From 2a7abb5a0b35ca8f7c9f8113322fbff87b5d6667 Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Mon, 8 Jul 2013 14:24:16 -0700 Subject: [PATCH 001/359] fput: turn "list_head delayed_fput_list" into llist_head commit 4f5e65a1cc90bbb15b9f6cdc362922af1bcc155a upstream. fput() and delayed_fput() can use llist and avoid the locking. This is unlikely path, it is not that this change can improve the performance, but this way the code looks simpler. Signed-off-by: Oleg Nesterov Suggested-by: Andrew Morton Cc: Al Viro Cc: Andrey Vagin Cc: "Eric W. Biederman" Cc: David Howells Cc: Huang Ying Cc: Peter Zijlstra Signed-off-by: Andrew Morton Signed-off-by: Al Viro Signed-off-by: Wang Kai Signed-off-by: Greg Kroah-Hartman --- fs/file_table.c | 25 ++++++++++--------------- include/linux/fs.h | 2 ++ 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/fs/file_table.c b/fs/file_table.c index 54a34be444f904..cd4ef34bb641fa 100644 --- a/fs/file_table.c +++ b/fs/file_table.c @@ -265,18 +265,15 @@ static void __fput(struct file *file) mntput(mnt); } -static DEFINE_SPINLOCK(delayed_fput_lock); -static LIST_HEAD(delayed_fput_list); +static LLIST_HEAD(delayed_fput_list); static void delayed_fput(struct work_struct *unused) { - LIST_HEAD(head); - spin_lock_irq(&delayed_fput_lock); - list_splice_init(&delayed_fput_list, &head); - spin_unlock_irq(&delayed_fput_lock); - while (!list_empty(&head)) { - struct file *f = list_first_entry(&head, struct file, f_u.fu_list); - list_del_init(&f->f_u.fu_list); - __fput(f); + struct llist_node *node = llist_del_all(&delayed_fput_list); + struct llist_node *next; + + for (; node; node = next) { + next = llist_next(node); + __fput(llist_entry(node, struct file, f_u.fu_llist)); } } @@ -306,7 +303,6 @@ void fput(struct file *file) { if (atomic_long_dec_and_test(&file->f_count)) { struct task_struct *task = current; - unsigned long flags; file_sb_list_del(file); if (likely(!in_interrupt() && !(task->flags & PF_KTHREAD))) { @@ -314,10 +310,9 @@ void fput(struct file *file) if (!task_work_add(task, &file->f_u.fu_rcuhead, true)) return; } - spin_lock_irqsave(&delayed_fput_lock, flags); - list_add(&file->f_u.fu_list, &delayed_fput_list); - schedule_work(&delayed_fput_work); - spin_unlock_irqrestore(&delayed_fput_lock, flags); + + if (llist_add(&file->f_u.fu_llist, &delayed_fput_list)) + schedule_work(&delayed_fput_work); } } diff --git a/include/linux/fs.h b/include/linux/fs.h index d57bc5df7225af..f45857a7ac494b 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -767,6 +768,7 @@ struct file { */ union { struct list_head fu_list; + struct llist_node fu_llist; struct rcu_head fu_rcuhead; } f_u; struct path f_path; From 68c8a7ae3030f73631a98d4d9ee16e31cba0c1b5 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Fri, 4 Oct 2013 11:06:42 -0400 Subject: [PATCH 002/359] get rid of s_files and files_lock commit eee5cc2702929fd41cce28058dc6d6717f723f87 upstream. The only thing we need it for is alt-sysrq-r (emergency remount r/o) and these days we can do just as well without going through the list of files. Signed-off-by: Al Viro [wangkai: backport to 3.10: adjust context] Signed-off-by: Wang Kai Signed-off-by: Greg Kroah-Hartman --- fs/file_table.c | 123 --------------------------------------------- fs/internal.h | 3 -- fs/open.c | 2 - fs/super.c | 23 +-------- include/linux/fs.h | 13 ----- 5 files changed, 2 insertions(+), 162 deletions(-) diff --git a/fs/file_table.c b/fs/file_table.c index cd4ef34bb641fa..28f02a7cbba189 100644 --- a/fs/file_table.c +++ b/fs/file_table.c @@ -36,8 +36,6 @@ struct files_stat_struct files_stat = { .max_files = NR_FILE }; -DEFINE_STATIC_LGLOCK(files_lglock); - /* SLAB cache for file structures */ static struct kmem_cache *filp_cachep __read_mostly; @@ -134,7 +132,6 @@ struct file *get_empty_filp(void) return ERR_PTR(error); } - INIT_LIST_HEAD(&f->f_u.fu_list); atomic_long_set(&f->f_count, 1); rwlock_init(&f->f_owner.lock); spin_lock_init(&f->f_lock); @@ -304,7 +301,6 @@ void fput(struct file *file) if (atomic_long_dec_and_test(&file->f_count)) { struct task_struct *task = current; - file_sb_list_del(file); if (likely(!in_interrupt() && !(task->flags & PF_KTHREAD))) { init_task_work(&file->f_u.fu_rcuhead, ____fput); if (!task_work_add(task, &file->f_u.fu_rcuhead, true)) @@ -328,7 +324,6 @@ void __fput_sync(struct file *file) { if (atomic_long_dec_and_test(&file->f_count)) { struct task_struct *task = current; - file_sb_list_del(file); BUG_ON(!(task->flags & PF_KTHREAD)); __fput(file); } @@ -340,127 +335,10 @@ void put_filp(struct file *file) { if (atomic_long_dec_and_test(&file->f_count)) { security_file_free(file); - file_sb_list_del(file); file_free(file); } } -static inline int file_list_cpu(struct file *file) -{ -#ifdef CONFIG_SMP - return file->f_sb_list_cpu; -#else - return smp_processor_id(); -#endif -} - -/* helper for file_sb_list_add to reduce ifdefs */ -static inline void __file_sb_list_add(struct file *file, struct super_block *sb) -{ - struct list_head *list; -#ifdef CONFIG_SMP - int cpu; - cpu = smp_processor_id(); - file->f_sb_list_cpu = cpu; - list = per_cpu_ptr(sb->s_files, cpu); -#else - list = &sb->s_files; -#endif - list_add(&file->f_u.fu_list, list); -} - -/** - * file_sb_list_add - add a file to the sb's file list - * @file: file to add - * @sb: sb to add it to - * - * Use this function to associate a file with the superblock of the inode it - * refers to. - */ -void file_sb_list_add(struct file *file, struct super_block *sb) -{ - lg_local_lock(&files_lglock); - __file_sb_list_add(file, sb); - lg_local_unlock(&files_lglock); -} - -/** - * file_sb_list_del - remove a file from the sb's file list - * @file: file to remove - * @sb: sb to remove it from - * - * Use this function to remove a file from its superblock. - */ -void file_sb_list_del(struct file *file) -{ - if (!list_empty(&file->f_u.fu_list)) { - lg_local_lock_cpu(&files_lglock, file_list_cpu(file)); - list_del_init(&file->f_u.fu_list); - lg_local_unlock_cpu(&files_lglock, file_list_cpu(file)); - } -} - -#ifdef CONFIG_SMP - -/* - * These macros iterate all files on all CPUs for a given superblock. - * files_lglock must be held globally. - */ -#define do_file_list_for_each_entry(__sb, __file) \ -{ \ - int i; \ - for_each_possible_cpu(i) { \ - struct list_head *list; \ - list = per_cpu_ptr((__sb)->s_files, i); \ - list_for_each_entry((__file), list, f_u.fu_list) - -#define while_file_list_for_each_entry \ - } \ -} - -#else - -#define do_file_list_for_each_entry(__sb, __file) \ -{ \ - struct list_head *list; \ - list = &(sb)->s_files; \ - list_for_each_entry((__file), list, f_u.fu_list) - -#define while_file_list_for_each_entry \ -} - -#endif - -/** - * mark_files_ro - mark all files read-only - * @sb: superblock in question - * - * All files are marked read-only. We don't care about pending - * delete files so this should be used in 'force' mode only. - */ -void mark_files_ro(struct super_block *sb) -{ - struct file *f; - - lg_global_lock(&files_lglock); - do_file_list_for_each_entry(sb, f) { - if (!S_ISREG(file_inode(f)->i_mode)) - continue; - if (!file_count(f)) - continue; - if (!(f->f_mode & FMODE_WRITE)) - continue; - spin_lock(&f->f_lock); - f->f_mode &= ~FMODE_WRITE; - spin_unlock(&f->f_lock); - if (file_check_writeable(f) != 0) - continue; - __mnt_drop_write(f->f_path.mnt); - file_release_write(f); - } while_file_list_for_each_entry; - lg_global_unlock(&files_lglock); -} - void __init files_init(unsigned long mempages) { unsigned long n; @@ -476,6 +354,5 @@ void __init files_init(unsigned long mempages) n = (mempages * (PAGE_SIZE / 1024)) / 10; files_stat.max_files = max_t(unsigned long, n, NR_FILE); files_defer_init(); - lg_lock_init(&files_lglock, "files_lglock"); percpu_counter_init(&nr_files, 0); } diff --git a/fs/internal.h b/fs/internal.h index 68121584ae37d4..2ffa65a36ca01d 100644 --- a/fs/internal.h +++ b/fs/internal.h @@ -74,9 +74,6 @@ extern void chroot_fs_refs(const struct path *, const struct path *); /* * file_table.c */ -extern void file_sb_list_add(struct file *f, struct super_block *sb); -extern void file_sb_list_del(struct file *f); -extern void mark_files_ro(struct super_block *); extern struct file *get_empty_filp(void); /* diff --git a/fs/open.c b/fs/open.c index 86092bde31f482..5f129683b7d7eb 100644 --- a/fs/open.c +++ b/fs/open.c @@ -674,7 +674,6 @@ static int do_dentry_open(struct file *f, } f->f_mapping = inode->i_mapping; - file_sb_list_add(f, inode->i_sb); if (unlikely(f->f_mode & FMODE_PATH)) { f->f_op = &empty_fops; @@ -709,7 +708,6 @@ static int do_dentry_open(struct file *f, cleanup_all: fops_put(f->f_op); - file_sb_list_del(f); if (f->f_mode & FMODE_WRITE) { if (!special_file(inode->i_mode)) { /* diff --git a/fs/super.c b/fs/super.c index e028b508db253e..97280e76179c5f 100644 --- a/fs/super.c +++ b/fs/super.c @@ -163,19 +163,6 @@ static struct super_block *alloc_super(struct file_system_type *type, int flags) s = NULL; goto out; } -#ifdef CONFIG_SMP - s->s_files = alloc_percpu(struct list_head); - if (!s->s_files) - goto err_out; - else { - int i; - - for_each_possible_cpu(i) - INIT_LIST_HEAD(per_cpu_ptr(s->s_files, i)); - } -#else - INIT_LIST_HEAD(&s->s_files); -#endif if (init_sb_writers(s, type)) goto err_out; s->s_flags = flags; @@ -225,10 +212,6 @@ static struct super_block *alloc_super(struct file_system_type *type, int flags) return s; err_out: security_sb_free(s); -#ifdef CONFIG_SMP - if (s->s_files) - free_percpu(s->s_files); -#endif destroy_sb_writers(s); kfree(s); s = NULL; @@ -243,9 +226,6 @@ static struct super_block *alloc_super(struct file_system_type *type, int flags) */ static inline void destroy_super(struct super_block *s) { -#ifdef CONFIG_SMP - free_percpu(s->s_files); -#endif destroy_sb_writers(s); security_sb_free(s); WARN_ON(!list_empty(&s->s_mounts)); @@ -727,7 +707,8 @@ int do_remount_sb(struct super_block *sb, int flags, void *data, int force) make sure there are no rw files opened */ if (remount_ro) { if (force) { - mark_files_ro(sb); + sb->s_readonly_remount = 1; + smp_wmb(); } else { retval = sb_prepare_remount_readonly(sb); if (retval) diff --git a/include/linux/fs.h b/include/linux/fs.h index f45857a7ac494b..5c9dc8471da5a9 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -762,12 +762,7 @@ static inline int ra_has_index(struct file_ra_state *ra, pgoff_t index) #define FILE_MNT_WRITE_RELEASED 2 struct file { - /* - * fu_list becomes invalid after file_free is called and queued via - * fu_rcuhead for RCU freeing - */ union { - struct list_head fu_list; struct llist_node fu_llist; struct rcu_head fu_rcuhead; } f_u; @@ -781,9 +776,6 @@ struct file { * Must not be taken from IRQ context. */ spinlock_t f_lock; -#ifdef CONFIG_SMP - int f_sb_list_cpu; -#endif atomic_long_t f_count; unsigned int f_flags; fmode_t f_mode; @@ -1259,11 +1251,6 @@ struct super_block { struct list_head s_inodes; /* all inodes */ struct hlist_bl_head s_anon; /* anonymous dentries for (nfs) exporting */ -#ifdef CONFIG_SMP - struct list_head __percpu *s_files; -#else - struct list_head s_files; -#endif struct list_head s_mounts; /* list of mounts; _not_ for fs use */ /* s_dentry_lru, s_nr_dentry_unused protected by dcache.c lru locks */ struct list_head s_dentry_lru; /* unused dentry lru */ From ff19fc34c96fa1e6eef703eccaaf14f47cfd08ce Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Fri, 17 Apr 2015 15:04:48 -0400 Subject: [PATCH 003/359] config: Enable NEED_DMA_MAP_STATE by default when SWIOTLB is selected commit a6dfa128ce5c414ab46b1d690f7a1b8decb8526d upstream. A huge amount of NIC drivers use the DMA API, however if compiled under 32-bit an very important part of the DMA API can be ommitted leading to the drivers not working at all (especially if used with 'swiotlb=force iommu=soft'). As Prashant Sreedharan explains it: "the driver [tg3] uses DEFINE_DMA_UNMAP_ADDR(), dma_unmap_addr_set() to keep a copy of the dma "mapping" and dma_unmap_addr() to get the "mapping" value. On most of the platforms this is a no-op, but ... with "iommu=soft and swiotlb=force" this house keeping is required, ... otherwise we pass 0 while calling pci_unmap_/pci_dma_sync_ instead of the DMA address." As such enable this even when using 32-bit kernels. Reported-by: Ian Jackson Signed-off-by: Konrad Rzeszutek Wilk Acked-by: David S. Miller Acked-by: Prashant Sreedharan Cc: Borislav Petkov Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Michael Chan Cc: Thomas Gleixner Cc: boris.ostrovsky@oracle.com Cc: cascardo@linux.vnet.ibm.com Cc: david.vrabel@citrix.com Cc: sanjeevb@broadcom.com Cc: siva.kallam@broadcom.com Cc: vyasevich@gmail.com Cc: xen-devel@lists.xensource.com Link: http://lkml.kernel.org/r/20150417190448.GA9462@l.oracle.com Signed-off-by: Ingo Molnar Cc: Ben Hutchings Signed-off-by: Greg Kroah-Hartman --- arch/x86/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 4e5b80d883c833..105ae30a176b90 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -154,7 +154,7 @@ config SBUS config NEED_DMA_MAP_STATE def_bool y - depends on X86_64 || INTEL_IOMMU || DMA_API_DEBUG + depends on X86_64 || INTEL_IOMMU || DMA_API_DEBUG || SWIOTLB config NEED_SG_DMA_LENGTH def_bool y From 59bc21951c78625486741b33eafdacbe57ce688d Mon Sep 17 00:00:00 2001 From: Chen Gang Date: Wed, 24 Dec 2014 23:04:54 +0800 Subject: [PATCH 004/359] netfilter: nfnetlink_cthelper: Remove 'const' and '&' to avoid warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit b18c5d15e8714336365d9d51782d5b53afa0443c upstream. The related code can be simplified, and also can avoid related warnings (with allmodconfig under parisc): CC [M] net/netfilter/nfnetlink_cthelper.o net/netfilter/nfnetlink_cthelper.c: In function ‘nfnl_cthelper_from_nlattr’: net/netfilter/nfnetlink_cthelper.c:97:9: warning: passing argument 1 o ‘memcpy’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-array-qualifiers] memcpy(&help->data, nla_data(attr), help->helper->data_len); ^ In file included from include/linux/string.h:17:0, from include/uapi/linux/uuid.h:25, from include/linux/uuid.h:23, from include/linux/mod_devicetable.h:12, from ./arch/parisc/include/asm/hardware.h:4, from ./arch/parisc/include/asm/processor.h:15, from ./arch/parisc/include/asm/spinlock.h:6, from ./arch/parisc/include/asm/atomic.h:21, from include/linux/atomic.h:4, from ./arch/parisc/include/asm/bitops.h:12, from include/linux/bitops.h:36, from include/linux/kernel.h:10, from include/linux/list.h:8, from include/linux/module.h:9, from net/netfilter/nfnetlink_cthelper.c:11: ./arch/parisc/include/asm/string.h:8:8: note: expected ‘void *’ but argument is of type ‘const char (*)[]’ void * memcpy(void * dest,const void *src,size_t count); ^ Signed-off-by: Chen Gang Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- net/netfilter/nfnetlink_cthelper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/netfilter/nfnetlink_cthelper.c b/net/netfilter/nfnetlink_cthelper.c index a191b6db657e5e..a9da433c8149a8 100644 --- a/net/netfilter/nfnetlink_cthelper.c +++ b/net/netfilter/nfnetlink_cthelper.c @@ -83,7 +83,7 @@ nfnl_cthelper_parse_tuple(struct nf_conntrack_tuple *tuple, static int nfnl_cthelper_from_nlattr(struct nlattr *attr, struct nf_conn *ct) { - const struct nf_conn_help *help = nfct_help(ct); + struct nf_conn_help *help = nfct_help(ct); if (attr == NULL) return -EINVAL; @@ -91,7 +91,7 @@ nfnl_cthelper_from_nlattr(struct nlattr *attr, struct nf_conn *ct) if (help->helper->data_len == 0) return -EINVAL; - memcpy(&help->data, nla_data(attr), help->helper->data_len); + memcpy(help->data, nla_data(attr), help->helper->data_len); return 0; } From 7c6300bb4934b8f9f881b1645c087b2ddba922f9 Mon Sep 17 00:00:00 2001 From: Ian Wilson Date: Thu, 12 Mar 2015 09:37:58 +0000 Subject: [PATCH 005/359] netfilter: Zero the tuple in nfnl_cthelper_parse_tuple() commit 78146572b9cd20452da47951812f35b1ad4906be upstream. nfnl_cthelper_parse_tuple() is called from nfnl_cthelper_new(), nfnl_cthelper_get() and nfnl_cthelper_del(). In each case they pass a pointer to an nf_conntrack_tuple data structure local variable: struct nf_conntrack_tuple tuple; ... ret = nfnl_cthelper_parse_tuple(&tuple, tb[NFCTH_TUPLE]); The problem is that this local variable is not initialized, and nfnl_cthelper_parse_tuple() only initializes two fields: src.l3num and dst.protonum. This leaves all other fields with undefined values based on whatever is on the stack: tuple->src.l3num = ntohs(nla_get_be16(tb[NFCTH_TUPLE_L3PROTONUM])); tuple->dst.protonum = nla_get_u8(tb[NFCTH_TUPLE_L4PROTONUM]); The symptom observed was that when the rpc and tns helpers were added then traffic to port 1536 was being sent to user-space. Signed-off-by: Ian Wilson Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- net/netfilter/nfnetlink_cthelper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/netfilter/nfnetlink_cthelper.c b/net/netfilter/nfnetlink_cthelper.c index a9da433c8149a8..3b283edec0273e 100644 --- a/net/netfilter/nfnetlink_cthelper.c +++ b/net/netfilter/nfnetlink_cthelper.c @@ -74,6 +74,9 @@ nfnl_cthelper_parse_tuple(struct nf_conntrack_tuple *tuple, if (!tb[NFCTH_TUPLE_L3PROTONUM] || !tb[NFCTH_TUPLE_L4PROTONUM]) return -EINVAL; + /* Not all fields are initialized so first zero the tuple */ + memset(tuple, 0, sizeof(struct nf_conntrack_tuple)); + tuple->src.l3num = ntohs(nla_get_be16(tb[NFCTH_TUPLE_L3PROTONUM])); tuple->dst.protonum = nla_get_u8(tb[NFCTH_TUPLE_L4PROTONUM]); From 434c32f798d372fbeff6258a1178dbeb41d960d4 Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Wed, 11 Sep 2013 14:20:06 -0700 Subject: [PATCH 006/359] include/linux/sched.h: don't use task->pid/tgid in same_thread_group/has_group_leader_pid commit e1403b8edf669ff49bbdf602cc97fefa2760cb15 upstream. task_struct->pid/tgid should go away. 1. Change same_thread_group() to use task->signal for comparison. 2. Change has_group_leader_pid(task) to compare task_pid(task) with signal->leader_pid. Signed-off-by: Oleg Nesterov Cc: Michal Hocko Cc: Sergey Dyasly Reviewed-by: "Eric W. Biederman" Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Peter Zijlstra Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- include/linux/sched.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/sched.h b/include/linux/sched.h index 00c1d4f450727e..7cf305d036db68 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -2203,15 +2203,15 @@ static inline bool thread_group_leader(struct task_struct *p) * all we care about is that we have a task with the appropriate * pid, we don't actually care if we have the right task. */ -static inline int has_group_leader_pid(struct task_struct *p) +static inline bool has_group_leader_pid(struct task_struct *p) { - return p->pid == p->tgid; + return task_pid(p) == p->signal->leader_pid; } static inline -int same_thread_group(struct task_struct *p1, struct task_struct *p2) +bool same_thread_group(struct task_struct *p1, struct task_struct *p2) { - return p1->tgid == p2->tgid; + return p1->signal == p2->signal; } static inline struct task_struct *next_thread(const struct task_struct *p) From a20cc70d1e37617c25c336ec036186d369946765 Mon Sep 17 00:00:00 2001 From: Mark Grondona Date: Wed, 11 Sep 2013 14:24:31 -0700 Subject: [PATCH 007/359] __ptrace_may_access() should not deny sub-threads commit 73af963f9f3036dffed55c3a2898598186db1045 upstream. __ptrace_may_access() checks get_dumpable/ptrace_has_cap/etc if task != current, this can can lead to surprising results. For example, a sub-thread can't readlink("/proc/self/exe") if the executable is not readable. setup_new_exec()->would_dump() notices that inode_permission(MAY_READ) fails and then it does set_dumpable(suid_dumpable). After that get_dumpable() fails. (It is not clear why proc_pid_readlink() checks get_dumpable(), perhaps we could add PTRACE_MODE_NODUMPABLE) Change __ptrace_may_access() to use same_thread_group() instead of "task == current". Any security check is pointless when the tasks share the same ->mm. Signed-off-by: Mark Grondona Signed-off-by: Ben Woodard Signed-off-by: Oleg Nesterov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- kernel/ptrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/ptrace.c b/kernel/ptrace.c index 118323bc852982..30ab20623bcafc 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c @@ -236,7 +236,7 @@ static int __ptrace_may_access(struct task_struct *task, unsigned int mode) */ int dumpable = 0; /* Don't let security modules deny introspection */ - if (task == current) + if (same_thread_group(task, current)) return 0; rcu_read_lock(); tcred = __task_cred(task); From 4dce4607145619ed563859413db8374c270319f6 Mon Sep 17 00:00:00 2001 From: Lv Zheng Date: Mon, 13 Apr 2015 11:48:46 +0800 Subject: [PATCH 008/359] ACPICA: Utilities: Cleanup to convert physical address printing formats. commit cc2080b0e5a7c6c33ef5e9ffccbc2b8f6f861393 upstream. ACPICA commit 7f06739db43a85083a70371c14141008f20b2198 For physical addresses, since the address may exceed 32-bit address range after calculation, we should use %8.8X%8.8X (see ACPI_FORMAT_UINT64()) to convert the %p formats. This is a preparation to switch acpi_physical_address to 64-bit on 32-bit kernel builds. Link: https://github.com/acpica/acpica/commit/7f06739d Signed-off-by: Lv Zheng Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki Signed-off-by: Dirk Behme [gdavis: Move tbinstall.c changes to tbutils.c due to lack of commit "42f4786 ACPICA: Split table print utilities to a new a separate file" in linux-3.10.y] Signed-off-by: George G. Davis Signed-off-by: Greg Kroah-Hartman --- drivers/acpi/acpica/exfldio.c | 10 ++++------ drivers/acpi/acpica/hwvalid.c | 16 ++++++++-------- drivers/acpi/acpica/nsdump.c | 7 +++---- drivers/acpi/acpica/tbutils.c | 4 ++-- drivers/acpi/acpica/utaddress.c | 24 +++++++++++------------- 5 files changed, 28 insertions(+), 33 deletions(-) diff --git a/drivers/acpi/acpica/exfldio.c b/drivers/acpi/acpica/exfldio.c index c84ee956fa4c58..dc210c3792778e 100644 --- a/drivers/acpi/acpica/exfldio.c +++ b/drivers/acpi/acpica/exfldio.c @@ -269,17 +269,15 @@ acpi_ex_access_region(union acpi_operand_object *obj_desc, } ACPI_DEBUG_PRINT_RAW((ACPI_DB_BFIELD, - " Region [%s:%X], Width %X, ByteBase %X, Offset %X at %p\n", + " Region [%s:%X], Width %X, ByteBase %X, Offset %X at %8.8X%8.8X\n", acpi_ut_get_region_name(rgn_desc->region. space_id), rgn_desc->region.space_id, obj_desc->common_field.access_byte_width, obj_desc->common_field.base_byte_offset, - field_datum_byte_offset, ACPI_CAST_PTR(void, - (rgn_desc-> - region. - address + - region_offset)))); + field_datum_byte_offset, + ACPI_FORMAT_UINT64(rgn_desc->region.address + + region_offset))); /* Invoke the appropriate address_space/op_region handler */ diff --git a/drivers/acpi/acpica/hwvalid.c b/drivers/acpi/acpica/hwvalid.c index eab70d58852a67..fae57584a182c1 100644 --- a/drivers/acpi/acpica/hwvalid.c +++ b/drivers/acpi/acpica/hwvalid.c @@ -142,17 +142,17 @@ acpi_hw_validate_io_request(acpi_io_address address, u32 bit_width) byte_width = ACPI_DIV_8(bit_width); last_address = address + byte_width - 1; - ACPI_DEBUG_PRINT((ACPI_DB_IO, "Address %p LastAddress %p Length %X", - ACPI_CAST_PTR(void, address), ACPI_CAST_PTR(void, - last_address), - byte_width)); + ACPI_DEBUG_PRINT((ACPI_DB_IO, + "Address %8.8X%8.8X LastAddress %8.8X%8.8X Length %X", + ACPI_FORMAT_UINT64(address), + ACPI_FORMAT_UINT64(last_address), byte_width)); /* Maximum 16-bit address in I/O space */ if (last_address > ACPI_UINT16_MAX) { ACPI_ERROR((AE_INFO, - "Illegal I/O port address/length above 64K: %p/0x%X", - ACPI_CAST_PTR(void, address), byte_width)); + "Illegal I/O port address/length above 64K: %8.8X%8.8X/0x%X", + ACPI_FORMAT_UINT64(address), byte_width)); return_ACPI_STATUS(AE_LIMIT); } @@ -181,8 +181,8 @@ acpi_hw_validate_io_request(acpi_io_address address, u32 bit_width) if (acpi_gbl_osi_data >= port_info->osi_dependency) { ACPI_DEBUG_PRINT((ACPI_DB_IO, - "Denied AML access to port 0x%p/%X (%s 0x%.4X-0x%.4X)", - ACPI_CAST_PTR(void, address), + "Denied AML access to port 0x%8.8X%8.8X/%X (%s 0x%.4X-0x%.4X)", + ACPI_FORMAT_UINT64(address), byte_width, port_info->name, port_info->start, port_info->end)); diff --git a/drivers/acpi/acpica/nsdump.c b/drivers/acpi/acpica/nsdump.c index ce6e9732620523..d6651e701a71fc 100644 --- a/drivers/acpi/acpica/nsdump.c +++ b/drivers/acpi/acpica/nsdump.c @@ -258,12 +258,11 @@ acpi_ns_dump_one_object(acpi_handle obj_handle, switch (type) { case ACPI_TYPE_PROCESSOR: - acpi_os_printf("ID %02X Len %02X Addr %p\n", + acpi_os_printf("ID %02X Len %02X Addr %8.8X%8.8X\n", obj_desc->processor.proc_id, obj_desc->processor.length, - ACPI_CAST_PTR(void, - obj_desc->processor. - address)); + ACPI_FORMAT_UINT64(obj_desc->processor. + address)); break; case ACPI_TYPE_DEVICE: diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c index ce3d5db39a9c74..45c4474c35b60f 100644 --- a/drivers/acpi/acpica/tbutils.c +++ b/drivers/acpi/acpica/tbutils.c @@ -474,8 +474,8 @@ acpi_tb_install_table(acpi_physical_address address, table = acpi_os_map_memory(address, sizeof(struct acpi_table_header)); if (!table) { ACPI_ERROR((AE_INFO, - "Could not map memory for table [%s] at %p", - signature, ACPI_CAST_PTR(void, address))); + "Could not map memory for table [%s] at %8.8X%8.8X", + signature, ACPI_FORMAT_UINT64(address))); return; } diff --git a/drivers/acpi/acpica/utaddress.c b/drivers/acpi/acpica/utaddress.c index e0a2e2779c2ed8..3c7770d75773de 100644 --- a/drivers/acpi/acpica/utaddress.c +++ b/drivers/acpi/acpica/utaddress.c @@ -107,10 +107,10 @@ acpi_ut_add_address_range(acpi_adr_space_type space_id, acpi_gbl_address_range_list[space_id] = range_info; ACPI_DEBUG_PRINT((ACPI_DB_NAMES, - "\nAdded [%4.4s] address range: 0x%p-0x%p\n", + "\nAdded [%4.4s] address range: 0x%8.8X%8.8X-0x%8.8X%8.8X\n", acpi_ut_get_node_name(range_info->region_node), - ACPI_CAST_PTR(void, address), - ACPI_CAST_PTR(void, range_info->end_address))); + ACPI_FORMAT_UINT64(address), + ACPI_FORMAT_UINT64(range_info->end_address))); (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); return_ACPI_STATUS(AE_OK); @@ -160,15 +160,13 @@ acpi_ut_remove_address_range(acpi_adr_space_type space_id, } ACPI_DEBUG_PRINT((ACPI_DB_NAMES, - "\nRemoved [%4.4s] address range: 0x%p-0x%p\n", + "\nRemoved [%4.4s] address range: 0x%8.8X%8.8X-0x%8.8X%8.8X\n", acpi_ut_get_node_name(range_info-> region_node), - ACPI_CAST_PTR(void, - range_info-> - start_address), - ACPI_CAST_PTR(void, - range_info-> - end_address))); + ACPI_FORMAT_UINT64(range_info-> + start_address), + ACPI_FORMAT_UINT64(range_info-> + end_address))); ACPI_FREE(range_info); return_VOID; @@ -244,9 +242,9 @@ acpi_ut_check_address_range(acpi_adr_space_type space_id, region_node); ACPI_WARNING((AE_INFO, - "0x%p-0x%p %s conflicts with Region %s %d", - ACPI_CAST_PTR(void, address), - ACPI_CAST_PTR(void, end_address), + "0x%8.8X%8.8X-0x%8.8X%8.8X %s conflicts with Region %s %d", + ACPI_FORMAT_UINT64(address), + ACPI_FORMAT_UINT64(end_address), acpi_ut_get_region_name(space_id), pathname, overlap_count)); ACPI_FREE(pathname); From a2dac7a1d62f940989d3695d44d04afef4d291f6 Mon Sep 17 00:00:00 2001 From: Lv Zheng Date: Mon, 13 Apr 2015 11:48:52 +0800 Subject: [PATCH 009/359] ACPICA: Utilities: Cleanup to remove useless ACPI_PRINTF/FORMAT_xxx helpers. commit 1d0a0b2f6df2bf2643fadc990eb143361eca6ada upstream. ACPICA commit b60612373a4ef63b64a57c124576d7ddb6d8efb6 For physical addresses, since the address may exceed 32-bit address range after calculation, we should use 0x%8.8X%8.8X instead of ACPI_PRINTF_UINT and ACPI_FORMAT_UINT64() instead of ACPI_FORMAT_NATIVE_UINT()/ACPI_FORMAT_TO_UINT(). This patch also removes above replaced macros as there are no users. This is a preparation to switch acpi_physical_address to 64-bit on 32-bit kernel builds. Link: https://github.com/acpica/acpica/commit/b6061237 Signed-off-by: Lv Zheng Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki Signed-off-by: Dirk Behme [gdavis: Move tbprint.c changes to tbutils.c due to lack of commit "42f4786 ACPICA: Split table print utilities to a new a separate file" in linux-3.10.y] Signed-off-by: George G. Davis Signed-off-by: Greg Kroah-Hartman --- drivers/acpi/acpica/acmacros.h | 10 +++------- drivers/acpi/acpica/dsopcode.c | 4 ++-- drivers/acpi/acpica/evregion.c | 2 +- drivers/acpi/acpica/exdump.c | 4 ++-- drivers/acpi/acpica/exregion.c | 8 +++----- drivers/acpi/acpica/nsdump.c | 5 +++-- drivers/acpi/acpica/tbutils.c | 16 ++++++---------- 7 files changed, 20 insertions(+), 29 deletions(-) diff --git a/drivers/acpi/acpica/acmacros.h b/drivers/acpi/acpica/acmacros.h index 53666bd9193d5c..32b0bf32364ad4 100644 --- a/drivers/acpi/acpica/acmacros.h +++ b/drivers/acpi/acpica/acmacros.h @@ -63,19 +63,15 @@ #define ACPI_SET64(ptr, val) (*ACPI_CAST64 (ptr) = (u64) (val)) /* - * printf() format helpers + * printf() format helper. This macros is a workaround for the difficulties + * with emitting 64-bit integers and 64-bit pointers with the same code + * for both 32-bit and 64-bit hosts. */ /* Split 64-bit integer into two 32-bit values. Use with %8.8X%8.8X */ #define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i), ACPI_LODWORD(i) -#if ACPI_MACHINE_WIDTH == 64 -#define ACPI_FORMAT_NATIVE_UINT(i) ACPI_FORMAT_UINT64(i) -#else -#define ACPI_FORMAT_NATIVE_UINT(i) 0, (i) -#endif - /* * Macros for moving data around to/from buffers that are possibly unaligned. * If the hardware supports the transfer of unaligned data, just do the store. diff --git a/drivers/acpi/acpica/dsopcode.c b/drivers/acpi/acpica/dsopcode.c index e9b13b92ba1e8d..46a37aeaedae0c 100644 --- a/drivers/acpi/acpica/dsopcode.c +++ b/drivers/acpi/acpica/dsopcode.c @@ -446,7 +446,7 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state, ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n", obj_desc, - ACPI_FORMAT_NATIVE_UINT(obj_desc->region.address), + ACPI_FORMAT_UINT64(obj_desc->region.address), obj_desc->region.length)); /* Now the address and length are valid for this opregion */ @@ -544,7 +544,7 @@ acpi_ds_eval_table_region_operands(struct acpi_walk_state *walk_state, ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n", obj_desc, - ACPI_FORMAT_NATIVE_UINT(obj_desc->region.address), + ACPI_FORMAT_UINT64(obj_desc->region.address), obj_desc->region.length)); /* Now the address and length are valid for this opregion */ diff --git a/drivers/acpi/acpica/evregion.c b/drivers/acpi/acpica/evregion.c index 8fab9262d98afc..ad698893e82929 100644 --- a/drivers/acpi/acpica/evregion.c +++ b/drivers/acpi/acpica/evregion.c @@ -276,7 +276,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, ACPI_DEBUG_PRINT((ACPI_DB_OPREGION, "Handler %p (@%p) Address %8.8X%8.8X [%s]\n", ®ion_obj->region.handler->address_space, handler, - ACPI_FORMAT_NATIVE_UINT(address), + ACPI_FORMAT_UINT64(address), acpi_ut_get_region_name(region_obj->region. space_id))); diff --git a/drivers/acpi/acpica/exdump.c b/drivers/acpi/acpica/exdump.c index e5a3c249f7fad2..7e6a56fe1d6e0d 100644 --- a/drivers/acpi/acpica/exdump.c +++ b/drivers/acpi/acpica/exdump.c @@ -621,8 +621,8 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth) acpi_os_printf("\n"); } else { acpi_os_printf(" base %8.8X%8.8X Length %X\n", - ACPI_FORMAT_NATIVE_UINT(obj_desc->region. - address), + ACPI_FORMAT_UINT64(obj_desc->region. + address), obj_desc->region.length); } break; diff --git a/drivers/acpi/acpica/exregion.c b/drivers/acpi/acpica/exregion.c index 182abaf045e165..e90c59d35a1692 100644 --- a/drivers/acpi/acpica/exregion.c +++ b/drivers/acpi/acpica/exregion.c @@ -176,7 +176,7 @@ acpi_ex_system_memory_space_handler(u32 function, if (!mem_info->mapped_logical_address) { ACPI_ERROR((AE_INFO, "Could not map memory at 0x%8.8X%8.8X, size %u", - ACPI_FORMAT_NATIVE_UINT(address), + ACPI_FORMAT_UINT64(address), (u32) map_length)); mem_info->mapped_length = 0; return_ACPI_STATUS(AE_NO_MEMORY); @@ -197,8 +197,7 @@ acpi_ex_system_memory_space_handler(u32 function, ACPI_DEBUG_PRINT((ACPI_DB_INFO, "System-Memory (width %u) R/W %u Address=%8.8X%8.8X\n", - bit_width, function, - ACPI_FORMAT_NATIVE_UINT(address))); + bit_width, function, ACPI_FORMAT_UINT64(address))); /* * Perform the memory read or write @@ -300,8 +299,7 @@ acpi_ex_system_io_space_handler(u32 function, ACPI_DEBUG_PRINT((ACPI_DB_INFO, "System-IO (width %u) R/W %u Address=%8.8X%8.8X\n", - bit_width, function, - ACPI_FORMAT_NATIVE_UINT(address))); + bit_width, function, ACPI_FORMAT_UINT64(address))); /* Decode the function parameter */ diff --git a/drivers/acpi/acpica/nsdump.c b/drivers/acpi/acpica/nsdump.c index d6651e701a71fc..20ae5b9bb9f2de 100644 --- a/drivers/acpi/acpica/nsdump.c +++ b/drivers/acpi/acpica/nsdump.c @@ -333,8 +333,9 @@ acpi_ns_dump_one_object(acpi_handle obj_handle, space_id)); if (obj_desc->region.flags & AOPOBJ_DATA_VALID) { acpi_os_printf(" Addr %8.8X%8.8X Len %.4X\n", - ACPI_FORMAT_NATIVE_UINT - (obj_desc->region.address), + ACPI_FORMAT_UINT64(obj_desc-> + region. + address), obj_desc->region.length); } else { acpi_os_printf diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c index 45c4474c35b60f..5c67b2840c5862 100644 --- a/drivers/acpi/acpica/tbutils.c +++ b/drivers/acpi/acpica/tbutils.c @@ -246,16 +246,12 @@ acpi_tb_print_table_header(acpi_physical_address address, { struct acpi_table_header local_header; - /* - * The reason that the Address is cast to a void pointer is so that we - * can use %p which will work properly on both 32-bit and 64-bit hosts. - */ if (ACPI_COMPARE_NAME(header->signature, ACPI_SIG_FACS)) { /* FACS only has signature and length fields */ - ACPI_INFO((AE_INFO, "%4.4s %p %05X", - header->signature, ACPI_CAST_PTR(void, address), + ACPI_INFO((AE_INFO, "%4.4s 0x%8.8X%8.8X %05X", + header->signature, ACPI_FORMAT_UINT64(address), header->length)); } else if (ACPI_COMPARE_NAME(header->signature, ACPI_SIG_RSDP)) { @@ -266,8 +262,8 @@ acpi_tb_print_table_header(acpi_physical_address address, header)->oem_id, ACPI_OEM_ID_SIZE); acpi_tb_fix_string(local_header.oem_id, ACPI_OEM_ID_SIZE); - ACPI_INFO((AE_INFO, "RSDP %p %05X (v%.2d %6.6s)", - ACPI_CAST_PTR (void, address), + ACPI_INFO((AE_INFO, "RSDP 0x%8.8X%8.8X %05X (v%.2d %6.6s)", + ACPI_FORMAT_UINT64(address), (ACPI_CAST_PTR(struct acpi_table_rsdp, header)-> revision > 0) ? ACPI_CAST_PTR(struct acpi_table_rsdp, @@ -281,8 +277,8 @@ acpi_tb_print_table_header(acpi_physical_address address, acpi_tb_cleanup_table_header(&local_header, header); ACPI_INFO((AE_INFO, - "%4.4s %p %05X (v%.2d %6.6s %8.8s %08X %4.4s %08X)", - local_header.signature, ACPI_CAST_PTR(void, address), + "%-4.4s 0x%8.8X%8.8X %05X (v%.2d %-6.6s %-8.8s %08X %-4.4s %08X)", + local_header.signature, ACPI_FORMAT_UINT64(address), local_header.length, local_header.revision, local_header.oem_id, local_header.oem_table_id, local_header.oem_revision, From 29e7fa7cb70a5f4b0e934f80949d1f1c6a6dc0a6 Mon Sep 17 00:00:00 2001 From: Jim Snow Date: Tue, 18 Nov 2014 14:51:09 +0100 Subject: [PATCH 010/359] sb_edac: Fix erroneous bytes->gigabytes conversion commit 8c009100295597f23978c224aec5751a365bc965 upstream. Signed-off-by: Jim Snow Signed-off-by: Lukasz Anaczkowski Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Jiri Slaby Cc: Vinson Lee Signed-off-by: Greg Kroah-Hartman --- drivers/edac/sb_edac.c | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c index f505e4ca6d58ef..3bdefbfb437728 100644 --- a/drivers/edac/sb_edac.c +++ b/drivers/edac/sb_edac.c @@ -623,7 +623,7 @@ static void get_memory_layout(const struct mem_ctl_info *mci) u32 reg; u64 limit, prv = 0; u64 tmp_mb; - u32 mb, kb; + u32 gb, mb; u32 rir_way; /* @@ -636,8 +636,9 @@ static void get_memory_layout(const struct mem_ctl_info *mci) pvt->tolm = GET_TOLM(reg); tmp_mb = (1 + pvt->tolm) >> 20; - mb = div_u64_rem(tmp_mb, 1000, &kb); - edac_dbg(0, "TOLM: %u.%03u GB (0x%016Lx)\n", mb, kb, (u64)pvt->tolm); + gb = div_u64_rem(tmp_mb, 1024, &mb); + edac_dbg(0, "TOLM: %u.%03u GB (0x%016Lx)\n", + gb, (mb*1000)/1024, (u64)pvt->tolm); /* Address range is already 45:25 */ pci_read_config_dword(pvt->pci_sad1, TOHM, @@ -645,8 +646,9 @@ static void get_memory_layout(const struct mem_ctl_info *mci) pvt->tohm = GET_TOHM(reg); tmp_mb = (1 + pvt->tohm) >> 20; - mb = div_u64_rem(tmp_mb, 1000, &kb); - edac_dbg(0, "TOHM: %u.%03u GB (0x%016Lx)\n", mb, kb, (u64)pvt->tohm); + gb = div_u64_rem(tmp_mb, 1024, &mb); + edac_dbg(0, "TOHM: %u.%03u GB (0x%016Lx)\n", + gb, (mb*1000)/1024, (u64)pvt->tohm); /* * Step 2) Get SAD range and SAD Interleave list @@ -668,11 +670,11 @@ static void get_memory_layout(const struct mem_ctl_info *mci) break; tmp_mb = (limit + 1) >> 20; - mb = div_u64_rem(tmp_mb, 1000, &kb); + gb = div_u64_rem(tmp_mb, 1024, &mb); edac_dbg(0, "SAD#%d %s up to %u.%03u GB (0x%016Lx) Interleave: %s reg=0x%08x\n", n_sads, get_dram_attr(reg), - mb, kb, + gb, (mb*1000)/1024, ((u64)tmp_mb) << 20L, INTERLEAVE_MODE(reg) ? "8:6" : "[8:6]XOR[18:16]", reg); @@ -702,9 +704,9 @@ static void get_memory_layout(const struct mem_ctl_info *mci) break; tmp_mb = (limit + 1) >> 20; - mb = div_u64_rem(tmp_mb, 1000, &kb); + gb = div_u64_rem(tmp_mb, 1024, &mb); edac_dbg(0, "TAD#%d: up to %u.%03u GB (0x%016Lx), socket interleave %d, memory interleave %d, TGT: %d, %d, %d, %d, reg=0x%08x\n", - n_tads, mb, kb, + n_tads, gb, (mb*1000)/1024, ((u64)tmp_mb) << 20L, (u32)TAD_SOCK(reg), (u32)TAD_CH(reg), @@ -727,10 +729,10 @@ static void get_memory_layout(const struct mem_ctl_info *mci) tad_ch_nilv_offset[j], ®); tmp_mb = TAD_OFFSET(reg) >> 20; - mb = div_u64_rem(tmp_mb, 1000, &kb); + gb = div_u64_rem(tmp_mb, 1024, &mb); edac_dbg(0, "TAD CH#%d, offset #%d: %u.%03u GB (0x%016Lx), reg=0x%08x\n", i, j, - mb, kb, + gb, (mb*1000)/1024, ((u64)tmp_mb) << 20L, reg); } @@ -752,10 +754,10 @@ static void get_memory_layout(const struct mem_ctl_info *mci) tmp_mb = RIR_LIMIT(reg) >> 20; rir_way = 1 << RIR_WAY(reg); - mb = div_u64_rem(tmp_mb, 1000, &kb); + gb = div_u64_rem(tmp_mb, 1024, &mb); edac_dbg(0, "CH#%d RIR#%d, limit: %u.%03u GB (0x%016Lx), way: %d, reg=0x%08x\n", i, j, - mb, kb, + gb, (mb*1000)/1024, ((u64)tmp_mb) << 20L, rir_way, reg); @@ -766,10 +768,10 @@ static void get_memory_layout(const struct mem_ctl_info *mci) ®); tmp_mb = RIR_OFFSET(reg) << 6; - mb = div_u64_rem(tmp_mb, 1000, &kb); + gb = div_u64_rem(tmp_mb, 1024, &mb); edac_dbg(0, "CH#%d RIR#%d INTL#%d, offset %u.%03u GB (0x%016Lx), tgt: %d, reg=0x%08x\n", i, j, k, - mb, kb, + gb, (mb*1000)/1024, ((u64)tmp_mb) << 20L, (u32)RIR_RNK_TGT(reg), reg); @@ -806,7 +808,7 @@ static int get_memory_error_data(struct mem_ctl_info *mci, u8 ch_way,sck_way; u32 tad_offset; u32 rir_way; - u32 mb, kb; + u32 mb, gb; u64 ch_addr, offset, limit, prv = 0; @@ -1022,10 +1024,10 @@ static int get_memory_error_data(struct mem_ctl_info *mci, continue; limit = RIR_LIMIT(reg); - mb = div_u64_rem(limit >> 20, 1000, &kb); + gb = div_u64_rem(limit >> 20, 1024, &mb); edac_dbg(0, "RIR#%d, limit: %u.%03u GB (0x%016Lx), way: %d\n", n_rir, - mb, kb, + gb, (mb*1000)/1024, limit, 1 << RIR_WAY(reg)); if (ch_addr <= limit) From 6a82524ebeb75562563192218e01462fb60c68f4 Mon Sep 17 00:00:00 2001 From: Tomas Henzl Date: Thu, 14 Aug 2014 16:12:39 +0200 Subject: [PATCH 011/359] hpsa: refine the pci enable/disable handling commit 132aa220b45d60e9b20def1e9d8be9422eed9616 upstream. When a second(kdump) kernel starts and the hard reset method is used the driver calls pci_disable_device without previously enabling it, so the kernel shows a warning - [ 16.876248] WARNING: at drivers/pci/pci.c:1431 pci_disable_device+0x84/0x90() [ 16.882686] Device hpsa disabling already-disabled device ... This patch fixes it, in addition to this I tried to balance also some other pairs of enable/disable device in the driver. Unfortunately I wasn't able to verify the functionality for the case of a sw reset, because of a lack of proper hw. Signed-off-by: Tomas Henzl Reviewed-by: Stephen M. Cameron Signed-off-by: Christoph Hellwig Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/hpsa.c | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 62ed744bbe06c4..28b6a2fde0ac7e 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -3898,10 +3898,6 @@ static int hpsa_kdump_hard_reset_controller(struct pci_dev *pdev) /* Save the PCI command register */ pci_read_config_word(pdev, 4, &command_register); - /* Turn the board off. This is so that later pci_restore_state() - * won't turn the board on before the rest of config space is ready. - */ - pci_disable_device(pdev); pci_save_state(pdev); /* find the first memory BAR, so we can find the cfg table */ @@ -3949,11 +3945,6 @@ static int hpsa_kdump_hard_reset_controller(struct pci_dev *pdev) goto unmap_cfgtable; pci_restore_state(pdev); - rc = pci_enable_device(pdev); - if (rc) { - dev_warn(&pdev->dev, "failed to enable device.\n"); - goto unmap_cfgtable; - } pci_write_config_word(pdev, 4, command_register); /* Some devices (notably the HP Smart Array 5i Controller) @@ -4448,6 +4439,23 @@ static int hpsa_init_reset_devices(struct pci_dev *pdev) if (!reset_devices) return 0; + /* kdump kernel is loading, we don't know in which state is + * the pci interface. The dev->enable_cnt is equal zero + * so we call enable+disable, wait a while and switch it on. + */ + rc = pci_enable_device(pdev); + if (rc) { + dev_warn(&pdev->dev, "Failed to enable PCI device\n"); + return -ENODEV; + } + pci_disable_device(pdev); + msleep(260); /* a randomly chosen number */ + rc = pci_enable_device(pdev); + if (rc) { + dev_warn(&pdev->dev, "failed to enable device.\n"); + return -ENODEV; + } + /* Reset the controller with a PCI power-cycle or via doorbell */ rc = hpsa_kdump_hard_reset_controller(pdev); @@ -4456,10 +4464,11 @@ static int hpsa_init_reset_devices(struct pci_dev *pdev) * "performant mode". Or, it might be 640x, which can't reset * due to concerns about shared bbwc between 6402/6404 pair. */ - if (rc == -ENOTSUPP) - return rc; /* just try to do the kdump anyhow. */ - if (rc) - return -ENODEV; + if (rc) { + if (rc != -ENOTSUPP) /* just try to do the kdump anyhow. */ + rc = -ENODEV; + goto out_disable; + } /* Now try to get the controller to respond to a no-op */ dev_warn(&pdev->dev, "Waiting for controller to respond to no-op\n"); @@ -4470,7 +4479,11 @@ static int hpsa_init_reset_devices(struct pci_dev *pdev) dev_warn(&pdev->dev, "no-op failed%s\n", (i < 11 ? "; re-trying" : "")); } - return 0; + +out_disable: + + pci_disable_device(pdev); + return rc; } static int hpsa_allocate_cmd_pool(struct ctlr_info *h) @@ -4613,6 +4626,7 @@ static void hpsa_undo_allocations_after_kdump_soft_reset(struct ctlr_info *h) iounmap(h->transtable); if (h->cfgtable) iounmap(h->cfgtable); + pci_disable_device(h->pdev); pci_release_regions(h->pdev); kfree(h); } From 31884f5463499bf023772ce94b003d40b5db08fc Mon Sep 17 00:00:00 2001 From: Tomas Henzl Date: Fri, 12 Sep 2014 14:44:15 +0200 Subject: [PATCH 012/359] hpsa: add missing pci_set_master in kdump path commit 859c75aba20264d87dd026bab0d0ca3bff385955 upstream. Add a call to pci_set_master(...) missing in the previous patch "hpsa: refine the pci enable/disable handling". Found thanks to Rob Elliot. Signed-off-by: Tomas Henzl Reviewed-by: Robert Elliott Tested-by: Robert Elliott Signed-off-by: Christoph Hellwig Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/hpsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 28b6a2fde0ac7e..a6cdf17e27dc6c 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -4455,7 +4455,7 @@ static int hpsa_init_reset_devices(struct pci_dev *pdev) dev_warn(&pdev->dev, "failed to enable device.\n"); return -ENODEV; } - + pci_set_master(pdev); /* Reset the controller with a PCI power-cycle or via doorbell */ rc = hpsa_kdump_hard_reset_controller(pdev); From 9eae8ac6ab40b896b472c526afe7847e798f4f36 Mon Sep 17 00:00:00 2001 From: Jann Horn Date: Sun, 19 Apr 2015 02:48:39 +0200 Subject: [PATCH 013/359] fs: take i_mutex during prepare_binprm for set[ug]id executables commit 8b01fc86b9f425899f8a3a8fc1c47d73c2c20543 upstream. This prevents a race between chown() and execve(), where chowning a setuid-user binary to root would momentarily make the binary setuid root. This patch was mostly written by Linus Torvalds. Signed-off-by: Jann Horn Signed-off-by: Linus Torvalds Signed-off-by: Charles Williams Signed-off-by: Jiri Slaby Signed-off-by: Sheng Yong Signed-off-by: Greg Kroah-Hartman --- fs/exec.c | 76 +++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 48 insertions(+), 28 deletions(-) diff --git a/fs/exec.c b/fs/exec.c index dd6aa61c85486b..acbd7ac2deda4c 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -1265,6 +1265,53 @@ static int check_unsafe_exec(struct linux_binprm *bprm) return res; } +static void bprm_fill_uid(struct linux_binprm *bprm) +{ + struct inode *inode; + unsigned int mode; + kuid_t uid; + kgid_t gid; + + /* clear any previous set[ug]id data from a previous binary */ + bprm->cred->euid = current_euid(); + bprm->cred->egid = current_egid(); + + if (bprm->file->f_path.mnt->mnt_flags & MNT_NOSUID) + return; + + if (current->no_new_privs) + return; + + inode = file_inode(bprm->file); + mode = ACCESS_ONCE(inode->i_mode); + if (!(mode & (S_ISUID|S_ISGID))) + return; + + /* Be careful if suid/sgid is set */ + mutex_lock(&inode->i_mutex); + + /* reload atomically mode/uid/gid now that lock held */ + mode = inode->i_mode; + uid = inode->i_uid; + gid = inode->i_gid; + mutex_unlock(&inode->i_mutex); + + /* We ignore suid/sgid if there are no mappings for them in the ns */ + if (!kuid_has_mapping(bprm->cred->user_ns, uid) || + !kgid_has_mapping(bprm->cred->user_ns, gid)) + return; + + if (mode & S_ISUID) { + bprm->per_clear |= PER_CLEAR_ON_SETID; + bprm->cred->euid = uid; + } + + if ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) { + bprm->per_clear |= PER_CLEAR_ON_SETID; + bprm->cred->egid = gid; + } +} + /* * Fill the binprm structure from the inode. * Check permissions, then read the first 128 (BINPRM_BUF_SIZE) bytes @@ -1273,39 +1320,12 @@ static int check_unsafe_exec(struct linux_binprm *bprm) */ int prepare_binprm(struct linux_binprm *bprm) { - umode_t mode; - struct inode * inode = file_inode(bprm->file); int retval; - mode = inode->i_mode; if (bprm->file->f_op == NULL) return -EACCES; - /* clear any previous set[ug]id data from a previous binary */ - bprm->cred->euid = current_euid(); - bprm->cred->egid = current_egid(); - - if (!(bprm->file->f_path.mnt->mnt_flags & MNT_NOSUID) && - !current->no_new_privs && - kuid_has_mapping(bprm->cred->user_ns, inode->i_uid) && - kgid_has_mapping(bprm->cred->user_ns, inode->i_gid)) { - /* Set-uid? */ - if (mode & S_ISUID) { - bprm->per_clear |= PER_CLEAR_ON_SETID; - bprm->cred->euid = inode->i_uid; - } - - /* Set-gid? */ - /* - * If setgid is set but no group execute bit then this - * is a candidate for mandatory locking, not a setgid - * executable. - */ - if ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) { - bprm->per_clear |= PER_CLEAR_ON_SETID; - bprm->cred->egid = inode->i_gid; - } - } + bprm_fill_uid(bprm); /* fill in binprm security blob */ retval = security_bprm_set_creds(bprm); From 66bd44e6a5c8f24805f94d19f943301d7a7f418e Mon Sep 17 00:00:00 2001 From: Quentin Casasnovas Date: Tue, 3 Feb 2015 13:00:22 +0100 Subject: [PATCH 014/359] x86/microcode/intel: Guard against stack overflow in the loader commit f84598bd7c851f8b0bf8cd0d7c3be0d73c432ff4 upstream. mc_saved_tmp is a static array allocated on the stack, we need to make sure mc_saved_count stays within its bounds, otherwise we're overflowing the stack in _save_mc(). A specially crafted microcode header could lead to a kernel crash or potentially kernel execution. Signed-off-by: Quentin Casasnovas Cc: "H. Peter Anvin" Cc: Fenghua Yu Link: http://lkml.kernel.org/r/1422964824-22056-1-git-send-email-quentin.casasnovas@oracle.com Signed-off-by: Borislav Petkov Signed-off-by: Jiri Slaby Signed-off-by: Sheng Yong Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/microcode_intel_early.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/microcode_intel_early.c b/arch/x86/kernel/microcode_intel_early.c index 2e9e12871c2b51..a883942aee44aa 100644 --- a/arch/x86/kernel/microcode_intel_early.c +++ b/arch/x86/kernel/microcode_intel_early.c @@ -321,7 +321,7 @@ get_matching_model_microcode(int cpu, unsigned long start, unsigned int mc_saved_count = mc_saved_data->mc_saved_count; int i; - while (leftover) { + while (leftover && mc_saved_count < ARRAY_SIZE(mc_saved_tmp)) { mc_header = (struct microcode_header_intel *)ucode_ptr; mc_size = get_totalsize(mc_header); From 43f2e3615d181a7028ab797114c5960977669b2a Mon Sep 17 00:00:00 2001 From: Filipe Manana Date: Sun, 9 Nov 2014 08:38:39 +0000 Subject: [PATCH 015/359] Btrfs: make xattr replace operations atomic commit 5f5bc6b1e2d5a6f827bc860ef2dc5b6f365d1339 upstream. Replacing a xattr consists of doing a lookup for its existing value, delete the current value from the respective leaf, release the search path and then finally insert the new value. This leaves a time window where readers (getxattr, listxattrs) won't see any value for the xattr. Xattrs are used to store ACLs, so this has security implications. This change also fixes 2 other existing issues which were: *) Deleting the old xattr value without verifying first if the new xattr will fit in the existing leaf item (in case multiple xattrs are packed in the same item due to name hash collision); *) Returning -EEXIST when the flag XATTR_CREATE is given and the xattr doesn't exist but we have have an existing item that packs muliple xattrs with the same name hash as the input xattr. In this case we should return ENOSPC. A test case for xfstests follows soon. Thanks to Alexandre Oliva for reporting the non-atomicity of the xattr replace implementation. Reported-by: Alexandre Oliva Signed-off-by: Filipe Manana Signed-off-by: Chris Mason [shengyong: backport to 3.10 - FIX: CVE-2014-9710 - adjust context - ASSERT() was added v3.12, so we do check with if statement - set the first parameter of btrfs_item_nr() as NULL, because it is not used, and is removed in v3.13 ] Signed-off-by: Sheng Yong Signed-off-by: Greg Kroah-Hartman --- fs/btrfs/ctree.c | 2 +- fs/btrfs/ctree.h | 5 ++ fs/btrfs/dir-item.c | 10 +-- fs/btrfs/xattr.c | 159 ++++++++++++++++++++++++++++---------------- 4 files changed, 111 insertions(+), 65 deletions(-) diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 7fb054ba1b6012..82f14a1da542ea 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -2769,7 +2769,7 @@ int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root */ if (!p->leave_spinning) btrfs_set_path_blocking(p); - if (ret < 0) + if (ret < 0 && !p->skip_release_on_error) btrfs_release_path(p); return ret; } diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index d6dd49b51ba8df..c19444e412be4e 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -586,6 +586,7 @@ struct btrfs_path { unsigned int skip_locking:1; unsigned int leave_spinning:1; unsigned int search_commit_root:1; + unsigned int skip_release_on_error:1; }; /* @@ -3406,6 +3407,10 @@ struct btrfs_dir_item *btrfs_lookup_xattr(struct btrfs_trans_handle *trans, int verify_dir_item(struct btrfs_root *root, struct extent_buffer *leaf, struct btrfs_dir_item *dir_item); +struct btrfs_dir_item *btrfs_match_dir_item_name(struct btrfs_root *root, + struct btrfs_path *path, + const char *name, + int name_len); /* orphan.c */ int btrfs_insert_orphan_item(struct btrfs_trans_handle *trans, diff --git a/fs/btrfs/dir-item.c b/fs/btrfs/dir-item.c index 79e594e341c7c7..6f61b9b1526f90 100644 --- a/fs/btrfs/dir-item.c +++ b/fs/btrfs/dir-item.c @@ -21,10 +21,6 @@ #include "hash.h" #include "transaction.h" -static struct btrfs_dir_item *btrfs_match_dir_item_name(struct btrfs_root *root, - struct btrfs_path *path, - const char *name, int name_len); - /* * insert a name into a directory, doing overflow properly if there is a hash * collision. data_size indicates how big the item inserted should be. On @@ -383,9 +379,9 @@ struct btrfs_dir_item *btrfs_lookup_xattr(struct btrfs_trans_handle *trans, * this walks through all the entries in a dir item and finds one * for a specific name. */ -static struct btrfs_dir_item *btrfs_match_dir_item_name(struct btrfs_root *root, - struct btrfs_path *path, - const char *name, int name_len) +struct btrfs_dir_item *btrfs_match_dir_item_name(struct btrfs_root *root, + struct btrfs_path *path, + const char *name, int name_len) { struct btrfs_dir_item *dir_item; unsigned long name_ptr; diff --git a/fs/btrfs/xattr.c b/fs/btrfs/xattr.c index 05740b9789e4f9..9cf20d63cc9987 100644 --- a/fs/btrfs/xattr.c +++ b/fs/btrfs/xattr.c @@ -27,6 +27,7 @@ #include "transaction.h" #include "xattr.h" #include "disk-io.h" +#include "locking.h" ssize_t __btrfs_getxattr(struct inode *inode, const char *name, @@ -89,7 +90,7 @@ static int do_setxattr(struct btrfs_trans_handle *trans, struct inode *inode, const char *name, const void *value, size_t size, int flags) { - struct btrfs_dir_item *di; + struct btrfs_dir_item *di = NULL; struct btrfs_root *root = BTRFS_I(inode)->root; struct btrfs_path *path; size_t name_len = strlen(name); @@ -101,84 +102,128 @@ static int do_setxattr(struct btrfs_trans_handle *trans, path = btrfs_alloc_path(); if (!path) return -ENOMEM; + path->skip_release_on_error = 1; + + if (!value) { + di = btrfs_lookup_xattr(trans, root, path, btrfs_ino(inode), + name, name_len, -1); + if (!di && (flags & XATTR_REPLACE)) + ret = -ENODATA; + else if (di) + ret = btrfs_delete_one_dir_name(trans, root, path, di); + goto out; + } + /* + * For a replace we can't just do the insert blindly. + * Do a lookup first (read-only btrfs_search_slot), and return if xattr + * doesn't exist. If it exists, fall down below to the insert/replace + * path - we can't race with a concurrent xattr delete, because the VFS + * locks the inode's i_mutex before calling setxattr or removexattr. + */ if (flags & XATTR_REPLACE) { - di = btrfs_lookup_xattr(trans, root, path, btrfs_ino(inode), name, - name_len, -1); - if (IS_ERR(di)) { - ret = PTR_ERR(di); - goto out; - } else if (!di) { + if(!mutex_is_locked(&inode->i_mutex)) { + pr_err("BTRFS: assertion failed: %s, file: %s, line: %d", + "mutex_is_locked(&inode->i_mutex)", __FILE__, + __LINE__); + BUG(); + } + di = btrfs_lookup_xattr(NULL, root, path, btrfs_ino(inode), + name, name_len, 0); + if (!di) { ret = -ENODATA; goto out; } - ret = btrfs_delete_one_dir_name(trans, root, path, di); - if (ret) - goto out; btrfs_release_path(path); + di = NULL; + } + ret = btrfs_insert_xattr_item(trans, root, path, btrfs_ino(inode), + name, name_len, value, size); + if (ret == -EOVERFLOW) { /* - * remove the attribute + * We have an existing item in a leaf, split_leaf couldn't + * expand it. That item might have or not a dir_item that + * matches our target xattr, so lets check. */ - if (!value) - goto out; - } else { - di = btrfs_lookup_xattr(NULL, root, path, btrfs_ino(inode), - name, name_len, 0); - if (IS_ERR(di)) { - ret = PTR_ERR(di); + ret = 0; + btrfs_assert_tree_locked(path->nodes[0]); + di = btrfs_match_dir_item_name(root, path, name, name_len); + if (!di && !(flags & XATTR_REPLACE)) { + ret = -ENOSPC; goto out; } - if (!di && !value) - goto out; - btrfs_release_path(path); + } else if (ret == -EEXIST) { + ret = 0; + di = btrfs_match_dir_item_name(root, path, name, name_len); + if(!di) { /* logic error */ + pr_err("BTRFS: assertion failed: %s, file: %s, line: %d", + "di", __FILE__, __LINE__); + BUG(); + } + } else if (ret) { + goto out; } -again: - ret = btrfs_insert_xattr_item(trans, root, path, btrfs_ino(inode), - name, name_len, value, size); - /* - * If we're setting an xattr to a new value but the new value is say - * exactly BTRFS_MAX_XATTR_SIZE, we could end up with EOVERFLOW getting - * back from split_leaf. This is because it thinks we'll be extending - * the existing item size, but we're asking for enough space to add the - * item itself. So if we get EOVERFLOW just set ret to EEXIST and let - * the rest of the function figure it out. - */ - if (ret == -EOVERFLOW) + if (di && (flags & XATTR_CREATE)) { ret = -EEXIST; + goto out; + } - if (ret == -EEXIST) { - if (flags & XATTR_CREATE) - goto out; + if (di) { /* - * We can't use the path we already have since we won't have the - * proper locking for a delete, so release the path and - * re-lookup to delete the thing. + * We're doing a replace, and it must be atomic, that is, at + * any point in time we have either the old or the new xattr + * value in the tree. We don't want readers (getxattr and + * listxattrs) to miss a value, this is specially important + * for ACLs. */ - btrfs_release_path(path); - di = btrfs_lookup_xattr(trans, root, path, btrfs_ino(inode), - name, name_len, -1); - if (IS_ERR(di)) { - ret = PTR_ERR(di); - goto out; - } else if (!di) { - /* Shouldn't happen but just in case... */ - btrfs_release_path(path); - goto again; + const int slot = path->slots[0]; + struct extent_buffer *leaf = path->nodes[0]; + const u16 old_data_len = btrfs_dir_data_len(leaf, di); + const u32 item_size = btrfs_item_size_nr(leaf, slot); + const u32 data_size = sizeof(*di) + name_len + size; + struct btrfs_item *item; + unsigned long data_ptr; + char *ptr; + + if (size > old_data_len) { + if (btrfs_leaf_free_space(root, leaf) < + (size - old_data_len)) { + ret = -ENOSPC; + goto out; + } } - ret = btrfs_delete_one_dir_name(trans, root, path, di); - if (ret) - goto out; + if (old_data_len + name_len + sizeof(*di) == item_size) { + /* No other xattrs packed in the same leaf item. */ + if (size > old_data_len) + btrfs_extend_item(root, path, + size - old_data_len); + else if (size < old_data_len) + btrfs_truncate_item(root, path, data_size, 1); + } else { + /* There are other xattrs packed in the same item. */ + ret = btrfs_delete_one_dir_name(trans, root, path, di); + if (ret) + goto out; + btrfs_extend_item(root, path, data_size); + } + item = btrfs_item_nr(NULL, slot); + ptr = btrfs_item_ptr(leaf, slot, char); + ptr += btrfs_item_size(leaf, item) - data_size; + di = (struct btrfs_dir_item *)ptr; + btrfs_set_dir_data_len(leaf, di, size); + data_ptr = ((unsigned long)(di + 1)) + name_len; + write_extent_buffer(leaf, value, data_ptr, size); + btrfs_mark_buffer_dirty(leaf); + } else { /* - * We have a value to set, so go back and try to insert it now. + * Insert, and we had space for the xattr, so path->slots[0] is + * where our xattr dir_item is and btrfs_insert_xattr_item() + * filled it. */ - if (value) { - btrfs_release_path(path); - goto again; - } } out: btrfs_free_path(path); From 528555d05bde69c436bb0126ea95635da24d889e Mon Sep 17 00:00:00 2001 From: Steffen Klassert Date: Fri, 25 Oct 2013 10:21:32 +0200 Subject: [PATCH 016/359] xfrm: Increase the garbage collector threshold commit eeb1b73378b560e00ff1da2ef09fed9254f4e128 upstream. With the removal of the routing cache, we lost the option to tweak the garbage collector threshold along with the maximum routing cache size. So git commit 703fb94ec ("xfrm: Fix the gc threshold value for ipv4") moved back to a static threshold. It turned out that the current threshold before we start garbage collecting is much to small for some workloads, so increase it from 1024 to 32768. This means that we start the garbage collector if we have more than 32768 dst entries in the system and refuse new allocations if we are above 65536. Reported-by: Wolfgang Walter Signed-off-by: Steffen Klassert Cc: Stephen Hemminger Signed-off-by: Greg Kroah-Hartman --- net/ipv4/xfrm4_policy.c | 2 +- net/ipv6/xfrm6_policy.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c index 9a459be24af762..9b5b5ddf8cd479 100644 --- a/net/ipv4/xfrm4_policy.c +++ b/net/ipv4/xfrm4_policy.c @@ -235,7 +235,7 @@ static struct dst_ops xfrm4_dst_ops = { .destroy = xfrm4_dst_destroy, .ifdown = xfrm4_dst_ifdown, .local_out = __ip_local_out, - .gc_thresh = 1024, + .gc_thresh = 32768, }; static struct xfrm_policy_afinfo xfrm4_policy_afinfo = { diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c index 23ed03d786c837..1c2e0c9ba8a19e 100644 --- a/net/ipv6/xfrm6_policy.c +++ b/net/ipv6/xfrm6_policy.c @@ -284,7 +284,7 @@ static struct dst_ops xfrm6_dst_ops = { .destroy = xfrm6_dst_destroy, .ifdown = xfrm6_dst_ifdown, .local_out = __ip6_local_out, - .gc_thresh = 1024, + .gc_thresh = 32768, }; static struct xfrm_policy_afinfo xfrm6_policy_afinfo = { From ba310bc86f54169bf4ec414683bd61dcd2f8675f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Kube=C4=8Dek?= Date: Thu, 1 Aug 2013 10:04:14 +0200 Subject: [PATCH 017/359] ipv6: prevent fib6_run_gc() contention commit 2ac3ac8f86f2fe065d746d9a9abaca867adec577 upstream. On a high-traffic router with many processors and many IPv6 dst entries, soft lockup in fib6_run_gc() can occur when number of entries reaches gc_thresh. This happens because fib6_run_gc() uses fib6_gc_lock to allow only one thread to run the garbage collector but ip6_dst_gc() doesn't update net->ipv6.ip6_rt_last_gc until fib6_run_gc() returns. On a system with many entries, this can take some time so that in the meantime, other threads pass the tests in ip6_dst_gc() (ip6_rt_last_gc is still not updated) and wait for the lock. They then have to run the garbage collector one after another which blocks them for quite long. Resolve this by replacing special value ~0UL of expire parameter to fib6_run_gc() by explicit "force" parameter to choose between spin_lock_bh() and spin_trylock_bh() and call fib6_run_gc() with force=false if gc_thresh is reached but not max_size. Signed-off-by: Michal Kubecek Signed-off-by: David S. Miller Cc: Konstantin Khlebnikov Signed-off-by: Greg Kroah-Hartman --- include/net/ip6_fib.h | 2 +- net/ipv6/ip6_fib.c | 19 ++++++++----------- net/ipv6/ndisc.c | 4 ++-- net/ipv6/route.c | 4 ++-- 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index 665e0cee59bd95..5e661a979694e8 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h @@ -301,7 +301,7 @@ extern void inet6_rt_notify(int event, struct rt6_info *rt, struct nl_info *info); extern void fib6_run_gc(unsigned long expires, - struct net *net); + struct net *net, bool force); extern void fib6_gc_cleanup(void); diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c index ceeb9458bb60c8..0b5e9086322dec 100644 --- a/net/ipv6/ip6_fib.c +++ b/net/ipv6/ip6_fib.c @@ -1648,19 +1648,16 @@ static int fib6_age(struct rt6_info *rt, void *arg) static DEFINE_SPINLOCK(fib6_gc_lock); -void fib6_run_gc(unsigned long expires, struct net *net) +void fib6_run_gc(unsigned long expires, struct net *net, bool force) { - if (expires != ~0UL) { + if (force) { spin_lock_bh(&fib6_gc_lock); - gc_args.timeout = expires ? (int)expires : - net->ipv6.sysctl.ip6_rt_gc_interval; - } else { - if (!spin_trylock_bh(&fib6_gc_lock)) { - mod_timer(&net->ipv6.ip6_fib_timer, jiffies + HZ); - return; - } - gc_args.timeout = net->ipv6.sysctl.ip6_rt_gc_interval; + } else if (!spin_trylock_bh(&fib6_gc_lock)) { + mod_timer(&net->ipv6.ip6_fib_timer, jiffies + HZ); + return; } + gc_args.timeout = expires ? (int)expires : + net->ipv6.sysctl.ip6_rt_gc_interval; gc_args.more = icmp6_dst_gc(); @@ -1677,7 +1674,7 @@ void fib6_run_gc(unsigned long expires, struct net *net) static void fib6_gc_timer_cb(unsigned long arg) { - fib6_run_gc(0, (struct net *)arg); + fib6_run_gc(0, (struct net *)arg, true); } static int __net_init fib6_net_init(struct net *net) diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 05f361338c2eab..deedf7ddbc6e27 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c @@ -1584,7 +1584,7 @@ static int ndisc_netdev_event(struct notifier_block *this, unsigned long event, switch (event) { case NETDEV_CHANGEADDR: neigh_changeaddr(&nd_tbl, dev); - fib6_run_gc(~0UL, net); + fib6_run_gc(0, net, false); idev = in6_dev_get(dev); if (!idev) break; @@ -1594,7 +1594,7 @@ static int ndisc_netdev_event(struct notifier_block *this, unsigned long event, break; case NETDEV_DOWN: neigh_ifdown(&nd_tbl, dev); - fib6_run_gc(~0UL, net); + fib6_run_gc(0, net, false); break; case NETDEV_NOTIFY_PEERS: ndisc_send_unsol_na(dev); diff --git a/net/ipv6/route.c b/net/ipv6/route.c index d94d224f7e6868..bd83c90f970c09 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -1349,7 +1349,7 @@ static int ip6_dst_gc(struct dst_ops *ops) goto out; net->ipv6.ip6_rt_gc_expire++; - fib6_run_gc(net->ipv6.ip6_rt_gc_expire, net); + fib6_run_gc(net->ipv6.ip6_rt_gc_expire, net, entries > rt_max_size); net->ipv6.ip6_rt_last_gc = now; entries = dst_entries_get_slow(ops); if (entries < ops->gc_thresh) @@ -2849,7 +2849,7 @@ int ipv6_sysctl_rtcache_flush(ctl_table *ctl, int write, net = (struct net *)ctl->extra1; delay = net->ipv6.sysctl.flush_delay; proc_dointvec(ctl, write, buffer, lenp, ppos); - fib6_run_gc(delay <= 0 ? ~0UL : (unsigned long)delay, net); + fib6_run_gc(delay <= 0 ? 0 : (unsigned long)delay, net, delay > 0); return 0; } From c1e1eb159efadf28f0da0de550d696abdb30aefc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Kube=C4=8Dek?= Date: Thu, 1 Aug 2013 10:04:24 +0200 Subject: [PATCH 018/359] ipv6: update ip6_rt_last_gc every time GC is run commit 49a18d86f66d33a20144ecb5a34bba0d1856b260 upstream. As pointed out by Eric Dumazet, net->ipv6.ip6_rt_last_gc should hold the last time garbage collector was run so that we should update it whenever fib6_run_gc() calls fib6_clean_all(), not only if we got there from ip6_dst_gc(). Signed-off-by: Michal Kubecek Signed-off-by: David S. Miller Cc: Konstantin Khlebnikov Signed-off-by: Greg Kroah-Hartman --- net/ipv6/ip6_fib.c | 6 +++++- net/ipv6/route.c | 4 +--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c index 0b5e9086322dec..46458ee3193939 100644 --- a/net/ipv6/ip6_fib.c +++ b/net/ipv6/ip6_fib.c @@ -1650,6 +1650,8 @@ static DEFINE_SPINLOCK(fib6_gc_lock); void fib6_run_gc(unsigned long expires, struct net *net, bool force) { + unsigned long now; + if (force) { spin_lock_bh(&fib6_gc_lock); } else if (!spin_trylock_bh(&fib6_gc_lock)) { @@ -1662,10 +1664,12 @@ void fib6_run_gc(unsigned long expires, struct net *net, bool force) gc_args.more = icmp6_dst_gc(); fib6_clean_all(net, fib6_age, 0, NULL); + now = jiffies; + net->ipv6.ip6_rt_last_gc = now; if (gc_args.more) mod_timer(&net->ipv6.ip6_fib_timer, - round_jiffies(jiffies + round_jiffies(now + net->ipv6.sysctl.ip6_rt_gc_interval)); else del_timer(&net->ipv6.ip6_fib_timer); diff --git a/net/ipv6/route.c b/net/ipv6/route.c index bd83c90f970c09..6ebefd46f71849 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -1334,7 +1334,6 @@ static void icmp6_clean_all(int (*func)(struct rt6_info *rt, void *arg), static int ip6_dst_gc(struct dst_ops *ops) { - unsigned long now = jiffies; struct net *net = container_of(ops, struct net, ipv6.ip6_dst_ops); int rt_min_interval = net->ipv6.sysctl.ip6_rt_gc_min_interval; int rt_max_size = net->ipv6.sysctl.ip6_rt_max_size; @@ -1344,13 +1343,12 @@ static int ip6_dst_gc(struct dst_ops *ops) int entries; entries = dst_entries_get_fast(ops); - if (time_after(rt_last_gc + rt_min_interval, now) && + if (time_after(rt_last_gc + rt_min_interval, jiffies) && entries <= rt_max_size) goto out; net->ipv6.ip6_rt_gc_expire++; fib6_run_gc(net->ipv6.ip6_rt_gc_expire, net, entries > rt_max_size); - net->ipv6.ip6_rt_last_gc = now; entries = dst_entries_get_slow(ops); if (entries < ops->gc_thresh) net->ipv6.ip6_rt_gc_expire = rt_gc_timeout>>1; From b93e0acc5001b80153cb0c7efcdcc53cc56aac4a Mon Sep 17 00:00:00 2001 From: Jari Ruusu Date: Sat, 13 Jun 2015 19:01:31 +0300 Subject: [PATCH 019/359] d_walk() might skip too much When Al Viro's VFS deadlock fix "deal with deadlock in d_walk()" was backported to 3.10.y 3.4.y and 3.2.y stable kernel brances, the deadlock fix was copied to 3 different places. Later, a bug in that code was discovered. Al Viro's fix involved fixing only one part of code in mainline kernel. That fix is called "d_walk() might skip too much". 3.10.y 3.4.y and 3.2.y stable kernel brances need that later fix copied to 3 different places. Greg Kroah-Hartman included Al Viro's "d_walk() might skip too much" fix only once in 3.10.80 kernel, leaving 2 more places without a fix. The patch below was not written by me. I only applied Al Viro's "d_walk() might skip too much" fix 2 more times to 3.10.80 kernel, and cheched that the fixes went to correct places. With this patch applied, all 3 places that I am aware of 3.10.y stable branch are now fixed. Signed-off-by: Jari Ruusu Cc: Willy Tarreau Signed-off-by: Greg Kroah-Hartman --- fs/dcache.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/dcache.c b/fs/dcache.c index e2800926ae0574..38c4a302fab426 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -1053,13 +1053,13 @@ int have_submounts(struct dentry *parent) /* might go back up the wrong parent if we have had a rename. */ if (!locked && read_seqretry(&rename_lock, seq)) goto rename_retry; - next = child->d_child.next; - while (unlikely(child->d_flags & DCACHE_DENTRY_KILLED)) { + /* go into the first sibling still alive */ + do { + next = child->d_child.next; if (next == &this_parent->d_subdirs) goto ascend; child = list_entry(next, struct dentry, d_child); - next = next->next; - } + } while (unlikely(child->d_flags & DCACHE_DENTRY_KILLED)); rcu_read_unlock(); goto resume; } @@ -2977,13 +2977,13 @@ void d_genocide(struct dentry *root) /* might go back up the wrong parent if we have had a rename. */ if (!locked && read_seqretry(&rename_lock, seq)) goto rename_retry; - next = child->d_child.next; - while (unlikely(child->d_flags & DCACHE_DENTRY_KILLED)) { + /* go into the first sibling still alive */ + do { + next = child->d_child.next; if (next == &this_parent->d_subdirs) goto ascend; child = list_entry(next, struct dentry, d_child); - next = next->next; - } + } while (unlikely(child->d_flags & DCACHE_DENTRY_KILLED)); rcu_read_unlock(); goto resume; } From 4cae4bbc1a8f5258a986801d72678752f9075a64 Mon Sep 17 00:00:00 2001 From: Sebastien Szymanski Date: Wed, 20 May 2015 16:30:37 +0200 Subject: [PATCH 020/359] ARM: clk-imx6q: refine sata's parent commit da946aeaeadcd24ff0cda9984c6fb8ed2bfd462a upstream. According to IMX6D/Q RM, table 18-3, sata clock's parent is ahb, not ipg. Signed-off-by: Sebastien Szymanski Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo [dirk.behme: Adjust moved file] Signed-off-by: Dirk Behme Signed-off-by: Greg Kroah-Hartman --- arch/arm/mach-imx/clk-imx6q.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c index 2acaded8025d14..ed00c9e3bfc65e 100644 --- a/arch/arm/mach-imx/clk-imx6q.c +++ b/arch/arm/mach-imx/clk-imx6q.c @@ -515,7 +515,7 @@ int __init mx6q_clocks_init(void) clk[gpmi_io] = imx_clk_gate2("gpmi_io", "enfc", base + 0x78, 28); clk[gpmi_apb] = imx_clk_gate2("gpmi_apb", "usdhc3", base + 0x78, 30); clk[rom] = imx_clk_gate2("rom", "ahb", base + 0x7c, 0); - clk[sata] = imx_clk_gate2("sata", "ipg", base + 0x7c, 4); + clk[sata] = imx_clk_gate2("sata", "ahb", base + 0x7c, 4); clk[sdma] = imx_clk_gate2("sdma", "ahb", base + 0x7c, 6); clk[spba] = imx_clk_gate2("spba", "ipg", base + 0x7c, 12); clk[ssi1_ipg] = imx_clk_gate2("ssi1_ipg", "ipg", base + 0x7c, 18); From ea0d66be1c27f55825a80d01ad1ff72f6e005c29 Mon Sep 17 00:00:00 2001 From: Bandan Das Date: Thu, 11 Jun 2015 02:05:33 -0400 Subject: [PATCH 021/359] KVM: nSVM: Check for NRIPS support before updating control field commit f104765b4f81fd74d69e0eb161e89096deade2db upstream. If hardware doesn't support DecodeAssist - a feature that provides more information about the intercept in the VMCB, KVM decodes the instruction and then updates the next_rip vmcb control field. However, NRIP support itself depends on cpuid Fn8000_000A_EDX[NRIPS]. Since skip_emulated_instruction() doesn't verify nrip support before accepting control.next_rip as valid, avoid writing this field if support isn't present. Signed-off-by: Bandan Das Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/svm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 8bf40a243d7571..224d2ef754cc68 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -495,8 +495,10 @@ static void skip_emulated_instruction(struct kvm_vcpu *vcpu) { struct vcpu_svm *svm = to_svm(vcpu); - if (svm->vmcb->control.next_rip != 0) + if (svm->vmcb->control.next_rip != 0) { + WARN_ON(!static_cpu_has(X86_FEATURE_NRIPS)); svm->next_rip = svm->vmcb->control.next_rip; + } if (!svm->next_rip) { if (emulate_instruction(vcpu, EMULTYPE_SKIP) != @@ -4229,7 +4231,9 @@ static int svm_check_intercept(struct kvm_vcpu *vcpu, break; } - vmcb->control.next_rip = info->next_rip; + /* TODO: Advertise NRIPS to guest hypervisor unconditionally */ + if (static_cpu_has(X86_FEATURE_NRIPS)) + vmcb->control.next_rip = info->next_rip; vmcb->control.exit_code = icpt_info.exit_code; vmexit = nested_svm_exit_handled(svm); From 2667677fb84b4b92e31573f2f2ffaec7a8772747 Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Mon, 14 Apr 2014 15:47:01 +0200 Subject: [PATCH 022/359] bus: mvebu: pass the coherency availability information at init time commit 5686a1e5aa436c49187a60052d5885fb1f541ce6 upstream. Until now, the mvebu-mbus was guessing by itself whether hardware I/O coherency was available or not by poking into the Device Tree to see if the coherency fabric Device Tree node was present or not. However, on some upcoming SoCs, the presence or absence of the coherency fabric DT node isn't sufficient: in CONFIG_SMP, the coherency can be enabled, but not in !CONFIG_SMP. In order to clean this up, the mvebu_mbus_dt_init() function is extended to get a boolean argument telling whether coherency is enabled or not. Therefore, the logic to decide whether coherency is available or not now belongs to the core SoC code instead of the mvebu-mbus driver itself, which is much better. Signed-off-by: Thomas Petazzoni Link: https://lkml.kernel.org/r/1397483228-25625-4-git-send-email-thomas.petazzoni@free-electrons.com Signed-off-by: Jason Cooper [ Greg Ungerer: back ported to linux-3.10.y Back port necessary due to large code differences in affected files. This change in combination with commit e553554536 ("ARM: mvebu: disable I/O coherency on non-SMP situations on Armada 370/375/38x/XP") is critical to the hardware I/O coherency being set correctly by both the mbus driver and all peripheral hardware drivers. Without this change drivers will incorrectly enable I/O coherency window attributes and this causes rare unreliable system behavior including oops. ] Signed-off-by: Greg Ungerer Acked-by: Gregory CLEMENT Signed-off-by: Greg Kroah-Hartman --- arch/arm/mach-dove/common.c | 2 +- arch/arm/mach-kirkwood/common.c | 2 +- arch/arm/mach-mv78xx0/common.c | 4 ++-- arch/arm/mach-mvebu/armada-370-xp.c | 3 ++- arch/arm/mach-mvebu/coherency.c | 15 +++++++++++++++ arch/arm/mach-mvebu/coherency.h | 1 + arch/arm/mach-orion5x/common.c | 2 +- drivers/bus/mvebu-mbus.c | 5 ++--- include/linux/mbus.h | 2 +- 9 files changed, 26 insertions(+), 10 deletions(-) diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c index e2b5da031f964c..8d4f5dc569105a 100644 --- a/arch/arm/mach-dove/common.c +++ b/arch/arm/mach-dove/common.c @@ -226,7 +226,7 @@ void __init dove_init_early(void) orion_time_set_base(TIMER_VIRT_BASE); mvebu_mbus_init("marvell,dove-mbus", BRIDGE_WINS_BASE, BRIDGE_WINS_SZ, - DOVE_MC_WINS_BASE, DOVE_MC_WINS_SZ); + DOVE_MC_WINS_BASE, DOVE_MC_WINS_SZ, 0); } static int __init dove_find_tclk(void) diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c index f389228975637c..4f6831ea88c549 100644 --- a/arch/arm/mach-kirkwood/common.c +++ b/arch/arm/mach-kirkwood/common.c @@ -530,7 +530,7 @@ void __init kirkwood_init_early(void) mvebu_mbus_init("marvell,kirkwood-mbus", BRIDGE_WINS_BASE, BRIDGE_WINS_SZ, - DDR_WINDOW_CPU_BASE, DDR_WINDOW_CPU_SZ); + DDR_WINDOW_CPU_BASE, DDR_WINDOW_CPU_SZ, 0); } int kirkwood_tclk; diff --git a/arch/arm/mach-mv78xx0/common.c b/arch/arm/mach-mv78xx0/common.c index 749a7f8c4992e9..4722c98dc1bb1f 100644 --- a/arch/arm/mach-mv78xx0/common.c +++ b/arch/arm/mach-mv78xx0/common.c @@ -337,11 +337,11 @@ void __init mv78xx0_init_early(void) if (mv78xx0_core_index() == 0) mvebu_mbus_init("marvell,mv78xx0-mbus", BRIDGE_WINS_CPU0_BASE, BRIDGE_WINS_SZ, - DDR_WINDOW_CPU0_BASE, DDR_WINDOW_CPU_SZ); + DDR_WINDOW_CPU0_BASE, DDR_WINDOW_CPU_SZ, 0); else mvebu_mbus_init("marvell,mv78xx0-mbus", BRIDGE_WINS_CPU1_BASE, BRIDGE_WINS_SZ, - DDR_WINDOW_CPU1_BASE, DDR_WINDOW_CPU_SZ); + DDR_WINDOW_CPU1_BASE, DDR_WINDOW_CPU_SZ, 0); } void __init_refok mv78xx0_timer_init(void) diff --git a/arch/arm/mach-mvebu/armada-370-xp.c b/arch/arm/mach-mvebu/armada-370-xp.c index 1c48890bb72b2c..4377c3484a6260 100644 --- a/arch/arm/mach-mvebu/armada-370-xp.c +++ b/arch/arm/mach-mvebu/armada-370-xp.c @@ -66,7 +66,8 @@ void __init armada_370_xp_init_early(void) ARMADA_370_XP_MBUS_WINS_BASE, ARMADA_370_XP_MBUS_WINS_SIZE, ARMADA_370_XP_SDRAM_WINS_BASE, - ARMADA_370_XP_SDRAM_WINS_SIZE); + ARMADA_370_XP_SDRAM_WINS_SIZE, + coherency_available()); #ifdef CONFIG_CACHE_L2X0 l2x0_of_init(0, ~0UL); diff --git a/arch/arm/mach-mvebu/coherency.c b/arch/arm/mach-mvebu/coherency.c index 3ee701f1d38e1c..ea26ebb5bb5ad1 100644 --- a/arch/arm/mach-mvebu/coherency.c +++ b/arch/arm/mach-mvebu/coherency.c @@ -137,6 +137,20 @@ static struct notifier_block mvebu_hwcc_platform_nb = { .notifier_call = mvebu_hwcc_platform_notifier, }; +/* + * Keep track of whether we have IO hardware coherency enabled or not. + * On Armada 370's we will not be using it for example. We need to make + * that available [through coherency_available()] so the mbus controller + * doesn't enable the IO coherency bit in the attribute bits of the + * chip selects. + */ +static int coherency_enabled; + +int coherency_available(void) +{ + return coherency_enabled; +} + int __init coherency_init(void) { struct device_node *np; @@ -170,6 +184,7 @@ int __init coherency_init(void) coherency_base = of_iomap(np, 0); coherency_cpu_base = of_iomap(np, 1); set_cpu_coherent(cpu_logical_map(smp_processor_id()), 0); + coherency_enabled = 1; bus_register_notifier(&platform_bus_type, &mvebu_hwcc_platform_nb); } diff --git a/arch/arm/mach-mvebu/coherency.h b/arch/arm/mach-mvebu/coherency.h index 2f428137f6fedf..1501a4e5eea0d1 100644 --- a/arch/arm/mach-mvebu/coherency.h +++ b/arch/arm/mach-mvebu/coherency.h @@ -19,6 +19,7 @@ int coherency_get_cpu_count(void); #endif int set_cpu_coherent(int cpu_id, int smp_group_id); +int coherency_available(void); int coherency_init(void); #endif /* __MACH_370_XP_COHERENCY_H */ diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c index f8a6db9239bf3c..048773926ad4e8 100644 --- a/arch/arm/mach-orion5x/common.c +++ b/arch/arm/mach-orion5x/common.c @@ -213,7 +213,7 @@ void __init orion5x_init_early(void) mbus_soc_name = NULL; mvebu_mbus_init(mbus_soc_name, ORION5X_BRIDGE_WINS_BASE, ORION5X_BRIDGE_WINS_SZ, - ORION5X_DDR_WINS_BASE, ORION5X_DDR_WINS_SZ); + ORION5X_DDR_WINS_BASE, ORION5X_DDR_WINS_SZ, 0); } void orion5x_setup_wins(void) diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c index 711dcf4a0313fc..7c437826c2f994 100644 --- a/drivers/bus/mvebu-mbus.c +++ b/drivers/bus/mvebu-mbus.c @@ -838,7 +838,7 @@ fs_initcall(mvebu_mbus_debugfs_init); int __init mvebu_mbus_init(const char *soc, phys_addr_t mbuswins_phys_base, size_t mbuswins_size, phys_addr_t sdramwins_phys_base, - size_t sdramwins_size) + size_t sdramwins_size, int is_coherent) { struct mvebu_mbus_state *mbus = &mbus_state; const struct of_device_id *of_id; @@ -865,8 +865,7 @@ int __init mvebu_mbus_init(const char *soc, phys_addr_t mbuswins_phys_base, return -ENOMEM; } - if (of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric")) - mbus->hw_io_coherency = 1; + mbus->hw_io_coherency = is_coherent; for (win = 0; win < mbus->soc->num_wins; win++) mvebu_mbus_disable_window(mbus, win); diff --git a/include/linux/mbus.h b/include/linux/mbus.h index dba482e31a130e..e80b9c7ec8da36 100644 --- a/include/linux/mbus.h +++ b/include/linux/mbus.h @@ -67,6 +67,6 @@ int mvebu_mbus_add_window(const char *devname, phys_addr_t base, int mvebu_mbus_del_window(phys_addr_t base, size_t size); int mvebu_mbus_init(const char *soc, phys_addr_t mbus_phys_base, size_t mbus_size, phys_addr_t sdram_phys_base, - size_t sdram_size); + size_t sdram_size, int is_coherent); #endif /* __LINUX_MBUS_H */ From c48465423908a8955cd6de09b871161324cf5205 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 3 Jul 2015 19:48:19 -0700 Subject: [PATCH 023/359] Linux 3.10.83 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5e3e665a10b7b5..21529dbcc11dfe 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 10 -SUBLEVEL = 82 +SUBLEVEL = 83 EXTRAVERSION = NAME = TOSSUG Baby Fish From dc911b31255d65ef7e54e416bfbea810af56cf7a Mon Sep 17 00:00:00 2001 From: Sowmini Varadhan Date: Tue, 21 Apr 2015 10:30:41 -0400 Subject: [PATCH 024/359] sparc: Use GFP_ATOMIC in ldc_alloc_exp_dring() as it can be called in softirq context Upstream commit 671d773297969bebb1732e1cdc1ec03aa53c6be2 Since it is possible for vnet_event_napi to end up doing vnet_control_pkt_engine -> ... -> vnet_send_attr -> vnet_port_alloc_tx_ring -> ldc_alloc_exp_dring -> kzalloc() (i.e., in softirq context), kzalloc() should be called with GFP_ATOMIC from ldc_alloc_exp_dring. Signed-off-by: Sowmini Varadhan Signed-off-by: Greg Kroah-Hartman --- arch/sparc/kernel/ldc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/sparc/kernel/ldc.c b/arch/sparc/kernel/ldc.c index fa4c900a0d1ff8..62983d77455e60 100644 --- a/arch/sparc/kernel/ldc.c +++ b/arch/sparc/kernel/ldc.c @@ -2306,7 +2306,7 @@ void *ldc_alloc_exp_dring(struct ldc_channel *lp, unsigned int len, if (len & (8UL - 1)) return ERR_PTR(-EINVAL); - buf = kzalloc(len, GFP_KERNEL); + buf = kzalloc(len, GFP_ATOMIC); if (!buf) return ERR_PTR(-ENOMEM); From 80cbc4a31be6abe812cdbd81d4b98e4d7771c7fa Mon Sep 17 00:00:00 2001 From: Nikolay Aleksandrov Date: Tue, 9 Jun 2015 10:23:57 -0700 Subject: [PATCH 025/359] bridge: fix multicast router rlist endless loop [ Upstream commit 1a040eaca1a22f8da8285ceda6b5e4a2cb704867 ] Since the addition of sysfs multicast router support if one set multicast_router to "2" more than once, then the port would be added to the hlist every time and could end up linking to itself and thus causing an endless loop for rlist walkers. So to reproduce just do: echo 2 > multicast_router; echo 2 > multicast_router; in a bridge port and let some igmp traffic flow, for me it hangs up in br_multicast_flood(). Fix this by adding a check in br_multicast_add_router() if the port is already linked. The reason this didn't happen before the addition of multicast_router sysfs entries is because there's a !hlist_unhashed check that prevents it. Signed-off-by: Nikolay Aleksandrov Fixes: 0909e11758bd ("bridge: Add multicast_router sysfs entries") Acked-by: Herbert Xu Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/bridge/br_multicast.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c index 49b4a82d3f864c..a09ea178348c42 100644 --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c @@ -1026,6 +1026,9 @@ static void br_multicast_add_router(struct net_bridge *br, struct net_bridge_port *p; struct hlist_node *slot = NULL; + if (!hlist_unhashed(&port->rlist)) + return; + hlist_for_each_entry(p, &br->router_list, rlist) { if ((unsigned long) port >= (unsigned long) p) break; @@ -1053,12 +1056,8 @@ static void br_multicast_mark_router(struct net_bridge *br, if (port->multicast_router != 1) return; - if (!hlist_unhashed(&port->rlist)) - goto timer; - br_multicast_add_router(br, port); -timer: mod_timer(&port->multicast_router_timer, now + br->multicast_querier_interval); } From 019b1332afd4dc4c80fa83379866d01984933694 Mon Sep 17 00:00:00 2001 From: Nikolay Aleksandrov Date: Mon, 15 Jun 2015 20:28:51 +0300 Subject: [PATCH 026/359] bridge: fix br_stp_set_bridge_priority race conditions [ Upstream commit 2dab80a8b486f02222a69daca6859519e05781d9 ] After the ->set() spinlocks were removed br_stp_set_bridge_priority was left running without any protection when used via sysfs. It can race with port add/del and could result in use-after-free cases and corrupted lists. Tested by running port add/del in a loop with stp enabled while setting priority in a loop, crashes are easily reproducible. The spinlocks around sysfs ->set() were removed in commit: 14f98f258f19 ("bridge: range check STP parameters") There's also a race condition in the netlink priority support that is fixed by this change, but it was introduced recently and the fixes tag covers it, just in case it's needed the commit is: af615762e972 ("bridge: add ageing_time, stp_state, priority over netlink") Signed-off-by: Nikolay Aleksandrov Fixes: 14f98f258f19 ("bridge: range check STP parameters") Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/bridge/br_ioctl.c | 2 -- net/bridge/br_stp_if.c | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/net/bridge/br_ioctl.c b/net/bridge/br_ioctl.c index cd8c3a44ab7dcc..b73eaba856675d 100644 --- a/net/bridge/br_ioctl.c +++ b/net/bridge/br_ioctl.c @@ -247,9 +247,7 @@ static int old_dev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN)) return -EPERM; - spin_lock_bh(&br->lock); br_stp_set_bridge_priority(br, args[1]); - spin_unlock_bh(&br->lock); return 0; case BRCTL_SET_PORT_PRIORITY: diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c index 656a6f3e40de1b..886f6d6dc48a3f 100644 --- a/net/bridge/br_stp_if.c +++ b/net/bridge/br_stp_if.c @@ -241,12 +241,13 @@ bool br_stp_recalculate_bridge_id(struct net_bridge *br) return true; } -/* called under bridge lock */ +/* Acquires and releases bridge lock */ void br_stp_set_bridge_priority(struct net_bridge *br, u16 newprio) { struct net_bridge_port *p; int wasroot; + spin_lock_bh(&br->lock); wasroot = br_is_root_bridge(br); list_for_each_entry(p, &br->port_list, list) { @@ -264,6 +265,7 @@ void br_stp_set_bridge_priority(struct net_bridge *br, u16 newprio) br_port_state_selection(br); if (br_is_root_bridge(br) && !wasroot) br_become_root_bridge(br); + spin_unlock_bh(&br->lock); } /* called under bridge lock */ From 7eee92bf2e54235ab90f90d4b97b9256f51b076d Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Tue, 16 Jun 2015 07:59:11 -0700 Subject: [PATCH 027/359] packet: read num_members once in packet_rcv_fanout() [ Upstream commit f98f4514d07871da7a113dd9e3e330743fd70ae4 ] We need to tell compiler it must not read f->num_members multiple times. Otherwise testing if num is not zero is flaky, and we could attempt an invalid divide by 0 in fanout_demux_cpu() Note bug was present in packet_rcv_fanout_hash() and packet_rcv_fanout_lb() but final 3.1 had a simple location after commit 95ec3eb417115fb ("packet: Add 'cpu' fanout policy.") Fixes: dc99f600698dc ("packet: Add fanout support.") Signed-off-by: Eric Dumazet Cc: Willem de Bruijn Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/packet/af_packet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 81b4b816f13132..62df51d9999354 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -1217,7 +1217,7 @@ static int packet_rcv_fanout(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev) { struct packet_fanout *f = pt->af_packet_priv; - unsigned int num = f->num_members; + unsigned int num = ACCESS_ONCE(f->num_members); struct packet_sock *po; unsigned int idx; From 4552ddd07a1f2f502243cb8d4609f1e3fad57958 Mon Sep 17 00:00:00 2001 From: Willem de Bruijn Date: Wed, 17 Jun 2015 15:59:34 -0400 Subject: [PATCH 028/359] packet: avoid out of bounds read in round robin fanout [ Upstream commit 468479e6043c84f5a65299cc07cb08a22a28c2b1 ] PACKET_FANOUT_LB computes f->rr_cur such that it is modulo f->num_members. It returns the old value unconditionally, but f->num_members may have changed since the last store. Ensure that the return value is always < num. When modifying the logic, simplify it further by replacing the loop with an unconditional atomic increment. Fixes: dc99f600698d ("packet: Add fanout support.") Suggested-by: Eric Dumazet Signed-off-by: Willem de Bruijn Acked-by: Eric Dumazet Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/packet/af_packet.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 62df51d9999354..39fa33969b0911 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -1150,16 +1150,6 @@ static void packet_sock_destruct(struct sock *sk) sk_refcnt_debug_dec(sk); } -static int fanout_rr_next(struct packet_fanout *f, unsigned int num) -{ - int x = atomic_read(&f->rr_cur) + 1; - - if (x >= num) - x = 0; - - return x; -} - static unsigned int fanout_demux_hash(struct packet_fanout *f, struct sk_buff *skb, unsigned int num) @@ -1171,13 +1161,9 @@ static unsigned int fanout_demux_lb(struct packet_fanout *f, struct sk_buff *skb, unsigned int num) { - int cur, old; + unsigned int val = atomic_inc_return(&f->rr_cur); - cur = atomic_read(&f->rr_cur); - while ((old = atomic_cmpxchg(&f->rr_cur, cur, - fanout_rr_next(f, num))) != cur) - cur = old; - return cur; + return val % num; } static unsigned int fanout_demux_cpu(struct packet_fanout *f, From 59a460c394a771501ffcd81e68c83fa2ed91e384 Mon Sep 17 00:00:00 2001 From: Alexander Sverdlin Date: Mon, 29 Jun 2015 10:41:03 +0200 Subject: [PATCH 029/359] sctp: Fix race between OOTB responce and route removal [ Upstream commit 29c4afc4e98f4dc0ea9df22c631841f9c220b944 ] There is NULL pointer dereference possible during statistics update if the route used for OOTB responce is removed at unfortunate time. If the route exists when we receive OOTB packet and we finally jump into sctp_packet_transmit() to send ABORT, but in the meantime route is removed under our feet, we take "no_route" path and try to update stats with IP_INC_STATS(sock_net(asoc->base.sk), ...). But sctp_ootb_pkt_new() used to prepare responce packet doesn't call sctp_transport_set_owner() and therefore there is no asoc associated with this packet. Probably temporary asoc just for OOTB responces is overkill, so just introduce a check like in all other places in sctp_packet_transmit(), where "asoc" is dereferenced. To reproduce this, one needs to 0. ensure that sctp module is loaded (otherwise ABORT is not generated) 1. remove default route on the machine 2. while true; do ip route del [interface-specific route] ip route add [interface-specific route] done 3. send enough OOTB packets (i.e. HB REQs) from another host to trigger ABORT responce On x86_64 the crash looks like this: BUG: unable to handle kernel NULL pointer dereference at 0000000000000020 IP: [] sctp_packet_transmit+0x63c/0x730 [sctp] PGD 0 Oops: 0000 [#1] PREEMPT SMP Modules linked in: ... CPU: 0 PID: 0 Comm: swapper/0 Tainted: G O 4.0.5-1-ARCH #1 Hardware name: ... task: ffffffff818124c0 ti: ffffffff81800000 task.ti: ffffffff81800000 RIP: 0010:[] [] sctp_packet_transmit+0x63c/0x730 [sctp] RSP: 0018:ffff880127c037b8 EFLAGS: 00010296 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00000015ff66b480 RDX: 00000015ff66b400 RSI: ffff880127c17200 RDI: ffff880123403700 RBP: ffff880127c03888 R08: 0000000000017200 R09: ffffffff814625af R10: ffffea00047e4680 R11: 00000000ffffff80 R12: ffff8800b0d38a28 R13: ffff8800b0d38a28 R14: ffff8800b3e88000 R15: ffffffffa05f24e0 FS: 0000000000000000(0000) GS:ffff880127c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b CR2: 0000000000000020 CR3: 00000000c855b000 CR4: 00000000000007f0 Stack: ffff880127c03910 ffff8800b0d38a28 ffffffff8189d240 ffff88011f91b400 ffff880127c03828 ffffffffa05c94c5 0000000000000000 ffff8800baa1c520 0000000000000000 0000000000000001 0000000000000000 0000000000000000 Call Trace: [] ? sctp_sf_tabort_8_4_8.isra.20+0x85/0x140 [sctp] [] ? sctp_transport_put+0x52/0x80 [sctp] [] sctp_do_sm+0xb8c/0x19a0 [sctp] [] ? trigger_load_balance+0x90/0x210 [] ? update_process_times+0x59/0x60 [] ? timerqueue_add+0x60/0xb0 [] ? enqueue_hrtimer+0x29/0xa0 [] ? read_tsc+0x9/0x10 [] ? put_page+0x55/0x60 [] ? clockevents_program_event+0x6d/0x100 [] ? skb_free_head+0x58/0x80 [] ? chksum_update+0x1b/0x27 [crc32c_generic] [] ? crypto_shash_update+0xce/0xf0 [] sctp_endpoint_bh_rcv+0x113/0x280 [sctp] [] sctp_inq_push+0x46/0x60 [sctp] [] sctp_rcv+0x880/0x910 [sctp] [] ? sctp_packet_transmit_chunk+0xb0/0xb0 [sctp] [] ? sctp_csum_update+0x20/0x20 [sctp] [] ? ip_route_input_noref+0x235/0xd30 [] ? ack_ioapic_level+0x7b/0x150 [] ip_local_deliver_finish+0xae/0x210 [] ip_local_deliver+0x35/0x90 [] ip_rcv_finish+0xf5/0x370 [] ip_rcv+0x2b8/0x3a0 [] __netif_receive_skb_core+0x763/0xa50 [] __netif_receive_skb+0x18/0x60 [] netif_receive_skb_internal+0x40/0xd0 [] napi_gro_receive+0xe8/0x120 [] rtl8169_poll+0x2da/0x660 [r8169] [] net_rx_action+0x21a/0x360 [] __do_softirq+0xe1/0x2d0 [] irq_exit+0xad/0xb0 [] do_IRQ+0x58/0xf0 [] common_interrupt+0x6d/0x6d [] ? hrtimer_start+0x18/0x20 [] ? sctp_transport_destroy_rcu+0x29/0x30 [sctp] [] ? mwait_idle+0x60/0xa0 [] arch_cpu_idle+0xf/0x20 [] cpu_startup_entry+0x3ec/0x480 [] rest_init+0x85/0x90 [] start_kernel+0x48b/0x4ac [] ? early_idt_handlers+0x120/0x120 [] x86_64_start_reservations+0x2a/0x2c [] x86_64_start_kernel+0x161/0x184 Code: 90 48 8b 80 b8 00 00 00 48 89 85 70 ff ff ff 48 83 bd 70 ff ff ff 00 0f 85 cd fa ff ff 48 89 df 31 db e8 18 63 e7 e0 48 8b 45 80 <48> 8b 40 20 48 8b 40 30 48 8b 80 68 01 00 00 65 48 ff 40 78 e9 RIP [] sctp_packet_transmit+0x63c/0x730 [sctp] RSP CR2: 0000000000000020 ---[ end trace 5aec7fd2dc983574 ]--- Kernel panic - not syncing: Fatal exception in interrupt Kernel Offset: 0x0 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffff9fffffff) drm_kms_helper: panic occurred, switching back to text console ---[ end Kernel panic - not syncing: Fatal exception in interrupt Signed-off-by: Alexander Sverdlin Acked-by: Neil Horman Acked-by: Marcelo Ricardo Leitner Acked-by: Vlad Yasevich Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/sctp/output.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/sctp/output.c b/net/sctp/output.c index 73b8ca51ba14ff..2d9689333fe402 100644 --- a/net/sctp/output.c +++ b/net/sctp/output.c @@ -618,7 +618,9 @@ int sctp_packet_transmit(struct sctp_packet *packet) return err; no_route: kfree_skb(nskb); - IP_INC_STATS(sock_net(asoc->base.sk), IPSTATS_MIB_OUTNOROUTES); + + if (asoc) + IP_INC_STATS(sock_net(asoc->base.sk), IPSTATS_MIB_OUTNOROUTES); /* FIXME: Returning the 'err' will effect all the associations * associated with a socket, although only one of the paths of the From 54b915793f085622ffa78e3cffd94a5733cc71b9 Mon Sep 17 00:00:00 2001 From: Horia Geant? Date: Mon, 11 May 2015 20:03:24 +0300 Subject: [PATCH 030/359] crypto: talitos - avoid memleak in talitos_alg_alloc() commit 5fa7dadc898567ce14d6d6d427e7bd8ce6eb5d39 upstream. Fixes: 1d11911a8c57 ("crypto: talitos - fix warning: 'alg' may be used uninitialized in this function") Signed-off-by: Horia Geanta Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/talitos.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 5b2b5e61e4f9d0..9723b3dcebe79a 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c @@ -2621,6 +2621,7 @@ static struct talitos_crypto_alg *talitos_alg_alloc(struct device *dev, break; default: dev_err(dev, "unknown algorithm type %d\n", t_alg->algt.type); + kfree(t_alg); return ERR_PTR(-EINVAL); } From fd2db9b79cfa3d4e31ac9df258dcf076b5dbadf0 Mon Sep 17 00:00:00 2001 From: Horia Geant? Date: Mon, 11 May 2015 20:04:49 +0300 Subject: [PATCH 031/359] Revert "crypto: talitos - convert to use be16_add_cpu()" commit 69d9cd8c592f1abce820dbce7181bbbf6812cfbd upstream. This reverts commit 7291a932c6e27d9768e374e9d648086636daf61c. The conversion to be16_add_cpu() is incorrect in case cryptlen is negative due to premature (i.e. before addition / subtraction) implicit conversion of cryptlen (int -> u16) leading to sign loss. Cc: Wei Yongjun Signed-off-by: Horia Geanta Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/talitos.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 9723b3dcebe79a..057d894eee667c 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c @@ -935,7 +935,8 @@ static int sg_to_link_tbl(struct scatterlist *sg, int sg_count, sg_count--; link_tbl_ptr--; } - be16_add_cpu(&link_tbl_ptr->len, cryptlen); + link_tbl_ptr->len = cpu_to_be16(be16_to_cpu(link_tbl_ptr->len) + + cryptlen); /* tag end of link table */ link_tbl_ptr->j_extent = DESC_PTR_LNKTBL_RETURN; From 06efcc8678f2f688680a058ae3ea9aa21925bf9a Mon Sep 17 00:00:00 2001 From: Marc Zyngier Date: Mon, 16 Mar 2015 10:59:43 +0000 Subject: [PATCH 032/359] arm: KVM: force execution of HCPTR access on VM exit commit 85e84ba31039595995dae80b277378213602891b upstream. On VM entry, we disable access to the VFP registers in order to perform a lazy save/restore of these registers. On VM exit, we restore access, test if we did enable them before, and save/restore the guest/host registers if necessary. In this sequence, the FPEXC register is always accessed, irrespective of the trapping configuration. If the guest didn't touch the VFP registers, then the HCPTR access has now enabled such access, but we're missing a barrier to ensure architectural execution of the new HCPTR configuration. If the HCPTR access has been delayed/reordered, the subsequent access to FPEXC will cause a trap, which we aren't prepared to handle at all. The same condition exists when trapping to enable VFP for the guest. The fix is to introduce a barrier after enabling VFP access. In the vmexit case, it can be relaxed to only takes place if the guest hasn't accessed its view of the VFP registers, making the access to FPEXC safe. The set_hcptr macro is modified to deal with both vmenter/vmexit and vmtrap operations, and now takes an optional label that is branched to when the guest hasn't touched the VFP registers. Reported-by: Vikram Sethi Signed-off-by: Marc Zyngier Signed-off-by: Greg Kroah-Hartman --- arch/arm/kvm/interrupts.S | 10 ++++------ arch/arm/kvm/interrupts_head.S | 20 ++++++++++++++++++-- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/arch/arm/kvm/interrupts.S b/arch/arm/kvm/interrupts.S index 16cd4ba5d7fd6d..bb117abb1b3ba6 100644 --- a/arch/arm/kvm/interrupts.S +++ b/arch/arm/kvm/interrupts.S @@ -159,13 +159,9 @@ __kvm_vcpu_return: @ Don't trap coprocessor accesses for host kernel set_hstr vmexit set_hdcr vmexit - set_hcptr vmexit, (HCPTR_TTA | HCPTR_TCP(10) | HCPTR_TCP(11)) + set_hcptr vmexit, (HCPTR_TTA | HCPTR_TCP(10) | HCPTR_TCP(11)), after_vfp_restore #ifdef CONFIG_VFPv3 - @ Save floating point registers we if let guest use them. - tst r2, #(HCPTR_TCP(10) | HCPTR_TCP(11)) - bne after_vfp_restore - @ Switch VFP/NEON hardware state to the host's add r7, vcpu, #VCPU_VFP_GUEST store_vfp_state r7 @@ -177,6 +173,8 @@ after_vfp_restore: @ Restore FPEXC_EN which we clobbered on entry pop {r2} VFPFMXR FPEXC, r2 +#else +after_vfp_restore: #endif @ Reset Hyp-role @@ -458,7 +456,7 @@ switch_to_guest_vfp: push {r3-r7} @ NEON/VFP used. Turn on VFP access. - set_hcptr vmexit, (HCPTR_TCP(10) | HCPTR_TCP(11)) + set_hcptr vmtrap, (HCPTR_TCP(10) | HCPTR_TCP(11)) @ Switch VFP/NEON hardware state to the guest's add r7, r0, #VCPU_VFP_HOST diff --git a/arch/arm/kvm/interrupts_head.S b/arch/arm/kvm/interrupts_head.S index 6f18695a09cb5b..b6f6137f59846a 100644 --- a/arch/arm/kvm/interrupts_head.S +++ b/arch/arm/kvm/interrupts_head.S @@ -570,8 +570,13 @@ vcpu .req r0 @ vcpu pointer always in r0 .endm /* Configures the HCPTR (Hyp Coprocessor Trap Register) on entry/return - * (hardware reset value is 0). Keep previous value in r2. */ -.macro set_hcptr operation, mask + * (hardware reset value is 0). Keep previous value in r2. + * An ISB is emited on vmexit/vmtrap, but executed on vmexit only if + * VFP wasn't already enabled (always executed on vmtrap). + * If a label is specified with vmexit, it is branched to if VFP wasn't + * enabled. + */ +.macro set_hcptr operation, mask, label = none mrc p15, 4, r2, c1, c1, 2 ldr r3, =\mask .if \operation == vmentry @@ -580,6 +585,17 @@ vcpu .req r0 @ vcpu pointer always in r0 bic r3, r2, r3 @ Don't trap defined coproc-accesses .endif mcr p15, 4, r3, c1, c1, 2 + .if \operation != vmentry + .if \operation == vmexit + tst r2, #(HCPTR_TCP(10) | HCPTR_TCP(11)) + beq 1f + .endif + isb + .if \label != none + b \label + .endif +1: + .endif .endm /* Configures the HDCR (Hyp Debug Configuration Register) on entry/return From aa517b185cf09969c4783d04de3243ee5d60adad Mon Sep 17 00:00:00 2001 From: Anton Blanchard Date: Tue, 26 May 2015 15:10:24 +1000 Subject: [PATCH 033/359] powerpc/perf: Fix book3s kernel to userspace backtraces commit 72e349f1124a114435e599479c9b8d14bfd1ebcd upstream. When we take a PMU exception or a software event we call perf_read_regs(). This overloads regs->result with a boolean that describes if we should use the sampled instruction address register (SIAR) or the regs. If the exception is in kernel, we start with the kernel regs and backtrace through the kernel stack. At this point we switch to the userspace regs and backtrace the user stack with perf_callchain_user(). Unfortunately these regs have not got the perf_read_regs() treatment, so regs->result could be anything. If it is non zero, perf_instruction_pointer() decides to use the SIAR, and we get issues like this: 0.11% qemu-system-ppc [kernel.kallsyms] [k] _raw_spin_lock_irqsave | ---_raw_spin_lock_irqsave | |--52.35%-- 0 | | | |--46.39%-- __hrtimer_start_range_ns | | kvmppc_run_core | | kvmppc_vcpu_run_hv | | kvmppc_vcpu_run | | kvm_arch_vcpu_ioctl_run | | kvm_vcpu_ioctl | | do_vfs_ioctl | | sys_ioctl | | system_call | | | | | |--67.08%-- _raw_spin_lock_irqsave <--- hi mum | | | | | | | --100.00%-- 0x7e714 | | | 0x7e714 Notice the bogus _raw_spin_irqsave when we transition from kernel (system_call) to userspace (0x7e714). We inserted what was in the SIAR. Add a check in regs_use_siar() to check that the regs in question are from a PMU exception. With this fix the backtrace makes sense: 0.47% qemu-system-ppc [kernel.vmlinux] [k] _raw_spin_lock_irqsave | ---_raw_spin_lock_irqsave | |--53.83%-- 0 | | | |--44.73%-- hrtimer_try_to_cancel | | kvmppc_start_thread | | kvmppc_run_core | | kvmppc_vcpu_run_hv | | kvmppc_vcpu_run | | kvm_arch_vcpu_ioctl_run | | kvm_vcpu_ioctl | | do_vfs_ioctl | | sys_ioctl | | system_call | | __ioctl | | 0x7e714 | | 0x7e714 Signed-off-by: Anton Blanchard Signed-off-by: Michael Ellerman Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/perf/core-book3s.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c index 846861a20b0730..b63dc809596d52 100644 --- a/arch/powerpc/perf/core-book3s.c +++ b/arch/powerpc/perf/core-book3s.c @@ -112,7 +112,16 @@ static inline void power_pmu_bhrb_read(struct cpu_hw_events *cpuhw) {} static bool regs_use_siar(struct pt_regs *regs) { - return !!regs->result; + /* + * When we take a performance monitor exception the regs are setup + * using perf_read_regs() which overloads some fields, in particular + * regs->result to tell us whether to use SIAR. + * + * However if the regs are from another exception, eg. a syscall, then + * they have not been setup using perf_read_regs() and so regs->result + * is something random. + */ + return ((TRAP(regs) == 0xf00) && regs->result); } /* From dc86cafe9a0c6d10c2e1a7c6d6e3ff1c98b65edc Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Tue, 9 Jun 2015 18:54:07 -0500 Subject: [PATCH 034/359] x86/PCI: Use host bridge _CRS info on Foxconn K8M890-8237A commit 1dace0116d0b05c967d94644fc4dfe96be2ecd3d upstream. The Foxconn K8M890-8237A has two PCI host bridges, and we can't assign resources correctly without the information from _CRS that tells us which address ranges are claimed by which bridge. In the bugs mentioned below, we incorrectly assign a sound card address (this example is from 1033299): bus: 00 index 2 [mem 0x80000000-0xfcffffffff] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-7f]) pci_root PNP0A08:00: host bridge window [mem 0x80000000-0xbfefffff] (ignored) pci_root PNP0A08:00: host bridge window [mem 0xc0000000-0xdfffffff] (ignored) pci_root PNP0A08:00: host bridge window [mem 0xf0000000-0xfebfffff] (ignored) ACPI: PCI Root Bridge [PCI1] (domain 0000 [bus 80-ff]) pci_root PNP0A08:01: host bridge window [mem 0xbff00000-0xbfffffff] (ignored) pci 0000:80:01.0: [1106:3288] type 0 class 0x000403 pci 0000:80:01.0: reg 10: [mem 0xbfffc000-0xbfffffff 64bit] pci 0000:80:01.0: address space collision: [mem 0xbfffc000-0xbfffffff 64bit] conflicts with PCI Bus #00 [mem 0x80000000-0xfcffffffff] pci 0000:80:01.0: BAR 0: assigned [mem 0xfd00000000-0xfd00003fff 64bit] BUG: unable to handle kernel paging request at ffffc90000378000 IP: [] azx_create+0x37c/0x822 [snd_hda_intel] We assigned 0xfd_0000_0000, but that is not in any of the host bridge windows, and the sound card doesn't work. Turn on pci=use_crs automatically for this system. Link: https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/931368 Link: https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1033299 Signed-off-by: Bjorn Helgaas Signed-off-by: Greg Kroah-Hartman --- arch/x86/pci/acpi.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c index 3e724256dbee6b..a3b0265c2ca716 100644 --- a/arch/x86/pci/acpi.c +++ b/arch/x86/pci/acpi.c @@ -84,6 +84,17 @@ static const struct dmi_system_id pci_crs_quirks[] __initconst = { DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies, LTD"), }, }, + /* https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/931368 */ + /* https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1033299 */ + { + .callback = set_use_crs, + .ident = "Foxconn K8M890-8237A", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Foxconn"), + DMI_MATCH(DMI_BOARD_NAME, "K8M890-8237A"), + DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies, LTD"), + }, + }, /* Now for the blacklist.. */ From ce2eb12c5858e7d67a4e22188734e0136c311d8e Mon Sep 17 00:00:00 2001 From: James Hogan Date: Mon, 27 Apr 2015 15:07:16 +0100 Subject: [PATCH 035/359] MIPS: Fix KVM guest fixmap address commit 8e748c8d09a9314eedb5c6367d9acfaacddcdc88 upstream. KVM guest kernels for trap & emulate run in user mode, with a modified set of kernel memory segments. However the fixmap address is still in the normal KSeg3 region at 0xfffe0000 regardless, causing problems when cache alias handling makes use of them when handling copy on write. Therefore define FIXADDR_TOP as 0x7ffe0000 in the guest kernel mapped region when CONFIG_KVM_GUEST is defined. Signed-off-by: James Hogan Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/9887/ Signed-off-by: Ralf Baechle Signed-off-by: Greg Kroah-Hartman --- arch/mips/include/asm/mach-generic/spaces.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/mips/include/asm/mach-generic/spaces.h b/arch/mips/include/asm/mach-generic/spaces.h index 5b2f2e68e57f08..503eb6ca5802a3 100644 --- a/arch/mips/include/asm/mach-generic/spaces.h +++ b/arch/mips/include/asm/mach-generic/spaces.h @@ -90,7 +90,11 @@ #endif #ifndef FIXADDR_TOP +#ifdef CONFIG_KVM_GUEST +#define FIXADDR_TOP ((unsigned long)(long)(int)0x7ffe0000) +#else #define FIXADDR_TOP ((unsigned long)(long)(int)0xfffe0000) #endif +#endif #endif /* __ASM_MACH_GENERIC_SPACES_H */ From 455aa7c4b828827944a2b24df33de9b64b8d18cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Date: Wed, 1 Jul 2015 15:31:49 +0200 Subject: [PATCH 036/359] KVM: x86: make vapics_in_nmi_mode atomic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 42720138b06301cc8a7ee8a495a6d021c4b6a9bc upstream. Writes were a bit racy, but hard to turn into a bug at the same time. (Particularly because modern Linux doesn't use this feature anymore.) Signed-off-by: Radim Krčmář [Actually the next patch makes it much, much easier to trigger the race so I'm including this one for stable@ as well. - Paolo] Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- arch/x86/include/asm/kvm_host.h | 2 +- arch/x86/kvm/i8254.c | 2 +- arch/x86/kvm/lapic.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 4c481e751e8e29..98b68c2f1a1cfa 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -541,7 +541,7 @@ struct kvm_arch { struct kvm_pic *vpic; struct kvm_ioapic *vioapic; struct kvm_pit *vpit; - int vapics_in_nmi_mode; + atomic_t vapics_in_nmi_mode; struct mutex apic_map_lock; struct kvm_apic_map *apic_map; diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c index 298781d4cfb44b..1406ffde3e35c0 100644 --- a/arch/x86/kvm/i8254.c +++ b/arch/x86/kvm/i8254.c @@ -305,7 +305,7 @@ static void pit_do_work(struct kthread_work *work) * LVT0 to NMI delivery. Other PIC interrupts are just sent to * VCPU0, and only if its LVT0 is in EXTINT mode. */ - if (kvm->arch.vapics_in_nmi_mode > 0) + if (atomic_read(&kvm->arch.vapics_in_nmi_mode) > 0) kvm_for_each_vcpu(i, vcpu, kvm) kvm_apic_nmi_wd_deliver(vcpu); } diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index 681e4e251f0003..ff280209d7de67 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c @@ -1123,10 +1123,10 @@ static void apic_manage_nmi_watchdog(struct kvm_lapic *apic, u32 lvt0_val) if (!nmi_wd_enabled) { apic_debug("Receive NMI setting on APIC_LVT0 " "for cpu %d\n", apic->vcpu->vcpu_id); - apic->vcpu->kvm->arch.vapics_in_nmi_mode++; + atomic_inc(&apic->vcpu->kvm->arch.vapics_in_nmi_mode); } } else if (nmi_wd_enabled) - apic->vcpu->kvm->arch.vapics_in_nmi_mode--; + atomic_dec(&apic->vcpu->kvm->arch.vapics_in_nmi_mode); } static int apic_reg_write(struct kvm_lapic *apic, u32 reg, u32 val) From 9b9724dc865428f0bc900f653b636456e81d8e3b Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Thu, 21 May 2015 16:05:52 +0200 Subject: [PATCH 037/359] fs: Fix S_NOSEC handling commit 2426f3910069ed47c0cc58559a6d088af7920201 upstream. file_remove_suid() could mistakenly set S_NOSEC inode bit when root was modifying the file. As a result following writes to the file by ordinary user would avoid clearing suid or sgid bits. Fix the bug by checking actual mode bits before setting S_NOSEC. Signed-off-by: Jan Kara Signed-off-by: Al Viro Signed-off-by: Greg Kroah-Hartman --- fs/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/inode.c b/fs/inode.c index 1b300a06b8be34..17f95b417955d3 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -1628,8 +1628,8 @@ int file_remove_suid(struct file *file) error = security_inode_killpriv(dentry); if (!error && killsuid) error = __remove_suid(dentry, killsuid); - if (!error && (inode->i_sb->s_flags & MS_NOSEC)) - inode->i_flags |= S_NOSEC; + if (!error) + inode_has_no_xattr(inode); return error; } From f1178e991adbe6ea8a7524c8c83fa479dc26c765 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 10 Jul 2015 10:40:38 -0700 Subject: [PATCH 038/359] Linux 3.10.84 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 21529dbcc11dfe..f7b10bb56737a3 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 10 -SUBLEVEL = 83 +SUBLEVEL = 84 EXTRAVERSION = NAME = TOSSUG Baby Fish From fc48f054b6be4c79ff44984374d6d6350ad1df92 Mon Sep 17 00:00:00 2001 From: Brian King Date: Wed, 13 May 2015 08:50:27 -0500 Subject: [PATCH 039/359] ipr: Increase default adapter init stage change timeout commit 45c44b5ff9caa743ed9c2bfd44307c536c9caf1e upstream. Increase the default init stage change timeout from 15 seconds to 30 seconds. This resolves issues we have seen with some adapters not transitioning to the first init stage within 15 seconds, which results in adapter initialization failures. Signed-off-by: Brian King Signed-off-by: James Bottomley Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/ipr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h index 535f57328a72d1..c1991155403691 100644 --- a/drivers/scsi/ipr.h +++ b/drivers/scsi/ipr.h @@ -257,7 +257,7 @@ #define IPR_RUNTIME_RESET 0x40000000 #define IPR_IPL_INIT_MIN_STAGE_TIME 5 -#define IPR_IPL_INIT_DEFAULT_STAGE_TIME 15 +#define IPR_IPL_INIT_DEFAULT_STAGE_TIME 30 #define IPR_IPL_INIT_STAGE_UNKNOWN 0x0 #define IPR_IPL_INIT_STAGE_TRANSOP 0xB0000000 #define IPR_IPL_INIT_STAGE_MASK 0xff000000 From f6bdfa036e1cda4caaa364362b239c05da817f2a Mon Sep 17 00:00:00 2001 From: Ryan Underwood Date: Sun, 25 Jan 2015 16:07:09 -0800 Subject: [PATCH 040/359] Disable write buffering on Toshiba ToPIC95 commit 2fb22a8042fe96b4220843f79241c116d90922c4 upstream. Disable write buffering on the Toshiba ToPIC95 if it is enabled by somebody (it is not supposed to be a power-on default according to the datasheet). On the ToPIC95, practically no 32-bit Cardbus card will work under heavy load without locking up the whole system if this is left enabled. I tried about a dozen. It does not affect 16-bit cards. This is similar to the O2 bugs in early controller revisions it seems. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=55961 Signed-off-by: Ryan C. Underwood Signed-off-by: Dominik Brodowski Signed-off-by: Greg Kroah-Hartman --- drivers/pcmcia/topic.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/pcmcia/topic.h b/drivers/pcmcia/topic.h index 615a45a8fe8674..582688fe750540 100644 --- a/drivers/pcmcia/topic.h +++ b/drivers/pcmcia/topic.h @@ -104,6 +104,9 @@ #define TOPIC_EXCA_IF_CONTROL 0x3e /* 8 bit */ #define TOPIC_EXCA_IFC_33V_ENA 0x01 +#define TOPIC_PCI_CFG_PPBCN 0x3e /* 16-bit */ +#define TOPIC_PCI_CFG_PPBCN_WBEN 0x0400 + static void topic97_zoom_video(struct pcmcia_socket *sock, int onoff) { struct yenta_socket *socket = container_of(sock, struct yenta_socket, socket); @@ -138,6 +141,7 @@ static int topic97_override(struct yenta_socket *socket) static int topic95_override(struct yenta_socket *socket) { u8 fctrl; + u16 ppbcn; /* enable 3.3V support for 16bit cards */ fctrl = exca_readb(socket, TOPIC_EXCA_IF_CONTROL); @@ -146,6 +150,18 @@ static int topic95_override(struct yenta_socket *socket) /* tell yenta to use exca registers to power 16bit cards */ socket->flags |= YENTA_16BIT_POWER_EXCA | YENTA_16BIT_POWER_DF; + /* Disable write buffers to prevent lockups under load with numerous + Cardbus cards, observed on Tecra 500CDT and reported elsewhere on the + net. This is not a power-on default according to the datasheet + but some BIOSes seem to set it. */ + if (pci_read_config_word(socket->dev, TOPIC_PCI_CFG_PPBCN, &ppbcn) == 0 + && socket->dev->revision <= 7 + && (ppbcn & TOPIC_PCI_CFG_PPBCN_WBEN)) { + ppbcn &= ~TOPIC_PCI_CFG_PPBCN_WBEN; + pci_write_config_word(socket->dev, TOPIC_PCI_CFG_PPBCN, ppbcn); + dev_info(&socket->dev->dev, "Disabled ToPIC95 Cardbus write buffers.\n"); + } + return 0; } From 783491448e84bf87387a88c927797c9cccd9bafc Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Sat, 27 Jun 2015 10:21:13 +0200 Subject: [PATCH 041/359] ALSA: hda - Add headset support to Acer Aspire V5 commit 7819717b11346b8a5420b223b46600e394049c66 upstream. Acer Aspire V5 with ALC282 codec needs the similar quirk like Dell laptops to support the headset mic. The headset mic pin is 0x19 and it's not exposed by BIOS, thus we need to fix the pincfg as well. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=96201 Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/pci/hda/patch_realtek.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index ca2094c914a199..5c7b68278638d2 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -3383,6 +3383,7 @@ enum { ALC290_FIXUP_MONO_SPEAKERS, ALC269_FIXUP_HEADSET_MODE, ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, + ALC269_FIXUP_ASPIRE_HEADSET_MIC, ALC269_FIXUP_ASUS_X101_FUNC, ALC269_FIXUP_ASUS_X101_VERB, ALC269_FIXUP_ASUS_X101, @@ -3598,6 +3599,15 @@ static const struct hda_fixup alc269_fixups[] = { .type = HDA_FIXUP_FUNC, .v.func = alc_fixup_headset_mode_no_hp_mic, }, + [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = { + .type = HDA_FIXUP_PINS, + .v.pins = (const struct hda_pintbl[]) { + { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */ + { } + }, + .chained = true, + .chain_id = ALC269_FIXUP_HEADSET_MODE, + }, [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = { .type = HDA_FIXUP_PINS, .v.pins = (const struct hda_pintbl[]) { @@ -3732,6 +3742,8 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700), + SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC), + SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC), SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK), SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK), SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC), From b56a832ec87e8018188e2b8c4066db059888e74a Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 29 Jun 2015 08:38:02 +0200 Subject: [PATCH 042/359] ALSA: hda - Fix the dock headphone output on Fujitsu Lifebook E780 commit 4df3fd1700abbb53bd874143dfd1f9ac9e7cbf4b upstream. Fujitsu Lifebook E780 sets the sequence number 0x0f to only only of the two headphones, thus the driver tries to assign another as the line-out, and this results in the inconsistent mapping between the created jack ctl and the actual I/O. Due to this, PulseAudio doesn't handle it properly and gets the silent output. The fix is to ignore the non-HP sequencer checks. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=99681 Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/pci/hda/patch_realtek.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 5c7b68278638d2..a82d6576fe0f3d 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -3365,6 +3365,7 @@ enum { ALC269_FIXUP_LIFEBOOK, ALC269_FIXUP_LIFEBOOK_EXTMIC, ALC269_FIXUP_LIFEBOOK_HP_PIN, + ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT, ALC269_FIXUP_AMIC, ALC269_FIXUP_DMIC, ALC269VB_FIXUP_AMIC, @@ -3487,6 +3488,10 @@ static const struct hda_fixup alc269_fixups[] = { { } }, }, + [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc269_fixup_pincfg_no_hp_to_lineout, + }, [ALC269_FIXUP_AMIC] = { .type = HDA_FIXUP_PINS, .v.pins = (const struct hda_pintbl[]) { @@ -3748,6 +3753,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK), SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC), SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK), + SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT), SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN), SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN), SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC), From ea207ff62ff67ce30e1a5d19c162a2a17f4d62dc Mon Sep 17 00:00:00 2001 From: Vineet Gupta Date: Thu, 13 Nov 2014 15:54:01 +0530 Subject: [PATCH 043/359] ARC: add compiler barrier to LLSC based cmpxchg commit d57f727264f1425a94689bafc7e99e502cb135b5 upstream. When auditing cmpxchg call sites, Chuck noted that gcc was optimizing away some of the desired LDs. | do { | new = old = *ipi_data_ptr; | new |= 1U << msg; | } while (cmpxchg(ipi_data_ptr, old, new) != old); was generating to below | 8015cef8: ld r2,[r4,0] <-- First LD | 8015cefc: bset r1,r2,r1 | | 8015cf00: llock r3,[r4] <-- atomic op | 8015cf04: brne r3,r2,8015cf10 | 8015cf08: scond r1,[r4] | 8015cf0c: bnz 8015cf00 | | 8015cf10: brne r3,r2,8015cf00 <-- Branch doesn't go to orig LD Although this was fixed by adding a ACCESS_ONCE in this call site, it seems safer (for now at least) to add compiler barrier to LLSC based cmpxchg Reported-by: Chuck Jordan Acked-by: Peter Zijlstra (Intel) Signed-off-by: Vineet Gupta Signed-off-by: Greg Kroah-Hartman --- arch/arc/include/asm/cmpxchg.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/arc/include/asm/cmpxchg.h b/arch/arc/include/asm/cmpxchg.h index 03cd6894855d61..90de5c528da221 100644 --- a/arch/arc/include/asm/cmpxchg.h +++ b/arch/arc/include/asm/cmpxchg.h @@ -25,10 +25,11 @@ __cmpxchg(volatile void *ptr, unsigned long expected, unsigned long new) " scond %3, [%1] \n" " bnz 1b \n" "2: \n" - : "=&r"(prev) - : "r"(ptr), "ir"(expected), - "r"(new) /* can't be "ir". scond can't take limm for "b" */ - : "cc"); + : "=&r"(prev) /* Early clobber, to prevent reg reuse */ + : "r"(ptr), /* Not "m": llock only supports reg direct addr mode */ + "ir"(expected), + "r"(new) /* can't be "ir". scond can't take LIMM for "b" */ + : "cc", "memory"); /* so that gcc knows memory is being written here */ return prev; } From 2b97cbc8c4e7d0f06b49695636306b65bed20cf2 Mon Sep 17 00:00:00 2001 From: Catalin Marinas Date: Fri, 12 Jun 2015 11:24:41 +0100 Subject: [PATCH 044/359] arm64: Do not attempt to use init_mm in reset_context() commit 565630d503ef24e44c252bed55571b3a0d68455f upstream. After secondary CPU boot or hotplug, the active_mm of the idle thread is &init_mm. The init_mm.pgd (swapper_pg_dir) is only meant for TTBR1_EL1 and must not be set in TTBR0_EL1. Since when active_mm == &init_mm the TTBR0_EL1 is already set to the reserved value, there is no need to perform any context reset. Signed-off-by: Catalin Marinas Signed-off-by: Greg Kroah-Hartman --- arch/arm64/mm/context.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm64/mm/context.c b/arch/arm64/mm/context.c index baa758d370210e..76c1e6cd36fc46 100644 --- a/arch/arm64/mm/context.c +++ b/arch/arm64/mm/context.c @@ -92,6 +92,14 @@ static void reset_context(void *info) unsigned int cpu = smp_processor_id(); struct mm_struct *mm = current->active_mm; + /* + * current->active_mm could be init_mm for the idle thread immediately + * after secondary CPU boot or hotplug. TTBR0_EL1 is already set to + * the reserved value, so no need to reset any context. + */ + if (mm == &init_mm) + return; + smp_rmb(); asid = cpu_last_asid + cpu; From 39ae2d098ad5cb37ce664d758ee9c3fc449a4940 Mon Sep 17 00:00:00 2001 From: Dave P Martin Date: Tue, 16 Jun 2015 17:38:47 +0100 Subject: [PATCH 045/359] arm64: mm: Fix freeing of the wrong memmap entries with !SPARSEMEM_VMEMMAP commit b9bcc919931611498e856eae9bf66337330d04cc upstream. The memmap freeing code in free_unused_memmap() computes the end of each memblock by adding the memblock size onto the base. However, if SPARSEMEM is enabled then the value (start) used for the base may already have been rounded downwards to work out which memmap entries to free after the previous memblock. This may cause memmap entries that are in use to get freed. In general, you're not likely to hit this problem unless there are at least 2 memblocks and one of them is not aligned to a sparsemem section boundary. Note that carve-outs can increase the number of memblocks by splitting the regions listed in the device tree. This problem doesn't occur with SPARSEMEM_VMEMMAP, because the vmemmap code deals with freeing the unused regions of the memmap instead of requiring the arch code to do it. This patch gets the memblock base out of the memblock directly when computing the block end address to ensure the correct value is used. Signed-off-by: Dave Martin Signed-off-by: Catalin Marinas Signed-off-by: Greg Kroah-Hartman --- arch/arm64/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index f497ca77925ac7..5c5516611b5e5f 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -262,7 +262,7 @@ static void __init free_unused_memmap(void) * memmap entries are valid from the bank end aligned to * MAX_ORDER_NR_PAGES. */ - prev_end = ALIGN(start + __phys_to_pfn(reg->size), + prev_end = ALIGN(__phys_to_pfn(reg->base + reg->size), MAX_ORDER_NR_PAGES); } From 6ec153c599f17f93afb650b42922379735196602 Mon Sep 17 00:00:00 2001 From: Will Deacon Date: Fri, 19 Jun 2015 13:56:33 +0100 Subject: [PATCH 046/359] arm64: vdso: work-around broken ELF toolchains in Makefile commit 6f1a6ae87c0c60d7c462ef8fd071f291aa7a9abb upstream. When building the kernel with a bare-metal (ELF) toolchain, the -shared option may not be passed down to collect2, resulting in silent corruption of the vDSO image (in particular, the DYNAMIC section is omitted). The effect of this corruption is that the dynamic linker fails to find the vDSO symbols and libc is instead used for the syscalls that we intended to optimise (e.g. gettimeofday). Functionally, there is no issue as the sigreturn trampoline is still intact and located by the kernel. This patch fixes the problem by explicitly passing -shared to the linker when building the vDSO. Reported-by: Szabolcs Nagy Reported-by: James Greenlaigh Signed-off-by: Will Deacon Signed-off-by: Catalin Marinas Signed-off-by: Greg Kroah-Hartman --- arch/arm64/kernel/vdso/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/kernel/vdso/Makefile b/arch/arm64/kernel/vdso/Makefile index 6d20b7d162d834..fdda6dd71ac628 100644 --- a/arch/arm64/kernel/vdso/Makefile +++ b/arch/arm64/kernel/vdso/Makefile @@ -15,6 +15,10 @@ ccflags-y := -shared -fno-common -fno-builtin ccflags-y += -nostdlib -Wl,-soname=linux-vdso.so.1 \ $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) +# Workaround for bare-metal (ELF) toolchains that neglect to pass -shared +# down to collect2, resulting in silent corruption of the vDSO image. +ccflags-y += -Wl,-shared + obj-y += vdso.o extra-y += vdso.lds vdso-offsets.h CPPFLAGS_vdso.lds += -P -C -U$(ARCH) From c24d75b7294314d9a07af26a8d062185b9314bea Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Thu, 1 May 2014 00:14:04 +0200 Subject: [PATCH 047/359] cpuidle / menu: Return (-1) if there are no suitable states commit 3836785a1bdcd6706c68ad46bf53adc0b057b310 upstream. If there is a PM QoS latency limit and all of the sufficiently shallow C-states are disabled, the cpuidle menu governor returns 0 which on some systems is CPUIDLE_DRIVER_STATE_START and shouldn't be returned if that C-state has been disabled. Fix the issue by modifying the menu governor to return (-1) in such situations. Signed-off-by: Rafael J. Wysocki [shilpab: Backport to 3.10.y - adjust context - add a check if 'next_state' is less than 0 in 'cpuidle_idle_call()', this ensures that we exit 'cpuidle_idle_call()' if governor->select() returns negative value] Signed-off-by: Shilpasri G Bhat Signed-off-by: Greg Kroah-Hartman --- drivers/cpuidle/cpuidle.c | 3 +++ drivers/cpuidle/governors/menu.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index c3a93fece819e7..5b11022d774566 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c @@ -135,6 +135,9 @@ int cpuidle_idle_call(void) /* ask the governor for the next state */ next_state = cpuidle_curr_governor->select(drv, dev); + if (next_state < 0) + return -EBUSY; + if (need_resched()) { dev->last_residency = 0; /* give the governor an opportunity to reflect on the outcome */ diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c index bc580b67a65298..67fd901f6fc9cb 100644 --- a/drivers/cpuidle/governors/menu.c +++ b/drivers/cpuidle/governors/menu.c @@ -269,7 +269,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev) data->needs_update = 0; } - data->last_state_idx = 0; + data->last_state_idx = CPUIDLE_DRIVER_STATE_START - 1; data->exit_us = 0; /* Special case when user has set very strict latency requirement */ From c9f4682139e837bb46eb0e19a0a728c573cc2ab4 Mon Sep 17 00:00:00 2001 From: Arun Chandran Date: Mon, 15 Jun 2015 15:59:02 +0530 Subject: [PATCH 048/359] regmap: Fix regmap_bulk_read in BE mode commit 15b8d2c41fe5839582029f65c5f7004db451cc2b upstream. In big endian mode regmap_bulk_read gives incorrect data for byte reads. This is because memcpy of a single byte from an address after full word read gives different results when endianness differs. ie. we get little-end in LE and big-end in BE. Signed-off-by: Arun Chandran Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- drivers/base/regmap/regmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index 6a66f0b7d3d466..4f3d70a9d7219b 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -1586,7 +1586,7 @@ int regmap_bulk_read(struct regmap *map, unsigned int reg, void *val, &ival); if (ret != 0) return ret; - memcpy(val + (i * val_bytes), &ival, val_bytes); + map->format.format_val(val + (i * val_bytes), ival, 0); } } From bd5bf922932d344cc602998a6abae4492fed82cd Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Tue, 9 Jun 2015 20:09:42 +0000 Subject: [PATCH 049/359] regulator: core: fix constraints output buffer commit a7068e3932eee8268c4ce4e080a338ee7b8a27bf upstream. The buffer for condtraints debug isn't big enough to hold the output in all cases. So fix this issue by increasing the buffer. Signed-off-by: Stefan Wahren Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- drivers/regulator/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 283212aa103c2d..70ccc20100546f 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -769,7 +769,7 @@ static int suspend_prepare(struct regulator_dev *rdev, suspend_state_t state) static void print_constraints(struct regulator_dev *rdev) { struct regulation_constraints *constraints = rdev->constraints; - char buf[80] = ""; + char buf[160] = ""; int count = 0; int ret; From 84df71dfcb03bc019268fc0220e281050c2ebee4 Mon Sep 17 00:00:00 2001 From: Ezequiel Garcia Date: Mon, 11 May 2015 12:20:18 -0300 Subject: [PATCH 050/359] spi: pl022: Specify 'num-cs' property as required in devicetree binding commit ea6055c46eda1e19e02209814955e13f334bbe1b upstream. Since commit 39a6ac11df65 ("spi/pl022: Devicetree support w/o platform data") the 'num-cs' parameter cannot be passed through platform data when probing with devicetree. Instead, it's a required devicetree property. Fix the binding documentation so the property is properly specified. Fixes: 39a6ac11df65 ("spi/pl022: Devicetree support w/o platform data") Signed-off-by: Ezequiel Garcia Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- Documentation/devicetree/bindings/spi/spi_pl022.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/spi/spi_pl022.txt b/Documentation/devicetree/bindings/spi/spi_pl022.txt index 22ed6797216d70..4d1673ca8cf802 100644 --- a/Documentation/devicetree/bindings/spi/spi_pl022.txt +++ b/Documentation/devicetree/bindings/spi/spi_pl022.txt @@ -4,9 +4,9 @@ Required properties: - compatible : "arm,pl022", "arm,primecell" - reg : Offset and length of the register set for the device - interrupts : Should contain SPI controller interrupt +- num-cs : total number of chipselects Optional properties: -- num-cs : total number of chipselects - cs-gpios : should specify GPIOs used for chipselects. The gpios will be referred to as reg = in the SPI child nodes. If unspecified, a single SPI device without a chip select can be used. From a3253d76fca662b74ea51ce2643299fb05d9e71b Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Thu, 7 May 2015 17:55:16 -0700 Subject: [PATCH 051/359] mtd: fix: avoid race condition when accessing mtd->usecount commit 073db4a51ee43ccb827f54a4261c0583b028d5ab upstream. On A MIPS 32-cores machine a BUG_ON was triggered because some acesses to mtd->usecount were done without taking mtd_table_mutex. kernel: Call Trace: kernel: [] __put_mtd_device+0x20/0x50 kernel: [] blktrans_release+0x8c/0xd8 kernel: [] __blkdev_put+0x1a8/0x200 kernel: [] blkdev_close+0x1c/0x30 kernel: [] __fput+0xac/0x250 kernel: [] task_work_run+0xd8/0x120 kernel: [] work_notifysig+0x10/0x18 kernel: kernel: Code: 2442ffff ac8202d8 000217fe <00020336> dc820128 10400003 00000000 0040f809 00000000 kernel: ---[ end trace 080fbb4579b47a73 ]--- Fixed by taking the mutex in blktrans_open and blktrans_release. Note that this locking is already suggested in include/linux/mtd/blktrans.h: struct mtd_blktrans_ops { ... /* Called with mtd_table_mutex held; no race with add/remove */ int (*open)(struct mtd_blktrans_dev *dev); void (*release)(struct mtd_blktrans_dev *dev); ... }; But we weren't following it. Originally reported by (and patched by) Zhang and Giuseppe, independently. Improved and rewritten. Reported-by: Zhang Xingcai Reported-by: Giuseppe Cantavenera Tested-by: Giuseppe Cantavenera Acked-by: Alexander Sverdlin Signed-off-by: Brian Norris Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/mtd_blkdevs.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c index 5073cbc796d86c..32d5e40c6863dc 100644 --- a/drivers/mtd/mtd_blkdevs.c +++ b/drivers/mtd/mtd_blkdevs.c @@ -199,6 +199,7 @@ static int blktrans_open(struct block_device *bdev, fmode_t mode) return -ERESTARTSYS; /* FIXME: busy loop! -arnd*/ mutex_lock(&dev->lock); + mutex_lock(&mtd_table_mutex); if (dev->open) goto unlock; @@ -222,6 +223,7 @@ static int blktrans_open(struct block_device *bdev, fmode_t mode) unlock: dev->open++; + mutex_unlock(&mtd_table_mutex); mutex_unlock(&dev->lock); blktrans_dev_put(dev); return ret; @@ -232,6 +234,7 @@ static int blktrans_open(struct block_device *bdev, fmode_t mode) error_put: module_put(dev->tr->owner); kref_put(&dev->ref, blktrans_dev_release); + mutex_unlock(&mtd_table_mutex); mutex_unlock(&dev->lock); blktrans_dev_put(dev); return ret; @@ -245,6 +248,7 @@ static void blktrans_release(struct gendisk *disk, fmode_t mode) return; mutex_lock(&dev->lock); + mutex_lock(&mtd_table_mutex); if (--dev->open) goto unlock; @@ -258,6 +262,7 @@ static void blktrans_release(struct gendisk *disk, fmode_t mode) __put_mtd_device(dev->mtd); } unlock: + mutex_unlock(&mtd_table_mutex); mutex_unlock(&dev->lock); blktrans_dev_put(dev); } From 7f9e2ccd7f142ca51219fdbeb3cb04b9f665966c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Thu, 28 May 2015 10:22:10 +0200 Subject: [PATCH 052/359] mtd: dc21285: use raw spinlock functions for nw_gpio_lock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit e5babdf928e5d0c432a8d4b99f20421ce14d1ab6 upstream. Since commit bd31b85960a7 (which is in 3.2-rc1) nw_gpio_lock is a raw spinlock that needs usage of the corresponding raw functions. This fixes: drivers/mtd/maps/dc21285.c: In function 'nw_en_write': drivers/mtd/maps/dc21285.c:41:340: warning: passing argument 1 of 'spinlock_check' from incompatible pointer type spin_lock_irqsave(&nw_gpio_lock, flags); In file included from include/linux/seqlock.h:35:0, from include/linux/time.h:5, from include/linux/stat.h:18, from include/linux/module.h:10, from drivers/mtd/maps/dc21285.c:8: include/linux/spinlock.h:299:102: note: expected 'struct spinlock_t *' but argument is of type 'struct raw_spinlock_t *' static inline raw_spinlock_t *spinlock_check(spinlock_t *lock) ^ drivers/mtd/maps/dc21285.c:43:25: warning: passing argument 1 of 'spin_unlock_irqrestore' from incompatible pointer type spin_unlock_irqrestore(&nw_gpio_lock, flags); ^ In file included from include/linux/seqlock.h:35:0, from include/linux/time.h:5, from include/linux/stat.h:18, from include/linux/module.h:10, from drivers/mtd/maps/dc21285.c:8: include/linux/spinlock.h:370:91: note: expected 'struct spinlock_t *' but argument is of type 'struct raw_spinlock_t *' static inline void spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags) Fixes: bd31b85960a7 ("locking, ARM: Annotate low level hw locks as raw") Signed-off-by: Uwe Kleine-König Signed-off-by: Brian Norris Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/maps/dc21285.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/maps/dc21285.c b/drivers/mtd/maps/dc21285.c index f8a7dd14cee0cc..70a3db3ab856f4 100644 --- a/drivers/mtd/maps/dc21285.c +++ b/drivers/mtd/maps/dc21285.c @@ -38,9 +38,9 @@ static void nw_en_write(void) * we want to write a bit pattern XXX1 to Xilinx to enable * the write gate, which will be open for about the next 2ms. */ - spin_lock_irqsave(&nw_gpio_lock, flags); + raw_spin_lock_irqsave(&nw_gpio_lock, flags); nw_cpld_modify(CPLD_FLASH_WR_ENABLE, CPLD_FLASH_WR_ENABLE); - spin_unlock_irqrestore(&nw_gpio_lock, flags); + raw_spin_unlock_irqrestore(&nw_gpio_lock, flags); /* * let the ISA bus to catch on... From eef15dcc8010b6bde54f8b20ff876581e0fd2760 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 9 Jun 2015 18:46:54 +0200 Subject: [PATCH 053/359] pinctrl: mvebu: armada-370: fix spi0 pin description commit 438881dfddb9107ef0eb30b49368e91e092f0b3e upstream. Due to a mistake, the CS0 and CS1 SPI0 functions were incorrectly named "spi0-1" instead of just "spi0". This commit fixes that. This DT binding change does not affect any of the in-tree users. Signed-off-by: Thomas Petazzoni Fixes: 5f597bb2be57 ("pinctrl: mvebu: add pinctrl driver for Armada 370") Signed-off-by: Linus Walleij Signed-off-by: Greg Kroah-Hartman --- .../bindings/pinctrl/marvell,armada-370-pinctrl.txt | 4 ++-- drivers/pinctrl/mvebu/pinctrl-armada-370.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/pinctrl/marvell,armada-370-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/marvell,armada-370-pinctrl.txt index 01ef408e205f18..8faff12e7014c2 100644 --- a/Documentation/devicetree/bindings/pinctrl/marvell,armada-370-pinctrl.txt +++ b/Documentation/devicetree/bindings/pinctrl/marvell,armada-370-pinctrl.txt @@ -91,5 +91,5 @@ mpp61 61 gpo, dev(wen1), uart1(txd), audio(rclk) mpp62 62 gpio, dev(a2), uart1(cts), tdm(drx), pcie(clkreq0), audio(mclk), uart0(cts) mpp63 63 gpo, spi0(sck), tclk -mpp64 64 gpio, spi0(miso), spi0-1(cs1) -mpp65 65 gpio, spi0(mosi), spi0-1(cs2) +mpp64 64 gpio, spi0(miso), spi0(cs1) +mpp65 65 gpio, spi0(mosi), spi0(cs2) diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-370.c b/drivers/pinctrl/mvebu/pinctrl-armada-370.c index 48e21a2294830f..c99e64ac8e0827 100644 --- a/drivers/pinctrl/mvebu/pinctrl-armada-370.c +++ b/drivers/pinctrl/mvebu/pinctrl-armada-370.c @@ -358,11 +358,11 @@ static struct mvebu_mpp_mode mv88f6710_mpp_modes[] = { MPP_MODE(64, MPP_FUNCTION(0x0, "gpio", NULL), MPP_FUNCTION(0x1, "spi0", "miso"), - MPP_FUNCTION(0x2, "spi0-1", "cs1")), + MPP_FUNCTION(0x2, "spi0", "cs1")), MPP_MODE(65, MPP_FUNCTION(0x0, "gpio", NULL), MPP_FUNCTION(0x1, "spi0", "mosi"), - MPP_FUNCTION(0x2, "spi0-1", "cs2")), + MPP_FUNCTION(0x2, "spi0", "cs2")), }; static struct mvebu_pinctrl_soc_info armada_370_pinctrl_info; From 74806d71a4449dd8e6dedc921b979108da34fa8b Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 9 Jun 2015 18:46:56 +0200 Subject: [PATCH 054/359] pinctrl: mvebu: armada-xp: remove non-existing NAND pins commit bc99357f3690c11817756adfee0ece811a3db2e7 upstream. After updating to a more recent version of the Armada XP datasheet, we realized that some of the pins documented as having a NAND-related functionality in fact did not have such functionality. This commit updates the pinctrl driver accordingly. Signed-off-by: Thomas Petazzoni Fixes: 463e270f766a ("pinctrl: mvebu: add pinctrl driver for Armada XP") Signed-off-by: Linus Walleij Signed-off-by: Greg Kroah-Hartman --- .../devicetree/bindings/pinctrl/marvell,armada-xp-pinctrl.txt | 4 ++-- drivers/pinctrl/mvebu/pinctrl-armada-xp.c | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/pinctrl/marvell,armada-xp-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/marvell,armada-xp-pinctrl.txt index bfa0a2e5e0cb92..797b3d5e2e58d6 100644 --- a/Documentation/devicetree/bindings/pinctrl/marvell,armada-xp-pinctrl.txt +++ b/Documentation/devicetree/bindings/pinctrl/marvell,armada-xp-pinctrl.txt @@ -41,8 +41,8 @@ mpp20 20 gpio, ge0(rxd4), ge1(rxd2), lcd(d20), ptp(clk) mpp21 21 gpio, ge0(rxd5), ge1(rxd3), lcd(d21), mem(bat) mpp22 22 gpio, ge0(rxd6), ge1(rxctl), lcd(d22), sata0(prsnt) mpp23 23 gpio, ge0(rxd7), ge1(rxclk), lcd(d23), sata1(prsnt) -mpp24 24 gpio, lcd(hsync), sata1(prsnt), nf(bootcs-re), tdm(rst) -mpp25 25 gpio, lcd(vsync), sata0(prsnt), nf(bootcs-we), tdm(pclk) +mpp24 24 gpio, lcd(hsync), sata1(prsnt), tdm(rst) +mpp25 25 gpio, lcd(vsync), sata0(prsnt), tdm(pclk) mpp26 26 gpio, lcd(clk), tdm(fsync), vdd(cpu1-pd) mpp27 27 gpio, lcd(e), tdm(dtx), ptp(trig) mpp28 28 gpio, lcd(pwm), tdm(drx), ptp(evreq) diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-xp.c b/drivers/pinctrl/mvebu/pinctrl-armada-xp.c index ab5dc04b3e8a1f..c5a01aea52b8c0 100644 --- a/drivers/pinctrl/mvebu/pinctrl-armada-xp.c +++ b/drivers/pinctrl/mvebu/pinctrl-armada-xp.c @@ -159,13 +159,11 @@ static struct mvebu_mpp_mode armada_xp_mpp_modes[] = { MPP_MODE(24, MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS), MPP_VAR_FUNCTION(0x1, "sata1", "prsnt", V_MV78230_PLUS), - MPP_VAR_FUNCTION(0x2, "nf", "bootcs-re", V_MV78230_PLUS), MPP_VAR_FUNCTION(0x3, "tdm", "rst", V_MV78230_PLUS), MPP_VAR_FUNCTION(0x4, "lcd", "hsync", V_MV78230_PLUS)), MPP_MODE(25, MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS), MPP_VAR_FUNCTION(0x1, "sata0", "prsnt", V_MV78230_PLUS), - MPP_VAR_FUNCTION(0x2, "nf", "bootcs-we", V_MV78230_PLUS), MPP_VAR_FUNCTION(0x3, "tdm", "pclk", V_MV78230_PLUS), MPP_VAR_FUNCTION(0x4, "lcd", "vsync", V_MV78230_PLUS)), MPP_MODE(26, From d150690472aed58d3208c8a46356c09bff6ca064 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 9 Jun 2015 18:46:57 +0200 Subject: [PATCH 055/359] pinctrl: mvebu: armada-xp: remove non-existing VDD cpu_pd functions commit 80b3d04feab5e69d51cb2375eb989a7165e43e3b upstream. The latest version of the Armada XP datasheet no longer documents the VDD cpu_pd functions, which might indicate they are not working and/or not supported. This commit ensures the pinctrl driver matches the datasheet. Signed-off-by: Thomas Petazzoni Fixes: 463e270f766a ("pinctrl: mvebu: add pinctrl driver for Armada XP") Signed-off-by: Linus Walleij Signed-off-by: Greg Kroah-Hartman --- .../pinctrl/marvell,armada-xp-pinctrl.txt | 26 ++++++--------- drivers/pinctrl/mvebu/pinctrl-armada-xp.c | 33 ++++++------------- 2 files changed, 20 insertions(+), 39 deletions(-) diff --git a/Documentation/devicetree/bindings/pinctrl/marvell,armada-xp-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/marvell,armada-xp-pinctrl.txt index 797b3d5e2e58d6..0ba220bdb17f2d 100644 --- a/Documentation/devicetree/bindings/pinctrl/marvell,armada-xp-pinctrl.txt +++ b/Documentation/devicetree/bindings/pinctrl/marvell,armada-xp-pinctrl.txt @@ -43,13 +43,13 @@ mpp22 22 gpio, ge0(rxd6), ge1(rxctl), lcd(d22), sata0(prsnt) mpp23 23 gpio, ge0(rxd7), ge1(rxclk), lcd(d23), sata1(prsnt) mpp24 24 gpio, lcd(hsync), sata1(prsnt), tdm(rst) mpp25 25 gpio, lcd(vsync), sata0(prsnt), tdm(pclk) -mpp26 26 gpio, lcd(clk), tdm(fsync), vdd(cpu1-pd) +mpp26 26 gpio, lcd(clk), tdm(fsync) mpp27 27 gpio, lcd(e), tdm(dtx), ptp(trig) mpp28 28 gpio, lcd(pwm), tdm(drx), ptp(evreq) -mpp29 29 gpio, lcd(ref-clk), tdm(int0), ptp(clk), vdd(cpu0-pd) +mpp29 29 gpio, lcd(ref-clk), tdm(int0), ptp(clk) mpp30 30 gpio, tdm(int1), sd0(clk) -mpp31 31 gpio, tdm(int2), sd0(cmd), vdd(cpu0-pd) -mpp32 32 gpio, tdm(int3), sd0(d0), vdd(cpu1-pd) +mpp31 31 gpio, tdm(int2), sd0(cmd) +mpp32 32 gpio, tdm(int3), sd0(d0) mpp33 33 gpio, tdm(int4), sd0(d1), mem(bat) mpp34 34 gpio, tdm(int5), sd0(d2), sata0(prsnt) mpp35 35 gpio, tdm(int6), sd0(d3), sata1(prsnt) @@ -57,14 +57,11 @@ mpp36 36 gpio, spi(mosi) mpp37 37 gpio, spi(miso) mpp38 38 gpio, spi(sck) mpp39 39 gpio, spi(cs0) -mpp40 40 gpio, spi(cs1), uart2(cts), lcd(vga-hsync), vdd(cpu1-pd), - pcie(clkreq0) +mpp40 40 gpio, spi(cs1), uart2(cts), lcd(vga-hsync), pcie(clkreq0) mpp41 41 gpio, spi(cs2), uart2(rts), lcd(vga-vsync), sata1(prsnt), pcie(clkreq1) -mpp42 42 gpio, uart2(rxd), uart0(cts), tdm(int7), tdm-1(timer), - vdd(cpu0-pd) -mpp43 43 gpio, uart2(txd), uart0(rts), spi(cs3), pcie(rstout), - vdd(cpu2-3-pd){1} +mpp42 42 gpio, uart2(rxd), uart0(cts), tdm(int7), tdm-1(timer) +mpp43 43 gpio, uart2(txd), uart0(rts), spi(cs3), pcie(rstout) mpp44 44 gpio, uart2(cts), uart3(rxd), spi(cs4), pcie(clkreq2), mem(bat) mpp45 45 gpio, uart2(rts), uart3(txd), spi(cs5), sata1(prsnt) @@ -83,9 +80,9 @@ mpp51 51 gpio, dev(ad16) mpp52 52 gpio, dev(ad17) mpp53 53 gpio, dev(ad18) mpp54 54 gpio, dev(ad19) -mpp55 55 gpio, dev(ad20), vdd(cpu0-pd) -mpp56 56 gpio, dev(ad21), vdd(cpu1-pd) -mpp57 57 gpio, dev(ad22), vdd(cpu2-3-pd){1} +mpp55 55 gpio, dev(ad20) +mpp56 56 gpio, dev(ad21) +mpp57 57 gpio, dev(ad22) mpp58 58 gpio, dev(ad23) mpp59 59 gpio, dev(ad24) mpp60 60 gpio, dev(ad25) @@ -95,6 +92,3 @@ mpp63 63 gpio, dev(ad28) mpp64 64 gpio, dev(ad29) mpp65 65 gpio, dev(ad30) mpp66 66 gpio, dev(ad31) - -Notes: -* {1} vdd(cpu2-3-pd) only available on mv78460. diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-xp.c b/drivers/pinctrl/mvebu/pinctrl-armada-xp.c index c5a01aea52b8c0..4966ee2f7da2b4 100644 --- a/drivers/pinctrl/mvebu/pinctrl-armada-xp.c +++ b/drivers/pinctrl/mvebu/pinctrl-armada-xp.c @@ -14,10 +14,7 @@ * available: mv78230, mv78260 and mv78460. From a pin muxing * perspective, the mv78230 has 49 MPP pins. The mv78260 and mv78460 * both have 67 MPP pins (more GPIOs and address lines for the memory - * bus mainly). The only difference between the mv78260 and the - * mv78460 in terms of pin muxing is the addition of two functions on - * pins 43 and 56 to access the VDD of the CPU2 and 3 (mv78260 has two - * cores, mv78460 has four cores). + * bus mainly). */ #include @@ -169,8 +166,7 @@ static struct mvebu_mpp_mode armada_xp_mpp_modes[] = { MPP_MODE(26, MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS), MPP_VAR_FUNCTION(0x3, "tdm", "fsync", V_MV78230_PLUS), - MPP_VAR_FUNCTION(0x4, "lcd", "clk", V_MV78230_PLUS), - MPP_VAR_FUNCTION(0x5, "vdd", "cpu1-pd", V_MV78230_PLUS)), + MPP_VAR_FUNCTION(0x4, "lcd", "clk", V_MV78230_PLUS)), MPP_MODE(27, MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS), MPP_VAR_FUNCTION(0x1, "ptp", "trig", V_MV78230_PLUS), @@ -185,8 +181,7 @@ static struct mvebu_mpp_mode armada_xp_mpp_modes[] = { MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS), MPP_VAR_FUNCTION(0x1, "ptp", "clk", V_MV78230_PLUS), MPP_VAR_FUNCTION(0x3, "tdm", "int0", V_MV78230_PLUS), - MPP_VAR_FUNCTION(0x4, "lcd", "ref-clk", V_MV78230_PLUS), - MPP_VAR_FUNCTION(0x5, "vdd", "cpu0-pd", V_MV78230_PLUS)), + MPP_VAR_FUNCTION(0x4, "lcd", "ref-clk", V_MV78230_PLUS)), MPP_MODE(30, MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS), MPP_VAR_FUNCTION(0x1, "sd0", "clk", V_MV78230_PLUS), @@ -194,13 +189,11 @@ static struct mvebu_mpp_mode armada_xp_mpp_modes[] = { MPP_MODE(31, MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS), MPP_VAR_FUNCTION(0x1, "sd0", "cmd", V_MV78230_PLUS), - MPP_VAR_FUNCTION(0x3, "tdm", "int2", V_MV78230_PLUS), - MPP_VAR_FUNCTION(0x5, "vdd", "cpu0-pd", V_MV78230_PLUS)), + MPP_VAR_FUNCTION(0x3, "tdm", "int2", V_MV78230_PLUS)), MPP_MODE(32, MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS), MPP_VAR_FUNCTION(0x1, "sd0", "d0", V_MV78230_PLUS), - MPP_VAR_FUNCTION(0x3, "tdm", "int3", V_MV78230_PLUS), - MPP_VAR_FUNCTION(0x5, "vdd", "cpu1-pd", V_MV78230_PLUS)), + MPP_VAR_FUNCTION(0x3, "tdm", "int3", V_MV78230_PLUS)), MPP_MODE(33, MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS), MPP_VAR_FUNCTION(0x1, "sd0", "d1", V_MV78230_PLUS), @@ -232,7 +225,6 @@ static struct mvebu_mpp_mode armada_xp_mpp_modes[] = { MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS), MPP_VAR_FUNCTION(0x1, "spi", "cs1", V_MV78230_PLUS), MPP_VAR_FUNCTION(0x2, "uart2", "cts", V_MV78230_PLUS), - MPP_VAR_FUNCTION(0x3, "vdd", "cpu1-pd", V_MV78230_PLUS), MPP_VAR_FUNCTION(0x4, "lcd", "vga-hsync", V_MV78230_PLUS), MPP_VAR_FUNCTION(0x5, "pcie", "clkreq0", V_MV78230_PLUS)), MPP_MODE(41, @@ -247,15 +239,13 @@ static struct mvebu_mpp_mode armada_xp_mpp_modes[] = { MPP_VAR_FUNCTION(0x1, "uart2", "rxd", V_MV78230_PLUS), MPP_VAR_FUNCTION(0x2, "uart0", "cts", V_MV78230_PLUS), MPP_VAR_FUNCTION(0x3, "tdm", "int7", V_MV78230_PLUS), - MPP_VAR_FUNCTION(0x4, "tdm-1", "timer", V_MV78230_PLUS), - MPP_VAR_FUNCTION(0x5, "vdd", "cpu0-pd", V_MV78230_PLUS)), + MPP_VAR_FUNCTION(0x4, "tdm-1", "timer", V_MV78230_PLUS)), MPP_MODE(43, MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS), MPP_VAR_FUNCTION(0x1, "uart2", "txd", V_MV78230_PLUS), MPP_VAR_FUNCTION(0x2, "uart0", "rts", V_MV78230_PLUS), MPP_VAR_FUNCTION(0x3, "spi", "cs3", V_MV78230_PLUS), - MPP_VAR_FUNCTION(0x4, "pcie", "rstout", V_MV78230_PLUS), - MPP_VAR_FUNCTION(0x5, "vdd", "cpu2-3-pd", V_MV78460)), + MPP_VAR_FUNCTION(0x4, "pcie", "rstout", V_MV78230_PLUS)), MPP_MODE(44, MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS), MPP_VAR_FUNCTION(0x1, "uart2", "cts", V_MV78230_PLUS), @@ -306,16 +296,13 @@ static struct mvebu_mpp_mode armada_xp_mpp_modes[] = { MPP_VAR_FUNCTION(0x1, "dev", "ad19", V_MV78260_PLUS)), MPP_MODE(55, MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78260_PLUS), - MPP_VAR_FUNCTION(0x1, "dev", "ad20", V_MV78260_PLUS), - MPP_VAR_FUNCTION(0x2, "vdd", "cpu0-pd", V_MV78260_PLUS)), + MPP_VAR_FUNCTION(0x1, "dev", "ad20", V_MV78260_PLUS)), MPP_MODE(56, MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78260_PLUS), - MPP_VAR_FUNCTION(0x1, "dev", "ad21", V_MV78260_PLUS), - MPP_VAR_FUNCTION(0x2, "vdd", "cpu1-pd", V_MV78260_PLUS)), + MPP_VAR_FUNCTION(0x1, "dev", "ad21", V_MV78260_PLUS)), MPP_MODE(57, MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78260_PLUS), - MPP_VAR_FUNCTION(0x1, "dev", "ad22", V_MV78260_PLUS), - MPP_VAR_FUNCTION(0x2, "vdd", "cpu2-3-pd", V_MV78460)), + MPP_VAR_FUNCTION(0x1, "dev", "ad22", V_MV78260_PLUS)), MPP_MODE(58, MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78260_PLUS), MPP_VAR_FUNCTION(0x1, "dev", "ad23", V_MV78260_PLUS)), From 91d0d491518984502fd02fe28fb229856f6112d8 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 9 Jun 2015 18:46:58 +0200 Subject: [PATCH 056/359] pinctrl: mvebu: armada-xp: fix functions of MPP48 commit ea78b9511a54d0de026e04b5da86b30515072f31 upstream. There was a mistake in the definition of the functions for MPP48 on Marvell Armada XP. The second function is dev(clkout), and not tclk. Signed-off-by: Thomas Petazzoni Fixes: 463e270f766a ("pinctrl: mvebu: add pinctrl driver for Armada XP") Signed-off-by: Linus Walleij Signed-off-by: Greg Kroah-Hartman --- .../devicetree/bindings/pinctrl/marvell,armada-xp-pinctrl.txt | 2 +- drivers/pinctrl/mvebu/pinctrl-armada-xp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/pinctrl/marvell,armada-xp-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/marvell,armada-xp-pinctrl.txt index 0ba220bdb17f2d..86dec67e54505a 100644 --- a/Documentation/devicetree/bindings/pinctrl/marvell,armada-xp-pinctrl.txt +++ b/Documentation/devicetree/bindings/pinctrl/marvell,armada-xp-pinctrl.txt @@ -68,7 +68,7 @@ mpp45 45 gpio, uart2(rts), uart3(txd), spi(cs5), sata1(prsnt) mpp46 46 gpio, uart3(rts), uart1(rts), spi(cs6), sata0(prsnt) mpp47 47 gpio, uart3(cts), uart1(cts), spi(cs7), pcie(clkreq3), ref(clkout) -mpp48 48 gpio, tclk, dev(burst/last) +mpp48 48 gpio, dev(clkout), dev(burst/last) * Marvell Armada XP (mv78260 and mv78460 only) diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-xp.c b/drivers/pinctrl/mvebu/pinctrl-armada-xp.c index 4966ee2f7da2b4..5923a9ef70ccbe 100644 --- a/drivers/pinctrl/mvebu/pinctrl-armada-xp.c +++ b/drivers/pinctrl/mvebu/pinctrl-armada-xp.c @@ -274,7 +274,7 @@ static struct mvebu_mpp_mode armada_xp_mpp_modes[] = { MPP_VAR_FUNCTION(0x5, "pcie", "clkreq3", V_MV78230_PLUS)), MPP_MODE(48, MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS), - MPP_VAR_FUNCTION(0x1, "tclk", NULL, V_MV78230_PLUS), + MPP_VAR_FUNCTION(0x1, "dev", "clkout", V_MV78230_PLUS), MPP_VAR_FUNCTION(0x2, "dev", "burst/last", V_MV78230_PLUS)), MPP_MODE(49, MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78260_PLUS), From 0a912f158f212be4bbd703cbbd0af57e94012f17 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 7 Jun 2015 09:42:19 +0200 Subject: [PATCH 057/359] Bluetooth: btusb: Fix memory leak in Intel setup routine commit ecffc80478cdce122f0ecb6a4e4f909132dd5c47 upstream. The SKB returned from the Intel specific version information command is missing a kfree_skb. Signed-off-by: Marcel Holtmann Signed-off-by: Johan Hedberg Signed-off-by: Greg Kroah-Hartman --- drivers/bluetooth/btusb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 92b985317770e3..537ad6897784b8 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -1234,6 +1234,8 @@ static int btusb_setup_intel(struct hci_dev *hdev) } fw_ptr = fw->data; + kfree_skb(skb); + /* This Intel specific command enables the manufacturer mode of the * controller. * From 885c15d7ea3d8d883394d81ec57758857a2b1a54 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 2 Jun 2015 10:38:32 +0200 Subject: [PATCH 058/359] ath9k: fix DMA stop sequence for AR9003+ commit 300f77c08ded96d33f492aaa02549103852f0c12 upstream. AR93xx and newer needs to stop rx before tx to avoid getting the DMA engine or MAC into a stuck state. This should reduce/fix the occurence of "Failed to stop Tx DMA" logspam. Signed-off-by: Felix Fietkau Signed-off-by: Kalle Valo Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/ath/ath9k/main.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 82a1b5b16b6215..c7f23d2710588f 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c @@ -195,11 +195,13 @@ static bool ath_prepare_reset(struct ath_softc *sc) ath9k_debug_samp_bb_mac(sc); ath9k_hw_disable_interrupts(ah); - if (!ath_drain_all_txq(sc)) - ret = false; - - if (!ath_stoprecv(sc)) - ret = false; + if (AR_SREV_9300_20_OR_LATER(ah)) { + ret &= ath_stoprecv(sc); + ret &= ath_drain_all_txq(sc); + } else { + ret &= ath_drain_all_txq(sc); + ret &= ath_stoprecv(sc); + } return ret; } From 38559326b111e77afbd77dad2117bdebc0b536a2 Mon Sep 17 00:00:00 2001 From: Haggai Eran Date: Sat, 23 May 2015 23:13:51 +0300 Subject: [PATCH 059/359] staging: rtl8712: prevent buffer overrun in recvbuf2recvframe commit cab462140f8a183e3cca0b51c8b59ef715cb6148 upstream. With an RTL8191SU USB adaptor, sometimes the hints for a fragmented packet are set, but the packet length is too large. Allocate enough space to prevent memory corruption and a resulting kernel panic [1]. [1] http://www.spinics.net/lists/linux-wireless/msg136546.html Signed-off-by: Haggai Eran ACKed-by: Larry Finger Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8712/rtl8712_recv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c index d59a74aa30489f..4b25f3afb8dc95 100644 --- a/drivers/staging/rtl8712/rtl8712_recv.c +++ b/drivers/staging/rtl8712/rtl8712_recv.c @@ -1075,7 +1075,8 @@ static int recvbuf2recvframe(struct _adapter *padapter, struct sk_buff *pskb) /* for first fragment packet, driver need allocate 1536 + * drvinfo_sz + RXDESC_SIZE to defrag packet. */ if ((mf == 1) && (frag == 0)) - alloc_sz = 1658;/*1658+6=1664, 1664 is 128 alignment.*/ + /*1658+6=1664, 1664 is 128 alignment.*/ + alloc_sz = max_t(u16, tmp_len, 1658); else alloc_sz = tmp_len; /* 2 is for IP header 4 bytes alignment in QoS packet case. From 5831539713c12f187ec132e8eacf86b832c0c94b Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Fri, 12 Jun 2015 23:45:33 -0400 Subject: [PATCH 060/359] ext4: fix race between truncate and __ext4_journalled_writepage() commit bdf96838aea6a265f2ae6cbcfb12a778c84a0b8e upstream. The commit cf108bca465d: "ext4: Invert the locking order of page_lock and transaction start" caused __ext4_journalled_writepage() to drop the page lock before the page was written back, as part of changing the locking order to jbd2_journal_start -> page_lock. However, this introduced a potential race if there was a truncate racing with the data=journalled writeback mode. Fix this by grabbing the page lock after starting the journal handle, and then checking to see if page had gotten truncated out from under us. This fixes a number of different warnings or BUG_ON's when running xfstests generic/086 in data=journalled mode, including: jbd2_journal_dirty_metadata: vdc-8: bad jh for block 115643: transaction (ee3fe7 c0, 164), jh->b_transaction ( (null), 0), jh->b_next_transaction ( (null), 0), jlist 0 - and - kernel BUG at /usr/projects/linux/ext4/fs/jbd2/transaction.c:2200! ... Call Trace: [] ? __ext4_journalled_invalidatepage+0x117/0x117 [] __ext4_journalled_invalidatepage+0x10f/0x117 [] ? __ext4_journalled_invalidatepage+0x117/0x117 [] ? lock_buffer+0x36/0x36 [] ext4_journalled_invalidatepage+0xd/0x22 [] do_invalidatepage+0x22/0x26 [] truncate_inode_page+0x5b/0x85 [] truncate_inode_pages_range+0x156/0x38c [] truncate_inode_pages+0x11/0x15 [] truncate_pagecache+0x55/0x71 [] ext4_setattr+0x4a9/0x560 [] ? current_kernel_time+0x10/0x44 [] notify_change+0x1c7/0x2be [] do_truncate+0x65/0x85 [] ? file_ra_state_init+0x12/0x29 - and - WARNING: CPU: 1 PID: 1331 at /usr/projects/linux/ext4/fs/jbd2/transaction.c:1396 irty_metadata+0x14a/0x1ae() ... Call Trace: [] ? console_unlock+0x3a1/0x3ce [] dump_stack+0x48/0x60 [] warn_slowpath_common+0x89/0xa0 [] ? jbd2_journal_dirty_metadata+0x14a/0x1ae [] warn_slowpath_null+0x14/0x18 [] jbd2_journal_dirty_metadata+0x14a/0x1ae [] __ext4_handle_dirty_metadata+0xd4/0x19d [] write_end_fn+0x40/0x53 [] ext4_walk_page_buffers+0x4e/0x6a [] ext4_writepage+0x354/0x3b8 [] ? mpage_release_unused_pages+0xd4/0xd4 [] ? wait_on_buffer+0x2c/0x2c [] ? ext4_writepage+0x3b8/0x3b8 [] __writepage+0x10/0x2e [] write_cache_pages+0x22d/0x32c [] ? ext4_writepage+0x3b8/0x3b8 [] ext4_writepages+0x102/0x607 [] ? sched_clock_local+0x10/0x10e [] ? __lock_is_held+0x2e/0x44 [] ? lock_is_held+0x43/0x51 [] do_writepages+0x1c/0x29 [] __writeback_single_inode+0xc3/0x545 [] writeback_sb_inodes+0x21f/0x36d ... Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman --- fs/ext4/inode.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 8a277505a3bebb..d4d72659803cab 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -2099,19 +2099,32 @@ static int __ext4_journalled_writepage(struct page *page, ext4_walk_page_buffers(handle, page_bufs, 0, len, NULL, bget_one); } - /* As soon as we unlock the page, it can go away, but we have - * references to buffers so we are safe */ + /* + * We need to release the page lock before we start the + * journal, so grab a reference so the page won't disappear + * out from under us. + */ + get_page(page); unlock_page(page); handle = ext4_journal_start(inode, EXT4_HT_WRITE_PAGE, ext4_writepage_trans_blocks(inode)); if (IS_ERR(handle)) { ret = PTR_ERR(handle); - goto out; + put_page(page); + goto out_no_pagelock; } - BUG_ON(!ext4_handle_valid(handle)); + lock_page(page); + put_page(page); + if (page->mapping != mapping) { + /* The page got truncated from under us */ + ext4_journal_stop(handle); + ret = 0; + goto out; + } + if (inline_data) { ret = ext4_journal_get_write_access(handle, inode_bh); @@ -2136,6 +2149,8 @@ static int __ext4_journalled_writepage(struct page *page, NULL, bput_one); ext4_set_inode_state(inode, EXT4_STATE_JDATA); out: + unlock_page(page); +out_no_pagelock: brelse(inode_bh); return ret; } From b9f1b63992150821ef4f28e009bc342325891ef5 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sat, 20 Jun 2015 22:50:33 -0400 Subject: [PATCH 061/359] ext4: call sync_blockdev() before invalidate_bdev() in put_super() commit 89d96a6f8e6491f24fc8f99fd6ae66820e85c6c1 upstream. Normally all of the buffers will have been forced out to disk before we call invalidate_bdev(), but there will be some cases, where a file system operation was aborted due to an ext4_error(), where there may still be some dirty buffers in the buffer cache for the device. So try to force them out to memory before calling invalidate_bdev(). This fixes a warning triggered by generic/081: WARNING: CPU: 1 PID: 3473 at /usr/projects/linux/ext4/fs/block_dev.c:56 __blkdev_put+0xb5/0x16f() Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman --- fs/ext4/super.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 21a0b43a7d3187..af1eaed96a9130 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -803,6 +803,7 @@ static void ext4_put_super(struct super_block *sb) dump_orphan_list(sb, sbi); J_ASSERT(list_empty(&sbi->s_orphan)); + sync_blockdev(sb->s_bdev); invalidate_bdev(sb->s_bdev); if (sbi->journal_bdev && sbi->journal_bdev != sb->s_bdev) { /* From 438a985247eb526402efb5e403b593a95060e888 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Sun, 21 Jun 2015 21:10:51 -0400 Subject: [PATCH 062/359] ext4: don't retry file block mapping on bigalloc fs with non-extent file commit 292db1bc6c105d86111e858859456bcb11f90f91 upstream. ext4 isn't willing to map clusters to a non-extent file. Don't signal this with an out of space error, since the FS will retry the allocation (which didn't fail) forever. Instead, return EUCLEAN so that the operation will fail immediately all the way back to userspace. (The fix is either to run e2fsck -E bmap2extent, or to chattr +e the file.) Signed-off-by: Darrick J. Wong Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman --- fs/ext4/indirect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/indirect.c b/fs/ext4/indirect.c index 5890614696870b..b07a221c31386f 100644 --- a/fs/ext4/indirect.c +++ b/fs/ext4/indirect.c @@ -577,7 +577,7 @@ int ext4_ind_map_blocks(handle_t *handle, struct inode *inode, EXT4_FEATURE_RO_COMPAT_BIGALLOC)) { EXT4_ERROR_INODE(inode, "Can't allocate blocks for " "non-extent mapped inodes with bigalloc"); - return -ENOSPC; + return -EUCLEAN; } goal = ext4_find_goal(inode, map->m_lblk, partial); From 9b5fe3a114cc5fef9c29e23555e7074d3991689e Mon Sep 17 00:00:00 2001 From: Lukas Czerner Date: Fri, 3 Jul 2015 21:13:55 -0400 Subject: [PATCH 063/359] ext4: fix reservation release on invalidatepage for delalloc fs commit 9705acd63b125dee8b15c705216d7186daea4625 upstream. On delalloc enabled file system on invalidatepage operation in ext4_da_page_release_reservation() we want to clear the delayed buffer and remove the extent covering the delayed buffer from the extent status tree. However currently there is a bug where on the systems with page size > block size we will always remove extents from the start of the page regardless where the actual delayed buffers are positioned in the page. This leads to the errors like this: EXT4-fs warning (device loop0): ext4_da_release_space:1225: ext4_da_release_space: ino 13, to_free 1 with only 0 reserved data blocks This however can cause data loss on writeback time if the file system is in ENOSPC condition because we're releasing reservation for someones else delayed buffer. Fix this by only removing extents that corresponds to the part of the page we want to invalidate. This problem is reproducible by the following fio receipt (however I was only able to reproduce it with fio-2.1 or older. [global] bs=8k iodepth=1024 iodepth_batch=60 randrepeat=1 size=1m directory=/mnt/test numjobs=20 [job1] ioengine=sync bs=1k direct=1 rw=randread filename=file1:file2 [job2] ioengine=libaio rw=randwrite direct=1 filename=file1:file2 [job3] bs=1k ioengine=posixaio rw=randwrite direct=1 filename=file1:file2 [job5] bs=1k ioengine=sync rw=randread filename=file1:file2 [job7] ioengine=libaio rw=randwrite filename=file1:file2 [job8] ioengine=posixaio rw=randwrite filename=file1:file2 [job10] ioengine=mmap rw=randwrite bs=1k filename=file1:file2 [job11] ioengine=mmap rw=randwrite direct=1 filename=file1:file2 Signed-off-by: Lukas Czerner Signed-off-by: Theodore Ts'o Reviewed-by: Jan Kara Signed-off-by: Greg Kroah-Hartman --- fs/ext4/inode.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index d4d72659803cab..10b71e4029a0e0 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -1412,7 +1412,7 @@ static void ext4_da_release_space(struct inode *inode, int to_free) static void ext4_da_page_release_reservation(struct page *page, unsigned long offset) { - int to_release = 0; + int to_release = 0, contiguous_blks = 0; struct buffer_head *head, *bh; unsigned int curr_off = 0; struct inode *inode = page->mapping->host; @@ -1427,14 +1427,23 @@ static void ext4_da_page_release_reservation(struct page *page, if ((offset <= curr_off) && (buffer_delay(bh))) { to_release++; + contiguous_blks++; clear_buffer_delay(bh); + } else if (contiguous_blks) { + lblk = page->index << + (PAGE_CACHE_SHIFT - inode->i_blkbits); + lblk += (curr_off >> inode->i_blkbits) - + contiguous_blks; + ext4_es_remove_extent(inode, lblk, contiguous_blks); + contiguous_blks = 0; } curr_off = next_off; } while ((bh = bh->b_this_page) != head); - if (to_release) { + if (contiguous_blks) { lblk = page->index << (PAGE_CACHE_SHIFT - inode->i_blkbits); - ext4_es_remove_extent(inode, lblk, to_release); + lblk += (curr_off >> inode->i_blkbits) - contiguous_blks; + ext4_es_remove_extent(inode, lblk, contiguous_blks); } /* If we have released all the blocks belonging to a cluster, then we From fc8bf2193703123dde6726ea66c899df48b2d775 Mon Sep 17 00:00:00 2001 From: Eryu Guan Date: Fri, 3 Jul 2015 23:56:50 -0400 Subject: [PATCH 064/359] ext4: be more strict when migrating to non-extent based file commit d6f123a9297496ad0b6335fe881504c4b5b2a5e5 upstream. Currently the check in ext4_ind_migrate() is not enough before doing the real conversion: a) delayed allocated extents could bypass the check on eh->eh_entries and eh->eh_depth This can be demonstrated by this script xfs_io -fc "pwrite 0 4k" -c "pwrite 8k 4k" /mnt/ext4/testfile chattr -e /mnt/ext4/testfile where testfile has two extents but still be converted to non-extent based file format. b) only extent length is checked but not the offset, which would result in data lose (delalloc) or fs corruption (nodelalloc), because non-extent based file only supports at most (12 + 2^10 + 2^20 + 2^30) blocks This can be demostrated by xfs_io -fc "pwrite 5T 4k" /mnt/ext4/testfile chattr -e /mnt/ext4/testfile sync If delalloc is enabled, dmesg prints EXT4-fs warning (device dm-4): ext4_block_to_path:105: block 1342177280 > max in inode 53 EXT4-fs (dm-4): Delayed block allocation failed for inode 53 at logical offset 1342177280 with max blocks 1 with error 5 EXT4-fs (dm-4): This should not happen!! Data will be lost If delalloc is disabled, e2fsck -nf shows corruption Inode 53, i_size is 5497558142976, should be 4096. Fix? no Fix the two issues by a) forcing all delayed allocation blocks to be allocated before checking eh->eh_depth and eh->eh_entries b) limiting the last logical block of the extent is within direct map Signed-off-by: Eryu Guan Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman --- fs/ext4/migrate.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/fs/ext4/migrate.c b/fs/ext4/migrate.c index 49e8bdff9163e8..c093a1b7b6eadc 100644 --- a/fs/ext4/migrate.c +++ b/fs/ext4/migrate.c @@ -616,6 +616,7 @@ int ext4_ind_migrate(struct inode *inode) struct ext4_inode_info *ei = EXT4_I(inode); struct ext4_extent *ex; unsigned int i, len; + ext4_lblk_t end; ext4_fsblk_t blk; handle_t *handle; int ret; @@ -629,6 +630,14 @@ int ext4_ind_migrate(struct inode *inode) EXT4_FEATURE_RO_COMPAT_BIGALLOC)) return -EOPNOTSUPP; + /* + * In order to get correct extent info, force all delayed allocation + * blocks to be allocated, otherwise delayed allocation blocks may not + * be reflected and bypass the checks on extent header. + */ + if (test_opt(inode->i_sb, DELALLOC)) + ext4_alloc_da_blocks(inode); + handle = ext4_journal_start(inode, EXT4_HT_MIGRATE, 1); if (IS_ERR(handle)) return PTR_ERR(handle); @@ -650,7 +659,8 @@ int ext4_ind_migrate(struct inode *inode) else { len = le16_to_cpu(ex->ee_len); blk = ext4_ext_pblock(ex); - if (len > EXT4_NDIR_BLOCKS) { + end = le32_to_cpu(ex->ee_block) + len - 1; + if (end >= EXT4_NDIR_BLOCKS) { ret = -EOPNOTSUPP; goto errout; } From 3cf4f7339b7902c6b7ac10035fd196b7889dcf4d Mon Sep 17 00:00:00 2001 From: Eryu Guan Date: Sat, 4 Jul 2015 00:03:44 -0400 Subject: [PATCH 065/359] ext4: correctly migrate a file with a hole at the beginning commit 8974fec7d72e3e02752fe0f27b4c3719c78d9a15 upstream. Currently ext4_ind_migrate() doesn't correctly handle a file which contains a hole at the beginning of the file. This caused the migration to be done incorrectly, and then if there is a subsequent following delayed allocation write to the "hole", this would reclaim the same data blocks again and results in fs corruption. # assmuing 4k block size ext4, with delalloc enabled # skip the first block and write to the second block xfs_io -fc "pwrite 4k 4k" -c "fsync" /mnt/ext4/testfile # converting to indirect-mapped file, which would move the data blocks # to the beginning of the file, but extent status cache still marks # that region as a hole chattr -e /mnt/ext4/testfile # delayed allocation writes to the "hole", reclaim the same data block # again, results in i_blocks corruption xfs_io -c "pwrite 0 4k" /mnt/ext4/testfile umount /mnt/ext4 e2fsck -nf /dev/sda6 ... Inode 53, i_blocks is 16, should be 8. Fix? no ... Signed-off-by: Eryu Guan Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman --- fs/ext4/migrate.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fs/ext4/migrate.c b/fs/ext4/migrate.c index c093a1b7b6eadc..d19efab66cb634 100644 --- a/fs/ext4/migrate.c +++ b/fs/ext4/migrate.c @@ -616,7 +616,7 @@ int ext4_ind_migrate(struct inode *inode) struct ext4_inode_info *ei = EXT4_I(inode); struct ext4_extent *ex; unsigned int i, len; - ext4_lblk_t end; + ext4_lblk_t start, end; ext4_fsblk_t blk; handle_t *handle; int ret; @@ -655,11 +655,12 @@ int ext4_ind_migrate(struct inode *inode) goto errout; } if (eh->eh_entries == 0) - blk = len = 0; + blk = len = start = end = 0; else { len = le16_to_cpu(ex->ee_len); blk = ext4_ext_pblock(ex); - end = le32_to_cpu(ex->ee_block) + len - 1; + start = le32_to_cpu(ex->ee_block); + end = start + len - 1; if (end >= EXT4_NDIR_BLOCKS) { ret = -EOPNOTSUPP; goto errout; @@ -668,7 +669,7 @@ int ext4_ind_migrate(struct inode *inode) ext4_clear_inode_flag(inode, EXT4_INODE_EXTENTS); memset(ei->i_data, 0, sizeof(ei->i_data)); - for (i=0; i < len; i++) + for (i = start; i <= end; i++) ei->i_data[i] = cpu_to_le32(blk++); ext4_mark_inode_dirty(handle, inode); errout: From 45add18aeda9dbc0a2346c6c7479835a0a01f0df Mon Sep 17 00:00:00 2001 From: Michal Hocko Date: Sun, 5 Jul 2015 12:33:44 -0400 Subject: [PATCH 066/359] ext4: replace open coded nofail allocation in ext4_free_blocks() commit 7444a072c387a93ebee7066e8aee776954ab0e41 upstream. ext4_free_blocks is looping around the allocation request and mimics __GFP_NOFAIL behavior without any allocation fallback strategy. Let's remove the open coded loop and replace it with __GFP_NOFAIL. Without the flag the allocator has no way to find out never-fail requirement and cannot help in any way. Signed-off-by: Michal Hocko Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman --- fs/ext4/mballoc.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index df5050f9080b06..61ee0160394056 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -4764,18 +4764,12 @@ void ext4_free_blocks(handle_t *handle, struct inode *inode, /* * blocks being freed are metadata. these blocks shouldn't * be used until this transaction is committed + * + * We use __GFP_NOFAIL because ext4_free_blocks() is not allowed + * to fail. */ - retry: - new_entry = kmem_cache_alloc(ext4_free_data_cachep, GFP_NOFS); - if (!new_entry) { - /* - * We use a retry loop because - * ext4_free_blocks() is not allowed to fail. - */ - cond_resched(); - congestion_wait(BLK_RW_ASYNC, HZ/50); - goto retry; - } + new_entry = kmem_cache_alloc(ext4_free_data_cachep, + GFP_NOFS|__GFP_NOFAIL); new_entry->efd_start_cluster = bit; new_entry->efd_group = block_group; new_entry->efd_count = count_clusters; From cab5d7026d869b7daa06a5e897b751f8bb07be74 Mon Sep 17 00:00:00 2001 From: Dmitry Monakhov Date: Mon, 15 Jun 2015 00:18:02 -0400 Subject: [PATCH 067/359] jbd2: use GFP_NOFS in jbd2_cleanup_journal_tail() commit b4f1afcd068f6e533230dfed00782cd8a907f96b upstream. jbd2_cleanup_journal_tail() can be invoked by jbd2__journal_start() So allocations should be done with GFP_NOFS [Full stack trace snipped from 3.10-rh7] [] dump_stack+0x19/0x1b [] warn_slowpath_common+0x61/0x80 [] warn_slowpath_null+0x1a/0x20 [] slab_pre_alloc_hook.isra.31.part.32+0x15/0x17 [] kmem_cache_alloc+0x55/0x210 [] ? mempool_alloc_slab+0x15/0x20 [] mempool_alloc_slab+0x15/0x20 [] mempool_alloc+0x69/0x170 [] ? _raw_spin_unlock_irq+0xe/0x20 [] ? finish_task_switch+0x5d/0x150 [] bio_alloc_bioset+0x1be/0x2e0 [] blkdev_issue_flush+0x99/0x120 [] jbd2_cleanup_journal_tail+0x93/0xa0 [jbd2] -->GFP_KERNEL [] jbd2_log_do_checkpoint+0x221/0x4a0 [jbd2] [] __jbd2_log_wait_for_space+0xa7/0x1e0 [jbd2] [] start_this_handle+0x2d8/0x550 [jbd2] [] ? __memcg_kmem_put_cache+0x29/0x30 [] ? kmem_cache_alloc+0x130/0x210 [] jbd2__journal_start+0xba/0x190 [jbd2] [] ? lru_cache_add+0xe/0x10 [] ? ext4_da_write_begin+0xf9/0x330 [ext4] [] __ext4_journal_start_sb+0x77/0x160 [ext4] [] ext4_da_write_begin+0xf9/0x330 [ext4] [] generic_file_buffered_write_iter+0x10c/0x270 [] __generic_file_write_iter+0x178/0x390 [] __generic_file_aio_write+0x8b/0xb0 [] generic_file_aio_write+0x5d/0xc0 [] ext4_file_write+0xa9/0x450 [ext4] [] ? pipe_read+0x379/0x4f0 [] do_sync_write+0x90/0xe0 [] vfs_write+0xbd/0x1e0 [] SyS_write+0x58/0xb0 [] system_call_fastpath+0x16/0x1b Signed-off-by: Dmitry Monakhov Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman --- fs/jbd2/checkpoint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/jbd2/checkpoint.c b/fs/jbd2/checkpoint.c index c78841ee81cf31..dadfedbfd35660 100644 --- a/fs/jbd2/checkpoint.c +++ b/fs/jbd2/checkpoint.c @@ -455,7 +455,7 @@ int jbd2_cleanup_journal_tail(journal_t *journal) * jbd2_cleanup_journal_tail() doesn't get called all that often. */ if (journal->j_flags & JBD2_BARRIER) - blkdev_issue_flush(journal->j_fs_dev, GFP_KERNEL, NULL); + blkdev_issue_flush(journal->j_fs_dev, GFP_NOFS, NULL); __jbd2_update_log_tail(journal, first_tid, blocknr); return 0; From c507ecae237f37b992b1e4e4a7c8abb373197de5 Mon Sep 17 00:00:00 2001 From: Joseph Qi Date: Mon, 15 Jun 2015 14:36:01 -0400 Subject: [PATCH 068/359] jbd2: fix ocfs2 corrupt when updating journal superblock fails commit 6f6a6fda294506dfe0e3e0a253bb2d2923f28f0a upstream. If updating journal superblock fails after journal data has been flushed, the error is omitted and this will mislead the caller as a normal case. In ocfs2, the checkpoint will be treated successfully and the other node can get the lock to update. Since the sb_start is still pointing to the old log block, it will rewrite the journal data during journal recovery by the other node. Thus the new updates will be overwritten and ocfs2 corrupts. So in above case we have to return the error, and ocfs2_commit_cache will take care of the error and prevent the other node to do update first. And only after recovering journal it can do the new updates. The issue discussion mail can be found at: https://oss.oracle.com/pipermail/ocfs2-devel/2015-June/010856.html http://comments.gmane.org/gmane.comp.file-systems.ext4/48841 [ Fixed bug in patch which allowed a non-negative error return from jbd2_cleanup_journal_tail() to leak out of jbd2_fjournal_flush(); this was causing xfstests ext4/306 to fail. -- Ted ] Reported-by: Yiwen Jiang Signed-off-by: Joseph Qi Signed-off-by: Theodore Ts'o Tested-by: Yiwen Jiang Cc: Junxiao Bi Signed-off-by: Greg Kroah-Hartman --- fs/jbd2/checkpoint.c | 5 ++--- fs/jbd2/journal.c | 38 +++++++++++++++++++++++++++++++------- include/linux/jbd2.h | 4 ++-- 3 files changed, 35 insertions(+), 12 deletions(-) diff --git a/fs/jbd2/checkpoint.c b/fs/jbd2/checkpoint.c index dadfedbfd35660..6bb52859cb866a 100644 --- a/fs/jbd2/checkpoint.c +++ b/fs/jbd2/checkpoint.c @@ -440,7 +440,7 @@ int jbd2_cleanup_journal_tail(journal_t *journal) unsigned long blocknr; if (is_journal_aborted(journal)) - return 1; + return -EIO; if (!jbd2_journal_get_log_tail(journal, &first_tid, &blocknr)) return 1; @@ -457,8 +457,7 @@ int jbd2_cleanup_journal_tail(journal_t *journal) if (journal->j_flags & JBD2_BARRIER) blkdev_issue_flush(journal->j_fs_dev, GFP_NOFS, NULL); - __jbd2_update_log_tail(journal, first_tid, blocknr); - return 0; + return __jbd2_update_log_tail(journal, first_tid, blocknr); } diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index aaa1a3f33b0e95..3e7ef8874ffb17 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -869,9 +869,10 @@ int jbd2_journal_get_log_tail(journal_t *journal, tid_t *tid, * * Requires j_checkpoint_mutex */ -void __jbd2_update_log_tail(journal_t *journal, tid_t tid, unsigned long block) +int __jbd2_update_log_tail(journal_t *journal, tid_t tid, unsigned long block) { unsigned long freed; + int ret; BUG_ON(!mutex_is_locked(&journal->j_checkpoint_mutex)); @@ -881,7 +882,10 @@ void __jbd2_update_log_tail(journal_t *journal, tid_t tid, unsigned long block) * space and if we lose sb update during power failure we'd replay * old transaction with possibly newly overwritten data. */ - jbd2_journal_update_sb_log_tail(journal, tid, block, WRITE_FUA); + ret = jbd2_journal_update_sb_log_tail(journal, tid, block, WRITE_FUA); + if (ret) + goto out; + write_lock(&journal->j_state_lock); freed = block - journal->j_tail; if (block < journal->j_tail) @@ -897,6 +901,9 @@ void __jbd2_update_log_tail(journal_t *journal, tid_t tid, unsigned long block) journal->j_tail_sequence = tid; journal->j_tail = block; write_unlock(&journal->j_state_lock); + +out: + return ret; } /* @@ -1315,7 +1322,7 @@ static int journal_reset(journal_t *journal) return jbd2_journal_start_thread(journal); } -static void jbd2_write_superblock(journal_t *journal, int write_op) +static int jbd2_write_superblock(journal_t *journal, int write_op) { struct buffer_head *bh = journal->j_sb_buffer; journal_superblock_t *sb = journal->j_superblock; @@ -1354,7 +1361,10 @@ static void jbd2_write_superblock(journal_t *journal, int write_op) printk(KERN_ERR "JBD2: Error %d detected when updating " "journal superblock for %s.\n", ret, journal->j_devname); + jbd2_journal_abort(journal, ret); } + + return ret; } /** @@ -1367,10 +1377,11 @@ static void jbd2_write_superblock(journal_t *journal, int write_op) * Update a journal's superblock information about log tail and write it to * disk, waiting for the IO to complete. */ -void jbd2_journal_update_sb_log_tail(journal_t *journal, tid_t tail_tid, +int jbd2_journal_update_sb_log_tail(journal_t *journal, tid_t tail_tid, unsigned long tail_block, int write_op) { journal_superblock_t *sb = journal->j_superblock; + int ret; BUG_ON(!mutex_is_locked(&journal->j_checkpoint_mutex)); jbd_debug(1, "JBD2: updating superblock (start %lu, seq %u)\n", @@ -1379,13 +1390,18 @@ void jbd2_journal_update_sb_log_tail(journal_t *journal, tid_t tail_tid, sb->s_sequence = cpu_to_be32(tail_tid); sb->s_start = cpu_to_be32(tail_block); - jbd2_write_superblock(journal, write_op); + ret = jbd2_write_superblock(journal, write_op); + if (ret) + goto out; /* Log is no longer empty */ write_lock(&journal->j_state_lock); WARN_ON(!sb->s_sequence); journal->j_flags &= ~JBD2_FLUSHED; write_unlock(&journal->j_state_lock); + +out: + return ret; } /** @@ -1922,7 +1938,14 @@ int jbd2_journal_flush(journal_t *journal) return -EIO; mutex_lock(&journal->j_checkpoint_mutex); - jbd2_cleanup_journal_tail(journal); + if (!err) { + err = jbd2_cleanup_journal_tail(journal); + if (err < 0) { + mutex_unlock(&journal->j_checkpoint_mutex); + goto out; + } + err = 0; + } /* Finally, mark the journal as really needing no recovery. * This sets s_start==0 in the underlying superblock, which is @@ -1938,7 +1961,8 @@ int jbd2_journal_flush(journal_t *journal) J_ASSERT(journal->j_head == journal->j_tail); J_ASSERT(journal->j_tail_sequence == journal->j_transaction_sequence); write_unlock(&journal->j_state_lock); - return 0; +out: + return err; } /** diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index 6e051f472edb6d..0c67c1f2a890bb 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h @@ -997,7 +997,7 @@ extern struct journal_head * jbd2_journal_get_descriptor_buffer(journal_t *); int jbd2_journal_next_log_block(journal_t *, unsigned long long *); int jbd2_journal_get_log_tail(journal_t *journal, tid_t *tid, unsigned long *block); -void __jbd2_update_log_tail(journal_t *journal, tid_t tid, unsigned long block); +int __jbd2_update_log_tail(journal_t *journal, tid_t tid, unsigned long block); void jbd2_update_log_tail(journal_t *journal, tid_t tid, unsigned long block); /* Commit management */ @@ -1116,7 +1116,7 @@ extern int jbd2_journal_recover (journal_t *journal); extern int jbd2_journal_wipe (journal_t *, int); extern int jbd2_journal_skip_recovery (journal_t *); extern void jbd2_journal_update_sb_errno(journal_t *); -extern void jbd2_journal_update_sb_log_tail (journal_t *, tid_t, +extern int jbd2_journal_update_sb_log_tail (journal_t *, tid_t, unsigned long, int); extern void __jbd2_journal_abort_hard (journal_t *); extern void jbd2_journal_abort (journal_t *, int); From 16bead853e0df06e2de903c9ee93b687558c2954 Mon Sep 17 00:00:00 2001 From: Cyrille Pitchen Date: Tue, 9 Jun 2015 18:22:14 +0200 Subject: [PATCH 069/359] i2c: at91: fix a race condition when using the DMA controller commit 93563a6a71bb69dd324fc7354c60fb05f84aae6b upstream. For TX transactions, the TXCOMP bit in the Status Register is cleared when the first data is written into the Transmit Holding Register. In the lines from at91_do_twi_transfer(): at91_twi_write_data_dma(dev); at91_twi_write(dev, AT91_TWI_IER, AT91_TWI_TXCOMP); the TXCOMP interrupt may be enabled before the DMA controller has actually started to write into the THR. In such a case, the TXCOMP bit is still set into the Status Register so the interrupt is triggered immediately. The driver understands that a transaction completion has occurred but this transaction hasn't started yet. Hence the TXCOMP interrupt is no longer enabled by at91_do_twi_transfer() but instead by at91_twi_write_data_dma_callback(). Also, the TXCOMP bit in the Status Register in not a clear on read flag but a snapshot of the transmission state at the time the Status Register is read. When a NACK error is dectected by the I2C controller, the TXCOMP, NACK and TXRDY bits are set together to 1 in the SR. If enabled, the TXCOMP interrupt is triggered at the same time. Also setting the TXRDY to 1 triggers the DMA controller to write the next data into the THR. Such a write resets the TXCOMP bit to 0 in the SR. So depending on when the interrupt handler reads the SR, it may fail to detect the NACK error if it relies on the TXCOMP bit. The NACK bit and its interrupt should be used instead. For RX transactions, the TXCOMP bit in the Status Register is cleared when the START bit is set into the Control Register. However to unify the management of the TXCOMP bit when the DMA controller is used, the TXCOMP interrupt is now enabled by the DMA callbacks for both TX and RX transfers. Signed-off-by: Cyrille Pitchen Acked-by: Ludovic Desroches Signed-off-by: Wolfram Sang Signed-off-by: Greg Kroah-Hartman --- drivers/i2c/busses/i2c-at91.c | 70 ++++++++++++++++++++++++++--------- 1 file changed, 53 insertions(+), 17 deletions(-) diff --git a/drivers/i2c/busses/i2c-at91.c b/drivers/i2c/busses/i2c-at91.c index 09324d0178d572..ceabcfeb587c64 100644 --- a/drivers/i2c/busses/i2c-at91.c +++ b/drivers/i2c/busses/i2c-at91.c @@ -63,6 +63,9 @@ #define AT91_TWI_UNRE 0x0080 /* Underrun Error */ #define AT91_TWI_NACK 0x0100 /* Not Acknowledged */ +#define AT91_TWI_INT_MASK \ + (AT91_TWI_TXCOMP | AT91_TWI_RXRDY | AT91_TWI_TXRDY | AT91_TWI_NACK) + #define AT91_TWI_IER 0x0024 /* Interrupt Enable Register */ #define AT91_TWI_IDR 0x0028 /* Interrupt Disable Register */ #define AT91_TWI_IMR 0x002c /* Interrupt Mask Register */ @@ -118,13 +121,12 @@ static void at91_twi_write(struct at91_twi_dev *dev, unsigned reg, unsigned val) static void at91_disable_twi_interrupts(struct at91_twi_dev *dev) { - at91_twi_write(dev, AT91_TWI_IDR, - AT91_TWI_TXCOMP | AT91_TWI_RXRDY | AT91_TWI_TXRDY); + at91_twi_write(dev, AT91_TWI_IDR, AT91_TWI_INT_MASK); } static void at91_twi_irq_save(struct at91_twi_dev *dev) { - dev->imr = at91_twi_read(dev, AT91_TWI_IMR) & 0x7; + dev->imr = at91_twi_read(dev, AT91_TWI_IMR) & AT91_TWI_INT_MASK; at91_disable_twi_interrupts(dev); } @@ -214,6 +216,14 @@ static void at91_twi_write_data_dma_callback(void *data) dma_unmap_single(dev->dev, sg_dma_address(&dev->dma.sg), dev->buf_len, DMA_TO_DEVICE); + /* + * When this callback is called, THR/TX FIFO is likely not to be empty + * yet. So we have to wait for TXCOMP or NACK bits to be set into the + * Status Register to be sure that the STOP bit has been sent and the + * transfer is completed. The NACK interrupt has already been enabled, + * we just have to enable TXCOMP one. + */ + at91_twi_write(dev, AT91_TWI_IER, AT91_TWI_TXCOMP); at91_twi_write(dev, AT91_TWI_CR, AT91_TWI_STOP); } @@ -308,7 +318,7 @@ static void at91_twi_read_data_dma_callback(void *data) /* The last two bytes have to be read without using dma */ dev->buf += dev->buf_len - 2; dev->buf_len = 2; - at91_twi_write(dev, AT91_TWI_IER, AT91_TWI_RXRDY); + at91_twi_write(dev, AT91_TWI_IER, AT91_TWI_RXRDY | AT91_TWI_TXCOMP); } static void at91_twi_read_data_dma(struct at91_twi_dev *dev) @@ -369,7 +379,7 @@ static irqreturn_t atmel_twi_interrupt(int irq, void *dev_id) /* catch error flags */ dev->transfer_status |= status; - if (irqstatus & AT91_TWI_TXCOMP) { + if (irqstatus & (AT91_TWI_TXCOMP | AT91_TWI_NACK)) { at91_disable_twi_interrupts(dev); complete(&dev->cmd_complete); } @@ -382,6 +392,34 @@ static int at91_do_twi_transfer(struct at91_twi_dev *dev) int ret; bool has_unre_flag = dev->pdata->has_unre_flag; + /* + * WARNING: the TXCOMP bit in the Status Register is NOT a clear on + * read flag but shows the state of the transmission at the time the + * Status Register is read. According to the programmer datasheet, + * TXCOMP is set when both holding register and internal shifter are + * empty and STOP condition has been sent. + * Consequently, we should enable NACK interrupt rather than TXCOMP to + * detect transmission failure. + * + * Besides, the TXCOMP bit is already set before the i2c transaction + * has been started. For read transactions, this bit is cleared when + * writing the START bit into the Control Register. So the + * corresponding interrupt can safely be enabled just after. + * However for write transactions managed by the CPU, we first write + * into THR, so TXCOMP is cleared. Then we can safely enable TXCOMP + * interrupt. If TXCOMP interrupt were enabled before writing into THR, + * the interrupt handler would be called immediately and the i2c command + * would be reported as completed. + * Also when a write transaction is managed by the DMA controller, + * enabling the TXCOMP interrupt in this function may lead to a race + * condition since we don't know whether the TXCOMP interrupt is enabled + * before or after the DMA has started to write into THR. So the TXCOMP + * interrupt is enabled later by at91_twi_write_data_dma_callback(). + * Immediately after in that DMA callback, we still need to send the + * STOP condition manually writing the corresponding bit into the + * Control Register. + */ + dev_dbg(dev->dev, "transfer: %s %d bytes.\n", (dev->msg->flags & I2C_M_RD) ? "read" : "write", dev->buf_len); @@ -412,26 +450,24 @@ static int at91_do_twi_transfer(struct at91_twi_dev *dev) * seems to be the best solution. */ if (dev->use_dma && (dev->buf_len > AT91_I2C_DMA_THRESHOLD)) { + at91_twi_write(dev, AT91_TWI_IER, AT91_TWI_NACK); at91_twi_read_data_dma(dev); - /* - * It is important to enable TXCOMP irq here because - * doing it only when transferring the last two bytes - * will mask NACK errors since TXCOMP is set when a - * NACK occurs. - */ - at91_twi_write(dev, AT91_TWI_IER, - AT91_TWI_TXCOMP); - } else + } else { at91_twi_write(dev, AT91_TWI_IER, - AT91_TWI_TXCOMP | AT91_TWI_RXRDY); + AT91_TWI_TXCOMP | + AT91_TWI_NACK | + AT91_TWI_RXRDY); + } } else { if (dev->use_dma && (dev->buf_len > AT91_I2C_DMA_THRESHOLD)) { + at91_twi_write(dev, AT91_TWI_IER, AT91_TWI_NACK); at91_twi_write_data_dma(dev); - at91_twi_write(dev, AT91_TWI_IER, AT91_TWI_TXCOMP); } else { at91_twi_write_next_byte(dev); at91_twi_write(dev, AT91_TWI_IER, - AT91_TWI_TXCOMP | AT91_TWI_TXRDY); + AT91_TWI_TXCOMP | + AT91_TWI_NACK | + AT91_TWI_TXRDY); } } From aa264839927926ea7e4de21ba9d086708bc0ec18 Mon Sep 17 00:00:00 2001 From: JM Friedt Date: Fri, 19 Jun 2015 14:48:06 +0200 Subject: [PATCH 070/359] iio: DAC: ad5624r_spi: fix bit shift of output data value commit adfa969850ae93beca57f7527f0e4dc10cbe1309 upstream. The value sent on the SPI bus is shifted by an erroneous number of bits. The shift value was already computed in the iio_chan_spec structure and hence subtracting this argument to 16 yields an erroneous data position in the SPI stream. Signed-off-by: JM Friedt Acked-by: Lars-Peter Clausen Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/dac/ad5624r_spi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/dac/ad5624r_spi.c b/drivers/iio/dac/ad5624r_spi.c index bb298aaff321f5..6deac5af1cfdc5 100644 --- a/drivers/iio/dac/ad5624r_spi.c +++ b/drivers/iio/dac/ad5624r_spi.c @@ -22,7 +22,7 @@ #include "ad5624r.h" static int ad5624r_spi_write(struct spi_device *spi, - u8 cmd, u8 addr, u16 val, u8 len) + u8 cmd, u8 addr, u16 val, u8 shift) { u32 data; u8 msg[3]; @@ -35,7 +35,7 @@ static int ad5624r_spi_write(struct spi_device *spi, * 14-, 12-bit input code followed by 0, 2, or 4 don't care bits, * for the AD5664R, AD5644R, and AD5624R, respectively. */ - data = (0 << 22) | (cmd << 19) | (addr << 16) | (val << (16 - len)); + data = (0 << 22) | (cmd << 19) | (addr << 16) | (val << shift); msg[0] = data >> 16; msg[1] = data >> 8; msg[2] = data; From 85c81d78fd02debcdc0f885a10075f9aff55ee81 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 28 Apr 2015 19:02:19 -0300 Subject: [PATCH 071/359] af9013: Don't accept invalid bandwidth commit d7b76c91f471413de9ded837bddeca2164786571 upstream. If userspace sends an invalid bandwidth, it should either return EINVAL or switch to auto mode. This driver will go past an array and program the hardware on a wrong way if this happens. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/dvb-frontends/af9013.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/media/dvb-frontends/af9013.c b/drivers/media/dvb-frontends/af9013.c index fb504f1e912500..5930aee6b5d059 100644 --- a/drivers/media/dvb-frontends/af9013.c +++ b/drivers/media/dvb-frontends/af9013.c @@ -606,6 +606,10 @@ static int af9013_set_frontend(struct dvb_frontend *fe) } } + /* Return an error if can't find bandwidth or the right clock */ + if (i == ARRAY_SIZE(coeff_lut)) + return -EINVAL; + ret = af9013_wr_regs(state, 0xae00, coeff_lut[i].val, sizeof(coeff_lut[i].val)); } From 72a5986b353150c220d5df97281474371a139f5e Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 28 Apr 2015 18:34:40 -0300 Subject: [PATCH 072/359] s5h1420: fix a buffer overflow when checking userspace params commit 12f4543f5d6811f864e6c4952eb27253c7466c02 upstream. The maximum size for a DiSEqC command is 6, according to the userspace API. However, the code allows to write up to 7 values: drivers/media/dvb-frontends/s5h1420.c:193 s5h1420_send_master_cmd() error: buffer overflow 'cmd->msg' 6 <= 7 Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/dvb-frontends/s5h1420.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/s5h1420.c b/drivers/media/dvb-frontends/s5h1420.c index 93eeaf7118fd01..0b4f8fe6bf9900 100644 --- a/drivers/media/dvb-frontends/s5h1420.c +++ b/drivers/media/dvb-frontends/s5h1420.c @@ -180,7 +180,7 @@ static int s5h1420_send_master_cmd (struct dvb_frontend* fe, int result = 0; dprintk("enter %s\n", __func__); - if (cmd->msg_len > 8) + if (cmd->msg_len > sizeof(cmd->msg)) return -EINVAL; /* setup for DISEQC */ From 81afd3a2f3bfd22a96a2229b8f091e072b78c0ba Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 28 Apr 2015 18:51:17 -0300 Subject: [PATCH 073/359] cx24116: fix a buffer overflow when checking userspace params commit 1fa2337a315a2448c5434f41e00d56b01a22283c upstream. The maximum size for a DiSEqC command is 6, according to the userspace API. However, the code allows to write up much more values: drivers/media/dvb-frontends/cx24116.c:983 cx24116_send_diseqc_msg() error: buffer overflow 'd->msg' 6 <= 23 Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/dvb-frontends/cx24116.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/dvb-frontends/cx24116.c b/drivers/media/dvb-frontends/cx24116.c index 2916d7c74a1da1..7bc68b355c0b91 100644 --- a/drivers/media/dvb-frontends/cx24116.c +++ b/drivers/media/dvb-frontends/cx24116.c @@ -963,6 +963,10 @@ static int cx24116_send_diseqc_msg(struct dvb_frontend *fe, struct cx24116_state *state = fe->demodulator_priv; int i, ret; + /* Validate length */ + if (d->msg_len > sizeof(d->msg)) + return -EINVAL; + /* Dump DiSEqC message */ if (debug) { printk(KERN_INFO "cx24116: %s(", __func__); @@ -974,10 +978,6 @@ static int cx24116_send_diseqc_msg(struct dvb_frontend *fe, printk(") toneburst=%d\n", toneburst); } - /* Validate length */ - if (d->msg_len > (CX24116_ARGLEN - CX24116_DISEQC_MSGOFS)) - return -EINVAL; - /* DiSEqC message */ for (i = 0; i < d->msg_len; i++) state->dsec_cmd.args[CX24116_DISEQC_MSGOFS + i] = d->msg[i]; From ea38800f911256ee729b718ba4080ba1c045ddd5 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Sun, 10 May 2015 11:35:06 +0800 Subject: [PATCH 074/359] ASoC: wm8737: Fixup setting VMID Impedance control register MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 14ba3ec1de043260cecd9e828ea2e3a0ad302893 upstream. According to the datasheet: R10 (0Ah) VMID Impedance Control BIT 3:2 VMIDSEL DEFAULT 00 DESCRIPTION: VMID impedance selection control 00: 75kΩ output 01: 300kΩ output 10: 2.5kΩ output WM8737_VMIDSEL_MASK is 0xC (VMIDSEL - [3:2]), so it needs to left shift WM8737_VMIDSEL_SHIFT bits for setting these bits. Signed-off-by: Axel Lin Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/codecs/wm8737.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/wm8737.c b/sound/soc/codecs/wm8737.c index 2f167a8ca01b50..62bacb8536e6ea 100644 --- a/sound/soc/codecs/wm8737.c +++ b/sound/soc/codecs/wm8737.c @@ -494,7 +494,8 @@ static int wm8737_set_bias_level(struct snd_soc_codec *codec, /* Fast VMID ramp at 2*2.5k */ snd_soc_update_bits(codec, WM8737_MISC_BIAS_CONTROL, - WM8737_VMIDSEL_MASK, 0x4); + WM8737_VMIDSEL_MASK, + 2 << WM8737_VMIDSEL_SHIFT); /* Bring VMID up */ snd_soc_update_bits(codec, WM8737_POWER_MANAGEMENT, @@ -508,7 +509,8 @@ static int wm8737_set_bias_level(struct snd_soc_codec *codec, /* VMID at 2*300k */ snd_soc_update_bits(codec, WM8737_MISC_BIAS_CONTROL, - WM8737_VMIDSEL_MASK, 2); + WM8737_VMIDSEL_MASK, + 1 << WM8737_VMIDSEL_SHIFT); break; From de2b5eb8b8865357a0766d436eddd37bb66de483 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Fri, 15 May 2015 09:15:16 +0800 Subject: [PATCH 075/359] ASoC: wm8955: Fix setting wrong register for WM8955_K_8_0_MASK bits commit 12c350050538c7dc779c083b7342bfd20f74949c upstream. WM8955_K_8_0_MASK bits is controlled by WM8955_PLL_CONTROL_3 rather than WM8955_PLL_CONTROL_2. Signed-off-by: Axel Lin Acked-by: Charles Keepax Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/codecs/wm8955.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/wm8955.c b/sound/soc/codecs/wm8955.c index 1c1fc6119758e9..475fc24c8ff630 100644 --- a/sound/soc/codecs/wm8955.c +++ b/sound/soc/codecs/wm8955.c @@ -298,7 +298,7 @@ static int wm8955_configure_clocking(struct snd_soc_codec *codec) snd_soc_update_bits(codec, WM8955_PLL_CONTROL_2, WM8955_K_17_9_MASK, (pll.k >> 9) & WM8955_K_17_9_MASK); - snd_soc_update_bits(codec, WM8955_PLL_CONTROL_2, + snd_soc_update_bits(codec, WM8955_PLL_CONTROL_3, WM8955_K_8_0_MASK, pll.k & WM8955_K_8_0_MASK); if (pll.k) From c5f6b2fa14c3b348797fc8a1da208e60200ade24 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Mon, 11 May 2015 09:04:06 +0800 Subject: [PATCH 076/359] ASoC: wm8903: Fix define for WM8903_VMID_RES_250K MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit ebb6ad73e645b8f2d098dd3c41d2ff0da4146a02 upstream. VMID Control 0 BIT[2:1] is VMID Divider Enable and Select 00 = VMID disabled (for OFF mode) 01 = 2 x 50kΩ divider (for normal operation) 10 = 2 x 250kΩ divider (for low power standby) 11 = 2 x 5kΩ divider (for fast start-up) So WM8903_VMID_RES_250K should be 2 << 1, which is 4. Signed-off-by: Axel Lin Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/codecs/wm8903.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/wm8903.h b/sound/soc/codecs/wm8903.h index db949311c0f206..0bb4a647755d84 100644 --- a/sound/soc/codecs/wm8903.h +++ b/sound/soc/codecs/wm8903.h @@ -172,7 +172,7 @@ extern int wm8903_mic_detect(struct snd_soc_codec *codec, #define WM8903_VMID_BUF_ENA_WIDTH 1 /* VMID_BUF_ENA */ #define WM8903_VMID_RES_50K 2 -#define WM8903_VMID_RES_250K 3 +#define WM8903_VMID_RES_250K 4 #define WM8903_VMID_RES_5K 6 /* From 7d08fbb3c879ab9e535e40b4656f2da18e7300b2 Mon Sep 17 00:00:00 2001 From: Zidan Wang Date: Thu, 11 Jun 2015 19:14:36 +0800 Subject: [PATCH 077/359] ASoC: wm8960: the enum of "DAC Polarity" should be wm8960_enum[1] commit a077e81ec61e07a7f86997d045109f06719fbffe upstream. the enum of "DAC Polarity" should be wm8960_enum[1]. Signed-off-by: Zidan Wang Acked-by: Charles Keepax Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/codecs/wm8960.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c index 39f65bc9de5617..ae5bb95df8623f 100644 --- a/sound/soc/codecs/wm8960.c +++ b/sound/soc/codecs/wm8960.c @@ -242,7 +242,7 @@ SOC_SINGLE("PCM Playback -6dB Switch", WM8960_DACCTL1, 7, 1, 0), SOC_ENUM("ADC Polarity", wm8960_enum[0]), SOC_SINGLE("ADC High Pass Filter Switch", WM8960_DACCTL1, 0, 1, 0), -SOC_ENUM("DAC Polarity", wm8960_enum[2]), +SOC_ENUM("DAC Polarity", wm8960_enum[1]), SOC_SINGLE_BOOL_EXT("DAC Deemphasis Switch", 0, wm8960_get_deemph, wm8960_put_deemph), From ef06caefe8f8a91c53bbe553e5893cbf53ad49e4 Mon Sep 17 00:00:00 2001 From: Aleksei Mamlin Date: Wed, 1 Jul 2015 13:48:30 +0300 Subject: [PATCH 078/359] libata: add ATA_HORKAGE_BROKEN_FPDMA_AA quirk for HP 250GB SATA disk VB0250EAVER commit 08c85d2a599d967ede38a847f5594447b6100642 upstream. Enabling AA on HP 250GB SATA disk VB0250EAVER causes errors: [ 3.788362] ata3.00: failed to enable AA (error_mask=0x1) [ 3.789243] ata3.00: failed to enable AA (error_mask=0x1) Add the ATA_HORKAGE_BROKEN_FPDMA_AA for this specific harddisk. tj: Collected FPDMA_AA entries and updated comment. Signed-off-by: Aleksei Mamlin Signed-off-by: Tejun Heo Signed-off-by: Greg Kroah-Hartman --- drivers/ata/libata-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 5d47a040129a54..4284d2b4f0d226 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -4150,9 +4150,10 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { { "ST3320[68]13AS", "SD1[5-9]", ATA_HORKAGE_NONCQ | ATA_HORKAGE_FIRMWARE_WARN }, - /* Seagate Momentus SpinPoint M8 seem to have FPMDA_AA issues */ + /* drives which fail FPDMA_AA activation (some may freeze afterwards) */ { "ST1000LM024 HN-M101MBB", "2AR10001", ATA_HORKAGE_BROKEN_FPDMA_AA }, { "ST1000LM024 HN-M101MBB", "2BA30001", ATA_HORKAGE_BROKEN_FPDMA_AA }, + { "VB0250EAVER", "HPG7", ATA_HORKAGE_BROKEN_FPDMA_AA }, /* Blacklist entries taken from Silicon Image 3124/3132 Windows driver .inf file - also several Linux problem reports */ From 2b265a7d06ff7ded5821a2447c97f36b020e99af Mon Sep 17 00:00:00 2001 From: Mikulas Patocka Date: Wed, 8 Jul 2015 13:06:12 -0400 Subject: [PATCH 079/359] libata: increase the timeout when setting transfer mode commit d531be2ca2f27cca5f041b6a140504999144a617 upstream. I have a ST4000DM000 disk. If Linux is booted while the disk is spun down, the command that sets transfer mode causes the disk to spin up. The spin-up takes longer than the default 5s timeout, so the command fails and timeout is reported. Fix this by increasing the timeout to 15s, which is enough for the disk to spin up. Signed-off-by: Mikulas Patocka Signed-off-by: Tejun Heo Signed-off-by: Greg Kroah-Hartman --- drivers/ata/libata-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 4284d2b4f0d226..a440a2034df844 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -4505,7 +4505,8 @@ static unsigned int ata_dev_set_xfermode(struct ata_device *dev) else /* In the ancient relic department - skip all of this */ return 0; - err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0); + /* On some disks, this command causes spin-up, so we need longer timeout */ + err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 15000); DPRINTK("EXIT, err_mask=%x\n", err_mask); return err_mask; From 265f7f397d9e22c9dab190f568840e4885f0d081 Mon Sep 17 00:00:00 2001 From: Subbaraya Sundeep Bhatta Date: Thu, 21 May 2015 15:46:47 +0530 Subject: [PATCH 080/359] usb: dwc3: gadget: return error if command sent to DGCMD register fails commit 891b1dc022955d36cf4c0f42d383226a930db7ed upstream. We need to return error to caller if command is not sent to controller succesfully. Signed-off-by: Subbaraya Sundeep Bhatta Fixes: b09bb64239c8 (usb: dwc3: gadget: implement Global Command support) Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman --- drivers/usb/dwc3/gadget.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 87f8fc63b3e1e0..be6fa45be10163 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -319,6 +319,8 @@ int dwc3_send_gadget_generic_command(struct dwc3 *dwc, int cmd, u32 param) if (!(reg & DWC3_DGCMD_CMDACT)) { dev_vdbg(dwc->dev, "Command Complete --> %d\n", DWC3_DGCMD_STATUS(reg)); + if (DWC3_DGCMD_STATUS(reg)) + return -EINVAL; return 0; } From de03d21864e76b448bb343c1aa1c4b943e05ce56 Mon Sep 17 00:00:00 2001 From: Subbaraya Sundeep Bhatta Date: Thu, 21 May 2015 15:46:48 +0530 Subject: [PATCH 081/359] usb: dwc3: gadget: return error if command sent to DEPCMD register fails commit 76e838c9f7765f9a6205b4d558d75a66104bc60d upstream. We need to return error to caller if command is not sent to controller succesfully. Signed-off-by: Subbaraya Sundeep Bhatta Fixes: 72246da40f37 (usb: Introduce DesignWare USB3 DRD Driver) Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman --- drivers/usb/dwc3/gadget.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index be6fa45be10163..6e70c88b25fb96 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -357,6 +357,8 @@ int dwc3_send_gadget_ep_cmd(struct dwc3 *dwc, unsigned ep, if (!(reg & DWC3_DEPCMD_CMDACT)) { dev_vdbg(dwc->dev, "Command Complete --> %d\n", DWC3_DEPCMD_STATUS(reg)); + if (DWC3_DEPCMD_STATUS(reg)) + return -EINVAL; return 0; } From 4b50e88dcd2ae15f26d431a8d1c177f233dcb5cd Mon Sep 17 00:00:00 2001 From: John Youn Date: Mon, 17 Sep 2001 00:00:00 -0700 Subject: [PATCH 082/359] usb: dwc3: Reset the transfer resource index on SET_INTERFACE commit aebda618718157a69c0dc0adb978d69bc2b8723c upstream. This fixes an issue introduced in commit b23c843992b6 (usb: dwc3: gadget: fix DEPSTARTCFG for non-EP0 EPs) that made sure we would only use DEPSTARTCFG once per SetConfig. The trick is that we should use one DEPSTARTCFG per SetConfig *OR* SetInterface. SetInterface was completely missed from the original patch. This problem became aparent after commit 76e838c9f776 (usb: dwc3: gadget: return error if command sent to DEPCMD register fails) added checking of the return status of device endpoint commands. 'Set Endpoint Transfer Resource' command was caught failing occasionally. This is because the Transfer Resource Index was not getting reset during a SET_INTERFACE request. Finally, to fix the issue, was we have to do is make sure that our start_config_issued flag gets reset whenever we receive a SetInterface request. To verify the problem (and its fix), all we have to do is run test 9 from testusb with 'testusb -t 9 -s 2048 -a -c 5000'. Tested-by: Huang Rui Tested-by: Subbaraya Sundeep Bhatta Fixes: b23c843992b6 (usb: dwc3: gadget: fix DEPSTARTCFG for non-EP0 EPs) Signed-off-by: John Youn Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman --- drivers/usb/dwc3/ep0.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c index 6cd418f6ac071a..57d7ec6c8090e8 100644 --- a/drivers/usb/dwc3/ep0.c +++ b/drivers/usb/dwc3/ep0.c @@ -718,6 +718,10 @@ static int dwc3_ep0_std_request(struct dwc3 *dwc, struct usb_ctrlrequest *ctrl) dev_vdbg(dwc->dev, "USB_REQ_SET_ISOCH_DELAY\n"); ret = dwc3_ep0_set_isoch_delay(dwc, ctrl); break; + case USB_REQ_SET_INTERFACE: + dev_vdbg(dwc->dev, "USB_REQ_SET_INTERFACE\n"); + dwc->start_config_issued = false; + /* Fall through */ default: dev_vdbg(dwc->dev, "Forwarding to gadget driver\n"); ret = dwc3_ep0_delegate_req(dwc, ctrl); From fe4b246602ac4efaf78e8d4d40e6f6ba5a8f58ca Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Mon, 18 May 2015 15:29:51 +0300 Subject: [PATCH 083/359] USB: devio: fix a condition in async_completed() commit 83ed07c5db71bc02bd646d6eb60b48908235cdf9 upstream. Static checkers complain that the current condition is never true. It seems pretty likely that it's a typo and "URB" was intended instead of "USB". Fixes: 3d97ff63f899 ('usbdevfs: Use scatter-gather lists for large bulk transfers') Signed-off-by: Dan Carpenter Acked-by: Alan Stern Signed-off-by: Greg Kroah-Hartman --- drivers/usb/core/devio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 78ddfb43750a69..4c011cfb1da3d8 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -513,7 +513,7 @@ static void async_completed(struct urb *urb) snoop(&urb->dev->dev, "urb complete\n"); snoop_urb(urb->dev, as->userurb, urb->pipe, urb->actual_length, as->status, COMPLETE, NULL, 0); - if ((urb->transfer_flags & URB_DIR_MASK) == USB_DIR_IN) + if ((urb->transfer_flags & URB_DIR_MASK) == URB_DIR_IN) snoop_urb_data(urb, urb->actual_length); if (as->status < 0 && as->bulk_addr && as->status != -ECONNRESET && From 73ee170a4811341440531e27b7d379ac4cca7f22 Mon Sep 17 00:00:00 2001 From: Peter Sanford Date: Thu, 25 Jun 2015 17:40:05 -0700 Subject: [PATCH 084/359] USB: cp210x: add ID for Aruba Networks controllers commit f98a7aa81eeeadcad25665c3501c236d531d4382 upstream. Add the USB serial console device ID for Aruba Networks 7xxx series controllers which have a USB port for their serial console. Signed-off-by: Peter Sanford Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/cp210x.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index ab1c5e8ac27fb9..dd84416a23cdc5 100644 --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c @@ -187,6 +187,7 @@ static const struct usb_device_id id_table[] = { { USB_DEVICE(0x1FB9, 0x0602) }, /* Lake Shore Model 648 Magnet Power Supply */ { USB_DEVICE(0x1FB9, 0x0700) }, /* Lake Shore Model 737 VSM Controller */ { USB_DEVICE(0x1FB9, 0x0701) }, /* Lake Shore Model 776 Hall Matrix */ + { USB_DEVICE(0x2626, 0xEA60) }, /* Aruba Networks 7xxx USB Serial Console */ { USB_DEVICE(0x3195, 0xF190) }, /* Link Instruments MSO-19 */ { USB_DEVICE(0x3195, 0xF280) }, /* Link Instruments MSO-28 */ { USB_DEVICE(0x3195, 0xF281) }, /* Link Instruments MSO-28 */ From 459019ced009796f2ed80c90a262411ffc8482f2 Mon Sep 17 00:00:00 2001 From: Claudio Cappelli Date: Wed, 10 Jun 2015 20:38:30 +0200 Subject: [PATCH 085/359] USB: option: add 2020:4000 ID commit f6d7fb37f92622479ef6da604f27561f5045ba1e upstream. Add device Olivetti Olicard 300 (Network Connect: MT6225) - IDs 2020:4000. T: Bus=01 Lev=02 Prnt=04 Port=00 Cnt=01 Dev#= 10 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=2020 ProdID=4000 Rev=03.00 S: Manufacturer=Network Connect S: Product=MT6225 C: #Ifs= 7 Cfg#= 1 Atr=a0 MxPwr=500mA I: If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim I: If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim I: If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=02 Prot=01 Driver=option I: If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#= 6 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage Signed-off-by: Claudio Cappelli Suggested-by: Lars Melin [johan: amend commit message with devices info ] Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/option.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 8b3484134ab032..096438e4fb0cf5 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -1755,6 +1755,7 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x00, 0x00) }, { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e01, 0xff, 0xff, 0xff) }, /* D-Link DWM-152/C1 */ { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e02, 0xff, 0xff, 0xff) }, /* D-Link DWM-156/C1 */ + { USB_DEVICE_INTERFACE_CLASS(0x2020, 0x4000, 0xff) }, /* OLICARD300 - MT6225 */ { USB_DEVICE(INOVIA_VENDOR_ID, INOVIA_SEW858) }, { USB_DEVICE(VIATELECOM_VENDOR_ID, VIATELECOM_PRODUCT_CDS7) }, { } /* Terminating entry */ From e70c51ae7f8f5e1389cb51cbadc4a1d60f10f7fd Mon Sep 17 00:00:00 2001 From: AMAN DEEP Date: Tue, 21 Jul 2015 17:20:27 +0300 Subject: [PATCH 086/359] usb: xhci: Bugfix for NULL pointer deference in xhci_endpoint_init() function commit 3496810663922617d4b706ef2780c279252ddd6a upstream. virt_dev->num_cached_rings counts on freed ring and is not updated correctly. In xhci_free_or_cache_endpoint_ring() function, the free ring is added into cache and then num_rings_cache is incremented as below: virt_dev->ring_cache[rings_cached] = virt_dev->eps[ep_index].ring; virt_dev->num_rings_cached++; here, free ring pointer is added to a current index and then index is incremented. So current index always points to empty location in the ring cache. For getting available free ring, current index should be decremented first and then corresponding ring buffer value should be taken from ring cache. But In function xhci_endpoint_init(), the num_rings_cached index is accessed before decrement. virt_dev->eps[ep_index].new_ring = virt_dev->ring_cache[virt_dev->num_rings_cached]; virt_dev->ring_cache[virt_dev->num_rings_cached] = NULL; virt_dev->num_rings_cached--; This is bug in manipulating the index of ring cache. And it should be as below: virt_dev->num_rings_cached--; virt_dev->eps[ep_index].new_ring = virt_dev->ring_cache[virt_dev->num_rings_cached]; virt_dev->ring_cache[virt_dev->num_rings_cached] = NULL; Signed-off-by: Aman Deep Signed-off-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci-mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index 677f032482f74e..31bed5f7d0eb08 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c @@ -1400,10 +1400,10 @@ int xhci_endpoint_init(struct xhci_hcd *xhci, /* Attempt to use the ring cache */ if (virt_dev->num_rings_cached == 0) return -ENOMEM; + virt_dev->num_rings_cached--; virt_dev->eps[ep_index].new_ring = virt_dev->ring_cache[virt_dev->num_rings_cached]; virt_dev->ring_cache[virt_dev->num_rings_cached] = NULL; - virt_dev->num_rings_cached--; xhci_reinit_cached_ring(xhci, virt_dev->eps[ep_index].new_ring, 1, type); } From c3055bd86da041225bc2e156ec0574b090c36e43 Mon Sep 17 00:00:00 2001 From: Dennis Yang Date: Fri, 26 Jun 2015 15:25:48 +0100 Subject: [PATCH 087/359] dm btree remove: fix bug in redistribute3 commit 4c7e309340ff85072e96f529582d159002c36734 upstream. redistribute3() shares entries out across 3 nodes. Some entries were being moved the wrong way, breaking the ordering. This manifested as a BUG() in dm-btree-remove.c:shift() when entries were removed from the btree. For additional context see: https://www.redhat.com/archives/dm-devel/2015-May/msg00113.html Signed-off-by: Dennis Yang Signed-off-by: Joe Thornber Signed-off-by: Mike Snitzer Signed-off-by: Greg Kroah-Hartman --- drivers/md/persistent-data/dm-btree-remove.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/md/persistent-data/dm-btree-remove.c b/drivers/md/persistent-data/dm-btree-remove.c index b88757cd0d1d93..a03178e91a79a7 100644 --- a/drivers/md/persistent-data/dm-btree-remove.c +++ b/drivers/md/persistent-data/dm-btree-remove.c @@ -309,8 +309,8 @@ static void redistribute3(struct dm_btree_info *info, struct btree_node *parent, if (s < 0 && nr_center < -s) { /* not enough in central node */ - shift(left, center, nr_center); - s = nr_center - target; + shift(left, center, -nr_center); + s += nr_center; shift(left, right, s); nr_right += s; } else @@ -323,7 +323,7 @@ static void redistribute3(struct dm_btree_info *info, struct btree_node *parent, if (s > 0 && nr_center < s) { /* not enough in central node */ shift(center, right, nr_center); - s = target - nr_center; + s -= nr_center; shift(left, right, s); nr_left -= s; } else From 2554f6d1934d42459f56071dacef7fcbd886d0ad Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Fri, 3 Jul 2015 14:51:32 +0100 Subject: [PATCH 088/359] dm btree: silence lockdep lock inversion in dm_btree_del() commit 1c7518794a3647eb345d59ee52844e8a40405198 upstream. Allocate memory using GFP_NOIO when deleting a btree. dm_btree_del() can be called via an ioctl and we don't want to recurse into the FS or block layer. Signed-off-by: Joe Thornber Signed-off-by: Mike Snitzer Signed-off-by: Greg Kroah-Hartman --- drivers/md/persistent-data/dm-btree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/persistent-data/dm-btree.c b/drivers/md/persistent-data/dm-btree.c index 0a7592e88811e8..e3ecb0b824b55f 100644 --- a/drivers/md/persistent-data/dm-btree.c +++ b/drivers/md/persistent-data/dm-btree.c @@ -240,7 +240,7 @@ int dm_btree_del(struct dm_btree_info *info, dm_block_t root) int r; struct del_stack *s; - s = kmalloc(sizeof(*s), GFP_KERNEL); + s = kmalloc(sizeof(*s), GFP_NOIO); if (!s) return -ENOMEM; s->tm = info->tm; From 1ac6c9e2747ae5b3cb10e3a940281b9be242cff0 Mon Sep 17 00:00:00 2001 From: Tomas Winkler Date: Thu, 16 Jul 2015 15:50:45 +0200 Subject: [PATCH 089/359] mmc: block: Add missing mmc_blk_put() in power_ro_lock_show() commit 9098f84cced870f54d8c410dd2444cfa61467fa0 upstream. Enclosing mmc_blk_put() is missing in power_ro_lock_show() sysfs handler, let's add it. Fixes: add710eaa886 ("mmc: boot partition ro lock support") Signed-off-by: Tomas Winkler Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/card/block.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index 56998eca1a8d02..32fc557bca43a2 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -202,6 +202,8 @@ static ssize_t power_ro_lock_show(struct device *dev, ret = snprintf(buf, PAGE_SIZE, "%d\n", locked); + mmc_blk_put(md); + return ret; } From 840ea3bbb6d3090a0f72559e947475d4ef7f41f2 Mon Sep 17 00:00:00 2001 From: Frediano Ziglio Date: Wed, 3 Jun 2015 12:09:09 +0100 Subject: [PATCH 090/359] drm/qxl: Do not cause spice-server to clean our objects commit 2fa19535ca6abcbfd1ccc9ef694db52f49f77747 upstream. If objects are moved back from system memory to VRAM (and spice id created again) memory is already initialized so we need to set flag to not clear memory. If you don't do it after a while using desktop many images turns to black or transparents. Signed-off-by: Frediano Ziglio Reviewed-by: Dave Airlie Signed-off-by: Dave Airlie Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/qxl/qxl_cmd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/qxl/qxl_cmd.c b/drivers/gpu/drm/qxl/qxl_cmd.c index f86771481317b7..5a48d7419baf49 100644 --- a/drivers/gpu/drm/qxl/qxl_cmd.c +++ b/drivers/gpu/drm/qxl/qxl_cmd.c @@ -500,6 +500,7 @@ int qxl_hw_surface_alloc(struct qxl_device *qdev, cmd = (struct qxl_surface_cmd *)qxl_release_map(qdev, release); cmd->type = QXL_SURFACE_CMD_CREATE; + cmd->flags = QXL_SURF_FLAG_KEEP_DATA; cmd->u.surface_create.format = surf->surf.format; cmd->u.surface_create.width = surf->surf.width; cmd->u.surface_create.height = surf->surf.height; From d2996f66a49aa58efe057c91d4d5bc3fa6d2af0f Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Fri, 15 May 2015 11:48:52 -0400 Subject: [PATCH 091/359] drm/radeon: take the mode_config mutex when dealing with hpds (v2) commit 39fa10f7e21574a70cecf1fed0f9b36535aa68a0 upstream. Since we are messing with state in the worker. v2: drop the changes in the mst worker Signed-off-by: Alex Deucher Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/radeon/radeon_irq_kms.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c b/drivers/gpu/drm/radeon/radeon_irq_kms.c index 1fe12ab5c5ea9a..db83d075606eef 100644 --- a/drivers/gpu/drm/radeon/radeon_irq_kms.c +++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c @@ -73,10 +73,12 @@ static void radeon_hotplug_work_func(struct work_struct *work) struct drm_mode_config *mode_config = &dev->mode_config; struct drm_connector *connector; + mutex_lock(&mode_config->mutex); if (mode_config->num_connector) { list_for_each_entry(connector, &mode_config->connector_list, head) radeon_connector_hotplug(connector); } + mutex_unlock(&mode_config->mutex); /* Just fire off a uevent and let userspace tell us what to do */ drm_helper_hpd_irq_event(dev); } From 391cf875e2717a4e7c615db6fe093b4a40002f1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Fri, 3 Jul 2015 10:02:27 +0900 Subject: [PATCH 092/359] drm/radeon: Don't flush the GART TLB if rdev->gart.ptr == NULL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 233709d2cd6bbaaeda0aeb8d11f6ca7f98563b39 upstream. This can be the case when the GPU is powered off, e.g. via vgaswitcheroo or runpm. When the GPU is powered up again, radeon_gart_table_vram_pin flushes the TLB after setting rdev->gart.ptr to non-NULL. Fixes panic on powering off R7xx GPUs. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61529 Reviewed-by: Christian König Signed-off-by: Michel Dänzer Signed-off-by: Alex Deucher Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/radeon/radeon_gart.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_gart.c b/drivers/gpu/drm/radeon/radeon_gart.c index 2915a1c569340f..c4bb0bc2a1d950 100644 --- a/drivers/gpu/drm/radeon/radeon_gart.c +++ b/drivers/gpu/drm/radeon/radeon_gart.c @@ -251,8 +251,10 @@ void radeon_gart_unbind(struct radeon_device *rdev, unsigned offset, } } } - mb(); - radeon_gart_tlb_flush(rdev); + if (rdev->gart.ptr) { + mb(); + radeon_gart_tlb_flush(rdev); + } } /** @@ -294,8 +296,10 @@ int radeon_gart_bind(struct radeon_device *rdev, unsigned offset, } } } - mb(); - radeon_gart_tlb_flush(rdev); + if (rdev->gart.ptr) { + mb(); + radeon_gart_tlb_flush(rdev); + } return 0; } From e92ad5b7ae75b49d69419568168c410fcdd9d7b8 Mon Sep 17 00:00:00 2001 From: Zhao Junwang Date: Tue, 7 Jul 2015 17:08:35 +0800 Subject: [PATCH 093/359] drm: add a check for x/y in drm_mode_setcrtc commit 01447e9f04ba1c49a9534ae6a5a6f26c2bb05226 upstream. legacy setcrtc ioctl does take a 32 bit value which might indeed overflow the checks of crtc_req->x > INT_MAX and crtc_req->y > INT_MAX aren't needed any more with this v2: -polish the annotation according to Daniel's comment Cc: Daniel Vetter Signed-off-by: Zhao Junwang Signed-off-by: Daniel Vetter Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/drm_crtc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 8759d699bd8e1f..c24c356068368e 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -1955,8 +1955,11 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data, if (!drm_core_check_feature(dev, DRIVER_MODESET)) return -EINVAL; - /* For some reason crtc x/y offsets are signed internally. */ - if (crtc_req->x > INT_MAX || crtc_req->y > INT_MAX) + /* + * Universal plane src offsets are only 16.16, prevent havoc for + * drivers using universal plane code internally. + */ + if (crtc_req->x & 0xffff0000 || crtc_req->y & 0xffff0000) return -ERANGE; drm_modeset_lock_all(dev); From 720e6d218692b95af7f3b2032d53cf20f7c9ff9a Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Mon, 22 Jun 2015 09:42:48 +1000 Subject: [PATCH 094/359] xfs: fix remote symlinks on V5/CRC filesystems commit 2ac56d3d4bd625450a54d4c3f9292d58f6b88232 upstream. If we create a CRC filesystem, mount it, and create a symlink with a path long enough that it can't live in the inode, we get a very strange result upon remount: # ls -l mnt total 4 lrwxrwxrwx. 1 root root 929 Jun 15 16:58 link -> XSLM XSLM is the V5 symlink block header magic (which happens to be followed by a NUL, so the string looks terminated). xfs_readlink_bmap() advanced cur_chunk by the size of the header for CRC filesystems, but never actually used that pointer; it kept reading from bp->b_addr, which is the start of the block, rather than the start of the symlink data after the header. Looks like this problem goes back to v3.10. Fixing this gets us reading the proper link target, again. Signed-off-by: Eric Sandeen Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner Signed-off-by: Greg Kroah-Hartman --- fs/xfs/xfs_symlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/xfs/xfs_symlink.c b/fs/xfs/xfs_symlink.c index 195a403e1522bb..61dbe1958a30f0 100644 --- a/fs/xfs/xfs_symlink.c +++ b/fs/xfs/xfs_symlink.c @@ -272,7 +272,7 @@ xfs_readlink_bmap( cur_chunk += sizeof(struct xfs_dsymlink_hdr); } - memcpy(link + offset, bp->b_addr, byte_cnt); + memcpy(link + offset, cur_chunk, byte_cnt); pathlen -= byte_cnt; offset += byte_cnt; From 8f24d7c7cccae54f6025206479f5d54f35c65519 Mon Sep 17 00:00:00 2001 From: "Hon Ching \\\\(Vicky\\\\) Lo" Date: Fri, 22 May 2015 13:23:02 -0400 Subject: [PATCH 095/359] vTPM: set virtual device before passing to ibmvtpm_reset_crq commit 9d75f08946e8485109458ccf16f714697c207f41 upstream. tpm_ibmvtpm_probe() calls ibmvtpm_reset_crq(ibmvtpm) without having yet set the virtual device in the ibmvtpm structure. So in ibmvtpm_reset_crq, the phype call contains empty unit addresses, ibmvtpm->vdev->unit_address. Signed-off-by: Hon Ching(Vicky) Lo Signed-off-by: Joy Latten Reviewed-by: Ashley Lai Fixes: 132f76294744 ("drivers/char/tpm: Add new device driver to support IBM vTPM") Signed-off-by: Peter Huewe Signed-off-by: Greg Kroah-Hartman --- drivers/char/tpm/tpm_ibmvtpm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/char/tpm/tpm_ibmvtpm.c b/drivers/char/tpm/tpm_ibmvtpm.c index 09df26f9621dc3..a6524c3efdf7cf 100644 --- a/drivers/char/tpm/tpm_ibmvtpm.c +++ b/drivers/char/tpm/tpm_ibmvtpm.c @@ -618,6 +618,9 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev, goto cleanup; } + ibmvtpm->dev = dev; + ibmvtpm->vdev = vio_dev; + crq_q = &ibmvtpm->crq_queue; crq_q->crq_addr = (struct ibmvtpm_crq *)get_zeroed_page(GFP_KERNEL); if (!crq_q->crq_addr) { @@ -662,8 +665,6 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev, crq_q->index = 0; - ibmvtpm->dev = dev; - ibmvtpm->vdev = vio_dev; TPM_VPRIV(chip) = (void *)ibmvtpm; spin_lock_init(&ibmvtpm->rtce_lock); From 143482d1d9a077c5bef978f3c97d3790d8946d27 Mon Sep 17 00:00:00 2001 From: Arne Fitzenreiter Date: Wed, 15 Jul 2015 13:54:36 +0200 Subject: [PATCH 096/359] libata: add ATA_HORKAGE_NOTRIM commit 71d126fd28de2d4d9b7b2088dbccd7ca62fad6e0 upstream. Some devices lose data on TRIM whether queued or not. This patch adds a horkage to disable TRIM. tj: Collapsed unnecessary if() nesting. Signed-off-by: Arne Fitzenreiter Signed-off-by: Tejun Heo Signed-off-by: Greg Kroah-Hartman --- drivers/ata/libata-scsi.c | 3 ++- include/linux/libata.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 9933b4db7caf41..04e7db66836244 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -2512,7 +2512,8 @@ static unsigned int ata_scsiop_read_cap(struct ata_scsi_args *args, u8 *rbuf) rbuf[14] = (lowest_aligned >> 8) & 0x3f; rbuf[15] = lowest_aligned; - if (ata_id_has_trim(args->id)) { + if (ata_id_has_trim(args->id) && + !(dev->horkage & ATA_HORKAGE_NOTRIM)) { rbuf[14] |= 0x80; /* TPE */ if (ata_id_has_zero_after_trim(args->id)) diff --git a/include/linux/libata.h b/include/linux/libata.h index 8e5d45fa83cfb7..8ad0771b88abfd 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -409,6 +409,7 @@ enum { ATA_HORKAGE_ATAPI_DMADIR = (1 << 18), /* device requires dmadir */ ATA_HORKAGE_NOLPM = (1 << 20), /* don't use LPM */ ATA_HORKAGE_WD_BROKEN_LPM = (1 << 21), /* some WDs have broken LPM */ + ATA_HORKAGE_NOTRIM = (1 << 24), /* don't use TRIM */ /* DMA mask for user DMA control: User visible values; DO NOT renumber */ From 5484ab147d8081b7b84e0b94981cb738bd1620cf Mon Sep 17 00:00:00 2001 From: Arne Fitzenreiter Date: Wed, 15 Jul 2015 13:54:37 +0200 Subject: [PATCH 097/359] libata: force disable trim for SuperSSpeed S238 commit cda57b1b05cf7b8b99ab4b732bea0b05b6c015cc upstream. This device loses blocks, often the partition table area, on trim. Disable TRIM. http://pcengines.ch/msata16a.htm Signed-off-by: Arne Fitzenreiter Signed-off-by: Tejun Heo Signed-off-by: Greg Kroah-Hartman --- drivers/ata/libata-core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index a440a2034df844..53d35b6fd8bb48 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -4201,6 +4201,9 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { { "PIONEER DVD-RW DVR-212D", NULL, ATA_HORKAGE_NOSETXFER }, { "PIONEER DVD-RW DVR-216D", NULL, ATA_HORKAGE_NOSETXFER }, + /* devices that don't properly handle TRIM commands */ + { "SuperSSpeed S238*", NULL, ATA_HORKAGE_NOTRIM, }, + /* * Some WD SATA-I drives spin up and down erratically when the link * is put into the slumber mode. We don't have full list of the From c8b9a1fbd1fc6cdf1def415dc70e90d6a929a960 Mon Sep 17 00:00:00 2001 From: "Steven Rostedt (Red Hat)" Date: Thu, 25 Jun 2015 18:02:29 -0400 Subject: [PATCH 098/359] tracing/filter: Do not WARN on operand count going below zero commit b4875bbe7e68f139bd3383828ae8e994a0df6d28 upstream. When testing the fix for the trace filter, I could not come up with a scenario where the operand count goes below zero, so I added a WARN_ON_ONCE(cnt < 0) to the logic. But there is legitimate case that it can happen (although the filter would be wrong). # echo '>' > /sys/kernel/debug/events/ext4/ext4_truncate_exit/filter That is, a single operation without any operands will hit the path where the WARN_ON_ONCE() can trigger. Although this is harmless, and the filter is reported as a error. But instead of spitting out a warning to the kernel dmesg, just fail nicely and report it via the proper channels. Link: http://lkml.kernel.org/r/558C6082.90608@oracle.com Reported-by: Vince Weaver Reported-by: Sasha Levin Signed-off-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman --- kernel/trace/trace_events_filter.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c index fe3e086d38e9c8..1c08866779f2da 100644 --- a/kernel/trace/trace_events_filter.c +++ b/kernel/trace/trace_events_filter.c @@ -1342,7 +1342,9 @@ static int check_preds(struct filter_parse_state *ps) continue; } n_normal_preds++; - WARN_ON_ONCE(cnt < 0); + /* all ops should have operands */ + if (cnt < 0) + break; } if (cnt != 1 || !n_normal_preds || n_logical_preds >= n_normal_preds) { From 3f6ba7f88df0e94587a4b93319656d9ee2e5e203 Mon Sep 17 00:00:00 2001 From: "Steven Rostedt (Red Hat)" Date: Thu, 25 Jun 2015 18:10:09 -0400 Subject: [PATCH 099/359] tracing/filter: Do not allow infix to exceed end of string commit 6b88f44e161b9ee2a803e5b2b1fbcf4e20e8b980 upstream. While debugging a WARN_ON() for filtering, I found that it is possible for the filter string to be referenced after its end. With the filter: # echo '>' > /sys/kernel/debug/events/ext4/ext4_truncate_exit/filter The filter_parse() function can call infix_get_op() which calls infix_advance() that updates the infix filter pointers for the cnt and tail without checking if the filter is already at the end, which will put the cnt to zero and the tail beyond the end. The loop then calls infix_next() that has ps->infix.cnt--; return ps->infix.string[ps->infix.tail++]; The cnt will now be below zero, and the tail that is returned is already passed the end of the filter string. So far the allocation of the filter string usually has some buffer that is zeroed out, but if the filter string is of the exact size of the allocated buffer there's no guarantee that the charater after the nul terminating character will be zero. Luckily, only root can write to the filter. Signed-off-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman --- kernel/trace/trace_events_filter.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c index 1c08866779f2da..67654bb5bc2f53 100644 --- a/kernel/trace/trace_events_filter.c +++ b/kernel/trace/trace_events_filter.c @@ -1015,6 +1015,9 @@ static void parse_init(struct filter_parse_state *ps, static char infix_next(struct filter_parse_state *ps) { + if (!ps->infix.cnt) + return 0; + ps->infix.cnt--; return ps->infix.string[ps->infix.tail++]; @@ -1030,6 +1033,9 @@ static char infix_peek(struct filter_parse_state *ps) static void infix_advance(struct filter_parse_state *ps) { + if (!ps->infix.cnt) + return; + ps->infix.cnt--; ps->infix.tail++; } From f1bb13070802869da9e5c993a86d905c41f1ec28 Mon Sep 17 00:00:00 2001 From: "Steven Rostedt (Red Hat)" Date: Tue, 7 Jul 2015 15:05:03 -0400 Subject: [PATCH 100/359] tracing: Have branch tracer use recursive field of task struct commit 6224beb12e190ff11f3c7d4bf50cb2922878f600 upstream. Fengguang Wu's tests triggered a bug in the branch tracer's start up test when CONFIG_DEBUG_PREEMPT set. This was because that config adds some debug logic in the per cpu field, which calls back into the branch tracer. The branch tracer has its own recursive checks, but uses a per cpu variable to implement it. If retrieving the per cpu variable calls back into the branch tracer, you can see how things will break. Instead of using a per cpu variable, use the trace_recursion field of the current task struct. Simply set a bit when entering the branch tracing and clear it when leaving. If the bit is set on entry, just don't do the tracing. There's also the case with lockdep, as the local_irq_save() called before the recursion can also trigger code that can call back into the function. Changing that to a raw_local_irq_save() will protect that as well. This prevents the recursion and the inevitable crash that follows. Link: http://lkml.kernel.org/r/20150630141803.GA28071@wfg-t540p.sh.intel.com Reported-by: Fengguang Wu Tested-by: Fengguang Wu Signed-off-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman --- kernel/trace/trace.h | 1 + kernel/trace/trace_branch.c | 17 ++++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index aa0e736b72ac84..fe576073580ab2 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h @@ -428,6 +428,7 @@ enum { TRACE_CONTROL_BIT, + TRACE_BRANCH_BIT, /* * Abuse of the trace_recursion. * As we need a way to maintain state if we are tracing the function diff --git a/kernel/trace/trace_branch.c b/kernel/trace/trace_branch.c index d594da0dc03ce5..cb89197adf5c4e 100644 --- a/kernel/trace/trace_branch.c +++ b/kernel/trace/trace_branch.c @@ -37,9 +37,12 @@ probe_likely_condition(struct ftrace_branch_data *f, int val, int expect) struct trace_branch *entry; struct ring_buffer *buffer; unsigned long flags; - int cpu, pc; + int pc; const char *p; + if (current->trace_recursion & TRACE_BRANCH_BIT) + return; + /* * I would love to save just the ftrace_likely_data pointer, but * this code can also be used by modules. Ugly things can happen @@ -50,10 +53,10 @@ probe_likely_condition(struct ftrace_branch_data *f, int val, int expect) if (unlikely(!tr)) return; - local_irq_save(flags); - cpu = raw_smp_processor_id(); - data = per_cpu_ptr(tr->trace_buffer.data, cpu); - if (atomic_inc_return(&data->disabled) != 1) + raw_local_irq_save(flags); + current->trace_recursion |= TRACE_BRANCH_BIT; + data = this_cpu_ptr(tr->trace_buffer.data); + if (atomic_read(&data->disabled)) goto out; pc = preempt_count(); @@ -82,8 +85,8 @@ probe_likely_condition(struct ftrace_branch_data *f, int val, int expect) __buffer_unlock_commit(buffer, event); out: - atomic_dec(&data->disabled); - local_irq_restore(flags); + current->trace_recursion &= ~TRACE_BRANCH_BIT; + raw_local_irq_restore(flags); } static inline From 42f77f15b1fdab86d7d968232776eba3e9b4e135 Mon Sep 17 00:00:00 2001 From: Lior Amsalem Date: Tue, 26 May 2015 15:07:32 +0200 Subject: [PATCH 101/359] dmaengine: mv_xor: bug fix for racing condition in descriptors cleanup commit 9136291f1dbc1d4d1cacd2840fb35f4f3ce16c46 upstream. This patch fixes a bug in the XOR driver where the cleanup function can be called and free descriptors that never been processed by the engine (which result in data errors). The cleanup function will free descriptors based on the ownership bit in the descriptors. Fixes: ff7b04796d98 ("dmaengine: DMA engine driver for Marvell XOR engine") Signed-off-by: Lior Amsalem Signed-off-by: Maxime Ripard Reviewed-by: Ofer Heifetz Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman --- drivers/dma/mv_xor.c | 72 ++++++++++++++++++++++++++++---------------- drivers/dma/mv_xor.h | 1 + 2 files changed, 47 insertions(+), 26 deletions(-) diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c index d64ae14f2706e5..43092c3178978c 100644 --- a/drivers/dma/mv_xor.c +++ b/drivers/dma/mv_xor.c @@ -393,7 +393,8 @@ static void __mv_xor_slot_cleanup(struct mv_xor_chan *mv_chan) dma_cookie_t cookie = 0; int busy = mv_chan_is_busy(mv_chan); u32 current_desc = mv_chan_get_current_desc(mv_chan); - int seen_current = 0; + int current_cleaned = 0; + struct mv_xor_desc *hw_desc; dev_dbg(mv_chan_to_devp(mv_chan), "%s %d\n", __func__, __LINE__); dev_dbg(mv_chan_to_devp(mv_chan), "current_desc %x\n", current_desc); @@ -405,38 +406,57 @@ static void __mv_xor_slot_cleanup(struct mv_xor_chan *mv_chan) list_for_each_entry_safe(iter, _iter, &mv_chan->chain, chain_node) { - prefetch(_iter); - prefetch(&_iter->async_tx); - /* do not advance past the current descriptor loaded into the - * hardware channel, subsequent descriptors are either in - * process or have not been submitted - */ - if (seen_current) - break; + /* clean finished descriptors */ + hw_desc = iter->hw_desc; + if (hw_desc->status & XOR_DESC_SUCCESS) { + cookie = mv_xor_run_tx_complete_actions(iter, mv_chan, + cookie); - /* stop the search if we reach the current descriptor and the - * channel is busy - */ - if (iter->async_tx.phys == current_desc) { - seen_current = 1; - if (busy) + /* done processing desc, clean slot */ + mv_xor_clean_slot(iter, mv_chan); + + /* break if we did cleaned the current */ + if (iter->async_tx.phys == current_desc) { + current_cleaned = 1; + break; + } + } else { + if (iter->async_tx.phys == current_desc) { + current_cleaned = 0; break; + } } - - cookie = mv_xor_run_tx_complete_actions(iter, mv_chan, cookie); - - if (mv_xor_clean_slot(iter, mv_chan)) - break; } if ((busy == 0) && !list_empty(&mv_chan->chain)) { - struct mv_xor_desc_slot *chain_head; - chain_head = list_entry(mv_chan->chain.next, - struct mv_xor_desc_slot, - chain_node); - - mv_xor_start_new_chain(mv_chan, chain_head); + if (current_cleaned) { + /* + * current descriptor cleaned and removed, run + * from list head + */ + iter = list_entry(mv_chan->chain.next, + struct mv_xor_desc_slot, + chain_node); + mv_xor_start_new_chain(mv_chan, iter); + } else { + if (!list_is_last(&iter->chain_node, &mv_chan->chain)) { + /* + * descriptors are still waiting after + * current, trigger them + */ + iter = list_entry(iter->chain_node.next, + struct mv_xor_desc_slot, + chain_node); + mv_xor_start_new_chain(mv_chan, iter); + } else { + /* + * some descriptors are still waiting + * to be cleaned + */ + tasklet_schedule(&mv_chan->irq_tasklet); + } + } } if (cookie > 0) diff --git a/drivers/dma/mv_xor.h b/drivers/dma/mv_xor.h index c632a4761fcff9..e003851cd4e52b 100644 --- a/drivers/dma/mv_xor.h +++ b/drivers/dma/mv_xor.h @@ -32,6 +32,7 @@ #define XOR_OPERATION_MODE_XOR 0 #define XOR_OPERATION_MODE_MEMCPY 2 #define XOR_OPERATION_MODE_MEMSET 4 +#define XOR_DESC_SUCCESS 0x40000000 #define XOR_CURR_DESC(chan) (chan->mmr_base + 0x210 + (chan->idx * 4)) #define XOR_NEXT_DESC(chan) (chan->mmr_base + 0x200 + (chan->idx * 4)) From ec573efa13d9e957199f008c12d39d54ab3f61d1 Mon Sep 17 00:00:00 2001 From: "Stevens, Nick" Date: Wed, 1 Jul 2015 16:07:41 +0000 Subject: [PATCH 102/359] hwmon: (mcp3021) Fix broken output scaling commit 347d7e45bd09ce09cbc30d5cea9de377eb22f55c upstream. The mcp3021 scaling code is dividing the VDD (full-scale) value in millivolts by the A2D resolution to obtain the scaling factor. When VDD is 3300mV (the standard value) and the resolution is 12-bit (4096 divisions), the result is a scale factor of 3300/4096, which is always one. Effectively, the raw A2D reading is always being returned because no scaling is applied. This patch fixes the issue and simplifies the register-to-volts calculation, removing the unneeded "output_scale" struct member. Signed-off-by: Nick Stevens [Guenter Roeck: Dropped unnecessary value check] Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman --- drivers/hwmon/mcp3021.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/hwmon/mcp3021.c b/drivers/hwmon/mcp3021.c index eedb32292d6d3c..f712cc785ef23b 100644 --- a/drivers/hwmon/mcp3021.c +++ b/drivers/hwmon/mcp3021.c @@ -31,14 +31,11 @@ /* output format */ #define MCP3021_SAR_SHIFT 2 #define MCP3021_SAR_MASK 0x3ff - #define MCP3021_OUTPUT_RES 10 /* 10-bit resolution */ -#define MCP3021_OUTPUT_SCALE 4 #define MCP3221_SAR_SHIFT 0 #define MCP3221_SAR_MASK 0xfff #define MCP3221_OUTPUT_RES 12 /* 12-bit resolution */ -#define MCP3221_OUTPUT_SCALE 1 enum chips { mcp3021, @@ -54,7 +51,6 @@ struct mcp3021_data { u16 sar_shift; u16 sar_mask; u8 output_res; - u8 output_scale; }; static int mcp3021_read16(struct i2c_client *client) @@ -84,13 +80,7 @@ static int mcp3021_read16(struct i2c_client *client) static inline u16 volts_from_reg(struct mcp3021_data *data, u16 val) { - if (val == 0) - return 0; - - val = val * data->output_scale - data->output_scale / 2; - - return val * DIV_ROUND_CLOSEST(data->vdd, - (1 << data->output_res) * data->output_scale); + return DIV_ROUND_CLOSEST(data->vdd * val, 1 << data->output_res); } static ssize_t show_in_input(struct device *dev, struct device_attribute *attr, @@ -132,14 +122,12 @@ static int mcp3021_probe(struct i2c_client *client, data->sar_shift = MCP3021_SAR_SHIFT; data->sar_mask = MCP3021_SAR_MASK; data->output_res = MCP3021_OUTPUT_RES; - data->output_scale = MCP3021_OUTPUT_SCALE; break; case mcp3221: data->sar_shift = MCP3221_SAR_SHIFT; data->sar_mask = MCP3221_SAR_MASK; data->output_res = MCP3221_OUTPUT_RES; - data->output_scale = MCP3221_OUTPUT_SCALE; break; } From 882d00c103f84e5beb8108216cedec0fab26e703 Mon Sep 17 00:00:00 2001 From: Firo Yang Date: Thu, 11 Jun 2015 09:41:10 +0800 Subject: [PATCH 103/359] md: fix a build warning commit 4e023612325a9034a542bfab79f78b1fe5ebb841 upstream. Warning like this: drivers/md/md.c: In function "update_array_info": drivers/md/md.c:6394:26: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses] !mddev->persistent != info->not_persistent|| Fix it as Neil Brown said: mddev->persistent != !info->not_persistent || Signed-off-by: Firo Yang Signed-off-by: NeilBrown Signed-off-by: Greg Kroah-Hartman --- drivers/md/md.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index aaf77b07bb7279..631fe3e9c6e558 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -6221,7 +6221,7 @@ static int update_array_info(struct mddev *mddev, mdu_array_info_t *info) mddev->ctime != info->ctime || mddev->level != info->level || /* mddev->layout != info->layout || */ - !mddev->persistent != info->not_persistent|| + mddev->persistent != !info->not_persistent || mddev->chunk_sectors != info->chunk_size >> 9 || /* ignore bottom 8 bits of state, and allow SB_BITMAP_PRESENT to change */ ((state^info->state) & 0xfffffe00) From 9c902bd02dbd2cfabbd01560e76f1217e528189e Mon Sep 17 00:00:00 2001 From: Filipe Manana Date: Sat, 13 Jun 2015 06:52:56 +0100 Subject: [PATCH 104/359] Btrfs: use kmem_cache_free when freeing entry in inode cache commit c3f4a1685bb87e59c886ee68f7967eae07d4dffa upstream. The free space entries are allocated using kmem_cache_zalloc(), through __btrfs_add_free_space(), therefore we should use kmem_cache_free() and not kfree() to avoid any confusion and any potential problem. Looking at the kfree() definition at mm/slab.c it has the following comment: /* * (...) * * Don't free memory not originally allocated by kmalloc() * or you will run into trouble. */ So better be safe and use kmem_cache_free(). Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: Chris Mason Signed-off-by: Greg Kroah-Hartman --- fs/btrfs/inode-map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/inode-map.c b/fs/btrfs/inode-map.c index 2c66ddbbe670e0..0389e90eec3368 100644 --- a/fs/btrfs/inode-map.c +++ b/fs/btrfs/inode-map.c @@ -283,7 +283,7 @@ void btrfs_unpin_free_ino(struct btrfs_root *root) __btrfs_add_free_space(ctl, info->offset, count); free: rb_erase(&info->offset_index, rbroot); - kfree(info); + kmem_cache_free(btrfs_free_space_cachep, info); } } From cc522c517a2ecc04cf2acbb3ce4be95fb9dd9b3a Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Wed, 1 Jul 2015 16:25:55 +0200 Subject: [PATCH 105/359] fuse: initialize fc->release before calling it commit 0ad0b3255a08020eaf50e34ef0d6df5bdf5e09ed upstream. fc->release is called from fuse_conn_put() which was used in the error cleanup before fc->release was initialized. [Jeremiah Mahler : assign fc->release after calling fuse_conn_init(fc) instead of before.] Signed-off-by: Miklos Szeredi Fixes: a325f9b92273 ("fuse: update fuse_conn_init() and separate out fuse_conn_kill()") Signed-off-by: Greg Kroah-Hartman --- fs/fuse/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 39a986e1da9eff..4d371f3b9a4536 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -1028,6 +1028,7 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent) goto err_fput; fuse_conn_init(fc); + fc->release = fuse_free_conn; fc->dev = sb->s_dev; fc->sb = sb; @@ -1042,7 +1043,6 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent) fc->dont_mask = 1; sb->s_flags |= MS_POSIXACL; - fc->release = fuse_free_conn; fc->flags = d.flags; fc->user_id = d.user_id; fc->group_id = d.group_id; From 7546f8cb2dff62ad20c50bf3d6170ad8dadb9cc8 Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Mon, 29 Jun 2015 19:30:23 +0300 Subject: [PATCH 106/359] crush: fix a bug in tree bucket decode commit 82cd003a77173c91b9acad8033fb7931dac8d751 upstream. struct crush_bucket_tree::num_nodes is u8, so ceph_decode_8_safe() should be used. -Wconversion catches this, but I guess it went unnoticed in all the noise it spews. The actual problem (at least for common crushmaps) isn't the u32 -> u8 truncation though - it's the advancement by 4 bytes instead of 1 in the crushmap buffer. Fixes: http://tracker.ceph.com/issues/2759 Signed-off-by: Ilya Dryomov Reviewed-by: Josh Durgin Signed-off-by: Greg Kroah-Hartman --- net/ceph/osdmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ceph/osdmap.c b/net/ceph/osdmap.c index dbd9a479242745..7ec4e052221519 100644 --- a/net/ceph/osdmap.c +++ b/net/ceph/osdmap.c @@ -89,7 +89,7 @@ static int crush_decode_tree_bucket(void **p, void *end, { int j; dout("crush_decode_tree_bucket %p to %p\n", *p, end); - ceph_decode_32_safe(p, end, b->num_nodes, bad); + ceph_decode_8_safe(p, end, b->num_nodes, bad); b->node_weights = kcalloc(b->num_nodes, sizeof(u32), GFP_NOFS); if (b->node_weights == NULL) return -ENOMEM; From a73aa5b5c7fff1778c5649c85b1b41d086c0d539 Mon Sep 17 00:00:00 2001 From: Lv Zheng Date: Wed, 1 Jul 2015 14:43:26 +0800 Subject: [PATCH 107/359] ACPICA: Tables: Fix an issue that FACS initialization is performed twice commit c04be18448355441a0c424362df65b6422e27bda upstream. ACPICA commit 90f5332a15e9d9ba83831ca700b2b9f708274658 This patch adds a new FACS initialization flag for acpi_tb_initialize(). acpi_enable_subsystem() might be invoked several times in OS bootup process, and we don't want FACS initialization to be invoked twice. Lv Zheng. Link: https://github.com/acpica/acpica/commit/90f5332a Signed-off-by: Lv Zheng Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman --- drivers/acpi/acpica/utxfinit.c | 10 ++++++---- include/acpi/actypes.h | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/acpica/utxfinit.c b/drivers/acpi/acpica/utxfinit.c index 41ebaaf8bb1a4e..ee58a62443bd5c 100644 --- a/drivers/acpi/acpica/utxfinit.c +++ b/drivers/acpi/acpica/utxfinit.c @@ -165,10 +165,12 @@ acpi_status acpi_enable_subsystem(u32 flags) * Obtain a permanent mapping for the FACS. This is required for the * Global Lock and the Firmware Waking Vector */ - status = acpi_tb_initialize_facs(); - if (ACPI_FAILURE(status)) { - ACPI_WARNING((AE_INFO, "Could not map the FACS table")); - return_ACPI_STATUS(status); + if (!(flags & ACPI_NO_FACS_INIT)) { + status = acpi_tb_initialize_facs(); + if (ACPI_FAILURE(status)) { + ACPI_WARNING((AE_INFO, "Could not map the FACS table")); + return_ACPI_STATUS(status); + } } #endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index f819e813c8ac33..4407354c7d6a39 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h @@ -511,6 +511,7 @@ typedef u64 acpi_integer; #define ACPI_NO_ACPI_ENABLE 0x10 #define ACPI_NO_DEVICE_INIT 0x20 #define ACPI_NO_OBJECT_INIT 0x40 +#define ACPI_NO_FACS_INIT 0x80 /* * Initialization state From 49b028d31aedc00f179c883e87f1b4f2cf55923b Mon Sep 17 00:00:00 2001 From: Nicholas Bellinger Date: Thu, 26 Feb 2015 22:19:15 -0800 Subject: [PATCH 108/359] iscsi-target: Convert iscsi_thread_set usage to kthread.h commit 88dcd2dab5c23b1c9cfc396246d8f476c872f0ca upstream. This patch converts iscsi-target code to use modern kthread.h API callers for creating RX/TX threads for each new iscsi_conn descriptor, and releasing associated RX/TX threads during connection shutdown. This is done using iscsit_start_kthreads() -> kthread_run() to start new kthreads from within iscsi_post_login_handler(), and invoking kthread_stop() from existing iscsit_close_connection() code. Also, convert iscsit_logout_post_handler_closesession() code to use cmpxchg when determing when iscsit_cause_connection_reinstatement() needs to sleep waiting for completion. Reported-by: Sagi Grimberg Tested-by: Sagi Grimberg Cc: Slava Shwartsman Signed-off-by: Nicholas Bellinger Signed-off-by: Greg Kroah-Hartman --- drivers/target/iscsi/iscsi_target.c | 104 ++++++++++------------ drivers/target/iscsi/iscsi_target_core.h | 7 ++ drivers/target/iscsi/iscsi_target_erl0.c | 13 +-- drivers/target/iscsi/iscsi_target_login.c | 61 +++++++++++-- 4 files changed, 115 insertions(+), 70 deletions(-) diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index 5a3ea20e9cb526..3c293ad6ae7006 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c @@ -518,7 +518,7 @@ static struct iscsit_transport iscsi_target_transport = { static int __init iscsi_target_init_module(void) { - int ret = 0; + int ret = 0, size; pr_debug("iSCSI-Target "ISCSIT_VERSION"\n"); @@ -527,6 +527,7 @@ static int __init iscsi_target_init_module(void) pr_err("Unable to allocate memory for iscsit_global\n"); return -1; } + spin_lock_init(&iscsit_global->ts_bitmap_lock); mutex_init(&auth_id_lock); spin_lock_init(&sess_idr_lock); idr_init(&tiqn_idr); @@ -536,15 +537,11 @@ static int __init iscsi_target_init_module(void) if (ret < 0) goto out; - ret = iscsi_thread_set_init(); - if (ret < 0) + size = BITS_TO_LONGS(ISCSIT_BITMAP_BITS) * sizeof(long); + iscsit_global->ts_bitmap = vzalloc(size); + if (!iscsit_global->ts_bitmap) { + pr_err("Unable to allocate iscsit_global->ts_bitmap\n"); goto configfs_out; - - if (iscsi_allocate_thread_sets(TARGET_THREAD_SET_COUNT) != - TARGET_THREAD_SET_COUNT) { - pr_err("iscsi_allocate_thread_sets() returned" - " unexpected value!\n"); - goto ts_out1; } lio_cmd_cache = kmem_cache_create("lio_cmd_cache", @@ -553,7 +550,7 @@ static int __init iscsi_target_init_module(void) if (!lio_cmd_cache) { pr_err("Unable to kmem_cache_create() for" " lio_cmd_cache\n"); - goto ts_out2; + goto bitmap_out; } lio_qr_cache = kmem_cache_create("lio_qr_cache", @@ -608,10 +605,8 @@ static int __init iscsi_target_init_module(void) kmem_cache_destroy(lio_qr_cache); cmd_out: kmem_cache_destroy(lio_cmd_cache); -ts_out2: - iscsi_deallocate_thread_sets(); -ts_out1: - iscsi_thread_set_free(); +bitmap_out: + vfree(iscsit_global->ts_bitmap); configfs_out: iscsi_target_deregister_configfs(); out: @@ -621,8 +616,6 @@ static int __init iscsi_target_init_module(void) static void __exit iscsi_target_cleanup_module(void) { - iscsi_deallocate_thread_sets(); - iscsi_thread_set_free(); iscsit_release_discovery_tpg(); iscsit_unregister_transport(&iscsi_target_transport); kmem_cache_destroy(lio_cmd_cache); @@ -633,6 +626,7 @@ static void __exit iscsi_target_cleanup_module(void) iscsi_target_deregister_configfs(); + vfree(iscsit_global->ts_bitmap); kfree(iscsit_global); } @@ -3590,17 +3584,16 @@ static int iscsit_send_reject( void iscsit_thread_get_cpumask(struct iscsi_conn *conn) { - struct iscsi_thread_set *ts = conn->thread_set; int ord, cpu; /* - * thread_id is assigned from iscsit_global->ts_bitmap from - * within iscsi_thread_set.c:iscsi_allocate_thread_sets() + * bitmap_id is assigned from iscsit_global->ts_bitmap from + * within iscsit_start_kthreads() * - * Here we use thread_id to determine which CPU that this - * iSCSI connection's iscsi_thread_set will be scheduled to + * Here we use bitmap_id to determine which CPU that this + * iSCSI connection's RX/TX threads will be scheduled to * execute upon. */ - ord = ts->thread_id % cpumask_weight(cpu_online_mask); + ord = conn->bitmap_id % cpumask_weight(cpu_online_mask); for_each_online_cpu(cpu) { if (ord-- == 0) { cpumask_set_cpu(cpu, conn->conn_cpumask); @@ -3792,7 +3785,7 @@ iscsit_response_queue(struct iscsi_conn *conn, struct iscsi_cmd *cmd, int state) switch (state) { case ISTATE_SEND_LOGOUTRSP: if (!iscsit_logout_post_handler(cmd, conn)) - goto restart; + return -ECONNRESET; /* fall through */ case ISTATE_SEND_STATUS: case ISTATE_SEND_ASYNCMSG: @@ -3820,8 +3813,6 @@ iscsit_response_queue(struct iscsi_conn *conn, struct iscsi_cmd *cmd, int state) err: return -1; -restart: - return -EAGAIN; } static int iscsit_handle_response_queue(struct iscsi_conn *conn) @@ -3848,21 +3839,13 @@ static int iscsit_handle_response_queue(struct iscsi_conn *conn) int iscsi_target_tx_thread(void *arg) { int ret = 0; - struct iscsi_conn *conn; - struct iscsi_thread_set *ts = arg; + struct iscsi_conn *conn = arg; /* * Allow ourselves to be interrupted by SIGINT so that a * connection recovery / failure event can be triggered externally. */ allow_signal(SIGINT); -restart: - conn = iscsi_tx_thread_pre_handler(ts); - if (!conn) - goto out; - - ret = 0; - while (!kthread_should_stop()) { /* * Ensure that both TX and RX per connection kthreads @@ -3871,11 +3854,9 @@ int iscsi_target_tx_thread(void *arg) iscsit_thread_check_cpumask(conn, current, 1); wait_event_interruptible(conn->queues_wq, - !iscsit_conn_all_queues_empty(conn) || - ts->status == ISCSI_THREAD_SET_RESET); + !iscsit_conn_all_queues_empty(conn)); - if ((ts->status == ISCSI_THREAD_SET_RESET) || - signal_pending(current)) + if (signal_pending(current)) goto transport_err; get_immediate: @@ -3886,15 +3867,14 @@ int iscsi_target_tx_thread(void *arg) ret = iscsit_handle_response_queue(conn); if (ret == 1) goto get_immediate; - else if (ret == -EAGAIN) - goto restart; + else if (ret == -ECONNRESET) + goto out; else if (ret < 0) goto transport_err; } transport_err: iscsit_take_action_for_connection_exit(conn); - goto restart; out: return 0; } @@ -3979,8 +3959,7 @@ int iscsi_target_rx_thread(void *arg) int ret; u8 buffer[ISCSI_HDR_LEN], opcode; u32 checksum = 0, digest = 0; - struct iscsi_conn *conn = NULL; - struct iscsi_thread_set *ts = arg; + struct iscsi_conn *conn = arg; struct kvec iov; /* * Allow ourselves to be interrupted by SIGINT so that a @@ -3988,11 +3967,6 @@ int iscsi_target_rx_thread(void *arg) */ allow_signal(SIGINT); -restart: - conn = iscsi_rx_thread_pre_handler(ts); - if (!conn) - goto out; - if (conn->conn_transport->transport_type == ISCSI_INFINIBAND) { struct completion comp; int rc; @@ -4002,7 +3976,7 @@ int iscsi_target_rx_thread(void *arg) if (rc < 0) goto transport_err; - goto out; + goto transport_err; } while (!kthread_should_stop()) { @@ -4085,8 +4059,6 @@ int iscsi_target_rx_thread(void *arg) if (!signal_pending(current)) atomic_set(&conn->transport_failed, 1); iscsit_take_action_for_connection_exit(conn); - goto restart; -out: return 0; } @@ -4148,7 +4120,24 @@ int iscsit_close_connection( if (conn->conn_transport->transport_type == ISCSI_TCP) complete(&conn->conn_logout_comp); - iscsi_release_thread_set(conn); + if (!strcmp(current->comm, ISCSI_RX_THREAD_NAME)) { + if (conn->tx_thread && + cmpxchg(&conn->tx_thread_active, true, false)) { + send_sig(SIGINT, conn->tx_thread, 1); + kthread_stop(conn->tx_thread); + } + } else if (!strcmp(current->comm, ISCSI_TX_THREAD_NAME)) { + if (conn->rx_thread && + cmpxchg(&conn->rx_thread_active, true, false)) { + send_sig(SIGINT, conn->rx_thread, 1); + kthread_stop(conn->rx_thread); + } + } + + spin_lock(&iscsit_global->ts_bitmap_lock); + bitmap_release_region(iscsit_global->ts_bitmap, conn->bitmap_id, + get_order(1)); + spin_unlock(&iscsit_global->ts_bitmap_lock); iscsit_stop_timers_for_cmds(conn); iscsit_stop_nopin_response_timer(conn); @@ -4427,15 +4416,13 @@ static void iscsit_logout_post_handler_closesession( struct iscsi_conn *conn) { struct iscsi_session *sess = conn->sess; - - iscsi_set_thread_clear(conn, ISCSI_CLEAR_TX_THREAD); - iscsi_set_thread_set_signal(conn, ISCSI_SIGNAL_TX_THREAD); + int sleep = cmpxchg(&conn->tx_thread_active, true, false); atomic_set(&conn->conn_logout_remove, 0); complete(&conn->conn_logout_comp); iscsit_dec_conn_usage_count(conn); - iscsit_stop_session(sess, 1, 1); + iscsit_stop_session(sess, sleep, sleep); iscsit_dec_session_usage_count(sess); target_put_session(sess->se_sess); } @@ -4443,13 +4430,12 @@ static void iscsit_logout_post_handler_closesession( static void iscsit_logout_post_handler_samecid( struct iscsi_conn *conn) { - iscsi_set_thread_clear(conn, ISCSI_CLEAR_TX_THREAD); - iscsi_set_thread_set_signal(conn, ISCSI_SIGNAL_TX_THREAD); + int sleep = cmpxchg(&conn->tx_thread_active, true, false); atomic_set(&conn->conn_logout_remove, 0); complete(&conn->conn_logout_comp); - iscsit_cause_connection_reinstatement(conn, 1); + iscsit_cause_connection_reinstatement(conn, sleep); iscsit_dec_conn_usage_count(conn); } diff --git a/drivers/target/iscsi/iscsi_target_core.h b/drivers/target/iscsi/iscsi_target_core.h index e117870eb445ff..815bf5b1a4ae43 100644 --- a/drivers/target/iscsi/iscsi_target_core.h +++ b/drivers/target/iscsi/iscsi_target_core.h @@ -586,6 +586,11 @@ struct iscsi_conn { struct iscsi_session *sess; /* Pointer to thread_set in use for this conn's threads */ struct iscsi_thread_set *thread_set; + int bitmap_id; + int rx_thread_active; + struct task_struct *rx_thread; + int tx_thread_active; + struct task_struct *tx_thread; /* list_head for session connection list */ struct list_head conn_list; } ____cacheline_aligned; @@ -862,10 +867,12 @@ struct iscsit_global { /* Unique identifier used for the authentication daemon */ u32 auth_id; u32 inactive_ts; +#define ISCSIT_BITMAP_BITS 262144 /* Thread Set bitmap count */ int ts_bitmap_count; /* Thread Set bitmap pointer */ unsigned long *ts_bitmap; + spinlock_t ts_bitmap_lock; /* Used for iSCSI discovery session authentication */ struct iscsi_node_acl discovery_acl; struct iscsi_portal_group *discovery_tpg; diff --git a/drivers/target/iscsi/iscsi_target_erl0.c b/drivers/target/iscsi/iscsi_target_erl0.c index 08bd87833321c0..fab67eea54c0dd 100644 --- a/drivers/target/iscsi/iscsi_target_erl0.c +++ b/drivers/target/iscsi/iscsi_target_erl0.c @@ -866,7 +866,10 @@ void iscsit_connection_reinstatement_rcfr(struct iscsi_conn *conn) } spin_unlock_bh(&conn->state_lock); - iscsi_thread_set_force_reinstatement(conn); + if (conn->tx_thread && conn->tx_thread_active) + send_sig(SIGINT, conn->tx_thread, 1); + if (conn->rx_thread && conn->rx_thread_active) + send_sig(SIGINT, conn->rx_thread, 1); sleep: wait_for_completion(&conn->conn_wait_rcfr_comp); @@ -891,10 +894,10 @@ void iscsit_cause_connection_reinstatement(struct iscsi_conn *conn, int sleep) return; } - if (iscsi_thread_set_force_reinstatement(conn) < 0) { - spin_unlock_bh(&conn->state_lock); - return; - } + if (conn->tx_thread && conn->tx_thread_active) + send_sig(SIGINT, conn->tx_thread, 1); + if (conn->rx_thread && conn->rx_thread_active) + send_sig(SIGINT, conn->rx_thread, 1); atomic_set(&conn->connection_reinstatement, 1); if (!sleep) { diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c index 0493e8b1ba8fdd..797b2e2acc356e 100644 --- a/drivers/target/iscsi/iscsi_target_login.c +++ b/drivers/target/iscsi/iscsi_target_login.c @@ -683,7 +683,52 @@ static void iscsi_post_login_start_timers(struct iscsi_conn *conn) iscsit_start_nopin_timer(conn); } -static int iscsi_post_login_handler( +int iscsit_start_kthreads(struct iscsi_conn *conn) +{ + int ret = 0; + + spin_lock(&iscsit_global->ts_bitmap_lock); + conn->bitmap_id = bitmap_find_free_region(iscsit_global->ts_bitmap, + ISCSIT_BITMAP_BITS, get_order(1)); + spin_unlock(&iscsit_global->ts_bitmap_lock); + + if (conn->bitmap_id < 0) { + pr_err("bitmap_find_free_region() failed for" + " iscsit_start_kthreads()\n"); + return -ENOMEM; + } + + conn->tx_thread = kthread_run(iscsi_target_tx_thread, conn, + "%s", ISCSI_TX_THREAD_NAME); + if (IS_ERR(conn->tx_thread)) { + pr_err("Unable to start iscsi_target_tx_thread\n"); + ret = PTR_ERR(conn->tx_thread); + goto out_bitmap; + } + conn->tx_thread_active = true; + + conn->rx_thread = kthread_run(iscsi_target_rx_thread, conn, + "%s", ISCSI_RX_THREAD_NAME); + if (IS_ERR(conn->rx_thread)) { + pr_err("Unable to start iscsi_target_rx_thread\n"); + ret = PTR_ERR(conn->rx_thread); + goto out_tx; + } + conn->rx_thread_active = true; + + return 0; +out_tx: + kthread_stop(conn->tx_thread); + conn->tx_thread_active = false; +out_bitmap: + spin_lock(&iscsit_global->ts_bitmap_lock); + bitmap_release_region(iscsit_global->ts_bitmap, conn->bitmap_id, + get_order(1)); + spin_unlock(&iscsit_global->ts_bitmap_lock); + return ret; +} + +int iscsi_post_login_handler( struct iscsi_np *np, struct iscsi_conn *conn, u8 zero_tsih) @@ -693,7 +738,7 @@ static int iscsi_post_login_handler( struct se_session *se_sess = sess->se_sess; struct iscsi_portal_group *tpg = ISCSI_TPG_S(sess); struct se_portal_group *se_tpg = &tpg->tpg_se_tpg; - struct iscsi_thread_set *ts; + int rc; iscsit_inc_conn_usage_count(conn); @@ -708,7 +753,6 @@ static int iscsi_post_login_handler( /* * SCSI Initiator -> SCSI Target Port Mapping */ - ts = iscsi_get_thread_set(); if (!zero_tsih) { iscsi_set_session_parameters(sess->sess_ops, conn->param_list, 0); @@ -735,9 +779,11 @@ static int iscsi_post_login_handler( sess->sess_ops->InitiatorName); spin_unlock_bh(&sess->conn_lock); - iscsi_post_login_start_timers(conn); + rc = iscsit_start_kthreads(conn); + if (rc) + return rc; - iscsi_activate_thread_set(conn, ts); + iscsi_post_login_start_timers(conn); /* * Determine CPU mask to ensure connection's RX and TX kthreads * are scheduled on the same CPU. @@ -794,8 +840,11 @@ static int iscsi_post_login_handler( " iSCSI Target Portal Group: %hu\n", tpg->nsessions, tpg->tpgt); spin_unlock_bh(&se_tpg->session_lock); + rc = iscsit_start_kthreads(conn); + if (rc) + return rc; + iscsi_post_login_start_timers(conn); - iscsi_activate_thread_set(conn, ts); /* * Determine CPU mask to ensure connection's RX and TX kthreads * are scheduled on the same CPU. From 394adc1d4905b143a3f4f6a859a2253becc1101e Mon Sep 17 00:00:00 2001 From: Sagi Grimberg Date: Sun, 29 Mar 2015 15:52:04 +0300 Subject: [PATCH 109/359] iser-target: Fix possible deadlock in RDMA_CM connection error commit 4a579da2586bd3b79b025947ea24ede2bbfede62 upstream. Before we reach to connection established we may get an error event. In this case the core won't teardown this connection (never established it), so we take care of freeing it ourselves. Signed-off-by: Sagi Grimberg Signed-off-by: Nicholas Bellinger Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/ulp/isert/ib_isert.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index 8019e642d2f51d..4c2ed0b7d14086 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c @@ -202,7 +202,7 @@ isert_alloc_rx_descriptors(struct isert_conn *isert_conn) static void isert_free_rx_descriptors(struct isert_conn *isert_conn) { - struct ib_device *ib_dev = isert_conn->conn_cm_id->device; + struct ib_device *ib_dev = isert_conn->conn_device->ib_device; struct iser_rx_desc *rx_desc; int i; @@ -527,14 +527,15 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) static void isert_connect_release(struct isert_conn *isert_conn) { - struct ib_device *ib_dev = isert_conn->conn_cm_id->device; struct isert_device *device = isert_conn->conn_device; int cq_index; + struct ib_device *ib_dev = device->ib_device; pr_debug("Entering isert_connect_release(): >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n"); isert_free_rx_descriptors(isert_conn); - rdma_destroy_id(isert_conn->conn_cm_id); + if (isert_conn->conn_cm_id) + rdma_destroy_id(isert_conn->conn_cm_id); if (isert_conn->conn_qp) { cq_index = ((struct isert_cq_desc *) @@ -689,12 +690,15 @@ isert_disconnected_handler(struct rdma_cm_id *cma_id, return 0; } -static void +static int isert_connect_error(struct rdma_cm_id *cma_id) { struct isert_conn *isert_conn = cma_id->qp->qp_context; + isert_conn->conn_cm_id = NULL; isert_put_conn(isert_conn); + + return -1; } static int @@ -724,7 +728,7 @@ isert_cma_handler(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) case RDMA_CM_EVENT_REJECTED: /* FALLTHRU */ case RDMA_CM_EVENT_UNREACHABLE: /* FALLTHRU */ case RDMA_CM_EVENT_CONNECT_ERROR: - isert_connect_error(cma_id); + ret = isert_connect_error(cma_id); break; default: pr_err("Unhandled RDMA CMA event: %d\n", event->event); From 45f29355a34aa73db8c3419168e57d5b185bf0fa Mon Sep 17 00:00:00 2001 From: Sagi Grimberg Date: Thu, 4 Jun 2015 19:49:20 +0300 Subject: [PATCH 110/359] iser-target: release stale iser connections commit 2f1b6b7d9a815f341b18dfd26a363f37d4d3c96a upstream. When receiving a new iser connect request we serialize the pending requests by adding the newly created iser connection to the np accept list and let the login thread process the connect request one by one (np_accept_wait). In case we received a disconnect request before the iser_conn has begun processing (still linked in np_accept_list) we should detach it from the list and clean it up and not have the login thread process a stale connection. We do it only when the connection state is not already terminating (initiator driven disconnect) as this might lead us to access np_accept_mutex after the np was released in live shutdown scenarios. Signed-off-by: Sagi Grimberg Signed-off-by: Jenny Falkovich Signed-off-by: Nicholas Bellinger Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/ulp/isert/ib_isert.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index 4c2ed0b7d14086..43aa807d78bd32 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c @@ -49,6 +49,8 @@ static int isert_rdma_accept(struct isert_conn *isert_conn); struct rdma_cm_id *isert_setup_id(struct isert_np *isert_np); +static void isert_release_work(struct work_struct *work); + static void isert_qp_event_callback(struct ib_event *e, void *context) { @@ -432,6 +434,7 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) init_completion(&isert_conn->conn_wait_comp_err); kref_init(&isert_conn->conn_kref); mutex_init(&isert_conn->conn_mutex); + INIT_WORK(&isert_conn->release_work, isert_release_work); isert_conn->conn_cm_id = cma_id; isert_conn->responder_resources = event->param.conn.responder_resources; @@ -674,6 +677,7 @@ isert_disconnected_handler(struct rdma_cm_id *cma_id, { struct isert_np *isert_np = cma_id->context; struct isert_conn *isert_conn; + bool terminating = false; if (isert_np->np_cm_id == cma_id) return isert_np_cma_handler(cma_id->context, event); @@ -681,12 +685,25 @@ isert_disconnected_handler(struct rdma_cm_id *cma_id, isert_conn = cma_id->qp->qp_context; mutex_lock(&isert_conn->conn_mutex); + terminating = (isert_conn->state == ISER_CONN_TERMINATING); isert_conn_terminate(isert_conn); mutex_unlock(&isert_conn->conn_mutex); pr_info("conn %p completing conn_wait\n", isert_conn); complete(&isert_conn->conn_wait); + if (terminating) + goto out; + + mutex_lock(&isert_np->np_accept_mutex); + if (!list_empty(&isert_conn->conn_accept_node)) { + list_del_init(&isert_conn->conn_accept_node); + isert_put_conn(isert_conn); + queue_work(isert_release_wq, &isert_conn->release_work); + } + mutex_unlock(&isert_np->np_accept_mutex); + +out: return 0; } @@ -2422,7 +2439,6 @@ static void isert_wait_conn(struct iscsi_conn *conn) wait_for_completion(&isert_conn->conn_wait_comp_err); - INIT_WORK(&isert_conn->release_work, isert_release_work); queue_work(isert_release_wq, &isert_conn->release_work); } From 21dd5b3d73c3964a0bdcebcc0f5227f38d2d85b2 Mon Sep 17 00:00:00 2001 From: Ding Wang Date: Mon, 18 May 2015 20:14:15 +0800 Subject: [PATCH 111/359] mmc: card: Fixup request missing in mmc_blk_issue_rw_rq commit 29535f7b797df35cc9b6b3bca635591cdd3dd2a8 upstream. The current handler of MMC_BLK_CMD_ERR in mmc_blk_issue_rw_rq function may cause new coming request permanent missing when the ongoing request (previoulsy started) complete end. The problem scenario is as follows: (1) Request A is ongoing; (2) Request B arrived, and finally mmc_blk_issue_rw_rq() is called; (3) Request A encounters the MMC_BLK_CMD_ERR error; (4) In the error handling of MMC_BLK_CMD_ERR, suppose mmc_blk_cmd_err() end request A completed and return zero. Continue the error handling, suppose mmc_blk_reset() reset device success; (5) Continue the execution, while loop completed because variable ret is zero now; (6) Finally, mmc_blk_issue_rw_rq() return without processing request B. The process related to the missing request may wait that IO request complete forever, possibly crashing the application or hanging the system. Fix this issue by starting new request when reset success. Signed-off-by: Ding Wang Fixes: 67716327eec7 ("mmc: block: add eMMC hardware reset support") Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/card/block.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index 32fc557bca43a2..885ba4a19a6cee 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -1835,9 +1835,11 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *rqc) break; case MMC_BLK_CMD_ERR: ret = mmc_blk_cmd_err(md, card, brq, req, ret); - if (!mmc_blk_reset(md, card->host, type)) - break; - goto cmd_abort; + if (mmc_blk_reset(md, card->host, type)) + goto cmd_abort; + if (!ret) + goto start_new_req; + break; case MMC_BLK_RETRY: if (retry++ < 5) break; From bf95f46c3f1c3aa7f0cc026241877478487c3670 Mon Sep 17 00:00:00 2001 From: Chris Metcalf Date: Thu, 25 Jun 2015 15:02:08 -0700 Subject: [PATCH 112/359] __bitmap_parselist: fix bug in empty string handling commit 2528a8b8f457d7432552d0e2b6f0f4046bb702f4 upstream. bitmap_parselist("", &mask, nmaskbits) will erroneously set bit zero in the mask. The same bug is visible in cpumask_parselist() since it is layered on top of the bitmask code, e.g. if you boot with "isolcpus=", you will actually end up with cpu zero isolated. The bug was introduced in commit 4b060420a596 ("bitmap, irq: add smp_affinity_list interface to /proc/irq") when bitmap_parselist() was generalized to support userspace as well as kernelspace. Fixes: 4b060420a596 ("bitmap, irq: add smp_affinity_list interface to /proc/irq") Signed-off-by: Chris Metcalf Cc: Rasmus Villemoes Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- lib/bitmap.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/bitmap.c b/lib/bitmap.c index e5c4ebe586babf..c0634aa923a6d6 100644 --- a/lib/bitmap.c +++ b/lib/bitmap.c @@ -603,12 +603,12 @@ static int __bitmap_parselist(const char *buf, unsigned int buflen, unsigned a, b; int c, old_c, totaldigits; const char __user __force *ubuf = (const char __user __force *)buf; - int exp_digit, in_range; + int at_start, in_range; totaldigits = c = 0; bitmap_zero(maskp, nmaskbits); do { - exp_digit = 1; + at_start = 1; in_range = 0; a = b = 0; @@ -637,11 +637,10 @@ static int __bitmap_parselist(const char *buf, unsigned int buflen, break; if (c == '-') { - if (exp_digit || in_range) + if (at_start || in_range) return -EINVAL; b = 0; in_range = 1; - exp_digit = 1; continue; } @@ -651,16 +650,18 @@ static int __bitmap_parselist(const char *buf, unsigned int buflen, b = b * 10 + (c - '0'); if (!in_range) a = b; - exp_digit = 0; + at_start = 0; totaldigits++; } if (!(a <= b)) return -EINVAL; if (b >= nmaskbits) return -ERANGE; - while (a <= b) { - set_bit(a, maskp); - a++; + if (!at_start) { + while (a <= b) { + set_bit(a, maskp); + a++; + } } } while (buflen && c == ','); return 0; From 5c817fb317292d051103e738e825d8d543a51304 Mon Sep 17 00:00:00 2001 From: Michal Kazior Date: Fri, 22 May 2015 10:22:40 +0200 Subject: [PATCH 113/359] mac80211: prevent possible crypto tx tailroom corruption commit ab499db80fcf07c18e4053f91a619500f663e90e upstream. There was a possible race between ieee80211_reconfig() and ieee80211_delayed_tailroom_dec(). This could result in inability to transmit data if driver crashed during roaming or rekeying and subsequent skbs with insufficient tailroom appeared. This race was probably never seen in the wild because a device driver would have to crash AND recover within 0.5s which is very unlikely. I was able to prove this race exists after changing the delay to 10s locally and crashing ath10k via debugfs immediately after GTK rekeying. In case of ath10k the counter went below 0. This was harmless but other drivers which actually require tailroom (e.g. for WEP ICV or MMIC) could end up with the counter at 0 instead of >0 and introduce insufficient skb tailroom failures because mac80211 would not resize skbs appropriately anymore. Fixes: 8d1f7ecd2af5 ("mac80211: defer tailroom counter manipulation when roaming") Signed-off-by: Michal Kazior Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- net/mac80211/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 6658c58093533a..dd6ca36c34c1f4 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -257,6 +257,7 @@ static void ieee80211_restart_work(struct work_struct *work) { struct ieee80211_local *local = container_of(work, struct ieee80211_local, restart_work); + struct ieee80211_sub_if_data *sdata; /* wait for scan work complete */ flush_workqueue(local->workqueue); @@ -269,6 +270,8 @@ static void ieee80211_restart_work(struct work_struct *work) mutex_unlock(&local->mtx); rtnl_lock(); + list_for_each_entry(sdata, &local->interfaces, list) + flush_delayed_work(&sdata->dec_tailroom_needed_wk); ieee80211_scan_cancel(local); ieee80211_reconfig(local); rtnl_unlock(); From e17805417b3b213935a597e64592bae2a5daa2c4 Mon Sep 17 00:00:00 2001 From: Alan Stern Date: Thu, 29 Jan 2015 11:29:13 -0500 Subject: [PATCH 114/359] USB: usbfs: allow URBs to be reaped after disconnection commit 3f2cee73b650921b2e214bf487b2061a1c266504 upstream. The usbfs API has a peculiar hole: Users are not allowed to reap their URBs after the device has been disconnected. There doesn't seem to be any good reason for this; it is an ad-hoc inconsistency. The patch allows users to issue the USBDEVFS_REAPURB and USBDEVFS_REAPURBNDELAY ioctls (together with their 32-bit counterparts on 64-bit systems) even after the device is gone. If no URBs are pending for a disconnected device then the ioctls will return -ENODEV rather than -EAGAIN, because obviously no new URBs will ever be able to complete. The patch also adds a new capability flag for USBDEVFS_GET_CAPABILITIES to indicate that the reap-after-disconnect feature is supported. Signed-off-by: Alan Stern Tested-by: Chris Dickens Acked-by: Hans de Goede Signed-off-by: Greg Kroah-Hartman --- drivers/usb/core/devio.c | 63 ++++++++++++++++++------------- include/uapi/linux/usbdevice_fs.h | 3 +- 2 files changed, 39 insertions(+), 27 deletions(-) diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 4c011cfb1da3d8..62e532fb82ad4a 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -1593,7 +1593,7 @@ static struct async *reap_as(struct dev_state *ps) for (;;) { __set_current_state(TASK_INTERRUPTIBLE); as = async_getcompleted(ps); - if (as) + if (as || !connected(ps)) break; if (signal_pending(current)) break; @@ -1616,7 +1616,7 @@ static int proc_reapurb(struct dev_state *ps, void __user *arg) } if (signal_pending(current)) return -EINTR; - return -EIO; + return -ENODEV; } static int proc_reapurbnonblock(struct dev_state *ps, void __user *arg) @@ -1625,10 +1625,11 @@ static int proc_reapurbnonblock(struct dev_state *ps, void __user *arg) struct async *as; as = async_getcompleted(ps); - retval = -EAGAIN; if (as) { retval = processcompl(as, (void __user * __user *)arg); free_async(as); + } else { + retval = (connected(ps) ? -EAGAIN : -ENODEV); } return retval; } @@ -1758,7 +1759,7 @@ static int proc_reapurb_compat(struct dev_state *ps, void __user *arg) } if (signal_pending(current)) return -EINTR; - return -EIO; + return -ENODEV; } static int proc_reapurbnonblock_compat(struct dev_state *ps, void __user *arg) @@ -1766,11 +1767,12 @@ static int proc_reapurbnonblock_compat(struct dev_state *ps, void __user *arg) int retval; struct async *as; - retval = -EAGAIN; as = async_getcompleted(ps); if (as) { retval = processcompl_compat(as, (void __user * __user *)arg); free_async(as); + } else { + retval = (connected(ps) ? -EAGAIN : -ENODEV); } return retval; } @@ -1941,7 +1943,8 @@ static int proc_get_capabilities(struct dev_state *ps, void __user *arg) { __u32 caps; - caps = USBDEVFS_CAP_ZERO_PACKET | USBDEVFS_CAP_NO_PACKET_SIZE_LIM; + caps = USBDEVFS_CAP_ZERO_PACKET | USBDEVFS_CAP_NO_PACKET_SIZE_LIM | + USBDEVFS_CAP_REAP_AFTER_DISCONNECT; if (!ps->dev->bus->no_stop_on_short) caps |= USBDEVFS_CAP_BULK_CONTINUATION; if (ps->dev->bus->sg_tablesize) @@ -2002,6 +2005,32 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd, return -EPERM; usb_lock_device(dev); + + /* Reap operations are allowed even after disconnection */ + switch (cmd) { + case USBDEVFS_REAPURB: + snoop(&dev->dev, "%s: REAPURB\n", __func__); + ret = proc_reapurb(ps, p); + goto done; + + case USBDEVFS_REAPURBNDELAY: + snoop(&dev->dev, "%s: REAPURBNDELAY\n", __func__); + ret = proc_reapurbnonblock(ps, p); + goto done; + +#ifdef CONFIG_COMPAT + case USBDEVFS_REAPURB32: + snoop(&dev->dev, "%s: REAPURB32\n", __func__); + ret = proc_reapurb_compat(ps, p); + goto done; + + case USBDEVFS_REAPURBNDELAY32: + snoop(&dev->dev, "%s: REAPURBNDELAY32\n", __func__); + ret = proc_reapurbnonblock_compat(ps, p); + goto done; +#endif + } + if (!connected(ps)) { usb_unlock_device(dev); return -ENODEV; @@ -2095,16 +2124,6 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd, inode->i_mtime = CURRENT_TIME; break; - case USBDEVFS_REAPURB32: - snoop(&dev->dev, "%s: REAPURB32\n", __func__); - ret = proc_reapurb_compat(ps, p); - break; - - case USBDEVFS_REAPURBNDELAY32: - snoop(&dev->dev, "%s: REAPURBNDELAY32\n", __func__); - ret = proc_reapurbnonblock_compat(ps, p); - break; - case USBDEVFS_IOCTL32: snoop(&dev->dev, "%s: IOCTL32\n", __func__); ret = proc_ioctl_compat(ps, ptr_to_compat(p)); @@ -2116,16 +2135,6 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd, ret = proc_unlinkurb(ps, p); break; - case USBDEVFS_REAPURB: - snoop(&dev->dev, "%s: REAPURB\n", __func__); - ret = proc_reapurb(ps, p); - break; - - case USBDEVFS_REAPURBNDELAY: - snoop(&dev->dev, "%s: REAPURBNDELAY\n", __func__); - ret = proc_reapurbnonblock(ps, p); - break; - case USBDEVFS_DISCSIGNAL: snoop(&dev->dev, "%s: DISCSIGNAL\n", __func__); ret = proc_disconnectsignal(ps, p); @@ -2162,6 +2171,8 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd, ret = proc_disconnect_claim(ps, p); break; } + + done: usb_unlock_device(dev); if (ret >= 0) inode->i_atime = CURRENT_TIME; diff --git a/include/uapi/linux/usbdevice_fs.h b/include/uapi/linux/usbdevice_fs.h index 0c65e4b1261717..ef29266ef77a17 100644 --- a/include/uapi/linux/usbdevice_fs.h +++ b/include/uapi/linux/usbdevice_fs.h @@ -125,11 +125,12 @@ struct usbdevfs_hub_portinfo { char port [127]; /* e.g. port 3 connects to device 27 */ }; -/* Device capability flags */ +/* System and bus capability flags */ #define USBDEVFS_CAP_ZERO_PACKET 0x01 #define USBDEVFS_CAP_BULK_CONTINUATION 0x02 #define USBDEVFS_CAP_NO_PACKET_SIZE_LIM 0x04 #define USBDEVFS_CAP_BULK_SCATTER_GATHER 0x08 +#define USBDEVFS_CAP_REAP_AFTER_DISCONNECT 0x10 /* USBDEVFS_DISCONNECT_CLAIM flags & struct */ From 6afa955908877c770d18eb53a00bf8113fa9dab3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Wed, 29 Apr 2015 20:38:46 +0200 Subject: [PATCH 115/359] watchdog: omap: assert the counter being stopped before reprogramming MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 530c11d432727c697629ad5f9d00ee8e2864d453 upstream. The omap watchdog has the annoying behaviour that writes to most registers don't have any effect when the watchdog is already running. Quoting the AM335x reference manual: To modify the timer counter value (the WDT_WCRR register), prescaler ratio (the WDT_WCLR[4:2] PTV bit field), delay configuration value (the WDT_WDLY[31:0] DLY_VALUE bit field), or the load value (the WDT_WLDR[31:0] TIMER_LOAD bit field), the watchdog timer must be disabled by using the start/stop sequence (the WDT_WSPR register). Currently the timer is stopped in the .probe callback but still there are possibilities that yield to a situation where omap_wdt_start is entered with the timer running (e.g. when /dev/watchdog is closed without stopping and then reopened). In such a case programming the timeout silently fails! To circumvent this stop the timer before reprogramming. Assuming one of the first things the watchdog user does is setting the timeout explicitly nothing too bad should happen because this explicit setting works fine. Fixes: 7768a13c252a ("[PATCH] OMAP: Add Watchdog driver support") Signed-off-by: Uwe Kleine-König Reviewed-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck Signed-off-by: Greg Kroah-Hartman --- drivers/watchdog/omap_wdt.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c index af88ffd1068f57..2b7e073f5e36a4 100644 --- a/drivers/watchdog/omap_wdt.c +++ b/drivers/watchdog/omap_wdt.c @@ -134,6 +134,13 @@ static int omap_wdt_start(struct watchdog_device *wdog) pm_runtime_get_sync(wdev->dev); + /* + * Make sure the watchdog is disabled. This is unfortunately required + * because writing to various registers with the watchdog running has no + * effect. + */ + omap_wdt_disable(wdev); + /* initialize prescaler */ while (__raw_readl(base + OMAP_WATCHDOG_WPS) & 0x01) cpu_relax(); From f35c364f0e14db2df30a2518c4db844b453beae9 Mon Sep 17 00:00:00 2001 From: Chuck Lever Date: Tue, 26 May 2015 11:53:52 -0400 Subject: [PATCH 116/359] NFS: Fix size of NFSACL SETACL operations commit d683cc49daf7c5afca8cd9654aaa1bf63cdf2ad9 upstream. When encoding the NFSACL SETACL operation, reserve just the estimated size of the ACL rather than a fixed maximum. This eliminates needless zero padding on the wire that the server ignores. Fixes: ee5dc7732bd5 ('NFS: Fix "kernel BUG at fs/nfs/nfs3xdr.c:1338!"') Signed-off-by: Chuck Lever Signed-off-by: Trond Myklebust Signed-off-by: Greg Kroah-Hartman --- fs/nfs/nfs3xdr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c index fa6d72131c19e6..4495cad189c305 100644 --- a/fs/nfs/nfs3xdr.c +++ b/fs/nfs/nfs3xdr.c @@ -1342,7 +1342,7 @@ static void nfs3_xdr_enc_setacl3args(struct rpc_rqst *req, if (args->npages != 0) xdr_write_pages(xdr, args->pages, 0, args->len); else - xdr_reserve_space(xdr, NFS_ACL_INLINE_BUFSIZE); + xdr_reserve_space(xdr, args->len); error = nfsacl_encode(xdr->buf, base, args->inode, (args->mask & NFS_ACL) ? From 68e529128b5cbb783ac5afb722fc26901753fa8c Mon Sep 17 00:00:00 2001 From: Olga Kornievskaia Date: Fri, 15 May 2015 11:45:31 -0400 Subject: [PATCH 117/359] fixing infinite OPEN loop in 4.0 stateid recovery commit e8d975e73e5fa05f983fbf2723120edcf68e0b38 upstream. Problem: When an operation like WRITE receives a BAD_STATEID, even though recovery code clears the RECLAIM_NOGRACE recovery flag before recovering the open state, because of clearing delegation state for the associated inode, nfs_inode_find_state_and_recover() gets called and it makes the same state with RECLAIM_NOGRACE flag again. As a results, when we restart looking over the open states, we end up in the infinite loop instead of breaking out in the next test of state flags. Solution: unset the RECLAIM_NOGRACE set because of calling of nfs_inode_find_state_and_recover() after returning from calling recover_open() function. Signed-off-by: Olga Kornievskaia Signed-off-by: Trond Myklebust Signed-off-by: Greg Kroah-Hartman --- fs/nfs/nfs4state.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index d482b86d0e0bcf..cfa9163b3bb706 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -1452,6 +1452,8 @@ static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs } spin_unlock(&state->state_lock); nfs4_put_open_state(state); + clear_bit(NFS4CLNT_RECLAIM_NOGRACE, + &state->flags); spin_lock(&sp->so_lock); goto restart; } From 0e22b367fec937512336958053ddb3ffe1db92d3 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Tue, 9 Jun 2015 19:43:56 -0400 Subject: [PATCH 118/359] nfs: increase size of EXCHANGE_ID name string buffer commit 764ad8ba8cd4c6f836fca9378f8c5121aece0842 upstream. The current buffer is much too small if you have a relatively long hostname. Bring it up to the size of the one that SETCLIENTID has. Reported-by: Michael Skralivetsky Signed-off-by: Jeff Layton Signed-off-by: Trond Myklebust Signed-off-by: Greg Kroah-Hartman --- include/linux/nfs_xdr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 54e351aa4d2e56..a9e5134c2936fe 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h @@ -1094,7 +1094,7 @@ struct pnfs_ds_commit_info { struct pnfs_commit_bucket *buckets; }; -#define NFS4_EXCHANGE_ID_LEN (48) +#define NFS4_EXCHANGE_ID_LEN (127) struct nfs41_exchange_id_args { struct nfs_client *client; nfs4_verifier *verifier; From 13d0b6aae666e69c0156a3c6d1b6116a2e64078a Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Mon, 1 Jun 2015 15:10:25 -0400 Subject: [PATCH 119/359] SUNRPC: Fix a memory leak in the backchannel code commit 88de6af24f2b48b06c514d3c3d0a8f22fafe30bd upstream. req->rq_private_buf isn't initialised when xprt_setup_backchannel calls xprt_free_allocation. Fixes: fb7a0b9addbdb ("nfs41: New backchannel helper routines") Signed-off-by: Trond Myklebust Signed-off-by: Greg Kroah-Hartman --- net/sunrpc/backchannel_rqst.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sunrpc/backchannel_rqst.c b/net/sunrpc/backchannel_rqst.c index 890a29912d5ab3..d29c119ecd9cd9 100644 --- a/net/sunrpc/backchannel_rqst.c +++ b/net/sunrpc/backchannel_rqst.c @@ -60,7 +60,7 @@ static void xprt_free_allocation(struct rpc_rqst *req) dprintk("RPC: free allocations for req= %p\n", req); WARN_ON_ONCE(test_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state)); - xbufp = &req->rq_private_buf; + xbufp = &req->rq_rcv_buf; free_page((unsigned long)xbufp->head[0].iov_base); xbufp = &req->rq_snd_buf; free_page((unsigned long)xbufp->head[0].iov_base); From 693f66d6213c20cc83a33ef18e8ae01d78883e3d Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 4 Jul 2015 16:04:19 -0400 Subject: [PATCH 120/359] 9p: forgetting to cancel request on interrupted zero-copy RPC commit a84b69cb6e0a41e86bc593904faa6def3b957343 upstream. If we'd already sent a request and decide to abort it, we *must* issue TFLUSH properly and not just blindly reuse the tag, or we'll get seriously screwed when response eventually arrives and we confuse it for response to later request that had reused the same tag. Signed-off-by: Al Viro Signed-off-by: Greg Kroah-Hartman --- net/9p/client.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/9p/client.c b/net/9p/client.c index addc116cecf0be..853d62327a58a3 100644 --- a/net/9p/client.c +++ b/net/9p/client.c @@ -828,7 +828,8 @@ static struct p9_req_t *p9_client_zc_rpc(struct p9_client *c, int8_t type, if (err < 0) { if (err == -EIO) c->status = Disconnected; - goto reterr; + if (err != -ERESTARTSYS) + goto reterr; } if (req->status == REQ_STATUS_ERROR) { p9_debug(P9_DEBUG_ERROR, "req_status error %d\n", req->t_err); From b5a1d545f4ca7e5f47c891130c15d9898c08488e Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 12 Jul 2015 10:34:29 -0400 Subject: [PATCH 121/359] 9p: don't leave a half-initialized inode sitting around commit 0a73d0a204a4a04a1e110539c5a524ae51f91d6d upstream. Signed-off-by: Al Viro Signed-off-by: Greg Kroah-Hartman --- fs/9p/vfs_inode.c | 3 +-- fs/9p/vfs_inode_dotl.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index d86edc8d3fd05a..4c7d309e4aa6ea 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c @@ -537,8 +537,7 @@ static struct inode *v9fs_qid_iget(struct super_block *sb, unlock_new_inode(inode); return inode; error: - unlock_new_inode(inode); - iput(inode); + iget_failed(inode); return ERR_PTR(retval); } diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c index 53687bbf2296f8..65b21a24841e59 100644 --- a/fs/9p/vfs_inode_dotl.c +++ b/fs/9p/vfs_inode_dotl.c @@ -151,8 +151,7 @@ static struct inode *v9fs_qid_iget_dotl(struct super_block *sb, unlock_new_inode(inode); return inode; error: - unlock_new_inode(inode); - iput(inode); + iget_failed(inode); return ERR_PTR(retval); } From d8c97a8db6c42be159f05dbe02729a85a543aa01 Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Wed, 24 Jun 2015 17:24:33 +0300 Subject: [PATCH 122/359] rbd: use GFP_NOIO in rbd_obj_request_create() commit 5a60e87603c4c533492c515b7f62578189b03c9c upstream. rbd_obj_request_create() is called on the main I/O path, so we need to use GFP_NOIO to make sure allocation doesn't blow back on us. Not all callers need this, but I'm still hardcoding the flag inside rather than making it a parameter because a) this is going to stable, and b) those callers shouldn't really use rbd_obj_request_create() and will be fixed in the future. More memory allocation fixes will follow. Signed-off-by: Ilya Dryomov Reviewed-by: Alex Elder Signed-off-by: Greg Kroah-Hartman --- drivers/block/rbd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index dd297099c99dd1..f78cbbb88bd4f0 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -1851,11 +1851,11 @@ static struct rbd_obj_request *rbd_obj_request_create(const char *object_name, rbd_assert(obj_request_type_valid(type)); size = strlen(object_name) + 1; - name = kmalloc(size, GFP_KERNEL); + name = kmalloc(size, GFP_NOIO); if (!name) return NULL; - obj_request = kmem_cache_zalloc(rbd_obj_request_cache, GFP_KERNEL); + obj_request = kmem_cache_zalloc(rbd_obj_request_cache, GFP_NOIO); if (!obj_request) { kfree(name); return NULL; From f626f57b4ebd92ef9270eca4aa49a541bc66ff27 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 28 Jun 2015 14:18:16 +0100 Subject: [PATCH 123/359] agp/intel: Fix typo in needs_ilk_vtd_wa() commit 8b572a4200828b4e75cc22ed2f494b58d5372d65 upstream. In needs_ilk_vtd_wa(), we pass in the GPU device but compared it against the ids for the mobile GPU and the mobile host bridge. That latter is impossible and so likely was just a typo for the desktop GPU device id (which is also buggy). Fixes commit da88a5f7f7d434e2cde1b3e19d952e6d84533662 Author: Chris Wilson Date: Wed Feb 13 09:31:53 2013 +0000 drm/i915: Disable WC PTE updates to w/a buggy IOMMU on ILK Reported-by: Ting-Wei Lan Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91127 References: https://bugzilla.freedesktop.org/show_bug.cgi?id=60391 Signed-off-by: Chris Wilson Cc: Daniel Vetter Reviewed-by: Daniel Vetter Signed-off-by: Jani Nikula Signed-off-by: Greg Kroah-Hartman --- drivers/char/agp/intel-gtt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c index b8e2014cb9cb06..051aadb75e2cea 100644 --- a/drivers/char/agp/intel-gtt.c +++ b/drivers/char/agp/intel-gtt.c @@ -583,7 +583,7 @@ static inline int needs_ilk_vtd_wa(void) /* Query intel_iommu to see if we need the workaround. Presumably that * was loaded first. */ - if ((gpu_devid == PCI_DEVICE_ID_INTEL_IRONLAKE_M_HB || + if ((gpu_devid == PCI_DEVICE_ID_INTEL_IRONLAKE_D_IG || gpu_devid == PCI_DEVICE_ID_INTEL_IRONLAKE_M_IG) && intel_iommu_gfx_mapped) return 1; From c0e05f1c65358e9b770cebaf05200bb6243c28e5 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Thu, 26 Mar 2015 20:47:10 -0700 Subject: [PATCH 124/359] hpfs: hpfs_error: Remove static buffer, use vsprintf extension %pV instead commit a28e4b2b18ccb90df402da3f21e1a83c9d4f8ec1 upstream. Removing unnecessary static buffers is good. Use the vsprintf %pV extension instead. Signed-off-by: Joe Perches Signed-off-by: Mikulas Patocka Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- fs/hpfs/super.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c index 962e90c37aec64..2c1ce192af8bcd 100644 --- a/fs/hpfs/super.c +++ b/fs/hpfs/super.c @@ -52,17 +52,20 @@ static void unmark_dirty(struct super_block *s) } /* Filesystem error... */ -static char err_buf[1024]; - void hpfs_error(struct super_block *s, const char *fmt, ...) { + struct va_format vaf; va_list args; va_start(args, fmt); - vsnprintf(err_buf, sizeof(err_buf), fmt, args); + + vaf.fmt = fmt; + vaf.va = &args; + + pr_err("filesystem error: %pV", &vaf); + va_end(args); - printk("HPFS: filesystem error: %s", err_buf); if (!hpfs_sb(s)->sb_was_error) { if (hpfs_sb(s)->sb_err == 2) { printk("; crashing the system because you wanted it\n"); From 27dbfee9cffffa812e56f8a1a2f84f91d1d9ad63 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Thu, 9 Jul 2015 11:20:01 -0700 Subject: [PATCH 125/359] Fix firmware loader uevent buffer NULL pointer dereference commit 6f957724b94cb19f5c1c97efd01dd4df8ced323c upstream. The firmware class uevent function accessed the "fw_priv->buf" buffer without the proper locking and testing for NULL. This is an old bug (looks like it goes back to 2012 and commit 1244691c73b2: "firmware loader: introduce firmware_buf"), but for some reason it's triggering only now in 4.2-rc1. Shuah Khan is trying to bisect what it is that causes this to trigger more easily, but in the meantime let's just fix the bug since others are hitting it too (at least Ingo reports having seen it as well). Reported-and-tested-by: Shuah Khan Acked-by: Ming Lei Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- drivers/base/firmware_class.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 00a5656765835d..8e08fab0ed2e0f 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c @@ -513,10 +513,8 @@ static void fw_dev_release(struct device *dev) module_put(THIS_MODULE); } -static int firmware_uevent(struct device *dev, struct kobj_uevent_env *env) +static int do_firmware_uevent(struct firmware_priv *fw_priv, struct kobj_uevent_env *env) { - struct firmware_priv *fw_priv = to_firmware_priv(dev); - if (add_uevent_var(env, "FIRMWARE=%s", fw_priv->buf->fw_id)) return -ENOMEM; if (add_uevent_var(env, "TIMEOUT=%i", loading_timeout)) @@ -527,6 +525,18 @@ static int firmware_uevent(struct device *dev, struct kobj_uevent_env *env) return 0; } +static int firmware_uevent(struct device *dev, struct kobj_uevent_env *env) +{ + struct firmware_priv *fw_priv = to_firmware_priv(dev); + int err = 0; + + mutex_lock(&fw_lock); + if (fw_priv->buf) + err = do_firmware_uevent(fw_priv, env); + mutex_unlock(&fw_lock); + return err; +} + static struct class firmware_class = { .name = "firmware", .class_attrs = firmware_class_attrs, From 40ce7fb598a3e1d56e333a770bf178e32b80cd37 Mon Sep 17 00:00:00 2001 From: Chad Dupuis Date: Thu, 25 Sep 2014 05:17:01 -0400 Subject: [PATCH 126/359] qla2xxx: Mark port lost when we receive an RSCN for it. commit ef86cb2059a14b4024c7320999ee58e938873032 upstream. Signed-off-by: Chad Dupuis Signed-off-by: Saurav Kashyap Signed-off-by: Christoph Hellwig Cc: Himanshu Madhani Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/qla2xxx/qla_isr.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index d2a4c75e5b8fbc..813e9d8ba351ea 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -523,8 +523,9 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb) struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; struct device_reg_24xx __iomem *reg24 = &ha->iobase->isp24; struct device_reg_82xx __iomem *reg82 = &ha->iobase->isp82; - uint32_t rscn_entry, host_pid; + uint32_t rscn_entry, host_pid, tmp_pid; unsigned long flags; + fc_port_t *fcport = NULL; /* Setup to process RIO completion. */ handle_cnt = 0; @@ -918,6 +919,20 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb) if (qla2x00_is_a_vp_did(vha, rscn_entry)) break; + /* + * Search for the rport related to this RSCN entry and mark it + * as lost. + */ + list_for_each_entry(fcport, &vha->vp_fcports, list) { + if (atomic_read(&fcport->state) != FCS_ONLINE) + continue; + tmp_pid = fcport->d_id.b24; + if (fcport->d_id.b24 == rscn_entry) { + qla2x00_mark_device_lost(vha, fcport, 0, 0); + break; + } + } + atomic_set(&vha->loop_down_timer, 0); vha->flags.management_server_logged_in = 0; From 79af5d9f9b3d8180b75e0cc13fa331603342a6f1 Mon Sep 17 00:00:00 2001 From: Nicholas Mc Guire Date: Thu, 7 May 2015 14:47:50 +0200 Subject: [PATCH 127/359] MIPS: KVM: Do not sign extend on unsigned MMIO load commit ed9244e6c534612d2b5ae47feab2f55a0d4b4ced upstream. Fix possible unintended sign extension in unsigned MMIO loads by casting to uint16_t in the case of mmio_needed != 2. Signed-off-by: Nicholas Mc Guire Reviewed-by: James Hogan Tested-by: James Hogan Cc: Gleb Natapov Cc: Paolo Bonzini Cc: kvm@vger.kernel.org Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/9985/ Signed-off-by: Ralf Baechle Signed-off-by: James Hogan Signed-off-by: Greg Kroah-Hartman --- arch/mips/kvm/kvm_mips_emul.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/kvm/kvm_mips_emul.c b/arch/mips/kvm/kvm_mips_emul.c index e75ef8219cafb1..c76f297b714976 100644 --- a/arch/mips/kvm/kvm_mips_emul.c +++ b/arch/mips/kvm/kvm_mips_emul.c @@ -1626,7 +1626,7 @@ kvm_mips_complete_mmio_load(struct kvm_vcpu *vcpu, struct kvm_run *run) if (vcpu->mmio_needed == 2) *gpr = *(int16_t *) run->mmio.data; else - *gpr = *(int16_t *) run->mmio.data; + *gpr = *(uint16_t *)run->mmio.data; break; case 1: From b7c42895e7855fd80fe006d7573e08e536b4b622 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 3 Aug 2015 09:32:37 -0700 Subject: [PATCH 128/359] Linux 3.10.85 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f7b10bb56737a3..11a7e7bc31f26a 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 10 -SUBLEVEL = 84 +SUBLEVEL = 85 EXTRAVERSION = NAME = TOSSUG Baby Fish From efcbc94afe6dd0f8a4b112a0f3385cdc89ea58ba Mon Sep 17 00:00:00 2001 From: "Kirill A. Shutemov" Date: Mon, 6 Jul 2015 23:18:37 +0300 Subject: [PATCH 129/359] mm: avoid setting up anonymous pages into file mapping commit 6b7339f4c31ad69c8e9c0b2859276e22cf72176d upstream. Reading page fault handler code I've noticed that under right circumstances kernel would map anonymous pages into file mappings: if the VMA doesn't have vm_ops->fault() and the VMA wasn't fully populated on ->mmap(), kernel would handle page fault to not populated pte with do_anonymous_page(). Let's change page fault handler to use do_anonymous_page() only on anonymous VMA (->vm_ops == NULL) and make sure that the VMA is not shared. For file mappings without vm_ops->fault() or shred VMA without vm_ops, page fault on pte_none() entry would lead to SIGBUS. Signed-off-by: Kirill A. Shutemov Acked-by: Oleg Nesterov Cc: Andrew Morton Cc: Willy Tarreau Cc: stable@vger.kernel.org Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- mm/memory.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index e6b1da3a8924c5..30bf9cce8c2b04 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3230,6 +3230,10 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma, pte_unmap(page_table); + /* File mapping without ->vm_ops ? */ + if (vma->vm_flags & VM_SHARED) + return VM_FAULT_SIGBUS; + /* Check if we need to add a guard page to the stack */ if (check_stack_guard_page(vma, address) < 0) return VM_FAULT_SIGSEGV; @@ -3495,6 +3499,9 @@ static int do_linear_fault(struct mm_struct *mm, struct vm_area_struct *vma, - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff; pte_unmap(page_table); + /* The VMA was not fully populated on mmap() or missing VM_DONTEXPAND */ + if (!vma->vm_ops->fault) + return VM_FAULT_SIGBUS; return __do_fault(mm, vma, address, pmd, pgoff, flags, orig_pte); } @@ -3706,11 +3713,9 @@ int handle_pte_fault(struct mm_struct *mm, entry = *pte; if (!pte_present(entry)) { if (pte_none(entry)) { - if (vma->vm_ops) { - if (likely(vma->vm_ops->fault)) - return do_linear_fault(mm, vma, address, + if (vma->vm_ops) + return do_linear_fault(mm, vma, address, pte, pmd, flags, entry); - } return do_anonymous_page(mm, vma, address, pte, pmd, flags); } From 518309e081d6328daf443531c3a70cbb10277006 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 8 Jul 2015 02:42:38 +0100 Subject: [PATCH 130/359] freeing unlinked file indefinitely delayed commit 75a6f82a0d10ef8f13cd8fe7212911a0252ab99e upstream. Normally opening a file, unlinking it and then closing will have the inode freed upon close() (provided that it's not otherwise busy and has no remaining links, of course). However, there's one case where that does *not* happen. Namely, if you open it by fhandle with cold dcache, then unlink() and close(). In normal case you get d_delete() in unlink(2) notice that dentry is busy and unhash it; on the final dput() it will be forcibly evicted from dcache, triggering iput() and inode removal. In this case, though, we end up with *two* dentries - disconnected (created by open-by-fhandle) and regular one (used by unlink()). The latter will have its reference to inode dropped just fine, but the former will not - it's considered hashed (it is on the ->s_anon list), so it will stay around until the memory pressure will finally do it in. As the result, we have the final iput() delayed indefinitely. It's trivial to reproduce - void flush_dcache(void) { system("mount -o remount,rw /"); } static char buf[20 * 1024 * 1024]; main() { int fd; union { struct file_handle f; char buf[MAX_HANDLE_SZ]; } x; int m; x.f.handle_bytes = sizeof(x); chdir("/root"); mkdir("foo", 0700); fd = open("foo/bar", O_CREAT | O_RDWR, 0600); close(fd); name_to_handle_at(AT_FDCWD, "foo/bar", &x.f, &m, 0); flush_dcache(); fd = open_by_handle_at(AT_FDCWD, &x.f, O_RDWR); unlink("foo/bar"); write(fd, buf, sizeof(buf)); system("df ."); /* 20Mb eaten */ close(fd); system("df ."); /* should've freed those 20Mb */ flush_dcache(); system("df ."); /* should be the same as #2 */ } will spit out something like Filesystem 1K-blocks Used Available Use% Mounted on /dev/root 322023 303843 1131 100% / Filesystem 1K-blocks Used Available Use% Mounted on /dev/root 322023 303843 1131 100% / Filesystem 1K-blocks Used Available Use% Mounted on /dev/root 322023 283282 21692 93% / - inode gets freed only when dentry is finally evicted (here we trigger than by remount; normally it would've happened in response to memory pressure hell knows when). Acked-by: J. Bruce Fields Signed-off-by: Al Viro Signed-off-by: Greg Kroah-Hartman --- fs/dcache.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/dcache.c b/fs/dcache.c index 38c4a302fab426..90be2809e15aeb 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -520,6 +520,9 @@ void dput(struct dentry *dentry) return; } + if (unlikely(dentry->d_flags & DCACHE_DISCONNECTED)) + goto kill_it; + if (dentry->d_flags & DCACHE_OP_DELETE) { if (dentry->d_op->d_delete(dentry)) goto kill_it; From 3a893ef1923c6f93ca477ff583efe893ff98a109 Mon Sep 17 00:00:00 2001 From: Martin Schwidefsky Date: Mon, 6 Jul 2015 17:58:19 +0200 Subject: [PATCH 131/359] s390/sclp: clear upper register halves in _sclp_print_early commit f9c87a6f46d508eae0d9ae640be98d50f237f827 upstream. If the kernel is compiled with gcc 5.1 and the XZ compression option the decompress_kernel function calls _sclp_print_early in 64-bit mode while the content of the upper register half of %r6 is non-zero. This causes a specification exception on the servc instruction in _sclp_servc. The _sclp_print_early function saves and restores the upper registers halves but it fails to clear them for the 31-bit code of the mini sclp driver. Signed-off-by: Martin Schwidefsky Signed-off-by: Greg Kroah-Hartman --- arch/s390/kernel/sclp.S | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/s390/kernel/sclp.S b/arch/s390/kernel/sclp.S index 29bd7bec41768c..1ecd47b5e25078 100644 --- a/arch/s390/kernel/sclp.S +++ b/arch/s390/kernel/sclp.S @@ -276,6 +276,8 @@ ENTRY(_sclp_print_early) jno .Lesa2 ahi %r15,-80 stmh %r6,%r15,96(%r15) # store upper register halves + basr %r13,0 + lmh %r0,%r15,.Lzeroes-.(%r13) # clear upper register halves .Lesa2: #endif lr %r10,%r2 # save string pointer @@ -299,6 +301,8 @@ ENTRY(_sclp_print_early) #endif lm %r6,%r15,120(%r15) # restore registers br %r14 +.Lzeroes: + .fill 64,4,0 .LwritedataS4: .long 0x00760005 # SCLP command for write data From 508a750fe6cc950bad1cca07f1637ce4815b5420 Mon Sep 17 00:00:00 2001 From: Alexey Brodkin Date: Mon, 13 Jul 2015 10:25:17 +0300 Subject: [PATCH 132/359] ARC: make sure instruction_pointer() returns unsigned value commit f51e2f1911122879eefefa4c592dea8bf794b39c upstream. Currently instruction_pointer() returns pt_regs->ret and so return value is of type "long", which implicitly stands for "signed long". While that's perfectly fine when dealing with 32-bit values if return value of instruction_pointer() gets assigned to 64-bit variable sign extension may happen. And at least in one real use-case it happens already. In perf_prepare_sample() return value of perf_instruction_pointer() (which is an alias to instruction_pointer() in case of ARC) is assigned to (struct perf_sample_data)->ip (which type is "u64"). And what we see if instuction pointer points to user-space application that in case of ARC lays below 0x8000_0000 "ip" gets set properly with leading 32 zeros. But if instruction pointer points to kernel address space that starts from 0x8000_0000 then "ip" is set with 32 leadig "f"-s. I.e. id instruction_pointer() returns 0x8100_0000, "ip" will be assigned with 0xffff_ffff__8100_0000. Which is obviously wrong. In particular that issuse broke output of perf, because perf was unable to associate addresses like 0xffff_ffff__8100_0000 with anything from /proc/kallsyms. That's what we used to see: ----------->8---------- 6.27% ls [unknown] [k] 0xffffffff8046c5cc 2.96% ls libuClibc-0.9.34-git.so [.] memcpy 2.25% ls libuClibc-0.9.34-git.so [.] memset 1.66% ls [unknown] [k] 0xffffffff80666536 1.54% ls libuClibc-0.9.34-git.so [.] 0x000224d6 1.18% ls libuClibc-0.9.34-git.so [.] 0x00022472 ----------->8---------- With that change perf output looks much better now: ----------->8---------- 8.21% ls [kernel.kallsyms] [k] memset 3.52% ls libuClibc-0.9.34-git.so [.] memcpy 2.11% ls libuClibc-0.9.34-git.so [.] malloc 1.88% ls libuClibc-0.9.34-git.so [.] memset 1.64% ls [kernel.kallsyms] [k] _raw_spin_unlock_irqrestore 1.41% ls [kernel.kallsyms] [k] __d_lookup_rcu ----------->8---------- Signed-off-by: Alexey Brodkin Cc: arc-linux-dev@synopsys.com Cc: linux-kernel@vger.kernel.org Signed-off-by: Vineet Gupta Signed-off-by: Greg Kroah-Hartman --- arch/arc/include/asm/ptrace.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arc/include/asm/ptrace.h b/arch/arc/include/asm/ptrace.h index 2046a89a57cf01..78485493639a48 100644 --- a/arch/arc/include/asm/ptrace.h +++ b/arch/arc/include/asm/ptrace.h @@ -83,7 +83,7 @@ struct callee_regs { long r13; }; -#define instruction_pointer(regs) ((regs)->ret) +#define instruction_pointer(regs) (unsigned long)((regs)->ret) #define profile_pc(regs) instruction_pointer(regs) /* return 1 if user mode or 0 if kernel mode */ From dcc2305a489922a4fff7072bc811492f0fa5b2ed Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 16 Jul 2015 14:10:17 +0200 Subject: [PATCH 133/359] genirq: Prevent resend to interrupts marked IRQ_NESTED_THREAD MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 75a06189fc508a2acf470b0b12710362ffb2c4b1 upstream. The resend mechanism happily calls the interrupt handler of interrupts which are marked IRQ_NESTED_THREAD from softirq context. This can result in crashes because the interrupt handler is not the proper way to invoke the device handlers. They must be invoked via handle_nested_irq. Prevent the resend even if the interrupt has no valid parent irq set. Its better to have a lost interrupt than a crashing machine. Reported-by: Uwe Kleine-König Signed-off-by: Thomas Gleixner Signed-off-by: Greg Kroah-Hartman --- kernel/irq/resend.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/kernel/irq/resend.c b/kernel/irq/resend.c index 9065107f083e90..7a5237a1bce5b5 100644 --- a/kernel/irq/resend.c +++ b/kernel/irq/resend.c @@ -75,13 +75,21 @@ void check_irq_resend(struct irq_desc *desc, unsigned int irq) !desc->irq_data.chip->irq_retrigger(&desc->irq_data)) { #ifdef CONFIG_HARDIRQS_SW_RESEND /* - * If the interrupt has a parent irq and runs - * in the thread context of the parent irq, - * retrigger the parent. + * If the interrupt is running in the thread + * context of the parent irq we need to be + * careful, because we cannot trigger it + * directly. */ - if (desc->parent_irq && - irq_settings_is_nested_thread(desc)) + if (irq_settings_is_nested_thread(desc)) { + /* + * If the parent_irq is valid, we + * retrigger the parent, otherwise we + * do nothing. + */ + if (!desc->parent_irq) + return; irq = desc->parent_irq; + } /* Set it pending and activate the softirq: */ set_bit(irq, irqs_resend); tasklet_schedule(&resend_tasklet); From a9049040dc3cea7f1a23cb57e454ebde4310089f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominic=20Sacr=C3=A9?= Date: Tue, 30 Jun 2015 17:41:33 +0200 Subject: [PATCH 134/359] ALSA: usb-audio: Add MIDI support for Steinberg MI2/MI4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 0689a86ae814f39af94a9736a0a5426dd82eb107 upstream. The Steinberg MI2 and MI4 interfaces are compatible with the USB class audio spec, but the MIDI part of the devices is reported as a vendor specific interface. This patch adds entries to quirks-table.h to recognize the MIDI endpoints. Audio functionality was already working and is unaffected by this change. Signed-off-by: Dominic Sacré Signed-off-by: Albert Huitsing Acked-by: Clemens Ladisch Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/usb/quirks-table.h | 68 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h index d5bed1d2571384..45d586b6e8b533 100644 --- a/sound/usb/quirks-table.h +++ b/sound/usb/quirks-table.h @@ -2773,6 +2773,74 @@ YAMAHA_DEVICE(0x7010, "UB99"), } }, +/* Steinberg devices */ +{ + /* Steinberg MI2 */ + USB_DEVICE_VENDOR_SPEC(0x0a4e, 0x2040), + .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { + .ifnum = QUIRK_ANY_INTERFACE, + .type = QUIRK_COMPOSITE, + .data = & (const struct snd_usb_audio_quirk[]) { + { + .ifnum = 0, + .type = QUIRK_AUDIO_STANDARD_INTERFACE + }, + { + .ifnum = 1, + .type = QUIRK_AUDIO_STANDARD_INTERFACE + }, + { + .ifnum = 2, + .type = QUIRK_AUDIO_STANDARD_INTERFACE + }, + { + .ifnum = 3, + .type = QUIRK_MIDI_FIXED_ENDPOINT, + .data = &(const struct snd_usb_midi_endpoint_info) { + .out_cables = 0x0001, + .in_cables = 0x0001 + } + }, + { + .ifnum = -1 + } + } + } +}, +{ + /* Steinberg MI4 */ + USB_DEVICE_VENDOR_SPEC(0x0a4e, 0x4040), + .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { + .ifnum = QUIRK_ANY_INTERFACE, + .type = QUIRK_COMPOSITE, + .data = & (const struct snd_usb_audio_quirk[]) { + { + .ifnum = 0, + .type = QUIRK_AUDIO_STANDARD_INTERFACE + }, + { + .ifnum = 1, + .type = QUIRK_AUDIO_STANDARD_INTERFACE + }, + { + .ifnum = 2, + .type = QUIRK_AUDIO_STANDARD_INTERFACE + }, + { + .ifnum = 3, + .type = QUIRK_MIDI_FIXED_ENDPOINT, + .data = &(const struct snd_usb_midi_endpoint_info) { + .out_cables = 0x0001, + .in_cables = 0x0001 + } + }, + { + .ifnum = -1 + } + } + } +}, + /* TerraTec devices */ { USB_DEVICE_VENDOR_SPEC(0x0ccd, 0x0012), From 025b8126c559fcd2f19e969a896e6045aa778e54 Mon Sep 17 00:00:00 2001 From: Yao-Wen Mao Date: Wed, 29 Jul 2015 15:13:54 +0800 Subject: [PATCH 135/359] ALSA: usb-audio: add dB range mapping for some devices commit 2d1cb7f658fb9c3ba8f9dab8aca297d4dfdec835 upstream. Add the correct dB ranges of Bose Companion 5 and Drangonfly DAC 1.2. Signed-off-by: Yao-Wen Mao Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/usb/mixer_maps.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/sound/usb/mixer_maps.c b/sound/usb/mixer_maps.c index d06fbd9f7cbef3..2d17f40fb16d71 100644 --- a/sound/usb/mixer_maps.c +++ b/sound/usb/mixer_maps.c @@ -330,6 +330,20 @@ static const struct usbmix_name_map scms_usb3318_map[] = { { 0 } }; +/* Bose companion 5, the dB conversion factor is 16 instead of 256 */ +static struct usbmix_dB_map bose_companion5_dB = {-5006, -6}; +static struct usbmix_name_map bose_companion5_map[] = { + { 3, NULL, .dB = &bose_companion5_dB }, + { 0 } /* terminator */ +}; + +/* Dragonfly DAC 1.2, the dB conversion factor is 1 instead of 256 */ +static struct usbmix_dB_map dragonfly_1_2_dB = {0, 5000}; +static struct usbmix_name_map dragonfly_1_2_map[] = { + { 7, NULL, .dB = &dragonfly_1_2_dB }, + { 0 } /* terminator */ +}; + /* * Control map entries */ @@ -432,6 +446,16 @@ static struct usbmix_ctl_map usbmix_ctl_maps[] = { .id = USB_ID(0x25c4, 0x0003), .map = scms_usb3318_map, }, + { + /* Bose Companion 5 */ + .id = USB_ID(0x05a7, 0x1020), + .map = bose_companion5_map, + }, + { + /* Dragonfly DAC 1.2 */ + .id = USB_ID(0x21b4, 0x0081), + .map = dragonfly_1_2_map, + }, { 0 } /* terminator */ }; From c97464e307a0810f9a1f464c6a2f6287073cce59 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 30 Jul 2015 22:30:29 +0200 Subject: [PATCH 136/359] ALSA: hda - Fix MacBook Pro 5,2 quirk commit 649ccd08534ee26deb2e5b08509800d0e95167f5 upstream. MacBook Pro 5,2 with ALC889 codec had already a fixup entry, but this seems not working correctly, a fix for pin NID 0x15 is needed in addition. It's equivalent with the fixup for MacBook Air 1,1, so use this instead. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=102131 Reported-and-tested-by: Jeffery Miller Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/pci/hda/patch_realtek.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index a82d6576fe0f3d..d30252e7f3e816 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -2204,7 +2204,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = { SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF), SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF), SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF), - SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_IMAC91_VREF), + SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF), SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD), SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD), From bdedc624e9864fb39ddd2f0d99925a8746ef91db Mon Sep 17 00:00:00 2001 From: "Seymour, Shane M" Date: Thu, 2 Jul 2015 12:01:10 +0000 Subject: [PATCH 137/359] st: null pointer dereference panic caused by use after kref_put by st_open MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit e7ac6c6666bec0a354758a1298d3231e4a635362 upstream. Two SLES11 SP3 servers encountered similar crashes simultaneously following some kind of SAN/tape target issue: ... qla2xxx [0000:81:00.0]-801c:3: Abort command issued nexus=3:0:2 -- 1 2002. qla2xxx [0000:81:00.0]-801c:3: Abort command issued nexus=3:0:2 -- 1 2002. qla2xxx [0000:81:00.0]-8009:3: DEVICE RESET ISSUED nexus=3:0:2 cmd=ffff882f89c2c7c0. qla2xxx [0000:81:00.0]-800c:3: do_reset failed for cmd=ffff882f89c2c7c0. qla2xxx [0000:81:00.0]-800f:3: DEVICE RESET FAILED: Task management failed nexus=3:0:2 cmd=ffff882f89c2c7c0. qla2xxx [0000:81:00.0]-8009:3: TARGET RESET ISSUED nexus=3:0:2 cmd=ffff882f89c2c7c0. qla2xxx [0000:81:00.0]-800c:3: do_reset failed for cmd=ffff882f89c2c7c0. qla2xxx [0000:81:00.0]-800f:3: TARGET RESET FAILED: Task management failed nexus=3:0:2 cmd=ffff882f89c2c7c0. qla2xxx [0000:81:00.0]-8012:3: BUS RESET ISSUED nexus=3:0:2. qla2xxx [0000:81:00.0]-802b:3: BUS RESET SUCCEEDED nexus=3:0:2. qla2xxx [0000:81:00.0]-505f:3: Link is operational (8 Gbps). qla2xxx [0000:81:00.0]-8018:3: ADAPTER RESET ISSUED nexus=3:0:2. qla2xxx [0000:81:00.0]-00af:3: Performing ISP error recovery - ha=ffff88bf04d18000. rport-3:0-0: blocked FC remote port time out: removing target and saving binding qla2xxx [0000:81:00.0]-505f:3: Link is operational (8 Gbps). qla2xxx [0000:81:00.0]-8017:3: ADAPTER RESET SUCCEEDED nexus=3:0:2. rport-2:0-0: blocked FC remote port time out: removing target and saving binding sg_rq_end_io: device detached BUG: unable to handle kernel NULL pointer dereference at 00000000000002a8 IP: [] __pm_runtime_idle+0x28/0x90 PGD 7e6586f067 PUD 7e5af06067 PMD 0 [1739975.390354] Oops: 0002 [#1] SMP CPU 0 ... Supported: No, Proprietary modules are loaded [1739975.390463] Pid: 27965, comm: ABCD Tainted: PF X 3.0.101-0.29-default #1 HP ProLiant DL580 Gen8 RIP: 0010:[] [] __pm_runtime_idle+0x28/0x90 RSP: 0018:ffff8839dc1e7c68 EFLAGS: 00010202 RAX: 0000000000000000 RBX: ffff883f0592fc00 RCX: 0000000000000090 RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000138 RBP: 0000000000000138 R08: 0000000000000010 R09: ffffffff81bd39d0 R10: 00000000000009c0 R11: ffffffff81025790 R12: 0000000000000001 R13: ffff883022212b80 R14: 0000000000000004 R15: ffff883022212b80 FS: 00007f8e54560720(0000) GS:ffff88407f800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b CR2: 00000000000002a8 CR3: 0000007e6ced6000 CR4: 00000000001407f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Process ABCD (pid: 27965, threadinfo ffff8839dc1e6000, task ffff883592e0c640) Stack: ffff883f0592fc00 00000000fffffffa 0000000000000001 ffff883022212b80 ffff883eff772400 ffffffffa03fa309 0000000000000000 0000000000000000 ffffffffa04003a0 ffff883f063196c0 ffff887f0379a930 ffffffff8115ea1e Call Trace: [] st_open+0x129/0x240 [st] [] chrdev_open+0x13e/0x200 [] __dentry_open+0x198/0x310 [] do_last+0x1f4/0x800 [] path_openat+0xd9/0x420 [] do_filp_open+0x4c/0xc0 [] do_sys_open+0x17f/0x250 [] system_call_fastpath+0x16/0x1b [<00007f8e4f617fd0>] 0x7f8e4f617fcf Code: eb d3 90 48 83 ec 28 40 f6 c6 04 48 89 6c 24 08 4c 89 74 24 20 48 89 fd 48 89 1c 24 4c 89 64 24 10 41 89 f6 4c 89 6c 24 18 74 11 ff 8f 70 01 00 00 0f 94 c0 45 31 ed 84 c0 74 2b 4c 8d a5 a0 RIP [] __pm_runtime_idle+0x28/0x90 RSP CR2: 00000000000002a8 Analysis reveals the cause of the crash to be due to STp->device being NULL. The pointer was NULLed via scsi_tape_put(STp) when it calls scsi_tape_release(). In st_open() we jump to err_out after scsi_block_when_processing_errors() completes and returns the device as offline (sdev_state was SDEV_DEL): 1180 /* Open the device. Needs to take the BKL only because of incrementing the SCSI host 1181 module count. */ 1182 static int st_open(struct inode *inode, struct file *filp) 1183 { 1184 int i, retval = (-EIO); 1185 int resumed = 0; 1186 struct scsi_tape *STp; 1187 struct st_partstat *STps; 1188 int dev = TAPE_NR(inode); 1189 char *name; ... 1217 if (scsi_autopm_get_device(STp->device) < 0) { 1218 retval = -EIO; 1219 goto err_out; 1220 } 1221 resumed = 1; 1222 if (!scsi_block_when_processing_errors(STp->device)) { 1223 retval = (-ENXIO); 1224 goto err_out; 1225 } ... 1264 err_out: 1265 normalize_buffer(STp->buffer); 1266 spin_lock(&st_use_lock); 1267 STp->in_use = 0; 1268 spin_unlock(&st_use_lock); 1269 scsi_tape_put(STp); <-- STp->device = 0 after this 1270 if (resumed) 1271 scsi_autopm_put_device(STp->device); 1272 return retval; The ref count for the struct scsi_tape had already been reduced to 1 when the .remove method of the st module had been called. The kref_put() in scsi_tape_put() caused scsi_tape_release() to be called: 0266 static void scsi_tape_put(struct scsi_tape *STp) 0267 { 0268 struct scsi_device *sdev = STp->device; 0269 0270 mutex_lock(&st_ref_mutex); 0271 kref_put(&STp->kref, scsi_tape_release); <-- calls this 0272 scsi_device_put(sdev); 0273 mutex_unlock(&st_ref_mutex); 0274 } In scsi_tape_release() the struct scsi_device in the struct scsi_tape gets set to NULL: 4273 static void scsi_tape_release(struct kref *kref) 4274 { 4275 struct scsi_tape *tpnt = to_scsi_tape(kref); 4276 struct gendisk *disk = tpnt->disk; 4277 4278 tpnt->device = NULL; <<<---- where the dev is nulled 4279 4280 if (tpnt->buffer) { 4281 normalize_buffer(tpnt->buffer); 4282 kfree(tpnt->buffer->reserved_pages); 4283 kfree(tpnt->buffer); 4284 } 4285 4286 disk->private_data = NULL; 4287 put_disk(disk); 4288 kfree(tpnt); 4289 return; 4290 } Although the problem was reported on SLES11.3 the problem appears in linux-next as well. The crash is fixed by reordering the code so we no longer access the struct scsi_tape after the kref_put() is done on it in st_open(). Signed-off-by: Shane Seymour Signed-off-by: Darren Lavender Reviewed-by: Johannes Thumshirn Acked-by: Kai Mäkisara Signed-off-by: James Bottomley Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/st.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index 2a32036a9404be..fa9811200c9ddc 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c @@ -1262,9 +1262,9 @@ static int st_open(struct inode *inode, struct file *filp) spin_lock(&st_use_lock); STp->in_use = 0; spin_unlock(&st_use_lock); - scsi_tape_put(STp); if (resumed) scsi_autopm_put_device(STp->device); + scsi_tape_put(STp); return retval; } From b07016348b0bec192414ade9fb0e385fdc8c4a52 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 29 Jun 2015 19:41:49 +0100 Subject: [PATCH 138/359] mac80211: clear subdir_stations when removing debugfs commit 4479004e6409087d1b4986881dc98c6c15dffb28 upstream. If we don't do this, and we then fail to recreate the debugfs directory during a mode change, then we will fail later trying to add stations to this now bogus directory: BUG: unable to handle kernel NULL pointer dereference at 0000006c IP: [] mutex_lock+0x12/0x30 Call Trace: [] start_creating+0x44/0xc0 [] debugfs_create_dir+0x13/0xf0 [] ieee80211_sta_debugfs_add+0x6e/0x490 [mac80211] Signed-off-by: Tom Hughes Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- net/mac80211/debugfs_netdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c index 2d5b4f65c5194b..32bafdbdfd668b 100644 --- a/net/mac80211/debugfs_netdev.c +++ b/net/mac80211/debugfs_netdev.c @@ -697,6 +697,7 @@ void ieee80211_debugfs_remove_netdev(struct ieee80211_sub_if_data *sdata) debugfs_remove_recursive(sdata->vif.debugfs_dir); sdata->vif.debugfs_dir = NULL; + sdata->debugfs.subdir_stations = NULL; } void ieee80211_debugfs_rename_netdev(struct ieee80211_sub_if_data *sdata) From 04c6708522d382d8961214ceceed2052647f70c2 Mon Sep 17 00:00:00 2001 From: Joakim Tjernlund Date: Wed, 22 Jul 2015 16:44:26 +0200 Subject: [PATCH 139/359] mmc: sdhci-esdhc: Make 8BIT bus work commit 8e91125ff3f57f15c6568e2a6d32743b3f7815e4 upstream. Support for 8BIT bus with was added some time ago to sdhci-esdhc but then missed to remove the 8BIT from the reserved bit mask which made 8BIT non functional. Fixes: 66b50a00992d ("mmc: esdhc: Add support for 8-bit bus width and..") Signed-off-by: Joakim Tjernlund Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/host/sdhci-esdhc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-esdhc.h b/drivers/mmc/host/sdhci-esdhc.h index d25f9ab9a54da9..d33bb95224161f 100644 --- a/drivers/mmc/host/sdhci-esdhc.h +++ b/drivers/mmc/host/sdhci-esdhc.h @@ -40,7 +40,7 @@ #define ESDHC_DMA_SYSCTL 0x40c #define ESDHC_DMA_SNOOP 0x00000040 -#define ESDHC_HOST_CONTROL_RES 0x05 +#define ESDHC_HOST_CONTROL_RES 0x01 static inline void esdhc_set_clock(struct sdhci_host *host, unsigned int clock) { From 4713a3a3be8e81eddf2b4ab552e913b0a1cfaddf Mon Sep 17 00:00:00 2001 From: Jingju Hou Date: Thu, 23 Jul 2015 17:56:23 +0800 Subject: [PATCH 140/359] mmc: sdhci-pxav3: fix platform_data is not initialized commit 9cd76049f0d90ae241f5ad80e311489824527000 upstream. pdev->dev.platform_data is not initialized if match is true in function sdhci_pxav3_probe. Just local variable pdata is assigned the return value from function pxav3_get_mmc_pdata(). static int sdhci_pxav3_probe(struct platform_device *pdev) { struct sdhci_pxa_platdata *pdata = pdev->dev.platform_data; ... if (match) { ret = mmc_of_parse(host->mmc); if (ret) goto err_of_parse; sdhci_get_of_property(pdev); pdata = pxav3_get_mmc_pdata(dev); } ... } Signed-off-by: Jingju Hou Fixes: b650352dd3df("mmc: sdhci-pxa: Add device tree support") Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/host/sdhci-pxav3.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c index 4edb24bf56f8b9..c24fbc574cf123 100644 --- a/drivers/mmc/host/sdhci-pxav3.c +++ b/drivers/mmc/host/sdhci-pxav3.c @@ -255,6 +255,7 @@ static int sdhci_pxav3_probe(struct platform_device *pdev) mmc_of_parse(host->mmc); sdhci_get_of_property(pdev); pdata = pxav3_get_mmc_pdata(dev); + pdev->dev.platform_data = pdata; } else if (pdata) { /* on-chip device */ if (pdata->flags & PXA_FLAG_CARD_PERMANENT) From d83122855852f39491e9d418df397ea292b5a5be Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 24 Jul 2015 09:22:16 +1000 Subject: [PATCH 141/359] md/raid1: fix test for 'was read error from last working device'. commit 34cab6f42003cb06f48f86a86652984dec338ae9 upstream. When we get a read error from the last working device, we don't try to repair it, and don't fail the device. We simple report a read error to the caller. However the current test for 'is this the last working device' is wrong. When there is only one fully working device, it assumes that a non-faulty device is that device. However a spare which is rebuilding would be non-faulty but so not the only working device. So change the test from "!Faulty" to "In_sync". If ->degraded says there is only one fully working device and this device is in_sync, this must be the one. This bug has existed since we allowed read_balance to read from a recovering spare in v3.0 Reported-and-tested-by: Alexander Lyakas Fixes: 76073054c95b ("md/raid1: clean up read_balance.") Signed-off-by: NeilBrown Signed-off-by: Greg Kroah-Hartman --- drivers/md/raid1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 86ac4a4ccc01a4..fa58438b298a58 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -327,7 +327,7 @@ static void raid1_end_read_request(struct bio *bio, int error) spin_lock_irqsave(&conf->device_lock, flags); if (r1_bio->mddev->degraded == conf->raid_disks || (r1_bio->mddev->degraded == conf->raid_disks-1 && - !test_bit(Faulty, &conf->mirrors[mirror].rdev->flags))) + test_bit(In_sync, &conf->mirrors[mirror].rdev->flags))) uptodate = 1; spin_unlock_irqrestore(&conf->device_lock, flags); } From 9fbf45ec96502ed1f3d6498c142e7e18f0cec9b2 Mon Sep 17 00:00:00 2001 From: Chris Metcalf Date: Thu, 23 Jul 2015 14:11:09 -0400 Subject: [PATCH 142/359] tile: use free_bootmem_late() for initrd commit 3f81d2447b37ac697b3c600039f2c6b628c06e21 upstream. We were previously using free_bootmem() and just getting lucky that nothing too bad happened. Signed-off-by: Chris Metcalf Signed-off-by: Greg Kroah-Hartman --- arch/tile/kernel/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/tile/kernel/setup.c b/arch/tile/kernel/setup.c index 7a5aa1a7864e23..5ebe9367620160 100644 --- a/arch/tile/kernel/setup.c +++ b/arch/tile/kernel/setup.c @@ -1064,7 +1064,7 @@ static void __init load_hv_initrd(void) void __init free_initrd_mem(unsigned long begin, unsigned long end) { - free_bootmem(__pa(begin), end - begin); + free_bootmem_late(__pa(begin), end - begin); } #else From 15d6dd8f74b03fcdfbb66fa45f3c3dfdaccb3f75 Mon Sep 17 00:00:00 2001 From: Bernhard Bender Date: Thu, 23 Jul 2015 13:58:08 -0700 Subject: [PATCH 143/359] Input: usbtouchscreen - avoid unresponsive TSC-30 touch screen commit 968491709e5b1aaf429428814fff3d932fa90b60 upstream. This patch fixes a problem in the usbtouchscreen driver for DMC TSC-30 touch screen. Due to a missing delay between the RESET and SET_RATE commands, the touch screen may become unresponsive during system startup or driver loading. According to the DMC documentation, a delay is needed after the RESET command to allow the chip to complete its internal initialization. As this delay is not guaranteed, we had a system where the touch screen occasionally did not send any touch data. There was no other indication of the problem. The patch fixes the problem by adding a 150ms delay between the RESET and SET_RATE commands. Suggested-by: Jakob Mustafa Signed-off-by: Bernhard Bender Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- drivers/input/touchscreen/usbtouchscreen.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c index 5f87bed054674b..20aef5d5a24214 100644 --- a/drivers/input/touchscreen/usbtouchscreen.c +++ b/drivers/input/touchscreen/usbtouchscreen.c @@ -626,6 +626,9 @@ static int dmc_tsc10_init(struct usbtouch_usb *usbtouch) goto err_out; } + /* TSC-25 data sheet specifies a delay after the RESET command */ + msleep(150); + /* set coordinate output rate */ buf[0] = buf[1] = 0xFF; ret = usb_control_msg(dev, usb_rcvctrlpipe (dev, 0), From 74f412afcff28566ef240dc2a0f0af3994201fad Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Wed, 22 Jul 2015 18:05:53 -0400 Subject: [PATCH 144/359] blkcg: fix gendisk reference leak in blkg_conf_prep() commit 5f6c2d2b7dbb541c1e922538c49fa04c494ae3d7 upstream. When a blkcg configuration is targeted to a partition rather than a whole device, blkg_conf_prep fails with -EINVAL; unfortunately, it forgets to put the gendisk ref in that case. Fix it. Signed-off-by: Tejun Heo Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- block/blk-cgroup.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 1ff8e97f853ad7..8c4e81ac5e7543 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -720,8 +720,12 @@ int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol, return -EINVAL; disk = get_gendisk(MKDEV(major, minor), &part); - if (!disk || part) + if (!disk) return -EINVAL; + if (part) { + put_disk(disk); + return -EINVAL; + } rcu_read_lock(); spin_lock_irq(disk->queue->queue_lock); From 357dafbca56c66e47d3a76f036c47d8b756fe17b Mon Sep 17 00:00:00 2001 From: Lior Amsalem Date: Tue, 30 Jun 2015 16:09:49 +0200 Subject: [PATCH 145/359] ata: pmp: add quirk for Marvell 4140 SATA PMP commit 945b47441d83d2392ac9f984e0267ad521f24268 upstream. This commit adds the necessary quirk to make the Marvell 4140 SATA PMP work properly. This PMP doesn't like SRST on port number 4 (the host port) so this commit marks this port as not supporting SRST. Signed-off-by: Lior Amsalem Reviewed-by: Nadav Haklai Signed-off-by: Thomas Petazzoni Signed-off-by: Tejun Heo Signed-off-by: Greg Kroah-Hartman --- drivers/ata/libata-pmp.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/ata/libata-pmp.c b/drivers/ata/libata-pmp.c index 7ccc084bf1dfb8..85aa76116a305e 100644 --- a/drivers/ata/libata-pmp.c +++ b/drivers/ata/libata-pmp.c @@ -460,6 +460,13 @@ static void sata_pmp_quirks(struct ata_port *ap) ATA_LFLAG_NO_SRST | ATA_LFLAG_ASSUME_ATA; } + } else if (vendor == 0x11ab && devid == 0x4140) { + /* Marvell 4140 quirks */ + ata_for_each_link(link, ap, EDGE) { + /* port 4 is for SEMB device and it doesn't like SRST */ + if (link->pmp == 4) + link->flags |= ATA_LFLAG_DISABLED; + } } } From 76e0de0ab13401b76c5de2f48bd8d4edf809f9a5 Mon Sep 17 00:00:00 2001 From: Oliver Neukum Date: Mon, 6 Jul 2015 13:12:32 +0200 Subject: [PATCH 146/359] usb-storage: ignore ZTE MF 823 card reader in mode 0x1225 commit 5fb2c782f451a4fb9c19c076e2c442839faf0f76 upstream. This device automatically switches itself to another mode (0x1405) unless the specific access pattern of Windows is followed in its initial mode. That makes a dirty unmount of the internal storage devices inevitable if they are mounted. So the card reader of such a device should be ignored, lest an unclean removal become inevitable. This replaces an earlier patch that ignored all LUNs of this device. That patch was overly broad. Signed-off-by: Oliver Neukum Reviewed-by: Lars Melin Signed-off-by: Greg Kroah-Hartman --- drivers/usb/storage/unusual_devs.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index 821e1e2f70f65b..da380a99c6b818 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h @@ -2032,6 +2032,18 @@ UNUSUAL_DEV( 0x1908, 0x3335, 0x0200, 0x0200, USB_SC_DEVICE, USB_PR_DEVICE, NULL, US_FL_NO_READ_DISC_INFO ), +/* Reported by Oliver Neukum + * This device morphes spontaneously into another device if the access + * pattern of Windows isn't followed. Thus writable media would be dirty + * if the initial instance is used. So the device is limited to its + * virtual CD. + * And yes, the concept that BCD goes up to 9 is not heeded */ +UNUSUAL_DEV( 0x19d2, 0x1225, 0x0000, 0xffff, + "ZTE,Incorporated", + "ZTE WCDMA Technologies MSM", + USB_SC_DEVICE, USB_PR_DEVICE, NULL, + US_FL_SINGLE_LUN ), + /* Reported by Sven Geggus * This encrypted pen drive returns bogus data for the initial READ(10). */ From 7e74269b3bb7f226e25ef02b8e61ccd47ebbfff2 Mon Sep 17 00:00:00 2001 From: Brian Campbell Date: Tue, 21 Jul 2015 17:20:28 +0300 Subject: [PATCH 147/359] xhci: Calculate old endpoints correctly on device reset commit 326124a027abc9a7f43f72dc94f6f0f7a55b02b3 upstream. When resetting a device the number of active TTs may need to be corrected by xhci_update_tt_active_eps, but the number of old active endpoints supplied to it was always zero, so the number of TTs and the bandwidth reserved for them was not updated, and could rise unnecessarily. This affected systems using Intel's Patherpoint chipset, which rely on software bandwidth checking. For example, a Lenovo X230 would lose the ability to use ports on the docking station after enough suspend/resume cycles because the bandwidth calculated would rise with every cycle when a suitable device is attached. The correct number of active endpoints is calculated in the same way as in xhci_reserve_bandwidth. Signed-off-by: Brian Campbell Signed-off-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 10223f2b18d20d..1f901fc25590af 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -3356,6 +3356,9 @@ int xhci_discover_or_reset_device(struct usb_hcd *hcd, struct usb_device *udev) return -EINVAL; } + if (virt_dev->tt_info) + old_active_eps = virt_dev->tt_info->active_eps; + if (virt_dev->udev != udev) { /* If the virt_dev and the udev does not match, this virt_dev * may belong to another udev. From 99bcb88e61c399787ae48e3c0a85e024b3c8e668 Mon Sep 17 00:00:00 2001 From: Zhuang Jin Can Date: Tue, 21 Jul 2015 17:20:29 +0300 Subject: [PATCH 148/359] xhci: report U3 when link is in resume state commit 243292a2ad3dc365849b820a64868927168894ac upstream. xhci_hub_report_usb3_link_state() returns pls as U0 when the link is in resume state, and this causes usb core to think the link is in U0 while actually it's in resume state. When usb core transfers control request on the link, it fails with TRB error as the link is not ready for transfer. To fix the issue, report U3 when the link is in resume state, thus usb core knows the link it's not ready for transfer. Signed-off-by: Zhuang Jin Can Signed-off-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci-hub.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c index d939376c5deee4..ea853e3da9495b 100644 --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c @@ -468,10 +468,13 @@ static void xhci_hub_report_link_state(struct xhci_hcd *xhci, u32 pls = status_reg & PORT_PLS_MASK; /* resume state is a xHCI internal state. - * Do not report it to usb core. + * Do not report it to usb core, instead, pretend to be U3, + * thus usb core knows it's not ready for transfer */ - if (pls == XDEV_RESUME) + if (pls == XDEV_RESUME) { + *status |= USB_SS_PORT_LS_U3; return; + } /* When the CAS bit is set then warm reset * should be performed on port From 5eeb26f296b528d9e6f8738a3c87726925bf6237 Mon Sep 17 00:00:00 2001 From: Zhuang Jin Can Date: Tue, 21 Jul 2015 17:20:30 +0300 Subject: [PATCH 149/359] xhci: prevent bus_suspend if SS port resuming in phase 1 commit fac4271d1126c45ceaceb7f4a336317b771eb121 upstream. When the link is just waken, it's in Resume state, and driver sets PLS to U0. This refers to Phase 1. Phase 2 refers to when the link has completed the transition from Resume state to U0. With the fix of xhci: report U3 when link is in resume state, it also exposes an issue that usb3 roothub and controller can suspend right after phase 1, and this causes a hard hang in controller. To fix the issue, we need to prevent usb3 bus suspend if any port is resuming in phase 1. [merge separate USB2 and USB3 port resume checking to one -Mathias] Signed-off-by: Zhuang Jin Can Signed-off-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci-hub.c | 6 +++--- drivers/usb/host/xhci-ring.c | 3 +++ drivers/usb/host/xhci.h | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c index ea853e3da9495b..0f71c3a22507d1 100644 --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c @@ -1048,10 +1048,10 @@ int xhci_bus_suspend(struct usb_hcd *hcd) spin_lock_irqsave(&xhci->lock, flags); if (hcd->self.root_hub->do_remote_wakeup) { - if (bus_state->resuming_ports) { + if (bus_state->resuming_ports || /* USB2 */ + bus_state->port_remote_wakeup) { /* USB3 */ spin_unlock_irqrestore(&xhci->lock, flags); - xhci_dbg(xhci, "suspend failed because " - "a port is resuming\n"); + xhci_dbg(xhci, "suspend failed because a port is resuming\n"); return -EBUSY; } } diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 30533952b4a340..95fe1a432d2922 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -1669,6 +1669,9 @@ static void handle_port_status(struct xhci_hcd *xhci, usb_hcd_resume_root_hub(hcd); } + if (hcd->speed == HCD_USB3 && (temp & PORT_PLS_MASK) == XDEV_INACTIVE) + bus_state->port_remote_wakeup &= ~(1 << faked_port_index); + if ((temp & PORT_PLC) && (temp & PORT_PLS_MASK) == XDEV_RESUME) { xhci_dbg(xhci, "port resume event for port %d\n", port_id); diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index ed8de724b28593..deb2537ae75c4c 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -280,6 +280,7 @@ struct xhci_op_regs { #define XDEV_U0 (0x0 << 5) #define XDEV_U2 (0x2 << 5) #define XDEV_U3 (0x3 << 5) +#define XDEV_INACTIVE (0x6 << 5) #define XDEV_RESUME (0xf << 5) /* true: port has power (see HCC_PPC) */ #define PORT_POWER (1 << 9) From 6c3498f9eef9381a5d45d5b2ca23b455a36795c5 Mon Sep 17 00:00:00 2001 From: Wengang Wang Date: Mon, 6 Jul 2015 14:35:11 +0800 Subject: [PATCH 150/359] rds: rds_ib_device.refcount overflow commit 4fabb59449aa44a585b3603ffdadd4c5f4d0c033 upstream. Fixes: 3e0249f9c05c ("RDS/IB: add refcount tracking to struct rds_ib_device") There lacks a dropping on rds_ib_device.refcount in case rds_ib_alloc_fmr failed(mr pool running out). this lead to the refcount overflow. A complain in line 117(see following) is seen. From vmcore: s_ib_rdma_mr_pool_depleted is 2147485544 and rds_ibdev->refcount is -2147475448. That is the evidence the mr pool is used up. so rds_ib_alloc_fmr is very likely to return ERR_PTR(-EAGAIN). 115 void rds_ib_dev_put(struct rds_ib_device *rds_ibdev) 116 { 117 BUG_ON(atomic_read(&rds_ibdev->refcount) <= 0); 118 if (atomic_dec_and_test(&rds_ibdev->refcount)) 119 queue_work(rds_wq, &rds_ibdev->free_work); 120 } fix is to drop refcount when rds_ib_alloc_fmr failed. Signed-off-by: Wengang Wang Reviewed-by: Haggai Eran Signed-off-by: Doug Ledford Signed-off-by: Greg Kroah-Hartman --- net/rds/ib_rdma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/rds/ib_rdma.c b/net/rds/ib_rdma.c index e8fdb172adbb23..a985158d95d555 100644 --- a/net/rds/ib_rdma.c +++ b/net/rds/ib_rdma.c @@ -759,8 +759,10 @@ void *rds_ib_get_mr(struct scatterlist *sg, unsigned long nents, } ibmr = rds_ib_alloc_fmr(rds_ibdev); - if (IS_ERR(ibmr)) + if (IS_ERR(ibmr)) { + rds_ib_dev_put(rds_ibdev); return ibmr; + } ret = rds_ib_map_fmr(rds_ibdev, ibmr, sg, nents); if (ret == 0) From bde8e916ed7bfbb694792335043938e206636943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Fri, 17 Jul 2015 15:32:03 +0200 Subject: [PATCH 151/359] vhost: actually track log eventfd file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 7932c0bd7740f4cd2aa168d3ce0199e7af7d72d5 upstream. While reviewing vhost log code, I found out that log_file is never set. Note: I haven't tested the change (QEMU doesn't use LOG_FD yet). Signed-off-by: Marc-André Lureau Signed-off-by: Michael S. Tsirkin Signed-off-by: Greg Kroah-Hartman --- drivers/vhost/vhost.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 60aa5ad09a2fdb..3aabc652f1b945 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -855,6 +855,7 @@ long vhost_dev_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *argp) } if (eventfp != d->log_file) { filep = d->log_file; + d->log_file = eventfp; ctx = d->log_ctx; d->log_ctx = eventfp ? eventfd_ctx_fileget(eventfp) : NULL; From 8345c7414c155c06b7cf953820f94e0b3fa83a57 Mon Sep 17 00:00:00 2001 From: Nicholas Bellinger Date: Wed, 22 Jul 2015 00:24:09 -0700 Subject: [PATCH 152/359] iscsi-target: Fix use-after-free during TPG session shutdown commit 417c20a9bdd1e876384127cf096d8ae8b559066c upstream. This patch fixes a use-after-free bug in iscsit_release_sessions_for_tpg() where se_portal_group->session_lock was incorrectly released/re-acquired while walking the active se_portal_group->tpg_sess_list. The can result in a NULL pointer dereference when iscsit_close_session() shutdown happens in the normal path asynchronously to this code, causing a bogus dereference of an already freed list entry to occur. To address this bug, walk the session list checking for the same state as before, but move entries to a local list to avoid dropping the lock while walking the active list. As before, signal using iscsi_session->session_restatement=1 for those list entries to be released locally by iscsit_free_session() code. Reported-by: Sunilkumar Nadumuttlu Cc: Sunilkumar Nadumuttlu Signed-off-by: Nicholas Bellinger Signed-off-by: Greg Kroah-Hartman --- drivers/target/iscsi/iscsi_target.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index 3c293ad6ae7006..e91266974c0b61 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c @@ -4649,6 +4649,7 @@ int iscsit_release_sessions_for_tpg(struct iscsi_portal_group *tpg, int force) struct iscsi_session *sess; struct se_portal_group *se_tpg = &tpg->tpg_se_tpg; struct se_session *se_sess, *se_sess_tmp; + LIST_HEAD(free_list); int session_count = 0; spin_lock_bh(&se_tpg->session_lock); @@ -4670,14 +4671,17 @@ int iscsit_release_sessions_for_tpg(struct iscsi_portal_group *tpg, int force) } atomic_set(&sess->session_reinstatement, 1); spin_unlock(&sess->conn_lock); - spin_unlock_bh(&se_tpg->session_lock); - iscsit_free_session(sess); - spin_lock_bh(&se_tpg->session_lock); + list_move_tail(&se_sess->sess_list, &free_list); + } + spin_unlock_bh(&se_tpg->session_lock); + list_for_each_entry_safe(se_sess, se_sess_tmp, &free_list, sess_list) { + sess = (struct iscsi_session *)se_sess->fabric_sess_ptr; + + iscsit_free_session(sess); session_count++; } - spin_unlock_bh(&se_tpg->session_lock); pr_debug("Released %d iSCSI Session(s) from Target Portal" " Group: %hu\n", session_count, tpg->tpgt); From 92eba7ddb962d2c4236edd78bcc66263d934f2e0 Mon Sep 17 00:00:00 2001 From: Nicholas Bellinger Date: Thu, 23 Jul 2015 22:30:31 +0000 Subject: [PATCH 153/359] iscsi-target: Fix iser explicit logout TX kthread leak commit 007d038bdf95ccfe2491d0078be54040d110fd06 upstream. This patch fixes a regression introduced with the following commit in v4.0-rc1 code, where an explicit iser-target logout would result in ->tx_thread_active being incorrectly cleared by the logout post handler, and subsequent TX kthread leak: commit 88dcd2dab5c23b1c9cfc396246d8f476c872f0ca Author: Nicholas Bellinger Date: Thu Feb 26 22:19:15 2015 -0800 iscsi-target: Convert iscsi_thread_set usage to kthread.h To address this bug, change iscsit_logout_post_handler_closesession() and iscsit_logout_post_handler_samecid() to only cmpxchg() on ->tx_thread_active for traditional iscsi/tcp connections. This is required because iscsi/tcp connections are invoking logout post handler logic directly from TX kthread context, while iser connections are invoking logout post handler logic from a seperate workqueue context. Cc: Sagi Grimberg Signed-off-by: Nicholas Bellinger Signed-off-by: Greg Kroah-Hartman --- drivers/target/iscsi/iscsi_target.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index e91266974c0b61..efca110342cb05 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c @@ -4416,7 +4416,18 @@ static void iscsit_logout_post_handler_closesession( struct iscsi_conn *conn) { struct iscsi_session *sess = conn->sess; - int sleep = cmpxchg(&conn->tx_thread_active, true, false); + int sleep = 1; + /* + * Traditional iscsi/tcp will invoke this logic from TX thread + * context during session logout, so clear tx_thread_active and + * sleep if iscsit_close_connection() has not already occured. + * + * Since iser-target invokes this logic from it's own workqueue, + * always sleep waiting for RX/TX thread shutdown to complete + * within iscsit_close_connection(). + */ + if (conn->conn_transport->transport_type == ISCSI_TCP) + sleep = cmpxchg(&conn->tx_thread_active, true, false); atomic_set(&conn->conn_logout_remove, 0); complete(&conn->conn_logout_comp); @@ -4430,7 +4441,10 @@ static void iscsit_logout_post_handler_closesession( static void iscsit_logout_post_handler_samecid( struct iscsi_conn *conn) { - int sleep = cmpxchg(&conn->tx_thread_active, true, false); + int sleep = 1; + + if (conn->conn_transport->transport_type == ISCSI_TCP) + sleep = cmpxchg(&conn->tx_thread_active, true, false); atomic_set(&conn->conn_logout_remove, 0); complete(&conn->conn_logout_comp); From 8492fd437ef59a2a2ed2f312466c48f202458faf Mon Sep 17 00:00:00 2001 From: Fupan Li Date: Tue, 4 Aug 2015 09:51:21 +0800 Subject: [PATCH 154/359] efi: fix 32bit kernel boot failed problem using efi Commit 35d5134b7d5a ("x86/efi: Correct EFI boot stub use of code32_start") imported a bug, which will cause 32bit kernel boot failed using efi method. It should use the label's address instead of the value stored in the label to caculate the address of code32_start. Signed-off-by: Fupan Li Reviewed-by: Matt Fleming --- arch/x86/boot/compressed/head_32.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S index abb988a54c6933..3b28eff9b90b76 100644 --- a/arch/x86/boot/compressed/head_32.S +++ b/arch/x86/boot/compressed/head_32.S @@ -54,7 +54,7 @@ ENTRY(efi_pe_entry) call reloc reloc: popl %ecx - subl reloc, %ecx + subl $reloc, %ecx movl %ecx, BP_code32_start(%eax) sub $0x4, %esp From 78fb9f4236d9077fb343fb5a4e55fe27075e9a1d Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 10 Aug 2015 12:22:47 -0700 Subject: [PATCH 155/359] Linux 3.10.86 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 11a7e7bc31f26a..25ee724c908946 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 10 -SUBLEVEL = 85 +SUBLEVEL = 86 EXTRAVERSION = NAME = TOSSUG Baby Fish From 6025624e42dd86d4174ed5ccd122b86c100995d8 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Sun, 16 Mar 2014 21:00:25 +0100 Subject: [PATCH 156/359] ARM: realview: fix sparsemem build commit dd94d3558947756b102b1487911acd925224a38c upstream. Commit b713aa0b15 "ARM: fix asm/memory.h build error" broke some configurations on mach-realview with sparsemem enabled, which is missing a definition of PHYS_OFFSET: arch/arm/include/asm/memory.h:268:42: error: 'PHYS_OFFSET' undeclared (first use in this function) #define PHYS_PFN_OFFSET ((unsigned long)(PHYS_OFFSET >> PAGE_SHIFT)) arch/arm/include/asm/dma-mapping.h:104:9: note: in expansion of macro 'PHYS_PFN_OFFSET' return PHYS_PFN_OFFSET + dma_to_pfn(dev, *dev->dma_mask); An easy workaround is for realview to define PHYS_OFFSET itself, in the same way we define it for platforms that don't have a private __virt_to_phys function. Signed-off-by: Arnd Bergmann Cc: Russell King Cc: Linus Walleij Cc: Guenter Roeck Signed-off-by: Greg Kroah-Hartman --- arch/arm/mach-realview/include/mach/memory.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/mach-realview/include/mach/memory.h b/arch/arm/mach-realview/include/mach/memory.h index 2022e092f0cade..db09170e3832fc 100644 --- a/arch/arm/mach-realview/include/mach/memory.h +++ b/arch/arm/mach-realview/include/mach/memory.h @@ -56,6 +56,8 @@ #define PAGE_OFFSET1 (PAGE_OFFSET + 0x10000000) #define PAGE_OFFSET2 (PAGE_OFFSET + 0x30000000) +#define PHYS_OFFSET PLAT_PHYS_OFFSET + #define __phys_to_virt(phys) \ ((phys) >= 0x80000000 ? (phys) - 0x80000000 + PAGE_OFFSET2 : \ (phys) >= 0x20000000 ? (phys) - 0x20000000 + PAGE_OFFSET1 : \ From ff26891febc84e3e253b3f67bafd5cdf16f6a795 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 19 Jul 2015 00:38:41 +0200 Subject: [PATCH 157/359] MIPS: Fix sched_getaffinity with MT FPAFF enabled commit 1d62d737555e1378eb62a8bba26644f7d97139d2 upstream. p->thread.user_cpus_allowed is zero-initialized and is only filled on the first sched_setaffinity call. To avoid adding overhead in the task initialization codepath, simply OR the returned mask in sched_getaffinity with p->cpus_allowed. Signed-off-by: Felix Fietkau Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/10740/ Signed-off-by: Ralf Baechle Signed-off-by: Greg Kroah-Hartman --- arch/mips/kernel/mips-mt-fpaff.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/mips/kernel/mips-mt-fpaff.c b/arch/mips/kernel/mips-mt-fpaff.c index fd814e08c945da..0f3e030f232bb4 100644 --- a/arch/mips/kernel/mips-mt-fpaff.c +++ b/arch/mips/kernel/mips-mt-fpaff.c @@ -154,7 +154,7 @@ asmlinkage long mipsmt_sys_sched_getaffinity(pid_t pid, unsigned int len, unsigned long __user *user_mask_ptr) { unsigned int real_len; - cpumask_t mask; + cpumask_t allowed, mask; int retval; struct task_struct *p; @@ -173,7 +173,8 @@ asmlinkage long mipsmt_sys_sched_getaffinity(pid_t pid, unsigned int len, if (retval) goto out_unlock; - cpumask_and(&mask, &p->thread.user_cpus_allowed, cpu_possible_mask); + cpumask_or(&allowed, &p->thread.user_cpus_allowed, &p->cpus_allowed); + cpumask_and(&mask, &allowed, cpu_active_mask); out_unlock: read_unlock(&tasklist_lock); From c45e0a863527d466a3bc91d039471c0182f8fee1 Mon Sep 17 00:00:00 2001 From: David Daney Date: Mon, 3 Aug 2015 17:48:43 -0700 Subject: [PATCH 158/359] MIPS: Make set_pte() SMP safe. commit 46011e6ea39235e4aca656673c500eac81a07a17 upstream. On MIPS the GLOBAL bit of the PTE must have the same value in any aligned pair of PTEs. These pairs of PTEs are referred to as "buddies". In a SMP system is is possible for two CPUs to be calling set_pte() on adjacent PTEs at the same time. There is a race between setting the PTE and a different CPU setting the GLOBAL bit in its buddy PTE. This race can be observed when multiple CPUs are executing vmap()/vfree() at the same time. Make setting the buddy PTE's GLOBAL bit an atomic operation to close the race condition. The case of CONFIG_64BIT_PHYS_ADDR && CONFIG_CPU_MIPS32 is *not* handled. Signed-off-by: David Daney Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/10835/ Signed-off-by: Ralf Baechle Signed-off-by: Greg Kroah-Hartman --- arch/mips/include/asm/pgtable.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/arch/mips/include/asm/pgtable.h b/arch/mips/include/asm/pgtable.h index 8b8f6b39336350..e821de7cb14e95 100644 --- a/arch/mips/include/asm/pgtable.h +++ b/arch/mips/include/asm/pgtable.h @@ -150,8 +150,39 @@ static inline void set_pte(pte_t *ptep, pte_t pteval) * Make sure the buddy is global too (if it's !none, * it better already be global) */ +#ifdef CONFIG_SMP + /* + * For SMP, multiple CPUs can race, so we need to do + * this atomically. + */ +#ifdef CONFIG_64BIT +#define LL_INSN "lld" +#define SC_INSN "scd" +#else /* CONFIG_32BIT */ +#define LL_INSN "ll" +#define SC_INSN "sc" +#endif + unsigned long page_global = _PAGE_GLOBAL; + unsigned long tmp; + + __asm__ __volatile__ ( + " .set push\n" + " .set noreorder\n" + "1: " LL_INSN " %[tmp], %[buddy]\n" + " bnez %[tmp], 2f\n" + " or %[tmp], %[tmp], %[global]\n" + " " SC_INSN " %[tmp], %[buddy]\n" + " beqz %[tmp], 1b\n" + " nop\n" + "2:\n" + " .set pop" + : [buddy] "+m" (buddy->pte), + [tmp] "=&r" (tmp) + : [global] "r" (page_global)); +#else /* !CONFIG_SMP */ if (pte_none(*buddy)) pte_val(*buddy) = pte_val(*buddy) | _PAGE_GLOBAL; +#endif /* CONFIG_SMP */ } #endif } From 36db20aee5f89a3e23cca351841214d7d9aa4e8b Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Thu, 6 Aug 2015 15:46:42 -0700 Subject: [PATCH 159/359] fsnotify: fix oops in fsnotify_clear_marks_by_group_flags() commit 8f2f3eb59dff4ec538de55f2e0592fec85966aab upstream. fsnotify_clear_marks_by_group_flags() can race with fsnotify_destroy_marks() so that when fsnotify_destroy_mark_locked() drops mark_mutex, a mark from the list iterated by fsnotify_clear_marks_by_group_flags() can be freed and thus the next entry pointer we have cached may become stale and we dereference free memory. Fix the problem by first moving marks to free to a special private list and then always free the first entry in the special list. This method is safe even when entries from the list can disappear once we drop the lock. Signed-off-by: Jan Kara Reported-by: Ashish Sangwan Reviewed-by: Ashish Sangwan Cc: Lino Sanfilippo Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- fs/notify/mark.c | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/fs/notify/mark.c b/fs/notify/mark.c index fc6b49bf73600c..f08b3b729d3dec 100644 --- a/fs/notify/mark.c +++ b/fs/notify/mark.c @@ -299,16 +299,36 @@ void fsnotify_clear_marks_by_group_flags(struct fsnotify_group *group, unsigned int flags) { struct fsnotify_mark *lmark, *mark; + LIST_HEAD(to_free); + /* + * We have to be really careful here. Anytime we drop mark_mutex, e.g. + * fsnotify_clear_marks_by_inode() can come and free marks. Even in our + * to_free list so we have to use mark_mutex even when accessing that + * list. And freeing mark requires us to drop mark_mutex. So we can + * reliably free only the first mark in the list. That's why we first + * move marks to free to to_free list in one go and then free marks in + * to_free list one by one. + */ mutex_lock_nested(&group->mark_mutex, SINGLE_DEPTH_NESTING); list_for_each_entry_safe(mark, lmark, &group->marks_list, g_list) { - if (mark->flags & flags) { - fsnotify_get_mark(mark); - fsnotify_destroy_mark_locked(mark, group); - fsnotify_put_mark(mark); - } + if (mark->flags & flags) + list_move(&mark->g_list, &to_free); } mutex_unlock(&group->mark_mutex); + + while (1) { + mutex_lock_nested(&group->mark_mutex, SINGLE_DEPTH_NESTING); + if (list_empty(&to_free)) { + mutex_unlock(&group->mark_mutex); + break; + } + mark = list_first_entry(&to_free, struct fsnotify_mark, g_list); + fsnotify_get_mark(mark); + fsnotify_destroy_mark_locked(mark, group); + mutex_unlock(&group->mark_mutex); + fsnotify_put_mark(mark); + } } /* From 2f1a904ec548e48e7daa7b54fe18664d5a7e0d44 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 27 Jul 2015 19:24:31 -0400 Subject: [PATCH 160/359] drm/radeon/combios: add some validation of lvds values commit 0a90a0cff9f429f886f423967ae053150dce9259 upstream. Fixes a broken hsync start value uncovered by: abc0b1447d4974963548777a5ba4a4457c82c426 (drm: Perform basic sanity checks on probed modes) The driver handled the bad hsync start elsewhere, but the above commit prevented it from getting added. bug: https://bugs.freedesktop.org/show_bug.cgi?id=91401 Signed-off-by: Alex Deucher Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/radeon/radeon_combios.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c index 68ce360560190a..8cac6981905445 100644 --- a/drivers/gpu/drm/radeon/radeon_combios.c +++ b/drivers/gpu/drm/radeon/radeon_combios.c @@ -1271,10 +1271,15 @@ struct radeon_encoder_lvds *radeon_combios_get_lvds_info(struct radeon_encoder if ((RBIOS16(tmp) == lvds->native_mode.hdisplay) && (RBIOS16(tmp + 2) == lvds->native_mode.vdisplay)) { + u32 hss = (RBIOS16(tmp + 21) - RBIOS16(tmp + 19) - 1) * 8; + + if (hss > lvds->native_mode.hdisplay) + hss = (10 - 1) * 8; + lvds->native_mode.htotal = lvds->native_mode.hdisplay + (RBIOS16(tmp + 17) - RBIOS16(tmp + 19)) * 8; lvds->native_mode.hsync_start = lvds->native_mode.hdisplay + - (RBIOS16(tmp + 21) - RBIOS16(tmp + 19) - 1) * 8; + hss; lvds->native_mode.hsync_end = lvds->native_mode.hsync_start + (RBIOS8(tmp + 23) * 8); From ec8ea7c221488d7e6a05a34e2f9fafab6f39c976 Mon Sep 17 00:00:00 2001 From: Brian King Date: Tue, 14 Jul 2015 11:41:29 -0500 Subject: [PATCH 161/359] ipr: Fix locking for unit attention handling commit 36b8e180e1e929e00b351c3b72aab3147fc14116 upstream. Make sure we have the host lock held when calling scsi_report_bus_reset. Fixes a crash seen as the __devices list in the scsi host was changing as we were iterating through it. Reviewed-by: Wen Xiong Reviewed-by: Gabriel Krisman Bertazi Signed-off-by: Brian King Reviewed-by: Martin K. Petersen Signed-off-by: James Bottomley Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/ipr.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index f7732f3b98042f..847414b9b468be 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c @@ -6141,21 +6141,23 @@ static void ipr_scsi_done(struct ipr_cmnd *ipr_cmd) struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg; struct scsi_cmnd *scsi_cmd = ipr_cmd->scsi_cmd; u32 ioasc = be32_to_cpu(ipr_cmd->s.ioasa.hdr.ioasc); - unsigned long hrrq_flags; + unsigned long lock_flags; scsi_set_resid(scsi_cmd, be32_to_cpu(ipr_cmd->s.ioasa.hdr.residual_data_len)); if (likely(IPR_IOASC_SENSE_KEY(ioasc) == 0)) { scsi_dma_unmap(scsi_cmd); - spin_lock_irqsave(ipr_cmd->hrrq->lock, hrrq_flags); + spin_lock_irqsave(ipr_cmd->hrrq->lock, lock_flags); list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q); scsi_cmd->scsi_done(scsi_cmd); - spin_unlock_irqrestore(ipr_cmd->hrrq->lock, hrrq_flags); + spin_unlock_irqrestore(ipr_cmd->hrrq->lock, lock_flags); } else { - spin_lock_irqsave(ipr_cmd->hrrq->lock, hrrq_flags); + spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags); + spin_lock(&ipr_cmd->hrrq->_lock); ipr_erp_start(ioa_cfg, ipr_cmd); - spin_unlock_irqrestore(ipr_cmd->hrrq->lock, hrrq_flags); + spin_unlock(&ipr_cmd->hrrq->_lock); + spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); } } From 615b0eb835d3d37a9339872c5c1f7ce299e7a40f Mon Sep 17 00:00:00 2001 From: Brian King Date: Tue, 14 Jul 2015 11:41:31 -0500 Subject: [PATCH 162/359] ipr: Fix incorrect trace indexing commit bb7c54339e6a10ecce5c4961adf5e75b3cf0af30 upstream. When ipr's internal driver trace was changed to an atomic, a signed/unsigned bug slipped in which results in us indexing backwards in our memory buffer writing on memory that does not belong to us. This patch fixes this by removing the modulo and instead just mask off the low bits. Tested-by: Wen Xiong Reviewed-by: Wen Xiong Reviewed-by: Gabriel Krisman Bertazi Signed-off-by: Brian King Reviewed-by: Martin K. Petersen Signed-off-by: James Bottomley Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/ipr.c | 5 +++-- drivers/scsi/ipr.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 847414b9b468be..5b9d5efdd12d8f 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c @@ -554,9 +554,10 @@ static void ipr_trc_hook(struct ipr_cmnd *ipr_cmd, { struct ipr_trace_entry *trace_entry; struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg; + unsigned int trace_index; - trace_entry = &ioa_cfg->trace[atomic_add_return - (1, &ioa_cfg->trace_index)%IPR_NUM_TRACE_ENTRIES]; + trace_index = atomic_add_return(1, &ioa_cfg->trace_index) & IPR_TRACE_INDEX_MASK; + trace_entry = &ioa_cfg->trace[trace_index]; trace_entry->time = jiffies; trace_entry->op_code = ipr_cmd->ioarcb.cmd_pkt.cdb[0]; trace_entry->type = type; diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h index c1991155403691..e045676d8325e0 100644 --- a/drivers/scsi/ipr.h +++ b/drivers/scsi/ipr.h @@ -1452,6 +1452,7 @@ struct ipr_ioa_cfg { #define IPR_NUM_TRACE_INDEX_BITS 8 #define IPR_NUM_TRACE_ENTRIES (1 << IPR_NUM_TRACE_INDEX_BITS) +#define IPR_TRACE_INDEX_MASK (IPR_NUM_TRACE_ENTRIES - 1) #define IPR_TRACE_SIZE (sizeof(struct ipr_trace_entry) * IPR_NUM_TRACE_ENTRIES) char trace_start[8]; #define IPR_TRACE_START_LABEL "trace" From b8a1310da4aaeace4accce0762af56625bfbd769 Mon Sep 17 00:00:00 2001 From: Brian King Date: Tue, 14 Jul 2015 11:41:33 -0500 Subject: [PATCH 163/359] ipr: Fix invalid array indexing for HRRQ commit 3f1c0581310d5d94bd72740231507e763a6252a4 upstream. Fixes another signed / unsigned array indexing bug in the ipr driver. Currently, when hrrq_index wraps, it becomes a negative number. We do the modulo, but still have a negative number, so we end up indexing backwards in the array. Given where the hrrq array is located in memory, we probably won't actually reference memory we don't own, but nonetheless ipr is still looking at data within struct ipr_ioa_cfg and interpreting it as struct ipr_hrr_queue data, so bad things could certainly happen. Each ipr adapter has anywhere from 1 to 16 HRRQs. By default, we use 2 on new adapters. Let's take an example: Assume ioa_cfg->hrrq_index=0x7fffffffe and ioa_cfg->hrrq_num=4: The atomic_add_return will then return -1. We mod this with 3 and get -2, add one and get -1 for an array index. On adapters which support more than a single HRRQ, we dedicate HRRQ to adapter initialization and error interrupts so that we can optimize the other queues for fast path I/O. So all normal I/O uses HRRQ 1-15. So we want to spread the I/O requests across those HRRQs. With the default module parameter settings, this bug won't hit, only when someone sets the ipr.number_of_msix parameter to a value larger than 3 is when bad things start to happen. Tested-by: Wen Xiong Reviewed-by: Wen Xiong Reviewed-by: Gabriel Krisman Bertazi Signed-off-by: Brian King Reviewed-by: Martin K. Petersen Signed-off-by: James Bottomley Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/ipr.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 5b9d5efdd12d8f..4a79a5f0d95e96 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c @@ -1007,10 +1007,15 @@ static void ipr_send_blocking_cmd(struct ipr_cmnd *ipr_cmd, static int ipr_get_hrrq_index(struct ipr_ioa_cfg *ioa_cfg) { + unsigned int hrrq; + if (ioa_cfg->hrrq_num == 1) - return 0; - else - return (atomic_add_return(1, &ioa_cfg->hrrq_index) % (ioa_cfg->hrrq_num - 1)) + 1; + hrrq = 0; + else { + hrrq = atomic_add_return(1, &ioa_cfg->hrrq_index); + hrrq = (hrrq % (ioa_cfg->hrrq_num - 1)) + 1; + } + return hrrq; } /** From c0f94181a75400886041b183287ba91f1f392492 Mon Sep 17 00:00:00 2001 From: Mathias Nyman Date: Mon, 3 Aug 2015 16:07:48 +0300 Subject: [PATCH 164/359] xhci: fix off by one error in TRB DMA address boundary check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 7895086afde2a05fa24a0e410d8e6b75ca7c8fdd upstream. We need to check that a TRB is part of the current segment before calculating its DMA address. Previously a ring segment didn't use a full memory page, and every new ring segment got a new memory page, so the off by one error in checking the upper bound was never seen. Now that we use a full memory page, 256 TRBs (4096 bytes), the off by one didn't catch the case when a TRB was the first element of the next segment. This is triggered if the virtual memory pages for a ring segment are next to each in increasing order where the ring buffer wraps around and causes errors like: [ 106.398223] xhci_hcd 0000:00:14.0: ERROR Transfer event TRB DMA ptr not part of current TD ep_index 0 comp_code 1 [ 106.398230] xhci_hcd 0000:00:14.0: Looking for event-dma fffd3000 trb-start fffd4fd0 trb-end fffd5000 seg-start fffd4000 seg-end fffd4ff0 The trb-end address is one outside the end-seg address. Tested-by: Arkadiusz Miśkiewicz Signed-off-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci-ring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 95fe1a432d2922..fde0277adc2c48 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -85,7 +85,7 @@ dma_addr_t xhci_trb_virt_to_dma(struct xhci_segment *seg, return 0; /* offset in TRBs */ segment_offset = trb - seg->trbs; - if (segment_offset > TRBS_PER_SEGMENT) + if (segment_offset >= TRBS_PER_SEGMENT) return 0; return seg->dma + (segment_offset * sizeof(*trb)); } From e850ac8e566a530291d3c6d023030b3ea4a5d48e Mon Sep 17 00:00:00 2001 From: Dirk Behme Date: Mon, 27 Jul 2015 08:56:05 +0200 Subject: [PATCH 165/359] USB: sierra: add 1199:68AB device ID commit 74472233233f577eaa0ca6d6e17d9017b6e53150 upstream. Add support for the Sierra Wireless AR8550 device with USB descriptor 0x1199, 0x68AB. It is common with MC879x modules 1199:683c/683d which also are composite devices with 7 interfaces (0..6) and also MDM62xx based as the AR8550. The major difference are only the interface attributes 02/02/01 on interfaces 3 and 4 on the AR8550. They are vendor specific ff/ff/ff on MC879x modules. lsusb reports: Bus 001 Device 004: ID 1199:68ab Sierra Wireless, Inc. Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x1199 Sierra Wireless, Inc. idProduct 0x68ab bcdDevice 0.06 iManufacturer 3 Sierra Wireless, Incorporated iProduct 2 AR8550 iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 198 bNumInterfaces 7 bConfigurationValue 1 iConfiguration 1 Sierra Configuration bmAttributes 0xe0 Self Powered Remote Wakeup MaxPower 0mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 255 Vendor Specific Subclass bInterfaceProtocol 255 Vendor Specific Protocol iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 32 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 32 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 255 Vendor Specific Subclass bInterfaceProtocol 255 Vendor Specific Protocol iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 32 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x02 EP 2 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 32 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 255 Vendor Specific Subclass bInterfaceProtocol 255 Vendor Specific Protocol iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x83 EP 3 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 32 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x03 EP 3 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 32 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 3 bAlternateSetting 0 bNumEndpoints 3 bInterfaceClass 2 Communications bInterfaceSubClass 2 Abstract (modem) bInterfaceProtocol 1 AT-commands (v.25ter) iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x84 EP 4 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 5 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x85 EP 5 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 32 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x04 EP 4 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 32 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 4 bAlternateSetting 0 bNumEndpoints 3 bInterfaceClass 2 Communications bInterfaceSubClass 2 Abstract (modem) bInterfaceProtocol 1 AT-commands (v.25ter) iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x86 EP 6 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 5 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x87 EP 7 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 32 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x05 EP 5 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 32 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 5 bAlternateSetting 0 bNumEndpoints 3 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 255 Vendor Specific Subclass bInterfaceProtocol 255 Vendor Specific Protocol iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x88 EP 8 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 5 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x89 EP 9 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 32 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x06 EP 6 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 32 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 6 bAlternateSetting 0 bNumEndpoints 3 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 255 Vendor Specific Subclass bInterfaceProtocol 255 Vendor Specific Protocol iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x8a EP 10 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 5 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x8b EP 11 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 32 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x07 EP 7 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 32 Device Qualifier (for other device speed): bLength 10 bDescriptorType 6 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 bNumConfigurations 1 Device Status: 0x0001 Self Powered Signed-off-by: Dirk Behme Cc: Lars Melin Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/sierra.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c index 5aaa2b675116ef..af9f82a1fcdeea 100644 --- a/drivers/usb/serial/sierra.c +++ b/drivers/usb/serial/sierra.c @@ -289,6 +289,7 @@ static const struct usb_device_id id_table[] = { { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x68AA, 0xFF, 0xFF, 0xFF), .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist }, + { USB_DEVICE(0x1199, 0x68AB) }, /* Sierra Wireless AR8550 */ /* AT&T Direct IP LTE modems */ { USB_DEVICE_AND_INTERFACE_INFO(0x0F3D, 0x68AA, 0xFF, 0xFF, 0xFF), .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist From 21c7d3807a429ba6c606e30087d785c0ef3d6288 Mon Sep 17 00:00:00 2001 From: Benjamin Randazzo Date: Sat, 25 Jul 2015 16:36:50 +0200 Subject: [PATCH 166/359] md: use kzalloc() when bitmap is disabled commit b6878d9e03043695dbf3fa1caa6dfc09db225b16 upstream. In drivers/md/md.c get_bitmap_file() uses kmalloc() for creating a mdu_bitmap_file_t called "file". 5769 file = kmalloc(sizeof(*file), GFP_NOIO); 5770 if (!file) 5771 return -ENOMEM; This structure is copied to user space at the end of the function. 5786 if (err == 0 && 5787 copy_to_user(arg, file, sizeof(*file))) 5788 err = -EFAULT But if bitmap is disabled only the first byte of "file" is initialized with zero, so it's possible to read some bytes (up to 4095) of kernel space memory from user space. This is an information leak. 5775 /* bitmap disabled, zero the first byte and copy out */ 5776 if (!mddev->bitmap_info.file) 5777 file->pathname[0] = '\0'; Signed-off-by: Benjamin Randazzo Signed-off-by: NeilBrown Signed-off-by: Greg Kroah-Hartman --- drivers/md/md.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index 631fe3e9c6e558..37ff00d014b427 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -5628,9 +5628,9 @@ static int get_bitmap_file(struct mddev * mddev, void __user * arg) int err = -ENOMEM; if (md_allow_write(mddev)) - file = kmalloc(sizeof(*file), GFP_NOIO); + file = kzalloc(sizeof(*file), GFP_NOIO); else - file = kmalloc(sizeof(*file), GFP_KERNEL); + file = kzalloc(sizeof(*file), GFP_KERNEL); if (!file) goto out; From 471bfba87fb46dad486fe0b9aa4a14c2038383b7 Mon Sep 17 00:00:00 2001 From: Xie XiuQi Date: Fri, 24 Jan 2014 14:00:52 -0600 Subject: [PATCH 167/359] ipmi: fix timeout calculation when bmc is disconnected commit e21404dc0ac7ac971c1e36274b48bb460463f4e5 upstream. Loading ipmi_si module while bmc is disconnected, we found the timeout is longer than 5 secs. Actually it takes about 3 mins and 20 secs.(HZ=250) error message as below: Dec 12 19:08:59 linux kernel: IPMI BT: timeout in RD_WAIT [ ] 1 retries left Dec 12 19:08:59 linux kernel: BT: write 4 bytes seq=0x01 03 18 00 01 [...] Dec 12 19:12:19 linux kernel: IPMI BT: timeout in RD_WAIT [ ] Dec 12 19:12:19 linux kernel: failed 2 retries, sending error response Dec 12 19:12:19 linux kernel: IPMI: BT reset (takes 5 secs) Dec 12 19:12:19 linux kernel: IPMI BT: flag reset [ ] Function wait_for_msg_done() use schedule_timeout_uninterruptible(1) to sleep 1 tick, so we should subtract jiffies_to_usecs(1) instead of 100 usecs from timeout. Reported-by: Hu Shiyuan Signed-off-by: Xie XiuQi Signed-off-by: Corey Minyard Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- drivers/char/ipmi/ipmi_si_intf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index 40b3f756f904a7..02cc352d8bcc7f 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c @@ -2717,7 +2717,7 @@ static int wait_for_msg_done(struct smi_info *smi_info) smi_result == SI_SM_CALL_WITH_TICK_DELAY) { schedule_timeout_uninterruptible(1); smi_result = smi_info->handlers->event( - smi_info->si_sm, 100); + smi_info->si_sm, jiffies_to_usecs(1)); } else if (smi_result == SI_SM_CALL_WITHOUT_DELAY) { smi_result = smi_info->handlers->event( smi_info->si_sm, 0); From 14c99cd5cdd34ee464eeb1fc9f0d560672a4f2ec Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Sun, 8 Sep 2013 00:25:36 -0700 Subject: [PATCH 168/359] mfd: sm501: dbg_regs attribute must be read-only commit 8a8320c2e78d1b619a8fa8eb5ae946b8691de604 upstream. Fix: sm501 sm501: SM501 At b3e00000: Version 050100a0, 8 Mb, IRQ 100 Attribute dbg_regs: write permission without 'store' ------------[ cut here ]------------ WARNING: at drivers/base/core.c:620 dbg_regs does not have a write function and must therefore be marked as read-only. Signed-off-by: Guenter Roeck Signed-off-by: Lee Jones Signed-off-by: Greg Kroah-Hartman --- drivers/mfd/sm501.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c index 9816c232e58331..c04e08d1d0fa1e 100644 --- a/drivers/mfd/sm501.c +++ b/drivers/mfd/sm501.c @@ -1232,7 +1232,7 @@ static ssize_t sm501_dbg_regs(struct device *dev, } -static DEVICE_ATTR(dbg_regs, 0666, sm501_dbg_regs, NULL); +static DEVICE_ATTR(dbg_regs, 0444, sm501_dbg_regs, NULL); /* sm501_init_reg * From 3d8231988d46318b1039f057b78df6c9630e96f4 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Tue, 21 May 2013 13:05:37 +0200 Subject: [PATCH 169/359] perf/x86/amd: Rework AMD PMU init code commit 1b45adcd9a503428e6de6b39bc6892d86c9c1d41 upstream. Josh reported that his QEMU is a bad hardware emulator and trips a WARN in the AMD PMU init code. He requested the WARN be turned into a pr_err() or similar. While there, rework the code a little. Reported-by: Josh Boyer Acked-by: Robert Richter Acked-by: Jacob Shin Cc: Stephane Eranian Signed-off-by: Peter Zijlstra Link: http://lkml.kernel.org/r/20130521110537.GG26912@twins.programming.kicks-ass.net Signed-off-by: Ingo Molnar Cc: Guenter Roeck Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/cpu/perf_event_amd.c | 34 ++++++++++++++-------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/arch/x86/kernel/cpu/perf_event_amd.c b/arch/x86/kernel/cpu/perf_event_amd.c index 7e28d9467bb491..4cbe03287b0892 100644 --- a/arch/x86/kernel/cpu/perf_event_amd.c +++ b/arch/x86/kernel/cpu/perf_event_amd.c @@ -648,48 +648,48 @@ static __initconst const struct x86_pmu amd_pmu = { .cpu_dead = amd_pmu_cpu_dead, }; -static int setup_event_constraints(void) +static int __init amd_core_pmu_init(void) { - if (boot_cpu_data.x86 == 0x15) + if (!cpu_has_perfctr_core) + return 0; + + switch (boot_cpu_data.x86) { + case 0x15: + pr_cont("Fam15h "); x86_pmu.get_event_constraints = amd_get_event_constraints_f15h; - return 0; -} + break; -static int setup_perfctr_core(void) -{ - if (!cpu_has_perfctr_core) { - WARN(x86_pmu.get_event_constraints == amd_get_event_constraints_f15h, - KERN_ERR "Odd, counter constraints enabled but no core perfctrs detected!"); + default: + pr_err("core perfctr but no constraints; unknown hardware!\n"); return -ENODEV; } - WARN(x86_pmu.get_event_constraints == amd_get_event_constraints, - KERN_ERR "hw perf events core counters need constraints handler!"); - /* * If core performance counter extensions exists, we must use * MSR_F15H_PERF_CTL/MSR_F15H_PERF_CTR msrs. See also - * x86_pmu_addr_offset(). + * amd_pmu_addr_offset(). */ x86_pmu.eventsel = MSR_F15H_PERF_CTL; x86_pmu.perfctr = MSR_F15H_PERF_CTR; x86_pmu.num_counters = AMD64_NUM_COUNTERS_CORE; - printk(KERN_INFO "perf: AMD core performance counters detected\n"); - + pr_cont("core perfctr, "); return 0; } __init int amd_pmu_init(void) { + int ret; + /* Performance-monitoring supported from K7 and later: */ if (boot_cpu_data.x86 < 6) return -ENODEV; x86_pmu = amd_pmu; - setup_event_constraints(); - setup_perfctr_core(); + ret = amd_core_pmu_init(); + if (ret) + return ret; /* Events are common for all AMDs */ memcpy(hw_cache_event_ids, amd_hw_cache_event_ids, From 2312fd49eba5795907327885b407d321ea9cca54 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Tue, 14 Oct 2014 19:37:58 -0700 Subject: [PATCH 170/359] sparc64: Fix FPU register corruption with AES crypto offload. [ Upstream commit f4da3628dc7c32a59d1fb7116bb042e6f436d611 ] The AES loops in arch/sparc/crypto/aes_glue.c use a scheme where the key material is preloaded into the FPU registers, and then we loop over and over doing the crypt operation, reusing those pre-cooked key registers. There are intervening blkcipher*() calls between the crypt operation calls. And those might perform memcpy() and thus also try to use the FPU. The sparc64 kernel FPU usage mechanism is designed to allow such recursive uses, but with a catch. There has to be a trap between the two FPU using threads of control. The mechanism works by, when the FPU is already in use by the kernel, allocating a slot for FPU saving at trap time. Then if, within the trap handler, we try to use the FPU registers, the pre-trap FPU register state is saved into the slot. Then at trap return time we notice this and restore the pre-trap FPU state. Over the long term there are various more involved ways we can make this work, but for a quick fix let's take advantage of the fact that the situation where this happens is very limited. All sparc64 chips that support the crypto instructiosn also are using the Niagara4 memcpy routine, and that routine only uses the FPU for large copies where we can't get the source aligned properly to a multiple of 8 bytes. We look to see if the FPU is already in use in this context, and if so we use the non-large copy path which only uses integer registers. Furthermore, we also limit this special logic to when we are doing kernel copy, rather than a user copy. Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- arch/sparc/include/asm/visasm.h | 8 ++++++++ arch/sparc/lib/NG4memcpy.S | 14 +++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/arch/sparc/include/asm/visasm.h b/arch/sparc/include/asm/visasm.h index 39ca301920db72..11fdf0ef50bb65 100644 --- a/arch/sparc/include/asm/visasm.h +++ b/arch/sparc/include/asm/visasm.h @@ -39,6 +39,14 @@ 297: wr %o5, FPRS_FEF, %fprs; \ 298: +#define VISEntryHalfFast(fail_label) \ + rd %fprs, %o5; \ + andcc %o5, FPRS_FEF, %g0; \ + be,pt %icc, 297f; \ + nop; \ + ba,a,pt %xcc, fail_label; \ +297: wr %o5, FPRS_FEF, %fprs; + #define VISExitHalf \ wr %o5, 0, %fprs; diff --git a/arch/sparc/lib/NG4memcpy.S b/arch/sparc/lib/NG4memcpy.S index 9cf2ee01cee371..140527a20e7df0 100644 --- a/arch/sparc/lib/NG4memcpy.S +++ b/arch/sparc/lib/NG4memcpy.S @@ -41,6 +41,10 @@ #endif #endif +#if !defined(EX_LD) && !defined(EX_ST) +#define NON_USER_COPY +#endif + #ifndef EX_LD #define EX_LD(x) x #endif @@ -197,9 +201,13 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */ mov EX_RETVAL(%o3), %o0 .Llarge_src_unaligned: +#ifdef NON_USER_COPY + VISEntryHalfFast(.Lmedium_vis_entry_fail) +#else + VISEntryHalf +#endif andn %o2, 0x3f, %o4 sub %o2, %o4, %o2 - VISEntryHalf alignaddr %o1, %g0, %g1 add %o1, %o4, %o1 EX_LD(LOAD(ldd, %g1 + 0x00, %f0)) @@ -240,6 +248,10 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */ nop ba,a,pt %icc, .Lmedium_unaligned +#ifdef NON_USER_COPY +.Lmedium_vis_entry_fail: + or %o0, %o1, %g2 +#endif .Lmedium: LOAD(prefetch, %o1 + 0x40, #n_reads_strong) andcc %g2, 0x7, %g0 From 683d1a7fb35595d094f0de2f130e7314ee1978f3 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Thu, 6 Aug 2015 19:13:25 -0700 Subject: [PATCH 171/359] sparc64: Fix userspace FPU register corruptions. [ Upstream commit 44922150d87cef616fd183220d43d8fde4d41390 ] If we have a series of events from userpsace, with %fprs=FPRS_FEF, like follows: ETRAP ETRAP VIS_ENTRY(fprs=0x4) VIS_EXIT RTRAP (kernel FPU restore with fpu_saved=0x4) RTRAP We will not restore the user registers that were clobbered by the FPU using kernel code in the inner-most trap. Traps allocate FPU save slots in the thread struct, and FPU using sequences save the "dirty" FPU registers only. This works at the initial trap level because all of the registers get recorded into the top-level FPU save area, and we'll return to userspace with the FPU disabled so that any FPU use by the user will take an FPU disabled trap wherein we'll load the registers back up properly. But this is not how trap returns from kernel to kernel operate. The simplest fix for this bug is to always save all FPU register state for anything other than the top-most FPU save area. Getting rid of the optimized inner-slot FPU saving code ends up making VISEntryHalf degenerate into plain VISEntry. Longer term we need to do something smarter to reinstate the partial save optimizations. Perhaps the fundament error is having trap entry and exit allocate FPU save slots and restore register state. Instead, the VISEntry et al. calls should be doing that work. This bug is about two decades old. Reported-by: James Y Knight Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- arch/sparc/include/asm/visasm.h | 16 +++----- arch/sparc/lib/NG4memcpy.S | 5 ++- arch/sparc/lib/VISsave.S | 67 +-------------------------------- arch/sparc/lib/ksyms.c | 4 -- 4 files changed, 11 insertions(+), 81 deletions(-) diff --git a/arch/sparc/include/asm/visasm.h b/arch/sparc/include/asm/visasm.h index 11fdf0ef50bb65..50d6f16a151395 100644 --- a/arch/sparc/include/asm/visasm.h +++ b/arch/sparc/include/asm/visasm.h @@ -28,16 +28,10 @@ * Must preserve %o5 between VISEntryHalf and VISExitHalf */ #define VISEntryHalf \ - rd %fprs, %o5; \ - andcc %o5, FPRS_FEF, %g0; \ - be,pt %icc, 297f; \ - sethi %hi(298f), %g7; \ - sethi %hi(VISenterhalf), %g1; \ - jmpl %g1 + %lo(VISenterhalf), %g0; \ - or %g7, %lo(298f), %g7; \ - clr %o5; \ -297: wr %o5, FPRS_FEF, %fprs; \ -298: + VISEntry + +#define VISExitHalf \ + VISExit #define VISEntryHalfFast(fail_label) \ rd %fprs, %o5; \ @@ -47,7 +41,7 @@ ba,a,pt %xcc, fail_label; \ 297: wr %o5, FPRS_FEF, %fprs; -#define VISExitHalf \ +#define VISExitHalfFast \ wr %o5, 0, %fprs; #ifndef __ASSEMBLY__ diff --git a/arch/sparc/lib/NG4memcpy.S b/arch/sparc/lib/NG4memcpy.S index 140527a20e7df0..83aeeb1dffdb3b 100644 --- a/arch/sparc/lib/NG4memcpy.S +++ b/arch/sparc/lib/NG4memcpy.S @@ -240,8 +240,11 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */ add %o0, 0x40, %o0 bne,pt %icc, 1b LOAD(prefetch, %g1 + 0x200, #n_reads_strong) +#ifdef NON_USER_COPY + VISExitHalfFast +#else VISExitHalf - +#endif brz,pn %o2, .Lexit cmp %o2, 19 ble,pn %icc, .Lsmall_unaligned diff --git a/arch/sparc/lib/VISsave.S b/arch/sparc/lib/VISsave.S index b320ae9e2e2e8b..a063d84336d638 100644 --- a/arch/sparc/lib/VISsave.S +++ b/arch/sparc/lib/VISsave.S @@ -44,9 +44,8 @@ vis1: ldub [%g6 + TI_FPSAVED], %g3 stx %g3, [%g6 + TI_GSR] 2: add %g6, %g1, %g3 - cmp %o5, FPRS_DU - be,pn %icc, 6f - sll %g1, 3, %g1 + mov FPRS_DU | FPRS_DL | FPRS_FEF, %o5 + sll %g1, 3, %g1 stb %o5, [%g3 + TI_FPSAVED] rd %gsr, %g2 add %g6, %g1, %g3 @@ -80,65 +79,3 @@ vis1: ldub [%g6 + TI_FPSAVED], %g3 .align 32 80: jmpl %g7 + %g0, %g0 nop - -6: ldub [%g3 + TI_FPSAVED], %o5 - or %o5, FPRS_DU, %o5 - add %g6, TI_FPREGS+0x80, %g2 - stb %o5, [%g3 + TI_FPSAVED] - - sll %g1, 5, %g1 - add %g6, TI_FPREGS+0xc0, %g3 - wr %g0, FPRS_FEF, %fprs - membar #Sync - stda %f32, [%g2 + %g1] ASI_BLK_P - stda %f48, [%g3 + %g1] ASI_BLK_P - membar #Sync - ba,pt %xcc, 80f - nop - - .align 32 -80: jmpl %g7 + %g0, %g0 - nop - - .align 32 -VISenterhalf: - ldub [%g6 + TI_FPDEPTH], %g1 - brnz,a,pn %g1, 1f - cmp %g1, 1 - stb %g0, [%g6 + TI_FPSAVED] - stx %fsr, [%g6 + TI_XFSR] - clr %o5 - jmpl %g7 + %g0, %g0 - wr %g0, FPRS_FEF, %fprs - -1: bne,pn %icc, 2f - srl %g1, 1, %g1 - ba,pt %xcc, vis1 - sub %g7, 8, %g7 -2: addcc %g6, %g1, %g3 - sll %g1, 3, %g1 - andn %o5, FPRS_DU, %g2 - stb %g2, [%g3 + TI_FPSAVED] - - rd %gsr, %g2 - add %g6, %g1, %g3 - stx %g2, [%g3 + TI_GSR] - add %g6, %g1, %g2 - stx %fsr, [%g2 + TI_XFSR] - sll %g1, 5, %g1 -3: andcc %o5, FPRS_DL, %g0 - be,pn %icc, 4f - add %g6, TI_FPREGS, %g2 - - add %g6, TI_FPREGS+0x40, %g3 - membar #Sync - stda %f0, [%g2 + %g1] ASI_BLK_P - stda %f16, [%g3 + %g1] ASI_BLK_P - membar #Sync - ba,pt %xcc, 4f - nop - - .align 32 -4: and %o5, FPRS_DU, %o5 - jmpl %g7 + %g0, %g0 - wr %o5, FPRS_FEF, %fprs diff --git a/arch/sparc/lib/ksyms.c b/arch/sparc/lib/ksyms.c index 323335b9cd2b5c..ac094de28ccfd0 100644 --- a/arch/sparc/lib/ksyms.c +++ b/arch/sparc/lib/ksyms.c @@ -126,10 +126,6 @@ EXPORT_SYMBOL(copy_user_page); void VISenter(void); EXPORT_SYMBOL(VISenter); -/* CRYPTO code needs this */ -void VISenterhalf(void); -EXPORT_SYMBOL(VISenterhalf); - extern void xor_vis_2(unsigned long, unsigned long *, unsigned long *); extern void xor_vis_3(unsigned long, unsigned long *, unsigned long *, unsigned long *); From 3f2c206ae6f9e1005ac7f092e8d65c17307a0d59 Mon Sep 17 00:00:00 2001 From: Andy Lutomirski Date: Thu, 30 Jul 2015 14:31:31 -0700 Subject: [PATCH 172/359] x86/xen: Probe target addresses in set_aliased_prot() before the hypercall commit aa1acff356bbedfd03b544051f5b371746735d89 upstream. The update_va_mapping hypercall can fail if the VA isn't present in the guest's page tables. Under certain loads, this can result in an OOPS when the target address is in unpopulated vmap space. While we're at it, add comments to help explain what's going on. This isn't a great long-term fix. This code should probably be changed to use something like set_memory_ro. Signed-off-by: Andy Lutomirski Cc: Andrew Cooper Cc: Andy Lutomirski Cc: Boris Ostrovsky Cc: Borislav Petkov Cc: Brian Gerst Cc: David Vrabel Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Jan Beulich Cc: Konrad Rzeszutek Wilk Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Sasha Levin Cc: Steven Rostedt Cc: Thomas Gleixner Cc: security@kernel.org Cc: xen-devel Link: http://lkml.kernel.org/r/0b0e55b995cda11e7829f140b833ef932fcabe3a.1438291540.git.luto@kernel.org Signed-off-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman --- arch/x86/xen/enlighten.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index a492be2635ac04..13d926282c89ac 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c @@ -481,6 +481,7 @@ static void set_aliased_prot(void *v, pgprot_t prot) pte_t pte; unsigned long pfn; struct page *page; + unsigned char dummy; ptep = lookup_address((unsigned long)v, &level); BUG_ON(ptep == NULL); @@ -490,6 +491,32 @@ static void set_aliased_prot(void *v, pgprot_t prot) pte = pfn_pte(pfn, prot); + /* + * Careful: update_va_mapping() will fail if the virtual address + * we're poking isn't populated in the page tables. We don't + * need to worry about the direct map (that's always in the page + * tables), but we need to be careful about vmap space. In + * particular, the top level page table can lazily propagate + * entries between processes, so if we've switched mms since we + * vmapped the target in the first place, we might not have the + * top-level page table entry populated. + * + * We disable preemption because we want the same mm active when + * we probe the target and when we issue the hypercall. We'll + * have the same nominal mm, but if we're a kernel thread, lazy + * mm dropping could change our pgd. + * + * Out of an abundance of caution, this uses __get_user() to fault + * in the target address just in case there's some obscure case + * in which the target address isn't readable. + */ + + preempt_disable(); + + pagefault_disable(); /* Avoid warnings due to being atomic. */ + __get_user(dummy, (unsigned char __user __force *)v); + pagefault_enable(); + if (HYPERVISOR_update_va_mapping((unsigned long)v, pte, 0)) BUG(); @@ -501,6 +528,8 @@ static void set_aliased_prot(void *v, pgprot_t prot) BUG(); } else kmap_flush_unused(); + + preempt_enable(); } static void xen_alloc_ldt(struct desc_struct *ldt, unsigned entries) @@ -508,6 +537,17 @@ static void xen_alloc_ldt(struct desc_struct *ldt, unsigned entries) const unsigned entries_per_page = PAGE_SIZE / LDT_ENTRY_SIZE; int i; + /* + * We need to mark the all aliases of the LDT pages RO. We + * don't need to call vm_flush_aliases(), though, since that's + * only responsible for flushing aliases out the TLBs, not the + * page tables, and Xen will flush the TLB for us if needed. + * + * To avoid confusing future readers: none of this is necessary + * to load the LDT. The hypervisor only checks this when the + * LDT is faulted in due to subsequent descriptor access. + */ + for(i = 0; i < entries; i += entries_per_page) set_aliased_prot(ldt + i, PAGE_KERNEL_RO); } From 292f53675e097ca807df744fb6fd39211a134bf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Fri, 26 Jun 2015 03:28:24 +0200 Subject: [PATCH 173/359] xen/gntdevt: Fix race condition in gntdev_release() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 30b03d05e07467b8c6ec683ea96b5bffcbcd3931 upstream. While gntdev_release() is called the MMU notifier is still registered and can traverse priv->maps list even if no pages are mapped (which is the case -- gntdev_release() is called after all). But gntdev_release() will clear that list, so make sure that only one of those things happens at the same time. Signed-off-by: Marek Marczykowski-Górecki Signed-off-by: David Vrabel Signed-off-by: Greg Kroah-Hartman --- drivers/xen/gntdev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c index 3c8803feba26cd..474d11499d0ebe 100644 --- a/drivers/xen/gntdev.c +++ b/drivers/xen/gntdev.c @@ -534,12 +534,14 @@ static int gntdev_release(struct inode *inode, struct file *flip) pr_debug("priv %p\n", priv); + mutex_lock(&priv->lock); while (!list_empty(&priv->maps)) { map = list_entry(priv->maps.next, struct grant_map, next); list_del(&map->next); gntdev_put_map(NULL /* already removed */, map); } WARN_ON(!list_empty(&priv->freeable_maps)); + mutex_unlock(&priv->lock); if (use_ptemod) mmu_notifier_unregister(&priv->mn, priv->mm); From d3646ba72fd7292e9166866aed65e6e8de4b6440 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Wed, 22 Jul 2015 18:05:35 +0800 Subject: [PATCH 174/359] crypto: ixp4xx - Remove bogus BUG_ON on scattered dst buffer commit f898c522f0e9ac9f3177d0762b76e2ab2d2cf9c0 upstream. This patch removes a bogus BUG_ON in the ablkcipher path that triggers when the destination buffer is different from the source buffer and is scattered. Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/ixp4xx_crypto.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/crypto/ixp4xx_crypto.c b/drivers/crypto/ixp4xx_crypto.c index 21180d6cad6e27..7cb51b3bb79e30 100644 --- a/drivers/crypto/ixp4xx_crypto.c +++ b/drivers/crypto/ixp4xx_crypto.c @@ -915,7 +915,6 @@ static int ablk_perform(struct ablkcipher_request *req, int encrypt) crypt->mode |= NPE_OP_NOT_IN_PLACE; /* This was never tested by Intel * for more than one dst buffer, I think. */ - BUG_ON(req->dst->length < nbytes); req_ctx->dst = NULL; if (!chainup_buffers(dev, req->dst, nbytes, &dst_hook, flags, DMA_FROM_DEVICE)) From dff252b8499f7f7cb4353d5c64ed5dbc13b7daa0 Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Thu, 16 Jul 2015 17:36:11 +0300 Subject: [PATCH 175/359] rbd: fix copyup completion race commit 2761713d35e370fd640b5781109f753066b746c4 upstream. For write/discard obj_requests that involved a copyup method call, the opcode of the first op is CEPH_OSD_OP_CALL and the ->callback is rbd_img_obj_copyup_callback(). The latter frees copyup pages, sets ->xferred and delegates to rbd_img_obj_callback(), the "normal" image object callback, for reporting to block layer and putting refs. rbd_osd_req_callback() however treats CEPH_OSD_OP_CALL as a trivial op, which means obj_request is marked done in rbd_osd_trivial_callback(), *before* ->callback is invoked and rbd_img_obj_copyup_callback() has a chance to run. Marking obj_request done essentially means giving rbd_img_obj_callback() a license to end it at any moment, so if another obj_request from the same img_request is being completed concurrently, rbd_img_obj_end_request() may very well be called on such prematurally marked done request: handle_reply() rbd_osd_req_callback() rbd_osd_trivial_callback() rbd_obj_request_complete() rbd_img_obj_copyup_callback() rbd_img_obj_callback() handle_reply() rbd_osd_req_callback() rbd_osd_trivial_callback() for_each_obj_request(obj_request->img_request) { rbd_img_obj_end_request(obj_request-1/2) rbd_img_obj_end_request(obj_request-2/2) <-- } Calling rbd_img_obj_end_request() on such a request leads to trouble, in particular because its ->xfferred is 0. We report 0 to the block layer with blk_update_request(), get back 1 for "this request has more data in flight" and then trip on rbd_assert(more ^ (which == img_request->obj_request_count)); with rhs (which == ...) being 1 because rbd_img_obj_end_request() has been called for both requests and lhs (more) being 1 because we haven't got a chance to set ->xfferred in rbd_img_obj_copyup_callback() yet. To fix this, leverage that rbd wants to call class methods in only two cases: one is a generic method call wrapper (obj_request is standalone) and the other is a copyup (obj_request is part of an img_request). So make a dedicated handler for CEPH_OSD_OP_CALL and directly invoke rbd_img_obj_copyup_callback() from it if obj_request is part of an img_request, similar to how CEPH_OSD_OP_READ handler invokes rbd_img_obj_request_read_callback(). Since rbd_img_obj_copyup_callback() is now being called from the OSD request callback (only), it is renamed to rbd_osd_copyup_callback(). Cc: Alex Elder Signed-off-by: Ilya Dryomov Reviewed-by: Alex Elder Signed-off-by: Greg Kroah-Hartman --- drivers/block/rbd.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index f78cbbb88bd4f0..01677543248df1 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -457,6 +457,7 @@ void rbd_warn(struct rbd_device *rbd_dev, const char *fmt, ...) # define rbd_assert(expr) ((void) 0) #endif /* !RBD_DEBUG */ +static void rbd_osd_copyup_callback(struct rbd_obj_request *obj_request); static int rbd_img_obj_request_submit(struct rbd_obj_request *obj_request); static void rbd_img_parent_read(struct rbd_obj_request *obj_request); static void rbd_dev_remove_parent(struct rbd_device *rbd_dev); @@ -1670,6 +1671,16 @@ static void rbd_osd_stat_callback(struct rbd_obj_request *obj_request) obj_request_done_set(obj_request); } +static void rbd_osd_call_callback(struct rbd_obj_request *obj_request) +{ + dout("%s: obj %p\n", __func__, obj_request); + + if (obj_request_img_data_test(obj_request)) + rbd_osd_copyup_callback(obj_request); + else + obj_request_done_set(obj_request); +} + static void rbd_osd_req_callback(struct ceph_osd_request *osd_req, struct ceph_msg *msg) { @@ -1708,6 +1719,8 @@ static void rbd_osd_req_callback(struct ceph_osd_request *osd_req, rbd_osd_stat_callback(obj_request); break; case CEPH_OSD_OP_CALL: + rbd_osd_call_callback(obj_request); + break; case CEPH_OSD_OP_NOTIFY_ACK: case CEPH_OSD_OP_WATCH: rbd_osd_trivial_callback(obj_request); @@ -2305,13 +2318,15 @@ static int rbd_img_request_fill(struct rbd_img_request *img_request, } static void -rbd_img_obj_copyup_callback(struct rbd_obj_request *obj_request) +rbd_osd_copyup_callback(struct rbd_obj_request *obj_request) { struct rbd_img_request *img_request; struct rbd_device *rbd_dev; struct page **pages; u32 page_count; + dout("%s: obj %p\n", __func__, obj_request); + rbd_assert(obj_request->type == OBJ_REQUEST_BIO); rbd_assert(obj_request_img_data_test(obj_request)); img_request = obj_request->img_request; @@ -2337,9 +2352,7 @@ rbd_img_obj_copyup_callback(struct rbd_obj_request *obj_request) if (!obj_request->result) obj_request->xferred = obj_request->length; - /* Finish up with the normal image object callback */ - - rbd_img_obj_callback(obj_request); + obj_request_done_set(obj_request); } static void @@ -2436,7 +2449,6 @@ rbd_img_obj_parent_read_full_callback(struct rbd_img_request *img_request) /* All set, send it off. */ - orig_request->callback = rbd_img_obj_copyup_callback; osdc = &rbd_dev->rbd_client->client->osdc; img_result = rbd_obj_request_submit(osdc, orig_request); if (!img_result) From 621468a3d79c2ef11ef2ec2eeb1038b8c4373b7d Mon Sep 17 00:00:00 2001 From: Nicholas Bellinger Date: Wed, 22 Jul 2015 23:14:19 -0700 Subject: [PATCH 176/359] iscsi-target: Fix iscsit_start_kthreads failure OOPs commit e54198657b65625085834847ab6271087323ffea upstream. This patch fixes a regression introduced with the following commit in v4.0-rc1 code, where a iscsit_start_kthreads() failure triggers a NULL pointer dereference OOPs: commit 88dcd2dab5c23b1c9cfc396246d8f476c872f0ca Author: Nicholas Bellinger Date: Thu Feb 26 22:19:15 2015 -0800 iscsi-target: Convert iscsi_thread_set usage to kthread.h To address this bug, move iscsit_start_kthreads() immediately preceeding the transmit of last login response, before signaling a successful transition into full-feature-phase within existing iscsi_target_do_tx_login_io() logic. This ensures that no target-side resource allocation failures can occur after the final login response has been successfully sent. Also, it adds a iscsi_conn->rx_login_comp to allow the RX thread to sleep to prevent other socket related failures until the final iscsi_post_login_handler() call is able to complete. Cc: Sagi Grimberg Signed-off-by: Nicholas Bellinger Signed-off-by: Nicholas Bellinger Signed-off-by: Greg Kroah-Hartman --- drivers/target/iscsi/iscsi_target.c | 18 ++++++++-- drivers/target/iscsi/iscsi_target_core.h | 1 + drivers/target/iscsi/iscsi_target_login.c | 43 +++++++++-------------- drivers/target/iscsi/iscsi_target_login.h | 1 + drivers/target/iscsi/iscsi_target_nego.c | 34 +++++++++++++++++- 5 files changed, 66 insertions(+), 31 deletions(-) diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index efca110342cb05..06cd916f91fe47 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c @@ -3874,7 +3874,13 @@ int iscsi_target_tx_thread(void *arg) } transport_err: - iscsit_take_action_for_connection_exit(conn); + /* + * Avoid the normal connection failure code-path if this connection + * is still within LOGIN mode, and iscsi_np process context is + * responsible for cleaning up the early connection failure. + */ + if (conn->conn_state != TARG_CONN_STATE_IN_LOGIN) + iscsit_take_action_for_connection_exit(conn); out: return 0; } @@ -3956,7 +3962,7 @@ static int iscsi_target_rx_opcode(struct iscsi_conn *conn, unsigned char *buf) int iscsi_target_rx_thread(void *arg) { - int ret; + int ret, rc; u8 buffer[ISCSI_HDR_LEN], opcode; u32 checksum = 0, digest = 0; struct iscsi_conn *conn = arg; @@ -3966,10 +3972,16 @@ int iscsi_target_rx_thread(void *arg) * connection recovery / failure event can be triggered externally. */ allow_signal(SIGINT); + /* + * Wait for iscsi_post_login_handler() to complete before allowing + * incoming iscsi/tcp socket I/O, and/or failing the connection. + */ + rc = wait_for_completion_interruptible(&conn->rx_login_comp); + if (rc < 0) + return 0; if (conn->conn_transport->transport_type == ISCSI_INFINIBAND) { struct completion comp; - int rc; init_completion(&comp); rc = wait_for_completion_interruptible(&comp); diff --git a/drivers/target/iscsi/iscsi_target_core.h b/drivers/target/iscsi/iscsi_target_core.h index 815bf5b1a4ae43..bf93e1c1ff9789 100644 --- a/drivers/target/iscsi/iscsi_target_core.h +++ b/drivers/target/iscsi/iscsi_target_core.h @@ -589,6 +589,7 @@ struct iscsi_conn { int bitmap_id; int rx_thread_active; struct task_struct *rx_thread; + struct completion rx_login_comp; int tx_thread_active; struct task_struct *tx_thread; /* list_head for session connection list */ diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c index 797b2e2acc356e..2c4db62e327efc 100644 --- a/drivers/target/iscsi/iscsi_target_login.c +++ b/drivers/target/iscsi/iscsi_target_login.c @@ -84,6 +84,7 @@ static struct iscsi_login *iscsi_login_init_conn(struct iscsi_conn *conn) init_completion(&conn->conn_logout_comp); init_completion(&conn->rx_half_close_comp); init_completion(&conn->tx_half_close_comp); + init_completion(&conn->rx_login_comp); spin_lock_init(&conn->cmd_lock); spin_lock_init(&conn->conn_usage_lock); spin_lock_init(&conn->immed_queue_lock); @@ -718,6 +719,7 @@ int iscsit_start_kthreads(struct iscsi_conn *conn) return 0; out_tx: + send_sig(SIGINT, conn->tx_thread, 1); kthread_stop(conn->tx_thread); conn->tx_thread_active = false; out_bitmap: @@ -728,7 +730,7 @@ int iscsit_start_kthreads(struct iscsi_conn *conn) return ret; } -int iscsi_post_login_handler( +void iscsi_post_login_handler( struct iscsi_np *np, struct iscsi_conn *conn, u8 zero_tsih) @@ -738,7 +740,6 @@ int iscsi_post_login_handler( struct se_session *se_sess = sess->se_sess; struct iscsi_portal_group *tpg = ISCSI_TPG_S(sess); struct se_portal_group *se_tpg = &tpg->tpg_se_tpg; - int rc; iscsit_inc_conn_usage_count(conn); @@ -779,10 +780,6 @@ int iscsi_post_login_handler( sess->sess_ops->InitiatorName); spin_unlock_bh(&sess->conn_lock); - rc = iscsit_start_kthreads(conn); - if (rc) - return rc; - iscsi_post_login_start_timers(conn); /* * Determine CPU mask to ensure connection's RX and TX kthreads @@ -791,15 +788,20 @@ int iscsi_post_login_handler( iscsit_thread_get_cpumask(conn); conn->conn_rx_reset_cpumask = 1; conn->conn_tx_reset_cpumask = 1; - + /* + * Wakeup the sleeping iscsi_target_rx_thread() now that + * iscsi_conn is in TARG_CONN_STATE_LOGGED_IN state. + */ + complete(&conn->rx_login_comp); iscsit_dec_conn_usage_count(conn); + if (stop_timer) { spin_lock_bh(&se_tpg->session_lock); iscsit_stop_time2retain_timer(sess); spin_unlock_bh(&se_tpg->session_lock); } iscsit_dec_session_usage_count(sess); - return 0; + return; } iscsi_set_session_parameters(sess->sess_ops, conn->param_list, 1); @@ -840,10 +842,6 @@ int iscsi_post_login_handler( " iSCSI Target Portal Group: %hu\n", tpg->nsessions, tpg->tpgt); spin_unlock_bh(&se_tpg->session_lock); - rc = iscsit_start_kthreads(conn); - if (rc) - return rc; - iscsi_post_login_start_timers(conn); /* * Determine CPU mask to ensure connection's RX and TX kthreads @@ -852,10 +850,12 @@ int iscsi_post_login_handler( iscsit_thread_get_cpumask(conn); conn->conn_rx_reset_cpumask = 1; conn->conn_tx_reset_cpumask = 1; - + /* + * Wakeup the sleeping iscsi_target_rx_thread() now that + * iscsi_conn is in TARG_CONN_STATE_LOGGED_IN state. + */ + complete(&conn->rx_login_comp); iscsit_dec_conn_usage_count(conn); - - return 0; } static void iscsi_handle_login_thread_timeout(unsigned long data) @@ -1331,20 +1331,9 @@ static int __iscsi_target_login_thread(struct iscsi_np *np) if (iscsi_target_start_negotiation(login, conn) < 0) goto new_sess_out; - if (!conn->sess) { - pr_err("struct iscsi_conn session pointer is NULL!\n"); - goto new_sess_out; - } - iscsi_stop_login_thread_timer(np); - if (signal_pending(current)) - goto new_sess_out; - - ret = iscsi_post_login_handler(np, conn, zero_tsih); - - if (ret < 0) - goto new_sess_out; + iscsi_post_login_handler(np, conn, zero_tsih); iscsit_deaccess_np(np, tpg); tpg = NULL; diff --git a/drivers/target/iscsi/iscsi_target_login.h b/drivers/target/iscsi/iscsi_target_login.h index 63efd287845171..6d7eb66de94b20 100644 --- a/drivers/target/iscsi/iscsi_target_login.h +++ b/drivers/target/iscsi/iscsi_target_login.h @@ -12,6 +12,7 @@ extern int iscsit_accept_np(struct iscsi_np *, struct iscsi_conn *); extern int iscsit_get_login_rx(struct iscsi_conn *, struct iscsi_login *); extern int iscsit_put_login_tx(struct iscsi_conn *, struct iscsi_login *, u32); extern void iscsit_free_conn(struct iscsi_np *, struct iscsi_conn *); +extern int iscsit_start_kthreads(struct iscsi_conn *); extern int iscsi_target_login_thread(void *); extern int iscsi_login_disable_FIM_keys(struct iscsi_param_list *, struct iscsi_conn *); diff --git a/drivers/target/iscsi/iscsi_target_nego.c b/drivers/target/iscsi/iscsi_target_nego.c index 72d9dec991c0b3..77c276acccb68b 100644 --- a/drivers/target/iscsi/iscsi_target_nego.c +++ b/drivers/target/iscsi/iscsi_target_nego.c @@ -19,6 +19,7 @@ ******************************************************************************/ #include +#include #include #include #include @@ -352,10 +353,24 @@ static int iscsi_target_do_tx_login_io(struct iscsi_conn *conn, struct iscsi_log ntohl(login_rsp->statsn), login->rsp_length); padding = ((-login->rsp_length) & 3); + /* + * Before sending the last login response containing the transition + * bit for full-feature-phase, go ahead and start up TX/RX threads + * now to avoid potential resource allocation failures after the + * final login response has been sent. + */ + if (login->login_complete) { + int rc = iscsit_start_kthreads(conn); + if (rc) { + iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR, + ISCSI_LOGIN_STATUS_NO_RESOURCES); + return -1; + } + } if (conn->conn_transport->iscsit_put_login_tx(conn, login, login->rsp_length + padding) < 0) - return -1; + goto err; login->rsp_length = 0; mutex_lock(&sess->cmdsn_mutex); @@ -364,6 +379,23 @@ static int iscsi_target_do_tx_login_io(struct iscsi_conn *conn, struct iscsi_log mutex_unlock(&sess->cmdsn_mutex); return 0; + +err: + if (login->login_complete) { + if (conn->rx_thread && conn->rx_thread_active) { + send_sig(SIGINT, conn->rx_thread, 1); + kthread_stop(conn->rx_thread); + } + if (conn->tx_thread && conn->tx_thread_active) { + send_sig(SIGINT, conn->tx_thread, 1); + kthread_stop(conn->tx_thread); + } + spin_lock(&iscsit_global->ts_bitmap_lock); + bitmap_release_region(iscsit_global->ts_bitmap, conn->bitmap_id, + get_order(1)); + spin_unlock(&iscsit_global->ts_bitmap_lock); + } + return -1; } static int iscsi_target_do_login_io(struct iscsi_conn *conn, struct iscsi_login *login) From 5d6e58957cb833fe1847bd8370dac9b3939546b9 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Sat, 25 Jul 2015 03:03:38 +0300 Subject: [PATCH 177/359] ALSA: hda - fix cs4210_spdif_automute() commit 44008f0896ae205b02b0882dbf807f0de149efc4 upstream. Smatch complains that we have nested checks for "spdif_present". It turns out the current behavior isn't correct, we should remove the first check and keep the second. Fixes: 1077a024812d ('ALSA: hda - Use generic parser for Cirrus codec driver') Signed-off-by: Dan Carpenter Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/pci/hda/patch_cirrus.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c index e2642ba88b2d95..2ba07ae708790d 100644 --- a/sound/pci/hda/patch_cirrus.c +++ b/sound/pci/hda/patch_cirrus.c @@ -787,9 +787,7 @@ static void cs4210_spdif_automute(struct hda_codec *codec, spec->spdif_present = spdif_present; /* SPDIF TX on/off */ - if (spdif_present) - snd_hda_set_pin_ctl(codec, spdif_pin, - spdif_present ? PIN_OUT : 0); + snd_hda_set_pin_ctl(codec, spdif_pin, spdif_present ? PIN_OUT : 0); cs_automute(codec); } From 2934eb36cf564b6e368d8b43eb48384b308e04e7 Mon Sep 17 00:00:00 2001 From: Marcus Gelderie Date: Thu, 6 Aug 2015 15:46:10 -0700 Subject: [PATCH 178/359] ipc: modify message queue accounting to not take kernel data structures into account commit de54b9ac253787c366bbfb28d901a31954eb3511 upstream. A while back, the message queue implementation in the kernel was improved to use btrees to speed up retrieval of messages, in commit d6629859b36d ("ipc/mqueue: improve performance of send/recv"). That patch introducing the improved kernel handling of message queues (using btrees) has, as a by-product, changed the meaning of the QSIZE field in the pseudo-file created for the queue. Before, this field reflected the size of the user-data in the queue. Since, it also takes kernel data structures into account. For example, if 13 bytes of user data are in the queue, on my machine the file reports a size of 61 bytes. There was some discussion on this topic before (for example https://lkml.org/lkml/2014/10/1/115). Commenting on a th lkml, Michael Kerrisk gave the following background (https://lkml.org/lkml/2015/6/16/74): The pseudofiles in the mqueue filesystem (usually mounted at /dev/mqueue) expose fields with metadata describing a message queue. One of these fields, QSIZE, as originally implemented, showed the total number of bytes of user data in all messages in the message queue, and this feature was documented from the beginning in the mq_overview(7) page. In 3.5, some other (useful) work happened to break the user-space API in a couple of places, including the value exposed via QSIZE, which now includes a measure of kernel overhead bytes for the queue, a figure that renders QSIZE useless for its original purpose, since there's no way to deduce the number of overhead bytes consumed by the implementation. (The other user-space breakage was subsequently fixed.) This patch removes the accounting of kernel data structures in the queue. Reporting the size of these data-structures in the QSIZE field was a breaking change (see Michael's comment above). Without the QSIZE field reporting the total size of user-data in the queue, there is no way to deduce this number. It should be noted that the resource limit RLIMIT_MSGQUEUE is counted against the worst-case size of the queue (in both the old and the new implementation). Therefore, the kernel overhead accounting in QSIZE is not necessary to help the user understand the limitations RLIMIT imposes on the processes. Signed-off-by: Marcus Gelderie Acked-by: Doug Ledford Acked-by: Michael Kerrisk Acked-by: Davidlohr Bueso Cc: David Howells Cc: Alexander Viro Cc: John Duffy Cc: Arto Bendiken Cc: Manfred Spraul Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- ipc/mqueue.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ipc/mqueue.c b/ipc/mqueue.c index bb0248fc518772..82bb5e81ef575f 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c @@ -143,7 +143,6 @@ static int msg_insert(struct msg_msg *msg, struct mqueue_inode_info *info) if (!leaf) return -ENOMEM; INIT_LIST_HEAD(&leaf->msg_list); - info->qsize += sizeof(*leaf); } leaf->priority = msg->m_type; rb_link_node(&leaf->rb_node, parent, p); @@ -188,7 +187,6 @@ static inline struct msg_msg *msg_get(struct mqueue_inode_info *info) "lazy leaf delete!\n"); rb_erase(&leaf->rb_node, &info->msg_tree); if (info->node_cache) { - info->qsize -= sizeof(*leaf); kfree(leaf); } else { info->node_cache = leaf; @@ -201,7 +199,6 @@ static inline struct msg_msg *msg_get(struct mqueue_inode_info *info) if (list_empty(&leaf->msg_list)) { rb_erase(&leaf->rb_node, &info->msg_tree); if (info->node_cache) { - info->qsize -= sizeof(*leaf); kfree(leaf); } else { info->node_cache = leaf; @@ -1026,7 +1023,6 @@ SYSCALL_DEFINE5(mq_timedsend, mqd_t, mqdes, const char __user *, u_msg_ptr, /* Save our speculative allocation into the cache */ INIT_LIST_HEAD(&new_leaf->msg_list); info->node_cache = new_leaf; - info->qsize += sizeof(*new_leaf); new_leaf = NULL; } else { kfree(new_leaf); @@ -1133,7 +1129,6 @@ SYSCALL_DEFINE5(mq_timedreceive, mqd_t, mqdes, char __user *, u_msg_ptr, /* Save our speculative allocation into the cache */ INIT_LIST_HEAD(&new_leaf->msg_list); info->node_cache = new_leaf; - info->qsize += sizeof(*new_leaf); } else { kfree(new_leaf); } From 2a4cb7b52d728b1f6b76e73ea0277f422da1ffac Mon Sep 17 00:00:00 2001 From: Joseph Qi Date: Thu, 6 Aug 2015 15:46:23 -0700 Subject: [PATCH 179/359] ocfs2: fix BUG in ocfs2_downconvert_thread_do_work() commit 209f7512d007980fd111a74a064d70a3656079cf upstream. The "BUG_ON(list_empty(&osb->blocked_lock_list))" in ocfs2_downconvert_thread_do_work can be triggered in the following case: ocfs2dc has firstly saved osb->blocked_lock_count to local varibale processed, and then processes the dentry lockres. During the dentry put, it calls iput and then deletes rw, inode and open lockres from blocked list in ocfs2_mark_lockres_freeing. And this causes the variable `processed' to not reflect the number of blocked lockres to be processed, which triggers the BUG. Signed-off-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- fs/ocfs2/dlmglue.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index 3a44a648dae770..b294deb27d173f 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c @@ -3971,9 +3971,13 @@ static void ocfs2_downconvert_thread_do_work(struct ocfs2_super *osb) osb->dc_work_sequence = osb->dc_wake_sequence; processed = osb->blocked_lock_count; - while (processed) { - BUG_ON(list_empty(&osb->blocked_lock_list)); - + /* + * blocked lock processing in this loop might call iput which can + * remove items off osb->blocked_lock_list. Downconvert up to + * 'processed' number of locks, but stop short if we had some + * removed in ocfs2_mark_lockres_freeing when downconverting. + */ + while (processed && !list_empty(&osb->blocked_lock_list)) { lockres = list_entry(osb->blocked_lock_list.next, struct ocfs2_lock_res, l_blocked_list); list_del_init(&lockres->l_blocked_list); From c4a6d3f3491a55269ee1e8d99f6fa7bab15cc011 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Mon, 27 Jul 2015 11:48:52 +1000 Subject: [PATCH 180/359] md/raid1: extend spinlock to protect raid1_end_read_request against inconsistencies commit 423f04d63cf421ea436bcc5be02543d549ce4b28 upstream. raid1_end_read_request() assumes that the In_sync bits are consistent with the ->degaded count. raid1_spare_active updates the In_sync bit before the ->degraded count and so exposes an inconsistency, as does error() So extend the spinlock in raid1_spare_active() and error() to hide those inconsistencies. This should probably be part of Commit: 34cab6f42003 ("md/raid1: fix test for 'was read error from last working device'.") as it addresses the same issue. It fixes the same bug and should go to -stable for same reasons. Fixes: 76073054c95b ("md/raid1: clean up read_balance.") Signed-off-by: NeilBrown Signed-off-by: Greg Kroah-Hartman --- drivers/md/raid1.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index fa58438b298a58..72141ee60705d8 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1382,6 +1382,7 @@ static void error(struct mddev *mddev, struct md_rdev *rdev) { char b[BDEVNAME_SIZE]; struct r1conf *conf = mddev->private; + unsigned long flags; /* * If it is not operational, then we have already marked it as dead @@ -1401,14 +1402,13 @@ static void error(struct mddev *mddev, struct md_rdev *rdev) return; } set_bit(Blocked, &rdev->flags); + spin_lock_irqsave(&conf->device_lock, flags); if (test_and_clear_bit(In_sync, &rdev->flags)) { - unsigned long flags; - spin_lock_irqsave(&conf->device_lock, flags); mddev->degraded++; set_bit(Faulty, &rdev->flags); - spin_unlock_irqrestore(&conf->device_lock, flags); } else set_bit(Faulty, &rdev->flags); + spin_unlock_irqrestore(&conf->device_lock, flags); /* * if recovery is running, make sure it aborts. */ @@ -1466,7 +1466,10 @@ static int raid1_spare_active(struct mddev *mddev) * Find all failed disks within the RAID1 configuration * and mark them readable. * Called under mddev lock, so rcu protection not needed. + * device_lock used to avoid races with raid1_end_read_request + * which expects 'In_sync' flags and ->degraded to be consistent. */ + spin_lock_irqsave(&conf->device_lock, flags); for (i = 0; i < conf->raid_disks; i++) { struct md_rdev *rdev = conf->mirrors[i].rdev; struct md_rdev *repl = conf->mirrors[conf->raid_disks + i].rdev; @@ -1496,7 +1499,6 @@ static int raid1_spare_active(struct mddev *mddev) sysfs_notify_dirent_safe(rdev->sysfs_state); } } - spin_lock_irqsave(&conf->device_lock, flags); mddev->degraded -= count; spin_unlock_irqrestore(&conf->device_lock, flags); From 4d0dd4350a4107265fd8701d4b26fdc033ad28cc Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 21 Mar 2015 20:08:18 -0400 Subject: [PATCH 181/359] sg_start_req(): make sure that there's not too many elements in iovec commit 451a2886b6bf90e2fb378f7c46c655450fb96e81 upstream. unfortunately, allowing an arbitrary 16bit value means a possibility of overflow in the calculation of total number of pages in bio_map_user_iov() - we rely on there being no more than PAGE_SIZE members of sum in the first loop there. If that sum wraps around, we end up allocating too small array of pointers to pages and it's easy to overflow it in the second loop. X-Coverup: TINC (and there's no lumber cartel either) Signed-off-by: Al Viro [bwh: s/MAX_UIOVEC/UIO_MAXIOV/. This was fixed upstream by commit fdc81f45e9f5 ("sg_start_req(): use import_iovec()"), but we don't have that function.] Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/sg.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index eb81c98386b9d5..721d839d6c543c 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -1694,6 +1694,9 @@ static int sg_start_req(Sg_request *srp, unsigned char *cmd) md->from_user = 0; } + if (unlikely(iov_count > UIO_MAXIOV)) + return -EINVAL; + if (iov_count) { int len, size = sizeof(struct sg_iovec) * iov_count; struct iovec *iov; From 28d4d6e9df9093d372896e76f14bc21faba7f544 Mon Sep 17 00:00:00 2001 From: Russell King Date: Tue, 6 Aug 2013 09:48:42 +0100 Subject: [PATCH 182/359] ARM: Fix !kuser helpers case commit 1b16c4bcf80e319b2226a886b72b8466179c8e3a upstream. Fix yet another build failure caused by a weird set of configuration settings: LD init/built-in.o arch/arm/kernel/built-in.o: In function `__dabt_usr': /home/tom3q/kernel/arch/arm/kernel/entry-armv.S:377: undefined reference to `kuser_cmpxchg64_fixup' arch/arm/kernel/built-in.o: In function `__irq_usr': /home/tom3q/kernel/arch/arm/kernel/entry-armv.S:387: undefined reference to `kuser_cmpxchg64_fixup' caused by: CONFIG_KUSER_HELPERS=n CONFIG_CPU_32v6K=n CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG=n Reported-by: Tomasz Figa Signed-off-by: Russell King Cc: Martin Kaiser Signed-off-by: Greg Kroah-Hartman --- arch/arm/kernel/entry-armv.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index 32640ae7750f78..03a1e26ba3a35b 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S @@ -358,7 +358,8 @@ ENDPROC(__pabt_svc) .endm .macro kuser_cmpxchg_check -#if !defined(CONFIG_CPU_32v6K) && !defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG) +#if !defined(CONFIG_CPU_32v6K) && defined(CONFIG_KUSER_HELPERS) && \ + !defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG) #ifndef CONFIG_MMU #warning "NPTL on non MMU needs fixing" #else From 627cd1579c7620dfc22e21173291ba0f0bab0cd0 Mon Sep 17 00:00:00 2001 From: Russell King Date: Thu, 8 Aug 2013 11:51:21 +0100 Subject: [PATCH 183/359] ARM: Fix FIQ code on VIVT CPUs commit 2ba85e7af4c639d933c9a87a6d7363f2983d5ada upstream. Aaro Koskinen reports the following oops: Installing fiq handler from c001b110, length 0x164 Unable to handle kernel paging request at virtual address ffff1224 pgd = c0004000 [ffff1224] *pgd=00000000, *pte=11fff0cb, *ppte=11fff00a ... [] (set_fiq_handler+0x0/0x6c) from [] (ams_delta_init_fiq+0xa8/0x160) r6:00000164 r5:c001b110 r4:00000000 r3:fefecb4c [] (ams_delta_init_fiq+0x0/0x160) from [] (ams_delta_init+0xd4/0x114) r6:00000000 r5:fffece10 r4:c037a9e0 [] (ams_delta_init+0x0/0x114) from [] (customize_machine+0x24/0x30) This is because the vectors page is now write-protected, and to change code in there we must write to its original alias. Make that change, and adjust the cache flushing such that the code will become visible to the instruction stream on VIVT CPUs. Reported-by: Aaro Koskinen Tested-by: Aaro Koskinen Signed-off-by: Russell King Cc: Martin Kaiser Signed-off-by: Greg Kroah-Hartman --- arch/arm/kernel/fiq.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/arm/kernel/fiq.c b/arch/arm/kernel/fiq.c index 25442f451148ee..fc7920288a3d90 100644 --- a/arch/arm/kernel/fiq.c +++ b/arch/arm/kernel/fiq.c @@ -84,17 +84,13 @@ int show_fiq_list(struct seq_file *p, int prec) void set_fiq_handler(void *start, unsigned int length) { -#if defined(CONFIG_CPU_USE_DOMAINS) - void *base = (void *)0xffff0000; -#else void *base = vectors_page; -#endif unsigned offset = FIQ_OFFSET; memcpy(base + offset, start, length); + if (!cache_is_vipt_nonaliasing()) + flush_icache_range(base + offset, offset + length); flush_icache_range(0xffff0000 + offset, 0xffff0000 + offset + length); - if (!vectors_high()) - flush_icache_range(offset, offset + length); } int claim_fiq(struct fiq_handler *f) From 22ab6a2be78db078b11cc478bfc99cdc8e0642cb Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Fri, 16 Aug 2013 12:55:56 +0100 Subject: [PATCH 184/359] ARM: 7819/1: fiq: Cast the first argument of flush_icache_range() commit 7cb3be0a27805c625ff7cce20c53c926d9483243 upstream. Commit 2ba85e7af4 (ARM: Fix FIQ code on VIVT CPUs) causes the following build warning: arch/arm/kernel/fiq.c:92:3: warning: passing argument 1 of 'cpu_cache.coherent_kern_range' makes integer from pointer without a cast [enabled by default] Cast it as '(unsigned long)base' to avoid the warning. Signed-off-by: Fabio Estevam Signed-off-by: Russell King Cc: Martin Kaiser Signed-off-by: Greg Kroah-Hartman --- arch/arm/kernel/fiq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/kernel/fiq.c b/arch/arm/kernel/fiq.c index fc7920288a3d90..918875d96d5dc5 100644 --- a/arch/arm/kernel/fiq.c +++ b/arch/arm/kernel/fiq.c @@ -89,7 +89,8 @@ void set_fiq_handler(void *start, unsigned int length) memcpy(base + offset, start, length); if (!cache_is_vipt_nonaliasing()) - flush_icache_range(base + offset, offset + length); + flush_icache_range((unsigned long)base + offset, offset + + length); flush_icache_range(0xffff0000 + offset, 0xffff0000 + offset + length); } From 5c233bffdb9ffd2c85d1f94ddd8be956ee2b353f Mon Sep 17 00:00:00 2001 From: Amanieu d'Antras Date: Thu, 6 Aug 2015 15:46:33 -0700 Subject: [PATCH 185/359] signalfd: fix information leak in signalfd_copyinfo commit 3ead7c52bdb0ab44f4bb1feed505a8323cc12ba7 upstream. This function may copy the si_addr_lsb field to user mode when it hasn't been initialized, which can leak kernel stack data to user mode. Just checking the value of si_code is insufficient because the same si_code value is shared between multiple signals. This is solved by checking the value of si_signo in addition to si_code. Signed-off-by: Amanieu d'Antras Cc: Oleg Nesterov Cc: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- fs/signalfd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/signalfd.c b/fs/signalfd.c index 424b7b65321fec..148f8e7af88270 100644 --- a/fs/signalfd.c +++ b/fs/signalfd.c @@ -121,8 +121,9 @@ static int signalfd_copyinfo(struct signalfd_siginfo __user *uinfo, * Other callers might not initialize the si_lsb field, * so check explicitly for the right codes here. */ - if (kinfo->si_code == BUS_MCEERR_AR || - kinfo->si_code == BUS_MCEERR_AO) + if (kinfo->si_signo == SIGBUS && + (kinfo->si_code == BUS_MCEERR_AR || + kinfo->si_code == BUS_MCEERR_AO)) err |= __put_user((short) kinfo->si_addr_lsb, &uinfo->ssi_addr_lsb); #endif From 16a49557bc101b804a0a74d4032556f8836b9469 Mon Sep 17 00:00:00 2001 From: Amanieu d'Antras Date: Thu, 6 Aug 2015 15:46:29 -0700 Subject: [PATCH 186/359] signal: fix information leak in copy_siginfo_to_user commit 26135022f85105ad725cda103fa069e29e83bd16 upstream. This function may copy the si_addr_lsb, si_lower and si_upper fields to user mode when they haven't been initialized, which can leak kernel stack data to user mode. Just checking the value of si_code is insufficient because the same si_code value is shared between multiple signals. This is solved by checking the value of si_signo in addition to si_code. Signed-off-by: Amanieu d'Antras Cc: Oleg Nesterov Cc: Ingo Molnar Cc: Russell King Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- arch/arm64/kernel/signal32.c | 3 ++- kernel/signal.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kernel/signal32.c b/arch/arm64/kernel/signal32.c index 3d478102b1c015..efd1dde7094bb4 100644 --- a/arch/arm64/kernel/signal32.c +++ b/arch/arm64/kernel/signal32.c @@ -193,7 +193,8 @@ int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from) * Other callers might not initialize the si_lsb field, * so check explicitely for the right codes here. */ - if (from->si_code == BUS_MCEERR_AR || from->si_code == BUS_MCEERR_AO) + if (from->si_signo == SIGBUS && + (from->si_code == BUS_MCEERR_AR || from->si_code == BUS_MCEERR_AO)) err |= __put_user(from->si_addr_lsb, &to->si_addr_lsb); #endif break; diff --git a/kernel/signal.c b/kernel/signal.c index 113411bfe8b120..fa80d104cbec2d 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -2768,7 +2768,8 @@ int copy_siginfo_to_user(siginfo_t __user *to, siginfo_t *from) * Other callers might not initialize the si_lsb field, * so check explicitly for the right codes here. */ - if (from->si_code == BUS_MCEERR_AR || from->si_code == BUS_MCEERR_AO) + if (from->si_signo == SIGBUS && + (from->si_code == BUS_MCEERR_AR || from->si_code == BUS_MCEERR_AO)) err |= __put_user(from->si_addr_lsb, &to->si_addr_lsb); #endif break; From a6bb935312e2c20c95af0789ec84af4a6bcd5596 Mon Sep 17 00:00:00 2001 From: Amanieu d'Antras Date: Thu, 6 Aug 2015 15:46:26 -0700 Subject: [PATCH 187/359] signal: fix information leak in copy_siginfo_from_user32 commit 3c00cb5e68dc719f2fc73a33b1b230aadfcb1309 upstream. This function can leak kernel stack data when the user siginfo_t has a positive si_code value. The top 16 bits of si_code descibe which fields in the siginfo_t union are active, but they are treated inconsistently between copy_siginfo_from_user32, copy_siginfo_to_user32 and copy_siginfo_to_user. copy_siginfo_from_user32 is called from rt_sigqueueinfo and rt_tgsigqueueinfo in which the user has full control overthe top 16 bits of si_code. This fixes the following information leaks: x86: 8 bytes leaked when sending a signal from a 32-bit process to itself. This leak grows to 16 bytes if the process uses x32. (si_code = __SI_CHLD) x86: 100 bytes leaked when sending a signal from a 32-bit process to a 64-bit process. (si_code = -1) sparc: 4 bytes leaked when sending a signal from a 32-bit process to a 64-bit process. (si_code = any) parsic and s390 have similar bugs, but they are not vulnerable because rt_[tg]sigqueueinfo have checks that prevent sending a positive si_code to a different process. These bugs are also fixed for consistency. Signed-off-by: Amanieu d'Antras Cc: Oleg Nesterov Cc: Ingo Molnar Cc: Russell King Cc: Ralf Baechle Cc: Benjamin Herrenschmidt Cc: Chris Metcalf Cc: Paul Mackerras Cc: Michael Ellerman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- arch/arm64/kernel/signal32.c | 2 -- arch/mips/kernel/signal32.c | 2 -- arch/powerpc/kernel/signal_32.c | 2 -- kernel/signal.c | 4 ++-- 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/arch/arm64/kernel/signal32.c b/arch/arm64/kernel/signal32.c index efd1dde7094bb4..b9564b8d6bab4b 100644 --- a/arch/arm64/kernel/signal32.c +++ b/arch/arm64/kernel/signal32.c @@ -221,8 +221,6 @@ int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from) int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from) { - memset(to, 0, sizeof *to); - if (copy_from_user(to, from, __ARCH_SI_PREAMBLE_SIZE) || copy_from_user(to->_sifields._pad, from->_sifields._pad, SI_PAD_SIZE)) diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c index 57de8b751627be..41f8708d21a868 100644 --- a/arch/mips/kernel/signal32.c +++ b/arch/mips/kernel/signal32.c @@ -368,8 +368,6 @@ int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from) int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from) { - memset(to, 0, sizeof *to); - if (copy_from_user(to, from, 3*sizeof(int)) || copy_from_user(to->_sifields._pad, from->_sifields._pad, SI_PAD_SIZE32)) diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c index 81f929f026f2de..d9b673b06757e6 100644 --- a/arch/powerpc/kernel/signal_32.c +++ b/arch/powerpc/kernel/signal_32.c @@ -949,8 +949,6 @@ int copy_siginfo_to_user32(struct compat_siginfo __user *d, siginfo_t *s) int copy_siginfo_from_user32(siginfo_t *to, struct compat_siginfo __user *from) { - memset(to, 0, sizeof *to); - if (copy_from_user(to, from, 3*sizeof(int)) || copy_from_user(to->_sifields._pad, from->_sifields._pad, SI_PAD_SIZE32)) diff --git a/kernel/signal.c b/kernel/signal.c index fa80d104cbec2d..2e51bcbea1e3f9 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -3036,7 +3036,7 @@ COMPAT_SYSCALL_DEFINE3(rt_sigqueueinfo, int, sig, struct compat_siginfo __user *, uinfo) { - siginfo_t info; + siginfo_t info = {}; int ret = copy_siginfo_from_user32(&info, uinfo); if (unlikely(ret)) return ret; @@ -3082,7 +3082,7 @@ COMPAT_SYSCALL_DEFINE4(rt_tgsigqueueinfo, int, sig, struct compat_siginfo __user *, uinfo) { - siginfo_t info; + siginfo_t info = {}; if (copy_siginfo_from_user32(&info, uinfo)) return -EFAULT; From d7a681b77df62857104797f0ebfb47eb6fdc37c6 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Sat, 30 May 2015 14:31:24 +0200 Subject: [PATCH 188/359] kvm: x86: fix kvm_apic_has_events to check for NULL pointer commit ce40cd3fc7fa40a6119e5fe6c0f2bc0eb4541009 upstream. Malicious (or egregiously buggy) userspace can trigger it, but it should never happen in normal operation. Signed-off-by: Paolo Bonzini Signed-off-by: Wang Kai Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/lapic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/lapic.h b/arch/x86/kvm/lapic.h index c8b0d0d2da5ce2..fc87568fc40931 100644 --- a/arch/x86/kvm/lapic.h +++ b/arch/x86/kvm/lapic.h @@ -165,7 +165,7 @@ static inline u16 apic_logical_id(struct kvm_apic_map *map, u32 ldr) static inline bool kvm_apic_has_events(struct kvm_vcpu *vcpu) { - return vcpu->arch.apic->pending_events; + return kvm_vcpu_has_lapic(vcpu) && vcpu->arch.apic->pending_events; } bool kvm_apic_pending_eoi(struct kvm_vcpu *vcpu, int vector); From bc0a524cd874cb33146b641c4c8152a22b7da070 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 14 Aug 2015 17:04:21 +1000 Subject: [PATCH 189/359] md/bitmap: return an error when bitmap superblock is corrupt. commit b97e92574c0bf335db1cd2ec491d8ff5cd5d0b49 upstream Use separate bitmaps for each nodes in the cluster bitmap_read_sb() validates the bitmap superblock that it reads in. If it finds an inconsistency like a bad magic number or out-of-range version number, it prints an error and returns, but it incorrectly returns zero, so the array is still assembled with the (invalid) bitmap. This means it could try to use a bitmap with a new version number which it therefore does not understand. This bug was introduced in 3.5 and fix as part of a larger patch in 4.1. So the patch is suitable for any -stable kernel in that range. Fixes: 27581e5ae01f ("md/bitmap: centralise allocation of bitmap file pages.") Signed-off-by: NeilBrown Reported-by: GuoQing Jiang --- drivers/md/bitmap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index a79cbd6038f6ec..37470ee7c8509e 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c @@ -564,6 +564,8 @@ static int bitmap_read_sb(struct bitmap *bitmap) if (err) return err; + err = -EINVAL; + sb = kmap_atomic(sb_page); chunksize = le32_to_cpu(sb->chunksize); From 022d35a6db3423a7354f4d3467871eb389c04ddd Mon Sep 17 00:00:00 2001 From: Michal Hocko Date: Tue, 4 Aug 2015 14:36:58 -0700 Subject: [PATCH 190/359] mm, vmscan: Do not wait for page writeback for GFP_NOFS allocations commit ecf5fc6e9654cd7a268c782a523f072b2f1959f9 upstream. Nikolay has reported a hang when a memcg reclaim got stuck with the following backtrace: PID: 18308 TASK: ffff883d7c9b0a30 CPU: 1 COMMAND: "rsync" #0 __schedule at ffffffff815ab152 #1 schedule at ffffffff815ab76e #2 schedule_timeout at ffffffff815ae5e5 #3 io_schedule_timeout at ffffffff815aad6a #4 bit_wait_io at ffffffff815abfc6 #5 __wait_on_bit at ffffffff815abda5 #6 wait_on_page_bit at ffffffff8111fd4f #7 shrink_page_list at ffffffff81135445 #8 shrink_inactive_list at ffffffff81135845 #9 shrink_lruvec at ffffffff81135ead #10 shrink_zone at ffffffff811360c3 #11 shrink_zones at ffffffff81136eff #12 do_try_to_free_pages at ffffffff8113712f #13 try_to_free_mem_cgroup_pages at ffffffff811372be #14 try_charge at ffffffff81189423 #15 mem_cgroup_try_charge at ffffffff8118c6f5 #16 __add_to_page_cache_locked at ffffffff8112137d #17 add_to_page_cache_lru at ffffffff81121618 #18 pagecache_get_page at ffffffff8112170b #19 grow_dev_page at ffffffff811c8297 #20 __getblk_slow at ffffffff811c91d6 #21 __getblk_gfp at ffffffff811c92c1 #22 ext4_ext_grow_indepth at ffffffff8124565c #23 ext4_ext_create_new_leaf at ffffffff81246ca8 #24 ext4_ext_insert_extent at ffffffff81246f09 #25 ext4_ext_map_blocks at ffffffff8124a848 #26 ext4_map_blocks at ffffffff8121a5b7 #27 mpage_map_one_extent at ffffffff8121b1fa #28 mpage_map_and_submit_extent at ffffffff8121f07b #29 ext4_writepages at ffffffff8121f6d5 #30 do_writepages at ffffffff8112c490 #31 __filemap_fdatawrite_range at ffffffff81120199 #32 filemap_flush at ffffffff8112041c #33 ext4_alloc_da_blocks at ffffffff81219da1 #34 ext4_rename at ffffffff81229b91 #35 ext4_rename2 at ffffffff81229e32 #36 vfs_rename at ffffffff811a08a5 #37 SYSC_renameat2 at ffffffff811a3ffc #38 sys_renameat2 at ffffffff811a408e #39 sys_rename at ffffffff8119e51e #40 system_call_fastpath at ffffffff815afa89 Dave Chinner has properly pointed out that this is a deadlock in the reclaim code because ext4 doesn't submit pages which are marked by PG_writeback right away. The heuristic was introduced by commit e62e384e9da8 ("memcg: prevent OOM with too many dirty pages") and it was applied only when may_enter_fs was specified. The code has been changed by c3b94f44fcb0 ("memcg: further prevent OOM with too many dirty pages") which has removed the __GFP_FS restriction with a reasoning that we do not get into the fs code. But this is not sufficient apparently because the fs doesn't necessarily submit pages marked PG_writeback for IO right away. ext4_bio_write_page calls io_submit_add_bh but that doesn't necessarily submit the bio. Instead it tries to map more pages into the bio and mpage_map_one_extent might trigger memcg charge which might end up waiting on a page which is marked PG_writeback but hasn't been submitted yet so we would end up waiting for something that never finishes. Fix this issue by replacing __GFP_IO by may_enter_fs check (for case 2) before we go to wait on the writeback. The page fault path, which is the only path that triggers memcg oom killer since 3.12, shouldn't require GFP_NOFS and so we shouldn't reintroduce the premature OOM killer issue which was originally addressed by the heuristic. As per David Chinner the xfs is doing similar thing since 2.6.15 already so ext4 is not the only affected filesystem. Moreover he notes: : For example: IO completion might require unwritten extent conversion : which executes filesystem transactions and GFP_NOFS allocations. The : writeback flag on the pages can not be cleared until unwritten : extent conversion completes. Hence memory reclaim cannot wait on : page writeback to complete in GFP_NOFS context because it is not : safe to do so, memcg reclaim or otherwise. [tytso@mit.edu: corrected the control flow] Fixes: c3b94f44fcb0 ("memcg: further prevent OOM with too many dirty pages") Reported-by: Nikolay Borisov Signed-off-by: Michal Hocko Signed-off-by: Hugh Dickins Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- mm/vmscan.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index a2fd7e759cb766..233f0011f7680d 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -730,20 +730,15 @@ static unsigned long shrink_page_list(struct list_head *page_list, * could easily OOM just because too many pages are in * writeback and there is nothing else to reclaim. * - * Check __GFP_IO, certainly because a loop driver + * Require may_enter_fs to wait on writeback, because + * fs may not have submitted IO yet. And a loop driver * thread might enter reclaim, and deadlock if it waits * on a page for which it is needed to do the write * (loop masks off __GFP_IO|__GFP_FS for this reason); * but more thought would probably show more reasons. - * - * Don't require __GFP_FS, since we're not going into - * the FS, just waiting on its writeback completion. - * Worryingly, ext4 gfs2 and xfs allocate pages with - * grab_cache_page_write_begin(,,AOP_FLAG_NOFS), so - * testing may_enter_fs here is liable to OOM on them. */ if (global_reclaim(sc) || - !PageReclaim(page) || !(sc->gfp_mask & __GFP_IO)) { + !PageReclaim(page) || !may_enter_fs) { /* * This is slightly racy - end_page_writeback() * might have just cleared PageReclaim, then From 5a427ce18a14d6b85972c62196a8f10c3624d74a Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 16 Aug 2015 20:52:24 -0700 Subject: [PATCH 191/359] Linux 3.10.87 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 25ee724c908946..0d4fd64273491a 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 10 -SUBLEVEL = 86 +SUBLEVEL = 87 EXTRAVERSION = NAME = TOSSUG Baby Fish From 04d2af28546d8ae1c889df3938a11c38ce0e3463 Mon Sep 17 00:00:00 2001 From: "Herton R. Krzesinski" Date: Fri, 14 Aug 2015 15:35:02 -0700 Subject: [PATCH 192/359] ipc,sem: fix use after free on IPC_RMID after a task using same semaphore set exits commit 602b8593d2b4138c10e922eeaafe306f6b51817b upstream. The current semaphore code allows a potential use after free: in exit_sem we may free the task's sem_undo_list while there is still another task looping through the same semaphore set and cleaning the sem_undo list at freeary function (the task called IPC_RMID for the same semaphore set). For example, with a test program [1] running which keeps forking a lot of processes (which then do a semop call with SEM_UNDO flag), and with the parent right after removing the semaphore set with IPC_RMID, and a kernel built with CONFIG_SLAB, CONFIG_SLAB_DEBUG and CONFIG_DEBUG_SPINLOCK, you can easily see something like the following in the kernel log: Slab corruption (Not tainted): kmalloc-64 start=ffff88003b45c1c0, len=64 000: 6b 6b 6b 6b 6b 6b 6b 6b 00 6b 6b 6b 6b 6b 6b 6b kkkkkkkk.kkkkkkk 010: ff ff ff ff 6b 6b 6b 6b ff ff ff ff ff ff ff ff ....kkkk........ Prev obj: start=ffff88003b45c180, len=64 000: 00 00 00 00 ad 4e ad de ff ff ff ff 5a 5a 5a 5a .....N......ZZZZ 010: ff ff ff ff ff ff ff ff c0 fb 01 37 00 88 ff ff ...........7.... Next obj: start=ffff88003b45c200, len=64 000: 00 00 00 00 ad 4e ad de ff ff ff ff 5a 5a 5a 5a .....N......ZZZZ 010: ff ff ff ff ff ff ff ff 68 29 a7 3c 00 88 ff ff ........h).<.... BUG: spinlock wrong CPU on CPU#2, test/18028 general protection fault: 0000 [#1] SMP Modules linked in: 8021q mrp garp stp llc nf_conntrack_ipv4 nf_defrag_ipv4 ip6t_REJECT nf_reject_ipv6 nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables binfmt_misc ppdev input_leds joydev parport_pc parport floppy serio_raw virtio_balloon virtio_rng virtio_console virtio_net iosf_mbi crct10dif_pclmul crc32_pclmul ghash_clmulni_intel pcspkr qxl ttm drm_kms_helper drm snd_hda_codec_generic i2c_piix4 snd_hda_intel snd_hda_codec snd_hda_core snd_hwdep snd_seq snd_seq_device snd_pcm snd_timer snd soundcore crc32c_intel virtio_pci virtio_ring virtio pata_acpi ata_generic [last unloaded: speedstep_lib] CPU: 2 PID: 18028 Comm: test Not tainted 4.2.0-rc5+ #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.8.1-20150318_183358- 04/01/2014 RIP: spin_dump+0x53/0xc0 Call Trace: spin_bug+0x30/0x40 do_raw_spin_unlock+0x71/0xa0 _raw_spin_unlock+0xe/0x10 freeary+0x82/0x2a0 ? _raw_spin_lock+0xe/0x10 semctl_down.clone.0+0xce/0x160 ? __do_page_fault+0x19a/0x430 ? __audit_syscall_entry+0xa8/0x100 SyS_semctl+0x236/0x2c0 ? syscall_trace_leave+0xde/0x130 entry_SYSCALL_64_fastpath+0x12/0x71 Code: 8b 80 88 03 00 00 48 8d 88 60 05 00 00 48 c7 c7 a0 2c a4 81 31 c0 65 8b 15 eb 40 f3 7e e8 08 31 68 00 4d 85 e4 44 8b 4b 08 74 5e <45> 8b 84 24 88 03 00 00 49 8d 8c 24 60 05 00 00 8b 53 04 48 89 RIP [] spin_dump+0x53/0xc0 RSP ---[ end trace 783ebb76612867a0 ]--- NMI watchdog: BUG: soft lockup - CPU#3 stuck for 22s! [test:18053] Modules linked in: 8021q mrp garp stp llc nf_conntrack_ipv4 nf_defrag_ipv4 ip6t_REJECT nf_reject_ipv6 nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables binfmt_misc ppdev input_leds joydev parport_pc parport floppy serio_raw virtio_balloon virtio_rng virtio_console virtio_net iosf_mbi crct10dif_pclmul crc32_pclmul ghash_clmulni_intel pcspkr qxl ttm drm_kms_helper drm snd_hda_codec_generic i2c_piix4 snd_hda_intel snd_hda_codec snd_hda_core snd_hwdep snd_seq snd_seq_device snd_pcm snd_timer snd soundcore crc32c_intel virtio_pci virtio_ring virtio pata_acpi ata_generic [last unloaded: speedstep_lib] CPU: 3 PID: 18053 Comm: test Tainted: G D 4.2.0-rc5+ #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.8.1-20150318_183358- 04/01/2014 RIP: native_read_tsc+0x0/0x20 Call Trace: ? delay_tsc+0x40/0x70 __delay+0xf/0x20 do_raw_spin_lock+0x96/0x140 _raw_spin_lock+0xe/0x10 sem_lock_and_putref+0x11/0x70 SYSC_semtimedop+0x7bf/0x960 ? handle_mm_fault+0xbf6/0x1880 ? dequeue_task_fair+0x79/0x4a0 ? __do_page_fault+0x19a/0x430 ? kfree_debugcheck+0x16/0x40 ? __do_page_fault+0x19a/0x430 ? __audit_syscall_entry+0xa8/0x100 ? do_audit_syscall_entry+0x66/0x70 ? syscall_trace_enter_phase1+0x139/0x160 SyS_semtimedop+0xe/0x10 SyS_semop+0x10/0x20 entry_SYSCALL_64_fastpath+0x12/0x71 Code: 47 10 83 e8 01 85 c0 89 47 10 75 08 65 48 89 3d 1f 74 ff 7e c9 c3 0f 1f 44 00 00 55 48 89 e5 e8 87 17 04 00 66 90 c9 c3 0f 1f 00 <55> 48 89 e5 0f 31 89 c1 48 89 d0 48 c1 e0 20 89 c9 48 09 c8 c9 Kernel panic - not syncing: softlockup: hung tasks I wasn't able to trigger any badness on a recent kernel without the proper config debugs enabled, however I have softlockup reports on some kernel versions, in the semaphore code, which are similar as above (the scenario is seen on some servers running IBM DB2 which uses semaphore syscalls). The patch here fixes the race against freeary, by acquiring or waiting on the sem_undo_list lock as necessary (exit_sem can race with freeary, while freeary sets un->semid to -1 and removes the same sem_undo from list_proc or when it removes the last sem_undo). After the patch I'm unable to reproduce the problem using the test case [1]. [1] Test case used below: #include #include #include #include #include #include #include #include #include #define NSEM 1 #define NSET 5 int sid[NSET]; void thread() { struct sembuf op; int s; uid_t pid = getuid(); s = rand() % NSET; op.sem_num = pid % NSEM; op.sem_op = 1; op.sem_flg = SEM_UNDO; semop(sid[s], &op, 1); exit(EXIT_SUCCESS); } void create_set() { int i, j; pid_t p; union { int val; struct semid_ds *buf; unsigned short int *array; struct seminfo *__buf; } un; /* Create and initialize semaphore set */ for (i = 0; i < NSET; i++) { sid[i] = semget(IPC_PRIVATE , NSEM, 0644 | IPC_CREAT); if (sid[i] < 0) { perror("semget"); exit(EXIT_FAILURE); } } un.val = 0; for (i = 0; i < NSET; i++) { for (j = 0; j < NSEM; j++) { if (semctl(sid[i], j, SETVAL, un) < 0) perror("semctl"); } } /* Launch threads that operate on semaphore set */ for (i = 0; i < NSEM * NSET * NSET; i++) { p = fork(); if (p < 0) perror("fork"); if (p == 0) thread(); } /* Free semaphore set */ for (i = 0; i < NSET; i++) { if (semctl(sid[i], NSEM, IPC_RMID)) perror("IPC_RMID"); } /* Wait for forked processes to exit */ while (wait(NULL)) { if (errno == ECHILD) break; }; } int main(int argc, char **argv) { pid_t p; srand(time(NULL)); while (1) { p = fork(); if (p < 0) { perror("fork"); exit(EXIT_FAILURE); } if (p == 0) { create_set(); goto end; } /* Wait for forked processes to exit */ while (wait(NULL)) { if (errno == ECHILD) break; }; } end: return 0; } [akpm@linux-foundation.org: use normal comment layout] Signed-off-by: Herton R. Krzesinski Acked-by: Manfred Spraul Cc: Davidlohr Bueso Cc: Rafael Aquini CC: Aristeu Rozanski Cc: David Jeffery Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman Signed-off-by: Linus Torvalds --- ipc/sem.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/ipc/sem.c b/ipc/sem.c index db9d241af133d7..afb0e62af95676 100644 --- a/ipc/sem.c +++ b/ipc/sem.c @@ -2049,17 +2049,28 @@ void exit_sem(struct task_struct *tsk) rcu_read_lock(); un = list_entry_rcu(ulp->list_proc.next, struct sem_undo, list_proc); - if (&un->list_proc == &ulp->list_proc) - semid = -1; - else - semid = un->semid; + if (&un->list_proc == &ulp->list_proc) { + /* + * We must wait for freeary() before freeing this ulp, + * in case we raced with last sem_undo. There is a small + * possibility where we exit while freeary() didn't + * finish unlocking sem_undo_list. + */ + spin_unlock_wait(&ulp->lock); + rcu_read_unlock(); + break; + } + spin_lock(&ulp->lock); + semid = un->semid; + spin_unlock(&ulp->lock); + /* exit_sem raced with IPC_RMID, nothing to do */ if (semid == -1) { rcu_read_unlock(); - break; + continue; } - sma = sem_obtain_object_check(tsk->nsproxy->ipc_ns, un->semid); + sma = sem_obtain_object_check(tsk->nsproxy->ipc_ns, semid); /* exit_sem raced with IPC_RMID, nothing to do */ if (IS_ERR(sma)) { rcu_read_unlock(); From 30e5bc30f582e58bb2ee1b89838384dd9e9f9809 Mon Sep 17 00:00:00 2001 From: Manfred Spraul Date: Fri, 14 Aug 2015 15:35:10 -0700 Subject: [PATCH 193/359] ipc/sem.c: update/correct memory barriers commit 3ed1f8a99d70ea1cd1508910eb107d0edcae5009 upstream. sem_lock() did not properly pair memory barriers: !spin_is_locked() and spin_unlock_wait() are both only control barriers. The code needs an acquire barrier, otherwise the cpu might perform read operations before the lock test. As no primitive exists inside and since it seems noone wants another primitive, the code creates a local primitive within ipc/sem.c. With regards to -stable: The change of sem_wait_array() is a bugfix, the change to sem_lock() is a nop (just a preprocessor redefinition to improve the readability). The bugfix is necessary for all kernels that use sem_wait_array() (i.e.: starting from 3.10). Signed-off-by: Manfred Spraul Reported-by: Oleg Nesterov Acked-by: Peter Zijlstra (Intel) Cc: "Paul E. McKenney" Cc: Kirill Tkhai Cc: Ingo Molnar Cc: Josh Poimboeuf Cc: Davidlohr Bueso Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- ipc/sem.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/ipc/sem.c b/ipc/sem.c index afb0e62af95676..47a15192b8b879 100644 --- a/ipc/sem.c +++ b/ipc/sem.c @@ -252,6 +252,16 @@ static void sem_rcu_free(struct rcu_head *head) ipc_rcu_free(head); } +/* + * spin_unlock_wait() and !spin_is_locked() are not memory barriers, they + * are only control barriers. + * The code must pair with spin_unlock(&sem->lock) or + * spin_unlock(&sem_perm.lock), thus just the control barrier is insufficient. + * + * smp_rmb() is sufficient, as writes cannot pass the control barrier. + */ +#define ipc_smp_acquire__after_spin_is_unlocked() smp_rmb() + /* * Wait until all currently ongoing simple ops have completed. * Caller must own sem_perm.lock. @@ -275,6 +285,7 @@ static void sem_wait_array(struct sem_array *sma) sem = sma->sem_base + i; spin_unlock_wait(&sem->lock); } + ipc_smp_acquire__after_spin_is_unlocked(); } /* @@ -326,8 +337,13 @@ static inline int sem_lock(struct sem_array *sma, struct sembuf *sops, /* Then check that the global lock is free */ if (!spin_is_locked(&sma->sem_perm.lock)) { - /* spin_is_locked() is not a memory barrier */ - smp_mb(); + /* + * We need a memory barrier with acquire semantics, + * otherwise we can race with another thread that does: + * complex_count++; + * spin_unlock(sem_perm.lock); + */ + ipc_smp_acquire__after_spin_is_unlocked(); /* Now repeat the test of complex_count: * It can't change anymore until we drop sem->lock. From 50deac6cf762a571d99f6154ad7ef709bdfd6e8c Mon Sep 17 00:00:00 2001 From: Wanpeng Li Date: Fri, 14 Aug 2015 15:34:56 -0700 Subject: [PATCH 194/359] mm/hwpoison: fix page refcount of unknown non LRU page commit 4f32be677b124a49459e2603321c7a5605ceb9f8 upstream. After trying to drain pages from pagevec/pageset, we try to get reference count of the page again, however, the reference count of the page is not reduced if the page is still not on LRU list. Fix it by adding the put_page() to drop the page reference which is from __get_any_page(). Signed-off-by: Wanpeng Li Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- mm/memory-failure.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index ca96f411b0346c..f97d709594e611 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1473,6 +1473,8 @@ static int get_any_page(struct page *page, unsigned long pfn, int flags) */ ret = __get_any_page(page, pfn, 0); if (!PageLRU(page)) { + /* Drop page reference which is from __get_any_page() */ + put_page(page); pr_info("soft_offline: %#lx: unknown non LRU page type %lx\n", pfn, page->flags); return -EIO; From 1f6661e25639001c9fb5922affe9392b3729fff9 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Thu, 11 Jun 2015 10:32:01 +0200 Subject: [PATCH 195/359] perf: Fix fasync handling on inherited events commit fed66e2cdd4f127a43fd11b8d92a99bdd429528c upstream. Vince reported that the fasync signal stuff doesn't work proper for inherited events. So fix that. Installing fasync allocates memory and sets filp->f_flags |= FASYNC, which upon the demise of the file descriptor ensures the allocation is freed and state is updated. Now for perf, we can have the events stick around for a while after the original FD is dead because of references from child events. So we cannot copy the fasync pointer around. We can however consistently use the parent's fasync, as that will be updated. Reported-and-Tested-by: Vince Weaver Signed-off-by: Peter Zijlstra (Intel) Cc: Arnaldo Carvalho deMelo Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: eranian@google.com Link: http://lkml.kernel.org/r/1434011521.1495.71.camel@twins Signed-off-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman --- kernel/events/core.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/kernel/events/core.c b/kernel/events/core.c index 7daf52c340cdfb..d9b0aad17dbf73 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -3993,12 +3993,20 @@ static const struct file_operations perf_fops = { * to user-space before waking everybody up. */ +static inline struct fasync_struct **perf_event_fasync(struct perf_event *event) +{ + /* only the parent has fasync state */ + if (event->parent) + event = event->parent; + return &event->fasync; +} + void perf_event_wakeup(struct perf_event *event) { ring_buffer_wakeup(event); if (event->pending_kill) { - kill_fasync(&event->fasync, SIGIO, event->pending_kill); + kill_fasync(perf_event_fasync(event), SIGIO, event->pending_kill); event->pending_kill = 0; } } @@ -5153,7 +5161,7 @@ static int __perf_event_overflow(struct perf_event *event, else perf_event_output(event, data, regs); - if (event->fasync && event->pending_kill) { + if (*perf_event_fasync(event) && event->pending_kill) { event->pending_wakeup = 1; irq_work_queue(&event->pending); } From 9cdd5586f1e836ffd877c79c74240ee46fea5bd3 Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Wed, 12 Aug 2015 15:10:21 +0100 Subject: [PATCH 196/359] dm thin metadata: delete btrees when releasing metadata snapshot commit 7f518ad0a212e2a6fd68630e176af1de395070a7 upstream. The device details and mapping trees were just being decremented before. Now btree_del() is called to do a deep delete. Signed-off-by: Joe Thornber Signed-off-by: Mike Snitzer Signed-off-by: Greg Kroah-Hartman --- drivers/md/dm-thin-metadata.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c index 3b1503dc1f13e4..43f6250baadd88 100644 --- a/drivers/md/dm-thin-metadata.c +++ b/drivers/md/dm-thin-metadata.c @@ -1281,8 +1281,8 @@ static int __release_metadata_snap(struct dm_pool_metadata *pmd) return r; disk_super = dm_block_data(copy); - dm_sm_dec_block(pmd->metadata_sm, le64_to_cpu(disk_super->data_mapping_root)); - dm_sm_dec_block(pmd->metadata_sm, le64_to_cpu(disk_super->device_details_root)); + dm_btree_del(&pmd->info, le64_to_cpu(disk_super->data_mapping_root)); + dm_btree_del(&pmd->details_info, le64_to_cpu(disk_super->device_details_root)); dm_sm_dec_block(pmd->metadata_sm, held_root); return dm_tm_unlock(pmd->tm, copy); From 98e5059b209ae26f4d4fee4615d819183ed99ee8 Mon Sep 17 00:00:00 2001 From: Richard Weinberger Date: Mon, 27 Jul 2015 00:06:55 +0200 Subject: [PATCH 197/359] localmodconfig: Use Kbuild files too commit c0ddc8c745b7f89c50385fd7aa03c78dc543fa7a upstream. In kbuild it is allowed to define objects in files named "Makefile" and "Kbuild". Currently localmodconfig reads objects only from "Makefile"s and misses modules like nouveau. Link: http://lkml.kernel.org/r/1437948415-16290-1-git-send-email-richard@nod.at Reported-and-tested-by: Leonidas Spyropoulos Signed-off-by: Richard Weinberger Signed-off-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman --- scripts/kconfig/streamline_config.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl index 4606cdfb859d59..7dd7c391b4d8ca 100644 --- a/scripts/kconfig/streamline_config.pl +++ b/scripts/kconfig/streamline_config.pl @@ -137,7 +137,7 @@ sub read_config { my $kconfig = $ARGV[1]; my $lsmod_file = $ENV{'LSMOD'}; -my @makefiles = `find $ksource -name Makefile 2>/dev/null`; +my @makefiles = `find $ksource -name Makefile -or -name Kbuild 2>/dev/null`; chomp @makefiles; my %depends; From 94c379756b6749d7641f883fa5307abe9da3964c Mon Sep 17 00:00:00 2001 From: Michael Walle Date: Tue, 21 Jul 2015 11:00:53 +0200 Subject: [PATCH 198/359] EDAC, ppc4xx: Access mci->csrows array elements properly commit 5c16179b550b9fd8114637a56b153c9768ea06a5 upstream. The commit de3910eb79ac ("edac: change the mem allocation scheme to make Documentation/kobject.txt happy") changed the memory allocation for the csrows member. But ppc4xx_edac was forgotten in the patch. Fix it. Signed-off-by: Michael Walle Cc: linux-edac Cc: Mauro Carvalho Chehab Link: http://lkml.kernel.org/r/1437469253-8611-1-git-send-email-michael@walle.cc Signed-off-by: Borislav Petkov Signed-off-by: Greg Kroah-Hartman --- drivers/edac/ppc4xx_edac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/edac/ppc4xx_edac.c b/drivers/edac/ppc4xx_edac.c index ef6b7e08f48568..5c361f3c66aadc 100644 --- a/drivers/edac/ppc4xx_edac.c +++ b/drivers/edac/ppc4xx_edac.c @@ -921,7 +921,7 @@ static int ppc4xx_edac_init_csrows(struct mem_ctl_info *mci, u32 mcopt1) */ for (row = 0; row < mci->nr_csrows; row++) { - struct csrow_info *csi = &mci->csrows[row]; + struct csrow_info *csi = mci->csrows[row]; /* * Get the configuration settings for this From e7e8231c599e65e783eda3cd399c2b88032ff42d Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 10 Aug 2015 15:28:49 -0400 Subject: [PATCH 199/359] drm/radeon: add new OLAND pci id commit e037239e5e7b61007763984aa35a8329596d8c88 upstream. Signed-off-by: Alex Deucher Signed-off-by: Greg Kroah-Hartman --- include/drm/drm_pciids.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h index d7b717090f2f29..2b5c3bc3b0814e 100644 --- a/include/drm/drm_pciids.h +++ b/include/drm/drm_pciids.h @@ -150,6 +150,7 @@ {0x1002, 0x6610, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6611, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6613, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_NEW_MEMMAP}, \ + {0x1002, 0x6617, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6620, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6621, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6623, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ From 0a1b726993ae45ffda33dde0a5760926f682faf8 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 5 Jun 2015 14:20:51 -0700 Subject: [PATCH 200/359] libfc: Fix fc_fcp_cleanup_each_cmd() commit 8f2777f53e3d5ad8ef2a176a4463a5c8e1a16431 upstream. Since fc_fcp_cleanup_cmd() can sleep this function must not be called while holding a spinlock. This patch avoids that fc_fcp_cleanup_each_cmd() triggers the following bug: BUG: scheduling while atomic: sg_reset/1512/0x00000202 1 lock held by sg_reset/1512: #0: (&(&fsp->scsi_pkt_lock)->rlock){+.-...}, at: [] fc_fcp_cleanup_each_cmd.isra.21+0xa5/0x150 [libfc] Preemption disabled at:[] fc_fcp_cleanup_each_cmd.isra.21+0xa5/0x150 [libfc] Call Trace: [] dump_stack+0x4f/0x7b [] __schedule_bug+0x6c/0xd0 [] __schedule+0x71a/0xa10 [] schedule+0x32/0x80 [] fc_seq_set_resp+0xac/0x100 [libfc] [] fc_exch_done+0x41/0x60 [libfc] [] fc_fcp_cleanup_each_cmd.isra.21+0xcf/0x150 [libfc] [] fc_eh_device_reset+0x1c3/0x270 [libfc] [] scsi_try_bus_device_reset+0x29/0x60 [] scsi_ioctl_reset+0x258/0x2d0 [] scsi_ioctl+0x150/0x440 [] sd_ioctl+0xad/0x120 [] blkdev_ioctl+0x1b6/0x810 [] block_ioctl+0x38/0x40 [] do_vfs_ioctl+0x2f8/0x530 [] SyS_ioctl+0x81/0xa0 [] system_call_fastpath+0x16/0x7a Signed-off-by: Bart Van Assche Signed-off-by: Vasu Dev Signed-off-by: James Bottomley Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/libfc/fc_fcp.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c index 09c81b2f216988..42c46dc19537ab 100644 --- a/drivers/scsi/libfc/fc_fcp.c +++ b/drivers/scsi/libfc/fc_fcp.c @@ -1039,11 +1039,26 @@ static void fc_fcp_cleanup_each_cmd(struct fc_lport *lport, unsigned int id, fc_fcp_pkt_hold(fsp); spin_unlock_irqrestore(&si->scsi_queue_lock, flags); - if (!fc_fcp_lock_pkt(fsp)) { + spin_lock_bh(&fsp->scsi_pkt_lock); + if (!(fsp->state & FC_SRB_COMPL)) { + fsp->state |= FC_SRB_COMPL; + /* + * TODO: dropping scsi_pkt_lock and then reacquiring + * again around fc_fcp_cleanup_cmd() is required, + * since fc_fcp_cleanup_cmd() calls into + * fc_seq_set_resp() and that func preempts cpu using + * schedule. May be schedule and related code should be + * removed instead of unlocking here to avoid scheduling + * while atomic bug. + */ + spin_unlock_bh(&fsp->scsi_pkt_lock); + fc_fcp_cleanup_cmd(fsp, error); + + spin_lock_bh(&fsp->scsi_pkt_lock); fc_io_compl(fsp); - fc_fcp_unlock_pkt(fsp); } + spin_unlock_bh(&fsp->scsi_pkt_lock); fc_fcp_pkt_release(fsp); spin_lock_irqsave(&si->scsi_queue_lock, flags); From d51689e20adbf8fe2c3999939da8d61ed2ccbc58 Mon Sep 17 00:00:00 2001 From: Horia Geant? Date: Tue, 11 Aug 2015 20:19:20 +0300 Subject: [PATCH 201/359] crypto: caam - fix memory corruption in ahash_final_ctx commit b310c178e6d897f82abb9da3af1cd7c02b09f592 upstream. When doing pointer operation for accessing the HW S/G table, a value representing number of entries (and not number of bytes) must be used. Fixes: 045e36780f115 ("crypto: caam - ahash hmac support") Signed-off-by: Horia Geant? Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/caam/caamhash.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c index 84573b4d6f9280..dda43cc4b6cd55 100644 --- a/drivers/crypto/caam/caamhash.c +++ b/drivers/crypto/caam/caamhash.c @@ -895,13 +895,14 @@ static int ahash_final_ctx(struct ahash_request *req) state->buflen_1; u32 *sh_desc = ctx->sh_desc_fin, *desc; dma_addr_t ptr = ctx->sh_desc_fin_dma; - int sec4_sg_bytes; + int sec4_sg_bytes, sec4_sg_src_index; int digestsize = crypto_ahash_digestsize(ahash); struct ahash_edesc *edesc; int ret = 0; int sh_len; - sec4_sg_bytes = (1 + (buflen ? 1 : 0)) * sizeof(struct sec4_sg_entry); + sec4_sg_src_index = 1 + (buflen ? 1 : 0); + sec4_sg_bytes = sec4_sg_src_index * sizeof(struct sec4_sg_entry); /* allocate space for base edesc and hw desc commands, link tables */ edesc = kmalloc(sizeof(struct ahash_edesc) + DESC_JOB_IO_LEN + @@ -928,7 +929,7 @@ static int ahash_final_ctx(struct ahash_request *req) state->buf_dma = try_buf_map_to_sec4_sg(jrdev, edesc->sec4_sg + 1, buf, state->buf_dma, buflen, last_buflen); - (edesc->sec4_sg + sec4_sg_bytes - 1)->len |= SEC4_SG_LEN_FIN; + (edesc->sec4_sg + sec4_sg_src_index - 1)->len |= SEC4_SG_LEN_FIN; append_seq_in_ptr(desc, edesc->sec4_sg_dma, ctx->ctx_len + buflen, LDST_SGF); From 82c9aed33b8a6ca79121d54f1504e9df6b0479cd Mon Sep 17 00:00:00 2001 From: Yann Droneaud Date: Mon, 17 Nov 2014 23:02:19 +0000 Subject: [PATCH 202/359] arm64/mm: Remove hack in mmap randomize layout commit d6c763afab142a85e4770b4bc2a5f40f256d5c5d upstream. Since commit 8a0a9bd4db63 ('random: make get_random_int() more random'), get_random_int() returns a random value for each call, so comment and hack introduced in mmap_rnd() as part of commit 1d18c47c735e ('arm64: MMU fault handling and page table management') are incorrects. Commit 1d18c47c735e seems to use the same hack introduced by commit a5adc91a4b44 ('powerpc: Ensure random space between stack and mmaps'), latter copied in commit 5a0efea09f42 ('sparc64: Sharpen address space randomization calculations.'). But both architectures were cleaned up as part of commit fa8cbaaf5a68 ('powerpc+sparc64/mm: Remove hack in mmap randomize layout') as hack is no more needed since commit 8a0a9bd4db63. So the present patch removes the comment and the hack around get_random_int() on AArch64's mmap_rnd(). Cc: David S. Miller Cc: Anton Blanchard Cc: Benjamin Herrenschmidt Acked-by: Will Deacon Acked-by: Dan McGee Signed-off-by: Yann Droneaud Signed-off-by: Will Deacon Cc: Matthias Brugger Signed-off-by: Greg Kroah-Hartman --- arch/arm64/mm/mmap.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/arch/arm64/mm/mmap.c b/arch/arm64/mm/mmap.c index 7c7be78556387e..8aaf073ee07846 100644 --- a/arch/arm64/mm/mmap.c +++ b/arch/arm64/mm/mmap.c @@ -47,22 +47,14 @@ static int mmap_is_legacy(void) return sysctl_legacy_va_layout; } -/* - * Since get_random_int() returns the same value within a 1 jiffy window, we - * will almost always get the same randomisation for the stack and mmap - * region. This will mean the relative distance between stack and mmap will be - * the same. - * - * To avoid this we can shift the randomness by 1 bit. - */ static unsigned long mmap_rnd(void) { unsigned long rnd = 0; if (current->flags & PF_RANDOMIZE) - rnd = (long)get_random_int() & (STACK_RND_MASK >> 1); + rnd = (long)get_random_int() & STACK_RND_MASK; - return rnd << (PAGE_SHIFT + 1); + return rnd << PAGE_SHIFT; } static unsigned long mmap_base(void) From 2ec142700ec00142cdcd8c6529ad77cb9ec7a026 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 13 Sep 2015 09:08:15 -0700 Subject: [PATCH 203/359] Linux 3.10.88 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0d4fd64273491a..e94ce68ecf87fb 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 10 -SUBLEVEL = 87 +SUBLEVEL = 88 EXTRAVERSION = NAME = TOSSUG Baby Fish From c043ef53c78d0bccbbe4981ea55d5fb3df3c3d51 Mon Sep 17 00:00:00 2001 From: Stephen Chandler Paul Date: Fri, 21 Aug 2015 14:16:12 -0400 Subject: [PATCH 204/359] DRM - radeon: Don't link train DisplayPort on HPD until we get the dpcd commit 924f92bf12bfbef3662619e3ed24a1cea7c1cbcd upstream. Most of the time this isn't an issue since hotplugging an adaptor will trigger a crtc mode change which in turn, causes the driver to probe every DisplayPort for a dpcd. However, in cases where hotplugging doesn't cause a mode change (specifically when one unplugs a monitor from a DisplayPort connector, then plugs that same monitor back in seconds later on the same port without any other monitors connected), we never probe for the dpcd before starting the initial link training. What happens from there looks like this: - GPU has only one monitor connected. It's connected via DisplayPort, and does not go through an adaptor of any sort. - User unplugs DisplayPort connector from GPU. - Change in HPD is detected by the driver, we probe every DisplayPort for a possible connection. - Probe the port the user originally had the monitor connected on for it's dpcd. This fails, and we clear the first (and only the first) byte of the dpcd to indicate we no longer have a dpcd for this port. - User plugs the previously disconnected monitor back into the same DisplayPort. - radeon_connector_hotplug() is called before everyone else, and tries to handle the link training. Since only the first byte of the dpcd is zeroed, the driver is able to complete link training but does so against the wrong dpcd, causing it to initialize the link with the wrong settings. - Display stays blank (usually), dpcd is probed after the initial link training, and the driver prints no obvious messages to the log. In theory, since only one byte of the dpcd is chopped off (specifically, the byte that contains the revision information for DisplayPort), it's not entirely impossible that this bug may not show on certain monitors. For instance, the only reason this bug was visible on my ASUS PB238 monitor was due to the fact that this monitor using the enhanced framing symbol sequence, the flag for which is ignored if the radeon driver thinks that the DisplayPort version is below 1.1. Signed-off-by: Stephen Chandler Paul Reviewed-by: Jerome Glisse Signed-off-by: Alex Deucher Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/radeon/radeon_connectors.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index fc604fc7579710..1fbd38b371d410 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c @@ -78,6 +78,11 @@ void radeon_connector_hotplug(struct drm_connector *connector) if (!radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) { drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF); } else if (radeon_dp_needs_link_train(radeon_connector)) { + /* Don't try to start link training before we + * have the dpcd */ + if (!radeon_dp_getdpcd(radeon_connector)) + return; + /* set it to OFF so that drm_helper_connector_dpms() * won't return immediately since the current state * is ON at this point. From 35c45e8bce3c92fb1ff94d376f1d4bfaae079d66 Mon Sep 17 00:00:00 2001 From: Markus Pargmann Date: Wed, 29 Jul 2015 15:46:03 +0200 Subject: [PATCH 205/359] iio: bmg160: IIO_BUFFER and IIO_TRIGGERED_BUFFER are required commit 06d2f6ca5a38abe92f1f3a132b331eee773868c3 upstream. This patch adds selects for IIO_BUFFER and IIO_TRIGGERED_BUFFER. Without IIO_BUFFER, the driver does not compile. Signed-off-by: Markus Pargmann Reviewed-by: Srinivas Pandruvada Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/gyro/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iio/gyro/Kconfig b/drivers/iio/gyro/Kconfig index 107cafcb89dac6..953a0621c6fe7e 100644 --- a/drivers/iio/gyro/Kconfig +++ b/drivers/iio/gyro/Kconfig @@ -73,7 +73,8 @@ config IIO_ST_GYRO_SPI_3AXIS config ITG3200 tristate "InvenSense ITG3200 Digital 3-Axis Gyroscope I2C driver" depends on I2C - select IIO_TRIGGERED_BUFFER if IIO_BUFFER + select IIO_BUFFER + select IIO_TRIGGERED_BUFFER help Say yes here to add support for the InvenSense ITG3200 digital 3-axis gyroscope sensor. From c79f44d1c02df2deeebd7aea5534c7946548bf0b Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Wed, 5 Aug 2015 15:38:14 +0200 Subject: [PATCH 206/359] iio: Add inverse unit conversion macros commit c689a923c867eac40ed3826c1d9328edea8b6bc7 upstream. Add inverse unit conversion macro to convert from standard IIO units to units that might be used by some devices. Those are useful in combination with scale factors that are specified as IIO_VAL_FRACTIONAL. Typically the denominator for those specifications will contain the maximum raw value the sensor will generate and the numerator the value it maps to in a specific unit. Sometimes datasheets specify those in different units than the standard IIO units (e.g. degree/s instead of rad/s) and so we need to do a unit conversion. From a mathematical point of view it does not make a difference whether we apply the unit conversion to the numerator or the inverse unit conversion to the denominator since (x / y) / z = x / (y * z). But as the denominator is typically a larger value and we are rounding both the numerator and denominator to integer values using the later method gives us a better precision (E.g. the relative error is smaller if we round 8000.3 to 8000 rather than rounding 8.3 to 8). This is where in inverse unit conversion macros will be used. Marked for stable as used by some upcoming fixes. Signed-off-by: Lars-Peter Clausen Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- include/linux/iio/iio.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index 3d35b7023591fa..683911167953d9 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h @@ -568,6 +568,15 @@ int iio_str_to_fixpoint(const char *str, int fract_mult, int *integer, */ #define IIO_DEGREE_TO_RAD(deg) (((deg) * 314159ULL + 9000000ULL) / 18000000ULL) +/** + * IIO_RAD_TO_DEGREE() - Convert rad to degree + * @rad: A value in rad + * + * Returns the given value converted from rad to degree + */ +#define IIO_RAD_TO_DEGREE(rad) \ + (((rad) * 18000000ULL + 314159ULL / 2) / 314159ULL) + /** * IIO_G_TO_M_S_2() - Convert g to meter / second**2 * @g: A value in g @@ -576,4 +585,12 @@ int iio_str_to_fixpoint(const char *str, int fract_mult, int *integer, */ #define IIO_G_TO_M_S_2(g) ((g) * 980665ULL / 100000ULL) +/** + * IIO_M_S_2_TO_G() - Convert meter / second**2 to g + * @ms2: A value in meter / second**2 + * + * Returns the given value converted from meter / second**2 to g + */ +#define IIO_M_S_2_TO_G(ms2) (((ms2) * 100000ULL + 980665ULL / 2) / 980665ULL) + #endif /* _INDUSTRIAL_IO_H_ */ From fa8f11e479c92c694c9b339b866b3fbed9ee3b0e Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Wed, 5 Aug 2015 15:38:15 +0200 Subject: [PATCH 207/359] iio: adis16480: Fix scale factors commit 7abad1063deb0f77d275c61f58863ec319c58c5c upstream. The different devices support by the adis16480 driver have slightly different scales for the gyroscope and accelerometer channels. Signed-off-by: Lars-Peter Clausen Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/imu/adis16480.c | 39 +++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/drivers/iio/imu/adis16480.c b/drivers/iio/imu/adis16480.c index b7db3837629549..b0d05e88087c43 100644 --- a/drivers/iio/imu/adis16480.c +++ b/drivers/iio/imu/adis16480.c @@ -110,6 +110,10 @@ struct adis16480_chip_info { unsigned int num_channels; const struct iio_chan_spec *channels; + unsigned int gyro_max_val; + unsigned int gyro_max_scale; + unsigned int accel_max_val; + unsigned int accel_max_scale; }; struct adis16480 { @@ -533,19 +537,21 @@ static int adis16480_set_filter_freq(struct iio_dev *indio_dev, static int adis16480_read_raw(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, int *val, int *val2, long info) { + struct adis16480 *st = iio_priv(indio_dev); + switch (info) { case IIO_CHAN_INFO_RAW: return adis_single_conversion(indio_dev, chan, 0, val); case IIO_CHAN_INFO_SCALE: switch (chan->type) { case IIO_ANGL_VEL: - *val = 0; - *val2 = IIO_DEGREE_TO_RAD(20000); /* 0.02 degree/sec */ - return IIO_VAL_INT_PLUS_MICRO; + *val = st->chip_info->gyro_max_scale; + *val2 = st->chip_info->gyro_max_val; + return IIO_VAL_FRACTIONAL; case IIO_ACCEL: - *val = 0; - *val2 = IIO_G_TO_M_S_2(800); /* 0.8 mg */ - return IIO_VAL_INT_PLUS_MICRO; + *val = st->chip_info->accel_max_scale; + *val2 = st->chip_info->accel_max_val; + return IIO_VAL_FRACTIONAL; case IIO_MAGN: *val = 0; *val2 = 100; /* 0.0001 gauss */ @@ -702,18 +708,39 @@ static const struct adis16480_chip_info adis16480_chip_info[] = { [ADIS16375] = { .channels = adis16485_channels, .num_channels = ARRAY_SIZE(adis16485_channels), + /* + * storing the value in rad/degree and the scale in degree + * gives us the result in rad and better precession than + * storing the scale directly in rad. + */ + .gyro_max_val = IIO_RAD_TO_DEGREE(22887), + .gyro_max_scale = 300, + .accel_max_val = IIO_M_S_2_TO_G(21973), + .accel_max_scale = 18, }, [ADIS16480] = { .channels = adis16480_channels, .num_channels = ARRAY_SIZE(adis16480_channels), + .gyro_max_val = IIO_RAD_TO_DEGREE(22500), + .gyro_max_scale = 450, + .accel_max_val = IIO_M_S_2_TO_G(12500), + .accel_max_scale = 5, }, [ADIS16485] = { .channels = adis16485_channels, .num_channels = ARRAY_SIZE(adis16485_channels), + .gyro_max_val = IIO_RAD_TO_DEGREE(22500), + .gyro_max_scale = 450, + .accel_max_val = IIO_M_S_2_TO_G(20000), + .accel_max_scale = 5, }, [ADIS16488] = { .channels = adis16480_channels, .num_channels = ARRAY_SIZE(adis16480_channels), + .gyro_max_val = IIO_RAD_TO_DEGREE(22500), + .gyro_max_scale = 450, + .accel_max_val = IIO_M_S_2_TO_G(22500), + .accel_max_scale = 18, }, }; From 44a7b4fb57258d95e2ed213c2c595d033cda79d0 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 29 Jul 2015 13:17:06 +0300 Subject: [PATCH 208/359] clk: versatile: off by one in clk_sp810_timerclken_of_get() commit 3294bee87091be5f179474f6c39d1d87769635e2 upstream. The ">" should be ">=" or we end up reading beyond the end of the array. Fixes: 6e973d2c4385 ('clk: vexpress: Add separate SP810 driver') Signed-off-by: Dan Carpenter Acked-by: Pawel Moll Signed-off-by: Stephen Boyd Signed-off-by: Greg Kroah-Hartman --- drivers/clk/versatile/clk-sp810.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/versatile/clk-sp810.c b/drivers/clk/versatile/clk-sp810.c index bf9b15a585e188..b9e05bde0c0616 100644 --- a/drivers/clk/versatile/clk-sp810.c +++ b/drivers/clk/versatile/clk-sp810.c @@ -128,8 +128,8 @@ struct clk *clk_sp810_timerclken_of_get(struct of_phandle_args *clkspec, { struct clk_sp810 *sp810 = data; - if (WARN_ON(clkspec->args_count != 1 || clkspec->args[0] > - ARRAY_SIZE(sp810->timerclken))) + if (WARN_ON(clkspec->args_count != 1 || + clkspec->args[0] >= ARRAY_SIZE(sp810->timerclken))) return NULL; return sp810->timerclken[clkspec->args[0]].clk; From ae7a54384462e806d875a05b1acf3362beb1f2f0 Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Fri, 19 Jun 2015 15:58:24 -0500 Subject: [PATCH 209/359] PCI: Fix TI816X class code quirk commit d1541dc977d376406f4584d8eb055488655c98ec upstream. In fixup_ti816x_class(), we assigned "class = PCI_CLASS_MULTIMEDIA_VIDEO". But PCI_CLASS_MULTIMEDIA_VIDEO is only the two-byte base class/sub-class and needs to be shifted to make space for the low-order interface byte. Shift PCI_CLASS_MULTIMEDIA_VIDEO to set the correct class code. Fixes: 63c4408074cb ("PCI: Add quirk for setting valid class for TI816X Endpoint") Signed-off-by: Bjorn Helgaas CC: Hemant Pedanekar Signed-off-by: Greg Kroah-Hartman --- drivers/pci/quirks.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 910339c0791fd6..390e4094e4d53f 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -2796,12 +2796,15 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x3c28, vtd_mask_spec_errors); static void fixup_ti816x_class(struct pci_dev *dev) { + u32 class = dev->class; + /* TI 816x devices do not have class code set when in PCIe boot mode */ - dev_info(&dev->dev, "Setting PCI class for 816x PCIe device\n"); - dev->class = PCI_CLASS_MULTIMEDIA_VIDEO; + dev->class = PCI_CLASS_MULTIMEDIA_VIDEO << 8; + dev_info(&dev->dev, "PCI class overridden (%#08x -> %#08x)\n", + class, dev->class); } DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_TI, 0xb800, - PCI_CLASS_NOT_DEFINED, 0, fixup_ti816x_class); + PCI_CLASS_NOT_DEFINED, 0, fixup_ti816x_class); /* Some PCIe devices do not work reliably with the claimed maximum * payload size supported. From bcbc0b4c57d5fbaa6e4448c1f649dd7fbf1e3deb Mon Sep 17 00:00:00 2001 From: Philipp Hachtmann Date: Mon, 17 Aug 2015 17:31:46 +0200 Subject: [PATCH 210/359] USB: symbolserial: Use usb_get_serial_port_data commit 951d3793bbfc0a441d791d820183aa3085c83ea9 upstream. The driver used usb_get_serial_data(port->serial) which compiled but resulted in a NULL pointer being returned (and subsequently used). I did not go deeper into this but I guess this is a regression. Signed-off-by: Philipp Hachtmann Fixes: a85796ee5149 ("USB: symbolserial: move private-data allocation to port_probe") Acked-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/symbolserial.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/serial/symbolserial.c b/drivers/usb/serial/symbolserial.c index 9b1648945e7a85..1e2d86d4f539ee 100644 --- a/drivers/usb/serial/symbolserial.c +++ b/drivers/usb/serial/symbolserial.c @@ -97,7 +97,7 @@ static void symbol_int_callback(struct urb *urb) static int symbol_open(struct tty_struct *tty, struct usb_serial_port *port) { - struct symbol_private *priv = usb_get_serial_data(port->serial); + struct symbol_private *priv = usb_get_serial_port_data(port); unsigned long flags; int result = 0; @@ -123,7 +123,7 @@ static void symbol_close(struct usb_serial_port *port) static void symbol_throttle(struct tty_struct *tty) { struct usb_serial_port *port = tty->driver_data; - struct symbol_private *priv = usb_get_serial_data(port->serial); + struct symbol_private *priv = usb_get_serial_port_data(port); spin_lock_irq(&priv->lock); priv->throttled = true; @@ -133,7 +133,7 @@ static void symbol_throttle(struct tty_struct *tty) static void symbol_unthrottle(struct tty_struct *tty) { struct usb_serial_port *port = tty->driver_data; - struct symbol_private *priv = usb_get_serial_data(port->serial); + struct symbol_private *priv = usb_get_serial_port_data(port); int result; bool was_throttled; From 42578a54f0f7688077a3a2f0cde1da259baa3214 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Tue, 18 Aug 2015 10:33:56 +0200 Subject: [PATCH 211/359] USB: ftdi_sio: Added custom PID for CustomWare products commit 1fb8dc36384ae1140ee6ccc470de74397606a9d5 upstream. CustomWare uses the FTDI VID with custom PIDs for their ShipModul MiniPlex products. Signed-off-by: Matthijs Kooijman Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/ftdi_sio.c | 4 ++++ drivers/usb/serial/ftdi_sio_ids.h | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index b55e5f3a311d0d..514f3117ee2b54 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -621,6 +621,10 @@ static struct usb_device_id id_table_combined [] = { { USB_DEVICE(FTDI_VID, FTDI_NT_ORIONLXM_PID), .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, { USB_DEVICE(FTDI_VID, FTDI_SYNAPSE_SS200_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_CUSTOMWARE_MINIPLEX_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_CUSTOMWARE_MINIPLEX2_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_CUSTOMWARE_MINIPLEX2WI_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_CUSTOMWARE_MINIPLEX3_PID) }, /* * ELV devices: */ diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h index 99316d7cfc03f9..bfb0ecd98808c7 100644 --- a/drivers/usb/serial/ftdi_sio_ids.h +++ b/drivers/usb/serial/ftdi_sio_ids.h @@ -568,6 +568,14 @@ */ #define FTDI_SYNAPSE_SS200_PID 0x9090 /* SS200 - SNAP Stick 200 */ +/* + * CustomWare / ShipModul NMEA multiplexers product ids (FTDI_VID) + */ +#define FTDI_CUSTOMWARE_MINIPLEX_PID 0xfd48 /* MiniPlex first generation NMEA Multiplexer */ +#define FTDI_CUSTOMWARE_MINIPLEX2_PID 0xfd49 /* MiniPlex-USB and MiniPlex-2 series */ +#define FTDI_CUSTOMWARE_MINIPLEX2WI_PID 0xfd4a /* MiniPlex-2Wi */ +#define FTDI_CUSTOMWARE_MINIPLEX3_PID 0xfd4b /* MiniPlex-3 series */ + /********************************/ /** third-party VID/PID combos **/ From 42dc5f388aebc7ff73f7f2d2477620fb17dfc37b Mon Sep 17 00:00:00 2001 From: Kishon Vijay Abraham I Date: Mon, 27 Jul 2015 12:25:27 +0530 Subject: [PATCH 212/359] usb: dwc3: ep0: Fix mem corruption on OUT transfers of more than 512 bytes commit b2fb5b1a0f50d3ebc12342c8d8dead245e9c9d4e upstream. DWC3 uses bounce buffer to handle non max packet aligned OUT transfers and the size of bounce buffer is 512 bytes. However if the host initiates OUT transfers of size more than 512 bytes (and non max packet aligned), the driver throws a WARN dump but still programs the TRB to receive more than 512 bytes. This will cause bounce buffer to overflow and corrupt the adjacent memory locations which can be fatal. Fix it by programming the TRB to receive a maximum of DWC3_EP0_BOUNCE_SIZE (512) bytes. Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman --- drivers/usb/dwc3/ep0.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c index 57d7ec6c8090e8..27040a6314d4ba 100644 --- a/drivers/usb/dwc3/ep0.c +++ b/drivers/usb/dwc3/ep0.c @@ -804,6 +804,11 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc, unsigned maxp = ep0->endpoint.maxpacket; transfer_size += (maxp - (transfer_size % maxp)); + + /* Maximum of DWC3_EP0_BOUNCE_SIZE can only be received */ + if (transfer_size > DWC3_EP0_BOUNCE_SIZE) + transfer_size = DWC3_EP0_BOUNCE_SIZE; + transferred = min_t(u32, ur->length, transfer_size - length); memcpy(ur->buf, dwc->ep0_bounce, transferred); @@ -916,11 +921,14 @@ static void __dwc3_ep0_do_control_data(struct dwc3 *dwc, return; } - WARN_ON(req->request.length > DWC3_EP0_BOUNCE_SIZE); - maxpacket = dep->endpoint.maxpacket; transfer_size = roundup(req->request.length, maxpacket); + if (transfer_size > DWC3_EP0_BOUNCE_SIZE) { + dev_WARN(dwc->dev, "bounce buf can't handle req len\n"); + transfer_size = DWC3_EP0_BOUNCE_SIZE; + } + dwc->ep0_bounced = true; /* From 3433155a81e3c10c84dfc458132ee71080842ec7 Mon Sep 17 00:00:00 2001 From: Peter Chen Date: Mon, 17 Aug 2015 10:23:03 +0800 Subject: [PATCH 213/359] usb: host: ehci-sys: delete useless bus_to_hcd conversion commit 0521cfd06e1ebcd575e7ae36aab068b38df23850 upstream. The ehci platform device's drvdata is the pointer of struct usb_hcd already, so we doesn't need to call bus_to_hcd conversion again. Signed-off-by: Peter Chen Acked-by: Alan Stern Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/ehci-sysfs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ehci-sysfs.c b/drivers/usb/host/ehci-sysfs.c index 14ced00ba220ab..0659024290af45 100644 --- a/drivers/usb/host/ehci-sysfs.c +++ b/drivers/usb/host/ehci-sysfs.c @@ -29,7 +29,7 @@ static ssize_t show_companion(struct device *dev, int count = PAGE_SIZE; char *ptr = buf; - ehci = hcd_to_ehci(bus_to_hcd(dev_get_drvdata(dev))); + ehci = hcd_to_ehci(dev_get_drvdata(dev)); nports = HCS_N_PORTS(ehci->hcs_params); for (index = 0; index < nports; ++index) { @@ -54,7 +54,7 @@ static ssize_t store_companion(struct device *dev, struct ehci_hcd *ehci; int portnum, new_owner; - ehci = hcd_to_ehci(bus_to_hcd(dev_get_drvdata(dev))); + ehci = hcd_to_ehci(dev_get_drvdata(dev)); new_owner = PORT_OWNER; /* Owned by companion */ if (sscanf(buf, "%d", &portnum) != 1) return -EINVAL; @@ -85,7 +85,7 @@ static ssize_t show_uframe_periodic_max(struct device *dev, struct ehci_hcd *ehci; int n; - ehci = hcd_to_ehci(bus_to_hcd(dev_get_drvdata(dev))); + ehci = hcd_to_ehci(dev_get_drvdata(dev)); n = scnprintf(buf, PAGE_SIZE, "%d\n", ehci->uframe_periodic_max); return n; } @@ -102,7 +102,7 @@ static ssize_t store_uframe_periodic_max(struct device *dev, unsigned long flags; ssize_t ret; - ehci = hcd_to_ehci(bus_to_hcd(dev_get_drvdata(dev))); + ehci = hcd_to_ehci(dev_get_drvdata(dev)); if (kstrtouint(buf, 0, &uframe_periodic_max) < 0) return -EINVAL; From 1e63b61bcbc0d4d0f5ab01798eddb5b5abb64172 Mon Sep 17 00:00:00 2001 From: "Maciej S. Szmigiero" Date: Sun, 2 Aug 2015 23:11:52 +0200 Subject: [PATCH 214/359] serial: 8250: don't bind to SMSC IrCC IR port commit ffa34de03bcfbfa88d8352942bc238bb48e94e2d upstream. SMSC IrCC SIR/FIR port should not be bound to by (legacy) serial driver so its own driver (smsc-ircc2) can bind to it. Signed-off-by: Maciej Szmigiero Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/8250/8250_pnp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/tty/serial/8250/8250_pnp.c b/drivers/tty/serial/8250/8250_pnp.c index 35d9ab95c5cbb5..91b14202b90b73 100644 --- a/drivers/tty/serial/8250/8250_pnp.c +++ b/drivers/tty/serial/8250/8250_pnp.c @@ -365,6 +365,11 @@ static const struct pnp_device_id pnp_dev_table[] = { /* Winbond CIR port, should not be probed. We should keep track of it to prevent the legacy serial driver from probing it */ { "WEC1022", CIR_PORT }, + /* + * SMSC IrCC SIR/FIR port, should not be probed by serial driver + * as well so its own driver can bind to it. + */ + { "SMCF010", CIR_PORT }, { "", 0 } }; From e56ecbcc11b31fb2dcf9590677b275286237c6ab Mon Sep 17 00:00:00 2001 From: Andrey Ryabinin Date: Thu, 3 Sep 2015 14:32:01 +0300 Subject: [PATCH 215/359] crypto: ghash-clmulni: specify context size for ghash async algorithm commit 71c6da846be478a61556717ef1ee1cea91f5d6a8 upstream. Currently context size (cra_ctxsize) doesn't specified for ghash_async_alg. Which means it's zero. Thus crypto_create_tfm() doesn't allocate needed space for ghash_async_ctx, so any read/write to ctx (e.g. in ghash_async_init_tfm()) is not valid. Signed-off-by: Andrey Ryabinin Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- arch/x86/crypto/ghash-clmulni-intel_glue.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/crypto/ghash-clmulni-intel_glue.c b/arch/x86/crypto/ghash-clmulni-intel_glue.c index a8d6f69f92a3a9..4bcf841e47013d 100644 --- a/arch/x86/crypto/ghash-clmulni-intel_glue.c +++ b/arch/x86/crypto/ghash-clmulni-intel_glue.c @@ -291,6 +291,7 @@ static struct ahash_alg ghash_async_alg = { .cra_name = "ghash", .cra_driver_name = "ghash-clmulni", .cra_priority = 400, + .cra_ctxsize = sizeof(struct ghash_async_ctx), .cra_flags = CRYPTO_ALG_TYPE_AHASH | CRYPTO_ALG_ASYNC, .cra_blocksize = GHASH_BLOCK_SIZE, .cra_type = &crypto_ahash_type, From deeff0eaa0743aaa42c2ffc112604fb8a74bef5e Mon Sep 17 00:00:00 2001 From: Don Zickus Date: Mon, 10 Aug 2015 12:06:53 -0400 Subject: [PATCH 216/359] HID: usbhid: Fix the check for HID_RESET_PENDING in hid_io_error commit 3af4e5a95184d6d3c1c6a065f163faa174a96a1d upstream. It was reported that after 10-20 reboots, a usb keyboard plugged into a docking station would not work unless it was replugged in. Using usbmon, it turns out the interrupt URBs were streaming with callback errors of -71 for some reason. The hid-core.c::hid_io_error was supposed to retry and then reset, but the reset wasn't really happening. The check for HID_NO_BANDWIDTH was inverted. Fix was simple. Tested by reporter and locally by me by unplugging a keyboard halfway until I could recreate a stream of errors but no disconnect. Signed-off-by: Don Zickus Signed-off-by: Jiri Kosina Signed-off-by: Greg Kroah-Hartman --- drivers/hid/usbhid/hid-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index ada164e1b3a1fd..de904e6a4ab7e2 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -180,7 +180,7 @@ static void hid_io_error(struct hid_device *hid) if (time_after(jiffies, usbhid->stop_retry)) { /* Retries failed, so do a port reset unless we lack bandwidth*/ - if (test_bit(HID_NO_BANDWIDTH, &usbhid->iofl) + if (!test_bit(HID_NO_BANDWIDTH, &usbhid->iofl) && !test_and_set_bit(HID_RESET_PENDING, &usbhid->iofl)) { schedule_work(&usbhid->reset_work); From 8db5a692d7f860645a4f2a2c3b822637ecdfa3bf Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Sat, 4 Jul 2015 15:27:39 +0300 Subject: [PATCH 217/359] xtensa: fix threadptr reload on return to userspace commit 4229fb12a03e5da5882b420b0aa4a02e77447b86 upstream. Userspace return code may skip restoring THREADPTR register if there are no registers that need to be zeroed. This leads to spurious failures in libc NPTL tests. Always restore THREADPTR on return to userspace. Signed-off-by: Max Filippov Signed-off-by: Greg Kroah-Hartman --- arch/xtensa/kernel/entry.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/xtensa/kernel/entry.S b/arch/xtensa/kernel/entry.S index 6e53174f85565c..d29bac601be5bd 100644 --- a/arch/xtensa/kernel/entry.S +++ b/arch/xtensa/kernel/entry.S @@ -549,12 +549,13 @@ user_exception_exit: * (if we have restored WSBITS-1 frames). */ +2: #if XCHAL_HAVE_THREADPTR l32i a3, a1, PT_THREADPTR wur a3, threadptr #endif -2: j common_exception_exit + j common_exception_exit /* This is the kernel exception exit. * We avoided to do a MOVSP when we entered the exception, but we From 0bd183de611348459ef08b1e893dad005d8880f6 Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Thu, 16 Jul 2015 10:41:02 +0300 Subject: [PATCH 218/359] xtensa: fix kernel register spilling commit 77d6273e79e3a86552fcf10cdd31a69b46ed2ce6 upstream. call12 can't be safely used as the first call in the inline function, because the compiler does not extend the stack frame of the bounding function accordingly, which may result in corruption of local variables. If a call needs to be done, do call8 first followed by call12. For pure assembly code in _switch_to increase stack frame size of the bounding function. Signed-off-by: Max Filippov Signed-off-by: Greg Kroah-Hartman --- arch/xtensa/include/asm/traps.h | 29 +++++++++++++++++++---------- arch/xtensa/kernel/entry.S | 4 ++-- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/arch/xtensa/include/asm/traps.h b/arch/xtensa/include/asm/traps.h index f2faa58f9a43f3..03d02df47b9a99 100644 --- a/arch/xtensa/include/asm/traps.h +++ b/arch/xtensa/include/asm/traps.h @@ -24,30 +24,39 @@ static inline void spill_registers(void) { #if XCHAL_NUM_AREGS > 16 __asm__ __volatile__ ( - " call12 1f\n" + " call8 1f\n" " _j 2f\n" " retw\n" " .align 4\n" "1:\n" +#if XCHAL_NUM_AREGS == 32 + " _entry a1, 32\n" + " addi a8, a0, 3\n" + " _entry a1, 16\n" + " mov a12, a12\n" + " retw\n" +#else " _entry a1, 48\n" - " addi a12, a0, 3\n" -#if XCHAL_NUM_AREGS > 32 - " .rept (" __stringify(XCHAL_NUM_AREGS) " - 32) / 12\n" + " call12 1f\n" + " retw\n" + " .align 4\n" + "1:\n" + " .rept (" __stringify(XCHAL_NUM_AREGS) " - 16) / 12\n" " _entry a1, 48\n" " mov a12, a0\n" " .endr\n" -#endif - " _entry a1, 48\n" + " _entry a1, 16\n" #if XCHAL_NUM_AREGS % 12 == 0 - " mov a8, a8\n" -#elif XCHAL_NUM_AREGS % 12 == 4 " mov a12, a12\n" -#elif XCHAL_NUM_AREGS % 12 == 8 +#elif XCHAL_NUM_AREGS % 12 == 4 " mov a4, a4\n" +#elif XCHAL_NUM_AREGS % 12 == 8 + " mov a8, a8\n" #endif " retw\n" +#endif "2:\n" - : : : "a12", "a13", "memory"); + : : : "a8", "a9", "memory"); #else __asm__ __volatile__ ( " mov a12, a12\n" diff --git a/arch/xtensa/kernel/entry.S b/arch/xtensa/kernel/entry.S index d29bac601be5bd..b268d3cc01d1d3 100644 --- a/arch/xtensa/kernel/entry.S +++ b/arch/xtensa/kernel/entry.S @@ -1934,7 +1934,7 @@ ENDPROC(system_call) mov a12, a0 .endr #endif - _entry a1, 48 + _entry a1, 16 #if XCHAL_NUM_AREGS % 12 == 0 mov a8, a8 #elif XCHAL_NUM_AREGS % 12 == 4 @@ -1958,7 +1958,7 @@ ENDPROC(system_call) ENTRY(_switch_to) - entry a1, 16 + entry a1, 48 mov a11, a3 # and 'next' (a3) From db4d79952cd299d81fdb1a87ef363d77df5976a5 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Wed, 15 Jul 2015 10:29:00 +0900 Subject: [PATCH 219/359] devres: fix devres_get() commit 64526370d11ce8868ca495723d595b61e8697fbf upstream. Currently, devres_get() passes devres_free() the pointer to devres, but devres_free() should be given with the pointer to resource data. Fixes: 9ac7849e35f7 ("devres: device resource management") Signed-off-by: Masahiro Yamada Acked-by: Tejun Heo Signed-off-by: Greg Kroah-Hartman --- drivers/base/devres.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/base/devres.c b/drivers/base/devres.c index 507379e7b76378..4e2fb405da871e 100644 --- a/drivers/base/devres.c +++ b/drivers/base/devres.c @@ -296,10 +296,10 @@ void * devres_get(struct device *dev, void *new_res, if (!dr) { add_dr(dev, &new_dr->node); dr = new_dr; - new_dr = NULL; + new_res = NULL; } spin_unlock_irqrestore(&dev->devres_lock, flags); - devres_free(new_dr); + devres_free(new_res); return dr->data; } From 6fdfca2c195b40993d75246991a1fe55602ee617 Mon Sep 17 00:00:00 2001 From: Sudip Mukherjee Date: Mon, 20 Jul 2015 17:27:21 +0530 Subject: [PATCH 220/359] auxdisplay: ks0108: fix refcount commit bab383de3b84e584b0f09227151020b2a43dc34c upstream. parport_find_base() will implicitly do parport_get_port() which increases the refcount. Then parport_register_device() will again increment the refcount. But while unloading the module we are only doing parport_unregister_device() decrementing the refcount only once. We add an parport_put_port() to neutralize the effect of parport_get_port(). Signed-off-by: Sudip Mukherjee Signed-off-by: Greg Kroah-Hartman --- drivers/auxdisplay/ks0108.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/auxdisplay/ks0108.c b/drivers/auxdisplay/ks0108.c index 5b93852392b8c3..0d752851a1eef8 100644 --- a/drivers/auxdisplay/ks0108.c +++ b/drivers/auxdisplay/ks0108.c @@ -139,6 +139,7 @@ static int __init ks0108_init(void) ks0108_pardevice = parport_register_device(ks0108_parport, KS0108_NAME, NULL, NULL, NULL, PARPORT_DEV_EXCL, NULL); + parport_put_port(ks0108_parport); if (ks0108_pardevice == NULL) { printk(KERN_ERR KS0108_NAME ": ERROR: " "parport didn't register new device\n"); From 5d6daec041e51567b7492eac66a1e7f9755f251b Mon Sep 17 00:00:00 2001 From: David Daney Date: Wed, 19 Aug 2015 13:17:47 -0700 Subject: [PATCH 221/359] of/address: Don't loop forever in of_find_matching_node_by_address(). commit 3a496b00b6f90c41bd21a410871dfc97d4f3c7ab upstream. If the internal call to of_address_to_resource() fails, we end up looping forever in of_find_matching_node_by_address(). This can be caused by a defective device tree, or calling with an incorrect matches argument. Fix by calling of_find_matching_node() unconditionally at the end of the loop. Signed-off-by: David Daney Signed-off-by: Rob Herring Signed-off-by: Greg Kroah-Hartman --- drivers/of/address.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/of/address.c b/drivers/of/address.c index 8fb2b576973320..9ceff3c86d742d 100644 --- a/drivers/of/address.c +++ b/drivers/of/address.c @@ -629,10 +629,10 @@ struct device_node *of_find_matching_node_by_address(struct device_node *from, struct resource res; while (dn) { - if (of_address_to_resource(dn, 0, &res)) - continue; - if (res.start == base_address) + if (!of_address_to_resource(dn, 0, &res) && + res.start == base_address) return dn; + dn = of_find_matching_node(dn, matches); } From 6ae99d59c81abbf8943905f71dc796ae9560ac24 Mon Sep 17 00:00:00 2001 From: Grant Likely Date: Sun, 7 Jun 2015 15:20:11 +0100 Subject: [PATCH 222/359] drivercore: Fix unregistration path of platform devices commit 7f5dcaf1fdf289767a126a0a5cc3ef39b5254b06 upstream. The unregister path of platform_device is broken. On registration, it will register all resources with either a parent already set, or type==IORESOURCE_{IO,MEM}. However, on unregister it will release everything with type==IORESOURCE_{IO,MEM}, but ignore the others. There are also cases where resources don't get registered in the first place, like with devices created by of_platform_populate()*. Fix the unregister path to be symmetrical with the register path by checking the parent pointer instead of the type field to decide which resources to unregister. This is safe because the upshot of the registration path algorithm is that registered resources have a parent pointer, and non-registered resources do not. * It can be argued that of_platform_populate() should be registering it's resources, and they argument has some merit. However, there are quite a few platforms that end up broken if we try to do that due to overlapping resources in the device tree. Until that is fixed, we need to solve the immediate problem. Cc: Pantelis Antoniou Cc: Wolfram Sang Cc: Rob Herring Cc: Greg Kroah-Hartman Cc: Ricardo Ribalda Delgado Signed-off-by: Grant Likely Tested-by: Ricardo Ribalda Delgado Tested-by: Wolfram Sang Signed-off-by: Rob Herring Signed-off-by: Greg Kroah-Hartman --- drivers/base/platform.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 9eda84246ffd5e..8717be5093a238 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -347,9 +347,7 @@ int platform_device_add(struct platform_device *pdev) while (--i >= 0) { struct resource *r = &pdev->resource[i]; - unsigned long type = resource_type(r); - - if (type == IORESOURCE_MEM || type == IORESOURCE_IO) + if (r->parent) release_resource(r); } @@ -380,9 +378,7 @@ void platform_device_del(struct platform_device *pdev) for (i = 0; i < pdev->num_resources; i++) { struct resource *r = &pdev->resource[i]; - unsigned long type = resource_type(r); - - if (type == IORESOURCE_MEM || type == IORESOURCE_IO) + if (r->parent) release_resource(r); } } From 315966f69a3c255910693a0815da4b0b785ba9f9 Mon Sep 17 00:00:00 2001 From: Mikulas Patocka Date: Wed, 2 Sep 2015 22:51:53 +0200 Subject: [PATCH 223/359] hpfs: update ctime and mtime on directory modification commit f49a26e7718dd30b49e3541e3e25aecf5e7294e2 upstream. Update ctime and mtime when a directory is modified. (though OS/2 doesn't update them anyway) Signed-off-by: Mikulas Patocka Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- fs/hpfs/namei.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/fs/hpfs/namei.c b/fs/hpfs/namei.c index 345713d2f8f31e..6b42789ae799ef 100644 --- a/fs/hpfs/namei.c +++ b/fs/hpfs/namei.c @@ -8,6 +8,17 @@ #include #include "hpfs_fn.h" +static void hpfs_update_directory_times(struct inode *dir) +{ + time_t t = get_seconds(); + if (t == dir->i_mtime.tv_sec && + t == dir->i_ctime.tv_sec) + return; + dir->i_mtime.tv_sec = dir->i_ctime.tv_sec = t; + dir->i_mtime.tv_nsec = dir->i_ctime.tv_nsec = 0; + hpfs_write_inode_nolock(dir); +} + static int hpfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) { const unsigned char *name = dentry->d_name.name; @@ -99,6 +110,7 @@ static int hpfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) result->i_mode = mode | S_IFDIR; hpfs_write_inode_nolock(result); } + hpfs_update_directory_times(dir); d_instantiate(dentry, result); hpfs_unlock(dir->i_sb); return 0; @@ -187,6 +199,7 @@ static int hpfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, b result->i_mode = mode | S_IFREG; hpfs_write_inode_nolock(result); } + hpfs_update_directory_times(dir); d_instantiate(dentry, result); hpfs_unlock(dir->i_sb); return 0; @@ -262,6 +275,7 @@ static int hpfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, de insert_inode_hash(result); hpfs_write_inode_nolock(result); + hpfs_update_directory_times(dir); d_instantiate(dentry, result); brelse(bh); hpfs_unlock(dir->i_sb); @@ -340,6 +354,7 @@ static int hpfs_symlink(struct inode *dir, struct dentry *dentry, const char *sy insert_inode_hash(result); hpfs_write_inode_nolock(result); + hpfs_update_directory_times(dir); d_instantiate(dentry, result); hpfs_unlock(dir->i_sb); return 0; @@ -423,6 +438,8 @@ static int hpfs_unlink(struct inode *dir, struct dentry *dentry) out1: hpfs_brelse4(&qbh); out: + if (!err) + hpfs_update_directory_times(dir); hpfs_unlock(dir->i_sb); return err; } @@ -477,6 +494,8 @@ static int hpfs_rmdir(struct inode *dir, struct dentry *dentry) out1: hpfs_brelse4(&qbh); out: + if (!err) + hpfs_update_directory_times(dir); hpfs_unlock(dir->i_sb); return err; } @@ -595,7 +614,7 @@ static int hpfs_rename(struct inode *old_dir, struct dentry *old_dentry, goto end1; } - end: +end: hpfs_i(i)->i_parent_dir = new_dir->i_ino; if (S_ISDIR(i->i_mode)) { inc_nlink(new_dir); @@ -610,6 +629,10 @@ static int hpfs_rename(struct inode *old_dir, struct dentry *old_dentry, brelse(bh); } end1: + if (!err) { + hpfs_update_directory_times(old_dir); + hpfs_update_directory_times(new_dir); + } hpfs_unlock(i->i_sb); return err; } From 97a1e828cc66ee7f1c0178d92c30042c1851e3bf Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Thu, 22 Aug 2013 18:09:47 +0400 Subject: [PATCH 224/359] xtensa: don't use echo -e needlessly commit 123f15e669d5a5a2e2f260ba4a5fc2efd93df20e upstream. -e is not needed to output strings without escape sequences. This breaks big endian FSF build when the shell is dash, because its builtin echo doesn't understand '-e' switch and outputs it in the echoed string. Reported-by: Guenter Roeck Signed-off-by: Max Filippov Signed-off-by: Chris Zankel Cc: Sudip Mukherjee Signed-off-by: Greg Kroah-Hartman --- arch/xtensa/Makefile | 4 ++-- arch/xtensa/boot/Makefile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/xtensa/Makefile b/arch/xtensa/Makefile index 136224b74d4f0e..81250ece3062ae 100644 --- a/arch/xtensa/Makefile +++ b/arch/xtensa/Makefile @@ -55,10 +55,10 @@ ifneq ($(CONFIG_LD_NO_RELAX),) LDFLAGS := --no-relax endif -ifeq ($(shell echo -e __XTENSA_EB__ | $(CC) -E - | grep -v "\#"),1) +ifeq ($(shell echo __XTENSA_EB__ | $(CC) -E - | grep -v "\#"),1) CHECKFLAGS += -D__XTENSA_EB__ endif -ifeq ($(shell echo -e __XTENSA_EL__ | $(CC) -E - | grep -v "\#"),1) +ifeq ($(shell echo __XTENSA_EL__ | $(CC) -E - | grep -v "\#"),1) CHECKFLAGS += -D__XTENSA_EL__ endif diff --git a/arch/xtensa/boot/Makefile b/arch/xtensa/boot/Makefile index 64ffc4b53df646..ca20a892021bb6 100644 --- a/arch/xtensa/boot/Makefile +++ b/arch/xtensa/boot/Makefile @@ -12,7 +12,7 @@ KBUILD_CFLAGS += -fno-builtin -Iarch/$(ARCH)/boot/include HOSTFLAGS += -Iarch/$(ARCH)/boot/include -BIG_ENDIAN := $(shell echo -e __XTENSA_EB__ | $(CC) -E - | grep -v "\#") +BIG_ENDIAN := $(shell echo __XTENSA_EB__ | $(CC) -E - | grep -v "\#") export ccflags-y export BIG_ENDIAN From bfc167418de5987d6ec7d913459a1ee3c11763fb Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 21 Sep 2015 10:00:25 -0700 Subject: [PATCH 225/359] Linux 3.10.89 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e94ce68ecf87fb..ca82393e1eea26 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 10 -SUBLEVEL = 88 +SUBLEVEL = 89 EXTRAVERSION = NAME = TOSSUG Baby Fish From 6b7d2f5b6ef27a89a0aee245a94d988e9ce8315e Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Mon, 10 Aug 2015 17:35:07 -0500 Subject: [PATCH 226/359] unshare: Unsharing a thread does not require unsharing a vm commit 12c641ab8270f787dfcce08b5f20ce8b65008096 upstream. In the logic in the initial commit of unshare made creating a new thread group for a process, contingent upon creating a new memory address space for that process. That is wrong. Two separate processes in different thread groups can share a memory address space and clone allows creation of such proceses. This is significant because it was observed that mm_users > 1 does not mean that a process is multi-threaded, as reading /proc/PID/maps temporarily increments mm_users, which allows other processes to (accidentally) interfere with unshare() calls. Correct the check in check_unshare_flags() to test for !thread_group_empty() for CLONE_THREAD, CLONE_SIGHAND, and CLONE_VM. For sighand->count > 1 for CLONE_SIGHAND and CLONE_VM. For !current_is_single_threaded instead of mm_users > 1 for CLONE_VM. By using the correct checks in unshare this removes the possibility of an accidental denial of service attack. Additionally using the correct checks in unshare ensures that only an explicit unshare(CLONE_VM) can possibly trigger the slow path of current_is_single_threaded(). As an explict unshare(CLONE_VM) is pointless it is not expected there are many applications that make that call. Fixes: b2e0d98705e60e45bbb3c0032c48824ad7ae0704 userns: Implement unshare of the user namespace Reported-by: Ricky Zhou Reported-by: Kees Cook Reviewed-by: Kees Cook Signed-off-by: "Eric W. Biederman" Signed-off-by: Greg Kroah-Hartman --- kernel/fork.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/kernel/fork.c b/kernel/fork.c index 514dbc40f98fcd..2358bd4c875708 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -1760,13 +1760,21 @@ static int check_unshare_flags(unsigned long unshare_flags) CLONE_NEWUSER|CLONE_NEWPID)) return -EINVAL; /* - * Not implemented, but pretend it works if there is nothing to - * unshare. Note that unsharing CLONE_THREAD or CLONE_SIGHAND - * needs to unshare vm. + * Not implemented, but pretend it works if there is nothing + * to unshare. Note that unsharing the address space or the + * signal handlers also need to unshare the signal queues (aka + * CLONE_THREAD). */ if (unshare_flags & (CLONE_THREAD | CLONE_SIGHAND | CLONE_VM)) { - /* FIXME: get_task_mm() increments ->mm_users */ - if (atomic_read(¤t->mm->mm_users) > 1) + if (!thread_group_empty(current)) + return -EINVAL; + } + if (unshare_flags & (CLONE_SIGHAND | CLONE_VM)) { + if (atomic_read(¤t->sighand->count) > 1) + return -EINVAL; + } + if (unshare_flags & CLONE_VM) { + if (!current_is_single_threaded()) return -EINVAL; } @@ -1839,16 +1847,16 @@ SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags) */ if (unshare_flags & CLONE_NEWPID) unshare_flags |= CLONE_THREAD; - /* - * If unsharing a thread from a thread group, must also unshare vm. - */ - if (unshare_flags & CLONE_THREAD) - unshare_flags |= CLONE_VM; /* * If unsharing vm, must also unshare signal handlers. */ if (unshare_flags & CLONE_VM) unshare_flags |= CLONE_SIGHAND; + /* + * If unsharing a signal handlers, must also unshare the signal queues. + */ + if (unshare_flags & CLONE_SIGHAND) + unshare_flags |= CLONE_THREAD; /* * If unsharing namespace, must also unshare filesystem information. */ From f04fce5fcb1a6de2cf2f80c414ec9f16dbb15f6e Mon Sep 17 00:00:00 2001 From: Adrien Schildknecht Date: Wed, 19 Aug 2015 17:33:12 +0200 Subject: [PATCH 227/359] rtlwifi: rtl8192cu: Add new device ID commit 1642d09fb9b128e8e538b2a4179962a34f38dff9 upstream. The v2 of NetGear WNA1000M uses a different idProduct: USB ID 0846:9043 Signed-off-by: Adrien Schildknecht Acked-by: Larry Finger Signed-off-by: Kalle Valo Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c index 7555095e0b74ce..fa669b52fc9153 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c @@ -313,6 +313,7 @@ static struct usb_device_id rtl8192c_usb_ids[] = { {RTL_USB_DEVICE(0x07b8, 0x8188, rtl92cu_hal_cfg)}, /*Abocom - Abocom*/ {RTL_USB_DEVICE(0x07b8, 0x8189, rtl92cu_hal_cfg)}, /*Funai - Abocom*/ {RTL_USB_DEVICE(0x0846, 0x9041, rtl92cu_hal_cfg)}, /*NetGear WNA1000M*/ + {RTL_USB_DEVICE(0x0846, 0x9043, rtl92cu_hal_cfg)}, /*NG WNA1000Mv2*/ {RTL_USB_DEVICE(0x0b05, 0x17ba, rtl92cu_hal_cfg)}, /*ASUS-Edimax*/ {RTL_USB_DEVICE(0x0bda, 0x5088, rtl92cu_hal_cfg)}, /*Thinkware-CC&C*/ {RTL_USB_DEVICE(0x0df6, 0x0052, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/ From f4487c483c26c0374450e0e910a45a7c0e91407d Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Tue, 1 Sep 2015 18:07:41 +0200 Subject: [PATCH 228/359] tg3: Fix temperature reporting commit d3d11fe08ccc9bff174fc958722b5661f0932486 upstream. The temperature registers appear to report values in degrees Celsius while the hwmon API mandates values to be exposed in millidegrees Celsius. Do the conversion so that the values reported by "sensors" are correct. Fixes: aed93e0bf493 ("tg3: Add hwmon support for temperature") Signed-off-by: Jean Delvare Cc: Prashant Sreedharan Cc: Michael Chan Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/broadcom/tg3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 680d26d6d2c308..518cc4b6c7ddcb 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c @@ -10518,7 +10518,7 @@ static ssize_t tg3_show_temp(struct device *dev, tg3_ape_scratchpad_read(tp, &temperature, attr->index, sizeof(temperature)); spin_unlock_bh(&tp->lock); - return sprintf(buf, "%u\n", temperature); + return sprintf(buf, "%u\n", temperature * 1000); } From 957c0c65c71536c95d0cd92e9a4583272402567d Mon Sep 17 00:00:00 2001 From: Bob Copeland Date: Sat, 13 Jun 2015 10:16:31 -0400 Subject: [PATCH 229/359] mac80211: enable assoc check for mesh interfaces commit 3633ebebab2bbe88124388b7620442315c968e8f upstream. We already set a station to be associated when peering completes, both in user space and in the kernel. Thus we should always have an associated sta before sending data frames to that station. Failure to check assoc state can cause crashes in the lower-level driver due to transmitting unicast data frames before driver sta structures (e.g. ampdu state in ath9k) are initialized. This occurred when forwarding in the presence of fixed mesh paths: frames were transmitted to stations with whom we hadn't yet completed peering. Reported-by: Alexis Green Tested-by: Jesse Jones Signed-off-by: Bob Copeland Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- net/mac80211/tx.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 10eea232602253..e960fbe9e27139 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -281,9 +281,6 @@ ieee80211_tx_h_check_assoc(struct ieee80211_tx_data *tx) if (tx->sdata->vif.type == NL80211_IFTYPE_WDS) return TX_CONTINUE; - if (tx->sdata->vif.type == NL80211_IFTYPE_MESH_POINT) - return TX_CONTINUE; - if (tx->flags & IEEE80211_TX_PS_BUFFERED) return TX_CONTINUE; From f828609ff36c1180c06e307d2c51d4ede337f7da Mon Sep 17 00:00:00 2001 From: Jeff Vander Stoep Date: Tue, 18 Aug 2015 20:50:10 +0100 Subject: [PATCH 230/359] arm64: kconfig: Move LIST_POISON to a safe value commit bf0c4e04732479f650ff59d1ee82de761c0071f0 upstream. Move the poison pointer offset to 0xdead000000000000, a recognized value that is not mappable by user-space exploits. Acked-by: Catalin Marinas Signed-off-by: Thierry Strudel Signed-off-by: Jeff Vander Stoep Signed-off-by: Will Deacon Signed-off-by: Greg Kroah-Hartman --- arch/arm64/Kconfig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 0677ff4814fa0f..661ccf87b9ad28 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -56,6 +56,10 @@ config NO_IOPORT config STACKTRACE_SUPPORT def_bool y +config ILLEGAL_POINTER_VALUE + hex + default 0xdead000000000000 + config LOCKDEP_SUPPORT def_bool y From a507adf4f05a41a638cd6cbdfd78149c35cec8db Mon Sep 17 00:00:00 2001 From: Will Deacon Date: Tue, 15 Sep 2015 12:07:06 +0100 Subject: [PATCH 231/359] arm64: compat: fix vfp save/restore across signal handlers in big-endian commit bdec97a855ef1e239f130f7a11584721c9a1bf04 upstream. When saving/restoring the VFP registers from a compat (AArch32) signal frame, we rely on the compat registers forming a prefix of the native register file and therefore make use of copy_{to,from}_user to transfer between the native fpsimd_state and the compat_vfp_sigframe. Unfortunately, this doesn't work so well in a big-endian environment. Our fpsimd save/restore code operates directly on 128-bit quantities (Q registers) whereas the compat_vfp_sigframe represents the registers as an array of 64-bit (D) registers. The architecture packs the compat D registers into the Q registers, with the least significant bytes holding the lower register. Consequently, we need to swap the 64-bit halves when converting between these two representations on a big-endian machine. This patch replaces the __copy_{to,from}_user invocations in our compat VFP signal handling code with explicit __put_user loops that operate on 64-bit values and swap them accordingly. Reviewed-by: Catalin Marinas Signed-off-by: Will Deacon Signed-off-by: Greg Kroah-Hartman --- arch/arm64/kernel/signal32.c | 47 +++++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/arch/arm64/kernel/signal32.c b/arch/arm64/kernel/signal32.c index b9564b8d6bab4b..1e60acc6a4d7a2 100644 --- a/arch/arm64/kernel/signal32.c +++ b/arch/arm64/kernel/signal32.c @@ -231,14 +231,32 @@ int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from) /* * VFP save/restore code. + * + * We have to be careful with endianness, since the fpsimd context-switch + * code operates on 128-bit (Q) register values whereas the compat ABI + * uses an array of 64-bit (D) registers. Consequently, we need to swap + * the two halves of each Q register when running on a big-endian CPU. */ +union __fpsimd_vreg { + __uint128_t raw; + struct { +#ifdef __AARCH64EB__ + u64 hi; + u64 lo; +#else + u64 lo; + u64 hi; +#endif + }; +}; + static int compat_preserve_vfp_context(struct compat_vfp_sigframe __user *frame) { struct fpsimd_state *fpsimd = ¤t->thread.fpsimd_state; compat_ulong_t magic = VFP_MAGIC; compat_ulong_t size = VFP_STORAGE_SIZE; compat_ulong_t fpscr, fpexc; - int err = 0; + int i, err = 0; /* * Save the hardware registers to the fpsimd_state structure. @@ -254,10 +272,15 @@ static int compat_preserve_vfp_context(struct compat_vfp_sigframe __user *frame) /* * Now copy the FP registers. Since the registers are packed, * we can copy the prefix we want (V0-V15) as it is. - * FIXME: Won't work if big endian. */ - err |= __copy_to_user(&frame->ufp.fpregs, fpsimd->vregs, - sizeof(frame->ufp.fpregs)); + for (i = 0; i < ARRAY_SIZE(frame->ufp.fpregs); i += 2) { + union __fpsimd_vreg vreg = { + .raw = fpsimd->vregs[i >> 1], + }; + + __put_user_error(vreg.lo, &frame->ufp.fpregs[i], err); + __put_user_error(vreg.hi, &frame->ufp.fpregs[i + 1], err); + } /* Create an AArch32 fpscr from the fpsr and the fpcr. */ fpscr = (fpsimd->fpsr & VFP_FPSCR_STAT_MASK) | @@ -282,7 +305,7 @@ static int compat_restore_vfp_context(struct compat_vfp_sigframe __user *frame) compat_ulong_t magic = VFP_MAGIC; compat_ulong_t size = VFP_STORAGE_SIZE; compat_ulong_t fpscr; - int err = 0; + int i, err = 0; __get_user_error(magic, &frame->magic, err); __get_user_error(size, &frame->size, err); @@ -292,12 +315,14 @@ static int compat_restore_vfp_context(struct compat_vfp_sigframe __user *frame) if (magic != VFP_MAGIC || size != VFP_STORAGE_SIZE) return -EINVAL; - /* - * Copy the FP registers into the start of the fpsimd_state. - * FIXME: Won't work if big endian. - */ - err |= __copy_from_user(fpsimd.vregs, frame->ufp.fpregs, - sizeof(frame->ufp.fpregs)); + /* Copy the FP registers into the start of the fpsimd_state. */ + for (i = 0; i < ARRAY_SIZE(frame->ufp.fpregs); i += 2) { + union __fpsimd_vreg vreg; + + __get_user_error(vreg.lo, &frame->ufp.fpregs[i], err); + __get_user_error(vreg.hi, &frame->ufp.fpregs[i + 1], err); + fpsimd.vregs[i >> 1] = vreg.raw; + } /* Extract the fpsr and the fpcr from the fpscr */ __get_user_error(fpscr, &frame->ufp.fpscr, err); From 8a31f0de7f474c13bcb4312f5c517bc594330f68 Mon Sep 17 00:00:00 2001 From: Will Deacon Date: Wed, 2 Sep 2015 18:49:28 +0100 Subject: [PATCH 232/359] arm64: head.S: initialise mdcr_el2 in el2_setup commit d10bcd473301888f957ec4b6b12aa3621be78d59 upstream. When entering the kernel at EL2, we fail to initialise the MDCR_EL2 register which controls debug access and PMU capabilities at EL1. This patch ensures that the register is initialised so that all traps are disabled and all the PMU counters are available to the host. When a guest is scheduled, KVM takes care to configure trapping appropriately. Acked-by: Marc Zyngier Signed-off-by: Will Deacon Signed-off-by: Greg Kroah-Hartman --- arch/arm64/kernel/head.S | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S index 53dcae49e72965..f480e7d6e8b220 100644 --- a/arch/arm64/kernel/head.S +++ b/arch/arm64/kernel/head.S @@ -184,6 +184,11 @@ ENTRY(el2_setup) msr hstr_el2, xzr // Disable CP15 traps to EL2 #endif + /* EL2 debug */ + mrs x0, pmcr_el0 // Disable debug access traps + ubfx x0, x0, #11, #5 // to EL2 and allow access to + msr mdcr_el2, x0 // all PMU counters from EL1 + /* Stage-2 translation */ msr vttbr_el2, xzr From e8c2bbe98ae6636123043bf7a9bf908635b1c5cc Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 13 Aug 2015 18:02:39 +0200 Subject: [PATCH 233/359] ALSA: hda - Enable headphone jack detect on old Fujitsu laptops commit bb148bdeb0ab16fc0ae8009799471e4d7180073b upstream. According to the bug report, FSC Amilo laptops with ALC880 can detect the headphone jack but currently the driver disables it. It's partly intentionally, as non-working jack detect was reported in the past. Let's enable now. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=102501 Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/pci/hda/patch_realtek.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index d30252e7f3e816..23f8241924b9ab 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -1137,7 +1137,7 @@ static const struct hda_fixup alc880_fixups[] = { /* override all pins as BIOS on old Amilo is broken */ .type = HDA_FIXUP_PINS, .v.pins = (const struct hda_pintbl[]) { - { 0x14, 0x0121411f }, /* HP */ + { 0x14, 0x0121401f }, /* HP */ { 0x15, 0x99030120 }, /* speaker */ { 0x16, 0x99030130 }, /* bass speaker */ { 0x17, 0x411111f0 }, /* N/A */ @@ -1157,7 +1157,7 @@ static const struct hda_fixup alc880_fixups[] = { /* almost compatible with FUJITSU, but no bass and SPDIF */ .type = HDA_FIXUP_PINS, .v.pins = (const struct hda_pintbl[]) { - { 0x14, 0x0121411f }, /* HP */ + { 0x14, 0x0121401f }, /* HP */ { 0x15, 0x99030120 }, /* speaker */ { 0x16, 0x411111f0 }, /* N/A */ { 0x17, 0x411111f0 }, /* N/A */ From 4c9510d519440ca46a4bf8f72ad72f842db22432 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 13 Aug 2015 18:05:06 +0200 Subject: [PATCH 234/359] ALSA: hda - Use ALC880_FIXUP_FUJITSU for FSC Amilo M1437 commit a161574e200ae63a5042120e0d8c36830e81bde3 upstream. It turned out that the machine has a bass speaker, so take a correct fixup entry. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=102501 Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/pci/hda/patch_realtek.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 23f8241924b9ab..183a96ab25331d 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -1365,7 +1365,7 @@ static const struct snd_pci_quirk alc880_fixup_tbl[] = { SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810), SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM), SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE), - SND_PCI_QUIRK(0x1734, 0x107c, "FSC F1734", ALC880_FIXUP_F1734), + SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU), SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU), SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734), SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU), From 36e5789bc706a67a0281a14b3888b3f5d0f723e0 Mon Sep 17 00:00:00 2001 From: Michael Ellerman Date: Fri, 7 Aug 2015 16:19:43 +1000 Subject: [PATCH 235/359] powerpc/mm: Fix pte_pagesize_index() crash on 4K w/64K hash commit 74b5037baa2011a2799e2c43adde7d171b072f9e upstream. The powerpc kernel can be built to have either a 4K PAGE_SIZE or a 64K PAGE_SIZE. However when built with a 4K PAGE_SIZE there is an additional config option which can be enabled, PPC_HAS_HASH_64K, which means the kernel also knows how to hash a 64K page even though the base PAGE_SIZE is 4K. This is used in one obscure configuration, to support 64K pages for SPU local store on the Cell processor when the rest of the kernel is using 4K pages. In this configuration, pte_pagesize_index() is defined to just pass through its arguments to get_slice_psize(). However pte_pagesize_index() is called for both user and kernel addresses, whereas get_slice_psize() only knows how to handle user addresses. This has been broken forever, however until recently it happened to work. That was because in get_slice_psize() the large kernel address would cause the right shift of the slice mask to return zero. However in commit 7aa0727f3302 ("powerpc/mm: Increase the slice range to 64TB"), the get_slice_psize() code was changed so that instead of a right shift we do an array lookup based on the address. When passed a kernel address this means we index way off the end of the slice array and return random junk. That is only fatal if we happen to hit something non-zero, but when we do return a non-zero value we confuse the MMU code and eventually cause a check stop. This fix is ugly, but simple. When we're called for a kernel address we return 4K, which is always correct in this configuration, otherwise we use the slice mask. Fixes: 7aa0727f3302 ("powerpc/mm: Increase the slice range to 64TB") Reported-by: Cyril Bur Signed-off-by: Michael Ellerman Reviewed-by: Aneesh Kumar K.V Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/include/asm/pgtable-ppc64.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h b/arch/powerpc/include/asm/pgtable-ppc64.h index e3d55f6f24fe18..6fbb2b46098c3d 100644 --- a/arch/powerpc/include/asm/pgtable-ppc64.h +++ b/arch/powerpc/include/asm/pgtable-ppc64.h @@ -130,7 +130,19 @@ #define pte_iterate_hashed_end() } while(0) #ifdef CONFIG_PPC_HAS_HASH_64K -#define pte_pagesize_index(mm, addr, pte) get_slice_psize(mm, addr) +/* + * We expect this to be called only for user addresses or kernel virtual + * addresses other than the linear mapping. + */ +#define pte_pagesize_index(mm, addr, pte) \ + ({ \ + unsigned int psize; \ + if (is_kernel_addr(addr)) \ + psize = MMU_PAGE_4K; \ + else \ + psize = get_slice_psize(mm, addr); \ + psize; \ + }) #else #define pte_pagesize_index(mm, addr, pte) MMU_PAGE_4K #endif From 2ba90c0e0638dba68ffe6e78b135729e41a4540a Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Fri, 17 Jul 2015 12:46:58 +0200 Subject: [PATCH 236/359] powerpc/rtas: Introduce rtas_get_sensor_fast() for IRQ handlers commit 1c2cb594441d02815d304cccec9742ff5c707495 upstream. The EPOW interrupt handler uses rtas_get_sensor(), which in turn uses rtas_busy_delay() to wait for RTAS becoming ready in case it is necessary. But rtas_busy_delay() is annotated with might_sleep() and thus may not be used by interrupts handlers like the EPOW handler! This leads to the following BUG when CONFIG_DEBUG_ATOMIC_SLEEP is enabled: BUG: sleeping function called from invalid context at arch/powerpc/kernel/rtas.c:496 in_atomic(): 1, irqs_disabled(): 1, pid: 0, name: swapper/1 CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.2.0-rc2-thuth #6 Call Trace: [c00000007ffe7b90] [c000000000807670] dump_stack+0xa0/0xdc (unreliable) [c00000007ffe7bc0] [c0000000000e1f14] ___might_sleep+0x134/0x180 [c00000007ffe7c20] [c00000000002aec0] rtas_busy_delay+0x30/0xd0 [c00000007ffe7c50] [c00000000002bde4] rtas_get_sensor+0x74/0xe0 [c00000007ffe7ce0] [c000000000083264] ras_epow_interrupt+0x44/0x450 [c00000007ffe7d90] [c000000000120260] handle_irq_event_percpu+0xa0/0x300 [c00000007ffe7e70] [c000000000120524] handle_irq_event+0x64/0xc0 [c00000007ffe7eb0] [c000000000124dbc] handle_fasteoi_irq+0xec/0x260 [c00000007ffe7ef0] [c00000000011f4f0] generic_handle_irq+0x50/0x80 [c00000007ffe7f20] [c000000000010f3c] __do_irq+0x8c/0x200 [c00000007ffe7f90] [c0000000000236cc] call_do_irq+0x14/0x24 [c00000007e6f39e0] [c000000000011144] do_IRQ+0x94/0x110 [c00000007e6f3a30] [c000000000002594] hardware_interrupt_common+0x114/0x180 Fix this issue by introducing a new rtas_get_sensor_fast() function that does not use rtas_busy_delay() - and thus can only be used for sensors that do not cause a BUSY condition - known as "fast" sensors. The EPOW sensor is defined to be "fast" in sPAPR - mpe. Fixes: 587f83e8dd50 ("powerpc/pseries: Use rtas_get_sensor in RAS code") Signed-off-by: Thomas Huth Reviewed-by: Nathan Fontenot Signed-off-by: Michael Ellerman Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/include/asm/rtas.h | 1 + arch/powerpc/kernel/rtas.c | 17 +++++++++++++++++ arch/powerpc/platforms/pseries/ras.c | 3 ++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h index 34fd70488d83f0..c5d5cb36f6c664 100644 --- a/arch/powerpc/include/asm/rtas.h +++ b/arch/powerpc/include/asm/rtas.h @@ -255,6 +255,7 @@ extern void rtas_power_off(void); extern void rtas_halt(void); extern void rtas_os_term(char *str); extern int rtas_get_sensor(int sensor, int index, int *state); +extern int rtas_get_sensor_fast(int sensor, int index, int *state); extern int rtas_get_power_level(int powerdomain, int *level); extern int rtas_set_power_level(int powerdomain, int level, int *setlevel); extern bool rtas_indicator_present(int token, int *maxindex); diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c index 52add6f3e201e1..f956a2f84a1525 100644 --- a/arch/powerpc/kernel/rtas.c +++ b/arch/powerpc/kernel/rtas.c @@ -584,6 +584,23 @@ int rtas_get_sensor(int sensor, int index, int *state) } EXPORT_SYMBOL(rtas_get_sensor); +int rtas_get_sensor_fast(int sensor, int index, int *state) +{ + int token = rtas_token("get-sensor-state"); + int rc; + + if (token == RTAS_UNKNOWN_SERVICE) + return -ENOENT; + + rc = rtas_call(token, 2, 2, state, sensor, index); + WARN_ON(rc == RTAS_BUSY || (rc >= RTAS_EXTENDED_DELAY_MIN && + rc <= RTAS_EXTENDED_DELAY_MAX)); + + if (rc < 0) + return rtas_error_rc(rc); + return rc; +} + bool rtas_indicator_present(int token, int *maxindex) { int proplen, count, i; diff --git a/arch/powerpc/platforms/pseries/ras.c b/arch/powerpc/platforms/pseries/ras.c index c4dfccd3a3d90b..2338e6e98483cf 100644 --- a/arch/powerpc/platforms/pseries/ras.c +++ b/arch/powerpc/platforms/pseries/ras.c @@ -187,7 +187,8 @@ static irqreturn_t ras_epow_interrupt(int irq, void *dev_id) int state; int critical; - status = rtas_get_sensor(EPOW_SENSOR_TOKEN, EPOW_SENSOR_INDEX, &state); + status = rtas_get_sensor_fast(EPOW_SENSOR_TOKEN, EPOW_SENSOR_INDEX, + &state); if (state > 3) critical = 1; /* Time Critical */ From 1d6c45737c391f980df36e9183f81f8b19632d37 Mon Sep 17 00:00:00 2001 From: Jeffery Miller Date: Tue, 1 Sep 2015 11:23:02 -0400 Subject: [PATCH 237/359] Add radeon suspend/resume quirk for HP Compaq dc5750. commit 09bfda10e6efd7b65bcc29237bee1765ed779657 upstream. With the radeon driver loaded the HP Compaq dc5750 Small Form Factor machine fails to resume from suspend. Adding a quirk similar to other devices avoids the problem and the system resumes properly. Signed-off-by: Jeffery Miller Signed-off-by: Alex Deucher Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/radeon/radeon_combios.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c index 8cac6981905445..9c64a973190e29 100644 --- a/drivers/gpu/drm/radeon/radeon_combios.c +++ b/drivers/gpu/drm/radeon/radeon_combios.c @@ -3403,6 +3403,14 @@ void radeon_combios_asic_init(struct drm_device *dev) rdev->pdev->subsystem_device == 0x30ae) return; + /* quirk for rs4xx HP Compaq dc5750 Small Form Factor to make it resume + * - it hangs on resume inside the dynclk 1 table. + */ + if (rdev->family == CHIP_RS480 && + rdev->pdev->subsystem_vendor == 0x103c && + rdev->pdev->subsystem_device == 0x280a) + return; + /* DYN CLK 1 */ table = combios_get_table_offset(dev, COMBIOS_DYN_CLK_1_TABLE); if (table) From 55b9029eab6e1cf44afa35b9823308246a0605d9 Mon Sep 17 00:00:00 2001 From: Minfei Huang Date: Sun, 12 Jul 2015 20:18:42 +0800 Subject: [PATCH 238/359] x86/mm: Initialize pmd_idx in page_table_range_init_count() commit 9962eea9e55f797f05f20ba6448929cab2a9f018 upstream. The variable pmd_idx is not initialized for the first iteration of the for loop. Assign the proper value which indexes the start address. Fixes: 719272c45b82 'x86, mm: only call early_ioremap_page_table_range_init() once' Signed-off-by: Minfei Huang Cc: tony.luck@intel.com Cc: wangnan0@huawei.com Cc: david.vrabel@citrix.com Reviewed-by: yinghai@kernel.org Link: http://lkml.kernel.org/r/1436703522-29552-1-git-send-email-mhuang@redhat.com Signed-off-by: Thomas Gleixner Signed-off-by: Greg Kroah-Hartman --- arch/x86/mm/init_32.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c index 3ac7e319918d41..6a70f0ee409235 100644 --- a/arch/x86/mm/init_32.c +++ b/arch/x86/mm/init_32.c @@ -137,6 +137,7 @@ page_table_range_init_count(unsigned long start, unsigned long end) vaddr = start; pgd_idx = pgd_index(vaddr); + pmd_idx = pmd_index(vaddr); for ( ; (pgd_idx < PTRS_PER_PGD) && (vaddr != end); pgd_idx++) { for (; (pmd_idx < PTRS_PER_PMD) && (vaddr != end); From 92a6eef0fb73b10dcc9fa3061d3ec2cf604d6d0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20H=C3=A4rdeman?= Date: Tue, 19 May 2015 19:03:12 -0300 Subject: [PATCH 239/359] rc-core: fix remove uevent generation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit a66b0c41ad277ae62a3ae6ac430a71882f899557 upstream. The input_dev is already gone when the rc device is being unregistered so checking for its presence only means that no remove uevent will be generated. Signed-off-by: David Härdeman Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/rc/rc-main.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c index 1cf382a0b27761..cf7bbb6c9807dd 100644 --- a/drivers/media/rc/rc-main.c +++ b/drivers/media/rc/rc-main.c @@ -943,9 +943,6 @@ static int rc_dev_uevent(struct device *device, struct kobj_uevent_env *env) { struct rc_dev *dev = to_rc_dev(device); - if (!dev || !dev->input_dev) - return -ENODEV; - if (dev->rc_map.name) ADD_HOTPLUG_VAR("NAME=%s", dev->rc_map.name); if (dev->driver_name) From 9520ac796ef656c8ca8f7b0dfc56651f185d845f Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Thu, 30 Jul 2015 13:00:56 +1000 Subject: [PATCH 240/359] NFSv4: don't set SETATTR for O_RDONLY|O_EXCL commit efcbc04e16dfa95fef76309f89710dd1d99a5453 upstream. It is unusual to combine the open flags O_RDONLY and O_EXCL, but it appears that libre-office does just that. [pid 3250] stat("/home/USER/.config", {st_mode=S_IFDIR|0700, st_size=8192, ...}) = 0 [pid 3250] open("/home/USER/.config/libreoffice/4-suse/user/extensions/buildid", O_RDONLY|O_EXCL NFSv4 takes O_EXCL as a sign that a setattr command should be sent, probably to reset the timestamps. When it was an O_RDONLY open, the SETATTR command does not identify any actual attributes to change. If no delegation was provided to the open, the SETATTR uses the all-zeros stateid and the request is accepted (at least by the Linux NFS server - no harm, no foul). If a read-delegation was provided, this is used in the SETATTR request, and a Netapp filer will justifiably claim NFS4ERR_BAD_STATEID, which the Linux client takes as a sign to retry - indefinitely. So only treat O_EXCL specially if O_CREAT was also given. Signed-off-by: NeilBrown Signed-off-by: Trond Myklebust Signed-off-by: Greg Kroah-Hartman --- fs/nfs/nfs4proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 20ebcfa3c92ecd..78679b489484d4 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -2043,7 +2043,7 @@ static int _nfs4_do_open(struct inode *dir, if (status != 0) goto err_opendata_put; - if ((opendata->o_arg.open_flags & O_EXCL) && + if ((opendata->o_arg.open_flags & (O_CREAT|O_EXCL)) == (O_CREAT|O_EXCL) && (opendata->o_arg.createmode != NFS4_CREATE_GUARDED)) { nfs4_exclusive_attrset(opendata, sattr); From 690eb5ee31ee70eb31565de1052147e20cc40ff0 Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Mon, 17 Aug 2015 12:57:07 -0500 Subject: [PATCH 241/359] NFS: nfs_set_pgio_error sometimes misses errors commit e9ae58aeee8842a50f7e199d602a5ccb2e41a95f upstream. We should ensure that we always set the pgio_header's error field if a READ or WRITE RPC call returns an error. The current code depends on 'hdr->good_bytes' always being initialised to a large value, which is not always done correctly by callers. When this happens, applications may end up missing important errors. Signed-off-by: Trond Myklebust Signed-off-by: Greg Kroah-Hartman --- fs/nfs/pagelist.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c index 29cfb7ade12127..d852ca281c16c2 100644 --- a/fs/nfs/pagelist.c +++ b/fs/nfs/pagelist.c @@ -60,8 +60,8 @@ EXPORT_SYMBOL_GPL(nfs_pgheader_init); void nfs_set_pgio_error(struct nfs_pgio_header *hdr, int error, loff_t pos) { spin_lock(&hdr->lock); - if (pos < hdr->io_start + hdr->good_bytes) { - set_bit(NFS_IOHDR_ERROR, &hdr->flags); + if (!test_and_set_bit(NFS_IOHDR_ERROR, &hdr->flags) + || pos < hdr->io_start + hdr->good_bytes) { clear_bit(NFS_IOHDR_EOF, &hdr->flags); hdr->good_bytes = pos - hdr->io_start; hdr->error = error; From 706ad8dcb5a2db85e6c2b2da30449c9a9918fa9d Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Thu, 3 Sep 2015 22:45:21 +0200 Subject: [PATCH 242/359] parisc: Filter out spurious interrupts in PA-RISC irq handler commit b1b4e435e4ef7de77f07bf2a42c8380b960c2d44 upstream. When detecting a serial port on newer PA-RISC machines (with iosapic) we have a long way to go to find the right IRQ line, registering it, then registering the serial port and the irq handler for the serial port. During this phase spurious interrupts for the serial port may happen which then crashes the kernel because the action handler might not have been set up yet. So, basically it's a race condition between the serial port hardware and the CPU which sets up the necessary fields in the irq sructs. The main reason for this race is, that we unmask the serial port irqs too early without having set up everything properly before (which isn't easily possible because we need the IRQ number to register the serial ports). This patch is a work-around for this problem. It adds checks to the CPU irq handler to verify if the IRQ action field has been initialized already. If not, we just skip this interrupt (which isn't critical for a serial port at bootup). The real fix would probably involve rewriting all PA-RISC specific IRQ code (for CPU, IOSAPIC, GSC and EISA) to use IRQ domains with proper parenting of the irq chips and proper irq enabling along this line. This bug has been in the PA-RISC port since the beginning, but the crashes happened very rarely with currently used hardware. But on the latest machine which I bought (a C8000 workstation), which uses the fastest CPUs (4 x PA8900, 1GHz) and which has the largest possible L1 cache size (64MB each), the kernel crashed at every boot because of this race. So, without this patch the machine would currently be unuseable. For the record, here is the flow logic: 1. serial_init_chip() in 8250_gsc.c calls iosapic_serial_irq(). 2. iosapic_serial_irq() calls txn_alloc_irq() to find the irq. 3. iosapic_serial_irq() calls cpu_claim_irq() to register the CPU irq 4. cpu_claim_irq() unmasks the CPU irq (which it shouldn't!) 5. serial_init_chip() then registers the 8250 port. Problems: - In step 4 the CPU irq shouldn't have been registered yet, but after step 5 - If serial irq happens between 4 and 5 have finished, the kernel will crash Signed-off-by: Helge Deller Signed-off-by: Greg Kroah-Hartman --- arch/parisc/kernel/irq.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c index 2e6443b1e92284..c32a37e0e0d2d5 100644 --- a/arch/parisc/kernel/irq.c +++ b/arch/parisc/kernel/irq.c @@ -524,8 +524,8 @@ void do_cpu_irq_mask(struct pt_regs *regs) struct pt_regs *old_regs; unsigned long eirr_val; int irq, cpu = smp_processor_id(); -#ifdef CONFIG_SMP struct irq_desc *desc; +#ifdef CONFIG_SMP cpumask_t dest; #endif @@ -538,8 +538,12 @@ void do_cpu_irq_mask(struct pt_regs *regs) goto set_out; irq = eirr_to_irq(eirr_val); -#ifdef CONFIG_SMP + /* Filter out spurious interrupts, mostly from serial port at bootup */ desc = irq_to_desc(irq); + if (unlikely(!desc->action)) + goto set_out; + +#ifdef CONFIG_SMP cpumask_copy(&dest, desc->irq_data.affinity); if (irqd_is_per_cpu(&desc->irq_data) && !cpu_isset(smp_processor_id(), dest)) { From de047ce49582e2fc3303efc58b40f4dbe7a4519f Mon Sep 17 00:00:00 2001 From: Jaewon Kim Date: Tue, 8 Sep 2015 15:02:21 -0700 Subject: [PATCH 243/359] vmscan: fix increasing nr_isolated incurred by putback unevictable pages commit c54839a722a02818677bcabe57e957f0ce4f841d upstream. reclaim_clean_pages_from_list() assumes that shrink_page_list() returns number of pages removed from the candidate list. But shrink_page_list() puts back mlocked pages without passing it to caller and without counting as nr_reclaimed. This increases nr_isolated. To fix this, this patch changes shrink_page_list() to pass unevictable pages back to caller. Caller will take care those pages. Minchan said: It fixes two issues. 1. With unevictable page, cma_alloc will be successful. Exactly speaking, cma_alloc of current kernel will fail due to unevictable pages. 2. fix leaking of NR_ISOLATED counter of vmstat With it, too_many_isolated works. Otherwise, it could make hang until the process get SIGKILL. Signed-off-by: Jaewon Kim Acked-by: Minchan Kim Cc: Mel Gorman Acked-by: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 233f0011f7680d..a1e3becef05e11 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -925,7 +925,7 @@ static unsigned long shrink_page_list(struct list_head *page_list, if (PageSwapCache(page)) try_to_free_swap(page); unlock_page(page); - putback_lru_page(page); + list_add(&page->lru, &ret_pages); continue; activate_locked: From 9bdee2f90804f2c5865b1c4a75d3208ef28b9007 Mon Sep 17 00:00:00 2001 From: Jann Horn Date: Wed, 9 Sep 2015 15:38:28 -0700 Subject: [PATCH 244/359] fs: if a coredump already exists, unlink and recreate with O_EXCL commit fbb1816942c04429e85dbf4c1a080accc534299e upstream. It was possible for an attacking user to trick root (or another user) into writing his coredumps into an attacker-readable, pre-existing file using rename() or link(), causing the disclosure of secret data from the victim process' virtual memory. Depending on the configuration, it was also possible to trick root into overwriting system files with coredumps. Fix that issue by never writing coredumps into existing files. Requirements for the attack: - The attack only applies if the victim's process has a nonzero RLIMIT_CORE and is dumpable. - The attacker can trick the victim into coredumping into an attacker-writable directory D, either because the core_pattern is relative and the victim's cwd is attacker-writable or because an absolute core_pattern pointing to a world-writable directory is used. - The attacker has one of these: A: on a system with protected_hardlinks=0: execute access to a folder containing a victim-owned, attacker-readable file on the same partition as D, and the victim-owned file will be deleted before the main part of the attack takes place. (In practice, there are lots of files that fulfill this condition, e.g. entries in Debian's /var/lib/dpkg/info/.) This does not apply to most Linux systems because most distros set protected_hardlinks=1. B: on a system with protected_hardlinks=1: execute access to a folder containing a victim-owned, attacker-readable and attacker-writable file on the same partition as D, and the victim-owned file will be deleted before the main part of the attack takes place. (This seems to be uncommon.) C: on any system, independent of protected_hardlinks: write access to a non-sticky folder containing a victim-owned, attacker-readable file on the same partition as D (This seems to be uncommon.) The basic idea is that the attacker moves the victim-owned file to where he expects the victim process to dump its core. The victim process dumps its core into the existing file, and the attacker reads the coredump from it. If the attacker can't move the file because he does not have write access to the containing directory, he can instead link the file to a directory he controls, then wait for the original link to the file to be deleted (because the kernel checks that the link count of the corefile is 1). A less reliable variant that requires D to be non-sticky works with link() and does not require deletion of the original link: link() the file into D, but then unlink() it directly before the kernel performs the link count check. On systems with protected_hardlinks=0, this variant allows an attacker to not only gain information from coredumps, but also clobber existing, victim-writable files with coredumps. (This could theoretically lead to a privilege escalation.) Signed-off-by: Jann Horn Cc: Kees Cook Cc: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- fs/coredump.c | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/fs/coredump.c b/fs/coredump.c index 1d402ce5b72f63..4f03b2b503756a 100644 --- a/fs/coredump.c +++ b/fs/coredump.c @@ -491,10 +491,10 @@ void do_coredump(siginfo_t *siginfo) const struct cred *old_cred; struct cred *cred; int retval = 0; - int flag = 0; int ispipe; struct files_struct *displaced; - bool need_nonrelative = false; + /* require nonrelative corefile path and be extra careful */ + bool need_suid_safe = false; bool core_dumped = false; static atomic_t core_dump_count = ATOMIC_INIT(0); struct coredump_params cprm = { @@ -528,9 +528,8 @@ void do_coredump(siginfo_t *siginfo) */ if (__get_dumpable(cprm.mm_flags) == SUID_DUMP_ROOT) { /* Setuid core dump mode */ - flag = O_EXCL; /* Stop rewrite attacks */ cred->fsuid = GLOBAL_ROOT_UID; /* Dump root private */ - need_nonrelative = true; + need_suid_safe = true; } retval = coredump_wait(siginfo->si_signo, &core_state); @@ -611,7 +610,7 @@ void do_coredump(siginfo_t *siginfo) if (cprm.limit < binfmt->min_coredump) goto fail_unlock; - if (need_nonrelative && cn.corename[0] != '/') { + if (need_suid_safe && cn.corename[0] != '/') { printk(KERN_WARNING "Pid %d(%s) can only dump core "\ "to fully qualified path!\n", task_tgid_vnr(current), current->comm); @@ -619,8 +618,35 @@ void do_coredump(siginfo_t *siginfo) goto fail_unlock; } + /* + * Unlink the file if it exists unless this is a SUID + * binary - in that case, we're running around with root + * privs and don't want to unlink another user's coredump. + */ + if (!need_suid_safe) { + mm_segment_t old_fs; + + old_fs = get_fs(); + set_fs(KERNEL_DS); + /* + * If it doesn't exist, that's fine. If there's some + * other problem, we'll catch it at the filp_open(). + */ + (void) sys_unlink((const char __user *)cn.corename); + set_fs(old_fs); + } + + /* + * There is a race between unlinking and creating the + * file, but if that causes an EEXIST here, that's + * fine - another process raced with us while creating + * the corefile, and the other process won. To userspace, + * what matters is that at least one of the two processes + * writes its coredump successfully, not which one. + */ cprm.file = filp_open(cn.corename, - O_CREAT | 2 | O_NOFOLLOW | O_LARGEFILE | flag, + O_CREAT | 2 | O_NOFOLLOW | + O_LARGEFILE | O_EXCL, 0600); if (IS_ERR(cprm.file)) goto fail_unlock; From ab7a4b4b9d31e0458a5f327d1da66d649d814066 Mon Sep 17 00:00:00 2001 From: Jialing Fu Date: Fri, 28 Aug 2015 11:13:09 +0800 Subject: [PATCH 245/359] mmc: core: fix race condition in mmc_wait_data_done commit 71f8a4b81d040b3d094424197ca2f1bf811b1245 upstream. The following panic is captured in ker3.14, but the issue still exists in latest kernel. --------------------------------------------------------------------- [ 20.738217] c0 3136 (Compiler) Unable to handle kernel NULL pointer dereference at virtual address 00000578 ...... [ 20.738499] c0 3136 (Compiler) PC is at _raw_spin_lock_irqsave+0x24/0x60 [ 20.738527] c0 3136 (Compiler) LR is at _raw_spin_lock_irqsave+0x20/0x60 [ 20.740134] c0 3136 (Compiler) Call trace: [ 20.740165] c0 3136 (Compiler) [] _raw_spin_lock_irqsave+0x24/0x60 [ 20.740200] c0 3136 (Compiler) [] __wake_up+0x1c/0x54 [ 20.740230] c0 3136 (Compiler) [] mmc_wait_data_done+0x28/0x34 [ 20.740262] c0 3136 (Compiler) [] mmc_request_done+0xa4/0x220 [ 20.740314] c0 3136 (Compiler) [] sdhci_tasklet_finish+0xac/0x264 [ 20.740352] c0 3136 (Compiler) [] tasklet_action+0xa0/0x158 [ 20.740382] c0 3136 (Compiler) [] __do_softirq+0x10c/0x2e4 [ 20.740411] c0 3136 (Compiler) [] irq_exit+0x8c/0xc0 [ 20.740439] c0 3136 (Compiler) [] handle_IRQ+0x48/0xac [ 20.740469] c0 3136 (Compiler) [] gic_handle_irq+0x38/0x7c ---------------------------------------------------------------------- Because in SMP, "mrq" has race condition between below two paths: path1: CPU0: static void mmc_wait_data_done(struct mmc_request *mrq) { mrq->host->context_info.is_done_rcv = true; // // If CPU0 has just finished "is_done_rcv = true" in path1, and at // this moment, IRQ or ICache line missing happens in CPU0. // What happens in CPU1 (path2)? // // If the mmcqd thread in CPU1(path2) hasn't entered to sleep mode: // path2 would have chance to break from wait_event_interruptible // in mmc_wait_for_data_req_done and continue to run for next // mmc_request (mmc_blk_rw_rq_prep). // // Within mmc_blk_rq_prep, mrq is cleared to 0. // If below line still gets host from "mrq" as the result of // compiler, the panic happens as we traced. wake_up_interruptible(&mrq->host->context_info.wait); } path2: CPU1: static int mmc_wait_for_data_req_done(... { ... while (1) { wait_event_interruptible(context_info->wait, (context_info->is_done_rcv || context_info->is_new_req)); static void mmc_blk_rw_rq_prep(... { ... memset(brq, 0, sizeof(struct mmc_blk_request)); This issue happens very coincidentally; however adding mdelay(1) in mmc_wait_data_done as below could duplicate it easily. static void mmc_wait_data_done(struct mmc_request *mrq) { mrq->host->context_info.is_done_rcv = true; + mdelay(1); wake_up_interruptible(&mrq->host->context_info.wait); } At runtime, IRQ or ICache line missing may just happen at the same place of the mdelay(1). This patch gets the mmc_context_info at the beginning of function, it can avoid this race condition. Signed-off-by: Jialing Fu Tested-by: Shawn Lin Fixes: 2220eedfd7ae ("mmc: fix async request mechanism ....") Signed-off-by: Shawn Lin Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/core/core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index c40396f23202d6..68ab26385d060f 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -327,8 +327,10 @@ EXPORT_SYMBOL(mmc_start_bkops); */ static void mmc_wait_data_done(struct mmc_request *mrq) { - mrq->host->context_info.is_done_rcv = true; - wake_up_interruptible(&mrq->host->context_info.wait); + struct mmc_context_info *context_info = &mrq->host->context_info; + + context_info->is_done_rcv = true; + wake_up_interruptible(&context_info->wait); } static void mmc_wait_done(struct mmc_request *mrq) From d3e972d5e77997cf0944d2c91162a9e893264c92 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Mon, 6 Jul 2015 17:37:49 +1000 Subject: [PATCH 246/359] md/raid10: always set reshape_safe when initializing reshape_position. commit 299b0685e31c9f3dcc2d58ee3beca761a40b44b3 upstream. 'reshape_position' tracks where in the reshape we have reached. 'reshape_safe' tracks where in the reshape we have safely recorded in the metadata. These are compared to determine when to update the metadata. So it is important that reshape_safe is initialised properly. Currently it isn't. When starting a reshape from the beginning it usually has the correct value by luck. But when reducing the number of devices in a RAID10, it has the wrong value and this leads to the metadata not being updated correctly. This can lead to corruption if the reshape is not allowed to complete. This patch is suitable for any -stable kernel which supports RAID10 reshape, which is 3.5 and later. Fixes: 3ea7daa5d7fd ("md/raid10: add reshape support") Signed-off-by: NeilBrown Signed-off-by: Greg Kroah-Hartman --- drivers/md/raid10.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index a1ea2a75391240..5b2a1eaea34d3c 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -3578,6 +3578,7 @@ static struct r10conf *setup_conf(struct mddev *mddev) /* far_copies must be 1 */ conf->prev.stride = conf->dev_sectors; } + conf->reshape_safe = conf->reshape_progress; spin_lock_init(&conf->device_lock); INIT_LIST_HEAD(&conf->retry_list); @@ -3785,7 +3786,6 @@ static int run(struct mddev *mddev) } conf->offset_diff = min_offset_diff; - conf->reshape_safe = conf->reshape_progress; clear_bit(MD_RECOVERY_SYNC, &mddev->recovery); clear_bit(MD_RECOVERY_CHECK, &mddev->recovery); set_bit(MD_RECOVERY_RESHAPE, &mddev->recovery); @@ -4130,6 +4130,7 @@ static int raid10_start_reshape(struct mddev *mddev) conf->reshape_progress = size; } else conf->reshape_progress = 0; + conf->reshape_safe = conf->reshape_progress; spin_unlock_irq(&conf->device_lock); if (mddev->delta_disks && mddev->bitmap) { @@ -4196,6 +4197,7 @@ static int raid10_start_reshape(struct mddev *mddev) rdev->new_data_offset = rdev->data_offset; smp_wmb(); conf->reshape_progress = MaxSector; + conf->reshape_safe = MaxSector; mddev->reshape_position = MaxSector; spin_unlock_irq(&conf->device_lock); return ret; @@ -4543,6 +4545,7 @@ static void end_reshape(struct r10conf *conf) md_finish_reshape(conf->mddev); smp_wmb(); conf->reshape_progress = MaxSector; + conf->reshape_safe = MaxSector; spin_unlock_irq(&conf->device_lock); /* read-ahead size must cover two whole stripes, which is From f8cb6399b16470397e7870e272ee7f3b03ed76ef Mon Sep 17 00:00:00 2001 From: David Vrabel Date: Fri, 9 Jan 2015 18:06:12 +0000 Subject: [PATCH 247/359] xen/gntdev: convert priv->lock to a mutex commit 1401c00e59ea021c575f74612fe2dbba36d6a4ee upstream. Unmapping may require sleeping and we unmap while holding priv->lock, so convert it to a mutex. Signed-off-by: David Vrabel Reviewed-by: Stefano Stabellini Cc: Ian Campbell Signed-off-by: Greg Kroah-Hartman --- drivers/xen/gntdev.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c index 474d11499d0ebe..e68205cbc46e6c 100644 --- a/drivers/xen/gntdev.c +++ b/drivers/xen/gntdev.c @@ -65,7 +65,7 @@ struct gntdev_priv { * Only populated if populate_freeable_maps == 1 */ struct list_head freeable_maps; /* lock protects maps and freeable_maps */ - spinlock_t lock; + struct mutex lock; struct mm_struct *mm; struct mmu_notifier mn; }; @@ -214,9 +214,9 @@ static void gntdev_put_map(struct gntdev_priv *priv, struct grant_map *map) } if (populate_freeable_maps && priv) { - spin_lock(&priv->lock); + mutex_lock(&priv->lock); list_del(&map->next); - spin_unlock(&priv->lock); + mutex_unlock(&priv->lock); } if (map->pages && !use_ptemod) @@ -392,9 +392,9 @@ static void gntdev_vma_close(struct vm_area_struct *vma) * not do any unmapping, since that has been done prior to * closing the vma, but it may still iterate the unmap_ops list. */ - spin_lock(&priv->lock); + mutex_lock(&priv->lock); map->vma = NULL; - spin_unlock(&priv->lock); + mutex_unlock(&priv->lock); } vma->vm_private_data = NULL; gntdev_put_map(priv, map); @@ -438,14 +438,14 @@ static void mn_invl_range_start(struct mmu_notifier *mn, struct gntdev_priv *priv = container_of(mn, struct gntdev_priv, mn); struct grant_map *map; - spin_lock(&priv->lock); + mutex_lock(&priv->lock); list_for_each_entry(map, &priv->maps, next) { unmap_if_in_range(map, start, end); } list_for_each_entry(map, &priv->freeable_maps, next) { unmap_if_in_range(map, start, end); } - spin_unlock(&priv->lock); + mutex_unlock(&priv->lock); } static void mn_invl_page(struct mmu_notifier *mn, @@ -462,7 +462,7 @@ static void mn_release(struct mmu_notifier *mn, struct grant_map *map; int err; - spin_lock(&priv->lock); + mutex_lock(&priv->lock); list_for_each_entry(map, &priv->maps, next) { if (!map->vma) continue; @@ -481,7 +481,7 @@ static void mn_release(struct mmu_notifier *mn, err = unmap_grant_pages(map, /* offset */ 0, map->count); WARN_ON(err); } - spin_unlock(&priv->lock); + mutex_unlock(&priv->lock); } static struct mmu_notifier_ops gntdev_mmu_ops = { @@ -503,7 +503,7 @@ static int gntdev_open(struct inode *inode, struct file *flip) INIT_LIST_HEAD(&priv->maps); INIT_LIST_HEAD(&priv->freeable_maps); - spin_lock_init(&priv->lock); + mutex_init(&priv->lock); if (use_ptemod) { priv->mm = get_task_mm(current); @@ -579,10 +579,10 @@ static long gntdev_ioctl_map_grant_ref(struct gntdev_priv *priv, return -EFAULT; } - spin_lock(&priv->lock); + mutex_lock(&priv->lock); gntdev_add_map(priv, map); op.index = map->index << PAGE_SHIFT; - spin_unlock(&priv->lock); + mutex_unlock(&priv->lock); if (copy_to_user(u, &op, sizeof(op)) != 0) return -EFAULT; @@ -601,7 +601,7 @@ static long gntdev_ioctl_unmap_grant_ref(struct gntdev_priv *priv, return -EFAULT; pr_debug("priv %p, del %d+%d\n", priv, (int)op.index, (int)op.count); - spin_lock(&priv->lock); + mutex_lock(&priv->lock); map = gntdev_find_map_index(priv, op.index >> PAGE_SHIFT, op.count); if (map) { list_del(&map->next); @@ -609,7 +609,7 @@ static long gntdev_ioctl_unmap_grant_ref(struct gntdev_priv *priv, list_add_tail(&map->next, &priv->freeable_maps); err = 0; } - spin_unlock(&priv->lock); + mutex_unlock(&priv->lock); if (map) gntdev_put_map(priv, map); return err; @@ -677,7 +677,7 @@ static long gntdev_ioctl_notify(struct gntdev_priv *priv, void __user *u) out_flags = op.action; out_event = op.event_channel_port; - spin_lock(&priv->lock); + mutex_lock(&priv->lock); list_for_each_entry(map, &priv->maps, next) { uint64_t begin = map->index << PAGE_SHIFT; @@ -705,7 +705,7 @@ static long gntdev_ioctl_notify(struct gntdev_priv *priv, void __user *u) rc = 0; unlock_out: - spin_unlock(&priv->lock); + mutex_unlock(&priv->lock); /* Drop the reference to the event channel we did not save in the map */ if (out_flags & UNMAP_NOTIFY_SEND_EVENT) @@ -755,7 +755,7 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma) pr_debug("map %d+%d at %lx (pgoff %lx)\n", index, count, vma->vm_start, vma->vm_pgoff); - spin_lock(&priv->lock); + mutex_lock(&priv->lock); map = gntdev_find_map_index(priv, index, count); if (!map) goto unlock_out; @@ -790,7 +790,7 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma) map->flags |= GNTMAP_readonly; } - spin_unlock(&priv->lock); + mutex_unlock(&priv->lock); if (use_ptemod) { err = apply_to_page_range(vma->vm_mm, vma->vm_start, @@ -818,11 +818,11 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma) return 0; unlock_out: - spin_unlock(&priv->lock); + mutex_unlock(&priv->lock); return err; out_unlock_put: - spin_unlock(&priv->lock); + mutex_unlock(&priv->lock); out_put_map: if (use_ptemod) map->vma = NULL; From 431152b6b341eefac26cef3d812ae52bc24df566 Mon Sep 17 00:00:00 2001 From: Hin-Tak Leung Date: Wed, 9 Sep 2015 15:38:07 -0700 Subject: [PATCH 248/359] hfs: fix B-tree corruption after insertion at position 0 commit b4cc0efea4f0bfa2477c56af406cfcf3d3e58680 upstream. Fix B-tree corruption when a new record is inserted at position 0 in the node in hfs_brec_insert(). This is an identical change to the corresponding hfs b-tree code to Sergei Antonov's "hfsplus: fix B-tree corruption after insertion at position 0", to keep similar code paths in the hfs and hfsplus drivers in sync, where appropriate. Signed-off-by: Hin-Tak Leung Cc: Sergei Antonov Cc: Joe Perches Reviewed-by: Vyacheslav Dubeyko Cc: Anton Altaparmakov Cc: Al Viro Cc: Christoph Hellwig Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- fs/hfs/brec.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/fs/hfs/brec.c b/fs/hfs/brec.c index 9f4ee7f5202615..6fc766df04617a 100644 --- a/fs/hfs/brec.c +++ b/fs/hfs/brec.c @@ -131,13 +131,16 @@ int hfs_brec_insert(struct hfs_find_data *fd, void *entry, int entry_len) hfs_bnode_write(node, entry, data_off + key_len, entry_len); hfs_bnode_dump(node); - if (new_node) { - /* update parent key if we inserted a key - * at the start of the first node - */ - if (!rec && new_node != node) - hfs_brec_update_parent(fd); + /* + * update parent key if we inserted a key + * at the start of the node and it is not the new node + */ + if (!rec && new_node != node) { + hfs_bnode_read_key(node, fd->search_key, data_off + size); + hfs_brec_update_parent(fd); + } + if (new_node) { hfs_bnode_put(fd->bnode); if (!new_node->parent) { hfs_btree_inc_height(tree); @@ -166,9 +169,6 @@ int hfs_brec_insert(struct hfs_find_data *fd, void *entry, int entry_len) goto again; } - if (!rec) - hfs_brec_update_parent(fd); - return 0; } @@ -366,6 +366,8 @@ static int hfs_brec_update_parent(struct hfs_find_data *fd) if (IS_ERR(parent)) return PTR_ERR(parent); __hfs_brec_find(parent, fd); + if (fd->record < 0) + return -ENOENT; hfs_bnode_dump(parent); rec = fd->record; From 939f8043048f59a4d77db1f5eeed1526a74a1503 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 26 Aug 2015 11:00:37 +0200 Subject: [PATCH 249/359] IB/uverbs: reject invalid or unknown opcodes commit b632ffa7cee439ba5dce3b3bc4a5cbe2b3e20133 upstream. We have many WR opcodes that are only supported in kernel space and/or require optional information to be copied into the WR structure. Reject all those not explicitly handled so that we can't pass invalid information to drivers. Signed-off-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Reviewed-by: Sagi Grimberg Signed-off-by: Doug Ledford Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/core/uverbs_cmd.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index a7d00f6b3bc1c8..44c15cebd43f60 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c @@ -2106,6 +2106,12 @@ ssize_t ib_uverbs_post_send(struct ib_uverbs_file *file, next->send_flags = user_wr->send_flags; if (is_ud) { + if (next->opcode != IB_WR_SEND && + next->opcode != IB_WR_SEND_WITH_IMM) { + ret = -EINVAL; + goto out_put; + } + next->wr.ud.ah = idr_read_ah(user_wr->wr.ud.ah, file->ucontext); if (!next->wr.ud.ah) { @@ -2142,9 +2148,11 @@ ssize_t ib_uverbs_post_send(struct ib_uverbs_file *file, user_wr->wr.atomic.compare_add; next->wr.atomic.swap = user_wr->wr.atomic.swap; next->wr.atomic.rkey = user_wr->wr.atomic.rkey; + case IB_WR_SEND: break; default: - break; + ret = -EINVAL; + goto out_put; } } From caf233503f3ce58ebe564c5d11aa53f2344a1053 Mon Sep 17 00:00:00 2001 From: Yishai Hadas Date: Thu, 13 Aug 2015 18:32:03 +0300 Subject: [PATCH 250/359] IB/uverbs: Fix race between ib_uverbs_open and remove_one commit 35d4a0b63dc0c6d1177d4f532a9deae958f0662c upstream. Fixes: 2a72f212263701b927559f6850446421d5906c41 ("IB/uverbs: Remove dev_table") Before this commit there was a device look-up table that was protected by a spin_lock used by ib_uverbs_open and by ib_uverbs_remove_one. When it was dropped and container_of was used instead, it enabled the race with remove_one as dev might be freed just after: dev = container_of(inode->i_cdev, struct ib_uverbs_device, cdev) but before the kref_get. In addition, this buggy patch added some dead code as container_of(x,y,z) can never be NULL and so dev can never be NULL. As a result the comment above ib_uverbs_open saying "the open method will either immediately run -ENXIO" is wrong as it can never happen. The solution follows Jason Gunthorpe suggestion from below URL: https://www.mail-archive.com/linux-rdma@vger.kernel.org/msg25692.html cdev will hold a kref on the parent (the containing structure, ib_uverbs_device) and only when that kref is released it is guaranteed that open will never be called again. In addition, fixes the active count scheme to use an atomic not a kref to prevent WARN_ON as pointed by above comment from Jason. Signed-off-by: Yishai Hadas Signed-off-by: Shachar Raindel Reviewed-by: Jason Gunthorpe Signed-off-by: Doug Ledford Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/core/uverbs.h | 3 +- drivers/infiniband/core/uverbs_main.c | 43 +++++++++++++++++++-------- 2 files changed, 32 insertions(+), 14 deletions(-) diff --git a/drivers/infiniband/core/uverbs.h b/drivers/infiniband/core/uverbs.h index 0fcd7aa26fa212..8b8de21bfdc54c 100644 --- a/drivers/infiniband/core/uverbs.h +++ b/drivers/infiniband/core/uverbs.h @@ -69,7 +69,7 @@ */ struct ib_uverbs_device { - struct kref ref; + atomic_t refcount; int num_comp_vectors; struct completion comp; struct device *dev; @@ -78,6 +78,7 @@ struct ib_uverbs_device { struct cdev cdev; struct rb_root xrcd_tree; struct mutex xrcd_tree_mutex; + struct kobject kobj; }; struct ib_uverbs_event_file { diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c index 949b386334964a..b6062b9236a20d 100644 --- a/drivers/infiniband/core/uverbs_main.c +++ b/drivers/infiniband/core/uverbs_main.c @@ -119,14 +119,18 @@ static ssize_t (*uverbs_cmd_table[])(struct ib_uverbs_file *file, static void ib_uverbs_add_one(struct ib_device *device); static void ib_uverbs_remove_one(struct ib_device *device); -static void ib_uverbs_release_dev(struct kref *ref) +static void ib_uverbs_release_dev(struct kobject *kobj) { struct ib_uverbs_device *dev = - container_of(ref, struct ib_uverbs_device, ref); + container_of(kobj, struct ib_uverbs_device, kobj); - complete(&dev->comp); + kfree(dev); } +static struct kobj_type ib_uverbs_dev_ktype = { + .release = ib_uverbs_release_dev, +}; + static void ib_uverbs_release_event_file(struct kref *ref) { struct ib_uverbs_event_file *file = @@ -282,13 +286,19 @@ static int ib_uverbs_cleanup_ucontext(struct ib_uverbs_file *file, return context->device->dealloc_ucontext(context); } +static void ib_uverbs_comp_dev(struct ib_uverbs_device *dev) +{ + complete(&dev->comp); +} + static void ib_uverbs_release_file(struct kref *ref) { struct ib_uverbs_file *file = container_of(ref, struct ib_uverbs_file, ref); module_put(file->device->ib_dev->owner); - kref_put(&file->device->ref, ib_uverbs_release_dev); + if (atomic_dec_and_test(&file->device->refcount)) + ib_uverbs_comp_dev(file->device); kfree(file); } @@ -629,9 +639,7 @@ static int ib_uverbs_open(struct inode *inode, struct file *filp) int ret; dev = container_of(inode->i_cdev, struct ib_uverbs_device, cdev); - if (dev) - kref_get(&dev->ref); - else + if (!atomic_inc_not_zero(&dev->refcount)) return -ENXIO; if (!try_module_get(dev->ib_dev->owner)) { @@ -652,6 +660,7 @@ static int ib_uverbs_open(struct inode *inode, struct file *filp) mutex_init(&file->mutex); filp->private_data = file; + kobject_get(&dev->kobj); return nonseekable_open(inode, filp); @@ -659,13 +668,16 @@ static int ib_uverbs_open(struct inode *inode, struct file *filp) module_put(dev->ib_dev->owner); err: - kref_put(&dev->ref, ib_uverbs_release_dev); + if (atomic_dec_and_test(&dev->refcount)) + ib_uverbs_comp_dev(dev); + return ret; } static int ib_uverbs_close(struct inode *inode, struct file *filp) { struct ib_uverbs_file *file = filp->private_data; + struct ib_uverbs_device *dev = file->device; ib_uverbs_cleanup_ucontext(file, file->ucontext); @@ -673,6 +685,7 @@ static int ib_uverbs_close(struct inode *inode, struct file *filp) kref_put(&file->async_file->ref, ib_uverbs_release_event_file); kref_put(&file->ref, ib_uverbs_release_file); + kobject_put(&dev->kobj); return 0; } @@ -768,10 +781,11 @@ static void ib_uverbs_add_one(struct ib_device *device) if (!uverbs_dev) return; - kref_init(&uverbs_dev->ref); + atomic_set(&uverbs_dev->refcount, 1); init_completion(&uverbs_dev->comp); uverbs_dev->xrcd_tree = RB_ROOT; mutex_init(&uverbs_dev->xrcd_tree_mutex); + kobject_init(&uverbs_dev->kobj, &ib_uverbs_dev_ktype); spin_lock(&map_lock); devnum = find_first_zero_bit(dev_map, IB_UVERBS_MAX_DEVICES); @@ -798,6 +812,7 @@ static void ib_uverbs_add_one(struct ib_device *device) cdev_init(&uverbs_dev->cdev, NULL); uverbs_dev->cdev.owner = THIS_MODULE; uverbs_dev->cdev.ops = device->mmap ? &uverbs_mmap_fops : &uverbs_fops; + uverbs_dev->cdev.kobj.parent = &uverbs_dev->kobj; kobject_set_name(&uverbs_dev->cdev.kobj, "uverbs%d", uverbs_dev->devnum); if (cdev_add(&uverbs_dev->cdev, base, 1)) goto err_cdev; @@ -828,9 +843,10 @@ static void ib_uverbs_add_one(struct ib_device *device) clear_bit(devnum, overflow_map); err: - kref_put(&uverbs_dev->ref, ib_uverbs_release_dev); + if (atomic_dec_and_test(&uverbs_dev->refcount)) + ib_uverbs_comp_dev(uverbs_dev); wait_for_completion(&uverbs_dev->comp); - kfree(uverbs_dev); + kobject_put(&uverbs_dev->kobj); return; } @@ -850,9 +866,10 @@ static void ib_uverbs_remove_one(struct ib_device *device) else clear_bit(uverbs_dev->devnum - IB_UVERBS_MAX_DEVICES, overflow_map); - kref_put(&uverbs_dev->ref, ib_uverbs_release_dev); + if (atomic_dec_and_test(&uverbs_dev->refcount)) + ib_uverbs_comp_dev(uverbs_dev); wait_for_completion(&uverbs_dev->comp); - kfree(uverbs_dev); + kobject_put(&uverbs_dev->kobj); } static char *uverbs_devnode(struct device *dev, umode_t *mode) From a6d452e0f3d91f697b90650f21fb540c13d55b44 Mon Sep 17 00:00:00 2001 From: Jack Morgenstein Date: Thu, 30 Jul 2015 17:34:23 +0300 Subject: [PATCH 251/359] IB/mlx4: Forbid using sysfs to change RoCE pkeys commit 2b135db3e81301d0452e6aa107349abe67b097d6 upstream. The pkey mapping for RoCE must remain the default mapping: VFs: virtual index 0 = mapped to real index 0 (0xFFFF) All others indices: mapped to a real pkey index containing an invalid pkey. PF: virtual index i = real index i. Don't allow users to change these mappings using files found in sysfs. Fixes: c1e7e466120b ('IB/mlx4: Add iov directory in sysfs under the ib device') Signed-off-by: Jack Morgenstein Signed-off-by: Or Gerlitz Signed-off-by: Doug Ledford Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/hw/mlx4/sysfs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/mlx4/sysfs.c b/drivers/infiniband/hw/mlx4/sysfs.c index 97516eb363b70d..c5ce4082fdc7e4 100644 --- a/drivers/infiniband/hw/mlx4/sysfs.c +++ b/drivers/infiniband/hw/mlx4/sysfs.c @@ -563,6 +563,8 @@ static int add_port(struct mlx4_ib_dev *dev, int port_num, int slave) struct mlx4_port *p; int i; int ret; + int is_eth = rdma_port_get_link_layer(&dev->ib_dev, port_num) == + IB_LINK_LAYER_ETHERNET; p = kzalloc(sizeof *p, GFP_KERNEL); if (!p) @@ -580,7 +582,8 @@ static int add_port(struct mlx4_ib_dev *dev, int port_num, int slave) p->pkey_group.name = "pkey_idx"; p->pkey_group.attrs = - alloc_group_attrs(show_port_pkey, store_port_pkey, + alloc_group_attrs(show_port_pkey, + is_eth ? NULL : store_port_pkey, dev->dev->caps.pkey_table_len[port_num]); if (!p->pkey_group.attrs) goto err_alloc; From 2698f5747a861bc1ecfb35b08ffa3ffabc91a77f Mon Sep 17 00:00:00 2001 From: Noa Osherovich Date: Thu, 30 Jul 2015 17:34:24 +0300 Subject: [PATCH 252/359] IB/mlx4: Use correct SL on AH query under RoCE commit 5e99b139f1b68acd65e36515ca347b03856dfb5a upstream. The mlx4 IB driver implementation for ib_query_ah used a wrong offset (28 instead of 29) when link type is Ethernet. Fixed to use the correct one. Fixes: fa417f7b520e ('IB/mlx4: Add support for IBoE') Signed-off-by: Shani Michaeli Signed-off-by: Noa Osherovich Signed-off-by: Or Gerlitz Signed-off-by: Doug Ledford Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/hw/mlx4/ah.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/mlx4/ah.c b/drivers/infiniband/hw/mlx4/ah.c index a251becdaa987d..890c23b3d714e1 100644 --- a/drivers/infiniband/hw/mlx4/ah.c +++ b/drivers/infiniband/hw/mlx4/ah.c @@ -169,9 +169,13 @@ int mlx4_ib_query_ah(struct ib_ah *ibah, struct ib_ah_attr *ah_attr) enum rdma_link_layer ll; memset(ah_attr, 0, sizeof *ah_attr); - ah_attr->sl = be32_to_cpu(ah->av.ib.sl_tclass_flowlabel) >> 28; ah_attr->port_num = be32_to_cpu(ah->av.ib.port_pd) >> 24; ll = rdma_port_get_link_layer(ibah->device, ah_attr->port_num); + if (ll == IB_LINK_LAYER_ETHERNET) + ah_attr->sl = be32_to_cpu(ah->av.eth.sl_tclass_flowlabel) >> 29; + else + ah_attr->sl = be32_to_cpu(ah->av.ib.sl_tclass_flowlabel) >> 28; + ah_attr->dlid = ll == IB_LINK_LAYER_INFINIBAND ? be16_to_cpu(ah->av.ib.dlid) : 0; if (ah->av.ib.stat_rate) ah_attr->static_rate = ah->av.ib.stat_rate - MLX4_STAT_RATE_OFFSET; From 61cabc7d549fde1afddac0efbbf03a5c63161b33 Mon Sep 17 00:00:00 2001 From: Hin-Tak Leung Date: Wed, 9 Sep 2015 15:38:04 -0700 Subject: [PATCH 253/359] hfs,hfsplus: cache pages correctly between bnode_create and bnode_free commit 7cb74be6fd827e314f81df3c5889b87e4c87c569 upstream. Pages looked up by __hfs_bnode_create() (called by hfs_bnode_create() and hfs_bnode_find() for finding or creating pages corresponding to an inode) are immediately kmap()'ed and used (both read and write) and kunmap()'ed, and should not be page_cache_release()'ed until hfs_bnode_free(). This patch fixes a problem I first saw in July 2012: merely running "du" on a large hfsplus-mounted directory a few times on a reasonably loaded system would get the hfsplus driver all confused and complaining about B-tree inconsistencies, and generates a "BUG: Bad page state". Most recently, I can generate this problem on up-to-date Fedora 22 with shipped kernel 4.0.5, by running "du /" (="/" + "/home" + "/mnt" + other smaller mounts) and "du /mnt" simultaneously on two windows, where /mnt is a lightly-used QEMU VM image of the full Mac OS X 10.9: $ df -i / /home /mnt Filesystem Inodes IUsed IFree IUse% Mounted on /dev/mapper/fedora-root 3276800 551665 2725135 17% / /dev/mapper/fedora-home 52879360 716221 52163139 2% /home /dev/nbd0p2 4294967295 1387818 4293579477 1% /mnt After applying the patch, I was able to run "du /" (60+ times) and "du /mnt" (150+ times) continuously and simultaneously for 6+ hours. There are many reports of the hfsplus driver getting confused under load and generating "BUG: Bad page state" or other similar issues over the years. [1] The unpatched code [2] has always been wrong since it entered the kernel tree. The only reason why it gets away with it is that the kmap/memcpy/kunmap follow very quickly after the page_cache_release() so the kernel has not had a chance to reuse the memory for something else, most of the time. The current RW driver appears to have followed the design and development of the earlier read-only hfsplus driver [3], where-by version 0.1 (Dec 2001) had a B-tree node-centric approach to read_cache_page()/page_cache_release() per bnode_get()/bnode_put(), migrating towards version 0.2 (June 2002) of caching and releasing pages per inode extents. When the current RW code first entered the kernel [2] in 2005, there was an REF_PAGES conditional (and "//" commented out code) to switch between B-node centric paging to inode-centric paging. There was a mistake with the direction of one of the REF_PAGES conditionals in __hfs_bnode_create(). In a subsequent "remove debug code" commit [4], the read_cache_page()/page_cache_release() per bnode_get()/bnode_put() were removed, but a page_cache_release() was mistakenly left in (propagating the "REF_PAGES <-> !REF_PAGE" mistake), and the commented-out page_cache_release() in bnode_release() (which should be spanned by !REF_PAGES) was never enabled. References: [1]: Michael Fox, Apr 2013 http://www.spinics.net/lists/linux-fsdevel/msg63807.html ("hfsplus volume suddenly inaccessable after 'hfs: recoff %d too large'") Sasha Levin, Feb 2015 http://lkml.org/lkml/2015/2/20/85 ("use after free") https://bugs.launchpad.net/ubuntu/+source/linux/+bug/740814 https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1027887 https://bugzilla.kernel.org/show_bug.cgi?id=42342 https://bugzilla.kernel.org/show_bug.cgi?id=63841 https://bugzilla.kernel.org/show_bug.cgi?id=78761 [2]: http://git.kernel.org/cgit/linux/kernel/git/tglx/history.git/commit/\ fs/hfs/bnode.c?id=d1081202f1d0ee35ab0beb490da4b65d4bc763db commit d1081202f1d0ee35ab0beb490da4b65d4bc763db Author: Andrew Morton Date: Wed Feb 25 16:17:36 2004 -0800 [PATCH] HFS rewrite http://git.kernel.org/cgit/linux/kernel/git/tglx/history.git/commit/\ fs/hfsplus/bnode.c?id=91556682e0bf004d98a529bf829d339abb98bbbd commit 91556682e0bf004d98a529bf829d339abb98bbbd Author: Andrew Morton Date: Wed Feb 25 16:17:48 2004 -0800 [PATCH] HFS+ support [3]: http://sourceforge.net/projects/linux-hfsplus/ http://sourceforge.net/projects/linux-hfsplus/files/Linux%202.4.x%20patch/hfsplus%200.1/ http://sourceforge.net/projects/linux-hfsplus/files/Linux%202.4.x%20patch/hfsplus%200.2/ http://linux-hfsplus.cvs.sourceforge.net/viewvc/linux-hfsplus/linux/\ fs/hfsplus/bnode.c?r1=1.4&r2=1.5 Date: Thu Jun 6 09:45:14 2002 +0000 Use buffer cache instead of page cache in bnode.c. Cache inode extents. [4]: http://git.kernel.org/cgit/linux/kernel/git/\ stable/linux-stable.git/commit/?id=a5e3985fa014029eb6795664c704953720cc7f7d commit a5e3985fa014029eb6795664c704953720cc7f7d Author: Roman Zippel Date: Tue Sep 6 15:18:47 2005 -0700 [PATCH] hfs: remove debug code Signed-off-by: Hin-Tak Leung Signed-off-by: Sergei Antonov Reviewed-by: Anton Altaparmakov Reported-by: Sasha Levin Cc: Al Viro Cc: Christoph Hellwig Cc: Vyacheslav Dubeyko Cc: Sougata Santra Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- fs/hfs/bnode.c | 9 ++++----- fs/hfsplus/bnode.c | 3 --- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/fs/hfs/bnode.c b/fs/hfs/bnode.c index d3fa6bd9503e76..221719eac5de66 100644 --- a/fs/hfs/bnode.c +++ b/fs/hfs/bnode.c @@ -288,7 +288,6 @@ static struct hfs_bnode *__hfs_bnode_create(struct hfs_btree *tree, u32 cnid) page_cache_release(page); goto fail; } - page_cache_release(page); node->page[i] = page; } @@ -398,11 +397,11 @@ struct hfs_bnode *hfs_bnode_find(struct hfs_btree *tree, u32 num) void hfs_bnode_free(struct hfs_bnode *node) { - //int i; + int i; - //for (i = 0; i < node->tree->pages_per_bnode; i++) - // if (node->page[i]) - // page_cache_release(node->page[i]); + for (i = 0; i < node->tree->pages_per_bnode; i++) + if (node->page[i]) + page_cache_release(node->page[i]); kfree(node); } diff --git a/fs/hfsplus/bnode.c b/fs/hfsplus/bnode.c index 11c860204520d3..bedfe5f7d332ec 100644 --- a/fs/hfsplus/bnode.c +++ b/fs/hfsplus/bnode.c @@ -456,7 +456,6 @@ static struct hfs_bnode *__hfs_bnode_create(struct hfs_btree *tree, u32 cnid) page_cache_release(page); goto fail; } - page_cache_release(page); node->page[i] = page; } @@ -568,13 +567,11 @@ struct hfs_bnode *hfs_bnode_find(struct hfs_btree *tree, u32 num) void hfs_bnode_free(struct hfs_bnode *node) { -#if 0 int i; for (i = 0; i < node->tree->pages_per_bnode; i++) if (node->page[i]) page_cache_release(node->page[i]); -#endif kfree(node); } From 7bf24986e3c2e4b818be4a6172aebb3784c6bcda Mon Sep 17 00:00:00 2001 From: Marcelo Ricardo Leitner Date: Fri, 12 Jun 2015 10:16:41 -0300 Subject: [PATCH 254/359] sctp: fix ASCONF list handling commit 2d45a02d0166caf2627fe91897c6ffc3b19514c4 upstream. ->auto_asconf_splist is per namespace and mangled by functions like sctp_setsockopt_auto_asconf() which doesn't guarantee any serialization. Also, the call to inet_sk_copy_descendant() was backuping ->auto_asconf_list through the copy but was not honoring ->do_auto_asconf, which could lead to list corruption if it was different between both sockets. This commit thus fixes the list handling by using ->addr_wq_lock spinlock to protect the list. A special handling is done upon socket creation and destruction for that. Error handlig on sctp_init_sock() will never return an error after having initialized asconf, so sctp_destroy_sock() can be called without addrq_wq_lock. The lock now will be take on sctp_close_sock(), before locking the socket, so we don't do it in inverse order compared to sctp_addr_wq_timeout_handler(). Instead of taking the lock on sctp_sock_migrate() for copying and restoring the list values, it's preferred to avoid rewritting it by implementing sctp_copy_descendant(). Issue was found with a test application that kept flipping sysctl default_auto_asconf on and off, but one could trigger it by issuing simultaneous setsockopt() calls on multiple sockets or by creating/destroying sockets fast enough. This is only triggerable locally. Fixes: 9f7d653b67ae ("sctp: Add Auto-ASCONF support (core).") Reported-by: Ji Jianwen Suggested-by: Neil Horman Suggested-by: Hannes Frederic Sowa Acked-by: Hannes Frederic Sowa Signed-off-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller [wangkai: backport to 3.10: adjust context] Signed-off-by: Wang Kai Signed-off-by: Greg Kroah-Hartman --- include/net/netns/sctp.h | 1 + include/net/sctp/structs.h | 4 ++++ net/sctp/socket.c | 43 ++++++++++++++++++++++++++++---------- 3 files changed, 37 insertions(+), 11 deletions(-) diff --git a/include/net/netns/sctp.h b/include/net/netns/sctp.h index 3573a81815ad9e..8ba379f9e4678d 100644 --- a/include/net/netns/sctp.h +++ b/include/net/netns/sctp.h @@ -31,6 +31,7 @@ struct netns_sctp { struct list_head addr_waitq; struct timer_list addr_wq_timer; struct list_head auto_asconf_splist; + /* Lock that protects both addr_waitq and auto_asconf_splist */ spinlock_t addr_wq_lock; /* Lock that protects the local_addr_list writers */ diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index da6b9a01ff75bc..b30c1d95be2c29 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h @@ -228,6 +228,10 @@ struct sctp_sock { atomic_t pd_mode; /* Receive to here while partial delivery is in effect. */ struct sk_buff_head pd_lobby; + + /* These must be the last fields, as they will skipped on copies, + * like on accept and peeloff operations + */ struct list_head auto_asconf_list; int do_auto_asconf; }; diff --git a/net/sctp/socket.c b/net/sctp/socket.c index dfb9b133e662c4..ec5766dc394603 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -1548,8 +1548,10 @@ SCTP_STATIC void sctp_close(struct sock *sk, long timeout) /* Supposedly, no process has access to the socket, but * the net layers still may. + * Also, sctp_destroy_sock() needs to be called with addr_wq_lock + * held and that should be grabbed before socket lock. */ - sctp_local_bh_disable(); + spin_lock_bh(&net->sctp.addr_wq_lock); sctp_bh_lock_sock(sk); /* Hold the sock, since sk_common_release() will put sock_put() @@ -1559,7 +1561,7 @@ SCTP_STATIC void sctp_close(struct sock *sk, long timeout) sk_common_release(sk); sctp_bh_unlock_sock(sk); - sctp_local_bh_enable(); + spin_unlock_bh(&net->sctp.addr_wq_lock); sock_put(sk); @@ -3508,6 +3510,7 @@ static int sctp_setsockopt_auto_asconf(struct sock *sk, char __user *optval, if ((val && sp->do_auto_asconf) || (!val && !sp->do_auto_asconf)) return 0; + spin_lock_bh(&sock_net(sk)->sctp.addr_wq_lock); if (val == 0 && sp->do_auto_asconf) { list_del(&sp->auto_asconf_list); sp->do_auto_asconf = 0; @@ -3516,6 +3519,7 @@ static int sctp_setsockopt_auto_asconf(struct sock *sk, char __user *optval, &sock_net(sk)->sctp.auto_asconf_splist); sp->do_auto_asconf = 1; } + spin_unlock_bh(&sock_net(sk)->sctp.addr_wq_lock); return 0; } @@ -4007,18 +4011,28 @@ SCTP_STATIC int sctp_init_sock(struct sock *sk) local_bh_disable(); percpu_counter_inc(&sctp_sockets_allocated); sock_prot_inuse_add(net, sk->sk_prot, 1); + + /* Nothing can fail after this block, otherwise + * sctp_destroy_sock() will be called without addr_wq_lock held + */ if (net->sctp.default_auto_asconf) { + spin_lock(&sock_net(sk)->sctp.addr_wq_lock); list_add_tail(&sp->auto_asconf_list, &net->sctp.auto_asconf_splist); sp->do_auto_asconf = 1; - } else + spin_unlock(&sock_net(sk)->sctp.addr_wq_lock); + } else { sp->do_auto_asconf = 0; + } + local_bh_enable(); return 0; } -/* Cleanup any SCTP per socket resources. */ +/* Cleanup any SCTP per socket resources. Must be called with + * sock_net(sk)->sctp.addr_wq_lock held if sp->do_auto_asconf is true + */ SCTP_STATIC void sctp_destroy_sock(struct sock *sk) { struct sctp_sock *sp; @@ -6957,6 +6971,19 @@ void sctp_copy_sock(struct sock *newsk, struct sock *sk, newinet->mc_list = NULL; } +static inline void sctp_copy_descendant(struct sock *sk_to, + const struct sock *sk_from) +{ + int ancestor_size = sizeof(struct inet_sock) + + sizeof(struct sctp_sock) - + offsetof(struct sctp_sock, auto_asconf_list); + + if (sk_from->sk_family == PF_INET6) + ancestor_size += sizeof(struct ipv6_pinfo); + + __inet_sk_copy_descendant(sk_to, sk_from, ancestor_size); +} + /* Populate the fields of the newsk from the oldsk and migrate the assoc * and its messages to the newsk. */ @@ -6971,7 +6998,6 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk, struct sk_buff *skb, *tmp; struct sctp_ulpevent *event; struct sctp_bind_hashbucket *head; - struct list_head tmplist; /* Migrate socket buffer sizes and all the socket level options to the * new socket. @@ -6979,12 +7005,7 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk, newsk->sk_sndbuf = oldsk->sk_sndbuf; newsk->sk_rcvbuf = oldsk->sk_rcvbuf; /* Brute force copy old sctp opt. */ - if (oldsp->do_auto_asconf) { - memcpy(&tmplist, &newsp->auto_asconf_list, sizeof(tmplist)); - inet_sk_copy_descendant(newsk, oldsk); - memcpy(&newsp->auto_asconf_list, &tmplist, sizeof(tmplist)); - } else - inet_sk_copy_descendant(newsk, oldsk); + sctp_copy_descendant(newsk, oldsk); /* Restore the ep value that was overwritten with the above structure * copy. From fa83234f6a4e7b378f0da63938a09b9e8d535c4d Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 5 Feb 2015 10:37:33 +0300 Subject: [PATCH 255/359] vhost/scsi: potential memory corruption commit 59c816c1f24df0204e01851431d3bab3eb76719c upstream. This code in vhost_scsi_make_tpg() is confusing because we limit "tpgt" to UINT_MAX but the data type of "tpg->tport_tpgt" and that is a u16. I looked at the context and it turns out that in vhost_scsi_set_endpoint(), "tpg->tport_tpgt" is used as an offset into the vs_tpg[] array which has VHOST_SCSI_MAX_TARGET (256) elements so anything higher than 255 then it is invalid. I have made that the limit now. In vhost_scsi_send_evt() we mask away values higher than 255, but now that the limit has changed, we don't need the mask. Signed-off-by: Dan Carpenter Signed-off-by: Nicholas Bellinger [ The affected function was renamed to vhost_scsi_make_tpg before the vulnerability was announced, I ported it to 3.10 stable and changed the code in function tcm_vhost_make_tpg] Signed-off-by: Wang Long Signed-off-by: Greg Kroah-Hartman --- drivers/vhost/scsi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index fb97bc0b80e78a..2947eda522b259 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c @@ -1088,7 +1088,7 @@ static void tcm_vhost_send_evt(struct vhost_scsi *vs, struct tcm_vhost_tpg *tpg, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked_lun >> 8 | 0x40 ; evt->event.lun[3] = lun->unpacked_lun & 0xFF; @@ -1894,12 +1894,12 @@ static struct se_portal_group *tcm_vhost_make_tpg(struct se_wwn *wwn, struct tcm_vhost_tport, tport_wwn); struct tcm_vhost_tpg *tpg; - unsigned long tpgt; + u16 tpgt; int ret; if (strstr(name, "tpgt_") != name) return ERR_PTR(-EINVAL); - if (kstrtoul(name + 5, 10, &tpgt) || tpgt > UINT_MAX) + if (kstrtou16(name + 5, 10, &tpgt) || tpgt >= VHOST_SCSI_MAX_TARGET) return ERR_PTR(-EINVAL); tpg = kzalloc(sizeof(struct tcm_vhost_tpg), GFP_KERNEL); From 9f6191daa545384ce5cc90b770f0d2bf64c0ba22 Mon Sep 17 00:00:00 2001 From: Alexei Starovoitov Date: Fri, 22 May 2015 15:42:55 -0700 Subject: [PATCH 256/359] x86: bpf_jit: fix compilation of large bpf programs commit 3f7352bf21f8fd7ba3e2fcef9488756f188e12be upstream. x86 has variable length encoding. x86 JIT compiler is trying to pick the shortest encoding for given bpf instruction. While doing so the jump targets are changing, so JIT is doing multiple passes over the program. Typical program needs 3 passes. Some very short programs converge with 2 passes. Large programs may need 4 or 5. But specially crafted bpf programs may hit the pass limit and if the program converges on the last iteration the JIT compiler will be producing an image full of 'int 3' insns. Fix this corner case by doing final iteration over bpf program. Fixes: 0a14842f5a3c ("net: filter: Just In Time compiler for x86-64") Reported-by: Daniel Borkmann Signed-off-by: Alexei Starovoitov Tested-by: Daniel Borkmann Acked-by: Daniel Borkmann Signed-off-by: David S. Miller Signed-off-by: Jiri Slaby Signed-off-by: Greg Kroah-Hartman --- arch/x86/net/bpf_jit_comp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c index 0c966fecfb8c90..5479d677f9bed2 100644 --- a/arch/x86/net/bpf_jit_comp.c +++ b/arch/x86/net/bpf_jit_comp.c @@ -176,7 +176,12 @@ void bpf_jit_compile(struct sk_filter *fp) } cleanup_addr = proglen; /* epilogue address */ - for (pass = 0; pass < 10; pass++) { + /* JITed image shrinks with every pass and the loop iterates + * until the image stops shrinking. Very large bpf programs + * may converge on the last pass. In such case do one more + * pass to emit the final image + */ + for (pass = 0; pass < 10 || image; pass++) { u8 seen_or_pass0 = (pass == 0) ? (SEEN_XREG | SEEN_DATAREF | SEEN_MEM) : seen; /* no prologue/epilogue for trivial filters (RET something) */ proglen = 0; From 3b9393dc1d4cc226bce44708ab899518cc598e57 Mon Sep 17 00:00:00 2001 From: Angga Date: Fri, 3 Jul 2015 14:40:52 +1200 Subject: [PATCH 257/359] ipv6: Make MLD packets to only be processed locally [ Upstream commit 4c938d22c88a9ddccc8c55a85e0430e9c62b1ac5 ] Before commit daad151263cf ("ipv6: Make ipv6_is_mld() inline and use it from ip6_mc_input().") MLD packets were only processed locally. After the change, a copy of MLD packet goes through ip6_mr_input, causing MRT6MSG_NOCACHE message to be generated to user space. Make MLD packet only processed locally. Fixes: daad151263cf ("ipv6: Make ipv6_is_mld() inline and use it from ip6_mc_input().") Signed-off-by: Hermin Anggawijaya Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv6/ip6_input.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c index 774b09cb2920f9..63264c9a15cb40 100644 --- a/net/ipv6/ip6_input.c +++ b/net/ipv6/ip6_input.c @@ -325,10 +325,10 @@ int ip6_mc_input(struct sk_buff *skb) if (offset < 0) goto out; - if (!ipv6_is_mld(skb, nexthdr, offset)) - goto out; + if (ipv6_is_mld(skb, nexthdr, offset)) + deliver = true; - deliver = true; + goto out; } /* unknown RA - process it normally */ } From afabf2a8b621f2c300cbdf6adb0f8855f612b3a6 Mon Sep 17 00:00:00 2001 From: Stephen Smalley Date: Tue, 7 Jul 2015 09:43:45 -0400 Subject: [PATCH 258/359] net/tipc: initialize security state for new connection socket [ Upstream commit fdd75ea8df370f206a8163786e7470c1277a5064 ] Calling connect() with an AF_TIPC socket would trigger a series of error messages from SELinux along the lines of: SELinux: Invalid class 0 type=AVC msg=audit(1434126658.487:34500): avc: denied { } for pid=292 comm="kworker/u16:5" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:unlabeled_t:s0 tclass= permissive=0 This was due to a failure to initialize the security state of the new connection sock by the tipc code, leaving it with junk in the security class field and an unlabeled secid. Add a call to security_sk_clone() to inherit the security state from the parent socket. Reported-by: Tim Shearer Signed-off-by: Stephen Smalley Acked-by: Paul Moore Acked-by: Ying Xue Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/tipc/socket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 2b1d7c2d677d3f..e0cb5edc6d1d9a 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c @@ -1528,6 +1528,7 @@ static int accept(struct socket *sock, struct socket *new_sock, int flags) res = tipc_create(sock_net(sock->sk), new_sock, 0, 0); if (res) goto exit; + security_sk_clone(sock->sk, new_sock->sk); new_sk = new_sock->sk; new_tsock = tipc_sk(new_sk); From 7865ece30f06072ea61f7db2ebbe24b632800e17 Mon Sep 17 00:00:00 2001 From: Nikolay Aleksandrov Date: Tue, 7 Jul 2015 15:55:56 +0200 Subject: [PATCH 259/359] bridge: mdb: zero out the local br_ip variable before use [ Upstream commit f1158b74e54f2e2462ba5e2f45a118246d9d5b43 ] Since commit b0e9a30dd669 ("bridge: Add vlan id to multicast groups") there's a check in br_ip_equal() for a matching vlan id, but the mdb functions were not modified to use (or at least zero it) so when an entry was added it would have a garbage vlan id (from the local br_ip variable in __br_mdb_add/del) and this would prevent it from being matched and also deleted. So zero out the whole local ip var to protect ourselves from future changes and also to fix the current bug, since there's no vlan id support in the mdb uapi - use always vlan id 0. Example before patch: root@debian:~# bridge mdb add dev br0 port eth1 grp 239.0.0.1 permanent root@debian:~# bridge mdb dev br0 port eth1 grp 239.0.0.1 permanent root@debian:~# bridge mdb del dev br0 port eth1 grp 239.0.0.1 permanent RTNETLINK answers: Invalid argument After patch: root@debian:~# bridge mdb add dev br0 port eth1 grp 239.0.0.1 permanent root@debian:~# bridge mdb dev br0 port eth1 grp 239.0.0.1 permanent root@debian:~# bridge mdb del dev br0 port eth1 grp 239.0.0.1 permanent root@debian:~# bridge mdb Signed-off-by: Nikolay Aleksandrov Fixes: b0e9a30dd669 ("bridge: Add vlan id to multicast groups") Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/bridge/br_mdb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/bridge/br_mdb.c b/net/bridge/br_mdb.c index 19942e38fd2d93..ff61e200bf019c 100644 --- a/net/bridge/br_mdb.c +++ b/net/bridge/br_mdb.c @@ -368,6 +368,7 @@ static int __br_mdb_add(struct net *net, struct net_bridge *br, if (!p || p->br != br || p->state == BR_STATE_DISABLED) return -EINVAL; + memset(&ip, 0, sizeof(ip)); ip.proto = entry->addr.proto; if (ip.proto == htons(ETH_P_IP)) ip.u.ip4 = entry->addr.u.ip4; @@ -417,6 +418,7 @@ static int __br_mdb_del(struct net_bridge *br, struct br_mdb_entry *entry) if (timer_pending(&br->multicast_querier_timer)) return -EBUSY; + memset(&ip, 0, sizeof(ip)); ip.proto = entry->addr.proto; if (ip.proto == htons(ETH_P_IP)) ip.u.ip4 = entry->addr.u.ip4; From f85eee641c7a3bb928a4b605db632c2e90b9574f Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Wed, 8 Jul 2015 21:42:11 +0200 Subject: [PATCH 260/359] net: pktgen: fix race between pktgen_thread_worker() and kthread_stop() [ Upstream commit fecdf8be2d91e04b0a9a4f79ff06499a36f5d14f ] pktgen_thread_worker() is obviously racy, kthread_stop() can come between the kthread_should_stop() check and set_current_state(). Signed-off-by: Oleg Nesterov Reported-by: Jan Stancek Reported-by: Marcelo Leitner Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/core/pktgen.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/core/pktgen.c b/net/core/pktgen.c index ebbea537196781..21a23d97e99c10 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c @@ -3377,8 +3377,10 @@ static int pktgen_thread_worker(void *arg) pktgen_rem_thread(t); /* Wait for kthread_stop */ - while (!kthread_should_stop()) { + for (;;) { set_current_state(TASK_INTERRUPTIBLE); + if (kthread_should_stop()) + break; schedule(); } __set_current_state(TASK_RUNNING); From c987fa7146e0c18acc2392b25349cca45c177175 Mon Sep 17 00:00:00 2001 From: Julian Anastasov Date: Thu, 9 Jul 2015 09:59:10 +0300 Subject: [PATCH 261/359] net: call rcu_read_lock early in process_backlog [ Upstream commit 2c17d27c36dcce2b6bf689f41a46b9e909877c21 ] Incoming packet should be either in backlog queue or in RCU read-side section. Otherwise, the final sequence of flush_backlog() and synchronize_net() may miss packets that can run without device reference: CPU 1 CPU 2 skb->dev: no reference process_backlog:__skb_dequeue process_backlog:local_irq_enable on_each_cpu for flush_backlog => IPI(hardirq): flush_backlog - packet not found in backlog CPU delayed ... synchronize_net - no ongoing RCU read-side sections netdev_run_todo, rcu_barrier: no ongoing callbacks __netif_receive_skb_core:rcu_read_lock - too late free dev process packet for freed dev Fixes: 6e583ce5242f ("net: eliminate refcounting in backlog queue") Cc: Eric W. Biederman Cc: Stephen Hemminger Signed-off-by: Julian Anastasov Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/core/dev.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/net/core/dev.c b/net/core/dev.c index aeca8dd88b2af8..1ccfc49683b37b 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -3443,8 +3443,6 @@ static int __netif_receive_skb_core(struct sk_buff *skb, bool pfmemalloc) pt_prev = NULL; - rcu_read_lock(); - another_round: skb->skb_iif = skb->dev->ifindex; @@ -3454,7 +3452,7 @@ static int __netif_receive_skb_core(struct sk_buff *skb, bool pfmemalloc) skb->protocol == cpu_to_be16(ETH_P_8021AD)) { skb = vlan_untag(skb); if (unlikely(!skb)) - goto unlock; + goto out; } #ifdef CONFIG_NET_CLS_ACT @@ -3479,7 +3477,7 @@ static int __netif_receive_skb_core(struct sk_buff *skb, bool pfmemalloc) #ifdef CONFIG_NET_CLS_ACT skb = handle_ing(skb, &pt_prev, &ret, orig_dev); if (!skb) - goto unlock; + goto out; ncls: #endif @@ -3494,7 +3492,7 @@ static int __netif_receive_skb_core(struct sk_buff *skb, bool pfmemalloc) if (vlan_do_receive(&skb)) goto another_round; else if (unlikely(!skb)) - goto unlock; + goto out; } rx_handler = rcu_dereference(skb->dev->rx_handler); @@ -3506,7 +3504,7 @@ static int __netif_receive_skb_core(struct sk_buff *skb, bool pfmemalloc) switch (rx_handler(&skb)) { case RX_HANDLER_CONSUMED: ret = NET_RX_SUCCESS; - goto unlock; + goto out; case RX_HANDLER_ANOTHER: goto another_round; case RX_HANDLER_EXACT: @@ -3558,8 +3556,6 @@ static int __netif_receive_skb_core(struct sk_buff *skb, bool pfmemalloc) ret = NET_RX_DROP; } -unlock: - rcu_read_unlock(); out: return ret; } @@ -3606,29 +3602,30 @@ static int __netif_receive_skb(struct sk_buff *skb) */ int netif_receive_skb(struct sk_buff *skb) { + int ret; + net_timestamp_check(netdev_tstamp_prequeue, skb); if (skb_defer_rx_timestamp(skb)) return NET_RX_SUCCESS; + rcu_read_lock(); + #ifdef CONFIG_RPS if (static_key_false(&rps_needed)) { struct rps_dev_flow voidflow, *rflow = &voidflow; - int cpu, ret; - - rcu_read_lock(); - - cpu = get_rps_cpu(skb->dev, skb, &rflow); + int cpu = get_rps_cpu(skb->dev, skb, &rflow); if (cpu >= 0) { ret = enqueue_to_backlog(skb, cpu, &rflow->last_qtail); rcu_read_unlock(); return ret; } - rcu_read_unlock(); } #endif - return __netif_receive_skb(skb); + ret = __netif_receive_skb(skb); + rcu_read_unlock(); + return ret; } EXPORT_SYMBOL(netif_receive_skb); @@ -4038,8 +4035,10 @@ static int process_backlog(struct napi_struct *napi, int quota) unsigned int qlen; while ((skb = __skb_dequeue(&sd->process_queue))) { + rcu_read_lock(); local_irq_enable(); __netif_receive_skb(skb); + rcu_read_unlock(); local_irq_disable(); input_queue_head_incr(sd); if (++work >= quota) { From 0ba48ae94c393dc4c43b257400046feeeb9c6fad Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Mon, 13 Jul 2015 16:04:13 +0800 Subject: [PATCH 262/359] net: Clone skb before setting peeked flag [ Upstream commit 738ac1ebb96d02e0d23bc320302a6ea94c612dec ] Shared skbs must not be modified and this is crucial for broadcast and/or multicast paths where we use it as an optimisation to avoid unnecessary cloning. The function skb_recv_datagram breaks this rule by setting peeked without cloning the skb first. This causes funky races which leads to double-free. This patch fixes this by cloning the skb and replacing the skb in the list when setting skb->peeked. Fixes: a59322be07c9 ("[UDP]: Only increment counter on first peek/recv") Reported-by: Konstantin Khlebnikov Signed-off-by: Herbert Xu Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/core/datagram.c | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/net/core/datagram.c b/net/core/datagram.c index b71423db77851e..f1506c7d414eea 100644 --- a/net/core/datagram.c +++ b/net/core/datagram.c @@ -128,6 +128,35 @@ static int wait_for_more_packets(struct sock *sk, int *err, long *timeo_p, goto out; } +static int skb_set_peeked(struct sk_buff *skb) +{ + struct sk_buff *nskb; + + if (skb->peeked) + return 0; + + /* We have to unshare an skb before modifying it. */ + if (!skb_shared(skb)) + goto done; + + nskb = skb_clone(skb, GFP_ATOMIC); + if (!nskb) + return -ENOMEM; + + skb->prev->next = nskb; + skb->next->prev = nskb; + nskb->prev = skb->prev; + nskb->next = skb->next; + + consume_skb(skb); + skb = nskb; + +done: + skb->peeked = 1; + + return 0; +} + /** * __skb_recv_datagram - Receive a datagram skbuff * @sk: socket @@ -162,7 +191,9 @@ static int wait_for_more_packets(struct sock *sk, int *err, long *timeo_p, struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned int flags, int *peeked, int *off, int *err) { + struct sk_buff_head *queue = &sk->sk_receive_queue; struct sk_buff *skb, *last; + unsigned long cpu_flags; long timeo; /* * Caller is allowed not to check sk->sk_err before skb_recv_datagram() @@ -181,8 +212,6 @@ struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned int flags, * Look at current nfs client by the way... * However, this function was correct in any case. 8) */ - unsigned long cpu_flags; - struct sk_buff_head *queue = &sk->sk_receive_queue; int _off = *off; last = (struct sk_buff *)queue; @@ -196,7 +225,11 @@ struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned int flags, _off -= skb->len; continue; } - skb->peeked = 1; + + error = skb_set_peeked(skb); + if (error) + goto unlock_err; + atomic_inc(&skb->users); } else __skb_unlink(skb, queue); @@ -216,6 +249,8 @@ struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned int flags, return NULL; +unlock_err: + spin_unlock_irqrestore(&queue->lock, cpu_flags); no_packet: *err = error; return NULL; From 4164cda8cad7303614d211192d27a912de53a463 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Mon, 13 Jul 2015 20:01:42 +0800 Subject: [PATCH 263/359] net: Fix skb csum races when peeking [ Upstream commit 89c22d8c3b278212eef6a8cc66b570bc840a6f5a ] When we calculate the checksum on the recv path, we store the result in the skb as an optimisation in case we need the checksum again down the line. This is in fact bogus for the MSG_PEEK case as this is done without any locking. So multiple threads can peek and then store the result to the same skb, potentially resulting in bogus skb states. This patch fixes this by only storing the result if the skb is not shared. This preserves the optimisations for the few cases where it can be done safely due to locking or other reasons, e.g., SIOCINQ. Signed-off-by: Herbert Xu Acked-by: Eric Dumazet Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/core/datagram.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/core/datagram.c b/net/core/datagram.c index f1506c7d414eea..80b0fd83fac83d 100644 --- a/net/core/datagram.c +++ b/net/core/datagram.c @@ -700,7 +700,8 @@ __sum16 __skb_checksum_complete_head(struct sk_buff *skb, int len) if (likely(!sum)) { if (unlikely(skb->ip_summed == CHECKSUM_COMPLETE)) netdev_rx_csum_fault(skb->dev); - skb->ip_summed = CHECKSUM_UNNECESSARY; + if (!skb_shared(skb)) + skb->ip_summed = CHECKSUM_UNNECESSARY; } return sum; } From 5fa39f16036eb627fe50a38c307fa99eace26ee3 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Tue, 4 Aug 2015 15:42:47 +0800 Subject: [PATCH 264/359] net: Fix skb_set_peeked use-after-free bug [ Upstream commit a0a2a6602496a45ae838a96db8b8173794b5d398 ] The commit 738ac1ebb96d02e0d23bc320302a6ea94c612dec ("net: Clone skb before setting peeked flag") introduced a use-after-free bug in skb_recv_datagram. This is because skb_set_peeked may create a new skb and free the existing one. As it stands the caller will continue to use the old freed skb. This patch fixes it by making skb_set_peeked return the new skb (or the old one if unchanged). Fixes: 738ac1ebb96d ("net: Clone skb before setting peeked flag") Reported-by: Brenden Blanco Signed-off-by: Herbert Xu Tested-by: Brenden Blanco Reviewed-by: Konstantin Khlebnikov Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/core/datagram.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/net/core/datagram.c b/net/core/datagram.c index 80b0fd83fac83d..052b71c5b1b4ce 100644 --- a/net/core/datagram.c +++ b/net/core/datagram.c @@ -128,12 +128,12 @@ static int wait_for_more_packets(struct sock *sk, int *err, long *timeo_p, goto out; } -static int skb_set_peeked(struct sk_buff *skb) +static struct sk_buff *skb_set_peeked(struct sk_buff *skb) { struct sk_buff *nskb; if (skb->peeked) - return 0; + return skb; /* We have to unshare an skb before modifying it. */ if (!skb_shared(skb)) @@ -141,7 +141,7 @@ static int skb_set_peeked(struct sk_buff *skb) nskb = skb_clone(skb, GFP_ATOMIC); if (!nskb) - return -ENOMEM; + return ERR_PTR(-ENOMEM); skb->prev->next = nskb; skb->next->prev = nskb; @@ -154,7 +154,7 @@ static int skb_set_peeked(struct sk_buff *skb) done: skb->peeked = 1; - return 0; + return skb; } /** @@ -226,8 +226,9 @@ struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned int flags, continue; } - error = skb_set_peeked(skb); - if (error) + skb = skb_set_peeked(skb); + error = PTR_ERR(skb); + if (IS_ERR(skb)) goto unlock_err; atomic_inc(&skb->users); From 8d228c93f31c90894fa86c597beb42b67c5ac978 Mon Sep 17 00:00:00 2001 From: Nikolay Aleksandrov Date: Mon, 13 Jul 2015 06:36:19 -0700 Subject: [PATCH 265/359] bridge: mdb: fix double add notification [ Upstream commit 5ebc784625ea68a9570d1f70557e7932988cd1b4 ] Since the mdb add/del code was introduced there have been 2 br_mdb_notify calls when doing br_mdb_add() resulting in 2 notifications on each add. Example: Command: bridge mdb add dev br0 port eth1 grp 239.0.0.1 permanent Before patch: root@debian:~# bridge monitor all [MDB]dev br0 port eth1 grp 239.0.0.1 permanent [MDB]dev br0 port eth1 grp 239.0.0.1 permanent After patch: root@debian:~# bridge monitor all [MDB]dev br0 port eth1 grp 239.0.0.1 permanent Signed-off-by: Nikolay Aleksandrov Fixes: cfd567543590 ("bridge: add support of adding and deleting mdb entries") Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/bridge/br_mdb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/bridge/br_mdb.c b/net/bridge/br_mdb.c index ff61e200bf019c..4e76d2a11284f7 100644 --- a/net/bridge/br_mdb.c +++ b/net/bridge/br_mdb.c @@ -345,7 +345,6 @@ static int br_mdb_add_group(struct net_bridge *br, struct net_bridge_port *port, return -ENOMEM; rcu_assign_pointer(*pp, p); - br_mdb_notify(br->dev, port, group, RTM_NEWMDB); return 0; } From c6419a861e56cf6c6446bf0e8f9c75557c2a3a02 Mon Sep 17 00:00:00 2001 From: Tilman Schmidt Date: Tue, 14 Jul 2015 00:37:13 +0200 Subject: [PATCH 266/359] isdn/gigaset: reset tty->receive_room when attaching ser_gigaset [ Upstream commit fd98e9419d8d622a4de91f76b306af6aa627aa9c ] Commit 79901317ce80 ("n_tty: Don't flush buffer when closing ldisc"), first merged in kernel release 3.10, caused the following regression in the Gigaset M101 driver: Before that commit, when closing the N_TTY line discipline in preparation to switching to N_GIGASET_M101, receive_room would be reset to a non-zero value by the call to n_tty_flush_buffer() in n_tty's close method. With the removal of that call, receive_room might be left at zero, blocking data reception on the serial line. The present patch fixes that regression by setting receive_room to an appropriate value in the ldisc open method. Fixes: 79901317ce80 ("n_tty: Don't flush buffer when closing ldisc") Signed-off-by: Tilman Schmidt Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/isdn/gigaset/ser-gigaset.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/isdn/gigaset/ser-gigaset.c b/drivers/isdn/gigaset/ser-gigaset.c index 8c91fd5eb6fdd4..3ac9c4194814ce 100644 --- a/drivers/isdn/gigaset/ser-gigaset.c +++ b/drivers/isdn/gigaset/ser-gigaset.c @@ -524,9 +524,18 @@ gigaset_tty_open(struct tty_struct *tty) cs->hw.ser->tty = tty; atomic_set(&cs->hw.ser->refcnt, 1); init_completion(&cs->hw.ser->dead_cmp); - tty->disc_data = cs; + /* Set the amount of data we're willing to receive per call + * from the hardware driver to half of the input buffer size + * to leave some reserve. + * Note: We don't do flow control towards the hardware driver. + * If more data is received than will fit into the input buffer, + * it will be dropped and an error will be logged. This should + * never happen as the device is slow and the buffer size ample. + */ + tty->receive_room = RBUFSIZE/2; + /* OK.. Initialization of the datastructures and the HW is done.. Now * startup system and notify the LL that we are ready to run */ From 4b633bbef8730380d624a3d55a54d9e42effdd1c Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Tue, 14 Jul 2015 08:10:22 +0200 Subject: [PATCH 267/359] ipv6: lock socket in ip6_datagram_connect() [ Upstream commit 03645a11a570d52e70631838cb786eb4253eb463 ] ip6_datagram_connect() is doing a lot of socket changes without socket being locked. This looks wrong, at least for udp_lib_rehash() which could corrupt lists because of concurrent udp_sk(sk)->udp_portaddr_hash accesses. Signed-off-by: Eric Dumazet Acked-by: Herbert Xu Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- include/net/ip.h | 1 + net/ipv4/datagram.c | 16 ++++++++++++---- net/ipv6/datagram.c | 20 +++++++++++++++----- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/include/net/ip.h b/include/net/ip.h index 0a62365149e2b3..ea9be6b407bc67 100644 --- a/include/net/ip.h +++ b/include/net/ip.h @@ -141,6 +141,7 @@ static inline struct sk_buff *ip_finish_skb(struct sock *sk, struct flowi4 *fl4) } /* datagram.c */ +int __ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len); extern int ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len); diff --git a/net/ipv4/datagram.c b/net/ipv4/datagram.c index 5f3dc1df04bf28..291b0821d1acea 100644 --- a/net/ipv4/datagram.c +++ b/net/ipv4/datagram.c @@ -20,7 +20,7 @@ #include #include -int ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) +int __ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) { struct inet_sock *inet = inet_sk(sk); struct sockaddr_in *usin = (struct sockaddr_in *) uaddr; @@ -39,8 +39,6 @@ int ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) sk_dst_reset(sk); - lock_sock(sk); - oif = sk->sk_bound_dev_if; saddr = inet->inet_saddr; if (ipv4_is_multicast(usin->sin_addr.s_addr)) { @@ -81,9 +79,19 @@ int ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) sk_dst_set(sk, &rt->dst); err = 0; out: - release_sock(sk); return err; } +EXPORT_SYMBOL(__ip4_datagram_connect); + +int ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) +{ + int res; + + lock_sock(sk); + res = __ip4_datagram_connect(sk, uaddr, addr_len); + release_sock(sk); + return res; +} EXPORT_SYMBOL(ip4_datagram_connect); /* Because UDP xmit path can manipulate sk_dst_cache without holding diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c index ce17d3da9b2bcd..b0d5d7eb94626f 100644 --- a/net/ipv6/datagram.c +++ b/net/ipv6/datagram.c @@ -40,7 +40,7 @@ static bool ipv6_mapped_addr_any(const struct in6_addr *a) return ipv6_addr_v4mapped(a) && (a->s6_addr32[3] == 0); } -int ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) +static int __ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) { struct sockaddr_in6 *usin = (struct sockaddr_in6 *) uaddr; struct inet_sock *inet = inet_sk(sk); @@ -56,7 +56,7 @@ int ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) if (usin->sin6_family == AF_INET) { if (__ipv6_only_sock(sk)) return -EAFNOSUPPORT; - err = ip4_datagram_connect(sk, uaddr, addr_len); + err = __ip4_datagram_connect(sk, uaddr, addr_len); goto ipv4_connected; } @@ -99,9 +99,9 @@ int ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) sin.sin_addr.s_addr = daddr->s6_addr32[3]; sin.sin_port = usin->sin6_port; - err = ip4_datagram_connect(sk, - (struct sockaddr *) &sin, - sizeof(sin)); + err = __ip4_datagram_connect(sk, + (struct sockaddr *) &sin, + sizeof(sin)); ipv4_connected: if (err) @@ -204,6 +204,16 @@ int ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) fl6_sock_release(flowlabel); return err; } + +int ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) +{ + int res; + + lock_sock(sk); + res = __ip6_datagram_connect(sk, uaddr, addr_len); + release_sock(sk); + return res; +} EXPORT_SYMBOL_GPL(ip6_datagram_connect); void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, From e3e3caac28a5c7c9428ebc4fa154a007c0636393 Mon Sep 17 00:00:00 2001 From: Nikolay Aleksandrov Date: Wed, 15 Jul 2015 21:52:51 +0200 Subject: [PATCH 268/359] bonding: fix destruction of bond with devices different from arphrd_ether [ Upstream commit 06f6d1094aa0992432b1e2a0920b0ee86ccd83bf ] When the bonding is being unloaded and the netdevice notifier is unregistered it executes NETDEV_UNREGISTER for each device which should remove the bond's proc entry but if the device enslaved is not of ARPHRD_ETHER type and is in front of the bonding, it may execute bond_release_and_destroy() first which would release the last slave and destroy the bond device leaving the proc entry and thus we will get the following error (with dynamic debug on for bond_netdev_event to see the events order): [ 908.963051] eql: event: 9 [ 908.963052] eql: IFF_SLAVE [ 908.963054] eql: event: 2 [ 908.963056] eql: IFF_SLAVE [ 908.963058] eql: event: 6 [ 908.963059] eql: IFF_SLAVE [ 908.963110] bond0: Releasing active interface eql [ 908.976168] bond0: Destroying bond bond0 [ 908.976266] bond0 (unregistering): Released all slaves [ 908.984097] ------------[ cut here ]------------ [ 908.984107] WARNING: CPU: 0 PID: 1787 at fs/proc/generic.c:575 remove_proc_entry+0x112/0x160() [ 908.984110] remove_proc_entry: removing non-empty directory 'net/bonding', leaking at least 'bond0' [ 908.984111] Modules linked in: bonding(-) eql(O) 9p nfsd auth_rpcgss oid_registry nfs_acl nfs lockd grace fscache sunrpc crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel ppdev qxl drm_kms_helper snd_hda_codec_generic aesni_intel ttm aes_x86_64 glue_helper pcspkr lrw gf128mul ablk_helper cryptd snd_hda_intel virtio_console snd_hda_codec psmouse serio_raw snd_hwdep snd_hda_core 9pnet_virtio 9pnet evdev joydev drm virtio_balloon snd_pcm snd_timer snd soundcore i2c_piix4 i2c_core pvpanic acpi_cpufreq parport_pc parport processor thermal_sys button autofs4 ext4 crc16 mbcache jbd2 hid_generic usbhid hid sg sr_mod cdrom ata_generic virtio_blk virtio_net floppy ata_piix e1000 libata ehci_pci virtio_pci scsi_mod uhci_hcd ehci_hcd virtio_ring virtio usbcore usb_common [last unloaded: bonding] [ 908.984168] CPU: 0 PID: 1787 Comm: rmmod Tainted: G W O 4.2.0-rc2+ #8 [ 908.984170] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 908.984172] 0000000000000000 ffffffff81732d41 ffffffff81525b34 ffff8800358dfda8 [ 908.984175] ffffffff8106c521 ffff88003595af78 ffff88003595af40 ffff88003e3a4280 [ 908.984178] ffffffffa058d040 0000000000000000 ffffffff8106c59a ffffffff8172ebd0 [ 908.984181] Call Trace: [ 908.984188] [] ? dump_stack+0x40/0x50 [ 908.984193] [] ? warn_slowpath_common+0x81/0xb0 [ 908.984196] [] ? warn_slowpath_fmt+0x4a/0x50 [ 908.984199] [] ? remove_proc_entry+0x112/0x160 [ 908.984205] [] ? bond_destroy_proc_dir+0x26/0x30 [bonding] [ 908.984208] [] ? bond_net_exit+0x8e/0xa0 [bonding] [ 908.984217] [] ? ops_exit_list.isra.4+0x37/0x70 [ 908.984225] [] ? unregister_pernet_operations+0x8d/0xd0 [ 908.984228] [] ? unregister_pernet_subsys+0x1d/0x30 [ 908.984232] [] ? bonding_exit+0x23/0xdba [bonding] [ 908.984236] [] ? SyS_delete_module+0x18a/0x250 [ 908.984241] [] ? task_work_run+0x89/0xc0 [ 908.984244] [] ? entry_SYSCALL_64_fastpath+0x16/0x75 [ 908.984247] ---[ end trace 7c006ed4abbef24b ]--- Thus remove the proc entry manually if bond_release_and_destroy() is used. Because of the checks in bond_remove_proc_entry() it's not a problem for a bond device to change namespaces (the bug fixed by the Fixes commit) but since commit f9399814927ad ("bonding: Don't allow bond devices to change network namespaces.") that can't happen anyway. Reported-by: Carol Soto Signed-off-by: Nikolay Aleksandrov Fixes: a64d49c3dd50 ("bonding: Manage /proc/net/bonding/ entries from the netdev events") Tested-by: Carol L Soto Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/bonding/bond_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index b143ce91e08115..6b5baf01512db0 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -2188,6 +2188,7 @@ static int bond_release_and_destroy(struct net_device *bond_dev, bond_dev->priv_flags |= IFF_DISABLE_NETPOLL; pr_info("%s: destroying bond %s.\n", bond_dev->name, bond_dev->name); + bond_remove_proc_entry(bond); unregister_netdevice(bond_dev); } return ret; From cecc56226678a5a218e8b9859382ab0b0c27ad0b Mon Sep 17 00:00:00 2001 From: Edward Hyunkoo Jee Date: Tue, 21 Jul 2015 09:43:59 +0200 Subject: [PATCH 269/359] inet: frags: fix defragmented packet's IP header for af_packet [ Upstream commit 0848f6428ba3a2e42db124d41ac6f548655735bf ] When ip_frag_queue() computes positions, it assumes that the passed sk_buff does not contain L2 headers. However, when PACKET_FANOUT_FLAG_DEFRAG is used, IP reassembly functions can be called on outgoing packets that contain L2 headers. Also, IPv4 checksum is not corrected after reassembly. Fixes: 7736d33f4262 ("packet: Add pre-defragmentation support for ipv4 fanouts.") Signed-off-by: Edward Hyunkoo Jee Signed-off-by: Eric Dumazet Cc: Willem de Bruijn Cc: Jerry Chu Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv4/ip_fragment.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c index 4c1884fed54862..4d98a6b80b0437 100644 --- a/net/ipv4/ip_fragment.c +++ b/net/ipv4/ip_fragment.c @@ -356,7 +356,7 @@ static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb) ihl = ip_hdrlen(skb); /* Determine the position of this fragment. */ - end = offset + skb->len - ihl; + end = offset + skb->len - skb_network_offset(skb) - ihl; err = -EINVAL; /* Is this the final fragment? */ @@ -386,7 +386,7 @@ static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb) goto err; err = -ENOMEM; - if (pskb_pull(skb, ihl) == NULL) + if (!pskb_pull(skb, skb_network_offset(skb) + ihl)) goto err; err = pskb_trim_rcsum(skb, end - offset); @@ -627,6 +627,9 @@ static int ip_frag_reasm(struct ipq *qp, struct sk_buff *prev, iph->frag_off = qp->q.max_size ? htons(IP_DF) : 0; iph->tot_len = htons(len); iph->tos |= ecn; + + ip_send_check(iph); + IP_INC_STATS_BH(net, IPSTATS_MIB_REASMOKS); qp->q.fragments = NULL; qp->q.fragments_tail = NULL; From 3ebe377baaebbed39733c3eb03212b9c22601888 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Tue, 21 Jul 2015 16:33:50 +0200 Subject: [PATCH 270/359] netlink: don't hold mutex in rcu callback when releasing mmapd ring [ Upstream commit 0470eb99b4721586ccac954faac3fa4472da0845 ] Kirill A. Shutemov says: This simple test-case trigers few locking asserts in kernel: int main(int argc, char **argv) { unsigned int block_size = 16 * 4096; struct nl_mmap_req req = { .nm_block_size = block_size, .nm_block_nr = 64, .nm_frame_size = 16384, .nm_frame_nr = 64 * block_size / 16384, }; unsigned int ring_size; int fd; fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC); if (setsockopt(fd, SOL_NETLINK, NETLINK_RX_RING, &req, sizeof(req)) < 0) exit(1); if (setsockopt(fd, SOL_NETLINK, NETLINK_TX_RING, &req, sizeof(req)) < 0) exit(1); ring_size = req.nm_block_nr * req.nm_block_size; mmap(NULL, 2 * ring_size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); return 0; } +++ exited with 0 +++ BUG: sleeping function called from invalid context at /home/kas/git/public/linux-mm/kernel/locking/mutex.c:616 in_atomic(): 1, irqs_disabled(): 0, pid: 1, name: init 3 locks held by init/1: #0: (reboot_mutex){+.+...}, at: [] SyS_reboot+0xa9/0x220 #1: ((reboot_notifier_list).rwsem){.+.+..}, at: [] __blocking_notifier_call_chain+0x39/0x70 #2: (rcu_callback){......}, at: [] rcu_do_batch.isra.49+0x160/0x10c0 Preemption disabled at:[] __delay+0xf/0x20 CPU: 1 PID: 1 Comm: init Not tainted 4.1.0-00009-gbddf4c4818e0 #253 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS Debian-1.8.2-1 04/01/2014 ffff88017b3d8000 ffff88027bc03c38 ffffffff81929ceb 0000000000000102 0000000000000000 ffff88027bc03c68 ffffffff81085a9d 0000000000000002 ffffffff81ca2a20 0000000000000268 0000000000000000 ffff88027bc03c98 Call Trace: [] dump_stack+0x4f/0x7b [] ___might_sleep+0x16d/0x270 [] __might_sleep+0x4d/0x90 [] mutex_lock_nested+0x2f/0x430 [] ? _raw_spin_unlock_irqrestore+0x5d/0x80 [] ? __this_cpu_preempt_check+0x13/0x20 [] netlink_set_ring+0x1ed/0x350 [] ? netlink_undo_bind+0x70/0x70 [] netlink_sock_destruct+0x80/0x150 [] __sk_free+0x1d/0x160 [] sk_free+0x19/0x20 [..] Cong Wang says: We can't hold mutex lock in a rcu callback, [..] Thomas Graf says: The socket should be dead at this point. It might be simpler to add a netlink_release_ring() function which doesn't require locking at all. Reported-by: "Kirill A. Shutemov" Diagnosed-by: Cong Wang Suggested-by: Thomas Graf Signed-off-by: Florian Westphal Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/netlink/af_netlink.c | 79 ++++++++++++++++++++++++---------------- 1 file changed, 47 insertions(+), 32 deletions(-) diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index f7ad5c630b654f..56ff3b45227716 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -214,25 +214,52 @@ static void **alloc_pg_vec(struct netlink_sock *nlk, return NULL; } + +static void +__netlink_set_ring(struct sock *sk, struct nl_mmap_req *req, bool tx_ring, void **pg_vec, + unsigned int order) +{ + struct netlink_sock *nlk = nlk_sk(sk); + struct sk_buff_head *queue; + struct netlink_ring *ring; + + queue = tx_ring ? &sk->sk_write_queue : &sk->sk_receive_queue; + ring = tx_ring ? &nlk->tx_ring : &nlk->rx_ring; + + spin_lock_bh(&queue->lock); + + ring->frame_max = req->nm_frame_nr - 1; + ring->head = 0; + ring->frame_size = req->nm_frame_size; + ring->pg_vec_pages = req->nm_block_size / PAGE_SIZE; + + swap(ring->pg_vec_len, req->nm_block_nr); + swap(ring->pg_vec_order, order); + swap(ring->pg_vec, pg_vec); + + __skb_queue_purge(queue); + spin_unlock_bh(&queue->lock); + + WARN_ON(atomic_read(&nlk->mapped)); + + if (pg_vec) + free_pg_vec(pg_vec, order, req->nm_block_nr); +} + static int netlink_set_ring(struct sock *sk, struct nl_mmap_req *req, - bool closing, bool tx_ring) + bool tx_ring) { struct netlink_sock *nlk = nlk_sk(sk); struct netlink_ring *ring; - struct sk_buff_head *queue; void **pg_vec = NULL; unsigned int order = 0; - int err; ring = tx_ring ? &nlk->tx_ring : &nlk->rx_ring; - queue = tx_ring ? &sk->sk_write_queue : &sk->sk_receive_queue; - if (!closing) { - if (atomic_read(&nlk->mapped)) - return -EBUSY; - if (atomic_read(&ring->pending)) - return -EBUSY; - } + if (atomic_read(&nlk->mapped)) + return -EBUSY; + if (atomic_read(&ring->pending)) + return -EBUSY; if (req->nm_block_nr) { if (ring->pg_vec != NULL) @@ -264,31 +291,19 @@ static int netlink_set_ring(struct sock *sk, struct nl_mmap_req *req, return -EINVAL; } - err = -EBUSY; mutex_lock(&nlk->pg_vec_lock); - if (closing || atomic_read(&nlk->mapped) == 0) { - err = 0; - spin_lock_bh(&queue->lock); - - ring->frame_max = req->nm_frame_nr - 1; - ring->head = 0; - ring->frame_size = req->nm_frame_size; - ring->pg_vec_pages = req->nm_block_size / PAGE_SIZE; - - swap(ring->pg_vec_len, req->nm_block_nr); - swap(ring->pg_vec_order, order); - swap(ring->pg_vec, pg_vec); - - __skb_queue_purge(queue); - spin_unlock_bh(&queue->lock); - - WARN_ON(atomic_read(&nlk->mapped)); + if (atomic_read(&nlk->mapped) == 0) { + __netlink_set_ring(sk, req, tx_ring, pg_vec, order); + mutex_unlock(&nlk->pg_vec_lock); + return 0; } + mutex_unlock(&nlk->pg_vec_lock); if (pg_vec) free_pg_vec(pg_vec, order, req->nm_block_nr); - return err; + + return -EBUSY; } static void netlink_mm_open(struct vm_area_struct *vma) @@ -762,10 +777,10 @@ static void netlink_sock_destruct(struct sock *sk) memset(&req, 0, sizeof(req)); if (nlk->rx_ring.pg_vec) - netlink_set_ring(sk, &req, true, false); + __netlink_set_ring(sk, &req, false, NULL, 0); memset(&req, 0, sizeof(req)); if (nlk->tx_ring.pg_vec) - netlink_set_ring(sk, &req, true, true); + __netlink_set_ring(sk, &req, true, NULL, 0); } #endif /* CONFIG_NETLINK_MMAP */ @@ -2017,7 +2032,7 @@ static int netlink_setsockopt(struct socket *sock, int level, int optname, return -EINVAL; if (copy_from_user(&req, optval, sizeof(req))) return -EFAULT; - err = netlink_set_ring(sk, &req, false, + err = netlink_set_ring(sk, &req, optname == NETLINK_TX_RING); break; } From 7cd1033116c708c7e3e772cbf053fd9c98163570 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Sat, 1 Aug 2015 15:33:26 +0300 Subject: [PATCH 271/359] rds: fix an integer overflow test in rds_info_getsockopt() [ Upstream commit 468b732b6f76b138c0926eadf38ac88467dcd271 ] "len" is a signed integer. We check that len is not negative, so it goes from zero to INT_MAX. PAGE_SIZE is unsigned long so the comparison is type promoted to unsigned long. ULONG_MAX - 4095 is a higher than INT_MAX so the condition can never be true. I don't know if this is harmful but it seems safe to limit "len" to INT_MAX - 4095. Fixes: a8c879a7ee98 ('RDS: Info and stats') Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/rds/info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/rds/info.c b/net/rds/info.c index 9a6b4f66187cf3..140a44a5f7b7f1 100644 --- a/net/rds/info.c +++ b/net/rds/info.c @@ -176,7 +176,7 @@ int rds_info_getsockopt(struct socket *sock, int optname, char __user *optval, /* check for all kinds of wrapping and the like */ start = (unsigned long)optval; - if (len < 0 || len + PAGE_SIZE - 1 < len || start + len < start) { + if (len < 0 || len > INT_MAX - PAGE_SIZE + 1 || start + len < start) { ret = -EINVAL; goto out; } From 6d8c190531d0020870b93eee6a3933cb39fb1f52 Mon Sep 17 00:00:00 2001 From: huaibin Wang Date: Tue, 25 Aug 2015 16:20:34 +0200 Subject: [PATCH 272/359] ip6_gre: release cached dst on tunnel removal [ Upstream commit d4257295ba1b389c693b79de857a96e4b7cd8ac0 ] When a tunnel is deleted, the cached dst entry should be released. This problem may prevent the removal of a netns (seen with a x-netns IPv6 gre tunnel): unregister_netdevice: waiting for lo to become free. Usage count = 3 CC: Dmitry Kozlov Fixes: c12b395a4664 ("gre: Support GRE over IPv6") Signed-off-by: huaibin Wang Signed-off-by: Nicolas Dichtel Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv6/ip6_gre.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c index 65156a73b3f3bd..bf6233cdb75326 100644 --- a/net/ipv6/ip6_gre.c +++ b/net/ipv6/ip6_gre.c @@ -359,6 +359,7 @@ static void ip6gre_tunnel_uninit(struct net_device *dev) struct ip6gre_net *ign = net_generic(net, ip6gre_net_id); ip6gre_tunnel_unlink(ign, netdev_priv(dev)); + ip6_tnl_dst_reset(netdev_priv(dev)); dev_put(dev); } From fe474009a2167693c1a1cc2f396cb20621770450 Mon Sep 17 00:00:00 2001 From: Eugene Shatokhin Date: Mon, 24 Aug 2015 23:13:42 +0300 Subject: [PATCH 273/359] usbnet: Get EVENT_NO_RUNTIME_PM bit before it is cleared [ Upstream commit f50791ac1aca1ac1b0370d62397b43e9f831421a ] It is needed to check EVENT_NO_RUNTIME_PM bit of dev->flags in usbnet_stop(), but its value should be read before it is cleared when dev->flags is set to 0. The problem was spotted and the fix was provided by Oliver Neukum . Signed-off-by: Eugene Shatokhin Acked-by: Oliver Neukum Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/usb/usbnet.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 3d50e7db141e9e..fb068ada0c5ad3 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c @@ -753,7 +753,7 @@ int usbnet_stop (struct net_device *net) { struct usbnet *dev = netdev_priv(net); struct driver_info *info = dev->driver_info; - int retval, pm; + int retval, pm, mpn; clear_bit(EVENT_DEV_OPEN, &dev->flags); netif_stop_queue (net); @@ -784,6 +784,8 @@ int usbnet_stop (struct net_device *net) usbnet_purge_paused_rxq(dev); + mpn = !test_and_clear_bit(EVENT_NO_RUNTIME_PM, &dev->flags); + /* deferred work (task, timer, softirq) must also stop. * can't flush_scheduled_work() until we drop rtnl (later), * else workers could deadlock; so make workers a NOP. @@ -794,8 +796,7 @@ int usbnet_stop (struct net_device *net) if (!pm) usb_autopm_put_interface(dev->intf); - if (info->manage_power && - !test_and_clear_bit(EVENT_NO_RUNTIME_PM, &dev->flags)) + if (info->manage_power && mpn) info->manage_power(dev, 0); else usb_autopm_put_interface(dev->intf); From 162e3d1c34b0c7b4a2bd016332b48c171a926965 Mon Sep 17 00:00:00 2001 From: Daniel Borkmann Date: Thu, 3 Sep 2015 00:29:07 +0200 Subject: [PATCH 274/359] ipv6: fix exthdrs offload registration in out_rt path [ Upstream commit e41b0bedba0293b9e1e8d1e8ed553104b9693656 ] We previously register IPPROTO_ROUTING offload under inet6_add_offload(), but in error path, we try to unregister it with inet_del_offload(). This doesn't seem correct, it should actually be inet6_del_offload(), also ipv6_exthdrs_offload_exit() from that commit seems rather incorrect (it also uses rthdr_offload twice), but it got removed entirely later on. Fixes: 3336288a9fea ("ipv6: Switch to using new offload infrastructure.") Signed-off-by: Daniel Borkmann Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv6/exthdrs_offload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv6/exthdrs_offload.c b/net/ipv6/exthdrs_offload.c index 447a7fbd1bb6f2..f5e2ba1c18bf81 100644 --- a/net/ipv6/exthdrs_offload.c +++ b/net/ipv6/exthdrs_offload.c @@ -36,6 +36,6 @@ int __init ipv6_exthdrs_offload_init(void) return ret; out_rt: - inet_del_offload(&rthdr_offload, IPPROTO_ROUTING); + inet6_del_offload(&rthdr_offload, IPPROTO_ROUTING); goto out; } From 02b5ca779d6d15b3af9ea79e1be6e9eb1636f286 Mon Sep 17 00:00:00 2001 From: Richard Laing Date: Thu, 3 Sep 2015 13:52:31 +1200 Subject: [PATCH 275/359] net/ipv6: Correct PIM6 mrt_lock handling [ Upstream commit 25b4a44c19c83d98e8c0807a7ede07c1f28eab8b ] In the IPv6 multicast routing code the mrt_lock was not being released correctly in the MFC iterator, as a result adding or deleting a MIF would cause a hang because the mrt_lock could not be acquired. This fix is a copy of the code for the IPv4 case and ensures that the lock is released correctly. Signed-off-by: Richard Laing Acked-by: Cong Wang Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv6/ip6mr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index 2c84072b1da73d..57dd3e7d86cc39 100644 --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c @@ -552,7 +552,7 @@ static void ipmr_mfc_seq_stop(struct seq_file *seq, void *v) if (it->cache == &mrt->mfc6_unres_queue) spin_unlock_bh(&mfc_unres_lock); - else if (it->cache == mrt->mfc6_cache_array) + else if (it->cache == &mrt->mfc6_cache_array[it->ct]) read_unlock(&mrt_lock); } From e7bb902b26f1e8f7c1a4f0cc7b3abfd9b3fbb108 Mon Sep 17 00:00:00 2001 From: Marcelo Ricardo Leitner Date: Thu, 10 Sep 2015 17:31:15 -0300 Subject: [PATCH 276/359] sctp: fix race on protocol/netns initialization [ Upstream commit 8e2d61e0aed2b7c4ecb35844fe07e0b2b762dee4 ] Consider sctp module is unloaded and is being requested because an user is creating a sctp socket. During initialization, sctp will add the new protocol type and then initialize pernet subsys: status = sctp_v4_protosw_init(); if (status) goto err_protosw_init; status = sctp_v6_protosw_init(); if (status) goto err_v6_protosw_init; status = register_pernet_subsys(&sctp_net_ops); The problem is that after those calls to sctp_v{4,6}_protosw_init(), it is possible for userspace to create SCTP sockets like if the module is already fully loaded. If that happens, one of the possible effects is that we will have readers for net->sctp.local_addr_list list earlier than expected and sctp_net_init() does not take precautions while dealing with that list, leading to a potential panic but not limited to that, as sctp_sock_init() will copy a bunch of blank/partially initialized values from net->sctp. The race happens like this: CPU 0 | CPU 1 socket() | __sock_create | socket() inet_create | __sock_create list_for_each_entry_rcu( | answer, &inetsw[sock->type], | list) { | inet_create /* no hits */ | if (unlikely(err)) { | ... | request_module() | /* socket creation is blocked | * the module is fully loaded | */ | sctp_init | sctp_v4_protosw_init | inet_register_protosw | list_add_rcu(&p->list, | last_perm); | | list_for_each_entry_rcu( | answer, &inetsw[sock->type], sctp_v6_protosw_init | list) { | /* hit, so assumes protocol | * is already loaded | */ | /* socket creation continues | * before netns is initialized | */ register_pernet_subsys | Simply inverting the initialization order between register_pernet_subsys() and sctp_v4_protosw_init() is not possible because register_pernet_subsys() will create a control sctp socket, so the protocol must be already visible by then. Deferring the socket creation to a work-queue is not good specially because we loose the ability to handle its errors. So, as suggested by Vlad, the fix is to split netns initialization in two moments: defaults and control socket, so that the defaults are already loaded by when we register the protocol, while control socket initialization is kept at the same moment it is today. Fixes: 4db67e808640 ("sctp: Make the address lists per network namespace") Signed-off-by: Vlad Yasevich Signed-off-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/sctp/protocol.c | 64 +++++++++++++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 23 deletions(-) diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index 5a3c1c0a84a199..57c2c4c0c97b9b 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c @@ -1170,7 +1170,7 @@ static void sctp_v4_del_protocol(void) unregister_inetaddr_notifier(&sctp_inetaddr_notifier); } -static int __net_init sctp_net_init(struct net *net) +static int __net_init sctp_defaults_init(struct net *net) { int status; @@ -1263,12 +1263,6 @@ static int __net_init sctp_net_init(struct net *net) sctp_dbg_objcnt_init(net); - /* Initialize the control inode/socket for handling OOTB packets. */ - if ((status = sctp_ctl_sock_init(net))) { - pr_err("Failed to initialize the SCTP control sock\n"); - goto err_ctl_sock_init; - } - /* Initialize the local address list. */ INIT_LIST_HEAD(&net->sctp.local_addr_list); spin_lock_init(&net->sctp.local_addr_lock); @@ -1284,9 +1278,6 @@ static int __net_init sctp_net_init(struct net *net) return 0; -err_ctl_sock_init: - sctp_dbg_objcnt_exit(net); - sctp_proc_exit(net); err_init_proc: cleanup_sctp_mibs(net); err_init_mibs: @@ -1295,15 +1286,12 @@ static int __net_init sctp_net_init(struct net *net) return status; } -static void __net_exit sctp_net_exit(struct net *net) +static void __net_exit sctp_defaults_exit(struct net *net) { /* Free the local address list */ sctp_free_addr_wq(net); sctp_free_local_addr_list(net); - /* Free the control endpoint. */ - inet_ctl_sock_destroy(net->sctp.ctl_sock); - sctp_dbg_objcnt_exit(net); sctp_proc_exit(net); @@ -1311,9 +1299,32 @@ static void __net_exit sctp_net_exit(struct net *net) sctp_sysctl_net_unregister(net); } -static struct pernet_operations sctp_net_ops = { - .init = sctp_net_init, - .exit = sctp_net_exit, +static struct pernet_operations sctp_defaults_ops = { + .init = sctp_defaults_init, + .exit = sctp_defaults_exit, +}; + +static int __net_init sctp_ctrlsock_init(struct net *net) +{ + int status; + + /* Initialize the control inode/socket for handling OOTB packets. */ + status = sctp_ctl_sock_init(net); + if (status) + pr_err("Failed to initialize the SCTP control sock\n"); + + return status; +} + +static void __net_init sctp_ctrlsock_exit(struct net *net) +{ + /* Free the control endpoint. */ + inet_ctl_sock_destroy(net->sctp.ctl_sock); +} + +static struct pernet_operations sctp_ctrlsock_ops = { + .init = sctp_ctrlsock_init, + .exit = sctp_ctrlsock_exit, }; /* Initialize the universe into something sensible. */ @@ -1448,8 +1459,11 @@ SCTP_STATIC __init int sctp_init(void) sctp_v4_pf_init(); sctp_v6_pf_init(); - status = sctp_v4_protosw_init(); + status = register_pernet_subsys(&sctp_defaults_ops); + if (status) + goto err_register_defaults; + status = sctp_v4_protosw_init(); if (status) goto err_protosw_init; @@ -1457,9 +1471,9 @@ SCTP_STATIC __init int sctp_init(void) if (status) goto err_v6_protosw_init; - status = register_pernet_subsys(&sctp_net_ops); + status = register_pernet_subsys(&sctp_ctrlsock_ops); if (status) - goto err_register_pernet_subsys; + goto err_register_ctrlsock; status = sctp_v4_add_protocol(); if (status) @@ -1476,12 +1490,14 @@ SCTP_STATIC __init int sctp_init(void) err_v6_add_protocol: sctp_v4_del_protocol(); err_add_protocol: - unregister_pernet_subsys(&sctp_net_ops); -err_register_pernet_subsys: + unregister_pernet_subsys(&sctp_ctrlsock_ops); +err_register_ctrlsock: sctp_v6_protosw_exit(); err_v6_protosw_init: sctp_v4_protosw_exit(); err_protosw_init: + unregister_pernet_subsys(&sctp_defaults_ops); +err_register_defaults: sctp_v4_pf_exit(); sctp_v6_pf_exit(); sctp_sysctl_unregister(); @@ -1514,12 +1530,14 @@ SCTP_STATIC __exit void sctp_exit(void) sctp_v6_del_protocol(); sctp_v4_del_protocol(); - unregister_pernet_subsys(&sctp_net_ops); + unregister_pernet_subsys(&sctp_ctrlsock_ops); /* Free protosw registrations */ sctp_v6_protosw_exit(); sctp_v4_protosw_exit(); + unregister_pernet_subsys(&sctp_defaults_ops); + /* Unregister with socket layer. */ sctp_v6_pf_exit(); sctp_v4_pf_exit(); From d0550a3f2d313a5310ace03299d45ef63edfb750 Mon Sep 17 00:00:00 2001 From: Wilson Kok Date: Tue, 22 Sep 2015 21:40:22 -0700 Subject: [PATCH 277/359] fib_rules: fix fib rule dumps across multiple skbs [ Upstream commit 41fc014332d91ee90c32840bf161f9685b7fbf2b ] dump_rules returns skb length and not error. But when family == AF_UNSPEC, the caller of dump_rules assumes that it returns an error. Hence, when family == AF_UNSPEC, we continue trying to dump on -EMSGSIZE errors resulting in incorrect dump idx carried between skbs belonging to the same dump. This results in fib rule dump always only dumping rules that fit into the first skb. This patch fixes dump_rules to return error so that we exit correctly and idx is correctly maintained between skbs that are part of the same dump. Signed-off-by: Wilson Kok Signed-off-by: Roopa Prabhu Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/core/fib_rules.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c index 55e08e2de3a1c2..627e517077e465 100644 --- a/net/core/fib_rules.c +++ b/net/core/fib_rules.c @@ -596,15 +596,17 @@ static int dump_rules(struct sk_buff *skb, struct netlink_callback *cb, { int idx = 0; struct fib_rule *rule; + int err = 0; rcu_read_lock(); list_for_each_entry_rcu(rule, &ops->rules_list, list) { if (idx < cb->args[1]) goto skip; - if (fib_nl_fill_rule(skb, rule, NETLINK_CB(cb->skb).portid, - cb->nlh->nlmsg_seq, RTM_NEWRULE, - NLM_F_MULTI, ops) < 0) + err = fib_nl_fill_rule(skb, rule, NETLINK_CB(cb->skb).portid, + cb->nlh->nlmsg_seq, RTM_NEWRULE, + NLM_F_MULTI, ops); + if (err) break; skip: idx++; @@ -613,7 +615,7 @@ static int dump_rules(struct sk_buff *skb, struct netlink_callback *cb, cb->args[1] = idx; rules_ops_put(ops); - return skb->len; + return err; } static int fib_nl_dumprule(struct sk_buff *skb, struct netlink_callback *cb) @@ -629,7 +631,9 @@ static int fib_nl_dumprule(struct sk_buff *skb, struct netlink_callback *cb) if (ops == NULL) return -EAFNOSUPPORT; - return dump_rules(skb, cb, ops); + dump_rules(skb, cb, ops); + + return skb->len; } rcu_read_lock(); From e6478de4fad8e6d7cad3ca3440ee4da599fb0b2f Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Sun, 24 May 2015 09:25:00 -0500 Subject: [PATCH 278/359] vfs: Remove incorrect debugging WARN in prepend_path commit 93e3bce6287e1fb3e60d3324ed08555b5bbafa89 upstream. The warning message in prepend_path is unclear and outdated. It was added as a warning that the mechanism for generating names of pseudo files had been removed from prepend_path and d_dname should be used instead. Unfortunately the warning reads like a general warning, making it unclear what to do with it. Remove the warning. The transition it was added to warn about is long over, and I added code several years ago which in rare cases causes the warning to fire on legitimate code, and the warning is now firing and scaring people for no good reason. Reported-by: Ivan Delalande Reported-by: Omar Sandoval Fixes: f48cfddc6729e ("vfs: In d_path don't call d_dname on a mount point") Signed-off-by: "Eric W. Biederman" [ vlee: Backported to 3.10. Adjusted context. ] Signed-off-by: Vinson Lee Signed-off-by: Greg Kroah-Hartman --- fs/dcache.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/fs/dcache.c b/fs/dcache.c index 90be2809e15aeb..f1e80178597611 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -2569,15 +2569,6 @@ static int prepend_path(const struct path *path, return error; global_root: - /* - * Filesystems needing to implement special "root names" - * should do so with ->d_dname() - */ - if (IS_ROOT(dentry) && - (dentry->d_name.len != 1 || dentry->d_name.name[0] != '/')) { - WARN(1, "Root dentry has weird name <%.*s>\n", - (int) dentry->d_name.len, dentry->d_name.name); - } if (!slash) error = prepend(buffer, buflen, "/", 1); if (!error) From d565d87eb95146aef43f0c60a88d4cfdadebb16c Mon Sep 17 00:00:00 2001 From: Markus Pargmann Date: Wed, 29 Jul 2015 15:46:03 +0200 Subject: [PATCH 279/359] Revert "iio: bmg160: IIO_BUFFER and IIO_TRIGGERED_BUFFER are required" This reverts commit 35c45e8bce3c92fb1ff94d376f1d4bfaae079d66 which was commit 06d2f6ca5a38abe92f1f3a132b331eee773868c3 upstream as it should not have been applied. Reported-by: Luis Henriques Cc: Markus Pargmann Cc: Srinivas Pandruvada Cc: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/gyro/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/gyro/Kconfig b/drivers/iio/gyro/Kconfig index 953a0621c6fe7e..107cafcb89dac6 100644 --- a/drivers/iio/gyro/Kconfig +++ b/drivers/iio/gyro/Kconfig @@ -73,8 +73,7 @@ config IIO_ST_GYRO_SPI_3AXIS config ITG3200 tristate "InvenSense ITG3200 Digital 3-Axis Gyroscope I2C driver" depends on I2C - select IIO_BUFFER - select IIO_TRIGGERED_BUFFER + select IIO_TRIGGERED_BUFFER if IIO_BUFFER help Say yes here to add support for the InvenSense ITG3200 digital 3-axis gyroscope sensor. From f5552cd830e58c46dffae3617b3ce0c839771981 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 1 Oct 2015 12:07:55 +0200 Subject: [PATCH 280/359] Linux 3.10.90 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ca82393e1eea26..ce741a9f5b1c9c 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 10 -SUBLEVEL = 89 +SUBLEVEL = 90 EXTRAVERSION = NAME = TOSSUG Baby Fish From 4f402ee59232ea59b0364a290ba4efd46b03510d Mon Sep 17 00:00:00 2001 From: Michal Hocko Date: Thu, 27 Aug 2015 20:16:37 +0200 Subject: [PATCH 281/359] scsi: fix scsi_error_handler vs. scsi_host_dev_release race commit 537b604c8b3aa8b96fe35f87dd085816552e294c upstream. b9d5c6b7ef57 ("[SCSI] cleanup setting task state in scsi_error_handler()") has introduced a race between scsi_error_handler and scsi_host_dev_release resulting in the hang when the device goes away because scsi_error_handler might miss a wake up: CPU0 CPU1 scsi_error_handler scsi_host_dev_release kthread_stop() kthread_should_stop() test_bit(KTHREAD_SHOULD_STOP) set_bit(KTHREAD_SHOULD_STOP) wake_up_process() wait_for_completion() set_current_state(TASK_INTERRUPTIBLE) schedule() The most straightforward solution seems to be to invert the ordering of the set_current_state and kthread_should_stop. The issue has been noticed during reboot test on a 3.0 based kernel but the current code seems to be affected in the same way. [jejb: additional comment added] Reported-and-debugged-by: Mike Mayer Signed-off-by: Michal Hocko Reviewed-by: Dan Williams Reviewed-by: Hannes Reinecke Signed-off-by: James Bottomley Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/scsi_error.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 3668b1b23b5a3f..9acbc885239b3e 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -1849,8 +1849,17 @@ int scsi_error_handler(void *data) * We never actually get interrupted because kthread_run * disables signal delivery for the created thread. */ - while (!kthread_should_stop()) { + while (true) { + /* + * The sequence in kthread_stop() sets the stop flag first + * then wakes the process. To avoid missed wakeups, the task + * should always be in a non running state before the stop + * flag is checked + */ set_current_state(TASK_INTERRUPTIBLE); + if (kthread_should_stop()) + break; + if ((shost->host_failed == 0 && shost->host_eh_scheduled == 0) || shost->host_failed != shost->host_busy) { SCSI_LOG_ERROR_RECOVERY(1, From b200a84e6b618fc37d04f74d7228cf5acd6fb221 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Fri, 11 Sep 2015 12:36:12 -0300 Subject: [PATCH 282/359] perf header: Fixup reading of HEADER_NRCPUS feature commit caa470475d9b59eeff093ae650800d34612c4379 upstream. The original patch introducing this header wrote the number of CPUs available and online in one order and then swapped those values when reading, fix it. Before: # perf record usleep 1 # perf report --header-only | grep 'nrcpus \(online\|avail\)' # nrcpus online : 4 # nrcpus avail : 4 # echo 0 > /sys/devices/system/cpu/cpu2/online # perf record usleep 1 # perf report --header-only | grep 'nrcpus \(online\|avail\)' # nrcpus online : 4 # nrcpus avail : 3 # echo 0 > /sys/devices/system/cpu/cpu1/online # perf record usleep 1 # perf report --header-only | grep 'nrcpus \(online\|avail\)' # nrcpus online : 4 # nrcpus avail : 2 After the fix, bringing back the CPUs online: # perf report --header-only | grep 'nrcpus \(online\|avail\)' # nrcpus online : 2 # nrcpus avail : 4 # echo 1 > /sys/devices/system/cpu/cpu2/online # perf record usleep 1 # perf report --header-only | grep 'nrcpus \(online\|avail\)' # nrcpus online : 3 # nrcpus avail : 4 # echo 1 > /sys/devices/system/cpu/cpu1/online # perf record usleep 1 # perf report --header-only | grep 'nrcpus \(online\|avail\)' # nrcpus online : 4 # nrcpus avail : 4 Acked-by: Namhyung Kim Cc: Adrian Hunter Cc: Borislav Petkov Cc: David Ahern Cc: Frederic Weisbecker Cc: Jiri Olsa Cc: Kan Liang Cc: Stephane Eranian Cc: Wang Nan Fixes: fbe96f29ce4b ("perf tools: Make perf.data more self-descriptive (v8)") Link: http://lkml.kernel.org/r/20150911153323.GP23511@kernel.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Greg Kroah-Hartman --- tools/perf/util/header.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 326068a593a5f4..bb34199d54519e 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -1729,7 +1729,7 @@ static int process_nrcpus(struct perf_file_section *section __maybe_unused, if (ph->needs_swap) nr = bswap_32(nr); - ph->env.nr_cpus_online = nr; + ph->env.nr_cpus_avail = nr; ret = readn(fd, &nr, sizeof(nr)); if (ret != sizeof(nr)) @@ -1738,7 +1738,7 @@ static int process_nrcpus(struct perf_file_section *section __maybe_unused, if (ph->needs_swap) nr = bswap_32(nr); - ph->env.nr_cpus_avail = nr; + ph->env.nr_cpus_online = nr; return 0; } From a18006390cf8f53f73a7e5e08e7102212807e2e8 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Thu, 3 Sep 2015 13:24:40 +0100 Subject: [PATCH 283/359] ARM: 8429/1: disable GCC SRA optimization commit a077224fd35b2f7fbc93f14cf67074fc792fbac2 upstream. While working on the 32-bit ARM port of UEFI, I noticed a strange corruption in the kernel log. The following snprintf() statement (in drivers/firmware/efi/efi.c:efi_md_typeattr_format()) snprintf(pos, size, "|%3s|%2s|%2s|%2s|%3s|%2s|%2s|%2s|%2s]", was producing the following output in the log: | | | | | |WB|WT|WC|UC] | | | | | |WB|WT|WC|UC] | | | | | |WB|WT|WC|UC] |RUN| | | | |WB|WT|WC|UC]* |RUN| | | | |WB|WT|WC|UC]* | | | | | |WB|WT|WC|UC] |RUN| | | | |WB|WT|WC|UC]* | | | | | |WB|WT|WC|UC] |RUN| | | | | | | |UC] |RUN| | | | | | | |UC] As it turns out, this is caused by incorrect code being emitted for the string() function in lib/vsprintf.c. The following code if (!(spec.flags & LEFT)) { while (len < spec.field_width--) { if (buf < end) *buf = ' '; ++buf; } } for (i = 0; i < len; ++i) { if (buf < end) *buf = *s; ++buf; ++s; } while (len < spec.field_width--) { if (buf < end) *buf = ' '; ++buf; } when called with len == 0, triggers an issue in the GCC SRA optimization pass (Scalar Replacement of Aggregates), which handles promotion of signed struct members incorrectly. This is a known but as yet unresolved issue. (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65932). In this particular case, it is causing the second while loop to be executed erroneously a single time, causing the additional space characters to be printed. So disable the optimization by passing -fno-ipa-sra. Acked-by: Nicolas Pitre Signed-off-by: Ard Biesheuvel Signed-off-by: Russell King Signed-off-by: Greg Kroah-Hartman --- arch/arm/Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 1ba358ba16b871..7d4ce431107b17 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -55,6 +55,14 @@ endif comma = , +# +# The Scalar Replacement of Aggregates (SRA) optimization pass in GCC 4.9 and +# later may result in code being generated that handles signed short and signed +# char struct members incorrectly. So disable it. +# (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65932) +# +KBUILD_CFLAGS += $(call cc-option,-fno-ipa-sra) + # This selects which instruction set is used. # Note that GCC does not numerically define an architecture version # macro, but instead defines a whole series of macros which makes From a5c58721ab7b93861043b9c1336901a0862dfa6a Mon Sep 17 00:00:00 2001 From: Paul Bolle Date: Fri, 31 Jul 2015 14:08:58 +0200 Subject: [PATCH 284/359] windfarm: decrement client count when unregistering commit fe2b592173ff0274e70dc44d1d28c19bb995aa7c upstream. wf_unregister_client() increments the client count when a client unregisters. That is obviously incorrect. Decrement that client count instead. Fixes: 75722d3992f5 ("[PATCH] ppc64: Thermal control for SMU based machines") Signed-off-by: Paul Bolle Signed-off-by: Michael Ellerman Signed-off-by: Greg Kroah-Hartman --- drivers/macintosh/windfarm_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/macintosh/windfarm_core.c b/drivers/macintosh/windfarm_core.c index 3ee198b6584382..cc7ece1712b506 100644 --- a/drivers/macintosh/windfarm_core.c +++ b/drivers/macintosh/windfarm_core.c @@ -435,7 +435,7 @@ int wf_unregister_client(struct notifier_block *nb) { mutex_lock(&wf_lock); blocking_notifier_chain_unregister(&wf_client_list, nb); - wf_client_count++; + wf_client_count--; if (wf_client_count == 0) wf_stop_thread(); mutex_unlock(&wf_lock); From ffebdff74ff04666b221c568daabd878f5939738 Mon Sep 17 00:00:00 2001 From: Shaohua Li Date: Thu, 30 Jul 2015 16:24:43 -0700 Subject: [PATCH 285/359] x86/apic: Serialize LVTT and TSC_DEADLINE writes commit 5d7c631d926b59aa16f3c56eaeb83f1036c81dc7 upstream. The APIC LVTT register is MMIO mapped but the TSC_DEADLINE register is an MSR. The write to the TSC_DEADLINE MSR is not serializing, so it's not guaranteed that the write to LVTT has reached the APIC before the TSC_DEADLINE MSR is written. In such a case the write to the MSR is ignored and as a consequence the local timer interrupt never fires. The SDM decribes this issue for xAPIC and x2APIC modes. The serialization methods recommended by the SDM differ. xAPIC: "1. Memory-mapped write to LVT Timer Register, setting bits 18:17 to 10b. 2. WRMSR to the IA32_TSC_DEADLINE MSR a value much larger than current time-stamp counter. 3. If RDMSR of the IA32_TSC_DEADLINE MSR returns zero, go to step 2. 4. WRMSR to the IA32_TSC_DEADLINE MSR the desired deadline." x2APIC: "To allow for efficient access to the APIC registers in x2APIC mode, the serializing semantics of WRMSR are relaxed when writing to the APIC registers. Thus, system software should not use 'WRMSR to APIC registers in x2APIC mode' as a serializing instruction. Read and write accesses to the APIC registers will occur in program order. A WRMSR to an APIC register may complete before all preceding stores are globally visible; software can prevent this by inserting a serializing instruction, an SFENCE, or an MFENCE before the WRMSR." The xAPIC method is to just wait for the memory mapped write to hit the LVTT by checking whether the MSR write has reached the hardware. There is no reason why a proper MFENCE after the memory mapped write would not do the same. Andi Kleen confirmed that MFENCE is sufficient for the xAPIC case as well. Issue MFENCE before writing to the TSC_DEADLINE MSR. This can be done unconditionally as all CPUs which have TSC_DEADLINE also have MFENCE support. [ tglx: Massaged the changelog ] Signed-off-by: Shaohua Li Reviewed-by: Ingo Molnar Cc: Cc: Cc: Cc: Andi Kleen Cc: H. Peter Anvin Link: http://lkml.kernel.org/r/20150909041352.GA2059853@devbig257.prn2.facebook.com Signed-off-by: Thomas Gleixner Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/apic/apic.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 033eb44dc661a9..9620d18cb63804 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -350,6 +350,13 @@ static void __setup_APIC_LVTT(unsigned int clocks, int oneshot, int irqen) apic_write(APIC_LVTT, lvtt_value); if (lvtt_value & APIC_LVT_TIMER_TSCDEADLINE) { + /* + * See Intel SDM: TSC-Deadline Mode chapter. In xAPIC mode, + * writing to the APIC LVTT and TSC_DEADLINE MSR isn't serialized. + * According to Intel, MFENCE can do the serialization here. + */ + asm volatile("mfence" : : : "memory"); + printk_once(KERN_DEBUG "TSC deadline timer enabled\n"); return; } From 9870892fc277debf23fd5f6bef2fef5ae77b97fb Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Wed, 16 Sep 2015 14:10:03 +0100 Subject: [PATCH 286/359] x86/platform: Fix Geode LX timekeeping in the generic x86 build commit 03da3ff1cfcd7774c8780d2547ba0d995f7dc03d upstream. In 2007, commit 07190a08eef36 ("Mark TSC on GeodeLX reliable") bypassed verification of the TSC on Geode LX. However, this code (now in the check_system_tsc_reliable() function in arch/x86/kernel/tsc.c) was only present if CONFIG_MGEODE_LX was set. OpenWRT has recently started building its generic Geode target for Geode GX, not LX, to include support for additional platforms. This broke the timekeeping on LX-based devices, because the TSC wasn't marked as reliable: https://dev.openwrt.org/ticket/20531 By adding a runtime check on is_geode_lx(), we can also include the fix if CONFIG_MGEODEGX1 or CONFIG_X86_GENERIC are set, thus fixing the problem. Signed-off-by: David Woodhouse Cc: Andres Salomon Cc: Linus Torvalds Cc: Marcelo Tosatti Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1442409003.131189.87.camel@infradead.org Signed-off-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/tsc.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index 27e3a14fc917bd..9714a7aa32fcd8 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c @@ -20,6 +20,7 @@ #include #include #include +#include unsigned int __read_mostly cpu_khz; /* TSC clocks / usec, not used here */ EXPORT_SYMBOL(cpu_khz); @@ -806,15 +807,17 @@ EXPORT_SYMBOL_GPL(mark_tsc_unstable); static void __init check_system_tsc_reliable(void) { -#ifdef CONFIG_MGEODE_LX - /* RTSC counts during suspend */ +#if defined(CONFIG_MGEODEGX1) || defined(CONFIG_MGEODE_LX) || defined(CONFIG_X86_GENERIC) + if (is_geode_lx()) { + /* RTSC counts during suspend */ #define RTSC_SUSP 0x100 - unsigned long res_low, res_high; + unsigned long res_low, res_high; - rdmsr_safe(MSR_GEODE_BUSCONT_CONF0, &res_low, &res_high); - /* Geode_LX - the OLPC CPU has a very reliable TSC */ - if (res_low & RTSC_SUSP) - tsc_clocksource_reliable = 1; + rdmsr_safe(MSR_GEODE_BUSCONT_CONF0, &res_low, &res_high); + /* Geode_LX - the OLPC CPU has a very reliable TSC */ + if (res_low & RTSC_SUSP) + tsc_clocksource_reliable = 1; + } #endif if (boot_cpu_has(X86_FEATURE_TSC_RELIABLE)) tsc_clocksource_reliable = 1; From fb7eff9cfdffc4cb2f3d75024bda6c2a56ab12e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20M=C3=BCller?= Date: Thu, 1 Oct 2015 13:43:42 +0200 Subject: [PATCH 287/359] Use WARN_ON_ONCE for missing X86_FEATURE_NRIPS commit d2922422c48df93f3edff7d872ee4f3191fefb08 upstream. The cpu feature flags are not ever going to change, so warning everytime can cause a lot of kernel log spam (in our case more than 10GB/hour). The warning seems to only occur when nested virtualization is enabled, so it's probably triggered by a KVM bug. This is a sensible and safe change anyway, and the KVM bug fix might not be suitable for stable releases anyway. Signed-off-by: Dirk Mueller Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/svm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 224d2ef754cc68..3deddd796f769e 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -496,7 +496,7 @@ static void skip_emulated_instruction(struct kvm_vcpu *vcpu) struct vcpu_svm *svm = to_svm(vcpu); if (svm->vmcb->control.next_rip != 0) { - WARN_ON(!static_cpu_has(X86_FEATURE_NRIPS)); + WARN_ON_ONCE(!static_cpu_has(X86_FEATURE_NRIPS)); svm->next_rip = svm->vmcb->control.next_rip; } From 4f9d53595caf9c801c8b4389bc0c64e9c16488f0 Mon Sep 17 00:00:00 2001 From: Stephen Smalley Date: Thu, 1 Oct 2015 09:04:22 -0400 Subject: [PATCH 288/359] x86/mm: Set NX on gap between __ex_table and rodata commit ab76f7b4ab2397ffdd2f1eb07c55697d19991d10 upstream. Unused space between the end of __ex_table and the start of rodata can be left W+x in the kernel page tables. Extend the setting of the NX bit to cover this gap by starting from text_end rather than rodata_start. Before: ---[ High Kernel Mapping ]--- 0xffffffff80000000-0xffffffff81000000 16M pmd 0xffffffff81000000-0xffffffff81600000 6M ro PSE GLB x pmd 0xffffffff81600000-0xffffffff81754000 1360K ro GLB x pte 0xffffffff81754000-0xffffffff81800000 688K RW GLB x pte 0xffffffff81800000-0xffffffff81a00000 2M ro PSE GLB NX pmd 0xffffffff81a00000-0xffffffff81b3b000 1260K ro GLB NX pte 0xffffffff81b3b000-0xffffffff82000000 4884K RW GLB NX pte 0xffffffff82000000-0xffffffff82200000 2M RW PSE GLB NX pmd 0xffffffff82200000-0xffffffffa0000000 478M pmd After: ---[ High Kernel Mapping ]--- 0xffffffff80000000-0xffffffff81000000 16M pmd 0xffffffff81000000-0xffffffff81600000 6M ro PSE GLB x pmd 0xffffffff81600000-0xffffffff81754000 1360K ro GLB x pte 0xffffffff81754000-0xffffffff81800000 688K RW GLB NX pte 0xffffffff81800000-0xffffffff81a00000 2M ro PSE GLB NX pmd 0xffffffff81a00000-0xffffffff81b3b000 1260K ro GLB NX pte 0xffffffff81b3b000-0xffffffff82000000 4884K RW GLB NX pte 0xffffffff82000000-0xffffffff82200000 2M RW PSE GLB NX pmd 0xffffffff82200000-0xffffffffa0000000 478M pmd Signed-off-by: Stephen Smalley Acked-by: Kees Cook Cc: Linus Torvalds Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-kernel@vger.kernel.org Link: http://lkml.kernel.org/r/1443704662-3138-1-git-send-email-sds@tycho.nsa.gov Signed-off-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman --- arch/x86/mm/init_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index 2db3f30bed7510..b04e502620882f 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c @@ -1163,7 +1163,7 @@ void mark_rodata_ro(void) * has been zapped already via cleanup_highmem(). */ all_end = roundup((unsigned long)_brk_end, PMD_SIZE); - set_memory_nx(rodata_start, (all_end - rodata_start) >> PAGE_SHIFT); + set_memory_nx(text_end, (all_end - text_end) >> PAGE_SHIFT); rodata_test(); From 919845cb331e066a042a8060e84bb9dc6ba390bf Mon Sep 17 00:00:00 2001 From: Vitaly Kuznetsov Date: Fri, 25 Sep 2015 11:59:52 +0200 Subject: [PATCH 289/359] x86/xen: Support kexec/kdump in HVM guests by doing a soft reset commit 0b34a166f291d255755be46e43ed5497cdd194f2 upstream. Currently there is a number of issues preventing PVHVM Xen guests from doing successful kexec/kdump: - Bound event channels. - Registered vcpu_info. - PIRQ/emuirq mappings. - shared_info frame after XENMAPSPACE_shared_info operation. - Active grant mappings. Basically, newly booted kernel stumbles upon already set up Xen interfaces and there is no way to reestablish them. In Xen-4.7 a new feature called 'soft reset' is coming. A guest performing kexec/kdump operation is supposed to call SCHEDOP_shutdown hypercall with SHUTDOWN_soft_reset reason before jumping to new kernel. Hypervisor (with some help from toolstack) will do full domain cleanup (but keeping its memory and vCPU contexts intact) returning the guest to the state it had when it was first booted and thus allowing it to start over. Doing SHUTDOWN_soft_reset on Xen hypervisors which don't support it is probably OK as by default all unknown shutdown reasons cause domain destroy with a message in toolstack log: 'Unknown shutdown reason code 5. Destroying domain.' which gives a clue to what the problem is and eliminates false expectations. Signed-off-by: Vitaly Kuznetsov Signed-off-by: David Vrabel Signed-off-by: Greg Kroah-Hartman --- arch/x86/xen/enlighten.c | 23 +++++++++++++++++++++++ include/xen/interface/sched.h | 8 ++++++++ 2 files changed, 31 insertions(+) diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 13d926282c89ac..511630db00a82e 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c @@ -33,6 +33,10 @@ #include #include +#ifdef CONFIG_KEXEC_CORE +#include +#endif + #include #include #include @@ -1744,6 +1748,21 @@ static struct notifier_block xen_hvm_cpu_notifier __cpuinitdata = { .notifier_call = xen_hvm_cpu_notify, }; +#ifdef CONFIG_KEXEC_CORE +static void xen_hvm_shutdown(void) +{ + native_machine_shutdown(); + if (kexec_in_progress) + xen_reboot(SHUTDOWN_soft_reset); +} + +static void xen_hvm_crash_shutdown(struct pt_regs *regs) +{ + native_machine_crash_shutdown(regs); + xen_reboot(SHUTDOWN_soft_reset); +} +#endif + static void __init xen_hvm_guest_init(void) { init_hvm_pv_info(); @@ -1758,6 +1777,10 @@ static void __init xen_hvm_guest_init(void) x86_init.irqs.intr_init = xen_init_IRQ; xen_hvm_init_time_ops(); xen_hvm_init_mmu_ops(); +#ifdef CONFIG_KEXEC_CORE + machine_ops.shutdown = xen_hvm_shutdown; + machine_ops.crash_shutdown = xen_hvm_crash_shutdown; +#endif } static bool __init xen_hvm_platform(void) diff --git a/include/xen/interface/sched.h b/include/xen/interface/sched.h index 9ce083960a2575..f18490985fc8e5 100644 --- a/include/xen/interface/sched.h +++ b/include/xen/interface/sched.h @@ -107,5 +107,13 @@ struct sched_watchdog { #define SHUTDOWN_suspend 2 /* Clean up, save suspend info, kill. */ #define SHUTDOWN_crash 3 /* Tell controller we've crashed. */ #define SHUTDOWN_watchdog 4 /* Restart because watchdog time expired. */ +/* + * Domain asked to perform 'soft reset' for it. The expected behavior is to + * reset internal Xen state for the domain returning it to the point where it + * was created but leaving the domain's memory contents and vCPU contexts + * intact. This will allow the domain to start over and set up all Xen specific + * interfaces again. + */ +#define SHUTDOWN_soft_reset 5 #endif /* __XEN_PUBLIC_SCHED_H__ */ From 69e686057711bf17907ba68e19ceffdfca80d788 Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Sun, 6 Sep 2015 01:46:54 +0300 Subject: [PATCH 290/359] spi: Fix documentation of spi_alloc_master() commit a394d635193b641f2c86ead5ada5b115d57c51f8 upstream. Actually, spi_master_put() after spi_alloc_master() must _not_ be followed by kfree(). The memory is already freed with the call to spi_master_put() through spi_master_class, which registers a release function. Calling both spi_master_put() and kfree() results in often nasty (and delayed) crashes elsewhere in the kernel, often in the networking stack. This reverts commit eb4af0f5349235df2e4a5057a72fc8962d00308a. Link to patch and concerns: https://lkml.org/lkml/2012/9/3/269 or http://lkml.iu.edu/hypermail/linux/kernel/1209.0/00790.html Alexey Klimov: This revert becomes valid after 94c69f765f1b4a658d96905ec59928e3e3e07e6a when spi-imx.c has been fixed and there is no need to call kfree() so comment for spi_alloc_master() should be fixed. Signed-off-by: Guenter Roeck Signed-off-by: Alexey Klimov Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- drivers/spi/spi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 32b7bb111eb6b5..7c159634aaaeb8 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -1030,8 +1030,7 @@ static struct class spi_master_class = { * * The caller is responsible for assigning the bus number and initializing * the master's methods before calling spi_register_master(); and (after errors - * adding the device) calling spi_master_put() and kfree() to prevent a memory - * leak. + * adding the device) calling spi_master_put() to prevent a memory leak. */ struct spi_master *spi_alloc_master(struct device *dev, unsigned size) { From 69155df6a85cd1672c032220a8619a7f9e5f403b Mon Sep 17 00:00:00 2001 From: "Tan, Jui Nee" Date: Tue, 1 Sep 2015 10:22:51 +0800 Subject: [PATCH 291/359] spi: spi-pxa2xx: Check status register to determine if SSSR_TINT is disabled commit 02bc933ebb59208f42c2e6305b2c17fd306f695d upstream. On Intel Baytrail, there is case when interrupt handler get called, no SPI message is captured. The RX FIFO is indeed empty when RX timeout pending interrupt (SSSR_TINT) happens. Use the BIOS version where both HSUART and SPI are on the same IRQ. Both drivers are using IRQF_SHARED when calling the request_irq function. When running two separate and independent SPI and HSUART application that generate data traffic on both components, user will see messages like below on the console: pxa2xx-spi pxa2xx-spi.0: bad message state in interrupt handler This commit will fix this by first checking Receiver Time-out Interrupt, if it is disabled, ignore the request and return without servicing. Signed-off-by: Tan, Jui Nee Acked-by: Jarkko Nikula Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- drivers/spi/spi-pxa2xx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index cc42ee5e19fba4..787cfbaa7755d8 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -546,6 +546,10 @@ static irqreturn_t ssp_int(int irq, void *dev_id) if (!(sccr1_reg & SSCR1_TIE)) mask &= ~SSSR_TFS; + /* Ignore RX timeout interrupt if it is disabled */ + if (!(sccr1_reg & SSCR1_TINTE)) + mask &= ~SSSR_TINT; + if (!(status & mask)) return IRQ_NONE; From 9834213fa8586963f8f85fcf08df94efcb72435f Mon Sep 17 00:00:00 2001 From: Mel Gorman Date: Thu, 1 Oct 2015 15:36:57 -0700 Subject: [PATCH 292/359] mm: hugetlbfs: skip shared VMAs when unmapping private pages to satisfy a fault commit 2f84a8990ebbe235c59716896e017c6b2ca1200f upstream. SunDong reported the following on https://bugzilla.kernel.org/show_bug.cgi?id=103841 I think I find a linux bug, I have the test cases is constructed. I can stable recurring problems in fedora22(4.0.4) kernel version, arch for x86_64. I construct transparent huge page, when the parent and child process with MAP_SHARE, MAP_PRIVATE way to access the same huge page area, it has the opportunity to lead to huge page copy on write failure, and then it will munmap the child corresponding mmap area, but then the child mmap area with VM_MAYSHARE attributes, child process munmap this area can trigger VM_BUG_ON in set_vma_resv_flags functions (vma - > vm_flags & VM_MAYSHARE). There were a number of problems with the report (e.g. it's hugetlbfs that triggers this, not transparent huge pages) but it was fundamentally correct in that a VM_BUG_ON in set_vma_resv_flags() can be triggered that looks like this vma ffff8804651fd0d0 start 00007fc474e00000 end 00007fc475e00000 next ffff8804651fd018 prev ffff8804651fd188 mm ffff88046b1b1800 prot 8000000000000027 anon_vma (null) vm_ops ffffffff8182a7a0 pgoff 0 file ffff88106bdb9800 private_data (null) flags: 0x84400fb(read|write|shared|mayread|maywrite|mayexec|mayshare|dontexpand|hugetlb) ------------ kernel BUG at mm/hugetlb.c:462! SMP Modules linked in: xt_pkttype xt_LOG xt_limit [..] CPU: 38 PID: 26839 Comm: map Not tainted 4.0.4-default #1 Hardware name: Dell Inc. PowerEdge R810/0TT6JF, BIOS 2.7.4 04/26/2012 set_vma_resv_flags+0x2d/0x30 The VM_BUG_ON is correct because private and shared mappings have different reservation accounting but the warning clearly shows that the VMA is shared. When a private COW fails to allocate a new page then only the process that created the VMA gets the page -- all the children unmap the page. If the children access that data in the future then they get killed. The problem is that the same file is mapped shared and private. During the COW, the allocation fails, the VMAs are traversed to unmap the other private pages but a shared VMA is found and the bug is triggered. This patch identifies such VMAs and skips them. Signed-off-by: Mel Gorman Reported-by: SunDong Reviewed-by: Michal Hocko Cc: Andrea Arcangeli Cc: Hugh Dickins Cc: Naoya Horiguchi Cc: David Rientjes Reviewed-by: Naoya Horiguchi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- mm/hugetlb.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index d9bc87ca062bf8..e9fd382bf25a21 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -2572,6 +2572,14 @@ static int unmap_ref_private(struct mm_struct *mm, struct vm_area_struct *vma, if (iter_vma == vma) continue; + /* + * Shared VMAs have their own reserves and do not affect + * MAP_PRIVATE accounting but it is possible that a shared + * VMA is using the same page so check and skip such VMAs. + */ + if (iter_vma->vm_flags & VM_MAYSHARE) + continue; + /* * Unmap the page from other VMAs without their own reserves. * They get marked to be SIGKILLed if they fault in these From c47197f13497a9b17d9b2b69fe1185fcef044166 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 5 Oct 2015 16:55:09 +0200 Subject: [PATCH 293/359] ALSA: synth: Fix conflicting OSS device registration on AWE32 commit 225db5762dc1a35b26850477ffa06e5cd0097243 upstream. When OSS emulation is loaded on ISA SB AWE32 chip, we get now kernel warnings like: WARNING: CPU: 0 PID: 2791 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x51/0x80() sysfs: cannot create duplicate filename '/devices/isa/sbawe.0/sound/card0/seq-oss-0-0' It's because both emux synth and opl3 drivers try to register their OSS device object with the same static index number 0. This hasn't been a big problem until the recent rewrite of device management code (that exposes sysfs at the same time), but it's been an obvious bug. This patch works around it just by using a different index number of emux synth object. There can be a more elegant way to fix, but it's enough for now, as this code won't be touched so often, in anyway. Reported-and-tested-by: Michael Shell Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/synth/emux/emux_oss.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/synth/emux/emux_oss.c b/sound/synth/emux/emux_oss.c index daf61abc3670f5..646b66703bd8fd 100644 --- a/sound/synth/emux/emux_oss.c +++ b/sound/synth/emux/emux_oss.c @@ -69,7 +69,8 @@ snd_emux_init_seq_oss(struct snd_emux *emu) struct snd_seq_oss_reg *arg; struct snd_seq_device *dev; - if (snd_seq_device_new(emu->card, 0, SNDRV_SEQ_DEV_ID_OSS, + /* using device#1 here for avoiding conflicts with OPL3 */ + if (snd_seq_device_new(emu->card, 1, SNDRV_SEQ_DEV_ID_OSS, sizeof(struct snd_seq_oss_reg), &dev) < 0) return; From 9f6425cad8634c76c9055a3f4e85733f8f234419 Mon Sep 17 00:00:00 2001 From: Robert Jarzmik Date: Tue, 15 Sep 2015 20:51:31 +0200 Subject: [PATCH 294/359] ASoC: fix broken pxa SoC support commit 3c8f7710c1c44fb650bc29b6ef78ed8b60cfaa28 upstream. The previous fix of pxa library support, which was introduced to fix the library dependency, broke the previous SoC behavior, where a machine code binding pxa2xx-ac97 with a coded relied on : - sound/soc/pxa/pxa2xx-ac97.c - sound/soc/codecs/XXX.c For example, the mioa701_wm9713.c machine code is currently broken. The "select ARM" statement wrongly selects the soc/arm/pxa2xx-ac97 for compilation, as per an unfortunate fate SND_PXA2XX_AC97 is both declared in sound/arm/Kconfig and sound/soc/pxa/Kconfig. Fix this by ensuring that SND_PXA2XX_SOC correctly triggers the correct pxa2xx-ac97 compilation. Fixes: 846172dfe33c ("ASoC: fix SND_PXA2XX_LIB Kconfig warning") Signed-off-by: Robert Jarzmik Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/arm/Kconfig | 15 ++++++++------- sound/soc/pxa/Kconfig | 2 -- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/sound/arm/Kconfig b/sound/arm/Kconfig index 885683a3b0bdf0..e0406211716b00 100644 --- a/sound/arm/Kconfig +++ b/sound/arm/Kconfig @@ -9,6 +9,14 @@ menuconfig SND_ARM Drivers that are implemented on ASoC can be found in "ALSA for SoC audio support" section. +config SND_PXA2XX_LIB + tristate + select SND_AC97_CODEC if SND_PXA2XX_LIB_AC97 + select SND_DMAENGINE_PCM + +config SND_PXA2XX_LIB_AC97 + bool + if SND_ARM config SND_ARMAACI @@ -21,13 +29,6 @@ config SND_PXA2XX_PCM tristate select SND_PCM -config SND_PXA2XX_LIB - tristate - select SND_AC97_CODEC if SND_PXA2XX_LIB_AC97 - -config SND_PXA2XX_LIB_AC97 - bool - config SND_PXA2XX_AC97 tristate "AC97 driver for the Intel PXA2xx chip" depends on ARCH_PXA diff --git a/sound/soc/pxa/Kconfig b/sound/soc/pxa/Kconfig index 4d2e46fae77cfc..20a57c0060b229 100644 --- a/sound/soc/pxa/Kconfig +++ b/sound/soc/pxa/Kconfig @@ -1,7 +1,6 @@ config SND_PXA2XX_SOC tristate "SoC Audio for the Intel PXA2xx chip" depends on ARCH_PXA - select SND_ARM select SND_PXA2XX_LIB help Say Y or M if you want to add support for codecs attached to @@ -24,7 +23,6 @@ config SND_PXA2XX_AC97 config SND_PXA2XX_SOC_AC97 tristate select AC97_BUS - select SND_ARM select SND_PXA2XX_LIB_AC97 select SND_SOC_AC97_BUS From b7ab3afe207c8de114c9f546f8f9906f4ea7ecc3 Mon Sep 17 00:00:00 2001 From: Yitian Bu Date: Fri, 2 Oct 2015 15:18:41 +0800 Subject: [PATCH 295/359] ASoC: dwc: correct irq clear method commit 4873867e5f2bd90faad861dd94865099fc3140f3 upstream. from Designware I2S datasheet, tx/rx XRUN irq is cleared by reading register TOR/ROR, rather than by writing into them. Signed-off-by: Yitian Bu Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/dwc/designware_i2s.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/dwc/designware_i2s.c b/sound/soc/dwc/designware_i2s.c index 489a9abf112b14..6a530afbb7e987 100644 --- a/sound/soc/dwc/designware_i2s.c +++ b/sound/soc/dwc/designware_i2s.c @@ -100,10 +100,10 @@ static inline void i2s_clear_irqs(struct dw_i2s_dev *dev, u32 stream) if (stream == SNDRV_PCM_STREAM_PLAYBACK) { for (i = 0; i < 4; i++) - i2s_write_reg(dev->i2s_base, TOR(i), 0); + i2s_read_reg(dev->i2s_base, TOR(i)); } else { for (i = 0; i < 4; i++) - i2s_write_reg(dev->i2s_base, ROR(i), 0); + i2s_read_reg(dev->i2s_base, ROR(i)); } } From 6ec7d68798b8103a120b5b650995d7766ee3e374 Mon Sep 17 00:00:00 2001 From: Jeff Mahoney Date: Fri, 11 Sep 2015 21:44:17 -0400 Subject: [PATCH 296/359] btrfs: skip waiting on ordered range for special files commit a30e577c96f59b1e1678ea5462432b09bf7d5cbc upstream. In btrfs_evict_inode, we properly truncate the page cache for evicted inodes but then we call btrfs_wait_ordered_range for every inode as well. It's the right thing to do for regular files but results in incorrect behavior for device inodes for block devices. filemap_fdatawrite_range gets called with inode->i_mapping which gets resolved to the block device inode before getting passed to wbc_attach_fdatawrite_inode and ultimately to inode_to_bdi. What happens next depends on whether there's an open file handle associated with the inode. If there is, we write to the block device, which is unexpected behavior. If there isn't, we through normally and inode->i_data is used. We can also end up racing against open/close which can result in crashes when i_mapping points to a block device inode that has been closed. Since there can't be any page cache associated with special file inodes, it's safe to skip the btrfs_wait_ordered_range call entirely and avoid the problem. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=100911 Tested-by: Christoph Biedl Signed-off-by: Jeff Mahoney Reviewed-by: Filipe Manana Signed-off-by: Greg Kroah-Hartman --- fs/btrfs/inode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index d20db643772301..f22beda91ffc76 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -4650,7 +4650,8 @@ void btrfs_evict_inode(struct inode *inode) goto no_delete; } /* do we really want it for ->i_nlink > 0 and zero btrfs_root_refs? */ - btrfs_wait_ordered_range(inode, 0, (u64)-1); + if (!special_file(inode->i_mode)) + btrfs_wait_ordered_range(inode, 0, (u64)-1); if (root->fs_info->log_root_recovering) { BUG_ON(test_bit(BTRFS_INODE_HAS_ORPHAN_ITEM, From ba45b48d9bd1b01229c4fa3d94ba2a89045f23bd Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Tue, 11 Aug 2015 13:05:10 +0100 Subject: [PATCH 297/359] staging: comedi: adl_pci7x3x: fix digital output on PCI-7230 commit ad83dbd974feb2e2a8cc071a1d28782bd4d2c70e upstream. The "adl_pci7x3x" driver replaced the "adl_pci7230" and "adl_pci7432" drivers in commits 8f567c373c4b ("staging: comedi: new adl_pci7x3x driver") and 657f77d173d3 ("staging: comedi: remove adl_pci7230 and adl_pci7432 drivers"). Although the new driver code agrees with the user manuals for the respective boards, digital outputs stopped working on the PCI-7230. This has 16 digital output channels and the previous adl_pci7230 driver shifted the 16 bit output state left by 16 bits before writing to the hardware register. The new adl_pci7x3x driver doesn't do that. Fix it in `adl_pci7x3x_do_insn_bits()` by checking for the special case of the subdevice having only 16 channels and duplicating the 16 bit output state into both halves of the 32-bit register. That should work both for what the board actually does and for what the user manual says it should do. Fixes: 8f567c373c4b ("staging: comedi: new adl_pci7x3x driver") Signed-off-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adl_pci7x3x.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/adl_pci7x3x.c b/drivers/staging/comedi/drivers/adl_pci7x3x.c index e3960745f506ed..49cb6920689630 100644 --- a/drivers/staging/comedi/drivers/adl_pci7x3x.c +++ b/drivers/staging/comedi/drivers/adl_pci7x3x.c @@ -119,10 +119,21 @@ static int adl_pci7x3x_do_insn_bits(struct comedi_device *dev, unsigned int bits = data[1]; if (mask) { + unsigned int val; + s->state &= ~mask; s->state |= (bits & mask); - - outl(s->state, dev->iobase + reg); + val = s->state; + if (s->n_chan == 16) { + /* + * It seems the PCI-7230 needs the 16-bit DO state + * to be shifted left by 16 bits before being written + * to the 32-bit register. Set the value in both + * halves of the register to be sure. + */ + val |= val << 16; + } + outl(val, dev->iobase + reg); } /* From 249fbae374c90d6d29ed26f11bbacaf0bd0be827 Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Wed, 12 Aug 2015 15:12:09 +0100 Subject: [PATCH 298/359] dm btree: add ref counting ops for the leaves of top level btrees commit b0dc3c8bc157c60b1d470163882be8c13e1950af upstream. When using nested btrees, the top leaves of the top levels contain block addresses for the root of the next tree down. If we shadow a shared leaf node the leaf values (sub tree roots) should be incremented accordingly. This is only an issue if there is metadata sharing in the top levels. Which only occurs if metadata snapshots are being used (as is possible with dm-thinp). And could result in a block from the thinp metadata snap being reused early, thus corrupting the thinp metadata snap. Signed-off-by: Joe Thornber Signed-off-by: Mike Snitzer Signed-off-by: Greg Kroah-Hartman --- .../md/persistent-data/dm-btree-internal.h | 6 +++ drivers/md/persistent-data/dm-btree-remove.c | 12 ++---- drivers/md/persistent-data/dm-btree-spine.c | 37 +++++++++++++++++++ drivers/md/persistent-data/dm-btree.c | 7 +--- 4 files changed, 47 insertions(+), 15 deletions(-) diff --git a/drivers/md/persistent-data/dm-btree-internal.h b/drivers/md/persistent-data/dm-btree-internal.h index bf2b80d5c4707a..8731b6ea026bd9 100644 --- a/drivers/md/persistent-data/dm-btree-internal.h +++ b/drivers/md/persistent-data/dm-btree-internal.h @@ -138,4 +138,10 @@ int lower_bound(struct btree_node *n, uint64_t key); extern struct dm_block_validator btree_node_validator; +/* + * Value type for upper levels of multi-level btrees. + */ +extern void init_le64_type(struct dm_transaction_manager *tm, + struct dm_btree_value_type *vt); + #endif /* DM_BTREE_INTERNAL_H */ diff --git a/drivers/md/persistent-data/dm-btree-remove.c b/drivers/md/persistent-data/dm-btree-remove.c index a03178e91a79a7..7c0d75547ccf51 100644 --- a/drivers/md/persistent-data/dm-btree-remove.c +++ b/drivers/md/persistent-data/dm-btree-remove.c @@ -544,14 +544,6 @@ static int remove_raw(struct shadow_spine *s, struct dm_btree_info *info, return r; } -static struct dm_btree_value_type le64_type = { - .context = NULL, - .size = sizeof(__le64), - .inc = NULL, - .dec = NULL, - .equal = NULL -}; - int dm_btree_remove(struct dm_btree_info *info, dm_block_t root, uint64_t *keys, dm_block_t *new_root) { @@ -559,12 +551,14 @@ int dm_btree_remove(struct dm_btree_info *info, dm_block_t root, int index = 0, r = 0; struct shadow_spine spine; struct btree_node *n; + struct dm_btree_value_type le64_vt; + init_le64_type(info->tm, &le64_vt); init_shadow_spine(&spine, info); for (level = 0; level < info->levels; level++) { r = remove_raw(&spine, info, (level == last_level ? - &info->value_type : &le64_type), + &info->value_type : &le64_vt), root, keys[level], (unsigned *)&index); if (r < 0) break; diff --git a/drivers/md/persistent-data/dm-btree-spine.c b/drivers/md/persistent-data/dm-btree-spine.c index 1b5e13ec7f96a6..0dee514ba4c5f9 100644 --- a/drivers/md/persistent-data/dm-btree-spine.c +++ b/drivers/md/persistent-data/dm-btree-spine.c @@ -249,3 +249,40 @@ int shadow_root(struct shadow_spine *s) { return s->root; } + +static void le64_inc(void *context, const void *value_le) +{ + struct dm_transaction_manager *tm = context; + __le64 v_le; + + memcpy(&v_le, value_le, sizeof(v_le)); + dm_tm_inc(tm, le64_to_cpu(v_le)); +} + +static void le64_dec(void *context, const void *value_le) +{ + struct dm_transaction_manager *tm = context; + __le64 v_le; + + memcpy(&v_le, value_le, sizeof(v_le)); + dm_tm_dec(tm, le64_to_cpu(v_le)); +} + +static int le64_equal(void *context, const void *value1_le, const void *value2_le) +{ + __le64 v1_le, v2_le; + + memcpy(&v1_le, value1_le, sizeof(v1_le)); + memcpy(&v2_le, value2_le, sizeof(v2_le)); + return v1_le == v2_le; +} + +void init_le64_type(struct dm_transaction_manager *tm, + struct dm_btree_value_type *vt) +{ + vt->context = tm; + vt->size = sizeof(__le64); + vt->inc = le64_inc; + vt->dec = le64_dec; + vt->equal = le64_equal; +} diff --git a/drivers/md/persistent-data/dm-btree.c b/drivers/md/persistent-data/dm-btree.c index e3ecb0b824b55f..79233b051da049 100644 --- a/drivers/md/persistent-data/dm-btree.c +++ b/drivers/md/persistent-data/dm-btree.c @@ -651,12 +651,7 @@ static int insert(struct dm_btree_info *info, dm_block_t root, struct btree_node *n; struct dm_btree_value_type le64_type; - le64_type.context = NULL; - le64_type.size = sizeof(__le64); - le64_type.inc = NULL; - le64_type.dec = NULL; - le64_type.equal = NULL; - + init_le64_type(info->tm, &le64_type); init_shadow_spine(&spine, info); for (level = 0; level < (info->levels - 1); level++) { From 03fbf7001db5ecf209a9f36faa5a607e39cd54e9 Mon Sep 17 00:00:00 2001 From: "Liu.Zhao" Date: Mon, 24 Aug 2015 08:36:12 -0700 Subject: [PATCH 299/359] USB: option: add ZTE PIDs commit 19ab6bc5674a30fdb6a2436b068d19a3c17dc73e upstream. This is intended to add ZTE device PIDs on kernel. Signed-off-by: Liu.Zhao [johan: sort the new entries ] Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/option.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 096438e4fb0cf5..c918075e5eaeba 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -276,6 +276,10 @@ static void option_instat_callback(struct urb *urb); #define ZTE_PRODUCT_MF622 0x0001 #define ZTE_PRODUCT_MF628 0x0015 #define ZTE_PRODUCT_MF626 0x0031 +#define ZTE_PRODUCT_ZM8620_X 0x0396 +#define ZTE_PRODUCT_ME3620_MBIM 0x0426 +#define ZTE_PRODUCT_ME3620_X 0x1432 +#define ZTE_PRODUCT_ME3620_L 0x1433 #define ZTE_PRODUCT_AC2726 0xfff1 #define ZTE_PRODUCT_CDMA_TECH 0xfffe #define ZTE_PRODUCT_AC8710T 0xffff @@ -549,6 +553,18 @@ static const struct option_blacklist_info zte_mc2716_z_blacklist = { .sendsetup = BIT(1) | BIT(2) | BIT(3), }; +static const struct option_blacklist_info zte_me3620_mbim_blacklist = { + .reserved = BIT(2) | BIT(3) | BIT(4), +}; + +static const struct option_blacklist_info zte_me3620_xl_blacklist = { + .reserved = BIT(3) | BIT(4) | BIT(5), +}; + +static const struct option_blacklist_info zte_zm8620_x_blacklist = { + .reserved = BIT(3) | BIT(4) | BIT(5), +}; + static const struct option_blacklist_info huawei_cdc12_blacklist = { .reserved = BIT(1) | BIT(2), }; @@ -1579,6 +1595,14 @@ static const struct usb_device_id option_ids[] = { .driver_info = (kernel_ulong_t)&zte_ad3812_z_blacklist }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MC2716, 0xff, 0xff, 0xff), .driver_info = (kernel_ulong_t)&zte_mc2716_z_blacklist }, + { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_ME3620_L), + .driver_info = (kernel_ulong_t)&zte_me3620_xl_blacklist }, + { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_ME3620_MBIM), + .driver_info = (kernel_ulong_t)&zte_me3620_mbim_blacklist }, + { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_ME3620_X), + .driver_info = (kernel_ulong_t)&zte_me3620_xl_blacklist }, + { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_ZM8620_X), + .driver_info = (kernel_ulong_t)&zte_zm8620_x_blacklist }, { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x01) }, { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x05) }, { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x86, 0x10) }, From bad5bfcd07d6bcd73d8e4e141c9c1904b21d7053 Mon Sep 17 00:00:00 2001 From: Mikulas Patocka Date: Fri, 2 Oct 2015 11:17:37 -0400 Subject: [PATCH 300/359] dm raid: fix round up of default region size commit 042745ee53a0a7c1f5aff191a4a24213c6dcfb52 upstream. Commit 3a0f9aaee028 ("dm raid: round region_size to power of two") intended to make sure that the default region size is a power of two. However, the logic in that commit is incorrect and sets the variable region_size to 0 or 1, depending on whether min_region_size is a power of two. Fix this logic, using roundup_pow_of_two(), so that region_size is properly rounded up to the next power of two. Signed-off-by: Mikulas Patocka Fixes: 3a0f9aaee028 ("dm raid: round region_size to power of two") Signed-off-by: Mike Snitzer Signed-off-by: Greg Kroah-Hartman --- drivers/md/dm-raid.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c index 84cddccc024978..4805c15185c2e6 100644 --- a/drivers/md/dm-raid.c +++ b/drivers/md/dm-raid.c @@ -325,8 +325,7 @@ static int validate_region_size(struct raid_set *rs, unsigned long region_size) */ if (min_region_size > (1 << 13)) { /* If not a power of 2, make it the next power of 2 */ - if (min_region_size & (min_region_size - 1)) - region_size = 1 << fls(region_size); + region_size = roundup_pow_of_two(min_region_size); DMINFO("Choosing default region size of %lu sectors", region_size); } else { From 6709d8bdf704a67f8930374fd001d79eb4f1f41b Mon Sep 17 00:00:00 2001 From: Joe Stringer Date: Tue, 21 Jul 2015 21:37:31 -0700 Subject: [PATCH 301/359] netfilter: nf_conntrack: Support expectations in different zones commit 4b31814d20cbe5cd4ccf18089751e77a04afe4f2 upstream. When zones were originally introduced, the expectation functions were all extended to perform lookup using the zone. However, insertion was not modified to check the zone. This means that two expectations which are intended to apply for different connections that have the same tuple but exist in different zones cannot both be tracked. Fixes: 5d0aa2ccd4 (netfilter: nf_conntrack: add support for "conntrack zones") Signed-off-by: Joe Stringer Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- net/netfilter/nf_conntrack_expect.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/netfilter/nf_conntrack_expect.c b/net/netfilter/nf_conntrack_expect.c index c63b618cd619eb..95578da760d51a 100644 --- a/net/netfilter/nf_conntrack_expect.c +++ b/net/netfilter/nf_conntrack_expect.c @@ -202,7 +202,8 @@ static inline int expect_clash(const struct nf_conntrack_expect *a, a->mask.src.u3.all[count] & b->mask.src.u3.all[count]; } - return nf_ct_tuple_mask_cmp(&a->tuple, &b->tuple, &intersect_mask); + return nf_ct_tuple_mask_cmp(&a->tuple, &b->tuple, &intersect_mask) && + nf_ct_zone(a->master) == nf_ct_zone(b->master); } static inline int expect_matches(const struct nf_conntrack_expect *a, From 10ff4a0ca662575c9815b0bc6553d3f263efc24d Mon Sep 17 00:00:00 2001 From: Steve French Date: Tue, 22 Sep 2015 09:29:38 -0500 Subject: [PATCH 302/359] disabling oplocks/leases via module parm enable_oplocks broken for SMB3 commit e0ddde9d44e37fbc21ce893553094ecf1a633ab5 upstream. leases (oplocks) were always requested for SMB2/SMB3 even when oplocks disabled in the cifs.ko module. Signed-off-by: Steve French Reviewed-by: Chandrika Srinivasan Signed-off-by: Greg Kroah-Hartman --- fs/cifs/smb2ops.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index e12f258a5ffab7..66202da4c9614a 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -48,9 +48,13 @@ change_conf(struct TCP_Server_Info *server) break; default: server->echoes = true; - server->oplocks = true; + if (enable_oplocks) { + server->oplocks = true; + server->oplock_credits = 1; + } else + server->oplocks = false; + server->echo_credits = 1; - server->oplock_credits = 1; } server->credits -= server->echo_credits + server->oplock_credits; return 0; From 253db046eb2812dfe976203394e51f1a36fcbc67 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Tue, 23 Jun 2015 11:34:21 +0200 Subject: [PATCH 303/359] drm: Reject DRI1 hw lock ioctl functions for kms drivers commit da168d81b44898404d281d5dbe70154ab5f117c1 upstream. I've done some extensive history digging across libdrm, mesa and xf86-video-{intel,nouveau,ati}. The only potential user of this with kms drivers I could find was ttmtest, which once used drmGetLock still. But that mistake was quickly fixed up. Even the intel xvmc library (which otherwise was really good with using dri1 stuff in kms mode) managed to never take the hw lock for dri2 (and hence kms). Hence it should be save to unconditionally disallow this. Cc: Peter Antoine Reviewed-by: Peter Antoine Signed-off-by: Daniel Vetter Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/drm_lock.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/drm_lock.c b/drivers/gpu/drm/drm_lock.c index d752c96d609092..bdceb60998d350 100644 --- a/drivers/gpu/drm/drm_lock.c +++ b/drivers/gpu/drm/drm_lock.c @@ -58,6 +58,9 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv) struct drm_master *master = file_priv->master; int ret = 0; + if (drm_core_check_feature(dev, DRIVER_MODESET)) + return -EINVAL; + ++file_priv->lock_count; if (lock->context == DRM_KERNEL_CONTEXT) { @@ -151,6 +154,9 @@ int drm_unlock(struct drm_device *dev, void *data, struct drm_file *file_priv) struct drm_lock *lock = data; struct drm_master *master = file_priv->master; + if (drm_core_check_feature(dev, DRIVER_MODESET)) + return -EINVAL; + if (lock->context == DRM_KERNEL_CONTEXT) { DRM_ERROR("Process %d using kernel context %d\n", task_pid_nr(current), lock->context); From 0bccecfc32cb896d49ebd226b22cf6bfed45b35d Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Wed, 23 Sep 2015 11:41:42 -0700 Subject: [PATCH 304/359] USB: whiteheat: fix potential null-deref at probe commit cbb4be652d374f64661137756b8f357a1827d6a4 upstream. Fix potential null-pointer dereference at probe by making sure that the required endpoints are present. The whiteheat driver assumes there are at least five pairs of bulk endpoints, of which the final pair is used for the "command port". An attempt to bind to an interface with fewer bulk endpoints would currently lead to an oops. Fixes CVE-2015-5257. Reported-by: Moein Ghasemzadeh Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/whiteheat.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c index 5e3dd9f87ff5bd..ae79c2245a7372 100644 --- a/drivers/usb/serial/whiteheat.c +++ b/drivers/usb/serial/whiteheat.c @@ -81,6 +81,8 @@ static int whiteheat_firmware_download(struct usb_serial *serial, static int whiteheat_firmware_attach(struct usb_serial *serial); /* function prototypes for the Connect Tech WhiteHEAT serial converter */ +static int whiteheat_probe(struct usb_serial *serial, + const struct usb_device_id *id); static int whiteheat_attach(struct usb_serial *serial); static void whiteheat_release(struct usb_serial *serial); static int whiteheat_port_probe(struct usb_serial_port *port); @@ -117,6 +119,7 @@ static struct usb_serial_driver whiteheat_device = { .description = "Connect Tech - WhiteHEAT", .id_table = id_table_std, .num_ports = 4, + .probe = whiteheat_probe, .attach = whiteheat_attach, .release = whiteheat_release, .port_probe = whiteheat_port_probe, @@ -218,6 +221,34 @@ static int whiteheat_firmware_attach(struct usb_serial *serial) /***************************************************************************** * Connect Tech's White Heat serial driver functions *****************************************************************************/ + +static int whiteheat_probe(struct usb_serial *serial, + const struct usb_device_id *id) +{ + struct usb_host_interface *iface_desc; + struct usb_endpoint_descriptor *endpoint; + size_t num_bulk_in = 0; + size_t num_bulk_out = 0; + size_t min_num_bulk; + unsigned int i; + + iface_desc = serial->interface->cur_altsetting; + + for (i = 0; i < iface_desc->desc.bNumEndpoints; i++) { + endpoint = &iface_desc->endpoint[i].desc; + if (usb_endpoint_is_bulk_in(endpoint)) + ++num_bulk_in; + if (usb_endpoint_is_bulk_out(endpoint)) + ++num_bulk_out; + } + + min_num_bulk = COMMAND_PORT + 1; + if (num_bulk_in < min_num_bulk || num_bulk_out < min_num_bulk) + return -ENODEV; + + return 0; +} + static int whiteheat_attach(struct usb_serial *serial) { struct usb_serial_port *command_port; From 5eaec968f3377c20e7da49f8e3aef1d874a0591b Mon Sep 17 00:00:00 2001 From: Roger Quadros Date: Mon, 21 Sep 2015 17:46:13 +0300 Subject: [PATCH 305/359] usb: xhci: Clear XHCI_STATE_DYING on start commit e5bfeab0ad515b4f6df39fe716603e9dc6d3dfd0 upstream. For whatever reason if XHCI died in the previous instant then it will never recover on the next xhci_start unless we clear the DYING flag. Signed-off-by: Roger Quadros Signed-off-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 1f901fc25590af..1a22d186bef7a7 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -139,7 +139,8 @@ static int xhci_start(struct xhci_hcd *xhci) "waited %u microseconds.\n", XHCI_MAX_HALT_USEC); if (!ret) - xhci->xhc_state &= ~XHCI_STATE_HALTED; + xhci->xhc_state &= ~(XHCI_STATE_HALTED | XHCI_STATE_DYING); + return ret; } From 560db83c3e96376df8c6b8874c65f5d28031a493 Mon Sep 17 00:00:00 2001 From: Mathias Nyman Date: Mon, 21 Sep 2015 17:46:16 +0300 Subject: [PATCH 306/359] xhci: change xhci 1.0 only restrictions to support xhci 1.1 commit dca7794539eff04b786fb6907186989e5eaaa9c2 upstream. Some changes between xhci 0.96 and xhci 1.0 specifications forced us to check the hci version in code, some of these checks were implemented as hci_version == 1.0, which will not work with new xhci 1.1 controllers. xhci 1.1 behaves similar to xhci 1.0 in these cases, so change these checks to hci_version >= 1.0 Signed-off-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci-mem.c | 6 +++--- drivers/usb/host/xhci-ring.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index 31bed5f7d0eb08..87e82e6b0c3855 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c @@ -1473,10 +1473,10 @@ int xhci_endpoint_init(struct xhci_hcd *xhci, * use Event Data TRBs, and we don't chain in a link TRB on short * transfers, we're basically dividing by 1. * - * xHCI 1.0 specification indicates that the Average TRB Length should - * be set to 8 for control endpoints. + * xHCI 1.0 and 1.1 specification indicates that the Average TRB Length + * should be set to 8 for control endpoints. */ - if (usb_endpoint_xfer_control(&ep->desc) && xhci->hci_version == 0x100) + if (usb_endpoint_xfer_control(&ep->desc) && xhci->hci_version >= 0x100) ep_ctx->tx_info |= cpu_to_le32(AVG_TRB_LENGTH_FOR_EP(8)); else ep_ctx->tx_info |= diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index fde0277adc2c48..fe223cfaab0b79 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -3511,8 +3511,8 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *xhci, gfp_t mem_flags, if (start_cycle == 0) field |= 0x1; - /* xHCI 1.0 6.4.1.2.1: Transfer Type field */ - if (xhci->hci_version == 0x100) { + /* xHCI 1.0/1.1 6.4.1.2.1: Transfer Type field */ + if (xhci->hci_version >= 0x100) { if (urb->transfer_buffer_length > 0) { if (setup->bRequestType & USB_DIR_IN) field |= TRB_TX_TYPE(TRB_DATA_IN); From 760f9dc129d41a76934d149ccc762590006a6f6a Mon Sep 17 00:00:00 2001 From: Reyad Attiyat Date: Thu, 6 Aug 2015 19:23:58 +0300 Subject: [PATCH 307/359] usb: xhci: Add support for URB_ZERO_PACKET to bulk/sg transfers commit 4758dcd19a7d9ba9610b38fecb93f65f56f86346 upstream. This commit checks for the URB_ZERO_PACKET flag and creates an extra zero-length td if the urb transfer length is a multiple of the endpoint's max packet length. Signed-off-by: Reyad Attiyat Signed-off-by: Mathias Nyman Cc: Oliver Neukum Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci-ring.c | 66 ++++++++++++++++++++++++++++-------- drivers/usb/host/xhci.c | 5 +++ 2 files changed, 57 insertions(+), 14 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index fe223cfaab0b79..4ba6974dd4b64b 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -3167,9 +3167,11 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct xhci_td *td; struct scatterlist *sg; int num_sgs; - int trb_buff_len, this_sg_len, running_total; + int trb_buff_len, this_sg_len, running_total, ret; unsigned int total_packet_count; + bool zero_length_needed; bool first_trb; + int last_trb_num; u64 addr; bool more_trbs_coming; @@ -3185,13 +3187,27 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags, total_packet_count = DIV_ROUND_UP(urb->transfer_buffer_length, usb_endpoint_maxp(&urb->ep->desc)); - trb_buff_len = prepare_transfer(xhci, xhci->devs[slot_id], + ret = prepare_transfer(xhci, xhci->devs[slot_id], ep_index, urb->stream_id, num_trbs, urb, 0, mem_flags); - if (trb_buff_len < 0) - return trb_buff_len; + if (ret < 0) + return ret; urb_priv = urb->hcpriv; + + /* Deal with URB_ZERO_PACKET - need one more td/trb */ + zero_length_needed = urb->transfer_flags & URB_ZERO_PACKET && + urb_priv->length == 2; + if (zero_length_needed) { + num_trbs++; + xhci_dbg(xhci, "Creating zero length td.\n"); + ret = prepare_transfer(xhci, xhci->devs[slot_id], + ep_index, urb->stream_id, + 1, urb, 1, mem_flags); + if (ret < 0) + return ret; + } + td = urb_priv->td[0]; /* @@ -3221,6 +3237,7 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags, trb_buff_len = urb->transfer_buffer_length; first_trb = true; + last_trb_num = zero_length_needed ? 2 : 1; /* Queue the first TRB, even if it's zero-length */ do { u32 field = 0; @@ -3238,12 +3255,15 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags, /* Chain all the TRBs together; clear the chain bit in the last * TRB to indicate it's the last TRB in the chain. */ - if (num_trbs > 1) { + if (num_trbs > last_trb_num) { field |= TRB_CHAIN; - } else { - /* FIXME - add check for ZERO_PACKET flag before this */ + } else if (num_trbs == last_trb_num) { td->last_trb = ep_ring->enqueue; field |= TRB_IOC; + } else if (zero_length_needed && num_trbs == 1) { + trb_buff_len = 0; + urb_priv->td[1]->last_trb = ep_ring->enqueue; + field |= TRB_IOC; } /* Only set interrupt on short packet for IN endpoints */ @@ -3305,7 +3325,7 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags, if (running_total + trb_buff_len > urb->transfer_buffer_length) trb_buff_len = urb->transfer_buffer_length - running_total; - } while (running_total < urb->transfer_buffer_length); + } while (num_trbs > 0); check_trb_math(urb, num_trbs, running_total); giveback_first_trb(xhci, slot_id, ep_index, urb->stream_id, @@ -3323,7 +3343,9 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, int num_trbs; struct xhci_generic_trb *start_trb; bool first_trb; + int last_trb_num; bool more_trbs_coming; + bool zero_length_needed; int start_cycle; u32 field, length_field; @@ -3354,7 +3376,6 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, num_trbs++; running_total += TRB_MAX_BUFF_SIZE; } - /* FIXME: this doesn't deal with URB_ZERO_PACKET - need one more */ ret = prepare_transfer(xhci, xhci->devs[slot_id], ep_index, urb->stream_id, @@ -3363,6 +3384,20 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, return ret; urb_priv = urb->hcpriv; + + /* Deal with URB_ZERO_PACKET - need one more td/trb */ + zero_length_needed = urb->transfer_flags & URB_ZERO_PACKET && + urb_priv->length == 2; + if (zero_length_needed) { + num_trbs++; + xhci_dbg(xhci, "Creating zero length td.\n"); + ret = prepare_transfer(xhci, xhci->devs[slot_id], + ep_index, urb->stream_id, + 1, urb, 1, mem_flags); + if (ret < 0) + return ret; + } + td = urb_priv->td[0]; /* @@ -3384,7 +3419,7 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, trb_buff_len = urb->transfer_buffer_length; first_trb = true; - + last_trb_num = zero_length_needed ? 2 : 1; /* Queue the first TRB, even if it's zero-length */ do { u32 remainder = 0; @@ -3401,12 +3436,15 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, /* Chain all the TRBs together; clear the chain bit in the last * TRB to indicate it's the last TRB in the chain. */ - if (num_trbs > 1) { + if (num_trbs > last_trb_num) { field |= TRB_CHAIN; - } else { - /* FIXME - add check for ZERO_PACKET flag before this */ + } else if (num_trbs == last_trb_num) { td->last_trb = ep_ring->enqueue; field |= TRB_IOC; + } else if (zero_length_needed && num_trbs == 1) { + trb_buff_len = 0; + urb_priv->td[1]->last_trb = ep_ring->enqueue; + field |= TRB_IOC; } /* Only set interrupt on short packet for IN endpoints */ @@ -3444,7 +3482,7 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, trb_buff_len = urb->transfer_buffer_length - running_total; if (trb_buff_len > TRB_MAX_BUFF_SIZE) trb_buff_len = TRB_MAX_BUFF_SIZE; - } while (running_total < urb->transfer_buffer_length); + } while (num_trbs > 0); check_trb_math(urb, num_trbs, running_total); giveback_first_trb(xhci, slot_id, ep_index, urb->stream_id, diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 1a22d186bef7a7..a3431e90345fad 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -1300,6 +1300,11 @@ int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags) if (usb_endpoint_xfer_isoc(&urb->ep->desc)) size = urb->number_of_packets; + else if (usb_endpoint_is_bulk_out(&urb->ep->desc) && + urb->transfer_buffer_length > 0 && + urb->transfer_flags & URB_ZERO_PACKET && + !(urb->transfer_buffer_length % usb_endpoint_maxp(&urb->ep->desc))) + size = 2; else size = 1; From 162d3c2fd8b7ca5971fc1a366013463d7511afdd Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Wed, 30 Sep 2015 12:48:40 -0400 Subject: [PATCH 308/359] Initialize msg/shm IPC objects before doing ipc_addid() commit b9a532277938798b53178d5a66af6e2915cb27cf upstream. As reported by Dmitry Vyukov, we really shouldn't do ipc_addid() before having initialized the IPC object state. Yes, we initialize the IPC object in a locked state, but with all the lockless RCU lookup work, that IPC object lock no longer means that the state cannot be seen. We already did this for the IPC semaphore code (see commit e8577d1f0329: "ipc/sem.c: fully initialize sem_array before making it visible") but we clearly forgot about msg and shm. Reported-by: Dmitry Vyukov Cc: Manfred Spraul Cc: Davidlohr Bueso Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- ipc/msg.c | 14 +++++++------- ipc/shm.c | 12 ++++++------ ipc/util.c | 8 ++++---- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/ipc/msg.c b/ipc/msg.c index 52770bfde2a5af..32aaaab15c5c46 100644 --- a/ipc/msg.c +++ b/ipc/msg.c @@ -202,13 +202,6 @@ static int newque(struct ipc_namespace *ns, struct ipc_params *params) return retval; } - /* ipc_addid() locks msq upon success. */ - id = ipc_addid(&msg_ids(ns), &msq->q_perm, ns->msg_ctlmni); - if (id < 0) { - ipc_rcu_putref(msq, msg_rcu_free); - return id; - } - msq->q_stime = msq->q_rtime = 0; msq->q_ctime = get_seconds(); msq->q_cbytes = msq->q_qnum = 0; @@ -218,6 +211,13 @@ static int newque(struct ipc_namespace *ns, struct ipc_params *params) INIT_LIST_HEAD(&msq->q_receivers); INIT_LIST_HEAD(&msq->q_senders); + /* ipc_addid() locks msq upon success. */ + id = ipc_addid(&msg_ids(ns), &msq->q_perm, ns->msg_ctlmni); + if (id < 0) { + ipc_rcu_putref(msq, msg_rcu_free); + return id; + } + ipc_unlock_object(&msq->q_perm); rcu_read_unlock(); diff --git a/ipc/shm.c b/ipc/shm.c index 6dc55af8a29b4b..08b14f69d6cfdb 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -544,12 +544,6 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params) if (IS_ERR(file)) goto no_file; - id = ipc_addid(&shm_ids(ns), &shp->shm_perm, ns->shm_ctlmni); - if (id < 0) { - error = id; - goto no_id; - } - shp->shm_cprid = task_tgid_vnr(current); shp->shm_lprid = 0; shp->shm_atim = shp->shm_dtim = 0; @@ -559,6 +553,12 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params) shp->shm_file = file; shp->shm_creator = current; + id = ipc_addid(&shm_ids(ns), &shp->shm_perm, ns->shm_ctlmni); + if (id < 0) { + error = id; + goto no_id; + } + /* * shmid gets reported as "inode#" in /proc/pid/maps. * proc-ps tools use this. Changing this will break them. diff --git a/ipc/util.c b/ipc/util.c index 7684f41bce76a9..735342570a875f 100644 --- a/ipc/util.c +++ b/ipc/util.c @@ -292,6 +292,10 @@ int ipc_addid(struct ipc_ids* ids, struct kern_ipc_perm* new, int size) rcu_read_lock(); spin_lock(&new->lock); + current_euid_egid(&euid, &egid); + new->cuid = new->uid = euid; + new->gid = new->cgid = egid; + id = idr_alloc(&ids->ipcs_idr, new, (next_id < 0) ? 0 : ipcid_to_idx(next_id), 0, GFP_NOWAIT); @@ -304,10 +308,6 @@ int ipc_addid(struct ipc_ids* ids, struct kern_ipc_perm* new, int size) ids->in_use++; - current_euid_egid(&euid, &egid); - new->cuid = new->uid = euid; - new->gid = new->cgid = egid; - if (next_id < 0) { new->seq = ids->seq++; if (ids->seq > ids->seq_max) From 212c45ac20229c1752dd56fa38e9a8d57127974b Mon Sep 17 00:00:00 2001 From: Julian Anastasov Date: Sat, 27 Jun 2015 14:39:30 +0300 Subject: [PATCH 309/359] ipvs: do not use random local source address for tunnels commit 4754957f04f5f368792a0eb7dab0ae89fb93dcfd upstream. Michael Vallaly reports about wrong source address used in rare cases for tunneled traffic. Looks like __ip_vs_get_out_rt in 3.10+ is providing uninitialized dest_dst->dst_saddr.ip because ip_vs_dest_dst_alloc uses kmalloc. While we retry after seeing EINVAL from routing for data that does not look like valid local address, it still succeeded when this memory was previously used from other dests and with different local addresses. As result, we can use valid local address that is not suitable for our real server. Fix it by providing 0.0.0.0 every time our cache is refreshed. By this way we will get preferred source address from routing. Reported-by: Michael Vallaly Fixes: 026ace060dfe ("ipvs: optimize dst usage for real server") Signed-off-by: Julian Anastasov Signed-off-by: Simon Horman Signed-off-by: Greg Kroah-Hartman --- net/netfilter/ipvs/ip_vs_xmit.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c index 1692e75347593c..c3d204973dbc47 100644 --- a/net/netfilter/ipvs/ip_vs_xmit.c +++ b/net/netfilter/ipvs/ip_vs_xmit.c @@ -129,7 +129,6 @@ static struct rtable *do_output_route4(struct net *net, __be32 daddr, memset(&fl4, 0, sizeof(fl4)); fl4.daddr = daddr; - fl4.saddr = (rt_mode & IP_VS_RT_MODE_CONNECT) ? *saddr : 0; fl4.flowi4_flags = (rt_mode & IP_VS_RT_MODE_KNOWN_NH) ? FLOWI_FLAG_KNOWN_NH : 0; From 2fc9fc91a54a04877e441e261efcfe38aea882bf Mon Sep 17 00:00:00 2001 From: Julian Anastasov Date: Wed, 8 Jul 2015 08:31:33 +0300 Subject: [PATCH 310/359] ipvs: fix crash with sync protocol v0 and FTP commit 56184858d1fc95c46723436b455cb7261cd8be6f upstream. Fix crash in 3.5+ if FTP is used after switching sync_version to 0. Fixes: 749c42b620a9 ("ipvs: reduce sync rate with time thresholds") Signed-off-by: Julian Anastasov Signed-off-by: Simon Horman Signed-off-by: Greg Kroah-Hartman --- net/netfilter/ipvs/ip_vs_sync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c index e476cc7dc8019f..19f9aa4e698a5e 100644 --- a/net/netfilter/ipvs/ip_vs_sync.c +++ b/net/netfilter/ipvs/ip_vs_sync.c @@ -599,7 +599,7 @@ static void ip_vs_sync_conn_v0(struct net *net, struct ip_vs_conn *cp, pkts = atomic_add_return(1, &cp->in_pkts); else pkts = sysctl_sync_threshold(ipvs); - ip_vs_sync_conn(net, cp->control, pkts); + ip_vs_sync_conn(net, cp, pkts); } } From 4d2c033d846d0cf835ecb2ab6f3e3d0e002b915d Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Wed, 7 Jan 2015 13:49:08 +0100 Subject: [PATCH 311/359] udf: Check length of extended attributes and allocation descriptors commit 23b133bdc452aa441fcb9b82cbf6dd05cfd342d0 upstream. Check length of extended attributes and allocation descriptors when loading inodes from disk. Otherwise corrupted filesystems could confuse the code and make the kernel oops. Reported-by: Carl Henrik Lunde Cc: stable@vger.kernel.org Signed-off-by: Jan Kara Signed-off-by: Jiri Slaby [Jan and Jiri fixed it in 3.12 stable, i ported it to 3.10 stable, replaced bs by inode->i_sb->s_blocksize] Signed-off-by: Zhang Zhen Signed-off-by: Greg Kroah-Hartman --- fs/udf/inode.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/fs/udf/inode.c b/fs/udf/inode.c index aa023283cc8a29..789814f274388a 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c @@ -1495,6 +1495,16 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh) iinfo->i_checkpoint = le32_to_cpu(efe->checkpoint); } + /* + * Sanity check length of allocation descriptors and extended attrs to + * avoid integer overflows + */ + if (iinfo->i_lenEAttr > inode->i_sb->s_blocksize || iinfo->i_lenAlloc > inode->i_sb->s_blocksize) + return; + /* Now do exact checks */ + if (udf_file_entry_alloc_offset(inode) + iinfo->i_lenAlloc > inode->i_sb->s_blocksize) + return; + switch (fe->icbTag.fileType) { case ICBTAG_FILE_TYPE_DIRECTORY: inode->i_op = &udf_dir_inode_operations; From 789ef3db34ad5bbb3660dd7cf16810974021f9f1 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Sat, 19 Sep 2015 07:00:18 -0700 Subject: [PATCH 312/359] regmap: debugfs: Ensure we don't underflow when printing access masks commit b763ec17ac762470eec5be8ebcc43e4f8b2c2b82 upstream. If a read is attempted which is smaller than the line length then we may underflow the subtraction we're doing with the unsigned size_t type so move some of the calculation to be additions on the right hand side instead in order to avoid this. Reported-by: Rasmus Villemoes Signed-off-by: Mark Brown Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/base/regmap/regmap-debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c index b41994fd846034..d576dc90aa2ff6 100644 --- a/drivers/base/regmap/regmap-debugfs.c +++ b/drivers/base/regmap/regmap-debugfs.c @@ -419,7 +419,7 @@ static ssize_t regmap_access_read_file(struct file *file, /* If we're in the region the user is trying to read */ if (p >= *ppos) { /* ...but not beyond it */ - if (buf_pos >= count - 1 - tot_len) + if (buf_pos + tot_len + 1 >= count) break; /* Format the register */ From 0bdf7953e7c97de5100d5f4ecad7a5d0c760503c Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Sat, 19 Sep 2015 07:12:34 -0700 Subject: [PATCH 313/359] regmap: debugfs: Don't bother actually printing when calculating max length commit 176fc2d5770a0990eebff903ba680d2edd32e718 upstream. The in kernel snprintf() will conveniently return the actual length of the printed string even if not given an output beffer at all so just do that rather than relying on the user to pass in a suitable buffer, ensuring that we don't need to worry if the buffer was truncated due to the size of the buffer passed in. Reported-by: Rasmus Villemoes Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- drivers/base/regmap/regmap-debugfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c index d576dc90aa2ff6..2670bebb058b58 100644 --- a/drivers/base/regmap/regmap-debugfs.c +++ b/drivers/base/regmap/regmap-debugfs.c @@ -23,8 +23,7 @@ static struct dentry *regmap_debugfs_root; /* Calculate the length of a fixed format */ static size_t regmap_calc_reg_len(int max_val, char *buf, size_t buf_size) { - snprintf(buf, buf_size, "%x", max_val); - return strlen(buf); + return snprintf(NULL, 0, "%x", max_val); } static ssize_t regmap_name_read_file(struct file *file, From db3611bc16541c7684220ffe43ded0093e7f0567 Mon Sep 17 00:00:00 2001 From: Jann Horn Date: Fri, 18 Sep 2015 23:41:23 +0200 Subject: [PATCH 314/359] security: fix typo in security_task_prctl commit b7f76ea2ef6739ee484a165ffbac98deb855d3d3 upstream. Signed-off-by: Jann Horn Reviewed-by: Andy Lutomirski Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- include/linux/security.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/security.h b/include/linux/security.h index 4686491852a70b..4e50307c4c6dfa 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -2394,7 +2394,7 @@ static inline int security_task_prctl(int option, unsigned long arg2, unsigned long arg4, unsigned long arg5) { - return cap_task_prctl(option, arg2, arg3, arg3, arg5); + return cap_task_prctl(option, arg2, arg3, arg4, arg5); } static inline void security_task_to_inode(struct task_struct *p, struct inode *inode) From 560fac952b6eefd68535c09d971f2d4b9a4e28b6 Mon Sep 17 00:00:00 2001 From: Mathias Nyman Date: Mon, 21 Sep 2015 17:46:09 +0300 Subject: [PATCH 315/359] usb: Use the USB_SS_MULT() macro to get the burst multiplier. commit ff30cbc8da425754e8ab96904db1d295bd034f27 upstream. Bits 1:0 of the bmAttributes are used for the burst multiplier. The rest of the bits used to be reserved (zero), but USB3.1 takes bit 7 into use. Use the existing USB_SS_MULT() macro instead to make sure the mult value and hence max packet calculations are correct for USB3.1 devices. Note that burst multiplier in bmAttributes is zero based and that the USB_SS_MULT() macro adds one. Signed-off-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman --- drivers/usb/core/config.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c index 65243832519706..85756bd36746d0 100644 --- a/drivers/usb/core/config.c +++ b/drivers/usb/core/config.c @@ -114,7 +114,7 @@ static void usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno, cfgno, inum, asnum, ep->desc.bEndpointAddress); ep->ss_ep_comp.bmAttributes = 16; } else if (usb_endpoint_xfer_isoc(&ep->desc) && - desc->bmAttributes > 2) { + USB_SS_MULT(desc->bmAttributes) > 3) { dev_warn(ddev, "Isoc endpoint has Mult of %d in " "config %d interface %d altsetting %d ep %d: " "setting to 3\n", desc->bmAttributes + 1, @@ -123,7 +123,8 @@ static void usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno, } if (usb_endpoint_xfer_isoc(&ep->desc)) - max_tx = (desc->bMaxBurst + 1) * (desc->bmAttributes + 1) * + max_tx = (desc->bMaxBurst + 1) * + (USB_SS_MULT(desc->bmAttributes)) * usb_endpoint_maxp(&ep->desc); else if (usb_endpoint_xfer_int(&ep->desc)) max_tx = usb_endpoint_maxp(&ep->desc) * From fcb7ae4e6596f78e80ca3947f3290a062206e8fd Mon Sep 17 00:00:00 2001 From: Vincent Palatin Date: Thu, 1 Oct 2015 14:10:22 -0700 Subject: [PATCH 316/359] usb: Add device quirk for Logitech PTZ cameras commit 72194739f54607bbf8cfded159627a2015381557 upstream. Add a device quirk for the Logitech PTZ Pro Camera and its sibling the ConferenceCam CC3000e Camera. This fixes the failed camera enumeration on some boot, particularly on machines with fast CPU. Tested by connecting a Logitech PTZ Pro Camera to a machine with a Haswell Core i7-4600U CPU @ 2.10GHz, and doing thousands of reboot cycles while recording the kernel logs and taking camera picture after each boot. Before the patch, more than 7% of the boots show some enumeration transfer failures and in a few of them, the kernel is giving up before actually enumerating the webcam. After the patch, the enumeration has been correct on every reboot. Signed-off-by: Vincent Palatin Signed-off-by: Greg Kroah-Hartman --- drivers/usb/core/quirks.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c index b73f3031a66026..ff987e8d793547 100644 --- a/drivers/usb/core/quirks.c +++ b/drivers/usb/core/quirks.c @@ -53,6 +53,13 @@ static const struct usb_device_id usb_quirk_list[] = { { USB_DEVICE(0x046d, 0x082d), .driver_info = USB_QUIRK_DELAY_INIT }, { USB_DEVICE(0x046d, 0x0843), .driver_info = USB_QUIRK_DELAY_INIT }, + /* Logitech ConferenceCam CC3000e */ + { USB_DEVICE(0x046d, 0x0847), .driver_info = USB_QUIRK_DELAY_INIT }, + { USB_DEVICE(0x046d, 0x0848), .driver_info = USB_QUIRK_DELAY_INIT }, + + /* Logitech PTZ Pro Camera */ + { USB_DEVICE(0x046d, 0x0853), .driver_info = USB_QUIRK_DELAY_INIT }, + /* Logitech Quickcam Fusion */ { USB_DEVICE(0x046d, 0x08c1), .driver_info = USB_QUIRK_RESET_RESUME }, From b196b1125c7d54fc5df7e0a2a2525540cf66857d Mon Sep 17 00:00:00 2001 From: Yao-Wen Mao Date: Mon, 31 Aug 2015 14:24:09 +0800 Subject: [PATCH 317/359] USB: Add reset-resume quirk for two Plantronics usb headphones. commit 8484bf2981b3d006426ac052a3642c9ce1d8d980 upstream. These two headphones need a reset-resume quirk to properly resume to original volume level. Signed-off-by: Yao-Wen Mao Signed-off-by: Greg Kroah-Hartman --- drivers/usb/core/quirks.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c index ff987e8d793547..d4db4ea4a92d90 100644 --- a/drivers/usb/core/quirks.c +++ b/drivers/usb/core/quirks.c @@ -84,6 +84,12 @@ static const struct usb_device_id usb_quirk_list[] = { /* Philips PSC805 audio device */ { USB_DEVICE(0x0471, 0x0155), .driver_info = USB_QUIRK_RESET_RESUME }, + /* Plantronic Audio 655 DSP */ + { USB_DEVICE(0x047f, 0xc008), .driver_info = USB_QUIRK_RESET_RESUME }, + + /* Plantronic Audio 648 USB */ + { USB_DEVICE(0x047f, 0xc013), .driver_info = USB_QUIRK_RESET_RESUME }, + /* Artisman Watchdog Dongle */ { USB_DEVICE(0x04b4, 0x0526), .driver_info = USB_QUIRK_CONFIG_INTF_STRINGS }, From 1335a48ac221194597294b5012aaca14484da0ad Mon Sep 17 00:00:00 2001 From: James Hogan Date: Fri, 27 Mar 2015 08:33:43 +0000 Subject: [PATCH 318/359] MIPS: dma-default: Fix 32-bit fall back to GFP_DMA commit 53960059d56ecef67d4ddd546731623641a3d2d1 upstream. If there is a DMA zone (usually 24bit = 16MB I believe), but no DMA32 zone, as is the case for some 32-bit kernels, then massage_gfp_flags() will cause DMA memory allocated for devices with a 32..63-bit coherent_dma_mask to fall back to using __GFP_DMA, even though there may only be 32-bits of physical address available anyway. Correct that case to compare against a mask the size of phys_addr_t instead of always using a 64-bit mask. Signed-off-by: James Hogan Fixes: a2e715a86c6d ("MIPS: DMA: Fix computation of DMA flags from device's coherent_dma_mask.") Cc: Ralf Baechle Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/9610/ Signed-off-by: Ralf Baechle Signed-off-by: Greg Kroah-Hartman --- arch/mips/mm/dma-default.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c index 23129d1005dbdb..5fa55b80b7b694 100644 --- a/arch/mips/mm/dma-default.c +++ b/arch/mips/mm/dma-default.c @@ -91,7 +91,7 @@ static gfp_t massage_gfp_flags(const struct device *dev, gfp_t gfp) else #endif #if defined(CONFIG_ZONE_DMA) && !defined(CONFIG_ZONE_DMA32) - if (dev->coherent_dma_mask < DMA_BIT_MASK(64)) + if (dev->coherent_dma_mask < DMA_BIT_MASK(sizeof(phys_addr_t) * 8)) dma_flag = __GFP_DMA; else #endif From d7b00aadea64b68ef9025c6622a78a7b703b47e1 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Wed, 22 Jul 2015 10:20:07 +1000 Subject: [PATCH 319/359] md: flush ->event_work before stopping array. commit ee5d004fd0591536a061451eba2b187092e9127c upstream. The 'event_work' worker used by dm-raid may still be running when the array is stopped. This can result in an oops. So flush the workqueue on which it is run after detaching and before destroying the device. Reported-by: Heinz Mauelshagen Signed-off-by: NeilBrown Fixes: 9d09e663d550 ("dm: raid456 basic support") Signed-off-by: Greg Kroah-Hartman --- drivers/md/md.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/md/md.c b/drivers/md/md.c index 37ff00d014b427..7c45286e266269 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -5306,6 +5306,8 @@ EXPORT_SYMBOL_GPL(md_stop_writes); static void __md_stop(struct mddev *mddev) { mddev->ready = 0; + /* Ensure ->event_work is done */ + flush_workqueue(md_misc_wq); mddev->pers->stop(mddev); if (mddev->pers->sync_request && mddev->to_remove == NULL) mddev->to_remove = &md_redundancy_group; From 892e053cd7afcc54b2958130cab94ee2123be2d7 Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Thu, 10 Sep 2015 14:36:21 +1000 Subject: [PATCH 320/359] powerpc/MSI: Fix race condition in tearing down MSI interrupts commit e297c939b745e420ef0b9dc989cb87bda617b399 upstream. This fixes a race which can result in the same virtual IRQ number being assigned to two different MSI interrupts. The most visible consequence of that is usually a warning and stack trace from the sysfs code about an attempt to create a duplicate entry in sysfs. The race happens when one CPU (say CPU 0) is disposing of an MSI while another CPU (say CPU 1) is setting up an MSI. CPU 0 calls (for example) pnv_teardown_msi_irqs(), which calls msi_bitmap_free_hwirqs() to indicate that the MSI (i.e. its hardware IRQ number) is no longer in use. Then, before CPU 0 gets to calling irq_dispose_mapping() to free up the virtal IRQ number, CPU 1 comes in and calls msi_bitmap_alloc_hwirqs() to allocate an MSI, and gets the same hardware IRQ number that CPU 0 just freed. CPU 1 then calls irq_create_mapping() to get a virtual IRQ number, which sees that there is currently a mapping for that hardware IRQ number and returns the corresponding virtual IRQ number (which is the same virtual IRQ number that CPU 0 was using). CPU 0 then calls irq_dispose_mapping() and frees that virtual IRQ number. Now, if another CPU comes along and calls irq_create_mapping(), it is likely to get the virtual IRQ number that was just freed, resulting in the same virtual IRQ number apparently being used for two different hardware interrupts. To fix this race, we just move the call to msi_bitmap_free_hwirqs() to after the call to irq_dispose_mapping(). Since virq_to_hw() doesn't work for the virtual IRQ number after irq_dispose_mapping() has been called, we need to call it before irq_dispose_mapping() and remember the result for the msi_bitmap_free_hwirqs() call. The pattern of calling msi_bitmap_free_hwirqs() before irq_dispose_mapping() appears in 5 places under arch/powerpc, and appears to have originated in commit 05af7bd2d75e ("[POWERPC] MPIC U3/U4 MSI backend") from 2007. Fixes: 05af7bd2d75e ("[POWERPC] MPIC U3/U4 MSI backend") Reported-by: Alexey Kardashevskiy Signed-off-by: Paul Mackerras Signed-off-by: Michael Ellerman Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/platforms/powernv/pci.c | 5 +++-- arch/powerpc/sysdev/fsl_msi.c | 5 +++-- arch/powerpc/sysdev/mpic_pasemi_msi.c | 6 ++++-- arch/powerpc/sysdev/mpic_u3msi.c | 5 +++-- arch/powerpc/sysdev/ppc4xx_msi.c | 5 +++-- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c index 8ee842ce3abac2..0473d31b3a4ded 100644 --- a/arch/powerpc/platforms/powernv/pci.c +++ b/arch/powerpc/platforms/powernv/pci.c @@ -106,6 +106,7 @@ static void pnv_teardown_msi_irqs(struct pci_dev *pdev) struct pci_controller *hose = pci_bus_to_host(pdev->bus); struct pnv_phb *phb = hose->private_data; struct msi_desc *entry; + irq_hw_number_t hwirq; if (WARN_ON(!phb)) return; @@ -113,10 +114,10 @@ static void pnv_teardown_msi_irqs(struct pci_dev *pdev) list_for_each_entry(entry, &pdev->msi_list, list) { if (entry->irq == NO_IRQ) continue; + hwirq = virq_to_hw(entry->irq); irq_set_msi_desc(entry->irq, NULL); - msi_bitmap_free_hwirqs(&phb->msi_bmp, - virq_to_hw(entry->irq) - phb->msi_base, 1); irq_dispose_mapping(entry->irq); + msi_bitmap_free_hwirqs(&phb->msi_bmp, hwirq - phb->msi_base, 1); } } #endif /* CONFIG_PCI_MSI */ diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c index ab02db3d02d8f8..6616fa61994535 100644 --- a/arch/powerpc/sysdev/fsl_msi.c +++ b/arch/powerpc/sysdev/fsl_msi.c @@ -108,15 +108,16 @@ static void fsl_teardown_msi_irqs(struct pci_dev *pdev) { struct msi_desc *entry; struct fsl_msi *msi_data; + irq_hw_number_t hwirq; list_for_each_entry(entry, &pdev->msi_list, list) { if (entry->irq == NO_IRQ) continue; + hwirq = virq_to_hw(entry->irq); msi_data = irq_get_chip_data(entry->irq); irq_set_msi_desc(entry->irq, NULL); - msi_bitmap_free_hwirqs(&msi_data->bitmap, - virq_to_hw(entry->irq), 1); irq_dispose_mapping(entry->irq); + msi_bitmap_free_hwirqs(&msi_data->bitmap, hwirq, 1); } return; diff --git a/arch/powerpc/sysdev/mpic_pasemi_msi.c b/arch/powerpc/sysdev/mpic_pasemi_msi.c index 38e62382070c93..9e14d82287a166 100644 --- a/arch/powerpc/sysdev/mpic_pasemi_msi.c +++ b/arch/powerpc/sysdev/mpic_pasemi_msi.c @@ -74,6 +74,7 @@ static int pasemi_msi_check_device(struct pci_dev *pdev, int nvec, int type) static void pasemi_msi_teardown_msi_irqs(struct pci_dev *pdev) { struct msi_desc *entry; + irq_hw_number_t hwirq; pr_debug("pasemi_msi_teardown_msi_irqs, pdev %p\n", pdev); @@ -81,10 +82,11 @@ static void pasemi_msi_teardown_msi_irqs(struct pci_dev *pdev) if (entry->irq == NO_IRQ) continue; + hwirq = virq_to_hw(entry->irq); irq_set_msi_desc(entry->irq, NULL); - msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, - virq_to_hw(entry->irq), ALLOC_CHUNK); irq_dispose_mapping(entry->irq); + msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, + hwirq, ALLOC_CHUNK); } return; diff --git a/arch/powerpc/sysdev/mpic_u3msi.c b/arch/powerpc/sysdev/mpic_u3msi.c index 9a7aa0ed9c1c2b..dfc3486bf8027a 100644 --- a/arch/powerpc/sysdev/mpic_u3msi.c +++ b/arch/powerpc/sysdev/mpic_u3msi.c @@ -124,15 +124,16 @@ static int u3msi_msi_check_device(struct pci_dev *pdev, int nvec, int type) static void u3msi_teardown_msi_irqs(struct pci_dev *pdev) { struct msi_desc *entry; + irq_hw_number_t hwirq; list_for_each_entry(entry, &pdev->msi_list, list) { if (entry->irq == NO_IRQ) continue; + hwirq = virq_to_hw(entry->irq); irq_set_msi_desc(entry->irq, NULL); - msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, - virq_to_hw(entry->irq), 1); irq_dispose_mapping(entry->irq); + msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, hwirq, 1); } return; diff --git a/arch/powerpc/sysdev/ppc4xx_msi.c b/arch/powerpc/sysdev/ppc4xx_msi.c index 43948da837a799..c3e65129940b70 100644 --- a/arch/powerpc/sysdev/ppc4xx_msi.c +++ b/arch/powerpc/sysdev/ppc4xx_msi.c @@ -121,16 +121,17 @@ void ppc4xx_teardown_msi_irqs(struct pci_dev *dev) { struct msi_desc *entry; struct ppc4xx_msi *msi_data = &ppc4xx_msi; + irq_hw_number_t hwirq; dev_dbg(&dev->dev, "PCIE-MSI: tearing down msi irqs\n"); list_for_each_entry(entry, &dev->msi_list, list) { if (entry->irq == NO_IRQ) continue; + hwirq = virq_to_hw(entry->irq); irq_set_msi_desc(entry->irq, NULL); - msi_bitmap_free_hwirqs(&msi_data->bitmap, - virq_to_hw(entry->irq), 1); irq_dispose_mapping(entry->irq); + msi_bitmap_free_hwirqs(&msi_data->bitmap, hwirq, 1); } } From a5bae33a3530cdfa59e86899e06e4213372b2bce Mon Sep 17 00:00:00 2001 From: Richard Weinberger Date: Tue, 22 Sep 2015 23:58:07 +0200 Subject: [PATCH 321/359] UBI: Validate data_size commit 281fda27673f833a01d516658a64d22a32c8e072 upstream. Make sure that data_size is less than LEB size. Otherwise a handcrafted UBI image is able to trigger an out of bounds memory access in ubi_compare_lebs(). Signed-off-by: Richard Weinberger Reviewed-by: David Gstir Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/ubi/io.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c index bf79def4012686..8822e880833bae 100644 --- a/drivers/mtd/ubi/io.c +++ b/drivers/mtd/ubi/io.c @@ -931,6 +931,11 @@ static int validate_vid_hdr(const struct ubi_device *ubi, goto bad; } + if (data_size > ubi->leb_size) { + ubi_err("bad data_size"); + goto bad; + } + if (vol_type == UBI_VID_STATIC) { /* * Although from high-level point of view static volumes may From 480ed182e39ca90b19282dbc3e3c77a3517c41fc Mon Sep 17 00:00:00 2001 From: shengyong Date: Mon, 28 Sep 2015 17:57:19 +0000 Subject: [PATCH 322/359] UBI: return ENOSPC if no enough space available commit 7c7feb2ebfc9c0552c51f0c050db1d1a004faac5 upstream. UBI: attaching mtd1 to ubi0 UBI: scanning is finished UBI error: init_volumes: not enough PEBs, required 706, available 686 UBI error: ubi_wl_init: no enough physical eraseblocks (-20, need 1) UBI error: ubi_attach_mtd_dev: failed to attach mtd1, error -12 <= NOT ENOMEM UBI error: ubi_init: cannot attach mtd1 If available PEBs are not enough when initializing volumes, return -ENOSPC directly. If available PEBs are not enough when initializing WL, return -ENOSPC instead of -ENOMEM. Signed-off-by: Sheng Yong Signed-off-by: Richard Weinberger Reviewed-by: David Gstir Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/ubi/vtbl.c | 1 + drivers/mtd/ubi/wl.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/mtd/ubi/vtbl.c b/drivers/mtd/ubi/vtbl.c index d77b1c1d7c7267..bebf49e0dbe90c 100644 --- a/drivers/mtd/ubi/vtbl.c +++ b/drivers/mtd/ubi/vtbl.c @@ -651,6 +651,7 @@ static int init_volumes(struct ubi_device *ubi, if (ubi->corr_peb_count) ubi_err("%d PEBs are corrupted and not used", ubi->corr_peb_count); + return -ENOSPC; } ubi->rsvd_pebs += reserved_pebs; ubi->avail_pebs -= reserved_pebs; diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c index c08254016fe8b3..3375bfb1b24679 100644 --- a/drivers/mtd/ubi/wl.c +++ b/drivers/mtd/ubi/wl.c @@ -1978,6 +1978,7 @@ int ubi_wl_init(struct ubi_device *ubi, struct ubi_attach_info *ai) if (ubi->corr_peb_count) ubi_err("%d PEBs are corrupted and not used", ubi->corr_peb_count); + err = -ENOSPC; goto out_free; } ubi->avail_pebs -= reserved_pebs; From ef5844a015293453e4031ad336e459729cfe3cd9 Mon Sep 17 00:00:00 2001 From: Mike Marciniszyn Date: Tue, 21 Jul 2015 08:36:07 -0400 Subject: [PATCH 323/359] IB/qib: Change lkey table allocation to support more MRs commit d6f1c17e162b2a11e708f28fa93f2f79c164b442 upstream. The lkey table is allocated with with a get_user_pages() with an order based on a number of index bits from a module parameter. The underlying kernel code cannot allocate that many contiguous pages. There is no reason the underlying memory needs to be physically contiguous. This patch: - switches the allocation/deallocation to vmalloc/vfree - caps the number of bits to 23 to insure at least 1 generation bit o this matches the module parameter description Reviewed-by: Vinit Agnihotri Signed-off-by: Mike Marciniszyn Signed-off-by: Doug Ledford Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/hw/qib/qib.h | 27 +++++++++++---------------- drivers/infiniband/hw/qib/qib_keys.c | 4 ++++ drivers/infiniband/hw/qib/qib_verbs.c | 14 ++++++++++---- drivers/infiniband/hw/qib/qib_verbs.h | 2 ++ 4 files changed, 27 insertions(+), 20 deletions(-) diff --git a/drivers/infiniband/hw/qib/qib.h b/drivers/infiniband/hw/qib/qib.h index d1b30c66d60474..727a9dc44b94ce 100644 --- a/drivers/infiniband/hw/qib/qib.h +++ b/drivers/infiniband/hw/qib/qib.h @@ -1467,27 +1467,22 @@ extern struct mutex qib_mutex; * first to avoid possible serial port delays from printk. */ #define qib_early_err(dev, fmt, ...) \ - do { \ - dev_err(dev, fmt, ##__VA_ARGS__); \ - } while (0) + dev_err(dev, fmt, ##__VA_ARGS__) #define qib_dev_err(dd, fmt, ...) \ - do { \ - dev_err(&(dd)->pcidev->dev, "%s: " fmt, \ - qib_get_unit_name((dd)->unit), ##__VA_ARGS__); \ - } while (0) + dev_err(&(dd)->pcidev->dev, "%s: " fmt, \ + qib_get_unit_name((dd)->unit), ##__VA_ARGS__) -#define qib_dev_porterr(dd, port, fmt, ...) \ - do { \ - dev_err(&(dd)->pcidev->dev, "%s: IB%u:%u " fmt, \ - qib_get_unit_name((dd)->unit), (dd)->unit, (port), \ - ##__VA_ARGS__); \ - } while (0) +#define qib_dev_warn(dd, fmt, ...) \ + dev_warn(&(dd)->pcidev->dev, "%s: " fmt, \ + qib_get_unit_name((dd)->unit), ##__VA_ARGS__) +#define qib_dev_porterr(dd, port, fmt, ...) \ + dev_err(&(dd)->pcidev->dev, "%s: IB%u:%u " fmt, \ + qib_get_unit_name((dd)->unit), (dd)->unit, (port), \ + ##__VA_ARGS__) #define qib_devinfo(pcidev, fmt, ...) \ - do { \ - dev_info(&(pcidev)->dev, fmt, ##__VA_ARGS__); \ - } while (0) + dev_info(&(pcidev)->dev, fmt, ##__VA_ARGS__) /* * this is used for formatting hw error messages... diff --git a/drivers/infiniband/hw/qib/qib_keys.c b/drivers/infiniband/hw/qib/qib_keys.c index 3b9afccaaade82..eabe54738be613 100644 --- a/drivers/infiniband/hw/qib/qib_keys.c +++ b/drivers/infiniband/hw/qib/qib_keys.c @@ -86,6 +86,10 @@ int qib_alloc_lkey(struct qib_mregion *mr, int dma_region) * unrestricted LKEY. */ rkt->gen++; + /* + * bits are capped in qib_verbs.c to insure enough bits + * for generation number + */ mr->lkey = (r << (32 - ib_qib_lkey_table_size)) | ((((1 << (24 - ib_qib_lkey_table_size)) - 1) & rkt->gen) << 8); diff --git a/drivers/infiniband/hw/qib/qib_verbs.c b/drivers/infiniband/hw/qib/qib_verbs.c index 904c384aa36142..6c809bf5012867 100644 --- a/drivers/infiniband/hw/qib/qib_verbs.c +++ b/drivers/infiniband/hw/qib/qib_verbs.c @@ -40,6 +40,7 @@ #include #include #include +#include #include "qib.h" #include "qib_common.h" @@ -2084,10 +2085,16 @@ int qib_register_ib_device(struct qib_devdata *dd) * the LKEY). The remaining bits act as a generation number or tag. */ spin_lock_init(&dev->lk_table.lock); + /* insure generation is at least 4 bits see keys.c */ + if (ib_qib_lkey_table_size > MAX_LKEY_TABLE_BITS) { + qib_dev_warn(dd, "lkey bits %u too large, reduced to %u\n", + ib_qib_lkey_table_size, MAX_LKEY_TABLE_BITS); + ib_qib_lkey_table_size = MAX_LKEY_TABLE_BITS; + } dev->lk_table.max = 1 << ib_qib_lkey_table_size; lk_tab_size = dev->lk_table.max * sizeof(*dev->lk_table.table); dev->lk_table.table = (struct qib_mregion __rcu **) - __get_free_pages(GFP_KERNEL, get_order(lk_tab_size)); + vmalloc(lk_tab_size); if (dev->lk_table.table == NULL) { ret = -ENOMEM; goto err_lk; @@ -2260,7 +2267,7 @@ int qib_register_ib_device(struct qib_devdata *dd) sizeof(struct qib_pio_header), dev->pio_hdrs, dev->pio_hdrs_phys); err_hdrs: - free_pages((unsigned long) dev->lk_table.table, get_order(lk_tab_size)); + vfree(dev->lk_table.table); err_lk: kfree(dev->qp_table); err_qpt: @@ -2314,8 +2321,7 @@ void qib_unregister_ib_device(struct qib_devdata *dd) sizeof(struct qib_pio_header), dev->pio_hdrs, dev->pio_hdrs_phys); lk_tab_size = dev->lk_table.max * sizeof(*dev->lk_table.table); - free_pages((unsigned long) dev->lk_table.table, - get_order(lk_tab_size)); + vfree(dev->lk_table.table); kfree(dev->qp_table); } diff --git a/drivers/infiniband/hw/qib/qib_verbs.h b/drivers/infiniband/hw/qib/qib_verbs.h index aff8b2c178869c..e4f9fff51890b8 100644 --- a/drivers/infiniband/hw/qib/qib_verbs.h +++ b/drivers/infiniband/hw/qib/qib_verbs.h @@ -645,6 +645,8 @@ struct qib_qpn_table { struct qpn_map map[QPNMAP_ENTRIES]; }; +#define MAX_LKEY_TABLE_BITS 23 + struct qib_lkey_table { spinlock_t lock; /* protect changes in this struct */ u32 next; /* next unused index (speeds search) */ From 91397d567646df4ede8619beb678252e82fafb2a Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Sat, 15 Aug 2015 13:36:12 -0500 Subject: [PATCH 324/359] dcache: Handle escaped paths in prepend_path commit cde93be45a8a90d8c264c776fab63487b5038a65 upstream. A rename can result in a dentry that by walking up d_parent will never reach it's mnt_root. For lack of a better term I call this an escaped path. prepend_path is called by four different functions __d_path, d_absolute_path, d_path, and getcwd. __d_path only wants to see paths are connected to the root it passes in. So __d_path needs prepend_path to return an error. d_absolute_path similarly wants to see paths that are connected to some root. Escaped paths are not connected to any mnt_root so d_absolute_path needs prepend_path to return an error greater than 1. So escaped paths will be treated like paths on lazily unmounted mounts. getcwd needs to prepend "(unreachable)" so getcwd also needs prepend_path to return an error. d_path is the interesting hold out. d_path just wants to print something, and does not care about the weird cases. Which raises the question what should be printed? Given that / should result in -ENOENT I believe it is desirable for escaped paths to be printed as empty paths. As there are not really any meaninful path components when considered from the perspective of a mount tree. So tweak prepend_path to return an empty path with an new error code of 3 when it encounters an escaped path. Signed-off-by: "Eric W. Biederman" Signed-off-by: Al Viro Signed-off-by: Greg Kroah-Hartman --- fs/dcache.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/fs/dcache.c b/fs/dcache.c index f1e80178597611..17222fa5bdc6ce 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -2534,6 +2534,8 @@ static int prepend_path(const struct path *path, struct dentry *dentry = path->dentry; struct vfsmount *vfsmnt = path->mnt; struct mount *mnt = real_mount(vfsmnt); + char *orig_buffer = *buffer; + int orig_len = *buflen; bool slash = false; int error = 0; @@ -2541,6 +2543,14 @@ static int prepend_path(const struct path *path, struct dentry * parent; if (dentry == vfsmnt->mnt_root || IS_ROOT(dentry)) { + /* Escaped? */ + if (dentry != vfsmnt->mnt_root) { + *buffer = orig_buffer; + *buflen = orig_len; + slash = false; + error = 3; + goto global_root; + } /* Global root? */ if (!mnt_has_parent(mnt)) goto global_root; From fa6ef735862a25daff2a3ee3aba1e32f278f21c5 Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Sat, 15 Aug 2015 20:27:13 -0500 Subject: [PATCH 325/359] vfs: Test for and handle paths that are unreachable from their mnt_root commit 397d425dc26da728396e66d392d5dcb8dac30c37 upstream. In rare cases a directory can be renamed out from under a bind mount. In those cases without special handling it becomes possible to walk up the directory tree to the root dentry of the filesystem and down from the root dentry to every other file or directory on the filesystem. Like division by zero .. from an unconnected path can not be given a useful semantic as there is no predicting at which path component the code will realize it is unconnected. We certainly can not match the current behavior as the current behavior is a security hole. Therefore when encounting .. when following an unconnected path return -ENOENT. - Add a function path_connected to verify path->dentry is reachable from path->mnt.mnt_root. AKA to validate that rename did not do something nasty to the bind mount. To avoid races path_connected must be called after following a path component to it's next path component. Signed-off-by: "Eric W. Biederman" Signed-off-by: Al Viro Signed-off-by: Greg Kroah-Hartman --- fs/namei.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/fs/namei.c b/fs/namei.c index 036c21246d6aba..157c3dbacf6c55 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -473,6 +473,24 @@ void path_put(const struct path *path) } EXPORT_SYMBOL(path_put); +/** + * path_connected - Verify that a path->dentry is below path->mnt.mnt_root + * @path: nameidate to verify + * + * Rename can sometimes move a file or directory outside of a bind + * mount, path_connected allows those cases to be detected. + */ +static bool path_connected(const struct path *path) +{ + struct vfsmount *mnt = path->mnt; + + /* Only bind mounts can have disconnected paths */ + if (mnt->mnt_root == mnt->mnt_sb->s_root) + return true; + + return is_subdir(path->dentry, mnt->mnt_root); +} + /* * Path walking has 2 modes, rcu-walk and ref-walk (see * Documentation/filesystems/path-lookup.txt). In situations when we can't @@ -1148,6 +1166,8 @@ static int follow_dotdot_rcu(struct nameidata *nd) goto failed; nd->path.dentry = parent; nd->seq = seq; + if (unlikely(!path_connected(&nd->path))) + goto failed; break; } if (!follow_up_rcu(&nd->path)) @@ -1231,7 +1251,7 @@ static void follow_mount(struct path *path) } } -static void follow_dotdot(struct nameidata *nd) +static int follow_dotdot(struct nameidata *nd) { set_root(nd); @@ -1246,6 +1266,10 @@ static void follow_dotdot(struct nameidata *nd) /* rare case of legitimate dget_parent()... */ nd->path.dentry = dget_parent(nd->path.dentry); dput(old); + if (unlikely(!path_connected(&nd->path))) { + path_put(&nd->path); + return -ENOENT; + } break; } if (!follow_up(&nd->path)) @@ -1253,6 +1277,7 @@ static void follow_dotdot(struct nameidata *nd) } follow_mount(&nd->path); nd->inode = nd->path.dentry->d_inode; + return 0; } /* @@ -1476,7 +1501,7 @@ static inline int handle_dots(struct nameidata *nd, int type) if (follow_dotdot_rcu(nd)) return -ECHILD; } else - follow_dotdot(nd); + return follow_dotdot(nd); } return 0; } From 339cb27fc56dd226e6ec59b15010527b12b0411a Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Mon, 21 Sep 2015 21:39:50 +0100 Subject: [PATCH 326/359] arm64: readahead: fault retry breaks mmap file read random detection commit 569ba74a7ba69f46ce2950bf085b37fea2408385 upstream. This is the arm64 portion of commit 45cac65b0fcd ("readahead: fault retry breaks mmap file read random detection"), which was absent from the initial port and has since gone unnoticed. The original commit says: > .fault now can retry. The retry can break state machine of .fault. In > filemap_fault, if page is miss, ra->mmap_miss is increased. In the second > try, since the page is in page cache now, ra->mmap_miss is decreased. And > these are done in one fault, so we can't detect random mmap file access. > > Add a new flag to indicate .fault is tried once. In the second try, skip > ra->mmap_miss decreasing. The filemap_fault state machine is ok with it. With this change, Mark reports that: > Random read improves by 250%, sequential read improves by 40%, and > random write by 400% to an eMMC device with dm crypto wrapped around it. Cc: Shaohua Li Cc: Rik van Riel Cc: Wu Fengguang Signed-off-by: Mark Salyzyn Signed-off-by: Riley Andrews Signed-off-by: Will Deacon Signed-off-by: Greg Kroah-Hartman --- arch/arm64/mm/fault.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index b5d458769b655d..250319040de248 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c @@ -278,6 +278,7 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr, * starvation. */ mm_flags &= ~FAULT_FLAG_ALLOW_RETRY; + mm_flags |= FAULT_FLAG_TRIED; goto retry; } } From 46409b7e4b56dd58779fb148d870353588a925ae Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Wed, 23 Sep 2015 23:12:09 +0200 Subject: [PATCH 327/359] m68k: Define asmlinkage_protect commit 8474ba74193d302e8340dddd1e16c85cc4b98caf upstream. Make sure the compiler does not modify arguments of syscall functions. This can happen if the compiler generates a tailcall to another function. For example, without asmlinkage_protect sys_openat is compiled into this function: sys_openat: clr.l %d0 move.w 18(%sp),%d0 move.l %d0,16(%sp) jbra do_sys_open Note how the fourth argument is modified in place, modifying the register %d4 that gets restored from this stack slot when the function returns to user-space. The caller may expect the register to be unmodified across system calls. Signed-off-by: Andreas Schwab Signed-off-by: Geert Uytterhoeven Signed-off-by: Greg Kroah-Hartman --- arch/m68k/include/asm/linkage.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/arch/m68k/include/asm/linkage.h b/arch/m68k/include/asm/linkage.h index 5a822bb790f721..066e74f666ae95 100644 --- a/arch/m68k/include/asm/linkage.h +++ b/arch/m68k/include/asm/linkage.h @@ -4,4 +4,34 @@ #define __ALIGN .align 4 #define __ALIGN_STR ".align 4" +/* + * Make sure the compiler doesn't do anything stupid with the + * arguments on the stack - they are owned by the *caller*, not + * the callee. This just fools gcc into not spilling into them, + * and keeps it from doing tailcall recursion and/or using the + * stack slots for temporaries, since they are live and "used" + * all the way to the end of the function. + */ +#define asmlinkage_protect(n, ret, args...) \ + __asmlinkage_protect##n(ret, ##args) +#define __asmlinkage_protect_n(ret, args...) \ + __asm__ __volatile__ ("" : "=r" (ret) : "0" (ret), ##args) +#define __asmlinkage_protect0(ret) \ + __asmlinkage_protect_n(ret) +#define __asmlinkage_protect1(ret, arg1) \ + __asmlinkage_protect_n(ret, "m" (arg1)) +#define __asmlinkage_protect2(ret, arg1, arg2) \ + __asmlinkage_protect_n(ret, "m" (arg1), "m" (arg2)) +#define __asmlinkage_protect3(ret, arg1, arg2, arg3) \ + __asmlinkage_protect_n(ret, "m" (arg1), "m" (arg2), "m" (arg3)) +#define __asmlinkage_protect4(ret, arg1, arg2, arg3, arg4) \ + __asmlinkage_protect_n(ret, "m" (arg1), "m" (arg2), "m" (arg3), \ + "m" (arg4)) +#define __asmlinkage_protect5(ret, arg1, arg2, arg3, arg4, arg5) \ + __asmlinkage_protect_n(ret, "m" (arg1), "m" (arg2), "m" (arg3), \ + "m" (arg4), "m" (arg5)) +#define __asmlinkage_protect6(ret, arg1, arg2, arg3, arg4, arg5, arg6) \ + __asmlinkage_protect_n(ret, "m" (arg1), "m" (arg2), "m" (arg3), \ + "m" (arg4), "m" (arg5), "m" (arg6)) + #endif From 495d9de1ad472cd215ac72bcfa8ac6252af02e16 Mon Sep 17 00:00:00 2001 From: dingtianhong Date: Thu, 16 Jul 2015 16:30:02 +0800 Subject: [PATCH 328/359] bonding: correct the MAC address for "follow" fail_over_mac policy [ Upstream commit a951bc1e6ba58f11df5ed5ddc41311e10f5fd20b ] The "follow" fail_over_mac policy is useful for multiport devices that either become confused or incur a performance penalty when multiple ports are programmed with the same MAC address, but the same MAC address still may happened by this steps for this policy: 1) echo +eth0 > /sys/class/net/bond0/bonding/slaves bond0 has the same mac address with eth0, it is MAC1. 2) echo +eth1 > /sys/class/net/bond0/bonding/slaves eth1 is backup, eth1 has MAC2. 3) ifconfig eth0 down eth1 became active slave, bond will swap MAC for eth0 and eth1, so eth1 has MAC1, and eth0 has MAC2. 4) ifconfig eth1 down there is no active slave, and eth1 still has MAC1, eth2 has MAC2. 5) ifconfig eth0 up the eth0 became active slave again, the bond set eth0 to MAC1. Something wrong here, then if you set eth1 up, the eth0 and eth1 will have the same MAC address, it will break this policy for ACTIVE_BACKUP mode. This patch will fix this problem by finding the old active slave and swap them MAC address before change active slave. Signed-off-by: Ding Tianhong Tested-by: Nikolay Aleksandrov Signed-off-by: David S. Miller [bwh: Backported to 3.10: bond_for_each_slave() takes an extra int paramter] Signed-off-by: Ben Hutchings Signed-off-by: Greg Kroah-Hartman --- drivers/net/bonding/bond_main.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 6b5baf01512db0..c0ed7c80281931 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -876,6 +876,23 @@ static void bond_mc_swap(struct bonding *bond, struct slave *new_active, } } +static struct slave *bond_get_old_active(struct bonding *bond, + struct slave *new_active) +{ + struct slave *slave; + int i; + + bond_for_each_slave(bond, slave, i) { + if (slave == new_active) + continue; + + if (ether_addr_equal(bond->dev->dev_addr, slave->dev->dev_addr)) + return slave; + } + + return NULL; +} + /* * bond_do_fail_over_mac * @@ -919,6 +936,9 @@ static void bond_do_fail_over_mac(struct bonding *bond, write_unlock_bh(&bond->curr_slave_lock); read_unlock(&bond->lock); + if (!old_active) + old_active = bond_get_old_active(bond, new_active); + if (old_active) { memcpy(tmp_mac, new_active->dev->dev_addr, ETH_ALEN); memcpy(saddr.sa_data, old_active->dev->dev_addr, From e9346b9a2f5cd4ff470ee58d1bf271d0a2ca27a0 Mon Sep 17 00:00:00 2001 From: Roland Dreier Date: Mon, 5 Oct 2015 10:29:28 -0700 Subject: [PATCH 329/359] fib_rules: Fix dump_rules() not to exit early Backports of 41fc014332d9 ("fib_rules: fix fib rule dumps across multiple skbs") introduced a regression in "ip rule show" - it ends up dumping the first rule over and over and never exiting, because 3.19 and earlier are missing commit 053c095a82cf ("netlink: make nlmsg_end() and genlmsg_end() void"), so fib_nl_fill_rule() ends up returning skb->len (i.e. > 0) in the success case. Fix this by checking the return code for < 0 instead of != 0. Signed-off-by: Roland Dreier Signed-off-by: Greg Kroah-Hartman --- net/core/fib_rules.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c index 627e517077e465..84340a2605edd7 100644 --- a/net/core/fib_rules.c +++ b/net/core/fib_rules.c @@ -606,7 +606,7 @@ static int dump_rules(struct sk_buff *skb, struct netlink_callback *cb, err = fib_nl_fill_rule(skb, rule, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq, RTM_NEWRULE, NLM_F_MULTI, ops); - if (err) + if (err < 0) break; skip: idx++; From 8938c10543801cbb9d85efd3f317184e405b45bc Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sat, 26 Sep 2015 12:23:56 +0100 Subject: [PATCH 330/359] genirq: Fix race in register_irq_proc() commit 95c2b17534654829db428f11bcf4297c059a2a7e upstream. Per-IRQ directories in procfs are created only when a handler is first added to the irqdesc, not when the irqdesc is created. In the case of a shared IRQ, multiple tasks can race to create a directory. This race condition seems to have been present forever, but is easier to hit with async probing. Signed-off-by: Ben Hutchings Link: http://lkml.kernel.org/r/1443266636.2004.2.camel@decadent.org.uk Signed-off-by: Thomas Gleixner Signed-off-by: Greg Kroah-Hartman --- kernel/irq/proc.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c index 19ed5c425c3b95..349e5bbdb31ff3 100644 --- a/kernel/irq/proc.c +++ b/kernel/irq/proc.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "internals.h" @@ -309,18 +310,29 @@ void register_handler_proc(unsigned int irq, struct irqaction *action) void register_irq_proc(unsigned int irq, struct irq_desc *desc) { + static DEFINE_MUTEX(register_lock); char name [MAX_NAMELEN]; - if (!root_irq_dir || (desc->irq_data.chip == &no_irq_chip) || desc->dir) + if (!root_irq_dir || (desc->irq_data.chip == &no_irq_chip)) return; + /* + * irq directories are registered only when a handler is + * added, not when the descriptor is created, so multiple + * tasks might try to register at the same time. + */ + mutex_lock(®ister_lock); + + if (desc->dir) + goto out_unlock; + memset(name, 0, MAX_NAMELEN); sprintf(name, "%d", irq); /* create /proc/irq/1234 */ desc->dir = proc_mkdir(name, root_irq_dir); if (!desc->dir) - return; + goto out_unlock; #ifdef CONFIG_SMP /* create /proc/irq//smp_affinity */ @@ -341,6 +353,9 @@ void register_irq_proc(unsigned int irq, struct irq_desc *desc) proc_create_data("spurious", 0444, desc->dir, &irq_spurious_proc_fops, (void *)(long)irq); + +out_unlock: + mutex_unlock(®ister_lock); } void unregister_irq_proc(unsigned int irq, struct irq_desc *desc) From f7c7bb9f06eb2af9c03b29e019d45ad4e943f900 Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Fri, 16 Aug 2013 14:17:19 -0700 Subject: [PATCH 331/359] x86: Add 1/2/4/8 byte optimization to 64bit __copy_{from,to}_user_inatomic commit ff47ab4ff3cddfa7bc1b25b990e24abe2ae474ff upstream. The 64bit __copy_{from,to}_user_inatomic always called copy_from_user_generic, but skipped the special optimizations for 1/2/4/8 byte accesses. This especially hurts the futex call, which accesses the 4 byte futex user value with a complicated fast string operation in a function call, instead of a single movl. Use __copy_{from,to}_user for _inatomic instead to get the same optimizations. The only problem was the might_fault() in those functions. So move that to new wrapper and call __copy_{f,t}_user_nocheck() from *_inatomic directly. 32bit already did this correctly by duplicating the code. Signed-off-by: Andi Kleen Link: http://lkml.kernel.org/r/1376687844-19857-2-git-send-email-andi@firstfloor.org Signed-off-by: H. Peter Anvin Cc: Thomas Gleixner Signed-off-by: Greg Kroah-Hartman --- arch/x86/include/asm/uaccess_64.h | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/arch/x86/include/asm/uaccess_64.h b/arch/x86/include/asm/uaccess_64.h index 142810c457dc5f..34df5c22df90a5 100644 --- a/arch/x86/include/asm/uaccess_64.h +++ b/arch/x86/include/asm/uaccess_64.h @@ -77,11 +77,10 @@ int copy_to_user(void __user *dst, const void *src, unsigned size) } static __always_inline __must_check -int __copy_from_user(void *dst, const void __user *src, unsigned size) +int __copy_from_user_nocheck(void *dst, const void __user *src, unsigned size) { int ret = 0; - might_fault(); if (!__builtin_constant_p(size)) return copy_user_generic(dst, (__force void *)src, size); switch (size) { @@ -121,11 +120,17 @@ int __copy_from_user(void *dst, const void __user *src, unsigned size) } static __always_inline __must_check -int __copy_to_user(void __user *dst, const void *src, unsigned size) +int __copy_from_user(void *dst, const void __user *src, unsigned size) +{ + might_fault(); + return __copy_from_user_nocheck(dst, src, size); +} + +static __always_inline __must_check +int __copy_to_user_nocheck(void __user *dst, const void *src, unsigned size) { int ret = 0; - might_fault(); if (!__builtin_constant_p(size)) return copy_user_generic((__force void *)dst, src, size); switch (size) { @@ -164,6 +169,13 @@ int __copy_to_user(void __user *dst, const void *src, unsigned size) } } +static __always_inline __must_check +int __copy_to_user(void __user *dst, const void *src, unsigned size) +{ + might_fault(); + return __copy_to_user_nocheck(dst, src, size); +} + static __always_inline __must_check int __copy_in_user(void __user *dst, const void __user *src, unsigned size) { @@ -220,13 +232,13 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) static __must_check __always_inline int __copy_from_user_inatomic(void *dst, const void __user *src, unsigned size) { - return copy_user_generic(dst, (__force const void *)src, size); + return __copy_from_user_nocheck(dst, (__force const void *)src, size); } static __must_check __always_inline int __copy_to_user_inatomic(void __user *dst, const void *src, unsigned size) { - return copy_user_generic((__force void *)dst, src, size); + return __copy_to_user_nocheck((__force void *)dst, src, size); } extern long __copy_user_nocache(void *dst, const void __user *src, From d60cb61235d4df7eef0bb048664f0bbcc615dc71 Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Fri, 9 Oct 2015 14:03:38 +0100 Subject: [PATCH 332/359] dm cache: fix NULL pointer when switching from cleaner policy commit 2bffa1503c5c06192eb1459180fac4416575a966 upstream. The cleaner policy doesn't make use of the per cache block hint space in the metadata (unlike the other policies). When switching from the cleaner policy to mq or smq a NULL pointer crash (in dm_tm_new_block) was observed. The crash was caused by bugs in dm-cache-metadata.c when trying to skip creation of the hint btree. The minimal fix is to change hint size for the cleaner policy to 4 bytes (only hint size supported). Signed-off-by: Joe Thornber Signed-off-by: Mike Snitzer Signed-off-by: Greg Kroah-Hartman --- drivers/md/dm-cache-policy-cleaner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/dm-cache-policy-cleaner.c b/drivers/md/dm-cache-policy-cleaner.c index b04d1f904d0763..2eca9084defeea 100644 --- a/drivers/md/dm-cache-policy-cleaner.c +++ b/drivers/md/dm-cache-policy-cleaner.c @@ -434,7 +434,7 @@ static struct dm_cache_policy *wb_create(dm_cblock_t cache_size, static struct dm_cache_policy_type wb_policy_type = { .name = "cleaner", .version = {1, 0, 0}, - .hint_size = 0, + .hint_size = 4, .owner = THIS_MODULE, .create = wb_create }; From 613df159a3db2421407d69ba4473bf4830060347 Mon Sep 17 00:00:00 2001 From: "covici@ccs.covici.com" Date: Wed, 20 May 2015 05:44:11 -0400 Subject: [PATCH 333/359] staging: speakup: fix speakup-r regression commit b1d562acc78f0af46de0dfe447410bc40bdb7ece upstream. Here is a patch to make speakup-r work again. It broke in 3.6 due to commit 4369c64c79a22b98d3b7eff9d089196cd878a10a "Input: Send events one packet at a time) The problem was that the fakekey.c routine to fake a down arrow no longer functioned properly and putting the input_sync fixed it. Fixes: 4369c64c79a22b98d3b7eff9d089196cd878a10a Acked-by: Samuel Thibault Signed-off-by: John Covici Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman --- drivers/staging/speakup/fakekey.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/speakup/fakekey.c b/drivers/staging/speakup/fakekey.c index 4299cf45f947de..5e1f16c36b49ad 100644 --- a/drivers/staging/speakup/fakekey.c +++ b/drivers/staging/speakup/fakekey.c @@ -81,6 +81,7 @@ void speakup_fake_down_arrow(void) __this_cpu_write(reporting_keystroke, true); input_report_key(virt_keyboard, KEY_DOWN, PRESSED); input_report_key(virt_keyboard, KEY_DOWN, RELEASED); + input_sync(virt_keyboard); __this_cpu_write(reporting_keystroke, false); /* reenable preemption */ From c3dadb26a96bd1895a6ab69e0042a52014b7986a Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Sat, 3 Oct 2015 19:16:07 +0200 Subject: [PATCH 334/359] 3w-9xxx: don't unmap bounce buffered commands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 15e3d5a285ab9283136dba34bbf72886d9146706 upstream. 3w controller don't dma map small single SGL entry commands but instead bounce buffer them. Add a helper to identify these commands and don't call scsi_dma_unmap for them. Based on an earlier patch from James Bottomley. Fixes: 118c85 ("3w-9xxx: fix command completion race") Reported-by: Tóth Attila Tested-by: Tóth Attila Signed-off-by: Christoph Hellwig Acked-by: Adam Radford Signed-off-by: James Bottomley Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/3w-9xxx.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c index 5f57e3d35e26d4..6adf9abdf955ed 100644 --- a/drivers/scsi/3w-9xxx.c +++ b/drivers/scsi/3w-9xxx.c @@ -225,6 +225,17 @@ static const struct file_operations twa_fops = { .llseek = noop_llseek, }; +/* + * The controllers use an inline buffer instead of a mapped SGL for small, + * single entry buffers. Note that we treat a zero-length transfer like + * a mapped SGL. + */ +static bool twa_command_mapped(struct scsi_cmnd *cmd) +{ + return scsi_sg_count(cmd) != 1 || + scsi_bufflen(cmd) >= TW_MIN_SGL_LENGTH; +} + /* This function will complete an aen request from the isr */ static int twa_aen_complete(TW_Device_Extension *tw_dev, int request_id) { @@ -1351,7 +1362,8 @@ static irqreturn_t twa_interrupt(int irq, void *dev_instance) } /* Now complete the io */ - scsi_dma_unmap(cmd); + if (twa_command_mapped(cmd)) + scsi_dma_unmap(cmd); cmd->scsi_done(cmd); tw_dev->state[request_id] = TW_S_COMPLETED; twa_free_request_id(tw_dev, request_id); @@ -1594,7 +1606,8 @@ static int twa_reset_device_extension(TW_Device_Extension *tw_dev) struct scsi_cmnd *cmd = tw_dev->srb[i]; cmd->result = (DID_RESET << 16); - scsi_dma_unmap(cmd); + if (twa_command_mapped(cmd)) + scsi_dma_unmap(cmd); cmd->scsi_done(cmd); } } @@ -1777,12 +1790,14 @@ static int twa_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_ retval = twa_scsiop_execute_scsi(tw_dev, request_id, NULL, 0, NULL); switch (retval) { case SCSI_MLQUEUE_HOST_BUSY: - scsi_dma_unmap(SCpnt); + if (twa_command_mapped(SCpnt)) + scsi_dma_unmap(SCpnt); twa_free_request_id(tw_dev, request_id); break; case 1: SCpnt->result = (DID_ERROR << 16); - scsi_dma_unmap(SCpnt); + if (twa_command_mapped(SCpnt)) + scsi_dma_unmap(SCpnt); done(SCpnt); tw_dev->state[request_id] = TW_S_COMPLETED; twa_free_request_id(tw_dev, request_id); @@ -1843,8 +1858,7 @@ static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id, /* Map sglist from scsi layer to cmd packet */ if (scsi_sg_count(srb)) { - if ((scsi_sg_count(srb) == 1) && - (scsi_bufflen(srb) < TW_MIN_SGL_LENGTH)) { + if (!twa_command_mapped(srb)) { if (srb->sc_data_direction == DMA_TO_DEVICE || srb->sc_data_direction == DMA_BIDIRECTIONAL) scsi_sg_copy_to_buffer(srb, @@ -1917,7 +1931,7 @@ static void twa_scsiop_execute_scsi_complete(TW_Device_Extension *tw_dev, int re { struct scsi_cmnd *cmd = tw_dev->srb[request_id]; - if (scsi_bufflen(cmd) < TW_MIN_SGL_LENGTH && + if (!twa_command_mapped(cmd) && (cmd->sc_data_direction == DMA_FROM_DEVICE || cmd->sc_data_direction == DMA_BIDIRECTIONAL)) { if (scsi_sg_count(cmd) == 1) { From 61ce1520149bb1cfdc9a2946a1b6a33119742881 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 22 Oct 2015 14:38:04 -0700 Subject: [PATCH 335/359] Linux 3.10.91 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ce741a9f5b1c9c..ba6a94cf354bbf 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 10 -SUBLEVEL = 90 +SUBLEVEL = 91 EXTRAVERSION = NAME = TOSSUG Baby Fish From 30e3049027aa2af5e331d4dafc511f41b1fc4a6f Mon Sep 17 00:00:00 2001 From: moonman Date: Sat, 24 Oct 2015 06:19:20 -0600 Subject: [PATCH 336/359] Revert "Additional AUFS fixes" This reverts commit 4e7cb93e401fe473963dc8e346ffea281ccfc137. --- fs/aufs/debug.c | 2 +- fs/aufs/hnotify.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/aufs/debug.c b/fs/aufs/debug.c index 5cc83379bd26d3..3465e79e51da8b 100644 --- a/fs/aufs/debug.c +++ b/fs/aufs/debug.c @@ -169,7 +169,7 @@ void au_dpri_dalias(struct inode *inode) struct dentry *d; spin_lock(&inode->i_lock); - hlist_for_each_entry(d, &inode->i_dentry, d_u.d_alias) + hlist_for_each_entry(d, &inode->i_dentry, d_alias) au_dpri_dentry(d); spin_unlock(&inode->i_lock); } diff --git a/fs/aufs/hnotify.c b/fs/aufs/hnotify.c index 6b2e1fa7ac5b63..3dc01f97e7cd6d 100644 --- a/fs/aufs/hnotify.c +++ b/fs/aufs/hnotify.c @@ -211,7 +211,7 @@ static int hn_gen_by_inode(char *name, unsigned int nlen, struct inode *inode, AuDebugOn(!name); au_iigen_dec(inode); spin_lock(&inode->i_lock); - hlist_for_each_entry(d, &inode->i_dentry, d_u.d_alias) { + hlist_for_each_entry(d, &inode->i_dentry, d_alias) { spin_lock(&d->d_lock); dname = &d->d_name; if (dname->len != nlen From d3cb84149407187b89b0accdfb3590fb1ce51ef0 Mon Sep 17 00:00:00 2001 From: moonman Date: Sat, 24 Oct 2015 06:20:07 -0600 Subject: [PATCH 337/359] Revert "fix aufs for newer kernels" This reverts commit 02712c7e324a394455f0f76dbf55745c4eb87403. --- fs/aufs/dcsub.c | 4 ++-- fs/aufs/export.c | 2 +- fs/aufs/hnotify.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/aufs/dcsub.c b/fs/aufs/dcsub.c index c2e69fe7253386..1746e79da2d2e3 100644 --- a/fs/aufs/dcsub.c +++ b/fs/aufs/dcsub.c @@ -133,7 +133,7 @@ int au_dcsub_pages(struct au_dcsub_pages *dpages, struct dentry *root, while (next != &this_parent->d_subdirs) { struct list_head *tmp = next; struct dentry *dentry = list_entry(tmp, struct dentry, - d_child); + d_u.d_child); next = tmp->next; spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); @@ -169,7 +169,7 @@ int au_dcsub_pages(struct au_dcsub_pages *dpages, struct dentry *root, this_parent = tmp; spin_lock(&this_parent->d_lock); rcu_read_unlock(); - next = child->d_child.next; + next = child->d_u.d_child.next; goto resume; } diff --git a/fs/aufs/export.c b/fs/aufs/export.c index bbeb8dd0f94b01..484794df25e57b 100644 --- a/fs/aufs/export.c +++ b/fs/aufs/export.c @@ -243,7 +243,7 @@ static struct dentry *decode_by_ino(struct super_block *sb, ino_t ino, dentry = d_find_alias(inode); else { spin_lock(&inode->i_lock); - hlist_for_each_entry(d, &inode->i_dentry, d_u.d_alias) { + hlist_for_each_entry(d, &inode->i_dentry, d_alias) { spin_lock(&d->d_lock); if (!au_test_anon(d) && d->d_parent->d_inode->i_ino == dir_ino) { diff --git a/fs/aufs/hnotify.c b/fs/aufs/hnotify.c index 3dc01f97e7cd6d..6b5b85e0b28261 100644 --- a/fs/aufs/hnotify.c +++ b/fs/aufs/hnotify.c @@ -378,7 +378,7 @@ static struct dentry *lookup_wlock_by_name(char *name, unsigned int nlen, dentry = NULL; spin_lock(&parent->d_lock); - list_for_each_entry(d, &parent->d_subdirs, d_child) { + list_for_each_entry(d, &parent->d_subdirs, d_u.d_child) { /* AuDbg("%.*s\n", AuDLNPair(d)); */ spin_lock_nested(&d->d_lock, DENTRY_D_LOCK_NESTED); dname = &d->d_name; From 2fdc213071f423955f031c65887a437d70d47853 Mon Sep 17 00:00:00 2001 From: moonman Date: Sat, 24 Oct 2015 06:20:31 -0600 Subject: [PATCH 338/359] Revert "integrated support for aufs & Docker" This reverts commit 0cedbaa9da0cdff10b0ab50ad16d7efef62c8209. --- Documentation/ABI/testing/debugfs-aufs | 50 - Documentation/ABI/testing/sysfs-aufs | 31 - Documentation/filesystems/aufs/README | 370 ---- .../filesystems/aufs/design/01intro.txt | 161 -- .../filesystems/aufs/design/02struct.txt | 251 --- .../filesystems/aufs/design/03lookup.txt | 133 -- .../filesystems/aufs/design/04branch.txt | 75 - .../filesystems/aufs/design/05wbr_policy.txt | 64 - .../filesystems/aufs/design/06fhsm.txt | 120 -- .../filesystems/aufs/design/06mmap.txt | 46 - .../filesystems/aufs/design/06xattr.txt | 96 - .../filesystems/aufs/design/07export.txt | 58 - .../filesystems/aufs/design/08shwh.txt | 52 - .../filesystems/aufs/design/10dynop.txt | 46 - .../filesystems/aufs/design/99plan.txt | 58 - MAINTAINERS | 14 - arch/arm/configs/odroidxu3_defconfig | 34 +- fs/Kconfig | 1 - fs/Makefile | 1 - fs/aufs/Kconfig | 185 -- fs/aufs/Makefile | 43 - fs/aufs/aufs.h | 59 - fs/aufs/branch.c | 1436 ------------- fs/aufs/branch.h | 268 --- fs/aufs/conf.mk | 38 - fs/aufs/cpup.c | 1285 ------------ fs/aufs/cpup.h | 94 - fs/aufs/dbgaufs.c | 432 ---- fs/aufs/dbgaufs.h | 48 - fs/aufs/dcsub.c | 242 --- fs/aufs/dcsub.h | 102 - fs/aufs/debug.c | 520 ----- fs/aufs/debug.h | 263 --- fs/aufs/dentry.c | 1096 ---------- fs/aufs/dentry.h | 232 --- fs/aufs/dinfo.c | 542 ----- fs/aufs/dir.c | 631 ------ fs/aufs/dir.h | 130 -- fs/aufs/dynop.c | 378 ---- fs/aufs/dynop.h | 75 - fs/aufs/export.c | 825 -------- fs/aufs/f_op.c | 796 ------- fs/aufs/fhsm.c | 426 ---- fs/aufs/file.c | 815 -------- fs/aufs/file.h | 281 --- fs/aufs/finfo.c | 156 -- fs/aufs/fstype.h | 469 ----- fs/aufs/hfsnotify.c | 302 --- fs/aufs/hfsplus.c | 56 - fs/aufs/hnotify.c | 712 ------- fs/aufs/i_op.c | 1255 ----------- fs/aufs/i_op_add.c | 750 ------- fs/aufs/i_op_del.c | 502 ----- fs/aufs/i_op_ren.c | 1010 --------- fs/aufs/iinfo.c | 275 --- fs/aufs/inode.c | 496 ----- fs/aufs/inode.h | 633 ------ fs/aufs/ioctl.c | 219 -- fs/aufs/loop.c | 134 -- fs/aufs/loop.h | 49 - fs/aufs/magic.mk | 54 - fs/aufs/module.c | 210 -- fs/aufs/module.h | 104 - fs/aufs/mvdown.c | 680 ------ fs/aufs/opts.c | 1840 ----------------- fs/aufs/opts.h | 213 -- fs/aufs/plink.c | 519 ----- fs/aufs/poll.c | 55 - fs/aufs/procfs.c | 169 -- fs/aufs/rdu.c | 383 ---- fs/aufs/rwsem.h | 191 -- fs/aufs/sbinfo.c | 351 ---- fs/aufs/spl.h | 111 - fs/aufs/super.c | 1008 --------- fs/aufs/super.h | 637 ------ fs/aufs/sysaufs.c | 104 - fs/aufs/sysaufs.h | 101 - fs/aufs/sysfs.c | 372 ---- fs/aufs/sysrq.c | 153 -- fs/aufs/vdir.c | 879 -------- fs/aufs/vfsub.c | 782 ------- fs/aufs/vfsub.h | 329 --- fs/aufs/wbr_policy.c | 764 ------- fs/aufs/whout.c | 1025 --------- fs/aufs/whout.h | 85 - fs/aufs/wkq.c | 212 -- fs/aufs/wkq.h | 91 - fs/aufs/xattr.c | 437 ---- fs/aufs/xino.c | 1309 ------------ fs/buffer.c | 2 +- fs/file_table.c | 5 +- fs/inode.c | 4 +- fs/namei.c | 3 +- fs/namespace.c | 3 - fs/notify/group.c | 4 - fs/notify/mark.c | 4 - fs/open.c | 2 - fs/proc/base.c | 2 +- fs/proc/nommu.c | 5 +- fs/proc/task_mmu.c | 6 +- fs/proc/task_nommu.c | 5 +- fs/splice.c | 12 +- fs/xattr.c | 1 - include/linux/fs.h | 2 - include/linux/mm.h | 22 - include/linux/mm_types.h | 2 - include/linux/splice.h | 6 - include/uapi/linux/Kbuild | 1 - include/uapi/linux/aufs_type.h | 418 ---- kernel/fork.c | 2 +- mm/Makefile | 2 +- mm/filemap.c | 2 +- mm/fremap.c | 16 +- mm/madvise.c | 4 +- mm/memory.c | 4 +- mm/mmap.c | 12 +- mm/msync.c | 4 +- mm/nommu.c | 10 +- mm/prfile.c | 86 - security/commoncap.c | 2 - security/device_cgroup.c | 2 - security/security.c | 10 - 122 files changed, 40 insertions(+), 33714 deletions(-) delete mode 100644 Documentation/ABI/testing/debugfs-aufs delete mode 100644 Documentation/ABI/testing/sysfs-aufs delete mode 100644 Documentation/filesystems/aufs/README delete mode 100644 Documentation/filesystems/aufs/design/01intro.txt delete mode 100644 Documentation/filesystems/aufs/design/02struct.txt delete mode 100644 Documentation/filesystems/aufs/design/03lookup.txt delete mode 100644 Documentation/filesystems/aufs/design/04branch.txt delete mode 100644 Documentation/filesystems/aufs/design/05wbr_policy.txt delete mode 100644 Documentation/filesystems/aufs/design/06fhsm.txt delete mode 100644 Documentation/filesystems/aufs/design/06mmap.txt delete mode 100644 Documentation/filesystems/aufs/design/06xattr.txt delete mode 100644 Documentation/filesystems/aufs/design/07export.txt delete mode 100644 Documentation/filesystems/aufs/design/08shwh.txt delete mode 100644 Documentation/filesystems/aufs/design/10dynop.txt delete mode 100644 Documentation/filesystems/aufs/design/99plan.txt delete mode 100644 fs/aufs/Kconfig delete mode 100644 fs/aufs/Makefile delete mode 100644 fs/aufs/aufs.h delete mode 100644 fs/aufs/branch.c delete mode 100644 fs/aufs/branch.h delete mode 100644 fs/aufs/conf.mk delete mode 100644 fs/aufs/cpup.c delete mode 100644 fs/aufs/cpup.h delete mode 100644 fs/aufs/dbgaufs.c delete mode 100644 fs/aufs/dbgaufs.h delete mode 100644 fs/aufs/dcsub.c delete mode 100644 fs/aufs/dcsub.h delete mode 100644 fs/aufs/debug.c delete mode 100644 fs/aufs/debug.h delete mode 100644 fs/aufs/dentry.c delete mode 100644 fs/aufs/dentry.h delete mode 100644 fs/aufs/dinfo.c delete mode 100644 fs/aufs/dir.c delete mode 100644 fs/aufs/dir.h delete mode 100644 fs/aufs/dynop.c delete mode 100644 fs/aufs/dynop.h delete mode 100644 fs/aufs/export.c delete mode 100644 fs/aufs/f_op.c delete mode 100644 fs/aufs/fhsm.c delete mode 100644 fs/aufs/file.c delete mode 100644 fs/aufs/file.h delete mode 100644 fs/aufs/finfo.c delete mode 100644 fs/aufs/fstype.h delete mode 100644 fs/aufs/hfsnotify.c delete mode 100644 fs/aufs/hfsplus.c delete mode 100644 fs/aufs/hnotify.c delete mode 100644 fs/aufs/i_op.c delete mode 100644 fs/aufs/i_op_add.c delete mode 100644 fs/aufs/i_op_del.c delete mode 100644 fs/aufs/i_op_ren.c delete mode 100644 fs/aufs/iinfo.c delete mode 100644 fs/aufs/inode.c delete mode 100644 fs/aufs/inode.h delete mode 100644 fs/aufs/ioctl.c delete mode 100644 fs/aufs/loop.c delete mode 100644 fs/aufs/loop.h delete mode 100644 fs/aufs/magic.mk delete mode 100644 fs/aufs/module.c delete mode 100644 fs/aufs/module.h delete mode 100644 fs/aufs/mvdown.c delete mode 100644 fs/aufs/opts.c delete mode 100644 fs/aufs/opts.h delete mode 100644 fs/aufs/plink.c delete mode 100644 fs/aufs/poll.c delete mode 100644 fs/aufs/procfs.c delete mode 100644 fs/aufs/rdu.c delete mode 100644 fs/aufs/rwsem.h delete mode 100644 fs/aufs/sbinfo.c delete mode 100644 fs/aufs/spl.h delete mode 100644 fs/aufs/super.c delete mode 100644 fs/aufs/super.h delete mode 100644 fs/aufs/sysaufs.c delete mode 100644 fs/aufs/sysaufs.h delete mode 100644 fs/aufs/sysfs.c delete mode 100644 fs/aufs/sysrq.c delete mode 100644 fs/aufs/vdir.c delete mode 100644 fs/aufs/vfsub.c delete mode 100644 fs/aufs/vfsub.h delete mode 100644 fs/aufs/wbr_policy.c delete mode 100644 fs/aufs/whout.c delete mode 100644 fs/aufs/whout.h delete mode 100644 fs/aufs/wkq.c delete mode 100644 fs/aufs/wkq.h delete mode 100644 fs/aufs/xattr.c delete mode 100644 fs/aufs/xino.c delete mode 100644 include/uapi/linux/aufs_type.h delete mode 100644 mm/prfile.c diff --git a/Documentation/ABI/testing/debugfs-aufs b/Documentation/ABI/testing/debugfs-aufs deleted file mode 100644 index 99642d1055a295..00000000000000 --- a/Documentation/ABI/testing/debugfs-aufs +++ /dev/null @@ -1,50 +0,0 @@ -What: /debug/aufs/si_/ -Date: March 2009 -Contact: J. R. Okajima -Description: - Under /debug/aufs, a directory named si_ is created - per aufs mount, where is a unique id generated - internally. - -What: /debug/aufs/si_/plink -Date: Apr 2013 -Contact: J. R. Okajima -Description: - It has three lines and shows the information about the - pseudo-link. The first line is a single number - representing a number of buckets. The second line is a - number of pseudo-links per buckets (separated by a - blank). The last line is a single number representing a - total number of psedo-links. - When the aufs mount option 'noplink' is specified, it - will show "1\n0\n0\n". - -What: /debug/aufs/si_/xib -Date: March 2009 -Contact: J. R. Okajima -Description: - It shows the consumed blocks by xib (External Inode Number - Bitmap), its block size and file size. - When the aufs mount option 'noxino' is specified, it - will be empty. About XINO files, see the aufs manual. - -What: /debug/aufs/si_/xino0, xino1 ... xinoN -Date: March 2009 -Contact: J. R. Okajima -Description: - It shows the consumed blocks by xino (External Inode Number - Translation Table), its link count, block size and file - size. - When the aufs mount option 'noxino' is specified, it - will be empty. About XINO files, see the aufs manual. - -What: /debug/aufs/si_/xigen -Date: March 2009 -Contact: J. R. Okajima -Description: - It shows the consumed blocks by xigen (External Inode - Generation Table), its block size and file size. - If CONFIG_AUFS_EXPORT is disabled, this entry will not - be created. - When the aufs mount option 'noxino' is specified, it - will be empty. About XINO files, see the aufs manual. diff --git a/Documentation/ABI/testing/sysfs-aufs b/Documentation/ABI/testing/sysfs-aufs deleted file mode 100644 index 82f9518495eae4..00000000000000 --- a/Documentation/ABI/testing/sysfs-aufs +++ /dev/null @@ -1,31 +0,0 @@ -What: /sys/fs/aufs/si_/ -Date: March 2009 -Contact: J. R. Okajima -Description: - Under /sys/fs/aufs, a directory named si_ is created - per aufs mount, where is a unique id generated - internally. - -What: /sys/fs/aufs/si_/br0, br1 ... brN -Date: March 2009 -Contact: J. R. Okajima -Description: - It shows the abolute path of a member directory (which - is called branch) in aufs, and its permission. - -What: /sys/fs/aufs/si_/brid0, brid1 ... bridN -Date: July 2013 -Contact: J. R. Okajima -Description: - It shows the id of a member directory (which is called - branch) in aufs. - -What: /sys/fs/aufs/si_/xi_path -Date: March 2009 -Contact: J. R. Okajima -Description: - It shows the abolute path of XINO (External Inode Number - Bitmap, Translation Table and Generation Table) file - even if it is the default path. - When the aufs mount option 'noxino' is specified, it - will be empty. About XINO files, see the aufs manual. diff --git a/Documentation/filesystems/aufs/README b/Documentation/filesystems/aufs/README deleted file mode 100644 index 4b97e592ddc05a..00000000000000 --- a/Documentation/filesystems/aufs/README +++ /dev/null @@ -1,370 +0,0 @@ - -Aufs3 -- advanced multi layered unification filesystem version 3.x -http://aufs.sf.net -Junjiro R. Okajima - - -0. Introduction ----------------------------------------- -In the early days, aufs was entirely re-designed and re-implemented -Unionfs Version 1.x series. After many original ideas, approaches, -improvements and implementations, it becomes totally different from -Unionfs while keeping the basic features. -Recently, Unionfs Version 2.x series begin taking some of the same -approaches to aufs1's. -Unionfs is being developed by Professor Erez Zadok at Stony Brook -University and his team. - -Aufs3 supports linux-3.0 and later. -If you want older kernel version support, try aufs2-2.6.git or -aufs2-standalone.git repository, aufs1 from CVS on SourceForge. - -Note: it becomes clear that "Aufs was rejected. Let's give it up." - According to Christoph Hellwig, linux rejects all union-type - filesystems but UnionMount. - - -PS. Al Viro seems have a plan to merge aufs as well as overlayfs and - UnionMount, and he pointed out an issue around a directory mutex - lock and aufs addressed it. But it is still unsure whether aufs will - be merged (or any other union solution). - - - -1. Features ----------------------------------------- -- unite several directories into a single virtual filesystem. The member - directory is called as a branch. -- you can specify the permission flags to the branch, which are 'readonly', - 'readwrite' and 'whiteout-able.' -- by upper writable branch, internal copyup and whiteout, files/dirs on - readonly branch are modifiable logically. -- dynamic branch manipulation, add, del. -- etc... - -Also there are many enhancements in aufs1, such as: -- readdir(3) in userspace. -- keep inode number by external inode number table -- keep the timestamps of file/dir in internal copyup operation -- seekable directory, supporting NFS readdir. -- whiteout is hardlinked in order to reduce the consumption of inodes - on branch -- do not copyup, nor create a whiteout when it is unnecessary -- revert a single systemcall when an error occurs in aufs -- remount interface instead of ioctl -- maintain /etc/mtab by an external command, /sbin/mount.aufs. -- loopback mounted filesystem as a branch -- kernel thread for removing the dir who has a plenty of whiteouts -- support copyup sparse file (a file which has a 'hole' in it) -- default permission flags for branches -- selectable permission flags for ro branch, whether whiteout can - exist or not -- export via NFS. -- support /fs/aufs and /aufs. -- support multiple writable branches, some policies to select one - among multiple writable branches. -- a new semantics for link(2) and rename(2) to support multiple - writable branches. -- no glibc changes are required. -- pseudo hardlink (hardlink over branches) -- allow a direct access manually to a file on branch, e.g. bypassing aufs. - including NFS or remote filesystem branch. -- userspace wrapper for pathconf(3)/fpathconf(3) with _PC_LINK_MAX. -- and more... - -Currently these features are dropped temporary from aufs3. -See design/08plan.txt in detail. -- test only the highest one for the directory permission (dirperm1) -- copyup on open (coo=) -- nested mount, i.e. aufs as readonly no-whiteout branch of another aufs - (robr) -- statistics of aufs thread (/sys/fs/aufs/stat) -- delegation mode (dlgt) - a delegation of the internal branch access to support task I/O - accounting, which also supports Linux Security Modules (LSM) mainly - for Suse AppArmor. -- intent.open/create (file open in a single lookup) - -Features or just an idea in the future (see also design/*.txt), -- reorder the branch index without del/re-add. -- permanent xino files for NFSD -- an option for refreshing the opened files after add/del branches -- 'move' policy for copy-up between two writable branches, after - checking free space. -- light version, without branch manipulation. (unnecessary?) -- copyup in userspace -- inotify in userspace -- readv/writev -- xattr, acl - - -2. Download ----------------------------------------- -There were three GIT trees for aufs3, aufs3-linux.git, -aufs3-standalone.git, and aufs-util.git. Note that there is no "3" in -"aufs-util.git." -While the aufs-util is always necessary, you need either of aufs3-linux -or aufs3-standalone. - -The aufs3-linux tree includes the whole linux mainline GIT tree, -git://git.kernel.org/.../torvalds/linux.git. -And you cannot select CONFIG_AUFS_FS=m for this version, eg. you cannot -build aufs3 as an external kernel module. - -On the other hand, the aufs3-standalone tree has only aufs source files -and necessary patches, and you can select CONFIG_AUFS_FS=m. - -You will find GIT branches whose name is in form of "aufs3.x" where "x" -represents the linux kernel version, "linux-3.x". For instance, -"aufs3.0" is for linux-3.0. For latest "linux-3.x-rcN", use -"aufs3.x-rcN" branch. - -o aufs3-linux tree -$ git clone --reference /your/linux/git/tree \ - git://git.code.sf.net/p/aufs/aufs3-linux aufs-aufs3-linux \ - aufs3-linux.git -- if you don't have linux GIT tree, then remove "--reference ..." -$ cd aufs3-linux.git -$ git checkout origin/aufs3.0 - -o aufs3-standalone tree -$ git clone git://git.code.sf.net/p/aufs/aufs3-standalone \ - aufs3-standalone.git -$ cd aufs3-standalone.git -$ git checkout origin/aufs3.0 - -o aufs-util tree -$ git clone git://git.code.sf.net/p/aufs/aufs-util \ - aufs-util.git -$ cd aufs-util.git -$ git checkout origin/aufs3.0 - -Note: The 3.x-rcN branch is to be used with `rc' kernel versions ONLY. -The minor version number, 'x' in '3.x', of aufs may not always -follow the minor version number of the kernel. -Because changes in the kernel that cause the use of a new -minor version number do not always require changes to aufs-util. - -Since aufs-util has its own minor version number, you may not be -able to find a GIT branch in aufs-util for your kernel's -exact minor version number. -In this case, you should git-checkout the branch for the -nearest lower number. - -For (an unreleased) example: -If you are using "linux-3.10" and the "aufs3.10" branch -does not exist in aufs-util repository, then "aufs3.9", "aufs3.8" -or something numerically smaller is the branch for your kernel. - -Also you can view all branches by - $ git branch -a - - -3. Configuration and Compilation ----------------------------------------- -Make sure you have git-checkout'ed the correct branch. - -For aufs3-linux tree, -- enable CONFIG_AUFS_FS. -- set other aufs configurations if necessary. - -For aufs3-standalone tree, -There are several ways to build. - -1. -- apply ./aufs3-kbuild.patch to your kernel source files. -- apply ./aufs3-base.patch too. -- apply ./aufs3-mmap.patch too. -- apply ./aufs3-standalone.patch too, if you have a plan to set - CONFIG_AUFS_FS=m. otherwise you don't need ./aufs3-standalone.patch. -- copy ./{Documentation,fs,include/uapi/linux/aufs_type.h} files to your - kernel source tree. Never copy $PWD/include/uapi/linux/Kbuild. -- enable CONFIG_AUFS_FS, you can select either - =m or =y. -- and build your kernel as usual. -- install the built kernel. - Note: Since linux-3.9, every filesystem module requires an alias - "fs-". You should make sure that "fs-aufs" is listed in your - modules.aliases file if you set CONFIG_AUFS_FS=m. -- install the header files too by "make headers_install" to the - directory where you specify. By default, it is $PWD/usr. - "make help" shows a brief note for headers_install. -- and reboot your system. - -2. -- module only (CONFIG_AUFS_FS=m). -- apply ./aufs3-base.patch to your kernel source files. -- apply ./aufs3-mmap.patch too. -- apply ./aufs3-standalone.patch too. -- build your kernel, don't forget "make headers_install", and reboot. -- edit ./config.mk and set other aufs configurations if necessary. - Note: You should read $PWD/fs/aufs/Kconfig carefully which describes - every aufs configurations. -- build the module by simple "make". - Note: Since linux-3.9, every filesystem module requires an alias - "fs-". You should make sure that "fs-aufs" is listed in your - modules.aliases file. -- you can specify ${KDIR} make variable which points to your kernel - source tree. -- install the files - + run "make install" to install the aufs module, or copy the built - $PWD/aufs.ko to /lib/modules/... and run depmod -a (or reboot simply). - + run "make install_headers" (instead of headers_install) to install - the modified aufs header file (you can specify DESTDIR which is - available in aufs standalone version's Makefile only), or copy - $PWD/usr/include/linux/aufs_type.h to /usr/include/linux or wherever - you like manually. By default, the target directory is $PWD/usr. -- no need to apply aufs3-kbuild.patch, nor copying source files to your - kernel source tree. - -Note: The header file aufs_type.h is necessary to build aufs-util - as well as "make headers_install" in the kernel source tree. - headers_install is subject to be forgotten, but it is essentially - necessary, not only for building aufs-util. - You may not meet problems without headers_install in some older - version though. - -And then, -- read README in aufs-util, build and install it -- note that your distribution may contain an obsoleted version of - aufs_type.h in /usr/include/linux or something. When you build aufs - utilities, make sure that your compiler refers the correct aufs header - file which is built by "make headers_install." -- if you want to use readdir(3) in userspace or pathconf(3) wrapper, - then run "make install_ulib" too. And refer to the aufs manual in - detail. - -There several other patches in aufs3-standalone.git. They are all -optional. When you meet some problems, they will help you. -- aufs3-loopback.patch - Supports a nested loopback mount in a branch-fs. This patch is - unnecessary until aufs produces a message like "you may want to try - another patch for loopback file". -- vfs-ino.patch - Modifies a system global kernel internal function get_next_ino() in - order to stop assigning 0 for an inode-number. Not directly related to - aufs, but recommended generally. -- tmpfs-idr.patch - Keeps the tmpfs inode number as the lowest value. Effective to reduce - the size of aufs XINO files for tmpfs branch. Also it prevents the - duplication of inode number, which is important for backup tools and - other utilities. When you find aufs XINO files for tmpfs branch - growing too much, try this patch. - - -4. Usage ----------------------------------------- -At first, make sure aufs-util are installed, and please read the aufs -manual, aufs.5 in aufs-util.git tree. -$ man -l aufs.5 - -And then, -$ mkdir /tmp/rw /tmp/aufs -# mount -t aufs -o br=/tmp/rw:${HOME} none /tmp/aufs - -Here is another example. The result is equivalent. -# mount -t aufs -o br=/tmp/rw=rw:${HOME}=ro none /tmp/aufs - Or -# mount -t aufs -o br:/tmp/rw none /tmp/aufs -# mount -o remount,append:${HOME} /tmp/aufs - -Then, you can see whole tree of your home dir through /tmp/aufs. If -you modify a file under /tmp/aufs, the one on your home directory is -not affected, instead the same named file will be newly created under -/tmp/rw. And all of your modification to a file will be applied to -the one under /tmp/rw. This is called the file based Copy on Write -(COW) method. -Aufs mount options are described in aufs.5. -If you run chroot or something and make your aufs as a root directory, -then you need to customize the shutdown script. See the aufs manual in -detail. - -Additionally, there are some sample usages of aufs which are a -diskless system with network booting, and LiveCD over NFS. -See sample dir in CVS tree on SourceForge. - - -5. Contact ----------------------------------------- -When you have any problems or strange behaviour in aufs, please let me -know with: -- /proc/mounts (instead of the output of mount(8)) -- /sys/module/aufs/* -- /sys/fs/aufs/* (if you have them) -- /debug/aufs/* (if you have them) -- linux kernel version - if your kernel is not plain, for example modified by distributor, - the url where i can download its source is necessary too. -- aufs version which was printed at loading the module or booting the - system, instead of the date you downloaded. -- configuration (define/undefine CONFIG_AUFS_xxx) -- kernel configuration or /proc/config.gz (if you have it) -- behaviour which you think to be incorrect -- actual operation, reproducible one is better -- mailto: aufs-users at lists.sourceforge.net - -Usually, I don't watch the Public Areas(Bugs, Support Requests, Patches, -and Feature Requests) on SourceForge. Please join and write to -aufs-users ML. - - -6. Acknowledgements ----------------------------------------- -Thanks to everyone who have tried and are using aufs, whoever -have reported a bug or any feedback. - -Especially donators: -Tomas Matejicek(slax.org) made a donation (much more than once). - Since Apr 2010, Tomas M (the author of Slax and Linux Live - scripts) is making "doubling" donations. - Unfortunately I cannot list all of the donators, but I really - appreciate. - It ends Aug 2010, but the ordinary donation URL is still available. - -Dai Itasaka made a donation (2007/8). -Chuck Smith made a donation (2008/4, 10 and 12). -Henk Schoneveld made a donation (2008/9). -Chih-Wei Huang, ASUS, CTC donated Eee PC 4G (2008/10). -Francois Dupoux made a donation (2008/11). -Bruno Cesar Ribas and Luis Carlos Erpen de Bona, C3SL serves public - aufs2 GIT tree (2009/2). -William Grant made a donation (2009/3). -Patrick Lane made a donation (2009/4). -The Mail Archive (mail-archive.com) made donations (2009/5). -Nippy Networks (Ed Wildgoose) made a donation (2009/7). -New Dream Network, LLC (www.dreamhost.com) made a donation (2009/11). -Pavel Pronskiy made a donation (2011/2). -Iridium and Inmarsat satellite phone retailer (www.mailasail.com), Nippy - Networks (Ed Wildgoose) made a donation for hardware (2011/3). -Max Lekomcev (DOM-TV project) made a donation (2011/7, 12, 2012/3, 6 and -11). -Sam Liddicott made a donation (2011/9). -Era Scarecrow made a donation (2013/4). -Bor Ratajc made a donation (2013/4). -Alessandro Gorreta made a donation (2013/4). -POIRETTE Marc made a donation (2013/4). -Alessandro Gorreta made a donation (2013/4). -lauri kasvandik made a donation (2013/5). -"pemasu from Finland" made a donation (2013/7). -The Parted Magic Project made a donation (2013/9 and 11). -Pavel Barta made a donation (2013/10). -Nikolay Pertsev made a donation (2014/5). -James B made a donation (2014/7). -Stefano Di Biase made a donation (2014/8). - -Thank you very much. -Donations are always, including future donations, very important and -helpful for me to keep on developing aufs. - - -7. ----------------------------------------- -If you are an experienced user, no explanation is needed. Aufs is -just a linux filesystem. - - -Enjoy! - -# Local variables: ; -# mode: text; -# End: ; diff --git a/Documentation/filesystems/aufs/design/01intro.txt b/Documentation/filesystems/aufs/design/01intro.txt deleted file mode 100644 index 88aec2d2271b44..00000000000000 --- a/Documentation/filesystems/aufs/design/01intro.txt +++ /dev/null @@ -1,161 +0,0 @@ - -# Copyright (C) 2005-2014 Junjiro R. Okajima -# -# 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, see . - -Introduction ----------------------------------------- - -aufs [ei ju: ef es] | [a u f s] -1. abbrev. for "advanced multi-layered unification filesystem". -2. abbrev. for "another unionfs". -3. abbrev. for "auf das" in German which means "on the" in English. - Ex. "Butter aufs Brot"(G) means "butter onto bread"(E). - But "Filesystem aufs Filesystem" is hard to understand. - -AUFS is a filesystem with features: -- multi layered stackable unification filesystem, the member directory - is called as a branch. -- branch permission and attribute, 'readonly', 'real-readonly', - 'readwrite', 'whiteout-able', 'link-able whiteout' and their - combination. -- internal "file copy-on-write". -- logical deletion, whiteout. -- dynamic branch manipulation, adding, deleting and changing permission. -- allow bypassing aufs, user's direct branch access. -- external inode number translation table and bitmap which maintains the - persistent aufs inode number. -- seekable directory, including NFS readdir. -- file mapping, mmap and sharing pages. -- pseudo-link, hardlink over branches. -- loopback mounted filesystem as a branch. -- several policies to select one among multiple writable branches. -- revert a single systemcall when an error occurs in aufs. -- and more... - - -Multi Layered Stackable Unification Filesystem ----------------------------------------------------------------------- -Most people already knows what it is. -It is a filesystem which unifies several directories and provides a -merged single directory. When users access a file, the access will be -passed/re-directed/converted (sorry, I am not sure which English word is -correct) to the real file on the member filesystem. The member -filesystem is called 'lower filesystem' or 'branch' and has a mode -'readonly' and 'readwrite.' And the deletion for a file on the lower -readonly branch is handled by creating 'whiteout' on the upper writable -branch. - -On LKML, there have been discussions about UnionMount (Jan Blunck, -Bharata B Rao and Valerie Aurora) and Unionfs (Erez Zadok). They took -different approaches to implement the merged-view. -The former tries putting it into VFS, and the latter implements as a -separate filesystem. -(If I misunderstand about these implementations, please let me know and -I shall correct it. Because it is a long time ago when I read their -source files last time). - -UnionMount's approach will be able to small, but may be hard to share -branches between several UnionMount since the whiteout in it is -implemented in the inode on branch filesystem and always -shared. According to Bharata's post, readdir does not seems to be -finished yet. -There are several missing features known in this implementations such as -- for users, the inode number may change silently. eg. copy-up. -- link(2) may break by copy-up. -- read(2) may get an obsoleted filedata (fstat(2) too). -- fcntl(F_SETLK) may be broken by copy-up. -- unnecessary copy-up may happen, for example mmap(MAP_PRIVATE) after - open(O_RDWR). - -Unionfs has a longer history. When I started implementing a stacking filesystem -(Aug 2005), it already existed. It has virtual super_block, inode, -dentry and file objects and they have an array pointing lower same kind -objects. After contributing many patches for Unionfs, I re-started my -project AUFS (Jun 2006). - -In AUFS, the structure of filesystem resembles to Unionfs, but I -implemented my own ideas, approaches and enhancements and it became -totally different one. - -Comparing DM snapshot and fs based implementation -- the number of bytes to be copied between devices is much smaller. -- the type of filesystem must be one and only. -- the fs must be writable, no readonly fs, even for the lower original - device. so the compression fs will not be usable. but if we use - loopback mount, we may address this issue. - for instance, - mount /cdrom/squashfs.img /sq - losetup /sq/ext2.img - losetup /somewhere/cow - dmsetup "snapshot /dev/loop0 /dev/loop1 ..." -- it will be difficult (or needs more operations) to extract the - difference between the original device and COW. -- DM snapshot-merge may help a lot when users try merging. in the - fs-layer union, users will use rsync(1). - - -Several characters/aspects of aufs ----------------------------------------------------------------------- - -Aufs has several characters or aspects. -1. a filesystem, callee of VFS helper -2. sub-VFS, caller of VFS helper for branches -3. a virtual filesystem which maintains persistent inode number -4. reader/writer of files on branches such like an application - -1. Callee of VFS Helper -As an ordinary linux filesystem, aufs is a callee of VFS. For instance, -unlink(2) from an application reaches sys_unlink() kernel function and -then vfs_unlink() is called. vfs_unlink() is one of VFS helper and it -calls filesystem specific unlink operation. Actually aufs implements the -unlink operation but it behaves like a redirector. - -2. Caller of VFS Helper for Branches -aufs_unlink() passes the unlink request to the branch filesystem as if -it were called from VFS. So the called unlink operation of the branch -filesystem acts as usual. As a caller of VFS helper, aufs should handle -every necessary pre/post operation for the branch filesystem. -- acquire the lock for the parent dir on a branch -- lookup in a branch -- revalidate dentry on a branch -- mnt_want_write() for a branch -- vfs_unlink() for a branch -- mnt_drop_write() for a branch -- release the lock on a branch - -3. Persistent Inode Number -One of the most important issue for a filesystem is to maintain inode -numbers. This is particularly important to support exporting a -filesystem via NFS. Aufs is a virtual filesystem which doesn't have a -backend block device for its own. But some storage is necessary to -maintain inode number. It may be a large space and may not suit to keep -in memory. Aufs rents some space from its first writable branch -filesystem (by default) and creates file(s) on it. These files are -created by aufs internally and removed soon (currently) keeping opened. -Note: Because these files are removed, they are totally gone after - unmounting aufs. It means the inode numbers are not persistent - across unmount or reboot. I have a plan to make them really - persistent which will be important for aufs on NFS server. - -4. Read/Write Files Internally (copy-on-write) -Because a branch can be readonly, when you write a file on it, aufs will -"copy-up" it to the upper writable branch internally. And then write the -originally requested thing to the file. Generally kernel doesn't -open/read/write file actively. In aufs, even a single write may cause a -internal "file copy". This behaviour is very similar to cp(1) command. - -Some people may think it is better to pass such work to user space -helper, instead of doing in kernel space. Actually I am still thinking -about it. But currently I have implemented it in kernel space. diff --git a/Documentation/filesystems/aufs/design/02struct.txt b/Documentation/filesystems/aufs/design/02struct.txt deleted file mode 100644 index 46b6fca69dbb55..00000000000000 --- a/Documentation/filesystems/aufs/design/02struct.txt +++ /dev/null @@ -1,251 +0,0 @@ - -# Copyright (C) 2005-2014 Junjiro R. Okajima -# -# 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, see . - -Basic Aufs Internal Structure - -Superblock/Inode/Dentry/File Objects ----------------------------------------------------------------------- -As like an ordinary filesystem, aufs has its own -superblock/inode/dentry/file objects. All these objects have a -dynamically allocated array and store the same kind of pointers to the -lower filesystem, branch. -For example, when you build a union with one readwrite branch and one -readonly, mounted /au, /rw and /ro respectively. -- /au = /rw + /ro -- /ro/fileA exists but /rw/fileA - -Aufs lookup operation finds /ro/fileA and gets dentry for that. These -pointers are stored in a aufs dentry. The array in aufs dentry will be, -- [0] = NULL -- [1] = /ro/fileA - -This style of an array is essentially same to the aufs -superblock/inode/dentry/file objects. - -Because aufs supports manipulating branches, ie. add/delete/change -dynamically, these objects has its own generation. When branches are -changed, the generation in aufs superblock is incremented. And a -generation in other object are compared when it is accessed. -When a generation in other objects are obsoleted, aufs refreshes the -internal array. - - -Superblock ----------------------------------------------------------------------- -Additionally aufs superblock has some data for policies to select one -among multiple writable branches, XIB files, pseudo-links and kobject. -See below in detail. -About the policies which supports copy-down a directory, see policy.txt -too. - - -Branch and XINO(External Inode Number Translation Table) ----------------------------------------------------------------------- -Every branch has its own xino (external inode number translation table) -file. The xino file is created and unlinked by aufs internally. When two -members of a union exist on the same filesystem, they share the single -xino file. -The struct of a xino file is simple, just a sequence of aufs inode -numbers which is indexed by the lower inode number. -In the above sample, assume the inode number of /ro/fileA is i111 and -aufs assigns the inode number i999 for fileA. Then aufs writes 999 as -4(8) bytes at 111 * 4(8) bytes offset in the xino file. - -When the inode numbers are not contiguous, the xino file will be sparse -which has a hole in it and doesn't consume as much disk space as it -might appear. If your branch filesystem consumes disk space for such -holes, then you should specify 'xino=' option at mounting aufs. - -Also a writable branch has three kinds of "whiteout bases". All these -are existed when the branch is joined to aufs and the names are -whiteout-ed doubly, so that users will never see their names in aufs -hierarchy. -1. a regular file which will be linked to all whiteouts. -2. a directory to store a pseudo-link. -3. a directory to store an "orphan-ed" file temporary. - -1. Whiteout Base - When you remove a file on a readonly branch, aufs handles it as a - logical deletion and creates a whiteout on the upper writable branch - as a hardlink of this file in order not to consume inode on the - writable branch. -2. Pseudo-link Dir - See below, Pseudo-link. -3. Step-Parent Dir - When "fileC" exists on the lower readonly branch only and it is - opened and removed with its parent dir, and then user writes - something into it, then aufs copies-up fileC to this - directory. Because there is no other dir to store fileC. After - creating a file under this dir, the file is unlinked. - -Because aufs supports manipulating branches, ie. add/delete/change -dynamically, a branch has its own id. When the branch order changes, aufs -finds the new index by searching the branch id. - - -Pseudo-link ----------------------------------------------------------------------- -Assume "fileA" exists on the lower readonly branch only and it is -hardlinked to "fileB" on the branch. When you write something to fileA, -aufs copies-up it to the upper writable branch. Additionally aufs -creates a hardlink under the Pseudo-link Directory of the writable -branch. The inode of a pseudo-link is kept in aufs super_block as a -simple list. If fileB is read after unlinking fileA, aufs returns -filedata from the pseudo-link instead of the lower readonly -branch. Because the pseudo-link is based upon the inode, to keep the -inode number by xino (see above) is important. - -All the hardlinks under the Pseudo-link Directory of the writable branch -should be restored in a proper location later. Aufs provides a utility -to do this. The userspace helpers executed at remounting and unmounting -aufs by default. -During this utility is running, it puts aufs into the pseudo-link -maintenance mode. In this mode, only the process which began the -maintenance mode (and its child processes) is allowed to operate in -aufs. Some other processes which are not related to the pseudo-link will -be allowed to run too, but the rest have to return an error or wait -until the maintenance mode ends. If a process already acquires an inode -mutex (in VFS), it has to return an error. - - -XIB(external inode number bitmap) ----------------------------------------------------------------------- -Addition to the xino file per a branch, aufs has an external inode number -bitmap in a superblock object. It is also a file such like a xino file. -It is a simple bitmap to mark whether the aufs inode number is in-use or -not. -To reduce the file I/O, aufs prepares a single memory page to cache xib. - -Aufs implements a feature to truncate/refresh both of xino and xib to -reduce the number of consumed disk blocks for these files. - - -Virtual or Vertical Dir, and Readdir in Userspace ----------------------------------------------------------------------- -In order to support multiple layers (branches), aufs readdir operation -constructs a virtual dir block on memory. For readdir, aufs calls -vfs_readdir() internally for each dir on branches, merges their entries -with eliminating the whiteout-ed ones, and sets it to file (dir) -object. So the file object has its entry list until it is closed. The -entry list will be updated when the file position is zero and becomes -old. This decision is made in aufs automatically. - -The dynamically allocated memory block for the name of entries has a -unit of 512 bytes (by default) and stores the names contiguously (no -padding). Another block for each entry is handled by kmem_cache too. -During building dir blocks, aufs creates hash list and judging whether -the entry is whiteouted by its upper branch or already listed. -The merged result is cached in the corresponding inode object and -maintained by a customizable life-time option. - -Some people may call it can be a security hole or invite DoS attack -since the opened and once readdir-ed dir (file object) holds its entry -list and becomes a pressure for system memory. But I'd say it is similar -to files under /proc or /sys. The virtual files in them also holds a -memory page (generally) while they are opened. When an idea to reduce -memory for them is introduced, it will be applied to aufs too. -For those who really hate this situation, I've developed readdir(3) -library which operates this merging in userspace. You just need to set -LD_PRELOAD environment variable, and aufs will not consume no memory in -kernel space for readdir(3). - - -Workqueue ----------------------------------------------------------------------- -Aufs sometimes requires privilege access to a branch. For instance, -in copy-up/down operation. When a user process is going to make changes -to a file which exists in the lower readonly branch only, and the mode -of one of ancestor directories may not be writable by a user -process. Here aufs copy-up the file with its ancestors and they may -require privilege to set its owner/group/mode/etc. -This is a typical case of a application character of aufs (see -Introduction). - -Aufs uses workqueue synchronously for this case. It creates its own -workqueue. The workqueue is a kernel thread and has privilege. Aufs -passes the request to call mkdir or write (for example), and wait for -its completion. This approach solves a problem of a signal handler -simply. -If aufs didn't adopt the workqueue and changed the privilege of the -process, and if the mkdir/write call arises SIGXFSZ or other signal, -then the user process might gain a privilege or the generated core file -was owned by a superuser. - -Also aufs uses the system global workqueue ("events" kernel thread) too -for asynchronous tasks, such like handling inotify/fsnotify, re-creating a -whiteout base and etc. This is unrelated to a privilege. -Most of aufs operation tries acquiring a rw_semaphore for aufs -superblock at the beginning, at the same time waits for the completion -of all queued asynchronous tasks. - - -Whiteout ----------------------------------------------------------------------- -The whiteout in aufs is very similar to Unionfs's. That is represented -by its filename. UnionMount takes an approach of a file mode, but I am -afraid several utilities (find(1) or something) will have to support it. - -Basically the whiteout represents "logical deletion" which stops aufs to -lookup further, but also it represents "dir is opaque" which also stop -lookup. - -In aufs, rmdir(2) and rename(2) for dir uses whiteout alternatively. -In order to make several functions in a single systemcall to be -revertible, aufs adopts an approach to rename a directory to a temporary -unique whiteouted name. -For example, in rename(2) dir where the target dir already existed, aufs -renames the target dir to a temporary unique whiteouted name before the -actual rename on a branch and then handles other actions (make it opaque, -update the attributes, etc). If an error happens in these actions, aufs -simply renames the whiteouted name back and returns an error. If all are -succeeded, aufs registers a function to remove the whiteouted unique -temporary name completely and asynchronously to the system global -workqueue. - - -Copy-up ----------------------------------------------------------------------- -It is a well-known feature or concept. -When user modifies a file on a readonly branch, aufs operate "copy-up" -internally and makes change to the new file on the upper writable branch. -When the trigger systemcall does not update the timestamps of the parent -dir, aufs reverts it after copy-up. - - -Move-down (aufs3.9 and later) ----------------------------------------------------------------------- -"Copy-up" is one of the essential feature in aufs. It copies a file from -the lower readonly branch to the upper writable branch when a user -changes something about the file. -"Move-down" is an opposite action of copy-up. Basically this action is -ran manually instead of automatically and internally. -For desgin and implementation, aufs has to consider these issues. -- whiteout for the file may exist on the lower branch. -- ancestor directories may not exist on the lower branch. -- diropq for the ancestor directories may exist on the upper branch. -- free space on the lower branch will reduce. -- another access to the file may happen during moving-down, including - UDBA. -- the file should not be hard-linked nor pseudo-linked. they should be - handled by auplink utility later. - -Sometimes users want to move-down a file from the upper writable branch -to the lower readonly or writable branch. For instance, -- the free space of the upper writable branch is going to run out. -- create a new intermediate branch between the upper and lower branch. -- etc. - -For this purpose, use "aumvdown" command in aufs-util.git. diff --git a/Documentation/filesystems/aufs/design/03lookup.txt b/Documentation/filesystems/aufs/design/03lookup.txt deleted file mode 100644 index b35365efb179a0..00000000000000 --- a/Documentation/filesystems/aufs/design/03lookup.txt +++ /dev/null @@ -1,133 +0,0 @@ - -# Copyright (C) 2005-2014 Junjiro R. Okajima -# -# 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, see . - -Lookup in a Branch ----------------------------------------------------------------------- -Since aufs has a character of sub-VFS (see Introduction), it operates -lookup for branches as VFS does. It may be a heavy work. Generally -speaking struct nameidata is a bigger structure and includes many -information. But almost all lookup operation in aufs is the simplest -case, ie. lookup only an entry directly connected to its parent. Digging -down the directory hierarchy is unnecessary. - -VFS has a function lookup_one_len() for that use, but it is not usable -for a branch filesystem which requires struct nameidata. So aufs -implements a simple lookup wrapper function. When a branch filesystem -allows NULL as nameidata, it calls lookup_one_len(). Otherwise it builds -a simplest nameidata and calls lookup_hash(). -Here aufs applies "a principle in NFSD", ie. if the filesystem supports -NFS-export, then it has to support NULL as a nameidata parameter for -->create(), ->lookup() and ->d_revalidate(). So the lookup wrapper in -aufs tests if ->s_export_op in the branch is NULL or not. - -When a branch is a remote filesystem, aufs basically trusts its -->d_revalidate(), also aufs forces the hardest revalidate tests for -them. -For d_revalidate, aufs implements three levels of revalidate tests. See -"Revalidate Dentry and UDBA" in detail. - - -Test Only the Highest One for the Directory Permission (dirperm1 option) ----------------------------------------------------------------------- -Let's try case study. -- aufs has two branches, upper readwrite and lower readonly. - /au = /rw + /ro -- "dirA" exists under /ro, but /rw. and its mode is 0700. -- user invoked "chmod a+rx /au/dirA" -- the internal copy-up is activated and "/rw/dirA" is created and its - permission bits are set to world readble. -- then "/au/dirA" becomes world readable? - -In this case, /ro/dirA is still 0700 since it exists in readonly branch, -or it may be a natively readonly filesystem. If aufs respects the lower -branch, it should not respond readdir request from other users. But user -allowed it by chmod. Should really aufs rejects showing the entries -under /ro/dirA? - -To be honest, I don't have a best solution for this case. So aufs -implements 'dirperm1' and 'nodirperm1' and leave it to users. -When dirperm1 is specified, aufs checks only the highest one for the -directory permission, and shows the entries. Otherwise, as usual, checks -every dir existing on all branches and rejects the request. - -As a side effect, dirperm1 option improves the performance of aufs -because the number of permission check is reduced when the number of -branch is many. - - -Loopback Mount ----------------------------------------------------------------------- -Basically aufs supports any type of filesystem and block device for a -branch (actually there are some exceptions). But it is prohibited to add -a loopback mounted one whose backend file exists in a filesystem which is -already added to aufs. The reason is to protect aufs from a recursive -lookup. If it was allowed, the aufs lookup operation might re-enter a -lookup for the loopback mounted branch in the same context, and will -cause a deadlock. - - -Revalidate Dentry and UDBA (User's Direct Branch Access) ----------------------------------------------------------------------- -Generally VFS helpers re-validate a dentry as a part of lookup. -0. digging down the directory hierarchy. -1. lock the parent dir by its i_mutex. -2. lookup the final (child) entry. -3. revalidate it. -4. call the actual operation (create, unlink, etc.) -5. unlock the parent dir - -If the filesystem implements its ->d_revalidate() (step 3), then it is -called. Actually aufs implements it and checks the dentry on a branch is -still valid. -But it is not enough. Because aufs has to release the lock for the -parent dir on a branch at the end of ->lookup() (step 2) and -->d_revalidate() (step 3) while the i_mutex of the aufs dir is still -held by VFS. -If the file on a branch is changed directly, eg. bypassing aufs, after -aufs released the lock, then the subsequent operation may cause -something unpleasant result. - -This situation is a result of VFS architecture, ->lookup() and -->d_revalidate() is separated. But I never say it is wrong. It is a good -design from VFS's point of view. It is just not suitable for sub-VFS -character in aufs. - -Aufs supports such case by three level of revalidation which is -selectable by user. -1. Simple Revalidate - Addition to the native flow in VFS's, confirm the child-parent - relationship on the branch just after locking the parent dir on the - branch in the "actual operation" (step 4). When this validation - fails, aufs returns EBUSY. ->d_revalidate() (step 3) in aufs still - checks the validation of the dentry on branches. -2. Monitor Changes Internally by Inotify/Fsnotify - Addition to above, in the "actual operation" (step 4) aufs re-lookup - the dentry on the branch, and returns EBUSY if it finds different - dentry. - Additionally, aufs sets the inotify/fsnotify watch for every dir on branches - during it is in cache. When the event is notified, aufs registers a - function to kernel 'events' thread by schedule_work(). And the - function sets some special status to the cached aufs dentry and inode - private data. If they are not cached, then aufs has nothing to - do. When the same file is accessed through aufs (step 0-3) later, - aufs will detect the status and refresh all necessary data. - In this mode, aufs has to ignore the event which is fired by aufs - itself. -3. No Extra Validation - This is the simplest test and doesn't add any additional revalidation - test, and skip therevalidatin in step 4. It is useful and improves - aufs performance when system surely hide the aufs branches from user, - by over-mounting something (or another method). diff --git a/Documentation/filesystems/aufs/design/04branch.txt b/Documentation/filesystems/aufs/design/04branch.txt deleted file mode 100644 index 8033d0ee8006b4..00000000000000 --- a/Documentation/filesystems/aufs/design/04branch.txt +++ /dev/null @@ -1,75 +0,0 @@ - -# Copyright (C) 2005-2014 Junjiro R. Okajima -# -# 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, see . - -Branch Manipulation - -Since aufs supports dynamic branch manipulation, ie. add/remove a branch -and changing its permission/attribute, there are a lot of works to do. - - -Add a Branch ----------------------------------------------------------------------- -o Confirm the adding dir exists outside of aufs, including loopback - mount. -- and other various attributes... -o Initialize the xino file and whiteout bases if necessary. - See struct.txt. - -o Check the owner/group/mode of the directory - When the owner/group/mode of the adding directory differs from the - existing branch, aufs issues a warning because it may impose a - security risk. - For example, when a upper writable branch has a world writable empty - top directory, a malicious user can create any files on the writable - branch directly, like copy-up and modify manually. If something like - /etc/{passwd,shadow} exists on the lower readonly branch but the upper - writable branch, and the writable branch is world-writable, then a - malicious guy may create /etc/passwd on the writable branch directly - and the infected file will be valid in aufs. - I am afraid it can be a security issue, but nothing to do except - producing a warning. - - -Delete a Branch ----------------------------------------------------------------------- -o Confirm the deleting branch is not busy - To be general, there is one merit to adopt "remount" interface to - manipulate branches. It is to discard caches. At deleting a branch, - aufs checks the still cached (and connected) dentries and inodes. If - there are any, then they are all in-use. An inode without its - corresponding dentry can be alive alone (for example, inotify/fsnotify case). - - For the cached one, aufs checks whether the same named entry exists on - other branches. - If the cached one is a directory, because aufs provides a merged view - to users, as long as one dir is left on any branch aufs can show the - dir to users. In this case, the branch can be removed from aufs. - Otherwise aufs rejects deleting the branch. - - If any file on the deleting branch is opened by aufs, then aufs - rejects deleting. - - -Modify the Permission of a Branch ----------------------------------------------------------------------- -o Re-initialize or remove the xino file and whiteout bases if necessary. - See struct.txt. - -o rw --> ro: Confirm the modifying branch is not busy - Aufs rejects the request if any of these conditions are true. - - a file on the branch is mmap-ed. - - a regular file on the branch is opened for write and there is no - same named entry on the upper branch. diff --git a/Documentation/filesystems/aufs/design/05wbr_policy.txt b/Documentation/filesystems/aufs/design/05wbr_policy.txt deleted file mode 100644 index 9f135a017b38c3..00000000000000 --- a/Documentation/filesystems/aufs/design/05wbr_policy.txt +++ /dev/null @@ -1,64 +0,0 @@ - -# Copyright (C) 2005-2014 Junjiro R. Okajima -# -# 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, see . - -Policies to Select One among Multiple Writable Branches ----------------------------------------------------------------------- -When the number of writable branch is more than one, aufs has to decide -the target branch for file creation or copy-up. By default, the highest -writable branch which has the parent (or ancestor) dir of the target -file is chosen (top-down-parent policy). -By user's request, aufs implements some other policies to select the -writable branch, for file creation two policies, round-robin and -most-free-space policies. For copy-up three policies, top-down-parent, -bottom-up-parent and bottom-up policies. - -As expected, the round-robin policy selects the branch in circular. When -you have two writable branches and creates 10 new files, 5 files will be -created for each branch. mkdir(2) systemcall is an exception. When you -create 10 new directories, all will be created on the same branch. -And the most-free-space policy selects the one which has most free -space among the writable branches. The amount of free space will be -checked by aufs internally, and users can specify its time interval. - -The policies for copy-up is more simple, -top-down-parent is equivalent to the same named on in create policy, -bottom-up-parent selects the writable branch where the parent dir -exists and the nearest upper one from the copyup-source, -bottom-up selects the nearest upper writable branch from the -copyup-source, regardless the existence of the parent dir. - -There are some rules or exceptions to apply these policies. -- If there is a readonly branch above the policy-selected branch and - the parent dir is marked as opaque (a variation of whiteout), or the - target (creating) file is whiteout-ed on the upper readonly branch, - then the result of the policy is ignored and the target file will be - created on the nearest upper writable branch than the readonly branch. -- If there is a writable branch above the policy-selected branch and - the parent dir is marked as opaque or the target file is whiteouted - on the branch, then the result of the policy is ignored and the target - file will be created on the highest one among the upper writable - branches who has diropq or whiteout. In case of whiteout, aufs removes - it as usual. -- link(2) and rename(2) systemcalls are exceptions in every policy. - They try selecting the branch where the source exists as possible - since copyup a large file will take long time. If it can't be, - ie. the branch where the source exists is readonly, then they will - follow the copyup policy. -- There is an exception for rename(2) when the target exists. - If the rename target exists, aufs compares the index of the branches - where the source and the target exists and selects the higher - one. If the selected branch is readonly, then aufs follows the - copyup policy. diff --git a/Documentation/filesystems/aufs/design/06fhsm.txt b/Documentation/filesystems/aufs/design/06fhsm.txt deleted file mode 100644 index 69cdf17487fbf7..00000000000000 --- a/Documentation/filesystems/aufs/design/06fhsm.txt +++ /dev/null @@ -1,120 +0,0 @@ - -# Copyright (C) 2011-2014 Junjiro R. Okajima -# -# 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 - - -File-based Hierarchical Storage Management (FHSM) ----------------------------------------------------------------------- -Hierarchical Storage Management (or HSM) is a well-known feature in the -storage world. Aufs provides this feature as file-based with multiple -writable branches, based upon the principle of "Colder-Lower". -Here the word "colder" means that the less used files, and "lower" means -that the position in the order of the stacked branches. -These multiple writable branches are prioritized, ie. the topmost one -should be the fastest drive and be used heavily. - -o Characters in aufs FHSM story -- aufs itself and a new branch attribute. -- a new ioctl interface to move-down and to establish a connection with - the daemon ("move-down" is a converse of "copy-up"). -- userspace tool and daemon. - -The userspace daemon establishes a connection with aufs and waits for -the notification. The notified information is very similar to struct -statfs containing the number of consumed blocks and inodes. -When the consumed blocks/inodes of a branch exceeds the user-specified -upper watermark, the daemon activates its move-down process until the -consumed blocks/inodes reaches the user-specified lower watermark. - -The actual move-down is done by aufs based upon the request from -user-space since we need to maintain the inode number and the internal -pointer arrays in aufs. - -Currently aufs FHSM handles the regular files only. Additionally they -must not be hard-linked nor pseudo-linked. - - -o Cowork of aufs and the user-space daemon - During the userspace daemon established the connection, aufs sends a - small notification to it whenever aufs writes something into the - writable branch. But it may cost high since aufs issues statfs(2) - internally. So user can specify a new option to cache the - info. Actually the notification is controlled by these factors. - + the specified cache time. - + classified as "force" by aufs internally. - Until the specified time expires, aufs doesn't send the info - except the forced cases. When aufs decide forcing, the info is always - notified to userspace. - For example, the number of free inodes is generally large enough and - the shortage of it happens rarely. So aufs doesn't force the - notification when creating a new file, directory and others. This is - the typical case which aufs doesn't force. - When aufs writes the actual filedata and the files consumes any of new - blocks, the aufs forces notifying. - - -o Interfaces in aufs -- New branch attribute. - + fhsm - Specifies that the branch is managed by FHSM feature. In other word, - participant in the FHSM. - When nofhsm is set to the branch, it will not be the source/target - branch of the move-down operation. This attribute is set - independently from coo and moo attributes, and if you want full - FHSM, you should specify them as well. -- New mount option. - + fhsm_sec - Specifies a second to suppress many less important info to be - notified. -- New ioctl. - + AUFS_CTL_FHSM_FD - create a new file descriptor which userspace can read the notification - (a subset of struct statfs) from aufs. -- Module parameter 'brs' - It has to be set to 1. Otherwise the new mount option 'fhsm' will not - be set. -- mount helpers /sbin/mount.aufs and /sbin/umount.aufs - When there are two or more branches with fhsm attributes, - /sbin/mount.aufs invokes the user-space daemon and /sbin/umount.aufs - terminates it. As a result of remounting and branch-manipulation, the - number of branches with fhsm attribute can be one. In this case, - /sbin/mount.aufs will terminate the user-space daemon. - - -Finally the operation is done as these steps in kernel-space. -- make sure that, - + no one else is using the file. - + the file is not hard-linked. - + the file is not pseudo-linked. - + the file is a regular file. - + the parent dir is not opaqued. -- find the target writable branch. -- make sure the file is not whiteout-ed by the upper (than the target) - branch. -- make the parent dir on the target branch. -- mutex lock the inode on the branch. -- unlink the whiteout on the target branch (if exists). -- lookup and create the whiteout-ed temporary name on the target branch. -- copy the file as the whiteout-ed temporary name on the target branch. -- rename the whiteout-ed temporary name to the original name. -- unlink the file on the source branch. -- maintain the internal pointer array and the external inode number - table (XINO). -- maintain the timestamps and other attributes of the parent dir and the - file. - -And of course, in every step, an error may happen. So the operation -should restore the original file state after an error happens. diff --git a/Documentation/filesystems/aufs/design/06mmap.txt b/Documentation/filesystems/aufs/design/06mmap.txt deleted file mode 100644 index 8346545246cc6a..00000000000000 --- a/Documentation/filesystems/aufs/design/06mmap.txt +++ /dev/null @@ -1,46 +0,0 @@ - -# Copyright (C) 2005-2014 Junjiro R. Okajima -# -# 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, see . - -mmap(2) -- File Memory Mapping ----------------------------------------------------------------------- -In aufs, the file-mapped pages are handled by a branch fs directly, no -interaction with aufs. It means aufs_mmap() calls the branch fs's -->mmap(). -This approach is simple and good, but there is one problem. -Under /proc, several entries show the mmap-ped files by its path (with -device and inode number), and the printed path will be the path on the -branch fs's instead of virtual aufs's. -This is not a problem in most cases, but some utilities lsof(1) (and its -user) may expect the path on aufs. - -To address this issue, aufs adds a new member called vm_prfile in struct -vm_area_struct (and struct vm_region). The original vm_file points to -the file on the branch fs in order to handle everything correctly as -usual. The new vm_prfile points to a virtual file in aufs, and the -show-functions in procfs refers to vm_prfile if it is set. -Also we need to maintain several other places where touching vm_file -such like -- fork()/clone() copies vma and the reference count of vm_file is - incremented. -- merging vma maintains the ref count too. - -This is not a good approach. It just faking the printed path. But it -leaves all behaviour around f_mapping unchanged. This is surely an -advantage. -Actually aufs had adopted another complicated approach which calls -generic_file_mmap() and handles struct vm_operations_struct. In this -approach, aufs met a hard problem and I could not solve it without -switching the approach. diff --git a/Documentation/filesystems/aufs/design/06xattr.txt b/Documentation/filesystems/aufs/design/06xattr.txt deleted file mode 100644 index 1896cbaabf9ddd..00000000000000 --- a/Documentation/filesystems/aufs/design/06xattr.txt +++ /dev/null @@ -1,96 +0,0 @@ - -# Copyright (C) 2014 Junjiro R. Okajima -# -# 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 - - -Listing XATTR/EA and getting the value ----------------------------------------------------------------------- -For the inode standard attributes (owner, group, timestamps, etc.), aufs -shows the values from the topmost existing file. This behaviour is good -for the non-dir entreis since the bahaviour exactly matches the shown -information. But for the directories, aufs considers all the same named -entries on the lower branches. Which means, if one of the lower entry -rejects readdir call, then aufs returns an error even if the topmost -entry allows it. This behaviour is necessary to respect the branch fs's -security, but can make users confused since the user-visible standard -attributes don't match the behaviour. -To address this issue, aufs has a mount option called dirperm1 which -checks the permission for the topmost entry only, and ignores the lower -entry's permission. - -A similar issue can happen around XATTR. -getxattr(2) and listxattr(2) families behave as if dirperm1 option is -always set. Otherwise these very unpleasant situation can happen. -- listxattr(2) may return the duplicated entires. -- users may not be able to remove or reset the XATTR forever, - - -XATTR/EA support in the internal (copy,move)-(up,down) ----------------------------------------------------------------------- -Generally the extended attributes of inode are categorazied as these. -- "security" for LSM and capability. -- "system" for posix ACL, 'acl' mount option is required for the branch - fs generally. -- "trusted" for userspace, CAP_SYS_ADMIN is required. -- "user" for userspace, 'user_xattr' mount option is required for the - branch fs generally. - -Moreover there are some other categories. Aufs handles these rather -unpopular categories as the ordinary ones, ie. there is no special -condition nor exception. - -In copy-up, the support for XATTR on the dst branch may differ from the -src branch. In this case, the copy-up operation will get an error and -the original user operation which triggered the copy-up fails. It can -happen that even all copy-up will fail. -When both of src and dst branches support XATTR and if an error occurs -during copying XATTR, then the copy-up should fail obviously. That is a -good reason and aufs should return an error to userspace. But when only -the src branch support XATTR, aufs should not return an error. -For example, the src branch supports ACL but the dst branch doesn't -because the dst branch may natively un-support it or temporary -un-support it due to "noacl" mount option. Of course, the dst branch fs -may NOT return an error even if the XATTR is not supported. It is -totally up to the branch fs. - -Anyway when the aufs internal copy-up gets an error from the dst branch -fs, then aufs tries removing the just copied entry and returns the error -to the userspace. The worst case of this situation will be all copy-up -will fail. - -For the copy-up operation, there two basic approaches. -- copy the specified XATTR only (by category above), and return the - error if it happens inconditionally. -- copy all XATTR, and ignore the error on the specified category only. - -In order to support XATTR and to implement the correct behaviour, aufs -chooses the latter approach and introduces some attributes for its -branch, "icexsec", "icexsys", "icextr", "icexusr", and "icexoth". -They correspond to the XATTR namespaces (see above). Additionally, to be -convenient, "icex" is also provided which means all "ix*" attributes are -set. - -The meaning of these attributes is to ignore the error from setting -XATTR on that branch. -Note that aufs tries copying all XATTR unconditionally, and ignores the -error from the dst branch according to the specified attributes. - -Some XATTR may have its default value. The default value may come from -the parent dir or the environment. If the default value is set at the -file creating-time, it will be overwritten by copy-up. -Some contradiction may happen I am afraid. -Do we need another attribute to stop copying XATTR? I am unsure. For -now, aufs implements the branch attributes to ignore the error. diff --git a/Documentation/filesystems/aufs/design/07export.txt b/Documentation/filesystems/aufs/design/07export.txt deleted file mode 100644 index 8144383d5f5b71..00000000000000 --- a/Documentation/filesystems/aufs/design/07export.txt +++ /dev/null @@ -1,58 +0,0 @@ - -# Copyright (C) 2005-2014 Junjiro R. Okajima -# -# 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, see . - -Export Aufs via NFS ----------------------------------------------------------------------- -Here is an approach. -- like xino/xib, add a new file 'xigen' which stores aufs inode - generation. -- iget_locked(): initialize aufs inode generation for a new inode, and - store it in xigen file. -- destroy_inode(): increment aufs inode generation and store it in xigen - file. it is necessary even if it is not unlinked, because any data of - inode may be changed by UDBA. -- encode_fh(): for a root dir, simply return FILEID_ROOT. otherwise - build file handle by - + branch id (4 bytes) - + superblock generation (4 bytes) - + inode number (4 or 8 bytes) - + parent dir inode number (4 or 8 bytes) - + inode generation (4 bytes)) - + return value of exportfs_encode_fh() for the parent on a branch (4 - bytes) - + file handle for a branch (by exportfs_encode_fh()) -- fh_to_dentry(): - + find the index of a branch from its id in handle, and check it is - still exist in aufs. - + 1st level: get the inode number from handle and search it in cache. - + 2nd level: if not found, get the parent inode number from handle and - search it in cache. and then open the parent dir, find the matching - inode number by vfs_readdir() and get its name, and call - lookup_one_len() for the target dentry. - + 3rd level: if the parent dir is not cached, call - exportfs_decode_fh() for a branch and get the parent on a branch, - build a pathname of it, convert it a pathname in aufs, call - path_lookup(). now aufs gets a parent dir dentry, then handle it as - the 2nd level. - + to open the dir, aufs needs struct vfsmount. aufs keeps vfsmount - for every branch, but not itself. to get this, (currently) aufs - searches in current->nsproxy->mnt_ns list. it may not be a good - idea, but I didn't get other approach. - + test the generation of the gotten inode. -- every inode operation: they may get EBUSY due to UDBA. in this case, - convert it into ESTALE for NFSD. -- readdir(): call lockdep_on/off() because filldir in NFSD calls - lookup_one_len(), vfs_getattr(), encode_fh() and others. diff --git a/Documentation/filesystems/aufs/design/08shwh.txt b/Documentation/filesystems/aufs/design/08shwh.txt deleted file mode 100644 index aeca324eb4b1fb..00000000000000 --- a/Documentation/filesystems/aufs/design/08shwh.txt +++ /dev/null @@ -1,52 +0,0 @@ - -# Copyright (C) 2005-2014 Junjiro R. Okajima -# -# 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, see . - -Show Whiteout Mode (shwh) ----------------------------------------------------------------------- -Generally aufs hides the name of whiteouts. But in some cases, to show -them is very useful for users. For instance, creating a new middle layer -(branch) by merging existing layers. - -(borrowing aufs1 HOW-TO from a user, Michael Towers) -When you have three branches, -- Bottom: 'system', squashfs (underlying base system), read-only -- Middle: 'mods', squashfs, read-only -- Top: 'overlay', ram (tmpfs), read-write - -The top layer is loaded at boot time and saved at shutdown, to preserve -the changes made to the system during the session. -When larger changes have been made, or smaller changes have accumulated, -the size of the saved top layer data grows. At this point, it would be -nice to be able to merge the two overlay branches ('mods' and 'overlay') -and rewrite the 'mods' squashfs, clearing the top layer and thus -restoring save and load speed. - -This merging is simplified by the use of another aufs mount, of just the -two overlay branches using the 'shwh' option. -# mount -t aufs -o ro,shwh,br:/livesys/overlay=ro+wh:/livesys/mods=rr+wh \ - aufs /livesys/merge_union - -A merged view of these two branches is then available at -/livesys/merge_union, and the new feature is that the whiteouts are -visible! -Note that in 'shwh' mode the aufs mount must be 'ro', which will disable -writing to all branches. Also the default mode for all branches is 'ro'. -It is now possible to save the combined contents of the two overlay -branches to a new squashfs, e.g.: -# mksquashfs /livesys/merge_union /path/to/newmods.squash - -This new squashfs archive can be stored on the boot device and the -initramfs will use it to replace the old one at the next boot. diff --git a/Documentation/filesystems/aufs/design/10dynop.txt b/Documentation/filesystems/aufs/design/10dynop.txt deleted file mode 100644 index 9091384b08e0d9..00000000000000 --- a/Documentation/filesystems/aufs/design/10dynop.txt +++ /dev/null @@ -1,46 +0,0 @@ - -# Copyright (C) 2010-2014 Junjiro R. Okajima -# -# 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, see . - -Dynamically customizable FS operations ----------------------------------------------------------------------- -Generally FS operations (struct inode_operations, struct -address_space_operations, struct file_operations, etc.) are defined as -"static const", but it never means that FS have only one set of -operation. Some FS have multiple sets of them. For instance, ext2 has -three sets, one for XIP, for NOBH, and for normal. -Since aufs overrides and redirects these operations, sometimes aufs has -to change its behaviour according to the branch FS type. More imporantly -VFS acts differently if a function (member in the struct) is set or -not. It means aufs should have several sets of operations and select one -among them according to the branch FS definition. - -In order to solve this problem and not to affect the behavour of VFS, -aufs defines these operations dynamically. For instance, aufs defines -aio_read function for struct file_operations, but it may not be set to -the file_operations. When the branch FS doesn't have it, aufs doesn't -set it to its file_operations while the function definition itself is -still alive. So the behaviour of io_submit(2) will not change, and it -will return an error when aio_read is not defined. - -The lifetime of these dynamically generated operation object is -maintained by aufs branch object. When the branch is removed from aufs, -the reference counter of the object is decremented. When it reaches -zero, the dynamically generated operation object will be freed. - -This approach is designed to support AIO (io_submit), Direcit I/O and -XIP mainly. -Currently this approach is applied to file_operations and -vm_operations_struct for regular files only. diff --git a/Documentation/filesystems/aufs/design/99plan.txt b/Documentation/filesystems/aufs/design/99plan.txt deleted file mode 100644 index 575096bf51f0ca..00000000000000 --- a/Documentation/filesystems/aufs/design/99plan.txt +++ /dev/null @@ -1,58 +0,0 @@ - -# Copyright (C) 2005-2014 Junjiro R. Okajima -# -# 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, see . - -Plan - -Restoring some features which was implemented in aufs1. -They were dropped in aufs2 in order to make source files simpler and -easier to be reviewed. - - -Being Another Aufs's Readonly Branch (robr) ----------------------------------------------------------------------- -Aufs1 allows aufs to be another aufs's readonly branch. -This feature was developed by a user's request. But it may not be used -currecnly. - - -Refresh the Opened File (refrof) ----------------------------------------------------------------------- -This option is implemented in aufs1 but incomplete. - -When user reads from a file, he expects to get its latest filedata -generally. If the file is removed and a new same named file is created, -the content he gets is unchanged, ie. the unlinked filedata. - -Let's try case study again. -- aufs has two branches. - /au = /rw + /ro -- "fileA" exists under /ro, but /rw. -- user opened "/au/fileA". -- he or someone else inserts a branch (/new) between /rw and /ro. - /au = /rw + /new + /ro -- the new branch has "fileA". -- user reads from the opened "fileA" -- which filedata should aufs return, from /ro or /new? - -Some people says it has to be "from /ro" and it is a semantics of Unix. -The others say it should be "from /new" because the file is not removed -and it is equivalent to the case of someone else modifies the file. - -Here again I don't have a best and final answer. I got an idea to -implement 'refrof' and 'norefrof' option. When 'refrof' (REFResh the -Opened File) is specified (by default), aufs returns the filedata from -/new. -Otherwise from /new. diff --git a/MAINTAINERS b/MAINTAINERS index 75518fe9ddf96d..48c748080c96ee 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1533,20 +1533,6 @@ F: include/linux/audit.h F: include/uapi/linux/audit.h F: kernel/audit* -AUFS (advanced multi layered unification filesystem) FILESYSTEM -M: "J. R. Okajima" -L: linux-unionfs@vger.kernel.org -L: aufs-users@lists.sourceforge.net (members only) -W: http://aufs.sourceforge.net -T: git://git.code.sf.net/p/aufs/aufs3-linux -T: git://github.com/sfjro/aufs3-linux.git -S: Supported -F: Documentation/filesystems/aufs/ -F: Documentation/ABI/testing/debugfs-aufs -F: Documentation/ABI/testing/sysfs-aufs -F: fs/aufs/ -F: include/uapi/linux/aufs_type.h - AUXILIARY DISPLAY DRIVERS M: Miguel Ojeda Sandonis W: http://miguelojeda.es/auxdisplay.htm diff --git a/arch/arm/configs/odroidxu3_defconfig b/arch/arm/configs/odroidxu3_defconfig index 179ee79e7564c7..4ab741675cf45a 100755 --- a/arch/arm/configs/odroidxu3_defconfig +++ b/arch/arm/configs/odroidxu3_defconfig @@ -110,16 +110,12 @@ CONFIG_LOG_BUF_SHIFT=17 CONFIG_CGROUPS=y CONFIG_CGROUP_DEBUG=y CONFIG_CGROUP_FREEZER=y -CONFIG_CGROUP_DEVICE=y -CONFIG_CPUSETS=y -CONFIG_PROC_PID_CPUSET=y +# CONFIG_CGROUP_DEVICE is not set +# CONFIG_CPUSETS is not set CONFIG_CGROUP_CPUACCT=y CONFIG_RESOURCE_COUNTERS=y -CONFIG_MEMCG=y -CONFIG_MEMCG_SWAP=y -CONFIG_MEMCG_SWAP_ENABLED=y -# CONFIG_MEMCG_KMEM is not set -CONFIG_CGROUP_PERF=y +# CONFIG_MEMCG is not set +# CONFIG_CGROUP_PERF is not set CONFIG_CGROUP_SCHED=y CONFIG_FAIR_GROUP_SCHED=y CONFIG_CFS_BANDWIDTH=y @@ -135,7 +131,6 @@ CONFIG_NET_NS=y CONFIG_UIDGID_CONVERTED=y CONFIG_UIDGID_STRICT_TYPE_CHECKS=y # CONFIG_SCHED_AUTOGROUP is not set -CONFIG_MM_OWNER=y # CONFIG_SYSFS_DEPRECATED is not set CONFIG_RELAY=y CONFIG_BLK_DEV_INITRD=y @@ -1705,7 +1700,7 @@ CONFIG_VT_CONSOLE_SLEEP=y CONFIG_HW_CONSOLE=y CONFIG_VT_HW_CONSOLE_BINDING=y CONFIG_UNIX98_PTYS=y -CONFIG_DEVPTS_MULTIPLE_INSTANCES=y +# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 # CONFIG_SERIAL_NONSTANDARD is not set @@ -3834,25 +3829,6 @@ CONFIG_F2FS_FS=m CONFIG_F2FS_STAT_FS=y CONFIG_F2FS_FS_XATTR=y CONFIG_F2FS_FS_POSIX_ACL=y -CONFIG_AUFS_FS=m -CONFIG_AUFS_BRANCH_MAX_127=y -# CONFIG_AUFS_BRANCH_MAX_511 is not set -# CONFIG_AUFS_BRANCH_MAX_1023 is not set -# CONFIG_AUFS_BRANCH_MAX_32767 is not set -CONFIG_AUFS_SBILIST=y -CONFIG_AUFS_HNOTIFY=y -CONFIG_AUFS_HFSNOTIFY=y -CONFIG_AUFS_EXPORT=y -CONFIG_AUFS_XATTR=y -CONFIG_AUFS_FHSM=y -CONFIG_AUFS_RDU=y -CONFIG_AUFS_SHWH=y -CONFIG_AUFS_BR_RAMFS=y -CONFIG_AUFS_BR_FUSE=y -CONFIG_AUFS_POLL=y -CONFIG_AUFS_BR_HFSPLUS=y -CONFIG_AUFS_BDEV_LOOP=y -# CONFIG_AUFS_DEBUG is not set CONFIG_NETWORK_FILESYSTEMS=y CONFIG_NFS_FS=m CONFIG_NFS_V2=m diff --git a/fs/Kconfig b/fs/Kconfig index 397b4736016892..c229f828eb012e 100644 --- a/fs/Kconfig +++ b/fs/Kconfig @@ -212,7 +212,6 @@ source "fs/ufs/Kconfig" source "fs/exofs/Kconfig" source "fs/f2fs/Kconfig" source "fs/efivarfs/Kconfig" -source "fs/aufs/Kconfig" endif # MISC_FILESYSTEMS diff --git a/fs/Makefile b/fs/Makefile index 4a57676050fc67..4fe6df3ec28fe5 100644 --- a/fs/Makefile +++ b/fs/Makefile @@ -126,4 +126,3 @@ obj-y += exofs/ # Multiple modules obj-$(CONFIG_CEPH_FS) += ceph/ obj-$(CONFIG_PSTORE) += pstore/ obj-$(CONFIG_EFIVAR_FS) += efivarfs/ -obj-$(CONFIG_AUFS_FS) += aufs/ diff --git a/fs/aufs/Kconfig b/fs/aufs/Kconfig deleted file mode 100644 index 63560ceda3a4bb..00000000000000 --- a/fs/aufs/Kconfig +++ /dev/null @@ -1,185 +0,0 @@ -config AUFS_FS - tristate "Aufs (Advanced multi layered unification filesystem) support" - help - Aufs is a stackable unification filesystem such as Unionfs, - which unifies several directories and provides a merged single - directory. - In the early days, aufs was entirely re-designed and - re-implemented Unionfs Version 1.x series. Introducing many - original ideas, approaches and improvements, it becomes totally - different from Unionfs while keeping the basic features. - -if AUFS_FS -choice - prompt "Maximum number of branches" - default AUFS_BRANCH_MAX_127 - help - Specifies the maximum number of branches (or member directories) - in a single aufs. The larger value consumes more system - resources and has a minor impact to performance. -config AUFS_BRANCH_MAX_127 - bool "127" - help - Specifies the maximum number of branches (or member directories) - in a single aufs. The larger value consumes more system - resources and has a minor impact to performance. -config AUFS_BRANCH_MAX_511 - bool "511" - help - Specifies the maximum number of branches (or member directories) - in a single aufs. The larger value consumes more system - resources and has a minor impact to performance. -config AUFS_BRANCH_MAX_1023 - bool "1023" - help - Specifies the maximum number of branches (or member directories) - in a single aufs. The larger value consumes more system - resources and has a minor impact to performance. -config AUFS_BRANCH_MAX_32767 - bool "32767" - help - Specifies the maximum number of branches (or member directories) - in a single aufs. The larger value consumes more system - resources and has a minor impact to performance. -endchoice - -config AUFS_SBILIST - bool - depends on AUFS_MAGIC_SYSRQ || PROC_FS - default y - help - Automatic configuration for internal use. - When aufs supports Magic SysRq or /proc, enabled automatically. - -config AUFS_HNOTIFY - bool "Detect direct branch access (bypassing aufs)" - help - If you want to modify files on branches directly, eg. bypassing aufs, - and want aufs to detect the changes of them fully, then enable this - option and use 'udba=notify' mount option. - Currently there is only one available configuration, "fsnotify". - It will have a negative impact to the performance. - See detail in aufs.5. - -choice - prompt "method" if AUFS_HNOTIFY - default AUFS_HFSNOTIFY -config AUFS_HFSNOTIFY - bool "fsnotify" - select FSNOTIFY -endchoice - -config AUFS_EXPORT - bool "NFS-exportable aufs" - depends on EXPORTFS - help - If you want to export your mounted aufs via NFS, then enable this - option. There are several requirements for this configuration. - See detail in aufs.5. - -config AUFS_INO_T_64 - bool - depends on AUFS_EXPORT - depends on 64BIT && !(ALPHA || S390) - default y - help - Automatic configuration for internal use. - /* typedef unsigned long/int __kernel_ino_t */ - /* alpha and s390x are int */ - -config AUFS_XATTR - bool "support for XATTR/EA (including Security Labels)" - help - If your branch fs supports XATTR/EA and you want to make them - available in aufs too, then enable this opsion and specify the - branch attributes for EA. - See detail in aufs.5. - -config AUFS_FHSM - bool "File-based Hierarchical Storage Management" - help - Hierarchical Storage Management (or HSM) is a well-known feature - in the storage world. Aufs provides this feature as file-based. - with multiple branches. - These multiple branches are prioritized, ie. the topmost one - should be the fastest drive and be used heavily. - -config AUFS_RDU - bool "Readdir in userspace" - help - Aufs has two methods to provide a merged view for a directory, - by a user-space library and by kernel-space natively. The latter - is always enabled but sometimes large and slow. - If you enable this option, install the library in aufs2-util - package, and set some environment variables for your readdir(3), - then the work will be handled in user-space which generally - shows better performance in most cases. - See detail in aufs.5. - -config AUFS_SHWH - bool "Show whiteouts" - help - If you want to make the whiteouts in aufs visible, then enable - this option and specify 'shwh' mount option. Although it may - sounds like philosophy or something, but in technically it - simply shows the name of whiteout with keeping its behaviour. - -config AUFS_BR_RAMFS - bool "Ramfs (initramfs/rootfs) as an aufs branch" - help - If you want to use ramfs as an aufs branch fs, then enable this - option. Generally tmpfs is recommended. - Aufs prohibited them to be a branch fs by default, because - initramfs becomes unusable after switch_root or something - generally. If you sets initramfs as an aufs branch and boot your - system by switch_root, you will meet a problem easily since the - files in initramfs may be inaccessible. - Unless you are going to use ramfs as an aufs branch fs without - switch_root or something, leave it N. - -config AUFS_BR_FUSE - bool "Fuse fs as an aufs branch" - depends on FUSE_FS - select AUFS_POLL - help - If you want to use fuse-based userspace filesystem as an aufs - branch fs, then enable this option. - It implements the internal poll(2) operation which is - implemented by fuse only (curretnly). - -config AUFS_POLL - bool - help - Automatic configuration for internal use. - -config AUFS_BR_HFSPLUS - bool "Hfsplus as an aufs branch" - depends on HFSPLUS_FS - default y - help - If you want to use hfsplus fs as an aufs branch fs, then enable - this option. This option introduces a small overhead at - copying-up a file on hfsplus. - -config AUFS_BDEV_LOOP - bool - depends on BLK_DEV_LOOP - default y - help - Automatic configuration for internal use. - Convert =[ym] into =y. - -config AUFS_DEBUG - bool "Debug aufs" - help - Enable this to compile aufs internal debug code. - It will have a negative impact to the performance. - -config AUFS_MAGIC_SYSRQ - bool - depends on AUFS_DEBUG && MAGIC_SYSRQ - default y - help - Automatic configuration for internal use. - When aufs supports Magic SysRq, enabled automatically. -endif diff --git a/fs/aufs/Makefile b/fs/aufs/Makefile deleted file mode 100644 index 22b56c0d2e3b56..00000000000000 --- a/fs/aufs/Makefile +++ /dev/null @@ -1,43 +0,0 @@ - -include ${src}/magic.mk -ifeq (${CONFIG_AUFS_FS},m) -include ${src}/conf.mk -endif --include ${src}/priv_def.mk - -# cf. include/linux/kernel.h -# enable pr_debug -ccflags-y += -DDEBUG -# sparse requires the full pathname -ifdef M -ccflags-y += -include ${M}/../../include/uapi/linux/aufs_type.h -else -ccflags-y += -include ${srctree}/include/uapi/linux/aufs_type.h -endif - -obj-$(CONFIG_AUFS_FS) += aufs.o -aufs-y := module.o sbinfo.o super.o branch.o xino.o sysaufs.o opts.o \ - wkq.o vfsub.o dcsub.o \ - cpup.o whout.o wbr_policy.o \ - dinfo.o dentry.o \ - dynop.o \ - finfo.o file.o f_op.o \ - dir.o vdir.o \ - iinfo.o inode.o i_op.o i_op_add.o i_op_del.o i_op_ren.o \ - mvdown.o ioctl.o - -# all are boolean -aufs-$(CONFIG_PROC_FS) += procfs.o plink.o -aufs-$(CONFIG_SYSFS) += sysfs.o -aufs-$(CONFIG_DEBUG_FS) += dbgaufs.o -aufs-$(CONFIG_AUFS_BDEV_LOOP) += loop.o -aufs-$(CONFIG_AUFS_HNOTIFY) += hnotify.o -aufs-$(CONFIG_AUFS_HFSNOTIFY) += hfsnotify.o -aufs-$(CONFIG_AUFS_EXPORT) += export.o -aufs-$(CONFIG_AUFS_XATTR) += xattr.o -aufs-$(CONFIG_AUFS_FHSM) += fhsm.o -aufs-$(CONFIG_AUFS_POLL) += poll.o -aufs-$(CONFIG_AUFS_RDU) += rdu.o -aufs-$(CONFIG_AUFS_BR_HFSPLUS) += hfsplus.o -aufs-$(CONFIG_AUFS_DEBUG) += debug.o -aufs-$(CONFIG_AUFS_MAGIC_SYSRQ) += sysrq.o diff --git a/fs/aufs/aufs.h b/fs/aufs/aufs.h deleted file mode 100644 index bba08f867c0baa..00000000000000 --- a/fs/aufs/aufs.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * all header files - */ - -#ifndef __AUFS_H__ -#define __AUFS_H__ - -#ifdef __KERNEL__ - -#define AuStub(type, name, body, ...) \ - static inline type name(__VA_ARGS__) { body; } - -#define AuStubVoid(name, ...) \ - AuStub(void, name, , __VA_ARGS__) -#define AuStubInt0(name, ...) \ - AuStub(int, name, return 0, __VA_ARGS__) - -#include "debug.h" - -#include "branch.h" -#include "cpup.h" -#include "dcsub.h" -#include "dbgaufs.h" -#include "dentry.h" -#include "dir.h" -#include "dynop.h" -#include "file.h" -#include "fstype.h" -#include "inode.h" -#include "loop.h" -#include "module.h" -#include "opts.h" -#include "rwsem.h" -#include "spl.h" -#include "super.h" -#include "sysaufs.h" -#include "vfsub.h" -#include "whout.h" -#include "wkq.h" - -#endif /* __KERNEL__ */ -#endif /* __AUFS_H__ */ diff --git a/fs/aufs/branch.c b/fs/aufs/branch.c deleted file mode 100644 index 1e6cfccd30ada6..00000000000000 --- a/fs/aufs/branch.c +++ /dev/null @@ -1,1436 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * branch management - */ - -#include -#include -#include "aufs.h" - -/* - * free a single branch - */ - -/* prohibit rmdir to the root of the branch */ -/* todo: another new flag? */ -static void au_br_dflags_force(struct au_branch *br) -{ - struct dentry *h_dentry; - - h_dentry = au_br_dentry(br); - spin_lock(&h_dentry->d_lock); - br->br_dflags = h_dentry->d_flags & DCACHE_MOUNTED; - h_dentry->d_flags |= DCACHE_MOUNTED; - spin_unlock(&h_dentry->d_lock); -} - -/* restore its d_flags */ -static void au_br_dflags_restore(struct au_branch *br) -{ - struct dentry *h_dentry; - - if (br->br_dflags) - return; - - h_dentry = au_br_dentry(br); - spin_lock(&h_dentry->d_lock); - h_dentry->d_flags &= ~DCACHE_MOUNTED; - spin_unlock(&h_dentry->d_lock); -} - -static void au_br_do_free(struct au_branch *br) -{ - int i; - struct au_wbr *wbr; - struct au_dykey **key; - - au_hnotify_fin_br(br); - - if (br->br_xino.xi_file) - fput(br->br_xino.xi_file); - mutex_destroy(&br->br_xino.xi_nondir_mtx); - - AuDebugOn(atomic_read(&br->br_count)); - - wbr = br->br_wbr; - if (wbr) { - for (i = 0; i < AuBrWh_Last; i++) - dput(wbr->wbr_wh[i]); - AuDebugOn(atomic_read(&wbr->wbr_wh_running)); - AuRwDestroy(&wbr->wbr_wh_rwsem); - } - - if (br->br_fhsm) { - au_br_fhsm_fin(br->br_fhsm); - kfree(br->br_fhsm); - } - - key = br->br_dykey; - for (i = 0; i < AuBrDynOp; i++, key++) - if (*key) - au_dy_put(*key); - else - break; - - au_br_dflags_restore(br); - - /* recursive lock, s_umount of branch's */ - lockdep_off(); - path_put(&br->br_path); - lockdep_on(); - kfree(wbr); - kfree(br); -} - -/* - * frees all branches - */ -void au_br_free(struct au_sbinfo *sbinfo) -{ - aufs_bindex_t bmax; - struct au_branch **br; - - AuRwMustWriteLock(&sbinfo->si_rwsem); - - bmax = sbinfo->si_bend + 1; - br = sbinfo->si_branch; - while (bmax--) - au_br_do_free(*br++); -} - -/* - * find the index of a branch which is specified by @br_id. - */ -int au_br_index(struct super_block *sb, aufs_bindex_t br_id) -{ - aufs_bindex_t bindex, bend; - - bend = au_sbend(sb); - for (bindex = 0; bindex <= bend; bindex++) - if (au_sbr_id(sb, bindex) == br_id) - return bindex; - return -1; -} - -/* ---------------------------------------------------------------------- */ - -/* - * add a branch - */ - -static int test_overlap(struct super_block *sb, struct dentry *h_adding, - struct dentry *h_root) -{ - if (unlikely(h_adding == h_root - || au_test_loopback_overlap(sb, h_adding))) - return 1; - if (h_adding->d_sb != h_root->d_sb) - return 0; - return au_test_subdir(h_adding, h_root) - || au_test_subdir(h_root, h_adding); -} - -/* - * returns a newly allocated branch. @new_nbranch is a number of branches - * after adding a branch. - */ -static struct au_branch *au_br_alloc(struct super_block *sb, int new_nbranch, - int perm) -{ - struct au_branch *add_branch; - struct dentry *root; - int err; - - err = -ENOMEM; - root = sb->s_root; - add_branch = kmalloc(sizeof(*add_branch), GFP_NOFS); - if (unlikely(!add_branch)) - goto out; - - err = au_hnotify_init_br(add_branch, perm); - if (unlikely(err)) - goto out_br; - - add_branch->br_wbr = NULL; - if (au_br_writable(perm)) { - /* may be freed separately at changing the branch permission */ - add_branch->br_wbr = kmalloc(sizeof(*add_branch->br_wbr), - GFP_NOFS); - if (unlikely(!add_branch->br_wbr)) - goto out_hnotify; - } - - add_branch->br_fhsm = NULL; - if (au_br_fhsm(perm)) { - err = au_fhsm_br_alloc(add_branch); - if (unlikely(err)) - goto out_wbr; - } - - err = au_sbr_realloc(au_sbi(sb), new_nbranch); - if (!err) - err = au_di_realloc(au_di(root), new_nbranch); - if (!err) - err = au_ii_realloc(au_ii(root->d_inode), new_nbranch); - if (!err) - return add_branch; /* success */ - -out_wbr: - kfree(add_branch->br_wbr); -out_hnotify: - au_hnotify_fin_br(add_branch); -out_br: - kfree(add_branch); -out: - return ERR_PTR(err); -} - -/* - * test if the branch permission is legal or not. - */ -static int test_br(struct inode *inode, int brperm, char *path) -{ - int err; - - err = (au_br_writable(brperm) && IS_RDONLY(inode)); - if (!err) - goto out; - - err = -EINVAL; - pr_err("write permission for readonly mount or inode, %s\n", path); - -out: - return err; -} - -/* - * returns: - * 0: success, the caller will add it - * plus: success, it is already unified, the caller should ignore it - * minus: error - */ -static int test_add(struct super_block *sb, struct au_opt_add *add, int remount) -{ - int err; - aufs_bindex_t bend, bindex; - struct dentry *root; - struct inode *inode, *h_inode; - - root = sb->s_root; - bend = au_sbend(sb); - if (unlikely(bend >= 0 - && au_find_dbindex(root, add->path.dentry) >= 0)) { - err = 1; - if (!remount) { - err = -EINVAL; - pr_err("%s duplicated\n", add->pathname); - } - goto out; - } - - err = -ENOSPC; /* -E2BIG; */ - if (unlikely(AUFS_BRANCH_MAX <= add->bindex - || AUFS_BRANCH_MAX - 1 <= bend)) { - pr_err("number of branches exceeded %s\n", add->pathname); - goto out; - } - - err = -EDOM; - if (unlikely(add->bindex < 0 || bend + 1 < add->bindex)) { - pr_err("bad index %d\n", add->bindex); - goto out; - } - - inode = add->path.dentry->d_inode; - err = -ENOENT; - if (unlikely(!inode->i_nlink)) { - pr_err("no existence %s\n", add->pathname); - goto out; - } - - err = -EINVAL; - if (unlikely(inode->i_sb == sb)) { - pr_err("%s must be outside\n", add->pathname); - goto out; - } - - if (unlikely(au_test_fs_unsuppoted(inode->i_sb))) { - pr_err("unsupported filesystem, %s (%s)\n", - add->pathname, au_sbtype(inode->i_sb)); - goto out; - } - - err = test_br(add->path.dentry->d_inode, add->perm, add->pathname); - if (unlikely(err)) - goto out; - - if (bend < 0) - return 0; /* success */ - - err = -EINVAL; - for (bindex = 0; bindex <= bend; bindex++) - if (unlikely(test_overlap(sb, add->path.dentry, - au_h_dptr(root, bindex)))) { - pr_err("%s is overlapped\n", add->pathname); - goto out; - } - - err = 0; - if (au_opt_test(au_mntflags(sb), WARN_PERM)) { - h_inode = au_h_dptr(root, 0)->d_inode; - if ((h_inode->i_mode & S_IALLUGO) != (inode->i_mode & S_IALLUGO) - || !uid_eq(h_inode->i_uid, inode->i_uid) - || !gid_eq(h_inode->i_gid, inode->i_gid)) - pr_warn("uid/gid/perm %s %u/%u/0%o, %u/%u/0%o\n", - add->pathname, - i_uid_read(inode), i_gid_read(inode), - (inode->i_mode & S_IALLUGO), - i_uid_read(h_inode), i_gid_read(h_inode), - (h_inode->i_mode & S_IALLUGO)); - } - -out: - return err; -} - -/* - * initialize or clean the whiteouts for an adding branch - */ -static int au_br_init_wh(struct super_block *sb, struct au_branch *br, - int new_perm) -{ - int err, old_perm; - aufs_bindex_t bindex; - struct mutex *h_mtx; - struct au_wbr *wbr; - struct au_hinode *hdir; - - err = vfsub_mnt_want_write(au_br_mnt(br)); - if (unlikely(err)) - goto out; - - wbr = br->br_wbr; - old_perm = br->br_perm; - br->br_perm = new_perm; - hdir = NULL; - h_mtx = NULL; - bindex = au_br_index(sb, br->br_id); - if (0 <= bindex) { - hdir = au_hi(sb->s_root->d_inode, bindex); - au_hn_imtx_lock_nested(hdir, AuLsc_I_PARENT); - } else { - h_mtx = &au_br_dentry(br)->d_inode->i_mutex; - mutex_lock_nested(h_mtx, AuLsc_I_PARENT); - } - if (!wbr) - err = au_wh_init(br, sb); - else { - wbr_wh_write_lock(wbr); - err = au_wh_init(br, sb); - wbr_wh_write_unlock(wbr); - } - if (hdir) - au_hn_imtx_unlock(hdir); - else - mutex_unlock(h_mtx); - vfsub_mnt_drop_write(au_br_mnt(br)); - br->br_perm = old_perm; - - if (!err && wbr && !au_br_writable(new_perm)) { - kfree(wbr); - br->br_wbr = NULL; - } - -out: - return err; -} - -static int au_wbr_init(struct au_branch *br, struct super_block *sb, - int perm) -{ - int err; - struct kstatfs kst; - struct au_wbr *wbr; - - wbr = br->br_wbr; - au_rw_init(&wbr->wbr_wh_rwsem); - memset(wbr->wbr_wh, 0, sizeof(wbr->wbr_wh)); - atomic_set(&wbr->wbr_wh_running, 0); - wbr->wbr_bytes = 0; - - /* - * a limit for rmdir/rename a dir - * cf. AUFS_MAX_NAMELEN in include/uapi/linux/aufs_type.h - */ - err = vfs_statfs(&br->br_path, &kst); - if (unlikely(err)) - goto out; - err = -EINVAL; - if (kst.f_namelen >= NAME_MAX) - err = au_br_init_wh(sb, br, perm); - else - pr_err("%.*s(%s), unsupported namelen %ld\n", - AuDLNPair(au_br_dentry(br)), - au_sbtype(au_br_dentry(br)->d_sb), kst.f_namelen); - -out: - return err; -} - -/* initialize a new branch */ -static int au_br_init(struct au_branch *br, struct super_block *sb, - struct au_opt_add *add) -{ - int err; - - err = 0; - memset(&br->br_xino, 0, sizeof(br->br_xino)); - mutex_init(&br->br_xino.xi_nondir_mtx); - br->br_perm = add->perm; - BUILD_BUG_ON(sizeof(br->br_dflags) - != sizeof(br->br_path.dentry->d_flags)); - br->br_dflags = DCACHE_MOUNTED; - br->br_path = add->path; /* set first, path_get() later */ - spin_lock_init(&br->br_dykey_lock); - memset(br->br_dykey, 0, sizeof(br->br_dykey)); - atomic_set(&br->br_count, 0); - atomic_set(&br->br_xino_running, 0); - br->br_id = au_new_br_id(sb); - AuDebugOn(br->br_id < 0); - - if (au_br_writable(add->perm)) { - err = au_wbr_init(br, sb, add->perm); - if (unlikely(err)) - goto out_err; - } - - if (au_opt_test(au_mntflags(sb), XINO)) { - err = au_xino_br(sb, br, add->path.dentry->d_inode->i_ino, - au_sbr(sb, 0)->br_xino.xi_file, /*do_test*/1); - if (unlikely(err)) { - AuDebugOn(br->br_xino.xi_file); - goto out_err; - } - } - - sysaufs_br_init(br); - path_get(&br->br_path); - goto out; /* success */ - -out_err: - memset(&br->br_path, 0, sizeof(br->br_path)); -out: - return err; -} - -static void au_br_do_add_brp(struct au_sbinfo *sbinfo, aufs_bindex_t bindex, - struct au_branch *br, aufs_bindex_t bend, - aufs_bindex_t amount) -{ - struct au_branch **brp; - - AuRwMustWriteLock(&sbinfo->si_rwsem); - - brp = sbinfo->si_branch + bindex; - memmove(brp + 1, brp, sizeof(*brp) * amount); - *brp = br; - sbinfo->si_bend++; - if (unlikely(bend < 0)) - sbinfo->si_bend = 0; -} - -static void au_br_do_add_hdp(struct au_dinfo *dinfo, aufs_bindex_t bindex, - aufs_bindex_t bend, aufs_bindex_t amount) -{ - struct au_hdentry *hdp; - - AuRwMustWriteLock(&dinfo->di_rwsem); - - hdp = dinfo->di_hdentry + bindex; - memmove(hdp + 1, hdp, sizeof(*hdp) * amount); - au_h_dentry_init(hdp); - dinfo->di_bend++; - if (unlikely(bend < 0)) - dinfo->di_bstart = 0; -} - -static void au_br_do_add_hip(struct au_iinfo *iinfo, aufs_bindex_t bindex, - aufs_bindex_t bend, aufs_bindex_t amount) -{ - struct au_hinode *hip; - - AuRwMustWriteLock(&iinfo->ii_rwsem); - - hip = iinfo->ii_hinode + bindex; - memmove(hip + 1, hip, sizeof(*hip) * amount); - hip->hi_inode = NULL; - au_hn_init(hip); - iinfo->ii_bend++; - if (unlikely(bend < 0)) - iinfo->ii_bstart = 0; -} - -static void au_br_do_add(struct super_block *sb, struct au_branch *br, - aufs_bindex_t bindex) -{ - struct dentry *root, *h_dentry; - struct inode *root_inode; - aufs_bindex_t bend, amount; - - au_br_dflags_force(br); - - root = sb->s_root; - root_inode = root->d_inode; - bend = au_sbend(sb); - amount = bend + 1 - bindex; - h_dentry = au_br_dentry(br); - au_sbilist_lock(); - au_br_do_add_brp(au_sbi(sb), bindex, br, bend, amount); - au_br_do_add_hdp(au_di(root), bindex, bend, amount); - au_br_do_add_hip(au_ii(root_inode), bindex, bend, amount); - au_set_h_dptr(root, bindex, dget(h_dentry)); - au_set_h_iptr(root_inode, bindex, au_igrab(h_dentry->d_inode), - /*flags*/0); - au_sbilist_unlock(); -} - -int au_br_add(struct super_block *sb, struct au_opt_add *add, int remount) -{ - int err; - aufs_bindex_t bend, add_bindex; - struct dentry *root, *h_dentry; - struct inode *root_inode; - struct au_branch *add_branch; - - root = sb->s_root; - root_inode = root->d_inode; - IMustLock(root_inode); - err = test_add(sb, add, remount); - if (unlikely(err < 0)) - goto out; - if (err) { - err = 0; - goto out; /* success */ - } - - bend = au_sbend(sb); - add_branch = au_br_alloc(sb, bend + 2, add->perm); - err = PTR_ERR(add_branch); - if (IS_ERR(add_branch)) - goto out; - - err = au_br_init(add_branch, sb, add); - if (unlikely(err)) { - au_br_do_free(add_branch); - goto out; - } - - add_bindex = add->bindex; - if (!remount) - au_br_do_add(sb, add_branch, add_bindex); - else { - sysaufs_brs_del(sb, add_bindex); - au_br_do_add(sb, add_branch, add_bindex); - sysaufs_brs_add(sb, add_bindex); - } - - h_dentry = add->path.dentry; - if (!add_bindex) { - au_cpup_attr_all(root_inode, /*force*/1); - sb->s_maxbytes = h_dentry->d_sb->s_maxbytes; - } else - au_add_nlink(root_inode, h_dentry->d_inode); - - /* - * this test/set prevents aufs from handling unnecesary notify events - * of xino files, in case of re-adding a writable branch which was - * once detached from aufs. - */ - if (au_xino_brid(sb) < 0 - && au_br_writable(add_branch->br_perm) - && !au_test_fs_bad_xino(h_dentry->d_sb) - && add_branch->br_xino.xi_file - && add_branch->br_xino.xi_file->f_dentry->d_parent == h_dentry) - au_xino_brid_set(sb, add_branch->br_id); - -out: - return err; -} - -/* ---------------------------------------------------------------------- */ - -static unsigned long long au_farray_cb(void *a, - unsigned long long max __maybe_unused, - void *arg) -{ - unsigned long long n; - struct file **p, *f; - struct super_block *sb = arg; - - n = 0; - p = a; - lg_global_lock(&files_lglock); - do_file_list_for_each_entry(sb, f) { - if (au_fi(f) - && file_count(f) - && !special_file(file_inode(f)->i_mode)) { - get_file(f); - *p++ = f; - n++; - AuDebugOn(n > max); - } - } while_file_list_for_each_entry; - lg_global_unlock(&files_lglock); - - return n; -} - -static struct file **au_farray_alloc(struct super_block *sb, - unsigned long long *max) -{ - *max = atomic_long_read(&au_sbi(sb)->si_nfiles); - return au_array_alloc(max, au_farray_cb, sb); -} - -static void au_farray_free(struct file **a, unsigned long long max) -{ - unsigned long long ull; - - for (ull = 0; ull < max; ull++) - if (a[ull]) - fput(a[ull]); - au_array_free(a); -} - -/* ---------------------------------------------------------------------- */ - -/* - * delete a branch - */ - -/* to show the line number, do not make it inlined function */ -#define AuVerbose(do_info, fmt, ...) do { \ - if (do_info) \ - pr_info(fmt, ##__VA_ARGS__); \ -} while (0) - -static int au_test_ibusy(struct inode *inode, aufs_bindex_t bstart, - aufs_bindex_t bend) -{ - return (inode && !S_ISDIR(inode->i_mode)) || bstart == bend; -} - -static int au_test_dbusy(struct dentry *dentry, aufs_bindex_t bstart, - aufs_bindex_t bend) -{ - return au_test_ibusy(dentry->d_inode, bstart, bend); -} - -/* - * test if the branch is deletable or not. - */ -static int test_dentry_busy(struct dentry *root, aufs_bindex_t bindex, - unsigned int sigen, const unsigned int verbose) -{ - int err, i, j, ndentry; - aufs_bindex_t bstart, bend; - struct au_dcsub_pages dpages; - struct au_dpage *dpage; - struct dentry *d; - - err = au_dpages_init(&dpages, GFP_NOFS); - if (unlikely(err)) - goto out; - err = au_dcsub_pages(&dpages, root, NULL, NULL); - if (unlikely(err)) - goto out_dpages; - - for (i = 0; !err && i < dpages.ndpage; i++) { - dpage = dpages.dpages + i; - ndentry = dpage->ndentry; - for (j = 0; !err && j < ndentry; j++) { - d = dpage->dentries[j]; - AuDebugOn(!d->d_count); - if (!au_digen_test(d, sigen)) { - di_read_lock_child(d, AuLock_IR); - if (unlikely(au_dbrange_test(d))) { - di_read_unlock(d, AuLock_IR); - continue; - } - } else { - di_write_lock_child(d); - if (unlikely(au_dbrange_test(d))) { - di_write_unlock(d); - continue; - } - err = au_reval_dpath(d, sigen); - if (!err) - di_downgrade_lock(d, AuLock_IR); - else { - di_write_unlock(d); - break; - } - } - - /* AuDbgDentry(d); */ - bstart = au_dbstart(d); - bend = au_dbend(d); - if (bstart <= bindex - && bindex <= bend - && au_h_dptr(d, bindex) - && au_test_dbusy(d, bstart, bend)) { - err = -EBUSY; - AuVerbose(verbose, "busy %.*s\n", AuDLNPair(d)); - AuDbgDentry(d); - } - di_read_unlock(d, AuLock_IR); - } - } - -out_dpages: - au_dpages_free(&dpages); -out: - return err; -} - -static int test_inode_busy(struct super_block *sb, aufs_bindex_t bindex, - unsigned int sigen, const unsigned int verbose) -{ - int err; - unsigned long long max, ull; - struct inode *i, **array; - aufs_bindex_t bstart, bend; - - array = au_iarray_alloc(sb, &max); - err = PTR_ERR(array); - if (IS_ERR(array)) - goto out; - - err = 0; - AuDbg("b%d\n", bindex); - for (ull = 0; !err && ull < max; ull++) { - i = array[ull]; - if (unlikely(!i)) - break; - if (i->i_ino == AUFS_ROOT_INO) - continue; - - /* AuDbgInode(i); */ - if (au_iigen(i, NULL) == sigen) - ii_read_lock_child(i); - else { - ii_write_lock_child(i); - err = au_refresh_hinode_self(i); - au_iigen_dec(i); - if (!err) - ii_downgrade_lock(i); - else { - ii_write_unlock(i); - break; - } - } - - bstart = au_ibstart(i); - bend = au_ibend(i); - if (bstart <= bindex - && bindex <= bend - && au_h_iptr(i, bindex) - && au_test_ibusy(i, bstart, bend)) { - err = -EBUSY; - AuVerbose(verbose, "busy i%lu\n", i->i_ino); - AuDbgInode(i); - } - ii_read_unlock(i); - } - au_iarray_free(array, max); - -out: - return err; -} - -static int test_children_busy(struct dentry *root, aufs_bindex_t bindex, - const unsigned int verbose) -{ - int err; - unsigned int sigen; - - sigen = au_sigen(root->d_sb); - DiMustNoWaiters(root); - IiMustNoWaiters(root->d_inode); - di_write_unlock(root); - err = test_dentry_busy(root, bindex, sigen, verbose); - if (!err) - err = test_inode_busy(root->d_sb, bindex, sigen, verbose); - di_write_lock_child(root); /* aufs_write_lock() calls ..._child() */ - - return err; -} - -static int test_dir_busy(struct file *file, aufs_bindex_t br_id, - struct file **to_free, int *idx) -{ - int err; - unsigned char matched, root; - aufs_bindex_t bindex, bend; - struct au_fidir *fidir; - struct au_hfile *hfile; - - err = 0; - root = IS_ROOT(file->f_dentry); - if (root) { - get_file(file); - to_free[*idx] = file; - (*idx)++; - goto out; - } - - matched = 0; - fidir = au_fi(file)->fi_hdir; - AuDebugOn(!fidir); - bend = au_fbend_dir(file); - for (bindex = au_fbstart(file); bindex <= bend; bindex++) { - hfile = fidir->fd_hfile + bindex; - if (!hfile->hf_file) - continue; - - if (hfile->hf_br->br_id == br_id) { - matched = 1; - break; - } - } - if (matched) - err = -EBUSY; - -out: - return err; -} - -static int test_file_busy(struct super_block *sb, aufs_bindex_t br_id, - struct file **to_free, int opened) -{ - int err, idx; - unsigned long long ull, max; - aufs_bindex_t bstart; - struct file *file, **array; - struct inode *inode; - struct dentry *root; - struct au_hfile *hfile; - - array = au_farray_alloc(sb, &max); - err = PTR_ERR(array); - if (IS_ERR(array)) - goto out; - - err = 0; - idx = 0; - root = sb->s_root; - di_write_unlock(root); - for (ull = 0; ull < max; ull++) { - file = array[ull]; - if (unlikely(!file)) - break; - - /* AuDbg("%.*s\n", AuDLNPair(file->f_dentry)); */ - fi_read_lock(file); - bstart = au_fbstart(file); - inode = file_inode(file); - if (!S_ISDIR(inode->i_mode)) { - hfile = &au_fi(file)->fi_htop; - if (hfile->hf_br->br_id == br_id) - err = -EBUSY; - } else - err = test_dir_busy(file, br_id, to_free, &idx); - fi_read_unlock(file); - if (unlikely(err)) - break; - } - di_write_lock_child(root); - au_farray_free(array, max); - AuDebugOn(idx > opened); - -out: - return err; -} - -static void br_del_file(struct file **to_free, unsigned long long opened, - aufs_bindex_t br_id) -{ - unsigned long long ull; - aufs_bindex_t bindex, bstart, bend, bfound; - struct file *file; - struct au_fidir *fidir; - struct au_hfile *hfile; - - for (ull = 0; ull < opened; ull++) { - file = to_free[ull]; - if (unlikely(!file)) - break; - - /* AuDbg("%.*s\n", AuDLNPair(file->f_dentry)); */ - AuDebugOn(!S_ISDIR(file_inode(file)->i_mode)); - bfound = -1; - fidir = au_fi(file)->fi_hdir; - AuDebugOn(!fidir); - fi_write_lock(file); - bstart = au_fbstart(file); - bend = au_fbend_dir(file); - for (bindex = bstart; bindex <= bend; bindex++) { - hfile = fidir->fd_hfile + bindex; - if (!hfile->hf_file) - continue; - - if (hfile->hf_br->br_id == br_id) { - bfound = bindex; - break; - } - } - AuDebugOn(bfound < 0); - au_set_h_fptr(file, bfound, NULL); - if (bfound == bstart) { - for (bstart++; bstart <= bend; bstart++) - if (au_hf_dir(file, bstart)) { - au_set_fbstart(file, bstart); - break; - } - } - fi_write_unlock(file); - } -} - -static void au_br_do_del_brp(struct au_sbinfo *sbinfo, - const aufs_bindex_t bindex, - const aufs_bindex_t bend) -{ - struct au_branch **brp, **p; - - AuRwMustWriteLock(&sbinfo->si_rwsem); - - brp = sbinfo->si_branch + bindex; - if (bindex < bend) - memmove(brp, brp + 1, sizeof(*brp) * (bend - bindex)); - sbinfo->si_branch[0 + bend] = NULL; - sbinfo->si_bend--; - - p = krealloc(sbinfo->si_branch, sizeof(*p) * bend, AuGFP_SBILIST); - if (p) - sbinfo->si_branch = p; - /* harmless error */ -} - -static void au_br_do_del_hdp(struct au_dinfo *dinfo, const aufs_bindex_t bindex, - const aufs_bindex_t bend) -{ - struct au_hdentry *hdp, *p; - - AuRwMustWriteLock(&dinfo->di_rwsem); - - hdp = dinfo->di_hdentry; - if (bindex < bend) - memmove(hdp + bindex, hdp + bindex + 1, - sizeof(*hdp) * (bend - bindex)); - hdp[0 + bend].hd_dentry = NULL; - dinfo->di_bend--; - - p = krealloc(hdp, sizeof(*p) * bend, AuGFP_SBILIST); - if (p) - dinfo->di_hdentry = p; - /* harmless error */ -} - -static void au_br_do_del_hip(struct au_iinfo *iinfo, const aufs_bindex_t bindex, - const aufs_bindex_t bend) -{ - struct au_hinode *hip, *p; - - AuRwMustWriteLock(&iinfo->ii_rwsem); - - hip = iinfo->ii_hinode + bindex; - if (bindex < bend) - memmove(hip, hip + 1, sizeof(*hip) * (bend - bindex)); - iinfo->ii_hinode[0 + bend].hi_inode = NULL; - au_hn_init(iinfo->ii_hinode + bend); - iinfo->ii_bend--; - - p = krealloc(iinfo->ii_hinode, sizeof(*p) * bend, AuGFP_SBILIST); - if (p) - iinfo->ii_hinode = p; - /* harmless error */ -} - -static void au_br_do_del(struct super_block *sb, aufs_bindex_t bindex, - struct au_branch *br) -{ - aufs_bindex_t bend; - struct au_sbinfo *sbinfo; - struct dentry *root, *h_root; - struct inode *inode, *h_inode; - struct au_hinode *hinode; - - SiMustWriteLock(sb); - - root = sb->s_root; - inode = root->d_inode; - sbinfo = au_sbi(sb); - bend = sbinfo->si_bend; - - h_root = au_h_dptr(root, bindex); - hinode = au_hi(inode, bindex); - h_inode = au_igrab(hinode->hi_inode); - au_hiput(hinode); - - au_sbilist_lock(); - au_br_do_del_brp(sbinfo, bindex, bend); - au_br_do_del_hdp(au_di(root), bindex, bend); - au_br_do_del_hip(au_ii(inode), bindex, bend); - au_sbilist_unlock(); - - dput(h_root); - iput(h_inode); - au_br_do_free(br); -} - -static unsigned long long empty_cb(void *array, unsigned long long max, - void *arg) -{ - return max; -} - -int au_br_del(struct super_block *sb, struct au_opt_del *del, int remount) -{ - int err, rerr, i; - unsigned long long opened; - unsigned int mnt_flags; - aufs_bindex_t bindex, bend, br_id; - unsigned char do_wh, verbose; - struct au_branch *br; - struct au_wbr *wbr; - struct dentry *root; - struct file **to_free; - - err = 0; - opened = 0; - to_free = NULL; - root = sb->s_root; - bindex = au_find_dbindex(root, del->h_path.dentry); - if (bindex < 0) { - if (remount) - goto out; /* success */ - err = -ENOENT; - pr_err("%s no such branch\n", del->pathname); - goto out; - } - AuDbg("bindex b%d\n", bindex); - - err = -EBUSY; - mnt_flags = au_mntflags(sb); - verbose = !!au_opt_test(mnt_flags, VERBOSE); - bend = au_sbend(sb); - if (unlikely(!bend)) { - AuVerbose(verbose, "no more branches left\n"); - goto out; - } - br = au_sbr(sb, bindex); - AuDebugOn(!path_equal(&br->br_path, &del->h_path)); - - br_id = br->br_id; - opened = atomic_read(&br->br_count); - if (unlikely(opened)) { - to_free = au_array_alloc(&opened, empty_cb, NULL); - err = PTR_ERR(to_free); - if (IS_ERR(to_free)) - goto out; - - err = test_file_busy(sb, br_id, to_free, opened); - if (unlikely(err)) { - AuVerbose(verbose, "%llu file(s) opened\n", opened); - goto out; - } - } - - wbr = br->br_wbr; - do_wh = wbr && (wbr->wbr_whbase || wbr->wbr_plink || wbr->wbr_orph); - if (do_wh) { - /* instead of WbrWhMustWriteLock(wbr) */ - SiMustWriteLock(sb); - for (i = 0; i < AuBrWh_Last; i++) { - dput(wbr->wbr_wh[i]); - wbr->wbr_wh[i] = NULL; - } - } - - err = test_children_busy(root, bindex, verbose); - if (unlikely(err)) { - if (do_wh) - goto out_wh; - goto out; - } - - err = 0; - if (to_free) { - /* - * now we confirmed the branch is deletable. - * let's free the remaining opened dirs on the branch. - */ - di_write_unlock(root); - br_del_file(to_free, opened, br_id); - di_write_lock_child(root); - } - - if (!remount) - au_br_do_del(sb, bindex, br); - else { - sysaufs_brs_del(sb, bindex); - au_br_do_del(sb, bindex, br); - sysaufs_brs_add(sb, bindex); - } - - if (!bindex) { - au_cpup_attr_all(root->d_inode, /*force*/1); - sb->s_maxbytes = au_sbr_sb(sb, 0)->s_maxbytes; - } else - au_sub_nlink(root->d_inode, del->h_path.dentry->d_inode); - if (au_opt_test(mnt_flags, PLINK)) - au_plink_half_refresh(sb, br_id); - - if (au_xino_brid(sb) == br_id) - au_xino_brid_set(sb, -1); - goto out; /* success */ - -out_wh: - /* revert */ - rerr = au_br_init_wh(sb, br, br->br_perm); - if (rerr) - pr_warn("failed re-creating base whiteout, %s. (%d)\n", - del->pathname, rerr); -out: - if (to_free) - au_farray_free(to_free, opened); - return err; -} - -/* ---------------------------------------------------------------------- */ - -static int au_ibusy(struct super_block *sb, struct aufs_ibusy __user *arg) -{ - int err; - aufs_bindex_t bstart, bend; - struct aufs_ibusy ibusy; - struct inode *inode, *h_inode; - - err = -EPERM; - if (unlikely(!capable(CAP_SYS_ADMIN))) - goto out; - - err = copy_from_user(&ibusy, arg, sizeof(ibusy)); - if (!err) - err = !access_ok(VERIFY_WRITE, &arg->h_ino, sizeof(arg->h_ino)); - if (unlikely(err)) { - err = -EFAULT; - AuTraceErr(err); - goto out; - } - - err = -EINVAL; - si_read_lock(sb, AuLock_FLUSH); - if (unlikely(ibusy.bindex < 0 || ibusy.bindex > au_sbend(sb))) - goto out_unlock; - - err = 0; - ibusy.h_ino = 0; /* invalid */ - inode = ilookup(sb, ibusy.ino); - if (!inode - || inode->i_ino == AUFS_ROOT_INO - || is_bad_inode(inode)) - goto out_unlock; - - ii_read_lock_child(inode); - bstart = au_ibstart(inode); - bend = au_ibend(inode); - if (bstart <= ibusy.bindex && ibusy.bindex <= bend) { - h_inode = au_h_iptr(inode, ibusy.bindex); - if (h_inode && au_test_ibusy(inode, bstart, bend)) - ibusy.h_ino = h_inode->i_ino; - } - ii_read_unlock(inode); - iput(inode); - -out_unlock: - si_read_unlock(sb); - if (!err) { - err = __put_user(ibusy.h_ino, &arg->h_ino); - if (unlikely(err)) { - err = -EFAULT; - AuTraceErr(err); - } - } -out: - return err; -} - -long au_ibusy_ioctl(struct file *file, unsigned long arg) -{ - return au_ibusy(file->f_dentry->d_sb, (void __user *)arg); -} - -#ifdef CONFIG_COMPAT -long au_ibusy_compat_ioctl(struct file *file, unsigned long arg) -{ - return au_ibusy(file->f_dentry->d_sb, compat_ptr(arg)); -} -#endif - -/* ---------------------------------------------------------------------- */ - -/* - * change a branch permission - */ - -static void au_warn_ima(void) -{ -#ifdef CONFIG_IMA - /* since it doesn't support mark_files_ro() */ - AuWarn1("RW -> RO makes IMA to produce wrong message\n"); -#endif -} - -static int do_need_sigen_inc(int a, int b) -{ - return au_br_whable(a) && !au_br_whable(b); -} - -static int need_sigen_inc(int old, int new) -{ - return do_need_sigen_inc(old, new) - || do_need_sigen_inc(new, old); -} - -static int au_br_mod_files_ro(struct super_block *sb, aufs_bindex_t bindex) -{ - int err, do_warn; - unsigned int mnt_flags; - unsigned long long ull, max; - aufs_bindex_t br_id; - unsigned char verbose; - struct file *file, *hf, **array; - struct inode *inode; - struct au_hfile *hfile; - - mnt_flags = au_mntflags(sb); - verbose = !!au_opt_test(mnt_flags, VERBOSE); - - array = au_farray_alloc(sb, &max); - err = PTR_ERR(array); - if (IS_ERR(array)) - goto out; - - do_warn = 0; - br_id = au_sbr_id(sb, bindex); - for (ull = 0; ull < max; ull++) { - file = array[ull]; - if (unlikely(!file)) - break; - - /* AuDbg("%.*s\n", AuDLNPair(file->f_dentry)); */ - fi_read_lock(file); - if (unlikely(au_test_mmapped(file))) { - err = -EBUSY; - AuVerbose(verbose, "mmapped %.*s\n", - AuDLNPair(file->f_dentry)); - AuDbgFile(file); - FiMustNoWaiters(file); - fi_read_unlock(file); - goto out_array; - } - - inode = file_inode(file); - hfile = &au_fi(file)->fi_htop; - hf = hfile->hf_file; - if (!S_ISREG(inode->i_mode) - || !(file->f_mode & FMODE_WRITE) - || hfile->hf_br->br_id != br_id - || !(hf->f_mode & FMODE_WRITE)) - array[ull] = NULL; - else { - do_warn = 1; - get_file(file); - } - - FiMustNoWaiters(file); - fi_read_unlock(file); - fput(file); - } - - err = 0; - if (do_warn) - au_warn_ima(); - - for (ull = 0; ull < max; ull++) { - file = array[ull]; - if (!file) - continue; - - /* todo: already flushed? */ - /* cf. fs/super.c:mark_files_ro() */ - /* fi_read_lock(file); */ - hfile = &au_fi(file)->fi_htop; - hf = hfile->hf_file; - /* fi_read_unlock(file); */ - spin_lock(&hf->f_lock); - hf->f_mode &= ~FMODE_WRITE; - spin_unlock(&hf->f_lock); - if (!file_check_writeable(hf)) { - __mnt_drop_write(hf->f_path.mnt); - file_release_write(hf); - } - } - -out_array: - au_farray_free(array, max); -out: - AuTraceErr(err); - return err; -} - -int au_br_mod(struct super_block *sb, struct au_opt_mod *mod, int remount, - int *do_refresh) -{ - int err, rerr; - aufs_bindex_t bindex; - struct dentry *root; - struct au_branch *br; - struct au_br_fhsm *bf; - - root = sb->s_root; - bindex = au_find_dbindex(root, mod->h_root); - if (bindex < 0) { - if (remount) - return 0; /* success */ - err = -ENOENT; - pr_err("%s no such branch\n", mod->path); - goto out; - } - AuDbg("bindex b%d\n", bindex); - - err = test_br(mod->h_root->d_inode, mod->perm, mod->path); - if (unlikely(err)) - goto out; - - br = au_sbr(sb, bindex); - AuDebugOn(mod->h_root != au_br_dentry(br)); - if (br->br_perm == mod->perm) - return 0; /* success */ - - /* pre-allocate for non-fhsm --> fhsm */ - bf = NULL; - if (!au_br_fhsm(br->br_perm) && au_br_fhsm(mod->perm)) { - err = au_fhsm_br_alloc(br); - if (unlikely(err)) - goto out; - bf = br->br_fhsm; - br->br_fhsm = NULL; - } - - if (au_br_writable(br->br_perm)) { - /* remove whiteout base */ - err = au_br_init_wh(sb, br, mod->perm); - if (unlikely(err)) - goto out_bf; - - if (!au_br_writable(mod->perm)) { - /* rw --> ro, file might be mmapped */ - DiMustNoWaiters(root); - IiMustNoWaiters(root->d_inode); - di_write_unlock(root); - err = au_br_mod_files_ro(sb, bindex); - /* aufs_write_lock() calls ..._child() */ - di_write_lock_child(root); - - if (unlikely(err)) { - rerr = -ENOMEM; - br->br_wbr = kmalloc(sizeof(*br->br_wbr), - GFP_NOFS); - if (br->br_wbr) - rerr = au_wbr_init(br, sb, br->br_perm); - if (unlikely(rerr)) { - AuIOErr("nested error %d (%d)\n", - rerr, err); - br->br_perm = mod->perm; - } - } - } - } else if (au_br_writable(mod->perm)) { - /* ro --> rw */ - err = -ENOMEM; - br->br_wbr = kmalloc(sizeof(*br->br_wbr), GFP_NOFS); - if (br->br_wbr) { - err = au_wbr_init(br, sb, mod->perm); - if (unlikely(err)) { - kfree(br->br_wbr); - br->br_wbr = NULL; - } - } - } - if (unlikely(err)) - goto out_bf; - - if (au_br_fhsm(br->br_perm)) { - if (!au_br_fhsm(mod->perm)) { - /* fhsm --> non-fhsm */ - au_br_fhsm_fin(br->br_fhsm); - kfree(br->br_fhsm); - br->br_fhsm = NULL; - } - } else if (au_br_fhsm(mod->perm)) - /* non-fhsm --> fhsm */ - br->br_fhsm = bf; - - if ((br->br_perm & AuBrAttr_UNPIN) - && !(mod->perm & AuBrAttr_UNPIN)) - au_br_dflags_force(br); - else if (!(br->br_perm & AuBrAttr_UNPIN) - && (mod->perm & AuBrAttr_UNPIN)) - au_br_dflags_restore(br); - *do_refresh |= need_sigen_inc(br->br_perm, mod->perm); - br->br_perm = mod->perm; - goto out; /* success */ - -out_bf: - kfree(bf); -out: - AuTraceErr(err); - return err; -} - -/* ---------------------------------------------------------------------- */ - -int au_br_stfs(struct au_branch *br, struct aufs_stfs *stfs) -{ - int err; - struct kstatfs kstfs; - - err = vfs_statfs(&br->br_path, &kstfs); - if (!err) { - stfs->f_blocks = kstfs.f_blocks; - stfs->f_bavail = kstfs.f_bavail; - stfs->f_files = kstfs.f_files; - stfs->f_ffree = kstfs.f_ffree; - } - - return err; -} diff --git a/fs/aufs/branch.h b/fs/aufs/branch.h deleted file mode 100644 index b063fb8f15622a..00000000000000 --- a/fs/aufs/branch.h +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * branch filesystems and xino for them - */ - -#ifndef __AUFS_BRANCH_H__ -#define __AUFS_BRANCH_H__ - -#ifdef __KERNEL__ - -#include -#include "dynop.h" -#include "rwsem.h" -#include "super.h" - -/* ---------------------------------------------------------------------- */ - -/* a xino file */ -struct au_xino_file { - struct file *xi_file; - struct mutex xi_nondir_mtx; - - /* todo: make xino files an array to support huge inode number */ - -#ifdef CONFIG_DEBUG_FS - struct dentry *xi_dbgaufs; -#endif -}; - -/* File-based Hierarchical Storage Management */ -struct au_br_fhsm { -#ifdef CONFIG_AUFS_FHSM - struct mutex bf_lock; - unsigned long bf_jiffy; - struct aufs_stfs bf_stfs; - int bf_readable; -#endif -}; - -/* members for writable branch only */ -enum {AuBrWh_BASE, AuBrWh_PLINK, AuBrWh_ORPH, AuBrWh_Last}; -struct au_wbr { - struct au_rwsem wbr_wh_rwsem; - struct dentry *wbr_wh[AuBrWh_Last]; - atomic_t wbr_wh_running; -#define wbr_whbase wbr_wh[AuBrWh_BASE] /* whiteout base */ -#define wbr_plink wbr_wh[AuBrWh_PLINK] /* pseudo-link dir */ -#define wbr_orph wbr_wh[AuBrWh_ORPH] /* dir for orphans */ - - /* mfs mode */ - unsigned long long wbr_bytes; -}; - -/* ext2 has 3 types of operations at least, ext3 has 4 */ -#define AuBrDynOp (AuDyLast * 4) - -#ifdef CONFIG_AUFS_HFSNOTIFY -/* support for asynchronous destruction */ -struct au_br_hfsnotify { - struct fsnotify_group *hfsn_group; -}; -#endif - -/* sysfs entries */ -struct au_brsysfs { - char name[16]; - struct attribute attr; -}; - -enum { - AuBrSysfs_BR, - AuBrSysfs_BRID, - AuBrSysfs_Last -}; - -/* protected by superblock rwsem */ -struct au_branch { - struct au_xino_file br_xino; - - aufs_bindex_t br_id; - - int br_perm; - unsigned int br_dflags; - struct path br_path; - spinlock_t br_dykey_lock; - struct au_dykey *br_dykey[AuBrDynOp]; - atomic_t br_count; - - struct au_wbr *br_wbr; - struct au_br_fhsm *br_fhsm; - - /* xino truncation */ - atomic_t br_xino_running; - -#ifdef CONFIG_AUFS_HFSNOTIFY - struct au_br_hfsnotify *br_hfsn; -#endif - -#ifdef CONFIG_SYSFS - /* entries under sysfs per mount-point */ - struct au_brsysfs br_sysfs[AuBrSysfs_Last]; -#endif -}; - -/* ---------------------------------------------------------------------- */ - -static inline struct vfsmount *au_br_mnt(struct au_branch *br) -{ - return br->br_path.mnt; -} - -static inline struct dentry *au_br_dentry(struct au_branch *br) -{ - return br->br_path.dentry; -} - -static inline struct super_block *au_br_sb(struct au_branch *br) -{ - return au_br_mnt(br)->mnt_sb; -} - -static inline int au_br_rdonly(struct au_branch *br) -{ - return ((au_br_sb(br)->s_flags & MS_RDONLY) - || !au_br_writable(br->br_perm)) - ? -EROFS : 0; -} - -static inline int au_br_hnotifyable(int brperm __maybe_unused) -{ -#ifdef CONFIG_AUFS_HNOTIFY - return !(brperm & AuBrPerm_RR); -#else - return 0; -#endif -} - -/* ---------------------------------------------------------------------- */ - -/* branch.c */ -struct au_sbinfo; -void au_br_free(struct au_sbinfo *sinfo); -int au_br_index(struct super_block *sb, aufs_bindex_t br_id); -struct au_opt_add; -int au_br_add(struct super_block *sb, struct au_opt_add *add, int remount); -struct au_opt_del; -int au_br_del(struct super_block *sb, struct au_opt_del *del, int remount); -long au_ibusy_ioctl(struct file *file, unsigned long arg); -#ifdef CONFIG_COMPAT -long au_ibusy_compat_ioctl(struct file *file, unsigned long arg); -#endif -struct au_opt_mod; -int au_br_mod(struct super_block *sb, struct au_opt_mod *mod, int remount, - int *do_refresh); -struct aufs_stfs; -int au_br_stfs(struct au_branch *br, struct aufs_stfs *stfs); - -/* xino.c */ -static const loff_t au_loff_max = LLONG_MAX; - -int au_xib_trunc(struct super_block *sb); -ssize_t xino_fread(au_readf_t func, struct file *file, void *buf, size_t size, - loff_t *pos); -ssize_t xino_fwrite(au_writef_t func, struct file *file, void *buf, size_t size, - loff_t *pos); -struct file *au_xino_create2(struct file *base_file, struct file *copy_src); -struct file *au_xino_create(struct super_block *sb, char *fname, int silent); -ino_t au_xino_new_ino(struct super_block *sb); -void au_xino_delete_inode(struct inode *inode, const int unlinked); -int au_xino_write(struct super_block *sb, aufs_bindex_t bindex, ino_t h_ino, - ino_t ino); -int au_xino_read(struct super_block *sb, aufs_bindex_t bindex, ino_t h_ino, - ino_t *ino); -int au_xino_br(struct super_block *sb, struct au_branch *br, ino_t hino, - struct file *base_file, int do_test); -int au_xino_trunc(struct super_block *sb, aufs_bindex_t bindex); - -struct au_opt_xino; -int au_xino_set(struct super_block *sb, struct au_opt_xino *xino, int remount); -void au_xino_clr(struct super_block *sb); -struct file *au_xino_def(struct super_block *sb); -int au_xino_path(struct seq_file *seq, struct file *file); - -/* ---------------------------------------------------------------------- */ - -/* Superblock to branch */ -static inline -aufs_bindex_t au_sbr_id(struct super_block *sb, aufs_bindex_t bindex) -{ - return au_sbr(sb, bindex)->br_id; -} - -static inline -struct vfsmount *au_sbr_mnt(struct super_block *sb, aufs_bindex_t bindex) -{ - return au_br_mnt(au_sbr(sb, bindex)); -} - -static inline -struct super_block *au_sbr_sb(struct super_block *sb, aufs_bindex_t bindex) -{ - return au_br_sb(au_sbr(sb, bindex)); -} - -static inline void au_sbr_put(struct super_block *sb, aufs_bindex_t bindex) -{ - atomic_dec(&au_sbr(sb, bindex)->br_count); -} - -static inline int au_sbr_perm(struct super_block *sb, aufs_bindex_t bindex) -{ - return au_sbr(sb, bindex)->br_perm; -} - -static inline int au_sbr_whable(struct super_block *sb, aufs_bindex_t bindex) -{ - return au_br_whable(au_sbr_perm(sb, bindex)); -} - -/* ---------------------------------------------------------------------- */ - -/* - * wbr_wh_read_lock, wbr_wh_write_lock - * wbr_wh_read_unlock, wbr_wh_write_unlock, wbr_wh_downgrade_lock - */ -AuSimpleRwsemFuncs(wbr_wh, struct au_wbr *wbr, &wbr->wbr_wh_rwsem); - -#define WbrWhMustNoWaiters(wbr) AuRwMustNoWaiters(&wbr->wbr_wh_rwsem) -#define WbrWhMustAnyLock(wbr) AuRwMustAnyLock(&wbr->wbr_wh_rwsem) -#define WbrWhMustWriteLock(wbr) AuRwMustWriteLock(&wbr->wbr_wh_rwsem) - -/* ---------------------------------------------------------------------- */ - -#ifdef CONFIG_AUFS_FHSM -static inline void au_br_fhsm_init(struct au_br_fhsm *brfhsm) -{ - mutex_init(&brfhsm->bf_lock); - brfhsm->bf_jiffy = 0; - brfhsm->bf_readable = 0; -} - -static inline void au_br_fhsm_fin(struct au_br_fhsm *brfhsm) -{ - mutex_destroy(&brfhsm->bf_lock); -} -#else -AuStubVoid(au_br_fhsm_init, struct au_br_fhsm *brfhsm) -AuStubVoid(au_br_fhsm_fin, struct au_br_fhsm *brfhsm) -#endif - -#endif /* __KERNEL__ */ -#endif /* __AUFS_BRANCH_H__ */ diff --git a/fs/aufs/conf.mk b/fs/aufs/conf.mk deleted file mode 100644 index 0bbb2d3a528594..00000000000000 --- a/fs/aufs/conf.mk +++ /dev/null @@ -1,38 +0,0 @@ - -AuConfStr = CONFIG_AUFS_FS=${CONFIG_AUFS_FS} - -define AuConf -ifdef ${1} -AuConfStr += ${1}=${${1}} -endif -endef - -AuConfAll = BRANCH_MAX_127 BRANCH_MAX_511 BRANCH_MAX_1023 BRANCH_MAX_32767 \ - SBILIST \ - HNOTIFY HFSNOTIFY \ - EXPORT INO_T_64 \ - XATTR \ - FHSM \ - RDU \ - SHWH \ - BR_RAMFS \ - BR_FUSE POLL \ - BR_HFSPLUS \ - BDEV_LOOP \ - DEBUG MAGIC_SYSRQ -$(foreach i, ${AuConfAll}, \ - $(eval $(call AuConf,CONFIG_AUFS_${i}))) - -AuConfName = ${obj}/conf.str -${AuConfName}.tmp: FORCE - @echo ${AuConfStr} | tr ' ' '\n' | sed -e 's/^/"/' -e 's/$$/\\n"/' > $@ -${AuConfName}: ${AuConfName}.tmp - @diff -q $< $@ > /dev/null 2>&1 || { \ - echo ' GEN ' $@; \ - cp -p $< $@; \ - } -FORCE: -clean-files += ${AuConfName} ${AuConfName}.tmp -${obj}/sysfs.o: ${AuConfName} - --include ${srctree}/${src}/conf_priv.mk diff --git a/fs/aufs/cpup.c b/fs/aufs/cpup.c deleted file mode 100644 index 0d6c56c40c8e33..00000000000000 --- a/fs/aufs/cpup.c +++ /dev/null @@ -1,1285 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * copy-up functions, see wbr_policy.c for copy-down - */ - -#include -#include -#include "aufs.h" - -void au_cpup_attr_flags(struct inode *dst, unsigned int iflags) -{ - const unsigned int mask = S_DEAD | S_SWAPFILE | S_PRIVATE - | S_NOATIME | S_NOCMTIME | S_AUTOMOUNT; - - BUILD_BUG_ON(sizeof(iflags) != sizeof(dst->i_flags)); - - dst->i_flags |= iflags & ~mask; - if (au_test_fs_notime(dst->i_sb)) - dst->i_flags |= S_NOATIME | S_NOCMTIME; -} - -void au_cpup_attr_timesizes(struct inode *inode) -{ - struct inode *h_inode; - - h_inode = au_h_iptr(inode, au_ibstart(inode)); - fsstack_copy_attr_times(inode, h_inode); - fsstack_copy_inode_size(inode, h_inode); -} - -void au_cpup_attr_nlink(struct inode *inode, int force) -{ - struct inode *h_inode; - struct super_block *sb; - aufs_bindex_t bindex, bend; - - sb = inode->i_sb; - bindex = au_ibstart(inode); - h_inode = au_h_iptr(inode, bindex); - if (!force - && !S_ISDIR(h_inode->i_mode) - && au_opt_test(au_mntflags(sb), PLINK) - && au_plink_test(inode)) - return; - - /* - * 0 can happen in revalidating. - * h_inode->i_mutex is not held, but it is harmless since once i_nlink - * reaches 0, it will never become positive. - */ - set_nlink(inode, h_inode->i_nlink); - - /* - * fewer nlink makes find(1) noisy, but larger nlink doesn't. - * it may includes whplink directory. - */ - if (S_ISDIR(h_inode->i_mode)) { - bend = au_ibend(inode); - for (bindex++; bindex <= bend; bindex++) { - h_inode = au_h_iptr(inode, bindex); - if (h_inode) - au_add_nlink(inode, h_inode); - } - } -} - -void au_cpup_attr_changeable(struct inode *inode) -{ - struct inode *h_inode; - - h_inode = au_h_iptr(inode, au_ibstart(inode)); - inode->i_mode = h_inode->i_mode; - inode->i_uid = h_inode->i_uid; - inode->i_gid = h_inode->i_gid; - au_cpup_attr_timesizes(inode); - au_cpup_attr_flags(inode, h_inode->i_flags); -} - -void au_cpup_igen(struct inode *inode, struct inode *h_inode) -{ - struct au_iinfo *iinfo = au_ii(inode); - - IiMustWriteLock(inode); - - iinfo->ii_higen = h_inode->i_generation; - iinfo->ii_hsb1 = h_inode->i_sb; -} - -void au_cpup_attr_all(struct inode *inode, int force) -{ - struct inode *h_inode; - - h_inode = au_h_iptr(inode, au_ibstart(inode)); - au_cpup_attr_changeable(inode); - if (inode->i_nlink > 0) - au_cpup_attr_nlink(inode, force); - inode->i_rdev = h_inode->i_rdev; - inode->i_blkbits = h_inode->i_blkbits; - au_cpup_igen(inode, h_inode); -} - -/* ---------------------------------------------------------------------- */ - -/* Note: dt_dentry and dt_h_dentry are not dget/dput-ed */ - -/* keep the timestamps of the parent dir when cpup */ -void au_dtime_store(struct au_dtime *dt, struct dentry *dentry, - struct path *h_path) -{ - struct inode *h_inode; - - dt->dt_dentry = dentry; - dt->dt_h_path = *h_path; - h_inode = h_path->dentry->d_inode; - dt->dt_atime = h_inode->i_atime; - dt->dt_mtime = h_inode->i_mtime; - /* smp_mb(); */ -} - -void au_dtime_revert(struct au_dtime *dt) -{ - struct iattr attr; - int err; - - attr.ia_atime = dt->dt_atime; - attr.ia_mtime = dt->dt_mtime; - attr.ia_valid = ATTR_FORCE | ATTR_MTIME | ATTR_MTIME_SET - | ATTR_ATIME | ATTR_ATIME_SET; - - err = vfsub_notify_change(&dt->dt_h_path, &attr); - if (unlikely(err)) - pr_warn("restoring timestamps failed(%d). ignored\n", err); -} - -/* ---------------------------------------------------------------------- */ - -/* internal use only */ -struct au_cpup_reg_attr { - int valid; - struct kstat st; - unsigned int iflags; /* inode->i_flags */ -}; - -static noinline_for_stack -int cpup_iattr(struct dentry *dst, aufs_bindex_t bindex, struct dentry *h_src, - struct au_cpup_reg_attr *h_src_attr) -{ - int err, sbits, icex; - struct iattr ia; - struct path h_path; - struct inode *h_isrc, *h_idst; - struct kstat *h_st; - struct au_branch *br; - - h_path.dentry = au_h_dptr(dst, bindex); - h_idst = h_path.dentry->d_inode; - br = au_sbr(dst->d_sb, bindex); - h_path.mnt = au_br_mnt(br); - h_isrc = h_src->d_inode; - ia.ia_valid = ATTR_FORCE | ATTR_UID | ATTR_GID - | ATTR_ATIME | ATTR_MTIME - | ATTR_ATIME_SET | ATTR_MTIME_SET; - if (h_src_attr && h_src_attr->valid) { - h_st = &h_src_attr->st; - ia.ia_uid = h_st->uid; - ia.ia_gid = h_st->gid; - ia.ia_atime = h_st->atime; - ia.ia_mtime = h_st->mtime; - if (h_idst->i_mode != h_st->mode - && !S_ISLNK(h_idst->i_mode)) { - ia.ia_valid |= ATTR_MODE; - ia.ia_mode = h_st->mode; - } - sbits = !!(h_st->mode & (S_ISUID | S_ISGID)); - au_cpup_attr_flags(h_idst, h_src_attr->iflags); - } else { - ia.ia_uid = h_isrc->i_uid; - ia.ia_gid = h_isrc->i_gid; - ia.ia_atime = h_isrc->i_atime; - ia.ia_mtime = h_isrc->i_mtime; - if (h_idst->i_mode != h_isrc->i_mode - && !S_ISLNK(h_idst->i_mode)) { - ia.ia_valid |= ATTR_MODE; - ia.ia_mode = h_isrc->i_mode; - } - sbits = !!(h_isrc->i_mode & (S_ISUID | S_ISGID)); - au_cpup_attr_flags(h_idst, h_isrc->i_flags); - } - err = vfsub_notify_change(&h_path, &ia); - - /* is this nfs only? */ - if (!err && sbits && au_test_nfs(h_path.dentry->d_sb)) { - ia.ia_valid = ATTR_FORCE | ATTR_MODE; - ia.ia_mode = h_isrc->i_mode; - err = vfsub_notify_change(&h_path, &ia); - } - - icex = br->br_perm & AuBrAttr_ICEX; - if (!err) - err = au_cpup_xattr(h_path.dentry, h_src, icex); - - return err; -} - -/* ---------------------------------------------------------------------- */ - -static int au_do_copy_file(struct file *dst, struct file *src, loff_t len, - char *buf, unsigned long blksize) -{ - int err; - size_t sz, rbytes, wbytes; - unsigned char all_zero; - char *p, *zp; - struct mutex *h_mtx; - /* reduce stack usage */ - struct iattr *ia; - - zp = page_address(ZERO_PAGE(0)); - if (unlikely(!zp)) - return -ENOMEM; /* possible? */ - - err = 0; - all_zero = 0; - while (len) { - AuDbg("len %lld\n", len); - sz = blksize; - if (len < blksize) - sz = len; - - rbytes = 0; - /* todo: signal_pending? */ - while (!rbytes || err == -EAGAIN || err == -EINTR) { - rbytes = vfsub_read_k(src, buf, sz, &src->f_pos); - err = rbytes; - } - if (unlikely(err < 0)) - break; - - all_zero = 0; - if (len >= rbytes && rbytes == blksize) - all_zero = !memcmp(buf, zp, rbytes); - if (!all_zero) { - wbytes = rbytes; - p = buf; - while (wbytes) { - size_t b; - - b = vfsub_write_k(dst, p, wbytes, &dst->f_pos); - err = b; - /* todo: signal_pending? */ - if (unlikely(err == -EAGAIN || err == -EINTR)) - continue; - if (unlikely(err < 0)) - break; - wbytes -= b; - p += b; - } - if (unlikely(err < 0)) - break; - } else { - loff_t res; - - AuLabel(hole); - res = vfsub_llseek(dst, rbytes, SEEK_CUR); - err = res; - if (unlikely(res < 0)) - break; - } - len -= rbytes; - err = 0; - } - - /* the last block may be a hole */ - if (!err && all_zero) { - AuLabel(last hole); - - err = 1; - if (au_test_nfs(dst->f_dentry->d_sb)) { - /* nfs requires this step to make last hole */ - /* is this only nfs? */ - do { - /* todo: signal_pending? */ - err = vfsub_write_k(dst, "\0", 1, &dst->f_pos); - } while (err == -EAGAIN || err == -EINTR); - if (err == 1) - dst->f_pos--; - } - - if (err == 1) { - ia = (void *)buf; - ia->ia_size = dst->f_pos; - ia->ia_valid = ATTR_SIZE | ATTR_FILE; - ia->ia_file = dst; - h_mtx = &file_inode(dst)->i_mutex; - mutex_lock_nested(h_mtx, AuLsc_I_CHILD2); - err = vfsub_notify_change(&dst->f_path, ia); - mutex_unlock(h_mtx); - } - } - - return err; -} - -int au_copy_file(struct file *dst, struct file *src, loff_t len) -{ - int err; - unsigned long blksize; - unsigned char do_kfree; - char *buf; - - err = -ENOMEM; - blksize = dst->f_dentry->d_sb->s_blocksize; - if (!blksize || PAGE_SIZE < blksize) - blksize = PAGE_SIZE; - AuDbg("blksize %lu\n", blksize); - do_kfree = (blksize != PAGE_SIZE && blksize >= sizeof(struct iattr *)); - if (do_kfree) - buf = kmalloc(blksize, GFP_NOFS); - else - buf = (void *)__get_free_page(GFP_NOFS); - if (unlikely(!buf)) - goto out; - - if (len > (1 << 22)) - AuDbg("copying a large file %lld\n", (long long)len); - - src->f_pos = 0; - dst->f_pos = 0; - err = au_do_copy_file(dst, src, len, buf, blksize); - if (do_kfree) - kfree(buf); - else - free_page((unsigned long)buf); - -out: - return err; -} - -/* - * to support a sparse file which is opened with O_APPEND, - * we need to close the file. - */ -static int au_cp_regular(struct au_cp_generic *cpg) -{ - int err, i; - enum { SRC, DST }; - struct { - aufs_bindex_t bindex; - unsigned int flags; - struct dentry *dentry; - int force_wr; - struct file *file; - void *label, *label_file; - } *f, file[] = { - { - .bindex = cpg->bsrc, - .flags = O_RDONLY | O_NOATIME | O_LARGEFILE, - .label = &&out, - .label_file = &&out_src - }, - { - .bindex = cpg->bdst, - .flags = O_WRONLY | O_NOATIME | O_LARGEFILE, - .force_wr = !!au_ftest_cpup(cpg->flags, RWDST), - .label = &&out_src, - .label_file = &&out_dst - } - }; - struct super_block *sb; - - /* bsrc branch can be ro/rw. */ - sb = cpg->dentry->d_sb; - f = file; - for (i = 0; i < 2; i++, f++) { - f->dentry = au_h_dptr(cpg->dentry, f->bindex); - f->file = au_h_open(cpg->dentry, f->bindex, f->flags, - /*file*/NULL, f->force_wr); - err = PTR_ERR(f->file); - if (IS_ERR(f->file)) - goto *f->label; - err = -EINVAL; - if (unlikely(!f->file->f_op)) - goto *f->label_file; - } - - /* try stopping to update while we copyup */ - IMustLock(file[SRC].dentry->d_inode); - err = au_copy_file(file[DST].file, file[SRC].file, cpg->len); - -out_dst: - fput(file[DST].file); - au_sbr_put(sb, file[DST].bindex); -out_src: - fput(file[SRC].file); - au_sbr_put(sb, file[SRC].bindex); -out: - return err; -} - -static int au_do_cpup_regular(struct au_cp_generic *cpg, - struct au_cpup_reg_attr *h_src_attr) -{ - int err, rerr; - loff_t l; - struct path h_path; - struct inode *h_src_inode; - - err = 0; - h_src_inode = au_h_iptr(cpg->dentry->d_inode, cpg->bsrc); - l = i_size_read(h_src_inode); - if (cpg->len == -1 || l < cpg->len) - cpg->len = l; - if (cpg->len) { - /* try stopping to update while we are referencing */ - mutex_lock_nested(&h_src_inode->i_mutex, AuLsc_I_CHILD); - au_pin_hdir_unlock(cpg->pin); - - h_path.dentry = au_h_dptr(cpg->dentry, cpg->bsrc); - h_path.mnt = au_sbr_mnt(cpg->dentry->d_sb, cpg->bsrc); - h_src_attr->iflags = h_src_inode->i_flags; - err = vfs_getattr(&h_path, &h_src_attr->st); - if (unlikely(err)) { - mutex_unlock(&h_src_inode->i_mutex); - goto out; - } - h_src_attr->valid = 1; - err = au_cp_regular(cpg); - mutex_unlock(&h_src_inode->i_mutex); - rerr = au_pin_hdir_relock(cpg->pin); - if (!err && rerr) - err = rerr; - } - -out: - return err; -} - -static int au_do_cpup_symlink(struct path *h_path, struct dentry *h_src, - struct inode *h_dir) -{ - int err, symlen; - mm_segment_t old_fs; - union { - char *k; - char __user *u; - } sym; - - err = -ENOSYS; - if (unlikely(!h_src->d_inode->i_op->readlink)) - goto out; - - err = -ENOMEM; - sym.k = (void *)__get_free_page(GFP_NOFS); - if (unlikely(!sym.k)) - goto out; - - /* unnecessary to support mmap_sem since symlink is not mmap-able */ - old_fs = get_fs(); - set_fs(KERNEL_DS); - symlen = h_src->d_inode->i_op->readlink(h_src, sym.u, PATH_MAX); - err = symlen; - set_fs(old_fs); - - if (symlen > 0) { - sym.k[symlen] = 0; - err = vfsub_symlink(h_dir, h_path, sym.k); - } - free_page((unsigned long)sym.k); - -out: - return err; -} - -static noinline_for_stack -int cpup_entry(struct au_cp_generic *cpg, struct dentry *dst_parent, - struct au_cpup_reg_attr *h_src_attr) -{ - int err; - umode_t mode; - unsigned int mnt_flags; - unsigned char isdir, isreg, force; - const unsigned char do_dt = !!au_ftest_cpup(cpg->flags, DTIME); - struct au_dtime dt; - struct path h_path; - struct dentry *h_src, *h_dst, *h_parent; - struct inode *h_inode, *h_dir; - struct super_block *sb; - - /* bsrc branch can be ro/rw. */ - h_src = au_h_dptr(cpg->dentry, cpg->bsrc); - h_inode = h_src->d_inode; - AuDebugOn(h_inode != au_h_iptr(cpg->dentry->d_inode, cpg->bsrc)); - - /* try stopping to be referenced while we are creating */ - h_dst = au_h_dptr(cpg->dentry, cpg->bdst); - if (au_ftest_cpup(cpg->flags, RENAME)) - AuDebugOn(strncmp(h_dst->d_name.name, AUFS_WH_PFX, - AUFS_WH_PFX_LEN)); - h_parent = h_dst->d_parent; /* dir inode is locked */ - h_dir = h_parent->d_inode; - IMustLock(h_dir); - AuDebugOn(h_parent != h_dst->d_parent); - - sb = cpg->dentry->d_sb; - h_path.mnt = au_sbr_mnt(sb, cpg->bdst); - if (do_dt) { - h_path.dentry = h_parent; - au_dtime_store(&dt, dst_parent, &h_path); - } - h_path.dentry = h_dst; - - isreg = 0; - isdir = 0; - mode = h_inode->i_mode; - switch (mode & S_IFMT) { - case S_IFREG: - isreg = 1; - err = vfsub_create(h_dir, &h_path, mode | S_IWUSR, - /*want_excl*/true); - if (!err) - err = au_do_cpup_regular(cpg, h_src_attr); - break; - case S_IFDIR: - isdir = 1; - err = vfsub_mkdir(h_dir, &h_path, mode); - if (!err) { - /* - * strange behaviour from the users view, - * particularry setattr case - */ - if (au_ibstart(dst_parent->d_inode) == cpg->bdst) - au_cpup_attr_nlink(dst_parent->d_inode, - /*force*/1); - au_cpup_attr_nlink(cpg->dentry->d_inode, /*force*/1); - } - break; - case S_IFLNK: - err = au_do_cpup_symlink(&h_path, h_src, h_dir); - break; - case S_IFCHR: - case S_IFBLK: - AuDebugOn(!capable(CAP_MKNOD)); - /*FALLTHROUGH*/ - case S_IFIFO: - case S_IFSOCK: - err = vfsub_mknod(h_dir, &h_path, mode, h_inode->i_rdev); - break; - default: - AuIOErr("Unknown inode type 0%o\n", mode); - err = -EIO; - } - - mnt_flags = au_mntflags(sb); - if (!au_opt_test(mnt_flags, UDBA_NONE) - && !isdir - && au_opt_test(mnt_flags, XINO) - && h_inode->i_nlink == 1 - /* todo: unnecessary? */ - /* && cpg->dentry->d_inode->i_nlink == 1 */ - && cpg->bdst < cpg->bsrc - && !au_ftest_cpup(cpg->flags, KEEPLINO)) - au_xino_write(sb, cpg->bsrc, h_inode->i_ino, /*ino*/0); - /* ignore this error */ - - if (!err) { - force = 0; - if (isreg) { - force = !!cpg->len; - if (cpg->len == -1) - force = !!i_size_read(h_inode); - } - au_fhsm_wrote(sb, cpg->bdst, force); - } - - if (do_dt) - au_dtime_revert(&dt); - return err; -} - -static int au_do_ren_after_cpup(struct au_cp_generic *cpg, struct path *h_path) -{ - int err; - struct dentry *dentry, *h_dentry, *h_parent, *parent; - struct inode *h_dir; - aufs_bindex_t bdst; - - dentry = cpg->dentry; - bdst = cpg->bdst; - h_dentry = au_h_dptr(dentry, bdst); - if (!au_ftest_cpup(cpg->flags, OVERWRITE)) { - dget(h_dentry); - au_set_h_dptr(dentry, bdst, NULL); - err = au_lkup_neg(dentry, bdst, /*wh*/0); - if (!err) - h_path->dentry = dget(au_h_dptr(dentry, bdst)); - au_set_h_dptr(dentry, bdst, h_dentry); - } else { - err = 0; - parent = dget_parent(dentry); - h_parent = au_h_dptr(parent, bdst); - dput(parent); - h_path->dentry = vfsub_lkup_one(&dentry->d_name, h_parent); - if (IS_ERR(h_path->dentry)) - err = PTR_ERR(h_path->dentry); - } - if (unlikely(err)) - goto out; - - h_parent = h_dentry->d_parent; /* dir inode is locked */ - h_dir = h_parent->d_inode; - IMustLock(h_dir); - AuDbg("%.*s %.*s\n", AuDLNPair(h_dentry), AuDLNPair(h_path->dentry)); - err = vfsub_rename(h_dir, h_dentry, h_dir, h_path); - dput(h_path->dentry); - -out: - return err; -} - -/* - * copyup the @dentry from @bsrc to @bdst. - * the caller must set the both of lower dentries. - * @len is for truncating when it is -1 copyup the entire file. - * in link/rename cases, @dst_parent may be different from the real one. - * basic->bsrc can be larger than basic->bdst. - */ -static int au_cpup_single(struct au_cp_generic *cpg, struct dentry *dst_parent) -{ - int err, rerr; - aufs_bindex_t old_ibstart; - unsigned char isdir, plink; - struct dentry *h_src, *h_dst, *h_parent; - struct inode *dst_inode, *h_dir, *inode; - struct super_block *sb; - struct au_branch *br; - /* to reuduce stack size */ - struct { - struct au_dtime dt; - struct path h_path; - struct au_cpup_reg_attr h_src_attr; - } *a; - - err = -ENOMEM; - a = kmalloc(sizeof(*a), GFP_NOFS); - if (unlikely(!a)) - goto out; - a->h_src_attr.valid = 0; - - sb = cpg->dentry->d_sb; - br = au_sbr(sb, cpg->bdst); - a->h_path.mnt = au_br_mnt(br); - h_dst = au_h_dptr(cpg->dentry, cpg->bdst); - h_parent = h_dst->d_parent; /* dir inode is locked */ - h_dir = h_parent->d_inode; - IMustLock(h_dir); - - h_src = au_h_dptr(cpg->dentry, cpg->bsrc); - inode = cpg->dentry->d_inode; - - if (!dst_parent) - dst_parent = dget_parent(cpg->dentry); - else - dget(dst_parent); - - plink = !!au_opt_test(au_mntflags(sb), PLINK); - dst_inode = au_h_iptr(inode, cpg->bdst); - if (dst_inode) { - if (unlikely(!plink)) { - err = -EIO; - AuIOErr("hi%lu(i%lu) exists on b%d " - "but plink is disabled\n", - dst_inode->i_ino, inode->i_ino, cpg->bdst); - goto out_parent; - } - - if (dst_inode->i_nlink) { - const int do_dt = au_ftest_cpup(cpg->flags, DTIME); - - h_src = au_plink_lkup(inode, cpg->bdst); - err = PTR_ERR(h_src); - if (IS_ERR(h_src)) - goto out_parent; - if (unlikely(!h_src->d_inode)) { - err = -EIO; - AuIOErr("i%lu exists on a upper branch " - "but not pseudo-linked\n", - inode->i_ino); - dput(h_src); - goto out_parent; - } - - if (do_dt) { - a->h_path.dentry = h_parent; - au_dtime_store(&a->dt, dst_parent, &a->h_path); - } - - a->h_path.dentry = h_dst; - err = vfsub_link(h_src, h_dir, &a->h_path); - if (!err && au_ftest_cpup(cpg->flags, RENAME)) - err = au_do_ren_after_cpup(cpg, &a->h_path); - if (do_dt) - au_dtime_revert(&a->dt); - dput(h_src); - goto out_parent; - } else - /* todo: cpup_wh_file? */ - /* udba work */ - au_update_ibrange(inode, /*do_put_zero*/1); - } - - isdir = S_ISDIR(inode->i_mode); - old_ibstart = au_ibstart(inode); - err = cpup_entry(cpg, dst_parent, &a->h_src_attr); - if (unlikely(err)) - goto out_rev; - dst_inode = h_dst->d_inode; - mutex_lock_nested(&dst_inode->i_mutex, AuLsc_I_CHILD2); - /* todo: necessary? */ - /* au_pin_hdir_unlock(cpg->pin); */ - - err = cpup_iattr(cpg->dentry, cpg->bdst, h_src, &a->h_src_attr); - if (unlikely(err)) { - /* todo: necessary? */ - /* au_pin_hdir_relock(cpg->pin); */ /* ignore an error */ - mutex_unlock(&dst_inode->i_mutex); - goto out_rev; - } - - if (cpg->bdst < old_ibstart) { - if (S_ISREG(inode->i_mode)) { - err = au_dy_iaop(inode, cpg->bdst, dst_inode); - if (unlikely(err)) { - /* ignore an error */ - /* au_pin_hdir_relock(cpg->pin); */ - mutex_unlock(&dst_inode->i_mutex); - goto out_rev; - } - } - au_set_ibstart(inode, cpg->bdst); - } else - au_set_ibend(inode, cpg->bdst); - au_set_h_iptr(inode, cpg->bdst, au_igrab(dst_inode), - au_hi_flags(inode, isdir)); - - /* todo: necessary? */ - /* err = au_pin_hdir_relock(cpg->pin); */ - mutex_unlock(&dst_inode->i_mutex); - if (unlikely(err)) - goto out_rev; - - if (!isdir - && h_src->d_inode->i_nlink > 1 - && plink) - au_plink_append(inode, cpg->bdst, h_dst); - - if (au_ftest_cpup(cpg->flags, RENAME)) { - a->h_path.dentry = h_dst; - err = au_do_ren_after_cpup(cpg, &a->h_path); - } - if (!err) - goto out_parent; /* success */ - - /* revert */ -out_rev: - a->h_path.dentry = h_parent; - au_dtime_store(&a->dt, dst_parent, &a->h_path); - a->h_path.dentry = h_dst; - rerr = 0; - if (h_dst->d_inode) { - if (!isdir) - rerr = vfsub_unlink(h_dir, &a->h_path, /*force*/0); - else - rerr = vfsub_rmdir(h_dir, &a->h_path); - } - au_dtime_revert(&a->dt); - if (rerr) { - AuIOErr("failed removing broken entry(%d, %d)\n", err, rerr); - err = -EIO; - } -out_parent: - dput(dst_parent); - kfree(a); -out: - return err; -} - -#if 0 /* unused */ -struct au_cpup_single_args { - int *errp; - struct au_cp_generic *cpg; - struct dentry *dst_parent; -}; - -static void au_call_cpup_single(void *args) -{ - struct au_cpup_single_args *a = args; - - au_pin_hdir_acquire_nest(a->cpg->pin); - *a->errp = au_cpup_single(a->cpg, a->dst_parent); - au_pin_hdir_release(a->cpg->pin); -} -#endif - -/* - * prevent SIGXFSZ in copy-up. - * testing CAP_MKNOD is for generic fs, - * but CAP_FSETID is for xfs only, currently. - */ -static int au_cpup_sio_test(struct au_pin *pin, umode_t mode) -{ - int do_sio; - struct super_block *sb; - struct inode *h_dir; - - do_sio = 0; - sb = au_pinned_parent(pin)->d_sb; - if (!au_wkq_test() - && (!au_sbi(sb)->si_plink_maint_pid - || au_plink_maint(sb, AuLock_NOPLM))) { - switch (mode & S_IFMT) { - case S_IFREG: - /* no condition about RLIMIT_FSIZE and the file size */ - do_sio = 1; - break; - case S_IFCHR: - case S_IFBLK: - do_sio = !capable(CAP_MKNOD); - break; - } - if (!do_sio) - do_sio = ((mode & (S_ISUID | S_ISGID)) - && !capable(CAP_FSETID)); - /* this workaround may be removed in the future */ - if (!do_sio) { - h_dir = au_pinned_h_dir(pin); - do_sio = h_dir->i_mode & S_ISVTX; - } - } - - return do_sio; -} - -#if 0 /* unused */ -int au_sio_cpup_single(struct au_cp_generic *cpg, struct dentry *dst_parent) -{ - int err, wkq_err; - struct dentry *h_dentry; - - h_dentry = au_h_dptr(cpg->dentry, cpg->bsrc); - if (!au_cpup_sio_test(pin, h_dentry->d_inode->i_mode)) - err = au_cpup_single(cpg, dst_parent); - else { - struct au_cpup_single_args args = { - .errp = &err, - .cpg = cpg, - .dst_parent = dst_parent - }; - wkq_err = au_wkq_wait(au_call_cpup_single, &args); - if (unlikely(wkq_err)) - err = wkq_err; - } - - return err; -} -#endif - -/* - * copyup the @dentry from the first active lower branch to @bdst, - * using au_cpup_single(). - */ -static int au_cpup_simple(struct au_cp_generic *cpg) -{ - int err; - unsigned int flags_orig; - struct dentry *dentry; - - AuDebugOn(cpg->bsrc < 0); - - dentry = cpg->dentry; - DiMustWriteLock(dentry); - - err = au_lkup_neg(dentry, cpg->bdst, /*wh*/1); - if (!err) { - flags_orig = cpg->flags; - au_fset_cpup(cpg->flags, RENAME); - err = au_cpup_single(cpg, NULL); - cpg->flags = flags_orig; - if (!err) - return 0; /* success */ - - /* revert */ - au_set_h_dptr(dentry, cpg->bdst, NULL); - au_set_dbstart(dentry, cpg->bsrc); - } - - return err; -} - -struct au_cpup_simple_args { - int *errp; - struct au_cp_generic *cpg; -}; - -static void au_call_cpup_simple(void *args) -{ - struct au_cpup_simple_args *a = args; - - au_pin_hdir_acquire_nest(a->cpg->pin); - *a->errp = au_cpup_simple(a->cpg); - au_pin_hdir_release(a->cpg->pin); -} - -static int au_do_sio_cpup_simple(struct au_cp_generic *cpg) -{ - int err, wkq_err; - struct dentry *dentry, *parent; - struct file *h_file; - struct inode *h_dir; - - dentry = cpg->dentry; - h_file = NULL; - if (au_ftest_cpup(cpg->flags, HOPEN)) { - AuDebugOn(cpg->bsrc < 0); - h_file = au_h_open_pre(dentry, cpg->bsrc, /*force_wr*/0); - err = PTR_ERR(h_file); - if (IS_ERR(h_file)) - goto out; - } - - parent = dget_parent(dentry); - h_dir = au_h_iptr(parent->d_inode, cpg->bdst); - if (!au_test_h_perm_sio(h_dir, MAY_EXEC | MAY_WRITE) - && !au_cpup_sio_test(cpg->pin, dentry->d_inode->i_mode)) - err = au_cpup_simple(cpg); - else { - struct au_cpup_simple_args args = { - .errp = &err, - .cpg = cpg - }; - wkq_err = au_wkq_wait(au_call_cpup_simple, &args); - if (unlikely(wkq_err)) - err = wkq_err; - } - - dput(parent); - if (h_file) - au_h_open_post(dentry, cpg->bsrc, h_file); - -out: - return err; -} - -int au_sio_cpup_simple(struct au_cp_generic *cpg) -{ - aufs_bindex_t bsrc, bend; - struct dentry *dentry, *h_dentry; - - if (cpg->bsrc < 0) { - dentry = cpg->dentry; - bend = au_dbend(dentry); - for (bsrc = cpg->bdst + 1; bsrc <= bend; bsrc++) { - h_dentry = au_h_dptr(dentry, bsrc); - if (h_dentry) { - AuDebugOn(!h_dentry->d_inode); - break; - } - } - AuDebugOn(bsrc > bend); - cpg->bsrc = bsrc; - } - AuDebugOn(cpg->bsrc <= cpg->bdst); - return au_do_sio_cpup_simple(cpg); -} - -int au_sio_cpdown_simple(struct au_cp_generic *cpg) -{ - AuDebugOn(cpg->bdst <= cpg->bsrc); - return au_do_sio_cpup_simple(cpg); -} - -/* ---------------------------------------------------------------------- */ - -/* - * copyup the deleted file for writing. - */ -static int au_do_cpup_wh(struct au_cp_generic *cpg, struct dentry *wh_dentry, - struct file *file) -{ - int err; - unsigned int flags_orig; - aufs_bindex_t bsrc_orig; - struct dentry *h_d_dst, *h_d_start; - struct au_dinfo *dinfo; - struct au_hdentry *hdp; - - dinfo = au_di(cpg->dentry); - AuRwMustWriteLock(&dinfo->di_rwsem); - - bsrc_orig = cpg->bsrc; - cpg->bsrc = dinfo->di_bstart; - hdp = dinfo->di_hdentry; - h_d_dst = hdp[0 + cpg->bdst].hd_dentry; - dinfo->di_bstart = cpg->bdst; - hdp[0 + cpg->bdst].hd_dentry = wh_dentry; - h_d_start = NULL; - if (file) { - h_d_start = hdp[0 + cpg->bsrc].hd_dentry; - hdp[0 + cpg->bsrc].hd_dentry = au_hf_top(file)->f_dentry; - } - flags_orig = cpg->flags; - cpg->flags = !AuCpup_DTIME; - err = au_cpup_single(cpg, /*h_parent*/NULL); - cpg->flags = flags_orig; - if (file) { - if (!err) - err = au_reopen_nondir(file); - hdp[0 + cpg->bsrc].hd_dentry = h_d_start; - } - hdp[0 + cpg->bdst].hd_dentry = h_d_dst; - dinfo->di_bstart = cpg->bsrc; - cpg->bsrc = bsrc_orig; - - return err; -} - -static int au_cpup_wh(struct au_cp_generic *cpg, struct file *file) -{ - int err; - aufs_bindex_t bdst; - struct au_dtime dt; - struct dentry *dentry, *parent, *h_parent, *wh_dentry; - struct au_branch *br; - struct path h_path; - - dentry = cpg->dentry; - bdst = cpg->bdst; - br = au_sbr(dentry->d_sb, bdst); - parent = dget_parent(dentry); - h_parent = au_h_dptr(parent, bdst); - wh_dentry = au_whtmp_lkup(h_parent, br, &dentry->d_name); - err = PTR_ERR(wh_dentry); - if (IS_ERR(wh_dentry)) - goto out; - - h_path.dentry = h_parent; - h_path.mnt = au_br_mnt(br); - au_dtime_store(&dt, parent, &h_path); - err = au_do_cpup_wh(cpg, wh_dentry, file); - if (unlikely(err)) - goto out_wh; - - dget(wh_dentry); - h_path.dentry = wh_dentry; - if (!S_ISDIR(wh_dentry->d_inode->i_mode)) - err = vfsub_unlink(h_parent->d_inode, &h_path, /*force*/0); - else - err = vfsub_rmdir(h_parent->d_inode, &h_path); - if (unlikely(err)) { - AuIOErr("failed remove copied-up tmp file %.*s(%d)\n", - AuDLNPair(wh_dentry), err); - err = -EIO; - } - au_dtime_revert(&dt); - au_set_hi_wh(dentry->d_inode, bdst, wh_dentry); - -out_wh: - dput(wh_dentry); -out: - dput(parent); - return err; -} - -struct au_cpup_wh_args { - int *errp; - struct au_cp_generic *cpg; - struct file *file; -}; - -static void au_call_cpup_wh(void *args) -{ - struct au_cpup_wh_args *a = args; - - au_pin_hdir_acquire_nest(a->cpg->pin); - *a->errp = au_cpup_wh(a->cpg, a->file); - au_pin_hdir_release(a->cpg->pin); -} - -int au_sio_cpup_wh(struct au_cp_generic *cpg, struct file *file) -{ - int err, wkq_err; - aufs_bindex_t bdst; - struct dentry *dentry, *parent, *h_orph, *h_parent, *h_dentry; - struct inode *dir, *h_dir, *h_tmpdir; - struct au_wbr *wbr; - struct au_pin wh_pin, *pin_orig; - - dentry = cpg->dentry; - bdst = cpg->bdst; - parent = dget_parent(dentry); - dir = parent->d_inode; - h_orph = NULL; - h_parent = NULL; - h_dir = au_igrab(au_h_iptr(dir, bdst)); - h_tmpdir = h_dir; - pin_orig = NULL; - if (!h_dir->i_nlink) { - wbr = au_sbr(dentry->d_sb, bdst)->br_wbr; - h_orph = wbr->wbr_orph; - - h_parent = dget(au_h_dptr(parent, bdst)); - au_set_h_dptr(parent, bdst, dget(h_orph)); - h_tmpdir = h_orph->d_inode; - au_set_h_iptr(dir, bdst, au_igrab(h_tmpdir), /*flags*/0); - - if (file) - h_dentry = au_hf_top(file)->f_dentry; - else - h_dentry = au_h_dptr(dentry, au_dbstart(dentry)); - mutex_lock_nested(&h_tmpdir->i_mutex, AuLsc_I_PARENT3); - /* todo: au_h_open_pre()? */ - - pin_orig = cpg->pin; - au_pin_init(&wh_pin, dentry, bdst, AuLsc_DI_PARENT, - AuLsc_I_PARENT3, cpg->pin->udba, AuPin_DI_LOCKED); - cpg->pin = &wh_pin; - } - - if (!au_test_h_perm_sio(h_tmpdir, MAY_EXEC | MAY_WRITE) - && !au_cpup_sio_test(cpg->pin, dentry->d_inode->i_mode)) - err = au_cpup_wh(cpg, file); - else { - struct au_cpup_wh_args args = { - .errp = &err, - .cpg = cpg, - .file = file - }; - wkq_err = au_wkq_wait(au_call_cpup_wh, &args); - if (unlikely(wkq_err)) - err = wkq_err; - } - - if (h_orph) { - mutex_unlock(&h_tmpdir->i_mutex); - /* todo: au_h_open_post()? */ - au_set_h_iptr(dir, bdst, au_igrab(h_dir), /*flags*/0); - au_set_h_dptr(parent, bdst, h_parent); - AuDebugOn(!pin_orig); - cpg->pin = pin_orig; - } - iput(h_dir); - dput(parent); - - return err; -} - -/* ---------------------------------------------------------------------- */ - -/* - * generic routine for both of copy-up and copy-down. - */ -/* cf. revalidate function in file.c */ -int au_cp_dirs(struct dentry *dentry, aufs_bindex_t bdst, - int (*cp)(struct dentry *dentry, aufs_bindex_t bdst, - struct au_pin *pin, - struct dentry *h_parent, void *arg), - void *arg) -{ - int err; - struct au_pin pin; - struct dentry *d, *parent, *h_parent, *real_parent; - - err = 0; - parent = dget_parent(dentry); - if (IS_ROOT(parent)) - goto out; - - au_pin_init(&pin, dentry, bdst, AuLsc_DI_PARENT2, AuLsc_I_PARENT2, - au_opt_udba(dentry->d_sb), AuPin_MNT_WRITE); - - /* do not use au_dpage */ - real_parent = parent; - while (1) { - dput(parent); - parent = dget_parent(dentry); - h_parent = au_h_dptr(parent, bdst); - if (h_parent) - goto out; /* success */ - - /* find top dir which is necessary to cpup */ - do { - d = parent; - dput(parent); - parent = dget_parent(d); - di_read_lock_parent3(parent, !AuLock_IR); - h_parent = au_h_dptr(parent, bdst); - di_read_unlock(parent, !AuLock_IR); - } while (!h_parent); - - if (d != real_parent) - di_write_lock_child3(d); - - /* somebody else might create while we were sleeping */ - if (!au_h_dptr(d, bdst) || !au_h_dptr(d, bdst)->d_inode) { - if (au_h_dptr(d, bdst)) - au_update_dbstart(d); - - au_pin_set_dentry(&pin, d); - err = au_do_pin(&pin); - if (!err) { - err = cp(d, bdst, &pin, h_parent, arg); - au_unpin(&pin); - } - } - - if (d != real_parent) - di_write_unlock(d); - if (unlikely(err)) - break; - } - -out: - dput(parent); - return err; -} - -static int au_cpup_dir(struct dentry *dentry, aufs_bindex_t bdst, - struct au_pin *pin, - struct dentry *h_parent __maybe_unused , - void *arg __maybe_unused) -{ - struct au_cp_generic cpg = { - .dentry = dentry, - .bdst = bdst, - .bsrc = -1, - .len = 0, - .pin = pin, - .flags = AuCpup_DTIME - }; - return au_sio_cpup_simple(&cpg); -} - -int au_cpup_dirs(struct dentry *dentry, aufs_bindex_t bdst) -{ - return au_cp_dirs(dentry, bdst, au_cpup_dir, NULL); -} - -int au_test_and_cpup_dirs(struct dentry *dentry, aufs_bindex_t bdst) -{ - int err; - struct dentry *parent; - struct inode *dir; - - parent = dget_parent(dentry); - dir = parent->d_inode; - err = 0; - if (au_h_iptr(dir, bdst)) - goto out; - - di_read_unlock(parent, AuLock_IR); - di_write_lock_parent(parent); - /* someone else might change our inode while we were sleeping */ - if (!au_h_iptr(dir, bdst)) - err = au_cpup_dirs(dentry, bdst); - di_downgrade_lock(parent, AuLock_IR); - -out: - dput(parent); - return err; -} diff --git a/fs/aufs/cpup.h b/fs/aufs/cpup.h deleted file mode 100644 index 563ca3c9f26d93..00000000000000 --- a/fs/aufs/cpup.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * copy-up/down functions - */ - -#ifndef __AUFS_CPUP_H__ -#define __AUFS_CPUP_H__ - -#ifdef __KERNEL__ - -#include - -struct inode; -struct file; -struct au_pin; - -void au_cpup_attr_flags(struct inode *dst, unsigned int iflags); -void au_cpup_attr_timesizes(struct inode *inode); -void au_cpup_attr_nlink(struct inode *inode, int force); -void au_cpup_attr_changeable(struct inode *inode); -void au_cpup_igen(struct inode *inode, struct inode *h_inode); -void au_cpup_attr_all(struct inode *inode, int force); - -/* ---------------------------------------------------------------------- */ - -struct au_cp_generic { - struct dentry *dentry; - aufs_bindex_t bdst, bsrc; - loff_t len; - struct au_pin *pin; - unsigned int flags; -}; - -/* cpup flags */ -#define AuCpup_DTIME 1 /* do dtime_store/revert */ -#define AuCpup_KEEPLINO (1 << 1) /* do not clear the lower xino, - for link(2) */ -#define AuCpup_RENAME (1 << 2) /* rename after cpup */ -#define AuCpup_HOPEN (1 << 3) /* call h_open_pre/post() in - cpup */ -#define AuCpup_OVERWRITE (1 << 4) /* allow overwriting the - existing entry */ -#define AuCpup_RWDST (1 << 5) /* force write target even if - the branch is marked as RO */ - -#define au_ftest_cpup(flags, name) ((flags) & AuCpup_##name) -#define au_fset_cpup(flags, name) \ - do { (flags) |= AuCpup_##name; } while (0) -#define au_fclr_cpup(flags, name) \ - do { (flags) &= ~AuCpup_##name; } while (0) - -int au_copy_file(struct file *dst, struct file *src, loff_t len); -int au_sio_cpup_simple(struct au_cp_generic *cpg); -int au_sio_cpdown_simple(struct au_cp_generic *cpg); -int au_sio_cpup_wh(struct au_cp_generic *cpg, struct file *file); - -int au_cp_dirs(struct dentry *dentry, aufs_bindex_t bdst, - int (*cp)(struct dentry *dentry, aufs_bindex_t bdst, - struct au_pin *pin, - struct dentry *h_parent, void *arg), - void *arg); -int au_cpup_dirs(struct dentry *dentry, aufs_bindex_t bdst); -int au_test_and_cpup_dirs(struct dentry *dentry, aufs_bindex_t bdst); - -/* ---------------------------------------------------------------------- */ - -/* keep timestamps when copyup */ -struct au_dtime { - struct dentry *dt_dentry; - struct path dt_h_path; - struct timespec dt_atime, dt_mtime; -}; -void au_dtime_store(struct au_dtime *dt, struct dentry *dentry, - struct path *h_path); -void au_dtime_revert(struct au_dtime *dt); - -#endif /* __KERNEL__ */ -#endif /* __AUFS_CPUP_H__ */ diff --git a/fs/aufs/dbgaufs.c b/fs/aufs/dbgaufs.c deleted file mode 100644 index eef7249ce51daa..00000000000000 --- a/fs/aufs/dbgaufs.c +++ /dev/null @@ -1,432 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * debugfs interface - */ - -#include -#include "aufs.h" - -#ifndef CONFIG_SYSFS -#error DEBUG_FS depends upon SYSFS -#endif - -static struct dentry *dbgaufs; -static const mode_t dbgaufs_mode = S_IRUSR | S_IRGRP | S_IROTH; - -/* 20 is max digits length of ulong 64 */ -struct dbgaufs_arg { - int n; - char a[20 * 4]; -}; - -/* - * common function for all XINO files - */ -static int dbgaufs_xi_release(struct inode *inode __maybe_unused, - struct file *file) -{ - kfree(file->private_data); - return 0; -} - -static int dbgaufs_xi_open(struct file *xf, struct file *file, int do_fcnt) -{ - int err; - struct kstat st; - struct dbgaufs_arg *p; - - err = -ENOMEM; - p = kmalloc(sizeof(*p), GFP_NOFS); - if (unlikely(!p)) - goto out; - - err = 0; - p->n = 0; - file->private_data = p; - if (!xf) - goto out; - - err = vfs_getattr(&xf->f_path, &st); - if (!err) { - if (do_fcnt) - p->n = snprintf - (p->a, sizeof(p->a), "%ld, %llux%lu %lld\n", - (long)file_count(xf), st.blocks, st.blksize, - (long long)st.size); - else - p->n = snprintf(p->a, sizeof(p->a), "%llux%lu %lld\n", - st.blocks, st.blksize, - (long long)st.size); - AuDebugOn(p->n >= sizeof(p->a)); - } else { - p->n = snprintf(p->a, sizeof(p->a), "err %d\n", err); - err = 0; - } - -out: - return err; - -} - -static ssize_t dbgaufs_xi_read(struct file *file, char __user *buf, - size_t count, loff_t *ppos) -{ - struct dbgaufs_arg *p; - - p = file->private_data; - return simple_read_from_buffer(buf, count, ppos, p->a, p->n); -} - -/* ---------------------------------------------------------------------- */ - -struct dbgaufs_plink_arg { - int n; - char a[]; -}; - -static int dbgaufs_plink_release(struct inode *inode __maybe_unused, - struct file *file) -{ - free_page((unsigned long)file->private_data); - return 0; -} - -static int dbgaufs_plink_open(struct inode *inode, struct file *file) -{ - int err, i, limit; - unsigned long n, sum; - struct dbgaufs_plink_arg *p; - struct au_sbinfo *sbinfo; - struct super_block *sb; - struct au_sphlhead *sphl; - - err = -ENOMEM; - p = (void *)get_zeroed_page(GFP_NOFS); - if (unlikely(!p)) - goto out; - - err = -EFBIG; - sbinfo = inode->i_private; - sb = sbinfo->si_sb; - si_noflush_read_lock(sb); - if (au_opt_test(au_mntflags(sb), PLINK)) { - limit = PAGE_SIZE - sizeof(p->n); - - /* the number of buckets */ - n = snprintf(p->a + p->n, limit, "%d\n", AuPlink_NHASH); - p->n += n; - limit -= n; - - sum = 0; - for (i = 0, sphl = sbinfo->si_plink; - i < AuPlink_NHASH; - i++, sphl++) { - n = au_sphl_count(sphl); - sum += n; - - n = snprintf(p->a + p->n, limit, "%lu ", n); - p->n += n; - limit -= n; - if (unlikely(limit <= 0)) - goto out_free; - } - p->a[p->n - 1] = '\n'; - - /* the sum of plinks */ - n = snprintf(p->a + p->n, limit, "%lu\n", sum); - p->n += n; - limit -= n; - if (unlikely(limit <= 0)) - goto out_free; - } else { -#define str "1\n0\n0\n" - p->n = sizeof(str) - 1; - strcpy(p->a, str); -#undef str - } - si_read_unlock(sb); - - err = 0; - file->private_data = p; - goto out; /* success */ - -out_free: - free_page((unsigned long)p); -out: - return err; -} - -static ssize_t dbgaufs_plink_read(struct file *file, char __user *buf, - size_t count, loff_t *ppos) -{ - struct dbgaufs_plink_arg *p; - - p = file->private_data; - return simple_read_from_buffer(buf, count, ppos, p->a, p->n); -} - -static const struct file_operations dbgaufs_plink_fop = { - .owner = THIS_MODULE, - .open = dbgaufs_plink_open, - .release = dbgaufs_plink_release, - .read = dbgaufs_plink_read -}; - -/* ---------------------------------------------------------------------- */ - -static int dbgaufs_xib_open(struct inode *inode, struct file *file) -{ - int err; - struct au_sbinfo *sbinfo; - struct super_block *sb; - - sbinfo = inode->i_private; - sb = sbinfo->si_sb; - si_noflush_read_lock(sb); - err = dbgaufs_xi_open(sbinfo->si_xib, file, /*do_fcnt*/0); - si_read_unlock(sb); - return err; -} - -static const struct file_operations dbgaufs_xib_fop = { - .owner = THIS_MODULE, - .open = dbgaufs_xib_open, - .release = dbgaufs_xi_release, - .read = dbgaufs_xi_read -}; - -/* ---------------------------------------------------------------------- */ - -#define DbgaufsXi_PREFIX "xi" - -static int dbgaufs_xino_open(struct inode *inode, struct file *file) -{ - int err; - long l; - struct au_sbinfo *sbinfo; - struct super_block *sb; - struct file *xf; - struct qstr *name; - - err = -ENOENT; - xf = NULL; - name = &file->f_dentry->d_name; - if (unlikely(name->len < sizeof(DbgaufsXi_PREFIX) - || memcmp(name->name, DbgaufsXi_PREFIX, - sizeof(DbgaufsXi_PREFIX) - 1))) - goto out; - err = kstrtol(name->name + sizeof(DbgaufsXi_PREFIX) - 1, 10, &l); - if (unlikely(err)) - goto out; - - sbinfo = inode->i_private; - sb = sbinfo->si_sb; - si_noflush_read_lock(sb); - if (l <= au_sbend(sb)) { - xf = au_sbr(sb, (aufs_bindex_t)l)->br_xino.xi_file; - err = dbgaufs_xi_open(xf, file, /*do_fcnt*/1); - } else - err = -ENOENT; - si_read_unlock(sb); - -out: - return err; -} - -static const struct file_operations dbgaufs_xino_fop = { - .owner = THIS_MODULE, - .open = dbgaufs_xino_open, - .release = dbgaufs_xi_release, - .read = dbgaufs_xi_read -}; - -void dbgaufs_brs_del(struct super_block *sb, aufs_bindex_t bindex) -{ - aufs_bindex_t bend; - struct au_branch *br; - struct au_xino_file *xi; - - if (!au_sbi(sb)->si_dbgaufs) - return; - - bend = au_sbend(sb); - for (; bindex <= bend; bindex++) { - br = au_sbr(sb, bindex); - xi = &br->br_xino; - debugfs_remove(xi->xi_dbgaufs); - xi->xi_dbgaufs = NULL; - } -} - -void dbgaufs_brs_add(struct super_block *sb, aufs_bindex_t bindex) -{ - struct au_sbinfo *sbinfo; - struct dentry *parent; - struct au_branch *br; - struct au_xino_file *xi; - aufs_bindex_t bend; - char name[sizeof(DbgaufsXi_PREFIX) + 5]; /* "xi" bindex NULL */ - - sbinfo = au_sbi(sb); - parent = sbinfo->si_dbgaufs; - if (!parent) - return; - - bend = au_sbend(sb); - for (; bindex <= bend; bindex++) { - snprintf(name, sizeof(name), DbgaufsXi_PREFIX "%d", bindex); - br = au_sbr(sb, bindex); - xi = &br->br_xino; - AuDebugOn(xi->xi_dbgaufs); - xi->xi_dbgaufs = debugfs_create_file(name, dbgaufs_mode, parent, - sbinfo, &dbgaufs_xino_fop); - /* ignore an error */ - if (unlikely(!xi->xi_dbgaufs)) - AuWarn1("failed %s under debugfs\n", name); - } -} - -/* ---------------------------------------------------------------------- */ - -#ifdef CONFIG_AUFS_EXPORT -static int dbgaufs_xigen_open(struct inode *inode, struct file *file) -{ - int err; - struct au_sbinfo *sbinfo; - struct super_block *sb; - - sbinfo = inode->i_private; - sb = sbinfo->si_sb; - si_noflush_read_lock(sb); - err = dbgaufs_xi_open(sbinfo->si_xigen, file, /*do_fcnt*/0); - si_read_unlock(sb); - return err; -} - -static const struct file_operations dbgaufs_xigen_fop = { - .owner = THIS_MODULE, - .open = dbgaufs_xigen_open, - .release = dbgaufs_xi_release, - .read = dbgaufs_xi_read -}; - -static int dbgaufs_xigen_init(struct au_sbinfo *sbinfo) -{ - int err; - - /* - * This function is a dynamic '__init' function actually, - * so the tiny check for si_rwsem is unnecessary. - */ - /* AuRwMustWriteLock(&sbinfo->si_rwsem); */ - - err = -EIO; - sbinfo->si_dbgaufs_xigen = debugfs_create_file - ("xigen", dbgaufs_mode, sbinfo->si_dbgaufs, sbinfo, - &dbgaufs_xigen_fop); - if (sbinfo->si_dbgaufs_xigen) - err = 0; - - return err; -} -#else -static int dbgaufs_xigen_init(struct au_sbinfo *sbinfo) -{ - return 0; -} -#endif /* CONFIG_AUFS_EXPORT */ - -/* ---------------------------------------------------------------------- */ - -void dbgaufs_si_fin(struct au_sbinfo *sbinfo) -{ - /* - * This function is a dynamic '__init' function actually, - * so the tiny check for si_rwsem is unnecessary. - */ - /* AuRwMustWriteLock(&sbinfo->si_rwsem); */ - - debugfs_remove_recursive(sbinfo->si_dbgaufs); - sbinfo->si_dbgaufs = NULL; - kobject_put(&sbinfo->si_kobj); -} - -int dbgaufs_si_init(struct au_sbinfo *sbinfo) -{ - int err; - char name[SysaufsSiNameLen]; - - /* - * This function is a dynamic '__init' function actually, - * so the tiny check for si_rwsem is unnecessary. - */ - /* AuRwMustWriteLock(&sbinfo->si_rwsem); */ - - err = -ENOENT; - if (!dbgaufs) { - AuErr1("/debug/aufs is uninitialized\n"); - goto out; - } - - err = -EIO; - sysaufs_name(sbinfo, name); - sbinfo->si_dbgaufs = debugfs_create_dir(name, dbgaufs); - if (unlikely(!sbinfo->si_dbgaufs)) - goto out; - kobject_get(&sbinfo->si_kobj); - - sbinfo->si_dbgaufs_xib = debugfs_create_file - ("xib", dbgaufs_mode, sbinfo->si_dbgaufs, sbinfo, - &dbgaufs_xib_fop); - if (unlikely(!sbinfo->si_dbgaufs_xib)) - goto out_dir; - - sbinfo->si_dbgaufs_plink = debugfs_create_file - ("plink", dbgaufs_mode, sbinfo->si_dbgaufs, sbinfo, - &dbgaufs_plink_fop); - if (unlikely(!sbinfo->si_dbgaufs_plink)) - goto out_dir; - - err = dbgaufs_xigen_init(sbinfo); - if (!err) - goto out; /* success */ - -out_dir: - dbgaufs_si_fin(sbinfo); -out: - return err; -} - -/* ---------------------------------------------------------------------- */ - -void dbgaufs_fin(void) -{ - debugfs_remove(dbgaufs); -} - -int __init dbgaufs_init(void) -{ - int err; - - err = -EIO; - dbgaufs = debugfs_create_dir(AUFS_NAME, NULL); - if (dbgaufs) - err = 0; - return err; -} diff --git a/fs/aufs/dbgaufs.h b/fs/aufs/dbgaufs.h deleted file mode 100644 index ed79f6eefe6821..00000000000000 --- a/fs/aufs/dbgaufs.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * debugfs interface - */ - -#ifndef __DBGAUFS_H__ -#define __DBGAUFS_H__ - -#ifdef __KERNEL__ - -struct super_block; -struct au_sbinfo; - -#ifdef CONFIG_DEBUG_FS -/* dbgaufs.c */ -void dbgaufs_brs_del(struct super_block *sb, aufs_bindex_t bindex); -void dbgaufs_brs_add(struct super_block *sb, aufs_bindex_t bindex); -void dbgaufs_si_fin(struct au_sbinfo *sbinfo); -int dbgaufs_si_init(struct au_sbinfo *sbinfo); -void dbgaufs_fin(void); -int __init dbgaufs_init(void); -#else -AuStubVoid(dbgaufs_brs_del, struct super_block *sb, aufs_bindex_t bindex) -AuStubVoid(dbgaufs_brs_add, struct super_block *sb, aufs_bindex_t bindex) -AuStubVoid(dbgaufs_si_fin, struct au_sbinfo *sbinfo) -AuStubInt0(dbgaufs_si_init, struct au_sbinfo *sbinfo) -AuStubVoid(dbgaufs_fin, void) -AuStubInt0(__init dbgaufs_init, void) -#endif /* CONFIG_DEBUG_FS */ - -#endif /* __KERNEL__ */ -#endif /* __DBGAUFS_H__ */ diff --git a/fs/aufs/dcsub.c b/fs/aufs/dcsub.c deleted file mode 100644 index 1746e79da2d2e3..00000000000000 --- a/fs/aufs/dcsub.c +++ /dev/null @@ -1,242 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * sub-routines for dentry cache - */ - -#include "aufs.h" - -static void au_dpage_free(struct au_dpage *dpage) -{ - int i; - struct dentry **p; - - p = dpage->dentries; - for (i = 0; i < dpage->ndentry; i++) - dput(*p++); - free_page((unsigned long)dpage->dentries); -} - -int au_dpages_init(struct au_dcsub_pages *dpages, gfp_t gfp) -{ - int err; - void *p; - - err = -ENOMEM; - dpages->dpages = kmalloc(sizeof(*dpages->dpages), gfp); - if (unlikely(!dpages->dpages)) - goto out; - - p = (void *)__get_free_page(gfp); - if (unlikely(!p)) - goto out_dpages; - - dpages->dpages[0].ndentry = 0; - dpages->dpages[0].dentries = p; - dpages->ndpage = 1; - return 0; /* success */ - -out_dpages: - kfree(dpages->dpages); -out: - return err; -} - -void au_dpages_free(struct au_dcsub_pages *dpages) -{ - int i; - struct au_dpage *p; - - p = dpages->dpages; - for (i = 0; i < dpages->ndpage; i++) - au_dpage_free(p++); - kfree(dpages->dpages); -} - -static int au_dpages_append(struct au_dcsub_pages *dpages, - struct dentry *dentry, gfp_t gfp) -{ - int err, sz; - struct au_dpage *dpage; - void *p; - - dpage = dpages->dpages + dpages->ndpage - 1; - sz = PAGE_SIZE / sizeof(dentry); - if (unlikely(dpage->ndentry >= sz)) { - AuLabel(new dpage); - err = -ENOMEM; - sz = dpages->ndpage * sizeof(*dpages->dpages); - p = au_kzrealloc(dpages->dpages, sz, - sz + sizeof(*dpages->dpages), gfp); - if (unlikely(!p)) - goto out; - - dpages->dpages = p; - dpage = dpages->dpages + dpages->ndpage; - p = (void *)__get_free_page(gfp); - if (unlikely(!p)) - goto out; - - dpage->ndentry = 0; - dpage->dentries = p; - dpages->ndpage++; - } - - AuDebugOn(!dentry->d_count); - dpage->dentries[dpage->ndentry++] = dget_dlock(dentry); - return 0; /* success */ - -out: - return err; -} - -int au_dcsub_pages(struct au_dcsub_pages *dpages, struct dentry *root, - au_dpages_test test, void *arg) -{ - int err; - struct dentry *this_parent; - struct list_head *next; - struct super_block *sb = root->d_sb; - - err = 0; - write_seqlock(&rename_lock); - this_parent = root; - spin_lock(&this_parent->d_lock); -repeat: - next = this_parent->d_subdirs.next; -resume: - if (this_parent->d_sb == sb - && !IS_ROOT(this_parent) - && au_di(this_parent) - && this_parent->d_count - && (!test || test(this_parent, arg))) { - err = au_dpages_append(dpages, this_parent, GFP_ATOMIC); - if (unlikely(err)) - goto out; - } - - while (next != &this_parent->d_subdirs) { - struct list_head *tmp = next; - struct dentry *dentry = list_entry(tmp, struct dentry, - d_u.d_child); - - next = tmp->next; - spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); - if (dentry->d_count) { - if (!list_empty(&dentry->d_subdirs)) { - spin_unlock(&this_parent->d_lock); - spin_release(&dentry->d_lock.dep_map, 1, - _RET_IP_); - this_parent = dentry; - spin_acquire(&this_parent->d_lock.dep_map, 0, 1, - _RET_IP_); - goto repeat; - } - if (dentry->d_sb == sb - && au_di(dentry) - && (!test || test(dentry, arg))) - err = au_dpages_append(dpages, dentry, - GFP_ATOMIC); - } - spin_unlock(&dentry->d_lock); - if (unlikely(err)) - goto out; - } - - if (this_parent != root) { - struct dentry *tmp; - struct dentry *child; - - tmp = this_parent->d_parent; - rcu_read_lock(); - spin_unlock(&this_parent->d_lock); - child = this_parent; - this_parent = tmp; - spin_lock(&this_parent->d_lock); - rcu_read_unlock(); - next = child->d_u.d_child.next; - goto resume; - } - -out: - spin_unlock(&this_parent->d_lock); - write_sequnlock(&rename_lock); - return err; -} - -int au_dcsub_pages_rev(struct au_dcsub_pages *dpages, struct dentry *dentry, - int do_include, au_dpages_test test, void *arg) -{ - int err; - - err = 0; - write_seqlock(&rename_lock); - spin_lock(&dentry->d_lock); - if (do_include - && dentry->d_count - && (!test || test(dentry, arg))) - err = au_dpages_append(dpages, dentry, GFP_ATOMIC); - spin_unlock(&dentry->d_lock); - if (unlikely(err)) - goto out; - - /* - * vfsmount_lock is unnecessary since this is a traverse in a single - * mount - */ - while (!IS_ROOT(dentry)) { - dentry = dentry->d_parent; /* rename_lock is locked */ - spin_lock(&dentry->d_lock); - if (dentry->d_count - && (!test || test(dentry, arg))) - err = au_dpages_append(dpages, dentry, GFP_ATOMIC); - spin_unlock(&dentry->d_lock); - if (unlikely(err)) - break; - } - -out: - write_sequnlock(&rename_lock); - return err; -} - -static inline int au_dcsub_dpages_aufs(struct dentry *dentry, void *arg) -{ - return au_di(dentry) && dentry->d_sb == arg; -} - -int au_dcsub_pages_rev_aufs(struct au_dcsub_pages *dpages, - struct dentry *dentry, int do_include) -{ - return au_dcsub_pages_rev(dpages, dentry, do_include, - au_dcsub_dpages_aufs, dentry->d_sb); -} - -int au_test_subdir(struct dentry *d1, struct dentry *d2) -{ - struct path path[2] = { - { - .dentry = d1 - }, - { - .dentry = d2 - } - }; - - return path_is_under(path + 0, path + 1); -} diff --git a/fs/aufs/dcsub.h b/fs/aufs/dcsub.h deleted file mode 100644 index 0a9679b68d780b..00000000000000 --- a/fs/aufs/dcsub.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * sub-routines for dentry cache - */ - -#ifndef __AUFS_DCSUB_H__ -#define __AUFS_DCSUB_H__ - -#ifdef __KERNEL__ - -#include -#include - -struct dentry; - -struct au_dpage { - int ndentry; - struct dentry **dentries; -}; - -struct au_dcsub_pages { - int ndpage; - struct au_dpage *dpages; -}; - -/* ---------------------------------------------------------------------- */ - -/* dcsub.c */ -int au_dpages_init(struct au_dcsub_pages *dpages, gfp_t gfp); -void au_dpages_free(struct au_dcsub_pages *dpages); -typedef int (*au_dpages_test)(struct dentry *dentry, void *arg); -int au_dcsub_pages(struct au_dcsub_pages *dpages, struct dentry *root, - au_dpages_test test, void *arg); -int au_dcsub_pages_rev(struct au_dcsub_pages *dpages, struct dentry *dentry, - int do_include, au_dpages_test test, void *arg); -int au_dcsub_pages_rev_aufs(struct au_dcsub_pages *dpages, - struct dentry *dentry, int do_include); -int au_test_subdir(struct dentry *d1, struct dentry *d2); - -/* ---------------------------------------------------------------------- */ - -static inline int au_d_hashed_positive(struct dentry *d) -{ - int err; - struct inode *inode = d->d_inode; - - err = 0; - if (unlikely(d_unhashed(d) || !inode || !inode->i_nlink)) - err = -ENOENT; - return err; -} - -static inline int au_d_alive(struct dentry *d) -{ - int err; - struct inode *inode; - - err = 0; - if (!IS_ROOT(d)) - err = au_d_hashed_positive(d); - else { - inode = d->d_inode; - if (unlikely(d_unlinked(d) || !inode || !inode->i_nlink)) - err = -ENOENT; - } - return err; -} - -static inline int au_alive_dir(struct dentry *d) -{ - int err; - - err = au_d_alive(d); - if (unlikely(err || IS_DEADDIR(d->d_inode))) - err = -ENOENT; - return err; -} - -static inline int au_qstreq(struct qstr *a, struct qstr *b) -{ - return a->len == b->len - && !memcmp(a->name, b->name, a->len); -} - -#endif /* __KERNEL__ */ -#endif /* __AUFS_DCSUB_H__ */ diff --git a/fs/aufs/debug.c b/fs/aufs/debug.c deleted file mode 100644 index 3465e79e51da8b..00000000000000 --- a/fs/aufs/debug.c +++ /dev/null @@ -1,520 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * debug print functions - */ - -#include -#include "aufs.h" - -/* Returns 0, or -errno. arg is in kp->arg. */ -static int param_atomic_t_set(const char *val, const struct kernel_param *kp) -{ - int err, n; - - err = kstrtoint(val, 0, &n); - if (!err) { - if (n > 0) - au_debug_on(); - else - au_debug_off(); - } - return err; -} - -/* Returns length written or -errno. Buffer is 4k (ie. be short!) */ -static int param_atomic_t_get(char *buffer, const struct kernel_param *kp) -{ - atomic_t *a; - - a = kp->arg; - return sprintf(buffer, "%d", atomic_read(a)); -} - -static struct kernel_param_ops param_ops_atomic_t = { - .set = param_atomic_t_set, - .get = param_atomic_t_get - /* void (*free)(void *arg) */ -}; - -atomic_t aufs_debug = ATOMIC_INIT(0); -MODULE_PARM_DESC(debug, "debug print"); -module_param_named(debug, aufs_debug, atomic_t, S_IRUGO | S_IWUSR | S_IWGRP); - -DEFINE_MUTEX(au_dbg_mtx); /* just to serialize the dbg msgs */ -char *au_plevel = KERN_DEBUG; -#define dpri(fmt, ...) do { \ - if ((au_plevel \ - && strcmp(au_plevel, KERN_DEBUG)) \ - || au_debug_test()) \ - printk("%s" fmt, au_plevel, ##__VA_ARGS__); \ -} while (0) - -/* ---------------------------------------------------------------------- */ - -void au_dpri_whlist(struct au_nhash *whlist) -{ - unsigned long ul, n; - struct hlist_head *head; - struct au_vdir_wh *pos; - - n = whlist->nh_num; - head = whlist->nh_head; - for (ul = 0; ul < n; ul++) { - hlist_for_each_entry(pos, head, wh_hash) - dpri("b%d, %.*s, %d\n", - pos->wh_bindex, - pos->wh_str.len, pos->wh_str.name, - pos->wh_str.len); - head++; - } -} - -void au_dpri_vdir(struct au_vdir *vdir) -{ - unsigned long ul; - union au_vdir_deblk_p p; - unsigned char *o; - - if (!vdir || IS_ERR(vdir)) { - dpri("err %ld\n", PTR_ERR(vdir)); - return; - } - - dpri("deblk %u, nblk %lu, deblk %p, last{%lu, %p}, ver %lu\n", - vdir->vd_deblk_sz, vdir->vd_nblk, vdir->vd_deblk, - vdir->vd_last.ul, vdir->vd_last.p.deblk, vdir->vd_version); - for (ul = 0; ul < vdir->vd_nblk; ul++) { - p.deblk = vdir->vd_deblk[ul]; - o = p.deblk; - dpri("[%lu]: %p\n", ul, o); - } -} - -static int do_pri_inode(aufs_bindex_t bindex, struct inode *inode, int hn, - struct dentry *wh) -{ - char *n = NULL; - int l = 0; - - if (!inode || IS_ERR(inode)) { - dpri("i%d: err %ld\n", bindex, PTR_ERR(inode)); - return -1; - } - - /* the type of i_blocks depends upon CONFIG_LBDAF */ - BUILD_BUG_ON(sizeof(inode->i_blocks) != sizeof(unsigned long) - && sizeof(inode->i_blocks) != sizeof(u64)); - if (wh) { - n = (void *)wh->d_name.name; - l = wh->d_name.len; - } - - dpri("i%d: %p, i%lu, %s, cnt %d, nl %u, 0%o, sz %llu, blk %llu," - " hn %d, ct %lld, np %lu, st 0x%lx, f 0x%x, v %llu, g %x%s%.*s\n", - bindex, inode, - inode->i_ino, inode->i_sb ? au_sbtype(inode->i_sb) : "??", - atomic_read(&inode->i_count), inode->i_nlink, inode->i_mode, - i_size_read(inode), (unsigned long long)inode->i_blocks, - hn, (long long)timespec_to_ns(&inode->i_ctime) & 0x0ffff, - inode->i_mapping ? inode->i_mapping->nrpages : 0, - inode->i_state, inode->i_flags, inode->i_version, - inode->i_generation, - l ? ", wh " : "", l, n); - return 0; -} - -void au_dpri_inode(struct inode *inode) -{ - struct au_iinfo *iinfo; - aufs_bindex_t bindex; - int err, hn; - - err = do_pri_inode(-1, inode, -1, NULL); - if (err || !au_test_aufs(inode->i_sb)) - return; - - iinfo = au_ii(inode); - if (!iinfo) - return; - dpri("i-1: bstart %d, bend %d, gen %d\n", - iinfo->ii_bstart, iinfo->ii_bend, au_iigen(inode, NULL)); - if (iinfo->ii_bstart < 0) - return; - hn = 0; - for (bindex = iinfo->ii_bstart; bindex <= iinfo->ii_bend; bindex++) { - hn = !!au_hn(iinfo->ii_hinode + bindex); - do_pri_inode(bindex, iinfo->ii_hinode[0 + bindex].hi_inode, hn, - iinfo->ii_hinode[0 + bindex].hi_whdentry); - } -} - -void au_dpri_dalias(struct inode *inode) -{ - struct dentry *d; - - spin_lock(&inode->i_lock); - hlist_for_each_entry(d, &inode->i_dentry, d_alias) - au_dpri_dentry(d); - spin_unlock(&inode->i_lock); -} - -static int do_pri_dentry(aufs_bindex_t bindex, struct dentry *dentry) -{ - struct dentry *wh = NULL; - int hn; - struct au_iinfo *iinfo; - - if (!dentry || IS_ERR(dentry)) { - dpri("d%d: err %ld\n", bindex, PTR_ERR(dentry)); - return -1; - } - /* do not call dget_parent() here */ - /* note: access d_xxx without d_lock */ - dpri("d%d: %p, %.*s?/%.*s, %s, cnt %d, flags 0x%x, %shashed\n", - bindex, dentry, - AuDLNPair(dentry->d_parent), AuDLNPair(dentry), - dentry->d_sb ? au_sbtype(dentry->d_sb) : "??", - dentry->d_count, dentry->d_flags, - d_unhashed(dentry) ? "un" : ""); - hn = -1; - if (bindex >= 0 && dentry->d_inode && au_test_aufs(dentry->d_sb)) { - iinfo = au_ii(dentry->d_inode); - if (iinfo) { - hn = !!au_hn(iinfo->ii_hinode + bindex); - wh = iinfo->ii_hinode[0 + bindex].hi_whdentry; - } - } - do_pri_inode(bindex, dentry->d_inode, hn, wh); - return 0; -} - -void au_dpri_dentry(struct dentry *dentry) -{ - struct au_dinfo *dinfo; - aufs_bindex_t bindex; - int err; - struct au_hdentry *hdp; - - err = do_pri_dentry(-1, dentry); - if (err || !au_test_aufs(dentry->d_sb)) - return; - - dinfo = au_di(dentry); - if (!dinfo) - return; - dpri("d-1: bstart %d, bend %d, bwh %d, bdiropq %d, gen %d\n", - dinfo->di_bstart, dinfo->di_bend, - dinfo->di_bwh, dinfo->di_bdiropq, au_digen(dentry)); - if (dinfo->di_bstart < 0) - return; - hdp = dinfo->di_hdentry; - for (bindex = dinfo->di_bstart; bindex <= dinfo->di_bend; bindex++) - do_pri_dentry(bindex, hdp[0 + bindex].hd_dentry); -} - -static int do_pri_file(aufs_bindex_t bindex, struct file *file) -{ - char a[32]; - - if (!file || IS_ERR(file)) { - dpri("f%d: err %ld\n", bindex, PTR_ERR(file)); - return -1; - } - a[0] = 0; - if (bindex < 0 - && file->f_dentry - && au_test_aufs(file->f_dentry->d_sb) - && au_fi(file)) - snprintf(a, sizeof(a), ", gen %d, mmapped %d", - au_figen(file), atomic_read(&au_fi(file)->fi_mmapped)); - dpri("f%d: mode 0x%x, flags 0%o, cnt %ld, v %llu, pos %llu%s\n", - bindex, file->f_mode, file->f_flags, (long)file_count(file), - file->f_version, file->f_pos, a); - if (file->f_dentry) - do_pri_dentry(bindex, file->f_dentry); - return 0; -} - -void au_dpri_file(struct file *file) -{ - struct au_finfo *finfo; - struct au_fidir *fidir; - struct au_hfile *hfile; - aufs_bindex_t bindex; - int err; - - err = do_pri_file(-1, file); - if (err || !file->f_dentry || !au_test_aufs(file->f_dentry->d_sb)) - return; - - finfo = au_fi(file); - if (!finfo) - return; - if (finfo->fi_btop < 0) - return; - fidir = finfo->fi_hdir; - if (!fidir) - do_pri_file(finfo->fi_btop, finfo->fi_htop.hf_file); - else - for (bindex = finfo->fi_btop; - bindex >= 0 && bindex <= fidir->fd_bbot; - bindex++) { - hfile = fidir->fd_hfile + bindex; - do_pri_file(bindex, hfile ? hfile->hf_file : NULL); - } -} - -static int do_pri_br(aufs_bindex_t bindex, struct au_branch *br) -{ - struct vfsmount *mnt; - struct super_block *sb; - - if (!br || IS_ERR(br)) - goto out; - mnt = au_br_mnt(br); - if (!mnt || IS_ERR(mnt)) - goto out; - sb = mnt->mnt_sb; - if (!sb || IS_ERR(sb)) - goto out; - - dpri("s%d: {perm 0x%x, id %d, cnt %d, wbr %p}, " - "%s, dev 0x%02x%02x, flags 0x%lx, cnt %d, active %d, " - "xino %d\n", - bindex, br->br_perm, br->br_id, atomic_read(&br->br_count), - br->br_wbr, au_sbtype(sb), MAJOR(sb->s_dev), MINOR(sb->s_dev), - sb->s_flags, sb->s_count, - atomic_read(&sb->s_active), !!br->br_xino.xi_file); - return 0; - -out: - dpri("s%d: err %ld\n", bindex, PTR_ERR(br)); - return -1; -} - -void au_dpri_sb(struct super_block *sb) -{ - struct au_sbinfo *sbinfo; - aufs_bindex_t bindex; - int err; - /* to reuduce stack size */ - struct { - struct vfsmount mnt; - struct au_branch fake; - } *a; - - /* this function can be called from magic sysrq */ - a = kzalloc(sizeof(*a), GFP_ATOMIC); - if (unlikely(!a)) { - dpri("no memory\n"); - return; - } - - a->mnt.mnt_sb = sb; - a->fake.br_perm = 0; - a->fake.br_path.mnt = &a->mnt; - a->fake.br_xino.xi_file = NULL; - atomic_set(&a->fake.br_count, 0); - smp_mb(); /* atomic_set */ - err = do_pri_br(-1, &a->fake); - kfree(a); - dpri("dev 0x%x\n", sb->s_dev); - if (err || !au_test_aufs(sb)) - return; - - sbinfo = au_sbi(sb); - if (!sbinfo) - return; - dpri("nw %d, gen %u, kobj %d\n", - atomic_read(&sbinfo->si_nowait.nw_len), sbinfo->si_generation, - atomic_read(&sbinfo->si_kobj.kref.refcount)); - for (bindex = 0; bindex <= sbinfo->si_bend; bindex++) - do_pri_br(bindex, sbinfo->si_branch[0 + bindex]); -} - -/* ---------------------------------------------------------------------- */ - -void au_dbg_sleep_jiffy(int jiffy) -{ - while (jiffy) - jiffy = schedule_timeout_uninterruptible(jiffy); -} - -void au_dbg_iattr(struct iattr *ia) -{ -#define AuBit(name) \ - do { \ - if (ia->ia_valid & ATTR_ ## name) \ - dpri(#name "\n"); \ - } while (0) - AuBit(MODE); - AuBit(UID); - AuBit(GID); - AuBit(SIZE); - AuBit(ATIME); - AuBit(MTIME); - AuBit(CTIME); - AuBit(ATIME_SET); - AuBit(MTIME_SET); - AuBit(FORCE); - AuBit(ATTR_FLAG); - AuBit(KILL_SUID); - AuBit(KILL_SGID); - AuBit(FILE); - AuBit(KILL_PRIV); - AuBit(OPEN); - AuBit(TIMES_SET); -#undef AuBit - dpri("ia_file %p\n", ia->ia_file); -} - -/* ---------------------------------------------------------------------- */ - -void __au_dbg_verify_dinode(struct dentry *dentry, const char *func, int line) -{ - struct inode *h_inode, *inode = dentry->d_inode; - struct dentry *h_dentry; - aufs_bindex_t bindex, bend, bi; - - if (!inode /* || au_di(dentry)->di_lsc == AuLsc_DI_TMP */) - return; - - bend = au_dbend(dentry); - bi = au_ibend(inode); - if (bi < bend) - bend = bi; - bindex = au_dbstart(dentry); - bi = au_ibstart(inode); - if (bi > bindex) - bindex = bi; - - for (; bindex <= bend; bindex++) { - h_dentry = au_h_dptr(dentry, bindex); - if (!h_dentry) - continue; - h_inode = au_h_iptr(inode, bindex); - if (unlikely(h_inode != h_dentry->d_inode)) { - au_debug_on(); - AuDbg("b%d, %s:%d\n", bindex, func, line); - AuDbgDentry(dentry); - AuDbgInode(inode); - au_debug_off(); - BUG(); - } - } -} - -void au_dbg_verify_dir_parent(struct dentry *dentry, unsigned int sigen) -{ - struct dentry *parent; - - parent = dget_parent(dentry); - AuDebugOn(!S_ISDIR(dentry->d_inode->i_mode)); - AuDebugOn(IS_ROOT(dentry)); - AuDebugOn(au_digen_test(parent, sigen)); - dput(parent); -} - -void au_dbg_verify_nondir_parent(struct dentry *dentry, unsigned int sigen) -{ - struct dentry *parent; - struct inode *inode; - - parent = dget_parent(dentry); - inode = dentry->d_inode; - AuDebugOn(inode && S_ISDIR(dentry->d_inode->i_mode)); - AuDebugOn(au_digen_test(parent, sigen)); - dput(parent); -} - -void au_dbg_verify_gen(struct dentry *parent, unsigned int sigen) -{ - int err, i, j; - struct au_dcsub_pages dpages; - struct au_dpage *dpage; - struct dentry **dentries; - - err = au_dpages_init(&dpages, GFP_NOFS); - AuDebugOn(err); - err = au_dcsub_pages_rev_aufs(&dpages, parent, /*do_include*/1); - AuDebugOn(err); - for (i = dpages.ndpage - 1; !err && i >= 0; i--) { - dpage = dpages.dpages + i; - dentries = dpage->dentries; - for (j = dpage->ndentry - 1; !err && j >= 0; j--) - AuDebugOn(au_digen_test(dentries[j], sigen)); - } - au_dpages_free(&dpages); -} - -void au_dbg_verify_kthread(void) -{ - if (au_wkq_test()) { - au_dbg_blocked(); - /* - * It may be recursive, but udba=notify between two aufs mounts, - * where a single ro branch is shared, is not a problem. - */ - /* WARN_ON(1); */ - } -} - -/* ---------------------------------------------------------------------- */ - -void au_debug_sbinfo_init(struct au_sbinfo *sbinfo __maybe_unused) -{ -#ifdef AuForceNoPlink - au_opt_clr(sbinfo->si_mntflags, PLINK); -#endif -#ifdef AuForceNoXino - au_opt_clr(sbinfo->si_mntflags, XINO); -#endif -#ifdef AuForceNoRefrof - au_opt_clr(sbinfo->si_mntflags, REFROF); -#endif -#ifdef AuForceHnotify - au_opt_set_udba(sbinfo->si_mntflags, UDBA_HNOTIFY); -#endif -#ifdef AuForceRd0 - sbinfo->si_rdblk = 0; - sbinfo->si_rdhash = 0; -#endif -} - -int __init au_debug_init(void) -{ - aufs_bindex_t bindex; - struct au_vdir_destr destr; - - bindex = -1; - AuDebugOn(bindex >= 0); - - destr.len = -1; - AuDebugOn(destr.len < NAME_MAX); - -#ifdef CONFIG_4KSTACKS - pr_warn("CONFIG_4KSTACKS is defined.\n"); -#endif - -#ifdef AuForceNoBrs - sysaufs_brs = 0; -#endif - - return 0; -} diff --git a/fs/aufs/debug.h b/fs/aufs/debug.h deleted file mode 100644 index dfda1eb201b220..00000000000000 --- a/fs/aufs/debug.h +++ /dev/null @@ -1,263 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * debug print functions - */ - -#ifndef __AUFS_DEBUG_H__ -#define __AUFS_DEBUG_H__ - -#ifdef __KERNEL__ - -#include -#include -#include -#include - -#ifdef CONFIG_AUFS_DEBUG -#define AuDebugOn(a) BUG_ON(a) - -/* module parameter */ -extern atomic_t aufs_debug; -static inline void au_debug_on(void) -{ - atomic_inc(&aufs_debug); -} -static inline void au_debug_off(void) -{ - atomic_dec_if_positive(&aufs_debug); -} - -static inline int au_debug_test(void) -{ - return atomic_read(&aufs_debug) > 0; -} -#else -#define AuDebugOn(a) do {} while (0) -AuStubVoid(au_debug_on, void) -AuStubVoid(au_debug_off, void) -AuStubInt0(au_debug_test, void) -#endif /* CONFIG_AUFS_DEBUG */ - -#define param_check_atomic_t(name, p) __param_check(name, p, atomic_t) - -/* ---------------------------------------------------------------------- */ - -/* debug print */ - -#define AuDbg(fmt, ...) do { \ - if (au_debug_test()) \ - pr_debug("DEBUG: " fmt, ##__VA_ARGS__); \ -} while (0) -#define AuLabel(l) AuDbg(#l "\n") -#define AuIOErr(fmt, ...) pr_err("I/O Error, " fmt, ##__VA_ARGS__) -#define AuWarn1(fmt, ...) do { \ - static unsigned char _c; \ - if (!_c++) \ - pr_warn(fmt, ##__VA_ARGS__); \ -} while (0) - -#define AuErr1(fmt, ...) do { \ - static unsigned char _c; \ - if (!_c++) \ - pr_err(fmt, ##__VA_ARGS__); \ -} while (0) - -#define AuIOErr1(fmt, ...) do { \ - static unsigned char _c; \ - if (!_c++) \ - AuIOErr(fmt, ##__VA_ARGS__); \ -} while (0) - -#define AuUnsupportMsg "This operation is not supported." \ - " Please report this application to aufs-users ML." -#define AuUnsupport(fmt, ...) do { \ - pr_err(AuUnsupportMsg "\n" fmt, ##__VA_ARGS__); \ - dump_stack(); \ -} while (0) - -#define AuTraceErr(e) do { \ - if (unlikely((e) < 0)) \ - AuDbg("err %d\n", (int)(e)); \ -} while (0) - -#define AuTraceErrPtr(p) do { \ - if (IS_ERR(p)) \ - AuDbg("err %ld\n", PTR_ERR(p)); \ -} while (0) - -/* dirty macros for debug print, use with "%.*s" and caution */ -#define AuLNPair(qstr) (qstr)->len, (qstr)->name -#define AuDLNPair(d) AuLNPair(&(d)->d_name) - -/* ---------------------------------------------------------------------- */ - -struct au_sbinfo; -struct au_finfo; -struct dentry; -#ifdef CONFIG_AUFS_DEBUG -extern struct mutex au_dbg_mtx; -extern char *au_plevel; -struct au_nhash; -void au_dpri_whlist(struct au_nhash *whlist); -struct au_vdir; -void au_dpri_vdir(struct au_vdir *vdir); -struct inode; -void au_dpri_inode(struct inode *inode); -void au_dpri_dalias(struct inode *inode); -void au_dpri_dentry(struct dentry *dentry); -struct file; -void au_dpri_file(struct file *filp); -struct super_block; -void au_dpri_sb(struct super_block *sb); - -void au_dbg_sleep_jiffy(int jiffy); -struct iattr; -void au_dbg_iattr(struct iattr *ia); - -#define au_dbg_verify_dinode(d) __au_dbg_verify_dinode(d, __func__, __LINE__) -void __au_dbg_verify_dinode(struct dentry *dentry, const char *func, int line); -void au_dbg_verify_dir_parent(struct dentry *dentry, unsigned int sigen); -void au_dbg_verify_nondir_parent(struct dentry *dentry, unsigned int sigen); -void au_dbg_verify_gen(struct dentry *parent, unsigned int sigen); -void au_dbg_verify_kthread(void); - -int __init au_debug_init(void); -void au_debug_sbinfo_init(struct au_sbinfo *sbinfo); -#define AuDbgWhlist(w) do { \ - mutex_lock(&au_dbg_mtx); \ - AuDbg(#w "\n"); \ - au_dpri_whlist(w); \ - mutex_unlock(&au_dbg_mtx); \ -} while (0) - -#define AuDbgVdir(v) do { \ - mutex_lock(&au_dbg_mtx); \ - AuDbg(#v "\n"); \ - au_dpri_vdir(v); \ - mutex_unlock(&au_dbg_mtx); \ -} while (0) - -#define AuDbgInode(i) do { \ - mutex_lock(&au_dbg_mtx); \ - AuDbg(#i "\n"); \ - au_dpri_inode(i); \ - mutex_unlock(&au_dbg_mtx); \ -} while (0) - -#define AuDbgDAlias(i) do { \ - mutex_lock(&au_dbg_mtx); \ - AuDbg(#i "\n"); \ - au_dpri_dalias(i); \ - mutex_unlock(&au_dbg_mtx); \ -} while (0) - -#define AuDbgDentry(d) do { \ - mutex_lock(&au_dbg_mtx); \ - AuDbg(#d "\n"); \ - au_dpri_dentry(d); \ - mutex_unlock(&au_dbg_mtx); \ -} while (0) - -#define AuDbgFile(f) do { \ - mutex_lock(&au_dbg_mtx); \ - AuDbg(#f "\n"); \ - au_dpri_file(f); \ - mutex_unlock(&au_dbg_mtx); \ -} while (0) - -#define AuDbgSb(sb) do { \ - mutex_lock(&au_dbg_mtx); \ - AuDbg(#sb "\n"); \ - au_dpri_sb(sb); \ - mutex_unlock(&au_dbg_mtx); \ -} while (0) - -#define AuDbgSleep(sec) do { \ - AuDbg("sleep %d sec\n", sec); \ - ssleep(sec); \ -} while (0) - -#define AuDbgSleepJiffy(jiffy) do { \ - AuDbg("sleep %d jiffies\n", jiffy); \ - au_dbg_sleep_jiffy(jiffy); \ -} while (0) - -#define AuDbgIAttr(ia) do { \ - AuDbg("ia_valid 0x%x\n", (ia)->ia_valid); \ - au_dbg_iattr(ia); \ -} while (0) - -#define AuDbgSym(addr) do { \ - char sym[KSYM_SYMBOL_LEN]; \ - sprint_symbol(sym, (unsigned long)addr); \ - AuDbg("%s\n", sym); \ -} while (0) - -#define AuInfoSym(addr) do { \ - char sym[KSYM_SYMBOL_LEN]; \ - sprint_symbol(sym, (unsigned long)addr); \ - AuInfo("%s\n", sym); \ -} while (0) -#else -AuStubVoid(au_dbg_verify_dinode, struct dentry *dentry) -AuStubVoid(au_dbg_verify_dir_parent, struct dentry *dentry, unsigned int sigen) -AuStubVoid(au_dbg_verify_nondir_parent, struct dentry *dentry, - unsigned int sigen) -AuStubVoid(au_dbg_verify_gen, struct dentry *parent, unsigned int sigen) -AuStubVoid(au_dbg_verify_kthread, void) -AuStubInt0(__init au_debug_init, void) -AuStubVoid(au_debug_sbinfo_init, struct au_sbinfo *sbinfo) - -#define AuDbgWhlist(w) do {} while (0) -#define AuDbgVdir(v) do {} while (0) -#define AuDbgInode(i) do {} while (0) -#define AuDbgDAlias(i) do {} while (0) -#define AuDbgDentry(d) do {} while (0) -#define AuDbgFile(f) do {} while (0) -#define AuDbgSb(sb) do {} while (0) -#define AuDbgSleep(sec) do {} while (0) -#define AuDbgSleepJiffy(jiffy) do {} while (0) -#define AuDbgIAttr(ia) do {} while (0) -#define AuDbgSym(addr) do {} while (0) -#define AuInfoSym(addr) do {} while (0) -#endif /* CONFIG_AUFS_DEBUG */ - -/* ---------------------------------------------------------------------- */ - -#ifdef CONFIG_AUFS_MAGIC_SYSRQ -int __init au_sysrq_init(void); -void au_sysrq_fin(void); - -#ifdef CONFIG_HW_CONSOLE -#define au_dbg_blocked() do { \ - WARN_ON(1); \ - handle_sysrq('w'); \ -} while (0) -#else -AuStubVoid(au_dbg_blocked, void) -#endif - -#else -AuStubInt0(__init au_sysrq_init, void) -AuStubVoid(au_sysrq_fin, void) -AuStubVoid(au_dbg_blocked, void) -#endif /* CONFIG_AUFS_MAGIC_SYSRQ */ - -#endif /* __KERNEL__ */ -#endif /* __AUFS_DEBUG_H__ */ diff --git a/fs/aufs/dentry.c b/fs/aufs/dentry.c deleted file mode 100644 index b5da387220fc65..00000000000000 --- a/fs/aufs/dentry.c +++ /dev/null @@ -1,1096 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * lookup and dentry operations - */ - -#include -#include "aufs.h" - -#define AuLkup_ALLOW_NEG 1 -#define AuLkup_IGNORE_PERM (1 << 1) -#define au_ftest_lkup(flags, name) ((flags) & AuLkup_##name) -#define au_fset_lkup(flags, name) \ - do { (flags) |= AuLkup_##name; } while (0) -#define au_fclr_lkup(flags, name) \ - do { (flags) &= ~AuLkup_##name; } while (0) - -struct au_do_lookup_args { - unsigned int flags; - mode_t type; -}; - -/* - * returns positive/negative dentry, NULL or an error. - * NULL means whiteout-ed or not-found. - */ -static struct dentry* -au_do_lookup(struct dentry *h_parent, struct dentry *dentry, - aufs_bindex_t bindex, struct qstr *wh_name, - struct au_do_lookup_args *args) -{ - struct dentry *h_dentry; - struct inode *h_inode, *inode; - struct au_branch *br; - int wh_found, opq; - unsigned char wh_able; - const unsigned char allow_neg = !!au_ftest_lkup(args->flags, ALLOW_NEG); - const unsigned char ignore_perm = !!au_ftest_lkup(args->flags, - IGNORE_PERM); - - wh_found = 0; - br = au_sbr(dentry->d_sb, bindex); - wh_able = !!au_br_whable(br->br_perm); - if (wh_able) - wh_found = au_wh_test(h_parent, wh_name, /*try_sio*/0); - h_dentry = ERR_PTR(wh_found); - if (!wh_found) - goto real_lookup; - if (unlikely(wh_found < 0)) - goto out; - - /* We found a whiteout */ - /* au_set_dbend(dentry, bindex); */ - au_set_dbwh(dentry, bindex); - if (!allow_neg) - return NULL; /* success */ - -real_lookup: - if (!ignore_perm) - h_dentry = vfsub_lkup_one(&dentry->d_name, h_parent); - else - h_dentry = au_sio_lkup_one(&dentry->d_name, h_parent); - if (IS_ERR(h_dentry)) - goto out; - - h_inode = h_dentry->d_inode; - if (!h_inode) { - if (!allow_neg) - goto out_neg; - } else if (wh_found - || (args->type && args->type != (h_inode->i_mode & S_IFMT))) - goto out_neg; - - if (au_dbend(dentry) <= bindex) - au_set_dbend(dentry, bindex); - if (au_dbstart(dentry) < 0 || bindex < au_dbstart(dentry)) - au_set_dbstart(dentry, bindex); - au_set_h_dptr(dentry, bindex, h_dentry); - - inode = dentry->d_inode; - if (!h_inode || !S_ISDIR(h_inode->i_mode) || !wh_able - || (inode && !S_ISDIR(inode->i_mode))) - goto out; /* success */ - - mutex_lock_nested(&h_inode->i_mutex, AuLsc_I_CHILD); - opq = au_diropq_test(h_dentry); - mutex_unlock(&h_inode->i_mutex); - if (opq > 0) - au_set_dbdiropq(dentry, bindex); - else if (unlikely(opq < 0)) { - au_set_h_dptr(dentry, bindex, NULL); - h_dentry = ERR_PTR(opq); - } - goto out; - -out_neg: - dput(h_dentry); - h_dentry = NULL; -out: - return h_dentry; -} - -static int au_test_shwh(struct super_block *sb, const struct qstr *name) -{ - if (unlikely(!au_opt_test(au_mntflags(sb), SHWH) - && !strncmp(name->name, AUFS_WH_PFX, AUFS_WH_PFX_LEN))) - return -EPERM; - return 0; -} - -/* - * returns the number of lower positive dentries, - * otherwise an error. - * can be called at unlinking with @type is zero. - */ -int au_lkup_dentry(struct dentry *dentry, aufs_bindex_t bstart, mode_t type) -{ - int npositive, err; - aufs_bindex_t bindex, btail, bdiropq; - unsigned char isdir, dirperm1; - struct qstr whname; - struct au_do_lookup_args args = { - .flags = 0, - .type = type - }; - const struct qstr *name = &dentry->d_name; - struct dentry *parent; - struct inode *inode; - struct super_block *sb; - - sb = dentry->d_sb; - err = au_test_shwh(sb, name); - if (unlikely(err)) - goto out; - - err = au_wh_name_alloc(&whname, name); - if (unlikely(err)) - goto out; - - inode = dentry->d_inode; - isdir = !!(inode && S_ISDIR(inode->i_mode)); - if (!type) - au_fset_lkup(args.flags, ALLOW_NEG); - dirperm1 = !!au_opt_test(au_mntflags(sb), DIRPERM1); - - npositive = 0; - parent = dget_parent(dentry); - btail = au_dbtaildir(parent); - for (bindex = bstart; bindex <= btail; bindex++) { - struct dentry *h_parent, *h_dentry; - struct inode *h_inode, *h_dir; - - h_dentry = au_h_dptr(dentry, bindex); - if (h_dentry) { - if (h_dentry->d_inode) - npositive++; - if (type != S_IFDIR) - break; - continue; - } - h_parent = au_h_dptr(parent, bindex); - if (!h_parent) - continue; - h_dir = h_parent->d_inode; - if (!h_dir || !S_ISDIR(h_dir->i_mode)) - continue; - - mutex_lock_nested(&h_dir->i_mutex, AuLsc_I_PARENT); - h_dentry = au_do_lookup(h_parent, dentry, bindex, &whname, - &args); - mutex_unlock(&h_dir->i_mutex); - err = PTR_ERR(h_dentry); - if (IS_ERR(h_dentry)) - goto out_parent; - au_fclr_lkup(args.flags, ALLOW_NEG); - if (dirperm1) - au_fset_lkup(args.flags, IGNORE_PERM); - - if (au_dbwh(dentry) >= 0) - break; - if (!h_dentry) - continue; - h_inode = h_dentry->d_inode; - if (!h_inode) - continue; - npositive++; - if (!args.type) - args.type = h_inode->i_mode & S_IFMT; - if (args.type != S_IFDIR) - break; - else if (isdir) { - /* the type of lower may be different */ - bdiropq = au_dbdiropq(dentry); - if (bdiropq >= 0 && bdiropq <= bindex) - break; - } - } - - if (npositive) { - AuLabel(positive); - au_update_dbstart(dentry); - } - err = npositive; - if (unlikely(!au_opt_test(au_mntflags(sb), UDBA_NONE) - && au_dbstart(dentry) < 0)) { - err = -EIO; - AuIOErr("both of real entry and whiteout found, %.*s, err %d\n", - AuDLNPair(dentry), err); - } - -out_parent: - dput(parent); - kfree(whname.name); -out: - return err; -} - -struct dentry *au_sio_lkup_one(struct qstr *name, struct dentry *parent) -{ - struct dentry *dentry; - int wkq_err; - - if (!au_test_h_perm_sio(parent->d_inode, MAY_EXEC)) - dentry = vfsub_lkup_one(name, parent); - else { - struct vfsub_lkup_one_args args = { - .errp = &dentry, - .name = name, - .parent = parent - }; - - wkq_err = au_wkq_wait(vfsub_call_lkup_one, &args); - if (unlikely(wkq_err)) - dentry = ERR_PTR(wkq_err); - } - - return dentry; -} - -/* - * lookup @dentry on @bindex which should be negative. - */ -int au_lkup_neg(struct dentry *dentry, aufs_bindex_t bindex, int wh) -{ - int err; - struct dentry *parent, *h_parent, *h_dentry; - struct au_branch *br; - - parent = dget_parent(dentry); - h_parent = au_h_dptr(parent, bindex); - br = au_sbr(dentry->d_sb, bindex); - if (wh) - h_dentry = au_whtmp_lkup(h_parent, br, &dentry->d_name); - else - h_dentry = au_sio_lkup_one(&dentry->d_name, h_parent); - err = PTR_ERR(h_dentry); - if (IS_ERR(h_dentry)) - goto out; - if (unlikely(h_dentry->d_inode)) { - err = -EIO; - AuIOErr("%.*s should be negative on b%d.\n", - AuDLNPair(h_dentry), bindex); - dput(h_dentry); - goto out; - } - - err = 0; - if (bindex < au_dbstart(dentry)) - au_set_dbstart(dentry, bindex); - if (au_dbend(dentry) < bindex) - au_set_dbend(dentry, bindex); - au_set_h_dptr(dentry, bindex, h_dentry); - -out: - dput(parent); - return err; -} - -/* ---------------------------------------------------------------------- */ - -/* subset of struct inode */ -struct au_iattr { - unsigned long i_ino; - /* unsigned int i_nlink; */ - kuid_t i_uid; - kgid_t i_gid; - u64 i_version; -/* - loff_t i_size; - blkcnt_t i_blocks; -*/ - umode_t i_mode; -}; - -static void au_iattr_save(struct au_iattr *ia, struct inode *h_inode) -{ - ia->i_ino = h_inode->i_ino; - /* ia->i_nlink = h_inode->i_nlink; */ - ia->i_uid = h_inode->i_uid; - ia->i_gid = h_inode->i_gid; - ia->i_version = h_inode->i_version; -/* - ia->i_size = h_inode->i_size; - ia->i_blocks = h_inode->i_blocks; -*/ - ia->i_mode = (h_inode->i_mode & S_IFMT); -} - -static int au_iattr_test(struct au_iattr *ia, struct inode *h_inode) -{ - return ia->i_ino != h_inode->i_ino - /* || ia->i_nlink != h_inode->i_nlink */ - || !uid_eq(ia->i_uid, h_inode->i_uid) - || !gid_eq(ia->i_gid, h_inode->i_gid) - || ia->i_version != h_inode->i_version -/* - || ia->i_size != h_inode->i_size - || ia->i_blocks != h_inode->i_blocks -*/ - || ia->i_mode != (h_inode->i_mode & S_IFMT); -} - -static int au_h_verify_dentry(struct dentry *h_dentry, struct dentry *h_parent, - struct au_branch *br) -{ - int err; - struct au_iattr ia; - struct inode *h_inode; - struct dentry *h_d; - struct super_block *h_sb; - - err = 0; - memset(&ia, -1, sizeof(ia)); - h_sb = h_dentry->d_sb; - h_inode = h_dentry->d_inode; - if (h_inode) - au_iattr_save(&ia, h_inode); - else if (au_test_nfs(h_sb) || au_test_fuse(h_sb)) - /* nfs d_revalidate may return 0 for negative dentry */ - /* fuse d_revalidate always return 0 for negative dentry */ - goto out; - - /* main purpose is namei.c:cached_lookup() and d_revalidate */ - h_d = vfsub_lkup_one(&h_dentry->d_name, h_parent); - err = PTR_ERR(h_d); - if (IS_ERR(h_d)) - goto out; - - err = 0; - if (unlikely(h_d != h_dentry - || h_d->d_inode != h_inode - || (h_inode && au_iattr_test(&ia, h_inode)))) - err = au_busy_or_stale(); - dput(h_d); - -out: - AuTraceErr(err); - return err; -} - -int au_h_verify(struct dentry *h_dentry, unsigned int udba, struct inode *h_dir, - struct dentry *h_parent, struct au_branch *br) -{ - int err; - - err = 0; - if (udba == AuOpt_UDBA_REVAL - && !au_test_fs_remote(h_dentry->d_sb)) { - IMustLock(h_dir); - err = (h_dentry->d_parent->d_inode != h_dir); - } else if (udba != AuOpt_UDBA_NONE) - err = au_h_verify_dentry(h_dentry, h_parent, br); - - return err; -} - -/* ---------------------------------------------------------------------- */ - -static int au_do_refresh_hdentry(struct dentry *dentry, struct dentry *parent) -{ - int err; - aufs_bindex_t new_bindex, bindex, bend, bwh, bdiropq; - struct au_hdentry tmp, *p, *q; - struct au_dinfo *dinfo; - struct super_block *sb; - - DiMustWriteLock(dentry); - - sb = dentry->d_sb; - dinfo = au_di(dentry); - bend = dinfo->di_bend; - bwh = dinfo->di_bwh; - bdiropq = dinfo->di_bdiropq; - p = dinfo->di_hdentry + dinfo->di_bstart; - for (bindex = dinfo->di_bstart; bindex <= bend; bindex++, p++) { - if (!p->hd_dentry) - continue; - - new_bindex = au_br_index(sb, p->hd_id); - if (new_bindex == bindex) - continue; - - if (dinfo->di_bwh == bindex) - bwh = new_bindex; - if (dinfo->di_bdiropq == bindex) - bdiropq = new_bindex; - if (new_bindex < 0) { - au_hdput(p); - p->hd_dentry = NULL; - continue; - } - - /* swap two lower dentries, and loop again */ - q = dinfo->di_hdentry + new_bindex; - tmp = *q; - *q = *p; - *p = tmp; - if (tmp.hd_dentry) { - bindex--; - p--; - } - } - - dinfo->di_bwh = -1; - if (bwh >= 0 && bwh <= au_sbend(sb) && au_sbr_whable(sb, bwh)) - dinfo->di_bwh = bwh; - - dinfo->di_bdiropq = -1; - if (bdiropq >= 0 - && bdiropq <= au_sbend(sb) - && au_sbr_whable(sb, bdiropq)) - dinfo->di_bdiropq = bdiropq; - - err = -EIO; - dinfo->di_bstart = -1; - dinfo->di_bend = -1; - bend = au_dbend(parent); - p = dinfo->di_hdentry; - for (bindex = 0; bindex <= bend; bindex++, p++) - if (p->hd_dentry) { - dinfo->di_bstart = bindex; - break; - } - - if (dinfo->di_bstart >= 0) { - p = dinfo->di_hdentry + bend; - for (bindex = bend; bindex >= 0; bindex--, p--) - if (p->hd_dentry) { - dinfo->di_bend = bindex; - err = 0; - break; - } - } - - return err; -} - -static void au_do_hide(struct dentry *dentry) -{ - struct inode *inode; - - inode = dentry->d_inode; - if (inode) { - if (!S_ISDIR(inode->i_mode)) { - if (inode->i_nlink && !d_unhashed(dentry)) - drop_nlink(inode); - } else { - clear_nlink(inode); - /* stop next lookup */ - inode->i_flags |= S_DEAD; - } - smp_mb(); /* necessary? */ - } - d_drop(dentry); -} - -static int au_hide_children(struct dentry *parent) -{ - int err, i, j, ndentry; - struct au_dcsub_pages dpages; - struct au_dpage *dpage; - struct dentry *dentry; - - err = au_dpages_init(&dpages, GFP_NOFS); - if (unlikely(err)) - goto out; - err = au_dcsub_pages(&dpages, parent, NULL, NULL); - if (unlikely(err)) - goto out_dpages; - - /* in reverse order */ - for (i = dpages.ndpage - 1; i >= 0; i--) { - dpage = dpages.dpages + i; - ndentry = dpage->ndentry; - for (j = ndentry - 1; j >= 0; j--) { - dentry = dpage->dentries[j]; - if (dentry != parent) - au_do_hide(dentry); - } - } - -out_dpages: - au_dpages_free(&dpages); -out: - return err; -} - -static void au_hide(struct dentry *dentry) -{ - int err; - struct inode *inode; - - AuDbgDentry(dentry); - inode = dentry->d_inode; - if (inode && S_ISDIR(inode->i_mode)) { - /* shrink_dcache_parent(dentry); */ - err = au_hide_children(dentry); - if (unlikely(err)) - AuIOErr("%.*s, failed hiding children, ignored %d\n", - AuDLNPair(dentry), err); - } - au_do_hide(dentry); -} - -/* - * By adding a dirty branch, a cached dentry may be affected in various ways. - * - * a dirty branch is added - * - on the top of layers - * - in the middle of layers - * - to the bottom of layers - * - * on the added branch there exists - * - a whiteout - * - a diropq - * - a same named entry - * + exist - * * negative --> positive - * * positive --> positive - * - type is unchanged - * - type is changed - * + doesn't exist - * * negative --> negative - * * positive --> negative (rejected by au_br_del() for non-dir case) - * - none - */ -static int au_refresh_by_dinfo(struct dentry *dentry, struct au_dinfo *dinfo, - struct au_dinfo *tmp) -{ - int err; - aufs_bindex_t bindex, bend; - struct { - struct dentry *dentry; - struct inode *inode; - mode_t mode; - } orig_h, tmp_h; - struct au_hdentry *hd; - struct inode *inode, *h_inode; - struct dentry *h_dentry; - - err = 0; - AuDebugOn(dinfo->di_bstart < 0); - orig_h.dentry = dinfo->di_hdentry[dinfo->di_bstart].hd_dentry; - orig_h.inode = orig_h.dentry->d_inode; - orig_h.mode = 0; - if (orig_h.inode) - orig_h.mode = orig_h.inode->i_mode & S_IFMT; - memset(&tmp_h, 0, sizeof(tmp_h)); - if (tmp->di_bstart >= 0) { - tmp_h.dentry = tmp->di_hdentry[tmp->di_bstart].hd_dentry; - tmp_h.inode = tmp_h.dentry->d_inode; - if (tmp_h.inode) - tmp_h.mode = tmp_h.inode->i_mode & S_IFMT; - } - - inode = dentry->d_inode; - if (!orig_h.inode) { - AuDbg("nagative originally\n"); - if (inode) { - au_hide(dentry); - goto out; - } - AuDebugOn(inode); - AuDebugOn(dinfo->di_bstart != dinfo->di_bend); - AuDebugOn(dinfo->di_bdiropq != -1); - - if (!tmp_h.inode) { - AuDbg("negative --> negative\n"); - /* should have only one negative lower */ - if (tmp->di_bstart >= 0 - && tmp->di_bstart < dinfo->di_bstart) { - AuDebugOn(tmp->di_bstart != tmp->di_bend); - AuDebugOn(dinfo->di_bstart != dinfo->di_bend); - au_set_h_dptr(dentry, dinfo->di_bstart, NULL); - au_di_cp(dinfo, tmp); - hd = tmp->di_hdentry + tmp->di_bstart; - au_set_h_dptr(dentry, tmp->di_bstart, - dget(hd->hd_dentry)); - } - au_dbg_verify_dinode(dentry); - } else { - AuDbg("negative --> positive\n"); - /* - * similar to the behaviour of creating with bypassing - * aufs. - * unhash it in order to force an error in the - * succeeding create operation. - * we should not set S_DEAD here. - */ - d_drop(dentry); - /* au_di_swap(tmp, dinfo); */ - au_dbg_verify_dinode(dentry); - } - } else { - AuDbg("positive originally\n"); - /* inode may be NULL */ - AuDebugOn(inode && (inode->i_mode & S_IFMT) != orig_h.mode); - if (!tmp_h.inode) { - AuDbg("positive --> negative\n"); - /* or bypassing aufs */ - au_hide(dentry); - if (tmp->di_bwh >= 0 && tmp->di_bwh <= dinfo->di_bstart) - dinfo->di_bwh = tmp->di_bwh; - if (inode) - err = au_refresh_hinode_self(inode); - au_dbg_verify_dinode(dentry); - } else if (orig_h.mode == tmp_h.mode) { - AuDbg("positive --> positive, same type\n"); - if (!S_ISDIR(orig_h.mode) - && dinfo->di_bstart > tmp->di_bstart) { - /* - * similar to the behaviour of removing and - * creating. - */ - au_hide(dentry); - if (inode) - err = au_refresh_hinode_self(inode); - au_dbg_verify_dinode(dentry); - } else { - /* fill empty slots */ - if (dinfo->di_bstart > tmp->di_bstart) - dinfo->di_bstart = tmp->di_bstart; - if (dinfo->di_bend < tmp->di_bend) - dinfo->di_bend = tmp->di_bend; - dinfo->di_bwh = tmp->di_bwh; - dinfo->di_bdiropq = tmp->di_bdiropq; - hd = tmp->di_hdentry; - bend = dinfo->di_bend; - for (bindex = tmp->di_bstart; bindex <= bend; - bindex++) { - if (au_h_dptr(dentry, bindex)) - continue; - h_dentry = hd[bindex].hd_dentry; - if (!h_dentry) - continue; - h_inode = h_dentry->d_inode; - AuDebugOn(!h_inode); - AuDebugOn(orig_h.mode - != (h_inode->i_mode - & S_IFMT)); - au_set_h_dptr(dentry, bindex, - dget(h_dentry)); - } - err = au_refresh_hinode(inode, dentry); - au_dbg_verify_dinode(dentry); - } - } else { - AuDbg("positive --> positive, different type\n"); - /* similar to the behaviour of removing and creating */ - au_hide(dentry); - if (inode) - err = au_refresh_hinode_self(inode); - au_dbg_verify_dinode(dentry); - } - } - -out: - return err; -} - -int au_refresh_dentry(struct dentry *dentry, struct dentry *parent) -{ - int err, ebrange; - unsigned int sigen; - struct au_dinfo *dinfo, *tmp; - struct super_block *sb; - struct inode *inode; - - DiMustWriteLock(dentry); - AuDebugOn(IS_ROOT(dentry)); - AuDebugOn(!parent->d_inode); - - sb = dentry->d_sb; - inode = dentry->d_inode; - sigen = au_sigen(sb); - err = au_digen_test(parent, sigen); - if (unlikely(err)) - goto out; - - dinfo = au_di(dentry); - err = au_di_realloc(dinfo, au_sbend(sb) + 1); - if (unlikely(err)) - goto out; - ebrange = au_dbrange_test(dentry); - if (!ebrange) - ebrange = au_do_refresh_hdentry(dentry, parent); - - if (d_unhashed(dentry) || ebrange) { - AuDebugOn(au_dbstart(dentry) < 0 && au_dbend(dentry) >= 0); - if (inode) - err = au_refresh_hinode_self(inode); - au_dbg_verify_dinode(dentry); - if (!err) - goto out_dgen; /* success */ - goto out; - } - - /* temporary dinfo */ - AuDbgDentry(dentry); - err = -ENOMEM; - tmp = au_di_alloc(sb, AuLsc_DI_TMP); - if (unlikely(!tmp)) - goto out; - au_di_swap(tmp, dinfo); - /* returns the number of positive dentries */ - /* - * if current working dir is removed, it returns an error. - * but the dentry is legal. - */ - err = au_lkup_dentry(dentry, /*bstart*/0, /*type*/0); - AuDbgDentry(dentry); - au_di_swap(tmp, dinfo); - if (err == -ENOENT) - err = 0; - if (err >= 0) { - /* compare/refresh by dinfo */ - AuDbgDentry(dentry); - err = au_refresh_by_dinfo(dentry, dinfo, tmp); - au_dbg_verify_dinode(dentry); - AuTraceErr(err); - } - au_rw_write_unlock(&tmp->di_rwsem); - au_di_free(tmp); - if (unlikely(err)) - goto out; - -out_dgen: - au_update_digen(dentry); -out: - if (unlikely(err && !(dentry->d_flags & DCACHE_NFSFS_RENAMED))) { - AuIOErr("failed refreshing %.*s, %d\n", - AuDLNPair(dentry), err); - AuDbgDentry(dentry); - } - AuTraceErr(err); - return err; -} - -static int au_do_h_d_reval(struct dentry *h_dentry, unsigned int flags, - struct dentry *dentry, aufs_bindex_t bindex) -{ - int err, valid; - - err = 0; - if (!(h_dentry->d_flags & DCACHE_OP_REVALIDATE)) - goto out; - - AuDbg("b%d\n", bindex); - /* - * gave up supporting LOOKUP_CREATE/OPEN for lower fs, - * due to whiteout and branch permission. - */ - flags &= ~(/*LOOKUP_PARENT |*/ LOOKUP_OPEN | LOOKUP_CREATE - | LOOKUP_FOLLOW | LOOKUP_EXCL); - /* it may return tri-state */ - valid = h_dentry->d_op->d_revalidate(h_dentry, flags); - - if (unlikely(valid < 0)) - err = valid; - else if (!valid) - err = -EINVAL; - -out: - AuTraceErr(err); - return err; -} - -/* todo: remove this */ -static int h_d_revalidate(struct dentry *dentry, struct inode *inode, - unsigned int flags, int do_udba) -{ - int err; - umode_t mode, h_mode; - aufs_bindex_t bindex, btail, bstart, ibs, ibe; - unsigned char plus, unhashed, is_root, h_plus, h_nfs; - struct inode *h_inode, *h_cached_inode; - struct dentry *h_dentry; - struct qstr *name, *h_name; - - err = 0; - plus = 0; - mode = 0; - ibs = -1; - ibe = -1; - unhashed = !!d_unhashed(dentry); - is_root = !!IS_ROOT(dentry); - name = &dentry->d_name; - - /* - * Theoretically, REVAL test should be unnecessary in case of - * {FS,I}NOTIFY. - * But {fs,i}notify doesn't fire some necessary events, - * IN_ATTRIB for atime/nlink/pageio - * IN_DELETE for NFS dentry - * Let's do REVAL test too. - */ - if (do_udba && inode) { - mode = (inode->i_mode & S_IFMT); - plus = (inode->i_nlink > 0); - ibs = au_ibstart(inode); - ibe = au_ibend(inode); - } - - bstart = au_dbstart(dentry); - btail = bstart; - if (inode && S_ISDIR(inode->i_mode)) - btail = au_dbtaildir(dentry); - for (bindex = bstart; bindex <= btail; bindex++) { - h_dentry = au_h_dptr(dentry, bindex); - if (!h_dentry) - continue; - - AuDbg("b%d, %.*s\n", bindex, AuDLNPair(h_dentry)); - h_nfs = !!au_test_nfs(h_dentry->d_sb); - spin_lock(&h_dentry->d_lock); - h_name = &h_dentry->d_name; - if (unlikely(do_udba - && !is_root - && ((!h_nfs - && (unhashed != !!d_unhashed(h_dentry) - || !au_qstreq(name, h_name))) - || (h_nfs - && !(flags & LOOKUP_OPEN) - && (h_dentry->d_flags - & DCACHE_NFSFS_RENAMED))) - )) { - int h_unhashed; - - h_unhashed = d_unhashed(h_dentry); - spin_unlock(&h_dentry->d_lock); - AuDbg("unhash 0x%x 0x%x, %.*s %.*s\n", - unhashed, h_unhashed, - AuDLNPair(dentry), AuDLNPair(h_dentry)); - goto err; - } - spin_unlock(&h_dentry->d_lock); - - err = au_do_h_d_reval(h_dentry, flags, dentry, bindex); - if (unlikely(err)) - /* do not goto err, to keep the errno */ - break; - - /* todo: plink too? */ - if (!do_udba) - continue; - - /* UDBA tests */ - h_inode = h_dentry->d_inode; - if (unlikely(!!inode != !!h_inode)) - goto err; - - h_plus = plus; - h_mode = mode; - h_cached_inode = h_inode; - if (h_inode) { - h_mode = (h_inode->i_mode & S_IFMT); - h_plus = (h_inode->i_nlink > 0); - } - if (inode && ibs <= bindex && bindex <= ibe) - h_cached_inode = au_h_iptr(inode, bindex); - - if (!h_nfs) { - if (unlikely(plus != h_plus)) - goto err; - } else { - if (unlikely(!(h_dentry->d_flags & DCACHE_NFSFS_RENAMED) - && !is_root - && !IS_ROOT(h_dentry) - && unhashed != d_unhashed(h_dentry))) - goto err; - } - if (unlikely(mode != h_mode - || h_cached_inode != h_inode)) - goto err; - continue; - -err: - err = -EINVAL; - break; - } - - AuTraceErr(err); - return err; -} - -/* todo: consolidate with do_refresh() and au_reval_for_attr() */ -static int simple_reval_dpath(struct dentry *dentry, unsigned int sigen) -{ - int err; - struct dentry *parent; - - if (!au_digen_test(dentry, sigen)) - return 0; - - parent = dget_parent(dentry); - di_read_lock_parent(parent, AuLock_IR); - AuDebugOn(au_digen_test(parent, sigen)); - au_dbg_verify_gen(parent, sigen); - err = au_refresh_dentry(dentry, parent); - di_read_unlock(parent, AuLock_IR); - dput(parent); - AuTraceErr(err); - return err; -} - -int au_reval_dpath(struct dentry *dentry, unsigned int sigen) -{ - int err; - struct dentry *d, *parent; - struct inode *inode; - - if (!au_ftest_si(au_sbi(dentry->d_sb), FAILED_REFRESH_DIR)) - return simple_reval_dpath(dentry, sigen); - - /* slow loop, keep it simple and stupid */ - /* cf: au_cpup_dirs() */ - err = 0; - parent = NULL; - while (au_digen_test(dentry, sigen)) { - d = dentry; - while (1) { - dput(parent); - parent = dget_parent(d); - if (!au_digen_test(parent, sigen)) - break; - d = parent; - } - - inode = d->d_inode; - if (d != dentry) - di_write_lock_child2(d); - - /* someone might update our dentry while we were sleeping */ - if (au_digen_test(d, sigen)) { - /* - * todo: consolidate with simple_reval_dpath(), - * do_refresh() and au_reval_for_attr(). - */ - di_read_lock_parent(parent, AuLock_IR); - err = au_refresh_dentry(d, parent); - di_read_unlock(parent, AuLock_IR); - } - - if (d != dentry) - di_write_unlock(d); - dput(parent); - if (unlikely(err)) - break; - } - - return err; -} - -/* - * if valid returns 1, otherwise 0. - */ -static int aufs_d_revalidate(struct dentry *dentry, unsigned int flags) -{ - int valid, err; - unsigned int sigen; - unsigned char do_udba; - struct super_block *sb; - struct inode *inode; - - /* todo: support rcu-walk? */ - if (flags & LOOKUP_RCU) - return -ECHILD; - - valid = 0; - if (unlikely(!au_di(dentry))) - goto out; - - valid = 1; - sb = dentry->d_sb; - /* - * todo: very ugly - * i_mutex of parent dir may be held, - * but we should not return 'invalid' due to busy. - */ - err = aufs_read_lock(dentry, AuLock_FLUSH | AuLock_DW | AuLock_NOPLM); - if (unlikely(err)) { - valid = err; - AuTraceErr(err); - goto out; - } - inode = dentry->d_inode; - if (unlikely(inode && is_bad_inode(inode))) { - err = -EINVAL; - AuTraceErr(err); - goto out_dgrade; - } - if (unlikely(au_dbrange_test(dentry))) { - err = -EINVAL; - AuTraceErr(err); - goto out_dgrade; - } - - sigen = au_sigen(sb); - if (au_digen_test(dentry, sigen)) { - AuDebugOn(IS_ROOT(dentry)); - err = au_reval_dpath(dentry, sigen); - if (unlikely(err)) { - AuTraceErr(err); - goto out_dgrade; - } - } - di_downgrade_lock(dentry, AuLock_IR); - - err = -EINVAL; - if (!(flags & (LOOKUP_OPEN | LOOKUP_EMPTY)) - && inode - && (IS_DEADDIR(inode) || !inode->i_nlink)) - goto out_inval; - - do_udba = !au_opt_test(au_mntflags(sb), UDBA_NONE); - if (do_udba && inode) { - aufs_bindex_t bstart = au_ibstart(inode); - struct inode *h_inode; - - if (bstart >= 0) { - h_inode = au_h_iptr(inode, bstart); - if (h_inode && au_test_higen(inode, h_inode)) - goto out_inval; - } - } - - err = h_d_revalidate(dentry, inode, flags, do_udba); - if (unlikely(!err && do_udba && au_dbstart(dentry) < 0)) { - err = -EIO; - AuDbg("both of real entry and whiteout found, %.*s, err %d\n", - AuDLNPair(dentry), err); - } - goto out_inval; - -out_dgrade: - di_downgrade_lock(dentry, AuLock_IR); -out_inval: - aufs_read_unlock(dentry, AuLock_IR); - AuTraceErr(err); - valid = !err; -out: - if (!valid) { - AuDbg("%.*s invalid, %d\n", AuDLNPair(dentry), valid); - d_drop(dentry); - } - return valid; -} - -static void aufs_d_release(struct dentry *dentry) -{ - if (au_di(dentry)) { - au_di_fin(dentry); - au_hn_di_reinit(dentry); - } -} - -const struct dentry_operations aufs_dop = { - .d_revalidate = aufs_d_revalidate, - .d_weak_revalidate = aufs_d_revalidate, - .d_release = aufs_d_release -}; diff --git a/fs/aufs/dentry.h b/fs/aufs/dentry.h deleted file mode 100644 index 9871e8c22d6689..00000000000000 --- a/fs/aufs/dentry.h +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * lookup and dentry operations - */ - -#ifndef __AUFS_DENTRY_H__ -#define __AUFS_DENTRY_H__ - -#ifdef __KERNEL__ - -#include -#include "rwsem.h" - -struct au_hdentry { - struct dentry *hd_dentry; - aufs_bindex_t hd_id; -}; - -struct au_dinfo { - atomic_t di_generation; - - struct au_rwsem di_rwsem; - aufs_bindex_t di_bstart, di_bend, di_bwh, di_bdiropq; - struct au_hdentry *di_hdentry; -} ____cacheline_aligned_in_smp; - -/* ---------------------------------------------------------------------- */ - -/* dentry.c */ -extern const struct dentry_operations aufs_dop; -struct au_branch; -struct dentry *au_sio_lkup_one(struct qstr *name, struct dentry *parent); -int au_h_verify(struct dentry *h_dentry, unsigned int udba, struct inode *h_dir, - struct dentry *h_parent, struct au_branch *br); - -int au_lkup_dentry(struct dentry *dentry, aufs_bindex_t bstart, mode_t type); -int au_lkup_neg(struct dentry *dentry, aufs_bindex_t bindex, int wh); -int au_refresh_dentry(struct dentry *dentry, struct dentry *parent); -int au_reval_dpath(struct dentry *dentry, unsigned int sigen); - -/* dinfo.c */ -void au_di_init_once(void *_di); -struct au_dinfo *au_di_alloc(struct super_block *sb, unsigned int lsc); -void au_di_free(struct au_dinfo *dinfo); -void au_di_swap(struct au_dinfo *a, struct au_dinfo *b); -void au_di_cp(struct au_dinfo *dst, struct au_dinfo *src); -int au_di_init(struct dentry *dentry); -void au_di_fin(struct dentry *dentry); -int au_di_realloc(struct au_dinfo *dinfo, int nbr); - -void di_read_lock(struct dentry *d, int flags, unsigned int lsc); -void di_read_unlock(struct dentry *d, int flags); -void di_downgrade_lock(struct dentry *d, int flags); -void di_write_lock(struct dentry *d, unsigned int lsc); -void di_write_unlock(struct dentry *d); -void di_write_lock2_child(struct dentry *d1, struct dentry *d2, int isdir); -void di_write_lock2_parent(struct dentry *d1, struct dentry *d2, int isdir); -void di_write_unlock2(struct dentry *d1, struct dentry *d2); - -struct dentry *au_h_dptr(struct dentry *dentry, aufs_bindex_t bindex); -struct dentry *au_h_d_alias(struct dentry *dentry, aufs_bindex_t bindex); -aufs_bindex_t au_dbtail(struct dentry *dentry); -aufs_bindex_t au_dbtaildir(struct dentry *dentry); - -void au_set_h_dptr(struct dentry *dentry, aufs_bindex_t bindex, - struct dentry *h_dentry); -int au_digen_test(struct dentry *dentry, unsigned int sigen); -int au_dbrange_test(struct dentry *dentry); -void au_update_digen(struct dentry *dentry); -void au_update_dbrange(struct dentry *dentry, int do_put_zero); -void au_update_dbstart(struct dentry *dentry); -void au_update_dbend(struct dentry *dentry); -int au_find_dbindex(struct dentry *dentry, struct dentry *h_dentry); - -/* ---------------------------------------------------------------------- */ - -static inline struct au_dinfo *au_di(struct dentry *dentry) -{ - return dentry->d_fsdata; -} - -/* ---------------------------------------------------------------------- */ - -/* lock subclass for dinfo */ -enum { - AuLsc_DI_CHILD, /* child first */ - AuLsc_DI_CHILD2, /* rename(2), link(2), and cpup at hnotify */ - AuLsc_DI_CHILD3, /* copyup dirs */ - AuLsc_DI_PARENT, - AuLsc_DI_PARENT2, - AuLsc_DI_PARENT3, - AuLsc_DI_TMP /* temp for replacing dinfo */ -}; - -/* - * di_read_lock_child, di_write_lock_child, - * di_read_lock_child2, di_write_lock_child2, - * di_read_lock_child3, di_write_lock_child3, - * di_read_lock_parent, di_write_lock_parent, - * di_read_lock_parent2, di_write_lock_parent2, - * di_read_lock_parent3, di_write_lock_parent3, - */ -#define AuReadLockFunc(name, lsc) \ -static inline void di_read_lock_##name(struct dentry *d, int flags) \ -{ di_read_lock(d, flags, AuLsc_DI_##lsc); } - -#define AuWriteLockFunc(name, lsc) \ -static inline void di_write_lock_##name(struct dentry *d) \ -{ di_write_lock(d, AuLsc_DI_##lsc); } - -#define AuRWLockFuncs(name, lsc) \ - AuReadLockFunc(name, lsc) \ - AuWriteLockFunc(name, lsc) - -AuRWLockFuncs(child, CHILD); -AuRWLockFuncs(child2, CHILD2); -AuRWLockFuncs(child3, CHILD3); -AuRWLockFuncs(parent, PARENT); -AuRWLockFuncs(parent2, PARENT2); -AuRWLockFuncs(parent3, PARENT3); - -#undef AuReadLockFunc -#undef AuWriteLockFunc -#undef AuRWLockFuncs - -#define DiMustNoWaiters(d) AuRwMustNoWaiters(&au_di(d)->di_rwsem) -#define DiMustAnyLock(d) AuRwMustAnyLock(&au_di(d)->di_rwsem) -#define DiMustWriteLock(d) AuRwMustWriteLock(&au_di(d)->di_rwsem) - -/* ---------------------------------------------------------------------- */ - -/* todo: memory barrier? */ -static inline unsigned int au_digen(struct dentry *d) -{ - return atomic_read(&au_di(d)->di_generation); -} - -static inline void au_h_dentry_init(struct au_hdentry *hdentry) -{ - hdentry->hd_dentry = NULL; -} - -static inline void au_hdput(struct au_hdentry *hd) -{ - if (hd) - dput(hd->hd_dentry); -} - -static inline aufs_bindex_t au_dbstart(struct dentry *dentry) -{ - DiMustAnyLock(dentry); - return au_di(dentry)->di_bstart; -} - -static inline aufs_bindex_t au_dbend(struct dentry *dentry) -{ - DiMustAnyLock(dentry); - return au_di(dentry)->di_bend; -} - -static inline aufs_bindex_t au_dbwh(struct dentry *dentry) -{ - DiMustAnyLock(dentry); - return au_di(dentry)->di_bwh; -} - -static inline aufs_bindex_t au_dbdiropq(struct dentry *dentry) -{ - DiMustAnyLock(dentry); - return au_di(dentry)->di_bdiropq; -} - -/* todo: hard/soft set? */ -static inline void au_set_dbstart(struct dentry *dentry, aufs_bindex_t bindex) -{ - DiMustWriteLock(dentry); - au_di(dentry)->di_bstart = bindex; -} - -static inline void au_set_dbend(struct dentry *dentry, aufs_bindex_t bindex) -{ - DiMustWriteLock(dentry); - au_di(dentry)->di_bend = bindex; -} - -static inline void au_set_dbwh(struct dentry *dentry, aufs_bindex_t bindex) -{ - DiMustWriteLock(dentry); - /* dbwh can be outside of bstart - bend range */ - au_di(dentry)->di_bwh = bindex; -} - -static inline void au_set_dbdiropq(struct dentry *dentry, aufs_bindex_t bindex) -{ - DiMustWriteLock(dentry); - au_di(dentry)->di_bdiropq = bindex; -} - -/* ---------------------------------------------------------------------- */ - -#ifdef CONFIG_AUFS_HNOTIFY -static inline void au_digen_dec(struct dentry *d) -{ - atomic_dec(&au_di(d)->di_generation); -} - -static inline void au_hn_di_reinit(struct dentry *dentry) -{ - dentry->d_fsdata = NULL; -} -#else -AuStubVoid(au_hn_di_reinit, struct dentry *dentry __maybe_unused) -#endif /* CONFIG_AUFS_HNOTIFY */ - -#endif /* __KERNEL__ */ -#endif /* __AUFS_DENTRY_H__ */ diff --git a/fs/aufs/dinfo.c b/fs/aufs/dinfo.c deleted file mode 100644 index 24c369634ec977..00000000000000 --- a/fs/aufs/dinfo.c +++ /dev/null @@ -1,542 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * dentry private data - */ - -#include "aufs.h" - -void au_di_init_once(void *_dinfo) -{ - struct au_dinfo *dinfo = _dinfo; - static struct lock_class_key aufs_di; - - au_rw_init(&dinfo->di_rwsem); - au_rw_class(&dinfo->di_rwsem, &aufs_di); -} - -struct au_dinfo *au_di_alloc(struct super_block *sb, unsigned int lsc) -{ - struct au_dinfo *dinfo; - int nbr, i; - - dinfo = au_cache_alloc_dinfo(); - if (unlikely(!dinfo)) - goto out; - - nbr = au_sbend(sb) + 1; - if (nbr <= 0) - nbr = 1; - dinfo->di_hdentry = kcalloc(nbr, sizeof(*dinfo->di_hdentry), GFP_NOFS); - if (dinfo->di_hdentry) { - au_rw_write_lock_nested(&dinfo->di_rwsem, lsc); - dinfo->di_bstart = -1; - dinfo->di_bend = -1; - dinfo->di_bwh = -1; - dinfo->di_bdiropq = -1; - for (i = 0; i < nbr; i++) - dinfo->di_hdentry[i].hd_id = -1; - goto out; - } - - au_cache_free_dinfo(dinfo); - dinfo = NULL; - -out: - return dinfo; -} - -void au_di_free(struct au_dinfo *dinfo) -{ - struct au_hdentry *p; - aufs_bindex_t bend, bindex; - - /* dentry may not be revalidated */ - bindex = dinfo->di_bstart; - if (bindex >= 0) { - bend = dinfo->di_bend; - p = dinfo->di_hdentry + bindex; - while (bindex++ <= bend) - au_hdput(p++); - } - kfree(dinfo->di_hdentry); - au_cache_free_dinfo(dinfo); -} - -void au_di_swap(struct au_dinfo *a, struct au_dinfo *b) -{ - struct au_hdentry *p; - aufs_bindex_t bi; - - AuRwMustWriteLock(&a->di_rwsem); - AuRwMustWriteLock(&b->di_rwsem); - -#define DiSwap(v, name) \ - do { \ - v = a->di_##name; \ - a->di_##name = b->di_##name; \ - b->di_##name = v; \ - } while (0) - - DiSwap(p, hdentry); - DiSwap(bi, bstart); - DiSwap(bi, bend); - DiSwap(bi, bwh); - DiSwap(bi, bdiropq); - /* smp_mb(); */ - -#undef DiSwap -} - -void au_di_cp(struct au_dinfo *dst, struct au_dinfo *src) -{ - AuRwMustWriteLock(&dst->di_rwsem); - AuRwMustWriteLock(&src->di_rwsem); - - dst->di_bstart = src->di_bstart; - dst->di_bend = src->di_bend; - dst->di_bwh = src->di_bwh; - dst->di_bdiropq = src->di_bdiropq; - /* smp_mb(); */ -} - -int au_di_init(struct dentry *dentry) -{ - int err; - struct super_block *sb; - struct au_dinfo *dinfo; - - err = 0; - sb = dentry->d_sb; - dinfo = au_di_alloc(sb, AuLsc_DI_CHILD); - if (dinfo) { - atomic_set(&dinfo->di_generation, au_sigen(sb)); - /* smp_mb(); */ /* atomic_set */ - dentry->d_fsdata = dinfo; - } else - err = -ENOMEM; - - return err; -} - -void au_di_fin(struct dentry *dentry) -{ - struct au_dinfo *dinfo; - - dinfo = au_di(dentry); - AuRwDestroy(&dinfo->di_rwsem); - au_di_free(dinfo); -} - -int au_di_realloc(struct au_dinfo *dinfo, int nbr) -{ - int err, sz; - struct au_hdentry *hdp; - - AuRwMustWriteLock(&dinfo->di_rwsem); - - err = -ENOMEM; - sz = sizeof(*hdp) * (dinfo->di_bend + 1); - if (!sz) - sz = sizeof(*hdp); - hdp = au_kzrealloc(dinfo->di_hdentry, sz, sizeof(*hdp) * nbr, GFP_NOFS); - if (hdp) { - dinfo->di_hdentry = hdp; - err = 0; - } - - return err; -} - -/* ---------------------------------------------------------------------- */ - -static void do_ii_write_lock(struct inode *inode, unsigned int lsc) -{ - switch (lsc) { - case AuLsc_DI_CHILD: - ii_write_lock_child(inode); - break; - case AuLsc_DI_CHILD2: - ii_write_lock_child2(inode); - break; - case AuLsc_DI_CHILD3: - ii_write_lock_child3(inode); - break; - case AuLsc_DI_PARENT: - ii_write_lock_parent(inode); - break; - case AuLsc_DI_PARENT2: - ii_write_lock_parent2(inode); - break; - case AuLsc_DI_PARENT3: - ii_write_lock_parent3(inode); - break; - default: - BUG(); - } -} - -static void do_ii_read_lock(struct inode *inode, unsigned int lsc) -{ - switch (lsc) { - case AuLsc_DI_CHILD: - ii_read_lock_child(inode); - break; - case AuLsc_DI_CHILD2: - ii_read_lock_child2(inode); - break; - case AuLsc_DI_CHILD3: - ii_read_lock_child3(inode); - break; - case AuLsc_DI_PARENT: - ii_read_lock_parent(inode); - break; - case AuLsc_DI_PARENT2: - ii_read_lock_parent2(inode); - break; - case AuLsc_DI_PARENT3: - ii_read_lock_parent3(inode); - break; - default: - BUG(); - } -} - -void di_read_lock(struct dentry *d, int flags, unsigned int lsc) -{ - au_rw_read_lock_nested(&au_di(d)->di_rwsem, lsc); - if (d->d_inode) { - if (au_ftest_lock(flags, IW)) - do_ii_write_lock(d->d_inode, lsc); - else if (au_ftest_lock(flags, IR)) - do_ii_read_lock(d->d_inode, lsc); - } -} - -void di_read_unlock(struct dentry *d, int flags) -{ - if (d->d_inode) { - if (au_ftest_lock(flags, IW)) { - au_dbg_verify_dinode(d); - ii_write_unlock(d->d_inode); - } else if (au_ftest_lock(flags, IR)) { - au_dbg_verify_dinode(d); - ii_read_unlock(d->d_inode); - } - } - au_rw_read_unlock(&au_di(d)->di_rwsem); -} - -void di_downgrade_lock(struct dentry *d, int flags) -{ - if (d->d_inode && au_ftest_lock(flags, IR)) - ii_downgrade_lock(d->d_inode); - au_rw_dgrade_lock(&au_di(d)->di_rwsem); -} - -void di_write_lock(struct dentry *d, unsigned int lsc) -{ - au_rw_write_lock_nested(&au_di(d)->di_rwsem, lsc); - if (d->d_inode) - do_ii_write_lock(d->d_inode, lsc); -} - -void di_write_unlock(struct dentry *d) -{ - au_dbg_verify_dinode(d); - if (d->d_inode) - ii_write_unlock(d->d_inode); - au_rw_write_unlock(&au_di(d)->di_rwsem); -} - -void di_write_lock2_child(struct dentry *d1, struct dentry *d2, int isdir) -{ - AuDebugOn(d1 == d2 - || d1->d_inode == d2->d_inode - || d1->d_sb != d2->d_sb); - - if (isdir && au_test_subdir(d1, d2)) { - di_write_lock_child(d1); - di_write_lock_child2(d2); - } else { - /* there should be no races */ - di_write_lock_child(d2); - di_write_lock_child2(d1); - } -} - -void di_write_lock2_parent(struct dentry *d1, struct dentry *d2, int isdir) -{ - AuDebugOn(d1 == d2 - || d1->d_inode == d2->d_inode - || d1->d_sb != d2->d_sb); - - if (isdir && au_test_subdir(d1, d2)) { - di_write_lock_parent(d1); - di_write_lock_parent2(d2); - } else { - /* there should be no races */ - di_write_lock_parent(d2); - di_write_lock_parent2(d1); - } -} - -void di_write_unlock2(struct dentry *d1, struct dentry *d2) -{ - di_write_unlock(d1); - if (d1->d_inode == d2->d_inode) - au_rw_write_unlock(&au_di(d2)->di_rwsem); - else - di_write_unlock(d2); -} - -/* ---------------------------------------------------------------------- */ - -struct dentry *au_h_dptr(struct dentry *dentry, aufs_bindex_t bindex) -{ - struct dentry *d; - - DiMustAnyLock(dentry); - - if (au_dbstart(dentry) < 0 || bindex < au_dbstart(dentry)) - return NULL; - AuDebugOn(bindex < 0); - d = au_di(dentry)->di_hdentry[0 + bindex].hd_dentry; - AuDebugOn(d && d->d_count <= 0); - return d; -} - -/* - * extended version of au_h_dptr(). - * returns a hashed and positive h_dentry in bindex, NULL, or error. - */ -struct dentry *au_h_d_alias(struct dentry *dentry, aufs_bindex_t bindex) -{ - struct dentry *h_dentry; - struct inode *inode, *h_inode; - - inode = dentry->d_inode; - AuDebugOn(!inode); - - h_dentry = NULL; - if (au_dbstart(dentry) <= bindex - && bindex <= au_dbend(dentry)) - h_dentry = au_h_dptr(dentry, bindex); - if (h_dentry && !au_d_hashed_positive(h_dentry)) { - dget(h_dentry); - goto out; /* success */ - } - - AuDebugOn(bindex < au_ibstart(inode)); - AuDebugOn(au_ibend(inode) < bindex); - h_inode = au_h_iptr(inode, bindex); - h_dentry = d_find_alias(h_inode); - if (h_dentry) { - if (!IS_ERR(h_dentry)) { - if (!au_d_hashed_positive(h_dentry)) - goto out; /* success */ - dput(h_dentry); - } else - goto out; - } - - if (au_opt_test(au_mntflags(dentry->d_sb), PLINK)) { - h_dentry = au_plink_lkup(inode, bindex); - AuDebugOn(!h_dentry); - if (!IS_ERR(h_dentry)) { - if (!au_d_hashed_positive(h_dentry)) - goto out; /* success */ - dput(h_dentry); - h_dentry = NULL; - } - } - -out: - AuDbgDentry(h_dentry); - return h_dentry; -} - -aufs_bindex_t au_dbtail(struct dentry *dentry) -{ - aufs_bindex_t bend, bwh; - - bend = au_dbend(dentry); - if (0 <= bend) { - bwh = au_dbwh(dentry); - if (!bwh) - return bwh; - if (0 < bwh && bwh < bend) - return bwh - 1; - } - return bend; -} - -aufs_bindex_t au_dbtaildir(struct dentry *dentry) -{ - aufs_bindex_t bend, bopq; - - bend = au_dbtail(dentry); - if (0 <= bend) { - bopq = au_dbdiropq(dentry); - if (0 <= bopq && bopq < bend) - bend = bopq; - } - return bend; -} - -/* ---------------------------------------------------------------------- */ - -void au_set_h_dptr(struct dentry *dentry, aufs_bindex_t bindex, - struct dentry *h_dentry) -{ - struct au_hdentry *hd = au_di(dentry)->di_hdentry + bindex; - struct au_branch *br; - - DiMustWriteLock(dentry); - - au_hdput(hd); - hd->hd_dentry = h_dentry; - if (h_dentry) { - br = au_sbr(dentry->d_sb, bindex); - hd->hd_id = br->br_id; - } -} - -int au_dbrange_test(struct dentry *dentry) -{ - int err; - aufs_bindex_t bstart, bend; - - err = 0; - bstart = au_dbstart(dentry); - bend = au_dbend(dentry); - if (bstart >= 0) - AuDebugOn(bend < 0 && bstart > bend); - else { - err = -EIO; - AuDebugOn(bend >= 0); - } - - return err; -} - -int au_digen_test(struct dentry *dentry, unsigned int sigen) -{ - int err; - - err = 0; - if (unlikely(au_digen(dentry) != sigen - || au_iigen_test(dentry->d_inode, sigen))) - err = -EIO; - - return err; -} - -void au_update_digen(struct dentry *dentry) -{ - atomic_set(&au_di(dentry)->di_generation, au_sigen(dentry->d_sb)); - /* smp_mb(); */ /* atomic_set */ -} - -void au_update_dbrange(struct dentry *dentry, int do_put_zero) -{ - struct au_dinfo *dinfo; - struct dentry *h_d; - struct au_hdentry *hdp; - - DiMustWriteLock(dentry); - - dinfo = au_di(dentry); - if (!dinfo || dinfo->di_bstart < 0) - return; - - hdp = dinfo->di_hdentry; - if (do_put_zero) { - aufs_bindex_t bindex, bend; - - bend = dinfo->di_bend; - for (bindex = dinfo->di_bstart; bindex <= bend; bindex++) { - h_d = hdp[0 + bindex].hd_dentry; - if (h_d && !h_d->d_inode) - au_set_h_dptr(dentry, bindex, NULL); - } - } - - dinfo->di_bstart = -1; - while (++dinfo->di_bstart <= dinfo->di_bend) - if (hdp[0 + dinfo->di_bstart].hd_dentry) - break; - if (dinfo->di_bstart > dinfo->di_bend) { - dinfo->di_bstart = -1; - dinfo->di_bend = -1; - return; - } - - dinfo->di_bend++; - while (0 <= --dinfo->di_bend) - if (hdp[0 + dinfo->di_bend].hd_dentry) - break; - AuDebugOn(dinfo->di_bstart > dinfo->di_bend || dinfo->di_bend < 0); -} - -void au_update_dbstart(struct dentry *dentry) -{ - aufs_bindex_t bindex, bend; - struct dentry *h_dentry; - - bend = au_dbend(dentry); - for (bindex = au_dbstart(dentry); bindex <= bend; bindex++) { - h_dentry = au_h_dptr(dentry, bindex); - if (!h_dentry) - continue; - if (h_dentry->d_inode) { - au_set_dbstart(dentry, bindex); - return; - } - au_set_h_dptr(dentry, bindex, NULL); - } -} - -void au_update_dbend(struct dentry *dentry) -{ - aufs_bindex_t bindex, bstart; - struct dentry *h_dentry; - - bstart = au_dbstart(dentry); - for (bindex = au_dbend(dentry); bindex >= bstart; bindex--) { - h_dentry = au_h_dptr(dentry, bindex); - if (!h_dentry) - continue; - if (h_dentry->d_inode) { - au_set_dbend(dentry, bindex); - return; - } - au_set_h_dptr(dentry, bindex, NULL); - } -} - -int au_find_dbindex(struct dentry *dentry, struct dentry *h_dentry) -{ - aufs_bindex_t bindex, bend; - - bend = au_dbend(dentry); - for (bindex = au_dbstart(dentry); bindex <= bend; bindex++) - if (au_h_dptr(dentry, bindex) == h_dentry) - return bindex; - return -1; -} diff --git a/fs/aufs/dir.c b/fs/aufs/dir.c deleted file mode 100644 index ddd23a3f1f1e56..00000000000000 --- a/fs/aufs/dir.c +++ /dev/null @@ -1,631 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * directory operations - */ - -#include -#include "aufs.h" - -void au_add_nlink(struct inode *dir, struct inode *h_dir) -{ - unsigned int nlink; - - AuDebugOn(!S_ISDIR(dir->i_mode) || !S_ISDIR(h_dir->i_mode)); - - nlink = dir->i_nlink; - nlink += h_dir->i_nlink - 2; - if (h_dir->i_nlink < 2) - nlink += 2; - smp_mb(); /* for i_nlink */ - /* 0 can happen in revaliding */ - set_nlink(dir, nlink); -} - -void au_sub_nlink(struct inode *dir, struct inode *h_dir) -{ - unsigned int nlink; - - AuDebugOn(!S_ISDIR(dir->i_mode) || !S_ISDIR(h_dir->i_mode)); - - nlink = dir->i_nlink; - nlink -= h_dir->i_nlink - 2; - if (h_dir->i_nlink < 2) - nlink -= 2; - smp_mb(); /* for i_nlink */ - /* nlink == 0 means the branch-fs is broken */ - set_nlink(dir, nlink); -} - -loff_t au_dir_size(struct file *file, struct dentry *dentry) -{ - loff_t sz; - aufs_bindex_t bindex, bend; - struct file *h_file; - struct dentry *h_dentry; - - sz = 0; - if (file) { - AuDebugOn(!file_inode(file)); - AuDebugOn(!S_ISDIR(file_inode(file)->i_mode)); - - bend = au_fbend_dir(file); - for (bindex = au_fbstart(file); - bindex <= bend && sz < KMALLOC_MAX_SIZE; - bindex++) { - h_file = au_hf_dir(file, bindex); - if (h_file && file_inode(h_file)) - sz += vfsub_f_size_read(h_file); - } - } else { - AuDebugOn(!dentry); - AuDebugOn(!dentry->d_inode); - AuDebugOn(!S_ISDIR(dentry->d_inode->i_mode)); - - bend = au_dbtaildir(dentry); - for (bindex = au_dbstart(dentry); - bindex <= bend && sz < KMALLOC_MAX_SIZE; - bindex++) { - h_dentry = au_h_dptr(dentry, bindex); - if (h_dentry && h_dentry->d_inode) - sz += i_size_read(h_dentry->d_inode); - } - } - if (sz < KMALLOC_MAX_SIZE) - sz = roundup_pow_of_two(sz); - if (sz > KMALLOC_MAX_SIZE) - sz = KMALLOC_MAX_SIZE; - else if (sz < NAME_MAX) { - BUILD_BUG_ON(AUFS_RDBLK_DEF < NAME_MAX); - sz = AUFS_RDBLK_DEF; - } - return sz; -} - -/* ---------------------------------------------------------------------- */ - -static int reopen_dir(struct file *file) -{ - int err; - unsigned int flags; - aufs_bindex_t bindex, btail, bstart; - struct dentry *dentry, *h_dentry; - struct file *h_file; - - /* open all lower dirs */ - dentry = file->f_dentry; - bstart = au_dbstart(dentry); - for (bindex = au_fbstart(file); bindex < bstart; bindex++) - au_set_h_fptr(file, bindex, NULL); - au_set_fbstart(file, bstart); - - btail = au_dbtaildir(dentry); - for (bindex = au_fbend_dir(file); btail < bindex; bindex--) - au_set_h_fptr(file, bindex, NULL); - au_set_fbend_dir(file, btail); - - flags = vfsub_file_flags(file); - for (bindex = bstart; bindex <= btail; bindex++) { - h_dentry = au_h_dptr(dentry, bindex); - if (!h_dentry) - continue; - h_file = au_hf_dir(file, bindex); - if (h_file) - continue; - - h_file = au_h_open(dentry, bindex, flags, file, /*force_wr*/0); - err = PTR_ERR(h_file); - if (IS_ERR(h_file)) - goto out; /* close all? */ - au_set_h_fptr(file, bindex, h_file); - } - au_update_figen(file); - /* todo: necessary? */ - /* file->f_ra = h_file->f_ra; */ - err = 0; - -out: - return err; -} - -static int do_open_dir(struct file *file, int flags) -{ - int err; - aufs_bindex_t bindex, btail; - struct dentry *dentry, *h_dentry; - struct file *h_file; - - FiMustWriteLock(file); - - err = 0; - dentry = file->f_dentry; - file->f_version = dentry->d_inode->i_version; - bindex = au_dbstart(dentry); - au_set_fbstart(file, bindex); - btail = au_dbtaildir(dentry); - au_set_fbend_dir(file, btail); - for (; !err && bindex <= btail; bindex++) { - h_dentry = au_h_dptr(dentry, bindex); - if (!h_dentry) - continue; - - h_file = au_h_open(dentry, bindex, flags, file, /*force_wr*/0); - if (IS_ERR(h_file)) { - err = PTR_ERR(h_file); - break; - } - au_set_h_fptr(file, bindex, h_file); - } - au_update_figen(file); - /* todo: necessary? */ - /* file->f_ra = h_file->f_ra; */ - if (!err) - return 0; /* success */ - - /* close all */ - for (bindex = au_fbstart(file); bindex <= btail; bindex++) - au_set_h_fptr(file, bindex, NULL); - au_set_fbstart(file, -1); - au_set_fbend_dir(file, -1); - - return err; -} - -static int aufs_open_dir(struct inode *inode __maybe_unused, - struct file *file) -{ - int err; - struct super_block *sb; - struct au_fidir *fidir; - - err = -ENOMEM; - sb = file->f_dentry->d_sb; - si_read_lock(sb, AuLock_FLUSH); - fidir = au_fidir_alloc(sb); - if (fidir) { - err = au_do_open(file, do_open_dir, fidir); - if (unlikely(err)) - kfree(fidir); - } - si_read_unlock(sb); - return err; -} - -static int aufs_release_dir(struct inode *inode __maybe_unused, - struct file *file) -{ - struct au_vdir *vdir_cache; - struct au_finfo *finfo; - struct au_fidir *fidir; - aufs_bindex_t bindex, bend; - - finfo = au_fi(file); - fidir = finfo->fi_hdir; - if (fidir) { - vdir_cache = fidir->fd_vdir_cache; /* lock-free */ - if (vdir_cache) - au_vdir_free(vdir_cache); - - bindex = finfo->fi_btop; - if (bindex >= 0) { - /* - * calls fput() instead of filp_close(), - * since no dnotify or lock for the lower file. - */ - bend = fidir->fd_bbot; - for (; bindex <= bend; bindex++) - au_set_h_fptr(file, bindex, NULL); - } - kfree(fidir); - finfo->fi_hdir = NULL; - } - au_finfo_fin(file); - return 0; -} - -/* ---------------------------------------------------------------------- */ - -static int au_do_flush_dir(struct file *file, fl_owner_t id) -{ - int err; - aufs_bindex_t bindex, bend; - struct file *h_file; - - err = 0; - bend = au_fbend_dir(file); - for (bindex = au_fbstart(file); !err && bindex <= bend; bindex++) { - h_file = au_hf_dir(file, bindex); - if (h_file) - err = vfsub_flush(h_file, id); - } - return err; -} - -static int aufs_flush_dir(struct file *file, fl_owner_t id) -{ - return au_do_flush(file, id, au_do_flush_dir); -} - -/* ---------------------------------------------------------------------- */ - -static int au_do_fsync_dir_no_file(struct dentry *dentry, int datasync) -{ - int err; - aufs_bindex_t bend, bindex; - struct inode *inode; - struct super_block *sb; - - err = 0; - sb = dentry->d_sb; - inode = dentry->d_inode; - IMustLock(inode); - bend = au_dbend(dentry); - for (bindex = au_dbstart(dentry); !err && bindex <= bend; bindex++) { - struct path h_path; - - if (au_test_ro(sb, bindex, inode)) - continue; - h_path.dentry = au_h_dptr(dentry, bindex); - if (!h_path.dentry) - continue; - - h_path.mnt = au_sbr_mnt(sb, bindex); - err = vfsub_fsync(NULL, &h_path, datasync); - } - - return err; -} - -static int au_do_fsync_dir(struct file *file, int datasync) -{ - int err; - aufs_bindex_t bend, bindex; - struct file *h_file; - struct super_block *sb; - struct inode *inode; - - err = au_reval_and_lock_fdi(file, reopen_dir, /*wlock*/1); - if (unlikely(err)) - goto out; - - sb = file->f_dentry->d_sb; - inode = file_inode(file); - bend = au_fbend_dir(file); - for (bindex = au_fbstart(file); !err && bindex <= bend; bindex++) { - h_file = au_hf_dir(file, bindex); - if (!h_file || au_test_ro(sb, bindex, inode)) - continue; - - err = vfsub_fsync(h_file, &h_file->f_path, datasync); - } - -out: - return err; -} - -/* - * @file may be NULL - */ -static int aufs_fsync_dir(struct file *file, loff_t start, loff_t end, - int datasync) -{ - int err; - struct dentry *dentry; - struct super_block *sb; - struct mutex *mtx; - - err = 0; - dentry = file->f_dentry; - mtx = &dentry->d_inode->i_mutex; - mutex_lock(mtx); - sb = dentry->d_sb; - si_noflush_read_lock(sb); - if (file) - err = au_do_fsync_dir(file, datasync); - else { - di_write_lock_child(dentry); - err = au_do_fsync_dir_no_file(dentry, datasync); - } - au_cpup_attr_timesizes(dentry->d_inode); - di_write_unlock(dentry); - if (file) - fi_write_unlock(file); - - si_read_unlock(sb); - mutex_unlock(mtx); - return err; -} - -/* ---------------------------------------------------------------------- */ - -static int aufs_readdir(struct file *file, void *dirent, filldir_t filldir) -{ - int err; - struct dentry *dentry; - struct inode *inode, *h_inode; - struct super_block *sb; - - dentry = file->f_dentry; - inode = dentry->d_inode; - IMustLock(inode); - - sb = dentry->d_sb; - si_read_lock(sb, AuLock_FLUSH); - err = au_reval_and_lock_fdi(file, reopen_dir, /*wlock*/1); - if (unlikely(err)) - goto out; - err = au_alive_dir(dentry); - if (!err) - err = au_vdir_init(file); - di_downgrade_lock(dentry, AuLock_IR); - if (unlikely(err)) - goto out_unlock; - - h_inode = au_h_iptr(inode, au_ibstart(inode)); - if (!au_test_nfsd()) { - err = au_vdir_fill_de(file, dirent, filldir); - fsstack_copy_attr_atime(inode, h_inode); - } else { - /* - * nfsd filldir may call lookup_one_len(), vfs_getattr(), - * encode_fh() and others. - */ - atomic_inc(&h_inode->i_count); - di_read_unlock(dentry, AuLock_IR); - si_read_unlock(sb); - err = au_vdir_fill_de(file, dirent, filldir); - fsstack_copy_attr_atime(inode, h_inode); - fi_write_unlock(file); - iput(h_inode); - - AuTraceErr(err); - return err; - } - -out_unlock: - di_read_unlock(dentry, AuLock_IR); - fi_write_unlock(file); -out: - si_read_unlock(sb); - return err; -} - -/* ---------------------------------------------------------------------- */ - -#define AuTestEmpty_WHONLY 1 -#define AuTestEmpty_CALLED (1 << 1) -#define AuTestEmpty_SHWH (1 << 2) -#define au_ftest_testempty(flags, name) ((flags) & AuTestEmpty_##name) -#define au_fset_testempty(flags, name) \ - do { (flags) |= AuTestEmpty_##name; } while (0) -#define au_fclr_testempty(flags, name) \ - do { (flags) &= ~AuTestEmpty_##name; } while (0) - -#ifndef CONFIG_AUFS_SHWH -#undef AuTestEmpty_SHWH -#define AuTestEmpty_SHWH 0 -#endif - -struct test_empty_arg { - struct au_nhash *whlist; - unsigned int flags; - int err; - aufs_bindex_t bindex; -}; - -static int test_empty_cb(void *__arg, const char *__name, int namelen, - loff_t offset __maybe_unused, u64 ino, - unsigned int d_type) -{ - struct test_empty_arg *arg = __arg; - char *name = (void *)__name; - - arg->err = 0; - au_fset_testempty(arg->flags, CALLED); - /* smp_mb(); */ - if (name[0] == '.' - && (namelen == 1 || (name[1] == '.' && namelen == 2))) - goto out; /* success */ - - if (namelen <= AUFS_WH_PFX_LEN - || memcmp(name, AUFS_WH_PFX, AUFS_WH_PFX_LEN)) { - if (au_ftest_testempty(arg->flags, WHONLY) - && !au_nhash_test_known_wh(arg->whlist, name, namelen)) - arg->err = -ENOTEMPTY; - goto out; - } - - name += AUFS_WH_PFX_LEN; - namelen -= AUFS_WH_PFX_LEN; - if (!au_nhash_test_known_wh(arg->whlist, name, namelen)) - arg->err = au_nhash_append_wh - (arg->whlist, name, namelen, ino, d_type, arg->bindex, - au_ftest_testempty(arg->flags, SHWH)); - -out: - /* smp_mb(); */ - AuTraceErr(arg->err); - return arg->err; -} - -static int do_test_empty(struct dentry *dentry, struct test_empty_arg *arg) -{ - int err; - struct file *h_file; - - h_file = au_h_open(dentry, arg->bindex, - O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_LARGEFILE, - /*file*/NULL, /*force_wr*/0); - err = PTR_ERR(h_file); - if (IS_ERR(h_file)) - goto out; - - err = 0; - if (!au_opt_test(au_mntflags(dentry->d_sb), UDBA_NONE) - && !file_inode(h_file)->i_nlink) - goto out_put; - - do { - arg->err = 0; - au_fclr_testempty(arg->flags, CALLED); - /* smp_mb(); */ - err = vfsub_readdir(h_file, test_empty_cb, arg); - if (err >= 0) - err = arg->err; - } while (!err && au_ftest_testempty(arg->flags, CALLED)); - -out_put: - fput(h_file); - au_sbr_put(dentry->d_sb, arg->bindex); -out: - return err; -} - -struct do_test_empty_args { - int *errp; - struct dentry *dentry; - struct test_empty_arg *arg; -}; - -static void call_do_test_empty(void *args) -{ - struct do_test_empty_args *a = args; - *a->errp = do_test_empty(a->dentry, a->arg); -} - -static int sio_test_empty(struct dentry *dentry, struct test_empty_arg *arg) -{ - int err, wkq_err; - struct dentry *h_dentry; - struct inode *h_inode; - - h_dentry = au_h_dptr(dentry, arg->bindex); - h_inode = h_dentry->d_inode; - /* todo: i_mode changes anytime? */ - mutex_lock_nested(&h_inode->i_mutex, AuLsc_I_CHILD); - err = au_test_h_perm_sio(h_inode, MAY_EXEC | MAY_READ); - mutex_unlock(&h_inode->i_mutex); - if (!err) - err = do_test_empty(dentry, arg); - else { - struct do_test_empty_args args = { - .errp = &err, - .dentry = dentry, - .arg = arg - }; - unsigned int flags = arg->flags; - - wkq_err = au_wkq_wait(call_do_test_empty, &args); - if (unlikely(wkq_err)) - err = wkq_err; - arg->flags = flags; - } - - return err; -} - -int au_test_empty_lower(struct dentry *dentry) -{ - int err; - unsigned int rdhash; - aufs_bindex_t bindex, bstart, btail; - struct au_nhash whlist; - struct test_empty_arg arg; - int (*test_empty)(struct dentry *dentry, struct test_empty_arg *arg); - - SiMustAnyLock(dentry->d_sb); - - rdhash = au_sbi(dentry->d_sb)->si_rdhash; - if (!rdhash) - rdhash = au_rdhash_est(au_dir_size(/*file*/NULL, dentry)); - err = au_nhash_alloc(&whlist, rdhash, GFP_NOFS); - if (unlikely(err)) - goto out; - - arg.flags = 0; - arg.whlist = &whlist; - bstart = au_dbstart(dentry); - if (au_opt_test(au_mntflags(dentry->d_sb), SHWH)) - au_fset_testempty(arg.flags, SHWH); - test_empty = do_test_empty; - if (au_opt_test(au_mntflags(dentry->d_sb), DIRPERM1)) - test_empty = sio_test_empty; - arg.bindex = bstart; - err = test_empty(dentry, &arg); - if (unlikely(err)) - goto out_whlist; - - au_fset_testempty(arg.flags, WHONLY); - btail = au_dbtaildir(dentry); - for (bindex = bstart + 1; !err && bindex <= btail; bindex++) { - struct dentry *h_dentry; - - h_dentry = au_h_dptr(dentry, bindex); - if (h_dentry && h_dentry->d_inode) { - arg.bindex = bindex; - err = test_empty(dentry, &arg); - } - } - -out_whlist: - au_nhash_wh_free(&whlist); -out: - return err; -} - -int au_test_empty(struct dentry *dentry, struct au_nhash *whlist) -{ - int err; - struct test_empty_arg arg; - aufs_bindex_t bindex, btail; - - err = 0; - arg.whlist = whlist; - arg.flags = AuTestEmpty_WHONLY; - if (au_opt_test(au_mntflags(dentry->d_sb), SHWH)) - au_fset_testempty(arg.flags, SHWH); - btail = au_dbtaildir(dentry); - for (bindex = au_dbstart(dentry); !err && bindex <= btail; bindex++) { - struct dentry *h_dentry; - - h_dentry = au_h_dptr(dentry, bindex); - if (h_dentry && h_dentry->d_inode) { - arg.bindex = bindex; - err = sio_test_empty(dentry, &arg); - } - } - - return err; -} - -/* ---------------------------------------------------------------------- */ - -const struct file_operations aufs_dir_fop = { - .owner = THIS_MODULE, - .llseek = default_llseek, - .read = generic_read_dir, - .readdir = aufs_readdir, - .unlocked_ioctl = aufs_ioctl_dir, -#ifdef CONFIG_COMPAT - .compat_ioctl = aufs_compat_ioctl_dir, -#endif - .open = aufs_open_dir, - .release = aufs_release_dir, - .flush = aufs_flush_dir, - .fsync = aufs_fsync_dir -}; diff --git a/fs/aufs/dir.h b/fs/aufs/dir.h deleted file mode 100644 index e41c45d3a59850..00000000000000 --- a/fs/aufs/dir.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * directory operations - */ - -#ifndef __AUFS_DIR_H__ -#define __AUFS_DIR_H__ - -#ifdef __KERNEL__ - -#include - -/* ---------------------------------------------------------------------- */ - -/* need to be faster and smaller */ - -struct au_nhash { - unsigned int nh_num; - struct hlist_head *nh_head; -}; - -struct au_vdir_destr { - unsigned char len; - unsigned char name[0]; -} __packed; - -struct au_vdir_dehstr { - struct hlist_node hash; - struct au_vdir_destr *str; -} ____cacheline_aligned_in_smp; - -struct au_vdir_de { - ino_t de_ino; - unsigned char de_type; - /* caution: packed */ - struct au_vdir_destr de_str; -} __packed; - -struct au_vdir_wh { - struct hlist_node wh_hash; -#ifdef CONFIG_AUFS_SHWH - ino_t wh_ino; - aufs_bindex_t wh_bindex; - unsigned char wh_type; -#else - aufs_bindex_t wh_bindex; -#endif - /* caution: packed */ - struct au_vdir_destr wh_str; -} __packed; - -union au_vdir_deblk_p { - unsigned char *deblk; - struct au_vdir_de *de; -}; - -struct au_vdir { - unsigned char **vd_deblk; - unsigned long vd_nblk; - struct { - unsigned long ul; - union au_vdir_deblk_p p; - } vd_last; - - unsigned long vd_version; - unsigned int vd_deblk_sz; - unsigned long vd_jiffy; -} ____cacheline_aligned_in_smp; - -/* ---------------------------------------------------------------------- */ - -/* dir.c */ -extern const struct file_operations aufs_dir_fop; -void au_add_nlink(struct inode *dir, struct inode *h_dir); -void au_sub_nlink(struct inode *dir, struct inode *h_dir); -loff_t au_dir_size(struct file *file, struct dentry *dentry); -int au_test_empty_lower(struct dentry *dentry); -int au_test_empty(struct dentry *dentry, struct au_nhash *whlist); - -/* vdir.c */ -unsigned int au_rdhash_est(loff_t sz); -int au_nhash_alloc(struct au_nhash *nhash, unsigned int num_hash, gfp_t gfp); -void au_nhash_wh_free(struct au_nhash *whlist); -int au_nhash_test_longer_wh(struct au_nhash *whlist, aufs_bindex_t btgt, - int limit); -int au_nhash_test_known_wh(struct au_nhash *whlist, char *name, int nlen); -int au_nhash_append_wh(struct au_nhash *whlist, char *name, int nlen, ino_t ino, - unsigned int d_type, aufs_bindex_t bindex, - unsigned char shwh); -void au_vdir_free(struct au_vdir *vdir); -int au_vdir_init(struct file *file); -int au_vdir_fill_de(struct file *file, void *dirent, filldir_t filldir); - -/* ioctl.c */ -long aufs_ioctl_dir(struct file *file, unsigned int cmd, unsigned long arg); - -#ifdef CONFIG_AUFS_RDU -/* rdu.c */ -long au_rdu_ioctl(struct file *file, unsigned int cmd, unsigned long arg); -#ifdef CONFIG_COMPAT -long au_rdu_compat_ioctl(struct file *file, unsigned int cmd, - unsigned long arg); -#endif -#else -AuStub(long, au_rdu_ioctl, return -EINVAL, struct file *file, - unsigned int cmd, unsigned long arg) -#ifdef CONFIG_COMPAT -AuStub(long, au_rdu_compat_ioctl, return -EINVAL, struct file *file, - unsigned int cmd, unsigned long arg) -#endif -#endif - -#endif /* __KERNEL__ */ -#endif /* __AUFS_DIR_H__ */ diff --git a/fs/aufs/dynop.c b/fs/aufs/dynop.c deleted file mode 100644 index 24d32cef9cb705..00000000000000 --- a/fs/aufs/dynop.c +++ /dev/null @@ -1,378 +0,0 @@ -/* - * Copyright (C) 2010-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * dynamically customizable operations for regular files - */ - -#include "aufs.h" - -#define DyPrSym(key) AuDbgSym(key->dk_op.dy_hop) - -/* - * How large will these lists be? - * Usually just a few elements, 20-30 at most for each, I guess. - */ -static struct au_splhead dynop[AuDyLast]; - -static struct au_dykey *dy_gfind_get(struct au_splhead *spl, const void *h_op) -{ - struct au_dykey *key, *tmp; - struct list_head *head; - - key = NULL; - head = &spl->head; - rcu_read_lock(); - list_for_each_entry_rcu(tmp, head, dk_list) - if (tmp->dk_op.dy_hop == h_op) { - key = tmp; - kref_get(&key->dk_kref); - break; - } - rcu_read_unlock(); - - return key; -} - -static struct au_dykey *dy_bradd(struct au_branch *br, struct au_dykey *key) -{ - struct au_dykey **k, *found; - const void *h_op = key->dk_op.dy_hop; - int i; - - found = NULL; - k = br->br_dykey; - for (i = 0; i < AuBrDynOp; i++) - if (k[i]) { - if (k[i]->dk_op.dy_hop == h_op) { - found = k[i]; - break; - } - } else - break; - if (!found) { - spin_lock(&br->br_dykey_lock); - for (; i < AuBrDynOp; i++) - if (k[i]) { - if (k[i]->dk_op.dy_hop == h_op) { - found = k[i]; - break; - } - } else { - k[i] = key; - break; - } - spin_unlock(&br->br_dykey_lock); - BUG_ON(i == AuBrDynOp); /* expand the array */ - } - - return found; -} - -/* kref_get() if @key is already added */ -static struct au_dykey *dy_gadd(struct au_splhead *spl, struct au_dykey *key) -{ - struct au_dykey *tmp, *found; - struct list_head *head; - const void *h_op = key->dk_op.dy_hop; - - found = NULL; - head = &spl->head; - spin_lock(&spl->spin); - list_for_each_entry(tmp, head, dk_list) - if (tmp->dk_op.dy_hop == h_op) { - kref_get(&tmp->dk_kref); - found = tmp; - break; - } - if (!found) - list_add_rcu(&key->dk_list, head); - spin_unlock(&spl->spin); - - if (!found) - DyPrSym(key); - return found; -} - -static void dy_free_rcu(struct rcu_head *rcu) -{ - struct au_dykey *key; - - key = container_of(rcu, struct au_dykey, dk_rcu); - DyPrSym(key); - kfree(key); -} - -static void dy_free(struct kref *kref) -{ - struct au_dykey *key; - struct au_splhead *spl; - - key = container_of(kref, struct au_dykey, dk_kref); - spl = dynop + key->dk_op.dy_type; - au_spl_del_rcu(&key->dk_list, spl); - call_rcu(&key->dk_rcu, dy_free_rcu); -} - -void au_dy_put(struct au_dykey *key) -{ - kref_put(&key->dk_kref, dy_free); -} - -/* ---------------------------------------------------------------------- */ - -#define DyDbgSize(cnt, op) AuDebugOn(cnt != sizeof(op)/sizeof(void *)) - -#ifdef CONFIG_AUFS_DEBUG -#define DyDbgDeclare(cnt) unsigned int cnt = 0 -#define DyDbgInc(cnt) do { cnt++; } while (0) -#else -#define DyDbgDeclare(cnt) do {} while (0) -#define DyDbgInc(cnt) do {} while (0) -#endif - -#define DySet(func, dst, src, h_op, h_sb) do { \ - DyDbgInc(cnt); \ - if (h_op->func) { \ - if (src.func) \ - dst.func = src.func; \ - else \ - AuDbg("%s %s\n", au_sbtype(h_sb), #func); \ - } \ -} while (0) - -#define DySetForce(func, dst, src) do { \ - AuDebugOn(!src.func); \ - DyDbgInc(cnt); \ - dst.func = src.func; \ -} while (0) - -#define DySetAop(func) \ - DySet(func, dyaop->da_op, aufs_aop, h_aop, h_sb) -#define DySetAopForce(func) \ - DySetForce(func, dyaop->da_op, aufs_aop) - -static void dy_aop(struct au_dykey *key, const void *h_op, - struct super_block *h_sb __maybe_unused) -{ - struct au_dyaop *dyaop = (void *)key; - const struct address_space_operations *h_aop = h_op; - DyDbgDeclare(cnt); - - AuDbg("%s\n", au_sbtype(h_sb)); - - DySetAop(writepage); - DySetAopForce(readpage); /* force */ - DySetAop(writepages); - DySetAop(set_page_dirty); - DySetAop(readpages); - DySetAop(write_begin); - DySetAop(write_end); - DySetAop(bmap); - DySetAop(invalidatepage); - DySetAop(releasepage); - DySetAop(freepage); - /* these two will be changed according to an aufs mount option */ - DySetAop(direct_IO); - DySetAop(get_xip_mem); - DySetAop(migratepage); - DySetAop(launder_page); - DySetAop(is_partially_uptodate); - DySetAop(error_remove_page); - DySetAop(swap_activate); - DySetAop(swap_deactivate); - - DyDbgSize(cnt, *h_aop); - dyaop->da_get_xip_mem = h_aop->get_xip_mem; -} - -/* ---------------------------------------------------------------------- */ - -static void dy_bug(struct kref *kref) -{ - BUG(); -} - -static struct au_dykey *dy_get(struct au_dynop *op, struct au_branch *br) -{ - struct au_dykey *key, *old; - struct au_splhead *spl; - struct op { - unsigned int sz; - void (*set)(struct au_dykey *key, const void *h_op, - struct super_block *h_sb __maybe_unused); - }; - static const struct op a[] = { - [AuDy_AOP] = { - .sz = sizeof(struct au_dyaop), - .set = dy_aop - } - }; - const struct op *p; - - spl = dynop + op->dy_type; - key = dy_gfind_get(spl, op->dy_hop); - if (key) - goto out_add; /* success */ - - p = a + op->dy_type; - key = kzalloc(p->sz, GFP_NOFS); - if (unlikely(!key)) { - key = ERR_PTR(-ENOMEM); - goto out; - } - - key->dk_op.dy_hop = op->dy_hop; - kref_init(&key->dk_kref); - p->set(key, op->dy_hop, au_br_sb(br)); - old = dy_gadd(spl, key); - if (old) { - kfree(key); - key = old; - } - -out_add: - old = dy_bradd(br, key); - if (old) - /* its ref-count should never be zero here */ - kref_put(&key->dk_kref, dy_bug); -out: - return key; -} - -/* ---------------------------------------------------------------------- */ -/* - * Aufs prohibits O_DIRECT by defaut even if the branch supports it. - * This behaviour is necessary to return an error from open(O_DIRECT) instead - * of the succeeding I/O. The dio mount option enables O_DIRECT and makes - * open(O_DIRECT) always succeed, but the succeeding I/O may return an error. - * See the aufs manual in detail. - * - * To keep this behaviour, aufs has to set NULL to ->get_xip_mem too, and the - * performance of fadvise() and madvise() may be affected. - */ -static void dy_adx(struct au_dyaop *dyaop, int do_dx) -{ - if (!do_dx) { - dyaop->da_op.direct_IO = NULL; - dyaop->da_op.get_xip_mem = NULL; - } else { - dyaop->da_op.direct_IO = aufs_aop.direct_IO; - dyaop->da_op.get_xip_mem = aufs_aop.get_xip_mem; - if (!dyaop->da_get_xip_mem) - dyaop->da_op.get_xip_mem = NULL; - } -} - -static struct au_dyaop *dy_aget(struct au_branch *br, - const struct address_space_operations *h_aop, - int do_dx) -{ - struct au_dyaop *dyaop; - struct au_dynop op; - - op.dy_type = AuDy_AOP; - op.dy_haop = h_aop; - dyaop = (void *)dy_get(&op, br); - if (IS_ERR(dyaop)) - goto out; - dy_adx(dyaop, do_dx); - -out: - return dyaop; -} - -int au_dy_iaop(struct inode *inode, aufs_bindex_t bindex, - struct inode *h_inode) -{ - int err, do_dx; - struct super_block *sb; - struct au_branch *br; - struct au_dyaop *dyaop; - - AuDebugOn(!S_ISREG(h_inode->i_mode)); - IiMustWriteLock(inode); - - sb = inode->i_sb; - br = au_sbr(sb, bindex); - do_dx = !!au_opt_test(au_mntflags(sb), DIO); - dyaop = dy_aget(br, h_inode->i_mapping->a_ops, do_dx); - err = PTR_ERR(dyaop); - if (IS_ERR(dyaop)) - /* unnecessary to call dy_fput() */ - goto out; - - err = 0; - inode->i_mapping->a_ops = &dyaop->da_op; - -out: - return err; -} - -/* - * Is it safe to replace a_ops during the inode/file is in operation? - * Yes, I hope so. - */ -int au_dy_irefresh(struct inode *inode) -{ - int err; - aufs_bindex_t bstart; - struct inode *h_inode; - - err = 0; - if (S_ISREG(inode->i_mode)) { - bstart = au_ibstart(inode); - h_inode = au_h_iptr(inode, bstart); - err = au_dy_iaop(inode, bstart, h_inode); - } - return err; -} - -void au_dy_arefresh(int do_dx) -{ - struct au_splhead *spl; - struct list_head *head; - struct au_dykey *key; - - spl = dynop + AuDy_AOP; - head = &spl->head; - spin_lock(&spl->spin); - list_for_each_entry(key, head, dk_list) - dy_adx((void *)key, do_dx); - spin_unlock(&spl->spin); -} - -/* ---------------------------------------------------------------------- */ - -void __init au_dy_init(void) -{ - int i; - - /* make sure that 'struct au_dykey *' can be any type */ - BUILD_BUG_ON(offsetof(struct au_dyaop, da_key)); - - for (i = 0; i < AuDyLast; i++) - au_spl_init(dynop + i); -} - -void au_dy_fin(void) -{ - int i; - - for (i = 0; i < AuDyLast; i++) - WARN_ON(!list_empty(&dynop[i].head)); -} diff --git a/fs/aufs/dynop.h b/fs/aufs/dynop.h deleted file mode 100644 index 9b7f9c6ac18e6b..00000000000000 --- a/fs/aufs/dynop.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (C) 2010-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * dynamically customizable operations (for regular files only) - */ - -#ifndef __AUFS_DYNOP_H__ -#define __AUFS_DYNOP_H__ - -#ifdef __KERNEL__ - -#include "inode.h" - -enum {AuDy_AOP, AuDyLast}; - -struct au_dynop { - int dy_type; - union { - const void *dy_hop; - const struct address_space_operations *dy_haop; - }; -}; - -struct au_dykey { - union { - struct list_head dk_list; - struct rcu_head dk_rcu; - }; - struct au_dynop dk_op; - - /* - * during I am in the branch local array, kref is gotten. when the - * branch is removed, kref is put. - */ - struct kref dk_kref; -}; - -/* stop unioning since their sizes are very different from each other */ -struct au_dyaop { - struct au_dykey da_key; - struct address_space_operations da_op; /* not const */ - int (*da_get_xip_mem)(struct address_space *, pgoff_t, int, - void **, unsigned long *); -}; - -/* ---------------------------------------------------------------------- */ - -/* dynop.c */ -struct au_branch; -void au_dy_put(struct au_dykey *key); -int au_dy_iaop(struct inode *inode, aufs_bindex_t bindex, - struct inode *h_inode); -int au_dy_irefresh(struct inode *inode); -void au_dy_arefresh(int do_dio); - -void __init au_dy_init(void); -void au_dy_fin(void); - -#endif /* __KERNEL__ */ -#endif /* __AUFS_DYNOP_H__ */ diff --git a/fs/aufs/export.c b/fs/aufs/export.c deleted file mode 100644 index 484794df25e57b..00000000000000 --- a/fs/aufs/export.c +++ /dev/null @@ -1,825 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * export via nfs - */ - -#include -#include -#include -#include -#include -#include -#include "../fs/mount.h" -#include "aufs.h" - -union conv { -#ifdef CONFIG_AUFS_INO_T_64 - __u32 a[2]; -#else - __u32 a[1]; -#endif - ino_t ino; -}; - -static ino_t decode_ino(__u32 *a) -{ - union conv u; - - BUILD_BUG_ON(sizeof(u.ino) != sizeof(u.a)); - u.a[0] = a[0]; -#ifdef CONFIG_AUFS_INO_T_64 - u.a[1] = a[1]; -#endif - return u.ino; -} - -static void encode_ino(__u32 *a, ino_t ino) -{ - union conv u; - - u.ino = ino; - a[0] = u.a[0]; -#ifdef CONFIG_AUFS_INO_T_64 - a[1] = u.a[1]; -#endif -} - -/* NFS file handle */ -enum { - Fh_br_id, - Fh_sigen, -#ifdef CONFIG_AUFS_INO_T_64 - /* support 64bit inode number */ - Fh_ino1, - Fh_ino2, - Fh_dir_ino1, - Fh_dir_ino2, -#else - Fh_ino1, - Fh_dir_ino1, -#endif - Fh_igen, - Fh_h_type, - Fh_tail, - - Fh_ino = Fh_ino1, - Fh_dir_ino = Fh_dir_ino1 -}; - -static int au_test_anon(struct dentry *dentry) -{ - /* note: read d_flags without d_lock */ - return !!(dentry->d_flags & DCACHE_DISCONNECTED); -} - -int au_test_nfsd(void) -{ - int ret; - struct task_struct *tsk = current; - char comm[sizeof(tsk->comm)]; - - ret = 0; - if (tsk->flags & PF_KTHREAD) { - get_task_comm(comm, tsk); - ret = !strcmp(comm, "nfsd"); - } - - return ret; -} - -/* ---------------------------------------------------------------------- */ -/* inode generation external table */ - -void au_xigen_inc(struct inode *inode) -{ - loff_t pos; - ssize_t sz; - __u32 igen; - struct super_block *sb; - struct au_sbinfo *sbinfo; - - sb = inode->i_sb; - AuDebugOn(!au_opt_test(au_mntflags(sb), XINO)); - - sbinfo = au_sbi(sb); - pos = inode->i_ino; - pos *= sizeof(igen); - igen = inode->i_generation + 1; - sz = xino_fwrite(sbinfo->si_xwrite, sbinfo->si_xigen, &igen, - sizeof(igen), &pos); - if (sz == sizeof(igen)) - return; /* success */ - - if (unlikely(sz >= 0)) - AuIOErr("xigen error (%zd)\n", sz); -} - -int au_xigen_new(struct inode *inode) -{ - int err; - loff_t pos; - ssize_t sz; - struct super_block *sb; - struct au_sbinfo *sbinfo; - struct file *file; - - err = 0; - /* todo: dirty, at mount time */ - if (inode->i_ino == AUFS_ROOT_INO) - goto out; - sb = inode->i_sb; - SiMustAnyLock(sb); - if (unlikely(!au_opt_test(au_mntflags(sb), XINO))) - goto out; - - err = -EFBIG; - pos = inode->i_ino; - if (unlikely(au_loff_max / sizeof(inode->i_generation) - 1 < pos)) { - AuIOErr1("too large i%lld\n", pos); - goto out; - } - pos *= sizeof(inode->i_generation); - - err = 0; - sbinfo = au_sbi(sb); - file = sbinfo->si_xigen; - BUG_ON(!file); - - if (vfsub_f_size_read(file) - < pos + sizeof(inode->i_generation)) { - inode->i_generation = atomic_inc_return(&sbinfo->si_xigen_next); - sz = xino_fwrite(sbinfo->si_xwrite, file, &inode->i_generation, - sizeof(inode->i_generation), &pos); - } else - sz = xino_fread(sbinfo->si_xread, file, &inode->i_generation, - sizeof(inode->i_generation), &pos); - if (sz == sizeof(inode->i_generation)) - goto out; /* success */ - - err = sz; - if (unlikely(sz >= 0)) { - err = -EIO; - AuIOErr("xigen error (%zd)\n", sz); - } - -out: - return err; -} - -int au_xigen_set(struct super_block *sb, struct file *base) -{ - int err; - struct au_sbinfo *sbinfo; - struct file *file; - - SiMustWriteLock(sb); - - sbinfo = au_sbi(sb); - file = au_xino_create2(base, sbinfo->si_xigen); - err = PTR_ERR(file); - if (IS_ERR(file)) - goto out; - err = 0; - if (sbinfo->si_xigen) - fput(sbinfo->si_xigen); - sbinfo->si_xigen = file; - -out: - return err; -} - -void au_xigen_clr(struct super_block *sb) -{ - struct au_sbinfo *sbinfo; - - SiMustWriteLock(sb); - - sbinfo = au_sbi(sb); - if (sbinfo->si_xigen) { - fput(sbinfo->si_xigen); - sbinfo->si_xigen = NULL; - } -} - -/* ---------------------------------------------------------------------- */ - -static struct dentry *decode_by_ino(struct super_block *sb, ino_t ino, - ino_t dir_ino) -{ - struct dentry *dentry, *d; - struct inode *inode; - unsigned int sigen; - - dentry = NULL; - inode = ilookup(sb, ino); - if (!inode) - goto out; - - dentry = ERR_PTR(-ESTALE); - sigen = au_sigen(sb); - if (unlikely(is_bad_inode(inode) - || IS_DEADDIR(inode) - || sigen != au_iigen(inode, NULL))) - goto out_iput; - - dentry = NULL; - if (!dir_ino || S_ISDIR(inode->i_mode)) - dentry = d_find_alias(inode); - else { - spin_lock(&inode->i_lock); - hlist_for_each_entry(d, &inode->i_dentry, d_alias) { - spin_lock(&d->d_lock); - if (!au_test_anon(d) - && d->d_parent->d_inode->i_ino == dir_ino) { - dentry = dget_dlock(d); - spin_unlock(&d->d_lock); - break; - } - spin_unlock(&d->d_lock); - } - spin_unlock(&inode->i_lock); - } - if (unlikely(dentry && au_digen_test(dentry, sigen))) { - /* need to refresh */ - dput(dentry); - dentry = NULL; - } - -out_iput: - iput(inode); -out: - AuTraceErrPtr(dentry); - return dentry; -} - -/* ---------------------------------------------------------------------- */ - -/* todo: dirty? */ -/* if exportfs_decode_fh() passed vfsmount*, we could be happy */ - -struct au_compare_mnt_args { - /* input */ - struct super_block *sb; - - /* output */ - struct vfsmount *mnt; -}; - -static int au_compare_mnt(struct vfsmount *mnt, void *arg) -{ - struct au_compare_mnt_args *a = arg; - - if (mnt->mnt_sb != a->sb) - return 0; - a->mnt = mntget(mnt); - return 1; -} - -static struct vfsmount *au_mnt_get(struct super_block *sb) -{ - int err; - struct path root; - struct au_compare_mnt_args args = { - .sb = sb - }; - - get_fs_root(current->fs, &root); - br_read_lock(&vfsmount_lock); - err = iterate_mounts(au_compare_mnt, &args, root.mnt); - br_read_unlock(&vfsmount_lock); - path_put(&root); - AuDebugOn(!err); - AuDebugOn(!args.mnt); - return args.mnt; -} - -struct au_nfsd_si_lock { - unsigned int sigen; - aufs_bindex_t bindex, br_id; - unsigned char force_lock; -}; - -static int si_nfsd_read_lock(struct super_block *sb, - struct au_nfsd_si_lock *nsi_lock) -{ - int err; - aufs_bindex_t bindex; - - si_read_lock(sb, AuLock_FLUSH); - - /* branch id may be wrapped around */ - err = 0; - bindex = au_br_index(sb, nsi_lock->br_id); - if (bindex >= 0 && nsi_lock->sigen + AUFS_BRANCH_MAX > au_sigen(sb)) - goto out; /* success */ - - err = -ESTALE; - bindex = -1; - if (!nsi_lock->force_lock) - si_read_unlock(sb); - -out: - nsi_lock->bindex = bindex; - return err; -} - -struct find_name_by_ino { - int called, found; - ino_t ino; - char *name; - int namelen; -}; - -static int -find_name_by_ino(void *arg, const char *name, int namelen, loff_t offset, - u64 ino, unsigned int d_type) -{ - struct find_name_by_ino *a = arg; - - a->called++; - if (a->ino != ino) - return 0; - - memcpy(a->name, name, namelen); - a->namelen = namelen; - a->found = 1; - return 1; -} - -static struct dentry *au_lkup_by_ino(struct path *path, ino_t ino, - struct au_nfsd_si_lock *nsi_lock) -{ - struct dentry *dentry, *parent; - struct file *file; - struct inode *dir; - struct find_name_by_ino arg; - int err; - - parent = path->dentry; - if (nsi_lock) - si_read_unlock(parent->d_sb); - file = vfsub_dentry_open(path, au_dir_roflags); - dentry = (void *)file; - if (IS_ERR(file)) - goto out; - - dentry = ERR_PTR(-ENOMEM); - arg.name = (void *)__get_free_page(GFP_NOFS); - if (unlikely(!arg.name)) - goto out_file; - arg.ino = ino; - arg.found = 0; - do { - arg.called = 0; - /* smp_mb(); */ - err = vfsub_readdir(file, find_name_by_ino, &arg); - } while (!err && !arg.found && arg.called); - dentry = ERR_PTR(err); - if (unlikely(err)) - goto out_name; - /* instead of ENOENT */ - dentry = ERR_PTR(-ESTALE); - if (!arg.found) - goto out_name; - - /* do not call vfsub_lkup_one() */ - dir = parent->d_inode; - mutex_lock(&dir->i_mutex); - dentry = vfsub_lookup_one_len(arg.name, parent, arg.namelen); - mutex_unlock(&dir->i_mutex); - AuTraceErrPtr(dentry); - if (IS_ERR(dentry)) - goto out_name; - AuDebugOn(au_test_anon(dentry)); - if (unlikely(!dentry->d_inode)) { - dput(dentry); - dentry = ERR_PTR(-ENOENT); - } - -out_name: - free_page((unsigned long)arg.name); -out_file: - fput(file); -out: - if (unlikely(nsi_lock - && si_nfsd_read_lock(parent->d_sb, nsi_lock) < 0)) - if (!IS_ERR(dentry)) { - dput(dentry); - dentry = ERR_PTR(-ESTALE); - } - AuTraceErrPtr(dentry); - return dentry; -} - -static struct dentry *decode_by_dir_ino(struct super_block *sb, ino_t ino, - ino_t dir_ino, - struct au_nfsd_si_lock *nsi_lock) -{ - struct dentry *dentry; - struct path path; - - if (dir_ino != AUFS_ROOT_INO) { - path.dentry = decode_by_ino(sb, dir_ino, 0); - dentry = path.dentry; - if (!path.dentry || IS_ERR(path.dentry)) - goto out; - AuDebugOn(au_test_anon(path.dentry)); - } else - path.dentry = dget(sb->s_root); - - path.mnt = au_mnt_get(sb); - dentry = au_lkup_by_ino(&path, ino, nsi_lock); - path_put(&path); - -out: - AuTraceErrPtr(dentry); - return dentry; -} - -/* ---------------------------------------------------------------------- */ - -static int h_acceptable(void *expv, struct dentry *dentry) -{ - return 1; -} - -static char *au_build_path(struct dentry *h_parent, struct path *h_rootpath, - char *buf, int len, struct super_block *sb) -{ - char *p; - int n; - struct path path; - - p = d_path(h_rootpath, buf, len); - if (IS_ERR(p)) - goto out; - n = strlen(p); - - path.mnt = h_rootpath->mnt; - path.dentry = h_parent; - p = d_path(&path, buf, len); - if (IS_ERR(p)) - goto out; - if (n != 1) - p += n; - - path.mnt = au_mnt_get(sb); - path.dentry = sb->s_root; - p = d_path(&path, buf, len - strlen(p)); - mntput(path.mnt); - if (IS_ERR(p)) - goto out; - if (n != 1) - p[strlen(p)] = '/'; - -out: - AuTraceErrPtr(p); - return p; -} - -static -struct dentry *decode_by_path(struct super_block *sb, ino_t ino, __u32 *fh, - int fh_len, struct au_nfsd_si_lock *nsi_lock) -{ - struct dentry *dentry, *h_parent, *root; - struct super_block *h_sb; - char *pathname, *p; - struct vfsmount *h_mnt; - struct au_branch *br; - int err; - struct path path; - - br = au_sbr(sb, nsi_lock->bindex); - h_mnt = au_br_mnt(br); - h_sb = h_mnt->mnt_sb; - /* todo: call lower fh_to_dentry()? fh_to_parent()? */ - h_parent = exportfs_decode_fh(h_mnt, (void *)(fh + Fh_tail), - fh_len - Fh_tail, fh[Fh_h_type], - h_acceptable, /*context*/NULL); - dentry = h_parent; - if (unlikely(!h_parent || IS_ERR(h_parent))) { - AuWarn1("%s decode_fh failed, %ld\n", - au_sbtype(h_sb), PTR_ERR(h_parent)); - goto out; - } - dentry = NULL; - if (unlikely(au_test_anon(h_parent))) { - AuWarn1("%s decode_fh returned a disconnected dentry\n", - au_sbtype(h_sb)); - goto out_h_parent; - } - - dentry = ERR_PTR(-ENOMEM); - pathname = (void *)__get_free_page(GFP_NOFS); - if (unlikely(!pathname)) - goto out_h_parent; - - root = sb->s_root; - path.mnt = h_mnt; - di_read_lock_parent(root, !AuLock_IR); - path.dentry = au_h_dptr(root, nsi_lock->bindex); - di_read_unlock(root, !AuLock_IR); - p = au_build_path(h_parent, &path, pathname, PAGE_SIZE, sb); - dentry = (void *)p; - if (IS_ERR(p)) - goto out_pathname; - - si_read_unlock(sb); - err = vfsub_kern_path(p, LOOKUP_FOLLOW | LOOKUP_DIRECTORY, &path); - dentry = ERR_PTR(err); - if (unlikely(err)) - goto out_relock; - - dentry = ERR_PTR(-ENOENT); - AuDebugOn(au_test_anon(path.dentry)); - if (unlikely(!path.dentry->d_inode)) - goto out_path; - - if (ino != path.dentry->d_inode->i_ino) - dentry = au_lkup_by_ino(&path, ino, /*nsi_lock*/NULL); - else - dentry = dget(path.dentry); - -out_path: - path_put(&path); -out_relock: - if (unlikely(si_nfsd_read_lock(sb, nsi_lock) < 0)) - if (!IS_ERR(dentry)) { - dput(dentry); - dentry = ERR_PTR(-ESTALE); - } -out_pathname: - free_page((unsigned long)pathname); -out_h_parent: - dput(h_parent); -out: - AuTraceErrPtr(dentry); - return dentry; -} - -/* ---------------------------------------------------------------------- */ - -static struct dentry * -aufs_fh_to_dentry(struct super_block *sb, struct fid *fid, int fh_len, - int fh_type) -{ - struct dentry *dentry; - __u32 *fh = fid->raw; - struct au_branch *br; - ino_t ino, dir_ino; - struct au_nfsd_si_lock nsi_lock = { - .force_lock = 0 - }; - - dentry = ERR_PTR(-ESTALE); - /* it should never happen, but the file handle is unreliable */ - if (unlikely(fh_len < Fh_tail)) - goto out; - nsi_lock.sigen = fh[Fh_sigen]; - nsi_lock.br_id = fh[Fh_br_id]; - - /* branch id may be wrapped around */ - br = NULL; - if (unlikely(si_nfsd_read_lock(sb, &nsi_lock))) - goto out; - nsi_lock.force_lock = 1; - - /* is this inode still cached? */ - ino = decode_ino(fh + Fh_ino); - /* it should never happen */ - if (unlikely(ino == AUFS_ROOT_INO)) - goto out; - - dir_ino = decode_ino(fh + Fh_dir_ino); - dentry = decode_by_ino(sb, ino, dir_ino); - if (IS_ERR(dentry)) - goto out_unlock; - if (dentry) - goto accept; - - /* is the parent dir cached? */ - br = au_sbr(sb, nsi_lock.bindex); - atomic_inc(&br->br_count); - dentry = decode_by_dir_ino(sb, ino, dir_ino, &nsi_lock); - if (IS_ERR(dentry)) - goto out_unlock; - if (dentry) - goto accept; - - /* lookup path */ - dentry = decode_by_path(sb, ino, fh, fh_len, &nsi_lock); - if (IS_ERR(dentry)) - goto out_unlock; - if (unlikely(!dentry)) - /* todo?: make it ESTALE */ - goto out_unlock; - -accept: - if (!au_digen_test(dentry, au_sigen(sb)) - && dentry->d_inode->i_generation == fh[Fh_igen]) - goto out_unlock; /* success */ - - dput(dentry); - dentry = ERR_PTR(-ESTALE); -out_unlock: - if (br) - atomic_dec(&br->br_count); - si_read_unlock(sb); -out: - AuTraceErrPtr(dentry); - return dentry; -} - -#if 0 /* reserved for future use */ -/* support subtreecheck option */ -static struct dentry *aufs_fh_to_parent(struct super_block *sb, struct fid *fid, - int fh_len, int fh_type) -{ - struct dentry *parent; - __u32 *fh = fid->raw; - ino_t dir_ino; - - dir_ino = decode_ino(fh + Fh_dir_ino); - parent = decode_by_ino(sb, dir_ino, 0); - if (IS_ERR(parent)) - goto out; - if (!parent) - parent = decode_by_path(sb, au_br_index(sb, fh[Fh_br_id]), - dir_ino, fh, fh_len); - -out: - AuTraceErrPtr(parent); - return parent; -} -#endif - -/* ---------------------------------------------------------------------- */ - -static int aufs_encode_fh(struct inode *inode, __u32 *fh, int *max_len, - struct inode *dir) -{ - int err; - aufs_bindex_t bindex; - struct super_block *sb, *h_sb; - struct dentry *dentry, *parent, *h_parent; - struct inode *h_dir; - struct au_branch *br; - - err = -ENOSPC; - if (unlikely(*max_len <= Fh_tail)) { - AuWarn1("NFSv2 client (max_len %d)?\n", *max_len); - goto out; - } - - err = FILEID_ROOT; - if (inode->i_ino == AUFS_ROOT_INO) { - AuDebugOn(inode->i_ino != AUFS_ROOT_INO); - goto out; - } - - h_parent = NULL; - sb = inode->i_sb; - err = si_read_lock(sb, AuLock_FLUSH); - if (unlikely(err)) - goto out; - -#ifdef CONFIG_AUFS_DEBUG - if (unlikely(!au_opt_test(au_mntflags(sb), XINO))) - AuWarn1("NFS-exporting requires xino\n"); -#endif - err = -EIO; - parent = NULL; - ii_read_lock_child(inode); - bindex = au_ibstart(inode); - if (!dir) { - dentry = d_find_any_alias(inode); - if (unlikely(!dentry)) - goto out_unlock; - AuDebugOn(au_test_anon(dentry)); - parent = dget_parent(dentry); - dput(dentry); - if (unlikely(!parent)) - goto out_unlock; - dir = parent->d_inode; - } - - ii_read_lock_parent(dir); - h_dir = au_h_iptr(dir, bindex); - ii_read_unlock(dir); - if (unlikely(!h_dir)) - goto out_parent; - h_parent = d_find_any_alias(h_dir); - if (unlikely(!h_parent)) - goto out_hparent; - - err = -EPERM; - br = au_sbr(sb, bindex); - h_sb = au_br_sb(br); - if (unlikely(!h_sb->s_export_op)) { - AuErr1("%s branch is not exportable\n", au_sbtype(h_sb)); - goto out_hparent; - } - - fh[Fh_br_id] = br->br_id; - fh[Fh_sigen] = au_sigen(sb); - encode_ino(fh + Fh_ino, inode->i_ino); - encode_ino(fh + Fh_dir_ino, dir->i_ino); - fh[Fh_igen] = inode->i_generation; - - *max_len -= Fh_tail; - fh[Fh_h_type] = exportfs_encode_fh(h_parent, (void *)(fh + Fh_tail), - max_len, - /*connectable or subtreecheck*/0); - err = fh[Fh_h_type]; - *max_len += Fh_tail; - /* todo: macros? */ - if (err != FILEID_INVALID) - err = 99; - else - AuWarn1("%s encode_fh failed\n", au_sbtype(h_sb)); - -out_hparent: - dput(h_parent); -out_parent: - dput(parent); -out_unlock: - ii_read_unlock(inode); - si_read_unlock(sb); -out: - if (unlikely(err < 0)) - err = FILEID_INVALID; - return err; -} - -/* ---------------------------------------------------------------------- */ - -static int aufs_commit_metadata(struct inode *inode) -{ - int err; - aufs_bindex_t bindex; - struct super_block *sb; - struct inode *h_inode; - int (*f)(struct inode *inode); - - sb = inode->i_sb; - si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW); - ii_write_lock_child(inode); - bindex = au_ibstart(inode); - AuDebugOn(bindex < 0); - h_inode = au_h_iptr(inode, bindex); - - f = h_inode->i_sb->s_export_op->commit_metadata; - if (f) - err = f(h_inode); - else { - struct writeback_control wbc = { - .sync_mode = WB_SYNC_ALL, - .nr_to_write = 0 /* metadata only */ - }; - - err = sync_inode(h_inode, &wbc); - } - - au_cpup_attr_timesizes(inode); - ii_write_unlock(inode); - si_read_unlock(sb); - return err; -} - -/* ---------------------------------------------------------------------- */ - -static struct export_operations aufs_export_op = { - .fh_to_dentry = aufs_fh_to_dentry, - /* .fh_to_parent = aufs_fh_to_parent, */ - .encode_fh = aufs_encode_fh, - .commit_metadata = aufs_commit_metadata -}; - -void au_export_init(struct super_block *sb) -{ - struct au_sbinfo *sbinfo; - __u32 u; - - sb->s_export_op = &aufs_export_op; - sbinfo = au_sbi(sb); - sbinfo->si_xigen = NULL; - get_random_bytes(&u, sizeof(u)); - BUILD_BUG_ON(sizeof(u) != sizeof(int)); - atomic_set(&sbinfo->si_xigen_next, u); -} diff --git a/fs/aufs/f_op.c b/fs/aufs/f_op.c deleted file mode 100644 index 4236287ba9d720..00000000000000 --- a/fs/aufs/f_op.c +++ /dev/null @@ -1,796 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * file and vm operations - */ - -#include -#include -#include -#include -#include "aufs.h" - -int au_do_open_nondir(struct file *file, int flags) -{ - int err; - aufs_bindex_t bindex; - struct file *h_file; - struct dentry *dentry; - struct au_finfo *finfo; - - FiMustWriteLock(file); - - err = 0; - dentry = file->f_dentry; - finfo = au_fi(file); - memset(&finfo->fi_htop, 0, sizeof(finfo->fi_htop)); - atomic_set(&finfo->fi_mmapped, 0); - bindex = au_dbstart(dentry); - h_file = au_h_open(dentry, bindex, flags, file, /*force_wr*/0); - if (IS_ERR(h_file)) - err = PTR_ERR(h_file); - else { - au_set_fbstart(file, bindex); - au_set_h_fptr(file, bindex, h_file); - au_update_figen(file); - /* todo: necessary? */ - /* file->f_ra = h_file->f_ra; */ - } - - return err; -} - -static int aufs_open_nondir(struct inode *inode __maybe_unused, - struct file *file) -{ - int err; - struct super_block *sb; - - AuDbg("%.*s, f_flags 0x%x, f_mode 0x%x\n", - AuDLNPair(file->f_dentry), vfsub_file_flags(file), - file->f_mode); - - sb = file->f_dentry->d_sb; - si_read_lock(sb, AuLock_FLUSH); - err = au_do_open(file, au_do_open_nondir, /*fidir*/NULL); - si_read_unlock(sb); - return err; -} - -int aufs_release_nondir(struct inode *inode __maybe_unused, struct file *file) -{ - struct au_finfo *finfo; - aufs_bindex_t bindex; - - finfo = au_fi(file); - bindex = finfo->fi_btop; - if (bindex >= 0) - au_set_h_fptr(file, bindex, NULL); - - au_finfo_fin(file); - return 0; -} - -/* ---------------------------------------------------------------------- */ - -static int au_do_flush_nondir(struct file *file, fl_owner_t id) -{ - int err; - struct file *h_file; - - err = 0; - h_file = au_hf_top(file); - if (h_file) - err = vfsub_flush(h_file, id); - return err; -} - -static int aufs_flush_nondir(struct file *file, fl_owner_t id) -{ - return au_do_flush(file, id, au_do_flush_nondir); -} - -/* ---------------------------------------------------------------------- */ -/* - * read and write functions acquire [fdi]_rwsem once, but release before - * mmap_sem. This is because to stop a race condition between mmap(2). - * Releasing these aufs-rwsem should be safe, no branch-mamagement (by keeping - * si_rwsem), no harmful copy-up should happen. Actually copy-up may happen in - * read functions after [fdi]_rwsem are released, but it should be harmless. - */ - -static ssize_t aufs_read(struct file *file, char __user *buf, size_t count, - loff_t *ppos) -{ - ssize_t err; - struct dentry *dentry; - struct file *h_file; - struct super_block *sb; - - dentry = file->f_dentry; - sb = dentry->d_sb; - si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW); - err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/0); - if (unlikely(err)) - goto out; - - h_file = au_hf_top(file); - get_file(h_file); - di_read_unlock(dentry, AuLock_IR); - fi_read_unlock(file); - - /* filedata may be obsoleted by concurrent copyup, but no problem */ - err = vfsub_read_u(h_file, buf, count, ppos); - /* todo: necessary? */ - /* file->f_ra = h_file->f_ra; */ - /* update without lock, I don't think it a problem */ - fsstack_copy_attr_atime(dentry->d_inode, file_inode(h_file)); - fput(h_file); - -out: - si_read_unlock(sb); - return err; -} - -/* - * todo: very ugly - * it locks both of i_mutex and si_rwsem for read in safe. - * if the plink maintenance mode continues forever (that is the problem), - * may loop forever. - */ -static void au_mtx_and_read_lock(struct inode *inode) -{ - int err; - struct super_block *sb = inode->i_sb; - - while (1) { - mutex_lock(&inode->i_mutex); - err = si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLM); - if (!err) - break; - mutex_unlock(&inode->i_mutex); - si_read_lock(sb, AuLock_NOPLMW); - si_read_unlock(sb); - } -} - -static ssize_t aufs_write(struct file *file, const char __user *ubuf, - size_t count, loff_t *ppos) -{ - ssize_t err; - blkcnt_t blks; - aufs_bindex_t bstart; - struct au_pin pin; - struct dentry *dentry; - struct inode *inode, *h_inode; - struct super_block *sb; - struct file *h_file; - char __user *buf = (char __user *)ubuf; - - dentry = file->f_dentry; - sb = dentry->d_sb; - inode = dentry->d_inode; - au_mtx_and_read_lock(inode); - - err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1); - if (unlikely(err)) - goto out; - - err = au_ready_to_write(file, -1, &pin); - di_downgrade_lock(dentry, AuLock_IR); - if (unlikely(err)) { - di_read_unlock(dentry, AuLock_IR); - fi_write_unlock(file); - goto out; - } - - bstart = au_fbstart(file); - h_file = au_hf_top(file); - get_file(h_file); - h_inode = h_file->f_dentry->d_inode; - blks = h_inode->i_blocks; - au_unpin(&pin); - di_read_unlock(dentry, AuLock_IR); - fi_write_unlock(file); - - err = vfsub_write_u(h_file, buf, count, ppos); - ii_write_lock_child(inode); - au_cpup_attr_timesizes(inode); - inode->i_mode = file_inode(h_file)->i_mode; - AuDbg("blks %llu, %llu\n", (u64)blks, (u64)h_inode->i_blocks); - if (err > 0) - au_fhsm_wrote(sb, bstart, /*force*/h_inode->i_blocks > blks); - ii_write_unlock(inode); - fput(h_file); - -out: - si_read_unlock(sb); - mutex_unlock(&inode->i_mutex); - return err; -} - -static ssize_t au_do_aio(struct file *h_file, int rw, struct kiocb *kio, - const struct iovec *iov, unsigned long nv, loff_t pos) -{ - ssize_t err; - struct file *file; - ssize_t (*func)(struct kiocb *, const struct iovec *, unsigned long, - loff_t); - - err = security_file_permission(h_file, rw); - if (unlikely(err)) - goto out; - - err = -ENOSYS; - func = NULL; - if (rw == MAY_READ) - func = h_file->f_op->aio_read; - else if (rw == MAY_WRITE) - func = h_file->f_op->aio_write; - if (func) { - file = kio->ki_filp; - kio->ki_filp = h_file; - lockdep_off(); - err = func(kio, iov, nv, pos); - lockdep_on(); - kio->ki_filp = file; - } else - /* currently there is no such fs */ - WARN_ON_ONCE(1); - -out: - return err; -} - -static ssize_t aufs_aio_read(struct kiocb *kio, const struct iovec *iov, - unsigned long nv, loff_t pos) -{ - ssize_t err; - struct file *file, *h_file; - struct dentry *dentry; - struct super_block *sb; - - file = kio->ki_filp; - dentry = file->f_dentry; - sb = dentry->d_sb; - si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW); - err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/0); - if (unlikely(err)) - goto out; - - h_file = au_hf_top(file); - get_file(h_file); - di_read_unlock(dentry, AuLock_IR); - fi_read_unlock(file); - - err = au_do_aio(h_file, MAY_READ, kio, iov, nv, pos); - /* todo: necessary? */ - /* file->f_ra = h_file->f_ra; */ - /* update without lock, I don't think it a problem */ - fsstack_copy_attr_atime(dentry->d_inode, file_inode(h_file)); - fput(h_file); - -out: - si_read_unlock(sb); - return err; -} - -static ssize_t aufs_aio_write(struct kiocb *kio, const struct iovec *iov, - unsigned long nv, loff_t pos) -{ - ssize_t err; - blkcnt_t blks; - aufs_bindex_t bstart; - struct au_pin pin; - struct dentry *dentry; - struct inode *inode, *h_inode; - struct file *file, *h_file; - struct super_block *sb; - - file = kio->ki_filp; - dentry = file->f_dentry; - sb = dentry->d_sb; - inode = dentry->d_inode; - au_mtx_and_read_lock(inode); - - err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1); - if (unlikely(err)) - goto out; - - err = au_ready_to_write(file, -1, &pin); - di_downgrade_lock(dentry, AuLock_IR); - if (unlikely(err)) { - di_read_unlock(dentry, AuLock_IR); - fi_write_unlock(file); - goto out; - } - - bstart = au_fbstart(file); - h_file = au_hf_top(file); - get_file(h_file); - h_inode = h_file->f_dentry->d_inode; - blks = h_inode->i_blocks; - au_unpin(&pin); - di_read_unlock(dentry, AuLock_IR); - fi_write_unlock(file); - - err = au_do_aio(h_file, MAY_WRITE, kio, iov, nv, pos); - ii_write_lock_child(inode); - au_cpup_attr_timesizes(inode); - inode->i_mode = file_inode(h_file)->i_mode; - AuDbg("blks %llu, %llu\n", (u64)blks, (u64)h_inode->i_blocks); - if (err > 0) - au_fhsm_wrote(sb, bstart, /*force*/h_inode->i_blocks > blks); - ii_write_unlock(inode); - fput(h_file); - -out: - si_read_unlock(sb); - mutex_unlock(&inode->i_mutex); - return err; -} - -static ssize_t aufs_splice_read(struct file *file, loff_t *ppos, - struct pipe_inode_info *pipe, size_t len, - unsigned int flags) -{ - ssize_t err; - struct file *h_file; - struct dentry *dentry; - struct super_block *sb; - - dentry = file->f_dentry; - sb = dentry->d_sb; - si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW); - err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/0); - if (unlikely(err)) - goto out; - - err = -EINVAL; - h_file = au_hf_top(file); - get_file(h_file); - if (au_test_loopback_kthread()) { - au_warn_loopback(h_file->f_dentry->d_sb); - if (file->f_mapping != h_file->f_mapping) { - file->f_mapping = h_file->f_mapping; - smp_mb(); /* unnecessary? */ - } - } - di_read_unlock(dentry, AuLock_IR); - fi_read_unlock(file); - - err = vfsub_splice_to(h_file, ppos, pipe, len, flags); - /* todo: necessasry? */ - /* file->f_ra = h_file->f_ra; */ - /* update without lock, I don't think it a problem */ - fsstack_copy_attr_atime(dentry->d_inode, file_inode(h_file)); - fput(h_file); - -out: - si_read_unlock(sb); - return err; -} - -static ssize_t -aufs_splice_write(struct pipe_inode_info *pipe, struct file *file, loff_t *ppos, - size_t len, unsigned int flags) -{ - ssize_t err; - blkcnt_t blks; - aufs_bindex_t bstart; - struct au_pin pin; - struct dentry *dentry; - struct inode *inode, *h_inode; - struct super_block *sb; - struct file *h_file; - - dentry = file->f_dentry; - sb = dentry->d_sb; - inode = dentry->d_inode; - au_mtx_and_read_lock(inode); - - err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1); - if (unlikely(err)) - goto out; - - err = au_ready_to_write(file, -1, &pin); - di_downgrade_lock(dentry, AuLock_IR); - if (unlikely(err)) { - di_read_unlock(dentry, AuLock_IR); - fi_write_unlock(file); - goto out; - } - - bstart = au_fbstart(file); - h_file = au_hf_top(file); - get_file(h_file); - h_inode = h_file->f_dentry->d_inode; - blks = h_inode->i_blocks; - au_unpin(&pin); - di_read_unlock(dentry, AuLock_IR); - fi_write_unlock(file); - - err = vfsub_splice_from(pipe, h_file, ppos, len, flags); - ii_write_lock_child(inode); - au_cpup_attr_timesizes(inode); - inode->i_mode = file_inode(h_file)->i_mode; - AuDbg("blks %llu, %llu\n", (u64)blks, (u64)h_inode->i_blocks); - if (err > 0) - au_fhsm_wrote(sb, bstart, /*force*/h_inode->i_blocks > blks); - ii_write_unlock(inode); - fput(h_file); - -out: - si_read_unlock(sb); - mutex_unlock(&inode->i_mutex); - return err; -} - -static long aufs_fallocate(struct file *file, int mode, loff_t offset, - loff_t len) -{ - long err; - struct au_pin pin; - struct dentry *dentry; - struct super_block *sb; - struct inode *inode; - struct file *h_file; - - dentry = file->f_dentry; - sb = dentry->d_sb; - inode = dentry->d_inode; - au_mtx_and_read_lock(inode); - - err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1); - if (unlikely(err)) - goto out; - - err = au_ready_to_write(file, -1, &pin); - di_downgrade_lock(dentry, AuLock_IR); - if (unlikely(err)) { - di_read_unlock(dentry, AuLock_IR); - fi_write_unlock(file); - goto out; - } - - h_file = au_hf_top(file); - get_file(h_file); - au_unpin(&pin); - di_read_unlock(dentry, AuLock_IR); - fi_write_unlock(file); - - lockdep_off(); - err = do_fallocate(h_file, mode, offset, len); - lockdep_on(); - ii_write_lock_child(inode); - au_cpup_attr_timesizes(inode); - inode->i_mode = file_inode(h_file)->i_mode; - ii_write_unlock(inode); - fput(h_file); - -out: - si_read_unlock(sb); - mutex_unlock(&inode->i_mutex); - return err; -} - -/* ---------------------------------------------------------------------- */ - -/* - * The locking order around current->mmap_sem. - * - in most and regular cases - * file I/O syscall -- aufs_read() or something - * -- si_rwsem for read -- mmap_sem - * (Note that [fdi]i_rwsem are released before mmap_sem). - * - in mmap case - * mmap(2) -- mmap_sem -- aufs_mmap() -- si_rwsem for read -- [fdi]i_rwsem - * This AB-BA order is definitly bad, but is not a problem since "si_rwsem for - * read" allows muliple processes to acquire it and [fdi]i_rwsem are not held in - * file I/O. Aufs needs to stop lockdep in aufs_mmap() though. - * It means that when aufs acquires si_rwsem for write, the process should never - * acquire mmap_sem. - * - * Actually aufs_readdir() holds [fdi]i_rwsem before mmap_sem, but this is not a - * problem either since any directory is not able to be mmap-ed. - * The similar scenario is applied to aufs_readlink() too. - */ - -#if 0 /* stop calling security_file_mmap() */ -/* cf. linux/include/linux/mman.h: calc_vm_prot_bits() */ -#define AuConv_VM_PROT(f, b) _calc_vm_trans(f, VM_##b, PROT_##b) - -static unsigned long au_arch_prot_conv(unsigned long flags) -{ - /* currently ppc64 only */ -#ifdef CONFIG_PPC64 - /* cf. linux/arch/powerpc/include/asm/mman.h */ - AuDebugOn(arch_calc_vm_prot_bits(-1) != VM_SAO); - return AuConv_VM_PROT(flags, SAO); -#else - AuDebugOn(arch_calc_vm_prot_bits(-1)); - return 0; -#endif -} - -static unsigned long au_prot_conv(unsigned long flags) -{ - return AuConv_VM_PROT(flags, READ) - | AuConv_VM_PROT(flags, WRITE) - | AuConv_VM_PROT(flags, EXEC) - | au_arch_prot_conv(flags); -} - -/* cf. linux/include/linux/mman.h: calc_vm_flag_bits() */ -#define AuConv_VM_MAP(f, b) _calc_vm_trans(f, VM_##b, MAP_##b) - -static unsigned long au_flag_conv(unsigned long flags) -{ - return AuConv_VM_MAP(flags, GROWSDOWN) - | AuConv_VM_MAP(flags, DENYWRITE) - | AuConv_VM_MAP(flags, LOCKED); -} -#endif - -static int aufs_mmap(struct file *file, struct vm_area_struct *vma) -{ - int err; - aufs_bindex_t bstart; - const unsigned char wlock - = (file->f_mode & FMODE_WRITE) && (vma->vm_flags & VM_SHARED); - struct dentry *dentry; - struct super_block *sb; - struct file *h_file; - struct au_branch *br; - struct au_pin pin; - - AuDbgVmRegion(file, vma); - - dentry = file->f_dentry; - sb = dentry->d_sb; - lockdep_off(); - si_read_lock(sb, AuLock_NOPLMW); - err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1); - if (unlikely(err)) - goto out; - - if (wlock) { - err = au_ready_to_write(file, -1, &pin); - di_write_unlock(dentry); - if (unlikely(err)) { - fi_write_unlock(file); - goto out; - } - au_unpin(&pin); - } else - di_write_unlock(dentry); - - bstart = au_fbstart(file); - br = au_sbr(sb, bstart); - h_file = au_hf_top(file); - get_file(h_file); - au_set_mmapped(file); - fi_write_unlock(file); - lockdep_on(); - - au_vm_file_reset(vma, h_file); - /* - * we cannot call security_mmap_file() here since it may acquire - * mmap_sem or i_mutex. - * - * err = security_mmap_file(h_file, au_prot_conv(vma->vm_flags), - * au_flag_conv(vma->vm_flags)); - */ - if (!err) - err = h_file->f_op->mmap(h_file, vma); - if (unlikely(err)) - goto out_reset; - - au_vm_prfile_set(vma, file); - /* update without lock, I don't think it a problem */ - fsstack_copy_attr_atime(file_inode(file), file_inode(h_file)); - goto out_fput; /* success */ - -out_reset: - au_unset_mmapped(file); - au_vm_file_reset(vma, file); -out_fput: - fput(h_file); - lockdep_off(); -out: - si_read_unlock(sb); - lockdep_on(); - AuTraceErr(err); - return err; -} - -/* ---------------------------------------------------------------------- */ - -static int aufs_fsync_nondir(struct file *file, loff_t start, loff_t end, - int datasync) -{ - int err; - struct au_pin pin; - struct dentry *dentry; - struct inode *inode; - struct file *h_file; - struct super_block *sb; - - dentry = file->f_dentry; - inode = dentry->d_inode; - sb = dentry->d_sb; - mutex_lock(&inode->i_mutex); - err = si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLM); - if (unlikely(err)) - goto out; - - err = 0; /* -EBADF; */ /* posix? */ - if (unlikely(!(file->f_mode & FMODE_WRITE))) - goto out_si; - err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1); - if (unlikely(err)) - goto out_si; - - err = au_ready_to_write(file, -1, &pin); - di_downgrade_lock(dentry, AuLock_IR); - if (unlikely(err)) - goto out_unlock; - au_unpin(&pin); - - err = -EINVAL; - h_file = au_hf_top(file); - err = vfsub_fsync(h_file, &h_file->f_path, datasync); - au_cpup_attr_timesizes(inode); - -out_unlock: - di_read_unlock(dentry, AuLock_IR); - fi_write_unlock(file); -out_si: - si_read_unlock(sb); -out: - mutex_unlock(&inode->i_mutex); - return err; -} - -/* no one supports this operation, currently */ -#if 0 -static int aufs_aio_fsync_nondir(struct kiocb *kio, int datasync) -{ - int err; - struct au_pin pin; - struct dentry *dentry; - struct inode *inode; - struct file *file, *h_file; - - file = kio->ki_filp; - dentry = file->f_dentry; - inode = dentry->d_inode; - au_mtx_and_read_lock(inode); - - err = 0; /* -EBADF; */ /* posix? */ - if (unlikely(!(file->f_mode & FMODE_WRITE))) - goto out; - err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1); - if (unlikely(err)) - goto out; - - err = au_ready_to_write(file, -1, &pin); - di_downgrade_lock(dentry, AuLock_IR); - if (unlikely(err)) - goto out_unlock; - au_unpin(&pin); - - err = -ENOSYS; - h_file = au_hf_top(file); - if (h_file->f_op && h_file->f_op->aio_fsync) { - struct mutex *h_mtx; - - h_mtx = &file_inode(h_file)->i_mutex; - if (!is_sync_kiocb(kio)) { - get_file(h_file); - fput(file); - } - kio->ki_filp = h_file; - err = h_file->f_op->aio_fsync(kio, datasync); - mutex_lock_nested(h_mtx, AuLsc_I_CHILD); - if (!err) - vfsub_update_h_iattr(&h_file->f_path, /*did*/NULL); - /*ignore*/ - au_cpup_attr_timesizes(inode); - mutex_unlock(h_mtx); - } - -out_unlock: - di_read_unlock(dentry, AuLock_IR); - fi_write_unlock(file); -out: - si_read_unlock(inode->sb); - mutex_unlock(&inode->i_mutex); - return err; -} -#endif - -static int aufs_fasync(int fd, struct file *file, int flag) -{ - int err; - struct file *h_file; - struct dentry *dentry; - struct super_block *sb; - - dentry = file->f_dentry; - sb = dentry->d_sb; - si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW); - err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/0); - if (unlikely(err)) - goto out; - - h_file = au_hf_top(file); - if (h_file->f_op && h_file->f_op->fasync) - err = h_file->f_op->fasync(fd, h_file, flag); - - di_read_unlock(dentry, AuLock_IR); - fi_read_unlock(file); - -out: - si_read_unlock(sb); - return err; -} - -/* ---------------------------------------------------------------------- */ - -/* no one supports this operation, currently */ -#if 0 -static ssize_t aufs_sendpage(struct file *file, struct page *page, int offset, - size_t len, loff_t *pos , int more) -{ -} -#endif - -/* ---------------------------------------------------------------------- */ - -const struct file_operations aufs_file_fop = { - .owner = THIS_MODULE, - - .llseek = default_llseek, - - .read = aufs_read, - .write = aufs_write, - .aio_read = aufs_aio_read, - .aio_write = aufs_aio_write, -#ifdef CONFIG_AUFS_POLL - .poll = aufs_poll, -#endif - .unlocked_ioctl = aufs_ioctl_nondir, -#ifdef CONFIG_COMPAT - .compat_ioctl = aufs_compat_ioctl_nondir, -#endif - .mmap = aufs_mmap, - .open = aufs_open_nondir, - .flush = aufs_flush_nondir, - .release = aufs_release_nondir, - .fsync = aufs_fsync_nondir, - /* .aio_fsync = aufs_aio_fsync_nondir, */ - .fasync = aufs_fasync, - /* .sendpage = aufs_sendpage, */ - .splice_write = aufs_splice_write, - .splice_read = aufs_splice_read, -#if 0 - .aio_splice_write = aufs_aio_splice_write, - .aio_splice_read = aufs_aio_splice_read, -#endif - .fallocate = aufs_fallocate -}; diff --git a/fs/aufs/fhsm.c b/fs/aufs/fhsm.c deleted file mode 100644 index b734599545f28f..00000000000000 --- a/fs/aufs/fhsm.c +++ /dev/null @@ -1,426 +0,0 @@ -/* - * Copyright (C) 2011-2014 Junjiro R. Okajima - * - * This program, aufs 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 - */ - -/* - * File-based Hierarchy Storage Management - */ - -#include -#include -#include -#include -#include "aufs.h" - -static aufs_bindex_t au_fhsm_bottom(struct super_block *sb) -{ - struct au_sbinfo *sbinfo; - struct au_fhsm *fhsm; - - SiMustAnyLock(sb); - - sbinfo = au_sbi(sb); - fhsm = &sbinfo->si_fhsm; - AuDebugOn(!fhsm); - return fhsm->fhsm_bottom; -} - -void au_fhsm_set_bottom(struct super_block *sb, aufs_bindex_t bindex) -{ - struct au_sbinfo *sbinfo; - struct au_fhsm *fhsm; - - SiMustWriteLock(sb); - - sbinfo = au_sbi(sb); - fhsm = &sbinfo->si_fhsm; - AuDebugOn(!fhsm); - fhsm->fhsm_bottom = bindex; -} - -/* ---------------------------------------------------------------------- */ - -static int au_fhsm_test_jiffy(struct au_sbinfo *sbinfo, struct au_branch *br) -{ - struct au_br_fhsm *bf; - - bf = br->br_fhsm; - MtxMustLock(&bf->bf_lock); - - return !bf->bf_readable - || time_after(jiffies, - bf->bf_jiffy + sbinfo->si_fhsm.fhsm_expire); -} - -/* ---------------------------------------------------------------------- */ - -static void au_fhsm_notify(struct super_block *sb, int val) -{ - struct au_sbinfo *sbinfo; - struct au_fhsm *fhsm; - - SiMustAnyLock(sb); - - sbinfo = au_sbi(sb); - fhsm = &sbinfo->si_fhsm; - if (au_fhsm_pid(fhsm) - && atomic_read(&fhsm->fhsm_readable) != -1) { - atomic_set(&fhsm->fhsm_readable, val); - if (val) - wake_up(&fhsm->fhsm_wqh); - } -} - -static int au_fhsm_stfs(struct super_block *sb, aufs_bindex_t bindex, - struct aufs_stfs *rstfs, int do_lock, int do_notify) -{ - int err; - struct au_branch *br; - struct au_br_fhsm *bf; - - br = au_sbr(sb, bindex); - AuDebugOn(au_br_rdonly(br)); - bf = br->br_fhsm; - AuDebugOn(!bf); - - if (do_lock) - mutex_lock(&bf->bf_lock); - else - MtxMustLock(&bf->bf_lock); - - /* sb->s_root for NFS is unreliable */ - err = au_br_stfs(br, &bf->bf_stfs); - if (unlikely(err)) { - AuErr1("FHSM failed (%d), b%d, ignored.\n", bindex, err); - goto out; - } - - bf->bf_jiffy = jiffies; - bf->bf_readable = 1; - if (do_notify) - au_fhsm_notify(sb, /*val*/1); - if (rstfs) - *rstfs = bf->bf_stfs; - -out: - if (do_lock) - mutex_unlock(&bf->bf_lock); - au_fhsm_notify(sb, /*val*/1); - - return err; -} - -void au_fhsm_wrote(struct super_block *sb, aufs_bindex_t bindex, int force) -{ - int err; - struct au_sbinfo *sbinfo; - struct au_fhsm *fhsm; - struct au_branch *br; - struct au_br_fhsm *bf; - - AuDbg("b%d, force %d\n", bindex, force); - SiMustAnyLock(sb); - - sbinfo = au_sbi(sb); - fhsm = &sbinfo->si_fhsm; - if (!au_ftest_si(sbinfo, FHSM) - || fhsm->fhsm_bottom == bindex) - return; - - br = au_sbr(sb, bindex); - bf = br->br_fhsm; - AuDebugOn(!bf); - mutex_lock(&bf->bf_lock); - if (force - || au_fhsm_pid(fhsm) - || au_fhsm_test_jiffy(sbinfo, br)) - err = au_fhsm_stfs(sb, bindex, /*rstfs*/NULL, /*do_lock*/0, - /*do_notify*/1); - mutex_unlock(&bf->bf_lock); -} - -void au_fhsm_wrote_all(struct super_block *sb, int force) -{ - aufs_bindex_t bindex, bend; - struct au_branch *br; - - /* exclude the bottom */ - bend = au_fhsm_bottom(sb); - for (bindex = 0; bindex < bend; bindex++) { - br = au_sbr(sb, bindex); - if (au_br_fhsm(br->br_perm)) - au_fhsm_wrote(sb, bindex, force); - } -} - -/* ---------------------------------------------------------------------- */ - -static unsigned int au_fhsm_poll(struct file *file, - struct poll_table_struct *wait) -{ - unsigned int mask; - struct au_sbinfo *sbinfo; - struct au_fhsm *fhsm; - - mask = 0; - sbinfo = file->private_data; - fhsm = &sbinfo->si_fhsm; - poll_wait(file, &fhsm->fhsm_wqh, wait); - if (atomic_read(&fhsm->fhsm_readable)) - mask = POLLIN /* | POLLRDNORM */; - - AuTraceErr((int)mask); - return mask; -} - -static int au_fhsm_do_read_one(struct aufs_stbr __user *stbr, - struct aufs_stfs *stfs, __s16 brid) -{ - int err; - - err = copy_to_user(&stbr->stfs, stfs, sizeof(*stfs)); - if (!err) - err = __put_user(brid, &stbr->brid); - if (unlikely(err)) - err = -EFAULT; - - return err; -} - -static ssize_t au_fhsm_do_read(struct super_block *sb, - struct aufs_stbr __user *stbr, size_t count) -{ - ssize_t err; - int nstbr; - aufs_bindex_t bindex, bend; - struct au_branch *br; - struct au_br_fhsm *bf; - - /* except the bottom branch */ - err = 0; - nstbr = 0; - bend = au_fhsm_bottom(sb); - for (bindex = 0; !err && bindex < bend; bindex++) { - br = au_sbr(sb, bindex); - if (!au_br_fhsm(br->br_perm)) - continue; - - bf = br->br_fhsm; - mutex_lock(&bf->bf_lock); - if (bf->bf_readable) { - err = -EFAULT; - if (count >= sizeof(*stbr)) - err = au_fhsm_do_read_one(stbr++, &bf->bf_stfs, - br->br_id); - if (!err) { - bf->bf_readable = 0; - count -= sizeof(*stbr); - nstbr++; - } - } - mutex_unlock(&bf->bf_lock); - } - if (!err) - err = sizeof(*stbr) * nstbr; - - return err; -} - -static ssize_t au_fhsm_read(struct file *file, char __user *buf, size_t count, - loff_t *pos) -{ - ssize_t err; - int readable; - aufs_bindex_t nfhsm, bindex, bend; - struct au_sbinfo *sbinfo; - struct au_fhsm *fhsm; - struct au_branch *br; - struct super_block *sb; - - err = 0; - sbinfo = file->private_data; - fhsm = &sbinfo->si_fhsm; -need_data: - spin_lock_irq(&fhsm->fhsm_wqh.lock); - if (!atomic_read(&fhsm->fhsm_readable)) { - if (vfsub_file_flags(file) & O_NONBLOCK) - err = -EAGAIN; - else - err = wait_event_interruptible_locked_irq - (fhsm->fhsm_wqh, - atomic_read(&fhsm->fhsm_readable)); - } - spin_unlock_irq(&fhsm->fhsm_wqh.lock); - if (unlikely(err)) - goto out; - - /* sb may already be dead */ - au_rw_read_lock(&sbinfo->si_rwsem); - readable = atomic_read(&fhsm->fhsm_readable); - if (readable > 0) { - sb = sbinfo->si_sb; - AuDebugOn(!sb); - /* exclude the bottom branch */ - nfhsm = 0; - bend = au_fhsm_bottom(sb); - for (bindex = 0; bindex < bend; bindex++) { - br = au_sbr(sb, bindex); - if (au_br_fhsm(br->br_perm)) - nfhsm++; - } - err = -EMSGSIZE; - if (nfhsm * sizeof(struct aufs_stbr) <= count) { - atomic_set(&fhsm->fhsm_readable, 0); - err = au_fhsm_do_read(sbinfo->si_sb, (void __user *)buf, - count); - } - } - au_rw_read_unlock(&sbinfo->si_rwsem); - if (!readable) - goto need_data; - -out: - return err; -} - -static int au_fhsm_release(struct inode *inode, struct file *file) -{ - struct au_sbinfo *sbinfo; - struct au_fhsm *fhsm; - - /* sb may already be dead */ - sbinfo = file->private_data; - fhsm = &sbinfo->si_fhsm; - spin_lock(&fhsm->fhsm_spin); - fhsm->fhsm_pid = 0; - spin_unlock(&fhsm->fhsm_spin); - kobject_put(&sbinfo->si_kobj); - - return 0; -} - -static const struct file_operations au_fhsm_fops = { - .owner = THIS_MODULE, - .llseek = noop_llseek, - .read = au_fhsm_read, - .poll = au_fhsm_poll, - .release = au_fhsm_release -}; - -int au_fhsm_fd(struct super_block *sb, int oflags) -{ - int err, fd; - struct au_sbinfo *sbinfo; - struct au_fhsm *fhsm; - - err = -EPERM; - if (unlikely(!capable(CAP_SYS_ADMIN))) - goto out; - - err = -EINVAL; - if (unlikely(oflags & ~(O_CLOEXEC | O_NONBLOCK))) - goto out; - - err = 0; - sbinfo = au_sbi(sb); - fhsm = &sbinfo->si_fhsm; - spin_lock(&fhsm->fhsm_spin); - if (!fhsm->fhsm_pid) - fhsm->fhsm_pid = current->pid; - else - err = -EBUSY; - spin_unlock(&fhsm->fhsm_spin); - if (unlikely(err)) - goto out; - - oflags |= O_RDONLY; - /* oflags |= FMODE_NONOTIFY; */ - fd = anon_inode_getfd("[aufs_fhsm]", &au_fhsm_fops, sbinfo, oflags); - err = fd; - if (unlikely(fd < 0)) - goto out_pid; - - /* succeed reglardless 'fhsm' status */ - kobject_get(&sbinfo->si_kobj); - si_noflush_read_lock(sb); - if (au_ftest_si(sbinfo, FHSM)) - au_fhsm_wrote_all(sb, /*force*/0); - si_read_unlock(sb); - goto out; /* success */ - -out_pid: - spin_lock(&fhsm->fhsm_spin); - fhsm->fhsm_pid = 0; - spin_unlock(&fhsm->fhsm_spin); -out: - AuTraceErr(err); - return err; -} - -/* ---------------------------------------------------------------------- */ - -int au_fhsm_br_alloc(struct au_branch *br) -{ - int err; - - err = 0; - br->br_fhsm = kmalloc(sizeof(*br->br_fhsm), GFP_NOFS); - if (br->br_fhsm) - au_br_fhsm_init(br->br_fhsm); - else - err = -ENOMEM; - - return err; -} - -/* ---------------------------------------------------------------------- */ - -void au_fhsm_fin(struct super_block *sb) -{ - au_fhsm_notify(sb, /*val*/-1); -} - -void au_fhsm_init(struct au_sbinfo *sbinfo) -{ - struct au_fhsm *fhsm; - - fhsm = &sbinfo->si_fhsm; - spin_lock_init(&fhsm->fhsm_spin); - init_waitqueue_head(&fhsm->fhsm_wqh); - atomic_set(&fhsm->fhsm_readable, 0); - fhsm->fhsm_expire - = msecs_to_jiffies(AUFS_FHSM_CACHE_DEF_SEC * MSEC_PER_SEC); - fhsm->fhsm_bottom = -1; -} - -void au_fhsm_set(struct au_sbinfo *sbinfo, unsigned int sec) -{ - sbinfo->si_fhsm.fhsm_expire - = msecs_to_jiffies(sec * MSEC_PER_SEC); -} - -void au_fhsm_show(struct seq_file *seq, struct au_sbinfo *sbinfo) -{ - unsigned int u; - - if (!au_ftest_si(sbinfo, FHSM)) - return; - - u = jiffies_to_msecs(sbinfo->si_fhsm.fhsm_expire) / MSEC_PER_SEC; - if (u != AUFS_FHSM_CACHE_DEF_SEC) - seq_printf(seq, ",fhsm_sec=%u", u); -} diff --git a/fs/aufs/file.c b/fs/aufs/file.c deleted file mode 100644 index 731fe2116eab7c..00000000000000 --- a/fs/aufs/file.c +++ /dev/null @@ -1,815 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * handling file/dir, and address_space operation - */ - -#ifdef CONFIG_AUFS_DEBUG -#include -#endif -#include -#include "aufs.h" - -/* drop flags for writing */ -unsigned int au_file_roflags(unsigned int flags) -{ - flags &= ~(O_WRONLY | O_RDWR | O_APPEND | O_CREAT | O_TRUNC); - flags |= O_RDONLY | O_NOATIME; - return flags; -} - -/* common functions to regular file and dir */ -struct file *au_h_open(struct dentry *dentry, aufs_bindex_t bindex, int flags, - struct file *file, int force_wr) -{ - struct file *h_file; - struct dentry *h_dentry; - struct inode *h_inode; - struct super_block *sb; - struct au_branch *br; - struct path h_path; - int err, exec_flag; - - /* a race condition can happen between open and unlink/rmdir */ - h_file = ERR_PTR(-ENOENT); - h_dentry = au_h_dptr(dentry, bindex); - if (au_test_nfsd() && !h_dentry) - goto out; - h_inode = h_dentry->d_inode; - if (au_test_nfsd() && !h_inode) - goto out; - spin_lock(&h_dentry->d_lock); - err = (!d_unhashed(dentry) && d_unlinked(h_dentry)) - || !h_inode - /* || !dentry->d_inode->i_nlink */ - ; - spin_unlock(&h_dentry->d_lock); - if (unlikely(err)) - goto out; - - sb = dentry->d_sb; - br = au_sbr(sb, bindex); - h_file = ERR_PTR(-EACCES); - exec_flag = flags & __FMODE_EXEC; - if (exec_flag && (au_br_mnt(br)->mnt_flags & MNT_NOEXEC)) - goto out; - - /* drop flags for writing */ - if (au_test_ro(sb, bindex, dentry->d_inode)) { - if (force_wr && !(flags & O_WRONLY)) - force_wr = 0; - flags = au_file_roflags(flags); - if (force_wr) { - h_file = ERR_PTR(-EROFS); - flags = au_file_roflags(flags); - if (unlikely(vfsub_native_ro(h_inode) - || IS_APPEND(h_inode))) - goto out; - flags &= ~O_ACCMODE; - flags |= O_WRONLY; - } - } - flags &= ~O_CREAT; - atomic_inc(&br->br_count); - h_path.dentry = h_dentry; - h_path.mnt = au_br_mnt(br); - h_file = vfsub_dentry_open(&h_path, flags); - if (IS_ERR(h_file)) - goto out_br; - - if (exec_flag) { - err = deny_write_access(h_file); - if (unlikely(err)) { - fput(h_file); - h_file = ERR_PTR(err); - goto out_br; - } - } - fsnotify_open(h_file); - goto out; /* success */ - -out_br: - atomic_dec(&br->br_count); -out: - return h_file; -} - -static int au_cmoo(struct dentry *dentry) -{ - int err, cmoo; - unsigned int udba; - struct path h_path; - struct au_pin pin; - struct au_cp_generic cpg = { - .dentry = dentry, - .bdst = -1, - .bsrc = -1, - .len = -1, - .pin = &pin, - .flags = AuCpup_DTIME | AuCpup_HOPEN - }; - struct inode *inode; - struct super_block *sb; - struct au_sbinfo *sbinfo; - struct au_fhsm *fhsm; - pid_t pid; - struct au_branch *br; - struct dentry *parent; - struct au_hinode *hdir; - - DiMustWriteLock(dentry); - inode = dentry->d_inode; - IiMustWriteLock(inode); - - err = 0; - if (IS_ROOT(dentry)) - goto out; - cpg.bsrc = au_dbstart(dentry); - if (!cpg.bsrc) - goto out; - - sb = dentry->d_sb; - sbinfo = au_sbi(sb); - fhsm = &sbinfo->si_fhsm; - pid = au_fhsm_pid(fhsm); - if (pid - && (current->pid == pid - || current->real_parent->pid == pid)) - goto out; - - br = au_sbr(sb, cpg.bsrc); - cmoo = au_br_cmoo(br->br_perm); - if (!cmoo) - goto out; - if (!S_ISREG(inode->i_mode)) - cmoo &= AuBrAttr_COO_ALL; - if (!cmoo) - goto out; - - parent = dget_parent(dentry); - di_write_lock_parent(parent); - err = au_wbr_do_copyup_bu(dentry, cpg.bsrc - 1); - cpg.bdst = err; - if (unlikely(err < 0)) { - err = 0; /* there is no upper writable branch */ - goto out_dgrade; - } - AuDbg("bsrc %d, bdst %d\n", cpg.bsrc, cpg.bdst); - - /* do not respect the coo attrib for the target branch */ - err = au_cpup_dirs(dentry, cpg.bdst); - if (unlikely(err)) - goto out_dgrade; - - di_downgrade_lock(parent, AuLock_IR); - udba = au_opt_udba(sb); - err = au_pin(&pin, dentry, cpg.bdst, udba, - AuPin_DI_LOCKED | AuPin_MNT_WRITE); - if (unlikely(err)) - goto out_parent; - - err = au_sio_cpup_simple(&cpg); - au_unpin(&pin); - if (unlikely(err)) - goto out_parent; - if (!(cmoo & AuBrWAttr_MOO)) - goto out_parent; /* success */ - - err = au_pin(&pin, dentry, cpg.bsrc, udba, - AuPin_DI_LOCKED | AuPin_MNT_WRITE); - if (unlikely(err)) - goto out_parent; - - h_path.mnt = au_br_mnt(br); - h_path.dentry = au_h_dptr(dentry, cpg.bsrc); - hdir = au_hi(parent->d_inode, cpg.bsrc); - err = vfsub_unlink(hdir->hi_inode, &h_path, /*force*/1); - au_unpin(&pin); - /* todo: keep h_dentry or not? */ - if (unlikely(err)) { - pr_err("unlink %.*s after coo failed (%d), ignored\n", - AuDLNPair(dentry), err); - err = 0; - } - goto out_parent; /* success */ - -out_dgrade: - di_downgrade_lock(parent, AuLock_IR); -out_parent: - di_read_unlock(parent, AuLock_IR); - dput(parent); -out: - AuTraceErr(err); - return err; -} - -int au_do_open(struct file *file, int (*open)(struct file *file, int flags), - struct au_fidir *fidir) -{ - int err; - struct dentry *dentry; - - err = au_finfo_init(file, fidir); - if (unlikely(err)) - goto out; - - dentry = file->f_dentry; - di_write_lock_child(dentry); - err = au_cmoo(dentry); - di_downgrade_lock(dentry, AuLock_IR); - if (!err) - err = open(file, vfsub_file_flags(file)); - di_read_unlock(dentry, AuLock_IR); - - fi_write_unlock(file); - if (unlikely(err)) { - au_fi(file)->fi_hdir = NULL; - au_finfo_fin(file); - } - -out: - return err; -} - -int au_reopen_nondir(struct file *file) -{ - int err; - aufs_bindex_t bstart; - struct dentry *dentry; - struct file *h_file, *h_file_tmp; - - dentry = file->f_dentry; - bstart = au_dbstart(dentry); - h_file_tmp = NULL; - if (au_fbstart(file) == bstart) { - h_file = au_hf_top(file); - if (file->f_mode == h_file->f_mode) - return 0; /* success */ - h_file_tmp = h_file; - get_file(h_file_tmp); - au_set_h_fptr(file, bstart, NULL); - } - AuDebugOn(au_fi(file)->fi_hdir); - /* - * it can happen - * file exists on both of rw and ro - * open --> dbstart and fbstart are both 0 - * prepend a branch as rw, "rw" become ro - * remove rw/file - * delete the top branch, "rw" becomes rw again - * --> dbstart is 1, fbstart is still 0 - * write --> fbstart is 0 but dbstart is 1 - */ - /* AuDebugOn(au_fbstart(file) < bstart); */ - - h_file = au_h_open(dentry, bstart, vfsub_file_flags(file) & ~O_TRUNC, - file, /*force_wr*/0); - err = PTR_ERR(h_file); - if (IS_ERR(h_file)) { - if (h_file_tmp) { - atomic_inc(&au_sbr(dentry->d_sb, bstart)->br_count); - au_set_h_fptr(file, bstart, h_file_tmp); - h_file_tmp = NULL; - } - goto out; /* todo: close all? */ - } - - err = 0; - au_set_fbstart(file, bstart); - au_set_h_fptr(file, bstart, h_file); - au_update_figen(file); - /* todo: necessary? */ - /* file->f_ra = h_file->f_ra; */ - -out: - if (h_file_tmp) - fput(h_file_tmp); - return err; -} - -/* ---------------------------------------------------------------------- */ - -static int au_reopen_wh(struct file *file, aufs_bindex_t btgt, - struct dentry *hi_wh) -{ - int err; - aufs_bindex_t bstart; - struct au_dinfo *dinfo; - struct dentry *h_dentry; - struct au_hdentry *hdp; - - dinfo = au_di(file->f_dentry); - AuRwMustWriteLock(&dinfo->di_rwsem); - - bstart = dinfo->di_bstart; - dinfo->di_bstart = btgt; - hdp = dinfo->di_hdentry; - h_dentry = hdp[0 + btgt].hd_dentry; - hdp[0 + btgt].hd_dentry = hi_wh; - err = au_reopen_nondir(file); - hdp[0 + btgt].hd_dentry = h_dentry; - dinfo->di_bstart = bstart; - - return err; -} - -static int au_ready_to_write_wh(struct file *file, loff_t len, - aufs_bindex_t bcpup, struct au_pin *pin) -{ - int err; - struct inode *inode, *h_inode; - struct dentry *h_dentry, *hi_wh; - struct au_cp_generic cpg = { - .dentry = file->f_dentry, - .bdst = bcpup, - .bsrc = -1, - .len = len, - .pin = pin - }; - - au_update_dbstart(cpg.dentry); - inode = cpg.dentry->d_inode; - h_inode = NULL; - if (au_dbstart(cpg.dentry) <= bcpup - && au_dbend(cpg.dentry) >= bcpup) { - h_dentry = au_h_dptr(cpg.dentry, bcpup); - if (h_dentry) - h_inode = h_dentry->d_inode; - } - hi_wh = au_hi_wh(inode, bcpup); - if (!hi_wh && !h_inode) - err = au_sio_cpup_wh(&cpg, file); - else - /* already copied-up after unlink */ - err = au_reopen_wh(file, bcpup, hi_wh); - - if (!err - && inode->i_nlink > 1 - && au_opt_test(au_mntflags(cpg.dentry->d_sb), PLINK)) - au_plink_append(inode, bcpup, au_h_dptr(cpg.dentry, bcpup)); - - return err; -} - -/* - * prepare the @file for writing. - */ -int au_ready_to_write(struct file *file, loff_t len, struct au_pin *pin) -{ - int err; - aufs_bindex_t dbstart; - struct dentry *parent, *h_dentry; - struct inode *inode; - struct super_block *sb; - struct file *h_file; - struct au_cp_generic cpg = { - .dentry = file->f_dentry, - .bdst = -1, - .bsrc = -1, - .len = len, - .pin = pin, - .flags = AuCpup_DTIME - }; - - sb = cpg.dentry->d_sb; - inode = cpg.dentry->d_inode; - cpg.bsrc = au_fbstart(file); - err = au_test_ro(sb, cpg.bsrc, inode); - if (!err && (au_hf_top(file)->f_mode & FMODE_WRITE)) { - err = au_pin(pin, cpg.dentry, cpg.bsrc, AuOpt_UDBA_NONE, - /*flags*/0); - goto out; - } - - /* need to cpup or reopen */ - parent = dget_parent(cpg.dentry); - di_write_lock_parent(parent); - err = AuWbrCopyup(au_sbi(sb), cpg.dentry); - cpg.bdst = err; - if (unlikely(err < 0)) - goto out_dgrade; - err = 0; - - if (!d_unhashed(cpg.dentry) && !au_h_dptr(parent, cpg.bdst)) { - err = au_cpup_dirs(cpg.dentry, cpg.bdst); - if (unlikely(err)) - goto out_dgrade; - } - - err = au_pin(pin, cpg.dentry, cpg.bdst, AuOpt_UDBA_NONE, - AuPin_DI_LOCKED | AuPin_MNT_WRITE); - if (unlikely(err)) - goto out_dgrade; - - h_dentry = au_hf_top(file)->f_dentry; - dbstart = au_dbstart(cpg.dentry); - if (dbstart <= cpg.bdst) { - h_dentry = au_h_dptr(cpg.dentry, cpg.bdst); - AuDebugOn(!h_dentry); - cpg.bsrc = cpg.bdst; - } - - if (dbstart <= cpg.bdst /* just reopen */ - || !d_unhashed(cpg.dentry) /* copyup and reopen */ - ) { - h_file = au_h_open_pre(cpg.dentry, cpg.bsrc, /*force_wr*/0); - if (IS_ERR(h_file)) - err = PTR_ERR(h_file); - else { - di_downgrade_lock(parent, AuLock_IR); - if (dbstart > cpg.bdst) - err = au_sio_cpup_simple(&cpg); - if (!err) - err = au_reopen_nondir(file); - au_h_open_post(cpg.dentry, cpg.bsrc, h_file); - } - } else { /* copyup as wh and reopen */ - /* - * since writable hfsplus branch is not supported, - * h_open_pre/post() are unnecessary. - */ - err = au_ready_to_write_wh(file, len, cpg.bdst, pin); - di_downgrade_lock(parent, AuLock_IR); - } - - if (!err) { - au_pin_set_parent_lflag(pin, /*lflag*/0); - goto out_dput; /* success */ - } - au_unpin(pin); - goto out_unlock; - -out_dgrade: - di_downgrade_lock(parent, AuLock_IR); -out_unlock: - di_read_unlock(parent, AuLock_IR); -out_dput: - dput(parent); -out: - return err; -} - -/* ---------------------------------------------------------------------- */ - -int au_do_flush(struct file *file, fl_owner_t id, - int (*flush)(struct file *file, fl_owner_t id)) -{ - int err; - struct super_block *sb; - struct inode *inode; - - inode = file_inode(file); - sb = inode->i_sb; - si_noflush_read_lock(sb); - fi_read_lock(file); - ii_read_lock_child(inode); - - err = flush(file, id); - au_cpup_attr_timesizes(inode); - - ii_read_unlock(inode); - fi_read_unlock(file); - si_read_unlock(sb); - return err; -} - -/* ---------------------------------------------------------------------- */ - -static int au_file_refresh_by_inode(struct file *file, int *need_reopen) -{ - int err; - struct au_pin pin; - struct au_finfo *finfo; - struct dentry *parent, *hi_wh; - struct inode *inode; - struct super_block *sb; - struct au_cp_generic cpg = { - .dentry = file->f_dentry, - .bdst = -1, - .bsrc = -1, - .len = -1, - .pin = &pin, - .flags = AuCpup_DTIME - }; - - FiMustWriteLock(file); - - err = 0; - finfo = au_fi(file); - sb = cpg.dentry->d_sb; - inode = cpg.dentry->d_inode; - cpg.bdst = au_ibstart(inode); - if (cpg.bdst == finfo->fi_btop || IS_ROOT(cpg.dentry)) - goto out; - - parent = dget_parent(cpg.dentry); - if (au_test_ro(sb, cpg.bdst, inode)) { - di_read_lock_parent(parent, !AuLock_IR); - err = AuWbrCopyup(au_sbi(sb), cpg.dentry); - cpg.bdst = err; - di_read_unlock(parent, !AuLock_IR); - if (unlikely(err < 0)) - goto out_parent; - err = 0; - } - - di_read_lock_parent(parent, AuLock_IR); - hi_wh = au_hi_wh(inode, cpg.bdst); - if (!S_ISDIR(inode->i_mode) - && au_opt_test(au_mntflags(sb), PLINK) - && au_plink_test(inode) - && !d_unhashed(cpg.dentry) - && cpg.bdst < au_dbstart(cpg.dentry)) { - err = au_test_and_cpup_dirs(cpg.dentry, cpg.bdst); - if (unlikely(err)) - goto out_unlock; - - /* always superio. */ - err = au_pin(&pin, cpg.dentry, cpg.bdst, AuOpt_UDBA_NONE, - AuPin_DI_LOCKED | AuPin_MNT_WRITE); - if (!err) { - err = au_sio_cpup_simple(&cpg); - au_unpin(&pin); - } - } else if (hi_wh) { - /* already copied-up after unlink */ - err = au_reopen_wh(file, cpg.bdst, hi_wh); - *need_reopen = 0; - } - -out_unlock: - di_read_unlock(parent, AuLock_IR); -out_parent: - dput(parent); -out: - return err; -} - -static void au_do_refresh_dir(struct file *file) -{ - aufs_bindex_t bindex, bend, new_bindex, brid; - struct au_hfile *p, tmp, *q; - struct au_finfo *finfo; - struct super_block *sb; - struct au_fidir *fidir; - - FiMustWriteLock(file); - - sb = file->f_dentry->d_sb; - finfo = au_fi(file); - fidir = finfo->fi_hdir; - AuDebugOn(!fidir); - p = fidir->fd_hfile + finfo->fi_btop; - brid = p->hf_br->br_id; - bend = fidir->fd_bbot; - for (bindex = finfo->fi_btop; bindex <= bend; bindex++, p++) { - if (!p->hf_file) - continue; - - new_bindex = au_br_index(sb, p->hf_br->br_id); - if (new_bindex == bindex) - continue; - if (new_bindex < 0) { - au_set_h_fptr(file, bindex, NULL); - continue; - } - - /* swap two lower inode, and loop again */ - q = fidir->fd_hfile + new_bindex; - tmp = *q; - *q = *p; - *p = tmp; - if (tmp.hf_file) { - bindex--; - p--; - } - } - - p = fidir->fd_hfile; - if (!au_test_mmapped(file) && !d_unlinked(file->f_dentry)) { - bend = au_sbend(sb); - for (finfo->fi_btop = 0; finfo->fi_btop <= bend; - finfo->fi_btop++, p++) - if (p->hf_file) { - if (file_inode(p->hf_file)) - break; - au_hfput(p, file); - } - } else { - bend = au_br_index(sb, brid); - for (finfo->fi_btop = 0; finfo->fi_btop < bend; - finfo->fi_btop++, p++) - if (p->hf_file) - au_hfput(p, file); - bend = au_sbend(sb); - } - - p = fidir->fd_hfile + bend; - for (fidir->fd_bbot = bend; fidir->fd_bbot >= finfo->fi_btop; - fidir->fd_bbot--, p--) - if (p->hf_file) { - if (file_inode(p->hf_file)) - break; - au_hfput(p, file); - } - AuDebugOn(fidir->fd_bbot < finfo->fi_btop); -} - -/* - * after branch manipulating, refresh the file. - */ -static int refresh_file(struct file *file, int (*reopen)(struct file *file)) -{ - int err, need_reopen; - aufs_bindex_t bend, bindex; - struct dentry *dentry; - struct au_finfo *finfo; - struct au_hfile *hfile; - - dentry = file->f_dentry; - finfo = au_fi(file); - if (!finfo->fi_hdir) { - hfile = &finfo->fi_htop; - AuDebugOn(!hfile->hf_file); - bindex = au_br_index(dentry->d_sb, hfile->hf_br->br_id); - AuDebugOn(bindex < 0); - if (bindex != finfo->fi_btop) - au_set_fbstart(file, bindex); - } else { - err = au_fidir_realloc(finfo, au_sbend(dentry->d_sb) + 1); - if (unlikely(err)) - goto out; - au_do_refresh_dir(file); - } - - err = 0; - need_reopen = 1; - if (!au_test_mmapped(file)) - err = au_file_refresh_by_inode(file, &need_reopen); - if (!err && need_reopen && !d_unlinked(dentry)) - err = reopen(file); - if (!err) { - au_update_figen(file); - goto out; /* success */ - } - - /* error, close all lower files */ - if (finfo->fi_hdir) { - bend = au_fbend_dir(file); - for (bindex = au_fbstart(file); bindex <= bend; bindex++) - au_set_h_fptr(file, bindex, NULL); - } - -out: - return err; -} - -/* common function to regular file and dir */ -int au_reval_and_lock_fdi(struct file *file, int (*reopen)(struct file *file), - int wlock) -{ - int err; - unsigned int sigen, figen; - aufs_bindex_t bstart; - unsigned char pseudo_link; - struct dentry *dentry; - struct inode *inode; - - err = 0; - dentry = file->f_dentry; - inode = dentry->d_inode; - sigen = au_sigen(dentry->d_sb); - fi_write_lock(file); - figen = au_figen(file); - di_write_lock_child(dentry); - bstart = au_dbstart(dentry); - pseudo_link = (bstart != au_ibstart(inode)); - if (sigen == figen && !pseudo_link && au_fbstart(file) == bstart) { - if (!wlock) { - di_downgrade_lock(dentry, AuLock_IR); - fi_downgrade_lock(file); - } - goto out; /* success */ - } - - AuDbg("sigen %d, figen %d\n", sigen, figen); - if (au_digen_test(dentry, sigen)) { - err = au_reval_dpath(dentry, sigen); - AuDebugOn(!err && au_digen_test(dentry, sigen)); - } - - if (!err) - err = refresh_file(file, reopen); - if (!err) { - if (!wlock) { - di_downgrade_lock(dentry, AuLock_IR); - fi_downgrade_lock(file); - } - } else { - di_write_unlock(dentry); - fi_write_unlock(file); - } - -out: - return err; -} - -/* ---------------------------------------------------------------------- */ - -/* cf. aufs_nopage() */ -/* for madvise(2) */ -static int aufs_readpage(struct file *file __maybe_unused, struct page *page) -{ - unlock_page(page); - return 0; -} - -/* it will never be called, but necessary to support O_DIRECT */ -static ssize_t aufs_direct_IO(int rw, struct kiocb *iocb, - const struct iovec *iov, loff_t offset, - unsigned long nr_segs) -{ BUG(); return 0; } - -/* - * it will never be called, but madvise and fadvise behaves differently - * when get_xip_mem is defined - */ -static int aufs_get_xip_mem(struct address_space *mapping, pgoff_t pgoff, - int create, void **kmem, unsigned long *pfn) -{ BUG(); return 0; } - -/* they will never be called. */ -#ifdef CONFIG_AUFS_DEBUG -static int aufs_write_begin(struct file *file, struct address_space *mapping, - loff_t pos, unsigned len, unsigned flags, - struct page **pagep, void **fsdata) -{ AuUnsupport(); return 0; } -static int aufs_write_end(struct file *file, struct address_space *mapping, - loff_t pos, unsigned len, unsigned copied, - struct page *page, void *fsdata) -{ AuUnsupport(); return 0; } -static int aufs_writepage(struct page *page, struct writeback_control *wbc) -{ AuUnsupport(); return 0; } - -static int aufs_set_page_dirty(struct page *page) -{ AuUnsupport(); return 0; } -static void aufs_invalidatepage(struct page *page, unsigned long offset) -{ AuUnsupport(); } -static int aufs_releasepage(struct page *page, gfp_t gfp) -{ AuUnsupport(); return 0; } -static int aufs_migratepage(struct address_space *mapping, struct page *newpage, - struct page *page, enum migrate_mode mode) -{ AuUnsupport(); return 0; } -static int aufs_launder_page(struct page *page) -{ AuUnsupport(); return 0; } -static int aufs_is_partially_uptodate(struct page *page, - read_descriptor_t *desc, - unsigned long from) -{ AuUnsupport(); return 0; } -static int aufs_error_remove_page(struct address_space *mapping, - struct page *page) -{ AuUnsupport(); return 0; } -static int aufs_swap_activate(struct swap_info_struct *sis, struct file *file, - sector_t *span) -{ AuUnsupport(); return 0; } -static void aufs_swap_deactivate(struct file *file) -{ AuUnsupport(); } -#endif /* CONFIG_AUFS_DEBUG */ - -const struct address_space_operations aufs_aop = { - .readpage = aufs_readpage, - .direct_IO = aufs_direct_IO, - .get_xip_mem = aufs_get_xip_mem, -#ifdef CONFIG_AUFS_DEBUG - .writepage = aufs_writepage, - /* no writepages, because of writepage */ - .set_page_dirty = aufs_set_page_dirty, - /* no readpages, because of readpage */ - .write_begin = aufs_write_begin, - .write_end = aufs_write_end, - /* no bmap, no block device */ - .invalidatepage = aufs_invalidatepage, - .releasepage = aufs_releasepage, - .migratepage = aufs_migratepage, - .launder_page = aufs_launder_page, - .is_partially_uptodate = aufs_is_partially_uptodate, - .error_remove_page = aufs_error_remove_page, - .swap_activate = aufs_swap_activate, - .swap_deactivate = aufs_swap_deactivate -#endif /* CONFIG_AUFS_DEBUG */ -}; diff --git a/fs/aufs/file.h b/fs/aufs/file.h deleted file mode 100644 index d3a9e873ef0613..00000000000000 --- a/fs/aufs/file.h +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * file operations - */ - -#ifndef __AUFS_FILE_H__ -#define __AUFS_FILE_H__ - -#ifdef __KERNEL__ - -#include -#include -#include -#include "rwsem.h" - -struct au_branch; -struct au_hfile { - struct file *hf_file; - struct au_branch *hf_br; -}; - -struct au_vdir; -struct au_fidir { - aufs_bindex_t fd_bbot; - aufs_bindex_t fd_nent; - struct au_vdir *fd_vdir_cache; - struct au_hfile fd_hfile[]; -}; - -static inline int au_fidir_sz(int nent) -{ - AuDebugOn(nent < 0); - return sizeof(struct au_fidir) + sizeof(struct au_hfile) * nent; -} - -struct au_finfo { - atomic_t fi_generation; - - struct au_rwsem fi_rwsem; - aufs_bindex_t fi_btop; - - /* do not union them */ - struct { /* for non-dir */ - struct au_hfile fi_htop; - atomic_t fi_mmapped; - }; - struct au_fidir *fi_hdir; /* for dir only */ -} ____cacheline_aligned_in_smp; - -/* ---------------------------------------------------------------------- */ - -/* file.c */ -extern const struct address_space_operations aufs_aop; -unsigned int au_file_roflags(unsigned int flags); -struct file *au_h_open(struct dentry *dentry, aufs_bindex_t bindex, int flags, - struct file *file, int force_wr); -int au_do_open(struct file *file, int (*open)(struct file *file, int flags), - struct au_fidir *fidir); -int au_reopen_nondir(struct file *file); -struct au_pin; -int au_ready_to_write(struct file *file, loff_t len, struct au_pin *pin); -int au_reval_and_lock_fdi(struct file *file, int (*reopen)(struct file *file), - int wlock); -int au_do_flush(struct file *file, fl_owner_t id, - int (*flush)(struct file *file, fl_owner_t id)); - -/* poll.c */ -#ifdef CONFIG_AUFS_POLL -unsigned int aufs_poll(struct file *file, poll_table *wait); -#endif - -#ifdef CONFIG_AUFS_BR_HFSPLUS -/* hfsplus.c */ -struct file *au_h_open_pre(struct dentry *dentry, aufs_bindex_t bindex, - int force_wr); -void au_h_open_post(struct dentry *dentry, aufs_bindex_t bindex, - struct file *h_file); -#else -AuStub(struct file *, au_h_open_pre, return NULL, struct dentry *dentry, - aufs_bindex_t bindex, int force_wr) -AuStubVoid(au_h_open_post, struct dentry *dentry, aufs_bindex_t bindex, - struct file *h_file); -#endif - -/* f_op.c */ -extern const struct file_operations aufs_file_fop; -int au_do_open_nondir(struct file *file, int flags); -int aufs_release_nondir(struct inode *inode __maybe_unused, struct file *file); - -/* finfo.c */ -void au_hfput(struct au_hfile *hf, struct file *file); -void au_set_h_fptr(struct file *file, aufs_bindex_t bindex, - struct file *h_file); - -void au_update_figen(struct file *file); -struct au_fidir *au_fidir_alloc(struct super_block *sb); -int au_fidir_realloc(struct au_finfo *finfo, int nbr); - -void au_fi_init_once(void *_fi); -void au_finfo_fin(struct file *file); -int au_finfo_init(struct file *file, struct au_fidir *fidir); - -/* ioctl.c */ -long aufs_ioctl_nondir(struct file *file, unsigned int cmd, unsigned long arg); -#ifdef CONFIG_COMPAT -long aufs_compat_ioctl_dir(struct file *file, unsigned int cmd, - unsigned long arg); -long aufs_compat_ioctl_nondir(struct file *file, unsigned int cmd, - unsigned long arg); -#endif - -/* ---------------------------------------------------------------------- */ - -static inline struct au_finfo *au_fi(struct file *file) -{ - return file->private_data; -} - -/* ---------------------------------------------------------------------- */ - -/* - * fi_read_lock, fi_write_lock, - * fi_read_unlock, fi_write_unlock, fi_downgrade_lock - */ -AuSimpleRwsemFuncs(fi, struct file *f, &au_fi(f)->fi_rwsem); - -#define FiMustNoWaiters(f) AuRwMustNoWaiters(&au_fi(f)->fi_rwsem) -#define FiMustAnyLock(f) AuRwMustAnyLock(&au_fi(f)->fi_rwsem) -#define FiMustWriteLock(f) AuRwMustWriteLock(&au_fi(f)->fi_rwsem) - -/* ---------------------------------------------------------------------- */ - -/* todo: hard/soft set? */ -static inline aufs_bindex_t au_fbstart(struct file *file) -{ - FiMustAnyLock(file); - return au_fi(file)->fi_btop; -} - -static inline aufs_bindex_t au_fbend_dir(struct file *file) -{ - FiMustAnyLock(file); - AuDebugOn(!au_fi(file)->fi_hdir); - return au_fi(file)->fi_hdir->fd_bbot; -} - -static inline struct au_vdir *au_fvdir_cache(struct file *file) -{ - FiMustAnyLock(file); - AuDebugOn(!au_fi(file)->fi_hdir); - return au_fi(file)->fi_hdir->fd_vdir_cache; -} - -static inline void au_set_fbstart(struct file *file, aufs_bindex_t bindex) -{ - FiMustWriteLock(file); - au_fi(file)->fi_btop = bindex; -} - -static inline void au_set_fbend_dir(struct file *file, aufs_bindex_t bindex) -{ - FiMustWriteLock(file); - AuDebugOn(!au_fi(file)->fi_hdir); - au_fi(file)->fi_hdir->fd_bbot = bindex; -} - -static inline void au_set_fvdir_cache(struct file *file, - struct au_vdir *vdir_cache) -{ - FiMustWriteLock(file); - AuDebugOn(!au_fi(file)->fi_hdir); - au_fi(file)->fi_hdir->fd_vdir_cache = vdir_cache; -} - -static inline struct file *au_hf_top(struct file *file) -{ - FiMustAnyLock(file); - AuDebugOn(au_fi(file)->fi_hdir); - return au_fi(file)->fi_htop.hf_file; -} - -static inline struct file *au_hf_dir(struct file *file, aufs_bindex_t bindex) -{ - FiMustAnyLock(file); - AuDebugOn(!au_fi(file)->fi_hdir); - return au_fi(file)->fi_hdir->fd_hfile[0 + bindex].hf_file; -} - -/* todo: memory barrier? */ -static inline unsigned int au_figen(struct file *f) -{ - return atomic_read(&au_fi(f)->fi_generation); -} - -static inline void au_set_mmapped(struct file *f) -{ - if (atomic_inc_return(&au_fi(f)->fi_mmapped)) - return; - pr_warn("fi_mmapped wrapped around\n"); - while (!atomic_inc_return(&au_fi(f)->fi_mmapped)) - ; -} - -static inline void au_unset_mmapped(struct file *f) -{ - atomic_dec(&au_fi(f)->fi_mmapped); -} - -static inline int au_test_mmapped(struct file *f) -{ - return atomic_read(&au_fi(f)->fi_mmapped); -} - -/* customize vma->vm_file */ - -static inline void au_do_vm_file_reset(struct vm_area_struct *vma, - struct file *file) -{ - struct file *f; - - f = vma->vm_file; - get_file(file); - vma->vm_file = file; - fput(f); -} - -#ifdef CONFIG_MMU -#define AuDbgVmRegion(file, vma) do {} while (0) - -static inline void au_vm_file_reset(struct vm_area_struct *vma, - struct file *file) -{ - au_do_vm_file_reset(vma, file); -} -#else -#define AuDbgVmRegion(file, vma) \ - AuDebugOn((vma)->vm_region && (vma)->vm_region->vm_file != (file)) - -static inline void au_vm_file_reset(struct vm_area_struct *vma, - struct file *file) -{ - struct file *f; - - au_do_vm_file_reset(vma, file); - f = vma->vm_region->vm_file; - get_file(file); - vma->vm_region->vm_file = file; - fput(f); -} -#endif /* CONFIG_MMU */ - -/* handle vma->vm_prfile */ -static inline void au_vm_prfile_set(struct vm_area_struct *vma, - struct file *file) -{ - get_file(file); - vma->vm_prfile = file; -#ifndef CONFIG_MMU - get_file(file); - vma->vm_region->vm_prfile = file; -#endif -} - -#endif /* __KERNEL__ */ -#endif /* __AUFS_FILE_H__ */ diff --git a/fs/aufs/finfo.c b/fs/aufs/finfo.c deleted file mode 100644 index 28cc9bffa369fe..00000000000000 --- a/fs/aufs/finfo.c +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * file private data - */ - -#include "aufs.h" - -void au_hfput(struct au_hfile *hf, struct file *file) -{ - /* todo: direct access f_flags */ - if (vfsub_file_flags(file) & __FMODE_EXEC) - allow_write_access(hf->hf_file); - fput(hf->hf_file); - hf->hf_file = NULL; - atomic_dec(&hf->hf_br->br_count); - hf->hf_br = NULL; -} - -void au_set_h_fptr(struct file *file, aufs_bindex_t bindex, struct file *val) -{ - struct au_finfo *finfo = au_fi(file); - struct au_hfile *hf; - struct au_fidir *fidir; - - fidir = finfo->fi_hdir; - if (!fidir) { - AuDebugOn(finfo->fi_btop != bindex); - hf = &finfo->fi_htop; - } else - hf = fidir->fd_hfile + bindex; - - if (hf && hf->hf_file) - au_hfput(hf, file); - if (val) { - FiMustWriteLock(file); - hf->hf_file = val; - hf->hf_br = au_sbr(file->f_dentry->d_sb, bindex); - } -} - -void au_update_figen(struct file *file) -{ - atomic_set(&au_fi(file)->fi_generation, au_digen(file->f_dentry)); - /* smp_mb(); */ /* atomic_set */ -} - -/* ---------------------------------------------------------------------- */ - -struct au_fidir *au_fidir_alloc(struct super_block *sb) -{ - struct au_fidir *fidir; - int nbr; - - nbr = au_sbend(sb) + 1; - if (nbr < 2) - nbr = 2; /* initial allocate for 2 branches */ - fidir = kzalloc(au_fidir_sz(nbr), GFP_NOFS); - if (fidir) { - fidir->fd_bbot = -1; - fidir->fd_nent = nbr; - fidir->fd_vdir_cache = NULL; - } - - return fidir; -} - -int au_fidir_realloc(struct au_finfo *finfo, int nbr) -{ - int err; - struct au_fidir *fidir, *p; - - AuRwMustWriteLock(&finfo->fi_rwsem); - fidir = finfo->fi_hdir; - AuDebugOn(!fidir); - - err = -ENOMEM; - p = au_kzrealloc(fidir, au_fidir_sz(fidir->fd_nent), au_fidir_sz(nbr), - GFP_NOFS); - if (p) { - p->fd_nent = nbr; - finfo->fi_hdir = p; - err = 0; - } - - return err; -} - -/* ---------------------------------------------------------------------- */ - -void au_finfo_fin(struct file *file) -{ - struct au_finfo *finfo; - - au_nfiles_dec(file->f_dentry->d_sb); - - finfo = au_fi(file); - AuDebugOn(finfo->fi_hdir); - AuRwDestroy(&finfo->fi_rwsem); - au_cache_free_finfo(finfo); -} - -void au_fi_init_once(void *_finfo) -{ - struct au_finfo *finfo = _finfo; - static struct lock_class_key aufs_fi; - - au_rw_init(&finfo->fi_rwsem); - au_rw_class(&finfo->fi_rwsem, &aufs_fi); -} - -int au_finfo_init(struct file *file, struct au_fidir *fidir) -{ - int err; - struct au_finfo *finfo; - struct dentry *dentry; - - err = -ENOMEM; - dentry = file->f_dentry; - finfo = au_cache_alloc_finfo(); - if (unlikely(!finfo)) - goto out; - - err = 0; - au_nfiles_inc(dentry->d_sb); - /* verbose coding for lock class name */ - if (!fidir) - au_rw_class(&finfo->fi_rwsem, au_lc_key + AuLcNonDir_FIINFO); - else - au_rw_class(&finfo->fi_rwsem, au_lc_key + AuLcDir_FIINFO); - au_rw_write_lock(&finfo->fi_rwsem); - finfo->fi_btop = -1; - finfo->fi_hdir = fidir; - atomic_set(&finfo->fi_generation, au_digen(dentry)); - /* smp_mb(); */ /* atomic_set */ - - file->private_data = finfo; - -out: - return err; -} diff --git a/fs/aufs/fstype.h b/fs/aufs/fstype.h deleted file mode 100644 index b6e6f79f744f02..00000000000000 --- a/fs/aufs/fstype.h +++ /dev/null @@ -1,469 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * judging filesystem type - */ - -#ifndef __AUFS_FSTYPE_H__ -#define __AUFS_FSTYPE_H__ - -#ifdef __KERNEL__ - -#include -#include -#include - -static inline int au_test_aufs(struct super_block *sb) -{ - return sb->s_magic == AUFS_SUPER_MAGIC; -} - -static inline const char *au_sbtype(struct super_block *sb) -{ - return sb->s_type->name; -} - -static inline int au_test_iso9660(struct super_block *sb __maybe_unused) -{ -#if defined(CONFIG_ROMFS_FS) || defined(CONFIG_ROMFS_FS_MODULE) - return sb->s_magic == ROMFS_MAGIC; -#else - return 0; -#endif -} - -static inline int au_test_romfs(struct super_block *sb __maybe_unused) -{ -#if defined(CONFIG_ISO9660_FS) || defined(CONFIG_ISO9660_FS_MODULE) - return sb->s_magic == ISOFS_SUPER_MAGIC; -#else - return 0; -#endif -} - -static inline int au_test_cramfs(struct super_block *sb __maybe_unused) -{ -#if defined(CONFIG_CRAMFS) || defined(CONFIG_CRAMFS_MODULE) - return sb->s_magic == CRAMFS_MAGIC; -#endif - return 0; -} - -static inline int au_test_nfs(struct super_block *sb __maybe_unused) -{ -#if defined(CONFIG_NFS_FS) || defined(CONFIG_NFS_FS_MODULE) - return sb->s_magic == NFS_SUPER_MAGIC; -#else - return 0; -#endif -} - -static inline int au_test_fuse(struct super_block *sb __maybe_unused) -{ -#if defined(CONFIG_FUSE_FS) || defined(CONFIG_FUSE_FS_MODULE) - return sb->s_magic == FUSE_SUPER_MAGIC; -#else - return 0; -#endif -} - -static inline int au_test_xfs(struct super_block *sb __maybe_unused) -{ -#if defined(CONFIG_XFS_FS) || defined(CONFIG_XFS_FS_MODULE) - return sb->s_magic == XFS_SB_MAGIC; -#else - return 0; -#endif -} - -static inline int au_test_tmpfs(struct super_block *sb __maybe_unused) -{ -#ifdef CONFIG_TMPFS - return sb->s_magic == TMPFS_MAGIC; -#else - return 0; -#endif -} - -static inline int au_test_ecryptfs(struct super_block *sb __maybe_unused) -{ -#if defined(CONFIG_ECRYPT_FS) || defined(CONFIG_ECRYPT_FS_MODULE) - return !strcmp(au_sbtype(sb), "ecryptfs"); -#else - return 0; -#endif -} - -static inline int au_test_ocfs2(struct super_block *sb __maybe_unused) -{ -#if defined(CONFIG_OCFS2_FS) || defined(CONFIG_OCFS2_FS_MODULE) - return sb->s_magic == OCFS2_SUPER_MAGIC; -#else - return 0; -#endif -} - -static inline int au_test_ocfs2_dlmfs(struct super_block *sb __maybe_unused) -{ -#if defined(CONFIG_OCFS2_FS_O2CB) || defined(CONFIG_OCFS2_FS_O2CB_MODULE) - return sb->s_magic == DLMFS_MAGIC; -#else - return 0; -#endif -} - -static inline int au_test_coda(struct super_block *sb __maybe_unused) -{ -#if defined(CONFIG_CODA_FS) || defined(CONFIG_CODA_FS_MODULE) - return sb->s_magic == CODA_SUPER_MAGIC; -#else - return 0; -#endif -} - -static inline int au_test_v9fs(struct super_block *sb __maybe_unused) -{ -#if defined(CONFIG_9P_FS) || defined(CONFIG_9P_FS_MODULE) - return sb->s_magic == V9FS_MAGIC; -#else - return 0; -#endif -} - -static inline int au_test_ext4(struct super_block *sb __maybe_unused) -{ -#if defined(CONFIG_EXT4_FS) || defined(CONFIG_EXT4_FS_MODULE) - return sb->s_magic == EXT4_SUPER_MAGIC; -#else - return 0; -#endif -} - -static inline int au_test_sysv(struct super_block *sb __maybe_unused) -{ -#if defined(CONFIG_SYSV_FS) || defined(CONFIG_SYSV_FS_MODULE) - return !strcmp(au_sbtype(sb), "sysv"); -#else - return 0; -#endif -} - -static inline int au_test_ramfs(struct super_block *sb) -{ - return sb->s_magic == RAMFS_MAGIC; -} - -static inline int au_test_ubifs(struct super_block *sb __maybe_unused) -{ -#if defined(CONFIG_UBIFS_FS) || defined(CONFIG_UBIFS_FS_MODULE) - return sb->s_magic == UBIFS_SUPER_MAGIC; -#else - return 0; -#endif -} - -static inline int au_test_procfs(struct super_block *sb __maybe_unused) -{ -#ifdef CONFIG_PROC_FS - return sb->s_magic == PROC_SUPER_MAGIC; -#else - return 0; -#endif -} - -static inline int au_test_sysfs(struct super_block *sb __maybe_unused) -{ -#ifdef CONFIG_SYSFS - return sb->s_magic == SYSFS_MAGIC; -#else - return 0; -#endif -} - -static inline int au_test_configfs(struct super_block *sb __maybe_unused) -{ -#if defined(CONFIG_CONFIGFS_FS) || defined(CONFIG_CONFIGFS_FS_MODULE) - return sb->s_magic == CONFIGFS_MAGIC; -#else - return 0; -#endif -} - -static inline int au_test_minix(struct super_block *sb __maybe_unused) -{ -#if defined(CONFIG_MINIX_FS) || defined(CONFIG_MINIX_FS_MODULE) - return sb->s_magic == MINIX3_SUPER_MAGIC - || sb->s_magic == MINIX2_SUPER_MAGIC - || sb->s_magic == MINIX2_SUPER_MAGIC2 - || sb->s_magic == MINIX_SUPER_MAGIC - || sb->s_magic == MINIX_SUPER_MAGIC2; -#else - return 0; -#endif -} - -static inline int au_test_cifs(struct super_block *sb __maybe_unused) -{ -#if defined(CONFIG_CIFS_FS) || defined(CONFIGCIFS_FS_MODULE) - return sb->s_magic == CIFS_MAGIC_NUMBER; -#else - return 0; -#endif -} - -static inline int au_test_fat(struct super_block *sb __maybe_unused) -{ -#if defined(CONFIG_FAT_FS) || defined(CONFIG_FAT_FS_MODULE) - return sb->s_magic == MSDOS_SUPER_MAGIC; -#else - return 0; -#endif -} - -static inline int au_test_msdos(struct super_block *sb) -{ - return au_test_fat(sb); -} - -static inline int au_test_vfat(struct super_block *sb) -{ - return au_test_fat(sb); -} - -static inline int au_test_securityfs(struct super_block *sb __maybe_unused) -{ -#ifdef CONFIG_SECURITYFS - return sb->s_magic == SECURITYFS_MAGIC; -#else - return 0; -#endif -} - -static inline int au_test_squashfs(struct super_block *sb __maybe_unused) -{ -#if defined(CONFIG_SQUASHFS) || defined(CONFIG_SQUASHFS_MODULE) - return sb->s_magic == SQUASHFS_MAGIC; -#else - return 0; -#endif -} - -static inline int au_test_btrfs(struct super_block *sb __maybe_unused) -{ -#if defined(CONFIG_BTRFS_FS) || defined(CONFIG_BTRFS_FS_MODULE) - return sb->s_magic == BTRFS_SUPER_MAGIC; -#else - return 0; -#endif -} - -static inline int au_test_xenfs(struct super_block *sb __maybe_unused) -{ -#if defined(CONFIG_XENFS) || defined(CONFIG_XENFS_MODULE) - return sb->s_magic == XENFS_SUPER_MAGIC; -#else - return 0; -#endif -} - -static inline int au_test_debugfs(struct super_block *sb __maybe_unused) -{ -#ifdef CONFIG_DEBUG_FS - return sb->s_magic == DEBUGFS_MAGIC; -#else - return 0; -#endif -} - -static inline int au_test_nilfs(struct super_block *sb __maybe_unused) -{ -#if defined(CONFIG_NILFS) || defined(CONFIG_NILFS_MODULE) - return sb->s_magic == NILFS_SUPER_MAGIC; -#else - return 0; -#endif -} - -static inline int au_test_hfsplus(struct super_block *sb __maybe_unused) -{ -#if defined(CONFIG_HFSPLUS_FS) || defined(CONFIG_HFSPLUS_FS_MODULE) - return sb->s_magic == HFSPLUS_SUPER_MAGIC; -#else - return 0; -#endif -} - -/* ---------------------------------------------------------------------- */ -/* - * they can't be an aufs branch. - */ -static inline int au_test_fs_unsuppoted(struct super_block *sb) -{ - return -#ifndef CONFIG_AUFS_BR_RAMFS - au_test_ramfs(sb) || -#endif - au_test_procfs(sb) - || au_test_sysfs(sb) - || au_test_configfs(sb) - || au_test_debugfs(sb) - || au_test_securityfs(sb) - || au_test_xenfs(sb) - || au_test_ecryptfs(sb) - /* || !strcmp(au_sbtype(sb), "unionfs") */ - || au_test_aufs(sb); /* will be supported in next version */ -} - -static inline int au_test_fs_remote(struct super_block *sb) -{ - return !au_test_tmpfs(sb) -#ifdef CONFIG_AUFS_BR_RAMFS - && !au_test_ramfs(sb) -#endif - && !(sb->s_type->fs_flags & FS_REQUIRES_DEV); -} - -/* ---------------------------------------------------------------------- */ - -/* - * Note: these functions (below) are created after reading ->getattr() in all - * filesystems under linux/fs. it means we have to do so in every update... - */ - -/* - * some filesystems require getattr to refresh the inode attributes before - * referencing. - * in most cases, we can rely on the inode attribute in NFS (or every remote fs) - * and leave the work for d_revalidate() - */ -static inline int au_test_fs_refresh_iattr(struct super_block *sb) -{ - return au_test_nfs(sb) - || au_test_fuse(sb) - /* || au_test_ocfs2(sb) */ /* untested */ - /* || au_test_btrfs(sb) */ /* untested */ - /* || au_test_coda(sb) */ /* untested */ - /* || au_test_v9fs(sb) */ /* untested */ - ; -} - -/* - * filesystems which don't maintain i_size or i_blocks. - */ -static inline int au_test_fs_bad_iattr_size(struct super_block *sb) -{ - return au_test_xfs(sb) - || au_test_btrfs(sb) - || au_test_ubifs(sb) - || au_test_hfsplus(sb) /* maintained, but incorrect */ - /* || au_test_ext4(sb) */ /* untested */ - /* || au_test_ocfs2(sb) */ /* untested */ - /* || au_test_ocfs2_dlmfs(sb) */ /* untested */ - /* || au_test_sysv(sb) */ /* untested */ - /* || au_test_minix(sb) */ /* untested */ - ; -} - -/* - * filesystems which don't store the correct value in some of their inode - * attributes. - */ -static inline int au_test_fs_bad_iattr(struct super_block *sb) -{ - return au_test_fs_bad_iattr_size(sb) - /* || au_test_cifs(sb) */ /* untested */ - || au_test_fat(sb) - || au_test_msdos(sb) - || au_test_vfat(sb); -} - -/* they don't check i_nlink in link(2) */ -static inline int au_test_fs_no_limit_nlink(struct super_block *sb) -{ - return au_test_tmpfs(sb) -#ifdef CONFIG_AUFS_BR_RAMFS - || au_test_ramfs(sb) -#endif - || au_test_ubifs(sb) - || au_test_hfsplus(sb); -} - -/* - * filesystems which sets S_NOATIME and S_NOCMTIME. - */ -static inline int au_test_fs_notime(struct super_block *sb) -{ - return au_test_nfs(sb) - || au_test_fuse(sb) - || au_test_ubifs(sb) - /* || au_test_cifs(sb) */ /* untested */ - ; -} - -/* - * filesystems which requires replacing i_mapping. - */ -static inline int au_test_fs_bad_mapping(struct super_block *sb) -{ - return au_test_fuse(sb) - || au_test_ubifs(sb); -} - -/* temporary support for i#1 in cramfs */ -static inline int au_test_fs_unique_ino(struct inode *inode) -{ - if (au_test_cramfs(inode->i_sb)) - return inode->i_ino != 1; - return 1; -} - -/* ---------------------------------------------------------------------- */ - -/* - * the filesystem where the xino files placed must support i/o after unlink and - * maintain i_size and i_blocks. - */ -static inline int au_test_fs_bad_xino(struct super_block *sb) -{ - return au_test_fs_remote(sb) - || au_test_fs_bad_iattr_size(sb) - /* don't want unnecessary work for xino */ - || au_test_aufs(sb) - || au_test_ecryptfs(sb) - || au_test_nilfs(sb); -} - -static inline int au_test_fs_trunc_xino(struct super_block *sb) -{ - return au_test_tmpfs(sb) - || au_test_ramfs(sb); -} - -/* - * test if the @sb is real-readonly. - */ -static inline int au_test_fs_rr(struct super_block *sb) -{ - return au_test_squashfs(sb) - || au_test_iso9660(sb) - || au_test_cramfs(sb) - || au_test_romfs(sb); -} - -#endif /* __KERNEL__ */ -#endif /* __AUFS_FSTYPE_H__ */ diff --git a/fs/aufs/hfsnotify.c b/fs/aufs/hfsnotify.c deleted file mode 100644 index 21d77179609c23..00000000000000 --- a/fs/aufs/hfsnotify.c +++ /dev/null @@ -1,302 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * fsnotify for the lower directories - */ - -#include "aufs.h" - -/* FS_IN_IGNORED is unnecessary */ -static const __u32 AuHfsnMask = (FS_MOVED_TO | FS_MOVED_FROM | FS_DELETE - | FS_CREATE | FS_EVENT_ON_CHILD); -static DECLARE_WAIT_QUEUE_HEAD(au_hfsn_wq); -static __cacheline_aligned_in_smp atomic64_t au_hfsn_ifree = ATOMIC64_INIT(0); - -static void au_hfsn_free_mark(struct fsnotify_mark *mark) -{ - struct au_hnotify *hn = container_of(mark, struct au_hnotify, - hn_mark); - AuDbg("here\n"); - au_cache_free_hnotify(hn); - smp_mb__before_atomic_dec(); - if (atomic64_dec_and_test(&au_hfsn_ifree)) - wake_up(&au_hfsn_wq); -} - -static int au_hfsn_alloc(struct au_hinode *hinode) -{ - int err; - struct au_hnotify *hn; - struct super_block *sb; - struct au_branch *br; - struct fsnotify_mark *mark; - aufs_bindex_t bindex; - - hn = hinode->hi_notify; - sb = hn->hn_aufs_inode->i_sb; - bindex = au_br_index(sb, hinode->hi_id); - br = au_sbr(sb, bindex); - AuDebugOn(!br->br_hfsn); - - mark = &hn->hn_mark; - fsnotify_init_mark(mark, au_hfsn_free_mark); - mark->mask = AuHfsnMask; - /* - * by udba rename or rmdir, aufs assign a new inode to the known - * h_inode, so specify 1 to allow dups. - */ - lockdep_off(); - err = fsnotify_add_mark(mark, br->br_hfsn->hfsn_group, hinode->hi_inode, - /*mnt*/NULL, /*allow_dups*/1); - /* even if err */ - fsnotify_put_mark(mark); - lockdep_on(); - - return err; -} - -static int au_hfsn_free(struct au_hinode *hinode, struct au_hnotify *hn) -{ - struct fsnotify_mark *mark; - unsigned long long ull; - struct fsnotify_group *group; - - ull = atomic64_inc_return(&au_hfsn_ifree); - BUG_ON(!ull); - - mark = &hn->hn_mark; - spin_lock(&mark->lock); - group = mark->group; - fsnotify_get_group(group); - spin_unlock(&mark->lock); - lockdep_off(); - fsnotify_destroy_mark(mark, group); - fsnotify_put_group(group); - lockdep_on(); - - /* free hn by myself */ - return 0; -} - -/* ---------------------------------------------------------------------- */ - -static void au_hfsn_ctl(struct au_hinode *hinode, int do_set) -{ - struct fsnotify_mark *mark; - - mark = &hinode->hi_notify->hn_mark; - spin_lock(&mark->lock); - if (do_set) { - AuDebugOn(mark->mask & AuHfsnMask); - mark->mask |= AuHfsnMask; - } else { - AuDebugOn(!(mark->mask & AuHfsnMask)); - mark->mask &= ~AuHfsnMask; - } - spin_unlock(&mark->lock); - /* fsnotify_recalc_inode_mask(hinode->hi_inode); */ -} - -/* ---------------------------------------------------------------------- */ - -/* #define AuDbgHnotify */ -#ifdef AuDbgHnotify -static char *au_hfsn_name(u32 mask) -{ -#ifdef CONFIG_AUFS_DEBUG -#define test_ret(flag) \ - do { \ - if (mask & flag) \ - return #flag; \ - } while (0) - test_ret(FS_ACCESS); - test_ret(FS_MODIFY); - test_ret(FS_ATTRIB); - test_ret(FS_CLOSE_WRITE); - test_ret(FS_CLOSE_NOWRITE); - test_ret(FS_OPEN); - test_ret(FS_MOVED_FROM); - test_ret(FS_MOVED_TO); - test_ret(FS_CREATE); - test_ret(FS_DELETE); - test_ret(FS_DELETE_SELF); - test_ret(FS_MOVE_SELF); - test_ret(FS_UNMOUNT); - test_ret(FS_Q_OVERFLOW); - test_ret(FS_IN_IGNORED); - test_ret(FS_IN_ISDIR); - test_ret(FS_IN_ONESHOT); - test_ret(FS_EVENT_ON_CHILD); - return ""; -#undef test_ret -#else - return "??"; -#endif -} -#endif - -/* ---------------------------------------------------------------------- */ - -static void au_hfsn_free_group(struct fsnotify_group *group) -{ - struct au_br_hfsnotify *hfsn = group->private; - - AuDbg("here\n"); - kfree(hfsn); -} - -static int au_hfsn_handle_event(struct fsnotify_group *group, - struct fsnotify_mark *inode_mark, - struct fsnotify_mark *vfsmount_mark, - struct fsnotify_event *event) -{ - int err; - struct au_hnotify *hnotify; - struct inode *h_dir, *h_inode; - __u32 mask; - struct qstr h_child_qstr = QSTR_INIT(event->file_name, event->name_len); - - AuDebugOn(event->data_type != FSNOTIFY_EVENT_INODE); - - err = 0; - /* if FS_UNMOUNT happens, there must be another bug */ - mask = event->mask; - AuDebugOn(mask & FS_UNMOUNT); - if (mask & (FS_IN_IGNORED | FS_UNMOUNT)) - goto out; - - h_dir = event->to_tell; - h_inode = event->inode; -#ifdef AuDbgHnotify - au_debug_on(); - if (1 || h_child_qstr.len != sizeof(AUFS_XINO_FNAME) - 1 - || strncmp(h_child_qstr.name, AUFS_XINO_FNAME, h_child_qstr.len)) { - AuDbg("i%lu, mask 0x%x %s, hcname %.*s, hi%lu\n", - h_dir->i_ino, mask, au_hfsn_name(mask), - AuLNPair(&h_child_qstr), h_inode ? h_inode->i_ino : 0); - /* WARN_ON(1); */ - } - au_debug_off(); -#endif - - AuDebugOn(!inode_mark); - hnotify = container_of(inode_mark, struct au_hnotify, hn_mark); - err = au_hnotify(h_dir, hnotify, mask, &h_child_qstr, h_inode); - -out: - return err; -} - -/* isn't it waste to ask every registered 'group'? */ -/* copied from linux/fs/notify/inotify/inotify_fsnotiry.c */ -/* it should be exported to modules */ -static bool au_hfsn_should_send_event(struct fsnotify_group *group, - struct inode *h_inode, - struct fsnotify_mark *inode_mark, - struct fsnotify_mark *vfsmount_mark, - __u32 mask, void *data, int data_type) -{ - mask = (mask & ~FS_EVENT_ON_CHILD); - return inode_mark->mask & mask; -} - -static struct fsnotify_ops au_hfsn_ops = { - .should_send_event = au_hfsn_should_send_event, - .handle_event = au_hfsn_handle_event, - .free_group_priv = au_hfsn_free_group -}; - -/* ---------------------------------------------------------------------- */ - -static void au_hfsn_fin_br(struct au_branch *br) -{ - struct au_br_hfsnotify *hfsn; - - hfsn = br->br_hfsn; - if (hfsn) { - lockdep_off(); - fsnotify_put_group(hfsn->hfsn_group); - lockdep_on(); - } -} - -static int au_hfsn_init_br(struct au_branch *br, int perm) -{ - int err; - struct fsnotify_group *group; - struct au_br_hfsnotify *hfsn; - - err = 0; - br->br_hfsn = NULL; - if (!au_br_hnotifyable(perm)) - goto out; - - err = -ENOMEM; - hfsn = kmalloc(sizeof(*hfsn), GFP_NOFS); - if (unlikely(!hfsn)) - goto out; - - err = 0; - group = fsnotify_alloc_group(&au_hfsn_ops); - if (IS_ERR(group)) { - err = PTR_ERR(group); - pr_err("fsnotify_alloc_group() failed, %d\n", err); - goto out_hfsn; - } - - group->private = hfsn; - hfsn->hfsn_group = group; - br->br_hfsn = hfsn; - goto out; /* success */ - -out_hfsn: - kfree(hfsn); -out: - return err; -} - -static int au_hfsn_reset_br(unsigned int udba, struct au_branch *br, int perm) -{ - int err; - - err = 0; - if (!br->br_hfsn) - err = au_hfsn_init_br(br, perm); - - return err; -} - -/* ---------------------------------------------------------------------- */ - -static void au_hfsn_fin(void) -{ - AuDbg("au_hfsn_ifree %lld\n", (long long)atomic64_read(&au_hfsn_ifree)); - wait_event(au_hfsn_wq, !atomic64_read(&au_hfsn_ifree)); -} - -const struct au_hnotify_op au_hnotify_op = { - .ctl = au_hfsn_ctl, - .alloc = au_hfsn_alloc, - .free = au_hfsn_free, - - .fin = au_hfsn_fin, - - .reset_br = au_hfsn_reset_br, - .fin_br = au_hfsn_fin_br, - .init_br = au_hfsn_init_br -}; diff --git a/fs/aufs/hfsplus.c b/fs/aufs/hfsplus.c deleted file mode 100644 index cb4340348c62fb..00000000000000 --- a/fs/aufs/hfsplus.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2010-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * special support for filesystems which aqucires an inode mutex - * at final closing a file, eg, hfsplus. - * - * This trick is very simple and stupid, just to open the file before really - * neceeary open to tell hfsplus that this is not the final closing. - * The caller should call au_h_open_pre() after acquiring the inode mutex, - * and au_h_open_post() after releasing it. - */ - -#include "aufs.h" - -struct file *au_h_open_pre(struct dentry *dentry, aufs_bindex_t bindex, - int force_wr) -{ - struct file *h_file; - struct dentry *h_dentry; - - h_dentry = au_h_dptr(dentry, bindex); - AuDebugOn(!h_dentry); - AuDebugOn(!h_dentry->d_inode); - - h_file = NULL; - if (au_test_hfsplus(h_dentry->d_sb) - && S_ISREG(h_dentry->d_inode->i_mode)) - h_file = au_h_open(dentry, bindex, - O_RDONLY | O_NOATIME | O_LARGEFILE, - /*file*/NULL, force_wr); - return h_file; -} - -void au_h_open_post(struct dentry *dentry, aufs_bindex_t bindex, - struct file *h_file) -{ - if (h_file) { - fput(h_file); - au_sbr_put(dentry->d_sb, bindex); - } -} diff --git a/fs/aufs/hnotify.c b/fs/aufs/hnotify.c deleted file mode 100644 index 6b5b85e0b28261..00000000000000 --- a/fs/aufs/hnotify.c +++ /dev/null @@ -1,712 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * abstraction to notify the direct changes on lower directories - */ - -#include "aufs.h" - -int au_hn_alloc(struct au_hinode *hinode, struct inode *inode) -{ - int err; - struct au_hnotify *hn; - - err = -ENOMEM; - hn = au_cache_alloc_hnotify(); - if (hn) { - hn->hn_aufs_inode = inode; - hinode->hi_notify = hn; - err = au_hnotify_op.alloc(hinode); - AuTraceErr(err); - if (unlikely(err)) { - hinode->hi_notify = NULL; - au_cache_free_hnotify(hn); - /* - * The upper dir was removed by udba, but the same named - * dir left. In this case, aufs assignes a new inode - * number and set the monitor again. - * For the lower dir, the old monitnor is still left. - */ - if (err == -EEXIST) - err = 0; - } - } - - AuTraceErr(err); - return err; -} - -void au_hn_free(struct au_hinode *hinode) -{ - struct au_hnotify *hn; - - hn = hinode->hi_notify; - if (hn) { - hinode->hi_notify = NULL; - if (au_hnotify_op.free(hinode, hn)) - au_cache_free_hnotify(hn); - } -} - -/* ---------------------------------------------------------------------- */ - -void au_hn_ctl(struct au_hinode *hinode, int do_set) -{ - if (hinode->hi_notify) - au_hnotify_op.ctl(hinode, do_set); -} - -void au_hn_reset(struct inode *inode, unsigned int flags) -{ - aufs_bindex_t bindex, bend; - struct inode *hi; - struct dentry *iwhdentry; - - bend = au_ibend(inode); - for (bindex = au_ibstart(inode); bindex <= bend; bindex++) { - hi = au_h_iptr(inode, bindex); - if (!hi) - continue; - - /* mutex_lock_nested(&hi->i_mutex, AuLsc_I_CHILD); */ - iwhdentry = au_hi_wh(inode, bindex); - if (iwhdentry) - dget(iwhdentry); - au_igrab(hi); - au_set_h_iptr(inode, bindex, NULL, 0); - au_set_h_iptr(inode, bindex, au_igrab(hi), - flags & ~AuHi_XINO); - iput(hi); - dput(iwhdentry); - /* mutex_unlock(&hi->i_mutex); */ - } -} - -/* ---------------------------------------------------------------------- */ - -static int hn_xino(struct inode *inode, struct inode *h_inode) -{ - int err; - aufs_bindex_t bindex, bend, bfound, bstart; - struct inode *h_i; - - err = 0; - if (unlikely(inode->i_ino == AUFS_ROOT_INO)) { - pr_warn("branch root dir was changed\n"); - goto out; - } - - bfound = -1; - bend = au_ibend(inode); - bstart = au_ibstart(inode); -#if 0 /* reserved for future use */ - if (bindex == bend) { - /* keep this ino in rename case */ - goto out; - } -#endif - for (bindex = bstart; bindex <= bend; bindex++) - if (au_h_iptr(inode, bindex) == h_inode) { - bfound = bindex; - break; - } - if (bfound < 0) - goto out; - - for (bindex = bstart; bindex <= bend; bindex++) { - h_i = au_h_iptr(inode, bindex); - if (!h_i) - continue; - - err = au_xino_write(inode->i_sb, bindex, h_i->i_ino, /*ino*/0); - /* ignore this error */ - /* bad action? */ - } - - /* children inode number will be broken */ - -out: - AuTraceErr(err); - return err; -} - -static int hn_gen_tree(struct dentry *dentry) -{ - int err, i, j, ndentry; - struct au_dcsub_pages dpages; - struct au_dpage *dpage; - struct dentry **dentries; - - err = au_dpages_init(&dpages, GFP_NOFS); - if (unlikely(err)) - goto out; - err = au_dcsub_pages(&dpages, dentry, NULL, NULL); - if (unlikely(err)) - goto out_dpages; - - for (i = 0; i < dpages.ndpage; i++) { - dpage = dpages.dpages + i; - dentries = dpage->dentries; - ndentry = dpage->ndentry; - for (j = 0; j < ndentry; j++) { - struct dentry *d; - - d = dentries[j]; - if (IS_ROOT(d)) - continue; - - au_digen_dec(d); - if (d->d_inode) - /* todo: reset children xino? - cached children only? */ - au_iigen_dec(d->d_inode); - } - } - -out_dpages: - au_dpages_free(&dpages); - -#if 0 - /* discard children */ - dentry_unhash(dentry); - dput(dentry); -#endif -out: - return err; -} - -/* - * return 0 if processed. - */ -static int hn_gen_by_inode(char *name, unsigned int nlen, struct inode *inode, - const unsigned int isdir) -{ - int err; - struct dentry *d; - struct qstr *dname; - - err = 1; - if (unlikely(inode->i_ino == AUFS_ROOT_INO)) { - pr_warn("branch root dir was changed\n"); - err = 0; - goto out; - } - - if (!isdir) { - AuDebugOn(!name); - au_iigen_dec(inode); - spin_lock(&inode->i_lock); - hlist_for_each_entry(d, &inode->i_dentry, d_alias) { - spin_lock(&d->d_lock); - dname = &d->d_name; - if (dname->len != nlen - && memcmp(dname->name, name, nlen)) { - spin_unlock(&d->d_lock); - continue; - } - err = 0; - au_digen_dec(d); - spin_unlock(&d->d_lock); - break; - } - spin_unlock(&inode->i_lock); - } else { - au_fset_si(au_sbi(inode->i_sb), FAILED_REFRESH_DIR); - d = d_find_any_alias(inode); - if (!d) { - au_iigen_dec(inode); - goto out; - } - - spin_lock(&d->d_lock); - dname = &d->d_name; - if (dname->len == nlen && !memcmp(dname->name, name, nlen)) { - spin_unlock(&d->d_lock); - err = hn_gen_tree(d); - spin_lock(&d->d_lock); - } - spin_unlock(&d->d_lock); - dput(d); - } - -out: - AuTraceErr(err); - return err; -} - -static int hn_gen_by_name(struct dentry *dentry, const unsigned int isdir) -{ - int err; - struct inode *inode; - - inode = dentry->d_inode; - if (IS_ROOT(dentry) - /* || (inode && inode->i_ino == AUFS_ROOT_INO) */ - ) { - pr_warn("branch root dir was changed\n"); - return 0; - } - - err = 0; - if (!isdir) { - au_digen_dec(dentry); - if (inode) - au_iigen_dec(inode); - } else { - au_fset_si(au_sbi(dentry->d_sb), FAILED_REFRESH_DIR); - if (inode) - err = hn_gen_tree(dentry); - } - - AuTraceErr(err); - return err; -} - -/* ---------------------------------------------------------------------- */ - -/* hnotify job flags */ -#define AuHnJob_XINO0 1 -#define AuHnJob_GEN (1 << 1) -#define AuHnJob_DIRENT (1 << 2) -#define AuHnJob_ISDIR (1 << 3) -#define AuHnJob_TRYXINO0 (1 << 4) -#define AuHnJob_MNTPNT (1 << 5) -#define au_ftest_hnjob(flags, name) ((flags) & AuHnJob_##name) -#define au_fset_hnjob(flags, name) \ - do { (flags) |= AuHnJob_##name; } while (0) -#define au_fclr_hnjob(flags, name) \ - do { (flags) &= ~AuHnJob_##name; } while (0) - -enum { - AuHn_CHILD, - AuHn_PARENT, - AuHnLast -}; - -struct au_hnotify_args { - struct inode *h_dir, *dir, *h_child_inode; - u32 mask; - unsigned int flags[AuHnLast]; - unsigned int h_child_nlen; - char h_child_name[]; -}; - -struct hn_job_args { - unsigned int flags; - struct inode *inode, *h_inode, *dir, *h_dir; - struct dentry *dentry; - char *h_name; - int h_nlen; -}; - -static int hn_job(struct hn_job_args *a) -{ - const unsigned int isdir = au_ftest_hnjob(a->flags, ISDIR); - int e; - - /* reset xino */ - if (au_ftest_hnjob(a->flags, XINO0) && a->inode) - hn_xino(a->inode, a->h_inode); /* ignore this error */ - - if (au_ftest_hnjob(a->flags, TRYXINO0) - && a->inode - && a->h_inode) { - mutex_lock_nested(&a->h_inode->i_mutex, AuLsc_I_CHILD); - if (!a->h_inode->i_nlink) - hn_xino(a->inode, a->h_inode); /* ignore this error */ - mutex_unlock(&a->h_inode->i_mutex); - } - - /* make the generation obsolete */ - if (au_ftest_hnjob(a->flags, GEN)) { - e = -1; - if (a->inode) - e = hn_gen_by_inode(a->h_name, a->h_nlen, a->inode, - isdir); - if (e && a->dentry) - hn_gen_by_name(a->dentry, isdir); - /* ignore this error */ - } - - /* make dir entries obsolete */ - if (au_ftest_hnjob(a->flags, DIRENT) && a->inode) { - struct au_vdir *vdir; - - vdir = au_ivdir(a->inode); - if (vdir) - vdir->vd_jiffy = 0; - /* IMustLock(a->inode); */ - /* a->inode->i_version++; */ - } - - /* can do nothing but warn */ - if (au_ftest_hnjob(a->flags, MNTPNT) - && a->dentry - && d_mountpoint(a->dentry)) - pr_warn("mount-point %.*s is removed or renamed\n", - AuDLNPair(a->dentry)); - - return 0; -} - -/* ---------------------------------------------------------------------- */ - -static struct dentry *lookup_wlock_by_name(char *name, unsigned int nlen, - struct inode *dir) -{ - struct dentry *dentry, *d, *parent; - struct qstr *dname; - - parent = d_find_any_alias(dir); - if (!parent) - return NULL; - - dentry = NULL; - spin_lock(&parent->d_lock); - list_for_each_entry(d, &parent->d_subdirs, d_u.d_child) { - /* AuDbg("%.*s\n", AuDLNPair(d)); */ - spin_lock_nested(&d->d_lock, DENTRY_D_LOCK_NESTED); - dname = &d->d_name; - if (dname->len != nlen || memcmp(dname->name, name, nlen)) - goto cont_unlock; - if (au_di(d)) - au_digen_dec(d); - else - goto cont_unlock; - if (d->d_count) { - dentry = dget_dlock(d); - spin_unlock(&d->d_lock); - break; - } - -cont_unlock: - spin_unlock(&d->d_lock); - } - spin_unlock(&parent->d_lock); - dput(parent); - - if (dentry) - di_write_lock_child(dentry); - - return dentry; -} - -static struct inode *lookup_wlock_by_ino(struct super_block *sb, - aufs_bindex_t bindex, ino_t h_ino) -{ - struct inode *inode; - ino_t ino; - int err; - - inode = NULL; - err = au_xino_read(sb, bindex, h_ino, &ino); - if (!err && ino) - inode = ilookup(sb, ino); - if (!inode) - goto out; - - if (unlikely(inode->i_ino == AUFS_ROOT_INO)) { - pr_warn("wrong root branch\n"); - iput(inode); - inode = NULL; - goto out; - } - - ii_write_lock_child(inode); - -out: - return inode; -} - -static void au_hn_bh(void *_args) -{ - struct au_hnotify_args *a = _args; - struct super_block *sb; - aufs_bindex_t bindex, bend, bfound; - unsigned char xino, try_iput; - int err; - struct inode *inode; - ino_t h_ino; - struct hn_job_args args; - struct dentry *dentry; - struct au_sbinfo *sbinfo; - - AuDebugOn(!_args); - AuDebugOn(!a->h_dir); - AuDebugOn(!a->dir); - AuDebugOn(!a->mask); - AuDbg("mask 0x%x, i%lu, hi%lu, hci%lu\n", - a->mask, a->dir->i_ino, a->h_dir->i_ino, - a->h_child_inode ? a->h_child_inode->i_ino : 0); - - inode = NULL; - dentry = NULL; - /* - * do not lock a->dir->i_mutex here - * because of d_revalidate() may cause a deadlock. - */ - sb = a->dir->i_sb; - AuDebugOn(!sb); - sbinfo = au_sbi(sb); - AuDebugOn(!sbinfo); - si_write_lock(sb, AuLock_NOPLMW); - - ii_read_lock_parent(a->dir); - bfound = -1; - bend = au_ibend(a->dir); - for (bindex = au_ibstart(a->dir); bindex <= bend; bindex++) - if (au_h_iptr(a->dir, bindex) == a->h_dir) { - bfound = bindex; - break; - } - ii_read_unlock(a->dir); - if (unlikely(bfound < 0)) - goto out; - - xino = !!au_opt_test(au_mntflags(sb), XINO); - h_ino = 0; - if (a->h_child_inode) - h_ino = a->h_child_inode->i_ino; - - if (a->h_child_nlen - && (au_ftest_hnjob(a->flags[AuHn_CHILD], GEN) - || au_ftest_hnjob(a->flags[AuHn_CHILD], MNTPNT))) - dentry = lookup_wlock_by_name(a->h_child_name, a->h_child_nlen, - a->dir); - try_iput = 0; - if (dentry) - inode = dentry->d_inode; - if (xino && !inode && h_ino - && (au_ftest_hnjob(a->flags[AuHn_CHILD], XINO0) - || au_ftest_hnjob(a->flags[AuHn_CHILD], TRYXINO0) - || au_ftest_hnjob(a->flags[AuHn_CHILD], GEN))) { - inode = lookup_wlock_by_ino(sb, bfound, h_ino); - try_iput = 1; - } - - args.flags = a->flags[AuHn_CHILD]; - args.dentry = dentry; - args.inode = inode; - args.h_inode = a->h_child_inode; - args.dir = a->dir; - args.h_dir = a->h_dir; - args.h_name = a->h_child_name; - args.h_nlen = a->h_child_nlen; - err = hn_job(&args); - if (dentry) { - if (au_di(dentry)) - di_write_unlock(dentry); - dput(dentry); - } - if (inode && try_iput) { - ii_write_unlock(inode); - iput(inode); - } - - ii_write_lock_parent(a->dir); - args.flags = a->flags[AuHn_PARENT]; - args.dentry = NULL; - args.inode = a->dir; - args.h_inode = a->h_dir; - args.dir = NULL; - args.h_dir = NULL; - args.h_name = NULL; - args.h_nlen = 0; - err = hn_job(&args); - ii_write_unlock(a->dir); - -out: - iput(a->h_child_inode); - iput(a->h_dir); - iput(a->dir); - si_write_unlock(sb); - au_nwt_done(&sbinfo->si_nowait); - kfree(a); -} - -/* ---------------------------------------------------------------------- */ - -int au_hnotify(struct inode *h_dir, struct au_hnotify *hnotify, u32 mask, - struct qstr *h_child_qstr, struct inode *h_child_inode) -{ - int err, len; - unsigned int flags[AuHnLast], f; - unsigned char isdir, isroot, wh; - struct inode *dir; - struct au_hnotify_args *args; - char *p, *h_child_name; - - err = 0; - AuDebugOn(!hnotify || !hnotify->hn_aufs_inode); - dir = igrab(hnotify->hn_aufs_inode); - if (!dir) - goto out; - - isroot = (dir->i_ino == AUFS_ROOT_INO); - wh = 0; - h_child_name = (void *)h_child_qstr->name; - len = h_child_qstr->len; - if (h_child_name) { - if (len > AUFS_WH_PFX_LEN - && !memcmp(h_child_name, AUFS_WH_PFX, AUFS_WH_PFX_LEN)) { - h_child_name += AUFS_WH_PFX_LEN; - len -= AUFS_WH_PFX_LEN; - wh = 1; - } - } - - isdir = 0; - if (h_child_inode) - isdir = !!S_ISDIR(h_child_inode->i_mode); - flags[AuHn_PARENT] = AuHnJob_ISDIR; - flags[AuHn_CHILD] = 0; - if (isdir) - flags[AuHn_CHILD] = AuHnJob_ISDIR; - au_fset_hnjob(flags[AuHn_PARENT], DIRENT); - au_fset_hnjob(flags[AuHn_CHILD], GEN); - switch (mask & FS_EVENTS_POSS_ON_CHILD) { - case FS_MOVED_FROM: - case FS_MOVED_TO: - au_fset_hnjob(flags[AuHn_CHILD], XINO0); - au_fset_hnjob(flags[AuHn_CHILD], MNTPNT); - /*FALLTHROUGH*/ - case FS_CREATE: - AuDebugOn(!h_child_name || !h_child_inode); - break; - - case FS_DELETE: - /* - * aufs never be able to get this child inode. - * revalidation should be in d_revalidate() - * by checking i_nlink, i_generation or d_unhashed(). - */ - AuDebugOn(!h_child_name); - au_fset_hnjob(flags[AuHn_CHILD], TRYXINO0); - au_fset_hnjob(flags[AuHn_CHILD], MNTPNT); - break; - - default: - AuDebugOn(1); - } - - if (wh) - h_child_inode = NULL; - - err = -ENOMEM; - /* iput() and kfree() will be called in au_hnotify() */ - args = kmalloc(sizeof(*args) + len + 1, GFP_NOFS); - if (unlikely(!args)) { - AuErr1("no memory\n"); - iput(dir); - goto out; - } - args->flags[AuHn_PARENT] = flags[AuHn_PARENT]; - args->flags[AuHn_CHILD] = flags[AuHn_CHILD]; - args->mask = mask; - args->dir = dir; - args->h_dir = igrab(h_dir); - if (h_child_inode) - h_child_inode = igrab(h_child_inode); /* can be NULL */ - args->h_child_inode = h_child_inode; - args->h_child_nlen = len; - if (len) { - p = (void *)args; - p += sizeof(*args); - memcpy(p, h_child_name, len); - p[len] = 0; - } - - f = 0; - if (!dir->i_nlink) - f = AuWkq_NEST; - err = au_wkq_nowait(au_hn_bh, args, dir->i_sb, f); - if (unlikely(err)) { - pr_err("wkq %d\n", err); - iput(args->h_child_inode); - iput(args->h_dir); - iput(args->dir); - kfree(args); - } - -out: - return err; -} - -/* ---------------------------------------------------------------------- */ - -int au_hnotify_reset_br(unsigned int udba, struct au_branch *br, int perm) -{ - int err; - - AuDebugOn(!(udba & AuOptMask_UDBA)); - - err = 0; - if (au_hnotify_op.reset_br) - err = au_hnotify_op.reset_br(udba, br, perm); - - return err; -} - -int au_hnotify_init_br(struct au_branch *br, int perm) -{ - int err; - - err = 0; - if (au_hnotify_op.init_br) - err = au_hnotify_op.init_br(br, perm); - - return err; -} - -void au_hnotify_fin_br(struct au_branch *br) -{ - if (au_hnotify_op.fin_br) - au_hnotify_op.fin_br(br); -} - -static void au_hn_destroy_cache(void) -{ - kmem_cache_destroy(au_cachep[AuCache_HNOTIFY]); - au_cachep[AuCache_HNOTIFY] = NULL; -} - -int __init au_hnotify_init(void) -{ - int err; - - err = -ENOMEM; - au_cachep[AuCache_HNOTIFY] = AuCache(au_hnotify); - if (au_cachep[AuCache_HNOTIFY]) { - err = 0; - if (au_hnotify_op.init) - err = au_hnotify_op.init(); - if (unlikely(err)) - au_hn_destroy_cache(); - } - AuTraceErr(err); - return err; -} - -void au_hnotify_fin(void) -{ - if (au_hnotify_op.fin) - au_hnotify_op.fin(); - /* cf. au_cache_fin() */ - if (au_cachep[AuCache_HNOTIFY]) - au_hn_destroy_cache(); -} diff --git a/fs/aufs/i_op.c b/fs/aufs/i_op.c deleted file mode 100644 index e2f0c89955dc05..00000000000000 --- a/fs/aufs/i_op.c +++ /dev/null @@ -1,1255 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * inode operations (except add/del/rename) - */ - -#include -#include -#include -#include -#include -#include "aufs.h" - -static int h_permission(struct inode *h_inode, int mask, - struct vfsmount *h_mnt, int brperm) -{ - int err; - const unsigned char write_mask = !!(mask & (MAY_WRITE | MAY_APPEND)); - - err = -EACCES; - if ((write_mask && IS_IMMUTABLE(h_inode)) - || ((mask & MAY_EXEC) - && S_ISREG(h_inode->i_mode) - && ((h_mnt->mnt_flags & MNT_NOEXEC) - || !(h_inode->i_mode & S_IXUGO)))) - goto out; - - /* - * - skip the lower fs test in the case of write to ro branch. - * - nfs dir permission write check is optimized, but a policy for - * link/rename requires a real check. - */ - if ((write_mask && !au_br_writable(brperm)) - || (au_test_nfs(h_inode->i_sb) && S_ISDIR(h_inode->i_mode) - && write_mask && !(mask & MAY_READ)) - || !h_inode->i_op->permission) { - /* AuLabel(generic_permission); */ - err = generic_permission(h_inode, mask); - } else { - /* AuLabel(h_inode->permission); */ - err = h_inode->i_op->permission(h_inode, mask); - AuTraceErr(err); - } - - if (!err) - err = devcgroup_inode_permission(h_inode, mask); - if (!err) - err = security_inode_permission(h_inode, mask); - -#if 0 - if (!err) { - /* todo: do we need to call ima_path_check()? */ - struct path h_path = { - .dentry = - .mnt = h_mnt - }; - err = ima_path_check(&h_path, - mask & (MAY_READ | MAY_WRITE | MAY_EXEC), - IMA_COUNT_LEAVE); - } -#endif - -out: - return err; -} - -static int aufs_permission(struct inode *inode, int mask) -{ - int err; - aufs_bindex_t bindex, bend; - const unsigned char isdir = !!S_ISDIR(inode->i_mode), - write_mask = !!(mask & (MAY_WRITE | MAY_APPEND)); - struct inode *h_inode; - struct super_block *sb; - struct au_branch *br; - - /* todo: support rcu-walk? */ - if (mask & MAY_NOT_BLOCK) - return -ECHILD; - - sb = inode->i_sb; - si_read_lock(sb, AuLock_FLUSH); - ii_read_lock_child(inode); -#if 0 - err = au_iigen_test(inode, au_sigen(sb)); - if (unlikely(err)) - goto out; -#endif - - if (!isdir - || write_mask - || au_opt_test(au_mntflags(sb), DIRPERM1)) { - err = au_busy_or_stale(); - h_inode = au_h_iptr(inode, au_ibstart(inode)); - if (unlikely(!h_inode - || (h_inode->i_mode & S_IFMT) - != (inode->i_mode & S_IFMT))) - goto out; - - err = 0; - bindex = au_ibstart(inode); - br = au_sbr(sb, bindex); - err = h_permission(h_inode, mask, au_br_mnt(br), br->br_perm); - if (write_mask - && !err - && !special_file(h_inode->i_mode)) { - /* test whether the upper writable branch exists */ - err = -EROFS; - for (; bindex >= 0; bindex--) - if (!au_br_rdonly(au_sbr(sb, bindex))) { - err = 0; - break; - } - } - goto out; - } - - /* non-write to dir */ - err = 0; - bend = au_ibend(inode); - for (bindex = au_ibstart(inode); !err && bindex <= bend; bindex++) { - h_inode = au_h_iptr(inode, bindex); - if (h_inode) { - err = au_busy_or_stale(); - if (unlikely(!S_ISDIR(h_inode->i_mode))) - break; - - br = au_sbr(sb, bindex); - err = h_permission(h_inode, mask, au_br_mnt(br), - br->br_perm); - } - } - -out: - ii_read_unlock(inode); - si_read_unlock(sb); - return err; -} - -#ifdef CONFIG_FS_POSIX_ACL -static struct posix_acl *aufs_get_acl(struct inode *inode, int mask) -{ - struct posix_acl *acl; - int err; - aufs_bindex_t bindex, bend; - const unsigned char isdir = !!S_ISDIR(inode->i_mode), - write_mask = !!(mask & (MAY_WRITE | MAY_APPEND)); - struct inode *h_inode; - struct super_block *sb; - - WARN_ON(mask & MAY_NOT_BLOCK); - - err = 0; - sb = inode->i_sb; - si_read_lock(sb, AuLock_FLUSH); - ii_read_lock_child(inode); - if (!(sb->s_flags & MS_POSIXACL)) - goto out_ii; - - err = au_busy_or_stale(); - bindex = au_ibstart(inode); - h_inode = au_h_iptr(inode, bindex); - if (unlikely(!h_inode - || (h_inode->i_mode & S_IFMT) != (inode->i_mode & S_IFMT))) - goto out_ii; - - /* cf: fs/namei.c:acl_permission_check() */ - err = -EAGAIN; - if (!IS_POSIXACL(h_inode)) - goto out_ii; - - if (!isdir - || write_mask - || au_opt_test(au_mntflags(sb), DIRPERM1)) { - err = check_acl(h_inode, mask); - if (unlikely(err && err != -EAGAIN)) - goto out_ii; - - if (write_mask - && !special_file(h_inode->i_mode)) { - /* test whether the upper writable branch exists */ - err = -EROFS; - for (; bindex >= 0; bindex--) - if (!au_br_rdonly(au_sbr(sb, bindex))) { - err = 0; - break; - } - } - goto out_ii; - } - - /* non-write to dir */ - err = 0; - bend = au_ibend(inode); - for (; (!err || err == -EAGAIN) && bindex <= bend; bindex++) { - h_inode = au_h_iptr(inode, bindex); - if (h_inode) { - err = au_busy_or_stale(); - if (unlikely(!S_ISDIR(h_inode->i_mode))) - break; - - err = check_acl(h_inode, mask); - } - } - -out_ii: - ii_read_unlock(inode); - si_read_unlock(sb); - acl = ERR_PTR(err); - - return acl; -} -#endif - -/* ---------------------------------------------------------------------- */ - -static struct dentry *aufs_lookup(struct inode *dir, struct dentry *dentry, - unsigned int flags) -{ - struct dentry *ret, *parent; - struct inode *inode; - struct super_block *sb; - int err, npositive; - - IMustLock(dir); - - /* todo: support rcu-walk? */ - ret = ERR_PTR(-ECHILD); - if (flags & LOOKUP_RCU) - goto out; - - ret = ERR_PTR(-ENAMETOOLONG); - if (unlikely(dentry->d_name.len > AUFS_MAX_NAMELEN)) - goto out; - - sb = dir->i_sb; - err = si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLM); - ret = ERR_PTR(err); - if (unlikely(err)) - goto out; - - err = au_di_init(dentry); - ret = ERR_PTR(err); - if (unlikely(err)) - goto out_si; - - inode = NULL; - npositive = 0; /* suppress a warning */ - parent = dentry->d_parent; /* dir inode is locked */ - di_read_lock_parent(parent, AuLock_IR); - err = au_alive_dir(parent); - if (!err) - err = au_digen_test(parent, au_sigen(sb)); - if (!err) { - npositive = au_lkup_dentry(dentry, au_dbstart(parent), - /*type*/0); - err = npositive; - } - di_read_unlock(parent, AuLock_IR); - ret = ERR_PTR(err); - if (unlikely(err < 0)) - goto out_unlock; - - if (npositive) { - inode = au_new_inode(dentry, /*must_new*/0); - if (IS_ERR(inode)) { - ret = (void *)inode; - inode = NULL; - goto out_unlock; - } - } - - ret = d_splice_alias(inode, dentry); -#if 0 - if (unlikely(d_need_lookup(dentry))) { - spin_lock(&dentry->d_lock); - dentry->d_flags &= ~DCACHE_NEED_LOOKUP; - spin_unlock(&dentry->d_lock); - } else -#endif - if (unlikely(IS_ERR(ret) && inode)) { - ii_write_unlock(inode); - iput(inode); - inode = NULL; - } - -out_unlock: - di_write_unlock(dentry); - if (inode) { - /* verbose coding for lock class name */ - if (unlikely(S_ISLNK(inode->i_mode))) - au_rw_class(&au_di(dentry)->di_rwsem, - au_lc_key + AuLcSymlink_DIINFO); - else if (unlikely(S_ISDIR(inode->i_mode))) - au_rw_class(&au_di(dentry)->di_rwsem, - au_lc_key + AuLcDir_DIINFO); - else /* likely */ - au_rw_class(&au_di(dentry)->di_rwsem, - au_lc_key + AuLcNonDir_DIINFO); - } -out_si: - si_read_unlock(sb); -out: - return ret; -} - -/* ---------------------------------------------------------------------- */ - -static int au_wr_dir_cpup(struct dentry *dentry, struct dentry *parent, - const unsigned char add_entry, aufs_bindex_t bcpup, - aufs_bindex_t bstart) -{ - int err; - struct dentry *h_parent; - struct inode *h_dir; - - if (add_entry) - IMustLock(parent->d_inode); - else - di_write_lock_parent(parent); - - err = 0; - if (!au_h_dptr(parent, bcpup)) { - if (bstart > bcpup) - err = au_cpup_dirs(dentry, bcpup); - else if (bstart < bcpup) - err = au_cpdown_dirs(dentry, bcpup); - else - BUG(); - } - if (!err && add_entry) { - h_parent = au_h_dptr(parent, bcpup); - h_dir = h_parent->d_inode; - mutex_lock_nested(&h_dir->i_mutex, AuLsc_I_PARENT); - err = au_lkup_neg(dentry, bcpup, - au_ftest_wrdir(add_entry, TMP_WHENTRY)); - /* todo: no unlock here */ - mutex_unlock(&h_dir->i_mutex); - - AuDbg("bcpup %d\n", bcpup); - if (!err) { - if (!dentry->d_inode) - au_set_h_dptr(dentry, bstart, NULL); - au_update_dbrange(dentry, /*do_put_zero*/0); - } - } - - if (!add_entry) - di_write_unlock(parent); - if (!err) - err = bcpup; /* success */ - - AuTraceErr(err); - return err; -} - -/* - * decide the branch and the parent dir where we will create a new entry. - * returns new bindex or an error. - * copyup the parent dir if needed. - */ -int au_wr_dir(struct dentry *dentry, struct dentry *src_dentry, - struct au_wr_dir_args *args) -{ - int err; - unsigned int flags; - aufs_bindex_t bcpup, bstart, src_bstart; - const unsigned char add_entry - = au_ftest_wrdir(args->flags, ADD_ENTRY) - | au_ftest_wrdir(args->flags, TMP_WHENTRY); - struct super_block *sb; - struct dentry *parent; - struct au_sbinfo *sbinfo; - - sb = dentry->d_sb; - sbinfo = au_sbi(sb); - parent = dget_parent(dentry); - bstart = au_dbstart(dentry); - bcpup = bstart; - if (args->force_btgt < 0) { - if (src_dentry) { - src_bstart = au_dbstart(src_dentry); - if (src_bstart < bstart) - bcpup = src_bstart; - } else if (add_entry) { - flags = 0; - if (au_ftest_wrdir(args->flags, ISDIR)) - au_fset_wbr(flags, DIR); - err = AuWbrCreate(sbinfo, dentry, flags); - bcpup = err; - } - - if (bcpup < 0 || au_test_ro(sb, bcpup, dentry->d_inode)) { - if (add_entry) - err = AuWbrCopyup(sbinfo, dentry); - else { - if (!IS_ROOT(dentry)) { - di_read_lock_parent(parent, !AuLock_IR); - err = AuWbrCopyup(sbinfo, dentry); - di_read_unlock(parent, !AuLock_IR); - } else - err = AuWbrCopyup(sbinfo, dentry); - } - bcpup = err; - if (unlikely(err < 0)) - goto out; - } - } else { - bcpup = args->force_btgt; - AuDebugOn(au_test_ro(sb, bcpup, dentry->d_inode)); - } - - AuDbg("bstart %d, bcpup %d\n", bstart, bcpup); - err = bcpup; - if (bcpup == bstart) - goto out; /* success */ - - /* copyup the new parent into the branch we process */ - err = au_wr_dir_cpup(dentry, parent, add_entry, bcpup, bstart); - if (err >= 0) { - if (!dentry->d_inode) { - au_set_h_dptr(dentry, bstart, NULL); - au_set_dbstart(dentry, bcpup); - au_set_dbend(dentry, bcpup); - } - AuDebugOn(add_entry && !au_h_dptr(dentry, bcpup)); - } - -out: - dput(parent); - return err; -} - -/* ---------------------------------------------------------------------- */ - -void au_pin_hdir_unlock(struct au_pin *p) -{ - if (p->hdir) - au_hn_imtx_unlock(p->hdir); -} - -int au_pin_hdir_lock(struct au_pin *p) -{ - int err; - - err = 0; - if (!p->hdir) - goto out; - - /* even if an error happens later, keep this lock */ - au_hn_imtx_lock_nested(p->hdir, p->lsc_hi); - - err = -EBUSY; - if (unlikely(p->hdir->hi_inode != p->h_parent->d_inode)) - goto out; - - err = 0; - if (p->h_dentry) - err = au_h_verify(p->h_dentry, p->udba, p->hdir->hi_inode, - p->h_parent, p->br); - -out: - return err; -} - -int au_pin_hdir_relock(struct au_pin *p) -{ - int err, i; - struct inode *h_i; - struct dentry *h_d[] = { - p->h_dentry, - p->h_parent - }; - - err = au_pin_hdir_lock(p); - if (unlikely(err)) - goto out; - - for (i = 0; !err && i < sizeof(h_d)/sizeof(*h_d); i++) { - if (!h_d[i]) - continue; - h_i = h_d[i]->d_inode; - if (h_i) - err = !h_i->i_nlink; - } - -out: - return err; -} - -void au_pin_hdir_set_owner(struct au_pin *p, struct task_struct *task) -{ -#if defined(CONFIG_DEBUG_MUTEXES) || defined(CONFIG_SMP) - p->hdir->hi_inode->i_mutex.owner = task; -#endif -} - -void au_pin_hdir_acquire_nest(struct au_pin *p) -{ - if (p->hdir) { - mutex_acquire_nest(&p->hdir->hi_inode->i_mutex.dep_map, - p->lsc_hi, 0, NULL, _RET_IP_); - au_pin_hdir_set_owner(p, current); - } -} - -void au_pin_hdir_release(struct au_pin *p) -{ - if (p->hdir) { - au_pin_hdir_set_owner(p, p->task); - mutex_release(&p->hdir->hi_inode->i_mutex.dep_map, 1, _RET_IP_); - } -} - -struct dentry *au_pinned_h_parent(struct au_pin *pin) -{ - if (pin && pin->parent) - return au_h_dptr(pin->parent, pin->bindex); - return NULL; -} - -void au_unpin(struct au_pin *p) -{ - if (p->hdir) - au_pin_hdir_unlock(p); - if (p->h_mnt && au_ftest_pin(p->flags, MNT_WRITE)) - vfsub_mnt_drop_write(p->h_mnt); - if (!p->hdir) - return; - - if (!au_ftest_pin(p->flags, DI_LOCKED)) - di_read_unlock(p->parent, AuLock_IR); - iput(p->hdir->hi_inode); - dput(p->parent); - p->parent = NULL; - p->hdir = NULL; - p->h_mnt = NULL; - /* do not clear p->task */ -} - -int au_do_pin(struct au_pin *p) -{ - int err; - struct super_block *sb; - struct inode *h_dir; - - err = 0; - sb = p->dentry->d_sb; - p->br = au_sbr(sb, p->bindex); - if (IS_ROOT(p->dentry)) { - if (au_ftest_pin(p->flags, MNT_WRITE)) { - p->h_mnt = au_br_mnt(p->br); - err = vfsub_mnt_want_write(p->h_mnt); - if (unlikely(err)) { - au_fclr_pin(p->flags, MNT_WRITE); - goto out_err; - } - } - goto out; - } - - p->h_dentry = NULL; - if (p->bindex <= au_dbend(p->dentry)) - p->h_dentry = au_h_dptr(p->dentry, p->bindex); - - p->parent = dget_parent(p->dentry); - if (!au_ftest_pin(p->flags, DI_LOCKED)) - di_read_lock(p->parent, AuLock_IR, p->lsc_di); - - h_dir = NULL; - p->h_parent = au_h_dptr(p->parent, p->bindex); - p->hdir = au_hi(p->parent->d_inode, p->bindex); - if (p->hdir) - h_dir = p->hdir->hi_inode; - - /* - * udba case, or - * if DI_LOCKED is not set, then p->parent may be different - * and h_parent can be NULL. - */ - if (unlikely(!p->hdir || !h_dir || !p->h_parent)) { - err = -EBUSY; - if (!au_ftest_pin(p->flags, DI_LOCKED)) - di_read_unlock(p->parent, AuLock_IR); - dput(p->parent); - p->parent = NULL; - goto out_err; - } - - if (au_ftest_pin(p->flags, MNT_WRITE)) { - p->h_mnt = au_br_mnt(p->br); - err = vfsub_mnt_want_write(p->h_mnt); - if (unlikely(err)) { - au_fclr_pin(p->flags, MNT_WRITE); - if (!au_ftest_pin(p->flags, DI_LOCKED)) - di_read_unlock(p->parent, AuLock_IR); - dput(p->parent); - p->parent = NULL; - goto out_err; - } - } - - au_igrab(h_dir); - err = au_pin_hdir_lock(p); - if (!err) - goto out; /* success */ - - au_unpin(p); - -out_err: - pr_err("err %d\n", err); - err = au_busy_or_stale(); -out: - return err; -} - -void au_pin_init(struct au_pin *p, struct dentry *dentry, - aufs_bindex_t bindex, int lsc_di, int lsc_hi, - unsigned int udba, unsigned char flags) -{ - p->dentry = dentry; - p->udba = udba; - p->lsc_di = lsc_di; - p->lsc_hi = lsc_hi; - p->flags = flags; - p->bindex = bindex; - - p->parent = NULL; - p->hdir = NULL; - p->h_mnt = NULL; - - p->h_dentry = NULL; - p->h_parent = NULL; - p->br = NULL; - p->task = current; -} - -int au_pin(struct au_pin *pin, struct dentry *dentry, aufs_bindex_t bindex, - unsigned int udba, unsigned char flags) -{ - au_pin_init(pin, dentry, bindex, AuLsc_DI_PARENT, AuLsc_I_PARENT2, - udba, flags); - return au_do_pin(pin); -} - -/* ---------------------------------------------------------------------- */ - -/* - * ->setattr() and ->getattr() are called in various cases. - * chmod, stat: dentry is revalidated. - * fchmod, fstat: file and dentry are not revalidated, additionally they may be - * unhashed. - * for ->setattr(), ia->ia_file is passed from ftruncate only. - */ -/* todo: consolidate with do_refresh() and simple_reval_dpath() */ -int au_reval_for_attr(struct dentry *dentry, unsigned int sigen) -{ - int err; - struct inode *inode; - struct dentry *parent; - - err = 0; - inode = dentry->d_inode; - if (au_digen_test(dentry, sigen)) { - parent = dget_parent(dentry); - di_read_lock_parent(parent, AuLock_IR); - err = au_refresh_dentry(dentry, parent); - di_read_unlock(parent, AuLock_IR); - dput(parent); - } - - AuTraceErr(err); - return err; -} - -int au_pin_and_icpup(struct dentry *dentry, struct iattr *ia, - struct au_icpup_args *a) -{ - int err; - loff_t sz; - aufs_bindex_t bstart, ibstart; - struct dentry *hi_wh, *parent; - struct inode *inode; - struct au_wr_dir_args wr_dir_args = { - .force_btgt = -1, - .flags = 0 - }; - - bstart = au_dbstart(dentry); - inode = dentry->d_inode; - if (S_ISDIR(inode->i_mode)) - au_fset_wrdir(wr_dir_args.flags, ISDIR); - /* plink or hi_wh() case */ - ibstart = au_ibstart(inode); - if (bstart != ibstart && !au_test_ro(inode->i_sb, ibstart, inode)) - wr_dir_args.force_btgt = ibstart; - err = au_wr_dir(dentry, /*src_dentry*/NULL, &wr_dir_args); - if (unlikely(err < 0)) - goto out; - a->btgt = err; - if (err != bstart) - au_fset_icpup(a->flags, DID_CPUP); - - err = 0; - a->pin_flags = AuPin_MNT_WRITE; - parent = NULL; - if (!IS_ROOT(dentry)) { - au_fset_pin(a->pin_flags, DI_LOCKED); - parent = dget_parent(dentry); - di_write_lock_parent(parent); - } - - err = au_pin(&a->pin, dentry, a->btgt, a->udba, a->pin_flags); - if (unlikely(err)) - goto out_parent; - - a->h_path.dentry = au_h_dptr(dentry, bstart); - a->h_inode = a->h_path.dentry->d_inode; - sz = -1; - if (ia && (ia->ia_valid & ATTR_SIZE)) { - mutex_lock_nested(&a->h_inode->i_mutex, AuLsc_I_CHILD); - if (ia->ia_size < i_size_read(a->h_inode)) - sz = ia->ia_size; - mutex_unlock(&a->h_inode->i_mutex); - } - - hi_wh = NULL; - if (au_ftest_icpup(a->flags, DID_CPUP) && d_unlinked(dentry)) { - hi_wh = au_hi_wh(inode, a->btgt); - if (!hi_wh) { - struct au_cp_generic cpg = { - .dentry = dentry, - .bdst = a->btgt, - .bsrc = -1, - .len = sz, - .pin = &a->pin - }; - err = au_sio_cpup_wh(&cpg, /*file*/NULL); - if (unlikely(err)) - goto out_unlock; - hi_wh = au_hi_wh(inode, a->btgt); - /* todo: revalidate hi_wh? */ - } - } - - if (parent) { - au_pin_set_parent_lflag(&a->pin, /*lflag*/0); - di_downgrade_lock(parent, AuLock_IR); - dput(parent); - parent = NULL; - } - if (!au_ftest_icpup(a->flags, DID_CPUP)) - goto out; /* success */ - - if (!d_unhashed(dentry)) { - struct au_cp_generic cpg = { - .dentry = dentry, - .bdst = a->btgt, - .bsrc = bstart, - .len = sz, - .pin = &a->pin, - .flags = AuCpup_DTIME | AuCpup_HOPEN - }; - err = au_sio_cpup_simple(&cpg); - if (!err) - a->h_path.dentry = au_h_dptr(dentry, a->btgt); - } else if (!hi_wh) - a->h_path.dentry = au_h_dptr(dentry, a->btgt); - else - a->h_path.dentry = hi_wh; /* do not dget here */ - -out_unlock: - a->h_inode = a->h_path.dentry->d_inode; - if (!err) - goto out; /* success */ - au_unpin(&a->pin); -out_parent: - if (parent) { - di_write_unlock(parent); - dput(parent); - } -out: - if (!err) - mutex_lock_nested(&a->h_inode->i_mutex, AuLsc_I_CHILD); - return err; -} - -static int aufs_setattr(struct dentry *dentry, struct iattr *ia) -{ - int err; - struct inode *inode; - struct super_block *sb; - struct file *file; - struct au_icpup_args *a; - - inode = dentry->d_inode; - IMustLock(inode); - - err = -ENOMEM; - a = kzalloc(sizeof(*a), GFP_NOFS); - if (unlikely(!a)) - goto out; - - if (ia->ia_valid & (ATTR_KILL_SUID | ATTR_KILL_SGID)) - ia->ia_valid &= ~ATTR_MODE; - - file = NULL; - sb = dentry->d_sb; - err = si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLM); - if (unlikely(err)) - goto out_kfree; - - if (ia->ia_valid & ATTR_FILE) { - /* currently ftruncate(2) only */ - AuDebugOn(!S_ISREG(inode->i_mode)); - file = ia->ia_file; - err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1); - if (unlikely(err)) - goto out_si; - ia->ia_file = au_hf_top(file); - a->udba = AuOpt_UDBA_NONE; - } else { - /* fchmod() doesn't pass ia_file */ - a->udba = au_opt_udba(sb); - di_write_lock_child(dentry); - /* no d_unlinked(), to set UDBA_NONE for root */ - if (d_unhashed(dentry)) - a->udba = AuOpt_UDBA_NONE; - if (a->udba != AuOpt_UDBA_NONE) { - AuDebugOn(IS_ROOT(dentry)); - err = au_reval_for_attr(dentry, au_sigen(sb)); - if (unlikely(err)) - goto out_dentry; - } - } - - err = au_pin_and_icpup(dentry, ia, a); - if (unlikely(err < 0)) - goto out_dentry; - if (au_ftest_icpup(a->flags, DID_CPUP)) { - ia->ia_file = NULL; - ia->ia_valid &= ~ATTR_FILE; - } - - a->h_path.mnt = au_sbr_mnt(sb, a->btgt); - if ((ia->ia_valid & (ATTR_MODE | ATTR_CTIME)) - == (ATTR_MODE | ATTR_CTIME)) { - err = security_path_chmod(&a->h_path, ia->ia_mode); - if (unlikely(err)) - goto out_unlock; - } else if ((ia->ia_valid & (ATTR_UID | ATTR_GID)) - && (ia->ia_valid & ATTR_CTIME)) { - err = security_path_chown(&a->h_path, ia->ia_uid, ia->ia_gid); - if (unlikely(err)) - goto out_unlock; - } - - if (ia->ia_valid & ATTR_SIZE) { - struct file *f; - - if (ia->ia_size < i_size_read(inode)) - /* unmap only */ - truncate_setsize(inode, ia->ia_size); - - f = NULL; - if (ia->ia_valid & ATTR_FILE) - f = ia->ia_file; - mutex_unlock(&a->h_inode->i_mutex); - err = vfsub_trunc(&a->h_path, ia->ia_size, ia->ia_valid, f); - mutex_lock_nested(&a->h_inode->i_mutex, AuLsc_I_CHILD); - } else - err = vfsub_notify_change(&a->h_path, ia); - if (!err) - au_cpup_attr_changeable(inode); - -out_unlock: - mutex_unlock(&a->h_inode->i_mutex); - au_unpin(&a->pin); - if (unlikely(err)) - au_update_dbstart(dentry); -out_dentry: - di_write_unlock(dentry); - if (file) { - fi_write_unlock(file); - ia->ia_file = file; - ia->ia_valid |= ATTR_FILE; - } -out_si: - si_read_unlock(sb); -out_kfree: - kfree(a); -out: - AuTraceErr(err); - return err; -} - -static void au_refresh_iattr(struct inode *inode, struct kstat *st, - unsigned int nlink) -{ - unsigned int n; - - inode->i_mode = st->mode; - /* don't i_[ug]id_write() here */ - inode->i_uid = st->uid; - inode->i_gid = st->gid; - inode->i_atime = st->atime; - inode->i_mtime = st->mtime; - inode->i_ctime = st->ctime; - - au_cpup_attr_nlink(inode, /*force*/0); - if (S_ISDIR(inode->i_mode)) { - n = inode->i_nlink; - n -= nlink; - n += st->nlink; - smp_mb(); /* for i_nlink */ - /* 0 can happen */ - set_nlink(inode, n); - } - - spin_lock(&inode->i_lock); - inode->i_blocks = st->blocks; - i_size_write(inode, st->size); - spin_unlock(&inode->i_lock); -} - -/* - * common routine for aufs_getattr() and aufs_getxattr(). - * returns zero or negative (an error). - * @dentry will be read-locked in success. - */ -int au_h_path_getattr(struct dentry *dentry, int force, struct path *h_path) -{ - int err; - unsigned int mnt_flags, sigen; - unsigned char udba_none; - aufs_bindex_t bindex; - struct super_block *sb, *h_sb; - struct inode *inode; - - h_path->mnt = NULL; - h_path->dentry = NULL; - - err = 0; - sb = dentry->d_sb; - mnt_flags = au_mntflags(sb); - udba_none = !!au_opt_test(mnt_flags, UDBA_NONE); - - /* support fstat(2) */ - if (!d_unlinked(dentry) && !udba_none) { - sigen = au_sigen(sb); - err = au_digen_test(dentry, sigen); - if (!err) { - di_read_lock_child(dentry, AuLock_IR); - err = au_dbrange_test(dentry); - if (unlikely(err)) { - di_read_unlock(dentry, AuLock_IR); - goto out; - } - } else { - AuDebugOn(IS_ROOT(dentry)); - di_write_lock_child(dentry); - err = au_dbrange_test(dentry); - if (!err) - err = au_reval_for_attr(dentry, sigen); - if (!err) - di_downgrade_lock(dentry, AuLock_IR); - else { - di_write_unlock(dentry); - goto out; - } - } - } else - di_read_lock_child(dentry, AuLock_IR); - - inode = dentry->d_inode; - bindex = au_ibstart(inode); - h_path->mnt = au_sbr_mnt(sb, bindex); - h_sb = h_path->mnt->mnt_sb; - if (!force - && !au_test_fs_bad_iattr(h_sb) - && udba_none) - goto out; /* success */ - - if (au_dbstart(dentry) == bindex) - h_path->dentry = au_h_dptr(dentry, bindex); - else if (au_opt_test(mnt_flags, PLINK) && au_plink_test(inode)) { - h_path->dentry = au_plink_lkup(inode, bindex); - if (IS_ERR(h_path->dentry)) - /* pretending success */ - h_path->dentry = NULL; - else - dput(h_path->dentry); - } - -out: - return err; -} - -static int aufs_getattr(struct vfsmount *mnt __maybe_unused, - struct dentry *dentry, struct kstat *st) -{ - int err; - unsigned char positive; - struct path h_path; - struct inode *inode; - struct super_block *sb; - - inode = dentry->d_inode; - sb = dentry->d_sb; - err = si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLM); - if (unlikely(err)) - goto out; - err = au_h_path_getattr(dentry, /*force*/0, &h_path); - if (unlikely(err)) - goto out_si; - if (unlikely(!h_path.dentry)) - /* illegally overlapped or something */ - goto out_fill; /* pretending success */ - - positive = !!h_path.dentry->d_inode; - if (positive) - err = vfs_getattr(&h_path, st); - if (!err) { - if (positive) - au_refresh_iattr(inode, st, - h_path.dentry->d_inode->i_nlink); - goto out_fill; /* success */ - } - AuTraceErr(err); - goto out_di; - -out_fill: - generic_fillattr(inode, st); -out_di: - di_read_unlock(dentry, AuLock_IR); -out_si: - si_read_unlock(sb); -out: - AuTraceErr(err); - return err; -} - -/* ---------------------------------------------------------------------- */ - -static int h_readlink(struct dentry *dentry, int bindex, char __user *buf, - int bufsiz) -{ - int err; - struct super_block *sb; - struct dentry *h_dentry; - - err = -EINVAL; - h_dentry = au_h_dptr(dentry, bindex); - if (unlikely(!h_dentry->d_inode->i_op->readlink)) - goto out; - - err = security_inode_readlink(h_dentry); - if (unlikely(err)) - goto out; - - sb = dentry->d_sb; - if (!au_test_ro(sb, bindex, dentry->d_inode)) { - vfsub_touch_atime(au_sbr_mnt(sb, bindex), h_dentry); - fsstack_copy_attr_atime(dentry->d_inode, h_dentry->d_inode); - } - err = h_dentry->d_inode->i_op->readlink(h_dentry, buf, bufsiz); - -out: - return err; -} - -static int aufs_readlink(struct dentry *dentry, char __user *buf, int bufsiz) -{ - int err; - - err = aufs_read_lock(dentry, AuLock_IR | AuLock_GEN); - if (unlikely(err)) - goto out; - err = au_d_hashed_positive(dentry); - if (!err) - err = h_readlink(dentry, au_dbstart(dentry), buf, bufsiz); - aufs_read_unlock(dentry, AuLock_IR); - -out: - return err; -} - -static void *aufs_follow_link(struct dentry *dentry, struct nameidata *nd) -{ - int err; - mm_segment_t old_fs; - union { - char *k; - char __user *u; - } buf; - - err = -ENOMEM; - buf.k = (void *)__get_free_page(GFP_NOFS); - if (unlikely(!buf.k)) - goto out; - - err = aufs_read_lock(dentry, AuLock_IR | AuLock_GEN); - if (unlikely(err)) - goto out_name; - - err = au_d_hashed_positive(dentry); - if (!err) { - old_fs = get_fs(); - set_fs(KERNEL_DS); - err = h_readlink(dentry, au_dbstart(dentry), buf.u, PATH_MAX); - set_fs(old_fs); - } - aufs_read_unlock(dentry, AuLock_IR); - - if (err >= 0) { - buf.k[err] = 0; - /* will be freed by put_link */ - nd_set_link(nd, buf.k); - return NULL; /* success */ - } - -out_name: - free_page((unsigned long)buf.k); -out: - AuTraceErr(err); - return ERR_PTR(err); -} - -static void aufs_put_link(struct dentry *dentry __maybe_unused, - struct nameidata *nd, void *cookie __maybe_unused) -{ - char *p; - - p = nd_get_link(nd); - if (!IS_ERR_OR_NULL(p)) - free_page((unsigned long)p); -} - -/* ---------------------------------------------------------------------- */ - -static int aufs_update_time(struct inode *inode, struct timespec *ts, int flags) -{ - int err; - struct super_block *sb; - struct inode *h_inode; - - sb = inode->i_sb; - /* mmap_sem might be acquired already, cf. aufs_mmap() */ - lockdep_off(); - si_read_lock(sb, AuLock_FLUSH); - ii_write_lock_child(inode); - lockdep_on(); - h_inode = au_h_iptr(inode, au_ibstart(inode)); - err = vfsub_update_time(h_inode, ts, flags); - lockdep_off(); - if (!err) - au_cpup_attr_timesizes(inode); - ii_write_unlock(inode); - si_read_unlock(sb); - lockdep_on(); - - if (!err && (flags & S_VERSION)) - inode_inc_iversion(inode); - - return err; -} - -/* ---------------------------------------------------------------------- */ - -struct inode_operations aufs_symlink_iop = { - .permission = aufs_permission, -#ifdef CONFIG_FS_POSIX_ACL - .get_acl = aufs_get_acl, -#endif - - .setattr = aufs_setattr, - .getattr = aufs_getattr, - -#ifdef CONFIG_AUFS_XATTR - .setxattr = aufs_setxattr, - .getxattr = aufs_getxattr, - .listxattr = aufs_listxattr, - .removexattr = aufs_removexattr, -#endif - - .readlink = aufs_readlink, - .follow_link = aufs_follow_link, - .put_link = aufs_put_link, - - /* .update_time = aufs_update_time */ -}; - -struct inode_operations aufs_dir_iop = { - .create = aufs_create, - .lookup = aufs_lookup, - .link = aufs_link, - .unlink = aufs_unlink, - .symlink = aufs_symlink, - .mkdir = aufs_mkdir, - .rmdir = aufs_rmdir, - .mknod = aufs_mknod, - .rename = aufs_rename, - - .permission = aufs_permission, -#ifdef CONFIG_FS_POSIX_ACL - .get_acl = aufs_get_acl, -#endif - - .setattr = aufs_setattr, - .getattr = aufs_getattr, - -#ifdef CONFIG_AUFS_XATTR - .setxattr = aufs_setxattr, - .getxattr = aufs_getxattr, - .listxattr = aufs_listxattr, - .removexattr = aufs_removexattr, -#endif - - .update_time = aufs_update_time - /* no support for atomic_open() */ -}; - -struct inode_operations aufs_iop = { - .permission = aufs_permission, -#ifdef CONFIG_FS_POSIX_ACL - .get_acl = aufs_get_acl, -#endif - - .setattr = aufs_setattr, - .getattr = aufs_getattr, - -#ifdef CONFIG_AUFS_XATTR - .setxattr = aufs_setxattr, - .getxattr = aufs_getxattr, - .listxattr = aufs_listxattr, - .removexattr = aufs_removexattr, -#endif - - .update_time = aufs_update_time -}; diff --git a/fs/aufs/i_op_add.c b/fs/aufs/i_op_add.c deleted file mode 100644 index dee3b9606eeae3..00000000000000 --- a/fs/aufs/i_op_add.c +++ /dev/null @@ -1,750 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * inode operations (add entry) - */ - -#include "aufs.h" - -/* - * final procedure of adding a new entry, except link(2). - * remove whiteout, instantiate, copyup the parent dir's times and size - * and update version. - * if it failed, re-create the removed whiteout. - */ -static int epilog(struct inode *dir, aufs_bindex_t bindex, - struct dentry *wh_dentry, struct dentry *dentry) -{ - int err, rerr; - aufs_bindex_t bwh; - struct path h_path; - struct super_block *sb; - struct inode *inode, *h_dir; - struct dentry *wh; - - bwh = -1; - sb = dir->i_sb; - if (wh_dentry) { - h_dir = wh_dentry->d_parent->d_inode; /* dir inode is locked */ - IMustLock(h_dir); - AuDebugOn(au_h_iptr(dir, bindex) != h_dir); - bwh = au_dbwh(dentry); - h_path.dentry = wh_dentry; - h_path.mnt = au_sbr_mnt(sb, bindex); - err = au_wh_unlink_dentry(au_h_iptr(dir, bindex), &h_path, - dentry); - if (unlikely(err)) - goto out; - } - - inode = au_new_inode(dentry, /*must_new*/1); - if (!IS_ERR(inode)) { - d_instantiate(dentry, inode); - dir = dentry->d_parent->d_inode; /* dir inode is locked */ - IMustLock(dir); - if (au_ibstart(dir) == au_dbstart(dentry)) - au_cpup_attr_timesizes(dir); - dir->i_version++; - au_fhsm_wrote(sb, bindex, /*force*/0); - return 0; /* success */ - } - - err = PTR_ERR(inode); - if (!wh_dentry) - goto out; - - /* revert */ - /* dir inode is locked */ - wh = au_wh_create(dentry, bwh, wh_dentry->d_parent); - rerr = PTR_ERR(wh); - if (IS_ERR(wh)) { - AuIOErr("%.*s reverting whiteout failed(%d, %d)\n", - AuDLNPair(dentry), err, rerr); - err = -EIO; - } else - dput(wh); - -out: - return err; -} - -static int au_d_may_add(struct dentry *dentry) -{ - int err; - - err = 0; - if (unlikely(d_unhashed(dentry))) - err = -ENOENT; - if (unlikely(dentry->d_inode)) - err = -EEXIST; - return err; -} - -/* - * simple tests for the adding inode operations. - * following the checks in vfs, plus the parent-child relationship. - */ -int au_may_add(struct dentry *dentry, aufs_bindex_t bindex, - struct dentry *h_parent, int isdir) -{ - int err; - umode_t h_mode; - struct dentry *h_dentry; - struct inode *h_inode; - - err = -ENAMETOOLONG; - if (unlikely(dentry->d_name.len > AUFS_MAX_NAMELEN)) - goto out; - - h_dentry = au_h_dptr(dentry, bindex); - h_inode = h_dentry->d_inode; - if (!dentry->d_inode) { - err = -EEXIST; - if (unlikely(h_inode)) - goto out; - } else { - /* rename(2) case */ - err = -EIO; - if (unlikely(!h_inode || !h_inode->i_nlink)) - goto out; - - h_mode = h_inode->i_mode; - if (!isdir) { - err = -EISDIR; - if (unlikely(S_ISDIR(h_mode))) - goto out; - } else if (unlikely(!S_ISDIR(h_mode))) { - err = -ENOTDIR; - goto out; - } - } - - err = 0; - /* expected parent dir is locked */ - if (unlikely(h_parent != h_dentry->d_parent)) - err = -EIO; - -out: - AuTraceErr(err); - return err; -} - -/* - * initial procedure of adding a new entry. - * prepare writable branch and the parent dir, lock it, - * and lookup whiteout for the new entry. - */ -static struct dentry* -lock_hdir_lkup_wh(struct dentry *dentry, struct au_dtime *dt, - struct dentry *src_dentry, struct au_pin *pin, - struct au_wr_dir_args *wr_dir_args) -{ - struct dentry *wh_dentry, *h_parent; - struct super_block *sb; - struct au_branch *br; - int err; - unsigned int udba; - aufs_bindex_t bcpup; - - AuDbg("%.*s\n", AuDLNPair(dentry)); - - err = au_wr_dir(dentry, src_dentry, wr_dir_args); - bcpup = err; - wh_dentry = ERR_PTR(err); - if (unlikely(err < 0)) - goto out; - - sb = dentry->d_sb; - udba = au_opt_udba(sb); - err = au_pin(pin, dentry, bcpup, udba, - AuPin_DI_LOCKED | AuPin_MNT_WRITE); - wh_dentry = ERR_PTR(err); - if (unlikely(err)) - goto out; - - h_parent = au_pinned_h_parent(pin); - if (udba != AuOpt_UDBA_NONE - && au_dbstart(dentry) == bcpup) - err = au_may_add(dentry, bcpup, h_parent, - au_ftest_wrdir(wr_dir_args->flags, ISDIR)); - else if (unlikely(dentry->d_name.len > AUFS_MAX_NAMELEN)) - err = -ENAMETOOLONG; - wh_dentry = ERR_PTR(err); - if (unlikely(err)) - goto out_unpin; - - br = au_sbr(sb, bcpup); - if (dt) { - struct path tmp = { - .dentry = h_parent, - .mnt = au_br_mnt(br) - }; - au_dtime_store(dt, au_pinned_parent(pin), &tmp); - } - - wh_dentry = NULL; - if (bcpup != au_dbwh(dentry)) - goto out; /* success */ - - wh_dentry = au_wh_lkup(h_parent, &dentry->d_name, br); - -out_unpin: - if (IS_ERR(wh_dentry)) - au_unpin(pin); -out: - return wh_dentry; -} - -/* ---------------------------------------------------------------------- */ - -enum { Mknod, Symlink, Creat }; -struct simple_arg { - int type; - union { - struct { - umode_t mode; - bool want_excl; - } c; - struct { - const char *symname; - } s; - struct { - umode_t mode; - dev_t dev; - } m; - } u; -}; - -static int add_simple(struct inode *dir, struct dentry *dentry, - struct simple_arg *arg) -{ - int err, rerr; - aufs_bindex_t bstart; - unsigned char created; - struct dentry *wh_dentry, *parent; - struct inode *h_dir; - /* to reuduce stack size */ - struct { - struct au_dtime dt; - struct au_pin pin; - struct path h_path; - struct au_wr_dir_args wr_dir_args; - } *a; - - AuDbg("%.*s\n", AuDLNPair(dentry)); - IMustLock(dir); - - err = -ENOMEM; - a = kmalloc(sizeof(*a), GFP_NOFS); - if (unlikely(!a)) - goto out; - a->wr_dir_args.force_btgt = -1; - a->wr_dir_args.flags = AuWrDir_ADD_ENTRY; - - parent = dentry->d_parent; /* dir inode is locked */ - err = aufs_read_lock(dentry, AuLock_DW | AuLock_GEN); - if (unlikely(err)) - goto out_free; - err = au_d_may_add(dentry); - if (unlikely(err)) - goto out_unlock; - di_write_lock_parent(parent); - wh_dentry = lock_hdir_lkup_wh(dentry, &a->dt, /*src_dentry*/NULL, - &a->pin, &a->wr_dir_args); - err = PTR_ERR(wh_dentry); - if (IS_ERR(wh_dentry)) - goto out_parent; - - bstart = au_dbstart(dentry); - a->h_path.dentry = au_h_dptr(dentry, bstart); - a->h_path.mnt = au_sbr_mnt(dentry->d_sb, bstart); - h_dir = au_pinned_h_dir(&a->pin); - switch (arg->type) { - case Creat: - err = vfsub_create(h_dir, &a->h_path, arg->u.c.mode, - arg->u.c.want_excl); - break; - case Symlink: - err = vfsub_symlink(h_dir, &a->h_path, arg->u.s.symname); - break; - case Mknod: - err = vfsub_mknod(h_dir, &a->h_path, arg->u.m.mode, - arg->u.m.dev); - break; - default: - BUG(); - } - created = !err; - if (!err) - err = epilog(dir, bstart, wh_dentry, dentry); - - /* revert */ - if (unlikely(created && err && a->h_path.dentry->d_inode)) { - rerr = vfsub_unlink(h_dir, &a->h_path, /*force*/0); - if (rerr) { - AuIOErr("%.*s revert failure(%d, %d)\n", - AuDLNPair(dentry), err, rerr); - err = -EIO; - } - au_dtime_revert(&a->dt); - } - - au_unpin(&a->pin); - dput(wh_dentry); - -out_parent: - di_write_unlock(parent); -out_unlock: - if (unlikely(err)) { - au_update_dbstart(dentry); - d_drop(dentry); - } - aufs_read_unlock(dentry, AuLock_DW); -out_free: - kfree(a); -out: - return err; -} - -int aufs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, - dev_t dev) -{ - struct simple_arg arg = { - .type = Mknod, - .u.m = { - .mode = mode, - .dev = dev - } - }; - return add_simple(dir, dentry, &arg); -} - -int aufs_symlink(struct inode *dir, struct dentry *dentry, const char *symname) -{ - struct simple_arg arg = { - .type = Symlink, - .u.s.symname = symname - }; - return add_simple(dir, dentry, &arg); -} - -int aufs_create(struct inode *dir, struct dentry *dentry, umode_t mode, - bool want_excl) -{ - struct simple_arg arg = { - .type = Creat, - .u.c = { - .mode = mode, - .want_excl = want_excl - } - }; - return add_simple(dir, dentry, &arg); -} - -/* ---------------------------------------------------------------------- */ - -struct au_link_args { - aufs_bindex_t bdst, bsrc; - struct au_pin pin; - struct path h_path; - struct dentry *src_parent, *parent; -}; - -static int au_cpup_before_link(struct dentry *src_dentry, - struct au_link_args *a) -{ - int err; - struct dentry *h_src_dentry; - struct au_cp_generic cpg = { - .dentry = src_dentry, - .bdst = a->bdst, - .bsrc = a->bsrc, - .len = -1, - .pin = &a->pin, - .flags = AuCpup_DTIME | AuCpup_HOPEN /* | AuCpup_KEEPLINO */ - }; - - di_read_lock_parent(a->src_parent, AuLock_IR); - err = au_test_and_cpup_dirs(src_dentry, a->bdst); - if (unlikely(err)) - goto out; - - h_src_dentry = au_h_dptr(src_dentry, a->bsrc); - err = au_pin(&a->pin, src_dentry, a->bdst, - au_opt_udba(src_dentry->d_sb), - AuPin_DI_LOCKED | AuPin_MNT_WRITE); - if (unlikely(err)) - goto out; - - err = au_sio_cpup_simple(&cpg); - au_unpin(&a->pin); - -out: - di_read_unlock(a->src_parent, AuLock_IR); - return err; -} - -static int au_cpup_or_link(struct dentry *src_dentry, struct dentry *dentry, - struct au_link_args *a) -{ - int err; - unsigned char plink; - aufs_bindex_t bend; - struct dentry *h_src_dentry; - struct inode *h_inode, *inode; - struct super_block *sb; - struct file *h_file; - - plink = 0; - h_inode = NULL; - sb = src_dentry->d_sb; - inode = src_dentry->d_inode; - if (au_ibstart(inode) <= a->bdst) - h_inode = au_h_iptr(inode, a->bdst); - if (!h_inode || !h_inode->i_nlink) { - /* copyup src_dentry as the name of dentry. */ - bend = au_dbend(dentry); - if (bend < a->bsrc) - au_set_dbend(dentry, a->bsrc); - au_set_h_dptr(dentry, a->bsrc, - dget(au_h_dptr(src_dentry, a->bsrc))); - dget(a->h_path.dentry); - au_set_h_dptr(dentry, a->bdst, NULL); - AuDbg("temporary d_inode...\n"); - spin_lock(&dentry->d_lock); - dentry->d_inode = src_dentry->d_inode; /* tmp */ - spin_unlock(&dentry->d_lock); - h_file = au_h_open_pre(dentry, a->bsrc, /*force_wr*/0); - if (IS_ERR(h_file)) - err = PTR_ERR(h_file); - else { - struct au_cp_generic cpg = { - .dentry = dentry, - .bdst = a->bdst, - .bsrc = -1, - .len = -1, - .pin = &a->pin, - .flags = AuCpup_KEEPLINO - }; - err = au_sio_cpup_simple(&cpg); - au_h_open_post(dentry, a->bsrc, h_file); - if (!err) { - dput(a->h_path.dentry); - a->h_path.dentry = au_h_dptr(dentry, a->bdst); - } else - au_set_h_dptr(dentry, a->bdst, - a->h_path.dentry); - } - spin_lock(&dentry->d_lock); - dentry->d_inode = NULL; /* restore */ - spin_unlock(&dentry->d_lock); - AuDbg("temporary d_inode...done\n"); - au_set_h_dptr(dentry, a->bsrc, NULL); - au_set_dbend(dentry, bend); - } else { - /* the inode of src_dentry already exists on a.bdst branch */ - h_src_dentry = d_find_alias(h_inode); - if (!h_src_dentry && au_plink_test(inode)) { - plink = 1; - h_src_dentry = au_plink_lkup(inode, a->bdst); - err = PTR_ERR(h_src_dentry); - if (IS_ERR(h_src_dentry)) - goto out; - - if (unlikely(!h_src_dentry->d_inode)) { - dput(h_src_dentry); - h_src_dentry = NULL; - } - - } - if (h_src_dentry) { - err = vfsub_link(h_src_dentry, au_pinned_h_dir(&a->pin), - &a->h_path); - dput(h_src_dentry); - } else { - AuIOErr("no dentry found for hi%lu on b%d\n", - h_inode->i_ino, a->bdst); - err = -EIO; - } - } - - if (!err && !plink) - au_plink_append(inode, a->bdst, a->h_path.dentry); - -out: - AuTraceErr(err); - return err; -} - -int aufs_link(struct dentry *src_dentry, struct inode *dir, - struct dentry *dentry) -{ - int err, rerr; - struct au_dtime dt; - struct au_link_args *a; - struct dentry *wh_dentry, *h_src_dentry; - struct inode *inode; - struct super_block *sb; - struct au_wr_dir_args wr_dir_args = { - /* .force_btgt = -1, */ - .flags = AuWrDir_ADD_ENTRY - }; - - IMustLock(dir); - inode = src_dentry->d_inode; - IMustLock(inode); - - err = -ENOMEM; - a = kzalloc(sizeof(*a), GFP_NOFS); - if (unlikely(!a)) - goto out; - - a->parent = dentry->d_parent; /* dir inode is locked */ - err = aufs_read_and_write_lock2(dentry, src_dentry, - AuLock_NOPLM | AuLock_GEN); - if (unlikely(err)) - goto out_kfree; - err = au_d_hashed_positive(src_dentry); - if (unlikely(err)) - goto out_unlock; - err = au_d_may_add(dentry); - if (unlikely(err)) - goto out_unlock; - - a->src_parent = dget_parent(src_dentry); - wr_dir_args.force_btgt = au_ibstart(inode); - - di_write_lock_parent(a->parent); - wr_dir_args.force_btgt = au_wbr(dentry, wr_dir_args.force_btgt); - wh_dentry = lock_hdir_lkup_wh(dentry, &dt, src_dentry, &a->pin, - &wr_dir_args); - err = PTR_ERR(wh_dentry); - if (IS_ERR(wh_dentry)) - goto out_parent; - - err = 0; - sb = dentry->d_sb; - a->bdst = au_dbstart(dentry); - a->h_path.dentry = au_h_dptr(dentry, a->bdst); - a->h_path.mnt = au_sbr_mnt(sb, a->bdst); - a->bsrc = au_ibstart(inode); - h_src_dentry = au_h_d_alias(src_dentry, a->bsrc); - if (!h_src_dentry) { - a->bsrc = au_dbstart(src_dentry); - h_src_dentry = au_h_d_alias(src_dentry, a->bsrc); - AuDebugOn(!h_src_dentry); - } else if (IS_ERR(h_src_dentry)) { - err = PTR_ERR(h_src_dentry); - goto out_parent; - } - - if (au_opt_test(au_mntflags(sb), PLINK)) { - if (a->bdst < a->bsrc - /* && h_src_dentry->d_sb != a->h_path.dentry->d_sb */) - err = au_cpup_or_link(src_dentry, dentry, a); - else - err = vfsub_link(h_src_dentry, au_pinned_h_dir(&a->pin), - &a->h_path); - dput(h_src_dentry); - } else { - /* - * copyup src_dentry to the branch we process, - * and then link(2) to it. - */ - dput(h_src_dentry); - if (a->bdst < a->bsrc - /* && h_src_dentry->d_sb != a->h_path.dentry->d_sb */) { - au_unpin(&a->pin); - di_write_unlock(a->parent); - err = au_cpup_before_link(src_dentry, a); - di_write_lock_parent(a->parent); - if (!err) - err = au_pin(&a->pin, dentry, a->bdst, - au_opt_udba(sb), - AuPin_DI_LOCKED | AuPin_MNT_WRITE); - if (unlikely(err)) - goto out_wh; - } - if (!err) { - h_src_dentry = au_h_dptr(src_dentry, a->bdst); - err = -ENOENT; - if (h_src_dentry && h_src_dentry->d_inode) - err = vfsub_link(h_src_dentry, - au_pinned_h_dir(&a->pin), - &a->h_path); - } - } - if (unlikely(err)) - goto out_unpin; - - if (wh_dentry) { - a->h_path.dentry = wh_dentry; - err = au_wh_unlink_dentry(au_pinned_h_dir(&a->pin), &a->h_path, - dentry); - if (unlikely(err)) - goto out_revert; - } - - dir->i_version++; - if (au_ibstart(dir) == au_dbstart(dentry)) - au_cpup_attr_timesizes(dir); - inc_nlink(inode); - inode->i_ctime = dir->i_ctime; - d_instantiate(dentry, au_igrab(inode)); - if (d_unhashed(a->h_path.dentry)) - /* some filesystem calls d_drop() */ - d_drop(dentry); - /* some filesystems consume an inode even hardlink */ - au_fhsm_wrote(sb, a->bdst, /*force*/0); - goto out_unpin; /* success */ - -out_revert: - rerr = vfsub_unlink(au_pinned_h_dir(&a->pin), &a->h_path, /*force*/0); - if (unlikely(rerr)) { - AuIOErr("%.*s reverting failed(%d, %d)\n", - AuDLNPair(dentry), err, rerr); - err = -EIO; - } - au_dtime_revert(&dt); -out_unpin: - au_unpin(&a->pin); -out_wh: - dput(wh_dentry); -out_parent: - di_write_unlock(a->parent); - dput(a->src_parent); -out_unlock: - if (unlikely(err)) { - au_update_dbstart(dentry); - d_drop(dentry); - } - aufs_read_and_write_unlock2(dentry, src_dentry); -out_kfree: - kfree(a); -out: - AuTraceErr(err); - return err; -} - -int aufs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) -{ - int err, rerr; - aufs_bindex_t bindex; - unsigned char diropq; - struct path h_path; - struct dentry *wh_dentry, *parent, *opq_dentry; - struct mutex *h_mtx; - struct super_block *sb; - struct { - struct au_pin pin; - struct au_dtime dt; - } *a; /* reduce the stack usage */ - struct au_wr_dir_args wr_dir_args = { - .force_btgt = -1, - .flags = AuWrDir_ADD_ENTRY | AuWrDir_ISDIR - }; - - IMustLock(dir); - - err = -ENOMEM; - a = kmalloc(sizeof(*a), GFP_NOFS); - if (unlikely(!a)) - goto out; - - err = aufs_read_lock(dentry, AuLock_DW | AuLock_GEN); - if (unlikely(err)) - goto out_free; - err = au_d_may_add(dentry); - if (unlikely(err)) - goto out_unlock; - - parent = dentry->d_parent; /* dir inode is locked */ - di_write_lock_parent(parent); - wh_dentry = lock_hdir_lkup_wh(dentry, &a->dt, /*src_dentry*/NULL, - &a->pin, &wr_dir_args); - err = PTR_ERR(wh_dentry); - if (IS_ERR(wh_dentry)) - goto out_parent; - - sb = dentry->d_sb; - bindex = au_dbstart(dentry); - h_path.dentry = au_h_dptr(dentry, bindex); - h_path.mnt = au_sbr_mnt(sb, bindex); - err = vfsub_mkdir(au_pinned_h_dir(&a->pin), &h_path, mode); - if (unlikely(err)) - goto out_unpin; - - /* make the dir opaque */ - diropq = 0; - h_mtx = &h_path.dentry->d_inode->i_mutex; - if (wh_dentry - || au_opt_test(au_mntflags(sb), ALWAYS_DIROPQ)) { - mutex_lock_nested(h_mtx, AuLsc_I_CHILD); - opq_dentry = au_diropq_create(dentry, bindex); - mutex_unlock(h_mtx); - err = PTR_ERR(opq_dentry); - if (IS_ERR(opq_dentry)) - goto out_dir; - dput(opq_dentry); - diropq = 1; - } - - err = epilog(dir, bindex, wh_dentry, dentry); - if (!err) { - inc_nlink(dir); - goto out_unpin; /* success */ - } - - /* revert */ - if (diropq) { - AuLabel(revert opq); - mutex_lock_nested(h_mtx, AuLsc_I_CHILD); - rerr = au_diropq_remove(dentry, bindex); - mutex_unlock(h_mtx); - if (rerr) { - AuIOErr("%.*s reverting diropq failed(%d, %d)\n", - AuDLNPair(dentry), err, rerr); - err = -EIO; - } - } - -out_dir: - AuLabel(revert dir); - rerr = vfsub_rmdir(au_pinned_h_dir(&a->pin), &h_path); - if (rerr) { - AuIOErr("%.*s reverting dir failed(%d, %d)\n", - AuDLNPair(dentry), err, rerr); - err = -EIO; - } - au_dtime_revert(&a->dt); -out_unpin: - au_unpin(&a->pin); - dput(wh_dentry); -out_parent: - di_write_unlock(parent); -out_unlock: - if (unlikely(err)) { - au_update_dbstart(dentry); - d_drop(dentry); - } - aufs_read_unlock(dentry, AuLock_DW); -out_free: - kfree(a); -out: - return err; -} diff --git a/fs/aufs/i_op_del.c b/fs/aufs/i_op_del.c deleted file mode 100644 index 7385d0e3c1f242..00000000000000 --- a/fs/aufs/i_op_del.c +++ /dev/null @@ -1,502 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * inode operations (del entry) - */ - -#include "aufs.h" - -/* - * decide if a new whiteout for @dentry is necessary or not. - * when it is necessary, prepare the parent dir for the upper branch whose - * branch index is @bcpup for creation. the actual creation of the whiteout will - * be done by caller. - * return value: - * 0: wh is unnecessary - * plus: wh is necessary - * minus: error - */ -int au_wr_dir_need_wh(struct dentry *dentry, int isdir, aufs_bindex_t *bcpup) -{ - int need_wh, err; - aufs_bindex_t bstart; - struct super_block *sb; - - sb = dentry->d_sb; - bstart = au_dbstart(dentry); - if (*bcpup < 0) { - *bcpup = bstart; - if (au_test_ro(sb, bstart, dentry->d_inode)) { - err = AuWbrCopyup(au_sbi(sb), dentry); - *bcpup = err; - if (unlikely(err < 0)) - goto out; - } - } else - AuDebugOn(bstart < *bcpup - || au_test_ro(sb, *bcpup, dentry->d_inode)); - AuDbg("bcpup %d, bstart %d\n", *bcpup, bstart); - - if (*bcpup != bstart) { - err = au_cpup_dirs(dentry, *bcpup); - if (unlikely(err)) - goto out; - need_wh = 1; - } else { - struct au_dinfo *dinfo, *tmp; - - need_wh = -ENOMEM; - dinfo = au_di(dentry); - tmp = au_di_alloc(sb, AuLsc_DI_TMP); - if (tmp) { - au_di_cp(tmp, dinfo); - au_di_swap(tmp, dinfo); - /* returns the number of positive dentries */ - need_wh = au_lkup_dentry(dentry, bstart + 1, /*type*/0); - au_di_swap(tmp, dinfo); - au_rw_write_unlock(&tmp->di_rwsem); - au_di_free(tmp); - } - } - AuDbg("need_wh %d\n", need_wh); - err = need_wh; - -out: - return err; -} - -/* - * simple tests for the del-entry operations. - * following the checks in vfs, plus the parent-child relationship. - */ -int au_may_del(struct dentry *dentry, aufs_bindex_t bindex, - struct dentry *h_parent, int isdir) -{ - int err; - umode_t h_mode; - struct dentry *h_dentry, *h_latest; - struct inode *h_inode; - - h_dentry = au_h_dptr(dentry, bindex); - h_inode = h_dentry->d_inode; - if (dentry->d_inode) { - err = -ENOENT; - if (unlikely(!h_inode || !h_inode->i_nlink)) - goto out; - - h_mode = h_inode->i_mode; - if (!isdir) { - err = -EISDIR; - if (unlikely(S_ISDIR(h_mode))) - goto out; - } else if (unlikely(!S_ISDIR(h_mode))) { - err = -ENOTDIR; - goto out; - } - } else { - /* rename(2) case */ - err = -EIO; - if (unlikely(h_inode)) - goto out; - } - - err = -ENOENT; - /* expected parent dir is locked */ - if (unlikely(h_parent != h_dentry->d_parent)) - goto out; - err = 0; - - /* - * rmdir a dir may break the consistency on some filesystem. - * let's try heavy test. - */ - err = -EACCES; - if (unlikely(!au_opt_test(au_mntflags(dentry->d_sb), DIRPERM1) - && au_test_h_perm(h_parent->d_inode, - MAY_EXEC | MAY_WRITE))) - goto out; - - h_latest = au_sio_lkup_one(&dentry->d_name, h_parent); - err = -EIO; - if (IS_ERR(h_latest)) - goto out; - if (h_latest == h_dentry) - err = 0; - dput(h_latest); - -out: - return err; -} - -/* - * decide the branch where we operate for @dentry. the branch index will be set - * @rbcpup. after diciding it, 'pin' it and store the timestamps of the parent - * dir for reverting. - * when a new whiteout is necessary, create it. - */ -static struct dentry* -lock_hdir_create_wh(struct dentry *dentry, int isdir, aufs_bindex_t *rbcpup, - struct au_dtime *dt, struct au_pin *pin) -{ - struct dentry *wh_dentry; - struct super_block *sb; - struct path h_path; - int err, need_wh; - unsigned int udba; - aufs_bindex_t bcpup; - - need_wh = au_wr_dir_need_wh(dentry, isdir, rbcpup); - wh_dentry = ERR_PTR(need_wh); - if (unlikely(need_wh < 0)) - goto out; - - sb = dentry->d_sb; - udba = au_opt_udba(sb); - bcpup = *rbcpup; - err = au_pin(pin, dentry, bcpup, udba, - AuPin_DI_LOCKED | AuPin_MNT_WRITE); - wh_dentry = ERR_PTR(err); - if (unlikely(err)) - goto out; - - h_path.dentry = au_pinned_h_parent(pin); - if (udba != AuOpt_UDBA_NONE - && au_dbstart(dentry) == bcpup) { - err = au_may_del(dentry, bcpup, h_path.dentry, isdir); - wh_dentry = ERR_PTR(err); - if (unlikely(err)) - goto out_unpin; - } - - h_path.mnt = au_sbr_mnt(sb, bcpup); - au_dtime_store(dt, au_pinned_parent(pin), &h_path); - wh_dentry = NULL; - if (!need_wh) - goto out; /* success, no need to create whiteout */ - - wh_dentry = au_wh_create(dentry, bcpup, h_path.dentry); - if (IS_ERR(wh_dentry)) - goto out_unpin; - - /* returns with the parent is locked and wh_dentry is dget-ed */ - goto out; /* success */ - -out_unpin: - au_unpin(pin); -out: - return wh_dentry; -} - -/* - * when removing a dir, rename it to a unique temporary whiteout-ed name first - * in order to be revertible and save time for removing many child whiteouts - * under the dir. - * returns 1 when there are too many child whiteout and caller should remove - * them asynchronously. returns 0 when the number of children is enough small to - * remove now or the branch fs is a remote fs. - * otherwise return an error. - */ -static int renwh_and_rmdir(struct dentry *dentry, aufs_bindex_t bindex, - struct au_nhash *whlist, struct inode *dir) -{ - int rmdir_later, err, dirwh; - struct dentry *h_dentry; - struct super_block *sb; - - sb = dentry->d_sb; - SiMustAnyLock(sb); - h_dentry = au_h_dptr(dentry, bindex); - err = au_whtmp_ren(h_dentry, au_sbr(sb, bindex)); - if (unlikely(err)) - goto out; - - /* stop monitoring */ - au_hn_free(au_hi(dentry->d_inode, bindex)); - - if (!au_test_fs_remote(h_dentry->d_sb)) { - dirwh = au_sbi(sb)->si_dirwh; - rmdir_later = (dirwh <= 1); - if (!rmdir_later) - rmdir_later = au_nhash_test_longer_wh(whlist, bindex, - dirwh); - if (rmdir_later) - return rmdir_later; - } - - err = au_whtmp_rmdir(dir, bindex, h_dentry, whlist); - if (unlikely(err)) { - AuIOErr("rmdir %.*s, b%d failed, %d. ignored\n", - AuDLNPair(h_dentry), bindex, err); - err = 0; - } - -out: - AuTraceErr(err); - return err; -} - -/* - * final procedure for deleting a entry. - * maintain dentry and iattr. - */ -static void epilog(struct inode *dir, struct dentry *dentry, - aufs_bindex_t bindex) -{ - struct inode *inode; - - inode = dentry->d_inode; - d_drop(dentry); - inode->i_ctime = dir->i_ctime; - - if (au_ibstart(dir) == bindex) - au_cpup_attr_timesizes(dir); - dir->i_version++; -} - -/* - * when an error happened, remove the created whiteout and revert everything. - */ -static int do_revert(int err, struct inode *dir, aufs_bindex_t bindex, - aufs_bindex_t bwh, struct dentry *wh_dentry, - struct dentry *dentry, struct au_dtime *dt) -{ - int rerr; - struct path h_path = { - .dentry = wh_dentry, - .mnt = au_sbr_mnt(dir->i_sb, bindex) - }; - - rerr = au_wh_unlink_dentry(au_h_iptr(dir, bindex), &h_path, dentry); - if (!rerr) { - au_set_dbwh(dentry, bwh); - au_dtime_revert(dt); - return 0; - } - - AuIOErr("%.*s reverting whiteout failed(%d, %d)\n", - AuDLNPair(dentry), err, rerr); - return -EIO; -} - -/* ---------------------------------------------------------------------- */ - -int aufs_unlink(struct inode *dir, struct dentry *dentry) -{ - int err; - aufs_bindex_t bwh, bindex, bstart; - struct inode *inode, *h_dir; - struct dentry *parent, *wh_dentry; - /* to reuduce stack size */ - struct { - struct au_dtime dt; - struct au_pin pin; - struct path h_path; - } *a; - - IMustLock(dir); - - err = -ENOMEM; - a = kmalloc(sizeof(*a), GFP_NOFS); - if (unlikely(!a)) - goto out; - - err = aufs_read_lock(dentry, AuLock_DW | AuLock_GEN); - if (unlikely(err)) - goto out_free; - err = au_d_hashed_positive(dentry); - if (unlikely(err)) - goto out_unlock; - inode = dentry->d_inode; - IMustLock(inode); - err = -EISDIR; - if (unlikely(S_ISDIR(inode->i_mode))) - goto out_unlock; /* possible? */ - - bstart = au_dbstart(dentry); - bwh = au_dbwh(dentry); - bindex = -1; - parent = dentry->d_parent; /* dir inode is locked */ - di_write_lock_parent(parent); - wh_dentry = lock_hdir_create_wh(dentry, /*isdir*/0, &bindex, &a->dt, - &a->pin); - err = PTR_ERR(wh_dentry); - if (IS_ERR(wh_dentry)) - goto out_parent; - - a->h_path.mnt = au_sbr_mnt(dentry->d_sb, bstart); - a->h_path.dentry = au_h_dptr(dentry, bstart); - dget(a->h_path.dentry); - if (bindex == bstart) { - h_dir = au_pinned_h_dir(&a->pin); - err = vfsub_unlink(h_dir, &a->h_path, /*force*/0); - } else { - /* dir inode is locked */ - h_dir = wh_dentry->d_parent->d_inode; - IMustLock(h_dir); - err = 0; - } - - if (!err) { - vfsub_drop_nlink(inode); - epilog(dir, dentry, bindex); - - /* update target timestamps */ - if (bindex == bstart) { - vfsub_update_h_iattr(&a->h_path, /*did*/NULL); - /*ignore*/ - inode->i_ctime = a->h_path.dentry->d_inode->i_ctime; - } else - /* todo: this timestamp may be reverted later */ - inode->i_ctime = h_dir->i_ctime; - goto out_unpin; /* success */ - } - - /* revert */ - if (wh_dentry) { - int rerr; - - rerr = do_revert(err, dir, bindex, bwh, wh_dentry, dentry, - &a->dt); - if (rerr) - err = rerr; - } - -out_unpin: - au_unpin(&a->pin); - dput(wh_dentry); - dput(a->h_path.dentry); -out_parent: - di_write_unlock(parent); -out_unlock: - aufs_read_unlock(dentry, AuLock_DW); -out_free: - kfree(a); -out: - return err; -} - -int aufs_rmdir(struct inode *dir, struct dentry *dentry) -{ - int err, rmdir_later; - aufs_bindex_t bwh, bindex, bstart; - struct inode *inode; - struct dentry *parent, *wh_dentry, *h_dentry; - struct au_whtmp_rmdir *args; - /* to reuduce stack size */ - struct { - struct au_dtime dt; - struct au_pin pin; - } *a; - - IMustLock(dir); - - err = -ENOMEM; - a = kmalloc(sizeof(*a), GFP_NOFS); - if (unlikely(!a)) - goto out; - - err = aufs_read_lock(dentry, AuLock_DW | AuLock_FLUSH | AuLock_GEN); - if (unlikely(err)) - goto out_free; - err = au_alive_dir(dentry); - if (unlikely(err)) - goto out_unlock; - inode = dentry->d_inode; - IMustLock(inode); - err = -ENOTDIR; - if (unlikely(!S_ISDIR(inode->i_mode))) - goto out_unlock; /* possible? */ - - err = -ENOMEM; - args = au_whtmp_rmdir_alloc(dir->i_sb, GFP_NOFS); - if (unlikely(!args)) - goto out_unlock; - - parent = dentry->d_parent; /* dir inode is locked */ - di_write_lock_parent(parent); - err = au_test_empty(dentry, &args->whlist); - if (unlikely(err)) - goto out_parent; - - bstart = au_dbstart(dentry); - bwh = au_dbwh(dentry); - bindex = -1; - wh_dentry = lock_hdir_create_wh(dentry, /*isdir*/1, &bindex, &a->dt, - &a->pin); - err = PTR_ERR(wh_dentry); - if (IS_ERR(wh_dentry)) - goto out_parent; - - h_dentry = au_h_dptr(dentry, bstart); - dget(h_dentry); - rmdir_later = 0; - if (bindex == bstart) { - err = renwh_and_rmdir(dentry, bstart, &args->whlist, dir); - if (err > 0) { - rmdir_later = err; - err = 0; - } - } else { - /* stop monitoring */ - au_hn_free(au_hi(inode, bstart)); - - /* dir inode is locked */ - IMustLock(wh_dentry->d_parent->d_inode); - err = 0; - } - - if (!err) { - vfsub_dead_dir(inode); - au_set_dbdiropq(dentry, -1); - epilog(dir, dentry, bindex); - - if (rmdir_later) { - au_whtmp_kick_rmdir(dir, bstart, h_dentry, args); - args = NULL; - } - - goto out_unpin; /* success */ - } - - /* revert */ - AuLabel(revert); - if (wh_dentry) { - int rerr; - - rerr = do_revert(err, dir, bindex, bwh, wh_dentry, dentry, - &a->dt); - if (rerr) - err = rerr; - } - -out_unpin: - au_unpin(&a->pin); - dput(wh_dentry); - dput(h_dentry); -out_parent: - di_write_unlock(parent); - if (args) - au_whtmp_rmdir_free(args); -out_unlock: - aufs_read_unlock(dentry, AuLock_DW); -out_free: - kfree(a); -out: - AuTraceErr(err); - return err; -} diff --git a/fs/aufs/i_op_ren.c b/fs/aufs/i_op_ren.c deleted file mode 100644 index f74802e1090929..00000000000000 --- a/fs/aufs/i_op_ren.c +++ /dev/null @@ -1,1010 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * inode operation (rename entry) - * todo: this is crazy monster - */ - -#include "aufs.h" - -enum { AuSRC, AuDST, AuSrcDst }; -enum { AuPARENT, AuCHILD, AuParentChild }; - -#define AuRen_ISDIR 1 -#define AuRen_ISSAMEDIR (1 << 1) -#define AuRen_WHSRC (1 << 2) -#define AuRen_WHDST (1 << 3) -#define AuRen_MNT_WRITE (1 << 4) -#define AuRen_DT_DSTDIR (1 << 5) -#define AuRen_DIROPQ (1 << 6) -#define AuRen_CPUP (1 << 7) -#define au_ftest_ren(flags, name) ((flags) & AuRen_##name) -#define au_fset_ren(flags, name) \ - do { (flags) |= AuRen_##name; } while (0) -#define au_fclr_ren(flags, name) \ - do { (flags) &= ~AuRen_##name; } while (0) - -struct au_ren_args { - struct { - struct dentry *dentry, *h_dentry, *parent, *h_parent, - *wh_dentry; - struct inode *dir, *inode; - struct au_hinode *hdir; - struct au_dtime dt[AuParentChild]; - aufs_bindex_t bstart; - } sd[AuSrcDst]; - -#define src_dentry sd[AuSRC].dentry -#define src_dir sd[AuSRC].dir -#define src_inode sd[AuSRC].inode -#define src_h_dentry sd[AuSRC].h_dentry -#define src_parent sd[AuSRC].parent -#define src_h_parent sd[AuSRC].h_parent -#define src_wh_dentry sd[AuSRC].wh_dentry -#define src_hdir sd[AuSRC].hdir -#define src_h_dir sd[AuSRC].hdir->hi_inode -#define src_dt sd[AuSRC].dt -#define src_bstart sd[AuSRC].bstart - -#define dst_dentry sd[AuDST].dentry -#define dst_dir sd[AuDST].dir -#define dst_inode sd[AuDST].inode -#define dst_h_dentry sd[AuDST].h_dentry -#define dst_parent sd[AuDST].parent -#define dst_h_parent sd[AuDST].h_parent -#define dst_wh_dentry sd[AuDST].wh_dentry -#define dst_hdir sd[AuDST].hdir -#define dst_h_dir sd[AuDST].hdir->hi_inode -#define dst_dt sd[AuDST].dt -#define dst_bstart sd[AuDST].bstart - - struct dentry *h_trap; - struct au_branch *br; - struct au_hinode *src_hinode; - struct path h_path; - struct au_nhash whlist; - aufs_bindex_t btgt, src_bwh, src_bdiropq; - - unsigned int flags; - - struct au_whtmp_rmdir *thargs; - struct dentry *h_dst; -}; - -/* ---------------------------------------------------------------------- */ - -/* - * functions for reverting. - * when an error happened in a single rename systemcall, we should revert - * everything as if nothing happend. - * we don't need to revert the copied-up/down the parent dir since they are - * harmless. - */ - -#define RevertFailure(fmt, ...) do { \ - AuIOErr("revert failure: " fmt " (%d, %d)\n", \ - ##__VA_ARGS__, err, rerr); \ - err = -EIO; \ -} while (0) - -static void au_ren_rev_diropq(int err, struct au_ren_args *a) -{ - int rerr; - - au_hn_imtx_lock_nested(a->src_hinode, AuLsc_I_CHILD); - rerr = au_diropq_remove(a->src_dentry, a->btgt); - au_hn_imtx_unlock(a->src_hinode); - au_set_dbdiropq(a->src_dentry, a->src_bdiropq); - if (rerr) - RevertFailure("remove diropq %.*s", AuDLNPair(a->src_dentry)); -} - -static void au_ren_rev_rename(int err, struct au_ren_args *a) -{ - int rerr; - - a->h_path.dentry = vfsub_lkup_one(&a->src_dentry->d_name, - a->src_h_parent); - rerr = PTR_ERR(a->h_path.dentry); - if (IS_ERR(a->h_path.dentry)) { - RevertFailure("lkup one %.*s", AuDLNPair(a->src_dentry)); - return; - } - - rerr = vfsub_rename(a->dst_h_dir, - au_h_dptr(a->src_dentry, a->btgt), - a->src_h_dir, &a->h_path); - d_drop(a->h_path.dentry); - dput(a->h_path.dentry); - /* au_set_h_dptr(a->src_dentry, a->btgt, NULL); */ - if (rerr) - RevertFailure("rename %.*s", AuDLNPair(a->src_dentry)); -} - -static void au_ren_rev_cpup(int err, struct au_ren_args *a) -{ - int rerr; - - a->h_path.dentry = a->dst_h_dentry; - rerr = vfsub_unlink(a->dst_h_dir, &a->h_path, /*force*/0); - au_set_h_dptr(a->src_dentry, a->btgt, NULL); - au_set_dbstart(a->src_dentry, a->src_bstart); - if (rerr) - RevertFailure("unlink %.*s", AuDLNPair(a->dst_h_dentry)); -} - -static void au_ren_rev_whtmp(int err, struct au_ren_args *a) -{ - int rerr; - - a->h_path.dentry = vfsub_lkup_one(&a->dst_dentry->d_name, - a->dst_h_parent); - rerr = PTR_ERR(a->h_path.dentry); - if (IS_ERR(a->h_path.dentry)) { - RevertFailure("lkup one %.*s", AuDLNPair(a->dst_dentry)); - return; - } - if (a->h_path.dentry->d_inode) { - d_drop(a->h_path.dentry); - dput(a->h_path.dentry); - return; - } - - rerr = vfsub_rename(a->dst_h_dir, a->h_dst, a->dst_h_dir, &a->h_path); - d_drop(a->h_path.dentry); - dput(a->h_path.dentry); - if (!rerr) - au_set_h_dptr(a->dst_dentry, a->btgt, dget(a->h_dst)); - else - RevertFailure("rename %.*s", AuDLNPair(a->h_dst)); -} - -static void au_ren_rev_whsrc(int err, struct au_ren_args *a) -{ - int rerr; - - a->h_path.dentry = a->src_wh_dentry; - rerr = au_wh_unlink_dentry(a->src_h_dir, &a->h_path, a->src_dentry); - au_set_dbwh(a->src_dentry, a->src_bwh); - if (rerr) - RevertFailure("unlink %.*s", AuDLNPair(a->src_wh_dentry)); -} -#undef RevertFailure - -/* ---------------------------------------------------------------------- */ - -/* - * when we have to copyup the renaming entry, do it with the rename-target name - * in order to minimize the cost (the later actual rename is unnecessary). - * otherwise rename it on the target branch. - */ -static int au_ren_or_cpup(struct au_ren_args *a) -{ - int err; - struct dentry *d; - - d = a->src_dentry; - if (au_dbstart(d) == a->btgt) { - a->h_path.dentry = a->dst_h_dentry; - if (au_ftest_ren(a->flags, DIROPQ) - && au_dbdiropq(d) == a->btgt) - au_fclr_ren(a->flags, DIROPQ); - AuDebugOn(au_dbstart(d) != a->btgt); - err = vfsub_rename(a->src_h_dir, au_h_dptr(d, a->btgt), - a->dst_h_dir, &a->h_path); - } else - BUG(); - - if (!err && a->h_dst) - /* it will be set to dinfo later */ - dget(a->h_dst); - - return err; -} - -/* cf. aufs_rmdir() */ -static int au_ren_del_whtmp(struct au_ren_args *a) -{ - int err; - struct inode *dir; - - dir = a->dst_dir; - SiMustAnyLock(dir->i_sb); - if (!au_nhash_test_longer_wh(&a->whlist, a->btgt, - au_sbi(dir->i_sb)->si_dirwh) - || au_test_fs_remote(a->h_dst->d_sb)) { - err = au_whtmp_rmdir(dir, a->btgt, a->h_dst, &a->whlist); - if (unlikely(err)) - pr_warn("failed removing whtmp dir %.*s (%d), " - "ignored.\n", AuDLNPair(a->h_dst), err); - } else { - au_nhash_wh_free(&a->thargs->whlist); - a->thargs->whlist = a->whlist; - a->whlist.nh_num = 0; - au_whtmp_kick_rmdir(dir, a->btgt, a->h_dst, a->thargs); - dput(a->h_dst); - a->thargs = NULL; - } - - return 0; -} - -/* make it 'opaque' dir. */ -static int au_ren_diropq(struct au_ren_args *a) -{ - int err; - struct dentry *diropq; - - err = 0; - a->src_bdiropq = au_dbdiropq(a->src_dentry); - a->src_hinode = au_hi(a->src_inode, a->btgt); - au_hn_imtx_lock_nested(a->src_hinode, AuLsc_I_CHILD); - diropq = au_diropq_create(a->src_dentry, a->btgt); - au_hn_imtx_unlock(a->src_hinode); - if (IS_ERR(diropq)) - err = PTR_ERR(diropq); - else - dput(diropq); - - return err; -} - -static int do_rename(struct au_ren_args *a) -{ - int err; - struct dentry *d, *h_d; - - /* prepare workqueue args for asynchronous rmdir */ - h_d = a->dst_h_dentry; - if (au_ftest_ren(a->flags, ISDIR) && h_d->d_inode) { - err = -ENOMEM; - a->thargs = au_whtmp_rmdir_alloc(a->src_dentry->d_sb, GFP_NOFS); - if (unlikely(!a->thargs)) - goto out; - a->h_dst = dget(h_d); - } - - /* create whiteout for src_dentry */ - if (au_ftest_ren(a->flags, WHSRC)) { - a->src_bwh = au_dbwh(a->src_dentry); - AuDebugOn(a->src_bwh >= 0); - a->src_wh_dentry - = au_wh_create(a->src_dentry, a->btgt, a->src_h_parent); - err = PTR_ERR(a->src_wh_dentry); - if (IS_ERR(a->src_wh_dentry)) - goto out_thargs; - } - - /* lookup whiteout for dentry */ - if (au_ftest_ren(a->flags, WHDST)) { - h_d = au_wh_lkup(a->dst_h_parent, &a->dst_dentry->d_name, - a->br); - err = PTR_ERR(h_d); - if (IS_ERR(h_d)) - goto out_whsrc; - if (!h_d->d_inode) - dput(h_d); - else - a->dst_wh_dentry = h_d; - } - - /* rename dentry to tmpwh */ - if (a->thargs) { - err = au_whtmp_ren(a->dst_h_dentry, a->br); - if (unlikely(err)) - goto out_whdst; - - d = a->dst_dentry; - au_set_h_dptr(d, a->btgt, NULL); - err = au_lkup_neg(d, a->btgt, /*wh*/0); - if (unlikely(err)) - goto out_whtmp; - a->dst_h_dentry = au_h_dptr(d, a->btgt); - } - - BUG_ON(a->dst_h_dentry->d_inode && a->src_bstart != a->btgt); - - /* rename by vfs_rename or cpup */ - d = a->dst_dentry; - if (au_ftest_ren(a->flags, ISDIR) - && (a->dst_wh_dentry - || au_dbdiropq(d) == a->btgt - /* hide the lower to keep xino */ - || a->btgt < au_dbend(d) - || au_opt_test(au_mntflags(d->d_sb), ALWAYS_DIROPQ))) - au_fset_ren(a->flags, DIROPQ); - err = au_ren_or_cpup(a); - if (unlikely(err)) - /* leave the copied-up one */ - goto out_whtmp; - - /* make dir opaque */ - if (au_ftest_ren(a->flags, DIROPQ)) { - err = au_ren_diropq(a); - if (unlikely(err)) - goto out_rename; - } - - /* update target timestamps */ - AuDebugOn(au_dbstart(a->src_dentry) != a->btgt); - a->h_path.dentry = au_h_dptr(a->src_dentry, a->btgt); - vfsub_update_h_iattr(&a->h_path, /*did*/NULL); /*ignore*/ - a->src_inode->i_ctime = a->h_path.dentry->d_inode->i_ctime; - - /* remove whiteout for dentry */ - if (a->dst_wh_dentry) { - a->h_path.dentry = a->dst_wh_dentry; - err = au_wh_unlink_dentry(a->dst_h_dir, &a->h_path, - a->dst_dentry); - if (unlikely(err)) - goto out_diropq; - } - - /* remove whtmp */ - if (a->thargs) - au_ren_del_whtmp(a); /* ignore this error */ - - au_fhsm_wrote(a->src_dentry->d_sb, a->btgt, /*force*/0); - err = 0; - goto out_success; - -out_diropq: - if (au_ftest_ren(a->flags, DIROPQ)) - au_ren_rev_diropq(err, a); -out_rename: - if (!au_ftest_ren(a->flags, CPUP)) - au_ren_rev_rename(err, a); - else - au_ren_rev_cpup(err, a); - dput(a->h_dst); -out_whtmp: - if (a->thargs) - au_ren_rev_whtmp(err, a); -out_whdst: - dput(a->dst_wh_dentry); - a->dst_wh_dentry = NULL; -out_whsrc: - if (a->src_wh_dentry) - au_ren_rev_whsrc(err, a); -out_success: - dput(a->src_wh_dentry); - dput(a->dst_wh_dentry); -out_thargs: - if (a->thargs) { - dput(a->h_dst); - au_whtmp_rmdir_free(a->thargs); - a->thargs = NULL; - } -out: - return err; -} - -/* ---------------------------------------------------------------------- */ - -/* - * test if @dentry dir can be rename destination or not. - * success means, it is a logically empty dir. - */ -static int may_rename_dstdir(struct dentry *dentry, struct au_nhash *whlist) -{ - return au_test_empty(dentry, whlist); -} - -/* - * test if @dentry dir can be rename source or not. - * if it can, return 0 and @children is filled. - * success means, - * - it is a logically empty dir. - * - or, it exists on writable branch and has no children including whiteouts - * on the lower branch. - */ -static int may_rename_srcdir(struct dentry *dentry, aufs_bindex_t btgt) -{ - int err; - unsigned int rdhash; - aufs_bindex_t bstart; - - bstart = au_dbstart(dentry); - if (bstart != btgt) { - struct au_nhash whlist; - - SiMustAnyLock(dentry->d_sb); - rdhash = au_sbi(dentry->d_sb)->si_rdhash; - if (!rdhash) - rdhash = au_rdhash_est(au_dir_size(/*file*/NULL, - dentry)); - err = au_nhash_alloc(&whlist, rdhash, GFP_NOFS); - if (unlikely(err)) - goto out; - err = au_test_empty(dentry, &whlist); - au_nhash_wh_free(&whlist); - goto out; - } - - if (bstart == au_dbtaildir(dentry)) - return 0; /* success */ - - err = au_test_empty_lower(dentry); - -out: - if (err == -ENOTEMPTY) { - AuWarn1("renaming dir who has child(ren) on multiple branches," - " is not supported\n"); - err = -EXDEV; - } - return err; -} - -/* side effect: sets whlist and h_dentry */ -static int au_ren_may_dir(struct au_ren_args *a) -{ - int err; - unsigned int rdhash; - struct dentry *d; - - d = a->dst_dentry; - SiMustAnyLock(d->d_sb); - - err = 0; - if (au_ftest_ren(a->flags, ISDIR) && a->dst_inode) { - rdhash = au_sbi(d->d_sb)->si_rdhash; - if (!rdhash) - rdhash = au_rdhash_est(au_dir_size(/*file*/NULL, d)); - err = au_nhash_alloc(&a->whlist, rdhash, GFP_NOFS); - if (unlikely(err)) - goto out; - - au_set_dbstart(d, a->dst_bstart); - err = may_rename_dstdir(d, &a->whlist); - au_set_dbstart(d, a->btgt); - } - a->dst_h_dentry = au_h_dptr(d, au_dbstart(d)); - if (unlikely(err)) - goto out; - - d = a->src_dentry; - a->src_h_dentry = au_h_dptr(d, au_dbstart(d)); - if (au_ftest_ren(a->flags, ISDIR)) { - err = may_rename_srcdir(d, a->btgt); - if (unlikely(err)) { - au_nhash_wh_free(&a->whlist); - a->whlist.nh_num = 0; - } - } -out: - return err; -} - -/* ---------------------------------------------------------------------- */ - -/* - * simple tests for rename. - * following the checks in vfs, plus the parent-child relationship. - */ -static int au_may_ren(struct au_ren_args *a) -{ - int err, isdir; - struct inode *h_inode; - - if (a->src_bstart == a->btgt) { - err = au_may_del(a->src_dentry, a->btgt, a->src_h_parent, - au_ftest_ren(a->flags, ISDIR)); - if (unlikely(err)) - goto out; - err = -EINVAL; - if (unlikely(a->src_h_dentry == a->h_trap)) - goto out; - } - - err = 0; - if (a->dst_bstart != a->btgt) - goto out; - - err = -ENOTEMPTY; - if (unlikely(a->dst_h_dentry == a->h_trap)) - goto out; - - err = -EIO; - h_inode = a->dst_h_dentry->d_inode; - isdir = !!au_ftest_ren(a->flags, ISDIR); - if (!a->dst_dentry->d_inode) { - if (unlikely(h_inode)) - goto out; - err = au_may_add(a->dst_dentry, a->btgt, a->dst_h_parent, - isdir); - } else { - if (unlikely(!h_inode || !h_inode->i_nlink)) - goto out; - err = au_may_del(a->dst_dentry, a->btgt, a->dst_h_parent, - isdir); - if (unlikely(err)) - goto out; - } - -out: - if (unlikely(err == -ENOENT || err == -EEXIST)) - err = -EIO; - AuTraceErr(err); - return err; -} - -/* ---------------------------------------------------------------------- */ - -/* - * locking order - * (VFS) - * - src_dir and dir by lock_rename() - * - inode if exitsts - * (aufs) - * - lock all - * + src_dentry and dentry by aufs_read_and_write_lock2() which calls, - * + si_read_lock - * + di_write_lock2_child() - * + di_write_lock_child() - * + ii_write_lock_child() - * + di_write_lock_child2() - * + ii_write_lock_child2() - * + src_parent and parent - * + di_write_lock_parent() - * + ii_write_lock_parent() - * + di_write_lock_parent2() - * + ii_write_lock_parent2() - * + lower src_dir and dir by vfsub_lock_rename() - * + verify the every relationships between child and parent. if any - * of them failed, unlock all and return -EBUSY. - */ -static void au_ren_unlock(struct au_ren_args *a) -{ - vfsub_unlock_rename(a->src_h_parent, a->src_hdir, - a->dst_h_parent, a->dst_hdir); - if (au_ftest_ren(a->flags, MNT_WRITE)) - vfsub_mnt_drop_write(au_br_mnt(a->br)); -} - -static int au_ren_lock(struct au_ren_args *a) -{ - int err; - unsigned int udba; - - err = 0; - a->src_h_parent = au_h_dptr(a->src_parent, a->btgt); - a->src_hdir = au_hi(a->src_dir, a->btgt); - a->dst_h_parent = au_h_dptr(a->dst_parent, a->btgt); - a->dst_hdir = au_hi(a->dst_dir, a->btgt); - - err = vfsub_mnt_want_write(au_br_mnt(a->br)); - if (unlikely(err)) - goto out; - au_fset_ren(a->flags, MNT_WRITE); - a->h_trap = vfsub_lock_rename(a->src_h_parent, a->src_hdir, - a->dst_h_parent, a->dst_hdir); - udba = au_opt_udba(a->src_dentry->d_sb); - if (unlikely(a->src_hdir->hi_inode != a->src_h_parent->d_inode - || a->dst_hdir->hi_inode != a->dst_h_parent->d_inode)) - err = au_busy_or_stale(); - if (!err && au_dbstart(a->src_dentry) == a->btgt) - err = au_h_verify(a->src_h_dentry, udba, - a->src_h_parent->d_inode, a->src_h_parent, - a->br); - if (!err && au_dbstart(a->dst_dentry) == a->btgt) - err = au_h_verify(a->dst_h_dentry, udba, - a->dst_h_parent->d_inode, a->dst_h_parent, - a->br); - if (!err) - goto out; /* success */ - - err = au_busy_or_stale(); - au_ren_unlock(a); - -out: - return err; -} - -/* ---------------------------------------------------------------------- */ - -static void au_ren_refresh_dir(struct au_ren_args *a) -{ - struct inode *dir; - - dir = a->dst_dir; - dir->i_version++; - if (au_ftest_ren(a->flags, ISDIR)) { - /* is this updating defined in POSIX? */ - au_cpup_attr_timesizes(a->src_inode); - au_cpup_attr_nlink(dir, /*force*/1); - } - - if (au_ibstart(dir) == a->btgt) - au_cpup_attr_timesizes(dir); - - if (au_ftest_ren(a->flags, ISSAMEDIR)) - return; - - dir = a->src_dir; - dir->i_version++; - if (au_ftest_ren(a->flags, ISDIR)) - au_cpup_attr_nlink(dir, /*force*/1); - if (au_ibstart(dir) == a->btgt) - au_cpup_attr_timesizes(dir); -} - -static void au_ren_refresh(struct au_ren_args *a) -{ - aufs_bindex_t bend, bindex; - struct dentry *d, *h_d; - struct inode *i, *h_i; - struct super_block *sb; - - d = a->dst_dentry; - d_drop(d); - if (a->h_dst) - /* already dget-ed by au_ren_or_cpup() */ - au_set_h_dptr(d, a->btgt, a->h_dst); - - i = a->dst_inode; - if (i) { - if (!au_ftest_ren(a->flags, ISDIR)) - vfsub_drop_nlink(i); - else { - vfsub_dead_dir(i); - au_cpup_attr_timesizes(i); - } - au_update_dbrange(d, /*do_put_zero*/1); - } else { - bend = a->btgt; - for (bindex = au_dbstart(d); bindex < bend; bindex++) - au_set_h_dptr(d, bindex, NULL); - bend = au_dbend(d); - for (bindex = a->btgt + 1; bindex <= bend; bindex++) - au_set_h_dptr(d, bindex, NULL); - au_update_dbrange(d, /*do_put_zero*/0); - } - - d = a->src_dentry; - au_set_dbwh(d, -1); - bend = au_dbend(d); - for (bindex = a->btgt + 1; bindex <= bend; bindex++) { - h_d = au_h_dptr(d, bindex); - if (h_d) - au_set_h_dptr(d, bindex, NULL); - } - au_set_dbend(d, a->btgt); - - sb = d->d_sb; - i = a->src_inode; - if (au_opt_test(au_mntflags(sb), PLINK) && au_plink_test(i)) - return; /* success */ - - bend = au_ibend(i); - for (bindex = a->btgt + 1; bindex <= bend; bindex++) { - h_i = au_h_iptr(i, bindex); - if (h_i) { - au_xino_write(sb, bindex, h_i->i_ino, /*ino*/0); - /* ignore this error */ - au_set_h_iptr(i, bindex, NULL, 0); - } - } - au_set_ibend(i, a->btgt); -} - -/* ---------------------------------------------------------------------- */ - -/* mainly for link(2) and rename(2) */ -int au_wbr(struct dentry *dentry, aufs_bindex_t btgt) -{ - aufs_bindex_t bdiropq, bwh; - struct dentry *parent; - struct au_branch *br; - - parent = dentry->d_parent; - IMustLock(parent->d_inode); /* dir is locked */ - - bdiropq = au_dbdiropq(parent); - bwh = au_dbwh(dentry); - br = au_sbr(dentry->d_sb, btgt); - if (au_br_rdonly(br) - || (0 <= bdiropq && bdiropq < btgt) - || (0 <= bwh && bwh < btgt)) - btgt = -1; - - AuDbg("btgt %d\n", btgt); - return btgt; -} - -/* sets src_bstart, dst_bstart and btgt */ -static int au_ren_wbr(struct au_ren_args *a) -{ - int err; - struct au_wr_dir_args wr_dir_args = { - /* .force_btgt = -1, */ - .flags = AuWrDir_ADD_ENTRY - }; - - a->src_bstart = au_dbstart(a->src_dentry); - a->dst_bstart = au_dbstart(a->dst_dentry); - if (au_ftest_ren(a->flags, ISDIR)) - au_fset_wrdir(wr_dir_args.flags, ISDIR); - wr_dir_args.force_btgt = a->src_bstart; - if (a->dst_inode && a->dst_bstart < a->src_bstart) - wr_dir_args.force_btgt = a->dst_bstart; - wr_dir_args.force_btgt = au_wbr(a->dst_dentry, wr_dir_args.force_btgt); - err = au_wr_dir(a->dst_dentry, a->src_dentry, &wr_dir_args); - a->btgt = err; - - return err; -} - -static void au_ren_dt(struct au_ren_args *a) -{ - a->h_path.dentry = a->src_h_parent; - au_dtime_store(a->src_dt + AuPARENT, a->src_parent, &a->h_path); - if (!au_ftest_ren(a->flags, ISSAMEDIR)) { - a->h_path.dentry = a->dst_h_parent; - au_dtime_store(a->dst_dt + AuPARENT, a->dst_parent, &a->h_path); - } - - au_fclr_ren(a->flags, DT_DSTDIR); - if (!au_ftest_ren(a->flags, ISDIR)) - return; - - a->h_path.dentry = a->src_h_dentry; - au_dtime_store(a->src_dt + AuCHILD, a->src_dentry, &a->h_path); - if (a->dst_h_dentry->d_inode) { - au_fset_ren(a->flags, DT_DSTDIR); - a->h_path.dentry = a->dst_h_dentry; - au_dtime_store(a->dst_dt + AuCHILD, a->dst_dentry, &a->h_path); - } -} - -static void au_ren_rev_dt(int err, struct au_ren_args *a) -{ - struct dentry *h_d; - struct mutex *h_mtx; - - au_dtime_revert(a->src_dt + AuPARENT); - if (!au_ftest_ren(a->flags, ISSAMEDIR)) - au_dtime_revert(a->dst_dt + AuPARENT); - - if (au_ftest_ren(a->flags, ISDIR) && err != -EIO) { - h_d = a->src_dt[AuCHILD].dt_h_path.dentry; - h_mtx = &h_d->d_inode->i_mutex; - mutex_lock_nested(h_mtx, AuLsc_I_CHILD); - au_dtime_revert(a->src_dt + AuCHILD); - mutex_unlock(h_mtx); - - if (au_ftest_ren(a->flags, DT_DSTDIR)) { - h_d = a->dst_dt[AuCHILD].dt_h_path.dentry; - h_mtx = &h_d->d_inode->i_mutex; - mutex_lock_nested(h_mtx, AuLsc_I_CHILD); - au_dtime_revert(a->dst_dt + AuCHILD); - mutex_unlock(h_mtx); - } - } -} - -/* ---------------------------------------------------------------------- */ - -int aufs_rename(struct inode *_src_dir, struct dentry *_src_dentry, - struct inode *_dst_dir, struct dentry *_dst_dentry) -{ - int err, flags; - /* reduce stack space */ - struct au_ren_args *a; - - AuDbg("%.*s, %.*s\n", AuDLNPair(_src_dentry), AuDLNPair(_dst_dentry)); - IMustLock(_src_dir); - IMustLock(_dst_dir); - - err = -ENOMEM; - BUILD_BUG_ON(sizeof(*a) > PAGE_SIZE); - a = kzalloc(sizeof(*a), GFP_NOFS); - if (unlikely(!a)) - goto out; - - a->src_dir = _src_dir; - a->src_dentry = _src_dentry; - a->src_inode = a->src_dentry->d_inode; - a->src_parent = a->src_dentry->d_parent; /* dir inode is locked */ - a->dst_dir = _dst_dir; - a->dst_dentry = _dst_dentry; - a->dst_inode = a->dst_dentry->d_inode; - a->dst_parent = a->dst_dentry->d_parent; /* dir inode is locked */ - if (a->dst_inode) { - IMustLock(a->dst_inode); - au_igrab(a->dst_inode); - } - - err = -ENOTDIR; - flags = AuLock_FLUSH | AuLock_NOPLM | AuLock_GEN; - if (S_ISDIR(a->src_inode->i_mode)) { - au_fset_ren(a->flags, ISDIR); - if (unlikely(a->dst_inode && !S_ISDIR(a->dst_inode->i_mode))) - goto out_free; - err = aufs_read_and_write_lock2(a->dst_dentry, a->src_dentry, - AuLock_DIR | flags); - } else - err = aufs_read_and_write_lock2(a->dst_dentry, a->src_dentry, - flags); - if (unlikely(err)) - goto out_free; - - err = au_d_hashed_positive(a->src_dentry); - if (unlikely(err)) - goto out_unlock; - err = -ENOENT; - if (a->dst_inode) { - /* - * If it is a dir, VFS unhash dst_dentry before this - * function. It means we cannot rely upon d_unhashed(). - */ - if (unlikely(!a->dst_inode->i_nlink)) - goto out_unlock; - if (!S_ISDIR(a->dst_inode->i_mode)) { - err = au_d_hashed_positive(a->dst_dentry); - if (unlikely(err)) - goto out_unlock; - } else if (unlikely(IS_DEADDIR(a->dst_inode))) - goto out_unlock; - } else if (unlikely(d_unhashed(a->dst_dentry))) - goto out_unlock; - - /* - * is it possible? - * yes, it happend (in linux-3.3-rcN) but I don't know why. - * there may exist a problem somewhere else. - */ - err = -EINVAL; - if (unlikely(a->dst_parent->d_inode == a->src_dentry->d_inode)) - goto out_unlock; - - au_fset_ren(a->flags, ISSAMEDIR); /* temporary */ - di_write_lock_parent(a->dst_parent); - - /* which branch we process */ - err = au_ren_wbr(a); - if (unlikely(err < 0)) - goto out_parent; - a->br = au_sbr(a->dst_dentry->d_sb, a->btgt); - a->h_path.mnt = au_br_mnt(a->br); - - /* are they available to be renamed */ - err = au_ren_may_dir(a); - if (unlikely(err)) - goto out_children; - - /* prepare the writable parent dir on the same branch */ - if (a->dst_bstart == a->btgt) { - au_fset_ren(a->flags, WHDST); - } else { - err = au_cpup_dirs(a->dst_dentry, a->btgt); - if (unlikely(err)) - goto out_children; - } - - if (a->src_dir != a->dst_dir) { - /* - * this temporary unlock is safe, - * because both dir->i_mutex are locked. - */ - di_write_unlock(a->dst_parent); - di_write_lock_parent(a->src_parent); - err = au_wr_dir_need_wh(a->src_dentry, - au_ftest_ren(a->flags, ISDIR), - &a->btgt); - di_write_unlock(a->src_parent); - di_write_lock2_parent(a->src_parent, a->dst_parent, /*isdir*/1); - au_fclr_ren(a->flags, ISSAMEDIR); - } else - err = au_wr_dir_need_wh(a->src_dentry, - au_ftest_ren(a->flags, ISDIR), - &a->btgt); - if (unlikely(err < 0)) - goto out_children; - if (err) - au_fset_ren(a->flags, WHSRC); - - /* cpup src */ - if (a->src_bstart != a->btgt) { - struct au_pin pin; - - err = au_pin(&pin, a->src_dentry, a->btgt, - au_opt_udba(a->src_dentry->d_sb), - AuPin_DI_LOCKED | AuPin_MNT_WRITE); - if (!err) { - struct au_cp_generic cpg = { - .dentry = a->src_dentry, - .bdst = a->btgt, - .bsrc = a->src_bstart, - .len = -1, - .pin = &pin, - .flags = AuCpup_DTIME | AuCpup_HOPEN - }; - AuDebugOn(au_dbstart(a->src_dentry) != a->src_bstart); - err = au_sio_cpup_simple(&cpg); - au_unpin(&pin); - } - if (unlikely(err)) - goto out_children; - a->src_bstart = a->btgt; - a->src_h_dentry = au_h_dptr(a->src_dentry, a->btgt); - au_fset_ren(a->flags, WHSRC); - } - - /* lock them all */ - err = au_ren_lock(a); - if (unlikely(err)) - /* leave the copied-up one */ - goto out_children; - - if (!au_opt_test(au_mntflags(a->dst_dir->i_sb), UDBA_NONE)) - err = au_may_ren(a); - else if (unlikely(a->dst_dentry->d_name.len > AUFS_MAX_NAMELEN)) - err = -ENAMETOOLONG; - if (unlikely(err)) - goto out_hdir; - - /* store timestamps to be revertible */ - au_ren_dt(a); - - /* here we go */ - err = do_rename(a); - if (unlikely(err)) - goto out_dt; - - /* update dir attributes */ - au_ren_refresh_dir(a); - - /* dput/iput all lower dentries */ - au_ren_refresh(a); - - goto out_hdir; /* success */ - -out_dt: - au_ren_rev_dt(err, a); -out_hdir: - au_ren_unlock(a); -out_children: - au_nhash_wh_free(&a->whlist); - if (err && a->dst_inode && a->dst_bstart != a->btgt) { - AuDbg("bstart %d, btgt %d\n", a->dst_bstart, a->btgt); - au_set_h_dptr(a->dst_dentry, a->btgt, NULL); - au_set_dbstart(a->dst_dentry, a->dst_bstart); - } -out_parent: - if (!err) - d_move(a->src_dentry, a->dst_dentry); - else { - au_update_dbstart(a->dst_dentry); - if (!a->dst_inode) - d_drop(a->dst_dentry); - } - if (au_ftest_ren(a->flags, ISSAMEDIR)) - di_write_unlock(a->dst_parent); - else - di_write_unlock2(a->src_parent, a->dst_parent); -out_unlock: - aufs_read_and_write_unlock2(a->dst_dentry, a->src_dentry); -out_free: - iput(a->dst_inode); - if (a->thargs) - au_whtmp_rmdir_free(a->thargs); - kfree(a); -out: - AuTraceErr(err); - return err; -} diff --git a/fs/aufs/iinfo.c b/fs/aufs/iinfo.c deleted file mode 100644 index 14ca4cac8ee6e7..00000000000000 --- a/fs/aufs/iinfo.c +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * inode private data - */ - -#include "aufs.h" - -struct inode *au_h_iptr(struct inode *inode, aufs_bindex_t bindex) -{ - struct inode *h_inode; - - IiMustAnyLock(inode); - - h_inode = au_ii(inode)->ii_hinode[0 + bindex].hi_inode; - AuDebugOn(h_inode && atomic_read(&h_inode->i_count) <= 0); - return h_inode; -} - -/* todo: hard/soft set? */ -void au_hiput(struct au_hinode *hinode) -{ - au_hn_free(hinode); - dput(hinode->hi_whdentry); - iput(hinode->hi_inode); -} - -unsigned int au_hi_flags(struct inode *inode, int isdir) -{ - unsigned int flags; - const unsigned int mnt_flags = au_mntflags(inode->i_sb); - - flags = 0; - if (au_opt_test(mnt_flags, XINO)) - au_fset_hi(flags, XINO); - if (isdir && au_opt_test(mnt_flags, UDBA_HNOTIFY)) - au_fset_hi(flags, HNOTIFY); - return flags; -} - -void au_set_h_iptr(struct inode *inode, aufs_bindex_t bindex, - struct inode *h_inode, unsigned int flags) -{ - struct au_hinode *hinode; - struct inode *hi; - struct au_iinfo *iinfo = au_ii(inode); - - IiMustWriteLock(inode); - - hinode = iinfo->ii_hinode + bindex; - hi = hinode->hi_inode; - AuDebugOn(h_inode && atomic_read(&h_inode->i_count) <= 0); - - if (hi) - au_hiput(hinode); - hinode->hi_inode = h_inode; - if (h_inode) { - int err; - struct super_block *sb = inode->i_sb; - struct au_branch *br; - - AuDebugOn(inode->i_mode - && (h_inode->i_mode & S_IFMT) - != (inode->i_mode & S_IFMT)); - if (bindex == iinfo->ii_bstart) - au_cpup_igen(inode, h_inode); - br = au_sbr(sb, bindex); - hinode->hi_id = br->br_id; - if (au_ftest_hi(flags, XINO)) { - err = au_xino_write(sb, bindex, h_inode->i_ino, - inode->i_ino); - if (unlikely(err)) - AuIOErr1("failed au_xino_write() %d\n", err); - } - - if (au_ftest_hi(flags, HNOTIFY) - && au_br_hnotifyable(br->br_perm)) { - err = au_hn_alloc(hinode, inode); - if (unlikely(err)) - AuIOErr1("au_hn_alloc() %d\n", err); - } - } -} - -void au_set_hi_wh(struct inode *inode, aufs_bindex_t bindex, - struct dentry *h_wh) -{ - struct au_hinode *hinode; - - IiMustWriteLock(inode); - - hinode = au_ii(inode)->ii_hinode + bindex; - AuDebugOn(hinode->hi_whdentry); - hinode->hi_whdentry = h_wh; -} - -void au_update_iigen(struct inode *inode, int half) -{ - struct au_iinfo *iinfo; - struct au_iigen *iigen; - unsigned int sigen; - - sigen = au_sigen(inode->i_sb); - iinfo = au_ii(inode); - iigen = &iinfo->ii_generation; - spin_lock(&iinfo->ii_genspin); - iigen->ig_generation = sigen; - if (half) - au_ig_fset(iigen->ig_flags, HALF_REFRESHED); - else - au_ig_fclr(iigen->ig_flags, HALF_REFRESHED); - spin_unlock(&iinfo->ii_genspin); -} - -/* it may be called at remount time, too */ -void au_update_ibrange(struct inode *inode, int do_put_zero) -{ - struct au_iinfo *iinfo; - aufs_bindex_t bindex, bend; - - iinfo = au_ii(inode); - if (!iinfo) - return; - - IiMustWriteLock(inode); - - if (do_put_zero && iinfo->ii_bstart >= 0) { - for (bindex = iinfo->ii_bstart; bindex <= iinfo->ii_bend; - bindex++) { - struct inode *h_i; - - h_i = iinfo->ii_hinode[0 + bindex].hi_inode; - if (h_i && !h_i->i_nlink) - au_set_h_iptr(inode, bindex, NULL, 0); - } - } - - iinfo->ii_bstart = -1; - iinfo->ii_bend = -1; - bend = au_sbend(inode->i_sb); - for (bindex = 0; bindex <= bend; bindex++) - if (iinfo->ii_hinode[0 + bindex].hi_inode) { - iinfo->ii_bstart = bindex; - break; - } - if (iinfo->ii_bstart >= 0) - for (bindex = bend; bindex >= iinfo->ii_bstart; bindex--) - if (iinfo->ii_hinode[0 + bindex].hi_inode) { - iinfo->ii_bend = bindex; - break; - } - AuDebugOn(iinfo->ii_bstart > iinfo->ii_bend); -} - -/* ---------------------------------------------------------------------- */ - -void au_icntnr_init_once(void *_c) -{ - struct au_icntnr *c = _c; - struct au_iinfo *iinfo = &c->iinfo; - static struct lock_class_key aufs_ii; - - spin_lock_init(&iinfo->ii_genspin); - au_rw_init(&iinfo->ii_rwsem); - au_rw_class(&iinfo->ii_rwsem, &aufs_ii); - inode_init_once(&c->vfs_inode); -} - -int au_iinfo_init(struct inode *inode) -{ - struct au_iinfo *iinfo; - struct super_block *sb; - int nbr, i; - - sb = inode->i_sb; - iinfo = &(container_of(inode, struct au_icntnr, vfs_inode)->iinfo); - nbr = au_sbend(sb) + 1; - if (unlikely(nbr <= 0)) - nbr = 1; - iinfo->ii_hinode = kcalloc(nbr, sizeof(*iinfo->ii_hinode), GFP_NOFS); - if (iinfo->ii_hinode) { - au_ninodes_inc(sb); - for (i = 0; i < nbr; i++) - iinfo->ii_hinode[i].hi_id = -1; - - iinfo->ii_generation.ig_generation = au_sigen(sb); - iinfo->ii_bstart = -1; - iinfo->ii_bend = -1; - iinfo->ii_vdir = NULL; - return 0; - } - return -ENOMEM; -} - -int au_ii_realloc(struct au_iinfo *iinfo, int nbr) -{ - int err, sz; - struct au_hinode *hip; - - AuRwMustWriteLock(&iinfo->ii_rwsem); - - err = -ENOMEM; - sz = sizeof(*hip) * (iinfo->ii_bend + 1); - if (!sz) - sz = sizeof(*hip); - hip = au_kzrealloc(iinfo->ii_hinode, sz, sizeof(*hip) * nbr, GFP_NOFS); - if (hip) { - iinfo->ii_hinode = hip; - err = 0; - } - - return err; -} - -void au_iinfo_fin(struct inode *inode) -{ - struct au_iinfo *iinfo; - struct au_hinode *hi; - struct super_block *sb; - aufs_bindex_t bindex, bend; - const unsigned char unlinked = !inode->i_nlink; - - iinfo = au_ii(inode); - /* bad_inode case */ - if (!iinfo) - return; - - sb = inode->i_sb; - au_ninodes_dec(sb); - if (si_pid_test(sb)) - au_xino_delete_inode(inode, unlinked); - else { - /* - * it is safe to hide the dependency between sbinfo and - * sb->s_umount. - */ - lockdep_off(); - si_noflush_read_lock(sb); - au_xino_delete_inode(inode, unlinked); - si_read_unlock(sb); - lockdep_on(); - } - - if (iinfo->ii_vdir) - au_vdir_free(iinfo->ii_vdir); - - bindex = iinfo->ii_bstart; - if (bindex >= 0) { - hi = iinfo->ii_hinode + bindex; - bend = iinfo->ii_bend; - while (bindex++ <= bend) { - if (hi->hi_inode) - au_hiput(hi); - hi++; - } - } - kfree(iinfo->ii_hinode); - iinfo->ii_hinode = NULL; - AuRwDestroy(&iinfo->ii_rwsem); -} diff --git a/fs/aufs/inode.c b/fs/aufs/inode.c deleted file mode 100644 index 43643390f2f12c..00000000000000 --- a/fs/aufs/inode.c +++ /dev/null @@ -1,496 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * inode functions - */ - -#include "aufs.h" - -struct inode *au_igrab(struct inode *inode) -{ - if (inode) { - AuDebugOn(!atomic_read(&inode->i_count)); - ihold(inode); - } - return inode; -} - -static void au_refresh_hinode_attr(struct inode *inode, int do_version) -{ - au_cpup_attr_all(inode, /*force*/0); - au_update_iigen(inode, /*half*/1); - if (do_version) - inode->i_version++; -} - -static int au_ii_refresh(struct inode *inode, int *update) -{ - int err, e; - umode_t type; - aufs_bindex_t bindex, new_bindex; - struct super_block *sb; - struct au_iinfo *iinfo; - struct au_hinode *p, *q, tmp; - - IiMustWriteLock(inode); - - *update = 0; - sb = inode->i_sb; - type = inode->i_mode & S_IFMT; - iinfo = au_ii(inode); - err = au_ii_realloc(iinfo, au_sbend(sb) + 1); - if (unlikely(err)) - goto out; - - AuDebugOn(iinfo->ii_bstart < 0); - p = iinfo->ii_hinode + iinfo->ii_bstart; - for (bindex = iinfo->ii_bstart; bindex <= iinfo->ii_bend; - bindex++, p++) { - if (!p->hi_inode) - continue; - - AuDebugOn(type != (p->hi_inode->i_mode & S_IFMT)); - new_bindex = au_br_index(sb, p->hi_id); - if (new_bindex == bindex) - continue; - - if (new_bindex < 0) { - *update = 1; - au_hiput(p); - p->hi_inode = NULL; - continue; - } - - if (new_bindex < iinfo->ii_bstart) - iinfo->ii_bstart = new_bindex; - if (iinfo->ii_bend < new_bindex) - iinfo->ii_bend = new_bindex; - /* swap two lower inode, and loop again */ - q = iinfo->ii_hinode + new_bindex; - tmp = *q; - *q = *p; - *p = tmp; - if (tmp.hi_inode) { - bindex--; - p--; - } - } - au_update_ibrange(inode, /*do_put_zero*/0); - e = au_dy_irefresh(inode); - if (unlikely(e && !err)) - err = e; - -out: - AuTraceErr(err); - return err; -} - -int au_refresh_hinode_self(struct inode *inode) -{ - int err, update; - - err = au_ii_refresh(inode, &update); - if (!err) - au_refresh_hinode_attr(inode, update && S_ISDIR(inode->i_mode)); - - AuTraceErr(err); - return err; -} - -int au_refresh_hinode(struct inode *inode, struct dentry *dentry) -{ - int err, e, update; - unsigned int flags; - umode_t mode; - aufs_bindex_t bindex, bend; - unsigned char isdir; - struct au_hinode *p; - struct au_iinfo *iinfo; - - err = au_ii_refresh(inode, &update); - if (unlikely(err)) - goto out; - - update = 0; - iinfo = au_ii(inode); - p = iinfo->ii_hinode + iinfo->ii_bstart; - mode = (inode->i_mode & S_IFMT); - isdir = S_ISDIR(mode); - flags = au_hi_flags(inode, isdir); - bend = au_dbend(dentry); - for (bindex = au_dbstart(dentry); bindex <= bend; bindex++) { - struct inode *h_i; - struct dentry *h_d; - - h_d = au_h_dptr(dentry, bindex); - if (!h_d || !h_d->d_inode) - continue; - - AuDebugOn(mode != (h_d->d_inode->i_mode & S_IFMT)); - if (iinfo->ii_bstart <= bindex && bindex <= iinfo->ii_bend) { - h_i = au_h_iptr(inode, bindex); - if (h_i) { - if (h_i == h_d->d_inode) - continue; - err = -EIO; - break; - } - } - if (bindex < iinfo->ii_bstart) - iinfo->ii_bstart = bindex; - if (iinfo->ii_bend < bindex) - iinfo->ii_bend = bindex; - au_set_h_iptr(inode, bindex, au_igrab(h_d->d_inode), flags); - update = 1; - } - au_update_ibrange(inode, /*do_put_zero*/0); - e = au_dy_irefresh(inode); - if (unlikely(e && !err)) - err = e; - if (!err) - au_refresh_hinode_attr(inode, update && isdir); - -out: - AuTraceErr(err); - return err; -} - -static int set_inode(struct inode *inode, struct dentry *dentry) -{ - int err; - unsigned int flags; - umode_t mode; - aufs_bindex_t bindex, bstart, btail; - unsigned char isdir; - struct dentry *h_dentry; - struct inode *h_inode; - struct au_iinfo *iinfo; - - IiMustWriteLock(inode); - - err = 0; - isdir = 0; - bstart = au_dbstart(dentry); - h_inode = au_h_dptr(dentry, bstart)->d_inode; - mode = h_inode->i_mode; - switch (mode & S_IFMT) { - case S_IFREG: - btail = au_dbtail(dentry); - inode->i_op = &aufs_iop; - inode->i_fop = &aufs_file_fop; - err = au_dy_iaop(inode, bstart, h_inode); - if (unlikely(err)) - goto out; - break; - case S_IFDIR: - isdir = 1; - btail = au_dbtaildir(dentry); - inode->i_op = &aufs_dir_iop; - inode->i_fop = &aufs_dir_fop; - break; - case S_IFLNK: - btail = au_dbtail(dentry); - inode->i_op = &aufs_symlink_iop; - break; - case S_IFBLK: - case S_IFCHR: - case S_IFIFO: - case S_IFSOCK: - btail = au_dbtail(dentry); - inode->i_op = &aufs_iop; - init_special_inode(inode, mode, h_inode->i_rdev); - break; - default: - AuIOErr("Unknown file type 0%o\n", mode); - err = -EIO; - goto out; - } - - /* do not set hnotify for whiteouted dirs (SHWH mode) */ - flags = au_hi_flags(inode, isdir); - if (au_opt_test(au_mntflags(dentry->d_sb), SHWH) - && au_ftest_hi(flags, HNOTIFY) - && dentry->d_name.len > AUFS_WH_PFX_LEN - && !memcmp(dentry->d_name.name, AUFS_WH_PFX, AUFS_WH_PFX_LEN)) - au_fclr_hi(flags, HNOTIFY); - iinfo = au_ii(inode); - iinfo->ii_bstart = bstart; - iinfo->ii_bend = btail; - for (bindex = bstart; bindex <= btail; bindex++) { - h_dentry = au_h_dptr(dentry, bindex); - if (h_dentry) - au_set_h_iptr(inode, bindex, - au_igrab(h_dentry->d_inode), flags); - } - au_cpup_attr_all(inode, /*force*/1); - /* - * to force calling aufs_get_acl() every time, - * do not call cache_no_acl() for aufs inode. - */ - -out: - return err; -} - -/* - * successful returns with iinfo write_locked - * minus: errno - * zero: success, matched - * plus: no error, but unmatched - */ -static int reval_inode(struct inode *inode, struct dentry *dentry) -{ - int err; - unsigned int gen; - struct au_iigen iigen; - aufs_bindex_t bindex, bend; - struct inode *h_inode, *h_dinode; - - /* - * before this function, if aufs got any iinfo lock, it must be only - * one, the parent dir. - * it can happen by UDBA and the obsoleted inode number. - */ - err = -EIO; - if (unlikely(inode->i_ino == parent_ino(dentry))) - goto out; - - err = 1; - ii_write_lock_new_child(inode); - h_dinode = au_h_dptr(dentry, au_dbstart(dentry))->d_inode; - bend = au_ibend(inode); - for (bindex = au_ibstart(inode); bindex <= bend; bindex++) { - h_inode = au_h_iptr(inode, bindex); - if (!h_inode || h_inode != h_dinode) - continue; - - err = 0; - gen = au_iigen(inode, &iigen); - if (gen == au_digen(dentry) - && !au_ig_ftest(iigen.ig_flags, HALF_REFRESHED)) - break; - - /* fully refresh inode using dentry */ - err = au_refresh_hinode(inode, dentry); - if (!err) - au_update_iigen(inode, /*half*/0); - break; - } - - if (unlikely(err)) - ii_write_unlock(inode); -out: - return err; -} - -int au_ino(struct super_block *sb, aufs_bindex_t bindex, ino_t h_ino, - unsigned int d_type, ino_t *ino) -{ - int err; - struct mutex *mtx; - - /* prevent hardlinked inode number from race condition */ - mtx = NULL; - if (d_type != DT_DIR) { - mtx = &au_sbr(sb, bindex)->br_xino.xi_nondir_mtx; - mutex_lock(mtx); - } - err = au_xino_read(sb, bindex, h_ino, ino); - if (unlikely(err)) - goto out; - - if (!*ino) { - err = -EIO; - *ino = au_xino_new_ino(sb); - if (unlikely(!*ino)) - goto out; - err = au_xino_write(sb, bindex, h_ino, *ino); - if (unlikely(err)) - goto out; - } - -out: - if (mtx) - mutex_unlock(mtx); - return err; -} - -/* successful returns with iinfo write_locked */ -/* todo: return with unlocked? */ -struct inode *au_new_inode(struct dentry *dentry, int must_new) -{ - struct inode *inode, *h_inode; - struct dentry *h_dentry; - struct super_block *sb; - struct mutex *mtx; - ino_t h_ino, ino; - int err; - aufs_bindex_t bstart; - - sb = dentry->d_sb; - bstart = au_dbstart(dentry); - h_dentry = au_h_dptr(dentry, bstart); - h_inode = h_dentry->d_inode; - h_ino = h_inode->i_ino; - - /* - * stop 'race'-ing between hardlinks under different - * parents. - */ - mtx = NULL; - if (!S_ISDIR(h_inode->i_mode)) - mtx = &au_sbr(sb, bstart)->br_xino.xi_nondir_mtx; - -new_ino: - if (mtx) - mutex_lock(mtx); - err = au_xino_read(sb, bstart, h_ino, &ino); - inode = ERR_PTR(err); - if (unlikely(err)) - goto out; - - if (!ino) { - ino = au_xino_new_ino(sb); - if (unlikely(!ino)) { - inode = ERR_PTR(-EIO); - goto out; - } - } - - AuDbg("i%lu\n", (unsigned long)ino); - inode = au_iget_locked(sb, ino); - err = PTR_ERR(inode); - if (IS_ERR(inode)) - goto out; - - AuDbg("%lx, new %d\n", inode->i_state, !!(inode->i_state & I_NEW)); - if (inode->i_state & I_NEW) { - /* verbose coding for lock class name */ - if (unlikely(S_ISLNK(h_inode->i_mode))) - au_rw_class(&au_ii(inode)->ii_rwsem, - au_lc_key + AuLcSymlink_IIINFO); - else if (unlikely(S_ISDIR(h_inode->i_mode))) - au_rw_class(&au_ii(inode)->ii_rwsem, - au_lc_key + AuLcDir_IIINFO); - else /* likely */ - au_rw_class(&au_ii(inode)->ii_rwsem, - au_lc_key + AuLcNonDir_IIINFO); - - ii_write_lock_new_child(inode); - err = set_inode(inode, dentry); - if (!err) { - unlock_new_inode(inode); - goto out; /* success */ - } - - /* - * iget_failed() calls iput(), but we need to call - * ii_write_unlock() after iget_failed(). so dirty hack for - * i_count. - */ - atomic_inc(&inode->i_count); - iget_failed(inode); - ii_write_unlock(inode); - au_xino_write(sb, bstart, h_ino, /*ino*/0); - /* ignore this error */ - goto out_iput; - } else if (!must_new && !IS_DEADDIR(inode) && inode->i_nlink) { - /* - * horrible race condition between lookup, readdir and copyup - * (or something). - */ - if (mtx) - mutex_unlock(mtx); - err = reval_inode(inode, dentry); - if (unlikely(err < 0)) { - mtx = NULL; - goto out_iput; - } - - if (!err) { - mtx = NULL; - goto out; /* success */ - } else if (mtx) - mutex_lock(mtx); - } - - if (unlikely(au_test_fs_unique_ino(h_dentry->d_inode))) - AuWarn1("Warning: Un-notified UDBA or repeatedly renamed dir," - " b%d, %s, %.*s, hi%lu, i%lu.\n", - bstart, au_sbtype(h_dentry->d_sb), AuDLNPair(dentry), - (unsigned long)h_ino, (unsigned long)ino); - ino = 0; - err = au_xino_write(sb, bstart, h_ino, /*ino*/0); - if (!err) { - iput(inode); - if (mtx) - mutex_unlock(mtx); - goto new_ino; - } - -out_iput: - iput(inode); - inode = ERR_PTR(err); -out: - if (mtx) - mutex_unlock(mtx); - return inode; -} - -/* ---------------------------------------------------------------------- */ - -int au_test_ro(struct super_block *sb, aufs_bindex_t bindex, - struct inode *inode) -{ - int err; - struct inode *hi; - - err = au_br_rdonly(au_sbr(sb, bindex)); - - /* pseudo-link after flushed may happen out of bounds */ - if (!err - && inode - && au_ibstart(inode) <= bindex - && bindex <= au_ibend(inode)) { - /* - * permission check is unnecessary since vfsub routine - * will be called later - */ - hi = au_h_iptr(inode, bindex); - if (hi) - err = IS_IMMUTABLE(hi) ? -EROFS : 0; - } - - return err; -} - -int au_test_h_perm(struct inode *h_inode, int mask) -{ - if (uid_eq(current_fsuid(), GLOBAL_ROOT_UID)) - return 0; - return inode_permission(h_inode, mask); -} - -int au_test_h_perm_sio(struct inode *h_inode, int mask) -{ - if (au_test_nfs(h_inode->i_sb) - && (mask & MAY_WRITE) - && S_ISDIR(h_inode->i_mode)) - mask |= MAY_READ; /* force permission check */ - return au_test_h_perm(h_inode, mask); -} diff --git a/fs/aufs/inode.h b/fs/aufs/inode.h deleted file mode 100644 index c058dddea6392d..00000000000000 --- a/fs/aufs/inode.h +++ /dev/null @@ -1,633 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * inode operations - */ - -#ifndef __AUFS_INODE_H__ -#define __AUFS_INODE_H__ - -#ifdef __KERNEL__ - -#include -#include "rwsem.h" - -struct vfsmount; - -struct au_hnotify { -#ifdef CONFIG_AUFS_HNOTIFY -#ifdef CONFIG_AUFS_HFSNOTIFY - /* never use fsnotify_add_vfsmount_mark() */ - struct fsnotify_mark hn_mark; -#endif - struct inode *hn_aufs_inode; /* no get/put */ -#endif -} ____cacheline_aligned_in_smp; - -struct au_hinode { - struct inode *hi_inode; - aufs_bindex_t hi_id; -#ifdef CONFIG_AUFS_HNOTIFY - struct au_hnotify *hi_notify; -#endif - - /* reference to the copied-up whiteout with get/put */ - struct dentry *hi_whdentry; -}; - -/* ig_flags */ -#define AuIG_HALF_REFRESHED 1 -#define au_ig_ftest(flags, name) ((flags) & AuIG_##name) -#define au_ig_fset(flags, name) \ - do { (flags) |= AuIG_##name; } while (0) -#define au_ig_fclr(flags, name) \ - do { (flags) &= ~AuIG_##name; } while (0) - -struct au_iigen { - __u32 ig_generation, ig_flags; -}; - -struct au_vdir; -struct au_iinfo { - spinlock_t ii_genspin; - struct au_iigen ii_generation; - struct super_block *ii_hsb1; /* no get/put */ - - struct au_rwsem ii_rwsem; - aufs_bindex_t ii_bstart, ii_bend; - __u32 ii_higen; - struct au_hinode *ii_hinode; - struct au_vdir *ii_vdir; -}; - -struct au_icntnr { - struct au_iinfo iinfo; - struct inode vfs_inode; -} ____cacheline_aligned_in_smp; - -/* au_pin flags */ -#define AuPin_DI_LOCKED 1 -#define AuPin_MNT_WRITE (1 << 1) -#define au_ftest_pin(flags, name) ((flags) & AuPin_##name) -#define au_fset_pin(flags, name) \ - do { (flags) |= AuPin_##name; } while (0) -#define au_fclr_pin(flags, name) \ - do { (flags) &= ~AuPin_##name; } while (0) - -struct au_pin { - /* input */ - struct dentry *dentry; - unsigned int udba; - unsigned char lsc_di, lsc_hi, flags; - aufs_bindex_t bindex; - - /* output */ - struct dentry *parent; - struct au_hinode *hdir; - struct vfsmount *h_mnt; - - /* temporary unlock/relock for copyup */ - struct dentry *h_dentry, *h_parent; - struct au_branch *br; - struct task_struct *task; -}; - -void au_pin_hdir_unlock(struct au_pin *p); -int au_pin_hdir_lock(struct au_pin *p); -int au_pin_hdir_relock(struct au_pin *p); -void au_pin_hdir_set_owner(struct au_pin *p, struct task_struct *task); -void au_pin_hdir_acquire_nest(struct au_pin *p); -void au_pin_hdir_release(struct au_pin *p); - -/* ---------------------------------------------------------------------- */ - -static inline struct au_iinfo *au_ii(struct inode *inode) -{ - struct au_iinfo *iinfo; - - iinfo = &(container_of(inode, struct au_icntnr, vfs_inode)->iinfo); - if (iinfo->ii_hinode) - return iinfo; - return NULL; /* debugging bad_inode case */ -} - -/* ---------------------------------------------------------------------- */ - -/* inode.c */ -struct inode *au_igrab(struct inode *inode); -int au_refresh_hinode_self(struct inode *inode); -int au_refresh_hinode(struct inode *inode, struct dentry *dentry); -int au_ino(struct super_block *sb, aufs_bindex_t bindex, ino_t h_ino, - unsigned int d_type, ino_t *ino); -struct inode *au_new_inode(struct dentry *dentry, int must_new); -int au_test_ro(struct super_block *sb, aufs_bindex_t bindex, - struct inode *inode); -int au_test_h_perm(struct inode *h_inode, int mask); -int au_test_h_perm_sio(struct inode *h_inode, int mask); - -static inline int au_wh_ino(struct super_block *sb, aufs_bindex_t bindex, - ino_t h_ino, unsigned int d_type, ino_t *ino) -{ -#ifdef CONFIG_AUFS_SHWH - return au_ino(sb, bindex, h_ino, d_type, ino); -#else - return 0; -#endif -} - -/* i_op.c */ -extern struct inode_operations aufs_iop, aufs_symlink_iop, aufs_dir_iop; - -/* au_wr_dir flags */ -#define AuWrDir_ADD_ENTRY 1 -#define AuWrDir_TMP_WHENTRY (1 << 1) -#define AuWrDir_ISDIR (1 << 2) -#define au_ftest_wrdir(flags, name) ((flags) & AuWrDir_##name) -#define au_fset_wrdir(flags, name) \ - do { (flags) |= AuWrDir_##name; } while (0) -#define au_fclr_wrdir(flags, name) \ - do { (flags) &= ~AuWrDir_##name; } while (0) - -struct au_wr_dir_args { - aufs_bindex_t force_btgt; - unsigned char flags; -}; -int au_wr_dir(struct dentry *dentry, struct dentry *src_dentry, - struct au_wr_dir_args *args); - -struct dentry *au_pinned_h_parent(struct au_pin *pin); -void au_pin_init(struct au_pin *pin, struct dentry *dentry, - aufs_bindex_t bindex, int lsc_di, int lsc_hi, - unsigned int udba, unsigned char flags); -int au_pin(struct au_pin *pin, struct dentry *dentry, aufs_bindex_t bindex, - unsigned int udba, unsigned char flags) __must_check; -int au_do_pin(struct au_pin *pin) __must_check; -void au_unpin(struct au_pin *pin); -int au_reval_for_attr(struct dentry *dentry, unsigned int sigen); - -#define AuIcpup_DID_CPUP 1 -#define au_ftest_icpup(flags, name) ((flags) & AuIcpup_##name) -#define au_fset_icpup(flags, name) \ - do { (flags) |= AuIcpup_##name; } while (0) -#define au_fclr_icpup(flags, name) \ - do { (flags) &= ~AuIcpup_##name; } while (0) - -struct au_icpup_args { - unsigned char flags; - unsigned char pin_flags; - aufs_bindex_t btgt; - unsigned int udba; - struct au_pin pin; - struct path h_path; - struct inode *h_inode; -}; - -int au_pin_and_icpup(struct dentry *dentry, struct iattr *ia, - struct au_icpup_args *a); - -int au_h_path_getattr(struct dentry *dentry, int force, struct path *h_path); - -/* i_op_add.c */ -int au_may_add(struct dentry *dentry, aufs_bindex_t bindex, - struct dentry *h_parent, int isdir); -int aufs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, - dev_t dev); -int aufs_symlink(struct inode *dir, struct dentry *dentry, const char *symname); -int aufs_create(struct inode *dir, struct dentry *dentry, umode_t mode, - bool want_excl); -int aufs_link(struct dentry *src_dentry, struct inode *dir, - struct dentry *dentry); -int aufs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode); - -/* i_op_del.c */ -int au_wr_dir_need_wh(struct dentry *dentry, int isdir, aufs_bindex_t *bcpup); -int au_may_del(struct dentry *dentry, aufs_bindex_t bindex, - struct dentry *h_parent, int isdir); -int aufs_unlink(struct inode *dir, struct dentry *dentry); -int aufs_rmdir(struct inode *dir, struct dentry *dentry); - -/* i_op_ren.c */ -int au_wbr(struct dentry *dentry, aufs_bindex_t btgt); -int aufs_rename(struct inode *src_dir, struct dentry *src_dentry, - struct inode *dir, struct dentry *dentry); - -/* iinfo.c */ -struct inode *au_h_iptr(struct inode *inode, aufs_bindex_t bindex); -void au_hiput(struct au_hinode *hinode); -void au_set_hi_wh(struct inode *inode, aufs_bindex_t bindex, - struct dentry *h_wh); -unsigned int au_hi_flags(struct inode *inode, int isdir); - -/* hinode flags */ -#define AuHi_XINO 1 -#define AuHi_HNOTIFY (1 << 1) -#define au_ftest_hi(flags, name) ((flags) & AuHi_##name) -#define au_fset_hi(flags, name) \ - do { (flags) |= AuHi_##name; } while (0) -#define au_fclr_hi(flags, name) \ - do { (flags) &= ~AuHi_##name; } while (0) - -#ifndef CONFIG_AUFS_HNOTIFY -#undef AuHi_HNOTIFY -#define AuHi_HNOTIFY 0 -#endif - -void au_set_h_iptr(struct inode *inode, aufs_bindex_t bindex, - struct inode *h_inode, unsigned int flags); - -void au_update_iigen(struct inode *inode, int half); -void au_update_ibrange(struct inode *inode, int do_put_zero); - -void au_icntnr_init_once(void *_c); -int au_iinfo_init(struct inode *inode); -void au_iinfo_fin(struct inode *inode); -int au_ii_realloc(struct au_iinfo *iinfo, int nbr); - -#ifdef CONFIG_PROC_FS -/* plink.c */ -int au_plink_maint(struct super_block *sb, int flags); -void au_plink_maint_leave(struct au_sbinfo *sbinfo); -int au_plink_maint_enter(struct super_block *sb); -#ifdef CONFIG_AUFS_DEBUG -void au_plink_list(struct super_block *sb); -#else -AuStubVoid(au_plink_list, struct super_block *sb) -#endif -int au_plink_test(struct inode *inode); -struct dentry *au_plink_lkup(struct inode *inode, aufs_bindex_t bindex); -void au_plink_append(struct inode *inode, aufs_bindex_t bindex, - struct dentry *h_dentry); -void au_plink_put(struct super_block *sb, int verbose); -void au_plink_clean(struct super_block *sb, int verbose); -void au_plink_half_refresh(struct super_block *sb, aufs_bindex_t br_id); -#else -AuStubInt0(au_plink_maint, struct super_block *sb, int flags); -AuStubVoid(au_plink_maint_leave, struct au_sbinfo *sbinfo); -AuStubInt0(au_plink_maint_enter, struct super_block *sb); -AuStubVoid(au_plink_list, struct super_block *sb); -AuStubInt0(au_plink_test, struct inode *inode); -AuStub(struct dentry *, au_plink_lkup, return NULL, - struct inode *inode, aufs_bindex_t bindex); -AuStubVoid(au_plink_append, struct inode *inode, aufs_bindex_t bindex, - struct dentry *h_dentry); -AuStubVoid(au_plink_put, struct super_block *sb, int verbose); -AuStubVoid(au_plink_clean, struct super_block *sb, int verbose); -AuStubVoid(au_plink_half_refresh, struct super_block *sb, aufs_bindex_t br_id); -#endif /* CONFIG_PROC_FS */ - -#ifdef CONFIG_AUFS_XATTR -/* xattr.c */ -int au_cpup_xattr(struct dentry *h_dst, struct dentry *h_src, int ignore_flags); -ssize_t aufs_listxattr(struct dentry *dentry, char *list, size_t size); -ssize_t aufs_getxattr(struct dentry *dentry, const char *name, void *value, - size_t size); -int aufs_setxattr(struct dentry *dentry, const char *name, const void *value, - size_t size, int flags); -int aufs_removexattr(struct dentry *dentry, const char *name); - -/* void au_xattr_init(struct super_block *sb); */ -#else -AuStubInt0(au_cpup_xattr, struct dentry *h_dst, struct dentry *h_src, - int ignore_flags); -/* AuStubVoid(au_xattr_init, struct super_block *sb); */ -#endif - - -/* ---------------------------------------------------------------------- */ - -/* lock subclass for iinfo */ -enum { - AuLsc_II_CHILD, /* child first */ - AuLsc_II_CHILD2, /* rename(2), link(2), and cpup at hnotify */ - AuLsc_II_CHILD3, /* copyup dirs */ - AuLsc_II_PARENT, /* see AuLsc_I_PARENT in vfsub.h */ - AuLsc_II_PARENT2, - AuLsc_II_PARENT3, /* copyup dirs */ - AuLsc_II_NEW_CHILD -}; - -/* - * ii_read_lock_child, ii_write_lock_child, - * ii_read_lock_child2, ii_write_lock_child2, - * ii_read_lock_child3, ii_write_lock_child3, - * ii_read_lock_parent, ii_write_lock_parent, - * ii_read_lock_parent2, ii_write_lock_parent2, - * ii_read_lock_parent3, ii_write_lock_parent3, - * ii_read_lock_new_child, ii_write_lock_new_child, - */ -#define AuReadLockFunc(name, lsc) \ -static inline void ii_read_lock_##name(struct inode *i) \ -{ \ - au_rw_read_lock_nested(&au_ii(i)->ii_rwsem, AuLsc_II_##lsc); \ -} - -#define AuWriteLockFunc(name, lsc) \ -static inline void ii_write_lock_##name(struct inode *i) \ -{ \ - au_rw_write_lock_nested(&au_ii(i)->ii_rwsem, AuLsc_II_##lsc); \ -} - -#define AuRWLockFuncs(name, lsc) \ - AuReadLockFunc(name, lsc) \ - AuWriteLockFunc(name, lsc) - -AuRWLockFuncs(child, CHILD); -AuRWLockFuncs(child2, CHILD2); -AuRWLockFuncs(child3, CHILD3); -AuRWLockFuncs(parent, PARENT); -AuRWLockFuncs(parent2, PARENT2); -AuRWLockFuncs(parent3, PARENT3); -AuRWLockFuncs(new_child, NEW_CHILD); - -#undef AuReadLockFunc -#undef AuWriteLockFunc -#undef AuRWLockFuncs - -/* - * ii_read_unlock, ii_write_unlock, ii_downgrade_lock - */ -AuSimpleUnlockRwsemFuncs(ii, struct inode *i, &au_ii(i)->ii_rwsem); - -#define IiMustNoWaiters(i) AuRwMustNoWaiters(&au_ii(i)->ii_rwsem) -#define IiMustAnyLock(i) AuRwMustAnyLock(&au_ii(i)->ii_rwsem) -#define IiMustWriteLock(i) AuRwMustWriteLock(&au_ii(i)->ii_rwsem) - -/* ---------------------------------------------------------------------- */ - -static inline void au_icntnr_init(struct au_icntnr *c) -{ -#ifdef CONFIG_AUFS_DEBUG - c->vfs_inode.i_mode = 0; -#endif -} - -static inline unsigned int au_iigen(struct inode *inode, struct au_iigen *iigen) -{ - unsigned int gen; - struct au_iinfo *iinfo; - - iinfo = au_ii(inode); - spin_lock(&iinfo->ii_genspin); - if (iigen) - *iigen = iinfo->ii_generation; - gen = iinfo->ii_generation.ig_generation; - spin_unlock(&iinfo->ii_genspin); - - return gen; -} - -/* tiny test for inode number */ -/* tmpfs generation is too rough */ -static inline int au_test_higen(struct inode *inode, struct inode *h_inode) -{ - struct au_iinfo *iinfo; - - iinfo = au_ii(inode); - AuRwMustAnyLock(&iinfo->ii_rwsem); - return !(iinfo->ii_hsb1 == h_inode->i_sb - && iinfo->ii_higen == h_inode->i_generation); -} - -static inline void au_iigen_dec(struct inode *inode) -{ - struct au_iinfo *iinfo; - - iinfo = au_ii(inode); - spin_lock(&iinfo->ii_genspin); - iinfo->ii_generation.ig_generation--; - spin_unlock(&iinfo->ii_genspin); -} - -static inline int au_iigen_test(struct inode *inode, unsigned int sigen) -{ - int err; - - err = 0; - if (unlikely(inode && au_iigen(inode, NULL) != sigen)) - err = -EIO; - - return err; -} - -/* ---------------------------------------------------------------------- */ - -static inline aufs_bindex_t au_ii_br_id(struct inode *inode, - aufs_bindex_t bindex) -{ - IiMustAnyLock(inode); - return au_ii(inode)->ii_hinode[0 + bindex].hi_id; -} - -static inline aufs_bindex_t au_ibstart(struct inode *inode) -{ - IiMustAnyLock(inode); - return au_ii(inode)->ii_bstart; -} - -static inline aufs_bindex_t au_ibend(struct inode *inode) -{ - IiMustAnyLock(inode); - return au_ii(inode)->ii_bend; -} - -static inline struct au_vdir *au_ivdir(struct inode *inode) -{ - IiMustAnyLock(inode); - return au_ii(inode)->ii_vdir; -} - -static inline struct dentry *au_hi_wh(struct inode *inode, aufs_bindex_t bindex) -{ - IiMustAnyLock(inode); - return au_ii(inode)->ii_hinode[0 + bindex].hi_whdentry; -} - -static inline void au_set_ibstart(struct inode *inode, aufs_bindex_t bindex) -{ - IiMustWriteLock(inode); - au_ii(inode)->ii_bstart = bindex; -} - -static inline void au_set_ibend(struct inode *inode, aufs_bindex_t bindex) -{ - IiMustWriteLock(inode); - au_ii(inode)->ii_bend = bindex; -} - -static inline void au_set_ivdir(struct inode *inode, struct au_vdir *vdir) -{ - IiMustWriteLock(inode); - au_ii(inode)->ii_vdir = vdir; -} - -static inline struct au_hinode *au_hi(struct inode *inode, aufs_bindex_t bindex) -{ - IiMustAnyLock(inode); - return au_ii(inode)->ii_hinode + bindex; -} - -/* ---------------------------------------------------------------------- */ - -static inline struct dentry *au_pinned_parent(struct au_pin *pin) -{ - if (pin) - return pin->parent; - return NULL; -} - -static inline struct inode *au_pinned_h_dir(struct au_pin *pin) -{ - if (pin && pin->hdir) - return pin->hdir->hi_inode; - return NULL; -} - -static inline struct au_hinode *au_pinned_hdir(struct au_pin *pin) -{ - if (pin) - return pin->hdir; - return NULL; -} - -static inline void au_pin_set_dentry(struct au_pin *pin, struct dentry *dentry) -{ - if (pin) - pin->dentry = dentry; -} - -static inline void au_pin_set_parent_lflag(struct au_pin *pin, - unsigned char lflag) -{ - if (pin) { - if (lflag) - au_fset_pin(pin->flags, DI_LOCKED); - else - au_fclr_pin(pin->flags, DI_LOCKED); - } -} - -static inline void au_pin_set_parent(struct au_pin *pin, struct dentry *parent) -{ - if (pin) { - dput(pin->parent); - pin->parent = dget(parent); - } -} - -/* ---------------------------------------------------------------------- */ - -struct au_branch; -#ifdef CONFIG_AUFS_HNOTIFY -struct au_hnotify_op { - void (*ctl)(struct au_hinode *hinode, int do_set); - int (*alloc)(struct au_hinode *hinode); - - /* - * if it returns true, the the caller should free hinode->hi_notify, - * otherwise ->free() frees it. - */ - int (*free)(struct au_hinode *hinode, - struct au_hnotify *hn) __must_check; - - void (*fin)(void); - int (*init)(void); - - int (*reset_br)(unsigned int udba, struct au_branch *br, int perm); - void (*fin_br)(struct au_branch *br); - int (*init_br)(struct au_branch *br, int perm); -}; - -/* hnotify.c */ -int au_hn_alloc(struct au_hinode *hinode, struct inode *inode); -void au_hn_free(struct au_hinode *hinode); -void au_hn_ctl(struct au_hinode *hinode, int do_set); -void au_hn_reset(struct inode *inode, unsigned int flags); -int au_hnotify(struct inode *h_dir, struct au_hnotify *hnotify, u32 mask, - struct qstr *h_child_qstr, struct inode *h_child_inode); -int au_hnotify_reset_br(unsigned int udba, struct au_branch *br, int perm); -int au_hnotify_init_br(struct au_branch *br, int perm); -void au_hnotify_fin_br(struct au_branch *br); -int __init au_hnotify_init(void); -void au_hnotify_fin(void); - -/* hfsnotify.c */ -extern const struct au_hnotify_op au_hnotify_op; - -static inline -void au_hn_init(struct au_hinode *hinode) -{ - hinode->hi_notify = NULL; -} - -static inline struct au_hnotify *au_hn(struct au_hinode *hinode) -{ - return hinode->hi_notify; -} - -#else -AuStub(int, au_hn_alloc, return -EOPNOTSUPP, - struct au_hinode *hinode __maybe_unused, - struct inode *inode __maybe_unused) -AuStub(struct au_hnotify *, au_hn, return NULL, struct au_hinode *hinode) -AuStubVoid(au_hn_free, struct au_hinode *hinode __maybe_unused) -AuStubVoid(au_hn_ctl, struct au_hinode *hinode __maybe_unused, - int do_set __maybe_unused) -AuStubVoid(au_hn_reset, struct inode *inode __maybe_unused, - unsigned int flags __maybe_unused) -AuStubInt0(au_hnotify_reset_br, unsigned int udba __maybe_unused, - struct au_branch *br __maybe_unused, - int perm __maybe_unused) -AuStubInt0(au_hnotify_init_br, struct au_branch *br __maybe_unused, - int perm __maybe_unused) -AuStubVoid(au_hnotify_fin_br, struct au_branch *br __maybe_unused) -AuStubInt0(__init au_hnotify_init, void) -AuStubVoid(au_hnotify_fin, void) -AuStubVoid(au_hn_init, struct au_hinode *hinode __maybe_unused) -#endif /* CONFIG_AUFS_HNOTIFY */ - -static inline void au_hn_suspend(struct au_hinode *hdir) -{ - au_hn_ctl(hdir, /*do_set*/0); -} - -static inline void au_hn_resume(struct au_hinode *hdir) -{ - au_hn_ctl(hdir, /*do_set*/1); -} - -static inline void au_hn_imtx_lock(struct au_hinode *hdir) -{ - mutex_lock(&hdir->hi_inode->i_mutex); - au_hn_suspend(hdir); -} - -static inline void au_hn_imtx_lock_nested(struct au_hinode *hdir, - unsigned int sc __maybe_unused) -{ - mutex_lock_nested(&hdir->hi_inode->i_mutex, sc); - au_hn_suspend(hdir); -} - -static inline void au_hn_imtx_unlock(struct au_hinode *hdir) -{ - au_hn_resume(hdir); - mutex_unlock(&hdir->hi_inode->i_mutex); -} - -#endif /* __KERNEL__ */ -#endif /* __AUFS_INODE_H__ */ diff --git a/fs/aufs/ioctl.c b/fs/aufs/ioctl.c deleted file mode 100644 index cce07d7fb63782..00000000000000 --- a/fs/aufs/ioctl.c +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * ioctl - * plink-management and readdir in userspace. - * assist the pathconf(3) wrapper library. - * move-down - * File-based Hierarchical Storage Management. - */ - -#include -#include -#include "aufs.h" - -static int au_wbr_fd(struct path *path, struct aufs_wbr_fd __user *arg) -{ - int err, fd; - aufs_bindex_t wbi, bindex, bend; - struct file *h_file; - struct super_block *sb; - struct dentry *root; - struct au_branch *br; - struct aufs_wbr_fd wbrfd = { - .oflags = au_dir_roflags, - .brid = -1 - }; - const int valid = O_RDONLY | O_NONBLOCK | O_LARGEFILE | O_DIRECTORY - | O_NOATIME | O_CLOEXEC; - - AuDebugOn(wbrfd.oflags & ~valid); - - if (arg) { - err = copy_from_user(&wbrfd, arg, sizeof(wbrfd)); - if (unlikely(err)) { - err = -EFAULT; - goto out; - } - - err = -EINVAL; - AuDbg("wbrfd{0%o, %d}\n", wbrfd.oflags, wbrfd.brid); - wbrfd.oflags |= au_dir_roflags; - AuDbg("0%o\n", wbrfd.oflags); - if (unlikely(wbrfd.oflags & ~valid)) - goto out; - } - - fd = get_unused_fd(); - err = fd; - if (unlikely(fd < 0)) - goto out; - - h_file = ERR_PTR(-EINVAL); - wbi = 0; - br = NULL; - sb = path->dentry->d_sb; - root = sb->s_root; - aufs_read_lock(root, AuLock_IR); - bend = au_sbend(sb); - if (wbrfd.brid >= 0) { - wbi = au_br_index(sb, wbrfd.brid); - if (unlikely(wbi < 0 || wbi > bend)) - goto out_unlock; - } - - h_file = ERR_PTR(-ENOENT); - br = au_sbr(sb, wbi); - if (!au_br_writable(br->br_perm)) { - if (arg) - goto out_unlock; - - bindex = wbi + 1; - wbi = -1; - for (; bindex <= bend; bindex++) { - br = au_sbr(sb, bindex); - if (au_br_writable(br->br_perm)) { - wbi = bindex; - br = au_sbr(sb, wbi); - break; - } - } - } - AuDbg("wbi %d\n", wbi); - if (wbi >= 0) - h_file = au_h_open(root, wbi, wbrfd.oflags, NULL, - /*force_wr*/0); - -out_unlock: - aufs_read_unlock(root, AuLock_IR); - err = PTR_ERR(h_file); - if (IS_ERR(h_file)) - goto out_fd; - - atomic_dec(&br->br_count); /* cf. au_h_open() */ - fd_install(fd, h_file); - err = fd; - goto out; /* success */ - -out_fd: - put_unused_fd(fd); -out: - AuTraceErr(err); - return err; -} - -/* ---------------------------------------------------------------------- */ - -long aufs_ioctl_dir(struct file *file, unsigned int cmd, unsigned long arg) -{ - long err; - struct dentry *dentry; - - switch (cmd) { - case AUFS_CTL_RDU: - case AUFS_CTL_RDU_INO: - err = au_rdu_ioctl(file, cmd, arg); - break; - - case AUFS_CTL_WBR_FD: - err = au_wbr_fd(&file->f_path, (void __user *)arg); - break; - - case AUFS_CTL_IBUSY: - err = au_ibusy_ioctl(file, arg); - break; - - case AUFS_CTL_BRINFO: - err = au_brinfo_ioctl(file, arg); - break; - - case AUFS_CTL_FHSM_FD: - dentry = file->f_dentry; - if (IS_ROOT(dentry)) - err = au_fhsm_fd(dentry->d_sb, arg); - else - err = -ENOTTY; - break; - - default: - /* do not call the lower */ - AuDbg("0x%x\n", cmd); - err = -ENOTTY; - } - - AuTraceErr(err); - return err; -} - -long aufs_ioctl_nondir(struct file *file, unsigned int cmd, unsigned long arg) -{ - long err; - - switch (cmd) { - case AUFS_CTL_MVDOWN: - err = au_mvdown(file->f_dentry, (void __user *)arg); - break; - - case AUFS_CTL_WBR_FD: - err = au_wbr_fd(&file->f_path, (void __user *)arg); - break; - - default: - /* do not call the lower */ - AuDbg("0x%x\n", cmd); - err = -ENOTTY; - } - - AuTraceErr(err); - return err; -} - -#ifdef CONFIG_COMPAT -long aufs_compat_ioctl_dir(struct file *file, unsigned int cmd, - unsigned long arg) -{ - long err; - - switch (cmd) { - case AUFS_CTL_RDU: - case AUFS_CTL_RDU_INO: - err = au_rdu_compat_ioctl(file, cmd, arg); - break; - - case AUFS_CTL_IBUSY: - err = au_ibusy_compat_ioctl(file, arg); - break; - - case AUFS_CTL_BRINFO: - err = au_brinfo_compat_ioctl(file, arg); - break; - - default: - err = aufs_ioctl_dir(file, cmd, arg); - } - - AuTraceErr(err); - return err; -} - -long aufs_compat_ioctl_nondir(struct file *file, unsigned int cmd, - unsigned long arg) -{ - return aufs_ioctl_nondir(file, cmd, (unsigned long)compat_ptr(arg)); -} -#endif diff --git a/fs/aufs/loop.c b/fs/aufs/loop.c deleted file mode 100644 index 642df0e8aa1a54..00000000000000 --- a/fs/aufs/loop.c +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * support for loopback block device as a branch - */ - -#include -#include "aufs.h" - -/* - * test if two lower dentries have overlapping branches. - */ -int au_test_loopback_overlap(struct super_block *sb, struct dentry *h_adding) -{ - struct super_block *h_sb; - struct loop_device *l; - - h_sb = h_adding->d_sb; - if (MAJOR(h_sb->s_dev) != LOOP_MAJOR) - return 0; - - l = h_sb->s_bdev->bd_disk->private_data; - h_adding = l->lo_backing_file->f_dentry; - /* - * h_adding can be local NFS. - * in this case aufs cannot detect the loop. - */ - if (unlikely(h_adding->d_sb == sb)) - return 1; - return !!au_test_subdir(h_adding, sb->s_root); -} - -/* true if a kernel thread named 'loop[0-9].*' accesses a file */ -int au_test_loopback_kthread(void) -{ - int ret; - struct task_struct *tsk = current; - char c, comm[sizeof(tsk->comm)]; - - ret = 0; - if (tsk->flags & PF_KTHREAD) { - get_task_comm(comm, tsk); - c = comm[4]; - ret = ('0' <= c && c <= '9' - && !strncmp(comm, "loop", 4)); - } - - return ret; -} - -/* ---------------------------------------------------------------------- */ - -#define au_warn_loopback_step 16 -static int au_warn_loopback_nelem = au_warn_loopback_step; -static unsigned long *au_warn_loopback_array; - -void au_warn_loopback(struct super_block *h_sb) -{ - int i, new_nelem; - unsigned long *a, magic; - static DEFINE_SPINLOCK(spin); - - magic = h_sb->s_magic; - spin_lock(&spin); - a = au_warn_loopback_array; - for (i = 0; i < au_warn_loopback_nelem && *a; i++) - if (a[i] == magic) { - spin_unlock(&spin); - return; - } - - /* h_sb is new to us, print it */ - if (i < au_warn_loopback_nelem) { - a[i] = magic; - goto pr; - } - - /* expand the array */ - new_nelem = au_warn_loopback_nelem + au_warn_loopback_step; - a = au_kzrealloc(au_warn_loopback_array, - au_warn_loopback_nelem * sizeof(unsigned long), - new_nelem * sizeof(unsigned long), GFP_ATOMIC); - if (a) { - au_warn_loopback_nelem = new_nelem; - au_warn_loopback_array = a; - a[i] = magic; - goto pr; - } - - spin_unlock(&spin); - AuWarn1("realloc failed, ignored\n"); - return; - -pr: - spin_unlock(&spin); - pr_warn("you may want to try another patch for loopback file " - "on %s(0x%lx) branch\n", au_sbtype(h_sb), magic); -} - -int au_loopback_init(void) -{ - int err; - struct super_block *sb __maybe_unused; - - AuDebugOn(sizeof(sb->s_magic) != sizeof(unsigned long)); - - err = 0; - au_warn_loopback_array = kcalloc(au_warn_loopback_step, - sizeof(unsigned long), GFP_NOFS); - if (unlikely(!au_warn_loopback_array)) - err = -ENOMEM; - - return err; -} - -void au_loopback_fin(void) -{ - kfree(au_warn_loopback_array); -} diff --git a/fs/aufs/loop.h b/fs/aufs/loop.h deleted file mode 100644 index db430fe41eb1b0..00000000000000 --- a/fs/aufs/loop.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * support for loopback mount as a branch - */ - -#ifndef __AUFS_LOOP_H__ -#define __AUFS_LOOP_H__ - -#ifdef __KERNEL__ - -struct dentry; -struct super_block; - -#ifdef CONFIG_AUFS_BDEV_LOOP -/* loop.c */ -int au_test_loopback_overlap(struct super_block *sb, struct dentry *h_adding); -int au_test_loopback_kthread(void); -void au_warn_loopback(struct super_block *h_sb); - -int au_loopback_init(void); -void au_loopback_fin(void); -#else -AuStubInt0(au_test_loopback_overlap, struct super_block *sb, - struct dentry *h_adding) -AuStubInt0(au_test_loopback_kthread, void) -AuStubVoid(au_warn_loopback, struct super_block *h_sb) - -AuStubInt0(au_loopback_init, void) -AuStubVoid(au_loopback_fin, void) -#endif /* BLK_DEV_LOOP */ - -#endif /* __KERNEL__ */ -#endif /* __AUFS_LOOP_H__ */ diff --git a/fs/aufs/magic.mk b/fs/aufs/magic.mk deleted file mode 100644 index 3e6387b01b497d..00000000000000 --- a/fs/aufs/magic.mk +++ /dev/null @@ -1,54 +0,0 @@ - -# defined in ${srctree}/fs/fuse/inode.c -# tristate -ifdef CONFIG_FUSE_FS -ccflags-y += -DFUSE_SUPER_MAGIC=0x65735546 -endif - -# defined in ${srctree}/fs/ocfs2/ocfs2_fs.h -# tristate -ifdef CONFIG_OCFS2_FS -ccflags-y += -DOCFS2_SUPER_MAGIC=0x7461636f -endif - -# defined in ${srctree}/fs/ocfs2/dlm/userdlm.h -# tristate -ifdef CONFIG_OCFS2_FS_O2CB -ccflags-y += -DDLMFS_MAGIC=0x76a9f425 -endif - -# defined in ${srctree}/fs/cifs/cifsfs.c -# tristate -ifdef CONFIG_CIFS_FS -ccflags-y += -DCIFS_MAGIC_NUMBER=0xFF534D42 -endif - -# defined in ${srctree}/fs/xfs/xfs_sb.h -# tristate -ifdef CONFIG_XFS_FS -ccflags-y += -DXFS_SB_MAGIC=0x58465342 -endif - -# defined in ${srctree}/fs/configfs/mount.c -# tristate -ifdef CONFIG_CONFIGFS_FS -ccflags-y += -DCONFIGFS_MAGIC=0x62656570 -endif - -# defined in ${srctree}/fs/9p/v9fs.h -# tristate -ifdef CONFIG_9P_FS -ccflags-y += -DV9FS_MAGIC=0x01021997 -endif - -# defined in ${srctree}/fs/ubifs/ubifs.h -# tristate -ifdef CONFIG_UBIFS_FS -ccflags-y += -DUBIFS_SUPER_MAGIC=0x24051905 -endif - -# defined in ${srctree}/fs/hfsplus/hfsplus_raw.h -# tristate -ifdef CONFIG_HFSPLUS_FS -ccflags-y += -DHFSPLUS_SUPER_MAGIC=0x482b -endif diff --git a/fs/aufs/module.c b/fs/aufs/module.c deleted file mode 100644 index 5bfb50058c2b11..00000000000000 --- a/fs/aufs/module.c +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * module global variables and operations - */ - -#include -#include -#include "aufs.h" - -void *au_kzrealloc(void *p, unsigned int nused, unsigned int new_sz, gfp_t gfp) -{ - if (new_sz <= nused) - return p; - - p = krealloc(p, new_sz, gfp); - if (p) - memset(p + nused, 0, new_sz - nused); - return p; -} - -/* ---------------------------------------------------------------------- */ - -/* - * aufs caches - */ -struct kmem_cache *au_cachep[AuCache_Last]; -static int __init au_cache_init(void) -{ - au_cachep[AuCache_DINFO] = AuCacheCtor(au_dinfo, au_di_init_once); - if (au_cachep[AuCache_DINFO]) - /* SLAB_DESTROY_BY_RCU */ - au_cachep[AuCache_ICNTNR] = AuCacheCtor(au_icntnr, - au_icntnr_init_once); - if (au_cachep[AuCache_ICNTNR]) - au_cachep[AuCache_FINFO] = AuCacheCtor(au_finfo, - au_fi_init_once); - if (au_cachep[AuCache_FINFO]) - au_cachep[AuCache_VDIR] = AuCache(au_vdir); - if (au_cachep[AuCache_VDIR]) - au_cachep[AuCache_DEHSTR] = AuCache(au_vdir_dehstr); - if (au_cachep[AuCache_DEHSTR]) - return 0; - - return -ENOMEM; -} - -static void au_cache_fin(void) -{ - int i; - - /* - * Make sure all delayed rcu free inodes are flushed before we - * destroy cache. - */ - rcu_barrier(); - - /* excluding AuCache_HNOTIFY */ - BUILD_BUG_ON(AuCache_HNOTIFY + 1 != AuCache_Last); - for (i = 0; i < AuCache_HNOTIFY; i++) - if (au_cachep[i]) { - kmem_cache_destroy(au_cachep[i]); - au_cachep[i] = NULL; - } -} - -/* ---------------------------------------------------------------------- */ - -int au_dir_roflags; - -#ifdef CONFIG_AUFS_SBILIST -/* - * iterate_supers_type() doesn't protect us from - * remounting (branch management) - */ -struct au_splhead au_sbilist; -#endif - -struct lock_class_key au_lc_key[AuLcKey_Last]; - -/* - * functions for module interface. - */ -MODULE_LICENSE("GPL"); -/* MODULE_LICENSE("GPL v2"); */ -MODULE_AUTHOR("Junjiro R. Okajima "); -MODULE_DESCRIPTION(AUFS_NAME - " -- Advanced multi layered unification filesystem"); -MODULE_VERSION(AUFS_VERSION); -MODULE_ALIAS_FS(AUFS_NAME); - -/* this module parameter has no meaning when SYSFS is disabled */ -int sysaufs_brs = 1; -MODULE_PARM_DESC(brs, "use /fs/aufs/si_*/brN"); -module_param_named(brs, sysaufs_brs, int, S_IRUGO); - -/* this module parameter has no meaning when USER_NS is disabled */ -static bool au_userns; -MODULE_PARM_DESC(allow_userns, "allow unprivileged to mount under userns"); -module_param_named(allow_userns, au_userns, bool, S_IRUGO); - -/* ---------------------------------------------------------------------- */ - -static char au_esc_chars[0x20 + 3]; /* 0x01-0x20, backslash, del, and NULL */ - -int au_seq_path(struct seq_file *seq, struct path *path) -{ - return seq_path(seq, path, au_esc_chars); -} - -/* ---------------------------------------------------------------------- */ - -static int __init aufs_init(void) -{ - int err, i; - char *p; - - p = au_esc_chars; - for (i = 1; i <= ' '; i++) - *p++ = i; - *p++ = '\\'; - *p++ = '\x7f'; - *p = 0; - - au_dir_roflags = au_file_roflags(O_DIRECTORY | O_LARGEFILE); - - au_sbilist_init(); - sysaufs_brs_init(); - au_debug_init(); - au_dy_init(); - err = sysaufs_init(); - if (unlikely(err)) - goto out; - err = au_procfs_init(); - if (unlikely(err)) - goto out_sysaufs; - err = au_wkq_init(); - if (unlikely(err)) - goto out_procfs; - err = au_loopback_init(); - if (unlikely(err)) - goto out_wkq; - err = au_hnotify_init(); - if (unlikely(err)) - goto out_loopback; - err = au_sysrq_init(); - if (unlikely(err)) - goto out_hin; - err = au_cache_init(); - if (unlikely(err)) - goto out_sysrq; - - aufs_fs_type.fs_flags |= au_userns ? FS_USERNS_MOUNT : 0; - err = register_filesystem(&aufs_fs_type); - if (unlikely(err)) - goto out_cache; - - /* since we define pr_fmt, call printk directly */ - printk(KERN_INFO AUFS_NAME " " AUFS_VERSION "\n"); - goto out; /* success */ - -out_cache: - au_cache_fin(); -out_sysrq: - au_sysrq_fin(); -out_hin: - au_hnotify_fin(); -out_loopback: - au_loopback_fin(); -out_wkq: - au_wkq_fin(); -out_procfs: - au_procfs_fin(); -out_sysaufs: - sysaufs_fin(); - au_dy_fin(); -out: - return err; -} - -static void __exit aufs_exit(void) -{ - unregister_filesystem(&aufs_fs_type); - au_cache_fin(); - au_sysrq_fin(); - au_hnotify_fin(); - au_loopback_fin(); - au_wkq_fin(); - au_procfs_fin(); - sysaufs_fin(); - au_dy_fin(); -} - -module_init(aufs_init); -module_exit(aufs_exit); diff --git a/fs/aufs/module.h b/fs/aufs/module.h deleted file mode 100644 index da2fb26a2e4a78..00000000000000 --- a/fs/aufs/module.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * module initialization and module-global - */ - -#ifndef __AUFS_MODULE_H__ -#define __AUFS_MODULE_H__ - -#ifdef __KERNEL__ - -#include - -struct path; -struct seq_file; - -/* module parameters */ -extern int sysaufs_brs; - -/* ---------------------------------------------------------------------- */ - -extern int au_dir_roflags; - -enum { - AuLcNonDir_FIINFO, - AuLcNonDir_DIINFO, - AuLcNonDir_IIINFO, - - AuLcDir_FIINFO, - AuLcDir_DIINFO, - AuLcDir_IIINFO, - - AuLcSymlink_DIINFO, - AuLcSymlink_IIINFO, - - AuLcKey_Last -}; -extern struct lock_class_key au_lc_key[AuLcKey_Last]; - -void *au_kzrealloc(void *p, unsigned int nused, unsigned int new_sz, gfp_t gfp); -int au_seq_path(struct seq_file *seq, struct path *path); - -#ifdef CONFIG_PROC_FS -/* procfs.c */ -int __init au_procfs_init(void); -void au_procfs_fin(void); -#else -AuStubInt0(au_procfs_init, void); -AuStubVoid(au_procfs_fin, void); -#endif - -/* ---------------------------------------------------------------------- */ - -/* kmem cache */ -enum { - AuCache_DINFO, - AuCache_ICNTNR, - AuCache_FINFO, - AuCache_VDIR, - AuCache_DEHSTR, - AuCache_HNOTIFY, /* must be last */ - AuCache_Last -}; - -#define AuCacheFlags (SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD) -#define AuCache(type) KMEM_CACHE(type, AuCacheFlags) -#define AuCacheCtor(type, ctor) \ - kmem_cache_create(#type, sizeof(struct type), \ - __alignof__(struct type), AuCacheFlags, ctor) - -extern struct kmem_cache *au_cachep[]; - -#define AuCacheFuncs(name, index) \ -static inline struct au_##name *au_cache_alloc_##name(void) \ -{ return kmem_cache_alloc(au_cachep[AuCache_##index], GFP_NOFS); } \ -static inline void au_cache_free_##name(struct au_##name *p) \ -{ kmem_cache_free(au_cachep[AuCache_##index], p); } - -AuCacheFuncs(dinfo, DINFO); -AuCacheFuncs(icntnr, ICNTNR); -AuCacheFuncs(finfo, FINFO); -AuCacheFuncs(vdir, VDIR); -AuCacheFuncs(vdir_dehstr, DEHSTR); -#ifdef CONFIG_AUFS_HNOTIFY -AuCacheFuncs(hnotify, HNOTIFY); -#endif - -#endif /* __KERNEL__ */ -#endif /* __AUFS_MODULE_H__ */ diff --git a/fs/aufs/mvdown.c b/fs/aufs/mvdown.c deleted file mode 100644 index b02a262550ad75..00000000000000 --- a/fs/aufs/mvdown.c +++ /dev/null @@ -1,680 +0,0 @@ -/* - * Copyright (C) 2011-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * move-down, opposite of copy-up - */ - -#include "aufs.h" - -struct au_mvd_args { - struct { - struct super_block *h_sb; - struct dentry *h_parent; - struct au_hinode *hdir; - struct inode *h_dir, *h_inode; - struct au_pin pin; - } info[AUFS_MVDOWN_NARRAY]; - - struct aufs_mvdown mvdown; - struct dentry *dentry, *parent; - struct inode *inode, *dir; - struct super_block *sb; - aufs_bindex_t bopq, bwh, bfound; - unsigned char rename_lock; -}; - -#define mvd_errno mvdown.au_errno -#define mvd_bsrc mvdown.stbr[AUFS_MVDOWN_UPPER].bindex -#define mvd_src_brid mvdown.stbr[AUFS_MVDOWN_UPPER].brid -#define mvd_bdst mvdown.stbr[AUFS_MVDOWN_LOWER].bindex -#define mvd_dst_brid mvdown.stbr[AUFS_MVDOWN_LOWER].brid - -#define mvd_h_src_sb info[AUFS_MVDOWN_UPPER].h_sb -#define mvd_h_src_parent info[AUFS_MVDOWN_UPPER].h_parent -#define mvd_hdir_src info[AUFS_MVDOWN_UPPER].hdir -#define mvd_h_src_dir info[AUFS_MVDOWN_UPPER].h_dir -#define mvd_h_src_inode info[AUFS_MVDOWN_UPPER].h_inode -#define mvd_pin_src info[AUFS_MVDOWN_UPPER].pin - -#define mvd_h_dst_sb info[AUFS_MVDOWN_LOWER].h_sb -#define mvd_h_dst_parent info[AUFS_MVDOWN_LOWER].h_parent -#define mvd_hdir_dst info[AUFS_MVDOWN_LOWER].hdir -#define mvd_h_dst_dir info[AUFS_MVDOWN_LOWER].h_dir -#define mvd_h_dst_inode info[AUFS_MVDOWN_LOWER].h_inode -#define mvd_pin_dst info[AUFS_MVDOWN_LOWER].pin - -#define AU_MVD_PR(flag, ...) do { \ - if (flag) \ - pr_err(__VA_ARGS__); \ - } while (0) - -static int find_lower_writable(struct au_mvd_args *a) -{ - struct super_block *sb; - aufs_bindex_t bindex, bend; - struct au_branch *br; - - sb = a->sb; - bindex = a->mvd_bsrc; - bend = au_sbend(sb); - if (a->mvdown.flags & AUFS_MVDOWN_FHSM_LOWER) - for (bindex++; bindex <= bend; bindex++) { - br = au_sbr(sb, bindex); - if (au_br_fhsm(br->br_perm) - && (!(au_br_sb(br)->s_flags & MS_RDONLY))) - return bindex; - } - else if (!(a->mvdown.flags & AUFS_MVDOWN_ROLOWER)) - for (bindex++; bindex <= bend; bindex++) { - br = au_sbr(sb, bindex); - if (!au_br_rdonly(br)) - return bindex; - } - else - for (bindex++; bindex <= bend; bindex++) { - br = au_sbr(sb, bindex); - if (!(au_br_sb(br)->s_flags & MS_RDONLY)) { - if (au_br_rdonly(br)) - a->mvdown.flags - |= AUFS_MVDOWN_ROLOWER_R; - return bindex; - } - } - - return -1; -} - -/* make the parent dir on bdst */ -static int au_do_mkdir(const unsigned char dmsg, struct au_mvd_args *a) -{ - int err; - - err = 0; - a->mvd_hdir_src = au_hi(a->dir, a->mvd_bsrc); - a->mvd_hdir_dst = au_hi(a->dir, a->mvd_bdst); - a->mvd_h_src_parent = au_h_dptr(a->parent, a->mvd_bsrc); - a->mvd_h_dst_parent = NULL; - if (au_dbend(a->parent) >= a->mvd_bdst) - a->mvd_h_dst_parent = au_h_dptr(a->parent, a->mvd_bdst); - if (!a->mvd_h_dst_parent) { - err = au_cpdown_dirs(a->dentry, a->mvd_bdst); - if (unlikely(err)) { - AU_MVD_PR(dmsg, "cpdown_dirs failed\n"); - goto out; - } - a->mvd_h_dst_parent = au_h_dptr(a->parent, a->mvd_bdst); - } - -out: - AuTraceErr(err); - return err; -} - -/* lock them all */ -static int au_do_lock(const unsigned char dmsg, struct au_mvd_args *a) -{ - int err; - struct dentry *h_trap; - - a->mvd_h_src_sb = au_sbr_sb(a->sb, a->mvd_bsrc); - a->mvd_h_dst_sb = au_sbr_sb(a->sb, a->mvd_bdst); - err = au_pin(&a->mvd_pin_dst, a->dentry, a->mvd_bdst, - au_opt_udba(a->sb), - AuPin_MNT_WRITE | AuPin_DI_LOCKED); - AuTraceErr(err); - if (unlikely(err)) { - AU_MVD_PR(dmsg, "pin_dst failed\n"); - goto out; - } - - if (a->mvd_h_src_sb != a->mvd_h_dst_sb) { - a->rename_lock = 0; - au_pin_init(&a->mvd_pin_src, a->dentry, a->mvd_bsrc, - AuLsc_DI_PARENT, AuLsc_I_PARENT3, - au_opt_udba(a->sb), - AuPin_MNT_WRITE | AuPin_DI_LOCKED); - err = au_do_pin(&a->mvd_pin_src); - AuTraceErr(err); - a->mvd_h_src_dir = a->mvd_h_src_parent->d_inode; - if (unlikely(err)) { - AU_MVD_PR(dmsg, "pin_src failed\n"); - goto out_dst; - } - goto out; /* success */ - } - - a->rename_lock = 1; - au_pin_hdir_unlock(&a->mvd_pin_dst); - err = au_pin(&a->mvd_pin_src, a->dentry, a->mvd_bsrc, - au_opt_udba(a->sb), - AuPin_MNT_WRITE | AuPin_DI_LOCKED); - AuTraceErr(err); - a->mvd_h_src_dir = a->mvd_h_src_parent->d_inode; - if (unlikely(err)) { - AU_MVD_PR(dmsg, "pin_src failed\n"); - au_pin_hdir_lock(&a->mvd_pin_dst); - goto out_dst; - } - au_pin_hdir_unlock(&a->mvd_pin_src); - h_trap = vfsub_lock_rename(a->mvd_h_src_parent, a->mvd_hdir_src, - a->mvd_h_dst_parent, a->mvd_hdir_dst); - if (h_trap) { - err = (h_trap != a->mvd_h_src_parent); - if (err) - err = (h_trap != a->mvd_h_dst_parent); - } - BUG_ON(err); /* it should never happen */ - if (unlikely(a->mvd_h_src_dir != au_pinned_h_dir(&a->mvd_pin_src))) { - err = -EBUSY; - AuTraceErr(err); - vfsub_unlock_rename(a->mvd_h_src_parent, a->mvd_hdir_src, - a->mvd_h_dst_parent, a->mvd_hdir_dst); - au_pin_hdir_lock(&a->mvd_pin_src); - au_unpin(&a->mvd_pin_src); - au_pin_hdir_lock(&a->mvd_pin_dst); - goto out_dst; - } - goto out; /* success */ - -out_dst: - au_unpin(&a->mvd_pin_dst); -out: - AuTraceErr(err); - return err; -} - -static void au_do_unlock(const unsigned char dmsg, struct au_mvd_args *a) -{ - if (!a->rename_lock) - au_unpin(&a->mvd_pin_src); - else { - vfsub_unlock_rename(a->mvd_h_src_parent, a->mvd_hdir_src, - a->mvd_h_dst_parent, a->mvd_hdir_dst); - au_pin_hdir_lock(&a->mvd_pin_src); - au_unpin(&a->mvd_pin_src); - au_pin_hdir_lock(&a->mvd_pin_dst); - } - au_unpin(&a->mvd_pin_dst); -} - -/* copy-down the file */ -static int au_do_cpdown(const unsigned char dmsg, struct au_mvd_args *a) -{ - int err; - struct au_cp_generic cpg = { - .dentry = a->dentry, - .bdst = a->mvd_bdst, - .bsrc = a->mvd_bsrc, - .len = -1, - .pin = &a->mvd_pin_dst, - .flags = AuCpup_DTIME | AuCpup_HOPEN - }; - - AuDbg("b%d, b%d\n", cpg.bsrc, cpg.bdst); - if (a->mvdown.flags & AUFS_MVDOWN_OWLOWER) - au_fset_cpup(cpg.flags, OVERWRITE); - if (a->mvdown.flags & AUFS_MVDOWN_ROLOWER) - au_fset_cpup(cpg.flags, RWDST); - err = au_sio_cpdown_simple(&cpg); - if (unlikely(err)) - AU_MVD_PR(dmsg, "cpdown failed\n"); - - AuTraceErr(err); - return err; -} - -/* - * unlink the whiteout on bdst if exist which may be created by UDBA while we - * were sleeping - */ -static int au_do_unlink_wh(const unsigned char dmsg, struct au_mvd_args *a) -{ - int err; - struct path h_path; - struct au_branch *br; - - br = au_sbr(a->sb, a->mvd_bdst); - h_path.dentry = au_wh_lkup(a->mvd_h_dst_parent, &a->dentry->d_name, br); - err = PTR_ERR(h_path.dentry); - if (IS_ERR(h_path.dentry)) { - AU_MVD_PR(dmsg, "wh_lkup failed\n"); - goto out; - } - - err = 0; - if (h_path.dentry->d_inode) { - h_path.mnt = au_br_mnt(br); - err = vfsub_unlink(a->mvd_h_dst_parent->d_inode, &h_path, - /*force*/0); - if (unlikely(err)) - AU_MVD_PR(dmsg, "wh_unlink failed\n"); - } - dput(h_path.dentry); - -out: - AuTraceErr(err); - return err; -} - -/* - * unlink the topmost h_dentry - */ -static int au_do_unlink(const unsigned char dmsg, struct au_mvd_args *a) -{ - int err; - struct path h_path; - - h_path.mnt = au_sbr_mnt(a->sb, a->mvd_bsrc); - h_path.dentry = au_h_dptr(a->dentry, a->mvd_bsrc); - err = vfsub_unlink(a->mvd_h_src_dir, &h_path, /*force*/0); - if (unlikely(err)) - AU_MVD_PR(dmsg, "unlink failed\n"); - - AuTraceErr(err); - return err; -} - -/* Since mvdown succeeded, we ignore an error of this function */ -static void au_do_stfs(const unsigned char dmsg, struct au_mvd_args *a) -{ - int err; - struct au_branch *br; - - a->mvdown.flags |= AUFS_MVDOWN_STFS_FAILED; - br = au_sbr(a->sb, a->mvd_bsrc); - err = au_br_stfs(br, &a->mvdown.stbr[AUFS_MVDOWN_UPPER].stfs); - if (!err) { - br = au_sbr(a->sb, a->mvd_bdst); - a->mvdown.stbr[AUFS_MVDOWN_LOWER].brid = br->br_id; - err = au_br_stfs(br, &a->mvdown.stbr[AUFS_MVDOWN_LOWER].stfs); - } - if (!err) - a->mvdown.flags &= ~AUFS_MVDOWN_STFS_FAILED; - else - AU_MVD_PR(dmsg, "statfs failed (%d), ignored\n", err); -} - -/* - * copy-down the file and unlink the bsrc file. - * - unlink the bdst whout if exist - * - copy-down the file (with whtmp name and rename) - * - unlink the bsrc file - */ -static int au_do_mvdown(const unsigned char dmsg, struct au_mvd_args *a) -{ - int err; - - err = au_do_mkdir(dmsg, a); - if (!err) - err = au_do_lock(dmsg, a); - if (unlikely(err)) - goto out; - - /* - * do not revert the activities we made on bdst since they should be - * harmless in aufs. - */ - - err = au_do_cpdown(dmsg, a); - if (!err) - err = au_do_unlink_wh(dmsg, a); - if (!err && !(a->mvdown.flags & AUFS_MVDOWN_KUPPER)) - err = au_do_unlink(dmsg, a); - if (unlikely(err)) - goto out_unlock; - - AuDbg("%pd2, 0x%x, %d --> %d\n", - a->dentry, a->mvdown.flags, a->mvd_bsrc, a->mvd_bdst); - if (find_lower_writable(a) < 0) - a->mvdown.flags |= AUFS_MVDOWN_BOTTOM; - - if (a->mvdown.flags & AUFS_MVDOWN_STFS) - au_do_stfs(dmsg, a); - - /* maintain internal array */ - if (!(a->mvdown.flags & AUFS_MVDOWN_KUPPER)) { - au_set_h_dptr(a->dentry, a->mvd_bsrc, NULL); - au_set_dbstart(a->dentry, a->mvd_bdst); - au_set_h_iptr(a->inode, a->mvd_bsrc, NULL, /*flags*/0); - au_set_ibstart(a->inode, a->mvd_bdst); - } - if (au_dbend(a->dentry) < a->mvd_bdst) - au_set_dbend(a->dentry, a->mvd_bdst); - if (au_ibend(a->inode) < a->mvd_bdst) - au_set_ibend(a->inode, a->mvd_bdst); - -out_unlock: - au_do_unlock(dmsg, a); -out: - AuTraceErr(err); - return err; -} - -/* ---------------------------------------------------------------------- */ - -/* make sure the file is idle */ -static int au_mvd_args_busy(const unsigned char dmsg, struct au_mvd_args *a) -{ - int err, plinked; - - err = 0; - plinked = !!au_opt_test(au_mntflags(a->sb), PLINK); - if (au_dbstart(a->dentry) == a->mvd_bsrc - && a->dentry->d_count == 1 - && atomic_read(&a->inode->i_count) == 1 - /* && a->mvd_h_src_inode->i_nlink == 1 */ - && (!plinked || !au_plink_test(a->inode)) - && a->inode->i_nlink == 1) - goto out; - - err = -EBUSY; - AU_MVD_PR(dmsg, - "b%d, d{b%d, c%u?}, i{c%d?, l%u}, hi{l%u}, p{%d, %d}\n", - a->mvd_bsrc, au_dbstart(a->dentry), a->dentry->d_count, - atomic_read(&a->inode->i_count), a->inode->i_nlink, - a->mvd_h_src_inode->i_nlink, - plinked, plinked ? au_plink_test(a->inode) : 0); - -out: - AuTraceErr(err); - return err; -} - -/* make sure the parent dir is fine */ -static int au_mvd_args_parent(const unsigned char dmsg, - struct au_mvd_args *a) -{ - int err; - aufs_bindex_t bindex; - - err = 0; - if (unlikely(au_alive_dir(a->parent))) { - err = -ENOENT; - AU_MVD_PR(dmsg, "parent dir is dead\n"); - goto out; - } - - a->bopq = au_dbdiropq(a->parent); - bindex = au_wbr_nonopq(a->dentry, a->mvd_bdst); - AuDbg("b%d\n", bindex); - if (unlikely((bindex >= 0 && bindex < a->mvd_bdst) - || (a->bopq != -1 && a->bopq < a->mvd_bdst))) { - err = -EINVAL; - a->mvd_errno = EAU_MVDOWN_OPAQUE; - AU_MVD_PR(dmsg, "ancestor is opaque b%d, b%d\n", - a->bopq, a->mvd_bdst); - } - -out: - AuTraceErr(err); - return err; -} - -static int au_mvd_args_intermediate(const unsigned char dmsg, - struct au_mvd_args *a) -{ - int err; - struct au_dinfo *dinfo, *tmp; - - /* lookup the next lower positive entry */ - err = -ENOMEM; - tmp = au_di_alloc(a->sb, AuLsc_DI_TMP); - if (unlikely(!tmp)) - goto out; - - a->bfound = -1; - a->bwh = -1; - dinfo = au_di(a->dentry); - au_di_cp(tmp, dinfo); - au_di_swap(tmp, dinfo); - - /* returns the number of positive dentries */ - err = au_lkup_dentry(a->dentry, a->mvd_bsrc + 1, /*type*/0); - if (!err) - a->bwh = au_dbwh(a->dentry); - else if (err > 0) - a->bfound = au_dbstart(a->dentry); - - au_di_swap(tmp, dinfo); - au_rw_write_unlock(&tmp->di_rwsem); - au_di_free(tmp); - if (unlikely(err < 0)) - AU_MVD_PR(dmsg, "failed look-up lower\n"); - - /* - * here, we have these cases. - * bfound == -1 - * no positive dentry under bsrc. there are more sub-cases. - * bwh < 0 - * there no whiteout, we can safely move-down. - * bwh <= bsrc - * impossible - * bsrc < bwh && bwh < bdst - * there is a whiteout on RO branch. cannot proceed. - * bwh == bdst - * there is a whiteout on the RW target branch. it should - * be removed. - * bdst < bwh - * there is a whiteout somewhere unrelated branch. - * -1 < bfound && bfound <= bsrc - * impossible. - * bfound < bdst - * found, but it is on RO branch between bsrc and bdst. cannot - * proceed. - * bfound == bdst - * found, replace it if AUFS_MVDOWN_FORCE is set. otherwise return - * error. - * bdst < bfound - * found, after we create the file on bdst, it will be hidden. - */ - - AuDebugOn(a->bfound == -1 - && a->bwh != -1 - && a->bwh <= a->mvd_bsrc); - AuDebugOn(-1 < a->bfound - && a->bfound <= a->mvd_bsrc); - - err = -EINVAL; - if (a->bfound == -1 - && a->mvd_bsrc < a->bwh - && a->bwh != -1 - && a->bwh < a->mvd_bdst) { - a->mvd_errno = EAU_MVDOWN_WHITEOUT; - AU_MVD_PR(dmsg, "bsrc %d, bdst %d, bfound %d, bwh %d\n", - a->mvd_bsrc, a->mvd_bdst, a->bfound, a->bwh); - goto out; - } else if (a->bfound != -1 && a->bfound < a->mvd_bdst) { - a->mvd_errno = EAU_MVDOWN_UPPER; - AU_MVD_PR(dmsg, "bdst %d, bfound %d\n", - a->mvd_bdst, a->bfound); - goto out; - } - - err = 0; /* success */ - -out: - AuTraceErr(err); - return err; -} - -static int au_mvd_args_exist(const unsigned char dmsg, struct au_mvd_args *a) -{ - int err; - - err = 0; - if (!(a->mvdown.flags & AUFS_MVDOWN_OWLOWER) - && a->bfound == a->mvd_bdst) - err = -EEXIST; - AuTraceErr(err); - return err; -} - -static int au_mvd_args(const unsigned char dmsg, struct au_mvd_args *a) -{ - int err; - struct au_branch *br; - - err = -EISDIR; - if (unlikely(S_ISDIR(a->inode->i_mode))) - goto out; - - err = -EINVAL; - if (!(a->mvdown.flags & AUFS_MVDOWN_BRID_UPPER)) - a->mvd_bsrc = au_ibstart(a->inode); - else { - a->mvd_bsrc = au_br_index(a->sb, a->mvd_src_brid); - if (unlikely(a->mvd_bsrc < 0 - || (a->mvd_bsrc < au_dbstart(a->dentry) - || au_dbend(a->dentry) < a->mvd_bsrc - || !au_h_dptr(a->dentry, a->mvd_bsrc)) - || (a->mvd_bsrc < au_ibstart(a->inode) - || au_ibend(a->inode) < a->mvd_bsrc - || !au_h_iptr(a->inode, a->mvd_bsrc)))) { - a->mvd_errno = EAU_MVDOWN_NOUPPER; - AU_MVD_PR(dmsg, "no upper\n"); - goto out; - } - } - if (unlikely(a->mvd_bsrc == au_sbend(a->sb))) { - a->mvd_errno = EAU_MVDOWN_BOTTOM; - AU_MVD_PR(dmsg, "on the bottom\n"); - goto out; - } - a->mvd_h_src_inode = au_h_iptr(a->inode, a->mvd_bsrc); - br = au_sbr(a->sb, a->mvd_bsrc); - err = au_br_rdonly(br); - if (!(a->mvdown.flags & AUFS_MVDOWN_ROUPPER)) { - if (unlikely(err)) - goto out; - } else if (!(vfsub_native_ro(a->mvd_h_src_inode) - || IS_APPEND(a->mvd_h_src_inode))) { - if (err) - a->mvdown.flags |= AUFS_MVDOWN_ROUPPER_R; - /* go on */ - } else - goto out; - - err = -EINVAL; - if (!(a->mvdown.flags & AUFS_MVDOWN_BRID_LOWER)) { - a->mvd_bdst = find_lower_writable(a); - if (unlikely(a->mvd_bdst < 0)) { - a->mvd_errno = EAU_MVDOWN_BOTTOM; - AU_MVD_PR(dmsg, "no writable lower branch\n"); - goto out; - } - } else { - a->mvd_bdst = au_br_index(a->sb, a->mvd_dst_brid); - if (unlikely(a->mvd_bdst < 0 - || au_sbend(a->sb) < a->mvd_bdst)) { - a->mvd_errno = EAU_MVDOWN_NOLOWERBR; - AU_MVD_PR(dmsg, "no lower brid\n"); - goto out; - } - } - - err = au_mvd_args_busy(dmsg, a); - if (!err) - err = au_mvd_args_parent(dmsg, a); - if (!err) - err = au_mvd_args_intermediate(dmsg, a); - if (!err) - err = au_mvd_args_exist(dmsg, a); - if (!err) - AuDbg("b%d, b%d\n", a->mvd_bsrc, a->mvd_bdst); - -out: - AuTraceErr(err); - return err; -} - -int au_mvdown(struct dentry *dentry, struct aufs_mvdown __user *uarg) -{ - int err, e; - unsigned char dmsg; - struct au_mvd_args *args; - - err = -EPERM; - if (unlikely(!capable(CAP_SYS_ADMIN))) - goto out; - - err = -ENOMEM; - args = kmalloc(sizeof(*args), GFP_NOFS); - if (unlikely(!args)) - goto out; - - err = copy_from_user(&args->mvdown, uarg, sizeof(args->mvdown)); - if (!err) - err = !access_ok(VERIFY_WRITE, uarg, sizeof(*uarg)); - if (unlikely(err)) { - err = -EFAULT; - AuTraceErr(err); - goto out_free; - } - AuDbg("flags 0x%x\n", args->mvdown.flags); - args->mvdown.flags &= ~(AUFS_MVDOWN_ROLOWER_R | AUFS_MVDOWN_ROUPPER_R); - args->mvdown.au_errno = 0; - args->dentry = dentry; - args->inode = dentry->d_inode; - args->sb = dentry->d_sb; - - err = -ENOENT; - dmsg = !!(args->mvdown.flags & AUFS_MVDOWN_DMSG); - args->parent = dget_parent(dentry); - args->dir = args->parent->d_inode; - mutex_lock_nested(&args->dir->i_mutex, I_MUTEX_PARENT); - dput(args->parent); - if (unlikely(args->parent != dentry->d_parent)) { - AU_MVD_PR(dmsg, "parent dir is moved\n"); - goto out_dir; - } - - mutex_lock_nested(&args->inode->i_mutex, I_MUTEX_CHILD); - err = aufs_read_lock(dentry, AuLock_DW | AuLock_FLUSH); - if (unlikely(err)) - goto out_inode; - - di_write_lock_parent(args->parent); - err = au_mvd_args(dmsg, args); - if (unlikely(err)) - goto out_parent; - - err = au_do_mvdown(dmsg, args); - if (unlikely(err)) - goto out_parent; - - au_cpup_attr_timesizes(args->dir); - au_cpup_attr_timesizes(args->inode); - au_cpup_igen(args->inode, au_h_iptr(args->inode, args->mvd_bdst)); - /* au_digen_dec(dentry); */ - -out_parent: - di_write_unlock(args->parent); - aufs_read_unlock(dentry, AuLock_DW); -out_inode: - mutex_unlock(&args->inode->i_mutex); -out_dir: - mutex_unlock(&args->dir->i_mutex); -out_free: - e = copy_to_user(uarg, &args->mvdown, sizeof(args->mvdown)); - if (unlikely(e)) - err = -EFAULT; - kfree(args); -out: - AuTraceErr(err); - return err; -} diff --git a/fs/aufs/opts.c b/fs/aufs/opts.c deleted file mode 100644 index 22de4471fca950..00000000000000 --- a/fs/aufs/opts.c +++ /dev/null @@ -1,1840 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * mount options/flags - */ - -#include -#include /* a distribution requires */ -#include -#include "aufs.h" - -/* ---------------------------------------------------------------------- */ - -enum { - Opt_br, - Opt_add, Opt_del, Opt_mod, Opt_reorder, Opt_append, Opt_prepend, - Opt_idel, Opt_imod, Opt_ireorder, - Opt_dirwh, Opt_rdcache, Opt_rdblk, Opt_rdhash, Opt_rendir, - Opt_rdblk_def, Opt_rdhash_def, - Opt_xino, Opt_zxino, Opt_noxino, - Opt_trunc_xino, Opt_trunc_xino_v, Opt_notrunc_xino, - Opt_trunc_xino_path, Opt_itrunc_xino, - Opt_trunc_xib, Opt_notrunc_xib, - Opt_shwh, Opt_noshwh, - Opt_plink, Opt_noplink, Opt_list_plink, - Opt_udba, - Opt_dio, Opt_nodio, - /* Opt_lock, Opt_unlock, */ - Opt_cmd, Opt_cmd_args, - Opt_diropq_a, Opt_diropq_w, - Opt_warn_perm, Opt_nowarn_perm, - Opt_wbr_copyup, Opt_wbr_create, - Opt_fhsm_sec, - Opt_refrof, Opt_norefrof, - Opt_verbose, Opt_noverbose, - Opt_sum, Opt_nosum, Opt_wsum, - Opt_dirperm1, Opt_nodirperm1, - Opt_acl, Opt_noacl, - Opt_tail, Opt_ignore, Opt_ignore_silent, Opt_err -}; - -static match_table_t options = { - {Opt_br, "br=%s"}, - {Opt_br, "br:%s"}, - - {Opt_add, "add=%d:%s"}, - {Opt_add, "add:%d:%s"}, - {Opt_add, "ins=%d:%s"}, - {Opt_add, "ins:%d:%s"}, - {Opt_append, "append=%s"}, - {Opt_append, "append:%s"}, - {Opt_prepend, "prepend=%s"}, - {Opt_prepend, "prepend:%s"}, - - {Opt_del, "del=%s"}, - {Opt_del, "del:%s"}, - /* {Opt_idel, "idel:%d"}, */ - {Opt_mod, "mod=%s"}, - {Opt_mod, "mod:%s"}, - /* {Opt_imod, "imod:%d:%s"}, */ - - {Opt_dirwh, "dirwh=%d"}, - - {Opt_xino, "xino=%s"}, - {Opt_noxino, "noxino"}, - {Opt_trunc_xino, "trunc_xino"}, - {Opt_trunc_xino_v, "trunc_xino_v=%d:%d"}, - {Opt_notrunc_xino, "notrunc_xino"}, - {Opt_trunc_xino_path, "trunc_xino=%s"}, - {Opt_itrunc_xino, "itrunc_xino=%d"}, - /* {Opt_zxino, "zxino=%s"}, */ - {Opt_trunc_xib, "trunc_xib"}, - {Opt_notrunc_xib, "notrunc_xib"}, - -#ifdef CONFIG_PROC_FS - {Opt_plink, "plink"}, -#else - {Opt_ignore_silent, "plink"}, -#endif - - {Opt_noplink, "noplink"}, - -#ifdef CONFIG_AUFS_DEBUG - {Opt_list_plink, "list_plink"}, -#endif - - {Opt_udba, "udba=%s"}, - - {Opt_dio, "dio"}, - {Opt_nodio, "nodio"}, - -#ifdef CONFIG_AUFS_FHSM - {Opt_fhsm_sec, "fhsm_sec=%d"}, -#else - {Opt_ignore_silent, "fhsm_sec=%d"}, -#endif - - {Opt_diropq_a, "diropq=always"}, - {Opt_diropq_a, "diropq=a"}, - {Opt_diropq_w, "diropq=whiteouted"}, - {Opt_diropq_w, "diropq=w"}, - - {Opt_warn_perm, "warn_perm"}, - {Opt_nowarn_perm, "nowarn_perm"}, - - /* keep them temporary */ - {Opt_ignore_silent, "nodlgt"}, - {Opt_ignore_silent, "clean_plink"}, - -#ifdef CONFIG_AUFS_SHWH - {Opt_shwh, "shwh"}, -#endif - {Opt_noshwh, "noshwh"}, - - {Opt_dirperm1, "dirperm1"}, - {Opt_nodirperm1, "nodirperm1"}, - - {Opt_rendir, "rendir=%d"}, - - {Opt_refrof, "refrof"}, - {Opt_norefrof, "norefrof"}, - - {Opt_verbose, "verbose"}, - {Opt_verbose, "v"}, - {Opt_noverbose, "noverbose"}, - {Opt_noverbose, "quiet"}, - {Opt_noverbose, "q"}, - {Opt_noverbose, "silent"}, - - {Opt_sum, "sum"}, - {Opt_nosum, "nosum"}, - {Opt_wsum, "wsum"}, - - {Opt_rdcache, "rdcache=%d"}, - {Opt_rdblk, "rdblk=%d"}, - {Opt_rdblk_def, "rdblk=def"}, - {Opt_rdhash, "rdhash=%d"}, - {Opt_rdhash_def, "rdhash=def"}, - - {Opt_wbr_create, "create=%s"}, - {Opt_wbr_create, "create_policy=%s"}, - {Opt_wbr_copyup, "cpup=%s"}, - {Opt_wbr_copyup, "copyup=%s"}, - {Opt_wbr_copyup, "copyup_policy=%s"}, - - /* generic VFS flag */ -#ifdef CONFIG_FS_POSIX_ACL - {Opt_acl, "acl"}, - {Opt_noacl, "noacl"}, -#else - {Opt_ignore_silent, "acl"}, - {Opt_ignore_silent, "noacl"}, -#endif - - /* internal use for the scripts */ - {Opt_ignore_silent, "si=%s"}, - - {Opt_br, "dirs=%s"}, - {Opt_ignore, "debug=%d"}, - {Opt_ignore, "delete=whiteout"}, - {Opt_ignore, "delete=all"}, - {Opt_ignore, "imap=%s"}, - - /* temporary workaround, due to old mount(8)? */ - {Opt_ignore_silent, "relatime"}, - - {Opt_err, NULL} -}; - -/* ---------------------------------------------------------------------- */ - -static const char *au_parser_pattern(int val, match_table_t tbl) -{ - struct match_token *p; - - p = tbl; - while (p->pattern) { - if (p->token == val) - return p->pattern; - p++; - } - BUG(); - return "??"; -} - -static const char *au_optstr(int *val, match_table_t tbl) -{ - struct match_token *p; - int v; - - v = *val; - p = tbl; - while (p->token) { - if ((v & p->token) == p->token) { - *val &= ~p->token; - return p->pattern; - } - p++; - } - return NULL; -} - -/* ---------------------------------------------------------------------- */ - -static match_table_t brperm = { - {AuBrPerm_RO, AUFS_BRPERM_RO}, - {AuBrPerm_RR, AUFS_BRPERM_RR}, - {AuBrPerm_RW, AUFS_BRPERM_RW}, - {0, NULL} -}; - -static match_table_t brattr = { - /* general */ - {AuBrAttr_COO_REG, AUFS_BRATTR_COO_REG}, - {AuBrAttr_COO_ALL, AUFS_BRATTR_COO_ALL}, - {AuBrAttr_UNPIN, AUFS_BRATTR_UNPIN}, - {AuBrAttr_FHSM, AUFS_BRATTR_FHSM}, - {AuBrAttr_ICEX, AUFS_BRATTR_ICEX}, - {AuBrAttr_ICEX_SEC, AUFS_BRATTR_ICEX_SEC}, - {AuBrAttr_ICEX_SYS, AUFS_BRATTR_ICEX_SYS}, - {AuBrAttr_ICEX_TR, AUFS_BRATTR_ICEX_TR}, - {AuBrAttr_ICEX_USR, AUFS_BRATTR_ICEX_USR}, - {AuBrAttr_ICEX_OTH, AUFS_BRATTR_ICEX_OTH}, - - /* ro/rr branch */ - {AuBrRAttr_WH, AUFS_BRRATTR_WH}, - - /* rw branch */ - {AuBrWAttr_MOO, AUFS_BRWATTR_MOO}, - {AuBrWAttr_NoLinkWH, AUFS_BRWATTR_NLWH}, - - {0, NULL} -}; - -static int br_attr_val(char *str, match_table_t table, substring_t args[]) -{ - int attr, v; - char *p; - - attr = 0; - do { - p = strchr(str, '+'); - if (p) - *p = 0; - v = match_token(str, table, args); - if (v) { - if (v & AuBrAttr_CMOO_Mask) - attr &= ~AuBrAttr_CMOO_Mask; - attr |= v; - } else { - if (p) - *p = '+'; - pr_warn("ignored branch attribute %s\n", str); - break; - } - if (p) - str = p + 1; - } while (p); - - return attr; -} - -static int au_do_optstr_br_attr(au_br_perm_str_t *str, int perm) -{ - int sz; - const char *p; - char *q; - - q = str->a; - *q = 0; - p = au_optstr(&perm, brattr); - if (p) { - sz = strlen(p); - memcpy(q, p, sz + 1); - q += sz; - } else - goto out; - - do { - p = au_optstr(&perm, brattr); - if (p) { - *q++ = '+'; - sz = strlen(p); - memcpy(q, p, sz + 1); - q += sz; - } - } while (p); - -out: - return q - str->a; -} - -static int noinline_for_stack br_perm_val(char *perm) -{ - int val, bad, sz; - char *p; - substring_t args[MAX_OPT_ARGS]; - au_br_perm_str_t attr; - - p = strchr(perm, '+'); - if (p) - *p = 0; - val = match_token(perm, brperm, args); - if (!val) { - if (p) - *p = '+'; - pr_warn("ignored branch permission %s\n", perm); - val = AuBrPerm_RO; - goto out; - } - if (!p) - goto out; - - val |= br_attr_val(p + 1, brattr, args); - - bad = 0; - switch (val & AuBrPerm_Mask) { - case AuBrPerm_RO: - case AuBrPerm_RR: - bad = val & AuBrWAttr_Mask; - val &= ~AuBrWAttr_Mask; - break; - case AuBrPerm_RW: - bad = val & AuBrRAttr_Mask; - val &= ~AuBrRAttr_Mask; - break; - } - if (unlikely(bad)) { - sz = au_do_optstr_br_attr(&attr, bad); - AuDebugOn(!sz); - pr_warn("ignored branch attribute %s\n", attr.a); - } - -out: - return val; -} - -void au_optstr_br_perm(au_br_perm_str_t *str, int perm) -{ - au_br_perm_str_t attr; - const char *p; - char *q; - int sz; - - q = str->a; - p = au_optstr(&perm, brperm); - AuDebugOn(!p || !*p); - sz = strlen(p); - memcpy(q, p, sz + 1); - q += sz; - - sz = au_do_optstr_br_attr(&attr, perm); - if (sz) { - *q++ = '+'; - memcpy(q, attr.a, sz + 1); - } - - AuDebugOn(strlen(str->a) >= sizeof(str->a)); -} - -/* ---------------------------------------------------------------------- */ - -static match_table_t udbalevel = { - {AuOpt_UDBA_REVAL, "reval"}, - {AuOpt_UDBA_NONE, "none"}, -#ifdef CONFIG_AUFS_HNOTIFY - {AuOpt_UDBA_HNOTIFY, "notify"}, /* abstraction */ -#ifdef CONFIG_AUFS_HFSNOTIFY - {AuOpt_UDBA_HNOTIFY, "fsnotify"}, -#endif -#endif - {-1, NULL} -}; - -static int noinline_for_stack udba_val(char *str) -{ - substring_t args[MAX_OPT_ARGS]; - - return match_token(str, udbalevel, args); -} - -const char *au_optstr_udba(int udba) -{ - return au_parser_pattern(udba, udbalevel); -} - -/* ---------------------------------------------------------------------- */ - -static match_table_t au_wbr_create_policy = { - {AuWbrCreate_TDP, "tdp"}, - {AuWbrCreate_TDP, "top-down-parent"}, - {AuWbrCreate_RR, "rr"}, - {AuWbrCreate_RR, "round-robin"}, - {AuWbrCreate_MFS, "mfs"}, - {AuWbrCreate_MFS, "most-free-space"}, - {AuWbrCreate_MFSV, "mfs:%d"}, - {AuWbrCreate_MFSV, "most-free-space:%d"}, - - {AuWbrCreate_MFSRR, "mfsrr:%d"}, - {AuWbrCreate_MFSRRV, "mfsrr:%d:%d"}, - {AuWbrCreate_PMFS, "pmfs"}, - {AuWbrCreate_PMFSV, "pmfs:%d"}, - {AuWbrCreate_PMFSRR, "pmfsrr:%d"}, - {AuWbrCreate_PMFSRRV, "pmfsrr:%d:%d"}, - - {-1, NULL} -}; - -/* - * cf. linux/lib/parser.c and cmdline.c - * gave up calling memparse() since it uses simple_strtoull() instead of - * kstrto...(). - */ -static int noinline_for_stack -au_match_ull(substring_t *s, unsigned long long *result) -{ - int err; - unsigned int len; - char a[32]; - - err = -ERANGE; - len = s->to - s->from; - if (len + 1 <= sizeof(a)) { - memcpy(a, s->from, len); - a[len] = '\0'; - err = kstrtoull(a, 0, result); - } - return err; -} - -static int au_wbr_mfs_wmark(substring_t *arg, char *str, - struct au_opt_wbr_create *create) -{ - int err; - unsigned long long ull; - - err = 0; - if (!au_match_ull(arg, &ull)) - create->mfsrr_watermark = ull; - else { - pr_err("bad integer in %s\n", str); - err = -EINVAL; - } - - return err; -} - -static int au_wbr_mfs_sec(substring_t *arg, char *str, - struct au_opt_wbr_create *create) -{ - int n, err; - - err = 0; - if (!match_int(arg, &n) && 0 <= n && n <= AUFS_MFS_MAX_SEC) - create->mfs_second = n; - else { - pr_err("bad integer in %s\n", str); - err = -EINVAL; - } - - return err; -} - -static int noinline_for_stack -au_wbr_create_val(char *str, struct au_opt_wbr_create *create) -{ - int err, e; - substring_t args[MAX_OPT_ARGS]; - - err = match_token(str, au_wbr_create_policy, args); - create->wbr_create = err; - switch (err) { - case AuWbrCreate_MFSRRV: - case AuWbrCreate_PMFSRRV: - e = au_wbr_mfs_wmark(&args[0], str, create); - if (!e) - e = au_wbr_mfs_sec(&args[1], str, create); - if (unlikely(e)) - err = e; - break; - case AuWbrCreate_MFSRR: - case AuWbrCreate_PMFSRR: - e = au_wbr_mfs_wmark(&args[0], str, create); - if (unlikely(e)) { - err = e; - break; - } - /*FALLTHROUGH*/ - case AuWbrCreate_MFS: - case AuWbrCreate_PMFS: - create->mfs_second = AUFS_MFS_DEF_SEC; - break; - case AuWbrCreate_MFSV: - case AuWbrCreate_PMFSV: - e = au_wbr_mfs_sec(&args[0], str, create); - if (unlikely(e)) - err = e; - break; - } - - return err; -} - -const char *au_optstr_wbr_create(int wbr_create) -{ - return au_parser_pattern(wbr_create, au_wbr_create_policy); -} - -static match_table_t au_wbr_copyup_policy = { - {AuWbrCopyup_TDP, "tdp"}, - {AuWbrCopyup_TDP, "top-down-parent"}, - {AuWbrCopyup_BUP, "bup"}, - {AuWbrCopyup_BUP, "bottom-up-parent"}, - {AuWbrCopyup_BU, "bu"}, - {AuWbrCopyup_BU, "bottom-up"}, - {-1, NULL} -}; - -static int noinline_for_stack au_wbr_copyup_val(char *str) -{ - substring_t args[MAX_OPT_ARGS]; - - return match_token(str, au_wbr_copyup_policy, args); -} - -const char *au_optstr_wbr_copyup(int wbr_copyup) -{ - return au_parser_pattern(wbr_copyup, au_wbr_copyup_policy); -} - -/* ---------------------------------------------------------------------- */ - -static const int lkup_dirflags = LOOKUP_FOLLOW | LOOKUP_DIRECTORY; - -static void dump_opts(struct au_opts *opts) -{ -#ifdef CONFIG_AUFS_DEBUG - /* reduce stack space */ - union { - struct au_opt_add *add; - struct au_opt_del *del; - struct au_opt_mod *mod; - struct au_opt_xino *xino; - struct au_opt_xino_itrunc *xino_itrunc; - struct au_opt_wbr_create *create; - } u; - struct au_opt *opt; - - opt = opts->opt; - while (opt->type != Opt_tail) { - switch (opt->type) { - case Opt_add: - u.add = &opt->add; - AuDbg("add {b%d, %s, 0x%x, %p}\n", - u.add->bindex, u.add->pathname, u.add->perm, - u.add->path.dentry); - break; - case Opt_del: - case Opt_idel: - u.del = &opt->del; - AuDbg("del {%s, %p}\n", - u.del->pathname, u.del->h_path.dentry); - break; - case Opt_mod: - case Opt_imod: - u.mod = &opt->mod; - AuDbg("mod {%s, 0x%x, %p}\n", - u.mod->path, u.mod->perm, u.mod->h_root); - break; - case Opt_append: - u.add = &opt->add; - AuDbg("append {b%d, %s, 0x%x, %p}\n", - u.add->bindex, u.add->pathname, u.add->perm, - u.add->path.dentry); - break; - case Opt_prepend: - u.add = &opt->add; - AuDbg("prepend {b%d, %s, 0x%x, %p}\n", - u.add->bindex, u.add->pathname, u.add->perm, - u.add->path.dentry); - break; - case Opt_dirwh: - AuDbg("dirwh %d\n", opt->dirwh); - break; - case Opt_rdcache: - AuDbg("rdcache %d\n", opt->rdcache); - break; - case Opt_rdblk: - AuDbg("rdblk %u\n", opt->rdblk); - break; - case Opt_rdblk_def: - AuDbg("rdblk_def\n"); - break; - case Opt_rdhash: - AuDbg("rdhash %u\n", opt->rdhash); - break; - case Opt_rdhash_def: - AuDbg("rdhash_def\n"); - break; - case Opt_xino: - u.xino = &opt->xino; - AuDbg("xino {%s %.*s}\n", - u.xino->path, - AuDLNPair(u.xino->file->f_dentry)); - break; - case Opt_trunc_xino: - AuLabel(trunc_xino); - break; - case Opt_notrunc_xino: - AuLabel(notrunc_xino); - break; - case Opt_trunc_xino_path: - case Opt_itrunc_xino: - u.xino_itrunc = &opt->xino_itrunc; - AuDbg("trunc_xino %d\n", u.xino_itrunc->bindex); - break; - - case Opt_noxino: - AuLabel(noxino); - break; - case Opt_trunc_xib: - AuLabel(trunc_xib); - break; - case Opt_notrunc_xib: - AuLabel(notrunc_xib); - break; - case Opt_shwh: - AuLabel(shwh); - break; - case Opt_noshwh: - AuLabel(noshwh); - break; - case Opt_dirperm1: - AuLabel(dirperm1); - break; - case Opt_nodirperm1: - AuLabel(nodirperm1); - break; - case Opt_plink: - AuLabel(plink); - break; - case Opt_noplink: - AuLabel(noplink); - break; - case Opt_list_plink: - AuLabel(list_plink); - break; - case Opt_udba: - AuDbg("udba %d, %s\n", - opt->udba, au_optstr_udba(opt->udba)); - break; - case Opt_dio: - AuLabel(dio); - break; - case Opt_nodio: - AuLabel(nodio); - break; - case Opt_diropq_a: - AuLabel(diropq_a); - break; - case Opt_diropq_w: - AuLabel(diropq_w); - break; - case Opt_warn_perm: - AuLabel(warn_perm); - break; - case Opt_nowarn_perm: - AuLabel(nowarn_perm); - break; - case Opt_refrof: - AuLabel(refrof); - break; - case Opt_norefrof: - AuLabel(norefrof); - break; - case Opt_verbose: - AuLabel(verbose); - break; - case Opt_noverbose: - AuLabel(noverbose); - break; - case Opt_sum: - AuLabel(sum); - break; - case Opt_nosum: - AuLabel(nosum); - break; - case Opt_wsum: - AuLabel(wsum); - break; - case Opt_wbr_create: - u.create = &opt->wbr_create; - AuDbg("create %d, %s\n", u.create->wbr_create, - au_optstr_wbr_create(u.create->wbr_create)); - switch (u.create->wbr_create) { - case AuWbrCreate_MFSV: - case AuWbrCreate_PMFSV: - AuDbg("%d sec\n", u.create->mfs_second); - break; - case AuWbrCreate_MFSRR: - AuDbg("%llu watermark\n", - u.create->mfsrr_watermark); - break; - case AuWbrCreate_MFSRRV: - case AuWbrCreate_PMFSRRV: - AuDbg("%llu watermark, %d sec\n", - u.create->mfsrr_watermark, - u.create->mfs_second); - break; - } - break; - case Opt_wbr_copyup: - AuDbg("copyup %d, %s\n", opt->wbr_copyup, - au_optstr_wbr_copyup(opt->wbr_copyup)); - break; - case Opt_fhsm_sec: - AuDbg("fhsm_sec %u\n", opt->fhsm_second); - break; - case Opt_acl: - AuLabel(acl); - break; - case Opt_noacl: - AuLabel(noacl); - break; - default: - BUG(); - } - opt++; - } -#endif -} - -void au_opts_free(struct au_opts *opts) -{ - struct au_opt *opt; - - opt = opts->opt; - while (opt->type != Opt_tail) { - switch (opt->type) { - case Opt_add: - case Opt_append: - case Opt_prepend: - path_put(&opt->add.path); - break; - case Opt_del: - case Opt_idel: - path_put(&opt->del.h_path); - break; - case Opt_mod: - case Opt_imod: - dput(opt->mod.h_root); - break; - case Opt_xino: - fput(opt->xino.file); - break; - } - opt++; - } -} - -static int opt_add(struct au_opt *opt, char *opt_str, unsigned long sb_flags, - aufs_bindex_t bindex) -{ - int err; - struct au_opt_add *add = &opt->add; - char *p; - - add->bindex = bindex; - add->perm = AuBrPerm_RO; - add->pathname = opt_str; - p = strchr(opt_str, '='); - if (p) { - *p++ = 0; - if (*p) - add->perm = br_perm_val(p); - } - - err = vfsub_kern_path(add->pathname, lkup_dirflags, &add->path); - if (!err) { - if (!p) { - add->perm = AuBrPerm_RO; - if (au_test_fs_rr(add->path.dentry->d_sb)) - add->perm = AuBrPerm_RR; - else if (!bindex && !(sb_flags & MS_RDONLY)) - add->perm = AuBrPerm_RW; - } - opt->type = Opt_add; - goto out; - } - pr_err("lookup failed %s (%d)\n", add->pathname, err); - err = -EINVAL; - -out: - return err; -} - -static int au_opts_parse_del(struct au_opt_del *del, substring_t args[]) -{ - int err; - - del->pathname = args[0].from; - AuDbg("del path %s\n", del->pathname); - - err = vfsub_kern_path(del->pathname, lkup_dirflags, &del->h_path); - if (unlikely(err)) - pr_err("lookup failed %s (%d)\n", del->pathname, err); - - return err; -} - -#if 0 /* reserved for future use */ -static int au_opts_parse_idel(struct super_block *sb, aufs_bindex_t bindex, - struct au_opt_del *del, substring_t args[]) -{ - int err; - struct dentry *root; - - err = -EINVAL; - root = sb->s_root; - aufs_read_lock(root, AuLock_FLUSH); - if (bindex < 0 || au_sbend(sb) < bindex) { - pr_err("out of bounds, %d\n", bindex); - goto out; - } - - err = 0; - del->h_path.dentry = dget(au_h_dptr(root, bindex)); - del->h_path.mnt = mntget(au_sbr_mnt(sb, bindex)); - -out: - aufs_read_unlock(root, !AuLock_IR); - return err; -} -#endif - -static int noinline_for_stack -au_opts_parse_mod(struct au_opt_mod *mod, substring_t args[]) -{ - int err; - struct path path; - char *p; - - err = -EINVAL; - mod->path = args[0].from; - p = strchr(mod->path, '='); - if (unlikely(!p)) { - pr_err("no permssion %s\n", args[0].from); - goto out; - } - - *p++ = 0; - err = vfsub_kern_path(mod->path, lkup_dirflags, &path); - if (unlikely(err)) { - pr_err("lookup failed %s (%d)\n", mod->path, err); - goto out; - } - - mod->perm = br_perm_val(p); - AuDbg("mod path %s, perm 0x%x, %s\n", mod->path, mod->perm, p); - mod->h_root = dget(path.dentry); - path_put(&path); - -out: - return err; -} - -#if 0 /* reserved for future use */ -static int au_opts_parse_imod(struct super_block *sb, aufs_bindex_t bindex, - struct au_opt_mod *mod, substring_t args[]) -{ - int err; - struct dentry *root; - - err = -EINVAL; - root = sb->s_root; - aufs_read_lock(root, AuLock_FLUSH); - if (bindex < 0 || au_sbend(sb) < bindex) { - pr_err("out of bounds, %d\n", bindex); - goto out; - } - - err = 0; - mod->perm = br_perm_val(args[1].from); - AuDbg("mod path %s, perm 0x%x, %s\n", - mod->path, mod->perm, args[1].from); - mod->h_root = dget(au_h_dptr(root, bindex)); - -out: - aufs_read_unlock(root, !AuLock_IR); - return err; -} -#endif - -static int au_opts_parse_xino(struct super_block *sb, struct au_opt_xino *xino, - substring_t args[]) -{ - int err; - struct file *file; - - file = au_xino_create(sb, args[0].from, /*silent*/0); - err = PTR_ERR(file); - if (IS_ERR(file)) - goto out; - - err = -EINVAL; - if (unlikely(file->f_dentry->d_sb == sb)) { - fput(file); - pr_err("%s must be outside\n", args[0].from); - goto out; - } - - err = 0; - xino->file = file; - xino->path = args[0].from; - -out: - return err; -} - -static int noinline_for_stack -au_opts_parse_xino_itrunc_path(struct super_block *sb, - struct au_opt_xino_itrunc *xino_itrunc, - substring_t args[]) -{ - int err; - aufs_bindex_t bend, bindex; - struct path path; - struct dentry *root; - - err = vfsub_kern_path(args[0].from, lkup_dirflags, &path); - if (unlikely(err)) { - pr_err("lookup failed %s (%d)\n", args[0].from, err); - goto out; - } - - xino_itrunc->bindex = -1; - root = sb->s_root; - aufs_read_lock(root, AuLock_FLUSH); - bend = au_sbend(sb); - for (bindex = 0; bindex <= bend; bindex++) { - if (au_h_dptr(root, bindex) == path.dentry) { - xino_itrunc->bindex = bindex; - break; - } - } - aufs_read_unlock(root, !AuLock_IR); - path_put(&path); - - if (unlikely(xino_itrunc->bindex < 0)) { - pr_err("no such branch %s\n", args[0].from); - err = -EINVAL; - } - -out: - return err; -} - -/* called without aufs lock */ -int au_opts_parse(struct super_block *sb, char *str, struct au_opts *opts) -{ - int err, n, token; - aufs_bindex_t bindex; - unsigned char skipped; - struct dentry *root; - struct au_opt *opt, *opt_tail; - char *opt_str; - /* reduce the stack space */ - union { - struct au_opt_xino_itrunc *xino_itrunc; - struct au_opt_wbr_create *create; - } u; - struct { - substring_t args[MAX_OPT_ARGS]; - } *a; - - err = -ENOMEM; - a = kmalloc(sizeof(*a), GFP_NOFS); - if (unlikely(!a)) - goto out; - - root = sb->s_root; - err = 0; - bindex = 0; - opt = opts->opt; - opt_tail = opt + opts->max_opt - 1; - opt->type = Opt_tail; - while (!err && (opt_str = strsep(&str, ",")) && *opt_str) { - err = -EINVAL; - skipped = 0; - token = match_token(opt_str, options, a->args); - switch (token) { - case Opt_br: - err = 0; - while (!err && (opt_str = strsep(&a->args[0].from, ":")) - && *opt_str) { - err = opt_add(opt, opt_str, opts->sb_flags, - bindex++); - if (unlikely(!err && ++opt > opt_tail)) { - err = -E2BIG; - break; - } - opt->type = Opt_tail; - skipped = 1; - } - break; - case Opt_add: - if (unlikely(match_int(&a->args[0], &n))) { - pr_err("bad integer in %s\n", opt_str); - break; - } - bindex = n; - err = opt_add(opt, a->args[1].from, opts->sb_flags, - bindex); - if (!err) - opt->type = token; - break; - case Opt_append: - err = opt_add(opt, a->args[0].from, opts->sb_flags, - /*dummy bindex*/1); - if (!err) - opt->type = token; - break; - case Opt_prepend: - err = opt_add(opt, a->args[0].from, opts->sb_flags, - /*bindex*/0); - if (!err) - opt->type = token; - break; - case Opt_del: - err = au_opts_parse_del(&opt->del, a->args); - if (!err) - opt->type = token; - break; -#if 0 /* reserved for future use */ - case Opt_idel: - del->pathname = "(indexed)"; - if (unlikely(match_int(&args[0], &n))) { - pr_err("bad integer in %s\n", opt_str); - break; - } - err = au_opts_parse_idel(sb, n, &opt->del, a->args); - if (!err) - opt->type = token; - break; -#endif - case Opt_mod: - err = au_opts_parse_mod(&opt->mod, a->args); - if (!err) - opt->type = token; - break; -#ifdef IMOD /* reserved for future use */ - case Opt_imod: - u.mod->path = "(indexed)"; - if (unlikely(match_int(&a->args[0], &n))) { - pr_err("bad integer in %s\n", opt_str); - break; - } - err = au_opts_parse_imod(sb, n, &opt->mod, a->args); - if (!err) - opt->type = token; - break; -#endif - case Opt_xino: - err = au_opts_parse_xino(sb, &opt->xino, a->args); - if (!err) - opt->type = token; - break; - - case Opt_trunc_xino_path: - err = au_opts_parse_xino_itrunc_path - (sb, &opt->xino_itrunc, a->args); - if (!err) - opt->type = token; - break; - - case Opt_itrunc_xino: - u.xino_itrunc = &opt->xino_itrunc; - if (unlikely(match_int(&a->args[0], &n))) { - pr_err("bad integer in %s\n", opt_str); - break; - } - u.xino_itrunc->bindex = n; - aufs_read_lock(root, AuLock_FLUSH); - if (n < 0 || au_sbend(sb) < n) { - pr_err("out of bounds, %d\n", n); - aufs_read_unlock(root, !AuLock_IR); - break; - } - aufs_read_unlock(root, !AuLock_IR); - err = 0; - opt->type = token; - break; - - case Opt_dirwh: - if (unlikely(match_int(&a->args[0], &opt->dirwh))) - break; - err = 0; - opt->type = token; - break; - - case Opt_rdcache: - if (unlikely(match_int(&a->args[0], &n))) { - pr_err("bad integer in %s\n", opt_str); - break; - } - if (unlikely(n > AUFS_RDCACHE_MAX)) { - pr_err("rdcache must be smaller than %d\n", - AUFS_RDCACHE_MAX); - break; - } - opt->rdcache = n; - err = 0; - opt->type = token; - break; - case Opt_rdblk: - if (unlikely(match_int(&a->args[0], &n) - || n < 0 - || n > KMALLOC_MAX_SIZE)) { - pr_err("bad integer in %s\n", opt_str); - break; - } - if (unlikely(n && n < NAME_MAX)) { - pr_err("rdblk must be larger than %d\n", - NAME_MAX); - break; - } - opt->rdblk = n; - err = 0; - opt->type = token; - break; - case Opt_rdhash: - if (unlikely(match_int(&a->args[0], &n) - || n < 0 - || n * sizeof(struct hlist_head) - > KMALLOC_MAX_SIZE)) { - pr_err("bad integer in %s\n", opt_str); - break; - } - opt->rdhash = n; - err = 0; - opt->type = token; - break; - - case Opt_trunc_xino: - case Opt_notrunc_xino: - case Opt_noxino: - case Opt_trunc_xib: - case Opt_notrunc_xib: - case Opt_shwh: - case Opt_noshwh: - case Opt_dirperm1: - case Opt_nodirperm1: - case Opt_plink: - case Opt_noplink: - case Opt_list_plink: - case Opt_dio: - case Opt_nodio: - case Opt_diropq_a: - case Opt_diropq_w: - case Opt_warn_perm: - case Opt_nowarn_perm: - case Opt_refrof: - case Opt_norefrof: - case Opt_verbose: - case Opt_noverbose: - case Opt_sum: - case Opt_nosum: - case Opt_wsum: - case Opt_rdblk_def: - case Opt_rdhash_def: - case Opt_acl: - case Opt_noacl: - err = 0; - opt->type = token; - break; - - case Opt_udba: - opt->udba = udba_val(a->args[0].from); - if (opt->udba >= 0) { - err = 0; - opt->type = token; - } else - pr_err("wrong value, %s\n", opt_str); - break; - - case Opt_wbr_create: - u.create = &opt->wbr_create; - u.create->wbr_create - = au_wbr_create_val(a->args[0].from, u.create); - if (u.create->wbr_create >= 0) { - err = 0; - opt->type = token; - } else - pr_err("wrong value, %s\n", opt_str); - break; - case Opt_wbr_copyup: - opt->wbr_copyup = au_wbr_copyup_val(a->args[0].from); - if (opt->wbr_copyup >= 0) { - err = 0; - opt->type = token; - } else - pr_err("wrong value, %s\n", opt_str); - break; - - case Opt_fhsm_sec: - if (unlikely(match_int(&a->args[0], &n) - || n < 0)) { - pr_err("bad integer in %s\n", opt_str); - break; - } - if (sysaufs_brs) { - opt->fhsm_second = n; - opt->type = token; - } else - pr_warn("ignored %s\n", opt_str); - err = 0; - break; - - case Opt_ignore: - pr_warn("ignored %s\n", opt_str); - /*FALLTHROUGH*/ - case Opt_ignore_silent: - skipped = 1; - err = 0; - break; - case Opt_err: - pr_err("unknown option %s\n", opt_str); - break; - } - - if (!err && !skipped) { - if (unlikely(++opt > opt_tail)) { - err = -E2BIG; - opt--; - opt->type = Opt_tail; - break; - } - opt->type = Opt_tail; - } - } - - kfree(a); - dump_opts(opts); - if (unlikely(err)) - au_opts_free(opts); - -out: - return err; -} - -static int au_opt_wbr_create(struct super_block *sb, - struct au_opt_wbr_create *create) -{ - int err; - struct au_sbinfo *sbinfo; - - SiMustWriteLock(sb); - - err = 1; /* handled */ - sbinfo = au_sbi(sb); - if (sbinfo->si_wbr_create_ops->fin) { - err = sbinfo->si_wbr_create_ops->fin(sb); - if (!err) - err = 1; - } - - sbinfo->si_wbr_create = create->wbr_create; - sbinfo->si_wbr_create_ops = au_wbr_create_ops + create->wbr_create; - switch (create->wbr_create) { - case AuWbrCreate_MFSRRV: - case AuWbrCreate_MFSRR: - case AuWbrCreate_PMFSRR: - case AuWbrCreate_PMFSRRV: - sbinfo->si_wbr_mfs.mfsrr_watermark = create->mfsrr_watermark; - /*FALLTHROUGH*/ - case AuWbrCreate_MFS: - case AuWbrCreate_MFSV: - case AuWbrCreate_PMFS: - case AuWbrCreate_PMFSV: - sbinfo->si_wbr_mfs.mfs_expire - = msecs_to_jiffies(create->mfs_second * MSEC_PER_SEC); - break; - } - - if (sbinfo->si_wbr_create_ops->init) - sbinfo->si_wbr_create_ops->init(sb); /* ignore */ - - return err; -} - -/* - * returns, - * plus: processed without an error - * zero: unprocessed - */ -static int au_opt_simple(struct super_block *sb, struct au_opt *opt, - struct au_opts *opts) -{ - int err; - struct au_sbinfo *sbinfo; - - SiMustWriteLock(sb); - - err = 1; /* handled */ - sbinfo = au_sbi(sb); - switch (opt->type) { - case Opt_udba: - sbinfo->si_mntflags &= ~AuOptMask_UDBA; - sbinfo->si_mntflags |= opt->udba; - opts->given_udba |= opt->udba; - break; - - case Opt_plink: - au_opt_set(sbinfo->si_mntflags, PLINK); - break; - case Opt_noplink: - if (au_opt_test(sbinfo->si_mntflags, PLINK)) - au_plink_put(sb, /*verbose*/1); - au_opt_clr(sbinfo->si_mntflags, PLINK); - break; - case Opt_list_plink: - if (au_opt_test(sbinfo->si_mntflags, PLINK)) - au_plink_list(sb); - break; - - case Opt_dio: - au_opt_set(sbinfo->si_mntflags, DIO); - au_fset_opts(opts->flags, REFRESH_DYAOP); - break; - case Opt_nodio: - au_opt_clr(sbinfo->si_mntflags, DIO); - au_fset_opts(opts->flags, REFRESH_DYAOP); - break; - - case Opt_fhsm_sec: - au_fhsm_set(sbinfo, opt->fhsm_second); - break; - - case Opt_diropq_a: - au_opt_set(sbinfo->si_mntflags, ALWAYS_DIROPQ); - break; - case Opt_diropq_w: - au_opt_clr(sbinfo->si_mntflags, ALWAYS_DIROPQ); - break; - - case Opt_warn_perm: - au_opt_set(sbinfo->si_mntflags, WARN_PERM); - break; - case Opt_nowarn_perm: - au_opt_clr(sbinfo->si_mntflags, WARN_PERM); - break; - - case Opt_refrof: - au_opt_set(sbinfo->si_mntflags, REFROF); - break; - case Opt_norefrof: - au_opt_clr(sbinfo->si_mntflags, REFROF); - break; - - case Opt_verbose: - au_opt_set(sbinfo->si_mntflags, VERBOSE); - break; - case Opt_noverbose: - au_opt_clr(sbinfo->si_mntflags, VERBOSE); - break; - - case Opt_sum: - au_opt_set(sbinfo->si_mntflags, SUM); - break; - case Opt_wsum: - au_opt_clr(sbinfo->si_mntflags, SUM); - au_opt_set(sbinfo->si_mntflags, SUM_W); - case Opt_nosum: - au_opt_clr(sbinfo->si_mntflags, SUM); - au_opt_clr(sbinfo->si_mntflags, SUM_W); - break; - - case Opt_wbr_create: - err = au_opt_wbr_create(sb, &opt->wbr_create); - break; - case Opt_wbr_copyup: - sbinfo->si_wbr_copyup = opt->wbr_copyup; - sbinfo->si_wbr_copyup_ops = au_wbr_copyup_ops + opt->wbr_copyup; - break; - - case Opt_dirwh: - sbinfo->si_dirwh = opt->dirwh; - break; - - case Opt_rdcache: - sbinfo->si_rdcache - = msecs_to_jiffies(opt->rdcache * MSEC_PER_SEC); - break; - case Opt_rdblk: - sbinfo->si_rdblk = opt->rdblk; - break; - case Opt_rdblk_def: - sbinfo->si_rdblk = AUFS_RDBLK_DEF; - break; - case Opt_rdhash: - sbinfo->si_rdhash = opt->rdhash; - break; - case Opt_rdhash_def: - sbinfo->si_rdhash = AUFS_RDHASH_DEF; - break; - - case Opt_shwh: - au_opt_set(sbinfo->si_mntflags, SHWH); - break; - case Opt_noshwh: - au_opt_clr(sbinfo->si_mntflags, SHWH); - break; - - case Opt_dirperm1: - au_opt_set(sbinfo->si_mntflags, DIRPERM1); - break; - case Opt_nodirperm1: - au_opt_clr(sbinfo->si_mntflags, DIRPERM1); - break; - - case Opt_trunc_xino: - au_opt_set(sbinfo->si_mntflags, TRUNC_XINO); - break; - case Opt_notrunc_xino: - au_opt_clr(sbinfo->si_mntflags, TRUNC_XINO); - break; - - case Opt_trunc_xino_path: - case Opt_itrunc_xino: - err = au_xino_trunc(sb, opt->xino_itrunc.bindex); - if (!err) - err = 1; - break; - - case Opt_trunc_xib: - au_fset_opts(opts->flags, TRUNC_XIB); - break; - case Opt_notrunc_xib: - au_fclr_opts(opts->flags, TRUNC_XIB); - break; - - case Opt_acl: - sb->s_flags |= MS_POSIXACL; - break; - case Opt_noacl: - sb->s_flags &= ~MS_POSIXACL; - break; - - default: - err = 0; - break; - } - - return err; -} - -/* - * returns tri-state. - * plus: processed without an error - * zero: unprocessed - * minus: error - */ -static int au_opt_br(struct super_block *sb, struct au_opt *opt, - struct au_opts *opts) -{ - int err, do_refresh; - - err = 0; - switch (opt->type) { - case Opt_append: - opt->add.bindex = au_sbend(sb) + 1; - if (opt->add.bindex < 0) - opt->add.bindex = 0; - goto add; - case Opt_prepend: - opt->add.bindex = 0; - add: /* indented label */ - case Opt_add: - err = au_br_add(sb, &opt->add, - au_ftest_opts(opts->flags, REMOUNT)); - if (!err) { - err = 1; - au_fset_opts(opts->flags, REFRESH); - } - break; - - case Opt_del: - case Opt_idel: - err = au_br_del(sb, &opt->del, - au_ftest_opts(opts->flags, REMOUNT)); - if (!err) { - err = 1; - au_fset_opts(opts->flags, TRUNC_XIB); - au_fset_opts(opts->flags, REFRESH); - } - break; - - case Opt_mod: - case Opt_imod: - err = au_br_mod(sb, &opt->mod, - au_ftest_opts(opts->flags, REMOUNT), - &do_refresh); - if (!err) { - err = 1; - if (do_refresh) - au_fset_opts(opts->flags, REFRESH); - } - break; - } - - return err; -} - -static int au_opt_xino(struct super_block *sb, struct au_opt *opt, - struct au_opt_xino **opt_xino, - struct au_opts *opts) -{ - int err; - aufs_bindex_t bend, bindex; - struct dentry *root, *parent, *h_root; - - err = 0; - switch (opt->type) { - case Opt_xino: - err = au_xino_set(sb, &opt->xino, - !!au_ftest_opts(opts->flags, REMOUNT)); - if (unlikely(err)) - break; - - *opt_xino = &opt->xino; - au_xino_brid_set(sb, -1); - - /* safe d_parent access */ - parent = opt->xino.file->f_dentry->d_parent; - root = sb->s_root; - bend = au_sbend(sb); - for (bindex = 0; bindex <= bend; bindex++) { - h_root = au_h_dptr(root, bindex); - if (h_root == parent) { - au_xino_brid_set(sb, au_sbr_id(sb, bindex)); - break; - } - } - break; - - case Opt_noxino: - au_xino_clr(sb); - au_xino_brid_set(sb, -1); - *opt_xino = (void *)-1; - break; - } - - return err; -} - -int au_opts_verify(struct super_block *sb, unsigned long sb_flags, - unsigned int pending) -{ - int err, fhsm; - aufs_bindex_t bindex, bend; - unsigned char do_plink, skip, do_free; - struct au_branch *br; - struct au_wbr *wbr; - struct dentry *root; - struct inode *dir, *h_dir; - struct au_sbinfo *sbinfo; - struct au_hinode *hdir; - - SiMustAnyLock(sb); - - sbinfo = au_sbi(sb); - AuDebugOn(!(sbinfo->si_mntflags & AuOptMask_UDBA)); - - if (!(sb_flags & MS_RDONLY)) { - if (unlikely(!au_br_writable(au_sbr_perm(sb, 0)))) - pr_warn("first branch should be rw\n"); - if (unlikely(au_opt_test(sbinfo->si_mntflags, SHWH))) - pr_warn("shwh should be used with ro\n"); - } - - if (au_opt_test((sbinfo->si_mntflags | pending), UDBA_HNOTIFY) - && !au_opt_test(sbinfo->si_mntflags, XINO)) - pr_warn("udba=*notify requires xino\n"); - - if (au_opt_test(sbinfo->si_mntflags, DIRPERM1)) - pr_warn("dirperm1 breaks the protection" - " by the permission bits on the lower branch\n"); - - err = 0; - fhsm = 0; - root = sb->s_root; - dir = root->d_inode; - do_plink = !!au_opt_test(sbinfo->si_mntflags, PLINK); - bend = au_sbend(sb); - for (bindex = 0; !err && bindex <= bend; bindex++) { - skip = 0; - h_dir = au_h_iptr(dir, bindex); - br = au_sbr(sb, bindex); - - if ((br->br_perm & AuBrAttr_ICEX) - && !h_dir->i_op->listxattr) - br->br_perm &= ~AuBrAttr_ICEX; -#if 0 - if ((br->br_perm & AuBrAttr_ICEX_SEC) - && (au_br_sb(br)->s_flags & MS_NOSEC)) - br->br_perm &= ~AuBrAttr_ICEX_SEC; -#endif - - do_free = 0; - wbr = br->br_wbr; - if (wbr) - wbr_wh_read_lock(wbr); - - if (!au_br_writable(br->br_perm)) { - do_free = !!wbr; - skip = (!wbr - || (!wbr->wbr_whbase - && !wbr->wbr_plink - && !wbr->wbr_orph)); - } else if (!au_br_wh_linkable(br->br_perm)) { - /* skip = (!br->br_whbase && !br->br_orph); */ - skip = (!wbr || !wbr->wbr_whbase); - if (skip && wbr) { - if (do_plink) - skip = !!wbr->wbr_plink; - else - skip = !wbr->wbr_plink; - } - } else { - /* skip = (br->br_whbase && br->br_ohph); */ - skip = (wbr && wbr->wbr_whbase); - if (skip) { - if (do_plink) - skip = !!wbr->wbr_plink; - else - skip = !wbr->wbr_plink; - } - } - if (wbr) - wbr_wh_read_unlock(wbr); - - if (au_br_fhsm(br->br_perm)) { - fhsm++; - AuDebugOn(!br->br_fhsm); - } - - if (skip) - continue; - - hdir = au_hi(dir, bindex); - au_hn_imtx_lock_nested(hdir, AuLsc_I_PARENT); - if (wbr) - wbr_wh_write_lock(wbr); - err = au_wh_init(br, sb); - if (wbr) - wbr_wh_write_unlock(wbr); - au_hn_imtx_unlock(hdir); - - if (!err && do_free) { - kfree(wbr); - br->br_wbr = NULL; - } - } - - if (fhsm >= 2) { - au_fset_si(sbinfo, FHSM); - for (bindex = bend; bindex >= 0; bindex--) { - br = au_sbr(sb, bindex); - if (au_br_fhsm(br->br_perm)) { - au_fhsm_set_bottom(sb, bindex); - break; - } - } - } else { - au_fclr_si(sbinfo, FHSM); - au_fhsm_set_bottom(sb, -1); - } - - return err; -} - -int au_opts_mount(struct super_block *sb, struct au_opts *opts) -{ - int err; - unsigned int tmp; - aufs_bindex_t bindex, bend; - struct au_opt *opt; - struct au_opt_xino *opt_xino, xino; - struct au_sbinfo *sbinfo; - struct au_branch *br; - struct inode *dir; - - SiMustWriteLock(sb); - - err = 0; - opt_xino = NULL; - opt = opts->opt; - while (err >= 0 && opt->type != Opt_tail) - err = au_opt_simple(sb, opt++, opts); - if (err > 0) - err = 0; - else if (unlikely(err < 0)) - goto out; - - /* disable xino and udba temporary */ - sbinfo = au_sbi(sb); - tmp = sbinfo->si_mntflags; - au_opt_clr(sbinfo->si_mntflags, XINO); - au_opt_set_udba(sbinfo->si_mntflags, UDBA_REVAL); - - opt = opts->opt; - while (err >= 0 && opt->type != Opt_tail) - err = au_opt_br(sb, opt++, opts); - if (err > 0) - err = 0; - else if (unlikely(err < 0)) - goto out; - - bend = au_sbend(sb); - if (unlikely(bend < 0)) { - err = -EINVAL; - pr_err("no branches\n"); - goto out; - } - - if (au_opt_test(tmp, XINO)) - au_opt_set(sbinfo->si_mntflags, XINO); - opt = opts->opt; - while (!err && opt->type != Opt_tail) - err = au_opt_xino(sb, opt++, &opt_xino, opts); - if (unlikely(err)) - goto out; - - err = au_opts_verify(sb, sb->s_flags, tmp); - if (unlikely(err)) - goto out; - - /* restore xino */ - if (au_opt_test(tmp, XINO) && !opt_xino) { - xino.file = au_xino_def(sb); - err = PTR_ERR(xino.file); - if (IS_ERR(xino.file)) - goto out; - - err = au_xino_set(sb, &xino, /*remount*/0); - fput(xino.file); - if (unlikely(err)) - goto out; - } - - /* restore udba */ - tmp &= AuOptMask_UDBA; - sbinfo->si_mntflags &= ~AuOptMask_UDBA; - sbinfo->si_mntflags |= tmp; - bend = au_sbend(sb); - for (bindex = 0; bindex <= bend; bindex++) { - br = au_sbr(sb, bindex); - err = au_hnotify_reset_br(tmp, br, br->br_perm); - if (unlikely(err)) - AuIOErr("hnotify failed on br %d, %d, ignored\n", - bindex, err); - /* go on even if err */ - } - if (au_opt_test(tmp, UDBA_HNOTIFY)) { - dir = sb->s_root->d_inode; - au_hn_reset(dir, au_hi_flags(dir, /*isdir*/1) & ~AuHi_XINO); - } - -out: - return err; -} - -int au_opts_remount(struct super_block *sb, struct au_opts *opts) -{ - int err, rerr; - struct inode *dir; - struct au_opt_xino *opt_xino; - struct au_opt *opt; - struct au_sbinfo *sbinfo; - - SiMustWriteLock(sb); - - dir = sb->s_root->d_inode; - sbinfo = au_sbi(sb); - err = 0; - opt_xino = NULL; - opt = opts->opt; - while (err >= 0 && opt->type != Opt_tail) { - err = au_opt_simple(sb, opt, opts); - if (!err) - err = au_opt_br(sb, opt, opts); - if (!err) - err = au_opt_xino(sb, opt, &opt_xino, opts); - opt++; - } - if (err > 0) - err = 0; - AuTraceErr(err); - /* go on even err */ - - rerr = au_opts_verify(sb, opts->sb_flags, /*pending*/0); - if (unlikely(rerr && !err)) - err = rerr; - - if (au_ftest_opts(opts->flags, TRUNC_XIB)) { - rerr = au_xib_trunc(sb); - if (unlikely(rerr && !err)) - err = rerr; - } - - /* will be handled by the caller */ - if (!au_ftest_opts(opts->flags, REFRESH) - && (opts->given_udba || au_opt_test(sbinfo->si_mntflags, XINO))) - au_fset_opts(opts->flags, REFRESH); - - AuDbg("status 0x%x\n", opts->flags); - return err; -} - -/* ---------------------------------------------------------------------- */ - -unsigned int au_opt_udba(struct super_block *sb) -{ - return au_mntflags(sb) & AuOptMask_UDBA; -} diff --git a/fs/aufs/opts.h b/fs/aufs/opts.h deleted file mode 100644 index 5bef4d18beb9fe..00000000000000 --- a/fs/aufs/opts.h +++ /dev/null @@ -1,213 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * mount options/flags - */ - -#ifndef __AUFS_OPTS_H__ -#define __AUFS_OPTS_H__ - -#ifdef __KERNEL__ - -#include -#include "branch.h" - -struct file; -struct super_block; - -/* ---------------------------------------------------------------------- */ - -/* mount flags */ -#define AuOpt_XINO 1 /* external inode number bitmap - and translation table */ -#define AuOpt_TRUNC_XINO (1 << 1) /* truncate xino files */ -#define AuOpt_UDBA_NONE (1 << 2) /* users direct branch access */ -#define AuOpt_UDBA_REVAL (1 << 3) -#define AuOpt_UDBA_HNOTIFY (1 << 4) -#define AuOpt_SHWH (1 << 5) /* show whiteout */ -#define AuOpt_PLINK (1 << 6) /* pseudo-link */ -#define AuOpt_DIRPERM1 (1 << 7) /* ignore the lower dir's perm - bits */ -#define AuOpt_REFROF (1 << 8) /* unimplemented */ -#define AuOpt_ALWAYS_DIROPQ (1 << 9) /* policy to creating diropq */ -#define AuOpt_SUM (1 << 10) /* summation for statfs(2) */ -#define AuOpt_SUM_W (1 << 11) /* unimplemented */ -#define AuOpt_WARN_PERM (1 << 12) /* warn when add-branch */ -#define AuOpt_VERBOSE (1 << 13) /* busy inode when del-branch */ -#define AuOpt_DIO (1 << 14) /* direct io */ - -#ifndef CONFIG_AUFS_HNOTIFY -#undef AuOpt_UDBA_HNOTIFY -#define AuOpt_UDBA_HNOTIFY 0 -#endif -#ifndef CONFIG_AUFS_SHWH -#undef AuOpt_SHWH -#define AuOpt_SHWH 0 -#endif - -#define AuOpt_Def (AuOpt_XINO \ - | AuOpt_UDBA_REVAL \ - | AuOpt_PLINK \ - /* | AuOpt_DIRPERM1 */ \ - | AuOpt_WARN_PERM) -#define AuOptMask_UDBA (AuOpt_UDBA_NONE \ - | AuOpt_UDBA_REVAL \ - | AuOpt_UDBA_HNOTIFY) - -#define au_opt_test(flags, name) (flags & AuOpt_##name) -#define au_opt_set(flags, name) do { \ - BUILD_BUG_ON(AuOpt_##name & AuOptMask_UDBA); \ - ((flags) |= AuOpt_##name); \ -} while (0) -#define au_opt_set_udba(flags, name) do { \ - (flags) &= ~AuOptMask_UDBA; \ - ((flags) |= AuOpt_##name); \ -} while (0) -#define au_opt_clr(flags, name) do { \ - ((flags) &= ~AuOpt_##name); \ -} while (0) - -static inline unsigned int au_opts_plink(unsigned int mntflags) -{ -#ifdef CONFIG_PROC_FS - return mntflags; -#else - return mntflags & ~AuOpt_PLINK; -#endif -} - -/* ---------------------------------------------------------------------- */ - -/* policies to select one among multiple writable branches */ -enum { - AuWbrCreate_TDP, /* top down parent */ - AuWbrCreate_RR, /* round robin */ - AuWbrCreate_MFS, /* most free space */ - AuWbrCreate_MFSV, /* mfs with seconds */ - AuWbrCreate_MFSRR, /* mfs then rr */ - AuWbrCreate_MFSRRV, /* mfs then rr with seconds */ - AuWbrCreate_PMFS, /* parent and mfs */ - AuWbrCreate_PMFSV, /* parent and mfs with seconds */ - AuWbrCreate_PMFSRR, /* parent, mfs and round-robin */ - AuWbrCreate_PMFSRRV, /* plus seconds */ - - AuWbrCreate_Def = AuWbrCreate_TDP -}; - -enum { - AuWbrCopyup_TDP, /* top down parent */ - AuWbrCopyup_BUP, /* bottom up parent */ - AuWbrCopyup_BU, /* bottom up */ - - AuWbrCopyup_Def = AuWbrCopyup_TDP -}; - -/* ---------------------------------------------------------------------- */ - -struct au_opt_add { - aufs_bindex_t bindex; - char *pathname; - int perm; - struct path path; -}; - -struct au_opt_del { - char *pathname; - struct path h_path; -}; - -struct au_opt_mod { - char *path; - int perm; - struct dentry *h_root; -}; - -struct au_opt_xino { - char *path; - struct file *file; -}; - -struct au_opt_xino_itrunc { - aufs_bindex_t bindex; -}; - -struct au_opt_wbr_create { - int wbr_create; - int mfs_second; - unsigned long long mfsrr_watermark; -}; - -struct au_opt { - int type; - union { - struct au_opt_xino xino; - struct au_opt_xino_itrunc xino_itrunc; - struct au_opt_add add; - struct au_opt_del del; - struct au_opt_mod mod; - int dirwh; - int rdcache; - unsigned int rdblk; - unsigned int rdhash; - int udba; - struct au_opt_wbr_create wbr_create; - int wbr_copyup; - unsigned int fhsm_second; - }; -}; - -/* opts flags */ -#define AuOpts_REMOUNT 1 -#define AuOpts_REFRESH (1 << 1) -#define AuOpts_TRUNC_XIB (1 << 2) -#define AuOpts_REFRESH_DYAOP (1 << 3) -#define au_ftest_opts(flags, name) ((flags) & AuOpts_##name) -#define au_fset_opts(flags, name) \ - do { (flags) |= AuOpts_##name; } while (0) -#define au_fclr_opts(flags, name) \ - do { (flags) &= ~AuOpts_##name; } while (0) - -struct au_opts { - struct au_opt *opt; - int max_opt; - - unsigned int given_udba; - unsigned int flags; - unsigned long sb_flags; -}; - -/* ---------------------------------------------------------------------- */ - -void au_optstr_br_perm(au_br_perm_str_t *str, int perm); -const char *au_optstr_udba(int udba); -const char *au_optstr_wbr_copyup(int wbr_copyup); -const char *au_optstr_wbr_create(int wbr_create); - -void au_opts_free(struct au_opts *opts); -int au_opts_parse(struct super_block *sb, char *str, struct au_opts *opts); -int au_opts_verify(struct super_block *sb, unsigned long sb_flags, - unsigned int pending); -int au_opts_mount(struct super_block *sb, struct au_opts *opts); -int au_opts_remount(struct super_block *sb, struct au_opts *opts); - -unsigned int au_opt_udba(struct super_block *sb); - -/* ---------------------------------------------------------------------- */ - -#endif /* __KERNEL__ */ -#endif /* __AUFS_OPTS_H__ */ diff --git a/fs/aufs/plink.c b/fs/aufs/plink.c deleted file mode 100644 index d6af13d92c3854..00000000000000 --- a/fs/aufs/plink.c +++ /dev/null @@ -1,519 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * pseudo-link - */ - -#include "aufs.h" - -/* - * the pseudo-link maintenance mode. - * during a user process maintains the pseudo-links, - * prohibit adding a new plink and branch manipulation. - * - * Flags - * NOPLM: - * For entry functions which will handle plink, and i_mutex is already held - * in VFS. - * They cannot wait and should return an error at once. - * Callers has to check the error. - * NOPLMW: - * For entry functions which will handle plink, but i_mutex is not held - * in VFS. - * They can wait the plink maintenance mode to finish. - * - * They behave like F_SETLK and F_SETLKW. - * If the caller never handle plink, then both flags are unnecessary. - */ - -int au_plink_maint(struct super_block *sb, int flags) -{ - int err; - pid_t pid, ppid; - struct au_sbinfo *sbi; - - SiMustAnyLock(sb); - - err = 0; - if (!au_opt_test(au_mntflags(sb), PLINK)) - goto out; - - sbi = au_sbi(sb); - pid = sbi->si_plink_maint_pid; - if (!pid || pid == current->pid) - goto out; - - /* todo: it highly depends upon /sbin/mount.aufs */ - rcu_read_lock(); - ppid = task_pid_vnr(rcu_dereference(current->real_parent)); - rcu_read_unlock(); - if (pid == ppid) - goto out; - - if (au_ftest_lock(flags, NOPLMW)) { - /* if there is no i_mutex lock in VFS, we don't need to wait */ - /* AuDebugOn(!lockdep_depth(current)); */ - while (sbi->si_plink_maint_pid) { - si_read_unlock(sb); - /* gave up wake_up_bit() */ - wait_event(sbi->si_plink_wq, !sbi->si_plink_maint_pid); - - if (au_ftest_lock(flags, FLUSH)) - au_nwt_flush(&sbi->si_nowait); - si_noflush_read_lock(sb); - } - } else if (au_ftest_lock(flags, NOPLM)) { - AuDbg("ppid %d, pid %d\n", ppid, pid); - err = -EAGAIN; - } - -out: - return err; -} - -void au_plink_maint_leave(struct au_sbinfo *sbinfo) -{ - spin_lock(&sbinfo->si_plink_maint_lock); - sbinfo->si_plink_maint_pid = 0; - spin_unlock(&sbinfo->si_plink_maint_lock); - wake_up_all(&sbinfo->si_plink_wq); -} - -int au_plink_maint_enter(struct super_block *sb) -{ - int err; - struct au_sbinfo *sbinfo; - - err = 0; - sbinfo = au_sbi(sb); - /* make sure i am the only one in this fs */ - si_write_lock(sb, AuLock_FLUSH); - if (au_opt_test(au_mntflags(sb), PLINK)) { - spin_lock(&sbinfo->si_plink_maint_lock); - if (!sbinfo->si_plink_maint_pid) - sbinfo->si_plink_maint_pid = current->pid; - else - err = -EBUSY; - spin_unlock(&sbinfo->si_plink_maint_lock); - } - si_write_unlock(sb); - - return err; -} - -/* ---------------------------------------------------------------------- */ - -#ifdef CONFIG_AUFS_DEBUG -void au_plink_list(struct super_block *sb) -{ - int i; - struct au_sbinfo *sbinfo; - struct hlist_head *plink_hlist; - struct pseudo_link *plink; - - SiMustAnyLock(sb); - - sbinfo = au_sbi(sb); - AuDebugOn(!au_opt_test(au_mntflags(sb), PLINK)); - AuDebugOn(au_plink_maint(sb, AuLock_NOPLM)); - - for (i = 0; i < AuPlink_NHASH; i++) { - plink_hlist = &sbinfo->si_plink[i].head; - rcu_read_lock(); - hlist_for_each_entry_rcu(plink, plink_hlist, hlist) - AuDbg("%lu\n", plink->inode->i_ino); - rcu_read_unlock(); - } -} -#endif - -/* is the inode pseudo-linked? */ -int au_plink_test(struct inode *inode) -{ - int found, i; - struct au_sbinfo *sbinfo; - struct hlist_head *plink_hlist; - struct pseudo_link *plink; - - sbinfo = au_sbi(inode->i_sb); - AuRwMustAnyLock(&sbinfo->si_rwsem); - AuDebugOn(!au_opt_test(au_mntflags(inode->i_sb), PLINK)); - AuDebugOn(au_plink_maint(inode->i_sb, AuLock_NOPLM)); - - found = 0; - i = au_plink_hash(inode->i_ino); - plink_hlist = &sbinfo->si_plink[i].head; - rcu_read_lock(); - hlist_for_each_entry_rcu(plink, plink_hlist, hlist) - if (plink->inode == inode) { - found = 1; - break; - } - rcu_read_unlock(); - return found; -} - -/* ---------------------------------------------------------------------- */ - -/* - * generate a name for plink. - * the file will be stored under AUFS_WH_PLINKDIR. - */ -/* 20 is max digits length of ulong 64 */ -#define PLINK_NAME_LEN ((20 + 1) * 2) - -static int plink_name(char *name, int len, struct inode *inode, - aufs_bindex_t bindex) -{ - int rlen; - struct inode *h_inode; - - h_inode = au_h_iptr(inode, bindex); - rlen = snprintf(name, len, "%lu.%lu", inode->i_ino, h_inode->i_ino); - return rlen; -} - -struct au_do_plink_lkup_args { - struct dentry **errp; - struct qstr *tgtname; - struct dentry *h_parent; - struct au_branch *br; -}; - -static struct dentry *au_do_plink_lkup(struct qstr *tgtname, - struct dentry *h_parent, - struct au_branch *br) -{ - struct dentry *h_dentry; - struct mutex *h_mtx; - - h_mtx = &h_parent->d_inode->i_mutex; - mutex_lock_nested(h_mtx, AuLsc_I_CHILD2); - h_dentry = vfsub_lkup_one(tgtname, h_parent); - mutex_unlock(h_mtx); - return h_dentry; -} - -static void au_call_do_plink_lkup(void *args) -{ - struct au_do_plink_lkup_args *a = args; - *a->errp = au_do_plink_lkup(a->tgtname, a->h_parent, a->br); -} - -/* lookup the plink-ed @inode under the branch at @bindex */ -struct dentry *au_plink_lkup(struct inode *inode, aufs_bindex_t bindex) -{ - struct dentry *h_dentry, *h_parent; - struct au_branch *br; - struct inode *h_dir; - int wkq_err; - char a[PLINK_NAME_LEN]; - struct qstr tgtname = QSTR_INIT(a, 0); - - AuDebugOn(au_plink_maint(inode->i_sb, AuLock_NOPLM)); - - br = au_sbr(inode->i_sb, bindex); - h_parent = br->br_wbr->wbr_plink; - h_dir = h_parent->d_inode; - tgtname.len = plink_name(a, sizeof(a), inode, bindex); - - if (!uid_eq(current_fsuid(), GLOBAL_ROOT_UID)) { - struct au_do_plink_lkup_args args = { - .errp = &h_dentry, - .tgtname = &tgtname, - .h_parent = h_parent, - .br = br - }; - - wkq_err = au_wkq_wait(au_call_do_plink_lkup, &args); - if (unlikely(wkq_err)) - h_dentry = ERR_PTR(wkq_err); - } else - h_dentry = au_do_plink_lkup(&tgtname, h_parent, br); - - return h_dentry; -} - -/* create a pseudo-link */ -static int do_whplink(struct qstr *tgt, struct dentry *h_parent, - struct dentry *h_dentry, struct au_branch *br) -{ - int err; - struct path h_path = { - .mnt = au_br_mnt(br) - }; - struct inode *h_dir; - - h_dir = h_parent->d_inode; - mutex_lock_nested(&h_dir->i_mutex, AuLsc_I_CHILD2); -again: - h_path.dentry = vfsub_lkup_one(tgt, h_parent); - err = PTR_ERR(h_path.dentry); - if (IS_ERR(h_path.dentry)) - goto out; - - err = 0; - /* wh.plink dir is not monitored */ - /* todo: is it really safe? */ - if (h_path.dentry->d_inode - && h_path.dentry->d_inode != h_dentry->d_inode) { - err = vfsub_unlink(h_dir, &h_path, /*force*/0); - dput(h_path.dentry); - h_path.dentry = NULL; - if (!err) - goto again; - } - if (!err && !h_path.dentry->d_inode) - err = vfsub_link(h_dentry, h_dir, &h_path); - dput(h_path.dentry); - -out: - mutex_unlock(&h_dir->i_mutex); - return err; -} - -struct do_whplink_args { - int *errp; - struct qstr *tgt; - struct dentry *h_parent; - struct dentry *h_dentry; - struct au_branch *br; -}; - -static void call_do_whplink(void *args) -{ - struct do_whplink_args *a = args; - *a->errp = do_whplink(a->tgt, a->h_parent, a->h_dentry, a->br); -} - -static int whplink(struct dentry *h_dentry, struct inode *inode, - aufs_bindex_t bindex, struct au_branch *br) -{ - int err, wkq_err; - struct au_wbr *wbr; - struct dentry *h_parent; - struct inode *h_dir; - char a[PLINK_NAME_LEN]; - struct qstr tgtname = QSTR_INIT(a, 0); - - wbr = au_sbr(inode->i_sb, bindex)->br_wbr; - h_parent = wbr->wbr_plink; - h_dir = h_parent->d_inode; - tgtname.len = plink_name(a, sizeof(a), inode, bindex); - - /* always superio. */ - if (!uid_eq(current_fsuid(), GLOBAL_ROOT_UID)) { - struct do_whplink_args args = { - .errp = &err, - .tgt = &tgtname, - .h_parent = h_parent, - .h_dentry = h_dentry, - .br = br - }; - wkq_err = au_wkq_wait(call_do_whplink, &args); - if (unlikely(wkq_err)) - err = wkq_err; - } else - err = do_whplink(&tgtname, h_parent, h_dentry, br); - - return err; -} - -/* free a single plink */ -static void do_put_plink(struct pseudo_link *plink, int do_del) -{ - if (do_del) - hlist_del(&plink->hlist); - iput(plink->inode); - kfree(plink); -} - -static void do_put_plink_rcu(struct rcu_head *rcu) -{ - struct pseudo_link *plink; - - plink = container_of(rcu, struct pseudo_link, rcu); - iput(plink->inode); - kfree(plink); -} - -/* - * create a new pseudo-link for @h_dentry on @bindex. - * the linked inode is held in aufs @inode. - */ -void au_plink_append(struct inode *inode, aufs_bindex_t bindex, - struct dentry *h_dentry) -{ - struct super_block *sb; - struct au_sbinfo *sbinfo; - struct hlist_head *plink_hlist; - struct pseudo_link *plink, *tmp; - struct au_sphlhead *sphl; - int found, err, cnt, i; - - sb = inode->i_sb; - sbinfo = au_sbi(sb); - AuDebugOn(!au_opt_test(au_mntflags(sb), PLINK)); - AuDebugOn(au_plink_maint(sb, AuLock_NOPLM)); - - found = au_plink_test(inode); - if (found) - return; - - i = au_plink_hash(inode->i_ino); - sphl = sbinfo->si_plink + i; - plink_hlist = &sphl->head; - tmp = kmalloc(sizeof(*plink), GFP_NOFS); - if (tmp) - tmp->inode = au_igrab(inode); - else { - err = -ENOMEM; - goto out; - } - - spin_lock(&sphl->spin); - hlist_for_each_entry(plink, plink_hlist, hlist) { - if (plink->inode == inode) { - found = 1; - break; - } - } - if (!found) - hlist_add_head_rcu(&tmp->hlist, plink_hlist); - spin_unlock(&sphl->spin); - if (!found) { - cnt = au_sphl_count(sphl); -#define msg "unexpectedly unblanced or too many pseudo-links" - if (cnt > AUFS_PLINK_WARN) - AuWarn1(msg ", %d\n", cnt); -#undef msg - err = whplink(h_dentry, inode, bindex, au_sbr(sb, bindex)); - } else { - do_put_plink(tmp, 0); - return; - } - -out: - if (unlikely(err)) { - pr_warn("err %d, damaged pseudo link.\n", err); - if (tmp) { - au_sphl_del_rcu(&tmp->hlist, sphl); - call_rcu(&tmp->rcu, do_put_plink_rcu); - } - } -} - -/* free all plinks */ -void au_plink_put(struct super_block *sb, int verbose) -{ - int i, warned; - struct au_sbinfo *sbinfo; - struct hlist_head *plink_hlist; - struct hlist_node *tmp; - struct pseudo_link *plink; - - SiMustWriteLock(sb); - - sbinfo = au_sbi(sb); - AuDebugOn(!au_opt_test(au_mntflags(sb), PLINK)); - AuDebugOn(au_plink_maint(sb, AuLock_NOPLM)); - - /* no spin_lock since sbinfo is write-locked */ - warned = 0; - for (i = 0; i < AuPlink_NHASH; i++) { - plink_hlist = &sbinfo->si_plink[i].head; - if (!warned && verbose && !hlist_empty(plink_hlist)) { - pr_warn("pseudo-link is not flushed"); - warned = 1; - } - hlist_for_each_entry_safe(plink, tmp, plink_hlist, hlist) - do_put_plink(plink, 0); - INIT_HLIST_HEAD(plink_hlist); - } -} - -void au_plink_clean(struct super_block *sb, int verbose) -{ - struct dentry *root; - - root = sb->s_root; - aufs_write_lock(root); - if (au_opt_test(au_mntflags(sb), PLINK)) - au_plink_put(sb, verbose); - aufs_write_unlock(root); -} - -static int au_plink_do_half_refresh(struct inode *inode, aufs_bindex_t br_id) -{ - int do_put; - aufs_bindex_t bstart, bend, bindex; - - do_put = 0; - bstart = au_ibstart(inode); - bend = au_ibend(inode); - if (bstart >= 0) { - for (bindex = bstart; bindex <= bend; bindex++) { - if (!au_h_iptr(inode, bindex) - || au_ii_br_id(inode, bindex) != br_id) - continue; - au_set_h_iptr(inode, bindex, NULL, 0); - do_put = 1; - break; - } - if (do_put) - for (bindex = bstart; bindex <= bend; bindex++) - if (au_h_iptr(inode, bindex)) { - do_put = 0; - break; - } - } else - do_put = 1; - - return do_put; -} - -/* free the plinks on a branch specified by @br_id */ -void au_plink_half_refresh(struct super_block *sb, aufs_bindex_t br_id) -{ - struct au_sbinfo *sbinfo; - struct hlist_head *plink_hlist; - struct hlist_node *tmp; - struct pseudo_link *plink; - struct inode *inode; - int i, do_put; - - SiMustWriteLock(sb); - - sbinfo = au_sbi(sb); - AuDebugOn(!au_opt_test(au_mntflags(sb), PLINK)); - AuDebugOn(au_plink_maint(sb, AuLock_NOPLM)); - - /* no spin_lock since sbinfo is write-locked */ - for (i = 0; i < AuPlink_NHASH; i++) { - plink_hlist = &sbinfo->si_plink[i].head; - hlist_for_each_entry_safe(plink, tmp, plink_hlist, hlist) { - inode = au_igrab(plink->inode); - ii_write_lock_child(inode); - do_put = au_plink_do_half_refresh(inode, br_id); - if (do_put) - do_put_plink(plink, 1); - ii_write_unlock(inode); - iput(inode); - } - } -} diff --git a/fs/aufs/poll.c b/fs/aufs/poll.c deleted file mode 100644 index debe9ccbfe4baf..00000000000000 --- a/fs/aufs/poll.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * poll operation - * There is only one filesystem which implements ->poll operation, currently. - */ - -#include "aufs.h" - -unsigned int aufs_poll(struct file *file, poll_table *wait) -{ - unsigned int mask; - int err; - struct file *h_file; - struct dentry *dentry; - struct super_block *sb; - - /* We should pretend an error happened. */ - mask = POLLERR /* | POLLIN | POLLOUT */; - dentry = file->f_dentry; - sb = dentry->d_sb; - si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW); - err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/0); - if (unlikely(err)) - goto out; - - /* it is not an error if h_file has no operation */ - mask = DEFAULT_POLLMASK; - h_file = au_hf_top(file); - if (h_file->f_op && h_file->f_op->poll) - mask = h_file->f_op->poll(h_file, wait); - - di_read_unlock(dentry, AuLock_IR); - fi_read_unlock(file); - -out: - si_read_unlock(sb); - AuTraceErr((int)mask); - return mask; -} diff --git a/fs/aufs/procfs.c b/fs/aufs/procfs.c deleted file mode 100644 index c0c0b4195c181d..00000000000000 --- a/fs/aufs/procfs.c +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright (C) 2010-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * procfs interfaces - */ - -#include -#include "aufs.h" - -static int au_procfs_plm_release(struct inode *inode, struct file *file) -{ - struct au_sbinfo *sbinfo; - - sbinfo = file->private_data; - if (sbinfo) { - au_plink_maint_leave(sbinfo); - kobject_put(&sbinfo->si_kobj); - } - - return 0; -} - -static void au_procfs_plm_write_clean(struct file *file) -{ - struct au_sbinfo *sbinfo; - - sbinfo = file->private_data; - if (sbinfo) - au_plink_clean(sbinfo->si_sb, /*verbose*/0); -} - -static int au_procfs_plm_write_si(struct file *file, unsigned long id) -{ - int err; - struct super_block *sb; - struct au_sbinfo *sbinfo; - - err = -EBUSY; - if (unlikely(file->private_data)) - goto out; - - sb = NULL; - /* don't use au_sbilist_lock() here */ - spin_lock(&au_sbilist.spin); - list_for_each_entry(sbinfo, &au_sbilist.head, si_list) - if (id == sysaufs_si_id(sbinfo)) { - kobject_get(&sbinfo->si_kobj); - sb = sbinfo->si_sb; - break; - } - spin_unlock(&au_sbilist.spin); - - err = -EINVAL; - if (unlikely(!sb)) - goto out; - - err = au_plink_maint_enter(sb); - if (!err) - /* keep kobject_get() */ - file->private_data = sbinfo; - else - kobject_put(&sbinfo->si_kobj); -out: - return err; -} - -/* - * Accept a valid "si=xxxx" only. - * Once it is accepted successfully, accept "clean" too. - */ -static ssize_t au_procfs_plm_write(struct file *file, const char __user *ubuf, - size_t count, loff_t *ppos) -{ - ssize_t err; - unsigned long id; - /* last newline is allowed */ - char buf[3 + sizeof(unsigned long) * 2 + 1]; - - err = -EACCES; - if (unlikely(!capable(CAP_SYS_ADMIN))) - goto out; - - err = -EINVAL; - if (unlikely(count > sizeof(buf))) - goto out; - - err = copy_from_user(buf, ubuf, count); - if (unlikely(err)) { - err = -EFAULT; - goto out; - } - buf[count] = 0; - - err = -EINVAL; - if (!strcmp("clean", buf)) { - au_procfs_plm_write_clean(file); - goto out_success; - } else if (unlikely(strncmp("si=", buf, 3))) - goto out; - - err = kstrtoul(buf + 3, 16, &id); - if (unlikely(err)) - goto out; - - err = au_procfs_plm_write_si(file, id); - if (unlikely(err)) - goto out; - -out_success: - err = count; /* success */ -out: - return err; -} - -static const struct file_operations au_procfs_plm_fop = { - .write = au_procfs_plm_write, - .release = au_procfs_plm_release, - .owner = THIS_MODULE -}; - -/* ---------------------------------------------------------------------- */ - -static struct proc_dir_entry *au_procfs_dir; - -void au_procfs_fin(void) -{ - remove_proc_entry(AUFS_PLINK_MAINT_NAME, au_procfs_dir); - remove_proc_entry(AUFS_PLINK_MAINT_DIR, NULL); -} - -int __init au_procfs_init(void) -{ - int err; - struct proc_dir_entry *entry; - - err = -ENOMEM; - au_procfs_dir = proc_mkdir(AUFS_PLINK_MAINT_DIR, NULL); - if (unlikely(!au_procfs_dir)) - goto out; - - entry = proc_create(AUFS_PLINK_MAINT_NAME, S_IFREG | S_IWUSR, - au_procfs_dir, &au_procfs_plm_fop); - if (unlikely(!entry)) - goto out_dir; - - err = 0; - goto out; /* success */ - - -out_dir: - remove_proc_entry(AUFS_PLINK_MAINT_DIR, NULL); -out: - return err; -} diff --git a/fs/aufs/rdu.c b/fs/aufs/rdu.c deleted file mode 100644 index 7ca9ca9459ee6f..00000000000000 --- a/fs/aufs/rdu.c +++ /dev/null @@ -1,383 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * readdir in userspace. - */ - -#include -#include -#include -#include "aufs.h" - -/* bits for struct aufs_rdu.flags */ -#define AuRdu_CALLED 1 -#define AuRdu_CONT (1 << 1) -#define AuRdu_FULL (1 << 2) -#define au_ftest_rdu(flags, name) ((flags) & AuRdu_##name) -#define au_fset_rdu(flags, name) \ - do { (flags) |= AuRdu_##name; } while (0) -#define au_fclr_rdu(flags, name) \ - do { (flags) &= ~AuRdu_##name; } while (0) - -struct au_rdu_arg { - struct aufs_rdu *rdu; - union au_rdu_ent_ul ent; - unsigned long end; - - struct super_block *sb; - int err; -}; - -static int au_rdu_fill(void *__arg, const char *name, int nlen, - loff_t offset, u64 h_ino, unsigned int d_type) -{ - int err, len; - struct au_rdu_arg *arg = __arg; - struct aufs_rdu *rdu = arg->rdu; - struct au_rdu_ent ent; - - err = 0; - arg->err = 0; - au_fset_rdu(rdu->cookie.flags, CALLED); - len = au_rdu_len(nlen); - if (arg->ent.ul + len < arg->end) { - ent.ino = h_ino; - ent.bindex = rdu->cookie.bindex; - ent.type = d_type; - ent.nlen = nlen; - if (unlikely(nlen > AUFS_MAX_NAMELEN)) - ent.type = DT_UNKNOWN; - - /* unnecessary to support mmap_sem since this is a dir */ - err = -EFAULT; - if (copy_to_user(arg->ent.e, &ent, sizeof(ent))) - goto out; - if (copy_to_user(arg->ent.e->name, name, nlen)) - goto out; - /* the terminating NULL */ - if (__put_user(0, arg->ent.e->name + nlen)) - goto out; - err = 0; - /* AuDbg("%p, %.*s\n", arg->ent.p, nlen, name); */ - arg->ent.ul += len; - rdu->rent++; - } else { - err = -EFAULT; - au_fset_rdu(rdu->cookie.flags, FULL); - rdu->full = 1; - rdu->tail = arg->ent; - } - -out: - /* AuTraceErr(err); */ - return err; -} - -static int au_rdu_do(struct file *h_file, struct au_rdu_arg *arg) -{ - int err; - loff_t offset; - struct au_rdu_cookie *cookie = &arg->rdu->cookie; - - /* we don't have to care (FMODE_32BITHASH | FMODE_64BITHASH) for ext4 */ - offset = vfsub_llseek(h_file, cookie->h_pos, SEEK_SET); - err = offset; - if (unlikely(offset != cookie->h_pos)) - goto out; - - err = 0; - do { - arg->err = 0; - au_fclr_rdu(cookie->flags, CALLED); - /* smp_mb(); */ - err = vfsub_readdir(h_file, au_rdu_fill, arg); - if (err >= 0) - err = arg->err; - } while (!err - && au_ftest_rdu(cookie->flags, CALLED) - && !au_ftest_rdu(cookie->flags, FULL)); - cookie->h_pos = h_file->f_pos; - -out: - AuTraceErr(err); - return err; -} - -static int au_rdu(struct file *file, struct aufs_rdu *rdu) -{ - int err; - aufs_bindex_t bend; - struct au_rdu_arg arg; - struct dentry *dentry; - struct inode *inode; - struct file *h_file; - struct au_rdu_cookie *cookie = &rdu->cookie; - - err = !access_ok(VERIFY_WRITE, rdu->ent.e, rdu->sz); - if (unlikely(err)) { - err = -EFAULT; - AuTraceErr(err); - goto out; - } - rdu->rent = 0; - rdu->tail = rdu->ent; - rdu->full = 0; - arg.rdu = rdu; - arg.ent = rdu->ent; - arg.end = arg.ent.ul; - arg.end += rdu->sz; - - err = -ENOTDIR; - if (unlikely(!file->f_op || !file->f_op->readdir)) - goto out; - - err = security_file_permission(file, MAY_READ); - AuTraceErr(err); - if (unlikely(err)) - goto out; - - dentry = file->f_dentry; - inode = dentry->d_inode; -#if 1 - mutex_lock(&inode->i_mutex); -#else - err = mutex_lock_killable(&inode->i_mutex); - AuTraceErr(err); - if (unlikely(err)) - goto out; -#endif - - arg.sb = inode->i_sb; - err = si_read_lock(arg.sb, AuLock_FLUSH | AuLock_NOPLM); - if (unlikely(err)) - goto out_mtx; - err = au_alive_dir(dentry); - if (unlikely(err)) - goto out_si; - /* todo: reval? */ - fi_read_lock(file); - - err = -EAGAIN; - if (unlikely(au_ftest_rdu(cookie->flags, CONT) - && cookie->generation != au_figen(file))) - goto out_unlock; - - err = 0; - if (!rdu->blk) { - rdu->blk = au_sbi(arg.sb)->si_rdblk; - if (!rdu->blk) - rdu->blk = au_dir_size(file, /*dentry*/NULL); - } - bend = au_fbstart(file); - if (cookie->bindex < bend) - cookie->bindex = bend; - bend = au_fbend_dir(file); - /* AuDbg("b%d, b%d\n", cookie->bindex, bend); */ - for (; !err && cookie->bindex <= bend; - cookie->bindex++, cookie->h_pos = 0) { - h_file = au_hf_dir(file, cookie->bindex); - if (!h_file) - continue; - - au_fclr_rdu(cookie->flags, FULL); - err = au_rdu_do(h_file, &arg); - AuTraceErr(err); - if (unlikely(au_ftest_rdu(cookie->flags, FULL) || err)) - break; - } - AuDbg("rent %llu\n", rdu->rent); - - if (!err && !au_ftest_rdu(cookie->flags, CONT)) { - rdu->shwh = !!au_opt_test(au_sbi(arg.sb)->si_mntflags, SHWH); - au_fset_rdu(cookie->flags, CONT); - cookie->generation = au_figen(file); - } - - ii_read_lock_child(inode); - fsstack_copy_attr_atime(inode, au_h_iptr(inode, au_ibstart(inode))); - ii_read_unlock(inode); - -out_unlock: - fi_read_unlock(file); -out_si: - si_read_unlock(arg.sb); -out_mtx: - mutex_unlock(&inode->i_mutex); -out: - AuTraceErr(err); - return err; -} - -static int au_rdu_ino(struct file *file, struct aufs_rdu *rdu) -{ - int err; - ino_t ino; - unsigned long long nent; - union au_rdu_ent_ul *u; - struct au_rdu_ent ent; - struct super_block *sb; - - err = 0; - nent = rdu->nent; - u = &rdu->ent; - sb = file->f_dentry->d_sb; - si_read_lock(sb, AuLock_FLUSH); - while (nent-- > 0) { - /* unnecessary to support mmap_sem since this is a dir */ - err = copy_from_user(&ent, u->e, sizeof(ent)); - if (!err) - err = !access_ok(VERIFY_WRITE, &u->e->ino, sizeof(ino)); - if (unlikely(err)) { - err = -EFAULT; - AuTraceErr(err); - break; - } - - /* AuDbg("b%d, i%llu\n", ent.bindex, ent.ino); */ - if (!ent.wh) - err = au_ino(sb, ent.bindex, ent.ino, ent.type, &ino); - else - err = au_wh_ino(sb, ent.bindex, ent.ino, ent.type, - &ino); - if (unlikely(err)) { - AuTraceErr(err); - break; - } - - err = __put_user(ino, &u->e->ino); - if (unlikely(err)) { - err = -EFAULT; - AuTraceErr(err); - break; - } - u->ul += au_rdu_len(ent.nlen); - } - si_read_unlock(sb); - - return err; -} - -/* ---------------------------------------------------------------------- */ - -static int au_rdu_verify(struct aufs_rdu *rdu) -{ - AuDbg("rdu{%llu, %p, %u | %u | %llu, %u, %u | " - "%llu, b%d, 0x%x, g%u}\n", - rdu->sz, rdu->ent.e, rdu->verify[AufsCtlRduV_SZ], - rdu->blk, - rdu->rent, rdu->shwh, rdu->full, - rdu->cookie.h_pos, rdu->cookie.bindex, rdu->cookie.flags, - rdu->cookie.generation); - - if (rdu->verify[AufsCtlRduV_SZ] == sizeof(*rdu)) - return 0; - - AuDbg("%u:%u\n", - rdu->verify[AufsCtlRduV_SZ], (unsigned int)sizeof(*rdu)); - return -EINVAL; -} - -long au_rdu_ioctl(struct file *file, unsigned int cmd, unsigned long arg) -{ - long err, e; - struct aufs_rdu rdu; - void __user *p = (void __user *)arg; - - err = copy_from_user(&rdu, p, sizeof(rdu)); - if (unlikely(err)) { - err = -EFAULT; - AuTraceErr(err); - goto out; - } - err = au_rdu_verify(&rdu); - if (unlikely(err)) - goto out; - - switch (cmd) { - case AUFS_CTL_RDU: - err = au_rdu(file, &rdu); - if (unlikely(err)) - break; - - e = copy_to_user(p, &rdu, sizeof(rdu)); - if (unlikely(e)) { - err = -EFAULT; - AuTraceErr(err); - } - break; - case AUFS_CTL_RDU_INO: - err = au_rdu_ino(file, &rdu); - break; - - default: - /* err = -ENOTTY; */ - err = -EINVAL; - } - -out: - AuTraceErr(err); - return err; -} - -#ifdef CONFIG_COMPAT -long au_rdu_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) -{ - long err, e; - struct aufs_rdu rdu; - void __user *p = compat_ptr(arg); - - /* todo: get_user()? */ - err = copy_from_user(&rdu, p, sizeof(rdu)); - if (unlikely(err)) { - err = -EFAULT; - AuTraceErr(err); - goto out; - } - rdu.ent.e = compat_ptr(rdu.ent.ul); - err = au_rdu_verify(&rdu); - if (unlikely(err)) - goto out; - - switch (cmd) { - case AUFS_CTL_RDU: - err = au_rdu(file, &rdu); - if (unlikely(err)) - break; - - rdu.ent.ul = ptr_to_compat(rdu.ent.e); - rdu.tail.ul = ptr_to_compat(rdu.tail.e); - e = copy_to_user(p, &rdu, sizeof(rdu)); - if (unlikely(e)) { - err = -EFAULT; - AuTraceErr(err); - } - break; - case AUFS_CTL_RDU_INO: - err = au_rdu_ino(file, &rdu); - break; - - default: - /* err = -ENOTTY; */ - err = -EINVAL; - } - -out: - AuTraceErr(err); - return err; -} -#endif diff --git a/fs/aufs/rwsem.h b/fs/aufs/rwsem.h deleted file mode 100644 index 0704b079d17bdd..00000000000000 --- a/fs/aufs/rwsem.h +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * simple read-write semaphore wrappers - */ - -#ifndef __AUFS_RWSEM_H__ -#define __AUFS_RWSEM_H__ - -#ifdef __KERNEL__ - -#include "debug.h" - -struct au_rwsem { - struct rw_semaphore rwsem; -#ifdef CONFIG_AUFS_DEBUG - /* just for debugging, not almighty counter */ - atomic_t rcnt, wcnt; -#endif -}; - -#ifdef CONFIG_AUFS_DEBUG -#define AuDbgCntInit(rw) do { \ - atomic_set(&(rw)->rcnt, 0); \ - atomic_set(&(rw)->wcnt, 0); \ - smp_mb(); /* atomic set */ \ -} while (0) - -#define AuDbgRcntInc(rw) atomic_inc(&(rw)->rcnt) -#define AuDbgRcntDec(rw) WARN_ON(atomic_dec_return(&(rw)->rcnt) < 0) -#define AuDbgWcntInc(rw) atomic_inc(&(rw)->wcnt) -#define AuDbgWcntDec(rw) WARN_ON(atomic_dec_return(&(rw)->wcnt) < 0) -#else -#define AuDbgCntInit(rw) do {} while (0) -#define AuDbgRcntInc(rw) do {} while (0) -#define AuDbgRcntDec(rw) do {} while (0) -#define AuDbgWcntInc(rw) do {} while (0) -#define AuDbgWcntDec(rw) do {} while (0) -#endif /* CONFIG_AUFS_DEBUG */ - -/* to debug easier, do not make them inlined functions */ -#define AuRwMustNoWaiters(rw) AuDebugOn(!list_empty(&(rw)->rwsem.wait_list)) -/* rwsem_is_locked() is unusable */ -#define AuRwMustReadLock(rw) AuDebugOn(atomic_read(&(rw)->rcnt) <= 0) -#define AuRwMustWriteLock(rw) AuDebugOn(atomic_read(&(rw)->wcnt) <= 0) -#define AuRwMustAnyLock(rw) AuDebugOn(atomic_read(&(rw)->rcnt) <= 0 \ - && atomic_read(&(rw)->wcnt) <= 0) -#define AuRwDestroy(rw) AuDebugOn(atomic_read(&(rw)->rcnt) \ - || atomic_read(&(rw)->wcnt)) - -#define au_rw_class(rw, key) lockdep_set_class(&(rw)->rwsem, key) - -static inline void au_rw_init(struct au_rwsem *rw) -{ - AuDbgCntInit(rw); - init_rwsem(&rw->rwsem); -} - -static inline void au_rw_init_wlock(struct au_rwsem *rw) -{ - au_rw_init(rw); - down_write(&rw->rwsem); - AuDbgWcntInc(rw); -} - -static inline void au_rw_init_wlock_nested(struct au_rwsem *rw, - unsigned int lsc) -{ - au_rw_init(rw); - down_write_nested(&rw->rwsem, lsc); - AuDbgWcntInc(rw); -} - -static inline void au_rw_read_lock(struct au_rwsem *rw) -{ - down_read(&rw->rwsem); - AuDbgRcntInc(rw); -} - -static inline void au_rw_read_lock_nested(struct au_rwsem *rw, unsigned int lsc) -{ - down_read_nested(&rw->rwsem, lsc); - AuDbgRcntInc(rw); -} - -static inline void au_rw_read_unlock(struct au_rwsem *rw) -{ - AuRwMustReadLock(rw); - AuDbgRcntDec(rw); - up_read(&rw->rwsem); -} - -static inline void au_rw_dgrade_lock(struct au_rwsem *rw) -{ - AuRwMustWriteLock(rw); - AuDbgRcntInc(rw); - AuDbgWcntDec(rw); - downgrade_write(&rw->rwsem); -} - -static inline void au_rw_write_lock(struct au_rwsem *rw) -{ - down_write(&rw->rwsem); - AuDbgWcntInc(rw); -} - -static inline void au_rw_write_lock_nested(struct au_rwsem *rw, - unsigned int lsc) -{ - down_write_nested(&rw->rwsem, lsc); - AuDbgWcntInc(rw); -} - -static inline void au_rw_write_unlock(struct au_rwsem *rw) -{ - AuRwMustWriteLock(rw); - AuDbgWcntDec(rw); - up_write(&rw->rwsem); -} - -/* why is not _nested version defined */ -static inline int au_rw_read_trylock(struct au_rwsem *rw) -{ - int ret; - - ret = down_read_trylock(&rw->rwsem); - if (ret) - AuDbgRcntInc(rw); - return ret; -} - -static inline int au_rw_write_trylock(struct au_rwsem *rw) -{ - int ret; - - ret = down_write_trylock(&rw->rwsem); - if (ret) - AuDbgWcntInc(rw); - return ret; -} - -#undef AuDbgCntInit -#undef AuDbgRcntInc -#undef AuDbgRcntDec -#undef AuDbgWcntInc -#undef AuDbgWcntDec - -#define AuSimpleLockRwsemFuncs(prefix, param, rwsem) \ -static inline void prefix##_read_lock(param) \ -{ au_rw_read_lock(rwsem); } \ -static inline void prefix##_write_lock(param) \ -{ au_rw_write_lock(rwsem); } \ -static inline int prefix##_read_trylock(param) \ -{ return au_rw_read_trylock(rwsem); } \ -static inline int prefix##_write_trylock(param) \ -{ return au_rw_write_trylock(rwsem); } -/* why is not _nested version defined */ -/* static inline void prefix##_read_trylock_nested(param, lsc) -{ au_rw_read_trylock_nested(rwsem, lsc)); } -static inline void prefix##_write_trylock_nestd(param, lsc) -{ au_rw_write_trylock_nested(rwsem, lsc); } */ - -#define AuSimpleUnlockRwsemFuncs(prefix, param, rwsem) \ -static inline void prefix##_read_unlock(param) \ -{ au_rw_read_unlock(rwsem); } \ -static inline void prefix##_write_unlock(param) \ -{ au_rw_write_unlock(rwsem); } \ -static inline void prefix##_downgrade_lock(param) \ -{ au_rw_dgrade_lock(rwsem); } - -#define AuSimpleRwsemFuncs(prefix, param, rwsem) \ - AuSimpleLockRwsemFuncs(prefix, param, rwsem) \ - AuSimpleUnlockRwsemFuncs(prefix, param, rwsem) - -#endif /* __KERNEL__ */ -#endif /* __AUFS_RWSEM_H__ */ diff --git a/fs/aufs/sbinfo.c b/fs/aufs/sbinfo.c deleted file mode 100644 index 15564f60fc54da..00000000000000 --- a/fs/aufs/sbinfo.c +++ /dev/null @@ -1,351 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * superblock private data - */ - -#include "aufs.h" - -/* - * they are necessary regardless sysfs is disabled. - */ -void au_si_free(struct kobject *kobj) -{ - int i; - struct au_sbinfo *sbinfo; - char *locked __maybe_unused; /* debug only */ - - sbinfo = container_of(kobj, struct au_sbinfo, si_kobj); - for (i = 0; i < AuPlink_NHASH; i++) - AuDebugOn(!hlist_empty(&sbinfo->si_plink[i].head)); - AuDebugOn(atomic_read(&sbinfo->si_nowait.nw_len)); - - au_rw_write_lock(&sbinfo->si_rwsem); - au_br_free(sbinfo); - au_rw_write_unlock(&sbinfo->si_rwsem); - - AuDebugOn(radix_tree_gang_lookup - (&sbinfo->au_si_pid.tree, (void **)&locked, - /*first_index*/PID_MAX_DEFAULT - 1, - /*max_items*/sizeof(locked)/sizeof(*locked))); - - kfree(sbinfo->si_branch); - kfree(sbinfo->au_si_pid.bitmap); - mutex_destroy(&sbinfo->si_xib_mtx); - AuRwDestroy(&sbinfo->si_rwsem); - - kfree(sbinfo); -} - -int au_si_alloc(struct super_block *sb) -{ - int err, i; - struct au_sbinfo *sbinfo; - static struct lock_class_key aufs_si; - - err = -ENOMEM; - sbinfo = kzalloc(sizeof(*sbinfo), GFP_NOFS); - if (unlikely(!sbinfo)) - goto out; - - BUILD_BUG_ON(sizeof(unsigned long) != - sizeof(*sbinfo->au_si_pid.bitmap)); - sbinfo->au_si_pid.bitmap = kcalloc(BITS_TO_LONGS(PID_MAX_DEFAULT), - sizeof(*sbinfo->au_si_pid.bitmap), - GFP_NOFS); - if (unlikely(!sbinfo->au_si_pid.bitmap)) - goto out_sbinfo; - - /* will be reallocated separately */ - sbinfo->si_branch = kzalloc(sizeof(*sbinfo->si_branch), GFP_NOFS); - if (unlikely(!sbinfo->si_branch)) - goto out_pidmap; - - err = sysaufs_si_init(sbinfo); - if (unlikely(err)) - goto out_br; - - au_nwt_init(&sbinfo->si_nowait); - au_rw_init_wlock(&sbinfo->si_rwsem); - au_rw_class(&sbinfo->si_rwsem, &aufs_si); - spin_lock_init(&sbinfo->au_si_pid.tree_lock); - INIT_RADIX_TREE(&sbinfo->au_si_pid.tree, GFP_ATOMIC | __GFP_NOFAIL); - - atomic_long_set(&sbinfo->si_ninodes, 0); - atomic_long_set(&sbinfo->si_nfiles, 0); - - sbinfo->si_bend = -1; - sbinfo->si_last_br_id = AUFS_BRANCH_MAX / 2; - - sbinfo->si_wbr_copyup = AuWbrCopyup_Def; - sbinfo->si_wbr_create = AuWbrCreate_Def; - sbinfo->si_wbr_copyup_ops = au_wbr_copyup_ops + sbinfo->si_wbr_copyup; - sbinfo->si_wbr_create_ops = au_wbr_create_ops + sbinfo->si_wbr_create; - - au_fhsm_init(sbinfo); - - sbinfo->si_mntflags = au_opts_plink(AuOpt_Def); - - sbinfo->si_xino_jiffy = jiffies; - sbinfo->si_xino_expire - = msecs_to_jiffies(AUFS_XINO_DEF_SEC * MSEC_PER_SEC); - mutex_init(&sbinfo->si_xib_mtx); - sbinfo->si_xino_brid = -1; - /* leave si_xib_last_pindex and si_xib_next_bit */ - - sbinfo->si_rdcache = msecs_to_jiffies(AUFS_RDCACHE_DEF * MSEC_PER_SEC); - sbinfo->si_rdblk = AUFS_RDBLK_DEF; - sbinfo->si_rdhash = AUFS_RDHASH_DEF; - sbinfo->si_dirwh = AUFS_DIRWH_DEF; - - for (i = 0; i < AuPlink_NHASH; i++) - au_sphl_init(sbinfo->si_plink + i); - init_waitqueue_head(&sbinfo->si_plink_wq); - spin_lock_init(&sbinfo->si_plink_maint_lock); - - /* leave other members for sysaufs and si_mnt. */ - sbinfo->si_sb = sb; - sb->s_fs_info = sbinfo; - si_pid_set(sb); - au_debug_sbinfo_init(sbinfo); - return 0; /* success */ - -out_br: - kfree(sbinfo->si_branch); -out_pidmap: - kfree(sbinfo->au_si_pid.bitmap); -out_sbinfo: - kfree(sbinfo); -out: - return err; -} - -int au_sbr_realloc(struct au_sbinfo *sbinfo, int nbr) -{ - int err, sz; - struct au_branch **brp; - - AuRwMustWriteLock(&sbinfo->si_rwsem); - - err = -ENOMEM; - sz = sizeof(*brp) * (sbinfo->si_bend + 1); - if (unlikely(!sz)) - sz = sizeof(*brp); - brp = au_kzrealloc(sbinfo->si_branch, sz, sizeof(*brp) * nbr, GFP_NOFS); - if (brp) { - sbinfo->si_branch = brp; - err = 0; - } - - return err; -} - -/* ---------------------------------------------------------------------- */ - -unsigned int au_sigen_inc(struct super_block *sb) -{ - unsigned int gen; - - SiMustWriteLock(sb); - - gen = ++au_sbi(sb)->si_generation; - au_update_digen(sb->s_root); - au_update_iigen(sb->s_root->d_inode, /*half*/0); - sb->s_root->d_inode->i_version++; - return gen; -} - -aufs_bindex_t au_new_br_id(struct super_block *sb) -{ - aufs_bindex_t br_id; - int i; - struct au_sbinfo *sbinfo; - - SiMustWriteLock(sb); - - sbinfo = au_sbi(sb); - for (i = 0; i <= AUFS_BRANCH_MAX; i++) { - br_id = ++sbinfo->si_last_br_id; - AuDebugOn(br_id < 0); - if (br_id && au_br_index(sb, br_id) < 0) - return br_id; - } - - return -1; -} - -/* ---------------------------------------------------------------------- */ - -/* it is ok that new 'nwt' tasks are appended while we are sleeping */ -int si_read_lock(struct super_block *sb, int flags) -{ - int err; - - err = 0; - if (au_ftest_lock(flags, FLUSH)) - au_nwt_flush(&au_sbi(sb)->si_nowait); - - si_noflush_read_lock(sb); - err = au_plink_maint(sb, flags); - if (unlikely(err)) - si_read_unlock(sb); - - return err; -} - -int si_write_lock(struct super_block *sb, int flags) -{ - int err; - - if (au_ftest_lock(flags, FLUSH)) - au_nwt_flush(&au_sbi(sb)->si_nowait); - - si_noflush_write_lock(sb); - err = au_plink_maint(sb, flags); - if (unlikely(err)) - si_write_unlock(sb); - - return err; -} - -/* dentry and super_block lock. call at entry point */ -int aufs_read_lock(struct dentry *dentry, int flags) -{ - int err; - struct super_block *sb; - - sb = dentry->d_sb; - err = si_read_lock(sb, flags); - if (unlikely(err)) - goto out; - - if (au_ftest_lock(flags, DW)) - di_write_lock_child(dentry); - else - di_read_lock_child(dentry, flags); - - if (au_ftest_lock(flags, GEN)) { - err = au_digen_test(dentry, au_sigen(sb)); - AuDebugOn(!err && au_dbrange_test(dentry)); - if (unlikely(err)) - aufs_read_unlock(dentry, flags); - } - -out: - return err; -} - -void aufs_read_unlock(struct dentry *dentry, int flags) -{ - if (au_ftest_lock(flags, DW)) - di_write_unlock(dentry); - else - di_read_unlock(dentry, flags); - si_read_unlock(dentry->d_sb); -} - -void aufs_write_lock(struct dentry *dentry) -{ - si_write_lock(dentry->d_sb, AuLock_FLUSH | AuLock_NOPLMW); - di_write_lock_child(dentry); -} - -void aufs_write_unlock(struct dentry *dentry) -{ - di_write_unlock(dentry); - si_write_unlock(dentry->d_sb); -} - -int aufs_read_and_write_lock2(struct dentry *d1, struct dentry *d2, int flags) -{ - int err; - unsigned int sigen; - struct super_block *sb; - - sb = d1->d_sb; - err = si_read_lock(sb, flags); - if (unlikely(err)) - goto out; - - di_write_lock2_child(d1, d2, au_ftest_lock(flags, DIR)); - - if (au_ftest_lock(flags, GEN)) { - sigen = au_sigen(sb); - err = au_digen_test(d1, sigen); - AuDebugOn(!err && au_dbrange_test(d1)); - if (!err) { - err = au_digen_test(d2, sigen); - AuDebugOn(!err && au_dbrange_test(d2)); - } - if (unlikely(err)) - aufs_read_and_write_unlock2(d1, d2); - } - -out: - return err; -} - -void aufs_read_and_write_unlock2(struct dentry *d1, struct dentry *d2) -{ - di_write_unlock2(d1, d2); - si_read_unlock(d1->d_sb); -} - -/* ---------------------------------------------------------------------- */ - -int si_pid_test_slow(struct super_block *sb) -{ - void *p; - - rcu_read_lock(); - p = radix_tree_lookup(&au_sbi(sb)->au_si_pid.tree, current->pid); - rcu_read_unlock(); - - return (long)!!p; -} - -void si_pid_set_slow(struct super_block *sb) -{ - int err; - struct au_sbinfo *sbinfo; - - AuDebugOn(si_pid_test_slow(sb)); - - sbinfo = au_sbi(sb); - err = radix_tree_preload(GFP_NOFS | __GFP_NOFAIL); - AuDebugOn(err); - spin_lock(&sbinfo->au_si_pid.tree_lock); - err = radix_tree_insert(&sbinfo->au_si_pid.tree, current->pid, - /*any valid ptr*/sb); - spin_unlock(&sbinfo->au_si_pid.tree_lock); - AuDebugOn(err); - radix_tree_preload_end(); -} - -void si_pid_clr_slow(struct super_block *sb) -{ - void *p; - struct au_sbinfo *sbinfo; - - AuDebugOn(!si_pid_test_slow(sb)); - - sbinfo = au_sbi(sb); - spin_lock(&sbinfo->au_si_pid.tree_lock); - p = radix_tree_delete(&sbinfo->au_si_pid.tree, current->pid); - spin_unlock(&sbinfo->au_si_pid.tree_lock); -} diff --git a/fs/aufs/spl.h b/fs/aufs/spl.h deleted file mode 100644 index fbcd820fbfaeef..00000000000000 --- a/fs/aufs/spl.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * simple list protected by a spinlock - */ - -#ifndef __AUFS_SPL_H__ -#define __AUFS_SPL_H__ - -#ifdef __KERNEL__ - -struct au_splhead { - spinlock_t spin; - struct list_head head; -}; - -static inline void au_spl_init(struct au_splhead *spl) -{ - spin_lock_init(&spl->spin); - INIT_LIST_HEAD(&spl->head); -} - -static inline void au_spl_add(struct list_head *list, struct au_splhead *spl) -{ - spin_lock(&spl->spin); - list_add(list, &spl->head); - spin_unlock(&spl->spin); -} - -static inline void au_spl_del(struct list_head *list, struct au_splhead *spl) -{ - spin_lock(&spl->spin); - list_del(list); - spin_unlock(&spl->spin); -} - -static inline void au_spl_del_rcu(struct list_head *list, - struct au_splhead *spl) -{ - spin_lock(&spl->spin); - list_del_rcu(list); - spin_unlock(&spl->spin); -} - -/* ---------------------------------------------------------------------- */ - -struct au_sphlhead { - spinlock_t spin; - struct hlist_head head; -}; - -static inline void au_sphl_init(struct au_sphlhead *sphl) -{ - spin_lock_init(&sphl->spin); - INIT_HLIST_HEAD(&sphl->head); -} - -static inline void au_sphl_add(struct hlist_node *hlist, - struct au_sphlhead *sphl) -{ - spin_lock(&sphl->spin); - hlist_add_head(hlist, &sphl->head); - spin_unlock(&sphl->spin); -} - -static inline void au_sphl_del(struct hlist_node *hlist, - struct au_sphlhead *sphl) -{ - spin_lock(&sphl->spin); - hlist_del(hlist); - spin_unlock(&sphl->spin); -} - -static inline void au_sphl_del_rcu(struct hlist_node *hlist, - struct au_sphlhead *sphl) -{ - spin_lock(&sphl->spin); - hlist_del_rcu(hlist); - spin_unlock(&sphl->spin); -} - -static inline unsigned long au_sphl_count(struct au_sphlhead *sphl) -{ - unsigned long cnt; - struct hlist_node *pos; - - cnt = 0; - spin_lock(&sphl->spin); - hlist_for_each(pos, &sphl->head) - cnt++; - spin_unlock(&sphl->spin); - return cnt; -} - -#endif /* __KERNEL__ */ -#endif /* __AUFS_SPL_H__ */ diff --git a/fs/aufs/super.c b/fs/aufs/super.c deleted file mode 100644 index 41a02b2cbdc71e..00000000000000 --- a/fs/aufs/super.c +++ /dev/null @@ -1,1008 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * mount and super_block operations - */ - -#include -#include -#include -#include -#include -#include -#include "aufs.h" - -/* - * super_operations - */ -static struct inode *aufs_alloc_inode(struct super_block *sb __maybe_unused) -{ - struct au_icntnr *c; - - c = au_cache_alloc_icntnr(); - if (c) { - au_icntnr_init(c); - c->vfs_inode.i_version = 1; /* sigen(sb); */ - c->iinfo.ii_hinode = NULL; - return &c->vfs_inode; - } - return NULL; -} - -static void aufs_destroy_inode_cb(struct rcu_head *head) -{ - struct inode *inode = container_of(head, struct inode, i_rcu); - - INIT_HLIST_HEAD(&inode->i_dentry); - au_cache_free_icntnr(container_of(inode, struct au_icntnr, vfs_inode)); -} - -static void aufs_destroy_inode(struct inode *inode) -{ - au_iinfo_fin(inode); - call_rcu(&inode->i_rcu, aufs_destroy_inode_cb); -} - -struct inode *au_iget_locked(struct super_block *sb, ino_t ino) -{ - struct inode *inode; - int err; - - inode = iget_locked(sb, ino); - if (unlikely(!inode)) { - inode = ERR_PTR(-ENOMEM); - goto out; - } - if (!(inode->i_state & I_NEW)) - goto out; - - err = au_xigen_new(inode); - if (!err) - err = au_iinfo_init(inode); - if (!err) - inode->i_version++; - else { - iget_failed(inode); - inode = ERR_PTR(err); - } - -out: - /* never return NULL */ - AuDebugOn(!inode); - AuTraceErrPtr(inode); - return inode; -} - -/* lock free root dinfo */ -static int au_show_brs(struct seq_file *seq, struct super_block *sb) -{ - int err; - aufs_bindex_t bindex, bend; - struct path path; - struct au_hdentry *hdp; - struct au_branch *br; - au_br_perm_str_t perm; - - err = 0; - bend = au_sbend(sb); - hdp = au_di(sb->s_root)->di_hdentry; - for (bindex = 0; !err && bindex <= bend; bindex++) { - br = au_sbr(sb, bindex); - path.mnt = au_br_mnt(br); - path.dentry = hdp[bindex].hd_dentry; - err = au_seq_path(seq, &path); - if (err > 0) { - au_optstr_br_perm(&perm, br->br_perm); - err = seq_printf(seq, "=%s", perm.a); - if (err == -1) - err = -E2BIG; - } - if (!err && bindex != bend) - err = seq_putc(seq, ':'); - } - - return err; -} - -static void au_show_wbr_create(struct seq_file *m, int v, - struct au_sbinfo *sbinfo) -{ - const char *pat; - - AuRwMustAnyLock(&sbinfo->si_rwsem); - - seq_puts(m, ",create="); - pat = au_optstr_wbr_create(v); - switch (v) { - case AuWbrCreate_TDP: - case AuWbrCreate_RR: - case AuWbrCreate_MFS: - case AuWbrCreate_PMFS: - seq_puts(m, pat); - break; - case AuWbrCreate_MFSV: - seq_printf(m, /*pat*/"mfs:%lu", - jiffies_to_msecs(sbinfo->si_wbr_mfs.mfs_expire) - / MSEC_PER_SEC); - break; - case AuWbrCreate_PMFSV: - seq_printf(m, /*pat*/"pmfs:%lu", - jiffies_to_msecs(sbinfo->si_wbr_mfs.mfs_expire) - / MSEC_PER_SEC); - break; - case AuWbrCreate_MFSRR: - seq_printf(m, /*pat*/"mfsrr:%llu", - sbinfo->si_wbr_mfs.mfsrr_watermark); - break; - case AuWbrCreate_MFSRRV: - seq_printf(m, /*pat*/"mfsrr:%llu:%lu", - sbinfo->si_wbr_mfs.mfsrr_watermark, - jiffies_to_msecs(sbinfo->si_wbr_mfs.mfs_expire) - / MSEC_PER_SEC); - break; - case AuWbrCreate_PMFSRR: - seq_printf(m, /*pat*/"pmfsrr:%llu", - sbinfo->si_wbr_mfs.mfsrr_watermark); - break; - case AuWbrCreate_PMFSRRV: - seq_printf(m, /*pat*/"pmfsrr:%llu:%lu", - sbinfo->si_wbr_mfs.mfsrr_watermark, - jiffies_to_msecs(sbinfo->si_wbr_mfs.mfs_expire) - / MSEC_PER_SEC); - break; - } -} - -static int au_show_xino(struct seq_file *seq, struct super_block *sb) -{ -#ifdef CONFIG_SYSFS - return 0; -#else - int err; - const int len = sizeof(AUFS_XINO_FNAME) - 1; - aufs_bindex_t bindex, brid; - struct qstr *name; - struct file *f; - struct dentry *d, *h_root; - struct au_hdentry *hdp; - - AuRwMustAnyLock(&sbinfo->si_rwsem); - - err = 0; - f = au_sbi(sb)->si_xib; - if (!f) - goto out; - - /* stop printing the default xino path on the first writable branch */ - h_root = NULL; - brid = au_xino_brid(sb); - if (brid >= 0) { - bindex = au_br_index(sb, brid); - hdp = au_di(sb->s_root)->di_hdentry; - h_root = hdp[0 + bindex].hd_dentry; - } - d = f->f_dentry; - name = &d->d_name; - /* safe ->d_parent because the file is unlinked */ - if (d->d_parent == h_root - && name->len == len - && !memcmp(name->name, AUFS_XINO_FNAME, len)) - goto out; - - seq_puts(seq, ",xino="); - err = au_xino_path(seq, f); - -out: - return err; -#endif -} - -/* seq_file will re-call me in case of too long string */ -static int aufs_show_options(struct seq_file *m, struct dentry *dentry) -{ - int err; - unsigned int mnt_flags, v; - struct super_block *sb; - struct au_sbinfo *sbinfo; - -#define AuBool(name, str) do { \ - v = au_opt_test(mnt_flags, name); \ - if (v != au_opt_test(AuOpt_Def, name)) \ - seq_printf(m, ",%s" #str, v ? "" : "no"); \ -} while (0) - -#define AuStr(name, str) do { \ - v = mnt_flags & AuOptMask_##name; \ - if (v != (AuOpt_Def & AuOptMask_##name)) \ - seq_printf(m, "," #str "=%s", au_optstr_##str(v)); \ -} while (0) - -#define AuUInt(name, str, val) do { \ - if (val != AUFS_##name##_DEF) \ - seq_printf(m, "," #str "=%u", val); \ -} while (0) - - sb = dentry->d_sb; - if (sb->s_flags & MS_POSIXACL) - seq_puts(m, ",acl"); - - /* lock free root dinfo */ - si_noflush_read_lock(sb); - sbinfo = au_sbi(sb); - seq_printf(m, ",si=%lx", sysaufs_si_id(sbinfo)); - - mnt_flags = au_mntflags(sb); - if (au_opt_test(mnt_flags, XINO)) { - err = au_show_xino(m, sb); - if (unlikely(err)) - goto out; - } else - seq_puts(m, ",noxino"); - - AuBool(TRUNC_XINO, trunc_xino); - AuStr(UDBA, udba); - AuBool(SHWH, shwh); - AuBool(PLINK, plink); - AuBool(DIO, dio); - AuBool(DIRPERM1, dirperm1); - /* AuBool(REFROF, refrof); */ - - v = sbinfo->si_wbr_create; - if (v != AuWbrCreate_Def) - au_show_wbr_create(m, v, sbinfo); - - v = sbinfo->si_wbr_copyup; - if (v != AuWbrCopyup_Def) - seq_printf(m, ",cpup=%s", au_optstr_wbr_copyup(v)); - - v = au_opt_test(mnt_flags, ALWAYS_DIROPQ); - if (v != au_opt_test(AuOpt_Def, ALWAYS_DIROPQ)) - seq_printf(m, ",diropq=%c", v ? 'a' : 'w'); - - AuUInt(DIRWH, dirwh, sbinfo->si_dirwh); - - v = jiffies_to_msecs(sbinfo->si_rdcache) / MSEC_PER_SEC; - AuUInt(RDCACHE, rdcache, v); - - AuUInt(RDBLK, rdblk, sbinfo->si_rdblk); - AuUInt(RDHASH, rdhash, sbinfo->si_rdhash); - - au_fhsm_show(m, sbinfo); - - AuBool(SUM, sum); - /* AuBool(SUM_W, wsum); */ - AuBool(WARN_PERM, warn_perm); - AuBool(VERBOSE, verbose); - -out: - /* be sure to print "br:" last */ - if (!sysaufs_brs) { - seq_puts(m, ",br:"); - au_show_brs(m, sb); - } - si_read_unlock(sb); - return 0; - -#undef AuBool -#undef AuStr -#undef AuUInt -} - -/* ---------------------------------------------------------------------- */ - -/* sum mode which returns the summation for statfs(2) */ - -static u64 au_add_till_max(u64 a, u64 b) -{ - u64 old; - - old = a; - a += b; - if (old <= a) - return a; - return ULLONG_MAX; -} - -static u64 au_mul_till_max(u64 a, long mul) -{ - u64 old; - - old = a; - a *= mul; - if (old <= a) - return a; - return ULLONG_MAX; -} - -static int au_statfs_sum(struct super_block *sb, struct kstatfs *buf) -{ - int err; - long bsize, factor; - u64 blocks, bfree, bavail, files, ffree; - aufs_bindex_t bend, bindex, i; - unsigned char shared; - struct path h_path; - struct super_block *h_sb; - - err = 0; - bsize = LONG_MAX; - files = 0; - ffree = 0; - blocks = 0; - bfree = 0; - bavail = 0; - bend = au_sbend(sb); - for (bindex = 0; bindex <= bend; bindex++) { - h_path.mnt = au_sbr_mnt(sb, bindex); - h_sb = h_path.mnt->mnt_sb; - shared = 0; - for (i = 0; !shared && i < bindex; i++) - shared = (au_sbr_sb(sb, i) == h_sb); - if (shared) - continue; - - /* sb->s_root for NFS is unreliable */ - h_path.dentry = h_path.mnt->mnt_root; - err = vfs_statfs(&h_path, buf); - if (unlikely(err)) - goto out; - - if (bsize > buf->f_bsize) { - /* - * we will reduce bsize, so we have to expand blocks - * etc. to match them again - */ - factor = (bsize / buf->f_bsize); - blocks = au_mul_till_max(blocks, factor); - bfree = au_mul_till_max(bfree, factor); - bavail = au_mul_till_max(bavail, factor); - bsize = buf->f_bsize; - } - - factor = (buf->f_bsize / bsize); - blocks = au_add_till_max(blocks, - au_mul_till_max(buf->f_blocks, factor)); - bfree = au_add_till_max(bfree, - au_mul_till_max(buf->f_bfree, factor)); - bavail = au_add_till_max(bavail, - au_mul_till_max(buf->f_bavail, factor)); - files = au_add_till_max(files, buf->f_files); - ffree = au_add_till_max(ffree, buf->f_ffree); - } - - buf->f_bsize = bsize; - buf->f_blocks = blocks; - buf->f_bfree = bfree; - buf->f_bavail = bavail; - buf->f_files = files; - buf->f_ffree = ffree; - buf->f_frsize = 0; - -out: - return err; -} - -static int aufs_statfs(struct dentry *dentry, struct kstatfs *buf) -{ - int err; - struct path h_path; - struct super_block *sb; - - /* lock free root dinfo */ - sb = dentry->d_sb; - si_noflush_read_lock(sb); - if (!au_opt_test(au_mntflags(sb), SUM)) { - /* sb->s_root for NFS is unreliable */ - h_path.mnt = au_sbr_mnt(sb, 0); - h_path.dentry = h_path.mnt->mnt_root; - err = vfs_statfs(&h_path, buf); - } else - err = au_statfs_sum(sb, buf); - si_read_unlock(sb); - - if (!err) { - buf->f_type = AUFS_SUPER_MAGIC; - buf->f_namelen = AUFS_MAX_NAMELEN; - memset(&buf->f_fsid, 0, sizeof(buf->f_fsid)); - } - /* buf->f_bsize = buf->f_blocks = buf->f_bfree = buf->f_bavail = -1; */ - - return err; -} - -/* ---------------------------------------------------------------------- */ - -static int aufs_sync_fs(struct super_block *sb, int wait) -{ - int err, e; - aufs_bindex_t bend, bindex; - struct au_branch *br; - struct super_block *h_sb; - - err = 0; - si_noflush_read_lock(sb); - bend = au_sbend(sb); - for (bindex = 0; bindex <= bend; bindex++) { - br = au_sbr(sb, bindex); - if (!au_br_writable(br->br_perm)) - continue; - - h_sb = au_sbr_sb(sb, bindex); - if (h_sb->s_op->sync_fs) { - e = h_sb->s_op->sync_fs(h_sb, wait); - if (unlikely(e && !err)) - err = e; - /* go on even if an error happens */ - } - } - si_read_unlock(sb); - - return err; -} - -/* ---------------------------------------------------------------------- */ - -/* final actions when unmounting a file system */ -static void aufs_put_super(struct super_block *sb) -{ - struct au_sbinfo *sbinfo; - - sbinfo = au_sbi(sb); - if (!sbinfo) - return; - - dbgaufs_si_fin(sbinfo); - kobject_put(&sbinfo->si_kobj); -} - -/* ---------------------------------------------------------------------- */ - -void au_array_free(void *array) -{ - if (array) { - if (!is_vmalloc_addr(array)) - kfree(array); - else - vfree(array); - } -} - -void *au_array_alloc(unsigned long long *hint, au_arraycb_t cb, void *arg) -{ - void *array; - unsigned long long n, sz; - - array = NULL; - n = 0; - if (!*hint) - goto out; - - if (*hint > ULLONG_MAX / sizeof(array)) { - array = ERR_PTR(-EMFILE); - pr_err("hint %llu\n", *hint); - goto out; - } - - sz = sizeof(array) * *hint; - array = kzalloc(sz, GFP_NOFS); - if (unlikely(!array)) - array = vzalloc(sz); - if (unlikely(!array)) { - array = ERR_PTR(-ENOMEM); - goto out; - } - - n = cb(array, *hint, arg); - AuDebugOn(n > *hint); - -out: - *hint = n; - return array; -} - -static unsigned long long au_iarray_cb(void *a, - unsigned long long max __maybe_unused, - void *arg) -{ - unsigned long long n; - struct inode **p, *inode; - struct list_head *head; - - n = 0; - p = a; - head = arg; - spin_lock(&inode_sb_list_lock); - list_for_each_entry(inode, head, i_sb_list) { - if (!is_bad_inode(inode) - && au_ii(inode)->ii_bstart >= 0) { - spin_lock(&inode->i_lock); - if (atomic_read(&inode->i_count)) { - au_igrab(inode); - *p++ = inode; - n++; - AuDebugOn(n > max); - } - spin_unlock(&inode->i_lock); - } - } - spin_unlock(&inode_sb_list_lock); - - return n; -} - -struct inode **au_iarray_alloc(struct super_block *sb, unsigned long long *max) -{ - *max = atomic_long_read(&au_sbi(sb)->si_ninodes); - return au_array_alloc(max, au_iarray_cb, &sb->s_inodes); -} - -void au_iarray_free(struct inode **a, unsigned long long max) -{ - unsigned long long ull; - - for (ull = 0; ull < max; ull++) - iput(a[ull]); - au_array_free(a); -} - -/* ---------------------------------------------------------------------- */ - -/* - * refresh dentry and inode at remount time. - */ -/* todo: consolidate with simple_reval_dpath() and au_reval_for_attr() */ -static int au_do_refresh(struct dentry *dentry, unsigned int dir_flags, - struct dentry *parent) -{ - int err; - - di_write_lock_child(dentry); - di_read_lock_parent(parent, AuLock_IR); - err = au_refresh_dentry(dentry, parent); - if (!err && dir_flags) - au_hn_reset(dentry->d_inode, dir_flags); - di_read_unlock(parent, AuLock_IR); - di_write_unlock(dentry); - - return err; -} - -static int au_do_refresh_d(struct dentry *dentry, unsigned int sigen, - struct au_sbinfo *sbinfo, - const unsigned int dir_flags) -{ - int err; - struct dentry *parent; - struct inode *inode; - - err = 0; - parent = dget_parent(dentry); - if (!au_digen_test(parent, sigen) && au_digen_test(dentry, sigen)) { - inode = dentry->d_inode; - if (inode) { - if (!S_ISDIR(inode->i_mode)) - err = au_do_refresh(dentry, /*dir_flags*/0, - parent); - else { - err = au_do_refresh(dentry, dir_flags, parent); - if (unlikely(err)) - au_fset_si(sbinfo, FAILED_REFRESH_DIR); - } - } else - err = au_do_refresh(dentry, /*dir_flags*/0, parent); - AuDbgDentry(dentry); - } - dput(parent); - - AuTraceErr(err); - return err; -} - -static int au_refresh_d(struct super_block *sb) -{ - int err, i, j, ndentry, e; - unsigned int sigen; - struct au_dcsub_pages dpages; - struct au_dpage *dpage; - struct dentry **dentries, *d; - struct au_sbinfo *sbinfo; - struct dentry *root = sb->s_root; - const unsigned int dir_flags = au_hi_flags(root->d_inode, /*isdir*/1); - - err = au_dpages_init(&dpages, GFP_NOFS); - if (unlikely(err)) - goto out; - err = au_dcsub_pages(&dpages, root, NULL, NULL); - if (unlikely(err)) - goto out_dpages; - - sigen = au_sigen(sb); - sbinfo = au_sbi(sb); - for (i = 0; i < dpages.ndpage; i++) { - dpage = dpages.dpages + i; - dentries = dpage->dentries; - ndentry = dpage->ndentry; - for (j = 0; j < ndentry; j++) { - d = dentries[j]; - e = au_do_refresh_d(d, sigen, sbinfo, dir_flags); - if (unlikely(e && !err)) - err = e; - /* go on even err */ - } - } - -out_dpages: - au_dpages_free(&dpages); -out: - return err; -} - -static int au_refresh_i(struct super_block *sb) -{ - int err, e; - unsigned int sigen; - unsigned long long max, ull; - struct inode *inode, **array; - - array = au_iarray_alloc(sb, &max); - err = PTR_ERR(array); - if (IS_ERR(array)) - goto out; - - err = 0; - sigen = au_sigen(sb); - for (ull = 0; ull < max; ull++) { - inode = array[ull]; - if (unlikely(!inode)) - break; - if (au_iigen(inode, NULL) != sigen) { - ii_write_lock_child(inode); - e = au_refresh_hinode_self(inode); - ii_write_unlock(inode); - if (unlikely(e)) { - pr_err("error %d, i%lu\n", e, inode->i_ino); - if (!err) - err = e; - /* go on even if err */ - } - } - } - - au_iarray_free(array, max); - -out: - return err; -} - -static void au_remount_refresh(struct super_block *sb) -{ - int err, e; - unsigned int udba; - aufs_bindex_t bindex, bend; - struct dentry *root; - struct inode *inode; - struct au_branch *br; - - au_sigen_inc(sb); - au_fclr_si(au_sbi(sb), FAILED_REFRESH_DIR); - - root = sb->s_root; - DiMustNoWaiters(root); - inode = root->d_inode; - IiMustNoWaiters(inode); - - udba = au_opt_udba(sb); - bend = au_sbend(sb); - for (bindex = 0; bindex <= bend; bindex++) { - br = au_sbr(sb, bindex); - err = au_hnotify_reset_br(udba, br, br->br_perm); - if (unlikely(err)) - AuIOErr("hnotify failed on br %d, %d, ignored\n", - bindex, err); - /* go on even if err */ - } - au_hn_reset(inode, au_hi_flags(inode, /*isdir*/1)); - - di_write_unlock(root); - err = au_refresh_d(sb); - e = au_refresh_i(sb); - if (unlikely(e && !err)) - err = e; - /* aufs_write_lock() calls ..._child() */ - di_write_lock_child(root); - - au_cpup_attr_all(inode, /*force*/1); - - if (unlikely(err)) - AuIOErr("refresh failed, ignored, %d\n", err); -} - -/* stop extra interpretation of errno in mount(8), and strange error messages */ -static int cvt_err(int err) -{ - AuTraceErr(err); - - switch (err) { - case -ENOENT: - case -ENOTDIR: - case -EEXIST: - case -EIO: - err = -EINVAL; - } - return err; -} - -static int aufs_remount_fs(struct super_block *sb, int *flags, char *data) -{ - int err, do_dx; - unsigned int mntflags; - struct au_opts opts; - struct dentry *root; - struct inode *inode; - struct au_sbinfo *sbinfo; - - err = 0; - root = sb->s_root; - if (!data || !*data) { - err = si_write_lock(sb, AuLock_FLUSH | AuLock_NOPLM); - if (!err) { - di_write_lock_child(root); - err = au_opts_verify(sb, *flags, /*pending*/0); - aufs_write_unlock(root); - } - goto out; - } - - err = -ENOMEM; - memset(&opts, 0, sizeof(opts)); - opts.opt = (void *)__get_free_page(GFP_NOFS); - if (unlikely(!opts.opt)) - goto out; - opts.max_opt = PAGE_SIZE / sizeof(*opts.opt); - opts.flags = AuOpts_REMOUNT; - opts.sb_flags = *flags; - - /* parse it before aufs lock */ - err = au_opts_parse(sb, data, &opts); - if (unlikely(err)) - goto out_opts; - - sbinfo = au_sbi(sb); - inode = root->d_inode; - mutex_lock(&inode->i_mutex); - err = si_write_lock(sb, AuLock_FLUSH | AuLock_NOPLM); - if (unlikely(err)) - goto out_mtx; - di_write_lock_child(root); - - /* au_opts_remount() may return an error */ - err = au_opts_remount(sb, &opts); - au_opts_free(&opts); - - if (au_ftest_opts(opts.flags, REFRESH)) - au_remount_refresh(sb); - - if (au_ftest_opts(opts.flags, REFRESH_DYAOP)) { - mntflags = au_mntflags(sb); - do_dx = !!au_opt_test(mntflags, DIO); - au_dy_arefresh(do_dx); - } - - au_fhsm_wrote_all(sb, /*force*/1); /* ?? */ - aufs_write_unlock(root); - -out_mtx: - mutex_unlock(&inode->i_mutex); -out_opts: - free_page((unsigned long)opts.opt); -out: - err = cvt_err(err); - AuTraceErr(err); - return err; -} - -static const struct super_operations aufs_sop = { - .alloc_inode = aufs_alloc_inode, - .destroy_inode = aufs_destroy_inode, - /* always deleting, no clearing */ - .drop_inode = generic_delete_inode, - .show_options = aufs_show_options, - .statfs = aufs_statfs, - .put_super = aufs_put_super, - .sync_fs = aufs_sync_fs, - .remount_fs = aufs_remount_fs -}; - -/* ---------------------------------------------------------------------- */ - -static int alloc_root(struct super_block *sb) -{ - int err; - struct inode *inode; - struct dentry *root; - - err = -ENOMEM; - inode = au_iget_locked(sb, AUFS_ROOT_INO); - err = PTR_ERR(inode); - if (IS_ERR(inode)) - goto out; - - inode->i_op = &aufs_dir_iop; - inode->i_fop = &aufs_dir_fop; - inode->i_mode = S_IFDIR; - set_nlink(inode, 2); - unlock_new_inode(inode); - - root = d_make_root(inode); - if (unlikely(!root)) - goto out; - err = PTR_ERR(root); - if (IS_ERR(root)) - goto out; - - err = au_di_init(root); - if (!err) { - sb->s_root = root; - return 0; /* success */ - } - dput(root); - -out: - return err; -} - -static int aufs_fill_super(struct super_block *sb, void *raw_data, - int silent __maybe_unused) -{ - int err; - struct au_opts opts; - struct dentry *root; - struct inode *inode; - char *arg = raw_data; - - if (unlikely(!arg || !*arg)) { - err = -EINVAL; - pr_err("no arg\n"); - goto out; - } - - err = -ENOMEM; - memset(&opts, 0, sizeof(opts)); - opts.opt = (void *)__get_free_page(GFP_NOFS); - if (unlikely(!opts.opt)) - goto out; - opts.max_opt = PAGE_SIZE / sizeof(*opts.opt); - opts.sb_flags = sb->s_flags; - - err = au_si_alloc(sb); - if (unlikely(err)) - goto out_opts; - - /* all timestamps always follow the ones on the branch */ - sb->s_flags |= MS_NOATIME | MS_NODIRATIME; - sb->s_op = &aufs_sop; - sb->s_d_op = &aufs_dop; - sb->s_magic = AUFS_SUPER_MAGIC; - sb->s_maxbytes = 0; - au_export_init(sb); - /* au_xattr_init(sb); */ - - err = alloc_root(sb); - if (unlikely(err)) { - si_write_unlock(sb); - goto out_info; - } - root = sb->s_root; - inode = root->d_inode; - - /* - * actually we can parse options regardless aufs lock here. - * but at remount time, parsing must be done before aufs lock. - * so we follow the same rule. - */ - ii_write_lock_parent(inode); - aufs_write_unlock(root); - err = au_opts_parse(sb, arg, &opts); - if (unlikely(err)) - goto out_root; - - /* lock vfs_inode first, then aufs. */ - mutex_lock(&inode->i_mutex); - aufs_write_lock(root); - err = au_opts_mount(sb, &opts); - au_opts_free(&opts); - aufs_write_unlock(root); - mutex_unlock(&inode->i_mutex); - if (!err) - goto out_opts; /* success */ - -out_root: - dput(root); - sb->s_root = NULL; -out_info: - dbgaufs_si_fin(au_sbi(sb)); - kobject_put(&au_sbi(sb)->si_kobj); - sb->s_fs_info = NULL; -out_opts: - free_page((unsigned long)opts.opt); -out: - AuTraceErr(err); - err = cvt_err(err); - AuTraceErr(err); - return err; -} - -/* ---------------------------------------------------------------------- */ - -static struct dentry *aufs_mount(struct file_system_type *fs_type, int flags, - const char *dev_name __maybe_unused, - void *raw_data) -{ - struct dentry *root; - struct super_block *sb; - - /* all timestamps always follow the ones on the branch */ - /* mnt->mnt_flags |= MNT_NOATIME | MNT_NODIRATIME; */ - root = mount_nodev(fs_type, flags, raw_data, aufs_fill_super); - if (IS_ERR(root)) - goto out; - - sb = root->d_sb; - si_write_lock(sb, !AuLock_FLUSH); - sysaufs_brs_add(sb, 0); - si_write_unlock(sb); - au_sbilist_add(sb); - -out: - return root; -} - -static void aufs_kill_sb(struct super_block *sb) -{ - struct au_sbinfo *sbinfo; - - sbinfo = au_sbi(sb); - if (sbinfo) { - au_sbilist_del(sb); - aufs_write_lock(sb->s_root); - au_fhsm_fin(sb); - if (sbinfo->si_wbr_create_ops->fin) - sbinfo->si_wbr_create_ops->fin(sb); - if (au_opt_test(sbinfo->si_mntflags, UDBA_HNOTIFY)) { - au_opt_set_udba(sbinfo->si_mntflags, UDBA_NONE); - au_remount_refresh(sb); - } - if (au_opt_test(sbinfo->si_mntflags, PLINK)) - au_plink_put(sb, /*verbose*/1); - au_xino_clr(sb); - sbinfo->si_sb = NULL; - aufs_write_unlock(sb->s_root); - au_nwt_flush(&sbinfo->si_nowait); - } - kill_anon_super(sb); -} - -struct file_system_type aufs_fs_type = { - .name = AUFS_FSTYPE, - /* a race between rename and others */ - .fs_flags = FS_RENAME_DOES_D_MOVE, - .mount = aufs_mount, - .kill_sb = aufs_kill_sb, - /* no need to __module_get() and module_put(). */ - .owner = THIS_MODULE, -}; diff --git a/fs/aufs/super.h b/fs/aufs/super.h deleted file mode 100644 index 15010149157d4d..00000000000000 --- a/fs/aufs/super.h +++ /dev/null @@ -1,637 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * super_block operations - */ - -#ifndef __AUFS_SUPER_H__ -#define __AUFS_SUPER_H__ - -#ifdef __KERNEL__ - -#include -#include "rwsem.h" -#include "spl.h" -#include "wkq.h" - -typedef ssize_t (*au_readf_t)(struct file *, char __user *, size_t, loff_t *); -typedef ssize_t (*au_writef_t)(struct file *, const char __user *, size_t, - loff_t *); - -/* policies to select one among multiple writable branches */ -struct au_wbr_copyup_operations { - int (*copyup)(struct dentry *dentry); -}; - -#define AuWbr_DIR 1 /* target is a dir */ -#define AuWbr_PARENT (1 << 1) /* always require a parent */ - -#define au_ftest_wbr(flags, name) ((flags) & AuWbr_##name) -#define au_fset_wbr(flags, name) { (flags) |= AuWbr_##name; } -#define au_fclr_wbr(flags, name) { (flags) &= ~AuWbr_##name; } - -struct au_wbr_create_operations { - int (*create)(struct dentry *dentry, unsigned int flags); - int (*init)(struct super_block *sb); - int (*fin)(struct super_block *sb); -}; - -struct au_wbr_mfs { - struct mutex mfs_lock; /* protect this structure */ - unsigned long mfs_jiffy; - unsigned long mfs_expire; - aufs_bindex_t mfs_bindex; - - unsigned long long mfsrr_bytes; - unsigned long long mfsrr_watermark; -}; - -struct pseudo_link { - union { - struct hlist_node hlist; - struct rcu_head rcu; - }; - struct inode *inode; -}; - -#define AuPlink_NHASH 100 -static inline int au_plink_hash(ino_t ino) -{ - return ino % AuPlink_NHASH; -} - -/* File-based Hierarchical Storage Management */ -struct au_fhsm { -#ifdef CONFIG_AUFS_FHSM - /* allow only one process who can receive the notification */ - spinlock_t fhsm_spin; - pid_t fhsm_pid; - wait_queue_head_t fhsm_wqh; - atomic_t fhsm_readable; - - /* these are protected by si_rwsem */ - unsigned long fhsm_expire; - aufs_bindex_t fhsm_bottom; -#endif -}; - -struct au_branch; -struct au_sbinfo { - /* nowait tasks in the system-wide workqueue */ - struct au_nowait_tasks si_nowait; - - /* - * tried sb->s_umount, but failed due to the dependecy between i_mutex. - * rwsem for au_sbinfo is necessary. - */ - struct au_rwsem si_rwsem; - - /* prevent recursive locking in deleting inode */ - struct { - unsigned long *bitmap; - spinlock_t tree_lock; - struct radix_tree_root tree; - } au_si_pid; - - /* - * dirty approach to protect sb->sb_inodes and ->s_files from remount. - */ - atomic_long_t si_ninodes, si_nfiles; - - /* branch management */ - unsigned int si_generation; - - /* see above flags */ - unsigned char au_si_status; - - aufs_bindex_t si_bend; - - /* dirty trick to keep br_id plus */ - unsigned int si_last_br_id : - sizeof(aufs_bindex_t) * BITS_PER_BYTE - 1; - struct au_branch **si_branch; - - /* policy to select a writable branch */ - unsigned char si_wbr_copyup; - unsigned char si_wbr_create; - struct au_wbr_copyup_operations *si_wbr_copyup_ops; - struct au_wbr_create_operations *si_wbr_create_ops; - - /* round robin */ - atomic_t si_wbr_rr_next; - - /* most free space */ - struct au_wbr_mfs si_wbr_mfs; - - /* File-based Hierarchical Storage Management */ - struct au_fhsm si_fhsm; - - /* mount flags */ - /* include/asm-ia64/siginfo.h defines a macro named si_flags */ - unsigned int si_mntflags; - - /* external inode number (bitmap and translation table) */ - au_readf_t si_xread; - au_writef_t si_xwrite; - struct file *si_xib; - struct mutex si_xib_mtx; /* protect xib members */ - unsigned long *si_xib_buf; - unsigned long si_xib_last_pindex; - int si_xib_next_bit; - aufs_bindex_t si_xino_brid; - unsigned long si_xino_jiffy; - unsigned long si_xino_expire; - /* reserved for future use */ - /* unsigned long long si_xib_limit; */ /* Max xib file size */ - -#ifdef CONFIG_AUFS_EXPORT - /* i_generation */ - struct file *si_xigen; - atomic_t si_xigen_next; -#endif - - /* vdir parameters */ - unsigned long si_rdcache; /* max cache time in jiffies */ - unsigned int si_rdblk; /* deblk size */ - unsigned int si_rdhash; /* hash size */ - - /* - * If the number of whiteouts are larger than si_dirwh, leave all of - * them after au_whtmp_ren to reduce the cost of rmdir(2). - * future fsck.aufs or kernel thread will remove them later. - * Otherwise, remove all whiteouts and the dir in rmdir(2). - */ - unsigned int si_dirwh; - - /* - * rename(2) a directory with all children. - */ - /* reserved for future use */ - /* int si_rendir; */ - - /* pseudo_link list */ - struct au_sphlhead si_plink[AuPlink_NHASH]; - wait_queue_head_t si_plink_wq; - spinlock_t si_plink_maint_lock; - pid_t si_plink_maint_pid; - - /* - * sysfs and lifetime management. - * this is not a small structure and it may be a waste of memory in case - * of sysfs is disabled, particulary when many aufs-es are mounted. - * but using sysfs is majority. - */ - struct kobject si_kobj; -#ifdef CONFIG_DEBUG_FS - struct dentry *si_dbgaufs; - struct dentry *si_dbgaufs_plink; - struct dentry *si_dbgaufs_xib; -#ifdef CONFIG_AUFS_EXPORT - struct dentry *si_dbgaufs_xigen; -#endif -#endif - -#ifdef CONFIG_AUFS_SBILIST - struct list_head si_list; -#endif - - /* dirty, necessary for unmounting, sysfs and sysrq */ - struct super_block *si_sb; -}; - -/* sbinfo status flags */ -/* - * set true when refresh_dirs() failed at remount time. - * then try refreshing dirs at access time again. - * if it is false, refreshing dirs at access time is unnecesary - */ -#define AuSi_FAILED_REFRESH_DIR 1 - -#define AuSi_FHSM (1 << 1) /* fhsm is active now */ - -#ifndef CONFIG_AUFS_FHSM -#undef AuSi_FHSM -#define AuSi_FHSM 0 -#endif - -static inline unsigned char au_do_ftest_si(struct au_sbinfo *sbi, - unsigned int flag) -{ - AuRwMustAnyLock(&sbi->si_rwsem); - return sbi->au_si_status & flag; -} -#define au_ftest_si(sbinfo, name) au_do_ftest_si(sbinfo, AuSi_##name) -#define au_fset_si(sbinfo, name) do { \ - AuRwMustWriteLock(&(sbinfo)->si_rwsem); \ - (sbinfo)->au_si_status |= AuSi_##name; \ -} while (0) -#define au_fclr_si(sbinfo, name) do { \ - AuRwMustWriteLock(&(sbinfo)->si_rwsem); \ - (sbinfo)->au_si_status &= ~AuSi_##name; \ -} while (0) - -/* ---------------------------------------------------------------------- */ - -/* policy to select one among writable branches */ -#define AuWbrCopyup(sbinfo, ...) \ - ((sbinfo)->si_wbr_copyup_ops->copyup(__VA_ARGS__)) -#define AuWbrCreate(sbinfo, ...) \ - ((sbinfo)->si_wbr_create_ops->create(__VA_ARGS__)) - -/* flags for si_read_lock()/aufs_read_lock()/di_read_lock() */ -#define AuLock_DW 1 /* write-lock dentry */ -#define AuLock_IR (1 << 1) /* read-lock inode */ -#define AuLock_IW (1 << 2) /* write-lock inode */ -#define AuLock_FLUSH (1 << 3) /* wait for 'nowait' tasks */ -#define AuLock_DIR (1 << 4) /* target is a dir */ -#define AuLock_NOPLM (1 << 5) /* return err in plm mode */ -#define AuLock_NOPLMW (1 << 6) /* wait for plm mode ends */ -#define AuLock_GEN (1 << 7) /* test digen/iigen */ -#define au_ftest_lock(flags, name) ((flags) & AuLock_##name) -#define au_fset_lock(flags, name) \ - do { (flags) |= AuLock_##name; } while (0) -#define au_fclr_lock(flags, name) \ - do { (flags) &= ~AuLock_##name; } while (0) - -/* ---------------------------------------------------------------------- */ - -/* super.c */ -extern struct file_system_type aufs_fs_type; -struct inode *au_iget_locked(struct super_block *sb, ino_t ino); -typedef unsigned long long (*au_arraycb_t)(void *array, unsigned long long max, - void *arg); -void au_array_free(void *array); -void *au_array_alloc(unsigned long long *hint, au_arraycb_t cb, void *arg); -struct inode **au_iarray_alloc(struct super_block *sb, unsigned long long *max); -void au_iarray_free(struct inode **a, unsigned long long max); - -/* sbinfo.c */ -void au_si_free(struct kobject *kobj); -int au_si_alloc(struct super_block *sb); -int au_sbr_realloc(struct au_sbinfo *sbinfo, int nbr); - -unsigned int au_sigen_inc(struct super_block *sb); -aufs_bindex_t au_new_br_id(struct super_block *sb); - -int si_read_lock(struct super_block *sb, int flags); -int si_write_lock(struct super_block *sb, int flags); -int aufs_read_lock(struct dentry *dentry, int flags); -void aufs_read_unlock(struct dentry *dentry, int flags); -void aufs_write_lock(struct dentry *dentry); -void aufs_write_unlock(struct dentry *dentry); -int aufs_read_and_write_lock2(struct dentry *d1, struct dentry *d2, int flags); -void aufs_read_and_write_unlock2(struct dentry *d1, struct dentry *d2); - -int si_pid_test_slow(struct super_block *sb); -void si_pid_set_slow(struct super_block *sb); -void si_pid_clr_slow(struct super_block *sb); - -/* wbr_policy.c */ -extern struct au_wbr_copyup_operations au_wbr_copyup_ops[]; -extern struct au_wbr_create_operations au_wbr_create_ops[]; -int au_cpdown_dirs(struct dentry *dentry, aufs_bindex_t bdst); -int au_wbr_nonopq(struct dentry *dentry, aufs_bindex_t bindex); -int au_wbr_do_copyup_bu(struct dentry *dentry, aufs_bindex_t bstart); - -/* mvdown.c */ -int au_mvdown(struct dentry *dentry, struct aufs_mvdown __user *arg); - -#ifdef CONFIG_AUFS_FHSM -/* fhsm.c */ - -static inline pid_t au_fhsm_pid(struct au_fhsm *fhsm) -{ - pid_t pid; - - spin_lock(&fhsm->fhsm_spin); - pid = fhsm->fhsm_pid; - spin_unlock(&fhsm->fhsm_spin); - - return pid; -} - -void au_fhsm_wrote(struct super_block *sb, aufs_bindex_t bindex, int force); -void au_fhsm_wrote_all(struct super_block *sb, int force); -int au_fhsm_fd(struct super_block *sb, int oflags); -int au_fhsm_br_alloc(struct au_branch *br); -void au_fhsm_set_bottom(struct super_block *sb, aufs_bindex_t bindex); -void au_fhsm_fin(struct super_block *sb); -void au_fhsm_init(struct au_sbinfo *sbinfo); -void au_fhsm_set(struct au_sbinfo *sbinfo, unsigned int sec); -void au_fhsm_show(struct seq_file *seq, struct au_sbinfo *sbinfo); -#else -AuStubVoid(au_fhsm_wrote, struct super_block *sb, aufs_bindex_t bindex, - int force) -AuStubVoid(au_fhsm_wrote_all, struct super_block *sb, int force) -AuStub(int, au_fhsm_fd, return -EOPNOTSUPP, struct super_block *sb, int oflags) -AuStub(pid_t, au_fhsm_pid, return 0, struct au_fhsm *fhsm) -AuStubInt0(au_fhsm_br_alloc, struct au_branch *br) -AuStubVoid(au_fhsm_set_bottom, struct super_block *sb, aufs_bindex_t bindex) -AuStubVoid(au_fhsm_fin, struct super_block *sb) -AuStubVoid(au_fhsm_init, struct au_sbinfo *sbinfo) -AuStubVoid(au_fhsm_set, struct au_sbinfo *sbinfo, unsigned int sec) -AuStubVoid(au_fhsm_show, struct seq_file *seq, struct au_sbinfo *sbinfo) -#endif - -/* ---------------------------------------------------------------------- */ - -static inline struct au_sbinfo *au_sbi(struct super_block *sb) -{ - return sb->s_fs_info; -} - -/* ---------------------------------------------------------------------- */ - -#ifdef CONFIG_AUFS_EXPORT -int au_test_nfsd(void); -void au_export_init(struct super_block *sb); -void au_xigen_inc(struct inode *inode); -int au_xigen_new(struct inode *inode); -int au_xigen_set(struct super_block *sb, struct file *base); -void au_xigen_clr(struct super_block *sb); - -static inline int au_busy_or_stale(void) -{ - if (!au_test_nfsd()) - return -EBUSY; - return -ESTALE; -} -#else -AuStubInt0(au_test_nfsd, void) -AuStubVoid(au_export_init, struct super_block *sb) -AuStubVoid(au_xigen_inc, struct inode *inode) -AuStubInt0(au_xigen_new, struct inode *inode) -AuStubInt0(au_xigen_set, struct super_block *sb, struct file *base) -AuStubVoid(au_xigen_clr, struct super_block *sb) -AuStub(int, au_busy_or_stale, return -EBUSY, void) -#endif /* CONFIG_AUFS_EXPORT */ - -/* ---------------------------------------------------------------------- */ - -#ifdef CONFIG_AUFS_SBILIST -/* module.c */ -extern struct au_splhead au_sbilist; - -static inline void au_sbilist_init(void) -{ - au_spl_init(&au_sbilist); -} - -static inline void au_sbilist_add(struct super_block *sb) -{ - au_spl_add(&au_sbi(sb)->si_list, &au_sbilist); -} - -static inline void au_sbilist_del(struct super_block *sb) -{ - au_spl_del(&au_sbi(sb)->si_list, &au_sbilist); -} - -#ifdef CONFIG_AUFS_MAGIC_SYSRQ -static inline void au_sbilist_lock(void) -{ - spin_lock(&au_sbilist.spin); -} - -static inline void au_sbilist_unlock(void) -{ - spin_unlock(&au_sbilist.spin); -} -#define AuGFP_SBILIST GFP_ATOMIC -#else -AuStubVoid(au_sbilist_lock, void) -AuStubVoid(au_sbilist_unlock, void) -#define AuGFP_SBILIST GFP_NOFS -#endif /* CONFIG_AUFS_MAGIC_SYSRQ */ -#else -AuStubVoid(au_sbilist_init, void) -AuStubVoid(au_sbilist_add, struct super_block *sb) -AuStubVoid(au_sbilist_del, struct super_block *sb) -AuStubVoid(au_sbilist_lock, void) -AuStubVoid(au_sbilist_unlock, void) -#define AuGFP_SBILIST GFP_NOFS -#endif - -/* ---------------------------------------------------------------------- */ - -static inline void dbgaufs_si_null(struct au_sbinfo *sbinfo) -{ - /* - * This function is a dynamic '__init' function actually, - * so the tiny check for si_rwsem is unnecessary. - */ - /* AuRwMustWriteLock(&sbinfo->si_rwsem); */ -#ifdef CONFIG_DEBUG_FS - sbinfo->si_dbgaufs = NULL; - sbinfo->si_dbgaufs_plink = NULL; - sbinfo->si_dbgaufs_xib = NULL; -#ifdef CONFIG_AUFS_EXPORT - sbinfo->si_dbgaufs_xigen = NULL; -#endif -#endif -} - -/* ---------------------------------------------------------------------- */ - -static inline pid_t si_pid_bit(void) -{ - /* the origin of pid is 1, but the bitmap's is 0 */ - return current->pid - 1; -} - -static inline int si_pid_test(struct super_block *sb) -{ - pid_t bit; - - bit = si_pid_bit(); - if (bit < PID_MAX_DEFAULT) - return test_bit(bit, au_sbi(sb)->au_si_pid.bitmap); - return si_pid_test_slow(sb); -} - -static inline void si_pid_set(struct super_block *sb) -{ - pid_t bit; - - bit = si_pid_bit(); - if (bit < PID_MAX_DEFAULT) { - AuDebugOn(test_bit(bit, au_sbi(sb)->au_si_pid.bitmap)); - set_bit(bit, au_sbi(sb)->au_si_pid.bitmap); - /* smp_mb(); */ - } else - si_pid_set_slow(sb); -} - -static inline void si_pid_clr(struct super_block *sb) -{ - pid_t bit; - - bit = si_pid_bit(); - if (bit < PID_MAX_DEFAULT) { - AuDebugOn(!test_bit(bit, au_sbi(sb)->au_si_pid.bitmap)); - clear_bit(bit, au_sbi(sb)->au_si_pid.bitmap); - /* smp_mb(); */ - } else - si_pid_clr_slow(sb); -} - -/* ---------------------------------------------------------------------- */ - -/* lock superblock. mainly for entry point functions */ -/* - * __si_read_lock, __si_write_lock, - * __si_read_unlock, __si_write_unlock, __si_downgrade_lock - */ -AuSimpleRwsemFuncs(__si, struct super_block *sb, &au_sbi(sb)->si_rwsem); - -#define SiMustNoWaiters(sb) AuRwMustNoWaiters(&au_sbi(sb)->si_rwsem) -#define SiMustAnyLock(sb) AuRwMustAnyLock(&au_sbi(sb)->si_rwsem) -#define SiMustWriteLock(sb) AuRwMustWriteLock(&au_sbi(sb)->si_rwsem) - -static inline void si_noflush_read_lock(struct super_block *sb) -{ - __si_read_lock(sb); - si_pid_set(sb); -} - -static inline int si_noflush_read_trylock(struct super_block *sb) -{ - int locked; - - locked = __si_read_trylock(sb); - if (locked) - si_pid_set(sb); - return locked; -} - -static inline void si_noflush_write_lock(struct super_block *sb) -{ - __si_write_lock(sb); - si_pid_set(sb); -} - -static inline int si_noflush_write_trylock(struct super_block *sb) -{ - int locked; - - locked = __si_write_trylock(sb); - if (locked) - si_pid_set(sb); - return locked; -} - -#if 0 /* unused */ -static inline int si_read_trylock(struct super_block *sb, int flags) -{ - if (au_ftest_lock(flags, FLUSH)) - au_nwt_flush(&au_sbi(sb)->si_nowait); - return si_noflush_read_trylock(sb); -} -#endif - -static inline void si_read_unlock(struct super_block *sb) -{ - si_pid_clr(sb); - __si_read_unlock(sb); -} - -#if 0 /* unused */ -static inline int si_write_trylock(struct super_block *sb, int flags) -{ - if (au_ftest_lock(flags, FLUSH)) - au_nwt_flush(&au_sbi(sb)->si_nowait); - return si_noflush_write_trylock(sb); -} -#endif - -static inline void si_write_unlock(struct super_block *sb) -{ - si_pid_clr(sb); - __si_write_unlock(sb); -} - -#if 0 /* unused */ -static inline void si_downgrade_lock(struct super_block *sb) -{ - __si_downgrade_lock(sb); -} -#endif - -/* ---------------------------------------------------------------------- */ - -static inline aufs_bindex_t au_sbend(struct super_block *sb) -{ - SiMustAnyLock(sb); - return au_sbi(sb)->si_bend; -} - -static inline unsigned int au_mntflags(struct super_block *sb) -{ - SiMustAnyLock(sb); - return au_sbi(sb)->si_mntflags; -} - -static inline unsigned int au_sigen(struct super_block *sb) -{ - SiMustAnyLock(sb); - return au_sbi(sb)->si_generation; -} - -static inline void au_ninodes_inc(struct super_block *sb) -{ - atomic_long_inc(&au_sbi(sb)->si_ninodes); -} - -static inline void au_ninodes_dec(struct super_block *sb) -{ - AuDebugOn(!atomic_long_read(&au_sbi(sb)->si_ninodes)); - atomic_long_dec(&au_sbi(sb)->si_ninodes); -} - -static inline void au_nfiles_inc(struct super_block *sb) -{ - atomic_long_inc(&au_sbi(sb)->si_nfiles); -} - -static inline void au_nfiles_dec(struct super_block *sb) -{ - AuDebugOn(!atomic_long_read(&au_sbi(sb)->si_nfiles)); - atomic_long_dec(&au_sbi(sb)->si_nfiles); -} - -static inline struct au_branch *au_sbr(struct super_block *sb, - aufs_bindex_t bindex) -{ - SiMustAnyLock(sb); - return au_sbi(sb)->si_branch[0 + bindex]; -} - -static inline void au_xino_brid_set(struct super_block *sb, aufs_bindex_t brid) -{ - SiMustWriteLock(sb); - au_sbi(sb)->si_xino_brid = brid; -} - -static inline aufs_bindex_t au_xino_brid(struct super_block *sb) -{ - SiMustAnyLock(sb); - return au_sbi(sb)->si_xino_brid; -} - -#endif /* __KERNEL__ */ -#endif /* __AUFS_SUPER_H__ */ diff --git a/fs/aufs/sysaufs.c b/fs/aufs/sysaufs.c deleted file mode 100644 index 0483dd00172fde..00000000000000 --- a/fs/aufs/sysaufs.c +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * sysfs interface and lifetime management - * they are necessary regardless sysfs is disabled. - */ - -#include -#include "aufs.h" - -unsigned long sysaufs_si_mask; -struct kset *sysaufs_kset; - -#define AuSiAttr(_name) { \ - .attr = { .name = __stringify(_name), .mode = 0444 }, \ - .show = sysaufs_si_##_name, \ -} - -static struct sysaufs_si_attr sysaufs_si_attr_xi_path = AuSiAttr(xi_path); -struct attribute *sysaufs_si_attrs[] = { - &sysaufs_si_attr_xi_path.attr, - NULL, -}; - -static const struct sysfs_ops au_sbi_ops = { - .show = sysaufs_si_show -}; - -static struct kobj_type au_sbi_ktype = { - .release = au_si_free, - .sysfs_ops = &au_sbi_ops, - .default_attrs = sysaufs_si_attrs -}; - -/* ---------------------------------------------------------------------- */ - -int sysaufs_si_init(struct au_sbinfo *sbinfo) -{ - int err; - - sbinfo->si_kobj.kset = sysaufs_kset; - /* cf. sysaufs_name() */ - err = kobject_init_and_add - (&sbinfo->si_kobj, &au_sbi_ktype, /*&sysaufs_kset->kobj*/NULL, - SysaufsSiNamePrefix "%lx", sysaufs_si_id(sbinfo)); - - dbgaufs_si_null(sbinfo); - if (!err) { - err = dbgaufs_si_init(sbinfo); - if (unlikely(err)) - kobject_put(&sbinfo->si_kobj); - } - return err; -} - -void sysaufs_fin(void) -{ - dbgaufs_fin(); - sysfs_remove_group(&sysaufs_kset->kobj, sysaufs_attr_group); - kset_unregister(sysaufs_kset); -} - -int __init sysaufs_init(void) -{ - int err; - - do { - get_random_bytes(&sysaufs_si_mask, sizeof(sysaufs_si_mask)); - } while (!sysaufs_si_mask); - - err = -EINVAL; - sysaufs_kset = kset_create_and_add(AUFS_NAME, NULL, fs_kobj); - if (unlikely(!sysaufs_kset)) - goto out; - err = PTR_ERR(sysaufs_kset); - if (IS_ERR(sysaufs_kset)) - goto out; - err = sysfs_create_group(&sysaufs_kset->kobj, sysaufs_attr_group); - if (unlikely(err)) { - kset_unregister(sysaufs_kset); - goto out; - } - - err = dbgaufs_init(); - if (unlikely(err)) - sysaufs_fin(); -out: - return err; -} diff --git a/fs/aufs/sysaufs.h b/fs/aufs/sysaufs.h deleted file mode 100644 index b7461013687421..00000000000000 --- a/fs/aufs/sysaufs.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * sysfs interface and mount lifetime management - */ - -#ifndef __SYSAUFS_H__ -#define __SYSAUFS_H__ - -#ifdef __KERNEL__ - -#include -#include "module.h" - -struct super_block; -struct au_sbinfo; - -struct sysaufs_si_attr { - struct attribute attr; - int (*show)(struct seq_file *seq, struct super_block *sb); -}; - -/* ---------------------------------------------------------------------- */ - -/* sysaufs.c */ -extern unsigned long sysaufs_si_mask; -extern struct kset *sysaufs_kset; -extern struct attribute *sysaufs_si_attrs[]; -int sysaufs_si_init(struct au_sbinfo *sbinfo); -int __init sysaufs_init(void); -void sysaufs_fin(void); - -/* ---------------------------------------------------------------------- */ - -/* some people doesn't like to show a pointer in kernel */ -static inline unsigned long sysaufs_si_id(struct au_sbinfo *sbinfo) -{ - return sysaufs_si_mask ^ (unsigned long)sbinfo; -} - -#define SysaufsSiNamePrefix "si_" -#define SysaufsSiNameLen (sizeof(SysaufsSiNamePrefix) + 16) -static inline void sysaufs_name(struct au_sbinfo *sbinfo, char *name) -{ - snprintf(name, SysaufsSiNameLen, SysaufsSiNamePrefix "%lx", - sysaufs_si_id(sbinfo)); -} - -struct au_branch; -#ifdef CONFIG_SYSFS -/* sysfs.c */ -extern struct attribute_group *sysaufs_attr_group; - -int sysaufs_si_xi_path(struct seq_file *seq, struct super_block *sb); -ssize_t sysaufs_si_show(struct kobject *kobj, struct attribute *attr, - char *buf); -long au_brinfo_ioctl(struct file *file, unsigned long arg); -#ifdef CONFIG_COMPAT -long au_brinfo_compat_ioctl(struct file *file, unsigned long arg); -#endif - -void sysaufs_br_init(struct au_branch *br); -void sysaufs_brs_add(struct super_block *sb, aufs_bindex_t bindex); -void sysaufs_brs_del(struct super_block *sb, aufs_bindex_t bindex); - -#define sysaufs_brs_init() do {} while (0) - -#else -#define sysaufs_attr_group NULL - -AuStubInt0(sysaufs_si_xi_path, struct seq_file *seq, struct super_block *sb) -AuStub(ssize_t, sysaufs_si_show, return 0, struct kobject *kobj, - struct attribute *attr, char *buf) -AuStubVoid(sysaufs_br_init, struct au_branch *br) -AuStubVoid(sysaufs_brs_add, struct super_block *sb, aufs_bindex_t bindex) -AuStubVoid(sysaufs_brs_del, struct super_block *sb, aufs_bindex_t bindex) - -static inline void sysaufs_brs_init(void) -{ - sysaufs_brs = 0; -} - -#endif /* CONFIG_SYSFS */ - -#endif /* __KERNEL__ */ -#endif /* __SYSAUFS_H__ */ diff --git a/fs/aufs/sysfs.c b/fs/aufs/sysfs.c deleted file mode 100644 index 8e97f8fc645155..00000000000000 --- a/fs/aufs/sysfs.c +++ /dev/null @@ -1,372 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * sysfs interface - */ - -#include -#include -#include "aufs.h" - -#ifdef CONFIG_AUFS_FS_MODULE -/* this entry violates the "one line per file" policy of sysfs */ -static ssize_t config_show(struct kobject *kobj, struct kobj_attribute *attr, - char *buf) -{ - ssize_t err; - static char *conf = -/* this file is generated at compiling */ -#include "conf.str" - ; - - err = snprintf(buf, PAGE_SIZE, conf); - if (unlikely(err >= PAGE_SIZE)) - err = -EFBIG; - return err; -} - -static struct kobj_attribute au_config_attr = __ATTR_RO(config); -#endif - -static struct attribute *au_attr[] = { -#ifdef CONFIG_AUFS_FS_MODULE - &au_config_attr.attr, -#endif - NULL, /* need to NULL terminate the list of attributes */ -}; - -static struct attribute_group sysaufs_attr_group_body = { - .attrs = au_attr -}; - -struct attribute_group *sysaufs_attr_group = &sysaufs_attr_group_body; - -/* ---------------------------------------------------------------------- */ - -int sysaufs_si_xi_path(struct seq_file *seq, struct super_block *sb) -{ - int err; - - SiMustAnyLock(sb); - - err = 0; - if (au_opt_test(au_mntflags(sb), XINO)) { - err = au_xino_path(seq, au_sbi(sb)->si_xib); - seq_putc(seq, '\n'); - } - return err; -} - -/* - * the lifetime of branch is independent from the entry under sysfs. - * sysfs handles the lifetime of the entry, and never call ->show() after it is - * unlinked. - */ -static int sysaufs_si_br(struct seq_file *seq, struct super_block *sb, - aufs_bindex_t bindex, int idx) -{ - int err; - struct path path; - struct dentry *root; - struct au_branch *br; - au_br_perm_str_t perm; - - AuDbg("b%d\n", bindex); - - err = 0; - root = sb->s_root; - di_read_lock_parent(root, !AuLock_IR); - br = au_sbr(sb, bindex); - - switch (idx) { - case AuBrSysfs_BR: - path.mnt = au_br_mnt(br); - path.dentry = au_h_dptr(root, bindex); - au_seq_path(seq, &path); - au_optstr_br_perm(&perm, br->br_perm); - err = seq_printf(seq, "=%s\n", perm.a); - break; - case AuBrSysfs_BRID: - err = seq_printf(seq, "%d\n", br->br_id); - break; - } - di_read_unlock(root, !AuLock_IR); - if (err == -1) - err = -E2BIG; - - return err; -} - -/* ---------------------------------------------------------------------- */ - -static struct seq_file *au_seq(char *p, ssize_t len) -{ - struct seq_file *seq; - - seq = kzalloc(sizeof(*seq), GFP_NOFS); - if (seq) { - /* mutex_init(&seq.lock); */ - seq->buf = p; - seq->size = len; - return seq; /* success */ - } - - seq = ERR_PTR(-ENOMEM); - return seq; -} - -#define SysaufsBr_PREFIX "br" -#define SysaufsBrid_PREFIX "brid" - -/* todo: file size may exceed PAGE_SIZE */ -ssize_t sysaufs_si_show(struct kobject *kobj, struct attribute *attr, - char *buf) -{ - ssize_t err; - int idx; - long l; - aufs_bindex_t bend; - struct au_sbinfo *sbinfo; - struct super_block *sb; - struct seq_file *seq; - char *name; - struct attribute **cattr; - - sbinfo = container_of(kobj, struct au_sbinfo, si_kobj); - sb = sbinfo->si_sb; - - /* - * prevent a race condition between sysfs and aufs. - * for instance, sysfs_file_read() calls sysfs_get_active_two() which - * prohibits maintaining the sysfs entries. - * hew we acquire read lock after sysfs_get_active_two(). - * on the other hand, the remount process may maintain the sysfs/aufs - * entries after acquiring write lock. - * it can cause a deadlock. - * simply we gave up processing read here. - */ - err = -EBUSY; - if (unlikely(!si_noflush_read_trylock(sb))) - goto out; - - seq = au_seq(buf, PAGE_SIZE); - err = PTR_ERR(seq); - if (IS_ERR(seq)) - goto out_unlock; - - name = (void *)attr->name; - cattr = sysaufs_si_attrs; - while (*cattr) { - if (!strcmp(name, (*cattr)->name)) { - err = container_of(*cattr, struct sysaufs_si_attr, attr) - ->show(seq, sb); - goto out_seq; - } - cattr++; - } - - if (!strncmp(name, SysaufsBrid_PREFIX, - sizeof(SysaufsBrid_PREFIX) - 1)) { - idx = AuBrSysfs_BRID; - name += sizeof(SysaufsBrid_PREFIX) - 1; - } else if (!strncmp(name, SysaufsBr_PREFIX, - sizeof(SysaufsBr_PREFIX) - 1)) { - idx = AuBrSysfs_BR; - name += sizeof(SysaufsBr_PREFIX) - 1; - } else - BUG(); - - err = kstrtol(name, 10, &l); - if (!err) { - bend = au_sbend(sb); - if (l <= bend) - err = sysaufs_si_br(seq, sb, (aufs_bindex_t)l, idx); - else - err = -ENOENT; - } - -out_seq: - if (!err) { - err = seq->count; - /* sysfs limit */ - if (unlikely(err == PAGE_SIZE)) - err = -EFBIG; - } - kfree(seq); -out_unlock: - si_read_unlock(sb); -out: - return err; -} - -/* ---------------------------------------------------------------------- */ - -static int au_brinfo(struct super_block *sb, union aufs_brinfo __user *arg) -{ - int err; - int16_t brid; - aufs_bindex_t bindex, bend; - size_t sz; - char *buf; - struct seq_file *seq; - struct au_branch *br; - - si_read_lock(sb, AuLock_FLUSH); - bend = au_sbend(sb); - err = bend + 1; - if (!arg) - goto out; - - err = -ENOMEM; - buf = (void *)__get_free_page(GFP_NOFS); - if (unlikely(!buf)) - goto out; - - seq = au_seq(buf, PAGE_SIZE); - err = PTR_ERR(seq); - if (IS_ERR(seq)) - goto out_buf; - - sz = sizeof(*arg) - offsetof(union aufs_brinfo, path); - for (bindex = 0; bindex <= bend; bindex++, arg++) { - err = !access_ok(VERIFY_WRITE, arg, sizeof(*arg)); - if (unlikely(err)) - break; - - br = au_sbr(sb, bindex); - brid = br->br_id; - BUILD_BUG_ON(sizeof(brid) != sizeof(arg->id)); - err = __put_user(brid, &arg->id); - if (unlikely(err)) - break; - - BUILD_BUG_ON(sizeof(br->br_perm) != sizeof(arg->perm)); - err = __put_user(br->br_perm, &arg->perm); - if (unlikely(err)) - break; - - au_seq_path(seq, &br->br_path); - err = seq_putc(seq, '\0'); - if (!err && seq->count <= sz) { - err = copy_to_user(arg->path, seq->buf, seq->count); - seq->count = 0; - if (unlikely(err)) - break; - } else { - err = -E2BIG; - goto out_seq; - } - } - if (unlikely(err)) - err = -EFAULT; - -out_seq: - kfree(seq); -out_buf: - free_page((unsigned long)buf); -out: - si_read_unlock(sb); - return err; -} - -long au_brinfo_ioctl(struct file *file, unsigned long arg) -{ - return au_brinfo(file->f_dentry->d_sb, (void __user *)arg); -} - -#ifdef CONFIG_COMPAT -long au_brinfo_compat_ioctl(struct file *file, unsigned long arg) -{ - return au_brinfo(file->f_dentry->d_sb, compat_ptr(arg)); -} -#endif - -/* ---------------------------------------------------------------------- */ - -void sysaufs_br_init(struct au_branch *br) -{ - int i; - struct au_brsysfs *br_sysfs; - struct attribute *attr; - - br_sysfs = br->br_sysfs; - for (i = 0; i < ARRAY_SIZE(br->br_sysfs); i++) { - attr = &br_sysfs->attr; - sysfs_attr_init(attr); - attr->name = br_sysfs->name; - attr->mode = S_IRUGO; - br_sysfs++; - } -} - -void sysaufs_brs_del(struct super_block *sb, aufs_bindex_t bindex) -{ - struct au_branch *br; - struct kobject *kobj; - struct au_brsysfs *br_sysfs; - int i; - aufs_bindex_t bend; - - dbgaufs_brs_del(sb, bindex); - - if (!sysaufs_brs) - return; - - kobj = &au_sbi(sb)->si_kobj; - bend = au_sbend(sb); - for (; bindex <= bend; bindex++) { - br = au_sbr(sb, bindex); - br_sysfs = br->br_sysfs; - for (i = 0; i < ARRAY_SIZE(br->br_sysfs); i++) { - sysfs_remove_file(kobj, &br_sysfs->attr); - br_sysfs++; - } - } -} - -void sysaufs_brs_add(struct super_block *sb, aufs_bindex_t bindex) -{ - int err, i; - aufs_bindex_t bend; - struct kobject *kobj; - struct au_branch *br; - struct au_brsysfs *br_sysfs; - - dbgaufs_brs_add(sb, bindex); - - if (!sysaufs_brs) - return; - - kobj = &au_sbi(sb)->si_kobj; - bend = au_sbend(sb); - for (; bindex <= bend; bindex++) { - br = au_sbr(sb, bindex); - br_sysfs = br->br_sysfs; - snprintf(br_sysfs[AuBrSysfs_BR].name, sizeof(br_sysfs->name), - SysaufsBr_PREFIX "%d", bindex); - snprintf(br_sysfs[AuBrSysfs_BRID].name, sizeof(br_sysfs->name), - SysaufsBrid_PREFIX "%d", bindex); - for (i = 0; i < ARRAY_SIZE(br->br_sysfs); i++) { - err = sysfs_create_file(kobj, &br_sysfs->attr); - if (unlikely(err)) - pr_warn("failed %s under sysfs(%d)\n", - br_sysfs->name, err); - br_sysfs++; - } - } -} diff --git a/fs/aufs/sysrq.c b/fs/aufs/sysrq.c deleted file mode 100644 index a8127c252a0623..00000000000000 --- a/fs/aufs/sysrq.c +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * magic sysrq hanlder - */ - -/* #include */ -#include -#include "aufs.h" - -/* ---------------------------------------------------------------------- */ - -static void sysrq_sb(struct super_block *sb) -{ - char *plevel; - struct au_sbinfo *sbinfo; - struct file *file; - - plevel = au_plevel; - au_plevel = KERN_WARNING; - - /* since we define pr_fmt, call printk directly */ -#define pr(str) printk(KERN_WARNING AUFS_NAME ": " str) - - sbinfo = au_sbi(sb); - printk(KERN_WARNING "si=%lx\n", sysaufs_si_id(sbinfo)); - pr("superblock\n"); - au_dpri_sb(sb); - -#if 0 - pr("root dentry\n"); - au_dpri_dentry(sb->s_root); - pr("root inode\n"); - au_dpri_inode(sb->s_root->d_inode); -#endif - -#if 0 - do { - int err, i, j, ndentry; - struct au_dcsub_pages dpages; - struct au_dpage *dpage; - - err = au_dpages_init(&dpages, GFP_ATOMIC); - if (unlikely(err)) - break; - err = au_dcsub_pages(&dpages, sb->s_root, NULL, NULL); - if (!err) - for (i = 0; i < dpages.ndpage; i++) { - dpage = dpages.dpages + i; - ndentry = dpage->ndentry; - for (j = 0; j < ndentry; j++) - au_dpri_dentry(dpage->dentries[j]); - } - au_dpages_free(&dpages); - } while (0); -#endif - -#if 1 - { - struct inode *i; - - pr("isolated inode\n"); - spin_lock(&inode_sb_list_lock); - list_for_each_entry(i, &sb->s_inodes, i_sb_list) { - spin_lock(&i->i_lock); - if (1 || hlist_empty(&i->i_dentry)) - au_dpri_inode(i); - spin_unlock(&i->i_lock); - } - spin_unlock(&inode_sb_list_lock); - } -#endif - pr("files\n"); - lg_global_lock(&files_lglock); - do_file_list_for_each_entry(sb, file) { - umode_t mode; - - mode = file_inode(file)->i_mode; - if (!special_file(mode)) - au_dpri_file(file); - } while_file_list_for_each_entry; - lg_global_unlock(&files_lglock); - pr("done\n"); - -#undef pr - au_plevel = plevel; -} - -/* ---------------------------------------------------------------------- */ - -/* module parameter */ -static char *aufs_sysrq_key = "a"; -module_param_named(sysrq, aufs_sysrq_key, charp, S_IRUGO); -MODULE_PARM_DESC(sysrq, "MagicSysRq key for " AUFS_NAME); - -static void au_sysrq(int key __maybe_unused) -{ - struct au_sbinfo *sbinfo; - - lockdep_off(); - au_sbilist_lock(); - list_for_each_entry(sbinfo, &au_sbilist.head, si_list) - sysrq_sb(sbinfo->si_sb); - au_sbilist_unlock(); - lockdep_on(); -} - -static struct sysrq_key_op au_sysrq_op = { - .handler = au_sysrq, - .help_msg = "Aufs", - .action_msg = "Aufs", - .enable_mask = SYSRQ_ENABLE_DUMP -}; - -/* ---------------------------------------------------------------------- */ - -int __init au_sysrq_init(void) -{ - int err; - char key; - - err = -1; - key = *aufs_sysrq_key; - if ('a' <= key && key <= 'z') - err = register_sysrq_key(key, &au_sysrq_op); - if (unlikely(err)) - pr_err("err %d, sysrq=%c\n", err, key); - return err; -} - -void au_sysrq_fin(void) -{ - int err; - - err = unregister_sysrq_key(*aufs_sysrq_key, &au_sysrq_op); - if (unlikely(err)) - pr_err("err %d (ignored)\n", err); -} diff --git a/fs/aufs/vdir.c b/fs/aufs/vdir.c deleted file mode 100644 index 00f213765dc5c9..00000000000000 --- a/fs/aufs/vdir.c +++ /dev/null @@ -1,879 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * virtual or vertical directory - */ - -#include "aufs.h" - -static unsigned int calc_size(int nlen) -{ - return ALIGN(sizeof(struct au_vdir_de) + nlen, sizeof(ino_t)); -} - -static int set_deblk_end(union au_vdir_deblk_p *p, - union au_vdir_deblk_p *deblk_end) -{ - if (calc_size(0) <= deblk_end->deblk - p->deblk) { - p->de->de_str.len = 0; - /* smp_mb(); */ - return 0; - } - return -1; /* error */ -} - -/* returns true or false */ -static int is_deblk_end(union au_vdir_deblk_p *p, - union au_vdir_deblk_p *deblk_end) -{ - if (calc_size(0) <= deblk_end->deblk - p->deblk) - return !p->de->de_str.len; - return 1; -} - -static unsigned char *last_deblk(struct au_vdir *vdir) -{ - return vdir->vd_deblk[vdir->vd_nblk - 1]; -} - -/* ---------------------------------------------------------------------- */ - -/* estimate the apropriate size for name hash table */ -unsigned int au_rdhash_est(loff_t sz) -{ - unsigned int n; - - n = UINT_MAX; - sz >>= 10; - if (sz < n) - n = sz; - if (sz < AUFS_RDHASH_DEF) - n = AUFS_RDHASH_DEF; - /* pr_info("n %u\n", n); */ - return n; -} - -/* - * the allocated memory has to be freed by - * au_nhash_wh_free() or au_nhash_de_free(). - */ -int au_nhash_alloc(struct au_nhash *nhash, unsigned int num_hash, gfp_t gfp) -{ - struct hlist_head *head; - unsigned int u; - size_t sz; - - sz = sizeof(*nhash->nh_head) * num_hash; - head = kmalloc(sz, gfp); - if (head) { - nhash->nh_num = num_hash; - nhash->nh_head = head; - for (u = 0; u < num_hash; u++) - INIT_HLIST_HEAD(head++); - return 0; /* success */ - } - - return -ENOMEM; -} - -static void nhash_count(struct hlist_head *head) -{ -#if 0 - unsigned long n; - struct hlist_node *pos; - - n = 0; - hlist_for_each(pos, head) - n++; - pr_info("%lu\n", n); -#endif -} - -static void au_nhash_wh_do_free(struct hlist_head *head) -{ - struct au_vdir_wh *pos; - struct hlist_node *node; - - hlist_for_each_entry_safe(pos, node, head, wh_hash) - kfree(pos); -} - -static void au_nhash_de_do_free(struct hlist_head *head) -{ - struct au_vdir_dehstr *pos; - struct hlist_node *node; - - hlist_for_each_entry_safe(pos, node, head, hash) - au_cache_free_vdir_dehstr(pos); -} - -static void au_nhash_do_free(struct au_nhash *nhash, - void (*free)(struct hlist_head *head)) -{ - unsigned int n; - struct hlist_head *head; - - n = nhash->nh_num; - if (!n) - return; - - head = nhash->nh_head; - while (n-- > 0) { - nhash_count(head); - free(head++); - } - kfree(nhash->nh_head); -} - -void au_nhash_wh_free(struct au_nhash *whlist) -{ - au_nhash_do_free(whlist, au_nhash_wh_do_free); -} - -static void au_nhash_de_free(struct au_nhash *delist) -{ - au_nhash_do_free(delist, au_nhash_de_do_free); -} - -/* ---------------------------------------------------------------------- */ - -int au_nhash_test_longer_wh(struct au_nhash *whlist, aufs_bindex_t btgt, - int limit) -{ - int num; - unsigned int u, n; - struct hlist_head *head; - struct au_vdir_wh *pos; - - num = 0; - n = whlist->nh_num; - head = whlist->nh_head; - for (u = 0; u < n; u++, head++) - hlist_for_each_entry(pos, head, wh_hash) - if (pos->wh_bindex == btgt && ++num > limit) - return 1; - return 0; -} - -static struct hlist_head *au_name_hash(struct au_nhash *nhash, - unsigned char *name, - unsigned int len) -{ - unsigned int v; - /* const unsigned int magic_bit = 12; */ - - AuDebugOn(!nhash->nh_num || !nhash->nh_head); - - v = 0; - while (len--) - v += *name++; - /* v = hash_long(v, magic_bit); */ - v %= nhash->nh_num; - return nhash->nh_head + v; -} - -static int au_nhash_test_name(struct au_vdir_destr *str, const char *name, - int nlen) -{ - return str->len == nlen && !memcmp(str->name, name, nlen); -} - -/* returns found or not */ -int au_nhash_test_known_wh(struct au_nhash *whlist, char *name, int nlen) -{ - struct hlist_head *head; - struct au_vdir_wh *pos; - struct au_vdir_destr *str; - - head = au_name_hash(whlist, name, nlen); - hlist_for_each_entry(pos, head, wh_hash) { - str = &pos->wh_str; - AuDbg("%.*s\n", str->len, str->name); - if (au_nhash_test_name(str, name, nlen)) - return 1; - } - return 0; -} - -/* returns found(true) or not */ -static int test_known(struct au_nhash *delist, char *name, int nlen) -{ - struct hlist_head *head; - struct au_vdir_dehstr *pos; - struct au_vdir_destr *str; - - head = au_name_hash(delist, name, nlen); - hlist_for_each_entry(pos, head, hash) { - str = pos->str; - AuDbg("%.*s\n", str->len, str->name); - if (au_nhash_test_name(str, name, nlen)) - return 1; - } - return 0; -} - -static void au_shwh_init_wh(struct au_vdir_wh *wh, ino_t ino, - unsigned char d_type) -{ -#ifdef CONFIG_AUFS_SHWH - wh->wh_ino = ino; - wh->wh_type = d_type; -#endif -} - -/* ---------------------------------------------------------------------- */ - -int au_nhash_append_wh(struct au_nhash *whlist, char *name, int nlen, ino_t ino, - unsigned int d_type, aufs_bindex_t bindex, - unsigned char shwh) -{ - int err; - struct au_vdir_destr *str; - struct au_vdir_wh *wh; - - AuDbg("%.*s\n", nlen, name); - AuDebugOn(!whlist->nh_num || !whlist->nh_head); - - err = -ENOMEM; - wh = kmalloc(sizeof(*wh) + nlen, GFP_NOFS); - if (unlikely(!wh)) - goto out; - - err = 0; - wh->wh_bindex = bindex; - if (shwh) - au_shwh_init_wh(wh, ino, d_type); - str = &wh->wh_str; - str->len = nlen; - memcpy(str->name, name, nlen); - hlist_add_head(&wh->wh_hash, au_name_hash(whlist, name, nlen)); - /* smp_mb(); */ - -out: - return err; -} - -static int append_deblk(struct au_vdir *vdir) -{ - int err; - unsigned long ul; - const unsigned int deblk_sz = vdir->vd_deblk_sz; - union au_vdir_deblk_p p, deblk_end; - unsigned char **o; - - err = -ENOMEM; - o = krealloc(vdir->vd_deblk, sizeof(*o) * (vdir->vd_nblk + 1), - GFP_NOFS); - if (unlikely(!o)) - goto out; - - vdir->vd_deblk = o; - p.deblk = kmalloc(deblk_sz, GFP_NOFS); - if (p.deblk) { - ul = vdir->vd_nblk++; - vdir->vd_deblk[ul] = p.deblk; - vdir->vd_last.ul = ul; - vdir->vd_last.p.deblk = p.deblk; - deblk_end.deblk = p.deblk + deblk_sz; - err = set_deblk_end(&p, &deblk_end); - } - -out: - return err; -} - -static int append_de(struct au_vdir *vdir, char *name, int nlen, ino_t ino, - unsigned int d_type, struct au_nhash *delist) -{ - int err; - unsigned int sz; - const unsigned int deblk_sz = vdir->vd_deblk_sz; - union au_vdir_deblk_p p, *room, deblk_end; - struct au_vdir_dehstr *dehstr; - - p.deblk = last_deblk(vdir); - deblk_end.deblk = p.deblk + deblk_sz; - room = &vdir->vd_last.p; - AuDebugOn(room->deblk < p.deblk || deblk_end.deblk <= room->deblk - || !is_deblk_end(room, &deblk_end)); - - sz = calc_size(nlen); - if (unlikely(sz > deblk_end.deblk - room->deblk)) { - err = append_deblk(vdir); - if (unlikely(err)) - goto out; - - p.deblk = last_deblk(vdir); - deblk_end.deblk = p.deblk + deblk_sz; - /* smp_mb(); */ - AuDebugOn(room->deblk != p.deblk); - } - - err = -ENOMEM; - dehstr = au_cache_alloc_vdir_dehstr(); - if (unlikely(!dehstr)) - goto out; - - dehstr->str = &room->de->de_str; - hlist_add_head(&dehstr->hash, au_name_hash(delist, name, nlen)); - room->de->de_ino = ino; - room->de->de_type = d_type; - room->de->de_str.len = nlen; - memcpy(room->de->de_str.name, name, nlen); - - err = 0; - room->deblk += sz; - if (unlikely(set_deblk_end(room, &deblk_end))) - err = append_deblk(vdir); - /* smp_mb(); */ - -out: - return err; -} - -/* ---------------------------------------------------------------------- */ - -void au_vdir_free(struct au_vdir *vdir) -{ - unsigned char **deblk; - - deblk = vdir->vd_deblk; - while (vdir->vd_nblk--) - kfree(*deblk++); - kfree(vdir->vd_deblk); - au_cache_free_vdir(vdir); -} - -static struct au_vdir *alloc_vdir(struct file *file) -{ - struct au_vdir *vdir; - struct super_block *sb; - int err; - - sb = file->f_dentry->d_sb; - SiMustAnyLock(sb); - - err = -ENOMEM; - vdir = au_cache_alloc_vdir(); - if (unlikely(!vdir)) - goto out; - - vdir->vd_deblk = kzalloc(sizeof(*vdir->vd_deblk), GFP_NOFS); - if (unlikely(!vdir->vd_deblk)) - goto out_free; - - vdir->vd_deblk_sz = au_sbi(sb)->si_rdblk; - if (!vdir->vd_deblk_sz) { - /* estimate the apropriate size for deblk */ - vdir->vd_deblk_sz = au_dir_size(file, /*dentry*/NULL); - /* pr_info("vd_deblk_sz %u\n", vdir->vd_deblk_sz); */ - } - vdir->vd_nblk = 0; - vdir->vd_version = 0; - vdir->vd_jiffy = 0; - err = append_deblk(vdir); - if (!err) - return vdir; /* success */ - - kfree(vdir->vd_deblk); - -out_free: - au_cache_free_vdir(vdir); -out: - vdir = ERR_PTR(err); - return vdir; -} - -static int reinit_vdir(struct au_vdir *vdir) -{ - int err; - union au_vdir_deblk_p p, deblk_end; - - while (vdir->vd_nblk > 1) { - kfree(vdir->vd_deblk[vdir->vd_nblk - 1]); - /* vdir->vd_deblk[vdir->vd_nblk - 1] = NULL; */ - vdir->vd_nblk--; - } - p.deblk = vdir->vd_deblk[0]; - deblk_end.deblk = p.deblk + vdir->vd_deblk_sz; - err = set_deblk_end(&p, &deblk_end); - /* keep vd_dblk_sz */ - vdir->vd_last.ul = 0; - vdir->vd_last.p.deblk = vdir->vd_deblk[0]; - vdir->vd_version = 0; - vdir->vd_jiffy = 0; - /* smp_mb(); */ - return err; -} - -/* ---------------------------------------------------------------------- */ - -#define AuFillVdir_CALLED 1 -#define AuFillVdir_WHABLE (1 << 1) -#define AuFillVdir_SHWH (1 << 2) -#define au_ftest_fillvdir(flags, name) ((flags) & AuFillVdir_##name) -#define au_fset_fillvdir(flags, name) \ - do { (flags) |= AuFillVdir_##name; } while (0) -#define au_fclr_fillvdir(flags, name) \ - do { (flags) &= ~AuFillVdir_##name; } while (0) - -#ifndef CONFIG_AUFS_SHWH -#undef AuFillVdir_SHWH -#define AuFillVdir_SHWH 0 -#endif - -struct fillvdir_arg { - struct file *file; - struct au_vdir *vdir; - struct au_nhash delist; - struct au_nhash whlist; - aufs_bindex_t bindex; - unsigned int flags; - int err; -}; - -static int fillvdir(void *__arg, const char *__name, int nlen, - loff_t offset __maybe_unused, u64 h_ino, - unsigned int d_type) -{ - struct fillvdir_arg *arg = __arg; - char *name = (void *)__name; - struct super_block *sb; - ino_t ino; - const unsigned char shwh = !!au_ftest_fillvdir(arg->flags, SHWH); - - arg->err = 0; - sb = arg->file->f_dentry->d_sb; - au_fset_fillvdir(arg->flags, CALLED); - /* smp_mb(); */ - if (nlen <= AUFS_WH_PFX_LEN - || memcmp(name, AUFS_WH_PFX, AUFS_WH_PFX_LEN)) { - if (test_known(&arg->delist, name, nlen) - || au_nhash_test_known_wh(&arg->whlist, name, nlen)) - goto out; /* already exists or whiteouted */ - - sb = arg->file->f_dentry->d_sb; - arg->err = au_ino(sb, arg->bindex, h_ino, d_type, &ino); - if (!arg->err) { - if (unlikely(nlen > AUFS_MAX_NAMELEN)) - d_type = DT_UNKNOWN; - arg->err = append_de(arg->vdir, name, nlen, ino, - d_type, &arg->delist); - } - } else if (au_ftest_fillvdir(arg->flags, WHABLE)) { - name += AUFS_WH_PFX_LEN; - nlen -= AUFS_WH_PFX_LEN; - if (au_nhash_test_known_wh(&arg->whlist, name, nlen)) - goto out; /* already whiteouted */ - - if (shwh) - arg->err = au_wh_ino(sb, arg->bindex, h_ino, d_type, - &ino); - if (!arg->err) { - if (nlen <= AUFS_MAX_NAMELEN + AUFS_WH_PFX_LEN) - d_type = DT_UNKNOWN; - arg->err = au_nhash_append_wh - (&arg->whlist, name, nlen, ino, d_type, - arg->bindex, shwh); - } - } - -out: - if (!arg->err) - arg->vdir->vd_jiffy = jiffies; - /* smp_mb(); */ - AuTraceErr(arg->err); - return arg->err; -} - -static int au_handle_shwh(struct super_block *sb, struct au_vdir *vdir, - struct au_nhash *whlist, struct au_nhash *delist) -{ -#ifdef CONFIG_AUFS_SHWH - int err; - unsigned int nh, u; - struct hlist_head *head; - struct au_vdir_wh *pos; - struct hlist_node *n; - char *p, *o; - struct au_vdir_destr *destr; - - AuDebugOn(!au_opt_test(au_mntflags(sb), SHWH)); - - err = -ENOMEM; - o = p = (void *)__get_free_page(GFP_NOFS); - if (unlikely(!p)) - goto out; - - err = 0; - nh = whlist->nh_num; - memcpy(p, AUFS_WH_PFX, AUFS_WH_PFX_LEN); - p += AUFS_WH_PFX_LEN; - for (u = 0; u < nh; u++) { - head = whlist->nh_head + u; - hlist_for_each_entry_safe(pos, n, head, wh_hash) { - destr = &pos->wh_str; - memcpy(p, destr->name, destr->len); - err = append_de(vdir, o, destr->len + AUFS_WH_PFX_LEN, - pos->wh_ino, pos->wh_type, delist); - if (unlikely(err)) - break; - } - } - - free_page((unsigned long)o); - -out: - AuTraceErr(err); - return err; -#else - return 0; -#endif -} - -static int au_do_read_vdir(struct fillvdir_arg *arg) -{ - int err; - unsigned int rdhash; - loff_t offset; - aufs_bindex_t bend, bindex, bstart; - unsigned char shwh; - struct file *hf, *file; - struct super_block *sb; - - file = arg->file; - sb = file->f_dentry->d_sb; - SiMustAnyLock(sb); - - rdhash = au_sbi(sb)->si_rdhash; - if (!rdhash) - rdhash = au_rdhash_est(au_dir_size(file, /*dentry*/NULL)); - err = au_nhash_alloc(&arg->delist, rdhash, GFP_NOFS); - if (unlikely(err)) - goto out; - err = au_nhash_alloc(&arg->whlist, rdhash, GFP_NOFS); - if (unlikely(err)) - goto out_delist; - - err = 0; - arg->flags = 0; - shwh = 0; - if (au_opt_test(au_mntflags(sb), SHWH)) { - shwh = 1; - au_fset_fillvdir(arg->flags, SHWH); - } - bstart = au_fbstart(file); - bend = au_fbend_dir(file); - for (bindex = bstart; !err && bindex <= bend; bindex++) { - hf = au_hf_dir(file, bindex); - if (!hf) - continue; - - offset = vfsub_llseek(hf, 0, SEEK_SET); - err = offset; - if (unlikely(offset)) - break; - - arg->bindex = bindex; - au_fclr_fillvdir(arg->flags, WHABLE); - if (shwh - || (bindex != bend - && au_br_whable(au_sbr_perm(sb, bindex)))) - au_fset_fillvdir(arg->flags, WHABLE); - do { - arg->err = 0; - au_fclr_fillvdir(arg->flags, CALLED); - /* smp_mb(); */ - err = vfsub_readdir(hf, fillvdir, arg); - if (err >= 0) - err = arg->err; - } while (!err && au_ftest_fillvdir(arg->flags, CALLED)); - } - - if (!err && shwh) - err = au_handle_shwh(sb, arg->vdir, &arg->whlist, &arg->delist); - - au_nhash_wh_free(&arg->whlist); - -out_delist: - au_nhash_de_free(&arg->delist); -out: - return err; -} - -static int read_vdir(struct file *file, int may_read) -{ - int err; - unsigned long expire; - unsigned char do_read; - struct fillvdir_arg arg; - struct inode *inode; - struct au_vdir *vdir, *allocated; - - err = 0; - inode = file_inode(file); - IMustLock(inode); - SiMustAnyLock(inode->i_sb); - - allocated = NULL; - do_read = 0; - expire = au_sbi(inode->i_sb)->si_rdcache; - vdir = au_ivdir(inode); - if (!vdir) { - do_read = 1; - vdir = alloc_vdir(file); - err = PTR_ERR(vdir); - if (IS_ERR(vdir)) - goto out; - err = 0; - allocated = vdir; - } else if (may_read - && (inode->i_version != vdir->vd_version - || time_after(jiffies, vdir->vd_jiffy + expire))) { - do_read = 1; - err = reinit_vdir(vdir); - if (unlikely(err)) - goto out; - } - - if (!do_read) - return 0; /* success */ - - arg.file = file; - arg.vdir = vdir; - err = au_do_read_vdir(&arg); - if (!err) { - /* file->f_pos = 0; */ - vdir->vd_version = inode->i_version; - vdir->vd_last.ul = 0; - vdir->vd_last.p.deblk = vdir->vd_deblk[0]; - if (allocated) - au_set_ivdir(inode, allocated); - } else if (allocated) - au_vdir_free(allocated); - -out: - return err; -} - -static int copy_vdir(struct au_vdir *tgt, struct au_vdir *src) -{ - int err, rerr; - unsigned long ul, n; - const unsigned int deblk_sz = src->vd_deblk_sz; - - AuDebugOn(tgt->vd_nblk != 1); - - err = -ENOMEM; - if (tgt->vd_nblk < src->vd_nblk) { - unsigned char **p; - - p = krealloc(tgt->vd_deblk, sizeof(*p) * src->vd_nblk, - GFP_NOFS); - if (unlikely(!p)) - goto out; - tgt->vd_deblk = p; - } - - if (tgt->vd_deblk_sz != deblk_sz) { - unsigned char *p; - - tgt->vd_deblk_sz = deblk_sz; - p = krealloc(tgt->vd_deblk[0], deblk_sz, GFP_NOFS); - if (unlikely(!p)) - goto out; - tgt->vd_deblk[0] = p; - } - memcpy(tgt->vd_deblk[0], src->vd_deblk[0], deblk_sz); - tgt->vd_version = src->vd_version; - tgt->vd_jiffy = src->vd_jiffy; - - n = src->vd_nblk; - for (ul = 1; ul < n; ul++) { - tgt->vd_deblk[ul] = kmemdup(src->vd_deblk[ul], deblk_sz, - GFP_NOFS); - if (unlikely(!tgt->vd_deblk[ul])) - goto out; - tgt->vd_nblk++; - } - tgt->vd_nblk = n; - tgt->vd_last.ul = tgt->vd_last.ul; - tgt->vd_last.p.deblk = tgt->vd_deblk[tgt->vd_last.ul]; - tgt->vd_last.p.deblk += src->vd_last.p.deblk - - src->vd_deblk[src->vd_last.ul]; - /* smp_mb(); */ - return 0; /* success */ - -out: - rerr = reinit_vdir(tgt); - BUG_ON(rerr); - return err; -} - -int au_vdir_init(struct file *file) -{ - int err; - struct inode *inode; - struct au_vdir *vdir_cache, *allocated; - - err = read_vdir(file, !file->f_pos); - if (unlikely(err)) - goto out; - - allocated = NULL; - vdir_cache = au_fvdir_cache(file); - if (!vdir_cache) { - vdir_cache = alloc_vdir(file); - err = PTR_ERR(vdir_cache); - if (IS_ERR(vdir_cache)) - goto out; - allocated = vdir_cache; - } else if (!file->f_pos && vdir_cache->vd_version != file->f_version) { - err = reinit_vdir(vdir_cache); - if (unlikely(err)) - goto out; - } else - return 0; /* success */ - - inode = file_inode(file); - err = copy_vdir(vdir_cache, au_ivdir(inode)); - if (!err) { - file->f_version = inode->i_version; - if (allocated) - au_set_fvdir_cache(file, allocated); - } else if (allocated) - au_vdir_free(allocated); - -out: - return err; -} - -static loff_t calc_offset(struct au_vdir *vdir) -{ - loff_t offset; - union au_vdir_deblk_p p; - - p.deblk = vdir->vd_deblk[vdir->vd_last.ul]; - offset = vdir->vd_last.p.deblk - p.deblk; - offset += vdir->vd_deblk_sz * vdir->vd_last.ul; - return offset; -} - -/* returns true or false */ -static int seek_vdir(struct file *file) -{ - int valid; - unsigned int deblk_sz; - unsigned long ul, n; - loff_t offset; - union au_vdir_deblk_p p, deblk_end; - struct au_vdir *vdir_cache; - - valid = 1; - vdir_cache = au_fvdir_cache(file); - offset = calc_offset(vdir_cache); - AuDbg("offset %lld\n", offset); - if (file->f_pos == offset) - goto out; - - vdir_cache->vd_last.ul = 0; - vdir_cache->vd_last.p.deblk = vdir_cache->vd_deblk[0]; - if (!file->f_pos) - goto out; - - valid = 0; - deblk_sz = vdir_cache->vd_deblk_sz; - ul = div64_u64(file->f_pos, deblk_sz); - AuDbg("ul %lu\n", ul); - if (ul >= vdir_cache->vd_nblk) - goto out; - - n = vdir_cache->vd_nblk; - for (; ul < n; ul++) { - p.deblk = vdir_cache->vd_deblk[ul]; - deblk_end.deblk = p.deblk + deblk_sz; - offset = ul; - offset *= deblk_sz; - while (!is_deblk_end(&p, &deblk_end) && offset < file->f_pos) { - unsigned int l; - - l = calc_size(p.de->de_str.len); - offset += l; - p.deblk += l; - } - if (!is_deblk_end(&p, &deblk_end)) { - valid = 1; - vdir_cache->vd_last.ul = ul; - vdir_cache->vd_last.p = p; - break; - } - } - -out: - /* smp_mb(); */ - AuTraceErr(!valid); - return valid; -} - -int au_vdir_fill_de(struct file *file, void *dirent, filldir_t filldir) -{ - int err; - unsigned int l, deblk_sz; - union au_vdir_deblk_p deblk_end; - struct au_vdir *vdir_cache; - struct au_vdir_de *de; - - vdir_cache = au_fvdir_cache(file); - if (!seek_vdir(file)) - return 0; - - deblk_sz = vdir_cache->vd_deblk_sz; - while (1) { - deblk_end.deblk = vdir_cache->vd_deblk[vdir_cache->vd_last.ul]; - deblk_end.deblk += deblk_sz; - while (!is_deblk_end(&vdir_cache->vd_last.p, &deblk_end)) { - de = vdir_cache->vd_last.p.de; - AuDbg("%.*s, off%lld, i%lu, dt%d\n", - de->de_str.len, de->de_str.name, file->f_pos, - (unsigned long)de->de_ino, de->de_type); - err = filldir(dirent, de->de_str.name, de->de_str.len, - file->f_pos, de->de_ino, de->de_type); - if (unlikely(err)) { - AuTraceErr(err); - /* todo: ignore the error caused by udba? */ - /* return err; */ - return 0; - } - - l = calc_size(de->de_str.len); - vdir_cache->vd_last.p.deblk += l; - file->f_pos += l; - } - if (vdir_cache->vd_last.ul < vdir_cache->vd_nblk - 1) { - vdir_cache->vd_last.ul++; - vdir_cache->vd_last.p.deblk - = vdir_cache->vd_deblk[vdir_cache->vd_last.ul]; - file->f_pos = deblk_sz * vdir_cache->vd_last.ul; - continue; - } - break; - } - - /* smp_mb(); */ - return 0; -} diff --git a/fs/aufs/vfsub.c b/fs/aufs/vfsub.c deleted file mode 100644 index 91468c37830bc1..00000000000000 --- a/fs/aufs/vfsub.c +++ /dev/null @@ -1,782 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * sub-routines for VFS - */ - -#include -#include -#include -#include -#include "aufs.h" - -int vfsub_update_h_iattr(struct path *h_path, int *did) -{ - int err; - struct kstat st; - struct super_block *h_sb; - - /* for remote fs, leave work for its getattr or d_revalidate */ - /* for bad i_attr fs, handle them in aufs_getattr() */ - /* still some fs may acquire i_mutex. we need to skip them */ - err = 0; - if (!did) - did = &err; - h_sb = h_path->dentry->d_sb; - *did = (!au_test_fs_remote(h_sb) && au_test_fs_refresh_iattr(h_sb)); - if (*did) - err = vfs_getattr(h_path, &st); - - return err; -} - -/* ---------------------------------------------------------------------- */ - -struct file *vfsub_dentry_open(struct path *path, int flags) -{ - struct file *file; - - file = dentry_open(path, flags /* | __FMODE_NONOTIFY */, - current_cred()); - if (!IS_ERR_OR_NULL(file) - && (file->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ) - i_readcount_inc(path->dentry->d_inode); - - return file; -} - -struct file *vfsub_filp_open(const char *path, int oflags, int mode) -{ - struct file *file; - - lockdep_off(); - file = filp_open(path, - oflags /* | __FMODE_NONOTIFY */, - mode); - lockdep_on(); - if (IS_ERR(file)) - goto out; - vfsub_update_h_iattr(&file->f_path, /*did*/NULL); /*ignore*/ - -out: - return file; -} - -int vfsub_kern_path(const char *name, unsigned int flags, struct path *path) -{ - int err; - - err = kern_path(name, flags, path); - if (!err && path->dentry->d_inode) - vfsub_update_h_iattr(path, /*did*/NULL); /*ignore*/ - return err; -} - -struct dentry *vfsub_lookup_one_len(const char *name, struct dentry *parent, - int len) -{ - struct path path = { - .mnt = NULL - }; - - /* VFS checks it too, but by WARN_ON_ONCE() */ - IMustLock(parent->d_inode); - - path.dentry = lookup_one_len(name, parent, len); - if (IS_ERR(path.dentry)) - goto out; - if (path.dentry->d_inode) - vfsub_update_h_iattr(&path, /*did*/NULL); /*ignore*/ - -out: - AuTraceErrPtr(path.dentry); - return path.dentry; -} - -void vfsub_call_lkup_one(void *args) -{ - struct vfsub_lkup_one_args *a = args; - *a->errp = vfsub_lkup_one(a->name, a->parent); -} - -/* ---------------------------------------------------------------------- */ - -struct dentry *vfsub_lock_rename(struct dentry *d1, struct au_hinode *hdir1, - struct dentry *d2, struct au_hinode *hdir2) -{ - struct dentry *d; - - lockdep_off(); - d = lock_rename(d1, d2); - lockdep_on(); - au_hn_suspend(hdir1); - if (hdir1 != hdir2) - au_hn_suspend(hdir2); - - return d; -} - -void vfsub_unlock_rename(struct dentry *d1, struct au_hinode *hdir1, - struct dentry *d2, struct au_hinode *hdir2) -{ - au_hn_resume(hdir1); - if (hdir1 != hdir2) - au_hn_resume(hdir2); - lockdep_off(); - unlock_rename(d1, d2); - lockdep_on(); -} - -/* ---------------------------------------------------------------------- */ - -int vfsub_create(struct inode *dir, struct path *path, int mode, bool want_excl) -{ - int err; - struct dentry *d; - - IMustLock(dir); - - d = path->dentry; - path->dentry = d->d_parent; - err = security_path_mknod(path, d, mode, 0); - path->dentry = d; - if (unlikely(err)) - goto out; - - lockdep_off(); - err = vfs_create(dir, path->dentry, mode, want_excl); - lockdep_on(); - if (!err) { - struct path tmp = *path; - int did; - - vfsub_update_h_iattr(&tmp, &did); - if (did) { - tmp.dentry = path->dentry->d_parent; - vfsub_update_h_iattr(&tmp, /*did*/NULL); - } - /*ignore*/ - } - -out: - return err; -} - -int vfsub_symlink(struct inode *dir, struct path *path, const char *symname) -{ - int err; - struct dentry *d; - - IMustLock(dir); - - d = path->dentry; - path->dentry = d->d_parent; - err = security_path_symlink(path, d, symname); - path->dentry = d; - if (unlikely(err)) - goto out; - - lockdep_off(); - err = vfs_symlink(dir, path->dentry, symname); - lockdep_on(); - if (!err) { - struct path tmp = *path; - int did; - - vfsub_update_h_iattr(&tmp, &did); - if (did) { - tmp.dentry = path->dentry->d_parent; - vfsub_update_h_iattr(&tmp, /*did*/NULL); - } - /*ignore*/ - } - -out: - return err; -} - -int vfsub_mknod(struct inode *dir, struct path *path, int mode, dev_t dev) -{ - int err; - struct dentry *d; - - IMustLock(dir); - - d = path->dentry; - path->dentry = d->d_parent; - err = security_path_mknod(path, d, mode, new_encode_dev(dev)); - path->dentry = d; - if (unlikely(err)) - goto out; - - lockdep_off(); - err = vfs_mknod(dir, path->dentry, mode, dev); - lockdep_on(); - if (!err) { - struct path tmp = *path; - int did; - - vfsub_update_h_iattr(&tmp, &did); - if (did) { - tmp.dentry = path->dentry->d_parent; - vfsub_update_h_iattr(&tmp, /*did*/NULL); - } - /*ignore*/ - } - -out: - return err; -} - -static int au_test_nlink(struct inode *inode) -{ - const unsigned int link_max = UINT_MAX >> 1; /* rough margin */ - - if (!au_test_fs_no_limit_nlink(inode->i_sb) - || inode->i_nlink < link_max) - return 0; - return -EMLINK; -} - -int vfsub_link(struct dentry *src_dentry, struct inode *dir, struct path *path) -{ - int err; - struct dentry *d; - - IMustLock(dir); - - err = au_test_nlink(src_dentry->d_inode); - if (unlikely(err)) - return err; - - /* we don't call may_linkat() */ - d = path->dentry; - path->dentry = d->d_parent; - err = security_path_link(src_dentry, path, d); - path->dentry = d; - if (unlikely(err)) - goto out; - - lockdep_off(); - err = vfs_link(src_dentry, dir, path->dentry); - lockdep_on(); - if (!err) { - struct path tmp = *path; - int did; - - /* fuse has different memory inode for the same inumber */ - vfsub_update_h_iattr(&tmp, &did); - if (did) { - tmp.dentry = path->dentry->d_parent; - vfsub_update_h_iattr(&tmp, /*did*/NULL); - tmp.dentry = src_dentry; - vfsub_update_h_iattr(&tmp, /*did*/NULL); - } - /*ignore*/ - } - -out: - return err; -} - -int vfsub_rename(struct inode *src_dir, struct dentry *src_dentry, - struct inode *dir, struct path *path) -{ - int err; - struct path tmp = { - .mnt = path->mnt - }; - struct dentry *d; - - IMustLock(dir); - IMustLock(src_dir); - - d = path->dentry; - path->dentry = d->d_parent; - tmp.dentry = src_dentry->d_parent; - err = security_path_rename(&tmp, src_dentry, path, d); - path->dentry = d; - if (unlikely(err)) - goto out; - - lockdep_off(); - err = vfs_rename(src_dir, src_dentry, dir, path->dentry); - lockdep_on(); - if (!err) { - int did; - - tmp.dentry = d->d_parent; - vfsub_update_h_iattr(&tmp, &did); - if (did) { - tmp.dentry = src_dentry; - vfsub_update_h_iattr(&tmp, /*did*/NULL); - tmp.dentry = src_dentry->d_parent; - vfsub_update_h_iattr(&tmp, /*did*/NULL); - } - /*ignore*/ - } - -out: - return err; -} - -int vfsub_mkdir(struct inode *dir, struct path *path, int mode) -{ - int err; - struct dentry *d; - - IMustLock(dir); - - d = path->dentry; - path->dentry = d->d_parent; - err = security_path_mkdir(path, d, mode); - path->dentry = d; - if (unlikely(err)) - goto out; - - lockdep_off(); - err = vfs_mkdir(dir, path->dentry, mode); - lockdep_on(); - if (!err) { - struct path tmp = *path; - int did; - - vfsub_update_h_iattr(&tmp, &did); - if (did) { - tmp.dentry = path->dentry->d_parent; - vfsub_update_h_iattr(&tmp, /*did*/NULL); - } - /*ignore*/ - } - -out: - return err; -} - -int vfsub_rmdir(struct inode *dir, struct path *path) -{ - int err; - struct dentry *d; - - IMustLock(dir); - - d = path->dentry; - path->dentry = d->d_parent; - err = security_path_rmdir(path, d); - path->dentry = d; - if (unlikely(err)) - goto out; - - lockdep_off(); - err = vfs_rmdir(dir, path->dentry); - lockdep_on(); - if (!err) { - struct path tmp = { - .dentry = path->dentry->d_parent, - .mnt = path->mnt - }; - - vfsub_update_h_iattr(&tmp, /*did*/NULL); /*ignore*/ - } - -out: - return err; -} - -/* ---------------------------------------------------------------------- */ - -/* todo: support mmap_sem? */ -ssize_t vfsub_read_u(struct file *file, char __user *ubuf, size_t count, - loff_t *ppos) -{ - ssize_t err; - - lockdep_off(); - err = vfs_read(file, ubuf, count, ppos); - lockdep_on(); - if (err >= 0) - vfsub_update_h_iattr(&file->f_path, /*did*/NULL); /*ignore*/ - return err; -} - -/* todo: kernel_read()? */ -ssize_t vfsub_read_k(struct file *file, void *kbuf, size_t count, - loff_t *ppos) -{ - ssize_t err; - mm_segment_t oldfs; - union { - void *k; - char __user *u; - } buf; - - buf.k = kbuf; - oldfs = get_fs(); - set_fs(KERNEL_DS); - err = vfsub_read_u(file, buf.u, count, ppos); - set_fs(oldfs); - return err; -} - -ssize_t vfsub_write_u(struct file *file, const char __user *ubuf, size_t count, - loff_t *ppos) -{ - ssize_t err; - - lockdep_off(); - err = vfs_write(file, ubuf, count, ppos); - lockdep_on(); - if (err >= 0) - vfsub_update_h_iattr(&file->f_path, /*did*/NULL); /*ignore*/ - return err; -} - -ssize_t vfsub_write_k(struct file *file, void *kbuf, size_t count, loff_t *ppos) -{ - ssize_t err; - mm_segment_t oldfs; - union { - void *k; - const char __user *u; - } buf; - - buf.k = kbuf; - oldfs = get_fs(); - set_fs(KERNEL_DS); - err = vfsub_write_u(file, buf.u, count, ppos); - set_fs(oldfs); - return err; -} - -int vfsub_flush(struct file *file, fl_owner_t id) -{ - int err; - - err = 0; - if (file->f_op && file->f_op->flush) { - if (!au_test_nfs(file->f_dentry->d_sb)) - err = file->f_op->flush(file, id); - else { - lockdep_off(); - err = file->f_op->flush(file, id); - lockdep_on(); - } - if (!err) - vfsub_update_h_iattr(&file->f_path, /*did*/NULL); - /*ignore*/ - } - return err; -} - -int vfsub_readdir(struct file *file, filldir_t filldir, void *arg) -{ - int err; - - lockdep_off(); - err = vfs_readdir(file, filldir, arg); - lockdep_on(); - if (err >= 0) - vfsub_update_h_iattr(&file->f_path, /*did*/NULL); /*ignore*/ - return err; -} - -long vfsub_splice_to(struct file *in, loff_t *ppos, - struct pipe_inode_info *pipe, size_t len, - unsigned int flags) -{ - long err; - - lockdep_off(); - err = do_splice_to(in, ppos, pipe, len, flags); - lockdep_on(); - file_accessed(in); - if (err >= 0) - vfsub_update_h_iattr(&in->f_path, /*did*/NULL); /*ignore*/ - return err; -} - -long vfsub_splice_from(struct pipe_inode_info *pipe, struct file *out, - loff_t *ppos, size_t len, unsigned int flags) -{ - long err; - - lockdep_off(); - err = do_splice_from(pipe, out, ppos, len, flags); - lockdep_on(); - if (err >= 0) - vfsub_update_h_iattr(&out->f_path, /*did*/NULL); /*ignore*/ - return err; -} - -int vfsub_fsync(struct file *file, struct path *path, int datasync) -{ - int err; - - /* file can be NULL */ - lockdep_off(); - err = vfs_fsync(file, datasync); - lockdep_on(); - if (!err) { - if (!path) { - AuDebugOn(!file); - path = &file->f_path; - } - vfsub_update_h_iattr(path, /*did*/NULL); /*ignore*/ - } - return err; -} - -/* cf. open.c:do_sys_truncate() and do_sys_ftruncate() */ -int vfsub_trunc(struct path *h_path, loff_t length, unsigned int attr, - struct file *h_file) -{ - int err; - struct inode *h_inode; - struct super_block *h_sb; - - if (!h_file) { - err = vfsub_truncate(h_path, length); - goto out; - } - - h_inode = h_path->dentry->d_inode; - h_sb = h_inode->i_sb; - lockdep_off(); - sb_start_write(h_sb); - lockdep_on(); - err = locks_verify_truncate(h_inode, h_file, length); - if (!err) - err = security_path_truncate(h_path); - if (!err) { - lockdep_off(); - err = do_truncate(h_path->dentry, length, attr, h_file); - lockdep_on(); - } - lockdep_off(); - sb_end_write(h_sb); - lockdep_on(); - -out: - return err; -} - -/* ---------------------------------------------------------------------- */ - -struct au_vfsub_mkdir_args { - int *errp; - struct inode *dir; - struct path *path; - int mode; -}; - -static void au_call_vfsub_mkdir(void *args) -{ - struct au_vfsub_mkdir_args *a = args; - *a->errp = vfsub_mkdir(a->dir, a->path, a->mode); -} - -int vfsub_sio_mkdir(struct inode *dir, struct path *path, int mode) -{ - int err, do_sio, wkq_err; - - do_sio = au_test_h_perm_sio(dir, MAY_EXEC | MAY_WRITE); - if (!do_sio) { - lockdep_off(); - err = vfsub_mkdir(dir, path, mode); - lockdep_on(); - } else { - struct au_vfsub_mkdir_args args = { - .errp = &err, - .dir = dir, - .path = path, - .mode = mode - }; - wkq_err = au_wkq_wait(au_call_vfsub_mkdir, &args); - if (unlikely(wkq_err)) - err = wkq_err; - } - - return err; -} - -struct au_vfsub_rmdir_args { - int *errp; - struct inode *dir; - struct path *path; -}; - -static void au_call_vfsub_rmdir(void *args) -{ - struct au_vfsub_rmdir_args *a = args; - *a->errp = vfsub_rmdir(a->dir, a->path); -} - -int vfsub_sio_rmdir(struct inode *dir, struct path *path) -{ - int err, do_sio, wkq_err; - - do_sio = au_test_h_perm_sio(dir, MAY_EXEC | MAY_WRITE); - if (!do_sio) { - lockdep_off(); - err = vfsub_rmdir(dir, path); - lockdep_on(); - } else { - struct au_vfsub_rmdir_args args = { - .errp = &err, - .dir = dir, - .path = path - }; - wkq_err = au_wkq_wait(au_call_vfsub_rmdir, &args); - if (unlikely(wkq_err)) - err = wkq_err; - } - - return err; -} - -/* ---------------------------------------------------------------------- */ - -struct notify_change_args { - int *errp; - struct path *path; - struct iattr *ia; -}; - -static void call_notify_change(void *args) -{ - struct notify_change_args *a = args; - struct inode *h_inode; - - h_inode = a->path->dentry->d_inode; - IMustLock(h_inode); - - *a->errp = -EPERM; - if (!IS_IMMUTABLE(h_inode) && !IS_APPEND(h_inode)) { - lockdep_off(); - *a->errp = notify_change(a->path->dentry, a->ia); - lockdep_on(); - if (!*a->errp) - vfsub_update_h_iattr(a->path, /*did*/NULL); /*ignore*/ - } - AuTraceErr(*a->errp); -} - -int vfsub_notify_change(struct path *path, struct iattr *ia) -{ - int err; - struct notify_change_args args = { - .errp = &err, - .path = path, - .ia = ia - }; - - call_notify_change(&args); - - return err; -} - -int vfsub_sio_notify_change(struct path *path, struct iattr *ia) -{ - int err, wkq_err; - struct notify_change_args args = { - .errp = &err, - .path = path, - .ia = ia - }; - - wkq_err = au_wkq_wait(call_notify_change, &args); - if (unlikely(wkq_err)) - err = wkq_err; - - return err; -} - -/* ---------------------------------------------------------------------- */ - -struct unlink_args { - int *errp; - struct inode *dir; - struct path *path; -}; - -static void call_unlink(void *args) -{ - struct unlink_args *a = args; - struct dentry *d = a->path->dentry; - struct inode *h_inode; - const int stop_sillyrename = (au_test_nfs(d->d_sb) - && d->d_count == 1); - - IMustLock(a->dir); - - a->path->dentry = d->d_parent; - *a->errp = security_path_unlink(a->path, d); - a->path->dentry = d; - if (unlikely(*a->errp)) - return; - - if (!stop_sillyrename) - dget(d); - h_inode = d->d_inode; - if (h_inode) - ihold(h_inode); - - lockdep_off(); - *a->errp = vfs_unlink(a->dir, d); - lockdep_on(); - if (!*a->errp) { - struct path tmp = { - .dentry = d->d_parent, - .mnt = a->path->mnt - }; - vfsub_update_h_iattr(&tmp, /*did*/NULL); /*ignore*/ - } - - if (!stop_sillyrename) - dput(d); - if (h_inode) - iput(h_inode); - - AuTraceErr(*a->errp); -} - -/* - * @dir: must be locked. - * @dentry: target dentry. - */ -int vfsub_unlink(struct inode *dir, struct path *path, int force) -{ - int err; - struct unlink_args args = { - .errp = &err, - .dir = dir, - .path = path - }; - - if (!force) - call_unlink(&args); - else { - int wkq_err; - - wkq_err = au_wkq_wait(call_unlink, &args); - if (unlikely(wkq_err)) - err = wkq_err; - } - - return err; -} diff --git a/fs/aufs/vfsub.h b/fs/aufs/vfsub.h deleted file mode 100644 index 233c9f36cd0e96..00000000000000 --- a/fs/aufs/vfsub.h +++ /dev/null @@ -1,329 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * sub-routines for VFS - */ - -#ifndef __AUFS_VFSUB_H__ -#define __AUFS_VFSUB_H__ - -#ifdef __KERNEL__ - -#include -#include -#include -#include -#include "debug.h" - -/* copied from linux/fs/internal.h */ -/* todo: BAD approach!! */ -extern struct lglock vfsmount_lock; -extern void __mnt_drop_write(struct vfsmount *); -extern spinlock_t inode_sb_list_lock; - -/* copied from linux/fs/file_table.c */ -extern struct lglock files_lglock; -#ifdef CONFIG_SMP -/* - * These macros iterate all files on all CPUs for a given superblock. - * files_lglock must be held globally. - */ -#define do_file_list_for_each_entry(__sb, __file) \ -{ \ - int i; \ - for_each_possible_cpu(i) { \ - struct list_head *list; \ - list = per_cpu_ptr((__sb)->s_files, i); \ - list_for_each_entry((__file), list, f_u.fu_list) - -#define while_file_list_for_each_entry \ - } \ -} - -#else - -#define do_file_list_for_each_entry(__sb, __file) \ -{ \ - struct list_head *list; \ - list = &(sb)->s_files; \ - list_for_each_entry((__file), list, f_u.fu_list) - -#define while_file_list_for_each_entry \ -} -#endif - -/* ---------------------------------------------------------------------- */ - -/* lock subclass for lower inode */ -/* default MAX_LOCKDEP_SUBCLASSES(8) is not enough */ -/* reduce? gave up. */ -enum { - AuLsc_I_Begin = I_MUTEX_QUOTA, /* 4 */ - AuLsc_I_PARENT, /* lower inode, parent first */ - AuLsc_I_PARENT2, /* copyup dirs */ - AuLsc_I_PARENT3, /* copyup wh */ - AuLsc_I_CHILD, - AuLsc_I_CHILD2, - AuLsc_I_End -}; - -/* to debug easier, do not make them inlined functions */ -#define MtxMustLock(mtx) AuDebugOn(!mutex_is_locked(mtx)) -#define IMustLock(i) MtxMustLock(&(i)->i_mutex) - -/* ---------------------------------------------------------------------- */ - -static inline void vfsub_drop_nlink(struct inode *inode) -{ - AuDebugOn(!inode->i_nlink); - drop_nlink(inode); -} - -static inline void vfsub_dead_dir(struct inode *inode) -{ - AuDebugOn(!S_ISDIR(inode->i_mode)); - inode->i_flags |= S_DEAD; - clear_nlink(inode); -} - -static inline int vfsub_native_ro(struct inode *inode) -{ - return (inode->i_sb->s_flags & MS_RDONLY) - || IS_RDONLY(inode) - /* || IS_APPEND(inode) */ - || IS_IMMUTABLE(inode); -} - -/* ---------------------------------------------------------------------- */ - -int vfsub_update_h_iattr(struct path *h_path, int *did); -struct file *vfsub_dentry_open(struct path *path, int flags); -struct file *vfsub_filp_open(const char *path, int oflags, int mode); -int vfsub_kern_path(const char *name, unsigned int flags, struct path *path); - -struct dentry *vfsub_lookup_one_len(const char *name, struct dentry *parent, - int len); - -struct vfsub_lkup_one_args { - struct dentry **errp; - struct qstr *name; - struct dentry *parent; -}; - -static inline struct dentry *vfsub_lkup_one(struct qstr *name, - struct dentry *parent) -{ - return vfsub_lookup_one_len(name->name, parent, name->len); -} - -void vfsub_call_lkup_one(void *args); - -/* ---------------------------------------------------------------------- */ - -static inline int vfsub_mnt_want_write(struct vfsmount *mnt) -{ - int err; - - lockdep_off(); - err = mnt_want_write(mnt); - lockdep_on(); - return err; -} - -static inline void vfsub_mnt_drop_write(struct vfsmount *mnt) -{ - lockdep_off(); - mnt_drop_write(mnt); - lockdep_on(); -} - -static inline void vfsub_mnt_drop_write_file(struct file *file) -{ - lockdep_off(); - mnt_drop_write_file(file); - lockdep_on(); -} - -/* ---------------------------------------------------------------------- */ - -struct au_hinode; -struct dentry *vfsub_lock_rename(struct dentry *d1, struct au_hinode *hdir1, - struct dentry *d2, struct au_hinode *hdir2); -void vfsub_unlock_rename(struct dentry *d1, struct au_hinode *hdir1, - struct dentry *d2, struct au_hinode *hdir2); - -int vfsub_create(struct inode *dir, struct path *path, int mode, - bool want_excl); -int vfsub_symlink(struct inode *dir, struct path *path, - const char *symname); -int vfsub_mknod(struct inode *dir, struct path *path, int mode, dev_t dev); -int vfsub_link(struct dentry *src_dentry, struct inode *dir, - struct path *path); -int vfsub_rename(struct inode *src_hdir, struct dentry *src_dentry, - struct inode *hdir, struct path *path); -int vfsub_mkdir(struct inode *dir, struct path *path, int mode); -int vfsub_rmdir(struct inode *dir, struct path *path); - -/* ---------------------------------------------------------------------- */ - -ssize_t vfsub_read_u(struct file *file, char __user *ubuf, size_t count, - loff_t *ppos); -ssize_t vfsub_read_k(struct file *file, void *kbuf, size_t count, - loff_t *ppos); -ssize_t vfsub_write_u(struct file *file, const char __user *ubuf, size_t count, - loff_t *ppos); -ssize_t vfsub_write_k(struct file *file, void *kbuf, size_t count, - loff_t *ppos); -int vfsub_flush(struct file *file, fl_owner_t id); -int vfsub_readdir(struct file *file, filldir_t filldir, void *arg); - -static inline loff_t vfsub_f_size_read(struct file *file) -{ - return i_size_read(file_inode(file)); -} - -static inline unsigned int vfsub_file_flags(struct file *file) -{ - unsigned int flags; - - spin_lock(&file->f_lock); - flags = file->f_flags; - spin_unlock(&file->f_lock); - - return flags; -} - -static inline void vfsub_file_accessed(struct file *h_file) -{ - file_accessed(h_file); - vfsub_update_h_iattr(&h_file->f_path, /*did*/NULL); /*ignore*/ -} - -static inline void vfsub_touch_atime(struct vfsmount *h_mnt, - struct dentry *h_dentry) -{ - struct path h_path = { - .dentry = h_dentry, - .mnt = h_mnt - }; - touch_atime(&h_path); - vfsub_update_h_iattr(&h_path, /*did*/NULL); /*ignore*/ -} - -static inline int vfsub_update_time(struct inode *h_inode, struct timespec *ts, - int flags) -{ - return update_time(h_inode, ts, flags); - /* no vfsub_update_h_iattr() since we don't have struct path */ -} - -long vfsub_splice_to(struct file *in, loff_t *ppos, - struct pipe_inode_info *pipe, size_t len, - unsigned int flags); -long vfsub_splice_from(struct pipe_inode_info *pipe, struct file *out, - loff_t *ppos, size_t len, unsigned int flags); - -static inline long vfsub_truncate(struct path *path, loff_t length) -{ - long err; - - lockdep_off(); - err = vfs_truncate(path, length); - lockdep_on(); - return err; -} - -int vfsub_trunc(struct path *h_path, loff_t length, unsigned int attr, - struct file *h_file); -int vfsub_fsync(struct file *file, struct path *path, int datasync); - -/* ---------------------------------------------------------------------- */ - -static inline loff_t vfsub_llseek(struct file *file, loff_t offset, int origin) -{ - loff_t err; - - lockdep_off(); - err = vfs_llseek(file, offset, origin); - lockdep_on(); - return err; -} - -/* ---------------------------------------------------------------------- */ - -/* dirty workaround for strict type of fmode_t */ -union vfsub_fmu { - fmode_t fm; - unsigned int ui; -}; - -static inline unsigned int vfsub_fmode_to_uint(fmode_t fm) -{ - union vfsub_fmu u = { - .fm = fm - }; - - BUILD_BUG_ON(sizeof(u.fm) != sizeof(u.ui)); - - return u.ui; -} - -static inline fmode_t vfsub_uint_to_fmode(unsigned int ui) -{ - union vfsub_fmu u = { - .ui = ui - }; - - return u.fm; -} - -/* ---------------------------------------------------------------------- */ - -int vfsub_sio_mkdir(struct inode *dir, struct path *path, int mode); -int vfsub_sio_rmdir(struct inode *dir, struct path *path); -int vfsub_sio_notify_change(struct path *path, struct iattr *ia); -int vfsub_notify_change(struct path *path, struct iattr *ia); -int vfsub_unlink(struct inode *dir, struct path *path, int force); - -/* ---------------------------------------------------------------------- */ - -static inline int vfsub_setxattr(struct dentry *dentry, const char *name, - const void *value, size_t size, int flags) -{ - int err; - - lockdep_off(); - err = vfs_setxattr(dentry, name, value, size, flags); - lockdep_on(); - - return err; -} - -static inline int vfsub_removexattr(struct dentry *dentry, const char *name) -{ - int err; - - lockdep_off(); - err = vfs_removexattr(dentry, name); - lockdep_on(); - - return err; -} - -#endif /* __KERNEL__ */ -#endif /* __AUFS_VFSUB_H__ */ diff --git a/fs/aufs/wbr_policy.c b/fs/aufs/wbr_policy.c deleted file mode 100644 index 391b0e00a70d53..00000000000000 --- a/fs/aufs/wbr_policy.c +++ /dev/null @@ -1,764 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * policies for selecting one among multiple writable branches - */ - -#include -#include "aufs.h" - -/* subset of cpup_attr() */ -static noinline_for_stack -int au_cpdown_attr(struct path *h_path, struct dentry *h_src) -{ - int err, sbits; - struct iattr ia; - struct inode *h_isrc; - - h_isrc = h_src->d_inode; - ia.ia_valid = ATTR_FORCE | ATTR_MODE | ATTR_UID | ATTR_GID; - ia.ia_mode = h_isrc->i_mode; - ia.ia_uid = h_isrc->i_uid; - ia.ia_gid = h_isrc->i_gid; - sbits = !!(ia.ia_mode & (S_ISUID | S_ISGID)); - au_cpup_attr_flags(h_path->dentry->d_inode, h_isrc->i_flags); - err = vfsub_sio_notify_change(h_path, &ia); - - /* is this nfs only? */ - if (!err && sbits && au_test_nfs(h_path->dentry->d_sb)) { - ia.ia_valid = ATTR_FORCE | ATTR_MODE; - ia.ia_mode = h_isrc->i_mode; - err = vfsub_sio_notify_change(h_path, &ia); - } - - return err; -} - -#define AuCpdown_PARENT_OPQ 1 -#define AuCpdown_WHED (1 << 1) -#define AuCpdown_MADE_DIR (1 << 2) -#define AuCpdown_DIROPQ (1 << 3) -#define au_ftest_cpdown(flags, name) ((flags) & AuCpdown_##name) -#define au_fset_cpdown(flags, name) \ - do { (flags) |= AuCpdown_##name; } while (0) -#define au_fclr_cpdown(flags, name) \ - do { (flags) &= ~AuCpdown_##name; } while (0) - -static int au_cpdown_dir_opq(struct dentry *dentry, aufs_bindex_t bdst, - unsigned int *flags) -{ - int err; - struct dentry *opq_dentry; - - opq_dentry = au_diropq_create(dentry, bdst); - err = PTR_ERR(opq_dentry); - if (IS_ERR(opq_dentry)) - goto out; - dput(opq_dentry); - au_fset_cpdown(*flags, DIROPQ); - -out: - return err; -} - -static int au_cpdown_dir_wh(struct dentry *dentry, struct dentry *h_parent, - struct inode *dir, aufs_bindex_t bdst) -{ - int err; - struct path h_path; - struct au_branch *br; - - br = au_sbr(dentry->d_sb, bdst); - h_path.dentry = au_wh_lkup(h_parent, &dentry->d_name, br); - err = PTR_ERR(h_path.dentry); - if (IS_ERR(h_path.dentry)) - goto out; - - err = 0; - if (h_path.dentry->d_inode) { - h_path.mnt = au_br_mnt(br); - err = au_wh_unlink_dentry(au_h_iptr(dir, bdst), &h_path, - dentry); - } - dput(h_path.dentry); - -out: - return err; -} - -static int au_cpdown_dir(struct dentry *dentry, aufs_bindex_t bdst, - struct au_pin *pin, - struct dentry *h_parent, void *arg) -{ - int err, rerr; - aufs_bindex_t bopq, bstart; - struct path h_path; - struct dentry *parent; - struct inode *h_dir, *h_inode, *inode, *dir; - unsigned int *flags = arg; - - bstart = au_dbstart(dentry); - /* dentry is di-locked */ - parent = dget_parent(dentry); - dir = parent->d_inode; - h_dir = h_parent->d_inode; - AuDebugOn(h_dir != au_h_iptr(dir, bdst)); - IMustLock(h_dir); - - err = au_lkup_neg(dentry, bdst, /*wh*/0); - if (unlikely(err < 0)) - goto out; - h_path.dentry = au_h_dptr(dentry, bdst); - h_path.mnt = au_sbr_mnt(dentry->d_sb, bdst); - err = vfsub_sio_mkdir(au_h_iptr(dir, bdst), &h_path, - S_IRWXU | S_IRUGO | S_IXUGO); - if (unlikely(err)) - goto out_put; - au_fset_cpdown(*flags, MADE_DIR); - - bopq = au_dbdiropq(dentry); - au_fclr_cpdown(*flags, WHED); - au_fclr_cpdown(*flags, DIROPQ); - if (au_dbwh(dentry) == bdst) - au_fset_cpdown(*flags, WHED); - if (!au_ftest_cpdown(*flags, PARENT_OPQ) && bopq <= bdst) - au_fset_cpdown(*flags, PARENT_OPQ); - h_inode = h_path.dentry->d_inode; - mutex_lock_nested(&h_inode->i_mutex, AuLsc_I_CHILD); - if (au_ftest_cpdown(*flags, WHED)) { - err = au_cpdown_dir_opq(dentry, bdst, flags); - if (unlikely(err)) { - mutex_unlock(&h_inode->i_mutex); - goto out_dir; - } - } - - err = au_cpdown_attr(&h_path, au_h_dptr(dentry, bstart)); - mutex_unlock(&h_inode->i_mutex); - if (unlikely(err)) - goto out_opq; - - if (au_ftest_cpdown(*flags, WHED)) { - err = au_cpdown_dir_wh(dentry, h_parent, dir, bdst); - if (unlikely(err)) - goto out_opq; - } - - inode = dentry->d_inode; - if (au_ibend(inode) < bdst) - au_set_ibend(inode, bdst); - au_set_h_iptr(inode, bdst, au_igrab(h_inode), - au_hi_flags(inode, /*isdir*/1)); - au_fhsm_wrote(dentry->d_sb, bdst, /*force*/0); - goto out; /* success */ - - /* revert */ -out_opq: - if (au_ftest_cpdown(*flags, DIROPQ)) { - mutex_lock_nested(&h_inode->i_mutex, AuLsc_I_CHILD); - rerr = au_diropq_remove(dentry, bdst); - mutex_unlock(&h_inode->i_mutex); - if (unlikely(rerr)) { - AuIOErr("failed removing diropq for %.*s b%d (%d)\n", - AuDLNPair(dentry), bdst, rerr); - err = -EIO; - goto out; - } - } -out_dir: - if (au_ftest_cpdown(*flags, MADE_DIR)) { - rerr = vfsub_sio_rmdir(au_h_iptr(dir, bdst), &h_path); - if (unlikely(rerr)) { - AuIOErr("failed removing %.*s b%d (%d)\n", - AuDLNPair(dentry), bdst, rerr); - err = -EIO; - } - } -out_put: - au_set_h_dptr(dentry, bdst, NULL); - if (au_dbend(dentry) == bdst) - au_update_dbend(dentry); -out: - dput(parent); - return err; -} - -int au_cpdown_dirs(struct dentry *dentry, aufs_bindex_t bdst) -{ - int err; - unsigned int flags; - - flags = 0; - err = au_cp_dirs(dentry, bdst, au_cpdown_dir, &flags); - - return err; -} - -/* ---------------------------------------------------------------------- */ - -/* policies for create */ - -int au_wbr_nonopq(struct dentry *dentry, aufs_bindex_t bindex) -{ - int err, i, j, ndentry; - aufs_bindex_t bopq; - struct au_dcsub_pages dpages; - struct au_dpage *dpage; - struct dentry **dentries, *parent, *d; - - err = au_dpages_init(&dpages, GFP_NOFS); - if (unlikely(err)) - goto out; - parent = dget_parent(dentry); - err = au_dcsub_pages_rev_aufs(&dpages, parent, /*do_include*/0); - if (unlikely(err)) - goto out_free; - - err = bindex; - for (i = 0; i < dpages.ndpage; i++) { - dpage = dpages.dpages + i; - dentries = dpage->dentries; - ndentry = dpage->ndentry; - for (j = 0; j < ndentry; j++) { - d = dentries[j]; - di_read_lock_parent2(d, !AuLock_IR); - bopq = au_dbdiropq(d); - di_read_unlock(d, !AuLock_IR); - if (bopq >= 0 && bopq < err) - err = bopq; - } - } - -out_free: - dput(parent); - au_dpages_free(&dpages); -out: - return err; -} - -static int au_wbr_bu(struct super_block *sb, aufs_bindex_t bindex) -{ - for (; bindex >= 0; bindex--) - if (!au_br_rdonly(au_sbr(sb, bindex))) - return bindex; - return -EROFS; -} - -/* top down parent */ -static int au_wbr_create_tdp(struct dentry *dentry, - unsigned int flags __maybe_unused) -{ - int err; - aufs_bindex_t bstart, bindex; - struct super_block *sb; - struct dentry *parent, *h_parent; - - sb = dentry->d_sb; - bstart = au_dbstart(dentry); - err = bstart; - if (!au_br_rdonly(au_sbr(sb, bstart))) - goto out; - - err = -EROFS; - parent = dget_parent(dentry); - for (bindex = au_dbstart(parent); bindex < bstart; bindex++) { - h_parent = au_h_dptr(parent, bindex); - if (!h_parent || !h_parent->d_inode) - continue; - - if (!au_br_rdonly(au_sbr(sb, bindex))) { - err = bindex; - break; - } - } - dput(parent); - - /* bottom up here */ - if (unlikely(err < 0)) { - err = au_wbr_bu(sb, bstart - 1); - if (err >= 0) - err = au_wbr_nonopq(dentry, err); - } - -out: - AuDbg("b%d\n", err); - return err; -} - -/* ---------------------------------------------------------------------- */ - -/* an exception for the policy other than tdp */ -static int au_wbr_create_exp(struct dentry *dentry) -{ - int err; - aufs_bindex_t bwh, bdiropq; - struct dentry *parent; - - err = -1; - bwh = au_dbwh(dentry); - parent = dget_parent(dentry); - bdiropq = au_dbdiropq(parent); - if (bwh >= 0) { - if (bdiropq >= 0) - err = min(bdiropq, bwh); - else - err = bwh; - AuDbg("%d\n", err); - } else if (bdiropq >= 0) { - err = bdiropq; - AuDbg("%d\n", err); - } - dput(parent); - - if (err >= 0) - err = au_wbr_nonopq(dentry, err); - - if (err >= 0 && au_br_rdonly(au_sbr(dentry->d_sb, err))) - err = -1; - - AuDbg("%d\n", err); - return err; -} - -/* ---------------------------------------------------------------------- */ - -/* round robin */ -static int au_wbr_create_init_rr(struct super_block *sb) -{ - int err; - - err = au_wbr_bu(sb, au_sbend(sb)); - atomic_set(&au_sbi(sb)->si_wbr_rr_next, -err); /* less important */ - /* smp_mb(); */ - - AuDbg("b%d\n", err); - return err; -} - -static int au_wbr_create_rr(struct dentry *dentry, unsigned int flags) -{ - int err, nbr; - unsigned int u; - aufs_bindex_t bindex, bend; - struct super_block *sb; - atomic_t *next; - - err = au_wbr_create_exp(dentry); - if (err >= 0) - goto out; - - sb = dentry->d_sb; - next = &au_sbi(sb)->si_wbr_rr_next; - bend = au_sbend(sb); - nbr = bend + 1; - for (bindex = 0; bindex <= bend; bindex++) { - if (!au_ftest_wbr(flags, DIR)) { - err = atomic_dec_return(next) + 1; - /* modulo for 0 is meaningless */ - if (unlikely(!err)) - err = atomic_dec_return(next) + 1; - } else - err = atomic_read(next); - AuDbg("%d\n", err); - u = err; - err = u % nbr; - AuDbg("%d\n", err); - if (!au_br_rdonly(au_sbr(sb, err))) - break; - err = -EROFS; - } - - if (err >= 0) - err = au_wbr_nonopq(dentry, err); - -out: - AuDbg("%d\n", err); - return err; -} - -/* ---------------------------------------------------------------------- */ - -/* most free space */ -static void au_mfs(struct dentry *dentry, struct dentry *parent) -{ - struct super_block *sb; - struct au_branch *br; - struct au_wbr_mfs *mfs; - struct dentry *h_parent; - aufs_bindex_t bindex, bend; - int err; - unsigned long long b, bavail; - struct path h_path; - /* reduce the stack usage */ - struct kstatfs *st; - - st = kmalloc(sizeof(*st), GFP_NOFS); - if (unlikely(!st)) { - AuWarn1("failed updating mfs(%d), ignored\n", -ENOMEM); - return; - } - - bavail = 0; - sb = dentry->d_sb; - mfs = &au_sbi(sb)->si_wbr_mfs; - MtxMustLock(&mfs->mfs_lock); - mfs->mfs_bindex = -EROFS; - mfs->mfsrr_bytes = 0; - if (!parent) { - bindex = 0; - bend = au_sbend(sb); - } else { - bindex = au_dbstart(parent); - bend = au_dbtaildir(parent); - } - - for (; bindex <= bend; bindex++) { - if (parent) { - h_parent = au_h_dptr(parent, bindex); - if (!h_parent || !h_parent->d_inode) - continue; - } - br = au_sbr(sb, bindex); - if (au_br_rdonly(br)) - continue; - - /* sb->s_root for NFS is unreliable */ - h_path.mnt = au_br_mnt(br); - h_path.dentry = h_path.mnt->mnt_root; - err = vfs_statfs(&h_path, st); - if (unlikely(err)) { - AuWarn1("failed statfs, b%d, %d\n", bindex, err); - continue; - } - - /* when the available size is equal, select the lower one */ - BUILD_BUG_ON(sizeof(b) < sizeof(st->f_bavail) - || sizeof(b) < sizeof(st->f_bsize)); - b = st->f_bavail * st->f_bsize; - br->br_wbr->wbr_bytes = b; - if (b >= bavail) { - bavail = b; - mfs->mfs_bindex = bindex; - mfs->mfs_jiffy = jiffies; - } - } - - mfs->mfsrr_bytes = bavail; - AuDbg("b%d\n", mfs->mfs_bindex); - kfree(st); -} - -static int au_wbr_create_mfs(struct dentry *dentry, unsigned int flags) -{ - int err; - struct dentry *parent; - struct super_block *sb; - struct au_wbr_mfs *mfs; - - err = au_wbr_create_exp(dentry); - if (err >= 0) - goto out; - - sb = dentry->d_sb; - parent = NULL; - if (au_ftest_wbr(flags, PARENT)) - parent = dget_parent(dentry); - mfs = &au_sbi(sb)->si_wbr_mfs; - mutex_lock(&mfs->mfs_lock); - if (time_after(jiffies, mfs->mfs_jiffy + mfs->mfs_expire) - || mfs->mfs_bindex < 0 - || au_br_rdonly(au_sbr(sb, mfs->mfs_bindex))) - au_mfs(dentry, parent); - mutex_unlock(&mfs->mfs_lock); - err = mfs->mfs_bindex; - dput(parent); - - if (err >= 0) - err = au_wbr_nonopq(dentry, err); - -out: - AuDbg("b%d\n", err); - return err; -} - -static int au_wbr_create_init_mfs(struct super_block *sb) -{ - struct au_wbr_mfs *mfs; - - mfs = &au_sbi(sb)->si_wbr_mfs; - mutex_init(&mfs->mfs_lock); - mfs->mfs_jiffy = 0; - mfs->mfs_bindex = -EROFS; - - return 0; -} - -static int au_wbr_create_fin_mfs(struct super_block *sb __maybe_unused) -{ - mutex_destroy(&au_sbi(sb)->si_wbr_mfs.mfs_lock); - return 0; -} - -/* ---------------------------------------------------------------------- */ - -/* most free space and then round robin */ -static int au_wbr_create_mfsrr(struct dentry *dentry, unsigned int flags) -{ - int err; - struct au_wbr_mfs *mfs; - - err = au_wbr_create_mfs(dentry, flags); - if (err >= 0) { - mfs = &au_sbi(dentry->d_sb)->si_wbr_mfs; - mutex_lock(&mfs->mfs_lock); - if (mfs->mfsrr_bytes < mfs->mfsrr_watermark) - err = au_wbr_create_rr(dentry, flags); - mutex_unlock(&mfs->mfs_lock); - } - - AuDbg("b%d\n", err); - return err; -} - -static int au_wbr_create_init_mfsrr(struct super_block *sb) -{ - int err; - - au_wbr_create_init_mfs(sb); /* ignore */ - err = au_wbr_create_init_rr(sb); - - return err; -} - -/* ---------------------------------------------------------------------- */ - -/* top down parent and most free space */ -static int au_wbr_create_pmfs(struct dentry *dentry, unsigned int flags) -{ - int err, e2; - unsigned long long b; - aufs_bindex_t bindex, bstart, bend; - struct super_block *sb; - struct dentry *parent, *h_parent; - struct au_branch *br; - - err = au_wbr_create_tdp(dentry, flags); - if (unlikely(err < 0)) - goto out; - parent = dget_parent(dentry); - bstart = au_dbstart(parent); - bend = au_dbtaildir(parent); - if (bstart == bend) - goto out_parent; /* success */ - - e2 = au_wbr_create_mfs(dentry, flags); - if (e2 < 0) - goto out_parent; /* success */ - - /* when the available size is equal, select upper one */ - sb = dentry->d_sb; - br = au_sbr(sb, err); - b = br->br_wbr->wbr_bytes; - AuDbg("b%d, %llu\n", err, b); - - for (bindex = bstart; bindex <= bend; bindex++) { - h_parent = au_h_dptr(parent, bindex); - if (!h_parent || !h_parent->d_inode) - continue; - - br = au_sbr(sb, bindex); - if (!au_br_rdonly(br) && br->br_wbr->wbr_bytes > b) { - b = br->br_wbr->wbr_bytes; - err = bindex; - AuDbg("b%d, %llu\n", err, b); - } - } - - if (err >= 0) - err = au_wbr_nonopq(dentry, err); - -out_parent: - dput(parent); -out: - AuDbg("b%d\n", err); - return err; -} - -/* ---------------------------------------------------------------------- */ - -/* - * - top down parent - * - most free space with parent - * - most free space round-robin regardless parent - */ -static int au_wbr_create_pmfsrr(struct dentry *dentry, unsigned int flags) -{ - int err; - unsigned long long watermark; - struct super_block *sb; - struct au_branch *br; - struct au_wbr_mfs *mfs; - - err = au_wbr_create_pmfs(dentry, flags | AuWbr_PARENT); - if (unlikely(err < 0)) - goto out; - - sb = dentry->d_sb; - br = au_sbr(sb, err); - mfs = &au_sbi(sb)->si_wbr_mfs; - mutex_lock(&mfs->mfs_lock); - watermark = mfs->mfsrr_watermark; - mutex_unlock(&mfs->mfs_lock); - if (br->br_wbr->wbr_bytes < watermark) - /* regardless the parent dir */ - err = au_wbr_create_mfsrr(dentry, flags); - -out: - AuDbg("b%d\n", err); - return err; -} - -/* ---------------------------------------------------------------------- */ - -/* policies for copyup */ - -/* top down parent */ -static int au_wbr_copyup_tdp(struct dentry *dentry) -{ - return au_wbr_create_tdp(dentry, /*flags, anything is ok*/0); -} - -/* bottom up parent */ -static int au_wbr_copyup_bup(struct dentry *dentry) -{ - int err; - aufs_bindex_t bindex, bstart; - struct dentry *parent, *h_parent; - struct super_block *sb; - - err = -EROFS; - sb = dentry->d_sb; - parent = dget_parent(dentry); - bstart = au_dbstart(parent); - for (bindex = au_dbstart(dentry); bindex >= bstart; bindex--) { - h_parent = au_h_dptr(parent, bindex); - if (!h_parent || !h_parent->d_inode) - continue; - - if (!au_br_rdonly(au_sbr(sb, bindex))) { - err = bindex; - break; - } - } - dput(parent); - - /* bottom up here */ - if (unlikely(err < 0)) - err = au_wbr_bu(sb, bstart - 1); - - AuDbg("b%d\n", err); - return err; -} - -/* bottom up */ -int au_wbr_do_copyup_bu(struct dentry *dentry, aufs_bindex_t bstart) -{ - int err; - - err = au_wbr_bu(dentry->d_sb, bstart); - AuDbg("b%d\n", err); - if (err > bstart) - err = au_wbr_nonopq(dentry, err); - - AuDbg("b%d\n", err); - return err; -} - -static int au_wbr_copyup_bu(struct dentry *dentry) -{ - int err; - aufs_bindex_t bstart; - - bstart = au_dbstart(dentry); - err = au_wbr_do_copyup_bu(dentry, bstart); - return err; -} - -/* ---------------------------------------------------------------------- */ - -struct au_wbr_copyup_operations au_wbr_copyup_ops[] = { - [AuWbrCopyup_TDP] = { - .copyup = au_wbr_copyup_tdp - }, - [AuWbrCopyup_BUP] = { - .copyup = au_wbr_copyup_bup - }, - [AuWbrCopyup_BU] = { - .copyup = au_wbr_copyup_bu - } -}; - -struct au_wbr_create_operations au_wbr_create_ops[] = { - [AuWbrCreate_TDP] = { - .create = au_wbr_create_tdp - }, - [AuWbrCreate_RR] = { - .create = au_wbr_create_rr, - .init = au_wbr_create_init_rr - }, - [AuWbrCreate_MFS] = { - .create = au_wbr_create_mfs, - .init = au_wbr_create_init_mfs, - .fin = au_wbr_create_fin_mfs - }, - [AuWbrCreate_MFSV] = { - .create = au_wbr_create_mfs, - .init = au_wbr_create_init_mfs, - .fin = au_wbr_create_fin_mfs - }, - [AuWbrCreate_MFSRR] = { - .create = au_wbr_create_mfsrr, - .init = au_wbr_create_init_mfsrr, - .fin = au_wbr_create_fin_mfs - }, - [AuWbrCreate_MFSRRV] = { - .create = au_wbr_create_mfsrr, - .init = au_wbr_create_init_mfsrr, - .fin = au_wbr_create_fin_mfs - }, - [AuWbrCreate_PMFS] = { - .create = au_wbr_create_pmfs, - .init = au_wbr_create_init_mfs, - .fin = au_wbr_create_fin_mfs - }, - [AuWbrCreate_PMFSV] = { - .create = au_wbr_create_pmfs, - .init = au_wbr_create_init_mfs, - .fin = au_wbr_create_fin_mfs - }, - [AuWbrCreate_PMFSRR] = { - .create = au_wbr_create_pmfsrr, - .init = au_wbr_create_init_mfsrr, - .fin = au_wbr_create_fin_mfs - }, - [AuWbrCreate_PMFSRRV] = { - .create = au_wbr_create_pmfsrr, - .init = au_wbr_create_init_mfsrr, - .fin = au_wbr_create_fin_mfs - } -}; diff --git a/fs/aufs/whout.c b/fs/aufs/whout.c deleted file mode 100644 index 8537a1ca3feb0d..00000000000000 --- a/fs/aufs/whout.c +++ /dev/null @@ -1,1025 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * whiteout for logical deletion and opaque directory - */ - -#include "aufs.h" - -#define WH_MASK S_IRUGO - -/* - * If a directory contains this file, then it is opaque. We start with the - * .wh. flag so that it is blocked by lookup. - */ -static struct qstr diropq_name = QSTR_INIT(AUFS_WH_DIROPQ, - sizeof(AUFS_WH_DIROPQ) - 1); - -/* - * generate whiteout name, which is NOT terminated by NULL. - * @name: original d_name.name - * @len: original d_name.len - * @wh: whiteout qstr - * returns zero when succeeds, otherwise error. - * succeeded value as wh->name should be freed by kfree(). - */ -int au_wh_name_alloc(struct qstr *wh, const struct qstr *name) -{ - char *p; - - if (unlikely(name->len > PATH_MAX - AUFS_WH_PFX_LEN)) - return -ENAMETOOLONG; - - wh->len = name->len + AUFS_WH_PFX_LEN; - p = kmalloc(wh->len, GFP_NOFS); - wh->name = p; - if (p) { - memcpy(p, AUFS_WH_PFX, AUFS_WH_PFX_LEN); - memcpy(p + AUFS_WH_PFX_LEN, name->name, name->len); - /* smp_mb(); */ - return 0; - } - return -ENOMEM; -} - -/* ---------------------------------------------------------------------- */ - -/* - * test if the @wh_name exists under @h_parent. - * @try_sio specifies the necessary of super-io. - */ -int au_wh_test(struct dentry *h_parent, struct qstr *wh_name, int try_sio) -{ - int err; - struct dentry *wh_dentry; - - if (!try_sio) - wh_dentry = vfsub_lkup_one(wh_name, h_parent); - else - wh_dentry = au_sio_lkup_one(wh_name, h_parent); - err = PTR_ERR(wh_dentry); - if (IS_ERR(wh_dentry)) - goto out; - - err = 0; - if (!wh_dentry->d_inode) - goto out_wh; /* success */ - - err = 1; - if (S_ISREG(wh_dentry->d_inode->i_mode)) - goto out_wh; /* success */ - - err = -EIO; - AuIOErr("%.*s Invalid whiteout entry type 0%o.\n", - AuDLNPair(wh_dentry), wh_dentry->d_inode->i_mode); - -out_wh: - dput(wh_dentry); -out: - return err; -} - -/* - * test if the @h_dentry sets opaque or not. - */ -int au_diropq_test(struct dentry *h_dentry) -{ - int err; - struct inode *h_dir; - - h_dir = h_dentry->d_inode; - err = au_wh_test(h_dentry, &diropq_name, - au_test_h_perm_sio(h_dir, MAY_EXEC)); - return err; -} - -/* - * returns a negative dentry whose name is unique and temporary. - */ -struct dentry *au_whtmp_lkup(struct dentry *h_parent, struct au_branch *br, - struct qstr *prefix) -{ - struct dentry *dentry; - int i; - char defname[NAME_MAX - AUFS_MAX_NAMELEN + DNAME_INLINE_LEN + 1], - *name, *p; - /* strict atomic_t is unnecessary here */ - static unsigned short cnt; - struct qstr qs; - - BUILD_BUG_ON(sizeof(cnt) * 2 > AUFS_WH_TMP_LEN); - - name = defname; - qs.len = sizeof(defname) - DNAME_INLINE_LEN + prefix->len - 1; - if (unlikely(prefix->len > DNAME_INLINE_LEN)) { - dentry = ERR_PTR(-ENAMETOOLONG); - if (unlikely(qs.len > NAME_MAX)) - goto out; - dentry = ERR_PTR(-ENOMEM); - name = kmalloc(qs.len + 1, GFP_NOFS); - if (unlikely(!name)) - goto out; - } - - /* doubly whiteout-ed */ - memcpy(name, AUFS_WH_PFX AUFS_WH_PFX, AUFS_WH_PFX_LEN * 2); - p = name + AUFS_WH_PFX_LEN * 2; - memcpy(p, prefix->name, prefix->len); - p += prefix->len; - *p++ = '.'; - AuDebugOn(name + qs.len + 1 - p <= AUFS_WH_TMP_LEN); - - qs.name = name; - for (i = 0; i < 3; i++) { - sprintf(p, "%.*x", AUFS_WH_TMP_LEN, cnt++); - dentry = au_sio_lkup_one(&qs, h_parent); - if (IS_ERR(dentry) || !dentry->d_inode) - goto out_name; - dput(dentry); - } - /* pr_warn("could not get random name\n"); */ - dentry = ERR_PTR(-EEXIST); - AuDbg("%.*s\n", AuLNPair(&qs)); - BUG(); - -out_name: - if (name != defname) - kfree(name); -out: - AuTraceErrPtr(dentry); - return dentry; -} - -/* - * rename the @h_dentry on @br to the whiteouted temporary name. - */ -int au_whtmp_ren(struct dentry *h_dentry, struct au_branch *br) -{ - int err; - struct path h_path = { - .mnt = au_br_mnt(br) - }; - struct inode *h_dir; - struct dentry *h_parent; - - h_parent = h_dentry->d_parent; /* dir inode is locked */ - h_dir = h_parent->d_inode; - IMustLock(h_dir); - - h_path.dentry = au_whtmp_lkup(h_parent, br, &h_dentry->d_name); - err = PTR_ERR(h_path.dentry); - if (IS_ERR(h_path.dentry)) - goto out; - - /* under the same dir, no need to lock_rename() */ - err = vfsub_rename(h_dir, h_dentry, h_dir, &h_path); - AuTraceErr(err); - dput(h_path.dentry); - -out: - AuTraceErr(err); - return err; -} - -/* ---------------------------------------------------------------------- */ -/* - * functions for removing a whiteout - */ - -static int do_unlink_wh(struct inode *h_dir, struct path *h_path) -{ - int force; - - /* - * forces superio when the dir has a sticky bit. - * this may be a violation of unix fs semantics. - */ - force = (h_dir->i_mode & S_ISVTX) - && !uid_eq(current_fsuid(), h_path->dentry->d_inode->i_uid); - return vfsub_unlink(h_dir, h_path, force); -} - -int au_wh_unlink_dentry(struct inode *h_dir, struct path *h_path, - struct dentry *dentry) -{ - int err; - - err = do_unlink_wh(h_dir, h_path); - if (!err && dentry) - au_set_dbwh(dentry, -1); - - return err; -} - -static int unlink_wh_name(struct dentry *h_parent, struct qstr *wh, - struct au_branch *br) -{ - int err; - struct path h_path = { - .mnt = au_br_mnt(br) - }; - - err = 0; - h_path.dentry = vfsub_lkup_one(wh, h_parent); - if (IS_ERR(h_path.dentry)) - err = PTR_ERR(h_path.dentry); - else { - if (h_path.dentry->d_inode - && S_ISREG(h_path.dentry->d_inode->i_mode)) - err = do_unlink_wh(h_parent->d_inode, &h_path); - dput(h_path.dentry); - } - - return err; -} - -/* ---------------------------------------------------------------------- */ -/* - * initialize/clean whiteout for a branch - */ - -static void au_wh_clean(struct inode *h_dir, struct path *whpath, - const int isdir) -{ - int err; - - if (!whpath->dentry->d_inode) - return; - - if (isdir) - err = vfsub_rmdir(h_dir, whpath); - else - err = vfsub_unlink(h_dir, whpath, /*force*/0); - if (unlikely(err)) - pr_warn("failed removing %.*s (%d), ignored.\n", - AuDLNPair(whpath->dentry), err); -} - -static int test_linkable(struct dentry *h_root) -{ - struct inode *h_dir = h_root->d_inode; - - if (h_dir->i_op->link) - return 0; - - pr_err("%.*s (%s) doesn't support link(2), use noplink and rw+nolwh\n", - AuDLNPair(h_root), au_sbtype(h_root->d_sb)); - return -ENOSYS; -} - -/* todo: should this mkdir be done in /sbin/mount.aufs helper? */ -static int au_whdir(struct inode *h_dir, struct path *path) -{ - int err; - - err = -EEXIST; - if (!path->dentry->d_inode) { - int mode = S_IRWXU; - - if (au_test_nfs(path->dentry->d_sb)) - mode |= S_IXUGO; - err = vfsub_mkdir(h_dir, path, mode); - } else if (S_ISDIR(path->dentry->d_inode->i_mode)) - err = 0; - else - pr_err("unknown %.*s exists\n", AuDLNPair(path->dentry)); - - return err; -} - -struct au_wh_base { - const struct qstr *name; - struct dentry *dentry; -}; - -static void au_wh_init_ro(struct inode *h_dir, struct au_wh_base base[], - struct path *h_path) -{ - h_path->dentry = base[AuBrWh_BASE].dentry; - au_wh_clean(h_dir, h_path, /*isdir*/0); - h_path->dentry = base[AuBrWh_PLINK].dentry; - au_wh_clean(h_dir, h_path, /*isdir*/1); - h_path->dentry = base[AuBrWh_ORPH].dentry; - au_wh_clean(h_dir, h_path, /*isdir*/1); -} - -/* - * returns tri-state, - * minus: error, caller should print the message - * zero: succuess - * plus: error, caller should NOT print the message - */ -static int au_wh_init_rw_nolink(struct dentry *h_root, struct au_wbr *wbr, - int do_plink, struct au_wh_base base[], - struct path *h_path) -{ - int err; - struct inode *h_dir; - - h_dir = h_root->d_inode; - h_path->dentry = base[AuBrWh_BASE].dentry; - au_wh_clean(h_dir, h_path, /*isdir*/0); - h_path->dentry = base[AuBrWh_PLINK].dentry; - if (do_plink) { - err = test_linkable(h_root); - if (unlikely(err)) { - err = 1; - goto out; - } - - err = au_whdir(h_dir, h_path); - if (unlikely(err)) - goto out; - wbr->wbr_plink = dget(base[AuBrWh_PLINK].dentry); - } else - au_wh_clean(h_dir, h_path, /*isdir*/1); - h_path->dentry = base[AuBrWh_ORPH].dentry; - err = au_whdir(h_dir, h_path); - if (unlikely(err)) - goto out; - wbr->wbr_orph = dget(base[AuBrWh_ORPH].dentry); - -out: - return err; -} - -/* - * for the moment, aufs supports the branch filesystem which does not support - * link(2). testing on FAT which does not support i_op->setattr() fully either, - * copyup failed. finally, such filesystem will not be used as the writable - * branch. - * - * returns tri-state, see above. - */ -static int au_wh_init_rw(struct dentry *h_root, struct au_wbr *wbr, - int do_plink, struct au_wh_base base[], - struct path *h_path) -{ - int err; - struct inode *h_dir; - - WbrWhMustWriteLock(wbr); - - err = test_linkable(h_root); - if (unlikely(err)) { - err = 1; - goto out; - } - - /* - * todo: should this create be done in /sbin/mount.aufs helper? - */ - err = -EEXIST; - h_dir = h_root->d_inode; - if (!base[AuBrWh_BASE].dentry->d_inode) { - h_path->dentry = base[AuBrWh_BASE].dentry; - err = vfsub_create(h_dir, h_path, WH_MASK, /*want_excl*/true); - } else if (S_ISREG(base[AuBrWh_BASE].dentry->d_inode->i_mode)) - err = 0; - else - pr_err("unknown %.*s/%.*s exists\n", - AuDLNPair(h_root), AuDLNPair(base[AuBrWh_BASE].dentry)); - if (unlikely(err)) - goto out; - - h_path->dentry = base[AuBrWh_PLINK].dentry; - if (do_plink) { - err = au_whdir(h_dir, h_path); - if (unlikely(err)) - goto out; - wbr->wbr_plink = dget(base[AuBrWh_PLINK].dentry); - } else - au_wh_clean(h_dir, h_path, /*isdir*/1); - wbr->wbr_whbase = dget(base[AuBrWh_BASE].dentry); - - h_path->dentry = base[AuBrWh_ORPH].dentry; - err = au_whdir(h_dir, h_path); - if (unlikely(err)) - goto out; - wbr->wbr_orph = dget(base[AuBrWh_ORPH].dentry); - -out: - return err; -} - -/* - * initialize the whiteout base file/dir for @br. - */ -int au_wh_init(struct au_branch *br, struct super_block *sb) -{ - int err, i; - const unsigned char do_plink - = !!au_opt_test(au_mntflags(sb), PLINK); - struct inode *h_dir; - struct path path = br->br_path; - struct dentry *h_root = path.dentry; - struct au_wbr *wbr = br->br_wbr; - static const struct qstr base_name[] = { - [AuBrWh_BASE] = QSTR_INIT(AUFS_BASE_NAME, - sizeof(AUFS_BASE_NAME) - 1), - [AuBrWh_PLINK] = QSTR_INIT(AUFS_PLINKDIR_NAME, - sizeof(AUFS_PLINKDIR_NAME) - 1), - [AuBrWh_ORPH] = QSTR_INIT(AUFS_ORPHDIR_NAME, - sizeof(AUFS_ORPHDIR_NAME) - 1) - }; - struct au_wh_base base[] = { - [AuBrWh_BASE] = { - .name = base_name + AuBrWh_BASE, - .dentry = NULL - }, - [AuBrWh_PLINK] = { - .name = base_name + AuBrWh_PLINK, - .dentry = NULL - }, - [AuBrWh_ORPH] = { - .name = base_name + AuBrWh_ORPH, - .dentry = NULL - } - }; - - if (wbr) - WbrWhMustWriteLock(wbr); - - for (i = 0; i < AuBrWh_Last; i++) { - /* doubly whiteouted */ - struct dentry *d; - - d = au_wh_lkup(h_root, (void *)base[i].name, br); - err = PTR_ERR(d); - if (IS_ERR(d)) - goto out; - - base[i].dentry = d; - AuDebugOn(wbr - && wbr->wbr_wh[i] - && wbr->wbr_wh[i] != base[i].dentry); - } - - if (wbr) - for (i = 0; i < AuBrWh_Last; i++) { - dput(wbr->wbr_wh[i]); - wbr->wbr_wh[i] = NULL; - } - - err = 0; - if (!au_br_writable(br->br_perm)) { - h_dir = h_root->d_inode; - au_wh_init_ro(h_dir, base, &path); - } else if (!au_br_wh_linkable(br->br_perm)) { - err = au_wh_init_rw_nolink(h_root, wbr, do_plink, base, &path); - if (err > 0) - goto out; - else if (err) - goto out_err; - } else { - err = au_wh_init_rw(h_root, wbr, do_plink, base, &path); - if (err > 0) - goto out; - else if (err) - goto out_err; - } - goto out; /* success */ - -out_err: - pr_err("an error(%d) on the writable branch %.*s(%s)\n", - err, AuDLNPair(h_root), au_sbtype(h_root->d_sb)); -out: - for (i = 0; i < AuBrWh_Last; i++) - dput(base[i].dentry); - return err; -} - -/* ---------------------------------------------------------------------- */ -/* - * whiteouts are all hard-linked usually. - * when its link count reaches a ceiling, we create a new whiteout base - * asynchronously. - */ - -struct reinit_br_wh { - struct super_block *sb; - struct au_branch *br; -}; - -static void reinit_br_wh(void *arg) -{ - int err; - aufs_bindex_t bindex; - struct path h_path; - struct reinit_br_wh *a = arg; - struct au_wbr *wbr; - struct inode *dir; - struct dentry *h_root; - struct au_hinode *hdir; - - err = 0; - wbr = a->br->br_wbr; - /* big aufs lock */ - si_noflush_write_lock(a->sb); - if (!au_br_writable(a->br->br_perm)) - goto out; - bindex = au_br_index(a->sb, a->br->br_id); - if (unlikely(bindex < 0)) - goto out; - - di_read_lock_parent(a->sb->s_root, AuLock_IR); - dir = a->sb->s_root->d_inode; - hdir = au_hi(dir, bindex); - h_root = au_h_dptr(a->sb->s_root, bindex); - AuDebugOn(h_root != au_br_dentry(a->br)); - - au_hn_imtx_lock_nested(hdir, AuLsc_I_PARENT); - wbr_wh_write_lock(wbr); - err = au_h_verify(wbr->wbr_whbase, au_opt_udba(a->sb), hdir->hi_inode, - h_root, a->br); - if (!err) { - h_path.dentry = wbr->wbr_whbase; - h_path.mnt = au_br_mnt(a->br); - err = vfsub_unlink(hdir->hi_inode, &h_path, /*force*/0); - } else { - pr_warn("%.*s is moved, ignored\n", - AuDLNPair(wbr->wbr_whbase)); - err = 0; - } - dput(wbr->wbr_whbase); - wbr->wbr_whbase = NULL; - if (!err) - err = au_wh_init(a->br, a->sb); - wbr_wh_write_unlock(wbr); - au_hn_imtx_unlock(hdir); - di_read_unlock(a->sb->s_root, AuLock_IR); - if (!err) - au_fhsm_wrote(a->sb, bindex, /*force*/0); - -out: - if (wbr) - atomic_dec(&wbr->wbr_wh_running); - atomic_dec(&a->br->br_count); - si_write_unlock(a->sb); - au_nwt_done(&au_sbi(a->sb)->si_nowait); - kfree(arg); - if (unlikely(err)) - AuIOErr("err %d\n", err); -} - -static void kick_reinit_br_wh(struct super_block *sb, struct au_branch *br) -{ - int do_dec, wkq_err; - struct reinit_br_wh *arg; - - do_dec = 1; - if (atomic_inc_return(&br->br_wbr->wbr_wh_running) != 1) - goto out; - - /* ignore ENOMEM */ - arg = kmalloc(sizeof(*arg), GFP_NOFS); - if (arg) { - /* - * dec(wh_running), kfree(arg) and dec(br_count) - * in reinit function - */ - arg->sb = sb; - arg->br = br; - atomic_inc(&br->br_count); - wkq_err = au_wkq_nowait(reinit_br_wh, arg, sb, /*flags*/0); - if (unlikely(wkq_err)) { - atomic_dec(&br->br_wbr->wbr_wh_running); - atomic_dec(&br->br_count); - kfree(arg); - } - do_dec = 0; - } - -out: - if (do_dec) - atomic_dec(&br->br_wbr->wbr_wh_running); -} - -/* ---------------------------------------------------------------------- */ - -/* - * create the whiteout @wh. - */ -static int link_or_create_wh(struct super_block *sb, aufs_bindex_t bindex, - struct dentry *wh) -{ - int err; - struct path h_path = { - .dentry = wh - }; - struct au_branch *br; - struct au_wbr *wbr; - struct dentry *h_parent; - struct inode *h_dir; - - h_parent = wh->d_parent; /* dir inode is locked */ - h_dir = h_parent->d_inode; - IMustLock(h_dir); - - br = au_sbr(sb, bindex); - h_path.mnt = au_br_mnt(br); - wbr = br->br_wbr; - wbr_wh_read_lock(wbr); - if (wbr->wbr_whbase) { - err = vfsub_link(wbr->wbr_whbase, h_dir, &h_path); - if (!err || err != -EMLINK) - goto out; - - /* link count full. re-initialize br_whbase. */ - kick_reinit_br_wh(sb, br); - } - - /* return this error in this context */ - err = vfsub_create(h_dir, &h_path, WH_MASK, /*want_excl*/true); - if (!err) - au_fhsm_wrote(sb, bindex, /*force*/0); - -out: - wbr_wh_read_unlock(wbr); - return err; -} - -/* ---------------------------------------------------------------------- */ - -/* - * create or remove the diropq. - */ -static struct dentry *do_diropq(struct dentry *dentry, aufs_bindex_t bindex, - unsigned int flags) -{ - struct dentry *opq_dentry, *h_dentry; - struct super_block *sb; - struct au_branch *br; - int err; - - sb = dentry->d_sb; - br = au_sbr(sb, bindex); - h_dentry = au_h_dptr(dentry, bindex); - opq_dentry = vfsub_lkup_one(&diropq_name, h_dentry); - if (IS_ERR(opq_dentry)) - goto out; - - if (au_ftest_diropq(flags, CREATE)) { - err = link_or_create_wh(sb, bindex, opq_dentry); - if (!err) { - au_set_dbdiropq(dentry, bindex); - goto out; /* success */ - } - } else { - struct path tmp = { - .dentry = opq_dentry, - .mnt = au_br_mnt(br) - }; - err = do_unlink_wh(au_h_iptr(dentry->d_inode, bindex), &tmp); - if (!err) - au_set_dbdiropq(dentry, -1); - } - dput(opq_dentry); - opq_dentry = ERR_PTR(err); - -out: - return opq_dentry; -} - -struct do_diropq_args { - struct dentry **errp; - struct dentry *dentry; - aufs_bindex_t bindex; - unsigned int flags; -}; - -static void call_do_diropq(void *args) -{ - struct do_diropq_args *a = args; - *a->errp = do_diropq(a->dentry, a->bindex, a->flags); -} - -struct dentry *au_diropq_sio(struct dentry *dentry, aufs_bindex_t bindex, - unsigned int flags) -{ - struct dentry *diropq, *h_dentry; - - h_dentry = au_h_dptr(dentry, bindex); - if (!au_test_h_perm_sio(h_dentry->d_inode, MAY_EXEC | MAY_WRITE)) - diropq = do_diropq(dentry, bindex, flags); - else { - int wkq_err; - struct do_diropq_args args = { - .errp = &diropq, - .dentry = dentry, - .bindex = bindex, - .flags = flags - }; - - wkq_err = au_wkq_wait(call_do_diropq, &args); - if (unlikely(wkq_err)) - diropq = ERR_PTR(wkq_err); - } - - return diropq; -} - -/* ---------------------------------------------------------------------- */ - -/* - * lookup whiteout dentry. - * @h_parent: lower parent dentry which must exist and be locked - * @base_name: name of dentry which will be whiteouted - * returns dentry for whiteout. - */ -struct dentry *au_wh_lkup(struct dentry *h_parent, struct qstr *base_name, - struct au_branch *br) -{ - int err; - struct qstr wh_name; - struct dentry *wh_dentry; - - err = au_wh_name_alloc(&wh_name, base_name); - wh_dentry = ERR_PTR(err); - if (!err) { - wh_dentry = vfsub_lkup_one(&wh_name, h_parent); - kfree(wh_name.name); - } - return wh_dentry; -} - -/* - * link/create a whiteout for @dentry on @bindex. - */ -struct dentry *au_wh_create(struct dentry *dentry, aufs_bindex_t bindex, - struct dentry *h_parent) -{ - struct dentry *wh_dentry; - struct super_block *sb; - int err; - - sb = dentry->d_sb; - wh_dentry = au_wh_lkup(h_parent, &dentry->d_name, au_sbr(sb, bindex)); - if (!IS_ERR(wh_dentry) && !wh_dentry->d_inode) { - err = link_or_create_wh(sb, bindex, wh_dentry); - if (!err) { - au_set_dbwh(dentry, bindex); - au_fhsm_wrote(sb, bindex, /*force*/0); - } else { - dput(wh_dentry); - wh_dentry = ERR_PTR(err); - } - } - - return wh_dentry; -} - -/* ---------------------------------------------------------------------- */ - -/* Delete all whiteouts in this directory on branch bindex. */ -static int del_wh_children(struct dentry *h_dentry, struct au_nhash *whlist, - aufs_bindex_t bindex, struct au_branch *br) -{ - int err; - unsigned long ul, n; - struct qstr wh_name; - char *p; - struct hlist_head *head; - struct au_vdir_wh *pos; - struct au_vdir_destr *str; - - err = -ENOMEM; - p = (void *)__get_free_page(GFP_NOFS); - wh_name.name = p; - if (unlikely(!wh_name.name)) - goto out; - - err = 0; - memcpy(p, AUFS_WH_PFX, AUFS_WH_PFX_LEN); - p += AUFS_WH_PFX_LEN; - n = whlist->nh_num; - head = whlist->nh_head; - for (ul = 0; !err && ul < n; ul++, head++) { - hlist_for_each_entry(pos, head, wh_hash) { - if (pos->wh_bindex != bindex) - continue; - - str = &pos->wh_str; - if (str->len + AUFS_WH_PFX_LEN <= PATH_MAX) { - memcpy(p, str->name, str->len); - wh_name.len = AUFS_WH_PFX_LEN + str->len; - err = unlink_wh_name(h_dentry, &wh_name, br); - if (!err) - continue; - break; - } - AuIOErr("whiteout name too long %.*s\n", - str->len, str->name); - err = -EIO; - break; - } - } - free_page((unsigned long)wh_name.name); - -out: - return err; -} - -struct del_wh_children_args { - int *errp; - struct dentry *h_dentry; - struct au_nhash *whlist; - aufs_bindex_t bindex; - struct au_branch *br; -}; - -static void call_del_wh_children(void *args) -{ - struct del_wh_children_args *a = args; - *a->errp = del_wh_children(a->h_dentry, a->whlist, a->bindex, a->br); -} - -/* ---------------------------------------------------------------------- */ - -struct au_whtmp_rmdir *au_whtmp_rmdir_alloc(struct super_block *sb, gfp_t gfp) -{ - struct au_whtmp_rmdir *whtmp; - int err; - unsigned int rdhash; - - SiMustAnyLock(sb); - - whtmp = kmalloc(sizeof(*whtmp), gfp); - if (unlikely(!whtmp)) { - whtmp = ERR_PTR(-ENOMEM); - goto out; - } - - whtmp->dir = NULL; - whtmp->br = NULL; - whtmp->wh_dentry = NULL; - /* no estimation for dir size */ - rdhash = au_sbi(sb)->si_rdhash; - if (!rdhash) - rdhash = AUFS_RDHASH_DEF; - err = au_nhash_alloc(&whtmp->whlist, rdhash, gfp); - if (unlikely(err)) { - kfree(whtmp); - whtmp = ERR_PTR(err); - } - -out: - return whtmp; -} - -void au_whtmp_rmdir_free(struct au_whtmp_rmdir *whtmp) -{ - if (whtmp->br) - atomic_dec(&whtmp->br->br_count); - dput(whtmp->wh_dentry); - iput(whtmp->dir); - au_nhash_wh_free(&whtmp->whlist); - kfree(whtmp); -} - -/* - * rmdir the whiteouted temporary named dir @h_dentry. - * @whlist: whiteouted children. - */ -int au_whtmp_rmdir(struct inode *dir, aufs_bindex_t bindex, - struct dentry *wh_dentry, struct au_nhash *whlist) -{ - int err; - struct path h_tmp; - struct inode *wh_inode, *h_dir; - struct au_branch *br; - - h_dir = wh_dentry->d_parent->d_inode; /* dir inode is locked */ - IMustLock(h_dir); - - br = au_sbr(dir->i_sb, bindex); - wh_inode = wh_dentry->d_inode; - mutex_lock_nested(&wh_inode->i_mutex, AuLsc_I_CHILD); - - /* - * someone else might change some whiteouts while we were sleeping. - * it means this whlist may have an obsoleted entry. - */ - if (!au_test_h_perm_sio(wh_inode, MAY_EXEC | MAY_WRITE)) - err = del_wh_children(wh_dentry, whlist, bindex, br); - else { - int wkq_err; - struct del_wh_children_args args = { - .errp = &err, - .h_dentry = wh_dentry, - .whlist = whlist, - .bindex = bindex, - .br = br - }; - - wkq_err = au_wkq_wait(call_del_wh_children, &args); - if (unlikely(wkq_err)) - err = wkq_err; - } - mutex_unlock(&wh_inode->i_mutex); - - if (!err) { - h_tmp.dentry = wh_dentry; - h_tmp.mnt = au_br_mnt(br); - err = vfsub_rmdir(h_dir, &h_tmp); - } - - if (!err) { - if (au_ibstart(dir) == bindex) { - /* todo: dir->i_mutex is necessary */ - au_cpup_attr_timesizes(dir); - vfsub_drop_nlink(dir); - } - return 0; /* success */ - } - - pr_warn("failed removing %.*s(%d), ignored\n", - AuDLNPair(wh_dentry), err); - return err; -} - -static void call_rmdir_whtmp(void *args) -{ - int err; - aufs_bindex_t bindex; - struct au_whtmp_rmdir *a = args; - struct super_block *sb; - struct dentry *h_parent; - struct inode *h_dir; - struct au_hinode *hdir; - - /* rmdir by nfsd may cause deadlock with this i_mutex */ - /* mutex_lock(&a->dir->i_mutex); */ - err = -EROFS; - sb = a->dir->i_sb; - si_read_lock(sb, !AuLock_FLUSH); - if (!au_br_writable(a->br->br_perm)) - goto out; - bindex = au_br_index(sb, a->br->br_id); - if (unlikely(bindex < 0)) - goto out; - - err = -EIO; - ii_write_lock_parent(a->dir); - h_parent = dget_parent(a->wh_dentry); - h_dir = h_parent->d_inode; - hdir = au_hi(a->dir, bindex); - err = vfsub_mnt_want_write(au_br_mnt(a->br)); - if (unlikely(err)) - goto out_mnt; - au_hn_imtx_lock_nested(hdir, AuLsc_I_PARENT); - err = au_h_verify(a->wh_dentry, au_opt_udba(sb), h_dir, h_parent, - a->br); - if (!err) - err = au_whtmp_rmdir(a->dir, bindex, a->wh_dentry, &a->whlist); - au_hn_imtx_unlock(hdir); - vfsub_mnt_drop_write(au_br_mnt(a->br)); - -out_mnt: - dput(h_parent); - ii_write_unlock(a->dir); -out: - /* mutex_unlock(&a->dir->i_mutex); */ - au_whtmp_rmdir_free(a); - si_read_unlock(sb); - au_nwt_done(&au_sbi(sb)->si_nowait); - if (unlikely(err)) - AuIOErr("err %d\n", err); -} - -void au_whtmp_kick_rmdir(struct inode *dir, aufs_bindex_t bindex, - struct dentry *wh_dentry, struct au_whtmp_rmdir *args) -{ - int wkq_err; - struct super_block *sb; - - IMustLock(dir); - - /* all post-process will be done in do_rmdir_whtmp(). */ - sb = dir->i_sb; - args->dir = au_igrab(dir); - args->br = au_sbr(sb, bindex); - atomic_inc(&args->br->br_count); - args->wh_dentry = dget(wh_dentry); - wkq_err = au_wkq_nowait(call_rmdir_whtmp, args, sb, /*flags*/0); - if (unlikely(wkq_err)) { - pr_warn("rmdir error %.*s (%d), ignored\n", - AuDLNPair(wh_dentry), wkq_err); - au_whtmp_rmdir_free(args); - } -} diff --git a/fs/aufs/whout.h b/fs/aufs/whout.h deleted file mode 100644 index 9c48bd833a23ef..00000000000000 --- a/fs/aufs/whout.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * whiteout for logical deletion and opaque directory - */ - -#ifndef __AUFS_WHOUT_H__ -#define __AUFS_WHOUT_H__ - -#ifdef __KERNEL__ - -#include "dir.h" - -/* whout.c */ -int au_wh_name_alloc(struct qstr *wh, const struct qstr *name); -struct au_branch; -int au_wh_test(struct dentry *h_parent, struct qstr *wh_name, int try_sio); -int au_diropq_test(struct dentry *h_dentry); -struct dentry *au_whtmp_lkup(struct dentry *h_parent, struct au_branch *br, - struct qstr *prefix); -int au_whtmp_ren(struct dentry *h_dentry, struct au_branch *br); -int au_wh_unlink_dentry(struct inode *h_dir, struct path *h_path, - struct dentry *dentry); -int au_wh_init(struct au_branch *br, struct super_block *sb); - -/* diropq flags */ -#define AuDiropq_CREATE 1 -#define au_ftest_diropq(flags, name) ((flags) & AuDiropq_##name) -#define au_fset_diropq(flags, name) \ - do { (flags) |= AuDiropq_##name; } while (0) -#define au_fclr_diropq(flags, name) \ - do { (flags) &= ~AuDiropq_##name; } while (0) - -struct dentry *au_diropq_sio(struct dentry *dentry, aufs_bindex_t bindex, - unsigned int flags); -struct dentry *au_wh_lkup(struct dentry *h_parent, struct qstr *base_name, - struct au_branch *br); -struct dentry *au_wh_create(struct dentry *dentry, aufs_bindex_t bindex, - struct dentry *h_parent); - -/* real rmdir for the whiteout-ed dir */ -struct au_whtmp_rmdir { - struct inode *dir; - struct au_branch *br; - struct dentry *wh_dentry; - struct au_nhash whlist; -}; - -struct au_whtmp_rmdir *au_whtmp_rmdir_alloc(struct super_block *sb, gfp_t gfp); -void au_whtmp_rmdir_free(struct au_whtmp_rmdir *whtmp); -int au_whtmp_rmdir(struct inode *dir, aufs_bindex_t bindex, - struct dentry *wh_dentry, struct au_nhash *whlist); -void au_whtmp_kick_rmdir(struct inode *dir, aufs_bindex_t bindex, - struct dentry *wh_dentry, struct au_whtmp_rmdir *args); - -/* ---------------------------------------------------------------------- */ - -static inline struct dentry *au_diropq_create(struct dentry *dentry, - aufs_bindex_t bindex) -{ - return au_diropq_sio(dentry, bindex, AuDiropq_CREATE); -} - -static inline int au_diropq_remove(struct dentry *dentry, aufs_bindex_t bindex) -{ - return PTR_ERR(au_diropq_sio(dentry, bindex, !AuDiropq_CREATE)); -} - -#endif /* __KERNEL__ */ -#endif /* __AUFS_WHOUT_H__ */ diff --git a/fs/aufs/wkq.c b/fs/aufs/wkq.c deleted file mode 100644 index 558e69450ee8b8..00000000000000 --- a/fs/aufs/wkq.c +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * workqueue for asynchronous/super-io operations - * todo: try new dredential scheme - */ - -#include -#include "aufs.h" - -/* internal workqueue named AUFS_WKQ_NAME */ - -static struct workqueue_struct *au_wkq; - -struct au_wkinfo { - struct work_struct wk; - struct kobject *kobj; - - unsigned int flags; /* see wkq.h */ - - au_wkq_func_t func; - void *args; - - struct completion *comp; -}; - -/* ---------------------------------------------------------------------- */ - -static void wkq_func(struct work_struct *wk) -{ - struct au_wkinfo *wkinfo = container_of(wk, struct au_wkinfo, wk); - - AuDebugOn(!uid_eq(current_fsuid(), GLOBAL_ROOT_UID)); - AuDebugOn(rlimit(RLIMIT_FSIZE) != RLIM_INFINITY); - - wkinfo->func(wkinfo->args); - if (au_ftest_wkq(wkinfo->flags, WAIT)) - complete(wkinfo->comp); - else { - kobject_put(wkinfo->kobj); - module_put(THIS_MODULE); /* todo: ?? */ - kfree(wkinfo); - } -} - -/* - * Since struct completion is large, try allocating it dynamically. - */ -#if 1 /* defined(CONFIG_4KSTACKS) || defined(AuTest4KSTACKS) */ -#define AuWkqCompDeclare(name) struct completion *comp = NULL - -static int au_wkq_comp_alloc(struct au_wkinfo *wkinfo, struct completion **comp) -{ - *comp = kmalloc(sizeof(**comp), GFP_NOFS); - if (*comp) { - init_completion(*comp); - wkinfo->comp = *comp; - return 0; - } - return -ENOMEM; -} - -static void au_wkq_comp_free(struct completion *comp) -{ - kfree(comp); -} - -#else - -/* no braces */ -#define AuWkqCompDeclare(name) \ - DECLARE_COMPLETION_ONSTACK(_ ## name); \ - struct completion *comp = &_ ## name - -static int au_wkq_comp_alloc(struct au_wkinfo *wkinfo, struct completion **comp) -{ - wkinfo->comp = *comp; - return 0; -} - -static void au_wkq_comp_free(struct completion *comp __maybe_unused) -{ - /* empty */ -} -#endif /* 4KSTACKS */ - -static void au_wkq_run(struct au_wkinfo *wkinfo) -{ - if (au_ftest_wkq(wkinfo->flags, NEST)) { - if (au_wkq_test()) { - AuWarn1("wkq from wkq, due to a dead dir by UDBA?\n"); - AuDebugOn(au_ftest_wkq(wkinfo->flags, WAIT)); - } - } else - au_dbg_verify_kthread(); - - if (au_ftest_wkq(wkinfo->flags, WAIT)) { - INIT_WORK_ONSTACK(&wkinfo->wk, wkq_func); - queue_work(au_wkq, &wkinfo->wk); - } else { - INIT_WORK(&wkinfo->wk, wkq_func); - schedule_work(&wkinfo->wk); - } -} - -/* - * Be careful. It is easy to make deadlock happen. - * processA: lock, wkq and wait - * processB: wkq and wait, lock in wkq - * --> deadlock - */ -int au_wkq_do_wait(unsigned int flags, au_wkq_func_t func, void *args) -{ - int err; - AuWkqCompDeclare(comp); - struct au_wkinfo wkinfo = { - .flags = flags, - .func = func, - .args = args - }; - - err = au_wkq_comp_alloc(&wkinfo, &comp); - if (!err) { - au_wkq_run(&wkinfo); - /* no timeout, no interrupt */ - wait_for_completion(wkinfo.comp); - au_wkq_comp_free(comp); - destroy_work_on_stack(&wkinfo.wk); - } - - return err; - -} - -/* - * Note: dget/dput() in func for aufs dentries are not supported. It will be a - * problem in a concurrent umounting. - */ -int au_wkq_nowait(au_wkq_func_t func, void *args, struct super_block *sb, - unsigned int flags) -{ - int err; - struct au_wkinfo *wkinfo; - - atomic_inc(&au_sbi(sb)->si_nowait.nw_len); - - /* - * wkq_func() must free this wkinfo. - * it highly depends upon the implementation of workqueue. - */ - err = 0; - wkinfo = kmalloc(sizeof(*wkinfo), GFP_NOFS); - if (wkinfo) { - wkinfo->kobj = &au_sbi(sb)->si_kobj; - wkinfo->flags = flags & ~AuWkq_WAIT; - wkinfo->func = func; - wkinfo->args = args; - wkinfo->comp = NULL; - kobject_get(wkinfo->kobj); - __module_get(THIS_MODULE); /* todo: ?? */ - - au_wkq_run(wkinfo); - } else { - err = -ENOMEM; - au_nwt_done(&au_sbi(sb)->si_nowait); - } - - return err; -} - -/* ---------------------------------------------------------------------- */ - -void au_nwt_init(struct au_nowait_tasks *nwt) -{ - atomic_set(&nwt->nw_len, 0); - /* smp_mb(); */ /* atomic_set */ - init_waitqueue_head(&nwt->nw_wq); -} - -void au_wkq_fin(void) -{ - destroy_workqueue(au_wkq); -} - -int __init au_wkq_init(void) -{ - int err; - - err = 0; - au_wkq = alloc_workqueue(AUFS_WKQ_NAME, 0, WQ_DFL_ACTIVE); - if (IS_ERR(au_wkq)) - err = PTR_ERR(au_wkq); - else if (!au_wkq) - err = -ENOMEM; - - return err; -} diff --git a/fs/aufs/wkq.h b/fs/aufs/wkq.h deleted file mode 100644 index f324e49fa93121..00000000000000 --- a/fs/aufs/wkq.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * workqueue for asynchronous/super-io operations - * todo: try new credentials management scheme - */ - -#ifndef __AUFS_WKQ_H__ -#define __AUFS_WKQ_H__ - -#ifdef __KERNEL__ - -struct super_block; - -/* ---------------------------------------------------------------------- */ - -/* - * in the next operation, wait for the 'nowait' tasks in system-wide workqueue - */ -struct au_nowait_tasks { - atomic_t nw_len; - wait_queue_head_t nw_wq; -}; - -/* ---------------------------------------------------------------------- */ - -typedef void (*au_wkq_func_t)(void *args); - -/* wkq flags */ -#define AuWkq_WAIT 1 -#define AuWkq_NEST (1 << 1) -#define au_ftest_wkq(flags, name) ((flags) & AuWkq_##name) -#define au_fset_wkq(flags, name) \ - do { (flags) |= AuWkq_##name; } while (0) -#define au_fclr_wkq(flags, name) \ - do { (flags) &= ~AuWkq_##name; } while (0) - -#ifndef CONFIG_AUFS_HNOTIFY -#undef AuWkq_NEST -#define AuWkq_NEST 0 -#endif - -/* wkq.c */ -int au_wkq_do_wait(unsigned int flags, au_wkq_func_t func, void *args); -int au_wkq_nowait(au_wkq_func_t func, void *args, struct super_block *sb, - unsigned int flags); -void au_nwt_init(struct au_nowait_tasks *nwt); -int __init au_wkq_init(void); -void au_wkq_fin(void); - -/* ---------------------------------------------------------------------- */ - -static inline int au_wkq_test(void) -{ - return current->flags & PF_WQ_WORKER; -} - -static inline int au_wkq_wait(au_wkq_func_t func, void *args) -{ - return au_wkq_do_wait(AuWkq_WAIT, func, args); -} - -static inline void au_nwt_done(struct au_nowait_tasks *nwt) -{ - if (atomic_dec_and_test(&nwt->nw_len)) - wake_up_all(&nwt->nw_wq); -} - -static inline int au_nwt_flush(struct au_nowait_tasks *nwt) -{ - wait_event(nwt->nw_wq, !atomic_read(&nwt->nw_len)); - return 0; -} - -#endif /* __KERNEL__ */ -#endif /* __AUFS_WKQ_H__ */ diff --git a/fs/aufs/xattr.c b/fs/aufs/xattr.c deleted file mode 100644 index 5bcde92dabed8e..00000000000000 --- a/fs/aufs/xattr.c +++ /dev/null @@ -1,437 +0,0 @@ -/* - * Copyright (C) 2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * handling xattr functions - */ - -#include -#include "aufs.h" - -static int au_xattr_ignore(int err, char *name, unsigned int ignore_flags) -{ - if (!ignore_flags) - goto out; - switch (err) { - case -ENOMEM: - case -EDQUOT: - goto out; - } - - if ((ignore_flags & AuBrAttr_ICEX) == AuBrAttr_ICEX) { - err = 0; - goto out; - } - -#define cmp(brattr, prefix) do { \ - if (!strncmp(name, XATTR_##prefix##_PREFIX, \ - XATTR_##prefix##_PREFIX_LEN)) { \ - if (ignore_flags & AuBrAttr_ICEX_##brattr) \ - err = 0; \ - goto out; \ - } \ - } while (0) - - cmp(SEC, SECURITY); - cmp(SYS, SYSTEM); - cmp(TR, TRUSTED); - cmp(USR, USER); -#undef cmp - - if (ignore_flags & AuBrAttr_ICEX_OTH) - err = 0; - -out: - return err; -} - -static const int au_xattr_out_of_list = AuBrAttr_ICEX_OTH << 1; - -static int au_do_cpup_xattr(struct dentry *h_dst, struct dentry *h_src, - char *name, char **buf, unsigned int ignore_flags) -{ - int err; - ssize_t ssz; - struct inode *h_idst; - - ssz = vfs_getxattr_alloc(h_src, name, buf, 0, GFP_NOFS); - err = ssz; - if (unlikely(err <= 0)) { - AuTraceErr(err); - if (err == -ENODATA - || (err == -EOPNOTSUPP - && (ignore_flags & au_xattr_out_of_list))) - err = 0; - goto out; - } - - /* unlock it temporary */ - h_idst = h_dst->d_inode; - mutex_unlock(&h_idst->i_mutex); - err = vfsub_setxattr(h_dst, name, *buf, ssz, /*flags*/0); - mutex_lock_nested(&h_idst->i_mutex, AuLsc_I_CHILD2); - if (unlikely(err)) { - AuDbg("%s, err %d\n", name, err); - err = au_xattr_ignore(err, name, ignore_flags); - } - -out: - return err; -} - -int au_cpup_xattr(struct dentry *h_dst, struct dentry *h_src, int ignore_flags) -{ - int err, unlocked, acl_access, acl_default; - ssize_t ssz; - struct inode *h_isrc, *h_idst; - char *value, *p, *o, *e; - - /* try stopping to update the source inode while we are referencing */ - /* there should not be the parent-child relation ship between them */ - h_isrc = h_src->d_inode; - h_idst = h_dst->d_inode; - mutex_unlock(&h_idst->i_mutex); - mutex_lock_nested(&h_isrc->i_mutex, AuLsc_I_CHILD); - mutex_lock_nested(&h_idst->i_mutex, AuLsc_I_CHILD2); - unlocked = 0; - - /* some filesystems don't list POSIX ACL, for example tmpfs */ - ssz = vfs_listxattr(h_src, NULL, 0); - err = ssz; - if (unlikely(err < 0)) { - if (err == -ENODATA - || err == -EOPNOTSUPP) - err = 0; /* ignore */ - goto out; - } - - err = 0; - p = NULL; - o = NULL; - if (ssz) { - err = -ENOMEM; - p = kmalloc(ssz, GFP_NOFS); - o = p; - if (unlikely(!p)) - goto out; - err = vfs_listxattr(h_src, p, ssz); - } - mutex_unlock(&h_isrc->i_mutex); - unlocked = 1; - AuDbg("err %d, ssz %zd\n", err, ssz); - if (unlikely(err < 0)) - goto out_free; - - err = 0; - e = p + ssz; - value = NULL; - acl_access = 0; - acl_default = 0; - while (!err && p < e) { - acl_access |= !strncmp(p, XATTR_NAME_POSIX_ACL_ACCESS, - sizeof(XATTR_NAME_POSIX_ACL_ACCESS) - 1); - acl_default |= !strncmp(p, XATTR_NAME_POSIX_ACL_DEFAULT, - sizeof(XATTR_NAME_POSIX_ACL_DEFAULT) - - 1); - err = au_do_cpup_xattr(h_dst, h_src, p, &value, ignore_flags); - p += strlen(p) + 1; - } - AuTraceErr(err); - ignore_flags |= au_xattr_out_of_list; - if (!err && !acl_access) { - err = au_do_cpup_xattr(h_dst, h_src, - XATTR_NAME_POSIX_ACL_ACCESS, &value, - ignore_flags); - AuTraceErr(err); - } - if (!err && !acl_default) { - err = au_do_cpup_xattr(h_dst, h_src, - XATTR_NAME_POSIX_ACL_DEFAULT, &value, - ignore_flags); - AuTraceErr(err); - } - - kfree(value); - -out_free: - kfree(o); -out: - if (!unlocked) - mutex_unlock(&h_isrc->i_mutex); - AuTraceErr(err); - return err; -} - -/* ---------------------------------------------------------------------- */ - -enum { - AU_XATTR_LIST, - AU_XATTR_GET -}; - -struct au_lgxattr { - int type; - union { - struct { - char *list; - size_t size; - } list; - struct { - const char *name; - void *value; - size_t size; - } get; - } u; -}; - -static ssize_t au_lgxattr(struct dentry *dentry, struct au_lgxattr *arg) -{ - ssize_t err; - struct path h_path; - struct super_block *sb; - - sb = dentry->d_sb; - err = si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLM); - if (unlikely(err)) - goto out; - err = au_h_path_getattr(dentry, /*force*/1, &h_path); - if (unlikely(err)) - goto out_si; - if (unlikely(!h_path.dentry)) - /* illegally overlapped or something */ - goto out_di; /* pretending success */ - - /* always topmost entry only */ - switch (arg->type) { - case AU_XATTR_LIST: - err = vfs_listxattr(h_path.dentry, - arg->u.list.list, arg->u.list.size); - break; - case AU_XATTR_GET: - err = vfs_getxattr(h_path.dentry, - arg->u.get.name, arg->u.get.value, - arg->u.get.size); - break; - } - -out_di: - di_read_unlock(dentry, AuLock_IR); -out_si: - si_read_unlock(sb); -out: - AuTraceErr(err); - return err; -} - -ssize_t aufs_listxattr(struct dentry *dentry, char *list, size_t size) -{ - struct au_lgxattr arg = { - .type = AU_XATTR_LIST, - .u.list = { - .list = list, - .size = size - }, - }; - - return au_lgxattr(dentry, &arg); -} - -ssize_t aufs_getxattr(struct dentry *dentry, const char *name, void *value, - size_t size) -{ - struct au_lgxattr arg = { - .type = AU_XATTR_GET, - .u.get = { - .name = name, - .value = value, - .size = size - }, - }; - - return au_lgxattr(dentry, &arg); -} - -/* cf fs/aufs/i_op.c:aufs_setattr() */ -static int au_h_path_to_set_attr(struct dentry *dentry, - struct au_icpup_args *a, struct path *h_path) -{ - int err; - struct super_block *sb; - - sb = dentry->d_sb; - a->udba = au_opt_udba(sb); - /* no d_unlinked(), to set UDBA_NONE for root */ - if (d_unhashed(dentry)) - a->udba = AuOpt_UDBA_NONE; - if (a->udba != AuOpt_UDBA_NONE) { - AuDebugOn(IS_ROOT(dentry)); - err = au_reval_for_attr(dentry, au_sigen(sb)); - if (unlikely(err)) - goto out; - } - err = au_pin_and_icpup(dentry, /*ia*/NULL, a); - if (unlikely(err < 0)) - goto out; - - h_path->dentry = a->h_path.dentry; - h_path->mnt = au_sbr_mnt(sb, a->btgt); - -out: - return err; -} - -enum { - AU_XATTR_SET, - AU_XATTR_REMOVE -}; - -struct au_srxattr { - int type; - union { - struct { - const char *name; - const void *value; - size_t size; - int flags; - } set; - struct { - const char *name; - } remove; - } u; -}; - -static ssize_t au_srxattr(struct dentry *dentry, struct au_srxattr *arg) -{ - int err; - struct path h_path; - struct super_block *sb; - struct au_icpup_args *a; - struct inode *inode; - - inode = dentry->d_inode; - IMustLock(inode); - - err = -ENOMEM; - a = kzalloc(sizeof(*a), GFP_NOFS); - if (unlikely(!a)) - goto out; - - sb = dentry->d_sb; - err = si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLM); - if (unlikely(err)) - goto out_kfree; - - h_path.dentry = NULL; /* silence gcc */ - di_write_lock_child(dentry); - err = au_h_path_to_set_attr(dentry, a, &h_path); - if (unlikely(err)) - goto out_di; - - mutex_unlock(&a->h_inode->i_mutex); - switch (arg->type) { - case AU_XATTR_SET: - err = vfsub_setxattr(h_path.dentry, - arg->u.set.name, arg->u.set.value, - arg->u.set.size, arg->u.set.flags); - break; - case AU_XATTR_REMOVE: - err = vfsub_removexattr(h_path.dentry, arg->u.remove.name); - break; - } - if (!err) - au_cpup_attr_timesizes(inode); - - au_unpin(&a->pin); - if (unlikely(err)) - au_update_dbstart(dentry); - -out_di: - di_write_unlock(dentry); - si_read_unlock(sb); -out_kfree: - kfree(a); -out: - AuTraceErr(err); - return err; -} - -int aufs_setxattr(struct dentry *dentry, const char *name, const void *value, - size_t size, int flags) -{ - struct au_srxattr arg = { - .type = AU_XATTR_SET, - .u.set = { - .name = name, - .value = value, - .size = size, - .flags = flags - }, - }; - - return au_srxattr(dentry, &arg); -} - -int aufs_removexattr(struct dentry *dentry, const char *name) -{ - struct au_srxattr arg = { - .type = AU_XATTR_REMOVE, - .u.remove = { - .name = name - }, - }; - - return au_srxattr(dentry, &arg); -} - -/* ---------------------------------------------------------------------- */ - -#if 0 -static size_t au_xattr_list(struct dentry *dentry, char *list, size_t list_size, - const char *name, size_t name_len, int type) -{ - return aufs_listxattr(dentry, list, list_size); -} - -static int au_xattr_get(struct dentry *dentry, const char *name, void *buffer, - size_t size, int type) -{ - return aufs_getxattr(dentry, name, buffer, size); -} - -static int au_xattr_set(struct dentry *dentry, const char *name, - const void *value, size_t size, int flags, int type) -{ - return aufs_setxattr(dentry, name, value, size, flags); -} - -static const struct xattr_handler au_xattr_handler = { - /* no prefix, no flags */ - .list = au_xattr_list, - .get = au_xattr_get, - .set = au_xattr_set - /* why no remove? */ -}; - -static const struct xattr_handler *au_xattr_handlers[] = { - &au_xattr_handler -}; - -void au_xattr_init(struct super_block *sb) -{ - /* sb->s_xattr = au_xattr_handlers; */ -} -#endif diff --git a/fs/aufs/xino.c b/fs/aufs/xino.c deleted file mode 100644 index 49b7a76d7cec74..00000000000000 --- a/fs/aufs/xino.c +++ /dev/null @@ -1,1309 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -/* - * external inode number translation table and bitmap - */ - -#include -#include -#include "aufs.h" - -/* todo: unnecessary to support mmap_sem since kernel-space? */ -ssize_t xino_fread(au_readf_t func, struct file *file, void *kbuf, size_t size, - loff_t *pos) -{ - ssize_t err; - mm_segment_t oldfs; - union { - void *k; - char __user *u; - } buf; - - buf.k = kbuf; - oldfs = get_fs(); - set_fs(KERNEL_DS); - do { - /* todo: signal_pending? */ - err = func(file, buf.u, size, pos); - } while (err == -EAGAIN || err == -EINTR); - set_fs(oldfs); - -#if 0 /* reserved for future use */ - if (err > 0) - fsnotify_access(file->f_dentry); -#endif - - return err; -} - -/* ---------------------------------------------------------------------- */ - -static ssize_t do_xino_fwrite(au_writef_t func, struct file *file, void *kbuf, - size_t size, loff_t *pos) -{ - ssize_t err; - mm_segment_t oldfs; - union { - void *k; - const char __user *u; - } buf; - - buf.k = kbuf; - oldfs = get_fs(); - set_fs(KERNEL_DS); - do { - /* todo: signal_pending? */ - err = func(file, buf.u, size, pos); - } while (err == -EAGAIN || err == -EINTR); - set_fs(oldfs); - -#if 0 /* reserved for future use */ - if (err > 0) - fsnotify_modify(file->f_dentry); -#endif - - return err; -} - -struct do_xino_fwrite_args { - ssize_t *errp; - au_writef_t func; - struct file *file; - void *buf; - size_t size; - loff_t *pos; -}; - -static void call_do_xino_fwrite(void *args) -{ - struct do_xino_fwrite_args *a = args; - *a->errp = do_xino_fwrite(a->func, a->file, a->buf, a->size, a->pos); -} - -ssize_t xino_fwrite(au_writef_t func, struct file *file, void *buf, size_t size, - loff_t *pos) -{ - ssize_t err; - - /* todo: signal block and no wkq? */ - if (rlimit(RLIMIT_FSIZE) == RLIM_INFINITY) { - lockdep_off(); - err = do_xino_fwrite(func, file, buf, size, pos); - lockdep_on(); - } else { - /* - * it breaks RLIMIT_FSIZE and normal user's limit, - * users should care about quota and real 'filesystem full.' - */ - int wkq_err; - struct do_xino_fwrite_args args = { - .errp = &err, - .func = func, - .file = file, - .buf = buf, - .size = size, - .pos = pos - }; - - wkq_err = au_wkq_wait(call_do_xino_fwrite, &args); - if (unlikely(wkq_err)) - err = wkq_err; - } - - return err; -} - -/* ---------------------------------------------------------------------- */ - -/* - * create a new xinofile at the same place/path as @base_file. - */ -struct file *au_xino_create2(struct file *base_file, struct file *copy_src) -{ - struct file *file; - struct dentry *base, *parent; - struct inode *dir; - struct qstr *name; - struct path path; - int err; - - base = base_file->f_dentry; - parent = base->d_parent; /* dir inode is locked */ - dir = parent->d_inode; - IMustLock(dir); - - file = ERR_PTR(-EINVAL); - name = &base->d_name; - path.dentry = vfsub_lookup_one_len(name->name, parent, name->len); - if (IS_ERR(path.dentry)) { - file = (void *)path.dentry; - pr_err("%.*s lookup err %ld\n", - AuLNPair(name), PTR_ERR(path.dentry)); - goto out; - } - - /* no need to mnt_want_write() since we call dentry_open() later */ - err = vfs_create(dir, path.dentry, S_IRUGO | S_IWUGO, NULL); - if (unlikely(err)) { - file = ERR_PTR(err); - pr_err("%.*s create err %d\n", AuLNPair(name), err); - goto out_dput; - } - - path.mnt = base_file->f_path.mnt; - file = vfsub_dentry_open(&path, - O_RDWR | O_CREAT | O_EXCL | O_LARGEFILE - /* | __FMODE_NONOTIFY */); - if (IS_ERR(file)) { - pr_err("%.*s open err %ld\n", AuLNPair(name), PTR_ERR(file)); - goto out_dput; - } - - err = vfsub_unlink(dir, &file->f_path, /*force*/0); - if (unlikely(err)) { - pr_err("%.*s unlink err %d\n", AuLNPair(name), err); - goto out_fput; - } - - if (copy_src) { - /* no one can touch copy_src xino */ - err = au_copy_file(file, copy_src, vfsub_f_size_read(copy_src)); - if (unlikely(err)) { - pr_err("%.*s copy err %d\n", AuLNPair(name), err); - goto out_fput; - } - } - goto out_dput; /* success */ - -out_fput: - fput(file); - file = ERR_PTR(err); -out_dput: - dput(path.dentry); -out: - return file; -} - -struct au_xino_lock_dir { - struct au_hinode *hdir; - struct dentry *parent; - struct mutex *mtx; -}; - -static void au_xino_lock_dir(struct super_block *sb, struct file *xino, - struct au_xino_lock_dir *ldir) -{ - aufs_bindex_t brid, bindex; - - ldir->hdir = NULL; - bindex = -1; - brid = au_xino_brid(sb); - if (brid >= 0) - bindex = au_br_index(sb, brid); - if (bindex >= 0) { - ldir->hdir = au_hi(sb->s_root->d_inode, bindex); - au_hn_imtx_lock_nested(ldir->hdir, AuLsc_I_PARENT); - } else { - ldir->parent = dget_parent(xino->f_dentry); - ldir->mtx = &ldir->parent->d_inode->i_mutex; - mutex_lock_nested(ldir->mtx, AuLsc_I_PARENT); - } -} - -static void au_xino_unlock_dir(struct au_xino_lock_dir *ldir) -{ - if (ldir->hdir) - au_hn_imtx_unlock(ldir->hdir); - else { - mutex_unlock(ldir->mtx); - dput(ldir->parent); - } -} - -/* ---------------------------------------------------------------------- */ - -/* trucate xino files asynchronously */ - -int au_xino_trunc(struct super_block *sb, aufs_bindex_t bindex) -{ - int err; - unsigned long jiffy; - blkcnt_t blocks; - aufs_bindex_t bi, bend; - struct kstatfs *st; - struct au_branch *br; - struct file *new_xino, *file; - struct super_block *h_sb; - struct au_xino_lock_dir ldir; - - err = -ENOMEM; - st = kzalloc(sizeof(*st), GFP_NOFS); - if (unlikely(!st)) - goto out; - - err = -EINVAL; - bend = au_sbend(sb); - if (unlikely(bindex < 0 || bend < bindex)) - goto out_st; - br = au_sbr(sb, bindex); - file = br->br_xino.xi_file; - if (!file) - goto out_st; - - err = vfs_statfs(&file->f_path, st); - if (unlikely(err)) - AuErr1("statfs err %d, ignored\n", err); - jiffy = jiffies; - blocks = file_inode(file)->i_blocks; - pr_info("begin truncating xino(b%d), ib%llu, %llu/%llu free blks\n", - bindex, (u64)blocks, st->f_bfree, st->f_blocks); - - au_xino_lock_dir(sb, file, &ldir); - /* mnt_want_write() is unnecessary here */ - new_xino = au_xino_create2(file, file); - au_xino_unlock_dir(&ldir); - err = PTR_ERR(new_xino); - if (IS_ERR(new_xino)) { - pr_err("err %d, ignored\n", err); - goto out_st; - } - err = 0; - fput(file); - br->br_xino.xi_file = new_xino; - - h_sb = au_br_sb(br); - for (bi = 0; bi <= bend; bi++) { - if (unlikely(bi == bindex)) - continue; - br = au_sbr(sb, bi); - if (au_br_sb(br) != h_sb) - continue; - - fput(br->br_xino.xi_file); - br->br_xino.xi_file = new_xino; - get_file(new_xino); - } - - err = vfs_statfs(&new_xino->f_path, st); - if (!err) { - pr_info("end truncating xino(b%d), ib%llu, %llu/%llu free blks\n", - bindex, (u64)file_inode(new_xino)->i_blocks, - st->f_bfree, st->f_blocks); - if (file_inode(new_xino)->i_blocks < blocks) - au_sbi(sb)->si_xino_jiffy = jiffy; - } else - AuErr1("statfs err %d, ignored\n", err); - -out_st: - kfree(st); -out: - return err; -} - -struct xino_do_trunc_args { - struct super_block *sb; - struct au_branch *br; -}; - -static void xino_do_trunc(void *_args) -{ - struct xino_do_trunc_args *args = _args; - struct super_block *sb; - struct au_branch *br; - struct inode *dir; - int err; - aufs_bindex_t bindex; - - err = 0; - sb = args->sb; - dir = sb->s_root->d_inode; - br = args->br; - - si_noflush_write_lock(sb); - ii_read_lock_parent(dir); - bindex = au_br_index(sb, br->br_id); - err = au_xino_trunc(sb, bindex); - ii_read_unlock(dir); - if (unlikely(err)) - pr_warn("err b%d, (%d)\n", bindex, err); - atomic_dec(&br->br_xino_running); - atomic_dec(&br->br_count); - si_write_unlock(sb); - au_nwt_done(&au_sbi(sb)->si_nowait); - kfree(args); -} - -static int xino_trunc_test(struct super_block *sb, struct au_branch *br) -{ - int err; - struct kstatfs st; - struct au_sbinfo *sbinfo; - - /* todo: si_xino_expire and the ratio should be customizable */ - sbinfo = au_sbi(sb); - if (time_before(jiffies, - sbinfo->si_xino_jiffy + sbinfo->si_xino_expire)) - return 0; - - /* truncation border */ - err = vfs_statfs(&br->br_xino.xi_file->f_path, &st); - if (unlikely(err)) { - AuErr1("statfs err %d, ignored\n", err); - return 0; - } - if (div64_u64(st.f_bfree * 100, st.f_blocks) >= AUFS_XINO_DEF_TRUNC) - return 0; - - return 1; -} - -static void xino_try_trunc(struct super_block *sb, struct au_branch *br) -{ - struct xino_do_trunc_args *args; - int wkq_err; - - if (!xino_trunc_test(sb, br)) - return; - - if (atomic_inc_return(&br->br_xino_running) > 1) - goto out; - - /* lock and kfree() will be called in trunc_xino() */ - args = kmalloc(sizeof(*args), GFP_NOFS); - if (unlikely(!args)) { - AuErr1("no memory\n"); - goto out_args; - } - - atomic_inc(&br->br_count); - args->sb = sb; - args->br = br; - wkq_err = au_wkq_nowait(xino_do_trunc, args, sb, /*flags*/0); - if (!wkq_err) - return; /* success */ - - pr_err("wkq %d\n", wkq_err); - atomic_dec(&br->br_count); - -out_args: - kfree(args); -out: - atomic_dec(&br->br_xino_running); -} - -/* ---------------------------------------------------------------------- */ - -static int au_xino_do_write(au_writef_t write, struct file *file, - ino_t h_ino, ino_t ino) -{ - loff_t pos; - ssize_t sz; - - pos = h_ino; - if (unlikely(au_loff_max / sizeof(ino) - 1 < pos)) { - AuIOErr1("too large hi%lu\n", (unsigned long)h_ino); - return -EFBIG; - } - pos *= sizeof(ino); - sz = xino_fwrite(write, file, &ino, sizeof(ino), &pos); - if (sz == sizeof(ino)) - return 0; /* success */ - - AuIOErr("write failed (%zd)\n", sz); - return -EIO; -} - -/* - * write @ino to the xinofile for the specified branch{@sb, @bindex} - * at the position of @h_ino. - * even if @ino is zero, it is written to the xinofile and means no entry. - * if the size of the xino file on a specific filesystem exceeds the watermark, - * try truncating it. - */ -int au_xino_write(struct super_block *sb, aufs_bindex_t bindex, ino_t h_ino, - ino_t ino) -{ - int err; - unsigned int mnt_flags; - struct au_branch *br; - - BUILD_BUG_ON(sizeof(long long) != sizeof(au_loff_max) - || ((loff_t)-1) > 0); - SiMustAnyLock(sb); - - mnt_flags = au_mntflags(sb); - if (!au_opt_test(mnt_flags, XINO)) - return 0; - - br = au_sbr(sb, bindex); - err = au_xino_do_write(au_sbi(sb)->si_xwrite, br->br_xino.xi_file, - h_ino, ino); - if (!err) { - if (au_opt_test(mnt_flags, TRUNC_XINO) - && au_test_fs_trunc_xino(au_br_sb(br))) - xino_try_trunc(sb, br); - return 0; /* success */ - } - - AuIOErr("write failed (%d)\n", err); - return -EIO; -} - -/* ---------------------------------------------------------------------- */ - -/* aufs inode number bitmap */ - -static const int page_bits = (int)PAGE_SIZE * BITS_PER_BYTE; -static ino_t xib_calc_ino(unsigned long pindex, int bit) -{ - ino_t ino; - - AuDebugOn(bit < 0 || page_bits <= bit); - ino = AUFS_FIRST_INO + pindex * page_bits + bit; - return ino; -} - -static void xib_calc_bit(ino_t ino, unsigned long *pindex, int *bit) -{ - AuDebugOn(ino < AUFS_FIRST_INO); - ino -= AUFS_FIRST_INO; - *pindex = ino / page_bits; - *bit = ino % page_bits; -} - -static int xib_pindex(struct super_block *sb, unsigned long pindex) -{ - int err; - loff_t pos; - ssize_t sz; - struct au_sbinfo *sbinfo; - struct file *xib; - unsigned long *p; - - sbinfo = au_sbi(sb); - MtxMustLock(&sbinfo->si_xib_mtx); - AuDebugOn(pindex > ULONG_MAX / PAGE_SIZE - || !au_opt_test(sbinfo->si_mntflags, XINO)); - - if (pindex == sbinfo->si_xib_last_pindex) - return 0; - - xib = sbinfo->si_xib; - p = sbinfo->si_xib_buf; - pos = sbinfo->si_xib_last_pindex; - pos *= PAGE_SIZE; - sz = xino_fwrite(sbinfo->si_xwrite, xib, p, PAGE_SIZE, &pos); - if (unlikely(sz != PAGE_SIZE)) - goto out; - - pos = pindex; - pos *= PAGE_SIZE; - if (vfsub_f_size_read(xib) >= pos + PAGE_SIZE) - sz = xino_fread(sbinfo->si_xread, xib, p, PAGE_SIZE, &pos); - else { - memset(p, 0, PAGE_SIZE); - sz = xino_fwrite(sbinfo->si_xwrite, xib, p, PAGE_SIZE, &pos); - } - if (sz == PAGE_SIZE) { - sbinfo->si_xib_last_pindex = pindex; - return 0; /* success */ - } - -out: - AuIOErr1("write failed (%zd)\n", sz); - err = sz; - if (sz >= 0) - err = -EIO; - return err; -} - -/* ---------------------------------------------------------------------- */ - -static void au_xib_clear_bit(struct inode *inode) -{ - int err, bit; - unsigned long pindex; - struct super_block *sb; - struct au_sbinfo *sbinfo; - - AuDebugOn(inode->i_nlink); - - sb = inode->i_sb; - xib_calc_bit(inode->i_ino, &pindex, &bit); - AuDebugOn(page_bits <= bit); - sbinfo = au_sbi(sb); - mutex_lock(&sbinfo->si_xib_mtx); - err = xib_pindex(sb, pindex); - if (!err) { - clear_bit(bit, sbinfo->si_xib_buf); - sbinfo->si_xib_next_bit = bit; - } - mutex_unlock(&sbinfo->si_xib_mtx); -} - -/* for s_op->delete_inode() */ -void au_xino_delete_inode(struct inode *inode, const int unlinked) -{ - int err; - unsigned int mnt_flags; - aufs_bindex_t bindex, bend, bi; - unsigned char try_trunc; - struct au_iinfo *iinfo; - struct super_block *sb; - struct au_hinode *hi; - struct inode *h_inode; - struct au_branch *br; - au_writef_t xwrite; - - sb = inode->i_sb; - mnt_flags = au_mntflags(sb); - if (!au_opt_test(mnt_flags, XINO) - || inode->i_ino == AUFS_ROOT_INO) - return; - - if (unlinked) { - au_xigen_inc(inode); - au_xib_clear_bit(inode); - } - - iinfo = au_ii(inode); - if (!iinfo) - return; - - bindex = iinfo->ii_bstart; - if (bindex < 0) - return; - - xwrite = au_sbi(sb)->si_xwrite; - try_trunc = !!au_opt_test(mnt_flags, TRUNC_XINO); - hi = iinfo->ii_hinode + bindex; - bend = iinfo->ii_bend; - for (; bindex <= bend; bindex++, hi++) { - h_inode = hi->hi_inode; - if (!h_inode - || (!unlinked && h_inode->i_nlink)) - continue; - - /* inode may not be revalidated */ - bi = au_br_index(sb, hi->hi_id); - if (bi < 0) - continue; - - br = au_sbr(sb, bi); - err = au_xino_do_write(xwrite, br->br_xino.xi_file, - h_inode->i_ino, /*ino*/0); - if (!err && try_trunc - && au_test_fs_trunc_xino(au_br_sb(br))) - xino_try_trunc(sb, br); - } -} - -/* get an unused inode number from bitmap */ -ino_t au_xino_new_ino(struct super_block *sb) -{ - ino_t ino; - unsigned long *p, pindex, ul, pend; - struct au_sbinfo *sbinfo; - struct file *file; - int free_bit, err; - - if (!au_opt_test(au_mntflags(sb), XINO)) - return iunique(sb, AUFS_FIRST_INO); - - sbinfo = au_sbi(sb); - mutex_lock(&sbinfo->si_xib_mtx); - p = sbinfo->si_xib_buf; - free_bit = sbinfo->si_xib_next_bit; - if (free_bit < page_bits && !test_bit(free_bit, p)) - goto out; /* success */ - free_bit = find_first_zero_bit(p, page_bits); - if (free_bit < page_bits) - goto out; /* success */ - - pindex = sbinfo->si_xib_last_pindex; - for (ul = pindex - 1; ul < ULONG_MAX; ul--) { - err = xib_pindex(sb, ul); - if (unlikely(err)) - goto out_err; - free_bit = find_first_zero_bit(p, page_bits); - if (free_bit < page_bits) - goto out; /* success */ - } - - file = sbinfo->si_xib; - pend = vfsub_f_size_read(file) / PAGE_SIZE; - for (ul = pindex + 1; ul <= pend; ul++) { - err = xib_pindex(sb, ul); - if (unlikely(err)) - goto out_err; - free_bit = find_first_zero_bit(p, page_bits); - if (free_bit < page_bits) - goto out; /* success */ - } - BUG(); - -out: - set_bit(free_bit, p); - sbinfo->si_xib_next_bit = free_bit + 1; - pindex = sbinfo->si_xib_last_pindex; - mutex_unlock(&sbinfo->si_xib_mtx); - ino = xib_calc_ino(pindex, free_bit); - AuDbg("i%lu\n", (unsigned long)ino); - return ino; -out_err: - mutex_unlock(&sbinfo->si_xib_mtx); - AuDbg("i0\n"); - return 0; -} - -/* - * read @ino from xinofile for the specified branch{@sb, @bindex} - * at the position of @h_ino. - * if @ino does not exist and @do_new is true, get new one. - */ -int au_xino_read(struct super_block *sb, aufs_bindex_t bindex, ino_t h_ino, - ino_t *ino) -{ - int err; - ssize_t sz; - loff_t pos; - struct file *file; - struct au_sbinfo *sbinfo; - - *ino = 0; - if (!au_opt_test(au_mntflags(sb), XINO)) - return 0; /* no xino */ - - err = 0; - sbinfo = au_sbi(sb); - pos = h_ino; - if (unlikely(au_loff_max / sizeof(*ino) - 1 < pos)) { - AuIOErr1("too large hi%lu\n", (unsigned long)h_ino); - return -EFBIG; - } - pos *= sizeof(*ino); - - file = au_sbr(sb, bindex)->br_xino.xi_file; - if (vfsub_f_size_read(file) < pos + sizeof(*ino)) - return 0; /* no ino */ - - sz = xino_fread(sbinfo->si_xread, file, ino, sizeof(*ino), &pos); - if (sz == sizeof(*ino)) - return 0; /* success */ - - err = sz; - if (unlikely(sz >= 0)) { - err = -EIO; - AuIOErr("xino read error (%zd)\n", sz); - } - - return err; -} - -/* ---------------------------------------------------------------------- */ - -/* create and set a new xino file */ - -struct file *au_xino_create(struct super_block *sb, char *fname, int silent) -{ - struct file *file; - struct dentry *h_parent, *d; - struct inode *h_dir; - int err; - - /* - * at mount-time, and the xino file is the default path, - * hnotify is disabled so we have no notify events to ignore. - * when a user specified the xino, we cannot get au_hdir to be ignored. - */ - file = vfsub_filp_open(fname, O_RDWR | O_CREAT | O_EXCL | O_LARGEFILE - /* | __FMODE_NONOTIFY */, - S_IRUGO | S_IWUGO); - if (IS_ERR(file)) { - if (!silent) - pr_err("open %s(%ld)\n", fname, PTR_ERR(file)); - return file; - } - - /* keep file count */ - h_parent = dget_parent(file->f_dentry); - h_dir = h_parent->d_inode; - mutex_lock_nested(&h_dir->i_mutex, AuLsc_I_PARENT); - /* mnt_want_write() is unnecessary here */ - err = vfsub_unlink(h_dir, &file->f_path, /*force*/0); - mutex_unlock(&h_dir->i_mutex); - dput(h_parent); - if (unlikely(err)) { - if (!silent) - pr_err("unlink %s(%d)\n", fname, err); - goto out; - } - - err = -EINVAL; - d = file->f_dentry; - if (unlikely(sb == d->d_sb)) { - if (!silent) - pr_err("%s must be outside\n", fname); - goto out; - } - if (unlikely(au_test_fs_bad_xino(d->d_sb))) { - if (!silent) - pr_err("xino doesn't support %s(%s)\n", - fname, au_sbtype(d->d_sb)); - goto out; - } - return file; /* success */ - -out: - fput(file); - file = ERR_PTR(err); - return file; -} - -/* - * find another branch who is on the same filesystem of the specified - * branch{@btgt}. search until @bend. - */ -static int is_sb_shared(struct super_block *sb, aufs_bindex_t btgt, - aufs_bindex_t bend) -{ - aufs_bindex_t bindex; - struct super_block *tgt_sb = au_sbr_sb(sb, btgt); - - for (bindex = 0; bindex < btgt; bindex++) - if (unlikely(tgt_sb == au_sbr_sb(sb, bindex))) - return bindex; - for (bindex++; bindex <= bend; bindex++) - if (unlikely(tgt_sb == au_sbr_sb(sb, bindex))) - return bindex; - return -1; -} - -/* ---------------------------------------------------------------------- */ - -/* - * initialize the xinofile for the specified branch @br - * at the place/path where @base_file indicates. - * test whether another branch is on the same filesystem or not, - * if @do_test is true. - */ -int au_xino_br(struct super_block *sb, struct au_branch *br, ino_t h_ino, - struct file *base_file, int do_test) -{ - int err; - ino_t ino; - aufs_bindex_t bend, bindex; - struct au_branch *shared_br, *b; - struct file *file; - struct super_block *tgt_sb; - - shared_br = NULL; - bend = au_sbend(sb); - if (do_test) { - tgt_sb = au_br_sb(br); - for (bindex = 0; bindex <= bend; bindex++) { - b = au_sbr(sb, bindex); - if (tgt_sb == au_br_sb(b)) { - shared_br = b; - break; - } - } - } - - if (!shared_br || !shared_br->br_xino.xi_file) { - struct au_xino_lock_dir ldir; - - au_xino_lock_dir(sb, base_file, &ldir); - /* mnt_want_write() is unnecessary here */ - file = au_xino_create2(base_file, NULL); - au_xino_unlock_dir(&ldir); - err = PTR_ERR(file); - if (IS_ERR(file)) - goto out; - br->br_xino.xi_file = file; - } else { - br->br_xino.xi_file = shared_br->br_xino.xi_file; - get_file(br->br_xino.xi_file); - } - - ino = AUFS_ROOT_INO; - err = au_xino_do_write(au_sbi(sb)->si_xwrite, br->br_xino.xi_file, - h_ino, ino); - if (unlikely(err)) { - fput(br->br_xino.xi_file); - br->br_xino.xi_file = NULL; - } - -out: - return err; -} - -/* ---------------------------------------------------------------------- */ - -/* trucate a xino bitmap file */ - -/* todo: slow */ -static int do_xib_restore(struct super_block *sb, struct file *file, void *page) -{ - int err, bit; - ssize_t sz; - unsigned long pindex; - loff_t pos, pend; - struct au_sbinfo *sbinfo; - au_readf_t func; - ino_t *ino; - unsigned long *p; - - err = 0; - sbinfo = au_sbi(sb); - MtxMustLock(&sbinfo->si_xib_mtx); - p = sbinfo->si_xib_buf; - func = sbinfo->si_xread; - pend = vfsub_f_size_read(file); - pos = 0; - while (pos < pend) { - sz = xino_fread(func, file, page, PAGE_SIZE, &pos); - err = sz; - if (unlikely(sz <= 0)) - goto out; - - err = 0; - for (ino = page; sz > 0; ino++, sz -= sizeof(ino)) { - if (unlikely(*ino < AUFS_FIRST_INO)) - continue; - - xib_calc_bit(*ino, &pindex, &bit); - AuDebugOn(page_bits <= bit); - err = xib_pindex(sb, pindex); - if (!err) - set_bit(bit, p); - else - goto out; - } - } - -out: - return err; -} - -static int xib_restore(struct super_block *sb) -{ - int err; - aufs_bindex_t bindex, bend; - void *page; - - err = -ENOMEM; - page = (void *)__get_free_page(GFP_NOFS); - if (unlikely(!page)) - goto out; - - err = 0; - bend = au_sbend(sb); - for (bindex = 0; !err && bindex <= bend; bindex++) - if (!bindex || is_sb_shared(sb, bindex, bindex - 1) < 0) - err = do_xib_restore - (sb, au_sbr(sb, bindex)->br_xino.xi_file, page); - else - AuDbg("b%d\n", bindex); - free_page((unsigned long)page); - -out: - return err; -} - -int au_xib_trunc(struct super_block *sb) -{ - int err; - ssize_t sz; - loff_t pos; - struct au_xino_lock_dir ldir; - struct au_sbinfo *sbinfo; - unsigned long *p; - struct file *file; - - SiMustWriteLock(sb); - - err = 0; - sbinfo = au_sbi(sb); - if (!au_opt_test(sbinfo->si_mntflags, XINO)) - goto out; - - file = sbinfo->si_xib; - if (vfsub_f_size_read(file) <= PAGE_SIZE) - goto out; - - au_xino_lock_dir(sb, file, &ldir); - /* mnt_want_write() is unnecessary here */ - file = au_xino_create2(sbinfo->si_xib, NULL); - au_xino_unlock_dir(&ldir); - err = PTR_ERR(file); - if (IS_ERR(file)) - goto out; - fput(sbinfo->si_xib); - sbinfo->si_xib = file; - - p = sbinfo->si_xib_buf; - memset(p, 0, PAGE_SIZE); - pos = 0; - sz = xino_fwrite(sbinfo->si_xwrite, sbinfo->si_xib, p, PAGE_SIZE, &pos); - if (unlikely(sz != PAGE_SIZE)) { - err = sz; - AuIOErr("err %d\n", err); - if (sz >= 0) - err = -EIO; - goto out; - } - - mutex_lock(&sbinfo->si_xib_mtx); - /* mnt_want_write() is unnecessary here */ - err = xib_restore(sb); - mutex_unlock(&sbinfo->si_xib_mtx); - -out: - return err; -} - -/* ---------------------------------------------------------------------- */ - -/* - * xino mount option handlers - */ -static au_readf_t find_readf(struct file *h_file) -{ - const struct file_operations *fop = h_file->f_op; - - if (fop) { - if (fop->read) - return fop->read; - if (fop->aio_read) - return do_sync_read; - } - return ERR_PTR(-ENOSYS); -} - -static au_writef_t find_writef(struct file *h_file) -{ - const struct file_operations *fop = h_file->f_op; - - if (fop) { - if (fop->write) - return fop->write; - if (fop->aio_write) - return do_sync_write; - } - return ERR_PTR(-ENOSYS); -} - -/* xino bitmap */ -static void xino_clear_xib(struct super_block *sb) -{ - struct au_sbinfo *sbinfo; - - SiMustWriteLock(sb); - - sbinfo = au_sbi(sb); - sbinfo->si_xread = NULL; - sbinfo->si_xwrite = NULL; - if (sbinfo->si_xib) - fput(sbinfo->si_xib); - sbinfo->si_xib = NULL; - free_page((unsigned long)sbinfo->si_xib_buf); - sbinfo->si_xib_buf = NULL; -} - -static int au_xino_set_xib(struct super_block *sb, struct file *base) -{ - int err; - loff_t pos; - struct au_sbinfo *sbinfo; - struct file *file; - - SiMustWriteLock(sb); - - sbinfo = au_sbi(sb); - file = au_xino_create2(base, sbinfo->si_xib); - err = PTR_ERR(file); - if (IS_ERR(file)) - goto out; - if (sbinfo->si_xib) - fput(sbinfo->si_xib); - sbinfo->si_xib = file; - sbinfo->si_xread = find_readf(file); - sbinfo->si_xwrite = find_writef(file); - - err = -ENOMEM; - if (!sbinfo->si_xib_buf) - sbinfo->si_xib_buf = (void *)get_zeroed_page(GFP_NOFS); - if (unlikely(!sbinfo->si_xib_buf)) - goto out_unset; - - sbinfo->si_xib_last_pindex = 0; - sbinfo->si_xib_next_bit = 0; - if (vfsub_f_size_read(file) < PAGE_SIZE) { - pos = 0; - err = xino_fwrite(sbinfo->si_xwrite, file, sbinfo->si_xib_buf, - PAGE_SIZE, &pos); - if (unlikely(err != PAGE_SIZE)) - goto out_free; - } - err = 0; - goto out; /* success */ - -out_free: - free_page((unsigned long)sbinfo->si_xib_buf); - sbinfo->si_xib_buf = NULL; - if (err >= 0) - err = -EIO; -out_unset: - fput(sbinfo->si_xib); - sbinfo->si_xib = NULL; - sbinfo->si_xread = NULL; - sbinfo->si_xwrite = NULL; -out: - return err; -} - -/* xino for each branch */ -static void xino_clear_br(struct super_block *sb) -{ - aufs_bindex_t bindex, bend; - struct au_branch *br; - - bend = au_sbend(sb); - for (bindex = 0; bindex <= bend; bindex++) { - br = au_sbr(sb, bindex); - if (!br || !br->br_xino.xi_file) - continue; - - fput(br->br_xino.xi_file); - br->br_xino.xi_file = NULL; - } -} - -static int au_xino_set_br(struct super_block *sb, struct file *base) -{ - int err; - ino_t ino; - aufs_bindex_t bindex, bend, bshared; - struct { - struct file *old, *new; - } *fpair, *p; - struct au_branch *br; - struct inode *inode; - au_writef_t writef; - - SiMustWriteLock(sb); - - err = -ENOMEM; - bend = au_sbend(sb); - fpair = kcalloc(bend + 1, sizeof(*fpair), GFP_NOFS); - if (unlikely(!fpair)) - goto out; - - inode = sb->s_root->d_inode; - ino = AUFS_ROOT_INO; - writef = au_sbi(sb)->si_xwrite; - for (bindex = 0, p = fpair; bindex <= bend; bindex++, p++) { - br = au_sbr(sb, bindex); - bshared = is_sb_shared(sb, bindex, bindex - 1); - if (bshared >= 0) { - /* shared xino */ - *p = fpair[bshared]; - get_file(p->new); - } - - if (!p->new) { - /* new xino */ - p->old = br->br_xino.xi_file; - p->new = au_xino_create2(base, br->br_xino.xi_file); - err = PTR_ERR(p->new); - if (IS_ERR(p->new)) { - p->new = NULL; - goto out_pair; - } - } - - err = au_xino_do_write(writef, p->new, - au_h_iptr(inode, bindex)->i_ino, ino); - if (unlikely(err)) - goto out_pair; - } - - for (bindex = 0, p = fpair; bindex <= bend; bindex++, p++) { - br = au_sbr(sb, bindex); - if (br->br_xino.xi_file) - fput(br->br_xino.xi_file); - get_file(p->new); - br->br_xino.xi_file = p->new; - } - -out_pair: - for (bindex = 0, p = fpair; bindex <= bend; bindex++, p++) - if (p->new) - fput(p->new); - else - break; - kfree(fpair); -out: - return err; -} - -void au_xino_clr(struct super_block *sb) -{ - struct au_sbinfo *sbinfo; - - au_xigen_clr(sb); - xino_clear_xib(sb); - xino_clear_br(sb); - sbinfo = au_sbi(sb); - /* lvalue, do not call au_mntflags() */ - au_opt_clr(sbinfo->si_mntflags, XINO); -} - -int au_xino_set(struct super_block *sb, struct au_opt_xino *xino, int remount) -{ - int err, skip; - struct dentry *parent, *cur_parent; - struct qstr *dname, *cur_name; - struct file *cur_xino; - struct inode *dir; - struct au_sbinfo *sbinfo; - - SiMustWriteLock(sb); - - err = 0; - sbinfo = au_sbi(sb); - parent = dget_parent(xino->file->f_dentry); - if (remount) { - skip = 0; - dname = &xino->file->f_dentry->d_name; - cur_xino = sbinfo->si_xib; - if (cur_xino) { - cur_parent = dget_parent(cur_xino->f_dentry); - cur_name = &cur_xino->f_dentry->d_name; - skip = (cur_parent == parent - && au_qstreq(dname, cur_name)); - dput(cur_parent); - } - if (skip) - goto out; - } - - au_opt_set(sbinfo->si_mntflags, XINO); - dir = parent->d_inode; - mutex_lock_nested(&dir->i_mutex, AuLsc_I_PARENT); - /* mnt_want_write() is unnecessary here */ - err = au_xino_set_xib(sb, xino->file); - if (!err) - err = au_xigen_set(sb, xino->file); - if (!err) - err = au_xino_set_br(sb, xino->file); - mutex_unlock(&dir->i_mutex); - if (!err) - goto out; /* success */ - - /* reset all */ - AuIOErr("failed creating xino(%d).\n", err); - -out: - dput(parent); - return err; -} - -/* ---------------------------------------------------------------------- */ - -/* - * create a xinofile at the default place/path. - */ -struct file *au_xino_def(struct super_block *sb) -{ - struct file *file; - char *page, *p; - struct au_branch *br; - struct super_block *h_sb; - struct path path; - aufs_bindex_t bend, bindex, bwr; - - br = NULL; - bend = au_sbend(sb); - bwr = -1; - for (bindex = 0; bindex <= bend; bindex++) { - br = au_sbr(sb, bindex); - if (au_br_writable(br->br_perm) - && !au_test_fs_bad_xino(au_br_sb(br))) { - bwr = bindex; - break; - } - } - - if (bwr >= 0) { - file = ERR_PTR(-ENOMEM); - page = (void *)__get_free_page(GFP_NOFS); - if (unlikely(!page)) - goto out; - path.mnt = au_br_mnt(br); - path.dentry = au_h_dptr(sb->s_root, bwr); - p = d_path(&path, page, PATH_MAX - sizeof(AUFS_XINO_FNAME)); - file = (void *)p; - if (!IS_ERR(p)) { - strcat(p, "/" AUFS_XINO_FNAME); - AuDbg("%s\n", p); - file = au_xino_create(sb, p, /*silent*/0); - if (!IS_ERR(file)) - au_xino_brid_set(sb, br->br_id); - } - free_page((unsigned long)page); - } else { - file = au_xino_create(sb, AUFS_XINO_DEFPATH, /*silent*/0); - if (IS_ERR(file)) - goto out; - h_sb = file->f_dentry->d_sb; - if (unlikely(au_test_fs_bad_xino(h_sb))) { - pr_err("xino doesn't support %s(%s)\n", - AUFS_XINO_DEFPATH, au_sbtype(h_sb)); - fput(file); - file = ERR_PTR(-EINVAL); - } - if (!IS_ERR(file)) - au_xino_brid_set(sb, -1); - } - -out: - return file; -} - -/* ---------------------------------------------------------------------- */ - -int au_xino_path(struct seq_file *seq, struct file *file) -{ - int err; - - err = au_seq_path(seq, &file->f_path); - if (unlikely(err < 0)) - goto out; - - err = 0; -#define Deleted "\\040(deleted)" - seq->count -= sizeof(Deleted) - 1; - AuDebugOn(memcmp(seq->buf + seq->count, Deleted, - sizeof(Deleted) - 1)); -#undef Deleted - -out: - return err; -} diff --git a/fs/buffer.c b/fs/buffer.c index 8f474366a6820d..83fedaa53b55c0 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -2399,7 +2399,7 @@ int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, * Update file times before taking page lock. We may end up failing the * fault so this update may be superfluous but who really cares... */ - vma_file_update_time(vma); + file_update_time(vma->vm_file); ret = __block_page_mkwrite(vma, vmf, get_block); sb_end_pagefault(sb); diff --git a/fs/file_table.c b/fs/file_table.c index d108b539647317..54a34be444f904 100644 --- a/fs/file_table.c +++ b/fs/file_table.c @@ -36,8 +36,7 @@ struct files_stat_struct files_stat = { .max_files = NR_FILE }; -DEFINE_LGLOCK(files_lglock); -EXPORT_SYMBOL(files_lglock); +DEFINE_STATIC_LGLOCK(files_lglock); /* SLAB cache for file structures */ static struct kmem_cache *filp_cachep __read_mostly; @@ -406,8 +405,6 @@ void file_sb_list_del(struct file *file) } } -EXPORT_SYMBOL(file_sb_list_del); - #ifdef CONFIG_SMP /* diff --git a/fs/inode.c b/fs/inode.c index 3a42c7c8b21e97..1b300a06b8be34 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -56,7 +56,6 @@ static struct hlist_head *inode_hashtable __read_mostly; static __cacheline_aligned_in_smp DEFINE_SPINLOCK(inode_hash_lock); __cacheline_aligned_in_smp DEFINE_SPINLOCK(inode_sb_list_lock); -EXPORT_SYMBOL(inode_sb_list_lock); /* * Empty aops. Can be used for the cases where the user does not @@ -1499,7 +1498,7 @@ static int relatime_need_update(struct vfsmount *mnt, struct inode *inode, * This does the actual work of updating an inodes time or version. Must have * had called mnt_want_write() before calling this. */ -int update_time(struct inode *inode, struct timespec *time, int flags) +static int update_time(struct inode *inode, struct timespec *time, int flags) { if (inode->i_op->update_time) return inode->i_op->update_time(inode, time, flags); @@ -1515,7 +1514,6 @@ int update_time(struct inode *inode, struct timespec *time, int flags) mark_inode_dirty_sync(inode); return 0; } -EXPORT_SYMBOL(update_time); /** * touch_atime - update the access time diff --git a/fs/namei.c b/fs/namei.c index 716c0eb3d2475a..036c21246d6aba 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -221,7 +221,7 @@ void putname(struct filename *name) } #endif -int check_acl(struct inode *inode, int mask) +static int check_acl(struct inode *inode, int mask) { #ifdef CONFIG_FS_POSIX_ACL struct posix_acl *acl; @@ -266,7 +266,6 @@ int check_acl(struct inode *inode, int mask) return -EAGAIN; } -EXPORT_SYMBOL(check_acl); /* * This does the basic permission checking diff --git a/fs/namespace.c b/fs/namespace.c index 8ecc31c0d877b4..d0244c8ba09c8e 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -54,7 +54,6 @@ EXPORT_SYMBOL_GPL(fs_kobj); * tree or hash is modified or when a vfsmount structure is modified. */ DEFINE_BRLOCK(vfsmount_lock); -EXPORT_SYMBOL(vfsmount_lock); static inline unsigned long hash(struct vfsmount *mnt, struct dentry *dentry) { @@ -428,7 +427,6 @@ void __mnt_drop_write(struct vfsmount *mnt) mnt_dec_writers(real_mount(mnt)); preempt_enable(); } -EXPORT_SYMBOL_GPL(__mnt_drop_write); /** * mnt_drop_write - give up write access to a mount @@ -1476,7 +1474,6 @@ int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg, } return 0; } -EXPORT_SYMBOL(iterate_mounts); static void cleanup_group_ids(struct mount *mnt, struct mount *end) { diff --git a/fs/notify/group.c b/fs/notify/group.c index 2ff2a0fd5aea39..bd2625bd88b47a 100644 --- a/fs/notify/group.c +++ b/fs/notify/group.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include "fsnotify.h" @@ -66,7 +65,6 @@ void fsnotify_get_group(struct fsnotify_group *group) { atomic_inc(&group->refcnt); } -EXPORT_SYMBOL(fsnotify_get_group); /* * Drop a reference to a group. Free it if it's through. @@ -76,7 +74,6 @@ void fsnotify_put_group(struct fsnotify_group *group) if (atomic_dec_and_test(&group->refcnt)) fsnotify_final_destroy_group(group); } -EXPORT_SYMBOL(fsnotify_put_group); /* * Create a new fsnotify_group and hold a reference for the group returned. @@ -105,7 +102,6 @@ struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops) return group; } -EXPORT_SYMBOL(fsnotify_alloc_group); int fsnotify_fasync(int fd, struct file *file, int on) { diff --git a/fs/notify/mark.c b/fs/notify/mark.c index a6bb87dcbe3d14..fc6b49bf73600c 100644 --- a/fs/notify/mark.c +++ b/fs/notify/mark.c @@ -115,7 +115,6 @@ void fsnotify_put_mark(struct fsnotify_mark *mark) mark->free_mark(mark); } } -EXPORT_SYMBOL(fsnotify_put_mark); /* * Any time a mark is getting freed we end up here. @@ -198,7 +197,6 @@ void fsnotify_destroy_mark(struct fsnotify_mark *mark, fsnotify_destroy_mark_locked(mark, group); mutex_unlock(&group->mark_mutex); } -EXPORT_SYMBOL(fsnotify_destroy_mark); void fsnotify_set_mark_mask_locked(struct fsnotify_mark *mark, __u32 mask) { @@ -283,7 +281,6 @@ int fsnotify_add_mark_locked(struct fsnotify_mark *mark, return ret; } -EXPORT_SYMBOL(fsnotify_add_mark); int fsnotify_add_mark(struct fsnotify_mark *mark, struct fsnotify_group *group, struct inode *inode, struct vfsmount *mnt, int allow_dups) @@ -345,7 +342,6 @@ void fsnotify_init_mark(struct fsnotify_mark *mark, atomic_set(&mark->refcnt, 1); mark->free_mark = free_mark; } -EXPORT_SYMBOL(fsnotify_init_mark); static int fsnotify_mark_destroy(void *ignored) { diff --git a/fs/open.c b/fs/open.c index bcb352dcdaf9f4..86092bde31f482 100644 --- a/fs/open.c +++ b/fs/open.c @@ -61,7 +61,6 @@ int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs, mutex_unlock(&dentry->d_inode->i_mutex); return ret; } -EXPORT_SYMBOL(do_truncate); long vfs_truncate(struct path *path, loff_t length) { @@ -279,7 +278,6 @@ int do_fallocate(struct file *file, int mode, loff_t offset, loff_t len) sb_end_write(inode->i_sb); return ret; } -EXPORT_SYMBOL(do_fallocate); SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len) { diff --git a/fs/proc/base.c b/fs/proc/base.c index bae6736d25bb26..fb8447f147650e 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -1835,7 +1835,7 @@ static int proc_map_files_get_link(struct dentry *dentry, struct path *path) down_read(&mm->mmap_sem); vma = find_exact_vma(mm, vm_start, vm_end); if (vma && vma->vm_file) { - *path = vma_pr_or_file(vma)->f_path; + *path = vma->vm_file->f_path; path_get(path); rc = 0; } diff --git a/fs/proc/nommu.c b/fs/proc/nommu.c index 1f584c3ee6f0d7..ccfd99bd1c5a62 100644 --- a/fs/proc/nommu.c +++ b/fs/proc/nommu.c @@ -45,10 +45,7 @@ static int nommu_region_show(struct seq_file *m, struct vm_region *region) file = region->vm_file; if (file) { - struct inode *inode; - - file = vmr_pr_or_file(region); - inode = file_inode(file); + struct inode *inode = file_inode(region->vm_file); dev = inode->i_sb->s_dev; ino = inode->i_ino; } diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index ec7abcf48fd7d6..e22d93eee4d2de 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -321,10 +321,7 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid) const char *name = NULL; if (file) { - struct inode *inode; - - file = vma_pr_or_file(vma); - inode = file_inode(file); + struct inode *inode = file_inode(vma->vm_file); dev = inode->i_sb->s_dev; ino = inode->i_ino; pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT; @@ -1359,7 +1356,6 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid) seq_printf(m, "%08lx %s", vma->vm_start, buffer); if (file) { - file = vma_pr_or_file(vma); seq_printf(m, " file="); seq_path(m, &file->f_path, "\n\t= "); } else if (vma->vm_start <= mm->brk && vma->vm_end >= mm->start_brk) { diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c index bf8498949d234e..56123a6f462e7d 100644 --- a/fs/proc/task_nommu.c +++ b/fs/proc/task_nommu.c @@ -149,10 +149,7 @@ static int nommu_vma_show(struct seq_file *m, struct vm_area_struct *vma, file = vma->vm_file; if (file) { - struct inode *inode; - - file = vma_pr_or_file(file); - inode = file_inode(file); + struct inode *inode = file_inode(vma->vm_file); dev = inode->i_sb->s_dev; ino = inode->i_ino; pgoff = (loff_t)vma->vm_pgoff << PAGE_SHIFT; diff --git a/fs/splice.c b/fs/splice.c index 5e951eac4bfb3f..f183f1342c0127 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -1115,8 +1115,8 @@ EXPORT_SYMBOL(generic_splice_sendpage); /* * Attempt to initiate a splice from pipe to file. */ -long do_splice_from(struct pipe_inode_info *pipe, struct file *out, - loff_t *ppos, size_t len, unsigned int flags) +static long do_splice_from(struct pipe_inode_info *pipe, struct file *out, + loff_t *ppos, size_t len, unsigned int flags) { ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); @@ -1142,14 +1142,13 @@ long do_splice_from(struct pipe_inode_info *pipe, struct file *out, file_end_write(out); return ret; } -EXPORT_SYMBOL(do_splice_from); /* * Attempt to initiate a splice from a file to a pipe. */ -long do_splice_to(struct file *in, loff_t *ppos, - struct pipe_inode_info *pipe, size_t len, - unsigned int flags) +static long do_splice_to(struct file *in, loff_t *ppos, + struct pipe_inode_info *pipe, size_t len, + unsigned int flags) { ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); @@ -1169,7 +1168,6 @@ long do_splice_to(struct file *in, loff_t *ppos, return splice_read(in, ppos, pipe, len, flags); } -EXPORT_SYMBOL(do_splice_to); /** * splice_direct_to_actor - splices data directly between two non-pipes diff --git a/fs/xattr.c b/fs/xattr.c index 1de03c80b68ee4..3377dff1840420 100644 --- a/fs/xattr.c +++ b/fs/xattr.c @@ -207,7 +207,6 @@ vfs_getxattr_alloc(struct dentry *dentry, const char *name, char **xattr_value, *xattr_value = value; return error; } -EXPORT_SYMBOL(vfs_getxattr_alloc); /* Compare an extended attribute value with the given value */ int vfs_xattr_cmp(struct dentry *dentry, const char *xattr_name, diff --git a/include/linux/fs.h b/include/linux/fs.h index c6b2c2c1cde952..9e452045b328db 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2024,7 +2024,6 @@ extern struct file * dentry_open(const struct path *, int, const struct cred *); extern int filp_close(struct file *, fl_owner_t id); extern struct filename *getname(const char __user *); -int check_acl(struct inode *, int); enum { FILE_CREATED = 1, @@ -2591,7 +2590,6 @@ extern int inode_change_ok(const struct inode *, struct iattr *); extern int inode_newsize_ok(const struct inode *, loff_t offset); extern void setattr_copy(struct inode *inode, const struct iattr *attr); -extern int update_time(struct inode *, struct timespec *, int); extern int file_update_time(struct file *file); extern int generic_show_options(struct seq_file *m, struct dentry *root); diff --git a/include/linux/mm.h b/include/linux/mm.h index 9ab650a532bcda..05c2f69ce6b532 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1037,28 +1037,6 @@ static inline int fixup_user_fault(struct task_struct *tsk, } #endif -#ifdef CONFIG_MMU -extern void vma_do_file_update_time(struct vm_area_struct *, const char[], int); -extern struct file *vma_do_pr_or_file(struct vm_area_struct *, const char[], - int); -extern void vma_do_get_file(struct vm_area_struct *, const char[], int); -extern void vma_do_fput(struct vm_area_struct *, const char[], int); - -#define vma_file_update_time(vma) vma_do_file_update_time(vma, __func__, \ - __LINE__) -#define vma_pr_or_file(vma) vma_do_pr_or_file(vma, __func__, \ - __LINE__) -#define vma_get_file(vma) vma_do_get_file(vma, __func__, __LINE__) -#define vma_fput(vma) vma_do_fput(vma, __func__, __LINE__) -#else -extern struct file *vmr_do_pr_or_file(struct vm_region *, const char[], int); -extern void vmr_do_fput(struct vm_region *, const char[], int); - -#define vmr_pr_or_file(region) vmr_do_pr_or_file(region, __func__, \ - __LINE__) -#define vmr_fput(region) vmr_do_fput(region, __func__, __LINE__) -#endif /* CONFIG_MMU */ - extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); extern int access_remote_vm(struct mm_struct *mm, unsigned long addr, void *buf, int len, int write); diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index dcd1362cf99e1d..27e08cee8103ea 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -213,7 +213,6 @@ struct vm_region { unsigned long vm_top; /* region allocated to here */ unsigned long vm_pgoff; /* the offset in vm_file corresponding to vm_start */ struct file *vm_file; /* the backing file or NULL */ - struct file *vm_prfile; /* the virtual backing file or NULL */ int vm_usage; /* region usage count (access under nommu_region_sem) */ bool vm_icache_flushed : 1; /* true if the icache has been flushed for @@ -283,7 +282,6 @@ struct vm_area_struct { unsigned long vm_pgoff; /* Offset (within vm_file) in PAGE_SIZE units, *not* PAGE_CACHE_SIZE */ struct file * vm_file; /* File we map to (can be NULL). */ - struct file *vm_prfile; /* shadow of vm_file */ void * vm_private_data; /* was vm_pte (shared mem) */ #ifndef CONFIG_MMU diff --git a/include/linux/splice.h b/include/linux/splice.h index bfc6fb669d8ebd..74575cbf2d6f57 100644 --- a/include/linux/splice.h +++ b/include/linux/splice.h @@ -92,10 +92,4 @@ extern void splice_shrink_spd(struct splice_pipe_desc *); extern void spd_release_page(struct splice_pipe_desc *, unsigned int); extern const struct pipe_buf_operations page_cache_pipe_buf_ops; - -extern long do_splice_from(struct pipe_inode_info *pipe, struct file *out, - loff_t *ppos, size_t len, unsigned int flags); -extern long do_splice_to(struct file *in, loff_t *ppos, - struct pipe_inode_info *pipe, size_t len, - unsigned int flags); #endif diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild index 349600cd815fe0..bdc6e87ff3eb37 100644 --- a/include/uapi/linux/Kbuild +++ b/include/uapi/linux/Kbuild @@ -56,7 +56,6 @@ header-y += atmppp.h header-y += atmsap.h header-y += atmsvc.h header-y += audit.h -header-y += aufs_type.h header-y += auto_fs.h header-y += auto_fs4.h header-y += auxvec.h diff --git a/include/uapi/linux/aufs_type.h b/include/uapi/linux/aufs_type.h deleted file mode 100644 index 7fea7f031b50e2..00000000000000 --- a/include/uapi/linux/aufs_type.h +++ /dev/null @@ -1,418 +0,0 @@ -/* - * Copyright (C) 2005-2014 Junjiro R. Okajima - * - * This program, aufs 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, see . - */ - -#ifndef __AUFS_TYPE_H__ -#define __AUFS_TYPE_H__ - -#define AUFS_NAME "aufs" - -#ifdef __KERNEL__ -/* - * define it before including all other headers. - * sched.h may use pr_* macros before defining "current", so define the - * no-current version first, and re-define later. - */ -#define pr_fmt(fmt) AUFS_NAME " %s:%d: " fmt, __func__, __LINE__ -#include -#undef pr_fmt -#define pr_fmt(fmt) \ - AUFS_NAME " %s:%d:%.*s[%d]: " fmt, __func__, __LINE__, \ - (int)sizeof(current->comm), current->comm, current->pid -#else -#include -#include -#endif /* __KERNEL__ */ - -#include - -#define AUFS_VERSION "3.10.x-20141215" - -/* todo? move this to linux-2.6.19/include/magic.h */ -#define AUFS_SUPER_MAGIC ('a' << 24 | 'u' << 16 | 'f' << 8 | 's') - -/* ---------------------------------------------------------------------- */ - -#ifdef CONFIG_AUFS_BRANCH_MAX_127 -typedef int8_t aufs_bindex_t; -#define AUFS_BRANCH_MAX 127 -#else -typedef int16_t aufs_bindex_t; -#ifdef CONFIG_AUFS_BRANCH_MAX_511 -#define AUFS_BRANCH_MAX 511 -#elif defined(CONFIG_AUFS_BRANCH_MAX_1023) -#define AUFS_BRANCH_MAX 1023 -#elif defined(CONFIG_AUFS_BRANCH_MAX_32767) -#define AUFS_BRANCH_MAX 32767 -#endif -#endif - -#ifdef __KERNEL__ -#ifndef AUFS_BRANCH_MAX -#error unknown CONFIG_AUFS_BRANCH_MAX value -#endif -#endif /* __KERNEL__ */ - -/* ---------------------------------------------------------------------- */ - -#define AUFS_FSTYPE AUFS_NAME - -#define AUFS_ROOT_INO 2 -#define AUFS_FIRST_INO 11 - -#define AUFS_WH_PFX ".wh." -#define AUFS_WH_PFX_LEN ((int)sizeof(AUFS_WH_PFX) - 1) -#define AUFS_WH_TMP_LEN 4 -/* a limit for rmdir/rename a dir and copyup */ -#define AUFS_MAX_NAMELEN (NAME_MAX \ - - AUFS_WH_PFX_LEN * 2 /* doubly whiteouted */\ - - 1 /* dot */\ - - AUFS_WH_TMP_LEN) /* hex */ -#define AUFS_XINO_FNAME "." AUFS_NAME ".xino" -#define AUFS_XINO_DEFPATH "/tmp/" AUFS_XINO_FNAME -#define AUFS_XINO_DEF_SEC 30 /* seconds */ -#define AUFS_XINO_DEF_TRUNC 45 /* percentage */ -#define AUFS_DIRWH_DEF 3 -#define AUFS_RDCACHE_DEF 10 /* seconds */ -#define AUFS_RDCACHE_MAX 3600 /* seconds */ -#define AUFS_RDBLK_DEF 512 /* bytes */ -#define AUFS_RDHASH_DEF 32 -#define AUFS_WKQ_NAME AUFS_NAME "d" -#define AUFS_MFS_DEF_SEC 30 /* seconds */ -#define AUFS_MFS_MAX_SEC 3600 /* seconds */ -#define AUFS_FHSM_CACHE_DEF_SEC 30 /* seconds */ -#define AUFS_PLINK_WARN 50 /* number of plinks in a single bucket */ - -/* pseudo-link maintenace under /proc */ -#define AUFS_PLINK_MAINT_NAME "plink_maint" -#define AUFS_PLINK_MAINT_DIR "fs/" AUFS_NAME -#define AUFS_PLINK_MAINT_PATH AUFS_PLINK_MAINT_DIR "/" AUFS_PLINK_MAINT_NAME - -#define AUFS_DIROPQ_NAME AUFS_WH_PFX ".opq" /* whiteouted doubly */ -#define AUFS_WH_DIROPQ AUFS_WH_PFX AUFS_DIROPQ_NAME - -#define AUFS_BASE_NAME AUFS_WH_PFX AUFS_NAME -#define AUFS_PLINKDIR_NAME AUFS_WH_PFX "plnk" -#define AUFS_ORPHDIR_NAME AUFS_WH_PFX "orph" - -/* doubly whiteouted */ -#define AUFS_WH_BASE AUFS_WH_PFX AUFS_BASE_NAME -#define AUFS_WH_PLINKDIR AUFS_WH_PFX AUFS_PLINKDIR_NAME -#define AUFS_WH_ORPHDIR AUFS_WH_PFX AUFS_ORPHDIR_NAME - -/* branch permissions and attributes */ -#define AUFS_BRPERM_RW "rw" -#define AUFS_BRPERM_RO "ro" -#define AUFS_BRPERM_RR "rr" -#define AUFS_BRATTR_COO_REG "coo_reg" -#define AUFS_BRATTR_COO_ALL "coo_all" -#define AUFS_BRATTR_FHSM "fhsm" -#define AUFS_BRATTR_UNPIN "unpin" -#define AUFS_BRATTR_ICEX "icex" -#define AUFS_BRATTR_ICEX_SEC "icexsec" -#define AUFS_BRATTR_ICEX_SYS "icexsys" -#define AUFS_BRATTR_ICEX_TR "icextr" -#define AUFS_BRATTR_ICEX_USR "icexusr" -#define AUFS_BRATTR_ICEX_OTH "icexoth" -#define AUFS_BRRATTR_WH "wh" -#define AUFS_BRWATTR_NLWH "nolwh" -#define AUFS_BRWATTR_MOO "moo" - -#define AuBrPerm_RW 1 /* writable, hardlinkable wh */ -#define AuBrPerm_RO (1 << 1) /* readonly */ -#define AuBrPerm_RR (1 << 2) /* natively readonly */ -#define AuBrPerm_Mask (AuBrPerm_RW | AuBrPerm_RO | AuBrPerm_RR) - -#define AuBrAttr_COO_REG (1 << 3) /* copy-up on open */ -#define AuBrAttr_COO_ALL (1 << 4) -#define AuBrAttr_COO_Mask (AuBrAttr_COO_REG | AuBrAttr_COO_ALL) - -#define AuBrAttr_FHSM (1 << 5) /* file-based hsm */ -#define AuBrAttr_UNPIN (1 << 6) /* rename-able top dir of - branch */ - -/* ignore error in copying XATTR */ -#define AuBrAttr_ICEX_SEC (1 << 7) -#define AuBrAttr_ICEX_SYS (1 << 8) -#define AuBrAttr_ICEX_TR (1 << 9) -#define AuBrAttr_ICEX_USR (1 << 10) -#define AuBrAttr_ICEX_OTH (1 << 11) -#define AuBrAttr_ICEX (AuBrAttr_ICEX_SEC \ - | AuBrAttr_ICEX_SYS \ - | AuBrAttr_ICEX_TR \ - | AuBrAttr_ICEX_USR \ - | AuBrAttr_ICEX_OTH) - -#define AuBrRAttr_WH (1 << 12) /* whiteout-able */ -#define AuBrRAttr_Mask AuBrRAttr_WH - -#define AuBrWAttr_NoLinkWH (1 << 13) /* un-hardlinkable whiteouts */ -#define AuBrWAttr_MOO (1 << 14) /* move-up on open */ -#define AuBrWAttr_Mask (AuBrWAttr_NoLinkWH | AuBrWAttr_MOO) - -#define AuBrAttr_CMOO_Mask (AuBrAttr_COO_Mask | AuBrWAttr_MOO) - -/* #warning test userspace */ -#ifdef __KERNEL__ -#ifndef CONFIG_AUFS_FHSM -#undef AuBrAttr_FHSM -#define AuBrAttr_FHSM 0 -#endif -#ifndef CONFIG_AUFS_XATTR -#undef AuBrAttr_ICEX -#define AuBrAttr_ICEX 0 -#undef AuBrAttr_ICEX_SEC -#define AuBrAttr_ICEX_SEC 0 -#undef AuBrAttr_ICEX_SYS -#define AuBrAttr_ICEX_SYS 0 -#undef AuBrAttr_ICEX_TR -#define AuBrAttr_ICEX_TR 0 -#undef AuBrAttr_ICEX_USR -#define AuBrAttr_ICEX_USR 0 -#undef AuBrAttr_ICEX_OTH -#define AuBrAttr_ICEX_OTH 0 -#endif -#endif - -/* the longest combination */ -/* AUFS_BRATTR_ICEX and AUFS_BRATTR_ICEX_TR don't affect here */ -#define AuBrPermStrSz sizeof(AUFS_BRPERM_RW \ - "+" AUFS_BRATTR_COO_REG \ - "+" AUFS_BRATTR_FHSM \ - "+" AUFS_BRATTR_UNPIN \ - "+" AUFS_BRATTR_ICEX_SEC \ - "+" AUFS_BRATTR_ICEX_SYS \ - "+" AUFS_BRATTR_ICEX_USR \ - "+" AUFS_BRATTR_ICEX_OTH \ - "+" AUFS_BRWATTR_NLWH) - -typedef struct { - char a[AuBrPermStrSz]; -} au_br_perm_str_t; - -static inline int au_br_writable(int brperm) -{ - return brperm & AuBrPerm_RW; -} - -static inline int au_br_whable(int brperm) -{ - return brperm & (AuBrPerm_RW | AuBrRAttr_WH); -} - -static inline int au_br_wh_linkable(int brperm) -{ - return !(brperm & AuBrWAttr_NoLinkWH); -} - -static inline int au_br_cmoo(int brperm) -{ - return brperm & AuBrAttr_CMOO_Mask; -} - -static inline int au_br_fhsm(int brperm) -{ - return brperm & AuBrAttr_FHSM; -} - -/* ---------------------------------------------------------------------- */ - -/* ioctl */ -enum { - /* readdir in userspace */ - AuCtl_RDU, - AuCtl_RDU_INO, - - AuCtl_WBR_FD, /* pathconf wrapper */ - AuCtl_IBUSY, /* busy inode */ - AuCtl_MVDOWN, /* move-down */ - AuCtl_BR, /* info about branches */ - AuCtl_FHSM_FD /* connection for fhsm */ -}; - -/* borrowed from linux/include/linux/kernel.h */ -#ifndef ALIGN -#define ALIGN(x, a) __ALIGN_MASK(x, (typeof(x))(a)-1) -#define __ALIGN_MASK(x, mask) (((x)+(mask))&~(mask)) -#endif - -/* borrowed from linux/include/linux/compiler-gcc3.h */ -#ifndef __aligned -#define __aligned(x) __attribute__((aligned(x))) -#endif - -#ifdef __KERNEL__ -#ifndef __packed -#define __packed __attribute__((packed)) -#endif -#endif - -struct au_rdu_cookie { - uint64_t h_pos; - int16_t bindex; - uint8_t flags; - uint8_t pad; - uint32_t generation; -} __aligned(8); - -struct au_rdu_ent { - uint64_t ino; - int16_t bindex; - uint8_t type; - uint8_t nlen; - uint8_t wh; - char name[0]; -} __aligned(8); - -static inline int au_rdu_len(int nlen) -{ - /* include the terminating NULL */ - return ALIGN(sizeof(struct au_rdu_ent) + nlen + 1, - sizeof(uint64_t)); -} - -union au_rdu_ent_ul { - struct au_rdu_ent __user *e; - uint64_t ul; -}; - -enum { - AufsCtlRduV_SZ, - AufsCtlRduV_End -}; - -struct aufs_rdu { - /* input */ - union { - uint64_t sz; /* AuCtl_RDU */ - uint64_t nent; /* AuCtl_RDU_INO */ - }; - union au_rdu_ent_ul ent; - uint16_t verify[AufsCtlRduV_End]; - - /* input/output */ - uint32_t blk; - - /* output */ - union au_rdu_ent_ul tail; - /* number of entries which were added in a single call */ - uint64_t rent; - uint8_t full; - uint8_t shwh; - - struct au_rdu_cookie cookie; -} __aligned(8); - -/* ---------------------------------------------------------------------- */ - -struct aufs_wbr_fd { - uint32_t oflags; - int16_t brid; -} __aligned(8); - -/* ---------------------------------------------------------------------- */ - -struct aufs_ibusy { - uint64_t ino, h_ino; - int16_t bindex; -} __aligned(8); - -/* ---------------------------------------------------------------------- */ - -/* error code for move-down */ -/* the actual message strings are implemented in aufs-util.git */ -enum { - EAU_MVDOWN_OPAQUE = 1, - EAU_MVDOWN_WHITEOUT, - EAU_MVDOWN_UPPER, - EAU_MVDOWN_BOTTOM, - EAU_MVDOWN_NOUPPER, - EAU_MVDOWN_NOLOWERBR, - EAU_Last -}; - -/* flags for move-down */ -#define AUFS_MVDOWN_DMSG 1 -#define AUFS_MVDOWN_OWLOWER (1 << 1) /* overwrite lower */ -#define AUFS_MVDOWN_KUPPER (1 << 2) /* keep upper */ -#define AUFS_MVDOWN_ROLOWER (1 << 3) /* do even if lower is RO */ -#define AUFS_MVDOWN_ROLOWER_R (1 << 4) /* did on lower RO */ -#define AUFS_MVDOWN_ROUPPER (1 << 5) /* do even if upper is RO */ -#define AUFS_MVDOWN_ROUPPER_R (1 << 6) /* did on upper RO */ -#define AUFS_MVDOWN_BRID_UPPER (1 << 7) /* upper brid */ -#define AUFS_MVDOWN_BRID_LOWER (1 << 8) /* lower brid */ -#define AUFS_MVDOWN_FHSM_LOWER (1 << 9) /* find fhsm attr for lower */ -#define AUFS_MVDOWN_STFS (1 << 10) /* req. stfs */ -#define AUFS_MVDOWN_STFS_FAILED (1 << 11) /* output: stfs is unusable */ -#define AUFS_MVDOWN_BOTTOM (1 << 12) /* output: no more lowers */ - -/* index for move-down */ -enum { - AUFS_MVDOWN_UPPER, - AUFS_MVDOWN_LOWER, - AUFS_MVDOWN_NARRAY -}; - -/* - * additional info of move-down - * number of free blocks and inodes. - * subset of struct kstatfs, but smaller and always 64bit. - */ -struct aufs_stfs { - uint64_t f_blocks; - uint64_t f_bavail; - uint64_t f_files; - uint64_t f_ffree; -}; - -struct aufs_stbr { - int16_t brid; /* optional input */ - int16_t bindex; /* output */ - struct aufs_stfs stfs; /* output when AUFS_MVDOWN_STFS set */ -} __aligned(8); - -struct aufs_mvdown { - uint32_t flags; /* input/output */ - struct aufs_stbr stbr[AUFS_MVDOWN_NARRAY]; /* input/output */ - int8_t au_errno; /* output */ -} __aligned(8); - -/* ---------------------------------------------------------------------- */ - -union aufs_brinfo { - /* PATH_MAX may differ between kernel-space and user-space */ - char _spacer[4096]; - struct { - int16_t id; - int perm; - char path[0]; - }; -} __aligned(8); - -/* ---------------------------------------------------------------------- */ - -#define AuCtlType 'A' -#define AUFS_CTL_RDU _IOWR(AuCtlType, AuCtl_RDU, struct aufs_rdu) -#define AUFS_CTL_RDU_INO _IOWR(AuCtlType, AuCtl_RDU_INO, struct aufs_rdu) -#define AUFS_CTL_WBR_FD _IOW(AuCtlType, AuCtl_WBR_FD, \ - struct aufs_wbr_fd) -#define AUFS_CTL_IBUSY _IOWR(AuCtlType, AuCtl_IBUSY, struct aufs_ibusy) -#define AUFS_CTL_MVDOWN _IOWR(AuCtlType, AuCtl_MVDOWN, \ - struct aufs_mvdown) -#define AUFS_CTL_BRINFO _IOW(AuCtlType, AuCtl_BR, union aufs_brinfo) -#define AUFS_CTL_FHSM_FD _IOW(AuCtlType, AuCtl_FHSM_FD, int) - -#endif /* __AUFS_TYPE_H__ */ diff --git a/kernel/fork.c b/kernel/fork.c index 7176c4a80c065c..ccc4044e6cc845 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -433,7 +433,7 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm) struct inode *inode = file_inode(file); struct address_space *mapping = file->f_mapping; - vma_get_file(tmp); + get_file(file); if (tmp->vm_flags & VM_DENYWRITE) atomic_dec(&inode->i_writecount); mutex_lock(&mapping->i_mmap_mutex); diff --git a/mm/Makefile b/mm/Makefile index c7e0d59dea3153..72c5acb9345fdd 100644 --- a/mm/Makefile +++ b/mm/Makefile @@ -17,7 +17,7 @@ obj-y := filemap.o mempool.o oom_kill.o fadvise.o \ util.o mmzone.o vmstat.o backing-dev.o \ mm_init.o mmu_context.o percpu.o slab_common.o \ compaction.o balloon_compaction.o \ - interval_tree.o prfile.o $(mmu-y) + interval_tree.o $(mmu-y) obj-y += init-mm.o diff --git a/mm/filemap.c b/mm/filemap.c index 94cc777e8cb788..7905fe721aa8ab 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -1733,7 +1733,7 @@ int filemap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) int ret = VM_FAULT_LOCKED; sb_start_pagefault(inode->i_sb); - vma_file_update_time(vma); + file_update_time(vma->vm_file); lock_page(page); if (page->mapping != inode->i_mapping) { unlock_page(page); diff --git a/mm/fremap.c b/mm/fremap.c index d96a92e49b530d..1fb6bfe39d8cd5 100644 --- a/mm/fremap.c +++ b/mm/fremap.c @@ -202,28 +202,16 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, */ if (mapping_cap_account_dirty(mapping)) { unsigned long addr; - struct file *file = vma->vm_file, - *prfile = vma->vm_prfile; - + struct file *file = get_file(vma->vm_file); /* mmap_region may free vma; grab the info now */ vm_flags = vma->vm_flags; - vma_get_file(vma); addr = mmap_region(file, start, size, vm_flags, pgoff); - vma_fput(vma); + fput(file); if (IS_ERR_VALUE(addr)) { err = addr; } else { BUG_ON(addr != start); - if (prfile) { - struct vm_area_struct *new_vma; - - new_vma = find_vma(mm, addr); - if (!new_vma->vm_prfile) - new_vma->vm_prfile = prfile; - if (new_vma != vma) - get_file(prfile); - } err = 0; } goto out_freed; diff --git a/mm/madvise.c b/mm/madvise.c index 06599cb942fc4a..85d1a5427c27fa 100644 --- a/mm/madvise.c +++ b/mm/madvise.c @@ -328,12 +328,12 @@ static long madvise_remove(struct vm_area_struct *vma, * vma's reference to the file) can go away as soon as we drop * mmap_sem. */ - vma_get_file(vma); + get_file(f); up_read(¤t->mm->mmap_sem); error = do_fallocate(f, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, offset, end - start); - vma_fput(vma); + fput(f); down_read(¤t->mm->mmap_sem); return error; } diff --git a/mm/memory.c b/mm/memory.c index 58602898045e74..e6b1da3a8924c5 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -2759,7 +2759,7 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, set_page_dirty_balance(dirty_page, page_mkwrite); /* file_update_time outside page_lock */ if (vma->vm_file) - vma_file_update_time(vma); + file_update_time(vma->vm_file); } put_page(dirty_page); if (page_mkwrite) { @@ -3466,7 +3466,7 @@ static int __do_fault(struct mm_struct *mm, struct vm_area_struct *vma, /* file_update_time outside page_lock */ if (vma->vm_file && !page_mkwrite) - vma_file_update_time(vma); + file_update_time(vma->vm_file); } else { unlock_page(vmf.page); if (anon) diff --git a/mm/mmap.c b/mm/mmap.c index e20402d3a94804..84a1c44242a8a8 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -250,7 +250,7 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma) if (vma->vm_ops && vma->vm_ops->close) vma->vm_ops->close(vma); if (vma->vm_file) - vma_fput(vma); + fput(vma->vm_file); mpol_put(vma_policy(vma)); kmem_cache_free(vm_area_cachep, vma); return next; @@ -860,7 +860,7 @@ again: remove_next = 1 + (end > next->vm_end); if (remove_next) { if (file) { uprobe_munmap(next, next->vm_start, next->vm_end); - vma_fput(vma); + fput(file); } if (next->anon_vma) anon_vma_merge(vma, next); @@ -1626,8 +1626,8 @@ unsigned long mmap_region(struct file *file, unsigned long addr, unmap_and_free_vma: if (correct_wcount) atomic_inc(&inode->i_writecount); - vma_fput(vma); vma->vm_file = NULL; + fput(file); /* Undo any partial mapping done by a device driver. */ unmap_region(mm, vma, prev, vma->vm_start, vma->vm_end); @@ -2451,7 +2451,7 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma, goto out_free_mpol; if (new->vm_file) - vma_get_file(new); + get_file(new->vm_file); if (new->vm_ops && new->vm_ops->open) new->vm_ops->open(new); @@ -2470,7 +2470,7 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma, if (new->vm_ops && new->vm_ops->close) new->vm_ops->close(new); if (new->vm_file) - vma_fput(new); + fput(new->vm_file); unlink_anon_vmas(new); out_free_mpol: mpol_put(pol); @@ -2870,7 +2870,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, if (anon_vma_clone(new_vma, vma)) goto out_free_mempol; if (new_vma->vm_file) - vma_get_file(new_vma); + get_file(new_vma->vm_file); if (new_vma->vm_ops && new_vma->vm_ops->open) new_vma->vm_ops->open(new_vma); vma_link(mm, new_vma, prev, rb_link, rb_parent); diff --git a/mm/msync.c b/mm/msync.c index 02d770eb9fc741..632df4527c0122 100644 --- a/mm/msync.c +++ b/mm/msync.c @@ -80,10 +80,10 @@ SYSCALL_DEFINE3(msync, unsigned long, start, size_t, len, int, flags) start = vma->vm_end; if ((flags & MS_SYNC) && file && (vma->vm_flags & VM_SHARED)) { - vma_get_file(vma); + get_file(file); up_read(&mm->mmap_sem); error = vfs_fsync(file, 0); - vma_fput(vma); + fput(file); if (error || start >= end) goto out; down_read(&mm->mmap_sem); diff --git a/mm/nommu.c b/mm/nommu.c index b51894cb7b8050..d9d07a5d2318ad 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -650,7 +650,7 @@ static void __put_nommu_region(struct vm_region *region) up_write(&nommu_region_sem); if (region->vm_file) - vmr_fput(region); + fput(region->vm_file); /* IO memory and memory shared directly out of the pagecache * from ramfs/tmpfs mustn't be released here */ @@ -808,7 +808,7 @@ static void delete_vma(struct mm_struct *mm, struct vm_area_struct *vma) if (vma->vm_ops && vma->vm_ops->close) vma->vm_ops->close(vma); if (vma->vm_file) - vma_fput(vma); + fput(vma->vm_file); put_nommu_region(vma->vm_region); kmem_cache_free(vm_area_cachep, vma); } @@ -1374,7 +1374,7 @@ unsigned long do_mmap_pgoff(struct file *file, goto error_just_free; } } - vmr_fput(region); + fput(region->vm_file); kmem_cache_free(vm_region_jar, region); region = pregion; result = start; @@ -1450,10 +1450,10 @@ unsigned long do_mmap_pgoff(struct file *file, up_write(&nommu_region_sem); error: if (region->vm_file) - vmr_fput(region); + fput(region->vm_file); kmem_cache_free(vm_region_jar, region); if (vma->vm_file) - vma_fput(vma); + fput(vma->vm_file); kmem_cache_free(vm_area_cachep, vma); kleave(" = %d", ret); return ret; diff --git a/mm/prfile.c b/mm/prfile.c deleted file mode 100644 index fc708d2622dfbb..00000000000000 --- a/mm/prfile.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Mainly for aufs which mmap(2) diffrent file and wants to print different path - * in /proc/PID/maps. - * Call these functions via macros defined in linux/mm.h. - * - * See Documentation/filesystems/aufs/design/06mmap.txt - * - * Copyright (c) 2014 Junjro R. Okajima - * Copyright (c) 2014 Ian Campbell - */ - -#include -#include -#include - -/* #define PRFILE_TRACE */ -static inline void prfile_trace(struct file *f, struct file *pr, - const char func[], int line, const char func2[]) -{ -#ifdef PRFILE_TRACE - if (pr) - pr_info("%s:%d: %s, %p\n", func, line, func2, - f ? (char *)f->f_dentry->d_name.name : "(null)"); -#endif -} - -#ifdef CONFIG_MMU -void vma_do_file_update_time(struct vm_area_struct *vma, const char func[], - int line) -{ - struct file *f = vma->vm_file, *pr = vma->vm_prfile; - - prfile_trace(f, pr, func, line, __func__); - file_update_time(f); - if (f && pr) - file_update_time(pr); -} - -struct file *vma_do_pr_or_file(struct vm_area_struct *vma, const char func[], - int line) -{ - struct file *f = vma->vm_file, *pr = vma->vm_prfile; - - prfile_trace(f, pr, func, line, __func__); - return (f && pr) ? pr : f; -} - -void vma_do_get_file(struct vm_area_struct *vma, const char func[], int line) -{ - struct file *f = vma->vm_file, *pr = vma->vm_prfile; - - prfile_trace(f, pr, func, line, __func__); - get_file(f); - if (f && pr) - get_file(pr); -} - -void vma_do_fput(struct vm_area_struct *vma, const char func[], int line) -{ - struct file *f = vma->vm_file, *pr = vma->vm_prfile; - - prfile_trace(f, pr, func, line, __func__); - fput(f); - if (f && pr) - fput(pr); -} -#else -struct file *vmr_do_pr_or_file(struct vm_region *region, const char func[], - int line) -{ - struct file *f = region->vm_file, *pr = region->vm_prfile; - - prfile_trace(f, pr, func, line, __func__); - return (f && pr) ? pr : f; -} - -void vmr_do_fput(struct vm_region *region, const char func[], int line) -{ - struct file *f = region->vm_file, *pr = region->vm_prfile; - - prfile_trace(f, pr, func, line, __func__); - fput(f); - if (f && pr) - fput(pr); -} -#endif /* CONFIG_MMU */ diff --git a/security/commoncap.c b/security/commoncap.c index e06c96bf05b39c..0405522995c574 100644 --- a/security/commoncap.c +++ b/security/commoncap.c @@ -1002,11 +1002,9 @@ int cap_mmap_addr(unsigned long addr) } return ret; } -EXPORT_SYMBOL(cap_mmap_addr); int cap_mmap_file(struct file *file, unsigned long reqprot, unsigned long prot, unsigned long flags) { return 0; } -EXPORT_SYMBOL(cap_mmap_file); diff --git a/security/device_cgroup.c b/security/device_cgroup.c index 9760ecb6b05259..dd0dc574d78dd0 100644 --- a/security/device_cgroup.c +++ b/security/device_cgroup.c @@ -7,7 +7,6 @@ #include #include #include -#include #include #include #include @@ -790,7 +789,6 @@ int __devcgroup_inode_permission(struct inode *inode, int mask) return __devcgroup_check_permission(type, imajor(inode), iminor(inode), access); } -EXPORT_SYMBOL(__devcgroup_inode_permission); int devcgroup_inode_mknod(int mode, dev_t dev) { diff --git a/security/security.c b/security/security.c index 3ccb6220ac9af5..d6ab2d2b363dac 100644 --- a/security/security.c +++ b/security/security.c @@ -416,7 +416,6 @@ int security_path_rmdir(struct path *dir, struct dentry *dentry) return 0; return security_ops->path_rmdir(dir, dentry); } -EXPORT_SYMBOL(security_path_rmdir); int security_path_unlink(struct path *dir, struct dentry *dentry) { @@ -433,7 +432,6 @@ int security_path_symlink(struct path *dir, struct dentry *dentry, return 0; return security_ops->path_symlink(dir, dentry, old_name); } -EXPORT_SYMBOL(security_path_symlink); int security_path_link(struct dentry *old_dentry, struct path *new_dir, struct dentry *new_dentry) @@ -442,7 +440,6 @@ int security_path_link(struct dentry *old_dentry, struct path *new_dir, return 0; return security_ops->path_link(old_dentry, new_dir, new_dentry); } -EXPORT_SYMBOL(security_path_link); int security_path_rename(struct path *old_dir, struct dentry *old_dentry, struct path *new_dir, struct dentry *new_dentry) @@ -461,7 +458,6 @@ int security_path_truncate(struct path *path) return 0; return security_ops->path_truncate(path); } -EXPORT_SYMBOL(security_path_truncate); int security_path_chmod(struct path *path, umode_t mode) { @@ -469,7 +465,6 @@ int security_path_chmod(struct path *path, umode_t mode) return 0; return security_ops->path_chmod(path, mode); } -EXPORT_SYMBOL(security_path_chmod); int security_path_chown(struct path *path, kuid_t uid, kgid_t gid) { @@ -477,7 +472,6 @@ int security_path_chown(struct path *path, kuid_t uid, kgid_t gid) return 0; return security_ops->path_chown(path, uid, gid); } -EXPORT_SYMBOL(security_path_chown); int security_path_chroot(struct path *path) { @@ -554,7 +548,6 @@ int security_inode_readlink(struct dentry *dentry) return 0; return security_ops->inode_readlink(dentry); } -EXPORT_SYMBOL(security_inode_readlink); int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd) { @@ -569,7 +562,6 @@ int security_inode_permission(struct inode *inode, int mask) return 0; return security_ops->inode_permission(inode, mask); } -EXPORT_SYMBOL(security_inode_permission); int security_inode_setattr(struct dentry *dentry, struct iattr *attr) { @@ -691,7 +683,6 @@ int security_file_permission(struct file *file, int mask) return fsnotify_perm(file, mask); } -EXPORT_SYMBOL(security_file_permission); int security_file_alloc(struct file *file) { @@ -752,7 +743,6 @@ int security_mmap_file(struct file *file, unsigned long prot, return ret; return ima_file_mmap(file, prot); } -EXPORT_SYMBOL(security_mmap_file); int security_mmap_addr(unsigned long addr) { From c0287762213b93cbfbd9fbc8445586dac5988815 Mon Sep 17 00:00:00 2001 From: moonman Date: Sat, 24 Oct 2015 06:31:53 -0600 Subject: [PATCH 339/359] r8152 to v2.05.0 (2015/06/09) --- drivers/net/usb/r8152.c | 476 ++++++++++++++++++++++++++++++++-------- 1 file changed, 380 insertions(+), 96 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index d43b9c64d9ee8f..f3f9aa1fc5dfc0 100755 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -29,7 +29,7 @@ #include "compatibility.h" /* Version Information */ -#define DRIVER_VERSION "v2.04.0 (2015/03/06)" +#define DRIVER_VERSION "v2.05.0 (2015/06/09)" #define DRIVER_AUTHOR "Realtek nic sw " #define DRIVER_DESC "Realtek RTL8152/RTL8153 Based USB Ethernet Adapters" #define MODULENAME "r8152" @@ -500,6 +500,7 @@ enum rtl8152_flags { #define VENDOR_ID_REALTEK 0x0bda #define VENDOR_ID_SAMSUNG 0x04e8 #define VENDOR_ID_LENOVO 0x17ef +#define VENDOR_ID_TPLINK 0x2357 #define MCU_TYPE_PLA 0x0100 #define MCU_TYPE_USB 0x0000 @@ -598,6 +599,7 @@ struct r8152 { struct sk_buff_head tx_queue, rx_queue; spinlock_t rx_lock, tx_lock; struct delayed_work schedule; + struct delayed_work work_reset; struct mii_if_info mii; struct mutex control; /* use for hw setting */ #if LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0) @@ -640,6 +642,7 @@ enum rtl_version { RTL_VER_04, RTL_VER_05, RTL_VER_06, + RTL_VER_07, RTL_VER_MAX }; @@ -2124,11 +2127,11 @@ static void rtl_drop_queued_tx(struct r8152 *tp) static void rtl8152_tx_timeout(struct net_device *netdev) { struct r8152 *tp = netdev_priv(netdev); - int i; netif_warn(tp, tx_err, netdev, "Tx timeout\n"); - for (i = 0; i < RTL8152_MAX_TX; i++) - usb_unlink_urb(tp->tx_info[i].urb); + + schedule_delayed_work(&tp->work_reset, 0); + cancel_delayed_work(&tp->schedule); } static void rtl8152_set_rx_mode(struct net_device *netdev) @@ -2340,6 +2343,32 @@ static void rxdy_gated_en(struct r8152 *tp, bool enable) ocp_write_word(tp, MCU_TYPE_PLA, PLA_MISC_1, ocp_data); } +static int rtl_s5_wol(struct r8152 *tp) +{ +#ifdef CONFIG_PM + struct usb_device *udev = tp->udev; + + if (!udev->do_remote_wakeup) + return 0; + + /* usb_enable_remote_wakeup */ + if (udev->speed < USB_SPEED_SUPER) + return usb_control_msg(udev, usb_sndctrlpipe(udev, 0), + USB_REQ_SET_FEATURE, USB_RECIP_DEVICE, + USB_DEVICE_REMOTE_WAKEUP, 0, NULL, 0, + USB_CTRL_SET_TIMEOUT); + else + return usb_control_msg(udev, usb_sndctrlpipe(udev, 0), + USB_REQ_SET_FEATURE, USB_RECIP_INTERFACE, + USB_INTRF_FUNC_SUSPEND, + USB_INTRF_FUNC_SUSPEND_RW | + USB_INTRF_FUNC_SUSPEND_LP, + NULL, 0, USB_CTRL_SET_TIMEOUT); +#else + return 0; +#endif +} + static int rtl_start_rx(struct r8152 *tp) { int i, ret = 0; @@ -2433,6 +2462,7 @@ static int rtl8153_enable(struct r8152 *tp) if (test_bit(RTL8152_UNPLUG, &tp->flags)) return -ENODEV; + usb_disable_lpm(tp->udev); set_tx_qlen(tp); rtl_set_eee_plus(tp); r8153_set_rx_early_timeout(tp); @@ -2646,11 +2676,54 @@ static void __rtl_set_wol(struct r8152 *tp, u32 wolopts) device_set_wakeup_enable(&tp->udev->dev, false); } +static void r8153_u1u2en(struct r8152 *tp, bool enable) +{ + u8 u1u2[8]; + + if (enable) + memset(u1u2, 0xff, sizeof(u1u2)); + else + memset(u1u2, 0x00, sizeof(u1u2)); + + usb_ocp_write(tp, USB_TOLERANCE, BYTE_EN_SIX_BYTES, sizeof(u1u2), u1u2); +} + +static void r8153_u2p3en(struct r8152 *tp, bool enable) +{ + u32 ocp_data; + + ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_U2P3_CTRL); + if (enable && tp->version != RTL_VER_03 && tp->version != RTL_VER_04) + ocp_data |= U2P3_ENABLE; + else + ocp_data &= ~U2P3_ENABLE; + ocp_write_word(tp, MCU_TYPE_USB, USB_U2P3_CTRL, ocp_data); +} + +static void r8153_power_cut_en(struct r8152 *tp, bool enable) +{ + u32 ocp_data; + + ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_POWER_CUT); + if (enable) + ocp_data |= PWR_EN | PHASE2_EN; + else + ocp_data &= ~(PWR_EN | PHASE2_EN); + ocp_write_word(tp, MCU_TYPE_USB, USB_POWER_CUT, ocp_data); + + ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_MISC_0); + ocp_data &= ~PCUT_STATUS; + ocp_write_word(tp, MCU_TYPE_USB, USB_MISC_0, ocp_data); +} + static void rtl_runtime_suspend_enable(struct r8152 *tp, bool enable) { if (enable) { u32 ocp_data; + r8153_u1u2en(tp, false); + r8153_u2p3en(tp, false); + __rtl_set_wol(tp, WAKE_ANY); ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CRWECR, CRWECR_CONFIG); @@ -2662,6 +2735,8 @@ static void rtl_runtime_suspend_enable(struct r8152 *tp, bool enable) ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CRWECR, CRWECR_NORAML); } else { __rtl_set_wol(tp, tp->saved_wolopts); + r8153_u2p3en(tp, true); + r8153_u1u2en(tp, true); } } @@ -3511,6 +3586,47 @@ static void r8152b_enter_oob(struct r8152 *tp) ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RCR, ocp_data); } +static int r8153_pre_ram_code(struct r8152 *tp, u16 patch_key) +{ + u16 data; + int i; + + data = ocp_reg_read(tp, 0xb820); + data |= 0x0010; + ocp_reg_write(tp, 0xb820, data); + + for (i = 0, data = 0; !data && i < 5000; i++) { + usleep_range(1000, 2000); + data = ocp_reg_read(tp, 0xb800) & 0x0040; + } + + sram_write(tp, 0x8146, patch_key); + sram_write(tp, 0xb82e, 0x0001); + + return -EBUSY; +} + +static int r8153_post_ram_code(struct r8152 *tp) +{ + u16 data; + + sram_write(tp, 0x0000, 0x0000); + + data = ocp_reg_read(tp, 0xb82e); + data &= ~0x0001; + ocp_reg_write(tp, 0xb82e, data); + + sram_write(tp, 0x8146, 0x0000); + + data = ocp_reg_read(tp, 0xb820); + data &= ~0x0010; + ocp_reg_write(tp, 0xb820, data); + + ocp_write_word(tp, MCU_TYPE_PLA, PLA_OCP_GPHY_BASE, tp->ocp_base); + + return 0; +} + static void r8153_wdt1_end(struct r8152 *tp) { int i; @@ -3524,28 +3640,13 @@ static void r8153_wdt1_end(struct r8152 *tp) static void r8153_firmware(struct r8152 *tp) { - u16 data; - if (tp->version == RTL_VER_03) { r8153_clear_bp(tp); - data = ocp_reg_read(tp, 0xb820); - data |= 0x0010; - ocp_reg_write(tp, 0xb820, data); - while ((ocp_reg_read(tp, 0xb800) & 0x0040) == 0) - ; - ocp_reg_write(tp, 0xa436, 0x8146); - ocp_reg_write(tp, 0xa438, 0x7000); - ocp_reg_write(tp, 0xa436, 0xb82e); - ocp_reg_write(tp, 0xa438, 0x0001); - tp->ocp_base = 0xa000; - ocp_write_word(tp, MCU_TYPE_PLA, 0xe86c, 0xa000); - ocp_write_word(tp, MCU_TYPE_PLA, 0xb436, 0xb820); - ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x0290); - ocp_write_word(tp, MCU_TYPE_PLA, 0xb436, 0xa012); - ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x0000); - ocp_write_word(tp, MCU_TYPE_PLA, 0xb436, 0xa014); - ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x2c04); + r8153_pre_ram_code(tp, 0x7000); + sram_write(tp, 0xb820, 0x0290); + sram_write(tp, 0xa012, 0x0000); + sram_write(tp, 0xa014, 0x2c04); ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x2c18); ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x2c45); ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x2c45); @@ -3614,29 +3715,13 @@ static void r8153_firmware(struct r8152 *tp) ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0xd500); ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0xd702); ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x0800); - ocp_write_word(tp, MCU_TYPE_PLA, 0xb436, 0xa01a); - ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x0000); - ocp_write_word(tp, MCU_TYPE_PLA, 0xb436, 0xa006); - ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x0fff); - ocp_write_word(tp, MCU_TYPE_PLA, 0xb436, 0xa004); - ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x0fff); - ocp_write_word(tp, MCU_TYPE_PLA, 0xb436, 0xa002); - ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x05a3); - ocp_write_word(tp, MCU_TYPE_PLA, 0xb436, 0xa000); - ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x3591); - ocp_write_word(tp, MCU_TYPE_PLA, 0xb436, 0xb820); - ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x0210); - ocp_reg_write(tp, 0xa436, 0x0000); - ocp_reg_write(tp, 0xa438, 0x0000); - data = ocp_reg_read(tp, 0xb82e); - data &= ~0x0001; - ocp_reg_write(tp, 0xb82e, data); - ocp_reg_write(tp, 0xa436, 0x8146); - ocp_reg_write(tp, 0xa438, 0x0000); - - data = ocp_reg_read(tp, 0xb820); - data &= ~0x0010; - ocp_reg_write(tp, 0xb820, data); + sram_write(tp, 0xa01a, 0x0000); + sram_write(tp, 0xa006, 0x0fff); + sram_write(tp, 0xa004, 0x0fff); + sram_write(tp, 0xa002, 0x05a3); + sram_write(tp, 0xa000, 0x3591); + sram_write(tp, 0xb820, 0x0210); + r8153_post_ram_code(tp); } else if (tp->version == RTL_VER_04) { static u8 usb_patch_b[] = { 0x08, 0xe0, 0x0f, 0xe0, @@ -3984,6 +4069,32 @@ static void r8153_firmware(struct r8152 *tp) 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + r8153_pre_ram_code(tp, 0x7001); + sram_write(tp, 0xb820, 0x0290); + sram_write(tp, 0xa012, 0x0000); + sram_write(tp, 0xa014, 0x2c04); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x2c07); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x2c0a); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x2c0d); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0xa240); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0xa104); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x292d); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x8620); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0xa480); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x2a2c); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x8480); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0xa101); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x2a36); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0xd056); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x2223); + sram_write(tp, 0xa01a, 0x0000); + sram_write(tp, 0xa006, 0x0222); + sram_write(tp, 0xa004, 0x0a35); + sram_write(tp, 0xa002, 0x0a2b); + sram_write(tp, 0xa000, 0xf92c); + sram_write(tp, 0xb820, 0x0210); + r8153_post_ram_code(tp); + r8153_wdt1_end(tp); r8153_clear_bp(tp); @@ -4342,6 +4453,32 @@ static void r8153_firmware(struct r8152 *tp) ocp_data &= ~0x4000; ocp_write_word(tp, MCU_TYPE_USB, 0xcfca, ocp_data); + r8153_pre_ram_code(tp, 0x7001); + sram_write(tp, 0xb820, 0x0290); + sram_write(tp, 0xa012, 0x0000); + sram_write(tp, 0xa014, 0x2c04); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x2c07); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x2c0a); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x2c0d); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0xa240); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0xa104); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x292d); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x8620); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0xa480); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x2a2c); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x8480); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0xa101); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x2a36); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0xd056); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x2223); + sram_write(tp, 0xa01a, 0x0000); + sram_write(tp, 0xa006, 0x0222); + sram_write(tp, 0xa004, 0x0a35); + sram_write(tp, 0xa002, 0x0a2b); + sram_write(tp, 0xa000, 0xf92c); + sram_write(tp, 0xb820, 0x0210); + r8153_post_ram_code(tp); + r8153_wdt1_end(tp); r8153_clear_bp(tp); @@ -4383,6 +4520,70 @@ static void r8153_firmware(struct r8152 *tp) ocp_data = ocp_read_word(tp, MCU_TYPE_USB, 0xcfca); ocp_data |= 0x4000; ocp_write_word(tp, MCU_TYPE_USB, 0xcfca, ocp_data); + } else if (tp->version == RTL_VER_06) { + static u8 usb_patch_d[] = { + 0x08, 0xe0, 0x0a, 0xe0, + 0x0c, 0xe0, 0x1f, 0xe0, + 0x28, 0xe0, 0x2a, 0xe0, + 0x2c, 0xe0, 0x2e, 0xe0, + 0x02, 0xc5, 0x00, 0xbd, + 0x00, 0x00, 0x02, 0xc3, + 0x00, 0xbb, 0x00, 0x00, + 0x30, 0x18, 0x11, 0xc1, + 0x05, 0xe8, 0x10, 0xc6, + 0x02, 0xc2, 0x00, 0xba, + 0x94, 0x17, 0x02, 0xb4, + 0x09, 0xc2, 0x40, 0x99, + 0x0e, 0x48, 0x42, 0x98, + 0x42, 0x70, 0x8e, 0x49, + 0xfe, 0xf1, 0x02, 0xb0, + 0x80, 0xff, 0xc0, 0xd4, + 0xe4, 0x40, 0x20, 0xd4, + 0xb0, 0x49, 0x04, 0xf0, + 0x30, 0x18, 0x06, 0xc1, + 0xef, 0xef, 0xfa, 0xc7, + 0x02, 0xc0, 0x00, 0xb8, + 0x38, 0x12, 0xe4, 0x4b, + 0x02, 0xc3, 0x00, 0xbb, + 0x00, 0x00, 0x02, 0xc5, + 0x00, 0xbd, 0x00, 0x00, + 0x02, 0xc1, 0x00, 0xb9, + 0x00, 0x00, 0x02, 0xc1, + 0x00, 0xb9, 0x00, 0x00 }; + + r8153_pre_ram_code(tp, 0x7002); + sram_write(tp, 0xb820, 0x0290); + sram_write(tp, 0xa012, 0x0000); + sram_write(tp, 0xa014, 0x2c04); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x2c07); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x2c07); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x2c07); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0xa240); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0xa104); + ocp_write_word(tp, MCU_TYPE_PLA, 0xb438, 0x2944); + sram_write(tp, 0xa01a, 0x0000); + sram_write(tp, 0xa006, 0x0fff); + sram_write(tp, 0xa004, 0x0fff); + sram_write(tp, 0xa002, 0x0fff); + sram_write(tp, 0xa000, 0x1943); + sram_write(tp, 0xb820, 0x0210); + r8153_post_ram_code(tp); + + r8153_clear_bp(tp); + + ocp_write_word(tp, MCU_TYPE_USB, USB_BP_EN, 0x0000); + generic_ocp_write(tp, 0xf800, 0xff, sizeof(usb_patch_d), + usb_patch_d, MCU_TYPE_USB); + ocp_write_word(tp, MCU_TYPE_USB, 0xfc26, 0xa000); + ocp_write_word(tp, MCU_TYPE_USB, 0xfc28, 0x0000); + ocp_write_word(tp, MCU_TYPE_USB, 0xfc2a, 0x0000); + ocp_write_word(tp, MCU_TYPE_USB, 0xfc2c, 0x1792); + ocp_write_word(tp, MCU_TYPE_USB, 0xfc2e, 0x1236); + ocp_write_word(tp, MCU_TYPE_USB, 0xfc30, 0x0000); + ocp_write_word(tp, MCU_TYPE_USB, 0xfc32, 0x0000); + ocp_write_word(tp, MCU_TYPE_USB, 0xfc34, 0x0000); + ocp_write_word(tp, MCU_TYPE_USB, 0xfc36, 0x0000); + ocp_write_word(tp, MCU_TYPE_USB, USB_BP_EN, 0x000c); } } @@ -4435,46 +4636,6 @@ static void r8153_hw_phy_cfg(struct r8152 *tp) set_bit(PHY_RESET, &tp->flags); } -static void r8153_u1u2en(struct r8152 *tp, bool enable) -{ - u8 u1u2[8]; - - if (enable) - memset(u1u2, 0xff, sizeof(u1u2)); - else - memset(u1u2, 0x00, sizeof(u1u2)); - - usb_ocp_write(tp, USB_TOLERANCE, BYTE_EN_SIX_BYTES, sizeof(u1u2), u1u2); -} - -static void r8153_u2p3en(struct r8152 *tp, bool enable) -{ - u32 ocp_data; - - ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_U2P3_CTRL); - if (enable) - ocp_data |= U2P3_ENABLE; - else - ocp_data &= ~U2P3_ENABLE; - ocp_write_word(tp, MCU_TYPE_USB, USB_U2P3_CTRL, ocp_data); -} - -static void r8153_power_cut_en(struct r8152 *tp, bool enable) -{ - u32 ocp_data; - - ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_POWER_CUT); - if (enable) - ocp_data |= PWR_EN | PHASE2_EN; - else - ocp_data &= ~(PWR_EN | PHASE2_EN); - ocp_write_word(tp, MCU_TYPE_USB, USB_POWER_CUT, ocp_data); - - ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_MISC_0); - ocp_data &= ~PCUT_STATUS; - ocp_write_word(tp, MCU_TYPE_USB, USB_MISC_0, ocp_data); -} - static void r8153_first_init(struct r8152 *tp) { u32 ocp_data; @@ -4519,7 +4680,8 @@ static void r8153_first_init(struct r8152 *tp) rtl_rx_vlan_en(tp, tp->netdev->features & NETIF_F_HW_VLAN_CTAG_RX); - ocp_write_word(tp, MCU_TYPE_PLA, PLA_RMS, RTL8153_RMS); + ocp_data = tp->netdev->mtu + VLAN_ETH_HLEN + VLAN_HLEN; + ocp_write_word(tp, MCU_TYPE_PLA, PLA_RMS, ocp_data); ocp_write_byte(tp, MCU_TYPE_PLA, PLA_MTPS, MTPS_JUMBO); ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_TCR0); @@ -4570,7 +4732,8 @@ static void r8153_enter_oob(struct r8152 *tp) usleep_range(1000, 2000); } - ocp_write_word(tp, MCU_TYPE_PLA, PLA_RMS, RTL8153_RMS); + ocp_data = tp->netdev->mtu + VLAN_ETH_HLEN + VLAN_HLEN; + ocp_write_word(tp, MCU_TYPE_PLA, PLA_RMS, ocp_data); ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_TEREDO_CFG); ocp_data &= ~TEREDO_WAKE_MASK; @@ -4617,6 +4780,7 @@ static void rtl8153_disable(struct r8152 *tp) r8153_disable_aldps(tp); rtl_disable(tp); r8153_enable_aldps(tp); + usb_enable_lpm(tp->udev); } static int rtl8152_set_speed(struct r8152 *tp, u8 autoneg, u16 speed, u8 duplex) @@ -4739,9 +4903,13 @@ static void rtl8153_up(struct r8152 *tp) if (test_bit(RTL8152_UNPLUG, &tp->flags)) return; + r8153_u1u2en(tp, false); r8153_disable_aldps(tp); r8153_first_init(tp); r8153_enable_aldps(tp); + r8153_u2p3en(tp, true); + r8153_u1u2en(tp, true); + usb_enable_lpm(tp->udev); } static void rtl8153_down(struct r8152 *tp) @@ -4752,6 +4920,7 @@ static void rtl8153_down(struct r8152 *tp) } r8153_u1u2en(tp, false); + r8153_u2p3en(tp, false); r8153_power_cut_en(tp, false); r8153_disable_aldps(tp); r8153_enter_oob(tp); @@ -4850,8 +5019,7 @@ static void rtl_work_func_t(struct work_struct *work) static int rtk_disable_diag(struct r8152 *tp) { tp->rtk_enable_diag--; - ocp_write_word(tp, MCU_TYPE_PLA, PLA_OCP_GPHY_BASE, - tp->ocp_base); + ocp_write_word(tp, MCU_TYPE_PLA, PLA_OCP_GPHY_BASE, tp->ocp_base); netif_info(tp, drv, tp->netdev, "disable rtk diag %d\n", tp->rtk_enable_diag); mutex_unlock(&tp->control); @@ -4953,6 +5121,8 @@ static int rtl8152_close(struct net_device *netdev) tp->rtl_ops.down(tp); + res = rtl_s5_wol(tp); + /* set speed to 0 to avoid autoresume try to submit rx * during open(). Set this in open() is too late, becaues * autoresume may occur before resetting it. @@ -5116,6 +5286,13 @@ static void r8152b_init(struct r8152 *tp) SPDWN_RXDV_MSK | SPDWN_LINKCHG_MSK; ocp_write_word(tp, MCU_TYPE_PLA, PLA_GPHY_INTR_IMR, ocp_data); + ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_USB_TIMER); + ocp_data |= BIT(15); + ocp_write_word(tp, MCU_TYPE_USB, USB_USB_TIMER, ocp_data); + ocp_write_word(tp, MCU_TYPE_USB, 0xcbfc, 0x03e8); + ocp_data &= ~BIT(15); + ocp_write_word(tp, MCU_TYPE_USB, USB_USB_TIMER, ocp_data); + r8152b_enable_eee(tp); r8152b_enable_aldps(tp); r8152b_enable_fc(tp); @@ -5159,6 +5336,7 @@ static void r8153_init(struct r8152 *tp) msleep(20); } + usb_disable_lpm(tp->udev); r8153_u2p3en(tp, false); if (tp->version == RTL_VER_04) { @@ -5233,6 +5411,7 @@ static void r8153_init(struct r8152 *tp) r8153_enable_aldps(tp); r8152b_enable_fc(tp); rtl_tally_reset(tp); + r8153_u2p3en(tp, true); } static bool rtl_vendor_mode(struct usb_interface *intf) @@ -5242,6 +5421,84 @@ static bool rtl_vendor_mode(struct usb_interface *intf) return alt->desc.bInterfaceClass == USB_CLASS_VENDOR_SPEC; } +static int rtl8152_pre_reset(struct usb_interface *intf) +{ + struct r8152 *tp = usb_get_intfdata(intf); + struct net_device *netdev; + int ret; + + if (intf->condition != USB_INTERFACE_BOUND || !tp) + return 0; + + netdev = tp->netdev; + if (!netif_running(netdev)) + return 0; + + ret = usb_autopm_get_interface(intf); + if (ret < 0) + return ret; + + napi_disable(&tp->napi); + clear_bit(WORK_ENABLE, &tp->flags); + usb_kill_urb(tp->intr_urb); + cancel_delayed_work_sync(&tp->schedule); + if (netif_carrier_ok(netdev)) { + netif_stop_queue(netdev); + mutex_lock(&tp->control); + tp->rtl_ops.disable(tp); + mutex_unlock(&tp->control); + } + + usb_autopm_put_interface(intf); + + return 0; +} + +static int rtl8152_post_reset(struct usb_interface *intf) +{ + struct r8152 *tp = usb_get_intfdata(intf); + struct net_device *netdev; + int ret; + + if (intf->condition != USB_INTERFACE_BOUND || !tp) + return 0; + + netdev = tp->netdev; + if (!netif_running(netdev)) + return 0; + + ret = usb_autopm_get_interface(intf); + if (ret < 0) + return ret; + + set_bit(WORK_ENABLE, &tp->flags); + if (netif_carrier_ok(netdev)) { + mutex_lock(&tp->control); + tp->rtl_ops.enable(tp); + rtl8152_set_rx_mode(netdev); + mutex_unlock(&tp->control); + netif_wake_queue(netdev); + } + + napi_enable(&tp->napi); + + usb_autopm_put_interface(intf); + + return ret; +} + +static void rtl_hw_reset(struct work_struct *work) +{ + struct r8152 *tp = container_of(work, struct r8152, work_reset.work); + + netif_info(tp, drv, tp->netdev, "usb reset device\n"); + + if (test_bit(RTL8152_UNPLUG, &tp->flags)) + return; + + usb_reset_device(tp->udev); +} + static int rtl8152_suspend(struct usb_interface *intf, pm_message_t message) { struct r8152 *tp = usb_get_intfdata(intf); @@ -5771,6 +6028,7 @@ static int rtl8152_get_coalesce(struct net_device *netdev, switch (tp->version) { case RTL_VER_01: case RTL_VER_02: + case RTL_VER_07: return -EOPNOTSUPP; default: break; @@ -5790,6 +6048,7 @@ static int rtl8152_set_coalesce(struct net_device *netdev, switch (tp->version) { case RTL_VER_01: case RTL_VER_02: + case RTL_VER_07: return -EOPNOTSUPP; default: break; @@ -6099,6 +6358,7 @@ static int rtl8152_change_mtu(struct net_device *dev, int new_mtu) switch (tp->version) { case RTL_VER_01: case RTL_VER_02: + case RTL_VER_07: return eth_change_mtu(dev, new_mtu); default: break; @@ -6115,8 +6375,14 @@ static int rtl8152_change_mtu(struct net_device *dev, int new_mtu) dev->mtu = new_mtu; - if (netif_running(dev) && netif_carrier_ok(dev)) - r8153_set_rx_early_size(tp); + if (netif_running(dev)) { + u32 rms = new_mtu + VLAN_ETH_HLEN + VLAN_HLEN; + + ocp_write_word(tp, MCU_TYPE_PLA, PLA_RMS, rms); + + if (netif_carrier_ok(dev)) + r8153_set_rx_early_size(tp); + } mutex_unlock(&tp->control); @@ -6178,6 +6444,9 @@ static void r8152b_get_version(struct r8152 *tp) tp->version = RTL_VER_06; tp->mii.supports_gmii = 1; break; + case 0x4800: + tp->version = RTL_VER_07; + break; default: netif_info(tp, probe, tp->netdev, "Unknown version 0x%04x\n", version); @@ -6210,6 +6479,7 @@ static int rtl_ops_init(struct r8152 *tp) switch (tp->version) { case RTL_VER_01: case RTL_VER_02: + case RTL_VER_07: ops->init = r8152b_init; ops->enable = rtl8152_enable; ops->disable = rtl8152_disable; @@ -6286,6 +6556,7 @@ static int rtl8152_probe(struct usb_interface *intf, mutex_init(&tp->control); INIT_DELAYED_WORK(&tp->schedule, rtl_work_func_t); + INIT_DELAYED_WORK(&tp->work_reset, rtl_hw_reset); #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) netdev->open = rtl8152_open; @@ -6348,7 +6619,8 @@ static int rtl8152_probe(struct usb_interface *intf, break; } - intf->needs_remote_wakeup = 1; + if (udev->actconfig->desc.bmAttributes & USB_CONFIG_ATT_WAKEUP) + intf->needs_remote_wakeup = 1; tp->rtl_ops.init(tp); set_ethernet_addr(tp); @@ -6411,16 +6683,26 @@ static void rtl8152_disconnect(struct usb_interface *intf) /* table of devices that work with this driver */ static struct usb_device_id rtl8152_table[] = { + /* Realtek */ + {REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8050)}, {REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8152)}, {REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8153)}, + + /* Samsung */ {REALTEK_USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101)}, - {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x7205)}, - {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3052)}, + + /* Lenovo */ {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x304f)}, + {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3052)}, + {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3054)}, + {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3057)}, + {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x7205)}, {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x720a)}, {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x720b)}, {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x720c)}, - {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3054)}, + + /* TP-LINK */ + {REALTEK_USB_DEVICE(VENDOR_ID_TPLINK, 0x0601)}, {} }; @@ -6434,6 +6716,8 @@ static struct usb_driver rtl8152_driver = { .suspend = rtl8152_suspend, .resume = rtl8152_resume, .reset_resume = rtl8152_resume, + .pre_reset = rtl8152_pre_reset, + .post_reset = rtl8152_post_reset, .supports_autosuspend = 1, #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) .disable_hub_initiated_lpm = 1, From 5ec68faaad0c6beae87a0d28c14f738a1053fb94 Mon Sep 17 00:00:00 2001 From: moonman Date: Sat, 24 Oct 2015 06:33:20 -0600 Subject: [PATCH 340/359] Update rtl8812au to v4.3.14_13455 and enable 8821 support --- arch/arm/configs/odroidxu3_defconfig | 2 +- backports/drivers/realtek/rtl8812au/Kconfig | 6 +- backports/drivers/realtek/rtl8812au/Makefile | 486 +- .../realtek/rtl8812au/core/efuse/rtw_efuse.c | 205 +- .../drivers/realtek/rtl8812au/core/rtw_ap.c | 254 +- .../realtek/rtl8812au/core/rtw_beamforming.c | 499 +- .../realtek/rtl8812au/core/rtw_br_ext.c | 77 +- .../realtek/rtl8812au/core/rtw_bt_mp.c | 8 +- .../realtek/rtl8812au/core/rtw_btcoex.c | 1513 +- .../drivers/realtek/rtl8812au/core/rtw_cmd.c | 514 +- .../realtek/rtl8812au/core/rtw_debug.c | 1592 +- .../realtek/rtl8812au/core/rtw_ieee80211.c | 146 +- .../drivers/realtek/rtl8812au/core/rtw_io.c | 6 +- .../realtek/rtl8812au/core/rtw_ioctl_set.c | 18 +- .../drivers/realtek/rtl8812au/core/rtw_iol.c | 4 +- .../drivers/realtek/rtl8812au/core/rtw_mem.c | 103 + .../drivers/realtek/rtl8812au/core/rtw_mlme.c | 593 +- .../realtek/rtl8812au/core/rtw_mlme_ext.c | 2125 ++- .../drivers/realtek/rtl8812au/core/rtw_mp.c | 440 +- .../realtek/rtl8812au/core/rtw_mp_ioctl.c | 6 +- .../drivers/realtek/rtl8812au/core/rtw_odm.c | 186 +- .../drivers/realtek/rtl8812au/core/rtw_p2p.c | 205 +- .../realtek/rtl8812au/core/rtw_pwrctrl.c | 205 +- .../drivers/realtek/rtl8812au/core/rtw_recv.c | 1336 +- .../realtek/rtl8812au/core/rtw_security.c | 120 +- .../realtek/rtl8812au/core/rtw_sreset.c | 18 +- .../realtek/rtl8812au/core/rtw_sta_mgt.c | 48 +- .../drivers/realtek/rtl8812au/core/rtw_tdls.c | 2525 ++- .../drivers/realtek/rtl8812au/core/rtw_vht.c | 44 +- .../realtek/rtl8812au/core/rtw_wlan_util.c | 1406 +- .../drivers/realtek/rtl8812au/core/rtw_xmit.c | 524 +- .../realtek/rtl8812au/hal/HalPwrSeqCmd.c | 2 +- .../hal/OUTSRC-BTCoexist/HalBtc8188c2Ant.c | 52 +- .../hal/OUTSRC-BTCoexist/HalBtc8188c2Ant.h | 7 +- .../hal/OUTSRC-BTCoexist/HalBtc8192d2Ant.c | 52 +- .../hal/OUTSRC-BTCoexist/HalBtc8192d2Ant.h | 7 +- .../hal/OUTSRC-BTCoexist/HalBtc8192e1Ant.c | 72 +- .../hal/OUTSRC-BTCoexist/HalBtc8192e1Ant.h | 7 +- .../hal/OUTSRC-BTCoexist/HalBtc8192e2Ant.c | 67 +- .../hal/OUTSRC-BTCoexist/HalBtc8192e2Ant.h | 7 +- .../hal/OUTSRC-BTCoexist/HalBtc8723a1Ant.c | 50 +- .../hal/OUTSRC-BTCoexist/HalBtc8723a2Ant.c | 110 +- .../hal/OUTSRC-BTCoexist/HalBtc8723a2Ant.h | 7 +- .../hal/OUTSRC-BTCoexist/HalBtc8723b1Ant.c | 2300 ++- .../hal/OUTSRC-BTCoexist/HalBtc8723b1Ant.h | 110 +- .../hal/OUTSRC-BTCoexist/HalBtc8723b2Ant.c | 1313 +- .../hal/OUTSRC-BTCoexist/HalBtc8723b2Ant.h | 48 +- .../hal/OUTSRC-BTCoexist/HalBtc8812a1Ant.c | 60 +- .../hal/OUTSRC-BTCoexist/HalBtc8812a1Ant.h | 7 +- .../hal/OUTSRC-BTCoexist/HalBtc8812a2Ant.c | 457 +- .../hal/OUTSRC-BTCoexist/HalBtc8812a2Ant.h | 8 +- .../hal/OUTSRC-BTCoexist/HalBtc8821a1Ant.c | 669 +- .../hal/OUTSRC-BTCoexist/HalBtc8821a1Ant.h | 21 +- .../hal/OUTSRC-BTCoexist/HalBtc8821a2Ant.c | 3148 ++-- .../hal/OUTSRC-BTCoexist/HalBtc8821a2Ant.h | 68 +- .../hal/OUTSRC-BTCoexist/HalBtc8821aCsr2Ant.c | 4398 +++++ .../hal/OUTSRC-BTCoexist/HalBtc8821aCsr2Ant.h | 207 + .../hal/OUTSRC-BTCoexist/HalBtcOutSrc.h | 134 +- .../hal/OUTSRC-BTCoexist/Mp_Precomp.h | 1 + .../realtek/rtl8812au/hal/OUTSRC/HalPhyRf.c | 64 +- .../realtek/rtl8812au/hal/OUTSRC/Mp_Precomp.h | 24 + .../rtl8812au/hal/OUTSRC/PhyDM_Adaptivity.c | 922 + .../rtl8812au/hal/OUTSRC/PhyDM_Adaptivity.h | 143 + .../realtek/rtl8812au/hal/OUTSRC/odm.c | 14176 ---------------- .../realtek/rtl8812au/hal/OUTSRC/odm.h | 2366 --- .../realtek/rtl8812au/hal/OUTSRC/odm_AntDiv.c | 2269 --- .../realtek/rtl8812au/hal/OUTSRC/odm_AntDiv.h | 136 - .../realtek/rtl8812au/hal/OUTSRC/odm_debug.c | 629 - .../realtek/rtl8812au/hal/OUTSRC/odm_debug.h | 892 - .../rtl8812au/hal/OUTSRC/odm_precomp.h | 307 - .../realtek/rtl8812au/hal/OUTSRC/odm_reg.h | 122 - .../realtek/rtl8812au/hal/OUTSRC/phydm.c | 1731 ++ .../realtek/rtl8812au/hal/OUTSRC/phydm.h | 1335 ++ .../realtek/rtl8812au/hal/OUTSRC/phydm_ACS.c | 213 + .../realtek/rtl8812au/hal/OUTSRC/phydm_ACS.h | 61 + .../rtl8812au/hal/OUTSRC/phydm_AntDect.c | 1215 ++ .../rtl8812au/hal/OUTSRC/phydm_AntDect.h | 98 + .../rtl8812au/hal/OUTSRC/phydm_AntDiv.c | 4059 +++++ .../rtl8812au/hal/OUTSRC/phydm_AntDiv.h | 538 + .../rtl8812au/hal/OUTSRC/phydm_CfoTracking.c | 357 + .../rtl8812au/hal/OUTSRC/phydm_CfoTracking.h | 68 + .../realtek/rtl8812au/hal/OUTSRC/phydm_DIG.c | 2008 +++ .../realtek/rtl8812au/hal/OUTSRC/phydm_DIG.h | 309 + .../hal/OUTSRC/phydm_DynamicBBPowerSaving.c | 218 + .../hal/OUTSRC/phydm_DynamicBBPowerSaving.h | 63 + .../hal/OUTSRC/phydm_DynamicTxPower.c | 882 + .../hal/OUTSRC/phydm_DynamicTxPower.h | 89 + .../hal/OUTSRC/phydm_EdcaTurboCheck.c | 831 + .../hal/OUTSRC/phydm_EdcaTurboCheck.h | 99 + .../{odm_HWConfig.c => phydm_HWConfig.c} | 1031 +- .../{odm_HWConfig.h => phydm_HWConfig.h} | 8 +- .../rtl8812au/hal/OUTSRC/phydm_NoiseMonitor.c | 197 + .../rtl8812au/hal/OUTSRC/phydm_NoiseMonitor.h | 49 + .../rtl8812au/hal/OUTSRC/phydm_PathDiv.c | 2239 +++ .../rtl8812au/hal/OUTSRC/phydm_PathDiv.h | 320 + .../hal/OUTSRC/phydm_PowerTracking.c | 687 + .../hal/OUTSRC/phydm_PowerTracking.h | 248 + .../realtek/rtl8812au/hal/OUTSRC/phydm_RXHP.c | 1685 ++ .../realtek/rtl8812au/hal/OUTSRC/phydm_RXHP.h | 105 + .../rtl8812au/hal/OUTSRC/phydm_RaInfo.c | 2233 +++ .../rtl8812au/hal/OUTSRC/phydm_RaInfo.h | 328 + ..._RegDefine11AC.h => phydm_RegDefine11AC.h} | 24 +- ...dm_RegDefine11N.h => phydm_RegDefine11N.h} | 37 +- .../rtl8812au/hal/OUTSRC/phydm_debug.c | 1030 ++ .../rtl8812au/hal/OUTSRC/phydm_debug.h | 279 + .../{odm_interface.c => phydm_interface.c} | 378 +- .../{odm_interface.h => phydm_interface.h} | 80 +- .../rtl8812au/hal/OUTSRC/phydm_pre_define.h | 483 + .../rtl8812au/hal/OUTSRC/phydm_precomp.h | 275 + .../realtek/rtl8812au/hal/OUTSRC/phydm_reg.h | 208 + .../hal/OUTSRC/{odm_types.h => phydm_types.h} | 93 +- .../hal/OUTSRC/rtl8812a/HalHWImg8812A_BB.c | 923 +- .../hal/OUTSRC/rtl8812a/HalHWImg8812A_BB.h | 55 +- .../hal/OUTSRC/rtl8812a/HalHWImg8812A_FW.c | 10169 +++++------ .../hal/OUTSRC/rtl8812a/HalHWImg8812A_MAC.c | 225 +- .../hal/OUTSRC/rtl8812a/HalHWImg8812A_MAC.h | 5 +- .../hal/OUTSRC/rtl8812a/HalHWImg8812A_RF.c | 1790 +- .../hal/OUTSRC/rtl8812a/HalHWImg8812A_RF.h | 36 +- .../rtl8812a/HalHWImg8812A_TestChip_BB.c | 1229 -- .../rtl8812a/HalHWImg8812A_TestChip_FW.c | 2575 --- .../rtl8812a/HalHWImg8812A_TestChip_MAC.c | 239 - .../rtl8812a/HalHWImg8812A_TestChip_RF.c | 1920 --- .../hal/OUTSRC/rtl8812a/HalPhyRf_8812A.c | 153 +- .../hal/OUTSRC/rtl8812a/Mp_Precomp.h | 24 + .../{odm_RTL8812A.c => phydm_RTL8812A.c} | 23 +- .../{odm_RTL8812A.h => phydm_RTL8812A.h} | 12 +- ...egConfig8812A.c => phydm_RegConfig8812A.c} | 3 +- ...egConfig8812A.h => phydm_RegConfig8812A.h} | 0 .../hal/OUTSRC/rtl8821a/HalHWImg8821A_BB.c | 742 + .../HalHWImg8821A_BB.h} | 38 +- .../hal/OUTSRC/rtl8821a/HalHWImg8821A_FW.c | 6371 +++++++ .../HalHWImg8821A_FW.h} | 60 +- .../hal/OUTSRC/rtl8821a/HalHWImg8821A_MAC.c | 287 + .../HalHWImg8821A_MAC.h} | 10 +- .../hal/OUTSRC/rtl8821a/HalHWImg8821A_RF.c | 4739 ++++++ .../hal/OUTSRC/rtl8821a/HalHWImg8821A_RF.h | 138 + .../hal/OUTSRC/rtl8821a/HalPhyRf_8821A.c | 289 + .../hal/OUTSRC/rtl8821a/HalPhyRf_8821A.h | 52 + .../hal/OUTSRC/rtl8821a/Mp_Precomp.h | 24 + .../hal/OUTSRC/rtl8821a/PhyDM_IQK_8821A.c | 875 + .../hal/OUTSRC/rtl8821a/PhyDM_IQK_8821A.h | 48 + .../hal/OUTSRC/rtl8821a/phydm_RTL8821A.c | 54 + .../hal/OUTSRC/rtl8821a/phydm_RTL8821A.h | 29 + .../OUTSRC/rtl8821a/phydm_RegConfig8821A.c | 223 + .../OUTSRC/rtl8821a/phydm_RegConfig8821A.h | 96 + .../realtek/rtl8812au/hal/efuse/efuse_mask.h | 53 + .../efuse/rtl8812a/HalEfuseMask8812A_PCIE.c | 100 + .../rtl8812a/HalEfuseMask8812A_PCIE.h} | 32 +- .../efuse/rtl8812a/HalEfuseMask8812A_USB.c | 102 + .../efuse/rtl8812a/HalEfuseMask8812A_USB.h | 40 + .../efuse/rtl8812a/HalEfuseMask8821A_PCIE.c | 102 + .../efuse/rtl8812a/HalEfuseMask8821A_PCIE.h | 41 + .../efuse/rtl8812a/HalEfuseMask8821A_USB.c | 102 + .../efuse/rtl8812a/HalEfuseMask8821A_USB.h | 39 + .../realtek/rtl8812au/hal/hal_btcoex.c | 968 +- .../drivers/realtek/rtl8812au/hal/hal_com.c | 6057 ++++++- .../realtek/rtl8812au/hal/hal_com_phycfg.c | 120 +- .../drivers/realtek/rtl8812au/hal/hal_dm.c | 196 + .../drivers/realtek/rtl8812au/hal/hal_dm.h | 26 + .../realtek/rtl8812au/hal/hal_hci/hal_usb.c | 543 + .../drivers/realtek/rtl8812au/hal/hal_intf.c | 135 +- .../realtek/rtl8812au/hal/led/hal_usb_led.c | 43 +- .../rtl8812au/hal/rtl8812a/rtl8812a_cmd.c | 2090 ++- .../rtl8812au/hal/rtl8812a/rtl8812a_dm.c | 253 +- .../hal/rtl8812a/rtl8812a_hal_init.c | 1642 +- .../rtl8812au/hal/rtl8812a/rtl8812a_mp.c | 51 +- .../rtl8812au/hal/rtl8812a/rtl8812a_phycfg.c | 193 +- .../rtl8812au/hal/rtl8812a/rtl8812a_rxdesc.c | 252 +- .../rtl8812au/hal/rtl8812a/rtl8812a_sreset.c | 2 +- .../rtl8812au/hal/rtl8812a/rtl8812a_xmit.c | 34 +- .../hal/rtl8812a/usb/rtl8812au_led.c | 10 +- .../hal/rtl8812a/usb/rtl8812au_recv.c | 188 +- .../hal/rtl8812a/usb/rtl8812au_xmit.c | 64 +- .../rtl8812au/hal/rtl8812a/usb/usb_halinit.c | 524 +- .../hal/rtl8812a/usb/usb_ops_linux.c | 687 +- .../rtl8812au/include/Hal8188EPhyReg.h | 1 + .../rtl8812au/include/Hal8192CPhyReg.h | 1 + .../rtl8812au/include/Hal8192DPhyReg.h | 3 +- .../rtl8812au/include/Hal8192EPhyCfg.h | 8 + .../rtl8812au/include/Hal8192EPhyReg.h | 7 +- .../rtl8812au/include/Hal8723BPhyReg.h | 3 +- .../realtek/rtl8812au/include/Hal8812PhyReg.h | 8 +- .../realtek/rtl8812au/include/Hal8812PwrSeq.h | 4 +- .../realtek/rtl8812au/include/autoconf.h | 119 +- .../realtek/rtl8812au/include/basic_types.h | 30 +- .../realtek/rtl8812au/include/drv_conf.h | 30 + .../realtek/rtl8812au/include/drv_types.h | 330 +- .../realtek/rtl8812au/include/gspi_hal.h | 2 +- .../realtek/rtl8812au/include/gspi_ops.h | 18 +- .../realtek/rtl8812au/include/hal_btcoex.h | 19 +- .../realtek/rtl8812au/include/hal_com.h | 167 +- .../realtek/rtl8812au/include/hal_com_h2c.h | 136 +- .../realtek/rtl8812au/include/hal_com_led.h | 3 +- .../rtl8812au/include/hal_com_phycfg.h | 4 +- .../realtek/rtl8812au/include/hal_com_reg.h | 76 +- .../realtek/rtl8812au/include/hal_data.h | 53 +- .../realtek/rtl8812au/include/hal_gspi.h | 32 + .../realtek/rtl8812au/include/hal_intf.h | 46 +- .../realtek/rtl8812au/include/hal_pg.h | 6 +- .../realtek/rtl8812au/include/hal_sdio.h | 1 + .../realtek/rtl8812au/include/ieee80211.h | 38 +- .../rtl8812au/include/linux/wireless.h | 8 +- .../realtek/rtl8812au/include/osdep_intf.h | 18 +- .../realtek/rtl8812au/include/osdep_service.h | 7 +- .../rtl8812au/include/osdep_service_linux.h | 20 +- .../realtek/rtl8812au/include/pci_hal.h | 8 + .../realtek/rtl8812au/include/pci_ops.h | 20 + .../realtek/rtl8812au/include/recv_osdep.h | 2 + .../realtek/rtl8812au/include/rtl8188e_cmd.h | 9 +- .../realtek/rtl8812au/include/rtl8188e_hal.h | 83 +- .../realtek/rtl8812au/include/rtl8188e_led.h | 2 +- .../realtek/rtl8812au/include/rtl8188e_recv.h | 10 +- .../realtek/rtl8812au/include/rtl8188e_spec.h | 15 +- .../realtek/rtl8812au/include/rtl8188e_xmit.h | 23 +- .../realtek/rtl8812au/include/rtl8192c_cmd.h | 1 + .../realtek/rtl8812au/include/rtl8192c_hal.h | 9 +- .../realtek/rtl8812au/include/rtl8192c_recv.h | 28 +- .../realtek/rtl8812au/include/rtl8192c_spec.h | 22 +- .../realtek/rtl8812au/include/rtl8192c_xmit.h | 12 +- .../realtek/rtl8812au/include/rtl8192d_cmd.h | 30 +- .../realtek/rtl8812au/include/rtl8192d_hal.h | 5 +- .../realtek/rtl8812au/include/rtl8192d_recv.h | 24 +- .../realtek/rtl8812au/include/rtl8192d_spec.h | 7 +- .../realtek/rtl8812au/include/rtl8192d_xmit.h | 12 +- .../realtek/rtl8812au/include/rtl8192e_cmd.h | 41 +- .../realtek/rtl8812au/include/rtl8192e_hal.h | 110 +- .../realtek/rtl8812au/include/rtl8192e_recv.h | 44 +- .../realtek/rtl8812au/include/rtl8192e_spec.h | 80 +- .../realtek/rtl8812au/include/rtl8192e_xmit.h | 82 +- .../realtek/rtl8812au/include/rtl8723a_cmd.h | 6 +- .../realtek/rtl8812au/include/rtl8723a_hal.h | 12 +- .../realtek/rtl8812au/include/rtl8723a_recv.h | 10 +- .../realtek/rtl8812au/include/rtl8723a_spec.h | 4 +- .../realtek/rtl8812au/include/rtl8723a_xmit.h | 5 +- .../realtek/rtl8812au/include/rtl8723b_cmd.h | 60 +- .../realtek/rtl8812au/include/rtl8723b_hal.h | 66 +- .../realtek/rtl8812au/include/rtl8723b_led.h | 4 + .../realtek/rtl8812au/include/rtl8723b_recv.h | 132 +- .../realtek/rtl8812au/include/rtl8723b_spec.h | 109 +- .../realtek/rtl8812au/include/rtl8723b_xmit.h | 185 +- .../realtek/rtl8812au/include/rtl8812a_cmd.h | 58 +- .../realtek/rtl8812au/include/rtl8812a_hal.h | 78 +- .../realtek/rtl8812au/include/rtl8812a_recv.h | 15 +- .../realtek/rtl8812au/include/rtl8812a_spec.h | 19 +- .../realtek/rtl8812au/include/rtl8812a_xmit.h | 13 +- .../realtek/rtl8812au/include/rtl8821a_spec.h | 9 +- .../realtek/rtl8812au/include/rtw_android.h | 18 + .../realtek/rtl8812au/include/rtw_ap.h | 3 +- .../rtl8812au/include/rtw_beamforming.h | 45 +- .../realtek/rtl8812au/include/rtw_bt_mp.h | 2 +- .../realtek/rtl8812au/include/rtw_btcoex.h | 318 +- .../realtek/rtl8812au/include/rtw_cmd.h | 68 +- .../realtek/rtl8812au/include/rtw_debug.h | 80 +- .../realtek/rtl8812au/include/rtw_eeprom.h | 5 +- .../realtek/rtl8812au/include/rtw_efuse.h | 14 + .../realtek/rtl8812au/include/rtw_event.h | 4 + .../realtek/rtl8812au/include/rtw_ht.h | 75 +- .../realtek/rtl8812au/include/rtw_io.h | 5 + .../realtek/rtl8812au/include/rtw_mem.h | 38 + .../realtek/rtl8812au/include/rtw_mlme.h | 93 +- .../realtek/rtl8812au/include/rtw_mlme_ext.h | 142 +- .../realtek/rtl8812au/include/rtw_mp.h | 199 +- .../rtl8812au/include/rtw_mp_phy_regdef.h | 9 +- .../realtek/rtl8812au/include/rtw_odm.h | 9 +- .../realtek/rtl8812au/include/rtw_p2p.h | 1 + .../realtek/rtl8812au/include/rtw_pwrctrl.h | 28 +- .../realtek/rtl8812au/include/rtw_recv.h | 74 +- .../realtek/rtl8812au/include/rtw_rf.h | 14 - .../realtek/rtl8812au/include/rtw_security.h | 26 + .../realtek/rtl8812au/include/rtw_tdls.h | 98 +- .../realtek/rtl8812au/include/rtw_version.h | 3 +- .../realtek/rtl8812au/include/rtw_vht.h | 25 +- .../realtek/rtl8812au/include/rtw_wifi_regd.h | 8 +- .../realtek/rtl8812au/include/rtw_xmit.h | 96 +- .../realtek/rtl8812au/include/sdio_hal.h | 4 + .../realtek/rtl8812au/include/sdio_ops.h | 16 + .../realtek/rtl8812au/include/sta_info.h | 23 +- .../realtek/rtl8812au/include/usb_hal.h | 3 + .../realtek/rtl8812au/include/usb_ops_linux.h | 15 + .../drivers/realtek/rtl8812au/include/wifi.h | 19 +- .../realtek/rtl8812au/include/wlan_bssdef.h | 3 +- .../realtek/rtl8812au/include/xmit_osdep.h | 4 + .../os_dep/linux/custom_gpio_linux.c | 68 +- .../rtl8812au/os_dep/linux/ioctl_cfg80211.c | 823 +- .../linux}/ioctl_cfg80211.h | 11 +- .../rtl8812au/os_dep/linux/ioctl_linux.c | 2474 ++- .../rtl8812au/os_dep/linux/mlme_linux.c | 43 +- .../realtek/rtl8812au/os_dep/linux/os_intfs.c | 1239 +- .../rtl8812au/os_dep/linux/recv_linux.c | 85 +- .../rtl8812au/os_dep/linux/rtw_android.c | 222 +- .../rtl8812au/os_dep/linux/rtw_cfgvendor.c | 1328 ++ .../rtl8812au/os_dep/linux/rtw_cfgvendor.h | 246 + .../realtek/rtl8812au/os_dep/linux/rtw_proc.c | 533 +- .../realtek/rtl8812au/os_dep/linux/rtw_proc.h | 12 +- .../realtek/rtl8812au/os_dep/linux/usb_intf.c | 509 +- .../rtl8812au/os_dep/linux/usb_ops_linux.c | 519 +- .../rtl8812au/os_dep/linux/wifi_regd.c | 90 +- .../rtl8812au/os_dep/linux/xmit_linux.c | 177 +- .../realtek/rtl8812au/os_dep/osdep_service.c | 124 +- .../platform/platform_ARM_SUNnI_sdio.c | 17 +- .../platform/platform_ARM_WMT_sdio.c | 51 + .../platform/platform_arm_act_sdio.c | 58 + 302 files changed, 90908 insertions(+), 46959 deletions(-) create mode 100644 backports/drivers/realtek/rtl8812au/core/rtw_mem.c create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8821aCsr2Ant.c create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8821aCsr2Ant.h create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/Mp_Precomp.h create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/PhyDM_Adaptivity.c create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/PhyDM_Adaptivity.h delete mode 100755 backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm.c delete mode 100755 backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm.h delete mode 100755 backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_AntDiv.c delete mode 100755 backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_AntDiv.h delete mode 100755 backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_debug.c delete mode 100755 backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_debug.h delete mode 100755 backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_precomp.h delete mode 100755 backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_reg.h create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm.c create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm.h create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_ACS.c create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_ACS.h create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_AntDect.c create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_AntDect.h create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_AntDiv.c create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_AntDiv.h create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_CfoTracking.c create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_CfoTracking.h create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_DIG.c create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_DIG.h create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_DynamicBBPowerSaving.c create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_DynamicBBPowerSaving.h create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_DynamicTxPower.c create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_DynamicTxPower.h create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_EdcaTurboCheck.c create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_EdcaTurboCheck.h rename backports/drivers/realtek/rtl8812au/hal/OUTSRC/{odm_HWConfig.c => phydm_HWConfig.c} (71%) mode change 100755 => 100644 rename backports/drivers/realtek/rtl8812au/hal/OUTSRC/{odm_HWConfig.h => phydm_HWConfig.h} (93%) mode change 100755 => 100644 create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_NoiseMonitor.c create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_NoiseMonitor.h create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_PathDiv.c create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_PathDiv.h create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_PowerTracking.c create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_PowerTracking.h create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_RXHP.c create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_RXHP.h create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_RaInfo.c create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_RaInfo.h rename backports/drivers/realtek/rtl8812au/hal/OUTSRC/{odm_RegDefine11AC.h => phydm_RegDefine11AC.h} (65%) mode change 100755 => 100644 rename backports/drivers/realtek/rtl8812au/hal/OUTSRC/{odm_RegDefine11N.h => phydm_RegDefine11N.h} (84%) mode change 100755 => 100644 create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_debug.c create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_debug.h rename backports/drivers/realtek/rtl8812au/hal/OUTSRC/{odm_interface.c => phydm_interface.c} (59%) mode change 100755 => 100644 rename backports/drivers/realtek/rtl8812au/hal/OUTSRC/{odm_interface.h => phydm_interface.h} (80%) mode change 100755 => 100644 create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_pre_define.h create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_precomp.h create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_reg.h rename backports/drivers/realtek/rtl8812au/hal/OUTSRC/{odm_types.h => phydm_types.h} (73%) mode change 100755 => 100644 delete mode 100755 backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_BB.c delete mode 100755 backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_FW.c delete mode 100755 backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_MAC.c delete mode 100755 backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_RF.c create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/Mp_Precomp.h rename backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/{odm_RTL8812A.c => phydm_RTL8812A.c} (89%) mode change 100755 => 100644 rename backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/{odm_RTL8812A.h => phydm_RTL8812A.h} (87%) mode change 100755 => 100644 rename backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/{odm_RegConfig8812A.c => phydm_RegConfig8812A.c} (98%) mode change 100755 => 100644 rename backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/{odm_RegConfig8812A.h => phydm_RegConfig8812A.h} (100%) mode change 100755 => 100644 create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalHWImg8821A_BB.c rename backports/drivers/realtek/rtl8812au/hal/OUTSRC/{rtl8812a/HalHWImg8812A_TestChip_BB.h => rtl8821a/HalHWImg8821A_BB.h} (57%) mode change 100755 => 100644 create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalHWImg8821A_FW.c rename backports/drivers/realtek/rtl8812au/hal/OUTSRC/{rtl8812a/HalHWImg8812A_TestChip_RF.h => rtl8821a/HalHWImg8821A_FW.h} (52%) mode change 100755 => 100644 create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalHWImg8821A_MAC.c rename backports/drivers/realtek/rtl8812au/hal/OUTSRC/{rtl8812a/HalHWImg8812A_TestChip_MAC.h => rtl8821a/HalHWImg8821A_MAC.h} (80%) mode change 100755 => 100644 create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalHWImg8821A_RF.c create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalHWImg8821A_RF.h create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalPhyRf_8821A.c create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalPhyRf_8821A.h create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/Mp_Precomp.h create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/PhyDM_IQK_8821A.c create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/PhyDM_IQK_8821A.h create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/phydm_RTL8821A.c create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/phydm_RTL8821A.h create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/phydm_RegConfig8821A.c create mode 100644 backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/phydm_RegConfig8821A.h create mode 100644 backports/drivers/realtek/rtl8812au/hal/efuse/efuse_mask.h create mode 100644 backports/drivers/realtek/rtl8812au/hal/efuse/rtl8812a/HalEfuseMask8812A_PCIE.c rename backports/drivers/realtek/rtl8812au/hal/{OUTSRC/rtl8812a/HalHWImg8812A_TestChip_FW.h => efuse/rtl8812a/HalEfuseMask8812A_PCIE.h} (61%) mode change 100755 => 100644 create mode 100644 backports/drivers/realtek/rtl8812au/hal/efuse/rtl8812a/HalEfuseMask8812A_USB.c create mode 100644 backports/drivers/realtek/rtl8812au/hal/efuse/rtl8812a/HalEfuseMask8812A_USB.h create mode 100644 backports/drivers/realtek/rtl8812au/hal/efuse/rtl8812a/HalEfuseMask8821A_PCIE.c create mode 100644 backports/drivers/realtek/rtl8812au/hal/efuse/rtl8812a/HalEfuseMask8821A_PCIE.h create mode 100644 backports/drivers/realtek/rtl8812au/hal/efuse/rtl8812a/HalEfuseMask8821A_USB.c create mode 100644 backports/drivers/realtek/rtl8812au/hal/efuse/rtl8812a/HalEfuseMask8821A_USB.h create mode 100644 backports/drivers/realtek/rtl8812au/hal/hal_dm.c create mode 100644 backports/drivers/realtek/rtl8812au/hal/hal_dm.h create mode 100644 backports/drivers/realtek/rtl8812au/include/hal_gspi.h create mode 100644 backports/drivers/realtek/rtl8812au/include/rtw_mem.h rename backports/drivers/realtek/rtl8812au/{include => os_dep/linux}/ioctl_cfg80211.h (90%) mode change 100755 => 100644 create mode 100644 backports/drivers/realtek/rtl8812au/os_dep/linux/rtw_cfgvendor.c create mode 100644 backports/drivers/realtek/rtl8812au/os_dep/linux/rtw_cfgvendor.h create mode 100644 backports/drivers/realtek/rtl8812au/platform/platform_ARM_WMT_sdio.c create mode 100644 backports/drivers/realtek/rtl8812au/platform/platform_arm_act_sdio.c diff --git a/arch/arm/configs/odroidxu3_defconfig b/arch/arm/configs/odroidxu3_defconfig index 4ab741675cf45a..9e65f24cf06827 100755 --- a/arch/arm/configs/odroidxu3_defconfig +++ b/arch/arm/configs/odroidxu3_defconfig @@ -4483,6 +4483,6 @@ CONFIG_BACKPORT_USB_NET_RNDIS_HOST=m # CONFIG_BACKPORT_USB_WDM=m CONFIG_RTL8192CU=m -CONFIG_RTL8812AU=m +CONFIG_RTL8821AU=m CONFIG_RTL8188EU=m CONFIG_RTL8192DU=m diff --git a/backports/drivers/realtek/rtl8812au/Kconfig b/backports/drivers/realtek/rtl8812au/Kconfig index f87653d5ae214e..bddf51b34ec430 100755 --- a/backports/drivers/realtek/rtl8812au/Kconfig +++ b/backports/drivers/realtek/rtl8812au/Kconfig @@ -1,6 +1,6 @@ -config RTL8812AU - tristate "Realtek 8812A USB WiFi" +config RTL8821AU + tristate "Realtek 8821A USB WiFi" depends on USB ---help--- - Help message of RTL8812AU + Help message of RTL8821AU diff --git a/backports/drivers/realtek/rtl8812au/Makefile b/backports/drivers/realtek/rtl8812au/Makefile index ef25111e71ac8a..86f1be9b5aa868 100755 --- a/backports/drivers/realtek/rtl8812au/Makefile +++ b/backports/drivers/realtek/rtl8812au/Makefile @@ -1,11 +1,12 @@ EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS) EXTRA_CFLAGS += -O1 #EXTRA_CFLAGS += -O3 -#EXTRA_CFLAGS += -Wall -#EXTRA_CFLAGS += -Wextra +EXTRA_CFLAGS += -Wall +EXTRA_CFLAGS += -Wextra #EXTRA_CFLAGS += -Werror #EXTRA_CFLAGS += -pedantic #EXTRA_CFLAGS += -Wshadow -Wpointer-arith -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes +EXTRA_CFLAGS += -Werror=incompatible-pointer-types EXTRA_CFLAGS += -Wno-unused-variable EXTRA_CFLAGS += -Wno-unused-value @@ -15,6 +16,7 @@ EXTRA_CFLAGS += -Wno-unused-function EXTRA_CFLAGS += -Wno-unused #EXTRA_CFLAGS += -Wno-uninitialized +EXTRA_CFLAGS += -Wno-date-time EXTRA_CFLAGS += -I$(src)/include @@ -22,21 +24,22 @@ EXTRA_LDFLAGS += --strip-debug CONFIG_AUTOCFG_CP = n +########################## WIFI IC ############################ CONFIG_MULTIDRV = n CONFIG_RTL8192C = n CONFIG_RTL8192D = n CONFIG_RTL8723A = n CONFIG_RTL8188E = n CONFIG_RTL8812A = y -CONFIG_RTL8821A = n +CONFIG_RTL8821A = y CONFIG_RTL8192E = n CONFIG_RTL8723B = n - +######################### Interface ########################### CONFIG_USB_HCI = y CONFIG_PCI_HCI = n CONFIG_SDIO_HCI = n CONFIG_GSPI_HCI = n - +########################## Features ########################### CONFIG_MP_INCLUDED = y CONFIG_POWER_SAVING = y CONFIG_USB_AUTOSUSPEND = n @@ -48,17 +51,32 @@ CONFIG_INTEL_WIDI = n CONFIG_WAPI_SUPPORT = n CONFIG_EFUSE_CONFIG_FILE = n CONFIG_EXT_CLK = n -CONFIG_WOWLAN = n -CONFIG_GPIO_WAKEUP = n CONFIG_TRAFFIC_PROTECT = y CONFIG_LOAD_PHY_PARA_FROM_FILE = y -CONFIG_ODM_ADAPTIVITY = n +CONFIG_CALIBRATE_TX_POWER_BY_REGULATORY = n +CONFIG_CALIBRATE_TX_POWER_TO_MAX = n +CONFIG_RTW_ADAPTIVITY_EN = disable +CONFIG_RTW_ADAPTIVITY_MODE = normal +CONFIG_SKIP_SIGNAL_SCALE_MAPPING = n +CONFIG_80211W = n +CONFIG_REDUCE_TX_CPU_LOADING = n +CONFIG_BR_EXT = y +CONFIG_ANTENNA_DIVERSITY = n +CONFIG_TDLS = n +######################## Wake On Lan ########################## +CONFIG_WOWLAN = n +CONFIG_GPIO_WAKEUP = n +CONFIG_WAKEUP_GPIO_IDX = default CONFIG_PNO_SUPPORT = n CONFIG_PNO_SET_DEBUG = n CONFIG_AP_WOWLAN = n - -CONFIG_PLATFORM_I386_PC = y +######### Notify SDIO Host Keep Power During Syspend ########## +CONFIG_RTW_SDIO_PM_KEEP_POWER = y +###################### Platform Related ####################### +CONFIG_PLATFORM_GENERIC = y +CONFIG_PLATFORM_I386_PC = n CONFIG_PLATFORM_ANDROID_X86 = n +CONFIG_PLATFORM_ANDROID_INTEL_X86 = n CONFIG_PLATFORM_JB_X86 = n CONFIG_PLATFORM_ARM_S3C2K4 = n CONFIG_PLATFORM_ARM_PXA2XX = n @@ -79,12 +97,12 @@ CONFIG_PLATFORM_ARM_TCC8900 = n CONFIG_PLATFORM_ARM_TCC8920 = n CONFIG_PLATFORM_ARM_TCC8920_JB42 = n CONFIG_PLATFORM_ARM_RK2818 = n +CONFIG_PLATFORM_ARM_RK3066 = n CONFIG_PLATFORM_ARM_RK3188 = n CONFIG_PLATFORM_ARM_URBETTER = n CONFIG_PLATFORM_ARM_TI_PANDA = n CONFIG_PLATFORM_MIPS_JZ4760 = n CONFIG_PLATFORM_DMP_PHILIPS = n -CONFIG_PLATFORM_TI_DM365 = n CONFIG_PLATFORM_MSTAR_TITANIA12 = n CONFIG_PLATFORM_MSTAR = n CONFIG_PLATFORM_SZEBOOK = n @@ -94,9 +112,16 @@ CONFIG_PLATFORM_ARM_SUN7I = n CONFIG_PLATFORM_ARM_SUN8I = n CONFIG_PLATFORM_ACTIONS_ATM702X = n CONFIG_PLATFORM_ACTIONS_ATV5201 = n +CONFIG_PLATFORM_ACTIONS_ATM705X = n CONFIG_PLATFORM_ARM_RTD299X = n CONFIG_PLATFORM_ARM_SPREADTRUM_6820 = n CONFIG_PLATFORM_ARM_SPREADTRUM_8810 = n +CONFIG_PLATFORM_ARM_WMT = n +CONFIG_PLATFORM_TI_DM365 = n +CONFIG_PLATFORM_MOZART = n +CONFIG_PLATFORM_RTK119X = n +CONFIG_PLATFORM_NOVATEK_NT72668 = n +############################################################### CONFIG_DRVEXT_MODULE = n @@ -129,6 +154,7 @@ _OS_INTFS_FILES := os_dep/osdep_service.o \ os_dep/linux/mlme_linux.o \ os_dep/linux/recv_linux.o \ os_dep/linux/ioctl_cfg80211.o \ + os_dep/linux/rtw_cfgvendor.o \ os_dep/linux/wifi_regd.o \ os_dep/linux/rtw_android.o \ os_dep/linux/rtw_proc.o @@ -148,16 +174,29 @@ _HAL_INTFS_FILES := hal/hal_intf.o \ hal/hal_com.o \ hal/hal_com_phycfg.o \ hal/hal_phy.o \ + hal/hal_dm.o \ hal/hal_btcoex.o \ hal/hal_hci/hal_$(HCI_NAME).o \ hal/led/hal_$(HCI_NAME)_led.o - -_OUTSRC_FILES := hal/OUTSRC/odm_debug.o \ - hal/OUTSRC/odm_AntDiv.o\ - hal/OUTSRC/odm_interface.o\ - hal/OUTSRC/odm_HWConfig.o\ - hal/OUTSRC/odm.o\ - hal/OUTSRC/HalPhyRf.o + +_OUTSRC_FILES := hal/OUTSRC/phydm_debug.o \ + hal/OUTSRC/phydm_AntDiv.o\ + hal/OUTSRC/phydm_AntDect.o\ + hal/OUTSRC/phydm_interface.o\ + hal/OUTSRC/phydm_HWConfig.o\ + hal/OUTSRC/phydm.o\ + hal/OUTSRC/HalPhyRf.o\ + hal/OUTSRC/phydm_EdcaTurboCheck.o\ + hal/OUTSRC/phydm_DIG.o\ + hal/OUTSRC/phydm_PathDiv.o\ + hal/OUTSRC/phydm_RaInfo.o\ + hal/OUTSRC/phydm_DynamicBBPowerSaving.o\ + hal/OUTSRC/phydm_PowerTracking.o\ + hal/OUTSRC/phydm_DynamicTxPower.o\ + hal/OUTSRC/PhyDM_Adaptivity.o\ + hal/OUTSRC/phydm_CfoTracking.o\ + hal/OUTSRC/phydm_NoiseMonitor.o\ + hal/OUTSRC/phydm_ACS.o EXTRA_CFLAGS += -I$(src)/platform _PLATFORM_FILES := platform/platform_ops.o @@ -175,10 +214,11 @@ _OUTSRC_FILES += hal/OUTSRC-BTCoexist/HalBtc8188c2Ant.o \ hal/OUTSRC-BTCoexist/HalBtc8812a1Ant.o \ hal/OUTSRC-BTCoexist/HalBtc8812a2Ant.o \ hal/OUTSRC-BTCoexist/HalBtc8821a1Ant.o \ - hal/OUTSRC-BTCoexist/HalBtc8821a2Ant.o + hal/OUTSRC-BTCoexist/HalBtc8821a2Ant.o \ + hal/OUTSRC-BTCoexist/HalBtc8821aCsr2Ant.o endif - -########### HAL_RTL8192C ################################# + +########### HAL_RTL8192C ################################# ifeq ($(CONFIG_RTL8192C), y) RTL871X = rtl8192c @@ -203,7 +243,7 @@ _HAL_INTFS_FILES += hal/$(RTL871X)/$(RTL871X)_hal_init.o \ hal/$(RTL871X)/$(HCI_NAME)/$(HCI_NAME)_halinit.o \ hal/$(RTL871X)/$(HCI_NAME)/rtl$(MODULE_NAME)_led.o \ hal/$(RTL871X)/$(HCI_NAME)/rtl$(MODULE_NAME)_xmit.o \ - hal/$(RTL871X)/$(HCI_NAME)/rtl$(MODULE_NAME)_recv.o + hal/$(RTL871X)/$(HCI_NAME)/rtl$(MODULE_NAME)_recv.o _HAL_INTFS_FILES += hal/$(RTL871X)/$(HCI_NAME)/$(HCI_NAME)_ops_linux.o @@ -212,7 +252,7 @@ ifeq ($(CONFIG_MP_INCLUDED), y) _HAL_INTFS_FILES += hal/$(RTL871X)/$(RTL871X)_mp.o endif -_OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/odm_RTL8192C.o\ +_OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/phydm_RTL8192C.o\ hal/OUTSRC/$(RTL871X)/HalDMOutSrc8192C_CE.o ifeq ($(CONFIG_USB_HCI), y) @@ -260,10 +300,10 @@ ifeq ($(CONFIG_MP_INCLUDED), y) _HAL_INTFS_FILES += hal/$(RTL871X)/$(RTL871X)_mp.o endif -_OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/odm_RTL8192D.o\ +_OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/phydm_RTL8192D.o\ hal/OUTSRC/$(RTL871X)/HalDMOutSrc8192D_CE.o - + ifeq ($(CONFIG_USB_HCI), y) _OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/Hal8192DUFWImg_CE.o \ hal/OUTSRC/$(RTL871X)/Hal8192DUPHYImg_CE.o \ @@ -300,7 +340,7 @@ _HAL_INTFS_FILES += hal/HalPwrSeqCmd.o \ hal/$(RTL871X)/Hal8723PwrSeq.o\ hal/$(RTL871X)/$(RTL871X)_xmit.o \ hal/$(RTL871X)/$(RTL871X)_sreset.o - + _HAL_INTFS_FILES += hal/$(RTL871X)/$(RTL871X)_hal_init.o \ hal/$(RTL871X)/$(RTL871X)_phycfg.o \ hal/$(RTL871X)/$(RTL871X)_rf6052.o \ @@ -311,7 +351,7 @@ _HAL_INTFS_FILES += hal/$(RTL871X)/$(RTL871X)_hal_init.o \ hal/$(RTL871X)/$(HCI_NAME)/rtl$(MODULE_NAME)_led.o \ hal/$(RTL871X)/$(HCI_NAME)/rtl$(MODULE_NAME)_xmit.o \ hal/$(RTL871X)/$(HCI_NAME)/rtl$(MODULE_NAME)_recv.o - + ifeq ($(CONFIG_SDIO_HCI), y) _HAL_INTFS_FILES += hal/$(RTL871X)/$(HCI_NAME)/$(HCI_NAME)_ops.o else @@ -346,7 +386,7 @@ endif _OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/HalHWImg8723A_BB.o\ hal/OUTSRC/$(RTL871X)/HalHWImg8723A_MAC.o\ hal/OUTSRC/$(RTL871X)/HalHWImg8723A_RF.o\ - hal/OUTSRC/$(RTL871X)/odm_RegConfig8723A.o + hal/OUTSRC/$(RTL871X)/phydm_RegConfig8723A.o _OUTSRC_FILES += hal/OUTSRC/rtl8192c/HalDMOutSrc8192C_CE.o @@ -362,6 +402,10 @@ ifeq ($(CONFIG_SDIO_HCI), y) MODULE_NAME = 8189es endif +ifeq ($(CONFIG_GSPI_HCI), y) +MODULE_NAME = 8189es +endif + ifeq ($(CONFIG_USB_HCI), y) MODULE_NAME = 8188eu endif @@ -399,7 +443,17 @@ endif ifeq ($(CONFIG_MP_INCLUDED), y) _HAL_INTFS_FILES += hal/$(RTL871X)/$(RTL871X)_mp.o -endif +endif + +ifeq ($(CONFIG_USB_HCI), y) +_HAL_INTFS_FILES +=hal/efuse/$(RTL871X)/HalEfuseMask8188E_USB.o +endif +ifeq ($(CONFIG_PCI_HCI), y) +_HAL_INTFS_FILES +=hal/efuse/$(RTL871X)/HalEfuseMask8188E_PCIE.o +endif +ifeq ($(CONFIG_SDIO_HCI), y) +_HAL_INTFS_FILES +=hal/efuse/$(RTL871X)/HalEfuseMask8188E_SDIO.o +endif #hal/OUTSRC/$(RTL871X)/Hal8188EFWImg_CE.o _OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/HalHWImg8188E_MAC.o\ @@ -407,9 +461,9 @@ _OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/HalHWImg8188E_MAC.o\ hal/OUTSRC/$(RTL871X)/HalHWImg8188E_RF.o\ hal/OUTSRC/$(RTL871X)/HalHWImg8188E_FW.o\ hal/OUTSRC/$(RTL871X)/HalPhyRf_8188e.o\ - hal/OUTSRC/$(RTL871X)/odm_RegConfig8188E.o\ + hal/OUTSRC/$(RTL871X)/phydm_RegConfig8188E.o\ hal/OUTSRC/$(RTL871X)/Hal8188ERateAdaptive.o\ - hal/OUTSRC/$(RTL871X)/odm_RTL8188E.o + hal/OUTSRC/$(RTL871X)/phydm_RTL8188E.o endif @@ -459,14 +513,21 @@ ifeq ($(CONFIG_MP_INCLUDED), y) _HAL_INTFS_FILES += hal/$(RTL871X)/$(RTL871X)_mp.o endif +ifeq ($(CONFIG_USB_HCI), y) +_HAL_INTFS_FILES +=hal/efuse/$(RTL871X)/HalEfuseMask8192E_USB.o +endif +ifeq ($(CONFIG_PCI_HCI), y) +_HAL_INTFS_FILES +=hal/efuse/$(RTL871X)/HalEfuseMask8192E_PCIE.o +endif + #hal/OUTSRC/$(RTL871X)/HalHWImg8188E_FW.o _OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/HalHWImg8192E_MAC.o\ hal/OUTSRC/$(RTL871X)/HalHWImg8192E_BB.o\ hal/OUTSRC/$(RTL871X)/HalHWImg8192E_RF.o\ hal/OUTSRC/$(RTL871X)/HalHWImg8192E_FW.o\ hal/OUTSRC/$(RTL871X)/HalPhyRf_8192e.o\ - hal/OUTSRC/$(RTL871X)/odm_RegConfig8192E.o\ - hal/OUTSRC/$(RTL871X)/odm_RTL8192E.o + hal/OUTSRC/$(RTL871X)/phydm_RegConfig8192E.o\ + hal/OUTSRC/$(RTL871X)/phydm_RTL8192E.o endif @@ -516,19 +577,32 @@ ifeq ($(CONFIG_MP_INCLUDED), y) _HAL_INTFS_FILES += hal/$(RTL871X)/$(RTL871X)_mp.o endif +ifeq ($(CONFIG_RTL8812A), y) +ifeq ($(CONFIG_USB_HCI), y) +_HAL_INTFS_FILES +=hal/efuse/$(RTL871X)/HalEfuseMask8812A_USB.o +endif +ifeq ($(CONFIG_PCI_HCI), y) +_HAL_INTFS_FILES +=hal/efuse/$(RTL871X)/HalEfuseMask8812A_PCIE.o +endif +endif +ifeq ($(CONFIG_RTL8821A), y) +ifeq ($(CONFIG_USB_HCI), y) +_HAL_INTFS_FILES +=hal/efuse/$(RTL871X)/HalEfuseMask8821A_USB.o +endif +ifeq ($(CONFIG_PCI_HCI), y) +_HAL_INTFS_FILES +=hal/efuse/$(RTL871X)/HalEfuseMask8821A_PCIE.o +endif +endif + ifeq ($(CONFIG_RTL8812A), y) EXTRA_CFLAGS += -DCONFIG_RTL8812A _OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/HalHWImg8812A_FW.o\ hal/OUTSRC/$(RTL871X)/HalHWImg8812A_MAC.o\ hal/OUTSRC/$(RTL871X)/HalHWImg8812A_BB.o\ hal/OUTSRC/$(RTL871X)/HalHWImg8812A_RF.o\ - hal/OUTSRC/$(RTL871X)/HalHWImg8812A_TestChip_FW.o\ - hal/OUTSRC/$(RTL871X)/HalHWImg8812A_TestChip_MAC.o\ - hal/OUTSRC/$(RTL871X)/HalHWImg8812A_TestChip_BB.o\ - hal/OUTSRC/$(RTL871X)/HalHWImg8812A_TestChip_RF.o\ hal/OUTSRC/$(RTL871X)/HalPhyRf_8812A.o\ - hal/OUTSRC/$(RTL871X)/odm_RegConfig8812A.o\ - hal/OUTSRC/$(RTL871X)/odm_RTL8812A.o + hal/OUTSRC/$(RTL871X)/phydm_RegConfig8812A.o\ + hal/OUTSRC/$(RTL871X)/phydm_RTL8812A.o endif ifeq ($(CONFIG_RTL8821A), y) @@ -553,14 +627,12 @@ _OUTSRC_FILES += hal/OUTSRC/rtl8821a/HalHWImg8821A_FW.o\ hal/OUTSRC/rtl8821a/HalHWImg8821A_MAC.o\ hal/OUTSRC/rtl8821a/HalHWImg8821A_BB.o\ hal/OUTSRC/rtl8821a/HalHWImg8821A_RF.o\ - hal/OUTSRC/rtl8821a/HalHWImg8821A_TestChip_MAC.o\ - hal/OUTSRC/rtl8821a/HalHWImg8821A_TestChip_BB.o\ - hal/OUTSRC/rtl8821a/HalHWImg8821A_TestChip_RF.o\ hal/OUTSRC/rtl8812a/HalPhyRf_8812A.o\ hal/OUTSRC/rtl8821a/HalPhyRf_8821A.o\ - hal/OUTSRC/rtl8821a/odm_RegConfig8821A.o\ - hal/OUTSRC/rtl8821a/odm_RTL8821A.o -endif + hal/OUTSRC/rtl8821a/phydm_RegConfig8821A.o\ + hal/OUTSRC/rtl8821a/phydm_RTL8821A.o\ + hal/OUTSRC/rtl8821a/PhyDM_IQK_8821A.o +endif endif @@ -572,6 +644,9 @@ RTL871X = rtl8723b ifeq ($(CONFIG_USB_HCI), y) MODULE_NAME = 8723bu endif +ifeq ($(CONFIG_PCI_HCI), y) +MODULE_NAME = 8723be +endif ifeq ($(CONFIG_SDIO_HCI), y) MODULE_NAME = 8723bs endif @@ -588,36 +663,50 @@ _HAL_INTFS_FILES += hal/$(RTL871X)/$(RTL871X)_hal_init.o \ hal/$(RTL871X)/$(RTL871X)_dm.o \ hal/$(RTL871X)/$(RTL871X)_rxdesc.o \ hal/$(RTL871X)/$(RTL871X)_cmd.o \ + + +_HAL_INTFS_FILES += \ hal/$(RTL871X)/$(HCI_NAME)/$(HCI_NAME)_halinit.o \ hal/$(RTL871X)/$(HCI_NAME)/rtl$(MODULE_NAME)_led.o \ hal/$(RTL871X)/$(HCI_NAME)/rtl$(MODULE_NAME)_xmit.o \ hal/$(RTL871X)/$(HCI_NAME)/rtl$(MODULE_NAME)_recv.o +ifeq ($(CONFIG_PCI_HCI), y) +_HAL_INTFS_FILES += hal/$(RTL871X)/$(HCI_NAME)/$(HCI_NAME)_ops_linux.o +else _HAL_INTFS_FILES += hal/$(RTL871X)/$(HCI_NAME)/$(HCI_NAME)_ops.o +endif ifeq ($(CONFIG_MP_INCLUDED), y) _HAL_INTFS_FILES += hal/$(RTL871X)/$(RTL871X)_mp.o endif +ifeq ($(CONFIG_USB_HCI), y) +_HAL_INTFS_FILES +=hal/efuse/$(RTL871X)/HalEfuseMask8723B_USB.o +endif +ifeq ($(CONFIG_PCI_HCI), y) +_HAL_INTFS_FILES +=hal/efuse/$(RTL871X)/HalEfuseMask8723B_PCIE.o +endif + _OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/HalHWImg8723B_BB.o\ hal/OUTSRC/$(RTL871X)/HalHWImg8723B_MAC.o\ hal/OUTSRC/$(RTL871X)/HalHWImg8723B_RF.o\ hal/OUTSRC/$(RTL871X)/HalHWImg8723B_FW.o\ hal/OUTSRC/$(RTL871X)/HalHWImg8723B_MP.o\ - hal/OUTSRC/$(RTL871X)/odm_RegConfig8723B.o\ + hal/OUTSRC/$(RTL871X)/phydm_RegConfig8723B.o\ hal/OUTSRC/$(RTL871X)/HalPhyRf_8723B.o\ - hal/OUTSRC/$(RTL871X)/odm_RTL8723B.o + hal/OUTSRC/$(RTL871X)/phydm_RTL8723B.o endif -########### AUTO_CFG ################################# - +########### AUTO_CFG ################################# + ifeq ($(CONFIG_AUTOCFG_CP), y) -ifeq ($(CONFIG_MULTIDRV), y) +ifeq ($(CONFIG_MULTIDRV), y) $(shell cp $(TopDIR)/autoconf_multidrv_$(HCI_NAME)_linux.h $(TopDIR)/include/autoconf.h) else -ifeq ($(CONFIG_RTL8188E)$(CONFIG_SDIO_HCI),yy) +ifeq ($(CONFIG_RTL8188E)$(CONFIG_SDIO_HCI),yy) $(shell cp $(TopDIR)/autoconf_rtl8189e_$(HCI_NAME)_linux.h $(TopDIR)/include/autoconf.h) else $(shell cp $(TopDIR)/autoconf_$(RTL871X)_$(HCI_NAME)_linux.h $(TopDIR)/include/autoconf.h) @@ -671,6 +760,14 @@ endif ifeq ($(CONFIG_EFUSE_CONFIG_FILE), y) EXTRA_CFLAGS += -DCONFIG_EFUSE_CONFIG_FILE +ifeq ($(MODULE_NAME), 8189es) +EXTRA_CFLAGS += -DEFUSE_MAP_PATH=\"/system/etc/wifi/wifi_efuse_8189e.map\" +else ifeq ($(MODULE_NAME), 8723bs) +EXTRA_CFLAGS += -DEFUSE_MAP_PATH=\"/system/etc/wifi/wifi_efuse_8723bs.map\" +else +EXTRA_CFLAGS += -DEFUSE_MAP_PATH=\"/system/etc/wifi/wifi_efuse_$(MODULE_NAME).map\" +endif +EXTRA_CFLAGS += -DWIFIMAC_PATH=\"/data/wifimac.txt\" endif ifeq ($(CONFIG_EXT_CLK), y) @@ -683,52 +780,100 @@ endif ifeq ($(CONFIG_LOAD_PHY_PARA_FROM_FILE), y) EXTRA_CFLAGS += -DCONFIG_LOAD_PHY_PARA_FROM_FILE +#EXTRA_CFLAGS += -DREALTEK_CONFIG_PATH=\"/lib/firmware/\" +EXTRA_CFLAGS += -DREALTEK_CONFIG_PATH=\"\" endif -ifeq ($(CONFIG_ODM_ADAPTIVITY), y) -EXTRA_CFLAGS += -DCONFIG_ODM_ADAPTIVITY +ifeq ($(CONFIG_CALIBRATE_TX_POWER_BY_REGULATORY), y) +EXTRA_CFLAGS += -DCONFIG_CALIBRATE_TX_POWER_BY_REGULATORY endif -ifeq ($(CONFIG_RTL8188E), y) -ifeq ($(CONFIG_WOWLAN), y) -EXTRA_CFLAGS += -DCONFIG_WOWLAN +ifeq ($(CONFIG_CALIBRATE_TX_POWER_TO_MAX), y) +EXTRA_CFLAGS += -DCONFIG_CALIBRATE_TX_POWER_TO_MAX endif + +ifeq ($(CONFIG_RTW_ADAPTIVITY_EN), disable) +EXTRA_CFLAGS += -DCONFIG_RTW_ADAPTIVITY_EN=0 +else ifeq ($(CONFIG_RTW_ADAPTIVITY_EN), enable) +EXTRA_CFLAGS += -DCONFIG_RTW_ADAPTIVITY_EN=1 endif -ifeq ($(CONFIG_RTL8192E), y) -ifeq ($(CONFIG_WOWLAN), y) -EXTRA_CFLAGS += -DCONFIG_WOWLAN +ifeq ($(CONFIG_RTW_ADAPTIVITY_MODE), normal) +EXTRA_CFLAGS += -DCONFIG_RTW_ADAPTIVITY_MODE=0 +else ifeq ($(CONFIG_RTW_ADAPTIVITY_MODE), carrier_sense) +EXTRA_CFLAGS += -DCONFIG_RTW_ADAPTIVITY_MODE=1 endif -ifeq ($(CONFIG_AP_WOWLAN), y) -EXTRA_CFLAGS += -DCONFIG_AP_WOWLAN + +ifeq ($(CONFIG_SKIP_SIGNAL_SCALE_MAPPING), y) +EXTRA_CFLAGS += -DCONFIG_SKIP_SIGNAL_SCALE_MAPPING endif + +ifeq ($(CONFIG_80211W), y) +EXTRA_CFLAGS += -DCONFIG_IEEE80211W endif -ifeq ($(CONFIG_RTL8723B), y) ifeq ($(CONFIG_WOWLAN), y) EXTRA_CFLAGS += -DCONFIG_WOWLAN +ifeq ($(CONFIG_SDIO_HCI), y) +EXTRA_CFLAGS += -DCONFIG_RTW_SDIO_PM_KEEP_POWER +endif +endif + +ifeq ($(CONFIG_AP_WOWLAN), y) +EXTRA_CFLAGS += -DCONFIG_AP_WOWLAN +ifeq ($(CONFIG_SDIO_HCI), y) +EXTRA_CFLAGS += -DCONFIG_RTW_SDIO_PM_KEEP_POWER endif -ifeq ($(CONFIG_GPIO_WAKEUP), y) -EXTRA_CFLAGS += -DCONFIG_GPIO_WAKEUP endif + ifeq ($(CONFIG_PNO_SUPPORT), y) EXTRA_CFLAGS += -DCONFIG_PNO_SUPPORT ifeq ($(CONFIG_PNO_SET_DEBUG), y) EXTRA_CFLAGS += -DCONFIG_PNO_SET_DEBUG endif endif -ifeq ($(CONFIG_AP_WOWLAN), y) -EXTRA_CFLAGS += -DCONFIG_AP_WOWLAN + +ifeq ($(CONFIG_GPIO_WAKEUP), y) +EXTRA_CFLAGS += -DCONFIG_GPIO_WAKEUP +endif + +ifneq ($(CONFIG_WAKEUP_GPIO_IDX), default) +EXTRA_CFLAGS += -DWAKEUP_GPIO_IDX=$(CONFIG_WAKEUP_GPIO_IDX) +endif + +ifeq ($(CONFIG_RTW_SDIO_PM_KEEP_POWER), y) ifeq ($(CONFIG_SDIO_HCI), y) -EXTRA_CFLAGS += -DCONFIG_MMC_PM_KEEP_POWER +EXTRA_CFLAGS += -DCONFIG_RTW_SDIO_PM_KEEP_POWER endif endif + +ifeq ($(CONFIG_REDUCE_TX_CPU_LOADING), y) +EXTRA_CFLAGS += -DCONFIG_REDUCE_TX_CPU_LOADING endif -ifeq ($(CONFIG_WOWLAN), y) -ifeq ($(CONFIG_SDIO_HCI), y) -EXTRA_CFLAGS += -DCONFIG_MMC_PM_KEEP_POWER +ifeq ($(CONFIG_BR_EXT), y) +BR_NAME = br0 +EXTRA_CFLAGS += -DCONFIG_BR_EXT +EXTRA_CFLAGS += '-DCONFIG_BR_EXT_BRNAME="'$(BR_NAME)'"' endif + +ifeq ($(CONFIG_ANTENNA_DIVERSITY), y) +EXTRA_CFLAGS += -DCONFIG_ANTENNA_DIVERSITY +endif + +ifeq ($(CONFIG_TDLS), y) +EXTRA_CFLAGS += -DCONFIG_TDLS +endif + +ifeq ($(CONFIG_PLATFORM_GENERIC), y) +EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN +SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/armv.*/arm/) +ARCH ?= $(SUBARCH) +CROSS_COMPILE ?= +KVER ?= $(shell uname -r) +KSRC := /lib/modules/$(KVER)/build +MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/ +INSTALL_PREFIX := endif ifeq ($(CONFIG_PLATFORM_I386_PC), y) @@ -754,6 +899,25 @@ KSRC := $(KERNEL_BUILD_PATH) MODULE_NAME :=wlan endif +ifeq ($(CONFIG_PLATFORM_ACTIONS_ATM705X), y) +EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN +#EXTRA_CFLAGS += -DRTW_ENABLE_WIFI_CONTROL_FUNC +# default setting for Android 4.1, 4.2, 4.3, 4.4 +EXTRA_CFLAGS += -DCONFIG_PLATFORM_ACTIONS_ATM705X +EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE +EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT +EXTRA_CFLAGS += -DCONFIG_P2P_IPS + +EXTRA_CFLAGS += -DCONFIG_PLATFORM_OPS +ifeq ($(CONFIG_SDIO_HCI), y) +_PLATFORM_FILES += platform/platform_arm_act_sdio.o +endif + +ARCH := arm +CROSS_COMPILE := /opt/arm-2011.09/bin/arm-none-linux-gnueabi- +KSRC := /home/android_sdk/Action-semi/705a_android_L/android/kernel +endif + ifeq ($(CONFIG_PLATFORM_TI_AM3517), y) EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ANDROID -DCONFIG_PLATFORM_SHUTTLE CROSS_COMPILE := arm-eabi- @@ -770,7 +934,7 @@ KSRC:= /usr/src/Mstar_kernel/2.6.28.9/ endif ifeq ($(CONFIG_PLATFORM_MSTAR), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_MSTAR +EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_MSTAR #-DCONFIG_PLATFORM_MSTAR_SCAN_BEFORE_CONNECT ARCH:=arm CROSS_COMPILE:= /usr/src/bin/arm-none-linux-gnueabi- KVER:= 3.1.10 @@ -786,6 +950,19 @@ KSRC := /media/DATA-2/android-x86/ics-x86_20120130/out/target/product/generic_x8 MODULE_NAME :=wlan endif +ifeq ($(CONFIG_PLATFORM_ANDROID_INTEL_X86), y) +EXTRA_CFLAGS += -DCONFIG_PLATFORM_ANDROID_INTEL_X86 +EXTRA_CFLAGS += -DCONFIG_PLATFORM_INTEL_BYT +EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ANDROID +EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE +EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT +EXTRA_CFLAGS += -DCONFIG_P2P_IPS +EXTRA_CFLAGS += -DCONFIG_SKIP_SIGNAL_SCALE_MAPPING +ifeq ($(CONFIG_SDIO_HCI), y) +EXTRA_CFLAGS += -DCONFIG_RESUME_IN_WORKQUEUE +endif +endif + ifeq ($(CONFIG_PLATFORM_JB_X86), y) EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE @@ -898,7 +1075,7 @@ KSRC ?= /lib/modules/2.6.31-770-g0e46b52/source endif ifeq ($(CONFIG_PLATFORM_FS_MX61), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN +EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN ARCH := arm CROSS_COMPILE := /home/share/CusEnv/FreeScale/arm-eabi-4.4.3/bin/arm-eabi- KSRC ?= /home/share/CusEnv/FreeScale/FS_kernel_env @@ -916,10 +1093,24 @@ endif ifeq ($(CONFIG_PLATFORM_TI_DM365), y) EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_TI_DM365 +EXTRA_CFLAGS += -DCONFIG_USE_USB_BUFFER_ALLOC_RX +EXTRA_CFLAGS += -DCONFIG_SINGLE_XMIT_BUF -DCONFIG_SINGLE_RECV_BUF ARCH := arm -CROSS_COMPILE := /home/cnsd4/Appro/mv_pro_5.0/montavista/pro/devkit/arm/v5t_le/bin/arm_v5t_le- +#CROSS_COMPILE := /home/cnsd4/Appro/mv_pro_5.0/montavista/pro/devkit/arm/v5t_le/bin/arm_v5t_le- +#KSRC := /home/cnsd4/Appro/mv_pro_5.0/montavista/pro/devkit/lsp/ti-davinci/linux-dm365 +CROSS_COMPILE := /opt/montavista/pro5.0/devkit/arm/v5t_le/bin/arm-linux- +KSRC:= /home/vivotek/lsp/DM365/kernel_platform/kernel/linux-2.6.18 +KERNELOUTPUT := ${PRODUCTDIR}/tmp KVER := 2.6.18 -KSRC := /home/cnsd4/Appro/mv_pro_5.0/montavista/pro/devkit/lsp/ti-davinci/linux-dm365 +endif + +ifeq ($(CONFIG_PLATFORM_MOZART), y) +EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_MOZART +ARCH := arm +CROSS_COMPILE := /home/vivotek/lsp/mozart3v2/Mozart3e_Toolchain/build_arm_nofpu/usr/bin/arm-linux- +KVER := $(shell uname -r) +KSRC:= /opt/Vivotek/lsp/mozart3v2/kernel_platform/kernel/mozart_kernel-1.17 +KERNELOUTPUT := /home/pink/sample/ODM/IP8136W-VINT/tmp/kernel endif ifeq ($(CONFIG_PLATFORM_TEGRA3_CARDHU), y) @@ -977,7 +1168,7 @@ MODULE_NAME := wlan endif ifeq ($(CONFIG_PLATFORM_ARM_RK2818), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ANDROID -DCONFIG_PLATFORM_ROCKCHIPS -DCONFIG_MINIMAL_MEMORY_USAGE +EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ANDROID -DCONFIG_PLATFORM_ROCKCHIPS ARCH := arm CROSS_COMPILE := /usr/src/release_fae_version/toolchain/arm-eabi-4.4.0/bin/arm-eabi- KSRC := /usr/src/release_fae_version/kernel25_A7_281x @@ -985,16 +1176,39 @@ MODULE_NAME := wlan endif ifeq ($(CONFIG_PLATFORM_ARM_RK3188), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ANDROID -DCONFIG_PLATFORM_ROCKCHIPS -DCONFIG_MINIMAL_MEMORY_USAGE +EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ANDROID -DCONFIG_PLATFORM_ROCKCHIPS +# default setting for Android 4.1, 4.2, 4.3, 4.4 +EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT +EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE +# default setting for Power control EXTRA_CFLAGS += -DRTW_ENABLE_WIFI_CONTROL_FUNC EXTRA_CFLAGS += -DRTW_SUPPORT_PLATFORM_SHUTDOWN -EXTRA_CFLAGS += -DRTW_USE_CFG80211_STA_EVENT +# default setting for Special function +EXTRA_CFLAGS += -DCONFIG_P2P_IPS ARCH := arm CROSS_COMPILE := /home/android_sdk/Rockchip/Rk3188/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi- KSRC := /home/android_sdk/Rockchip/Rk3188/kernel MODULE_NAME := wlan endif +ifeq ($(CONFIG_PLATFORM_ARM_RK3066), y) +EXTRA_CFLAGS += -DCONFIG_PLATFORM_ARM_RK3066 +EXTRA_CFLAGS += -DRTW_ENABLE_WIFI_CONTROL_FUNC +EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN +EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE +EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 +EXTRA_CFLAGS += -DCONFIG_P2P_IPS +ifeq ($(CONFIG_SDIO_HCI), y) +EXTRA_CFLAGS += -DRTW_SUPPORT_PLATFORM_SHUTDOWN +endif +EXTRA_CFLAGS += -fno-pic +ARCH := arm +CROSS_COMPILE := /home/android_sdk/Rockchip/rk3066_20130607/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/arm-linux-androideabi- +#CROSS_COMPILE := /home/android_sdk/Rockchip/Rk3066sdk/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/arm-linux-androideabi- +KSRC := /home/android_sdk/Rockchip/Rk3066sdk/kernel +MODULE_NAME :=wlan +endif + ifeq ($(CONFIG_PLATFORM_ARM_URBETTER), y) EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN #-DCONFIG_MINIMAL_MEMORY_USAGE ARCH := arm @@ -1023,7 +1237,7 @@ endif ifeq ($(CONFIG_PLATFORM_SZEBOOK), y) EXTRA_CFLAGS += -DCONFIG_BIG_ENDIAN ARCH:=arm -CROSS_COMPILE:=/opt/crosstool2/bin/armeb-unknown-linux-gnueabi- +CROSS_COMPILE:=/opt/crosstool2/bin/armeb-unknown-linux-gnueabi- KVER:= 2.6.31.6 KSRC:= ../code/linux-2.6.31.6-2020/ endif @@ -1070,7 +1284,7 @@ ifeq ($(CONFIG_PLATFORM_ARM_SUN6I), y) EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN EXTRA_CFLAGS += -DCONFIG_PLATFORM_ARM_SUN6I EXTRA_CFLAGS += -DCONFIG_TRAFFIC_PROTECT -# default setting for Android 4.1, 4.2 +# default setting for Android 4.1, 4.2, 4.3, 4.4 EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT EXTRA_CFLAGS += -DCONFIG_P2P_IPS -DCONFIG_QOS_OPTIMIZATION @@ -1087,25 +1301,22 @@ _PLATFORM_FILES += platform/platform_ARM_SUNnI_sdio.o endif ARCH := arm -KVER := 3.3.0 #Android-JB42 #CROSS_COMPILE := /home/android_sdk/Allwinner/a31/android-jb42/lichee/buildroot/output/external-toolchain/bin/arm-linux-gnueabi- #KSRC :=/home/android_sdk/Allwinner/a31/android-jb42/lichee/linux-3.3 - -#Android-KK44 -CROSS_COMPILE := /home/android_sdk/Allwinner/a31/android-kk44/A3x-KK-SDK/lichee/buildroot/output/external-toolchain/bin/arm-linux-gnueabi- -KSRC :=/home/android_sdk/Allwinner/a31/android-kk44/A3x-KK-SDK/lichee/linux-3.3 - -ifeq ($(CONFIG_USB_HCI), y) -MODULE_NAME := 8188eu_sw -endif +#ifeq ($(CONFIG_USB_HCI), y) +#MODULE_NAME := 8188eu_sw +#endif +# ==== Cross compile setting for kitkat-a3x_v4.5 ===== +CROSS_COMPILE := /home/android_sdk/Allwinner/a31/kitkat-a3x_v4.5/lichee/buildroot/output/external-toolchain/bin/arm-linux-gnueabi- +KSRC :=/home/android_sdk/Allwinner/a31/kitkat-a3x_v4.5/lichee/linux-3.3 endif ifeq ($(CONFIG_PLATFORM_ARM_SUN7I), y) EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN EXTRA_CFLAGS += -DCONFIG_PLATFORM_ARM_SUN7I EXTRA_CFLAGS += -DCONFIG_TRAFFIC_PROTECT -# default setting for Android 4.1, 4.2 +# default setting for Android 4.1, 4.2, 4.3, 4.4 EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT EXTRA_CFLAGS += -DCONFIG_P2P_IPS -DCONFIG_QOS_OPTIMIZATION @@ -1121,20 +1332,14 @@ endif ARCH := arm # ===Cross compile setting for Android 4.2 SDK === -#CROSS_COMPILE :=/home/android_sdk/Allwinner/a20_evb/lichee/out/android/common/buildroot/external-toolchain/bin/arm-linux-gnueabi- -#KVER := 3.3.0 +#CROSS_COMPILE := /home/android_sdk/Allwinner/a20_evb/lichee/out/android/common/buildroot/external-toolchain/bin/arm-linux-gnueabi- #KSRC := /home/android_sdk/Allwinner/a20_evb/lichee/linux-3.3 - # ==== Cross compile setting for Android 4.3 SDK ===== #CROSS_COMPILE := /home/android_sdk/Allwinner/a20/android-jb43/lichee/out/android/common/buildroot/external-toolchain/bin/arm-linux-gnueabi- -#KVER := 3.4.39 -#KSRC :=/home/android_sdk/Allwinner/a20/android-jb43/lichee/linux-3.4 - -# ==== Cross compile setting for Android 4.4 SDK ===== -CROSS_COMPILE := /home/android_sdk/Allwinner/a20/android-kitkat44/lichee/out/android/common/buildroot/external-toolchain/bin/arm-linux-gnueabi- -KVER := 3.4.39 -KSRC :=/home/android_sdk/Allwinner/a20/android-kitkat44/lichee/linux-3.4 - +#KSRC := /home/android_sdk/Allwinner/a20/android-jb43/lichee/linux-3.4 +# ==== Cross compile setting for kitkat-a20_v4.4 ===== +CROSS_COMPILE := /home/android_sdk/Allwinner/a20/kitkat-a20_v4.4/lichee/out/android/common/buildroot/external-toolchain/bin/arm-linux-gnueabi- +KSRC := /home/android_sdk/Allwinner/a20/kitkat-a20_v4.4/lichee/linux-3.4 endif ifeq ($(CONFIG_PLATFORM_ARM_SUN8I), y) @@ -1156,13 +1361,17 @@ _PLATFORM_FILES += platform/platform_ARM_SUNnI_sdio.o endif ARCH := arm -CROSS_COMPILE := /home/android_sdk/Allwinner/a23/android-jb42/lichee/out/android/common/buildroot/external-toolchain/bin/arm-linux-gnueabi- -KVER := 3.4.39 -KSRC :=/home/android_sdk/Allwinner/a23/android-jb42/lichee/linux-3.4 +# ===Cross compile setting for Android 4.2 SDK === +#CROSS_COMPILE := /home/android_sdk/Allwinner/a23/android-jb42/lichee/out/android/common/buildroot/external-toolchain/bin/arm-linux-gnueabi- +#KSRC :=/home/android_sdk/Allwinner/a23/android-jb42/lichee/linux-3.4 +# ===Cross compile setting for Android 4.4 SDK === +CROSS_COMPILE := /home/android_sdk/Allwinner/a23/android-kk44/lichee/out/android/common/buildroot/external-toolchain/bin/arm-linux-gnueabi- +KSRC :=/home/android_sdk/Allwinner/a23/android-kk44/lichee/linux-3.4 endif ifeq ($(CONFIG_PLATFORM_ACTIONS_ATV5201), y) EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ACTIONS_ATV5201 +EXTRA_CFLAGS += -DCONFIG_SDIO_DISABLE_RXFIFO_POLLING_LOOP ARCH := mips CROSS_COMPILE := mipsel-linux-gnu- KVER := $(KERNEL_VER) @@ -1208,7 +1417,67 @@ _PLATFORM_FILES += platform/platform_sprd_sdio.o endif endif -ifeq ($(CONFIG_MULTIDRV), y) +ifeq ($(CONFIG_PLATFORM_ARM_WMT), y) +EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN +EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE +EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT +EXTRA_CFLAGS += -DCONFIG_PLATFORM_OPS +ifeq ($(CONFIG_SDIO_HCI), y) +_PLATFORM_FILES += platform/platform_ARM_WMT_sdio.o +endif +ARCH := arm +CROSS_COMPILE := /home/android_sdk/WonderMedia/wm8880-android4.4/toolchain/arm_201103_gcc4.5.2/mybin/arm_1103_le- +KSRC := /home/android_sdk/WonderMedia/wm8880-android4.4/kernel4.4/ +MODULE_NAME :=8189es_kk +endif + +ifeq ($(CONFIG_PLATFORM_RTK119X), y) +EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN +#EXTRA_CFLAGS += -DCONFIG_PLATFORM_ARM_SUN7I +EXTRA_CFLAGS += -DCONFIG_TRAFFIC_PROTECT +# default setting for Android 4.1, 4.2 +EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE +EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT +#EXTRA_CFLAGS += -DCONFIG_P2P_IPS -DCONFIG_QOS_OPTIMIZATION +EXTRA_CFLAGS += -DCONFIG_QOS_OPTIMIZATION + +#EXTRA_CFLAGS += -DCONFIG_#PLATFORM_OPS +ifeq ($(CONFIG_USB_HCI), y) +EXTRA_CFLAGS += -DCONFIG_USE_USB_BUFFER_ALLOC_TX +#_PLATFORM_FILES += platform/platform_ARM_SUNxI_usb.o +endif +ifeq ($(CONFIG_SDIO_HCI), y) +_PLATFORM_FILES += platform/platform_ARM_SUNnI_sdio.o +endif + +ARCH := arm + +# ==== Cross compile setting for Android 4.4 SDK ===== +#CROSS_COMPILE := arm-linux-gnueabihf- +KVER := 3.10.24 +#KSRC :=/home/android_sdk/Allwinner/a20/android-kitkat44/lichee/linux-3.4 +CROSS_COMPILE := /home/realtek/software_phoenix/phoenix/toolchain/usr/local/arm-2013.11/bin/arm-linux-gnueabihf- +KSRC := /home/realtek/software_phoenix/linux-kernel +MODULE_NAME := 8192eu + +endif + +ifeq ($(CONFIG_PLATFORM_NOVATEK_NT72668), y) +EXTRA_CFLAGS += -DCONFIG_PLATFORM_NOVATEK_NT72668 +EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN +EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE +EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT +EXTRA_CFLAGS += -DDCONFIG_P2P_IPS +EXTRA_CFLAGS += -DCONFIG_USE_USB_BUFFER_ALLOC_RX +EXTRA_CFLAGS += -DCONFIG_USE_USB_BUFFER_ALLOC_TX +ARCH ?= arm +CROSS_COMPILE := arm-linux-gnueabihf- +KVER := 3.8.0 +KSRC := /Custom/Novatek/TCL/linux-3.8_header +#KSRC := $(KERNELDIR) +endif + +ifeq ($(CONFIG_MULTIDRV), y) ifeq ($(CONFIG_SDIO_HCI), y) MODULE_NAME := rtw_sdio @@ -1225,6 +1494,7 @@ endif endif +USER_MODULE_NAME ?= ifneq ($(USER_MODULE_NAME),) MODULE_NAME := $(USER_MODULE_NAME) endif @@ -1264,7 +1534,7 @@ $(MODULE_NAME)-$(CONFIG_INTEL_WIDI) += core/rtw_intel_widi.o $(MODULE_NAME)-$(CONFIG_WAPI_SUPPORT) += core/rtw_wapi.o \ core/rtw_wapi_sms4.o - + $(MODULE_NAME)-y += $(_OS_INTFS_FILES) $(MODULE_NAME)-y += $(_HAL_INTFS_FILES) $(MODULE_NAME)-y += $(_OUTSRC_FILES) @@ -1283,11 +1553,11 @@ ifeq ($(CONFIG_RTL8821A), y) $(MODULE_NAME)-$(CONFIG_MP_INCLUDED)+= core/rtw_bt_mp.o endif -obj-$(CONFIG_RTL8812AU) := $(MODULE_NAME).o +obj-$(CONFIG_RTL8821AU) := $(MODULE_NAME).o else -export CONFIG_RTL8812AU = m +export CONFIG_RTL8821AU = m all: modules @@ -1314,7 +1584,7 @@ config_r: clean: cd hal/OUTSRC/ ; rm -fr */*.mod.c */*.mod */*.o */.*.cmd */*.ko - cd hal/OUTSRC/ ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko + cd hal/OUTSRC/ ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko cd hal/led ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko cd hal ; rm -fr */*/*.mod.c */*/*.mod */*/*.o */*/.*.cmd */*/*.ko cd hal ; rm -fr */*.mod.c */*.mod */*.o */.*.cmd */*.ko diff --git a/backports/drivers/realtek/rtl8812au/core/efuse/rtw_efuse.c b/backports/drivers/realtek/rtl8812au/core/efuse/rtw_efuse.c index 5654d90154bb6d..63e3d51096217c 100755 --- a/backports/drivers/realtek/rtl8812au/core/efuse/rtw_efuse.c +++ b/backports/drivers/realtek/rtl8812au/core/efuse/rtw_efuse.c @@ -22,6 +22,7 @@ #include #include +#include "../hal/efuse/efuse_mask.h" /*------------------------Define local variable------------------------------*/ u8 fakeEfuseBank=0; @@ -39,6 +40,8 @@ u32 fakeBTEfuseUsedBytes=0; u8 fakeBTEfuseContent[EFUSE_MAX_BT_BANK][EFUSE_MAX_HW_SIZE]; u8 fakeBTEfuseInitMap[EFUSE_BT_MAX_MAP_LEN]={0}; u8 fakeBTEfuseModifiedMap[EFUSE_BT_MAX_MAP_LEN]={0}; + +u8 maskfileBuffer[32]; /*------------------------Define local variable------------------------------*/ //------------------------------------------------------------------------------ @@ -430,10 +433,11 @@ efuse_OneByteRead( IN u8 *data, IN BOOLEAN bPseudoTest) { - u8 tmpidx = 0; + u32 tmpidx = 0; u8 bResult; u8 readbyte; - + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); + //DBG_871X("===> EFUSE_OneByteRead(), addr = %x\n", addr); //DBG_871X("===> EFUSE_OneByteRead() start, 0x34 = 0x%X\n", rtw_read32(pAdapter, EFUSE_TEST)); @@ -442,9 +446,12 @@ efuse_OneByteRead( bResult = Efuse_Read1ByteFromFakeContent(pAdapter, addr, data); return bResult; } - + if( IS_HARDWARE_TYPE_8723B(pAdapter) || - (IS_HARDWARE_TYPE_8192E(pAdapter) && IS_VENDOR_8192E_B_CUT(pAdapter))) + (IS_HARDWARE_TYPE_8192E(pAdapter) && (!IS_A_CUT(pHalData->VersionID))) || + //(IS_HARDWARE_TYPE_8188E(pAdapter) && ((IS_I_CUT(pHalData->VersionID)) || (IS_J_CUT(pHalData->VersionID)))) + (IS_VENDOR_8188E_I_CUT_SERIES(pAdapter)) + ) { // <20130121, Kordan> For SMIC EFUSE specificatoin. //0x34[11]: SW force PGMEN input of efuse to high. (for the bank selected by 0x34[9:8]) @@ -495,7 +502,8 @@ efuse_OneByteWrite( u8 tmpidx = 0; u8 bResult=_FALSE; u32 efuseValue = 0; - + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); + //DBG_871X("===> EFUSE_OneByteWrite(), addr = %x data=%x\n", addr, data); //DBG_871X("===> EFUSE_OneByteWrite() start, 0x34 = 0x%X\n", rtw_read32(pAdapter, EFUSE_TEST)); @@ -517,7 +525,11 @@ efuse_OneByteWrite( // <20130227, Kordan> 8192E MP chip A-cut had better not set 0x34[11] until B-Cut. - if (IS_HARDWARE_TYPE_8723B(pAdapter)||(IS_HARDWARE_TYPE_8192E(pAdapter) && IS_VENDOR_8192E_B_CUT(pAdapter))) + if ( IS_HARDWARE_TYPE_8723B(pAdapter) || + (IS_HARDWARE_TYPE_8192E(pAdapter) && (!IS_A_CUT(pHalData->VersionID))) || + //(IS_HARDWARE_TYPE_8188E(pAdapter) && ((IS_I_CUT(pHalData->VersionID)) || (IS_J_CUT(pHalData->VersionID)))) + (IS_VENDOR_8188E_I_CUT_SERIES(pAdapter)) + ) { // <20130121, Kordan> For SMIC EFUSE specificatoin. //0x34[11]: SW force PGMEN input of efuse to high. (for the bank selected by 0x34[9:8]) @@ -548,7 +560,11 @@ efuse_OneByteWrite( } // disable Efuse program enable - if (IS_HARDWARE_TYPE_8723B(pAdapter)) + if ( IS_HARDWARE_TYPE_8723B(pAdapter) || + (IS_HARDWARE_TYPE_8192E(pAdapter) && (!IS_A_CUT(pHalData->VersionID))) || + //(IS_HARDWARE_TYPE_8188E(pAdapter) && ((IS_I_CUT(pHalData->VersionID)) || (IS_J_CUT(pHalData->VersionID)))) + (IS_VENDOR_8188E_I_CUT_SERIES(pAdapter)) + ) { PHY_SetMacReg(pAdapter, EFUSE_TEST, BIT(11), 0); } @@ -759,6 +775,148 @@ u8 rtw_BT_efuse_map_read(PADAPTER padapter, u16 addr, u16 cnts, u8 *data) return _SUCCESS; } + +BOOLEAN rtw_file_efuse_IsMasked( + PADAPTER pAdapter, + u16 Offset + ) +{ + int r = Offset/16; + int c = (Offset%16) / 2; + int result = 0; + + if(pAdapter->registrypriv.boffefusemask) + return FALSE; + + //DBG_871X(" %s ,Offset=%x r= %d , c=%d , maskfileBuffer[r]= %x \n",__func__,Offset,r,c,maskfileBuffer[r]); + if (c < 4) // Upper double word + result = (maskfileBuffer[r] & (0x10 << c)); + else + result = (maskfileBuffer[r] & (0x01 << (c-4))); + + return (result > 0) ? 0 : 1; + +} + + +u8 rtw_efuse_file_read(PADAPTER padapter,u8 *filepatch,u8 *buf,u32 len) +{ + char *ptmp; + char *ptmpbuf=NULL; + u32 rtStatus; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); + + ptmpbuf = rtw_zmalloc(2048); + + if (ptmpbuf == NULL) + return _FALSE; + + _rtw_memset(ptmpbuf,'\0',2048); + + rtStatus = rtw_retrive_from_file(filepatch, ptmpbuf, 2048); + + if( rtStatus > 100 ) + { + u32 i,j; + for(i=0,j=0;jregistrypriv.boffefusemask) + return FALSE; + +#if DEV_BUS_TYPE == RT_USB_INTERFACE +#if defined(CONFIG_RTL8188E) + if (IS_HARDWARE_TYPE_8188E(pAdapter)) + return (IS_MASKED(8188E,_MUSB,Offset)) ? TRUE : FALSE; +#endif +#if defined(CONFIG_RTL8812A) + if (IS_HARDWARE_TYPE_8812(pAdapter)) + return (IS_MASKED(8812A,_MUSB,Offset)) ? TRUE : FALSE; +#endif +#if defined(CONFIG_RTL8821A) + //if (IS_HARDWARE_TYPE_8811AU(pAdapter)) + // return (IS_MASKED(8811A,_MUSB,Offset)) ? TRUE : FALSE; + if (IS_HARDWARE_TYPE_8821(pAdapter)) + return (IS_MASKED(8821A,_MUSB,Offset)) ? TRUE : FALSE; +#endif +#if defined(CONFIG_RTL8192E) + if (IS_HARDWARE_TYPE_8192E(pAdapter)) + return (IS_MASKED(8192E,_MUSB,Offset)) ? TRUE : FALSE; +#endif +#if defined(CONFIG_RTL8723B) + if (IS_HARDWARE_TYPE_8723B(pAdapter)) + return (IS_MASKED(8723B,_MUSB,Offset)) ? TRUE : FALSE; +#endif + //else if (IS_HARDWARE_TYPE_8814A(pAdapter)) + // return (IS_MASKED(8814A,_MUSB,Offset)) ? TRUE : FALSE; +#elif DEV_BUS_TYPE == RT_PCI_INTERFACE +#if defined(CONFIG_RTL8188E) + if (IS_HARDWARE_TYPE_8188E(pAdapter)) + return (IS_MASKED(8188E,_MPCIE,Offset)) ? TRUE : FALSE; +#endif +#if defined(CONFIG_RTL8192E) + if (IS_HARDWARE_TYPE_8192E(pAdapter)) + return (IS_MASKED(8192E,_MPCIE,Offset)) ? TRUE : FALSE; +#endif +#if defined(CONFIG_RTL8812A) + if (IS_HARDWARE_TYPE_8812(pAdapter)) + return (IS_MASKED(8812A,_MPCIE,Offset)) ? TRUE : FALSE; +#endif +#if defined(CONFIG_RTL8821A) + if (IS_HARDWARE_TYPE_8821(pAdapter)) + return (IS_MASKED(8821A,_MPCIE,Offset)) ? TRUE : FALSE; +#endif +#if defined(CONFIG_RTL8723B) + if (IS_HARDWARE_TYPE_8723B(pAdapter)) + return (IS_MASKED(8723B,_MPCIE,Offset)) ? TRUE : FALSE; +#endif + //else if (IS_HARDWARE_TYPE_8814A(pAdapter)) + // return (IS_MASKED(8814A,_MPCIE,Offset)) ? TRUE : FALSE; + //else if (IS_HARDWARE_TYPE_8821B(pAdapter)) + // return (IS_MASKED(8821B,_MPCIE,Offset)) ? TRUE : FALSE; +#elif DEV_BUS_TYPE == RT_SDIO_INTERFACE +#ifdef CONFIG_RTL8188E_SDIO + if (IS_HARDWARE_TYPE_8188E(pAdapter)) + return (IS_MASKED(8188E,_MSDIO,Offset)) ? TRUE : FALSE; +#endif +#endif + + return FALSE; +} + //------------------------------------------------------------------------------ u8 rtw_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data) { @@ -775,6 +933,8 @@ u8 rtw_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data) s32 i, j, idx; u8 ret = _SUCCESS; u16 mapLen=0; + EEPROM_EFUSE_PRIV *pEEPROM = GET_EEPROM_EFUSE_PRIV(padapter); + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_EFUSE_MAP_LEN, (PVOID)&mapLen, _FALSE); @@ -794,6 +954,24 @@ u8 rtw_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data) ret = rtw_efuse_map_read(padapter, 0, mapLen, map); if (ret == _FAIL) goto exit; + if(padapter->registrypriv.boffefusemask==0) + { + for (i =0; i < cnts; i++) + { + if(padapter->registrypriv.bFileMaskEfuse==_TRUE) + { + if ( rtw_file_efuse_IsMasked(padapter, addr+i )) //use file efuse mask. + data[i] = map[addr+i]; + } + else + { + //DBG_8192C(" %s , Default Efuse Mask check \n",__func__); + if ( efuse_IsMasked(padapter, addr+i )) + data[i] = map[addr+i]; + } + DBG_8192C(" %s , data[%d] = %x ,map[addr+i]= %x \n",__func__,i,data[i],map[addr+i]); + } + } Efuse_PowerSwitch(padapter, _TRUE, _TRUE); idx = 0; @@ -809,6 +987,19 @@ u8 rtw_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data) { word_en &= ~BIT(i >> 1); newdata[i] = data[idx]; +#ifdef CONFIG_RTL8723B + if( addr + idx == 0x8) + { + if (IS_C_CUT(pHalData->VersionID) || IS_B_CUT(pHalData->VersionID)) + { + if(pEEPROM->adjuseVoltageVal == 6) + { + newdata[i] = map[addr + idx]; + DBG_8192C(" %s ,\n adjuseVoltageVal = %d ,newdata[%d] = %x \n",__func__,pEEPROM->adjuseVoltageVal,i,newdata[i]); + } + } + } +#endif } } diff --git a/backports/drivers/realtek/rtl8812au/core/rtw_ap.c b/backports/drivers/realtek/rtl8812au/core/rtw_ap.c index a2742413d9ef66..3bf2299a98f9f5 100755 --- a/backports/drivers/realtek/rtl8812au/core/rtw_ap.c +++ b/backports/drivers/realtek/rtl8812au/core/rtw_ap.c @@ -71,9 +71,9 @@ void free_mlme_ap_info(_adapter *padapter) //free bc/mc sta_info psta = rtw_get_bcmc_stainfo(padapter); - _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); + //_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); rtw_free_stainfo(padapter, psta); - _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); + //_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); _rtw_spinlock_free(&pmlmepriv->bcn_update_lock); @@ -249,6 +249,9 @@ void rtw_add_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index, u8 *d dst_ie = (p+ielen); } + if(dst_ie == NULL) + return; + if(remainder_ielen>0) { pbackup_remainder_ie = rtw_malloc(remainder_ielen); @@ -379,7 +382,8 @@ void expire_timeout_chk(_adapter *padapter) while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { psta = LIST_CONTAINOR(plist, struct sta_info, auth_list); - plist = get_next(plist); + + plist = get_next(plist); #ifdef CONFIG_ATMEL_RC_PATCH @@ -401,9 +405,9 @@ void expire_timeout_chk(_adapter *padapter) _exit_critical_bh(&pstapriv->auth_list_lock, &irqL); - _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); + //_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); rtw_free_stainfo(padapter, psta); - _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); + //_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); _enter_critical_bh(&pstapriv->auth_list_lock, &irqL); } @@ -530,8 +534,8 @@ void expire_timeout_chk(_adapter *padapter) //add_ba_hdl(padapter, (u8*)paddbareq_parm); DBG_871X("issue addba_req to check if sta alive, keep_alive_trycnt=%d\n", psta->keep_alive_trycnt); - - issue_action_BA(padapter, psta->hwaddr, RTW_WLAN_ACTION_ADDBA_REQ, (u16)priority); + + issue_addba_req(padapter, psta->hwaddr, (u8)priority); _set_timer(&psta->addba_retry_timer, ADDBA_TO); @@ -873,8 +877,6 @@ void update_bmc_sta(_adapter *padapter) if(psta) { psta->aid = 0;//default set to 0 - //psta->mac_id = psta->aid+4; - psta->mac_id = psta->aid + 1;//mac_id=1 for bc/mc stainfo pmlmeinfo->FW_sta_info[psta->mac_id].psta = psta; @@ -958,6 +960,7 @@ void update_sta_info_apmode(_adapter *padapter, struct sta_info *psta) struct ht_priv *phtpriv_ap = &pmlmepriv->htpriv; struct ht_priv *phtpriv_sta = &psta->htpriv; #endif //CONFIG_80211N_HT + u8 cur_ldpc_cap=0, cur_stbc_cap=0, cur_beamform_cap=0; //set intf_tag to if1 //psta->intf_tag = 0; @@ -987,29 +990,77 @@ void update_sta_info_apmode(_adapter *padapter, struct sta_info *psta) //check if sta supports rx ampdu phtpriv_sta->ampdu_enable = phtpriv_ap->ampdu_enable; - //check if sta support s Short GI 20M + phtpriv_sta->rx_ampdu_min_spacing = (phtpriv_sta->ht_cap.ampdu_params_info&IEEE80211_HT_CAP_AMPDU_DENSITY)>>2; + + // bwmode + if((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info) & cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH)) + { + psta->bw_mode = CHANNEL_WIDTH_40; + } + else + { + psta->bw_mode = CHANNEL_WIDTH_20; + } + + if(pmlmeext->cur_bwmode < psta->bw_mode) + { + psta->bw_mode = pmlmeext->cur_bwmode; + } + + phtpriv_sta->ch_offset = pmlmeext->cur_ch_offset; + + + //check if sta support s Short GI 20M if((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info) & cpu_to_le16(IEEE80211_HT_CAP_SGI_20)) { phtpriv_sta->sgi_20m = _TRUE; } - //check if sta support s Short GI 40M + + //check if sta support s Short GI 40M if((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info) & cpu_to_le16(IEEE80211_HT_CAP_SGI_40)) { - phtpriv_sta->sgi_40m = _TRUE; + if(psta->bw_mode == CHANNEL_WIDTH_40) //according to psta->bw_mode + phtpriv_sta->sgi_40m = _TRUE; + else + phtpriv_sta->sgi_40m = _FALSE; } - // bwmode - if((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info) & cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH)) + psta->qos_option = _TRUE; + + // B0 Config LDPC Coding Capability + if (TEST_FLAG(phtpriv_ap->ldpc_cap, LDPC_HT_ENABLE_TX) && + GET_HT_CAP_ELE_LDPC_CAP((u8 *)(&phtpriv_sta->ht_cap))) { - phtpriv_sta->ch_offset = pmlmeext->cur_ch_offset; - psta->bw_mode = CHANNEL_WIDTH_40; + SET_FLAG(cur_ldpc_cap, (LDPC_HT_ENABLE_TX | LDPC_HT_CAP_TX)); + DBG_871X("Enable HT Tx LDPC for STA(%d)\n",psta->aid); } - else + + // B7 B8 B9 Config STBC setting + if (TEST_FLAG(phtpriv_ap->stbc_cap, STBC_HT_ENABLE_TX) && + GET_HT_CAP_ELE_RX_STBC((u8 *)(&phtpriv_sta->ht_cap))) { - psta->bw_mode = CHANNEL_WIDTH_20; + SET_FLAG(cur_stbc_cap, (STBC_HT_ENABLE_TX | STBC_HT_CAP_TX) ); + DBG_871X("Enable HT Tx STBC for STA(%d)\n",psta->aid); } - psta->qos_option = _TRUE; +#ifdef CONFIG_BEAMFORMING + // Config Tx beamforming setting + if (TEST_FLAG(phtpriv_ap->beamform_cap, BEAMFORMING_HT_BEAMFORMEE_ENABLE) && + GET_HT_CAP_TXBF_EXPLICIT_COMP_STEERING_CAP((u8 *)(&phtpriv_sta->ht_cap))) + { + SET_FLAG(cur_beamform_cap, BEAMFORMING_HT_BEAMFORMER_ENABLE); + } + + if (TEST_FLAG(phtpriv_ap->beamform_cap, BEAMFORMING_HT_BEAMFORMER_ENABLE) && + GET_HT_CAP_TXBF_EXPLICIT_COMP_FEEDBACK_CAP((u8 *)(&phtpriv_sta->ht_cap))) + { + SET_FLAG(cur_beamform_cap, BEAMFORMING_HT_BEAMFORMEE_ENABLE); + } + + if (cur_beamform_cap) { + DBG_871X("Client STA(%d) HT Beamforming Cap = 0x%02X\n", psta->aid, cur_beamform_cap); + } +#endif //CONFIG_BEAMFORMING } else { @@ -1021,6 +1072,10 @@ void update_sta_info_apmode(_adapter *padapter, struct sta_info *psta) phtpriv_sta->ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; } + phtpriv_sta->ldpc_cap = cur_ldpc_cap; + phtpriv_sta->stbc_cap = cur_stbc_cap; + phtpriv_sta->beamform_cap = cur_beamform_cap; + //Rx AMPDU send_delba(padapter, 0, psta->hwaddr);// recipient @@ -1034,6 +1089,8 @@ void update_sta_info_apmode(_adapter *padapter, struct sta_info *psta) update_sta_vht_info_apmode(padapter, psta); #endif + update_ldpc_stbc_cap(psta); + //todo: init other variables _rtw_memset((void*)&psta->sta_stats, 0, sizeof(struct stainfo_stats)); @@ -1071,7 +1128,7 @@ static void update_ap_info(_adapter *padapter, struct sta_info *psta) if(phtpriv_ap->ht_option) { //check if sta supports rx ampdu - phtpriv_ap->ampdu_enable = phtpriv_ap->ampdu_enable; + //phtpriv_ap->ampdu_enable = phtpriv_ap->ampdu_enable; //check if sta support s Short GI 20M if((phtpriv_ap->ht_cap.cap_info) & cpu_to_le16(IEEE80211_HT_CAP_SGI_20)) @@ -1674,18 +1731,46 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) if(p && ie_len>0) { u8 rf_type=0; - u8 max_rx_ampdu_factor=0; + HT_CAP_AMPDU_FACTOR max_rx_ampdu_factor=MAX_AMPDU_FACTOR_64K; struct rtw_ieee80211_ht_cap *pht_cap = (struct rtw_ieee80211_ht_cap *)(p+2); + if (0) { + DBG_871X(FUNC_ADPT_FMT" HT_CAP_IE from upper layer:\n", FUNC_ADPT_ARG(padapter)); + dump_ht_cap_ie_content(RTW_DBGDUMP, p+2, ie_len); + } + pHT_caps_ie=p; - - + ht_cap = _TRUE; network_type |= WIRELESS_11_24N; - + rtw_ht_use_default_setting(padapter); + + /* Update HT Capabilities Info field */ + if (pmlmepriv->htpriv.sgi_20m == _FALSE) + pht_cap->cap_info &= ~(IEEE80211_HT_CAP_SGI_20); + + if (pmlmepriv->htpriv.sgi_40m == _FALSE) + pht_cap->cap_info &= ~(IEEE80211_HT_CAP_SGI_40); + + if (!TEST_FLAG(pmlmepriv->htpriv.ldpc_cap, LDPC_HT_ENABLE_RX)) + { + pht_cap->cap_info &= ~(IEEE80211_HT_CAP_LDPC_CODING); + } + + if (!TEST_FLAG(pmlmepriv->htpriv.stbc_cap, STBC_HT_ENABLE_TX)) + { + pht_cap->cap_info &= ~(IEEE80211_HT_CAP_TX_STBC); + } + + if (!TEST_FLAG(pmlmepriv->htpriv.stbc_cap, STBC_HT_ENABLE_RX)) + { + pht_cap->cap_info &= ~(IEEE80211_HT_CAP_RX_STBC_3R); + } + + /* Update A-MPDU Parameters field */ pht_cap->ampdu_params_info &= ~(IEEE80211_HT_CAP_AMPDU_FACTOR|IEEE80211_HT_CAP_AMPDU_DENSITY); - + if((psecuritypriv->wpa_pairwise_cipher & WPA_CIPHER_CCMP) || (psecuritypriv->wpa2_pairwise_cipher & WPA_CIPHER_CCMP)) { @@ -1699,15 +1784,59 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) rtw_hal_get_def_var(padapter, HW_VAR_MAX_RX_AMPDU_FACTOR, &max_rx_ampdu_factor); pht_cap->ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_FACTOR & max_rx_ampdu_factor); //set Max Rx AMPDU size to 64K - rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type)); - if(rf_type == RF_1T1R) - { - pht_cap->supp_mcs_set[0] = 0xff; - pht_cap->supp_mcs_set[1] = 0x0; + /* Update Supported MCS Set field */ + { + int i; + + rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type)); + + /* RX MCS Bitmask */ + switch(rf_type) + { + case RF_1T1R: + case RF_1T2R: //? + set_mcs_rate_by_mask(HT_CAP_ELE_RX_MCS_MAP(pht_cap), MCS_RATE_1R); + break; + case RF_2T2R: + default: + set_mcs_rate_by_mask(HT_CAP_ELE_RX_MCS_MAP(pht_cap), MCS_RATE_2R); + } + for (i = 0; i < 10; i++) + *(HT_CAP_ELE_RX_MCS_MAP(pht_cap)+i) &= padapter->mlmeextpriv.default_supported_mcs_set[i]; } - _rtw_memcpy(&pmlmepriv->htpriv.ht_cap, p+2, ie_len); - +#ifdef CONFIG_BEAMFORMING + // Use registry value to enable HT Beamforming. + // ToDo: use configure file to set these capability. + pht_cap->tx_BF_cap_info = 0; + + // HT Beamformer + if(TEST_FLAG(pmlmepriv->htpriv.beamform_cap, BEAMFORMING_HT_BEAMFORMER_ENABLE)) + { + // Transmit NDP Capable + SET_HT_CAP_TXBF_TRANSMIT_NDP_CAP(pht_cap, 1); + // Explicit Compressed Steering Capable + SET_HT_CAP_TXBF_EXPLICIT_COMP_STEERING_CAP(pht_cap, 1); + // Compressed Steering Number Antennas + SET_HT_CAP_TXBF_COMP_STEERING_NUM_ANTENNAS(pht_cap, 1); + } + + // HT Beamformee + if(TEST_FLAG(pmlmepriv->htpriv.beamform_cap, BEAMFORMING_HT_BEAMFORMEE_ENABLE)) + { + // Receive NDP Capable + SET_HT_CAP_TXBF_RECEIVE_NDP_CAP(pht_cap, 1); + // Explicit Compressed Beamforming Feedback Capable + SET_HT_CAP_TXBF_EXPLICIT_COMP_FEEDBACK_CAP(pht_cap, 2); + } +#endif //CONFIG_BEAMFORMING + + _rtw_memcpy(&pmlmepriv->htpriv.ht_cap, p+2, ie_len); + + if (0) { + DBG_871X(FUNC_ADPT_FMT" HT_CAP_IE driver masked:\n", FUNC_ADPT_ARG(padapter)); + dump_ht_cap_ie_content(RTW_DBGDUMP, p+2, ie_len); + } } //parsing HT_INFO_IE @@ -2045,11 +2174,10 @@ static int rtw_ap_set_key(_adapter *padapter, u8 *key, u8 alg, int keyid, u8 set keylen = 13; break; case _TKIP_: - case _TKIP_WTMIC_: + case _TKIP_WTMIC_: case _AES_: - keylen = 16; default: - keylen = 16; + keylen = 16; } _rtw_memcpy(&(psetkeyparm->key[0]), key, keylen); @@ -2271,7 +2399,7 @@ static void update_bcn_vendor_spec_ie(_adapter *padapter, u8*oui) } -void update_beacon(_adapter *padapter, u8 ie_id, u8 *oui, u8 tx) +void _update_beacon(_adapter *padapter, u8 ie_id, u8 *oui, u8 tx, const char *tag) { _irqL irqL; struct mlme_priv *pmlmepriv; @@ -2349,6 +2477,8 @@ void update_beacon(_adapter *padapter, u8 ie_id, u8 *oui, u8 tx) if(tx) { //send_beacon(padapter);//send_beacon must execute on TSR level + if (0) + DBG_871X(FUNC_ADPT_FMT" ie_id:%u - %s\n", FUNC_ADPT_ARG(padapter), ie_id, tag); set_tx_beacon_cmd(padapter); } #else @@ -2787,6 +2917,10 @@ u8 ap_free_sta(_adapter *padapter, struct sta_info *psta, bool active, u16 reaso issue_deauth(padapter, psta->hwaddr, reason); } +#ifdef CONFIG_BEAMFORMING + beamforming_wk_cmd(padapter, BEAMFORMING_CTRL_LEAVE, psta->hwaddr, ETH_ALEN, 1); +#endif + psta->htpriv.agg_enable_bitmap = 0x0;//reset psta->htpriv.candidate_tid_bitmap = 0x0;//reset @@ -2794,8 +2928,7 @@ u8 ap_free_sta(_adapter *padapter, struct sta_info *psta, bool active, u16 reaso //report_del_sta_event(padapter, psta->hwaddr, reason); //clear cam entry / key - //clear_cam_entry(padapter, (psta->mac_id + 3)); - rtw_clearstakey_cmd(padapter, (u8*)psta, (u8)rtw_get_camid(psta->mac_id), _TRUE); + rtw_clearstakey_cmd(padapter, psta, _TRUE); _enter_critical_bh(&psta->lock, &irqL); @@ -2821,9 +2954,9 @@ u8 ap_free_sta(_adapter *padapter, struct sta_info *psta, bool active, u16 reaso beacon_updated = bss_cap_update_on_sta_leave(padapter, psta); - _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); + //_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); rtw_free_stainfo(padapter, psta); - _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); + //_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); return beacon_updated; @@ -2878,12 +3011,10 @@ int rtw_sta_flush(_adapter *padapter) struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); u8 bc_addr[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff}; - DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(padapter->pnetdev)); - if((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE) return ret; - + DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(padapter->pnetdev)); _enter_critical_bh(&pstapriv->asoc_list_lock, &irqL); phead = &pstapriv->asoc_list; plist = get_next(phead); @@ -3034,13 +3165,14 @@ void rtw_ap_restore_network(_adapter *padapter) if (psta == NULL) { DBG_871X(FUNC_ADPT_FMT" sta_info is null\n", FUNC_ADPT_ARG(padapter)); } else if (psta->state &_FW_LINKED) { + rtw_sta_media_status_rpt(padapter, psta, 1); Update_RA_Entry(padapter, psta); //pairwise key /* per sta pairwise key and settings */ if( (padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_) || (padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)) { - rtw_setstakey_cmd(padapter, (unsigned char *)psta, _TRUE,_FALSE); + rtw_setstakey_cmd(padapter, psta, UNICAST_KEY,_FALSE); } } } @@ -3053,6 +3185,7 @@ void start_ap_mode(_adapter *padapter) struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct sta_priv *pstapriv = &padapter->stapriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); struct wlan_acl_pool *pacl_list = &pstapriv->acl_list; pmlmepriv->update_bcn = _FALSE; @@ -3070,10 +3203,12 @@ void start_ap_mode(_adapter *padapter) #ifdef CONFIG_80211N_HT pmlmepriv->num_sta_no_ht = 0; #endif //CONFIG_80211N_HT + pmlmeinfo->HT_info_enable =0; + pmlmeinfo->HT_caps_enable=0; + pmlmeinfo->HT_enable=0; + pmlmepriv->num_sta_ht_20mhz = 0; - pmlmepriv->olbc = _FALSE; - pmlmepriv->olbc_ht = _FALSE; #ifdef CONFIG_80211N_HT @@ -3083,13 +3218,14 @@ void start_ap_mode(_adapter *padapter) for(i=0; ista_aid[i] = NULL; +/* to avoid memory leak issue, don't set to NULL directly pmlmepriv->wps_beacon_ie = NULL; pmlmepriv->wps_probe_resp_ie = NULL; pmlmepriv->wps_assoc_resp_ie = NULL; pmlmepriv->p2p_beacon_ie = NULL; pmlmepriv->p2p_probe_resp_ie = NULL; - +*/ //for ACL _rtw_init_listhead(&(pacl_list->acl_node_q.queue)); @@ -3117,6 +3253,7 @@ void stop_ap_mode(_adapter *padapter) pmlmepriv->update_bcn = _FALSE; pmlmeext->bstart_bss = _FALSE; + padapter->netif_up = _FALSE; //_rtw_spinlock_free(&pmlmepriv->bcn_update_lock); //reset and init security priv , this can refine with rtw_reset_securitypriv @@ -3152,9 +3289,9 @@ void stop_ap_mode(_adapter *padapter) rtw_free_all_stainfo(padapter); psta = rtw_get_bcmc_stainfo(padapter); - _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); + //_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); rtw_free_stainfo(padapter, psta); - _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); + //_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); rtw_init_bcmc_stainfo(padapter); @@ -3195,15 +3332,15 @@ void concurrent_set_ap_chbw(_adapter *padapter, u8 channel, u8 channel_offset, u { set_channel_bwmode(padapter, cur_channel, cur_ch_offset, cur_bwmode); } - else if(check_buddy_fwstate(padapter, _FW_LINKED)==_TRUE)//only second adapter can enter AP Mode + else if(check_buddy_fwstate(padapter, _FW_LINKED)==_TRUE) { _adapter *pbuddy_adapter = padapter->pbuddy_adapter; struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv; - - //To sync cur_channel/cur_bwmode/cur_ch_offset with primary adapter - DBG_871X("primary iface is at linked state, sync cur_channel/cur_bwmode/cur_ch_offset\n"); - DBG_871X("primary adapter, CH=%d, BW=%d, offset=%d\n", pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_bwmode, pbuddy_mlmeext->cur_ch_offset); - DBG_871X("second adapter, CH=%d, BW=%d, offset=%d\n", cur_channel, cur_bwmode, cur_ch_offset); + + //To sync cur_channel/cur_bwmode/cur_ch_offset with buddy adapter + DBG_871X(ADPT_FMT" is at linked state\n", ADPT_ARG(pbuddy_adapter)); + DBG_871X(ADPT_FMT": CH=%d, BW=%d, offset=%d\n", ADPT_ARG(pbuddy_adapter), pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_bwmode, pbuddy_mlmeext->cur_ch_offset); + DBG_871X(ADPT_FMT": CH=%d, BW=%d, offset=%d\n", ADPT_ARG(padapter), cur_channel, cur_bwmode, cur_ch_offset); if((cur_channel <= 14 && pbuddy_mlmeext->cur_channel >= 36) || (cur_channel >= 36 && pbuddy_mlmeext->cur_channel <= 14)) @@ -3350,9 +3487,8 @@ void concurrent_set_ap_chbw(_adapter *padapter, u8 channel, u8 channel_offset, u } else - { - //follow buddy's ch/bw/ch_offset setting, needn't set ch_bw again. - //set_channel_bwmode(padapter, cur_channel, pbuddy_mlmeext->cur_ch_offset, pbuddy_mlmeext->cur_bwmode); + { + set_channel_bwmode(padapter, cur_channel, pbuddy_mlmeext->cur_ch_offset, pbuddy_mlmeext->cur_bwmode); } // to update channel value in beacon @@ -3365,7 +3501,7 @@ void concurrent_set_ap_chbw(_adapter *padapter, u8 channel, u8 channel_offset, u pht_info->primary_channel = cur_channel; } - DBG_871X("%s, CH=%d, BW=%d, offset=%d\n", __FUNCTION__, cur_channel, cur_bwmode, cur_ch_offset); + DBG_871X(FUNC_ADPT_FMT" CH=%d, BW=%d, offset=%d\n", FUNC_ADPT_ARG(padapter), cur_channel, cur_bwmode, cur_ch_offset); pmlmeext->cur_channel = cur_channel; pmlmeext->cur_bwmode = cur_bwmode; diff --git a/backports/drivers/realtek/rtl8812au/core/rtw_beamforming.c b/backports/drivers/realtek/rtl8812au/core/rtw_beamforming.c index 6486c8243ca5d8..8d8c614e7b82d1 100755 --- a/backports/drivers/realtek/rtl8812au/core/rtw_beamforming.c +++ b/backports/drivers/realtek/rtl8812au/core/rtw_beamforming.c @@ -20,6 +20,7 @@ #define _RTW_BEAMFORMING_C_ #include +#include #ifdef CONFIG_BEAMFORMING @@ -30,7 +31,7 @@ struct beamforming_entry *beamforming_get_entry_by_addr(struct mlme_priv *pmlmep for(i = 0; i < BEAMFORMING_ENTRY_NUM; i++) { - if( pBeamInfo->beamforming_entry[i].used && + if( pBeamInfo->beamforming_entry[i].bUsed && (_rtw_memcmp(ra,pBeamInfo->beamforming_entry[i].mac_addr, ETH_ALEN))) { *idx = i; @@ -41,6 +42,25 @@ struct beamforming_entry *beamforming_get_entry_by_addr(struct mlme_priv *pmlmep return NULL; } +BEAMFORMING_CAP beamforming_get_entry_beam_cap_by_mac_id(PVOID pmlmepriv ,u8 mac_id) +{ + u8 i = 0; + struct beamforming_info *pBeamInfo = GET_BEAMFORM_INFO((struct mlme_priv *)pmlmepriv); + BEAMFORMING_CAP BeamformEntryCap = BEAMFORMING_CAP_NONE; + + for(i = 0; i < BEAMFORMING_ENTRY_NUM; i++) + { + if( pBeamInfo->beamforming_entry[i].bUsed && + (mac_id == pBeamInfo->beamforming_entry[i].mac_id)) + { + BeamformEntryCap = pBeamInfo->beamforming_entry[i].beamforming_entry_cap; + i = BEAMFORMING_ENTRY_NUM; + } + } + + return BeamformEntryCap; +} + struct beamforming_entry *beamforming_get_free_entry(struct mlme_priv *pmlmepriv, u8* idx) { u8 i = 0; @@ -48,7 +68,7 @@ struct beamforming_entry *beamforming_get_free_entry(struct mlme_priv *pmlmepriv for(i = 0; i < BEAMFORMING_ENTRY_NUM; i++) { - if(pBeamInfo->beamforming_entry[i].used == _FALSE) + if(pBeamInfo->beamforming_entry[i].bUsed == _FALSE) { *idx = i; return &(pBeamInfo->beamforming_entry[i]); @@ -66,7 +86,7 @@ struct beamforming_entry *beamforming_add_entry(PADAPTER adapter, u8* ra, u16 ai if(pEntry != NULL) { - pEntry->used = _TRUE; + pEntry->bUsed = _TRUE; pEntry->aid = aid; pEntry->mac_id = mac_id; pEntry->sound_bw = bw; @@ -86,11 +106,18 @@ struct beamforming_entry *beamforming_add_entry(PADAPTER adapter, u8* ra, u16 ai pEntry->p_aid = (pEntry->p_aid << 1) | (ra[4] >> 7 ); } _rtw_memcpy(pEntry->mac_addr, ra, ETH_ALEN); - pEntry->tx_bf = _FALSE; - pEntry->sound_period = 6; + pEntry->bSound = _FALSE; + + //3 TODO SW/FW sound period + pEntry->sound_period = 200; pEntry->beamforming_entry_cap = beamfrom_cap; pEntry->beamforming_entry_state = BEAMFORMING_ENTRY_STATE_UNINITIALIZE; + pEntry->LogSeq = 0xff; + pEntry->LogRetryCnt = 0; + pEntry->LogSuccessCnt = 0; + pEntry->LogStatusFailCnt = 0; + return pEntry; } else @@ -103,7 +130,7 @@ BOOLEAN beamforming_remove_entry(struct mlme_priv *pmlmepriv, u8* ra, u8* idx) if(pEntry != NULL) { - pEntry->used = _FALSE; + pEntry->bUsed = _FALSE; pEntry->beamforming_entry_cap = BEAMFORMING_CAP_NONE; pEntry->beamforming_entry_state = BEAMFORMING_ENTRY_STATE_UNINITIALIZE; return _TRUE; @@ -112,22 +139,345 @@ BOOLEAN beamforming_remove_entry(struct mlme_priv *pmlmepriv, u8* ra, u8* idx) return _FALSE; } -/* Used for BeamformingStart_SW and BeamformingStart_FW */ +/* Used for BeamformingStart_V1 */ void beamforming_dym_ndpa_rate(PADAPTER adapter) { u16 NDPARate = MGN_6M; - /*PHAL_DATA_TYPE pHalData = GET_HAL_DATA(adapter); + PHAL_DATA_TYPE pHalData = GET_HAL_DATA(adapter); if(pHalData->dmpriv.MinUndecoratedPWDBForDM > 30) // link RSSI > 30% NDPARate = MGN_24M; else NDPARate = MGN_6M; -*/ + //BW = CHANNEL_WIDTH_20; NDPARate = NDPARate << 8; rtw_hal_set_hwreg(adapter, HW_VAR_SOUNDING_RATE, (u8 *)&NDPARate); } +void beamforming_dym_period(PADAPTER Adapter) +{ + u8 Idx; + BOOLEAN bChangePeriod = _FALSE; + u16 SoundPeriod_SW, SoundPeriod_FW; + PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter); + struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(Adapter); + struct beamforming_entry *pBeamformEntry; + struct beamforming_info *pBeamInfo = GET_BEAMFORM_INFO(( &Adapter->mlmepriv)); + struct sounding_info *pSoundInfo = &(pBeamInfo->sounding_info); + + //3 TODO per-client throughput caculation. + + if(pdvobjpriv->traffic_stat.cur_tx_tp + pdvobjpriv->traffic_stat.cur_rx_tp > 2) + { + SoundPeriod_SW = 32*20; + SoundPeriod_FW = 2; + } + else + { + SoundPeriod_SW = 32*2000; + SoundPeriod_FW = 200; + } + + for(Idx = 0; Idx < BEAMFORMING_ENTRY_NUM; Idx++) + { + pBeamformEntry = pBeamInfo->beamforming_entry+Idx; + if(pBeamformEntry->bDefaultCSI) + { + SoundPeriod_SW = 32*2000; + SoundPeriod_FW = 200; + } + + if(pBeamformEntry->beamforming_entry_cap & (BEAMFORMER_CAP_HT_EXPLICIT |BEAMFORMER_CAP_VHT_SU)) + { + if(pSoundInfo->sound_mode == SOUNDING_FW_VHT_TIMER || pSoundInfo->sound_mode == SOUNDING_FW_HT_TIMER) + { + if(pBeamformEntry->sound_period != SoundPeriod_FW) + { + pBeamformEntry->sound_period = SoundPeriod_FW; + bChangePeriod = _TRUE; // Only FW sounding need to send H2C packet to change sound period. + } + } + else if(pBeamformEntry->sound_period != SoundPeriod_SW) + { + pBeamformEntry->sound_period = SoundPeriod_SW; + } + } + } + + if(bChangePeriod) + rtw_hal_set_hwreg(Adapter, HW_VAR_SOUNDING_FW_NDPA, (u8 *)&Idx); +} + +u32 beamforming_get_report_frame(PADAPTER Adapter, union recv_frame *precv_frame) +{ + u32 ret = _SUCCESS; + struct beamforming_entry *pBeamformEntry = NULL; + struct mlme_priv *pmlmepriv = &(Adapter->mlmepriv); + u8 *pframe = precv_frame->u.hdr.rx_data; + u32 frame_len = precv_frame->u.hdr.len; + u8 *ta; + u8 idx, offset; + + //DBG_871X("beamforming_get_report_frame\n"); + + //Memory comparison to see if CSI report is the same with previous one + ta = GetAddr2Ptr(pframe); + pBeamformEntry = beamforming_get_entry_by_addr(pmlmepriv, ta, &idx); + if(pBeamformEntry->beamforming_entry_cap & BEAMFORMER_CAP_VHT_SU) + offset = 31; //24+(1+1+3)+2 MAC header+(Category+ActionCode+MIMOControlField)+SNR(Nc=2) + else if(pBeamformEntry->beamforming_entry_cap & BEAMFORMER_CAP_HT_EXPLICIT) + offset = 34; //24+(1+1+6)+2 MAC header+(Category+ActionCode+MIMOControlField)+SNR(Nc=2) + else + return ret; + + //DBG_871X("%s MacId %d offset=%d\n", __FUNCTION__, pBeamformEntry->mac_id, offset); + + if(_rtw_memcmp(pBeamformEntry->PreCsiReport + offset, pframe+offset, frame_len-offset) == _FALSE) + { + pBeamformEntry->DefaultCsiCnt = 0; + //DBG_871X("%s CSI report is NOT the same with previos one\n", __FUNCTION__); + } + else + { + pBeamformEntry->DefaultCsiCnt ++; + //DBG_871X("%s CSI report is the SAME with previos one\n", __FUNCTION__); + } + _rtw_memcpy(&pBeamformEntry->PreCsiReport, pframe, frame_len); + + pBeamformEntry->bDefaultCSI = _FALSE; + + if(pBeamformEntry->DefaultCsiCnt > 20) + pBeamformEntry->bDefaultCSI = _TRUE; + else + pBeamformEntry->bDefaultCSI = _FALSE; + + return ret; +} + +void beamforming_get_ndpa_frame(PADAPTER Adapter, union recv_frame *precv_frame) +{ + u8 *ta; + u8 idx, Sequence; + u8 *pframe = precv_frame->u.hdr.rx_data; + struct mlme_priv *pmlmepriv = &(Adapter->mlmepriv); + struct beamforming_entry *pBeamformEntry = NULL; + + //DBG_871X("beamforming_get_ndpa_frame\n"); + + if(IS_HARDWARE_TYPE_8812(Adapter) == _FALSE) + return; + else if(GetFrameSubType(pframe) != WIFI_NDPA) + return; + + ta = GetAddr2Ptr(pframe); + // Remove signaling TA. + ta[0] = ta[0] & 0xFE; + + pBeamformEntry = beamforming_get_entry_by_addr(pmlmepriv, ta, &idx); + + if(pBeamformEntry == NULL) + return; + else if(!(pBeamformEntry->beamforming_entry_cap & BEAMFORMEE_CAP_VHT_SU)) + return; + else if(pBeamformEntry->LogSuccessCnt > 1) + return; + + Sequence = (pframe[16]) >> 2; + + if(pBeamformEntry->LogSeq != Sequence) + { + /* Previous frame doesn't retry when meet new sequence number */ + if(pBeamformEntry->LogSeq != 0xff && pBeamformEntry->LogRetryCnt == 0) + pBeamformEntry->LogSuccessCnt++; + + pBeamformEntry->LogSeq = Sequence; + pBeamformEntry->LogRetryCnt = 0; + } + else + { + if(pBeamformEntry->LogRetryCnt == 3) + beamforming_wk_cmd(Adapter, BEAMFORMING_CTRL_SOUNDING_CLK, NULL, 0, 1); + + pBeamformEntry->LogRetryCnt++; + } + + DBG_871X("%s LogSeq %d LogRetryCnt %d LogSuccessCnt %d\n", + __FUNCTION__, pBeamformEntry->LogSeq, pBeamformEntry->LogRetryCnt, pBeamformEntry->LogSuccessCnt); +} + +BOOLEAN issue_ht_ndpa_packet(PADAPTER Adapter, u8 *ra, CHANNEL_WIDTH bw, u8 qidx) +{ + struct xmit_frame *pmgntframe; + struct pkt_attrib *pattrib; + struct rtw_ieee80211_hdr *pwlanhdr; + struct xmit_priv *pxmitpriv = &(Adapter->xmitpriv); + struct mlme_ext_priv *pmlmeext = &Adapter->mlmeextpriv; + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + u8 ActionHdr[4] = {ACT_CAT_VENDOR, 0x00, 0xe0, 0x4c}; + u8 *pframe; + u16 *fctrl; + u16 duration = 0; + u8 aSifsTime = 0; + + if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) + { + return _FALSE; + } + + //update attribute + pattrib = &pmgntframe->attrib; + update_mgntframe_attrib(Adapter, pattrib); + + if (qidx == BCN_QUEUE_INX) + pattrib->qsel = QSLT_BEACON; + pattrib->rate = MGN_MCS8; + pattrib->bwmode = bw; + pattrib->order = 1; + pattrib->subtype = WIFI_ACTION_NOACK; + + _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + + pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; + + pwlanhdr = (struct rtw_ieee80211_hdr*)pframe; + + fctrl = &pwlanhdr->frame_ctl; + *(fctrl) = 0; + + SetOrderBit(pframe); + SetFrameSubType(pframe, WIFI_ACTION_NOACK); + + _rtw_memcpy(pwlanhdr->addr1, ra, ETH_ALEN); + _rtw_memcpy(pwlanhdr->addr2, myid(&(Adapter->eeprompriv)), ETH_ALEN); + _rtw_memcpy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); + + if( pmlmeext->cur_wireless_mode == WIRELESS_11B) + aSifsTime = 10; + else + aSifsTime = 16; + + duration = 2*aSifsTime + 40; + + if(bw == CHANNEL_WIDTH_40) + duration+= 87; + else + duration+= 180; + + SetDuration(pframe, duration); + + //HT control field + SET_HT_CTRL_CSI_STEERING(pframe+24, 3); + SET_HT_CTRL_NDP_ANNOUNCEMENT(pframe+24, 1); + + _rtw_memcpy(pframe+28, ActionHdr, 4); + + pattrib->pktlen = 32; + + pattrib->last_txcmdsz = pattrib->pktlen; + + dump_mgntframe(Adapter, pmgntframe); + + return _TRUE; +} + +BOOLEAN beamforming_send_ht_ndpa_packet(PADAPTER Adapter, u8 *ra, CHANNEL_WIDTH bw, u8 qidx) +{ + return issue_ht_ndpa_packet(Adapter, ra, bw, qidx); +} + +BOOLEAN issue_vht_ndpa_packet(PADAPTER Adapter, u8 *ra, u16 aid, CHANNEL_WIDTH bw, u8 qidx) +{ + struct xmit_frame *pmgntframe; + struct pkt_attrib *pattrib; + struct rtw_ieee80211_hdr *pwlanhdr; + struct xmit_priv *pxmitpriv = &(Adapter->xmitpriv); + struct mlme_ext_priv *pmlmeext = &Adapter->mlmeextpriv; + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + struct mlme_priv *pmlmepriv = &(Adapter->mlmepriv); + struct beamforming_info *pBeamInfo = GET_BEAMFORM_INFO(pmlmepriv); + struct rtw_ndpa_sta_info sta_info; + u8 *pframe; + u16 *fctrl; + u16 duration = 0; + u8 sequence = 0, aSifsTime = 0; + + if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) + { + return _FALSE; + } + + //update attribute + pattrib = &pmgntframe->attrib; + update_mgntframe_attrib(Adapter, pattrib); + + if (qidx == BCN_QUEUE_INX) + pattrib->qsel = QSLT_BEACON; + pattrib->rate = MGN_VHT2SS_MCS0; + pattrib->bwmode = bw; + pattrib->subtype = WIFI_NDPA; + + _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + + pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; + + pwlanhdr = (struct rtw_ieee80211_hdr*)pframe; + + fctrl = &pwlanhdr->frame_ctl; + *(fctrl) = 0; + + SetFrameSubType(pframe, WIFI_NDPA); + + _rtw_memcpy(pwlanhdr->addr1, ra, ETH_ALEN); + _rtw_memcpy(pwlanhdr->addr2, myid(&(Adapter->eeprompriv)), ETH_ALEN); + + if (IsSupported5G(pmlmeext->cur_wireless_mode) || IsSupportedHT(pmlmeext->cur_wireless_mode)) + aSifsTime = 16; + else + aSifsTime = 10; + + duration = 2*aSifsTime + 44; + + if(bw == CHANNEL_WIDTH_80) + duration += 40; + else if(bw == CHANNEL_WIDTH_40) + duration+= 87; + else + duration+= 180; + + SetDuration(pframe, duration); + + sequence = pBeamInfo->sounding_sequence<< 2; + if (pBeamInfo->sounding_sequence >= 0x3f) + pBeamInfo->sounding_sequence = 0; + else + pBeamInfo->sounding_sequence++; + + _rtw_memcpy(pframe+16, &sequence,1); + + if(((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) || ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)) + aid = 0; + + sta_info.aid = aid; + sta_info.feedback_type = 0; + sta_info.nc_index= 0; + + _rtw_memcpy(pframe+17, (u8 *)&sta_info, 2); + + pattrib->pktlen = 19; + + pattrib->last_txcmdsz = pattrib->pktlen; + + dump_mgntframe(Adapter, pmgntframe); + + return _TRUE; +} + +BOOLEAN beamforming_send_vht_ndpa_packet(PADAPTER Adapter, u8 *ra, u16 aid, CHANNEL_WIDTH bw, u8 qidx) +{ + return issue_vht_ndpa_packet(Adapter, ra, aid, bw, qidx); +} + BOOLEAN beamfomring_bSounding(struct beamforming_info *pBeamInfo) { BOOLEAN bSounding = _FALSE; @@ -147,7 +497,8 @@ u8 beamforming_sounding_idx(struct beamforming_info *pBeamInfo) for(i = 0; i < BEAMFORMING_ENTRY_NUM; i++) { - if (pBeamInfo->beamforming_entry[i].used) + if (pBeamInfo->beamforming_entry[i].bUsed && + (_FALSE == pBeamInfo->beamforming_entry[i].bSound)) { idx = i; break; @@ -230,16 +581,16 @@ BOOLEAN beamforming_start_fw(PADAPTER adapter, u8 idx) struct beamforming_info *pBeamInfo = GET_BEAMFORM_INFO(pmlmepriv); pEntry = &(pBeamInfo->beamforming_entry[idx]); - if(pEntry->used == _FALSE) + if(pEntry->bUsed == _FALSE) { DBG_871X("Skip Beamforming, no entry for Idx =%d\n", idx); return _FALSE; } pEntry->beamforming_entry_state = BEAMFORMING_ENTRY_STATE_PROGRESSING; + pEntry->bSound = _TRUE; rtw_hal_set_hwreg(adapter, HW_VAR_SOUNDING_FW_NDPA, (u8 *)&idx); - - DBG_871X("%s Idx %d \n", __FUNCTION__, idx); + return _TRUE; } @@ -337,26 +688,6 @@ void beamforming_notify(PADAPTER adapter) DBG_871X("%s BeamformState %d bSounding %d\n", __FUNCTION__, pBeamInfo->beamforming_state, bSounding); } -void beamforming_reset(PADAPTER adapter) -{ - u8 idx = 0; - struct mlme_priv *pmlmepriv = &(adapter->mlmepriv); - struct beamforming_info *pBeamInfo = GET_BEAMFORM_INFO(pmlmepriv); - - for(idx = 0; idx < BEAMFORMING_ENTRY_NUM; idx++) - { - if(pBeamInfo->beamforming_entry[idx].used == _TRUE) - { - pBeamInfo->beamforming_entry[idx].used = _FALSE; - pBeamInfo->beamforming_entry[idx].beamforming_entry_cap = BEAMFORMING_CAP_NONE; - pBeamInfo->beamforming_entry[idx].beamforming_entry_state= BEAMFORMING_ENTRY_STATE_UNINITIALIZE; - rtw_hal_set_hwreg(adapter, HW_VAR_SOUNDING_LEAVE, (u8 *)&idx); - } - } - - DBG_871X("%s\n", __FUNCTION__); -} - BOOLEAN beamforming_init_entry(PADAPTER adapter, struct sta_info *psta, u8* idx) { struct mlme_priv *pmlmepriv = &(adapter->mlmepriv); @@ -462,6 +793,62 @@ void beamforming_deinit_entry(PADAPTER adapter, u8* ra) DBG_871X("%s Idx %d\n", __FUNCTION__, idx); } +void beamforming_reset(PADAPTER adapter) +{ + u8 idx = 0; + struct mlme_priv *pmlmepriv = &(adapter->mlmepriv); + struct beamforming_info *pBeamInfo = GET_BEAMFORM_INFO(pmlmepriv); + + for(idx = 0; idx < BEAMFORMING_ENTRY_NUM; idx++) + { + if(pBeamInfo->beamforming_entry[idx].bUsed == _TRUE) + { + pBeamInfo->beamforming_entry[idx].bUsed = _FALSE; + pBeamInfo->beamforming_entry[idx].beamforming_entry_cap = BEAMFORMING_CAP_NONE; + pBeamInfo->beamforming_entry[idx].beamforming_entry_state= BEAMFORMING_ENTRY_STATE_UNINITIALIZE; + rtw_hal_set_hwreg(adapter, HW_VAR_SOUNDING_LEAVE, (u8 *)&idx); + } + } + + DBG_871X("%s\n", __FUNCTION__); +} + +void beamforming_sounding_fail(PADAPTER Adapter) +{ + struct mlme_priv *pmlmepriv = &(Adapter->mlmepriv); + struct beamforming_info *pBeamInfo = GET_BEAMFORM_INFO(pmlmepriv); + struct beamforming_entry *pEntry = &(pBeamInfo->beamforming_entry[pBeamInfo->beamforming_cur_idx]); + + pEntry->bSound = _FALSE; + rtw_hal_set_hwreg(Adapter, HW_VAR_SOUNDING_FW_NDPA, (u8 *)&pBeamInfo->beamforming_cur_idx); + beamforming_deinit_entry(Adapter, pEntry->mac_addr); +} + +void beamforming_check_sounding_success(PADAPTER Adapter,BOOLEAN status) +{ + struct mlme_priv *pmlmepriv = &(Adapter->mlmepriv); + struct beamforming_info *pBeamInfo = GET_BEAMFORM_INFO(pmlmepriv); + struct beamforming_entry *pEntry = &(pBeamInfo->beamforming_entry[pBeamInfo->beamforming_cur_idx]); + + if(status == 1) + { + pEntry->LogStatusFailCnt = 0; + } + else + { + pEntry->LogStatusFailCnt++; + DBG_871X("%s LogStatusFailCnt %d\n", __FUNCTION__, pEntry->LogStatusFailCnt); + } + if(pEntry->LogStatusFailCnt > 20) + { + DBG_871X("%s LogStatusFailCnt > 20, Stop SOUNDING\n", __FUNCTION__); + //pEntry->bSound = _FALSE; + //rtw_hal_set_hwreg(Adapter, HW_VAR_SOUNDING_FW_NDPA, (u8 *)&pBeamInfo->beamforming_cur_idx); + //beamforming_deinit_entry(Adapter, pEntry->mac_addr); + beamforming_wk_cmd(Adapter, BEAMFORMING_CTRL_SOUNDING_FAIL, NULL, 0, 1); + } +} + void beamforming_enter(PADAPTER adapter, PVOID psta) { u8 idx = 0xff; @@ -469,7 +856,7 @@ void beamforming_enter(PADAPTER adapter, PVOID psta) if(beamforming_init_entry(adapter, (struct sta_info *)psta, &idx)) rtw_hal_set_hwreg(adapter, HW_VAR_SOUNDING_ENTER, (u8 *)&idx); - DBG_871X("%s Idx %d\n", __FUNCTION__, idx); + //DBG_871X("%s Idx %d\n", __FUNCTION__, idx); } void beamforming_leave(PADAPTER adapter,u8* ra) @@ -494,9 +881,9 @@ BEAMFORMING_CAP beamforming_get_beamform_cap(struct beamforming_info *pBeamInfo) { beamforming_entry = pBeamInfo->beamforming_entry[i]; - if(beamforming_entry.used) + if(beamforming_entry.bUsed) { - if( (beamforming_entry.beamforming_entry_cap& BEAMFORMEE_CAP_VHT_SU) || + if( (beamforming_entry.beamforming_entry_cap & BEAMFORMEE_CAP_VHT_SU) || (beamforming_entry.beamforming_entry_cap & BEAMFORMEE_CAP_HT_EXPLICIT)) bSelfBeamformee = _TRUE; if( (beamforming_entry.beamforming_entry_cap & BEAMFORMER_CAP_VHT_SU) || @@ -516,10 +903,19 @@ BEAMFORMING_CAP beamforming_get_beamform_cap(struct beamforming_info *pBeamInfo) return beamform_cap; } +void beamforming_watchdog(PADAPTER Adapter) +{ + struct beamforming_info *pBeamInfo = GET_BEAMFORM_INFO(( &(Adapter->mlmepriv))); + + if(pBeamInfo->beamforming_state != BEAMFORMING_STATE_START) + return; + + beamforming_dym_period(Adapter); + beamforming_dym_ndpa_rate(Adapter); +} void beamforming_wk_hdl(_adapter *padapter, u8 type, u8 *pbuf) { - struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); _func_enter_; @@ -532,6 +928,14 @@ _func_enter_; case BEAMFORMING_CTRL_LEAVE: beamforming_leave(padapter, pbuf); break; + + case BEAMFORMING_CTRL_SOUNDING_FAIL: + beamforming_sounding_fail(padapter); + break; + + case BEAMFORMING_CTRL_SOUNDING_CLK: + rtw_hal_set_hwreg(padapter, HW_VAR_SOUNDING_CLK, NULL); + break; default: break; @@ -566,15 +970,20 @@ _func_enter_; goto exit; } - wk_buf = rtw_zmalloc(size); - if(wk_buf==NULL){ - rtw_mfree((u8 *)ph2c, sizeof(struct cmd_obj)); - rtw_mfree((u8 *)pdrvextra_cmd_parm, sizeof(struct drvextra_cmd_parm)); - res= _FAIL; - goto exit; - } + if (pbuf != NULL) { + wk_buf = rtw_zmalloc(size); + if(wk_buf==NULL){ + rtw_mfree((u8 *)ph2c, sizeof(struct cmd_obj)); + rtw_mfree((u8 *)pdrvextra_cmd_parm, sizeof(struct drvextra_cmd_parm)); + res= _FAIL; + goto exit; + } - _rtw_memcpy(wk_buf, pbuf, size); + _rtw_memcpy(wk_buf, pbuf, size); + } else { + wk_buf = NULL; + size = 0; + } pdrvextra_cmd_parm->ec_id = BEAMFORMING_WK_CID; pdrvextra_cmd_parm->type = type; diff --git a/backports/drivers/realtek/rtl8812au/core/rtw_br_ext.c b/backports/drivers/realtek/rtl8812au/core/rtw_br_ext.c index 88a517a68d7d24..f90f790a31d829 100755 --- a/backports/drivers/realtek/rtl8812au/core/rtw_br_ext.c +++ b/backports/drivers/realtek/rtl8812au/core/rtw_br_ext.c @@ -247,7 +247,7 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char if (len >= 8) { mac = scan_tlv(&data[8], len-8, 1, 1); if (mac) { - _DEBUG_INFO("Router Solicitation, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n", + DBG_871X("Router Solicitation, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n", mac[0],mac[1],mac[2],mac[3],mac[4],mac[5], replace_mac[0],replace_mac[1],replace_mac[2],replace_mac[3],replace_mac[4],replace_mac[5]); memcpy(mac, replace_mac, 6); @@ -259,7 +259,7 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char if (len >= 16) { mac = scan_tlv(&data[16], len-16, 1, 1); if (mac) { - _DEBUG_INFO("Router Advertisement, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n", + DBG_871X("Router Advertisement, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n", mac[0],mac[1],mac[2],mac[3],mac[4],mac[5], replace_mac[0],replace_mac[1],replace_mac[2],replace_mac[3],replace_mac[4],replace_mac[5]); memcpy(mac, replace_mac, 6); @@ -271,7 +271,7 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char if (len >= 24) { mac = scan_tlv(&data[24], len-24, 1, 1); if (mac) { - _DEBUG_INFO("Neighbor Solicitation, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n", + DBG_871X("Neighbor Solicitation, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n", mac[0],mac[1],mac[2],mac[3],mac[4],mac[5], replace_mac[0],replace_mac[1],replace_mac[2],replace_mac[3],replace_mac[4],replace_mac[5]); memcpy(mac, replace_mac, 6); @@ -283,7 +283,7 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char if (len >= 24) { mac = scan_tlv(&data[24], len-24, 2, 1); if (mac) { - _DEBUG_INFO("Neighbor Advertisement, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n", + DBG_871X("Neighbor Advertisement, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n", mac[0],mac[1],mac[2],mac[3],mac[4],mac[5], replace_mac[0],replace_mac[1],replace_mac[2],replace_mac[3],replace_mac[4],replace_mac[5]); memcpy(mac, replace_mac, 6); @@ -295,7 +295,7 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char if (len >= 40) { mac = scan_tlv(&data[40], len-40, 2, 1); if (mac) { - _DEBUG_INFO("Redirect, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n", + DBG_871X("Redirect, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n", mac[0],mac[1],mac[2],mac[3],mac[4],mac[5], replace_mac[0],replace_mac[1],replace_mac[2],replace_mac[3],replace_mac[4],replace_mac[5]); memcpy(mac, replace_mac, 6); @@ -439,7 +439,7 @@ static int __nat25_db_network_lookup_and_replace(_adapter *priv, atomic_inc(&db->use_count); #ifdef CL_IPV6_PASS - DEBUG_INFO("NAT25: Lookup M:%02x%02x%02x%02x%02x%02x N:%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x" + DBG_871X("NAT25: Lookup M:%02x%02x%02x%02x%02x%02x N:%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x" "%02x%02x%02x%02x%02x%02x\n", db->macAddr[0], db->macAddr[1], @@ -465,7 +465,7 @@ static int __nat25_db_network_lookup_and_replace(_adapter *priv, db->networkAddr[15], db->networkAddr[16]); #else - DEBUG_INFO("NAT25: Lookup M:%02x%02x%02x%02x%02x%02x N:%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\n", + DBG_871X("NAT25: Lookup M:%02x%02x%02x%02x%02x%02x N:%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\n", db->macAddr[0], db->macAddr[1], db->macAddr[2], @@ -815,7 +815,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) //in class A, B, C, host address is all zero or all one is illegal if (iph->saddr == 0) return 0; - DEBUG_INFO("NAT25: Insert IP, SA=%08x, DA=%08x\n", iph->saddr, iph->daddr); + DBG_871X("NAT25: Insert IP, SA=%08x, DA=%08x\n", iph->saddr, iph->daddr); __nat25_generate_ipv4_network_addr(networkAddr, &iph->saddr); //record source IP address and , source mac address into db __nat25_db_network_insert(priv, skb->data+ETH_ALEN, networkAddr); @@ -826,7 +826,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) case NAT25_LOOKUP: { - DEBUG_INFO("NAT25: Lookup IP, SA=%08x, DA=%08x\n", iph->saddr, iph->daddr); + DBG_871X("NAT25: Lookup IP, SA=%08x, DA=%08x\n", iph->saddr, iph->daddr); #ifdef SUPPORT_TX_MCAST2UNI if (priv->pshare->rf_ft_var.mc2u_disable || ((((OPMODE & (WIFI_STATION_STATE|WIFI_ASOC_STATE)) @@ -840,12 +840,12 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) if (!__nat25_db_network_lookup_and_replace(priv, skb, networkAddr)) { if (*((unsigned char *)&iph->daddr + 3) == 0xff) { // L2 is unicast but L3 is broadcast, make L2 bacome broadcast - DEBUG_INFO("NAT25: Set DA as boardcast\n"); + DBG_871X("NAT25: Set DA as boardcast\n"); memset(skb->data, 0xff, ETH_ALEN); } else { // forward unknow IP packet to upper TCP/IP - DEBUG_INFO("NAT25: Replace DA with BR's MAC\n"); + DBG_871X("NAT25: Replace DA with BR's MAC\n"); if ( (*(u32 *)priv->br_mac) == 0 && (*(u16 *)(priv->br_mac+4)) == 0 ) { void netdev_br_init(struct net_device *netdev); printk("Re-init netdev_br_init() due to br_mac==0!\n"); @@ -885,7 +885,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) case NAT25_INSERT: { - DEBUG_INFO("NAT25: Insert ARP, MAC=%02x%02x%02x%02x%02x%02x\n", arp_ptr[0], + DBG_871X("NAT25: Insert ARP, MAC=%02x%02x%02x%02x%02x%02x\n", arp_ptr[0], arp_ptr[1], arp_ptr[2], arp_ptr[3], arp_ptr[4], arp_ptr[5]); // change to ARP sender mac address to wlan STA address @@ -904,7 +904,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) case NAT25_LOOKUP: { - DEBUG_INFO("NAT25: Lookup ARP\n"); + DBG_871X("NAT25: Lookup ARP\n"); arp_ptr += arp->ar_hln; sender = (unsigned int *)arp_ptr; @@ -930,8 +930,9 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) /*---------------------------------------------------*/ /* Handle IPX and Apple Talk frame */ /*---------------------------------------------------*/ - else if((protocol == __constant_htons(ETH_P_IPX)) || - (protocol <= __constant_htons(ETH_FRAME_LEN))) + else if((protocol == __constant_htons(ETH_P_IPX)) || + (protocol == __constant_htons(ETH_P_ATALK)) || + (protocol == __constant_htons(ETH_P_AARP))) { unsigned char ipx_header[2] = {0xFF, 0xFF}; struct ipxhdr *ipx = NULL; @@ -941,14 +942,14 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) if(protocol == __constant_htons(ETH_P_IPX)) { - DEBUG_INFO("NAT25: Protocol=IPX (Ethernet II)\n"); + DBG_871X("NAT25: Protocol=IPX (Ethernet II)\n"); ipx = (struct ipxhdr *)framePtr; } - else if(protocol <= __constant_htons(ETH_FRAME_LEN)) + else //if(protocol <= __constant_htons(ETH_FRAME_LEN)) { if(!memcmp(ipx_header, framePtr, 2)) { - DEBUG_INFO("NAT25: Protocol=IPX (Ethernet 802.3)\n"); + DBG_871X("NAT25: Protocol=IPX (Ethernet 802.3)\n"); ipx = (struct ipxhdr *)framePtr; } else @@ -968,7 +969,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) { framePtr += 5; // eliminate the SNAP header - DEBUG_INFO("NAT25: Protocol=IPX (Ethernet SNAP)\n"); + DBG_871X("NAT25: Protocol=IPX (Ethernet SNAP)\n"); ipx = (struct ipxhdr *)framePtr; } else if(!memcmp(aarp_snap_id, framePtr, 5)) @@ -996,18 +997,14 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) if(!memcmp(ipx_header, framePtr, 2)) { - DEBUG_INFO("NAT25: Protocol=IPX (Ethernet 802.2)\n"); + DBG_871X("NAT25: Protocol=IPX (Ethernet 802.2)\n"); ipx = (struct ipxhdr *)framePtr; } else return -1; } - else - return -1; } } - else - return -1; /* IPX */ if(ipx != NULL) @@ -1017,14 +1014,14 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) case NAT25_CHECK: if(!memcmp(skb->data+ETH_ALEN, ipx->ipx_source.node, ETH_ALEN)) { - DEBUG_INFO("NAT25: Check IPX skb_copy\n"); + DBG_871X("NAT25: Check IPX skb_copy\n"); return 0; } return -1; case NAT25_INSERT: { - DEBUG_INFO("NAT25: Insert IPX, Dest=%08x,%02x%02x%02x%02x%02x%02x,%04x Source=%08x,%02x%02x%02x%02x%02x%02x,%04x\n", + DBG_871X("NAT25: Insert IPX, Dest=%08x,%02x%02x%02x%02x%02x%02x,%04x Source=%08x,%02x%02x%02x%02x%02x%02x,%04x\n", ipx->ipx_dest.net, ipx->ipx_dest.node[0], ipx->ipx_dest.node[1], @@ -1044,7 +1041,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) if(!memcmp(skb->data+ETH_ALEN, ipx->ipx_source.node, ETH_ALEN)) { - DEBUG_INFO("NAT25: Use IPX Net, and Socket as network addr\n"); + DBG_871X("NAT25: Use IPX Net, and Socket as network addr\n"); __nat25_generate_ipx_network_addr_with_socket(networkAddr, &ipx->ipx_source.net, &ipx->ipx_source.sock); @@ -1066,7 +1063,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) { if(!memcmp(GET_MY_HWADDR(priv), ipx->ipx_dest.node, ETH_ALEN)) { - DEBUG_INFO("NAT25: Lookup IPX, Modify Destination IPX Node addr\n"); + DBG_871X("NAT25: Lookup IPX, Modify Destination IPX Node addr\n"); __nat25_generate_ipx_network_addr_with_socket(networkAddr, &ipx->ipx_dest.net, &ipx->ipx_dest.sock); @@ -1109,7 +1106,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) // change to AARP source mac address to wlan STA address memcpy(ea->hw_src, GET_MY_HWADDR(priv), ETH_ALEN); - DEBUG_INFO("NAT25: Insert AARP, Source=%d,%d Destination=%d,%d\n", + DBG_871X("NAT25: Insert AARP, Source=%d,%d Destination=%d,%d\n", ea->pa_src_net, ea->pa_src_node, ea->pa_dst_net, @@ -1125,7 +1122,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) case NAT25_LOOKUP: { - DEBUG_INFO("NAT25: Lookup AARP, Source=%d,%d Destination=%d,%d\n", + DBG_871X("NAT25: Lookup AARP, Source=%d,%d Destination=%d,%d\n", ea->pa_src_net, ea->pa_src_node, ea->pa_dst_net, @@ -1155,7 +1152,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) case NAT25_INSERT: { - DEBUG_INFO("NAT25: Insert DDP, Source=%d,%d Destination=%d,%d\n", + DBG_871X("NAT25: Insert DDP, Source=%d,%d Destination=%d,%d\n", ddp->deh_snet, ddp->deh_snode, ddp->deh_dnet, @@ -1171,7 +1168,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) case NAT25_LOOKUP: { - DEBUG_INFO("NAT25: Lookup DDP, Source=%d,%d Destination=%d,%d\n", + DBG_871X("NAT25: Lookup DDP, Source=%d,%d Destination=%d,%d\n", ddp->deh_snet, ddp->deh_snode, ddp->deh_dnet, @@ -1248,7 +1245,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) if(__nat25_add_pppoe_tag(skb, tag) < 0) return -1; - DEBUG_INFO("NAT25: Insert PPPoE, forward %s packet\n", + DBG_871X("NAT25: Insert PPPoE, forward %s packet\n", (ph->code == PADI_CODE ? "PADI" : "PADR")); } else { // not add relay tag @@ -1269,7 +1266,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) } else // session phase { - DEBUG_INFO("NAT25: Insert PPPoE, insert session packet to %s\n", skb->dev->name); + DBG_871X("NAT25: Insert PPPoE, insert session packet to %s\n", skb->dev->name); __nat25_generate_pppoe_network_addr(networkAddr, skb->data, &(ph->sid)); @@ -1327,7 +1324,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) if (offset > 0) tag->tag_len = htons(tagLen-MAGIC_CODE_LEN-RTL_RELAY_TAG_LEN); - DEBUG_INFO("NAT25: Lookup PPPoE, forward %s Packet from %s\n", + DBG_871X("NAT25: Lookup PPPoE, forward %s Packet from %s\n", (ph->code == PADO_CODE ? "PADO" : "PADS"), skb->dev->name); } else { // not add relay tag @@ -1342,7 +1339,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) else { if(ph->sid != 0) { - DEBUG_INFO("NAT25: Lookup PPPoE, lookup session packet from %s\n", skb->dev->name); + DBG_871X("NAT25: Lookup PPPoE, lookup session packet from %s\n", skb->dev->name); __nat25_generate_pppoe_network_addr(networkAddr, skb->data+ETH_ALEN, &(ph->sid)); __nat25_db_network_lookup_and_replace(priv, skb, networkAddr); @@ -1426,7 +1423,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) case NAT25_INSERT: { - DEBUG_INFO("NAT25: Insert IP, SA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x," + DBG_871X("NAT25: Insert IP, SA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x," " DA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x\n", iph->saddr.s6_addr16[0],iph->saddr.s6_addr16[1],iph->saddr.s6_addr16[2],iph->saddr.s6_addr16[3], iph->saddr.s6_addr16[4],iph->saddr.s6_addr16[5],iph->saddr.s6_addr16[6],iph->saddr.s6_addr16[7], @@ -1455,7 +1452,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) return 0; case NAT25_LOOKUP: - DEBUG_INFO("NAT25: Lookup IP, SA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x," + DBG_871X("NAT25: Lookup IP, SA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x," " DA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x\n", iph->saddr.s6_addr16[0],iph->saddr.s6_addr16[1],iph->saddr.s6_addr16[2],iph->saddr.s6_addr16[3], iph->saddr.s6_addr16[4],iph->saddr.s6_addr16[5],iph->saddr.s6_addr16[6],iph->saddr.s6_addr16[7], @@ -1571,7 +1568,7 @@ void mac_clone(_adapter *priv, unsigned char *addr) struct sockaddr sa; memcpy(sa.sa_data, addr, ETH_ALEN); - DEBUG_INFO("MAC Clone: Addr=%02x%02x%02x%02x%02x%02x\n", + DBG_871X("MAC Clone: Addr=%02x%02x%02x%02x%02x%02x\n", addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); rtl8192cd_set_hwaddr(priv->dev, &sa); } @@ -1650,7 +1647,7 @@ void dhcp_flag_bcast(_adapter *priv, struct sk_buff *skb) { register int sum = 0; - DEBUG_INFO("DHCP: change flag of DHCP request to broadcast.\n"); + DBG_871X("DHCP: change flag of DHCP request to broadcast.\n"); // or BROADCAST flag dhcph->flags |= htons(BROADCAST_FLAG); // recalculate checksum diff --git a/backports/drivers/realtek/rtl8812au/core/rtw_bt_mp.c b/backports/drivers/realtek/rtl8812au/core/rtw_bt_mp.c index 63fbf9e40373d5..73f2105becede0 100755 --- a/backports/drivers/realtek/rtl8812au/core/rtw_bt_mp.c +++ b/backports/drivers/realtek/rtl8812au/core/rtw_bt_mp.c @@ -107,10 +107,6 @@ mptbt_CheckC2hFrame( return c2hStatus; } -#if defined(CONFIG_RTL8723A) -extern s32 FillH2CCmd(PADAPTER padapter, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer); -#endif - BT_CTRL_STATUS mptbt_SendH2c( PADAPTER Adapter, @@ -140,7 +136,7 @@ mptbt_SendH2c( pMptCtx->MptBtC2hEvent = _FALSE; #if defined(CONFIG_RTL8723A) - FillH2CCmd(Adapter, 70, h2cCmdLen, (pu1Byte)pH2c); + rtw_hal_fill_h2c_cmd(Adapter, 70, h2cCmdLen, (pu1Byte)pH2c); #elif defined(CONFIG_RTL8723B) rtl8723b_set_FwBtMpOper_cmd(Adapter, pH2c->opCode, pH2c->opCodeVer, pH2c->reqNum, pH2c->buf); #endif @@ -529,7 +525,7 @@ MPTBT_FwC2hBtMpCtrl( if(Adapter->bBTFWReady == _FALSE || Adapter->registrypriv.mp_mode == 0 ) { - DBG_8192C("Ignore C2H BT MP Info since not in MP mode \n"); + //DBG_8192C("Ignore C2H BT MP Info since not in MP mode \n"); return; } if( length > 32 || length < 3 ) diff --git a/backports/drivers/realtek/rtl8812au/core/rtw_btcoex.c b/backports/drivers/realtek/rtl8812au/core/rtw_btcoex.c index 3df43e03c46e51..31fdfbaf4597b4 100755 --- a/backports/drivers/realtek/rtl8812au/core/rtw_btcoex.c +++ b/backports/drivers/realtek/rtl8812au/core/rtw_btcoex.c @@ -19,8 +19,9 @@ ******************************************************************************/ #ifdef CONFIG_BT_COEXIST -#include +#include #include +#include void rtw_btcoex_Initialize(PADAPTER padapter) @@ -28,23 +29,56 @@ void rtw_btcoex_Initialize(PADAPTER padapter) hal_btcoex_Initialize(padapter); } -void rtw_btcoex_HAL_Initialize(PADAPTER padapter) +void rtw_btcoex_PowerOnSetting(PADAPTER padapter) { - hal_btcoex_InitHwConfig(padapter); + hal_btcoex_PowerOnSetting(padapter); +} + +void rtw_btcoex_PreLoadFirmware(PADAPTER padapter) +{ + hal_btcoex_PreLoadFirmware(padapter); +} + +void rtw_btcoex_HAL_Initialize(PADAPTER padapter, u8 bWifiOnly) +{ + hal_btcoex_InitHwConfig(padapter, bWifiOnly); } void rtw_btcoex_IpsNotify(PADAPTER padapter, u8 type) { + PHAL_DATA_TYPE pHalData; + + pHalData = GET_HAL_DATA(padapter); + if (_FALSE == pHalData->EEPROMBluetoothCoexist) + return; + hal_btcoex_IpsNotify(padapter, type); } void rtw_btcoex_LpsNotify(PADAPTER padapter, u8 type) { + PHAL_DATA_TYPE pHalData; + + pHalData = GET_HAL_DATA(padapter); + if (_FALSE == pHalData->EEPROMBluetoothCoexist) + return; + hal_btcoex_LpsNotify(padapter, type); } void rtw_btcoex_ScanNotify(PADAPTER padapter, u8 type) { + PHAL_DATA_TYPE pHalData; + + pHalData = GET_HAL_DATA(padapter); + if (_FALSE == pHalData->EEPROMBluetoothCoexist) + return; + +#ifdef CONFIG_BT_COEXIST_SOCKET_TRX + struct bt_coex_info *pcoex_info = &padapter->coex_info; + PBT_MGNT pBtMgnt=&pcoex_info->BtMgnt; +#endif //CONFIG_BT_COEXIST_SOCKET_TRX + #ifdef CONFIG_CONCURRENT_MODE if ((_FALSE == type) && (padapter->pbuddy_adapter)) { @@ -54,11 +88,22 @@ void rtw_btcoex_ScanNotify(PADAPTER padapter, u8 type) } #endif +#ifdef CONFIG_BT_COEXIST_SOCKET_TRX + if(pBtMgnt->ExtConfig.bEnableWifiScanNotify) + rtw_btcoex_SendScanNotify(padapter, type); +#endif //CONFIG_BT_COEXIST_SOCKET_TRX + hal_btcoex_ScanNotify(padapter, type); } void rtw_btcoex_ConnectNotify(PADAPTER padapter, u8 action) { + PHAL_DATA_TYPE pHalData; + + pHalData = GET_HAL_DATA(padapter); + if (_FALSE == pHalData->EEPROMBluetoothCoexist) + return; + #ifdef DBG_CONFIG_ERROR_RESET if (_TRUE == rtw_hal_sreset_inprogress(padapter)) { @@ -82,6 +127,12 @@ void rtw_btcoex_ConnectNotify(PADAPTER padapter, u8 action) void rtw_btcoex_MediaStatusNotify(PADAPTER padapter, u8 mediaStatus) { + PHAL_DATA_TYPE pHalData; + + pHalData = GET_HAL_DATA(padapter); + if (_FALSE == pHalData->EEPROMBluetoothCoexist) + return; + #ifdef DBG_CONFIG_ERROR_RESET if (_TRUE == rtw_hal_sreset_inprogress(padapter)) { @@ -111,26 +162,56 @@ void rtw_btcoex_MediaStatusNotify(PADAPTER padapter, u8 mediaStatus) void rtw_btcoex_SpecialPacketNotify(PADAPTER padapter, u8 pktType) { + PHAL_DATA_TYPE pHalData; + + pHalData = GET_HAL_DATA(padapter); + if (_FALSE == pHalData->EEPROMBluetoothCoexist) + return; + hal_btcoex_SpecialPacketNotify(padapter, pktType); } void rtw_btcoex_IQKNotify(PADAPTER padapter, u8 state) { + PHAL_DATA_TYPE pHalData; + + pHalData = GET_HAL_DATA(padapter); + if (_FALSE == pHalData->EEPROMBluetoothCoexist) + return; + hal_btcoex_IQKNotify(padapter, state); } void rtw_btcoex_BtInfoNotify(PADAPTER padapter, u8 length, u8 *tmpBuf) { + PHAL_DATA_TYPE pHalData; + + pHalData = GET_HAL_DATA(padapter); + if (_FALSE == pHalData->EEPROMBluetoothCoexist) + return; + hal_btcoex_BtInfoNotify(padapter, length, tmpBuf); } void rtw_btcoex_SuspendNotify(PADAPTER padapter, u8 state) { + PHAL_DATA_TYPE pHalData; + + pHalData = GET_HAL_DATA(padapter); + if (_FALSE == pHalData->EEPROMBluetoothCoexist) + return; + hal_btcoex_SuspendNotify(padapter, state); } void rtw_btcoex_HaltNotify(PADAPTER padapter) { + PHAL_DATA_TYPE pHalData; + + pHalData = GET_HAL_DATA(padapter); + if (_FALSE == pHalData->EEPROMBluetoothCoexist) + return; + if (_FALSE == padapter->bup) { DBG_871X(FUNC_ADPT_FMT ": bup=%d Skip!\n", @@ -150,9 +231,9 @@ void rtw_btcoex_HaltNotify(PADAPTER padapter) hal_btcoex_HaltNotify(padapter); } -void rtw_btcoex_SwitchGntBt(PADAPTER padapter) +void rtw_btcoex_SwitchBtTRxMask(PADAPTER padapter) { - hal_btcoex_SwitchGntBt(padapter); + hal_btcoex_SwitchBtTRxMask(padapter); } void rtw_btcoex_Switch(PADAPTER padapter, u8 enable) @@ -167,14 +248,32 @@ u8 rtw_btcoex_IsBtDisabled(PADAPTER padapter) void rtw_btcoex_Handler(PADAPTER padapter) { + PHAL_DATA_TYPE pHalData; + + pHalData = GET_HAL_DATA(padapter); + + if (_FALSE == pHalData->EEPROMBluetoothCoexist) + return; + #if defined(CONFIG_CONCURRENT_MODE) if (padapter->adapter_type != PRIMARY_ADAPTER) return; #endif + + hal_btcoex_Hanlder(padapter); } +s32 rtw_btcoex_IsBTCoexRejectAMPDU(PADAPTER padapter) +{ + s32 coexctrl; + + coexctrl = hal_btcoex_IsBTCoexRejectAMPDU(padapter); + + return coexctrl; +} + s32 rtw_btcoex_IsBTCoexCtrlAMPDUSize(PADAPTER padapter) { s32 coexctrl; @@ -250,6 +349,11 @@ u8 rtw_btcoex_GetPGAntNum(PADAPTER padapter) return hal_btcoex_GetPgAntNum(padapter); } +void rtw_btcoex_SetSingleAntPath(PADAPTER padapter, u8 singleAntPath) +{ + hal_btcoex_SetSingleAntPath(padapter, singleAntPath); +} + u32 rtw_btcoex_GetRaMask(PADAPTER padapter) { return hal_btcoex_GetRaMask(padapter); @@ -285,26 +389,27 @@ u8 rtw_btcoex_IsBtLinkExist(PADAPTER padapter) return hal_btcoex_IsBtLinkExist(padapter); } +void rtw_btcoex_SetBtPatchVersion(PADAPTER padapter,u16 btHciVer, u16 btPatchVer) +{ + hal_btcoex_SetBtPatchVersion(padapter,btHciVer,btPatchVer); +} + +void rtw_btcoex_SetHciVersion(PADAPTER padapter, u16 hciVersion) +{ + hal_btcoex_SetHciVersion(padapter, hciVersion); +} + +void rtw_btcoex_StackUpdateProfileInfo(void) +{ + hal_btcoex_StackUpdateProfileInfo(); +} + // ================================================== // Below Functions are called by BT-Coex // ================================================== -void rtw_btcoex_RejectApAggregatedPacket(PADAPTER padapter, u8 enable) +void rtw_btcoex_rx_ampdu_apply(PADAPTER padapter) { - struct mlme_ext_info *pmlmeinfo; - struct sta_info *psta; - - pmlmeinfo = &padapter->mlmeextpriv.mlmext_info; - psta = rtw_get_stainfo(&padapter->stapriv, get_bssid(&padapter->mlmepriv)); - - if (_TRUE == enable) - { - pmlmeinfo->bAcceptAddbaReq = _FALSE; - send_delba(padapter, 0, psta->hwaddr); - } - else - { - pmlmeinfo->bAcceptAddbaReq = _TRUE; - } + rtw_rx_ampdu_apply(padapter); } void rtw_btcoex_LPS_Enter(PADAPTER padapter) @@ -334,5 +439,1371 @@ void rtw_btcoex_LPS_Leave(PADAPTER padapter) pwrpriv->bpower_saving = _FALSE; } } + + +// ================================================== +// Below Functions are BT-Coex socket related function +// ================================================== + +#ifdef CONFIG_BT_COEXIST_SOCKET_TRX +_adapter *pbtcoexadapter = NULL; +u8 rtw_btcoex_btinfo_cmd(_adapter *adapter, u8 *buf, u16 len) +{ + struct cmd_obj *ph2c; + struct drvextra_cmd_parm *pdrvextra_cmd_parm; + u8 *btinfo; + struct cmd_priv *pcmdpriv = &adapter->cmdpriv; + u8 res = _SUCCESS; + + ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); + if (ph2c == NULL) { + res = _FAIL; + goto exit; + } + + pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm)); + if (pdrvextra_cmd_parm == NULL) { + rtw_mfree((u8*)ph2c, sizeof(struct cmd_obj)); + res = _FAIL; + goto exit; + } + + btinfo = rtw_zmalloc(len); + if (btinfo == NULL) { + rtw_mfree((u8*)ph2c, sizeof(struct cmd_obj)); + rtw_mfree((u8*)pdrvextra_cmd_parm, sizeof(struct drvextra_cmd_parm)); + res = _FAIL; + goto exit; + } + + pdrvextra_cmd_parm->ec_id = BTINFO_WK_CID; + pdrvextra_cmd_parm->type = 0; + pdrvextra_cmd_parm->size = len; + pdrvextra_cmd_parm->pbuf = btinfo; + + _rtw_memcpy(btinfo, buf, len); + + init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra)); + + res = rtw_enqueue_cmd(pcmdpriv, ph2c); + +exit: + return res; +} + +u8 rtw_btcoex_send_event_to_BT(_adapter *padapter, u8 status, u8 event_code, u8 opcode_low, u8 opcode_high,u8 *dbg_msg) +{ + u8 localBuf[6] = ""; + u8 *pRetPar; + u8 len=0,tx_event_length = 0; + rtw_HCI_event *pEvent; + + pEvent = (rtw_HCI_event*)(&localBuf[0]); + + pEvent->EventCode = event_code; + pEvent->Data[0] = 0x1; //packet # + pEvent->Data[1] = opcode_low; + pEvent->Data[2] = opcode_high; + len = len + 3; + + // Return parameters starts from here + pRetPar = &pEvent->Data[len]; + pRetPar[0] = status; //status + + len++; + pEvent->Length = len; + + //total tx event length + EventCode length + sizeof(length) + tx_event_length = pEvent->Length + 2; + + rtw_btcoex_dump_tx_msg((u8 *)pEvent, tx_event_length, dbg_msg); + + status = rtw_btcoex_sendmsgbysocket(padapter,(u8 *)pEvent, tx_event_length); + + return status; +} + +/* +Ref: +Realtek Wi-Fi Driver +Host Controller Interface for +Bluetooth 3.0 + HS V1.4 2013/02/07 + +Window team code & BT team code + */ + + +u8 rtw_btcoex_parse_BT_info_notify_cmd(_adapter *padapter, u8 *pcmd, u16 cmdlen) +{ + #define BT_INFO_LENGTH 8 + + u8 curPollEnable = pcmd[0]; + u8 curPollTime = pcmd[1]; + u8 btInfoReason = pcmd[2]; + u8 btInfoLen = pcmd[3]; + u8 btinfo[BT_INFO_LENGTH]; + + u8 localBuf[6] = ""; + u8 *pRetPar; + u8 len=0,tx_event_length = 0; + RTW_HCI_STATUS status = HCI_STATUS_SUCCESS; + rtw_HCI_event *pEvent; + + DBG_871X("%s\n",__func__); + DBG_871X("current Poll Enable: %d, currrent Poll Time: %d\n",curPollEnable,curPollTime); + DBG_871X("BT Info reason: %d, BT Info length: %d\n",btInfoReason,btInfoLen); + DBG_871X("%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n" + ,pcmd[4],pcmd[5],pcmd[6],pcmd[7],pcmd[8],pcmd[9],pcmd[10],pcmd[11]); + + _rtw_memset(btinfo, 0, BT_INFO_LENGTH); + +#if 1 + if(BT_INFO_LENGTH != btInfoLen) + { + status = HCI_STATUS_INVALID_HCI_CMD_PARA_VALUE; + DBG_871X("Error BT Info Length: %d\n",btInfoLen); + //return _FAIL; + } + else +#endif + { + if(0x1 == btInfoReason || 0x2 == btInfoReason) + { + _rtw_memcpy(btinfo, &pcmd[4], btInfoLen); + btinfo[0] = btInfoReason; + rtw_btcoex_btinfo_cmd(padapter,btinfo,btInfoLen); + } + else + { + DBG_871X("Other BT info reason\n"); + } + } + + //send complete event to BT + { + + pEvent = (rtw_HCI_event*)(&localBuf[0]); + + pEvent->EventCode = HCI_EVENT_COMMAND_COMPLETE; + pEvent->Data[0] = 0x1; //packet # + pEvent->Data[1] = HCIOPCODELOW(HCI_BT_INFO_NOTIFY, OGF_EXTENSION); + pEvent->Data[2] = HCIOPCODEHIGHT(HCI_BT_INFO_NOTIFY, OGF_EXTENSION); + len = len + 3; + + // Return parameters starts from here + pRetPar = &pEvent->Data[len]; + pRetPar[0] = status; //status + + len++; + pEvent->Length = len; + + //total tx event length + EventCode length + sizeof(length) + tx_event_length = pEvent->Length + 2; + + rtw_btcoex_dump_tx_msg((u8 *)pEvent, tx_event_length,"BT_info_event"); + + status = rtw_btcoex_sendmsgbysocket(padapter,(u8 *)pEvent, tx_event_length); + + return status; + //bthci_IndicateEvent(Adapter, PPacketIrpEvent, len+2); + } +} + +u8 rtw_btcoex_parse_BT_patch_ver_info_cmd(_adapter *padapter, u8 *pcmd, u16 cmdlen) +{ + RTW_HCI_STATUS status=HCI_STATUS_SUCCESS; + u16 btPatchVer=0x0, btHciVer=0x0; + //u16 *pU2tmp; + + u8 localBuf[6] = ""; + u8 *pRetPar; + u8 len=0, tx_event_length =0; + rtw_HCI_event *pEvent; + + btHciVer = pcmd[0] | pcmd[1]<<8; + btPatchVer = pcmd[2] | pcmd[3]<<8; + + + DBG_871X("%s, cmd:%02x %02x %02x %02x\n",__func__, pcmd[0] ,pcmd[1] ,pcmd[2] ,pcmd[3]); + DBG_871X("%s, HCI Ver:%d, Patch Ver:%d\n",__func__, btHciVer,btPatchVer); + + rtw_btcoex_SetBtPatchVersion(padapter,btHciVer,btPatchVer); + + + //send complete event to BT + { + pEvent = (rtw_HCI_event *)(&localBuf[0]); + + + pEvent->EventCode = HCI_EVENT_COMMAND_COMPLETE; + pEvent->Data[0] = 0x1; //packet # + pEvent->Data[1] = HCIOPCODELOW(HCI_BT_PATCH_VERSION_NOTIFY, OGF_EXTENSION); + pEvent->Data[2] = HCIOPCODEHIGHT(HCI_BT_PATCH_VERSION_NOTIFY, OGF_EXTENSION); + len = len + 3; + + // Return parameters starts from here + pRetPar = &pEvent->Data[len]; + pRetPar[0] = status; //status + + len++; + pEvent->Length = len; + + //total tx event length + EventCode length + sizeof(length) + tx_event_length = pEvent->Length + 2; + + rtw_btcoex_dump_tx_msg((u8 *)pEvent, tx_event_length,"BT_patch_event"); + + status = rtw_btcoex_sendmsgbysocket(padapter,(u8 *)pEvent, tx_event_length); + return status; + //bthci_IndicateEvent(Adapter, PPacketIrpEvent, len+2); + } +} + +u8 rtw_btcoex_parse_HCI_Ver_notify_cmd(_adapter *padapter, u8 *pcmd, u16 cmdlen) +{ + RTW_HCI_STATUS status=HCI_STATUS_SUCCESS; + u16 hciver = pcmd[0] | pcmd[1] <<8; + + u8 localBuf[6] = ""; + u8 *pRetPar; + u8 len=0, tx_event_length =0; + rtw_HCI_event *pEvent; + + struct bt_coex_info *pcoex_info = &padapter->coex_info; + PBT_MGNT pBtMgnt=&pcoex_info->BtMgnt; + pBtMgnt->ExtConfig.HCIExtensionVer = hciver; + DBG_871X("%s, HCI Version: %d\n",__func__,pBtMgnt->ExtConfig.HCIExtensionVer); + if(pBtMgnt->ExtConfig.HCIExtensionVer < 4) + { + status = HCI_STATUS_INVALID_HCI_CMD_PARA_VALUE; + DBG_871X("%s, Version = %d, HCI Version < 4\n",__func__,pBtMgnt->ExtConfig.HCIExtensionVer ); + } + else + { + rtw_btcoex_SetHciVersion(padapter,hciver); + } + //send complete event to BT + { + pEvent = (rtw_HCI_event *)(&localBuf[0]); + + + pEvent->EventCode = HCI_EVENT_COMMAND_COMPLETE; + pEvent->Data[0] = 0x1; //packet # + pEvent->Data[1] = HCIOPCODELOW(HCI_EXTENSION_VERSION_NOTIFY, OGF_EXTENSION); + pEvent->Data[2] = HCIOPCODEHIGHT(HCI_EXTENSION_VERSION_NOTIFY, OGF_EXTENSION); + len = len + 3; + + // Return parameters starts from here + pRetPar = &pEvent->Data[len]; + pRetPar[0] = status; //status + + len++; + pEvent->Length = len; + + //total tx event length + EventCode length + sizeof(length) + tx_event_length = pEvent->Length + 2; + + status = rtw_btcoex_sendmsgbysocket(padapter,(u8 *)pEvent, tx_event_length); + return status; + //bthci_IndicateEvent(Adapter, PPacketIrpEvent, len+2); + } + +} + +u8 rtw_btcoex_parse_WIFI_scan_notify_cmd(_adapter *padapter, u8 *pcmd, u16 cmdlen) +{ + RTW_HCI_STATUS status=HCI_STATUS_SUCCESS; + + u8 localBuf[6] = ""; + u8 *pRetPar; + u8 len=0, tx_event_length =0; + rtw_HCI_event *pEvent; + + struct bt_coex_info *pcoex_info = &padapter->coex_info; + PBT_MGNT pBtMgnt=&pcoex_info->BtMgnt; + pBtMgnt->ExtConfig.bEnableWifiScanNotify= pcmd[0]; + DBG_871X("%s, bEnableWifiScanNotify: %d\n",__func__,pBtMgnt->ExtConfig.bEnableWifiScanNotify); + + //send complete event to BT + { + pEvent = (rtw_HCI_event *)(&localBuf[0]); + + + pEvent->EventCode = HCI_EVENT_COMMAND_COMPLETE; + pEvent->Data[0] = 0x1; //packet # + pEvent->Data[1] = HCIOPCODELOW(HCI_ENABLE_WIFI_SCAN_NOTIFY, OGF_EXTENSION); + pEvent->Data[2] = HCIOPCODEHIGHT(HCI_ENABLE_WIFI_SCAN_NOTIFY, OGF_EXTENSION); + len = len + 3; + + // Return parameters starts from here + pRetPar = &pEvent->Data[len]; + pRetPar[0] = status; //status + + len++; + pEvent->Length = len; + + //total tx event length + EventCode length + sizeof(length) + tx_event_length = pEvent->Length + 2; + + status = rtw_btcoex_sendmsgbysocket(padapter,(u8 *)pEvent, tx_event_length); + return status; + //bthci_IndicateEvent(Adapter, PPacketIrpEvent, len+2); + } +} + +u8 rtw_btcoex_parse_HCI_link_status_notify_cmd(_adapter *padapter, u8 *pcmd, u16 cmdlen) +{ + RTW_HCI_STATUS status=HCI_STATUS_SUCCESS; + struct bt_coex_info *pcoex_info=&padapter->coex_info; + PBT_MGNT pBtMgnt=&pcoex_info->BtMgnt; + //PBT_DBG pBtDbg=&padapter->MgntInfo.BtInfo.BtDbg; + u8 i, numOfHandle=0, numOfAcl=0; + u16 conHandle; + u8 btProfile, btCoreSpec, linkRole; + u8 *pTriple; + + u8 localBuf[6] = ""; + u8 *pRetPar; + u8 len=0, tx_event_length =0; + rtw_HCI_event *pEvent; + + //pBtDbg->dbgHciInfo.hciCmdCntLinkStatusNotify++; + //RT_DISP_DATA(FIOCTL, IOCTL_BT_HCICMD_EXT, "LinkStatusNotify, Hex Data :\n", + // &pHciCmd->Data[0], pHciCmd->Length); + + DBG_871X("BTLinkStatusNotify\n"); + + // Current only RTL8723 support this command. + //pBtMgnt->bSupportProfile = TRUE; + pBtMgnt->bSupportProfile = _FALSE; + + pBtMgnt->ExtConfig.NumberOfACL = 0; + pBtMgnt->ExtConfig.NumberOfSCO = 0; + + numOfHandle = pcmd[0]; + //RT_DISP(FIOCTL, IOCTL_BT_HCICMD_EXT, ("numOfHandle = 0x%x\n", numOfHandle)); + //RT_DISP(FIOCTL, IOCTL_BT_HCICMD_EXT, ("HCIExtensionVer = %d\n", pBtMgnt->ExtConfig.HCIExtensionVer)); + DBG_871X("numOfHandle = 0x%x\n", numOfHandle); + DBG_871X("HCIExtensionVer = %d\n", pBtMgnt->ExtConfig.HCIExtensionVer); + + pTriple = &pcmd[1]; + for(i=0; iExtConfig.HCIExtensionVer < 1) + { + conHandle = *((u8 *)&pTriple[0]); + btProfile = pTriple[2]; + btCoreSpec = pTriple[3]; + if(BT_PROFILE_SCO == btProfile) + { + pBtMgnt->ExtConfig.NumberOfSCO++; + } + else + { + pBtMgnt->ExtConfig.NumberOfACL++; + pBtMgnt->ExtConfig.aclLink[i].ConnectHandle = conHandle; + pBtMgnt->ExtConfig.aclLink[i].BTProfile = btProfile; + pBtMgnt->ExtConfig.aclLink[i].BTCoreSpec = btCoreSpec; + } + //RT_DISP(FIOCTL, IOCTL_BT_HCICMD_EXT, + // ("Connection_Handle=0x%x, BTProfile=%d, BTSpec=%d\n", + // conHandle, btProfile, btCoreSpec)); + DBG_871X("Connection_Handle=0x%x, BTProfile=%d, BTSpec=%d\n", conHandle, btProfile, btCoreSpec); + pTriple += 4; + } + else if(pBtMgnt->ExtConfig.HCIExtensionVer >= 1) + { + conHandle = *((pu2Byte)&pTriple[0]); + btProfile = pTriple[2]; + btCoreSpec = pTriple[3]; + linkRole = pTriple[4]; + if(BT_PROFILE_SCO == btProfile) + { + pBtMgnt->ExtConfig.NumberOfSCO++; + } + else + { + pBtMgnt->ExtConfig.NumberOfACL++; + pBtMgnt->ExtConfig.aclLink[i].ConnectHandle = conHandle; + pBtMgnt->ExtConfig.aclLink[i].BTProfile = btProfile; + pBtMgnt->ExtConfig.aclLink[i].BTCoreSpec = btCoreSpec; + pBtMgnt->ExtConfig.aclLink[i].linkRole = linkRole; + } + //RT_DISP(FIOCTL, IOCTL_BT_HCICMD_EXT, + DBG_871X("Connection_Handle=0x%x, BTProfile=%d, BTSpec=%d, LinkRole=%d\n", + conHandle, btProfile, btCoreSpec, linkRole); + pTriple += 5; + } + } + rtw_btcoex_StackUpdateProfileInfo(); + + //send complete event to BT + { + pEvent = (rtw_HCI_event *)(&localBuf[0]); + + + pEvent->EventCode = HCI_EVENT_COMMAND_COMPLETE; + pEvent->Data[0] = 0x1; //packet # + pEvent->Data[1] = HCIOPCODELOW(HCI_LINK_STATUS_NOTIFY, OGF_EXTENSION); + pEvent->Data[2] = HCIOPCODEHIGHT(HCI_LINK_STATUS_NOTIFY, OGF_EXTENSION); + len = len + 3; + + // Return parameters starts from here + pRetPar = &pEvent->Data[len]; + pRetPar[0] = status; //status + + len++; + pEvent->Length = len; + + //total tx event length + EventCode length + sizeof(length) + tx_event_length = pEvent->Length + 2; + + status = rtw_btcoex_sendmsgbysocket(padapter,(u8 *)pEvent, tx_event_length); + return status; + //bthci_IndicateEvent(Adapter, PPacketIrpEvent, len+2); + } + + +} + +u8 rtw_btcoex_parse_HCI_BT_coex_notify_cmd(_adapter *padapter, u8 *pcmd, u16 cmdlen) +{ + u8 localBuf[6] = ""; + u8 *pRetPar; + u8 len=0, tx_event_length =0; + rtw_HCI_event *pEvent; + RTW_HCI_STATUS status=HCI_STATUS_SUCCESS; + + { + pEvent = (rtw_HCI_event *)(&localBuf[0]); + + + pEvent->EventCode = HCI_EVENT_COMMAND_COMPLETE; + pEvent->Data[0] = 0x1; //packet # + pEvent->Data[1] = HCIOPCODELOW(HCI_BT_COEX_NOTIFY, OGF_EXTENSION); + pEvent->Data[2] = HCIOPCODEHIGHT(HCI_BT_COEX_NOTIFY, OGF_EXTENSION); + len = len + 3; + + // Return parameters starts from here + pRetPar = &pEvent->Data[len]; + pRetPar[0] = status; //status + + len++; + pEvent->Length = len; + + //total tx event length + EventCode length + sizeof(length) + tx_event_length = pEvent->Length + 2; + + status = rtw_btcoex_sendmsgbysocket(padapter,(u8 *)pEvent, tx_event_length); + return status; + //bthci_IndicateEvent(Adapter, PPacketIrpEvent, len+2); + } +} + +u8 rtw_btcoex_parse_HCI_BT_operation_notify_cmd(_adapter *padapter, u8 *pcmd, u16 cmdlen) +{ + u8 localBuf[6] = ""; + u8 *pRetPar; + u8 len=0, tx_event_length =0; + rtw_HCI_event *pEvent; + RTW_HCI_STATUS status=HCI_STATUS_SUCCESS; + + DBG_871X("%s, OP code: %d\n",__func__,pcmd[0]); + + switch(pcmd[0]) + { + //case HCI_BT_OP_NONE: + case 0x0: + DBG_871X("[bt operation] : Operation None!!\n"); + break; + //case HCI_BT_OP_INQUIRY_START: + case 0x1: + DBG_871X("[bt operation] : Inquiry start!!\n"); + break; + //case HCI_BT_OP_INQUIRY_FINISH: + case 0x2: + DBG_871X("[bt operation] : Inquiry finished!!\n"); + break; + //case HCI_BT_OP_PAGING_START: + case 0x3: + DBG_871X("[bt operation] : Paging is started!!\n"); + break; + //case HCI_BT_OP_PAGING_SUCCESS: + case 0x4: + DBG_871X("[bt operation] : Paging complete successfully!!\n"); + break; + //case HCI_BT_OP_PAGING_UNSUCCESS: + case 0x5: + DBG_871X("[bt operation] : Paging complete unsuccessfully!!\n"); + break; + //case HCI_BT_OP_PAIRING_START: + case 0x6: + DBG_871X("[bt operation] : Pairing start!!\n"); + break; + //case HCI_BT_OP_PAIRING_FINISH: + case 0x7: + DBG_871X("[bt operation] : Pairing finished!!\n"); + break; + //case HCI_BT_OP_BT_DEV_ENABLE: + case 0x8: + DBG_871X("[bt operation] : BT Device is enabled!!\n"); + break; + //case HCI_BT_OP_BT_DEV_DISABLE: + case 0x9: + DBG_871X("[bt operation] : BT Device is disabled!!\n"); + break; + default: + DBG_871X("[bt operation] : Unknown, error!!\n"); + break; + } + + //send complete event to BT + { + pEvent = (rtw_HCI_event *)(&localBuf[0]); + + + pEvent->EventCode = HCI_EVENT_COMMAND_COMPLETE; + pEvent->Data[0] = 0x1; //packet # + pEvent->Data[1] = HCIOPCODELOW(HCI_BT_OPERATION_NOTIFY, OGF_EXTENSION); + pEvent->Data[2] = HCIOPCODEHIGHT(HCI_BT_OPERATION_NOTIFY, OGF_EXTENSION); + len = len + 3; + + // Return parameters starts from here + pRetPar = &pEvent->Data[len]; + pRetPar[0] = status; //status + + len++; + pEvent->Length = len; + + //total tx event length + EventCode length + sizeof(length) + tx_event_length = pEvent->Length + 2; + + status = rtw_btcoex_sendmsgbysocket(padapter,(u8 *)pEvent, tx_event_length); + return status; + //bthci_IndicateEvent(Adapter, PPacketIrpEvent, len+2); + } +} + +u8 rtw_btcoex_parse_BT_AFH_MAP_notify_cmd(_adapter *padapter, u8 *pcmd, u16 cmdlen) +{ + u8 localBuf[6] = ""; + u8 *pRetPar; + u8 len=0, tx_event_length =0; + rtw_HCI_event *pEvent; + RTW_HCI_STATUS status=HCI_STATUS_SUCCESS; + + { + pEvent = (rtw_HCI_event *)(&localBuf[0]); + + + pEvent->EventCode = HCI_EVENT_COMMAND_COMPLETE; + pEvent->Data[0] = 0x1; //packet # + pEvent->Data[1] = HCIOPCODELOW(HCI_BT_AFH_MAP_NOTIFY, OGF_EXTENSION); + pEvent->Data[2] = HCIOPCODEHIGHT(HCI_BT_AFH_MAP_NOTIFY, OGF_EXTENSION); + len = len + 3; + + // Return parameters starts from here + pRetPar = &pEvent->Data[len]; + pRetPar[0] = status; //status + + len++; + pEvent->Length = len; + + //total tx event length + EventCode length + sizeof(length) + tx_event_length = pEvent->Length + 2; + + status = rtw_btcoex_sendmsgbysocket(padapter,(u8 *)pEvent, tx_event_length); + return status; + //bthci_IndicateEvent(Adapter, PPacketIrpEvent, len+2); + } +} + +u8 rtw_btcoex_parse_BT_register_val_notify_cmd(_adapter *padapter, u8 *pcmd, u16 cmdlen) +{ + + u8 localBuf[6] = ""; + u8 *pRetPar; + u8 len=0, tx_event_length =0; + rtw_HCI_event *pEvent; + RTW_HCI_STATUS status=HCI_STATUS_SUCCESS; + + { + pEvent = (rtw_HCI_event *)(&localBuf[0]); + + + pEvent->EventCode = HCI_EVENT_COMMAND_COMPLETE; + pEvent->Data[0] = 0x1; //packet # + pEvent->Data[1] = HCIOPCODELOW(HCI_BT_REGISTER_VALUE_NOTIFY, OGF_EXTENSION); + pEvent->Data[2] = HCIOPCODEHIGHT(HCI_BT_REGISTER_VALUE_NOTIFY, OGF_EXTENSION); + len = len + 3; + + // Return parameters starts from here + pRetPar = &pEvent->Data[len]; + pRetPar[0] = status; //status + + len++; + pEvent->Length = len; + + //total tx event length + EventCode length + sizeof(length) + tx_event_length = pEvent->Length + 2; + + status = rtw_btcoex_sendmsgbysocket(padapter,(u8 *)pEvent, tx_event_length); + return status; + //bthci_IndicateEvent(Adapter, PPacketIrpEvent, len+2); + } +} + +u8 rtw_btcoex_parse_HCI_BT_abnormal_notify_cmd(_adapter *padapter, u8 *pcmd, u16 cmdlen) +{ + u8 localBuf[6] = ""; + u8 *pRetPar; + u8 len=0, tx_event_length =0; + rtw_HCI_event *pEvent; + RTW_HCI_STATUS status=HCI_STATUS_SUCCESS; + + { + pEvent = (rtw_HCI_event *)(&localBuf[0]); + + + pEvent->EventCode = HCI_EVENT_COMMAND_COMPLETE; + pEvent->Data[0] = 0x1; //packet # + pEvent->Data[1] = HCIOPCODELOW(HCI_BT_ABNORMAL_NOTIFY, OGF_EXTENSION); + pEvent->Data[2] = HCIOPCODEHIGHT(HCI_BT_ABNORMAL_NOTIFY, OGF_EXTENSION); + len = len + 3; + + // Return parameters starts from here + pRetPar = &pEvent->Data[len]; + pRetPar[0] = status; //status + + len++; + pEvent->Length = len; + + //total tx event length + EventCode length + sizeof(length) + tx_event_length = pEvent->Length + 2; + + status = rtw_btcoex_sendmsgbysocket(padapter,(u8 *)pEvent, tx_event_length); + return status; + //bthci_IndicateEvent(Adapter, PPacketIrpEvent, len+2); + } +} + +u8 rtw_btcoex_parse_HCI_query_RF_status_cmd(_adapter *padapter, u8 *pcmd, u16 cmdlen) +{ + u8 localBuf[6] = ""; + u8 *pRetPar; + u8 len=0, tx_event_length =0; + rtw_HCI_event *pEvent; + RTW_HCI_STATUS status=HCI_STATUS_SUCCESS; + + { + pEvent = (rtw_HCI_event *)(&localBuf[0]); + + + pEvent->EventCode = HCI_EVENT_COMMAND_COMPLETE; + pEvent->Data[0] = 0x1; //packet # + pEvent->Data[1] = HCIOPCODELOW(HCI_QUERY_RF_STATUS, OGF_EXTENSION); + pEvent->Data[2] = HCIOPCODEHIGHT(HCI_QUERY_RF_STATUS, OGF_EXTENSION); + len = len + 3; + + // Return parameters starts from here + pRetPar = &pEvent->Data[len]; + pRetPar[0] = status; //status + + len++; + pEvent->Length = len; + + //total tx event length + EventCode length + sizeof(length) + tx_event_length = pEvent->Length + 2; + + status = rtw_btcoex_sendmsgbysocket(padapter,(u8 *)pEvent, tx_event_length); + return status; + //bthci_IndicateEvent(Adapter, PPacketIrpEvent, len+2); + } +} + +/***************************************** +* HCI cmd format : +*| 15 - 0 | +*| OPcode (OCF|OGF<<10) | +*| 15 - 8 |7 - 0 | +*|Cmd para |Cmd para Length | +*|Cmd para...... | +******************************************/ + +//bit 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 +// | OCF | OGF | +void rtw_btcoex_parse_hci_extend_cmd(_adapter *padapter, u8 *pcmd, u16 len,const u16 hci_OCF) +{ + + DBG_871X("%s: OCF: %x\n",__func__,hci_OCF); + switch(hci_OCF) + { + case HCI_EXTENSION_VERSION_NOTIFY: + DBG_871X("HCI_EXTENSION_VERSION_NOTIFY\n"); + rtw_btcoex_parse_HCI_Ver_notify_cmd(padapter,pcmd, len); + break; + case HCI_LINK_STATUS_NOTIFY: + DBG_871X("HCI_LINK_STATUS_NOTIFY\n"); + rtw_btcoex_parse_HCI_link_status_notify_cmd(padapter,pcmd, len); + break; + case HCI_BT_OPERATION_NOTIFY: + // only for 8723a 2ant + DBG_871X("HCI_BT_OPERATION_NOTIFY\n"); + rtw_btcoex_parse_HCI_BT_operation_notify_cmd(padapter,pcmd, len); + // + break; + case HCI_ENABLE_WIFI_SCAN_NOTIFY: + DBG_871X("HCI_ENABLE_WIFI_SCAN_NOTIFY\n"); + rtw_btcoex_parse_WIFI_scan_notify_cmd(padapter,pcmd, len); + break; + case HCI_QUERY_RF_STATUS: + // only for 8723b 2ant + DBG_871X("HCI_QUERY_RF_STATUS\n"); + rtw_btcoex_parse_HCI_query_RF_status_cmd(padapter,pcmd, len); + break; + case HCI_BT_ABNORMAL_NOTIFY: + DBG_871X("HCI_BT_ABNORMAL_NOTIFY\n"); + rtw_btcoex_parse_HCI_BT_abnormal_notify_cmd(padapter,pcmd, len); + break; + case HCI_BT_INFO_NOTIFY: + DBG_871X("HCI_BT_INFO_NOTIFY\n"); + rtw_btcoex_parse_BT_info_notify_cmd(padapter,pcmd, len); + break; + case HCI_BT_COEX_NOTIFY: + DBG_871X("HCI_BT_COEX_NOTIFY\n"); + rtw_btcoex_parse_HCI_BT_coex_notify_cmd(padapter,pcmd, len); + break; + case HCI_BT_PATCH_VERSION_NOTIFY: + DBG_871X("HCI_BT_PATCH_VERSION_NOTIFY\n"); + rtw_btcoex_parse_BT_patch_ver_info_cmd(padapter,pcmd, len); + break; + case HCI_BT_AFH_MAP_NOTIFY: + DBG_871X("HCI_BT_AFH_MAP_NOTIFY\n"); + rtw_btcoex_parse_BT_AFH_MAP_notify_cmd(padapter,pcmd, len); + break; + case HCI_BT_REGISTER_VALUE_NOTIFY: + DBG_871X("HCI_BT_REGISTER_VALUE_NOTIFY\n"); + rtw_btcoex_parse_BT_register_val_notify_cmd(padapter,pcmd, len); + break; + default: + DBG_871X("ERROR!!! Unknown OCF: %x\n",hci_OCF); + break; + + } +} + +void rtw_btcoex_parse_hci_cmd(_adapter *padapter, u8 *pcmd, u16 len) +{ + u16 opcode = pcmd[0] | pcmd[1]<<8; + u16 hci_OGF = HCI_OGF(opcode); + u16 hci_OCF = HCI_OCF(opcode); + u8 cmdlen = len -3; + u8 pare_len = pcmd[2]; + + DBG_871X("%s\n",__func__); + DBG_871X("OGF: %x,OCF: %x\n",hci_OGF,hci_OCF); + switch(hci_OGF) + { + case OGF_EXTENSION: + DBG_871X("HCI_EXTENSION_CMD_OGF\n"); + rtw_btcoex_parse_hci_extend_cmd(padapter, &pcmd[3], cmdlen, hci_OCF); + break; + default: + DBG_871X("Other OGF: %x\n",hci_OGF); + break; + } +} + +u16 rtw_btcoex_parse_recv_data(u8 *msg, u8 msg_size) +{ + u8 cmp_msg1[128] = attend_ack; + u8 cmp_msg2[128] = leave_ack; + u8 cmp_msg3[128] = bt_leave; + u8 cmp_msg4[128] = invite_req; + //u8 btinfonotifycmd[2] = {0x06,0x01}; + u8 res = OTHER; + + if(_rtw_memcmp(cmp_msg1,msg,msg_size) == _TRUE) + { + DBG_871X("%s, msg:%s\n",__func__,msg); + res = RX_ATTEND_ACK; + } + else if(_rtw_memcmp(cmp_msg2,msg,msg_size) == _TRUE) + { + DBG_871X("%s, msg:%s\n",__func__,msg); + res = RX_LEAVE_ACK; + } + else if(_rtw_memcmp(cmp_msg3,msg,msg_size) == _TRUE) + { + DBG_871X("%s, msg:%s\n",__func__,msg); + res = RX_BT_LEAVE; + } + else if(_rtw_memcmp(cmp_msg4,msg,msg_size) == _TRUE) + { + DBG_871X("%s, msg:%s\n",__func__,msg); + res = RX_INVITE_REQ; + } +#if 0 + else if (_rtw_memcmp(btinfonotifycmd,msg,sizeof(btinfonotifycmd)) + { + DBG_871X("%s, OCF:%02x%02x\n",__func__,msg[0],msg[1]); + DBG_871X("%s, msg:BT_INFO_NOTIFY_CMD\n",__func__); + res = BT_INFO_NOTIFY_CMD; + } +#endif + else + { + DBG_871X("%s, OGF|OCF:%02x%02x\n",__func__,msg[1],msg[0]); + res = OTHER; + } + + DBG_871X("%s, res:%d\n",__func__,res); + + return res; +} + +void rtw_btcoex_recvmsgbynetlink(struct sk_buff *skb) { + struct nlmsghdr *nlh; + u32 msg_size; + u8 msg[255]={0}; + u8 rsp_msg[255] = invite_rsp; + u8 ack_msg[255] = leave_ack; + u8 res = 0; + u16 parse_res = 0; + u8 is_invite; + struct bt_coex_info *pcoex_info = &pbtcoexadapter->coex_info; + + + DBG_871X("Entering: %s\n", __FUNCTION__); + DBG_871X("========> pbtcoexadapter: %p\n",pbtcoexadapter); + + _rtw_memset(msg,0,sizeof(msg)); + nlh=(struct nlmsghdr*)skb->data; + DBG_871X("Netlink received msg payload:%s\n",(char*)nlmsg_data(nlh)); + + pcoex_info->pid = nlh->nlmsg_pid; /*pid of sending process */ + msg_size = sizeof(msg); + _rtw_memcpy(msg,NLMSG_DATA(nlh),strlen(NLMSG_DATA(nlh))); + DBG_871X("Message: %s,size: %d\n",msg,msg_size); + parse_res = rtw_btcoex_parse_recv_data(msg,strlen(msg)); + DBG_871X("parse_res: %d\n",parse_res); + DBG_871X("================> PID: %d\n", pcoex_info->pid); + + if(RX_INVITE_REQ == parse_res) + { + + is_invite = _TRUE; + res = rtw_btcoex_create_kernel_socket(pbtcoexadapter,is_invite); + if(_SUCCESS == res) + { + //res = sendmsgbynetlink(pbtcoexadapter, rsp_msg, sizeof(rsp_msg)); //inform BT to close netlink socket + res = rtw_btcoex_sendmsgbysocket(pbtcoexadapter, rsp_msg, sizeof(rsp_msg)); //inform BT to close netlink socket + if(res >= 0) + { + pcoex_info->BT_attend = _TRUE; + DBG_871X("sock_open:%d, BT_attend:%d\n",pcoex_info->sock_open,pcoex_info->BT_attend); + //if(pcoex_info->BT_attend == _TRUE) + //{ + // must send + //sendmsgbysocket(pbtcoexadapter,"hello, this is wifi!!",sizeof("hello, this is wifi!!")); + //msleep(20); + //} + } + else + DBG_871X("sendmsgbynetlink fail!!\n"); + } + } +#if 0 + else if(RX_BT_LEAVE == parse_res) + { + res = sendmsgbynetlink(pbtcoexadapter, ack_msg, sizeof(ack_msg));// Tx leave_ack; + pcoex_info->BT_attend = _FALSE; + close_kernel_socket(pbtcoexadapter); + DBG_871X("sock_open:%d, BT_attend:%d\n",pcoex_info->sock_open,pcoex_info->BT_attend); + } +#endif + else + { + DBG_871X("Error msg\n"); + } +} + +s8 rtw_btcoex_sendmsgbynetlink(_adapter *padapter, u8 *msg, u8 msg_size) +{ + struct nlmsghdr *nlh; + struct sk_buff *skb_out; + struct bt_coex_info *pcoex_info = &padapter->coex_info; + + u8 res = 0; + DBG_871X("%s\n", __FUNCTION__); + DBG_871X("========> padapter: %p\n",padapter); + DBG_871X("Message: %s,size: %d\n",msg,msg_size); + + skb_out = nlmsg_new(msg_size,0); + if(!skb_out) + { + + DBG_871X("Failed to allocate new skb\n"); + return -1; + + } + + nlh=nlmsg_put(skb_out,0,0,NLMSG_DONE,msg_size,0); + NETLINK_CB(skb_out).dst_group = 0; /* not in mcast group */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)) + NETLINK_CB(skb_out).portid = 0; +#else + NETLINK_CB(skb_out).pid = 0; +#endif + _rtw_memcpy(nlmsg_data(nlh),msg,msg_size); + + DBG_871X("===> send\n"); + if(pcoex_info->nl_sk) + { + res=netlink_unicast(pcoex_info->nl_sk, skb_out, pcoex_info->pid, MSG_WAITALL); + msleep(100); + } + DBG_871X("send <===\n"); + + if(res<0){ + //netlink_is_kernel(sk); + DBG_871X("pid:%d\n",pcoex_info->pid); + DBG_871X("%s, Error %d\n",__func__,res); + } + return res; + +} + +void rtw_btcoex_recvmsgbysocket(struct sock *sk, sint bytes){ + u8 recv_data[255]; + u8 tx_msg[255] = leave_ack; + u32 len = 0; + + u16 recv_length; + u16 parse_res = 0; +#if 0 + u8 para_len = 0, polling_enable = 0, poling_interval = 0, reason = 0, btinfo_len = 0; + u8 btinfo[BT_INFO_LEN] = {0}; +#endif + struct bt_coex_info *pcoex_info = &pbtcoexadapter->coex_info; + struct sk_buff * skb; + + DBG_871X("%s\n",__func__); + DBG_871X("========> pbtcoexadapter: %p\n",pbtcoexadapter); + + if(_TRUE == pcoex_info->BT_attend) + { + len = skb_queue_len(&sk->sk_receive_queue); + DBG_871X("skb queue len %i\n",len); + while(len > 0){ + skb = skb_dequeue(&sk->sk_receive_queue); + + /*important: cut the udp header from skb->data! + header length is 8 byte*/ + recv_length = skb->len-8; + _rtw_memset(recv_data,0,sizeof(recv_data)); + _rtw_memcpy(recv_data, skb->data+8, recv_length); + + DBG_871X("received data: %s :with len %u\n",recv_data, skb->len); + parse_res = rtw_btcoex_parse_recv_data(recv_data,recv_length); + DBG_871X("parse_res; %d\n",parse_res); + if(RX_ATTEND_ACK == parse_res) //attend ack + { + pcoex_info ->BT_attend = _TRUE; + DBG_871X("sock_open:%d, BT_attend:%d\n",pcoex_info ->sock_open,pcoex_info ->BT_attend); + + } + else if (RX_LEAVE_ACK == parse_res) //mean BT know wifi will leave + { + pcoex_info ->BT_attend = _FALSE; + DBG_871X("sock_open:%d, BT_attend:%d\n",pcoex_info ->sock_open,pcoex_info ->BT_attend); + + } + else if(RX_BT_LEAVE == parse_res) //BT leave + { + rtw_btcoex_sendmsgbysocket(pbtcoexadapter, tx_msg,sizeof(tx_msg)); // no ack + pcoex_info ->BT_attend = _FALSE; + //rtw_btcoex_close_kernel_socket(pbtcoexadapter); //Don't close or it will case soft lock + DBG_871X("sock_open:%d, BT_attend:%d\n",pcoex_info ->sock_open,pcoex_info ->BT_attend); + } +#if 0 + else if(BT_INFO_NOTIFY_CMD == parse_res) + { + para_len = recv_data[2]; + polling_enable = recv_data[3]; + poling_interval = recv_data[4]; + reason = recv_data[5]; + btinfo_len = recv_data[6]; + if(btinfo_len != BT_INFO_LEN) + { + DBG_871X("%s: Error BT info length: %d\n",__func__,btinfo_len); + } + else + { + DBG_871X("para_len: %d\n",para_len); + DBG_871X("polling_enable: %d\n",polling_enable); + DBG_871X("poling_interval: %d\n",poling_interval); + DBG_871X("reason: %d\n",reason); + DBG_871X("btinfo_len: %d\n",btinfo_len); + _rtw_memcpy(btinfo, &recv_data[7], btinfo_len); + if(coex_info ->BT_attend == _TRUE) + { + rtw_btinfo_cmd(pbtcoexadapter,btinfo,btinfo_len); + } + +} + + } +#endif + else//todo: check if recv data are really hci cmds + { + rtw_btcoex_parse_hci_cmd(pbtcoexadapter,recv_data,recv_length); + if(pcoex_info ->BT_attend == _TRUE) + { + //sendmsgbysocket("hello, this is wifi 1111!!",sizeof("hello, this is wifi 1111!!")); + //msleep(20); + } + } + len--; + kfree_skb(skb); + /*never do a sleep in this context!*/ + } + } +} + + +u8 rtw_btcoex_sendmsgbysocket(_adapter *padapter, u8 *msg, u8 msg_size) +{ + u8 error; + struct msghdr udpmsg; + mm_segment_t oldfs; + struct iovec iov; + struct bt_coex_info *pcoex_info = &padapter->coex_info; + + if(_TRUE == pcoex_info->BT_attend) + { + DBG_871X("%s msg:%s\n", __FUNCTION__,msg); + DBG_871X("========> Padapter: %p\n",padapter); + + iov.iov_base = (void *)msg; + iov.iov_len = msg_size; + udpmsg.msg_name = &pcoex_info->sin; + udpmsg.msg_namelen = sizeof(struct sockaddr_in); + udpmsg.msg_iov = &iov; + udpmsg.msg_iovlen = 1; + udpmsg.msg_control = NULL; + udpmsg.msg_controllen = 0; + udpmsg.msg_flags = MSG_DONTWAIT | MSG_NOSIGNAL; + oldfs = get_fs(); + set_fs(KERNEL_DS); + error = sock_sendmsg(pcoex_info->udpsock, &udpmsg, msg_size); + //rtw_msleep_os(20); + set_fs(oldfs); + if(error < 0) + { + DBG_871X("Error when sendimg msg, error:%d\n",error); + return _FAIL; + } + else + return _SUCCESS; + } + else + { + DBG_871X("Tx error: BT isn't up\n"); + return _FAIL; + } + +} + +void rtw_btcoex_create_nl_socket(_adapter *padapter) +{ + struct bt_coex_info *pcoex_info = &padapter->coex_info; +#if(LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) + struct netlink_kernel_cfg nl_cfg = { + .groups = 0, + .input = rtw_btcoex_recvmsgbynetlink, + .cb_mutex = NULL, + }; + pcoex_info->pnl_cfg = &nl_cfg; +#endif + + DBG_871X("%s\n",__func__); + +#if (LINUX_VERSION_CODE <= KERNEL_VERSION(3,5,0)) + pcoex_info->nl_sk = netlink_kernel_create(&init_net, NETLINK_USER, 0, rtw_btcoex_recvmsgbynetlink, NULL,THIS_MODULE); +#elif(LINUX_VERSION_CODE == KERNEL_VERSION(3,6,0)) + pcoex_info->nl_sk = netlink_kernel_create(&init_net, NETLINK_USER, THIS_MODULE, &nl_cfg); +#elif(LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)) + pcoex_info->nl_sk = netlink_kernel_create(&init_net, NETLINK_USER, &nl_cfg); +#endif + + if(!pcoex_info->nl_sk) + { + DBG_871X("Error creating netlink socket.\n"); + return ; + } + else + { + DBG_871X("Creating netlink socket successfully.\n"); + pcoex_info->sock_open |= NETLINK_SOCKET_OK; + } +} + +u8 rtw_btcoex_create_kernel_socket(_adapter *padapter, u8 is_invite) +{ + s8 kernel_socket_err; + u8 tx_msg[255] = attend_req; + struct bt_coex_info *pcoex_info = &padapter->coex_info; + DBG_871X("%s CONNECT_PORT %d\n",__func__,CONNECT_PORT); + DBG_871X("========> Padapter: %p\n",padapter); + + if(NULL == pcoex_info) + { + DBG_871X("coex_info: NULL\n"); + return _FAIL; + } + + kernel_socket_err = sock_create(PF_INET, SOCK_DGRAM, 0, &pcoex_info->udpsock); + + if (kernel_socket_err<0) + { + DBG_871X("Error during creation of socket error:%d\n",kernel_socket_err); + return _FAIL; + + } + else + { + _rtw_memset(&(pcoex_info->sin), 0, sizeof(pcoex_info->sin)); + pcoex_info->sin.sin_family = AF_INET; + pcoex_info->sin.sin_port = htons(CONNECT_PORT); + pcoex_info->sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + + kernel_socket_err = pcoex_info->udpsock->ops->bind(pcoex_info->udpsock,(struct sockaddr *)&pcoex_info->sin,sizeof(pcoex_info->sin)); + + // there is one process using this IP(127.0.0.1), means BT is on. + if(kernel_socket_err == -98){ + DBG_871X("binding socket success\n"); + pcoex_info->udpsock->sk->sk_data_ready = rtw_btcoex_recvmsgbysocket; + pcoex_info->sock_open |= KERNEL_SOCKET_OK; + pcoex_info->BT_attend = _TRUE; + + if(is_invite != _TRUE) // attend req + rtw_btcoex_sendmsgbysocket(padapter,tx_msg,sizeof(tx_msg)); + + return _SUCCESS; + } + else + { + pcoex_info->BT_attend = _FALSE; + sock_release(pcoex_info->udpsock); // bind fail release socket + DBG_871X("Error binding socket: %d\n",kernel_socket_err); + return _FAIL; + } + + } +} + +void rtw_btcoex_close_nl_socket(_adapter *padapter) +{ + struct bt_coex_info *pcoex_info = &padapter->coex_info; + if(pcoex_info->sock_open & NETLINK_SOCKET_OK) + { + DBG_871X("release netlink socket\n"); + netlink_kernel_release(pcoex_info->nl_sk); + pcoex_info->sock_open &= ~(NETLINK_SOCKET_OK); + if(_TRUE == pcoex_info->BT_attend) + pcoex_info->BT_attend = _FALSE; + + DBG_871X("sock_open:%d, BT_attend:%d\n",pcoex_info ->sock_open,pcoex_info ->BT_attend); + } +} + +void rtw_btcoex_close_kernel_socket(_adapter *padapter) +{ + struct bt_coex_info *pcoex_info = &padapter->coex_info; + if(pcoex_info->sock_open & KERNEL_SOCKET_OK) + { + DBG_871X("release kernel socket\n"); + sock_release(pcoex_info->udpsock); + pcoex_info->sock_open &= ~(KERNEL_SOCKET_OK); + if(_TRUE == pcoex_info->BT_attend) + pcoex_info->BT_attend = _FALSE; + + DBG_871X("sock_open:%d, BT_attend:%d\n",pcoex_info ->sock_open,pcoex_info ->BT_attend); + } +} + +void rtw_btcoex_init_socket(_adapter *padapter) +{ + + u8 is_invite = _FALSE; + struct bt_coex_info *pcoex_info = &padapter->coex_info; + DBG_871X("========> Padapter: %p\n",padapter); + + if(_FALSE == pcoex_info->is_exist) + { + _rtw_memset(pcoex_info,0,sizeof(struct bt_coex_info)); + pbtcoexadapter = padapter; + rtw_btcoex_create_nl_socket(padapter); + rtw_btcoex_create_kernel_socket(padapter,is_invite); + pcoex_info->is_exist = _TRUE; + DBG_871X("========> coex_info->is_exist: %d\n",pcoex_info->is_exist); + DBG_871X("========> pbtcoexadapter: %p\n",pbtcoexadapter); + } +} + +void rtw_btcoex_close_socket(_adapter *padapter) +{ + u8 msg[255] = wifi_leave; + struct bt_coex_info *pcoex_info = &padapter->coex_info; + DBG_871X("========> coex_info->is_exist: %d\n",pcoex_info->is_exist); + if( _TRUE == pcoex_info->is_exist) + { + if(pcoex_info->BT_attend == _TRUE) //inform BT wifi leave + { + rtw_btcoex_sendmsgbysocket(padapter,msg,sizeof(msg)); + msleep(50); + } + rtw_btcoex_close_nl_socket(padapter); + rtw_btcoex_close_kernel_socket(padapter); + pbtcoexadapter = NULL; + pcoex_info->is_exist = _FALSE; + } +} + +void rtw_btcoex_dump_tx_msg(u8 *tx_msg, u8 len, u8 *msg_name) +{ + u8 i = 0; + DBG_871X("======> Msg name: %s\n",msg_name); + for(i=0;iEventCode = HCI_EVENT_EXTENSION_RTK; + pEvent->Data[0] = HCI_EVENT_EXT_BT_COEX_CONTROL; //extension event code + len ++; + + // Return parameters starts from here + pRetPar = &pEvent->Data[len]; + _rtw_memcpy(&pRetPar[0], pData, dataLen); + + len += dataLen; + + pEvent->Length = len; + + //total tx event length + EventCode length + sizeof(length) + tx_event_length = pEvent->Length + 2; + + rtw_btcoex_dump_tx_msg((u8 *)pEvent, tx_event_length, "BT COEX CONTROL"); + + rtw_btcoex_sendmsgbysocket(padapter,(u8 *)pEvent, tx_event_length); + +} + +/* Porting from Windows team */ +void rtw_btcoex_SendEventExtBtInfoControl(PADAPTER padapter, u8 dataLen, void *pData) +{ + rtw_HCI_event *pEvent; + u8 *pRetPar; + u8 len=0, tx_event_length = 0; + u8 localBuf[32] = ""; + + struct bt_coex_info *pcoex_info = &padapter->coex_info; + PBT_MGNT pBtMgnt = &pcoex_info->BtMgnt; + + DBG_871X("%s\n",__func__); + if(pBtMgnt->ExtConfig.HCIExtensionVer < 4) //not support + { + DBG_871X("ERROR: HCIExtensionVer = %d, HCIExtensionVer<4 !!!!\n",pBtMgnt->ExtConfig.HCIExtensionVer); + return; + } + + pEvent = (rtw_HCI_event *)(&localBuf[0]); + + //len += bthci_ExtensionEventHeaderRtk(&localBuf[0], + // HCI_EVENT_EXT_BT_INFO_CONTROL); + pEvent->EventCode = HCI_EVENT_EXTENSION_RTK; + pEvent->Data[0] = HCI_EVENT_EXT_BT_INFO_CONTROL; //extension event code + len ++; + + // Return parameters starts from here + pRetPar = &pEvent->Data[len]; + _rtw_memcpy(&pRetPar[0], pData, dataLen); + + len += dataLen; + + pEvent->Length = len; + + //total tx event length + EventCode length + sizeof(length) + tx_event_length = pEvent->Length + 2; + + rtw_btcoex_dump_tx_msg((u8 *)pEvent, tx_event_length, "BT INFO CONTROL"); + + rtw_btcoex_sendmsgbysocket(padapter,(u8 *)pEvent, tx_event_length); + +} + +void rtw_btcoex_SendScanNotify(PADAPTER padapter, u8 scanType) +{ + u8 len=0, tx_event_length=0; + u8 localBuf[7] = ""; + u8 *pRetPar; + u8 *pu1Temp; + rtw_HCI_event *pEvent; + struct bt_coex_info *pcoex_info = &padapter->coex_info; + PBT_MGNT pBtMgnt = &pcoex_info->BtMgnt; + +// if(!pBtMgnt->BtOperationOn) +// return; + + pEvent = (rtw_HCI_event *)(&localBuf[0]); + +// len += bthci_ExtensionEventHeaderRtk(&localBuf[0], +// HCI_EVENT_EXT_WIFI_SCAN_NOTIFY); + + pEvent->EventCode = HCI_EVENT_EXTENSION_RTK; + pEvent->Data[0] = HCI_EVENT_EXT_WIFI_SCAN_NOTIFY; //extension event code + len ++; + + // Return parameters starts from here + //pRetPar = &PPacketIrpEvent->Data[len]; + //pu1Temp = (u8 *)&pRetPar[0]; + //*pu1Temp = scanType; + pEvent->Data[len] = scanType; + len += 1; + + pEvent->Length = len; + + //total tx event length + EventCode length + sizeof(length) + tx_event_length = pEvent->Length + 2; + + rtw_btcoex_dump_tx_msg((u8 *)pEvent, tx_event_length, "WIFI SCAN OPERATION"); + + rtw_btcoex_sendmsgbysocket(padapter, (u8 *)pEvent, tx_event_length); +} +#endif //CONFIG_BT_COEXIST_SOCKET_TRX #endif // CONFIG_BT_COEXIST diff --git a/backports/drivers/realtek/rtl8812au/core/rtw_cmd.c b/backports/drivers/realtek/rtl8812au/core/rtw_cmd.c index 30832f85f656bb..418d0664cd5a94 100755 --- a/backports/drivers/realtek/rtl8812au/core/rtw_cmd.c +++ b/backports/drivers/realtek/rtl8812au/core/rtw_cmd.c @@ -20,7 +20,6 @@ #define _RTW_CMD_C_ #include - /* Caller and the rtw_cmd_thread can protect cmd_q by spin_lock. No irqsave is necessary. @@ -209,6 +208,9 @@ since only spin_lock is used. ISR/Call-Back functions can't call this sub-function. */ +#ifdef DBG_CMD_QUEUE +extern u8 dump_cmd_id; +#endif sint _rtw_enqueue_cmd(_queue *queue, struct cmd_obj *obj) { @@ -219,11 +221,52 @@ _func_enter_; if (obj == NULL) goto exit; + if(obj->cmdsz > MAX_CMDSZ ){ + DBG_871X("%s failed due to obj->cmdsz(%d) > MAX_CMDSZ(%d) \n",__FUNCTION__, obj->cmdsz,MAX_CMDSZ); + goto exit; + } //_enter_critical_bh(&queue->lock, &irqL); _enter_critical(&queue->lock, &irqL); rtw_list_insert_tail(&obj->list, &queue->queue); + #ifdef DBG_CMD_QUEUE + if(dump_cmd_id){ + printk("%s===> cmdcode:0x%02x\n",__FUNCTION__,obj->cmdcode); + if(obj->cmdcode == GEN_CMD_CODE(_Set_MLME_EVT)){ + if(obj->parmbuf){ + struct C2HEvent_Header *pc2h_evt_hdr = (struct C2HEvent_Header *)(obj->parmbuf); + printk("pc2h_evt_hdr->ID:0x%02x(%d)\n",pc2h_evt_hdr->ID,pc2h_evt_hdr->ID); + } + } + if(obj->cmdcode == GEN_CMD_CODE(_Set_Drv_Extra)){ + if(obj->parmbuf){ + struct drvextra_cmd_parm *pdrvextra_cmd_parm =(struct drvextra_cmd_parm*)(obj->parmbuf); + printk("pdrvextra_cmd_parm->ec_id:0x%02x\n",pdrvextra_cmd_parm->ec_id); + } + } + } + + if (queue->queue.prev->next != &queue->queue) + { + DBG_871X("[%d] head %p, tail %p, tail->prev->next %p[tail], tail->next %p[head]\n", __LINE__, + &queue->queue, queue->queue.prev, queue->queue.prev->prev->next, queue->queue.prev->next); + + DBG_871X("==========%s============\n",__FUNCTION__); + DBG_871X("head:%p,obj_addr:%p\n",&queue->queue,obj); + DBG_871X("padapter: %p\n",obj->padapter); + DBG_871X("cmdcode: 0x%02x\n",obj->cmdcode); + DBG_871X("res: %d\n",obj->res); + DBG_871X("parmbuf: %p\n",obj->parmbuf); + DBG_871X("cmdsz: %d\n",obj->cmdsz); + DBG_871X("rsp: %p\n",obj->rsp); + DBG_871X("rspsz: %d\n",obj->rspsz); + DBG_871X("sctx: %p\n",obj->sctx); + DBG_871X("list->next: %p\n",obj->list.next); + DBG_871X("list->prev: %p\n",obj->list.prev); + } + #endif //DBG_CMD_QUEUE + //_exit_critical_bh(&queue->lock, &irqL); _exit_critical(&queue->lock, &irqL); @@ -243,11 +286,51 @@ _func_enter_; //_enter_critical_bh(&(queue->lock), &irqL); _enter_critical(&queue->lock, &irqL); - if (rtw_is_list_empty(&(queue->queue))) + + #ifdef DBG_CMD_QUEUE + if (queue->queue.prev->next != &queue->queue) + { + DBG_871X("[%d] head %p, tail %p, tail->prev->next %p[tail], tail->next %p[head]\n", __LINE__, + &queue->queue, queue->queue.prev, queue->queue.prev->prev->next, queue->queue.prev->next); + } + #endif //DBG_CMD_QUEUE + + + if (rtw_is_list_empty(&(queue->queue))){ obj = NULL; + } else { obj = LIST_CONTAINOR(get_next(&(queue->queue)), struct cmd_obj, list); + + #ifdef DBG_CMD_QUEUE + if (queue->queue.prev->next != &queue->queue){ + DBG_871X("==========%s============\n",__FUNCTION__); + DBG_871X("head:%p,obj_addr:%p\n",&queue->queue,obj); + DBG_871X("padapter: %p\n",obj->padapter); + DBG_871X("cmdcode: 0x%02x\n",obj->cmdcode); + DBG_871X("res: %d\n",obj->res); + DBG_871X("parmbuf: %p\n",obj->parmbuf); + DBG_871X("cmdsz: %d\n",obj->cmdsz); + DBG_871X("rsp: %p\n",obj->rsp); + DBG_871X("rspsz: %d\n",obj->rspsz); + DBG_871X("sctx: %p\n",obj->sctx); + DBG_871X("list->next: %p\n",obj->list.next); + DBG_871X("list->prev: %p\n",obj->list.prev); + } + + if(dump_cmd_id){ + DBG_871X("%s===> cmdcode:0x%02x\n",__FUNCTION__,obj->cmdcode); + if(obj->cmdcode == GEN_CMD_CODE(_Set_Drv_Extra)){ + if(obj->parmbuf){ + struct drvextra_cmd_parm *pdrvextra_cmd_parm =(struct drvextra_cmd_parm*)(obj->parmbuf); + printk("pdrvextra_cmd_parm->ec_id:0x%02x\n",pdrvextra_cmd_parm->ec_id); + } + } + + } + #endif //DBG_CMD_QUEUE + rtw_list_delete(&obj->list); } @@ -330,7 +413,7 @@ int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj) bAllow = _TRUE; if( (pcmdpriv->padapter->hw_init_completed ==_FALSE && bAllow == _FALSE) - || pcmdpriv->cmdthd_running== _FALSE //com_thread not running + || ATOMIC_READ(&(pcmdpriv->cmdthd_running)) == _FALSE //com_thread not running ) { //DBG_871X("%s:%s: drop cmdcode:%u, hw_init_completed:%u, cmdthd_running:%u\n", caller_func, __FUNCTION__, @@ -404,14 +487,16 @@ _func_exit_; void rtw_free_cmd_obj(struct cmd_obj *pcmd) { + struct drvextra_cmd_parm *extra_parm = NULL; _func_enter_; - if((pcmd->cmdcode!=_JoinBss_CMD_) &&(pcmd->cmdcode!= _CreateBss_CMD_)) - { - //free parmbuf in cmd_obj - rtw_mfree((unsigned char*)pcmd->parmbuf, pcmd->cmdsz); - } - + if(pcmd->parmbuf != NULL){ + if((pcmd->cmdcode!=_JoinBss_CMD_) &&(pcmd->cmdcode!= _CreateBss_CMD_)) + { + //free parmbuf in cmd_obj + rtw_mfree((unsigned char*)pcmd->parmbuf, pcmd->cmdsz); + } + } if(pcmd->rsp!=NULL) { if(pcmd->rspsz!= 0) @@ -430,8 +515,9 @@ _func_exit_; void rtw_stop_cmd_thread(_adapter *adapter) { - if(adapter->cmdThread && adapter->cmdpriv.cmdthd_running == _TRUE - && adapter->cmdpriv.stop_req == 0) + if(adapter->cmdThread && + ATOMIC_READ(&(adapter->cmdpriv.cmdthd_running)) == _TRUE && + adapter->cmdpriv.stop_req == 0) { adapter->cmdpriv.stop_req = 1; _rtw_up_sema(&adapter->cmdpriv.cmd_queue_sema); @@ -451,7 +537,7 @@ thread_return rtw_cmd_thread(thread_context context) PADAPTER padapter = (PADAPTER)context; struct cmd_priv *pcmdpriv = &(padapter->cmdpriv); struct drvextra_cmd_parm *extra_parm = NULL; - + _irqL irqL; _func_enter_; thread_enter("RTW_CMD_THREAD"); @@ -460,7 +546,7 @@ _func_enter_; prspbuf = pcmdpriv->rsp_buf; pcmdpriv->stop_req = 0; - pcmdpriv->cmdthd_running=_TRUE; + ATOMIC_SET(&(pcmdpriv->cmdthd_running), _TRUE); _rtw_up_sema(&pcmdpriv->terminate_cmdthread_sema); RT_TRACE(_module_rtl871x_cmd_c_,_drv_info_,("start r871x rtw_cmd_thread !!!!\n")); @@ -484,11 +570,14 @@ _func_enter_; break; } + _enter_critical(&pcmdpriv->cmd_queue.lock, &irqL); if(rtw_is_list_empty(&(pcmdpriv->cmd_queue.queue))) { //DBG_871X("%s: cmd queue is empty!\n", __func__); + _exit_critical(&pcmdpriv->cmd_queue.lock, &irqL); continue; } + _exit_critical(&pcmdpriv->cmd_queue.lock, &irqL); #ifdef CONFIG_LPS_LCLK if (rtw_register_cmd_alive(padapter) != _SUCCESS) @@ -519,6 +608,11 @@ _func_enter_; if( _FAIL == rtw_cmd_filter(pcmdpriv, pcmd) ) { pcmd->res = H2C_DROPPED; + if (pcmd->cmdcode == GEN_CMD_CODE(_Set_Drv_Extra)) { + extra_parm = (struct drvextra_cmd_parm *)pcmd->parmbuf; + if (extra_parm && extra_parm->pbuf && extra_parm->size > 0) + rtw_mfree(extra_parm->pbuf, extra_parm->size); + } goto post_process; } @@ -526,6 +620,10 @@ _func_enter_; pcmd->cmdsz = _RND4((pcmd->cmdsz));//_RND4 + if(pcmd->cmdsz > MAX_CMDSZ ){ + DBG_871X("%s cmdsz:%d > MAX_CMDSZ:%d\n",__FUNCTION__,pcmd->cmdsz,MAX_CMDSZ); + } + _rtw_memcpy(pcmdbuf, pcmd->parmbuf, pcmd->cmdsz); if(pcmd->cmdcode < (sizeof(wlancmds) /sizeof(struct cmd_hdl))) @@ -552,8 +650,8 @@ _func_enter_; _enter_critical_mutex(&(pcmd->padapter->cmdpriv.sctx_mutex), NULL); if (pcmd->sctx) { if (0) - DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" pcmd->sctx\n", - FUNC_ADPT_ARG(pcmd->padapter)); + DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" pcmd->sctx\n", + FUNC_ADPT_ARG(pcmd->padapter)); if (pcmd->res == H2C_SUCCESS) rtw_sctx_done(&pcmd->sctx); else @@ -582,7 +680,7 @@ _func_enter_; } //call callback function for post-processed - if(pcmd->cmdcode <= (sizeof(rtw_cmd_callback) /sizeof(struct _cmd_callback))) + if(pcmd->cmdcode < (sizeof(rtw_cmd_callback) /sizeof(struct _cmd_callback))) { pcmd_callback = rtw_cmd_callback[pcmd->cmdcode].callback; if(pcmd_callback == NULL) @@ -607,8 +705,6 @@ _func_enter_; goto _next; } - pcmdpriv->cmdthd_running=_FALSE; - // free all cmd_obj resources do{ @@ -619,7 +715,6 @@ _func_enter_; #endif break; } - //DBG_871X("%s: leaving... drop cmdcode:%u size:%d\n", __FUNCTION__, pcmd->cmdcode, pcmd->cmdsz); if (pcmd->cmdcode == GEN_CMD_CODE(_Set_Drv_Extra)) { @@ -633,6 +728,7 @@ _func_enter_; }while(1); _rtw_up_sema(&pcmdpriv->terminate_cmdthread_sema); + ATOMIC_SET(&(pcmdpriv->cmdthd_running), _FALSE); _func_exit_; @@ -815,8 +911,8 @@ _func_enter_; _rtw_memcpy(&psurveyPara->ssid[i], &ssid[i], sizeof(NDIS_802_11_SSID)); psurveyPara->ssid_num++; if (0) - DBG_871X(FUNC_ADPT_FMT" ssid:(%s, %d)\n", FUNC_ADPT_ARG(padapter), - psurveyPara->ssid[i].Ssid, psurveyPara->ssid[i].SsidLength); + DBG_871X(FUNC_ADPT_FMT" ssid:(%s, %d)\n", FUNC_ADPT_ARG(padapter), + psurveyPara->ssid[i].Ssid, psurveyPara->ssid[i].SsidLength); } } } @@ -829,8 +925,8 @@ _func_enter_; _rtw_memcpy(&psurveyPara->ch[i], &ch[i], sizeof(struct rtw_ieee80211_channel)); psurveyPara->ch_num++; if (0) - DBG_871X(FUNC_ADPT_FMT" ch:%u\n", FUNC_ADPT_ARG(padapter), - psurveyPara->ch[i].hw_value); + DBG_871X(FUNC_ADPT_FMT" ch:%u\n", FUNC_ADPT_ARG(padapter), + psurveyPara->ch[i].hw_value); } } } @@ -845,11 +941,16 @@ _func_enter_; #ifdef CONFIG_STA_MODE_SCAN_UNDER_AP_MODE if((padapter->pbuddy_adapter->mlmeextpriv.mlmext_info.state&0x03) == WIFI_FW_AP_STATE) - _set_timer(&pmlmepriv->scan_to_timer, SURVEY_TO * - ( padapter->mlmeextpriv.max_chan_nums + ( padapter->mlmeextpriv.max_chan_nums / RTW_SCAN_NUM_OF_CH ) * RTW_STAY_AP_CH_MILLISECOND ) + 1000 ); + { + if(IsSupported5G(padapter->registrypriv.wireless_mode) + && IsSupported24G(padapter->registrypriv.wireless_mode)) //dual band + mlme_set_scan_to_timer(pmlmepriv, CONC_SCANNING_TIMEOUT_DUAL_BAND); + else //single band + mlme_set_scan_to_timer(pmlmepriv, CONC_SCANNING_TIMEOUT_SINGLE_BAND); + } else #endif //CONFIG_STA_MODE_SCAN_UNDER_AP_MODE - _set_timer(&pmlmepriv->scan_to_timer, SCANNING_TIMEOUT); + mlme_set_scan_to_timer(pmlmepriv, SCANNING_TIMEOUT); rtw_led_control(padapter, LED_CTL_SITE_SURVEY); } else { @@ -1340,11 +1441,14 @@ _func_enter_; case Ndis802_11APMode: case Ndis802_11AutoUnknown: case Ndis802_11InfrastructureMax: + case Ndis802_11Monitor: break; } } + pmlmeinfo->assoc_AP_vendor = check_assoc_AP(pnetwork->network.IEs, pnetwork->network.IELength); + psecnetwork=(WLAN_BSSID_EX *)&psecuritypriv->sec_bss; if(psecnetwork==NULL) { @@ -1416,7 +1520,7 @@ _func_enter_; { rtw_ht_use_default_setting(padapter); - rtw_build_wmm_ie_ht(padapter, &psecnetwork->IEs[12], &psecnetwork->IELength); + rtw_build_wmm_ie_ht(padapter, &psecnetwork->IEs[0], &psecnetwork->IELength); //rtw_restructure_ht_ie rtw_restructure_ht_ie(padapter, &pnetwork->network.IEs[12], &psecnetwork->IEs[0], @@ -1437,8 +1541,6 @@ _func_enter_; #endif //CONFIG_80211N_HT - pmlmeinfo->assoc_AP_vendor = check_assoc_AP(pnetwork->network.IEs, pnetwork->network.IELength); - #if 0 psecuritypriv->supplicant_ie[0]=(u8)psecnetwork->IELength; @@ -1570,7 +1672,7 @@ _func_exit_; return res; } -u8 rtw_setstakey_cmd(_adapter *padapter, u8 *psta, u8 unicast_key, bool enqueue) +u8 rtw_setstakey_cmd(_adapter *padapter, struct sta_info *sta, u8 key_type, bool enqueue) { struct cmd_obj* ph2c; struct set_stakey_parm *psetstakey_para; @@ -1579,7 +1681,6 @@ u8 rtw_setstakey_cmd(_adapter *padapter, u8 *psta, u8 unicast_key, bool enqueue) struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct security_priv *psecuritypriv = &padapter->securitypriv; - struct sta_info* sta = (struct sta_info* )psta; u8 res=_SUCCESS; _func_enter_; @@ -1593,27 +1694,23 @@ _func_enter_; _rtw_memcpy(psetstakey_para->addr, sta->hwaddr,ETH_ALEN); if(check_fwstate(pmlmepriv, WIFI_STATION_STATE)){ -#ifdef CONFIG_TDLS - if(sta->tdls_sta_state&TDLS_LINKED_STATE) - psetstakey_para->algorithm=(u8)sta->dot118021XPrivacy; - else -#endif //CONFIG_TDLS psetstakey_para->algorithm =(unsigned char) psecuritypriv->dot11PrivacyAlgrthm; }else{ GET_ENCRY_ALGO(psecuritypriv, sta, psetstakey_para->algorithm, _FALSE); } - if (unicast_key == _TRUE) { + if (key_type == GROUP_KEY) { + _rtw_memcpy(&psetstakey_para->key, &psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey, 16); + } + else if (key_type == UNICAST_KEY) { + _rtw_memcpy(&psetstakey_para->key, &sta->dot118021x_UncstKey, 16); + } #ifdef CONFIG_TDLS - if((sta->tdls_sta_state&TDLS_LINKED_STATE)==TDLS_LINKED_STATE) + else if(key_type == TDLS_KEY){ _rtw_memcpy(&psetstakey_para->key, sta->tpk.tk, 16); - else -#endif //CONFIG_TDLS - _rtw_memcpy(&psetstakey_para->key, &sta->dot118021x_UncstKey, 16); - } - else { - _rtw_memcpy(&psetstakey_para->key, &psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey, 16); + psetstakey_para->algorithm=(u8)sta->dot118021XPrivacy; } +#endif /* CONFIG_TDLS */ //jeff: set this becasue at least sw key is ready padapter->securitypriv.busetkipkey=_TRUE; @@ -1651,7 +1748,7 @@ _func_exit_; return res; } -u8 rtw_clearstakey_cmd(_adapter *padapter, u8 *psta, u8 entry, u8 enqueue) +u8 rtw_clearstakey_cmd(_adapter *padapter, struct sta_info *sta, u8 enqueue) { struct cmd_obj* ph2c; struct set_stakey_parm *psetstakey_para; @@ -1659,14 +1756,18 @@ u8 rtw_clearstakey_cmd(_adapter *padapter, u8 *psta, u8 entry, u8 enqueue) struct set_stakey_rsp *psetstakey_rsp = NULL; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct security_priv *psecuritypriv = &padapter->securitypriv; - struct sta_info* sta = (struct sta_info* )psta; + s16 cam_id = 0; u8 res=_SUCCESS; _func_enter_; if(!enqueue) { - clear_cam_entry(padapter, entry); + while((cam_id = rtw_camid_search(padapter, sta->hwaddr, -1)) >= 0) { + DBG_871X_LEVEL(_drv_always_, "clear key for addr:"MAC_FMT", camid:%d\n", MAC_ARG(sta->hwaddr), cam_id); + clear_cam_entry(padapter, cam_id); + rtw_camid_free(padapter, cam_id); + } } else { @@ -1698,8 +1799,6 @@ _func_enter_; _rtw_memcpy(psetstakey_para->addr, sta->hwaddr, ETH_ALEN); psetstakey_para->algorithm = _NO_PRIVACY_; - - psetstakey_para->id = entry; res = rtw_enqueue_cmd(pcmdpriv, ph2c); @@ -2103,15 +2202,11 @@ _func_enter_; else { //no need to enqueue, do the cmd hdl directly and free cmd parameter - if( H2C_SUCCESS !=set_chplan_hdl(padapter, (unsigned char *)setChannelPlan_param) ) + if( H2C_SUCCESS != set_chplan_hdl(padapter, (unsigned char *)setChannelPlan_param) ) res = _FAIL; rtw_mfree((u8 *)setChannelPlan_param, sizeof(struct SetChannelPlan_param)); } - - //do something based on res... - if(res == _SUCCESS) - padapter->mlmepriv.ChannelPlan = chplan; exit: @@ -2224,7 +2319,8 @@ _func_enter_; } _rtw_spinlock(&(padapter->tdlsinfo.cmd_lock)); - _rtw_memcpy(TDLSoption->addr, addr, 6); + if (addr != NULL) + _rtw_memcpy(TDLSoption->addr, addr, 6); TDLSoption->option = option; _rtw_spinunlock(&(padapter->tdlsinfo.cmd_lock)); init_h2fwcmd_w_parm_no_rsp(pcmdobj, TDLSoption, GEN_CMD_CODE(_TDLS)); @@ -2285,10 +2381,18 @@ static void collect_traffic_statistics(_adapter *padapter) pdvobjpriv->traffic_stat.cur_rx_tp = (u32)(pdvobjpriv->traffic_stat.cur_rx_bytes *8/2/1024/1024); } +//from_timer == 1 means driver is in LPS u8 traffic_status_watchdog(_adapter *padapter, u8 from_timer) { u8 bEnterPS = _FALSE; - u16 BusyThreshold = 100; +#ifdef CONFIG_BT_COEXIST + u16 BusyThresholdHigh = 25; + u16 BusyThresholdLow = 10; +#else + u16 BusyThresholdHigh = 100; + u16 BusyThresholdLow = 75; +#endif + u16 BusyThreshold = BusyThresholdHigh; u8 bBusyTraffic = _FALSE, bTxBusyTraffic = _FALSE, bRxBusyTraffic = _FALSE; u8 bHigherBusyTraffic = _FALSE, bHigherBusyRxTraffic = _FALSE, bHigherBusyTxTraffic = _FALSE; @@ -2309,16 +2413,12 @@ u8 traffic_status_watchdog(_adapter *padapter, u8 from_timer) if((check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE) /*&& !MgntInitAdapterInProgress(pMgntInfo)*/) { -#ifdef CONFIG_BT_COEXIST - if( pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 25 || - pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > 25 ) -#else // !CONFIG_BT_COEXIST // if we raise bBusyTraffic in last watchdog, using lower threshold. if (pmlmepriv->LinkDetectInfo.bBusyTraffic) - BusyThreshold = 75; + BusyThreshold = BusyThresholdLow; + if( pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > BusyThreshold || pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > BusyThreshold ) -#endif // !CONFIG_BT_COEXIST { bBusyTraffic = _TRUE; @@ -2360,8 +2460,8 @@ u8 traffic_status_watchdog(_adapter *padapter, u8 from_timer) #ifdef CONFIG_TDLS #ifdef CONFIG_TDLS_AUTOSETUP - if( ( ptdlsinfo->watchdog_count % TDLS_WATCHDOG_PERIOD ) == 0 ) //10 * 2sec, periodically sending - { + /* TDLS_WATCHDOG_PERIOD * 2sec, periodically send */ + if ((ptdlsinfo->watchdog_count % TDLS_WATCHDOG_PERIOD ) == 0) { _rtw_memcpy(txmgmt.peer, baddr, ETH_ALEN); issue_tdls_dis_req( padapter, &txmgmt ); } @@ -2372,11 +2472,19 @@ u8 traffic_status_watchdog(_adapter *padapter, u8 from_timer) #ifdef CONFIG_LPS // check traffic for powersaving. if( ((pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod + pmlmepriv->LinkDetectInfo.NumTxOkInPeriod) > 8 ) || - (pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod > 2) ) +#ifdef CONFIG_LPS_SLOW_TRANSITION + (pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod > 2) +#else //CONFIG_LPS_SLOW_TRANSITION + (pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod > 4) +#endif //CONFIG_LPS_SLOW_TRANSITION + ) { - //DBG_871X("(-)Tx = %d, Rx = %d \n",pmlmepriv->LinkDetectInfo.NumTxOkInPeriod,pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod); +#ifdef DBG_RX_COUNTER_DUMP + if( padapter->dump_rx_cnt_mode & DUMP_DRV_TRX_COUNTER_DATA) + DBG_871X("(-)Tx = %d, Rx = %d \n",pmlmepriv->LinkDetectInfo.NumTxOkInPeriod,pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod); +#endif bEnterPS= _FALSE; - +#ifdef CONFIG_LPS_SLOW_TRANSITION if(bBusyTraffic == _TRUE) { if(pmlmepriv->LinkDetectInfo.TrafficTransitionCount <= 4) @@ -2391,11 +2499,16 @@ u8 traffic_status_watchdog(_adapter *padapter, u8 from_timer) pmlmepriv->LinkDetectInfo.TrafficTransitionCount = 30; } } +#endif //CONFIG_LPS_SLOW_TRANSITION + } else { - //DBG_871X("(+)Tx = %d, Rx = %d \n",pmlmepriv->LinkDetectInfo.NumTxOkInPeriod,pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod); - +#ifdef DBG_RX_COUNTER_DUMP + if( padapter->dump_rx_cnt_mode & DUMP_DRV_TRX_COUNTER_DATA) + DBG_871X("(+)Tx = %d, Rx = %d \n",pmlmepriv->LinkDetectInfo.NumTxOkInPeriod,pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod); +#endif +#ifdef CONFIG_LPS_SLOW_TRANSITION if(pmlmepriv->LinkDetectInfo.TrafficTransitionCount>=2) pmlmepriv->LinkDetectInfo.TrafficTransitionCount -=2; else @@ -2403,6 +2516,9 @@ u8 traffic_status_watchdog(_adapter *padapter, u8 from_timer) if(pmlmepriv->LinkDetectInfo.TrafficTransitionCount == 0) bEnterPS= _TRUE; +#else //CONFIG_LPS_SLOW_TRANSITION + bEnterPS= _TRUE; +#endif //CONFIG_LPS_SLOW_TRANSITION } #ifdef CONFIG_DYNAMIC_DTIM @@ -2519,10 +2635,17 @@ void dynamic_chk_wk_hdl(_adapter *padapter) //if(check_fwstate(pmlmepriv, _FW_UNDER_LINKING|_FW_UNDER_SURVEY)==_FALSE) { - linked_status_chk(padapter); + linked_status_chk(padapter, 0); traffic_status_watchdog(padapter, 0); + #ifdef DBG_RX_COUNTER_DUMP + rtw_dump_rx_counters(padapter); + #endif + dm_DynamicUsbTxAgg(padapter, 0); } +#ifdef CONFIG_BEAMFORMING + beamforming_watchdog(padapter); +#endif rtw_hal_dm_watchdog(padapter); @@ -2610,7 +2733,16 @@ _func_enter_; break; case LPS_CTRL_TRAFFIC_BUSY: LPS_Leave(padapter, "LPS_CTRL_TRAFFIC_BUSY"); - + break; + case LPS_CTRL_TX_TRAFFIC_LEAVE: + LPS_Leave(padapter, "LPS_CTRL_TX_TRAFFIC_LEAVE"); + break; + case LPS_CTRL_RX_TRAFFIC_LEAVE: + LPS_Leave(padapter, "LPS_CTRL_RX_TRAFFIC_LEAVE"); + break; + case LPS_CTRL_ENTER: + LPS_Enter(padapter, "TRAFFIC_IDLE_1"); + break; default: break; } @@ -3042,41 +3174,37 @@ _func_exit_; static void rtw_chk_hi_queue_hdl(_adapter *padapter) { - int cnt=0; struct sta_info *psta_bmc; struct sta_priv *pstapriv = &padapter->stapriv; + u32 start = rtw_get_current_time(); + u8 empty = _FALSE; psta_bmc = rtw_get_bcmc_stainfo(padapter); if(!psta_bmc) return; - if(psta_bmc->sleepq_len==0) - { - u8 val = 0; + rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &empty); - //while((rtw_read32(padapter, 0x414)&0x00ffff00)!=0) - //while((rtw_read32(padapter, 0x414)&0x0000ff00)!=0) - - rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &val); - - while(_FALSE == val) - { - rtw_msleep_os(100); + while(_FALSE == empty && rtw_get_passing_time_ms(start) < rtw_get_wait_hiq_empty_ms()) + { + rtw_msleep_os(100); + rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &empty); + } - cnt++; - - if(cnt>10) - break; + if(psta_bmc->sleepq_len==0) + { + if(empty == _SUCCESS) + { + bool update_tim = _FALSE; - rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &val); - } + if (pstapriv->tim_bitmap & BIT(0)) + update_tim = _TRUE; - if(cnt<=10) - { pstapriv->tim_bitmap &= ~BIT(0); pstapriv->sta_dz_bitmap &= ~BIT(0); - - update_beacon(padapter, _TIM_IE_, NULL, _TRUE); + + if (update_tim == _TRUE) + _update_beacon(padapter, _TIM_IE_, NULL, _TRUE, "bmc sleepq and HIQ empty"); } else //re check again { @@ -3123,6 +3251,160 @@ u8 rtw_chk_hi_queue_cmd(_adapter*padapter) } #endif +#ifdef CONFIG_BT_COEXIST +struct btinfo { + u8 cid; + u8 len; + + u8 bConnection:1; + u8 bSCOeSCO:1; + u8 bInQPage:1; + u8 bACLBusy:1; + u8 bSCOBusy:1; + u8 bHID:1; + u8 bA2DP:1; + u8 bFTP:1; + + u8 retry_cnt:4; + u8 rsvd_34:1; + u8 rsvd_35:1; + u8 rsvd_36:1; + u8 rsvd_37:1; + + u8 rssi; + + u8 rsvd_50:1; + u8 rsvd_51:1; + u8 rsvd_52:1; + u8 rsvd_53:1; + u8 rsvd_54:1; + u8 rsvd_55:1; + u8 eSCO_SCO:1; + u8 Master_Slave:1; + + u8 rsvd_6; + u8 rsvd_7; +}; + +void btinfo_evt_dump(void *sel, void *buf) +{ + struct btinfo *info = (struct btinfo *)buf; + + DBG_871X_SEL_NL(sel, "cid:0x%02x, len:%u\n", info->cid, info->len); + + if (info->len > 2) + DBG_871X_SEL_NL(sel, "byte2:%s%s%s%s%s%s%s%s\n" + , info->bConnection?"bConnection ":"" + , info->bSCOeSCO?"bSCOeSCO ":"" + , info->bInQPage?"bInQPage ":"" + , info->bACLBusy?"bACLBusy ":"" + , info->bSCOBusy?"bSCOBusy ":"" + , info->bHID?"bHID ":"" + , info->bA2DP?"bA2DP ":"" + , info->bFTP?"bFTP":"" + ); + + if (info->len > 3) + DBG_871X_SEL_NL(sel, "retry_cnt:%u\n", info->retry_cnt); + + if (info->len > 4) + DBG_871X_SEL_NL(sel, "rssi:%u\n", info->rssi); + + if (info->len > 5) + DBG_871X_SEL_NL(sel, "byte5:%s%s\n" + , info->eSCO_SCO?"eSCO_SCO ":"" + , info->Master_Slave?"Master_Slave ":"" + ); +} + +static void rtw_btinfo_hdl(_adapter *adapter, u8 *buf, u16 buf_len) +{ + #define BTINFO_WIFI_FETCH 0x23 + #define BTINFO_BT_AUTO_RPT 0x27 +#ifdef CONFIG_BT_COEXIST_SOCKET_TRX + struct btinfo_8761ATV *info = (struct btinfo_8761ATV *)buf; +#else //!CONFIG_BT_COEXIST_SOCKET_TRX + struct btinfo *info = (struct btinfo *)buf; +#endif //CONFIG_BT_COEXIST_SOCKET_TRX + u8 cmd_idx; + u8 len; + + cmd_idx = info->cid; + + if (info->len > buf_len-2) { + rtw_warn_on(1); + len = buf_len-2; + } else { + len = info->len; + } + +//#define DBG_PROC_SET_BTINFO_EVT +#ifdef DBG_PROC_SET_BTINFO_EVT +#ifdef CONFIG_BT_COEXIST_SOCKET_TRX + //DBG_871X("%s: btinfo[0]=%x,btinfo[1]=%x,btinfo[2]=%x,btinfo[3]=%x + // btinfo[4]=%x,btinfo[5]=%x,btinfo[6]=%x,btinfo[7]=%x",__func__,buf[0],buf[1],buf[2],buf[3],buf[4],buf[5],buf[6],buf[7]); +#else//!CONFIG_BT_COEXIST_SOCKET_TRX + btinfo_evt_dump(RTW_DBGDUMP, info); +#endif //CONFIG_BT_COEXIST_SOCKET_TRX +#endif // DBG_PROC_SET_BTINFO_EVT + + /* transform BT-FW btinfo to WiFI-FW C2H format and notify */ + if (cmd_idx == BTINFO_WIFI_FETCH) + buf[1] = 0; + else if (cmd_idx == BTINFO_BT_AUTO_RPT) + buf[1] = 2; +#ifdef CONFIG_BT_COEXIST_SOCKET_TRX + else if(0x01 == cmd_idx || 0x02 == cmd_idx) + buf[1] = buf[0]; +#endif //CONFIG_BT_COEXIST_SOCKET_TRX + rtw_btcoex_BtInfoNotify(adapter ,len+1, &buf[1]); +} + +u8 rtw_btinfo_cmd(_adapter *adapter, u8 *buf, u16 len) +{ + struct cmd_obj *ph2c; + struct drvextra_cmd_parm *pdrvextra_cmd_parm; + u8 *btinfo; + struct cmd_priv *pcmdpriv = &adapter->cmdpriv; + u8 res = _SUCCESS; + + ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); + if (ph2c == NULL) { + res = _FAIL; + goto exit; + } + + pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm)); + if (pdrvextra_cmd_parm == NULL) { + rtw_mfree((u8*)ph2c, sizeof(struct cmd_obj)); + res = _FAIL; + goto exit; + } + + btinfo = rtw_zmalloc(len); + if (btinfo == NULL) { + rtw_mfree((u8*)ph2c, sizeof(struct cmd_obj)); + rtw_mfree((u8*)pdrvextra_cmd_parm, sizeof(struct drvextra_cmd_parm)); + res = _FAIL; + goto exit; + } + + pdrvextra_cmd_parm->ec_id = BTINFO_WK_CID; + pdrvextra_cmd_parm->type = 0; + pdrvextra_cmd_parm->size = len; + pdrvextra_cmd_parm->pbuf = btinfo; + + _rtw_memcpy(btinfo, buf, len); + + init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra)); + + res = rtw_enqueue_cmd(pcmdpriv, ph2c); + +exit: + return res; +} +#endif //CONFIG_BT_COEXIST + //#ifdef CONFIG_C2H_PACKET_EN u8 rtw_c2h_packet_wk_cmd(PADAPTER padapter, u8 *pbuf, u16 length) { @@ -3196,6 +3478,42 @@ u8 rtw_c2h_wk_cmd(PADAPTER padapter, u8 *c2h_evt) } //#endif //CONFIG_C2H_PACKET_EN +u8 rtw_run_in_thread_cmd(PADAPTER padapter, void (*func)(void*), void* context) +{ + struct cmd_priv *pcmdpriv; + struct cmd_obj *ph2c; + struct RunInThread_param *parm; + s32 res = _SUCCESS; + +_func_enter_; + + pcmdpriv = &padapter->cmdpriv; + + ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); + if (NULL == ph2c) { + res = _FAIL; + goto exit; + } + + parm = (struct RunInThread_param*)rtw_zmalloc(sizeof(struct RunInThread_param)); + if (NULL == parm) { + rtw_mfree((u8*)ph2c, sizeof(struct cmd_obj)); + res = _FAIL; + goto exit; + } + + parm->func = func; + parm->context = context; + init_h2fwcmd_w_parm_no_rsp(ph2c, parm, GEN_CMD_CODE(_RunInThreadCMD)); + + res = rtw_enqueue_cmd(pcmdpriv, ph2c); +exit: + +_func_exit_; + + return res; +} + s32 c2h_evt_hdl(_adapter *adapter, u8 *c2h_evt, c2h_id_filter filter) { s32 ret = _FAIL; @@ -3355,7 +3673,11 @@ u8 rtw_drvextra_cmd_hdl(_adapter *padapter, unsigned char *pbuf) case DM_RA_MSK_WK_CID: rtw_dm_ra_mask_hdl(padapter, (struct sta_info *)pdrvextra_cmd->pbuf); break; - +#ifdef CONFIG_BT_COEXIST + case BTINFO_WK_CID: + rtw_btinfo_hdl(padapter ,pdrvextra_cmd->pbuf, pdrvextra_cmd->size); + break; +#endif default: break; } @@ -3378,10 +3700,10 @@ _func_enter_; { //TODO: cancel timer and do timeout handler directly... //need to make timeout handlerOS independent - _set_timer(&pmlmepriv->scan_to_timer, 1); + mlme_set_scan_to_timer(pmlmepriv, 1); } else if (pcmd->res != H2C_SUCCESS) { - _set_timer(&pmlmepriv->scan_to_timer, 1); + mlme_set_scan_to_timer(pmlmepriv, 1); RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("\n ********Error: MgntActrtw_set_802_11_bssid_LIST_SCAN Fail ************\n\n.")); } diff --git a/backports/drivers/realtek/rtl8812au/core/rtw_debug.c b/backports/drivers/realtek/rtl8812au/core/rtw_debug.c index 7542c27579081b..ec0caad76e1866 100755 --- a/backports/drivers/realtek/rtl8812au/core/rtw_debug.c +++ b/backports/drivers/realtek/rtl8812au/core/rtw_debug.c @@ -60,6 +60,10 @@ u32 GlobalDebugLevel = _drv_err_; #include +#ifdef CONFIG_TDLS +#define TDLS_DBG_INFO_SPACE_BTWN_ITEM_AND_VALUE 41 +#endif + void dump_drv_version(void *sel) { DBG_871X_SEL_NL(sel, "%s %s\n", DRV_NAME, DRIVERVERSION); @@ -151,6 +155,78 @@ void rf_reg_dump(void *sel, _adapter *adapter) } } +static u8 fwdl_test_chksum_fail = 0; +static u8 fwdl_test_wintint_rdy_fail = 0; + +bool rtw_fwdl_test_trigger_chksum_fail() +{ + if (fwdl_test_chksum_fail) { + DBG_871X_LEVEL(_drv_always_, "fwdl test case: trigger chksum_fail\n"); + fwdl_test_chksum_fail--; + return _TRUE; + } + return _FALSE; +} + +bool rtw_fwdl_test_trigger_wintint_rdy_fail() +{ + if (fwdl_test_wintint_rdy_fail) { + DBG_871X_LEVEL(_drv_always_, "fwdl test case: trigger wintint_rdy_fail\n"); + fwdl_test_wintint_rdy_fail--; + return _TRUE; + } + return _FALSE; +} + +static u32 g_wait_hiq_empty_ms = 0; + +u32 rtw_get_wait_hiq_empty_ms() +{ + return g_wait_hiq_empty_ms; +} + +static u8 del_rx_ampdu_test_no_tx_fail = 0; + +bool rtw_del_rx_ampdu_test_trigger_no_tx_fail(void) +{ + if (del_rx_ampdu_test_no_tx_fail) { + DBG_871X_LEVEL(_drv_always_, "del_rx_ampdu test case: trigger no_tx_fail\n"); + del_rx_ampdu_test_no_tx_fail--; + return _TRUE; + } + return _FALSE; +} + +void rtw_sink_rtp_seq_dbg( _adapter *adapter,_pkt *pkt) +{ + struct recv_priv *precvpriv = &(adapter->recvpriv); + if( precvpriv->sink_udpport > 0) + { + if(*((u16*)((pkt->data)+0x24)) == cpu_to_be16(precvpriv->sink_udpport)) + { + precvpriv->pre_rtp_rxseq= precvpriv->cur_rtp_rxseq; + precvpriv->cur_rtp_rxseq = be16_to_cpu(*((u16*)((pkt->data)+0x2C))); + if( precvpriv->pre_rtp_rxseq+1 != precvpriv->cur_rtp_rxseq) + DBG_871X("%s : RTP Seq num from %d to %d\n",__FUNCTION__,precvpriv->pre_rtp_rxseq,precvpriv->cur_rtp_rxseq); + } + } +} + +void sta_rx_reorder_ctl_dump(void *sel, struct sta_info *sta) +{ + struct recv_reorder_ctrl *reorder_ctl; + int i; + + for (i = 0; i < 16; i++) { + reorder_ctl = &sta->recvreorder_ctrl[i]; + if (reorder_ctl->ampdu_size != RX_AMPDU_SIZE_INVALID || reorder_ctl->indicate_seq != 0xFFFF) { + DBG_871X_SEL_NL(sel, "tid=%d, enable=%d, ampdu_size=%u, indicate_seq=%u\n" + , i, reorder_ctl->enable, reorder_ctl->ampdu_size, reorder_ctl->indicate_seq + ); + } + } +} + #ifdef CONFIG_PROC_DEBUG ssize_t proc_set_write_reg(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data) { @@ -273,11 +349,30 @@ int proc_get_sec_info(struct seq_file *m, void *v) { struct net_device *dev = m->private; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); - struct security_priv *psecuritypriv = &padapter->securitypriv; + struct security_priv *sec = &padapter->securitypriv; DBG_871X_SEL_NL(m, "auth_alg=0x%x, enc_alg=0x%x, auth_type=0x%x, enc_type=0x%x\n", - psecuritypriv->dot11AuthAlgrthm, psecuritypriv->dot11PrivacyAlgrthm, - psecuritypriv->ndisauthtype, psecuritypriv->ndisencryptstatus); + sec->dot11AuthAlgrthm, sec->dot11PrivacyAlgrthm, + sec->ndisauthtype, sec->ndisencryptstatus); + + DBG_871X_SEL_NL(m, "hw_decrypted=%d\n", sec->hw_decrypted); + +#ifdef DBG_SW_SEC_CNT + DBG_871X_SEL_NL(m, "wep_sw_enc_cnt=%llu, %llu, %llu\n" + , sec->wep_sw_enc_cnt_bc , sec->wep_sw_enc_cnt_mc, sec->wep_sw_enc_cnt_uc); + DBG_871X_SEL_NL(m, "wep_sw_dec_cnt=%llu, %llu, %llu\n" + , sec->wep_sw_dec_cnt_bc , sec->wep_sw_dec_cnt_mc, sec->wep_sw_dec_cnt_uc); + + DBG_871X_SEL_NL(m, "tkip_sw_enc_cnt=%llu, %llu, %llu\n" + , sec->tkip_sw_enc_cnt_bc , sec->tkip_sw_enc_cnt_mc, sec->tkip_sw_enc_cnt_uc); + DBG_871X_SEL_NL(m, "tkip_sw_dec_cnt=%llu, %llu, %llu\n" + , sec->tkip_sw_dec_cnt_bc , sec->tkip_sw_dec_cnt_mc, sec->tkip_sw_dec_cnt_uc); + + DBG_871X_SEL_NL(m, "aes_sw_enc_cnt=%llu, %llu, %llu\n" + , sec->aes_sw_enc_cnt_bc , sec->aes_sw_enc_cnt_mc, sec->aes_sw_enc_cnt_uc); + DBG_871X_SEL_NL(m, "aes_sw_dec_cnt=%llu, %llu, %llu\n" + , sec->aes_sw_dec_cnt_bc , sec->aes_sw_dec_cnt_mc, sec->aes_sw_dec_cnt_uc); +#endif /* DBG_SW_SEC_CNT */ return 0; } @@ -437,6 +532,65 @@ int proc_get_rf_info(struct seq_file *m, void *v) return 0; } +int proc_get_survey_info(struct seq_file *m, void *v) +{ + _irqL irqL; + struct net_device *dev = m->private; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + _queue *queue = &(pmlmepriv->scanned_queue); + struct wlan_network *pnetwork = NULL; + _list *plist, *phead; + s32 notify_signal; + s16 notify_noise = 0; + u16 index = 0; + + _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); + phead = get_list_head(queue); + if(!phead) + return 0; + plist = get_next(phead); + if (!plist) + return 0; + + DBG_871X_SEL_NL(m, "%5s %-17s %3s %-3s %-4s %-4s %5s %s\n","index", "bssid", "ch", "RSSI", "SdBm", "Noise", "age", "ssid"); + while(1) + { + if (rtw_end_of_queue_search(phead,plist)== _TRUE) + break; + + pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); + if (!pnetwork) + break; + + if ( check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE && + is_same_network(&pmlmepriv->cur_network.network, &pnetwork->network, 0)) { + notify_signal = translate_percentage_to_dbm(padapter->recvpriv.signal_strength);//dbm + } else { + notify_signal = translate_percentage_to_dbm(pnetwork->network.PhyInfo.SignalStrength);//dbm + } + + #if defined(CONFIG_SIGNAL_DISPLAY_DBM) && defined(CONFIG_BACKGROUND_NOISE_MONITOR) + rtw_hal_get_odm_var(padapter, HAL_ODM_NOISE_MONITOR,&(pnetwork->network.Configuration.DSConfig), &(notify_noise)); + #endif + + DBG_871X_SEL_NL(m, "%5d "MAC_FMT" %3d %3d %4d %4d %5d %s\n", + ++index, + MAC_ARG(pnetwork->network.MacAddress), + pnetwork->network.Configuration.DSConfig, + (int)pnetwork->network.Rssi, + notify_signal, + notify_noise, + rtw_get_passing_time_ms((u32)pnetwork->last_scanned), + //translate_percentage_to_dbm(pnetwork->network.PhyInfo.SignalStrength), + pnetwork->network.Ssid.Ssid); + plist = get_next(plist); + } + _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); + + return 0; +} + int proc_get_ap_info(struct seq_file *m, void *v) { struct net_device *dev = m->private; @@ -470,16 +624,8 @@ int proc_get_ap_info(struct seq_file *m, void *v) DBG_871X_SEL_NL(m, "vht_ldpc_cap=0x%x, vht_stbc_cap=0x%x, vht_beamform_cap=0x%x\n", psta->vhtpriv.ldpc_cap, psta->vhtpriv.stbc_cap, psta->vhtpriv.beamform_cap); DBG_871X_SEL_NL(m, "vht_mcs_map=0x%x, vht_highest_rate=0x%x, vht_ampdu_len=%d\n", *(u16*)psta->vhtpriv.vht_mcs_map, psta->vhtpriv.vht_highest_rate, psta->vhtpriv.ampdu_len); #endif - - for(i=0;i<16;i++) - { - preorder_ctrl = &psta->recvreorder_ctrl[i]; - if(preorder_ctrl->enable) - { - DBG_871X_SEL_NL(m, "tid=%d, indicate_seq=%d\n", i, preorder_ctrl->indicate_seq); - } - } - + + sta_rx_reorder_ctl_dump(m, psta); } else { @@ -494,11 +640,37 @@ int proc_get_adapter_state(struct seq_file *m, void *v) struct net_device *dev = m->private; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); - DBG_871X_SEL_NL(m, "bSurpriseRemoved=%d, bDriverStopped=%d\n", - padapter->bSurpriseRemoved, padapter->bDriverStopped); +#ifdef CONFIG_CONCURRENT_MODE + DBG_871X_SEL_NL(m, "name=%s, iface_type=%d, bSurpriseRemoved=%d, bDriverStopped=%d\n", + dev->name, padapter->iface_type, + padapter->bSurpriseRemoved, padapter->bDriverStopped); +#else + DBG_871X_SEL_NL(m, "name=%s, bSurpriseRemoved=%d, bDriverStopped=%d\n", + dev->name, padapter->bSurpriseRemoved, padapter->bDriverStopped); +#endif return 0; } + +ssize_t proc_reset_trx_info(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data) +{ + struct net_device *dev = data; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + struct dvobj_priv *psdpriv = padapter->dvobj; + struct debug_priv *pdbgpriv = &psdpriv->drv_dbg; + char cmd[32]; + if (buffer && !copy_from_user(cmd, buffer, sizeof(cmd))) { + if('0' == cmd[0]){ + pdbgpriv->dbg_rx_ampdu_drop_count = 0; + pdbgpriv->dbg_rx_ampdu_forced_indicate_count = 0; + pdbgpriv->dbg_rx_ampdu_loss_count = 0; + pdbgpriv->dbg_rx_dup_mgt_frame_drop_count = 0; + pdbgpriv->dbg_rx_ampdu_window_shift_cnt = 0; + } + } + + return count; +} int proc_get_trx_info(struct seq_file *m, void *v) { @@ -507,8 +679,12 @@ int proc_get_trx_info(struct seq_file *m, void *v) _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); struct xmit_priv *pxmitpriv = &padapter->xmitpriv; struct recv_priv *precvpriv = &padapter->recvpriv; + struct dvobj_priv *psdpriv = padapter->dvobj; + struct debug_priv *pdbgpriv = &psdpriv->drv_dbg; struct hw_xmit *phwxmit; + dump_os_queue(m, padapter); + DBG_871X_SEL_NL(m, "free_xmitbuf_cnt=%d, free_xmitframe_cnt=%d\n" , pxmitpriv->free_xmitbuf_cnt, pxmitpriv->free_xmitframe_cnt); DBG_871X_SEL_NL(m, "free_ext_xmitbuf_cnt=%d, free_xframe_ext_cnt=%d\n" @@ -523,21 +699,70 @@ int proc_get_trx_info(struct seq_file *m, void *v) } #ifdef CONFIG_USB_HCI - DBG_871X_SEL_NL(m, "rx_urb_pending_cn=%d\n", precvpriv->rx_pending_cnt); + DBG_871X_SEL_NL(m, "rx_urb_pending_cn=%d\n", ATOMIC_READ(&(precvpriv->rx_pending_cnt))); #endif + //Folowing are RX info + //Counts of packets whose seq_num is less than preorder_ctrl->indicate_seq, Ex delay, retransmission, redundant packets and so on + DBG_871X_SEL_NL(m,"Rx: Counts of Packets Whose Seq_Num Less Than Reorder Control Seq_Num: %llu\n",(unsigned long long)pdbgpriv->dbg_rx_ampdu_drop_count); + //How many times the Rx Reorder Timer is triggered. + DBG_871X_SEL_NL(m,"Rx: Reorder Time-out Trigger Counts: %llu\n",(unsigned long long)pdbgpriv->dbg_rx_ampdu_forced_indicate_count); + //Total counts of packets loss + DBG_871X_SEL_NL(m,"Rx: Packet Loss Counts: %llu\n",(unsigned long long)pdbgpriv->dbg_rx_ampdu_loss_count); + DBG_871X_SEL_NL(m,"Rx: Duplicate Management Frame Drop Count: %llu\n",(unsigned long long)pdbgpriv->dbg_rx_dup_mgt_frame_drop_count); + DBG_871X_SEL_NL(m,"Rx: AMPDU BA window shift Count: %llu\n",(unsigned long long)pdbgpriv->dbg_rx_ampdu_window_shift_cnt); + + return 0; +} + +int proc_get_dis_pwt(struct seq_file *m, void *v) +{ + struct net_device *dev = m->private; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + u8 dis_pwt = 0; + rtw_hal_get_def_var(padapter, HAL_DEF_DBG_DIS_PWT, &(dis_pwt)); + DBG_871X_SEL_NL(m, " Tx Power training mode:%s \n",(dis_pwt==_TRUE)?"Disable":"Enable"); return 0; } +ssize_t proc_set_dis_pwt(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data) +{ + struct net_device *dev = data; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + char tmp[4]={0}; + u8 dis_pwt = 0; + + if (count < 1) + return -EFAULT; + if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) { + + int num = sscanf(tmp, "%hhx", &dis_pwt); + DBG_871X("Set Tx Power training mode:%s \n",(dis_pwt==_TRUE)?"Disable":"Enable"); + + if (num >= 1) + rtw_hal_set_def_var(padapter, HAL_DEF_DBG_DIS_PWT, &(dis_pwt)); + } + + return count; + +} int proc_get_rate_ctl(struct seq_file *m, void *v) { struct net_device *dev = m->private; int i; _adapter *adapter = (_adapter *)rtw_netdev_priv(dev); - + u8 data_rate = 0, sgi=0, data_fb = 0; + if (adapter->fix_rate != 0xff) { - DBG_871X_SEL_NL(m, "FIX\n"); - DBG_871X_SEL_NL(m, "0x%02x\n", adapter->fix_rate); + data_rate = adapter->fix_rate & 0x7F; + sgi = adapter->fix_rate >>7; + data_fb = adapter->data_fb?1:0; + DBG_871X_SEL_NL(m, "FIXED %s%s%s\n" + , HDATA_RATE(data_rate) + , data_rate>DESC_RATE54M?(sgi?" SGI":" LGI"):"" + , data_fb?" FB":"" + ); + DBG_871X_SEL_NL(m, "0x%02x %u\n", adapter->fix_rate, adapter->data_fb); } else { DBG_871X_SEL_NL(m, "RA\n"); } @@ -551,24 +776,60 @@ ssize_t proc_set_rate_ctl(struct file *file, const char __user *buffer, size_t c _adapter *adapter = (_adapter *)rtw_netdev_priv(dev); char tmp[32]; u8 fix_rate; + u8 data_fb; if (count < 1) return -EFAULT; if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) { - int num = sscanf(tmp, "%hhx", &fix_rate); + int num = sscanf(tmp, "%hhx %hhu", &fix_rate, &data_fb); if (num >= 1) adapter->fix_rate = fix_rate; + if (num >= 2) + adapter->data_fb = data_fb?1:0; } return count; } +#ifdef DBG_RX_COUNTER_DUMP +int proc_get_rx_cnt_dump(struct seq_file *m, void *v) +{ + struct net_device *dev = m->private; + int i; + _adapter *adapter = (_adapter *)rtw_netdev_priv(dev); + + DBG_871X_SEL_NL(m, "BIT0- Dump RX counters of DRV \n"); + DBG_871X_SEL_NL(m, "BIT1- Dump RX counters of MAC \n"); + DBG_871X_SEL_NL(m, "BIT2- Dump RX counters of PHY \n"); + DBG_871X_SEL_NL(m, "BIT3- Dump TRX data frame of DRV \n"); + DBG_871X_SEL_NL(m, "dump_rx_cnt_mode = 0x%02x \n", adapter->dump_rx_cnt_mode); + + return 0; +} +ssize_t proc_set_rx_cnt_dump(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data) +{ + struct net_device *dev = data; + _adapter *adapter = (_adapter *)rtw_netdev_priv(dev); + char tmp[32]; + u8 dump_rx_cnt_mode; + + if (count < 1) + return -EFAULT; + + if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) { + + int num = sscanf(tmp, "%hhx", &dump_rx_cnt_mode); -u8 g_fwdl_chksum_fail = 0; -u8 g_fwdl_wintint_rdy_fail = 0; + rtw_dump_phy_rxcnts_preprocess(adapter,dump_rx_cnt_mode); + adapter->dump_rx_cnt_mode = dump_rx_cnt_mode; + + } + return count; +} +#endif ssize_t proc_set_fwdl_test_case(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data) { struct net_device *dev = data; @@ -579,7 +840,39 @@ ssize_t proc_set_fwdl_test_case(struct file *file, const char __user *buffer, si return -EFAULT; if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) { - int num = sscanf(tmp, "%hhu %hhu", &g_fwdl_chksum_fail, &g_fwdl_wintint_rdy_fail); + int num = sscanf(tmp, "%hhu %hhu", &fwdl_test_chksum_fail, &fwdl_test_wintint_rdy_fail); + } + + return count; +} + +ssize_t proc_set_del_rx_ampdu_test_case(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data) +{ + struct net_device *dev = data; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + char tmp[32]; + int num; + + if (count < 1) + return -EFAULT; + + if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) + num = sscanf(tmp, "%hhu", &del_rx_ampdu_test_no_tx_fail); + + return count; +} + +ssize_t proc_set_wait_hiq_empty(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data) +{ + struct net_device *dev = data; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + char tmp[32]; + + if (count < 1) + return -EFAULT; + + if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) { + int num = sscanf(tmp, "%u", &g_wait_hiq_empty_ms); } return count; @@ -624,6 +917,282 @@ int proc_get_suspend_resume_info(struct seq_file *m, void *v) return 0; } +#ifdef CONFIG_DBG_COUNTER + +int proc_get_rx_logs(struct seq_file *m, void *v) +{ + struct net_device *dev = m->private; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + struct rx_logs *rx_logs = &padapter->rx_logs; + + DBG_871X_SEL_NL(m, + "intf_rx=%d\n" + "intf_rx_err_recvframe=%d\n" + "intf_rx_err_skb=%d\n" + "intf_rx_report=%d\n" + "core_rx=%d\n" + "core_rx_pre=%d\n" + "core_rx_pre_ver_err=%d\n" + "core_rx_pre_mgmt=%d\n" + "core_rx_pre_mgmt_err_80211w=%d\n" + "core_rx_pre_mgmt_err=%d\n" + "core_rx_pre_ctrl=%d\n" + "core_rx_pre_ctrl_err=%d\n" + "core_rx_pre_data=%d\n" + "core_rx_pre_data_wapi_seq_err=%d\n" + "core_rx_pre_data_wapi_key_err=%d\n" + "core_rx_pre_data_handled=%d\n" + "core_rx_pre_data_err=%d\n" + "core_rx_pre_data_unknown=%d\n" + "core_rx_pre_unknown=%d\n" + "core_rx_enqueue=%d\n" + "core_rx_dequeue=%d\n" + "core_rx_post=%d\n" + "core_rx_post_decrypt=%d\n" + "core_rx_post_decrypt_wep=%d\n" + "core_rx_post_decrypt_tkip=%d\n" + "core_rx_post_decrypt_aes=%d\n" + "core_rx_post_decrypt_wapi=%d\n" + "core_rx_post_decrypt_hw=%d\n" + "core_rx_post_decrypt_unknown=%d\n" + "core_rx_post_decrypt_err=%d\n" + "core_rx_post_defrag_err=%d\n" + "core_rx_post_portctrl_err=%d\n" + "core_rx_post_indicate=%d\n" + "core_rx_post_indicate_in_oder=%d\n" + "core_rx_post_indicate_reoder=%d\n" + "core_rx_post_indicate_err=%d\n" + "os_indicate=%d\n" + "os_indicate_ap_mcast=%d\n" + "os_indicate_ap_forward=%d\n" + "os_indicate_ap_self=%d\n" + "os_indicate_err=%d\n" + "os_netif_ok=%d\n" + "os_netif_err=%d\n", + rx_logs->intf_rx, + rx_logs->intf_rx_err_recvframe, + rx_logs->intf_rx_err_skb, + rx_logs->intf_rx_report, + rx_logs->core_rx, + rx_logs->core_rx_pre, + rx_logs->core_rx_pre_ver_err, + rx_logs->core_rx_pre_mgmt, + rx_logs->core_rx_pre_mgmt_err_80211w, + rx_logs->core_rx_pre_mgmt_err, + rx_logs->core_rx_pre_ctrl, + rx_logs->core_rx_pre_ctrl_err, + rx_logs->core_rx_pre_data, + rx_logs->core_rx_pre_data_wapi_seq_err, + rx_logs->core_rx_pre_data_wapi_key_err, + rx_logs->core_rx_pre_data_handled, + rx_logs->core_rx_pre_data_err, + rx_logs->core_rx_pre_data_unknown, + rx_logs->core_rx_pre_unknown, + rx_logs->core_rx_enqueue, + rx_logs->core_rx_dequeue, + rx_logs->core_rx_post, + rx_logs->core_rx_post_decrypt, + rx_logs->core_rx_post_decrypt_wep, + rx_logs->core_rx_post_decrypt_tkip, + rx_logs->core_rx_post_decrypt_aes, + rx_logs->core_rx_post_decrypt_wapi, + rx_logs->core_rx_post_decrypt_hw, + rx_logs->core_rx_post_decrypt_unknown, + rx_logs->core_rx_post_decrypt_err, + rx_logs->core_rx_post_defrag_err, + rx_logs->core_rx_post_portctrl_err, + rx_logs->core_rx_post_indicate, + rx_logs->core_rx_post_indicate_in_oder, + rx_logs->core_rx_post_indicate_reoder, + rx_logs->core_rx_post_indicate_err, + rx_logs->os_indicate, + rx_logs->os_indicate_ap_mcast, + rx_logs->os_indicate_ap_forward, + rx_logs->os_indicate_ap_self, + rx_logs->os_indicate_err, + rx_logs->os_netif_ok, + rx_logs->os_netif_err + ); + + return 0; +} + +int proc_get_tx_logs(struct seq_file *m, void *v) +{ + struct net_device *dev = m->private; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + struct tx_logs *tx_logs = &padapter->tx_logs; + + DBG_871X_SEL_NL(m, + "os_tx=%d\n" + "os_tx_err_up=%d\n" + "os_tx_err_xmit=%d\n" + "os_tx_m2u=%d\n" + "os_tx_m2u_ignore_fw_linked=%d\n" + "os_tx_m2u_ignore_self=%d\n" + "os_tx_m2u_entry=%d\n" + "os_tx_m2u_entry_err_xmit=%d\n" + "os_tx_m2u_entry_err_skb=%d\n" + "os_tx_m2u_stop=%d\n" + "core_tx=%d\n" + "core_tx_err_pxmitframe=%d\n" + "core_tx_err_brtx=%d\n" + "core_tx_upd_attrib=%d\n" + "core_tx_upd_attrib_adhoc=%d\n" + "core_tx_upd_attrib_sta=%d\n" + "core_tx_upd_attrib_ap=%d\n" + "core_tx_upd_attrib_unknown=%d\n" + "core_tx_upd_attrib_dhcp=%d\n" + "core_tx_upd_attrib_icmp=%d\n" + "core_tx_upd_attrib_active=%d\n" + "core_tx_upd_attrib_err_ucast_sta=%d\n" + "core_tx_upd_attrib_err_ucast_ap_link=%d\n" + "core_tx_upd_attrib_err_sta=%d\n" + "core_tx_upd_attrib_err_link=%d\n" + "core_tx_upd_attrib_err_sec=%d\n" + "core_tx_ap_enqueue_warn_fwstate=%d\n" + "core_tx_ap_enqueue_warn_sta=%d\n" + "core_tx_ap_enqueue_warn_nosta=%d\n" + "core_tx_ap_enqueue_warn_link=%d\n" + "core_tx_ap_enqueue_warn_trigger=%d\n" + "core_tx_ap_enqueue_mcast=%d\n" + "core_tx_ap_enqueue_ucast=%d\n" + "core_tx_ap_enqueue=%d\n" + "intf_tx=%d\n" + "intf_tx_pending_ac=%d\n" + "intf_tx_pending_fw_under_survey=%d\n" + "intf_tx_pending_fw_under_linking=%d\n" + "intf_tx_pending_xmitbuf=%d\n" + "intf_tx_enqueue=%d\n" + "core_tx_enqueue=%d\n" + "core_tx_enqueue_class=%d\n" + "core_tx_enqueue_class_err_sta=%d\n" + "core_tx_enqueue_class_err_nosta=%d\n" + "core_tx_enqueue_class_err_fwlink=%d\n" + "intf_tx_direct=%d\n" + "intf_tx_direct_err_coalesce=%d\n" + "intf_tx_dequeue=%d\n" + "intf_tx_dequeue_err_coalesce=%d\n" + "intf_tx_dump_xframe=%d\n" + "intf_tx_dump_xframe_err_txdesc=%d\n" + "intf_tx_dump_xframe_err_port=%d\n", + tx_logs->os_tx, + tx_logs->os_tx_err_up, + tx_logs->os_tx_err_xmit, + tx_logs->os_tx_m2u, + tx_logs->os_tx_m2u_ignore_fw_linked, + tx_logs->os_tx_m2u_ignore_self, + tx_logs->os_tx_m2u_entry, + tx_logs->os_tx_m2u_entry_err_xmit, + tx_logs->os_tx_m2u_entry_err_skb, + tx_logs->os_tx_m2u_stop, + tx_logs->core_tx, + tx_logs->core_tx_err_pxmitframe, + tx_logs->core_tx_err_brtx, + tx_logs->core_tx_upd_attrib, + tx_logs->core_tx_upd_attrib_adhoc, + tx_logs->core_tx_upd_attrib_sta, + tx_logs->core_tx_upd_attrib_ap, + tx_logs->core_tx_upd_attrib_unknown, + tx_logs->core_tx_upd_attrib_dhcp, + tx_logs->core_tx_upd_attrib_icmp, + tx_logs->core_tx_upd_attrib_active, + tx_logs->core_tx_upd_attrib_err_ucast_sta, + tx_logs->core_tx_upd_attrib_err_ucast_ap_link, + tx_logs->core_tx_upd_attrib_err_sta, + tx_logs->core_tx_upd_attrib_err_link, + tx_logs->core_tx_upd_attrib_err_sec, + tx_logs->core_tx_ap_enqueue_warn_fwstate, + tx_logs->core_tx_ap_enqueue_warn_sta, + tx_logs->core_tx_ap_enqueue_warn_nosta, + tx_logs->core_tx_ap_enqueue_warn_link, + tx_logs->core_tx_ap_enqueue_warn_trigger, + tx_logs->core_tx_ap_enqueue_mcast, + tx_logs->core_tx_ap_enqueue_ucast, + tx_logs->core_tx_ap_enqueue, + tx_logs->intf_tx, + tx_logs->intf_tx_pending_ac, + tx_logs->intf_tx_pending_fw_under_survey, + tx_logs->intf_tx_pending_fw_under_linking, + tx_logs->intf_tx_pending_xmitbuf, + tx_logs->intf_tx_enqueue, + tx_logs->core_tx_enqueue, + tx_logs->core_tx_enqueue_class, + tx_logs->core_tx_enqueue_class_err_sta, + tx_logs->core_tx_enqueue_class_err_nosta, + tx_logs->core_tx_enqueue_class_err_fwlink, + tx_logs->intf_tx_direct, + tx_logs->intf_tx_direct_err_coalesce, + tx_logs->intf_tx_dequeue, + tx_logs->intf_tx_dequeue_err_coalesce, + tx_logs->intf_tx_dump_xframe, + tx_logs->intf_tx_dump_xframe_err_txdesc, + tx_logs->intf_tx_dump_xframe_err_port + ); + + return 0; +} + +int proc_get_int_logs(struct seq_file *m, void *v) +{ + struct net_device *dev = m->private; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + + DBG_871X_SEL_NL(m, + "all=%d\n" + "err=%d\n" + "tbdok=%d\n" + "tbder=%d\n" + "bcnderr=%d\n" + "bcndma=%d\n" + "bcndma_e=%d\n" + "rx=%d\n" + "rx_rdu=%d\n" + "rx_fovw=%d\n" + "txfovw=%d\n" + "mgntok=%d\n" + "highdok=%d\n" + "bkdok=%d\n" + "bedok=%d\n" + "vidok=%d\n" + "vodok=%d\n", + padapter->int_logs.all, + padapter->int_logs.err, + padapter->int_logs.tbdok, + padapter->int_logs.tbder, + padapter->int_logs.bcnderr, + padapter->int_logs.bcndma, + padapter->int_logs.bcndma_e, + padapter->int_logs.rx, + padapter->int_logs.rx_rdu, + padapter->int_logs.rx_fovw, + padapter->int_logs.txfovw, + padapter->int_logs.mgntok, + padapter->int_logs.highdok, + padapter->int_logs.bkdok, + padapter->int_logs.bedok, + padapter->int_logs.vidok, + padapter->int_logs.vodok + ); + + return 0; +} + +#endif // CONFIG_DBG_COUNTER + +int proc_get_hw_status(struct seq_file *m, void *v) +{ + struct net_device *dev = m->private; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + struct dvobj_priv *dvobj = padapter->dvobj; + struct debug_priv *pdbgpriv = &dvobj->drv_dbg; + + DBG_871X_SEL_NL(m, "RX FIFO full count: last_time=%lld, current_time=%lld, differential=%lld\n" + , pdbgpriv->dbg_rx_fifo_last_overflow, pdbgpriv->dbg_rx_fifo_curr_overflow, pdbgpriv->dbg_rx_fifo_diff_overflow); + + return 0; +} + int proc_get_rx_signal(struct seq_file *m, void *v) { struct net_device *dev = m->private; @@ -631,11 +1200,16 @@ int proc_get_rx_signal(struct seq_file *m, void *v) struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); DBG_871X_SEL_NL(m, "rssi:%d\n", padapter->recvpriv.rssi); - DBG_871X_SEL_NL(m, "rxpwdb:%d\n", padapter->recvpriv.rxpwdb); + //DBG_871X_SEL_NL(m, "rxpwdb:%d\n", padapter->recvpriv.rxpwdb); DBG_871X_SEL_NL(m, "signal_strength:%u\n", padapter->recvpriv.signal_strength); DBG_871X_SEL_NL(m, "signal_qual:%u\n", padapter->recvpriv.signal_qual); - DBG_871X_SEL_NL(m, "noise:%u\n", padapter->recvpriv.noise); + rtw_get_noise(padapter); + DBG_871X_SEL_NL(m, "noise:%d\n", padapter->recvpriv.noise); + #ifdef DBG_RX_SIGNAL_DISPLAY_RAW_DATA + rtw_odm_get_perpkt_rssi(m,padapter); + rtw_get_raw_rssi_info(m,padapter); + #endif return 0; } @@ -659,7 +1233,6 @@ ssize_t proc_set_rx_signal(struct file *file, const char __user *buffer, size_t return count; signal_strength = signal_strength>100?100:signal_strength; - signal_strength = signal_strength<0?0:signal_strength; padapter->recvpriv.is_signal_dbg = is_signal_dbg; padapter->recvpriv.signal_strength_dbg=signal_strength; @@ -703,10 +1276,10 @@ ssize_t proc_set_ht_enable(struct file *file, const char __user *buffer, size_t int num = sscanf(tmp, "%d ", &mode); - if( pregpriv && mode >= 0 && mode < 2 ) + if( pregpriv && mode < 2 ) { pregpriv->ht_enable= mode; - printk("ht_enable=%d\n", pregpriv->ht_enable); + DBG_871X("ht_enable=%d\n", pregpriv->ht_enable); } } @@ -741,7 +1314,7 @@ ssize_t proc_set_bw_mode(struct file *file, const char __user *buffer, size_t co int num = sscanf(tmp, "%d ", &mode); - if( pregpriv && mode >= 0 && mode < 2 ) + if( pregpriv && mode < 2 ) { pregpriv->bw_mode = mode; @@ -781,7 +1354,7 @@ ssize_t proc_set_ampdu_enable(struct file *file, const char __user *buffer, size int num = sscanf(tmp, "%d ", &mode); - if( pregpriv && mode >= 0 && mode < 3 ) + if( pregpriv && mode < 3 ) { pregpriv->ampdu_enable= mode; printk("ampdu_enable=%d\n", mode); @@ -797,14 +1370,24 @@ int proc_get_rx_ampdu(struct seq_file *m, void *v) { struct net_device *dev = m->private; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); - struct registry_priv *pregpriv = &padapter->registrypriv; - struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - if(pregpriv) - DBG_871X_SEL_NL(m, - "bAcceptAddbaReq = %d , 0:Reject AP's Add BA req, 1:Accept AP's Add BA req.\n", pmlmeinfo->bAcceptAddbaReq - ); + DBG_871X_SEL(m, "accept: "); + if (padapter->fix_rx_ampdu_accept == RX_AMPDU_ACCEPT_INVALID) + DBG_871X_SEL_NL(m, "%u%s\n", rtw_rx_ampdu_is_accept(padapter), "(auto)"); + else + DBG_871X_SEL_NL(m, "%u%s\n", padapter->fix_rx_ampdu_accept, "(fixed)"); + + DBG_871X_SEL(m, "size: "); + if (padapter->fix_rx_ampdu_size == RX_AMPDU_SIZE_INVALID) + DBG_871X_SEL_NL(m, "%u%s\n", rtw_rx_ampdu_size(padapter), "(auto)"); + else + DBG_871X_SEL_NL(m, "%u%s\n", padapter->fix_rx_ampdu_size, "(fixed)"); + + DBG_871X_SEL_NL(m, "%19s %17s\n", "fix_rx_ampdu_accept", "fix_rx_ampdu_size"); + + DBG_871X_SEL(m, "%-19d %-17u\n" + , padapter->fix_rx_ampdu_accept + , padapter->fix_rx_ampdu_size); return 0; } @@ -817,107 +1400,234 @@ ssize_t proc_set_rx_ampdu(struct file *file, const char __user *buffer, size_t c struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); char tmp[32]; - u32 mode; + u8 accept; + u8 size; if (count < 1) return -EFAULT; - if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) { + if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) { - int num = sscanf(tmp, "%d ", &mode); + int num = sscanf(tmp, "%hhu %hhu", &accept, &size); - if( pregpriv && mode >= 0 && mode < 2 ) - { - pmlmeinfo->bAcceptAddbaReq = mode; - DBG_871X("pmlmeinfo->bAcceptAddbaReq=%d \n",pmlmeinfo->bAcceptAddbaReq); - if(mode == 0) - { - //tear down Rx AMPDU - send_delba(padapter, 0, get_my_bssid(&(pmlmeinfo->network)));// recipient - } - } + if (num >= 1) + rtw_rx_ampdu_set_accept(padapter, accept, RX_AMPDU_DRV_FIXED); + if (num >= 2) + rtw_rx_ampdu_set_size(padapter, size, RX_AMPDU_DRV_FIXED); + rtw_rx_ampdu_apply(padapter); } +exit: return count; } - -#endif //CONFIG_80211N_HT - -int proc_get_en_fwps(struct seq_file *m, void *v) +int proc_get_rx_ampdu_factor(struct seq_file *m, void *v) { struct net_device *dev = m->private; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); - struct registry_priv *pregpriv = &padapter->registrypriv; - struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - if(pregpriv) - DBG_871X_SEL_NL(m, "check_fw_ps = %d , 1:enable get FW PS state , 0: disable get FW PS state\n" - , pregpriv->check_fw_ps); + if(padapter) + { + DBG_871X_SEL_NL(m,"rx ampdu factor = %x\n",padapter->driver_rx_ampdu_factor); + } + return 0; } -ssize_t proc_set_en_fwps(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data) +ssize_t proc_set_rx_ampdu_factor(struct file *file, const char __user *buffer + , size_t count, loff_t *pos, void *data) { struct net_device *dev = data; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); - struct registry_priv *pregpriv = &padapter->registrypriv; - struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); char tmp[32]; - u32 mode; + u32 factor; if (count < 1) return -EFAULT; - if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) { + if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) + { - int num = sscanf(tmp, "%d ", &mode); + int num = sscanf(tmp, "%d ", &factor); - if( pregpriv && mode >= 0 && mode < 2 ) + if( padapter && (num == 1) ) { - pregpriv->check_fw_ps = mode; - DBG_871X("pregpriv->check_fw_ps=%d \n",pregpriv->check_fw_ps); - } + DBG_871X("padapter->driver_rx_ampdu_factor = %x\n", factor); + if(factor > 0x03) + padapter->driver_rx_ampdu_factor = 0xFF; + else + padapter->driver_rx_ampdu_factor = factor; + } } return count; } -int proc_get_two_path_rssi(struct seq_file *m, void *v) +int proc_get_rx_ampdu_density(struct seq_file *m, void *v) { struct net_device *dev = m->private; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); - if(padapter) - DBG_871X_SEL_NL(m, "%d %d\n", - padapter->recvpriv.RxRssi[0], padapter->recvpriv.RxRssi[1]); - - return 0; -} -#ifdef CONFIG_80211N_HT -int proc_get_rx_stbc(struct seq_file *m, void *v) -{ - struct net_device *dev = m->private; - _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); - struct registry_priv *pregpriv = &padapter->registrypriv; - if(pregpriv) - DBG_871X_SEL_NL(m, "%d\n", pregpriv->rx_stbc); + if(padapter) + { + DBG_871X_SEL_NL(m,"rx ampdu densityg = %x\n",padapter->driver_rx_ampdu_spacing); + } return 0; } -ssize_t proc_set_rx_stbc(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data) +ssize_t proc_set_rx_ampdu_density(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data) { struct net_device *dev = data; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); - struct registry_priv *pregpriv = &padapter->registrypriv; char tmp[32]; - u32 mode; + u32 density; + + if (count < 1) + return -EFAULT; + + if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) + { + + int num = sscanf(tmp, "%d ", &density); + + if( padapter && (num == 1) ) + { + DBG_871X("padapter->driver_rx_ampdu_spacing = %x\n", density); + + if(density > 0x07) + padapter->driver_rx_ampdu_spacing = 0xFF; + else + padapter->driver_rx_ampdu_spacing = density; + } + } + + return count; +} + +int proc_get_tx_ampdu_density(struct seq_file *m, void *v) +{ + struct net_device *dev = m->private; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + + + if(padapter) + { + DBG_871X_SEL_NL(m,"tx ampdu density = %x\n",padapter->driver_ampdu_spacing); + } + + return 0; +} + +ssize_t proc_set_tx_ampdu_density(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data) +{ + struct net_device *dev = data; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + char tmp[32]; + u32 density; + + if (count < 1) + return -EFAULT; + + if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) + { + + int num = sscanf(tmp, "%d ", &density); + + if( padapter && (num == 1) ) + { + DBG_871X("padapter->driver_ampdu_spacing = %x\n", density); + + if(density > 0x07) + padapter->driver_ampdu_spacing = 0xFF; + else + padapter->driver_ampdu_spacing = density; + } + } + + return count; +} +#endif //CONFIG_80211N_HT + +int proc_get_en_fwps(struct seq_file *m, void *v) +{ + struct net_device *dev = m->private; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + struct registry_priv *pregpriv = &padapter->registrypriv; + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + + if(pregpriv) + DBG_871X_SEL_NL(m, "check_fw_ps = %d , 1:enable get FW PS state , 0: disable get FW PS state\n" + , pregpriv->check_fw_ps); + + return 0; +} + +ssize_t proc_set_en_fwps(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data) +{ + struct net_device *dev = data; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + struct registry_priv *pregpriv = &padapter->registrypriv; + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + char tmp[32]; + u32 mode; + + if (count < 1) + return -EFAULT; + + if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) { + + int num = sscanf(tmp, "%d ", &mode); + + if( pregpriv && mode < 2 ) + { + pregpriv->check_fw_ps = mode; + DBG_871X("pregpriv->check_fw_ps=%d \n",pregpriv->check_fw_ps); + } + + } + + return count; +} + +/* +int proc_get_two_path_rssi(struct seq_file *m, void *v) +{ + struct net_device *dev = m->private; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + + if(padapter) + DBG_871X_SEL_NL(m, "%d %d\n", + padapter->recvpriv.RxRssi[0], padapter->recvpriv.RxRssi[1]); + + return 0; +} +*/ +#ifdef CONFIG_80211N_HT +int proc_get_rx_stbc(struct seq_file *m, void *v) +{ + struct net_device *dev = m->private; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + struct registry_priv *pregpriv = &padapter->registrypriv; + + if(pregpriv) + DBG_871X_SEL_NL(m, "%d\n", pregpriv->rx_stbc); + + return 0; +} + +ssize_t proc_set_rx_stbc(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data) +{ + struct net_device *dev = data; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + struct registry_priv *pregpriv = &padapter->registrypriv; + char tmp[32]; + u32 mode; if (count < 1) return -EFAULT; @@ -938,13 +1648,14 @@ ssize_t proc_set_rx_stbc(struct file *file, const char __user *buffer, size_t co } #endif //CONFIG_80211N_HT -int proc_get_rssi_disp(struct seq_file *m, void *v) +/*int proc_get_rssi_disp(struct seq_file *m, void *v) { struct net_device *dev = m->private; return 0; } +*/ -ssize_t proc_set_rssi_disp(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data) +/*ssize_t proc_set_rssi_disp(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data) { struct net_device *dev = data; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); @@ -983,7 +1694,7 @@ ssize_t proc_set_rssi_disp(struct file *file, const char __user *buffer, size_t } - +*/ #ifdef CONFIG_AP_MODE int proc_get_all_sta_info(struct seq_file *m, void *v) @@ -993,9 +1704,8 @@ int proc_get_all_sta_info(struct seq_file *m, void *v) struct sta_info *psta; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); struct sta_priv *pstapriv = &padapter->stapriv; - int i, j; + int i; _list *plist, *phead; - struct recv_reorder_ctrl *preorder_ctrl; DBG_871X_SEL_NL(m, "sta_dz_bitmap=0x%x, tim_bitmap=0x%x\n", pstapriv->sta_dz_bitmap, pstapriv->tim_bitmap); @@ -1025,6 +1735,11 @@ int proc_get_all_sta_info(struct seq_file *m, void *v) DBG_871X_SEL_NL(m, "agg_enable_bitmap=%x, candidate_tid_bitmap=%x\n", psta->htpriv.agg_enable_bitmap, psta->htpriv.candidate_tid_bitmap); #endif //CONFIG_80211N_HT DBG_871X_SEL_NL(m, "sleepq_len=%d\n", psta->sleepq_len); + DBG_871X_SEL_NL(m, "sta_xmitpriv.vo_q_qcnt=%d\n", psta->sta_xmitpriv.vo_q.qcnt); + DBG_871X_SEL_NL(m, "sta_xmitpriv.vi_q_qcnt=%d\n", psta->sta_xmitpriv.vi_q.qcnt); + DBG_871X_SEL_NL(m, "sta_xmitpriv.be_q_qcnt=%d\n", psta->sta_xmitpriv.be_q.qcnt); + DBG_871X_SEL_NL(m, "sta_xmitpriv.bk_q_qcnt=%d\n", psta->sta_xmitpriv.bk_q.qcnt); + DBG_871X_SEL_NL(m, "capability=0x%x\n", psta->capability); DBG_871X_SEL_NL(m, "flags=0x%x\n", psta->flags); DBG_871X_SEL_NL(m, "wpa_psk=0x%x\n", psta->wpa_psk); @@ -1032,15 +1747,8 @@ int proc_get_all_sta_info(struct seq_file *m, void *v) DBG_871X_SEL_NL(m, "wpa2_pairwise_cipher=0x%x\n", psta->wpa2_pairwise_cipher); DBG_871X_SEL_NL(m, "qos_info=0x%x\n", psta->qos_info); DBG_871X_SEL_NL(m, "dot118021XPrivacy=0x%x\n", psta->dot118021XPrivacy); - - for(j=0;j<16;j++) - { - preorder_ctrl = &psta->recvreorder_ctrl[j]; - if(preorder_ctrl->enable) - { - DBG_871X_SEL_NL(m, "tid=%d, indicate_seq=%d\n", j, preorder_ctrl->indicate_seq); - } - } + + sta_rx_reorder_ctl_dump(m, psta); #ifdef CONFIG_TDLS DBG_871X_SEL_NL(m, "tdls_sta_state=0x%08x\n", psta->tdls_sta_state); @@ -1093,7 +1801,7 @@ int proc_get_best_channel(struct seq_file *m, void *v) index_5G = i; } - for (i=0; pmlmeext->channel_set[i].ChannelNum !=0; i++) { + for (i=0; (i < MAX_CHANNEL_NUM) && (pmlmeext->channel_set[i].ChannelNum !=0) ; i++) { // 2.4G if ( pmlmeext->channel_set[i].ChannelNum == 6 ) { if ( pmlmeext->channel_set[i].rx_count < pmlmeext->channel_set[index_24G].rx_count ) { @@ -1297,5 +2005,681 @@ ssize_t proc_set_sreset(struct file *file, const char __user *buffer, size_t cou } #endif /* DBG_CONFIG_ERROR_DETECT */ +#ifdef CONFIG_PCI_HCI + +int proc_get_rx_ring(struct seq_file *m, void *v) +{ + _irqL irqL; + struct net_device *dev = m->private; + _adapter *padapter = (_adapter *) rtw_netdev_priv(dev); + struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter); + struct recv_priv *precvpriv = &padapter->recvpriv; + struct rtw_rx_ring *rx_ring = &precvpriv->rx_ring[RX_MPDU_QUEUE]; + int i, j; + + DBG_871X_SEL_NL(m, "rx ring (%p)\n", rx_ring); + DBG_871X_SEL_NL(m, " dma: 0x%08x\n", (int) rx_ring->dma); + DBG_871X_SEL_NL(m, " idx: %d\n", rx_ring->idx); + + _enter_critical(&pdvobjpriv->irq_th_lock, &irqL); + for (i=0; irxringcount; i++) + { + struct recv_stat *entry = &rx_ring->desc[i]; + struct sk_buff *skb = rx_ring->rx_buf[i]; + + DBG_871X_SEL_NL(m, " desc[%03d]: %p, rx_buf[%03d]: 0x%08x\n", + i, entry, i, cpu_to_le32(*((dma_addr_t *)skb->cb))); + + for (j=0; jirq_th_lock, &irqL); + + return 0; +} + +int proc_get_tx_ring(struct seq_file *m, void *v) +{ + _irqL irqL; + struct net_device *dev = m->private; + _adapter *padapter = (_adapter *) rtw_netdev_priv(dev); + struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter); + struct xmit_priv *pxmitpriv = &padapter->xmitpriv; + int i, j, k; + + _enter_critical(&pdvobjpriv->irq_th_lock, &irqL); + for (i = 0; i < PCI_MAX_TX_QUEUE_COUNT; i++) + { + struct rtw_tx_ring *tx_ring = &pxmitpriv->tx_ring[i]; + + DBG_871X_SEL_NL(m, "tx ring[%d] (%p)\n", i, tx_ring); + DBG_871X_SEL_NL(m, " dma: 0x%08x\n", (int) tx_ring->dma); + DBG_871X_SEL_NL(m, " idx: %d\n", tx_ring->idx); + DBG_871X_SEL_NL(m, " entries: %d\n", tx_ring->entries); +// DBG_871X_SEL_NL(m, " queue: %d\n", tx_ring->queue); + DBG_871X_SEL_NL(m, " qlen: %d\n", tx_ring->qlen); + + for (j=0; j < pxmitpriv->txringcount[i]; j++) + { + struct tx_desc *entry = &tx_ring->desc[j]; + + DBG_871X_SEL_NL(m, " desc[%03d]: %p\n", j, entry); + for (k=0; k < sizeof(*entry)/4; k++) + { + if ((k % 4) == 0) + DBG_871X_SEL_NL(m, " 0x%03x", k); + + DBG_871X_SEL_NL(m, " 0x%08x ", ((int *) entry)[k]); + + if ((k % 4) == 3) + DBG_871X_SEL_NL(m, "\n"); + } + } + } + _exit_critical(&pdvobjpriv->irq_th_lock, &irqL); + + return 0; +} +#endif + +#ifdef CONFIG_P2P_WOWLAN +int proc_get_p2p_wowlan_info(struct seq_file *m, void *v) +{ + struct net_device *dev = m->private; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); + struct p2p_wowlan_info peerinfo = pwdinfo->p2p_wow_info; + if(_TRUE == peerinfo.is_trigger) + { + DBG_871X_SEL_NL(m,"is_trigger: TRUE\n"); + switch(peerinfo.wowlan_recv_frame_type) + { + case P2P_WOWLAN_RECV_NEGO_REQ: + DBG_871X_SEL_NL(m,"Frame Type: Nego Request\n"); + break; + case P2P_WOWLAN_RECV_INVITE_REQ: + DBG_871X_SEL_NL(m,"Frame Type: Invitation Request\n"); + break; + case P2P_WOWLAN_RECV_PROVISION_REQ: + DBG_871X_SEL_NL(m,"Frame Type: Provision Request\n"); + break; + default: + break; + } + DBG_871X_SEL_NL(m,"Peer Addr: "MAC_FMT"\n", MAC_ARG(peerinfo.wowlan_peer_addr)); + DBG_871X_SEL_NL(m,"Peer WPS Config: %x\n", peerinfo.wowlan_peer_wpsconfig); + DBG_871X_SEL_NL(m,"Persistent Group: %d\n", peerinfo.wowlan_peer_is_persistent); + DBG_871X_SEL_NL(m,"Intivation Type: %d\n", peerinfo.wowlan_peer_invitation_type); + } + else + { + DBG_871X_SEL_NL(m,"is_trigger: False\n"); + } + return 0; +} +#endif /* CONFIG_P2P_WOWLAN */ + +int proc_get_new_bcn_max(struct seq_file *m, void *v) +{ + extern int new_bcn_max; + + DBG_871X_SEL_NL(m, "%d", new_bcn_max); + return 0; +} + +ssize_t proc_set_new_bcn_max(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data) +{ + char tmp[32]; + extern int new_bcn_max; + + if(count < 1) + return -EFAULT; + + if(buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) + sscanf(tmp, "%d ", &new_bcn_max); + + return count; +} + +#ifdef CONFIG_POWER_SAVING +int proc_get_ps_info(struct seq_file *m, void *v) +{ + struct net_device *dev = m->private; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); + u8 ips_mode = pwrpriv->ips_mode; + u8 lps_mode = pwrpriv->power_mgnt; + char *str = ""; + + DBG_871X_SEL_NL(m, "======Power Saving Info:======\n"); + DBG_871X_SEL_NL(m, "*IPS:\n"); + + if (ips_mode == IPS_NORMAL) { +#ifdef CONFIG_FWLPS_IN_IPS + str = "FW_LPS_IN_IPS"; +#else + str = "Card Disable"; +#endif + } else if (ips_mode == IPS_NONE) { + str = "NO IPS"; + } else if (ips_mode == IPS_LEVEL_2) { + str = "IPS_LEVEL_2"; + } else { + str = "invalid ips_mode"; + } + + DBG_871X_SEL_NL(m, " IPS mode: %s\n", str); + DBG_871X_SEL_NL(m, " IPS enter count:%d, IPS leave count:%d\n", + pwrpriv->ips_enter_cnts, pwrpriv->ips_leave_cnts); + DBG_871X_SEL_NL(m, "------------------------------\n"); + DBG_871X_SEL_NL(m, "*LPS:\n"); + + if (lps_mode == PS_MODE_ACTIVE) { + str = "NO LPS"; + } else if (lps_mode == PS_MODE_MIN) { + str = "MIN"; + } else if (lps_mode == PS_MODE_MAX) { + str = "MAX"; + } else if (lps_mode == PS_MODE_DTIM) { + str = "DTIM"; + } else { + sprintf(str, "%d", lps_mode); + } + + DBG_871X_SEL_NL(m, " LPS mode: %s\n", str); + + if (pwrpriv->dtim != 0) + DBG_871X_SEL_NL(m, " DTIM: %d\n", pwrpriv->dtim); + DBG_871X_SEL_NL(m, " LPS enter count:%d, LPS leave count:%d\n", + pwrpriv->lps_enter_cnts, pwrpriv->lps_leave_cnts); + DBG_871X_SEL_NL(m, "=============================\n"); + return 0; +} +#endif //CONFIG_POWER_SAVING + +#ifdef CONFIG_TDLS +static int proc_tdls_display_tdls_function_info(struct seq_file *m) +{ + struct net_device *dev = m->private; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; + u8 SpaceBtwnItemAndValue = TDLS_DBG_INFO_SPACE_BTWN_ITEM_AND_VALUE; + u8 SpaceBtwnItemAndValueTmp = 0; + BOOLEAN FirstMatchFound = _FALSE; + int j= 0; + + DBG_871X_SEL_NL(m, "============[TDLS Function Info]============\n"); + DBG_871X_SEL_NL(m, "%-*s = %s\n", SpaceBtwnItemAndValue, "TDLS Prohibited", (ptdlsinfo->ap_prohibited == _TRUE) ? "_TRUE" : "_FALSE"); + DBG_871X_SEL_NL(m, "%-*s = %s\n", SpaceBtwnItemAndValue, "TDLS Channel Switch Prohibited", (ptdlsinfo->ch_switch_prohibited == _TRUE) ? "_TRUE" : "_FALSE"); + DBG_871X_SEL_NL(m, "%-*s = %s\n", SpaceBtwnItemAndValue, "TDLS Link Established", (ptdlsinfo->link_established == _TRUE) ? "_TRUE" : "_FALSE"); + DBG_871X_SEL_NL(m, "%-*s = %d/%d\n", SpaceBtwnItemAndValue, "TDLS STA Num (Linked/Allowed)", ptdlsinfo->sta_cnt, MAX_ALLOWED_TDLS_STA_NUM); + DBG_871X_SEL_NL(m, "%-*s = %s\n", SpaceBtwnItemAndValue, "TDLS Allowed STA Num Reached", (ptdlsinfo->sta_maximum == _TRUE) ? "_TRUE" : "_FALSE"); + +#ifdef CONFIG_TDLS_CH_SW + DBG_871X_SEL_NL(m, "%-*s =", SpaceBtwnItemAndValue, "TDLS CH SW State"); + if (ptdlsinfo->chsw_info.ch_sw_state == TDLS_STATE_NONE) + { + DBG_871X_SEL_NL(m, "%-*s%s\n", SpaceBtwnItemAndValueTmp, " ", "TDLS_STATE_NONE"); + } + else + { + for (j = 0; j < 32; j++) + { + if (ptdlsinfo->chsw_info.ch_sw_state & BIT(j)) + { + if (FirstMatchFound == _FALSE) + { + SpaceBtwnItemAndValueTmp = 1; + FirstMatchFound = _TRUE; + } + else + { + SpaceBtwnItemAndValueTmp = SpaceBtwnItemAndValue + 3; + } + switch (BIT(j)) + { + case TDLS_INITIATOR_STATE: + DBG_871X_SEL_NL(m, "%-*s%s\n", SpaceBtwnItemAndValueTmp, " ", "TDLS_INITIATOR_STATE"); + break; + case TDLS_RESPONDER_STATE: + DBG_871X_SEL_NL(m, "%-*s%s\n", SpaceBtwnItemAndValueTmp, " ", "TDLS_RESPONDER_STATE"); + break; + case TDLS_LINKED_STATE: + DBG_871X_SEL_NL(m, "%-*s%s\n", SpaceBtwnItemAndValueTmp, " ", "TDLS_LINKED_STATE"); + break; + case TDLS_WAIT_PTR_STATE: + DBG_871X_SEL_NL(m, "%-*s%s\n", SpaceBtwnItemAndValueTmp, " ", "TDLS_WAIT_PTR_STATE"); + break; + case TDLS_ALIVE_STATE: + DBG_871X_SEL_NL(m, "%-*s%s\n", SpaceBtwnItemAndValueTmp, " ", "TDLS_ALIVE_STATE"); + break; + case TDLS_CH_SWITCH_ON_STATE: + DBG_871X_SEL_NL(m, "%-*s%s\n", SpaceBtwnItemAndValueTmp, " ", "TDLS_CH_SWITCH_ON_STATE"); + break; + case TDLS_PEER_AT_OFF_STATE: + DBG_871X_SEL_NL(m, "%-*s%s\n", SpaceBtwnItemAndValueTmp, " ", "TDLS_PEER_AT_OFF_STATE"); + break; + case TDLS_CH_SW_INITIATOR_STATE: + DBG_871X_SEL_NL(m, "%-*s%s\n", SpaceBtwnItemAndValueTmp, " ", "TDLS_CH_SW_INITIATOR_STATE"); + break; + case TDLS_WAIT_CH_RSP_STATE: + DBG_871X_SEL_NL(m, "%-*s%s\n", SpaceBtwnItemAndValue, " ", "TDLS_WAIT_CH_RSP_STATE"); + break; + default: + DBG_871X_SEL_NL(m, "%-*sBIT(%d)\n", SpaceBtwnItemAndValueTmp, " ", j); + break; + } + } + } + } + + DBG_871X_SEL_NL(m, "%-*s = %s\n", SpaceBtwnItemAndValue, "TDLS CH SW On", (ATOMIC_READ(&ptdlsinfo->chsw_info.chsw_on) == _TRUE) ? "_TRUE" : "_FALSE"); + DBG_871X_SEL_NL(m, "%-*s = %d\n", SpaceBtwnItemAndValue, "TDLS CH SW Off-Channel Num", ptdlsinfo->chsw_info.off_ch_num); + DBG_871X_SEL_NL(m, "%-*s = %d\n", SpaceBtwnItemAndValue, "TDLS CH SW Channel Offset", ptdlsinfo->chsw_info.ch_offset); + DBG_871X_SEL_NL(m, "%-*s = %d\n", SpaceBtwnItemAndValue, "TDLS CH SW Current Time", ptdlsinfo->chsw_info.cur_time); + DBG_871X_SEL_NL(m, "%-*s = %s\n", SpaceBtwnItemAndValue, "TDLS CH SW Delay Switch Back", (ptdlsinfo->chsw_info.delay_switch_back == _TRUE) ? "_TRUE" : "_FALSE"); + DBG_871X_SEL_NL(m, "%-*s = %d\n", SpaceBtwnItemAndValue, "TDLS CH SW Dump Back", ptdlsinfo->chsw_info.dump_stack); +#endif + + DBG_871X_SEL_NL(m, "%-*s = %s\n", SpaceBtwnItemAndValue, "TDLS Device Discovered", (ptdlsinfo->dev_discovered == _TRUE) ? "_TRUE" : "_FALSE"); + DBG_871X_SEL_NL(m, "%-*s = %s\n", SpaceBtwnItemAndValue, "TDLS Enable", (ptdlsinfo->tdls_enable == _TRUE) ? "_TRUE" : "_FALSE"); + DBG_871X_SEL_NL(m, "%-*s = %s\n", SpaceBtwnItemAndValue, "TDLS Driver Setup", (ptdlsinfo->driver_setup == _TRUE) ? "_TRUE" : "_FALSE"); + + return 0; +} + +static int proc_tdls_display_network_info(struct seq_file *m) +{ + struct net_device *dev = m->private; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; + struct wlan_network *cur_network = &(pmlmepriv->cur_network); + int i = 0; + u8 SpaceBtwnItemAndValue = TDLS_DBG_INFO_SPACE_BTWN_ITEM_AND_VALUE; + + /* Display the linked AP/GO info */ + DBG_871X_SEL_NL(m, "============[Associated AP/GO Info]============\n"); + + if ((pmlmepriv->fw_state & WIFI_STATION_STATE) && (pmlmepriv->fw_state & _FW_LINKED)) + { + DBG_871X_SEL_NL(m, "%-*s = %s\n", SpaceBtwnItemAndValue, "BSSID", cur_network->network.Ssid.Ssid); + DBG_871X_SEL_NL(m, "%-*s = "MAC_FMT"\n", SpaceBtwnItemAndValue, "Mac Address", MAC_ARG(cur_network->network.MacAddress)); + + DBG_871X_SEL_NL(m, "%-*s = ", SpaceBtwnItemAndValue, "Wireless Mode"); + for (i = 0; i < 8; i++) + { + if (pmlmeext->cur_wireless_mode & BIT(i)) + { + switch (BIT(i)) + { + case WIRELESS_11B: + DBG_871X_SEL_NL(m, "%4s", "11B "); + break; + case WIRELESS_11G: + DBG_871X_SEL_NL(m, "%4s", "11G "); + break; + case WIRELESS_11A: + DBG_871X_SEL_NL(m, "%4s", "11A "); + break; + case WIRELESS_11_24N: + DBG_871X_SEL_NL(m, "%7s", "11_24N "); + break; + case WIRELESS_11_5N: + DBG_871X_SEL_NL(m, "%6s", "11_5N "); + break; + case WIRELESS_AUTO: + DBG_871X_SEL_NL(m, "%5s", "AUTO "); + break; + case WIRELESS_11AC: + DBG_871X_SEL_NL(m, "%5s", "11AC "); + break; + } + } + } + DBG_871X_SEL_NL(m, "\n"); + + DBG_871X_SEL_NL(m, "%-*s = ", SpaceBtwnItemAndValue, "Privacy"); + switch (padapter->securitypriv.dot11PrivacyAlgrthm) + { + case _NO_PRIVACY_: + DBG_871X_SEL_NL(m, "%s\n", "NO PRIVACY"); + break; + case _WEP40_: + DBG_871X_SEL_NL(m, "%s\n", "WEP 40"); + break; + case _TKIP_: + DBG_871X_SEL_NL(m, "%s\n", "TKIP"); + break; + case _TKIP_WTMIC_: + DBG_871X_SEL_NL(m, "%s\n", "TKIP WTMIC"); + break; + case _AES_: + DBG_871X_SEL_NL(m, "%s\n", "AES"); + break; + case _WEP104_: + DBG_871X_SEL_NL(m, "%s\n", "WEP 104"); + break; + case _WEP_WPA_MIXED_: + DBG_871X_SEL_NL(m, "%s\n", "WEP/WPA Mixed"); + break; + case _SMS4_: + DBG_871X_SEL_NL(m, "%s\n", "SMS4"); + break; +#ifdef CONFIG_IEEE80211W + case _BIP_: + DBG_871X_SEL_NL(m, "%s\n", "BIP"); + break; +#endif //CONFIG_IEEE80211W + } + + DBG_871X_SEL_NL(m, "%-*s = %d\n", SpaceBtwnItemAndValue, "Channel", pmlmeext->cur_channel); + DBG_871X_SEL_NL(m, "%-*s = ", SpaceBtwnItemAndValue, "Channel Offset"); + switch (pmlmeext->cur_ch_offset) + { + case HAL_PRIME_CHNL_OFFSET_DONT_CARE: + DBG_871X_SEL_NL(m, "%s\n", "N/A"); + break; + case HAL_PRIME_CHNL_OFFSET_LOWER: + DBG_871X_SEL_NL(m, "%s\n", "Lower"); + break; + case HAL_PRIME_CHNL_OFFSET_UPPER: + DBG_871X_SEL_NL(m, "%s\n", "Upper"); + break; + } + + DBG_871X_SEL_NL(m, "%-*s = ", SpaceBtwnItemAndValue, "Bandwidth Mode"); + switch (pmlmeext->cur_bwmode) + { + case CHANNEL_WIDTH_20: + DBG_871X_SEL_NL(m, "%s\n", "20MHz"); + break; + case CHANNEL_WIDTH_40: + DBG_871X_SEL_NL(m, "%s\n", "40MHz"); + break; + case CHANNEL_WIDTH_80: + DBG_871X_SEL_NL(m, "%s\n", "80MHz"); + break; + case CHANNEL_WIDTH_160: + DBG_871X_SEL_NL(m, "%s\n", "160MHz"); + break; + case CHANNEL_WIDTH_80_80: + DBG_871X_SEL_NL(m, "%s\n", "80MHz + 80MHz"); + break; + } + } + else + { + DBG_871X_SEL_NL(m, "No association with AP/GO exists!\n"); + } + + return 0; +} + +static int proc_tdls_display_tdls_sta_info(struct seq_file *m) +{ + struct net_device *dev = m->private; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + struct sta_priv *pstapriv = &padapter->stapriv; + struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; + struct sta_info *psta; + int i = 0, j = 0; + _irqL irqL; + _list *plist, *phead; + u8 SpaceBtwnItemAndValue = TDLS_DBG_INFO_SPACE_BTWN_ITEM_AND_VALUE; + u8 SpaceBtwnItemAndValueTmp = 0; + u8 NumOfTdlsStaToShow = 0; + BOOLEAN FirstMatchFound = _FALSE; + + /* Search for TDLS sta info to display */ + _enter_critical_bh(&pstapriv->sta_hash_lock, &irqL); + for (i=0; i< NUM_STA; i++) + { + phead = &(pstapriv->sta_hash[i]); + plist = get_next(phead); + while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) + { + psta = LIST_CONTAINOR(plist, struct sta_info, hash_list); + plist = get_next(plist); + if (psta->tdls_sta_state != TDLS_STATE_NONE) + { + /* We got one TDLS sta info to show */ + DBG_871X_SEL_NL(m, "============[TDLS Peer STA Info: STA %d]============\n", ++NumOfTdlsStaToShow); + DBG_871X_SEL_NL(m, "%-*s = "MAC_FMT"\n", SpaceBtwnItemAndValue, "Mac Address", MAC_ARG(psta->hwaddr)); + DBG_871X_SEL_NL(m, "%-*s =", SpaceBtwnItemAndValue, "TDLS STA State"); + SpaceBtwnItemAndValueTmp = 0; + FirstMatchFound = _FALSE; + for (j = 0; j < 32; j++) + { + if (psta->tdls_sta_state & BIT(j)) + { + if (FirstMatchFound == _FALSE) + { + SpaceBtwnItemAndValueTmp = 1; + FirstMatchFound = _TRUE; + } + else + { + SpaceBtwnItemAndValueTmp = SpaceBtwnItemAndValue + 3; + } + switch (BIT(j)) + { + case TDLS_INITIATOR_STATE: + DBG_871X_SEL_NL(m, "%-*s%s\n", SpaceBtwnItemAndValueTmp, " ", "TDLS_INITIATOR_STATE"); + break; + case TDLS_RESPONDER_STATE: + DBG_871X_SEL_NL(m, "%-*s%s\n", SpaceBtwnItemAndValueTmp, " ", "TDLS_RESPONDER_STATE"); + break; + case TDLS_LINKED_STATE: + DBG_871X_SEL_NL(m, "%-*s%s\n", SpaceBtwnItemAndValueTmp, " ", "TDLS_LINKED_STATE"); + break; + case TDLS_WAIT_PTR_STATE: + DBG_871X_SEL_NL(m, "%-*s%s\n", SpaceBtwnItemAndValueTmp, " ", "TDLS_WAIT_PTR_STATE"); + break; + case TDLS_ALIVE_STATE: + DBG_871X_SEL_NL(m, "%-*s%s\n", SpaceBtwnItemAndValueTmp, " ", "TDLS_ALIVE_STATE"); + break; + case TDLS_CH_SWITCH_ON_STATE: + DBG_871X_SEL_NL(m, "%-*s%s\n", SpaceBtwnItemAndValueTmp, " ", "TDLS_CH_SWITCH_ON_STATE"); + break; + case TDLS_PEER_AT_OFF_STATE: + DBG_871X_SEL_NL(m, "%-*s%s\n", SpaceBtwnItemAndValueTmp, " ", "TDLS_PEER_AT_OFF_STATE"); + break; + case TDLS_CH_SW_INITIATOR_STATE: + DBG_871X_SEL_NL(m, "%-*s%s\n", SpaceBtwnItemAndValueTmp, " ", "TDLS_CH_SW_INITIATOR_STATE"); + break; + case TDLS_WAIT_CH_RSP_STATE: + DBG_871X_SEL_NL(m, "%-*s%s\n", SpaceBtwnItemAndValue, " ", "TDLS_WAIT_CH_RSP_STATE"); + break; + default: + DBG_871X_SEL_NL(m, "%-*sBIT(%d)\n", SpaceBtwnItemAndValueTmp, " ", j); + break; + } + } + } + + DBG_871X_SEL_NL(m, "%-*s = ", SpaceBtwnItemAndValue, "Wireless Mode"); + for (j = 0; j < 8; j++) + { + if (psta->wireless_mode & BIT(j)) + { + switch (BIT(j)) + { + case WIRELESS_11B: + DBG_871X_SEL_NL(m, "%4s", "11B "); + break; + case WIRELESS_11G: + DBG_871X_SEL_NL(m, "%4s", "11G "); + break; + case WIRELESS_11A: + DBG_871X_SEL_NL(m, "%4s", "11A "); + break; + case WIRELESS_11_24N: + DBG_871X_SEL_NL(m, "%7s", "11_24N "); + break; + case WIRELESS_11_5N: + DBG_871X_SEL_NL(m, "%6s", "11_5N "); + break; + case WIRELESS_AUTO: + DBG_871X_SEL_NL(m, "%5s", "AUTO "); + break; + case WIRELESS_11AC: + DBG_871X_SEL_NL(m, "%5s", "11AC "); + break; + } + } + } + DBG_871X_SEL_NL(m, "\n"); + + DBG_871X_SEL_NL(m, "%-*s = ", SpaceBtwnItemAndValue, "Bandwidth Mode"); + switch (psta->bw_mode) + { + case CHANNEL_WIDTH_20: + DBG_871X_SEL_NL(m, "%s\n", "20MHz"); + break; + case CHANNEL_WIDTH_40: + DBG_871X_SEL_NL(m, "%s\n", "40MHz"); + break; + case CHANNEL_WIDTH_80: + DBG_871X_SEL_NL(m, "%s\n", "80MHz"); + break; + case CHANNEL_WIDTH_160: + DBG_871X_SEL_NL(m, "%s\n", "160MHz"); + break; + case CHANNEL_WIDTH_80_80: + DBG_871X_SEL_NL(m, "%s\n", "80MHz + 80MHz"); + break; + } + + DBG_871X_SEL_NL(m, "%-*s = ", SpaceBtwnItemAndValue, "Privacy"); + switch (psta->dot118021XPrivacy) + { + case _NO_PRIVACY_: + DBG_871X_SEL_NL(m, "%s\n", "NO PRIVACY"); + break; + case _WEP40_: + DBG_871X_SEL_NL(m, "%s\n", "WEP 40"); + break; + case _TKIP_: + DBG_871X_SEL_NL(m, "%s\n", "TKIP"); + break; + case _TKIP_WTMIC_: + DBG_871X_SEL_NL(m, "%s\n", "TKIP WTMIC"); + break; + case _AES_: + DBG_871X_SEL_NL(m, "%s\n", "AES"); + break; + case _WEP104_: + DBG_871X_SEL_NL(m, "%s\n", "WEP 104"); + break; + case _WEP_WPA_MIXED_: + DBG_871X_SEL_NL(m, "%s\n", "WEP/WPA Mixed"); + break; + case _SMS4_: + DBG_871X_SEL_NL(m, "%s\n", "SMS4"); + break; +#ifdef CONFIG_IEEE80211W + case _BIP_: + DBG_871X_SEL_NL(m, "%s\n", "BIP"); + break; +#endif //CONFIG_IEEE80211W + } + + DBG_871X_SEL_NL(m, "%-*s = %d sec/%d sec\n", SpaceBtwnItemAndValue, "TPK Lifetime (Current/Expire)", psta->TPK_count, psta->TDLS_PeerKey_Lifetime); + DBG_871X_SEL_NL(m, "%-*s = %llu\n", SpaceBtwnItemAndValue, "Tx Packets Over Direct Link", psta->sta_stats.tx_pkts); + DBG_871X_SEL_NL(m, "%-*s = %llu\n", SpaceBtwnItemAndValue, "Rx Packets Over Direct Link", psta->sta_stats.rx_data_pkts); + } + } + } + _exit_critical_bh(&pstapriv->sta_hash_lock, &irqL); + if (NumOfTdlsStaToShow == 0) + { + DBG_871X_SEL_NL(m, "============[TDLS Peer STA Info]============\n"); + DBG_871X_SEL_NL(m, "No TDLS direct link exists!\n"); + } + + return 0; +} + +int proc_get_tdls_info(struct seq_file *m, void *v) +{ + struct net_device *dev = m->private; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; + struct wlan_network *cur_network = &(pmlmepriv->cur_network); + struct sta_priv *pstapriv = &padapter->stapriv; + struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; + struct sta_info *psta; + int i = 0, j = 0; + _irqL irqL; + _list *plist, *phead; + u8 SpaceBtwnItemAndValue = 41; + u8 SpaceBtwnItemAndValueTmp = 0; + u8 NumOfTdlsStaToShow = 0; + BOOLEAN FirstMatchFound = _FALSE; + + proc_tdls_display_tdls_function_info(m); + proc_tdls_display_network_info(m); + proc_tdls_display_tdls_sta_info(m); + + return 0; +} +#endif + +int proc_get_monitor(struct seq_file *m, void *v) +{ + struct net_device *dev = m->private; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; + + if (WIFI_MONITOR_STATE == get_fwstate(pmlmepriv)) { + DBG_871X_SEL_NL(m, "Monitor mode : Enable\n"); + + DBG_871X_SEL_NL(m, "ch=%d, ch_offset=%d, bw=%d\n", + rtw_get_oper_ch(padapter), rtw_get_oper_choffset(padapter), rtw_get_oper_bw(padapter)); + } else { + DBG_871X_SEL_NL(m, "Monitor mode : Disable\n"); + } + + return 0; +} + +ssize_t proc_set_monitor(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data) +{ + char tmp[32]; + struct net_device *dev = data; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + u8 target_chan, target_offset, target_bw; + + if (count < 3) { + DBG_871X("argument size is less than 3\n"); + return -EFAULT; + } + + if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) { + int num = sscanf(tmp, "%hhu %hhu %hhu", &target_chan, &target_offset, &target_bw); + + if (num != 3) { + DBG_871X("invalid write_reg parameter!\n"); + return count; + } + + padapter->mlmeextpriv.cur_channel = target_chan; + set_channel_bwmode(padapter, target_chan, target_offset, target_bw); + } + + return count; +} + #endif diff --git a/backports/drivers/realtek/rtl8812au/core/rtw_ieee80211.c b/backports/drivers/realtek/rtl8812au/core/rtw_ieee80211.c index 97eba25e0fee0c..5c5eca758b2670 100755 --- a/backports/drivers/realtek/rtl8812au/core/rtw_ieee80211.c +++ b/backports/drivers/realtek/rtl8812au/core/rtw_ieee80211.c @@ -19,6 +19,9 @@ ******************************************************************************/ #define _IEEE80211_C +#ifdef CONFIG_PLATFORM_INTEL_BYT +#include +#endif #include @@ -85,7 +88,7 @@ uint rtw_is_cckrates_included(u8 *rate) { if ( (((rate[i]) & 0x7f) == 2) || (((rate[i]) & 0x7f) == 4) || (((rate[i]) & 0x7f) == 11) || (((rate[i]) & 0x7f) == 22) ) - return _TRUE; + return _TRUE; i++; } @@ -101,8 +104,7 @@ uint rtw_is_cckratesonly_included(u8 *rate) { if ( (((rate[i]) & 0x7f) != 2) && (((rate[i]) & 0x7f) != 4) && (((rate[i]) & 0x7f) != 11) && (((rate[i]) & 0x7f) != 22) ) - - return _FALSE; + return _FALSE; i++; } @@ -150,7 +152,6 @@ u8 *rtw_set_ie uint *frlen //frame length ) { -_func_enter_; *pbuf = (u8)index; *(pbuf + 1) = (u8)len; @@ -161,7 +162,6 @@ _func_enter_; *frlen = *frlen + (len + 2); return (pbuf + len + 2); -_func_exit_; } inline u8 *rtw_set_ie_ch_switch(u8 *buf, u32 *buf_len, u8 ch_switch_mode, @@ -1112,7 +1112,7 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen, elems->wme_tspec_len = elen; break; default: - DBG_871X("unknown WME " + DBG_871X_LEVEL(_drv_warning_, "unknown WME " "information element ignored " "(subtype=%d len=%lu)\n", pos[4], (unsigned long) elen); @@ -1125,7 +1125,7 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen, elems->wps_ie_len = elen; break; default: - DBG_871X("Unknown Microsoft " + DBG_871X_LEVEL(_drv_warning_, "Unknown Microsoft " "information element ignored " "(type=%d len=%lu)\n", pos[3], (unsigned long) elen); @@ -1140,7 +1140,7 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen, elems->vendor_ht_cap_len = elen; break; default: - DBG_871X("Unknown Broadcom " + DBG_871X_LEVEL(_drv_warning_, "Unknown Broadcom " "information element ignored " "(type=%d len=%lu)\n", pos[3], (unsigned long) elen); @@ -1149,7 +1149,7 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen, break; default: - DBG_871X("unknown vendor specific information " + DBG_871X_LEVEL(_drv_warning_, "unknown vendor specific information " "element ignored (vendor OUI %02x:%02x:%02x " "len=%lu)\n", pos[0], pos[1], pos[2], (unsigned long) elen); @@ -1290,9 +1290,10 @@ ParseRes rtw_ieee802_11_parse_elems(u8 *start, uint len, unknown++; if (!show_errors) break; - DBG_871X("IEEE 802.11 element parse " - "ignored unknown element (id=%d elen=%d)\n", - id, elen); + DBG_871X_LEVEL(_drv_warning_, + "IEEE 802.11 element parse " + "ignored unknown element (id=%d elen=%d)\n", + id, elen); break; } @@ -1347,6 +1348,39 @@ u8 convert_ip_addr(u8 hch, u8 mch, u8 lch) return ((key_char2num(hch) * 100) + (key_char2num(mch) * 10 ) + key_char2num(lch)); } +#ifdef CONFIG_PLATFORM_INTEL_BYT +#define MAC_ADDRESS_LEN 12 + +int rtw_get_mac_addr_intel(unsigned char *buf) +{ + int ret = 0; + int i; + struct file *fp = NULL; + mm_segment_t oldfs; + unsigned char c_mac[MAC_ADDRESS_LEN]; + char fname[]="/config/wifi/mac.txt"; + int jj,kk; + + DBG_871X("%s Enter\n", __FUNCTION__); + + ret = rtw_retrive_from_file(fname, c_mac, MAC_ADDRESS_LEN); + if(ret < MAC_ADDRESS_LEN) + { + return -1; + } + + for( jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 2 ) + { + buf[jj] = key_2char2num(c_mac[kk], c_mac[kk+ 1]); + } + + DBG_871X("%s: read from file mac address: "MAC_FMT"\n", + __FUNCTION__, MAC_ARG(buf)); + + return 0; +} +#endif //CONFIG_PLATFORM_INTEL_BYT + extern char* rtw_initmac; void rtw_macaddr_cfg(u8 *mac_addr) { @@ -1363,6 +1397,12 @@ void rtw_macaddr_cfg(u8 *mac_addr) } _rtw_memcpy(mac_addr, mac, ETH_ALEN); } +#ifdef CONFIG_PLATFORM_INTEL_BYT + else if (0 == rtw_get_mac_addr_intel(mac)) + { + _rtw_memcpy(mac_addr, mac, ETH_ALEN); + } +#endif //CONFIG_PLATFORM_INTEL_BYT else { // Use the mac address stored in the Efuse _rtw_memcpy(mac, mac_addr, ETH_ALEN); @@ -1387,21 +1427,56 @@ void rtw_macaddr_cfg(u8 *mac_addr) DBG_871X("rtw_macaddr_cfg MAC Address = "MAC_FMT"\n", MAC_ARG(mac_addr)); } -void dump_ies(u8 *buf, u32 buf_len) +#ifdef CONFIG_80211N_HT +void dump_ht_cap_ie_content(void *sel, u8 *buf, u32 buf_len) +{ + if (buf_len != 26) { + DBG_871X_SEL_NL(sel, "Invalid HT capability IE len:%d != %d\n", buf_len, 26); + return; + } + + DBG_871X_SEL_NL(sel, "HT Capabilities Info:%02x%02x\n", *(buf), *(buf+1)); + DBG_871X_SEL_NL(sel, "A-MPDU Parameters:"HT_AMPDU_PARA_FMT"\n" + , HT_AMPDU_PARA_ARG(HT_CAP_ELE_AMPDU_PARA(buf))); + DBG_871X_SEL_NL(sel, "Supported MCS Set:"HT_SUP_MCS_SET_FMT"\n" + , HT_SUP_MCS_SET_ARG(HT_CAP_ELE_SUP_MCS_SET(buf))); +} + +void dump_ht_cap_ie(void *sel, u8 *ie, u32 ie_len) +{ + u8* pos = (u8*)ie; + u16 id; + u16 len; + + u8 *ht_cap_ie; + sint ht_cap_ielen; + + ht_cap_ie = rtw_get_ie(ie, _HT_CAPABILITY_IE_, &ht_cap_ielen, ie_len); + if(!ie || ht_cap_ie != ie) + return; + + dump_ht_cap_ie_content(sel, ht_cap_ie+2, ht_cap_ielen); +} +#endif /* CONFIG_80211N_HT */ + +void dump_ies(void *sel, u8 *buf, u32 buf_len) { u8* pos = (u8*)buf; u8 id, len; - while(pos-buf<=buf_len){ + while(pos-buf+10) - // dump_ies(ie, ielen); + // dump_ies(RTW_DBGDUMP, ie, ielen); break; } } @@ -1763,12 +1838,11 @@ void rtw_WLAN_BSSID_EX_remove_p2p_attr(WLAN_BSSID_EX *bss_ex, u8 attr_id) if( (p2p_ie=rtw_get_p2p_ie(bss_ex->IEs+_FIXED_IE_LENGTH_, bss_ex->IELength-_FIXED_IE_LENGTH_, NULL, &p2p_ielen_ori)) ) { - #if 0 - if(rtw_get_p2p_attr(p2p_ie, p2p_ielen_ori, attr_id, NULL, NULL)) { - DBG_871X("rtw_get_p2p_attr: GOT P2P_ATTR:%u!!!!!!!!\n", attr_id); - dump_ies(bss_ex->IEs+_FIXED_IE_LENGTH_, bss_ex->IELength-_FIXED_IE_LENGTH_); - } - #endif + if (0) + if(rtw_get_p2p_attr(p2p_ie, p2p_ielen_ori, attr_id, NULL, NULL)) { + DBG_871X("rtw_get_p2p_attr: GOT P2P_ATTR:%u!!!!!!!!\n", attr_id); + dump_ies(RTW_DBGDUMP, bss_ex->IEs+_FIXED_IE_LENGTH_, bss_ex->IELength-_FIXED_IE_LENGTH_); + } p2p_ielen=rtw_p2p_attr_remove(p2p_ie, p2p_ielen_ori, attr_id); if(p2p_ielen != p2p_ielen_ori) { @@ -1781,10 +1855,10 @@ void rtw_WLAN_BSSID_EX_remove_p2p_attr(WLAN_BSSID_EX *bss_ex, u8 attr_id) _rtw_memset(next_ie+remain_len, 0, p2p_ielen_ori-p2p_ielen); bss_ex->IELength -= p2p_ielen_ori-p2p_ielen; - #if 0 - DBG_871X("remove P2P_ATTR:%u!\n", attr_id); - dump_ies(bss_ex->IEs+_FIXED_IE_LENGTH_, bss_ex->IELength-_FIXED_IE_LENGTH_); - #endif + if (0) { + DBG_871X("remove P2P_ATTR:%u!\n", attr_id); + dump_ies(RTW_DBGDUMP, bss_ex->IEs+_FIXED_IE_LENGTH_, bss_ex->IELength-_FIXED_IE_LENGTH_); + } } } } @@ -1792,7 +1866,7 @@ void rtw_WLAN_BSSID_EX_remove_p2p_attr(WLAN_BSSID_EX *bss_ex, u8 attr_id) #endif //CONFIG_P2P #ifdef CONFIG_WFD -void dump_wfd_ie(u8 *ie, u32 ie_len) +void dump_wfd_ie(void *sel, u8 *ie, u32 ie_len) { u8* pos = (u8*)ie; u8 id; @@ -1809,7 +1883,7 @@ void dump_wfd_ie(u8 *ie, u32 ie_len) id = *pos; len = RTW_GET_BE16(pos+1); - DBG_871X("%s ID:%u, LEN:%u\n", __FUNCTION__, id, len); + DBG_871X_SEL_NL(sel, "%s ID:%u, LEN:%u\n", __FUNCTION__, id, len); pos+=(3+len); } diff --git a/backports/drivers/realtek/rtl8812au/core/rtw_io.c b/backports/drivers/realtek/rtl8812au/core/rtw_io.c index 576a614241d379..e4c0245769797f 100755 --- a/backports/drivers/realtek/rtl8812au/core/rtw_io.c +++ b/backports/drivers/realtek/rtl8812au/core/rtw_io.c @@ -316,9 +316,10 @@ void _rtw_read_port_cancel(_adapter *adapter) _read_port_cancel = pintfhdl->io_ops._read_port_cancel; + RTW_DISABLE_FUNC(adapter, DF_RX_BIT); + if(_read_port_cancel) _read_port_cancel(pintfhdl); - } u32 _rtw_write_port(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem) @@ -365,9 +366,10 @@ void _rtw_write_port_cancel(_adapter *adapter) _write_port_cancel = pintfhdl->io_ops._write_port_cancel; + RTW_DISABLE_FUNC(adapter, DF_TX_BIT); + if(_write_port_cancel) _write_port_cancel(pintfhdl); - } int rtw_init_io_priv(_adapter *padapter, void (*set_intf_ops)(_adapter *padapter,struct _io_ops *pops)) { diff --git a/backports/drivers/realtek/rtl8812au/core/rtw_ioctl_set.c b/backports/drivers/realtek/rtl8812au/core/rtw_ioctl_set.c index ea0686df9ff22c..e27a6cd66a04cd 100755 --- a/backports/drivers/realtek/rtl8812au/core/rtw_ioctl_set.c +++ b/backports/drivers/realtek/rtl8812au/core/rtw_ioctl_set.c @@ -673,7 +673,10 @@ _func_enter_; case Ndis802_11AutoUnknown: case Ndis802_11InfrastructureMax: - break; + break; + case Ndis802_11Monitor: + set_fwstate(pmlmepriv, WIFI_MONITOR_STATE); + break; } //SecClearAllKeys(adapter); @@ -707,7 +710,8 @@ _func_enter_; rtw_indicate_disconnect(padapter); //modify for CONFIG_IEEE80211W, none 11w can use it rtw_free_assoc_resources_cmd(padapter); - rtw_pwr_wakeup(padapter); + if (_FAIL == rtw_pwr_wakeup(padapter)) + DBG_871X("%s(): rtw_pwr_wakeup fail !!!\n",__FUNCTION__); } _exit_critical_bh(&pmlmepriv->lock, &irqL); @@ -1251,16 +1255,22 @@ _func_enter_; //Set key to CAM through H2C command + #if 0 if(bgrouptkey)//never go to here { - res=rtw_setstakey_cmd(padapter, (unsigned char *)stainfo, _FALSE, _TRUE); + res=rtw_setstakey_cmd(padapter, stainfo, GROUP_KEY, _TRUE); RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n rtw_set_802_11_add_key:rtw_setstakey_cmd(group)\n")); } else{ - res=rtw_setstakey_cmd(padapter, (unsigned char *)stainfo, _TRUE, _TRUE); + res=rtw_setstakey_cmd(padapter, stainfo, UNICAST_KEY, _TRUE); RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n rtw_set_802_11_add_key:rtw_setstakey_cmd(unicast)\n")); } + #else + res = rtw_setstakey_cmd(padapter, stainfo, UNICAST_KEY, _TRUE); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("\n rtw_set_802_11_add_key:rtw_setstakey_cmd(unicast)\n")); + #endif + if(res ==_FALSE) ret= _FAIL; diff --git a/backports/drivers/realtek/rtl8812au/core/rtw_iol.c b/backports/drivers/realtek/rtl8812au/core/rtw_iol.c index 45dc60d0bebea6..3524e1c5a5edb3 100755 --- a/backports/drivers/realtek/rtl8812au/core/rtw_iol.c +++ b/backports/drivers/realtek/rtl8812au/core/rtw_iol.c @@ -50,7 +50,7 @@ struct xmit_frame *rtw_IOL_accquire_xmit_frame(ADAPTER *adapter) pattrib = &xmit_frame->attrib; update_mgntframe_attrib(adapter, pattrib); - pattrib->qsel = 0x10;//Beacon + pattrib->qsel = QSLT_BEACON;//Beacon pattrib->subtype = WIFI_BEACON; pattrib->pktlen = pattrib->last_txcmdsz = 0; @@ -62,7 +62,7 @@ struct xmit_frame *rtw_IOL_accquire_xmit_frame(ADAPTER *adapter) else { pattrib = &xmit_frame->attrib; update_mgntframe_attrib(adapter, pattrib); - pattrib->qsel = 0x10; + pattrib->qsel = QSLT_BEACON; pattrib->pktlen = pattrib->last_txcmdsz = 0; } #endif diff --git a/backports/drivers/realtek/rtl8812au/core/rtw_mem.c b/backports/drivers/realtek/rtl8812au/core/rtw_mem.c new file mode 100644 index 00000000000000..a4de3e61431fb4 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/core/rtw_mem.c @@ -0,0 +1,103 @@ + +#include +#include + +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("Realtek Wireless Lan Driver"); +MODULE_AUTHOR("Realtek Semiconductor Corp."); +MODULE_VERSION("DRIVERVERSION"); + +struct sk_buff_head rtk_skb_mem_q; +struct u8* rtk_buf_mem[NR_RECVBUFF]; + +struct u8 * rtw_get_buf_premem(int index) +{ + printk("%s, rtk_buf_mem index : %d\n", __func__, index); + return rtk_buf_mem[index]; +} + +struct sk_buff *rtw_alloc_skb_premem(void) +{ + struct sk_buff *skb = NULL; + + skb = skb_dequeue(&rtk_skb_mem_q); + + printk("%s, rtk_skb_mem_q len : %d\n", __func__, skb_queue_len(&rtk_skb_mem_q)); + + return skb; +} +EXPORT_SYMBOL(rtw_alloc_skb_premem); + +int rtw_free_skb_premem(struct sk_buff *pskb) +{ + if(!pskb) + return -1; + + if(skb_queue_len(&rtk_skb_mem_q) >= NR_PREALLOC_RECV_SKB) + return -1; + + skb_queue_tail(&rtk_skb_mem_q, pskb); + + printk("%s, rtk_skb_mem_q len : %d\n", __func__, skb_queue_len(&rtk_skb_mem_q)); + + return 0; +} +EXPORT_SYMBOL(rtw_free_skb_premem); + +static int __init rtw_mem_init(void) +{ + int i; + SIZE_PTR tmpaddr=0; + SIZE_PTR alignment=0; + struct sk_buff *pskb=NULL; + + printk("%s\n", __func__); + +#ifdef CONFIG_USE_USB_BUFFER_ALLOC_RX + for(i=0; idata; + alignment = tmpaddr & (RECVBUFF_ALIGN_SZ-1); + skb_reserve(pskb, (RECVBUFF_ALIGN_SZ - alignment)); + + skb_queue_tail(&rtk_skb_mem_q, pskb); + } + else + { + printk("%s, alloc skb memory fail!\n", __func__); + } + + pskb=NULL; + } + + printk("%s, rtk_skb_mem_q len : %d\n", __func__, skb_queue_len(&rtk_skb_mem_q)); + + return 0; + +} + +static void __exit rtw_mem_exit(void) +{ + if (skb_queue_len(&rtk_skb_mem_q)) { + printk("%s, rtk_skb_mem_q len : %d\n", __func__, skb_queue_len(&rtk_skb_mem_q)); + } + + skb_queue_purge(&rtk_skb_mem_q); + + printk("%s\n", __func__); +} + +module_init(rtw_mem_init); +module_exit(rtw_mem_exit); + diff --git a/backports/drivers/realtek/rtl8812au/core/rtw_mlme.c b/backports/drivers/realtek/rtl8812au/core/rtw_mlme.c index 6430bf610e21e3..d3bd28dbf8c149 100755 --- a/backports/drivers/realtek/rtl8812au/core/rtw_mlme.c +++ b/backports/drivers/realtek/rtl8812au/core/rtw_mlme.c @@ -25,13 +25,6 @@ extern void indicate_wx_scan_complete_event(_adapter *padapter); extern u8 rtw_do_join(_adapter * padapter); -#ifdef CONFIG_DISABLE_MCS13TO15 -extern unsigned char MCS_rate_2R_MCS13TO15_OFF[16]; -extern unsigned char MCS_rate_2R[16]; -#else //CONFIG_DISABLE_MCS13TO15 -extern unsigned char MCS_rate_2R[16]; -#endif //CONFIG_DISABLE_MCS13TO15 -extern unsigned char MCS_rate_1R[16]; sint _rtw_init_mlme_priv (_adapter* padapter) { @@ -162,7 +155,10 @@ void rtw_free_mlme_priv_ie_data(struct mlme_priv *pmlmepriv) void _rtw_free_mlme_priv (struct mlme_priv *pmlmepriv) { _func_enter_; - + if (NULL == pmlmepriv){ + rtw_warn_on(1); + goto exit; + } rtw_free_mlme_priv_ie_data(pmlmepriv); if(pmlmepriv){ @@ -172,6 +168,7 @@ _func_enter_; rtw_vmfree(pmlmepriv->free_bss_buf, MAX_BSS_CNT * sizeof(struct wlan_network)); } } +exit: _func_exit_; } @@ -540,15 +537,18 @@ void rtw_free_network(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork _func_enter_; RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("rtw_free_network==> ssid = %s \n\n" , pnetwork->network.Ssid.Ssid)); _rtw_free_network(pmlmepriv, pnetwork, is_freeall); -_func_exit_; +_func_exit_; } -void rtw_free_network_nolock(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork ); -void rtw_free_network_nolock(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork ) +void rtw_free_network_nolock(_adapter * padapter, struct wlan_network *pnetwork ); +void rtw_free_network_nolock(_adapter * padapter, struct wlan_network *pnetwork ) { _func_enter_; //RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("rtw_free_network==> ssid = %s \n\n" , pnetwork->network.Ssid.Ssid)); - _rtw_free_network_nolock(pmlmepriv, pnetwork); + _rtw_free_network_nolock(&(padapter->mlmepriv), pnetwork); +#ifdef CONFIG_IOCTL_CFG80211 + rtw_cfg80211_unlink_bss(padapter, pnetwork); +#endif //CONFIG_IOCTL_CFG80211 _func_exit_; } @@ -867,7 +867,9 @@ void rtw_update_scanned_network(_adapter *adapter, WLAN_BSSID_EX *target) ULONG bssid_ex_sz; struct mlme_priv *pmlmepriv = &(adapter->mlmepriv); struct mlme_ext_priv *pmlmeext = &(adapter->mlmeextpriv); - struct wifidirect_info *pwdinfo= &(adapter->wdinfo); +#ifdef CONFIG_P2P + struct wifidirect_info *pwdinfo= &(adapter->wdinfo); +#endif // CONFIG_P2P _queue *queue = &(pmlmepriv->scanned_queue); struct wlan_network *pnetwork = NULL; struct wlan_network *oldest = NULL; @@ -895,7 +897,7 @@ _func_enter_; rtw_bug_check(pnetwork, pnetwork, pnetwork, pnetwork); #ifdef CONFIG_P2P - if (!rtw_p2p_chk_state(&(adapter->wdinfo), P2P_STATE_NONE) && + if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE) && (_rtw_memcmp(pnetwork->network.MacAddress, target->MacAddress, ETH_ALEN) == _TRUE)) { target_find = 1; @@ -929,7 +931,10 @@ _func_enter_; /* If there are no more slots, expire the oldest */ //list_del_init(&oldest->list); pnetwork = oldest; - + if(pnetwork==NULL){ + RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("\n\n\nsomething wrong here\n\n\n")); + goto exit; + } #ifdef CONFIG_ANTENNA_DIVERSITY //target->PhyInfo.Optimum_antenna = pHalData->CurAntenna;//optimum_antenna=>For antenna diversity rtw_hal_get_def_var(adapter, HAL_DEF_CURRENT_ANTENNA, &(target->PhyInfo.Optimum_antenna)); @@ -1020,7 +1025,8 @@ _func_enter_; //_enter_critical_bh(&queue->lock, &irqL); #if defined(CONFIG_P2P) && defined(CONFIG_P2P_REMOVE_GROUP_INFO) - rtw_WLAN_BSSID_EX_remove_p2p_attr(pnetwork, P2P_ATTR_GROUP_INFO); + if (adapter->registrypriv.wifi_spec == 0) + rtw_WLAN_BSSID_EX_remove_p2p_attr(pnetwork, P2P_ATTR_GROUP_INFO); #endif update_current_network(adapter, pnetwork); @@ -1198,46 +1204,34 @@ _func_exit_; void rtw_surveydone_event_callback(_adapter *adapter, u8 *pbuf) { _irqL irqL; - u8 timer_cancelled = _FALSE; + u8 timer_cancelled; struct mlme_priv *pmlmepriv = &(adapter->mlmepriv); - -#ifdef CONFIG_MLME_EXT +#ifdef CONFIG_MLME_EXT mlmeext_surveydone_event_callback(adapter); - #endif -_func_enter_; +_func_enter_; _enter_critical_bh(&pmlmepriv->lock, &irqL); - if(pmlmepriv->wps_probe_req_ie) - { + if (pmlmepriv->wps_probe_req_ie) { u32 free_len = pmlmepriv->wps_probe_req_ie_len; pmlmepriv->wps_probe_req_ie_len = 0; rtw_mfree(pmlmepriv->wps_probe_req_ie, free_len); - pmlmepriv->wps_probe_req_ie = NULL; + pmlmepriv->wps_probe_req_ie = NULL; } - + RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("rtw_surveydone_event_callback: fw_state:%x\n\n", get_fwstate(pmlmepriv))); - - if (check_fwstate(pmlmepriv,_FW_UNDER_SURVEY)) - { - //u8 timer_cancelled; - timer_cancelled = _TRUE; - //_cancel_timer(&pmlmepriv->scan_to_timer, &timer_cancelled); - - _clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY); - } - else { - - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("nic status =%x, survey done event comes too late!\n", get_fwstate(pmlmepriv))); + if (check_fwstate(pmlmepriv,_FW_UNDER_SURVEY) == _FALSE) { + DBG_871X(FUNC_ADPT_FMT" fw_state:0x%x\n", FUNC_ADPT_ARG(adapter), get_fwstate(pmlmepriv)); + //rtw_warn_on(1); } - _exit_critical_bh(&pmlmepriv->lock, &irqL); - if(timer_cancelled) - _cancel_timer(&pmlmepriv->scan_to_timer, &timer_cancelled); + _clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY); + _exit_critical_bh(&pmlmepriv->lock, &irqL); + _cancel_timer(&pmlmepriv->scan_to_timer, &timer_cancelled); _enter_critical_bh(&pmlmepriv->lock, &irqL); @@ -1253,12 +1247,12 @@ _func_enter_; { set_fwstate(pmlmepriv, _FW_UNDER_LINKING); - if(rtw_select_and_join_from_scanned_queue(pmlmepriv)==_SUCCESS) - { - _set_timer(&pmlmepriv->assoc_timer, MAX_JOIN_TIMEOUT ); - } - else - { + if(rtw_select_and_join_from_scanned_queue(pmlmepriv)==_SUCCESS) + { + _set_timer(&pmlmepriv->assoc_timer, MAX_JOIN_TIMEOUT); + } + else + { WLAN_BSSID_EX *pdev_network = &(adapter->registrypriv.dev_network); u8 *pibss = adapter->registrypriv.dev_network.MacAddress; @@ -1378,6 +1372,30 @@ _func_enter_; rtw_indicate_scan_done(adapter, _FALSE); +#if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_IOCTL_CFG80211) + if (adapter->pbuddy_adapter) { + _adapter *buddy_adapter = adapter->pbuddy_adapter; + struct mlme_priv *buddy_mlme = &(buddy_adapter->mlmepriv); + struct rtw_wdev_priv *buddy_wdev_priv = adapter_wdev_data(buddy_adapter); + bool indicate_buddy_scan = _FALSE; + + _enter_critical_bh(&buddy_wdev_priv->scan_req_lock, &irqL); + if (buddy_wdev_priv->scan_request && buddy_mlme->scanning_via_buddy_intf == _TRUE) { + buddy_mlme->scanning_via_buddy_intf = _FALSE; + clr_fwstate(buddy_mlme, _FW_UNDER_SURVEY); + indicate_buddy_scan = _TRUE; + } + _exit_critical_bh(&buddy_wdev_priv->scan_req_lock, &irqL); + + if (indicate_buddy_scan == _TRUE) { + #ifdef CONFIG_IOCTL_CFG80211 + rtw_cfg80211_surveydone_event_callback(buddy_adapter); + #endif + rtw_indicate_scan_done(buddy_adapter, _FALSE); + } + } +#endif /* CONFIG_CONCURRENT_MODE */ + _func_exit_; } @@ -1422,6 +1440,14 @@ _func_enter_; _func_exit_; } + +void rtw_reset_rx_info(struct debug_priv *pdbgpriv){ + pdbgpriv->dbg_rx_ampdu_drop_count = 0; + pdbgpriv->dbg_rx_ampdu_forced_indicate_count = 0; + pdbgpriv->dbg_rx_ampdu_loss_count = 0; + pdbgpriv->dbg_rx_dup_mgt_frame_drop_count = 0; + pdbgpriv->dbg_rx_ampdu_window_shift_cnt = 0; +} /* *rtw_free_assoc_resources: the caller has to lock pmlmepriv->lock @@ -1430,9 +1456,12 @@ void rtw_free_assoc_resources(_adapter *adapter, int lock_scanned_queue) { _irqL irqL; struct wlan_network* pwlan = NULL; - struct mlme_priv *pmlmepriv = &adapter->mlmepriv; - struct sta_priv *pstapriv = &adapter->stapriv; + struct mlme_priv *pmlmepriv = &adapter->mlmepriv; + struct sta_priv *pstapriv = &adapter->stapriv; struct wlan_network *tgt_network = &pmlmepriv->cur_network; + struct dvobj_priv *psdpriv = adapter->dvobj; + struct debug_priv *pdbgpriv = &psdpriv->drv_dbg; + #ifdef CONFIG_TDLS struct tdls_info *ptdlsinfo = &adapter->tdlsinfo; @@ -1450,21 +1479,20 @@ _func_enter_; psta = rtw_get_stainfo(&adapter->stapriv, tgt_network->network.MacAddress); #ifdef CONFIG_TDLS - if(ptdlsinfo->link_established == _TRUE) - { - rtw_tdls_cmd(adapter, myid(&(adapter->eeprompriv)), TDLS_RS_RCR); + if (ptdlsinfo->link_established == _TRUE) { + rtw_tdls_cmd(adapter, NULL, TDLS_RS_RCR); rtw_reset_tdls_info(adapter); rtw_free_all_stainfo(adapter); - _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); + //_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); } else #endif //CONFIG_TDLS { - _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); + //_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); rtw_free_stainfo(adapter, psta); } - _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); + //_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); } @@ -1475,9 +1503,9 @@ _func_enter_; rtw_free_all_stainfo(adapter); psta = rtw_get_bcmc_stainfo(adapter); - _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); + //_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); rtw_free_stainfo(adapter, psta); - _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); + //_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); rtw_init_bcmc_stainfo(adapter); } @@ -1489,32 +1517,14 @@ _func_enter_; if(pwlan) { pwlan->fixed = _FALSE; + + DBG_871X("free disconnecting network\n"); + rtw_free_network_nolock(adapter, pwlan); #ifdef CONFIG_P2P if(!rtw_p2p_chk_state(&adapter->wdinfo, P2P_STATE_NONE)) { - u32 p2p_ielen=0; - u8 *p2p_ie; - //u16 capability; - u8 *pcap = NULL; - u32 capability_len=0; - - //DBG_871X("free disconnecting network\n"); - //rtw_free_network_nolock(pmlmepriv, pwlan); - - if((p2p_ie=rtw_get_p2p_ie(pwlan->network.IEs+_FIXED_IE_LENGTH_, pwlan->network.IELength-_FIXED_IE_LENGTH_, NULL, &p2p_ielen))) - { - pcap = rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, NULL, &capability_len); - if(pcap && capability_len==2) - { - u16 cap = *(u16*)pcap ; - *(u16*)pcap = cap&0x00ff;//clear group capability when free this network - } - - } - rtw_set_scan_deny(adapter, 2000); - //rtw_clear_scan_deny(adapter); - + //rtw_clear_scan_deny(adapter); } #endif //CONFIG_P2P } @@ -1527,7 +1537,7 @@ _func_enter_; if((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) && (adapter->stapriv.asoc_sta_count== 1)) /*||check_fwstate(pmlmepriv, WIFI_STATION_STATE)*/) { - rtw_free_network_nolock(pmlmepriv, pwlan); + rtw_free_network_nolock(adapter, pwlan); } if(lock_scanned_queue) @@ -1535,6 +1545,8 @@ _func_enter_; adapter->securitypriv.key_mask = 0; + rtw_reset_rx_info(pdbgpriv); + _func_exit_; } @@ -1608,6 +1620,8 @@ void rtw_indicate_disconnect( _adapter *padapter ) WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network); struct sta_info *psta; struct sta_priv *pstapriv = &padapter->stapriv; + u8 *wps_ie=NULL; + uint wpsie_len=0; _func_enter_; @@ -1615,6 +1629,22 @@ _func_enter_; _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING|WIFI_UNDER_WPS); + // force to clear cur_network_scanned's SELECTED REGISTRAR + if (pmlmepriv->cur_network_scanned) { + WLAN_BSSID_EX *current_joined_bss = &(pmlmepriv->cur_network_scanned->network); + if (current_joined_bss) { + wps_ie=rtw_get_wps_ie(current_joined_bss->IEs +_FIXED_IE_LENGTH_, + current_joined_bss->IELength-_FIXED_IE_LENGTH_, NULL, &wpsie_len); + if (wps_ie && wpsie_len>0) { + u8 *attr = NULL; + u32 attr_len; + attr=rtw_get_wps_attr(wps_ie, wpsie_len, WPS_ATTR_SELECTED_REGISTRAR, + NULL, &attr_len); + if (attr) + *(attr + 4) = 0; + } + } + } //DBG_871X("clear wps when %s\n", __func__); if(rtw_to_roam(padapter) > 0) @@ -1713,7 +1743,7 @@ void rtw_scan_abort(_adapter *adapter) #ifdef CONFIG_PLATFORM_MSTAR //_clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY); set_survey_timer(pmlmeext, 0); - _set_timer(&pmlmepriv->scan_to_timer, 50); + mlme_set_scan_to_timer(pmlmepriv, 50); #endif rtw_indicate_scan_done(adapter, _TRUE); } @@ -1781,6 +1811,7 @@ static struct sta_info *rtw_joinbss_update_stainfo(_adapter *padapter, struct wl _rtw_memset((u8 *)&psta->dot11tkiptxmickey, 0, sizeof (union Keytype)); _rtw_memset((u8 *)&psta->dot11txpn, 0, sizeof (union pn48)); + psta->dot11txpn.val = psta->dot11txpn.val + 1; #ifdef CONFIG_IEEE80211W _rtw_memset((u8 *)&psta->dot11wtxpn, 0, sizeof (union pn48)); #endif //CONFIG_IEEE80211W @@ -1812,6 +1843,7 @@ static struct sta_info *rtw_joinbss_update_stainfo(_adapter *padapter, struct wl #endif preorder_ctrl->wend_b= 0xffff; preorder_ctrl->wsize_b = 64;//max_ampdu_sz;//ex. 32(kbytes) -> wsize_b=32 + preorder_ctrl->ampdu_size = RX_AMPDU_SIZE_INVALID; } @@ -1830,6 +1862,7 @@ static struct sta_info *rtw_joinbss_update_stainfo(_adapter *padapter, struct wl #endif preorder_ctrl->wend_b= 0xffff; preorder_ctrl->wsize_b = 64;//max_ampdu_sz;//ex. 32(kbytes) -> wsize_b=32 + preorder_ctrl->ampdu_size = RX_AMPDU_SIZE_INVALID; } } } @@ -2002,9 +2035,9 @@ _func_enter_; pcur_sta = rtw_get_stainfo(pstapriv, cur_network->network.MacAddress); if(pcur_sta){ - _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL2); + //_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL2); rtw_free_stainfo(adapter, pcur_sta); - _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL2); + //_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL2); } ptarget_wlan = rtw_find_network(&pmlmepriv->scanned_queue, pnetwork->network.MacAddress); @@ -2289,6 +2322,10 @@ _func_enter_; rtw_indicate_sta_assoc_event(adapter, psta); #endif //!CONFIG_IOCTL_CFG80211 #endif //!CONFIG_AUTO_AP_MODE + +#ifdef CONFIG_BEAMFORMING + beamforming_wk_cmd(adapter, BEAMFORMING_CTRL_ENTER, (u8 *)psta, sizeof(struct sta_info), 0); +#endif } goto exit; } @@ -2351,7 +2388,7 @@ _func_enter_; #ifdef CONFIG_RTL8711 //submit SetStaKey_cmd to tell fw, fw will allocate an CAM entry for this sta - rtw_setstakey_cmd(adapter, (unsigned char*)psta, _FALSE, _TRUE); + rtw_setstakey_cmd(adapter, psta, GROUP_KEY, _TRUE); #endif exit: @@ -2446,13 +2483,14 @@ _func_enter_; rtw_free_assoc_resources(adapter, 1); rtw_indicate_disconnect(adapter); + rtw_free_mlme_priv_ie_data(pmlmepriv); _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); // remove the network entry in scanned_queue pwlan = rtw_find_network(&pmlmepriv->scanned_queue, tgt_network->network.MacAddress); if (pwlan) { pwlan->fixed = _FALSE; - rtw_free_network_nolock(pmlmepriv, pwlan); + rtw_free_network_nolock(adapter, pwlan); } _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); @@ -2468,9 +2506,9 @@ _func_enter_; check_fwstate(pmlmepriv,WIFI_ADHOC_STATE)) { - _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); + //_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); rtw_free_stainfo(adapter, psta); - _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); + //_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); if(adapter->stapriv.asoc_sta_count== 1) //a sta + bc/mc_stainfo (not Ibss_stainfo) { @@ -2482,7 +2520,7 @@ _func_enter_; if(pwlan) { pwlan->fixed = _FALSE; - rtw_free_network_nolock(pmlmepriv, pwlan); + rtw_free_network_nolock(adapter, pwlan); } _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); //re-create ibss @@ -2542,6 +2580,17 @@ _func_exit_; } + +void rtw_wmm_event_callback(PADAPTER padapter, u8 *pbuf) +{ +_func_enter_; + + WMMOnAssocRsp(padapter); + +_func_exit_; + +} + /* * _rtw_join_timeout_handler - Timeout/faliure handler for CMD JoinBss * @adapter: pointer to _adapter structure @@ -2628,23 +2677,48 @@ _func_exit_; void rtw_scan_timeout_handler (_adapter *adapter) { _irqL irqL; - struct mlme_priv *pmlmepriv = &adapter->mlmepriv; - + struct mlme_priv *pmlmepriv = &adapter->mlmepriv; DBG_871X(FUNC_ADPT_FMT" fw_state=%x\n", FUNC_ADPT_ARG(adapter), get_fwstate(pmlmepriv)); _enter_critical_bh(&pmlmepriv->lock, &irqL); _clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY); - + _exit_critical_bh(&pmlmepriv->lock, &irqL); - + +#ifdef CONFIG_IOCTL_CFG80211 + rtw_cfg80211_surveydone_event_callback(adapter); +#endif //CONFIG_IOCTL_CFG80211 + rtw_indicate_scan_done(adapter, _TRUE); +#if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_IOCTL_CFG80211) + if (adapter->pbuddy_adapter) { + _adapter *buddy_adapter = adapter->pbuddy_adapter; + struct mlme_priv *buddy_mlme = &(buddy_adapter->mlmepriv); + struct rtw_wdev_priv *buddy_wdev_priv = adapter_wdev_data(buddy_adapter); + bool indicate_buddy_scan = _FALSE; + + _enter_critical_bh(&buddy_wdev_priv->scan_req_lock, &irqL); + if (buddy_wdev_priv->scan_request && buddy_mlme->scanning_via_buddy_intf == _TRUE) { + buddy_mlme->scanning_via_buddy_intf = _FALSE; + clr_fwstate(buddy_mlme, _FW_UNDER_SURVEY); + indicate_buddy_scan = _TRUE; + } + _exit_critical_bh(&buddy_wdev_priv->scan_req_lock, &irqL); + + if (indicate_buddy_scan == _TRUE) { + rtw_indicate_scan_done(buddy_adapter, _TRUE); + } + } +#endif /* CONFIG_CONCURRENT_MODE */ } void rtw_mlme_reset_auto_scan_int(_adapter *adapter) { struct mlme_priv *mlme = &adapter->mlmepriv; + struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv; + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); #ifdef CONFIG_P2P if(!rtw_p2p_chk_state(&adapter->wdinfo, P2P_STATE_NONE)) { @@ -2652,8 +2726,11 @@ void rtw_mlme_reset_auto_scan_int(_adapter *adapter) goto exit; } #endif - - if(adapter->registrypriv.wifi_spec) { + if(pmlmeinfo->VHT_enable) //disable auto scan when connect to 11AC AP + { + mlme->auto_scan_int_ms = 0; + } + else if(adapter->registrypriv.wifi_spec && is_client_associated_to_ap(adapter) == _TRUE) { mlme->auto_scan_int_ms = 60*1000; #ifdef CONFIG_LAYER2_ROAMING } else if(rtw_chk_roam_flags(adapter, RTW_ROAM_ACTIVE)) { @@ -2761,7 +2838,7 @@ void rtw_dynamic_check_timer_handlder(_adapter *adapter) { u8 bEnterPS; - linked_status_chk(adapter); + linked_status_chk(adapter, 1); bEnterPS = traffic_status_watchdog(adapter, 1); if(bEnterPS) @@ -2844,7 +2921,7 @@ inline void rtw_clear_scan_deny(_adapter *adapter) struct mlme_priv *mlmepriv = &adapter->mlmepriv; ATOMIC_SET(&mlmepriv->set_scan_deny, 0); if (0) - DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(adapter)); + DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(adapter)); } void rtw_set_scan_deny_timer_hdl(_adapter *adapter) @@ -2860,7 +2937,7 @@ void rtw_set_scan_deny(_adapter *adapter, u32 ms) #endif if (0) - DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(adapter)); + DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(adapter)); ATOMIC_SET(&mlmepriv->set_scan_deny, 1); _set_timer(&mlmepriv->set_scan_deny_timer, ms); @@ -2869,7 +2946,7 @@ void rtw_set_scan_deny(_adapter *adapter, u32 ms) return; if (0) - DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(adapter->pbuddy_adapter)); + DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(adapter->pbuddy_adapter)); b_mlmepriv = &adapter->pbuddy_adapter->mlmepriv; ATOMIC_SET(&b_mlmepriv->set_scan_deny, 1); _set_timer(&b_mlmepriv->set_scan_deny_timer, ms); @@ -2969,11 +3046,11 @@ _func_enter_; mlme->pscanned = get_next(mlme->pscanned); if (0) - DBG_871X("%s("MAC_FMT", ch%u) rssi:%d\n" - , pnetwork->network.Ssid.Ssid - , MAC_ARG(pnetwork->network.MacAddress) - , pnetwork->network.Configuration.DSConfig - , (int)pnetwork->network.Rssi); + DBG_871X("%s("MAC_FMT", ch%u) rssi:%d\n" + , pnetwork->network.Ssid.Ssid + , MAC_ARG(pnetwork->network.MacAddress) + , pnetwork->network.Configuration.DSConfig + , (int)pnetwork->network.Rssi); rtw_check_roaming_candidate(mlme, &candidate, pnetwork); @@ -3021,7 +3098,7 @@ static int rtw_check_join_candidate(struct mlme_priv *mlme } //check ssid, if needed - if(mlme->assoc_ssid.Ssid && mlme->assoc_ssid.SsidLength) { + if(mlme->assoc_ssid.Ssid[0] && mlme->assoc_ssid.SsidLength) { if( competitor->network.Ssid.SsidLength != mlme->assoc_ssid.SsidLength || _rtw_memcmp(competitor->network.Ssid.Ssid, mlme->assoc_ssid.Ssid, mlme->assoc_ssid.SsidLength) == _FALSE ) @@ -3119,11 +3196,11 @@ _func_enter_; pmlmepriv->pscanned = get_next(pmlmepriv->pscanned); if (0) - DBG_871X("%s("MAC_FMT", ch%u) rssi:%d\n" - , pnetwork->network.Ssid.Ssid - , MAC_ARG(pnetwork->network.MacAddress) - , pnetwork->network.Configuration.DSConfig - , (int)pnetwork->network.Rssi); + DBG_871X("%s("MAC_FMT", ch%u) rssi:%d\n" + , pnetwork->network.Ssid.Ssid + , MAC_ARG(pnetwork->network.MacAddress) + , pnetwork->network.Configuration.DSConfig + , (int)pnetwork->network.Rssi); rtw_check_join_candidate(pmlmepriv, &candidate, pnetwork); @@ -3429,22 +3506,67 @@ static int SecIsInPMKIDList(_adapter *Adapter, u8 *bssid) // 13th element in the array is the IE length // -static int rtw_append_pmkid(_adapter *Adapter,int iEntry, u8 *ie, uint ie_len) +static int rtw_append_pmkid(_adapter *adapter,int iEntry, u8 *ie, uint ie_len) { - struct security_priv *psecuritypriv=&Adapter->securitypriv; + struct security_priv *sec=&adapter->securitypriv; - if(ie[13]<=20){ - // The RSN IE didn't include the PMK ID, append the PMK information - ie[ie_len]=1; - ie_len++; - ie[ie_len]=0; //PMKID count = 0x0100 - ie_len++; - _rtw_memcpy( &ie[ie_len], &psecuritypriv->PMKIDList[iEntry].PMKID, 16); - - ie_len+=16; - ie[13]+=18;//PMKID length = 2+16 + if (ie[13] > 20) { + int i; + u16 pmkid_cnt = RTW_GET_LE16(ie+14+20); + if (pmkid_cnt == 1 && _rtw_memcmp(ie+14+20+2, &sec->PMKIDList[iEntry].PMKID, 16)) { + DBG_871X(FUNC_ADPT_FMT" has carried the same PMKID:"KEY_FMT"\n" + , FUNC_ADPT_ARG(adapter), KEY_ARG(&sec->PMKIDList[iEntry].PMKID)); + goto exit; + } + DBG_871X(FUNC_ADPT_FMT" remove original PMKID, count:%u\n" + , FUNC_ADPT_ARG(adapter), pmkid_cnt); + + for (i=0;iPMKIDList[iEntry].PMKID)); + + RTW_PUT_LE16(&ie[ie_len], 1); + ie_len += 2; + + _rtw_memcpy(&ie[ie_len], &sec->PMKIDList[iEntry].PMKID, 16); + ie_len += 16; + + ie[13] += 18;//PMKID length = 2+16 + } + +exit: + return (ie_len); +} + +static int rtw_remove_pmkid(_adapter *adapter, u8 *ie, uint ie_len) +{ + struct security_priv *sec=&adapter->securitypriv; + int i; + u16 pmkid_cnt = RTW_GET_LE16(ie+14+20); + + if (ie[13] <= 20) + goto exit; + + DBG_871X(FUNC_ADPT_FMT" remove original PMKID, count:%u\n" + , FUNC_ADPT_ARG(adapter), pmkid_cnt); + + for (i=0;iassoc_bssid); if(iEntry<0) { - return ielength; + if(authmode == _WPA2_IE_ID_) + ielength = rtw_remove_pmkid(adapter, out_ie, ielength); } else { if(authmode == _WPA2_IE_ID_) - { ielength=rtw_append_pmkid(adapter, iEntry, out_ie, ielength); - } } _func_exit_; @@ -3635,17 +3756,10 @@ void rtw_joinbss_reset(_adapter *padapter) { u8 threshold; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - -#ifdef CONFIG_80211N_HT - struct ht_priv *phtpriv = &pmlmepriv->htpriv; -#endif - //todo: if you want to do something io/reg/hw setting before join_bss, please add code here - - - -#ifdef CONFIG_80211N_HT +#ifdef CONFIG_80211N_HT + struct ht_priv *phtpriv = &pmlmepriv->htpriv; pmlmepriv->num_FortyMHzIntolerant = 0; @@ -3669,9 +3783,9 @@ void rtw_joinbss_reset(_adapter *padapter) threshold = 1; rtw_hal_set_hwreg(padapter, HW_VAR_RXDMA_AGG_PG_TH, (u8 *)(&threshold)); } -#endif +#endif//#if defined( CONFIG_USB_HCI) || defined (CONFIG_SDIO_HCI) -#endif +#endif//#ifdef CONFIG_80211N_HT } @@ -3731,12 +3845,12 @@ void rtw_ht_use_default_setting(_adapter *padapter) rtw_hal_get_def_var(padapter, HAL_DEF_EXPLICIT_BEAMFORMER, (u8 *)&bHwSupportBeamformer); rtw_hal_get_def_var(padapter, HAL_DEF_EXPLICIT_BEAMFORMEE, (u8 *)&bHwSupportBeamformee); CLEAR_FLAGS(phtpriv->beamform_cap); - if(TEST_FLAG(pregistrypriv->beamform_cap, BIT0) && bHwSupportBeamformer) + if(TEST_FLAG(pregistrypriv->beamform_cap, BIT4) && bHwSupportBeamformer) { SET_FLAG(phtpriv->beamform_cap, BEAMFORMING_HT_BEAMFORMER_ENABLE); DBG_871X("[HT] Support Beamformer\n"); } - if(TEST_FLAG(pregistrypriv->beamform_cap, BIT1) && bHwSupportBeamformee) + if(TEST_FLAG(pregistrypriv->beamform_cap, BIT5) && bHwSupportBeamformee) { SET_FLAG(phtpriv->beamform_cap, BEAMFORMING_HT_BEAMFORMEE_ENABLE); DBG_871X("[HT] Support Beamformee\n"); @@ -3759,7 +3873,7 @@ void rtw_build_wmm_ie_ht(_adapter *padapter, u8 *out_ie, uint *pout_len) } } -//the fucntion is >= passive_level +/* the fucntion is >= passive_level */ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, uint in_len, uint *pout_len, u8 channel) { u32 ielen, out_len; @@ -3770,6 +3884,7 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui struct registry_priv *pregistrypriv = &padapter->registrypriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct ht_priv *phtpriv = &pmlmepriv->htpriv; + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; phtpriv->ht_option = _FALSE; @@ -3782,34 +3897,29 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui if (phtpriv->sgi_20m) ht_capie.cap_info |= IEEE80211_HT_CAP_SGI_20; - // Get HT BW - if(in_ie == NULL) - { - //TDLS: TODO 20/40 issue - if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) - { + /* Get HT BW */ + if (in_ie == NULL) { + /* TDLS: TODO 20/40 issue */ + if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) { operation_bw = padapter->mlmeextpriv.cur_bwmode; - if(operation_bw > CHANNEL_WIDTH_40); + if (operation_bw > CHANNEL_WIDTH_40) operation_bw = CHANNEL_WIDTH_40; - } - else - //TDLS: TODO 40? + } else + /* TDLS: TODO 40? */ operation_bw = CHANNEL_WIDTH_40; - } - else - { + } else { p = rtw_get_ie(in_ie, _HT_ADD_INFO_IE_, &ielen, in_len); - if(p && (ielen==sizeof(struct ieee80211_ht_addt_info))) { + if (p && (ielen == sizeof(struct ieee80211_ht_addt_info))) { struct HT_info_element *pht_info = (struct HT_info_element *)(p+2); if (pht_info->infos[0] & BIT(2)) { switch (pht_info->infos[0] & 0x3) { - case 1: - case 3: - operation_bw = CHANNEL_WIDTH_40; - break; - default: - operation_bw = CHANNEL_WIDTH_20; - break; + case 1: + case 3: + operation_bw = CHANNEL_WIDTH_40; + break; + default: + operation_bw = CHANNEL_WIDTH_20; + break; } } else { operation_bw = CHANNEL_WIDTH_20; @@ -3817,7 +3927,7 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui } } - //to disable 40M Hz support while gd_bw_40MHz_en = 0 + /* to disable 40M Hz support while gd_bw_40MHz_en = 0 */ if (channel > 14) { if ((pregistrypriv->bw_mode & 0xf0) > 0) cbw40_enable = 1; @@ -3835,50 +3945,51 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui if (TEST_FLAG(phtpriv->stbc_cap, STBC_HT_ENABLE_TX)) ht_capie.cap_info |= IEEE80211_HT_CAP_TX_STBC; - //todo: disable SM power save mode + /* todo: disable SM power save mode */ ht_capie.cap_info |= IEEE80211_HT_CAP_SM_PS; - if (TEST_FLAG(padapter->mlmepriv.htpriv.stbc_cap, STBC_HT_ENABLE_RX)) { - if((pregistrypriv->rx_stbc == 0x3) ||//enable for 2.4/5 GHz - ((channel <= 14) && (pregistrypriv->rx_stbc == 0x1)) || //enable for 2.4GHz - ((channel > 14) && (pregistrypriv->rx_stbc == 0x2)) || //enable for 5GHz - (pregistrypriv->wifi_spec==1)) - { + if (TEST_FLAG(phtpriv->stbc_cap, STBC_HT_ENABLE_RX)) { + if((pregistrypriv->rx_stbc == 0x3) || /* enable for 2.4/5 GHz */ + ((channel <= 14) && (pregistrypriv->rx_stbc == 0x1)) || /* enable for 2.4GHz */ + ((channel > 14) && (pregistrypriv->rx_stbc == 0x2)) || /* enable for 5GHz */ + (pregistrypriv->wifi_spec == 1)) { stbc_rx_enable = 1; DBG_871X("declare supporting RX STBC\n"); } } + //fill default supported_mcs_set + _rtw_memcpy(ht_capie.supp_mcs_set, pmlmeext->default_supported_mcs_set, 16); + + //update default supported_mcs_set rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type)); -#ifdef RTL8192C_RECONFIG_TO_1T1R - rf_type = RF_1T1R; -#endif + switch(rf_type) { - case RF_1T1R: + case RF_1T1R: - if (stbc_rx_enable) - ht_capie.cap_info |= IEEE80211_HT_CAP_RX_STBC_1R;//RX STBC One spatial stream + if (stbc_rx_enable) + ht_capie.cap_info |= IEEE80211_HT_CAP_RX_STBC_1R;//RX STBC One spatial stream - _rtw_memcpy(ht_capie.supp_mcs_set, MCS_rate_1R, 16); + set_mcs_rate_by_mask(ht_capie.supp_mcs_set, MCS_RATE_1R); break; - case RF_2T2R: - case RF_1T2R: - default: + case RF_2T2R: + case RF_1T2R: + default: - if (stbc_rx_enable) - ht_capie.cap_info |= IEEE80211_HT_CAP_RX_STBC_2R;//RX STBC two spatial stream + if (stbc_rx_enable) + ht_capie.cap_info |= IEEE80211_HT_CAP_RX_STBC_2R;//RX STBC two spatial stream - #ifdef CONFIG_DISABLE_MCS13TO15 - if(((cbw40_enable == 1) && (operation_bw == CHANNEL_WIDTH_40)) && (pregistrypriv->wifi_spec!=1)) - _rtw_memcpy(ht_capie.supp_mcs_set, MCS_rate_2R_MCS13TO15_OFF, 16); - else - _rtw_memcpy(ht_capie.supp_mcs_set, MCS_rate_2R, 16); - #else //CONFIG_DISABLE_MCS13TO15 - _rtw_memcpy(ht_capie.supp_mcs_set, MCS_rate_2R, 16); - #endif //CONFIG_DISABLE_MCS13TO15 - break; + #ifdef CONFIG_DISABLE_MCS13TO15 + if(((cbw40_enable == 1) && (operation_bw == CHANNEL_WIDTH_40)) && (pregistrypriv->wifi_spec!=1)) + set_mcs_rate_by_mask(ht_capie.supp_mcs_set, MCS_RATE_2R_13TO15_OFF); + else + set_mcs_rate_by_mask(ht_capie.supp_mcs_set, MCS_RATE_2R); + #else //CONFIG_DISABLE_MCS13TO15 + set_mcs_rate_by_mask(ht_capie.supp_mcs_set, MCS_RATE_2R); + #endif //CONFIG_DISABLE_MCS13TO15 + break; } { @@ -3903,14 +4014,48 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui #endif */ - rtw_hal_get_def_var(padapter, HW_VAR_MAX_RX_AMPDU_FACTOR, &max_rx_ampdu_factor); + if(padapter->driver_rx_ampdu_factor != 0xFF) + max_rx_ampdu_factor = (HT_CAP_AMPDU_FACTOR)padapter->driver_rx_ampdu_factor; + else + rtw_hal_get_def_var(padapter, HW_VAR_MAX_RX_AMPDU_FACTOR, &max_rx_ampdu_factor); + + //rtw_hal_get_def_var(padapter, HW_VAR_MAX_RX_AMPDU_FACTOR, &max_rx_ampdu_factor); ht_capie.ampdu_params_info = (max_rx_ampdu_factor&0x03); - if(padapter->securitypriv.dot11PrivacyAlgrthm == _AES_ ) - ht_capie.ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY&(0x07<<2)); + if(padapter->driver_rx_ampdu_spacing != 0xFF) + { + ht_capie.ampdu_params_info |= (( padapter->driver_rx_ampdu_spacing&0x07) <<2); + } else - ht_capie.ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY&0x00); + { + if(padapter->securitypriv.dot11PrivacyAlgrthm == _AES_ ) + ht_capie.ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY&(0x07<<2)); + else + ht_capie.ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY&0x00); + } +#ifdef CONFIG_BEAMFORMING + ht_capie.tx_BF_cap_info = 0; + // HT Beamformer + if(TEST_FLAG(phtpriv->beamform_cap, BEAMFORMING_HT_BEAMFORMER_ENABLE)) + { + // Transmit NDP Capable + SET_HT_CAP_TXBF_TRANSMIT_NDP_CAP(&ht_capie, 1); + // Explicit Compressed Steering Capable + SET_HT_CAP_TXBF_EXPLICIT_COMP_STEERING_CAP(&ht_capie, 1); + // Compressed Steering Number Antennas + SET_HT_CAP_TXBF_COMP_STEERING_NUM_ANTENNAS(&ht_capie, 1); + } + + // HT Beamformee + if(TEST_FLAG(phtpriv->beamform_cap, BEAMFORMING_HT_BEAMFORMEE_ENABLE)) + { + // Receive NDP Capable + SET_HT_CAP_TXBF_RECEIVE_NDP_CAP(&ht_capie, 1); + // Explicit Compressed Beamforming Feedback Capable + SET_HT_CAP_TXBF_EXPLICIT_COMP_FEEDBACK_CAP(&ht_capie, 2); + } +#endif pframe = rtw_set_ie(out_ie+out_len, _HT_CAPABILITY_IE_, sizeof(struct rtw_ieee80211_ht_cap), (unsigned char*)&ht_capie, pout_len); @@ -3963,7 +4108,9 @@ void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len, u8 channel) { if(pregistrypriv->wifi_spec==1) { - phtpriv->ampdu_enable = _FALSE; + //remove this part because testbed AP should disable RX AMPDU + //phtpriv->ampdu_enable = _FALSE; + phtpriv->ampdu_enable = _TRUE; } else { @@ -3972,7 +4119,8 @@ void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len, u8 channel) } else if(pregistrypriv->ampdu_enable==2) { - phtpriv->ampdu_enable = _TRUE; + //remove this part because testbed AP should disable RX AMPDU + //phtpriv->ampdu_enable = _TRUE; } @@ -4013,36 +4161,33 @@ void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len, u8 channel) (pmlmeinfo->HT_info.infos[0] & BIT(2))) { int i; - u8 rf_type; + u8 rf_type = RF_1T1R; - padapter->HalFunc.GetHwRegHandler(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type)); + rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type)); - //update the MCS rates + //update the MCS set for (i = 0; i < 16; i++) + pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= pmlmeext->default_supported_mcs_set[i]; + + //update the MCS rates + switch(rf_type) { - if((rf_type == RF_1T1R) || (rf_type == RF_1T2R)) - { - pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= MCS_rate_1R[i]; - } - else - { - #ifdef CONFIG_DISABLE_MCS13TO15 - if(pmlmeext->cur_bwmode == CHANNEL_WIDTH_40 && pregistrypriv->wifi_spec != 1 ) - { - pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= MCS_rate_2R_MCS13TO15_OFF[i]; - } + case RF_1T1R: + case RF_1T2R: + set_mcs_rate_by_mask(pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate, MCS_RATE_1R); + break; + case RF_2T2R: + default: +#ifdef CONFIG_DISABLE_MCS13TO15 + if(pmlmeext->cur_bwmode == CHANNEL_WIDTH_40 && pregistrypriv->wifi_spec != 1 ) + set_mcs_rate_by_mask(pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate, MCS_RATE_2R_13TO15_OFF); else - pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= MCS_rate_2R[i]; - #else - pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= MCS_rate_2R[i]; - #endif //CONFIG_DISABLE_MCS13TO15 - } - #ifdef RTL8192C_RECONFIG_TO_1T1R - { - pmlmeinfo->HT_caps.HT_cap_element.MCS_rate[i] &= MCS_rate_1R[i]; - } - #endif + set_mcs_rate_by_mask(pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate, MCS_RATE_2R); +#else //CONFIG_DISABLE_MCS13TO15 + set_mcs_rate_by_mask(pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate, MCS_RATE_2R); +#endif //CONFIG_DISABLE_MCS13TO15 } + //switch to the 40M Hz mode accoring to the AP //pmlmeext->cur_bwmode = CHANNEL_WIDTH_40; switch ((pmlmeinfo->HT_info.infos[0] & 0x3)) @@ -4137,21 +4282,17 @@ void rtw_issue_addbareq_cmd_tdls(_adapter *padapter, struct xmit_frame *pxmitfra priority = pattrib->priority; - if(pattrib->direct_link == _TRUE) - { + if (pattrib->direct_link == _TRUE) { ptdls_sta = rtw_get_stainfo(&padapter->stapriv, pattrib->dst); - if((ptdls_sta != NULL) && (ptdls_sta->tdls_sta_state & TDLS_ESTABLISHED)) - { + if ((ptdls_sta != NULL) && (ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE)) { phtpriv = &ptdls_sta->htpriv; - if((phtpriv->ht_option==_TRUE) && (phtpriv->ampdu_enable==_TRUE)) - { + if ((phtpriv->ht_option == _TRUE) && (phtpriv->ampdu_enable == _TRUE)) { issued = (phtpriv->agg_enable_bitmap>>priority)&0x1; issued |= (phtpriv->candidate_tid_bitmap>>priority)&0x1; - if(0==issued) - { - DBG_871X("rtw_issue_addbareq_cmd, p=%d\n", priority); + if (0 == issued) { + DBG_871X("[%s], p=%d\n", __FUNCTION__, priority); ptdls_sta->htpriv.candidate_tid_bitmap |= BIT((u8)priority); rtw_addbareq_cmd(padapter,(u8)priority, pattrib->dst); } diff --git a/backports/drivers/realtek/rtl8812au/core/rtw_mlme_ext.c b/backports/drivers/realtek/rtl8812au/core/rtw_mlme_ext.c index 75580272488b20..5701c2882488df 100755 --- a/backports/drivers/realtek/rtl8812au/core/rtw_mlme_ext.c +++ b/backports/drivers/realtek/rtl8812au/core/rtw_mlme_ext.c @@ -44,6 +44,7 @@ struct mlme_handler mlme_sta_tbl[]={ {WIFI_AUTH, "OnAuth", &OnAuthClient}, {WIFI_DEAUTH, "OnDeAuth", &OnDeAuth}, {WIFI_ACTION, "OnAction", &OnAction}, + {WIFI_ACTION_NOACK,"OnActionNoAck", &OnAction}, }; #ifdef _CONFIG_NATIVEAP_MLME_ @@ -66,6 +67,7 @@ struct mlme_handler mlme_ap_tbl[]={ {WIFI_AUTH, "OnAuth", &OnAuth}, {WIFI_DEAUTH, "OnDeAuth", &OnDeAuth}, {WIFI_ACTION, "OnAction", &OnAction}, + {WIFI_ACTION_NOACK,"OnActionNoAck", &OnAction}, }; #endif @@ -111,16 +113,6 @@ unsigned char RSN_TKIP_CIPHER[4] = {0x00, 0x0f, 0xac, 0x02}; extern unsigned char REALTEK_96B_IE[]; -/******************************************************** -MCS rate definitions -*********************************************************/ -#ifdef CONFIG_DISABLE_MCS13TO15 -unsigned char MCS_rate_2R_MCS13TO15_OFF[16] = {0xff, 0x1f, 0x0, 0x0, 0x01, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; -unsigned char MCS_rate_2R[16] = {0xff, 0xff, 0x0, 0x0, 0x01, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; -#else //CONFIG_DISABLE_MCS13TO15 -unsigned char MCS_rate_2R[16] = {0xff, 0xff, 0x0, 0x0, 0x01, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; -#endif //CONFIG_DISABLE_MCS13TO15 -unsigned char MCS_rate_1R[16] = {0xff, 0x00, 0x0, 0x0, 0x01, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; /******************************************************** ChannelPlan definitions @@ -179,7 +171,7 @@ static RT_CHANNEL_PLAN_5G RTW_ChannelPlan5G[RT_CHANNEL_DOMAIN_5G_MAX] = { {{56,60,64,149,153,157,161,165},8}, // 0x10, RT_CHANNEL_DOMAIN_5G_NCC2 {{149,153,157,161,165},5}, // 0x11, RT_CHANNEL_DOMAIN_5G_NCC3 {{36,40,44,48},4}, // 0x12, RT_CHANNEL_DOMAIN_5G_ETSI4 - {{36,40,44,48,52,56,60,64,100,104,108,112,116,136,140,149,153,157,161,165},20}, // 0x13, RT_CHANNEL_DOMAIN_5G_ETSI5 + {{36,40,44,48,52,56,60,64,100,104,108,112,116,132,136,140,149,153,157,161,165},21}, // 0x13, RT_CHANNEL_DOMAIN_5G_ETSI5 {{149,153,157,161},4}, // 0x14, RT_CHANNEL_DOMAIN_5G_FCC8 {{36,40,44,48,52,56,60,64},8}, // 0x15, RT_CHANNEL_DOMAIN_5G_ETSI6 {{36,40,44,48,52,56,60,64,149,153,157,161,165},13}, // 0x16, RT_CHANNEL_DOMAIN_5G_ETSI7 @@ -189,14 +181,17 @@ static RT_CHANNEL_PLAN_5G RTW_ChannelPlan5G[RT_CHANNEL_DOMAIN_5G_MAX] = { {{36,40,44,48,52,56,60,64,132,136,140,149,153,157,161,165},16}, // 0x1A, RT_CHANNEL_DOMAIN_5G_ETSI11 {{52,56,60,64,100,104,108,112,116,132,136,140,149,153,157,161,165},17}, // 0x1B, RT_CHANNEL_DOMAIN_5G_NCC4 {{149,153,157,161},4}, // 0x1C, RT_CHANNEL_DOMAIN_5G_ETSI12 - {{36,40,44,48,100,104,108,112,116,132,136,140,149,153,157,161,165},17}, // 0x1D, RT_CHANNEL_DOMAIN_5G_FCC9 - {{36,40,44,48,100,104,108,112,116,132,136,140},12}, // 0x1E, RT_CHANNEL_DOMAIN_5G_ETSI13 - {{36,40,44,48,52,56,60,64,100,104,108,112,116,132,136,140,149,153,157,161},20}, // 0x1F, RT_CHANNEL_DOMAIN_5G_FCC10 - + {{36,40,44,48,52,56,60,64,100,104,108,112,116,132,136,140,149,153,157,161,165},21}, // 0x1D, RT_CHANNEL_DOMAIN_5G_FCC9 + {{36,40,44,48,52,56,60,64,100,104,108,112,116,132,136,140},16}, // 0x1E, RT_CHANNEL_DOMAIN_5G_ETSI13 + {{36,40,44,48,52,56,60,64,100,104,108,112,116,132,136,140,149,153,157,161},20}, // 0x1F, RT_CHANNEL_DOMAIN_5G_FCC10 + {{36,40,44,48,52,56,60,64,100,104,108,112,116,120,124,149,153,157,161},19}, // 0x20, RT_CHANNEL_DOMAIN_5G_KCC2 + {{36,40,44,48,52,56,60,64,100,104,108,112,116,132,136,140,149,153,157,161,165},21}, // 0x21, RT_CHANNEL_DOMAIN_5G_FCC11 + {{56,60,64,100,104,108,112,116,132,136,140,149,153,157,161,165},16}, // 0x22, RT_CHANNEL_DOMAIN_5G_NCC5 + {{36,40,44,48},4}, // 0x23, RT_CHANNEL_DOMAIN_5G_MKK4 //===== Driver self defined for old channel plan Compatible ,Remember to modify if have new channel plan definition ===== - {{36,40,44,48,52,56,60,64,100,104,108,112,116,132,136,140,149,153,157,161,165},21}, // 0x20, RT_CHANNEL_DOMAIN_5G_FCC - {{36,40,44,48},4}, // 0x21, RT_CHANNEL_DOMAIN_5G_JAPAN_NO_DFS - {{36,40,44,48,149,153,157,161},8}, // 0x22, RT_CHANNEL_DOMAIN_5G_FCC4_NO_DFS + {{36,40,44,48,52,56,60,64,100,104,108,112,116,132,136,140,149,153,157,161,165},21}, // 0x30, RT_CHANNEL_DOMAIN_5G_FCC + {{36,40,44,48},4}, // 0x31, RT_CHANNEL_DOMAIN_5G_JAPAN_NO_DFS + {{36,40,44,48,149,153,157,161},8}, // 0x32, RT_CHANNEL_DOMAIN_5G_FCC4_NO_DFS }; static RT_CHANNEL_PLAN_MAP RTW_ChannelPlanMap[RT_CHANNEL_DOMAIN_MAX] = { @@ -242,7 +237,7 @@ static RT_CHANNEL_PLAN_MAP RTW_ChannelPlanMap[RT_CHANNEL_DOMAIN_MAX] = { {0x02,0x04}, //0x25, RT_CHANNEL_DOMAIN_FCC1_FCC1 {0x00,0x01}, //0x26, RT_CHANNEL_DOMAIN_WORLD_ETSI1 {0x03,0x0C}, //0x27, RT_CHANNEL_DOMAIN_MKK1_MKK1 - {0x00,0x0B}, //0x28, RT_CHANNEL_DOMAIN_WORLD_KCC1 + {0x00,0x20}, //0x28, RT_CHANNEL_DOMAIN_5G_KCC2 {0x00,0x05}, //0x29, RT_CHANNEL_DOMAIN_WORLD_FCC2 {0x00,0x00}, //0x2A, {0x00,0x00}, //0x2B, @@ -254,12 +249,12 @@ static RT_CHANNEL_PLAN_MAP RTW_ChannelPlanMap[RT_CHANNEL_DOMAIN_MAX] = { {0x00,0x07}, //0x31, RT_CHANNEL_DOMAIN_WORLD_FCC4 {0x00,0x08}, //0x32, RT_CHANNEL_DOMAIN_WORLD_FCC5 {0x00,0x09}, //0x33, RT_CHANNEL_DOMAIN_WORLD_FCC6 - {0x02,0x0A}, //0x34, RT_CHANNEL_DOMAIN_FCC1_FCC7 + {0x02,0x21}, //0x34, RT_CHANNEL_DOMAIN_5G_FCC11 {0x00,0x02}, //0x35, RT_CHANNEL_DOMAIN_WORLD_ETSI2 {0x00,0x03}, //0x36, RT_CHANNEL_DOMAIN_WORLD_ETSI3 {0x03,0x0D}, //0x37, RT_CHANNEL_DOMAIN_MKK1_MKK2 {0x03,0x0E}, //0x38, RT_CHANNEL_DOMAIN_MKK1_MKK3 - {0x02,0x0F}, //0x39, RT_CHANNEL_DOMAIN_FCC1_NCC1 + {0x02,0x22}, //0x39, RT_CHANNEL_DOMAIN_5G_NCC5 {0x00,0x00}, //0x3A, {0x00,0x00}, //0x3B, {0x00,0x00}, //0x3C, @@ -276,6 +271,12 @@ static RT_CHANNEL_PLAN_MAP RTW_ChannelPlanMap[RT_CHANNEL_DOMAIN_MAX] = { {0x00,0x15}, //0x47, RT_CHANNEL_DOMAIN_WORLD_ETSI6 {0x00,0x16}, //0x48, RT_CHANNEL_DOMAIN_WORLD_ETSI7 {0x00,0x17}, //0x49, RT_CHANNEL_DOMAIN_WORLD_ETSI8 + {0x00,0x00}, //0x4A, + {0x00,0x00}, //0x4B, + {0x00,0x00}, //0x4C, + {0x00,0x00}, //0x4D, + {0x00,0x00}, //0x4E, + {0x00,0x00}, //0x4F, {0x00,0x18}, //0x50, RT_CHANNEL_DOMAIN_WORLD_ETSI9 {0x00,0x19}, //0x51, RT_CHANNEL_DOMAIN_WORLD_ETSI10 {0x00,0x1A}, //0x52, RT_CHANNEL_DOMAIN_WORLD_ETSI11 @@ -284,9 +285,10 @@ static RT_CHANNEL_PLAN_MAP RTW_ChannelPlanMap[RT_CHANNEL_DOMAIN_MAX] = { {0x02,0x1D}, //0x55, RT_CHANNEL_DOMAIN_FCC1_FCC9 {0x00,0x1E}, //0x56, RT_CHANNEL_DOMAIN_WORLD_ETSI13 {0x02,0x1F}, //0x57, RT_CHANNEL_DOMAIN_FCC1_FCC10 + {0x01,0x23}, //0x58, RT_CHANNEL_DOMAIN_WORLD_MKK4 }; -static RT_CHANNEL_PLAN_MAP RTW_CHANNEL_PLAN_MAP_REALTEK_DEFINE = {0x03,0x02}; //use the conbination for max channel numbers +static RT_CHANNEL_PLAN_MAP RTW_CHANNEL_PLAN_MAP_REALTEK_DEFINE = {0x00,0x02}; //use the conbination for max channel numbers /* * Search the @param ch in given @param ch_set @@ -343,18 +345,24 @@ int init_hw_mlme_ext(_adapter *padapter) return _SUCCESS; } -static void init_mlme_ext_priv_value(_adapter* padapter) +void init_mlme_default_rate_set(_adapter* padapter) { - struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - -#ifdef CONFIG_TDLS - u8 i; -#endif + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - //unsigned char default_channel_set[MAX_CHANNEL_NUM] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 0, 0}; unsigned char mixed_datarate[NumRates] = {_1M_RATE_, _2M_RATE_, _5M_RATE_, _11M_RATE_, _6M_RATE_,_9M_RATE_, _12M_RATE_, _18M_RATE_, _24M_RATE_, _36M_RATE_, _48M_RATE_, _54M_RATE_, 0xff}; unsigned char mixed_basicrate[NumRates] ={_1M_RATE_, _2M_RATE_, _5M_RATE_, _11M_RATE_, _6M_RATE_, _12M_RATE_, _24M_RATE_, 0xff,}; + unsigned char supported_mcs_set[16] = {0xff, 0xff, 0x00, 0x00, 0x00, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; + + _rtw_memcpy(pmlmeext->datarate, mixed_datarate, NumRates); + _rtw_memcpy(pmlmeext->basicrate, mixed_basicrate, NumRates); + + _rtw_memcpy(pmlmeext->default_supported_mcs_set, supported_mcs_set, sizeof(pmlmeext->default_supported_mcs_set)); +} + +static void init_mlme_ext_priv_value(_adapter* padapter) +{ + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); ATOMIC_SET(&pmlmeext->event_seq, 0); pmlmeext->mgnt_seq = 0;//reset to zero when disconnect at client mode @@ -371,10 +379,7 @@ static void init_mlme_ext_priv_value(_adapter* padapter) pmlmeext->cur_wireless_mode = padapter->registrypriv.wireless_mode; - //_rtw_memcpy(pmlmeext->channel_set, DefaultChannelPlan[padapter->mlmepriv.ChannelPlan].Channel, DefaultChannelPlan[padapter->mlmepriv.ChannelPlan].Len); - //_rtw_memcpy(pmlmeext->channel_set, default_channel_set, MAX_CHANNEL_NUM); - _rtw_memcpy(pmlmeext->datarate, mixed_datarate, NumRates); - _rtw_memcpy(pmlmeext->basicrate, mixed_basicrate, NumRates); + init_mlme_default_rate_set(padapter); if(pmlmeext->cur_channel > 14) pmlmeext->tx_rate = IEEE80211_OFDM_RATE_6MB; @@ -485,14 +490,13 @@ static u8 init_channel_set(_adapter* padapter, u8 ChannelPlan, RT_CHANNEL_INFO * u8 b5GBand = _FALSE, b2_4GBand = _FALSE; u8 Index2G = 0, Index5G=0; - _rtw_memset(channel_set, 0, sizeof(RT_CHANNEL_INFO)*MAX_CHANNEL_NUM); - - if(ChannelPlan >= RT_CHANNEL_DOMAIN_MAX && ChannelPlan != RT_CHANNEL_DOMAIN_REALTEK_DEFINE) - { + if (!rtw_is_channel_plan_valid(ChannelPlan)) { DBG_871X("ChannelPlan ID %x error !!!!!\n",ChannelPlan); return chanset_size; } + _rtw_memset(channel_set, 0, sizeof(RT_CHANNEL_INFO)*MAX_CHANNEL_NUM); + if(IsSupported24G(padapter->registrypriv.wireless_mode)) { b2_4GBand = _TRUE; @@ -577,6 +581,8 @@ static u8 init_channel_set(_adapter* padapter, u8 ChannelPlan, RT_CHANNEL_INFO * } } + Hal_ChannelPlanToRegulation(padapter, ChannelPlan); + DBG_871X("%s ChannelPlan ID %x Chan num:%d \n",__FUNCTION__,ChannelPlan,chanset_size); return chanset_size; } @@ -694,6 +700,8 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame) u8 bc_addr[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff}; u8 *pframe = precv_frame->u.hdr.rx_data; struct sta_info *psta = rtw_get_stainfo(&padapter->stapriv, GetAddr2Ptr(pframe)); + struct dvobj_priv *psdpriv = padapter->dvobj; + struct debug_priv *pdbgpriv = &psdpriv->drv_dbg; RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("+mgt_dispatcher: type(0x%x) subtype(0x%x)\n", @@ -730,15 +738,15 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame) #ifdef CONFIG_TDLS if((index << 4)==WIFI_ACTION){ - //category==public (4), action==TDLS_DISCOVERY_RESPONSE - if(*(pframe+24)==0x04 && *(pframe+25)==TDLS_DISCOVERY_RESPONSE){ - DBG_871X("recv tdls discovery response frame from "MAC_FMT"\n", MAC_ARG(GetAddr2Ptr(pframe))); + /* category==public (4), action==TDLS_DISCOVERY_RESPONSE */ + if (*(pframe+24) == RTW_WLAN_CATEGORY_PUBLIC && *(pframe+25) == TDLS_DISCOVERY_RESPONSE) { + DBG_871X("[TDLS] Recv %s from "MAC_FMT"\n", rtw_tdls_action_txt(TDLS_DISCOVERY_RESPONSE), MAC_ARG(GetAddr2Ptr(pframe))); On_TDLS_Dis_Rsp(padapter, precv_frame); } } #endif //CONFIG_TDLS - if (index > 13) + if (index >= (sizeof(mlme_sta_tbl) /sizeof(struct mlme_handler))) { RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("Currently we do not support reserved sub-fr-type=%d\n", index)); return; @@ -753,6 +761,7 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame) if (precv_frame->u.hdr.attrib.seq_num == psta->RxMgmtFrameSeqNum) { /* drop the duplicate management frame */ + pdbgpriv->dbg_rx_dup_mgt_frame_drop_count++; DBG_871X("Drop duplicate management frame with seq_num = %d.\n", precv_frame->u.hdr.attrib.seq_num); return; } @@ -913,12 +922,13 @@ unsigned int OnProbeReq(_adapter *padapter, union recv_frame *precv_frame) // Commented by Kurt 2012/10/16 // IOT issue: Google Nexus7 use 1M rate to send p2p_probe_req after GO nego completed and Nexus7 is client -#ifdef CONFIG_WIFI_TEST - if ( pattrib->data_rate <= 3 ) - { - wifi_test_chk_rate = 0; - } -#endif //CONFIG_WIFI_TEST + if (padapter->registrypriv.wifi_spec == 1) + { + if ( pattrib->data_rate <= 3 ) + { + wifi_test_chk_rate = 0; + } + } if( wifi_test_chk_rate == 1 ) { @@ -1249,6 +1259,10 @@ unsigned int OnBeacon(_adapter *padapter, union recv_frame *precv_frame) int ret = _SUCCESS; u8 *p = NULL; u32 ielen = 0; +#ifdef CONFIG_TDLS + struct sta_info *ptdls_sta; + struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; +#endif /* CONFIG_TDLS */ #ifdef CONFIG_ATTEMPT_TO_FIX_AP_BEACON_ERROR p = rtw_get_ie(pframe + sizeof(struct rtw_ieee80211_hdr_3addr) + _BEACON_IE_OFFSET_, _EXT_SUPPORTEDRATES_IE_, &ielen, precv_frame->u.hdr.len -sizeof(struct rtw_ieee80211_hdr_3addr) - _BEACON_IE_OFFSET_); @@ -1285,8 +1299,23 @@ unsigned int OnBeacon(_adapter *padapter, union recv_frame *precv_frame) pbss = (WLAN_BSSID_EX*)rtw_malloc(sizeof(WLAN_BSSID_EX)); if (pbss) { if (collect_bss_info(padapter, precv_frame, pbss) == _SUCCESS) { + struct beacon_keys recv_beacon; + update_network(&(pmlmepriv->cur_network.network), pbss, padapter, _TRUE); rtw_get_bcn_info(&(pmlmepriv->cur_network)); + + // update bcn keys + if (rtw_get_bcn_keys(padapter, pframe, len, &recv_beacon) == _TRUE) { + DBG_871X("%s: beacon keys ready\n", __func__); + _rtw_memcpy(&pmlmepriv->cur_beacon_keys, + &recv_beacon, sizeof(recv_beacon)); + pmlmepriv->new_beacon_cnts = 0; + } + else { + DBG_871X_LEVEL(_drv_err_, "%s: get beacon keys failed\n", __func__); + _rtw_memset(&pmlmepriv->cur_beacon_keys, 0, sizeof(recv_beacon)); + pmlmepriv->new_beacon_cnts = 0; + } } rtw_mfree((u8*)pbss, sizeof(WLAN_BSSID_EX)); } @@ -1304,7 +1333,21 @@ unsigned int OnBeacon(_adapter *padapter, union recv_frame *precv_frame) pmlmeext->bcn_cnt = 0; _rtw_memset(pmlmeext->bcn_delay_cnt, 0, sizeof(pmlmeext->bcn_delay_cnt)); _rtw_memset(pmlmeext->bcn_delay_ratio, 0, sizeof(pmlmeext->bcn_delay_ratio)); - + +#ifdef CONFIG_P2P_PS + process_p2p_ps_ie(padapter, (pframe + WLAN_HDR_A3_LEN), (len - WLAN_HDR_A3_LEN)); +#endif //CONFIG_P2P_PS + +#if defined(CONFIG_P2P)&&defined(CONFIG_CONCURRENT_MODE) + if (padapter->registrypriv.wifi_spec) { + if (process_p2p_cross_connect_ie(padapter, (pframe + WLAN_HDR_A3_LEN), (len - WLAN_HDR_A3_LEN)) == _FALSE) { + if((padapter->pbuddy_adapter->mlmeextpriv.mlmext_info.state&0x03) == WIFI_FW_AP_STATE) { + DBG_871X_LEVEL(_drv_always_, "no issue auth, P2P cross-connect does not permit\n "); + return _SUCCESS; + } + } + } +#endif // CONFIG_P2P CONFIG_P2P and CONFIG_CONCURRENT_MODE //start auth start_clnt_auth(padapter); @@ -1344,6 +1387,24 @@ unsigned int OnBeacon(_adapter *padapter, union recv_frame *precv_frame) adaptive_early_32k(pmlmeext, pframe, len); +#ifdef CONFIG_TDLS +#ifdef CONFIG_TDLS_CH_SW + if (padapter->tdlsinfo.ch_switch_prohibited == _FALSE) + { + /* Send TDLS Channel Switch Request when receiving Beacon */ + if ((padapter->tdlsinfo.chsw_info.ch_sw_state & TDLS_CH_SW_INITIATOR_STATE) && (pmlmeext->cur_channel == rtw_get_oper_ch(padapter))) { + ptdlsinfo->chsw_info.ch_sw_state |= TDLS_WAIT_CH_RSP_STATE; + /* DBG_871X("[%s] issue_tdls_ch_switch_req to "MAC_FMT"\n", __FUNCTION__, MAC_ARG(padapter->tdlsinfo.chsw_info.addr)); */ + ptdls_sta = rtw_get_stainfo(&padapter->stapriv, padapter->tdlsinfo.chsw_info.addr); + if (ptdls_sta != NULL) { + if (ptdls_sta->tdls_sta_state | TDLS_LINKED_STATE) + issue_tdls_ch_switch_req(padapter, ptdls_sta); + } + } + } +#endif +#endif /* CONFIG_TDLS */ + #ifdef CONFIG_DFS process_csa_ie(padapter, pframe, len); //channel switch announcement #endif //CONFIG_DFS @@ -2230,6 +2291,10 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) if (elems.vht_op_mode_notify && elems.vht_op_mode_notify_len == 1) { _rtw_memcpy(&pstat->vhtpriv.vht_op_mode_notify, elems.vht_op_mode_notify, 1); } + else // for Frame without Operating Mode notify ie; default: 80M + { + pstat->vhtpriv.vht_op_mode_notify = CHANNEL_WIDTH_80; + } } else { pstat->flags &= ~WLAN_STA_VHT; @@ -2511,7 +2576,15 @@ unsigned int OnAssocRsp(_adapter *padapter, union recv_frame *precv_frame) case _ERPINFO_IE_: ERP_IE_handler(padapter, pIE); - + break; +#ifdef CONFIG_TDLS + case _EXT_CAP_IE_: + if (check_ap_tdls_prohibited(pIE->data, pIE->Length) == _TRUE) + padapter->tdlsinfo.ap_prohibited = _TRUE; + if (check_ap_tdls_ch_switching_prohibited(pIE->data, pIE->Length) == _TRUE) + padapter->tdlsinfo.ch_switch_prohibited = _TRUE; + break; +#endif /* CONFIG_TDLS */ default: break; } @@ -2833,6 +2906,261 @@ unsigned int OnAction_dls(_adapter *padapter, union recv_frame *precv_frame) return _SUCCESS; } +/** + * rtw_rx_ampdu_size - Get the target RX AMPDU buffer size for the specific @adapter + * @adapter: the adapter to get target RX AMPDU buffer size + * + * Returns: the target RX AMPDU buffer size + */ +u8 rtw_rx_ampdu_size(_adapter *adapter) +{ + u8 size; + HT_CAP_AMPDU_FACTOR max_rx_ampdu_factor; + + if (adapter->fix_rx_ampdu_size != RX_AMPDU_SIZE_INVALID) { + size = adapter->fix_rx_ampdu_size; + goto exit; + } + +#ifdef CONFIG_BT_COEXIST + if (rtw_btcoex_IsBTCoexCtrlAMPDUSize(adapter) == _TRUE) { + size = rtw_btcoex_GetAMPDUSize(adapter); + goto exit; + } +#endif + + /* default value based on max_rx_ampdu_factor */ + if (adapter->driver_rx_ampdu_factor != 0xFF) + max_rx_ampdu_factor = (HT_CAP_AMPDU_FACTOR)adapter->driver_rx_ampdu_factor; + else + rtw_hal_get_def_var(adapter, HW_VAR_MAX_RX_AMPDU_FACTOR, &max_rx_ampdu_factor); + + if (MAX_AMPDU_FACTOR_64K == max_rx_ampdu_factor) + size = 64; + else if (MAX_AMPDU_FACTOR_32K == max_rx_ampdu_factor) + size = 32; + else if (MAX_AMPDU_FACTOR_16K == max_rx_ampdu_factor) + size = 16; + else if (MAX_AMPDU_FACTOR_8K == max_rx_ampdu_factor) + size = 8; + else + size = 64; + +exit: + + if (size > 127) + size = 127; + + return size; +} + +/** + * rtw_rx_ampdu_is_accept - Get the permission if RX AMPDU should be set up for the specific @adapter + * @adapter: the adapter to get the permission if RX AMPDU should be set up + * + * Returns: accept or not + */ +bool rtw_rx_ampdu_is_accept(_adapter *adapter) +{ + bool accept; + + if (adapter->fix_rx_ampdu_accept != RX_AMPDU_ACCEPT_INVALID) { + accept = adapter->fix_rx_ampdu_accept; + goto exit; + } + +#ifdef CONFIG_BT_COEXIST + if (rtw_btcoex_IsBTCoexRejectAMPDU(adapter) == _TRUE) { + accept = _FALSE; + goto exit; + } +#endif + + /* default value for other cases */ + accept = adapter->mlmeextpriv.mlmext_info.bAcceptAddbaReq; + +exit: + return accept; +} + +/** + * rtw_rx_ampdu_set_size - Set the target RX AMPDU buffer size for the specific @adapter and specific @reason + * @adapter: the adapter to set target RX AMPDU buffer size + * @size: the target RX AMPDU buffer size to set + * @reason: reason for the target RX AMPDU buffer size setting + * + * Returns: whether the target RX AMPDU buffer size is changed + */ +bool rtw_rx_ampdu_set_size(_adapter *adapter, u8 size, u8 reason) +{ + bool is_adj = _FALSE; + struct mlme_ext_priv *mlmeext; + struct mlme_ext_info *mlmeinfo; + + mlmeext = &adapter->mlmeextpriv; + mlmeinfo = &mlmeext->mlmext_info; + + if (reason == RX_AMPDU_DRV_FIXED) { + if (adapter->fix_rx_ampdu_size != size) { + adapter->fix_rx_ampdu_size = size; + is_adj = _TRUE; + DBG_871X(FUNC_ADPT_FMT" fix_rx_ampdu_size:%u\n", FUNC_ADPT_ARG(adapter), size); + } + } + + return is_adj; +} + +/** + * rtw_rx_ampdu_set_accept - Set the permission if RX AMPDU should be set up for the specific @adapter and specific @reason + * @adapter: the adapter to set if RX AMPDU should be set up + * @accept: if RX AMPDU should be set up + * @reason: reason for the permission if RX AMPDU should be set up + * + * Returns: whether the permission if RX AMPDU should be set up is changed + */ +bool rtw_rx_ampdu_set_accept(_adapter *adapter, u8 accept, u8 reason) +{ + bool is_adj = _FALSE; + struct mlme_ext_priv *mlmeext; + struct mlme_ext_info *mlmeinfo; + + mlmeext = &adapter->mlmeextpriv; + mlmeinfo = &mlmeext->mlmext_info; + + if (reason == RX_AMPDU_DRV_FIXED) { + if (adapter->fix_rx_ampdu_accept != accept) { + adapter->fix_rx_ampdu_accept = accept; + is_adj = _TRUE; + DBG_871X(FUNC_ADPT_FMT" fix_rx_ampdu_accept:%u\n", FUNC_ADPT_ARG(adapter), accept); + } + } + + return is_adj; +} + +/** + * rx_ampdu_apply_sta_tid - Apply RX AMPDU setting to the specific @sta and @tid + * @adapter: the adapter to which @sta belongs + * @sta: the sta to be checked + * @tid: the tid to be checked + * @accept: the target permission if RX AMPDU should be set up + * @size: the target RX AMPDU buffer size + * + * Returns: + * 0: no canceled + * 1: canceled by no permission + * 2: canceled by different buffer size + * 3: canceled by potential mismatched status + * + * Blocking function, may sleep + */ +u8 rx_ampdu_apply_sta_tid(_adapter *adapter, struct sta_info *sta, u8 tid, u8 accept, u8 size) +{ + u8 ret = 0; + struct recv_reorder_ctrl *reorder_ctl = &sta->recvreorder_ctrl[tid]; + + if (reorder_ctl->enable == _FALSE) { + if (reorder_ctl->ampdu_size != RX_AMPDU_SIZE_INVALID) { + send_delba_sta_tid_wait_ack(adapter, 0, sta, tid, 1); + ret = 3; + } + goto exit; + } + + if (accept == _FALSE) { + send_delba_sta_tid_wait_ack(adapter, 0, sta, tid, 0); + ret = 1; + } else if (reorder_ctl->ampdu_size != size) { + send_delba_sta_tid_wait_ack(adapter, 0, sta, tid, 0); + ret = 2; + } + +exit: + return ret; +} + +/** + * rx_ampdu_apply_sta - Apply RX AMPDU setting to the specific @sta + * @adapter: the adapter to which @sta belongs + * @sta: the sta to be checked + * @accept: the target permission if RX AMPDU should be set up + * @size: the target RX AMPDU buffer size + * + * Returns: number of the RX AMPDU assciation canceled for applying current target setting + * + * Blocking function, may sleep + */ +u8 rx_ampdu_apply_sta(_adapter *adapter, struct sta_info *sta, u8 accept, u8 size) +{ + u8 change_cnt = 0; + int i; + + for (i = 0; i < TID_NUM; i++) { + if (rx_ampdu_apply_sta_tid(adapter, sta, i, accept, size) != 0) + change_cnt++; + } + + return change_cnt; +} + +/** + * rtw_rx_ampdu_apply - Apply the current target RX AMPDU setting for the specific @adapter + * @adapter: the adapter to be applied + * + * Returns: number of the RX AMPDU assciation canceled for applying current target setting + */ +u16 rtw_rx_ampdu_apply(_adapter *adapter) +{ + u16 adj_cnt = 0; + struct mlme_ext_priv *mlmeext; + struct sta_info *sta; + u8 accept = rtw_rx_ampdu_is_accept(adapter); + u8 size = rtw_rx_ampdu_size(adapter); + + mlmeext = &adapter->mlmeextpriv; + + if (mlmeext_msr(mlmeext) == WIFI_FW_STATION_STATE) { + sta = rtw_get_stainfo(&adapter->stapriv, get_bssid(&adapter->mlmepriv)); + if (sta) + adj_cnt += rx_ampdu_apply_sta(adapter, sta, accept, size); + + } else if (mlmeext_msr(mlmeext) == WIFI_FW_AP_STATE) { + _irqL irqL; + _list *phead, *plist; + u8 peer_num = 0; + char peers[NUM_STA]; + struct sta_priv *pstapriv = &adapter->stapriv; + int i; + + _enter_critical_bh(&pstapriv->asoc_list_lock, &irqL); + + phead = &pstapriv->asoc_list; + plist = get_next(phead); + + while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + int stainfo_offset; + + sta = LIST_CONTAINOR(plist, struct sta_info, asoc_list); + plist = get_next(plist); + + stainfo_offset = rtw_stainfo_offset(pstapriv, sta); + if (stainfo_offset_valid(stainfo_offset)) + peers[peer_num++] = stainfo_offset; + } + + _exit_critical_bh(&pstapriv->asoc_list_lock, &irqL); + + for (i = 0; i < peer_num; i++) { + sta = rtw_get_stainfo_by_offset(pstapriv, peers[i]); + if (sta) + adj_cnt += rx_ampdu_apply_sta(adapter, sta, accept, size); + } + } + + return adj_cnt; +} + unsigned int OnAction_back(_adapter *padapter, union recv_frame *precv_frame) { u8 *addr; @@ -2897,15 +3225,6 @@ unsigned int OnAction_back(_adapter *padapter, union recv_frame *precv_frame) _rtw_memcpy(&(pmlmeinfo->ADDBA_req), &(frame_body[2]), sizeof(struct ADDBA_request)); //process_addba_req(padapter, (u8*)&(pmlmeinfo->ADDBA_req), GetAddr3Ptr(pframe)); process_addba_req(padapter, (u8*)&(pmlmeinfo->ADDBA_req), addr); - - if(pmlmeinfo->bAcceptAddbaReq == _TRUE) - { - issue_action_BA(padapter, addr, RTW_WLAN_ACTION_ADDBA_RESP, 0); - } - else - { - issue_action_BA(padapter, addr, RTW_WLAN_ACTION_ADDBA_RESP, 37);//reject ADDBA Req - } break; @@ -2950,13 +3269,9 @@ unsigned int OnAction_back(_adapter *padapter, union recv_frame *precv_frame) { tid = (frame_body[3] >> 4) & 0x0F; - preorder_ctrl = &psta->recvreorder_ctrl[tid]; + preorder_ctrl = &psta->recvreorder_ctrl[tid]; preorder_ctrl->enable = _FALSE; - preorder_ctrl->indicate_seq = 0xffff; - #ifdef DBG_RX_SEQ - DBG_871X("DBG_RX_SEQ %s:%d indicate_seq:%u \n", __FUNCTION__, __LINE__, - preorder_ctrl->indicate_seq); - #endif + preorder_ctrl->ampdu_size = RX_AMPDU_SIZE_INVALID; } DBG_871X("%s(): DELBA: %x(%x)\n", __FUNCTION__,pmlmeinfo->agg_enable_bitmap, reason_code); @@ -3177,7 +3492,7 @@ void issue_p2p_GO_request(_adapter *padapter, u8* raddr) // Value: // Todo the tie breaker bit. - p2pie[ p2pielen++ ] = ( ( pwdinfo->intent << 1 ) | BIT(0) ); + p2pie[ p2pielen++ ] = ( ( pwdinfo->intent << 1 ) & 0xFE ); // Configuration Timeout // Type: @@ -5806,14 +6121,13 @@ unsigned int on_action_public_p2p(union recv_frame *precv_frame) // Commented by Kurt 20120113 // Get peer_dev_addr here if peer doesn't issue prov_disc frame. - if( _rtw_memcmp(pwdinfo->rx_prov_disc_info.peerDevAddr, empty_addr, ETH_ALEN) ); + if( _rtw_memcmp(pwdinfo->rx_prov_disc_info.peerDevAddr, empty_addr, ETH_ALEN) ) _rtw_memcpy(pwdinfo->rx_prov_disc_info.peerDevAddr, GetAddr2Ptr(pframe), ETH_ALEN); result = process_p2p_group_negotation_req( pwdinfo, frame_body, len ); issue_p2p_GO_response( padapter, GetAddr2Ptr(pframe), frame_body, len, result ); #ifdef CONFIG_INTEL_WIDI - if( (padapter->mlmepriv.widi_state == INTEL_WIDI_STATE_LISTEN) && (padapter->mlmepriv.widi_state != INTEL_WIDI_STATE_WFD_CONNECTION) ) - { + if (padapter->mlmepriv.widi_state == INTEL_WIDI_STATE_LISTEN) { padapter->mlmepriv.widi_state = INTEL_WIDI_STATE_WFD_CONNECTION; _cancel_timer_ex(&(padapter->mlmepriv.listen_timer)); intel_widi_wk_cmd(padapter, INTEL_WIDI_LISTEN_STOP_WK, NULL, 0); @@ -6062,8 +6376,7 @@ unsigned int on_action_public_p2p(union recv_frame *precv_frame) _set_timer( &pwdinfo->restore_p2p_state_timer, 3000 ); } #ifdef CONFIG_INTEL_WIDI - if( (padapter->mlmepriv.widi_state == INTEL_WIDI_STATE_LISTEN) && (padapter->mlmepriv.widi_state != INTEL_WIDI_STATE_WFD_CONNECTION) ) - { + if (padapter->mlmepriv.widi_state == INTEL_WIDI_STATE_LISTEN) { padapter->mlmepriv.widi_state = INTEL_WIDI_STATE_WFD_CONNECTION; _cancel_timer_ex(&(padapter->mlmepriv.listen_timer)); intel_widi_wk_cmd(padapter, INTEL_WIDI_LISTEN_STOP_WK, NULL, 0); @@ -6148,8 +6461,7 @@ unsigned int on_action_public_p2p(union recv_frame *precv_frame) rtw_p2p_set_state(pwdinfo, P2P_STATE_RX_PROVISION_DIS_REQ); _set_timer( &pwdinfo->restore_p2p_state_timer, P2P_PROVISION_TIMEOUT ); #ifdef CONFIG_INTEL_WIDI - if( (padapter->mlmepriv.widi_state == INTEL_WIDI_STATE_LISTEN) && (padapter->mlmepriv.widi_state != INTEL_WIDI_STATE_WFD_CONNECTION) ) - { + if (padapter->mlmepriv.widi_state == INTEL_WIDI_STATE_LISTEN) { padapter->mlmepriv.widi_state = INTEL_WIDI_STATE_WFD_CONNECTION; _cancel_timer_ex(&(padapter->mlmepriv.listen_timer)); intel_widi_wk_cmd(padapter, INTEL_WIDI_LISTEN_STOP_WK, NULL, 0); @@ -6256,6 +6568,33 @@ unsigned int on_action_public(_adapter *padapter, union recv_frame *precv_frame) unsigned int OnAction_ht(_adapter *padapter, union recv_frame *precv_frame) { + u8 *pframe = precv_frame->u.hdr.rx_data; + uint frame_len = precv_frame->u.hdr.len; + u8 *frame_body = pframe + sizeof(struct rtw_ieee80211_hdr_3addr); + u8 category, action; + + /* check RA matches or not */ + if (!_rtw_memcmp(myid(&(padapter->eeprompriv)), GetAddr1Ptr(pframe), ETH_ALEN)) + goto exit; + + category = frame_body[0]; + if(category != RTW_WLAN_CATEGORY_HT) + goto exit; + + action = frame_body[1]; + switch (action) { + case RTW_WLAN_ACTION_HT_COMPRESS_BEAMFORMING: +#ifdef CONFIG_BEAMFORMING + //DBG_871X("RTW_WLAN_ACTION_HT_COMPRESS_BEAMFORMING\n"); + beamforming_get_report_frame(padapter, precv_frame); +#endif //CONFIG_BEAMFORMING + break; + default: + break; + } + +exit: + return _SUCCESS; } @@ -6325,13 +6664,13 @@ unsigned int OnAction_vht(_adapter *padapter, union recv_frame *precv_frame) switch (action) { case RTW_WLAN_ACTION_VHT_COMPRESSED_BEAMFORMING: #ifdef CONFIG_BEAMFORMING - DBG_871X("RTW_WLAN_ACTION_VHT_COMPRESSED_BEAMFORMING\n"); - //beamforming_get_report_frame(padapter, precv_frame); + //DBG_871X("RTW_WLAN_ACTION_VHT_COMPRESSED_BEAMFORMING\n"); + beamforming_get_report_frame(padapter, precv_frame); #endif //CONFIG_BEAMFORMING break; case RTW_WLAN_ACTION_VHT_OPMODE_NOTIFICATION: // CategoryCode(1) + ActionCode(1) + OpModeNotification(1) - DBG_871X("RTW_WLAN_ACTION_VHT_OPMODE_NOTIFICATION\n"); + //DBG_871X("RTW_WLAN_ACTION_VHT_OPMODE_NOTIFICATION\n"); psta = rtw_get_stainfo(&padapter->stapriv, prxattrib->ta); if (psta) rtw_process_vht_op_mode_notify(padapter, &frame_body[2], psta); @@ -6354,10 +6693,7 @@ unsigned int OnAction_p2p(_adapter *padapter, union recv_frame *precv_frame) u8 *pframe = precv_frame->u.hdr.rx_data; uint len = precv_frame->u.hdr.len; struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); - - DBG_871X("%s\n", __FUNCTION__); - //check RA matches or not if (!_rtw_memcmp(myid(&(padapter->eeprompriv)), GetAddr1Ptr(pframe), ETH_ALEN))//for if1, sta/ap mode return _SUCCESS; @@ -6508,14 +6844,14 @@ void update_mgntframe_attrib(_adapter *padapter, struct pkt_attrib *pattrib) { u8 wireless_mode; struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); - + struct xmit_priv *pxmitpriv = &padapter->xmitpriv; //_rtw_memset((u8 *)(pattrib), 0, sizeof(struct pkt_attrib)); pattrib->hdrlen = 24; pattrib->nr_frags = 1; pattrib->priority = 7; pattrib->mac_id = 0; - pattrib->qsel = 0x12; + pattrib->qsel = QSLT_MGNT; pattrib->pktlen = 0; @@ -6524,6 +6860,7 @@ void update_mgntframe_attrib(_adapter *padapter, struct pkt_attrib *pattrib) else wireless_mode = WIRELESS_11G; pattrib->raid = rtw_get_mgntframe_raid(padapter, wireless_mode); + pattrib->rate = pmlmeext->tx_rate; pattrib->encrypt = _NO_PRIVACY_; pattrib->bswenc = _FALSE; @@ -6539,6 +6876,7 @@ void update_mgntframe_attrib(_adapter *padapter, struct pkt_attrib *pattrib) pattrib->retry_ctrl = _TRUE; pattrib->mbssid = 0; + pattrib->hw_ssn_sel = pxmitpriv->hw_ssn_seq_no; } @@ -6698,7 +7036,11 @@ void issue_beacon(_adapter *padapter, int timeout_ms) //DBG_871X("%s\n", __FUNCTION__); +#ifdef CONFIG_BCN_ICF + if ((pmgntframe = rtw_alloc_bcnxmitframe(pxmitpriv)) == NULL) +#else if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) +#endif { DBG_871X("%s, alloc mgnt frame fail\n", __FUNCTION__); return; @@ -6710,7 +7052,7 @@ void issue_beacon(_adapter *padapter, int timeout_ms) //update attribute pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); - pattrib->qsel = 0x10; + pattrib->qsel = QSLT_BEACON; #ifdef CONFIG_CONCURRENT_MODE if(padapter->iface_type == IFACE_PORT1) pattrib->mbssid = 1; @@ -7197,7 +7539,9 @@ void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probe } #ifdef CONFIG_P2P - if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO) /*&& is_valid_p2p_probereq*/) + if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO) + /* IOT issue, When wifi_spec is not set, send probe_resp with P2P IE even if probe_req has no P2P IE */ + && (is_valid_p2p_probereq || !padapter->registrypriv.wifi_spec)) { u32 len; #ifdef CONFIG_IOCTL_CFG80211 @@ -7809,6 +8153,7 @@ void issue_assocreq(_adapter *padapter) struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); int bssrate_len = 0, sta_bssrate_len = 0; + u8 vs_ie_length = 0; #ifdef CONFIG_P2P struct wifidirect_info *pwdinfo = &(padapter->wdinfo); u8 p2pie[ 255 ] = { 0x00 }; @@ -7820,6 +8165,10 @@ void issue_assocreq(_adapter *padapter) #ifdef CONFIG_DFS u16 cap; + + /* Dot H */ + u8 pow_cap_ele[2] = { 0x00 }; + u8 sup_ch[ 30 * 2 ] = {0x00 }, sup_ch_idx = 0, idx_5g = 2; //For supported channel #endif //CONFIG_DFS if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) @@ -7871,6 +8220,33 @@ void issue_assocreq(_adapter *padapter) //SSID pframe = rtw_set_ie(pframe, _SSID_IE_, pmlmeinfo->network.Ssid.SsidLength, pmlmeinfo->network.Ssid.Ssid, &(pattrib->pktlen)); +#ifdef CONFIG_DFS + /* Dot H */ + if(pmlmeext->cur_channel > 14) + { + pow_cap_ele[0] = 13; // Minimum transmit power capability + pow_cap_ele[1] = 21; // Maximum transmit power capability + pframe = rtw_set_ie(pframe, EID_PowerCap, 2, pow_cap_ele, &(pattrib->pktlen)); + + //supported channels + do{ + if( pmlmeext->channel_set[sup_ch_idx].ChannelNum <= 14 ) + { + sup_ch[0] = 1; //First channel number + sup_ch[1] = pmlmeext->channel_set[sup_ch_idx].ChannelNum; //Number of channel + } + else + { + sup_ch[idx_5g++] = pmlmeext->channel_set[sup_ch_idx].ChannelNum; + sup_ch[idx_5g++] = 1; + } + sup_ch_idx++; + } + while( pmlmeext->channel_set[sup_ch_idx].ChannelNum != 0 ); + pframe = rtw_set_ie(pframe, EID_SupportedChannels, idx_5g, sup_ch, &(pattrib->pktlen)); + } +#endif //CONFIG_DFS + //supported rate & extended supported rate #if 1 // Check if the AP's supported rates are also supported by STA. @@ -7936,7 +8312,7 @@ void issue_assocreq(_adapter *padapter) #endif #endif // Check if the AP's supported rates are also supported by STA. - if (bssrate_len == 0) { + if ((bssrate_len == 0) && (pmlmeinfo->network.SupportedRates[0] != 0)) { rtw_free_xmitbuf(pxmitpriv, pmgntframe->pxmitbuf); rtw_free_xmitframe(pxmitpriv, pmgntframe); goto exit; //don't connect to AP if no joint supported rate @@ -7948,9 +8324,11 @@ void issue_assocreq(_adapter *padapter) pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , 8, bssrate, &(pattrib->pktlen)); pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_ , (bssrate_len - 8), (bssrate + 8), &(pattrib->pktlen)); } - else + else if (bssrate_len > 0) { pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , bssrate_len , bssrate, &(pattrib->pktlen)); + } else { + DBG_871X("%s: Connect to AP without 11b and 11g data rate!\n",__FUNCTION__); } //vendor specific IE, such as WPA, WMM, WPS @@ -7964,17 +8342,18 @@ void issue_assocreq(_adapter *padapter) if ((_rtw_memcmp(pIE->data, RTW_WPA_OUI, 4)) || (_rtw_memcmp(pIE->data, WMM_OUI, 4)) || (_rtw_memcmp(pIE->data, WPS_OUI, 4))) - { - if(!padapter->registrypriv.wifi_spec) + { + vs_ie_length = pIE->Length; + if((!padapter->registrypriv.wifi_spec) && (_rtw_memcmp(pIE->data, WPS_OUI, 4))) { //Commented by Kurt 20110629 //In some older APs, WPS handshake //would be fail if we append vender extensions informations to AP - if(_rtw_memcmp(pIE->data, WPS_OUI, 4)){ - pIE->Length=14; - } + + vs_ie_length = 14; } - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, pIE->Length, pIE->data, &(pattrib->pktlen)); + + pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, vs_ie_length, pIE->data, &(pattrib->pktlen)); } break; @@ -8375,7 +8754,7 @@ int issue_nulldata(_adapter *padapter, unsigned char *da, unsigned int power_mod * The null data packet would be sent without power bit, * and not guarantee success. */ -s32 issue_nulldata_in_interrupt(PADAPTER padapter, u8 *da) +s32 issue_nulldata_in_interrupt(PADAPTER padapter, u8 *da, unsigned int power_mode) { int ret; struct mlme_ext_priv *pmlmeext; @@ -8389,7 +8768,7 @@ s32 issue_nulldata_in_interrupt(PADAPTER padapter, u8 *da) if (da == NULL) da = get_my_bssid(&(pmlmeinfo->network)); - ret = _issue_nulldata(padapter, da, 0, _FALSE); + ret = _issue_nulldata(padapter, da, power_mode, _FALSE); return ret; } @@ -8792,15 +9171,30 @@ void issue_action_SA_Query(_adapter *padapter, unsigned char *raddr, unsigned ch } #endif //CONFIG_IEEE80211W -void issue_action_BA(_adapter *padapter, unsigned char *raddr, unsigned char action, unsigned short status) +/** + * issue_action_ba - internal function to TX Block Ack action frame + * @padapter: the adapter to TX + * @raddr: receiver address + * @action: Block Ack Action + * @tid: tid + * @size: the announced AMPDU buffer size. used by ADDBA_RESP + * @status: status/reason code. used by ADDBA_RESP, DELBA + * @initiator: if we are the initiator of AMPDU association. used by DELBA + * @wait_ack: used xmit ack + * + * Returns: + * _SUCCESS: No xmit ack is used or acked + * _FAIL: not acked when using xmit ack + */ +static int issue_action_ba(_adapter *padapter, unsigned char *raddr, unsigned char action + , u8 tid, u8 size, u16 status, u8 initiator, int wait_ack) { + int ret = _FAIL; u8 category = RTW_WLAN_CATEGORY_BACK; u16 start_seq; u16 BA_para_set; - u16 reason_code; u16 BA_timeout_value; u16 BA_starting_seqctrl; - HT_CAP_AMPDU_FACTOR max_rx_ampdu_factor; struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; u8 *pframe; @@ -8814,12 +9208,9 @@ void issue_action_BA(_adapter *padapter, unsigned char *raddr, unsigned char act struct registry_priv *pregpriv = &padapter->registrypriv; #ifdef CONFIG_80211N_HT - DBG_871X("%s, category=%d, action=%d, status=%d\n", __FUNCTION__, category, action, status); if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) - { - return; - } + goto exit; //update attribute pattrib = &pmgntframe->attrib; @@ -8848,41 +9239,22 @@ void issue_action_BA(_adapter *padapter, unsigned char *raddr, unsigned char act pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); - status = cpu_to_le16(status); - - if (category == 3) { switch (action) { - case 0: //ADDBA req + case RTW_WLAN_ACTION_ADDBA_REQ: do { pmlmeinfo->dialogToken++; } while (pmlmeinfo->dialogToken == 0); pframe = rtw_set_fixed_ie(pframe, 1, &(pmlmeinfo->dialogToken), &(pattrib->pktlen)); -#ifdef CONFIG_BT_COEXIST - if (rtw_btcoex_IsBTCoexCtrlAMPDUSize(padapter) == _TRUE) - { - // A-MSDU NOT Supported - BA_para_set = 0; - // immediate Block Ack - BA_para_set |= (1 << 1) & IEEE80211_ADDBA_PARAM_POLICY_MASK; - // TID - BA_para_set |= (status << 2) & IEEE80211_ADDBA_PARAM_TID_MASK; - // max buffer size is 8 MSDU - BA_para_set |= (8 << 6) & RTW_IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK; - } - else -#endif - { - #if defined(CONFIG_RTL8188E) && defined(CONFIG_SDIO_HCI) - BA_para_set = (0x0802 | ((status & 0xf) << 2)); //immediate ack & 16 buffer size - #else - BA_para_set = (0x1002 | ((status & 0xf) << 2)); //immediate ack & 64 buffer size - #endif - } - //sys_mib.BA_para_set = 0x0802; //immediate ack & 32 buffer size + #if defined(CONFIG_RTL8188E) && defined(CONFIG_SDIO_HCI) + BA_para_set = (0x0802 | ((tid & 0xf) << 2)); /* immediate ack & 16 buffer size */ + #else + BA_para_set = (0x1002 | ((tid & 0xf) << 2)); /* immediate ack & 64 buffer size */ + #endif + BA_para_set = cpu_to_le16(BA_para_set); pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(BA_para_set)), &(pattrib->pktlen)); @@ -8894,11 +9266,11 @@ void issue_action_BA(_adapter *padapter, unsigned char *raddr, unsigned char act //if ((psta = rtw_get_stainfo(pstapriv, pmlmeinfo->network.MacAddress)) != NULL) if ((psta = rtw_get_stainfo(pstapriv, raddr)) != NULL) { - start_seq = (psta->sta_xmitpriv.txseq_tid[status & 0x07]&0xfff) + 1; + start_seq = (psta->sta_xmitpriv.txseq_tid[tid & 0x07]&0xfff) + 1; - DBG_871X("BA_starting_seqctrl = %d for TID=%d\n", start_seq, status & 0x07); + DBG_871X("BA_starting_seqctrl = %d for TID=%d\n", start_seq, tid & 0x07); - psta->BA_starting_seqctrl[status & 0x07] = start_seq; + psta->BA_starting_seqctrl[tid & 0x07] = start_seq; BA_starting_seqctrl = start_seq << 4; } @@ -8907,56 +9279,41 @@ void issue_action_BA(_adapter *padapter, unsigned char *raddr, unsigned char act pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(BA_starting_seqctrl)), &(pattrib->pktlen)); break; - case 1: //ADDBA rsp + case RTW_WLAN_ACTION_ADDBA_RESP: pframe = rtw_set_fixed_ie(pframe, 1, &(pmlmeinfo->ADDBA_req.dialog_token), &(pattrib->pktlen)); + status = cpu_to_le16(status); pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&status), &(pattrib->pktlen)); - /* - //BA_para_set = cpu_to_le16((le16_to_cpu(pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x1000); //64 buffer size - #if defined(CONFIG_RTL8188E )&& defined (CONFIG_SDIO_HCI) - BA_para_set = ((le16_to_cpu(pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x0800); //32buffer size - #else - BA_para_set = ((le16_to_cpu(pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x1000); //64 buffer size - #endif - */ - rtw_hal_get_def_var(padapter, HW_VAR_MAX_RX_AMPDU_FACTOR, &max_rx_ampdu_factor); - if(MAX_AMPDU_FACTOR_64K == max_rx_ampdu_factor) - BA_para_set = ((le16_to_cpu(pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x1000); //64 buffer size - else if(MAX_AMPDU_FACTOR_32K == max_rx_ampdu_factor) - BA_para_set = ((le16_to_cpu(pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x0800); //32 buffer size - else if(MAX_AMPDU_FACTOR_16K == max_rx_ampdu_factor) - BA_para_set = ((le16_to_cpu(pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x0400); //16 buffer size - else if(MAX_AMPDU_FACTOR_8K == max_rx_ampdu_factor) - BA_para_set = ((le16_to_cpu(pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x0200); //8 buffer size - else - BA_para_set = ((le16_to_cpu(pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x1000); //64 buffer size -#ifdef CONFIG_BT_COEXIST - if (rtw_btcoex_IsBTCoexCtrlAMPDUSize(padapter) == _TRUE) - { - // max buffer size is 8 MSDU - BA_para_set &= ~RTW_IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK; - BA_para_set |= (8 << 6) & RTW_IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK; + BA_para_set = le16_to_cpu(pmlmeinfo->ADDBA_req.BA_para_set); + + BA_para_set &= ~IEEE80211_ADDBA_PARAM_TID_MASK; + BA_para_set |= (tid << 2) & IEEE80211_ADDBA_PARAM_TID_MASK; + + BA_para_set &= ~RTW_IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK; + BA_para_set |= (size << 6) & RTW_IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK; + + if (!padapter->registrypriv.wifi_spec) { + if(pregpriv->ampdu_amsdu==0)//disabled + BA_para_set &= ~BIT(0); + else if(pregpriv->ampdu_amsdu==1)//enabled + BA_para_set |= BIT(0); } -#endif - if(pregpriv->ampdu_amsdu==0)//disabled - BA_para_set = cpu_to_le16(BA_para_set & ~BIT(0)); - else if(pregpriv->ampdu_amsdu==1)//enabled - BA_para_set = cpu_to_le16(BA_para_set | BIT(0)); - else //auto - BA_para_set = cpu_to_le16(BA_para_set); - + BA_para_set = cpu_to_le16(BA_para_set); + pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(BA_para_set)), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(pmlmeinfo->ADDBA_req.BA_timeout_value)), &(pattrib->pktlen)); break; - case 2://DELBA - BA_para_set = (status & 0x1F) << 3; + + case RTW_WLAN_ACTION_DELBA: + BA_para_set = 0; + BA_para_set |= (tid << 12) & IEEE80211_DELBA_PARAM_TID_MASK; + BA_para_set |= (initiator << 11) & IEEE80211_DELBA_PARAM_INITIATOR_MASK; + BA_para_set = cpu_to_le16(BA_para_set); pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(BA_para_set)), &(pattrib->pktlen)); - - reason_code = 37;//Requested from peer STA as it does not want to use the mechanism - reason_code = cpu_to_le16(reason_code); - pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(reason_code)), &(pattrib->pktlen)); + status = cpu_to_le16(status); + pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(status)), &(pattrib->pktlen)); break; default: break; @@ -8965,8 +9322,130 @@ void issue_action_BA(_adapter *padapter, unsigned char *raddr, unsigned char act pattrib->last_txcmdsz = pattrib->pktlen; - dump_mgntframe(padapter, pmgntframe); + if (wait_ack) { + ret = dump_mgntframe_and_wait_ack(padapter, pmgntframe); + } else { + dump_mgntframe(padapter, pmgntframe); + ret = _SUCCESS; + } + +exit: #endif //CONFIG_80211N_HT + return ret; +} + +/** + * issue_addba_req - TX ADDBA_REQ + * @adapter: the adapter to TX + * @ra: receiver address + * @tid: tid + */ +inline void issue_addba_req(_adapter *adapter, unsigned char *ra, u8 tid) +{ + issue_action_ba(adapter, ra, RTW_WLAN_ACTION_ADDBA_REQ + , tid + , 0 /* unused */ + , 0 /* unused */ + , 0 /* unused */ + , _FALSE + ); + DBG_871X(FUNC_ADPT_FMT" ra="MAC_FMT" tid=%u\n" + , FUNC_ADPT_ARG(adapter), MAC_ARG(ra), tid); + +} + +/** + * issue_addba_rsp - TX ADDBA_RESP + * @adapter: the adapter to TX + * @ra: receiver address + * @tid: tid + * @status: status code + * @size: the announced AMPDU buffer size + */ +inline void issue_addba_rsp(_adapter *adapter, unsigned char *ra, u8 tid, u16 status, u8 size) +{ + issue_action_ba(adapter, ra, RTW_WLAN_ACTION_ADDBA_RESP + , tid + , size + , status + , 0 /* unused */ + , _FALSE + ); + DBG_871X(FUNC_ADPT_FMT" ra="MAC_FMT" status=%u, tid=%u, size=%u\n" + , FUNC_ADPT_ARG(adapter), MAC_ARG(ra), status, tid, size); +} + +/** + * issue_del_ba - TX DELBA + * @adapter: the adapter to TX + * @ra: receiver address + * @tid: tid + * @reason: reason code + * @initiator: if we are the initiator of AMPDU association. used by DELBA + */ +inline void issue_del_ba(_adapter *adapter, unsigned char *ra, u8 tid, u16 reason, u8 initiator) +{ + issue_action_ba(adapter, ra, RTW_WLAN_ACTION_DELBA + , tid + , 0 /* unused */ + , reason + , initiator + , _FALSE + ); + DBG_871X(FUNC_ADPT_FMT" ra="MAC_FMT" reason=%u, tid=%u, initiator=%u\n" + , FUNC_ADPT_ARG(adapter), MAC_ARG(ra), reason, tid, initiator); +} + +/** + * issue_del_ba_ex - TX DELBA with xmit ack options + * @adapter: the adapter to TX + * @ra: receiver address + * @tid: tid + * @reason: reason code + * @initiator: if we are the initiator of AMPDU association. used by DELBA + * @try_cnt: the max driver level TX count to try + * @wait_ms: the waiting ms for each driver level TX + */ +int issue_del_ba_ex(_adapter *adapter, unsigned char *ra, u8 tid, u16 reason, u8 initiator + , int try_cnt, int wait_ms) +{ + int ret; + int i = 0; + u32 start = rtw_get_current_time(); + + do { + ret = issue_action_ba(adapter, ra, RTW_WLAN_ACTION_DELBA + , tid + , 0 /* unused */ + , reason + , initiator + , wait_ms > 0?_TRUE:_FALSE + ); + + i++; + + if (adapter->bDriverStopped || adapter->bSurpriseRemoved) + break; + + if (i < try_cnt && wait_ms > 0 && ret == _FAIL) + rtw_msleep_os(wait_ms); + + } while ((i < try_cnt) && ((ret == _FAIL) || (wait_ms == 0))); + + if (ret != _FAIL) { + ret = _SUCCESS; + #ifndef DBG_XMIT_ACK + /* goto exit; */ + #endif + } + + if (try_cnt && wait_ms) { + DBG_871X(FUNC_ADPT_FMT" ra="MAC_FMT" reason=%u, tid=%u, initiator=%u%s, %d/%d in %u ms\n" + , FUNC_ADPT_ARG(adapter), MAC_ARG(ra), reason, tid, initiator + , ret == _SUCCESS?", acked":"", i, try_cnt, rtw_get_passing_time_ms(start)); + } +exit: + return ret; } static void issue_action_BSSCoexistPacket(_adapter *padapter) @@ -9127,62 +9606,235 @@ static void issue_action_BSSCoexistPacket(_adapter *padapter) #endif //CONFIG_80211N_HT } +// Spatial Multiplexing Powersave (SMPS) action frame +int _issue_action_SM_PS(_adapter *padapter , unsigned char *raddr , u8 NewMimoPsMode , u8 wait_ack) +{ + + int ret=0; + unsigned char category = RTW_WLAN_CATEGORY_HT; + u8 action = RTW_WLAN_ACTION_HT_SM_PS; + u8 sm_power_control=0; + struct xmit_frame *pmgntframe; + struct pkt_attrib *pattrib; + unsigned char *pframe; + struct rtw_ieee80211_hdr *pwlanhdr; + unsigned short *fctrl; + struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); + struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + + + if(NewMimoPsMode==WLAN_HT_CAP_SM_PS_DISABLED) + { + sm_power_control = sm_power_control & ~(BIT(0)); // SM Power Save Enable = 0 SM Power Save Disable + } + else if(NewMimoPsMode==WLAN_HT_CAP_SM_PS_STATIC) + { + sm_power_control = sm_power_control | BIT(0); // SM Power Save Enable = 1 SM Power Save Enable + sm_power_control = sm_power_control & ~(BIT(1)); // SM Mode = 0 Static Mode + } + else if(NewMimoPsMode==WLAN_HT_CAP_SM_PS_DYNAMIC) + { + sm_power_control = sm_power_control | BIT(0); // SM Power Save Enable = 1 SM Power Save Enable + sm_power_control = sm_power_control | BIT(1); // SM Mode = 1 Dynamic Mode + } + else + return ret; + + DBG_871X("%s, sm_power_control=%u, NewMimoPsMode=%u\n", __FUNCTION__ , sm_power_control , NewMimoPsMode ); + + if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) + return ret; + + //update attribute + pattrib = &pmgntframe->attrib; + update_mgntframe_attrib(padapter, pattrib); + + _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + + pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; + pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + + fctrl = &(pwlanhdr->frame_ctl); + *(fctrl) = 0; + + _rtw_memcpy(pwlanhdr->addr1, raddr, ETH_ALEN); /* RA */ + _rtw_memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); /* TA */ + _rtw_memcpy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); /* DA = RA */ + + SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); + pmlmeext->mgnt_seq++; + SetFrameSubType(pframe, WIFI_ACTION); + + pframe += sizeof(struct rtw_ieee80211_hdr_3addr); + pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + + /* category, action */ + pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); + pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); + + pframe = rtw_set_fixed_ie(pframe, 1, &(sm_power_control), &(pattrib->pktlen)); + + pattrib->last_txcmdsz = pattrib->pktlen; + + if(wait_ack) + { + ret = dump_mgntframe_and_wait_ack(padapter, pmgntframe); + } + else + { + dump_mgntframe(padapter, pmgntframe); + ret = _SUCCESS; + } + + if (ret != _SUCCESS) + DBG_8192C("%s, ack to\n", __func__); + + return ret; +} + +int issue_action_SM_PS_wait_ack(_adapter *padapter, unsigned char *raddr, u8 NewMimoPsMode, int try_cnt, int wait_ms) +{ + int ret = 0; + int i = 0; + u32 start = rtw_get_current_time(); + + do { + ret = _issue_action_SM_PS(padapter, raddr, NewMimoPsMode , wait_ms>0?_TRUE:_FALSE ); + + i++; + + if (padapter->bDriverStopped || padapter->bSurpriseRemoved) + break; + + if(i < try_cnt && wait_ms > 0 && ret==_FAIL) + rtw_msleep_os(wait_ms); + + }while((irecvreorder_ctrl[tid].enable == _TRUE) { + u8 ampdu_size_bak = sta->recvreorder_ctrl[tid].ampdu_size; + + sta->recvreorder_ctrl[tid].enable = _FALSE; + sta->recvreorder_ctrl[tid].ampdu_size = RX_AMPDU_SIZE_INVALID; + + if (rtw_del_rx_ampdu_test_trigger_no_tx_fail()) + ret = _FAIL; + else if (wait_ack) + ret = issue_del_ba_ex(adapter, sta->hwaddr, tid, 37, initiator, 3, 1); + else + issue_del_ba(adapter, sta->hwaddr, tid, 37, initiator); + + if (ret == _FAIL && sta->recvreorder_ctrl[tid].enable == _FALSE) + sta->recvreorder_ctrl[tid].ampdu_size = ampdu_size_bak; + } + } else if (initiator == 1) { + /* originator */ +#ifdef CONFIG_80211N_HT + if (force || sta->htpriv.agg_enable_bitmap & BIT(tid)) { + sta->htpriv.agg_enable_bitmap &= ~BIT(tid); + sta->htpriv.candidate_tid_bitmap &= ~BIT(tid); + issue_del_ba(adapter, sta->hwaddr, tid, 37, initiator); + } +#endif + } + +exit: + return ret; +} + +inline unsigned int send_delba_sta_tid(_adapter *adapter, u8 initiator, struct sta_info *sta, u8 tid + , u8 force) +{ + return _send_delba_sta_tid(adapter, initiator, sta, tid, force, 0); +} + +inline unsigned int send_delba_sta_tid_wait_ack(_adapter *adapter, u8 initiator, struct sta_info *sta, u8 tid + , u8 force) +{ + return _send_delba_sta_tid(adapter, initiator, sta, tid, force, 1); +} + unsigned int send_delba(_adapter *padapter, u8 initiator, u8 *addr) { struct sta_priv *pstapriv = &padapter->stapriv; struct sta_info *psta = NULL; - //struct recv_reorder_ctrl *preorder_ctrl; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); u16 tid; - if((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE) + if ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE) if (!(pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS)) return _SUCCESS; - + psta = rtw_get_stainfo(pstapriv, addr); if(psta==NULL) return _SUCCESS; - //DBG_871X("%s:%s\n", __FUNCTION__, (initiator==0)?"RX_DIR":"TX_DIR"); - - if(initiator==0) // recipient - { - for(tid = 0;tidrecvreorder_ctrl[tid].enable == _TRUE) - { - DBG_871X("rx agg disable tid(%d)\n",tid); - issue_action_BA(padapter, addr, RTW_WLAN_ACTION_DELBA, (((tid <<1) |initiator)&0x1F)); - psta->recvreorder_ctrl[tid].enable = _FALSE; - psta->recvreorder_ctrl[tid].indicate_seq = 0xffff; - #ifdef DBG_RX_SEQ - DBG_871X("DBG_RX_SEQ %s:%d indicate_seq:%u \n", __FUNCTION__, __LINE__, - psta->recvreorder_ctrl[tid].indicate_seq); - #endif - } - } - } - else if(initiator == 1)// originator - { -#ifdef CONFIG_80211N_HT - //DBG_871X("tx agg_enable_bitmap(0x%08x)\n", psta->htpriv.agg_enable_bitmap); - for(tid = 0;tidhtpriv.agg_enable_bitmap & BIT(tid)) - { - DBG_871X("tx agg disable tid(%d)\n",tid); - issue_action_BA(padapter, addr, RTW_WLAN_ACTION_DELBA, (((tid <<1) |initiator)&0x1F) ); - psta->htpriv.agg_enable_bitmap &= ~BIT(tid); - psta->htpriv.candidate_tid_bitmap &= ~BIT(tid); - - } - } -#endif //CONFIG_80211N_HT - } - + #if 0 + DBG_871X("%s:%s\n", __func__, (initiator == 0)?"RX_DIR":"TX_DIR"); + if (initiator == 1) /* originator */ + DBG_871X("tx agg_enable_bitmap(0x%08x)\n", psta->htpriv.agg_enable_bitmap); + #endif + + for (tid = 0; tid < TID_NUM; tid++) + send_delba_sta_tid(padapter, initiator, psta, tid, 0); + return _SUCCESS; - } unsigned int send_beacon(_adapter *padapter) @@ -9198,13 +9850,16 @@ unsigned int send_beacon(_adapter *padapter) //#endif #ifdef CONFIG_PCI_HCI - //DBG_871X("%s\n", __FUNCTION__); + rtw_hal_set_hwreg(padapter, HW_VAR_BCN_VALID, NULL); + + /* 8192EE Port select for Beacon DL */ + rtw_hal_set_hwreg(padapter, HW_VAR_DL_BCN_SEL, NULL); + issue_beacon(padapter, 0); return _SUCCESS; - #endif #if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) @@ -9278,7 +9933,8 @@ void site_survey(_adapter *padapter) RT_SCAN_TYPE ScanType = SCAN_PASSIVE; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - u32 initialgain = 0; + u8 initialgain = 0; + u32 channel_scan_time_ms = 0,val32 = 0; #ifdef CONFIG_P2P @@ -9453,28 +10109,43 @@ void site_survey(_adapter *padapter) } } } + #if defined(CONFIG_ATMEL_RC_PATCH) // treat wlan0 & p2p0 in same way, may be changed in near feature. // assume home channel is 6, channel switch sequence will be // 1,2-6-3,4-6-5,6-6-7,8-6-9,10-6-11,12-6-13,14 //if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)==_TRUE) - if( stay_buddy_ch == 1 ) - set_survey_timer(pmlmeext, pmlmeext->chan_scan_time * RTW_STAY_AP_CH_MILLISECOND ); + if( stay_buddy_ch == 1 ){ + channel_scan_time_ms = pmlmeext->chan_scan_time * RTW_STAY_AP_CH_MILLISECOND; + } else { if( check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) - set_survey_timer(pmlmeext, 20); + channel_scan_time_ms = 20; else - set_survey_timer(pmlmeext, 40); + channel_scan_time_ms = 40 } #elif defined(CONFIG_STA_MODE_SCAN_UNDER_AP_MODE) if( stay_buddy_ch == 1 ) - set_survey_timer(pmlmeext, pmlmeext->chan_scan_time * RTW_STAY_AP_CH_MILLISECOND ); - else - set_survey_timer(pmlmeext, pmlmeext->chan_scan_time); + channel_scan_time_ms = pmlmeext->chan_scan_time * RTW_STAY_AP_CH_MILLISECOND ; + else + channel_scan_time_ms = pmlmeext->chan_scan_time; #else - set_survey_timer(pmlmeext, pmlmeext->chan_scan_time); + channel_scan_time_ms = pmlmeext->chan_scan_time; +#endif + + set_survey_timer(pmlmeext, channel_scan_time_ms); +#if defined(CONFIG_SIGNAL_DISPLAY_DBM) && defined(CONFIG_BACKGROUND_NOISE_MONITOR) + { + struct noise_info info; + info.bPauseDIG = _FALSE; + info.IGIValue = 0; + info.max_time = channel_scan_time_ms/2;//ms + info.chan = survey_channel; + rtw_hal_set_odm_var(padapter, HAL_ODM_NOISE_MONITOR,&info, _FALSE); + } #endif + } else { @@ -9489,8 +10160,8 @@ void site_survey(_adapter *padapter) if (rtw_get_ch_setting_union(padapter, &cur_channel, &cur_bwmode, &cur_ch_offset) != 0) { if (0) - DBG_871X(FUNC_ADPT_FMT" back to linked union - ch:%u, bw:%u, offset:%u\n", - FUNC_ADPT_ARG(padapter), cur_channel, cur_bwmode, cur_ch_offset); + DBG_871X(FUNC_ADPT_FMT" back to linked/linking union - ch:%u, bw:%u, offset:%u\n", + FUNC_ADPT_ARG(padapter), cur_channel, cur_bwmode, cur_ch_offset); } #ifdef CONFIG_IOCTL_CFG80211 else if(padapter->pbuddy_adapter @@ -9534,12 +10205,13 @@ void site_survey(_adapter *padapter) rtw_p2p_set_state(pwdinfo, P2P_STATE_FIND_PHASE_LISTEN); pmlmeext->sitesurvey_res.state = SCAN_DISABLE; - initialgain = 0xff; //restore RX GAIN - rtw_hal_set_hwreg(padapter, HW_VAR_INITIAL_GAIN, (u8 *)(&initialgain)); - //turn on dynamic functions + //turn on phy-dynamic functions Restore_DM_Func_Flag(padapter); //Switch_DM_Func(padapter, DYNAMIC_FUNC_DIG|DYNAMIC_FUNC_HP|DYNAMIC_FUNC_SS, _TRUE); + initialgain = 0xff; //restore RX GAIN + rtw_hal_set_hwreg(padapter, HW_VAR_INITIAL_GAIN, (u8 *)(&initialgain)); + _set_timer( &pwdinfo->find_phase_timer, ( u32 ) ( ( u32 ) ( pwdinfo->listen_dwell ) * 100 ) ); } else @@ -9614,11 +10286,13 @@ void site_survey(_adapter *padapter) //config MSR Set_MSR(padapter, (pmlmeinfo->state & 0x3)); - initialgain = 0xff; //restore RX GAIN - rtw_hal_set_hwreg(padapter, HW_VAR_INITIAL_GAIN, (u8 *)(&initialgain)); - //turn on dynamic functions + //turn on phy-dynamic functions Restore_DM_Func_Flag(padapter); //Switch_DM_Func(padapter, DYNAMIC_ALL_FUNC_ENABLE, _TRUE); + + initialgain = 0xff; //restore RX GAIN + rtw_hal_set_hwreg(padapter, HW_VAR_INITIAL_GAIN, (u8 *)(&initialgain)); + if (is_client_associated_to_ap(padapter) == _TRUE) { @@ -9999,6 +10673,7 @@ void start_clnt_join(_adapter* padapter) struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX*)(&(pmlmeinfo->network)); int beacon_timeout; + u8 ASIX_ID[]= {0x00, 0x0E, 0xC6}; //update wireless mode update_wireless_mode(padapter); @@ -10006,6 +10681,12 @@ void start_clnt_join(_adapter* padapter) //udpate capability caps = rtw_get_capability((WLAN_BSSID_EX *)pnetwork); update_capinfo(padapter, caps); + + //check if sta is ASIX peer and fix IOT issue if it is. + if (_rtw_memcmp(get_my_bssid(&pmlmeinfo->network) ,ASIX_ID ,3)) { + u8 iot_flag = _TRUE; + rtw_hal_set_hwreg(padapter, HW_VAR_ASIX_IOT, (u8 *)(&iot_flag)); + } if (caps&cap_ESS) { Set_MSR(padapter, WIFI_FW_STATION_STATE); @@ -10328,7 +11009,7 @@ static void process_80211d(PADAPTER padapter, WLAN_BSSID_EX *bssid) if (pregistrypriv->wireless_mode & WIRELESS_11A) { do { - if ((i == MAX_CHANNEL_NUM) || + if ((i >= MAX_CHANNEL_NUM) || (chplan_sta[i].ChannelNum == 0)) break; @@ -10620,6 +11301,52 @@ void report_join_res(_adapter *padapter, int res) } +void report_wmm_edca_update(_adapter *padapter) +{ + struct cmd_obj *pcmd_obj; + u8 *pevtcmd; + u32 cmdsz; + struct wmm_event *pwmm_event; + struct C2HEvent_Header *pc2h_evt_hdr; + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + struct cmd_priv *pcmdpriv = &padapter->cmdpriv; + + if ((pcmd_obj = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj))) == NULL) + { + return; + } + + cmdsz = (sizeof(struct wmm_event) + sizeof(struct C2HEvent_Header)); + if ((pevtcmd = (u8*)rtw_zmalloc(cmdsz)) == NULL) + { + rtw_mfree((u8 *)pcmd_obj, sizeof(struct cmd_obj)); + return; + } + + _rtw_init_listhead(&pcmd_obj->list); + + pcmd_obj->cmdcode = GEN_CMD_CODE(_Set_MLME_EVT); + pcmd_obj->cmdsz = cmdsz; + pcmd_obj->parmbuf = pevtcmd; + + pcmd_obj->rsp = NULL; + pcmd_obj->rspsz = 0; + + pc2h_evt_hdr = (struct C2HEvent_Header*)(pevtcmd); + pc2h_evt_hdr->len = sizeof(struct wmm_event); + pc2h_evt_hdr->ID = GEN_EVT_CODE(_WMM); + pc2h_evt_hdr->seq = ATOMIC_INC_RETURN(&pmlmeext->event_seq); + + pwmm_event = (struct wmm_event*)(pevtcmd + sizeof(struct C2HEvent_Header)); + pwmm_event->wmm =0; + + rtw_enqueue_cmd(pcmdpriv, pcmd_obj); + + return; + +} + void report_del_sta_event(_adapter *padapter, unsigned char* MacAddr, unsigned short reason) { struct cmd_obj *pcmd_obj; @@ -10842,6 +11569,8 @@ void update_sta_info(_adapter *padapter, struct sta_info *psta) psta->htpriv.ampdu_enable = pmlmepriv->htpriv.ampdu_enable; + psta->htpriv.rx_ampdu_min_spacing = (pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para&IEEE80211_HT_CAP_AMPDU_DENSITY)>>2; + if (support_short_GI(padapter, &(pmlmeinfo->HT_caps), CHANNEL_WIDTH_20)) psta->htpriv.sgi_20m = _TRUE; @@ -10850,6 +11579,10 @@ void update_sta_info(_adapter *padapter, struct sta_info *psta) psta->qos_option = _TRUE; + psta->htpriv.ldpc_cap = pmlmepriv->htpriv.ldpc_cap; + psta->htpriv.stbc_cap = pmlmepriv->htpriv.stbc_cap; + psta->htpriv.beamform_cap = pmlmepriv->htpriv.beamform_cap; + _rtw_memcpy(&psta->htpriv.ht_cap, &pmlmeinfo->HT_caps, sizeof(struct rtw_ieee80211_ht_cap)); } else @@ -10884,6 +11617,8 @@ void update_sta_info(_adapter *padapter, struct sta_info *psta) _rtw_memcpy(&psta->vhtpriv, &pmlmepriv->vhtpriv, sizeof(struct vht_priv)); #endif //CONFIG_80211AC_VHT + update_ldpc_stbc_cap(psta); + _enter_critical_bh(&psta->lock, &irqL); psta->state = _FW_LINKED; _exit_critical_bh(&psta->lock, &irqL); @@ -10895,16 +11630,39 @@ static void rtw_mlmeext_disconnect(_adapter *padapter) struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX*)(&(pmlmeinfo->network)); u8 state_backup = (pmlmeinfo->state&0x03); + u8 ASIX_ID[]= {0x00, 0x0E, 0xC6}; //set_opmode_cmd(padapter, infra_client_with_mlme); +#if 1 + /* + * For safety, prevent from keeping macid sleep. + * If we can sure all power mode enter/leave are paired, + * this check can be removed. + * Lucas@20131113 + */ + /* wakeup macid after disconnect. */ + { + struct sta_info *psta; + psta = rtw_get_stainfo(&padapter->stapriv, get_my_bssid(pnetwork)); + if (psta) + rtw_hal_macid_wakeup(padapter, psta->mac_id); + } +#endif + rtw_hal_set_hwreg(padapter, HW_VAR_MLME_DISCONNECT, 0); rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, null_addr); //set MSR to no link state -> infra. mode Set_MSR(padapter, _HW_STATE_STATION_); + //check if sta is ASIX peer and fix IOT issue if it is. + if (_rtw_memcmp(get_my_bssid(&pmlmeinfo->network) ,ASIX_ID ,3)) { + u8 iot_flag = _FALSE; + rtw_hal_set_hwreg(padapter, HW_VAR_ASIX_IOT, (u8 *)(&iot_flag)); + } pmlmeinfo->state = WIFI_FW_NULL_STATE; if(state_backup == WIFI_FW_STATION_STATE) @@ -10965,6 +11723,16 @@ static void rtw_mlmeext_disconnect(_adapter *padapter) pmlmepriv->LinkDetectInfo.TrafficTransitionCount = 0; pmlmepriv->LinkDetectInfo.LowPowerTransitionCount = 0; +#ifdef CONFIG_TDLS + padapter->tdlsinfo.ap_prohibited = _FALSE; + + /* For TDLS channel switch, currently we only allow it to work in wifi logo test mode */ + if (padapter->registrypriv.wifi_spec == 1) + { + padapter->tdlsinfo.ch_switch_prohibited = _FALSE; + } +#endif /* CONFIG_TDLS */ + } void mlmeext_joinbss_event_callback(_adapter *padapter, int join_res) @@ -11036,6 +11804,10 @@ void mlmeext_joinbss_event_callback(_adapter *padapter, int join_res) set_sta_rate(padapter, psta); rtw_sta_media_status_rpt(padapter, psta, 1); + + /* wakeup macid after join bss successfully to ensure + the subsequent data frames can be sent out normally */ + rtw_hal_macid_wakeup(padapter, psta->mac_id); } if (rtw_port_switch_chk(padapter) == _TRUE) @@ -11058,7 +11830,8 @@ void mlmeext_joinbss_event_callback(_adapter *padapter, int join_res) #endif #ifdef CONFIG_BEAMFORMING - beamforming_wk_cmd(padapter, BEAMFORMING_CTRL_ENTER, (u8 *)psta, sizeof(struct sta_info), 0); + if (psta) + beamforming_wk_cmd(padapter, BEAMFORMING_CTRL_ENTER, (u8 *)psta, sizeof(struct sta_info), 0); #endif exit_mlmeext_joinbss_event_callback: @@ -11154,42 +11927,21 @@ void _linked_info_dump(_adapter *padapter) { int i; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - u8 mac_id; - int UndecoratedSmoothedPWDB; - struct dvobj_priv *pdvobj = adapter_to_dvobj(padapter); - #if 0 - DBG_871X("============ linked status check ===================\n"); - DBG_871X("pathA Rx SNRdb:%d, pathB Rx SNRdb:%d\n",padapter->recvpriv.RxSNRdB[0], padapter->recvpriv.RxSNRdB[1]); - DBG_871X("pathA Rx PWDB:%d\n",padapter->recvpriv.rxpwdb); - rtw_hal_get_def_var(padapter, HAL_DEF_UNDERCORATEDSMOOTHEDPWDB, &UndecoratedSmoothedPWDB); - DBG_871X("UndecoratedSmoothedPWDB:%d\n",UndecoratedSmoothedPWDB); - DBG_871X("Rx RSSI:%d\n",padapter->recvpriv.rssi); - DBG_871X("Rx Signal_strength:%d\n",padapter->recvpriv.signal_strength); - DBG_871X("Rx Signal_qual:%d \n",padapter->recvpriv.signal_qual); - if ( check_fwstate( &padapter->mlmepriv, _FW_LINKED ) ) - { - DBG_871X("bw mode: %d, channel: %d\n", padapter->mlmeextpriv.cur_bwmode, padapter->mlmeextpriv.cur_channel ); - DBG_871X("received bytes = %d\n", (u32) (padapter->recvpriv.rx_bytes - padapter->recvpriv.last_rx_bytes ) ); - } - DBG_871X("============ linked status check ===================\n"); - DBG_871X("============ RX GAIN / FALSE ALARM ===================\n"); - DBG_871X(" DIG PATH-A(0x%02x), PATH-B(0x%02x)\n",rtw_read8(padapter,0xc50),rtw_read8(padapter,0xc58)); - DBG_871X(" OFDM -Alarm DA2(0x%04x),DA4(0x%04x),DA6(0x%04x),DA8(0x%04x)\n", - rtw_read16(padapter,0xDA2),rtw_read16(padapter,0xDA4),rtw_read16(padapter,0xDA6),rtw_read16(padapter,0xDA8)); - - DBG_871X(" CCK -Alarm A5B(0x%02x),A5C(0x%02x)\n",rtw_read8(padapter,0xA5B),rtw_read8(padapter,0xA5C)); - #endif + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + int UndecoratedSmoothedPWDB = 0; + struct dvobj_priv *dvobj = adapter_to_dvobj(padapter); + struct macid_ctl_t *macid_ctl = dvobj_to_macidctl(dvobj); if(padapter->bLinkInfoDump){ - DBG_871X("\n============ linked status check ===================\n"); - + DBG_871X("\n============["ADPT_FMT"] linked status check ===================\n",ADPT_ARG(padapter)); + if((pmlmeinfo->state&0x03) == WIFI_FW_STATION_STATE) { rtw_hal_get_def_var(padapter, HAL_DEF_UNDERCORATEDSMOOTHEDPWDB, &UndecoratedSmoothedPWDB); - DBG_871X("UndecoratedSmoothedPWDB:%d\n",UndecoratedSmoothedPWDB); + DBG_871X("AP[" MAC_FMT "] - UndecoratedSmoothedPWDB:%d\n", + MAC_ARG(padapter->mlmepriv.cur_network.network.MacAddress),UndecoratedSmoothedPWDB); } else if((pmlmeinfo->state&0x03) == _HW_STATE_AP_) { @@ -11205,23 +11957,26 @@ void _linked_info_dump(_adapter *padapter) while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list); - plist = get_next(plist); - - DBG_871X("STA:UndecoratedSmoothedPWDB:%d\n", - psta->rssi_stat.UndecoratedSmoothedPWDB); + plist = get_next(plist); + + DBG_871X("STA[" MAC_FMT "]:UndecoratedSmoothedPWDB:%d\n", + MAC_ARG(psta->hwaddr),psta->rssi_stat.UndecoratedSmoothedPWDB); } _exit_critical_bh(&pstapriv->asoc_list_lock, &irqL); } - for(i=0; inum; i++) { - if(pdvobj->macid[i] == _TRUE) - { - if(i !=1) //skip bc/mc sta - //============ tx info ============ - rtw_hal_get_def_var(padapter, HW_DEF_RA_INFO_DUMP, &i); + if(rtw_macid_is_used(macid_ctl, i) + && !rtw_macid_is_bmc(macid_ctl, i) /* skip bc/mc sta */ + ) { + //============ tx info ============ + rtw_hal_get_def_var(padapter, HW_DEF_RA_INFO_DUMP, &i); } } + rtw_hal_set_def_var(padapter, HAL_DEF_DBG_RX_INFO_DUMP, NULL); + + } @@ -11348,8 +12103,7 @@ struct candidate_pool{ for(i=0; i< num_checkalive; i++) { #ifdef CONFIG_XMIT_ACK - //TDLS: Should we set wait_ms to 300 for keeping alive? - ack_chk = issue_nulldata_to_TDLS_peer_STA(padapter, checkalive[i].addr, 0, 3, 300); + ack_chk = issue_nulldata_to_TDLS_peer_STA(padapter, checkalive[i].addr, 0, 3, 500); if(ack_chk == _SUCCESS) { @@ -11380,7 +12134,8 @@ struct candidate_pool{ } #endif //CONFIG_TDLS -void linked_status_chk(_adapter *padapter) +//from_timer == 1 means driver is in LPS +void linked_status_chk(_adapter *padapter, u8 from_timer) { u32 i; struct sta_info *psta; @@ -11407,18 +12162,31 @@ void linked_status_chk(_adapter *padapter) #endif #ifdef CONFIG_P2P if (!rtw_p2p_chk_state(&padapter->wdinfo, P2P_STATE_NONE)) - link_count_limit = 3; // 8 sec + { + if(!from_timer) + link_count_limit = 3; // 8 sec + else + link_count_limit = 15; // 32 sec + } else #endif // CONFIG_P2P - link_count_limit = 7; // 16 sec + { + if(!from_timer) + link_count_limit = 7; // 16 sec + else + link_count_limit = 29; // 60 sec + } + +#ifdef CONFIG_TDLS +#ifdef CONFIG_TDLS_CH_SW + if (ATOMIC_READ(&padapter->tdlsinfo.chsw_info.chsw_on) == _TRUE) + return; +#endif /* CONFIG_TDLS_CH_SW */ - // Marked by Kurt 20130715 - // For WiDi 3.5 and latered on, they don't ask WiDi sink to do roaming, so we could not check rx limit that strictly. - // todo: To check why we under miracast session, rx_chk would be _FALSE - //#ifdef CONFIG_INTEL_WIDI - //if (padapter->mlmepriv.widi_state != INTEL_WIDI_STATE_NONE) - // rx_chk_limit = 1; - //#endif +#ifdef CONFIG_TDLS_AUTOCHECKALIVE + linked_status_chk_tdls(padapter); +#endif /* CONFIG_TDLS_AUTOCHECKALIVE */ +#endif /* CONFIG_TDLS */ if ((psta = rtw_get_stainfo(pstapriv, pmlmeinfo->network.MacAddress)) != NULL) { @@ -11474,9 +12242,9 @@ void linked_status_chk(_adapter *padapter) if (tx_chk != _SUCCESS && pmlmeinfo->link_count++ == link_count_limit) { #ifdef DBG_EXPIRATION_CHK - DBG_871X("%s issue_nulldata 0\n", __FUNCTION__); + DBG_871X("%s issue_nulldata(%d)\n", __FUNCTION__, from_timer?1:0); #endif - tx_chk = issue_nulldata_in_interrupt(padapter, NULL); + tx_chk = issue_nulldata_in_interrupt(padapter, NULL, from_timer?1:0); } } @@ -11502,10 +12270,6 @@ void linked_status_chk(_adapter *padapter) } //end of if ((psta = rtw_get_stainfo(pstapriv, passoc_res->network.MacAddress)) != NULL) -#if defined (CONFIG_TDLS) && defined (CONFIG_TDLS_AUTOCHECKALIVE) - linked_status_chk_tdls(padapter); -#endif //CONFIG_TDLS - } else if (is_client_associated_to_ibss(padapter)) { @@ -11700,7 +12464,7 @@ void link_timer_hdl(_adapter *padapter) { if (tx_cnt == pxmitpriv->tx_pkts) { - issue_nulldata_in_interrupt(padapter, NULL); + issue_nulldata_in_interrupt(padapter, NULL, 0); } tx_cnt = pxmitpriv->tx_pkts; @@ -11917,6 +12681,8 @@ u8 setopmode_hdl(_adapter *padapter, u8 *pbuf) else if(psetop->mode == Ndis802_11IBSS) { type = _HW_STATE_ADHOC_; + } else if (psetop->mode == Ndis802_11Monitor) { + type = _HW_STATE_MONITOR_; } else { @@ -11966,7 +12732,7 @@ u8 createbss_hdl(_adapter *padapter, u8 *pbuf) struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX*)(&(pmlmeinfo->network)); struct joinbss_parm *pparm = (struct joinbss_parm *)pbuf; - //u32 initialgain; + //u8 initialgain; #ifdef CONFIG_AP_MODE if (pmlmeinfo->state == WIFI_FW_AP_STATE) { @@ -11991,14 +12757,14 @@ u8 createbss_hdl(_adapter *padapter, u8 *pbuf) pmlmeinfo->agg_enable_bitmap = 0; pmlmeinfo->candidate_tid_bitmap = 0; - //disable dynamic functions, such as high power, DIG - Save_DM_Func_Flag(padapter); - Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, _FALSE); - //config the initial gain under linking, need to write the BB registers //initialgain = 0x1E; //rtw_hal_set_hwreg(padapter, HW_VAR_INITIAL_GAIN, (u8 *)(&initialgain)); + //disable dynamic functions, such as high power, DIG + Save_DM_Func_Flag(padapter); + Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, _FALSE); + //cancel link timer _cancel_timer_ex(&pmlmeext->link_timer); @@ -12021,64 +12787,22 @@ u8 createbss_hdl(_adapter *padapter, u8 *pbuf) } -u8 join_cmd_hdl(_adapter *padapter, u8 *pbuf) -{ - u8 join_type; - PNDIS_802_11_VARIABLE_IEs pIE; - struct registry_priv *pregpriv = &padapter->registrypriv; - struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX*)(&(pmlmeinfo->network)); -#ifdef CONFIG_ANTENNA_DIVERSITY - struct joinbss_parm *pparm = (struct joinbss_parm *)pbuf; -#endif //CONFIG_ANTENNA_DIVERSITY - u32 i; - u8 cbw40_enable=0; - //u32 initialgain; - //u32 acparm; - u8 ch, bw, offset; - -#if 1 - /* - * For safety, prevent from keeping macid sleep. - * If we can sure all power mode enter/leave are paired, - * this check can be removed. - * Lucas@20131113 - */ - { - struct sta_info *psta; - psta = rtw_get_stainfo(&padapter->stapriv, get_my_bssid(pnetwork)); - if (psta) - rtw_hal_macid_wakeup(padapter, psta->mac_id); - } -#endif - -#ifdef CONFIG_BT_COEXIST -{ - static u8 bw_mode = 0; - - if (0 == bw_mode) - { - bw_mode = pregpriv->bw_mode; // keep original bw_mode - DBG_871X(FUNC_ADPT_FMT ": [BTCOEX] Save bw_mode(0x%02x)\n", - FUNC_ADPT_ARG(padapter), pregpriv->bw_mode); - } - - if ((rtw_btcoex_1Ant(padapter) == _TRUE) - && (rtw_btcoex_IsBtLinkExist(padapter) == _TRUE)) - { - pregpriv->bw_mode = 0x00; - DBG_871X(FUNC_ADPT_FMT ": [BTCOEX] Change bw_mode to 20MHz(0x%02x)\n", - FUNC_ADPT_ARG(padapter), pregpriv->bw_mode); - } - else - { - pregpriv->bw_mode = bw_mode; - DBG_871X(FUNC_ADPT_FMT ": [BTCOEX] Restore bw_mode(0x%02x)\n", - FUNC_ADPT_ARG(padapter), pregpriv->bw_mode); - } -} -#endif // CONFIG_BT_COEXIST +u8 join_cmd_hdl(_adapter *padapter, u8 *pbuf) +{ + u8 join_type; + PNDIS_802_11_VARIABLE_IEs pIE; + struct registry_priv *pregpriv = &padapter->registrypriv; + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX*)(&(pmlmeinfo->network)); +#ifdef CONFIG_ANTENNA_DIVERSITY + struct joinbss_parm *pparm = (struct joinbss_parm *)pbuf; +#endif //CONFIG_ANTENNA_DIVERSITY + u32 i; + u8 cbw40_enable=0; + //u8 initialgain; + //u32 acparm; + u8 ch, bw, offset; //check already connecting to AP or not if (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) @@ -12140,8 +12864,9 @@ u8 join_cmd_hdl(_adapter *padapter, u8 *pbuf) //pmlmeinfo->assoc_AP_vendor = check_assoc_AP(pnetwork->IEs, pnetwork->IELength); //sizeof(NDIS_802_11_FIXED_IEs) - for (i = _FIXED_IE_LENGTH_; i < pnetwork->IELength;) - { + /*for (i = _FIXED_IE_LENGTH_; i < pnetwork->IELength;)*/ + i = _FIXED_IE_LENGTH_; + do { pIE = (PNDIS_802_11_VARIABLE_IEs)(pnetwork->IEs + i); switch (pIE->ElementID) @@ -12220,7 +12945,7 @@ u8 join_cmd_hdl(_adapter *padapter, u8 *pbuf) } i += (pIE->Length + 2); - } + } while (pnetwork->IELength-i); #if 0 if (padapter->registrypriv.wifi_spec) { // for WiFi test, follow WMM test plan spec @@ -12295,22 +13020,6 @@ u8 disconnect_hdl(_adapter *padapter, unsigned char *pbuf) WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX*)(&(pmlmeinfo->network)); u8 val8; - -#if 1 - /* - * For safety, prevent from keeping macid sleep. - * If we can sure all power mode enter/leave are paired, - * this check can be removed. - * Lucas@20131113 - */ - { - struct sta_info *psta; - psta = rtw_get_stainfo(&padapter->stapriv, get_my_bssid(pnetwork)); - if (psta) - rtw_hal_macid_wakeup(padapter, psta->mac_id); - } -#endif - if (is_client_associated_to_ap(padapter)) { #ifdef CONFIG_DFS @@ -12359,7 +13068,7 @@ int rtw_scan_ch_decision(_adapter *padapter, struct rtw_ieee80211_channel *out, for (i=0;ichannel_set, in[i].hw_value)) >=0 @@ -12388,7 +13097,7 @@ int rtw_scan_ch_decision(_adapter *padapter, struct rtw_ieee80211_channel *out, for (i=0;imax_chan_nums;i++) { if (0) - DBG_871X(FUNC_ADPT_FMT" ch:%u\n", FUNC_ADPT_ARG(padapter), pmlmeext->channel_set[i].ChannelNum); + DBG_871X(FUNC_ADPT_FMT" ch:%u\n", FUNC_ADPT_ARG(padapter), pmlmeext->channel_set[i].ChannelNum); if (rtw_mlme_band_check(padapter, pmlmeext->channel_set[i].ChannelNum) == _TRUE) { @@ -12461,7 +13170,7 @@ u8 sitesurvey_cmd_hdl(_adapter *padapter, u8 *pbuf) struct sitesurvey_parm *pparm = (struct sitesurvey_parm *)pbuf; u8 bdelayscan = _FALSE; u8 val8; - u32 initialgain; + u8 initialgain; u32 i; struct dvobj_priv *psdpriv = padapter->dvobj; struct debug_priv *pdbgpriv = &psdpriv->drv_dbg; @@ -12560,10 +13269,6 @@ u8 sitesurvey_cmd_hdl(_adapter *padapter, u8 *pbuf) #endif #endif /* CONFIG_FIND_BEST_CHANNEL */ - //disable dynamic functions, such as high power, DIG - Save_DM_Func_Flag(padapter); - Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, _FALSE); - //config the initial gain under scaning, need to write the BB registers #ifdef CONFIG_P2P #ifdef CONFIG_IOCTL_CFG80211 @@ -12578,6 +13283,10 @@ u8 sitesurvey_cmd_hdl(_adapter *padapter, u8 *pbuf) initialgain = 0x1e; rtw_hal_set_hwreg(padapter, HW_VAR_INITIAL_GAIN, (u8 *)(&initialgain)); + + //disable dynamic functions, such as high power, DIG + Save_DM_Func_Flag(padapter); + Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, _FALSE); //set MSR to no link state Set_MSR(padapter, _HW_STATE_NOLINK_); @@ -12610,120 +13319,87 @@ u8 setauth_hdl(_adapter *padapter, unsigned char *pbuf) u8 setkey_hdl(_adapter *padapter, u8 *pbuf) { - unsigned short ctrl; + u16 ctrl = 0; + s16 cam_id = 0; struct setkey_parm *pparm = (struct setkey_parm *)pbuf; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - unsigned char null_sta[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + unsigned char null_addr[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + u8 *addr; //main tx key for wep. if(pparm->set_tx) pmlmeinfo->key_index = pparm->keyid; - - //write cam - ctrl = BIT(15) | ((pparm->algorithm) << 2) | pparm->keyid; - DBG_871X_LEVEL(_drv_always_, "set group key to hw: alg:%d(WEP40-1 WEP104-5 TKIP-2 AES-4) " - "keyid:%d\n", pparm->algorithm, pparm->keyid); - write_cam(padapter, pparm->keyid, ctrl, null_sta, pparm->key); - + cam_id = rtw_camid_alloc(padapter, NULL, pparm->keyid); + + if (cam_id < 0){ + } else { + if (cam_id > 3) /* not default key, searched by A2 */ + addr = get_bssid(&padapter->mlmepriv); + else + addr = null_addr; + + ctrl = BIT(15) | BIT6 |((pparm->algorithm) << 2) | pparm->keyid; + write_cam(padapter, cam_id, ctrl, addr, pparm->key); + DBG_871X_LEVEL(_drv_always_, "set group key camid:%d, addr:"MAC_FMT", kid:%d, type:%s\n" + ,cam_id, MAC_ARG(addr), pparm->keyid, security_type_str(pparm->algorithm)); + } + + #ifdef DYNAMIC_CAMID_ALLOC + if (cam_id >=0 && cam_id <=3) + rtw_hal_set_hwreg(padapter, HW_VAR_SEC_DK_CFG, (u8*)_TRUE); + #endif + //allow multicast packets to driver - padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_ON_RCR_AM, null_addr); + padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_ON_RCR_AM, null_addr); return H2C_SUCCESS; } u8 set_stakey_hdl(_adapter *padapter, u8 *pbuf) { - u16 ctrl=0; - u8 cam_id = 0;//cam_entry + u16 ctrl = 0; + s16 cam_id = 0; u8 ret = H2C_SUCCESS; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); struct set_stakey_parm *pparm = (struct set_stakey_parm *)pbuf; struct sta_priv *pstapriv = &padapter->stapriv; struct sta_info *psta; -#ifdef CONFIG_TDLS - struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; -#endif //CONFIG_TDLS - - //cam_entry: - //0~3 for default key - - //for concurrent mode (ap+sta, sta+sta): - //default key is disable, using sw encrypt/decrypt - //camid 0, 1, 2, 3 is default entry for default key/group key - //macid = 1 is for bc/mc stainfo, no mapping to camid - //macid = 0 mapping to camid 4 - //for macid >=2, camid = macid+3; + if(pparm->algorithm == _NO_PRIVACY_) + goto write_to_cam; - if(pparm->algorithm == _NO_PRIVACY_) // clear cam entry - { - clear_cam_entry(padapter, pparm->id); - ret = H2C_SUCCESS; - goto exit_set_stakey_hdl; + psta = rtw_get_stainfo(pstapriv, pparm->addr); + if (!psta) { + DBG_871X_LEVEL(_drv_always_, "%s sta:"MAC_FMT" not found\n", __func__, MAC_ARG(pparm->addr)); + ret = H2C_REJECTED; + goto exit; } - if((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) - { - psta = rtw_get_stainfo(pstapriv, pparm->addr); - if(psta) - { - ctrl = (BIT(15) | ((pparm->algorithm) << 2)); - - DBG_871X("r871x_set_stakey_hdl(): enc_algorithm=%d\n", pparm->algorithm); - - if((psta->mac_id == 1) || (psta->mac_id>(NUM_STA-4))) - { - DBG_871X("r871x_set_stakey_hdl():set_stakey failed, mac_id(aid)=%d\n", psta->mac_id); - ret = H2C_REJECTED; - goto exit_set_stakey_hdl; - } - - cam_id = (u8)rtw_get_camid(psta->mac_id);//0~3 for default key, cmd_id=macid + 3; - - DBG_871X("Write CAM, mac_addr=%x:%x:%x:%x:%x:%x, cam_entry=%d\n", pparm->addr[0], - pparm->addr[1], pparm->addr[2], pparm->addr[3], pparm->addr[4], - pparm->addr[5], cam_id); - - write_cam(padapter, cam_id, ctrl, pparm->addr, pparm->key); - - ret = H2C_SUCCESS_RSP; - goto exit_set_stakey_hdl; + pmlmeinfo->enc_algo = pparm->algorithm; + cam_id = rtw_camid_alloc(padapter, psta, 0); + if (cam_id < 0) + goto exit; +write_to_cam: + if(pparm->algorithm == _NO_PRIVACY_) { + while((cam_id = rtw_camid_search(padapter, pparm->addr, -1)) >= 0) { + DBG_871X_LEVEL(_drv_always_, "clear key for addr:"MAC_FMT", camid:%d\n", MAC_ARG(pparm->addr), cam_id); + clear_cam_entry(padapter, cam_id); + rtw_camid_free(padapter,cam_id); } - else - { - DBG_871X("r871x_set_stakey_hdl(): sta has been free\n"); - ret = H2C_REJECTED; - goto exit_set_stakey_hdl; - } - - } - - - //below for sta mode - if((psta = rtw_get_stainfo(pstapriv, pparm->addr))) - { - cam_id = (u8)rtw_get_camid(psta->mac_id); + } else { + DBG_871X_LEVEL(_drv_always_, "set pairwise key camid:%d, addr:"MAC_FMT", kid:%d, type:%s\n", + cam_id, MAC_ARG(pparm->addr), pparm->keyid, security_type_str(pparm->algorithm)); + ctrl = BIT(15) | ((pparm->algorithm) << 2) | pparm->keyid; + write_cam(padapter, cam_id, ctrl, pparm->addr, pparm->key); } - else - cam_id = 4; - - ctrl = BIT(15) | ((pparm->algorithm) << 2); - - write_cam(padapter, cam_id, ctrl, pparm->addr, pparm->key); - - pmlmeinfo->enc_algo = pparm->algorithm; - - DBG_871X_LEVEL(_drv_always_, "set pairwise key to hw: alg:%d(WEP40-1 WEP104-5 TKIP-2 AES-4) camid:%d\n", - pparm->algorithm, cam_id); - -exit_set_stakey_hdl: + ret = H2C_SUCCESS_RSP; +exit: return ret; - } u8 add_ba_hdl(_adapter *padapter, unsigned char *pbuf) @@ -12744,7 +13420,7 @@ u8 add_ba_hdl(_adapter *padapter, unsigned char *pbuf) //pmlmeinfo->ADDBA_retry_count = 0; //pmlmeinfo->candidate_tid_bitmap |= (0x1 << pparm->tid); //psta->htpriv.candidate_tid_bitmap |= BIT(pparm->tid); - issue_action_BA(padapter, pparm->addr, RTW_WLAN_ACTION_ADDBA_REQ, (u16)pparm->tid); + issue_addba_req(padapter, pparm->addr, (u8)pparm->tid); //_set_timer(&pmlmeext->ADDBA_timer, ADDBA_TO); _set_timer(&psta->addba_retry_timer, ADDBA_TO); } @@ -12753,8 +13429,7 @@ u8 add_ba_hdl(_adapter *padapter, unsigned char *pbuf) (psta->htpriv.ht_option==_TRUE) && (psta->htpriv.ampdu_enable==_TRUE) ) { - issue_action_BA(padapter, pparm->addr, RTW_WLAN_ACTION_ADDBA_REQ, (u16)pparm->tid); - //_set_timer(&pmlmeext->ADDBA_timer, ADDBA_TO); + issue_addba_req(padapter, pparm->addr, (u8)pparm->tid); _set_timer(&psta->addba_retry_timer, ADDBA_TO); } #endif //CONFIG @@ -12766,6 +13441,32 @@ u8 add_ba_hdl(_adapter *padapter, unsigned char *pbuf) return H2C_SUCCESS; } + +u8 chk_bmc_sleepq_cmd(_adapter* padapter) +{ + struct cmd_obj *ph2c; + struct cmd_priv *pcmdpriv = &(padapter->cmdpriv); + u8 res = _SUCCESS; + +_func_enter_; + + if ((ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj))) == NULL) + { + res= _FAIL; + goto exit; + } + + init_h2fwcmd_w_parm_no_parm_rsp(ph2c, GEN_CMD_CODE(_ChkBMCSleepq)); + + res = rtw_enqueue_cmd(pcmdpriv, ph2c); + +exit: + +_func_exit_; + + return res; +} + u8 set_tx_beacon_cmd(_adapter* padapter) { struct cmd_obj *ph2c; @@ -12777,13 +13478,13 @@ u8 set_tx_beacon_cmd(_adapter* padapter) int len_diff = 0; _func_enter_; - + if ((ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj))) == NULL) { res= _FAIL; goto exit; } - + if ((ptxBeacon_parm = (struct Tx_Beacon_param *)rtw_zmalloc(sizeof(struct Tx_Beacon_param))) == NULL) { rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj)); @@ -12792,14 +13493,14 @@ _func_enter_; } _rtw_memcpy(&(ptxBeacon_parm->network), &(pmlmeinfo->network), sizeof(WLAN_BSSID_EX)); - + len_diff = update_hidden_ssid( ptxBeacon_parm->network.IEs+_BEACON_IE_OFFSET_ , ptxBeacon_parm->network.IELength-_BEACON_IE_OFFSET_ , pmlmeinfo->hidden_ssid_mode ); ptxBeacon_parm->network.IELength += len_diff; - + init_h2fwcmd_w_parm_no_rsp(ph2c, ptxBeacon_parm, GEN_CMD_CODE(_TX_Beacon)); res = rtw_enqueue_cmd(pcmdpriv, ph2c); @@ -12821,6 +13522,9 @@ u8 mlme_evt_hdl(_adapter *padapter, unsigned char *pbuf) void (*event_callback)(_adapter *dev, u8 *pbuf); struct evt_priv *pevt_priv = &(padapter->evtpriv); + if (pbuf == NULL) + goto _abort_event_; + peventbuf = (uint*)pbuf; evt_sz = (u16)(*peventbuf&0xffff); evt_seq = (u8)((*peventbuf>>24)&0x7f); @@ -12885,87 +13589,87 @@ u8 h2c_msg_hdl(_adapter *padapter, unsigned char *pbuf) return H2C_SUCCESS; } -u8 tx_beacon_hdl(_adapter *padapter, unsigned char *pbuf) +u8 chk_bmc_sleepq_hdl(_adapter *padapter, unsigned char *pbuf) { - if(send_beacon(padapter)==_FAIL) - { - DBG_871X("issue_beacon, fail!\n"); - return H2C_PARAMETERS_ERROR; - } #ifdef CONFIG_AP_MODE - else //tx bc/mc frames after update TIM - { - _irqL irqL; - struct sta_info *psta_bmc; - _list *xmitframe_plist, *xmitframe_phead; - struct xmit_frame *pxmitframe=NULL; - struct xmit_priv *pxmitpriv = &padapter->xmitpriv; - struct sta_priv *pstapriv = &padapter->stapriv; - - //for BC/MC Frames - psta_bmc = rtw_get_bcmc_stainfo(padapter); - if(!psta_bmc) - return H2C_SUCCESS; - - if((pstapriv->tim_bitmap&BIT(0)) && (psta_bmc->sleepq_len>0)) - { + _irqL irqL; + struct sta_info *psta_bmc; + _list *xmitframe_plist, *xmitframe_phead; + struct xmit_frame *pxmitframe=NULL; + struct xmit_priv *pxmitpriv = &padapter->xmitpriv; + struct sta_priv *pstapriv = &padapter->stapriv; + + //for BC/MC Frames + psta_bmc = rtw_get_bcmc_stainfo(padapter); + if(!psta_bmc) + return H2C_SUCCESS; + + if((pstapriv->tim_bitmap&BIT(0)) && (psta_bmc->sleepq_len>0)) + { #ifndef CONFIG_PCI_HCI - rtw_msleep_os(10);// 10ms, ATIM(HIQ) Windows + rtw_msleep_os(10);// 10ms, ATIM(HIQ) Windows #endif - //_enter_critical_bh(&psta_bmc->sleep_q.lock, &irqL); - _enter_critical_bh(&pxmitpriv->lock, &irqL); + //_enter_critical_bh(&psta_bmc->sleep_q.lock, &irqL); + _enter_critical_bh(&pxmitpriv->lock, &irqL); - xmitframe_phead = get_list_head(&psta_bmc->sleep_q); - xmitframe_plist = get_next(xmitframe_phead); + xmitframe_phead = get_list_head(&psta_bmc->sleep_q); + xmitframe_plist = get_next(xmitframe_phead); - while ((rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) == _FALSE) - { - pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list); - - xmitframe_plist = get_next(xmitframe_plist); + while ((rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) == _FALSE) + { + pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list); - rtw_list_delete(&pxmitframe->list); + xmitframe_plist = get_next(xmitframe_plist); - psta_bmc->sleepq_len--; - if(psta_bmc->sleepq_len>0) - pxmitframe->attrib.mdata = 1; - else - pxmitframe->attrib.mdata = 0; + rtw_list_delete(&pxmitframe->list); - pxmitframe->attrib.triggered=1; + psta_bmc->sleepq_len--; + if(psta_bmc->sleepq_len>0) + pxmitframe->attrib.mdata = 1; + else + pxmitframe->attrib.mdata = 0; - pxmitframe->attrib.qsel = 0x11;//HIQ + pxmitframe->attrib.triggered=1; -#if 0 - _exit_critical_bh(&psta_bmc->sleep_q.lock, &irqL); - if(rtw_hal_xmit(padapter, pxmitframe) == _TRUE) - { - rtw_os_xmit_complete(padapter, pxmitframe); - } - _enter_critical_bh(&psta_bmc->sleep_q.lock, &irqL); + if (xmitframe_hiq_filter(pxmitframe) == _TRUE) + pxmitframe->attrib.qsel = QSLT_HIGH;//HIQ -#endif - rtw_hal_xmitframe_enqueue(padapter, pxmitframe); + #if 0 + _exit_critical_bh(&psta_bmc->sleep_q.lock, &irqL); + if(rtw_hal_xmit(padapter, pxmitframe) == _TRUE) + { + rtw_os_xmit_complete(padapter, pxmitframe); + } + _enter_critical_bh(&psta_bmc->sleep_q.lock, &irqL); + #endif + rtw_hal_xmitframe_enqueue(padapter, pxmitframe); + } - //pstapriv->tim_bitmap &= ~BIT(0); - - } - - //_exit_critical_bh(&psta_bmc->sleep_q.lock, &irqL); - _exit_critical_bh(&pxmitpriv->lock, &irqL); + //_exit_critical_bh(&psta_bmc->sleep_q.lock, &irqL); + _exit_critical_bh(&pxmitpriv->lock, &irqL); -//#if defined(CONFIG_PCI_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) -#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) + if (padapter->interface_type != RTW_PCIE) { + /* check hi queue and bmc_sleepq */ rtw_chk_hi_queue_cmd(padapter); + } + } #endif - } + return H2C_SUCCESS; +} +u8 tx_beacon_hdl(_adapter *padapter, unsigned char *pbuf) +{ + if(send_beacon(padapter)==_FAIL) + { + DBG_871X("issue_beacon, fail!\n"); + return H2C_PARAMETERS_ERROR; } -#endif + + /* tx bc/mc frames after update TIM */ + chk_bmc_sleepq_hdl(padapter, NULL); return H2C_SUCCESS; - } void change_band_update_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork) @@ -13893,7 +14597,23 @@ int rtw_chk_start_clnt_join(_adapter *padapter, u8 *ch, u8 *bw, u8 *offset) struct mlme_ext_priv *pbuddy_mlmeext; struct mlme_ext_info *pbuddy_pmlmeinfo; struct mlme_priv *pbuddy_mlmepriv; +#endif + + if (!ch || !bw || !offset) { + connect_allow = _FALSE; + rtw_warn_on(1); + goto exit; + } + + if (cur_ch == 0) { + connect_allow = _FALSE; + DBG_871X_LEVEL(_drv_err_, FUNC_ADPT_FMT" cur_ch:%u\n" + , FUNC_ADPT_ARG(padapter), cur_ch); + rtw_warn_on(1); + goto exit; + } +#ifdef CONFIG_CONCURRENT_MODE if (!rtw_buddy_adapter_up(padapter)) { goto exit; } @@ -14005,6 +14725,7 @@ int rtw_chk_start_clnt_join(_adapter *padapter, u8 *ch, u8 *bw, u8 *offset) connect_allow = chbw_allow; +#ifdef CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT #if defined(CONFIG_P2P) && defined(CONFIG_IOCTL_CFG80211) /* wlan0-sta mode has higher priority than p2p0-p2p client */ if (!rtw_p2p_chk_state(&(pbuddy_adapter->wdinfo), P2P_STATE_NONE) @@ -14013,6 +14734,9 @@ int rtw_chk_start_clnt_join(_adapter *padapter, u8 *ch, u8 *bw, u8 *offset) connect_allow = _TRUE; } #endif /* CONFIG_P2P && CONFIG_IOCTL_CFG80211 */ +#else + connect_allow = _TRUE; +#endif /* CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT */ DBG_871X("start_clnt_join: connect_allow:%d, chbw_allow:%d\n", connect_allow, chbw_allow); if (connect_allow == _TRUE && chbw_allow == _FALSE) { @@ -14023,13 +14747,9 @@ int rtw_chk_start_clnt_join(_adapter *padapter, u8 *ch, u8 *bw, u8 *offset) } } -exit: #endif /* CONFIG_CONCURRENT_MODE */ - if (!ch || !bw || !offset) { - rtw_warn_on(1); - connect_allow = _FALSE; - } +exit: if (connect_allow == _TRUE) { DBG_871X("start_join_set_ch_bw: ch=%d, bwmode=%d, ch_offset=%d\n", cur_ch, cur_bw, cur_ch_offset); @@ -14041,7 +14761,7 @@ int rtw_chk_start_clnt_join(_adapter *padapter, u8 *ch, u8 *bw, u8 *offset) return connect_allow == _TRUE ? _SUCCESS : _FAIL; } -/* Find union about ch, bw, ch_offset of all linked interfaces */ +/* Find union about ch, bw, ch_offset of all linked/linking interfaces */ int rtw_get_ch_setting_union(_adapter *adapter, u8 *ch, u8 *bw, u8 *offset) { struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); @@ -14061,7 +14781,7 @@ int rtw_get_ch_setting_union(_adapter *adapter, u8 *ch, u8 *bw, u8 *offset) iface = dvobj->padapters[i]; mlmeext = &iface->mlmeextpriv; - if (!check_fwstate(&iface->mlmepriv, _FW_LINKED)) + if (!check_fwstate(&iface->mlmepriv, _FW_LINKED|_FW_UNDER_LINKING)) continue; if (num == 0) { @@ -14124,23 +14844,27 @@ u8 set_ch_hdl(_adapter *padapter, u8 *pbuf) u8 set_chplan_hdl(_adapter *padapter, unsigned char *pbuf) { struct SetChannelPlan_param *setChannelPlan_param; - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; + struct mlme_priv *mlme = &padapter->mlmepriv; + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; if(!pbuf) return H2C_PARAMETERS_ERROR; setChannelPlan_param = (struct SetChannelPlan_param *)pbuf; + if(!rtw_is_channel_plan_valid(setChannelPlan_param->channel_plan)) { + return H2C_PARAMETERS_ERROR; + } + + mlme->ChannelPlan = setChannelPlan_param->channel_plan; + pmlmeext->max_chan_nums = init_channel_set(padapter, setChannelPlan_param->channel_plan, pmlmeext->channel_set); init_channel_list(padapter, pmlmeext->channel_set, pmlmeext->max_chan_nums, &pmlmeext->channel_list); + rtw_hal_set_odm_var(padapter,HAL_ODM_REGULATION,NULL,_TRUE); + #ifdef CONFIG_IOCTL_CFG80211 - if ((padapter->rtw_wdev != NULL) && (padapter->rtw_wdev->wiphy)) { - struct regulatory_request request; - request.initiator = NL80211_REGDOM_SET_BY_DRIVER; - rtw_reg_notifier(padapter->rtw_wdev->wiphy, &request); - } + rtw_reg_notify_by_driver(padapter); #endif //CONFIG_IOCTL_CFG80211 return H2C_SUCCESS; @@ -14200,197 +14924,171 @@ u8 set_csa_hdl(_adapter *padapter, unsigned char *pbuf) } -// TDLS_ESTABLISHED : write RCR DATA BIT -// TDLS_CS_OFF : go back to the channel linked with AP, terminating channel switch procedure -// TDLS_INIT_CH_SEN : init channel sensing, receive all data and mgnt frame -// TDLS_DONE_CH_SEN: channel sensing and report candidate channel -// TDLS_OFF_CH : first time set channel to off channel -// TDLS_BASE_CH : go back tp the channel linked with AP when set base channel as target channel -// TDLS_P_OFF_CH : periodically go to off channel -// TDLS_P_BASE_CH : periodically go back to base channel -// TDLS_RS_RCR : restore RCR -// TDLS_TEAR_STA : free tdls sta u8 tdls_hdl(_adapter *padapter, unsigned char *pbuf) { #ifdef CONFIG_TDLS _irqL irqL; struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; +#ifdef CONFIG_TDLS_CH_SW + struct tdls_ch_switch *pchsw_info = &ptdlsinfo->chsw_info; +#endif struct TDLSoption_param *TDLSoption; - struct sta_info *ptdls_sta; + struct sta_info *ptdls_sta = NULL; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; u8 survey_channel, i, min, option; + struct tdls_txmgmt txmgmt; + u32 setchtime, resp_sleep = 0, wait_time; + u8 zaddr[ETH_ALEN] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - if(!pbuf) + if (!pbuf) return H2C_PARAMETERS_ERROR; TDLSoption = (struct TDLSoption_param *)pbuf; - - ptdls_sta = rtw_get_stainfo( &(padapter->stapriv), TDLSoption->addr ); option = TDLSoption->option; - if( ptdls_sta == NULL ) - { - if( option != TDLS_RS_RCR ) + if (!_rtw_memcmp(TDLSoption->addr, zaddr, ETH_ALEN)) { + ptdls_sta = rtw_get_stainfo( &(padapter->stapriv), TDLSoption->addr ); + if (ptdls_sta == NULL) { + return H2C_REJECTED; + } + } else { + if (!(option == TDLS_RS_RCR || option == TDLS_CH_SW_BACK)) return H2C_REJECTED; } //_enter_critical_bh(&(ptdlsinfo->hdl_lock), &irqL); - DBG_871X("[%s] option:%d\n", __FUNCTION__, option); + //DBG_871X("[%s] option:%d\n", __FUNCTION__, option); - switch(option){ - case TDLS_ESTABLISHED: - { - //As long as TDLS handshake success, we should set RCR_CBSSID_DATA bit to 0 - //so we can receive all kinds of data frames. - u8 sta_band = 0; - rtw_hal_set_hwreg(padapter, HW_VAR_TDLS_WRCR, 0); - DBG_871X("Created Direct Link with "MAC_FMT"\n", MAC_ARG(ptdls_sta->hwaddr)); - - pmlmeinfo->FW_sta_info[ptdls_sta->mac_id].psta = ptdls_sta; - //set TDLS sta rate. - //update station supportRate - rtw_hal_update_sta_rate_mask(padapter, ptdls_sta); - if(padapter->mlmeextpriv.cur_channel > 14) { - if (ptdls_sta->ra_mask & 0xffff000) - sta_band |= WIRELESS_11_5N ; - - if (ptdls_sta->ra_mask & 0xff0) - sta_band |= WIRELESS_11A; - - // 5G band - #ifdef CONFIG_80211AC_VHT - if (ptdls_sta->vhtpriv.vht_option) { - sta_band = WIRELESS_11_5AC; - } - #endif - - } else { - if (ptdls_sta->ra_mask & 0xffff000) - sta_band |= WIRELESS_11_24N; + switch (option) { + case TDLS_ESTABLISHED: + { + /* As long as TDLS handshake success, we should set RCR_CBSSID_DATA bit to 0 */ + /* So we can receive all kinds of data frames. */ + u8 sta_band = 0; + + //leave ALL PS when TDLS is established + rtw_pwr_wakeup(padapter); + + rtw_hal_set_hwreg(padapter, HW_VAR_TDLS_WRCR, 0); + DBG_871X("Created Direct Link with "MAC_FMT"\n", MAC_ARG(ptdls_sta->hwaddr)); + + pmlmeinfo->FW_sta_info[ptdls_sta->mac_id].psta = ptdls_sta; + /* Set TDLS sta rate. */ + /* Update station supportRate */ + rtw_hal_update_sta_rate_mask(padapter, ptdls_sta); + if (pmlmeext->cur_channel > 14) { + if (ptdls_sta->ra_mask & 0xffff000) + sta_band |= WIRELESS_11_5N ; + + if (ptdls_sta->ra_mask & 0xff0) + sta_band |= WIRELESS_11A; + + /* 5G band */ + #ifdef CONFIG_80211AC_VHT + if (ptdls_sta->vhtpriv.vht_option) + sta_band = WIRELESS_11_5AC; + #endif + + } else { + if (ptdls_sta->ra_mask & 0xffff000) + sta_band |= WIRELESS_11_24N; - if (ptdls_sta->ra_mask & 0xff0) - sta_band |= WIRELESS_11G; + if (ptdls_sta->ra_mask & 0xff0) + sta_band |= WIRELESS_11G; - if (ptdls_sta->ra_mask & 0x0f) - sta_band |= WIRELESS_11B; - } - ptdls_sta->wireless_mode = sta_band; - ptdls_sta->raid = rtw_hal_networktype_to_raid(padapter,ptdls_sta); - set_sta_rate(padapter, ptdls_sta); - //sta mode - rtw_hal_set_odm_var(padapter,HAL_ODM_STA_INFO,ptdls_sta,_TRUE); - break; + if (ptdls_sta->ra_mask & 0x0f) + sta_band |= WIRELESS_11B; } - case TDLS_SD_PTI: - ptdls_sta->tdls_sta_state |= TDLS_WAIT_PTR_STATE; - issue_tdls_peer_traffic_indication(padapter, ptdls_sta); - _set_timer(&ptdls_sta->pti_timer, TDLS_PTI_TIME); - break; - case TDLS_CS_OFF: - _cancel_timer_ex(&ptdls_sta->base_ch_timer); - _cancel_timer_ex(&ptdls_sta->off_ch_timer); - SelectChannel(padapter, pmlmeext->cur_channel); - ptdls_sta->tdls_sta_state &= ~(TDLS_CH_SWITCH_ON_STATE | - TDLS_PEER_AT_OFF_STATE | - TDLS_AT_OFF_CH_STATE); - DBG_871X("go back to base channel\n "); + ptdls_sta->wireless_mode = sta_band; + ptdls_sta->raid = rtw_hal_networktype_to_raid(padapter,ptdls_sta); + set_sta_rate(padapter, ptdls_sta); + rtw_sta_media_status_rpt(padapter, ptdls_sta, 1); + /* Sta mode */ + rtw_hal_set_odm_var(padapter, HAL_ODM_STA_INFO, ptdls_sta,_TRUE); + break; + } + case TDLS_ISSUE_PTI: + ptdls_sta->tdls_sta_state |= TDLS_WAIT_PTR_STATE; + issue_tdls_peer_traffic_indication(padapter, ptdls_sta); + _set_timer(&ptdls_sta->pti_timer, TDLS_PTI_TIME); + break; +#ifdef CONFIG_TDLS_CH_SW + case TDLS_CH_SW_RESP: + _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); + txmgmt.status_code = 0; + _rtw_memcpy(txmgmt.peer, ptdls_sta->hwaddr, ETH_ALEN); + + issue_nulldata(padapter, NULL, 1, 0, 0); + + DBG_871X("issue tdls channel switch response\n"); + issue_tdls_ch_switch_rsp(padapter, &txmgmt, _FALSE); + resp_sleep = 5; + rtw_msleep_os(resp_sleep); + + /* If we receive TDLS_CH_SW_REQ at off channel which it's target is AP's channel */ + /* then we just SelectChannel to AP's channel*/ + if (padapter->mlmeextpriv.cur_channel == pchsw_info->off_ch_num) { + SelectChannel(padapter, padapter->mlmeextpriv.cur_channel); issue_nulldata(padapter, NULL, 0, 0, 0); + pchsw_info->ch_sw_state &= ~(TDLS_PEER_AT_OFF_STATE); + ATOMIC_SET(&pchsw_info->chsw_on, _FALSE); break; - case TDLS_INIT_CH_SEN: - rtw_hal_set_hwreg(padapter, HW_VAR_TDLS_INIT_CH_SEN, 0); - pmlmeext->sitesurvey_res.channel_idx = 0; - ptdls_sta->option = TDLS_DONE_CH_SEN; - rtw_tdls_cmd(padapter, ptdls_sta->hwaddr, TDLS_DONE_CH_SEN); - break; - case TDLS_DONE_CH_SEN: - survey_channel = pmlmeext->channel_set[pmlmeext->sitesurvey_res.channel_idx].ChannelNum; - if(survey_channel){ - SelectChannel(padapter, survey_channel); - ptdlsinfo->cur_channel = survey_channel; - pmlmeext->sitesurvey_res.channel_idx++; - _set_timer(&ptdls_sta->option_timer, SURVEY_TO); - }else{ - SelectChannel(padapter, pmlmeext->cur_channel); - - rtw_hal_set_hwreg(padapter, HW_VAR_TDLS_DONE_CH_SEN, 0); - - if(ptdlsinfo->ch_sensing==1){ - ptdlsinfo->ch_sensing=0; - ptdlsinfo->cur_channel=1; - min=ptdlsinfo->collect_pkt_num[0]; - for(i=1; i ptdlsinfo->collect_pkt_num[i]){ - ptdlsinfo->cur_channel=i+1; - min=ptdlsinfo->collect_pkt_num[i]; - } - ptdlsinfo->collect_pkt_num[i]=0; - } - ptdlsinfo->collect_pkt_num[0]=0; - ptdlsinfo->candidate_ch=ptdlsinfo->cur_channel; - DBG_871X("TDLS channel sensing done, candidate channel: %02x\n", ptdlsinfo->candidate_ch); - ptdlsinfo->cur_channel=0; + } - } + _set_timer(&ptdls_sta->delay_timer, pmlmeinfo->bcn_interval - 40); - if(ptdls_sta->tdls_sta_state & TDLS_PEER_SLEEP_STATE){ - ptdls_sta->tdls_sta_state |= TDLS_APSD_CHSW_STATE; - }else{ - //send null data with pwrbit==1 before send ch_switching_req to peer STA. - issue_nulldata(padapter, NULL, 1, 0, 0); + /* Continue following actions */ - ptdls_sta->tdls_sta_state |= TDLS_CH_SW_INITIATOR_STATE; + case TDLS_CH_SW: + issue_nulldata(padapter, NULL, 1, 0, 0); + _set_timer(&ptdls_sta->ch_sw_timer, (u32)(ptdls_sta->ch_switch_timeout)/1000); - issue_tdls_ch_switch_req(padapter, ptdls_sta->hwaddr); - DBG_871X("issue tdls ch switch req\n"); - } - } - break; - case TDLS_OFF_CH: - issue_nulldata(padapter, NULL, 1, 0, 0); - SelectChannel(padapter, ptdls_sta->off_ch); - - DBG_871X("change channel to tar ch:%02x\n", ptdls_sta->off_ch); - ptdls_sta->tdls_sta_state |= TDLS_AT_OFF_CH_STATE; - ptdls_sta->tdls_sta_state &= ~(TDLS_PEER_AT_OFF_STATE); - _set_timer(&ptdls_sta->option_timer, (u32)ptdls_sta->ch_switch_time); - break; - case TDLS_BASE_CH: - _cancel_timer_ex(&ptdls_sta->base_ch_timer); - _cancel_timer_ex(&ptdls_sta->off_ch_timer); - SelectChannel(padapter, pmlmeext->cur_channel); - ptdls_sta->tdls_sta_state &= ~(TDLS_CH_SWITCH_ON_STATE | - TDLS_PEER_AT_OFF_STATE | - TDLS_AT_OFF_CH_STATE); - DBG_871X("go back to base channel\n "); - issue_nulldata(padapter, NULL, 0, 0, 0); - _set_timer(&ptdls_sta->option_timer, (u32)ptdls_sta->ch_switch_time); - break; - case TDLS_P_OFF_CH: - SelectChannel(padapter, pmlmeext->cur_channel); + setchtime = rtw_systime_to_ms(rtw_get_current_time()); + SelectChannel(padapter, pchsw_info->off_ch_num); + setchtime = rtw_systime_to_ms(rtw_get_current_time()) - setchtime; + setchtime += resp_sleep; + + if (pmlmeext->cur_channel != rtw_get_oper_ch(padapter)) issue_nulldata(padapter, NULL, 0, 0, 0); - DBG_871X("change channel to base ch:%02x\n", pmlmeext->cur_channel); - ptdls_sta->tdls_sta_state &= ~(TDLS_PEER_AT_OFF_STATE| TDLS_AT_OFF_CH_STATE); - _set_timer(&ptdls_sta->off_ch_timer, TDLS_STAY_TIME); - break; - case TDLS_P_BASE_CH: - issue_nulldata(ptdls_sta->padapter, NULL, 1, 0, 0); - SelectChannel(padapter, ptdls_sta->off_ch); - DBG_871X("change channel to off ch:%02x\n", ptdls_sta->off_ch); - ptdls_sta->tdls_sta_state |= TDLS_AT_OFF_CH_STATE; - if((ptdls_sta->tdls_sta_state & TDLS_PEER_AT_OFF_STATE) != TDLS_PEER_AT_OFF_STATE){ - issue_nulldata_to_TDLS_peer_STA(padapter, ptdls_sta->hwaddr, 0, 3, 300); - } - _set_timer(&ptdls_sta->base_ch_timer, TDLS_STAY_TIME); - break; - case TDLS_RS_RCR: - rtw_hal_set_hwreg(padapter, HW_VAR_TDLS_RS_RCR, 0); - DBG_871X("wirte REG_RCR, set bit6 on\n"); - break; - case TDLS_TEAR_STA: - free_tdls_sta(padapter, ptdls_sta); - break; - + pchsw_info->ch_sw_state &= ~(TDLS_PEER_AT_OFF_STATE); + + if ((u32)ptdls_sta->ch_switch_time/1000 > setchtime) + wait_time = (u32)ptdls_sta->ch_switch_time/1000 - setchtime; + else + wait_time = 0; + + if (wait_time > 0) + rtw_msleep_os(wait_time); + + issue_nulldata_to_TDLS_peer_STA(ptdls_sta->padapter, ptdls_sta->hwaddr, 0, 0, 0); + issue_nulldata_to_TDLS_peer_STA(ptdls_sta->padapter, ptdls_sta->hwaddr, 0, 0, 0); + + break; + case TDLS_CH_SW_BACK: + pchsw_info->ch_sw_state &= ~(TDLS_PEER_AT_OFF_STATE | TDLS_WAIT_CH_RSP_STATE); + ATOMIC_SET(&pchsw_info->chsw_on, _FALSE); + SelectChannel(padapter, padapter->mlmeextpriv.cur_channel); + issue_nulldata(padapter, NULL, 0, 0, 0); + break; +#endif + case TDLS_RS_RCR: + rtw_hal_set_hwreg(padapter, HW_VAR_TDLS_RS_RCR, 0); + DBG_871X("wirte REG_RCR, set bit6 on\n"); + break; + case TDLS_TEAR_STA: +#ifdef CONFIG_TDLS_CH_SW + if (_rtw_memcmp(TDLSoption->addr, pchsw_info->addr, ETH_ALEN) == _TRUE) { + pchsw_info->ch_sw_state &= ~(TDLS_CH_SW_INITIATOR_STATE | + TDLS_CH_SWITCH_ON_STATE | + TDLS_PEER_AT_OFF_STATE); + ATOMIC_SET(&pchsw_info->chsw_on, _FALSE); + _rtw_memset(pchsw_info->addr, 0x00, ETH_ALEN); + } +#endif + rtw_sta_media_status_rpt(padapter, ptdls_sta, 0); + free_tdls_sta(padapter, ptdls_sta); + break; } //_exit_critical_bh(&(ptdlsinfo->hdl_lock), &irqL); @@ -14398,7 +15096,22 @@ u8 tdls_hdl(_adapter *padapter, unsigned char *pbuf) return H2C_SUCCESS; #else return H2C_REJECTED; -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ + +} + +u8 run_in_thread_hdl(_adapter *padapter, u8 *pbuf) +{ + struct RunInThread_param *p; + + if (NULL == pbuf) + return H2C_PARAMETERS_ERROR; + p = (struct RunInThread_param*)pbuf; + + if (p->func) + p->func(p->context); + + return H2C_SUCCESS; } diff --git a/backports/drivers/realtek/rtl8812au/core/rtw_mp.c b/backports/drivers/realtek/rtl8812au/core/rtw_mp.c index 7f78505c22de5f..854891ca1d6110 100755 --- a/backports/drivers/realtek/rtl8812au/core/rtw_mp.c +++ b/backports/drivers/realtek/rtl8812au/core/rtw_mp.c @@ -25,7 +25,7 @@ #include /* for RFHIGHPID */ #endif -#include "../hal/OUTSRC/odm_precomp.h" +#include "../hal/OUTSRC/phydm_precomp.h" #if defined(CONFIG_RTL8723A) || defined(CONFIG_RTL8723B) || defined(CONFIG_RTL8821A) #include #endif @@ -139,12 +139,19 @@ static void _init_mp_priv_(struct mp_priv *pmp_priv) pmp_priv->network_macaddr[5] = 0x55; pmp_priv->bSetRxBssid = _FALSE; + pmp_priv->bRTWSmbCfg = _FALSE; pnetwork = &pmp_priv->mp_network.network; _rtw_memcpy(pnetwork->MacAddress, pmp_priv->network_macaddr, ETH_ALEN); pnetwork->Ssid.SsidLength = 8; _rtw_memcpy(pnetwork->Ssid.Ssid, "mp_871x", pnetwork->Ssid.SsidLength); + + pmp_priv->tx.payload = 2; +#ifdef CONFIG_80211N_HT + pmp_priv->tx.attrib.ht_en = 1; +#endif + } #ifdef PLATFORM_WINDOWS @@ -280,6 +287,9 @@ static void mp_init_xmit_attrib(struct mp_tx *pmptx, PADAPTER padapter) pattrib->encrypt = 0; pattrib->bswenc = _FALSE; pattrib->qos_en = _FALSE; + + pattrib->pktlen = 1000; + } s32 init_mp_priv(PADAPTER padapter) @@ -292,7 +302,7 @@ s32 init_mp_priv(PADAPTER padapter) pmppriv->tx.stop = 1; pmppriv->bSetTxPower=0; //for manually set tx power pmppriv->bTxBufCkFail=_FALSE; - pmppriv->pktInterval=1; + pmppriv->pktInterval=0; mp_init_xmit_attrib(&pmppriv->tx, padapter); @@ -423,7 +433,7 @@ void mpt_InitHWConfig(PADAPTER Adapter) #define PHY_IQCalibrate(_Adapter, b) \ IS_HARDWARE_TYPE_8812(_Adapter) ? PHY_IQCalibrate_8812A(_Adapter, b) : \ - IS_HARDWARE_TYPE_8821(_Adapter) ? PHY_IQCalibrate_8821A(_Adapter, b) : \ + IS_HARDWARE_TYPE_8821(_Adapter) ? PHY_IQCalibrate_8821A(&(GET_HAL_DATA(_Adapter)->odmpriv), b) : \ PHY_IQCalibrate_default(_Adapter, b) #define PHY_LCCalibrate(_Adapter) \ @@ -443,7 +453,19 @@ void mpt_InitHWConfig(PADAPTER Adapter) #endif //CONFIG_RTL8812A_8821A #ifdef CONFIG_RTL8723B -#define PHY_IQCalibrate(a,b) PHY_IQCalibrate_8723B(a,b) +static void PHY_IQCalibrate(PADAPTER padapter, u8 bReCovery) +{ + PHAL_DATA_TYPE pHalData; + u8 b2ant; //false:1ant, true:2-ant + u8 RF_Path; //0:S1, 1:S0 + + pHalData = GET_HAL_DATA(padapter); + b2ant = pHalData->EEPROMBluetoothAntNum==Ant_x2?_TRUE:_FALSE; + + PHY_IQCalibrate_8723B(padapter, bReCovery, _FALSE, b2ant, pHalData->ant_path); +} + + #define PHY_LCCalibrate(a) PHY_LCCalibrate_8723B(&(GET_HAL_DATA(a)->odmpriv)) #define PHY_SetRFPathSwitch(a,b) PHY_SetRFPathSwitch_8723B(a,b) #endif @@ -534,7 +556,7 @@ MPT_InitializeAdapter( PHY_LCCalibrate(pAdapter); PHY_IQCalibrate(pAdapter, _FALSE); - dm_CheckTXPowerTracking(&pHalData->odmpriv); //trigger thermal meter + //dm_CheckTXPowerTracking(&pHalData->odmpriv); //trigger thermal meter PHY_SetRFPathSwitch(pAdapter, 1/*pHalData->bDefaultAntenna*/); //default use Main @@ -544,15 +566,14 @@ MPT_InitializeAdapter( #ifdef CONFIG_RTL8188E pMptCtx->backup0x52_RF_A = (u1Byte)PHY_QueryRFReg(pAdapter, RF_PATH_A, RF_0x52, 0x000F0); pMptCtx->backup0x52_RF_B = (u1Byte)PHY_QueryRFReg(pAdapter, RF_PATH_A, RF_0x52, 0x000F0); + rtw_write32(pAdapter, REG_MACID_NO_LINK_0, 0x0); + rtw_write32(pAdapter, REG_MACID_NO_LINK_1, 0x0); #endif //set ant to wifi side in mp mode rtw_write16(pAdapter, 0x870, 0x300); rtw_write16(pAdapter, 0x860, 0x110); - if (pAdapter->registrypriv.mp_mode == 1) - pmlmepriv->fw_state = WIFI_MP_STATE; - return rtStatus; } @@ -663,9 +684,9 @@ static void disable_dm(PADAPTER padapter) #endif Switch_DM_Func(padapter, DYNAMIC_RF_CALIBRATION, _TRUE); -#ifdef CONFIG_BT_COEXIST - rtw_btcoex_Switch(padapter, 0); -#endif +//#ifdef CONFIG_BT_COEXIST +// rtw_btcoex_Switch(padapter, 0); //remove for BT MP Down. +//#endif } @@ -675,7 +696,6 @@ void MPT_PwrCtlDM(PADAPTER padapter, u32 bstart) struct dm_priv *pdmpriv = &pHalData->dmpriv; PDM_ODM_T pDM_Odm = &pHalData->odmpriv; - //Switch_DM_Func(padapter, DYNAMIC_RF_CALIBRATION, bstart); if (bstart==1){ DBG_871X("in MPT_PwrCtlDM start \n"); Switch_DM_Func(padapter, DYNAMIC_RF_TX_PWR_TRACK, _TRUE); @@ -684,6 +704,7 @@ void MPT_PwrCtlDM(PADAPTER padapter, u32 bstart) pdmpriv->TxPowerTrackControl = _TRUE; pDM_Odm->RFCalibrateInfo.TxPowerTrackControl = _TRUE; padapter->mppriv.mp_dm =1; + }else{ DBG_871X("in MPT_PwrCtlDM stop \n"); disable_dm(padapter); @@ -691,6 +712,17 @@ void MPT_PwrCtlDM(PADAPTER padapter, u32 bstart) pdmpriv->TxPowerTrackControl = _FALSE; pDM_Odm->RFCalibrateInfo.TxPowerTrackControl = _FALSE; padapter->mppriv.mp_dm = 0; + { + TXPWRTRACK_CFG c; + u1Byte chnl =0 ; + _rtw_memset(&c, 0, sizeof(TXPWRTRACK_CFG)); + ConfigureTxpowerTrack(pDM_Odm, &c); + ODM_ClearTxPowerTrackingState(pDM_Odm); + if (*c.ODM_TxPwrTrackSetPwr) { + (*c.ODM_TxPwrTrackSetPwr)(pDM_Odm, BBSWING, ODM_RF_PATH_A, chnl); + (*c.ODM_TxPwrTrackSetPwr)(pDM_Odm, BBSWING, ODM_RF_PATH_B, chnl); + } + } } } @@ -708,7 +740,14 @@ u32 mp_join(PADAPTER padapter,u8 mode) struct mp_priv *pmppriv = &padapter->mppriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wlan_network *tgt_network = &pmlmepriv->cur_network; - + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX*)(&(pmlmeinfo->network)); + +#ifdef CONFIG_IOCTL_CFG80211 + struct wireless_dev *pwdev = padapter->rtw_wdev; + pwdev->iftype = NL80211_IFTYPE_ADHOC; +#endif //#ifdef CONFIG_IOCTL_CFG80211 // 1. initialize a new WLAN_BSSID_EX _rtw_memset(&bssid, 0, sizeof(WLAN_BSSID_EX)); DBG_8192C("%s ,pmppriv->network_macaddr=%x %x %x %x %x %x \n",__func__, @@ -721,6 +760,7 @@ u32 mp_join(PADAPTER padapter,u8 mode) bssid.InfrastructureMode = Ndis802_11IBSS; bssid.NetworkTypeInUse = Ndis802_11DS; bssid.IELength = 0; + bssid.Configuration.DSConfig=pmppriv->channel; }else if(mode==WIFI_FW_STATION_STATE){ bssid.Ssid.SsidLength = strlen("mp_pseudo_STATION"); @@ -730,7 +770,6 @@ u32 mp_join(PADAPTER padapter,u8 mode) bssid.IELength = 0; } - length = get_WLAN_BSSID_EX_sz(&bssid); if (length % 4) bssid.Length = ((length >> 2) + 1) << 2; //round up to multiple of 4 bytes. @@ -739,32 +778,20 @@ u32 mp_join(PADAPTER padapter,u8 mode) _enter_critical_bh(&pmlmepriv->lock, &irqL); - //if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == _TRUE) - // goto end_of_mp_start_test; -#if 0 + if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == _TRUE) + goto end_of_mp_start_test; + //init mp_start_test status if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) { - rtw_disassoc_cmd(padapter, 0, _TRUE); + rtw_disassoc_cmd(padapter, 500, _TRUE); rtw_indicate_disconnect(padapter); rtw_free_assoc_resources(padapter, 1); } - rtw_msleep_os(500); - pmppriv->prev_fw_state = get_fwstate(pmlmepriv); - if (padapter->registrypriv.mp_mode == 1) - pmlmepriv->fw_state = WIFI_MP_STATE; + pmlmepriv->fw_state = WIFI_MP_STATE; - if (pmppriv->mode == _LOOPBOOK_MODE_) { - set_fwstate(pmlmepriv, WIFI_MP_LPBK_STATE); //append txdesc - RT_TRACE(_module_mp_, _drv_notice_, ("+start mp in Lookback mode\n")); - } else { - RT_TRACE(_module_mp_, _drv_notice_, ("+start mp in normal mode\n")); - } -#endif set_fwstate(pmlmepriv, _FW_UNDER_LINKING); - set_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE); - #if 1 //3 2. create a new psta for mp driver //clear psta in the cur_network, if any psta = rtw_get_stainfo(&padapter->stapriv, tgt_network->network.MacAddress); @@ -777,39 +804,50 @@ u32 mp_join(PADAPTER padapter,u8 mode) res = _FAIL; goto end_of_mp_start_test; } - #endif + set_fwstate(pmlmepriv,WIFI_ADHOC_MASTER_STATE); //3 3. join psudo AdHoc tgt_network->join_res = 1; tgt_network->aid = psta->aid = 1; - _rtw_memcpy(&tgt_network->network, &bssid, length); + _rtw_memcpy(&padapter->registrypriv.dev_network, &bssid, length); + rtw_update_registrypriv_dev_network(padapter); + _rtw_memcpy(&tgt_network->network,&padapter->registrypriv.dev_network, padapter->registrypriv.dev_network.Length); + _rtw_memcpy(pnetwork,&padapter->registrypriv.dev_network, padapter->registrypriv.dev_network.Length); + + if(rtw_createbss_cmd(padapter)!=_SUCCESS) + { + DBG_871X("mp_join: rtw_createbss_cmd status FAIL*** \n "); + res = _FALSE; + return res; + } rtw_indicate_connect(padapter); _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); + set_fwstate(pmlmepriv,_FW_LINKED); end_of_mp_start_test: _exit_critical_bh(&pmlmepriv->lock, &irqL); - if(1) //(res == _SUCCESS) + if(1) //(res == _SUCCESS) { // set MSR to WIFI_FW_ADHOC_STATE - if( mode==WIFI_FW_ADHOC_STATE ){ + if( mode==WIFI_FW_ADHOC_STATE ){ - val8 = rtw_read8(padapter, MSR) & 0xFC; // 0x0102 - val8 |= WIFI_FW_ADHOC_STATE; - rtw_write8(padapter, MSR, val8); // Link in ad hoc network - } - else { - Set_MSR(padapter, WIFI_FW_STATION_STATE); + val8 = rtw_read8(padapter, MSR) & 0xFC; // 0x0102 + val8 |= WIFI_FW_ADHOC_STATE; + rtw_write8(padapter, MSR, val8); // Link in ad hoc network + } + else { + Set_MSR(padapter, WIFI_FW_STATION_STATE); - DBG_8192C("%s , pmppriv->network_macaddr =%x %x %x %x %x %x\n",__func__, - pmppriv->network_macaddr[0],pmppriv->network_macaddr[1],pmppriv->network_macaddr[2],pmppriv->network_macaddr[3],pmppriv->network_macaddr[4],pmppriv->network_macaddr[5]); + DBG_8192C("%s , pmppriv->network_macaddr =%x %x %x %x %x %x\n",__func__, + pmppriv->network_macaddr[0],pmppriv->network_macaddr[1],pmppriv->network_macaddr[2],pmppriv->network_macaddr[3],pmppriv->network_macaddr[4],pmppriv->network_macaddr[5]); - rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, pmppriv->network_macaddr); - } + rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, pmppriv->network_macaddr); } - pmlmepriv->fw_state = WIFI_MP_STATE; - return res; + } + + return res; } //This function initializes the DUT to the MP test mode s32 mp_start_test(PADAPTER padapter) @@ -1061,7 +1099,7 @@ int SetTxPower(PADAPTER pAdapter) } TxPower[ODM_RF_PATH_A] = (u1Byte)(u1TxPower&0xff); - TxPower[ODM_RF_PATH_B] = (u1Byte)((u1TxPower&0xff00)>>8); + TxPower[ODM_RF_PATH_B] = (u1Byte)(u1TxPower&0xff); DBG_871X("TxPower(A, B) = (0x%x, 0x%x)\n", TxPower[ODM_RF_PATH_A], TxPower[ODM_RF_PATH_B]); for(rf=0; rf<2; rf++) @@ -1247,16 +1285,16 @@ static thread_return mp_xmit_packet_thread(thread_context context) goto exit; } else { - rtw_msleep_os(1); + rtw_usleep_os(10); continue; } } _rtw_memcpy((u8 *)(pxmitframe->buf_addr+TXDESC_OFFSET), pmptx->buf, pmptx->write_size); _rtw_memcpy(&(pxmitframe->attrib), &(pmptx->attrib), sizeof(struct pkt_attrib)); + + rtw_usleep_os(padapter->mppriv.pktInterval); dump_mpframe(padapter, pxmitframe); - - rtw_udelay_os(padapter->mppriv.pktInterval); pmptx->sended++; pmp_priv->tx_pktcount++; @@ -1336,7 +1374,7 @@ void fill_tx_desc_8188e(PADAPTER padapter) u32 pkt_size = pattrib->last_txcmdsz; s32 bmcast = IS_MCAST(pattrib->ra); // offset 0 -#if !defined(CONFIG_RTL8188E_SDIO) +#if !defined(CONFIG_RTL8188E_SDIO) && !defined(CONFIG_PCI_HCI) desc->txdw0 |= cpu_to_le32(OWN | FSG | LSG); desc->txdw0 |= cpu_to_le32(pkt_size & 0x0000FFFF); // packet size desc->txdw0 |= cpu_to_le32(((TXDESC_SIZE + OFFSET_SZ) << OFFSET_SHT) & 0x00FF0000); //32 bytes for TX Desc @@ -1418,7 +1456,7 @@ void fill_tx_desc_8812a(PADAPTER padapter) SET_TX_DESC_SEQ_8812(pDesc, pattrib->seqnum); } - if ((pmp_priv->bandwidth >= 0) && (pmp_priv->bandwidth <= CHANNEL_WIDTH_160)) { + if (pmp_priv->bandwidth <= CHANNEL_WIDTH_160) { SET_TX_DESC_DATA_BW_8812(pDesc, pmp_priv->bandwidth); } else { DBG_871X("%s:Err: unknown bandwidth %d, use 20M\n", __func__,pmp_priv->bandwidth); @@ -1448,7 +1486,16 @@ void fill_tx_desc_8192e(PADAPTER padapter) offset = TXDESC_SIZE + OFFSET_SZ; SET_TX_DESC_OFFSET_92E(pDesc, offset); - SET_TX_DESC_PKT_OFFSET_92E(pDesc, 1); + + #if defined(CONFIG_PCI_HCI) //8192EE + SET_TX_DESC_OFFSET_92E(pDesc, offset+8); //work around + SET_TX_DESC_PKT_OFFSET_92E(pDesc, 0); /* 8192EE pkt_offset is 0 */ + #elif defined(CONFIG_SDIO_HCI) + SET_TX_DESC_OFFSET_92E(pDesc, offset); + #else //8192EU + SET_TX_DESC_OFFSET_92E(pDesc, offset); + SET_TX_DESC_PKT_OFFSET_92E(pDesc, 1); + #endif if (bmcast) { SET_TX_DESC_BMC_92E(pDesc, 1); @@ -1462,12 +1509,13 @@ void fill_tx_desc_8192e(PADAPTER padapter) //SET_TX_DESC_QUEUE_SEL_8812(pDesc, QSLT_MGNT); if (!pattrib->qos_en) { - SET_TX_DESC_HWSEQ_SEL_92E(pDesc, 1); // Hw set sequence number + SET_TX_DESC_EN_HWSEQ_92E(pDesc, 1);// Hw set sequence number + SET_TX_DESC_HWSEQ_SEL_92E(pDesc, pattrib->hw_ssn_sel); } else { SET_TX_DESC_SEQ_92E(pDesc, pattrib->seqnum); } - if ((pmp_priv->bandwidth >= CHANNEL_WIDTH_20) && (pmp_priv->bandwidth <= CHANNEL_WIDTH_40)) { + if ((pmp_priv->bandwidth == CHANNEL_WIDTH_20) || (pmp_priv->bandwidth == CHANNEL_WIDTH_40)) { SET_TX_DESC_DATA_BW_92E(pDesc, pmp_priv->bandwidth); } else { DBG_871X("%s:Err: unknown bandwidth %d, use 20M\n", __func__,pmp_priv->bandwidth); @@ -1486,37 +1534,51 @@ void fill_tx_desc_8192e(PADAPTER padapter) #if defined(CONFIG_RTL8723B) void fill_tx_desc_8723b(PADAPTER padapter) { - struct mp_priv *pmp_priv = &padapter->mppriv; struct pkt_attrib *pattrib = &(pmp_priv->tx.attrib); - PTXDESC_8723B ptxdesc = (PTXDESC_8723B)&(pmp_priv->tx.desc); - u8 descRate; - - ptxdesc->bk = 1; - ptxdesc->macid = pattrib->mac_id; - ptxdesc->qsel = pattrib->qsel; + u8 *ptxdesc = pmp_priv->tx.desc; - ptxdesc->rate_id = pattrib->raid; - ptxdesc->seq = pattrib->seqnum; - ptxdesc->en_hwseq = 1; - ptxdesc->userate = 1; - ptxdesc->disdatafb = 1; + SET_TX_DESC_AGG_BREAK_8723B(ptxdesc, 1); + SET_TX_DESC_MACID_8723B(ptxdesc, pattrib->mac_id); + SET_TX_DESC_QUEUE_SEL_8723B(ptxdesc, pattrib->qsel); - if( pmp_priv->preamble ){ - if (pmp_priv->rateidx <= MPT_RATE_54M) - ptxdesc->data_short = 1; - } - if (pmp_priv->bandwidth == CHANNEL_WIDTH_40) - ptxdesc->data_bw = 1; + SET_TX_DESC_RATE_ID_8723B(ptxdesc, pattrib->raid); + SET_TX_DESC_SEQ_8723B(ptxdesc, pattrib->seqnum); + SET_TX_DESC_HWSEQ_EN_8723B(ptxdesc, 1); + SET_TX_DESC_USE_RATE_8723B(ptxdesc, 1); + SET_TX_DESC_DISABLE_FB_8723B(ptxdesc, 1); - ptxdesc->datarate = pmp_priv->rateidx; + if (pmp_priv->preamble) + if (pmp_priv->rateidx <= MPT_RATE_54M) { + SET_TX_DESC_DATA_SHORT_8723B(ptxdesc, 1); + } + + if (pmp_priv->bandwidth == CHANNEL_WIDTH_40) { + SET_TX_DESC_DATA_BW_8723B(ptxdesc, 1); + } - ptxdesc->data_ratefb_lmt = 0x1F; - ptxdesc->rts_ratefb_lmt = 0xF; + SET_TX_DESC_TX_RATE_8723B(ptxdesc, pmp_priv->rateidx); + SET_TX_DESC_DATA_RATE_FB_LIMIT_8723B(ptxdesc, 0x1F); + SET_TX_DESC_RTS_RATE_FB_LIMIT_8723B(ptxdesc, 0xF); } #endif +static void Rtw_MPSetMacTxEDCA(PADAPTER padapter) +{ + + rtw_write32(padapter, 0x508 , 0x00a422); //Disable EDCA BE Txop for MP pkt tx adjust Packet interval + //DBG_871X("%s:write 0x508~~~~~~ 0x%x\n", __func__,rtw_read32(padapter, 0x508)); + PHY_SetMacReg(padapter, 0x458 ,bMaskDWord , 0x0); + //DBG_8192C("%s()!!!!! 0x460 = 0x%x\n" ,__func__,PHY_QueryBBReg(padapter, 0x460, bMaskDWord)); + PHY_SetMacReg(padapter, 0x460 ,bMaskLWord , 0x0);//fast EDCA queue packet interval & time out vaule + //PHY_SetMacReg(padapter, ODM_EDCA_VO_PARAM ,bMaskLWord , 0x431C); + //PHY_SetMacReg(padapter, ODM_EDCA_BE_PARAM ,bMaskLWord , 0x431C); + //PHY_SetMacReg(padapter, ODM_EDCA_BK_PARAM ,bMaskLWord , 0x431C); + DBG_8192C("%s()!!!!! 0x460 = 0x%x\n" ,__func__,PHY_QueryBBReg(padapter, 0x460, bMaskDWord)); + +} + void SetPacketTx(PADAPTER padapter) { u8 *ptr, *pkt_start, *pkt_end,*fctrl; @@ -1629,16 +1691,18 @@ void SetPacketTx(PADAPTER padapter) if(pmp_priv->TXradomBuffer == NULL) { DBG_871X("mp create random buffer fail!\n"); + goto exit; } - else - { - for(i=0;i<4096;i++) - pmp_priv->TXradomBuffer[i] = rtw_random32() %0xFF; - } + + + for(i=0;i<4096;i++) + pmp_priv->TXradomBuffer[i] = rtw_random32() %0xFF; + //startPlace = (u32)(rtw_random32() % 3450); _rtw_memcpy(ptr, pmp_priv->TXradomBuffer,pkt_end - ptr); //_rtw_memset(ptr, payload, pkt_end - ptr); rtw_mfree(pmp_priv->TXradomBuffer,4096); + //3 6. start thread #ifdef PLATFORM_LINUX pmp_priv->tx.PktTxThread = kthread_run(mp_xmit_packet_thread, pmp_priv, "RTW_MP_THREAD"); @@ -1656,6 +1720,10 @@ void SetPacketTx(PADAPTER padapter) DBG_871X("Create PktTx Thread Fail !!!!!\n"); } #endif + + Rtw_MPSetMacTxEDCA(padapter); +exit: + return; } void SetPacketRx(PADAPTER pAdapter, u8 bStartRx) @@ -1756,7 +1824,7 @@ static u32 rtw_GetPSDData(PADAPTER pAdapter, u32 point) { u32 psd_val=0; -#if defined(CONFIG_RTL8812A) //MP PSD for 8812A +#if defined(CONFIG_RTL8812A)||defined(CONFIG_RTL8821A) //MP PSD for 8812A u16 psd_reg = 0x910; u16 psd_regL= 0xF44; @@ -1817,8 +1885,8 @@ u32 mp_query_psd(PADAPTER pAdapter, u8 *data) } else { sscanf(data, "pts=%d,start=%d,stop=%d", &psd_pts, &psd_start, &psd_stop); } - - _rtw_memset(data, '\0', sizeof(data)); + + data[0]='\0'; i = psd_start; while (i < psd_stop) @@ -1842,7 +1910,7 @@ u32 mp_query_psd(PADAPTER pAdapter, u8 *data) } - +#if 0 void _rtw_mp_xmit_priv (struct xmit_priv *pxmitpriv) { int i,res; @@ -1909,7 +1977,7 @@ void _rtw_mp_xmit_priv (struct xmit_priv *pxmitpriv) pxmitbuf->padapter = padapter; pxmitbuf->buf_tag = XMITBUF_MGNT; - if((res=rtw_os_xmit_resource_alloc(padapter, pxmitbuf,max_xmit_extbuf_size + XMITBUF_ALIGN_SZ, _FALSE)) == _FAIL) { + if((res=rtw_os_xmit_resource_alloc(padapter, pxmitbuf,max_xmit_extbuf_size + XMITBUF_ALIGN_SZ, _TRUE)) == _FAIL) { res= _FAIL; goto exit; } @@ -1934,7 +2002,7 @@ void _rtw_mp_xmit_priv (struct xmit_priv *pxmitpriv) exit: ; } - +#endif ULONG getPowerDiffByRate8188E( @@ -2156,8 +2224,7 @@ mpt_ProQueryCalTxPower_8188E( CurrChannel = 1; } - if( pMptCtx->MptRateIndex >= MPT_RATE_1M && - pMptCtx->MptRateIndex <= MPT_RATE_11M ) + if(pMptCtx->MptRateIndex <= MPT_RATE_11M ) { TxPower = pHalData->Index24G_CCK_Base[rf_path][index]; } @@ -2201,8 +2268,7 @@ mpt_ProQueryCalTxPower_8188E( #endif // 2012/11/02 Awk: add power limit mechansim - if( pMptCtx->MptRateIndex >= MPT_RATE_1M && - pMptCtx->MptRateIndex <= MPT_RATE_11M ) + if( pMptCtx->MptRateIndex <= MPT_RATE_11M ) { rate = MGN_1M; } @@ -2233,72 +2299,141 @@ mpt_ProQueryCalTxPower_8188E( return TxPower; } -u8 MptToMgntRate(u32 MptRateIdx) + +u8 +MptToMgntRate( + IN ULONG MptRateIdx + ) { // Mapped to MGN_XXX defined in MgntGen.h switch (MptRateIdx) { /* CCK rate. */ - case MPT_RATE_1M: return 2; - case MPT_RATE_2M: return 4; - case MPT_RATE_55M: return 11; - case MPT_RATE_11M: return 22; - - /* OFDM rate. */ - case MPT_RATE_6M: return 12; - case MPT_RATE_9M: return 18; - case MPT_RATE_12M: return 24; - case MPT_RATE_18M: return 36; - case MPT_RATE_24M: return 48; - case MPT_RATE_36M: return 72; - case MPT_RATE_48M: return 96; - case MPT_RATE_54M: return 108; - - /* HT rate. */ - case MPT_RATE_MCS0: return 0x80; - case MPT_RATE_MCS1: return 0x81; - case MPT_RATE_MCS2: return 0x82; - case MPT_RATE_MCS3: return 0x83; - case MPT_RATE_MCS4: return 0x84; - case MPT_RATE_MCS5: return 0x85; - case MPT_RATE_MCS6: return 0x86; - case MPT_RATE_MCS7: return 0x87; - case MPT_RATE_MCS8: return 0x88; - case MPT_RATE_MCS9: return 0x89; - case MPT_RATE_MCS10: return 0x8A; - case MPT_RATE_MCS11: return 0x8B; - case MPT_RATE_MCS12: return 0x8C; - case MPT_RATE_MCS13: return 0x8D; - case MPT_RATE_MCS14: return 0x8E; - case MPT_RATE_MCS15: return 0x8F; - - /* VHT rate. */ - case MPT_RATE_VHT1SS_MCS0: return 0x90; - case MPT_RATE_VHT1SS_MCS1: return 0x91; - case MPT_RATE_VHT1SS_MCS2: return 0x92; - case MPT_RATE_VHT1SS_MCS3: return 0x93; - case MPT_RATE_VHT1SS_MCS4: return 0x94; - case MPT_RATE_VHT1SS_MCS5: return 0x95; - case MPT_RATE_VHT1SS_MCS6: return 0x96; - case MPT_RATE_VHT1SS_MCS7: return 0x97; - case MPT_RATE_VHT1SS_MCS8: return 0x98; - case MPT_RATE_VHT1SS_MCS9: return 0x99; - case MPT_RATE_VHT2SS_MCS0: return 0x9A; - case MPT_RATE_VHT2SS_MCS1: return 0x9B; - case MPT_RATE_VHT2SS_MCS2: return 0x9C; - case MPT_RATE_VHT2SS_MCS3: return 0x9D; - case MPT_RATE_VHT2SS_MCS4: return 0x9E; - case MPT_RATE_VHT2SS_MCS5: return 0x9F; - case MPT_RATE_VHT2SS_MCS6: return 0xA0; - case MPT_RATE_VHT2SS_MCS7: return 0xA1; - case MPT_RATE_VHT2SS_MCS8: return 0xA2; - case MPT_RATE_VHT2SS_MCS9: return 0xA3; + case MPT_RATE_1M: return MGN_1M; + case MPT_RATE_2M: return MGN_2M; + case MPT_RATE_55M: return MGN_5_5M; + case MPT_RATE_11M: return MGN_11M; + + /* OFDM rate. */ + case MPT_RATE_6M: return MGN_6M; + case MPT_RATE_9M: return MGN_9M; + case MPT_RATE_12M: return MGN_12M; + case MPT_RATE_18M: return MGN_18M; + case MPT_RATE_24M: return MGN_24M; + case MPT_RATE_36M: return MGN_36M; + case MPT_RATE_48M: return MGN_48M; + case MPT_RATE_54M: return MGN_54M; + + /* HT rate. */ + case MPT_RATE_MCS0: return MGN_MCS0; + case MPT_RATE_MCS1: return MGN_MCS1; + case MPT_RATE_MCS2: return MGN_MCS2; + case MPT_RATE_MCS3: return MGN_MCS3; + case MPT_RATE_MCS4: return MGN_MCS4; + case MPT_RATE_MCS5: return MGN_MCS5; + case MPT_RATE_MCS6: return MGN_MCS6; + case MPT_RATE_MCS7: return MGN_MCS7; + case MPT_RATE_MCS8: return MGN_MCS8; + case MPT_RATE_MCS9: return MGN_MCS9; + case MPT_RATE_MCS10: return MGN_MCS10; + case MPT_RATE_MCS11: return MGN_MCS11; + case MPT_RATE_MCS12: return MGN_MCS12; + case MPT_RATE_MCS13: return MGN_MCS13; + case MPT_RATE_MCS14: return MGN_MCS14; + case MPT_RATE_MCS15: return MGN_MCS15; + case MPT_RATE_MCS16: return MGN_MCS16; + case MPT_RATE_MCS17: return MGN_MCS17; + case MPT_RATE_MCS18: return MGN_MCS18; + case MPT_RATE_MCS19: return MGN_MCS19; + case MPT_RATE_MCS20: return MGN_MCS20; + case MPT_RATE_MCS21: return MGN_MCS21; + case MPT_RATE_MCS22: return MGN_MCS22; + case MPT_RATE_MCS23: return MGN_MCS23; + case MPT_RATE_MCS24: return MGN_MCS24; + case MPT_RATE_MCS25: return MGN_MCS25; + case MPT_RATE_MCS26: return MGN_MCS26; + case MPT_RATE_MCS27: return MGN_MCS27; + case MPT_RATE_MCS28: return MGN_MCS28; + case MPT_RATE_MCS29: return MGN_MCS29; + case MPT_RATE_MCS30: return MGN_MCS30; + case MPT_RATE_MCS31: return MGN_MCS31; + + /* VHT rate. */ + case MPT_RATE_VHT1SS_MCS0: return MGN_VHT1SS_MCS0; + case MPT_RATE_VHT1SS_MCS1: return MGN_VHT1SS_MCS1; + case MPT_RATE_VHT1SS_MCS2: return MGN_VHT1SS_MCS2; + case MPT_RATE_VHT1SS_MCS3: return MGN_VHT1SS_MCS3; + case MPT_RATE_VHT1SS_MCS4: return MGN_VHT1SS_MCS4; + case MPT_RATE_VHT1SS_MCS5: return MGN_VHT1SS_MCS5; + case MPT_RATE_VHT1SS_MCS6: return MGN_VHT1SS_MCS6; + case MPT_RATE_VHT1SS_MCS7: return MGN_VHT1SS_MCS7; + case MPT_RATE_VHT1SS_MCS8: return MGN_VHT1SS_MCS8; + case MPT_RATE_VHT1SS_MCS9: return MGN_VHT1SS_MCS9; + case MPT_RATE_VHT2SS_MCS0: return MGN_VHT2SS_MCS0; + case MPT_RATE_VHT2SS_MCS1: return MGN_VHT2SS_MCS1; + case MPT_RATE_VHT2SS_MCS2: return MGN_VHT2SS_MCS2; + case MPT_RATE_VHT2SS_MCS3: return MGN_VHT2SS_MCS3; + case MPT_RATE_VHT2SS_MCS4: return MGN_VHT2SS_MCS4; + case MPT_RATE_VHT2SS_MCS5: return MGN_VHT2SS_MCS5; + case MPT_RATE_VHT2SS_MCS6: return MGN_VHT2SS_MCS6; + case MPT_RATE_VHT2SS_MCS7: return MGN_VHT2SS_MCS7; + case MPT_RATE_VHT2SS_MCS8: return MGN_VHT2SS_MCS8; + case MPT_RATE_VHT2SS_MCS9: return MGN_VHT2SS_MCS9; + case MPT_RATE_VHT3SS_MCS0: return MGN_VHT3SS_MCS0; + case MPT_RATE_VHT3SS_MCS1: return MGN_VHT3SS_MCS1; + case MPT_RATE_VHT3SS_MCS2: return MGN_VHT3SS_MCS2; + case MPT_RATE_VHT3SS_MCS3: return MGN_VHT3SS_MCS3; + case MPT_RATE_VHT3SS_MCS4: return MGN_VHT3SS_MCS4; + case MPT_RATE_VHT3SS_MCS5: return MGN_VHT3SS_MCS5; + case MPT_RATE_VHT3SS_MCS6: return MGN_VHT3SS_MCS6; + case MPT_RATE_VHT3SS_MCS7: return MGN_VHT3SS_MCS7; + case MPT_RATE_VHT3SS_MCS8: return MGN_VHT3SS_MCS8; + case MPT_RATE_VHT3SS_MCS9: return MGN_VHT3SS_MCS9; + case MPT_RATE_VHT4SS_MCS0: return MGN_VHT4SS_MCS0; + case MPT_RATE_VHT4SS_MCS1: return MGN_VHT4SS_MCS1; + case MPT_RATE_VHT4SS_MCS2: return MGN_VHT4SS_MCS2; + case MPT_RATE_VHT4SS_MCS3: return MGN_VHT4SS_MCS3; + case MPT_RATE_VHT4SS_MCS4: return MGN_VHT4SS_MCS4; + case MPT_RATE_VHT4SS_MCS5: return MGN_VHT4SS_MCS5; + case MPT_RATE_VHT4SS_MCS6: return MGN_VHT4SS_MCS6; + case MPT_RATE_VHT4SS_MCS7: return MGN_VHT4SS_MCS7; + case MPT_RATE_VHT4SS_MCS8: return MGN_VHT4SS_MCS8; + case MPT_RATE_VHT4SS_MCS9: return MGN_VHT4SS_MCS9; - case MPT_RATE_LAST:// fully automatic - default: - DBG_8192C("<===MptToMgntRate(), Invalid Rate: %d!!\n", MptRateIdx); - return 0x0; + case MPT_RATE_LAST: // fully automatiMGN_VHT2SS_MCS1; + default: + DBG_871X("<===MptToMgntRate(), Invalid Rate: %d!!\n", MptRateIdx); + return 0x0; + } +} + +u8 rtw_mpRateParseFunc(PADAPTER pAdapter, u8 *targetStr) +{ + u16 i=0; + u8* rateindex_Array[] = { "1M","2M","5.5M","11M","6M","9M","12M","18M","24M","36M","48M","54M", + "HTMCS0","HTMCS1","HTMCS2","HTMCS3","HTMCS4","HTMCS5","HTMCS6","HTMCS7", + "HTMCS8","HTMCS9","HTMCS10","HTMCS11","HTMCS12","HTMCS13","HTMCS14","HTMCS15", + "HTMCS16","HTMCS17","HTMCS18","HTMCS19","HTMCS20","HTMCS21","HTMCS22","HTMCS23", + "HTMCS24","HTMCS25","HTMCS26","HTMCS27","HTMCS28","HTMCS29","HTMCS30","HTMCS31", + "VHT1MCS0","VHT1MCS1","VHT1MCS2","VHT1MCS3","VHT1MCS4","VHT1MCS5","VHT1MCS6","VHT1MCS7","VHT1MCS8","VHT1MCS9", + "VHT2MCS0","VHT2MCS1","VHT2MCS2","VHT2MCS3","VHT2MCS4","VHT2MCS5","VHT2MCS6","VHT2MCS7","VHT2MCS8","VHT2MCS9", + "VHT3MCS0","VHT3MCS1","VHT3MCS2","VHT3MCS3","VHT3MCS4","VHT3MCS5","VHT3MCS6","VHT3MCS7","VHT3MCS8","VHT3MCS9", + "VHT4MCS0","VHT4MCS1","VHT4MCS2","VHT4MCS3","VHT4MCS4","VHT4MCS5","VHT4MCS6","VHT4MCS7","VHT4MCS8","VHT4MCS9"}; + + for(i=0;i<=83;i++){ + if(strcmp(targetStr, rateindex_Array[i]) == 0){ + DBG_871X("%s , index = %d \n",__func__ ,i); + return i; + } } + + printk("%s ,please input a Data RATE String as:",__func__); + for(i=0;i<=83;i++){ + printk("%s ",rateindex_Array[i]); + if(i%10==0) + printk("\n"); + } + return _FAIL; } ULONG mpt_ProQueryCalTxPower( @@ -2403,8 +2538,5 @@ void Hal_ProSetCrystalCap (PADAPTER pAdapter , u32 CrystalCap) PHY_SetBBReg(pAdapter, REG_MAC_PHY_CTRL, 0xFFF000, (CrystalCap | (CrystalCap << 6))); } } - - - #endif diff --git a/backports/drivers/realtek/rtl8812au/core/rtw_mp_ioctl.c b/backports/drivers/realtek/rtl8812au/core/rtw_mp_ioctl.c index b2c5a28aeb1ca9..2b4c94fbc18f80 100755 --- a/backports/drivers/realtek/rtl8812au/core/rtw_mp_ioctl.c +++ b/backports/drivers/realtek/rtl8812au/core/rtw_mp_ioctl.c @@ -21,7 +21,7 @@ #include #include -#include "../hal/OUTSRC/odm_precomp.h" +#include "../hal/OUTSRC/phydm_precomp.h" //**************** oid_rtl_seg_81_85 section start **************** NDIS_STATUS oid_rt_wireless_mode_hdl(struct oid_par_priv *poid_par_priv) @@ -1990,9 +1990,9 @@ NDIS_STATUS oid_rt_pro_dele_sta_info_hdl(struct oid_par_priv *poid_par_priv) psta = rtw_get_stainfo(&Adapter->stapriv, macaddr); if (psta != NULL) { - _enter_critical(&(Adapter->stapriv.sta_hash_lock), &irqL); + //_enter_critical(&(Adapter->stapriv.sta_hash_lock), &irqL); rtw_free_stainfo(Adapter, psta); - _exit_critical(&(Adapter->stapriv.sta_hash_lock), &irqL); + //_exit_critical(&(Adapter->stapriv.sta_hash_lock), &irqL); } return status; diff --git a/backports/drivers/realtek/rtl8812au/core/rtw_odm.c b/backports/drivers/realtek/rtl8812au/core/rtw_odm.c index 848bd58422ad8d..4777bb8b960729 100755 --- a/backports/drivers/realtek/rtl8812au/core/rtw_odm.c +++ b/backports/drivers/realtek/rtl8812au/core/rtw_odm.c @@ -37,13 +37,13 @@ const char *odm_comp_str[] = { /* BIT12 */"ODM_COMP_DYNAMIC_PRICCA", /* BIT13 */"ODM_COMP_RXHP", /* BIT14 */"ODM_COMP_MP", - /* BIT15 */"ODM_COMP_DYNAMIC_ATC", - /* BIT16 */"ODM_COMP_EDCA_TURBO", - /* BIT17 */"ODM_COMP_EARLY_MODE", - /* BIT18 */NULL, + /* BIT15 */"ODM_COMP_CFO_TRACKING", + /* BIT16 */"ODM_COMP_ACS", + /* BIT17 */"PHYDM_COMP_ADAPTIVITY", + /* BIT18 */"PHYDM_COMP_RA_DBG", /* BIT19 */NULL, - /* BIT20 */NULL, - /* BIT21 */NULL, + /* BIT20 */"ODM_COMP_EDCA_TURBO", + /* BIT21 */"ODM_COMP_EARLY_MODE", /* BIT22 */NULL, /* BIT23 */NULL, /* BIT24 */"ODM_COMP_TX_PWR_TRACK", @@ -51,7 +51,7 @@ const char *odm_comp_str[] = { /* BIT26 */"ODM_COMP_CALIBRATION", /* BIT27 */NULL, /* BIT28 */NULL, - /* BIT29 */NULL, + /* BIT29 */"BEAMFORMING_DEBUG", /* BIT30 */"ODM_COMP_COMMON", /* BIT31 */"ODM_COMP_INIT", }; @@ -73,14 +73,14 @@ const char *odm_ability_str[] = { /* BIT11 */"ODM_BB_PSD", /* BIT12 */"ODM_BB_RXHP", /* BIT13 */"ODM_BB_ADAPTIVITY", - /* BIT14 */"ODM_BB_DYNAMIC_ATC", - /* BIT15 */NULL, - /* BIT16 */"ODM_MAC_EDCA_TURBO", - /* BIT17 */"ODM_MAC_EARLY_MODE", + /* BIT14 */"ODM_BB_CFO_TRACKING", + /* BIT15 */"ODM_BB_NHM_CNT", + /* BIT16 */"ODM_BB_PRIMARY_CCA", + /* BIT17 */NULL, /* BIT18 */NULL, /* BIT19 */NULL, - /* BIT20 */NULL, - /* BIT21 */NULL, + /* BIT20 */"ODM_MAC_EDCA_TURBO", + /* BIT21 */"ODM_MAC_EARLY_MODE", /* BIT22 */NULL, /* BIT23 */NULL, /* BIT24 */"ODM_RF_TX_PWR_TRACK", @@ -113,8 +113,8 @@ void rtw_odm_dbg_comp_msg(void *sel, _adapter *adapter) DBG_871X_SEL_NL(sel, "odm.DebugComponents = 0x%016llx \n", dbg_comp); for (i=0;iregistrypriv; + struct mlme_priv *mlme = &adapter->mlmepriv; + HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter); + DM_ODM_T *odm = &hal_data->odmpriv; + + DBG_871X_SEL_NL(sel, "RTW_ADAPTIVITY_EN_"); + + if (regsty->adaptivity_en == RTW_ADAPTIVITY_EN_DISABLE) { + DBG_871X_SEL(sel, "DISABLE\n"); + } else if (regsty->adaptivity_en == RTW_ADAPTIVITY_EN_ENABLE) { + DBG_871X_SEL(sel, "ENABLE\n"); + } else { + DBG_871X_SEL(sel, "INVALID\n"); + } +} + +#define RTW_ADAPTIVITY_MODE_NORMAL 0 +#define RTW_ADAPTIVITY_MODE_CARRIER_SENSE 1 + +void rtw_odm_adaptivity_mode_msg(void *sel, _adapter *adapter) +{ + struct registry_priv *regsty = &adapter->registrypriv; + + DBG_871X_SEL_NL(sel, "RTW_ADAPTIVITY_MODE_"); + + if (regsty->adaptivity_mode == RTW_ADAPTIVITY_MODE_NORMAL) { + DBG_871X_SEL(sel, "NORMAL\n"); + } else if (regsty->adaptivity_mode == RTW_ADAPTIVITY_MODE_CARRIER_SENSE) { + DBG_871X_SEL(sel, "CARRIER_SENSE\n"); + } else { + DBG_871X_SEL(sel, "INVALID\n"); + } +} + +#define RTW_ADAPTIVITY_DML_DISABLE 0 +#define RTW_ADAPTIVITY_DML_ENABLE 1 + +void rtw_odm_adaptivity_dml_msg(void *sel, _adapter *adapter) +{ + struct registry_priv *regsty = &adapter->registrypriv; + + DBG_871X_SEL_NL(sel, "RTW_ADAPTIVITY_DML_"); + + if (regsty->adaptivity_dml == RTW_ADAPTIVITY_DML_DISABLE) { + DBG_871X_SEL(sel, "DISABLE\n"); + } else if (regsty->adaptivity_dml == RTW_ADAPTIVITY_DML_ENABLE) { + DBG_871X_SEL(sel, "ENABLE\n"); + } else { + DBG_871X_SEL(sel, "INVALID\n"); + } +} + +bool rtw_odm_adaptivity_needed(_adapter *adapter) +{ + struct registry_priv *regsty = &adapter->registrypriv; + struct mlme_priv *mlme = &adapter->mlmepriv; + bool ret = _FALSE; + + if (regsty->adaptivity_en == RTW_ADAPTIVITY_EN_ENABLE) + ret = _TRUE; + + if (ret == _TRUE) { + rtw_odm_adaptivity_ver_msg(RTW_DBGDUMP, adapter); + rtw_odm_adaptivity_en_msg(RTW_DBGDUMP, adapter); + rtw_odm_adaptivity_mode_msg(RTW_DBGDUMP, adapter); + rtw_odm_adaptivity_dml_msg(RTW_DBGDUMP, adapter); + } + + return ret; +} + void rtw_odm_adaptivity_parm_msg(void *sel, _adapter *adapter) { HAL_DATA_TYPE *pHalData = GET_HAL_DATA(adapter); DM_ODM_T *odm = &pHalData->odmpriv; - DBG_871X_SEL_NL(sel, "%10s %16s %8s %10s %11s %14s\n" - , "TH_L2H_ini", "TH_EDCCA_HL_diff", "IGI_Base", "ForceEDCCA", "AdapEn_RSSI", "IGI_LowerBound"); - DBG_871X_SEL_NL(sel, "0x%-8x %-16d 0x%-6x %-10d %-11u %-14u\n" + rtw_odm_adaptivity_ver_msg(sel, adapter); + rtw_odm_adaptivity_en_msg(sel, adapter); + rtw_odm_adaptivity_mode_msg(sel, adapter); + rtw_odm_adaptivity_dml_msg(sel, adapter); + + DBG_871X_SEL_NL(sel, "%10s %16s %8s %7s\n" + , "TH_L2H_ini", "TH_EDCCA_HL_diff", "IGI_Base", "FABound"); + DBG_871X_SEL_NL(sel, "0x%-8x %-16d 0x%-6x %-7d\n" , (u8)odm->TH_L2H_ini , odm->TH_EDCCA_HL_diff , odm->IGI_Base - , odm->ForceEDCCA - , odm->AdapEn_RSSI - , odm->IGI_LowerBound + , odm->FABound + ); + + DBG_871X_SEL_NL(sel, "%15s %9s\n", "AdapEnableState","Adap_Flag"); + DBG_871X_SEL_NL(sel, "%-15x %-9x \n" + , odm->Adaptivity_enable + , odm->adaptivity_flag ); + + } void rtw_odm_adaptivity_parm_set(_adapter *adapter, s8 TH_L2H_ini, s8 TH_EDCCA_HL_diff, - s8 IGI_Base, bool ForceEDCCA, u8 AdapEn_RSSI, u8 IGI_LowerBound) + s8 IGI_Base, u32 FABound) { HAL_DATA_TYPE *pHalData = GET_HAL_DATA(adapter); DM_ODM_T *odm = &pHalData->odmpriv; @@ -192,8 +284,46 @@ void rtw_odm_adaptivity_parm_set(_adapter *adapter, s8 TH_L2H_ini, s8 TH_EDCCA_H odm->TH_L2H_ini = TH_L2H_ini; odm->TH_EDCCA_HL_diff = TH_EDCCA_HL_diff; odm->IGI_Base = IGI_Base; - odm->ForceEDCCA = ForceEDCCA; - odm->AdapEn_RSSI = AdapEn_RSSI; - odm->IGI_LowerBound = IGI_LowerBound; + odm->FABound = FABound; +} + +void rtw_odm_get_perpkt_rssi(void *sel, _adapter *adapter) +{ + HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter); + DM_ODM_T *odm = &(hal_data->odmpriv); + + DBG_871X_SEL_NL(sel,"RxRate = %s, RSSI_A = %d(%%), RSSI_B = %d(%%)\n", + HDATA_RATE(odm->RxRate), odm->RSSI_A, odm->RSSI_B); +} + + +void rtw_odm_acquirespinlock(_adapter *adapter, RT_SPINLOCK_TYPE type) +{ + PHAL_DATA_TYPE pHalData = GET_HAL_DATA(adapter); + struct dm_priv *pdmpriv = &pHalData->dmpriv; + _irqL irqL; + + switch(type) + { + case RT_IQK_SPINLOCK: + _enter_critical_bh(&pdmpriv->IQKSpinLock, &irqL); + default: + break; + } +} + +void rtw_odm_releasespinlock(_adapter *adapter, RT_SPINLOCK_TYPE type) +{ + PHAL_DATA_TYPE pHalData = GET_HAL_DATA(adapter); + struct dm_priv *pdmpriv = &pHalData->dmpriv; + _irqL irqL; + + switch(type) + { + case RT_IQK_SPINLOCK: + _exit_critical_bh(&pdmpriv->IQKSpinLock, &irqL); + default: + break; + } } diff --git a/backports/drivers/realtek/rtl8812au/core/rtw_p2p.c b/backports/drivers/realtek/rtl8812au/core/rtw_p2p.c index 9123451f4b9d35..93542e0116ca83 100755 --- a/backports/drivers/realtek/rtl8812au/core/rtw_p2p.c +++ b/backports/drivers/realtek/rtl8812au/core/rtw_p2p.c @@ -58,6 +58,11 @@ static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf) pdata_attr = rtw_zmalloc(MAX_P2P_IE_LEN); + if(NULL == pdata_attr){ + DBG_871X("%s pdata_attr malloc failed \n", __FUNCTION__); + goto _exit; + } + pstart = pdata_attr; pcur = pdata_attr; @@ -139,7 +144,8 @@ static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf) } rtw_mfree(pdata_attr, MAX_P2P_IE_LEN); - + +_exit: return len; } @@ -532,6 +538,7 @@ u32 build_beacon_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) u32 build_beacon_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) { u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; + u16 val16=0; u32 len=0, wfdielen = 0; _adapter *padapter = pwdinfo->padapter; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -568,19 +575,22 @@ u32 build_beacon_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) if ( is_any_client_associated( pwdinfo->padapter ) ) { // WFD primary sink + WiFi Direct mode + WSD (WFD Service Discovery) - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_WSD ); + val16 = pwfd_info->wfd_device_type | WFD_DEVINFO_WSD; + RTW_PUT_BE16(wfdie + wfdielen, val16); } else { // WFD primary sink + available for WFD session + WiFi Direct mode + WSD (WFD Service Discovery) - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD ); + val16 = pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD; + RTW_PUT_BE16(wfdie + wfdielen, val16); } } else { // WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD ); + val16 = pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD; + RTW_PUT_BE16(wfdie + wfdielen, val16); } wfdielen += 2; @@ -640,7 +650,7 @@ u32 build_beacon_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdie[ wfdielen++ ] = 0; wfdie[ wfdielen++ ] = 0; - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); return len; @@ -649,6 +659,7 @@ u32 build_beacon_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) u32 build_probe_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) { u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; + u16 val16=0; u32 len=0, wfdielen = 0; _adapter *padapter = pwdinfo->padapter; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -683,17 +694,19 @@ u32 build_probe_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) if ( 1 == pwdinfo->wfd_tdls_enable ) { // WFD primary sink + available for WFD session + WiFi TDLS mode + WSC ( WFD Service Discovery ) - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | + val16 = pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD | - WFD_DEVINFO_PC_TDLS ); + WFD_DEVINFO_PC_TDLS; + RTW_PUT_BE16(wfdie + wfdielen, val16 ); } else { // WFD primary sink + available for WFD session + WiFi Direct mode + WSC ( WFD Service Discovery ) - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | + val16 = pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | - WFD_DEVINFO_WSD ); + WFD_DEVINFO_WSD; + RTW_PUT_BE16(wfdie + wfdielen, val16 ); } wfdielen += 2; @@ -753,7 +766,7 @@ u32 build_probe_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdie[ wfdielen++ ] = 0; wfdie[ wfdielen++ ] = 0; - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); return len; @@ -957,6 +970,7 @@ u32 build_probe_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 tunnel u32 build_assoc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) { u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; + u16 val16=0; u32 len=0, wfdielen = 0; _adapter *padapter = NULL; struct mlme_priv *pmlmepriv = NULL; @@ -997,7 +1011,8 @@ u32 build_assoc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) // Value1: // WFD device information // WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD ); + val16 = pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD; + RTW_PUT_BE16(wfdie + wfdielen, val16); wfdielen += 2; // Value2: @@ -1055,7 +1070,7 @@ u32 build_assoc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdie[ wfdielen++ ] = 0; wfdie[ wfdielen++ ] = 0; - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); return len; @@ -1065,6 +1080,7 @@ u32 build_assoc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) { u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; u32 len=0, wfdielen = 0; + u16 val16=0; _adapter *padapter = pwdinfo->padapter; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; @@ -1095,7 +1111,8 @@ u32 build_assoc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) // Value1: // WFD device information // WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD ); + val16 = pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD; + RTW_PUT_BE16(wfdie + wfdielen, val16); wfdielen += 2; // Value2: @@ -1153,7 +1170,7 @@ u32 build_assoc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdie[ wfdielen++ ] = 0; wfdie[ wfdielen++ ] = 0; - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); return len; @@ -1163,6 +1180,7 @@ u32 build_nego_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) { u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; u32 len=0, wfdielen = 0; + u16 val16=0; _adapter *padapter = pwdinfo->padapter; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; @@ -1193,7 +1211,8 @@ u32 build_nego_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) // Value1: // WFD device information // WFD primary sink + WiFi Direct mode + WSD ( WFD Service Discovery ) + WFD Session Available - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_WSD | WFD_DEVINFO_SESSION_AVAIL); + val16 = pwfd_info->wfd_device_type | WFD_DEVINFO_WSD | WFD_DEVINFO_SESSION_AVAIL; + RTW_PUT_BE16(wfdie + wfdielen, val16); wfdielen += 2; // Value2: @@ -1251,7 +1270,7 @@ u32 build_nego_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdie[ wfdielen++ ] = 0; wfdie[ wfdielen++ ] = 0; - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); return len; @@ -1261,6 +1280,7 @@ u32 build_nego_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) { u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; u32 len=0, wfdielen = 0; + u16 val16=0; _adapter *padapter = pwdinfo->padapter; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; @@ -1291,7 +1311,8 @@ u32 build_nego_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) // Value1: // WFD device information // WFD primary sink + WiFi Direct mode + WSD ( WFD Service Discovery ) + WFD Session Available - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_WSD | WFD_DEVINFO_SESSION_AVAIL); + val16 = pwfd_info->wfd_device_type | WFD_DEVINFO_WSD | WFD_DEVINFO_SESSION_AVAIL; + RTW_PUT_BE16(wfdie + wfdielen, val16); wfdielen += 2; // Value2: @@ -1350,7 +1371,7 @@ u32 build_nego_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdie[ wfdielen++ ] = 0; - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); return len; @@ -1360,6 +1381,7 @@ u32 build_nego_confirm_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) { u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; u32 len=0, wfdielen = 0; + u16 val16=0; _adapter *padapter = pwdinfo->padapter; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; @@ -1390,7 +1412,8 @@ u32 build_nego_confirm_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) // Value1: // WFD device information // WFD primary sink + WiFi Direct mode + WSD ( WFD Service Discovery ) + WFD Session Available - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_WSD | WFD_DEVINFO_SESSION_AVAIL); + val16 = pwfd_info->wfd_device_type | WFD_DEVINFO_WSD | WFD_DEVINFO_SESSION_AVAIL; + RTW_PUT_BE16(wfdie + wfdielen, val16); wfdielen += 2; // Value2: @@ -1459,6 +1482,7 @@ u32 build_invitation_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) { u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; u32 len=0, wfdielen = 0; + u16 val16=0; _adapter *padapter = pwdinfo->padapter; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; @@ -1489,7 +1513,8 @@ u32 build_invitation_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) // Value1: // WFD device information // WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD ); + val16 = pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD; + RTW_PUT_BE16(wfdie + wfdielen, val16); wfdielen += 2; // Value2: @@ -1562,7 +1587,7 @@ u32 build_invitation_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) } - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); return len; @@ -1571,6 +1596,7 @@ u32 build_invitation_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) u32 build_invitation_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) { u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; + u16 val16=0; u32 len=0, wfdielen = 0; _adapter *padapter = pwdinfo->padapter; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -1602,7 +1628,8 @@ u32 build_invitation_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) // Value1: // WFD device information // WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD ); + val16 = pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD; + RTW_PUT_BE16(wfdie + wfdielen, val16); wfdielen += 2; // Value2: @@ -1675,7 +1702,7 @@ u32 build_invitation_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) } - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); return len; @@ -1685,6 +1712,7 @@ u32 build_provdisc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) { u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; u32 len=0, wfdielen = 0; + u16 val16=0; _adapter *padapter = pwdinfo->padapter; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; @@ -1715,7 +1743,8 @@ u32 build_provdisc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) // Value1: // WFD device information // WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD ); + val16 = pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD; + RTW_PUT_BE16(wfdie + wfdielen, val16); wfdielen += 2; // Value2: @@ -1774,7 +1803,7 @@ u32 build_provdisc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdie[ wfdielen++ ] = 0; - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); return len; @@ -1784,6 +1813,7 @@ u32 build_provdisc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) { u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; u32 len=0, wfdielen = 0; + u16 val16=0; _adapter *padapter = pwdinfo->padapter; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; @@ -1814,7 +1844,8 @@ u32 build_provdisc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) // Value1: // WFD device information // WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD ); + val16 = pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD; + RTW_PUT_BE16(wfdie + wfdielen, val16); wfdielen += 2; // Value2: @@ -1872,7 +1903,7 @@ u32 build_provdisc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdie[ wfdielen++ ] = 0; wfdie[ wfdielen++ ] = 0; - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); return len; @@ -3430,6 +3461,8 @@ _func_exit_; void p2p_concurrent_handler( _adapter* padapter ) { struct wifidirect_info *pwdinfo = &padapter->wdinfo; + struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); //_adapter *pbuddy_adapter = padapter->pbuddy_adapter; //struct wifidirect_info *pbuddy_wdinfo = &pbuddy_adapter->wdinfo; //struct mlme_priv *pbuddy_mlmepriv = &pbuddy_adapter->mlmepriv; @@ -3449,8 +3482,9 @@ _func_enter_; DBG_871X("%s, switch ch back to buddy's cur_channel=%d\n", __func__, pbuddy_mlmeext->cur_channel); set_channel_bwmode(padapter, pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_ch_offset, pbuddy_mlmeext->cur_bwmode); - - issue_nulldata(pbuddy_adapter, NULL, 0, 3, 500); + + if (check_buddy_fwstate(padapter, WIFI_FW_STATION_STATE)) + issue_nulldata(pbuddy_adapter, NULL, 0, 3, 500); } else if( pwdinfo->driver_interface == DRIVER_WEXT ) { @@ -3470,9 +3504,12 @@ _func_enter_; } rtw_p2p_set_state(pwdinfo, P2P_STATE_LISTEN); - val8 = 1; - rtw_hal_set_hwreg(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8)); - + if(!check_buddy_mlmeinfo_state(padapter, WIFI_FW_AP_STATE) && + !(pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) + { + val8 = 1; + rtw_hal_set_hwreg(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8)); + } // Todo: To check the value of pwdinfo->ext_listen_period is equal to 0 or not. _set_timer( &pwdinfo->ap_p2p_switch_timer, pwdinfo->ext_listen_period ); } @@ -3492,8 +3529,11 @@ _func_enter_; if ( pbuddy_mlmeext->cur_channel != pwdinfo->listen_channel ) { set_channel_bwmode(padapter, pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_ch_offset, pbuddy_mlmeext->cur_bwmode); - val8 = 0; - padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8)); + if(!check_buddy_mlmeinfo_state(padapter, WIFI_FW_AP_STATE) &&!(pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) + { + val8 = 0; + padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8)); + } rtw_p2p_set_state(pwdinfo, P2P_STATE_IDLE); issue_nulldata(pbuddy_adapter, NULL, 0, 3, 500); } @@ -3557,24 +3597,24 @@ _func_enter_; if (rtw_get_ch_setting_union(padapter, &ch, &bw, &offset) != 0) { if (0) - DBG_871X(FUNC_ADPT_FMT" back to linked union - ch:%u, bw:%u, offset:%u\n", - FUNC_ADPT_ARG(padapter), ch, bw, offset); + DBG_871X(FUNC_ADPT_FMT" back to linked/linking union - ch:%u, bw:%u, offset:%u\n", + FUNC_ADPT_ARG(padapter), ch, bw, offset); } else if (adapter_wdev_data(padapter)->p2p_enabled && pwdinfo->listen_channel) { ch = pwdinfo->listen_channel; bw = CHANNEL_WIDTH_20; offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; if (0) - DBG_871X(FUNC_ADPT_FMT" back to listen ch - ch:%u, bw:%u, offset:%u\n", - FUNC_ADPT_ARG(padapter), ch, bw, offset); + DBG_871X(FUNC_ADPT_FMT" back to listen ch - ch:%u, bw:%u, offset:%u\n", + FUNC_ADPT_ARG(padapter), ch, bw, offset); } else { ch = pcfg80211_wdinfo->restore_channel; bw = CHANNEL_WIDTH_20; offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; if (0) - DBG_871X(FUNC_ADPT_FMT" back to restore ch - ch:%u, bw:%u, offset:%u\n", - FUNC_ADPT_ARG(padapter), ch, bw, offset); + DBG_871X(FUNC_ADPT_FMT" back to restore ch - ch:%u, bw:%u, offset:%u\n", + FUNC_ADPT_ARG(padapter), ch, bw, offset); } set_channel_bwmode(padapter, ch, offset, bw); @@ -3587,6 +3627,9 @@ _func_enter_; pcfg80211_wdinfo->is_ro_ch = _FALSE; pcfg80211_wdinfo->last_ro_ch_time = rtw_get_current_time(); + if (pcfg80211_wdinfo->not_indic_ro_ch_exp == _TRUE) + return; + DBG_871X("cfg80211_remain_on_channel_expired, ch=%d, bw=%d, offset=%d\n", rtw_get_oper_ch(padapter), rtw_get_oper_bw(padapter), rtw_get_oper_choffset(padapter)); @@ -4056,7 +4099,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx) //pwdev_priv->provdisc_req_issued = _FALSE; - #ifdef CONFIG_CONCURRENT_MODE + #if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT) if(check_buddy_fwstate(padapter, _FW_LINKED)) rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr)); #endif @@ -4085,7 +4128,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx) (tx==_TRUE)?"Tx":"Rx", dialogToken, (intent>>1), intent&0x1 ? "+" : "-", listen_ch, op_ch, ch_list_buf); if (!tx) { - #ifdef CONFIG_CONCURRENT_MODE + #if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT) if(check_buddy_fwstate(padapter, _FW_LINKED) && rtw_chk_p2pie_ch_list_with_buddy(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr)) == _FALSE) { @@ -4102,7 +4145,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx) struct rtw_wdev_nego_info* nego_info = &pwdev_priv->nego_info; if (tx) { - #ifdef CONFIG_CONCURRENT_MODE + #if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT) if(check_buddy_fwstate(padapter, _FW_LINKED)) rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr)); #endif @@ -4132,7 +4175,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx) if (!tx) { pwdev_priv->provdisc_req_issued = _FALSE; - #ifdef CONFIG_CONCURRENT_MODE + #if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT) if(check_buddy_fwstate(padapter, _FW_LINKED) && rtw_chk_p2pie_ch_list_with_buddy(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr)) == _FALSE) { @@ -4150,7 +4193,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx) bool is_go = _FALSE; if (tx) { - #ifdef CONFIG_CONCURRENT_MODE + #if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT) if(check_buddy_fwstate(padapter, _FW_LINKED)) rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr)); #endif @@ -4169,7 +4212,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx) nego_info->state = 2; if (status == 0) { - if (rtw_p2p_nego_intent_compare(nego_info->req_intent, nego_info->rsp_intent) && tx) + if (rtw_p2p_nego_intent_compare(nego_info->req_intent, nego_info->rsp_intent) ^ !tx) is_go = _TRUE; } @@ -4191,7 +4234,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx) int flags = -1; if (tx) { - #ifdef CONFIG_CONCURRENT_MODE + #if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT) if(check_buddy_fwstate(padapter, _FW_LINKED)) rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr)); #endif @@ -4216,10 +4259,9 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx) DBG_871X("RTW_%s:P2P_INVIT_REQ, dialogToken=%d, flags:0x%02x, op_ch:%d, ch_list:%s\n", (tx==_TRUE)?"Tx":"Rx", dialogToken, flags, op_ch, ch_list_buf); - if (!tx && padapter->cfg80211_wdinfo.chk_invite_ch_list == _TRUE) { - #ifdef CONFIG_CONCURRENT_MODE - if(check_buddy_fwstate(padapter, _FW_LINKED)) - { + if (!tx) { + #if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT) + if(check_buddy_fwstate(padapter, _FW_LINKED)) { if (op_ch != -1 && rtw_chk_p2pie_op_ch_with_buddy(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr)) == _FALSE) { DBG_871X(FUNC_ADPT_FMT" op_ch:%u has no intersect with buddy\n", FUNC_ADPT_ARG(padapter), op_ch); rtw_change_p2pie_ch_list(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr), 0); @@ -4238,7 +4280,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx) struct rtw_wdev_invit_info* invit_info = &pwdev_priv->invit_info; if (tx) { - #ifdef CONFIG_CONCURRENT_MODE + #if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT) if(check_buddy_fwstate(padapter, _FW_LINKED)) rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr)); #endif @@ -4371,11 +4413,7 @@ void rtw_init_cfg80211_wifidirect_info( _adapter* padapter) struct cfg80211_wifidirect_info *pcfg80211_wdinfo = &padapter->cfg80211_wdinfo; _rtw_memset(pcfg80211_wdinfo, 0x00, sizeof(struct cfg80211_wifidirect_info) ); -#ifdef CONFIG_P2P_CHK_INVITE_CH_LIST - pcfg80211_wdinfo->chk_invite_ch_list = _TRUE; -#else - pcfg80211_wdinfo->chk_invite_ch_list = _FALSE; -#endif //CONFIG_P2P_CHK_INVITE_CH_LIST + _init_timer( &pcfg80211_wdinfo->remain_on_ch_timer, padapter->pnetdev, ro_ch_timer_process, padapter ); } #endif //CONFIG_IOCTL_CFG80211 @@ -4468,6 +4506,46 @@ _func_enter_; _func_exit_; } +int process_p2p_cross_connect_ie(PADAPTER padapter, u8 *IEs, u32 IELength) +{ + int ret = _TRUE; + u8 * ies; + u32 ies_len; + u8 * p2p_ie; + u32 p2p_ielen = 0; + u8 p2p_attr[MAX_P2P_IE_LEN] = { 0x00 };// NoA length should be n*(13) + 2 + u32 attr_contentlen = 0; + + struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); + +_func_enter_; + + if(IELength <= _BEACON_IE_OFFSET_) + return ret; + + ies = IEs + _BEACON_IE_OFFSET_; + ies_len = IELength - _BEACON_IE_OFFSET_; + + p2p_ie = rtw_get_p2p_ie( ies, ies_len, NULL, &p2p_ielen); + + while(p2p_ie) + { + // Get P2P Manageability IE. + if(rtw_get_p2p_attr_content( p2p_ie, p2p_ielen, P2P_ATTR_MANAGEABILITY, p2p_attr, &attr_contentlen)) + { + if ((p2p_attr[0]&(BIT(0)|BIT(1))) == 0x01) { + ret = _FALSE; + } + break; + } + //Get the next P2P IE + p2p_ie = rtw_get_p2p_ie(p2p_ie+p2p_ielen, ies_len -(p2p_ie -ies + p2p_ielen), NULL, &p2p_ielen); + } + +_func_exit_; + return ret; +} + #ifdef CONFIG_P2P_PS void process_p2p_ps_ie(PADAPTER padapter, u8 *IEs, u32 IELength) { @@ -5257,10 +5335,6 @@ int rtw_p2p_enable(_adapter *padapter, enum P2P_ROLE role) adapter_wdev_data(padapter)->p2p_enabled = _FALSE; #endif //CONFIG_IOCTL_CFG80211 - if (_FAIL == rtw_pwr_wakeup(padapter)) { - ret = _FAIL; - goto exit; - } //Disable P2P function if(!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) @@ -5279,6 +5353,10 @@ int rtw_p2p_enable(_adapter *padapter, enum P2P_ROLE role) rtw_p2p_set_pre_state(pwdinfo, P2P_STATE_NONE); rtw_p2p_set_role(pwdinfo, P2P_ROLE_DISABLE); _rtw_memset(&pwdinfo->rx_prov_disc_info, 0x00, sizeof(struct rx_provdisc_req_info)); + + /* Remove profiles in wifidirect_info structure. */ + _rtw_memset( &pwdinfo->profileinfo[ 0 ], 0x00, sizeof( struct profile_info ) * P2P_MAX_PERSISTENT_GROUP_NUM ); + pwdinfo->profileindex = 0; } rtw_hal_set_odm_var(padapter,HAL_ODM_P2P_STATE,NULL,_FALSE); @@ -5286,6 +5364,11 @@ int rtw_p2p_enable(_adapter *padapter, enum P2P_ROLE role) rtw_hal_set_odm_var(padapter,HAL_ODM_WIFI_DISPLAY_STATE,NULL,_FALSE); #endif + if (_FAIL == rtw_pwr_wakeup(padapter)) { + ret = _FAIL; + goto exit; + } + //Restore to initial setting. update_tx_basic_rate(padapter, padapter->registrypriv.wireless_mode); diff --git a/backports/drivers/realtek/rtl8812au/core/rtw_pwrctrl.c b/backports/drivers/realtek/rtl8812au/core/rtw_pwrctrl.c index 71b6a6ff52a64d..7973341ed958a3 100755 --- a/backports/drivers/realtek/rtl8812au/core/rtw_pwrctrl.c +++ b/backports/drivers/realtek/rtl8812au/core/rtw_pwrctrl.c @@ -20,7 +20,8 @@ #define _RTW_PWRCTRL_C_ #include - +#include +#include int rtw_fw_ps_state(PADAPTER padapter) { @@ -159,6 +160,9 @@ int ips_leave(_adapter * padapter) #endif //DBG_CHECK_FW_PS_STATE _exit_pwrlock(&pwrpriv->lock); + if (_SUCCESS == ret) + ODM_DMReset(&GET_HAL_DATA(padapter)->odmpriv); + #ifdef CONFIG_BT_COEXIST if (_SUCCESS == ret) rtw_btcoex_IpsNotify(padapter, IPS_NONE); @@ -460,7 +464,7 @@ void traffic_check_for_leave_lps(PADAPTER padapter, u8 tx, u32 tx_packets) #endif ) { - DBG_871X("leave lps via Tx = %d\n", xmit_cnt); + //DBG_871X("leave lps via Tx = %d\n", xmit_cnt); bLeaveLPS = _TRUE; } } @@ -481,7 +485,7 @@ void traffic_check_for_leave_lps(PADAPTER padapter, u8 tx, u32 tx_packets) #endif ) { - DBG_871X("leave lps via Rx = %d\n", pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod); + //DBG_871X("leave lps via Rx = %d\n", pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod); bLeaveLPS = _TRUE; } } @@ -491,7 +495,7 @@ void traffic_check_for_leave_lps(PADAPTER padapter, u8 tx, u32 tx_packets) { //DBG_871X("leave lps via %s, Tx = %d, Rx = %d \n", tx?"Tx":"Rx", pmlmepriv->LinkDetectInfo.NumTxOkInPeriod,pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod); //rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_LEAVE, 1); - rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_LEAVE, tx?0:1); + rtw_lps_ctrl_wk_cmd(padapter, tx?LPS_CTRL_TX_TRAFFIC_LEAVE:LPS_CTRL_RX_TRAFFIC_LEAVE, tx?0:1); } #endif //CONFIG_CHECK_LEAVE_LPS } @@ -604,7 +608,7 @@ _func_enter_; // polling cpwm do { - rtw_mdelay_os(1); + rtw_msleep_os(1); poll_cnt++; rtw_hal_get_hwreg(padapter, HW_VAR_CPWM, &cpwm_now); if ((cpwm_orig ^ cpwm_now) & 0x80) @@ -697,6 +701,10 @@ u8 PS_RDY_CHECK(_adapter * padapter) || !rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE) #endif || rtw_is_scan_deny(padapter) +#ifdef CONFIG_TDLS + // TDLS link is established. + || ( padapter->tdlsinfo.link_established == _TRUE ) +#endif // CONFIG_TDLS ) return _FALSE; @@ -714,6 +722,129 @@ u8 PS_RDY_CHECK(_adapter * padapter) return _TRUE; } +#if defined(CONFIG_FWLPS_IN_IPS) +void rtw_set_fw_in_ips_mode(PADAPTER padapter, u8 enable) +{ + struct hal_ops *pHalFunc = &padapter->HalFunc; + struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); + int cnt=0; + u32 start_time; + u8 val8 = 0; + u8 cpwm_orig = 0, cpwm_now = 0; + u8 parm[H2C_INACTIVE_PS_LEN]={0}; + + if (padapter->netif_up == _FALSE) { + DBG_871X("%s: ERROR, netif is down\n", __func__); + return; + } + + if (pHalFunc->fill_h2c_cmd == NULL) { + DBG_871X("%s: Please hook fill_h2c_cmd first!\n", __func__); + return; + } + + //u8 cmd_param; //BIT0:enable, BIT1:NoConnect32k + if (enable) { +#ifdef CONFIG_BT_COEXIST + rtw_btcoex_IpsNotify(padapter, pwrpriv->ips_mode_req); +#endif + //Enter IPS + DBG_871X("%s: issue H2C to FW when entering IPS\n", __func__); + +#ifdef CONFIG_PNO_SUPPORT + parm[0] = 0x03; + parm[1] = pwrpriv->pnlo_info->fast_scan_iterations; + parm[2] = pwrpriv->pnlo_info->slow_scan_period; +#else + parm[0] = 0x03; + parm[1] = 0x0; + parm[2] = 0x0; +#endif//CONFIG_PNO_SUPPORT + + pHalFunc->fill_h2c_cmd(padapter, //H2C_FWLPS_IN_IPS_, + H2C_INACTIVE_PS_, + H2C_INACTIVE_PS_LEN, parm); + //poll 0x1cc to make sure H2C command already finished by FW; MAC_0x1cc=0 means H2C done by FW. + do{ + val8 = rtw_read8(padapter, REG_HMETFR); + cnt++; + DBG_871X("%s polling REG_HMETFR=0x%x, cnt=%d \n", + __func__, val8, cnt); + rtw_mdelay_os(10); + }while(cnt<100 && (val8!=0)); + + //H2C done, enter 32k + if (val8 == 0) { + //ser rpwm to enter 32k + val8 = rtw_read8(padapter, SDIO_LOCAL_BASE|SDIO_REG_HRPWM1); + DBG_871X("%s: read rpwm=%02x\n", __FUNCTION__, val8); + val8 += 0x80; + val8 |= BIT(0); + rtw_write8(padapter, SDIO_LOCAL_BASE|SDIO_REG_HRPWM1, val8); + DBG_871X("%s: write rpwm=%02x\n", __FUNCTION__, val8); + adapter_to_pwrctl(padapter)->tog = (val8 + 0x80) & 0x80; + cnt = val8 = 0; + if (parm[1] == 0 || parm[2] == 0) { + do { + val8 = rtw_read8(padapter, REG_CR); + cnt++; + DBG_871X("%s polling 0x100=0x%x, cnt=%d \n", + __func__, val8, cnt); + DBG_871X("%s 0x08:%02x, 0x03:%02x\n", + __func__, + rtw_read8(padapter, 0x08), + rtw_read8(padapter, 0x03)); + rtw_mdelay_os(10); + } while(cnt<20 && (val8!=0xEA)); + } + } + } else { + //Leave IPS + DBG_871X("%s: Leaving IPS in FWLPS state\n", __func__); + + //for polling cpwm + cpwm_orig = 0; + rtw_hal_get_hwreg(padapter, HW_VAR_CPWM, &cpwm_orig); + + //ser rpwm + val8 = rtw_read8(padapter, SDIO_LOCAL_BASE|SDIO_REG_HRPWM1); + val8 &= 0x80; + val8 += 0x80; + val8 |= BIT(6); + rtw_write8(padapter, SDIO_LOCAL_BASE|SDIO_REG_HRPWM1, val8); + DBG_871X("%s: write rpwm=%02x\n", __FUNCTION__, val8); + adapter_to_pwrctl(padapter)->tog = (val8 + 0x80) & 0x80; + + //do polling cpwm + start_time = rtw_get_current_time(); + do { + + rtw_mdelay_os(1); + + rtw_hal_get_hwreg(padapter, HW_VAR_CPWM, &cpwm_now); + if ((cpwm_orig ^ cpwm_now) & 0x80) { + break; + } + + if (rtw_get_passing_time_ms(start_time) > 100) + { + DBG_871X("%s: polling cpwm timeout when leaving IPS in FWLPS state\n", __FUNCTION__); + break; + } + } while (1); + + parm[0] = 0x0; + parm[1] = 0x0; + parm[2] = 0x0; + pHalFunc->fill_h2c_cmd(padapter, H2C_INACTIVE_PS_, + H2C_INACTIVE_PS_LEN, parm); +#ifdef CONFIG_BT_COEXIST + rtw_btcoex_IpsNotify(padapter, IPS_NONE); +#endif + } +} +#endif //CONFIG_PNO_SUPPORT + void rtw_set_ps_mode(PADAPTER padapter, u8 ps_mode, u8 smart_ps, u8 bcn_ant_mode, const char *msg) { struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); @@ -781,6 +912,10 @@ _func_enter_; DBG_871X(FUNC_ADPT_FMT" Leave 802.11 power save - %s\n", FUNC_ADPT_ARG(padapter), msg); + if (pwrpriv->lps_leave_cnts < UINT_MAX) + pwrpriv->lps_leave_cnts++; + else + pwrpriv->lps_leave_cnts = 0; #ifdef CONFIG_TDLS _enter_critical_bh(&pstapriv->sta_hash_lock, &irqL); @@ -805,9 +940,10 @@ _func_enter_; pwrpriv->pwr_mode = ps_mode; rtw_set_rpwm(padapter, PS_STATE_S4); -#if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN) +#if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN) || defined(CONFIG_P2P_WOWLAN) if (pwrpriv->wowlan_mode == _TRUE || - pwrpriv->wowlan_ap_mode == _TRUE) + pwrpriv->wowlan_ap_mode == _TRUE || + pwrpriv->wowlan_p2p_mode == _TRUE) { u32 start_time, delay_ms; u8 val8; @@ -845,6 +981,9 @@ _func_enter_; || ((rtw_btcoex_IsBtControlLps(padapter) == _TRUE) && (rtw_btcoex_IsLpsOn(padapter) == _TRUE)) #endif +#ifdef CONFIG_P2P_WOWLAN + ||( _TRUE == pwrpriv->wowlan_p2p_mode) +#endif //CONFIG_P2P_WOWLAN ) { u8 pslv; @@ -852,6 +991,10 @@ _func_enter_; DBG_871X(FUNC_ADPT_FMT" Enter 802.11 power save - %s\n", FUNC_ADPT_ARG(padapter), msg); + if (pwrpriv->lps_enter_cnts < UINT_MAX) + pwrpriv->lps_enter_cnts++; + else + pwrpriv->lps_enter_cnts = 0; #ifdef CONFIG_TDLS _enter_critical_bh(&pstapriv->sta_hash_lock, &irqL); @@ -1011,6 +1154,13 @@ _func_enter_; return; } +#ifdef CONFIG_P2P_PS + if(padapter->wdinfo.p2p_ps_mode == P2P_PS_NOA) + { + return;//supporting p2p client ps NOA via H2C_8723B_P2P_PS_OFFLOAD + } +#endif //CONFIG_P2P_PS + if (pwrpriv->bLeisurePs) { // Idle for a while if we connect to AP a while ago. @@ -1112,7 +1262,7 @@ _func_enter_; ) { //connect - if(pwrpriv->power_mgnt == PS_MODE_ACTIVE) { + if(pwrpriv->pwr_mode == PS_MODE_ACTIVE) { DBG_871X("%s: Driver Already Leave LPS\n",__FUNCTION__); return; } @@ -1197,7 +1347,7 @@ _func_enter_; else #endif { -#if defined(CONFIG_FWLPS_IN_IPS) || defined(CONFIG_SWLPS_IN_IPS) || (defined(CONFIG_PLATFORM_SPRD) && defined(CONFIG_RTL8188E)) +#if defined(CONFIG_FWLPS_IN_IPS) || defined(CONFIG_SWLPS_IN_IPS) || defined(CONFIG_RTL8188E) #ifdef CONFIG_IPS if(_FALSE == ips_leave(pri_padapter)) { @@ -1205,8 +1355,8 @@ _func_enter_; } #endif #endif //CONFIG_SWLPS_IN_IPS || (CONFIG_PLATFORM_SPRD && CONFIG_RTL8188E) - } - } + } + } } _func_exit_; @@ -2091,6 +2241,8 @@ _func_enter_; pwrctrlpriv->rf_pwrstate = rf_on; pwrctrlpriv->ips_enter_cnts=0; pwrctrlpriv->ips_leave_cnts=0; + pwrctrlpriv->lps_enter_cnts=0; + pwrctrlpriv->lps_leave_cnts=0; pwrctrlpriv->bips_processing = _FALSE; pwrctrlpriv->ips_mode = padapter->registrypriv.ips_mode; @@ -2142,6 +2294,10 @@ _func_enter_; rtw_init_timer(&pwrctrlpriv->pwr_state_check_timer, padapter, pwr_state_check_handler); + pwrctrlpriv->wowlan_mode = _FALSE; + pwrctrlpriv->wowlan_ap_mode = _FALSE; + pwrctrlpriv->wowlan_p2p_mode = _FALSE; + #ifdef CONFIG_RESUME_IN_WORKQUEUE _init_workitem(&pwrctrlpriv->resume_work, resume_workitem_callback, NULL); pwrctrlpriv->rtw_workqueue = create_singlethread_workqueue("rtw_workqueue"); @@ -2152,10 +2308,15 @@ _func_enter_; rtw_register_early_suspend(pwrctrlpriv); #endif //CONFIG_HAS_EARLYSUSPEND || CONFIG_ANDROID_POWER +#ifdef CONFIG_WOWLAN + pwrctrlpriv->wowlan_from_cmd = _FALSE; +#endif #ifdef CONFIG_PNO_SUPPORT + pwrctrlpriv->pno_inited = _FALSE; pwrctrlpriv->pnlo_info = NULL; pwrctrlpriv->pscan_info = NULL; pwrctrlpriv->pno_ssid_list = NULL; + pwrctrlpriv->pno_in_resume = _TRUE; #endif _func_exit_; @@ -2217,12 +2378,16 @@ static void resume_workitem_callback(struct work_struct *work) DBG_871X("%s\n",__FUNCTION__); rtw_resume_process(adapter); + + rtw_resume_unlock_suspend(); } void rtw_resume_in_workqueue(struct pwrctrl_priv *pwrpriv) { // accquire system's suspend lock preventing from falliing asleep while resume in workqueue - rtw_lock_suspend(); + //rtw_lock_suspend(); + + rtw_resume_lock_suspend(); #if 1 queue_work(pwrpriv->rtw_workqueue, &pwrpriv->resume_work); @@ -2250,9 +2415,7 @@ inline void rtw_set_do_late_resume(struct pwrctrl_priv *pwrpriv, bool enable) #endif #ifdef CONFIG_HAS_EARLYSUSPEND -#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) extern int rtw_resume_process(_adapter *padapter); -#endif static void rtw_early_suspend(struct early_suspend *h) { struct pwrctrl_priv *pwrpriv = container_of(h, struct pwrctrl_priv, early_suspend); @@ -2270,10 +2433,8 @@ static void rtw_late_resume(struct early_suspend *h) DBG_871X("%s\n",__FUNCTION__); if(pwrpriv->do_late_resume) { - #if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) rtw_set_do_late_resume(pwrpriv, _FALSE); rtw_resume_process(adapter); - #endif } } @@ -2420,12 +2581,6 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller) } #endif - //System suspend is not allowed to wakeup - if((pwrpriv->bInternalAutoSuspend == _FALSE) && (_TRUE == pwrpriv->bInSuspend )){ - ret = _FAIL; - goto exit; - } - if (pwrpriv->bInternalAutoSuspend == _FALSE && pwrpriv->bInSuspend) { DBG_871X("%s wait bInSuspend...\n", __func__); while (pwrpriv->bInSuspend @@ -2440,6 +2595,12 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller) DBG_871X("%s wait bInSuspend done\n", __func__); } + //System suspend is not allowed to wakeup + if((pwrpriv->bInternalAutoSuspend == _FALSE) && (_TRUE == pwrpriv->bInSuspend )){ + ret = _FAIL; + goto exit; + } + //block??? if((pwrpriv->bInternalAutoSuspend == _TRUE) && (padapter->net_closed == _TRUE)) { ret = _FAIL; diff --git a/backports/drivers/realtek/rtl8812au/core/rtw_recv.c b/backports/drivers/realtek/rtl8812au/core/rtw_recv.c index fd127c64854584..ae8f0cfe8c6683 100755 --- a/backports/drivers/realtek/rtl8812au/core/rtw_recv.c +++ b/backports/drivers/realtek/rtl8812au/core/rtw_recv.c @@ -20,6 +20,7 @@ #define _RTW_RECV_C_ #include +#include #if defined (PLATFORM_LINUX) && defined (PLATFORM_WINDOWS) @@ -75,6 +76,10 @@ _func_enter_; precvpriv->free_recvframe_cnt = NR_RECVFRAME; + precvpriv->sink_udpport = 0; + precvpriv->pre_rtp_rxseq = 0; + precvpriv->cur_rtp_rxseq = 0; + rtw_os_recv_resource_init(precvpriv, padapter); precvpriv->pallocated_frame_buf = rtw_zvmalloc(NR_RECVFRAME * sizeof(union recv_frame) + RXFRAME_ALIGN_SZ); @@ -109,7 +114,7 @@ _func_enter_; #ifdef CONFIG_USB_HCI - precvpriv->rx_pending_cnt=1; + ATOMIC_SET(&(precvpriv->rx_pending_cnt), 1); _rtw_init_sema(&precvpriv->allrxreturnevt, 0); @@ -606,8 +611,11 @@ union recv_frame * decryptor(_adapter *padapter,union recv_frame *precv_frame) struct security_priv *psecuritypriv=&padapter->securitypriv; union recv_frame *return_packet=precv_frame; u32 res=_SUCCESS; + _func_enter_; + DBG_COUNTER(padapter->rx_logs.core_rx_post_decrypt); + RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("prxstat->decrypted=%x prxattrib->encrypt = 0x%03x\n",prxattrib->bdecrypted,prxattrib->encrypt)); if(prxattrib->encrypt>0) @@ -639,7 +647,7 @@ _func_enter_; #ifdef CONFIG_CONCURRENT_MODE if(!IS_MCAST(prxattrib->ra))//bc/mc packets use sw decryption for concurrent mode #endif - psecuritypriv->hw_decrypted=_FALSE; + psecuritypriv->hw_decrypted=_FALSE; #ifdef DBG_RX_DECRYPTOR DBG_871X("[%s] %d:prxstat->bdecrypted:%d, prxattrib->encrypt:%d, Setting psecuritypriv->hw_decrypted = %d\n", @@ -653,16 +661,20 @@ _func_enter_; switch(prxattrib->encrypt){ case _WEP40_: case _WEP104_: + DBG_COUNTER(padapter->rx_logs.core_rx_post_decrypt_wep); rtw_wep_decrypt(padapter, (u8 *)precv_frame); break; case _TKIP_: + DBG_COUNTER(padapter->rx_logs.core_rx_post_decrypt_tkip); res = rtw_tkip_decrypt(padapter, (u8 *)precv_frame); break; case _AES_: + DBG_COUNTER(padapter->rx_logs.core_rx_post_decrypt_aes); res = rtw_aes_decrypt(padapter, (u8 * )precv_frame); break; #ifdef CONFIG_WAPI_SUPPORT case _SMS4_: + DBG_COUNTER(padapter->rx_logs.core_rx_post_decrypt_wapi); rtw_sms4_decrypt(padapter, (u8 * )precv_frame); break; #endif @@ -690,6 +702,8 @@ _func_enter_; else #endif { + DBG_COUNTER(padapter->rx_logs.core_rx_post_decrypt_hw); + psecuritypriv->hw_decrypted=_TRUE; #ifdef DBG_RX_DECRYPTOR DBG_871X("[%s] %d:prxstat->bdecrypted:%d, prxattrib->encrypt:%d, Setting psecuritypriv->hw_decrypted = %d\n", @@ -700,10 +714,10 @@ _func_enter_; psecuritypriv->hw_decrypted); #endif - } } else { + DBG_COUNTER(padapter->rx_logs.core_rx_post_decrypt_unknown); #ifdef DBG_RX_DECRYPTOR DBG_871X("[%s] %d:prxstat->bdecrypted:%d, prxattrib->encrypt:%d, Setting psecuritypriv->hw_decrypted = %d\n", __FUNCTION__, @@ -800,16 +814,15 @@ _func_enter_; prtnframe=precv_frame; //check is the EAPOL frame or not (Rekey) - if(ether_type == eapol_type){ - - RT_TRACE(_module_rtl871x_recv_c_,_drv_notice_,("########portctrl:ether_type == 0x888e\n")); + //if(ether_type == eapol_type){ + // RT_TRACE(_module_rtl871x_recv_c_,_drv_notice_,("########portctrl:ether_type == 0x888e\n")); //check Rekey - prtnframe=precv_frame; - } - else{ - RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("########portctrl:ether_type=0x%04x\n", ether_type)); - } + // prtnframe=precv_frame; + //} + //else{ + // RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("########portctrl:ether_type=0x%04x\n", ether_type)); + //} } } else @@ -986,10 +999,10 @@ sint OnTDLS(_adapter *adapter, union recv_frame *precv_frame) u8 category_field = 1; #ifdef CONFIG_WFD u8 WFA_OUI[3] = { 0x50, 0x6f, 0x9a }; -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ struct tdls_info *ptdlsinfo = &(adapter->tdlsinfo); - //point to action field + /* point to action field */ paction+=pattrib->hdrlen + pattrib->iv_len + SNAP_SIZE @@ -997,82 +1010,76 @@ sint OnTDLS(_adapter *adapter, union recv_frame *precv_frame) + PAYLOAD_TYPE_LEN + category_field; - if(ptdlsinfo->tdls_enable == _FALSE) - { + if (ptdlsinfo->tdls_enable == _FALSE) { DBG_871X("recv tdls frame, " "but tdls haven't enabled\n"); ret = _FAIL; return ret; } + + DBG_871X("[TDLS] Recv %s from "MAC_FMT"\n", rtw_tdls_action_txt(*paction), MAC_ARG(pattrib->src)); switch(*paction){ - case TDLS_SETUP_REQUEST: - DBG_871X("recv tdls setup request frame from "MAC_FMT"\n", MAC_ARG(pattrib->src)); - ret=On_TDLS_Setup_Req(adapter, precv_frame); - break; - case TDLS_SETUP_RESPONSE: - DBG_871X("recv tdls setup response frame from "MAC_FMT"\n", MAC_ARG(pattrib->src)); - ret=On_TDLS_Setup_Rsp(adapter, precv_frame); - break; - case TDLS_SETUP_CONFIRM: - DBG_871X("recv tdls setup confirm frame from "MAC_FMT"\n", MAC_ARG(pattrib->src)); - ret=On_TDLS_Setup_Cfm(adapter, precv_frame); - break; - case TDLS_TEARDOWN: - DBG_871X("recv tdls teardown, free sta_info from "MAC_FMT"\n", MAC_ARG(pattrib->src)); - ret=On_TDLS_Teardown(adapter, precv_frame); - break; - case TDLS_DISCOVERY_REQUEST: - DBG_871X("recv tdls discovery request frame from "MAC_FMT"\n", MAC_ARG(pattrib->src)); - ret=On_TDLS_Dis_Req(adapter, precv_frame); - break; - case TDLS_PEER_TRAFFIC_INDICATION: - DBG_871X("recv tdls peer traffic indication frame\n"); - ret=On_TDLS_Peer_Traffic_Indication(adapter, precv_frame); - break; - case TDLS_PEER_TRAFFIC_RESPONSE: - DBG_871X("recv tdls peer traffic response frame\n"); - ret=On_TDLS_Peer_Traffic_Rsp(adapter, precv_frame); - break; - case TDLS_CHANNEL_SWITCH_REQUEST: - DBG_871X("recv tdls channel switch request frame\n"); - ret=On_TDLS_Ch_Switch_Req(adapter, precv_frame); - break; - case TDLS_CHANNEL_SWITCH_RESPONSE: - DBG_871X("recv tdls channel switch response frame\n"); - ret=On_TDLS_Ch_Switch_Rsp(adapter, precv_frame); - break; + case TDLS_SETUP_REQUEST: + ret=On_TDLS_Setup_Req(adapter, precv_frame); + break; + case TDLS_SETUP_RESPONSE: + ret=On_TDLS_Setup_Rsp(adapter, precv_frame); + break; + case TDLS_SETUP_CONFIRM: + ret=On_TDLS_Setup_Cfm(adapter, precv_frame); + break; + case TDLS_TEARDOWN: + ret=On_TDLS_Teardown(adapter, precv_frame); + break; + case TDLS_DISCOVERY_REQUEST: + ret=On_TDLS_Dis_Req(adapter, precv_frame); + break; + case TDLS_PEER_TRAFFIC_INDICATION: + ret=On_TDLS_Peer_Traffic_Indication(adapter, precv_frame); + break; + case TDLS_PEER_TRAFFIC_RESPONSE: + ret=On_TDLS_Peer_Traffic_Rsp(adapter, precv_frame); + break; +#ifdef CONFIG_TDLS_CH_SW + case TDLS_CHANNEL_SWITCH_REQUEST: + ret=On_TDLS_Ch_Switch_Req(adapter, precv_frame); + break; + case TDLS_CHANNEL_SWITCH_RESPONSE: + ret=On_TDLS_Ch_Switch_Rsp(adapter, precv_frame); + break; +#endif #ifdef CONFIG_WFD - case 0x50: //First byte of WFA OUI - if( _rtw_memcmp(WFA_OUI, (paction), 3) ) - { - if( *(paction + 3) == 0x04) //Probe request frame - { - //WFDTDLS: for sigma test, do not setup direct link automatically - ptdlsinfo->dev_discovered = 1; - DBG_871X("recv tunneled probe request frame\n"); - issue_tunneled_probe_rsp(adapter, precv_frame); - } - if( *(paction + 3) == 0x05) //Probe response frame - { - //WFDTDLS: for sigma test, do not setup direct link automatically - ptdlsinfo->dev_discovered = 1; - DBG_871X("recv tunneled probe response frame\n"); - } + /* First byte of WFA OUI */ + case 0x50: + if (_rtw_memcmp(WFA_OUI, paction, 3)) { + /* Probe request frame */ + if (*(paction + 3) == 0x04) { + /* WFDTDLS: for sigma test, do not setup direct link automatically */ + ptdlsinfo->dev_discovered = _TRUE; + DBG_871X("recv tunneled probe request frame\n"); + issue_tunneled_probe_rsp(adapter, precv_frame); } - break; -#endif //CONFIG_WFD - default: - DBG_871X("receive TDLS frame %d but not support\n", *paction); - ret=_FAIL; - break; + /* Probe response frame */ + if (*(paction + 3) == 0x05) { + /* WFDTDLS: for sigma test, do not setup direct link automatically */ + ptdlsinfo->dev_discovered = _TRUE; + DBG_871X("recv tunneled probe response frame\n"); + } + } + break; +#endif /* CONFIG_WFD */ + default: + DBG_871X("receive TDLS frame %d but not support\n", *paction); + ret=_FAIL; + break; } exit: return ret; } -#endif +#endif /* CONFIG_TDLS */ void count_rx_stats(_adapter *padapter, union recv_frame *prframe, struct sta_info*sta); void count_rx_stats(_adapter *padapter, union recv_frame *prframe, struct sta_info*sta) @@ -1105,7 +1112,6 @@ void count_rx_stats(_adapter *padapter, union recv_frame *prframe, struct sta_in pstats->rx_bytes += sz; #ifdef CONFIG_TDLS - if(psta->tdls_sta_state & TDLS_LINKED_STATE) { struct sta_info *pap_sta = NULL; @@ -1149,6 +1155,9 @@ sint sta2sta_data_frame( #ifdef CONFIG_TDLS struct tdls_info *ptdlsinfo = &adapter->tdlsinfo; +#ifdef CONFIG_TDLS_CH_SW + struct tdls_ch_switch *pchsw_info = &ptdlsinfo->chsw_info; +#endif struct sta_info *ptdls_sta=NULL; u8 *psnap_type=ptr+pattrib->hdrlen + pattrib->iv_len+SNAP_SIZE; //frame body located after [+2]: ether-type, [+1]: payload type @@ -1189,69 +1198,66 @@ _func_enter_; { #ifdef CONFIG_TDLS - //direct link data transfer - if(ptdlsinfo->link_established == _TRUE){ + /* direct link data transfer */ + if (ptdlsinfo->link_established == _TRUE) { ptdls_sta = rtw_get_stainfo(pstapriv, pattrib->src); - if(ptdls_sta==NULL) - { + if (ptdls_sta == NULL) { ret=_FAIL; goto exit; - } - else if(ptdls_sta->tdls_sta_state&TDLS_LINKED_STATE) - { - // filter packets that SA is myself or multicast or broadcast - if (_rtw_memcmp(myhwaddr, pattrib->src, ETH_ALEN)){ + } else if (ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE) { + /* filter packets that SA is myself or multicast or broadcast */ + if (_rtw_memcmp(myhwaddr, pattrib->src, ETH_ALEN)) { ret= _FAIL; goto exit; } - // da should be for me - if((!_rtw_memcmp(myhwaddr, pattrib->dst, ETH_ALEN))&& (!bmcast)) - { + /* da should be for me */ + if ((!_rtw_memcmp(myhwaddr, pattrib->dst, ETH_ALEN)) && (!bmcast)) { ret= _FAIL; goto exit; } - // check BSSID - if( _rtw_memcmp(pattrib->bssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) || + /* check BSSID */ + if (_rtw_memcmp(pattrib->bssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) || _rtw_memcmp(mybssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) || - (!_rtw_memcmp(pattrib->bssid, mybssid, ETH_ALEN)) ) - { + (!_rtw_memcmp(pattrib->bssid, mybssid, ETH_ALEN))) { ret= _FAIL; goto exit; } - //process UAPSD tdls sta +#ifdef CONFIG_TDLS_CH_SW + pchsw_info->ch_sw_state |= TDLS_PEER_AT_OFF_STATE; + + if(ATOMIC_READ(&pchsw_info->chsw_on) == _TRUE) { + if (!(pchsw_info->ch_sw_state & TDLS_PEER_AT_OFF_STATE)) { + DBG_871X("%s %d\n", __FUNCTION__, __LINE__); + issue_nulldata_to_TDLS_peer_STA(adapter, ptdls_sta->hwaddr, 0, 0, 0); + pchsw_info->ch_sw_state |= TDLS_PEER_AT_OFF_STATE; + /* On_TDLS_Peer_Traffic_Rsp(adapter, precv_frame); */ + } + } +#endif + + /* process UAPSD tdls sta */ process_pwrbit_data(adapter, precv_frame); - // if NULL-frame, check pwrbit - if ((GetFrameSubType(ptr) & WIFI_DATA_NULL) == WIFI_DATA_NULL) - { - //NULL-frame with pwrbit=1, buffer_STA should buffer frames for sleep_STA - if(GetPwrMgt(ptr)) - { + /* if NULL-frame, check pwrbit */ + if ((GetFrameSubType(ptr) & WIFI_DATA_NULL) == WIFI_DATA_NULL) { + /* NULL-frame with pwrbit=1, buffer_STA should buffer frames for sleep_STA */ + if (GetPwrMgt(ptr)) { + /* it would be triggered when we are off channel and receiving NULL DATA */ + /* we can confirm that peer STA is at off channel */ DBG_871X("TDLS: recv peer null frame with pwr bit 1\n"); //ptdls_sta->tdls_sta_state|=TDLS_PEER_SLEEP_STATE; - // it would be triggered when we are off channel and receiving NULL DATA - // we can confirm that peer STA is at off channel - } - else if(ptdls_sta->tdls_sta_state&TDLS_CH_SWITCH_ON_STATE) - { - if((ptdls_sta->tdls_sta_state & TDLS_PEER_AT_OFF_STATE) != TDLS_PEER_AT_OFF_STATE) - { - issue_nulldata_to_TDLS_peer_STA(adapter, ptdls_sta->hwaddr, 0, 0, 0); - ptdls_sta->tdls_sta_state |= TDLS_PEER_AT_OFF_STATE; - On_TDLS_Peer_Traffic_Rsp(adapter, precv_frame); - } } - //[TDLS] TODO: Updated BSSID's seq. - DBG_871X("drop Null Data\n"); + /* TODO: Updated BSSID's seq. */ + //DBG_871X("drop Null Data\n"); ptdls_sta->tdls_sta_state &= ~(TDLS_WAIT_PTR_STATE); ret= _FAIL; goto exit; } - //receive some of all TDLS management frames, process it at ON_TDLS - if((_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_TDLS, 2))){ + /* receive some of all TDLS management frames, process it at ON_TDLS */ + if (_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_TDLS, 2)) { ret= OnTDLS(adapter, precv_frame); goto exit; } @@ -1268,7 +1274,7 @@ _func_enter_; } else -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ { // For Station mode, sa and bssid should always be BSSID, and DA is my mac-address if(!_rtw_memcmp(pattrib->bssid, pattrib->src, ETH_ALEN) ) @@ -1339,7 +1345,7 @@ _func_enter_; if (adapter->registrypriv.mp_mode == 1) { if(check_fwstate(pmlmepriv, WIFI_MP_STATE) == _TRUE) - adapter->mppriv.rx_pktloss++; + adapter->mppriv.rx_pktloss++; } #endif ret= _FAIL; @@ -1461,7 +1467,8 @@ _func_enter_; _rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN); // - _rtw_memcpy(pattrib->bssid, mybssid, ETH_ALEN); + if(adapter->mppriv.bRTWSmbCfg==_FALSE) + _rtw_memcpy(pattrib->bssid, mybssid, ETH_ALEN); *psta = rtw_get_stainfo(pstapriv, pattrib->bssid); // get sta_info @@ -1489,9 +1496,20 @@ _func_enter_; *psta = rtw_get_stainfo(pstapriv, pattrib->bssid); // get sta_info if (*psta == NULL) { - DBG_871X("issue_deauth to the ap=" MAC_FMT " for the reason(7)\n", MAC_ARG(pattrib->bssid)); - issue_deauth(adapter, pattrib->bssid, WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA); + //for AP multicast issue , modify by yiwei + static u32 send_issue_deauth_time=0; + + //DBG_871X("After send deauth , %u ms has elapsed.\n", rtw_get_passing_time_ms(send_issue_deauth_time)); + + if(rtw_get_passing_time_ms(send_issue_deauth_time) > 10000 || send_issue_deauth_time == 0 ) + { + send_issue_deauth_time = rtw_get_current_time(); + + DBG_871X("issue_deauth to the ap=" MAC_FMT " for the reason(7)\n", MAC_ARG(pattrib->bssid)); + + issue_deauth(adapter, pattrib->bssid, WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA); + } } } @@ -1561,6 +1579,30 @@ _func_enter_; goto exit; } } + else if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == _TRUE) && + (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) ) + { + //DBG_871X("%s ,in WIFI_MP_STATE \n",__func__); + _rtw_memcpy(pattrib->dst, GetAddr1Ptr(ptr), ETH_ALEN); + _rtw_memcpy(pattrib->src, GetAddr2Ptr(ptr), ETH_ALEN); + _rtw_memcpy(pattrib->bssid, GetAddr3Ptr(ptr), ETH_ALEN); + _rtw_memcpy(pattrib->ra, pattrib->dst, ETH_ALEN); + _rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN); + // + if(adapter->mppriv.bRTWSmbCfg == _FALSE) + _rtw_memcpy(pattrib->bssid, mybssid, ETH_ALEN); + + *psta = rtw_get_stainfo(pstapriv, pattrib->bssid); // get sta_info + if (*psta == NULL) { + RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("can't get psta under MP_MODE ; drop pkt\n")); + #ifdef DBG_RX_DROP_FRAME + DBG_871X("DBG_RX_DROP_FRAME %s can't get psta under WIFI_MP_STATE ; drop pkt\n", __FUNCTION__); + #endif + ret= _FAIL; + goto exit; + } + + } else { u8 *myhwaddr = myid(&adapter->eeprompriv); if (!_rtw_memcmp(pattrib->ra, myhwaddr, ETH_ALEN)) { @@ -1584,10 +1626,10 @@ _func_exit_; sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame); sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame) { -#ifdef CONFIG_AP_MODE struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib; struct sta_priv *pstapriv = &padapter->stapriv; u8 *pframe = precv_frame->u.hdr.rx_data; + struct sta_info *psta=NULL; //uint len = precv_frame->u.hdr.len; //DBG_871X("+validate_recv_ctrl_frame\n"); @@ -1603,24 +1645,28 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame) return _FAIL; } + psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe)); + if (psta==NULL) + { + return _FAIL; + } + + //for rx pkt statistics + psta->sta_stats.rx_ctrl_pkts++; + //only handle ps-poll if(GetFrameSubType(pframe) == WIFI_PSPOLL) { +#ifdef CONFIG_AP_MODE u16 aid; u8 wmmps_ac=0; - struct sta_info *psta=NULL; aid = GetAid(pframe); - psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe)); - - if((psta==NULL) || (psta->aid!=aid)) + if(psta->aid!=aid) { return _FAIL; } - //for rx pkt statistics - psta->sta_stats.rx_ctrl_pkts++; - switch(pattrib->priority) { case 1: @@ -1677,20 +1723,20 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame) if(psta->sleepq_len>0) pxmitframe->attrib.mdata = 1; - else + else pxmitframe->attrib.mdata = 0; pxmitframe->attrib.triggered = 1; - //DBG_871X("handling ps-poll, q_len=%d, tim=%x\n", psta->sleepq_len, pstapriv->tim_bitmap); + //DBG_871X("handling ps-poll, q_len=%d, tim=%x\n", psta->sleepq_len, pstapriv->tim_bitmap); #if 0 - _exit_critical_bh(&psta->sleep_q.lock, &irqL); + _exit_critical_bh(&psta->sleep_q.lock, &irqL); if(rtw_hal_xmit(padapter, pxmitframe) == _TRUE) - { + { rtw_os_xmit_complete(padapter, pxmitframe); } - _enter_critical_bh(&psta->sleep_q.lock, &irqL); + _enter_critical_bh(&psta->sleep_q.lock, &irqL); #endif rtw_hal_xmitframe_enqueue(padapter, pxmitframe); @@ -1722,7 +1768,7 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame) DBG_871X("no buffered packets to xmit\n"); //issue nulldata with More data bit = 0 to indicate we have no buffered packets - issue_nulldata_in_interrupt(padapter, psta->hwaddr); + issue_nulldata_in_interrupt(padapter, psta->hwaddr, 0); } else { @@ -1736,14 +1782,15 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame) //update_BCNTIM(padapter); update_beacon(padapter, _TIM_IE_, NULL, _TRUE); } - } - } - +#endif //CONFIG_AP_MODE } - + else if(GetFrameSubType(pframe) == WIFI_NDPA) { +#ifdef CONFIG_BEAMFORMING + beamforming_get_ndpa_frame(padapter, precv_frame); #endif + } return _FAIL; @@ -1955,9 +2002,9 @@ _func_enter_; pattrib->hdrlen = pattrib->to_fr_ds==3 ? 32 : 26; if(pattrib->priority!=0 && pattrib->priority!=3) - { adapter->recvpriv.bIsAnyNonBEPkts = _TRUE; - } + else + adapter->recvpriv.bIsAnyNonBEPkts = _FALSE; } else { @@ -1984,14 +2031,6 @@ _func_enter_; goto exit; } -#if 0 - if(psta->tdls_sta_state & TDLS_LINKED_STATE ) - { - if(psta->dot118021XPrivacy==_AES_) - pattrib->encrypt=psta->dot118021XPrivacy; - } -#endif //CONFIG_TDLS - if(pattrib->privacy){ RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("validate_recv_data_frame:pattrib->privacy=%x\n", pattrib->privacy)); @@ -2062,7 +2101,7 @@ static sint validate_80211w_mgmt(_adapter *adapter, union recv_frame *precv_fram DBG_871X("%s mgmt allocate fail !!!!!!!!!\n", __FUNCTION__); goto validate_80211w_fail; } - /*//dump the packet content before decrypt + /* //dump the packet content before decrypt { int pp; printk("pattrib->pktlen = %d =>", pattrib->pkt_len); @@ -2079,7 +2118,7 @@ static sint validate_80211w_mgmt(_adapter *adapter, union recv_frame *precv_fram //remove the iv and icv length pattrib->pkt_len = pattrib->pkt_len - pattrib->iv_len - pattrib->icv_len; rtw_mfree(mgmt_DATA, data_len); - /*//print packet content after decryption + /* //print packet content after decryption { int pp; printk("after decryption pattrib->pktlen = %d @@=>", pattrib->pkt_len); @@ -2106,9 +2145,9 @@ static sint validate_80211w_mgmt(_adapter *adapter, union recv_frame *precv_fram } else if(BIP_ret == RTW_RX_HANDLED) { - //DBG_871X("802.11w recv none protected packet\n"); - //issue sa query request - issue_action_SA_Query(adapter, NULL, 0, 0); + DBG_871X("802.11w recv none protected packet\n"); + //drop pkt, don't issue sa query request + //issue_action_SA_Query(adapter, NULL, 0, 0); goto validate_80211w_fail; } }//802.11w protect @@ -2129,9 +2168,14 @@ static sint validate_80211w_mgmt(_adapter *adapter, union recv_frame *precv_fram } else if(subtype == WIFI_DEAUTH || subtype == WIFI_DISASSOC) { - DBG_871X("802.11w recv none protected packet\n"); - //issue sa query request - issue_action_SA_Query(adapter, NULL, 0, 0); + unsigned short reason; + reason = le16_to_cpu(*(unsigned short *)(ptr + WLAN_HDR_A3_LEN)); + DBG_871X("802.11w recv none protected packet, reason=%d\n", reason); + if(reason == 6 || reason == 7) + { + //issue sa query request + issue_action_SA_Query(adapter, NULL, 0, 0); + } goto validate_80211w_fail; } } @@ -2144,6 +2188,17 @@ static sint validate_80211w_mgmt(_adapter *adapter, union recv_frame *precv_fram } #endif //CONFIG_IEEE80211W +static inline void dump_rx_packet(u8 *ptr) +{ + int i; + + DBG_871X("############################# \n"); + for(i=0; i<64;i=i+8) + DBG_871X("%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:\n", *(ptr+i), + *(ptr+i+1), *(ptr+i+2) ,*(ptr+i+3) ,*(ptr+i+4),*(ptr+i+5), *(ptr+i+6), *(ptr+i+7)); + DBG_871X("############################# \n"); +} + sint validate_recv_frame(_adapter *adapter, union recv_frame *precv_frame); sint validate_recv_frame(_adapter *adapter, union recv_frame *precv_frame) { @@ -2176,7 +2231,6 @@ sint validate_recv_frame(_adapter *adapter, union recv_frame *precv_frame) _func_enter_; - #ifdef CONFIG_FIND_BEST_CHANNEL if (pmlmeext->sitesurvey_res.state == SCAN_PROCESS) { int ch_set_idx = rtw_ch_set_search_ch(pmlmeext->channel_set, rtw_get_oper_ch(adapter)); @@ -2210,6 +2264,7 @@ _func_enter_; if(ver!=0){ RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("validate_recv_data_frame fail! (ver!=0)\n")); retval= _FAIL; + DBG_COUNTER(adapter->rx_logs.core_rx_pre_ver_err); goto exit; } @@ -2234,46 +2289,23 @@ _func_enter_; { u8 bDumpRxPkt; rtw_hal_get_def_var(adapter, HAL_DEF_DBG_DUMP_RXPKT, &(bDumpRxPkt)); - if(bDumpRxPkt ==1){//dump all rx packets - int i; - DBG_871X("############################# \n"); - - for(i=0; i<64;i=i+8) - DBG_871X("%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:\n", *(ptr+i), - *(ptr+i+1), *(ptr+i+2) ,*(ptr+i+3) ,*(ptr+i+4),*(ptr+i+5), *(ptr+i+6), *(ptr+i+7)); - DBG_871X("############################# \n"); - } - else if(bDumpRxPkt ==2){ - if(type== WIFI_MGT_TYPE){ - int i; - DBG_871X("############################# \n"); - - for(i=0; i<64;i=i+8) - DBG_871X("%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:\n", *(ptr+i), - *(ptr+i+1), *(ptr+i+2) ,*(ptr+i+3) ,*(ptr+i+4),*(ptr+i+5), *(ptr+i+6), *(ptr+i+7)); - DBG_871X("############################# \n"); - } - } - else if(bDumpRxPkt ==3){ - if(type== WIFI_DATA_TYPE){ - int i; - DBG_871X("############################# \n"); - - for(i=0; i<64;i=i+8) - DBG_871X("%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:\n", *(ptr+i), - *(ptr+i+1), *(ptr+i+2) ,*(ptr+i+3) ,*(ptr+i+4),*(ptr+i+5), *(ptr+i+6), *(ptr+i+7)); - DBG_871X("############################# \n"); - } - } + if (bDumpRxPkt == 1) //dump all rx packets + dump_rx_packet(ptr); + else if ((bDumpRxPkt == 2) && (type == WIFI_MGT_TYPE)) + dump_rx_packet(ptr); + else if ((bDumpRxPkt == 3) && (type == WIFI_DATA_TYPE)) + dump_rx_packet(ptr); } #endif switch (type) { case WIFI_MGT_TYPE: //mgnt + DBG_COUNTER(adapter->rx_logs.core_rx_pre_mgmt); #ifdef CONFIG_IEEE80211W if(validate_80211w_mgmt(adapter, precv_frame) == _FAIL) { retval = _FAIL; + DBG_COUNTER(padapter->rx_logs.core_rx_pre_mgmt_err_80211w); break; } #endif //CONFIG_IEEE80211W @@ -2282,18 +2314,22 @@ _func_enter_; if (retval == _FAIL) { RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("validate_recv_mgnt_frame fail\n")); + DBG_COUNTER(adapter->rx_logs.core_rx_pre_mgmt_err); } retval = _FAIL; // only data frame return _SUCCESS break; case WIFI_CTRL_TYPE: //ctrl + DBG_COUNTER(adapter->rx_logs.core_rx_pre_ctrl); retval = validate_recv_ctrl_frame(adapter, precv_frame); if (retval == _FAIL) { RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("validate_recv_ctrl_frame fail\n")); + DBG_COUNTER(adapter->rx_logs.core_rx_pre_ctrl_err); } retval = _FAIL; // only data frame return _SUCCESS break; case WIFI_DATA_TYPE: //data + DBG_COUNTER(adapter->rx_logs.core_rx_pre_data); #ifdef CONFIG_WAPI_SUPPORT if(pattrib->qos) external_len = 2; @@ -2312,6 +2348,7 @@ _func_enter_; else { retval = _FAIL; + DBG_COUNTER(adapter->rx_logs.core_rx_pre_data_wapi_seq_err); break; } } @@ -2320,6 +2357,7 @@ _func_enter_; if(rtw_wapi_drop_for_key_absent(adapter,GetAddr2Ptr(ptr))){ retval=_FAIL; WAPI_TRACE(WAPI_RX,"drop for key absent for rx \n"); + DBG_COUNTER(adapter->rx_logs.core_rx_pre_data_wapi_key_err); break; } } @@ -2333,9 +2371,30 @@ _func_enter_; struct recv_priv *precvpriv = &adapter->recvpriv; //RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("validate_recv_data_frame fail\n")); precvpriv->rx_drop++; + DBG_COUNTER(adapter->rx_logs.core_rx_pre_data_err); + } + else if (retval == _SUCCESS) + { +#ifdef DBG_RX_DUMP_EAP + u8 bDumpRxPkt; + u16 eth_type; + + // dump eapol + rtw_hal_get_def_var(adapter, HAL_DEF_DBG_DUMP_RXPKT, &(bDumpRxPkt)); + // get ether_type + _rtw_memcpy(ð_type, ptr + pattrib->hdrlen + pattrib->iv_len + LLC_HEADER_SIZE, 2); + eth_type = ntohs((unsigned short) eth_type); + if ((bDumpRxPkt == 4) && (eth_type == 0x888e)) + dump_rx_packet(ptr); +#endif + } + else + { + DBG_COUNTER(adapter->rx_logs.core_rx_pre_data_handled); } break; default: + DBG_COUNTER(adapter->rx_logs.core_rx_pre_unknown); RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("validate_recv_data_frame fail! type=0x%x\n", type)); #ifdef DBG_RX_DROP_FRAME DBG_871X("DBG_RX_DROP_FRAME validate_recv_data_frame fail! type=0x%x\n", type); @@ -2447,21 +2506,32 @@ _func_enter_; eth_type = 0x8712; // append rx status for mp test packets ptr = recvframe_pull(precvframe, (rmv_len-sizeof(struct ethhdr)+2)-24); + if (!ptr) { + ret = _FAIL; + goto exiting; + } _rtw_memcpy(ptr, get_rxmem(precvframe), 24); ptr+=24; } else { ptr = recvframe_pull(precvframe, (rmv_len-sizeof(struct ethhdr)+ (bsnaphdr?2:0))); + if (!ptr) { + ret = _FAIL; + goto exiting; + } } - _rtw_memcpy(ptr, pattrib->dst, ETH_ALEN); - _rtw_memcpy(ptr+ETH_ALEN, pattrib->src, ETH_ALEN); + if (ptr) { + _rtw_memcpy(ptr, pattrib->dst, ETH_ALEN); + _rtw_memcpy(ptr+ETH_ALEN, pattrib->src, ETH_ALEN); - if(!bsnaphdr) { - len = htons(len); - _rtw_memcpy(ptr+12, &len, 2); + if(!bsnaphdr) { + len = htons(len); + _rtw_memcpy(ptr+12, &len, 2); + } } +exiting: _func_exit_; return ret; @@ -2964,6 +3034,9 @@ int amsdu_to_msdu(_adapter *padapter, union recv_frame *prframe) int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_num); int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_num) { + PADAPTER padapter = preorder_ctrl->padapter; + struct dvobj_priv *psdpriv = padapter->dvobj; + struct debug_priv *pdbgpriv = &psdpriv->drv_dbg; u8 wsize = preorder_ctrl->wsize_b; u16 wend = (preorder_ctrl->indicate_seq + wsize -1) & 0xFFF;//% 4096; @@ -3020,7 +3093,7 @@ int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_num) preorder_ctrl->indicate_seq = seq_num + 1 -wsize; else preorder_ctrl->indicate_seq = 0xFFF - (wsize - (seq_num + 1)) + 1; - + pdbgpriv->dbg_rx_ampdu_window_shift_cnt++; #ifdef DBG_RX_SEQ DBG_871X("DBG_RX_SEQ %s:%d SN_LESS(wend, seq_num) IndicateSeq: %d, NewSeq: %d\n", __FUNCTION__, __LINE__, preorder_ctrl->indicate_seq, seq_num); @@ -3094,6 +3167,19 @@ int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, union rec } +void recv_indicatepkts_pkt_loss_cnt(struct debug_priv *pdbgpriv, u64 prev_seq, u64 current_seq); +void recv_indicatepkts_pkt_loss_cnt(struct debug_priv *pdbgpriv, u64 prev_seq, u64 current_seq) +{ + if(current_seq < prev_seq) + { + pdbgpriv->dbg_rx_ampdu_loss_count+= (4096 + current_seq - prev_seq); + + } + else + { + pdbgpriv->dbg_rx_ampdu_loss_count+= (current_seq - prev_seq); + } +} int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ctrl *preorder_ctrl, int bforced); int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ctrl *preorder_ctrl, int bforced) { @@ -3106,6 +3192,10 @@ int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ctrl *pre int bPktInBuf = _FALSE; struct recv_priv *precvpriv = &padapter->recvpriv; _queue *ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue; + struct dvobj_priv *psdpriv = padapter->dvobj; + struct debug_priv *pdbgpriv = &psdpriv->drv_dbg; + + DBG_COUNTER(padapter->rx_logs.core_rx_post_indicate_in_oder); //DbgPrint("+recv_indicatepkts_in_order\n"); @@ -3124,6 +3214,7 @@ int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ctrl *pre // Handling some condition for forced indicate case. if(bforced==_TRUE) { + pdbgpriv->dbg_rx_ampdu_forced_indicate_count++; if(rtw_is_list_empty(phead)) { // _exit_critical_ex(&ppending_recvframe_queue->lock, &irql); @@ -3131,14 +3222,14 @@ int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ctrl *pre return _TRUE; } - prframe = LIST_CONTAINOR(plist, union recv_frame, u); - pattrib = &prframe->u.hdr.attrib; + prframe = LIST_CONTAINOR(plist, union recv_frame, u); + pattrib = &prframe->u.hdr.attrib; #ifdef DBG_RX_SEQ DBG_871X("DBG_RX_SEQ %s:%d IndicateSeq: %d, NewSeq: %d\n", __FUNCTION__, __LINE__, preorder_ctrl->indicate_seq, pattrib->seq_num); #endif - + recv_indicatepkts_pkt_loss_cnt(pdbgpriv,preorder_ctrl->indicate_seq,pattrib->seq_num); preorder_ctrl->indicate_seq = pattrib->seq_num; } @@ -3274,11 +3365,23 @@ int recv_indicatepkt_reorder(_adapter *padapter, union recv_frame *prframe) struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib; struct recv_reorder_ctrl *preorder_ctrl = prframe->u.hdr.preorder_ctrl; _queue *ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue; + struct dvobj_priv *psdpriv = padapter->dvobj; + struct debug_priv *pdbgpriv = &psdpriv->drv_dbg; + + DBG_COUNTER(padapter->rx_logs.core_rx_post_indicate_reoder); if(!pattrib->amsdu) { //s1. - wlanhdr_to_ethhdr(prframe); + retval = wlanhdr_to_ethhdr(prframe); + if (retval != _SUCCESS) + { + RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("wlanhdr_to_ethhdr: drop pkt \n")); + #ifdef DBG_RX_DROP_FRAME + DBG_871X("DBG_RX_DROP_FRAME %s wlanhdr_to_ethhdr error!\n", __FUNCTION__); + #endif + return retval; + } //if ((pattrib->qos!=1) /*|| pattrib->priority!=0 || IS_MCAST(pattrib->ra)*/ // || (pattrib->eth_type==0x0806) || (pattrib->ack_policy!=0)) @@ -3370,6 +3473,7 @@ int recv_indicatepkt_reorder(_adapter *padapter, union recv_frame *prframe) //s2. check if winstart_b(indicate_seq) needs to been updated if(!check_indicate_seq(preorder_ctrl, pattrib->seq_num)) { + pdbgpriv->dbg_rx_ampdu_drop_count++; //pHTInfo->RxReorderDropCounter++; //ReturnRFDList(Adapter, pRfd); //RT_TRACE(COMP_RX_REORDER, DBG_TRACE, ("RxReorderIndicatePacket() ==> Packet Drop!!\n")); @@ -3479,6 +3583,8 @@ int process_recv_indicatepkts(_adapter *padapter, union recv_frame *prframe) #ifdef CONFIG_80211N_HT struct ht_priv *phtpriv = &pmlmepriv->htpriv; + + DBG_COUNTER(padapter->rx_logs.core_rx_post_indicate); #ifdef CONFIG_TDLS if( (phtpriv->ht_option==_TRUE) || @@ -3576,41 +3682,613 @@ int validate_mp_recv_frame(_adapter *adapter, union recv_frame *precv_frame) } #endif -int recv_func_prehandle(_adapter *padapter, union recv_frame *rframe) +static sint MPwlanhdr_to_ethhdr ( union recv_frame *precvframe) +{ + sint rmv_len; + u16 eth_type, len; + u8 bsnaphdr; + u8 *psnap_type; + u8 mcastheadermac[]={0x01,0x00,0x5e}; + + struct ieee80211_snap_hdr *psnap; + + sint ret=_SUCCESS; + _adapter *adapter =precvframe->u.hdr.adapter; + struct mlme_priv *pmlmepriv = &adapter->mlmepriv; + + u8 *ptr = get_recvframe_data(precvframe) ; // point to frame_ctrl field + struct rx_pkt_attrib *pattrib = & precvframe->u.hdr.attrib; + +_func_enter_; + + if(pattrib->encrypt){ + recvframe_pull_tail(precvframe, pattrib->icv_len); + } + + psnap=(struct ieee80211_snap_hdr *)(ptr+pattrib->hdrlen + pattrib->iv_len); + psnap_type=ptr+pattrib->hdrlen + pattrib->iv_len+SNAP_SIZE; + /* convert hdr + possible LLC headers into Ethernet header */ + //eth_type = (psnap_type[0] << 8) | psnap_type[1]; + if((_rtw_memcmp(psnap, rtw_rfc1042_header, SNAP_SIZE) && + (_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_IPX, 2) == _FALSE) && + (_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_APPLETALK_AARP, 2)==_FALSE) )|| + //eth_type != ETH_P_AARP && eth_type != ETH_P_IPX) || + _rtw_memcmp(psnap, rtw_bridge_tunnel_header, SNAP_SIZE)){ + /* remove RFC1042 or Bridge-Tunnel encapsulation and replace EtherType */ + bsnaphdr = _TRUE; + } + else { + /* Leave Ethernet header part of hdr and full payload */ + bsnaphdr = _FALSE; + } + + rmv_len = pattrib->hdrlen + pattrib->iv_len +(bsnaphdr?SNAP_SIZE:0); + len = precvframe->u.hdr.len - rmv_len; + + RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("\n===pattrib->hdrlen: %x, pattrib->iv_len:%x ===\n\n", pattrib->hdrlen, pattrib->iv_len)); + + _rtw_memcpy(ð_type, ptr+rmv_len, 2); + eth_type= ntohs((unsigned short )eth_type); //pattrib->ether_type + pattrib->eth_type = eth_type; + + { + ptr = recvframe_pull(precvframe, (rmv_len-sizeof(struct ethhdr)+ (bsnaphdr?2:0))); + } + + _rtw_memcpy(ptr, pattrib->dst, ETH_ALEN); + _rtw_memcpy(ptr+ETH_ALEN, pattrib->src, ETH_ALEN); + + if(!bsnaphdr) { + len = htons(len); + _rtw_memcpy(ptr+12, &len, 2); + } + + + len = htons(pattrib->seq_num); + //DBG_871X("wlan seq = %d ,seq_num =%x\n",len,pattrib->seq_num); + _rtw_memcpy(ptr+12,&len, 2); + if(adapter->mppriv.bRTWSmbCfg==_TRUE) + { +// if(_rtw_memcmp(mcastheadermac, pattrib->dst, 3) == _TRUE)//SimpleConfig Dest. +// _rtw_memcpy(ptr+ETH_ALEN, pattrib->bssid, ETH_ALEN); + + if(_rtw_memcmp(mcastheadermac, pattrib->bssid, 3) == _TRUE) //SimpleConfig Dest. + _rtw_memcpy(ptr, pattrib->bssid, ETH_ALEN); + + } + + +_func_exit_; + return ret; + +} + + +int mp_recv_frame(_adapter *padapter, union recv_frame *rframe) { int ret = _SUCCESS; struct rx_pkt_attrib *pattrib = &rframe->u.hdr.attrib; struct recv_priv *precvpriv = &padapter->recvpriv; _queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue; - #ifdef CONFIG_MP_INCLUDED struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - - if (padapter->registrypriv.mp_mode == 1) + struct mp_priv *pmppriv = &padapter->mppriv; +#endif //CONFIG_MP_INCLUDED + u8 type; + u8 *ptr = rframe->u.hdr.rx_data; + u8 *psa, *pda, *pbssid; + struct sta_info *psta = NULL; + DBG_COUNTER(padapter->rx_logs.core_rx_pre); + + if ( (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) )//&&(padapter->mppriv.check_mp_pkt == 0)) { - if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == _TRUE))//&&(padapter->mppriv.check_mp_pkt == 0)) + if (pattrib->crc_err == 1){ + padapter->mppriv.rx_crcerrpktcount++; + } + else{ + if(_SUCCESS == validate_mp_recv_frame(padapter, rframe)) + padapter->mppriv.rx_pktcount++; + else + padapter->mppriv.rx_pktcount_filter_out++; + } + + if(pmppriv->rx_bindicatePkt == _FALSE) { - if (pattrib->crc_err == 1){ - padapter->mppriv.rx_crcerrpktcount++; - } - else{ - if(_SUCCESS == validate_mp_recv_frame(padapter, rframe)) - padapter->mppriv.rx_pktcount++; - else - padapter->mppriv.rx_pktcount_filter_out++; + //RT_TRACE(_module_rtl871x_recv_c_, _drv_alert_, ("MP - Not in loopback mode , drop pkt \n")); + ret = _FAIL; + rtw_free_recvframe(rframe, pfree_recv_queue);//free this recv_frame + goto exit; + } + else + { + type = GetFrameType(ptr); + pattrib->to_fr_ds = get_tofr_ds(ptr); + pattrib->frag_num = GetFragNum(ptr); + pattrib->seq_num = GetSequence(ptr); + pattrib->pw_save = GetPwrMgt(ptr); + pattrib->mfrag = GetMFrag(ptr); + pattrib->mdata = GetMData(ptr); + pattrib->privacy = GetPrivacy(ptr); + pattrib->order = GetOrder(ptr); + + if(type ==WIFI_DATA_TYPE) + { + pda = get_da(ptr); + psa = get_sa(ptr); + pbssid = get_hdr_bssid(ptr); + _rtw_memcpy(pattrib->dst, pda, ETH_ALEN); + _rtw_memcpy(pattrib->src, psa, ETH_ALEN); + _rtw_memcpy(pattrib->bssid, pbssid, ETH_ALEN); + + switch(pattrib->to_fr_ds) + { + case 0: + _rtw_memcpy(pattrib->ra, pda, ETH_ALEN); + _rtw_memcpy(pattrib->ta, psa, ETH_ALEN); + ret = sta2sta_data_frame(padapter, rframe, &psta); + break; + + case 1: + + _rtw_memcpy(pattrib->ra, pda, ETH_ALEN); + _rtw_memcpy(pattrib->ta, pbssid, ETH_ALEN); + ret = ap2sta_data_frame(padapter, rframe, &psta); + + break; + + case 2: + _rtw_memcpy(pattrib->ra, pbssid, ETH_ALEN); + _rtw_memcpy(pattrib->ta, psa, ETH_ALEN); + ret = sta2ap_data_frame(padapter, rframe, &psta); + break; + + case 3: + _rtw_memcpy(pattrib->ra, GetAddr1Ptr(ptr), ETH_ALEN); + _rtw_memcpy(pattrib->ta, GetAddr2Ptr(ptr), ETH_ALEN); + ret =_FAIL; + RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,(" case 3\n")); + break; + + default: + ret =_FAIL; + break; } + + ret = MPwlanhdr_to_ethhdr (rframe); + + if (ret != _SUCCESS) + { + RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("wlanhdr_to_ethhdr: drop pkt \n")); + #ifdef DBG_RX_DROP_FRAME + DBG_871X("DBG_RX_DROP_FRAME %s wlanhdr_to_ethhdr: drop pkt\n", __FUNCTION__); + #endif + rtw_free_recvframe(rframe, pfree_recv_queue);//free this recv_frame + ret = _FAIL; + goto exit; + } + if ((padapter->bDriverStopped == _FALSE) && (padapter->bSurpriseRemoved == _FALSE)) + { + RT_TRACE(_module_rtl871x_recv_c_, _drv_alert_, ("@@@@ recv_func: recv_func rtw_recv_indicatepkt\n" )); + //indicate this recv_frame + ret = rtw_recv_indicatepkt(padapter, rframe); + if (ret != _SUCCESS) + { + #ifdef DBG_RX_DROP_FRAME + DBG_871X("DBG_RX_DROP_FRAME %s rtw_recv_indicatepkt fail!\n", __FUNCTION__); + #endif + rtw_free_recvframe(rframe, pfree_recv_queue);//free this recv_frame + ret = _FAIL; + + goto exit; + } + } + else + { + RT_TRACE(_module_rtl871x_recv_c_, _drv_alert_, ("@@@@ recv_func: rtw_free_recvframe\n" )); + RT_TRACE(_module_rtl871x_recv_c_, _drv_debug_, ("recv_func:bDriverStopped(%d) OR bSurpriseRemoved(%d)", padapter->bDriverStopped, padapter->bSurpriseRemoved)); + #ifdef DBG_RX_DROP_FRAME + DBG_871X("DBG_RX_DROP_FRAME %s ecv_func:bDriverStopped(%d) OR bSurpriseRemoved(%d)\n", __FUNCTION__, + padapter->bDriverStopped, padapter->bSurpriseRemoved); + #endif + ret = _FAIL; + rtw_free_recvframe(rframe, pfree_recv_queue);//free this recv_frame + goto exit; + } - if (check_fwstate(pmlmepriv, WIFI_MP_LPBK_STATE) == _FALSE) { - //RT_TRACE(_module_rtl871x_recv_c_, _drv_alert_, ("MP - Not in loopback mode , drop pkt \n")); - ret = _FAIL; - rtw_free_recvframe(rframe, pfree_recv_queue);//free this recv_frame - goto exit; } } + + } + + RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("recv_func: validate_recv_frame fail! drop pkt\n")); + rtw_free_recvframe(rframe, pfree_recv_queue);//free this recv_frame + ret = _FAIL; + +exit: + return ret; + +} + +static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe, u8 *buf) +{ +#define CHAN2FREQ(a) ((a < 14)?(2407+5*a):(5000+5*a)) + +#if 0 +#define RTW_RX_RADIOTAP_PRESENT ( \ + (1 << IEEE80211_RADIOTAP_TSFT) | \ + (1 << IEEE80211_RADIOTAP_FLAGS) | \ + (1 << IEEE80211_RADIOTAP_RATE) | \ + (1 << IEEE80211_RADIOTAP_CHANNEL) | \ + (0 << IEEE80211_RADIOTAP_FHSS) | \ + (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) | \ + (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE) | \ + (0 << IEEE80211_RADIOTAP_LOCK_QUALITY) | \ + (0 << IEEE80211_RADIOTAP_TX_ATTENUATION) | \ + (0 << IEEE80211_RADIOTAP_DB_TX_ATTENUATION) | \ + (0 << IEEE80211_RADIOTAP_DBM_TX_POWER) | \ + (1 << IEEE80211_RADIOTAP_ANTENNA) | \ + (1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL) | \ + (0 << IEEE80211_RADIOTAP_DB_ANTNOISE) | \ + (0 << IEEE80211_RADIOTAP_RX_FLAGS) | \ + (0 << IEEE80211_RADIOTAP_TX_FLAGS) | \ + (0 << IEEE80211_RADIOTAP_RTS_RETRIES) | \ + (0 << IEEE80211_RADIOTAP_DATA_RETRIES) | \ + (0 << IEEE80211_RADIOTAP_MCS) | \ + (0 << IEEE80211_RADIOTAP_RADIOTAP_NAMESPACE)| \ + (0 << IEEE80211_RADIOTAP_VENDOR_NAMESPACE) | \ + (0 << IEEE80211_RADIOTAP_EXT) | \ + 0) + + /* (0 << IEEE80211_RADIOTAP_AMPDU_STATUS) | \ */ + /* (0 << IEEE80211_RADIOTAP_VHT) | \ */ +#endif +#ifndef IEEE80211_RADIOTAP_MCS +#define IEEE80211_RADIOTAP_MCS 19 +#endif +#ifndef IEEE80211_RADIOTAP_VHT +#define IEEE80211_RADIOTAP_VHT 21 +#endif + +#ifndef IEEE80211_RADIOTAP_F_BADFCS +#define IEEE80211_RADIOTAP_F_BADFCS 0x40 /* bad FCS */ +#endif + + sint ret = _SUCCESS; + _adapter *adapter = precvframe->u.hdr.adapter; + struct mlme_priv *pmlmepriv = &adapter->mlmepriv; + struct rx_pkt_attrib *pattrib = &precvframe->u.hdr.attrib; + + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); + + u16 tmp_16bit = 0; + + u8 data_rate[] = { + 2, 4, 11, 22, /* CCK */ + 12, 18, 24, 36, 48, 72, 93, 108, /* OFDM */ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, /* HT MCS index */ + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, /* VHT Nss 1 */ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, /* VHT Nss 2 */ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, /* VHT Nss 3 */ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, /* VHT Nss 4 */ + }; + + _pkt *pskb = NULL; + + struct ieee80211_radiotap_header *rtap_hdr = NULL; + u8 *ptr = NULL; + + u8 hdr_buf[64] = {0}; + u16 rt_len = 8; + + /* create header */ + rtap_hdr = (struct ieee80211_radiotap_header *)&hdr_buf[0]; + rtap_hdr->it_version = PKTHDR_RADIOTAP_VERSION; + + /* tsft */ + if (pattrib->tsfl) { + u64 tmp_64bit; + + rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_TSFT); + tmp_64bit = cpu_to_le64(pattrib->tsfl); + memcpy(&hdr_buf[rt_len], &tmp_64bit, 8); + rt_len += 8; + } + + /* flags */ + rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_FLAGS); + if (0) + hdr_buf[rt_len] |= IEEE80211_RADIOTAP_F_CFP; + + if (0) + hdr_buf[rt_len] |= IEEE80211_RADIOTAP_F_SHORTPRE; + + if ((pattrib->encrypt == 1) || (pattrib->encrypt == 5)) + hdr_buf[rt_len] |= IEEE80211_RADIOTAP_F_WEP; + + if (pattrib->mfrag) + hdr_buf[rt_len] |= IEEE80211_RADIOTAP_F_FRAG; + +#ifndef CONFIG_RX_PACKET_APPEND_FCS + hdr_buf[rt_len] |= IEEE80211_RADIOTAP_F_FCS; +#endif + + if (0) + hdr_buf[rt_len] |= IEEE80211_RADIOTAP_F_DATAPAD; + + if (pattrib->crc_err) + hdr_buf[rt_len] |= IEEE80211_RADIOTAP_F_BADFCS; + + if (pattrib->sgi) { + /* Currently unspecified but used */ + hdr_buf[rt_len] |= 0x80; + } + rt_len += 1; + + /* rate */ + if (pattrib->data_rate < 12) { + rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_RATE); + if (pattrib->data_rate < 4) { + /* CCK */ + hdr_buf[rt_len] = data_rate[pattrib->data_rate]; + } else { + /* OFDM */ + hdr_buf[rt_len] = data_rate[pattrib->data_rate]; + } + } + rt_len += 1; /* force padding 1 byte for aligned */ + + /* channel */ + tmp_16bit = 0; + rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_CHANNEL); + tmp_16bit = CHAN2FREQ(rtw_get_oper_ch(padapter)); + /*tmp_16bit = CHAN2FREQ(pHalData->CurrentChannel);*/ + memcpy(&hdr_buf[rt_len], &tmp_16bit, 2); + rt_len += 2; + + /* channel flags */ + tmp_16bit = 0; + if (pHalData->CurrentBandType == 0) + tmp_16bit |= cpu_to_le16(IEEE80211_CHAN_2GHZ); + else + tmp_16bit |= cpu_to_le16(IEEE80211_CHAN_5GHZ); + + if (pattrib->data_rate < 12) { + if (pattrib->data_rate < 4) { + /* CCK */ + tmp_16bit |= cpu_to_le16(IEEE80211_CHAN_CCK); + } else { + /* OFDM */ + tmp_16bit |= cpu_to_le16(IEEE80211_CHAN_OFDM); + } + } else { + tmp_16bit |= cpu_to_le16(IEEE80211_CHAN_DYN); + } + memcpy(&hdr_buf[rt_len], &tmp_16bit, 2); + rt_len += 2; + + /* dBm Antenna Signal */ + rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL); + hdr_buf[rt_len] = pattrib->phy_info.RecvSignalPower; + rt_len += 1; + +#if 0 + /* dBm Antenna Noise */ + rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE); + hdr_buf[rt_len] = 0; + rt_len += 1; + + /* Signal Quality */ + rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_LOCK_QUALITY); + hdr_buf[rt_len] = pattrib->phy_info.SignalQuality; + rt_len += 1; +#endif + + /* Antenna */ + rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_ANTENNA); + hdr_buf[rt_len] = 0; /* pHalData->rf_type; */ + rt_len += 1; + + /* RX flags */ + rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_RX_FLAGS); +#if 0 + tmp_16bit = cpu_to_le16(0); + memcpy(ptr, &tmp_16bit, 1); +#endif + rt_len += 2; + + /* MCS information */ + if (pattrib->data_rate >= 12 && pattrib->data_rate < 44) { + rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_MCS); + /* known, flag */ + hdr_buf[rt_len] |= BIT1; /* MCS index known */ + + /* bandwidth */ + hdr_buf[rt_len] |= BIT0; + hdr_buf[rt_len+1] |= (pattrib->bw & 0x03); + + /* guard interval */ + hdr_buf[rt_len] |= BIT2; + hdr_buf[rt_len+1] |= (pattrib->sgi & 0x01) << 2; + + /* STBC */ + hdr_buf[rt_len] |= BIT5; + hdr_buf[rt_len+1] |= (pattrib->stbc & 0x03) << 5; + + rt_len += 2; + + /* MCS rate index */ + hdr_buf[rt_len] = data_rate[pattrib->data_rate]; + rt_len += 1; + } + + /* VHT */ + if (pattrib->data_rate >= 44 && pattrib->data_rate < 84) { + rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_VHT); + + /* known 16 bit, flag 8 bit */ + tmp_16bit = 0; + + /* Bandwidth */ + tmp_16bit |= BIT6; + + /* Group ID */ + tmp_16bit |= BIT7; + + /* Partial AID */ + tmp_16bit |= BIT8; + + /* STBC */ + tmp_16bit |= BIT0; + hdr_buf[rt_len+2] |= (pattrib->stbc & 0x01); + + /* Guard interval */ + tmp_16bit |= BIT2; + hdr_buf[rt_len+2] |= (pattrib->sgi & 0x01) << 2; + + /* LDPC extra OFDM symbol */ + tmp_16bit |= BIT4; + hdr_buf[rt_len+2] |= (pattrib->ldpc & 0x01) << 4; + + memcpy(&hdr_buf[rt_len], &tmp_16bit, 2); + rt_len += 3; + + /* bandwidth */ + if (pattrib->bw == 0) + hdr_buf[rt_len] |= 0; + else if (pattrib->bw == 1) + hdr_buf[rt_len] |= 1; + else if (pattrib->bw == 2) + hdr_buf[rt_len] |= 4; + else if (pattrib->bw == 3) + hdr_buf[rt_len] |= 11; + rt_len += 1; + + /* mcs_nss */ + if (pattrib->data_rate >= 44 && pattrib->data_rate < 54) { + hdr_buf[rt_len] |= 1; + hdr_buf[rt_len] |= data_rate[pattrib->data_rate] << 4; + } else if (pattrib->data_rate >= 54 && pattrib->data_rate < 64) { + hdr_buf[rt_len + 1] |= 2; + hdr_buf[rt_len + 1] |= data_rate[pattrib->data_rate] << 4; + } else if (pattrib->data_rate >= 64 && pattrib->data_rate < 74) { + hdr_buf[rt_len + 2] |= 3; + hdr_buf[rt_len + 2] |= data_rate[pattrib->data_rate] << 4; + } else if (pattrib->data_rate >= 74 && pattrib->data_rate < 84) { + hdr_buf[rt_len + 3] |= 4; + hdr_buf[rt_len + 3] |= data_rate[pattrib->data_rate] << 4; + } + rt_len += 4; + + /* coding */ + hdr_buf[rt_len] = 0; + rt_len += 1; + + /* group_id */ + hdr_buf[rt_len] = 0; + rt_len += 1; + + /* partial_aid */ + tmp_16bit = 0; + memcpy(&hdr_buf[rt_len], &tmp_16bit, 2); + rt_len += 2; + } + + /* push to skb */ + pskb = (_pkt *)buf; + if (skb_headroom(pskb) < rt_len) { + DBG_871X("%s:%d %s headroom is too small.\n", __FILE__, __LINE__, __func__); + ret = _FAIL; + return ret; + } + + ptr = skb_push(pskb, rt_len); + if (ptr) { + rtap_hdr->it_len = cpu_to_le16(rt_len); + memcpy(ptr, rtap_hdr, rt_len); + } else { + ret = _FAIL; + } + + return ret; + +} + +int recv_frame_monitor(_adapter *padapter, union recv_frame *rframe) +{ + int ret = _SUCCESS; + struct rx_pkt_attrib *pattrib = &rframe->u.hdr.attrib; + struct recv_priv *precvpriv = &padapter->recvpriv; + _queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue; + _pkt *pskb = NULL; + + /* read skb information from recv frame */ + pskb = rframe->u.hdr.pkt; + pskb->len = rframe->u.hdr.len; + pskb->data = rframe->u.hdr.rx_data; + skb_set_tail_pointer(pskb, rframe->u.hdr.len); + + /* fill radiotap header */ + if (fill_radiotap_hdr(padapter, rframe, (u8 *)pskb) == _FAIL) { + ret = _FAIL; + rtw_free_recvframe(rframe, pfree_recv_queue); /* free this recv_frame */ + goto exit; + } + + /* write skb information to recv frame */ + skb_reset_mac_header(pskb); + rframe->u.hdr.len = pskb->len; + rframe->u.hdr.rx_data = pskb->data; + rframe->u.hdr.rx_head = pskb->head; + rframe->u.hdr.rx_tail = skb_tail_pointer(pskb); + rframe->u.hdr.rx_end = skb_end_pointer(pskb); + + if ((padapter->bDriverStopped == _FALSE) && (padapter->bSurpriseRemoved == _FALSE)) { + /* indicate this recv_frame */ + ret = rtw_recv_monitor(padapter, rframe); + if (ret != _SUCCESS) { + ret = _FAIL; + rtw_free_recvframe(rframe, pfree_recv_queue); /* free this recv_frame */ + goto exit; + } + } else { + ret = _FAIL; + rtw_free_recvframe(rframe, pfree_recv_queue); /* free this recv_frame */ + goto exit; + } + +exit: + return ret; +} + +int recv_func_prehandle(_adapter *padapter, union recv_frame *rframe) +{ + int ret = _SUCCESS; + struct rx_pkt_attrib *pattrib = &rframe->u.hdr.attrib; + struct recv_priv *precvpriv = &padapter->recvpriv; + _queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue; + +#ifdef DBG_RX_COUNTER_DUMP + if( padapter->dump_rx_cnt_mode & DUMP_DRV_RX_COUNTER ) + { + if (pattrib->crc_err == 1) + padapter->drv_rx_cnt_crcerror++; + else + padapter->drv_rx_cnt_ok++; } #endif +#ifdef CONFIG_MP_INCLUDED + if (padapter->registrypriv.mp_mode == 1 || padapter->mppriv.bRTWSmbCfg ==_TRUE) + { + mp_recv_frame(padapter,rframe); + ret = _FAIL; + goto exit; + } + else +#endif + { //check the frame crtl field and decache ret = validate_recv_frame(padapter, rframe); if (ret != _SUCCESS) @@ -3619,7 +4297,7 @@ int recv_func_prehandle(_adapter *padapter, union recv_frame *rframe) rtw_free_recvframe(rframe, pfree_recv_queue);//free this recv_frame goto exit; } - + } exit: return ret; } @@ -3631,12 +4309,11 @@ int recv_func_posthandle(_adapter *padapter, union recv_frame *prframe) struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib; struct recv_priv *precvpriv = &padapter->recvpriv; _queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue; - - #ifdef CONFIG_TDLS u8 *psnap_type, *pcategory; #endif //CONFIG_TDLS + DBG_COUNTER(padapter->rx_logs.core_rx_post); // DATA FRAME rtw_led_control(padapter, LED_CTL_RX); @@ -3648,6 +4325,7 @@ int recv_func_posthandle(_adapter *padapter, union recv_frame *prframe) DBG_871X("DBG_RX_DROP_FRAME %s decryptor: drop pkt\n", __FUNCTION__); #endif ret = _FAIL; + DBG_COUNTER(padapter->rx_logs.core_rx_post_decrypt_err); goto _recv_data_drop; } @@ -3674,10 +4352,9 @@ int recv_func_posthandle(_adapter *padapter, union recv_frame *prframe) if((_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_TDLS, ETH_TYPE_LEN)) && ((*pcategory==RTW_WLAN_CATEGORY_TDLS) || (*pcategory==RTW_WLAN_CATEGORY_P2P))){ - ret = OnTDLS(padapter, prframe); //all of functions will return _FAIL + ret = OnTDLS(padapter, prframe); if(ret == _FAIL) goto _exit_recv_func; - //goto _exit_recv_func; } #endif //CONFIG_TDLS @@ -3687,6 +4364,7 @@ int recv_func_posthandle(_adapter *padapter, union recv_frame *prframe) #ifdef DBG_RX_DROP_FRAME DBG_871X("DBG_RX_DROP_FRAME %s recvframe_chk_defrag: drop pkt\n", __FUNCTION__); #endif + DBG_COUNTER(padapter->rx_logs.core_rx_post_defrag_err); goto _recv_data_drop; } @@ -3697,6 +4375,7 @@ int recv_func_posthandle(_adapter *padapter, union recv_frame *prframe) DBG_871X("DBG_RX_DROP_FRAME %s portctrl: drop pkt\n", __FUNCTION__); #endif ret = _FAIL; + DBG_COUNTER(padapter->rx_logs.core_rx_post_portctrl_err); goto _recv_data_drop; } @@ -3715,6 +4394,7 @@ int recv_func_posthandle(_adapter *padapter, union recv_frame *prframe) DBG_871X("DBG_RX_DROP_FRAME %s process_recv_indicatepkts fail!\n", __FUNCTION__); #endif rtw_free_recvframe(orig_prframe, pfree_recv_queue);//free this recv_frame + DBG_COUNTER(padapter->rx_logs.core_rx_post_indicate_err); goto _recv_data_drop; } #else // CONFIG_80211N_HT @@ -3797,6 +4477,13 @@ int recv_func(_adapter *padapter, union recv_frame *rframe) struct security_priv *psecuritypriv=&padapter->securitypriv; struct mlme_priv *mlmepriv = &padapter->mlmepriv; + if (check_fwstate(mlmepriv, WIFI_MONITOR_STATE)) { + /* monitor mode */ + recv_frame_monitor(padapter, rframe); + ret = _SUCCESS; + goto exit; + } else + /* check if need to handle uc_swdec_pending_queue*/ if (check_fwstate(mlmepriv, WIFI_STATION_STATE) && psecuritypriv->busetkipkey) { @@ -3805,6 +4492,7 @@ int recv_func(_adapter *padapter, union recv_frame *rframe) while((pending_frame=rtw_alloc_recvframe(&padapter->recvpriv.uc_swdec_pending_queue))) { cnt++; + DBG_COUNTER(padapter->rx_logs.core_rx_dequeue); recv_func_posthandle(padapter, pending_frame); } @@ -3813,6 +4501,7 @@ int recv_func(_adapter *padapter, union recv_frame *rframe) FUNC_ADPT_ARG(padapter), cnt); } + DBG_COUNTER(padapter->rx_logs.core_rx); ret = recv_func_prehandle(padapter, rframe); if(ret == _SUCCESS) { @@ -3824,6 +4513,7 @@ int recv_func(_adapter *padapter, union recv_frame *rframe) psecuritypriv->ndisauthtype == Ndis802_11AuthModeWPAPSK && !psecuritypriv->busetkipkey) { + DBG_COUNTER(padapter->rx_logs.core_rx_enqueue); rtw_enqueue_recvframe(rframe, &padapter->recvpriv.uc_swdec_pending_queue); //DBG_871X("%s: no key, enqueue uc_swdec_pending_queue\n", __func__); @@ -3980,5 +4670,213 @@ void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS){ } #endif //CONFIG_NEW_SIGNAL_STAT_PROCESS +static void rx_process_rssi(_adapter *padapter,union recv_frame *prframe) +{ + u32 last_rssi, tmp_val; + struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib; +#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS + struct signal_stat * signal_stat = &padapter->recvpriv.signal_strength_data; +#endif //CONFIG_NEW_SIGNAL_STAT_PROCESS + + //DBG_8192C("process_rssi=> pattrib->rssil(%d) signal_strength(%d)\n ",pattrib->RecvSignalPower,pattrib->signal_strength); + //if(pRfd->Status.bPacketToSelf || pRfd->Status.bPacketBeacon) + { + #ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS + if(signal_stat->update_req) { + signal_stat->total_num = 0; + signal_stat->total_val = 0; + signal_stat->update_req = 0; + } + signal_stat->total_num++; + signal_stat->total_val += pattrib->phy_info.SignalStrength; + signal_stat->avg_val = signal_stat->total_val / signal_stat->total_num; + #else //CONFIG_NEW_SIGNAL_STAT_PROCESS + + //Adapter->RxStats.RssiCalculateCnt++; //For antenna Test + if(padapter->recvpriv.signal_strength_data.total_num++ >= PHY_RSSI_SLID_WIN_MAX) + { + padapter->recvpriv.signal_strength_data.total_num = PHY_RSSI_SLID_WIN_MAX; + last_rssi = padapter->recvpriv.signal_strength_data.elements[padapter->recvpriv.signal_strength_data.index]; + padapter->recvpriv.signal_strength_data.total_val -= last_rssi; + } + padapter->recvpriv.signal_strength_data.total_val +=pattrib->phy_info.SignalStrength; + + padapter->recvpriv.signal_strength_data.elements[padapter->recvpriv.signal_strength_data.index++] = pattrib->phy_info.SignalStrength; + if(padapter->recvpriv.signal_strength_data.index >= PHY_RSSI_SLID_WIN_MAX) + padapter->recvpriv.signal_strength_data.index = 0; + + + tmp_val = padapter->recvpriv.signal_strength_data.total_val/padapter->recvpriv.signal_strength_data.total_num; + + if(padapter->recvpriv.is_signal_dbg) { + padapter->recvpriv.signal_strength= padapter->recvpriv.signal_strength_dbg; + padapter->recvpriv.rssi=(s8)translate_percentage_to_dbm(padapter->recvpriv.signal_strength_dbg); + } else { + padapter->recvpriv.signal_strength= tmp_val; + padapter->recvpriv.rssi=(s8)translate_percentage_to_dbm(tmp_val); + } + + RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("UI RSSI = %d, ui_rssi.TotalVal = %d, ui_rssi.TotalNum = %d\n", tmp_val, padapter->recvpriv.signal_strength_data.total_val,padapter->recvpriv.signal_strength_data.total_num)); + #endif //CONFIG_NEW_SIGNAL_STAT_PROCESS + } +} + +static void rx_process_link_qual(_adapter *padapter,union recv_frame *prframe) +{ + u32 last_evm=0, tmpVal; + struct rx_pkt_attrib *pattrib; +#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS + struct signal_stat * signal_stat; +#endif //CONFIG_NEW_SIGNAL_STAT_PROCESS + + if(prframe == NULL || padapter==NULL){ + return; + } + + pattrib = &prframe->u.hdr.attrib; +#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS + signal_stat = &padapter->recvpriv.signal_qual_data; +#endif //CONFIG_NEW_SIGNAL_STAT_PROCESS + + //DBG_8192C("process_link_qual=> pattrib->signal_qual(%d)\n ",pattrib->signal_qual); + +#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS + if(signal_stat->update_req) { + signal_stat->total_num = 0; + signal_stat->total_val = 0; + signal_stat->update_req = 0; + } + + signal_stat->total_num++; + signal_stat->total_val += pattrib->phy_info.SignalQuality; + signal_stat->avg_val = signal_stat->total_val / signal_stat->total_num; + +#else //CONFIG_NEW_SIGNAL_STAT_PROCESS + if(pattrib->phy_info.SignalQuality != 0) + { + // + // 1. Record the general EVM to the sliding window. + // + if(padapter->recvpriv.signal_qual_data.total_num++ >= PHY_LINKQUALITY_SLID_WIN_MAX) + { + padapter->recvpriv.signal_qual_data.total_num = PHY_LINKQUALITY_SLID_WIN_MAX; + last_evm = padapter->recvpriv.signal_qual_data.elements[padapter->recvpriv.signal_qual_data.index]; + padapter->recvpriv.signal_qual_data.total_val -= last_evm; + } + padapter->recvpriv.signal_qual_data.total_val += pattrib->phy_info.SignalQuality; + + padapter->recvpriv.signal_qual_data.elements[padapter->recvpriv.signal_qual_data.index++] = pattrib->phy_info.SignalQuality; + if(padapter->recvpriv.signal_qual_data.index >= PHY_LINKQUALITY_SLID_WIN_MAX) + padapter->recvpriv.signal_qual_data.index = 0; + + RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("Total SQ=%d pattrib->signal_qual= %d\n", padapter->recvpriv.signal_qual_data.total_val, pattrib->phy_info.SignalQuality)); + + // <1> Showed on UI for user, in percentage. + tmpVal = padapter->recvpriv.signal_qual_data.total_val/padapter->recvpriv.signal_qual_data.total_num; + padapter->recvpriv.signal_qual=(u8)tmpVal; + + } + else + { + RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,(" pattrib->signal_qual =%d\n", pattrib->phy_info.SignalQuality)); + } +#endif //CONFIG_NEW_SIGNAL_STAT_PROCESS +} + +void rx_process_phy_info(_adapter *padapter, union recv_frame *rframe) +{ + /* Check RSSI */ + rx_process_rssi(padapter, rframe); + + /* Check PWDB */ + //process_PWDB(padapter, rframe); + + //UpdateRxSignalStatistics8192C(Adapter, pRfd); + + /* Check EVM */ + rx_process_link_qual(padapter, rframe); + #ifdef DBG_RX_SIGNAL_DISPLAY_RAW_DATA + rtw_store_phy_info( padapter, rframe); + #endif +} + +void rx_query_phy_status( + union recv_frame *precvframe, + u8 *pphy_status) +{ + PADAPTER padapter = precvframe->u.hdr.adapter; + struct rx_pkt_attrib *pattrib = &precvframe->u.hdr.attrib; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); + PODM_PHY_INFO_T pPHYInfo = (PODM_PHY_INFO_T)(&pattrib->phy_info); + u8 *wlanhdr; + ODM_PACKET_INFO_T pkt_info; + u8 *sa; + struct sta_priv *pstapriv; + struct sta_info *psta = NULL; + //_irqL irqL; + + pkt_info.bPacketMatchBSSID =_FALSE; + pkt_info.bPacketToSelf = _FALSE; + pkt_info.bPacketBeacon = _FALSE; + + wlanhdr = get_recvframe_data(precvframe); + + pkt_info.bPacketMatchBSSID = (!IsFrameTypeCtrl(wlanhdr)) + && (!pattrib->icv_err) && (!pattrib->crc_err) + && _rtw_memcmp(get_hdr_bssid(wlanhdr), get_bssid(&padapter->mlmepriv), ETH_ALEN); + + pkt_info.bToSelf = (!pattrib->icv_err) && (!pattrib->crc_err) + && _rtw_memcmp(get_ra(wlanhdr), myid(&padapter->eeprompriv), ETH_ALEN); + + pkt_info.bPacketToSelf = pkt_info.bPacketMatchBSSID + && _rtw_memcmp(get_ra(wlanhdr), myid(&padapter->eeprompriv), ETH_ALEN); + + pkt_info.bPacketBeacon = pkt_info.bPacketMatchBSSID + && (GetFrameSubType(wlanhdr) == WIFI_BEACON); + + sa = get_ta(wlanhdr); + + pkt_info.StationID = 0xFF; + + if (_rtw_memcmp(myid(&padapter->eeprompriv), sa, ETH_ALEN) == _TRUE) { + DBG_871X_LEVEL(_drv_always_, "Warning!!! sa equal my mac!!\n"); + rtw_warn_on(1); + } else{ + pstapriv = &padapter->stapriv; + psta = rtw_get_stainfo(pstapriv, sa); + if (psta) + pkt_info.StationID = psta->mac_id; + } + + pkt_info.DataRate = pattrib->data_rate; + + //_enter_critical_bh(&pHalData->odm_stainfo_lock, &irqL); + ODM_PhyStatusQuery(&pHalData->odmpriv, pPHYInfo, pphy_status, &pkt_info); + if (psta) + psta->rssi = pattrib->phy_info.RecvSignalPower; + //_exit_critical_bh(&pHalData->odm_stainfo_lock, &irqL); + +#ifdef CONFIG_SW_ANTENNA_DIVERSITY + if (GET_HAL_DATA(padapter)->odmpriv.RSSI_test == _FALSE + && (IS_81XXC(pHalData->VersionID)|| IS_92D(pHalData->VersionID))) +#endif + { + precvframe->u.hdr.psta = NULL; + if (pkt_info.bPacketMatchBSSID + && (check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE) == _TRUE) + ) { + if (psta) { + precvframe->u.hdr.psta = psta; + rx_process_phy_info(padapter, precvframe); + } + } else if (pkt_info.bPacketToSelf || pkt_info.bPacketBeacon) { + if (check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE|WIFI_ADHOC_MASTER_STATE) == _TRUE) { + if (psta) + precvframe->u.hdr.psta = psta; + } + rx_process_phy_info(padapter, precvframe); + } + } +} diff --git a/backports/drivers/realtek/rtl8812au/core/rtw_security.c b/backports/drivers/realtek/rtl8812au/core/rtw_security.c index 4fc5489c2ff2ed..65bb21cd39ea43 100755 --- a/backports/drivers/realtek/rtl8812au/core/rtw_security.c +++ b/backports/drivers/realtek/rtl8812au/core/rtw_security.c @@ -21,6 +21,85 @@ #include +static const char *_security_type_str[] = { + "N/A", + "WEP40", + "TKIP", + "TKIP_WM", + "AES", + "WEP104", + "SMS4", + "WEP_WPA", + "BIP", +}; + +const char *security_type_str(u8 value) +{ +#ifdef CONFIG_IEEE80211W + if (value <= _BIP_) +#else + if (value <= _WEP_WPA_MIXED_) +#endif + return _security_type_str[value]; + return NULL; +} + +#ifdef DBG_SW_SEC_CNT +#define WEP_SW_ENC_CNT_INC(sec, ra) \ + if (is_broadcast_mac_addr(ra)) \ + sec->wep_sw_enc_cnt_bc++; \ + else if (is_multicast_mac_addr(ra)) \ + sec->wep_sw_enc_cnt_mc++; \ + else \ + sec->wep_sw_enc_cnt_uc++; + +#define WEP_SW_DEC_CNT_INC(sec, ra) \ + if (is_broadcast_mac_addr(ra)) \ + sec->wep_sw_dec_cnt_bc++; \ + else if (is_multicast_mac_addr(ra)) \ + sec->wep_sw_dec_cnt_mc++; \ + else \ + sec->wep_sw_dec_cnt_uc++; + +#define TKIP_SW_ENC_CNT_INC(sec, ra) \ + if (is_broadcast_mac_addr(ra)) \ + sec->tkip_sw_enc_cnt_bc++; \ + else if (is_multicast_mac_addr(ra)) \ + sec->tkip_sw_enc_cnt_mc++; \ + else \ + sec->tkip_sw_enc_cnt_uc++; + +#define TKIP_SW_DEC_CNT_INC(sec, ra) \ + if (is_broadcast_mac_addr(ra)) \ + sec->tkip_sw_dec_cnt_bc++; \ + else if (is_multicast_mac_addr(ra)) \ + sec->tkip_sw_dec_cnt_mc++; \ + else \ + sec->tkip_sw_dec_cnt_uc++; + +#define AES_SW_ENC_CNT_INC(sec, ra) \ + if (is_broadcast_mac_addr(ra)) \ + sec->aes_sw_enc_cnt_bc++; \ + else if (is_multicast_mac_addr(ra)) \ + sec->aes_sw_enc_cnt_mc++; \ + else \ + sec->aes_sw_enc_cnt_uc++; + +#define AES_SW_DEC_CNT_INC(sec, ra) \ + if (is_broadcast_mac_addr(ra)) \ + sec->aes_sw_dec_cnt_bc++; \ + else if (is_multicast_mac_addr(ra)) \ + sec->aes_sw_dec_cnt_mc++; \ + else \ + sec->aes_sw_dec_cnt_uc++; +#else +#define WEP_SW_ENC_CNT_INC(sec, ra) +#define WEP_SW_DEC_CNT_INC(sec, ra) +#define TKIP_SW_ENC_CNT_INC(sec, ra) +#define TKIP_SW_DEC_CNT_INC(sec, ra) +#define AES_SW_ENC_CNT_INC(sec, ra) +#define AES_SW_DEC_CNT_INC(sec, ra) +#endif /* DBG_SW_SEC_CNT */ //=====WEP related===== @@ -229,7 +308,8 @@ _func_enter_; } } - + + WEP_SW_ENC_CNT_INC(psecuritypriv, pattrib->ra); } _func_exit_; @@ -277,8 +357,9 @@ _func_enter_; { RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("rtw_wep_decrypt:icv error crc[3](%x)!=payload[length-1](%x) || crc[2](%x)!=payload[length-2](%x) || crc[1](%x)!=payload[length-3](%x) || crc[0](%x)!=payload[length-4](%x)\n", crc[3],payload[length-1],crc[2],payload[length-2],crc[1],payload[length-3],crc[0],payload[length-4])); - } - + } + + WEP_SW_DEC_CNT_INC(psecuritypriv, prxattrib->ra); } _func_exit_; @@ -753,7 +834,7 @@ _func_enter_; } } - + TKIP_SW_ENC_CNT_INC(psecuritypriv,pattrib->ra); } /* else{ @@ -845,7 +926,6 @@ _func_enter_; } else { - RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("rtw_tkip_decrypt: stainfo!=NULL!!!\n")); prwskey=&stainfo->dot118021x_UncstKey.skey[0]; prwskeylen=16; } @@ -875,8 +955,8 @@ _func_enter_; crc[3],payload[length-1],crc[2],payload[length-2],crc[1],payload[length-3],crc[0],payload[length-4])); res=_FAIL; } - - + + TKIP_SW_DEC_CNT_INC(psecuritypriv, prxattrib->ra); } else{ RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("rtw_tkip_decrypt: stainfo==NULL!!!\n")); @@ -1653,8 +1733,9 @@ _func_enter_; prwskey=pattrib->dot118021x_UncstKey.skey; } -#ifdef CONFIG_TDLS //swencryption +#ifdef CONFIG_TDLS { + /* Swencryption */ struct sta_info *ptdls_sta; ptdls_sta=rtw_get_stainfo(&padapter->stapriv ,&pattrib->dst[0] ); if((ptdls_sta != NULL) && (ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE) ) @@ -1684,7 +1765,7 @@ _func_enter_; } } - + AES_SW_ENC_CNT_INC(psecuritypriv, pattrib->ra); } /* else{ @@ -1692,7 +1773,7 @@ _func_enter_; DBG_871X("%s, psta==NUL\n", __func__); res=_FAIL; } -*/ +*/ } @@ -2009,7 +2090,6 @@ _func_enter_; static u32 no_gkey_bc_cnt = 0; static u32 no_gkey_mc_cnt = 0; - //in concurrent we should use sw descrypt in group key, so we remove this message //DBG_871X("rx bc/mc packets, to perform sw rtw_aes_decrypt\n"); //prwskey = psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey; if(psecuritypriv->binstallGrpkey==_FALSE) @@ -2085,10 +2165,10 @@ _func_enter_; res= aes_decipher(prwskey,prxattrib->hdrlen,pframe, length); - + AES_SW_DEC_CNT_INC(psecuritypriv, prxattrib->ra); } else{ - RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("rtw_aes_encrypt: stainfo==NULL!!!\n")); + RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("rtw_aes_decrypt: stainfo==NULL!!!\n")); res=_FAIL; } @@ -3033,14 +3113,14 @@ int tdls_verify_mic(u8 *kck, u8 trans_seq, if (lnkid == NULL || rsnie == NULL || timeoutie == NULL || ftie == NULL){ - return 0; + return _FAIL; } len = 2 * ETH_ALEN + 1 + 2 + 18 + 2 + *(rsnie+1) + 2 + *(timeoutie+1) + 2 + *(ftie+1); buf = rtw_zmalloc(len); if (buf == NULL) - return 0; + return _FAIL; pos = buf; /* 1) TDLS initiator STA MAC address */ @@ -3070,17 +3150,17 @@ int tdls_verify_mic(u8 *kck, u8 trans_seq, ret = omac1_aes_128(kck, buf, pos - buf, mic); rtw_mfree(buf, len); if (ret) - return 0; + return _FAIL; rx_ftie = ftie+4; if (os_memcmp(mic, rx_ftie, 16) == 0) { //Valid MIC - return 1; + return _SUCCESS; } //Invalid MIC DBG_871X( "[%s] Invalid MIC\n", __FUNCTION__); - return 0; + return _FAIL; } #endif //CONFIG_TDLS @@ -3119,9 +3199,9 @@ void rtw_sec_restore_wep_key(_adapter *adapter) for(keyid=0;keyid<4;keyid++){ if(securitypriv->key_mask & BIT(keyid)){ if(keyid == securitypriv->dot11PrivacyKeyIndex) - rtw_set_key(adapter,securitypriv, keyid, 1, _TRUE); + rtw_set_key(adapter,securitypriv, keyid, 1, _FALSE); else - rtw_set_key(adapter,securitypriv, keyid, 0, _TRUE); + rtw_set_key(adapter,securitypriv, keyid, 0, _FALSE); } } } diff --git a/backports/drivers/realtek/rtl8812au/core/rtw_sreset.c b/backports/drivers/realtek/rtl8812au/core/rtw_sreset.c index 108833b379119b..ec95b41515928f 100755 --- a/backports/drivers/realtek/rtl8812au/core/rtw_sreset.c +++ b/backports/drivers/realtek/rtl8812au/core/rtw_sreset.c @@ -162,7 +162,7 @@ void sreset_restore_security_station(_adapter *padapter) else { //pairwise key - rtw_setstakey_cmd(padapter, (unsigned char *)psta, _TRUE,_FALSE); + rtw_setstakey_cmd(padapter, psta, UNICAST_KEY,_FALSE); //group key rtw_set_key(padapter,&padapter->securitypriv,padapter->securitypriv.dot118021XGrpKeyid, 0,_FALSE); } @@ -267,8 +267,7 @@ void sreset_stop_adapter(_adapter *padapter) DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(padapter)); - if (!rtw_netif_queue_stopped(padapter->pnetdev)) - rtw_netif_stop_queue(padapter->pnetdev); + rtw_netif_stop_queue(padapter->pnetdev); rtw_cancel_all_timer(padapter); @@ -307,11 +306,10 @@ void sreset_start_adapter(_adapter *padapter) tasklet_hi_schedule(&pxmitpriv->xmit_tasklet); #endif - _set_timer(&padapter->mlmepriv.dynamic_chk_timer, 2000); - - if (rtw_netif_queue_stopped(padapter->pnetdev)) - rtw_netif_wake_queue(padapter->pnetdev); + if (is_primary_adapter(padapter)) + _set_timer(&padapter->mlmepriv.dynamic_chk_timer, 2000); + rtw_netif_wake_queue(padapter->pnetdev); } void sreset_reset(_adapter *padapter) @@ -331,10 +329,10 @@ void sreset_reset(_adapter *padapter) psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS; - -#ifdef CONFIG_POWER_SAVING + +#ifdef CONFIG_LPS rtw_set_ps_mode(padapter, PS_MODE_ACTIVE, 0, 0, "SRESET"); -#endif +#endif//#ifdef CONFIG_LPS _enter_pwrlock(&pwrpriv->lock); diff --git a/backports/drivers/realtek/rtl8812au/core/rtw_sta_mgt.c b/backports/drivers/realtek/rtl8812au/core/rtw_sta_mgt.c index f03f727d9ee6e8..be20de650e5e38 100755 --- a/backports/drivers/realtek/rtl8812au/core/rtw_sta_mgt.c +++ b/backports/drivers/realtek/rtl8812au/core/rtw_sta_mgt.c @@ -412,6 +412,7 @@ _func_enter_; preorder_ctrl->wend_b= 0xffff; //preorder_ctrl->wsize_b = (NR_RECVBUFF-2); preorder_ctrl->wsize_b = 64;//64; + preorder_ctrl->ampdu_size = RX_AMPDU_SIZE_INVALID; _rtw_init_queue(&preorder_ctrl->pending_recvframe_queue); @@ -456,13 +457,19 @@ u32 rtw_free_stainfo(_adapter *padapter , struct sta_info *psta) struct xmit_priv *pxmitpriv= &padapter->xmitpriv; struct sta_priv *pstapriv = &padapter->stapriv; struct hw_xmit *phwxmit; - + int pending_qcnt[4]; _func_enter_; if (psta == NULL) goto exit; + _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL0); + rtw_list_delete(&psta->hash_list); + RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_err_,("\n free number_%d stainfo with hwaddr = 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x \n",pstapriv->asoc_sta_count , psta->hwaddr[0], psta->hwaddr[1], psta->hwaddr[2],psta->hwaddr[3],psta->hwaddr[4],psta->hwaddr[5])); + pstapriv->asoc_sta_count --; + _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL0); + _enter_critical_bh(&psta->lock, &irqL0); psta->state &= ~_FW_LINKED; @@ -488,6 +495,7 @@ _func_enter_; rtw_list_delete(&(pstaxmitpriv->vo_q.tx_pending)); phwxmit = pxmitpriv->hwxmits; phwxmit->accnt -= pstaxmitpriv->vo_q.qcnt; + pending_qcnt[0] = pstaxmitpriv->vo_q.qcnt; pstaxmitpriv->vo_q.qcnt = 0; //_exit_critical_bh(&(pxmitpriv->vo_pending.lock), &irqL0); @@ -497,6 +505,7 @@ _func_enter_; rtw_list_delete(&(pstaxmitpriv->vi_q.tx_pending)); phwxmit = pxmitpriv->hwxmits+1; phwxmit->accnt -= pstaxmitpriv->vi_q.qcnt; + pending_qcnt[1] = pstaxmitpriv->vi_q.qcnt; pstaxmitpriv->vi_q.qcnt = 0; //_exit_critical_bh(&(pxmitpriv->vi_pending.lock), &irqL0); @@ -506,6 +515,7 @@ _func_enter_; rtw_list_delete(&(pstaxmitpriv->be_q.tx_pending)); phwxmit = pxmitpriv->hwxmits+2; phwxmit->accnt -= pstaxmitpriv->be_q.qcnt; + pending_qcnt[2] = pstaxmitpriv->be_q.qcnt; pstaxmitpriv->be_q.qcnt = 0; //_exit_critical_bh(&(pxmitpriv->be_pending.lock), &irqL0); @@ -515,15 +525,14 @@ _func_enter_; rtw_list_delete(&(pstaxmitpriv->bk_q.tx_pending)); phwxmit = pxmitpriv->hwxmits+3; phwxmit->accnt -= pstaxmitpriv->bk_q.qcnt; + pending_qcnt[3] = pstaxmitpriv->bk_q.qcnt; pstaxmitpriv->bk_q.qcnt = 0; //_exit_critical_bh(&(pxmitpriv->bk_pending.lock), &irqL0); - + + rtw_os_wake_queue_at_free_stainfo(padapter, pending_qcnt); + _exit_critical_bh(&pxmitpriv->lock, &irqL0); - rtw_list_delete(&psta->hash_list); - RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_err_,("\n free number_%d stainfo with hwaddr = 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x \n",pstapriv->asoc_sta_count , psta->hwaddr[0], psta->hwaddr[1], psta->hwaddr[2],psta->hwaddr[3],psta->hwaddr[4],psta->hwaddr[5])); - pstapriv->asoc_sta_count --; - // re-init sta_info; 20061114 // will be init in alloc_stainfo //_rtw_init_sta_xmit_priv(&psta->sta_xmitpriv); @@ -532,6 +541,7 @@ _func_enter_; _cancel_timer_ex(&psta->addba_retry_timer); #ifdef CONFIG_TDLS + psta->tdls_sta_state = TDLS_STATE_NONE; rtw_free_tdls_timer(psta); #endif //CONFIG_TDLS @@ -631,7 +641,9 @@ _func_enter_; _rtw_spinlock_free(&psta->lock); //_enter_critical_bh(&(pfree_sta_queue->lock), &irqL0); + _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL0); rtw_list_insert_tail(&psta->list, get_list_head(pfree_sta_queue)); + _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL0); //_exit_critical_bh(&(pfree_sta_queue->lock), &irqL0); exit: @@ -651,6 +663,9 @@ void rtw_free_all_stainfo(_adapter *padapter) struct sta_info *psta = NULL; struct sta_priv *pstapriv = &padapter->stapriv; struct sta_info* pbcmc_stainfo =rtw_get_bcmc_stainfo( padapter); + u8 free_sta_num = 0; + char free_sta_list[NUM_STA]; + int stainfo_offset; _func_enter_; @@ -670,13 +685,27 @@ _func_enter_; plist = get_next(plist); - if(pbcmc_stainfo!=psta) - rtw_free_stainfo(padapter , psta); + if(pbcmc_stainfo!=psta) + { + rtw_list_delete(&psta->hash_list); + //rtw_free_stainfo(padapter , psta); + stainfo_offset = rtw_stainfo_offset(pstapriv, psta); + if (stainfo_offset_valid(stainfo_offset)) { + free_sta_list[free_sta_num++] = stainfo_offset; + } + } } } _exit_critical_bh(&pstapriv->sta_hash_lock, &irqL); + + + for (index = 0; index < free_sta_num; index++) + { + psta = rtw_get_stainfo_by_offset(pstapriv, free_sta_list[index]); + rtw_free_stainfo(padapter , psta); + } exit: @@ -762,9 +791,6 @@ _func_enter_; goto exit; } - // default broadcast & multicast use macid 1 - psta->mac_id = 1; - ptxservq= &(psta->sta_xmitpriv.be_q); /* diff --git a/backports/drivers/realtek/rtl8812au/core/rtw_tdls.c b/backports/drivers/realtek/rtl8812au/core/rtw_tdls.c index a4a9c0a6623c3a..14c865ee321e1c 100755 --- a/backports/drivers/realtek/rtl8812au/core/rtw_tdls.c +++ b/backports/drivers/realtek/rtl8812au/core/rtw_tdls.c @@ -22,6 +22,8 @@ #include #ifdef CONFIG_TDLS +#define ONE_SEC 1000 /* 1000 ms */ + extern unsigned char MCS_rate_2R[16]; extern unsigned char MCS_rate_1R[16]; extern void process_wmmps_data(_adapter *padapter, union recv_frame *precv_frame); @@ -31,18 +33,38 @@ void rtw_reset_tdls_info(_adapter* padapter) struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; ptdlsinfo->ap_prohibited = _FALSE; + + /* For TDLS channel switch, currently we only allow it to work in wifi logo test mode */ + if (padapter->registrypriv.wifi_spec == 1) + { + ptdlsinfo->ch_switch_prohibited = _FALSE; + } + else + { + ptdlsinfo->ch_switch_prohibited = _TRUE; + } + ptdlsinfo->link_established = _FALSE; ptdlsinfo->sta_cnt = 0; ptdlsinfo->sta_maximum = _FALSE; + +#ifdef CONFIG_TDLS_CH_SW + ptdlsinfo->chsw_info.ch_sw_state = TDLS_STATE_NONE; + ATOMIC_SET(&ptdlsinfo->chsw_info.chsw_on, _FALSE); + ptdlsinfo->chsw_info.off_ch_num = 0; + ptdlsinfo->chsw_info.ch_offset = 0; + ptdlsinfo->chsw_info.cur_time = 0; + ptdlsinfo->chsw_info.delay_switch_back = _FALSE; + ptdlsinfo->chsw_info.dump_stack = _FALSE; +#endif + ptdlsinfo->ch_sensing = 0; - ptdlsinfo->cur_channel = 0; - ptdlsinfo->candidate_ch = 1; //when inplement channel switching, default candidate channel is 1 ptdlsinfo->watchdog_count = 0; - ptdlsinfo->dev_discovered = 0; + ptdlsinfo->dev_discovered = _FALSE; #ifdef CONFIG_WFD ptdlsinfo->wfd_info = &padapter->wfd_info; -#endif //CONFIG_WFD +#endif /* ONFIG_WFD */ } int rtw_init_tdls_info(_adapter* padapter) @@ -50,9 +72,15 @@ int rtw_init_tdls_info(_adapter* padapter) int res = _SUCCESS; struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; - ptdlsinfo->tdls_enable = _TRUE; rtw_reset_tdls_info(padapter); + ptdlsinfo->tdls_enable = _TRUE; +#ifdef CONFIG_TDLS_DRIVER_SETUP + ptdlsinfo->driver_setup = _TRUE; +#else + ptdlsinfo->driver_setup = _FALSE; +#endif /* CONFIG_TDLS_DRIVER_SETUP */ + _rtw_spinlock_init(&ptdlsinfo->cmd_lock); _rtw_spinlock_init(&ptdlsinfo->hdl_lock); @@ -69,6 +97,36 @@ void rtw_free_tdls_info(struct tdls_info *ptdlsinfo) } +int check_ap_tdls_prohibited(u8 *pframe, u8 pkt_len) +{ + u8 tdls_prohibited_bit = 0x40; /* bit(38); TDLS_prohibited */ + + if (pkt_len < 5) { + return _FALSE; + } + + pframe += 4; + if ((*pframe) & tdls_prohibited_bit) + return _TRUE; + + return _FALSE; +} + +int check_ap_tdls_ch_switching_prohibited(u8 *pframe, u8 pkt_len) +{ + u8 tdls_ch_swithcing_prohibited_bit = 0x80; /* bit(39); TDLS_channel_switching prohibited */ + + if (pkt_len < 5) { + return _FALSE; + } + + pframe += 4; + if ((*pframe) & tdls_ch_swithcing_prohibited_bit) + return _TRUE; + + return _FALSE; +} + int _issue_nulldata_to_TDLS_peer_STA(_adapter *padapter, unsigned char *da, unsigned int power_mode, int wait_ack) { int ret = _FAIL; @@ -76,19 +134,22 @@ int _issue_nulldata_to_TDLS_peer_STA(_adapter *padapter, unsigned char *da, unsi struct pkt_attrib *pattrib; unsigned char *pframe; struct rtw_ieee80211_hdr *pwlanhdr; - unsigned short *fctrl; + unsigned short *fctrl, *qc; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) - { goto exit; - } - //update attribute pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); + + pattrib->hdrlen +=2; + pattrib->qos_en = _TRUE; + pattrib->eosp = 1; + pattrib->ack_policy = 0; + pattrib->mdata = 0; pattrib->retry_ctrl = _FALSE; _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); @@ -99,12 +160,16 @@ int _issue_nulldata_to_TDLS_peer_STA(_adapter *padapter, unsigned char *da, unsi fctrl = &(pwlanhdr->frame_ctl); *(fctrl) = 0; - // SetToDs(fctrl); - if (power_mode) - { SetPwrMgt(fctrl); - } + + qc = (unsigned short *)(pframe + pattrib->hdrlen - 2); + + SetPriority(qc, 7); /* Set priority to VO */ + + SetEOSP(qc, pattrib->eosp); + + SetAckpolicy(qc, pattrib->ack_policy); _rtw_memcpy(pwlanhdr->addr1, da, ETH_ALEN); _rtw_memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); @@ -112,19 +177,16 @@ int _issue_nulldata_to_TDLS_peer_STA(_adapter *padapter, unsigned char *da, unsi SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - SetFrameSubType(pframe, WIFI_DATA_NULL); + SetFrameSubType(pframe, WIFI_QOS_DATA_NULL); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr); - pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += sizeof(struct rtw_ieee80211_hdr_3addr_qos); + pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr_qos); pattrib->last_txcmdsz = pattrib->pktlen; - if(wait_ack) - { + if (wait_ack) ret = dump_mgntframe_and_wait_ack(padapter, pmgntframe); - } - else - { + else { dump_mgntframe(padapter, pmgntframe); ret = _SUCCESS; } @@ -133,7 +195,6 @@ int _issue_nulldata_to_TDLS_peer_STA(_adapter *padapter, unsigned char *da, unsi return ret; } - int issue_nulldata_to_TDLS_peer_STA(_adapter *padapter, unsigned char *da, unsigned int power_mode, int try_cnt, int wait_ms) { int ret; @@ -142,7 +203,6 @@ int issue_nulldata_to_TDLS_peer_STA(_adapter *padapter, unsigned char *da, unsig struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - //[TDLS] UAPSD : merge this from issue_nulldata() and mark it first. #if 0 psta = rtw_get_stainfo(&padapter->stapriv, da); if (psta) { @@ -157,8 +217,7 @@ int issue_nulldata_to_TDLS_peer_STA(_adapter *padapter, unsigned char *da, unsig } #endif - do - { + do { ret = _issue_nulldata_to_TDLS_peer_STA(padapter, da, power_mode, wait_ms>0 ? _TRUE : _FALSE); i++; @@ -166,10 +225,10 @@ int issue_nulldata_to_TDLS_peer_STA(_adapter *padapter, unsigned char *da, unsig if (padapter->bDriverStopped || padapter->bSurpriseRemoved) break; - if(i < try_cnt && wait_ms > 0 && ret==_FAIL) + if (i < try_cnt && wait_ms > 0 && ret == _FAIL) rtw_msleep_os(wait_ms); - }while((istapriv; _irqL irqL; - //free peer sta_info + /* free peer sta_info */ _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); - if(ptdlsinfo->sta_cnt != 0) + if (ptdlsinfo->sta_cnt != 0) ptdlsinfo->sta_cnt--; _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); - if( ptdlsinfo->sta_cnt < (NUM_STA - 2 - 4) ) // -2: AP + BC/MC sta, -4: default key - { + /* -2: AP + BC/MC sta, -4: default key */ + if (ptdlsinfo->sta_cnt < MAX_ALLOWED_TDLS_STA_NUM) { ptdlsinfo->sta_maximum = _FALSE; _rtw_memset( &ptdlsinfo->ss_record, 0x00, sizeof(struct tdls_ss_record) ); } - //clear cam - rtw_clearstakey_cmd(padapter, (u8 *)ptdls_sta, (u8)rtw_get_camid(ptdls_sta->mac_id), _TRUE); + /* clear cam */ + rtw_clearstakey_cmd(padapter, ptdls_sta, _TRUE); - if(ptdlsinfo->sta_cnt==0){ - rtw_tdls_cmd(padapter, myid(&(padapter->eeprompriv)), TDLS_RS_RCR); + if (ptdlsinfo->sta_cnt == 0) { + rtw_tdls_cmd(padapter, NULL, TDLS_RS_RCR); ptdlsinfo->link_established = _FALSE; } else @@ -224,65 +283,48 @@ void free_tdls_sta(_adapter *padapter, struct sta_info *ptdls_sta) } -//TDLS encryption(if needed) will always be CCMP -void rtw_tdls_set_key(_adapter *padapter, struct rx_pkt_attrib *prx_pkt_attrib, struct sta_info *ptdls_sta) +/* TDLS encryption(if needed) will always be CCMP */ +void rtw_tdls_set_key(_adapter *padapter, struct sta_info *ptdls_sta) { - if(prx_pkt_attrib->encrypt) - { - ptdls_sta->dot118021XPrivacy=_AES_; - rtw_setstakey_cmd(padapter, (u8*)ptdls_sta, _TRUE, _TRUE); - } + ptdls_sta->dot118021XPrivacy=_AES_; + rtw_setstakey_cmd(padapter, ptdls_sta, TDLS_KEY, _TRUE); } void rtw_tdls_process_ht_cap(_adapter *padapter, struct sta_info *ptdls_sta, u8 *data, u8 Length) { - /* save HT capabilities in the sta object */ + /* Save HT capabilities in the sta object */ _rtw_memset(&ptdls_sta->htpriv.ht_cap, 0, sizeof(struct rtw_ieee80211_ht_cap)); - if (data && Length >= sizeof(struct rtw_ieee80211_ht_cap) ) - { + if (data && Length >= sizeof(struct rtw_ieee80211_ht_cap)) { ptdls_sta->flags |= WLAN_STA_HT; - ptdls_sta->flags |= WLAN_STA_WME; - + _rtw_memcpy(&ptdls_sta->htpriv.ht_cap, data, sizeof(struct rtw_ieee80211_ht_cap)); - } else ptdls_sta->flags &= ~WLAN_STA_HT; - if(ptdls_sta->flags & WLAN_STA_HT) - { - if(padapter->registrypriv.ht_enable == _TRUE) - { + if (ptdls_sta->flags & WLAN_STA_HT) { + if (padapter->registrypriv.ht_enable == _TRUE) ptdls_sta->htpriv.ht_option = _TRUE; - } else - { ptdls_sta->htpriv.ht_option = _FALSE; - ptdls_sta->stat_code = _STATS_FAILURE_; - } } - //HT related cap - if(ptdls_sta->htpriv.ht_option) - { - //check if sta supports rx ampdu - if(padapter->registrypriv.ampdu_enable==1) + /* HT related cap */ + if (ptdls_sta->htpriv.ht_option) { + /* Check if sta supports rx ampdu */ + if (padapter->registrypriv.ampdu_enable == 1) ptdls_sta->htpriv.ampdu_enable = _TRUE; - //check if sta support s Short GI 20M - if(ptdls_sta->htpriv.ht_cap.cap_info & cpu_to_le16(IEEE80211_HT_CAP_SGI_20)) - { + /* Check if sta support s Short GI 20M */ + if (ptdls_sta->htpriv.ht_cap.cap_info & cpu_to_le16(IEEE80211_HT_CAP_SGI_20)) ptdls_sta->htpriv.sgi_20m = _TRUE; - } - //check if sta support s Short GI 40M - if(ptdls_sta->htpriv.ht_cap.cap_info & cpu_to_le16(IEEE80211_HT_CAP_SGI_40)) - { + + /* Check if sta support s Short GI 40M */ + if (ptdls_sta->htpriv.ht_cap.cap_info & cpu_to_le16(IEEE80211_HT_CAP_SGI_40)) ptdls_sta->htpriv.sgi_40m = _TRUE; - } - // bwmode would still followed AP's setting - if(ptdls_sta->htpriv.ht_cap.cap_info & cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH)) - { + /* Bwmode would still followed AP's setting */ + if (ptdls_sta->htpriv.ht_cap.cap_info & cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH)) { if (padapter->mlmeextpriv.cur_bwmode >= CHANNEL_WIDTH_40) ptdls_sta->bw_mode = CHANNEL_WIDTH_40; ptdls_sta->htpriv.ch_offset = padapter->mlmeextpriv.cur_ch_offset; @@ -291,17 +333,13 @@ void rtw_tdls_process_ht_cap(_adapter *padapter, struct sta_info *ptdls_sta, u8 } -int rtw_tdls_set_ht_cap(_adapter *padapter, u8 *pframe, struct pkt_attrib *pattrib) +u8 *rtw_tdls_set_ht_cap(_adapter *padapter, u8 *pframe, struct pkt_attrib *pattrib) { - int tmplen; - rtw_ht_use_default_setting(padapter); - tmplen = pattrib->pktlen; rtw_restructure_ht_ie(padapter, NULL, pframe, 0, &(pattrib->pktlen), padapter->mlmeextpriv.cur_channel); - return (pattrib->pktlen - tmplen); - + return pframe + pattrib->pktlen; } u8 *rtw_tdls_set_sup_ch(struct mlme_ext_priv *pmlmeext, u8 *pframe, struct pkt_attrib *pattrib) @@ -310,64 +348,266 @@ u8 *rtw_tdls_set_sup_ch(struct mlme_ext_priv *pmlmeext, u8 *pframe, struct pkt_a u8 ch_24g = 0, b1 = 0, b4 = 0; u8 bit_table = 0, sup_ch_idx = 0; - do{ - if( pmlmeext->channel_set[ch_set_idx].ChannelNum >= 1 && - pmlmeext->channel_set[ch_set_idx].ChannelNum <= 14 ) - { - ch_24g = 1; // 2.4 G channels - } - else if( pmlmeext->channel_set[ch_set_idx].ChannelNum >= 36 && + do { + if (pmlmeext->channel_set[ch_set_idx].ChannelNum >= 1 && + pmlmeext->channel_set[ch_set_idx].ChannelNum <= 14) + ch_24g = 1; /* 2.4 G channels */ + else if (pmlmeext->channel_set[ch_set_idx].ChannelNum >= 36 && pmlmeext->channel_set[ch_set_idx].ChannelNum <= 48) - { - b1 = 1; // 5 G band1 - } - else if( pmlmeext->channel_set[ch_set_idx].ChannelNum >= 149 && + b1 = 1; /* 5 G band1 */ + else if (pmlmeext->channel_set[ch_set_idx].ChannelNum >= 149 && pmlmeext->channel_set[ch_set_idx].ChannelNum <= 165) - { - b4 = 1; // 5 G band4 - } - else - { - ch_set_idx++; // We don't claim that we support DFS channels. + b4 = 1; /* 5 G band4 */ + else { + ch_set_idx++; /* We don't support DFS channels. */ continue; } sup_ch_idx = (ch_24g + b1 + b4 - 1) * 2; - if( sup_ch_idx >= 0) - { - if(sup_ch[sup_ch_idx] == 0) + if (sup_ch_idx >= 0) { + if (sup_ch[sup_ch_idx] == 0) sup_ch[sup_ch_idx] = pmlmeext->channel_set[ch_set_idx].ChannelNum; sup_ch[sup_ch_idx+1]++; //Number of channel } ch_set_idx++; - } - while( pmlmeext->channel_set[ch_set_idx].ChannelNum != 0 && ch_set_idx < MAX_CHANNEL_NUM ); + } while (pmlmeext->channel_set[ch_set_idx].ChannelNum != 0 && ch_set_idx < MAX_CHANNEL_NUM); return(rtw_set_ie(pframe, _SUPPORTED_CH_IE_, sup_ch_idx+2, sup_ch, &(pattrib->pktlen))); } +u8 *rtw_tdls_set_rsnie(struct tdls_txmgmt *ptxmgmt, u8 *pframe, struct pkt_attrib *pattrib, int init, struct sta_info *ptdls_sta) +{ + u8 *p = NULL; + int len = 0; + + if (ptxmgmt->len > 0) + p = rtw_get_ie(ptxmgmt->buf, _RSN_IE_2_, &len, ptxmgmt->len); + + if (p != NULL) + return rtw_set_ie(pframe, _RSN_IE_2_, len, p+2, &(pattrib->pktlen)); + else + if (init == _TRUE) + return rtw_set_ie(pframe, _RSN_IE_2_, sizeof(TDLS_RSNIE), TDLS_RSNIE, &(pattrib->pktlen)); + else + return rtw_set_ie(pframe, _RSN_IE_2_, sizeof(ptdls_sta->TDLS_RSNIE), ptdls_sta->TDLS_RSNIE, &(pattrib->pktlen)); +} + +u8 *rtw_tdls_set_ext_cap(u8 *pframe, struct pkt_attrib *pattrib) +{ + return rtw_set_ie(pframe, _EXT_CAP_IE_ , sizeof(TDLS_EXT_CAPIE), TDLS_EXT_CAPIE, &(pattrib->pktlen)); +} + +u8 *rtw_tdls_set_qos_cap(u8 *pframe, struct pkt_attrib *pattrib) +{ + return rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, sizeof(TDLS_WMMIE), TDLS_WMMIE, &(pattrib->pktlen)); +} + +u8 *rtw_tdls_set_ftie(struct tdls_txmgmt *ptxmgmt, u8 *pframe, struct pkt_attrib *pattrib, u8 *ANonce, u8 *SNonce) +{ + struct wpa_tdls_ftie FTIE = {0}; + u8 *p = NULL; + int len = 0; + + if (ptxmgmt->len > 0) + p = rtw_get_ie(ptxmgmt->buf, _FTIE_, &len, ptxmgmt->len); + + if (p != NULL) + return rtw_set_ie(pframe, _FTIE_, len, p+2, &(pattrib->pktlen)); + else { + if (ANonce != NULL) + _rtw_memcpy(FTIE.Anonce, ANonce, WPA_NONCE_LEN); + if (SNonce != NULL) + _rtw_memcpy(FTIE.Snonce, SNonce, WPA_NONCE_LEN); + return rtw_set_ie(pframe, _FTIE_ , 82, (u8 *)FTIE.mic_ctrl, &(pattrib->pktlen)); + } +} + +u8 *rtw_tdls_set_timeout_interval(struct tdls_txmgmt *ptxmgmt, u8 *pframe, struct pkt_attrib *pattrib, int init, struct sta_info *ptdls_sta) +{ + u8 timeout_itvl[5]; /* set timeout interval to maximum value */ + u32 timeout_interval= TPK_RESEND_COUNT; + u8 *p = NULL; + int len = 0; + + if (ptxmgmt->len > 0) + p = rtw_get_ie(ptxmgmt->buf, _TIMEOUT_ITVL_IE_, &len, ptxmgmt->len); + + if (p != NULL) + return rtw_set_ie(pframe, _TIMEOUT_ITVL_IE_, len, p+2, &(pattrib->pktlen)); + else { + /* Timeout interval */ + timeout_itvl[0]=0x02; + if (init == _TRUE) + _rtw_memcpy(timeout_itvl+1, &timeout_interval, 4); + else + _rtw_memcpy(timeout_itvl+1, (u8 *)(&ptdls_sta->TDLS_PeerKey_Lifetime), 4); + + return rtw_set_ie(pframe, _TIMEOUT_ITVL_IE_, 5, timeout_itvl, &(pattrib->pktlen)); + } +} + +u8 *rtw_tdls_set_bss_coexist(_adapter *padapter, u8 *pframe, struct pkt_attrib *pattrib) +{ + u8 iedata=0; + + if (padapter->mlmepriv.num_FortyMHzIntolerant > 0) + iedata |= BIT(2); /* 20 MHz BSS Width Request */ + + /* Information Bit should be set by TDLS test plan 5.9 */ + iedata |= BIT(0); + return rtw_set_ie(pframe, EID_BSSCoexistence, 1, &iedata, &(pattrib->pktlen)); +} + +u8 *rtw_tdls_set_payload_type(u8 *pframe, struct pkt_attrib *pattrib) +{ + u8 payload_type = 0x02; + return rtw_set_fixed_ie(pframe, 1, &(payload_type), &(pattrib->pktlen)); +} + +u8 *rtw_tdls_set_category(u8 *pframe, struct pkt_attrib *pattrib, u8 category) +{ + return rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); +} + +u8 *rtw_tdls_set_action(u8 *pframe, struct pkt_attrib *pattrib, struct tdls_txmgmt *ptxmgmt) +{ + return rtw_set_fixed_ie(pframe, 1, &(ptxmgmt->action_code), &(pattrib->pktlen)); +} + +u8 *rtw_tdls_set_status_code(u8 *pframe, struct pkt_attrib *pattrib, struct tdls_txmgmt *ptxmgmt) +{ + return rtw_set_fixed_ie(pframe, 2, (u8 *)&(ptxmgmt->status_code), &(pattrib->pktlen)); +} + +u8 *rtw_tdls_set_dialog(u8 *pframe, struct pkt_attrib *pattrib, struct tdls_txmgmt *ptxmgmt) +{ + u8 dialogtoken = 1; + if (ptxmgmt->dialog_token) + return rtw_set_fixed_ie(pframe, 1, &(ptxmgmt->dialog_token), &(pattrib->pktlen)); + else + return rtw_set_fixed_ie(pframe, 1, &(dialogtoken), &(pattrib->pktlen)); +} + +u8 *rtw_tdls_set_reg_class(u8 *pframe, struct pkt_attrib *pattrib, struct sta_info *ptdls_sta) +{ + u8 reg_class = 1; + return rtw_set_fixed_ie(pframe, 1, &(reg_class), &(pattrib->pktlen)); +} + +u8 *rtw_tdls_set_capability(_adapter *padapter, u8 *pframe, struct pkt_attrib *pattrib) +{ + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; + struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; + u8 cap_from_ie[2] = {0}; + + _rtw_memcpy(cap_from_ie, rtw_get_capability_from_ie(pmlmeinfo->network.IEs), 2); + + return rtw_set_fixed_ie(pframe, 2, cap_from_ie, &(pattrib->pktlen)); +} + +u8 *rtw_tdls_set_supported_rate(_adapter *padapter, u8 *pframe, struct pkt_attrib *pattrib) +{ + u8 bssrate[NDIS_802_11_LENGTH_RATES_EX]; + int bssrate_len = 0; + u8 more_supportedrates = 0; + + rtw_set_supported_rate(bssrate, padapter->registrypriv.wireless_mode); + bssrate_len = rtw_get_rateset_len(bssrate); + + if (bssrate_len > 8) { + pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , 8, bssrate, &(pattrib->pktlen)); + more_supportedrates = 1; + } else { + pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , bssrate_len , bssrate, &(pattrib->pktlen)); + } + + /* extended supported rates */ + if (more_supportedrates == 1) { + pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_ , (bssrate_len - 8), (bssrate + 8), &(pattrib->pktlen)); + } + + return pframe; +} + +u8 *rtw_tdls_set_sup_reg_class(u8 *pframe, struct pkt_attrib *pattrib) +{ + return rtw_set_ie(pframe, _SRC_IE_ , sizeof(TDLS_SRC), TDLS_SRC, &(pattrib->pktlen)); +} + +u8 *rtw_tdls_set_linkid(u8 *pframe, struct pkt_attrib *pattrib, u8 init) +{ + u8 link_id_addr[18] = {0}; + if (init == _TRUE) { + _rtw_memcpy(link_id_addr, pattrib->ra, 6); + _rtw_memcpy((link_id_addr+6), pattrib->src, 6); + _rtw_memcpy((link_id_addr+12), pattrib->dst, 6); + } else { + _rtw_memcpy(link_id_addr, pattrib->ra, 6); + _rtw_memcpy((link_id_addr+6), pattrib->dst, 6); + _rtw_memcpy((link_id_addr+12), pattrib->src, 6); + } + return rtw_set_ie(pframe, _LINK_ID_IE_, 18, link_id_addr, &(pattrib->pktlen)); +} + +#ifdef CONFIG_TDLS_CH_SW +u8 *rtw_tdls_set_target_ch(_adapter *padapter, u8 *pframe, struct pkt_attrib *pattrib) +{ + u8 target_ch = 1; + if (padapter->tdlsinfo.chsw_info.off_ch_num) + return rtw_set_fixed_ie(pframe, 1, &(padapter->tdlsinfo.chsw_info.off_ch_num), &(pattrib->pktlen)); + else + return rtw_set_fixed_ie(pframe, 1, &(target_ch), &(pattrib->pktlen)); +} + +u8 *rtw_tdls_set_ch_sw(u8 *pframe, struct pkt_attrib *pattrib, struct sta_info *ptdls_sta) +{ + u8 ch_switch_timing[4] = {0}; + u16 switch_time = (ptdls_sta->ch_switch_time >= CH_SWITCH_TIME * 1000) ? + ptdls_sta->ch_switch_time : CH_SWITCH_TIME; + u16 switch_timeout = (ptdls_sta->ch_switch_timeout >= CH_SWITCH_TIMEOUT * 1000) ? + ptdls_sta->ch_switch_timeout : CH_SWITCH_TIMEOUT; + + _rtw_memcpy(ch_switch_timing, &switch_time, 2); + _rtw_memcpy(ch_switch_timing + 2, &switch_timeout, 2); + + return rtw_set_ie(pframe, _CH_SWITCH_TIMING_, 4, ch_switch_timing, &(pattrib->pktlen)); +} +#endif + +u8 *rtw_tdls_set_wmm_params(_adapter *padapter, u8 *pframe, struct pkt_attrib *pattrib) +{ + struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + u8 wmm_param_ele[24] = {0}; + + if (&pmlmeinfo->WMM_param) { + _rtw_memcpy(wmm_param_ele, WMM_PARA_OUI, 6); + _rtw_memcpy(wmm_param_ele + 6, (u8 *)&pmlmeinfo->WMM_param, sizeof(pmlmeinfo->WMM_param)); + return rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, 24, wmm_param_ele, &(pattrib->pktlen)); + } + else + return pframe; +} + #ifdef CONFIG_WFD void rtw_tdls_process_wfd_ie(struct tdls_info *ptdlsinfo, u8 *ptr, u8 length) { u8 wfd_ie[ 128 ] = { 0x00 }; u32 wfd_ielen = 0; u32 wfd_offset = 0; - // Try to get the TCP port information when receiving the negotiation response. - // + /* Try to get the TCP port information when receiving the negotiation response. */ wfd_offset = 0; wfd_offset = rtw_get_wfd_ie( ptr + wfd_offset, length - wfd_offset, wfd_ie, &wfd_ielen ); - while( wfd_offset ) - { + while (wfd_offset) { u8 attr_content[ 10 ] = { 0x00 }; u32 attr_contentlen = 0; int i; DBG_871X( "[%s] WFD IE Found!!\n", __FUNCTION__ ); rtw_get_wfd_attr_content( wfd_ie, wfd_ielen, WFD_ATTR_DEVICE_INFO, attr_content, &attr_contentlen); - if ( attr_contentlen ) - { + if (attr_contentlen) { ptdlsinfo->wfd_info->peer_rtsp_ctrlport = RTW_GET_BE16( attr_content + 2 ); DBG_871X( "[%s] Peer PORT NUM = %d\n", __FUNCTION__, ptdlsinfo->wfd_info->peer_rtsp_ctrlport ); } @@ -375,13 +615,11 @@ void rtw_tdls_process_wfd_ie(struct tdls_info *ptdlsinfo, u8 *ptr, u8 length) _rtw_memset( attr_content, 0x00, 10); attr_contentlen = 0; rtw_get_wfd_attr_content( wfd_ie, wfd_ielen, WFD_ATTR_LOCAL_IP_ADDR, attr_content, &attr_contentlen); - if ( attr_contentlen ) - { + if (attr_contentlen) { _rtw_memcpy(ptdlsinfo->wfd_info->peer_ip_address, ( attr_content + 1 ), 4); DBG_871X( "[%s] Peer IP = %02u.%02u.%02u.%02u \n", __FUNCTION__, ptdlsinfo->wfd_info->peer_ip_address[0], ptdlsinfo->wfd_info->peer_ip_address[1], - ptdlsinfo->wfd_info->peer_ip_address[2], ptdlsinfo->wfd_info->peer_ip_address[3] - ); + ptdlsinfo->wfd_info->peer_ip_address[2], ptdlsinfo->wfd_info->peer_ip_address[3]); } wfd_offset = rtw_get_wfd_ie( ptr + wfd_offset, length - wfd_offset, wfd_ie, &wfd_ielen ); } @@ -403,11 +641,8 @@ int issue_tunneled_probe_req(_adapter *padapter) txmgmt.action_code = TUNNELED_PROBE_REQ; if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) - { goto exit; - } - - //update attribute + pattrib = &pmgntframe->attrib; pmgntframe->frame_tag = DATA_FRAMETAG; @@ -447,11 +682,8 @@ int issue_tunneled_probe_rsp(_adapter *padapter, union recv_frame *precv_frame) txmgmt.action_code = TUNNELED_PROBE_RSP; if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) - { goto exit; - } - - //update attribute + pattrib = &pmgntframe->attrib; pmgntframe->frame_tag = DATA_FRAMETAG; @@ -475,7 +707,7 @@ int issue_tunneled_probe_rsp(_adapter *padapter, union recv_frame *precv_frame) return ret; } -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ int issue_tdls_setup_req(_adapter *padapter, struct tdls_txmgmt *ptxmgmt, int wait_ack) { @@ -487,20 +719,19 @@ int issue_tdls_setup_req(_adapter *padapter, struct tdls_txmgmt *ptxmgmt, int wa struct sta_priv *pstapriv = &padapter->stapriv; struct sta_info *ptdls_sta= NULL; _irqL irqL; - static u8 dialogtoken = 0; int ret = _FAIL; - u32 timeout_interval= TPK_RESEND_COUNT * 1000; //retry timer should set at least 301 sec, using TPK_count counting 301 times. + /* Retry timer should be set at least 301 sec, using TPK_count counting 301 times. */ + u32 timeout_interval= TPK_RESEND_COUNT; + + DBG_871X("[TDLS] %s\n", __FUNCTION__); ptxmgmt->action_code = TDLS_SETUP_REQUEST; - if(ptdlsinfo->ap_prohibited == _TRUE) + if (ptdlsinfo->ap_prohibited == _TRUE) goto exit; if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) - { goto exit; - } - - //update attribute + pattrib = &pmgntframe->attrib; pmgntframe->frame_tag = DATA_FRAMETAG; pattrib->ether_type = 0x890d; @@ -512,13 +743,11 @@ int issue_tdls_setup_req(_adapter *padapter, struct tdls_txmgmt *ptxmgmt, int wa update_tdls_attrib(padapter, pattrib); - //init peer sta_info + /* init peer sta_info */ ptdls_sta = rtw_get_stainfo(pstapriv, ptxmgmt->peer); - if(ptdls_sta==NULL) - { + if (ptdls_sta == NULL) { ptdls_sta = rtw_alloc_stainfo(pstapriv, ptxmgmt->peer); - if(ptdls_sta==NULL) - { + if (ptdls_sta == NULL) { DBG_871X("[%s] rtw_alloc_stainfo fail\n", __FUNCTION__); rtw_free_xmitbuf(pxmitpriv,pmgntframe->pxmitbuf); rtw_free_xmitframe(pxmitpriv, pmgntframe); @@ -528,21 +757,20 @@ int issue_tdls_setup_req(_adapter *padapter, struct tdls_txmgmt *ptxmgmt, int wa if(!(ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE)) ptdlsinfo->sta_cnt++; - if( ptdlsinfo->sta_cnt == (NUM_STA - 2 - 4) ) // -2: AP + BC/MC sta, -4: default key - { + + if (ptdlsinfo->sta_cnt == MAX_ALLOWED_TDLS_STA_NUM) ptdlsinfo->sta_maximum = _TRUE; - } ptdls_sta->tdls_sta_state |= TDLS_RESPONDER_STATE; - //for tdls; ptdls_sta->aid is used to fill dialogtoken - ptdls_sta->dialog = dialogtoken; - dialogtoken = (dialogtoken+1)%256; - ptdls_sta->TDLS_PeerKey_Lifetime = timeout_interval; - _set_timer( &ptdls_sta->handshake_timer, TDLS_HANDSHAKE_TIME ); + + if (rtw_tdls_is_driver_setup(padapter) == _TRUE) { + ptdls_sta->TDLS_PeerKey_Lifetime = timeout_interval; + _set_timer(&ptdls_sta->handshake_timer, TDLS_HANDSHAKE_TIME); + } pattrib->qsel = pattrib->priority; - if(rtw_xmit_tdls_coalesce(padapter, pmgntframe, ptxmgmt) !=_SUCCESS ){ + if (rtw_xmit_tdls_coalesce(padapter, pmgntframe, ptxmgmt) !=_SUCCESS) { rtw_free_xmitbuf(pxmitpriv,pmgntframe->pxmitbuf); rtw_free_xmitframe(pxmitpriv, pmgntframe); goto exit; @@ -555,8 +783,6 @@ int issue_tdls_setup_req(_adapter *padapter, struct tdls_txmgmt *ptxmgmt, int wa ret = _SUCCESS; } - ret = _SUCCESS; - exit: return ret; @@ -573,19 +799,18 @@ int issue_tdls_teardown(_adapter *padapter, struct tdls_txmgmt *ptxmgmt, u8 wait _irqL irqL; int ret = _FAIL; + DBG_871X("[TDLS] %s\n", __FUNCTION__); + ptxmgmt->action_code = TDLS_TEARDOWN; ptdls_sta = rtw_get_stainfo(pstapriv, ptxmgmt->peer); - if(ptdls_sta==NULL){ + if (ptdls_sta == NULL) { DBG_871X("Np tdls_sta for tearing down\n"); goto exit; } if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) - { goto exit; - } - - //update attribute + pattrib = &pmgntframe->attrib; pmgntframe->frame_tag = DATA_FRAMETAG; @@ -604,6 +829,11 @@ int issue_tdls_teardown(_adapter *padapter, struct tdls_txmgmt *ptxmgmt, u8 wait goto exit; } + if (rtw_tdls_is_driver_setup(padapter) == _TRUE) + if(ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE) + if (pattrib->encrypt) + _cancel_timer_ex(&ptdls_sta->TPK_timer); + if (wait_ack) { ret = dump_mgntframe_and_wait_ack(padapter, pmgntframe); } else { @@ -611,21 +841,8 @@ int issue_tdls_teardown(_adapter *padapter, struct tdls_txmgmt *ptxmgmt, u8 wait ret = _SUCCESS; } - if(ret == _SUCCESS) - { - if(ptdls_sta->tdls_sta_state & TDLS_CH_SWITCH_ON_STATE){ - rtw_tdls_cmd(padapter, ptdls_sta->hwaddr, TDLS_CS_OFF); - } - - if( ptdls_sta->timer_flag == 1 ) - { - _enter_critical_bh(&(padapter->tdlsinfo.hdl_lock), &irqL); - ptdls_sta->timer_flag = 2; - _exit_critical_bh(&(padapter->tdlsinfo.hdl_lock), &irqL); - } - else - rtw_tdls_cmd(padapter, ptxmgmt->peer, TDLS_TEAR_STA ); - } + if (ret == _SUCCESS && rtw_tdls_is_driver_setup(padapter)) + rtw_tdls_cmd(padapter, ptxmgmt->peer, TDLS_TEAR_STA); exit: @@ -640,13 +857,12 @@ int issue_tdls_dis_req(_adapter *padapter, struct tdls_txmgmt *ptxmgmt) struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); int ret = _FAIL; + DBG_871X("[TDLS] %s\n", __FUNCTION__); + ptxmgmt->action_code = TDLS_DISCOVERY_REQUEST; if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) - { goto exit; - } - //update attribute pattrib = &pmgntframe->attrib; pmgntframe->frame_tag = DATA_FRAMETAG; pattrib->ether_type = 0x890d; @@ -679,13 +895,12 @@ int issue_tdls_setup_rsp(_adapter *padapter, struct tdls_txmgmt *ptxmgmt) struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); int ret = _FAIL; + DBG_871X("[TDLS] %s\n", __FUNCTION__); + ptxmgmt->action_code = TDLS_SETUP_RESPONSE; if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) - { goto exit; - } - - //update attribute + pattrib = &pmgntframe->attrib; pmgntframe->frame_tag = DATA_FRAMETAG; pattrib->ether_type = 0x890d; @@ -720,13 +935,12 @@ int issue_tdls_setup_cfm(_adapter *padapter, struct tdls_txmgmt *ptxmgmt) struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); int ret = _FAIL; + DBG_871X("[TDLS] %s\n", __FUNCTION__); + ptxmgmt->action_code = TDLS_SETUP_CONFIRM; if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) - { goto exit; - } - - //update attribute + pattrib = &pmgntframe->attrib; pmgntframe->frame_tag = DATA_FRAMETAG; pattrib->ether_type = 0x890d; @@ -753,7 +967,7 @@ int issue_tdls_setup_cfm(_adapter *padapter, struct tdls_txmgmt *ptxmgmt) } -//TDLS Discovery Response frame is a management action frame +/* TDLS Discovery Response frame is a management action frame */ int issue_tdls_dis_rsp(_adapter *padapter, struct tdls_txmgmt *ptxmgmt, u8 privacy) { struct xmit_frame *pmgntframe; @@ -765,12 +979,11 @@ int issue_tdls_dis_rsp(_adapter *padapter, struct tdls_txmgmt *ptxmgmt, u8 priva struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); int ret = _FAIL; + DBG_871X("[TDLS] %s\n", __FUNCTION__); + if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) - { goto exit; - } - //update attribute pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -782,14 +995,14 @@ int issue_tdls_dis_rsp(_adapter *padapter, struct tdls_txmgmt *ptxmgmt, u8 priva fctrl = &(pwlanhdr->frame_ctl); *(fctrl) = 0; - // unicast probe request frame + /* unicast probe request frame */ _rtw_memcpy(pwlanhdr->addr1, ptxmgmt->peer, ETH_ALEN); _rtw_memcpy(pattrib->dst, pwlanhdr->addr1, ETH_ALEN); _rtw_memcpy(pwlanhdr->addr2, myid(&padapter->eeprompriv), ETH_ALEN); _rtw_memcpy(pattrib->src, pwlanhdr->addr2, ETH_ALEN); _rtw_memcpy(pwlanhdr->addr3, get_bssid(&padapter->mlmepriv), ETH_ALEN); _rtw_memcpy(pattrib->ra, pwlanhdr->addr3, ETH_ALEN); - + SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; SetFrameSubType(pframe, WIFI_ACTION); @@ -797,7 +1010,7 @@ int issue_tdls_dis_rsp(_adapter *padapter, struct tdls_txmgmt *ptxmgmt, u8 priva pframe += sizeof (struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof (struct rtw_ieee80211_hdr_3addr); - rtw_build_tdls_dis_rsp_ies(padapter, pmgntframe, pframe, ptxmgmt->dialog_token, privacy); + rtw_build_tdls_dis_rsp_ies(padapter, pmgntframe, pframe, ptxmgmt, privacy); pattrib->nr_frags = 1; pattrib->last_txcmdsz = pattrib->pktlen; @@ -809,24 +1022,21 @@ int issue_tdls_dis_rsp(_adapter *padapter, struct tdls_txmgmt *ptxmgmt, u8 priva return ret; } -int issue_tdls_peer_traffic_rsp(_adapter *padapter, struct sta_info *ptdls_sta) +int issue_tdls_peer_traffic_rsp(_adapter *padapter, struct sta_info *ptdls_sta, struct tdls_txmgmt *ptxmgmt) { struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); - struct tdls_txmgmt txmgmt; int ret = _FAIL; - _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); - txmgmt.action_code = TDLS_PEER_TRAFFIC_RESPONSE; + DBG_871X("[TDLS] %s\n", __FUNCTION__); + + ptxmgmt->action_code = TDLS_PEER_TRAFFIC_RESPONSE; if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) - { goto exit; - } - - //update attribute + pattrib = &pmgntframe->attrib; pmgntframe->frame_tag = DATA_FRAMETAG; @@ -840,7 +1050,7 @@ int issue_tdls_peer_traffic_rsp(_adapter *padapter, struct sta_info *ptdls_sta) update_tdls_attrib(padapter, pattrib); pattrib->qsel = pattrib->priority; - if(rtw_xmit_tdls_coalesce(padapter, pmgntframe, &txmgmt) !=_SUCCESS ){ + if (rtw_xmit_tdls_coalesce(padapter, pmgntframe, ptxmgmt) !=_SUCCESS) { rtw_free_xmitbuf(pxmitpriv,pmgntframe->pxmitbuf); rtw_free_xmitframe(pxmitpriv, pmgntframe); goto exit; @@ -862,17 +1072,15 @@ int issue_tdls_peer_traffic_indication(_adapter *padapter, struct sta_info *ptdl struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct tdls_txmgmt txmgmt; int ret = _FAIL; - static u8 dialogtoken=0; + + DBG_871X("[TDLS] %s\n", __FUNCTION__); _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); txmgmt.action_code = TDLS_PEER_TRAFFIC_INDICATION; if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) - { goto exit; - } - - //update attribute + pattrib = &pmgntframe->attrib; pmgntframe->frame_tag = DATA_FRAMETAG; @@ -883,10 +1091,7 @@ int issue_tdls_peer_traffic_indication(_adapter *padapter, struct sta_info *ptdl _rtw_memcpy(pattrib->ra, get_bssid(pmlmepriv), ETH_ALEN); _rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN); - //for tdls; pattrib->nr_frags is used to fill dialogtoken - ptdls_sta->dialog = dialogtoken; - dialogtoken = (dialogtoken+1)%256; - //PTI frame's priority should be AC_VO + /* PTI frame's priority should be AC_VO */ pattrib->priority = 7; update_tdls_attrib(padapter, pattrib); @@ -905,7 +1110,7 @@ int issue_tdls_peer_traffic_indication(_adapter *padapter, struct sta_info *ptdl return ret; } -int issue_tdls_ch_switch_req(_adapter *padapter, u8 *mac_addr) +int issue_tdls_ch_switch_req(_adapter *padapter, struct sta_info *ptdls_sta) { struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; @@ -914,28 +1119,32 @@ int issue_tdls_ch_switch_req(_adapter *padapter, u8 *mac_addr) struct tdls_txmgmt txmgmt; int ret = _FAIL; - _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); + DBG_871X("[TDLS] %s\n", __FUNCTION__); + + if (padapter->tdlsinfo.ch_switch_prohibited == _TRUE) + { DBG_871X("[TDLS] Ignore %s since ch_switch_prohibited = _TRUE\n", __FUNCTION__); + goto exit; + } + + _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); txmgmt.action_code = TDLS_CHANNEL_SWITCH_REQUEST; if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) - { goto exit; - } - - //update attribute + pattrib = &pmgntframe->attrib; pmgntframe->frame_tag = DATA_FRAMETAG; pattrib->ether_type = 0x890d; - _rtw_memcpy(pattrib->dst, mac_addr, ETH_ALEN); + _rtw_memcpy(pattrib->dst, ptdls_sta->hwaddr, ETH_ALEN); _rtw_memcpy(pattrib->src, myid(&(padapter->eeprompriv)), ETH_ALEN); _rtw_memcpy(pattrib->ra, get_bssid(pmlmepriv), ETH_ALEN); _rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN); update_tdls_attrib(padapter, pattrib); pattrib->qsel = pattrib->priority; - if(rtw_xmit_tdls_coalesce(padapter, pmgntframe, &txmgmt) !=_SUCCESS ){ + if (rtw_xmit_tdls_coalesce(padapter, pmgntframe, &txmgmt) !=_SUCCESS) { rtw_free_xmitbuf(pxmitpriv,pmgntframe->pxmitbuf); rtw_free_xmitframe(pxmitpriv, pmgntframe); goto exit; @@ -948,30 +1157,32 @@ int issue_tdls_ch_switch_req(_adapter *padapter, u8 *mac_addr) return ret; } -int issue_tdls_ch_switch_rsp(_adapter *padapter, u8 *mac_addr) +int issue_tdls_ch_switch_rsp(_adapter *padapter, struct tdls_txmgmt *ptxmgmt, int wait_ack) { struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); - struct tdls_txmgmt txmgmt; int ret = _FAIL; - _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); - txmgmt.action_code = TDLS_CHANNEL_SWITCH_RESPONSE; + DBG_871X("[TDLS] %s\n", __FUNCTION__); - if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) - { + if (padapter->tdlsinfo.ch_switch_prohibited == _TRUE) + { DBG_871X("[TDLS] Ignore %s since ch_switch_prohibited = _TRUE\n", __FUNCTION__); goto exit; } - - //update attribute + + ptxmgmt->action_code = TDLS_CHANNEL_SWITCH_RESPONSE; + + if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) + goto exit; + pattrib = &pmgntframe->attrib; pmgntframe->frame_tag = DATA_FRAMETAG; pattrib->ether_type = 0x890d; - _rtw_memcpy(pattrib->dst, mac_addr, ETH_ALEN); + _rtw_memcpy(pattrib->dst, ptxmgmt->peer, ETH_ALEN); _rtw_memcpy(pattrib->src, myid(&(padapter->eeprompriv)), ETH_ALEN); _rtw_memcpy(pattrib->ra, get_bssid(pmlmepriv), ETH_ALEN); _rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN); @@ -985,12 +1196,18 @@ int issue_tdls_ch_switch_rsp(_adapter *padapter, u8 *mac_addr) return _FALSE; } */ - if(rtw_xmit_tdls_coalesce(padapter, pmgntframe, &txmgmt) !=_SUCCESS ){ + if (rtw_xmit_tdls_coalesce(padapter, pmgntframe, ptxmgmt) !=_SUCCESS) { rtw_free_xmitbuf(pxmitpriv,pmgntframe->pxmitbuf); rtw_free_xmitframe(pxmitpriv, pmgntframe); - goto exit; + goto exit; + } + + if (wait_ack) { + ret = dump_mgntframe_and_wait_ack(padapter, pmgntframe); + } else { + dump_mgntframe(padapter, pmgntframe); + ret = _SUCCESS; } - dump_mgntframe(padapter, pmgntframe); ret = _SUCCESS; exit: @@ -1010,55 +1227,40 @@ int On_TDLS_Dis_Rsp(_adapter *padapter, union recv_frame *precv_frame) int ret = _SUCCESS; _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); - //WFDTDLS: for sigma test, not to setup direct link automatically - ptdlsinfo->dev_discovered = 1; + /* WFDTDLS: for sigma test, not to setup direct link automatically */ + ptdlsinfo->dev_discovered = _TRUE; #ifdef CONFIG_TDLS_AUTOSETUP + psa = get_sa(ptr); ptdls_sta = rtw_get_stainfo(&(padapter->stapriv), psa); - if(ptdls_sta != NULL) - { + if (ptdls_sta != NULL) { ptdls_sta->tdls_sta_state |= TDLS_ALIVE_STATE; - //Record the tdls sta with lowest signal strength - if( (ptdlsinfo->sta_maximum == _TRUE) && (ptdls_sta->alive_count >= 1) ) - { - if( _rtw_memcmp(ptdlsinfo->ss_record.macaddr, empty_addr, ETH_ALEN) ) - { + /* Record the tdls sta with lowest signal strength */ + if (ptdlsinfo->sta_maximum == _TRUE && ptdls_sta->alive_count >= 1 ) { + if (_rtw_memcmp(ptdlsinfo->ss_record.macaddr, empty_addr, ETH_ALEN)) { _rtw_memcpy(ptdlsinfo->ss_record.macaddr, psa, ETH_ALEN); - ptdlsinfo->ss_record.RxPWDBAll = pattrib->RxPWDBAll; - } - else - { - if( ptdlsinfo->ss_record.RxPWDBAll < pattrib->RxPWDBAll ) - { + ptdlsinfo->ss_record.RxPWDBAll = pattrib->phy_info.RxPWDBAll; + } else { + if (ptdlsinfo->ss_record.RxPWDBAll < pattrib->phy_info.RxPWDBAll) { _rtw_memcpy(ptdlsinfo->ss_record.macaddr, psa, ETH_ALEN); - ptdlsinfo->ss_record.RxPWDBAll = pattrib->RxPWDBAll; + ptdlsinfo->ss_record.RxPWDBAll = pattrib->phy_info.RxPWDBAll; } } } - - } - else - { - if( ptdlsinfo->sta_maximum == _TRUE) - { - if( _rtw_memcmp( ptdlsinfo->ss_record.macaddr, empty_addr, ETH_ALEN ) ) - { - //All traffics are busy, do not set up another direct link. + } else { + if (ptdlsinfo->sta_maximum == _TRUE) { + if (_rtw_memcmp( ptdlsinfo->ss_record.macaddr, empty_addr, ETH_ALEN)) { + /* All traffics are busy, do not set up another direct link. */ ret = _FAIL; goto exit; - } - else - { - if( pattrib->RxPWDBAll > ptdlsinfo->ss_record.RxPWDBAll ) - { + } else { + if (pattrib->phy_info.RxPWDBAll > ptdlsinfo->ss_record.RxPWDBAll) { _rtw_memcpy(txmgmt.peer, ptdlsinfo->ss_record.macaddr, ETH_ALEN); - //issue_tdls_teardown(padapter, ptdlsinfo->ss_record.macaddr, _FALSE); - } - else - { + /* issue_tdls_teardown(padapter, ptdlsinfo->ss_record.macaddr, _FALSE); */ + } else { ret = _FAIL; goto exit; } @@ -1067,14 +1269,13 @@ int On_TDLS_Dis_Rsp(_adapter *padapter, union recv_frame *precv_frame) padapter->HalFunc.GetHalDefVarHandler(padapter, HAL_DEF_UNDERCORATEDSMOOTHEDPWDB, &UndecoratedSmoothedPWDB); - if( pattrib->RxPWDBAll + TDLS_SIGNAL_THRESH >= UndecoratedSmoothedPWDB); - { - DBG_871X("pattrib->RxPWDBAll=%d, pdmpriv->UndecoratedSmoothedPWDB=%d\n", pattrib->RxPWDBAll, UndecoratedSmoothedPWDB); + if (pattrib->phy_info.RxPWDBAll + TDLS_SIGNAL_THRESH >= UndecoratedSmoothedPWDB) { + DBG_871X("pattrib->RxPWDBAll=%d, pdmpriv->UndecoratedSmoothedPWDB=%d\n", pattrib->phy_info.RxPWDBAll, UndecoratedSmoothedPWDB); _rtw_memcpy(txmgmt.peer, psa, ETH_ALEN); issue_tdls_setup_req(padapter, &txmgmt, _FALSE); } } -#endif //CONFIG_TDLS_AUTOSETUP +#endif /* CONFIG_TDLS_AUTOSETUP */ exit: return ret; @@ -1097,20 +1298,23 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame) u8 ccmp_included=0, rsnie_included=0; u16 j, pairwise_count; u8 SNonce[32]; - u32 *timeout_interval=NULL; - sint parsing_length; //frame body length, without icv_len + u32 timeout_interval = TPK_RESEND_COUNT; + sint parsing_length; /* Frame body length, without icv_len */ PNDIS_802_11_VARIABLE_IEs pIE; u8 FIXED_IE = 5; unsigned char supportRate[16]; int supportRateNum = 0; struct tdls_txmgmt txmgmt; + if (ptdlsinfo->ap_prohibited == _TRUE) + goto exit; + _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); psa = get_sa(ptr); ptdls_sta = rtw_get_stainfo(pstapriv, psa); pmyid=myid(&(padapter->eeprompriv)); - ptr +=prx_pkt_attrib->hdrlen + prx_pkt_attrib->iv_len+LLC_HEADER_SIZE+TYPE_LENGTH_FIELD_SIZE+1; + ptr +=prx_pkt_attrib->hdrlen + prx_pkt_attrib->iv_len+LLC_HEADER_SIZE+ETH_TYPE_LEN+PAYLOAD_TYPE_LEN; parsing_length= ((union recv_frame *)precv_frame)->u.hdr.len -prx_pkt_attrib->hdrlen -prx_pkt_attrib->iv_len @@ -1120,33 +1324,28 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame) -PAYLOAD_TYPE_LEN -FIXED_IE; - if(ptdlsinfo->ap_prohibited == _TRUE) - { - goto exit; - } - - if(ptdls_sta==NULL){ + if (ptdls_sta == NULL) { ptdls_sta = rtw_alloc_stainfo(pstapriv, psa); - }else{ - if(ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE){ - //If the direct link is already set up - //Process as re-setup after tear down + } else { + if (ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE) { + /* If the direct link is already set up */ + /* Process as re-setup after tear down */ DBG_871X("re-setup a direct link\n"); } - //already receiving TDLS setup request - else if(ptdls_sta->tdls_sta_state & TDLS_INITIATOR_STATE){ + /* Already receiving TDLS setup request */ + else if (ptdls_sta->tdls_sta_state & TDLS_INITIATOR_STATE) { DBG_871X("receive duplicated TDLS setup request frame in handshaking\n"); goto exit; } - //When receiving and sending setup_req to the same link at the same time, STA with higher MAC_addr would be initiator - //following is to check out MAC_addr - else if(ptdls_sta->tdls_sta_state & TDLS_RESPONDER_STATE){ + /* When receiving and sending setup_req to the same link at the same time */ + /* STA with higher MAC_addr would be initiator */ + else if (ptdls_sta->tdls_sta_state & TDLS_RESPONDER_STATE) { DBG_871X("receive setup_req after sending setup_req\n"); for (i=0;i<6;i++){ if(*(pmyid+i)==*(psa+i)){ } else if(*(pmyid+i)>*(psa+i)){ - ptdls_sta->tdls_sta_state=TDLS_INITIATOR_STATE; + ptdls_sta->tdls_sta_state = TDLS_INITIATOR_STATE; break; }else if(*(pmyid+i)<*(psa+i)){ goto exit; @@ -1155,147 +1354,132 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame) } } - if(ptdls_sta) - { - ptdls_sta->dialog = *(ptr+2); //copy dialog token - ptdls_sta->stat_code = 0; + if (ptdls_sta) { + txmgmt.dialog_token = *(ptr+2); /* Copy dialog token */ + txmgmt.status_code = _STATS_SUCCESSFUL_; - //parsing information element - for(j=FIXED_IE; jElementID) - { - case _SUPPORTEDRATES_IE_: - _rtw_memcpy(supportRate, pIE->data, pIE->Length); - supportRateNum = pIE->Length; - break; - case _COUNTRY_IE_: - break; - case _EXT_SUPPORTEDRATES_IE_: - if(supportRateNum<=sizeof(supportRate)) - { - _rtw_memcpy(supportRate+supportRateNum, pIE->data, pIE->Length); - supportRateNum += pIE->Length; - } - break; - case _SUPPORTED_CH_IE_: - break; - case _RSN_IE_2_: - rsnie_included=1; - if(prx_pkt_attrib->encrypt){ - prsnie=(u8*)pIE; - //check whether initiator STA has CCMP pairwise_cipher. - ppairwise_cipher=prsnie+10; - _rtw_memcpy(ptdls_sta->TDLS_RSNIE, pIE->data, pIE->Length); - pairwise_count = *(u16*)(ppairwise_cipher-2); - for(k=0;kstat_code=72; - } - } - break; - case _EXT_CAP_IE_: - break; - case _VENDOR_SPECIFIC_IE_: - break; - case _FTIE_: - if(prx_pkt_attrib->encrypt) - _rtw_memcpy(SNonce, (ptr+j+52), 32); - break; - case _TIMEOUT_ITVL_IE_: - if(prx_pkt_attrib->encrypt) - timeout_interval = (u32 *)(ptr+j+3); - break; - case _RIC_Descriptor_IE_: - break; - case _HT_CAPABILITY_IE_: - rtw_tdls_process_ht_cap(padapter, ptdls_sta, pIE->data, pIE->Length); - break; - case EID_BSSCoexistence: - break; - case _LINK_ID_IE_: - if(_rtw_memcmp(get_bssid(pmlmepriv), pIE->data, 6) == _FALSE) - { - //not in the same BSS - ptdls_sta->stat_code=7; + switch (pIE->ElementID) { + case _SUPPORTEDRATES_IE_: + _rtw_memcpy(supportRate, pIE->data, pIE->Length); + supportRateNum = pIE->Length; + break; + case _COUNTRY_IE_: + break; + case _EXT_SUPPORTEDRATES_IE_: + if (supportRateNum<=sizeof(supportRate)) { + _rtw_memcpy(supportRate+supportRateNum, pIE->data, pIE->Length); + supportRateNum += pIE->Length; + } + break; + case _SUPPORTED_CH_IE_: + break; + case _RSN_IE_2_: + rsnie_included=1; + if (prx_pkt_attrib->encrypt) { + prsnie=(u8*)pIE; + /* Check CCMP pairwise_cipher presence. */ + ppairwise_cipher=prsnie+10; + _rtw_memcpy(ptdls_sta->TDLS_RSNIE, pIE->data, pIE->Length); + pairwise_count = *(u16*)(ppairwise_cipher-2); + for (k=0; kencrypt) + _rtw_memcpy(SNonce, (ptr+j+52), 32); + break; + case _TIMEOUT_ITVL_IE_: + if (prx_pkt_attrib->encrypt) + timeout_interval = cpu_to_le32(*(u32*)(ptr+j+3)); + break; + case _RIC_Descriptor_IE_: + break; + case _HT_CAPABILITY_IE_: + rtw_tdls_process_ht_cap(padapter, ptdls_sta, pIE->data, pIE->Length); + break; + case EID_BSSCoexistence: + break; + case _LINK_ID_IE_: + if (_rtw_memcmp(get_bssid(pmlmepriv), pIE->data, 6) == _FALSE) + txmgmt.status_code=_STATS_NOT_IN_SAME_BSS_; + break; + default: + break; } j += (pIE->Length + 2); } - //check status code - //if responder STA has/hasn't security on AP, but request hasn't/has RSNIE, it should reject - if(ptdls_sta->stat_code == 0 ) - { - if(rsnie_included && (prx_pkt_attrib->encrypt==0)){ - //security disabled - ptdls_sta->stat_code = 5; - }else if(rsnie_included==0 && (prx_pkt_attrib->encrypt)){ - //request haven't RSNIE - ptdls_sta->stat_code = 38; - } + /* Check status code */ + /* If responder STA has/hasn't security on AP, but request hasn't/has RSNIE, it should reject */ + if (txmgmt.status_code == _STATS_SUCCESSFUL_) { + if (rsnie_included && prx_pkt_attrib->encrypt == 0) + txmgmt.status_code = _STATS_SEC_DISABLED_; + else if (rsnie_included==0 && prx_pkt_attrib->encrypt) + txmgmt.status_code = _STATS_INVALID_PARAMETERS_; #ifdef CONFIG_WFD - //WFD test plan version 0.18.2 test item 5.1.5 - //SoUT does not use TDLS if AP uses weak security - if ( padapter->wdinfo.wfd_tdls_enable ) - { - if(rsnie_included && (prx_pkt_attrib->encrypt != _AES_)) - { - ptdls_sta->stat_code = 5; - } - } -#endif //CONFIG_WFD + /* WFD test plan version 0.18.2 test item 5.1.5 */ + /* SoUT does not use TDLS if AP uses weak security */ + if (padapter->wdinfo.wfd_tdls_enable && (rsnie_included && prx_pkt_attrib->encrypt != _AES_)) + txmgmt.status_code = _STATS_SEC_DISABLED_; +#endif /* CONFIG_WFD */ } ptdls_sta->tdls_sta_state|= TDLS_INITIATOR_STATE; - if(prx_pkt_attrib->encrypt){ + if (prx_pkt_attrib->encrypt) { _rtw_memcpy(ptdls_sta->SNonce, SNonce, 32); - _rtw_memcpy(&(ptdls_sta->TDLS_PeerKey_Lifetime), timeout_interval, 4); + + if (timeout_interval <= 300) + ptdls_sta->TDLS_PeerKey_Lifetime = TPK_RESEND_COUNT; + else + ptdls_sta->TDLS_PeerKey_Lifetime = timeout_interval; } - //update station supportRate + /* Update station supportRate */ ptdls_sta->bssratelen = supportRateNum; _rtw_memcpy(ptdls_sta->bssrateset, supportRate, supportRateNum); - if(!(ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE)) + if (!(ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE)) ptdlsinfo->sta_cnt++; - if( ptdlsinfo->sta_cnt == (NUM_STA - 2 - 4) ) // -2: AP + BC/MC sta, -4: default key - { + /* -2: AP + BC/MC sta, -4: default key */ + if (ptdlsinfo->sta_cnt == MAX_ALLOWED_TDLS_STA_NUM) ptdlsinfo->sta_maximum = _TRUE; - } #ifdef CONFIG_WFD rtw_tdls_process_wfd_ie(ptdlsinfo, ptr + FIXED_IE, parsing_length - FIXED_IE); -#endif // CONFIG_WFD +#endif /* CONFIG_WFD */ - } - else - { + }else { goto exit; } _rtw_memcpy(txmgmt.peer, prx_pkt_attrib->src, ETH_ALEN); - issue_tdls_setup_rsp(padapter, &txmgmt); - if(ptdls_sta->stat_code==0) - { - _set_timer( &ptdls_sta->handshake_timer, TDLS_HANDSHAKE_TIME); - } - else //status code!=0 ; setup unsuccess - { - free_tdls_sta(padapter, ptdls_sta); + if (rtw_tdls_is_driver_setup(padapter)) { + issue_tdls_setup_rsp(padapter, &txmgmt); + + if (txmgmt.status_code==_STATS_SUCCESSFUL_) { + _set_timer( &ptdls_sta->handshake_timer, TDLS_HANDSHAKE_TIME); + }else { + free_tdls_sta(padapter, ptdls_sta); + } } exit: @@ -1312,8 +1496,8 @@ int On_TDLS_Setup_Rsp(_adapter *padapter, union recv_frame *precv_frame) _irqL irqL; struct rx_pkt_attrib *prx_pkt_attrib = &precv_frame->u.hdr.attrib; u8 *psa; - u16 stat_code; - sint parsing_length; //frame body length, without icv_len + u16 status_code=0; + sint parsing_length; /* Frame body length, without icv_len */ PNDIS_802_11_VARIABLE_IEs pIE; u8 FIXED_IE =7; u8 ANonce[32]; @@ -1324,161 +1508,157 @@ int On_TDLS_Setup_Rsp(_adapter *padapter, union recv_frame *precv_frame) int supportRateNum = 0; struct tdls_txmgmt txmgmt; int ret = _SUCCESS; + u32 timeout_interval = TPK_RESEND_COUNT; _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); psa = get_sa(ptr); ptdls_sta = rtw_get_stainfo(pstapriv, psa); - if ( NULL == ptdls_sta ) - { + if (NULL == ptdls_sta) { ret = _FAIL; goto exit; } - ptr +=prx_pkt_attrib->hdrlen + prx_pkt_attrib->iv_len+LLC_HEADER_SIZE+TYPE_LENGTH_FIELD_SIZE+1; + ptr +=prx_pkt_attrib->hdrlen + prx_pkt_attrib->iv_len+LLC_HEADER_SIZE+ETH_TYPE_LEN+PAYLOAD_TYPE_LEN; parsing_length= ((union recv_frame *)precv_frame)->u.hdr.len -prx_pkt_attrib->hdrlen -prx_pkt_attrib->iv_len -prx_pkt_attrib->icv_len -LLC_HEADER_SIZE - -TYPE_LENGTH_FIELD_SIZE - -1 + -ETH_TYPE_LEN + -PAYLOAD_TYPE_LEN -FIXED_IE; - _rtw_memcpy(&stat_code, ptr+2, 2); + _rtw_memcpy(&status_code, ptr+2, 2); - if(stat_code!=0) - { - DBG_871X( "[%s] status_code = %d, free_tdls_sta\n", __FUNCTION__, stat_code ); + if (status_code != 0) { + DBG_871X( "[TDLS] %s status_code = %d, free_tdls_sta\n", __FUNCTION__, status_code ); free_tdls_sta(padapter, ptdls_sta); ret = _FAIL; goto exit; } - stat_code = 0; + status_code = 0; - //parsing information element - for(j=FIXED_IE; jElementID) - { - case _SUPPORTEDRATES_IE_: - _rtw_memcpy(supportRate, pIE->data, pIE->Length); - supportRateNum = pIE->Length; - break; - case _COUNTRY_IE_: - break; - case _EXT_SUPPORTEDRATES_IE_: - if(supportRateNum<=sizeof(supportRate)) - { - _rtw_memcpy(supportRate+supportRateNum, pIE->data, pIE->Length); - supportRateNum += pIE->Length; - } - break; - case _SUPPORTED_CH_IE_: - break; - case _RSN_IE_2_: - prsnie=(u8*)pIE; - //check whether responder STA has CCMP pairwise_cipher. - ppairwise_cipher=prsnie+10; - _rtw_memcpy(&pairwise_count, (u16*)(ppairwise_cipher-2), 2); - for(k=0;kANonce, (ptr+j+20), 32); - _rtw_memcpy(ANonce, (ptr+j+20), 32); - break; - case _TIMEOUT_ITVL_IE_: - ptimeout_ie=(u8*)pIE; - break; - case _RIC_Descriptor_IE_: - break; - case _HT_CAPABILITY_IE_: - rtw_tdls_process_ht_cap(padapter, ptdls_sta, pIE->data, pIE->Length); - break; - case EID_BSSCoexistence: - break; - case _LINK_ID_IE_: - plinkid_ie=(u8*)pIE; - break; - default: - break; + switch (pIE->ElementID) { + case _SUPPORTEDRATES_IE_: + _rtw_memcpy(supportRate, pIE->data, pIE->Length); + supportRateNum = pIE->Length; + break; + case _COUNTRY_IE_: + break; + case _EXT_SUPPORTEDRATES_IE_: + if (supportRateNum<=sizeof(supportRate)) { + _rtw_memcpy(supportRate+supportRateNum, pIE->data, pIE->Length); + supportRateNum += pIE->Length; + } + break; + case _SUPPORTED_CH_IE_: + break; + case _RSN_IE_2_: + prsnie=(u8*)pIE; + /* Check CCMP pairwise_cipher presence. */ + ppairwise_cipher=prsnie+10; + _rtw_memcpy(&pairwise_count, (u16*)(ppairwise_cipher-2), 2); + for (k=0;kdata, pIE->Length); + break; + case EID_BSSCoexistence: + break; + case _LINK_ID_IE_: + plinkid_ie=(u8*)pIE; + break; + default: + break; } j += (pIE->Length + 2); - + } - //update station's supportRate ptdls_sta->bssratelen = supportRateNum; _rtw_memcpy(ptdls_sta->bssrateset, supportRate, supportRateNum); - _rtw_memcpy(ptdls_sta->ANonce, ANonce, 32); #ifdef CONFIG_WFD rtw_tdls_process_wfd_ie(ptdlsinfo, ptr + FIXED_IE, parsing_length - FIXED_IE); -#endif // CONFIG_WFD +#endif /* CONFIG_WFD */ - if(stat_code != 0) - { - ptdls_sta->stat_code = stat_code; - } - else - { - if(prx_pkt_attrib->encrypt) - { - if(verify_ccmp==1) - { - wpa_tdls_generate_tpk(padapter, ptdls_sta); - ptdls_sta->stat_code=0; - if(tdls_verify_mic(ptdls_sta->tpk.kck, 2, plinkid_ie, prsnie, ptimeout_ie, pftie)==0) //0: Invalid, 1: valid - { - free_tdls_sta(padapter, ptdls_sta); - ret = _FAIL; - goto exit; + if (status_code != _STATS_SUCCESSFUL_) { + txmgmt.status_code = status_code; + } else { + if (prx_pkt_attrib->encrypt) { + if (verify_ccmp == 1) { + txmgmt.status_code = _STATS_SUCCESSFUL_; + if (rtw_tdls_is_driver_setup(padapter) == _TRUE) { + wpa_tdls_generate_tpk(padapter, ptdls_sta); + if (tdls_verify_mic(ptdls_sta->tpk.kck, 2, plinkid_ie, prsnie, ptimeout_ie, pftie) == _FAIL) { + DBG_871X( "[TDLS] %s tdls_verify_mic fail, free_tdls_sta\n", __FUNCTION__); + free_tdls_sta(padapter, ptdls_sta); + ret = _FAIL; + goto exit; + } + ptdls_sta->TDLS_PeerKey_Lifetime = timeout_interval; } } else { - ptdls_sta->stat_code=72; //invalide contents of RSNIE + txmgmt.status_code = _STATS_INVALID_RSNIE_; } }else{ - ptdls_sta->stat_code=0; + txmgmt.status_code = _STATS_SUCCESSFUL_; } } - DBG_871X("issue_tdls_setup_cfm\n"); - _rtw_memcpy(txmgmt.peer, prx_pkt_attrib->src, ETH_ALEN); - issue_tdls_setup_cfm(padapter, &txmgmt); + if (rtw_tdls_is_driver_setup(padapter) == _TRUE) { + _rtw_memcpy(txmgmt.peer, prx_pkt_attrib->src, ETH_ALEN); + issue_tdls_setup_cfm(padapter, &txmgmt); - if(ptdls_sta->stat_code==0) - { - ptdlsinfo->link_established = _TRUE; + if (txmgmt.status_code == _STATS_SUCCESSFUL_) { + ptdlsinfo->link_established = _TRUE; - if( ptdls_sta->tdls_sta_state & TDLS_RESPONDER_STATE ) - { - ptdls_sta->tdls_sta_state |= TDLS_LINKED_STATE; - _cancel_timer_ex( &ptdls_sta->handshake_timer); - } + if (ptdls_sta->tdls_sta_state & TDLS_RESPONDER_STATE) { + ptdls_sta->tdls_sta_state |= TDLS_LINKED_STATE; + ptdls_sta->state |= _FW_LINKED; + _cancel_timer_ex( &ptdls_sta->handshake_timer); + } - rtw_tdls_set_key(padapter, prx_pkt_attrib, ptdls_sta); + if (prx_pkt_attrib->encrypt) + rtw_tdls_set_key(padapter, ptdls_sta); - rtw_tdls_cmd(padapter, ptdls_sta->hwaddr, TDLS_ESTABLISHED); + rtw_tdls_cmd(padapter, ptdls_sta->hwaddr, TDLS_ESTABLISHED); + } } exit: - return ret; + if (rtw_tdls_is_driver_setup(padapter) == _TRUE) + return ret; + else + return _SUCCESS; } @@ -1491,7 +1671,7 @@ int On_TDLS_Setup_Cfm(_adapter *padapter, union recv_frame *precv_frame) _irqL irqL; struct rx_pkt_attrib *prx_pkt_attrib = &precv_frame->u.hdr.attrib; u8 *psa; - u16 stat_code; + u16 status_code=0; sint parsing_length; PNDIS_802_11_VARIABLE_IEs pIE; u8 FIXED_IE =5; @@ -1502,14 +1682,13 @@ int On_TDLS_Setup_Cfm(_adapter *padapter, union recv_frame *precv_frame) psa = get_sa(ptr); ptdls_sta = rtw_get_stainfo(pstapriv, psa); - if(ptdls_sta == NULL) - { - DBG_871X( "[%s] Direct Link Peer = "MAC_FMT" not found\n", __FUNCTION__, MAC_ARG(psa) ); + if (ptdls_sta == NULL) { + DBG_871X("[%s] Direct Link Peer = "MAC_FMT" not found\n", __FUNCTION__, MAC_ARG(psa)); ret = _FAIL; goto exit; } - ptr +=prx_pkt_attrib->hdrlen + prx_pkt_attrib->iv_len+LLC_HEADER_SIZE+TYPE_LENGTH_FIELD_SIZE+1; + ptr +=prx_pkt_attrib->hdrlen + prx_pkt_attrib->iv_len+LLC_HEADER_SIZE+ETH_TYPE_LEN+PAYLOAD_TYPE_LEN; parsing_length= ((union recv_frame *)precv_frame)->u.hdr.len -prx_pkt_attrib->hdrlen -prx_pkt_attrib->iv_len @@ -1518,49 +1697,50 @@ int On_TDLS_Setup_Cfm(_adapter *padapter, union recv_frame *precv_frame) -ETH_TYPE_LEN -PAYLOAD_TYPE_LEN -FIXED_IE; - _rtw_memcpy(&stat_code, ptr+2, 2); - if(stat_code!=0){ - DBG_871X( "[%s] stat_code = %d\n, free_tdls_sta", __FUNCTION__, stat_code ); + _rtw_memcpy(&status_code, ptr+2, 2); + + if (status_code!= 0) { + DBG_871X("[%s] status_code = %d\n, free_tdls_sta", __FUNCTION__, status_code); free_tdls_sta(padapter, ptdls_sta); ret = _FAIL; goto exit; } - if(prx_pkt_attrib->encrypt){ - //parsing information element - for(j=FIXED_IE; jencrypt) { + /* Parsing information element */ + for(j=FIXED_IE; jElementID) - { - case _RSN_IE_2_: - prsnie=(u8*)pIE; - break; - case _VENDOR_SPECIFIC_IE_: - break; - case _FTIE_: - pftie=(u8*)pIE; - break; - case _TIMEOUT_ITVL_IE_: - ptimeout_ie=(u8*)pIE; - break; - case _HT_EXTRA_INFO_IE_: - break; - case _LINK_ID_IE_: - plinkid_ie=(u8*)pIE; - break; - default: - break; + switch (pIE->ElementID) { + case _RSN_IE_2_: + prsnie=(u8*)pIE; + break; + case _VENDOR_SPECIFIC_IE_: + break; + case _FTIE_: + pftie=(u8*)pIE; + break; + case _TIMEOUT_ITVL_IE_: + ptimeout_ie=(u8*)pIE; + break; + case _HT_EXTRA_INFO_IE_: + break; + case _LINK_ID_IE_: + plinkid_ie=(u8*)pIE; + break; + default: + break; } j += (pIE->Length + 2); } - //verify mic in FTIE MIC field - if(tdls_verify_mic(ptdls_sta->tpk.kck, 3, plinkid_ie, prsnie, ptimeout_ie, pftie)==0){ //0: Invalid, 1: Valid + /* Verify mic in FTIE MIC field */ + if (rtw_tdls_is_driver_setup(padapter) && + (tdls_verify_mic(ptdls_sta->tpk.kck, 3, plinkid_ie, prsnie, ptimeout_ie, pftie) == _FAIL)) { free_tdls_sta(padapter, ptdls_sta); ret = _FAIL; goto exit; @@ -1568,16 +1748,25 @@ int On_TDLS_Setup_Cfm(_adapter *padapter, union recv_frame *precv_frame) } - ptdlsinfo->link_established = _TRUE; - if( ptdls_sta->tdls_sta_state & TDLS_INITIATOR_STATE ) - { - ptdls_sta->tdls_sta_state|=TDLS_LINKED_STATE; - _cancel_timer_ex( &ptdls_sta->handshake_timer); - } + if (rtw_tdls_is_driver_setup(padapter)) { + ptdlsinfo->link_established = _TRUE; - rtw_tdls_set_key(padapter, prx_pkt_attrib, ptdls_sta); + if (ptdls_sta->tdls_sta_state & TDLS_INITIATOR_STATE) { + ptdls_sta->tdls_sta_state|=TDLS_LINKED_STATE; + ptdls_sta->state |= _FW_LINKED; + _cancel_timer_ex(&ptdls_sta->handshake_timer); + } - rtw_tdls_cmd(padapter, ptdls_sta->hwaddr, TDLS_ESTABLISHED); + if (prx_pkt_attrib->encrypt) { + rtw_tdls_set_key(padapter, ptdls_sta); + + /* Start TPK timer */ + ptdls_sta->TPK_count = 0; + _set_timer(&ptdls_sta->TPK_timer, ONE_SEC); + } + + rtw_tdls_cmd(padapter, ptdls_sta->hwaddr, TDLS_ESTABLISHED); + } exit: return ret; @@ -1590,15 +1779,18 @@ int On_TDLS_Dis_Req(_adapter *padapter, union recv_frame *precv_frame) struct sta_priv *pstapriv = &padapter->stapriv; struct sta_info *psta_ap; u8 *ptr = precv_frame->u.hdr.rx_data; - sint parsing_length; //frame body length, without icv_len + sint parsing_length; /* Frame body length, without icv_len */ PNDIS_802_11_VARIABLE_IEs pIE; u8 FIXED_IE = 3, *dst; u16 j; struct tdls_txmgmt txmgmt; int ret = _SUCCESS; + if (rtw_tdls_is_driver_setup(padapter) == _FALSE) + goto exit; + _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); - ptr +=prx_pkt_attrib->hdrlen + prx_pkt_attrib->iv_len + LLC_HEADER_SIZE+TYPE_LENGTH_FIELD_SIZE + 1; + ptr +=prx_pkt_attrib->hdrlen + prx_pkt_attrib->iv_len+LLC_HEADER_SIZE+ETH_TYPE_LEN+PAYLOAD_TYPE_LEN; txmgmt.dialog_token = *(ptr+2); _rtw_memcpy(&txmgmt.peer, precv_frame->u.hdr.attrib.src, ETH_ALEN); txmgmt.action_code = TDLS_DISCOVERY_RESPONSE; @@ -1607,31 +1799,26 @@ int On_TDLS_Dis_Req(_adapter *padapter, union recv_frame *precv_frame) -prx_pkt_attrib->iv_len -prx_pkt_attrib->icv_len -LLC_HEADER_SIZE - -TYPE_LENGTH_FIELD_SIZE - -1 + -ETH_TYPE_LEN + -PAYLOAD_TYPE_LEN -FIXED_IE; - //parsing information element - for(j=FIXED_IE; jElementID) - { - case _LINK_ID_IE_: - psta_ap = rtw_get_stainfo(pstapriv, pIE->data); - if(psta_ap == NULL) - { - goto exit; - } - dst = pIE->data + 12; - if( (MacAddr_isBcst(dst) == _FALSE) && (_rtw_memcmp(myid(&(padapter->eeprompriv)), dst, 6) == _FALSE) ) - { - goto exit; - } - break; - default: - break; + switch (pIE->ElementID) { + case _LINK_ID_IE_: + psta_ap = rtw_get_stainfo(pstapriv, pIE->data); + if (psta_ap == NULL) + goto exit; + dst = pIE->data + 12; + if (MacAddr_isBcst(dst) == _FALSE && (_rtw_memcmp(myid(&padapter->eeprompriv), dst, 6) == _FALSE)) + goto exit; + break; + default: + break; } j += (pIE->Length + 2); @@ -1639,7 +1826,7 @@ int On_TDLS_Dis_Req(_adapter *padapter, union recv_frame *precv_frame) } issue_tdls_dis_rsp(padapter, &txmgmt, prx_pkt_attrib->privacy); - + exit: return ret; @@ -1655,51 +1842,51 @@ int On_TDLS_Teardown(_adapter *padapter, union recv_frame *precv_frame) struct sta_priv *pstapriv = &padapter->stapriv; struct sta_info *ptdls_sta= NULL; _irqL irqL; + u8 reason; + + reason = *(ptr + prx_pkt_attrib->hdrlen + prx_pkt_attrib->iv_len + LLC_HEADER_SIZE + ETH_TYPE_LEN + PAYLOAD_TYPE_LEN + 2); + DBG_871X("[TDLS] %s Reason code(%d)\n", __FUNCTION__,reason); psa = get_sa(ptr); ptdls_sta = rtw_get_stainfo(pstapriv, psa); - if(ptdls_sta!=NULL){ - if(ptdls_sta->tdls_sta_state & TDLS_CH_SWITCH_ON_STATE){ - rtw_tdls_cmd(padapter, ptdls_sta->hwaddr, TDLS_CS_OFF); - } - free_tdls_sta(padapter, ptdls_sta); + if (ptdls_sta != NULL) { + if (rtw_tdls_is_driver_setup(padapter)) + rtw_tdls_cmd(padapter, ptdls_sta->hwaddr, TDLS_TEAR_STA); } - + return _SUCCESS; } +#if 0 u8 TDLS_check_ch_state(uint state){ - if( (state & TDLS_CH_SWITCH_ON_STATE) && - (state & TDLS_AT_OFF_CH_STATE) && - (state & TDLS_PEER_AT_OFF_STATE) ){ - - if(state & TDLS_PEER_SLEEP_STATE) - return 2; //U-APSD + ch. switch + if (state & TDLS_CH_SWITCH_ON_STATE && + state & TDLS_PEER_AT_OFF_STATE) { + if (state & TDLS_PEER_SLEEP_STATE) + return 2; /* U-APSD + ch. switch */ else - return 1; //ch. switch + return 1; /* ch. switch */ }else return 0; } +#endif int On_TDLS_Peer_Traffic_Indication(_adapter *padapter, union recv_frame *precv_frame) { struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib; struct sta_info *ptdls_sta = rtw_get_stainfo(&padapter->stapriv, pattrib->src); u8 *ptr = precv_frame->u.hdr.rx_data; + struct tdls_txmgmt txmgmt; - ptr +=pattrib->hdrlen + pattrib->iv_len + LLC_HEADER_SIZE+TYPE_LENGTH_FIELD_SIZE + 1; - - if(ptdls_sta != NULL) - { - ptdls_sta->dialog = *(ptr+2); - issue_tdls_peer_traffic_rsp(padapter, ptdls_sta); + ptr +=pattrib->hdrlen + pattrib->iv_len+LLC_HEADER_SIZE+ETH_TYPE_LEN+PAYLOAD_TYPE_LEN; + _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); + if (ptdls_sta != NULL) { + txmgmt.dialog_token = *(ptr+2); + issue_tdls_peer_traffic_rsp(padapter, ptdls_sta, &txmgmt); //issue_nulldata_to_TDLS_peer_STA(padapter, ptdls_sta->hwaddr, 0, 0, 0); - } - else - { + } else { DBG_871X("from unknown sta:"MAC_FMT"\n", MAC_ARG(pattrib->src)); return _FAIL; } @@ -1707,44 +1894,29 @@ int On_TDLS_Peer_Traffic_Indication(_adapter *padapter, union recv_frame *precv_ return _SUCCESS; } -//we process buffered data for 1. U-APSD, 2. ch. switch, 3. U-APSD + ch. switch here +/* We process buffered data for 1. U-APSD, 2. ch. switch, 3. U-APSD + ch. switch here */ int On_TDLS_Peer_Traffic_Rsp(_adapter *padapter, union recv_frame *precv_frame) { struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct rx_pkt_attrib *pattrib = & precv_frame->u.hdr.attrib; struct sta_priv *pstapriv = &padapter->stapriv; - //get peer sta infomation struct sta_info *ptdls_sta = rtw_get_stainfo(pstapriv, pattrib->src); - u8 wmmps_ac=0, state=TDLS_check_ch_state(ptdls_sta->tdls_sta_state); + u8 wmmps_ac=0; + /* u8 state=TDLS_check_ch_state(ptdls_sta->tdls_sta_state); */ int i; ptdls_sta->sta_stats.rx_data_pkts++; ptdls_sta->tdls_sta_state &= ~(TDLS_WAIT_PTR_STATE); - //receive peer traffic response frame, sleeping STA wakes up - //ptdls_sta->tdls_sta_state &= ~(TDLS_PEER_SLEEP_STATE); - //process_wmmps_data( padapter, precv_frame); - - // if noticed peer STA wakes up by receiving peer traffic response - // and we want to do channel swtiching, then we will transmit channel switch request first - if(ptdls_sta->tdls_sta_state & TDLS_APSD_CHSW_STATE){ - issue_tdls_ch_switch_req(padapter, pattrib->src); - ptdls_sta->tdls_sta_state &= ~(TDLS_APSD_CHSW_STATE); - return _SUCCESS; - } - - //check 4-AC queue bit - if(ptdls_sta->uapsd_vo || ptdls_sta->uapsd_vi || ptdls_sta->uapsd_be || ptdls_sta->uapsd_bk) + /* Check 4-AC queue bit */ + if (ptdls_sta->uapsd_vo || ptdls_sta->uapsd_vi || ptdls_sta->uapsd_be || ptdls_sta->uapsd_bk) wmmps_ac=1; - //if it's a direct link and have buffered frame - if(ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE){ - //[TDLS] UAPSD - //if(wmmps_ac && state) - if(wmmps_ac && 1) - { + /* If it's a direct link and have buffered frame */ + if (ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE) { + if (wmmps_ac) { _irqL irqL; _list *xmitframe_plist, *xmitframe_phead; struct xmit_frame *pxmitframe=NULL; @@ -1754,48 +1926,31 @@ int On_TDLS_Peer_Traffic_Rsp(_adapter *padapter, union recv_frame *precv_frame) xmitframe_phead = get_list_head(&ptdls_sta->sleep_q); xmitframe_plist = get_next(xmitframe_phead); - //transmit buffered frames - while ((rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) == _FALSE) - { + /* transmit buffered frames */ + while (rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist) == _FALSE) { pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list); xmitframe_plist = get_next(xmitframe_plist); rtw_list_delete(&pxmitframe->list); ptdls_sta->sleepq_len--; ptdls_sta->sleepq_ac_len--; - if(ptdls_sta->sleepq_len>0){ + if (ptdls_sta->sleepq_len>0) { pxmitframe->attrib.mdata = 1; pxmitframe->attrib.eosp = 0; - }else{ + } else { pxmitframe->attrib.mdata = 0; pxmitframe->attrib.eosp = 1; } pxmitframe->attrib.triggered = 1; rtw_hal_xmitframe_enqueue(padapter, pxmitframe); - - } - if(ptdls_sta->sleepq_len==0) - { + if (ptdls_sta->sleepq_len==0) DBG_871X("no buffered packets for tdls to xmit\n"); - //on U-APSD + CH. switch state, when there is no buffered date to xmit, - // we should go back to base channel - if(state==2){ - rtw_tdls_cmd(padapter, ptdls_sta->hwaddr, TDLS_CS_OFF); - }else if(ptdls_sta->tdls_sta_state&TDLS_SW_OFF_STATE){ - ptdls_sta->tdls_sta_state &= ~(TDLS_SW_OFF_STATE); - ptdlsinfo->candidate_ch= pmlmeext->cur_channel; - issue_tdls_ch_switch_req(padapter, pattrib->src); - DBG_871X("issue tdls ch switch req back to base channel\n"); - } - - } - else - { + else { DBG_871X("error!psta->sleepq_len=%d\n", ptdls_sta->sleepq_len); - ptdls_sta->sleepq_len=0; + ptdls_sta->sleepq_len=0; } _exit_critical_bh(&ptdls_sta->sleep_q.lock, &irqL); @@ -1807,8 +1962,10 @@ int On_TDLS_Peer_Traffic_Rsp(_adapter *padapter, union recv_frame *precv_frame) return _SUCCESS; } +#ifdef CONFIG_TDLS_CH_SW sint On_TDLS_Ch_Switch_Req(_adapter *padapter, union recv_frame *precv_frame) { + struct tdls_ch_switch *pchsw_info = &padapter->tdlsinfo.chsw_info; struct sta_info *ptdls_sta= NULL; struct sta_priv *pstapriv = &padapter->stapriv; u8 *ptr = precv_frame->u.hdr.rx_data; @@ -1816,14 +1973,25 @@ sint On_TDLS_Ch_Switch_Req(_adapter *padapter, union recv_frame *precv_frame) u8 *psa; sint parsing_length; PNDIS_802_11_VARIABLE_IEs pIE; - u8 FIXED_IE =3; + u8 FIXED_IE = 4; u16 j; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; + struct tdls_txmgmt txmgmt; + u16 switch_time= CH_SWITCH_TIME * 1000, switch_timeout=CH_SWITCH_TIMEOUT * 1000; + if (padapter->tdlsinfo.ch_switch_prohibited == _TRUE) + { DBG_871X("[TDLS] Ignore %s since ch_switch_prohibited = _TRUE\n", __FUNCTION__); + return _SUCCESS; + } + + _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); psa = get_sa(ptr); ptdls_sta = rtw_get_stainfo(pstapriv, psa); - - ptr +=prx_pkt_attrib->hdrlen + prx_pkt_attrib->iv_len+LLC_HEADER_SIZE+TYPE_LENGTH_FIELD_SIZE+1; + + ptdls_sta->ch_switch_time=switch_time; + ptdls_sta->ch_switch_timeout=switch_timeout; + + ptr +=prx_pkt_attrib->hdrlen + prx_pkt_attrib->iv_len+LLC_HEADER_SIZE+ETH_TYPE_LEN+PAYLOAD_TYPE_LEN; parsing_length= ((union recv_frame *)precv_frame)->u.hdr.len -prx_pkt_attrib->hdrlen -prx_pkt_attrib->iv_len @@ -1833,55 +2001,54 @@ sint On_TDLS_Ch_Switch_Req(_adapter *padapter, union recv_frame *precv_frame) -PAYLOAD_TYPE_LEN -FIXED_IE; - ptdls_sta->off_ch = *(ptr+2); - - //parsing information element - for(j=FIXED_IE; joff_ch_num = *(ptr + 2); + + if (*(ptr + 2) == 2) { + pchsw_info->off_ch_num = 11; + } + + if (pchsw_info->off_ch_num != pmlmeext->cur_channel) { + pchsw_info->delay_switch_back = _FALSE; + } + /* Parsing information element */ + for (j=FIXED_IE; jElementID) - { - case _COUNTRY_IE_: - break; - case _CH_SWTICH_ANNOUNCE_: - break; - case _LINK_ID_IE_: - break; - case _CH_SWITCH_TIMING_: - _rtw_memcpy(&ptdls_sta->ch_switch_time, pIE->data, 2); - _rtw_memcpy(&ptdls_sta->ch_switch_timeout, pIE->data+2, 2); - default: - break; + switch (pIE->ElementID) { + case EID_SecondaryChnlOffset: + padapter->tdlsinfo.chsw_info.ch_offset = *(pIE->data); + break; + case _LINK_ID_IE_: + break; + case _CH_SWITCH_TIMING_: + ptdls_sta->ch_switch_time = (RTW_GET_LE16(pIE->data) >= CH_SWITCH_TIME * 1000) ? + RTW_GET_LE16(pIE->data) : CH_SWITCH_TIME * 1000; + ptdls_sta->ch_switch_timeout = (RTW_GET_LE16(pIE->data + 2) >= CH_SWITCH_TIMEOUT * 1000) ? + RTW_GET_LE16(pIE->data + 2) : CH_SWITCH_TIMEOUT * 1000; + DBG_871X("%s ch_switch_time:%d, ch_switch_timeout:%d\n" + , __FUNCTION__, RTW_GET_LE16(pIE->data), RTW_GET_LE16(pIE->data + 2)); + default: + break; } j += (pIE->Length + 2); - } - //todo: check status - ptdls_sta->stat_code=0; - ptdls_sta->tdls_sta_state |= TDLS_CH_SWITCH_ON_STATE; - - issue_nulldata(padapter, NULL, 1, 0, 0); - - issue_tdls_ch_switch_rsp(padapter, psa); + /* Todo: check status */ + txmgmt.status_code = 0; + _rtw_memcpy(txmgmt.peer, psa, ETH_ALEN); + + ATOMIC_SET(&pchsw_info->chsw_on, _TRUE); - DBG_871X("issue tdls channel switch response\n"); + rtw_tdls_cmd(padapter, ptdls_sta->hwaddr, TDLS_CH_SW_RESP); - if((ptdls_sta->tdls_sta_state & TDLS_CH_SWITCH_ON_STATE) && ptdls_sta->off_ch==pmlmeext->cur_channel){ - DBG_871X("back to base channel %x\n", pmlmeext->cur_channel); - ptdls_sta->option=TDLS_BASE_CH; - rtw_tdls_cmd(padapter, ptdls_sta->hwaddr, TDLS_BASE_CH); - }else{ - ptdls_sta->option=TDLS_OFF_CH; - rtw_tdls_cmd(padapter, ptdls_sta->hwaddr, TDLS_OFF_CH); - } return _SUCCESS; } sint On_TDLS_Ch_Switch_Rsp(_adapter *padapter, union recv_frame *precv_frame) { + struct tdls_ch_switch *pchsw_info = &padapter->tdlsinfo.chsw_info; struct sta_info *ptdls_sta= NULL; struct sta_priv *pstapriv = &padapter->stapriv; u8 *ptr = precv_frame->u.hdr.rx_data; @@ -1889,38 +2056,31 @@ sint On_TDLS_Ch_Switch_Rsp(_adapter *padapter, union recv_frame *precv_frame) u8 *psa; sint parsing_length; PNDIS_802_11_VARIABLE_IEs pIE; - u8 FIXED_IE =4; - u16 stat_code, j, switch_time, switch_timeout; + u8 FIXED_IE = 4; + u16 status_code, j, switch_time, switch_timeout; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; int ret = _SUCCESS; + if (padapter->tdlsinfo.ch_switch_prohibited == _TRUE) + { DBG_871X("[TDLS] Ignore %s since ch_switch_prohibited = _TRUE\n", __FUNCTION__); + return _SUCCESS; + } + psa = get_sa(ptr); ptdls_sta = rtw_get_stainfo(pstapriv, psa); - //if channel switch is running and receiving Unsolicited TDLS Channel Switch Response, - //it will go back to base channel and terminate this channel switch procedure - if(ptdls_sta->tdls_sta_state & TDLS_CH_SWITCH_ON_STATE ){ - if(pmlmeext->cur_channel==ptdls_sta->off_ch){ - DBG_871X("back to base channel %x\n", pmlmeext->cur_channel); - ptdls_sta->option=TDLS_BASE_CH; - rtw_tdls_cmd(padapter, ptdls_sta->hwaddr, TDLS_BASE_CH); - }else{ + /* If we receive Unsolicited TDLS Channel Switch Response when channel switch is running, */ + /* we will go back to base channel and terminate this channel switch procedure */ + if (ATOMIC_READ(&pchsw_info->chsw_on) == _TRUE) { + if (pmlmeext->cur_channel != rtw_get_oper_ch(padapter)) { DBG_871X("receive unsolicited channel switch response \n"); - rtw_tdls_cmd(padapter, ptdls_sta->hwaddr, TDLS_CS_OFF); + rtw_tdls_cmd(padapter, NULL, TDLS_CH_SW_BACK); + goto exit; } - ret = _FAIL; - goto exit; - } - - //avoiding duplicated or unconditional ch. switch. rsp - if(!(ptdls_sta->tdls_sta_state & TDLS_CH_SW_INITIATOR_STATE)) - { - ret = _FAIL; - goto exit; } - ptr +=prx_pkt_attrib->hdrlen + prx_pkt_attrib->iv_len+LLC_HEADER_SIZE+TYPE_LENGTH_FIELD_SIZE+1; - parsing_length= ((union recv_frame *)precv_frame)->u.hdr.len + ptr +=prx_pkt_attrib->hdrlen + prx_pkt_attrib->iv_len + LLC_HEADER_SIZE+ETH_TYPE_LEN+PAYLOAD_TYPE_LEN; + parsing_length = ((union recv_frame *)precv_frame)->u.hdr.len -prx_pkt_attrib->hdrlen -prx_pkt_attrib->iv_len -prx_pkt_attrib->icv_len @@ -1929,49 +2089,49 @@ sint On_TDLS_Ch_Switch_Rsp(_adapter *padapter, union recv_frame *precv_frame) -PAYLOAD_TYPE_LEN -FIXED_IE; - _rtw_memcpy(&stat_code, ptr+2, 2); + _rtw_memcpy(&status_code, ptr+2, 2); - if(stat_code!=0){ + if (status_code != 0) { + DBG_871X("[%s] status_code:%d\n", __FUNCTION__, status_code); + pchsw_info->ch_sw_state &= ~(TDLS_CH_SW_INITIATOR_STATE); + ATOMIC_SET(&pchsw_info->chsw_on, _FALSE); ret = _FAIL; goto exit; } - //parsing information element - for(j=FIXED_IE; jElementID) - { - case _LINK_ID_IE_: - break; - case _CH_SWITCH_TIMING_: - _rtw_memcpy(&switch_time, pIE->data, 2); - if(switch_time > ptdls_sta->ch_switch_time) - _rtw_memcpy(&ptdls_sta->ch_switch_time, &switch_time, 2); - - _rtw_memcpy(&switch_timeout, pIE->data+2, 2); - if(switch_timeout > ptdls_sta->ch_switch_timeout) - _rtw_memcpy(&ptdls_sta->ch_switch_timeout, &switch_timeout, 2); - - default: - break; + switch (pIE->ElementID) { + case _LINK_ID_IE_: + break; + case _CH_SWITCH_TIMING_: + _rtw_memcpy(&switch_time, pIE->data, 2); + if (switch_time > ptdls_sta->ch_switch_time) + _rtw_memcpy(&ptdls_sta->ch_switch_time, &switch_time, 2); + + _rtw_memcpy(&switch_timeout, pIE->data + 2, 2); + if (switch_timeout > ptdls_sta->ch_switch_timeout) + _rtw_memcpy(&ptdls_sta->ch_switch_timeout, &switch_timeout, 2); + break; + default: + break; } j += (pIE->Length + 2); - } - ptdls_sta->tdls_sta_state &= ~(TDLS_CH_SW_INITIATOR_STATE); - ptdls_sta->tdls_sta_state |=TDLS_CH_SWITCH_ON_STATE; - - //goto set_channel_workitem_callback() - ptdls_sta->option=TDLS_OFF_CH; - rtw_tdls_cmd(padapter, ptdls_sta->hwaddr, TDLS_OFF_CH); + if ((pmlmeext->cur_channel == rtw_get_oper_ch(padapter)) && + (pchsw_info->ch_sw_state & TDLS_WAIT_CH_RSP_STATE)) { + ATOMIC_SET(&pchsw_info->chsw_on, _TRUE); + rtw_tdls_cmd(padapter, ptdls_sta->hwaddr, TDLS_CH_SW); + } exit: return ret; } +#endif /* CONFIG_TDLS_CH_SW */ #ifdef CONFIG_WFD void wfd_ie_tdls(_adapter * padapter, u8 *pframe, u32 *pktlen ) @@ -1981,376 +2141,220 @@ void wfd_ie_tdls(_adapter * padapter, u8 *pframe, u32 *pktlen ) u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; u32 wfdielen = 0; - // WFD OUI + /* WFD OUI */ wfdielen = 0; wfdie[ wfdielen++ ] = 0x50; wfdie[ wfdielen++ ] = 0x6F; wfdie[ wfdielen++ ] = 0x9A; - wfdie[ wfdielen++ ] = 0x0A; // WFA WFD v1.0 - - // Commented by Albert 20110825 - // According to the WFD Specification, the negotiation request frame should contain 3 WFD attributes - // 1. WFD Device Information - // 2. Associated BSSID ( Optional ) - // 3. Local IP Adress ( Optional ) - - // WFD Device Information ATTR - // Type: + wfdie[ wfdielen++ ] = 0x0A; /* WFA WFD v1.0 */ + + /* + * Commented by Albert 20110825 + * According to the WFD Specification, the negotiation request frame should contain 3 WFD attributes + * 1. WFD Device Information + * 2. Associated BSSID ( Optional ) + * 3. Local IP Adress ( Optional ) + */ + + /* WFD Device Information ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_DEVICE_INFO; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0006); wfdielen += 2; - // Value1: - // WFD device information - // available for WFD session + Preferred TDLS + WSD ( WFD Service Discovery ) + /* Value1: */ + /* WFD device information */ + /* available for WFD session + Preferred TDLS + WSD ( WFD Service Discovery ) */ RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_PC_TDLS | WFD_DEVINFO_WSD); wfdielen += 2; - // Value2: - // Session Management Control Port - // Default TCP port for RTSP messages is 554 + /* Value2: */ + /* Session Management Control Port */ + /* Default TCP port for RTSP messages is 554 */ RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->rtsp_ctrlport ); wfdielen += 2; - // Value3: - // WFD Device Maximum Throughput - // 300Mbps is the maximum throughput + /* Value3: */ + /* WFD Device Maximum Throughput */ + /* 300Mbps is the maximum throughput */ RTW_PUT_BE16(wfdie + wfdielen, 300); wfdielen += 2; - // Associated BSSID ATTR - // Type: + /* Associated BSSID ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_ASSOC_BSSID; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0006); wfdielen += 2; - // Value: - // Associated BSSID - if ( check_fwstate( pmlmepriv, _FW_LINKED) == _TRUE ) - { - _rtw_memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); - } + /* Value: */ + /* Associated BSSID */ + if (check_fwstate( pmlmepriv, _FW_LINKED) == _TRUE) + _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN); else - { - _rtw_memset( wfdie + wfdielen, 0x00, ETH_ALEN ); - } + _rtw_memset(wfdie + wfdielen, 0x00, ETH_ALEN); - // Local IP Address ATTR + /* Local IP Address ATTR */ wfdie[ wfdielen++ ] = WFD_ATTR_LOCAL_IP_ADDR; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0005); wfdielen += 2; - // Version: - // 0x01: Version1;IPv4 + /* Version: */ + /* 0x01: Version1;IPv4 */ wfdie[ wfdielen++ ] = 0x01; - // IPv4 Address + /* IPv4 Address */ _rtw_memcpy( wfdie + wfdielen, pwfd_info->ip_address, 4 ); wfdielen += 4; pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, pktlen); } -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ void rtw_build_tdls_setup_req_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe, struct tdls_txmgmt *ptxmgmt) { - struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; struct pkt_attrib *pattrib = &pxmitframe->attrib; - struct registry_priv *pregistrypriv = &padapter->registrypriv; struct sta_info *ptdls_sta=rtw_get_stainfo( (&padapter->stapriv) , pattrib->dst); - u8 payload_type = 0x02; - u8 category = RTW_WLAN_CATEGORY_TDLS; - u8 action = TDLS_SETUP_REQUEST; - u8 bssrate[NDIS_802_11_LENGTH_RATES_EX]; //Use NDIS_802_11_LENGTH_RATES_EX in order to call func.rtw_set_supported_rate - int bssrate_len = 0, i = 0 ; - u8 more_supportedrates = 0; - unsigned int ie_len; - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - u8 link_id_addr[18] = {0}; - u8 iedata=0; - u8 sup_ch[ 30 * 2 ] = {0x00 }, sup_ch_idx = 0, idx_5g = 2; //For supported channel - u8 timeout_itvl[5]; //set timeout interval to maximum value + int i = 0 ; u32 time; u8 *pframe_head; - //SNonce - if(pattrib->encrypt){ - for(i=0;i<8;i++){ + /* SNonce */ + if (pattrib->encrypt) { + for (i=0;i<8;i++) { time=rtw_get_current_time(); _rtw_memcpy(&ptdls_sta->SNonce[4*i], (u8 *)&time, 4); } } - pframe_head = pframe; // For rtw_tdls_set_ht_cap() - - //payload type - pframe = rtw_set_fixed_ie(pframe, 1, &(payload_type), &(pattrib->pktlen)); - //category, action, dialog token - pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); - pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); - pframe = rtw_set_fixed_ie(pframe, 1, &(ptdls_sta->dialog), &(pattrib->pktlen)); - - //capability - _rtw_memcpy(pframe, rtw_get_capability_from_ie(pmlmeinfo->network.IEs), 2); - - if(pattrib->encrypt) - *pframe =*pframe | cap_Privacy; - pframe += 2; - pattrib->pktlen += 2; - - //supported rates - if(pmlmeext->cur_channel < 14 ) - { - rtw_set_supported_rate(bssrate, WIRELESS_11BG_24N); - bssrate_len = IEEE80211_CCK_RATE_LEN + IEEE80211_NUM_OFDM_RATESLEN; - } - else - { - rtw_set_supported_rate(bssrate, WIRELESS_11A_5N); - bssrate_len = IEEE80211_NUM_OFDM_RATESLEN; - } - - //country(optional) - - if (bssrate_len > 8) - { - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , 8, bssrate, &(pattrib->pktlen)); - more_supportedrates = 1; - } - else - { - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , bssrate_len , bssrate, &(pattrib->pktlen)); - } + pframe_head = pframe; /* For rtw_tdls_set_ht_cap() */ - //extended supported rates - if(more_supportedrates==1){ - pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_ , (bssrate_len - 8), (bssrate + 8), &(pattrib->pktlen)); - } + pframe = rtw_tdls_set_payload_type(pframe, pattrib); + pframe = rtw_tdls_set_category(pframe, pattrib, RTW_WLAN_CATEGORY_TDLS); + pframe = rtw_tdls_set_action(pframe, pattrib, ptxmgmt); + pframe = rtw_tdls_set_dialog(pframe, pattrib, ptxmgmt); - //supported channels - pframe = rtw_tdls_set_sup_ch(pmlmeext, pframe, pattrib); - - // SRC IE - pframe = rtw_set_ie( pframe, _SRC_IE_, sizeof(TDLS_SRC), TDLS_SRC, &(pattrib->pktlen)); - - //RSNIE - if(pattrib->encrypt) - pframe = rtw_set_ie(pframe, _RSN_IE_2_, sizeof(TDLS_RSNIE), TDLS_RSNIE, &(pattrib->pktlen)); - - //extended capabilities - pframe = rtw_set_ie(pframe, _EXT_CAP_IE_ , sizeof(TDLS_EXT_CAPIE), TDLS_EXT_CAPIE, &(pattrib->pktlen)); + pframe = rtw_tdls_set_capability(padapter, pframe, pattrib); + pframe = rtw_tdls_set_supported_rate(padapter, pframe, pattrib); + pframe = rtw_tdls_set_sup_ch(&(padapter->mlmeextpriv), pframe, pattrib); + pframe = rtw_tdls_set_sup_reg_class(pframe, pattrib); - //QoS capability(WMM_IE) - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, sizeof(TDLS_WMMIE), TDLS_WMMIE, &(pattrib->pktlen)); + if (pattrib->encrypt) + pframe = rtw_tdls_set_rsnie(ptxmgmt, pframe, pattrib, _TRUE, ptdls_sta); + pframe = rtw_tdls_set_ext_cap(pframe, pattrib); + pframe = rtw_tdls_set_qos_cap(pframe, pattrib); - if(pattrib->encrypt){ - //FTIE - _rtw_memset(pframe, 0, 84); //All fields except SNonce shall be set to 0 - _rtw_memset(pframe, _FTIE_, 1); //version - _rtw_memset((pframe+1), 82, 1); //length - _rtw_memcpy((pframe+52), ptdls_sta->SNonce, 32); - pframe += 84; - pattrib->pktlen += 84; + if (pattrib->encrypt) { + pframe = rtw_tdls_set_ftie(ptxmgmt + , pframe + , pattrib + , NULL + , ptdls_sta->SNonce); - //Timeout interval - timeout_itvl[0]=0x02; - _rtw_memcpy(timeout_itvl+1, (u8 *)(&ptdls_sta->TDLS_PeerKey_Lifetime), 4); - pframe = rtw_set_ie(pframe, _TIMEOUT_ITVL_IE_, 5, timeout_itvl, &(pattrib->pktlen)); + pframe = rtw_tdls_set_timeout_interval(ptxmgmt, pframe, pattrib, _TRUE, ptdls_sta); } - //Sup_reg_classes(optional) - //HT capabilities - pframe += rtw_tdls_set_ht_cap(padapter, pframe_head, pattrib); + /* Sup_reg_classes(optional) */ + pframe = rtw_tdls_set_ht_cap(padapter, pframe_head, pattrib); + pframe = rtw_tdls_set_bss_coexist(padapter, pframe, pattrib); - //20/40 BSS coexistence - if(pmlmepriv->num_FortyMHzIntolerant>0) - iedata |= BIT(2);//20 MHz BSS Width Request - pframe = rtw_set_ie(pframe, EID_BSSCoexistence, 1, &iedata, &(pattrib->pktlen)); - - //Link identifier - _rtw_memcpy(link_id_addr, pattrib->ra, 6); - _rtw_memcpy((link_id_addr+6), pattrib->src, 6); - _rtw_memcpy((link_id_addr+12), pattrib->dst, 6); - pframe = rtw_set_ie(pframe, _LINK_ID_IE_, 18, link_id_addr, &(pattrib->pktlen)); + pframe = rtw_tdls_set_linkid(pframe, pattrib, _TRUE); #ifdef CONFIG_WFD wfd_ie_tdls( padapter, pframe, &(pattrib->pktlen) ); -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ } void rtw_build_tdls_setup_rsp_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe, struct tdls_txmgmt *ptxmgmt) { - struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); struct pkt_attrib *pattrib = &pxmitframe->attrib; struct sta_info *ptdls_sta; - struct registry_priv *pregistrypriv = &padapter->registrypriv; - - u8 payload_type = 0x02; - unsigned char category = RTW_WLAN_CATEGORY_TDLS; - unsigned char action = TDLS_SETUP_RESPONSE; - unsigned char bssrate[NDIS_802_11_LENGTH_RATES_EX]; - int bssrate_len = 0; - u8 more_supportedrates = 0; - unsigned int ie_len; - unsigned char *p; - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - u8 link_id_addr[18] = {0}; - u8 iedata=0; - u8 timeout_itvl[5]; //setup response timeout interval will copy from request - u8 ANonce[32]; //maybe it can put in ontdls_req - u8 k; //for random ANonce - u8 *pftie=NULL, *ptimeout_ie=NULL, *plinkid_ie=NULL, *prsnie=NULL, *pftie_mic=NULL; + u8 k; /* for random ANonce */ + u8 *pftie=NULL, *ptimeout_ie = NULL, *plinkid_ie = NULL, *prsnie = NULL, *pftie_mic = NULL; u32 time; u8 *pframe_head; ptdls_sta = rtw_get_stainfo( &(padapter->stapriv) , pattrib->dst); - if(ptdls_sta == NULL ) - { - DBG_871X("[%s] %d\n", __FUNCTION__, __LINE__); - return; - } + if (ptdls_sta == NULL) + DBG_871X("[%s] %d ptdls_sta is NULL\n", __FUNCTION__, __LINE__); - if(pattrib->encrypt){ - for(k=0;k<8;k++){ - time=rtw_get_current_time(); + if (pattrib->encrypt && ptdls_sta != NULL) { + for (k=0;k<8;k++) { + time = rtw_get_current_time(); _rtw_memcpy(&ptdls_sta->ANonce[4*k], (u8*)&time, 4); } } pframe_head = pframe; - //payload type - pframe = rtw_set_fixed_ie(pframe, 1, &(payload_type), &(pattrib->pktlen)); - //category, action, status code - pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); - pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); - pframe = rtw_set_fixed_ie(pframe, 2, (u8 *)&ptdls_sta->stat_code, &(pattrib->pktlen)); + pframe = rtw_tdls_set_payload_type(pframe, pattrib); + pframe = rtw_tdls_set_category(pframe, pattrib, RTW_WLAN_CATEGORY_TDLS); + pframe = rtw_tdls_set_action(pframe, pattrib, ptxmgmt); + pframe = rtw_tdls_set_status_code(pframe, pattrib, ptxmgmt); - if(ptdls_sta->stat_code!=0) //invalid setup request - { - DBG_871X("ptdls_sta->stat_code:%04x \n", ptdls_sta->stat_code); + if (ptxmgmt->status_code != 0) { + DBG_871X("[%s] status_code:%04x \n", __FUNCTION__, ptxmgmt->status_code); return; } - //dialog token - pframe = rtw_set_fixed_ie(pframe, 1, &(ptdls_sta->dialog), &(pattrib->pktlen)); - - //capability - _rtw_memcpy(pframe, rtw_get_capability_from_ie(pmlmeinfo->network.IEs), 2); - - if(pattrib->encrypt ) - *pframe =*pframe | cap_Privacy; - pframe += 2; - pattrib->pktlen += 2; - - //supported rates - //supported rates - if(pmlmeext->cur_channel < 14 ) - { - rtw_set_supported_rate(bssrate, WIRELESS_11BG_24N); - bssrate_len = IEEE80211_CCK_RATE_LEN + IEEE80211_NUM_OFDM_RATESLEN; - } - else - { - rtw_set_supported_rate(bssrate, WIRELESS_11A_5N); - bssrate_len = IEEE80211_NUM_OFDM_RATESLEN; - } - - if (bssrate_len > 8) - { - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , 8, bssrate, &(pattrib->pktlen)); - more_supportedrates = 1; - } - else - { - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , bssrate_len , bssrate, &(pattrib->pktlen)); - } - - //country(optional) - //extended supported rates - if(more_supportedrates==1){ - pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_ , (bssrate_len - 8), (bssrate + 8), &(pattrib->pktlen)); - } - - //supported channels - pframe = rtw_tdls_set_sup_ch(pmlmeext, pframe, pattrib); - - // SRC IE - pframe = rtw_set_ie(pframe, _SRC_IE_ , sizeof(TDLS_SRC), TDLS_SRC, &(pattrib->pktlen)); + pframe = rtw_tdls_set_dialog(pframe, pattrib, ptxmgmt); + pframe = rtw_tdls_set_capability(padapter, pframe, pattrib); + pframe = rtw_tdls_set_supported_rate(padapter, pframe, pattrib); + pframe = rtw_tdls_set_sup_ch(&(padapter->mlmeextpriv), pframe, pattrib); + pframe = rtw_tdls_set_sup_reg_class(pframe, pattrib); - //RSNIE - if(pattrib->encrypt){ + if (pattrib->encrypt) { prsnie = pframe; - pframe = rtw_set_ie(pframe, _RSN_IE_2_, sizeof(ptdls_sta->TDLS_RSNIE), ptdls_sta->TDLS_RSNIE, &(pattrib->pktlen)); + pframe = rtw_tdls_set_rsnie(ptxmgmt, pframe, pattrib, _FALSE, ptdls_sta); } - //extended capabilities - pframe = rtw_set_ie(pframe, _EXT_CAP_IE_ , sizeof(TDLS_EXT_CAPIE), TDLS_EXT_CAPIE, &(pattrib->pktlen)); + pframe = rtw_tdls_set_ext_cap(pframe, pattrib); + pframe = rtw_tdls_set_qos_cap(pframe, pattrib); - //QoS capability(WMM_IE) - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, sizeof(TDLS_WMMIE), TDLS_WMMIE, &(pattrib->pktlen)); + if (pattrib->encrypt) { + if (rtw_tdls_is_driver_setup(padapter) == _TRUE) + wpa_tdls_generate_tpk(padapter, ptdls_sta); - if(pattrib->encrypt){ - wpa_tdls_generate_tpk(padapter, ptdls_sta); - - //FTIE pftie = pframe; pftie_mic = pframe+4; - _rtw_memset(pframe, 0, 84); //All fields except SNonce shall be set to 0 - _rtw_memset(pframe, _FTIE_, 1); //version - _rtw_memset((pframe+1), 82, 1); //length - _rtw_memcpy((pframe+20), ptdls_sta->ANonce, 32); - _rtw_memcpy((pframe+52), ptdls_sta->SNonce, 32); - pframe += 84; - pattrib->pktlen += 84; - - //Timeout interval + pframe = rtw_tdls_set_ftie(ptxmgmt + , pframe + , pattrib + , ptdls_sta->ANonce + , ptdls_sta->SNonce); + ptimeout_ie = pframe; - timeout_itvl[0]=0x02; - _rtw_memcpy(timeout_itvl+1, (u8 *)(&ptdls_sta->TDLS_PeerKey_Lifetime), 4); - pframe = rtw_set_ie(pframe, _TIMEOUT_ITVL_IE_, 5, timeout_itvl, &(pattrib->pktlen)); + pframe = rtw_tdls_set_timeout_interval(ptxmgmt, pframe, pattrib, _FALSE, ptdls_sta); } - //Sup_reg_classes(optional) - //HT capabilities - pframe += rtw_tdls_set_ht_cap(padapter, pframe_head, pattrib); - - //20/40 BSS coexistence - if(pmlmepriv->num_FortyMHzIntolerant>0) - iedata |= BIT(2);//20 MHz BSS Width Request - pframe = rtw_set_ie(pframe, EID_BSSCoexistence, 1, &iedata, &(pattrib->pktlen)); + /* Sup_reg_classes(optional) */ + pframe = rtw_tdls_set_ht_cap(padapter, pframe_head, pattrib); + pframe = rtw_tdls_set_bss_coexist(padapter, pframe, pattrib); - //Link identifier plinkid_ie = pframe; - _rtw_memcpy(link_id_addr, pattrib->ra, 6); - _rtw_memcpy((link_id_addr+6), pattrib->dst, 6); - _rtw_memcpy((link_id_addr+12), pattrib->src, 6); - pframe = rtw_set_ie(pframe, _LINK_ID_IE_, 18, link_id_addr, &(pattrib->pktlen)); + pframe = rtw_tdls_set_linkid(pframe, pattrib, _FALSE); - //fill FTIE mic - if(pattrib->encrypt) + /* Fill FTIE mic */ + if (pattrib->encrypt && rtw_tdls_is_driver_setup(padapter) == _TRUE) wpa_tdls_ftie_mic(ptdls_sta->tpk.kck, 2, plinkid_ie, prsnie, ptimeout_ie, pftie, pftie_mic); #ifdef CONFIG_WFD wfd_ie_tdls( padapter, pframe, &(pattrib->pktlen) ); -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ } @@ -2362,397 +2366,213 @@ void rtw_build_tdls_setup_cfm_ies(_adapter * padapter, struct xmit_frame * pxmit struct pkt_attrib *pattrib = &pxmitframe->attrib; struct sta_info *ptdls_sta=rtw_get_stainfo( (&padapter->stapriv) , pattrib->dst); - u8 payload_type = 0x02; - unsigned char category = RTW_WLAN_CATEGORY_TDLS; - unsigned char action = TDLS_SETUP_CONFIRM; - u8 more_supportedrates = 0; unsigned int ie_len; unsigned char *p; - u8 timeout_itvl[5]; //set timeout interval to maximum value u8 wmm_param_ele[24] = {0}; - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - u8 link_id_addr[18] = {0}; u8 *pftie=NULL, *ptimeout_ie=NULL, *plinkid_ie=NULL, *prsnie=NULL, *pftie_mic=NULL; - //payload type - pframe = rtw_set_fixed_ie(pframe, 1, &(payload_type), &(pattrib->pktlen)); - //category, action, status code, dialog token - pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); - pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); - pframe = rtw_set_fixed_ie(pframe, 2, (u8 *)&ptdls_sta->stat_code, &(pattrib->pktlen)); - pframe = rtw_set_fixed_ie(pframe, 1, &(ptdls_sta->dialog), &(pattrib->pktlen)); + pframe = rtw_tdls_set_payload_type(pframe, pattrib); + pframe = rtw_tdls_set_category(pframe, pattrib, RTW_WLAN_CATEGORY_TDLS); + pframe = rtw_tdls_set_action(pframe, pattrib, ptxmgmt); + pframe = rtw_tdls_set_status_code(pframe, pattrib, ptxmgmt); + pframe = rtw_tdls_set_dialog(pframe, pattrib, ptxmgmt); - if(ptdls_sta->stat_code!=0) //invalid setup request + if (ptxmgmt->status_code!=0) return; - //RSNIE - if(pattrib->encrypt){ + if (pattrib->encrypt) { prsnie = pframe; - pframe = rtw_set_ie(pframe, _RSN_IE_2_, sizeof(TDLS_RSNIE), TDLS_RSNIE, &(pattrib->pktlen)); + pframe = rtw_tdls_set_rsnie(ptxmgmt, pframe, pattrib, _TRUE, ptdls_sta); } - //EDCA param set; WMM param ele. - if(pattrib->encrypt){ - //FTIE + if (pattrib->encrypt) { pftie = pframe; pftie_mic = pframe+4; - _rtw_memset(pframe, 0, 84); //All fields except SNonce shall be set to 0 - _rtw_memset(pframe, _FTIE_, 1); //version - _rtw_memset((pframe+1), 82, 1); //length - _rtw_memcpy((pframe+20), ptdls_sta->ANonce, 32); - _rtw_memcpy((pframe+52), ptdls_sta->SNonce, 32); - pframe += 84; - pattrib->pktlen += 84; - - //Timeout interval + pframe = rtw_tdls_set_ftie(ptxmgmt + , pframe + , pattrib + , ptdls_sta->ANonce + , ptdls_sta->SNonce); + ptimeout_ie = pframe; - timeout_itvl[0]=0x02; - _rtw_memcpy(timeout_itvl+1, (u8 *)(&ptdls_sta->TDLS_PeerKey_Lifetime), 4); - ptdls_sta->TPK_count=0; - _set_timer(&ptdls_sta->TPK_timer, ptdls_sta->TDLS_PeerKey_Lifetime/TPK_RESEND_COUNT); - pframe = rtw_set_ie(pframe, _TIMEOUT_ITVL_IE_, 5, timeout_itvl, &(pattrib->pktlen)); + pframe = rtw_tdls_set_timeout_interval(ptxmgmt, pframe, pattrib, _TRUE, ptdls_sta); + + if (rtw_tdls_is_driver_setup(padapter) == _TRUE) { + /* Start TPK timer */ + ptdls_sta->TPK_count=0; + _set_timer(&ptdls_sta->TPK_timer, ONE_SEC); + } } - //HT operation; todo - //Link identifier + /* HT operation; todo */ plinkid_ie = pframe; - _rtw_memcpy(link_id_addr, pattrib->ra, 6); - _rtw_memcpy((link_id_addr+6), pattrib->src, 6); - _rtw_memcpy((link_id_addr+12), pattrib->dst, 6); - pframe = rtw_set_ie(pframe, _LINK_ID_IE_, 18, link_id_addr, &(pattrib->pktlen)); + pframe = rtw_tdls_set_linkid(pframe, pattrib, _TRUE); - //FTIE mic - if(pattrib->encrypt) + if (pattrib->encrypt && (rtw_tdls_is_driver_setup(padapter) == _TRUE)) wpa_tdls_ftie_mic(ptdls_sta->tpk.kck, 3, plinkid_ie, prsnie, ptimeout_ie, pftie, pftie_mic); - //WMM Parameter Set - if(&pmlmeinfo->WMM_param) - { - _rtw_memcpy(wmm_param_ele, WMM_PARA_OUI, 6); - _rtw_memcpy(wmm_param_ele+6, (u8 *)&pmlmeinfo->WMM_param, sizeof(pmlmeinfo->WMM_param)); - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, 24, wmm_param_ele, &(pattrib->pktlen)); - } - + pframe = rtw_tdls_set_linkid(pframe, pattrib, _TRUE); + pframe = rtw_tdls_set_wmm_params(padapter, pframe, pattrib); } void rtw_build_tdls_teardown_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe, struct tdls_txmgmt *ptxmgmt) { - - struct pkt_attrib *pattrib = &pxmitframe->attrib; - u8 payload_type = 0x02; - unsigned char category = RTW_WLAN_CATEGORY_TDLS; - u8 action = ptxmgmt->action_code; - u8 link_id_addr[18] = {0}; + struct pkt_attrib *pattrib = &pxmitframe->attrib; struct sta_info *ptdls_sta = rtw_get_stainfo( &(padapter->stapriv) , pattrib->dst); - //payload type - pframe = rtw_set_fixed_ie(pframe, 1, &(payload_type), &(pattrib->pktlen)); - //category, action, reason code - pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); - pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); - pframe = rtw_set_fixed_ie(pframe, 2, (u8 *)&ptxmgmt->status_code, &(pattrib->pktlen)); + pframe = rtw_tdls_set_payload_type(pframe, pattrib); + pframe = rtw_tdls_set_category(pframe, pattrib, RTW_WLAN_CATEGORY_TDLS); + pframe = rtw_tdls_set_action(pframe, pattrib, ptxmgmt); + pframe = rtw_tdls_set_status_code(pframe, pattrib, ptxmgmt); - //Link identifier - if(ptdls_sta->tdls_sta_state & TDLS_INITIATOR_STATE){ - _rtw_memcpy(link_id_addr, pattrib->ra, 6); - _rtw_memcpy((link_id_addr+6), pattrib->dst, 6); - _rtw_memcpy((link_id_addr+12), pattrib->src, 6); - }else if(ptdls_sta->tdls_sta_state & TDLS_RESPONDER_STATE){ - _rtw_memcpy(link_id_addr, pattrib->ra, 6); - _rtw_memcpy((link_id_addr+6), pattrib->src, 6); - _rtw_memcpy((link_id_addr+12), pattrib->dst, 6); - } - pframe = rtw_set_ie(pframe, _LINK_ID_IE_, 18, link_id_addr, &(pattrib->pktlen)); - + if (ptdls_sta->tdls_sta_state & TDLS_INITIATOR_STATE) + pframe = rtw_tdls_set_linkid(pframe, pattrib, _FALSE); + else if (ptdls_sta->tdls_sta_state & TDLS_RESPONDER_STATE) + pframe = rtw_tdls_set_linkid(pframe, pattrib, _TRUE); } void rtw_build_tdls_dis_req_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe, struct tdls_txmgmt *ptxmgmt) { + struct pkt_attrib *pattrib = &pxmitframe->attrib; - struct pkt_attrib *pattrib = &pxmitframe->attrib; - u8 payload_type = 0x02; - u8 category = RTW_WLAN_CATEGORY_TDLS; - u8 action = TDLS_DISCOVERY_REQUEST; - u8 link_id_addr[18] = {0}; - static u8 dialogtoken=0; - - //payload type - pframe = rtw_set_fixed_ie(pframe, 1, &(payload_type), &(pattrib->pktlen)); - //category, action, reason code - pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); - pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); - if(ptxmgmt->external_support == _TRUE) { - pframe = rtw_set_fixed_ie(pframe, 1, &(ptxmgmt->dialog_token), &(pattrib->pktlen)); - } else { - pframe = rtw_set_fixed_ie(pframe, 1, &(dialogtoken), &(pattrib->pktlen)); - dialogtoken = (dialogtoken+1)%256; - } + pframe = rtw_tdls_set_payload_type(pframe, pattrib); + pframe = rtw_tdls_set_category(pframe, pattrib, RTW_WLAN_CATEGORY_TDLS); + pframe = rtw_tdls_set_action(pframe, pattrib, ptxmgmt); + pframe = rtw_tdls_set_dialog(pframe, pattrib, ptxmgmt); + pframe = rtw_tdls_set_linkid(pframe, pattrib, _TRUE); - //Link identifier - _rtw_memcpy(link_id_addr, pattrib->ra, 6); - _rtw_memcpy((link_id_addr+6), pattrib->src, 6); - _rtw_memcpy((link_id_addr+12), pattrib->dst, 6); - pframe = rtw_set_ie(pframe, _LINK_ID_IE_, 18, link_id_addr, &(pattrib->pktlen)); - } -void rtw_build_tdls_dis_rsp_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe, u8 dialog, u8 privacy) +void rtw_build_tdls_dis_rsp_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe, struct tdls_txmgmt *ptxmgmt, u8 privacy) { struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; struct pkt_attrib *pattrib = &pxmitframe->attrib; - struct registry_priv *pregistrypriv = &padapter->registrypriv; - - u8 category = RTW_WLAN_CATEGORY_PUBLIC; - u8 action = TDLS_DISCOVERY_RESPONSE; - u8 bssrate[NDIS_802_11_LENGTH_RATES_EX]; - int bssrate_len = 0; - u8 more_supportedrates = 0; - u8 *p; - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - u8 link_id_addr[18] = {0}; - u8 iedata=0; - u8 timeout_itvl[5]; //set timeout interval to maximum value - u32 timeout_interval= TPK_RESEND_COUNT * 1000; u8 *pframe_head, pktlen_index; - pktlen_index = pattrib->pktlen; // For mgmt frame, pattrib->pktlen would count frame header + pktlen_index = pattrib->pktlen; pframe_head = pframe; - //category, action, dialog token - pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); - pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); - pframe = rtw_set_fixed_ie(pframe, 1, &(dialog), &(pattrib->pktlen)); - - //capability - _rtw_memcpy(pframe, rtw_get_capability_from_ie(pmlmeinfo->network.IEs), 2); - - if(privacy) - *pframe =*pframe | cap_Privacy; - pframe += 2; - pattrib->pktlen += 2; - - //supported rates - rtw_set_supported_rate(bssrate, WIRELESS_11BG_24N); - bssrate_len = IEEE80211_CCK_RATE_LEN + IEEE80211_NUM_OFDM_RATESLEN; - - if (bssrate_len > 8) - { - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , 8, bssrate, &(pattrib->pktlen)); - more_supportedrates = 1; - } - else - { - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , bssrate_len , bssrate, &(pattrib->pktlen)); - } + pframe = rtw_tdls_set_category(pframe, pattrib, RTW_WLAN_CATEGORY_PUBLIC); + pframe = rtw_tdls_set_action(pframe, pattrib, ptxmgmt); + pframe = rtw_tdls_set_dialog(pframe, pattrib, ptxmgmt); + pframe = rtw_tdls_set_capability(padapter, pframe, pattrib); - //extended supported rates - if(more_supportedrates==1){ - pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_ , (bssrate_len - 8), (bssrate + 8), &(pattrib->pktlen)); - } + pframe = rtw_tdls_set_supported_rate(padapter, pframe, pattrib); - //supported channels pframe = rtw_tdls_set_sup_ch(pmlmeext, pframe, pattrib); - //RSNIE - if(privacy) - pframe = rtw_set_ie(pframe, _RSN_IE_2_, sizeof(TDLS_RSNIE), TDLS_RSNIE, &(pattrib->pktlen)); + if (privacy) + pframe = rtw_tdls_set_rsnie(ptxmgmt, pframe, pattrib, _TRUE, NULL); - //extended capability - pframe = rtw_set_ie(pframe, _EXT_CAP_IE_ , sizeof(TDLS_EXT_CAPIE), TDLS_EXT_CAPIE, &(pattrib->pktlen)); + pframe = rtw_tdls_set_ext_cap(pframe, pattrib); - if(privacy){ - //FTIE - _rtw_memset(pframe, 0, 84); //All fields shall be set to 0 - _rtw_memset(pframe, _FTIE_, 1); //version - _rtw_memset((pframe+1), 82, 1); //length - pframe += 84; - pattrib->pktlen += 84; - - //Timeout interval - timeout_itvl[0]=0x02; - _rtw_memcpy(timeout_itvl+1, &timeout_interval, 4); - pframe = rtw_set_ie(pframe, _TIMEOUT_ITVL_IE_, 5, timeout_itvl, &(pattrib->pktlen)); + if (privacy) { + pframe = rtw_tdls_set_ftie(ptxmgmt, pframe, pattrib, NULL, NULL); + pframe = rtw_tdls_set_timeout_interval(ptxmgmt, pframe, pattrib, _TRUE, NULL); } - //Sup_reg_classes(optional) - //HT capabilities - pframe += rtw_tdls_set_ht_cap(padapter, pframe_head - pktlen_index, pattrib); - - //20/40 BSS coexistence - if(pmlmepriv->num_FortyMHzIntolerant>0) - iedata |= BIT(2);//20 MHz BSS Width Request - pframe = rtw_set_ie(pframe, EID_BSSCoexistence, 1, &iedata, &(pattrib->pktlen)); - - //Link identifier - _rtw_memcpy(link_id_addr, pattrib->ra, 6); - _rtw_memcpy((link_id_addr+6), pattrib->dst, 6); - _rtw_memcpy((link_id_addr+12), pattrib->src, 6); - pframe = rtw_set_ie(pframe, _LINK_ID_IE_, 18, link_id_addr, &(pattrib->pktlen)); + pframe = rtw_tdls_set_ht_cap(padapter, pframe_head - pktlen_index, pattrib); + pframe = rtw_tdls_set_bss_coexist(padapter, pframe, pattrib); + pframe = rtw_tdls_set_linkid(pframe, pattrib, _FALSE); } -void rtw_build_tdls_peer_traffic_indication_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe) + +void rtw_build_tdls_peer_traffic_indication_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe, struct tdls_txmgmt *ptxmgmt) { struct pkt_attrib *pattrib = &pxmitframe->attrib; - u8 payload_type = 0x02; - unsigned char category = RTW_WLAN_CATEGORY_TDLS; - unsigned char action = TDLS_PEER_TRAFFIC_INDICATION; - - u8 link_id_addr[18] = {0}; u8 AC_queue=0; struct sta_info *ptdls_sta = rtw_get_stainfo(&padapter->stapriv, pattrib->dst); - //payload type - pframe = rtw_set_fixed_ie(pframe, 1, &(payload_type), &(pattrib->pktlen)); - //category, action, reason code - pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); - pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); - pframe = rtw_set_fixed_ie(pframe, 1, &(ptdls_sta->dialog), &(pattrib->pktlen)); + pframe = rtw_tdls_set_payload_type(pframe, pattrib); + pframe = rtw_tdls_set_category(pframe, pattrib, RTW_WLAN_CATEGORY_TDLS); + pframe = rtw_tdls_set_action(pframe, pattrib, ptxmgmt); + pframe = rtw_tdls_set_dialog(pframe, pattrib, ptxmgmt); - //Link identifier - if(ptdls_sta->tdls_sta_state & TDLS_INITIATOR_STATE){ - _rtw_memcpy(link_id_addr, pattrib->ra, 6); - _rtw_memcpy((link_id_addr+6), pattrib->dst, 6); - _rtw_memcpy((link_id_addr+12), pattrib->src, 6); - }else if(ptdls_sta->tdls_sta_state & TDLS_RESPONDER_STATE){ - _rtw_memcpy(link_id_addr, pattrib->ra, 6); - _rtw_memcpy((link_id_addr+6), pattrib->src, 6); - _rtw_memcpy((link_id_addr+12), pattrib->dst, 6); - } - pframe = rtw_set_ie(pframe, _LINK_ID_IE_, 18, link_id_addr, &(pattrib->pktlen)); + if (ptdls_sta->tdls_sta_state & TDLS_INITIATOR_STATE) + pframe = rtw_tdls_set_linkid(pframe, pattrib, _FALSE); + else if (ptdls_sta->tdls_sta_state & TDLS_RESPONDER_STATE) + pframe = rtw_tdls_set_linkid(pframe, pattrib, _TRUE); - //PTI control - //PU buffer status - if(ptdls_sta->uapsd_bk&BIT(1)) + /* PTI control */ + /* PU buffer status */ + if (ptdls_sta->uapsd_bk & BIT(1)) AC_queue=BIT(0); - if(ptdls_sta->uapsd_be&BIT(1)) + if (ptdls_sta->uapsd_be & BIT(1)) AC_queue=BIT(1); - if(ptdls_sta->uapsd_vi&BIT(1)) + if (ptdls_sta->uapsd_vi & BIT(1)) AC_queue=BIT(2); - if(ptdls_sta->uapsd_vo&BIT(1)) + if (ptdls_sta->uapsd_vo & BIT(1)) AC_queue=BIT(3); pframe = rtw_set_ie(pframe, _PTI_BUFFER_STATUS_, 1, &AC_queue, &(pattrib->pktlen)); } -void rtw_build_tdls_peer_traffic_rsp_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe) +void rtw_build_tdls_peer_traffic_rsp_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe, struct tdls_txmgmt *ptxmgmt) { struct pkt_attrib *pattrib = &pxmitframe->attrib; - u8 payload_type = 0x02; - u8 category = RTW_WLAN_CATEGORY_TDLS; - u8 action = TDLS_PEER_TRAFFIC_RESPONSE; - u8 link_id_addr[18] = {0}; struct sta_info *ptdls_sta = rtw_get_stainfo(&padapter->stapriv, pattrib->dst); - static u8 dialogtoken=0; - //payload type - pframe = rtw_set_fixed_ie(pframe, 1, &(payload_type), &(pattrib->pktlen)); - //category, action, reason code - pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); - pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); - pframe = rtw_set_fixed_ie(pframe, 1, &ptdls_sta->dialog, &(pattrib->pktlen)); - - //Link identifier - if(ptdls_sta->tdls_sta_state & TDLS_INITIATOR_STATE){ - _rtw_memcpy(link_id_addr, pattrib->ra, 6); - _rtw_memcpy((link_id_addr+6), pattrib->dst, 6); - _rtw_memcpy((link_id_addr+12), pattrib->src, 6); - }else if(ptdls_sta->tdls_sta_state & TDLS_RESPONDER_STATE){ - _rtw_memcpy(link_id_addr, pattrib->ra, 6); - _rtw_memcpy((link_id_addr+6), pattrib->src, 6); - _rtw_memcpy((link_id_addr+12), pattrib->dst, 6); - } - pframe = rtw_set_ie(pframe, _LINK_ID_IE_, 18, link_id_addr, &(pattrib->pktlen)); + pframe = rtw_tdls_set_payload_type(pframe, pattrib); + pframe = rtw_tdls_set_category(pframe, pattrib, RTW_WLAN_CATEGORY_TDLS); + pframe = rtw_tdls_set_action(pframe, pattrib, ptxmgmt); + pframe = rtw_tdls_set_dialog(pframe, pattrib, ptxmgmt); + if (ptdls_sta->tdls_sta_state & TDLS_INITIATOR_STATE) + pframe = rtw_tdls_set_linkid(pframe, pattrib, _FALSE); + else if (ptdls_sta->tdls_sta_state & TDLS_RESPONDER_STATE) + pframe = rtw_tdls_set_linkid(pframe, pattrib, _TRUE); } -void rtw_build_tdls_ch_switch_req_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe) +#ifdef CONFIG_TDLS_CH_SW +void rtw_build_tdls_ch_switch_req_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe, struct tdls_txmgmt *ptxmgmt) { struct pkt_attrib *pattrib = &pxmitframe->attrib; - struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; - u8 payload_type = 0x02; - unsigned char category = RTW_WLAN_CATEGORY_TDLS; - unsigned char action = TDLS_CHANNEL_SWITCH_REQUEST; - u8 link_id_addr[18] = {0}; - struct sta_priv *pstapriv = &padapter->stapriv; + struct sta_priv *pstapriv = &padapter->stapriv; struct sta_info *ptdls_sta = rtw_get_stainfo(pstapriv, pattrib->dst); - u8 ch_switch_timing[4] = {0}; - u16 switch_time= CH_SWITCH_TIME, switch_timeout=CH_SWITCH_TIMEOUT; + u16 switch_time= CH_SWITCH_TIME * 1000, switch_timeout=CH_SWITCH_TIMEOUT * 1000; - //payload type - pframe = rtw_set_fixed_ie(pframe, 1, &(payload_type), &(pattrib->pktlen)); - //category, action, target_ch - pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); - pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); - pframe = rtw_set_fixed_ie(pframe, 1, &(ptdlsinfo->candidate_ch), &(pattrib->pktlen)); + ptdls_sta->ch_switch_time=switch_time; + ptdls_sta->ch_switch_timeout=switch_timeout; - //Link identifier - if(ptdls_sta->tdls_sta_state & TDLS_INITIATOR_STATE){ - _rtw_memcpy(link_id_addr, pattrib->ra, 6); - _rtw_memcpy((link_id_addr+6), pattrib->dst, 6); - _rtw_memcpy((link_id_addr+12), pattrib->src, 6); - }else if(ptdls_sta->tdls_sta_state & TDLS_RESPONDER_STATE){ - _rtw_memcpy(link_id_addr, pattrib->ra, 6); - _rtw_memcpy((link_id_addr+6), pattrib->src, 6); - _rtw_memcpy((link_id_addr+12), pattrib->dst, 6); - } - pframe = rtw_set_ie(pframe, _LINK_ID_IE_, 18, link_id_addr, &(pattrib->pktlen)); + pframe = rtw_tdls_set_payload_type(pframe, pattrib); + pframe = rtw_tdls_set_category(pframe, pattrib, RTW_WLAN_CATEGORY_TDLS); + pframe = rtw_tdls_set_action(pframe, pattrib, ptxmgmt); + pframe = rtw_tdls_set_target_ch(padapter, pframe, pattrib); + pframe = rtw_tdls_set_reg_class(pframe, pattrib, ptdls_sta); - //ch switch timing - _rtw_memcpy(ch_switch_timing, &switch_time, 2); - _rtw_memcpy(ch_switch_timing+2, &switch_timeout, 2); - pframe = rtw_set_ie(pframe, _CH_SWITCH_TIMING_, 4, ch_switch_timing, &(pattrib->pktlen)); + if (ptdls_sta->tdls_sta_state & TDLS_INITIATOR_STATE) + pframe = rtw_tdls_set_linkid(pframe, pattrib, _FALSE); + else if (ptdls_sta->tdls_sta_state & TDLS_RESPONDER_STATE) + pframe = rtw_tdls_set_linkid(pframe, pattrib, _TRUE); - //update ch switch attrib to sta_info - ptdls_sta->off_ch=ptdlsinfo->candidate_ch; - ptdls_sta->ch_switch_time=switch_time; - ptdls_sta->ch_switch_timeout=switch_timeout; + pframe = rtw_tdls_set_ch_sw(pframe, pattrib, ptdls_sta); } -void rtw_build_tdls_ch_switch_rsp_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe) +void rtw_build_tdls_ch_switch_rsp_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe, struct tdls_txmgmt *ptxmgmt) { struct pkt_attrib *pattrib = &pxmitframe->attrib; - u8 payload_type = 0x02; - unsigned char category = RTW_WLAN_CATEGORY_TDLS; - unsigned char action = TDLS_CHANNEL_SWITCH_RESPONSE; - u8 link_id_addr[18] = {0}; struct sta_priv *pstapriv = &padapter->stapriv; struct sta_info *ptdls_sta = rtw_get_stainfo(pstapriv, pattrib->dst); - struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; - u8 ch_switch_timing[4] = {0}; - - //payload type - pframe = rtw_set_fixed_ie(pframe, 1, &(payload_type), &(pattrib->pktlen)); - //category, action, status_code - pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); - pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); - pframe = rtw_set_fixed_ie(pframe, 2, (u8 *)&ptdls_sta->stat_code, &(pattrib->pktlen)); - //Link identifier - if(ptdls_sta->tdls_sta_state & TDLS_INITIATOR_STATE){ - _rtw_memcpy(link_id_addr, pattrib->ra, 6); - _rtw_memcpy((link_id_addr+6), pattrib->dst, 6); - _rtw_memcpy((link_id_addr+12), pattrib->src, 6); - }else if(ptdls_sta->tdls_sta_state & TDLS_RESPONDER_STATE){ - _rtw_memcpy(link_id_addr, pattrib->ra, 6); - _rtw_memcpy((link_id_addr+6), pattrib->src, 6); - _rtw_memcpy((link_id_addr+12), pattrib->dst, 6); - } - pframe = rtw_set_ie(pframe, _LINK_ID_IE_, 18, link_id_addr, &(pattrib->pktlen)); + pframe = rtw_tdls_set_payload_type(pframe, pattrib); + pframe = rtw_tdls_set_category(pframe, pattrib, RTW_WLAN_CATEGORY_TDLS); + pframe = rtw_tdls_set_action(pframe, pattrib, ptxmgmt); + pframe = rtw_tdls_set_status_code(pframe, pattrib, ptxmgmt); - //ch switch timing - _rtw_memcpy(ch_switch_timing, &ptdls_sta->ch_switch_time, 2); - _rtw_memcpy(ch_switch_timing+2, &ptdls_sta->ch_switch_timeout, 2); - pframe = rtw_set_ie(pframe, _CH_SWITCH_TIMING_, 4, ch_switch_timing, &(pattrib->pktlen)); + if (ptdls_sta->tdls_sta_state & TDLS_INITIATOR_STATE) + pframe = rtw_tdls_set_linkid(pframe, pattrib, _FALSE); + else if (ptdls_sta->tdls_sta_state & TDLS_RESPONDER_STATE) + pframe = rtw_tdls_set_linkid(pframe, pattrib, _TRUE); + pframe = rtw_tdls_set_ch_sw(pframe, pattrib, ptdls_sta); } +#endif #ifdef CONFIG_WFD void rtw_build_tunneled_probe_req_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe) @@ -2761,27 +2581,21 @@ void rtw_build_tunneled_probe_req_ies(_adapter * padapter, struct xmit_frame * p struct pkt_attrib *pattrib = &pxmitframe->attrib; struct wifidirect_info *pwdinfo = &padapter->wdinfo; struct wifidirect_info *pbuddy_wdinfo = &padapter->pbuddy_adapter->wdinfo; - u8 payload_type = 0x02; u8 category = RTW_WLAN_CATEGORY_P2P; u8 WFA_OUI[3] = { 0x50, 0x6f, 0x9a}; u8 probe_req = 4; u8 wfdielen = 0; - //payload type - pframe = rtw_set_fixed_ie(pframe, 1, &(payload_type), &(pattrib->pktlen)); - //category, OUI, frame_body_type + pframe = rtw_tdls_set_payload_type(pframe, pattrib); pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 3, WFA_OUI, &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(probe_req), &(pattrib->pktlen)); - if(!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) - { + if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) { wfdielen = build_probe_req_wfd_ie(pwdinfo, pframe); pframe += wfdielen; pattrib->pktlen += wfdielen; - } - else if(!rtw_p2p_chk_state(pbuddy_wdinfo, P2P_STATE_NONE)) - { + } else if (!rtw_p2p_chk_state(pbuddy_wdinfo, P2P_STATE_NONE)) { wfdielen = build_probe_req_wfd_ie(pbuddy_wdinfo, pframe); pframe += wfdielen; pattrib->pktlen += wfdielen; @@ -2795,34 +2609,28 @@ void rtw_build_tunneled_probe_rsp_ies(_adapter * padapter, struct xmit_frame * p struct pkt_attrib *pattrib = &pxmitframe->attrib; struct wifidirect_info *pwdinfo = &padapter->wdinfo; struct wifidirect_info *pbuddy_wdinfo = &padapter->pbuddy_adapter->wdinfo; - u8 payload_type = 0x02; u8 category = RTW_WLAN_CATEGORY_P2P; u8 WFA_OUI[3] = { 0x50, 0x6f, 0x9a}; u8 probe_rsp = 5; u8 wfdielen = 0; - //payload type - pframe = rtw_set_fixed_ie(pframe, 1, &(payload_type), &(pattrib->pktlen)); - //category, OUI, frame_body_type + pframe = rtw_tdls_set_payload_type(pframe, pattrib); pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 3, WFA_OUI, &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(probe_rsp), &(pattrib->pktlen)); - if(!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) - { + if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) { wfdielen = build_probe_resp_wfd_ie(pwdinfo, pframe, 1); pframe += wfdielen; pattrib->pktlen += wfdielen; - } - else if(!rtw_p2p_chk_state(pbuddy_wdinfo, P2P_STATE_NONE)) - { + } else if (!rtw_p2p_chk_state(pbuddy_wdinfo, P2P_STATE_NONE)) { wfdielen = build_probe_resp_wfd_ie(pbuddy_wdinfo, pframe, 1); pframe += wfdielen; pattrib->pktlen += wfdielen; } } -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ void _tdls_tpk_timer_hdl(void *FunctionContext) { @@ -2831,58 +2639,91 @@ void _tdls_tpk_timer_hdl(void *FunctionContext) _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); ptdls_sta->TPK_count++; - //TPK_timer set 1000 as default - //retry timer should set at least 301 sec. - if(ptdls_sta->TPK_count==TPK_RESEND_COUNT){ + /* TPK_timer expired in a second */ + /* Retry timer should set at least 301 sec. */ + if (ptdls_sta->TPK_count==TPK_RESEND_COUNT) { + DBG_871X("[TDLS] %s, Re-Setup TDLS link with "MAC_FMT" since TPK lifetime expires!\n", __FUNCTION__, MAC_ARG(ptdls_sta->hwaddr)); ptdls_sta->TPK_count=0; _rtw_memcpy(txmgmt.peer, ptdls_sta->hwaddr, ETH_ALEN); issue_tdls_setup_req(ptdls_sta->padapter, &txmgmt, _FALSE); } - - _set_timer(&ptdls_sta->TPK_timer, ptdls_sta->TDLS_PeerKey_Lifetime/TPK_RESEND_COUNT); + + _set_timer(&ptdls_sta->TPK_timer, ONE_SEC); } -// TDLS_DONE_CH_SEN: channel sensing and report candidate channel -// TDLS_OFF_CH: first time set channel to off channel -// TDLS_BASE_CH: when go back to the channel linked with AP, send null data to peer STA as an indication +#ifdef CONFIG_TDLS_CH_SW void _tdls_ch_switch_timer_hdl(void *FunctionContext) { - struct sta_info *ptdls_sta = (struct sta_info *)FunctionContext; _adapter *padapter = ptdls_sta->padapter; - - if( ptdls_sta->option == TDLS_DONE_CH_SEN ){ - rtw_tdls_cmd(padapter, ptdls_sta->hwaddr, TDLS_DONE_CH_SEN); - }else if( ptdls_sta->option == TDLS_OFF_CH ){ - issue_nulldata_to_TDLS_peer_STA(ptdls_sta->padapter, ptdls_sta->hwaddr, 0, 0, 0); - _set_timer(&ptdls_sta->base_ch_timer, 500); - }else if( ptdls_sta->option == TDLS_BASE_CH){ - issue_nulldata_to_TDLS_peer_STA(ptdls_sta->padapter, ptdls_sta->hwaddr, 0, 0, 0); + struct tdls_ch_switch *pchsw_info = &padapter->tdlsinfo.chsw_info; + + //DBG_871X("%s %d, tdls_sta_state:0x%08x\n", __FUNCTION__, __LINE__, ptdls_sta->tdls_sta_state); + + if (padapter->mlmeextpriv.cur_channel != rtw_get_oper_ch(padapter)) { + if (!(pchsw_info->ch_sw_state & TDLS_PEER_AT_OFF_STATE)) { + rtw_tdls_cmd(padapter, ptdls_sta->hwaddr, TDLS_CH_SW_BACK); + ATOMIC_SET(&pchsw_info->chsw_on, _FALSE); + DBG_871X("[TDLS] %s, can't get traffic from op_ch:%d\n", __FUNCTION__, rtw_get_oper_ch(padapter)); + } else { + //DBG_871X("%s %d\n", __FUNCTION__, __LINE__); + //_set_timer(&ptdls_sta->delay_timer, padapter->mlmeextpriv.mlmext_info.bcn_interval - 5 - ptdls_sta->ch_switch_timeout/1000); + } + } else { + //DBG_871X("%s %d, op_ch:%d, tdls_state:0x%08x\n", __FUNCTION__, __LINE__, rtw_get_oper_ch(padapter), ptdls_sta->tdls_sta_state); } -} -void _tdls_base_ch_timer_hdl(void *FunctionContext) -{ - struct sta_info *ptdls_sta = (struct sta_info *)FunctionContext; - rtw_tdls_cmd(ptdls_sta->padapter, ptdls_sta->hwaddr, TDLS_P_OFF_CH); +#if 0 + if (!(pchsw_info->ch_sw_state & TDLS_PEER_AT_OFF_STATE)) { + //SelectChannel(padapter, padapter->mlmeextpriv.cur_channel); + ATOMIC_SET(&pchsw_info->chsw_on, _FALSE); + DBG_871X("%s %d, op_ch:%d, tdls_state:0x%08x\n", __FUNCTION__, __LINE__, rtw_get_oper_ch(padapter), ptdls_sta->tdls_sta_state); + } + + if (pchsw_info->ch_sw_state & TDLS_CH_SW_INITIATOR_STATE) { + if (padapter->mlmeextpriv.cur_channel != rtw_get_oper_ch(padapter)) { + DBG_871X("%s %d\n", __FUNCTION__, __LINE__); + _set_timer(&ptdls_sta->delay_timer, padapter->mlmeextpriv.mlmext_info.bcn_interval - 5 - ptdls_sta->ch_switch_timeout/1000); + //_set_timer(&ptdls_sta->delay_timer, 1000); + } else { + DBG_871X("%s %d\n", __FUNCTION__, __LINE__); + issue_tdls_ch_switch_req(padapter, ptdls_sta); + //_set_timer(&ptdls_sta->delay_timer, 500); + } + } +#endif } -void _tdls_off_ch_timer_hdl(void *FunctionContext) +void _tdls_delay_timer_hdl(void *FunctionContext) { struct sta_info *ptdls_sta = (struct sta_info *)FunctionContext; - rtw_tdls_cmd(ptdls_sta->padapter, ptdls_sta->hwaddr, TDLS_P_BASE_CH ); + _adapter *padapter = ptdls_sta->padapter; + struct tdls_ch_switch *pchsw_info = &padapter->tdlsinfo.chsw_info; + + DBG_871X("[TDLS] %s, op_ch:%d, tdls_state:0x%08x\n", __FUNCTION__, rtw_get_oper_ch(padapter), ptdls_sta->tdls_sta_state); + pchsw_info->delay_switch_back = _TRUE; } +#endif void _tdls_handshake_timer_hdl(void *FunctionContext) { struct sta_info *ptdls_sta = (struct sta_info *)FunctionContext; + _adapter *padapter = ptdls_sta->padapter; + struct tdls_txmgmt txmgmt; - if(ptdls_sta != NULL) - { - if( !(ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE) ) + _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); + _rtw_memcpy(txmgmt.peer, ptdls_sta->hwaddr, ETH_ALEN); + txmgmt.status_code = _RSON_TDLS_TEAR_UN_RSN_; + + if (ptdls_sta != NULL) { + DBG_871X("[TDLS] Handshake time out\n"); + if (ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE) + { + issue_tdls_teardown(padapter, &txmgmt, _FALSE); + } + else { - DBG_871X("tdls handshake time out\n"); - rtw_tdls_cmd(ptdls_sta->padapter, ptdls_sta->hwaddr, TDLS_TEAR_STA ); + rtw_tdls_cmd(padapter, ptdls_sta->hwaddr, TDLS_TEAR_STA); } } } @@ -2897,11 +2738,10 @@ void _tdls_pti_timer_hdl(void *FunctionContext) _rtw_memcpy(txmgmt.peer, ptdls_sta->hwaddr, ETH_ALEN); txmgmt.status_code = _RSON_TDLS_TEAR_TOOFAR_; - if(ptdls_sta != NULL) - { - if( ptdls_sta->tdls_sta_state & TDLS_WAIT_PTR_STATE ) - { - DBG_871X("Doesn't receive PTR from peer dev:"MAC_FMT"; Send TDLS Tear Down\n", MAC_ARG(ptdls_sta->hwaddr)); + if (ptdls_sta != NULL) { + if (ptdls_sta->tdls_sta_state & TDLS_WAIT_PTR_STATE) { + DBG_871X("[TDLS] Doesn't receive PTR from peer dev:"MAC_FMT"; " + "Send TDLS Tear Down\n", MAC_ARG(ptdls_sta->hwaddr)); issue_tdls_teardown(padapter, &txmgmt, _FALSE); } } @@ -2911,9 +2751,10 @@ void rtw_init_tdls_timer(_adapter *padapter, struct sta_info *psta) { psta->padapter=padapter; _init_timer(&psta->TPK_timer, padapter->pnetdev, _tdls_tpk_timer_hdl, psta); - _init_timer(&psta->option_timer, padapter->pnetdev, _tdls_ch_switch_timer_hdl, psta); - _init_timer(&psta->base_ch_timer, padapter->pnetdev, _tdls_base_ch_timer_hdl, psta); - _init_timer(&psta->off_ch_timer, padapter->pnetdev, _tdls_off_ch_timer_hdl, psta); +#ifdef CONFIG_TDLS_CH_SW + _init_timer(&psta->ch_sw_timer, padapter->pnetdev, _tdls_ch_switch_timer_hdl, psta); + _init_timer(&psta->delay_timer, padapter->pnetdev, _tdls_delay_timer_hdl, psta); +#endif _init_timer(&psta->handshake_timer, padapter->pnetdev, _tdls_handshake_timer_hdl, psta); _init_timer(&psta->pti_timer, padapter->pnetdev, _tdls_pti_timer_hdl, psta); } @@ -2921,9 +2762,10 @@ void rtw_init_tdls_timer(_adapter *padapter, struct sta_info *psta) void rtw_free_tdls_timer(struct sta_info *psta) { _cancel_timer_ex(&psta->TPK_timer); - _cancel_timer_ex(&psta->option_timer); - _cancel_timer_ex(&psta->base_ch_timer); - _cancel_timer_ex(&psta->off_ch_timer); +#ifdef CONFIG_TDLS_CH_SW + _cancel_timer_ex(&psta->ch_sw_timer); + _cancel_timer_ex(&psta->delay_timer); +#endif _cancel_timer_ex(&psta->handshake_timer); _cancel_timer_ex(&psta->pti_timer); } @@ -2943,8 +2785,7 @@ u32 update_mask_tdls(_adapter *padapter, struct sta_info *psta) rtw_hal_update_sta_rate_mask(padapter, psta); tx_ra_bitmap = psta->ra_mask; - if ( pcur_network->Configuration.DSConfig > 14 ) { - // 5G band + if (pcur_network->Configuration.DSConfig > 14) { if (tx_ra_bitmap & 0xffff000) sta_band |= WIRELESS_11_5N | WIRELESS_11A; else @@ -2965,5 +2806,41 @@ u32 update_mask_tdls(_adapter *padapter, struct sta_info *psta) return tx_ra_bitmap; } -#endif //CONFIG_TDLS +int rtw_tdls_is_driver_setup(_adapter *padapter) +{ + return padapter->tdlsinfo.driver_setup; +} + +const char * rtw_tdls_action_txt(enum TDLS_ACTION_FIELD action) +{ + switch (action) { + case TDLS_SETUP_REQUEST: + return "TDLS_SETUP_REQUEST"; + case TDLS_SETUP_RESPONSE: + return "TDLS_SETUP_RESPONSE"; + case TDLS_SETUP_CONFIRM: + return "TDLS_SETUP_CONFIRM"; + case TDLS_TEARDOWN: + return "TDLS_TEARDOWN"; + case TDLS_PEER_TRAFFIC_INDICATION: + return "TDLS_PEER_TRAFFIC_INDICATION"; + case TDLS_CHANNEL_SWITCH_REQUEST: + return "TDLS_CHANNEL_SWITCH_REQUEST"; + case TDLS_CHANNEL_SWITCH_RESPONSE: + return "TDLS_CHANNEL_SWITCH_RESPONSE"; + case TDLS_PEER_PSM_REQUEST: + return "TDLS_PEER_PSM_REQUEST"; + case TDLS_PEER_PSM_RESPONSE: + return "TDLS_PEER_PSM_RESPONSE"; + case TDLS_PEER_TRAFFIC_RESPONSE: + return "TDLS_PEER_TRAFFIC_RESPONSE"; + case TDLS_DISCOVERY_REQUEST: + return "TDLS_DISCOVERY_REQUEST"; + case TDLS_DISCOVERY_RESPONSE: + return "TDLS_DISCOVERY_RESPONSE"; + default: + return "UNKNOWN"; + } +} +#endif /* CONFIG_TDLS */ diff --git a/backports/drivers/realtek/rtl8812au/core/rtw_vht.c b/backports/drivers/realtek/rtl8812au/core/rtw_vht.c index 2c4e7148654355..ce971d5a5ed335 100755 --- a/backports/drivers/realtek/rtl8812au/core/rtw_vht.c +++ b/backports/drivers/realtek/rtl8812au/core/rtw_vht.c @@ -281,15 +281,18 @@ void update_sta_vht_info_apmode(_adapter *padapter, PVOID sta) } bw_mode = GET_VHT_OPERATING_MODE_FIELD_CHNL_WIDTH(&pvhtpriv_sta->vht_op_mode_notify); - if (bw_mode > psta->bw_mode) - psta->bw_mode = bw_mode; + + //if (bw_mode > psta->bw_mode) + psta->bw_mode = bw_mode; // B4 Rx LDPC - if (TEST_FLAG(pvhtpriv_ap->ldpc_cap, LDPC_VHT_ENABLE_TX)) { - SET_FLAG(cur_ldpc_cap, GET_VHT_CAPABILITY_ELE_RX_LDPC(pvhtpriv_sta->vht_cap) ? (LDPC_VHT_ENABLE_TX | LDPC_VHT_CAP_TX) : 0); + if (TEST_FLAG(pvhtpriv_ap->ldpc_cap, LDPC_VHT_ENABLE_TX) && + GET_VHT_CAPABILITY_ELE_RX_LDPC(pvhtpriv_sta->vht_cap)) + { + SET_FLAG(cur_ldpc_cap, (LDPC_VHT_ENABLE_TX | LDPC_VHT_CAP_TX)); + DBG_871X("Current STA(%d) VHT LDPC = %02X\n", psta->aid, cur_ldpc_cap); } pvhtpriv_sta->ldpc_cap = cur_ldpc_cap; - DBG_871X("Current STA VHT LDPC = %02X\n", cur_ldpc_cap); if (psta->bw_mode > pmlmeext->cur_bwmode) psta->bw_mode = pmlmeext->cur_bwmode; @@ -297,11 +300,11 @@ void update_sta_vht_info_apmode(_adapter *padapter, PVOID sta) if (psta->bw_mode == CHANNEL_WIDTH_80) { // B5 Short GI for 80 MHz pvhtpriv_sta->sgi_80m = (GET_VHT_CAPABILITY_ELE_SHORT_GI80M(pvhtpriv_sta->vht_cap) & pvhtpriv_ap->sgi_80m) ? _TRUE : _FALSE; - DBG_871X("Current STA ShortGI80MHz = %d\n", pvhtpriv_sta->sgi_80m); + //DBG_871X("Current STA ShortGI80MHz = %d\n", pvhtpriv_sta->sgi_80m); } else if (psta->bw_mode >= CHANNEL_WIDTH_160) { // B5 Short GI for 80 MHz pvhtpriv_sta->sgi_80m = (GET_VHT_CAPABILITY_ELE_SHORT_GI160M(pvhtpriv_sta->vht_cap) & pvhtpriv_ap->sgi_80m) ? _TRUE : _FALSE; - DBG_871X("Current STA ShortGI160MHz = %d\n", pvhtpriv_sta->sgi_80m); + //DBG_871X("Current STA ShortGI160MHz = %d\n", pvhtpriv_sta->sgi_80m); } // B8 B9 B10 Rx STBC @@ -309,9 +312,9 @@ void update_sta_vht_info_apmode(_adapter *padapter, PVOID sta) GET_VHT_CAPABILITY_ELE_RX_STBC(pvhtpriv_sta->vht_cap)) { SET_FLAG(cur_stbc_cap, (STBC_VHT_ENABLE_TX | STBC_VHT_CAP_TX)); + DBG_871X("Current STA(%d) VHT STBC = %02X\n", psta->aid, cur_stbc_cap); } pvhtpriv_sta->stbc_cap = cur_stbc_cap; - DBG_871X("Current STA VHT STBC = %02X\n", cur_stbc_cap); // B11 SU Beamformer Capable, the target supports Beamformer and we are Beamformee if (TEST_FLAG(pvhtpriv_ap->beamform_cap, BEAMFORMING_VHT_BEAMFORMER_ENABLE) && @@ -327,7 +330,9 @@ void update_sta_vht_info_apmode(_adapter *padapter, PVOID sta) SET_FLAG(cur_beamform_cap, BEAMFORMING_VHT_BEAMFORMER_ENABLE); } pvhtpriv_sta->beamform_cap = cur_beamform_cap; - DBG_871X("Current VHT Beamforming Setting = %02X\n", cur_beamform_cap); + if (cur_beamform_cap) { + DBG_871X("Current STA(%d) VHT Beamforming Setting = %02X\n", psta->aid, cur_beamform_cap); + } // B23 B24 B25 Maximum A-MPDU Length Exponent pvhtpriv_sta->ampdu_len = GET_VHT_CAPABILITY_ELE_MAX_RXAMPDU_FACTOR(pvhtpriv_sta->vht_cap); @@ -370,24 +375,26 @@ void VHT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE) pmlmeinfo->VHT_enable = 1; // B4 Rx LDPC - if (TEST_FLAG(pvhtpriv->ldpc_cap, LDPC_VHT_ENABLE_TX)) { - SET_FLAG(cur_ldpc_cap, GET_VHT_CAPABILITY_ELE_RX_LDPC(pIE->data) ? (LDPC_VHT_ENABLE_TX | LDPC_VHT_CAP_TX) : 0); + if (TEST_FLAG(pvhtpriv->ldpc_cap, LDPC_VHT_ENABLE_TX) && + GET_VHT_CAPABILITY_ELE_RX_LDPC(pIE->data)) + { + SET_FLAG(cur_ldpc_cap, (LDPC_VHT_ENABLE_TX | LDPC_VHT_CAP_TX)); + DBG_871X("Current VHT LDPC Setting = %02X\n", cur_ldpc_cap); } pvhtpriv->ldpc_cap = cur_ldpc_cap; - DBG_871X("Current VHT LDPC Setting = %02X\n", cur_ldpc_cap); // B5 Short GI for 80 MHz pvhtpriv->sgi_80m = (GET_VHT_CAPABILITY_ELE_SHORT_GI80M(pIE->data) & pvhtpriv->sgi_80m) ? _TRUE : _FALSE; - DBG_871X("Current ShortGI80MHz = %d\n", pvhtpriv->sgi_80m); + //DBG_871X("Current ShortGI80MHz = %d\n", pvhtpriv->sgi_80m); // B8 B9 B10 Rx STBC if (TEST_FLAG(pvhtpriv->stbc_cap, STBC_VHT_ENABLE_TX) && GET_VHT_CAPABILITY_ELE_RX_STBC(pIE->data)) { SET_FLAG(cur_stbc_cap, (STBC_VHT_ENABLE_TX | STBC_VHT_CAP_TX)); + DBG_871X("Current VHT STBC Setting = %02X\n", cur_stbc_cap); } pvhtpriv->stbc_cap = cur_stbc_cap; - DBG_871X("Current VHT STBC Setting = %02X\n", cur_stbc_cap); // B11 SU Beamformer Capable, the target supports Beamformer and we are Beamformee if (TEST_FLAG(pvhtpriv->beamform_cap, BEAMFORMING_VHT_BEAMFORMER_ENABLE) && @@ -403,7 +410,9 @@ void VHT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE) SET_FLAG(cur_beamform_cap, BEAMFORMING_VHT_BEAMFORMER_ENABLE); } pvhtpriv->beamform_cap = cur_beamform_cap; - DBG_871X("Current VHT Beamforming Setting = %02X\n", cur_beamform_cap); + if (cur_beamform_cap) { + DBG_871X("Current VHT Beamforming Setting = %02X\n", cur_beamform_cap); + } // B23 B24 B25 Maximum A-MPDU Length Exponent pvhtpriv->ampdu_len = GET_VHT_CAPABILITY_ELE_MAX_RXAMPDU_FACTOR(pIE->data); @@ -501,9 +510,10 @@ u32 rtw_build_vht_operation_ie(_adapter *padapter, u8 *pbuf, u8 channel) //center frequency SET_VHT_OPERATION_ELE_CHL_CENTER_FREQ1(operation, center_freq);//Todo: need to set correct center channel SET_VHT_OPERATION_ELE_CHL_CENTER_FREQ2(operation,0); - SET_VHT_OPERATION_ELE_BASIC_MCS_SET(operation, 0xFFFF); + operation[3] = 0xff; + operation[4] = 0xff; - pbuf = rtw_set_ie(pbuf, EID_VHTOperation, 5, operation, &len); + rtw_set_ie(pbuf, EID_VHTOperation, 5, operation, &len); return len; } diff --git a/backports/drivers/realtek/rtl8812au/core/rtw_wlan_util.c b/backports/drivers/realtek/rtl8812au/core/rtw_wlan_util.c index b6be9ead59a678..01bc3cc4a108ed 100755 --- a/backports/drivers/realtek/rtl8812au/core/rtw_wlan_util.c +++ b/backports/drivers/realtek/rtl8812au/core/rtw_wlan_util.c @@ -31,6 +31,7 @@ unsigned char ARTHEROS_OUI2[] = {0x00, 0x13, 0x74}; unsigned char BROADCOM_OUI1[] = {0x00, 0x10, 0x18}; unsigned char BROADCOM_OUI2[] = {0x00, 0x0a, 0xf7}; unsigned char BROADCOM_OUI3[] = {0x00, 0x05, 0xb5}; +unsigned char BROADCOM_OUI4[] = {0x00, 0x90, 0x4c}; unsigned char CISCO_OUI[] = {0x00, 0x40, 0x96}; unsigned char MARVELL_OUI[] = {0x00, 0x50, 0x43}; @@ -40,11 +41,6 @@ unsigned char AIRGOCAP_OUI[] = {0x00, 0x0a, 0xf5}; unsigned char REALTEK_96B_IE[] = {0x00, 0xe0, 0x4c, 0x02, 0x01, 0x20}; -extern unsigned char MCS_rate_2R[16]; -#ifdef CONFIG_DISABLE_MCS13TO15 -extern unsigned char MCS_rate_2R_MCS13TO15_OFF[16]; -#endif //CONFIG_DISABLE_MCS13TO15 -extern unsigned char MCS_rate_1R[16]; extern unsigned char RTW_WPA_OUI[]; extern unsigned char WPA_TKIP_CIPHER[4]; extern unsigned char RSN_TKIP_CIPHER[4]; @@ -55,6 +51,9 @@ extern unsigned char RSN_TKIP_CIPHER[4]; #define WAIT_FOR_BCN_TO_MIN (6000) #define WAIT_FOR_BCN_TO_MAX (20000) +#define DISCONNECT_BY_CHK_BCN_FAIL_OBSERV_PERIOD_IN_MS 1000 +#define DISCONNECT_BY_CHK_BCN_FAIL_THRESHOLD 3 + static u8 rtw_basic_rate_cck[4] = { IEEE80211_CCK_RATE_1MB|IEEE80211_BASIC_RATE_MASK, IEEE80211_CCK_RATE_2MB|IEEE80211_BASIC_RATE_MASK, IEEE80211_CCK_RATE_5MB|IEEE80211_BASIC_RATE_MASK, IEEE80211_CCK_RATE_11MB|IEEE80211_BASIC_RATE_MASK @@ -72,6 +71,7 @@ static u8 rtw_basic_rate_mix[7] = { IEEE80211_OFDM_RATE_24MB|IEEE80211_BASIC_RATE_MASK }; +int new_bcn_max = 3; int cckrates_included(unsigned char *rate, int ratelen) { @@ -81,7 +81,7 @@ int cckrates_included(unsigned char *rate, int ratelen) { if ( (((rate[i]) & 0x7f) == 2) || (((rate[i]) & 0x7f) == 4) || (((rate[i]) & 0x7f) == 11) || (((rate[i]) & 0x7f) == 22) ) - return _TRUE; + return _TRUE; } return _FALSE; @@ -96,7 +96,7 @@ int cckratesonly_included(unsigned char *rate, int ratelen) { if ( (((rate[i]) & 0x7f) != 2) && (((rate[i]) & 0x7f) != 4) && (((rate[i]) & 0x7f) != 11) && (((rate[i]) & 0x7f) != 22) ) - return _FALSE; + return _FALSE; } return _TRUE; @@ -140,7 +140,9 @@ u8 networktype_to_raid(_adapter *adapter,struct sta_info *psta) u8 networktype_to_raid_ex(_adapter *adapter, struct sta_info *psta) { struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv; - u8 raid, cur_rf_type, rf_type= RF_1T1R; + u8 raid, cur_rf_type, rf_type; + + cur_rf_type = rf_type = RF_1T1R; rtw_hal_get_hwreg(adapter, HW_VAR_RF_TYPE, (u8 *)(&cur_rf_type)); @@ -393,6 +395,19 @@ void get_rate_set(_adapter *padapter, unsigned char *pbssrate, int *bssrate_len) _rtw_memcpy(pbssrate, supportedrates, *bssrate_len); } +void set_mcs_rate_by_mask(u8 *mcs_set, u32 mask) +{ + u8 mcs_rate_1r = (u8)(mask&0xff); + u8 mcs_rate_2r = (u8)((mask>>8)&0xff); + u8 mcs_rate_3r = (u8)((mask>>16)&0xff); + u8 mcs_rate_4r = (u8)((mask>>24)&0xff); + + mcs_set[0] &= mcs_rate_1r; + mcs_set[1] &= mcs_rate_2r; + mcs_set[2] &= mcs_rate_3r; + mcs_set[3] &= mcs_rate_4r; +} + void UpdateBrateTbl( IN PADAPTER Adapter, IN u8 *mBratesOS @@ -493,10 +508,39 @@ inline u8 rtw_get_oper_ch(_adapter *adapter) inline void rtw_set_oper_ch(_adapter *adapter, u8 ch) { - if (adapter_to_dvobj(adapter)->oper_channel != ch) - adapter_to_dvobj(adapter)->on_oper_ch_time = rtw_get_current_time(); +#ifdef DBG_CH_SWITCH + const int len = 128; + char msg[128] = {0}; + int cnt = 0; + int i = 0; +#endif /* DBG_CH_SWITCH */ + struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); + + if (dvobj->oper_channel != ch) { + dvobj->on_oper_ch_time = rtw_get_current_time(); + +#ifdef DBG_CH_SWITCH + cnt += snprintf(msg+cnt, len-cnt, "switch to ch %3u", ch); + + for (i = 0; i < dvobj->iface_nums; i++) { + _adapter *iface = dvobj->padapters[i]; + cnt += snprintf(msg+cnt, len-cnt, " ["ADPT_FMT":", ADPT_ARG(iface)); + if (iface->mlmeextpriv.cur_channel == ch) + cnt += snprintf(msg+cnt, len-cnt, "C"); + else + cnt += snprintf(msg+cnt, len-cnt, "_"); + if (iface->wdinfo.listen_channel == ch && !rtw_p2p_chk_state(&iface->wdinfo, P2P_STATE_NONE)) + cnt += snprintf(msg+cnt, len-cnt, "L"); + else + cnt += snprintf(msg+cnt, len-cnt, "_"); + cnt += snprintf(msg+cnt, len-cnt, "]"); + } + + DBG_871X(FUNC_ADPT_FMT" %s\n", FUNC_ADPT_ARG(adapter), msg); +#endif /* DBG_CH_SWITCH */ + } - adapter_to_dvobj(adapter)->oper_channel = ch; + dvobj->oper_channel = ch; } inline u8 rtw_get_oper_bw(_adapter *adapter) @@ -819,7 +863,17 @@ void CAM_empty_entry( void invalidate_cam_all(_adapter *padapter) { - rtw_hal_set_hwreg(padapter, HW_VAR_CAM_INVALID_ALL, 0); + struct dvobj_priv *dvobj = adapter_to_dvobj(padapter); + struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl; + _irqL irqL; + u8 val8 = 0; + + rtw_hal_set_hwreg(padapter, HW_VAR_CAM_INVALID_ALL, &val8); + + _enter_critical_bh(&cam_ctl->lock, &irqL); + cam_ctl->bitmap = 0; + _rtw_memset(dvobj->cam_cache, 0, sizeof(struct cam_entry_cache)*TOTAL_CAM_ENTRY); + _exit_critical_bh(&cam_ctl->lock, &irqL); } #if 1 static u32 _ReadCAM(_adapter *padapter ,u32 addr) @@ -851,81 +905,338 @@ void read_cam(_adapter *padapter ,u8 entry, u8 *get_key) } //DBG_8192C("*********************************\n"); } + +bool read_phy_cam_is_gtk(_adapter *padapter, u8 entry) +{ + bool res = _FALSE; + u32 addr, cmd; + + addr = entry << 3; + cmd = _ReadCAM(padapter, addr); + + res = (cmd & BIT6)? _TRUE:_FALSE; + return res; +} + +void dump_cam_table(_adapter *padapter) { + u32 i, j, addr, cmd; + DBG_871X("###########DUMP CAM TABLE##############\n"); + for (i = 0; i < 8 ; i++) { + addr = i << 3; + DBG_871X("********* DUMP CAM Entry_#%02d**********\n",i); + for (j = 0; j < 6; j++) { + cmd = _ReadCAM(padapter ,addr+j); + DBG_8192C("offset:0x%02x => 0x%08x \n",addr+j,cmd); + } + DBG_871X("*********************************\n"); + } +} #endif -void write_cam(_adapter *padapter, u8 entry, u16 ctrl, u8 *mac, u8 *key) +void _write_cam(_adapter *padapter, u8 entry, u16 ctrl, u8 *mac, u8 *key) { - unsigned int i, val, addr; - //unsigned int cmd; + unsigned int i, val, addr; int j; u32 cam_val[2]; addr = entry << 3; - for (j = 5; j >= 0; j--) - { - switch (j) - { - case 0: - val = (ctrl | (mac[0] << 16) | (mac[1] << 24) ); - break; - - case 1: - val = (mac[2] | ( mac[3] << 8) | (mac[4] << 16) | (mac[5] << 24)); - break; - - default: - i = (j - 2) << 2; - val = (key[i] | (key[i+1] << 8) | (key[i+2] << 16) | (key[i+3] << 24)); - break; - + for (j = 5; j >= 0; j--) { + switch (j) { + case 0: + val = (ctrl | (mac[0] << 16) | (mac[1] << 24) ); + break; + case 1: + val = (mac[2] | ( mac[3] << 8) | (mac[4] << 16) | (mac[5] << 24)); + break; + default: + i = (j - 2) << 2; + val = (key[i] | (key[i+1] << 8) | (key[i+2] << 16) | (key[i+3] << 24)); + break; } cam_val[0] = val; cam_val[1] = addr + (unsigned int)j; rtw_hal_set_hwreg(padapter, HW_VAR_CAM_WRITE, (u8 *)cam_val); - - //rtw_write32(padapter, WCAMI, val); - - //cmd = CAM_POLLINIG | CAM_WRITE | (addr + j); - //rtw_write32(padapter, RWCAM, cmd); - - //DBG_871X("%s=> cam write: %x, %x\n",__FUNCTION__, cmd, val); - } +} +void _clear_cam_entry(_adapter *padapter, u8 entry) +{ + unsigned char null_sta[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + unsigned char null_key[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00}; + + _write_cam(padapter, entry, 0, null_sta, null_key); } -void clear_cam_entry(_adapter *padapter, u8 entry) -{ -#if 0 - u32 addr, val=0; - u32 cam_val[2]; +inline void write_cam(_adapter *adapter, u8 id, u16 ctrl, u8 *mac, u8 *key) +{ +#ifdef CONFIG_WRITE_CACHE_ONLY + write_cam_cache(adapter, id ,ctrl, mac, key); +#else + _write_cam(adapter, id, ctrl, mac, key); + write_cam_cache(adapter, id ,ctrl, mac, key); +#endif +} - addr = entry << 3; +inline void clear_cam_entry(_adapter *adapter, u8 id) +{ + _clear_cam_entry(adapter, id); + clear_cam_cache(adapter, id); +} + +inline void write_cam_from_cache(_adapter *adapter, u8 id) +{ + struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); + struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl; + _irqL irqL; + struct cam_entry_cache cache; + + _enter_critical_bh(&cam_ctl->lock, &irqL); + _rtw_memcpy(&cache, &dvobj->cam_cache[id], sizeof(struct cam_entry_cache)); + _exit_critical_bh(&cam_ctl->lock, &irqL); + + _write_cam(adapter, id, cache.ctrl, cache.mac, cache.key); +} + +void write_cam_cache(_adapter *adapter, u8 id, u16 ctrl, u8 *mac, u8 *key) +{ + struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); + struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl; + _irqL irqL; + + _enter_critical_bh(&cam_ctl->lock, &irqL); + + dvobj->cam_cache[id].ctrl = ctrl; + _rtw_memcpy(dvobj->cam_cache[id].mac, mac, ETH_ALEN); + _rtw_memcpy(dvobj->cam_cache[id].key, key, 16); + + _exit_critical_bh(&cam_ctl->lock, &irqL); +} + +void clear_cam_cache(_adapter *adapter, u8 id) +{ + struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); + struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl; + _irqL irqL; + + _enter_critical_bh(&cam_ctl->lock, &irqL); + + _rtw_memset(&(dvobj->cam_cache[id]), 0, sizeof(struct cam_entry_cache)); + + _exit_critical_bh(&cam_ctl->lock, &irqL); +} + +s16 rtw_get_camid(_adapter *adapter, struct sta_info *sta, s16 kid) +{ + u8 macid; + s16 camid; + + //cam_entry: + //0~3 for default key + + //for concurrent mode (ap+sta, sta+sta): + //default key is disable, using sw encrypt/decrypt + //camid 0, 1, 2, 3 is default entry for default key/group key + //macid = 1 is for bc/mc stainfo, no mapping to camid + //macid = 0 mapping to camid 4 + //for macid >=2, camid = macid+3; + + if (sta) { + struct mlme_ext_info *mlmeinfo = &adapter->mlmeextpriv.mlmext_info; + macid = sta->mac_id; + + if((mlmeinfo->state&0x03) == WIFI_FW_AP_STATE) { + if((macid == 1) || (macid>(NUM_STA-4))){ + DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" failed, mac_id=%d\n", FUNC_ADPT_ARG(adapter), macid); + camid = -1; + goto exit; + } + } + + if(macid==0) + camid = 4; + else if(macid >=2) + camid = macid + 3; + else + camid = 4; + } + else { + /* default key is disabled */ + camid = -1; + } + +exit: + return (s16)camid; +} + +bool _rtw_camid_is_gk(_adapter *adapter, u8 cam_id) +{ + struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); + struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl; + bool ret = _FALSE; + + if (cam_id >= TOTAL_CAM_ENTRY) + goto exit; + + if (!(cam_ctl->bitmap & BIT(cam_id))) + goto exit; + ret = (dvobj->cam_cache[cam_id].ctrl&BIT6)?_TRUE:_FALSE; - cam_val[0] = val; - cam_val[1] = addr + (unsigned int)0; +exit: + return ret; +} - rtw_hal_set_hwreg(padapter, HW_VAR_CAM_WRITE, (u8 *)cam_val); +bool rtw_camid_is_gk(_adapter *adapter, u8 cam_id) +{ + struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); + struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl; + _irqL irqL; + bool ret; + _enter_critical_bh(&cam_ctl->lock, &irqL); + ret = _rtw_camid_is_gk(adapter, cam_id); + _exit_critical_bh(&cam_ctl->lock, &irqL); + return ret; +} - cam_val[0] = val; - cam_val[1] = addr + (unsigned int)1; +s16 _rtw_camid_search(_adapter *adapter, u8 *addr, s16 kid) +{ + struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); + struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl; + int i; + s16 cam_id = -1; + + for (i=0;icam_cache[i].mac, addr, ETH_ALEN) == _FALSE) + continue; + if (kid >= 0 && kid != (dvobj->cam_cache[i].ctrl&0x03)) + continue; + + cam_id = i; + break; + } + + if (0) { + if (addr) + DBG_871X(FUNC_ADPT_FMT" addr:"MAC_FMT" kid:%d, return cam_id:%d\n" + , FUNC_ADPT_ARG(adapter), MAC_ARG(addr), kid, cam_id); + else + DBG_871X(FUNC_ADPT_FMT" addr:%p kid:%d, return cam_id:%d\n" + , FUNC_ADPT_ARG(adapter), addr, kid, cam_id); + } + + return cam_id; +} + +s16 rtw_camid_search(_adapter *adapter, u8 *addr, s16 kid) +{ + struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); + struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl; + _irqL irqL; + s16 cam_id = -1; + + _enter_critical_bh(&cam_ctl->lock, &irqL); + cam_id = _rtw_camid_search(adapter, addr, kid); + _exit_critical_bh(&cam_ctl->lock, &irqL); + + return cam_id; +} - rtw_hal_set_hwreg(padapter, HW_VAR_CAM_WRITE, (u8 *)cam_val); +s16 rtw_camid_alloc(_adapter *adapter, struct sta_info *sta, u8 kid) +{ + struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); + struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl; + _irqL irqL; + s16 cam_id = -1; + + _enter_critical_bh(&cam_ctl->lock, &irqL); + +#ifdef DYNAMIC_CAMID_ALLOC + { + struct mlme_ext_info *mlmeinfo = &adapter->mlmeextpriv.mlmext_info; + + if((((mlmeinfo->state&0x03) == WIFI_FW_AP_STATE) || ((mlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE)) + && !sta) { + /* AP/Ad-hoc mode group key: static alloction to default key by key ID */ + if (kid > 3) { + DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" group key with invalid key id:%u\n" + , FUNC_ADPT_ARG(adapter), kid); + rtw_warn_on(1); + goto bitmap_handle; + } + + cam_id = kid; + } + else { + int i; + u8 *addr = sta?sta->hwaddr:NULL; + + if(!sta) { + if (!(mlmeinfo->state & WIFI_FW_ASSOC_SUCCESS)) { + /* bypass STA mode group key setting before connected(ex:WEP) because bssid is not ready */ + goto bitmap_handle; + } + + addr = get_bssid(&adapter->mlmepriv); + } + + if ((i = _rtw_camid_search(adapter, addr, kid)) >= 0) { + /* Fix issue that pairwise and group key have same key id. Pairwise key first, group key can overwirte group only(ex: rekey) */ + if (sta || _rtw_camid_is_gk(adapter, i) == _TRUE) + cam_id = i; + else + DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" group key id:%u the same key id as pairwise key\n" + , FUNC_ADPT_ARG(adapter), kid); + goto bitmap_handle; + } + + for (i=4;ibitmap & BIT(i))) + break; + + if (i == TOTAL_CAM_ENTRY) { + if (sta) + DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" pairwise key with "MAC_FMT" id:%u no room\n" + , FUNC_ADPT_ARG(adapter), MAC_ARG(sta->hwaddr), kid); + else + DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" group key id:%u no room\n" + , FUNC_ADPT_ARG(adapter), kid); + rtw_warn_on(1); + goto bitmap_handle; + } + + cam_id = i; + } + } #else + cam_id = rtw_get_camid(adapter, sta, kid); +#endif /* DYNAMIC_CAMID_ALLOC */ - unsigned char null_sta[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; +bitmap_handle: + if (cam_id >= 0) + cam_ctl->bitmap |= BIT(cam_id); - unsigned char null_key[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00}; + _exit_critical_bh(&cam_ctl->lock, &irqL); - write_cam(padapter, entry, 0, null_sta, null_key); + return cam_id; +} -#endif +void rtw_camid_free(_adapter *adapter, u8 cam_id) +{ + struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); + struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl; + _irqL irqL; + + _enter_critical_bh(&cam_ctl->lock, &irqL); + + if (cam_id < TOTAL_CAM_ENTRY) + cam_ctl->bitmap &= ~(BIT(cam_id)); + + _exit_critical_bh(&cam_ctl->lock, &irqL); } int allocate_fw_sta_entry(_adapter *padapter) @@ -949,49 +1260,58 @@ int allocate_fw_sta_entry(_adapter *padapter) void flush_all_cam_entry(_adapter *padapter) { - struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - -#ifdef CONFIG_CONCURRENT_MODE - + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); - //if(check_buddy_mlmeinfo_state(padapter, _HW_STATE_NOLINK_)) - if(check_buddy_fwstate(padapter, _FW_LINKED) == _FALSE) - { - rtw_hal_set_hwreg(padapter, HW_VAR_CAM_INVALID_ALL, 0); - } - else +#ifdef CONFIG_CONCURRENT_MODE + if(check_buddy_fwstate(padapter, _FW_LINKED) == _TRUE) { if(check_fwstate(pmlmepriv, WIFI_STATION_STATE)) { struct sta_priv *pstapriv = &padapter->stapriv; struct sta_info *psta; - u8 cam_id;//cam_entry psta = rtw_get_stainfo(pstapriv, pmlmeinfo->network.MacAddress); if(psta) { if(psta->state & WIFI_AP_STATE) {} //clear cam when ap free per sta_info else { - - cam_id = (u8)rtw_get_camid(psta->mac_id); - - //clear_cam_entry(padapter, cam_id); - rtw_clearstakey_cmd(padapter, (u8*)psta, cam_id, _FALSE); - } + rtw_clearstakey_cmd(padapter, psta, _FALSE); + } } } else if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE) { - //clear cam when ap free per sta_info - } - } -#else //CONFIG_CONCURRENT_MODE + /* clear default key */ + int i, cam_id; + u8 null_addr[ETH_ALEN]= {0,0,0,0,0,0}; + + for (i=0;i<4;i++) { + cam_id = rtw_camid_search(padapter, null_addr, i); + if (cam_id >= 0) { + clear_cam_entry(padapter, cam_id); + rtw_camid_free(padapter, cam_id); + } + } - rtw_hal_set_hwreg(padapter, HW_VAR_CAM_INVALID_ALL, 0); + /* clear default key related key search setting */ + #ifdef DYNAMIC_CAMID_ALLOC + rtw_hal_set_hwreg(padapter, HW_VAR_SEC_DK_CFG, (u8*)_FALSE); + #endif + /* leave pairwise key when ap free per sta_info */ + } + } + else #endif //CONFIG_CONCURRENT_MODE + { + invalidate_cam_all(padapter); + /* clear default key related key search setting */ + #ifdef DYNAMIC_CAMID_ALLOC + rtw_hal_set_hwreg(padapter, HW_VAR_SEC_DK_CFG, (u8*)_FALSE); + #endif + } _rtw_memset((u8 *)(pmlmeinfo->FW_sta_info), 0, sizeof(pmlmeinfo->FW_sta_info)); @@ -1043,11 +1363,18 @@ int WMM_param_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE) if(pmlmepriv->qospriv.qos_option==0) { pmlmeinfo->WMM_enable = 0; - return _FAIL; + return _FALSE; } - + + if(_rtw_memcmp(&(pmlmeinfo->WMM_param), (pIE->data + 6), sizeof(struct WMM_para_element))) + { + return _FALSE; + } + else + { + _rtw_memcpy(&(pmlmeinfo->WMM_param), (pIE->data + 6), sizeof(struct WMM_para_element)); + } pmlmeinfo->WMM_enable = 1; - _rtw_memcpy(&(pmlmeinfo->WMM_param), (pIE->data + 6), sizeof(struct WMM_para_element)); return _TRUE; /*if (pregpriv->wifi_spec == 1) @@ -1335,8 +1662,9 @@ void HT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE) { #ifdef CONFIG_80211N_HT unsigned int i; - u8 rf_type; + u8 rf_type = RF_1T1R; u8 max_AMPDU_len, min_MPDU_spacing; + u8 cur_ldpc_cap=0, cur_stbc_cap=0, cur_beamform_cap=0; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -1359,7 +1687,9 @@ void HT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE) } else { - //modify from fw by Thomas 2010/11/17 + /* AMPDU Parameters field */ + + /* Get MIN of MAX AMPDU Length Exp */ if ((pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x3) > (pIE->data[i] & 0x3)) { max_AMPDU_len = (pIE->data[i] & 0x3); @@ -1368,7 +1698,8 @@ void HT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE) { max_AMPDU_len = (pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x3); } - + + /* Get MAX of MIN MPDU Start Spacing */ if ((pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x1c) > (pIE->data[i] & 0x1c)) { min_MPDU_spacing = (pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x1c); @@ -1390,32 +1721,95 @@ void HT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE) rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type)); - //update the MCS rates + + //update the MCS set for (i = 0; i < 16; i++) + pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= pmlmeext->default_supported_mcs_set[i]; + + //update the MCS rates + switch(rf_type) { - if((rf_type == RF_1T1R) || (rf_type == RF_1T2R)) + case RF_1T1R: + case RF_1T2R: + set_mcs_rate_by_mask(pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate, MCS_RATE_1R); + break; + case RF_2T2R: + default: +#ifdef CONFIG_DISABLE_MCS13TO15 + if(pmlmeext->cur_bwmode == CHANNEL_WIDTH_40 && pregistrypriv->wifi_spec != 1 ) + set_mcs_rate_by_mask(pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate, MCS_RATE_2R_13TO15_OFF); + else + set_mcs_rate_by_mask(pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate, MCS_RATE_2R); +#else //CONFIG_DISABLE_MCS13TO15 + set_mcs_rate_by_mask(pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate, MCS_RATE_2R); +#endif //CONFIG_DISABLE_MCS13TO15 + } + + if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { + // Config STBC setting + if (TEST_FLAG(phtpriv->stbc_cap, STBC_HT_ENABLE_TX) && GET_HT_CAP_ELE_TX_STBC(pIE->data)) { - pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= MCS_rate_1R[i]; + SET_FLAG(cur_stbc_cap, STBC_HT_ENABLE_TX); + DBG_871X("Enable HT Tx STBC !\n"); } - else + phtpriv->stbc_cap = cur_stbc_cap; + +#ifdef CONFIG_BEAMFORMING + // Config Tx beamforming setting + if (TEST_FLAG(phtpriv->beamform_cap, BEAMFORMING_HT_BEAMFORMER_ENABLE) && + GET_HT_CAP_TXBF_EXPLICIT_COMP_STEERING_CAP(pIE->data)) { - #ifdef CONFIG_DISABLE_MCS13TO15 - if(pmlmeext->cur_bwmode == CHANNEL_WIDTH_40 && (pregistrypriv->wifi_spec!=1)) - pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= MCS_rate_2R_MCS13TO15_OFF[i]; - else - pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= MCS_rate_2R[i]; - #else - pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= MCS_rate_2R[i]; - #endif //CONFIG_DISABLE_MCS13TO15 + SET_FLAG(cur_beamform_cap, BEAMFORMING_HT_BEAMFORMER_ENABLE); } - #ifdef RTL8192C_RECONFIG_TO_1T1R + + if (TEST_FLAG(phtpriv->beamform_cap, BEAMFORMING_HT_BEAMFORMEE_ENABLE) && + GET_HT_CAP_TXBF_EXPLICIT_COMP_FEEDBACK_CAP(pIE->data)) { - pmlmeinfo->HT_caps.HT_cap_element.MCS_rate[i] &= MCS_rate_1R[i]; + SET_FLAG(cur_beamform_cap, BEAMFORMING_HT_BEAMFORMEE_ENABLE); } - #endif + phtpriv->beamform_cap = cur_beamform_cap; + if (cur_beamform_cap) { + DBG_871X("AP HT Beamforming Cap = 0x%02X\n", cur_beamform_cap); + } +#endif //CONFIG_BEAMFORMING + } else { + // Config LDPC Coding Capability + if (TEST_FLAG(phtpriv->ldpc_cap, LDPC_HT_ENABLE_TX) && GET_HT_CAP_ELE_LDPC_CAP(pIE->data)) + { + SET_FLAG(cur_ldpc_cap, (LDPC_HT_ENABLE_TX | LDPC_HT_CAP_TX)); + DBG_871X("Enable HT Tx LDPC!\n"); + } + phtpriv->ldpc_cap = cur_ldpc_cap; + + // Config STBC setting + if (TEST_FLAG(phtpriv->stbc_cap, STBC_HT_ENABLE_TX) && GET_HT_CAP_ELE_RX_STBC(pIE->data)) + { + SET_FLAG(cur_stbc_cap, (STBC_HT_ENABLE_TX | STBC_HT_CAP_TX) ); + DBG_871X("Enable HT Tx STBC!\n"); + } + phtpriv->stbc_cap = cur_stbc_cap; + +#ifdef CONFIG_BEAMFORMING + // Config Tx beamforming setting + if (TEST_FLAG(phtpriv->beamform_cap, BEAMFORMING_HT_BEAMFORMEE_ENABLE) && + GET_HT_CAP_TXBF_EXPLICIT_COMP_STEERING_CAP(pIE->data)) + { + SET_FLAG(cur_beamform_cap, BEAMFORMING_HT_BEAMFORMER_ENABLE); + } + + if (TEST_FLAG(phtpriv->beamform_cap, BEAMFORMING_HT_BEAMFORMER_ENABLE) && + GET_HT_CAP_TXBF_EXPLICIT_COMP_FEEDBACK_CAP(pIE->data)) + { + SET_FLAG(cur_beamform_cap, BEAMFORMING_HT_BEAMFORMEE_ENABLE); + } + phtpriv->beamform_cap = cur_beamform_cap; + if (cur_beamform_cap) { + DBG_871X("Client HT Beamforming Cap = 0x%02X\n", cur_beamform_cap); + } +#endif //CONFIG_BEAMFORMING } + #endif //CONFIG_80211N_HT - return; } void HT_info_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE) @@ -1586,28 +1980,148 @@ void VCS_update(_adapter *padapter, struct sta_info *psta) } break; } -} +} + +void update_ldpc_stbc_cap(struct sta_info *psta) +{ +#ifdef CONFIG_80211N_HT + +#ifdef CONFIG_80211AC_VHT + if (psta->vhtpriv.vht_option) { + if(TEST_FLAG(psta->vhtpriv.ldpc_cap, LDPC_VHT_ENABLE_TX)) + psta->ldpc = 1; + + if(TEST_FLAG(psta->vhtpriv.stbc_cap, STBC_VHT_ENABLE_TX)) + psta->stbc = 1; + } + else +#endif //CONFIG_80211AC_VHT + if (psta->htpriv.ht_option) { + if(TEST_FLAG(psta->htpriv.ldpc_cap, LDPC_HT_ENABLE_TX)) + psta->ldpc = 1; + + if(TEST_FLAG(psta->htpriv.stbc_cap, STBC_HT_ENABLE_TX)) + psta->stbc = 1; + } else { + psta->ldpc = 0; + psta->stbc = 0; + } + +#endif //CONFIG_80211N_HT +} + + +/* + * rtw_get_bcn_keys: get beacon keys from recv frame + * + * TODO: + * WLAN_EID_COUNTRY + * WLAN_EID_ERP_INFO + * WLAN_EID_CHANNEL_SWITCH + * WLAN_EID_PWR_CONSTRAINT + */ +int rtw_get_bcn_keys(ADAPTER *Adapter, u8 *pframe, u32 packet_len, + struct beacon_keys *recv_beacon) +{ + int left; + u16 capability; + unsigned char *pos; + struct rtw_ieee802_11_elems elems; + struct rtw_ieee80211_ht_cap *pht_cap = NULL; + struct HT_info_element *pht_info = NULL; + + _rtw_memset(recv_beacon, 0, sizeof(*recv_beacon)); + + /* checking capabilities */ + capability = le16_to_cpu(*(unsigned short *)(pframe + WLAN_HDR_A3_LEN + 10)); + + /* checking IEs */ + left = packet_len - sizeof(struct rtw_ieee80211_hdr_3addr) - _BEACON_IE_OFFSET_; + pos = pframe + sizeof(struct rtw_ieee80211_hdr_3addr) + _BEACON_IE_OFFSET_; + if (rtw_ieee802_11_parse_elems(pos, left, &elems, 1) == ParseFailed) + return _FALSE; + + /* check bw and channel offset */ + if (elems.ht_capabilities) { + if (elems.ht_capabilities_len != sizeof(*pht_cap)) + return _FALSE; + + pht_cap = (struct rtw_ieee80211_ht_cap *) elems.ht_capabilities; + recv_beacon->ht_cap_info = pht_cap->cap_info; + } -#ifdef CONFIG_TDLS -int check_ap_tdls_prohibited(u8 *pframe, u8 pkt_len) -{ - u8 tdls_prohibited_bit = 0x40; //bit(38); TDLS_prohibited + if (elems.ht_operation) { + if (elems.ht_operation_len != sizeof(*pht_info)) + return _FALSE; - if(pkt_len < 5) - { - return _FALSE; + pht_info = (struct HT_info_element *) elems.ht_operation; + recv_beacon->ht_info_infos_0_sco = pht_info->infos[0] & 0x03; } - pframe += 4; - if( (*pframe) & tdls_prohibited_bit ) - return _TRUE; + /* Checking for channel */ + if (elems.ds_params && elems.ds_params_len == sizeof(recv_beacon->bcn_channel)) + _rtw_memcpy(&recv_beacon->bcn_channel, elems.ds_params, + sizeof(recv_beacon->bcn_channel)); + else if (pht_info) + /* In 5G, some ap do not have DSSET IE checking HT info for channel */ + recv_beacon->bcn_channel = pht_info->primary_channel; + else { + /* we don't find channel IE, so don't check it */ + //DBG_871X("Oops: %s we don't find channel IE, so don't check it \n", __func__); + recv_beacon->bcn_channel = Adapter->mlmeextpriv.cur_channel; + } - return _FALSE; + /* checking SSID */ + if (elems.ssid) { + if (elems.ssid_len > sizeof(recv_beacon->ssid)) + return _FALSE; + + _rtw_memcpy(recv_beacon->ssid, elems.ssid, elems.ssid_len); + recv_beacon->ssid_len = elems.ssid_len; + } else { ; } // means hidden ssid + + /* checking RSN first */ + if (elems.rsn_ie && elems.rsn_ie_len) { + recv_beacon->encryp_protocol = ENCRYP_PROTOCOL_WPA2; + rtw_parse_wpa2_ie(elems.rsn_ie - 2, elems.rsn_ie_len + 2, + &recv_beacon->group_cipher, &recv_beacon->pairwise_cipher, + &recv_beacon->is_8021x); + } + /* checking WPA secon */ + else if (elems.wpa_ie && elems.wpa_ie_len) { + recv_beacon->encryp_protocol = ENCRYP_PROTOCOL_WPA; + rtw_parse_wpa_ie(elems.wpa_ie - 2, elems.wpa_ie_len + 2, + &recv_beacon->group_cipher, &recv_beacon->pairwise_cipher, + &recv_beacon->is_8021x); + } + else if (capability & BIT(4)) { + recv_beacon->encryp_protocol = ENCRYP_PROTOCOL_WEP; + } + + return _TRUE; +} + +void rtw_dump_bcn_keys(struct beacon_keys *recv_beacon) +{ + int i; + char *p; + u8 ssid[IW_ESSID_MAX_SIZE + 1]; + + _rtw_memcpy(ssid, recv_beacon->ssid, recv_beacon->ssid_len); + ssid[recv_beacon->ssid_len] = '\0'; + + DBG_871X("%s: ssid = %s\n", __func__, ssid); + DBG_871X("%s: channel = %x\n", __func__, recv_beacon->bcn_channel); + DBG_871X("%s: ht_cap = %x\n", __func__, recv_beacon->ht_cap_info); + DBG_871X("%s: ht_info_infos_0_sco = %x\n", __func__, recv_beacon->ht_info_infos_0_sco); + DBG_871X("%s: sec=%d, group = %x, pair = %x, 8021X = %x\n", __func__, + recv_beacon->encryp_protocol, recv_beacon->group_cipher, + recv_beacon->pairwise_cipher, recv_beacon->is_8021x); } -#endif //CONFIG_TDLS int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len) { +#if 0 unsigned int len; unsigned char *p; unsigned short val16, subtype; @@ -1627,6 +2141,12 @@ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len) u32 bcn_channel; unsigned short ht_cap_info; unsigned char ht_info_infos_0; +#endif + unsigned int len; + u8 *pbssid = GetAddr3Ptr(pframe); + struct mlme_priv *pmlmepriv = &Adapter->mlmepriv; + struct wlan_network *cur_network = &(Adapter->mlmepriv.cur_network); + struct beacon_keys recv_beacon; if (is_client_associated_to_ap(Adapter) == _FALSE) return _TRUE; @@ -1644,7 +2164,89 @@ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len) return _TRUE; } + if (rtw_get_bcn_keys(Adapter, pframe, packet_len, &recv_beacon) == _FALSE) + return _TRUE; // parsing failed => broken IE + + // don't care hidden ssid, use current beacon ssid directly + if (recv_beacon.ssid_len == 0) { + _rtw_memcpy(recv_beacon.ssid, pmlmepriv->cur_beacon_keys.ssid, + pmlmepriv->cur_beacon_keys.ssid_len); + recv_beacon.ssid_len = pmlmepriv->cur_beacon_keys.ssid_len; + } + + if (_rtw_memcmp(&recv_beacon, &pmlmepriv->cur_beacon_keys, sizeof(recv_beacon)) == _TRUE) + { + pmlmepriv->new_beacon_cnts = 0; + } + else if ((pmlmepriv->new_beacon_cnts == 0) || + _rtw_memcmp(&recv_beacon, &pmlmepriv->new_beacon_keys, sizeof(recv_beacon)) == _FALSE) + { + DBG_871X_LEVEL(_drv_err_, "%s: start new beacon (seq=%d)\n", __func__, GetSequence(pframe)); + + if (pmlmepriv->new_beacon_cnts == 0) { + DBG_871X_LEVEL(_drv_err_, "%s: cur beacon key\n", __func__); + DBG_871X_EXP(_drv_err_, rtw_dump_bcn_keys(&pmlmepriv->cur_beacon_keys)); + } + + DBG_871X_LEVEL(_drv_err_, "%s: new beacon key\n", __func__); + DBG_871X_EXP(_drv_err_, rtw_dump_bcn_keys(&recv_beacon)); + + memcpy(&pmlmepriv->new_beacon_keys, &recv_beacon, sizeof(recv_beacon)); + pmlmepriv->new_beacon_cnts = 1; + } + else + { + DBG_871X_LEVEL(_drv_err_, "%s: new beacon again (seq=%d)\n", __func__, GetSequence(pframe)); + pmlmepriv->new_beacon_cnts++; + } + + // if counter >= max, it means beacon is changed really + if (pmlmepriv->new_beacon_cnts >= new_bcn_max) + { + DBG_871X_LEVEL(_drv_err_, "%s: new beacon occur!!\n", __func__); + + // check bw mode change only? + pmlmepriv->cur_beacon_keys.ht_cap_info = recv_beacon.ht_cap_info; + pmlmepriv->cur_beacon_keys.ht_info_infos_0_sco = recv_beacon.ht_info_infos_0_sco; + + if (_rtw_memcmp(&recv_beacon, &pmlmepriv->cur_beacon_keys, + sizeof(recv_beacon)) == _FALSE) { + // beacon is changed, have to do disconnect/connect + return _FAIL; + } + + DBG_871X("%s bw mode change\n", __func__); + DBG_871X("%s bcn now: ht_cap_info:%x ht_info_infos_0:%x\n", __func__, + cur_network->BcnInfo.ht_cap_info, + cur_network->BcnInfo.ht_info_infos_0); + + cur_network->BcnInfo.ht_cap_info = recv_beacon.ht_cap_info; + cur_network->BcnInfo.ht_info_infos_0 = + (cur_network->BcnInfo.ht_info_infos_0 & (~0x03)) | + recv_beacon.ht_info_infos_0_sco; + + DBG_871X("%s bcn link: ht_cap_info:%x ht_info_infos_0:%x\n", __func__, + cur_network->BcnInfo.ht_cap_info, + cur_network->BcnInfo.ht_info_infos_0); + + memcpy(&pmlmepriv->cur_beacon_keys, &recv_beacon, sizeof(recv_beacon)); + pmlmepriv->new_beacon_cnts = 0; + } + + return _SUCCESS; + +#if 0 bssid = (WLAN_BSSID_EX *)rtw_zmalloc(sizeof(WLAN_BSSID_EX)); + if (bssid == NULL) { + DBG_871X("%s rtw_zmalloc fail !!!\n", __func__); + return _TRUE; + } + + if ((pmlmepriv->timeBcnInfoChkStart != 0) && (rtw_get_passing_time_ms(pmlmepriv->timeBcnInfoChkStart) > DISCONNECT_BY_CHK_BCN_FAIL_OBSERV_PERIOD_IN_MS)) + { + pmlmepriv->timeBcnInfoChkStart = 0; + pmlmepriv->NumOfBcnInfoChkFail = 0; + } subtype = GetFrameSubType(pframe) >> 4; @@ -1680,7 +2282,7 @@ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len) ht_cap_info, ht_info_infos_0); DBG_871X("%s bcn link: ht_cap_info:%x ht_info_infos_0:%x\n", __func__, cur_network->BcnInfo.ht_cap_info, cur_network->BcnInfo.ht_info_infos_0); - DBG_871X("%s bw mode change, disconnect\n", __func__); + DBG_871X("%s bw mode change\n", __func__); { //bcn_info_update cur_network->BcnInfo.ht_cap_info = ht_cap_info; @@ -1695,7 +2297,7 @@ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len) if (p) { bcn_channel = *(p + 2); } else {/* In 5G, some ap do not have DSSET IE checking HT info for channel */ - p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _HT_ADD_INFO_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_); + rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _HT_ADD_INFO_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_); if(pht_info) { bcn_channel = pht_info->primary_channel; } else { /* we don't find channel IE, so don't check it */ @@ -1733,7 +2335,7 @@ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len) if (_rtw_memcmp(bssid->Ssid.Ssid, cur_network->network.Ssid.Ssid, 32) == _FALSE || bssid->Ssid.SsidLength != cur_network->network.Ssid.SsidLength) { if (bssid->Ssid.Ssid[0] != '\0' && bssid->Ssid.SsidLength != 0) { /* not hidden ssid */ - DBG_871X("%s(), SSID is not match return FAIL\n", __func__); + DBG_871X("%s(), SSID is not match\n", __func__); goto _mismatch; } } @@ -1750,7 +2352,7 @@ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len) ("%s(): cur_network->network.Privacy is %d, bssid.Privacy is %d\n", __func__, cur_network->network.Privacy,bssid->Privacy)); if (cur_network->network.Privacy != bssid->Privacy) { - DBG_871X("%s(), privacy is not match return FAIL\n",__func__); + DBG_871X("%s(), privacy is not match\n",__func__); goto _mismatch; } @@ -1766,7 +2368,7 @@ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len) } if (cur_network->BcnInfo.encryp_protocol != encryp_protocol) { - DBG_871X("%s(): enctyp is not match ,return FAIL\n",__func__); + DBG_871X("%s(): enctyp is not match\n",__func__); goto _mismatch; } @@ -1793,14 +2395,14 @@ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len) RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_, ("%s cur_network->group_cipher is %d: %d\n",__func__, cur_network->BcnInfo.group_cipher, group_cipher)); if (pairwise_cipher != cur_network->BcnInfo.pairwise_cipher || group_cipher != cur_network->BcnInfo.group_cipher) { - DBG_871X("%s pairwise_cipher(%x:%x) or group_cipher(%x:%x) is not match ,return FAIL\n",__func__, + DBG_871X("%s pairwise_cipher(%x:%x) or group_cipher(%x:%x) is not match\n",__func__, pairwise_cipher, cur_network->BcnInfo.pairwise_cipher, group_cipher, cur_network->BcnInfo.group_cipher); goto _mismatch; } if (is_8021x != cur_network->BcnInfo.is_8021x) { - DBG_871X("%s authentication is not match ,return FAIL\n", __func__); + DBG_871X("%s authentication is not match\n", __func__); goto _mismatch; } } @@ -1810,9 +2412,27 @@ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len) _mismatch: rtw_mfree((u8 *)bssid, sizeof(WLAN_BSSID_EX)); - return _FAIL; - _func_exit_; + if (pmlmepriv->NumOfBcnInfoChkFail == 0) + { + pmlmepriv->timeBcnInfoChkStart = rtw_get_current_time(); + } + + pmlmepriv->NumOfBcnInfoChkFail++; + DBG_871X("%s by "ADPT_FMT" - NumOfChkFail = %d (SeqNum of this Beacon frame = %d).\n", __func__, ADPT_ARG(Adapter), pmlmepriv->NumOfBcnInfoChkFail, GetSequence(pframe)); + + if ((pmlmepriv->timeBcnInfoChkStart != 0) && (rtw_get_passing_time_ms(pmlmepriv->timeBcnInfoChkStart) <= DISCONNECT_BY_CHK_BCN_FAIL_OBSERV_PERIOD_IN_MS) + && (pmlmepriv->NumOfBcnInfoChkFail >= DISCONNECT_BY_CHK_BCN_FAIL_THRESHOLD)) + { + DBG_871X("%s by "ADPT_FMT" - NumOfChkFail = %d >= threshold : %d (in %d ms), return FAIL.\n", __func__, ADPT_ARG(Adapter), pmlmepriv->NumOfBcnInfoChkFail, + DISCONNECT_BY_CHK_BCN_FAIL_THRESHOLD, rtw_get_passing_time_ms(pmlmepriv->timeBcnInfoChkStart)); + pmlmepriv->timeBcnInfoChkStart = 0; + pmlmepriv->NumOfBcnInfoChkFail = 0; + return _FAIL; + } + + return _SUCCESS; +#endif } void update_beacon_info(_adapter *padapter, u8 *pframe, uint pkt_len, struct sta_info *psta) @@ -1834,15 +2454,14 @@ void update_beacon_info(_adapter *padapter, u8 *pframe, uint pkt_len, struct sta switch (pIE->ElementID) { -#if 0 case _VENDOR_SPECIFIC_IE_: - //todo: to update WMM paramter set while receiving beacon - if (_rtw_memcmp(pIE->data, WMM_PARA_OUI, 6)) //WMM + //to update WMM paramter set while receiving beacon + if (_rtw_memcmp(pIE->data, WMM_PARA_OUI, 6) && pIE->Length == WLAN_WMM_LEN) //WMM { - (WMM_param_handler(padapter, pIE))? WMMOnAssocRsp(padapter): 0; - } + (WMM_param_handler(padapter, pIE))? report_wmm_edca_update(padapter): 0; + } + break; -#endif case _HT_EXTRA_INFO_IE_: //HT info //HT_info_handler(padapter, pIE); @@ -1862,6 +2481,8 @@ void update_beacon_info(_adapter *padapter, u8 *pframe, uint pkt_len, struct sta case _EXT_CAP_IE_: if( check_ap_tdls_prohibited(pIE->data, pIE->Length) == _TRUE ) ptdlsinfo->ap_prohibited = _TRUE; + if (check_ap_tdls_ch_switching_prohibited(pIE->data, pIE->Length) == _TRUE) + ptdlsinfo->ch_switch_prohibited = _TRUE; break; #endif //CONFIG_TDLS default: @@ -1975,7 +2596,7 @@ unsigned int should_forbid_n_rate(_adapter * padapter) case _RSN_IE_2_: if ((_rtw_memcmp((pIE->data + 8), RSN_CIPHER_SUITE_CCMP, 4)) || (_rtw_memcmp((pIE->data + 12), RSN_CIPHER_SUITE_CCMP, 4))) - return _FALSE; + return _FALSE; default: break; @@ -2265,9 +2886,10 @@ unsigned char check_assoc_AP(u8 *pframe, uint len) DBG_871X("link to Artheros AP\n"); return HT_IOT_PEER_ATHEROS; } - else if ((_rtw_memcmp(pIE->data, BROADCOM_OUI1, 3)) - || (_rtw_memcmp(pIE->data, BROADCOM_OUI2, 3)) - || (_rtw_memcmp(pIE->data, BROADCOM_OUI2, 3))) + else if ( (_rtw_memcmp(pIE->data, BROADCOM_OUI1, 3)) + || (_rtw_memcmp(pIE->data, BROADCOM_OUI2, 3)) + || (_rtw_memcmp(pIE->data, BROADCOM_OUI3, 3)) + || (_rtw_memcmp(pIE->data, BROADCOM_OUI4, 3))) { DBG_871X("link to Broadcom AP\n"); return HT_IOT_PEER_BROADCOM; @@ -2599,31 +3221,41 @@ void process_addba_req(_adapter *padapter, u8 *paddba_req, u8 *addr) struct ADDBA_request *preq = (struct ADDBA_request*)paddba_req; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + u8 size; psta = rtw_get_stainfo(pstapriv, addr); + if (!psta) + goto exit; - if(psta) - { - start_seq = le16_to_cpu(preq->BA_starting_seqctrl) >> 4; - - param = le16_to_cpu(preq->BA_para_set); - tid = (param>>2)&0x0f; - - preorder_ctrl = &psta->recvreorder_ctrl[tid]; + start_seq = le16_to_cpu(preq->BA_starting_seqctrl) >> 4; - #ifdef CONFIG_UPDATE_INDICATE_SEQ_WHILE_PROCESS_ADDBA_REQ - preorder_ctrl->indicate_seq = start_seq; - #ifdef DBG_RX_SEQ - DBG_871X("DBG_RX_SEQ %s:%d IndicateSeq: %d, start_seq: %d\n", __FUNCTION__, __LINE__, - preorder_ctrl->indicate_seq, start_seq); - #endif - #else - preorder_ctrl->indicate_seq = 0xffff; - #endif - - preorder_ctrl->enable =(pmlmeinfo->bAcceptAddbaReq == _TRUE)? _TRUE :_FALSE; + param = le16_to_cpu(preq->BA_para_set); + tid = (param>>2)&0x0f; + + preorder_ctrl = &psta->recvreorder_ctrl[tid]; + + #ifdef CONFIG_UPDATE_INDICATE_SEQ_WHILE_PROCESS_ADDBA_REQ + preorder_ctrl->indicate_seq = start_seq; + #ifdef DBG_RX_SEQ + DBG_871X("DBG_RX_SEQ %s:%d IndicateSeq: %d, start_seq: %d\n", __func__, __LINE__, + preorder_ctrl->indicate_seq, start_seq); + #endif + #else + preorder_ctrl->indicate_seq = 0xffff; + #endif + + preorder_ctrl->enable = rtw_rx_ampdu_is_accept(padapter); + size = rtw_rx_ampdu_size(padapter); + + if (preorder_ctrl->enable == _TRUE) { + preorder_ctrl->ampdu_size = size; + issue_addba_rsp(padapter, addr, tid, 0, size); + } else { + issue_addba_rsp(padapter, addr, tid, 37, size); /* reject ADDBA Req */ } +exit: + return; } void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len) @@ -2712,8 +3344,8 @@ void adaptive_early_32k(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len) pmlmeext->bcn_delay_ratio[i] = (pmlmeext->bcn_delay_cnt[i] * 100) /pmlmeext->bcn_cnt; - DBG_871X("%s():bcn_delay_cnt[%d]=%d, bcn_delay_ratio[%d]=%d\n", __func__, i, - pmlmeext->bcn_delay_cnt[i] , i, pmlmeext->bcn_delay_ratio[i]); + //DBG_871X("%s():bcn_delay_cnt[%d]=%d, bcn_delay_ratio[%d]=%d\n", __func__, i, + // pmlmeext->bcn_delay_cnt[i] , i, pmlmeext->bcn_delay_ratio[i]); ratio_20_delay += pmlmeext->bcn_delay_ratio[i]; ratio_80_delay += pmlmeext->bcn_delay_ratio[i]; @@ -2721,13 +3353,13 @@ void adaptive_early_32k(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len) if(ratio_20_delay > 20 && DrvBcnEarly == 0xff) { DrvBcnEarly = i; - DBG_871X("%s(): DrvBcnEarly = %d\n", __func__, DrvBcnEarly); + //DBG_871X("%s(): DrvBcnEarly = %d\n", __func__, DrvBcnEarly); } if(ratio_80_delay > 80 && DrvBcnTimeOut == 0xff) { DrvBcnTimeOut = i; - DBG_871X("%s(): DrvBcnTimeOut = %d\n", __func__, DrvBcnTimeOut); + //DBG_871X("%s(): DrvBcnTimeOut = %d\n", __func__, DrvBcnTimeOut); } //reset adaptive_early_32k cnt @@ -2749,118 +3381,278 @@ void beacon_timing_control(_adapter *padapter) rtw_hal_bcn_related_reg_setting(padapter); } -uint rtw_get_camid(uint macid) +#define CONFIG_SHARED_BMC_MACID + +void dump_macid_map(void *sel, struct macid_bmp *map, u8 max_num) +{ + DBG_871X_SEL_NL(sel, "0x%08x\n", map->m0); +#if (MACID_NUM_SW_LIMIT > 32) + if (max_num && max_num > 32) + DBG_871X_SEL_NL(sel, "0x%08x\n", map->m1); +#endif +#if (MACID_NUM_SW_LIMIT > 64) + if (max_num && max_num > 64) + DBG_871X_SEL_NL(sel, "0x%08x\n", map->m2); +#endif +#if (MACID_NUM_SW_LIMIT > 96) + if (max_num && max_num > 96) + DBG_871X_SEL_NL(sel, "0x%08x\n", map->m3); +#endif +} + +inline bool rtw_macid_is_set(struct macid_bmp *map, u8 id) { - uint camid; + if (id < 32) + return (map->m0 & BIT(id)); +#if (MACID_NUM_SW_LIMIT > 32) + else if (id < 64) + return (map->m1 & BIT(id-32)); +#endif +#if (MACID_NUM_SW_LIMIT > 64) + else if (id < 96) + return (map->m2 & BIT(id-64)); +#endif +#if (MACID_NUM_SW_LIMIT > 96) + else if (id < 128) + return (map->m3 & BIT(id-96)); +#endif + else + rtw_warn_on(1); - //camid 0, 1, 2, 3 is default entry for default key/group key - //macid = 1 is for bc/mc stainfo, no mapping to camid - //macid = 0 mapping to camid 4 - //for macid >=2, camid = macid+3; + return 0; +} + +inline void rtw_macid_map_set(struct macid_bmp *map, u8 id) +{ + if (id < 32) + map->m0 |= BIT(id); +#if (MACID_NUM_SW_LIMIT > 32) + else if (id < 64) + map->m1 |= BIT(id-32); +#endif +#if (MACID_NUM_SW_LIMIT > 64) + else if (id < 96) + map->m2 |= BIT(id-64); +#endif +#if (MACID_NUM_SW_LIMIT > 96) + else if (id < 128) + map->m3 |= BIT(id-96); +#endif + else + rtw_warn_on(1); +} - if(macid==0) - camid = 4; - else if(macid >=2) - camid = macid + 3; +inline void rtw_macid_map_clr(struct macid_bmp *map, u8 id) +{ + if (id < 32) + map->m0 &= ~BIT(id); +#if (MACID_NUM_SW_LIMIT > 32) + else if (id < 64) + map->m1 &= ~BIT(id-32); +#endif +#if (MACID_NUM_SW_LIMIT > 64) + else if (id < 96) + map->m2 &= ~BIT(id-64); +#endif +#if (MACID_NUM_SW_LIMIT > 96) + else if (id < 128) + map->m3 &= ~BIT(id-96); +#endif else - camid = 4; + rtw_warn_on(1); +} + +inline bool rtw_macid_is_used(struct macid_ctl_t *macid_ctl, u8 id) +{ + return rtw_macid_is_set(&macid_ctl->used, id); +} - return camid; +inline bool rtw_macid_is_bmc(struct macid_ctl_t *macid_ctl, u8 id) +{ + return rtw_macid_is_set(&macid_ctl->bmc, id); } -void rtw_alloc_macid(_adapter *padapter, struct sta_info *psta) +inline s8 rtw_macid_get_if_g(struct macid_ctl_t *macid_ctl, u8 id) { int i; - _irqL irqL; - u8 bc_addr[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff}; - struct dvobj_priv *pdvobj = adapter_to_dvobj(padapter); +#ifdef CONFIG_SHARED_BMC_MACID + if (rtw_macid_is_bmc(macid_ctl,id)) + return -1; +#endif - if(_rtw_memcmp(psta->hwaddr, bc_addr, ETH_ALEN)) - return; + for (i=0;iif_g[i], id)) + return i; + } + return -1; +} - if(_rtw_memcmp(psta->hwaddr, myid(&padapter->eeprompriv), ETH_ALEN)) - { - psta->mac_id = NUM_STA; +inline s8 rtw_macid_get_ch_g(struct macid_ctl_t *macid_ctl, u8 id) +{ + int i; + + for (i=0;i<2;i++) { + if (rtw_macid_is_set(&macid_ctl->ch_g[i], id)) + return i; + } + return -1; +} + +void rtw_alloc_macid(_adapter *padapter, struct sta_info *psta) +{ + int i; + _irqL irqL; + u8 bc_addr[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff}; + struct dvobj_priv *dvobj = adapter_to_dvobj(padapter); + struct macid_ctl_t *macid_ctl = dvobj_to_macidctl(dvobj); + struct macid_bmp *used_map = &macid_ctl->used; + //static u8 last_id = 0; /* for testing */ + u8 last_id = 0; + + if (_rtw_memcmp(psta->hwaddr, myid(&padapter->eeprompriv), ETH_ALEN)) { + psta->mac_id = macid_ctl->num; return; } - _enter_critical_bh(&pdvobj->lock, &irqL); - for(i=0; imacid[i] == _FALSE) - { - pdvobj->macid[i] = _TRUE; +#ifdef CONFIG_SHARED_BMC_MACID + if(_rtw_memcmp(psta->hwaddr, bc_addr, ETH_ALEN)) { + /* use shared broadcast & multicast macid 1 */ + _enter_critical_bh(&macid_ctl->lock, &irqL); + rtw_macid_map_set(used_map, 1); + rtw_macid_map_set(&macid_ctl->bmc, 1); + for (i=0;iif_g[padapter->iface_id], 1); + /* TODO ch_g? */ + _exit_critical_bh(&macid_ctl->lock, &irqL); + i = 1; + goto assigned; + } +#endif + + _enter_critical_bh(&macid_ctl->lock, &irqL); + + for (i=last_id;inum;i++) { + #ifdef CONFIG_SHARED_BMC_MACID + if (i == 1) + continue; + #endif + if (!rtw_macid_is_used(macid_ctl, i)) break; - } } - _exit_critical_bh(&pdvobj->lock, &irqL); - if( i > (NUM_STA-1)) - { - psta->mac_id = NUM_STA; - DBG_871X(" no room for more MACIDs\n"); + if (i < macid_ctl->num) { + + rtw_macid_map_set(used_map, i); + + if(_rtw_memcmp(psta->hwaddr, bc_addr, ETH_ALEN)) + rtw_macid_map_set(&macid_ctl->bmc, i); + + rtw_macid_map_set(&macid_ctl->if_g[padapter->iface_id], i); + + /* TODO ch_g? */ + + last_id++; + last_id %= macid_ctl->num; } - else - { - psta->mac_id = i; - DBG_871X("%s = %d\n", __FUNCTION__, psta->mac_id); + + _exit_critical_bh(&macid_ctl->lock, &irqL); + + if (i >= macid_ctl->num) { + psta->mac_id = macid_ctl->num; + DBG_871X_LEVEL(_drv_err_, FUNC_ADPT_FMT" if%u, hwaddr:"MAC_FMT" no available macid\n" + , FUNC_ADPT_ARG(padapter), padapter->iface_id+1, MAC_ARG(psta->hwaddr)); + rtw_warn_on(1); + goto exit; + } else { + goto assigned; } +assigned: + psta->mac_id = i; + DBG_871X(FUNC_ADPT_FMT" if%u, hwaddr:"MAC_FMT" macid:%u\n" + , FUNC_ADPT_ARG(padapter), padapter->iface_id+1, MAC_ARG(psta->hwaddr), psta->mac_id); + +exit: + return; } void rtw_release_macid(_adapter *padapter, struct sta_info *psta) { - int i; - _irqL irqL; + _irqL irqL; u8 bc_addr[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff}; - struct dvobj_priv *pdvobj = adapter_to_dvobj(padapter); + struct dvobj_priv *dvobj = adapter_to_dvobj(padapter); + struct macid_ctl_t *macid_ctl = dvobj_to_macidctl(dvobj); + if(_rtw_memcmp(psta->hwaddr, myid(&padapter->eeprompriv), ETH_ALEN)) + return; +#ifdef CONFIG_SHARED_BMC_MACID if(_rtw_memcmp(psta->hwaddr, bc_addr, ETH_ALEN)) return; - if(_rtw_memcmp(psta->hwaddr, myid(&padapter->eeprompriv), ETH_ALEN)) - { + if (psta->mac_id == 1) { + DBG_871X_LEVEL(_drv_err_, FUNC_ADPT_FMT" if%u, hwaddr:"MAC_FMT" with macid:%u\n" + , FUNC_ADPT_ARG(padapter), padapter->iface_id+1, MAC_ARG(psta->hwaddr), psta->mac_id); + rtw_warn_on(1); return; } +#endif - _enter_critical_bh(&pdvobj->lock, &irqL); - if(psta->mac_idmac_id !=1 ) - { - if(pdvobj->macid[psta->mac_id] == _TRUE) - { - DBG_871X("%s = %d\n", __FUNCTION__, psta->mac_id); - pdvobj->macid[psta->mac_id] = _FALSE; - psta->mac_id = NUM_STA; + _enter_critical_bh(&macid_ctl->lock, &irqL); + + if (psta->mac_id < macid_ctl->num) { + int i; + + if (!rtw_macid_is_used(macid_ctl, psta->mac_id)) { + DBG_871X_LEVEL(_drv_err_, FUNC_ADPT_FMT" if%u, hwaddr:"MAC_FMT" macid:%u not used\n" + , FUNC_ADPT_ARG(padapter), padapter->iface_id+1, MAC_ARG(psta->hwaddr), psta->mac_id); + rtw_warn_on(1); } + rtw_macid_map_clr(&macid_ctl->used, psta->mac_id); + rtw_macid_map_clr(&macid_ctl->bmc, psta->mac_id); + for (i=0;iif_g[i], psta->mac_id); + for (i=0;i<2;i++) + rtw_macid_map_clr(&macid_ctl->ch_g[i], psta->mac_id); } - _exit_critical_bh(&pdvobj->lock, &irqL); + _exit_critical_bh(&macid_ctl->lock, &irqL); + + psta->mac_id = macid_ctl->num; } + //For 8188E RA u8 rtw_search_max_mac_id(_adapter *padapter) { u8 max_mac_id=0; - struct dvobj_priv *pdvobj = adapter_to_dvobj(padapter); + struct dvobj_priv *dvobj = adapter_to_dvobj(padapter); + struct macid_ctl_t *macid_ctl = dvobj_to_macidctl(dvobj); int i; - _irqL irqL; - _enter_critical_bh(&pdvobj->lock, &irqL); - for(i=(NUM_STA-1); i>=0 ; i--) - { - if(pdvobj->macid[i] == _TRUE) - { + _irqL irqL; + + _enter_critical_bh(&macid_ctl->lock, &irqL); + for(i=(macid_ctl->num-1); i>0 ; i--) { + if (!rtw_macid_is_used(macid_ctl, i)) break; - } } + _exit_critical_bh(&macid_ctl->lock, &irqL); max_mac_id = i; - _exit_critical_bh(&pdvobj->lock, &irqL); return max_mac_id; - } +inline void rtw_macid_ctl_init(struct macid_ctl_t *macid_ctl) +{ + _rtw_spinlock_init(&macid_ctl->lock); +} + +inline void rtw_macid_ctl_deinit(struct macid_ctl_t *macid_ctl) +{ + _rtw_spinlock_free(&macid_ctl->lock); +} + #if 0 unsigned int setup_beacon_frame(_adapter *padapter, unsigned char *beacon_frame) { @@ -3033,6 +3825,51 @@ _adapter *dvobj_get_port0_adapter(struct dvobj_priv *dvobj) return port0_iface; } +/* + * Description: + * rtw_check_invalid_mac_address: + * This is only used for checking mac address valid or not. + * + * Input: + * adapter: mac_address pointer. + * + * Output: + * _TRUE: The mac address is invalid. + * _FALSE: The mac address is valid. + * + * Auther: Isaac.Li + */ +u8 rtw_check_invalid_mac_address(u8 *mac_addr) { + u8 null_mac_addr[ETH_ALEN] = {0, 0, 0, 0, 0, 0}; + u8 multi_mac_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; + u8 res = _FALSE; + + if (_rtw_memcmp(mac_addr, null_mac_addr, ETH_ALEN)) { + res = _TRUE; + goto func_exit; + } + + if (_rtw_memcmp(mac_addr, multi_mac_addr, ETH_ALEN)) { + res = _TRUE; + goto func_exit; + } + + if (mac_addr[0] & BIT0) { + res = _TRUE; + goto func_exit; + } + + if (mac_addr[0] & BIT1) { + res = _TRUE; + goto func_exit; + } + +func_exit: + return res; +} + + + #if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN) void rtw_get_current_ip_address(PADAPTER padapter, u8 *pcurrentip) { @@ -3097,27 +3934,25 @@ void rtw_set_sec_pn(PADAPTER padapter) if(psta) { - if (pwrpriv->wowlan_fw_iv > psta->dot11txpn.val) - { -#ifdef CONFIG_RTL8188E - /* TODO: update 8188E FW to remove this workaround.*/ - psta->dot11txpn.val += 4; - DBG_871X("%s: workaround only for 8188e, txpn +=4\n", __func__); -#else - if (psecpriv->dot11PrivacyAlgrthm != _NO_PRIVACY_) - psta->dot11txpn.val = pwrpriv->wowlan_fw_iv + 2; -#endif - } else { - DBG_871X("%s(): FW IV is smaller than driver\n", __func__); - psta->dot11txpn.val += 2; - } - DBG_871X("%s: dot11txpn: 0x%016llx\n", __func__ ,psta->dot11txpn.val); + if (pwrpriv->wowlan_fw_iv > psta->dot11txpn.val) + { + if (psecpriv->dot11PrivacyAlgrthm != _NO_PRIVACY_) + psta->dot11txpn.val = pwrpriv->wowlan_fw_iv + 2; + } else { + DBG_871X("%s(): FW IV is smaller than driver\n", __func__); + psta->dot11txpn.val += 2; + } + DBG_871X("%s: dot11txpn: 0x%016llx\n", __func__ ,psta->dot11txpn.val); } } #endif //CONFIG_WOWLAN #ifdef CONFIG_PNO_SUPPORT #define CSCAN_TLV_TYPE_SSID_IE 'S' +#define CIPHER_IE "key_mgmt=" +#define CIPHER_NONE "NONE" +#define CIPHER_WPA_PSK "WPA-PSK" +#define CIPHER_WPA_EAP "WPA-EAP IEEE8021X" /* * SSIDs list parsing from cscan tlv list */ @@ -3190,20 +4025,99 @@ int rtw_parse_ssid_list_tlv(char** list_str, pno_ssid_t* ssid, return idx; } +int rtw_parse_cipher_list(struct pno_nlo_info *nlo_info, char* list_str) { + + char *pch, *pnext, *pend; + u8 key_len = 0, index = 0; + + pch = list_str; + + if (nlo_info == NULL || list_str == NULL) { + DBG_871X("%s error paramters\n", __func__); + return -1; + } + + while (strlen(pch) != 0) { + pnext = strstr(pch, "key_mgmt="); + if (pnext != NULL) { + pch = pnext + strlen(CIPHER_IE); + pend = strstr(pch, "}"); + if (strncmp(pch, CIPHER_NONE, + strlen(CIPHER_NONE)) == 0) { + nlo_info->ssid_cipher_info[index] = 0x00; + } else if (strncmp(pch, CIPHER_WPA_PSK, + strlen(CIPHER_WPA_PSK)) == 0) { + nlo_info->ssid_cipher_info[index] = 0x66; + } else if (strncmp(pch, CIPHER_WPA_EAP, + strlen(CIPHER_WPA_EAP)) == 0) { + nlo_info->ssid_cipher_info[index] = 0x01; + } + index ++; + pch = pend + 1; + } else { + break; + } + } + return 0; +} + int rtw_dev_nlo_info_set(struct pno_nlo_info *nlo_info, pno_ssid_t* ssid, int num, int pno_time, int pno_repeat, int pno_freq_expo_max) { int i = 0; + struct file *fp; + mm_segment_t fs; + loff_t pos = 0; + u8 *source = NULL; + long len = 0; + + DBG_871X("+%s+\n", __func__); + nlo_info->fast_scan_period = pno_time; nlo_info->ssid_num = num & BIT_LEN_MASK_32(8); + nlo_info->hidden_ssid_num = num & BIT_LEN_MASK_32(8); nlo_info->slow_scan_period = (pno_time * 2); nlo_info->fast_scan_iterations = 5; - //TODO: chiper array, channel list and probe index is all empty. + if (nlo_info->hidden_ssid_num > 8) + nlo_info->hidden_ssid_num = 8; + + //TODO: channel list and probe index is all empty. for (i = 0 ; i < num ; i++) { nlo_info->ssid_length[i] = ssid[i].SSID_len; } + + /* cipher array */ + fp = filp_open("/data/misc/wifi/wpa_supplicant.conf", O_RDONLY, 0644); + if (IS_ERR(fp)) { + DBG_871X("Error, wpa_supplicant.conf doesn't exist.\n"); + DBG_871X("Error, cipher array using default value.\n"); + return 0; + } + + len = i_size_read(fp->f_path.dentry->d_inode); + if (len < 0 || len > 2048) { + DBG_871X("Error, file size is bigger than 2048.\n"); + DBG_871X("Error, cipher array using default value.\n"); + return 0; + } + + fs = get_fs(); + set_fs(KERNEL_DS); + + source = rtw_zmalloc(2048); + + if (source != NULL) { + len = vfs_read(fp, source, len, &pos); + rtw_parse_cipher_list(nlo_info, source); + rtw_mfree(source, 2048); + } + + set_fs(fs); + filp_close(fp, NULL); + + DBG_871X("-%s-\n", __func__); return 0; } @@ -3217,6 +4131,7 @@ int rtw_dev_ssid_list_set(struct pno_ssid_list *pno_ssid_list, for (i = 0 ; i < num ; i++) { _rtw_memcpy(&pno_ssid_list->node[i].SSID, ssid[i].SSID, ssid[i].SSID_len); + pno_ssid_list->node[i].SSID_len = ssid[i].SSID_len; } return 0; } @@ -3283,9 +4198,12 @@ int rtw_dev_pno_set(struct net_device *net, pno_ssid_t* ssid, int num, pwrctl->pscan_info == NULL || pwrctl->pno_ssid_list == NULL){ DBG_871X("%s, ERROR: alloc nlo_info, ssid_list, scan_info fail\n", __func__); - return -1; + goto failing; } + pwrctl->pno_in_resume = _FALSE; + + pwrctl->pno_inited = _TRUE; /* NLO Info */ ret = rtw_dev_nlo_info_set(pwrctl->pnlo_info, ssid, num, pno_time, pno_repeat, pno_freq_expo_max); @@ -3301,6 +4219,22 @@ int rtw_dev_pno_set(struct net_device *net, pno_ssid_t* ssid, int num, __func__, num, pno_time, pno_repeat, pno_freq_expo_max); return 0; + +failing: + if (pwrctl->pnlo_info) { + rtw_mfree((u8 *)pwrctl->pnlo_info, sizeof(pno_nlo_info_t)); + pwrctl->pnlo_info = NULL; + } + if (pwrctl->pno_ssid_list) { + rtw_mfree((u8 *)pwrctl->pno_ssid_list, sizeof(pno_ssid_list_t)); + pwrctl->pno_ssid_list = NULL; + } + if (pwrctl->pscan_info) { + rtw_mfree((u8 *)pwrctl->pscan_info, sizeof(pno_scan_info_t)); + pwrctl->pscan_info = NULL; + } + + return -1; } #ifdef CONFIG_PNO_SET_DEBUG @@ -3321,9 +4255,9 @@ void rtw_dev_pno_debug(struct net_device *net) { } DBG_871X("\n"); - DBG_871X("chiper_info: "); + DBG_871X("cipher_info: "); for (i = 0 ; i < MAX_PNO_LIST_COUNT ; i++) { - DBG_871X("%d, ", pwrctl->pnlo_info->ssid_chiper_info[i]); + DBG_871X("%d, ", pwrctl->pnlo_info->ssid_cipher_info[i]); } DBG_871X("\n"); diff --git a/backports/drivers/realtek/rtl8812au/core/rtw_xmit.c b/backports/drivers/realtek/rtl8812au/core/rtw_xmit.c index b0f1949c3aad58..6b1f03c519c420 100755 --- a/backports/drivers/realtek/rtl8812au/core/rtw_xmit.c +++ b/backports/drivers/realtek/rtl8812au/core/rtw_xmit.c @@ -68,9 +68,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, _adapter *padapter) struct xmit_buf *pxmitbuf; struct xmit_frame *pxframe; sint res=_SUCCESS; - u32 max_xmit_extbuf_size = MAX_XMIT_EXTBUF_SZ; - u32 num_xmit_extbuf = NR_XMIT_EXTBUFF; - + _func_enter_; // We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). @@ -201,7 +199,7 @@ _func_enter_; /* init xframe_ext queue, the same count as extbuf */ _rtw_init_queue(&pxmitpriv->free_xframe_ext_queue); - pxmitpriv->xframe_ext_alloc_addr = rtw_zvmalloc(num_xmit_extbuf * sizeof(struct xmit_frame) + 4); + pxmitpriv->xframe_ext_alloc_addr = rtw_zvmalloc(NR_XMIT_EXTBUFF * sizeof(struct xmit_frame) + 4); if (pxmitpriv->xframe_ext_alloc_addr == NULL){ pxmitpriv->xframe_ext = NULL; @@ -212,7 +210,7 @@ _func_enter_; pxmitpriv->xframe_ext = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitpriv->xframe_ext_alloc_addr), 4); pxframe = (struct xmit_frame*)pxmitpriv->xframe_ext; - for (i = 0; i < num_xmit_extbuf; i++) { + for (i = 0; i < NR_XMIT_EXTBUFF; i++) { _rtw_init_listhead(&(pxframe->list)); pxframe->padapter = padapter; @@ -229,12 +227,12 @@ _func_enter_; pxframe++; } - pxmitpriv->free_xframe_ext_cnt = num_xmit_extbuf; + pxmitpriv->free_xframe_ext_cnt = NR_XMIT_EXTBUFF; // Init xmit extension buff _rtw_init_queue(&pxmitpriv->free_xmit_extbuf_queue); - pxmitpriv->pallocated_xmit_extbuf = rtw_zvmalloc(num_xmit_extbuf * sizeof(struct xmit_buf) + 4); + pxmitpriv->pallocated_xmit_extbuf = rtw_zvmalloc(NR_XMIT_EXTBUFF * sizeof(struct xmit_buf) + 4); if (pxmitpriv->pallocated_xmit_extbuf == NULL){ RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("alloc xmit_extbuf fail!\n")); @@ -246,7 +244,7 @@ _func_enter_; pxmitbuf = (struct xmit_buf*)pxmitpriv->pxmit_extbuf; - for (i = 0; i < num_xmit_extbuf; i++) + for (i = 0; i < NR_XMIT_EXTBUFF; i++) { _rtw_init_listhead(&pxmitbuf->list); @@ -254,14 +252,14 @@ _func_enter_; pxmitbuf->padapter = padapter; pxmitbuf->buf_tag = XMITBUF_MGNT; - if((res=rtw_os_xmit_resource_alloc(padapter, pxmitbuf,max_xmit_extbuf_size + XMITBUF_ALIGN_SZ, _TRUE)) == _FAIL) { + if((res=rtw_os_xmit_resource_alloc(padapter, pxmitbuf,MAX_XMIT_EXTBUF_SZ + XMITBUF_ALIGN_SZ, _TRUE)) == _FAIL) { res= _FAIL; goto exit; } #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) pxmitbuf->phead = pxmitbuf->pbuf; - pxmitbuf->pend = pxmitbuf->pbuf + max_xmit_extbuf_size; + pxmitbuf->pend = pxmitbuf->pbuf + MAX_XMIT_EXTBUF_SZ; pxmitbuf->len = 0; pxmitbuf->pdata = pxmitbuf->ptail = pxmitbuf->phead; #endif @@ -274,29 +272,30 @@ _func_enter_; } - pxmitpriv->free_xmit_extbuf_cnt = num_xmit_extbuf; + pxmitpriv->free_xmit_extbuf_cnt = NR_XMIT_EXTBUFF; + for (i = 0; ipcmd_xmitbuf[i]; + if (pxmitbuf) { + _rtw_init_listhead(&pxmitbuf->list); - pxmitbuf = &pxmitpriv->pcmd_xmitbuf; - if (pxmitbuf) { - _rtw_init_listhead(&pxmitbuf->list); + pxmitbuf->priv_data = NULL; + pxmitbuf->padapter = padapter; + pxmitbuf->buf_tag = XMITBUF_CMD; - pxmitbuf->priv_data = NULL; - pxmitbuf->padapter = padapter; - pxmitbuf->buf_tag = XMITBUF_CMD; - - if((res=rtw_os_xmit_resource_alloc(padapter, pxmitbuf, MAX_CMDBUF_SZ+XMITBUF_ALIGN_SZ, _TRUE)) == _FAIL) { - res= _FAIL; - goto exit; - } + if((res=rtw_os_xmit_resource_alloc(padapter, pxmitbuf, MAX_CMDBUF_SZ+XMITBUF_ALIGN_SZ, _TRUE)) == _FAIL) { + res= _FAIL; + goto exit; + } #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) - pxmitbuf->phead = pxmitbuf->pbuf; - pxmitbuf->pend = pxmitbuf->pbuf + MAX_CMDBUF_SZ; - pxmitbuf->len = 0; - pxmitbuf->pdata = pxmitbuf->ptail = pxmitbuf->phead; + pxmitbuf->phead = pxmitbuf->pbuf; + pxmitbuf->pend = pxmitbuf->pbuf + MAX_CMDBUF_SZ; + pxmitbuf->len = 0; + pxmitbuf->pdata = pxmitbuf->ptail = pxmitbuf->phead; #endif - pxmitbuf->alloc_sz = MAX_CMDBUF_SZ+XMITBUF_ALIGN_SZ; + pxmitbuf->alloc_sz = MAX_CMDBUF_SZ+XMITBUF_ALIGN_SZ; + } } rtw_alloc_hwxmits(padapter); @@ -363,15 +362,7 @@ void _rtw_free_xmit_priv (struct xmit_priv *pxmitpriv) _adapter *padapter = pxmitpriv->adapter; struct xmit_frame *pxmitframe = (struct xmit_frame*) pxmitpriv->pxmit_frame_buf; struct xmit_buf *pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmitbuf; - u32 max_xmit_extbuf_size = MAX_XMIT_EXTBUF_SZ; - u32 num_xmit_extbuf = NR_XMIT_EXTBUFF; -#if defined(CONFIG_MP_INCLUDED) && (defined(CONFIG_RTL8723A) ||defined(CONFIG_RTL8723B)) - if (padapter->registrypriv.mp_mode) { - max_xmit_extbuf_size = 20000; - num_xmit_extbuf = 1; - } -#endif - + _func_enter_; rtw_hal_free_xmit_priv(padapter); @@ -406,33 +397,35 @@ void _rtw_free_xmit_priv (struct xmit_priv *pxmitpriv) /* free xframe_ext queue, the same count as extbuf */ if ((pxmitframe = (struct xmit_frame*)pxmitpriv->xframe_ext)) { - for (i=0; ixframe_ext_alloc_addr) - rtw_vmfree(pxmitpriv->xframe_ext_alloc_addr, num_xmit_extbuf * sizeof(struct xmit_frame) + 4); + rtw_vmfree(pxmitpriv->xframe_ext_alloc_addr, NR_XMIT_EXTBUFF * sizeof(struct xmit_frame) + 4); _rtw_spinlock_free(&pxmitpriv->free_xframe_ext_queue.lock); // free xmit extension buff _rtw_spinlock_free(&pxmitpriv->free_xmit_extbuf_queue.lock); pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmit_extbuf; - for(i=0; ipallocated_xmit_extbuf) { - rtw_vmfree(pxmitpriv->pallocated_xmit_extbuf, num_xmit_extbuf * sizeof(struct xmit_buf) + 4); + rtw_vmfree(pxmitpriv->pallocated_xmit_extbuf, NR_XMIT_EXTBUFF * sizeof(struct xmit_buf) + 4); } - pxmitbuf = &pxmitpriv->pcmd_xmitbuf; - if(pxmitbuf!=NULL) - rtw_os_xmit_resource_free(padapter, pxmitbuf, MAX_CMDBUF_SZ+XMITBUF_ALIGN_SZ , _TRUE); + for (i=0; ipcmd_xmitbuf[i]; + if(pxmitbuf!=NULL) + rtw_os_xmit_resource_free(padapter, pxmitbuf, MAX_CMDBUF_SZ+XMITBUF_ALIGN_SZ , _TRUE); + } rtw_free_hwxmits(padapter); @@ -455,7 +448,6 @@ u8 query_ra_short_GI(struct sta_info *psta) if (psta->vhtpriv.vht_option) { sgi_80m= psta->vhtpriv.sgi_80m; } - else #endif //CONFIG_80211AC_VHT { sgi_20m = psta->htpriv.sgi_20m; @@ -612,40 +604,53 @@ static void update_attrib_vcs_info(_adapter *padapter, struct xmit_frame *pxmitf break; } } + + //for debug : force driver control vrtl_carrier_sense. + if(padapter->driver_vcs_en==1) + { + //u8 driver_vcs_en; //Enable=1, Disable=0 driver control vrtl_carrier_sense. + //u8 driver_vcs_type;//force 0:disable VCS, 1:RTS-CTS, 2:CTS-to-self when vcs_en=1. + pattrib->vcs_mode = padapter->driver_vcs_type; + } + } -static void update_attrib_phy_info(struct pkt_attrib *pattrib, struct sta_info *psta) +static void update_attrib_phy_info(_adapter *padapter, struct pkt_attrib *pattrib, struct sta_info *psta) { + struct mlme_ext_priv *mlmeext = &padapter->mlmeextpriv; + pattrib->rtsen = psta->rtsen; pattrib->cts2self = psta->cts2self; pattrib->mdata = 0; pattrib->eosp = 0; pattrib->triggered=0; + pattrib->ampdu_spacing = 0; //qos_en, ht_en, init rate, ,bw, ch_offset, sgi pattrib->qos_en = psta->qos_option; pattrib->raid = psta->raid; - pattrib->bwmode = psta->bw_mode; + if (mlmeext->cur_bwmode < psta->bw_mode) + pattrib->bwmode = mlmeext->cur_bwmode; + else + pattrib->bwmode = psta->bw_mode; pattrib->sgi = query_ra_short_GI(psta); -#ifdef CONFIG_80211N_HT -#ifdef CONFIG_80211AC_VHT - if (psta->vhtpriv.vht_option) { - if(TEST_FLAG(psta->vhtpriv.ldpc_cap, LDPC_VHT_ENABLE_TX)) - pattrib->ldpc = 1; - - if(TEST_FLAG(psta->vhtpriv.stbc_cap, STBC_VHT_ENABLE_TX)) - pattrib->stbc = 1; - } -#endif //CONFIG_80211AC_VHT + pattrib->ldpc = psta->ldpc; + pattrib->stbc = psta->stbc; +#ifdef CONFIG_80211N_HT pattrib->ht_en = psta->htpriv.ht_option; pattrib->ch_offset = psta->htpriv.ch_offset; pattrib->ampdu_en = _FALSE; + + if(padapter->driver_ampdu_spacing != 0xFF) //driver control AMPDU Density for peer sta's rx + pattrib->ampdu_spacing = padapter->driver_ampdu_spacing; + else + pattrib->ampdu_spacing = psta->htpriv.rx_ampdu_min_spacing; #endif //CONFIG_80211N_HT //if(pattrib->ht_en && psta->htpriv.ampdu_enable) //{ @@ -653,6 +658,19 @@ static void update_attrib_phy_info(struct pkt_attrib *pattrib, struct sta_info * // pattrib->ampdu_en = _TRUE; //} +#ifdef CONFIG_TDLS + if (pattrib->direct_link==_TRUE) { + psta = pattrib->ptdls_sta; + + pattrib->raid = psta->raid; +#ifdef CONFIG_80211N_HT + pattrib->bwmode = psta->bw_mode; + pattrib->ht_en = psta->htpriv.ht_option; + pattrib->ch_offset = psta->htpriv.ch_offset; + pattrib->sgi= query_ra_short_GI(psta); +#endif /* CONFIG_80211N_HT */ + } +#endif /* CONFIG_TDLS */ pattrib->retry_ctrl = _FALSE; @@ -799,7 +817,7 @@ static s32 update_attrib_sec_info(_adapter *padapter, struct pkt_attrib *pattrib RT_TRACE(_module_rtl871x_xmit_c_,_drv_info_,("update_attrib: bswenc=_FALSE\n")); } -#ifdef CONFIG_CONCURRENT_MODE +#if defined(CONFIG_CONCURRENT_MODE) && !defined(DYNAMIC_CAMID_ALLOC) if((pattrib->encrypt && bmcast) || (pattrib->encrypt ==_WEP40_) || (pattrib->encrypt ==_WEP104_)) { pattrib->bswenc = _TRUE;//force using sw enc. @@ -891,20 +909,37 @@ static void set_qos(struct pkt_file *ppktfile, struct pkt_attrib *pattrib) } #ifdef CONFIG_TDLS -void rtw_check_tdls_established(_adapter *padapter, struct pkt_attrib *pattrib) +u8 rtw_check_tdls_established(_adapter *padapter, struct pkt_attrib *pattrib) { pattrib->ptdls_sta = NULL; pattrib->direct_link = _FALSE; - if((padapter->tdlsinfo.link_established == _TRUE)){ + if (padapter->tdlsinfo.link_established == _TRUE) { pattrib->ptdls_sta = rtw_get_stainfo(&padapter->stapriv, pattrib->dst); +#if 1 if((pattrib->ptdls_sta!=NULL)&& (pattrib->ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE)&& (pattrib->ether_type!=0x0806)){ pattrib->direct_link = _TRUE; //DBG_871X("send ptk to "MAC_FMT" using direct link\n", MAC_ARG(pattrib->dst)); } +#else + if (pattrib->ptdls_sta != NULL && + pattrib->ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE) { + pattrib->direct_link = _TRUE; + #if 0 + DBG_871X("send ptk to "MAC_FMT" using direct link\n", MAC_ARG(pattrib->dst)); + #endif + } + + /* ARP frame may be helped by AP*/ + if (pattrib->ether_type != 0x0806) { + pattrib->direct_link = _FALSE; + } +#endif } + + return pattrib->direct_link; } s32 update_tdls_attrib(_adapter *padapter, struct pkt_attrib *pattrib) @@ -928,7 +963,7 @@ s32 update_tdls_attrib(_adapter *padapter, struct pkt_attrib *pattrib) pattrib->psta = psta; pattrib->ack_policy = 0; // get ether_hdr_len - pattrib->pkt_hdrlen = ETH_HLEN;//(pattrib->ether_type == 0x8100) ? (14 + 4 ): 14; //vlan tag + pattrib->pkt_hdrlen = ETH_HLEN; // [TDLS] TODO: setup req/rsp should be AC_BK if (pqospriv->qos_option && psta->qos_option) { @@ -948,7 +983,7 @@ s32 update_tdls_attrib(_adapter *padapter, struct pkt_attrib *pattrib) goto exit; } - update_attrib_phy_info(pattrib, psta); + update_attrib_phy_info(padapter, pattrib, psta); exit: @@ -958,6 +993,18 @@ s32 update_tdls_attrib(_adapter *padapter, struct pkt_attrib *pattrib) #endif //CONFIG_TDLS +//get non-qos hw_ssn control register,mapping to REG_HW_SEQ0,1,2,3 +inline u8 rtw_get_hwseq_no(_adapter *padapter) +{ + u8 hwseq_num = 0; +#ifdef CONFIG_CONCURRENT_MODE + if(padapter->adapter_type == SECONDARY_ADAPTER) + hwseq_num = 1; + //else + // hwseq_num = 2; +#endif //CONFIG_CONCURRENT_MODE + return hwseq_num; +} static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattrib) { uint i; @@ -968,12 +1015,15 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr sint bmcast; struct sta_priv *pstapriv = &padapter->stapriv; struct security_priv *psecuritypriv = &padapter->securitypriv; - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct qos_priv *pqospriv= &pmlmepriv->qospriv; + struct xmit_priv *pxmitpriv = &padapter->xmitpriv; sint res = _SUCCESS; _func_enter_; + DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib); + _rtw_open_pktfile(pkt, &pktfile); i = _rtw_pktfile_read(&pktfile, (u8*)ðerhdr, ETH_HLEN); @@ -987,21 +1037,28 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == _TRUE) || (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE)) { _rtw_memcpy(pattrib->ra, pattrib->dst, ETH_ALEN); - _rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN); + _rtw_memcpy(pattrib->ta, myid(&padapter->eeprompriv), ETH_ALEN); + DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_adhoc); } else if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) { +#ifdef CONFIG_TDLS + if (rtw_check_tdls_established(padapter, pattrib) == _TRUE) + _rtw_memcpy(pattrib->ra, pattrib->dst, ETH_ALEN); /* For TDLS direct link Tx, set ra to be same to dst */ + else +#endif _rtw_memcpy(pattrib->ra, get_bssid(pmlmepriv), ETH_ALEN); - _rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN); + _rtw_memcpy(pattrib->ta, myid(&padapter->eeprompriv), ETH_ALEN); + DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_sta); } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { _rtw_memcpy(pattrib->ra, pattrib->dst, ETH_ALEN); _rtw_memcpy(pattrib->ta, get_bssid(pmlmepriv), ETH_ALEN); + DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_ap); + } + else { + DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_unknown); } -#ifdef CONFIG_TDLS - rtw_check_tdls_established(padapter, pattrib); -#endif //CONFIG_TDLS - pattrib->pktlen = pktfile.pkt_len; if (ETH_P_IP == pattrib->ether_type) @@ -1031,6 +1088,7 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr // pTcb->DataRate = Adapter->MgntInfo.LowestBasicRate; //RTPRINT(FDM, WA_IOT, ("DHCP TranslateHeader(), pTcb->DataRate = 0x%x\n", pTcb->DataRate)); pattrib->dhcp_pkt = 1; + DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_dhcp); } } } @@ -1041,7 +1099,10 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr pattrib->icmp_pkt = 0; if(piphdr->protocol == 0x1) // protocol type in ip header 0x1 is ICMP + { pattrib->icmp_pkt = 1; + DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_icmp); + } } @@ -1071,6 +1132,7 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr #endif #endif { + DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_active); rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_SPECIAL_PACKET, 1); } #endif //CONFIG_LPS @@ -1082,7 +1144,8 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr psta = rtw_get_bcmc_stainfo(padapter); } else { psta = rtw_get_stainfo(pstapriv, pattrib->ra); - if (psta == NULL) { // if we cannot get psta => drrp the pkt + if (psta == NULL) { // if we cannot get psta => drop the pkt + DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_err_ucast_sta); RT_TRACE(_module_rtl871x_xmit_c_, _drv_alert_, ("\nupdate_attrib => get sta_info fail, ra:" MAC_FMT"\n", MAC_ARG(pattrib->ra))); #ifdef DBG_TX_DROP_FRAME DBG_871X("DBG_TX_DROP_FRAME %s get sta_info fail, ra:" MAC_FMT"\n", __FUNCTION__, MAC_ARG(pattrib->ra)); @@ -1092,6 +1155,7 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr } else if((check_fwstate(pmlmepriv, WIFI_AP_STATE)==_TRUE)&&(!(psta->state & _FW_LINKED))) { + DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_err_ucast_ap_link); res =_FAIL; goto exit; } @@ -1099,6 +1163,7 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr if(psta == NULL) { // if we cannot get psta => drop the pkt + DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_err_sta); RT_TRACE(_module_rtl871x_xmit_c_, _drv_alert_, ("\nupdate_attrib => get sta_info fail, ra:" MAC_FMT "\n", MAC_ARG(pattrib->ra))); #ifdef DBG_TX_DROP_FRAME DBG_871X("DBG_TX_DROP_FRAME %s get sta_info fail, ra:" MAC_FMT"\n", __FUNCTION__, MAC_ARG(pattrib->ra)); @@ -1109,6 +1174,7 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr if(!(psta->state &_FW_LINKED)) { + DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_err_link); DBG_871X("%s, psta("MAC_FMT")->state(0x%x) != _FW_LINKED\n", __func__, MAC_ARG(psta->hwaddr), psta->state); return _FAIL; } @@ -1118,11 +1184,12 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr //TODO:_lock if(update_attrib_sec_info(padapter, pattrib, psta) == _FAIL) { + DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_err_sec); res = _FAIL; goto exit; } - update_attrib_phy_info(pattrib, psta); + update_attrib_phy_info(padapter, pattrib, psta); //DBG_8192C("%s ==> mac_id(%d)\n",__FUNCTION__,pattrib->mac_id ); @@ -1158,7 +1225,7 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr } //pattrib->priority = 5; //force to used VI queue, for testing - + pattrib->hw_ssn_sel = pxmitpriv->hw_ssn_seq_no; rtw_set_tx_chksum_offload(pkt, pattrib); exit: @@ -1369,11 +1436,6 @@ s32 rtw_make_wlanhdr (_adapter *padapter , u8 *hdr, struct pkt_attrib *pattrib) struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct qos_priv *pqospriv = &pmlmepriv->qospriv; u8 qos_option = _FALSE; -#ifdef CONFIG_TDLS - struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; - struct sta_priv *pstapriv = &padapter->stapriv; -#endif //CONFIG_TDLS - sint res = _SUCCESS; u16 *fctrl = &pwlanhdr->frame_ctl; @@ -1411,8 +1473,6 @@ _func_enter_; if (pattrib->subtype & WIFI_DATA_TYPE) { if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == _TRUE)) { - //to_ds = 1, fr_ds = 0; - #ifdef CONFIG_TDLS if(pattrib->direct_link == _TRUE){ //TDLS data transfer, ToDS=0, FrDs=0 @@ -1423,11 +1483,12 @@ _func_enter_; else #endif //CONFIG_TDLS { + //to_ds = 1, fr_ds = 0; // 1.Data transfer to AP // 2.Arp pkt will relayed by AP SetToDs(fctrl); _rtw_memcpy(pwlanhdr->addr1, get_bssid(pmlmepriv), ETH_ALEN); - _rtw_memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN); + _rtw_memcpy(pwlanhdr->addr2, pattrib->ta, ETH_ALEN); _rtw_memcpy(pwlanhdr->addr3, pattrib->dst, ETH_ALEN); } @@ -1448,7 +1509,7 @@ _func_enter_; else if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == _TRUE) || (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE)) { _rtw_memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN); - _rtw_memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN); + _rtw_memcpy(pwlanhdr->addr2, pattrib->ta, ETH_ALEN); _rtw_memcpy(pwlanhdr->addr3, get_bssid(pmlmepriv), ETH_ALEN); if(pattrib->qos_en) @@ -1505,25 +1566,6 @@ _func_enter_; if(psta) { -#ifdef CONFIG_TDLS - if(pattrib->direct_link==_TRUE) - { - psta = pattrib->ptdls_sta; - - //qos_en, ht_en, init rate, ,bw, ch_offset, sgi - //pattrib->qos_en = ptdls_sta->qos_option; - - pattrib->raid = psta->raid; -#ifdef CONFIG_80211N_HT - pattrib->bwmode = psta->bw_mode; - pattrib->ht_en = psta->htpriv.ht_option; - pattrib->ch_offset = psta->htpriv.ch_offset; - pattrib->sgi= query_ra_short_GI(psta); -#endif //CONFIG_80211N_HT - } -#endif //CONFIG_TDLS - - psta->sta_xmitpriv.txseq_tid[pattrib->priority]++; psta->sta_xmitpriv.txseq_tid[pattrib->priority] &= 0xFFF; pattrib->seqnum = psta->sta_xmitpriv.txseq_tid[pattrib->priority]; @@ -1675,16 +1717,18 @@ int rtw_build_tdls_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 * rtw_build_tdls_dis_req_ies(padapter, pxmitframe, pframe, ptxmgmt); break; case TDLS_PEER_TRAFFIC_INDICATION: - rtw_build_tdls_peer_traffic_indication_ies(padapter, pxmitframe, pframe); + rtw_build_tdls_peer_traffic_indication_ies(padapter, pxmitframe, pframe, ptxmgmt); break; +#ifdef CONFIG_TDLS_CH_SW case TDLS_CHANNEL_SWITCH_REQUEST: - rtw_build_tdls_ch_switch_req_ies(padapter, pxmitframe, pframe); + rtw_build_tdls_ch_switch_req_ies(padapter, pxmitframe, pframe, ptxmgmt); break; case TDLS_CHANNEL_SWITCH_RESPONSE: - rtw_build_tdls_ch_switch_rsp_ies(padapter, pxmitframe, pframe); + rtw_build_tdls_ch_switch_rsp_ies(padapter, pxmitframe, pframe, ptxmgmt); break; +#endif case TDLS_PEER_TRAFFIC_RESPONSE: - rtw_build_tdls_peer_traffic_rsp_ies(padapter, pxmitframe, pframe); + rtw_build_tdls_peer_traffic_rsp_ies(padapter, pxmitframe, pframe, ptxmgmt); break; #ifdef CONFIG_WFD case TUNNELED_PROBE_REQ: @@ -1726,7 +1770,7 @@ _func_enter_; case TDLS_SETUP_RESPONSE: case TDLS_SETUP_CONFIRM: case TDLS_PEER_TRAFFIC_INDICATION: - case TDLS_PEER_PSM_REQUEST: //directly to peer STA or via AP + case TDLS_PEER_PSM_REQUEST: case TUNNELED_PROBE_REQ: case TUNNELED_PROBE_RSP: case TDLS_DISCOVERY_REQUEST: @@ -1842,11 +1886,15 @@ _func_enter_; } } - if(psta==NULL) - return _FAIL; + if (psta==NULL) { + res = _FAIL; + goto exit; + } - if (pxmitframe->buf_addr == NULL) - return _FAIL; + if (pxmitframe->buf_addr == NULL) { + res = _FAIL; + goto exit; + } pbuf_start = pxmitframe->buf_addr; mem_start = pbuf_start + TXDESC_OFFSET; @@ -1910,6 +1958,7 @@ _func_enter_; if (xmitframe_addmic(padapter, pxmitframe) == _FAIL) { + res = _FAIL; goto exit; } @@ -2220,7 +2269,7 @@ _func_enter_; int frame_body_len; u8 mic[16]; - _rtw_memset(MME, 0, 18); + _rtw_memset(MME, 0, _MME_IE_LENGTH_); //other types doesn't need the BIP if(GetFrameSubType(pframe) != WIFI_DEAUTH && GetFrameSubType(pframe) != WIFI_DISASSOC) @@ -2532,13 +2581,14 @@ void rtw_count_tx_stats(PADAPTER padapter, struct xmit_frame *pxmitframe, int sz } } -struct xmit_buf *rtw_alloc_cmd_xmitbuf(struct xmit_priv *pxmitpriv) +static struct xmit_buf *__rtw_alloc_cmd_xmitbuf(struct xmit_priv *pxmitpriv, + enum cmdbuf_type buf_type) { struct xmit_buf *pxmitbuf = NULL; _func_enter_; - pxmitbuf = &pxmitpriv->pcmd_xmitbuf; + pxmitbuf = &pxmitpriv->pcmd_xmitbuf[buf_type]; if (pxmitbuf != NULL) { pxmitbuf->priv_data = NULL; @@ -2550,6 +2600,7 @@ _func_enter_; #endif #ifdef CONFIG_PCI_HCI pxmitbuf->len = 0; + pxmitbuf->desc = NULL; #endif if (pxmitbuf->sctx) { @@ -2567,27 +2618,8 @@ _func_exit_; return pxmitbuf; } -s32 rtw_free_cmd_xmitbuf(struct xmit_priv *pxmitpriv) -{ - struct xmit_buf *pxmitbuf = NULL; - -_func_enter_; - - pxmitbuf = &pxmitpriv->pcmd_xmitbuf; - if (pxmitbuf==NULL) { - DBG_871X("%s fail, no xmitbuf available !!!\n", __func__); - return _FAIL; - } else { - rtw_os_xmit_resource_free(pxmitbuf->padapter, pxmitbuf, pxmitbuf->alloc_sz, _FALSE); - pxmitbuf->pallocated_buf = NULL; - } - -_func_exit_; - - return _SUCCESS; -} - -struct xmit_frame *rtw_alloc_cmdxmitframe(struct xmit_priv *pxmitpriv) +struct xmit_frame *__rtw_alloc_cmdxmitframe(struct xmit_priv *pxmitpriv, + enum cmdbuf_type buf_type) { struct xmit_frame *pcmdframe; struct xmit_buf *pxmitbuf; @@ -2598,7 +2630,7 @@ struct xmit_frame *rtw_alloc_cmdxmitframe(struct xmit_priv *pxmitpriv) return NULL; } - if ((pxmitbuf = rtw_alloc_cmd_xmitbuf(pxmitpriv)) == NULL) { + if ((pxmitbuf = __rtw_alloc_cmd_xmitbuf(pxmitpriv, buf_type)) == NULL) { DBG_871X("%s, alloc xmitbuf fail\n", __FUNCTION__); rtw_free_xmitframe(pxmitpriv, pcmdframe); return NULL; @@ -2653,9 +2685,11 @@ _func_enter_; #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) pxmitbuf->len = 0; pxmitbuf->pdata = pxmitbuf->ptail = pxmitbuf->phead; + pxmitbuf->agg_num = 1; #endif #ifdef CONFIG_PCI_HCI pxmitbuf->len = 0; + pxmitbuf->desc = NULL; #endif if (pxmitbuf->sctx) { @@ -2745,6 +2779,7 @@ _func_enter_; #endif #ifdef CONFIG_PCI_HCI pxmitbuf->len = 0; + pxmitbuf->desc = NULL; #endif if (pxmitbuf->sctx) { @@ -2993,7 +3028,7 @@ _func_enter_; else if(pxmitframe->ext_tag == 1) queue = &pxmitpriv->free_xframe_ext_queue; else - {} + rtw_warn_on(1); _enter_critical_bh(&queue->lock, &irqL); @@ -3052,6 +3087,7 @@ _func_exit_; s32 rtw_xmitframe_enqueue(_adapter *padapter, struct xmit_frame *pxmitframe) { + DBG_COUNTER(padapter->tx_logs.core_tx_enqueue); if (rtw_xmit_classifier(padapter, pxmitframe) == _FAIL) { RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, @@ -3075,7 +3111,7 @@ static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv, str { pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list); - xmitframe_plist = get_next(xmitframe_plist); + /* xmitframe_plist = get_next(xmitframe_plist); */ /*#ifdef RTK_DMP_PLATFORM #ifdef CONFIG_USB_TX_AGGREGATION @@ -3099,7 +3135,7 @@ static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv, str break; - pxmitframe = NULL; + //pxmitframe = NULL; } @@ -3137,7 +3173,7 @@ _func_enter_; } #endif -#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) +#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_PCI_HCI) for(j=0; j<4; j++) inx[j] = pxmitpriv->wmm_para_seq[j]; #endif @@ -3318,6 +3354,8 @@ s32 rtw_xmit_classifier(_adapter *padapter, struct xmit_frame *pxmitframe) _func_enter_; + DBG_COUNTER(padapter->tx_logs.core_tx_enqueue_class); + /* if (pattrib->psta) { psta = pattrib->psta; @@ -3330,11 +3368,13 @@ _func_enter_; psta = rtw_get_stainfo(&padapter->stapriv, pattrib->ra); if(pattrib->psta != psta) { + DBG_COUNTER(padapter->tx_logs.core_tx_enqueue_class_err_sta); DBG_871X("%s, pattrib->psta(%p) != psta(%p)\n", __func__, pattrib->psta, psta); return _FAIL; } if (psta == NULL) { + DBG_COUNTER(padapter->tx_logs.core_tx_enqueue_class_err_nosta); res = _FAIL; DBG_8192C("rtw_xmit_classifier: psta == NULL\n"); RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("rtw_xmit_classifier: psta == NULL\n")); @@ -3343,6 +3383,7 @@ _func_enter_; if(!(psta->state &_FW_LINKED)) { + DBG_COUNTER(padapter->tx_logs.core_tx_enqueue_class_err_fwlink); DBG_871X("%s, psta->state(0x%x) != _FW_LINKED\n", __func__, psta->state); return _FAIL; } @@ -3379,7 +3420,15 @@ void rtw_alloc_hwxmits(_adapter *padapter) pxmitpriv->hwxmit_entry = HWXMIT_ENTRY; + pxmitpriv->hwxmits = NULL; + pxmitpriv->hwxmits = (struct hw_xmit *)rtw_zmalloc(sizeof (struct hw_xmit) * pxmitpriv->hwxmit_entry); + + if(pxmitpriv->hwxmits == NULL) + { + DBG_871X("alloc hwxmits fail!...\n"); + return; + } hwxmits = pxmitpriv->hwxmits; @@ -3720,6 +3769,8 @@ s32 rtw_xmit(_adapter *padapter, _pkt **ppkt) s32 res; + DBG_COUNTER(padapter->tx_logs.core_tx); + if (start == 0) start = rtw_get_current_time(); @@ -3735,6 +3786,7 @@ s32 rtw_xmit(_adapter *padapter, _pkt **ppkt) if (pxmitframe == NULL) { drop_cnt ++; RT_TRACE(_module_xmit_osdep_c_, _drv_err_, ("rtw_xmit: no more pxmitframe\n")); + DBG_COUNTER(padapter->tx_logs.core_tx_err_pxmitframe); return -1; } @@ -3754,6 +3806,7 @@ s32 rtw_xmit(_adapter *padapter, _pkt **ppkt) if (res == -1) { rtw_free_xmitframe(pxmitpriv, pxmitframe); + DBG_COUNTER(padapter->tx_logs.core_tx_err_brtx); return -1; } } @@ -3791,11 +3844,13 @@ s32 rtw_xmit(_adapter *padapter, _pkt **ppkt) if(xmitframe_enqueue_for_sleeping_sta(padapter, pxmitframe) == _TRUE) { _exit_critical_bh(&pxmitpriv->lock, &irqL0); + DBG_COUNTER(padapter->tx_logs.core_tx_ap_enqueue); return 1; } _exit_critical_bh(&pxmitpriv->lock, &irqL0); #endif + //pre_xmitframe if (rtw_hal_xmit(padapter, pxmitframe) == _FALSE) return 1; @@ -3860,13 +3915,11 @@ sint xmitframe_enqueue_for_tdls_sleeping_sta(_adapter *padapter, struct xmit_fra break; } + /* Transmit TDLS PTI via AP */ if(ptdls_sta->sleepq_len==1) - { - //transmit TDLS PTI via AP - rtw_tdls_cmd(padapter, ptdls_sta->hwaddr, TDLS_SD_PTI); - } - ret = _TRUE; + rtw_tdls_cmd(padapter, ptdls_sta->hwaddr, TDLS_ISSUE_PTI); + ret = _TRUE; } _exit_critical_bh(&ptdls_sta->sleep_q.lock, &irqL); @@ -3877,6 +3930,47 @@ sint xmitframe_enqueue_for_tdls_sleeping_sta(_adapter *padapter, struct xmit_fra } #endif //CONFIG_TDLS +#define RTW_HIQ_FILTER_ALLOW_ALL 0 +#define RTW_HIQ_FILTER_ALLOW_SPECIAL 1 +#define RTW_HIQ_FILTER_DENY_ALL 2 + +inline bool xmitframe_hiq_filter(struct xmit_frame *xmitframe) +{ + bool allow = _FALSE; + _adapter *adapter = xmitframe->padapter; + struct registry_priv *registry = &adapter->registrypriv; + +if (adapter->interface_type != RTW_PCIE) { + + if (registry->hiq_filter == RTW_HIQ_FILTER_ALLOW_SPECIAL) { + + struct pkt_attrib *attrib = &xmitframe->attrib; + + if (attrib->ether_type == 0x0806 + || attrib->ether_type == 0x888e + #ifdef CONFIG_WAPI_SUPPORT + || attrib->ether_type == 0x88B4 + #endif + || attrib->dhcp_pkt + ) { + if (0) + DBG_871X(FUNC_ADPT_FMT" ether_type:0x%04x%s\n", FUNC_ADPT_ARG(xmitframe->padapter) + , attrib->ether_type, attrib->dhcp_pkt?" DHCP":""); + allow = _TRUE; + } + } + else if (registry->hiq_filter == RTW_HIQ_FILTER_ALLOW_ALL) { + allow = _TRUE; + } + else if (registry->hiq_filter == RTW_HIQ_FILTER_DENY_ALL) { + } + else { + rtw_warn_on(1); + } +} + return allow; +} + #if defined(CONFIG_AP_MODE) || defined(CONFIG_TDLS) sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *pxmitframe) @@ -3888,6 +3982,7 @@ sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *p struct pkt_attrib *pattrib = &pxmitframe->attrib; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; sint bmcst = IS_MCAST(pattrib->ra); + bool update_tim = _FALSE; #ifdef CONFIG_TDLS if( padapter->tdlsinfo.link_established == _TRUE ) @@ -3897,7 +3992,10 @@ sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *p #endif //CONFIG_TDLS if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == _FALSE) + { + DBG_COUNTER(padapter->tx_logs.core_tx_ap_enqueue_warn_fwstate); return ret; + } /* if(pattrib->psta) { @@ -3912,31 +4010,33 @@ sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *p psta = rtw_get_stainfo(&padapter->stapriv, pattrib->ra); if(pattrib->psta != psta) { + DBG_COUNTER(padapter->tx_logs.core_tx_ap_enqueue_warn_sta); DBG_871X("%s, pattrib->psta(%p) != psta(%p)\n", __func__, pattrib->psta, psta); return _FALSE; } if(psta==NULL) { + DBG_COUNTER(padapter->tx_logs.core_tx_ap_enqueue_warn_nosta); DBG_871X("%s, psta==NUL\n", __func__); return _FALSE; } if(!(psta->state &_FW_LINKED)) { + DBG_COUNTER(padapter->tx_logs.core_tx_ap_enqueue_warn_link); DBG_871X("%s, psta->state(0x%x) != _FW_LINKED\n", __func__, psta->state); return _FALSE; } if(pattrib->triggered==1) { + DBG_COUNTER(padapter->tx_logs.core_tx_ap_enqueue_warn_trigger); //DBG_871X("directly xmit pspoll_triggered packet\n"); //pattrib->triggered=0; - - if(bmcst) - pattrib->qsel = 0x11;//HIQ - + if (bmcst && xmitframe_hiq_filter(pxmitframe) == _TRUE) + pattrib->qsel = QSLT_HIGH;//HIQ return ret; } @@ -3948,7 +4048,7 @@ sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *p if(pstapriv->sta_dz_bitmap)//if anyone sta is in ps mode { - //pattrib->qsel = 0x11;//HIQ + //pattrib->qsel = QSLT_HIGH;//HIQ rtw_list_delete(&pxmitframe->list); @@ -3958,16 +4058,28 @@ sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *p psta->sleepq_len++; + if (!(pstapriv->tim_bitmap & BIT(0))) + update_tim = _TRUE; + pstapriv->tim_bitmap |= BIT(0);// pstapriv->sta_dz_bitmap |= BIT(0); - + //DBG_871X("enqueue, sq_len=%d, tim=%x\n", psta->sleepq_len, pstapriv->tim_bitmap); - update_beacon(padapter, _TIM_IE_, NULL, _TRUE);//tx bc/mc packets after upate bcn - + if (update_tim == _TRUE) { + if (is_broadcast_mac_addr(pattrib->ra)) + _update_beacon(padapter, _TIM_IE_, NULL, _TRUE, "buffer BC"); + else + _update_beacon(padapter, _TIM_IE_, NULL, _TRUE, "buffer MC"); + } else { + chk_bmc_sleepq_cmd(padapter); + } + //_exit_critical_bh(&psta->sleep_q.lock, &irqL); ret = _TRUE; + + DBG_COUNTER(padapter->tx_logs.core_tx_ap_enqueue_mcast); } @@ -4020,15 +4132,18 @@ sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *p if(((psta->has_legacy_ac) && (!wmmps_ac)) ||((!psta->has_legacy_ac)&&(wmmps_ac))) { + if (!(pstapriv->tim_bitmap & BIT(psta->aid))) + update_tim = _TRUE; + pstapriv->tim_bitmap |= BIT(psta->aid); //DBG_871X("enqueue, sq_len=%d, tim=%x\n", psta->sleepq_len, pstapriv->tim_bitmap); - if(psta->sleepq_len==1) + if(update_tim == _TRUE) { //DBG_871X("sleepq_len==1, update BCNTIM\n"); //upate BCN for TIM IE - update_beacon(padapter, _TIM_IE_, NULL, _TRUE); + _update_beacon(padapter, _TIM_IE_, NULL, _TRUE, "buffer UC"); } } @@ -4041,6 +4156,7 @@ sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *p ret = _TRUE; + DBG_COUNTER(padapter->tx_logs.core_tx_ap_enqueue_ucast); } } @@ -4068,14 +4184,16 @@ static void dequeue_xmitframes_to_sleeping_queue(_adapter *padapter, struct sta_ { pxmitframe = LIST_CONTAINOR(plist, struct xmit_frame, list); - plist = get_next(plist); + plist = get_next(plist); + pattrib = &pxmitframe->attrib; + + pattrib->triggered = 0; + ret = xmitframe_enqueue_for_sleeping_sta(padapter, pxmitframe); if(_TRUE == ret) { - pattrib = &pxmitframe->attrib; - ptxservq = rtw_get_sta_pending(padapter, psta, pattrib->priority, (u8 *)(&ac_index)); ptxservq->qcnt--; @@ -4131,10 +4249,7 @@ void stop_sta_xmit(_adapter *padapter, struct sta_info *psta) rtw_list_delete(&(pstaxmitpriv->bk_q.tx_pending)); #ifdef CONFIG_TDLS - if( !(psta->tdls_sta_state & TDLS_LINKED_STATE) ) - { - if( psta_bmc != NULL ) - { + if (!(psta->tdls_sta_state & TDLS_LINKED_STATE) && (psta_bmc != NULL)) { #endif //CONFIG_TDLS @@ -4146,7 +4261,6 @@ void stop_sta_xmit(_adapter *padapter, struct sta_info *psta) #ifdef CONFIG_TDLS } - } #endif //CONFIG_TDLS _exit_critical_bh(&pxmitpriv->lock, &irqL0); @@ -4237,6 +4351,41 @@ void wakeup_sta_to_xmit(_adapter *padapter, struct sta_info *psta) } + if(psta->sleepq_len==0) + { +#ifdef CONFIG_TDLS + if( psta->tdls_sta_state & TDLS_LINKED_STATE ) + { + if(psta->state&WIFI_SLEEP_STATE) + psta->state ^= WIFI_SLEEP_STATE; + + _exit_critical_bh(&pxmitpriv->lock, &irqL); + return; + } +#endif //CONFIG_TDLS + + if (pstapriv->tim_bitmap & BIT(psta->aid)) { + //DBG_871X("wakeup to xmit, qlen==0, update_BCNTIM, tim=%x\n", pstapriv->tim_bitmap); + //upate BCN for TIM IE + //update_BCNTIM(padapter); + update_mask = BIT(0); + } + + pstapriv->tim_bitmap &= ~BIT(psta->aid); + + if(psta->state&WIFI_SLEEP_STATE) + psta->state ^= WIFI_SLEEP_STATE; + + if(psta->state & WIFI_STA_ALIVE_CHK_STATE) + { + DBG_871X("%s alive check\n", __func__); + psta->expire_to = pstapriv->expire_to; + psta->state ^= WIFI_STA_ALIVE_CHK_STATE; + } + + pstapriv->sta_dz_bitmap &= ~BIT(psta->aid); + } + //for BC/MC Frames if(!psta_bmc) goto _exit; @@ -4277,49 +4426,18 @@ void wakeup_sta_to_xmit(_adapter *padapter, struct sta_info *psta) if(psta_bmc->sleepq_len==0) { + if (pstapriv->tim_bitmap & BIT(0)) { + //DBG_871X("wakeup to xmit, qlen==0, update_BCNTIM, tim=%x\n", pstapriv->tim_bitmap); + //upate BCN for TIM IE + //update_BCNTIM(padapter); + update_mask |= BIT(1); + } pstapriv->tim_bitmap &= ~BIT(0); pstapriv->sta_dz_bitmap &= ~BIT(0); - - //DBG_871X("wakeup to xmit, qlen==0, update_BCNTIM, tim=%x\n", pstapriv->tim_bitmap); - //upate BCN for TIM IE - //update_BCNTIM(padapter); - update_mask |= BIT(1); } } - if(psta->sleepq_len==0) - { -#ifdef CONFIG_TDLS - if( psta->tdls_sta_state & TDLS_LINKED_STATE ) - { - if(psta->state&WIFI_SLEEP_STATE) - psta->state ^= WIFI_SLEEP_STATE; - - _exit_critical_bh(&pxmitpriv->lock, &irqL); - return; - } -#endif //CONFIG_TDLS - pstapriv->tim_bitmap &= ~BIT(psta->aid); - - //DBG_871X("wakeup to xmit, qlen==0, update_BCNTIM, tim=%x\n", pstapriv->tim_bitmap); - //upate BCN for TIM IE - //update_BCNTIM(padapter); - update_mask = BIT(0); - - if(psta->state&WIFI_SLEEP_STATE) - psta->state ^= WIFI_SLEEP_STATE; - - if(psta->state & WIFI_STA_ALIVE_CHK_STATE) - { - DBG_871X("%s alive check\n", __func__); - psta->expire_to = pstapriv->expire_to; - psta->state ^= WIFI_STA_ALIVE_CHK_STATE; - } - - pstapriv->sta_dz_bitmap &= ~BIT(psta->aid); - } - _exit: //_exit_critical_bh(&psta_bmc->sleep_q.lock, &irqL); @@ -4328,8 +4446,12 @@ void wakeup_sta_to_xmit(_adapter *padapter, struct sta_info *psta) if(update_mask) { //update_BCNTIM(padapter); - //printk("%s => call update_beacon\n",__FUNCTION__); - update_beacon(padapter, _TIM_IE_, NULL, _TRUE); + if ((update_mask & (BIT(0)|BIT(1))) == (BIT(0)|BIT(1))) + _update_beacon(padapter, _TIM_IE_, NULL, _TRUE, "clear UC&BMC"); + else if ((update_mask & BIT(1)) == BIT(1)) + _update_beacon(padapter, _TIM_IE_, NULL, _TRUE, "clear BMC"); + else + _update_beacon(padapter, _TIM_IE_, NULL, _TRUE, "clear UC"); } } @@ -4426,7 +4548,7 @@ void xmit_delivery_enabled_frames(_adapter *padapter, struct sta_info *psta) return; } -#endif +#endif /* defined(CONFIG_AP_MODE) || defined(CONFIG_TDLS) */ #ifdef CONFIG_XMIT_THREAD_MODE void enqueue_pending_xmitbuf( diff --git a/backports/drivers/realtek/rtl8812au/hal/HalPwrSeqCmd.c b/backports/drivers/realtek/rtl8812au/hal/HalPwrSeqCmd.c index 425fbefc8b68c5..972a3d893fa652 100755 --- a/backports/drivers/realtek/rtl8812au/hal/HalPwrSeqCmd.c +++ b/backports/drivers/realtek/rtl8812au/hal/HalPwrSeqCmd.c @@ -147,7 +147,7 @@ u8 HalPwrSeqCmdParsing( rtw_udelay_os(10); if (pollingCount++ > maxPollingCnt) { - DBG_871X("Fail to polling Offset[%#x]=%02x\n", offset, value); + DBG_871X_LEVEL(_drv_always_, "HalPwrSeqCmdParsing: Fail to polling Offset[%#x]=%02x\n", offset, value); return _FALSE; } } while (!bPollingBit); diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8188c2Ant.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8188c2Ant.c index 65cf94e1769ff8..6e9454ca5ccad2 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8188c2Ant.c +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8188c2Ant.c @@ -1724,9 +1724,17 @@ halbtc8188c2ant_ActionPanA2dp( // extern function start with EXhalbtc8188c2ant_ //============================================================ VOID -EXhalbtc8188c2ant_InitHwConfig( +EXhalbtc8188c2ant_PowerOnSetting( IN PBTC_COEXIST pBtCoexist ) +{ +} + +VOID +EXhalbtc8188c2ant_InitHwConfig( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bWifiOnly + ) { u1Byte u1Tmp=0; @@ -1766,22 +1774,10 @@ EXhalbtc8188c2ant_DisplayCoexInfo( pu1Byte cliBuf=pBtCoexist->cliBuf; u1Byte u1Tmp[4], i, btInfoExt, psTdmaCase=0; u4Byte u4Tmp[4]; - BOOLEAN bRoam=FALSE, bScan=FALSE, bLink=FALSE, bWifiUnder5G=FALSE; - BOOLEAN bBtHsOn=FALSE, bWifiBusy=FALSE; - s4Byte wifiRssi=0, btHsRssi=0; - u4Byte wifiBw, wifiTrafficDir; - u1Byte wifiDot11Chnl, wifiHsChnl; CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n ============[BT Coexist info]============"); CL_PRINTF(cliBuf); - if(!pBoardInfo->bBtExist) - { - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n BT not exists !!!"); - CL_PRINTF(cliBuf); - return; - } - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d ", "Ant PG number/ Ant mechanism:", \ pBoardInfo->pgAntNum, pBoardInfo->btdmAntNum); CL_PRINTF(cliBuf); @@ -1796,34 +1792,12 @@ EXhalbtc8188c2ant_DisplayCoexInfo( ((pStackInfo->bProfileNotified)? "Yes":"No"), pStackInfo->hciVersion); CL_PRINTF(cliBuf); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_DOT11_CHNL, &wifiDot11Chnl); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_HS_CHNL, &wifiHsChnl); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d(%d)", "Dot11 channel / HsChnl(HsMode)", \ - wifiDot11Chnl, wifiHsChnl, bBtHsOn); - CL_PRINTF(cliBuf); - - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_WIFI_RSSI, &wifiRssi); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_HS_RSSI, &btHsRssi); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d", "Wifi rssi/ HS rssi", \ - wifiRssi, btHsRssi); + // wifi status + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[Wifi Status]============"); CL_PRINTF(cliBuf); + pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_WIFI_STATUS); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_LINK, &bLink); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_ROAM, &bRoam); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d ", "Wifi bLink/ bRoam/ bScan", \ - bLink, bRoam, bScan); - CL_PRINTF(cliBuf); - - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_UNDER_5G, &bWifiUnder5G); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_TRAFFIC_DIRECTION, &wifiTrafficDir); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s / %s/ %s ", "Wifi status", \ - (bWifiUnder5G? "5G":"2.4G"), - ((BTC_WIFI_BW_LEGACY==wifiBw)? "Legacy": (((BTC_WIFI_BW_HT40==wifiBw)? "HT40":"HT20"))), - ((!bWifiBusy)? "idle": ((BTC_WIFI_TRAFFIC_TX==wifiTrafficDir)? "uplink":"downlink"))); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[BT Status]============"); CL_PRINTF(cliBuf); if(pStackInfo->bProfileNotified) diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8188c2Ant.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8188c2Ant.h index 086a87927bf017..ce7ec564414fc5 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8188c2Ant.h +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8188c2Ant.h @@ -87,10 +87,15 @@ typedef struct _COEX_STA_8188C_2ANT{ // The following is interface which will notify coex module. //=========================================== VOID -EXhalbtc8188c2ant_InitHwConfig( +EXhalbtc8188c2ant_PowerOnSetting( IN PBTC_COEXIST pBtCoexist ); VOID +EXhalbtc8188c2ant_InitHwConfig( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bWifiOnly + ); +VOID EXhalbtc8188c2ant_InitCoexDm( IN PBTC_COEXIST pBtCoexist ); diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8192d2Ant.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8192d2Ant.c index 0a3f310005240a..cb60379c9a866a 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8192d2Ant.c +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8192d2Ant.c @@ -1713,9 +1713,17 @@ halbtc8192d2ant_IsBtCoexistEnter( // extern function start with EXhalbtc8192d2ant_ //============================================================ VOID -EXhalbtc8192d2ant_InitHwConfig( +EXhalbtc8192d2ant_PowerOnSetting( IN PBTC_COEXIST pBtCoexist ) +{ +} + +VOID +EXhalbtc8192d2ant_InitHwConfig( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bWifiOnly + ) { u1Byte u1Tmp=0; @@ -1772,22 +1780,10 @@ EXhalbtc8192d2ant_DisplayCoexInfo( pu1Byte cliBuf=pBtCoexist->cliBuf; u1Byte u1Tmp[4], i, btInfoExt, psTdmaCase=0; u4Byte u4Tmp[4]; - BOOLEAN bRoam=FALSE, bScan=FALSE, bLink=FALSE, bWifiUnder5G=FALSE; - BOOLEAN bBtHsOn=FALSE, bWifiBusy=FALSE; - s4Byte wifiRssi=0, btHsRssi=0; - u4Byte wifiBw, wifiTrafficDir; - u1Byte wifiDot11Chnl, wifiHsChnl; CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n ============[BT Coexist info]============"); CL_PRINTF(cliBuf); - if(!pBoardInfo->bBtExist) - { - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n BT not exists !!!"); - CL_PRINTF(cliBuf); - return; - } - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d ", "Ant PG number/ Ant mechanism:", \ pBoardInfo->pgAntNum, pBoardInfo->btdmAntNum); CL_PRINTF(cliBuf); @@ -1802,34 +1798,12 @@ EXhalbtc8192d2ant_DisplayCoexInfo( ((pStackInfo->bProfileNotified)? "Yes":"No"), pStackInfo->hciVersion); CL_PRINTF(cliBuf); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_DOT11_CHNL, &wifiDot11Chnl); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_HS_CHNL, &wifiHsChnl); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d(%d)", "Dot11 channel / HsChnl(HsMode)", \ - wifiDot11Chnl, wifiHsChnl, bBtHsOn); - CL_PRINTF(cliBuf); - - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_WIFI_RSSI, &wifiRssi); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_HS_RSSI, &btHsRssi); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d", "Wifi rssi/ HS rssi", \ - wifiRssi, btHsRssi); + // wifi status + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[Wifi Status]============"); CL_PRINTF(cliBuf); + pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_WIFI_STATUS); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_LINK, &bLink); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_ROAM, &bRoam); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d ", "Wifi bLink/ bRoam/ bScan", \ - bLink, bRoam, bScan); - CL_PRINTF(cliBuf); - - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_UNDER_5G, &bWifiUnder5G); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_TRAFFIC_DIRECTION, &wifiTrafficDir); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s / %s/ %s ", "Wifi status", \ - (bWifiUnder5G? "5G":"2.4G"), - ((BTC_WIFI_BW_LEGACY==wifiBw)? "Legacy": (((BTC_WIFI_BW_HT40==wifiBw)? "HT40":"HT20"))), - ((!bWifiBusy)? "idle": ((BTC_WIFI_TRAFFIC_TX==wifiTrafficDir)? "uplink":"downlink"))); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[BT Status]============"); CL_PRINTF(cliBuf); if(pStackInfo->bProfileNotified) diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8192d2Ant.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8192d2Ant.h index 4d3b83879081bf..85fd6742ca2f6d 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8192d2Ant.h +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8192d2Ant.h @@ -108,10 +108,15 @@ typedef struct _COEX_STA_8192D_2ANT{ // The following is interface which will notify coex module. //=========================================== VOID -EXhalbtc8192d2ant_InitHwConfig( +EXhalbtc8192d2ant_PowerOnSetting( IN PBTC_COEXIST pBtCoexist ); VOID +EXhalbtc8192d2ant_InitHwConfig( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bWifiOnly + ); +VOID EXhalbtc8192d2ant_InitCoexDm( IN PBTC_COEXIST pBtCoexist ); diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8192e1Ant.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8192e1Ant.c index a9b90c6acd63f6..12dfe4b210eb39 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8192e1Ant.c +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8192e1Ant.c @@ -2437,9 +2437,17 @@ halbtc8192e1ant_InitCoexDm( // extern function start with EXhalbtc8192e1ant_ //============================================================ VOID -EXhalbtc8192e1ant_InitHwConfig( +EXhalbtc8192e1ant_PowerOnSetting( IN PBTC_COEXIST pBtCoexist ) +{ +} + +VOID +EXhalbtc8192e1ant_InitHwConfig( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bWifiOnly + ) { u4Byte u4Tmp=0; u2Byte u2Tmp=0; @@ -2511,11 +2519,6 @@ EXhalbtc8192e1ant_DisplayCoexInfo( pu1Byte cliBuf=pBtCoexist->cliBuf; u1Byte u1Tmp[4], i, btInfoExt, psTdmaCase=0; u4Byte u4Tmp[4]; - BOOLEAN bRoam=FALSE, bScan=FALSE, bLink=FALSE, bWifiUnder5G=FALSE; - BOOLEAN bBtHsOn=FALSE, bWifiBusy=FALSE; - s4Byte wifiRssi=0, btHsRssi=0; - u4Byte wifiBw, wifiTrafficDir; - u1Byte wifiDot11Chnl, wifiHsChnl; u4Byte fwVer=0, btPatchVer=0; CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n ============[BT Coexist info]============"); @@ -2536,13 +2539,6 @@ EXhalbtc8192e1ant_DisplayCoexInfo( CL_PRINTF(cliBuf); } - if(!pBoardInfo->bBtExist) - { - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n BT not exists !!!"); - CL_PRINTF(cliBuf); - return; - } - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d ", "Ant PG number/ Ant mechanism:", \ pBoardInfo->pgAntNum, pBoardInfo->btdmAntNum); CL_PRINTF(cliBuf); @@ -2557,40 +2553,19 @@ EXhalbtc8192e1ant_DisplayCoexInfo( GLCoexVerDate8192e1Ant, GLCoexVer8192e1Ant, fwVer, btPatchVer, btPatchVer); CL_PRINTF(cliBuf); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_DOT11_CHNL, &wifiDot11Chnl); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_HS_CHNL, &wifiHsChnl); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d(%d)", "Dot11 channel / HsChnl(HsMode)", \ - wifiDot11Chnl, wifiHsChnl, bBtHsOn); - CL_PRINTF(cliBuf); - - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %02x %02x %02x ", "H2C Wifi inform bt chnl Info", \ + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %02x %02x %02x ", "Wifi channel informed to BT", \ pCoexDm->wifiChnlInfo[0], pCoexDm->wifiChnlInfo[1], pCoexDm->wifiChnlInfo[2]); CL_PRINTF(cliBuf); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_WIFI_RSSI, &wifiRssi); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_HS_RSSI, &btHsRssi); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d", "Wifi rssi/ HS rssi", \ - wifiRssi, btHsRssi); + // wifi status + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[Wifi Status]============"); CL_PRINTF(cliBuf); + pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_WIFI_STATUS); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_LINK, &bLink); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_ROAM, &bRoam); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d ", "Wifi bLink/ bRoam/ bScan", \ - bLink, bRoam, bScan); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[BT Status]============"); CL_PRINTF(cliBuf); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_UNDER_5G, &bWifiUnder5G); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_TRAFFIC_DIRECTION, &wifiTrafficDir); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s / %s/ %s ", "Wifi status", \ - (bWifiUnder5G? "5G":"2.4G"), - ((BTC_WIFI_BW_LEGACY==wifiBw)? "Legacy": (((BTC_WIFI_BW_HT40==wifiBw)? "HT40":"HT20"))), - ((!bWifiBusy)? "idle": ((BTC_WIFI_TRAFFIC_TX==wifiTrafficDir)? "uplink":"downlink"))); - CL_PRINTF(cliBuf); CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = [%s/ %d/ %d] ", "BT [status/ rssi/ retryCnt]", \ ((pBtCoexist->btInfo.bBtDisabled)? ("disabled"): ((pCoexSta->bC2hBtInquiryPage)?("inquiry/page scan"):((BT_8192E_1ANT_BT_STATUS_NON_CONNECTED_IDLE == pCoexDm->btStatus)? "non-connected idle": ( (BT_8192E_1ANT_BT_STATUS_CONNECTED_IDLE == pCoexDm->btStatus)? "connected-idle":"busy")))), @@ -2619,17 +2594,6 @@ EXhalbtc8192e1ant_DisplayCoexInfo( CL_PRINTF(cliBuf); } } - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s/%s, (0x%x/0x%x)", "PS state, IPS/LPS, (lps/rpwm)", \ - ((pCoexSta->bUnderIps? "IPS ON":"IPS OFF")), - ((pCoexSta->bUnderLps? "LPS ON":"LPS OFF")), - pBtCoexist->btInfo.lpsVal, - pBtCoexist->btInfo.rpwmVal); - CL_PRINTF(cliBuf); - pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_FW_PWR_MODE_CMD); - - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x ", "SS Type", \ - pCoexDm->curSsType); - CL_PRINTF(cliBuf); if(!pBtCoexist->bManualControl) { @@ -2637,10 +2601,6 @@ EXhalbtc8192e1ant_DisplayCoexInfo( CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[Sw mechanism]============"); CL_PRINTF(cliBuf); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d(0x%x) ", "SM[SwDacSwing(lvl)]", \ - pCoexDm->bCurDacSwingOn, pCoexDm->curDacSwingLvl); - CL_PRINTF(cliBuf); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s/ %s/ %d ", "DelBA/ BtCtrlAgg/ AggSize", \ (pBtCoexist->btInfo.bRejectAggPkt? "Yes":"No"), (pBtCoexist->btInfo.bBtCtrlAggBufSize? "Yes":"No"), pBtCoexist->btInfo.aggBufSize); @@ -2664,8 +2624,8 @@ EXhalbtc8192e1ant_DisplayCoexInfo( pCoexDm->errorCondition); CL_PRINTF(cliBuf); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d ", "DecBtPwrLvl/ IgnWlanAct", \ - pCoexDm->curBtDecPwrLvl, pCoexDm->bCurIgnoreWlanAct); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d ", "IgnWlanAct", \ + pCoexDm->bCurIgnoreWlanAct); CL_PRINTF(cliBuf); } diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8192e1Ant.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8192e1Ant.h index 7a1ce5ae1b1df7..8792ec8d381caa 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8192e1Ant.h +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8192e1Ant.h @@ -140,10 +140,15 @@ typedef struct _COEX_STA_8192E_1ANT{ // The following is interface which will notify coex module. //=========================================== VOID -EXhalbtc8192e1ant_InitHwConfig( +EXhalbtc8192e1ant_PowerOnSetting( IN PBTC_COEXIST pBtCoexist ); VOID +EXhalbtc8192e1ant_InitHwConfig( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bWifiOnly + ); +VOID EXhalbtc8192e1ant_InitCoexDm( IN PBTC_COEXIST pBtCoexist ); diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8192e2Ant.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8192e2Ant.c index a1b8f274e670a2..8bde294c93f23a 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8192e2Ant.c +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8192e2Ant.c @@ -1697,7 +1697,8 @@ halbtc8192e2ant_SetSwitchSsType( pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0xd04, 0x1); pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x90c, 0x81111111); // switch cck patch - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0xe77, 0x4, 0x1); + //Jenyu suggest to remove 0xe77 this line for tx issue + //pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0xe77, 0x4, 0x1); //pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0xa07, 0x81); mimoPs=BTC_MIMO_PS_STATIC; } @@ -1707,7 +1708,8 @@ halbtc8192e2ant_SetSwitchSsType( pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0xc04, 0x33); pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0xd04, 0x3); pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x90c, 0x81121313); - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0xe77, 0x4, 0x0); + //Jenyu suggest to remove 0xe77 this line for tx issue + //pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0xe77, 0x4, 0x0); //pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0xa07, 0x41); mimoPs=BTC_MIMO_PS_DYNAMIC; } @@ -3791,9 +3793,17 @@ halbtc8192e2ant_InitHwConfig( // extern function start with EXhalbtc8192e2ant_ //============================================================ VOID -EXhalbtc8192e2ant_InitHwConfig( +EXhalbtc8192e2ant_PowerOnSetting( IN PBTC_COEXIST pBtCoexist ) +{ +} + +VOID +EXhalbtc8192e2ant_InitHwConfig( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bWifiOnly + ) { halbtc8192e2ant_InitHwConfig(pBtCoexist, TRUE); } @@ -3819,11 +3829,7 @@ EXhalbtc8192e2ant_DisplayCoexInfo( u1Byte u1Tmp[4], i, btInfoExt, psTdmaCase=0; u2Byte u2Tmp[4]; u4Byte u4Tmp[4]; - BOOLEAN bRoam=FALSE, bScan=FALSE, bLink=FALSE, bWifiUnder5G=FALSE; - BOOLEAN bBtHsOn=FALSE, bWifiBusy=FALSE; - s4Byte wifiRssi=0, btHsRssi=0; - u4Byte wifiBw, wifiTrafficDir, faOfdm, faCck; - u1Byte wifiDot11Chnl, wifiHsChnl; + u4Byte faOfdm, faCck; u4Byte fwVer=0, btPatchVer=0; CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n ============[BT Coexist info]============"); @@ -3837,13 +3843,6 @@ EXhalbtc8192e2ant_DisplayCoexInfo( CL_PRINTF(cliBuf); } - if(!pBoardInfo->bBtExist) - { - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n BT not exists !!!"); - CL_PRINTF(cliBuf); - return; - } - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d ", "Ant PG number/ Ant mechanism:", \ pBoardInfo->pgAntNum, pBoardInfo->btdmAntNum); CL_PRINTF(cliBuf); @@ -3858,39 +3857,17 @@ EXhalbtc8192e2ant_DisplayCoexInfo( GLCoexVerDate8192e2Ant, GLCoexVer8192e2Ant, fwVer, btPatchVer, btPatchVer); CL_PRINTF(cliBuf); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_DOT11_CHNL, &wifiDot11Chnl); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_HS_CHNL, &wifiHsChnl); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d(%d)", "Dot11 channel / HsMode(HsChnl)", \ - wifiDot11Chnl, bBtHsOn, wifiHsChnl); - CL_PRINTF(cliBuf); - - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %02x %02x %02x ", "H2C Wifi inform bt chnl Info", \ + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %02x %02x %02x ", "Wifi channel informed to BT", \ pCoexDm->wifiChnlInfo[0], pCoexDm->wifiChnlInfo[1], pCoexDm->wifiChnlInfo[2]); CL_PRINTF(cliBuf); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_WIFI_RSSI, &wifiRssi); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_HS_RSSI, &btHsRssi); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d", "Wifi rssi/ HS rssi", \ - wifiRssi, btHsRssi); + // wifi status + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[Wifi Status]============"); CL_PRINTF(cliBuf); + pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_WIFI_STATUS); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_LINK, &bLink); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_ROAM, &bRoam); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d ", "Wifi bLink/ bRoam/ bScan", \ - bLink, bRoam, bScan); - CL_PRINTF(cliBuf); - - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_UNDER_5G, &bWifiUnder5G); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_TRAFFIC_DIRECTION, &wifiTrafficDir); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s / %s/ %s ", "Wifi status", \ - (bWifiUnder5G? "5G":"2.4G"), - ((BTC_WIFI_BW_LEGACY==wifiBw)? "Legacy": (((BTC_WIFI_BW_HT40==wifiBw)? "HT40":"HT20"))), - ((!bWifiBusy)? "idle": ((BTC_WIFI_TRAFFIC_TX==wifiTrafficDir)? "uplink":"downlink"))); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[BT Status]============"); CL_PRINTF(cliBuf); CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = [%s/ %d/ %d] ", "BT [status/ rssi/ retryCnt]", \ @@ -3922,12 +3899,6 @@ EXhalbtc8192e2ant_DisplayCoexInfo( } } - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s/%s", "PS state, IPS/LPS", \ - ((pCoexSta->bUnderIps? "IPS ON":"IPS OFF")), - ((pCoexSta->bUnderLps? "LPS ON":"LPS OFF"))); - CL_PRINTF(cliBuf); - pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_FW_PWR_MODE_CMD); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x ", "SS Type", \ pCoexDm->curSsType); CL_PRINTF(cliBuf); diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8192e2Ant.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8192e2Ant.h index dc94c73b3f3a43..58cddce87a412c 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8192e2Ant.h +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8192e2Ant.h @@ -143,10 +143,15 @@ typedef struct _COEX_STA_8192E_2ANT{ // The following is interface which will notify coex module. //=========================================== VOID -EXhalbtc8192e2ant_InitHwConfig( +EXhalbtc8192e2ant_PowerOnSetting( IN PBTC_COEXIST pBtCoexist ); VOID +EXhalbtc8192e2ant_InitHwConfig( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bWifiOnly + ); +VOID EXhalbtc8192e2ant_InitCoexDm( IN PBTC_COEXIST pBtCoexist ); diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8723a1Ant.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8723a1Ant.c index d2476cda62e568..8ea08e87d3de1c 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8723a1Ant.c +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8723a1Ant.c @@ -1068,22 +1068,10 @@ EXhalbtc8723a1ant_DisplayCoexInfo( pu1Byte cliBuf=pBtCoexist->cliBuf; u1Byte u1Tmp[4], i, btInfoExt, psTdmaCase=0; u4Byte u4Tmp[4]; - BOOLEAN bRoam=FALSE, bScan=FALSE, bLink=FALSE, bWifiUnder5G=FALSE; - BOOLEAN bBtHsOn=FALSE, bWifiBusy=FALSE; - s4Byte wifiRssi=0, btHsRssi=0; - u4Byte wifiBw, wifiTrafficDir; - u1Byte wifiDot11Chnl, wifiHsChnl; CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n ============[BT Coexist info]============"); CL_PRINTF(cliBuf); - if(!pBoardInfo->bBtExist) - { - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n BT not exists !!!"); - CL_PRINTF(cliBuf); - return; - } - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d ", "Ant PG number/ Ant mechanism:", \ pBoardInfo->pgAntNum, pBoardInfo->btdmAntNum); CL_PRINTF(cliBuf); @@ -1098,39 +1086,17 @@ EXhalbtc8723a1ant_DisplayCoexInfo( ((pStackInfo->bProfileNotified)? "Yes":"No"), pStackInfo->hciVersion); CL_PRINTF(cliBuf); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_DOT11_CHNL, &wifiDot11Chnl); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_HS_CHNL, &wifiHsChnl); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d(%d)", "Dot11 channel / HsChnl(HsMode)", \ - wifiDot11Chnl, wifiHsChnl, bBtHsOn); - CL_PRINTF(cliBuf); - - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %02x %02x %02x ", "H2C Wifi inform bt chnl Info", \ + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %02x %02x %02x ", "Wifi channel informed to BT", \ pCoexDm->wifiChnlInfo[0], pCoexDm->wifiChnlInfo[1], pCoexDm->wifiChnlInfo[2]); CL_PRINTF(cliBuf); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_WIFI_RSSI, &wifiRssi); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_HS_RSSI, &btHsRssi); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d", "Wifi rssi/ HS rssi", \ - wifiRssi, btHsRssi); + // wifi status + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[Wifi Status]============"); CL_PRINTF(cliBuf); + pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_WIFI_STATUS); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_LINK, &bLink); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_ROAM, &bRoam); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d ", "Wifi bLink/ bRoam/ bScan", \ - bLink, bRoam, bScan); - CL_PRINTF(cliBuf); - - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_UNDER_5G, &bWifiUnder5G); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_TRAFFIC_DIRECTION, &wifiTrafficDir); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s / %s/ %s ", "Wifi status", \ - (bWifiUnder5G? "5G":"2.4G"), - ((BTC_WIFI_BW_LEGACY==wifiBw)? "Legacy": (((BTC_WIFI_BW_HT40==wifiBw)? "HT40":"HT20"))), - ((!bWifiBusy)? "idle": ((BTC_WIFI_TRAFFIC_TX==wifiTrafficDir)? "uplink":"downlink"))); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[BT Status]============"); CL_PRINTF(cliBuf); CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = [%s/ %d/ %d] ", "BT [status/ rssi/ retryCnt]", \ @@ -1258,12 +1224,6 @@ EXhalbtc8723a1ant_DisplayCoexInfo( pCoexSta->lowPriorityRx, pCoexSta->lowPriorityTx); CL_PRINTF(cliBuf); - // Tx mgnt queue hang or not, 0x41b should = 0xf, ex: 0xd ==>hang - u1Tmp[0] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x41b); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x", "0x41b (mgntQ hang chk == 0xf)", \ - u1Tmp[0]); - CL_PRINTF(cliBuf); - pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_COEX_STATISTICS); } diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8723a2Ant.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8723a2Ant.c index 2b72397b5285d8..ffe117596f5b98 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8723a2Ant.c +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8723a2Ant.c @@ -58,6 +58,31 @@ halbtc8723a2ant_IsWifiIdle( return TRUE; } +BOOLEAN +halbtc8723a2ant_IsWifiConnectedIdle( + IN PBTC_COEXIST pBtCoexist + ) +{ + BOOLEAN bWifiConnected=FALSE, bScan=FALSE, bLink=FALSE, bRoam=FALSE, bWifiBusy=FALSE; + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_LINK, &bLink); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_ROAM, &bRoam); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); + + if(bScan) + return FALSE; + if(bLink) + return FALSE; + if(bRoam) + return FALSE; + if(bWifiConnected && !bWifiBusy) + return TRUE; + else + return FALSE; +} + u1Byte halbtc8723a2ant_BtRssiState( u1Byte levelNum, @@ -629,6 +654,9 @@ halbtc8723a2ant_NeedToDecBtPwr( BOOLEAN bRet=FALSE; BOOLEAN bBtHsOn=FALSE, bWifiConnected=FALSE; s4Byte btHsRssi=0; + u1Byte btRssiState=BTC_RSSI_STATE_HIGH; + + btRssiState = halbtc8723a2ant_BtRssiState(2, 42, 0); if(!pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn)) return FALSE; @@ -636,6 +664,8 @@ halbtc8723a2ant_NeedToDecBtPwr( return FALSE; if(!pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_HS_RSSI, &btHsRssi)) return FALSE; + if(BTC_RSSI_LOW(btRssiState)) + return FALSE; if(bWifiConnected) { @@ -1546,6 +1576,26 @@ halbtc8723a2ant_IsCommonAction( bCommon = TRUE; } + else if(halbtc8723a2ant_IsWifiConnectedIdle(pBtCoexist) && + (BT_8723A_2ANT_BT_STATUS_NON_IDLE == pCoexDm->btStatus) ) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi connected-idle + BT non-idle!!\n")); + + halbtc8723a2ant_LowPenaltyRa(pBtCoexist, NORMAL_EXEC, TRUE); + halbtc8723a2ant_RfShrink(pBtCoexist, NORMAL_EXEC, TRUE); + halbtc8723a2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55555555, 0xffff, 0x3); + + halbtc8723a2ant_IgnoreWlanAct(pBtCoexist, NORMAL_EXEC, FALSE); + halbtc8723a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 3); + halbtc8723a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 0x20); + halbtc8723a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + + halbtc8723a2ant_AgcTable(pBtCoexist, NORMAL_EXEC, FALSE); + halbtc8723a2ant_AdcBackOff(pBtCoexist, NORMAL_EXEC, FALSE); + halbtc8723a2ant_DacSwing(pBtCoexist, NORMAL_EXEC, FALSE, 0xc0); + + bCommon = TRUE; + } else { BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi non-idle + BT non-idle!!\n")); @@ -3332,9 +3382,17 @@ wa_halbtc8723a2ant_MonitorC2h( // extern function start with EXhalbtc8723a2ant_ //============================================================ VOID -EXhalbtc8723a2ant_InitHwConfig( +EXhalbtc8723a2ant_PowerOnSetting( IN PBTC_COEXIST pBtCoexist ) +{ +} + +VOID +EXhalbtc8723a2ant_InitHwConfig( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bWifiOnly + ) { u4Byte u4Tmp=0; u1Byte u1Tmp=0; @@ -3371,22 +3429,10 @@ EXhalbtc8723a2ant_DisplayCoexInfo( pu1Byte cliBuf=pBtCoexist->cliBuf; u1Byte u1Tmp[4], i, btInfoExt, psTdmaCase=0; u4Byte u4Tmp[4]; - BOOLEAN bRoam=FALSE, bScan=FALSE, bLink=FALSE, bWifiUnder5G=FALSE; - BOOLEAN bBtHsOn=FALSE, bWifiBusy=FALSE; - s4Byte wifiRssi=0, btHsRssi=0; - u4Byte wifiBw, wifiTrafficDir; - u1Byte wifiDot11Chnl, wifiHsChnl; CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n ============[BT Coexist info]============"); CL_PRINTF(cliBuf); - if(!pBoardInfo->bBtExist) - { - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n BT not exists !!!"); - CL_PRINTF(cliBuf); - return; - } - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d ", "Ant PG number/ Ant mechanism:", \ pBoardInfo->pgAntNum, pBoardInfo->btdmAntNum); CL_PRINTF(cliBuf); @@ -3401,39 +3447,17 @@ EXhalbtc8723a2ant_DisplayCoexInfo( ((pStackInfo->bProfileNotified)? "Yes":"No"), pStackInfo->hciVersion); CL_PRINTF(cliBuf); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_DOT11_CHNL, &wifiDot11Chnl); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_HS_CHNL, &wifiHsChnl); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d(%d)", "Dot11 channel / HsChnl(HsMode)", \ - wifiDot11Chnl, wifiHsChnl, bBtHsOn); - CL_PRINTF(cliBuf); - - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %02x %02x %02x ", "H2C Wifi inform bt chnl Info", \ + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %02x %02x %02x ", "Wifi channel informed to BT", \ pCoexDm->wifiChnlInfo[0], pCoexDm->wifiChnlInfo[1], pCoexDm->wifiChnlInfo[2]); CL_PRINTF(cliBuf); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_WIFI_RSSI, &wifiRssi); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_HS_RSSI, &btHsRssi); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d", "Wifi rssi/ HS rssi", \ - wifiRssi, btHsRssi); - CL_PRINTF(cliBuf); - - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_LINK, &bLink); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_ROAM, &bRoam); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d ", "Wifi bLink/ bRoam/ bScan", \ - bLink, bRoam, bScan); + // wifi status + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[Wifi Status]============"); CL_PRINTF(cliBuf); + pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_WIFI_STATUS); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_UNDER_5G, &bWifiUnder5G); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_TRAFFIC_DIRECTION, &wifiTrafficDir); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s / %s/ %s ", "Wifi status", \ - (bWifiUnder5G? "5G":"2.4G"), - ((BTC_WIFI_BW_LEGACY==wifiBw)? "Legacy": (((BTC_WIFI_BW_HT40==wifiBw)? "HT40":"HT20"))), - ((!bWifiBusy)? "idle": ((BTC_WIFI_TRAFFIC_TX==wifiTrafficDir)? "uplink":"downlink"))); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[BT Status]============"); CL_PRINTF(cliBuf); CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = [%s/ %d/ %d] ", "BT [status/ rssi/ retryCnt]", \ @@ -3564,12 +3588,6 @@ EXhalbtc8723a2ant_DisplayCoexInfo( pCoexSta->lowPriorityRx, pCoexSta->lowPriorityTx); CL_PRINTF(cliBuf); - // Tx mgnt queue hang or not, 0x41b should = 0xf, ex: 0xd ==>hang - u1Tmp[0] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x41b); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x", "0x41b (mgntQ hang chk == 0xf)", \ - u1Tmp[0]); - CL_PRINTF(cliBuf); - pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_COEX_STATISTICS); } diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8723a2Ant.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8723a2Ant.h index c2733d89cea504..f0cc8b546972c0 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8723a2Ant.h +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8723a2Ant.h @@ -116,10 +116,15 @@ typedef struct _COEX_STA_8723A_2ANT{ // The following is interface which will notify coex module. //=========================================== VOID -EXhalbtc8723a2ant_InitHwConfig( +EXhalbtc8723a2ant_PowerOnSetting( IN PBTC_COEXIST pBtCoexist ); VOID +EXhalbtc8723a2ant_InitHwConfig( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bWifiOnly + ); +VOID EXhalbtc8723a2ant_InitCoexDm( IN PBTC_COEXIST pBtCoexist ); diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8723b1Ant.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8723b1Ant.c index ace549f770788e..b19c9b72c660e9 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8723b1Ant.c +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8723b1Ant.c @@ -20,6 +20,9 @@ static COEX_DM_8723B_1ANT GLCoexDm8723b1Ant; static PCOEX_DM_8723B_1ANT pCoexDm=&GLCoexDm8723b1Ant; static COEX_STA_8723B_1ANT GLCoexSta8723b1Ant; static PCOEX_STA_8723B_1ANT pCoexSta=&GLCoexSta8723b1Ant; +static PSDSCAN_STA_8723B_1ANT GLPsdScan8723b1Ant; +static PPSDSCAN_STA_8723B_1ANT pPsdScan = &GLPsdScan8723b1Ant; + const char *const GLBtInfoSrc8723b1Ant[]={ "BT Info[wifi fw]", @@ -27,8 +30,8 @@ const char *const GLBtInfoSrc8723b1Ant[]={ "BT Info[bt auto report]", }; -u4Byte GLCoexVerDate8723b1Ant=20130918; -u4Byte GLCoexVer8723b1Ant=0x47; +u4Byte GLCoexVerDate8723b1Ant=20140929; +u4Byte GLCoexVer8723b1Ant=0x54; //============================================================ // local function proto type if needed @@ -411,6 +414,23 @@ halbtc8723b1ant_LimitedRx( } +VOID +halbtc8723b1ant_QueryBtInfo( + IN PBTC_COEXIST pBtCoexist + ) +{ + u1Byte H2C_Parameter[1] ={0}; + + pCoexSta->bC2hBtInfoReqSent = TRUE; + + H2C_Parameter[0] |= BIT0; // trigger + + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], Query Bt Info, FW write 0x61=0x%x\n", + H2C_Parameter[0])); + + pBtCoexist->fBtcFillH2c(pBtCoexist, 0x61, 1, H2C_Parameter); +} + VOID halbtc8723b1ant_MonitorBtCtr( IN PBTC_COEXIST pBtCoexist @@ -420,7 +440,20 @@ halbtc8723b1ant_MonitorBtCtr( u4Byte regHPTx=0, regHPRx=0, regLPTx=0, regLPRx=0; u1Byte u1Tmp, u1Tmp1; s4Byte wifiRssi; + static u1Byte NumOfBtCounterChk = 0; + //to avoid 0x76e[3] = 1 (WLAN_Act control by PTA) during IPS + //if (! (pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x76e) & 0x8) ) + + if (pCoexSta->bUnderIps) + { + //pCoexSta->highPriorityTx = 65535; + //pCoexSta->highPriorityRx = 65535; + //pCoexSta->lowPriorityTx = 65535; + //pCoexSta->lowPriorityRx = 65535; + //return; + } + regHPTxRx = 0x770; regLPTxRx = 0x774; @@ -437,25 +470,125 @@ halbtc8723b1ant_MonitorBtCtr( pCoexSta->lowPriorityTx = regLPTx; pCoexSta->lowPriorityRx = regLPRx; + if( (pCoexSta->lowPriorityTx > 1150) && (!pCoexSta->bC2hBtInquiryPage)) + pCoexSta->popEventCnt++; + + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Hi-Pri Rx/Tx: %d/%d, Lo-Pri Rx/Tx: %d/%d\n", + regHPRx, regHPTx, regLPRx, regLPTx)); + // reset counter pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0xc); + + if ((regHPTx == 0) && (regHPRx ==0) && (regLPTx == 0) && (regLPRx == 0)) + { + NumOfBtCounterChk++; + if (NumOfBtCounterChk >= 3) +{ + halbtc8723b1ant_QueryBtInfo(pBtCoexist); + NumOfBtCounterChk = 0; + } + } } + VOID -halbtc8723b1ant_QueryBtInfo( +halbtc8723b1ant_MonitorWiFiCtr( IN PBTC_COEXIST pBtCoexist ) { - u1Byte H2C_Parameter[1] ={0}; + u4Byte u4Tmp; + u2Byte u2Tmp[3]; + s4Byte wifiRssi=0; + BOOLEAN bWifiBusy = FALSE, bWifiUnderBMode = FALSE; + static u1Byte nCCKLockCounter = 0; - pCoexSta->bC2hBtInfoReqSent = TRUE; + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_WIFI_RSSI, &wifiRssi); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &bWifiUnderBMode); - H2C_Parameter[0] |= BIT0; // trigger + if (pCoexSta->bUnderIps) + { + pCoexSta->nCRCOK_CCK = 0; + pCoexSta->nCRCOK_11g = 0; + pCoexSta->nCRCOK_11n = 0; + pCoexSta->nCRCOK_11nAgg = 0; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], Query Bt Info, FW write 0x61=0x%x\n", - H2C_Parameter[0])); + pCoexSta->nCRCErr_CCK = 0; + pCoexSta->nCRCErr_11g = 0; + pCoexSta->nCRCErr_11n = 0; + pCoexSta->nCRCErr_11nAgg = 0; + } + else + { + pCoexSta->nCRCOK_CCK = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0xf88); + pCoexSta->nCRCOK_11g = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xf94); + pCoexSta->nCRCOK_11n = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xf90); + pCoexSta->nCRCOK_11nAgg= pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xfb8); + + pCoexSta->nCRCErr_CCK = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0xf84); + pCoexSta->nCRCErr_11g = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xf96); + pCoexSta->nCRCErr_11n = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xf92); + pCoexSta->nCRCErr_11nAgg = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xfba); + } + + + //reset counter + pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0xf16, 0x1, 0x1); + pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0xf16, 0x1, 0x0); + + if ( (bWifiBusy) && (wifiRssi >= 30) && (!bWifiUnderBMode)) + { + if ( (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) || + (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) || + (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) ) + { + if (pCoexSta->nCRCOK_CCK >(pCoexSta->nCRCOK_11g + pCoexSta->nCRCOK_11n + + pCoexSta->nCRCOK_11nAgg) ) + { + if (nCCKLockCounter < 5) + nCCKLockCounter++; + } + else + { + if (nCCKLockCounter > 0) + nCCKLockCounter--; + } + + } + else + { + if (nCCKLockCounter > 0) + nCCKLockCounter--; + } + } + else + { + if (nCCKLockCounter > 0) + nCCKLockCounter--; + } + + if (!pCoexSta->bPreCCKLock) + { + + if (nCCKLockCounter >= 5) + pCoexSta->bCCKLock = TRUE; + else + pCoexSta->bCCKLock = FALSE; + } + else + { + if (nCCKLockCounter == 0) + pCoexSta->bCCKLock = FALSE; + else + pCoexSta->bCCKLock = TRUE; + } + + if (pCoexSta->bCCKLock) + pCoexSta->bCCKEverLock = TRUE; + + pCoexSta->bPreCCKLock = pCoexSta->bCCKLock; + - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x61, 1, H2C_Parameter); } BOOLEAN @@ -509,6 +642,7 @@ halbtc8723b1ant_UpdateBtLinkInfo( pBtLinkInfo->bA2dpExist = pCoexSta->bA2dpExist; pBtLinkInfo->bPanExist = pCoexSta->bPanExist; pBtLinkInfo->bHidExist = pCoexSta->bHidExist; + pBtLinkInfo->bBtHiPriLinkExist = pCoexSta->bBtHiPriLinkExist; // work around for HS mode. if(bBtHsOn) @@ -920,6 +1054,10 @@ halbtc8723b1ant_CoexTableWithType( IN u1Byte type ) { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], ********** CoexTable(%d) **********\n", type)); + + pCoexSta->nCoexTableType = type; + switch(type) { case 0: @@ -932,16 +1070,19 @@ halbtc8723b1ant_CoexTableWithType( halbtc8723b1ant_CoexTable(pBtCoexist, bForceExec, 0x5a5a5a5a, 0x5a5a5a5a, 0xffffff, 0x3); break; case 3: - halbtc8723b1ant_CoexTable(pBtCoexist, bForceExec, 0x55555555, 0xaaaaaaaa, 0xffffff, 0x3); + halbtc8723b1ant_CoexTable(pBtCoexist, bForceExec, 0x55555555, 0x5a5a5a5a, 0xffffff, 0x3); break; case 4: - halbtc8723b1ant_CoexTable(pBtCoexist, bForceExec, 0x55555555, 0x5aaa5aaa, 0xffffff, 0x3); + if ((pCoexSta->nScanAPNum <= 5) || ( pCoexSta->bCCKEverLock) ) + halbtc8723b1ant_CoexTable(pBtCoexist, bForceExec, 0x55555555, 0xaaaaaaaa, 0xffffff, 0x3); + else + halbtc8723b1ant_CoexTable(pBtCoexist, bForceExec, 0x55555555, 0xaaaa5a5a, 0xffffff, 0x3); break; case 5: halbtc8723b1ant_CoexTable(pBtCoexist, bForceExec, 0x5a5a5a5a, 0xaaaa5a5a, 0xffffff, 0x3); break; case 6: - halbtc8723b1ant_CoexTable(pBtCoexist, bForceExec, 0x55555555, 0xaaaa5a5a, 0xffffff, 0x3); + halbtc8723b1ant_CoexTable(pBtCoexist, bForceExec, 0x55555555, 0xaaaaaaaa, 0xffffff, 0x3); break; case 7: halbtc8723b1ant_CoexTable(pBtCoexist, bForceExec, 0xaaaaaaaa, 0xaaaaaaaa, 0xffffff, 0x3); @@ -994,54 +1135,6 @@ halbtc8723b1ant_IgnoreWlanAct( pCoexDm->bPreIgnoreWlanAct = pCoexDm->bCurIgnoreWlanAct; } -VOID -halbtc8723b1ant_SetFwPstdma( - IN PBTC_COEXIST pBtCoexist, - IN u1Byte byte1, - IN u1Byte byte2, - IN u1Byte byte3, - IN u1Byte byte4, - IN u1Byte byte5 - ) -{ - u1Byte H2C_Parameter[5] ={0}; - u1Byte realByte1=byte1, realByte5=byte5; - BOOLEAN bApEnable=FALSE; - - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable); - - if(bApEnable) - { - if(byte1&BIT4 && !(byte1&BIT5)) - { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], FW for 1Ant AP mode\n")); - realByte1 &= ~BIT4; - realByte1 |= BIT5; - - realByte5 |= BIT5; - realByte5 &= ~BIT6; - } - } - - H2C_Parameter[0] = realByte1; - H2C_Parameter[1] = byte2; - H2C_Parameter[2] = byte3; - H2C_Parameter[3] = byte4; - H2C_Parameter[4] = realByte5; - - pCoexDm->psTdmaPara[0] = realByte1; - pCoexDm->psTdmaPara[1] = byte2; - pCoexDm->psTdmaPara[2] = byte3; - pCoexDm->psTdmaPara[3] = byte4; - pCoexDm->psTdmaPara[4] = realByte5; - - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], PS-TDMA H2C cmd =0x%x%08x\n", - H2C_Parameter[0], - H2C_Parameter[1]<<24|H2C_Parameter[2]<<16|H2C_Parameter[3]<<8|H2C_Parameter[4])); - - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x60, 5, H2C_Parameter); -} - VOID halbtc8723b1ant_SetLpsRpwm( IN PBTC_COEXIST pBtCoexist, @@ -1107,44 +1200,71 @@ VOID halbtc8723b1ant_SetAntPath( IN PBTC_COEXIST pBtCoexist, IN u1Byte antPosType, + IN BOOLEAN bForceExec, IN BOOLEAN bInitHwCfg, IN BOOLEAN bWifiOff ) { PBTC_BOARD_INFO pBoardInfo=&pBtCoexist->boardInfo; - u4Byte fwVer=0, u4Tmp=0; + u4Byte fwVer=0, u4Tmp=0, cntBtCalChk=0; BOOLEAN bPgExtSwitch=FALSE; BOOLEAN bUseExtSwitch=FALSE; - u1Byte H2C_Parameter[2] ={0}; - PADAPTER padapter=pBtCoexist->Adapter; + BOOLEAN bIsInMpMode = FALSE; + u1Byte H2C_Parameter[2] ={0}, u1Tmp = 0; + + pCoexDm->curAntPosType = antPosType; + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_EXT_SWITCH, &bPgExtSwitch); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_FW_VER, &fwVer); // [31:16]=fw ver, [15:0]=fw sub ver - - if((fwVer<0xc0000) || bPgExtSwitch) + if((fwVer>0 && fwVer<0xc0000) || bPgExtSwitch) bUseExtSwitch = TRUE; if(bInitHwCfg) { - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x67, 0x20, 0x1); //BT select s0/s1 is controlled by WiFi - - //Force GNT_BT to Normal - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x765, 0x18, 0x0); + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x780); //WiFi TRx Mask on + //remove due to interrupt is disabled that polling c2h will fail and delay 100ms. + //pBtCoexist->fBtcSetBtReg(pBtCoexist, BTC_BT_REG_RF, 0x3c, 0x15); //BT TRx Mask on + if(fwVer >= 0x180000) + { + /* Use H2C to set GNT_BT to HIGH */ + H2C_Parameter[0] = 1; + pBtCoexist->fBtcFillH2c(pBtCoexist, 0x6E, 1, H2C_Parameter); + } + else + { + // set grant_bt to high + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x765, 0x18); + } //set wlan_act control by PTA - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0xc); + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0x4); + + pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x67, 0x20, 0x0); //BT select s0/s1 is controlled by BT - //pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0x4); + pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x39, 0x8, 0x1); + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x974, 0xff); + pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x944, 0x3, 0x3); + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x930, 0x77); } else if(bWifiOff) { - //Force GNT_BT to High - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x765, 0x18, 0x3); - + if(fwVer >= 0x180000) + { + /* Use H2C to set GNT_BT to HIGH */ + H2C_Parameter[0] = 1; + pBtCoexist->fBtcFillH2c(pBtCoexist, 0x6E, 1, H2C_Parameter); + } + else + { + // set grant_bt to high + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x765, 0x18); + } //set wlan_act to always low pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0x4); - if(padapter->registrypriv.mp_mode ==0) + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_IS_IN_MP_MODE, &bIsInMpMode); + if(!bIsInMpMode) pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x67, 0x20, 0x0); //BT select s0/s1 is controlled by BT else pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x67, 0x20, 0x1); //BT select s0/s1 is controlled by WiFi @@ -1155,6 +1275,48 @@ halbtc8723b1ant_SetAntPath( u4Tmp &= ~BIT24; pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x4c, u4Tmp); } + else + { + /* Use H2C to set GNT_BT to LOW */ + if(fwVer >= 0x180000) + { + if (pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x765) != 0) + { + H2C_Parameter[0] = 0; + pBtCoexist->fBtcFillH2c(pBtCoexist, 0x6E, 1, H2C_Parameter); + } + } + else + { + // BT calibration check + while(cntBtCalChk <= 20) + { + u1Tmp = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x49d); + cntBtCalChk++; + if(u1Tmp & BIT0) + { + BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], ########### BT is calibrating (wait cnt=%d) ###########\n", cntBtCalChk)); + delay_ms(50); + } + else + { + BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], ********** BT is NOT calibrating (wait cnt=%d)**********\n", cntBtCalChk)); + break; + } + } + + // set grant_bt to PTA + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x765, 0x0); + } + + if (pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x76e) != 0xc) + { + //set wlan_act control by PTA + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0xc); + } + + pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x67, 0x20, 0x1); //BT select s0/s1 is controlled by WiFi + } if(bUseExtSwitch) { @@ -1166,10 +1328,10 @@ halbtc8723b1ant_SetAntPath( u4Tmp |= BIT24; pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x4c, u4Tmp); + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x0); // fixed internal switch S1->WiFi, S0->BT + if(pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) { - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x64, 0x1, 0x1); //Main Ant to BT for IPS case 0x4c[23]=1 - //tell firmware "no antenna inverse" H2C_Parameter[0] = 0; H2C_Parameter[1] = 1; //ext switch type @@ -1177,8 +1339,6 @@ halbtc8723b1ant_SetAntPath( } else { - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x64, 0x1, 0x0); //Aux Ant to BT for IPS case 0x4c[23]=1 - //tell firmware "antenna inverse" H2C_Parameter[0] = 1; H2C_Parameter[1] = 1; //ext switch type @@ -1186,36 +1346,32 @@ halbtc8723b1ant_SetAntPath( } } - // fixed internal switch first - if(pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) - pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x948, 0x0); // fixed internal switch S1->WiFi, S0->BT - else - pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x948, 0x280); // fixed internal switch S0->WiFi, S1->BT - - // ext switch setting - switch(antPosType) + if(bForceExec || (pCoexDm->curAntPosType != pCoexDm->preAntPosType)) { - case BTC_ANT_PATH_WIFI: - if(pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x1); - else - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x2); - break; - case BTC_ANT_PATH_BT: - if(pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x2); - else - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x1); - break; - default: - case BTC_ANT_PATH_PTA: - if(pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x1); - else - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x2); - break; + // ext switch setting + switch(antPosType) + { + case BTC_ANT_PATH_WIFI: + if(pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) + pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x1); + else + pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x2); + break; + case BTC_ANT_PATH_BT: + if(pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) + pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x2); + else + pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x1); + break; + default: + case BTC_ANT_PATH_PTA: + if(pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) + pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x1); + else + pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x2); + break; + } } - } else { @@ -1227,9 +1383,11 @@ halbtc8723b1ant_SetAntPath( u4Tmp &=~BIT24; pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x4c, u4Tmp); + //Fix Ext switch Main->S1, Aux->S0 + pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x64, 0x1, 0x0); + if(pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) { - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x64, 0x1, 0x0); //Main Ant to WiFi for IPS case 0x4c[23]=1 //tell firmware "no antenna inverse" H2C_Parameter[0] = 0; @@ -1238,7 +1396,6 @@ halbtc8723b1ant_SetAntPath( } else { - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x64, 0x1, 0x1); //Aux Ant to BT for IPS case 0x4c[23]=1 //tell firmware "antenna inverse" H2C_Parameter[0] = 1; @@ -1247,110 +1404,217 @@ halbtc8723b1ant_SetAntPath( } } - // fixed external switch first - if(pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x1); //Main->WiFi, Aux->BT - else - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x2); //Main->BT, Aux->WiFi - - // internal switch setting - switch(antPosType) + if(bForceExec || (pCoexDm->curAntPosType != pCoexDm->preAntPosType)) { - case BTC_ANT_PATH_WIFI: - if(pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) - pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x948, 0x0); - else - pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x948, 0x280); - break; - case BTC_ANT_PATH_BT: - if(pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) - pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x948, 0x280); - else - pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x948, 0x0); - break; - default: - case BTC_ANT_PATH_PTA: - if(pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) - pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x948, 0x200); - else - pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x948, 0x80); - break; + // internal switch setting + switch(antPosType) + { + case BTC_ANT_PATH_WIFI: + if(pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x0); + else + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x280); + break; + case BTC_ANT_PATH_BT: + if(pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x280); + else + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x0); + break; + default: + case BTC_ANT_PATH_PTA: + if(pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x200); + else + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x80); + break; + } } } + + pCoexDm->preAntPosType = pCoexDm->curAntPosType; } VOID -halbtc8723b1ant_PsTdma( +halbtc8723b1ant_SetAntPathDCut( IN PBTC_COEXIST pBtCoexist, - IN BOOLEAN bForceExec, - IN BOOLEAN bTurnOn, - IN u1Byte type + IN BOOLEAN bAntennaAux, //For 1-Ant--> 1: Antenna at S0, 0: Antenna at S1. Set 0 for 2-Ant + IN BOOLEAN bExtSwitch, // 1: Ext Switch (SPDT) exist on module, 0: no Ext Switch (SPDT) exist on module + IN BOOLEAN bTwoAntenna, // 1: 2-Antenna, 0:1-Antenna + IN u1Byte antennaPos, //Set Antenna Pos, For 1-Ant: BTC_ANT_PATH_WIFI, BTC_ANT_PATH_BT, BTC_ANT_PATH_PTA, For 2-Ant:BTC_ANT_WIFI_AT_MAIN, BTC_ANT_WIFI_AT_Aux + IN u1Byte wifiState //BTC_WIFI_STAT_INIT, BTC_WIFI_STAT_IQK, BTC_WIFI_STAT_NORMAL_OFF, BTC_WIFI_STAT_MP_OFF, BTC_WIFI_STAT_NORMAL, BTC_WIFI_STAT_ANT_DIV ) { - PBTC_BOARD_INFO pBoardInfo=&pBtCoexist->boardInfo; - BOOLEAN bTurnOnByCnt=FALSE, bWifiBusy=FALSE; - u1Byte psTdmaTypeByCnt=0, rssiAdjustVal=0; - //u4Byte fwVer=0; + u1Byte dataLen=5; + u1Byte buf[6] = {0}; - //BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], %s turn %s PS TDMA, type=%d\n", - // (bForceExec? "force to":""), (bTurnOn? "ON":"OFF"), type)); - pCoexDm->bCurPsTdmaOn = bTurnOn; - pCoexDm->curPsTdma = type; + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], set BT Ant, bAntennaAux/bExtSwitch/bTwoAntenna/antennaPos/wifiState=%d/%d/%d/%d/%d\n", + bAntennaAux, bExtSwitch, bTwoAntenna, antennaPos, wifiState)); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); + buf[0] = dataLen; + + if(bAntennaAux) + buf[1] = 0x1; + + if(bExtSwitch) + buf[2] = 0x1; + + if(bTwoAntenna) + buf[3] = 0x1; - if(!bForceExec) + buf[4] = antennaPos; + + buf[5] = wifiState; + + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_CTRL_8723B_ANT, (PVOID)&buf[0]); +} + +VOID +halbtc8723b1ant_SetFwPstdma( + IN PBTC_COEXIST pBtCoexist, + IN u1Byte byte1, + IN u1Byte byte2, + IN u1Byte byte3, + IN u1Byte byte4, + IN u1Byte byte5 + ) +{ + u1Byte H2C_Parameter[5] ={0}; + u1Byte realByte1=byte1, realByte5=byte5; + BOOLEAN bApEnable=FALSE; + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable); + + if(bApEnable) { - if (pCoexDm->bCurPsTdmaOn) - { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], ********** TDMA(on, %d) **********\n", - pCoexDm->curPsTdma)); - } - else - { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], ********** TDMA(off, %d) **********\n", - pCoexDm->curPsTdma)); - } - + if(byte1&BIT4 && !(byte1&BIT5)) + { + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], FW for 1Ant AP mode\n")); + realByte1 &= ~BIT4; + realByte1 |= BIT5; - if( (pCoexDm->bPrePsTdmaOn == pCoexDm->bCurPsTdmaOn) && - (pCoexDm->prePsTdma == pCoexDm->curPsTdma) ) - return; + realByte5 |= BIT5; + realByte5 &= ~BIT6; + } } - if(bTurnOn) - { - switch(type) + + H2C_Parameter[0] = realByte1; + H2C_Parameter[1] = byte2; + H2C_Parameter[2] = byte3; + H2C_Parameter[3] = byte4; + H2C_Parameter[4] = realByte5; + + pCoexDm->psTdmaPara[0] = realByte1; + pCoexDm->psTdmaPara[1] = byte2; + pCoexDm->psTdmaPara[2] = byte3; + pCoexDm->psTdmaPara[3] = byte4; + pCoexDm->psTdmaPara[4] = realByte5; + + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], PS-TDMA H2C cmd =0x%x%08x\n", + H2C_Parameter[0], + H2C_Parameter[1]<<24|H2C_Parameter[2]<<16|H2C_Parameter[3]<<8|H2C_Parameter[4])); + + pBtCoexist->fBtcFillH2c(pBtCoexist, 0x60, 5, H2C_Parameter); +} + + +VOID +halbtc8723b1ant_PsTdma( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bForceExec, + IN BOOLEAN bTurnOn, + IN u1Byte type + ) +{ + PBTC_BOARD_INFO pBoardInfo=&pBtCoexist->boardInfo; + PBTC_BT_LINK_INFO pBtLinkInfo=&pBtCoexist->btLinkInfo; + BOOLEAN bTurnOnByCnt=FALSE, bWifiBusy=FALSE, bWiFiNoisy=FALSE; + u1Byte psTdmaTypeByCnt=0, rssiAdjustVal=0; + u1Byte psTdmaByte4Val = 0x50, psTdmaByte0Val = 0x51, psTdmaByte3Val = 0x10; + s1Byte nWiFiDurationAdjust = 0x0; + static BOOLEAN bPreWifiBusy=FALSE; + + //BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], %s turn %s PS TDMA, type=%d\n", + // (bForceExec? "force to":""), (bTurnOn? "ON":"OFF"), type)); + pCoexDm->bCurPsTdmaOn = bTurnOn; + pCoexDm->curPsTdma = type; + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); + + if (bWifiBusy != bPreWifiBusy) + { + bForceExec = TRUE; + bPreWifiBusy = bWifiBusy; + } + + if (pCoexDm->bCurPsTdmaOn) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], ********** TDMA(on, %d) **********\n", + pCoexDm->curPsTdma)); + } + else + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], ********** TDMA(off, %d) **********\n", + pCoexDm->curPsTdma)); + } + + if(!bForceExec) + { + if( (pCoexDm->bPrePsTdmaOn == pCoexDm->bCurPsTdmaOn) && + (pCoexDm->prePsTdma == pCoexDm->curPsTdma) ) + return; + } + + if (pCoexSta->nScanAPNum <= 5) + nWiFiDurationAdjust = 5; + //nWiFiDurationAdjust = 2; + else if (pCoexSta->nScanAPNum >= 40) + nWiFiDurationAdjust = -15; + else if (pCoexSta->nScanAPNum >= 20) + nWiFiDurationAdjust = -10; + + if (!pCoexSta->bForceLpsOn) //only for A2DP-only case 1/2/9/11 while wifi noisy threshold > 30 + { + psTdmaByte0Val = 0x61; //no null-pkt + psTdmaByte3Val = 0x11; // no tx-pause at BT-slot + psTdmaByte4Val = 0x10; // 0x778 = d/1 toggle + } + + if ( (type == 3) || (type == 13) || (type == 14) ) + { + psTdmaByte4Val = psTdmaByte4Val & 0xbf; //no dynamic slot for multi-profile + + if (!bWifiBusy) + psTdmaByte4Val = psTdmaByte4Val | 0x1; //0x778 = 0x1 at wifi slot (no blocking BT Low-Pri pkts) + } + + if (pBtLinkInfo->bSlaveRole == TRUE) + psTdmaByte4Val = psTdmaByte4Val | 0x1; //0x778 = 0x1 at wifi slot (no blocking BT Low-Pri pkts) + + if(bTurnOn) + { + switch(type) { default: - halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x51, 0x1a, 0x1a, 0x0, 0x50); + halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x51, 0x1a, 0x1a, 0x0, psTdmaByte4Val); break; case 1: - //if(bWifiBusy) - halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x51, 0x3a, 0x03, 0x10, 0x50); - //else - // halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x51, 0x3a, 0x03, 0x10, 0x51); - - rssiAdjustVal = 11; + halbtc8723b1ant_SetFwPstdma(pBtCoexist, psTdmaByte0Val, 0x3a+nWiFiDurationAdjust, 0x03, psTdmaByte3Val, psTdmaByte4Val); break; case 2: - //if(bWifiBusy) - halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x51, 0x2b, 0x03, 0x10, 0x50); - //else - // halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x51, 0x2b, 0x03, 0x10, 0x51); - rssiAdjustVal = 14; + halbtc8723b1ant_SetFwPstdma(pBtCoexist, psTdmaByte0Val, 0x2d+nWiFiDurationAdjust, 0x03, psTdmaByte3Val, psTdmaByte4Val); break; case 3: - halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x51, 0x1d, 0x1d, 0x0, 0x52); + halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x51, 0x1d, 0x1d, 0x0, psTdmaByte4Val); break; case 4: halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x93, 0x15, 0x3, 0x14, 0x0); - rssiAdjustVal = 17; break; case 5: - halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x61, 0x15, 0x3, 0x11, 0x10); + halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x61, 0x15, 0x3, 0x11, 0x11); break; case 6: - halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x61, 0x20, 0x3, 0x11, 0x13); + halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x61, 0x20, 0x3, 0x11, 0x11); break; case 7: halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x13, 0xc, 0x5, 0x0, 0x0); @@ -1359,44 +1623,34 @@ halbtc8723b1ant_PsTdma( halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x93, 0x25, 0x3, 0x10, 0x0); break; case 9: - //if(bWifiBusy) - halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x51, 0x21, 0x3, 0x10, 0x50); - //else - // halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x51, 0x21, 0x3, 0x10, 0x50); - rssiAdjustVal = 18; + halbtc8723b1ant_SetFwPstdma(pBtCoexist, psTdmaByte0Val, 0x21, 0x3, psTdmaByte3Val, psTdmaByte4Val); break; case 10: halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x13, 0xa, 0xa, 0x0, 0x40); break; case 11: - //if(bWifiBusy) - halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x51, 0x15, 0x03, 0x10, 0x50); - //else - // halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x51, 0x15, 0x03, 0x10, 0x50); - rssiAdjustVal = 20; + halbtc8723b1ant_SetFwPstdma(pBtCoexist, psTdmaByte0Val, 0x21, 0x03, psTdmaByte3Val, psTdmaByte4Val); break; case 12: halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x51, 0x0a, 0x0a, 0x0, 0x50); break; case 13: - halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x51, 0x15, 0x15, 0x0, 0x50); + halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x51, 0x12, 0x12, 0x0, psTdmaByte4Val); break; case 14: - halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x51, 0x21, 0x3, 0x10, 0x52); + halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x51, 0x21, 0x3, 0x10, psTdmaByte4Val); break; case 15: halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x13, 0xa, 0x3, 0x8, 0x0); break; case 16: halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x93, 0x15, 0x3, 0x10, 0x0); - rssiAdjustVal = 18; break; case 18: halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x93, 0x25, 0x3, 0x10, 0x0); - rssiAdjustVal = 14; break; case 20: - halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x61, 0x35, 0x03, 0x11, 0x10); + halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x61, 0x3f, 0x03, 0x11, 0x10); break; case 21: halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x61, 0x25, 0x03, 0x11, 0x11); @@ -1406,23 +1660,18 @@ halbtc8723b1ant_PsTdma( break; case 23: halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0xe3, 0x25, 0x3, 0x31, 0x18); - rssiAdjustVal = 22; break; case 24: halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0xe3, 0x15, 0x3, 0x31, 0x18); - rssiAdjustVal = 22; break; case 25: halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0xe3, 0xa, 0x3, 0x31, 0x18); - rssiAdjustVal = 22; break; case 26: halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0xe3, 0xa, 0x3, 0x31, 0x18); - rssiAdjustVal = 22; break; case 27: halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0xe3, 0x25, 0x3, 0x31, 0x98); - rssiAdjustVal = 22; break; case 28: halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x69, 0x25, 0x3, 0x31, 0x0); @@ -1431,13 +1680,13 @@ halbtc8723b1ant_PsTdma( halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0xab, 0x1a, 0x1a, 0x1, 0x10); break; case 30: - halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x51, 0x14, 0x3, 0x10, 0x50); + halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x51, 0x30, 0x3, 0x10, 0x10); break; case 31: halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0xd3, 0x1a, 0x1a, 0, 0x58); break; case 32: - halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x61, 0xa, 0x3, 0x10, 0x0); + halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x61, 0x35, 0x3, 0x11, 0x11); break; case 33: halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0xa3, 0x25, 0x3, 0x30, 0x90); @@ -1459,46 +1708,42 @@ halbtc8723b1ant_PsTdma( } else { - //pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_FW_VER, &fwVer); // [31:16]=fw ver, [15:0]=fw sub ver // disable PS tdma switch(type) { case 8: //PTA Control halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x8, 0x0, 0x0, 0x0, 0x0); - halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_PTA, FALSE, FALSE); + //halbtc8723b1ant_SetAntPathDCut(pBtCoexist, FALSE, FALSE, FALSE, BTC_ANT_PATH_PTA, BTC_WIFI_STAT_NORMAL); + //halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_PTA, FALSE, FALSE); break; case 0: default: //Software control, Antenna at BT side halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x0, 0x0, 0x0, 0x0, 0x0); - halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, FALSE, FALSE); + //halbtc8723b1ant_SetAntPathDCut(pBtCoexist, FALSE, FALSE, FALSE, BTC_ANT_PATH_BT, BTC_WIFI_STAT_NORMAL); + //halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, FALSE, FALSE); break; +#if 0 case 9: //Software control, Antenna at WiFi side halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x0, 0x0, 0x0, 0x0, 0x0); + //halbtc8723b1ant_SetAntPathDCut(pBtCoexist, FALSE, FALSE, FALSE, BTC_ANT_PATH_WIFI, BTC_WIFI_STAT_NORMAL); halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_WIFI, FALSE, FALSE); break; +#endif } } rssiAdjustVal =0; pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_U1_RSSI_ADJ_VAL_FOR_1ANT_COEX_TYPE, &rssiAdjustVal); + + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("############# [BTCoex], 0x948=0x%x, 0x765=0x%x, 0x67=0x%x\n", + pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x948), pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x765), pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x67))); + // update pre state pCoexDm->bPrePsTdmaOn = pCoexDm->bCurPsTdmaOn; pCoexDm->prePsTdma = pCoexDm->curPsTdma; } -VOID -halbtc8723b1ant_CoexAllOff( - IN PBTC_COEXIST pBtCoexist - ) -{ - // sw all off - halbtc8723b1ant_SwMechanism(pBtCoexist, FALSE); - - // hw all off - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); -} - BOOLEAN halbtc8723b1ant_IsCommonAction( IN PBTC_COEXIST pBtCoexist @@ -1514,7 +1759,7 @@ halbtc8723b1ant_IsCommonAction( { BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi non connected-idle + BT non connected-idle!!\n")); - halbtc8723b1ant_SwMechanism(pBtCoexist, FALSE); + //halbtc8723b1ant_SwMechanism(pBtCoexist, FALSE); bCommon = TRUE; } @@ -1523,7 +1768,7 @@ halbtc8723b1ant_IsCommonAction( { BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi connected + BT non connected-idle!!\n")); - halbtc8723b1ant_SwMechanism(pBtCoexist, FALSE); + //halbtc8723b1ant_SwMechanism(pBtCoexist, FALSE); bCommon = TRUE; } @@ -1532,7 +1777,7 @@ halbtc8723b1ant_IsCommonAction( { BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi non connected-idle + BT connected-idle!!\n")); - halbtc8723b1ant_SwMechanism(pBtCoexist, FALSE); + //halbtc8723b1ant_SwMechanism(pBtCoexist, FALSE); bCommon = TRUE; } @@ -1541,7 +1786,7 @@ halbtc8723b1ant_IsCommonAction( { BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi connected + BT connected-idle!!\n")); - halbtc8723b1ant_SwMechanism(pBtCoexist, FALSE); + //halbtc8723b1ant_SwMechanism(pBtCoexist, FALSE); bCommon = TRUE; } @@ -1550,7 +1795,7 @@ halbtc8723b1ant_IsCommonAction( { BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi non connected-idle + BT Busy!!\n")); - halbtc8723b1ant_SwMechanism(pBtCoexist, FALSE); + //halbtc8723b1ant_SwMechanism(pBtCoexist, FALSE); bCommon = TRUE; } @@ -1636,6 +1881,10 @@ halbtc8723b1ant_TdmaDurationAdjustForAcl( //BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], retryCount = %d\n", retryCount)); //BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], up=%d, dn=%d, m=%d, n=%d, WaitCount=%d\n", // up, dn, m, n, WaitCount)); + + if ( (pCoexSta->lowPriorityTx) > 1150 || (pCoexSta->lowPriorityRx) > 1250 ) + retryCount++; + result = 0; WaitCount++; @@ -1793,7 +2042,7 @@ halbtc8723b1ant_PsTdmaCheckForPowerSaveState( else { // will leave LPS state, turn off psTdma first - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 0); + halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 8); } } else // NO PS state @@ -1801,7 +2050,7 @@ halbtc8723b1ant_PsTdmaCheckForPowerSaveState( if(bNewPsState) { // will enter LPS state, turn off psTdma first - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 0); + halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 8); } else { @@ -1827,6 +2076,7 @@ halbtc8723b1ant_PowerSaveState( bLowPwrDisable = FALSE; pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_NORMAL_LPS, NULL); + pCoexSta->bForceLpsOn = FALSE; break; case BTC_PS_LPS_ON: halbtc8723b1ant_PsTdmaCheckForPowerSaveState(pBtCoexist, TRUE); @@ -1836,10 +2086,12 @@ halbtc8723b1ant_PowerSaveState( pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); // power save must executed before psTdma. pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_ENTER_LPS, NULL); + pCoexSta->bForceLpsOn = TRUE; break; case BTC_PS_LPS_OFF: halbtc8723b1ant_PsTdmaCheckForPowerSaveState(pBtCoexist, FALSE); pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_LEAVE_LPS, NULL); + pCoexSta->bForceLpsOn = FALSE; break; default: break; @@ -1851,8 +2103,9 @@ halbtc8723b1ant_ActionWifiOnly( IN PBTC_COEXIST pBtCoexist ) { - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 9); + halbtc8723b1ant_CoexTableWithType(pBtCoexist, FORCE_EXEC, 0); + halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, FALSE, 8); + halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_PTA, FORCE_EXEC, FALSE, FALSE); } VOID @@ -1924,6 +2177,8 @@ halbtc8723b1ant_MonitorBtEnableDisable( //============================================= // SCO only or SCO+PAN(HS) + +/* VOID halbtc8723b1ant_ActionSco( IN PBTC_COEXIST pBtCoexist @@ -2009,11 +2264,25 @@ halbtc8723b1ant_ActionHidA2dp( halbtc8723b1ant_SwMechanism(pBtCoexist, TRUE); } +*/ + //============================================= // // Non-Software Coex Mechanism start // //============================================= +VOID +halbtc8723b1ant_ActionBtWhckTest( + IN PBTC_COEXIST pBtCoexist + ) +{ + halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + + halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 8); + halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_PTA, NORMAL_EXEC, FALSE, FALSE); + halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); +} + VOID halbtc8723b1ant_ActionWifiMultiPort( IN PBTC_COEXIST pBtCoexist @@ -2022,6 +2291,7 @@ halbtc8723b1ant_ActionWifiMultiPort( halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 8); + halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_PTA, NORMAL_EXEC, FALSE, FALSE); halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); } @@ -2040,33 +2310,49 @@ halbtc8723b1ant_ActionBtInquiry( ) { PBTC_BT_LINK_INFO pBtLinkInfo=&pBtCoexist->btLinkInfo; - BOOLEAN bWifiConnected=FALSE, bApEnable=FALSE; + BOOLEAN bWifiConnected=FALSE, bApEnable=FALSE, bWifiBusy=FALSE, bBtBusy=FALSE; pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_TRAFFIC_BUSY, &bBtBusy); - if(!bWifiConnected) + if ( (!bWifiConnected) && (!pCoexSta->bWiFiIsHighPriTask) ) { halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 8); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); + halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_PTA, NORMAL_EXEC, FALSE, FALSE); + halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); } - else if( (pBtLinkInfo->bScoExist) || - (pBtLinkInfo->bHidOnly) ) + else if( (pBtLinkInfo->bScoExist) || (pBtLinkInfo->bHidExist) || (pBtLinkInfo->bA2dpExist) ) { - // SCO/HID-only busy + // SCO/HID/A2DP busy halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 32); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); + + halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + } + else if ( (pBtLinkInfo->bPanExist) || (bWifiBusy) ) + { + halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + + //for BT inquiry/page fail after S4 resume + //halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 20); + halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 32); + + halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); } else { - if(bApEnable) - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); - else - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_LPS_ON, 0x50, 0x4); - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 30); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); + halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + + halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 8); + halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_PTA, NORMAL_EXEC, FALSE, FALSE); + halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); + + + //halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 32); + //halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); } } @@ -2087,35 +2373,13 @@ halbtc8723b1ant_ActionBtScoHidOnlyBusy( if(pBtLinkInfo->bScoExist) { halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 5); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); + halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 5); } else //HID { halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 6); halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 5); } -/* - if(pBtLinkInfo->bScoExist || pBtLinkInfo->bHidExist) - { - if(bWifiConnected) - { - wifiRssiState = halbtc8723b1ant_WifiRssiState(pBtCoexist, 0, 2, 30, 0); - if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || - (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) - { - halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 2, 1, 1, 1); - } - else - { - halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 1, 1, 1, 1); - } - } - else - { - halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0); - } - } -*/ } VOID @@ -2129,6 +2393,15 @@ halbtc8723b1ant_ActionWifiConnectedBtAclBusy( PBTC_BT_LINK_INFO pBtLinkInfo=&pBtCoexist->btLinkInfo; btRssiState = halbtc8723b1ant_BtRssiState(2, 28, 0); + if ( (pCoexSta->lowPriorityRx >= 950) && (!pCoexSta->bUnderIps) ) + { + pBtLinkInfo->bSlaveRole = TRUE; + } + else + { + pBtLinkInfo->bSlaveRole = FALSE; + } + if(pBtLinkInfo->bHidOnly) //HID { halbtc8723b1ant_ActionBtScoHidOnlyBusy(pBtCoexist, wifiStatus); @@ -2139,56 +2412,42 @@ halbtc8723b1ant_ActionWifiConnectedBtAclBusy( { if(BT_8723B_1ANT_WIFI_STATUS_CONNECTED_IDLE == wifiStatus) { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 8); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); + halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 32); + halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); pCoexDm->bAutoTdmaAdjust = FALSE; } - else if( (btRssiState == BTC_RSSI_STATE_HIGH) || - (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + else { halbtc8723b1ant_TdmaDurationAdjustForAcl(pBtCoexist, wifiStatus); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); - } - else //for low BT RSSI - { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 11); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); - pCoexDm->bAutoTdmaAdjust = FALSE; + halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + pCoexDm->bAutoTdmaAdjust = TRUE; } } + else if ( ((pBtLinkInfo->bA2dpExist) && (pBtLinkInfo->bPanExist)) || + (pBtLinkInfo->bHidExist&&pBtLinkInfo->bA2dpExist&&pBtLinkInfo->bPanExist) ) //A2DP+PAN(OPP,FTP), HID+A2DP+PAN(OPP,FTP) + { + halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 13); + halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + pCoexDm->bAutoTdmaAdjust = FALSE; + } else if(pBtLinkInfo->bHidExist&&pBtLinkInfo->bA2dpExist) //HID+A2DP { - if( (btRssiState == BTC_RSSI_STATE_HIGH) || - (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) - { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 14); - pCoexDm->bAutoTdmaAdjust = FALSE; - } - else //for low BT RSSI - { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 14); - pCoexDm->bAutoTdmaAdjust = FALSE; - } + halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 14); + pCoexDm->bAutoTdmaAdjust = FALSE; - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 6); + halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 3); } else if( (pBtLinkInfo->bPanOnly) || (pBtLinkInfo->bHidExist&&pBtLinkInfo->bPanExist) ) //PAN(OPP,FTP), HID+PAN(OPP,FTP) { halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 3); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 6); - pCoexDm->bAutoTdmaAdjust = FALSE; - } - else if ( ((pBtLinkInfo->bA2dpExist) && (pBtLinkInfo->bPanExist)) || - (pBtLinkInfo->bHidExist&&pBtLinkInfo->bA2dpExist&&pBtLinkInfo->bPanExist) ) //A2DP+PAN(OPP,FTP), HID+A2DP+PAN(OPP,FTP) - { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 13); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); + halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); pCoexDm->bAutoTdmaAdjust = FALSE; } else { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 11); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); + //BT no-profile busy (0x9) + halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 32); + halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); pCoexDm->bAutoTdmaAdjust = FALSE; } } @@ -2202,7 +2461,8 @@ halbtc8723b1ant_ActionWifiNotConnected( halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); // tdma and coex table - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 8); + halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, FALSE, 8); + halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_PTA, NORMAL_EXEC, FALSE, FALSE); halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); } @@ -2218,20 +2478,20 @@ halbtc8723b1ant_ActionWifiNotConnectedScan( // tdma and coex table if(BT_8723B_1ANT_BT_STATUS_ACL_BUSY == pCoexDm->btStatus) { - if(pBtLinkInfo->bA2dpExist && pBtLinkInfo->bPanExist) - { + if (pBtLinkInfo->bA2dpExist) + { + halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 32); + halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + } + else if (pBtLinkInfo->bA2dpExist && pBtLinkInfo->bPanExist) + { halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 22); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); - } - else if(pBtLinkInfo->bPanOnly) - { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 20); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); - } + halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + } else { halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 20); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); + halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); } } else if( (BT_8723B_1ANT_BT_STATUS_SCO_BUSY == pCoexDm->btStatus) || @@ -2242,11 +2502,9 @@ halbtc8723b1ant_ActionWifiNotConnectedScan( } else { - //halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 20); - //halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); - //Bryant Add halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 8); + halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_PTA, NORMAL_EXEC, FALSE, FALSE); halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); } } @@ -2260,22 +2518,23 @@ halbtc8723b1ant_ActionWifiNotConnectedAssoAuth( halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); - - if( (BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE == pCoexDm->btStatus) ||(pBtLinkInfo->bScoExist) - || (pBtLinkInfo->bHidOnly) || (pBtLinkInfo->bA2dpOnly) || (pBtLinkInfo->bPanOnly) ) + // tdma and coex table + if( (pBtLinkInfo->bScoExist) || (pBtLinkInfo->bHidExist) || (pBtLinkInfo->bA2dpExist) ) { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 8); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); - //delay_ms(50); - //pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cd, 0x10); - //pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cf, 0x10); + halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 32); + halbtc8723b1ant_CoexTableWithType(pBtCoexist, FORCE_EXEC, 4); } - else + else if (pBtLinkInfo->bPanExist) { halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 20); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); + halbtc8723b1ant_CoexTableWithType(pBtCoexist, FORCE_EXEC, 4); + } + else + { + halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 8); + halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_PTA, NORMAL_EXEC, FALSE, FALSE); + halbtc8723b1ant_CoexTableWithType(pBtCoexist, FORCE_EXEC, 2); } - } VOID @@ -2290,20 +2549,20 @@ halbtc8723b1ant_ActionWifiConnectedScan( // tdma and coex table if(BT_8723B_1ANT_BT_STATUS_ACL_BUSY == pCoexDm->btStatus) { - if(pBtLinkInfo->bA2dpExist && pBtLinkInfo->bPanExist) - { + if (pBtLinkInfo->bA2dpExist) + { + halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 32); + halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + } + else if (pBtLinkInfo->bA2dpExist && pBtLinkInfo->bPanExist) + { halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 22); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); - } - else if(pBtLinkInfo->bPanOnly) - { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 20); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); - } + halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + } else { halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 20); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); + halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); } } else if( (BT_8723B_1ANT_BT_STATUS_SCO_BUSY == pCoexDm->btStatus) || @@ -2314,11 +2573,9 @@ halbtc8723b1ant_ActionWifiConnectedScan( } else { - //halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 20); - //halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); - //Bryant Add halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 8); + halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_PTA, NORMAL_EXEC, FALSE, FALSE); halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); } } @@ -2328,28 +2585,26 @@ halbtc8723b1ant_ActionWifiConnectedSpecialPacket( IN PBTC_COEXIST pBtCoexist ) { - BOOLEAN bHsConnecting=FALSE; PBTC_BT_LINK_INFO pBtLinkInfo=&pBtCoexist->btLinkInfo; - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_CONNECTING, &bHsConnecting); - - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); // tdma and coex table - if( (BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE == pCoexDm->btStatus) ||(pBtLinkInfo->bScoExist) - || (pBtLinkInfo->bHidOnly) || (pBtLinkInfo->bA2dpOnly) || (pBtLinkInfo->bPanOnly) ) + if( (pBtLinkInfo->bScoExist) || (pBtLinkInfo->bHidExist) || (pBtLinkInfo->bA2dpExist) ) { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 8); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); - //delay_ms(50); - //pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cd, 0x10); - //pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cf, 0x10); + halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 32); + halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); } - else + else if(pBtLinkInfo->bPanExist) { halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 20); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); + halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + } + else + { + halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 8); + halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_PTA, NORMAL_EXEC, FALSE, FALSE); + halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); } } @@ -2388,11 +2643,28 @@ halbtc8723b1ant_ActionWifiConnected( pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); + // power save state if(!bApEnable && BT_8723B_1ANT_BT_STATUS_ACL_BUSY == pCoexDm->btStatus && !pBtCoexist->btLinkInfo.bHidOnly) { - if(!bWifiBusy && pBtCoexist->btLinkInfo.bA2dpOnly) //A2DP + if(pBtCoexist->btLinkInfo.bA2dpOnly) //A2DP + { + if(!bWifiBusy) + halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + else //busy + { + if (pCoexSta->nScanAPNum >= BT_8723B_1ANT_WIFI_NOISY_THRESH) //no force LPS, no PS-TDMA, use pure TDMA + { halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + } + else + { + halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_LPS_ON, 0x50, 0x4); + } + } + } + else if ((pCoexSta->bPanExist == FALSE) && (pCoexSta->bA2dpExist == FALSE) && (pCoexSta->bHidExist == FALSE)) + halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); else halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_LPS_ON, 0x50, 0x4); } @@ -2416,7 +2688,11 @@ halbtc8723b1ant_ActionWifiConnected( else { halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 8); + halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_PTA, NORMAL_EXEC, FALSE, FALSE); + if ( (pCoexSta->highPriorityTx) + (pCoexSta->highPriorityRx) <= 60 ) halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); + else + halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); } } else @@ -2435,7 +2711,11 @@ halbtc8723b1ant_ActionWifiConnected( else { halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 8); + halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_PTA, NORMAL_EXEC, FALSE, FALSE); + if ( (pCoexSta->highPriorityTx) + (pCoexSta->highPriorityRx) <= 60 ) halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); + else + halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); } } } @@ -2460,43 +2740,43 @@ halbtc8723b1ant_RunSwCoexistMechanism( { case BT_8723B_1ANT_COEX_ALGO_SCO: BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action algorithm = SCO.\n")); - halbtc8723b1ant_ActionSco(pBtCoexist); + //halbtc8723b1ant_ActionSco(pBtCoexist); break; case BT_8723B_1ANT_COEX_ALGO_HID: BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action algorithm = HID.\n")); - halbtc8723b1ant_ActionHid(pBtCoexist); + //halbtc8723b1ant_ActionHid(pBtCoexist); break; case BT_8723B_1ANT_COEX_ALGO_A2DP: BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action algorithm = A2DP.\n")); - halbtc8723b1ant_ActionA2dp(pBtCoexist); + //halbtc8723b1ant_ActionA2dp(pBtCoexist); break; case BT_8723B_1ANT_COEX_ALGO_A2DP_PANHS: BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action algorithm = A2DP+PAN(HS).\n")); - halbtc8723b1ant_ActionA2dpPanHs(pBtCoexist); + //halbtc8723b1ant_ActionA2dpPanHs(pBtCoexist); break; case BT_8723B_1ANT_COEX_ALGO_PANEDR: BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action algorithm = PAN(EDR).\n")); - halbtc8723b1ant_ActionPanEdr(pBtCoexist); + //halbtc8723b1ant_ActionPanEdr(pBtCoexist); break; case BT_8723B_1ANT_COEX_ALGO_PANHS: BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action algorithm = HS mode.\n")); - halbtc8723b1ant_ActionPanHs(pBtCoexist); + //halbtc8723b1ant_ActionPanHs(pBtCoexist); break; case BT_8723B_1ANT_COEX_ALGO_PANEDR_A2DP: BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action algorithm = PAN+A2DP.\n")); - halbtc8723b1ant_ActionPanEdrA2dp(pBtCoexist); + //halbtc8723b1ant_ActionPanEdrA2dp(pBtCoexist); break; case BT_8723B_1ANT_COEX_ALGO_PANEDR_HID: BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action algorithm = PAN(EDR)+HID.\n")); - halbtc8723b1ant_ActionPanEdrHid(pBtCoexist); + //halbtc8723b1ant_ActionPanEdrHid(pBtCoexist); break; case BT_8723B_1ANT_COEX_ALGO_HID_A2DP_PANEDR: BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action algorithm = HID+A2DP+PAN.\n")); - halbtc8723b1ant_ActionHidA2dpPanEdr(pBtCoexist); + //halbtc8723b1ant_ActionHidA2dpPanEdr(pBtCoexist); break; case BT_8723B_1ANT_COEX_ALGO_HID_A2DP: BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action algorithm = HID+A2DP.\n")); - halbtc8723b1ant_ActionHidA2dp(pBtCoexist); + //halbtc8723b1ant_ActionHidA2dp(pBtCoexist); break; default: BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action algorithm = coexist All Off!!\n")); @@ -2516,10 +2796,11 @@ halbtc8723b1ant_RunCoexistMechanism( BOOLEAN bWifiConnected=FALSE, bBtHsOn=FALSE; BOOLEAN bIncreaseScanDevNum=FALSE; BOOLEAN bBtCtrlAggBufSize=FALSE; + BOOLEAN bMiracastPlusBt=FALSE; u1Byte aggBufSize=5; u1Byte wifiRssiState=BTC_RSSI_STATE_HIGH; u4Byte wifiLinkStatus=0; - u4Byte numOfWifiLink=0; + u4Byte numOfWifiLink=0, wifiBw; BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], RunCoexistMechanism()===>\n")); @@ -2541,6 +2822,13 @@ halbtc8723b1ant_RunCoexistMechanism( return; } + if(pCoexSta->bBtWhckTest) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BT is under WHCK TEST!!!\n")); + halbtc8723b1ant_ActionBtWhckTest(pBtCoexist); + return; + } + if( (BT_8723B_1ANT_BT_STATUS_ACL_BUSY == pCoexDm->btStatus) || (BT_8723B_1ANT_BT_STATUS_SCO_BUSY == pCoexDm->btStatus) || (BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY == pCoexDm->btStatus) ) @@ -2553,62 +2841,79 @@ halbtc8723b1ant_RunCoexistMechanism( pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus); numOfWifiLink = wifiLinkStatus>>16; - if(numOfWifiLink >= 2) + + if((numOfWifiLink>=2) || (wifiLinkStatus&WIFI_P2P_GO_CONNECTED)) { + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("############# [BTCoex], Multi-Port numOfWifiLink = %d, wifiLinkStatus = 0x%x\n", numOfWifiLink,wifiLinkStatus) ); + + if(pBtLinkInfo->bBtLinkExist) + { + halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 1, 1, 0, 1); + bMiracastPlusBt = TRUE; + } + else + { halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0); + bMiracastPlusBt = FALSE; + } + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_MIRACAST_PLUS_BT, &bMiracastPlusBt); halbtc8723b1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, bBtCtrlAggBufSize, aggBufSize); + + if ( (pBtLinkInfo->bA2dpExist) && (pCoexSta->bC2hBtInquiryPage) ) + { + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("############# [BTCoex], BT Is Inquirying \n") ); + halbtc8723b1ant_ActionBtInquiry(pBtCoexist); + } + else halbtc8723b1ant_ActionWifiMultiPort(pBtCoexist); + return; } - - if(!pBtLinkInfo->bScoExist && !pBtLinkInfo->bHidExist) + else { - halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0); + bMiracastPlusBt = FALSE; + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_MIRACAST_PLUS_BT, &bMiracastPlusBt); } - else + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); + + if ( (pBtLinkInfo->bBtLinkExist) && (bWifiConnected) ) { - if(bWifiConnected) - { - wifiRssiState = halbtc8723b1ant_WifiRssiState(pBtCoexist, 1, 2, 30, 0); - if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || - (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) - { - halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 1, 1, 1, 1); - } - else - { - halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 1, 1, 1, 1); - } - } + halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 1, 1, 0, 1); + + if(pBtLinkInfo->bScoExist)//if (pBtLinkInfo->bBtHiPriLinkExist) + halbtc8723b1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, TRUE, FALSE, 0x5); + else + halbtc8723b1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x5); + /* + if(pBtLinkInfo->bScoExist) + halbtc8723b1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, TRUE, FALSE, 0x5); else { - halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0); + if (BTC_WIFI_BW_HT40==wifiBw) + halbtc8723b1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, TRUE, 0x10); + else + halbtc8723b1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, TRUE, 0x8); } + */ + halbtc8723b1ant_SwMechanism(pBtCoexist, TRUE); + halbtc8723b1ant_RunSwCoexistMechanism(pBtCoexist); //just print debug message } - - if(pBtLinkInfo->bScoExist) - { - bBtCtrlAggBufSize = TRUE; - aggBufSize = 0x3; - } - else if(pBtLinkInfo->bHidExist) - { - bBtCtrlAggBufSize = TRUE; - aggBufSize = 0x5; - } - else if(pBtLinkInfo->bA2dpExist || pBtLinkInfo->bPanExist) + else { - bBtCtrlAggBufSize = TRUE; - aggBufSize = 0x8; - } - halbtc8723b1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, bBtCtrlAggBufSize, aggBufSize); + halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0); + + halbtc8723b1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x5); - halbtc8723b1ant_RunSwCoexistMechanism(pBtCoexist); + halbtc8723b1ant_SwMechanism(pBtCoexist, FALSE); + halbtc8723b1ant_RunSwCoexistMechanism(pBtCoexist); ////just print debug message + } pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); if(pCoexSta->bC2hBtInquiryPage) { + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("############# [BTCoex], BT Is Inquirying \n") ); halbtc8723b1ant_ActionBtInquiry(pBtCoexist); return; } @@ -2645,6 +2950,59 @@ halbtc8723b1ant_RunCoexistMechanism( } } +u4Byte +halbtc8723b1ant_Log2Base( + IN PBTC_COEXIST pBtCoexist, + IN u4Byte val + + ) +{ + u1Byte i,j; + u4Byte tmp, tmp2, val_integerdB=0, tindex, shiftcount=0; + u4Byte result,val_fractiondB=0,Table_fraction[21]= {0,432, 332, 274, 232, 200, + 174, 151,132,115,100,86,74,62,51,42, + 32,23,15,7,0}; + + if (val == 0) + return 0; + + tmp = val; + + while(1) + { + if (tmp == 1) + break; + else + { + tmp = (tmp >> 1); + shiftcount++; + } + } + + + val_integerdB = shiftcount+1; + + tmp2=1; + for (j=1; j<= val_integerdB;j++) + tmp2 = tmp2*2; + + tmp = (val*100) /tmp2; + tindex = tmp/5; + + if (tindex > 20) + tindex = 20; + + val_fractiondB = Table_fraction[tindex]; + + result = val_integerdB*100 - val_fractiondB; + + return (result); + + +} + + + VOID halbtc8723b1ant_InitCoexDm( IN PBTC_COEXIST pBtCoexist @@ -2656,24 +3014,28 @@ halbtc8723b1ant_InitCoexDm( halbtc8723b1ant_SwMechanism(pBtCoexist, FALSE); //halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, FALSE, 8); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, FORCE_EXEC, 0); + //halbtc8723b1ant_CoexTableWithType(pBtCoexist, FORCE_EXEC, 0); + + pCoexSta->popEventCnt = 0; } VOID halbtc8723b1ant_InitHwConfig( IN PBTC_COEXIST pBtCoexist, - IN BOOLEAN bBackUp + IN BOOLEAN bBackUp, + IN BOOLEAN bWifiOnly ) { PBTC_BOARD_INFO pBoardInfo=&pBtCoexist->boardInfo; u4Byte u4Tmp=0;//, fwVer; u2Byte u2Tmp=0; - u1Byte u1Tmp=0; + u1Byte u1Tmp=0, u1Tmpa=0, u1Tmpb=0; u1Byte H2C_Parameter[2] ={0}; - u4Byte cntBtCalChk=0; BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], 1Ant Init HW Config!!\n")); + pPsdScan->bIsAntDetEnable = FALSE; +#if 0//move to BTC_MEDIA_CONNECT if(bBackUp) { pCoexDm->backupArfrCnt1 = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x430); @@ -2681,61 +3043,554 @@ halbtc8723b1ant_InitHwConfig( pCoexDm->backupRetryLimit = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0x42a); pCoexDm->backupAmpduMaxTime = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x456); } +#endif + pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x550, 0x8, 0x1); //enable TBTT nterrupt + + // 0x790[5:0]=0x5 + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x790, 0x5); - pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x780); //WiFi goto standby while GNT_BT 0-->1 - //pBtCoexist->fBtcSetBtReg(pBtCoexist, 0, 0x3c, 0x15); //BT goto standby while GNT_BT 1-->0 + // Enable counter statistics + //pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0xc); //0x76e[3] =1, WLAN_Act control by PTA + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x778, 0x1); + pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x40, 0x20, 0x1); - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x974, 0xff); - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x944, 0x3, 0x3); - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x930, 0x77); //pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x67, 0x20, 0x1); //BT select s0/s1 is controlled by WiFi - // BT calibration check - while(cntBtCalChk <= 20) + halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, FALSE, 8); + + //Antenna config + if(bWifiOnly) + halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_WIFI, FORCE_EXEC, TRUE, FALSE); + else + halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, FORCE_EXEC, TRUE, FALSE); + +#if 0 + if(bWifiOnly) { - u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x49d); - cntBtCalChk++; - if(u4Tmp & BIT0) + halbtc8723b1ant_SetAntPathDCut(pBtCoexist, FALSE, FALSE, FALSE, BTC_ANT_PATH_WIFI, BTC_WIFI_STAT_INIT); + halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, FALSE, 8); + } + else + halbtc8723b1ant_SetAntPathDCut(pBtCoexist, FALSE, FALSE, FALSE, BTC_ANT_PATH_BT, BTC_WIFI_STAT_INIT); +#endif + + + + // PTA parameter + halbtc8723b1ant_CoexTableWithType(pBtCoexist, FORCE_EXEC, 0); + + u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x948); + u1Tmpa = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x765); + u1Tmpb = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x67); + + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("############# [BTCoex], 0x948=0x%x, 0x765=0x%x, 0x67=0x%x\n", + u4Tmp, u1Tmpa, u1Tmpb)); +} + +VOID +halbtc8723b1ant_ShowPSDData( + IN PBTC_COEXIST pBtCoexist + ) +{ + pu1Byte cliBuf=pBtCoexist->cliBuf; + u4Byte nDeltaFreqPerPoint; + u4Byte freq,freq1,freq2,n=0,i=0, j=0, m=0, PsdRep1, PsdRep2; + + DbgPrint("xxxxxxxxxxxxxxxx DisplayAntIsolation()\n"); + + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n============[Antenna Detection info] (%d/%d)============\n", + pPsdScan->nPSDGenCount, pPsdScan->nPSDGenTotalCount); + CL_PRINTF(cliBuf); + + if (pPsdScan->nPSDGenTotalCount == 0) + { + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n No Data !!\n"); + CL_PRINTF(cliBuf); + return; + } + + if (pPsdScan->nPSDPoint == 0) + nDeltaFreqPerPoint = 0; + else + nDeltaFreqPerPoint = pPsdScan->nPSDBandWidth/pPsdScan->nPSDPoint; + + if (pPsdScan->bIsPSDShowMaxOnly) + { + PsdRep1 = pPsdScan->nPSDMaxValue/100; + PsdRep2 = pPsdScan->nPSDMaxValue - PsdRep1 * 100; + + freq = ((pPsdScan->realcentFreq-20) * 1000000 + pPsdScan->nPSDMaxValuePoint * nDeltaFreqPerPoint); + freq1 = freq/1000000; + freq2 = freq/1000 - freq1 * 1000; + + if (freq2 < 100) + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n Freq = %d.0%d MHz", + freq1, freq2); + else + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n Freq = %d.%d MHz", + freq1, freq2); + + if (PsdRep2 < 10) + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, ", Value = %d.0%d dB, (%d/%d) \n", + PsdRep1, PsdRep2, pPsdScan->nPSDGenCount, pPsdScan->nPSDGenTotalCount); + else + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, ", Value = %d.%d dB, %d, (%d/%d)\n", + PsdRep1, PsdRep2, pPsdScan->nPSDMaxValue, pPsdScan->nPSDGenCount, pPsdScan->nPSDGenTotalCount); + + CL_PRINTF(cliBuf); + } + else + { + m = pPsdScan->nPSDStartPoint; + n = pPsdScan->nPSDStartPoint; + i = 1; + j = 1; + + while(1) + { + do { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], ########### BT calibration(cnt=%d) ###########\n", cntBtCalChk)); - delay_ms(50); - } + freq = ((pPsdScan->realcentFreq-20) * 1000000 + m * nDeltaFreqPerPoint); + freq1 = freq/1000000; + freq2 = freq/1000 - freq1 * 1000; + + if (i ==1) + { + if (freq2 == 0) + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n Freq%6d.000", freq1); + else if (freq2 < 100) + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n Freq%6d.0%2d", freq1,freq2); + else + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n Freq%6d.%3d", freq1,freq2); + } + else if ( (i%8 == 0) || (m == pPsdScan->nPSDStopPoint) ) + { + if (freq2 == 0) + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "%6d.000\n", freq1); + else if (freq2 < 100) + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "%6d.0%2d\n", freq1,freq2); + else + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "%6d.%3d\n", freq1,freq2); + } + else + { + if (freq2 == 0) + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "%6d.000", freq1); + else if (freq2 < 100) + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "%6d.0%2d", freq1,freq2); + else + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "%6d.%3d", freq1,freq2); + } + + i++; + m++; + CL_PRINTF(cliBuf); + + }while( (i <= 8) && (m <= pPsdScan->nPSDStopPoint)); + + + do + { + PsdRep1 = pPsdScan->nPSDReport_MaxHold[n]/100; + PsdRep2 = pPsdScan->nPSDReport_MaxHold[n] - PsdRep1 * 100; + + if (j ==1) + { + if (PsdRep2 <10) + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n Val %7d.0%d", PsdRep1,PsdRep2); + else + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n Val %7d.%d", PsdRep1,PsdRep2); + } + else if ( (j%8 == 0) || (n == pPsdScan->nPSDStopPoint) ) + { + if (PsdRep2 <10) + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "%7d.0%d\n", PsdRep1,PsdRep2); + else + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "%7d.%d\n", PsdRep1,PsdRep2); + } + else + { + if (PsdRep2 <10) + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "%7d.0%d", PsdRep1,PsdRep2); + else + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "%7d.%d", PsdRep1,PsdRep2); + } + + j++; + n++; + CL_PRINTF(cliBuf); + + } while( (j <= 8) && (n <= pPsdScan->nPSDStopPoint)); + + if ( (m > pPsdScan->nPSDStopPoint) || (n > pPsdScan->nPSDStopPoint) ) + break; else { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], ********** BT NOT calibration (cnt=%d)**********\n", cntBtCalChk)); - break; + i = 1; + j = 1; } + + } } - // 0x790[5:0]=0x5 - u1Tmp = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x790); - u1Tmp &= 0xc0; - u1Tmp |= 0x5; - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x790, u1Tmp); + +} + +u4Byte +halbtc8723b1ant_GetPSDData( + IN PBTC_COEXIST pBtCoexist, + IN u4Byte nPoint + ) +{ + //reg 0x808[9:0]: FFT data x + //reg 0x808[22]: 0-->1 to get 1 FFT data y + //reg 0x8b4[15:0]: FFT data y report + + u4Byte val = 0, psd_report =0; - // Enable counter statistics - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0xc); //0x76e[3] =1, WLAN_Act control by PTA - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x778, 0x1); - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x40, 0x20, 0x1); + val = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x808); + + val &= 0xffbffc00; + val |= nPoint; + + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x808, val); + + val |= 0x00400000; + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x808, val); + + + val = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x8b4); + + psd_report = val & 0x0000ffff; + + return psd_report; +} + + +void +halbtc8723b1ant_SweepPSDPoint( +IN PBTC_COEXIST pBtCoexist, + IN u4Byte centFreq, + IN u4Byte offset, + IN u4Byte span, + IN u4Byte points, + IN u4Byte avgnum + ) +{ + u4Byte i,val,n,k=0; + u4Byte nPoints=0, psd_report=0; + u4Byte nStartP=0, nStopP=0, nDeltaFreqPerPoint=156250; + u4Byte nPSDCenterFreq=20*10^6, freq,freq1,freq2; + BOOLEAN outloop = FALSE; + u1Byte flag = 0; + u4Byte tmp, PsdRep1, PsdRep2; + + pPsdScan->bIsPSDRunning = TRUE; + + do + { + switch(flag) + { + case 0: //Get PSD parameters + default: + DbgPrint("xxxxxxxxxxxxxxxx SweepPSDPoint(), centFreq=0x%x, offset=0x%x, span=0x%x\n", + centFreq, offset, span); + + pPsdScan->nPSDBandWidth = 40*1000000; + pPsdScan->nPSDPoint = points; + pPsdScan->nPSDStartBase = points/2; + pPsdScan->nPSDAvgNum = avgnum; + + nPoints = pPsdScan->nPSDPoint; + nDeltaFreqPerPoint = pPsdScan->nPSDBandWidth/pPsdScan->nPSDPoint; + + //PSD point setup + val = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x808); + val &= 0xffff0fff; + + switch(pPsdScan->nPSDPoint) + { + case 128: + val |= 0x0; + break; + case 256: + default: + val |=0x00004000; + break; + case 512: + val |= 0x00008000; + break; + case 1024: + val |= 0x0000c000; + break; + } + + switch(pPsdScan->nPSDAvgNum) + { + case 1: + val |= 0x0; + break; + case 8: + val |=0x00001000; + break; + case 16: + val |= 0x00002000; + break; + case 32: + default: + val |= 0x00003000; + break; + } + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x808, val); + + DbgPrint("xxxxxxxxxxxxxxxx SweepPSDPoint(), PSD BW= %d, DeltaFreq=%d\n" + , pPsdScan->nPSDBandWidth, nDeltaFreqPerPoint); + flag = 1; + break; + case 1: //calculate the PSD point index from freq/offset/span + nPSDCenterFreq = pPsdScan->nPSDBandWidth /2 +offset*(1000000); + DbgPrint("xxxxxxxxxxxxxxxx SweepPSDPoint(), PSD Center Freq = %d\n", (centFreq + offset)); + + nStartP = pPsdScan->nPSDStartBase + (nPSDCenterFreq - span *(1000000)/2) /nDeltaFreqPerPoint; + pPsdScan->nPSDStartPoint = nStartP - pPsdScan->nPSDStartBase; + DbgPrint("xxxxxxxxxxxxxxxx SweepPSDPoint(), Start PSD Poin Matrix Index = %d\n", pPsdScan->nPSDStartPoint); + + nStopP = pPsdScan->nPSDStartBase + (nPSDCenterFreq + span *(1000000)/2) /nDeltaFreqPerPoint; + pPsdScan->nPSDStopPoint = nStopP - pPsdScan->nPSDStartBase-1; + DbgPrint("xxxxxxxxxxxxxxxx SweepPSDPoint(), Stop PSD Poin Matrix Index = %d\n",pPsdScan->nPSDStopPoint); + + flag = 2; + break; + case 2: //set RF channel/BW/Mode + + //set 3-wire off + val = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x88c); + val |= 0x00300000; + pBtCoexist->fBtcWrite4Byte(pBtCoexist,0x88c,val); + + //CCK off + val = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x800); + val &= 0xfeffffff; + pBtCoexist->fBtcWrite4Byte(pBtCoexist,0x800,val); + + //Set RF channel + if (centFreq == 2484) + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x18, 0x3ff, 0xe); //WiFi TRx Mask on + else + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x18, 0x3ff, (centFreq-2412)/5 + 1); //WiFi TRx Mask on + + //Set RF mode = Rx, RF Gain = 0x8a0 + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x0, 0xfffff, 0x308a0); + + //Set TRx mask off + //un-lock TRx Mask setup + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0xdd, 0x80, 0x1); + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0xdf, 0x1, 0x1); + + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); + + flag = 3; + break; + case 3: + memset(pPsdScan->nPSDReport,0, pPsdScan->nPSDPoint*sizeof(u4Byte)); + nStartP = pPsdScan->nPSDStartPoint + pPsdScan->nPSDStartBase; + nStopP = pPsdScan->nPSDStopPoint + pPsdScan->nPSDStartBase + 1; + + i = nStartP; + + while (i < nStopP) + { + if (i >= nPoints) + { + psd_report = halbtc8723b1ant_GetPSDData(pBtCoexist,i-nPoints); + } + else + { + psd_report = halbtc8723b1ant_GetPSDData(pBtCoexist,i); + } + + if (psd_report == 0) + tmp = 0; + else + //tmp = 20*log10((double)psd_report); + //20*log2(x)/log2(10), log2Base return theresult of the psd_report*100 + tmp = 6 * halbtc8723b1ant_Log2Base(pBtCoexist, psd_report); + + + n = i-pPsdScan->nPSDStartBase; + pPsdScan->nPSDReport[n] = tmp; + PsdRep1 = pPsdScan->nPSDReport[n] /100; + PsdRep2 = pPsdScan->nPSDReport[n] - PsdRep1 * 100; + + freq = ((centFreq-20) * 1000000 + n * nDeltaFreqPerPoint); + freq1 = freq/1000000; + freq2 = freq/1000 - freq1 * 1000; + + if (freq2 < 100) + DbgPrint("xxxxxxxxxxxxxxxx SweepPSDPoint(), i = %d (%d.0%d MHz)", n, freq1, freq2); + else + DbgPrint("xxxxxxxxxxxxxxxx SweepPSDPoint(), i = %d (%d.%d MHz)", n, freq1, freq2); + + if (PsdRep2 < 10) + DbgPrint(", PSDReport = %d (%d.0%d dB)\n",psd_report, PsdRep1, PsdRep2); + else + DbgPrint(", PSDReport = %d (%d.%d dB)\n",psd_report, PsdRep1,PsdRep2); + + i++; + + k=0; + + //Add Delay between PSD point + while(1) + { + if (k++ > 20000) + break; + } + + DbgPrint("xxxxxxxxxxxxxxxx SweepPSDPoint()==============\n"); + } + + flag = 100; + break; + case 99: //error + + outloop = TRUE; + break; + case 100: //recovery + + //set 3-wire on + val = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x88c); + val &=0xffcfffff; + pBtCoexist->fBtcWrite4Byte(pBtCoexist,0x88c,val); + + //CCK on + val = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x800); + val |= 0x01000000; + pBtCoexist->fBtcWrite4Byte(pBtCoexist,0x800,val); + + //PSD off + val = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x808); + val &=0xffbfffff; + pBtCoexist->fBtcWrite4Byte(pBtCoexist,0x808,val); + + //TRx Mask on + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0xdd, 0x80, 0x0); + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0xdf, 0x1, 0x0); + + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x780); + + outloop = TRUE; + break; + + } + + }while (!outloop); + + + + pPsdScan->bIsPSDRunning = FALSE; - //Antenna config - //halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_PTA, TRUE, FALSE); - halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, TRUE, FALSE); - // PTA parameter - halbtc8723b1ant_CoexTableWithType(pBtCoexist, FORCE_EXEC, 0); } VOID -halbtc8723b1ant_WifiOffHwCfg( - IN PBTC_COEXIST pBtCoexist +halbtc8723b1ant_AntennaDetection( + IN PBTC_COEXIST pBtCoexist, + IN u4Byte centFreq, + IN u4Byte offset, + IN u4Byte span, + IN u4Byte seconds ) { - // set wlan_act to low - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0x4); + u4Byte realseconds = 0, i=0, i_max=0, val_max=0, j; + + //Stop Coex DM + pBtCoexist->bStopCoexDm = TRUE; + + //Set Antenna path, switch WiFi to un-certain antenna port + halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, FORCE_EXEC, FALSE, FALSE); + + //Mailbox handshake + pBtCoexist->fBtcFillH2c(pBtCoexist, 0x62, 1, 0x0); + DbgPrint("xxxxxxxxxxxxxxxx SweepPSDPoint(), Set BT LE Tx\n"); + + //sweep PSD + DbgPrint("xxxxxxxxxxxxxxxx SweepPSDPoint(), \n"); + DbgPrint("xxxxxxxxxxxxxxxx SweepPSDPoint(), \n"); + DbgPrint("xxxxxxxxxxxxxxxx SweepPSDPoint(), \n"); + + + //Analysis Data + + do + { + halbtc8723b1ant_SweepPSDPoint(pBtCoexist, centFreq, offset,span, BT_8723B_1ANT_ANTDET_PSD_POINTS, BT_8723B_1ANT_ANTDET_PSD_AVGNUM); + + DbgPrint("xxxxxxxxxxxxxxxx SweepPSDPoint(), PSDGenCount = %d\n ", pPsdScan->nPSDGenCount); + + if (pPsdScan->nPSDGenCount == 0) + { + memcpy(pPsdScan->nPSDReport_MaxHold, pPsdScan->nPSDReport, BT_8723B_1ANT_ANTDET_PSD_POINTS*sizeof(u4Byte)); + + for (i= pPsdScan->nPSDStartPoint; i<=pPsdScan->nPSDStopPoint; i++) + { + DbgPrint("xxxxxxxxxxxxxxxx SweepPSDPoint(), Max_Hold i = %d, PSDReport = %d dB\n", i, pPsdScan->nPSDReport_MaxHold[i]); + } + } + else + { + for (i= pPsdScan->nPSDStartPoint; i<=pPsdScan->nPSDStopPoint; i++) + { + if (pPsdScan->nPSDReport[i] > pPsdScan->nPSDReport_MaxHold[i]) + pPsdScan->nPSDReport_MaxHold[i] = pPsdScan->nPSDReport[i]; + + //search Max Value + if (i ==pPsdScan->nPSDStartPoint ) + { + i_max = i; + val_max = pPsdScan->nPSDReport_MaxHold[i]; + } + else + { + if (pPsdScan->nPSDReport_MaxHold[i] > val_max) + { + i_max = i; + val_max = pPsdScan->nPSDReport_MaxHold[i]; + } + } + + DbgPrint("xxxxxxxxxxxxxxxx SweepPSDPoint(), Max_Hold i = %d, PSDReport = %d dB\n", i, pPsdScan->nPSDReport_MaxHold[i]); + + } + + pPsdScan->nPSDMaxValuePoint = i_max; + pPsdScan->nPSDMaxValue = val_max; + + DbgPrint("xxxxxxxxxxxxxxxx SweepPSDPoint(), Max_Hold i_Max = %d, PSDReport_Max = %d dB, TotalCnt = %d\n", pPsdScan->nPSDMaxValuePoint + ,pPsdScan->nPSDMaxValue, pPsdScan->nPSDGenTotalCount); + } + + if (pPsdScan->nPSDGenCount+1 <= pPsdScan->realseconds) + { + pPsdScan->nPSDGenCount++; + pPsdScan->nPSDGenTotalCount++; + } + else + { + break; + } + + } while (1); + //Set Antenna Path + halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_PTA, FORCE_EXEC, FALSE, FALSE); + + //Resume Coex DM + pBtCoexist->bStopCoexDm = FALSE; + } + //============================================================ // work around function start with wa_halbtc8723b1ant_ //============================================================ @@ -2743,11 +3598,87 @@ halbtc8723b1ant_WifiOffHwCfg( // extern function start with EXhalbtc8723b1ant_ //============================================================ VOID -EXhalbtc8723b1ant_InitHwConfig( +EXhalbtc8723b1ant_PowerOnSetting( + IN PBTC_COEXIST pBtCoexist + ) +{ + PBTC_BOARD_INFO pBoardInfo=&pBtCoexist->boardInfo; + u1Byte u1Tmp=0x0; + u2Byte u2Tmp=0x0; + + pBtCoexist->bStopCoexDm = TRUE; + + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x67, 0x20); + + // enable BB, REG_SYS_FUNC_EN such that we can write 0x948 correctly. + u2Tmp = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0x2); + pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x2, u2Tmp|BIT0|BIT1); + + // set GRAN_BT = 1 + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x765, 0x18); + // set WLAN_ACT = 0 + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0x4); + + // + // S0 or S1 setting and Local register setting(By the setting fw can get ant number, S0/S1, ... info) + // Local setting bit define + // BIT0: "0" for no antenna inverse; "1" for antenna inverse + // BIT1: "0" for internal switch; "1" for external switch + // BIT2: "0" for one antenna; "1" for two antenna + // NOTE: here default all internal switch and 1-antenna ==> BIT1=0 and BIT2=0 + if(pBtCoexist->chipInterface == BTC_INTF_USB) + { + // fixed at S0 for USB interface + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x0); + + u1Tmp |= 0x1; // antenna inverse + pBtCoexist->fBtcWriteLocalReg1Byte(pBtCoexist, 0xfe08, u1Tmp); + + pBoardInfo->btdmAntPos = BTC_ANTENNA_AT_AUX_PORT; + } + else + { + // for PCIE and SDIO interface, we check efuse 0xc3[6] + if(pBoardInfo->singleAntPath == 0) + { + // set to S1 + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x280); + pBoardInfo->btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT; + } + else if(pBoardInfo->singleAntPath == 1) + { + // set to S0 + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x0); + u1Tmp |= 0x1; // antenna inverse + pBoardInfo->btdmAntPos = BTC_ANTENNA_AT_AUX_PORT; + } + + if(pBtCoexist->chipInterface == BTC_INTF_PCI) + { + pBtCoexist->fBtcWriteLocalReg1Byte(pBtCoexist, 0x384, u1Tmp); + } + else if(pBtCoexist->chipInterface == BTC_INTF_SDIO) + { + pBtCoexist->fBtcWriteLocalReg1Byte(pBtCoexist, 0x60, u1Tmp); + } + } +} + +VOID +EXhalbtc8723b1ant_PreLoadFirmware( IN PBTC_COEXIST pBtCoexist ) { - halbtc8723b1ant_InitHwConfig(pBtCoexist, TRUE); +} + +VOID +EXhalbtc8723b1ant_InitHwConfig( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bWifiOnly + ) +{ + halbtc8723b1ant_InitHwConfig(pBtCoexist, TRUE, bWifiOnly); + pBtCoexist->bStopCoexDm = FALSE; } VOID @@ -2776,12 +3707,15 @@ EXhalbtc8723b1ant_DisplayCoexInfo( u1Byte u1Tmp[4], i, btInfoExt, psTdmaCase=0; u2Byte u2Tmp[4]; u4Byte u4Tmp[4]; - BOOLEAN bRoam=FALSE, bScan=FALSE, bLink=FALSE, bWifiUnder5G=FALSE; - BOOLEAN bBtHsOn=FALSE, bWifiBusy=FALSE; - s4Byte wifiRssi=0, btHsRssi=0; - u4Byte wifiBw, wifiTrafficDir, faOfdm, faCck, wifiLinkStatus; - u1Byte wifiDot11Chnl, wifiHsChnl; + u4Byte faOfdm, faCck; u4Byte fwVer=0, btPatchVer=0; + static u1Byte PopReportIn10s = 0; + + if (pPsdScan->bIsAntDetEnable == TRUE) + { + halbtc8723b1ant_ShowPSDData(pBtCoexist); + return; + } CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n ============[BT Coexist info]============"); CL_PRINTF(cliBuf); @@ -2801,13 +3735,6 @@ EXhalbtc8723b1ant_DisplayCoexInfo( CL_PRINTF(cliBuf); } - if(!pBoardInfo->bBtExist) - { - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n BT not exists !!!"); - CL_PRINTF(cliBuf); - return; - } - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d", "Ant PG Num/ Ant Mech/ Ant Pos:", \ pBoardInfo->pgAntNum, pBoardInfo->btdmAntNum, pBoardInfo->btdmAntPos); CL_PRINTF(cliBuf); @@ -2822,59 +3749,51 @@ EXhalbtc8723b1ant_DisplayCoexInfo( GLCoexVerDate8723b1Ant, GLCoexVer8723b1Ant, fwVer, btPatchVer, btPatchVer); CL_PRINTF(cliBuf); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_DOT11_CHNL, &wifiDot11Chnl); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_HS_CHNL, &wifiHsChnl); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d(%d)", "Dot11 channel / HsChnl(HsMode)", \ - wifiDot11Chnl, wifiHsChnl, bBtHsOn); - CL_PRINTF(cliBuf); - - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %02x %02x %02x ", "H2C Wifi inform bt chnl Info", \ + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %02x %02x %02x ", "Wifi channel informed to BT", \ pCoexDm->wifiChnlInfo[0], pCoexDm->wifiChnlInfo[1], pCoexDm->wifiChnlInfo[2]); CL_PRINTF(cliBuf); - - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_WIFI_RSSI, &wifiRssi); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_HS_RSSI, &btHsRssi); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d", "Wifi rssi/ HS rssi", \ - wifiRssi, btHsRssi); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s/ %s/ %s", "Wifi bHi-Pri/ CCK lock/ CCK ever-lock", \ + (pCoexSta->bWiFiIsHighPriTask? "Yes":"No"), + (pCoexSta->bCCKLock? "Yes":"No"), + (pCoexSta->bCCKEverLock? "Yes":"No")); CL_PRINTF(cliBuf); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_LINK, &bLink); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_ROAM, &bRoam); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d ", "Wifi bLink/ bRoam/ bScan", \ - bLink, bRoam, bScan); - CL_PRINTF(cliBuf); - - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_UNDER_5G, &bWifiUnder5G); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_TRAFFIC_DIRECTION, &wifiTrafficDir); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s / %s/ %s ", "Wifi status", \ - (bWifiUnder5G? "5G":"2.4G"), - ((BTC_WIFI_BW_LEGACY==wifiBw)? "Legacy": (((BTC_WIFI_BW_HT40==wifiBw)? "HT40":"HT20"))), - ((!bWifiBusy)? "idle": ((BTC_WIFI_TRAFFIC_TX==wifiTrafficDir)? "uplink":"downlink"))); + // wifi status + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[Wifi Status]============"); CL_PRINTF(cliBuf); + pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_WIFI_STATUS); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d/ %d/ %d", "sta/vwifi/hs/p2pGo/p2pGc", \ - ((wifiLinkStatus&WIFI_STA_CONNECTED)? 1:0), ((wifiLinkStatus&WIFI_AP_CONNECTED)? 1:0), - ((wifiLinkStatus&WIFI_HS_CONNECTED)? 1:0), ((wifiLinkStatus&WIFI_P2P_GO_CONNECTED)? 1:0), - ((wifiLinkStatus&WIFI_P2P_GC_CONNECTED)? 1:0) ); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[BT Status]============"); CL_PRINTF(cliBuf); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = [%s/ %d/ %d] ", "BT [status/ rssi/ retryCnt]", \ + PopReportIn10s++; + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = [%s/ %d/ %d/ %d] ", "BT [status/ rssi/ retryCnt/ popCnt]", \ ((pBtCoexist->btInfo.bBtDisabled)? ("disabled"): ((pCoexSta->bC2hBtInquiryPage)?("inquiry/page scan"):((BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE == pCoexDm->btStatus)? "non-connected idle": ( (BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE == pCoexDm->btStatus)? "connected-idle":"busy")))), - pCoexSta->btRssi, pCoexSta->btRetryCnt); + pCoexSta->btRssi, pCoexSta->btRetryCnt, pCoexSta->popEventCnt); CL_PRINTF(cliBuf); - - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d / %d / %d", "SCO/HID/PAN/A2DP", \ - pBtLinkInfo->bScoExist, pBtLinkInfo->bHidExist, pBtLinkInfo->bPanExist, pBtLinkInfo->bA2dpExist); + if (PopReportIn10s >= 5) + { + pCoexSta->popEventCnt = 0; + PopReportIn10s = 0; + } + + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d / %d / %d / %d", "SCO/HID/PAN/A2DP/Hi-Pri", \ + pBtLinkInfo->bScoExist, pBtLinkInfo->bHidExist, pBtLinkInfo->bPanExist, pBtLinkInfo->bA2dpExist, pBtLinkInfo->bBtHiPriLinkExist); CL_PRINTF(cliBuf); + + if (pStackInfo->bProfileNotified) + { pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_BT_LINK_INFO); + } + else + { + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s", "BT Role", \ + (pBtLinkInfo->bSlaveRole )? "Slave":"Master"); + CL_PRINTF(cliBuf); + } btInfoExt = pCoexSta->btInfoExt; CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s", "BT Info A2DP rate", \ @@ -2893,13 +3812,6 @@ EXhalbtc8723b1ant_DisplayCoexInfo( CL_PRINTF(cliBuf); } } - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s/%s, (0x%x/0x%x)", "PS state, IPS/LPS, (lps/rpwm)", \ - ((pCoexSta->bUnderIps? "IPS ON":"IPS OFF")), - ((pCoexSta->bUnderLps? "LPS ON":"LPS OFF")), - pBtCoexist->btInfo.lpsVal, - pBtCoexist->btInfo.rpwmVal); - CL_PRINTF(cliBuf); - pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_FW_PWR_MODE_CMD); if(!pBtCoexist->bManualControl) { @@ -2930,13 +3842,19 @@ EXhalbtc8723b1ant_DisplayCoexInfo( pCoexDm->psTdmaPara[4], psTdmaCase, pCoexDm->bAutoTdmaAdjust); CL_PRINTF(cliBuf); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d", "Coex Table Type", \ + pCoexSta->nCoexTableType); + CL_PRINTF(cliBuf); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d", "IgnWlanAct", \ pCoexDm->bCurIgnoreWlanAct); CL_PRINTF(cliBuf); + /* CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x ", "Latest error condition(should be 0)", \ pCoexDm->errorCondition); CL_PRINTF(cliBuf); + */ } // Hw setting @@ -2964,9 +3882,10 @@ EXhalbtc8723b1ant_DisplayCoexInfo( u4Tmp[0] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x948); u1Tmp[0] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x67); - u1Tmp[1] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x765); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/ 0x%x/ 0x%x", "0x948/ 0x67[5] / 0x765", \ - u4Tmp[0], ((u1Tmp[0]&0x20)>> 5), u1Tmp[1]); + u4Tmp[1] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x764); + u1Tmp[1] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x76e); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/ 0x%x/ 0x%x/ 0x%x", "0x948/ 0x67[5] / 0x764 / 0x76e", \ + u4Tmp[0], ((u1Tmp[0]&0x20)>> 5), (u4Tmp[1] & 0xffff), u1Tmp[1]); CL_PRINTF(cliBuf); u4Tmp[0] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x92c); @@ -3012,6 +3931,15 @@ EXhalbtc8723b1ant_DisplayCoexInfo( u4Tmp[0]&0xffff, faOfdm, faCck); CL_PRINTF(cliBuf); + + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d/ %d", "CRC_OK CCK/11g/11n/11n-Agg", \ + pCoexSta->nCRCOK_CCK, pCoexSta->nCRCOK_11g, pCoexSta->nCRCOK_11n, pCoexSta->nCRCOK_11nAgg); + CL_PRINTF(cliBuf); + + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d/ %d", "CRC_Err CCK/11g/11n/11n-Agg", \ + pCoexSta->nCRCErr_CCK, pCoexSta->nCRCErr_11g, pCoexSta->nCRCErr_11n, pCoexSta->nCRCErr_11nAgg); + CL_PRINTF(cliBuf); + u4Tmp[0] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x6c0); u4Tmp[1] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x6c4); u4Tmp[2] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x6c8); @@ -3026,7 +3954,7 @@ EXhalbtc8723b1ant_DisplayCoexInfo( pCoexSta->lowPriorityRx, pCoexSta->lowPriorityTx); CL_PRINTF(cliBuf); #if(BT_AUTO_REPORT_ONLY_8723B_1ANT == 1) - halbtc8723b1ant_MonitorBtCtr(pBtCoexist); + //halbtc8723b1ant_MonitorBtCtr(pBtCoexist); #endif pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_COEX_STATISTICS); } @@ -3047,21 +3975,21 @@ EXhalbtc8723b1ant_IpsNotify( { BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], IPS ENTER notify\n")); pCoexSta->bUnderIps = TRUE; - halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, FALSE, TRUE); + halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 0); + halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, FORCE_EXEC, FALSE, TRUE); halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); - halbtc8723b1ant_WifiOffHwCfg(pBtCoexist); + //halbtc8723b1ant_SetAntPathDCut(pBtCoexist, FALSE, FALSE, FALSE, BTC_ANT_PATH_BT, BTC_WIFI_STAT_NORMAL_OFF); } else if(BTC_IPS_LEAVE == type) { BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], IPS LEAVE notify\n")); - pCoexSta->bUnderIps = FALSE; - //halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_PTA, TRUE, FALSE); - //halbtc8723b1ant_RunCoexistMechanism(pBtCoexist); - halbtc8723b1ant_InitHwConfig(pBtCoexist, FALSE); + halbtc8723b1ant_InitHwConfig(pBtCoexist, FALSE, FALSE); halbtc8723b1ant_InitCoexDm(pBtCoexist); halbtc8723b1ant_QueryBtInfo(pBtCoexist); + + pCoexSta->bUnderIps = FALSE; } } @@ -3098,9 +4026,37 @@ EXhalbtc8723b1ant_ScanNotify( BOOLEAN bBtCtrlAggBufSize=FALSE; u1Byte aggBufSize=5; + u1Byte u1Tmpa, u1Tmpb; + u4Byte u4Tmp; + if(pBtCoexist->bManualControl || - pBtCoexist->bStopCoexDm || - pBtCoexist->btInfo.bBtDisabled ) + pBtCoexist->bStopCoexDm ) + return; + + if(BTC_SCAN_START == type) + { + pCoexSta->bWiFiIsHighPriTask = TRUE; + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN START notify\n")); + + halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, FALSE, 8); //Force antenna setup for no scan result issue + halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_PTA, FORCE_EXEC, FALSE, FALSE); + u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x948); + u1Tmpa = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x765); + u1Tmpb = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x67); + + + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], 0x948=0x%x, 0x765=0x%x, 0x67=0x%x\n", + u4Tmp, u1Tmpa, u1Tmpb)); + } + else + { + pCoexSta->bWiFiIsHighPriTask = FALSE; + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN FINISH notify\n")); + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_AP_NUM, &pCoexSta->nScanAPNum); + } + + if(pBtCoexist->btInfo.bBtDisabled) return; pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); @@ -3131,7 +4087,7 @@ EXhalbtc8723b1ant_ScanNotify( if(BTC_SCAN_START == type) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN START notify\n")); + //BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN START notify\n")); if(!bWifiConnected) // non-connected scan { halbtc8723b1ant_ActionWifiNotConnectedScan(pBtCoexist); @@ -3143,7 +4099,7 @@ EXhalbtc8723b1ant_ScanNotify( } else if(BTC_SCAN_FINISH == type) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN FINISH notify\n")); + //BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN FINISH notify\n")); if(!bWifiConnected) // non-connected scan { halbtc8723b1ant_ActionWifiNotConnected(pBtCoexist); @@ -3172,6 +4128,21 @@ EXhalbtc8723b1ant_ConnectNotify( pBtCoexist->btInfo.bBtDisabled ) return; + if(BTC_ASSOCIATE_START == type) + { + pCoexSta->bWiFiIsHighPriTask = TRUE; + halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, FALSE, 8); //Force antenna setup for no scan result issue + halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_PTA, FORCE_EXEC, FALSE, FALSE); + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT START notify\n")); + pCoexDm->nArpCnt = 0; + } + else + { + pCoexSta->bWiFiIsHighPriTask = FALSE; + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT FINISH notify\n")); + //pCoexDm->nArpCnt = 0; + } + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus); numOfWifiLink = wifiLinkStatus>>16; if(numOfWifiLink >= 2) @@ -3196,12 +4167,12 @@ EXhalbtc8723b1ant_ConnectNotify( if(BTC_ASSOCIATE_START == type) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT START notify\n")); + //BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT START notify\n")); halbtc8723b1ant_ActionWifiNotConnectedAssoAuth(pBtCoexist); } else if(BTC_ASSOCIATE_FINISH == type) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT FINISH notify\n")); + //BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT FINISH notify\n")); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); if(!bWifiConnected) // non-connected scan @@ -3224,6 +4195,7 @@ EXhalbtc8723b1ant_MediaStatusNotify( u1Byte H2C_Parameter[3] ={0}; u4Byte wifiBw; u1Byte wifiCentralChnl; + BOOLEAN bWifiUnderBMode = FALSE; if(pBtCoexist->bManualControl || pBtCoexist->bStopCoexDm || @@ -3233,10 +4205,36 @@ EXhalbtc8723b1ant_MediaStatusNotify( if(BTC_MEDIA_CONNECT == type) { BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], MEDIA connect notify\n")); + halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, FALSE, 8); //Force antenna setup for no scan result issue + halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_PTA, FORCE_EXEC, FALSE, FALSE); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &bWifiUnderBMode); + + //Set CCK Tx/Rx high Pri except 11b mode + if (bWifiUnderBMode) + { + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cd, 0x00); //CCK Tx + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cf, 0x00); //CCK Rx + } + else + { + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cd, 0x10); //CCK Tx + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cf, 0x10); //CCK Rx + } + + pCoexDm->backupArfrCnt1 = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x430); + pCoexDm->backupArfrCnt2 = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x434); + pCoexDm->backupRetryLimit = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0x42a); + pCoexDm->backupAmpduMaxTime = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x456); } else { BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], MEDIA disconnect notify\n")); + pCoexDm->nArpCnt = 0; + + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cd, 0x0); //CCK Tx + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cf, 0x0); //CCK Rx + + pCoexSta->bCCKEverLock = FALSE; } // only 2.4G we need to inform bt the chnl mask @@ -3281,6 +4279,38 @@ EXhalbtc8723b1ant_SpecialPacketNotify( pBtCoexist->btInfo.bBtDisabled ) return; + if( BTC_PACKET_DHCP == type || + BTC_PACKET_EAPOL == type || + BTC_PACKET_ARP == type ) + { + if (BTC_PACKET_ARP == type) + { + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], special Packet ARP notify\n")); + + pCoexDm->nArpCnt++; + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], ARP Packet Count = %d\n", pCoexDm->nArpCnt)); + + if(pCoexDm->nArpCnt >= 10) // if APR PKT > 10 after connect, do not go to ActionWifiConnectedSpecialPacket(pBtCoexist) + { + pCoexSta->bWiFiIsHighPriTask = FALSE; + } + else + { + pCoexSta->bWiFiIsHighPriTask = TRUE; + } + } + else + { + pCoexSta->bWiFiIsHighPriTask = TRUE; + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], special Packet DHCP or EAPOL notify\n")); + } + } + else + { + pCoexSta->bWiFiIsHighPriTask = FALSE; + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], special Packet [Type = %d] notify\n", type)); + } + pCoexSta->specialPktPeriodCnt = 0; pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus); @@ -3306,9 +4336,9 @@ EXhalbtc8723b1ant_SpecialPacketNotify( } if( BTC_PACKET_DHCP == type || - BTC_PACKET_EAPOL == type ) - { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], special Packet(%d) notify\n", type)); + BTC_PACKET_EAPOL == type || + ( (BTC_PACKET_ARP == type ) && (pCoexSta->bWiFiIsHighPriTask) ) ) + { halbtc8723b1ant_ActionWifiConnectedSpecialPacket(pBtCoexist); } } @@ -3349,22 +4379,39 @@ EXhalbtc8723b1ant_BtInfoNotify( } } + // if 0xff, it means BT is under WHCK test + if (btInfo == 0xff) + pCoexSta->bBtWhckTest = TRUE; + else + pCoexSta->bBtWhckTest = FALSE; + if(BT_INFO_SRC_8723B_1ANT_WIFI_FW != rspSource) { pCoexSta->btRetryCnt = // [3:0] pCoexSta->btInfoC2h[rspSource][2]&0xf; + if (pCoexSta->btRetryCnt >= 1) + pCoexSta->popEventCnt++; + + if (pCoexSta->btInfoC2h[rspSource][2]&0x20) + pCoexSta->bC2hBtPage = TRUE; + else + pCoexSta->bC2hBtPage = FALSE; + pCoexSta->btRssi = - pCoexSta->btInfoC2h[rspSource][3]*2+10; + pCoexSta->btInfoC2h[rspSource][3]*2-90; + //pCoexSta->btInfoC2h[rspSource][3]*2+10; pCoexSta->btInfoExt = pCoexSta->btInfoC2h[rspSource][4]; - if (!(pCoexSta->btInfoC2h[rspSource][2] & 0x40)) + pCoexSta->bBtTxRxMask = (pCoexSta->btInfoC2h[rspSource][2]&0x40); + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_TX_RX_MASK, &pCoexSta->bBtTxRxMask); + if(!pCoexSta->bBtTxRxMask) { - /* BT into is responded by BT FW and BT RF REG 0x3C != 0x15 => Need to switch GNT_BT */ - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Switch GNT_BT since BT RF REG 0x3C != 0x15\n")); - pBtCoexist->fBtcSetBtReg(pBtCoexist, 0, 0x3c, 0x15); + /* BT into is responded by BT FW and BT RF REG 0x3C != 0x15 => Need to switch BT TRx Mask */ + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Switch BT TRx Mask since BT RF REG 0x3C != 0x15\n")); + pBtCoexist->fBtcSetBtReg(pBtCoexist, BTC_BT_REG_RF, 0x3c, 0x15); } // Here we need to resend some wifi info to BT @@ -3421,6 +4468,8 @@ EXhalbtc8723b1ant_BtInfoNotify( pCoexSta->bA2dpExist = FALSE; pCoexSta->bHidExist = FALSE; pCoexSta->bScoExist = FALSE; + + pCoexSta->bBtHiPriLinkExist = FALSE; } else // connection exists { @@ -3441,10 +4490,23 @@ EXhalbtc8723b1ant_BtInfoNotify( pCoexSta->bScoExist = TRUE; else pCoexSta->bScoExist = FALSE; + + if ( (pCoexSta->bHidExist == FALSE) && (pCoexSta->bC2hBtInquiryPage == FALSE) ) + { + if (pCoexSta->highPriorityTx + pCoexSta->highPriorityRx >= 160) + pCoexSta->bHidExist = TRUE; + } + + //Add Hi-Pri Tx/Rx counter to avoid false detection + if ( ( (pCoexSta->bHidExist) || (pCoexSta->bScoExist) ) && (pCoexSta->highPriorityTx > 60) && (pCoexSta->highPriorityRx > 60) + && (!pCoexSta->bC2hBtInquiryPage)) + pCoexSta->bBtHiPriLinkExist = TRUE; } halbtc8723b1ant_UpdateBtLinkInfo(pBtCoexist); + btInfo = btInfo & 0x1f; //mask profile bit for connect-ilde identification ( for CSR case: A2DP idle --> 0x41) + if(!(btInfo&BT_INFO_8723B_1ANT_B_CONNECTION)) { pCoexDm->btStatus = BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE; @@ -3485,6 +4547,46 @@ EXhalbtc8723b1ant_BtInfoNotify( halbtc8723b1ant_RunCoexistMechanism(pBtCoexist); } +VOID +EXhalbtc8723b1ant_RfStatusNotify( + IN PBTC_COEXIST pBtCoexist, + IN u1Byte type + ) +{ + u4Byte u4Tmp; + u1Byte u1Tmpa,u1Tmpb, u1Tmpc; + + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], RF Status notify\n")); + + if(BTC_RF_ON == type) + { + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], RF is turned ON!!\n")); + pBtCoexist->bStopCoexDm = FALSE; + } + else if(BTC_RF_OFF == type) + { + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], RF is turned OFF!!\n")); + + halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, FALSE, 0); + halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, FORCE_EXEC, FALSE, TRUE); + //halbtc8723b1ant_SetAntPathDCut(pBtCoexist, FALSE, FALSE, FALSE, BTC_ANT_PATH_BT, BTC_WIFI_STAT_NORMAL_OFF); + + halbtc8723b1ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, TRUE); + pBtCoexist->bStopCoexDm = TRUE; + + u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x948); + u1Tmpa = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x765); + u1Tmpb = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x67); + u1Tmpc = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x76e); + + + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("############# [BTCoex], 0x948=0x%x, 0x765=0x%x, 0x67=0x%x, 0x76e=0x%x\n", + u4Tmp, u1Tmpa, u1Tmpb, u1Tmpc)); + + } +} + VOID EXhalbtc8723b1ant_HaltNotify( IN PBTC_COEXIST pBtCoexist @@ -3494,16 +4596,16 @@ EXhalbtc8723b1ant_HaltNotify( BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Halt notify\n")); - pBtCoexist->bStopCoexDm = TRUE; - - halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, FALSE, TRUE); - halbtc8723b1ant_WifiOffHwCfg(pBtCoexist); - halbtc8723b1ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, TRUE); - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, FALSE, 0); + halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, FORCE_EXEC, FALSE, TRUE); + //halbtc8723b1ant_SetAntPathDCut(pBtCoexist, FALSE, FALSE, FALSE, BTC_ANT_PATH_BT, BTC_WIFI_STAT_NORMAL_OFF); + + halbtc8723b1ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, TRUE); EXhalbtc8723b1ant_MediaStatusNotify(pBtCoexist, BTC_MEDIA_DISCONNECT); + + pBtCoexist->bStopCoexDm = TRUE; } VOID @@ -3517,24 +4619,20 @@ EXhalbtc8723b1ant_PnpNotify( if(BTC_WIFI_PNP_SLEEP == pnpState) { BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Pnp notify to SLEEP\n")); - pBtCoexist->bStopCoexDm = TRUE; - /* - halbtc8723b1ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, TRUE); - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 9); - */ - halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, FALSE, TRUE); halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 0); + halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, FORCE_EXEC, FALSE, TRUE); halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); - halbtc8723b1ant_WifiOffHwCfg(pBtCoexist); + //halbtc8723b1ant_SetAntPathDCut(pBtCoexist, FALSE, FALSE, FALSE, BTC_ANT_PATH_BT, BTC_WIFI_STAT_NORMAL_OFF); + + pBtCoexist->bStopCoexDm = TRUE; } else if(BTC_WIFI_PNP_WAKE_UP == pnpState) { BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Pnp notify to WAKE UP\n")); pBtCoexist->bStopCoexDm = FALSE; - halbtc8723b1ant_InitHwConfig(pBtCoexist, FALSE); + halbtc8723b1ant_InitHwConfig(pBtCoexist, FALSE, FALSE); halbtc8723b1ant_InitCoexDm(pBtCoexist); halbtc8723b1ant_QueryBtInfo(pBtCoexist); } @@ -3547,9 +4645,9 @@ EXhalbtc8723b1ant_CoexDmReset( { BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], *****************Coex DM Reset*****************\n")); - halbtc8723b1ant_InitHwConfig(pBtCoexist, FALSE); - pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); - pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x2, 0xfffff, 0x0); + halbtc8723b1ant_InitHwConfig(pBtCoexist, FALSE, FALSE); + //pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); + //pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x2, 0xfffff, 0x0); halbtc8723b1ant_InitCoexDm(pBtCoexist); } @@ -3582,22 +4680,144 @@ EXhalbtc8723b1ant_Periodical( #if(BT_AUTO_REPORT_ONLY_8723B_1ANT == 0) halbtc8723b1ant_QueryBtInfo(pBtCoexist); - halbtc8723b1ant_MonitorBtCtr(pBtCoexist); halbtc8723b1ant_MonitorBtEnableDisable(pBtCoexist); #else + halbtc8723b1ant_MonitorBtCtr(pBtCoexist); + halbtc8723b1ant_MonitorWiFiCtr(pBtCoexist); + if( halbtc8723b1ant_IsWifiStatusChanged(pBtCoexist) || pCoexDm->bAutoTdmaAdjust ) { - //if(pCoexSta->specialPktPeriodCnt > 2) - //{ - halbtc8723b1ant_RunCoexistMechanism(pBtCoexist); - //} + + halbtc8723b1ant_RunCoexistMechanism(pBtCoexist); } pCoexSta->specialPktPeriodCnt++; + +/* + if (pPsdScan->bIsAntDetEnable) + { + if (pPsdScan->nPSDGenCount > pPsdScan->realseconds) + pPsdScan->nPSDGenCount = 0; + + halbtc8723b1ant_AntennaDetection(pBtCoexist, pPsdScan->realcentFreq, pPsdScan->realoffset, pPsdScan->realspan, pPsdScan->realseconds); + pPsdScan->nPSDGenTotalCount +=2; + pPsdScan->nPSDGenCount += 2; + } +*/ #endif } +VOID +EXhalbtc8723b1ant_AntennaDetection( + IN PBTC_COEXIST pBtCoexist, + IN u4Byte centFreq, + IN u4Byte offset, + IN u4Byte span, + IN u4Byte seconds + ) +{ + pPsdScan->bIsAntDetEnable = FALSE; + + //do antenna detection periodically (every 2 seconds) + if (centFreq == 0) + { + return; + } + else + { + //parse parameter + pPsdScan->realcentFreq = ((centFreq & 0xf000) >> 12) * 1000 + ((centFreq & 0xf00) >> 8) * 100 + + ((centFreq & 0xf0) >> 4) * 10 + (centFreq & 0xf); + DbgPrint("xxxxxxxxxxxxxxxx SweepPSDPoint(), real freq = %d\n", pPsdScan->realcentFreq); + + + pPsdScan->realoffset =( (offset & 0x70) >> 4) * 10 + (offset & 0xf); + if (offset & 0x80) + pPsdScan->realoffset = 0 - pPsdScan->realoffset; + DbgPrint("xxxxxxxxxxxxxxxx SweepPSDPoint(), real offst = %d\n", pPsdScan->realoffset); + + if (span & 0x80) + pPsdScan->bIsPSDShowMaxOnly = TRUE; + else + pPsdScan->bIsPSDShowMaxOnly = FALSE; + pPsdScan->realspan = ((span & 0x70) >> 4) * 10 + (span & 0xf); + DbgPrint("xxxxxxxxxxxxxxxx SweepPSDPoint(), real span = %d\n", pPsdScan->realspan); + + if ( (pPsdScan->realcentFreq < 2412) || ( (pPsdScan->realcentFreq > 2472) && (pPsdScan->realcentFreq != 2484) ) ) + { + DbgPrint("xxxxxxxxxxxxxxxx SweepPSDPoint(), center freq is not valid!!\n"); + return; + + } + else if ( ( (pPsdScan->realcentFreq - 2412) % 5 != 0 ) && (pPsdScan->realcentFreq != 2484) ) + { + DbgPrint("xxxxxxxxxxxxxxxx SweepPSDPoint(), center freq is not valid!!\n"); + return; + } + + if ( (pPsdScan->realoffset > 20) || (pPsdScan->realoffset < -20) ) + { + DbgPrint("xxxxxxxxxxxxxxxx SweepPSDPoint(), freq offset is not valid!!\n"); + return; + } + + if (pPsdScan->realspan > 40) + { + DbgPrint("xxxxxxxxxxxxxxxx SweepPSDPoint(), freq span is not valid!!\n"); + return; + } + + pPsdScan->realseconds =( (seconds & 0xf0) >> 4) * 10 + (seconds & 0xf); + pPsdScan->nPSDGenCount = 0; + pPsdScan->nPSDGenTotalCount= 0; + } + + + pPsdScan->bIsAntDetEnable = TRUE; + + + halbtc8723b1ant_AntennaDetection(pBtCoexist, pPsdScan->realcentFreq, pPsdScan->realoffset, pPsdScan->realspan, pPsdScan->realseconds); + + + +} + +VOID +EXhalbtc8723b1ant_AntennaIsolation( + IN PBTC_COEXIST pBtCoexist, + IN u4Byte centFreq, + IN u4Byte offset, + IN u4Byte span, + IN u4Byte seconds + ) +{ + + +} + +VOID +EXhalbtc8723b1ant_PSDScan( + IN PBTC_COEXIST pBtCoexist, + IN u4Byte centFreq, + IN u4Byte offset, + IN u4Byte span, + IN u4Byte seconds + ) +{ + + +} + +VOID +EXhalbtc8723b1ant_DisplayAntIsolation( + IN PBTC_COEXIST pBtCoexist + ) +{ + + //halbtc8723b1ant_ShowPSDData(pBtCoexist); +} + #endif diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8723b1Ant.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8723b1Ant.h index cb4b89b2aa0701..248874d55f56ee 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8723b1Ant.h +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8723b1Ant.h @@ -17,6 +17,8 @@ #define BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT 2 +#define BT_8723B_1ANT_WIFI_NOISY_THRESH 30 //max: 255 + typedef enum _BT_INFO_SRC_8723B_1ANT{ BT_INFO_SRC_8723B_1ANT_WIFI_FW = 0x0, BT_INFO_SRC_8723B_1ANT_BT_RSP = 0x1, @@ -60,6 +62,9 @@ typedef enum _BT_8723B_1ANT_COEX_ALGO{ }BT_8723B_1ANT_COEX_ALGO,*PBT_8723B_1ANT_COEX_ALGO; typedef struct _COEX_DM_8723B_1ANT{ + // hw setting + u1Byte preAntPosType; + u1Byte curAntPosType; // fw mechanism BOOLEAN bCurIgnoreWlanAct; BOOLEAN bPreIgnoreWlanAct; @@ -109,6 +114,7 @@ typedef struct _COEX_DM_8723B_1ANT{ u1Byte curRetryLimitType; u1Byte preAmpduTimeType; u1Byte curAmpduTimeType; + u4Byte nArpCnt; u1Byte errorCondition; } COEX_DM_8723B_1ANT, *PCOEX_DM_8723B_1ANT; @@ -119,6 +125,7 @@ typedef struct _COEX_STA_8723B_1ANT{ BOOLEAN bA2dpExist; BOOLEAN bHidExist; BOOLEAN bPanExist; + BOOLEAN bBtHiPriLinkExist; BOOLEAN bUnderLps; BOOLEAN bUnderIps; @@ -127,25 +134,90 @@ typedef struct _COEX_STA_8723B_1ANT{ u4Byte highPriorityRx; u4Byte lowPriorityTx; u4Byte lowPriorityRx; - u1Byte btRssi; + s1Byte btRssi; + BOOLEAN bBtTxRxMask; u1Byte preBtRssiState; u1Byte preWifiRssiState[4]; BOOLEAN bC2hBtInfoReqSent; u1Byte btInfoC2h[BT_INFO_SRC_8723B_1ANT_MAX][10]; u4Byte btInfoC2hCnt[BT_INFO_SRC_8723B_1ANT_MAX]; + BOOLEAN bBtWhckTest; BOOLEAN bC2hBtInquiryPage; + BOOLEAN bC2hBtPage; //Add for win8.1 page out issue + BOOLEAN bWiFiIsHighPriTask; //Add for win8.1 page out issue u1Byte btRetryCnt; u1Byte btInfoExt; + u4Byte popEventCnt; + u1Byte nScanAPNum; + + u4Byte nCRCOK_CCK; + u4Byte nCRCOK_11g; + u4Byte nCRCOK_11n; + u4Byte nCRCOK_11nAgg; + + u4Byte nCRCErr_CCK; + u4Byte nCRCErr_11g; + u4Byte nCRCErr_11n; + u4Byte nCRCErr_11nAgg; + + BOOLEAN bCCKLock; + BOOLEAN bPreCCKLock; + BOOLEAN bCCKEverLock; + u1Byte nCoexTableType; + + BOOLEAN bForceLpsOn; }COEX_STA_8723B_1ANT, *PCOEX_STA_8723B_1ANT; +#define BT_8723B_1ANT_ANTDET_PSD_POINTS 256 //MAX:1024 +#define BT_8723B_1ANT_ANTDET_PSD_AVGNUM 1 //MAX:3 + +typedef struct _PSDSCAN_STA_8723B_1ANT{ + +BOOLEAN bIsAntDetEnable; +BOOLEAN bIsAntIsoEnable; +BOOLEAN bIsPSDScanEnable; + +u4Byte realcentFreq; //ex:2412 +s4Byte realoffset; +u4Byte realspan; +u4Byte realseconds; + +BOOLEAN bAntDetFinish; +u1Byte nAntIsolation; +u4Byte nPSDBandWidth; //unit: Hz +u4Byte nPSDPoint; //128/256/512/1024 +u4Byte nPSDReport[1024]; //unit:dB (20logx), 0~255 +u4Byte nPSDReport_MaxHold[1024]; //unit:dB (20logx), 0~255 +u4Byte nPSDStartPoint; +u4Byte nPSDStopPoint; +u4Byte nPSDMaxValuePoint; +u4Byte nPSDMaxValue; +u4Byte nPSDStartBase; +u4Byte nPSDAvgNum; // 1/8/16/32 +u4Byte nPSDGenCount; +u4Byte nPSDGenTotalCount; +BOOLEAN bIsSetupFinish; +BOOLEAN bIsPSDRunning; +BOOLEAN bIsPSDShowMaxOnly; +} PSDSCAN_STA_8723B_1ANT, *PPSDSCAN_STA_8723B_1ANT; + //=========================================== // The following is interface which will notify coex module. //=========================================== VOID -EXhalbtc8723b1ant_InitHwConfig( +EXhalbtc8723b1ant_PowerOnSetting( + IN PBTC_COEXIST pBtCoexist + ); +VOID +EXhalbtc8723b1ant_PreLoadFirmware( IN PBTC_COEXIST pBtCoexist ); VOID +EXhalbtc8723b1ant_InitHwConfig( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bWifiOnly + ); +VOID EXhalbtc8723b1ant_InitCoexDm( IN PBTC_COEXIST pBtCoexist ); @@ -186,6 +258,11 @@ EXhalbtc8723b1ant_BtInfoNotify( IN u1Byte length ); VOID +EXhalbtc8723b1ant_RfStatusNotify( + IN PBTC_COEXIST pBtCoexist, + IN u1Byte type + ); +VOID EXhalbtc8723b1ant_HaltNotify( IN PBTC_COEXIST pBtCoexist ); @@ -206,4 +283,33 @@ VOID EXhalbtc8723b1ant_DisplayCoexInfo( IN PBTC_COEXIST pBtCoexist ); +VOID +EXhalbtc8723b1ant_AntennaDetection( + IN PBTC_COEXIST pBtCoexist, + IN u4Byte centFreq, + IN u4Byte offset, + IN u4Byte span, + IN u4Byte seconds + ); +VOID +EXhalbtc8723b1ant_AntennaIsolation( + IN PBTC_COEXIST pBtCoexist, + IN u4Byte centFreq, + IN u4Byte offset, + IN u4Byte span, + IN u4Byte seconds + ); + +VOID +EXhalbtc8723b1ant_PSDScan( + IN PBTC_COEXIST pBtCoexist, + IN u4Byte centFreq, + IN u4Byte offset, + IN u4Byte span, + IN u4Byte seconds + ); +VOID +EXhalbtc8723b1ant_DisplayAntIsolation( + IN PBTC_COEXIST pBtCoexist + ); diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8723b2Ant.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8723b2Ant.c index 838150a3c08e20..c0ced8e21a8931 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8723b2Ant.c +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8723b2Ant.c @@ -27,8 +27,8 @@ const char *const GLBtInfoSrc8723b2Ant[]={ "BT Info[bt auto report]", }; -u4Byte GLCoexVerDate8723b2Ant=20131113; -u4Byte GLCoexVer8723b2Ant=0x3f; +u4Byte GLCoexVerDate8723b2Ant=20140903; +u4Byte GLCoexVer8723b2Ant=0x43; //============================================================ // local function proto type if needed @@ -303,6 +303,31 @@ halbtc8723b2ant_MonitorBtEnableDisable( } } +VOID +halbtc8723b2ant_LimitedRx( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bForceExec, + IN BOOLEAN bRejApAggPkt, + IN BOOLEAN bBtCtrlAggBufSize, + IN u1Byte aggBufSize + ) +{ + BOOLEAN bRejectRxAgg=bRejApAggPkt; + BOOLEAN bBtCtrlRxAggSize=bBtCtrlAggBufSize; + u1Byte rxAggSize=aggBufSize; + + //============================================ + // Rx Aggregation related setting + //============================================ + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_TO_REJ_AP_AGG_PKT, &bRejectRxAgg); + // decide BT control aggregation buf size or not + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_CTRL_AGG_SIZE, &bBtCtrlRxAggSize); + // aggregation buf size, only work when BT control Rx aggregation size. + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_U1_AGG_BUF_SIZE, &rxAggSize); + // real update aggregation setting + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_AGGREGATE_CTRL, NULL); +} + VOID halbtc8723b2ant_MonitorBtCtr( IN PBTC_COEXIST pBtCoexist @@ -312,6 +337,8 @@ halbtc8723b2ant_MonitorBtCtr( u4Byte regHPTx=0, regHPRx=0, regLPTx=0, regLPRx=0; u1Byte u1Tmp; + PBTC_BT_LINK_INFO pBtLinkInfo=&pBtCoexist->btLinkInfo; + regHPTxRx = 0x770; regLPTxRx = 0x774; @@ -328,6 +355,15 @@ halbtc8723b2ant_MonitorBtCtr( pCoexSta->lowPriorityTx = regLPTx; pCoexSta->lowPriorityRx = regLPRx; + if ( (pCoexSta->lowPriorityRx >= 950) && (pCoexSta->lowPriorityRx >= pCoexSta->lowPriorityTx) && (!pCoexSta->bUnderIps) ) + { + pBtLinkInfo->bSlaveRole = TRUE; + } + else + { + pBtLinkInfo->bSlaveRole = FALSE; + } + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], High Priority Tx/Rx (reg 0x%x)=0x%x(%d)/0x%x(%d)\n", regHPTxRx, regHPTx, regHPTx, regHPRx, regHPRx)); BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], Low Priority Tx/Rx (reg 0x%x)=0x%x(%d)/0x%x(%d)\n", @@ -337,6 +373,48 @@ halbtc8723b2ant_MonitorBtCtr( pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0xc); } +VOID +halbtc8723b2ant_MonitorWiFiCtr( + IN PBTC_COEXIST pBtCoexist + ) +{ + u4Byte u4Tmp; + u2Byte u2Tmp[3]; + s4Byte wifiRssi=0; + BOOLEAN bWifiBusy = FALSE, bWifiUnderBMode = FALSE; + static u1Byte nCCKLockCounter = 0; + + + if (pCoexSta->bUnderIps) + { + pCoexSta->nCRCOK_CCK = 0; + pCoexSta->nCRCOK_11g = 0; + pCoexSta->nCRCOK_11n = 0; + pCoexSta->nCRCOK_11nAgg = 0; + + pCoexSta->nCRCErr_CCK = 0; + pCoexSta->nCRCErr_11g = 0; + pCoexSta->nCRCErr_11n = 0; + pCoexSta->nCRCErr_11nAgg = 0; + } + else + { + pCoexSta->nCRCOK_CCK = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0xf88); + pCoexSta->nCRCOK_11g = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xf94); + pCoexSta->nCRCOK_11n = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xf90); + pCoexSta->nCRCOK_11nAgg= pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xfb8); + + pCoexSta->nCRCErr_CCK = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0xf84); + pCoexSta->nCRCErr_11g = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xf96); + pCoexSta->nCRCErr_11n = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xf92); + pCoexSta->nCRCErr_11nAgg = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xfba); + } + + //reset counter + pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0xf16, 0x1, 0x1); + pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0xf16, 0x1, 0x0); +} + VOID halbtc8723b2ant_QueryBtInfo( IN PBTC_COEXIST pBtCoexist @@ -362,6 +440,8 @@ halbtc8723b2ant_IsWifiStatusChanged( static BOOLEAN bPreWifiBusy=FALSE, bPreUnder4way=FALSE, bPreBtHsOn=FALSE; BOOLEAN bWifiBusy=FALSE, bUnder4way=FALSE, bBtHsOn=FALSE; BOOLEAN bWifiConnected=FALSE; + u1Byte wifiRssiState=BTC_RSSI_STATE_HIGH; + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); @@ -385,6 +465,15 @@ halbtc8723b2ant_IsWifiStatusChanged( bPreBtHsOn = bBtHsOn; return TRUE; } + + + wifiRssiState = halbtc8723b2ant_WifiRssiState(pBtCoexist,3, 2, BT_8723B_2ANT_WIFI_RSSI_COEXSWITCH_THRES, 0); + + if ( (BTC_RSSI_STATE_HIGH ==wifiRssiState ) || (BTC_RSSI_STATE_LOW ==wifiRssiState )) + { + return TRUE; + } + } return FALSE; @@ -685,50 +774,6 @@ halbtc8723b2ant_ActionAlgorithm( return algorithm; } -BOOLEAN -halbtc8723b2ant_NeedToDecBtPwr( - IN PBTC_COEXIST pBtCoexist - ) -{ - BOOLEAN bRet=FALSE; - BOOLEAN bBtHsOn=FALSE, bWifiConnected=FALSE; - s4Byte btHsRssi=0; - u1Byte btRssiState; - - if(!pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn)) - return FALSE; - if(!pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected)) - return FALSE; - if(!pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_HS_RSSI, &btHsRssi)) - return FALSE; - - btRssiState = halbtc8723b2ant_BtRssiState(2, 29, 0); - - if(bWifiConnected) - { - if(bBtHsOn) - { - if(btHsRssi > 37) - { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], Need to decrease bt power for HS mode!!\n")); - bRet = TRUE; - } - } - else - { - if( (btRssiState == BTC_RSSI_STATE_HIGH) || - (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) - { - - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], Need to decrease bt power for Wifi is connected!!\n")); - bRet = TRUE; - } - } - } - - return bRet; -} - VOID halbtc8723b2ant_SetFwDacSwingLevel( IN PBTC_COEXIST pBtCoexist, @@ -750,20 +795,15 @@ halbtc8723b2ant_SetFwDacSwingLevel( VOID halbtc8723b2ant_SetFwDecBtPwr( IN PBTC_COEXIST pBtCoexist, - IN BOOLEAN bDecBtPwr + IN u1Byte decBtPwrLvl ) { u1Byte H2C_Parameter[1] ={0}; - H2C_Parameter[0] = 0; - - if(bDecBtPwr) - { - H2C_Parameter[0] |= BIT1; - } + H2C_Parameter[0] = decBtPwrLvl; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], decrease Bt Power : %s, FW write 0x62=0x%x\n", - (bDecBtPwr? "Yes!!":"No!!"), H2C_Parameter[0])); + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], decrease Bt Power level = %d, FW write 0x62=0x%x\n", + decBtPwrLvl, H2C_Parameter[0])); pBtCoexist->fBtcFillH2c(pBtCoexist, 0x62, 1, H2C_Parameter); } @@ -772,24 +812,24 @@ VOID halbtc8723b2ant_DecBtPwr( IN PBTC_COEXIST pBtCoexist, IN BOOLEAN bForceExec, - IN BOOLEAN bDecBtPwr + IN u1Byte decBtPwrLvl ) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], %s Dec BT power = %s\n", - (bForceExec? "force to":""), ((bDecBtPwr)? "ON":"OFF"))); - pCoexDm->bCurDecBtPwr = bDecBtPwr; + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], %s Dec BT power level = %d\n", + (bForceExec? "force to":""), decBtPwrLvl)); + pCoexDm->curBtDecPwrLvl = decBtPwrLvl; if(!bForceExec) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], bPreDecBtPwr=%d, bCurDecBtPwr=%d\n", - pCoexDm->bPreDecBtPwr, pCoexDm->bCurDecBtPwr)); + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], preBtDecPwrLvl=%d, curBtDecPwrLvl=%d\n", + pCoexDm->preBtDecPwrLvl, pCoexDm->curBtDecPwrLvl)); - if(pCoexDm->bPreDecBtPwr == pCoexDm->bCurDecBtPwr) + if(pCoexDm->preBtDecPwrLvl == pCoexDm->curBtDecPwrLvl) return; } - halbtc8723b2ant_SetFwDecBtPwr(pBtCoexist, pCoexDm->bCurDecBtPwr); + halbtc8723b2ant_SetFwDecBtPwr(pBtCoexist, pCoexDm->curBtDecPwrLvl); - pCoexDm->bPreDecBtPwr = pCoexDm->bCurDecBtPwr; + pCoexDm->preBtDecPwrLvl = pCoexDm->curBtDecPwrLvl; } VOID @@ -1225,46 +1265,57 @@ halbtc8723b2ant_CoexTableWithType( IN u1Byte type ) { + pCoexSta->nCoexTableType = type; + switch(type) { case 0: - halbtc8723b2ant_CoexTable(pBtCoexist, bForceExec, 0x55555555, 0x55555555, 0xffff, 0x3); + halbtc8723b2ant_CoexTable(pBtCoexist, bForceExec, 0x55555555, 0x55555555, 0xffffff, 0x3); break; case 1: - halbtc8723b2ant_CoexTable(pBtCoexist, bForceExec, 0x55555555, 0x5afa5afa, 0xffff, 0x3); + halbtc8723b2ant_CoexTable(pBtCoexist, bForceExec, 0x55555555, 0x5afa5afa, 0xffffff, 0x3); break; case 2: - halbtc8723b2ant_CoexTable(pBtCoexist, bForceExec, 0x5a5a5a5a, 0x5a5a5a5a, 0xffff, 0x3); + halbtc8723b2ant_CoexTable(pBtCoexist, bForceExec, 0x5ada5ada, 0x5ada5ada, 0xffffff, 0x3); break; case 3: - halbtc8723b2ant_CoexTable(pBtCoexist, bForceExec, 0xaaaaaaaa, 0xaaaaaaaa, 0xffff, 0x3); + halbtc8723b2ant_CoexTable(pBtCoexist, bForceExec, 0xaaaaaaaa, 0xaaaaaaaa, 0xffffff, 0x3); break; case 4: - halbtc8723b2ant_CoexTable(pBtCoexist, bForceExec, 0xffffffff, 0xffffffff, 0xffff, 0x3); + halbtc8723b2ant_CoexTable(pBtCoexist, bForceExec, 0xffffffff, 0xffffffff, 0xffffff, 0x3); break; case 5: - halbtc8723b2ant_CoexTable(pBtCoexist, bForceExec, 0x5fff5fff, 0x5fff5fff, 0xffff, 0x3); + halbtc8723b2ant_CoexTable(pBtCoexist, bForceExec, 0x5fff5fff, 0x5fff5fff, 0xffffff, 0x3); break; case 6: - halbtc8723b2ant_CoexTable(pBtCoexist, bForceExec, 0x55ff55ff, 0x5a5a5a5a, 0xffff, 0x3); + halbtc8723b2ant_CoexTable(pBtCoexist, bForceExec, 0x55ff55ff, 0x5a5a5a5a, 0xffffff, 0x3); break; case 7: - halbtc8723b2ant_CoexTable(pBtCoexist, bForceExec, 0x55ff55ff, 0x5afa5afa, 0xffff, 0x3); + halbtc8723b2ant_CoexTable(pBtCoexist, bForceExec, 0x55dd55dd, 0x5ada5ada, 0xffffff, 0x3); break; case 8: - halbtc8723b2ant_CoexTable(pBtCoexist, bForceExec, 0x5aea5aea, 0x5aea5aea, 0xffff, 0x3); + halbtc8723b2ant_CoexTable(pBtCoexist, bForceExec, 0x55dd55dd, 0x5ada5ada, 0xffffff, 0x3); break; case 9: - halbtc8723b2ant_CoexTable(pBtCoexist, bForceExec, 0x55ff55ff, 0x5aea5aea, 0xffff, 0x3); + halbtc8723b2ant_CoexTable(pBtCoexist, bForceExec, 0x55dd55dd, 0x5ada5ada, 0xffffff, 0x3); break; case 10: - halbtc8723b2ant_CoexTable(pBtCoexist, bForceExec, 0x55ff55ff, 0x5aff5aff, 0xffff, 0x3); + halbtc8723b2ant_CoexTable(pBtCoexist, bForceExec, 0x55dd55dd, 0x5ada5ada, 0xffffff, 0x3); break; case 11: - halbtc8723b2ant_CoexTable(pBtCoexist, bForceExec, 0x55ff55ff, 0x5a5f5a5f, 0xffff, 0x3); + halbtc8723b2ant_CoexTable(pBtCoexist, bForceExec, 0x55dd55dd, 0x5ada5ada, 0xffffff, 0x3); break; case 12: - halbtc8723b2ant_CoexTable(pBtCoexist, bForceExec, 0x55ff55ff, 0x5f5f5f5f, 0xffff, 0x3); + halbtc8723b2ant_CoexTable(pBtCoexist, bForceExec, 0x55dd55dd, 0x5ada5ada, 0xffffff, 0x3); + break; + case 13: + halbtc8723b2ant_CoexTable(pBtCoexist, bForceExec, 0x5fff5fff, 0xaaaaaaaa, 0xffffff, 0x3); + break; + case 14: + halbtc8723b2ant_CoexTable(pBtCoexist, bForceExec, 0x5fff5fff, 0x5ada5ada, 0xffffff, 0x3); + break; + case 15: + halbtc8723b2ant_CoexTable(pBtCoexist, bForceExec, 0x55dd55dd, 0xaaaaaaaa, 0xffffff, 0x3); break; default: break; @@ -1290,6 +1341,55 @@ halbtc8723b2ant_SetFwIgnoreWlanAct( pBtCoexist->fBtcFillH2c(pBtCoexist, 0x63, 1, H2C_Parameter); } +VOID +halbtc8723b2ant_SetLpsRpwm( + IN PBTC_COEXIST pBtCoexist, + IN u1Byte lpsVal, + IN u1Byte rpwmVal + ) +{ + u1Byte lps=lpsVal; + u1Byte rpwm=rpwmVal; + + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_U1_LPS_VAL, &lps); + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_U1_RPWM_VAL, &rpwm); +} + +VOID +halbtc8723b2ant_LpsRpwm( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bForceExec, + IN u1Byte lpsVal, + IN u1Byte rpwmVal + ) +{ + BOOLEAN bForceExecPwrCmd=FALSE; + + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], %s set lps/rpwm=0x%x/0x%x \n", + (bForceExec? "force to":""), lpsVal, rpwmVal)); + pCoexDm->curLps = lpsVal; + pCoexDm->curRpwm = rpwmVal; + + if(!bForceExec) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], LPS-RxBeaconMode=0x%x , LPS-RPWM=0x%x!!\n", + pCoexDm->curLps, pCoexDm->curRpwm)); + + if( (pCoexDm->preLps == pCoexDm->curLps) && + (pCoexDm->preRpwm == pCoexDm->curRpwm) ) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], LPS-RPWM_Last=0x%x , LPS-RPWM_Now=0x%x!!\n", + pCoexDm->preRpwm, pCoexDm->curRpwm)); + + return; + } + } + halbtc8723b2ant_SetLpsRpwm(pBtCoexist, lpsVal, rpwmVal); + + pCoexDm->preLps = pCoexDm->curLps; + pCoexDm->preRpwm = pCoexDm->curRpwm; +} + VOID halbtc8723b2ant_IgnoreWlanAct( IN PBTC_COEXIST pBtCoexist, @@ -1326,6 +1426,12 @@ halbtc8723b2ant_SetFwPstdma( { u1Byte H2C_Parameter[5] ={0}; + + if ( (pCoexSta->bA2dpExist) && (pCoexSta->bHidExist) ) + { + byte5 = byte5 | 0x1; + } + H2C_Parameter[0] = byte1; H2C_Parameter[1] = byte2; H2C_Parameter[2] = byte3; @@ -1366,7 +1472,7 @@ halbtc8723b2ant_SwMechanism1( } */ - halbtc8723b2ant_RfShrink(pBtCoexist, NORMAL_EXEC, bShrinkRxLPF); + //halbtc8723b2ant_RfShrink(pBtCoexist, NORMAL_EXEC, bShrinkRxLPF); halbtc8723b2ant_LowPenaltyRa(pBtCoexist, NORMAL_EXEC, bLowPenaltyRA); } @@ -1379,9 +1485,9 @@ halbtc8723b2ant_SwMechanism2( IN u4Byte dacSwingLvl ) { - halbtc8723b2ant_AgcTable(pBtCoexist, NORMAL_EXEC, bAGCTableShift); + //halbtc8723b2ant_AgcTable(pBtCoexist, NORMAL_EXEC, bAGCTableShift); //halbtc8723b2ant_AdcBackOff(pBtCoexist, NORMAL_EXEC, bADCBackOff); - halbtc8723b2ant_DacSwing(pBtCoexist, NORMAL_EXEC, bSWDACSwing, dacSwingLvl); + //halbtc8723b2ant_DacSwing(pBtCoexist, NORMAL_EXEC, bSWDACSwing, dacSwingLvl); } VOID @@ -1401,46 +1507,84 @@ halbtc8723b2ant_SetAntPath( pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_EXT_SWITCH, &bPgExtSwitch); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_FW_VER, &fwVer); // [31:16]=fw ver, [15:0]=fw sub ver - if((fwVer<0xc0000) || bPgExtSwitch) + if((fwVer>0 && fwVer<0xc0000) || bPgExtSwitch) bUseExtSwitch = TRUE; if(bInitHwCfg) { - // 0x4c[23]=0, 0x4c[24]=1 Antenna control by WL/BT - u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x4c); - u4Tmp &=~BIT23; - u4Tmp |= BIT24; - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x4c, u4Tmp); - + pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x39, 0x8, 0x1); pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x974, 0xff); pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x944, 0x3, 0x3); pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x930, 0x77); pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x67, 0x20, 0x1); - //Force GNT_BT to low - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x765, 0x18, 0x0); - pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x948, 0x0); + if(fwVer >= 0x180000) + { + /* Use H2C to set GNT_BT to High to avoid A2DP click */ + H2C_Parameter[0] = 1; + pBtCoexist->fBtcFillH2c(pBtCoexist, 0x6E, 1, H2C_Parameter); + } + else + { + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x765, 0x18); + } + + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x0); + + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); //WiFi TRx Mask off + //remove due to interrupt is disabled that polling c2h will fail and delay 100ms. + //pBtCoexist->fBtcSetBtReg(pBtCoexist, BTC_BT_REG_RF, 0x3c, 0x01); //BT TRx Mask off if(pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) { //tell firmware "no antenna inverse" H2C_Parameter[0] = 0; - H2C_Parameter[1] = 1; //ext switch type - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x65, 2, H2C_Parameter); } else { //tell firmware "antenna inverse" H2C_Parameter[0] = 1; - H2C_Parameter[1] = 1; //ext switch type - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x65, 2, H2C_Parameter); + } + + if (bUseExtSwitch) + { + //ext switch type + H2C_Parameter[1] = 1; + } + else + { + //int switch type + H2C_Parameter[1] = 0; + } + pBtCoexist->fBtcFillH2c(pBtCoexist, 0x65, 2, H2C_Parameter); + } + else + { + if(fwVer >= 0x180000) + { + /* Use H2C to set GNT_BT to "Control by PTA"*/ + H2C_Parameter[0] = 0; + pBtCoexist->fBtcFillH2c(pBtCoexist, 0x6E, 1, H2C_Parameter); + } + else + { + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x765, 0x0); } } // ext switch setting if(bUseExtSwitch) { - pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x948, 0x0); // fixed internal switch S1->WiFi, S0->BT + if (bInitHwCfg) + { + // 0x4c[23]=0, 0x4c[24]=1 Antenna control by WL/BT + u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x4c); + u4Tmp &=~BIT23; + u4Tmp |= BIT24; + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x4c, u4Tmp); + } + + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x0); // fixed internal switch S1->WiFi, S0->BT switch(antPosType) { case BTC_ANT_WIFI_AT_MAIN: @@ -1453,15 +1597,23 @@ halbtc8723b2ant_SetAntPath( } else // internal switch { - // fixed ext switch - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x1); + if (bInitHwCfg) + { + // 0x4c[23]=0, 0x4c[24]=1 Antenna control by WL/BT + u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x4c); + u4Tmp |= BIT23; + u4Tmp &=~BIT24; + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x4c, u4Tmp); + } + + pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x64, 0x1, 0x0); //fixed external switch S1->Main, S0->Aux switch(antPosType) { case BTC_ANT_WIFI_AT_MAIN: - pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x948, 0x0); // fixed internal switch S1->WiFi, S0->BT + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x0); // fixed internal switch S1->WiFi, S0->BT break; case BTC_ANT_WIFI_AT_AUX: - pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x948, 0x280); // fixed internal switch S0->WiFi, S1->BT + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x280); // fixed internal switch S0->WiFi, S1->BT break; } } @@ -1477,6 +1629,16 @@ halbtc8723b2ant_PsTdma( { BOOLEAN bTurnOnByCnt=FALSE; u1Byte psTdmaTypeByCnt=0; + u1Byte wifiRssiState1, btRssiState; + + + wifiRssiState1 = halbtc8723b2ant_WifiRssiState(pBtCoexist, 1, 2, BT_8723B_2ANT_WIFI_RSSI_COEXSWITCH_THRES, 0); + btRssiState = halbtc8723b2ant_BtRssiState(2, BT_8723B_2ANT_BT_RSSI_COEXSWITCH_THRES, 0); + + if (!(BTC_RSSI_HIGH(wifiRssiState1) && BTC_RSSI_HIGH(btRssiState)) && bTurnOn) + { + type = type +100; //for WiFi RSSI low or BT RSSI low + } BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], %s turn %s PS TDMA, type=%d\n", (bForceExec? "force to":""), (bTurnOn? "ON":"OFF"), type)); @@ -1500,10 +1662,12 @@ halbtc8723b2ant_PsTdma( { case 1: default: - halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1a, 0x1a, 0xe1, 0x90); + //halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1a, 0x1a, 0xe1, 0x90); + halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x3c, 0x03, 0xf1, 0x90); break; case 2: - halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x12, 0x12, 0xe1, 0x90); + //halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x12, 0x12, 0xe1, 0x90); + halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x2d, 0x03, 0xf1, 0x90); break; case 3: halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1c, 0x3, 0xf1, 0x90); @@ -1512,10 +1676,12 @@ halbtc8723b2ant_PsTdma( halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x10, 0x03, 0xf1, 0x90); break; case 5: - halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1a, 0x1a, 0x60, 0x90); + //halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1a, 0x1a, 0x60, 0x90); + halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x3c, 0x3, 0x70, 0x90); break; case 6: - halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x12, 0x12, 0x60, 0x90); + //halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x12, 0x12, 0x60, 0x90); + halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x2d, 0x3, 0x70, 0x90); break; case 7: halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1c, 0x3, 0x70, 0x90); @@ -1524,28 +1690,36 @@ halbtc8723b2ant_PsTdma( halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xa3, 0x10, 0x3, 0x70, 0x90); break; case 9: - halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1a, 0x1a, 0xe1, 0x90); + //halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1a, 0x1a, 0xe1, 0x90); + halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x3c, 0x03, 0xf1, 0x90); break; case 10: - halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x12, 0x12, 0xe1, 0x90); + //halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x12, 0x12, 0xe1, 0x90); + halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x2d, 0x03, 0xf1, 0x90); break; case 11: - halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0xa, 0xa, 0xe1, 0x90); + //halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0xa, 0xa, 0xe1, 0x90); + halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1c, 0x3, 0xf1, 0x90); break; case 12: - halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x5, 0x5, 0xe1, 0x90); + //halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x5, 0x5, 0xe1, 0x90); + halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x10, 0x3, 0xf1, 0x90); break; case 13: - halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1a, 0x1a, 0x60, 0x90); + //halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1a, 0x1a, 0x60, 0x90); + halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x3c, 0x3, 0x70, 0x90); break; case 14: - halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x12, 0x12, 0x60, 0x90); + //halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x12, 0x12, 0x60, 0x90); + halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x2d, 0x3, 0x70, 0x90); break; case 15: - halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0xa, 0xa, 0x60, 0x90); + //halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0xa, 0xa, 0x60, 0x90); + halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1c, 0x3, 0x70, 0x90); break; case 16: - halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x5, 0x5, 0x60, 0x90); + //halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x5, 0x5, 0x60, 0x90); + halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x10, 0x3, 0x70, 0x90); break; case 17: halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xa3, 0x2f, 0x2f, 0x60, 0x90); @@ -1563,7 +1737,45 @@ halbtc8723b2ant_PsTdma( halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x15, 0x03, 0x70, 0x90); break; case 71: - halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1a, 0x1a, 0xe1, 0x90); + //halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1a, 0x1a, 0xe1, 0x90); + + halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x3c, 0x03, 0xf1, 0x90); + break; + case 101: + case 105: + case 171: + halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xd3, 0x3a, 0x03, 0x70, 0x50); + break; + case 102: + case 106: + case 110: + case 114: + halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xd3, 0x2d, 0x03, 0x70, 0x50); + break; + case 103: + case 107: + case 111: + case 115: + halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xd3, 0x1c, 0x03, 0x70, 0x50); + break; + case 104: + case 108: + case 112: + case 116: + halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xd3, 0x10, 0x03, 0x70, 0x50); + break; + case 109: + halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x3c, 0x03, 0xf1, 0x90); + break; + case 113: + halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x3c, 0x03, 0x70, 0x90); + break; + case 121: + halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x15, 0x03, 0x70, 0x90); + break; + case 22: + case 122: + halbtc8723b2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x35, 0x03, 0x71, 0x11); break; } } @@ -1589,15 +1801,92 @@ halbtc8723b2ant_PsTdma( pCoexDm->prePsTdma = pCoexDm->curPsTdma; } +VOID +halbtc8723b2ant_PsTdmaCheckForPowerSaveState( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bNewPsState + ) +{ + u1Byte lpsMode=0x0; + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_LPS_MODE, &lpsMode); + + if(lpsMode) // already under LPS state + { + if(bNewPsState) + { + // keep state under LPS, do nothing. + } + else + { + // will leave LPS state, turn off psTdma first + halbtc8723b2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); + } + } + else // NO PS state + { + if(bNewPsState) + { + // will enter LPS state, turn off psTdma first + halbtc8723b2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); + } + else + { + // keep state under NO PS state, do nothing. + } + } +} + +VOID +halbtc8723b2ant_PowerSaveState( + IN PBTC_COEXIST pBtCoexist, + IN u1Byte psType, + IN u1Byte lpsVal, + IN u1Byte rpwmVal + ) +{ + BOOLEAN bLowPwrDisable=FALSE; + + switch(psType) + { + case BTC_PS_WIFI_NATIVE: + // recover to original 32k low power setting + bLowPwrDisable = FALSE; + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_NORMAL_LPS, NULL); + pCoexSta->bForceLpsOn = FALSE; + break; + case BTC_PS_LPS_ON: + halbtc8723b2ant_PsTdmaCheckForPowerSaveState(pBtCoexist, TRUE); + halbtc8723b2ant_LpsRpwm(pBtCoexist, NORMAL_EXEC, lpsVal, rpwmVal); + // when coex force to enter LPS, do not enter 32k low power. + bLowPwrDisable = TRUE; + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); + // power save must executed before psTdma. + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_ENTER_LPS, NULL); + pCoexSta->bForceLpsOn = TRUE; + break; + case BTC_PS_LPS_OFF: + halbtc8723b2ant_PsTdmaCheckForPowerSaveState(pBtCoexist, FALSE); + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_LEAVE_LPS, NULL); + pCoexSta->bForceLpsOn = FALSE; + break; + default: + break; + } +} + + VOID halbtc8723b2ant_CoexAllOff( IN PBTC_COEXIST pBtCoexist ) { // fw all off + halbtc8723b2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); halbtc8723b2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); halbtc8723b2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); - halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); // sw all off halbtc8723b2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); @@ -1614,10 +1903,12 @@ halbtc8723b2ant_InitCoexDm( ) { // force to reset coex mechanism + halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); + halbtc8723b2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); halbtc8723b2ant_PsTdma(pBtCoexist, FORCE_EXEC, FALSE, 1); halbtc8723b2ant_FwDacSwingLvl(pBtCoexist, FORCE_EXEC, 6); - halbtc8723b2ant_DecBtPwr(pBtCoexist, FORCE_EXEC, FALSE); + halbtc8723b2ant_DecBtPwr(pBtCoexist, FORCE_EXEC, 0); halbtc8723b2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); halbtc8723b2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); @@ -1628,40 +1919,139 @@ halbtc8723b2ant_ActionBtInquiry( IN PBTC_COEXIST pBtCoexist ) { + u1Byte wifiRssiState, wifiRssiState1, btRssiState; BOOLEAN bWifiConnected=FALSE; BOOLEAN bLowPwrDisable=TRUE; + BOOLEAN bScan=FALSE, bLink=FALSE, bRoam=FALSE; + + + wifiRssiState = halbtc8723b2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); + wifiRssiState1 = halbtc8723b2ant_WifiRssiState(pBtCoexist, 1, 2, BT_8723B_2ANT_WIFI_RSSI_COEXSWITCH_THRES, 0); + btRssiState = halbtc8723b2ant_BtRssiState(2, BT_8723B_2ANT_BT_RSSI_COEXSWITCH_THRES, 0); pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); - if(bWifiConnected) + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_LINK, &bLink); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_ROAM, &bRoam); + + + halbtc8723b2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + + if(bScan || bLink || bRoam) { - halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); - halbtc8723b2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 3); + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi link process + BT Inq/Page!!\n")); + halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 15); + halbtc8723b2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 22); + } + else if(bWifiConnected) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi connected + BT Inq/Page!!\n")); + halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 15); + halbtc8723b2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 22); } else { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi no-link + BT Inq/Page!!\n")); halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); halbtc8723b2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); } + halbtc8723b2ant_FwDacSwingLvl(pBtCoexist, FORCE_EXEC, 6); - halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); halbtc8723b2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); halbtc8723b2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); - +/* pCoexDm->bNeedRecover0x948 = TRUE; - pCoexDm->backup0x948 = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0x948); + pCoexDm->backup0x948 = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x948); halbtc8723b2ant_SetAntPath(pBtCoexist, BTC_ANT_WIFI_AT_AUX, FALSE, FALSE); +*/ +} + + +VOID +halbtc8723b2ant_ActionWiFiLinkProcess( + IN PBTC_COEXIST pBtCoexist + ) +{ + u4Byte u4Tmp; + u1Byte u1Tmpa, u1Tmpb; + + halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 15); + halbtc8723b2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 22); + + halbtc8723b2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8723b2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + + + u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x948); + u1Tmpa = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x765); + u1Tmpb = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x76e); + + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("############# [BTCoex], 0x948=0x%x, 0x765=0x%x, 0x76e=0x%x\n", + u4Tmp, u1Tmpa, u1Tmpb)); +} + +BOOLEAN +halbtc8723b2ant_ActionWifiIdleProcess( + IN PBTC_COEXIST pBtCoexist + ) +{ + u1Byte wifiRssiState, wifiRssiState1, btRssiState; + u4Byte wifiBw; + u1Byte apNum=0; + + wifiRssiState = halbtc8723b2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); + //wifiRssiState1 = halbtc8723b2ant_WifiRssiState(pBtCoexist, 1, 2, BT_8723B_2ANT_WIFI_RSSI_COEXSWITCH_THRES, 0); + wifiRssiState1 = halbtc8723b2ant_WifiRssiState(pBtCoexist, 1, 2, BT_8723B_2ANT_WIFI_RSSI_COEXSWITCH_THRES-20, 0); + btRssiState = halbtc8723b2ant_BtRssiState(2, BT_8723B_2ANT_BT_RSSI_COEXSWITCH_THRES, 0); + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_AP_NUM, &apNum); + + // define the office environment + if(BTC_RSSI_HIGH(wifiRssiState1) && + (pCoexSta->bHidExist == TRUE) && (pCoexSta->bA2dpExist == TRUE)) + { + + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi idle process for BT HID+A2DP exist!!\n")); + + halbtc8723b2ant_DacSwing(pBtCoexist, NORMAL_EXEC, TRUE, 0x6); + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); + + // sw all off + halbtc8723b2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8723b2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + + halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); + + halbtc8723b2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + halbtc8723b2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); + + return TRUE; + } + else + { + halbtc8723b2ant_DacSwing(pBtCoexist, NORMAL_EXEC, TRUE, 0x18); + return FALSE; + } + + } + + + BOOLEAN halbtc8723b2ant_IsCommonAction( IN PBTC_COEXIST pBtCoexist ) { + u1Byte btRssiState=BTC_RSSI_STATE_HIGH; BOOLEAN bCommon=FALSE, bWifiConnected=FALSE, bWifiBusy=FALSE; BOOLEAN bBtHsOn=FALSE, bLowPwrDisable=FALSE; + BOOLEAN bAsus8723b=FALSE; pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); @@ -1671,14 +2061,17 @@ halbtc8723b2ant_IsCommonAction( { bLowPwrDisable = FALSE; pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); + halbtc8723b2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi non-connected idle!!\n")); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); + + halbtc8723b2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); halbtc8723b2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); halbtc8723b2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); - halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); halbtc8723b2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); halbtc8723b2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); @@ -1691,14 +2084,17 @@ halbtc8723b2ant_IsCommonAction( { bLowPwrDisable = FALSE; pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); + halbtc8723b2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi connected + BT non connected-idle!!\n")); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); + + halbtc8723b2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); halbtc8723b2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); halbtc8723b2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 0xb); - halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); halbtc8723b2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); halbtc8723b2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); @@ -1713,12 +2109,15 @@ halbtc8723b2ant_IsCommonAction( if(bBtHsOn) return FALSE; BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi connected + BT connected-idle!!\n")); + halbtc8723b2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); + + halbtc8723b2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); halbtc8723b2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); halbtc8723b2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 0xb); - halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); halbtc8723b2ant_SwMechanism1(pBtCoexist,TRUE,FALSE,FALSE,FALSE); halbtc8723b2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); @@ -1733,26 +2132,17 @@ halbtc8723b2ant_IsCommonAction( if(bWifiBusy) { BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi Connected-Busy + BT Busy!!\n")); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_IS_ASUS_8723B, &bAsus8723b); + if(!bAsus8723b) bCommon = FALSE; + else + bCommon = halbtc8723b2ant_ActionWifiIdleProcess(pBtCoexist); } else { - if(bBtHsOn) - return FALSE; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi Connected-Idle + BT Busy!!\n")); - - pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); - halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); - halbtc8723b2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 21); - halbtc8723b2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 0xb); - if(halbtc8723b2ant_NeedToDecBtPwr(pBtCoexist)) - halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); - else - halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); - halbtc8723b2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); - halbtc8723b2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); - bCommon = TRUE; + //bCommon = FALSE; + bCommon = halbtc8723b2ant_ActionWifiIdleProcess(pBtCoexist); } } } @@ -2676,19 +3066,22 @@ halbtc8723b2ant_ActionSco( IN PBTC_COEXIST pBtCoexist ) { - u1Byte wifiRssiState; + u1Byte wifiRssiState, btRssiState; u4Byte wifiBw; wifiRssiState = halbtc8723b2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); + btRssiState = halbtc8723b2ant_BtRssiState(2, BT_8723B_2ANT_BT_RSSI_COEXSWITCH_THRES, 0); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); + halbtc8723b2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); + halbtc8723b2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 4); - if(halbtc8723b2ant_NeedToDecBtPwr(pBtCoexist)) - halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); + if(BTC_RSSI_HIGH(btRssiState)) + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 2); else - halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); @@ -2701,6 +3094,7 @@ halbtc8723b2ant_ActionSco( halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 8); } + halbtc8723b2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); halbtc8723b2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 0); //for voice quality // sw mechanism @@ -2744,16 +3138,18 @@ halbtc8723b2ant_ActionHid( u4Byte wifiBw; wifiRssiState = halbtc8723b2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); - btRssiState = halbtc8723b2ant_BtRssiState(2, 29, 0); + btRssiState = halbtc8723b2ant_BtRssiState(2, BT_8723B_2ANT_BT_RSSI_COEXSWITCH_THRES, 0); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); + halbtc8723b2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); + halbtc8723b2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); - if(halbtc8723b2ant_NeedToDecBtPwr(pBtCoexist)) - halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); + if(BTC_RSSI_HIGH(btRssiState)) + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 2); else - halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); @@ -2766,6 +3162,8 @@ halbtc8723b2ant_ActionHid( halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 9); } + halbtc8723b2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + if( (btRssiState == BTC_RSSI_STATE_HIGH) || (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) { @@ -2818,19 +3216,25 @@ halbtc8723b2ant_ActionA2dp( u1Byte apNum=0; wifiRssiState = halbtc8723b2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); - wifiRssiState1 = halbtc8723b2ant_WifiRssiState(pBtCoexist, 1, 2, 40, 0); - btRssiState = halbtc8723b2ant_BtRssiState(2, 29, 0); + wifiRssiState1 = halbtc8723b2ant_WifiRssiState(pBtCoexist, 1, 2, BT_8723B_2ANT_WIFI_RSSI_COEXSWITCH_THRES, 0); + btRssiState = halbtc8723b2ant_BtRssiState(2, BT_8723B_2ANT_BT_RSSI_COEXSWITCH_THRES, 0); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_AP_NUM, &apNum); // define the office environment - if(apNum >= 10 && BTC_RSSI_HIGH(wifiRssiState1)) + if( (apNum >= 10) && BTC_RSSI_HIGH(wifiRssiState1) && BTC_RSSI_HIGH(btRssiState)) { //DbgPrint(" AP#>10(%d)\n", apNum); + halbtc8723b2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); + halbtc8723b2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); halbtc8723b2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); - halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 2); + halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); + + halbtc8723b2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); halbtc8723b2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); // sw mechanism @@ -2846,18 +3250,31 @@ halbtc8723b2ant_ActionA2dp( halbtc8723b2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,TRUE,0x18); } return; + } pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); + halbtc8723b2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); halbtc8723b2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); - if(halbtc8723b2ant_NeedToDecBtPwr(pBtCoexist)) - halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); + if(BTC_RSSI_HIGH(btRssiState)) + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 2); else - halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); + + if (BTC_RSSI_HIGH(wifiRssiState1) && BTC_RSSI_HIGH(btRssiState)) + { halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); + halbtc8723b2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + } + else + { + halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 13); + halbtc8723b2ant_PowerSaveState(pBtCoexist, BTC_PS_LPS_ON, 0x50, 0x4); + } + if( (btRssiState == BTC_RSSI_STATE_HIGH) || (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) @@ -2906,21 +3323,34 @@ halbtc8723b2ant_ActionA2dpPanHs( IN PBTC_COEXIST pBtCoexist ) { - u1Byte wifiRssiState; + u1Byte wifiRssiState, wifiRssiState1, btRssiState; u4Byte wifiBw; wifiRssiState = halbtc8723b2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); + wifiRssiState1 = halbtc8723b2ant_WifiRssiState(pBtCoexist, 1, 2, BT_8723B_2ANT_WIFI_RSSI_COEXSWITCH_THRES, 0); + btRssiState = halbtc8723b2ant_BtRssiState(2, BT_8723B_2ANT_BT_RSSI_COEXSWITCH_THRES, 0); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); + halbtc8723b2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); + halbtc8723b2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); - if(halbtc8723b2ant_NeedToDecBtPwr(pBtCoexist)) - halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); + if(BTC_RSSI_HIGH(btRssiState)) + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 2); else - halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); + if (BTC_RSSI_HIGH(wifiRssiState1) && BTC_RSSI_HIGH(btRssiState)) + { halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); + halbtc8723b2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + } + else + { + halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 13); + halbtc8723b2ant_PowerSaveState(pBtCoexist, BTC_PS_LPS_ON, 0x50, 0x4); + } halbtc8723b2ant_TdmaDurationAdjust(pBtCoexist, FALSE, TRUE, 2); @@ -2961,22 +3391,34 @@ halbtc8723b2ant_ActionPanEdr( IN PBTC_COEXIST pBtCoexist ) { - u1Byte wifiRssiState, btRssiState; + u1Byte wifiRssiState,wifiRssiState1, btRssiState; u4Byte wifiBw; wifiRssiState = halbtc8723b2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); - btRssiState = halbtc8723b2ant_BtRssiState(2, 29, 0); + wifiRssiState1 = halbtc8723b2ant_WifiRssiState(pBtCoexist, 1, 2, BT_8723B_2ANT_WIFI_RSSI_COEXSWITCH_THRES, 0); + btRssiState = halbtc8723b2ant_BtRssiState(2, BT_8723B_2ANT_BT_RSSI_COEXSWITCH_THRES, 0); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); + halbtc8723b2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); + halbtc8723b2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); - if(halbtc8723b2ant_NeedToDecBtPwr(pBtCoexist)) - halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); + if(BTC_RSSI_HIGH(btRssiState)) + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 2); else - halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); + if (BTC_RSSI_HIGH(wifiRssiState1) && BTC_RSSI_HIGH(btRssiState)) + { halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 10); + halbtc8723b2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + } + else + { + halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 13); + halbtc8723b2ant_PowerSaveState(pBtCoexist, BTC_PS_LPS_ON, 0x50, 0x4); + } if( (btRssiState == BTC_RSSI_STATE_HIGH) || (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) @@ -3027,27 +3469,27 @@ halbtc8723b2ant_ActionPanHs( IN PBTC_COEXIST pBtCoexist ) { - u1Byte wifiRssiState; + u1Byte wifiRssiState, wifiRssiState1, btRssiState; u4Byte wifiBw; wifiRssiState = halbtc8723b2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); + wifiRssiState1 = halbtc8723b2ant_WifiRssiState(pBtCoexist, 1, 2, BT_8723B_2ANT_WIFI_RSSI_COEXSWITCH_THRES, 0); + btRssiState = halbtc8723b2ant_BtRssiState(2, BT_8723B_2ANT_BT_RSSI_COEXSWITCH_THRES, 0); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); + halbtc8723b2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); + halbtc8723b2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); - if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || - (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) - { - halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); - } + if(BTC_RSSI_HIGH(btRssiState)) + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 2); else - { - halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); - } + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); + halbtc8723b2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); halbtc8723b2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); @@ -3087,20 +3529,28 @@ halbtc8723b2ant_ActionPanEdrA2dp( IN PBTC_COEXIST pBtCoexist ) { - u1Byte wifiRssiState, btRssiState; + u1Byte wifiRssiState, wifiRssiState1, btRssiState; u4Byte wifiBw; wifiRssiState = halbtc8723b2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); - btRssiState = halbtc8723b2ant_BtRssiState(2, 29, 0); + wifiRssiState1 = halbtc8723b2ant_WifiRssiState(pBtCoexist, 1, 2, BT_8723B_2ANT_WIFI_RSSI_COEXSWITCH_THRES, 0); + btRssiState = halbtc8723b2ant_BtRssiState(2, BT_8723B_2ANT_BT_RSSI_COEXSWITCH_THRES, 0); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); + halbtc8723b2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); + halbtc8723b2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); - if(halbtc8723b2ant_NeedToDecBtPwr(pBtCoexist)) - halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); + if(BTC_RSSI_HIGH(btRssiState)) + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 2); else - halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); + + if (BTC_RSSI_HIGH(wifiRssiState1) && BTC_RSSI_HIGH(btRssiState)) + halbtc8723b2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + else + halbtc8723b2ant_PowerSaveState(pBtCoexist, BTC_PS_LPS_ON, 0x50, 0x4); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); @@ -3108,6 +3558,7 @@ halbtc8723b2ant_ActionPanEdrA2dp( (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) { halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 12); + if(BTC_WIFI_BW_HT40 == wifiBw) halbtc8723b2ant_TdmaDurationAdjust(pBtCoexist, FALSE, TRUE, 3); else @@ -3115,7 +3566,7 @@ halbtc8723b2ant_ActionPanEdrA2dp( } else { - halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); + halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 13); halbtc8723b2ant_TdmaDurationAdjust(pBtCoexist, FALSE, TRUE, 3); } @@ -3155,17 +3606,31 @@ halbtc8723b2ant_ActionPanEdrHid( IN PBTC_COEXIST pBtCoexist ) { - u1Byte wifiRssiState, btRssiState; + u1Byte wifiRssiState, wifiRssiState1, btRssiState; u4Byte wifiBw; wifiRssiState = halbtc8723b2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); - btRssiState = halbtc8723b2ant_BtRssiState(2, 29, 0); + wifiRssiState1 = halbtc8723b2ant_WifiRssiState(pBtCoexist, 1, 2, BT_8723B_2ANT_WIFI_RSSI_COEXSWITCH_THRES, 0); + btRssiState = halbtc8723b2ant_BtRssiState(2, BT_8723B_2ANT_BT_RSSI_COEXSWITCH_THRES, 0); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); - if(halbtc8723b2ant_NeedToDecBtPwr(pBtCoexist)) - halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); + halbtc8723b2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); + + if(BTC_RSSI_HIGH(btRssiState)) + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 2); else - halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); + + if (BTC_RSSI_HIGH(wifiRssiState1) && BTC_RSSI_HIGH(btRssiState)) + { + halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); + halbtc8723b2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + } + else + { + halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 14); + halbtc8723b2ant_PowerSaveState(pBtCoexist, BTC_PS_LPS_ON, 0x50, 0x4); + } if( (btRssiState == BTC_RSSI_STATE_HIGH) || (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) @@ -3173,13 +3638,13 @@ halbtc8723b2ant_ActionPanEdrHid( if(BTC_WIFI_BW_HT40 == wifiBw) { halbtc8723b2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 3); - halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 11); + //halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 11); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x780); } else { halbtc8723b2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); - halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); + //halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); } halbtc8723b2ant_TdmaDurationAdjust(pBtCoexist, TRUE, FALSE, 2); @@ -3187,7 +3652,7 @@ halbtc8723b2ant_ActionPanEdrHid( else { halbtc8723b2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); - halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 11); + //halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 14); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); halbtc8723b2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 2); } @@ -3229,30 +3694,42 @@ halbtc8723b2ant_ActionHidA2dpPanEdr( IN PBTC_COEXIST pBtCoexist ) { - u1Byte wifiRssiState, btRssiState; + u1Byte wifiRssiState,wifiRssiState1, btRssiState; u4Byte wifiBw; wifiRssiState = halbtc8723b2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); - btRssiState = halbtc8723b2ant_BtRssiState(2, 29, 0); + wifiRssiState1 = halbtc8723b2ant_WifiRssiState(pBtCoexist, 1, 2, BT_8723B_2ANT_WIFI_RSSI_COEXSWITCH_THRES, 0); + btRssiState = halbtc8723b2ant_BtRssiState(2, BT_8723B_2ANT_BT_RSSI_COEXSWITCH_THRES, 0); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); + halbtc8723b2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); + halbtc8723b2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); - if(halbtc8723b2ant_NeedToDecBtPwr(pBtCoexist)) - halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); + if(BTC_RSSI_HIGH(btRssiState)) + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 2); else - halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); + if (BTC_RSSI_HIGH(wifiRssiState1) && BTC_RSSI_HIGH(btRssiState)) + { + halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); + halbtc8723b2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + } + else + { + halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 14); + halbtc8723b2ant_PowerSaveState(pBtCoexist, BTC_PS_LPS_ON, 0x50, 0x4); + } - halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); if( (btRssiState == BTC_RSSI_STATE_HIGH) || (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) { if(BTC_WIFI_BW_HT40 == wifiBw) - halbtc8723b2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 2); + halbtc8723b2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 3); else halbtc8723b2ant_TdmaDurationAdjust(pBtCoexist, TRUE, FALSE, 3); } @@ -3297,33 +3774,67 @@ halbtc8723b2ant_ActionHidA2dp( IN PBTC_COEXIST pBtCoexist ) { - u1Byte wifiRssiState, btRssiState; + u1Byte wifiRssiState, wifiRssiState1, btRssiState; u4Byte wifiBw; + u1Byte apNum=0; wifiRssiState = halbtc8723b2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); - btRssiState = halbtc8723b2ant_BtRssiState(2, 29, 0); + //btRssiState = halbtc8723b2ant_BtRssiState(2, 29, 0); + wifiRssiState1 = halbtc8723b2ant_WifiRssiState(pBtCoexist, 1, 2, BT_8723B_2ANT_WIFI_RSSI_COEXSWITCH_THRES, 0); + btRssiState = halbtc8723b2ant_BtRssiState(3, BT_8723B_2ANT_BT_RSSI_COEXSWITCH_THRES, 37); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); - halbtc8723b2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); + halbtc8723b2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, TRUE, 0x5); - if(halbtc8723b2ant_NeedToDecBtPwr(pBtCoexist)) - halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); - else - halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + halbtc8723b2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); + if(BTC_WIFI_BW_LEGACY == wifiBw) + { + if(BTC_RSSI_HIGH(btRssiState)) + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 2); + else if(BTC_RSSI_MEDIUM(btRssiState)) + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 2); + else + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); + } + else + { // only 802.11N mode we have to dec bt power to 4 degree + if(BTC_RSSI_HIGH(btRssiState)) + { + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_AP_NUM, &apNum); + // need to check ap Number of Not + if(apNum < 10) + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 4); + else + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 2); + } + else if(BTC_RSSI_MEDIUM(btRssiState)) + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 2); + else + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); + } + if (BTC_RSSI_HIGH(wifiRssiState1) && BTC_RSSI_HIGH(btRssiState)) + { halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); + halbtc8723b2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + } + else + { + halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 14); + halbtc8723b2ant_PowerSaveState(pBtCoexist, BTC_PS_LPS_ON, 0x50, 0x4); + } if( (btRssiState == BTC_RSSI_STATE_HIGH) || (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) { - halbtc8723b2ant_TdmaDurationAdjust(pBtCoexist, TRUE, FALSE, 2); + halbtc8723b2ant_TdmaDurationAdjust(pBtCoexist, TRUE, FALSE, 3); } else { - halbtc8723b2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 2); + halbtc8723b2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 3); } // sw mechanism @@ -3357,6 +3868,43 @@ halbtc8723b2ant_ActionHidA2dp( } } +VOID +halbtc8723b2ant_ActionBtWhckTest( + IN PBTC_COEXIST pBtCoexist + ) +{ + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); + + // sw all off + halbtc8723b2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8723b2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + + halbtc8723b2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + + halbtc8723b2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); + halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); +} + +VOID +halbtc8723b2ant_ActionWifiMultiPort( + IN PBTC_COEXIST pBtCoexist + ) +{ + halbtc8723b2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); + halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); + + // sw all off + halbtc8723b2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8723b2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + + // hw all off + //pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); + halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); + + halbtc8723b2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + halbtc8723b2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); +} + VOID halbtc8723b2ant_RunCoexistMechanism( IN PBTC_COEXIST pBtCoexist @@ -3365,6 +3913,11 @@ halbtc8723b2ant_RunCoexistMechanism( BOOLEAN bWifiUnder5G=FALSE, bBtHsOn=FALSE; u1Byte btInfoOriginal=0, btRetryCnt=0; u1Byte algorithm=0; + u4Byte numOfWifiLink=0; + u4Byte wifiLinkStatus=0; + PBTC_BT_LINK_INFO pBtLinkInfo=&pBtCoexist->btLinkInfo; + BOOLEAN bMiracastPlusBt=FALSE; + BOOLEAN bScan=FALSE, bLink=FALSE, bRoam=FALSE; BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], RunCoexistMechanism()===>\n")); @@ -3380,6 +3933,13 @@ halbtc8723b2ant_RunCoexistMechanism( return; } + if(pCoexSta->bBtWhckTest) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BT is under WHCK TEST!!!\n")); + halbtc8723b2ant_ActionBtWhckTest(pBtCoexist); + return; + } + algorithm = halbtc8723b2ant_ActionAlgorithm(pBtCoexist); if(pCoexSta->bC2hBtInquiryPage && (BT_8723B_2ANT_COEX_ALGO_PANHS!=algorithm)) { @@ -3389,11 +3949,53 @@ halbtc8723b2ant_RunCoexistMechanism( } else { + /* if(pCoexDm->bNeedRecover0x948) { pCoexDm->bNeedRecover0x948 = FALSE; - pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x948, pCoexDm->backup0x948); + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, pCoexDm->backup0x948); } + */ + } + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_LINK, &bLink); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_ROAM, &bRoam); + + if(bScan || bLink || bRoam) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], WiFi is under Link Process !!\n")); + halbtc8723b2ant_ActionWiFiLinkProcess(pBtCoexist); + return; + } + + //for P2P + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus); + numOfWifiLink = wifiLinkStatus>>16; + + if((numOfWifiLink>=2) || (wifiLinkStatus&WIFI_P2P_GO_CONNECTED)) + { + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("############# [BTCoex], Multi-Port numOfWifiLink = %d, wifiLinkStatus = 0x%x\n", numOfWifiLink,wifiLinkStatus) ); + + if(pBtLinkInfo->bBtLinkExist) + { + bMiracastPlusBt = TRUE; + } + else + { + bMiracastPlusBt = FALSE; + } + + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_MIRACAST_PLUS_BT, &bMiracastPlusBt); + halbtc8723b2ant_ActionWifiMultiPort(pBtCoexist); + + return; + } + else + { + bMiracastPlusBt = FALSE; + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_MIRACAST_PLUS_BT, &bMiracastPlusBt); } pCoexDm->curAlgorithm = algorithm; @@ -3468,29 +4070,37 @@ halbtc8723b2ant_WifiOffHwCfg( IN PBTC_COEXIST pBtCoexist ) { - PADAPTER padapter=pBtCoexist->Adapter; + BOOLEAN bIsInMpMode = FALSE; + u1Byte H2C_Parameter[2] ={0}; + u4Byte fwVer=0; + // set wlan_act to low pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0x4); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x780); //WiFi goto standby while GNT_BT 0-->1 - - //Force GNT_BT to High - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x765, 0x18, 0x3); - if(padapter->registrypriv.mp_mode ==0) + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_FW_VER, &fwVer); + if(fwVer >= 0x180000) + { + /* Use H2C to set GNT_BT to HIGH */ + H2C_Parameter[0] = 1; + pBtCoexist->fBtcFillH2c(pBtCoexist, 0x6E, 1, H2C_Parameter); + } + else + { + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x765, 0x18); + } + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_IS_IN_MP_MODE, &bIsInMpMode); + if(!bIsInMpMode) pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x67, 0x20, 0x0); //BT select s0/s1 is controlled by BT else pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x67, 0x20, 0x1); //BT select s0/s1 is controlled by WiFi } -//============================================================ -// work around function start with wa_halbtc8723b2ant_ -//============================================================ -//============================================================ -// extern function start with EXhalbtc8723b2ant_ -//============================================================ VOID -EXhalbtc8723b2ant_InitHwConfig( - IN PBTC_COEXIST pBtCoexist +halbtc8723b2ant_InitHwConfig( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bBackUp ) { PBTC_BOARD_INFO pBoardInfo=&pBtCoexist->boardInfo; @@ -3502,9 +4112,6 @@ EXhalbtc8723b2ant_InitHwConfig( BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], 2Ant Init HW Config!!\n")); - //pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); //WiFi goto standby while GNT_BT 0-->1 - //pBtCoexist->fBtcSetBtReg(pBtCoexist, 0, 0x3c, 0x1); //BT goto standby while GNT_BT 1-->0 - // backup rf 0x1e value pCoexDm->btRf0x1eBackup = pBtCoexist->fBtcGetRfReg(pBtCoexist, BTC_RF_A, 0x1e, 0xfffff); @@ -3517,16 +4124,111 @@ EXhalbtc8723b2ant_InitHwConfig( //Antenna config halbtc8723b2ant_SetAntPath(pBtCoexist, BTC_ANT_WIFI_AT_MAIN, TRUE, FALSE); + pCoexSta->disVerInfoCnt = 0; // PTA parameter halbtc8723b2ant_CoexTableWithType(pBtCoexist, FORCE_EXEC, 0); // Enable counter statistics - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0xc); //0x76e[3] =1, WLAN_Act control by PTA + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0x4); //0x76e[3] =1, WLAN_Act control by PTA pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x778, 0x3); pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x40, 0x20, 0x1); +} + +//============================================================ +// work around function start with wa_halbtc8723b2ant_ +//============================================================ +//============================================================ +// extern function start with EXhalbtc8723b2ant_ +//============================================================ +VOID +EXhalbtc8723b2ant_PowerOnSetting( + IN PBTC_COEXIST pBtCoexist + ) +{ + PBTC_BOARD_INFO pBoardInfo=&pBtCoexist->boardInfo; + u2Byte u2Tmp=0x0; + + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x67, 0x20); - pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); //WiFi goto standby while GNT_BT 0-->1 + // enable BB, REG_SYS_FUNC_EN such that we can write 0x948 correctly. + u2Tmp = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0x2); + pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x2, u2Tmp|BIT0|BIT1); + + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x0); + + if(pBtCoexist->chipInterface == BTC_INTF_USB) + { + // fixed at S0 for USB interface + pBoardInfo->btdmAntPos = BTC_ANTENNA_AT_AUX_PORT; + } + else + { + // for PCIE and SDIO interface, we check efuse 0xc3[6] + if(pBoardInfo->singleAntPath == 0) + { + // set to S1 + pBoardInfo->btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT; + } + else if(pBoardInfo->singleAntPath == 1) + { + // set to S0 + pBoardInfo->btdmAntPos = BTC_ANTENNA_AT_AUX_PORT; + } + } +} + +VOID +EXhalbtc8723b2ant_PreLoadFirmware( + IN PBTC_COEXIST pBtCoexist + ) +{ + PBTC_BOARD_INFO pBoardInfo=&pBtCoexist->boardInfo; + u1Byte u1Tmp=0x4; /* Set BIT2 by default since it's 2ant case */ + + // + // S0 or S1 setting and Local register setting(By the setting fw can get ant number, S0/S1, ... info) + // Local setting bit define + // BIT0: "0" for no antenna inverse; "1" for antenna inverse + // BIT1: "0" for internal switch; "1" for external switch + // BIT2: "0" for one antenna; "1" for two antenna + // NOTE: here default all internal switch and 1-antenna ==> BIT1=0 and BIT2=0 + if(pBtCoexist->chipInterface == BTC_INTF_USB) + { + // fixed at S0 for USB interface + u1Tmp |= 0x1; // antenna inverse + pBtCoexist->fBtcWriteLocalReg1Byte(pBtCoexist, 0xfe08, u1Tmp); + } + else + { + // for PCIE and SDIO interface, we check efuse 0xc3[6] + if(pBoardInfo->singleAntPath == 0) + { + } + else if(pBoardInfo->singleAntPath == 1) + { + // set to S0 + u1Tmp |= 0x1; // antenna inverse + } + + if(pBtCoexist->chipInterface == BTC_INTF_PCI) + { + pBtCoexist->fBtcWriteLocalReg1Byte(pBtCoexist, 0x384, u1Tmp); + } + else if(pBtCoexist->chipInterface == BTC_INTF_SDIO) + { + pBtCoexist->fBtcWriteLocalReg1Byte(pBtCoexist, 0x60, u1Tmp); + } + } +} + +VOID +EXhalbtc8723b2ant_InitHwConfig( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bWifiOnly + ) +{ + halbtc8723b2ant_InitHwConfig(pBtCoexist, TRUE); } VOID @@ -3550,13 +4252,8 @@ EXhalbtc8723b2ant_DisplayCoexInfo( pu1Byte cliBuf=pBtCoexist->cliBuf; u1Byte u1Tmp[4], i, btInfoExt, psTdmaCase=0; u4Byte u4Tmp[4]; - BOOLEAN bRoam=FALSE, bScan=FALSE, bLink=FALSE, bWifiUnder5G=FALSE; - BOOLEAN bBtHsOn=FALSE, bWifiBusy=FALSE; - s4Byte wifiRssi=0, btHsRssi=0; - u4Byte wifiBw, wifiTrafficDir, faOfdm, faCck; - u1Byte wifiDot11Chnl, wifiHsChnl; + u4Byte faOfdm, faCck; u4Byte fwVer=0, btPatchVer=0; - u1Byte apNum=0; CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n ============[BT Coexist info]============"); CL_PRINTF(cliBuf); @@ -3569,13 +4266,6 @@ EXhalbtc8723b2ant_DisplayCoexInfo( CL_PRINTF(cliBuf); } - if(!pBoardInfo->bBtExist) - { - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n BT not exists !!!"); - CL_PRINTF(cliBuf); - return; - } - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d ", "Ant PG number/ Ant mechanism:", \ pBoardInfo->pgAntNum, pBoardInfo->btdmAntNum); CL_PRINTF(cliBuf); @@ -3590,52 +4280,39 @@ EXhalbtc8723b2ant_DisplayCoexInfo( GLCoexVerDate8723b2Ant, GLCoexVer8723b2Ant, fwVer, btPatchVer, btPatchVer); CL_PRINTF(cliBuf); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_DOT11_CHNL, &wifiDot11Chnl); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_HS_CHNL, &wifiHsChnl); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d(%d)", "Dot11 channel / HsChnl(HsMode)", \ - wifiDot11Chnl, wifiHsChnl, bBtHsOn); - CL_PRINTF(cliBuf); - - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %02x %02x %02x ", "H2C Wifi inform bt chnl Info", \ + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %02x %02x %02x ", "Wifi channel informed to BT", \ pCoexDm->wifiChnlInfo[0], pCoexDm->wifiChnlInfo[1], pCoexDm->wifiChnlInfo[2]); CL_PRINTF(cliBuf); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_WIFI_RSSI, &wifiRssi); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_HS_RSSI, &btHsRssi); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_AP_NUM, &apNum); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d", "Wifi rssi/ HS rssi/ AP#", \ - wifiRssi, btHsRssi, apNum); + // wifi status + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[Wifi Status]============"); CL_PRINTF(cliBuf); + pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_WIFI_STATUS); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_LINK, &bLink); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_ROAM, &bRoam); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d ", "Wifi bLink/ bRoam/ bScan", \ - bLink, bRoam, bScan); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[BT Status]============"); CL_PRINTF(cliBuf); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_UNDER_5G, &bWifiUnder5G); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_TRAFFIC_DIRECTION, &wifiTrafficDir); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s / %s/ %s ", "Wifi status", \ - (bWifiUnder5G? "5G":"2.4G"), - ((BTC_WIFI_BW_LEGACY==wifiBw)? "Legacy": (((BTC_WIFI_BW_HT40==wifiBw)? "HT40":"HT20"))), - ((!bWifiBusy)? "idle": ((BTC_WIFI_TRAFFIC_TX==wifiTrafficDir)? "uplink":"downlink"))); - CL_PRINTF(cliBuf); - - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = [%s/ %d/ %d] ", "BT [status/ rssi/ retryCnt]", \ + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = [%s/ %ddBm/ %d] ", "BT [status/ rssi/ retryCnt]", \ ((pBtCoexist->btInfo.bBtDisabled)? ("disabled"): ((pCoexSta->bC2hBtInquiryPage)?("inquiry/page scan"):((BT_8723B_2ANT_BT_STATUS_NON_CONNECTED_IDLE == pCoexDm->btStatus)? "non-connected idle": ( (BT_8723B_2ANT_BT_STATUS_CONNECTED_IDLE == pCoexDm->btStatus)? "connected-idle":"busy")))), - pCoexSta->btRssi, pCoexSta->btRetryCnt); + pCoexSta->btRssi-100, pCoexSta->btRetryCnt); CL_PRINTF(cliBuf); CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d / %d / %d", "SCO/HID/PAN/A2DP", \ pBtLinkInfo->bScoExist, pBtLinkInfo->bHidExist, pBtLinkInfo->bPanExist, pBtLinkInfo->bA2dpExist); CL_PRINTF(cliBuf); + + if (pStackInfo->bProfileNotified) + { pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_BT_LINK_INFO); + } + else + { + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s", "BT Role", \ + (pBtLinkInfo->bSlaveRole )? "Slave":"Master"); + CL_PRINTF(cliBuf); + } btInfoExt = pCoexSta->btInfoExt; CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s", "BT Info A2DP rate", \ @@ -3655,12 +4332,6 @@ EXhalbtc8723b2ant_DisplayCoexInfo( } } - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s/%s", "PS state, IPS/LPS", \ - ((pCoexSta->bUnderIps? "IPS ON":"IPS OFF")), - ((pCoexSta->bUnderLps? "LPS ON":"LPS OFF"))); - CL_PRINTF(cliBuf); - pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_FW_PWR_MODE_CMD); - // Sw mechanism CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[Sw mechanism]============"); CL_PRINTF(cliBuf); @@ -3682,8 +4353,12 @@ EXhalbtc8723b2ant_DisplayCoexInfo( pCoexDm->psTdmaPara[4], psTdmaCase, pCoexDm->bAutoTdmaAdjust); CL_PRINTF(cliBuf); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d", "Coex Table Type", \ + pCoexSta->nCoexTableType); + CL_PRINTF(cliBuf); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d ", "DecBtPwr/ IgnWlanAct", \ - pCoexDm->bCurDecBtPwr, pCoexDm->bCurIgnoreWlanAct); + pCoexDm->curBtDecPwrLvl, pCoexDm->bCurIgnoreWlanAct); CL_PRINTF(cliBuf); // Hw setting @@ -3752,6 +4427,14 @@ EXhalbtc8723b2ant_DisplayCoexInfo( u4Tmp[0]&0xffff, faOfdm, faCck); CL_PRINTF(cliBuf); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d/ %d", "CRC_OK CCK/11g/11n/11n-Agg", \ + pCoexSta->nCRCOK_CCK, pCoexSta->nCRCOK_11g, pCoexSta->nCRCOK_11n, pCoexSta->nCRCOK_11nAgg); + CL_PRINTF(cliBuf); + + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d/ %d", "CRC_Err CCK/11g/11n/11n-Agg", \ + pCoexSta->nCRCErr_CCK, pCoexSta->nCRCErr_11g, pCoexSta->nCRCErr_11n, pCoexSta->nCRCErr_11nAgg); + CL_PRINTF(cliBuf); + u4Tmp[0] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x6c0); u4Tmp[1] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x6c4); u4Tmp[2] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x6c8); @@ -3767,7 +4450,7 @@ EXhalbtc8723b2ant_DisplayCoexInfo( pCoexSta->lowPriorityRx, pCoexSta->lowPriorityTx); CL_PRINTF(cliBuf); #if(BT_AUTO_REPORT_ONLY_8723B_2ANT == 1) - halbtc8723b2ant_MonitorBtCtr(pBtCoexist); + //halbtc8723b2ant_MonitorBtCtr(pBtCoexist); #endif pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_COEX_STATISTICS); } @@ -3791,7 +4474,7 @@ EXhalbtc8723b2ant_IpsNotify( { BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], IPS LEAVE notify\n")); pCoexSta->bUnderIps = FALSE; - EXhalbtc8723b2ant_InitHwConfig(pBtCoexist); + halbtc8723b2ant_InitHwConfig(pBtCoexist, FALSE); halbtc8723b2ant_InitCoexDm(pBtCoexist); halbtc8723b2ant_QueryBtInfo(pBtCoexist); } @@ -3821,6 +4504,15 @@ EXhalbtc8723b2ant_ScanNotify( IN u1Byte type ) { + u4Byte u4Tmp; + u1Byte u1Tmpa, u1Tmpb; + + + + u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x948); + u1Tmpa = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x765); + u1Tmpb = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x76e); + if(BTC_SCAN_START == type) { BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN START notify\n")); @@ -3829,6 +4521,9 @@ EXhalbtc8723b2ant_ScanNotify( { BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN FINISH notify\n")); } + + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("############# [BTCoex], 0x948=0x%x, 0x765=0x%x, 0x76e=0x%x\n", + u4Tmp, u1Tmpa, u1Tmpb)); } VOID @@ -3856,6 +4551,7 @@ EXhalbtc8723b2ant_MediaStatusNotify( u1Byte H2C_Parameter[3] ={0}; u4Byte wifiBw; u1Byte wifiCentralChnl; + u1Byte apNum=0; if(BTC_MEDIA_CONNECT == type) { @@ -3877,7 +4573,13 @@ EXhalbtc8723b2ant_MediaStatusNotify( if(BTC_WIFI_BW_HT40 == wifiBw) H2C_Parameter[2] = 0x30; else - H2C_Parameter[2] = 0x20; + { + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_AP_NUM, &apNum); + if(apNum < 10) + H2C_Parameter[2] = 0x30; + else + H2C_Parameter[2] = 0x20; + } } pCoexDm->wifiChnlInfo[0] = H2C_Parameter[0]; @@ -3946,6 +4648,12 @@ EXhalbtc8723b2ant_BtInfoNotify( return; } + // if 0xff, it means BT is under WHCK test + if (btInfo == 0xff) + pCoexSta->bBtWhckTest = TRUE; + else + pCoexSta->bBtWhckTest = FALSE; + if(BT_INFO_SRC_8723B_2ANT_WIFI_FW != rspSource) { pCoexSta->btRetryCnt = // [3:0] @@ -3957,11 +4665,13 @@ EXhalbtc8723b2ant_BtInfoNotify( pCoexSta->btInfoExt = pCoexSta->btInfoC2h[rspSource][4]; - if (pCoexSta->btInfoC2h[rspSource][2] & 0x40) + pCoexSta->bBtTxRxMask = (pCoexSta->btInfoC2h[rspSource][2]&0x40); + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_TX_RX_MASK, &pCoexSta->bBtTxRxMask); + if (pCoexSta->bBtTxRxMask) { - /* BT into is responded by BT FW and BT RF REG 0x3C != 0x01 => Need to switch GNT_BT */ - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Switch GNT_BT since BT RF REG 0x3C != 0x01\n")); - pBtCoexist->fBtcSetBtReg(pBtCoexist, 0, 0x3c, 0x01); + /* BT into is responded by BT FW and BT RF REG 0x3C != 0x01 => Need to switch BT TRx Mask */ + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Switch BT TRx Mask since BT RF REG 0x3C != 0x01\n")); + pBtCoexist->fBtcSetBtReg(pBtCoexist, BTC_BT_REG_RF, 0x3c, 0x01); } // Here we need to resend some wifi info to BT @@ -4035,6 +4745,12 @@ EXhalbtc8723b2ant_BtInfoNotify( pCoexSta->bScoExist = TRUE; else pCoexSta->bScoExist = FALSE; + + if ( (pCoexSta->bHidExist == FALSE) && (pCoexSta->bC2hBtInquiryPage == FALSE) ) + { + if (pCoexSta->highPriorityTx + pCoexSta->highPriorityRx >= 160) + pCoexSta->bHidExist = TRUE; + } } halbtc8723b2ant_UpdateBtLinkInfo(pBtCoexist); @@ -4095,27 +4811,49 @@ EXhalbtc8723b2ant_HaltNotify( BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Halt notify\n")); halbtc8723b2ant_WifiOffHwCfg(pBtCoexist); - pBtCoexist->fBtcSetBtReg(pBtCoexist, 0, 0x3c, 0x15); //BT goto standby while GNT_BT 1-->0 + //remove due to interrupt is disabled that polling c2h will fail and delay 100ms. + //pBtCoexist->fBtcSetBtReg(pBtCoexist, BTC_BT_REG_RF, 0x3c, 0x15); //BT goto standby while GNT_BT 1-->0 halbtc8723b2ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, TRUE); EXhalbtc8723b2ant_MediaStatusNotify(pBtCoexist, BTC_MEDIA_DISCONNECT); } +VOID +EXhalbtc8723b2ant_PnpNotify( + IN PBTC_COEXIST pBtCoexist, + IN u1Byte pnpState + ) +{ + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Pnp notify\n")); + + if(BTC_WIFI_PNP_SLEEP == pnpState) + { + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Pnp notify to SLEEP\n")); + } + else if(BTC_WIFI_PNP_WAKE_UP == pnpState) + { + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Pnp notify to WAKE UP\n")); + halbtc8723b2ant_InitHwConfig(pBtCoexist, FALSE); + halbtc8723b2ant_InitCoexDm(pBtCoexist); + halbtc8723b2ant_QueryBtInfo(pBtCoexist); + } +} + VOID EXhalbtc8723b2ant_Periodical( IN PBTC_COEXIST pBtCoexist ) { - static u1Byte disVerInfoCnt=0; + //static u1Byte disVerInfoCnt=0; u4Byte fwVer=0, btPatchVer=0; PBTC_BOARD_INFO pBoardInfo=&pBtCoexist->boardInfo; PBTC_STACK_INFO pStackInfo=&pBtCoexist->stackInfo; BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], ==========================Periodical===========================\n")); - if(disVerInfoCnt <= 5) + if(pCoexSta->disVerInfoCnt <= 5) { - disVerInfoCnt += 1; + pCoexSta->disVerInfoCnt += 1; BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], ****************************************************************\n")); BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], Ant PG Num/ Ant Mech/ Ant Pos = %d/ %d/ %d\n", \ pBoardInfo->pgAntNum, pBoardInfo->btdmAntNum, pBoardInfo->btdmAntPos)); @@ -4126,13 +4864,22 @@ EXhalbtc8723b2ant_Periodical( BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], CoexVer/ FwVer/ PatchVer = %d_%x/ 0x%x/ 0x%x(%d)\n", \ GLCoexVerDate8723b2Ant, GLCoexVer8723b2Ant, fwVer, btPatchVer, btPatchVer)); BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], ****************************************************************\n")); + + if (pCoexSta->disVerInfoCnt == 3) + { + //Antenna config to set 0x765 = 0x0 (GNT_BT control by PTA) after initial + BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], Set GNT_BT control by PTA\n")); + halbtc8723b2ant_SetAntPath(pBtCoexist, BTC_ANT_WIFI_AT_MAIN, FALSE, FALSE); + } } #if(BT_AUTO_REPORT_ONLY_8723B_2ANT == 0) halbtc8723b2ant_QueryBtInfo(pBtCoexist); - halbtc8723b2ant_MonitorBtCtr(pBtCoexist); halbtc8723b2ant_MonitorBtEnableDisable(pBtCoexist); #else + halbtc8723b2ant_MonitorBtCtr(pBtCoexist); + halbtc8723b2ant_MonitorWiFiCtr(pBtCoexist); + if( halbtc8723b2ant_IsWifiStatusChanged(pBtCoexist) || pCoexDm->bAutoTdmaAdjust) { diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8723b2Ant.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8723b2Ant.h index bf879d6048a614..2c049f9fcebfd2 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8723b2Ant.h +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8723b2Ant.h @@ -15,6 +15,10 @@ #define BTC_RSSI_COEX_THRESH_TOL_8723B_2ANT 2 + +#define BT_8723B_2ANT_WIFI_RSSI_COEXSWITCH_THRES 42 //WiFi RSSI Threshold for 2-Ant TDMA/1-Ant PS-TDMA translation +#define BT_8723B_2ANT_BT_RSSI_COEXSWITCH_THRES 46 //BT RSSI Threshold for 2-Ant TDMA/1-Ant PS-TDMA translation + typedef enum _BT_INFO_SRC_8723B_2ANT{ BT_INFO_SRC_8723B_2ANT_WIFI_FW = 0x0, BT_INFO_SRC_8723B_2ANT_BT_RSP = 0x1, @@ -49,8 +53,8 @@ typedef enum _BT_8723B_2ANT_COEX_ALGO{ typedef struct _COEX_DM_8723B_2ANT{ // fw mechanism - BOOLEAN bPreDecBtPwr; - BOOLEAN bCurDecBtPwr; + u1Byte preBtDecPwrLvl; + u1Byte curBtDecPwrLvl; u1Byte preFwDacSwingLvl; u1Byte curFwDacSwingLvl; BOOLEAN bCurIgnoreWlanAct; @@ -97,7 +101,12 @@ typedef struct _COEX_DM_8723B_2ANT{ u1Byte wifiChnlInfo[3]; BOOLEAN bNeedRecover0x948; - u2Byte backup0x948; + u4Byte backup0x948; + + u1Byte preLps; + u1Byte curLps; + u1Byte preRpwm; + u1Byte curRpwm; } COEX_DM_8723B_2ANT, *PCOEX_DM_8723B_2ANT; typedef struct _COEX_STA_8723B_2ANT{ @@ -114,24 +123,50 @@ typedef struct _COEX_STA_8723B_2ANT{ u4Byte lowPriorityTx; u4Byte lowPriorityRx; u1Byte btRssi; + BOOLEAN bBtTxRxMask; u1Byte preBtRssiState; u1Byte preWifiRssiState[4]; BOOLEAN bC2hBtInfoReqSent; u1Byte btInfoC2h[BT_INFO_SRC_8723B_2ANT_MAX][10]; u4Byte btInfoC2hCnt[BT_INFO_SRC_8723B_2ANT_MAX]; + BOOLEAN bBtWhckTest; BOOLEAN bC2hBtInquiryPage; u1Byte btRetryCnt; u1Byte btInfoExt; + + u4Byte nCRCOK_CCK; + u4Byte nCRCOK_11g; + u4Byte nCRCOK_11n; + u4Byte nCRCOK_11nAgg; + + u4Byte nCRCErr_CCK; + u4Byte nCRCErr_11g; + u4Byte nCRCErr_11n; + u4Byte nCRCErr_11nAgg; + + u1Byte nCoexTableType; + BOOLEAN bForceLpsOn; + + u1Byte disVerInfoCnt; }COEX_STA_8723B_2ANT, *PCOEX_STA_8723B_2ANT; //=========================================== // The following is interface which will notify coex module. //=========================================== VOID -EXhalbtc8723b2ant_InitHwConfig( +EXhalbtc8723b2ant_PowerOnSetting( IN PBTC_COEXIST pBtCoexist ); VOID +EXhalbtc8723b2ant_PreLoadFirmware( + IN PBTC_COEXIST pBtCoexist + ); +VOID +EXhalbtc8723b2ant_InitHwConfig( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bWifiOnly + ); +VOID EXhalbtc8723b2ant_InitCoexDm( IN PBTC_COEXIST pBtCoexist ); @@ -176,6 +211,11 @@ EXhalbtc8723b2ant_HaltNotify( IN PBTC_COEXIST pBtCoexist ); VOID +EXhalbtc8723b2ant_PnpNotify( + IN PBTC_COEXIST pBtCoexist, + IN u1Byte pnpState + ); +VOID EXhalbtc8723b2ant_Periodical( IN PBTC_COEXIST pBtCoexist ); diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8812a1Ant.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8812a1Ant.c index 9f4e49ad6f8b96..d081053b8c5c0c 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8812a1Ant.c +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8812a1Ant.c @@ -2092,9 +2092,17 @@ halbtc8812a1ant_InitCoexDm( // extern function start with EXhalbtc8812a1ant_ //============================================================ VOID -EXhalbtc8812a1ant_InitHwConfig( +EXhalbtc8812a1ant_PowerOnSetting( IN PBTC_COEXIST pBtCoexist ) +{ +} + +VOID +EXhalbtc8812a1ant_InitHwConfig( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bWifiOnly + ) { u4Byte u4Tmp=0; u2Byte u2Tmp=0; @@ -2160,11 +2168,6 @@ EXhalbtc8812a1ant_DisplayCoexInfo( pu1Byte cliBuf=pBtCoexist->cliBuf; u1Byte u1Tmp[4], i, btInfoExt, psTdmaCase=0; u4Byte u4Tmp[4]; - BOOLEAN bRoam=FALSE, bScan=FALSE, bLink=FALSE, bWifiUnder5G=FALSE; - BOOLEAN bBtHsOn=FALSE, bWifiBusy=FALSE; - s4Byte wifiRssi=0, btHsRssi=0; - u4Byte wifiBw, wifiTrafficDir; - u1Byte wifiDot11Chnl, wifiHsChnl; u4Byte fwVer=0, btPatchVer=0; CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n ============[BT Coexist info]============"); @@ -2185,13 +2188,6 @@ EXhalbtc8812a1ant_DisplayCoexInfo( CL_PRINTF(cliBuf); } - if(!pBoardInfo->bBtExist) - { - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n BT not exists !!!"); - CL_PRINTF(cliBuf); - return; - } - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d ", "Ant PG number/ Ant mechanism:", \ pBoardInfo->pgAntNum, pBoardInfo->btdmAntNum); CL_PRINTF(cliBuf); @@ -2206,40 +2202,19 @@ EXhalbtc8812a1ant_DisplayCoexInfo( GLCoexVerDate8812a1Ant, GLCoexVer8812a1Ant, fwVer, btPatchVer, btPatchVer); CL_PRINTF(cliBuf); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_DOT11_CHNL, &wifiDot11Chnl); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_HS_CHNL, &wifiHsChnl); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d(%d)", "Dot11 channel / HsChnl(HsMode)", \ - wifiDot11Chnl, wifiHsChnl, bBtHsOn); - CL_PRINTF(cliBuf); - - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %02x %02x %02x ", "H2C Wifi inform bt chnl Info", \ + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %02x %02x %02x ", "Wifi channel informed to BT", \ pCoexDm->wifiChnlInfo[0], pCoexDm->wifiChnlInfo[1], pCoexDm->wifiChnlInfo[2]); CL_PRINTF(cliBuf); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_WIFI_RSSI, &wifiRssi); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_HS_RSSI, &btHsRssi); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d", "Wifi rssi/ HS rssi", \ - wifiRssi, btHsRssi); + // wifi status + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[Wifi Status]============"); CL_PRINTF(cliBuf); + pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_WIFI_STATUS); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_LINK, &bLink); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_ROAM, &bRoam); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d ", "Wifi bLink/ bRoam/ bScan", \ - bLink, bRoam, bScan); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[BT Status]============"); CL_PRINTF(cliBuf); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_UNDER_5G, &bWifiUnder5G); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_TRAFFIC_DIRECTION, &wifiTrafficDir); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s / %s/ %s ", "Wifi status", \ - (bWifiUnder5G? "5G":"2.4G"), - ((BTC_WIFI_BW_LEGACY==wifiBw)? "Legacy": (((BTC_WIFI_BW_HT40==wifiBw)? "HT40":"HT20"))), - ((!bWifiBusy)? "idle": ((BTC_WIFI_TRAFFIC_TX==wifiTrafficDir)? "uplink":"downlink"))); - CL_PRINTF(cliBuf); CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = [%s/ %d/ %d] ", "BT [status/ rssi/ retryCnt]", \ ((pBtCoexist->btInfo.bBtDisabled)? ("disabled"): ((pCoexSta->bC2hBtInquiryPage)?("inquiry/page scan"):((BT_8812A_1ANT_BT_STATUS_NON_CONNECTED_IDLE == pCoexDm->btStatus)? "non-connected idle": ( (BT_8812A_1ANT_BT_STATUS_CONNECTED_IDLE == pCoexDm->btStatus)? "connected-idle":"busy")))), @@ -2268,13 +2243,6 @@ EXhalbtc8812a1ant_DisplayCoexInfo( CL_PRINTF(cliBuf); } } - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s/%s, (0x%x/0x%x)", "PS state, IPS/LPS, (lps/rpwm)", \ - ((pCoexSta->bUnderIps? "IPS ON":"IPS OFF")), - ((pCoexSta->bUnderLps? "LPS ON":"LPS OFF")), - pBtCoexist->btInfo.lpsVal, - pBtCoexist->btInfo.rpwmVal); - CL_PRINTF(cliBuf); - pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_FW_PWR_MODE_CMD); if(!pBtCoexist->bManualControl) { diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8812a1Ant.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8812a1Ant.h index 652e723ebea1ea..4f2df7a6033d66 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8812a1Ant.h +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8812a1Ant.h @@ -132,10 +132,15 @@ typedef struct _COEX_STA_8812A_1ANT{ // The following is interface which will notify coex module. //=========================================== VOID -EXhalbtc8812a1ant_InitHwConfig( +EXhalbtc8812a1ant_PowerOnSetting( IN PBTC_COEXIST pBtCoexist ); VOID +EXhalbtc8812a1ant_InitHwConfig( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bWifiOnly + ); +VOID EXhalbtc8812a1ant_InitCoexDm( IN PBTC_COEXIST pBtCoexist ); diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8812a2Ant.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8812a2Ant.c index c7add94066cc3f..f295346aa313d4 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8812a2Ant.c +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8812a2Ant.c @@ -611,6 +611,7 @@ halbtc8812a2ant_UpdateBtLinkInfo( pBtLinkInfo->bA2dpExist = pCoexSta->bA2dpExist; pBtLinkInfo->bPanExist = pCoexSta->bPanExist; pBtLinkInfo->bHidExist = pCoexSta->bHidExist; + pBtLinkInfo->bAclBusy = pCoexSta->bAclBusy; // work around for HS mode. if(bBtHsOn) @@ -697,7 +698,15 @@ halbtc8812a2ant_ActionAlgorithm( if(pBtLinkInfo->bA2dpExist) numOfDiffProfile++; - if(numOfDiffProfile == 1) + if(numOfDiffProfile == 0) + { + if(pBtLinkInfo->bAclBusy) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], ACL Busy only\n")); + algorithm = BT_8812A_2ANT_COEX_ALGO_PANEDR; + } + } + else if(numOfDiffProfile == 1) { if(pBtLinkInfo->bScoExist) { @@ -1381,20 +1390,39 @@ halbtc8812a2ant_SetFwPstdma( ) { u1Byte H2C_Parameter[5] ={0}; + u1Byte realByte1=byte1, realByte5=byte5; + BOOLEAN bApEnable=FALSE; + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable); + + if(bApEnable) + { + if(byte1&BIT4 && !(byte1&BIT5)) + { + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], FW for 1Ant AP mode\n")); + realByte1 &= ~BIT4; + realByte1 |= BIT5; + + realByte5 |= BIT5; + realByte5 &= ~BIT6; + } + } - H2C_Parameter[0] = byte1; + H2C_Parameter[0] = realByte1; H2C_Parameter[1] = byte2; H2C_Parameter[2] = byte3; H2C_Parameter[3] = byte4; - H2C_Parameter[4] = byte5; + H2C_Parameter[4] = realByte5; + - pCoexDm->psTdmaPara[0] = byte1; + pCoexDm->psTdmaPara[0] = realByte1; pCoexDm->psTdmaPara[1] = byte2; pCoexDm->psTdmaPara[2] = byte3; pCoexDm->psTdmaPara[3] = byte4; - pCoexDm->psTdmaPara[4] = byte5; + pCoexDm->psTdmaPara[4] = realByte5; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], FW write 0x60(5bytes)=0x%x%08x\n", + + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], FW write 0x60(6 bytes)=0x%x%08x\n", H2C_Parameter[0], H2C_Parameter[1]<<24|H2C_Parameter[2]<<16|H2C_Parameter[3]<<8|H2C_Parameter[4])); @@ -1564,7 +1592,7 @@ halbtc8812a2ant_PsTdma( halbtc8812a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1c, 0x3, 0xb1, 0x90); break; case 4: - halbtc8812a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x10, 0x03, 0xb1, 0x90); + halbtc8812a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x10, 0x3, 0xb1, 0x90); break; case 5: halbtc8812a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1a, 0x1a, 0x21, 0x10); @@ -1585,10 +1613,10 @@ halbtc8812a2ant_PsTdma( halbtc8812a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x12, 0x12, 0xa1, 0x10); break; case 11: - halbtc8812a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1c, 0x03, 0xb1, 0x10); + halbtc8812a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1c, 0x3, 0xb1, 0x10); break; case 12: - halbtc8812a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x10, 0x03, 0xb1, 0x10); + halbtc8812a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x10, 0x3, 0xb1, 0x10); break; case 13: halbtc8812a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1a, 0x1a, 0x21, 0x10); @@ -1597,13 +1625,13 @@ halbtc8812a2ant_PsTdma( halbtc8812a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x12, 0x12, 0x21, 0x10); break; case 15: - halbtc8812a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1c, 0x03, 0x21, 0x10); + halbtc8812a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1c, 0x3, 0x21, 0x10); break; case 16: - halbtc8812a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x10, 0x03, 0x21, 0x10); + halbtc8812a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x10, 0x3, 0x21, 0x10); break; case 17: - halbtc8812a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x15, 0x03, 0xb1, 0x10); + halbtc8812a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x35, 0x3, 0xb1, 0x11); break; case 18: halbtc8812a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x5, 0x5, 0xe1, 0x90); @@ -1615,8 +1643,15 @@ halbtc8812a2ant_PsTdma( halbtc8812a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x25, 0x25, 0x60, 0x90); break; case 21: - halbtc8812a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x15, 0x03, 0x70, 0x90); + halbtc8812a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x15, 0x3, 0x70, 0x90); + break; + case 22: + halbtc8812a2ant_SetFwPstdma(pBtCoexist, 0x61, 0x1a, 0x1a, 0x21, 0x10); break; + case 23: + halbtc8812a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1c, 0x03, 0x31, 0x10); + break; + case 71: halbtc8812a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1a, 0x1a, 0xe1, 0x90); break; @@ -1651,12 +1686,12 @@ halbtc8812a2ant_PsTdma( halbtc8812a2ant_SetFwPstdma(pBtCoexist, 0x8, 0x0, 0x0, 0x0, 0x0); break; case 1: //ANT2BT, 0x778=3 - halbtc8812a2ant_SetFwPstdma(pBtCoexist, 0x0, 0x0, 0x0, 0x08, 0x0); + halbtc8812a2ant_SetFwPstdma(pBtCoexist, 0x0, 0x0, 0x0, 0x8, 0x0); delay_ms(5); halbtc8812a2ant_SetAntPath(pBtCoexist, BTC_ANT_WIFI_AT_CPL_AUX, FALSE, FALSE); break; default: - halbtc8812a2ant_SetFwPstdma(pBtCoexist, 0x0, 0x0, 0x0, 0x00, 0x0); + halbtc8812a2ant_SetFwPstdma(pBtCoexist, 0x0, 0x0, 0x0, 0x0, 0x0); break; } } @@ -1772,7 +1807,7 @@ halbtc8812a2ant_ActionBtInquiry( halbtc8812a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, TRUE, 0x0, 0x0); halbtc8812a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); - halbtc8812a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 3); + halbtc8812a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 23); halbtc8812a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); halbtc8812a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); @@ -1794,6 +1829,14 @@ halbtc8812a2ant_IsCommonAction( pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); + + if(pCoexSta->bC2hBtInquiryPage) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BT is under inquiry/page scan !!\n")); + halbtc8812a2ant_ActionBtInquiry(pBtCoexist); + return TRUE; + } + if(pBtLinkInfo->bScoExist || pBtLinkInfo->bHidExist) { halbtc8812a2ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 1, 0, 0, 0); @@ -1838,7 +1881,7 @@ halbtc8812a2ant_IsCommonAction( halbtc8812a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, FALSE, 0x0, 0x0); halbtc8812a2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); - halbtc8812a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); + halbtc8812a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); halbtc8812a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 0); halbtc8812a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); halbtc8812a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); @@ -1857,7 +1900,7 @@ halbtc8812a2ant_IsCommonAction( halbtc8812a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, TRUE, 0x0, 0x0); halbtc8812a2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); - halbtc8812a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); + halbtc8812a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); halbtc8812a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 0); halbtc8812a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); halbtc8812a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); @@ -1877,24 +1920,15 @@ halbtc8812a2ant_IsCommonAction( else { BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi Connected-Idle + BT Busy!!\n")); - wifiRssiState = halbtc8812a2ant_WifiRssiState(pBtCoexist, 0, 2, 34, 0); - if(BTC_RSSI_HIGH(wifiRssiState)) - halbtc8812a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, TRUE, 0x0, 0x0); - else - halbtc8812a2ant_PowerSaveState(pBtCoexist, BTC_PS_LPS_ON, TRUE, 0x50, 0x4); + halbtc8812a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, TRUE, 0x0, 0x0); halbtc8812a2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); - if(BTC_RSSI_HIGH(wifiRssiState)) - halbtc8812a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); - else - halbtc8812a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); + halbtc8812a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); + + halbtc8812a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 17); - if(BTC_RSSI_HIGH(wifiRssiState)) - halbtc8812a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 17); - else - halbtc8812a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 83); halbtc8812a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); halbtc8812a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); halbtc8812a2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); @@ -2859,13 +2893,24 @@ halbtc8812a2ant_TdmaDurationAdjustForWifiRssiLow( #endif pCoexDm->bAutoTdmaAdjust = FALSE; + retryCount = pCoexSta->btRetryCnt; + btInfoExt = pCoexSta->btInfoExt; + if(!pCoexDm->bAutoTdmaAdjustLowRssi) { pCoexDm->bAutoTdmaAdjustLowRssi = TRUE; BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], first run TdmaDurationAdjustForWifiRssiLow()!!\n")); + if(BT_INFO_8812A_2ANT_A2DP_BASIC_RATE(btInfoExt)) + { + halbtc8812a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 83); + pCoexDm->psTdmaDuAdjType = 83; + } + else + { halbtc8812a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 82); pCoexDm->psTdmaDuAdjType = 82; + } //============ up = 0; dn = 0; @@ -2877,14 +2922,17 @@ halbtc8812a2ant_TdmaDurationAdjustForWifiRssiLow( else { //accquire the BT TRx retry count from BT_Info byte2 - retryCount = pCoexSta->btRetryCnt; - btInfoExt = pCoexSta->btInfoExt; +// retryCount = pCoexSta->btRetryCnt; +// btInfoExt = pCoexSta->btInfoExt; BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], retryCount = %d\n", retryCount)); BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], up=%d, dn=%d, m=%d, n=%d, WaitCount=%d\n", up, dn, m, n, WaitCount)); result = 0; WaitCount++; + if ( (pCoexSta->lowPriorityTx) > 1150 || (pCoexSta->lowPriorityRx) > 1250 ) + retryCount++; + if(retryCount == 0) // no retry in the last 2-second duration { up++; @@ -2952,8 +3000,8 @@ halbtc8812a2ant_TdmaDurationAdjustForWifiRssiLow( if( (BT_INFO_8812A_2ANT_A2DP_BASIC_RATE(btInfoExt)) && ((pCoexDm->curPsTdma == 81) ||(pCoexDm->curPsTdma == 82)) ) { - halbtc8812a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 83); - pCoexDm->psTdmaDuAdjType = 83; + halbtc8812a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 84); + pCoexDm->psTdmaDuAdjType = 84; } else if(pCoexDm->curPsTdma == 81) { @@ -3007,6 +3055,46 @@ halbtc8812a2ant_TdmaDurationAdjustForWifiRssiLow( } } +VOID +halbtc8812a2ant_GetBtRssiThreshold( + IN PBTC_COEXIST pBtCoexist, + IN pu1Byte pThres0, + IN pu1Byte pThres1 + ) +{ + u1Byte antType, btThreshold=0; + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_ANT_TYPE, &antType); + + switch(antType) + { + case BTC_ANT_TYPE_0: + *pThres0 = 100; + *pThres1 = 100; + break; + case BTC_ANT_TYPE_1: + *pThres0 = 34; + *pThres1 = 42; + break; + case BTC_ANT_TYPE_2: + *pThres0 = 34; + *pThres1 = 42; + break; + case BTC_ANT_TYPE_3: + *pThres0 = 34; + *pThres1 = 42; + break; + case BTC_ANT_TYPE_4: + *pThres0 = 34; + *pThres1 = 42; + break; + default: + break; + } +} + + + VOID halbtc8812a2ant_ActionSco( IN PBTC_COEXIST pBtCoexist @@ -3014,9 +3102,14 @@ halbtc8812a2ant_ActionSco( { u1Byte wifiRssiState=BTC_RSSI_STATE_HIGH, btRssiState=BTC_RSSI_STATE_HIGH; u4Byte wifiBw; + u1Byte btThresh0=0, btThresh1=0; + + + halbtc8812a2ant_GetBtRssiThreshold(pBtCoexist, &btThresh0, &btThresh1); + btRssiState = halbtc8812a2ant_BtRssiState(3, btThresh0, btThresh1); wifiRssiState = halbtc8812a2ant_WifiRssiState(pBtCoexist, 0, 2, 34, 0); - btRssiState = halbtc8812a2ant_BtRssiState(3, 34, 42); +// btRssiState = halbtc8812a2ant_BtRssiState(3, 34, 42); // power save state halbtc8812a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, TRUE, 0x0, 0x0); @@ -3085,9 +3178,13 @@ halbtc8812a2ant_ActionScoHid( { u1Byte wifiRssiState=BTC_RSSI_STATE_HIGH, btRssiState=BTC_RSSI_STATE_HIGH; u4Byte wifiBw; + u1Byte btThresh0=0, btThresh1=0; + + halbtc8812a2ant_GetBtRssiThreshold(pBtCoexist, &btThresh0, &btThresh1); + btRssiState = halbtc8812a2ant_BtRssiState(3, btThresh0, btThresh1); wifiRssiState = halbtc8812a2ant_WifiRssiState(pBtCoexist, 0, 2, 34, 0); - btRssiState = halbtc8812a2ant_BtRssiState(3, 34, 42); +// btRssiState = halbtc8812a2ant_BtRssiState(3, 34, 42); // power save state halbtc8812a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, TRUE, 0x0, 0x0); @@ -3153,24 +3250,28 @@ halbtc8812a2ant_ActionHid( { u1Byte wifiRssiState=BTC_RSSI_STATE_HIGH, btRssiState=BTC_RSSI_STATE_HIGH; u4Byte wifiBw; + u1Byte btThresh0=0, btThresh1=0; + + halbtc8812a2ant_GetBtRssiThreshold(pBtCoexist, &btThresh0, &btThresh1); + btRssiState = halbtc8812a2ant_BtRssiState(3, btThresh0, btThresh1); wifiRssiState = halbtc8812a2ant_WifiRssiState(pBtCoexist, 0, 2, 34, 0); - btRssiState = halbtc8812a2ant_BtRssiState(3, 34, 42); +// btRssiState = halbtc8812a2ant_BtRssiState(3, 34, 42); // power save state halbtc8812a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, TRUE, 0x0, 0x0); // coex table - if(BTC_RSSI_HIGH(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + if(BTC_RSSI_HIGH(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 3); else - halbtc8812a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 5); + halbtc8812a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); // pstdma - if(BTC_RSSI_HIGH(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + if(BTC_RSSI_HIGH(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 9); else - halbtc8812a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 13); + halbtc8812a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 22); // decrease BT power if(BTC_RSSI_LOW(btRssiState)) @@ -3181,9 +3282,9 @@ halbtc8812a2ant_ActionHid( halbtc8812a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 4); // limited Rx - if(BTC_RSSI_HIGH(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + if(BTC_RSSI_HIGH(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); - else if(BTC_RSSI_LOW(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + else if(BTC_RSSI_LOW(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); else halbtc8812a2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, TRUE, 0x8); @@ -3230,24 +3331,31 @@ halbtc8812a2ant_ActionA2dp( { u1Byte wifiRssiState=BTC_RSSI_STATE_HIGH, btRssiState=BTC_RSSI_STATE_HIGH; u4Byte wifiBw; + u1Byte btThresh0=0, btThresh1=0; + BOOLEAN bApEnable=FALSE; + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable); + halbtc8812a2ant_GetBtRssiThreshold(pBtCoexist, &btThresh0, &btThresh1); + btRssiState = halbtc8812a2ant_BtRssiState(3, btThresh0, btThresh1); + wifiRssiState = halbtc8812a2ant_WifiRssiState(pBtCoexist, 0, 2, 34, 0); - btRssiState = halbtc8812a2ant_BtRssiState(3, 34, 42); + //btRssiState = halbtc8812a2ant_BtRssiState(3, 34, 42); // power save state - if(BTC_RSSI_HIGH(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + if((bApEnable == TRUE) || (BTC_RSSI_HIGH(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState)))) halbtc8812a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, TRUE, 0x0, 0x0); else halbtc8812a2ant_PowerSaveState(pBtCoexist, BTC_PS_LPS_ON, TRUE, 0x50, 0x4); // coex table - if(BTC_RSSI_HIGH(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + if(BTC_RSSI_HIGH(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); else halbtc8812a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); // pstdma - if(BTC_RSSI_HIGH(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + if(BTC_RSSI_HIGH(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_TdmaDurationAdjust(pBtCoexist, FALSE, FALSE, 1); else halbtc8812a2ant_TdmaDurationAdjustForWifiRssiLow(pBtCoexist); @@ -3304,21 +3412,25 @@ halbtc8812a2ant_ActionA2dpPanHs( { u1Byte wifiRssiState=BTC_RSSI_STATE_HIGH, btRssiState=BTC_RSSI_STATE_HIGH; u4Byte wifiBw; + u1Byte btThresh0=0, btThresh1=0; + + halbtc8812a2ant_GetBtRssiThreshold(pBtCoexist, &btThresh0, &btThresh1); + btRssiState = halbtc8812a2ant_BtRssiState(3, btThresh0, btThresh1); wifiRssiState = halbtc8812a2ant_WifiRssiState(pBtCoexist, 0, 2, 34, 0); - btRssiState = halbtc8812a2ant_BtRssiState(3, 34, 42); +// btRssiState = halbtc8812a2ant_BtRssiState(3, 34, 42); // power save state halbtc8812a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, TRUE, 0x0, 0x0); // coex table - if(BTC_RSSI_HIGH(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + if(BTC_RSSI_HIGH(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); else halbtc8812a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 5); // pstdma - if(BTC_RSSI_HIGH(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + if(BTC_RSSI_HIGH(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_TdmaDurationAdjust(pBtCoexist, FALSE, FALSE, 2); else halbtc8812a2ant_TdmaDurationAdjust(pBtCoexist, FALSE, TRUE, 2); @@ -3375,24 +3487,32 @@ halbtc8812a2ant_ActionPanEdr( { u1Byte wifiRssiState=BTC_RSSI_STATE_HIGH, btRssiState=BTC_RSSI_STATE_HIGH; u4Byte wifiBw; + u1Byte btThresh0=0, btThresh1=0; + BOOLEAN bApEnable=FALSE; + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable); + + + halbtc8812a2ant_GetBtRssiThreshold(pBtCoexist, &btThresh0, &btThresh1); + btRssiState = halbtc8812a2ant_BtRssiState(3, btThresh0, btThresh1); wifiRssiState = halbtc8812a2ant_WifiRssiState(pBtCoexist, 0, 2, 34, 0); - btRssiState = halbtc8812a2ant_BtRssiState(3, 34, 42); +// btRssiState = halbtc8812a2ant_BtRssiState(3, 34, 42); // power save state - if(BTC_RSSI_HIGH(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + if((bApEnable == TRUE) || (BTC_RSSI_HIGH(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState)))) halbtc8812a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, TRUE, 0x0, 0x0); else halbtc8812a2ant_PowerSaveState(pBtCoexist, BTC_PS_LPS_ON, TRUE, 0x50, 0x4); // coex table - if(BTC_RSSI_HIGH(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + if(BTC_RSSI_HIGH(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); else halbtc8812a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); // pstdma - if(BTC_RSSI_HIGH(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + if(BTC_RSSI_HIGH(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 1); else halbtc8812a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 85); @@ -3515,30 +3635,38 @@ halbtc8812a2ant_ActionPanEdrA2dp( { u1Byte wifiRssiState=BTC_RSSI_STATE_HIGH, btRssiState=BTC_RSSI_STATE_HIGH; u4Byte wifiBw; + u1Byte btThresh0=0, btThresh1=0; + BOOLEAN bApEnable=FALSE; + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable); + + halbtc8812a2ant_GetBtRssiThreshold(pBtCoexist, &btThresh0, &btThresh1); + btRssiState = halbtc8812a2ant_BtRssiState(3, btThresh0, btThresh1); + wifiRssiState = halbtc8812a2ant_WifiRssiState(pBtCoexist, 0, 2, 34, 0); - btRssiState = halbtc8812a2ant_BtRssiState(3, 34, 42); +// btRssiState = halbtc8812a2ant_BtRssiState(3, 34, 42); // power save state - if(BTC_RSSI_HIGH(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + if((bApEnable == TRUE) || (BTC_RSSI_HIGH(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState)))) halbtc8812a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, TRUE, 0x0, 0x0); - else if(BTC_RSSI_LOW(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + else if(BTC_RSSI_LOW(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, TRUE, 0x0, 0x0); else halbtc8812a2ant_PowerSaveState(pBtCoexist, BTC_PS_LPS_ON, TRUE, 0x50, 0x4); // coex table - if(BTC_RSSI_HIGH(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + if(BTC_RSSI_HIGH(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); - else if(BTC_RSSI_LOW(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + else if(BTC_RSSI_LOW(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 5); else halbtc8812a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); // pstdma - if(BTC_RSSI_HIGH(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + if(BTC_RSSI_HIGH(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_TdmaDurationAdjust(pBtCoexist, FALSE, FALSE, 3); - else if(BTC_RSSI_LOW(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + else if(BTC_RSSI_LOW(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_TdmaDurationAdjust(pBtCoexist, FALSE, TRUE, 3); else { @@ -3598,30 +3726,37 @@ halbtc8812a2ant_ActionPanEdrHid( { u1Byte wifiRssiState=BTC_RSSI_STATE_HIGH, btRssiState=BTC_RSSI_STATE_HIGH; u4Byte wifiBw; + u1Byte btThresh0=0, btThresh1=0; + BOOLEAN bApEnable=FALSE; + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable); + + halbtc8812a2ant_GetBtRssiThreshold(pBtCoexist, &btThresh0, &btThresh1); + btRssiState = halbtc8812a2ant_BtRssiState(3, btThresh0, btThresh1); wifiRssiState = halbtc8812a2ant_WifiRssiState(pBtCoexist, 0, 2, 34, 0); - btRssiState = halbtc8812a2ant_BtRssiState(3, 34, 42); +// btRssiState = halbtc8812a2ant_BtRssiState(3, 34, 42); // power save state - if(BTC_RSSI_HIGH(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + if((bApEnable == TRUE) || (BTC_RSSI_HIGH(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState)))) halbtc8812a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, TRUE, 0x0, 0x0); - else if(BTC_RSSI_LOW(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + else if(BTC_RSSI_LOW(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, TRUE, 0x0, 0x0); else halbtc8812a2ant_PowerSaveState(pBtCoexist, BTC_PS_LPS_ON, TRUE, 0x50, 0x4); // coex table - if(BTC_RSSI_HIGH(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + if(BTC_RSSI_HIGH(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 3); - else if(BTC_RSSI_LOW(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + else if(BTC_RSSI_LOW(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 5); else halbtc8812a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); // pstdma - if(BTC_RSSI_HIGH(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + if(BTC_RSSI_HIGH(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 10); - else if(BTC_RSSI_LOW(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + else if(BTC_RSSI_LOW(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 14); else halbtc8812a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 85); @@ -3635,9 +3770,9 @@ halbtc8812a2ant_ActionPanEdrHid( halbtc8812a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 4); // limited Rx - if(BTC_RSSI_HIGH(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + if(BTC_RSSI_HIGH(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); - else if(BTC_RSSI_LOW(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + else if(BTC_RSSI_LOW(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); else halbtc8812a2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, TRUE, 0x8); @@ -3684,30 +3819,37 @@ halbtc8812a2ant_ActionHidA2dpPanEdr( { u1Byte wifiRssiState=BTC_RSSI_STATE_HIGH, btRssiState=BTC_RSSI_STATE_HIGH; u4Byte wifiBw; + u1Byte btThresh0=0, btThresh1=0; + BOOLEAN bApEnable=FALSE; + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable); + + halbtc8812a2ant_GetBtRssiThreshold(pBtCoexist, &btThresh0, &btThresh1); + btRssiState = halbtc8812a2ant_BtRssiState(3, btThresh0, btThresh1); wifiRssiState = halbtc8812a2ant_WifiRssiState(pBtCoexist, 0, 2, 34, 0); - btRssiState = halbtc8812a2ant_BtRssiState(3, 34, 42); +// btRssiState = halbtc8812a2ant_BtRssiState(3, 34, 42); // power save state - if(BTC_RSSI_HIGH(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + if((bApEnable == TRUE) || (BTC_RSSI_HIGH(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState)))) halbtc8812a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, TRUE, 0x0, 0x0); - else if(BTC_RSSI_LOW(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + else if(BTC_RSSI_LOW(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, TRUE, 0x0, 0x0); else halbtc8812a2ant_PowerSaveState(pBtCoexist, BTC_PS_LPS_ON, TRUE, 0x50, 0x4); // coex table - if(BTC_RSSI_HIGH(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + if(BTC_RSSI_HIGH(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 3); - else if(BTC_RSSI_LOW(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + else if(BTC_RSSI_LOW(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 5); else halbtc8812a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); // pstdma - if(BTC_RSSI_HIGH(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + if(BTC_RSSI_HIGH(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_TdmaDurationAdjust(pBtCoexist, TRUE, FALSE, 3); - else if(BTC_RSSI_LOW(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + else if(BTC_RSSI_LOW(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 3); else { @@ -3724,9 +3866,9 @@ halbtc8812a2ant_ActionHidA2dpPanEdr( halbtc8812a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 4); // limited Rx - if(BTC_RSSI_HIGH(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + if(BTC_RSSI_HIGH(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); - else if(BTC_RSSI_LOW(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + else if(BTC_RSSI_LOW(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); else halbtc8812a2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, TRUE, 0x8); @@ -3772,25 +3914,30 @@ halbtc8812a2ant_ActionHidA2dpPanHs( { u1Byte wifiRssiState=BTC_RSSI_STATE_HIGH, btRssiState=BTC_RSSI_STATE_HIGH; u4Byte wifiBw; + u1Byte btThresh0=0, btThresh1=0; + + halbtc8812a2ant_GetBtRssiThreshold(pBtCoexist, &btThresh0, &btThresh1); + btRssiState = halbtc8812a2ant_BtRssiState(3, btThresh0, btThresh1); + wifiRssiState = halbtc8812a2ant_WifiRssiState(pBtCoexist, 0, 2, 34, 0); - btRssiState = halbtc8812a2ant_BtRssiState(3, 34, 42); +// btRssiState = halbtc8812a2ant_BtRssiState(3, 34, 42); // power save state halbtc8812a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, TRUE, 0x0, 0x0); // coex table - if(BTC_RSSI_HIGH(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + if(BTC_RSSI_HIGH(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 3); - else if(BTC_RSSI_LOW(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + else if(BTC_RSSI_LOW(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 5); else - halbtc8812a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 5); + halbtc8812a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); // pstdma - if(BTC_RSSI_HIGH(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + if(BTC_RSSI_HIGH(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_TdmaDurationAdjust(pBtCoexist, TRUE, FALSE, 2); - else if(BTC_RSSI_LOW(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + else if(BTC_RSSI_LOW(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 2); else halbtc8812a2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 2); @@ -3804,9 +3951,9 @@ halbtc8812a2ant_ActionHidA2dpPanHs( halbtc8812a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 4); // limited Rx - if(BTC_RSSI_HIGH(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + if(BTC_RSSI_HIGH(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); - else if(BTC_RSSI_LOW(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + else if(BTC_RSSI_LOW(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); else halbtc8812a2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, TRUE, 0x8); @@ -3852,30 +3999,37 @@ halbtc8812a2ant_ActionHidA2dp( { u1Byte wifiRssiState=BTC_RSSI_STATE_HIGH, btRssiState=BTC_RSSI_STATE_HIGH; u4Byte wifiBw; + u1Byte btThresh0=0, btThresh1=0; + BOOLEAN bApEnable=FALSE; + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable); + + halbtc8812a2ant_GetBtRssiThreshold(pBtCoexist, &btThresh0, &btThresh1); + btRssiState = halbtc8812a2ant_BtRssiState(3, btThresh0, btThresh1); wifiRssiState = halbtc8812a2ant_WifiRssiState(pBtCoexist, 0, 2, 34, 0); - btRssiState = halbtc8812a2ant_BtRssiState(3, 34, 42); +// btRssiState = halbtc8812a2ant_BtRssiState(3, 34, 42); // power save state - if(BTC_RSSI_HIGH(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + if((bApEnable == TRUE) || (BTC_RSSI_HIGH(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState)))) halbtc8812a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, TRUE, 0x0, 0x0); - else if(BTC_RSSI_LOW(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + else if(BTC_RSSI_LOW(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, TRUE, 0x0, 0x0); else halbtc8812a2ant_PowerSaveState(pBtCoexist, BTC_PS_LPS_ON, TRUE, 0x50, 0x4); // coex table - if(BTC_RSSI_HIGH(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + if(BTC_RSSI_HIGH(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 3); - else if(BTC_RSSI_LOW(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + else if(BTC_RSSI_LOW(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 5); else halbtc8812a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); // pstdma - if(BTC_RSSI_HIGH(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + if(BTC_RSSI_HIGH(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_TdmaDurationAdjust(pBtCoexist, TRUE, FALSE, 2); - else if(BTC_RSSI_LOW(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + else if(BTC_RSSI_LOW(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 2); else { @@ -3892,9 +4046,9 @@ halbtc8812a2ant_ActionHidA2dp( halbtc8812a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 4); // limited Rx - if(BTC_RSSI_HIGH(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + if(BTC_RSSI_HIGH(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); - else if(BTC_RSSI_LOW(wifiRssiState) && BTC_RSSI_HIGH(btRssiState)) + else if(BTC_RSSI_LOW(wifiRssiState) && (!BTC_RSSI_LOW(btRssiState))) halbtc8812a2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); else halbtc8812a2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, TRUE, 0x8); @@ -3941,6 +4095,7 @@ halbtc8812a2ant_CoexUnder5G( { halbtc8812a2ant_CoexAllOff(pBtCoexist); + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Under 5G, force set BT to ignore Wlan active!!\n")); halbtc8812a2ant_IgnoreWlanAct(pBtCoexist, NORMAL_EXEC, TRUE); } //==================================================== @@ -3975,6 +4130,7 @@ halbtc8812a2ant_RunCoexistMechanism( return; } + algorithm = halbtc8812a2ant_ActionAlgorithm(pBtCoexist); if(pCoexSta->bC2hBtInquiryPage && (BT_8812A_2ANT_COEX_ALGO_PANHS!=algorithm)) { @@ -4058,6 +4214,7 @@ halbtc8812a2ant_RunCoexistMechanism( } pCoexDm->preAlgorithm = pCoexDm->curAlgorithm; } + } VOID @@ -4126,9 +4283,17 @@ halbtc8812a2ant_InitHwConfig( // extern function start with EXhalbtc8812a2ant_ //============================================================ VOID -EXhalbtc8812a2ant_InitHwConfig( +EXhalbtc8812a2ant_PowerOnSetting( IN PBTC_COEXIST pBtCoexist ) +{ +} + +VOID +EXhalbtc8812a2ant_InitHwConfig( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bWifiOnly + ) { halbtc8812a2ant_InitHwConfig(pBtCoexist, TRUE); } @@ -4155,11 +4320,6 @@ EXhalbtc8812a2ant_DisplayCoexInfo( u1Byte u1Tmp[4], i, btInfoExt, psTdmaCase=0; u2Byte u2Tmp[4]; u4Byte u4Tmp[4]; - BOOLEAN bRoam=FALSE, bScan=FALSE, bLink=FALSE, bWifiUnder5G=FALSE; - BOOLEAN bBtHsOn=FALSE, bWifiBusy=FALSE; - s4Byte wifiRssi=0, btHsRssi=0; - u4Byte wifiBw, wifiTrafficDir; - u1Byte wifiDot11Chnl, wifiHsChnl; u4Byte fwVer=0, btPatchVer=0; CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n ============[BT Coexist info]============"); @@ -4173,13 +4333,6 @@ EXhalbtc8812a2ant_DisplayCoexInfo( CL_PRINTF(cliBuf); } - if(!pBoardInfo->bBtExist) - { - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n BT not exists !!!"); - CL_PRINTF(cliBuf); - return; - } - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d ", "Ant PG number/ Ant mechanism:", \ pBoardInfo->pgAntNum, pBoardInfo->btdmAntNum); CL_PRINTF(cliBuf); @@ -4194,41 +4347,18 @@ EXhalbtc8812a2ant_DisplayCoexInfo( GLCoexVerDate8812a2Ant, GLCoexVer8812a2Ant, fwVer, btPatchVer, btPatchVer); CL_PRINTF(cliBuf); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_DOT11_CHNL, &wifiDot11Chnl); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_HS_CHNL, &wifiHsChnl); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d(%d)", "Dot11 channel / HsMode(HsChnl)", \ - wifiDot11Chnl, bBtHsOn, wifiHsChnl); - CL_PRINTF(cliBuf); - - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %02x %02x %02x ", "H2C Wifi inform bt chnl Info", \ + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %02x %02x %02x ", "Wifi channel informed to BT", \ pCoexDm->wifiChnlInfo[0], pCoexDm->wifiChnlInfo[1], pCoexDm->wifiChnlInfo[2]); CL_PRINTF(cliBuf); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_WIFI_RSSI, &wifiRssi); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_HS_RSSI, &btHsRssi); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d", "Wifi rssi/ HS rssi", \ - wifiRssi, btHsRssi); + // wifi status + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[Wifi Status]============"); CL_PRINTF(cliBuf); + pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_WIFI_STATUS); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_LINK, &bLink); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_ROAM, &bRoam); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d ", "Wifi bLink/ bRoam/ bScan", \ - bLink, bRoam, bScan); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[BT Status]============"); CL_PRINTF(cliBuf); - - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_UNDER_5G, &bWifiUnder5G); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_TRAFFIC_DIRECTION, &wifiTrafficDir); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s / %s/ %s ", "Wifi status", \ - (bWifiUnder5G? "5G":"2.4G"), - ((BTC_WIFI_BW_LEGACY==wifiBw)? "Legacy": (((BTC_WIFI_BW_HT40==wifiBw)? "HT40":"HT20"))), - ((!bWifiBusy)? "idle": ((BTC_WIFI_TRAFFIC_TX==wifiTrafficDir)? "uplink":"downlink"))); - CL_PRINTF(cliBuf); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = [%s/ %d/ %d] ", "BT [status/ rssi/ retryCnt]", \ ((pBtCoexist->btInfo.bBtDisabled)? ("disabled"): ((pCoexSta->bC2hBtInquiryPage)?("inquiry/page scan"):((BT_8812A_2ANT_BT_STATUS_NON_CONNECTED_IDLE == pCoexDm->btStatus)? "non-connected idle": ( (BT_8812A_2ANT_BT_STATUS_CONNECTED_IDLE == pCoexDm->btStatus)? "connected-idle":"busy")))), @@ -4258,15 +4388,6 @@ EXhalbtc8812a2ant_DisplayCoexInfo( } } - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s/%s, (0x%x/0x%x)", "PS state, IPS/LPS, (lps/rpwm)", \ - ((pCoexSta->bUnderIps? "IPS ON":"IPS OFF")), - ((pCoexSta->bUnderLps? "LPS ON":"LPS OFF")), - pBtCoexist->btInfo.lpsVal, - pBtCoexist->btInfo.rpwmVal); - CL_PRINTF(cliBuf); - - pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_FW_PWR_MODE_CMD); - // Sw mechanism CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[Sw mechanism]============"); CL_PRINTF(cliBuf); @@ -4286,10 +4407,10 @@ EXhalbtc8812a2ant_DisplayCoexInfo( CL_PRINTF(cliBuf); psTdmaCase = pCoexDm->curPsTdma; - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %02x %02x %02x %02x %02x case-%d (auto:%d/%d)", "PS TDMA", \ + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %02x %02x %02x %02x %02x %02x case-%d (auto:%d/%d)", "PS TDMA", \ pCoexDm->psTdmaPara[0], pCoexDm->psTdmaPara[1], pCoexDm->psTdmaPara[2], pCoexDm->psTdmaPara[3], - pCoexDm->psTdmaPara[4], psTdmaCase, pCoexDm->bAutoTdmaAdjust, pCoexDm->bAutoTdmaAdjustLowRssi); + pCoexDm->psTdmaPara[4], pCoexDm->psTdmaPara[5], psTdmaCase, pCoexDm->bAutoTdmaAdjust, pCoexDm->bAutoTdmaAdjustLowRssi); CL_PRINTF(cliBuf); CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d ", "DecBtPwr/ IgnWlanAct", \ @@ -4387,17 +4508,30 @@ EXhalbtc8812a2ant_IpsNotify( IN u1Byte type ) { + BOOLEAN bWifiUnder5G=FALSE; + if(BTC_IPS_ENTER == type) { BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], IPS ENTER notify\n")); pCoexSta->bUnderIps = TRUE; halbtc8812a2ant_CoexAllOff(pBtCoexist); halbtc8812a2ant_SetAntPath(pBtCoexist, BTC_ANT_WIFI_AT_CPL_AUX, FALSE, TRUE); + + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], IPS notify, force set BT to ignore Wlan active!!\n")); + halbtc8812a2ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, TRUE); + EXhalbtc8812a2ant_MediaStatusNotify(pBtCoexist, BTC_MEDIA_DISCONNECT); } else if(BTC_IPS_LEAVE == type) { BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], IPS LEAVE notify\n")); pCoexSta->bUnderIps = FALSE; + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_UNDER_5G, &bWifiUnder5G); + if(!bWifiUnder5G) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], IPS notify, force set BT NOT to ignore Wlan active!!\n")); + halbtc8812a2ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, FALSE); + } } } @@ -4515,6 +4649,7 @@ EXhalbtc8812a2ant_SpecialPacketNotify( { BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], DHCP Packet notify\n")); } + } VOID @@ -4532,7 +4667,7 @@ EXhalbtc8812a2ant_BtInfoNotify( pCoexSta->bC2hBtInfoReqSent = FALSE; pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_UNDER_5G, &bWifiUnder5G); - + rspSource = tmpBuf[0]&0xf; if(rspSource >= BT_INFO_SRC_8812A_2ANT_MAX) rspSource = BT_INFO_SRC_8812A_2ANT_WIFI_FW; @@ -4583,15 +4718,26 @@ EXhalbtc8812a2ant_BtInfoNotify( if( (pCoexSta->btInfoExt&BIT3) && !bWifiUnder5G) { + // BT already ignored WlanAct if(!pBtCoexist->bManualControl && !pBtCoexist->bStopCoexDm) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BT ext info bit3 check, set BT NOT to ignore Wlan active!!\n")); - halbtc8812a2ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, FALSE); + if(!pCoexSta->bUnderIps) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BT ext info bit3 check, set BT NOT to ignore Wlan active!!\n")); + halbtc8812a2ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, FALSE); + } } } else { // BT already NOT ignore Wlan active, do nothing here. + + if(pCoexSta->bUnderIps) + { + // work around for 8812a combo hw bug => when IPS, wlanAct is always high. + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], wifi is under IPS, set BT to ignore Wlan active!!\n")); + halbtc8812a2ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, TRUE); + } } } @@ -4609,6 +4755,7 @@ EXhalbtc8812a2ant_BtInfoNotify( pCoexSta->bA2dpExist = FALSE; pCoexSta->bHidExist = FALSE; pCoexSta->bScoExist = FALSE; + pCoexSta->bAclBusy = FALSE; } else // connection exists { @@ -4629,6 +4776,11 @@ EXhalbtc8812a2ant_BtInfoNotify( pCoexSta->bScoExist = TRUE; else pCoexSta->bScoExist = FALSE; + if(btInfo & BT_INFO_8812A_2ANT_B_ACL_BUSY) + pCoexSta->bAclBusy = TRUE; + else + pCoexSta->bAclBusy = FALSE; + } halbtc8812a2ant_UpdateBtLinkInfo(pBtCoexist); @@ -4692,6 +4844,7 @@ EXhalbtc8812a2ant_HaltNotify( BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Halt notify\n")); halbtc8812a2ant_SetAntPath(pBtCoexist, BTC_ANT_WIFI_AT_CPL_AUX, FALSE, TRUE); + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Halt notify, force set BT to ignore Wlan active!!\n")); halbtc8812a2ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, TRUE); EXhalbtc8812a2ant_MediaStatusNotify(pBtCoexist, BTC_MEDIA_DISCONNECT); diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8812a2Ant.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8812a2Ant.h index 31c78d324e6302..269d8494acb310 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8812a2Ant.h +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8812a2Ant.h @@ -125,6 +125,7 @@ typedef struct _COEX_STA_8812A_2ANT{ BOOLEAN bA2dpExist; BOOLEAN bHidExist; BOOLEAN bPanExist; + BOOLEAN bAclBusy; BOOLEAN bUnderLps; BOOLEAN bUnderIps; @@ -148,10 +149,15 @@ typedef struct _COEX_STA_8812A_2ANT{ // The following is interface which will notify coex module. //=========================================== VOID -EXhalbtc8812a2ant_InitHwConfig( +EXhalbtc8812a2ant_PowerOnSetting( IN PBTC_COEXIST pBtCoexist ); VOID +EXhalbtc8812a2ant_InitHwConfig( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bWifiOnly + ); +VOID EXhalbtc8812a2ant_InitCoexDm( IN PBTC_COEXIST pBtCoexist ); diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8821a1Ant.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8821a1Ant.c index 8728a47db5c966..c05c7668623d86 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8821a1Ant.c +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8821a1Ant.c @@ -1,7 +1,7 @@ //============================================================ // Description: // -// This file is for RTL8821A Co-exist mechanism +// This file is for 8821A_1ANT Co-exist mechanism // // History // 2012/11/15 Cosa first check in. @@ -27,8 +27,8 @@ const char *const GLBtInfoSrc8821a1Ant[]={ "BT Info[bt auto report]", }; -u4Byte GLCoexVerDate8821a1Ant=20130816; -u4Byte GLCoexVer8821a1Ant=0x41; +u4Byte GLCoexVerDate8821a1Ant=20140306; +u4Byte GLCoexVer8821a1Ant=0x4b; //============================================================ // local function proto type if needed @@ -420,7 +420,17 @@ halbtc8821a1ant_MonitorBtCtr( u4Byte regHPTx=0, regHPRx=0, regLPTx=0, regLPRx=0; u1Byte u1Tmp, u1Tmp1; s4Byte wifiRssi; - +#if 0 + //to avoid 0x76e[3] = 1 (WLAN_Act control by PTA) during IPS + if (! (pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x76e) & 0x8) ) + { + pCoexSta->highPriorityTx = 65535; + pCoexSta->highPriorityRx = 65535; + pCoexSta->lowPriorityTx = 65535; + pCoexSta->lowPriorityRx = 65535; + return; + } +#endif regHPTxRx = 0x770; regLPTxRx = 0x774; @@ -915,6 +925,8 @@ halbtc8821a1ant_CoexTableWithType( IN u1Byte type ) { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], ********** CoexTable(%d) **********\n", type)); + switch(type) { case 0: @@ -927,19 +939,19 @@ halbtc8821a1ant_CoexTableWithType( halbtc8821a1ant_CoexTable(pBtCoexist, bForceExec, 0x5a5a5a5a, 0x5a5a5a5a, 0xffffff, 0x3); break; case 3: - halbtc8821a1ant_CoexTable(pBtCoexist, bForceExec, 0x55555555, 0xaaaaaaaa, 0xffffff, 0x3); + halbtc8821a1ant_CoexTable(pBtCoexist, bForceExec, 0x5a5a5a5a, 0xaaaaaaaa, 0xffffff, 0x3); break; case 4: - halbtc8821a1ant_CoexTable(pBtCoexist, bForceExec, 0xffffffff, 0xffffffff, 0xffffff, 0x3); + halbtc8821a1ant_CoexTable(pBtCoexist, bForceExec, 0x55555555, 0xaaaaaaaa, 0xffffff, 0x3); break; case 5: - halbtc8821a1ant_CoexTable(pBtCoexist, bForceExec, 0x5fff5fff, 0x5fff5fff, 0xffffff, 0x3); + halbtc8821a1ant_CoexTable(pBtCoexist, bForceExec, 0x5a5a5a5a, 0xaaaa5a5a, 0xffffff, 0x3); break; case 6: - halbtc8821a1ant_CoexTable(pBtCoexist, bForceExec, 0x55ff55ff, 0x5a5a5a5a, 0xffffff, 0x3); + halbtc8821a1ant_CoexTable(pBtCoexist, bForceExec, 0x55555555, 0xaaaa5a5a, 0xffffff, 0x3); break; case 7: - halbtc8821a1ant_CoexTable(pBtCoexist, bForceExec, 0x5afa5afa, 0x5afa5afa, 0xffffff, 0x3); + halbtc8821a1ant_CoexTable(pBtCoexist, bForceExec, 0xaaaaaaaa, 0xaaaaaaaa, 0xffffff, 0x3); break; default: break; @@ -1000,18 +1012,35 @@ halbtc8821a1ant_SetFwPstdma( ) { u1Byte H2C_Parameter[5] ={0}; + u1Byte realByte1=byte1, realByte5=byte5; + BOOLEAN bApEnable=FALSE; - H2C_Parameter[0] = byte1; + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable); + + if(bApEnable) + { + if(byte1&BIT4 && !(byte1&BIT5)) + { + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], FW for 1Ant AP mode\n")); + realByte1 &= ~BIT4; + realByte1 |= BIT5; + + realByte5 |= BIT5; + realByte5 &= ~BIT6; + } + } + + H2C_Parameter[0] = realByte1; H2C_Parameter[1] = byte2; H2C_Parameter[2] = byte3; H2C_Parameter[3] = byte4; - H2C_Parameter[4] = byte5; + H2C_Parameter[4] = realByte5; - pCoexDm->psTdmaPara[0] = byte1; + pCoexDm->psTdmaPara[0] = realByte1; pCoexDm->psTdmaPara[1] = byte2; pCoexDm->psTdmaPara[2] = byte3; pCoexDm->psTdmaPara[3] = byte4; - pCoexDm->psTdmaPara[4] = byte5; + pCoexDm->psTdmaPara[4] = realByte5; BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], PS-TDMA H2C cmd =0x%x%08x\n", H2C_Parameter[0], @@ -1075,7 +1104,8 @@ halbtc8821a1ant_SwMechanism( IN BOOLEAN bLowPenaltyRA ) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], SM[LpRA] = %d \n", bLowPenaltyRA)); + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], SM[LpRA] = %d\n", + bLowPenaltyRA)); halbtc8821a1ant_LowPenaltyRa(pBtCoexist, NORMAL_EXEC, bLowPenaltyRA); } @@ -1100,8 +1130,8 @@ halbtc8821a1ant_SetAntPath( u4Tmp |= BIT24; pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x4c, u4Tmp); - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x975, 0x3, 0x3); - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0xcb4, 0x77); + //0x765 = 0x18 + pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x765, 0x18, 0x3); if(pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) { @@ -1110,7 +1140,7 @@ halbtc8821a1ant_SetAntPath( H2C_Parameter[1] = 1; pBtCoexist->fBtcFillH2c(pBtCoexist, 0x65, 2, H2C_Parameter); - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x64, 0x1, 0x1); //Main Ant to BT for IPS case 0x4c[23]=1 + //pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x64, 0x1, 0x1); //Main Ant to BT for IPS case 0x4c[23]=1 } else { @@ -1119,7 +1149,7 @@ halbtc8821a1ant_SetAntPath( H2C_Parameter[1] = 1; pBtCoexist->fBtcFillH2c(pBtCoexist, 0x65, 2, H2C_Parameter); - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x64, 0x1, 0x0); //Aux Ant to BT for IPS case 0x4c[23]=1 + //pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x64, 0x1, 0x0); //Aux Ant to BT for IPS case 0x4c[23]=1 } } else if(bWifiOff) @@ -1129,18 +1159,28 @@ halbtc8821a1ant_SetAntPath( u4Tmp &= ~BIT23; u4Tmp &= ~BIT24; pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x4c, u4Tmp); + + //0x765 = 0x18 + pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x765, 0x18, 0x3); + } + else + { + //0x765 = 0x0 + pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x765, 0x18, 0x0); } // ext switch setting switch(antPosType) { case BTC_ANT_PATH_WIFI: + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0xcb4, 0x77); if(pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0xcb7, 0x30, 0x1); else pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0xcb7, 0x30, 0x2); break; case BTC_ANT_PATH_BT: + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0xcb4, 0x77); if(pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0xcb7, 0x30, 0x2); else @@ -1148,6 +1188,7 @@ halbtc8821a1ant_SetAntPath( break; default: case BTC_ANT_PATH_PTA: + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0xcb4, 0x66); if(pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0xcb7, 0x30, 0x1); else @@ -1167,25 +1208,24 @@ halbtc8821a1ant_PsTdma( PBTC_BOARD_INFO pBoardInfo=&pBtCoexist->boardInfo; BOOLEAN bTurnOnByCnt=FALSE; u1Byte psTdmaTypeByCnt=0, rssiAdjustVal=0; - u4Byte fwVer=0; + //u4Byte fwVer=0; pCoexDm->bCurPsTdmaOn = bTurnOn; pCoexDm->curPsTdma = type; - if(!bForceExec) + if (pCoexDm->bCurPsTdmaOn) { - if (pCoexDm->bCurPsTdmaOn) - { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], ********** TDMA(on, %d) **********\n", - pCoexDm->curPsTdma)); - } - else - { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], ********** TDMA(off, %d) **********\n", - pCoexDm->curPsTdma)); - } - + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], ********** TDMA(on, %d) **********\n", + pCoexDm->curPsTdma)); + } + else + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], ********** TDMA(off, %d) **********\n", + pCoexDm->curPsTdma)); + } + if(!bForceExec) + { if( (pCoexDm->bPrePsTdmaOn == pCoexDm->bCurPsTdmaOn) && (pCoexDm->prePsTdma == pCoexDm->curPsTdma) ) return; @@ -1206,7 +1246,7 @@ halbtc8821a1ant_PsTdma( rssiAdjustVal = 14; break; case 3: - halbtc8821a1ant_SetFwPstdma(pBtCoexist, 0x51, 0x1d, 0x1d, 0x0, 0x10); + halbtc8821a1ant_SetFwPstdma(pBtCoexist, 0x51, 0x1d, 0x1d, 0x0, 0x52); break; case 4: halbtc8821a1ant_SetFwPstdma(pBtCoexist, 0x93, 0x15, 0x3, 0x14, 0x0); @@ -1216,7 +1256,7 @@ halbtc8821a1ant_PsTdma( halbtc8821a1ant_SetFwPstdma(pBtCoexist, 0x61, 0x15, 0x3, 0x11, 0x10); break; case 6: - halbtc8821a1ant_SetFwPstdma(pBtCoexist, 0x13, 0xa, 0x3, 0x0, 0x0); + halbtc8821a1ant_SetFwPstdma(pBtCoexist, 0x61, 0x20, 0x3, 0x11, 0x13); break; case 7: halbtc8821a1ant_SetFwPstdma(pBtCoexist, 0x13, 0xc, 0x5, 0x0, 0x0); @@ -1232,17 +1272,17 @@ halbtc8821a1ant_PsTdma( halbtc8821a1ant_SetFwPstdma(pBtCoexist, 0x13, 0xa, 0xa, 0x0, 0x40); break; case 11: - halbtc8821a1ant_SetFwPstdma(pBtCoexist, 0x51, 0x14, 0x03, 0x10, 0x10); + halbtc8821a1ant_SetFwPstdma(pBtCoexist, 0x51, 0x15, 0x03, 0x10, 0x50); rssiAdjustVal = 20; break; case 12: halbtc8821a1ant_SetFwPstdma(pBtCoexist, 0x51, 0x0a, 0x0a, 0x0, 0x50); break; case 13: - halbtc8821a1ant_SetFwPstdma(pBtCoexist, 0x51, 0x18, 0x18, 0x0, 0x10); + halbtc8821a1ant_SetFwPstdma(pBtCoexist, 0x51, 0x12, 0x12, 0x0, 0x50); break; case 14: - halbtc8821a1ant_SetFwPstdma(pBtCoexist, 0x51, 0x21, 0x3, 0x10, 0x10); + halbtc8821a1ant_SetFwPstdma(pBtCoexist, 0x51, 0x21, 0x3, 0x10, 0x52); break; case 15: halbtc8821a1ant_SetFwPstdma(pBtCoexist, 0x13, 0xa, 0x3, 0x8, 0x0); @@ -1259,7 +1299,7 @@ halbtc8821a1ant_PsTdma( halbtc8821a1ant_SetFwPstdma(pBtCoexist, 0x61, 0x35, 0x03, 0x11, 0x10); break; case 21: - halbtc8821a1ant_SetFwPstdma(pBtCoexist, 0x61, 0x15, 0x03, 0x11, 0x10); + halbtc8821a1ant_SetFwPstdma(pBtCoexist, 0x61, 0x25, 0x03, 0x11, 0x11); break; case 22: halbtc8821a1ant_SetFwPstdma(pBtCoexist, 0x61, 0x25, 0x03, 0x11, 0x10); @@ -1291,13 +1331,13 @@ halbtc8821a1ant_PsTdma( halbtc8821a1ant_SetFwPstdma(pBtCoexist, 0xab, 0x1a, 0x1a, 0x1, 0x10); break; case 30: - halbtc8821a1ant_SetFwPstdma(pBtCoexist, 0x51, 0x14, 0x3, 0x10, 0x50); + halbtc8821a1ant_SetFwPstdma(pBtCoexist, 0x51, 0x30, 0x3, 0x10, 0x10); break; case 31: halbtc8821a1ant_SetFwPstdma(pBtCoexist, 0xd3, 0x1a, 0x1a, 0, 0x58); break; case 32: - halbtc8821a1ant_SetFwPstdma(pBtCoexist, 0x61, 0xa, 0x3, 0x10, 0x0); + halbtc8821a1ant_SetFwPstdma(pBtCoexist, 0x61, 0x35, 0x3, 0x11, 0x11); break; case 33: halbtc8821a1ant_SetFwPstdma(pBtCoexist, 0xa3, 0x25, 0x3, 0x30, 0x90); @@ -1311,6 +1351,10 @@ halbtc8821a1ant_PsTdma( case 36: halbtc8821a1ant_SetFwPstdma(pBtCoexist, 0xd3, 0x12, 0x3, 0x14, 0x50); break; + case 40: // SoftAP only with no sta associated,BT disable ,TDMA mode for power saving + /* here softap mode screen off will cost 70-80mA for phone */ + halbtc8821a1ant_SetFwPstdma(pBtCoexist, 0x23, 0x18, 0x00, 0x10, 0x24); + break; } } else @@ -1702,29 +1746,6 @@ halbtc8821a1ant_CoexUnder5G( halbtc8821a1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 5); } -#define WIFI_ONLY_CHECK_UNDER_5G -#ifdef WIFI_ONLY_CHECK_UNDER_5G -VOID -halbtc8821a1ant_ActionWifiOnly( - IN PBTC_COEXIST pBtCoexist - ) -{ - BOOLEAN bWifiUnder5G=FALSE; - - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_UNDER_5G, &bWifiUnder5G); - - if (bWifiUnder5G) - { - halbtc8821a1ant_CoexUnder5G(pBtCoexist); - return; - } - else - { - halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); - halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 9); - } -} -#else VOID halbtc8821a1ant_ActionWifiOnly( IN PBTC_COEXIST pBtCoexist @@ -1733,7 +1754,6 @@ halbtc8821a1ant_ActionWifiOnly( halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 9); } -#endif VOID halbtc8821a1ant_MonitorBtEnableDisable( @@ -1893,6 +1913,16 @@ halbtc8821a1ant_ActionHidA2dp( // Non-Software Coex Mechanism start // //============================================= +VOID +halbtc8821a1ant_ActionWifiMultiPort( + IN PBTC_COEXIST pBtCoexist + ) +{ + halbtc8821a1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + + halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 8); + halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); +} VOID halbtc8821a1ant_ActionHs( @@ -1900,38 +1930,50 @@ halbtc8821a1ant_ActionHs( ) { halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 5); - halbtc8821a1ant_CoexTableWithType(pBtCoexist, FORCE_EXEC, 2); + halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); } VOID halbtc8821a1ant_ActionBtInquiry( IN PBTC_COEXIST pBtCoexist ) -{ +{ PBTC_BT_LINK_INFO pBtLinkInfo=&pBtCoexist->btLinkInfo; - BOOLEAN bWifiConnected=FALSE; - + BOOLEAN bWifiConnected=FALSE, bApEnable=FALSE, bWifiBusy=FALSE, bBtBusy=FALSE; + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_TRAFFIC_BUSY, &bBtBusy); - if(!bWifiConnected) + if((!bWifiConnected) && (!pCoexSta->bWiFiIsHighPriTask)) { halbtc8821a1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); - halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 5); - halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); + halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 8); + + halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); } - else if( (pBtLinkInfo->bScoExist) || - (pBtLinkInfo->bHidOnly) ) + else if((pBtLinkInfo->bScoExist) || (pBtLinkInfo->bHidExist) || (pBtLinkInfo->bA2dpExist)) { - // SCO/HID-only busy + // SCO/HID/A2DP busy halbtc8821a1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 32); - halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); + + halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + } + else if ((pBtLinkInfo->bPanExist) || (bWifiBusy)) + { + halbtc8821a1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 20); + + halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); } else { - halbtc8821a1ant_PowerSaveState(pBtCoexist, BTC_PS_LPS_ON, 0x50, 0x4); - halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 30); - halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); + halbtc8821a1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 8); + + halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); } } @@ -1941,13 +1983,24 @@ halbtc8821a1ant_ActionBtScoHidOnlyBusy( IN u1Byte wifiStatus ) { + PBTC_BT_LINK_INFO pBtLinkInfo=&pBtCoexist->btLinkInfo; + BOOLEAN bWifiConnected=FALSE; + u1Byte wifiRssiState=BTC_RSSI_STATE_HIGH; + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); + // tdma and coex table - halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 5); - if(BT_8821A_1ANT_WIFI_STATUS_NON_CONNECTED_ASSO_AUTH_SCAN == wifiStatus) - halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); - else - halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); + if(pBtLinkInfo->bScoExist) + { + halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 5); + halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); + } + else //HID + { + halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 6); + halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 5); + } } VOID @@ -1969,18 +2022,26 @@ halbtc8821a1ant_ActionWifiConnectedBtAclBusy( } else if(pBtLinkInfo->bA2dpOnly) //A2DP { - if( (btRssiState == BTC_RSSI_STATE_HIGH) || + if(BT_8821A_1ANT_WIFI_STATUS_CONNECTED_IDLE == wifiStatus) + { + //halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 8); + //halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); + halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 32); + halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); + pCoexDm->bAutoTdmaAdjust = FALSE; + } + else if( (btRssiState == BTC_RSSI_STATE_HIGH) || (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) { - halbtc8821a1ant_TdmaDurationAdjustForAcl(pBtCoexist, wifiStatus); + halbtc8821a1ant_TdmaDurationAdjustForAcl(pBtCoexist, wifiStatus); + halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); } else //for low BT RSSI { halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 11); + halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); pCoexDm->bAutoTdmaAdjust = FALSE; - } - - halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); + } } else if(pBtLinkInfo->bHidExist&&pBtLinkInfo->bA2dpExist) //HID+A2DP { @@ -1992,16 +2053,16 @@ halbtc8821a1ant_ActionWifiConnectedBtAclBusy( } else //for low BT RSSI { - halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 11); + halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 14); pCoexDm->bAutoTdmaAdjust = FALSE; } - halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); + halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 6); } else if( (pBtLinkInfo->bPanOnly) || (pBtLinkInfo->bHidExist&&pBtLinkInfo->bPanExist) ) //PAN(OPP,FTP), HID+PAN(OPP,FTP) { halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 3); - halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); + halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 6); pCoexDm->bAutoTdmaAdjust = FALSE; } else if ( ((pBtLinkInfo->bA2dpExist) && (pBtLinkInfo->bPanExist)) || @@ -2028,20 +2089,80 @@ halbtc8821a1ant_ActionWifiNotConnected( halbtc8821a1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); // tdma and coex table - halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 8); + halbtc8821a1ant_PsTdma(pBtCoexist, FORCE_EXEC, FALSE, 8); halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); } VOID -halbtc8821a1ant_ActionWifiNotConnectedAssoAuthScan( +halbtc8821a1ant_ActionWifiNotConnectedScan( IN PBTC_COEXIST pBtCoexist ) { + PBTC_BT_LINK_INFO pBtLinkInfo=&pBtCoexist->btLinkInfo; + halbtc8821a1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + + // tdma and coex table + if(BT_8821A_1ANT_BT_STATUS_ACL_BUSY == pCoexDm->btStatus) + { + if (pBtLinkInfo->bA2dpExist) + { + halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 32); + halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + } + else if (pBtLinkInfo->bA2dpExist && pBtLinkInfo->bPanExist) + { + halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 22); + halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + } + else + { + halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 20); + halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + } + } + else if( (BT_8821A_1ANT_BT_STATUS_SCO_BUSY == pCoexDm->btStatus) || + (BT_8821A_1ANT_BT_STATUS_ACL_SCO_BUSY == pCoexDm->btStatus) ) + { + halbtc8821a1ant_ActionBtScoHidOnlyBusy(pBtCoexist, + BT_8821A_1ANT_WIFI_STATUS_CONNECTED_SCAN); + } + else + { + //halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 20); + //halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); + + //Bryant Add + halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 8); + halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); + } +} +VOID +halbtc8821a1ant_ActionWifiNotConnectedAssoAuth( + IN PBTC_COEXIST pBtCoexist + ) +{ + PBTC_BT_LINK_INFO pBtLinkInfo=&pBtCoexist->btLinkInfo; + + halbtc8821a1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); - halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 22); - halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); + // tdma and coex table + if( (pBtLinkInfo->bScoExist) || (pBtLinkInfo->bHidExist) ) + { + halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 32); + halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + } + else if( (pBtLinkInfo->bA2dpExist) || (pBtLinkInfo->bPanExist) ) + { + halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 20); + halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + } + else + { + halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 8); + halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); + } } VOID @@ -2051,22 +2172,26 @@ halbtc8821a1ant_ActionWifiConnectedScan( { PBTC_BT_LINK_INFO pBtLinkInfo=&pBtCoexist->btLinkInfo; - // power save state halbtc8821a1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); // tdma and coex table if(BT_8821A_1ANT_BT_STATUS_ACL_BUSY == pCoexDm->btStatus) { - if(pBtLinkInfo->bA2dpExist && pBtLinkInfo->bPanExist) + if (pBtLinkInfo->bA2dpExist) + { + halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 32); + halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + } + else if (pBtLinkInfo->bA2dpExist && pBtLinkInfo->bPanExist) { halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 22); - halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); + halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); } else { - halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 20); - halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); - } + halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 20); + halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + } } else if( (BT_8821A_1ANT_BT_STATUS_SCO_BUSY == pCoexDm->btStatus) || (BT_8821A_1ANT_BT_STATUS_ACL_SCO_BUSY == pCoexDm->btStatus) ) @@ -2076,8 +2201,12 @@ halbtc8821a1ant_ActionWifiConnectedScan( } else { - halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 20); - halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); + //halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 20); + //halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); + + //Bryant Add + halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 8); + halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); } } @@ -2086,31 +2215,25 @@ halbtc8821a1ant_ActionWifiConnectedSpecialPacket( IN PBTC_COEXIST pBtCoexist ) { - BOOLEAN bHsConnecting=FALSE; PBTC_BT_LINK_INFO pBtLinkInfo=&pBtCoexist->btLinkInfo; - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_CONNECTING, &bHsConnecting); - halbtc8821a1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); // tdma and coex table - if(BT_8821A_1ANT_BT_STATUS_ACL_BUSY == pCoexDm->btStatus) + if((pBtLinkInfo->bScoExist) || (pBtLinkInfo->bHidExist) || (pBtLinkInfo->bA2dpExist)) { - if(pBtLinkInfo->bA2dpExist && pBtLinkInfo->bPanExist) - { - halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 22); - halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); - } - else - { - halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 20); - halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); - } + halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 32); + halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); } - else + else if(pBtLinkInfo->bPanExist) { halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 20); - halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 1); + halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + } + else + { + halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 8); + halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); } } @@ -2121,7 +2244,7 @@ halbtc8821a1ant_ActionWifiConnected( { BOOLEAN bWifiBusy=FALSE; BOOLEAN bScan=FALSE, bLink=FALSE, bRoam=FALSE; - BOOLEAN bUnder4way=FALSE; + BOOLEAN bUnder4way=FALSE, bApEnable=FALSE; u4Byte wifiBw; BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], CoexForWifiConnect()===>\n")); @@ -2139,19 +2262,28 @@ halbtc8821a1ant_ActionWifiConnected( pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_ROAM, &bRoam); if(bScan || bLink || bRoam) { - halbtc8821a1ant_ActionWifiConnectedScan(pBtCoexist); + if(bScan) + halbtc8821a1ant_ActionWifiConnectedScan(pBtCoexist); + else + halbtc8821a1ant_ActionWifiConnectedSpecialPacket(pBtCoexist); BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], CoexForWifiConnect(), return for wifi is under scan<===\n")); return; } + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); // power save state - if(BT_8821A_1ANT_BT_STATUS_ACL_BUSY == pCoexDm->btStatus && !pBtCoexist->btLinkInfo.bHidOnly) - halbtc8821a1ant_PowerSaveState(pBtCoexist, BTC_PS_LPS_ON, 0x50, 0x4); + if(!bApEnable && BT_8821A_1ANT_BT_STATUS_ACL_BUSY == pCoexDm->btStatus && !pBtCoexist->btLinkInfo.bHidOnly) + { + if(!bWifiBusy && pBtCoexist->btLinkInfo.bA2dpOnly) //A2DP + halbtc8821a1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + else + halbtc8821a1ant_PowerSaveState(pBtCoexist, BTC_PS_LPS_ON, 0x50, 0x4); + } else halbtc8821a1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); // tdma and coex table - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); if(!bWifiBusy) { if(BT_8821A_1ANT_BT_STATUS_ACL_BUSY == pCoexDm->btStatus) @@ -2167,7 +2299,7 @@ halbtc8821a1ant_ActionWifiConnected( } else { - halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 5); + halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 8); halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); } } @@ -2186,7 +2318,7 @@ halbtc8821a1ant_ActionWifiConnected( } else { - halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 5); + halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 8); halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); } } @@ -2270,6 +2402,8 @@ halbtc8821a1ant_RunCoexistMechanism( BOOLEAN bBtCtrlAggBufSize=FALSE; u1Byte aggBufSize=5; u1Byte wifiRssiState=BTC_RSSI_STATE_HIGH; + u4Byte wifiLinkStatus=0; + u4Byte numOfWifiLink=0; BOOLEAN bWifiUnder5G=FALSE; BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], RunCoexistMechanism()===>\n")); @@ -2308,9 +2442,18 @@ halbtc8821a1ant_RunCoexistMechanism( } pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_INC_SCAN_DEV_NUM, &bIncreaseScanDevNum); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus); + numOfWifiLink = wifiLinkStatus>>16; + if((numOfWifiLink>=2) || (wifiLinkStatus&WIFI_P2P_GO_CONNECTED)) + { + halbtc8821a1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0); + halbtc8821a1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, bBtCtrlAggBufSize, aggBufSize); + halbtc8821a1ant_ActionWifiMultiPort(pBtCoexist); + return; + } + if(!pBtLinkInfo->bScoExist && !pBtLinkInfo->bHidExist) { halbtc8821a1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0); @@ -2380,7 +2523,12 @@ halbtc8821a1ant_RunCoexistMechanism( pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_ROAM, &bRoam); if(bScan || bLink || bRoam) - halbtc8821a1ant_ActionWifiNotConnectedAssoAuthScan(pBtCoexist); + { + if (bScan) + halbtc8821a1ant_ActionWifiNotConnectedScan(pBtCoexist); + else + halbtc8821a1ant_ActionWifiNotConnectedAssoAuth(pBtCoexist); + } else halbtc8821a1ant_ActionWifiNotConnected(pBtCoexist); } @@ -2399,14 +2547,15 @@ halbtc8821a1ant_InitCoexDm( // sw all off halbtc8821a1ant_SwMechanism(pBtCoexist, FALSE); - halbtc8821a1ant_PsTdma(pBtCoexist, FORCE_EXEC, FALSE, 8); + //halbtc8821a1ant_PsTdma(pBtCoexist, FORCE_EXEC, FALSE, 8); halbtc8821a1ant_CoexTableWithType(pBtCoexist, FORCE_EXEC, 0); } VOID halbtc8821a1ant_InitHwConfig( IN PBTC_COEXIST pBtCoexist, - IN BOOLEAN bBackUp + IN BOOLEAN bBackUp, + IN BOOLEAN bWifiOnly ) { PBTC_BOARD_INFO pBoardInfo=&pBtCoexist->boardInfo; @@ -2416,9 +2565,12 @@ halbtc8821a1ant_InitHwConfig( u1Byte H2C_Parameter[2] ={0}; BOOLEAN bWifiUnder5G=FALSE; - + BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], 1Ant Init HW Config!!\n")); + if(bWifiOnly) + return; + if(bBackUp) { pCoexDm->backupArfrCnt1 = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x430); @@ -2440,6 +2592,7 @@ halbtc8821a1ant_InitHwConfig( halbtc8821a1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, TRUE, FALSE); else halbtc8821a1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_PTA, TRUE, FALSE); + // PTA parameter halbtc8821a1ant_CoexTableWithType(pBtCoexist, FORCE_EXEC, 0); @@ -2456,11 +2609,19 @@ halbtc8821a1ant_InitHwConfig( // extern function start with EXhalbtc8821a1ant_ //============================================================ VOID -EXhalbtc8821a1ant_InitHwConfig( +EXhalbtc8821a1ant_PowerOnSetting( IN PBTC_COEXIST pBtCoexist ) { - halbtc8821a1ant_InitHwConfig(pBtCoexist, TRUE); +} + +VOID +EXhalbtc8821a1ant_InitHwConfig( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bWifiOnly + ) +{ + halbtc8821a1ant_InitHwConfig(pBtCoexist, TRUE, bWifiOnly); } VOID @@ -2489,11 +2650,7 @@ EXhalbtc8821a1ant_DisplayCoexInfo( u1Byte u1Tmp[4], i, btInfoExt, psTdmaCase=0; u2Byte u2Tmp[4]; u4Byte u4Tmp[4]; - BOOLEAN bRoam=FALSE, bScan=FALSE, bLink=FALSE, bWifiUnder5G=FALSE; - BOOLEAN bBtHsOn=FALSE, bWifiBusy=FALSE; - s4Byte wifiRssi=0, btHsRssi=0; - u4Byte wifiBw, wifiTrafficDir; - u1Byte wifiDot11Chnl, wifiHsChnl; + u4Byte faOfdm, faCck; u4Byte fwVer=0, btPatchVer=0; CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n ============[BT Coexist info]============"); @@ -2514,13 +2671,6 @@ EXhalbtc8821a1ant_DisplayCoexInfo( CL_PRINTF(cliBuf); } - if(!pBoardInfo->bBtExist) - { - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n BT not exists !!!"); - CL_PRINTF(cliBuf); - return; - } - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d", "Ant PG Num/ Ant Mech/ Ant Pos:", \ pBoardInfo->pgAntNum, pBoardInfo->btdmAntNum, pBoardInfo->btdmAntPos); CL_PRINTF(cliBuf); @@ -2535,40 +2685,19 @@ EXhalbtc8821a1ant_DisplayCoexInfo( GLCoexVerDate8821a1Ant, GLCoexVer8821a1Ant, fwVer, btPatchVer, btPatchVer); CL_PRINTF(cliBuf); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_DOT11_CHNL, &wifiDot11Chnl); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_HS_CHNL, &wifiHsChnl); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d(%d)", "Dot11 channel / HsChnl(HsMode)", \ - wifiDot11Chnl, wifiHsChnl, bBtHsOn); - CL_PRINTF(cliBuf); - - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %02x %02x %02x ", "H2C Wifi inform bt chnl Info", \ + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %02x %02x %02x ", "Wifi channel informed to BT", \ pCoexDm->wifiChnlInfo[0], pCoexDm->wifiChnlInfo[1], pCoexDm->wifiChnlInfo[2]); CL_PRINTF(cliBuf); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_WIFI_RSSI, &wifiRssi); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_HS_RSSI, &btHsRssi); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d", "Wifi rssi/ HS rssi", \ - wifiRssi, btHsRssi); - CL_PRINTF(cliBuf); - - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_LINK, &bLink); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_ROAM, &bRoam); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d ", "Wifi bLink/ bRoam/ bScan", \ - bLink, bRoam, bScan); + // wifi status + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[Wifi Status]============"); CL_PRINTF(cliBuf); + pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_WIFI_STATUS); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_UNDER_5G, &bWifiUnder5G); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_TRAFFIC_DIRECTION, &wifiTrafficDir); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s / %s/ %s ", "Wifi status", \ - (bWifiUnder5G? "5G":"2.4G"), - ((BTC_WIFI_BW_LEGACY==wifiBw)? "Legacy": (((BTC_WIFI_BW_HT40==wifiBw)? "HT40":"HT20"))), - ((!bWifiBusy)? "idle": ((BTC_WIFI_TRAFFIC_TX==wifiTrafficDir)? "uplink":"downlink"))); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[BT Status]============"); CL_PRINTF(cliBuf); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = [%s/ %d/ %d] ", "BT [status/ rssi/ retryCnt]", \ ((pBtCoexist->btInfo.bBtDisabled)? ("disabled"): ((pCoexSta->bC2hBtInquiryPage)?("inquiry/page scan"):((BT_8821A_1ANT_BT_STATUS_NON_CONNECTED_IDLE == pCoexDm->btStatus)? "non-connected idle": ( (BT_8821A_1ANT_BT_STATUS_CONNECTED_IDLE == pCoexDm->btStatus)? "connected-idle":"busy")))), @@ -2597,13 +2726,6 @@ EXhalbtc8821a1ant_DisplayCoexInfo( CL_PRINTF(cliBuf); } } - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s/%s, (0x%x/0x%x)", "PS state, IPS/LPS, (lps/rpwm)", \ - ((pCoexSta->bUnderIps? "IPS ON":"IPS OFF")), - ((pCoexSta->bUnderLps? "LPS ON":"LPS OFF")), - pBtCoexist->btInfo.lpsVal, - pBtCoexist->btInfo.rpwmVal); - CL_PRINTF(cliBuf); - pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_FW_PWR_MODE_CMD); if(!pBtCoexist->bManualControl) { @@ -2634,13 +2756,13 @@ EXhalbtc8821a1ant_DisplayCoexInfo( pCoexDm->psTdmaPara[4], psTdmaCase, pCoexDm->bAutoTdmaAdjust); CL_PRINTF(cliBuf); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x ", "Latest error condition(should be 0)", \ - pCoexDm->errorCondition); - CL_PRINTF(cliBuf); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d ", "IgnWlanAct", \ pCoexDm->bCurIgnoreWlanAct); CL_PRINTF(cliBuf); + + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x ", "Latest error condition(should be 0)", \ + pCoexDm->errorCondition); + CL_PRINTF(cliBuf); } // Hw setting @@ -2705,9 +2827,8 @@ EXhalbtc8821a1ant_DisplayCoexInfo( u4Tmp[0] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x6c0); u4Tmp[1] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x6c4); u4Tmp[2] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x6c8); - u1Tmp[0] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x6cc); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/ 0x%x/ 0x%x/ 0x%x", "0x6c0/0x6c4/0x6c8/0x6cc(coexTable)", \ - u4Tmp[0], u4Tmp[1], u4Tmp[2], u1Tmp[0]); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/ 0x%x/ 0x%x", "0x6c0/0x6c4/0x6c8(coexTable)", \ + u4Tmp[0], u4Tmp[1], u4Tmp[2]); CL_PRINTF(cliBuf); CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d", "0x770(high-pri rx/tx)", \ @@ -2738,17 +2859,20 @@ EXhalbtc8821a1ant_IpsNotify( { BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], IPS ENTER notify\n")); pCoexSta->bUnderIps = TRUE; - halbtc8821a1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, FALSE, TRUE); - //set PTA control - halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 8); + + halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 0); halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); + halbtc8821a1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, FALSE, TRUE); + //halbtc8821a1ant_SetAntPathDCut(pBtCoexist, FALSE, FALSE, FALSE, BTC_ANT_PATH_BT, BTC_WIFI_STAT_NORMAL_OFF); } else if(BTC_IPS_LEAVE == type) { BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], IPS LEAVE notify\n")); pCoexSta->bUnderIps = FALSE; - halbtc8821a1ant_RunCoexistMechanism(pBtCoexist); + halbtc8821a1ant_InitHwConfig(pBtCoexist, FALSE, FALSE); + halbtc8821a1ant_InitCoexDm(pBtCoexist); + halbtc8821a1ant_QueryBtInfo(pBtCoexist); } } @@ -2780,10 +2904,29 @@ EXhalbtc8821a1ant_ScanNotify( ) { BOOLEAN bWifiConnected=FALSE, bBtHsOn=FALSE; + u4Byte wifiLinkStatus=0; + u4Byte numOfWifiLink=0; + BOOLEAN bBtCtrlAggBufSize=FALSE; + u1Byte aggBufSize=5; if(pBtCoexist->bManualControl || - pBtCoexist->bStopCoexDm || - pBtCoexist->btInfo.bBtDisabled ) + pBtCoexist->bStopCoexDm ) + return; + + if(BTC_SCAN_START == type) + { + pCoexSta->bWiFiIsHighPriTask = TRUE; + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN START notify\n")); + + halbtc8821a1ant_PsTdma(pBtCoexist, FORCE_EXEC, FALSE, 8); //Force antenna setup for no scan result issue + } + else + { + pCoexSta->bWiFiIsHighPriTask = FALSE; + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN FINISH notify\n")); + } + + if(pBtCoexist->btInfo.bBtDisabled) return; pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); @@ -2791,6 +2934,16 @@ EXhalbtc8821a1ant_ScanNotify( halbtc8821a1ant_QueryBtInfo(pBtCoexist); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus); + numOfWifiLink = wifiLinkStatus>>16; + if(numOfWifiLink >= 2) + { + halbtc8821a1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0); + halbtc8821a1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, bBtCtrlAggBufSize, aggBufSize); + halbtc8821a1ant_ActionWifiMultiPort(pBtCoexist); + return; + } + if(pCoexSta->bC2hBtInquiryPage) { halbtc8821a1ant_ActionBtInquiry(pBtCoexist); @@ -2804,10 +2957,10 @@ EXhalbtc8821a1ant_ScanNotify( if(BTC_SCAN_START == type) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN START notify\n")); + //BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN START notify\n")); if(!bWifiConnected) // non-connected scan { - halbtc8821a1ant_ActionWifiNotConnectedAssoAuthScan(pBtCoexist); + halbtc8821a1ant_ActionWifiNotConnectedScan(pBtCoexist); } else // wifi is connected { @@ -2816,7 +2969,7 @@ EXhalbtc8821a1ant_ScanNotify( } else if(BTC_SCAN_FINISH == type) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN FINISH notify\n")); + //BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN FINISH notify\n")); if(!bWifiConnected) // non-connected scan { halbtc8821a1ant_ActionWifiNotConnected(pBtCoexist); @@ -2835,12 +2988,39 @@ EXhalbtc8821a1ant_ConnectNotify( ) { BOOLEAN bWifiConnected=FALSE, bBtHsOn=FALSE; + u4Byte wifiLinkStatus=0; + u4Byte numOfWifiLink=0; + BOOLEAN bBtCtrlAggBufSize=FALSE; + u1Byte aggBufSize=5; if(pBtCoexist->bManualControl || pBtCoexist->bStopCoexDm || pBtCoexist->btInfo.bBtDisabled ) return; + if(BTC_ASSOCIATE_START == type) + { + pCoexSta->bWiFiIsHighPriTask = TRUE; + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT START notify\n")); + pCoexDm->nArpCnt = 0; + } + else + { + pCoexSta->bWiFiIsHighPriTask = FALSE; + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT FINISH notify\n")); + pCoexDm->nArpCnt = 0; + } + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus); + numOfWifiLink = wifiLinkStatus>>16; + if(numOfWifiLink >= 2) + { + halbtc8821a1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0); + halbtc8821a1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, bBtCtrlAggBufSize, aggBufSize); + halbtc8821a1ant_ActionWifiMultiPort(pBtCoexist); + return; + } + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); if(pCoexSta->bC2hBtInquiryPage) { @@ -2855,12 +3035,12 @@ EXhalbtc8821a1ant_ConnectNotify( if(BTC_ASSOCIATE_START == type) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT START notify\n")); - halbtc8821a1ant_ActionWifiNotConnectedAssoAuthScan(pBtCoexist); + //BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT START notify\n")); + halbtc8821a1ant_ActionWifiNotConnectedAssoAuth(pBtCoexist); } else if(BTC_ASSOCIATE_FINISH == type) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT FINISH notify\n")); + //BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT FINISH notify\n")); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); if(!bWifiConnected) // non-connected scan @@ -2896,6 +3076,7 @@ EXhalbtc8821a1ant_MediaStatusNotify( else { BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], MEDIA disconnect notify\n")); + pCoexDm->nArpCnt = 0; } // only 2.4G we need to inform bt the chnl mask @@ -2930,14 +3111,49 @@ EXhalbtc8821a1ant_SpecialPacketNotify( ) { BOOLEAN bBtHsOn=FALSE; + u4Byte wifiLinkStatus=0; + u4Byte numOfWifiLink=0; + BOOLEAN bBtCtrlAggBufSize=FALSE; + u1Byte aggBufSize=5; if(pBtCoexist->bManualControl || pBtCoexist->bStopCoexDm || pBtCoexist->btInfo.bBtDisabled ) return; + if( BTC_PACKET_DHCP == type || + BTC_PACKET_EAPOL == type || + BTC_PACKET_ARP == type ) + { + pCoexSta->bWiFiIsHighPriTask = TRUE; + + if(BTC_PACKET_ARP == type) + { + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], special Packet ARP notify\n")); + } + else + { + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], special Packet DHCP or EAPOL notify\n")); + } + } + else + { + pCoexSta->bWiFiIsHighPriTask = FALSE; + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], special Packet [Type = %d] notify\n", type)); + } + pCoexSta->specialPktPeriodCnt = 0; + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus); + numOfWifiLink = wifiLinkStatus>>16; + if(numOfWifiLink >= 2) + { + halbtc8821a1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0); + halbtc8821a1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, bBtCtrlAggBufSize, aggBufSize); + halbtc8821a1ant_ActionWifiMultiPort(pBtCoexist); + return; + } + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); if(pCoexSta->bC2hBtInquiryPage) { @@ -2951,9 +3167,18 @@ EXhalbtc8821a1ant_SpecialPacketNotify( } if( BTC_PACKET_DHCP == type || - BTC_PACKET_EAPOL == type ) + BTC_PACKET_EAPOL == type || + BTC_PACKET_ARP == type ) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], special Packet(%d) notify\n", type)); + //BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], special Packet(%d) notify\n", type)); + if(BTC_PACKET_ARP == type) + { + pCoexDm->nArpCnt++; + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], ARP Packet Count = %d\n", pCoexDm->nArpCnt)); + if(pCoexDm->nArpCnt >= 10) // if APR PKT > 10 after connect, do not go to ActionWifiConnectedSpecialPacket(pBtCoexist) + return; + } + halbtc8821a1ant_ActionWifiConnectedSpecialPacket(pBtCoexist); } } @@ -3002,12 +3227,26 @@ EXhalbtc8821a1ant_BtInfoNotify( pCoexSta->btRetryCnt = // [3:0] pCoexSta->btInfoC2h[rspSource][2]&0xf; + if (pCoexSta->btInfoC2h[rspSource][2]&0x20) + pCoexSta->bC2hBtPage = TRUE; + else + pCoexSta->bC2hBtPage = FALSE; + pCoexSta->btRssi = pCoexSta->btInfoC2h[rspSource][3]*2+10; pCoexSta->btInfoExt = pCoexSta->btInfoC2h[rspSource][4]; + pCoexSta->bBtTxRxMask = (pCoexSta->btInfoC2h[rspSource][2]&0x40); + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_TX_RX_MASK, &pCoexSta->bBtTxRxMask); + if(!pCoexSta->bBtTxRxMask) + { + /* BT into is responded by BT FW and BT RF REG 0x3C != 0x15 => Need to switch BT TRx Mask */ + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Switch BT TRx Mask since BT RF REG 0x3C != 0x15\n")); + pBtCoexist->fBtcSetBtReg(pBtCoexist, BTC_BT_REG_RF, 0x3c, 0x15); + } + // Here we need to resend some wifi info to BT // because bt is reset and loss of the info. if(pCoexSta->btInfoExt & BIT1) @@ -3043,7 +3282,6 @@ EXhalbtc8821a1ant_BtInfoNotify( } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BT ext info bit4 check, set BT to enable Auto Report!!\n")); halbtc8821a1ant_BtAutoReport(pBtCoexist, FORCE_EXEC, TRUE); } #endif @@ -3087,6 +3325,8 @@ EXhalbtc8821a1ant_BtInfoNotify( halbtc8821a1ant_UpdateBtLinkInfo(pBtCoexist); + btInfo = btInfo & 0x1f; //mask profile bit for connect-ilde identification ( for CSR case: A2DP idle --> 0x41) + if(!(btInfo&BT_INFO_8821A_1ANT_B_CONNECTION)) { pCoexDm->btStatus = BT_8821A_1ANT_BT_STATUS_NON_CONNECTED_IDLE; @@ -3136,15 +3376,16 @@ EXhalbtc8821a1ant_HaltNotify( BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Halt notify\n")); - pBtCoexist->bStopCoexDm = TRUE; - - halbtc8821a1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, FALSE, TRUE); - halbtc8821a1ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, TRUE); - halbtc8821a1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); halbtc8821a1ant_PsTdma(pBtCoexist, FORCE_EXEC, FALSE, 0); + halbtc8821a1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, FALSE, TRUE); + //halbtc8821a1ant_SetAntPathDCut(pBtCoexist, FALSE, FALSE, FALSE, BTC_ANT_PATH_BT, BTC_WIFI_STAT_NORMAL_OFF); + + halbtc8821a1ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, TRUE); EXhalbtc8821a1ant_MediaStatusNotify(pBtCoexist, BTC_MEDIA_DISCONNECT); + + pBtCoexist->bStopCoexDm = TRUE; } VOID @@ -3158,16 +3399,20 @@ EXhalbtc8821a1ant_PnpNotify( if(BTC_WIFI_PNP_SLEEP == pnpState) { BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Pnp notify to SLEEP\n")); - pBtCoexist->bStopCoexDm = TRUE; - halbtc8821a1ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, TRUE); + halbtc8821a1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); - halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 9); + halbtc8821a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 0); + halbtc8821a1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); + halbtc8821a1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, FALSE, TRUE); + //halbtc8821a1ant_SetAntPathDCut(pBtCoexist, FALSE, FALSE, FALSE, BTC_ANT_PATH_BT, BTC_WIFI_STAT_NORMAL_OFF); + + pBtCoexist->bStopCoexDm = TRUE; } else if(BTC_WIFI_PNP_WAKE_UP == pnpState) { BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Pnp notify to WAKE UP\n")); pBtCoexist->bStopCoexDm = FALSE; - halbtc8821a1ant_InitHwConfig(pBtCoexist, FALSE); + halbtc8821a1ant_InitHwConfig(pBtCoexist, FALSE, FALSE); halbtc8821a1ant_InitCoexDm(pBtCoexist); halbtc8821a1ant_QueryBtInfo(pBtCoexist); } @@ -3208,10 +3453,10 @@ EXhalbtc8821a1ant_Periodical( if( halbtc8821a1ant_IsWifiStatusChanged(pBtCoexist) || pCoexDm->bAutoTdmaAdjust ) { - if(pCoexSta->specialPktPeriodCnt > 2) - { + //if(pCoexSta->specialPktPeriodCnt > 2) + //{ halbtc8821a1ant_RunCoexistMechanism(pBtCoexist); - } + //} } pCoexSta->specialPktPeriodCnt++; diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8821a1Ant.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8821a1Ant.h index a9656abc2e2983..4c7469ef67c821 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8821a1Ant.h +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8821a1Ant.h @@ -1,7 +1,7 @@ //=========================================== // The following is for 8821A 1ANT BT Co-exist definition //=========================================== -#define BT_AUTO_REPORT_ONLY_8821A_1ANT 0 +#define BT_AUTO_REPORT_ONLY_8821A_1ANT 1 #define BT_INFO_8821A_1ANT_B_FTP BIT7 #define BT_INFO_8821A_1ANT_B_A2DP BIT6 @@ -108,6 +108,7 @@ typedef struct _COEX_DM_8821A_1ANT{ u1Byte curRetryLimitType; u1Byte preAmpduTimeType; u1Byte curAmpduTimeType; + u4Byte nArpCnt; u1Byte errorCondition; } COEX_DM_8821A_1ANT, *PCOEX_DM_8821A_1ANT; @@ -127,12 +128,15 @@ typedef struct _COEX_STA_8821A_1ANT{ u4Byte lowPriorityTx; u4Byte lowPriorityRx; u1Byte btRssi; + BOOLEAN bBtTxRxMask; u1Byte preBtRssiState; u1Byte preWifiRssiState[4]; BOOLEAN bC2hBtInfoReqSent; u1Byte btInfoC2h[BT_INFO_SRC_8821A_1ANT_MAX][10]; u4Byte btInfoC2hCnt[BT_INFO_SRC_8821A_1ANT_MAX]; BOOLEAN bC2hBtInquiryPage; + BOOLEAN bC2hBtPage; //Add for win8.1 page out issue + BOOLEAN bWiFiIsHighPriTask; //Add for win8.1 page out issue u1Byte btRetryCnt; u1Byte btInfoExt; }COEX_STA_8821A_1ANT, *PCOEX_STA_8821A_1ANT; @@ -141,10 +145,15 @@ typedef struct _COEX_STA_8821A_1ANT{ // The following is interface which will notify coex module. //=========================================== VOID -EXhalbtc8821a1ant_InitHwConfig( +EXhalbtc8821a1ant_PowerOnSetting( IN PBTC_COEXIST pBtCoexist ); VOID +EXhalbtc8821a1ant_InitHwConfig( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bWifiOnly + ); +VOID EXhalbtc8821a1ant_InitCoexDm( IN PBTC_COEXIST pBtCoexist ); @@ -201,10 +210,4 @@ VOID EXhalbtc8821a1ant_DisplayCoexInfo( IN PBTC_COEXIST pBtCoexist ); -VOID -EXhalbtc8821a1ant_DbgControl( - IN PBTC_COEXIST pBtCoexist, - IN u1Byte opCode, - IN u1Byte opLen, - IN pu1Byte pData - ); + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8821a2Ant.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8821a2Ant.c index 0d513790a4053a..2e5ee7696903af 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8821a2Ant.c +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8821a2Ant.c @@ -4,8 +4,7 @@ // This file is for RTL8821A Co-exist mechanism // // History -// 2012/08/22 Cosa first check in. -// 2012/11/14 Cosa Revise for 8821A 2Ant out sourcing. +// 2012/11/15 Cosa first check in. // //============================================================ @@ -13,13 +12,18 @@ // include files //============================================================ #include "Mp_Precomp.h" + +#ifdef WPP_SOFTWARE_TRACE +#include "HalBtc8821a2Ant.tmh" +#endif + #if(BT_30_SUPPORT == 1) //============================================================ // Global variables, these are static variables //============================================================ -static COEX_DM_8821A_2ANT GLCoexDm8821a2Ant; +static COEX_DM_8821A_2ANT GLCoexDm8821a2Ant; static PCOEX_DM_8821A_2ANT pCoexDm=&GLCoexDm8821a2Ant; -static COEX_STA_8821A_2ANT GLCoexSta8821a2Ant; +static COEX_STA_8821A_2ANT GLCoexSta8821a2Ant; static PCOEX_STA_8821A_2ANT pCoexSta=&GLCoexSta8821a2Ant; const char *const GLBtInfoSrc8821a2Ant[]={ @@ -28,8 +32,8 @@ const char *const GLBtInfoSrc8821a2Ant[]={ "BT Info[bt auto report]", }; -u4Byte GLCoexVerDate8821a2Ant=20130618; -u4Byte GLCoexVer8821a2Ant=0x5050; +u4Byte GLCoexVerDate8821a2Ant=20150128; +u4Byte GLCoexVer8821a2Ant=0x51; //============================================================ // local function proto type if needed @@ -57,12 +61,10 @@ halbtc8821a2ant_BtRssiState( if(btRssi >= (rssiThresh+BTC_RSSI_COEX_THRESH_TOL_8821A_2ANT)) { btRssiState = BTC_RSSI_STATE_HIGH; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state switch to High\n")); } else { btRssiState = BTC_RSSI_STATE_STAY_LOW; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state stay at Low\n")); } } else @@ -70,12 +72,10 @@ halbtc8821a2ant_BtRssiState( if(btRssi < rssiThresh) { btRssiState = BTC_RSSI_STATE_LOW; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state switch to Low\n")); } else { btRssiState = BTC_RSSI_STATE_STAY_HIGH; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state stay at High\n")); } } } @@ -83,7 +83,7 @@ halbtc8821a2ant_BtRssiState( { if(rssiThresh > rssiThresh1) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi thresh error!!\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BT Rssi thresh error!!\n")); return pCoexSta->preBtRssiState; } @@ -93,12 +93,10 @@ halbtc8821a2ant_BtRssiState( if(btRssi >= (rssiThresh+BTC_RSSI_COEX_THRESH_TOL_8821A_2ANT)) { btRssiState = BTC_RSSI_STATE_MEDIUM; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state switch to Medium\n")); } else { btRssiState = BTC_RSSI_STATE_STAY_LOW; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state stay at Low\n")); } } else if( (pCoexSta->preBtRssiState == BTC_RSSI_STATE_MEDIUM) || @@ -107,17 +105,14 @@ halbtc8821a2ant_BtRssiState( if(btRssi >= (rssiThresh1+BTC_RSSI_COEX_THRESH_TOL_8821A_2ANT)) { btRssiState = BTC_RSSI_STATE_HIGH; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state switch to High\n")); } else if(btRssi < rssiThresh) { btRssiState = BTC_RSSI_STATE_LOW; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state switch to Low\n")); } else { btRssiState = BTC_RSSI_STATE_STAY_MEDIUM; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state stay at Medium\n")); } } else @@ -125,12 +120,10 @@ halbtc8821a2ant_BtRssiState( if(btRssi < rssiThresh1) { btRssiState = BTC_RSSI_STATE_MEDIUM; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state switch to Medium\n")); } else { btRssiState = BTC_RSSI_STATE_STAY_HIGH; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state stay at High\n")); } } } @@ -162,12 +155,10 @@ halbtc8821a2ant_WifiRssiState( if(wifiRssi >= (rssiThresh+BTC_RSSI_COEX_THRESH_TOL_8821A_2ANT)) { wifiRssiState = BTC_RSSI_STATE_HIGH; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to High\n")); } else { wifiRssiState = BTC_RSSI_STATE_STAY_LOW; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state stay at Low\n")); } } else @@ -175,12 +166,10 @@ halbtc8821a2ant_WifiRssiState( if(wifiRssi < rssiThresh) { wifiRssiState = BTC_RSSI_STATE_LOW; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to Low\n")); } else { wifiRssiState = BTC_RSSI_STATE_STAY_HIGH; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state stay at High\n")); } } } @@ -188,7 +177,7 @@ halbtc8821a2ant_WifiRssiState( { if(rssiThresh > rssiThresh1) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI thresh error!!\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], wifi RSSI thresh error!!\n")); return pCoexSta->preWifiRssiState[index]; } @@ -198,12 +187,10 @@ halbtc8821a2ant_WifiRssiState( if(wifiRssi >= (rssiThresh+BTC_RSSI_COEX_THRESH_TOL_8821A_2ANT)) { wifiRssiState = BTC_RSSI_STATE_MEDIUM; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to Medium\n")); } else { wifiRssiState = BTC_RSSI_STATE_STAY_LOW; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state stay at Low\n")); } } else if( (pCoexSta->preWifiRssiState[index] == BTC_RSSI_STATE_MEDIUM) || @@ -212,17 +199,14 @@ halbtc8821a2ant_WifiRssiState( if(wifiRssi >= (rssiThresh1+BTC_RSSI_COEX_THRESH_TOL_8821A_2ANT)) { wifiRssiState = BTC_RSSI_STATE_HIGH; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to High\n")); } else if(wifiRssi < rssiThresh) { wifiRssiState = BTC_RSSI_STATE_LOW; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to Low\n")); } else { wifiRssiState = BTC_RSSI_STATE_STAY_MEDIUM; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state stay at Medium\n")); } } else @@ -230,12 +214,10 @@ halbtc8821a2ant_WifiRssiState( if(wifiRssi < rssiThresh1) { wifiRssiState = BTC_RSSI_STATE_MEDIUM; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to Medium\n")); } else { wifiRssiState = BTC_RSSI_STATE_STAY_HIGH; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state stay at High\n")); } } } @@ -275,23 +257,23 @@ halbtc8821a2ant_MonitorBtEnableDisable( btDisableCnt = 0; bBtDisabled = FALSE; pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_DISABLE, &bBtDisabled); - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], BT is enabled !!\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BT is enabled !!\n")); } else { btDisableCnt++; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], bt all counters=0, %d times!!\n", + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], bt all counters=0, %d times!!\n", btDisableCnt)); if(btDisableCnt >= 2) { bBtDisabled = TRUE; pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_DISABLE, &bBtDisabled); - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], BT is disabled !!\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BT is disabled !!\n")); } } if(bPreBtDisabled != bBtDisabled) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], BT is from %s to %s!!\n", + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BT is from %s to %s!!\n", (bPreBtDisabled ? "disabled":"enabled"), (bBtDisabled ? "disabled":"enabled"))); bPreBtDisabled = bBtDisabled; @@ -304,6 +286,31 @@ halbtc8821a2ant_MonitorBtEnableDisable( } } +VOID +halbtc8821a2ant_LimitedRx( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bForceExec, + IN BOOLEAN bRejApAggPkt, + IN BOOLEAN bBtCtrlAggBufSize, + IN u1Byte aggBufSize + ) +{ + BOOLEAN bRejectRxAgg=bRejApAggPkt; + BOOLEAN bBtCtrlRxAggSize=bBtCtrlAggBufSize; + u1Byte rxAggSize=aggBufSize; + + //============================================ + // Rx Aggregation related setting + //============================================ + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_TO_REJ_AP_AGG_PKT, &bRejectRxAgg); + // decide BT control aggregation buf size or not + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_CTRL_AGG_SIZE, &bBtCtrlRxAggSize); + // aggregation buf size, only work when BT control Rx aggregation size. + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_U1_AGG_BUF_SIZE, &rxAggSize); + // real update aggregation setting + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_AGGREGATE_CTRL, NULL); +} + VOID halbtc8821a2ant_MonitorBtCtr( IN PBTC_COEXIST pBtCoexist @@ -313,6 +320,8 @@ halbtc8821a2ant_MonitorBtCtr( u4Byte regHPTx=0, regHPRx=0, regLPTx=0, regLPRx=0; u1Byte u1Tmp; + PBTC_BT_LINK_INFO pBtLinkInfo=&pBtCoexist->btLinkInfo; + regHPTxRx = 0x770; regLPTxRx = 0x774; @@ -329,15 +338,66 @@ halbtc8821a2ant_MonitorBtCtr( pCoexSta->lowPriorityTx = regLPTx; pCoexSta->lowPriorityRx = regLPRx; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], High Priority Tx/Rx (reg 0x%x)=0x%x(%d)/0x%x(%d)\n", + if ( (pCoexSta->lowPriorityRx >= 950) && (pCoexSta->lowPriorityRx >= pCoexSta->lowPriorityTx) && (!pCoexSta->bUnderIps) ) + { + pBtLinkInfo->bSlaveRole = TRUE; + } + else + { + pBtLinkInfo->bSlaveRole = FALSE; + } + + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], High Priority Tx/Rx (reg 0x%x)=0x%x(%d)/0x%x(%d)\n", regHPTxRx, regHPTx, regHPTx, regHPRx, regHPRx)); - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], Low Priority Tx/Rx (reg 0x%x)=0x%x(%d)/0x%x(%d)\n", + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Low Priority Tx/Rx (reg 0x%x)=0x%x(%d)/0x%x(%d)\n", regLPTxRx, regLPTx, regLPTx, regLPRx, regLPRx)); // reset counter pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0xc); } +VOID +halbtc8821a2ant_MonitorWiFiCtr( + IN PBTC_COEXIST pBtCoexist + ) +{ + u4Byte u4Tmp; + u2Byte u2Tmp[3]; + s4Byte wifiRssi=0; + BOOLEAN bWifiBusy = FALSE, bWifiUnderBMode = FALSE; + static u1Byte nCCKLockCounter = 0; + + + if (pCoexSta->bUnderIps) + { + pCoexSta->nCRCOK_CCK = 0; + pCoexSta->nCRCOK_11g = 0; + pCoexSta->nCRCOK_11n = 0; + pCoexSta->nCRCOK_11nAgg = 0; + + pCoexSta->nCRCErr_CCK = 0; + pCoexSta->nCRCErr_11g = 0; + pCoexSta->nCRCErr_11n = 0; + pCoexSta->nCRCErr_11nAgg = 0; + } + else + { + pCoexSta->nCRCOK_CCK = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0xf88); + pCoexSta->nCRCOK_11g = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xf94); + pCoexSta->nCRCOK_11n = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xf90); + pCoexSta->nCRCOK_11nAgg= pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xfb8); + + pCoexSta->nCRCErr_CCK = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0xf84); + pCoexSta->nCRCErr_11g = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xf96); + pCoexSta->nCRCErr_11n = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xf92); + pCoexSta->nCRCErr_11nAgg = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xfba); + } + + //reset counter + pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0xf16, 0x1, 0x1); + pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0xf16, 0x1, 0x0); +} + VOID halbtc8821a2ant_QueryBtInfo( IN PBTC_COEXIST pBtCoexist @@ -349,74 +409,190 @@ halbtc8821a2ant_QueryBtInfo( H2C_Parameter[0] |= BIT0; // trigger - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], Query Bt Info, FW write 0x61=0x%x\n", + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], Query Bt Info, FW write 0x61=0x%x\n", H2C_Parameter[0])); pBtCoexist->fBtcFillH2c(pBtCoexist, 0x61, 1, H2C_Parameter); } -u1Byte -halbtc8821a2ant_ActionAlgorithm( + +BOOLEAN +halbtc8821a2ant_IsWifiStatusChanged( IN PBTC_COEXIST pBtCoexist ) { - PBTC_STACK_INFO pStackInfo=&pBtCoexist->stackInfo; - BOOLEAN bBtHsOn=FALSE; - u1Byte algorithm=BT_8821A_2ANT_COEX_ALGO_UNDEFINED; - u1Byte numOfDiffProfile=0; + static BOOLEAN bPreWifiBusy=FALSE, bPreUnder4way=FALSE, bPreBtHsOn=FALSE; + BOOLEAN bWifiBusy=FALSE, bUnder4way=FALSE, bBtHsOn=FALSE; + BOOLEAN bWifiConnected=FALSE; + u1Byte wifiRssiState=BTC_RSSI_STATE_HIGH; + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_4_WAY_PROGRESS, &bUnder4way); + + if(bWifiConnected) + { + if(bWifiBusy != bPreWifiBusy) + { + bPreWifiBusy = bWifiBusy; + return TRUE; + } + if(bUnder4way != bPreUnder4way) + { + bPreUnder4way = bUnder4way; + return TRUE; + } + if(bBtHsOn != bPreBtHsOn) + { + bPreBtHsOn = bBtHsOn; + return TRUE; + } + + + wifiRssiState = halbtc8821a2ant_WifiRssiState(pBtCoexist,3, 2, BT_8821A_2ANT_WIFI_RSSI_COEXSWITCH_THRES, 0); + + if ( (BTC_RSSI_STATE_HIGH ==wifiRssiState ) || (BTC_RSSI_STATE_LOW ==wifiRssiState )) + { + return TRUE; + } + } + + return FALSE; +} + +VOID +halbtc8821a2ant_UpdateBtLinkInfo( + IN PBTC_COEXIST pBtCoexist + ) +{ + PBTC_STACK_INFO pStackInfo=&pBtCoexist->stackInfo; + PBTC_BT_LINK_INFO pBtLinkInfo=&pBtCoexist->btLinkInfo; + BOOLEAN bBtHsOn=FALSE; + +#if(BT_AUTO_REPORT_ONLY_8821A_2ANT == 1) // profile from bt patch + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); + + pBtLinkInfo->bBtLinkExist = pCoexSta->bBtLinkExist; + pBtLinkInfo->bScoExist = pCoexSta->bScoExist; + pBtLinkInfo->bA2dpExist = pCoexSta->bA2dpExist; + pBtLinkInfo->bPanExist = pCoexSta->bPanExist; + pBtLinkInfo->bHidExist = pCoexSta->bHidExist; + + // work around for HS mode. + if(bBtHsOn) + { + pBtLinkInfo->bPanExist = TRUE; + pBtLinkInfo->bBtLinkExist = TRUE; + } +#else // profile from bt stack + pBtLinkInfo->bBtLinkExist = pStackInfo->bBtLinkExist; + pBtLinkInfo->bScoExist = pStackInfo->bScoExist; + pBtLinkInfo->bA2dpExist = pStackInfo->bA2dpExist; + pBtLinkInfo->bPanExist = pStackInfo->bPanExist; + pBtLinkInfo->bHidExist = pStackInfo->bHidExist; + //for win-8 stack HID report error if(!pStackInfo->bHidExist) pStackInfo->bHidExist = pCoexSta->bHidExist; //sync BTInfo with BT firmware and stack // when stack HID report error, here we use the info from bt fw. if(!pStackInfo->bBtLinkExist) - pStackInfo->bBtLinkExist = pCoexSta->bBtLinkExist; + pStackInfo->bBtLinkExist = pCoexSta->bBtLinkExist; +#endif + // check if Sco only + if( pBtLinkInfo->bScoExist && + !pBtLinkInfo->bA2dpExist && + !pBtLinkInfo->bPanExist && + !pBtLinkInfo->bHidExist ) + pBtLinkInfo->bScoOnly = TRUE; + else + pBtLinkInfo->bScoOnly = FALSE; + + // check if A2dp only + if( !pBtLinkInfo->bScoExist && + pBtLinkInfo->bA2dpExist && + !pBtLinkInfo->bPanExist && + !pBtLinkInfo->bHidExist ) + pBtLinkInfo->bA2dpOnly = TRUE; + else + pBtLinkInfo->bA2dpOnly = FALSE; + + // check if Pan only + if( !pBtLinkInfo->bScoExist && + !pBtLinkInfo->bA2dpExist && + pBtLinkInfo->bPanExist && + !pBtLinkInfo->bHidExist ) + pBtLinkInfo->bPanOnly = TRUE; + else + pBtLinkInfo->bPanOnly = FALSE; - if(!pStackInfo->bBtLinkExist) + // check if Hid only + if( !pBtLinkInfo->bScoExist && + !pBtLinkInfo->bA2dpExist && + !pBtLinkInfo->bPanExist && + pBtLinkInfo->bHidExist ) + pBtLinkInfo->bHidOnly = TRUE; + else + pBtLinkInfo->bHidOnly = FALSE; +} + +u1Byte +halbtc8821a2ant_ActionAlgorithm( + IN PBTC_COEXIST pBtCoexist + ) +{ + PBTC_BT_LINK_INFO pBtLinkInfo=&pBtCoexist->btLinkInfo; + BOOLEAN bBtHsOn=FALSE; + u1Byte algorithm=BT_8821A_2ANT_COEX_ALGO_UNDEFINED; + u1Byte numOfDiffProfile=0; + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); + + if(!pBtLinkInfo->bBtLinkExist) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], No profile exists!!!\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], No BT link exists!!!\n")); return algorithm; } - if(pStackInfo->bScoExist) + if(pBtLinkInfo->bScoExist) numOfDiffProfile++; - if(pStackInfo->bHidExist) + if(pBtLinkInfo->bHidExist) numOfDiffProfile++; - if(pStackInfo->bPanExist) + if(pBtLinkInfo->bPanExist) numOfDiffProfile++; - if(pStackInfo->bA2dpExist) + if(pBtLinkInfo->bA2dpExist) numOfDiffProfile++; if(numOfDiffProfile == 1) { - if(pStackInfo->bScoExist) + if(pBtLinkInfo->bScoExist) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO only\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], SCO only\n")); algorithm = BT_8821A_2ANT_COEX_ALGO_SCO; } else { - if(pStackInfo->bHidExist) + if(pBtLinkInfo->bHidExist) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], HID only\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], HID only\n")); algorithm = BT_8821A_2ANT_COEX_ALGO_HID; } - else if(pStackInfo->bA2dpExist) + else if(pBtLinkInfo->bA2dpExist) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], A2DP only\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], A2DP only\n")); algorithm = BT_8821A_2ANT_COEX_ALGO_A2DP; } - else if(pStackInfo->bPanExist) + else if(pBtLinkInfo->bPanExist) { if(bBtHsOn) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], PAN(HS) only\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], PAN(HS) only\n")); algorithm = BT_8821A_2ANT_COEX_ALGO_PANHS; } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], PAN(EDR) only\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], PAN(EDR) only\n")); algorithm = BT_8821A_2ANT_COEX_ALGO_PANEDR; } } @@ -424,73 +600,75 @@ halbtc8821a2ant_ActionAlgorithm( } else if(numOfDiffProfile == 2) { - if(pStackInfo->bScoExist) + if(pBtLinkInfo->bScoExist) { - if(pStackInfo->bHidExist) + if(pBtLinkInfo->bHidExist) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + HID\n")); - algorithm = BT_8821A_2ANT_COEX_ALGO_PANEDR_HID; + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], SCO + HID\n")); + algorithm = BT_8821A_2ANT_COEX_ALGO_SCO; } - else if(pStackInfo->bA2dpExist) + else if(pBtLinkInfo->bA2dpExist) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + A2DP ==> SCO\n")); - algorithm = BT_8821A_2ANT_COEX_ALGO_PANEDR_HID; + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], SCO + A2DP ==> SCO\n")); + algorithm = BT_8821A_2ANT_COEX_ALGO_SCO; } - else if(pStackInfo->bPanExist) + else if(pBtLinkInfo->bPanExist) { if(bBtHsOn) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + PAN(HS)\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], SCO + PAN(HS)\n")); algorithm = BT_8821A_2ANT_COEX_ALGO_SCO; } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + PAN(EDR)\n")); - algorithm = BT_8821A_2ANT_COEX_ALGO_PANEDR_HID; + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], SCO + PAN(EDR)\n")); + algorithm = BT_8821A_2ANT_COEX_ALGO_SCO; } } } else { - if( pStackInfo->bHidExist && - pStackInfo->bA2dpExist ) + if( pBtLinkInfo->bHidExist && + pBtLinkInfo->bA2dpExist ) { +#if 0 if(pStackInfo->numOfHid >= 2) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], HID*2 + A2DP\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], HID*2 + A2DP\n")); algorithm = BT_8821A_2ANT_COEX_ALGO_HID_A2DP_PANEDR; } else +#endif { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], HID + A2DP\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], HID + A2DP\n")); algorithm = BT_8821A_2ANT_COEX_ALGO_HID_A2DP; } } - else if( pStackInfo->bHidExist && - pStackInfo->bPanExist ) + else if( pBtLinkInfo->bHidExist && + pBtLinkInfo->bPanExist ) { if(bBtHsOn) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], HID + PAN(HS)\n")); - algorithm = BT_8821A_2ANT_COEX_ALGO_HID; + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], HID + PAN(HS)\n")); + algorithm = BT_8821A_2ANT_COEX_ALGO_HID; } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], HID + PAN(EDR)\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], HID + PAN(EDR)\n")); algorithm = BT_8821A_2ANT_COEX_ALGO_PANEDR_HID; } } - else if( pStackInfo->bPanExist && - pStackInfo->bA2dpExist ) + else if( pBtLinkInfo->bPanExist && + pBtLinkInfo->bA2dpExist ) { if(bBtHsOn) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], A2DP + PAN(HS)\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], A2DP + PAN(HS)\n")); algorithm = BT_8821A_2ANT_COEX_ALGO_A2DP_PANHS; } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], A2DP + PAN(EDR)\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], A2DP + PAN(EDR)\n")); algorithm = BT_8821A_2ANT_COEX_ALGO_PANEDR_A2DP; } } @@ -498,57 +676,57 @@ halbtc8821a2ant_ActionAlgorithm( } else if(numOfDiffProfile == 3) { - if(pStackInfo->bScoExist) + if(pBtLinkInfo->bScoExist) { - if( pStackInfo->bHidExist && - pStackInfo->bA2dpExist ) + if( pBtLinkInfo->bHidExist && + pBtLinkInfo->bA2dpExist ) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + HID + A2DP ==> HID\n")); - algorithm = BT_8821A_2ANT_COEX_ALGO_PANEDR_HID; + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], SCO + HID + A2DP ==> SCO\n")); + algorithm = BT_8821A_2ANT_COEX_ALGO_SCO; } - else if( pStackInfo->bHidExist && - pStackInfo->bPanExist ) + else if( pBtLinkInfo->bHidExist && + pBtLinkInfo->bPanExist ) { if(bBtHsOn) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + HID + PAN(HS)\n")); - algorithm = BT_8821A_2ANT_COEX_ALGO_PANEDR_HID; + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], SCO + HID + PAN(HS) ==> SCO\n")); + algorithm = BT_8821A_2ANT_COEX_ALGO_SCO; } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + HID + PAN(EDR)\n")); - algorithm = BT_8821A_2ANT_COEX_ALGO_PANEDR_HID; + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], SCO + HID + PAN(EDR) ==> SCO\n")); + algorithm = BT_8821A_2ANT_COEX_ALGO_SCO; } } - else if( pStackInfo->bPanExist && - pStackInfo->bA2dpExist ) + else if( pBtLinkInfo->bPanExist && + pBtLinkInfo->bA2dpExist ) { if(bBtHsOn) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + A2DP + PAN(HS)\n")); - algorithm = BT_8821A_2ANT_COEX_ALGO_PANEDR_HID; + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], SCO + A2DP + PAN(HS)\n")); + algorithm = BT_8821A_2ANT_COEX_ALGO_SCO; } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + A2DP + PAN(EDR) ==> HID\n")); - algorithm = BT_8821A_2ANT_COEX_ALGO_PANEDR_HID; + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], SCO + A2DP + PAN(EDR) ==> HID\n")); + algorithm = BT_8821A_2ANT_COEX_ALGO_SCO; } } } else { - if( pStackInfo->bHidExist && - pStackInfo->bPanExist && - pStackInfo->bA2dpExist ) + if( pBtLinkInfo->bHidExist && + pBtLinkInfo->bPanExist && + pBtLinkInfo->bA2dpExist ) { if(bBtHsOn) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], HID + A2DP + PAN(HS)\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], HID + A2DP + PAN(HS)\n")); algorithm = BT_8821A_2ANT_COEX_ALGO_HID_A2DP; } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], HID + A2DP + PAN(EDR)\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], HID + A2DP + PAN(EDR)\n")); algorithm = BT_8821A_2ANT_COEX_ALGO_HID_A2DP_PANEDR; } } @@ -556,21 +734,21 @@ halbtc8821a2ant_ActionAlgorithm( } else if(numOfDiffProfile >= 3) { - if(pStackInfo->bScoExist) + if(pBtLinkInfo->bScoExist) { - if( pStackInfo->bHidExist && - pStackInfo->bPanExist && - pStackInfo->bA2dpExist ) + if( pBtLinkInfo->bHidExist && + pBtLinkInfo->bPanExist && + pBtLinkInfo->bA2dpExist ) { if(bBtHsOn) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Error!!! SCO + HID + A2DP + PAN(HS)\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Error!!! SCO + HID + A2DP + PAN(HS)\n")); } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + HID + A2DP + PAN(EDR)==>PAN(EDR)+HID\n")); - algorithm = BT_8821A_2ANT_COEX_ALGO_PANEDR_HID; + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], SCO + HID + A2DP + PAN(EDR)==>PAN(EDR)+HID\n")); + algorithm = BT_8821A_2ANT_COEX_ALGO_SCO; } } } @@ -579,50 +757,6 @@ halbtc8821a2ant_ActionAlgorithm( return algorithm; } -BOOLEAN -halbtc8821a2ant_NeedToDecBtPwr( - IN PBTC_COEXIST pBtCoexist - ) -{ - BOOLEAN bRet=FALSE; - BOOLEAN bBtHsOn=FALSE, bWifiConnected=FALSE; - s4Byte btHsRssi=0; - u1Byte btRssiState; - - if(!pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn)) - return FALSE; - if(!pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected)) - return FALSE; - if(!pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_HS_RSSI, &btHsRssi)) - return FALSE; - - btRssiState = halbtc8821a2ant_BtRssiState(2, 35, 0); - - if(bWifiConnected) - { - if(bBtHsOn) - { - if(btHsRssi > 37) - { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], Need to decrease bt power for HS mode!!\n")); - bRet = TRUE; - } - } - else - { - if( (btRssiState == BTC_RSSI_STATE_HIGH) || - (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) - { - - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], Need to decrease bt power for Wifi is connected!!\n")); - bRet = TRUE; - } - } - } - - return bRet; -} - VOID halbtc8821a2ant_SetFwDacSwingLevel( IN PBTC_COEXIST pBtCoexist, @@ -635,8 +769,8 @@ halbtc8821a2ant_SetFwDacSwingLevel( // 0x18/ 0x10/ 0xc/ 0x8/ 0x4/ 0x6 H2C_Parameter[0] = dacSwingLvl; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], Set Dac Swing Level=0x%x\n", dacSwingLvl)); - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], FW write 0x64=0x%x\n", H2C_Parameter[0])); + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], Set Dac Swing Level=0x%x\n", dacSwingLvl)); + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], FW write 0x64=0x%x\n", H2C_Parameter[0])); pBtCoexist->fBtcFillH2c(pBtCoexist, 0x64, 1, H2C_Parameter); } @@ -644,20 +778,15 @@ halbtc8821a2ant_SetFwDacSwingLevel( VOID halbtc8821a2ant_SetFwDecBtPwr( IN PBTC_COEXIST pBtCoexist, - IN BOOLEAN bDecBtPwr + IN u1Byte decBtPwrLvl ) { u1Byte H2C_Parameter[1] ={0}; - H2C_Parameter[0] = 0; - - if(bDecBtPwr) - { - H2C_Parameter[0] |= BIT1; - } + H2C_Parameter[0] = decBtPwrLvl; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], decrease Bt Power : %s, FW write 0x62=0x%x\n", - (bDecBtPwr? "Yes!!":"No!!"), H2C_Parameter[0])); + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], decrease Bt Power level = %d, FW write 0x62=0x%x\n", + decBtPwrLvl, H2C_Parameter[0])); pBtCoexist->fBtcFillH2c(pBtCoexist, 0x62, 1, H2C_Parameter); } @@ -665,118 +794,24 @@ halbtc8821a2ant_SetFwDecBtPwr( VOID halbtc8821a2ant_DecBtPwr( IN PBTC_COEXIST pBtCoexist, - IN BOOLEAN bForceExec, - IN BOOLEAN bDecBtPwr - ) -{ - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], %s Dec BT power = %s\n", - (bForceExec? "force to":""), ((bDecBtPwr)? "ON":"OFF"))); - pCoexDm->bCurDecBtPwr = bDecBtPwr; - - if(!bForceExec) - { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], bPreDecBtPwr=%d, bCurDecBtPwr=%d\n", - pCoexDm->bPreDecBtPwr, pCoexDm->bCurDecBtPwr)); - - if(pCoexDm->bPreDecBtPwr == pCoexDm->bCurDecBtPwr) - return; - } - halbtc8821a2ant_SetFwDecBtPwr(pBtCoexist, pCoexDm->bCurDecBtPwr); - - pCoexDm->bPreDecBtPwr = pCoexDm->bCurDecBtPwr; -} - -VOID -halbtc8821a2ant_SetFwBtLnaConstrain( - IN PBTC_COEXIST pBtCoexist, - IN BOOLEAN bBtLnaConsOn - ) -{ - u1Byte H2C_Parameter[2] ={0}; - - H2C_Parameter[0] = 0x3; // opCode, 0x3=BT_SET_LNA_CONSTRAIN - - if(bBtLnaConsOn) - { - H2C_Parameter[1] |= BIT0; - } - - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], set BT LNA Constrain: %s, FW write 0x69=0x%x\n", - (bBtLnaConsOn? "ON!!":"OFF!!"), - H2C_Parameter[0]<<8|H2C_Parameter[1])); - - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x69, 2, H2C_Parameter); -} - -VOID -halbtc8821a2ant_SetBtLnaConstrain( - IN PBTC_COEXIST pBtCoexist, - IN BOOLEAN bForceExec, - IN BOOLEAN bBtLnaConsOn - ) -{ - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], %s BT Constrain = %s\n", - (bForceExec? "force":""), ((bBtLnaConsOn)? "ON":"OFF"))); - pCoexDm->bCurBtLnaConstrain = bBtLnaConsOn; - - if(!bForceExec) - { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], bPreBtLnaConstrain=%d, bCurBtLnaConstrain=%d\n", - pCoexDm->bPreBtLnaConstrain, pCoexDm->bCurBtLnaConstrain)); - - if(pCoexDm->bPreBtLnaConstrain == pCoexDm->bCurBtLnaConstrain) - return; - } - halbtc8821a2ant_SetFwBtLnaConstrain(pBtCoexist, pCoexDm->bCurBtLnaConstrain); - - pCoexDm->bPreBtLnaConstrain = pCoexDm->bCurBtLnaConstrain; -} - -VOID -halbtc8821a2ant_SetFwBtPsdMode( - IN PBTC_COEXIST pBtCoexist, - IN u1Byte btPsdMode - ) -{ - u1Byte H2C_Parameter[2] ={0}; - - H2C_Parameter[0] = 0x2; // opCode, 0x2=BT_SET_PSD_MODE - - H2C_Parameter[1] = btPsdMode; - - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], set BT PSD mode=0x%x, FW write 0x69=0x%x\n", - H2C_Parameter[1], - H2C_Parameter[0]<<8|H2C_Parameter[1])); - - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x69, 2, H2C_Parameter); -} - - -VOID -halbtc8821a2ant_SetBtPsdMode( - IN PBTC_COEXIST pBtCoexist, - IN BOOLEAN bForceExec, - IN u1Byte btPsdMode + IN BOOLEAN bForceExec, + IN u1Byte decBtPwrLvl ) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], %s BT PSD mode = 0x%x\n", - (bForceExec? "force":""), btPsdMode)); - pCoexDm->bCurBtPsdMode = btPsdMode; + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], %s Dec BT power level = %d\n", + (bForceExec? "force to":""), decBtPwrLvl)); + pCoexDm->curBtDecPwrLvl = decBtPwrLvl; if(!bForceExec) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], bPreBtPsdMode=0x%x, bCurBtPsdMode=0x%x\n", - pCoexDm->bPreBtPsdMode, pCoexDm->bCurBtPsdMode)); - - if(pCoexDm->bPreBtPsdMode == pCoexDm->bCurBtPsdMode) + if(pCoexDm->preBtDecPwrLvl == pCoexDm->curBtDecPwrLvl) return; } - halbtc8821a2ant_SetFwBtPsdMode(pBtCoexist, pCoexDm->bCurBtPsdMode); + halbtc8821a2ant_SetFwDecBtPwr(pBtCoexist, pCoexDm->curBtDecPwrLvl); - pCoexDm->bPreBtPsdMode = pCoexDm->bCurBtPsdMode; + pCoexDm->preBtDecPwrLvl = pCoexDm->curBtDecPwrLvl; } - VOID halbtc8821a2ant_SetBtAutoReport( IN PBTC_COEXIST pBtCoexist, @@ -792,7 +827,7 @@ halbtc8821a2ant_SetBtAutoReport( H2C_Parameter[0] |= BIT0; } - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], BT FW auto report : %s, FW write 0x68=0x%x\n", + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], BT FW auto report : %s, FW write 0x68=0x%x\n", (bEnableAutoReport? "Enabled!!":"Disabled!!"), H2C_Parameter[0])); pBtCoexist->fBtcFillH2c(pBtCoexist, 0x68, 1, H2C_Parameter); @@ -805,15 +840,12 @@ halbtc8821a2ant_BtAutoReport( IN BOOLEAN bEnableAutoReport ) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], %s BT Auto report = %s\n", + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], %s BT Auto report = %s\n", (bForceExec? "force to":""), ((bEnableAutoReport)? "Enabled":"Disabled"))); pCoexDm->bCurBtAutoReport = bEnableAutoReport; if(!bForceExec) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], bPreBtAutoReport=%d, bCurBtAutoReport=%d\n", - pCoexDm->bPreBtAutoReport, pCoexDm->bCurBtAutoReport)); - if(pCoexDm->bPreBtAutoReport == pCoexDm->bCurBtAutoReport) return; } @@ -829,15 +861,12 @@ halbtc8821a2ant_FwDacSwingLvl( IN u1Byte fwDacSwingLvl ) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], %s set FW Dac Swing level = %d\n", + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], %s set FW Dac Swing level = %d\n", (bForceExec? "force to":""), fwDacSwingLvl)); pCoexDm->curFwDacSwingLvl = fwDacSwingLvl; if(!bForceExec) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], preFwDacSwingLvl=%d, curFwDacSwingLvl=%d\n", - pCoexDm->preFwDacSwingLvl, pCoexDm->curFwDacSwingLvl)); - if(pCoexDm->preFwDacSwingLvl == pCoexDm->curFwDacSwingLvl) return; } @@ -856,7 +885,7 @@ halbtc8821a2ant_SetSwRfRxLpfCorner( if(bRxRfShrinkOn) { //Shrink RF Rx LPF corner - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Shrink RF Rx LPF corner!!\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Shrink RF Rx LPF corner!!\n")); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1e, 0xfffff, 0xffffc); } else @@ -865,7 +894,7 @@ halbtc8821a2ant_SetSwRfRxLpfCorner( // After initialized, we can use pCoexDm->btRf0x1eBackup if(pBtCoexist->bInitilized) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Resume RF Rx LPF corner!!\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Resume RF Rx LPF corner!!\n")); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1e, 0xfffff, pCoexDm->btRf0x1eBackup); } } @@ -878,15 +907,12 @@ halbtc8821a2ant_RfShrink( IN BOOLEAN bRxRfShrinkOn ) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW, ("[BTCoex], %s turn Rx RF Shrink = %s\n", + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], %s turn Rx RF Shrink = %s\n", (bForceExec? "force to":""), ((bRxRfShrinkOn)? "ON":"OFF"))); pCoexDm->bCurRfRxLpfShrink = bRxRfShrinkOn; if(!bForceExec) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_DETAIL, ("[BTCoex], bPreRfRxLpfShrink=%d, bCurRfRxLpfShrink=%d\n", - pCoexDm->bPreRfRxLpfShrink, pCoexDm->bCurRfRxLpfShrink)); - if(pCoexDm->bPreRfRxLpfShrink == pCoexDm->bCurRfRxLpfShrink) return; } @@ -914,8 +940,8 @@ halbtc8821a2ant_SetSwPenaltyTxRateAdaptive( H2C_Parameter[5] = 0xf9; //MCS5 or OFDM36 } - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], set WiFi Low-Penalty Retry: %s", - (bLowPenaltyRa? "ON!!":"OFF!!") )); + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], set WiFi Low-Penalty Retry: %s", + (bLowPenaltyRa? "ON!!":"OFF!!")) ); pBtCoexist->fBtcFillH2c(pBtCoexist, 0x69, 6, H2C_Parameter); } @@ -928,15 +954,12 @@ halbtc8821a2ant_LowPenaltyRa( ) { //return; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW, ("[BTCoex], %s turn LowPenaltyRA = %s\n", + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], %s turn LowPenaltyRA = %s\n", (bForceExec? "force to":""), ((bLowPenaltyRa)? "ON":"OFF"))); pCoexDm->bCurLowPenaltyRa = bLowPenaltyRa; if(!bForceExec) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_DETAIL, ("[BTCoex], bPreLowPenaltyRa=%d, bCurLowPenaltyRa=%d\n", - pCoexDm->bPreLowPenaltyRa, pCoexDm->bCurLowPenaltyRa)); - if(pCoexDm->bPreLowPenaltyRa == pCoexDm->bCurLowPenaltyRa) return; } @@ -953,7 +976,7 @@ halbtc8821a2ant_SetDacSwingReg( { u1Byte val=(u1Byte)level; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Write SwDacSwing = 0x%x\n", level)); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Write SwDacSwing = 0x%x\n", level)); pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0xc5b, 0x3e, val); } @@ -983,17 +1006,13 @@ halbtc8821a2ant_DacSwing( IN u4Byte dacSwingLvl ) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW, ("[BTCoex], %s turn DacSwing=%s, dacSwingLvl=0x%x\n", + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], %s turn DacSwing=%s, dacSwingLvl=0x%x\n", (bForceExec? "force to":""), ((bDacSwingOn)? "ON":"OFF"), dacSwingLvl)); pCoexDm->bCurDacSwingOn = bDacSwingOn; pCoexDm->curDacSwingLvl = dacSwingLvl; if(!bForceExec) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_DETAIL, ("[BTCoex], bPreDacSwingOn=%d, preDacSwingLvl=0x%x, bCurDacSwingOn=%d, curDacSwingLvl=0x%x\n", - pCoexDm->bPreDacSwingOn, pCoexDm->preDacSwingLvl, - pCoexDm->bCurDacSwingOn, pCoexDm->curDacSwingLvl)); - if( (pCoexDm->bPreDacSwingOn == pCoexDm->bCurDacSwingOn) && (pCoexDm->preDacSwingLvl == pCoexDm->curDacSwingLvl) ) return; @@ -1013,12 +1032,12 @@ halbtc8821a2ant_SetAdcBackOff( { if(bAdcBackOff) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], BB BackOff Level On!\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BB BackOff Level On!\n")); pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x8db, 0x60, 0x3); } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], BB BackOff Level Off!\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BB BackOff Level Off!\n")); pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x8db, 0x60, 0x1); } } @@ -1030,15 +1049,12 @@ halbtc8821a2ant_AdcBackOff( IN BOOLEAN bAdcBackOff ) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW, ("[BTCoex], %s turn AdcBackOff = %s\n", + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], %s turn AdcBackOff = %s\n", (bForceExec? "force to":""), ((bAdcBackOff)? "ON":"OFF"))); pCoexDm->bCurAdcBackOff = bAdcBackOff; if(!bForceExec) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_DETAIL, ("[BTCoex], bPreAdcBackOff=%d, bCurAdcBackOff=%d\n", - pCoexDm->bPreAdcBackOff, pCoexDm->bCurAdcBackOff)); - if(pCoexDm->bPreAdcBackOff == pCoexDm->bCurAdcBackOff) return; } @@ -1055,23 +1071,67 @@ halbtc8821a2ant_SetAgcTable( { u1Byte rssiAdjustVal=0; + //=================BB AGC Gain Table + if(bAgcTableEn) + { + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BB Agc Table On!\n")); + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78, 0x6e1A0001); + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78, 0x6d1B0001); + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78, 0x6c1C0001); + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78, 0x6b1D0001); + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78, 0x6a1E0001); + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78, 0x691F0001); + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78, 0x68200001); + } + else + { + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BB Agc Table Off!\n")); + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78, 0xaa1A0001); + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78, 0xa91B0001); + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78, 0xa81C0001); + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78, 0xa71D0001); + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78, 0xa61E0001); + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78, 0xa51F0001); + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78, 0xa4200001); + } + + + //=================RF Gain pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0xef, 0xfffff, 0x02000); if(bAgcTableEn) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Agc Table On!\n")); - pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x3b, 0xfffff, 0x28F4B); - pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x3b, 0xfffff, 0x10AB2); - rssiAdjustVal = 8; + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Agc Table On!\n")); + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x3b, 0xfffff, 0x38fff); + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x3b, 0xfffff, 0x38ffe); } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Agc Table Off!\n")); - pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x3b, 0xfffff, 0x2884B); - pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x3b, 0xfffff, 0x104B2); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Agc Table Off!\n")); + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x3b, 0xfffff, 0x380c3); + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x3b, 0xfffff, 0x28ce6); } pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0xef, 0xfffff, 0x0); + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0xed, 0xfffff, 0x1); + if(bAgcTableEn) + { + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Agc Table On!\n")); + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x40, 0xfffff, 0x38fff); + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x40, 0xfffff, 0x38ffe); + } + else + { + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Agc Table Off!\n")); + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x40, 0xfffff, 0x380c3); + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x40, 0xfffff, 0x28ce6); + } + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0xed, 0xfffff, 0x0); + // set rssiAdjustVal for wifi module. + if(bAgcTableEn) + { + rssiAdjustVal = 8; + } pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_U1_RSSI_ADJ_VAL_FOR_AGC_TABLE_ON, &rssiAdjustVal); } @@ -1082,15 +1142,12 @@ halbtc8821a2ant_AgcTable( IN BOOLEAN bAgcTableEn ) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW, ("[BTCoex], %s %s Agc Table\n", + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], %s %s Agc Table\n", (bForceExec? "force to":""), ((bAgcTableEn)? "Enable":"Disable"))); pCoexDm->bCurAgcTableEn = bAgcTableEn; if(!bForceExec) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_DETAIL, ("[BTCoex], bPreAgcTableEn=%d, bCurAgcTableEn=%d\n", - pCoexDm->bPreAgcTableEn, pCoexDm->bCurAgcTableEn)); - if(pCoexDm->bPreAgcTableEn == pCoexDm->bCurAgcTableEn) return; } @@ -1108,16 +1165,16 @@ halbtc8821a2ant_SetCoexTable( IN u1Byte val0x6cc ) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], set coex table, set 0x6c0=0x%x\n", val0x6c0)); + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], set coex table, set 0x6c0=0x%x\n", val0x6c0)); pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c0, val0x6c0); - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], set coex table, set 0x6c4=0x%x\n", val0x6c4)); + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], set coex table, set 0x6c4=0x%x\n", val0x6c4)); pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c4, val0x6c4); - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], set coex table, set 0x6c8=0x%x\n", val0x6c8)); + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], set coex table, set 0x6c8=0x%x\n", val0x6c8)); pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c8, val0x6c8); - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], set coex table, set 0x6cc=0x%x\n", val0x6cc)); + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], set coex table, set 0x6cc=0x%x\n", val0x6cc)); pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cc, val0x6cc); } @@ -1131,7 +1188,7 @@ halbtc8821a2ant_CoexTable( IN u1Byte val0x6cc ) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW, ("[BTCoex], %s write Coex Table 0x6c0=0x%x, 0x6c4=0x%x, 0x6c8=0x%x, 0x6cc=0x%x\n", + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], %s write Coex Table 0x6c0=0x%x, 0x6c4=0x%x, 0x6c8=0x%x, 0x6cc=0x%x\n", (bForceExec? "force to":""), val0x6c0, val0x6c4, val0x6c8, val0x6cc)); pCoexDm->curVal0x6c0 = val0x6c0; pCoexDm->curVal0x6c4 = val0x6c4; @@ -1139,12 +1196,7 @@ halbtc8821a2ant_CoexTable( pCoexDm->curVal0x6cc = val0x6cc; if(!bForceExec) - { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_DETAIL, ("[BTCoex], preVal0x6c0=0x%x, preVal0x6c4=0x%x, preVal0x6c8=0x%x, preVal0x6cc=0x%x !!\n", - pCoexDm->preVal0x6c0, pCoexDm->preVal0x6c4, pCoexDm->preVal0x6c8, pCoexDm->preVal0x6cc)); - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_DETAIL, ("[BTCoex], curVal0x6c0=0x%x, curVal0x6c4=0x%x, curVal0x6c8=0x%x, curVal0x6cc=0x%x !!\n", - pCoexDm->curVal0x6c0, pCoexDm->curVal0x6c4, pCoexDm->curVal0x6c8, pCoexDm->curVal0x6cc)); - + { if( (pCoexDm->preVal0x6c0 == pCoexDm->curVal0x6c0) && (pCoexDm->preVal0x6c4 == pCoexDm->curVal0x6c4) && (pCoexDm->preVal0x6c8 == pCoexDm->curVal0x6c8) && @@ -1159,6 +1211,76 @@ halbtc8821a2ant_CoexTable( pCoexDm->preVal0x6cc = pCoexDm->curVal0x6cc; } +VOID +halbtc8821a2ant_CoexTableWithType( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bForceExec, + IN u1Byte type + ) +{ + pCoexSta->nCoexTableType = type; + + switch(type) + { + case 0: + halbtc8821a2ant_CoexTable(pBtCoexist, bForceExec, 0x55555555, 0x55555555, 0xffffff, 0x3); + break; + case 1: + halbtc8821a2ant_CoexTable(pBtCoexist, bForceExec, 0x55555555, 0x5afa5afa, 0xffffff, 0x3); + break; + case 2: + halbtc8821a2ant_CoexTable(pBtCoexist, bForceExec, 0x5ada5ada, 0x5ada5ada, 0xffffff, 0x3); + break; + case 3: + halbtc8821a2ant_CoexTable(pBtCoexist, bForceExec, 0xaaaaaaaa, 0xaaaaaaaa, 0xffffff, 0x3); + break; + case 4: + halbtc8821a2ant_CoexTable(pBtCoexist, bForceExec, 0xffffffff, 0xffffffff, 0xffffff, 0x3); + break; + case 5: + halbtc8821a2ant_CoexTable(pBtCoexist, bForceExec, 0x5fff5fff, 0x5fff5fff, 0xffffff, 0x3); + break; + case 6: + halbtc8821a2ant_CoexTable(pBtCoexist, bForceExec, 0x55ff55ff, 0x5a5a5a5a, 0xffffff, 0x3); + break; + case 7: + halbtc8821a2ant_CoexTable(pBtCoexist, bForceExec, 0x55dd55dd, 0x5ada5ada, 0xffffff, 0x3); + break; + case 8: + halbtc8821a2ant_CoexTable(pBtCoexist, bForceExec, 0x55dd55dd, 0x5ada5ada, 0xffffff, 0x3); + break; + case 9: + halbtc8821a2ant_CoexTable(pBtCoexist, bForceExec, 0x55dd55dd, 0x5ada5ada, 0xffffff, 0x3); + break; + case 10: + halbtc8821a2ant_CoexTable(pBtCoexist, bForceExec, 0x55dd55dd, 0x5ada5ada, 0xffffff, 0x3); + break; + case 11: + halbtc8821a2ant_CoexTable(pBtCoexist, bForceExec, 0x55dd55dd, 0x5ada5ada, 0xffffff, 0x3); + break; + case 12: + halbtc8821a2ant_CoexTable(pBtCoexist, bForceExec, 0x55dd55dd, 0x5ada5ada, 0xffffff, 0x3); + break; + case 13: + halbtc8821a2ant_CoexTable(pBtCoexist, bForceExec, 0x5fff5fff, 0xaaaaaaaa, 0xffffff, 0x3); + break; + case 14: + halbtc8821a2ant_CoexTable(pBtCoexist, bForceExec, 0x5fff5fff, 0x5ada5ada, 0xffffff, 0x3); + break; + case 15: + halbtc8821a2ant_CoexTable(pBtCoexist, bForceExec, 0x55dd55dd, 0xaaaaaaaa, 0xffffff, 0x3); + break; + case 16: + halbtc8821a2ant_CoexTable(pBtCoexist, bForceExec, 0x5fdf5fdf, 0x5fdb5fdb, 0xffffff, 0x3); + break; + case 17: + halbtc8821a2ant_CoexTable(pBtCoexist, bForceExec, 0xfafafafa, 0xfafafafa, 0xffffff, 0x3); + break; + default: + break; + } +} + VOID halbtc8821a2ant_SetFwIgnoreWlanAct( IN PBTC_COEXIST pBtCoexist, @@ -1172,28 +1294,68 @@ halbtc8821a2ant_SetFwIgnoreWlanAct( H2C_Parameter[0] |= BIT0; // function enable } - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], set FW for BT Ignore Wlan_Act, FW write 0x63=0x%x\n", + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], set FW for BT Ignore Wlan_Act, FW write 0x63=0x%x\n", H2C_Parameter[0])); pBtCoexist->fBtcFillH2c(pBtCoexist, 0x63, 1, H2C_Parameter); } VOID -halbtc8821a2ant_IgnoreWlanAct( +halbtc8821a2ant_SetLpsRpwm( + IN PBTC_COEXIST pBtCoexist, + IN u1Byte lpsVal, + IN u1Byte rpwmVal + ) +{ + u1Byte lps=lpsVal; + u1Byte rpwm=rpwmVal; + + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_U1_LPS_VAL, &lps); + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_U1_RPWM_VAL, &rpwm); +} + +VOID +halbtc8821a2ant_LpsRpwm( IN PBTC_COEXIST pBtCoexist, IN BOOLEAN bForceExec, - IN BOOLEAN bEnable + IN u1Byte lpsVal, + IN u1Byte rpwmVal ) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], %s turn Ignore WlanAct %s\n", - (bForceExec? "force to":""), (bEnable? "ON":"OFF"))); - pCoexDm->bCurIgnoreWlanAct = bEnable; + BOOLEAN bForceExecPwrCmd=FALSE; + + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], %s set lps/rpwm=0x%x/0x%x \n", + (bForceExec? "force to":""), lpsVal, rpwmVal)); + pCoexDm->curLps = lpsVal; + pCoexDm->curRpwm = rpwmVal; + + if(!bForceExec) + { + if( (pCoexDm->preLps == pCoexDm->curLps) && + (pCoexDm->preRpwm == pCoexDm->curRpwm) ) + { + return; + } + } + halbtc8821a2ant_SetLpsRpwm(pBtCoexist, lpsVal, rpwmVal); + + pCoexDm->preLps = pCoexDm->curLps; + pCoexDm->preRpwm = pCoexDm->curRpwm; +} + +VOID +halbtc8821a2ant_IgnoreWlanAct( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bForceExec, + IN BOOLEAN bEnable + ) +{ + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], %s turn Ignore WlanAct %s\n", + (bForceExec? "force to":""), (bEnable? "ON":"OFF"))); + pCoexDm->bCurIgnoreWlanAct = bEnable; if(!bForceExec) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], bPreIgnoreWlanAct = %d, bCurIgnoreWlanAct = %d!!\n", - pCoexDm->bPreIgnoreWlanAct, pCoexDm->bCurIgnoreWlanAct)); - if(pCoexDm->bPreIgnoreWlanAct == pCoexDm->bCurIgnoreWlanAct) return; } @@ -1213,7 +1375,7 @@ halbtc8821a2ant_SetFwPstdma( ) { u1Byte H2C_Parameter[5] ={0}; - + H2C_Parameter[0] = byte1; H2C_Parameter[1] = byte2; H2C_Parameter[2] = byte3; @@ -1226,7 +1388,7 @@ halbtc8821a2ant_SetFwPstdma( pCoexDm->psTdmaPara[3] = byte4; pCoexDm->psTdmaPara[4] = byte5; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], FW write 0x60(5bytes)=0x%x%08x\n", + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], FW write 0x60(5bytes)=0x%x%08x\n", H2C_Parameter[0], H2C_Parameter[1]<<24|H2C_Parameter[2]<<16|H2C_Parameter[3]<<8|H2C_Parameter[4])); @@ -1242,6 +1404,7 @@ halbtc8821a2ant_SwMechanism1( IN BOOLEAN bBTLNAConstrain ) { + /* u4Byte wifiBw; pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); @@ -1251,12 +1414,10 @@ halbtc8821a2ant_SwMechanism1( if (bShrinkRxLPF) bShrinkRxLPF = FALSE; } - - halbtc8821a2ant_RfShrink(pBtCoexist, NORMAL_EXEC, bShrinkRxLPF); + */ + + //halbtc8821a2ant_RfShrink(pBtCoexist, NORMAL_EXEC, bShrinkRxLPF); halbtc8821a2ant_LowPenaltyRa(pBtCoexist, NORMAL_EXEC, bLowPenaltyRA); - - //no limited DIG - //halbtc8821a2ant_SetBtLnaConstrain(pBtCoexist, NORMAL_EXEC, bBTLNAConstrain); } VOID @@ -1269,7 +1430,7 @@ halbtc8821a2ant_SwMechanism2( ) { //halbtc8821a2ant_AgcTable(pBtCoexist, NORMAL_EXEC, bAGCTableShift); - halbtc8821a2ant_AdcBackOff(pBtCoexist, NORMAL_EXEC, bADCBackOff); + //halbtc8821a2ant_AdcBackOff(pBtCoexist, NORMAL_EXEC, bADCBackOff); halbtc8821a2ant_DacSwing(pBtCoexist, NORMAL_EXEC, bSWDACSwing, dacSwingLvl); } @@ -1334,19 +1495,24 @@ halbtc8821a2ant_PsTdma( { BOOLEAN bTurnOnByCnt=FALSE; u1Byte psTdmaTypeByCnt=0; + u1Byte wifiRssiState1, btRssiState; + + + wifiRssiState1 = halbtc8821a2ant_WifiRssiState(pBtCoexist, 1, 2, BT_8821A_2ANT_WIFI_RSSI_COEXSWITCH_THRES, 0); + btRssiState = halbtc8821a2ant_BtRssiState(2, BT_8821A_2ANT_BT_RSSI_COEXSWITCH_THRES, 0); - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], %s turn %s PS TDMA, type=%d\n", + if (!(BTC_RSSI_HIGH(wifiRssiState1) && BTC_RSSI_HIGH(btRssiState)) && bTurnOn) + { + type = type +100; //for WiFi RSSI low or BT RSSI low + } + + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], %s turn %s PS TDMA, type=%d\n", (bForceExec? "force to":""), (bTurnOn? "ON":"OFF"), type)); pCoexDm->bCurPsTdmaOn = bTurnOn; pCoexDm->curPsTdma = type; if(!bForceExec) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], bPrePsTdmaOn = %d, bCurPsTdmaOn = %d!!\n", - pCoexDm->bPrePsTdmaOn, pCoexDm->bCurPsTdmaOn)); - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], prePsTdma = %d, curPsTdma = %d!!\n", - pCoexDm->prePsTdma, pCoexDm->curPsTdma)); - if( (pCoexDm->bPrePsTdmaOn == pCoexDm->bCurPsTdmaOn) && (pCoexDm->prePsTdma == pCoexDm->curPsTdma) ) return; @@ -1357,10 +1523,12 @@ halbtc8821a2ant_PsTdma( { case 1: default: - halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1a, 0x1a, 0xe1, 0x90); + //halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1a, 0x1a, 0xe1, 0x90); + halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x3c, 0x03, 0xf1, 0x90); break; case 2: - halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x12, 0x12, 0xe1, 0x90); + //halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x12, 0x12, 0xe1, 0x90); + halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x2d, 0x03, 0xf1, 0x90); break; case 3: halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1c, 0x3, 0xf1, 0x90); @@ -1369,10 +1537,12 @@ halbtc8821a2ant_PsTdma( halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x10, 0x03, 0xf1, 0x90); break; case 5: - halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1a, 0x1a, 0x60, 0x90); + //halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1a, 0x1a, 0x60, 0x90); + halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x3c, 0x3, 0x70, 0x90); break; case 6: - halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x12, 0x12, 0x60, 0x90); + //halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x12, 0x12, 0x60, 0x90); + halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x2d, 0x3, 0x70, 0x90); break; case 7: halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1c, 0x3, 0x70, 0x90); @@ -1381,28 +1551,36 @@ halbtc8821a2ant_PsTdma( halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xa3, 0x10, 0x3, 0x70, 0x90); break; case 9: - halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1a, 0x1a, 0xe1, 0x90); + //halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1a, 0x1a, 0xe1, 0x90); + halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x3c, 0x03, 0xf1, 0x90); break; case 10: - halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x12, 0x12, 0xe1, 0x90); + //halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x12, 0x12, 0xe1, 0x90); + halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x2d, 0x03, 0xf1, 0x90); break; case 11: - halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0xa, 0xa, 0xe1, 0x90); + //halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0xa, 0xa, 0xe1, 0x90); + halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1c, 0x3, 0xf1, 0x90); break; case 12: - halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x5, 0x5, 0xe1, 0x90); + //halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x5, 0x5, 0xe1, 0x90); + halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x10, 0x3, 0xf1, 0x90); break; case 13: - halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1a, 0x1a, 0x60, 0x90); + //halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1a, 0x1a, 0x60, 0x90); + halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x3c, 0x3, 0x70, 0x90); break; case 14: - halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x12, 0x12, 0x60, 0x90); + //halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x12, 0x12, 0x60, 0x90); + halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x2d, 0x3, 0x70, 0x90); break; case 15: - halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0xa, 0xa, 0x60, 0x90); + //halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0xa, 0xa, 0x60, 0x90); + halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1c, 0x3, 0x70, 0x90); break; case 16: - halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x5, 0x5, 0x60, 0x90); + //halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x5, 0x5, 0x60, 0x90); + halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x10, 0x3, 0x70, 0x90); break; case 17: halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xa3, 0x2f, 0x2f, 0x60, 0x90); @@ -1416,11 +1594,59 @@ halbtc8821a2ant_PsTdma( case 20: halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x25, 0x25, 0x60, 0x90); break; - case 21: + case 21: halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x15, 0x03, 0x70, 0x90); + break; + case 23: + halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1c, 0x03, 0xf1, 0x10); + break; + case 24: + case 124: + halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xd3, 0x3c, 0x03, 0x70, 0x50); break; case 71: - halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1a, 0x1a, 0xe1, 0x90); + //halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1a, 0x1a, 0xe1, 0x90); + + halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x3c, 0x03, 0xf1, 0x90); + break; + case 101: + case 105: + case 171: + halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xd3, 0x3a, 0x03, 0x70, 0x50); + break; + case 102: + case 106: + case 110: + case 114: + halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xd3, 0x2d, 0x03, 0x70, 0x50); + break; + case 103: + case 107: + case 111: + case 115: + halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xd3, 0x1c, 0x03, 0x70, 0x50); + break; + case 104: + case 108: + case 112: + case 116: + halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xd3, 0x10, 0x03, 0x70, 0x50); + break; + case 109: + halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x3c, 0x03, 0xf1, 0x90); + break; + case 113: + halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x3c, 0x03, 0x70, 0x90); + break; + case 121: + halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x15, 0x03, 0x70, 0x90); + break; + case 22: + case 122: + halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x35, 0x03, 0x71, 0x11); + break; + case 123: + halbtc8821a2ant_SetFwPstdma(pBtCoexist, 0xd3, 0x1c, 0x03, 0x70, 0x50); break; } } @@ -1446,22 +1672,100 @@ halbtc8821a2ant_PsTdma( pCoexDm->prePsTdma = pCoexDm->curPsTdma; } +VOID +halbtc8821a2ant_PsTdmaCheckForPowerSaveState( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bNewPsState + ) +{ + u1Byte lpsMode=0x0; + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_LPS_MODE, &lpsMode); + + if(lpsMode) // already under LPS state + { + if(bNewPsState) + { + // keep state under LPS, do nothing. + } + else + { + // will leave LPS state, turn off psTdma first + halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); + } + } + else // NO PS state + { + if(bNewPsState) + { + // will enter LPS state, turn off psTdma first + halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); + } + else + { + // keep state under NO PS state, do nothing. + } + } +} + +VOID +halbtc8821a2ant_PowerSaveState( + IN PBTC_COEXIST pBtCoexist, + IN u1Byte psType, + IN u1Byte lpsVal, + IN u1Byte rpwmVal + ) +{ + BOOLEAN bLowPwrDisable=FALSE; + + switch(psType) + { + case BTC_PS_WIFI_NATIVE: + // recover to original 32k low power setting + bLowPwrDisable = FALSE; + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_NORMAL_LPS, NULL); + pCoexSta->bForceLpsOn = FALSE; + break; + case BTC_PS_LPS_ON: + halbtc8821a2ant_PsTdmaCheckForPowerSaveState(pBtCoexist, TRUE); + halbtc8821a2ant_LpsRpwm(pBtCoexist, NORMAL_EXEC, lpsVal, rpwmVal); + // when coex force to enter LPS, do not enter 32k low power. + bLowPwrDisable = TRUE; + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); + // power save must executed before psTdma. + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_ENTER_LPS, NULL); + pCoexSta->bForceLpsOn = TRUE; + break; + case BTC_PS_LPS_OFF: + halbtc8821a2ant_PsTdmaCheckForPowerSaveState(pBtCoexist, FALSE); + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_LEAVE_LPS, NULL); + pCoexSta->bForceLpsOn = FALSE; + break; + default: + break; + } +} + + VOID halbtc8821a2ant_CoexAllOff( IN PBTC_COEXIST pBtCoexist ) { // fw all off + halbtc8821a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); halbtc8821a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); - halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); // sw all off halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); // hw all off - halbtc8821a2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55555555, 0x55555555, 0xffff, 0x3); + //pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); } VOID @@ -1470,6 +1774,8 @@ halbtc8821a2ant_CoexUnder5G( ) { halbtc8821a2ant_CoexAllOff(pBtCoexist); + + halbtc8821a2ant_IgnoreWlanAct(pBtCoexist, NORMAL_EXEC, TRUE); } VOID @@ -1478,169 +1784,239 @@ halbtc8821a2ant_InitCoexDm( ) { // force to reset coex mechanism - halbtc8821a2ant_CoexTable(pBtCoexist, FORCE_EXEC, 0x55555555, 0x55555555, 0xffff, 0x3); - + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); + + halbtc8821a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); halbtc8821a2ant_PsTdma(pBtCoexist, FORCE_EXEC, FALSE, 1); halbtc8821a2ant_FwDacSwingLvl(pBtCoexist, FORCE_EXEC, 6); - halbtc8821a2ant_DecBtPwr(pBtCoexist, FORCE_EXEC, FALSE); + halbtc8821a2ant_DecBtPwr(pBtCoexist, FORCE_EXEC, 0); halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); } VOID -halbtc8821a2ant_BtInquiryPage( +halbtc8821a2ant_ActionBtInquiry( IN PBTC_COEXIST pBtCoexist ) { + u1Byte wifiRssiState, wifiRssiState1, btRssiState; + BOOLEAN bWifiConnected=FALSE; BOOLEAN bLowPwrDisable=TRUE; + BOOLEAN bScan=FALSE, bLink=FALSE, bRoam=FALSE; + + + wifiRssiState = halbtc8821a2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); + wifiRssiState1 = halbtc8821a2ant_WifiRssiState(pBtCoexist, 1, 2, BT_8821A_2ANT_WIFI_RSSI_COEXSWITCH_THRES, 0); + btRssiState = halbtc8821a2ant_BtRssiState(2, BT_8821A_2ANT_BT_RSSI_COEXSWITCH_THRES, 0); pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_LINK, &bLink); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_ROAM, &bRoam); + + + halbtc8821a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + + if(bScan || bLink || bRoam) + { + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Wifi link process + BT Inq/Page!!\n")); + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 15); + halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 22); + } + else if(bWifiConnected) + { + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Wifi connected + BT Inq/Page!!\n")); + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 15); + halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 22); + } + else + { + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Wifi no-link + BT Inq/Page!!\n")); + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); + halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); + } + + halbtc8821a2ant_FwDacSwingLvl(pBtCoexist, FORCE_EXEC, 6); + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); - halbtc8821a2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55ff55ff, 0x5afa5afa, 0xffff, 0x3); - halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 3); + halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + } -BOOLEAN -halbtc8821a2ant_IsCommonAction( + + +VOID +halbtc8821a2ant_ActionWiFiLinkProcess( IN PBTC_COEXIST pBtCoexist ) { - BOOLEAN bCommon=FALSE, bWifiConnected=FALSE, bWifiBusy=FALSE; - BOOLEAN bLowPwrDisable=FALSE; + u1Byte u1Tmpa, u1Tmpb; + + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 15); + halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 22); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); + halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); - halbtc8821a2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55ff55ff, 0x5afa5afa, 0xffff, 0x3); - if(!bWifiConnected && - BT_8821A_2ANT_BT_STATUS_IDLE == pCoexDm->btStatus) - { - bLowPwrDisable = FALSE; - pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi IPS + BT IPS!!\n")); + u1Tmpa = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x765); + u1Tmpb = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x76e); - - halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); - halbtc8821a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); - halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); - - halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + RT_TRACE(COMP_COEX, DBG_LOUD, ("############# [BTCoex], 0x765=0x%x, 0x76e=0x%x\n", u1Tmpa, u1Tmpb)); +} - bCommon = TRUE; - } - else if(bWifiConnected && - (BT_8821A_2ANT_BT_STATUS_IDLE == pCoexDm->btStatus) ) - { - bLowPwrDisable = FALSE; - pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); +BOOLEAN +halbtc8821a2ant_ActionWifiIdleProcess( + IN PBTC_COEXIST pBtCoexist + ) +{ + u1Byte wifiRssiState, wifiRssiState1, btRssiState; + u4Byte wifiBw; + u1Byte apNum=0; - if(bWifiBusy) - { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi Busy + BT IPS!!\n")); - halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); - } - else - { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi LPS + BT IPS!!\n")); - halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); - } - - halbtc8821a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); - halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + wifiRssiState = halbtc8821a2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); + //wifiRssiState1 = halbtc8821a2ant_WifiRssiState(pBtCoexist, 1, 2, BT_8821A_2ANT_WIFI_RSSI_COEXSWITCH_THRES, 0); + wifiRssiState1 = halbtc8821a2ant_WifiRssiState(pBtCoexist, 1, 2, BT_8821A_2ANT_WIFI_RSSI_COEXSWITCH_THRES-20, 0); + btRssiState = halbtc8821a2ant_BtRssiState(2, BT_8821A_2ANT_BT_RSSI_COEXSWITCH_THRES, 0); - halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_AP_NUM, &apNum); - bCommon = TRUE; - } - else if(!bWifiConnected && - (BT_8821A_2ANT_BT_STATUS_CONNECTED_IDLE == pCoexDm->btStatus) ) + // define the office environment + if(BTC_RSSI_HIGH(wifiRssiState1) && + (pCoexSta->bHidExist == TRUE) && (pCoexSta->bA2dpExist == TRUE)) { - bLowPwrDisable = TRUE; - pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); - - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi IPS + BT LPS!!\n")); - halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); - halbtc8821a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); - halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Wifi idle process for BT HID+A2DP exist!!\n")); + + halbtc8821a2ant_DacSwing(pBtCoexist, NORMAL_EXEC, TRUE, 0x6); + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); + // sw all off halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); - bCommon = TRUE; + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); + + halbtc8821a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); + + return TRUE; } - else if(bWifiConnected && - (BT_8821A_2ANT_BT_STATUS_CONNECTED_IDLE == pCoexDm->btStatus) ) + else { - bLowPwrDisable = TRUE; - pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); - - if(bWifiBusy) - { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi Busy + BT LPS!!\n")); - halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); - } - else - { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi LPS + BT LPS!!\n")); - halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); - } - - halbtc8821a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); - halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + halbtc8821a2ant_DacSwing(pBtCoexist, NORMAL_EXEC, TRUE, 0x18); + return FALSE; + } + + +} - halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,TRUE,TRUE,TRUE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); - bCommon = TRUE; - } - else if(!bWifiConnected && - (BT_8821A_2ANT_BT_STATUS_NON_IDLE == pCoexDm->btStatus) ) + +BOOLEAN +halbtc8821a2ant_IsCommonAction( + IN PBTC_COEXIST pBtCoexist + ) +{ + u1Byte btRssiState=BTC_RSSI_STATE_HIGH; + BOOLEAN bCommon=FALSE, bWifiConnected=FALSE, bWifiBusy=FALSE; + BOOLEAN bBtHsOn=FALSE, bLowPwrDisable=FALSE; + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); + + if(!bWifiConnected) { bLowPwrDisable = FALSE; pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); + halbtc8821a2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); + + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Wifi non-connected idle!!\n")); - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi IPS + BT Busy!!\n")); - + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); + + halbtc8821a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); halbtc8821a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); - halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); - - halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); + halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + bCommon = TRUE; } else { - bLowPwrDisable = TRUE; - pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); - - if(bWifiBusy) + if(BT_8821A_2ANT_BT_STATUS_NON_CONNECTED_IDLE == pCoexDm->btStatus) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi Busy + BT Busy!!\n")); - bCommon = FALSE; + bLowPwrDisable = FALSE; + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); + halbtc8821a2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); + + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Wifi connected + BT non connected-idle!!\n")); + + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); + + halbtc8821a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); + halbtc8821a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 0xb); + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); + + halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + + bCommon = TRUE; } - else + else if(BT_8821A_2ANT_BT_STATUS_CONNECTED_IDLE == pCoexDm->btStatus) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi LPS + BT Busy!!\n")); - halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 21); + bLowPwrDisable = TRUE; + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); - if(halbtc8821a2ant_NeedToDecBtPwr(pBtCoexist)) - halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); - else - halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + if(bBtHsOn) + return FALSE; + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Wifi connected + BT connected-idle!!\n")); + halbtc8821a2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); + + halbtc8821a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); + halbtc8821a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 0xb); + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); + + halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,FALSE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + bCommon = TRUE; } + else + { + bLowPwrDisable = TRUE; + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); - halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,TRUE,TRUE,TRUE); + if(bWifiBusy) + { + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Wifi Connected-Busy + BT Busy!!\n")); + bCommon = FALSE; + //bCommon = halbtc8821a2ant_ActionWifiIdleProcess(pBtCoexist); + } + else + { + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Wifi Connected-Idle + BT Busy!!\n")); + //bCommon = FALSE; + bCommon = halbtc8821a2ant_ActionWifiIdleProcess(pBtCoexist); + } + } } - + return bCommon; } VOID @@ -1655,12 +2031,12 @@ halbtc8821a2ant_TdmaDurationAdjust( s4Byte result; //0: no change, +1: increase WiFi duration, -1: decrease WiFi duration u1Byte retryCount=0; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], TdmaDurationAdjust()\n")); + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], TdmaDurationAdjust()\n")); - if(pCoexDm->bResetTdmaAdjust) + if(!pCoexDm->bAutoTdmaAdjust) { - pCoexDm->bResetTdmaAdjust = FALSE; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], first run TdmaDurationAdjust()!!\n")); + pCoexDm->bAutoTdmaAdjust = TRUE; + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], first run TdmaDurationAdjust()!!\n")); { if(bScoHid) { @@ -1773,8 +2149,8 @@ halbtc8821a2ant_TdmaDurationAdjust( { //accquire the BT TRx retry count from BT_Info byte2 retryCount = pCoexSta->btRetryCnt; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], retryCount = %d\n", retryCount)); - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], up=%d, dn=%d, m=%d, n=%d, WaitCount=%d\n", + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], retryCount = %d\n", retryCount)); + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], up=%d, dn=%d, m=%d, n=%d, WaitCount=%d\n", up, dn, m, n, WaitCount)); result = 0; WaitCount++; @@ -1794,7 +2170,7 @@ halbtc8821a2ant_TdmaDurationAdjust( up = 0; dn = 0; result = 1; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], Increase wifi duration!!\n")); + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], Increase wifi duration!!\n")); } } else if (retryCount <= 3) // <=3 retry in the last 2-second duration @@ -1820,7 +2196,7 @@ halbtc8821a2ant_TdmaDurationAdjust( dn = 0; WaitCount = 0; result = -1; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], Decrease wifi duration for retryCounter<3!!\n")); + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], Decrease wifi duration for retryCounter<3!!\n")); } } else //retry count > 3, un1 retry count > 3, hկWiFi duration @@ -1838,15 +2214,15 @@ halbtc8821a2ant_TdmaDurationAdjust( dn = 0; WaitCount = 0; result = -1; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], Decrease wifi duration for retryCounter>3!!\n")); + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], Decrease wifi duration for retryCounter>3!!\n")); } - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], max Interval = %d\n", maxInterval)); + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], max Interval = %d\n", maxInterval)); if(maxInterval == 1) { if(bTxPause) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], TxPause = 1\n")); + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], TxPause = 1\n")); if(pCoexDm->curPsTdma == 71) { @@ -1963,7 +2339,7 @@ halbtc8821a2ant_TdmaDurationAdjust( } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], TxPause = 0\n")); + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], TxPause = 0\n")); if(pCoexDm->curPsTdma == 5) { halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 71); @@ -2087,7 +2463,7 @@ halbtc8821a2ant_TdmaDurationAdjust( { if(bTxPause) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], TxPause = 1\n")); + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], TxPause = 1\n")); if(pCoexDm->curPsTdma == 1) { halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 6); @@ -2197,7 +2573,7 @@ halbtc8821a2ant_TdmaDurationAdjust( } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], TxPause = 0\n")); + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], TxPause = 0\n")); if(pCoexDm->curPsTdma == 5) { halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 2); @@ -2310,7 +2686,7 @@ halbtc8821a2ant_TdmaDurationAdjust( { if(bTxPause) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], TxPause = 1\n")); + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], TxPause = 1\n")); if(pCoexDm->curPsTdma == 1) { halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 7); @@ -2420,7 +2796,7 @@ halbtc8821a2ant_TdmaDurationAdjust( } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], TxPause = 0\n")); + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], TxPause = 0\n")); if(pCoexDm->curPsTdma == 5) { halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 3); @@ -2536,7 +2912,7 @@ halbtc8821a2ant_TdmaDurationAdjust( if(pCoexDm->curPsTdma != pCoexDm->psTdmaDuAdjType) { BOOLEAN bScan=FALSE, bLink=FALSE, bRoam=FALSE; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], PsTdma type dismatch!!!, curPsTdma=%d, recordPsTdma=%d\n", + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], PsTdma type dismatch!!!, curPsTdma=%d, recordPsTdma=%d\n", pCoexDm->curPsTdma, pCoexDm->psTdmaDuAdjType)); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan); @@ -2549,15 +2925,9 @@ halbtc8821a2ant_TdmaDurationAdjust( } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], roaming/link/scan is under progress, will adjust next time!!!\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], roaming/link/scan is under progress, will adjust next time!!!\n")); } } - - // when halbtc8821a2ant_TdmaDurationAdjust() is called, fw dac swing is included in the function. - //if(pCoexDm->psTdmaDuAdjType == 71) - // halbtc8821a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 0xc); //Skip because A2DP get worse at HT40 - //else - halbtc8821a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 0x6); } // SCO only or SCO+PAN(HS) @@ -2566,85 +2936,73 @@ halbtc8821a2ant_ActionSco( IN PBTC_COEXIST pBtCoexist ) { - u1Byte wifiRssiState,btRssiState; + PBTC_BT_LINK_INFO pBtLinkInfo=&pBtCoexist->btLinkInfo; + u1Byte wifiRssiState, btRssiState; u4Byte wifiBw; wifiRssiState = halbtc8821a2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); - btRssiState = halbtc8821a2ant_BtRssiState(2, 35, 0); + btRssiState = halbtc8821a2ant_BtRssiState(2, BT_8821A_2ANT_BT_RSSI_COEXSWITCH_THRES, 0); + + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); + halbtc8821a2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); + halbtc8821a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 4); - if(halbtc8821a2ant_NeedToDecBtPwr(pBtCoexist)) - halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); + if(BTC_RSSI_HIGH(btRssiState)) + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 2); else - halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); if (BTC_WIFI_BW_LEGACY == wifiBw) //for SCO quality at 11b/g mode { - halbtc8821a2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x5a5a5a5a, 0x5a5a5a5a, 0xffff, 0x3); + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); } else //for SCO quality & wifi performance balance at 11n mode { - halbtc8821a2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x5aea5aea, 0x5aea5aea, 0xffff, 0x3); - } - - if(BTC_WIFI_BW_HT40 == wifiBw) - { - - // fw mechanism - //halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 5); - - if( (btRssiState == BTC_RSSI_STATE_HIGH) || - (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) - { - halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 0); //for voice quality - } + if(BTC_WIFI_BW_HT40 == wifiBw) + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 8); else { - halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 0); //for voice quality + if(pBtLinkInfo->bScoOnly) + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 17); + else + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 12); } + } - // sw mechanism + halbtc8821a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 0); //for voice quality + + // sw mechanism + if(BTC_WIFI_BW_HT40 == wifiBw) + { if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) { halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,TRUE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,TRUE,0x18); } else { halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,TRUE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,TRUE,0x18); } } else { - // fw mechanism - //halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 5); - - if( (btRssiState == BTC_RSSI_STATE_HIGH) || - (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) - { - halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 0); //for voice quality - } - else - { - halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 0); //for voice quality - } - - // sw mechanism if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) { - halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,TRUE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,TRUE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,TRUE,0x18); } else { - halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,TRUE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,TRUE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,TRUE,0x18); } } } @@ -2659,76 +3017,61 @@ halbtc8821a2ant_ActionHid( u4Byte wifiBw; wifiRssiState = halbtc8821a2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); - btRssiState = halbtc8821a2ant_BtRssiState(2, 35, 0); + btRssiState = halbtc8821a2ant_BtRssiState(2, BT_8821A_2ANT_BT_RSSI_COEXSWITCH_THRES, 0); + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); + + halbtc8821a2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); + halbtc8821a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); - if(halbtc8821a2ant_NeedToDecBtPwr(pBtCoexist)) - halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); + if(BTC_RSSI_HIGH(btRssiState)) + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 2); else - halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); if (BTC_WIFI_BW_LEGACY == wifiBw) //for HID at 11b/g mode { - halbtc8821a2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55ff55ff, 0x5a5a5a5a, 0xffff, 0x3); + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); } else //for HID quality & wifi performance balance at 11n mode { - halbtc8821a2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55ff55ff, 0x5aea5aea, 0xffff, 0x3); + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); } + halbtc8821a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + + halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 24); + + // sw mechanism if(BTC_WIFI_BW_HT40 == wifiBw) { - // fw mechanism - if( (btRssiState == BTC_RSSI_STATE_HIGH) || - (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) - { - halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 9); - } - else - { - halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 13); - } - - // sw mechanism if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) { - halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,TRUE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,TRUE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); } else { - halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,TRUE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,TRUE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); } } else { - // fw mechanism - if( (btRssiState == BTC_RSSI_STATE_HIGH) || - (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) - { - halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 9); - } - else - { - halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 13); - } - - // sw mechanism if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) { - halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,TRUE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,TRUE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); } else { - halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,TRUE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,TRUE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); } } } @@ -2739,73 +3082,109 @@ halbtc8821a2ant_ActionA2dp( IN PBTC_COEXIST pBtCoexist ) { - u1Byte wifiRssiState, btRssiState; + u1Byte wifiRssiState, wifiRssiState1, btRssiState; u4Byte wifiBw; + u1Byte apNum=0; wifiRssiState = halbtc8821a2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); - btRssiState = halbtc8821a2ant_BtRssiState(2, 35, 0); + wifiRssiState1 = halbtc8821a2ant_WifiRssiState(pBtCoexist, 1, 2, BT_8821A_2ANT_WIFI_RSSI_COEXSWITCH_THRES, 0); + btRssiState = halbtc8821a2ant_BtRssiState(2, BT_8821A_2ANT_BT_RSSI_COEXSWITCH_THRES, 0); - //fw dac swing is called in halbtc8821a2ant_TdmaDurationAdjust() - //halbtc8821a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); - - - if(halbtc8821a2ant_NeedToDecBtPwr(pBtCoexist)) - halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); - else - halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_AP_NUM, &apNum); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); - - if(BTC_WIFI_BW_HT40 == wifiBw) + // define the office environment + if( (apNum >= 10) && BTC_RSSI_HIGH(wifiRssiState1) && BTC_RSSI_HIGH(btRssiState)) { - // fw mechanism - if( (btRssiState == BTC_RSSI_STATE_HIGH) || - (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + //DbgPrint(" AP#>10(%d)\n", apNum); + halbtc8821a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); + halbtc8821a2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); + halbtc8821a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 2); + + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); + + halbtc8821a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); + + // sw mechanism + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); + if(BTC_WIFI_BW_HT40 == wifiBw) { - halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, FALSE, FALSE, 1); + halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,FALSE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,TRUE,0x6); } else { - halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, FALSE, TRUE, 1); + halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,TRUE,0x6); } + return; + + } - // sw mechanism + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); + halbtc8821a2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); + + halbtc8821a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); + + if(BTC_RSSI_HIGH(btRssiState)) + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 2); + else + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); + + + if (BTC_RSSI_HIGH(wifiRssiState1) && BTC_RSSI_HIGH(btRssiState)) + { + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); + halbtc8821a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + } + else + { + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 13); + halbtc8821a2ant_PowerSaveState(pBtCoexist, BTC_PS_LPS_ON, 0x50, 0x4); + } + + + if( (btRssiState == BTC_RSSI_STATE_HIGH) || + (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, FALSE, FALSE, 1); + } + else + { + halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, FALSE, TRUE, 1); + } + + // sw mechanism + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); + if(BTC_WIFI_BW_HT40 == wifiBw) + { if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) { - halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,FALSE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,FALSE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); } else { - halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,FALSE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,FALSE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); } } else { - // fw mechanism - if( (btRssiState == BTC_RSSI_STATE_HIGH) || - (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) - { - halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, FALSE, FALSE, 1); - } - else - { - halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, FALSE, TRUE, 1); - } - - // sw mechanism if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) { - halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); } else { - halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); } } } @@ -2815,72 +3194,65 @@ halbtc8821a2ant_ActionA2dpPanHs( IN PBTC_COEXIST pBtCoexist ) { - u1Byte wifiRssiState, btRssiState, btInfoExt; + u1Byte wifiRssiState, wifiRssiState1, btRssiState; u4Byte wifiBw; - btInfoExt = pCoexSta->btInfoExt; wifiRssiState = halbtc8821a2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); - btRssiState = halbtc8821a2ant_BtRssiState(2,35, 0); + wifiRssiState1 = halbtc8821a2ant_WifiRssiState(pBtCoexist, 1, 2, BT_8821A_2ANT_WIFI_RSSI_COEXSWITCH_THRES, 0); + btRssiState = halbtc8821a2ant_BtRssiState(2, BT_8821A_2ANT_BT_RSSI_COEXSWITCH_THRES, 0); - //fw dac swing is called in halbtc8821a2ant_TdmaDurationAdjust() - //halbtc8821a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); + halbtc8821a2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); + + halbtc8821a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); - if(halbtc8821a2ant_NeedToDecBtPwr(pBtCoexist)) - halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); + if(BTC_RSSI_HIGH(btRssiState)) + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 2); else - halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); + if (BTC_RSSI_HIGH(wifiRssiState1) && BTC_RSSI_HIGH(btRssiState)) + { + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); + halbtc8821a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + } + else + { + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 13); + halbtc8821a2ant_PowerSaveState(pBtCoexist, BTC_PS_LPS_ON, 0x50, 0x4); + } + + halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, FALSE, TRUE, 2); + // sw mechanism + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); if(BTC_WIFI_BW_HT40 == wifiBw) { - // fw mechanism - if(btInfoExt&BIT0) //a2dp basic rate - { - halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, FALSE, TRUE, 2); - } - else //a2dp edr rate - { - halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, FALSE, TRUE, 1); - } - - // sw mechanism if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) { - halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,FALSE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,FALSE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); } else { - halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,FALSE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,FALSE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); } } else { - // fw mechanism - if(btInfoExt&BIT0) //a2dp basic rate - { - halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, FALSE, TRUE, 2); - } - else //a2dp edr rate - { - halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, FALSE, TRUE, 1); - } - - // sw mechanism if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) { - halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); } else { - halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); } } } @@ -2890,80 +3262,73 @@ halbtc8821a2ant_ActionPanEdr( IN PBTC_COEXIST pBtCoexist ) { - u1Byte wifiRssiState, btRssiState; + u1Byte wifiRssiState,wifiRssiState1, btRssiState; u4Byte wifiBw; wifiRssiState = halbtc8821a2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); - btRssiState = halbtc8821a2ant_BtRssiState(2, 35, 0); + wifiRssiState1 = halbtc8821a2ant_WifiRssiState(pBtCoexist, 1, 2, BT_8821A_2ANT_WIFI_RSSI_COEXSWITCH_THRES, 0); + btRssiState = halbtc8821a2ant_BtRssiState(2, BT_8821A_2ANT_BT_RSSI_COEXSWITCH_THRES, 0); + + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); + + halbtc8821a2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); halbtc8821a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); - if(halbtc8821a2ant_NeedToDecBtPwr(pBtCoexist)) - halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); + if(BTC_RSSI_HIGH(btRssiState)) + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 2); else - halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); - - if (BTC_WIFI_BW_LEGACY == wifiBw) //for HID at 11b/g mode + if (BTC_RSSI_HIGH(wifiRssiState1) && BTC_RSSI_HIGH(btRssiState)) { - halbtc8821a2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55ff55ff, 0x5aff5aff, 0xffff, 0x3); + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 10); + halbtc8821a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); } - else //for HID quality & wifi performance balance at 11n mode + else { - halbtc8821a2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55ff55ff, 0x5aff5aff, 0xffff, 0x3); + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 13); + halbtc8821a2ant_PowerSaveState(pBtCoexist, BTC_PS_LPS_ON, 0x50, 0x4); } - + + if( (btRssiState == BTC_RSSI_STATE_HIGH) || + (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 3); //1->3 for TENCENT spp profile delay time + } + else + { + halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 5); + } + + // sw mechanism + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); if(BTC_WIFI_BW_HT40 == wifiBw) { - // fw mechanism - if( (btRssiState == BTC_RSSI_STATE_HIGH) || - (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) - { - halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 1); - } - else - { - halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 5); - } - - // sw mechanism if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) { - halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,FALSE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,FALSE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); } else { - halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,FALSE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,FALSE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); } } else { - // fw mechanism - if( (btRssiState == BTC_RSSI_STATE_HIGH) || - (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) - { - halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 1); - } - else - { - halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 5); - } - - // sw mechanism if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) { - halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); } else { - halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); } } } @@ -2975,77 +3340,56 @@ halbtc8821a2ant_ActionPanHs( IN PBTC_COEXIST pBtCoexist ) { - u1Byte wifiRssiState, btRssiState; + u1Byte wifiRssiState, wifiRssiState1, btRssiState; u4Byte wifiBw; wifiRssiState = halbtc8821a2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); - btRssiState = halbtc8821a2ant_BtRssiState(2, 35, 0); + wifiRssiState1 = halbtc8821a2ant_WifiRssiState(pBtCoexist, 1, 2, BT_8821A_2ANT_WIFI_RSSI_COEXSWITCH_THRES, 0); + btRssiState = halbtc8821a2ant_BtRssiState(2, BT_8821A_2ANT_BT_RSSI_COEXSWITCH_THRES, 0); + + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); + + halbtc8821a2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); halbtc8821a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); + if(BTC_RSSI_HIGH(btRssiState)) + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 2); + else + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); + + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); + + halbtc8821a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); if(BTC_WIFI_BW_HT40 == wifiBw) { - // fw mechanism - if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || - (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) - { - halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); - } - else - { - halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); - } - halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); - - // sw mechanism if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) { - halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,FALSE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,FALSE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); } else { - halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,FALSE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,FALSE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); } } else { - // fw mechanism if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) { - halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); - } - else - { - halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); - } - - if( (btRssiState == BTC_RSSI_STATE_HIGH) || - (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) - { - halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); - } - else - { - halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); - } - - // sw mechanism - if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || - (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) - { - halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); } else { - halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); } } } @@ -3056,109 +3400,74 @@ halbtc8821a2ant_ActionPanEdrA2dp( IN PBTC_COEXIST pBtCoexist ) { - u1Byte wifiRssiState, btRssiState, btInfoExt; + u1Byte wifiRssiState, wifiRssiState1, btRssiState; u4Byte wifiBw; - btInfoExt = pCoexSta->btInfoExt; wifiRssiState = halbtc8821a2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); - btRssiState = halbtc8821a2ant_BtRssiState(2, 35, 0); + wifiRssiState1 = halbtc8821a2ant_WifiRssiState(pBtCoexist, 1, 2, BT_8821A_2ANT_WIFI_RSSI_COEXSWITCH_THRES, 0); + btRssiState = halbtc8821a2ant_BtRssiState(2, BT_8821A_2ANT_BT_RSSI_COEXSWITCH_THRES, 0); + + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); + + halbtc8821a2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); halbtc8821a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); - if(halbtc8821a2ant_NeedToDecBtPwr(pBtCoexist)) - halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); + if(BTC_RSSI_HIGH(btRssiState)) + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 2); else - halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); + + if (BTC_RSSI_HIGH(wifiRssiState1) && BTC_RSSI_HIGH(btRssiState)) + halbtc8821a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + else + halbtc8821a2ant_PowerSaveState(pBtCoexist, BTC_PS_LPS_ON, 0x50, 0x4); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); - if (BTC_WIFI_BW_LEGACY == wifiBw) //for HID at 11b/g mode + if( (btRssiState == BTC_RSSI_STATE_HIGH) || + (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) { - halbtc8821a2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55ff55ff, 0x5afa5afa, 0xffff, 0x3); + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 12); + + if(BTC_WIFI_BW_HT40 == wifiBw) + halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, FALSE, TRUE, 3); + else + halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, FALSE, FALSE, 3); } - else //for HID quality & wifi performance balance at 11n mode + else { - halbtc8821a2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55ff55ff, 0x5afa5afa, 0xffff, 0x3); + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 13); + halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, FALSE, TRUE, 3); } - + + // sw mechanism if(BTC_WIFI_BW_HT40 == wifiBw) { - // fw mechanism - if( (btRssiState == BTC_RSSI_STATE_HIGH) || - (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) - { - if(btInfoExt&BIT0) //a2dp basic rate - { - halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, FALSE, FALSE, 3); - } - else //a2dp edr rate - { - halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, FALSE, FALSE, 3); - } - } - else - { - if(btInfoExt&BIT0) //a2dp basic rate - { - halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, FALSE, TRUE, 3); - } - else //a2dp edr rate - { - halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, FALSE, TRUE, 3); - } - } - - // sw mechanism if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) { - halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,FALSE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,FALSE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); } else { - halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,FALSE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); - }; + halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,FALSE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + } } else { - // fw mechanism - if( (btRssiState == BTC_RSSI_STATE_HIGH) || - (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) - { - if(btInfoExt&BIT0) //a2dp basic rate - { - halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, FALSE, FALSE, 3); - } - else //a2dp edr rate - { - halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, FALSE, FALSE, 3); - } - } - else - { - if(btInfoExt&BIT0) //a2dp basic rate - { - halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, FALSE, TRUE, 3); - } - else //a2dp edr rate - { - halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, FALSE, TRUE, 3); - } - } - - // sw mechanism if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) { halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); } else { - halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); } } } @@ -3168,82 +3477,84 @@ halbtc8821a2ant_ActionPanEdrHid( IN PBTC_COEXIST pBtCoexist ) { - u1Byte wifiRssiState, btRssiState; + u1Byte wifiRssiState, wifiRssiState1, btRssiState; u4Byte wifiBw; wifiRssiState = halbtc8821a2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); - btRssiState = halbtc8821a2ant_BtRssiState(2, 35, 0); + wifiRssiState1 = halbtc8821a2ant_WifiRssiState(pBtCoexist, 1, 2, BT_8821A_2ANT_WIFI_RSSI_COEXSWITCH_THRES, 0); + btRssiState = halbtc8821a2ant_BtRssiState(2, BT_8821A_2ANT_BT_RSSI_COEXSWITCH_THRES, 0); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); - halbtc8821a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); + halbtc8821a2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); - if(halbtc8821a2ant_NeedToDecBtPwr(pBtCoexist)) - halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); + if(BTC_RSSI_HIGH(btRssiState)) + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 2); else - halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); - - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); - if (BTC_WIFI_BW_LEGACY == wifiBw) //for HID at 11b/g mode + if (BTC_RSSI_HIGH(wifiRssiState1) && BTC_RSSI_HIGH(btRssiState)) { - halbtc8821a2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55ff55ff, 0x5a5f5a5f, 0xffff, 0x3); + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); + halbtc8821a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); } - else //for HID quality & wifi performance balance at 11n mode + else { - halbtc8821a2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55ff55ff, 0x5a5f5a5f, 0xffff, 0x3); + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 14); + halbtc8821a2ant_PowerSaveState(pBtCoexist, BTC_PS_LPS_ON, 0x50, 0x4); } - if(BTC_WIFI_BW_HT40 == wifiBw) - { - halbtc8821a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 3); - // fw mechanism - if( (btRssiState == BTC_RSSI_STATE_HIGH) || - (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + if( (btRssiState == BTC_RSSI_STATE_HIGH) || + (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + if(BTC_WIFI_BW_HT40 == wifiBw) { - halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 10); + halbtc8821a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 3); + //halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 11); + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x780); } else { - halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 14); + halbtc8821a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); + //halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); } - - // sw mechanism + halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, TRUE, FALSE, 2); + } + else + { + halbtc8821a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); + //halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 14); + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); + halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 2); + } + + // sw mechanism + if(BTC_WIFI_BW_HT40 == wifiBw) + { if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) { - halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,TRUE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,TRUE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); } else { - halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,TRUE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,TRUE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); } } else { - halbtc8821a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); - // fw mechanism - if( (btRssiState == BTC_RSSI_STATE_HIGH) || - (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) - { - halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 10); - } - else - { - halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 14); - } - - // sw mechanism if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) { - halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,TRUE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,TRUE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); } else { - halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,TRUE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,TRUE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); } } } @@ -3254,109 +3565,77 @@ halbtc8821a2ant_ActionHidA2dpPanEdr( IN PBTC_COEXIST pBtCoexist ) { - u1Byte wifiRssiState, btRssiState, btInfoExt; + u1Byte wifiRssiState,wifiRssiState1, btRssiState; u4Byte wifiBw; - btInfoExt = pCoexSta->btInfoExt; wifiRssiState = halbtc8821a2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); - btRssiState = halbtc8821a2ant_BtRssiState(2, 35, 0); + wifiRssiState1 = halbtc8821a2ant_WifiRssiState(pBtCoexist, 1, 2, BT_8821A_2ANT_WIFI_RSSI_COEXSWITCH_THRES, 0); + btRssiState = halbtc8821a2ant_BtRssiState(2, BT_8821A_2ANT_BT_RSSI_COEXSWITCH_THRES, 0); + + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); + + halbtc8821a2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, FALSE, 0x8); halbtc8821a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); - if(halbtc8821a2ant_NeedToDecBtPwr(pBtCoexist)) - halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); + if(BTC_RSSI_HIGH(btRssiState)) + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 2); else - halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); + + if (BTC_RSSI_HIGH(wifiRssiState1) && BTC_RSSI_HIGH(btRssiState)) + { + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); + halbtc8821a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + } + else + { + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 14); + halbtc8821a2ant_PowerSaveState(pBtCoexist, BTC_PS_LPS_ON, 0x50, 0x4); + } pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); - if (BTC_WIFI_BW_LEGACY == wifiBw) //for HID at 11b/g mode + if( (btRssiState == BTC_RSSI_STATE_HIGH) || + (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) { - halbtc8821a2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55ff55ff, 0x5a5a5a5a, 0xffff, 0x3); + if(BTC_WIFI_BW_HT40 == wifiBw) + halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 3); + else + halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, TRUE, FALSE, 3); } - else //for HID quality & wifi performance balance at 11n mode + else { - halbtc8821a2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55ff55ff, 0x5a5a5a5a, 0xffff, 0x3); + halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 3); } + // sw mechanism if(BTC_WIFI_BW_HT40 == wifiBw) { - // fw mechanism - if( (btRssiState == BTC_RSSI_STATE_HIGH) || - (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) - { - if(btInfoExt&BIT0) //a2dp basic rate - { - halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 3); - } - else //a2dp edr rate - { - halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 3); - } - } - else - { - if(btInfoExt&BIT0) //a2dp basic rate - { - halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 3); - } - else //a2dp edr rate - { - halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 3); - } - } - - // sw mechanism if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) { - halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,TRUE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,TRUE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); } else { - halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,TRUE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,TRUE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); } } else { - // fw mechanism - if( (btRssiState == BTC_RSSI_STATE_HIGH) || - (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) - { - if(btInfoExt&BIT0) //a2dp basic rate - { - halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, TRUE, FALSE, 3); - } - else //a2dp edr rate - { - halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, TRUE, FALSE, 3); - } - } - else - { - if(btInfoExt&BIT0) //a2dp basic rate - { - halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 3); - } - else //a2dp edr rate - { - halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 3); - } - } - - // sw mechanism if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) { - halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,TRUE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,TRUE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); } else { - halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,TRUE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,TRUE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); } } } @@ -3366,279 +3645,438 @@ halbtc8821a2ant_ActionHidA2dp( IN PBTC_COEXIST pBtCoexist ) { - u1Byte wifiRssiState, btRssiState, btInfoExt; + u1Byte wifiRssiState, wifiRssiState1, btRssiState; u4Byte wifiBw; + u1Byte apNum=0; - btInfoExt = pCoexSta->btInfoExt; wifiRssiState = halbtc8821a2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); - btRssiState = halbtc8821a2ant_BtRssiState(2, 35, 0); + //btRssiState = halbtc8821a2ant_BtRssiState(2, 29, 0); + wifiRssiState1 = halbtc8821a2ant_WifiRssiState(pBtCoexist, 1, 2, BT_8821A_2ANT_WIFI_RSSI_COEXSWITCH_THRES, 0); + btRssiState = halbtc8821a2ant_BtRssiState(3, BT_8821A_2ANT_BT_RSSI_COEXSWITCH_THRES, 37); - if(halbtc8821a2ant_NeedToDecBtPwr(pBtCoexist)) - halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); - else - halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); + + halbtc8821a2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, TRUE, 0x5); + + halbtc8821a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); + if(BTC_WIFI_BW_LEGACY == wifiBw) + { + if(BTC_RSSI_HIGH(btRssiState)) + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 2); + else if(BTC_RSSI_MEDIUM(btRssiState)) + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 2); + else + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); + } + else + { // only 802.11N mode we have to dec bt power to 4 degree + if(BTC_RSSI_HIGH(btRssiState)) + { + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_AP_NUM, &apNum); + // need to check ap Number of Not + if(apNum < 10) + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 4); + else + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 2); + } + else if(BTC_RSSI_MEDIUM(btRssiState)) + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 2); + else + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); + } - if (BTC_WIFI_BW_LEGACY == wifiBw) //for HID at 11b/g mode + if (BTC_RSSI_HIGH(wifiRssiState1) && BTC_RSSI_HIGH(btRssiState)) { -//Allen halbtc8821a2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55ff55ff, 0x5a5a5a5a, 0xffff, 0x3); - halbtc8821a2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55ff55ff, 0x5f5b5f5b, 0xffffff, 0x3); + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); + halbtc8821a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); } - else //for HID quality & wifi performance balance at 11n mode + else { -//Allen halbtc8821a2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55ff55ff, 0x5a5a5a5a, 0xffff, 0x3); - halbtc8821a2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55ff55ff, 0x5f5b5f5b, 0xffffff, 0x3); - + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 14); + halbtc8821a2ant_PowerSaveState(pBtCoexist, BTC_PS_LPS_ON, 0x50, 0x4); } + if( (btRssiState == BTC_RSSI_STATE_HIGH) || + (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + //halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, TRUE, FALSE, 3); + halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 23); + } + else + { + //halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 3); + halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 23); + } + + // sw mechanism if(BTC_WIFI_BW_HT40 == wifiBw) { - // fw mechanism - if( (btRssiState == BTC_RSSI_STATE_HIGH) || - (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || + (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) { - if(btInfoExt&BIT0) //a2dp basic rate - { - halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 2); - } - else //a2dp edr rate - { - halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 2); - } + halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,TRUE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); } else { - if(btInfoExt&BIT0) //a2dp basic rate - { - halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 2); - } - else //a2dp edr rate - { - halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 2); - } + halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,TRUE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); } - - // sw mechanism + } + else + { if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) { - halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,TRUE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,TRUE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); } else { - halbtc8821a2ant_SwMechanism1(pBtCoexist,TRUE,TRUE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,TRUE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); } } +} + +VOID +halbtc8821a2ant_ActionBtWhckTest( + IN PBTC_COEXIST pBtCoexist + ) +{ + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); + + // sw all off + halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + + halbtc8821a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + + halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); +} + +VOID +halbtc8821a2ant_ActionWifiMultiPort( + IN PBTC_COEXIST pBtCoexist + ) +{ + halbtc8821a2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); + halbtc8821a2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 0); + + // sw all off + halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + + // hw all off + //pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); + halbtc8821a2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); + + halbtc8821a2ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + halbtc8821a2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); +} + +VOID +halbtc8821a2ant_RunCoexistMechanism( + IN PBTC_COEXIST pBtCoexist + ) +{ + BOOLEAN bWifiUnder5G=FALSE, bBtHsOn=FALSE; + u1Byte btInfoOriginal=0, btRetryCnt=0; + u1Byte algorithm=0; + u4Byte numOfWifiLink=0; + u4Byte wifiLinkStatus=0; + PBTC_BT_LINK_INFO pBtLinkInfo=&pBtCoexist->btLinkInfo; + BOOLEAN bMiracastPlusBt=FALSE; + BOOLEAN bScan=FALSE, bLink=FALSE, bRoam=FALSE; + + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], RunCoexistMechanism()===>\n")); + + if(pBtCoexist->bManualControl) + { + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], RunCoexistMechanism(), return for Manual CTRL <===\n")); + return; + } + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_UNDER_5G, &bWifiUnder5G); + if(bWifiUnder5G) + { + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], RunCoexistMechanism(), run 5G coex setting!!<===\n")); + halbtc8821a2ant_CoexUnder5G(pBtCoexist); + return; + } + + if(pCoexSta->bUnderIps) + { + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], wifi is under IPS !!!\n")); + return; + } + + if(pCoexSta->bBtWhckTest) + { + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BT is under WHCK TEST!!!\n")); + halbtc8821a2ant_ActionBtWhckTest(pBtCoexist); + return; + } + + algorithm = halbtc8821a2ant_ActionAlgorithm(pBtCoexist); + if(pCoexSta->bC2hBtInquiryPage && (BT_8821A_2ANT_COEX_ALGO_PANHS!=algorithm)) + { + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BT is under inquiry/page scan !!\n")); + halbtc8821a2ant_ActionBtInquiry(pBtCoexist); + return; + } else { - // fw mechanism - if( (btRssiState == BTC_RSSI_STATE_HIGH) || - (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) - { - if(btInfoExt&BIT0) //a2dp basic rate - { -// halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, TRUE, FALSE, 2); - halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 2); - } - else //a2dp edr rate - { -//Allen halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, TRUE, FALSE, 2); - halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 2); - } + } + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_LINK, &bLink); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_ROAM, &bRoam); + + if(bScan || bLink || bRoam) + { + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], WiFi is under Link Process !!\n")); + halbtc8821a2ant_ActionWiFiLinkProcess(pBtCoexist); + return; + } + + //for P2P + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus); + numOfWifiLink = wifiLinkStatus>>16; + + if((numOfWifiLink>=2) || (wifiLinkStatus&WIFI_P2P_GO_CONNECTED)) + { + RT_TRACE(COMP_COEX, DBG_LOUD, ("############# [BTCoex], Multi-Port numOfWifiLink = %d, wifiLinkStatus = 0x%x\n", numOfWifiLink,wifiLinkStatus) ); + + if(pBtLinkInfo->bBtLinkExist) + { + bMiracastPlusBt = TRUE; } else { - if(btInfoExt&BIT0) //a2dp basic rate - { - halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 2); - } - else //a2dp edr rate - { - halbtc8821a2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 2); - } + bMiracastPlusBt = FALSE; } + + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_MIRACAST_PLUS_BT, &bMiracastPlusBt); + halbtc8821a2ant_ActionWifiMultiPort(pBtCoexist); + + return; + } + else + { + bMiracastPlusBt = FALSE; + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_MIRACAST_PLUS_BT, &bMiracastPlusBt); + } - // sw mechanism - if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || - (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + pCoexDm->curAlgorithm = algorithm; + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Algorithm = %d \n", pCoexDm->curAlgorithm)); + + if(halbtc8821a2ant_IsCommonAction(pBtCoexist)) + { + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Action 2-Ant common.\n")); + pCoexDm->bAutoTdmaAdjust = FALSE; + } + else + { + if(pCoexDm->curAlgorithm != pCoexDm->preAlgorithm) { - halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,TRUE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], preAlgorithm=%d, curAlgorithm=%d\n", + pCoexDm->preAlgorithm, pCoexDm->curAlgorithm)); + pCoexDm->bAutoTdmaAdjust = FALSE; } - else + switch(pCoexDm->curAlgorithm) { - halbtc8821a2ant_SwMechanism1(pBtCoexist,FALSE,TRUE,FALSE,FALSE); - halbtc8821a2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + case BT_8821A_2ANT_COEX_ALGO_SCO: + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Action 2-Ant, algorithm = SCO.\n")); + halbtc8821a2ant_ActionSco(pBtCoexist); + break; + case BT_8821A_2ANT_COEX_ALGO_HID: + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Action 2-Ant, algorithm = HID.\n")); + halbtc8821a2ant_ActionHid(pBtCoexist); + break; + case BT_8821A_2ANT_COEX_ALGO_A2DP: + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Action 2-Ant, algorithm = A2DP.\n")); + halbtc8821a2ant_ActionA2dp(pBtCoexist); + break; + case BT_8821A_2ANT_COEX_ALGO_A2DP_PANHS: + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Action 2-Ant, algorithm = A2DP+PAN(HS).\n")); + halbtc8821a2ant_ActionA2dpPanHs(pBtCoexist); + break; + case BT_8821A_2ANT_COEX_ALGO_PANEDR: + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Action 2-Ant, algorithm = PAN(EDR).\n")); + halbtc8821a2ant_ActionPanEdr(pBtCoexist); + break; + case BT_8821A_2ANT_COEX_ALGO_PANHS: + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Action 2-Ant, algorithm = HS mode.\n")); + halbtc8821a2ant_ActionPanHs(pBtCoexist); + break; + case BT_8821A_2ANT_COEX_ALGO_PANEDR_A2DP: + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Action 2-Ant, algorithm = PAN+A2DP.\n")); + halbtc8821a2ant_ActionPanEdrA2dp(pBtCoexist); + break; + case BT_8821A_2ANT_COEX_ALGO_PANEDR_HID: + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Action 2-Ant, algorithm = PAN(EDR)+HID.\n")); + halbtc8821a2ant_ActionPanEdrHid(pBtCoexist); + break; + case BT_8821A_2ANT_COEX_ALGO_HID_A2DP_PANEDR: + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Action 2-Ant, algorithm = HID+A2DP+PAN.\n")); + halbtc8821a2ant_ActionHidA2dpPanEdr(pBtCoexist); + break; + case BT_8821A_2ANT_COEX_ALGO_HID_A2DP: + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Action 2-Ant, algorithm = HID+A2DP.\n")); + halbtc8821a2ant_ActionHidA2dp(pBtCoexist); + break; + default: + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Action 2-Ant, algorithm = coexist All Off!!\n")); + halbtc8821a2ant_CoexAllOff(pBtCoexist); + break; } + pCoexDm->preAlgorithm = pCoexDm->curAlgorithm; } } VOID -halbtc8821a2ant_RunCoexistMechanism( +halbtc8821a2ant_WifiOffHwCfg( IN PBTC_COEXIST pBtCoexist ) { - PBTC_STACK_INFO pStackInfo=&pBtCoexist->stackInfo; - BOOLEAN bWifiUnder5G=FALSE; - u1Byte btInfoOriginal=0, btRetryCnt=0; - u1Byte algorithm=0; + BOOLEAN bIsInMpMode = FALSE; + u1Byte H2C_Parameter[2] ={0}; + u4Byte fwVer=0; - if(pBtCoexist->bManualControl) - { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Manual control!!!\n")); - return; - } - - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_UNDER_5G, &bWifiUnder5G); + // set wlan_act to low + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0x4); - if(bWifiUnder5G) + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x780); //WiFi goto standby while GNT_BT 0-->1 + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_FW_VER, &fwVer); + if(fwVer >= 0x180000) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], RunCoexistMechanism(), run 5G coex setting!!<===\n")); - halbtc8821a2ant_CoexUnder5G(pBtCoexist); - return; + /* Use H2C to set GNT_BT to HIGH */ + H2C_Parameter[0] = 1; + pBtCoexist->fBtcFillH2c(pBtCoexist, 0x6E, 1, H2C_Parameter); } - - if(pStackInfo->bProfileNotified) + else { - algorithm = halbtc8821a2ant_ActionAlgorithm(pBtCoexist); - if(pCoexSta->bC2hBtInquiryPage && (BT_8821A_2ANT_COEX_ALGO_PANHS!=algorithm)) - { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BT is under inquiry/page scan !!\n")); - halbtc8821a2ant_BtInquiryPage(pBtCoexist); - return; - } - - pCoexDm->curAlgorithm = algorithm; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Algorithm = %d \n", pCoexDm->curAlgorithm)); - - if(halbtc8821a2ant_IsCommonAction(pBtCoexist)) - { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant common.\n")); - pCoexDm->bResetTdmaAdjust = TRUE; - } - else - { - if(pCoexDm->curAlgorithm != pCoexDm->preAlgorithm) - { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], preAlgorithm=%d, curAlgorithm=%d\n", - pCoexDm->preAlgorithm, pCoexDm->curAlgorithm)); - pCoexDm->bResetTdmaAdjust = TRUE; - } - switch(pCoexDm->curAlgorithm) - { - case BT_8821A_2ANT_COEX_ALGO_SCO: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = SCO.\n")); - halbtc8821a2ant_ActionSco(pBtCoexist); - break; - case BT_8821A_2ANT_COEX_ALGO_HID: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = HID.\n")); - halbtc8821a2ant_ActionHid(pBtCoexist); - break; - case BT_8821A_2ANT_COEX_ALGO_A2DP: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = A2DP.\n")); - halbtc8821a2ant_ActionA2dp(pBtCoexist); - break; - case BT_8821A_2ANT_COEX_ALGO_A2DP_PANHS: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = A2DP+PAN(HS).\n")); - halbtc8821a2ant_ActionA2dpPanHs(pBtCoexist); - break; - case BT_8821A_2ANT_COEX_ALGO_PANEDR: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = PAN(EDR).\n")); - halbtc8821a2ant_ActionPanEdr(pBtCoexist); - break; - case BT_8821A_2ANT_COEX_ALGO_PANHS: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = HS mode.\n")); - halbtc8821a2ant_ActionPanHs(pBtCoexist); - break; - case BT_8821A_2ANT_COEX_ALGO_PANEDR_A2DP: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = PAN+A2DP.\n")); - halbtc8821a2ant_ActionPanEdrA2dp(pBtCoexist); - break; - case BT_8821A_2ANT_COEX_ALGO_PANEDR_HID: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = PAN(EDR)+HID.\n")); - halbtc8821a2ant_ActionPanEdrHid(pBtCoexist); - break; - case BT_8821A_2ANT_COEX_ALGO_HID_A2DP_PANEDR: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = HID+A2DP+PAN.\n")); - halbtc8821a2ant_ActionHidA2dpPanEdr(pBtCoexist); - break; - case BT_8821A_2ANT_COEX_ALGO_HID_A2DP: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = HID+A2DP.\n")); - halbtc8821a2ant_ActionHidA2dp(pBtCoexist); - break; - default: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = coexist All Off!!\n")); - halbtc8821a2ant_CoexAllOff(pBtCoexist); - break; - } - pCoexDm->preAlgorithm = pCoexDm->curAlgorithm; - } + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x765, 0x18); } - else - { // stack doesn't notify profile info. - // use the following profile info from bt fw. - //pCoexSta->bBtLinkExist - //pCoexSta->bScoExist - //pCoexSta->bA2dpExist - //pCoexSta->bHidExist - //pCoexSta->bPanExist -} } - - -//============================================================ -// work around function start with wa_halbtc8821a2ant_ -//============================================================ -//============================================================ -// extern function start with EXhalbtc8821a2ant_ -//============================================================ VOID -EXhalbtc8821a2ant_InitHwConfig( - IN PBTC_COEXIST pBtCoexist +halbtc8821a2ant_InitHwConfig( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bBackUp ) { PBTC_BOARD_INFO pBoardInfo=&pBtCoexist->boardInfo; - u4Byte u4Tmp=0; + u4Byte u4Tmp=0, fwVer; u2Byte u2Tmp=0; u1Byte u1Tmp=0; u1Byte H2C_Parameter[2] ={0}; - BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], 2Ant Init HW Config!!\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], 2Ant Init HW Config!!\n")); // backup rf 0x1e value pCoexDm->btRf0x1eBackup = - pBtCoexist->fBtcGetRfReg(pBtCoexist, BTC_RF_A, 0x1e, 0xfffff); + pBtCoexist->fBtcGetRfReg(pBtCoexist, BTC_RF_A, 0x1e, 0xfffff); // 0x790[5:0]=0x5 u1Tmp = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x790); u1Tmp &= 0xc0; u1Tmp |= 0x5; pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x790, u1Tmp); - - //Antenna config + + //Antenna config halbtc8821a2ant_SetAntPath(pBtCoexist, BTC_ANT_WIFI_AT_MAIN, TRUE, FALSE); + pCoexSta->disVerInfoCnt = 0; // PTA parameter - halbtc8821a2ant_CoexTable(pBtCoexist, FORCE_EXEC, 0x55555555, 0x55555555, 0xffff, 0x3); + halbtc8821a2ant_CoexTableWithType(pBtCoexist, FORCE_EXEC, 0); // Enable counter statistics - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0xc); //0x76e[3] =1, WLAN_Act control by PTA + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0x4); //0x76e[3] =1, WLAN_Act control by PTA pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x778, 0x3); pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x40, 0x20, 0x1); } +//============================================================ +// work around function start with wa_halbtc8821a2ant_ +//============================================================ +//============================================================ +// extern function start with EXhalbtc8821a2ant_ +//============================================================ +VOID +EXhalbtc8821a2ant_PowerOnSetting( + IN PBTC_COEXIST pBtCoexist + ) +{ + +} + +VOID +EXhalbtc8821a2ant_PreLoadFirmware( + IN PBTC_COEXIST pBtCoexist + ) +{ + PBTC_BOARD_INFO pBoardInfo=&pBtCoexist->boardInfo; + u1Byte u1Tmp=0x4; /* Set BIT2 by default since it's 2ant case */ + + // + // S0 or S1 setting and Local register setting(By the setting fw can get ant number, S0/S1, ... info) + // Local setting bit define + // BIT0: "0" for no antenna inverse; "1" for antenna inverse + // BIT1: "0" for internal switch; "1" for external switch + // BIT2: "0" for one antenna; "1" for two antenna + // NOTE: here default all internal switch and 1-antenna ==> BIT1=0 and BIT2=0 + if(pBtCoexist->chipInterface == BTC_INTF_USB) + { + // fixed at S0 for USB interface + u1Tmp |= 0x1; // antenna inverse + pBtCoexist->fBtcWriteLocalReg1Byte(pBtCoexist, 0xfe08, u1Tmp); + } + else + { + // for PCIE and SDIO interface, we check efuse 0xc3[6] + if(pBoardInfo->singleAntPath == 0) + { + } + else if(pBoardInfo->singleAntPath == 1) + { + // set to S0 + u1Tmp |= 0x1; // antenna inverse + } + + if(pBtCoexist->chipInterface == BTC_INTF_PCI) + { + pBtCoexist->fBtcWriteLocalReg1Byte(pBtCoexist, 0x384, u1Tmp); + } + else if(pBtCoexist->chipInterface == BTC_INTF_SDIO) + { + pBtCoexist->fBtcWriteLocalReg1Byte(pBtCoexist, 0x60, u1Tmp); + } + } +} + +VOID +EXhalbtc8821a2ant_InitHwConfig( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bWifiOnly + ) +{ + halbtc8821a2ant_InitHwConfig(pBtCoexist, TRUE); +} + VOID EXhalbtc8821a2ant_InitCoexDm( IN PBTC_COEXIST pBtCoexist ) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], Coex Mechanism Init!!\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Coex Mechanism Init!!\n")); halbtc8821a2ant_InitCoexDm(pBtCoexist); } @@ -3650,35 +4088,27 @@ EXhalbtc8821a2ant_DisplayCoexInfo( { PBTC_BOARD_INFO pBoardInfo=&pBtCoexist->boardInfo; PBTC_STACK_INFO pStackInfo=&pBtCoexist->stackInfo; + PBTC_BT_LINK_INFO pBtLinkInfo=&pBtCoexist->btLinkInfo; pu1Byte cliBuf=pBtCoexist->cliBuf; u1Byte u1Tmp[4], i, btInfoExt, psTdmaCase=0; u4Byte u4Tmp[4]; - BOOLEAN bRoam=FALSE, bScan=FALSE, bLink=FALSE, bWifiUnder5G=FALSE; - BOOLEAN bBtHsOn=FALSE, bWifiBusy=FALSE; - s4Byte wifiRssi=0, btHsRssi=0; - u4Byte wifiBw, wifiTrafficDir; - u1Byte wifiDot11Chnl, wifiHsChnl; + u4Byte faOfdm, faCck; u4Byte fwVer=0, btPatchVer=0; CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n ============[BT Coexist info]============"); CL_PRINTF(cliBuf); - if(!pBoardInfo->bBtExist) + if(pBtCoexist->bManualControl) { - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n BT not exists !!!"); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n ============[Under Manual Control]============"); + CL_PRINTF(cliBuf); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n =========================================="); CL_PRINTF(cliBuf); - return; } CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d ", "Ant PG number/ Ant mechanism:", \ pBoardInfo->pgAntNum, pBoardInfo->btdmAntNum); - CL_PRINTF(cliBuf); - - if(pBtCoexist->bManualControl) - { - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "[Action Manual control]!!"); - CL_PRINTF(cliBuf); - } + CL_PRINTF(cliBuf); CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s / %d", "BT stack/ hci ext ver", \ ((pStackInfo->bProfileNotified)? "Yes":"No"), pStackInfo->hciVersion); @@ -3686,58 +4116,43 @@ EXhalbtc8821a2ant_DisplayCoexInfo( pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_BT_PATCH_VER, &btPatchVer); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_FW_VER, &fwVer); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d_%d/ 0x%x/ 0x%x(%d)", "CoexVer/ FwVer/ PatchVer", \ + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d_%x/ 0x%x/ 0x%x(%d)", "CoexVer/ FwVer/ PatchVer", \ GLCoexVerDate8821a2Ant, GLCoexVer8821a2Ant, fwVer, btPatchVer, btPatchVer); CL_PRINTF(cliBuf); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_DOT11_CHNL, &wifiDot11Chnl); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_HS_CHNL, &wifiHsChnl); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d(%d)", "Dot11 channel / HsMode(HsChnl)", \ - wifiDot11Chnl, bBtHsOn, wifiHsChnl); - CL_PRINTF(cliBuf); - - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %02x %02x %02x ", "H2C Wifi inform bt chnl Info", \ + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %02x %02x %02x ", "Wifi channel informed to BT", \ pCoexDm->wifiChnlInfo[0], pCoexDm->wifiChnlInfo[1], pCoexDm->wifiChnlInfo[2]); CL_PRINTF(cliBuf); - - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_WIFI_RSSI, &wifiRssi); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_HS_RSSI, &btHsRssi); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d", "Wifi rssi/ HS rssi", \ - wifiRssi, btHsRssi); + + // wifi status + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[Wifi Status]============"); CL_PRINTF(cliBuf); + pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_WIFI_STATUS); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_LINK, &bLink); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_ROAM, &bRoam); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d ", "Wifi bLink/ bRoam/ bScan", \ - bLink, bRoam, bScan); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[BT Status]============"); CL_PRINTF(cliBuf); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_UNDER_5G, &bWifiUnder5G); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_TRAFFIC_DIRECTION, &wifiTrafficDir); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s / %s/ %s ", "Wifi status", \ - (bWifiUnder5G? "5G":"2.4G"), - ((BTC_WIFI_BW_LEGACY==wifiBw)? "Legacy": (((BTC_WIFI_BW_HT40==wifiBw)? "HT40":"HT20"))), - ((!bWifiBusy)? "idle": ((BTC_WIFI_TRAFFIC_TX==wifiTrafficDir)? "uplink":"downlink"))); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = [%s/ %ddBm/ %d] ", "BT [status/ rssi/ retryCnt]", \ + ((pBtCoexist->btInfo.bBtDisabled)? ("disabled"): ((pCoexSta->bC2hBtInquiryPage)?("inquiry/page scan"):((BT_8821A_2ANT_BT_STATUS_NON_CONNECTED_IDLE == pCoexDm->btStatus)? "non-connected idle": + ( (BT_8821A_2ANT_BT_STATUS_CONNECTED_IDLE == pCoexDm->btStatus)? "connected-idle":"busy")))), + pCoexSta->btRssi-100, pCoexSta->btRetryCnt); CL_PRINTF(cliBuf); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = [%s/ %d/ %d] ", "BT [status/ rssi/ retryCnt]", \ - ((pCoexSta->bC2hBtInquiryPage)?("inquiry/page scan"):((BT_8821A_2ANT_BT_STATUS_IDLE == pCoexDm->btStatus)? "idle":( (BT_8821A_2ANT_BT_STATUS_CONNECTED_IDLE == pCoexDm->btStatus)? "connected-idle":"busy"))), - pCoexSta->btRssi, pCoexSta->btRetryCnt); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d / %d / %d", "SCO/HID/PAN/A2DP", \ + pBtLinkInfo->bScoExist, pBtLinkInfo->bHidExist, pBtLinkInfo->bPanExist, pBtLinkInfo->bA2dpExist); CL_PRINTF(cliBuf); - - if(pStackInfo->bProfileNotified) - { - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d / %d / %d", "SCO/HID/PAN/A2DP", \ - pStackInfo->bScoExist, pStackInfo->bHidExist, pStackInfo->bPanExist, pStackInfo->bA2dpExist); - CL_PRINTF(cliBuf); - pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_BT_LINK_INFO); + if (pStackInfo->bProfileNotified) + { + pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_BT_LINK_INFO); } + else + { + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s", "BT Role", \ + (pBtLinkInfo->bSlaveRole )? "Slave":"Master"); + CL_PRINTF(cliBuf); + } btInfoExt = pCoexSta->btInfoExt; CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s", "BT Info A2DP rate", \ @@ -3757,17 +4172,11 @@ EXhalbtc8821a2ant_DisplayCoexInfo( } } - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s/%s", "PS state, IPS/LPS", \ - ((pCoexSta->bUnderIps? "IPS ON":"IPS OFF")), - ((pCoexSta->bUnderLps? "LPS ON":"LPS OFF"))); - CL_PRINTF(cliBuf); - pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_FW_PWR_MODE_CMD); - // Sw mechanism CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[Sw mechanism]============"); CL_PRINTF(cliBuf); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d/ %d ", "SM1[ShRf/ LpRA/ LimDig/ btLna]", \ - pCoexDm->bCurRfRxLpfShrink, pCoexDm->bCurLowPenaltyRa, pCoexDm->bLimitedDig, pCoexDm->bCurBtLnaConstrain); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d ", "SM1[ShRf/ LpRA/ LimDig]", \ + pCoexDm->bCurRfRxLpfShrink, pCoexDm->bCurLowPenaltyRa, pCoexDm->bLimitedDig); CL_PRINTF(cliBuf); CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d(0x%x) ", "SM2[AgcT/ AdcB/ SwDacSwing(lvl)]", \ pCoexDm->bCurAgcTableEn, pCoexDm->bCurAdcBackOff, pCoexDm->bCurDacSwingOn, pCoexDm->curDacSwingLvl); @@ -3776,20 +4185,21 @@ EXhalbtc8821a2ant_DisplayCoexInfo( // Fw mechanism CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[Fw mechanism]============"); CL_PRINTF(cliBuf); - - if(!pBtCoexist->bManualControl) - { - psTdmaCase = pCoexDm->curPsTdma; - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %02x %02x %02x %02x %02x case-%d", "PS TDMA", \ - pCoexDm->psTdmaPara[0], pCoexDm->psTdmaPara[1], - pCoexDm->psTdmaPara[2], pCoexDm->psTdmaPara[3], - pCoexDm->psTdmaPara[4], psTdmaCase); - CL_PRINTF(cliBuf); - - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d ", "DecBtPwr/ IgnWlanAct", \ - pCoexDm->bCurDecBtPwr, pCoexDm->bCurIgnoreWlanAct); + + psTdmaCase = pCoexDm->curPsTdma; + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %02x %02x %02x %02x %02x case-%d (auto:%d)", "PS TDMA", \ + pCoexDm->psTdmaPara[0], pCoexDm->psTdmaPara[1], + pCoexDm->psTdmaPara[2], pCoexDm->psTdmaPara[3], + pCoexDm->psTdmaPara[4], psTdmaCase, pCoexDm->bAutoTdmaAdjust); + CL_PRINTF(cliBuf); + + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d", "Coex Table Type", \ + pCoexSta->nCoexTableType); CL_PRINTF(cliBuf); - } + + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d ", "DecBtPwr/ IgnWlanAct", \ + pCoexDm->curBtDecPwrLvl, pCoexDm->bCurIgnoreWlanAct); + CL_PRINTF(cliBuf); // Hw setting CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[Hw setting]============"); @@ -3800,16 +4210,17 @@ EXhalbtc8821a2ant_DisplayCoexInfo( CL_PRINTF(cliBuf); u1Tmp[0] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x778); - u1Tmp[1] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x6cc); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/ 0x%x ", "0x778 (W_Act)/ 0x6cc (CoTab Sel)", \ - u1Tmp[0], u1Tmp[1]); + u1Tmp[1] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0xc5b); + u4Tmp[0] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x880); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/ 0x%x/ 0x%x", "0x778/0x880[29:25]/0xc58[29:25]", \ + u1Tmp[0], (u4Tmp[0]&0x3e000000) >> 25, ((u1Tmp[1]&0x3e)>>1)); CL_PRINTF(cliBuf); - u1Tmp[0] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x8db); - u1Tmp[1] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0xc5b); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/ 0x%x", "0x8db(ADC)/0xc5b[29:25](DAC)", \ - ((u1Tmp[0]&0x60)>>5), ((u1Tmp[1]&0x3e)>>1)); - CL_PRINTF(cliBuf); + u4Tmp[0] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x764); + u1Tmp[0] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x76e); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/ 0x%x/ 0x%x", "0x764/ 0x765/ 0x76e", \ + (u4Tmp[0]&0xff), (u4Tmp[0]&0xff00)>>8, u1Tmp[0]); + CL_PRINTF(cliBuf); u4Tmp[0] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0xcb4); CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/ 0x%x", "0xcb4[7:0](ctrl)/ 0xcb4[29:28](val)", \ @@ -3830,38 +4241,52 @@ EXhalbtc8821a2ant_DisplayCoexInfo( CL_PRINTF(cliBuf); u4Tmp[0] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0xc50); - u1Tmp[0] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0xa0a); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/ 0x%x", "0xc50(DIG)/0xa0a(CCK-TH)", \ - u4Tmp[0], u1Tmp[0]); + u1Tmp[0] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x49c); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/ 0x%x", "0xc50(dig)/0x49c(null-drop)", \ + u4Tmp[0]&0xff, u1Tmp[0]); CL_PRINTF(cliBuf); - u4Tmp[0] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0xf48); + u4Tmp[0] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0xda0); + u4Tmp[1] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0xda4); + u4Tmp[2] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0xda8); + u4Tmp[3] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0xcf0); + u1Tmp[0] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0xa5b); u1Tmp[1] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0xa5c); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/ 0x%x", "OFDM-FA/ CCK-FA", \ - u4Tmp[0], (u1Tmp[0]<<8) + u1Tmp[1] ); + + faOfdm = ((u4Tmp[0]&0xffff0000) >> 16) + ((u4Tmp[1]&0xffff0000) >> 16) + (u4Tmp[1] & 0xffff) + (u4Tmp[2] & 0xffff) + \ + ((u4Tmp[3]&0xffff0000) >> 16) + (u4Tmp[3] & 0xffff) ; + faCck = (u1Tmp[0] << 8) + u1Tmp[1]; + + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/ 0x%x/ 0x%x", "OFDM-CCA/OFDM-FA/CCK-FA", \ + u4Tmp[0]&0xffff, faOfdm, faCck); + CL_PRINTF(cliBuf); + + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d/ %d", "CRC_OK CCK/11g/11n/11n-Agg", \ + pCoexSta->nCRCOK_CCK, pCoexSta->nCRCOK_11g, pCoexSta->nCRCOK_11n, pCoexSta->nCRCOK_11nAgg); CL_PRINTF(cliBuf); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d/ %d", "CRC_Err CCK/11g/11n/11n-Agg", \ + pCoexSta->nCRCErr_CCK, pCoexSta->nCRCErr_11g, pCoexSta->nCRCErr_11n, pCoexSta->nCRCErr_11nAgg); + CL_PRINTF(cliBuf); + u4Tmp[0] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x6c0); u4Tmp[1] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x6c4); u4Tmp[2] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x6c8); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/ 0x%x/ 0x%x", "0x6c0/0x6c4/0x6c8", \ - u4Tmp[0], u4Tmp[1], u4Tmp[2]); + u1Tmp[0] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x6cc); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/ 0x%x/ 0x%x/ 0x%x", "0x6c0/0x6c4/0x6c8/0x6cc(coexTable)", \ + u4Tmp[0], u4Tmp[1], u4Tmp[2], u1Tmp[0]); CL_PRINTF(cliBuf); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d", "0x770 (hi-pri Rx/Tx)", \ + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d", "0x770(high-pri rx/tx)", \ pCoexSta->highPriorityRx, pCoexSta->highPriorityTx); CL_PRINTF(cliBuf); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d", "0x774(low-pri Rx/Tx)", \ + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d", "0x774(low-pri rx/tx)", \ pCoexSta->lowPriorityRx, pCoexSta->lowPriorityTx); CL_PRINTF(cliBuf); - - // Tx mgnt queue hang or not, 0x41b should = 0xf, ex: 0xd ==>hang - u1Tmp[0] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x41b); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x", "0x41b (mgntQ hang chk == 0xf)", \ - u1Tmp[0]); - CL_PRINTF(cliBuf); - +#if(BT_AUTO_REPORT_ONLY_8821A_2ANT == 1) + //halbtc8821a2ant_MonitorBtCtr(pBtCoexist); +#endif pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_COEX_STATISTICS); } @@ -3874,15 +4299,19 @@ EXhalbtc8821a2ant_IpsNotify( { if(BTC_IPS_ENTER == type) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], IPS ENTER notify\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], IPS ENTER notify\n")); pCoexSta->bUnderIps = TRUE; + halbtc8821a2ant_WifiOffHwCfg(pBtCoexist); + halbtc8821a2ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, TRUE); halbtc8821a2ant_CoexAllOff(pBtCoexist); } else if(BTC_IPS_LEAVE == type) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], IPS LEAVE notify\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], IPS LEAVE notify\n")); pCoexSta->bUnderIps = FALSE; - //halbtc8821a2ant_InitCoexDm(pBtCoexist); + halbtc8821a2ant_InitHwConfig(pBtCoexist, FALSE); + halbtc8821a2ant_InitCoexDm(pBtCoexist); + halbtc8821a2ant_QueryBtInfo(pBtCoexist); } } @@ -3894,12 +4323,12 @@ EXhalbtc8821a2ant_LpsNotify( { if(BTC_LPS_ENABLE == type) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], LPS ENABLE notify\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], LPS ENABLE notify\n")); pCoexSta->bUnderLps = TRUE; } else if(BTC_LPS_DISABLE == type) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], LPS DISABLE notify\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], LPS DISABLE notify\n")); pCoexSta->bUnderLps = FALSE; } } @@ -3910,14 +4339,21 @@ EXhalbtc8821a2ant_ScanNotify( IN u1Byte type ) { + u1Byte u1Tmpa, u1Tmpb; + + u1Tmpa = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x765); + u1Tmpb = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x76e); + if(BTC_SCAN_START == type) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN START notify\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], SCAN START notify\n")); } else if(BTC_SCAN_FINISH == type) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN FINISH notify\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], SCAN FINISH notify\n")); } + + RT_TRACE(COMP_COEX, DBG_LOUD, ("############# [BTCoex], 0x765=0x%x, 0x76e=0x%x\n", u1Tmpa, u1Tmpb)); } VOID @@ -3928,31 +4364,32 @@ EXhalbtc8821a2ant_ConnectNotify( { if(BTC_ASSOCIATE_START == type) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT START notify\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], CONNECT START notify\n")); } else if(BTC_ASSOCIATE_FINISH == type) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT FINISH notify\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], CONNECT FINISH notify\n")); } } VOID EXhalbtc8821a2ant_MediaStatusNotify( - IN PBTC_COEXIST pBtCoexist, + IN PBTC_COEXIST pBtCoexist, IN u1Byte type ) { u1Byte H2C_Parameter[3] ={0}; u4Byte wifiBw; u1Byte wifiCentralChnl; + u1Byte apNum=0; if(BTC_MEDIA_CONNECT == type) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], MEDIA connect notify\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], MEDIA connect notify\n")); } else { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], MEDIA disconnect notify\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], MEDIA disconnect notify\n")); } // only 2.4G we need to inform bt the chnl mask @@ -3966,17 +4403,23 @@ EXhalbtc8821a2ant_MediaStatusNotify( if(BTC_WIFI_BW_HT40 == wifiBw) H2C_Parameter[2] = 0x30; else - H2C_Parameter[2] = 0x20; + { + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_AP_NUM, &apNum); + if(apNum < 10) + H2C_Parameter[2] = 0x30; + else + H2C_Parameter[2] = 0x20; + } } - + pCoexDm->wifiChnlInfo[0] = H2C_Parameter[0]; pCoexDm->wifiChnlInfo[1] = H2C_Parameter[1]; pCoexDm->wifiChnlInfo[2] = H2C_Parameter[2]; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], FW write 0x66=0x%x\n", + RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], FW write 0x66=0x%x\n", H2C_Parameter[0]<<16|H2C_Parameter[1]<<8|H2C_Parameter[2])); - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x66, 3, H2C_Parameter); + pBtCoexist->fBtcFillH2c(pBtCoexist, 0x66, 3, H2C_Parameter); } VOID @@ -3987,7 +4430,7 @@ EXhalbtc8821a2ant_SpecialPacketNotify( { if(type == BTC_PACKET_DHCP) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], DHCP Packet notify\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], DHCP Packet notify\n")); } } @@ -3998,20 +4441,24 @@ EXhalbtc8821a2ant_BtInfoNotify( IN u1Byte length ) { + PBTC_BT_LINK_INFO pBtLinkInfo=&pBtCoexist->btLinkInfo; u1Byte btInfo=0; u1Byte i, rspSource=0; - static u4Byte setBtLnaCnt=0, setBtPsdMode=0; BOOLEAN bBtBusy=FALSE, bLimitedDig=FALSE; - BOOLEAN bWifiConnected=FALSE, bBtHsOn=FALSE; + BOOLEAN bWifiConnected=FALSE, bWifiUnder5G=FALSE; + static BOOLEAN bPreScoExist=FALSE; + u4Byte raMask=0x0; pCoexSta->bC2hBtInfoReqSent = FALSE; + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_UNDER_5G, &bWifiUnder5G); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); rspSource = tmpBuf[0]&0xf; if(rspSource >= BT_INFO_SRC_8821A_2ANT_MAX) rspSource = BT_INFO_SRC_8821A_2ANT_WIFI_FW; pCoexSta->btInfoC2hCnt[rspSource]++; - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Bt info[%d], length=%d, hex data=[", rspSource, length)); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Bt info[%d], length=%d, hex data=[", rspSource, length)); for(i=0; ibtInfoC2h[rspSource][i] = tmpBuf[i]; @@ -4019,14 +4466,26 @@ EXhalbtc8821a2ant_BtInfoNotify( btInfo = tmpBuf[i]; if(i == length-1) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("0x%02x]\n", tmpBuf[i])); + RT_TRACE(COMP_COEX, DBG_LOUD, ("0x%02x]\n", tmpBuf[i])); } else { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("0x%02x, ", tmpBuf[i])); + RT_TRACE(COMP_COEX, DBG_LOUD, ("0x%02x, ", tmpBuf[i])); } } + if(pBtCoexist->bManualControl) + { + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BtInfoNotify(), return for Manual CTRL<===\n")); + return; + } + + // if 0xff, it means BT is under WHCK test + if (btInfo == 0xff) + pCoexSta->bBtWhckTest = TRUE; + else + pCoexSta->bBtWhckTest = FALSE; + if(BT_INFO_SRC_8821A_2ANT_WIFI_FW != rspSource) { pCoexSta->btRetryCnt = // [3:0] @@ -4038,11 +4497,20 @@ EXhalbtc8821a2ant_BtInfoNotify( pCoexSta->btInfoExt = pCoexSta->btInfoC2h[rspSource][4]; + pCoexSta->bBtTxRxMask = (pCoexSta->btInfoC2h[rspSource][2]&0x40); + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_TX_RX_MASK, &pCoexSta->bBtTxRxMask); + if(pCoexSta->bBtTxRxMask) + { + /* BT into is responded by BT FW and BT RF REG 0x3C != 0x01 => Need to switch BT TRx Mask */ + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Switch BT TRx Mask since BT RF REG 0x3C != 0x01\n")); + pBtCoexist->fBtcSetBtReg(pBtCoexist, BTC_BT_REG_RF, 0x3c, 0x01); + } + // Here we need to resend some wifi info to BT // because bt is reset and loss of the info. if( (pCoexSta->btInfoExt & BIT1) ) - { - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); + { + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BT ext info bit1 check, send wifi BW&Chnl to BT!!\n")); if(bWifiConnected) { EXhalbtc8821a2ant_MediaStatusNotify(pBtCoexist, BTC_MEDIA_CONNECT); @@ -4051,43 +4519,34 @@ EXhalbtc8821a2ant_BtInfoNotify( { EXhalbtc8821a2ant_MediaStatusNotify(pBtCoexist, BTC_MEDIA_DISCONNECT); } - - setBtPsdMode = 0; - } - if(setBtPsdMode <= 3) - { - halbtc8821a2ant_SetBtPsdMode(pBtCoexist, FORCE_EXEC, 0x0); //fix CH-BW mode - setBtPsdMode++; } + - if(pCoexDm->bCurBtLnaConstrain) + if(!pBtCoexist->bManualControl && !bWifiUnder5G) { - if( (pCoexSta->btInfoExt & BIT2) ) + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BT ext info = 0x%x!!\n", pCoexSta->btInfoExt)); + if( (pCoexSta->btInfoExt&BIT3) ) { + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BT ext info bit3=1, bWifiConnected=%d\n", bWifiConnected)); + if(bWifiConnected) + { + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BT ext info bit3 check, set BT NOT to ignore Wlan active!!\n")); + halbtc8821a2ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, FALSE); + } } else { - if(setBtLnaCnt <= 3) + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BT ext info bit3=0, bWifiConnected=%d\n", bWifiConnected)); + // BT already NOT ignore Wlan active, do nothing here. + if(!bWifiConnected) { - halbtc8821a2ant_SetBtLnaConstrain(pBtCoexist, FORCE_EXEC, TRUE); - setBtLnaCnt++; + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BT ext info bit3 check, set BT to ignore Wlan active!!\n")); + halbtc8821a2ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, TRUE); } } } - else - { - setBtLnaCnt = 0; - } - - if( (pCoexSta->btInfoExt & BIT3) ) - { - halbtc8821a2ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, FALSE); - } - else - { - // BT already NOT ignore Wlan active, do nothing here. - } +#if(BT_AUTO_REPORT_ONLY_8821A_2ANT == 0) if( (pCoexSta->btInfoExt & BIT4) ) { // BT auto report already enabled, do nothing @@ -4096,78 +4555,95 @@ EXhalbtc8821a2ant_BtInfoNotify( { halbtc8821a2ant_BtAutoReport(pBtCoexist, FORCE_EXEC, TRUE); } +#endif } - - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); + // check BIT2 first ==> check if bt is under inquiry or page scan if(btInfo & BT_INFO_8821A_2ANT_B_INQ_PAGE) - { pCoexSta->bC2hBtInquiryPage = TRUE; - pCoexDm->btStatus = BT_8821A_2ANT_BT_STATUS_NON_IDLE; - } else - { pCoexSta->bC2hBtInquiryPage = FALSE; - if(btInfo == 0x1) // connection exists but no busy - { - pCoexSta->bBtLinkExist = TRUE; - pCoexDm->btStatus = BT_8821A_2ANT_BT_STATUS_CONNECTED_IDLE; - } - else if(btInfo & BT_INFO_8821A_2ANT_B_CONNECTION) // connection exists and some link is busy - { - pCoexSta->bBtLinkExist = TRUE; - if(btInfo & BT_INFO_8821A_2ANT_B_FTP) - pCoexSta->bPanExist = TRUE; - else - pCoexSta->bPanExist = FALSE; - if(btInfo & BT_INFO_8821A_2ANT_B_A2DP) - pCoexSta->bA2dpExist = TRUE; - else - pCoexSta->bA2dpExist = FALSE; - if(btInfo & BT_INFO_8821A_2ANT_B_HID) - pCoexSta->bHidExist = TRUE; - else - pCoexSta->bHidExist = FALSE; - if(btInfo & BT_INFO_8821A_2ANT_B_SCO_ESCO) - pCoexSta->bScoExist = TRUE; - else - pCoexSta->bScoExist = FALSE; - pCoexDm->btStatus = BT_8821A_2ANT_BT_STATUS_NON_IDLE; - } + + // set link exist status + if(!(btInfo&BT_INFO_8821A_2ANT_B_CONNECTION)) + { + pCoexSta->bBtLinkExist = FALSE; + pCoexSta->bPanExist = FALSE; + pCoexSta->bA2dpExist = FALSE; + pCoexSta->bHidExist = FALSE; + pCoexSta->bScoExist = FALSE; + } + else // connection exists + { + pCoexSta->bBtLinkExist = TRUE; + if(btInfo & BT_INFO_8821A_2ANT_B_FTP) + pCoexSta->bPanExist = TRUE; else - { - pCoexSta->bBtLinkExist = FALSE; pCoexSta->bPanExist = FALSE; + if(btInfo & BT_INFO_8821A_2ANT_B_A2DP) + pCoexSta->bA2dpExist = TRUE; + else pCoexSta->bA2dpExist = FALSE; + if(btInfo & BT_INFO_8821A_2ANT_B_HID) + pCoexSta->bHidExist = TRUE; + else pCoexSta->bHidExist = FALSE; + if(btInfo & BT_INFO_8821A_2ANT_B_SCO_ESCO) + pCoexSta->bScoExist = TRUE; + else pCoexSta->bScoExist = FALSE; - pCoexDm->btStatus = BT_8821A_2ANT_BT_STATUS_IDLE; - } - - if(bBtHsOn) + + if ( (pCoexSta->bHidExist == FALSE) && (pCoexSta->bC2hBtInquiryPage == FALSE) && (pCoexSta->bScoExist == FALSE)) { - pCoexDm->btStatus = BT_8821A_2ANT_BT_STATUS_NON_IDLE; + if (pCoexSta->highPriorityTx + pCoexSta->highPriorityRx >= 160) + pCoexSta->bHidExist = TRUE; } } - if(BT_8821A_2ANT_BT_STATUS_NON_IDLE == pCoexDm->btStatus) + halbtc8821a2ant_UpdateBtLinkInfo(pBtCoexist); + + if(!(btInfo&BT_INFO_8821A_2ANT_B_CONNECTION)) { - bBtBusy = TRUE; + pCoexDm->btStatus = BT_8821A_2ANT_BT_STATUS_NON_CONNECTED_IDLE; + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BtInfoNotify(), BT Non-Connected idle!!!\n")); + } + else if(btInfo == BT_INFO_8821A_2ANT_B_CONNECTION) // connection exists but no busy + { + pCoexDm->btStatus = BT_8821A_2ANT_BT_STATUS_CONNECTED_IDLE; + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BtInfoNotify(), BT Connected-idle!!!\n")); + } + else if((btInfo&BT_INFO_8821A_2ANT_B_SCO_ESCO) || + (btInfo&BT_INFO_8821A_2ANT_B_SCO_BUSY)) + { + pCoexDm->btStatus = BT_8821A_2ANT_BT_STATUS_SCO_BUSY; + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BtInfoNotify(), BT SCO busy!!!\n")); + } + else if(btInfo&BT_INFO_8821A_2ANT_B_ACL_BUSY) + { + pCoexDm->btStatus = BT_8821A_2ANT_BT_STATUS_ACL_BUSY; + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BtInfoNotify(), BT ACL busy!!!\n")); } else { - bBtBusy = FALSE; + pCoexDm->btStatus = BT_8821A_2ANT_BT_STATUS_MAX; + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BtInfoNotify(), BT Non-Defined state!!!\n")); } - pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_TRAFFIC_BUSY, &bBtBusy); - - if(BT_8821A_2ANT_BT_STATUS_IDLE != pCoexDm->btStatus) + + if( (BT_8821A_2ANT_BT_STATUS_ACL_BUSY == pCoexDm->btStatus) || + (BT_8821A_2ANT_BT_STATUS_SCO_BUSY == pCoexDm->btStatus) || + (BT_8821A_2ANT_BT_STATUS_ACL_SCO_BUSY == pCoexDm->btStatus) ) { + bBtBusy = TRUE; bLimitedDig = TRUE; } else { + bBtBusy = FALSE; bLimitedDig = FALSE; } + + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_TRAFFIC_BUSY, &bBtBusy); + pCoexDm->bLimitedDig = bLimitedDig; pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_LIMITED_DIG, &bLimitedDig); @@ -4179,42 +4655,84 @@ EXhalbtc8821a2ant_HaltNotify( IN PBTC_COEXIST pBtCoexist ) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Halt notify\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Halt notify\n")); + halbtc8821a2ant_WifiOffHwCfg(pBtCoexist); + //remove due to interrupt is disabled that polling c2h will fail and delay 100ms. + //pBtCoexist->fBtcSetBtReg(pBtCoexist, BTC_BT_REG_RF, 0x3c, 0x15); //BT goto standby while GNT_BT 1-->0 halbtc8821a2ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, TRUE); + EXhalbtc8821a2ant_MediaStatusNotify(pBtCoexist, BTC_MEDIA_DISCONNECT); } +VOID +EXhalbtc8821a2ant_PnpNotify( + IN PBTC_COEXIST pBtCoexist, + IN u1Byte pnpState + ) +{ + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Pnp notify\n")); + + if(BTC_WIFI_PNP_SLEEP == pnpState) + { + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Pnp notify to SLEEP\n")); + } + else if(BTC_WIFI_PNP_WAKE_UP == pnpState) + { + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Pnp notify to WAKE UP\n")); + halbtc8821a2ant_InitHwConfig(pBtCoexist, FALSE); + halbtc8821a2ant_InitCoexDm(pBtCoexist); + halbtc8821a2ant_QueryBtInfo(pBtCoexist); + } +} + VOID EXhalbtc8821a2ant_Periodical( IN PBTC_COEXIST pBtCoexist ) { - static u1Byte disVerInfoCnt=0; + //static u1Byte disVerInfoCnt=0; u4Byte fwVer=0, btPatchVer=0; PBTC_BOARD_INFO pBoardInfo=&pBtCoexist->boardInfo; PBTC_STACK_INFO pStackInfo=&pBtCoexist->stackInfo; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], ==========================Periodical===========================\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], ==========================Periodical===========================\n")); - if(disVerInfoCnt <= 5) + if(pCoexSta->disVerInfoCnt <= 5) { - disVerInfoCnt += 1; - BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], ****************************************************************\n")); - BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], Ant PG Num/ Ant Mech/ Ant Pos = %d/ %d/ %d\n", \ + pCoexSta->disVerInfoCnt += 1; + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], ****************************************************************\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Ant PG Num/ Ant Mech/ Ant Pos = %d/ %d/ %d\n", pBoardInfo->pgAntNum, pBoardInfo->btdmAntNum, pBoardInfo->btdmAntPos)); - BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], BT stack/ hci ext ver = %s / %d\n", \ + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BT stack/ hci ext ver = %s / %d\n", ((pStackInfo->bProfileNotified)? "Yes":"No"), pStackInfo->hciVersion)); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_BT_PATCH_VER, &btPatchVer); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_FW_VER, &fwVer); - BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], CoexVer/ FwVer/ PatchVer = %d_%x/ 0x%x/ 0x%x(%d)\n", \ + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], CoexVer/ FwVer/ PatchVer = %d_%x/ 0x%x/ 0x%x(%d)\n", GLCoexVerDate8821a2Ant, GLCoexVer8821a2Ant, fwVer, btPatchVer, btPatchVer)); - BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], ****************************************************************\n")); + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], ****************************************************************\n")); + + if (pCoexSta->disVerInfoCnt == 3) + { + //Antenna config to set 0x765 = 0x0 (GNT_BT control by PTA) after initial + RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Set GNT_BT control by PTA\n")); + halbtc8821a2ant_SetAntPath(pBtCoexist, BTC_ANT_WIFI_AT_MAIN, FALSE, FALSE); + } } - halbtc8821a2ant_QueryBtInfo(pBtCoexist); - halbtc8821a2ant_MonitorBtCtr(pBtCoexist); +#if(BT_AUTO_REPORT_ONLY_8821A_2ANT == 0) + halbtc8821a2ant_QueryBtInfo(pBtCoexist); halbtc8821a2ant_MonitorBtEnableDisable(pBtCoexist); +#else + halbtc8821a2ant_MonitorBtCtr(pBtCoexist); + halbtc8821a2ant_MonitorWiFiCtr(pBtCoexist); + + if( halbtc8821a2ant_IsWifiStatusChanged(pBtCoexist) || + pCoexDm->bAutoTdmaAdjust) + { + halbtc8821a2ant_RunCoexistMechanism(pBtCoexist); + } +#endif } diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8821a2Ant.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8821a2Ant.h index 95266a122e8d3d..6b465e33ecd1d5 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8821a2Ant.h +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8821a2Ant.h @@ -1,6 +1,9 @@ //=========================================== // The following is for 8821A 2Ant BT Co-exist definition //=========================================== +#define BT_AUTO_REPORT_ONLY_8821A_2ANT 1 + + #define BT_INFO_8821A_2ANT_B_FTP BIT7 #define BT_INFO_8821A_2ANT_B_A2DP BIT6 #define BT_INFO_8821A_2ANT_B_HID BIT5 @@ -12,6 +15,10 @@ #define BTC_RSSI_COEX_THRESH_TOL_8821A_2ANT 2 + +#define BT_8821A_2ANT_WIFI_RSSI_COEXSWITCH_THRES 42 //WiFi RSSI Threshold for 2-Ant TDMA/1-Ant PS-TDMA translation +#define BT_8821A_2ANT_BT_RSSI_COEXSWITCH_THRES 46 //BT RSSI Threshold for 2-Ant TDMA/1-Ant PS-TDMA translation + typedef enum _BT_INFO_SRC_8821A_2ANT{ BT_INFO_SRC_8821A_2ANT_WIFI_FW = 0x0, BT_INFO_SRC_8821A_2ANT_BT_RSP = 0x1, @@ -20,9 +27,12 @@ typedef enum _BT_INFO_SRC_8821A_2ANT{ }BT_INFO_SRC_8821A_2ANT,*PBT_INFO_SRC_8821A_2ANT; typedef enum _BT_8821A_2ANT_BT_STATUS{ - BT_8821A_2ANT_BT_STATUS_IDLE = 0x0, - BT_8821A_2ANT_BT_STATUS_CONNECTED_IDLE = 0x1, - BT_8821A_2ANT_BT_STATUS_NON_IDLE = 0x2, + BT_8821A_2ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0, + BT_8821A_2ANT_BT_STATUS_CONNECTED_IDLE = 0x1, + BT_8821A_2ANT_BT_STATUS_INQ_PAGE = 0x2, + BT_8821A_2ANT_BT_STATUS_ACL_BUSY = 0x3, + BT_8821A_2ANT_BT_STATUS_SCO_BUSY = 0x4, + BT_8821A_2ANT_BT_STATUS_ACL_SCO_BUSY = 0x5, BT_8821A_2ANT_BT_STATUS_MAX }BT_8821A_2ANT_BT_STATUS,*PBT_8821A_2ANT_BT_STATUS; @@ -43,12 +53,8 @@ typedef enum _BT_8821A_2ANT_COEX_ALGO{ typedef struct _COEX_DM_8821A_2ANT{ // fw mechanism - BOOLEAN bPreDecBtPwr; - BOOLEAN bCurDecBtPwr; - BOOLEAN bPreBtLnaConstrain; - BOOLEAN bCurBtLnaConstrain; - u1Byte bPreBtPsdMode; - u1Byte bCurBtPsdMode; + u1Byte preBtDecPwrLvl; + u1Byte curBtDecPwrLvl; u1Byte preFwDacSwingLvl; u1Byte curFwDacSwingLvl; BOOLEAN bCurIgnoreWlanAct; @@ -58,6 +64,7 @@ typedef struct _COEX_DM_8821A_2ANT{ u1Byte psTdmaPara[5]; u1Byte psTdmaDuAdjType; BOOLEAN bResetTdmaAdjust; + BOOLEAN bAutoTdmaAdjust; BOOLEAN bPrePsTdmaOn; BOOLEAN bCurPsTdmaOn; BOOLEAN bPreBtAutoReport; @@ -92,9 +99,17 @@ typedef struct _COEX_DM_8821A_2ANT{ u1Byte curAlgorithm; u1Byte btStatus; u1Byte wifiChnlInfo[3]; + + BOOLEAN bNeedRecover0x948; + u4Byte backup0x948; + + u1Byte preLps; + u1Byte curLps; + u1Byte preRpwm; + u1Byte curRpwm; } COEX_DM_8821A_2ANT, *PCOEX_DM_8821A_2ANT; -typedef struct _COEX_STA_8821A_2ANT{ +typedef struct _COEX_STA_8821A_2ANT{ BOOLEAN bBtLinkExist; BOOLEAN bScoExist; BOOLEAN bA2dpExist; @@ -108,24 +123,50 @@ typedef struct _COEX_STA_8821A_2ANT{ u4Byte lowPriorityTx; u4Byte lowPriorityRx; u1Byte btRssi; + BOOLEAN bBtTxRxMask; u1Byte preBtRssiState; u1Byte preWifiRssiState[4]; BOOLEAN bC2hBtInfoReqSent; u1Byte btInfoC2h[BT_INFO_SRC_8821A_2ANT_MAX][10]; u4Byte btInfoC2hCnt[BT_INFO_SRC_8821A_2ANT_MAX]; + BOOLEAN bBtWhckTest; BOOLEAN bC2hBtInquiryPage; u1Byte btRetryCnt; u1Byte btInfoExt; + + u4Byte nCRCOK_CCK; + u4Byte nCRCOK_11g; + u4Byte nCRCOK_11n; + u4Byte nCRCOK_11nAgg; + + u4Byte nCRCErr_CCK; + u4Byte nCRCErr_11g; + u4Byte nCRCErr_11n; + u4Byte nCRCErr_11nAgg; + + u1Byte nCoexTableType; + BOOLEAN bForceLpsOn; + + u1Byte disVerInfoCnt; }COEX_STA_8821A_2ANT, *PCOEX_STA_8821A_2ANT; //=========================================== // The following is interface which will notify coex module. //=========================================== VOID -EXhalbtc8821a2ant_InitHwConfig( +EXhalbtc8821a2ant_PowerOnSetting( IN PBTC_COEXIST pBtCoexist ); VOID +EXhalbtc8821a2ant_PreLoadFirmware( + IN PBTC_COEXIST pBtCoexist + ); +VOID +EXhalbtc8821a2ant_InitHwConfig( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bWifiOnly + ); +VOID EXhalbtc8821a2ant_InitCoexDm( IN PBTC_COEXIST pBtCoexist ); @@ -170,6 +211,11 @@ EXhalbtc8821a2ant_HaltNotify( IN PBTC_COEXIST pBtCoexist ); VOID +EXhalbtc8821a2ant_PnpNotify( + IN PBTC_COEXIST pBtCoexist, + IN u1Byte pnpState + ); +VOID EXhalbtc8821a2ant_Periodical( IN PBTC_COEXIST pBtCoexist ); diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8821aCsr2Ant.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8821aCsr2Ant.c new file mode 100644 index 00000000000000..824b8fbb0f694a --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8821aCsr2Ant.c @@ -0,0 +1,4398 @@ +//============================================================ +// Description: +// +// This file is for RTL8821A_CSR Co-exist mechanism +// +// History +// 2012/08/22 Cosa first check in. +// 2012/11/14 Cosa Revise for 8821A_CSR 2Ant out sourcing. +// +//============================================================ + +//============================================================ +// include files +//============================================================ +#include "Mp_Precomp.h" + +#define _BTCOEX_CSR 1 + +#ifndef rtw_warn_on + #define rtw_warn_on(condition) do {} while (0) +#endif + +#if(BT_30_SUPPORT == 1) +//============================================================ +// Global variables, these are static variables +//============================================================ +static COEX_DM_8821A_CSR_2ANT GLCoexDm8821aCsr2Ant; +static PCOEX_DM_8821A_CSR_2ANT pCoexDm=&GLCoexDm8821aCsr2Ant; +static COEX_STA_8821A_CSR_2ANT GLCoexSta8821aCsr2Ant; +static PCOEX_STA_8821A_CSR_2ANT pCoexSta=&GLCoexSta8821aCsr2Ant; + +const char *const GLBtInfoSrc8821aCsr2Ant[]={ + "BT Info[wifi fw]", + "BT Info[bt rsp]", + "BT Info[bt auto report]", +}; + +u4Byte GLCoexVerDate8821aCsr2Ant=20130618; +u4Byte GLCoexVer8821aCsr2Ant=0x5050; + +//============================================================ +// local function proto type if needed +//============================================================ +//============================================================ +// local function start with halbtc8821aCsr2ant_ +//============================================================ +u1Byte +halbtc8821aCsr2ant_BtRssiState( + u1Byte levelNum, + u1Byte rssiThresh, + u1Byte rssiThresh1 + ) +{ + s4Byte btRssi=0; + u1Byte btRssiState=pCoexSta->preBtRssiState; + + btRssi = pCoexSta->btRssi; + + if(levelNum == 2) + { + if( (pCoexSta->preBtRssiState == BTC_RSSI_STATE_LOW) || + (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_LOW)) + { + if(btRssi >= (rssiThresh+BTC_RSSI_COEX_THRESH_TOL_8821A_CSR_2ANT)) + { + btRssiState = BTC_RSSI_STATE_HIGH; + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state switch to High\n")); + } + else + { + btRssiState = BTC_RSSI_STATE_STAY_LOW; + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state stay at Low\n")); + } + } + else + { + if(btRssi < rssiThresh) + { + btRssiState = BTC_RSSI_STATE_LOW; + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state switch to Low\n")); + } + else + { + btRssiState = BTC_RSSI_STATE_STAY_HIGH; + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state stay at High\n")); + } + } + } + else if(levelNum == 3) + { + if(rssiThresh > rssiThresh1) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi thresh error!!\n")); + return pCoexSta->preBtRssiState; + } + + if( (pCoexSta->preBtRssiState == BTC_RSSI_STATE_LOW) || + (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_LOW)) + { + if(btRssi >= (rssiThresh+BTC_RSSI_COEX_THRESH_TOL_8821A_CSR_2ANT)) + { + btRssiState = BTC_RSSI_STATE_MEDIUM; + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state switch to Medium\n")); + } + else + { + btRssiState = BTC_RSSI_STATE_STAY_LOW; + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state stay at Low\n")); + } + } + else if( (pCoexSta->preBtRssiState == BTC_RSSI_STATE_MEDIUM) || + (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_MEDIUM)) + { + if(btRssi >= (rssiThresh1+BTC_RSSI_COEX_THRESH_TOL_8821A_CSR_2ANT)) + { + btRssiState = BTC_RSSI_STATE_HIGH; + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state switch to High\n")); + } + else if(btRssi < rssiThresh) + { + btRssiState = BTC_RSSI_STATE_LOW; + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state switch to Low\n")); + } + else + { + btRssiState = BTC_RSSI_STATE_STAY_MEDIUM; + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state stay at Medium\n")); + } + } + else + { + if(btRssi < rssiThresh1) + { + btRssiState = BTC_RSSI_STATE_MEDIUM; + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state switch to Medium\n")); + } + else + { + btRssiState = BTC_RSSI_STATE_STAY_HIGH; + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state stay at High\n")); + } + } + } + + pCoexSta->preBtRssiState = btRssiState; + + return btRssiState; +} + +u1Byte +halbtc8821aCsr2ant_WifiRssiState( + IN PBTC_COEXIST pBtCoexist, + IN u1Byte index, + IN u1Byte levelNum, + IN u1Byte rssiThresh, + IN u1Byte rssiThresh1 + ) +{ + s4Byte wifiRssi=0; + u1Byte wifiRssiState=pCoexSta->preWifiRssiState[index]; + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_WIFI_RSSI, &wifiRssi); + + if(levelNum == 2) + { + if( (pCoexSta->preWifiRssiState[index] == BTC_RSSI_STATE_LOW) || + (pCoexSta->preWifiRssiState[index] == BTC_RSSI_STATE_STAY_LOW)) + { + if(wifiRssi >= (rssiThresh+BTC_RSSI_COEX_THRESH_TOL_8821A_CSR_2ANT)) + { + wifiRssiState = BTC_RSSI_STATE_HIGH; + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to High\n")); + } + else + { + wifiRssiState = BTC_RSSI_STATE_STAY_LOW; + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state stay at Low\n")); + } + } + else + { + if(wifiRssi < rssiThresh) + { + wifiRssiState = BTC_RSSI_STATE_LOW; + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to Low\n")); + } + else + { + wifiRssiState = BTC_RSSI_STATE_STAY_HIGH; + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state stay at High\n")); + } + } + } + else if(levelNum == 3) + { + if(rssiThresh > rssiThresh1) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI thresh error!!\n")); + return pCoexSta->preWifiRssiState[index]; + } + + if( (pCoexSta->preWifiRssiState[index] == BTC_RSSI_STATE_LOW) || + (pCoexSta->preWifiRssiState[index] == BTC_RSSI_STATE_STAY_LOW)) + { + if(wifiRssi >= (rssiThresh+BTC_RSSI_COEX_THRESH_TOL_8821A_CSR_2ANT)) + { + wifiRssiState = BTC_RSSI_STATE_MEDIUM; + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to Medium\n")); + } + else + { + wifiRssiState = BTC_RSSI_STATE_STAY_LOW; + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state stay at Low\n")); + } + } + else if( (pCoexSta->preWifiRssiState[index] == BTC_RSSI_STATE_MEDIUM) || + (pCoexSta->preWifiRssiState[index] == BTC_RSSI_STATE_STAY_MEDIUM)) + { + if(wifiRssi >= (rssiThresh1+BTC_RSSI_COEX_THRESH_TOL_8821A_CSR_2ANT)) + { + wifiRssiState = BTC_RSSI_STATE_HIGH; + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to High\n")); + } + else if(wifiRssi < rssiThresh) + { + wifiRssiState = BTC_RSSI_STATE_LOW; + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to Low\n")); + } + else + { + wifiRssiState = BTC_RSSI_STATE_STAY_MEDIUM; + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state stay at Medium\n")); + } + } + else + { + if(wifiRssi < rssiThresh1) + { + wifiRssiState = BTC_RSSI_STATE_MEDIUM; + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to Medium\n")); + } + else + { + wifiRssiState = BTC_RSSI_STATE_STAY_HIGH; + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state stay at High\n")); + } + } + } + + pCoexSta->preWifiRssiState[index] = wifiRssiState; + + return wifiRssiState; +} + +VOID +halbtc8821aCsr2ant_MonitorBtEnableDisable( + IN PBTC_COEXIST pBtCoexist + ) +{ + static BOOLEAN bPreBtDisabled=FALSE; + static u4Byte btDisableCnt=0; + BOOLEAN bBtActive=TRUE, bBtDisabled=FALSE; + + // This function check if bt is disabled + + if( pCoexSta->highPriorityTx == 0 && + pCoexSta->highPriorityRx == 0 && + pCoexSta->lowPriorityTx == 0 && + pCoexSta->lowPriorityRx == 0) + { + bBtActive = FALSE; + } + if( pCoexSta->highPriorityTx == 0xffff && + pCoexSta->highPriorityRx == 0xffff && + pCoexSta->lowPriorityTx == 0xffff && + pCoexSta->lowPriorityRx == 0xffff) + { + bBtActive = FALSE; + } + if(bBtActive) + { + btDisableCnt = 0; + bBtDisabled = FALSE; + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_DISABLE, &bBtDisabled); + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], BT is enabled !!\n")); + } + else + { + btDisableCnt++; + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], bt all counters=0, %d times!!\n", + btDisableCnt)); + if(btDisableCnt >= 2) + { + bBtDisabled = TRUE; + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_DISABLE, &bBtDisabled); + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], BT is disabled !!\n")); + } + } + if(bPreBtDisabled != bBtDisabled) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], BT is from %s to %s!!\n", + (bPreBtDisabled ? "disabled":"enabled"), + (bBtDisabled ? "disabled":"enabled"))); + bPreBtDisabled = bBtDisabled; + if(!bBtDisabled) + { + } + else + { + } + } +} + +VOID +halbtc8821aCsr2ant_MonitorBtCtr( + IN PBTC_COEXIST pBtCoexist + ) +{ + u4Byte regHPTxRx, regLPTxRx, u4Tmp; + u4Byte regHPTx=0, regHPRx=0, regLPTx=0, regLPRx=0; + u1Byte u1Tmp; + + regHPTxRx = 0x770; + regLPTxRx = 0x774; + + u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, regHPTxRx); + regHPTx = u4Tmp & bMaskLWord; + regHPRx = (u4Tmp & bMaskHWord)>>16; + + u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, regLPTxRx); + regLPTx = u4Tmp & bMaskLWord; + regLPRx = (u4Tmp & bMaskHWord)>>16; + + pCoexSta->highPriorityTx = regHPTx; + pCoexSta->highPriorityRx = regHPRx; + pCoexSta->lowPriorityTx = regLPTx; + pCoexSta->lowPriorityRx = regLPRx; + + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], High Priority Tx/Rx (reg 0x%x)=0x%x(%d)/0x%x(%d)\n", + regHPTxRx, regHPTx, regHPTx, regHPRx, regHPRx)); + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], Low Priority Tx/Rx (reg 0x%x)=0x%x(%d)/0x%x(%d)\n", + regLPTxRx, regLPTx, regLPTx, regLPRx, regLPRx)); + + // reset counter + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0x5d); +} + +VOID +halbtc8821aCsr2ant_UpdateRaMask( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bForceExec, + IN u4Byte disRateMask + ) +{ + pCoexDm->curRaMask = disRateMask; + + if( bForceExec || (pCoexDm->preRaMask != pCoexDm->curRaMask)) + { + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_UPDATE_RAMASK, &pCoexDm->curRaMask); + } + pCoexDm->preRaMask = pCoexDm->curRaMask; +} + +VOID +halbtc8821aCsr2ant_AutoRateFallbackRetry( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bForceExec, + IN u1Byte type + ) +{ + BOOLEAN bWifiUnderBMode=FALSE; + + pCoexDm->curArfrType = type; + + if( bForceExec || (pCoexDm->preArfrType != pCoexDm->curArfrType)) + { + switch(pCoexDm->curArfrType) + { + case 0: // normal mode + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x430, pCoexDm->backupArfrCnt1); + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x434, pCoexDm->backupArfrCnt2); + break; + case 1: + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &bWifiUnderBMode); + if(bWifiUnderBMode) + { + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x430, 0x0); + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x434, 0x01010101); + } + else + { + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x430, 0x0); + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x434, 0x04030201); + } + break; + default: + break; + } + } + + pCoexDm->preArfrType = pCoexDm->curArfrType; +} + +VOID +halbtc8821aCsr2ant_RetryLimit( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bForceExec, + IN u1Byte type + ) +{ + pCoexDm->curRetryLimitType = type; + + if( bForceExec || (pCoexDm->preRetryLimitType != pCoexDm->curRetryLimitType)) + { + switch(pCoexDm->curRetryLimitType) + { + case 0: // normal mode + pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x42a, pCoexDm->backupRetryLimit); + break; + case 1: // retry limit=8 + pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x42a, 0x0808); + break; + default: + break; + } + } + + pCoexDm->preRetryLimitType = pCoexDm->curRetryLimitType; +} + +VOID +halbtc8821aCsr2ant_AmpduMaxTime( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bForceExec, + IN u1Byte type + ) +{ + pCoexDm->curAmpduTimeType = type; + + if( bForceExec || (pCoexDm->preAmpduTimeType != pCoexDm->curAmpduTimeType)) + { + switch(pCoexDm->curAmpduTimeType) + { + case 0: // normal mode + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x456, pCoexDm->backupAmpduMaxTime); + break; + case 1: // AMPDU timw = 0x38 * 32us + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x456, 0x38); + break; + case 2: + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x456, 0x17); + break; + default: + break; + } + } + + pCoexDm->preAmpduTimeType = pCoexDm->curAmpduTimeType; +} + +VOID +halbtc8821aCsr2Ant_AmpduMaxNum( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bForceExec, + IN u1Byte type + ) +{ + pCoexDm->curAmpduNumType = type; + + if( bForceExec || (pCoexDm->preAmpduNumType != pCoexDm->curAmpduNumType)) + { + switch(pCoexDm->curAmpduNumType) + { + case 0: // normal mode + pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x4ca, pCoexDm->backupAmpduMaxNum); + break; + case 1: + pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x4ca, 0x0808); + break; + case 2: + pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x4ca, 0x1f1f); + break; + default: + break; + } + } + + pCoexDm->preAmpduNumType = pCoexDm->curAmpduNumType; + +} + +VOID +halbtc8821aCsr2ant_LimitedTx( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bForceExec, + IN u1Byte raMaskType, + IN u1Byte arfrType, + IN u1Byte retryLimitType, + IN u1Byte ampduTimeType, + IN u1Byte ampduNumType + ) +{ + switch(raMaskType) + { + case 0: // normal mode + halbtc8821aCsr2ant_UpdateRaMask(pBtCoexist, bForceExec, 0x0); + break; + case 1: // disable cck 1/2 + halbtc8821aCsr2ant_UpdateRaMask(pBtCoexist, bForceExec, 0x00000003); + break; + case 2: // disable cck 1/2/5.5, ofdm 6/9/12/18/24, mcs 0/1/2/3/4 + halbtc8821aCsr2ant_UpdateRaMask(pBtCoexist, bForceExec, 0x0001f1f7); + break; + default: + break; + } + + halbtc8821aCsr2ant_AutoRateFallbackRetry(pBtCoexist, bForceExec, arfrType); + halbtc8821aCsr2ant_RetryLimit(pBtCoexist, bForceExec, retryLimitType); + halbtc8821aCsr2ant_AmpduMaxTime(pBtCoexist, bForceExec, ampduTimeType); + halbtc8821aCsr2Ant_AmpduMaxNum(pBtCoexist, bForceExec, ampduNumType); +} + + + +VOID +halbtc8821aCsr2ant_LimitedRx( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bForceExec, + IN BOOLEAN bRejApAggPkt, + IN BOOLEAN bBtCtrlAggBufSize, + IN u1Byte aggBufSize + ) +{ + BOOLEAN bRejectRxAgg=bRejApAggPkt; + BOOLEAN bBtCtrlRxAggSize=bBtCtrlAggBufSize; + u1Byte rxAggSize=aggBufSize; + + //============================================ + // Rx Aggregation related setting + //============================================ + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_TO_REJ_AP_AGG_PKT, &bRejectRxAgg); + // decide BT control aggregation buf size or not + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_CTRL_AGG_SIZE, &bBtCtrlRxAggSize); + // aggregation buf size, only work when BT control Rx aggregation size. + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_U1_AGG_BUF_SIZE, &rxAggSize); + // real update aggregation setting + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_AGGREGATE_CTRL, NULL); +} + +VOID +halbtc8821aCsr2ant_QueryBtInfo( + IN PBTC_COEXIST pBtCoexist + ) +{ + u1Byte H2C_Parameter[1] ={0}; + + pCoexSta->bC2hBtInfoReqSent = TRUE; + + H2C_Parameter[0] |= BIT0; // trigger + + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], Query Bt Info, FW write 0x61=0x%x\n", + H2C_Parameter[0])); + + rtw_warn_on(_BTCOEX_CSR); + pBtCoexist->fBtcFillH2c(pBtCoexist, 0x61, 1, H2C_Parameter); +} + +u1Byte +halbtc8821aCsr2ant_ActionAlgorithm( + IN PBTC_COEXIST pBtCoexist + ) +{ + PBTC_STACK_INFO pStackInfo=&pBtCoexist->stackInfo; + BOOLEAN bBtHsOn=FALSE; + u1Byte algorithm=BT_8821A_CSR_2ANT_COEX_ALGO_UNDEFINED; + u1Byte numOfDiffProfile=0; + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); + + //sync StackInfo with BT firmware and stack + pStackInfo->bHidExist = pCoexSta->bHidExist; + pStackInfo->bBtLinkExist = pCoexSta->bBtLinkExist; + pStackInfo->bScoExist = pCoexSta->bScoExist; + pStackInfo->bPanExist = pCoexSta->bPanExist; + pStackInfo->bA2dpExist = pCoexSta->bA2dpExist; + + if(!pStackInfo->bBtLinkExist) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], No profile exists!!!\n")); + return algorithm; + } + + if(pStackInfo->bScoExist) + numOfDiffProfile++; + if(pStackInfo->bHidExist) + numOfDiffProfile++; + if(pStackInfo->bPanExist) + numOfDiffProfile++; + if(pStackInfo->bA2dpExist) + numOfDiffProfile++; + + if(numOfDiffProfile == 1) + { + if(pStackInfo->bScoExist) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO only\n")); + algorithm = BT_8821A_CSR_2ANT_COEX_ALGO_SCO; + } + else + { + if(pStackInfo->bHidExist) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], HID only\n")); + algorithm = BT_8821A_CSR_2ANT_COEX_ALGO_HID; + } + else if(pStackInfo->bA2dpExist) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], A2DP only\n")); + algorithm = BT_8821A_CSR_2ANT_COEX_ALGO_A2DP; + } + else if(pStackInfo->bPanExist) + { + if(bBtHsOn) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], PAN(HS) only\n")); + algorithm = BT_8821A_CSR_2ANT_COEX_ALGO_PANHS; + } + else + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], PAN(EDR) only\n")); + algorithm = BT_8821A_CSR_2ANT_COEX_ALGO_PANEDR; + } + } + } + } + else if(numOfDiffProfile == 2) + { + if(pStackInfo->bScoExist) + { + if(pStackInfo->bHidExist) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + HID\n")); + algorithm = BT_8821A_CSR_2ANT_COEX_ALGO_PANEDR_HID; + } + else if(pStackInfo->bA2dpExist) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + A2DP ==> SCO\n")); + algorithm = BT_8821A_CSR_2ANT_COEX_ALGO_PANEDR_HID; + } + else if(pStackInfo->bPanExist) + { + if(bBtHsOn) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + PAN(HS)\n")); + algorithm = BT_8821A_CSR_2ANT_COEX_ALGO_SCO; + } + else + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + PAN(EDR)\n")); + algorithm = BT_8821A_CSR_2ANT_COEX_ALGO_PANEDR_HID; + } + } + } + else + { + if( pStackInfo->bHidExist && + pStackInfo->bA2dpExist ) + { + if(pStackInfo->numOfHid >= 2) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], HID*2 + A2DP\n")); + algorithm = BT_8821A_CSR_2ANT_COEX_ALGO_HID_A2DP_PANEDR; + } + else + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], HID + A2DP\n")); + algorithm = BT_8821A_CSR_2ANT_COEX_ALGO_HID_A2DP; + } + } + else if( pStackInfo->bHidExist && + pStackInfo->bPanExist ) + { + if(bBtHsOn) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], HID + PAN(HS)\n")); + algorithm = BT_8821A_CSR_2ANT_COEX_ALGO_HID; + } + else + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], HID + PAN(EDR)\n")); + algorithm = BT_8821A_CSR_2ANT_COEX_ALGO_PANEDR_HID; + } + } + else if( pStackInfo->bPanExist && + pStackInfo->bA2dpExist ) + { + if(bBtHsOn) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], A2DP + PAN(HS)\n")); + algorithm = BT_8821A_CSR_2ANT_COEX_ALGO_A2DP_PANHS; + } + else + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], A2DP + PAN(EDR)\n")); + algorithm = BT_8821A_CSR_2ANT_COEX_ALGO_PANEDR_A2DP; + } + } + } + } + else if(numOfDiffProfile == 3) + { + if(pStackInfo->bScoExist) + { + if( pStackInfo->bHidExist && + pStackInfo->bA2dpExist ) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + HID + A2DP ==> HID\n")); + algorithm = BT_8821A_CSR_2ANT_COEX_ALGO_PANEDR_HID; + } + else if( pStackInfo->bHidExist && + pStackInfo->bPanExist ) + { + if(bBtHsOn) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + HID + PAN(HS)\n")); + algorithm = BT_8821A_CSR_2ANT_COEX_ALGO_PANEDR_HID; + } + else + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + HID + PAN(EDR)\n")); + algorithm = BT_8821A_CSR_2ANT_COEX_ALGO_PANEDR_HID; + } + } + else if( pStackInfo->bPanExist && + pStackInfo->bA2dpExist ) + { + if(bBtHsOn) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + A2DP + PAN(HS)\n")); + algorithm = BT_8821A_CSR_2ANT_COEX_ALGO_PANEDR_HID; + } + else + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + A2DP + PAN(EDR) ==> HID\n")); + algorithm = BT_8821A_CSR_2ANT_COEX_ALGO_PANEDR_HID; + } + } + } + else + { + if( pStackInfo->bHidExist && + pStackInfo->bPanExist && + pStackInfo->bA2dpExist ) + { + if(bBtHsOn) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], HID + A2DP + PAN(HS)\n")); + algorithm = BT_8821A_CSR_2ANT_COEX_ALGO_HID_A2DP; + } + else + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], HID + A2DP + PAN(EDR)\n")); + algorithm = BT_8821A_CSR_2ANT_COEX_ALGO_HID_A2DP_PANEDR; + } + } + } + } + else if(numOfDiffProfile >= 3) + { + if(pStackInfo->bScoExist) + { + if( pStackInfo->bHidExist && + pStackInfo->bPanExist && + pStackInfo->bA2dpExist ) + { + if(bBtHsOn) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Error!!! SCO + HID + A2DP + PAN(HS)\n")); + + } + else + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + HID + A2DP + PAN(EDR)==>PAN(EDR)+HID\n")); + algorithm = BT_8821A_CSR_2ANT_COEX_ALGO_PANEDR_HID; + } + } + } + } + + return algorithm; +} + +BOOLEAN +halbtc8821aCsr2ant_NeedToDecBtPwr( + IN PBTC_COEXIST pBtCoexist + ) +{ + BOOLEAN bRet=FALSE; + BOOLEAN bBtHsOn=FALSE, bWifiConnected=FALSE; + s4Byte btHsRssi=0; + u1Byte btRssiState; + + if(!pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn)) + return FALSE; + if(!pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected)) + return FALSE; + if(!pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_HS_RSSI, &btHsRssi)) + return FALSE; + + btRssiState = halbtc8821aCsr2ant_BtRssiState(2, 35, 0); + + if(bWifiConnected) + { + if(bBtHsOn) + { + if(btHsRssi > 37) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], Need to decrease bt power for HS mode!!\n")); + bRet = TRUE; + } + } + else + { + if( (btRssiState == BTC_RSSI_STATE_HIGH) || + (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], Need to decrease bt power for Wifi is connected!!\n")); + bRet = TRUE; + } + } + } + + return bRet; +} + +VOID +halbtc8821aCsr2ant_SetFwDacSwingLevel( + IN PBTC_COEXIST pBtCoexist, + IN u1Byte dacSwingLvl + ) +{ + u1Byte H2C_Parameter[1] ={0}; + + // There are several type of dacswing + // 0x18/ 0x10/ 0xc/ 0x8/ 0x4/ 0x6 + H2C_Parameter[0] = dacSwingLvl; + + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], Set Dac Swing Level=0x%x\n", dacSwingLvl)); + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], FW write 0x64=0x%x\n", H2C_Parameter[0])); + + pBtCoexist->fBtcFillH2c(pBtCoexist, 0x64, 1, H2C_Parameter); +} + +VOID +halbtc8821aCsr2ant_SetFwDecBtPwr( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bDecBtPwr + ) +{ + u1Byte H2C_Parameter[1] ={0}; + + H2C_Parameter[0] = 0; + + if(bDecBtPwr) + { + H2C_Parameter[0] |= BIT1; + } + + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], decrease Bt Power : %s, FW write 0x62=0x%x\n", + (bDecBtPwr? "Yes!!":"No!!"), H2C_Parameter[0])); + + rtw_warn_on(_BTCOEX_CSR); + pBtCoexist->fBtcFillH2c(pBtCoexist, 0x62, 1, H2C_Parameter); +} + +VOID +halbtc8821aCsr2ant_DecBtPwr( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bForceExec, + IN BOOLEAN bDecBtPwr + ) +{ + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], %s Dec BT power = %s\n", + (bForceExec? "force to":""), ((bDecBtPwr)? "ON":"OFF"))); + pCoexDm->bCurDecBtPwr = bDecBtPwr; + + if(!bForceExec) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], bPreDecBtPwr=%d, bCurDecBtPwr=%d\n", + pCoexDm->bPreDecBtPwr, pCoexDm->bCurDecBtPwr)); + + if(pCoexDm->bPreDecBtPwr == pCoexDm->bCurDecBtPwr) + return; + } + + /* TODO: may CSR consider to decrease BT power? */ + //halbtc8821aCsr2ant_SetFwDecBtPwr(pBtCoexist, pCoexDm->bCurDecBtPwr); + + pCoexDm->bPreDecBtPwr = pCoexDm->bCurDecBtPwr; +} + +VOID +halbtc8821aCsr2ant_SetBtAutoReport( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bEnableAutoReport + ) +{ + u1Byte H2C_Parameter[1] ={0}; + + H2C_Parameter[0] = 0; + + if(bEnableAutoReport) + { + H2C_Parameter[0] |= BIT0; + } + + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], BT FW auto report : %s, FW write 0x68=0x%x\n", + (bEnableAutoReport? "Enabled!!":"Disabled!!"), H2C_Parameter[0])); + + rtw_warn_on(_BTCOEX_CSR); + pBtCoexist->fBtcFillH2c(pBtCoexist, 0x68, 1, H2C_Parameter); +} + +VOID +halbtc8821aCsr2ant_BtAutoReport( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bForceExec, + IN BOOLEAN bEnableAutoReport + ) +{ + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], %s BT Auto report = %s\n", + (bForceExec? "force to":""), ((bEnableAutoReport)? "Enabled":"Disabled"))); + pCoexDm->bCurBtAutoReport = bEnableAutoReport; + + if(!bForceExec) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], bPreBtAutoReport=%d, bCurBtAutoReport=%d\n", + pCoexDm->bPreBtAutoReport, pCoexDm->bCurBtAutoReport)); + + if(pCoexDm->bPreBtAutoReport == pCoexDm->bCurBtAutoReport) + return; + } + //halbtc8821aCsr2ant_SetBtAutoReport(pBtCoexist, pCoexDm->bCurBtAutoReport); + + pCoexDm->bPreBtAutoReport = pCoexDm->bCurBtAutoReport; +} + +VOID +halbtc8821aCsr2ant_FwDacSwingLvl( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bForceExec, + IN u1Byte fwDacSwingLvl + ) +{ + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], %s set FW Dac Swing level = %d\n", + (bForceExec? "force to":""), fwDacSwingLvl)); + pCoexDm->curFwDacSwingLvl = fwDacSwingLvl; + + if(!bForceExec) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], preFwDacSwingLvl=%d, curFwDacSwingLvl=%d\n", + pCoexDm->preFwDacSwingLvl, pCoexDm->curFwDacSwingLvl)); + + if(pCoexDm->preFwDacSwingLvl == pCoexDm->curFwDacSwingLvl) + return; + } + + halbtc8821aCsr2ant_SetFwDacSwingLevel(pBtCoexist, pCoexDm->curFwDacSwingLvl); + + pCoexDm->preFwDacSwingLvl = pCoexDm->curFwDacSwingLvl; +} + +VOID +halbtc8821aCsr2ant_SetSwRfRxLpfCorner( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bRxRfShrinkOn + ) +{ + if(bRxRfShrinkOn) + { + //Shrink RF Rx LPF corner + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Shrink RF Rx LPF corner!!\n")); + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1e, 0xfffff, 0xffffc); + } + else + { + //Resume RF Rx LPF corner + // After initialized, we can use pCoexDm->btRf0x1eBackup + if(pBtCoexist->bInitilized) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Resume RF Rx LPF corner!!\n")); + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1e, 0xfffff, pCoexDm->btRf0x1eBackup); + } + } +} + +VOID +halbtc8821aCsr2ant_RfShrink( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bForceExec, + IN BOOLEAN bRxRfShrinkOn + ) +{ + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW, ("[BTCoex], %s turn Rx RF Shrink = %s\n", + (bForceExec? "force to":""), ((bRxRfShrinkOn)? "ON":"OFF"))); + pCoexDm->bCurRfRxLpfShrink = bRxRfShrinkOn; + + if(!bForceExec) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_DETAIL, ("[BTCoex], bPreRfRxLpfShrink=%d, bCurRfRxLpfShrink=%d\n", + pCoexDm->bPreRfRxLpfShrink, pCoexDm->bCurRfRxLpfShrink)); + + if(pCoexDm->bPreRfRxLpfShrink == pCoexDm->bCurRfRxLpfShrink) + return; + } + halbtc8821aCsr2ant_SetSwRfRxLpfCorner(pBtCoexist, pCoexDm->bCurRfRxLpfShrink); + + pCoexDm->bPreRfRxLpfShrink = pCoexDm->bCurRfRxLpfShrink; +} + +VOID +halbtc8821aCsr2ant_SetSwPenaltyTxRateAdaptive( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bLowPenaltyRa + ) +{ + u1Byte H2C_Parameter[6] ={0}; + + H2C_Parameter[0] = 0x6; // opCode, 0x6= Retry_Penalty + + if(bLowPenaltyRa) + { + H2C_Parameter[1] |= BIT0; + H2C_Parameter[2] = 0x00; //normal rate except MCS7/6/5, OFDM54/48/36 + H2C_Parameter[3] = 0xf7; //MCS7 or OFDM54 + H2C_Parameter[4] = 0xf8; //MCS6 or OFDM48 + H2C_Parameter[5] = 0xf9; //MCS5 or OFDM36 + } + + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], set WiFi Low-Penalty Retry: %s", + (bLowPenaltyRa? "ON!!":"OFF!!") )); + + pBtCoexist->fBtcFillH2c(pBtCoexist, 0x69, 6, H2C_Parameter); +} + +VOID +halbtc8821aCsr2ant_LowPenaltyRa( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bForceExec, + IN BOOLEAN bLowPenaltyRa + ) +{ + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW, ("[BTCoex], %s turn LowPenaltyRA = %s\n", + (bForceExec? "force to":""), ((bLowPenaltyRa)? "ON":"OFF"))); + pCoexDm->bCurLowPenaltyRa = bLowPenaltyRa; + + if(!bForceExec) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_DETAIL, ("[BTCoex], bPreLowPenaltyRa=%d, bCurLowPenaltyRa=%d\n", + pCoexDm->bPreLowPenaltyRa, pCoexDm->bCurLowPenaltyRa)); + + if(pCoexDm->bPreLowPenaltyRa == pCoexDm->bCurLowPenaltyRa) + return; + } + halbtc8821aCsr2ant_SetSwPenaltyTxRateAdaptive(pBtCoexist, pCoexDm->bCurLowPenaltyRa); + + pCoexDm->bPreLowPenaltyRa = pCoexDm->bCurLowPenaltyRa; +} + +VOID +halbtc8821aCsr2ant_SetDacSwingReg( + IN PBTC_COEXIST pBtCoexist, + IN u4Byte level + ) +{ + u1Byte val=(u1Byte)level; + + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Write SwDacSwing = 0x%x\n", level)); + pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0xc5b, 0x3e, val); +} + +VOID +halbtc8821aCsr2ant_SetSwFullTimeDacSwing( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bSwDacSwingOn, + IN u4Byte swDacSwingLvl + ) +{ + if(bSwDacSwingOn) + { + halbtc8821aCsr2ant_SetDacSwingReg(pBtCoexist, swDacSwingLvl); + } + else + { + halbtc8821aCsr2ant_SetDacSwingReg(pBtCoexist, 0x18); + } +} + + +VOID +halbtc8821aCsr2ant_DacSwing( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bForceExec, + IN BOOLEAN bDacSwingOn, + IN u4Byte dacSwingLvl + ) +{ + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW, ("[BTCoex], %s turn DacSwing=%s, dacSwingLvl=0x%x\n", + (bForceExec? "force to":""), ((bDacSwingOn)? "ON":"OFF"), dacSwingLvl)); + pCoexDm->bCurDacSwingOn = bDacSwingOn; + pCoexDm->curDacSwingLvl = dacSwingLvl; + + if(!bForceExec) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_DETAIL, ("[BTCoex], bPreDacSwingOn=%d, preDacSwingLvl=0x%x, bCurDacSwingOn=%d, curDacSwingLvl=0x%x\n", + pCoexDm->bPreDacSwingOn, pCoexDm->preDacSwingLvl, + pCoexDm->bCurDacSwingOn, pCoexDm->curDacSwingLvl)); + + if( (pCoexDm->bPreDacSwingOn == pCoexDm->bCurDacSwingOn) && + (pCoexDm->preDacSwingLvl == pCoexDm->curDacSwingLvl) ) + return; + } + delay_ms(30); + halbtc8821aCsr2ant_SetSwFullTimeDacSwing(pBtCoexist, bDacSwingOn, dacSwingLvl); + + pCoexDm->bPreDacSwingOn = pCoexDm->bCurDacSwingOn; + pCoexDm->preDacSwingLvl = pCoexDm->curDacSwingLvl; +} + +VOID +halbtc8821aCsr2ant_SetAdcBackOff( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bAdcBackOff + ) +{ + if(bAdcBackOff) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], BB BackOff Level On!\n")); + pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x8db, 0x60, 0x3); + } + else + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], BB BackOff Level Off!\n")); + pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x8db, 0x60, 0x1); + } +} + +VOID +halbtc8821aCsr2ant_AdcBackOff( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bForceExec, + IN BOOLEAN bAdcBackOff + ) +{ + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW, ("[BTCoex], %s turn AdcBackOff = %s\n", + (bForceExec? "force to":""), ((bAdcBackOff)? "ON":"OFF"))); + pCoexDm->bCurAdcBackOff = bAdcBackOff; + + if(!bForceExec) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_DETAIL, ("[BTCoex], bPreAdcBackOff=%d, bCurAdcBackOff=%d\n", + pCoexDm->bPreAdcBackOff, pCoexDm->bCurAdcBackOff)); + + if(pCoexDm->bPreAdcBackOff == pCoexDm->bCurAdcBackOff) + return; + } + halbtc8821aCsr2ant_SetAdcBackOff(pBtCoexist, pCoexDm->bCurAdcBackOff); + + pCoexDm->bPreAdcBackOff = pCoexDm->bCurAdcBackOff; +} + +VOID +halbtc8821aCsr2ant_SetAgcTable( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bAgcTableEn + ) +{ + u1Byte rssiAdjustVal=0; + + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0xef, 0xfffff, 0x02000); + if(bAgcTableEn) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Agc Table On!\n")); + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x3b, 0xfffff, 0x28F4B); + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x3b, 0xfffff, 0x10AB2); + rssiAdjustVal = 8; + } + else + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Agc Table Off!\n")); + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x3b, 0xfffff, 0x2884B); + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x3b, 0xfffff, 0x104B2); + } + pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0xef, 0xfffff, 0x0); + + // set rssiAdjustVal for wifi module. + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_U1_RSSI_ADJ_VAL_FOR_AGC_TABLE_ON, &rssiAdjustVal); +} + +VOID +halbtc8821aCsr2ant_AgcTable( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bForceExec, + IN BOOLEAN bAgcTableEn + ) +{ + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW, ("[BTCoex], %s %s Agc Table\n", + (bForceExec? "force to":""), ((bAgcTableEn)? "Enable":"Disable"))); + pCoexDm->bCurAgcTableEn = bAgcTableEn; + + if(!bForceExec) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_DETAIL, ("[BTCoex], bPreAgcTableEn=%d, bCurAgcTableEn=%d\n", + pCoexDm->bPreAgcTableEn, pCoexDm->bCurAgcTableEn)); + + if(pCoexDm->bPreAgcTableEn == pCoexDm->bCurAgcTableEn) + return; + } + halbtc8821aCsr2ant_SetAgcTable(pBtCoexist, bAgcTableEn); + + pCoexDm->bPreAgcTableEn = pCoexDm->bCurAgcTableEn; +} + +VOID +halbtc8821aCsr2ant_SetCoexTable( + IN PBTC_COEXIST pBtCoexist, + IN u4Byte val0x6c0, + IN u4Byte val0x6c4, + IN u4Byte val0x6c8, + IN u1Byte val0x6cc + ) +{ + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], set coex table, set 0x6c0=0x%x\n", val0x6c0)); + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c0, val0x6c0); + + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], set coex table, set 0x6c4=0x%x\n", val0x6c4)); + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c4, val0x6c4); + + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], set coex table, set 0x6c8=0x%x\n", val0x6c8)); + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c8, val0x6c8); + + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], set coex table, set 0x6cc=0x%x\n", val0x6cc)); + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cc, val0x6cc); +} + +VOID +halbtc8821aCsr2ant_CoexTable( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bForceExec, + IN u4Byte val0x6c0, + IN u4Byte val0x6c4, + IN u4Byte val0x6c8, + IN u1Byte val0x6cc + ) +{ + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW, ("[BTCoex], %s write Coex Table 0x6c0=0x%x, 0x6c4=0x%x, 0x6c8=0x%x, 0x6cc=0x%x\n", + (bForceExec? "force to":""), val0x6c0, val0x6c4, val0x6c8, val0x6cc)); + pCoexDm->curVal0x6c0 = val0x6c0; + pCoexDm->curVal0x6c4 = val0x6c4; + pCoexDm->curVal0x6c8 = val0x6c8; + pCoexDm->curVal0x6cc = val0x6cc; + + if(!bForceExec) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_DETAIL, ("[BTCoex], preVal0x6c0=0x%x, preVal0x6c4=0x%x, preVal0x6c8=0x%x, preVal0x6cc=0x%x !!\n", + pCoexDm->preVal0x6c0, pCoexDm->preVal0x6c4, pCoexDm->preVal0x6c8, pCoexDm->preVal0x6cc)); + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_DETAIL, ("[BTCoex], curVal0x6c0=0x%x, curVal0x6c4=0x%x, curVal0x6c8=0x%x, curVal0x6cc=0x%x !!\n", + pCoexDm->curVal0x6c0, pCoexDm->curVal0x6c4, pCoexDm->curVal0x6c8, pCoexDm->curVal0x6cc)); + + if( (pCoexDm->preVal0x6c0 == pCoexDm->curVal0x6c0) && + (pCoexDm->preVal0x6c4 == pCoexDm->curVal0x6c4) && + (pCoexDm->preVal0x6c8 == pCoexDm->curVal0x6c8) && + (pCoexDm->preVal0x6cc == pCoexDm->curVal0x6cc) ) + return; + } + halbtc8821aCsr2ant_SetCoexTable(pBtCoexist, val0x6c0, val0x6c4, val0x6c8, val0x6cc); + + pCoexDm->preVal0x6c0 = pCoexDm->curVal0x6c0; + pCoexDm->preVal0x6c4 = pCoexDm->curVal0x6c4; + pCoexDm->preVal0x6c8 = pCoexDm->curVal0x6c8; + pCoexDm->preVal0x6cc = pCoexDm->curVal0x6cc; +} + +VOID +halbtc8821aCsr2ant_SetFwIgnoreWlanAct( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bEnable + ) +{ + u1Byte H2C_Parameter[1] ={0}; + + if(bEnable) + { + H2C_Parameter[0] |= BIT0; // function enable + } + + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], set FW for BT Ignore Wlan_Act, FW write 0x63=0x%x\n", + H2C_Parameter[0])); + + rtw_warn_on(_BTCOEX_CSR); + pBtCoexist->fBtcFillH2c(pBtCoexist, 0x63, 1, H2C_Parameter); +} + +VOID +halbtc8821aCsr2ant_IgnoreWlanAct( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bForceExec, + IN BOOLEAN bEnable + ) +{ + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], %s turn Ignore WlanAct %s\n", + (bForceExec? "force to":""), (bEnable? "ON":"OFF"))); + pCoexDm->bCurIgnoreWlanAct = bEnable; + + if(!bForceExec) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], bPreIgnoreWlanAct = %d, bCurIgnoreWlanAct = %d!!\n", + pCoexDm->bPreIgnoreWlanAct, pCoexDm->bCurIgnoreWlanAct)); + + if(pCoexDm->bPreIgnoreWlanAct == pCoexDm->bCurIgnoreWlanAct) + return; + } + //halbtc8821aCsr2ant_SetFwIgnoreWlanAct(pBtCoexist, bEnable); + + pCoexDm->bPreIgnoreWlanAct = pCoexDm->bCurIgnoreWlanAct; +} + +VOID +halbtc8821aCsr2ant_SetFwPstdma( + IN PBTC_COEXIST pBtCoexist, + IN u1Byte byte1, + IN u1Byte byte2, + IN u1Byte byte3, + IN u1Byte byte4, + IN u1Byte byte5 + ) +{ + u1Byte H2C_Parameter[6] ={0}; + + H2C_Parameter[0] = byte1; + H2C_Parameter[1] = byte2; + H2C_Parameter[2] = byte3; + H2C_Parameter[3] = byte4; + H2C_Parameter[4] = byte5; + H2C_Parameter[5] = 0x01; + + pCoexDm->psTdmaPara[0] = byte1; + pCoexDm->psTdmaPara[1] = byte2; + pCoexDm->psTdmaPara[2] = byte3; + pCoexDm->psTdmaPara[3] = byte4; + pCoexDm->psTdmaPara[4] = byte5; + pCoexDm->psTdmaPara[5] = 0x01; + + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], FW write 0x60(6bytes)=0x%x%08x%02x\n", + H2C_Parameter[0], + H2C_Parameter[1]<<24|H2C_Parameter[2]<<16|H2C_Parameter[3]<<8|H2C_Parameter[4], H2C_Parameter[5])); + + pBtCoexist->fBtcFillH2c(pBtCoexist, 0x60, 6, H2C_Parameter); +} + +VOID +halbtc8821aCsr2ant_SwMechanism1( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bShrinkRxLPF, + IN BOOLEAN bLowPenaltyRA, + IN BOOLEAN bLimitedDIG, + IN BOOLEAN bBTLNAConstrain + ) +{ + u4Byte wifiBw; + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); + + if(BTC_WIFI_BW_HT40 != wifiBw) //only shrink RF Rx LPF for HT40 + { + if (bShrinkRxLPF) + bShrinkRxLPF = FALSE; + } + + halbtc8821aCsr2ant_RfShrink(pBtCoexist, NORMAL_EXEC, bShrinkRxLPF); + halbtc8821aCsr2ant_LowPenaltyRa(pBtCoexist, NORMAL_EXEC, bLowPenaltyRA); + + //no limited DIG + //halbtc8821aCsr2ant_SetBtLnaConstrain(pBtCoexist, NORMAL_EXEC, bBTLNAConstrain); +} + +VOID +halbtc8821aCsr2ant_SwMechanism2( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bAGCTableShift, + IN BOOLEAN bADCBackOff, + IN BOOLEAN bSWDACSwing, + IN u4Byte dacSwingLvl + ) +{ + //halbtc8821aCsr2ant_AgcTable(pBtCoexist, NORMAL_EXEC, bAGCTableShift); + halbtc8821aCsr2ant_AdcBackOff(pBtCoexist, NORMAL_EXEC, bADCBackOff); + halbtc8821aCsr2ant_DacSwing(pBtCoexist, NORMAL_EXEC, bSWDACSwing, dacSwingLvl); +} + +VOID +halbtc8821aCsr2ant_SetAntPath( + IN PBTC_COEXIST pBtCoexist, + IN u1Byte antPosType, + IN BOOLEAN bInitHwCfg, + IN BOOLEAN bWifiOff + ) +{ + PBTC_BOARD_INFO pBoardInfo=&pBtCoexist->boardInfo; + u4Byte u4Tmp=0; + u1Byte H2C_Parameter[2] ={0}; + + if(bInitHwCfg) + { + // 0x4c[23]=0, 0x4c[24]=1 Antenna control by WL/BT + u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x4c); + u4Tmp &=~BIT23; + u4Tmp |= BIT24; + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x4c, u4Tmp); + + pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x974, 0x3ff); + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0xcb4, 0x77); + + if(pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) + { + //tell firmware "antenna inverse" ==> WRONG firmware antenna control code.==>need fw to fix + H2C_Parameter[0] = 1; + H2C_Parameter[1] = 1; + pBtCoexist->fBtcFillH2c(pBtCoexist, 0x65, 2, H2C_Parameter); + } + else + { + //tell firmware "no antenna inverse" ==> WRONG firmware antenna control code.==>need fw to fix + H2C_Parameter[0] = 0; + H2C_Parameter[1] = 1; + pBtCoexist->fBtcFillH2c(pBtCoexist, 0x65, 2, H2C_Parameter); + } + } + + // ext switch setting + switch(antPosType) + { + case BTC_ANT_WIFI_AT_MAIN: + pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0xcb7, 0x30, 0x1); + break; + case BTC_ANT_WIFI_AT_AUX: + pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0xcb7, 0x30, 0x2); + break; + } +} + +VOID +halbtc8821aCsr2ant_PsTdma( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bForceExec, + IN BOOLEAN bTurnOn, + IN u1Byte type + ) +{ + BOOLEAN bTurnOnByCnt=FALSE; + u1Byte psTdmaTypeByCnt=0; + + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], %s turn %s PS TDMA, type=%d\n", + (bForceExec? "force to":""), (bTurnOn? "ON":"OFF"), type)); + pCoexDm->bCurPsTdmaOn = bTurnOn; + pCoexDm->curPsTdma = type; + + if(!bForceExec) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], bPrePsTdmaOn = %d, bCurPsTdmaOn = %d!!\n", + pCoexDm->bPrePsTdmaOn, pCoexDm->bCurPsTdmaOn)); + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], prePsTdma = %d, curPsTdma = %d!!\n", + pCoexDm->prePsTdma, pCoexDm->curPsTdma)); + + if( (pCoexDm->bPrePsTdmaOn == pCoexDm->bCurPsTdmaOn) && + (pCoexDm->prePsTdma == pCoexDm->curPsTdma) ) + return; + } + if(bTurnOn) + { + switch(type) + { + case 1: + default: + halbtc8821aCsr2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1a, 0x1a, 0xe1, 0x90); + break; + case 2: + halbtc8821aCsr2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x12, 0x12, 0xe1, 0x90); + break; + case 3: + halbtc8821aCsr2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1c, 0x3, 0xf1, 0x90); + break; + case 4: + halbtc8821aCsr2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x10, 0x03, 0xf1, 0x90); + break; + case 5: + halbtc8821aCsr2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1a, 0x1a, 0x60, 0x90); + break; + case 6: + halbtc8821aCsr2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x12, 0x12, 0x60, 0x90); + break; + case 7: + halbtc8821aCsr2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1c, 0x3, 0x70, 0x90); + break; + case 8: + halbtc8821aCsr2ant_SetFwPstdma(pBtCoexist, 0xa3, 0x10, 0x3, 0x70, 0x90); + break; + case 9: + halbtc8821aCsr2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1a, 0x1a, 0xe1, 0x90); + break; + case 10: + halbtc8821aCsr2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x12, 0x12, 0xe1, 0x90); + break; + case 11: + halbtc8821aCsr2ant_SetFwPstdma(pBtCoexist, 0xe3, 0xa, 0xa, 0xe1, 0x90); + break; + case 12: + halbtc8821aCsr2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x5, 0x5, 0xe1, 0x90); + break; + case 13: + halbtc8821aCsr2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1a, 0x1a, 0x60, 0x90); + break; + case 14: + halbtc8821aCsr2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x12, 0x12, 0x60, 0x90); + break; + case 15: + halbtc8821aCsr2ant_SetFwPstdma(pBtCoexist, 0xe3, 0xa, 0xa, 0x60, 0x90); + break; + case 16: + halbtc8821aCsr2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x5, 0x5, 0x60, 0x90); + break; + case 17: + halbtc8821aCsr2ant_SetFwPstdma(pBtCoexist, 0xa3, 0x2f, 0x2f, 0x60, 0x90); + break; + case 18: + halbtc8821aCsr2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x5, 0x5, 0xe1, 0x90); + break; + case 19: + halbtc8821aCsr2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x25, 0x25, 0xe1, 0x90); + break; + case 20: + halbtc8821aCsr2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x25, 0x25, 0x60, 0x90); + break; + case 21: + halbtc8821aCsr2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x15, 0x03, 0x70, 0x90); + break; + case 22: //ad2dp master + halbtc8821aCsr2ant_SetFwPstdma(pBtCoexist, 0xeb, 0x11, 0x11, 0x21, 0x10); + break; + case 23: //a2dp slave + halbtc8821aCsr2ant_SetFwPstdma(pBtCoexist, 0xeb, 0x12, 0x12, 0x20, 0x10); + break; + case 71: + halbtc8821aCsr2ant_SetFwPstdma(pBtCoexist, 0xe3, 0x1a, 0x1a, 0xe1, 0x90); + break; + } + } + else + { + // disable PS tdma + switch(type) + { + case 0: + halbtc8821aCsr2ant_SetFwPstdma(pBtCoexist, 0x0, 0x0, 0x0, 0x40, 0x0); + break; + case 1: + halbtc8821aCsr2ant_SetFwPstdma(pBtCoexist, 0x0, 0x0, 0x0, 0x48, 0x0); + break; + default: + halbtc8821aCsr2ant_SetFwPstdma(pBtCoexist, 0x0, 0x0, 0x0, 0x40, 0x0); + break; + } + } + + // update pre state + pCoexDm->bPrePsTdmaOn = pCoexDm->bCurPsTdmaOn; + pCoexDm->prePsTdma = pCoexDm->curPsTdma; +} + +VOID +halbtc8821aCsr2ant_CoexAllOff( + IN PBTC_COEXIST pBtCoexist + ) +{ + // fw all off + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); + halbtc8821aCsr2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); + halbtc8821aCsr2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + + // sw all off + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + + // hw all off + halbtc8821aCsr2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55555555, 0x55555555, 0xffff, 0x3); +} + +VOID +halbtc8821aCsr2ant_CoexUnder5G( + IN PBTC_COEXIST pBtCoexist + ) +{ + halbtc8821aCsr2ant_CoexAllOff(pBtCoexist); + + halbtc8821aCsr2ant_IgnoreWlanAct(pBtCoexist, NORMAL_EXEC, TRUE); +} + +VOID +halbtc8821aCsr2ant_InitCoexDm( + IN PBTC_COEXIST pBtCoexist + ) +{ + // force to reset coex mechanism + halbtc8821aCsr2ant_CoexTable(pBtCoexist, FORCE_EXEC, 0x55555555, 0x55555555, 0xffff, 0x3); + + halbtc8821aCsr2ant_PsTdma(pBtCoexist, FORCE_EXEC, FALSE, 1); + halbtc8821aCsr2ant_FwDacSwingLvl(pBtCoexist, FORCE_EXEC, 6); + halbtc8821aCsr2ant_DecBtPwr(pBtCoexist, FORCE_EXEC, FALSE); + + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); +} + +VOID +halbtc8821aCsr2ant_BtInquiryPage( + IN PBTC_COEXIST pBtCoexist + ) +{ + BOOLEAN bLowPwrDisable=TRUE; + + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); + + halbtc8821aCsr2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55ff55ff, 0x5afa5afa, 0xffff, 0x3); + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 3); +} +BOOLEAN +halbtc8821aCsr2ant_IsCommonAction( + IN PBTC_COEXIST pBtCoexist + ) +{ + BOOLEAN bCommon=FALSE, bWifiConnected=FALSE, bWifiBusy=FALSE; + BOOLEAN bLowPwrDisable=FALSE; + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); + + if(!bWifiConnected && + BT_8821A_CSR_2ANT_BT_STATUS_IDLE == pCoexDm->btStatus) + { + bLowPwrDisable = FALSE; + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); + + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi IPS + BT IPS!!\n")); + + + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); + halbtc8821aCsr2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); + halbtc8821aCsr2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + halbtc8821aCsr2ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0, 0); + halbtc8821aCsr2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, 0, 0, 0); + + bCommon = TRUE; + } + else if(bWifiConnected && + (BT_8821A_CSR_2ANT_BT_STATUS_IDLE == pCoexDm->btStatus) ) + { + bLowPwrDisable = FALSE; + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); + + if(bWifiBusy) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi Busy + BT IPS!!\n")); + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); + } + else + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi LPS + BT IPS!!\n")); + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); + } + + halbtc8821aCsr2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); + halbtc8821aCsr2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + halbtc8821aCsr2ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0, 0); + halbtc8821aCsr2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, 0, 0, 0); + + bCommon = TRUE; + } + else if(!bWifiConnected && + (BT_8821A_CSR_2ANT_BT_STATUS_CONNECTED_IDLE == pCoexDm->btStatus) ) + { + bLowPwrDisable = TRUE; + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); + + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi IPS + BT LPS!!\n")); + + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); + halbtc8821aCsr2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); + halbtc8821aCsr2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + halbtc8821aCsr2ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0, 0); + halbtc8821aCsr2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, 0, 0, 0); + + bCommon = TRUE; + } + else if(bWifiConnected && + (BT_8821A_CSR_2ANT_BT_STATUS_CONNECTED_IDLE == pCoexDm->btStatus) ) + { + bLowPwrDisable = TRUE; + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); + + if(bWifiBusy) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi Busy + BT LPS!!\n")); + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); + } + else + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi LPS + BT LPS!!\n")); + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); + } + + halbtc8821aCsr2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); + halbtc8821aCsr2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,TRUE,TRUE,TRUE,TRUE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + halbtc8821aCsr2ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0, 0); + halbtc8821aCsr2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, 0, 0, 0); + + bCommon = TRUE; + } + else if(!bWifiConnected && + (BT_8821A_CSR_2ANT_BT_STATUS_NON_IDLE == pCoexDm->btStatus) ) + { + bLowPwrDisable = FALSE; + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); + + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi IPS + BT Busy!!\n")); + + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); + halbtc8821aCsr2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); + halbtc8821aCsr2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + halbtc8821aCsr2ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0, 0); + halbtc8821aCsr2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, 0, 0, 0); + + bCommon = TRUE; + } + else + { + bLowPwrDisable = TRUE; + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); + + if(bWifiBusy) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi Busy + BT Busy!!\n")); + bCommon = FALSE; + } + else + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi LPS + BT Busy!!\n")); + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 21); + + if(halbtc8821aCsr2ant_NeedToDecBtPwr(pBtCoexist)) + halbtc8821aCsr2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); + else + halbtc8821aCsr2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + + bCommon = TRUE; + } + + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,TRUE,TRUE,TRUE,TRUE); + } + + if (bCommon == TRUE) + halbtc8821aCsr2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55ff55ff, 0x5afa5afa, 0xffff, 0x3); + + return bCommon; +} +VOID +halbtc8821aCsr2ant_TdmaDurationAdjust( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bScoHid, + IN BOOLEAN bTxPause, + IN u1Byte maxInterval + ) +{ + static s4Byte up,dn,m,n,WaitCount; + s4Byte result; //0: no change, +1: increase WiFi duration, -1: decrease WiFi duration + u1Byte retryCount=0; + + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], TdmaDurationAdjust()\n")); + + if(pCoexDm->bResetTdmaAdjust) + { + pCoexDm->bResetTdmaAdjust = FALSE; + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], first run TdmaDurationAdjust()!!\n")); + { + if(bScoHid) + { + if(bTxPause) + { + if(maxInterval == 1) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 13); + pCoexDm->psTdmaDuAdjType = 13; + } + else if(maxInterval == 2) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 14); + pCoexDm->psTdmaDuAdjType = 14; + } + else if(maxInterval == 3) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 15); + pCoexDm->psTdmaDuAdjType = 15; + } + else + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 15); + pCoexDm->psTdmaDuAdjType = 15; + } + } + else + { + if(maxInterval == 1) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 9); + pCoexDm->psTdmaDuAdjType = 9; + } + else if(maxInterval == 2) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 10); + pCoexDm->psTdmaDuAdjType = 10; + } + else if(maxInterval == 3) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 11); + pCoexDm->psTdmaDuAdjType = 11; + } + else + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 11); + pCoexDm->psTdmaDuAdjType = 11; + } + } + } + else + { + if(bTxPause) + { + if(maxInterval == 1) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 5); + pCoexDm->psTdmaDuAdjType = 5; + } + else if(maxInterval == 2) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 6); + pCoexDm->psTdmaDuAdjType = 6; + } + else if(maxInterval == 3) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 7); + pCoexDm->psTdmaDuAdjType = 7; + } + else + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 7); + pCoexDm->psTdmaDuAdjType = 7; + } + } + else + { + if(maxInterval == 1) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 1); + pCoexDm->psTdmaDuAdjType = 1; + } + else if(maxInterval == 2) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 2); + pCoexDm->psTdmaDuAdjType = 2; + } + else if(maxInterval == 3) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 3); + pCoexDm->psTdmaDuAdjType = 3; + } + else + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 3); + pCoexDm->psTdmaDuAdjType = 3; + } + } + } + } + //============ + up = 0; + dn = 0; + m = 1; + n= 3; + result = 0; + WaitCount = 0; + } + else + { + //accquire the BT TRx retry count from BT_Info byte2 + retryCount = pCoexSta->btRetryCnt; + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], retryCount = %d\n", retryCount)); + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], up=%d, dn=%d, m=%d, n=%d, WaitCount=%d\n", + up, dn, m, n, WaitCount)); + result = 0; + WaitCount++; + + if(retryCount == 0) // no retry in the last 2-second duration + { + up++; + dn--; + + if (dn <= 0) + dn = 0; + + if(up >= n) // if s n 2 retry count0, hռeWiFi duration + { + WaitCount = 0; + n = 3; + up = 0; + dn = 0; + result = 1; + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], Increase wifi duration!!\n")); + } + } + else if (retryCount <= 3) // <=3 retry in the last 2-second duration + { + up--; + dn++; + + if (up <= 0) + up = 0; + + if (dn == 2) // if s 2 2 retry count< 3, hկWiFi duration + { + if (WaitCount <= 2) + m++; // קK@blevelӦ^ + else + m = 1; + + if ( m >= 20) //m ̤j = 20 ' ̤j120 recheckO_վ WiFi duration. + m = 20; + + n = 3*m; + up = 0; + dn = 0; + WaitCount = 0; + result = -1; + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], Decrease wifi duration for retryCounter<3!!\n")); + } + } + else //retry count > 3, un1 retry count > 3, hկWiFi duration + { + if (WaitCount == 1) + m++; // קK@blevelӦ^ + else + m = 1; + + if ( m >= 20) //m ̤j = 20 ' ̤j120 recheckO_վ WiFi duration. + m = 20; + + n = 3*m; + up = 0; + dn = 0; + WaitCount = 0; + result = -1; + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], Decrease wifi duration for retryCounter>3!!\n")); + } + + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], max Interval = %d\n", maxInterval)); + if(maxInterval == 1) + { + if(bTxPause) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], TxPause = 1\n")); + + if(pCoexDm->curPsTdma == 71) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 5); + pCoexDm->psTdmaDuAdjType = 5; + } + else if(pCoexDm->curPsTdma == 1) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 5); + pCoexDm->psTdmaDuAdjType = 5; + } + else if(pCoexDm->curPsTdma == 2) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 6); + pCoexDm->psTdmaDuAdjType = 6; + } + else if(pCoexDm->curPsTdma == 3) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 7); + pCoexDm->psTdmaDuAdjType = 7; + } + else if(pCoexDm->curPsTdma == 4) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 8); + pCoexDm->psTdmaDuAdjType = 8; + } + if(pCoexDm->curPsTdma == 9) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 13); + pCoexDm->psTdmaDuAdjType = 13; + } + else if(pCoexDm->curPsTdma == 10) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 14); + pCoexDm->psTdmaDuAdjType = 14; + } + else if(pCoexDm->curPsTdma == 11) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 15); + pCoexDm->psTdmaDuAdjType = 15; + } + else if(pCoexDm->curPsTdma == 12) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 16); + pCoexDm->psTdmaDuAdjType = 16; + } + + if(result == -1) + { + if(pCoexDm->curPsTdma == 5) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 6); + pCoexDm->psTdmaDuAdjType = 6; + } + else if(pCoexDm->curPsTdma == 6) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 7); + pCoexDm->psTdmaDuAdjType = 7; + } + else if(pCoexDm->curPsTdma == 7) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 8); + pCoexDm->psTdmaDuAdjType = 8; + } + else if(pCoexDm->curPsTdma == 13) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 14); + pCoexDm->psTdmaDuAdjType = 14; + } + else if(pCoexDm->curPsTdma == 14) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 15); + pCoexDm->psTdmaDuAdjType = 15; + } + else if(pCoexDm->curPsTdma == 15) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 16); + pCoexDm->psTdmaDuAdjType = 16; + } + } + else if (result == 1) + { + if(pCoexDm->curPsTdma == 8) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 7); + pCoexDm->psTdmaDuAdjType = 7; + } + else if(pCoexDm->curPsTdma == 7) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 6); + pCoexDm->psTdmaDuAdjType = 6; + } + else if(pCoexDm->curPsTdma == 6) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 5); + pCoexDm->psTdmaDuAdjType = 5; + } + else if(pCoexDm->curPsTdma == 16) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 15); + pCoexDm->psTdmaDuAdjType = 15; + } + else if(pCoexDm->curPsTdma == 15) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 14); + pCoexDm->psTdmaDuAdjType = 14; + } + else if(pCoexDm->curPsTdma == 14) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 13); + pCoexDm->psTdmaDuAdjType = 13; + } + } + } + else + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], TxPause = 0\n")); + if(pCoexDm->curPsTdma == 5) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 71); + pCoexDm->psTdmaDuAdjType = 71; + } + else if(pCoexDm->curPsTdma == 6) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 2); + pCoexDm->psTdmaDuAdjType = 2; + } + else if(pCoexDm->curPsTdma == 7) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 3); + pCoexDm->psTdmaDuAdjType = 3; + } + else if(pCoexDm->curPsTdma == 8) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 4); + pCoexDm->psTdmaDuAdjType = 4; + } + if(pCoexDm->curPsTdma == 13) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 9); + pCoexDm->psTdmaDuAdjType = 9; + } + else if(pCoexDm->curPsTdma == 14) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 10); + pCoexDm->psTdmaDuAdjType = 10; + } + else if(pCoexDm->curPsTdma == 15) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 11); + pCoexDm->psTdmaDuAdjType = 11; + } + else if(pCoexDm->curPsTdma == 16) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 12); + pCoexDm->psTdmaDuAdjType = 12; + } + + if(result == -1) + { + if(pCoexDm->curPsTdma == 71) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 1); + pCoexDm->psTdmaDuAdjType = 1; + } + else if(pCoexDm->curPsTdma == 1) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 2); + pCoexDm->psTdmaDuAdjType = 2; + } + else if(pCoexDm->curPsTdma == 2) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 3); + pCoexDm->psTdmaDuAdjType = 3; + } + else if(pCoexDm->curPsTdma == 3) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 4); + pCoexDm->psTdmaDuAdjType = 4; + } + else if(pCoexDm->curPsTdma == 9) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 10); + pCoexDm->psTdmaDuAdjType = 10; + } + else if(pCoexDm->curPsTdma == 10) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 11); + pCoexDm->psTdmaDuAdjType = 11; + } + else if(pCoexDm->curPsTdma == 11) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 12); + pCoexDm->psTdmaDuAdjType = 12; + } + } + else if (result == 1) + { + if(pCoexDm->curPsTdma == 4) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 3); + pCoexDm->psTdmaDuAdjType = 3; + } + else if(pCoexDm->curPsTdma == 3) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 2); + pCoexDm->psTdmaDuAdjType = 2; + } + else if(pCoexDm->curPsTdma == 2) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 1); + pCoexDm->psTdmaDuAdjType = 1; + } + else if(pCoexDm->curPsTdma == 1) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 71); + pCoexDm->psTdmaDuAdjType = 71; + } + else if(pCoexDm->curPsTdma == 12) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 11); + pCoexDm->psTdmaDuAdjType = 11; + } + else if(pCoexDm->curPsTdma == 11) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 10); + pCoexDm->psTdmaDuAdjType = 10; + } + else if(pCoexDm->curPsTdma == 10) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 9); + pCoexDm->psTdmaDuAdjType = 9; + } + } + } + } + else if(maxInterval == 2) + { + if(bTxPause) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], TxPause = 1\n")); + if(pCoexDm->curPsTdma == 1) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 6); + pCoexDm->psTdmaDuAdjType = 6; + } + else if(pCoexDm->curPsTdma == 2) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 6); + pCoexDm->psTdmaDuAdjType = 6; + } + else if(pCoexDm->curPsTdma == 3) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 7); + pCoexDm->psTdmaDuAdjType = 7; + } + else if(pCoexDm->curPsTdma == 4) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 8); + pCoexDm->psTdmaDuAdjType = 8; + } + if(pCoexDm->curPsTdma == 9) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 14); + pCoexDm->psTdmaDuAdjType = 14; + } + else if(pCoexDm->curPsTdma == 10) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 14); + pCoexDm->psTdmaDuAdjType = 14; + } + else if(pCoexDm->curPsTdma == 11) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 15); + pCoexDm->psTdmaDuAdjType = 15; + } + else if(pCoexDm->curPsTdma == 12) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 16); + pCoexDm->psTdmaDuAdjType = 16; + } + if(result == -1) + { + if(pCoexDm->curPsTdma == 5) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 6); + pCoexDm->psTdmaDuAdjType = 6; + } + else if(pCoexDm->curPsTdma == 6) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 7); + pCoexDm->psTdmaDuAdjType = 7; + } + else if(pCoexDm->curPsTdma == 7) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 8); + pCoexDm->psTdmaDuAdjType = 8; + } + else if(pCoexDm->curPsTdma == 13) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 14); + pCoexDm->psTdmaDuAdjType = 14; + } + else if(pCoexDm->curPsTdma == 14) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 15); + pCoexDm->psTdmaDuAdjType = 15; + } + else if(pCoexDm->curPsTdma == 15) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 16); + pCoexDm->psTdmaDuAdjType = 16; + } + } + else if (result == 1) + { + if(pCoexDm->curPsTdma == 8) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 7); + pCoexDm->psTdmaDuAdjType = 7; + } + else if(pCoexDm->curPsTdma == 7) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 6); + pCoexDm->psTdmaDuAdjType = 6; + } + else if(pCoexDm->curPsTdma == 6) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 6); + pCoexDm->psTdmaDuAdjType = 6; + } + else if(pCoexDm->curPsTdma == 16) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 15); + pCoexDm->psTdmaDuAdjType = 15; + } + else if(pCoexDm->curPsTdma == 15) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 14); + pCoexDm->psTdmaDuAdjType = 14; + } + else if(pCoexDm->curPsTdma == 14) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 14); + pCoexDm->psTdmaDuAdjType = 14; + } + } + } + else + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], TxPause = 0\n")); + if(pCoexDm->curPsTdma == 5) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 2); + pCoexDm->psTdmaDuAdjType = 2; + } + else if(pCoexDm->curPsTdma == 6) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 2); + pCoexDm->psTdmaDuAdjType = 2; + } + else if(pCoexDm->curPsTdma == 7) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 3); + pCoexDm->psTdmaDuAdjType = 3; + } + else if(pCoexDm->curPsTdma == 8) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 4); + pCoexDm->psTdmaDuAdjType = 4; + } + if(pCoexDm->curPsTdma == 13) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 10); + pCoexDm->psTdmaDuAdjType = 10; + } + else if(pCoexDm->curPsTdma == 14) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 10); + pCoexDm->psTdmaDuAdjType = 10; + } + else if(pCoexDm->curPsTdma == 15) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 11); + pCoexDm->psTdmaDuAdjType = 11; + } + else if(pCoexDm->curPsTdma == 16) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 12); + pCoexDm->psTdmaDuAdjType = 12; + } + if(result == -1) + { + if(pCoexDm->curPsTdma == 1) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 2); + pCoexDm->psTdmaDuAdjType = 2; + } + else if(pCoexDm->curPsTdma == 2) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 3); + pCoexDm->psTdmaDuAdjType = 3; + } + else if(pCoexDm->curPsTdma == 3) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 4); + pCoexDm->psTdmaDuAdjType = 4; + } + else if(pCoexDm->curPsTdma == 9) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 10); + pCoexDm->psTdmaDuAdjType = 10; + } + else if(pCoexDm->curPsTdma == 10) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 11); + pCoexDm->psTdmaDuAdjType = 11; + } + else if(pCoexDm->curPsTdma == 11) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 12); + pCoexDm->psTdmaDuAdjType = 12; + } + } + else if (result == 1) + { + if(pCoexDm->curPsTdma == 4) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 3); + pCoexDm->psTdmaDuAdjType = 3; + } + else if(pCoexDm->curPsTdma == 3) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 2); + pCoexDm->psTdmaDuAdjType = 2; + } + else if(pCoexDm->curPsTdma == 2) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 2); + pCoexDm->psTdmaDuAdjType = 2; + } + else if(pCoexDm->curPsTdma == 12) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 11); + pCoexDm->psTdmaDuAdjType = 11; + } + else if(pCoexDm->curPsTdma == 11) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 10); + pCoexDm->psTdmaDuAdjType = 10; + } + else if(pCoexDm->curPsTdma == 10) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 10); + pCoexDm->psTdmaDuAdjType = 10; + } + } + } + } + else if(maxInterval == 3) + { + if(bTxPause) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], TxPause = 1\n")); + if(pCoexDm->curPsTdma == 1) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 7); + pCoexDm->psTdmaDuAdjType = 7; + } + else if(pCoexDm->curPsTdma == 2) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 7); + pCoexDm->psTdmaDuAdjType = 7; + } + else if(pCoexDm->curPsTdma == 3) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 7); + pCoexDm->psTdmaDuAdjType = 7; + } + else if(pCoexDm->curPsTdma == 4) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 8); + pCoexDm->psTdmaDuAdjType = 8; + } + if(pCoexDm->curPsTdma == 9) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 15); + pCoexDm->psTdmaDuAdjType = 15; + } + else if(pCoexDm->curPsTdma == 10) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 15); + pCoexDm->psTdmaDuAdjType = 15; + } + else if(pCoexDm->curPsTdma == 11) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 15); + pCoexDm->psTdmaDuAdjType = 15; + } + else if(pCoexDm->curPsTdma == 12) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 16); + pCoexDm->psTdmaDuAdjType = 16; + } + if(result == -1) + { + if(pCoexDm->curPsTdma == 5) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 7); + pCoexDm->psTdmaDuAdjType = 7; + } + else if(pCoexDm->curPsTdma == 6) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 7); + pCoexDm->psTdmaDuAdjType = 7; + } + else if(pCoexDm->curPsTdma == 7) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 8); + pCoexDm->psTdmaDuAdjType = 8; + } + else if(pCoexDm->curPsTdma == 13) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 15); + pCoexDm->psTdmaDuAdjType = 15; + } + else if(pCoexDm->curPsTdma == 14) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 15); + pCoexDm->psTdmaDuAdjType = 15; + } + else if(pCoexDm->curPsTdma == 15) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 16); + pCoexDm->psTdmaDuAdjType = 16; + } + } + else if (result == 1) + { + if(pCoexDm->curPsTdma == 8) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 7); + pCoexDm->psTdmaDuAdjType = 7; + } + else if(pCoexDm->curPsTdma == 7) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 7); + pCoexDm->psTdmaDuAdjType = 7; + } + else if(pCoexDm->curPsTdma == 6) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 7); + pCoexDm->psTdmaDuAdjType = 7; + } + else if(pCoexDm->curPsTdma == 16) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 15); + pCoexDm->psTdmaDuAdjType = 15; + } + else if(pCoexDm->curPsTdma == 15) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 15); + pCoexDm->psTdmaDuAdjType = 15; + } + else if(pCoexDm->curPsTdma == 14) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 15); + pCoexDm->psTdmaDuAdjType = 15; + } + } + } + else + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], TxPause = 0\n")); + if(pCoexDm->curPsTdma == 5) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 3); + pCoexDm->psTdmaDuAdjType = 3; + } + else if(pCoexDm->curPsTdma == 6) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 3); + pCoexDm->psTdmaDuAdjType = 3; + } + else if(pCoexDm->curPsTdma == 7) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 3); + pCoexDm->psTdmaDuAdjType = 3; + } + else if(pCoexDm->curPsTdma == 8) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 4); + pCoexDm->psTdmaDuAdjType = 4; + } + if(pCoexDm->curPsTdma == 13) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 11); + pCoexDm->psTdmaDuAdjType = 11; + } + else if(pCoexDm->curPsTdma == 14) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 11); + pCoexDm->psTdmaDuAdjType = 11; + } + else if(pCoexDm->curPsTdma == 15) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 11); + pCoexDm->psTdmaDuAdjType = 11; + } + else if(pCoexDm->curPsTdma == 16) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 12); + pCoexDm->psTdmaDuAdjType = 12; + } + if(result == -1) + { + if(pCoexDm->curPsTdma == 1) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 3); + pCoexDm->psTdmaDuAdjType = 3; + } + else if(pCoexDm->curPsTdma == 2) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 3); + pCoexDm->psTdmaDuAdjType = 3; + } + else if(pCoexDm->curPsTdma == 3) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 4); + pCoexDm->psTdmaDuAdjType = 4; + } + else if(pCoexDm->curPsTdma == 9) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 11); + pCoexDm->psTdmaDuAdjType = 11; + } + else if(pCoexDm->curPsTdma == 10) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 11); + pCoexDm->psTdmaDuAdjType = 11; + } + else if(pCoexDm->curPsTdma == 11) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 12); + pCoexDm->psTdmaDuAdjType = 12; + } + } + else if (result == 1) + { + if(pCoexDm->curPsTdma == 4) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 3); + pCoexDm->psTdmaDuAdjType = 3; + } + else if(pCoexDm->curPsTdma == 3) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 3); + pCoexDm->psTdmaDuAdjType = 3; + } + else if(pCoexDm->curPsTdma == 2) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 3); + pCoexDm->psTdmaDuAdjType = 3; + } + else if(pCoexDm->curPsTdma == 12) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 11); + pCoexDm->psTdmaDuAdjType = 11; + } + else if(pCoexDm->curPsTdma == 11) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 11); + pCoexDm->psTdmaDuAdjType = 11; + } + else if(pCoexDm->curPsTdma == 10) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 11); + pCoexDm->psTdmaDuAdjType = 11; + } + } + } + } + } + + // if current PsTdma not match with the recorded one (when scan, dhcp...), + // then we have to adjust it back to the previous record one. + if(pCoexDm->curPsTdma != pCoexDm->psTdmaDuAdjType) + { + BOOLEAN bScan=FALSE, bLink=FALSE, bRoam=FALSE; + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], PsTdma type dismatch!!!, curPsTdma=%d, recordPsTdma=%d\n", + pCoexDm->curPsTdma, pCoexDm->psTdmaDuAdjType)); + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_LINK, &bLink); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_ROAM, &bRoam); + + if( !bScan && !bLink && !bRoam) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, pCoexDm->psTdmaDuAdjType); + } + else + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], roaming/link/scan is under progress, will adjust next time!!!\n")); + } + } + + // when halbtc8821aCsr2ant_TdmaDurationAdjust() is called, fw dac swing is included in the function. + //if(pCoexDm->psTdmaDuAdjType == 71) + // halbtc8821aCsr2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 0xc); //Skip because A2DP get worse at HT40 + //else + halbtc8821aCsr2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 0x6); +} + +// SCO only or SCO+PAN(HS) +VOID +halbtc8821aCsr2ant_ActionSco( + IN PBTC_COEXIST pBtCoexist + ) +{ + u1Byte wifiRssiState,btRssiState; + u4Byte wifiBw; + + halbtc8821aCsr2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55555555, 0x55555555, 0xffffff, 0x3); + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 0); + + halbtc8821aCsr2ant_LowPenaltyRa(pBtCoexist, NORMAL_EXEC, TRUE); + + halbtc8821aCsr2ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 1, 0, 2, 0); + + if(pCoexSta->bSlave == FALSE) + halbtc8821aCsr2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, TRUE, 0x4); + else + halbtc8821aCsr2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, TRUE, 0x2); + +/* + wifiRssiState = halbtc8821aCsr2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); + btRssiState = halbtc8821aCsr2ant_BtRssiState(2, 35, 0); + + halbtc8821aCsr2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 4); + + if(halbtc8821aCsr2ant_NeedToDecBtPwr(pBtCoexist)) + halbtc8821aCsr2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); + else + halbtc8821aCsr2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); + + if (BTC_WIFI_BW_LEGACY == wifiBw) //for SCO quality at 11b/g mode + { + halbtc8821aCsr2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x5a5a5a5a, 0x5a5a5a5a, 0xffff, 0x3); + } + else //for SCO quality & wifi performance balance at 11n mode + { + halbtc8821aCsr2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x5aea5aea, 0x5aea5aea, 0xffff, 0x3); + } + + if(BTC_WIFI_BW_HT40 == wifiBw) + { + + // fw mechanism + //halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 5); + + if( (btRssiState == BTC_RSSI_STATE_HIGH) || + (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 0); //for voice quality + } + else + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 0); //for voice quality + } + + // sw mechanism + if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || + (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,TRUE,TRUE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + } + else + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,TRUE,TRUE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + } + } + else + { + // fw mechanism + //halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 5); + + if( (btRssiState == BTC_RSSI_STATE_HIGH) || + (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 0); //for voice quality + } + else + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 0); //for voice quality + } + + // sw mechanism + if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || + (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,FALSE,TRUE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + } + else + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,FALSE,TRUE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + } + } +*/ +} + + +VOID +halbtc8821aCsr2ant_ActionHid( + IN PBTC_COEXIST pBtCoexist + ) +{ + u1Byte wifiRssiState, btRssiState; + u4Byte wifiBw; + + wifiRssiState = halbtc8821aCsr2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); + btRssiState = halbtc8821aCsr2ant_BtRssiState(2, 35, 0); + + halbtc8821aCsr2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); + + if(halbtc8821aCsr2ant_NeedToDecBtPwr(pBtCoexist)) + halbtc8821aCsr2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); + else + halbtc8821aCsr2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); + + if (BTC_WIFI_BW_LEGACY == wifiBw) //for HID at 11b/g mode + { + halbtc8821aCsr2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55ff55ff, 0x5a5a5a5a, 0xffff, 0x3); + } + else //for HID quality & wifi performance balance at 11n mode + { + halbtc8821aCsr2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55ff55ff, 0x5aea5aea, 0xffff, 0x3); + } + + if(BTC_WIFI_BW_HT40 == wifiBw) + { + // fw mechanism + if( (btRssiState == BTC_RSSI_STATE_HIGH) || + (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 9); + } + else + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 13); + } + + // sw mechanism + if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || + (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,TRUE,TRUE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + } + else + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,TRUE,TRUE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + } + } + else + { + // fw mechanism + if( (btRssiState == BTC_RSSI_STATE_HIGH) || + (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 9); + } + else + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 13); + } + + // sw mechanism + if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || + (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,FALSE,TRUE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + } + else + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,FALSE,TRUE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + } + } +} + +//A2DP only / PAN(EDR) only/ A2DP+PAN(HS) +VOID +halbtc8821aCsr2ant_ActionA2dp( + IN PBTC_COEXIST pBtCoexist + ) +{ + u1Byte wifiRssiState, btRssiState; + u4Byte wifiBw; + + halbtc8821aCsr2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, FALSE, TRUE, 0x8); + + if(pCoexSta->bSlave == FALSE) + { + halbtc8821aCsr2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0xfdfdfdfd, 0xdfdadfda, 0xffffff, 0x3); + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 22); + halbtc8821aCsr2ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0, 1); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,TRUE,0x0c); + } + else + { + halbtc8821aCsr2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0xfdfdfdfd, 0xdfdadfda, 0xffffff, 0x3); + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 23); + halbtc8821aCsr2ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0, 2); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,TRUE,0x18); + } + +/* + wifiRssiState = halbtc8821aCsr2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); + btRssiState = halbtc8821aCsr2ant_BtRssiState(2, 35, 0); + + //fw dac swing is called in halbtc8821aCsr2ant_TdmaDurationAdjust() + //halbtc8821aCsr2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); + + + if(halbtc8821aCsr2ant_NeedToDecBtPwr(pBtCoexist)) + halbtc8821aCsr2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); + else + halbtc8821aCsr2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); + + if(BTC_WIFI_BW_HT40 == wifiBw) + { + // fw mechanism + if( (btRssiState == BTC_RSSI_STATE_HIGH) || + (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, FALSE, FALSE, 1); + } + else + { + halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, FALSE, TRUE, 1); + } + + // sw mechanism + if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || + (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,TRUE,FALSE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + } + else + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,TRUE,FALSE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + } + } + else + { + // fw mechanism + if( (btRssiState == BTC_RSSI_STATE_HIGH) || + (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, FALSE, FALSE, 1); + } + else + { + halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, FALSE, TRUE, 1); + } + + // sw mechanism + if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || + (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + } + else + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + } + } +*/ +} + +VOID +halbtc8821aCsr2ant_ActionA2dpPanHs( + IN PBTC_COEXIST pBtCoexist + ) +{ + u1Byte wifiRssiState, btRssiState, btInfoExt; + u4Byte wifiBw; + + btInfoExt = pCoexSta->btInfoExt; + wifiRssiState = halbtc8821aCsr2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); + btRssiState = halbtc8821aCsr2ant_BtRssiState(2,35, 0); + + //fw dac swing is called in halbtc8821aCsr2ant_TdmaDurationAdjust() + //halbtc8821aCsr2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); + + + if(halbtc8821aCsr2ant_NeedToDecBtPwr(pBtCoexist)) + halbtc8821aCsr2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); + else + halbtc8821aCsr2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); + + if(BTC_WIFI_BW_HT40 == wifiBw) + { + // fw mechanism + if(btInfoExt&BIT0) //a2dp basic rate + { + halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, FALSE, TRUE, 2); + } + else //a2dp edr rate + { + halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, FALSE, TRUE, 1); + } + + // sw mechanism + if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || + (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,TRUE,FALSE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + } + else + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,TRUE,FALSE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + } + } + else + { + // fw mechanism + if(btInfoExt&BIT0) //a2dp basic rate + { + halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, FALSE, TRUE, 2); + } + else //a2dp edr rate + { + halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, FALSE, TRUE, 1); + } + + // sw mechanism + if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || + (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + } + else + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + } + } +} + +VOID +halbtc8821aCsr2ant_ActionPanEdr( + IN PBTC_COEXIST pBtCoexist + ) +{ + u1Byte wifiRssiState, btRssiState; + u4Byte wifiBw; + + wifiRssiState = halbtc8821aCsr2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); + btRssiState = halbtc8821aCsr2ant_BtRssiState(2, 35, 0); + + halbtc8821aCsr2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); + + if(halbtc8821aCsr2ant_NeedToDecBtPwr(pBtCoexist)) + halbtc8821aCsr2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); + else + halbtc8821aCsr2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); + + if (BTC_WIFI_BW_LEGACY == wifiBw) //for HID at 11b/g mode + { + halbtc8821aCsr2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55ff55ff, 0x5aff5aff, 0xffff, 0x3); + } + else //for HID quality & wifi performance balance at 11n mode + { + halbtc8821aCsr2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55ff55ff, 0x5aff5aff, 0xffff, 0x3); + } + + if(BTC_WIFI_BW_HT40 == wifiBw) + { + // fw mechanism + if( (btRssiState == BTC_RSSI_STATE_HIGH) || + (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 1); + } + else + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 5); + } + + // sw mechanism + if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || + (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,TRUE,FALSE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + } + else + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,TRUE,FALSE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + } + } + else + { + // fw mechanism + if( (btRssiState == BTC_RSSI_STATE_HIGH) || + (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 1); + } + else + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 5); + } + + // sw mechanism + if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || + (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + } + else + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + } + } +} + + +//PAN(HS) only +VOID +halbtc8821aCsr2ant_ActionPanHs( + IN PBTC_COEXIST pBtCoexist + ) +{ + u1Byte wifiRssiState, btRssiState; + u4Byte wifiBw; + + wifiRssiState = halbtc8821aCsr2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); + btRssiState = halbtc8821aCsr2ant_BtRssiState(2, 35, 0); + + halbtc8821aCsr2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); + + if(BTC_WIFI_BW_HT40 == wifiBw) + { + // fw mechanism + if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || + (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821aCsr2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); + } + else + { + halbtc8821aCsr2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + } + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); + + // sw mechanism + if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || + (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,TRUE,FALSE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + } + else + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,TRUE,FALSE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + } + } + else + { + // fw mechanism + if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || + (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821aCsr2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); + } + else + { + halbtc8821aCsr2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + } + + if( (btRssiState == BTC_RSSI_STATE_HIGH) || + (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); + } + else + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 1); + } + + // sw mechanism + if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || + (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + } + else + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + } + } +} + +//PAN(EDR)+A2DP +VOID +halbtc8821aCsr2ant_ActionPanEdrA2dp( + IN PBTC_COEXIST pBtCoexist + ) +{ + u1Byte wifiRssiState, btRssiState, btInfoExt; + u4Byte wifiBw; + + btInfoExt = pCoexSta->btInfoExt; + wifiRssiState = halbtc8821aCsr2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); + btRssiState = halbtc8821aCsr2ant_BtRssiState(2, 35, 0); + + halbtc8821aCsr2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); + + if(halbtc8821aCsr2ant_NeedToDecBtPwr(pBtCoexist)) + halbtc8821aCsr2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); + else + halbtc8821aCsr2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); + + if (BTC_WIFI_BW_LEGACY == wifiBw) //for HID at 11b/g mode + { + halbtc8821aCsr2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55ff55ff, 0x5afa5afa, 0xffff, 0x3); + } + else //for HID quality & wifi performance balance at 11n mode + { + halbtc8821aCsr2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55ff55ff, 0x5afa5afa, 0xffff, 0x3); + } + + if(BTC_WIFI_BW_HT40 == wifiBw) + { + // fw mechanism + if( (btRssiState == BTC_RSSI_STATE_HIGH) || + (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + if(btInfoExt&BIT0) //a2dp basic rate + { + halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, FALSE, FALSE, 3); + } + else //a2dp edr rate + { + halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, FALSE, FALSE, 3); + } + } + else + { + if(btInfoExt&BIT0) //a2dp basic rate + { + halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, FALSE, TRUE, 3); + } + else //a2dp edr rate + { + halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, FALSE, TRUE, 3); + } + } + + // sw mechanism + if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || + (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,TRUE,FALSE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + } + else + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,TRUE,FALSE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + }; + } + else + { + // fw mechanism + if( (btRssiState == BTC_RSSI_STATE_HIGH) || + (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + if(btInfoExt&BIT0) //a2dp basic rate + { + halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, FALSE, FALSE, 3); + } + else //a2dp edr rate + { + halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, FALSE, FALSE, 3); + } + } + else + { + if(btInfoExt&BIT0) //a2dp basic rate + { + halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, FALSE, TRUE, 3); + } + else //a2dp edr rate + { + halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, FALSE, TRUE, 3); + } + } + + // sw mechanism + if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || + (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + } + else + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,FALSE,FALSE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + } + } +} + +VOID +halbtc8821aCsr2ant_ActionPanEdrHid( + IN PBTC_COEXIST pBtCoexist + ) +{ + u1Byte wifiRssiState, btRssiState; + u4Byte wifiBw; + + wifiRssiState = halbtc8821aCsr2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); + btRssiState = halbtc8821aCsr2ant_BtRssiState(2, 35, 0); + + halbtc8821aCsr2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); + + if(halbtc8821aCsr2ant_NeedToDecBtPwr(pBtCoexist)) + halbtc8821aCsr2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); + else + halbtc8821aCsr2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); + + if (BTC_WIFI_BW_LEGACY == wifiBw) //for HID at 11b/g mode + { + halbtc8821aCsr2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55ff55ff, 0x5a5f5a5f, 0xffff, 0x3); + } + else //for HID quality & wifi performance balance at 11n mode + { + halbtc8821aCsr2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55ff55ff, 0x5a5f5a5f, 0xffff, 0x3); + } + + if(BTC_WIFI_BW_HT40 == wifiBw) + { + halbtc8821aCsr2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 3); + // fw mechanism + if( (btRssiState == BTC_RSSI_STATE_HIGH) || + (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 10); + } + else + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 14); + } + + // sw mechanism + if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || + (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,TRUE,TRUE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + } + else + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,TRUE,TRUE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + } + } + else + { + halbtc8821aCsr2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); + // fw mechanism + if( (btRssiState == BTC_RSSI_STATE_HIGH) || + (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 10); + } + else + { + halbtc8821aCsr2ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 14); + } + + // sw mechanism + if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || + (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,FALSE,TRUE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + } + else + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,FALSE,TRUE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + } + } +} + +// HID+A2DP+PAN(EDR) +VOID +halbtc8821aCsr2ant_ActionHidA2dpPanEdr( + IN PBTC_COEXIST pBtCoexist + ) +{ + u1Byte wifiRssiState, btRssiState, btInfoExt; + u4Byte wifiBw; + + btInfoExt = pCoexSta->btInfoExt; + wifiRssiState = halbtc8821aCsr2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); + btRssiState = halbtc8821aCsr2ant_BtRssiState(2, 35, 0); + + halbtc8821aCsr2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); + + if(halbtc8821aCsr2ant_NeedToDecBtPwr(pBtCoexist)) + halbtc8821aCsr2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); + else + halbtc8821aCsr2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); + + if (BTC_WIFI_BW_LEGACY == wifiBw) //for HID at 11b/g mode + { + halbtc8821aCsr2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55ff55ff, 0x5a5a5a5a, 0xffff, 0x3); + } + else //for HID quality & wifi performance balance at 11n mode + { + halbtc8821aCsr2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55ff55ff, 0x5a5a5a5a, 0xffff, 0x3); + } + + if(BTC_WIFI_BW_HT40 == wifiBw) + { + // fw mechanism + if( (btRssiState == BTC_RSSI_STATE_HIGH) || + (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + if(btInfoExt&BIT0) //a2dp basic rate + { + halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 3); + } + else //a2dp edr rate + { + halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 3); + } + } + else + { + if(btInfoExt&BIT0) //a2dp basic rate + { + halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 3); + } + else //a2dp edr rate + { + halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 3); + } + } + + // sw mechanism + if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || + (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,TRUE,TRUE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + } + else + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,TRUE,TRUE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + } + } + else + { + // fw mechanism + if( (btRssiState == BTC_RSSI_STATE_HIGH) || + (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + if(btInfoExt&BIT0) //a2dp basic rate + { + halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, TRUE, FALSE, 3); + } + else //a2dp edr rate + { + halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, TRUE, FALSE, 3); + } + } + else + { + if(btInfoExt&BIT0) //a2dp basic rate + { + halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 3); + } + else //a2dp edr rate + { + halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 3); + } + } + + // sw mechanism + if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || + (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,FALSE,TRUE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + } + else + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,FALSE,TRUE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + } + } +} + +VOID +halbtc8821aCsr2ant_ActionHidA2dp( + IN PBTC_COEXIST pBtCoexist + ) +{ + u1Byte wifiRssiState, btRssiState, btInfoExt; + u4Byte wifiBw; + + btInfoExt = pCoexSta->btInfoExt; + wifiRssiState = halbtc8821aCsr2ant_WifiRssiState(pBtCoexist, 0, 2, 15, 0); + btRssiState = halbtc8821aCsr2ant_BtRssiState(2, 35, 0); + + if(halbtc8821aCsr2ant_NeedToDecBtPwr(pBtCoexist)) + halbtc8821aCsr2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, TRUE); + else + halbtc8821aCsr2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, FALSE); + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); + + if (BTC_WIFI_BW_LEGACY == wifiBw) //for HID at 11b/g mode + { +//Allen halbtc8821aCsr2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55ff55ff, 0x5a5a5a5a, 0xffff, 0x3); + halbtc8821aCsr2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55ff55ff, 0x5f5b5f5b, 0xffffff, 0x3); + } + else //for HID quality & wifi performance balance at 11n mode + { +//Allen halbtc8821aCsr2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55ff55ff, 0x5a5a5a5a, 0xffff, 0x3); + halbtc8821aCsr2ant_CoexTable(pBtCoexist, NORMAL_EXEC, 0x55ff55ff, 0x5f5b5f5b, 0xffffff, 0x3); + + } + + if(BTC_WIFI_BW_HT40 == wifiBw) + { + // fw mechanism + if( (btRssiState == BTC_RSSI_STATE_HIGH) || + (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + if(btInfoExt&BIT0) //a2dp basic rate + { + halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 2); + } + else //a2dp edr rate + { + halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 2); + } + } + else + { + if(btInfoExt&BIT0) //a2dp basic rate + { + halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 2); + } + else //a2dp edr rate + { + halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 2); + } + } + + // sw mechanism + if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || + (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,TRUE,TRUE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + } + else + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,TRUE,TRUE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + } + } + else + { + // fw mechanism + if( (btRssiState == BTC_RSSI_STATE_HIGH) || + (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + if(btInfoExt&BIT0) //a2dp basic rate + { +// halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, TRUE, FALSE, 2); + halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 2); + + } + else //a2dp edr rate + { +//Allen halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, TRUE, FALSE, 2); + halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 2); + } + } + else + { + if(btInfoExt&BIT0) //a2dp basic rate + { + halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 2); + } + else //a2dp edr rate + { + halbtc8821aCsr2ant_TdmaDurationAdjust(pBtCoexist, TRUE, TRUE, 2); + } + } + + // sw mechanism + if( (wifiRssiState == BTC_RSSI_STATE_HIGH) || + (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) ) + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,FALSE,TRUE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,TRUE,FALSE,FALSE,0x18); + } + else + { + halbtc8821aCsr2ant_SwMechanism1(pBtCoexist,FALSE,TRUE,FALSE,FALSE); + halbtc8821aCsr2ant_SwMechanism2(pBtCoexist,FALSE,FALSE,FALSE,0x18); + } + } +} + +VOID +halbtc8821aCsr2ant_RunCoexistMechanism( + IN PBTC_COEXIST pBtCoexist + ) +{ + PBTC_STACK_INFO pStackInfo=&pBtCoexist->stackInfo; + BOOLEAN bWifiUnder5G=FALSE; + u1Byte btInfoOriginal=0, btRetryCnt=0; + u1Byte algorithm=0; + + if(pBtCoexist->bManualControl) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Manual control!!!\n")); + return; + } + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_UNDER_5G, &bWifiUnder5G); + + if(bWifiUnder5G) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], RunCoexistMechanism(), run 5G coex setting!!<===\n")); + halbtc8821aCsr2ant_CoexUnder5G(pBtCoexist); + return; + } + + //if(pStackInfo->bProfileNotified) + { + algorithm = halbtc8821aCsr2ant_ActionAlgorithm(pBtCoexist); + if(pCoexSta->bC2hBtInquiryPage && (BT_8821A_CSR_2ANT_COEX_ALGO_PANHS!=algorithm)) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BT is under inquiry/page scan !!\n")); + halbtc8821aCsr2ant_BtInquiryPage(pBtCoexist); + return; + } + + pCoexDm->curAlgorithm = algorithm; + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Algorithm = %d \n", pCoexDm->curAlgorithm)); + + if(halbtc8821aCsr2ant_IsCommonAction(pBtCoexist)) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant common.\n")); + pCoexDm->bResetTdmaAdjust = TRUE; + } + else + { + if(pCoexDm->curAlgorithm != pCoexDm->preAlgorithm) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], preAlgorithm=%d, curAlgorithm=%d\n", + pCoexDm->preAlgorithm, pCoexDm->curAlgorithm)); + pCoexDm->bResetTdmaAdjust = TRUE; + } + switch(pCoexDm->curAlgorithm) + { + case BT_8821A_CSR_2ANT_COEX_ALGO_SCO: + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = SCO.\n")); + halbtc8821aCsr2ant_ActionSco(pBtCoexist); + break; + case BT_8821A_CSR_2ANT_COEX_ALGO_HID: + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = HID.\n")); + halbtc8821aCsr2ant_ActionHid(pBtCoexist); + break; + case BT_8821A_CSR_2ANT_COEX_ALGO_A2DP: + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = A2DP.\n")); + halbtc8821aCsr2ant_ActionA2dp(pBtCoexist); + break; + case BT_8821A_CSR_2ANT_COEX_ALGO_A2DP_PANHS: + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = A2DP+PAN(HS).\n")); + halbtc8821aCsr2ant_ActionA2dpPanHs(pBtCoexist); + break; + case BT_8821A_CSR_2ANT_COEX_ALGO_PANEDR: + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = PAN(EDR).\n")); + halbtc8821aCsr2ant_ActionPanEdr(pBtCoexist); + break; + case BT_8821A_CSR_2ANT_COEX_ALGO_PANHS: + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = HS mode.\n")); + halbtc8821aCsr2ant_ActionPanHs(pBtCoexist); + break; + case BT_8821A_CSR_2ANT_COEX_ALGO_PANEDR_A2DP: + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = PAN+A2DP.\n")); + halbtc8821aCsr2ant_ActionPanEdrA2dp(pBtCoexist); + break; + case BT_8821A_CSR_2ANT_COEX_ALGO_PANEDR_HID: + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = PAN(EDR)+HID.\n")); + halbtc8821aCsr2ant_ActionPanEdrHid(pBtCoexist); + break; + case BT_8821A_CSR_2ANT_COEX_ALGO_HID_A2DP_PANEDR: + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = HID+A2DP+PAN.\n")); + halbtc8821aCsr2ant_ActionHidA2dpPanEdr(pBtCoexist); + break; + case BT_8821A_CSR_2ANT_COEX_ALGO_HID_A2DP: + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = HID+A2DP.\n")); + halbtc8821aCsr2ant_ActionHidA2dp(pBtCoexist); + break; + default: + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = coexist All Off!!\n")); + halbtc8821aCsr2ant_CoexAllOff(pBtCoexist); + break; + } + pCoexDm->preAlgorithm = pCoexDm->curAlgorithm; + } + } +} + + + +//============================================================ +// work around function start with wa_halbtc8821aCsr2ant_ +//============================================================ +//============================================================ +// extern function start with EXhalbtc8821aCsr2ant_ +//============================================================ +VOID +EXhalbtc8821aCsr2ant_PowerOnSetting( + IN PBTC_COEXIST pBtCoexist + ) +{ +} + +VOID +EXhalbtc8821aCsr2ant_InitHwConfig( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bWifiOnly + ) +{ + PBTC_BOARD_INFO pBoardInfo=&pBtCoexist->boardInfo; + u4Byte u4Tmp=0; + u2Byte u2Tmp=0; + u1Byte u1Tmp=0; + u1Byte H2C_Parameter[2] ={0}; + + + BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], 2Ant Init HW Config!!\n")); + + if(bWifiOnly) + return; + + //if(bBackUp) + { + // backup rf 0x1e value + pCoexDm->btRf0x1eBackup = pBtCoexist->fBtcGetRfReg(pBtCoexist, BTC_RF_A, 0x1e, 0xfffff); + pCoexDm->backupArfrCnt1 = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x430); + pCoexDm->backupArfrCnt2 = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x434); + pCoexDm->backupRetryLimit = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0x42a); + pCoexDm->backupAmpduMaxTime = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x456); + pCoexDm->backupAmpduMaxNum = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0x4ca); + } + + #if 0 /* REMOVE */ + // 0x790[5:0]=0x5 + u1Tmp = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x790); + u1Tmp &= 0xc0; + u1Tmp |= 0x5; + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x790, u1Tmp); + #endif + + //Antenna config + halbtc8821aCsr2ant_SetAntPath(pBtCoexist, BTC_ANT_WIFI_AT_MAIN, TRUE, FALSE); + + // PTA parameter + halbtc8821aCsr2ant_CoexTable(pBtCoexist, FORCE_EXEC, 0x55555555, 0x55555555, 0xffff, 0x3); + + // Enable counter statistics + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0xc); //0x76e[3] =1, WLAN_Act control by PTA + pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x778, 0x3); + + #if 0 /* REMOVE */ + pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x40, 0x20, 0x1); + #endif +} + +VOID +EXhalbtc8821aCsr2ant_InitCoexDm( + IN PBTC_COEXIST pBtCoexist + ) +{ + BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], Coex Mechanism Init!!\n")); + + halbtc8821aCsr2ant_InitCoexDm(pBtCoexist); +} + +VOID +EXhalbtc8821aCsr2ant_DisplayCoexInfo( + IN PBTC_COEXIST pBtCoexist + ) +{ + PBTC_BOARD_INFO pBoardInfo=&pBtCoexist->boardInfo; + PBTC_STACK_INFO pStackInfo=&pBtCoexist->stackInfo; + pu1Byte cliBuf=pBtCoexist->cliBuf; + u1Byte u1Tmp[4], i, btInfoExt, psTdmaCase=0; + u4Byte u4Tmp[4]; + u4Byte fwVer=0, btPatchVer=0; + + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n ============[BT Coexist info]============"); + CL_PRINTF(cliBuf); + + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d ", "Ant PG number/ Ant mechanism:", \ + pBoardInfo->pgAntNum, pBoardInfo->btdmAntNum); + CL_PRINTF(cliBuf); + + if(pBtCoexist->bManualControl) + { + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "[Action Manual control]!!"); + CL_PRINTF(cliBuf); + } + + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s / %d", "BT stack/ hci ext ver", \ + ((pStackInfo->bProfileNotified)? "Yes":"No"), pStackInfo->hciVersion); + CL_PRINTF(cliBuf); + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_BT_PATCH_VER, &btPatchVer); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_FW_VER, &fwVer); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d_%d/ 0x%x/ 0x%x(%d)", "CoexVer/ FwVer/ PatchVer", \ + GLCoexVerDate8821aCsr2Ant, GLCoexVer8821aCsr2Ant, fwVer, btPatchVer, btPatchVer); + CL_PRINTF(cliBuf); + + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %02x %02x %02x ", "Wifi channel informed to BT", \ + pCoexDm->wifiChnlInfo[0], pCoexDm->wifiChnlInfo[1], + pCoexDm->wifiChnlInfo[2]); + CL_PRINTF(cliBuf); + + // wifi status + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[Wifi Status]============"); + CL_PRINTF(cliBuf); + pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_WIFI_STATUS); + + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[BT Status]============"); + CL_PRINTF(cliBuf); + + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = [%s/ %d/ %d] ", "BT [status/ rssi/ retryCnt]", \ + ((pCoexSta->bC2hBtInquiryPage)?("inquiry/page scan"):((BT_8821A_CSR_2ANT_BT_STATUS_IDLE == pCoexDm->btStatus)? "idle":( (BT_8821A_CSR_2ANT_BT_STATUS_CONNECTED_IDLE == pCoexDm->btStatus)? "connected-idle":"busy"))), + pCoexSta->btRssi, pCoexSta->btRetryCnt); + CL_PRINTF(cliBuf); + + if(pStackInfo->bProfileNotified) + { + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d / %d / %d", "SCO/HID/PAN/A2DP", \ + pStackInfo->bScoExist, pStackInfo->bHidExist, pStackInfo->bPanExist, pStackInfo->bA2dpExist); + CL_PRINTF(cliBuf); + + pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_BT_LINK_INFO); + } + + btInfoExt = pCoexSta->btInfoExt; + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s", "BT Info A2DP rate", \ + (btInfoExt&BIT0)? "Basic rate":"EDR rate"); + CL_PRINTF(cliBuf); + + for(i=0; ibtInfoC2hCnt[i]) + { + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %02x %02x %02x %02x %02x %02x %02x(%d)", GLBtInfoSrc8821aCsr2Ant[i], \ + pCoexSta->btInfoC2h[i][0], pCoexSta->btInfoC2h[i][1], + pCoexSta->btInfoC2h[i][2], pCoexSta->btInfoC2h[i][3], + pCoexSta->btInfoC2h[i][4], pCoexSta->btInfoC2h[i][5], + pCoexSta->btInfoC2h[i][6], pCoexSta->btInfoC2hCnt[i]); + CL_PRINTF(cliBuf); + } + } + + // Sw mechanism + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[Sw mechanism]============"); + CL_PRINTF(cliBuf); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d ", "SM1[ShRf/ LpRA/ LimDig]", \ + pCoexDm->bCurRfRxLpfShrink, pCoexDm->bCurLowPenaltyRa, pCoexDm->bLimitedDig); + CL_PRINTF(cliBuf); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d(0x%x) ", "SM2[AgcT/ AdcB/ SwDacSwing(lvl)]", \ + pCoexDm->bCurAgcTableEn, pCoexDm->bCurAdcBackOff, pCoexDm->bCurDacSwingOn, pCoexDm->curDacSwingLvl); + CL_PRINTF(cliBuf); + + // Fw mechanism + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[Fw mechanism]============"); + CL_PRINTF(cliBuf); + + if(!pBtCoexist->bManualControl) + { + psTdmaCase = pCoexDm->curPsTdma; + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %02x %02x %02x %02x %02x case-%d", "PS TDMA", \ + pCoexDm->psTdmaPara[0], pCoexDm->psTdmaPara[1], + pCoexDm->psTdmaPara[2], pCoexDm->psTdmaPara[3], + pCoexDm->psTdmaPara[4], psTdmaCase); + CL_PRINTF(cliBuf); + + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d ", "DecBtPwr/ IgnWlanAct", \ + pCoexDm->bCurDecBtPwr, pCoexDm->bCurIgnoreWlanAct); + CL_PRINTF(cliBuf); + } + + // Hw setting + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[Hw setting]============"); + CL_PRINTF(cliBuf); + + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x", "RF-A, 0x1e initVal", \ + pCoexDm->btRf0x1eBackup); + CL_PRINTF(cliBuf); + + u1Tmp[0] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x778); + u1Tmp[1] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x6cc); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/ 0x%x ", "0x778 (W_Act)/ 0x6cc (CoTab Sel)", \ + u1Tmp[0], u1Tmp[1]); + CL_PRINTF(cliBuf); + + u1Tmp[0] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x8db); + u1Tmp[1] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0xc5b); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/ 0x%x", "0x8db(ADC)/0xc5b[29:25](DAC)", \ + ((u1Tmp[0]&0x60)>>5), ((u1Tmp[1]&0x3e)>>1)); + CL_PRINTF(cliBuf); + + u4Tmp[0] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0xcb4); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/ 0x%x", "0xcb4[7:0](ctrl)/ 0xcb4[29:28](val)", \ + u4Tmp[0]&0xff, ((u4Tmp[0]&0x30000000)>>28)); + CL_PRINTF(cliBuf); + + u1Tmp[0] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x40); + u4Tmp[0] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x4c); + u4Tmp[1] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x974); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/ 0x%x/ 0x%x", "0x40/ 0x4c[24:23]/ 0x974", \ + u1Tmp[0], ((u4Tmp[0]&0x01800000)>>23), u4Tmp[1]); + CL_PRINTF(cliBuf); + + u4Tmp[0] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x550); + u1Tmp[0] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x522); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/ 0x%x", "0x550(bcn ctrl)/0x522", \ + u4Tmp[0], u1Tmp[0]); + CL_PRINTF(cliBuf); + + u4Tmp[0] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0xc50); + u1Tmp[0] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0xa0a); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/ 0x%x", "0xc50(DIG)/0xa0a(CCK-TH)", \ + u4Tmp[0], u1Tmp[0]); + CL_PRINTF(cliBuf); + + u4Tmp[0] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0xf48); + u1Tmp[0] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0xa5b); + u1Tmp[1] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0xa5c); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/ 0x%x", "OFDM-FA/ CCK-FA", \ + u4Tmp[0], (u1Tmp[0]<<8) + u1Tmp[1] ); + CL_PRINTF(cliBuf); + + u4Tmp[0] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x6c0); + u4Tmp[1] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x6c4); + u4Tmp[2] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x6c8); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/ 0x%x/ 0x%x", "0x6c0/0x6c4/0x6c8", \ + u4Tmp[0], u4Tmp[1], u4Tmp[2]); + CL_PRINTF(cliBuf); + + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d", "0x770 (hi-pri Rx/Tx)", \ + pCoexSta->highPriorityRx, pCoexSta->highPriorityTx); + CL_PRINTF(cliBuf); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d", "0x774(low-pri Rx/Tx)", \ + pCoexSta->lowPriorityRx, pCoexSta->lowPriorityTx); + CL_PRINTF(cliBuf); + + pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_COEX_STATISTICS); +} + + +VOID +EXhalbtc8821aCsr2ant_IpsNotify( + IN PBTC_COEXIST pBtCoexist, + IN u1Byte type + ) +{ + if(BTC_IPS_ENTER == type) + { + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], IPS ENTER notify\n")); + pCoexSta->bUnderIps = TRUE; + halbtc8821aCsr2ant_CoexAllOff(pBtCoexist); + } + else if(BTC_IPS_LEAVE == type) + { + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], IPS LEAVE notify\n")); + pCoexSta->bUnderIps = FALSE; + //halbtc8821aCsr2ant_InitCoexDm(pBtCoexist); + } +} + +VOID +EXhalbtc8821aCsr2ant_LpsNotify( + IN PBTC_COEXIST pBtCoexist, + IN u1Byte type + ) +{ + if(BTC_LPS_ENABLE == type) + { + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], LPS ENABLE notify\n")); + pCoexSta->bUnderLps = TRUE; + } + else if(BTC_LPS_DISABLE == type) + { + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], LPS DISABLE notify\n")); + pCoexSta->bUnderLps = FALSE; + } +} + +VOID +EXhalbtc8821aCsr2ant_ScanNotify( + IN PBTC_COEXIST pBtCoexist, + IN u1Byte type + ) +{ + if(BTC_SCAN_START == type) + { + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN START notify\n")); + } + else if(BTC_SCAN_FINISH == type) + { + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN FINISH notify\n")); + } +} + +VOID +EXhalbtc8821aCsr2ant_ConnectNotify( + IN PBTC_COEXIST pBtCoexist, + IN u1Byte type + ) +{ + if(BTC_ASSOCIATE_START == type) + { + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT START notify\n")); + } + else if(BTC_ASSOCIATE_FINISH == type) + { + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT FINISH notify\n")); + } +} + +VOID +EXhalbtc8821aCsr2ant_MediaStatusNotify( + IN PBTC_COEXIST pBtCoexist, + IN u1Byte type + ) +{ + u1Byte H2C_Parameter[3] ={0}; + u4Byte wifiBw; + u1Byte wifiCentralChnl; + + if(BTC_MEDIA_CONNECT == type) + { + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], MEDIA connect notify\n")); + } + else + { + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], MEDIA disconnect notify\n")); + } + + // only 2.4G we need to inform bt the chnl mask + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_CENTRAL_CHNL, &wifiCentralChnl); + if( (BTC_MEDIA_CONNECT == type) && + (wifiCentralChnl <= 14) ) + { + H2C_Parameter[0] = 0x1; + H2C_Parameter[1] = wifiCentralChnl; + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); + if(BTC_WIFI_BW_HT40 == wifiBw) + H2C_Parameter[2] = 0x30; + else + H2C_Parameter[2] = 0x20; + } + + #if 0 /* REMOVE */ + pCoexDm->wifiChnlInfo[0] = H2C_Parameter[0]; + pCoexDm->wifiChnlInfo[1] = H2C_Parameter[1]; + pCoexDm->wifiChnlInfo[2] = H2C_Parameter[2]; + + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], FW write 0x66=0x%x\n", + H2C_Parameter[0]<<16|H2C_Parameter[1]<<8|H2C_Parameter[2])); + + rtw_warn_on(_BTCOEX_CSR); + pBtCoexist->fBtcFillH2c(pBtCoexist, 0x66, 3, H2C_Parameter); + #endif +} + +VOID +EXhalbtc8821aCsr2ant_SpecialPacketNotify( + IN PBTC_COEXIST pBtCoexist, + IN u1Byte type + ) +{ + if(type == BTC_PACKET_DHCP) + { + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], DHCP Packet notify\n")); + } +} + +VOID +EXhalbtc8821aCsr2ant_BtInfoNotify( + IN PBTC_COEXIST pBtCoexist, + IN pu1Byte tmpBuf, + IN u1Byte length + ) +{ + u1Byte btInfo=0; + u1Byte i, rspSource=0; + BOOLEAN bBtBusy=FALSE, bLimitedDig=FALSE; + BOOLEAN bWifiConnected=FALSE, bBtHsOn=FALSE, bWifiUnder5G=FALSE; + + pCoexSta->bC2hBtInfoReqSent = FALSE; + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_UNDER_5G, &bWifiUnder5G); + + rspSource = tmpBuf[0]&0xf; + if(rspSource >= BT_INFO_SRC_8821A_CSR_2ANT_MAX) + rspSource = BT_INFO_SRC_8821A_CSR_2ANT_WIFI_FW; + pCoexSta->btInfoC2hCnt[rspSource]++; + + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Bt info[%d], length=%d, hex data=[", rspSource, length)); + for(i=0; ibtInfoC2h[rspSource][i] = tmpBuf[i]; + if(i == 1) + btInfo = tmpBuf[i]; + if(i == length-1) + { + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("0x%02x]\n", tmpBuf[i])); + } + else + { + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("0x%02x, ", tmpBuf[i])); + } + } + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); + if(BT_INFO_SRC_8821A_CSR_2ANT_WIFI_FW != rspSource) + { + pCoexSta->btRetryCnt = // [3:0] + pCoexSta->btInfoC2h[rspSource][2]&0xf; + + pCoexSta->btRssi = + pCoexSta->btInfoC2h[rspSource][3]*2+10; + + pCoexSta->btInfoExt = + pCoexSta->btInfoC2h[rspSource][4]; + + #if 0 /* REMOVE */ + // Here we need to resend some wifi info to BT + // because bt is reset and loss of the info. + if( (pCoexSta->btInfoExt & BIT1) ) + { + + if(bWifiConnected) + { + EXhalbtc8821aCsr2ant_MediaStatusNotify(pBtCoexist, BTC_MEDIA_CONNECT); + } + else + { + EXhalbtc8821aCsr2ant_MediaStatusNotify(pBtCoexist, BTC_MEDIA_DISCONNECT); + } + } + #endif + + #if 0 /* REMOVE */ + if(!pBtCoexist->bManualControl && !bWifiUnder5G) + { + if( (pCoexSta->btInfoExt&BIT3) ) + { + if(bWifiConnected) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BT ext info bit3 check, set BT NOT to ignore Wlan active!!\n")); + halbtc8821aCsr2ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, FALSE); + } + } + else + { + // BT already NOT ignore Wlan active, do nothing here. + if(!bWifiConnected) + { + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BT ext info bit3 check, set BT to ignore Wlan active!!\n")); + halbtc8821aCsr2ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, TRUE); + } + } + } + #endif + + #if 0 /* REMOVE */ + if( (pCoexSta->btInfoExt & BIT4) ) + { + // BT auto report already enabled, do nothing + } + else + { + halbtc8821aCsr2ant_BtAutoReport(pBtCoexist, FORCE_EXEC, TRUE); + } + #endif + } + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); + + if(btInfo == BT_INFO_8821A_CSR_2ANT_B_CONNECTION) // connection exists but no busy + { + pCoexSta->bBtLinkExist = TRUE; + pCoexDm->btStatus = BT_8821A_CSR_2ANT_BT_STATUS_CONNECTED_IDLE; + } + else if(btInfo & BT_INFO_8821A_CSR_2ANT_B_CONNECTION) // connection exists and some link is busy + { + pCoexSta->bBtLinkExist = TRUE; + + if(btInfo & BT_INFO_8821A_CSR_2ANT_B_FTP) + pCoexSta->bPanExist = TRUE; + else + pCoexSta->bPanExist = FALSE; + + if(btInfo & BT_INFO_8821A_CSR_2ANT_B_A2DP) + pCoexSta->bA2dpExist = TRUE; + else + pCoexSta->bA2dpExist = FALSE; + + if(btInfo & BT_INFO_8821A_CSR_2ANT_B_HID) + pCoexSta->bHidExist = TRUE; + else + pCoexSta->bHidExist = FALSE; + + if(btInfo & BT_INFO_8821A_CSR_2ANT_B_SCO_ESCO) + pCoexSta->bScoExist = TRUE; + else + pCoexSta->bScoExist = FALSE; + + if (pCoexSta->btInfoExt & 0x80) + pCoexSta->bSlave = TRUE; //Slave + else + pCoexSta->bSlave = FALSE; //Master + + pCoexDm->btStatus = BT_8821A_CSR_2ANT_BT_STATUS_NON_IDLE; + } + else + { + pCoexSta->bBtLinkExist = FALSE; + pCoexSta->bPanExist = FALSE; + pCoexSta->bA2dpExist = FALSE; + pCoexSta->bSlave = FALSE; + pCoexSta->bHidExist = FALSE; + pCoexSta->bScoExist = FALSE; + pCoexDm->btStatus = BT_8821A_CSR_2ANT_BT_STATUS_IDLE; + } + + if(bBtHsOn) + { + pCoexDm->btStatus = BT_8821A_CSR_2ANT_BT_STATUS_NON_IDLE; + } + + if(btInfo & BT_INFO_8821A_CSR_2ANT_B_INQ_PAGE) + { + pCoexSta->bC2hBtInquiryPage = TRUE; + pCoexDm->btStatus = BT_8821A_CSR_2ANT_BT_STATUS_NON_IDLE; + } + else + { + pCoexSta->bC2hBtInquiryPage = FALSE; + } + + + if(BT_8821A_CSR_2ANT_BT_STATUS_NON_IDLE == pCoexDm->btStatus) + { + bBtBusy = TRUE; + } + else + { + bBtBusy = FALSE; + } + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_TRAFFIC_BUSY, &bBtBusy); + + if(BT_8821A_CSR_2ANT_BT_STATUS_IDLE != pCoexDm->btStatus) + { + bLimitedDig = TRUE; + } + else + { + bLimitedDig = FALSE; + } + pCoexDm->bLimitedDig = bLimitedDig; + pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_LIMITED_DIG, &bLimitedDig); + + halbtc8821aCsr2ant_RunCoexistMechanism(pBtCoexist); +} + +VOID +EXhalbtc8821aCsr2ant_HaltNotify( + IN PBTC_COEXIST pBtCoexist + ) +{ + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Halt notify\n")); + + halbtc8821aCsr2ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, TRUE); + EXhalbtc8821aCsr2ant_MediaStatusNotify(pBtCoexist, BTC_MEDIA_DISCONNECT); +} + +VOID +EXhalbtc8821aCsr2ant_PnpNotify( + IN PBTC_COEXIST pBtCoexist, + IN u1Byte pnpState + ) +{ + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Pnp notify\n")); + + if(BTC_WIFI_PNP_SLEEP == pnpState) + { + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Pnp notify to SLEEP\n")); + halbtc8821aCsr2ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, TRUE); + } + else if(BTC_WIFI_PNP_WAKE_UP == pnpState) + { + BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Pnp notify to WAKE UP\n")); + } +} + +VOID +EXhalbtc8821aCsr2ant_Periodical( + IN PBTC_COEXIST pBtCoexist + ) +{ + static u1Byte disVerInfoCnt=0; + u4Byte fwVer=0, btPatchVer=0; + PBTC_BOARD_INFO pBoardInfo=&pBtCoexist->boardInfo; + PBTC_STACK_INFO pStackInfo=&pBtCoexist->stackInfo; + + BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], ==========================Periodical===========================\n")); + + if(disVerInfoCnt <= 5) + { + disVerInfoCnt += 1; + BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], ****************************************************************\n")); + BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], Ant PG Num/ Ant Mech/ Ant Pos = %d/ %d/ %d\n", \ + pBoardInfo->pgAntNum, pBoardInfo->btdmAntNum, pBoardInfo->btdmAntPos)); + BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], BT stack/ hci ext ver = %s / %d\n", \ + ((pStackInfo->bProfileNotified)? "Yes":"No"), pStackInfo->hciVersion)); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_BT_PATCH_VER, &btPatchVer); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_FW_VER, &fwVer); + BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], CoexVer/ FwVer/ PatchVer = %d_%x/ 0x%x/ 0x%x(%d)\n", \ + GLCoexVerDate8821aCsr2Ant, GLCoexVer8821aCsr2Ant, fwVer, btPatchVer, btPatchVer)); + BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], ****************************************************************\n")); + } + + //halbtc8821aCsr2ant_QueryBtInfo(pBtCoexist); + //halbtc8821aCsr2ant_RunCoexistMechanism(pBtCoexist); + halbtc8821aCsr2ant_MonitorBtCtr(pBtCoexist); + halbtc8821aCsr2ant_MonitorBtEnableDisable(pBtCoexist); +} + + +#endif + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8821aCsr2Ant.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8821aCsr2Ant.h new file mode 100644 index 00000000000000..aeebf82196da11 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtc8821aCsr2Ant.h @@ -0,0 +1,207 @@ +//=========================================== +// The following is for 8821A_CSR 2Ant BT Co-exist definition +//=========================================== +#define BT_INFO_8821A_CSR_2ANT_B_FTP BIT7 +#define BT_INFO_8821A_CSR_2ANT_B_A2DP BIT6 +#define BT_INFO_8821A_CSR_2ANT_B_HID BIT5 +#define BT_INFO_8821A_CSR_2ANT_B_SCO_BUSY BIT4 +#define BT_INFO_8821A_CSR_2ANT_B_ACL_BUSY BIT3 +#define BT_INFO_8821A_CSR_2ANT_B_INQ_PAGE BIT2 +#define BT_INFO_8821A_CSR_2ANT_B_SCO_ESCO BIT1 +#define BT_INFO_8821A_CSR_2ANT_B_CONNECTION BIT0 + +#define BTC_RSSI_COEX_THRESH_TOL_8821A_CSR_2ANT 2 + +typedef enum _BT_INFO_SRC_8821A_CSR_2ANT{ + BT_INFO_SRC_8821A_CSR_2ANT_WIFI_FW = 0x0, + BT_INFO_SRC_8821A_CSR_2ANT_BT_RSP = 0x1, + BT_INFO_SRC_8821A_CSR_2ANT_BT_ACTIVE_SEND = 0x2, + BT_INFO_SRC_8821A_CSR_2ANT_MAX +}BT_INFO_SRC_8821A_CSR_2ANT,*PBT_INFO_SRC_8821A_CSR_2ANT; + +typedef enum _BT_8821A_CSR_2ANT_BT_STATUS{ + BT_8821A_CSR_2ANT_BT_STATUS_IDLE = 0x0, + BT_8821A_CSR_2ANT_BT_STATUS_CONNECTED_IDLE = 0x1, + BT_8821A_CSR_2ANT_BT_STATUS_NON_IDLE = 0x2, + BT_8821A_CSR_2ANT_BT_STATUS_MAX +}BT_8821A_CSR_2ANT_BT_STATUS,*PBT_8821A_CSR_2ANT_BT_STATUS; + +typedef enum _BT_8821A_CSR_2ANT_COEX_ALGO{ + BT_8821A_CSR_2ANT_COEX_ALGO_UNDEFINED = 0x0, + BT_8821A_CSR_2ANT_COEX_ALGO_SCO = 0x1, + BT_8821A_CSR_2ANT_COEX_ALGO_HID = 0x2, + BT_8821A_CSR_2ANT_COEX_ALGO_A2DP = 0x3, + BT_8821A_CSR_2ANT_COEX_ALGO_A2DP_PANHS = 0x4, + BT_8821A_CSR_2ANT_COEX_ALGO_PANEDR = 0x5, + BT_8821A_CSR_2ANT_COEX_ALGO_PANHS = 0x6, + BT_8821A_CSR_2ANT_COEX_ALGO_PANEDR_A2DP = 0x7, + BT_8821A_CSR_2ANT_COEX_ALGO_PANEDR_HID = 0x8, + BT_8821A_CSR_2ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9, + BT_8821A_CSR_2ANT_COEX_ALGO_HID_A2DP = 0xa, + BT_8821A_CSR_2ANT_COEX_ALGO_MAX = 0xb, +}BT_8821A_CSR_2ANT_COEX_ALGO,*PBT_8821A_CSR_2ANT_COEX_ALGO; + +typedef struct _COEX_DM_8821A_CSR_2ANT{ + // fw mechanism + BOOLEAN bPreDecBtPwr; + BOOLEAN bCurDecBtPwr; + u1Byte preFwDacSwingLvl; + u1Byte curFwDacSwingLvl; + BOOLEAN bCurIgnoreWlanAct; + BOOLEAN bPreIgnoreWlanAct; + u1Byte prePsTdma; + u1Byte curPsTdma; + u1Byte psTdmaPara[6]; + u1Byte psTdmaDuAdjType; + BOOLEAN bResetTdmaAdjust; + BOOLEAN bPrePsTdmaOn; + BOOLEAN bCurPsTdmaOn; + BOOLEAN bPreBtAutoReport; + BOOLEAN bCurBtAutoReport; + + // sw mechanism + BOOLEAN bPreRfRxLpfShrink; + BOOLEAN bCurRfRxLpfShrink; + u4Byte btRf0x1eBackup; + BOOLEAN bPreLowPenaltyRa; + BOOLEAN bCurLowPenaltyRa; + BOOLEAN bPreDacSwingOn; + u4Byte preDacSwingLvl; + BOOLEAN bCurDacSwingOn; + u4Byte curDacSwingLvl; + BOOLEAN bPreAdcBackOff; + BOOLEAN bCurAdcBackOff; + BOOLEAN bPreAgcTableEn; + BOOLEAN bCurAgcTableEn; + u4Byte preVal0x6c0; + u4Byte curVal0x6c0; + u4Byte preVal0x6c4; + u4Byte curVal0x6c4; + u4Byte preVal0x6c8; + u4Byte curVal0x6c8; + u1Byte preVal0x6cc; + u1Byte curVal0x6cc; + BOOLEAN bLimitedDig; + + u4Byte preRaMask; + u4Byte curRaMask; + + u1Byte curAmpduNumType; + u1Byte preAmpduNumType; + u2Byte backupAmpduMaxNum; + + u1Byte curAmpduTimeType; + u1Byte preAmpduTimeType; + u1Byte backupAmpduMaxTime; + + u1Byte curArfrType; + u1Byte preArfrType; + u4Byte backupArfrCnt1; + u4Byte backupArfrCnt2; + + u1Byte curRetryLimitType; + u1Byte preRetryLimitType; + u2Byte backupRetryLimit; + + // algorithm related + u1Byte preAlgorithm; + u1Byte curAlgorithm; + u1Byte btStatus; + u1Byte wifiChnlInfo[3]; +} COEX_DM_8821A_CSR_2ANT, *PCOEX_DM_8821A_CSR_2ANT; + +typedef struct _COEX_STA_8821A_CSR_2ANT{ + BOOLEAN bBtLinkExist; + BOOLEAN bScoExist; + BOOLEAN bA2dpExist; + BOOLEAN bSlave; + BOOLEAN bHidExist; + BOOLEAN bPanExist; + + BOOLEAN bUnderLps; + BOOLEAN bUnderIps; + u4Byte highPriorityTx; + u4Byte highPriorityRx; + u4Byte lowPriorityTx; + u4Byte lowPriorityRx; + u1Byte btRssi; + u1Byte preBtRssiState; + u1Byte preWifiRssiState[4]; + BOOLEAN bC2hBtInfoReqSent; + u1Byte btInfoC2h[BT_INFO_SRC_8821A_CSR_2ANT_MAX][10]; + u4Byte btInfoC2hCnt[BT_INFO_SRC_8821A_CSR_2ANT_MAX]; + BOOLEAN bC2hBtInquiryPage; + u1Byte btRetryCnt; + u1Byte btInfoExt; +}COEX_STA_8821A_CSR_2ANT, *PCOEX_STA_8821A_CSR_2ANT; + +//=========================================== +// The following is interface which will notify coex module. +//=========================================== +VOID +EXhalbtc8821aCsr2ant_PowerOnSetting( + IN PBTC_COEXIST pBtCoexist + ); +VOID +EXhalbtc8821aCsr2ant_InitHwConfig( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bWifiOnly + ); +VOID +EXhalbtc8821aCsr2ant_InitCoexDm( + IN PBTC_COEXIST pBtCoexist + ); +VOID +EXhalbtc8821aCsr2ant_IpsNotify( + IN PBTC_COEXIST pBtCoexist, + IN u1Byte type + ); +VOID +EXhalbtc8821aCsr2ant_LpsNotify( + IN PBTC_COEXIST pBtCoexist, + IN u1Byte type + ); +VOID +EXhalbtc8821aCsr2ant_ScanNotify( + IN PBTC_COEXIST pBtCoexist, + IN u1Byte type + ); +VOID +EXhalbtc8821aCsr2ant_ConnectNotify( + IN PBTC_COEXIST pBtCoexist, + IN u1Byte type + ); +VOID +EXhalbtc8821aCsr2ant_MediaStatusNotify( + IN PBTC_COEXIST pBtCoexist, + IN u1Byte type + ); +VOID +EXhalbtc8821aCsr2ant_SpecialPacketNotify( + IN PBTC_COEXIST pBtCoexist, + IN u1Byte type + ); +VOID +EXhalbtc8821aCsr2ant_BtInfoNotify( + IN PBTC_COEXIST pBtCoexist, + IN pu1Byte tmpBuf, + IN u1Byte length + ); +VOID +EXhalbtc8821aCsr2ant_HaltNotify( + IN PBTC_COEXIST pBtCoexist + ); +VOID +EXhalbtc8821aCsr2ant_PnpNotify( + IN PBTC_COEXIST pBtCoexist, + IN u1Byte pnpState + ); +VOID +EXhalbtc8821aCsr2ant_Periodical( + IN PBTC_COEXIST pBtCoexist + ); +VOID +EXhalbtc8821aCsr2ant_DisplayCoexInfo( + IN PBTC_COEXIST pBtCoexist + ); + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtcOutSrc.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtcOutSrc.h index 73b0baf746db78..d74397076ee58f 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtcOutSrc.h +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/HalBtcOutSrc.h @@ -4,6 +4,9 @@ #define NORMAL_EXEC FALSE #define FORCE_EXEC TRUE +#define BTC_RF_OFF 0x0 +#define BTC_RF_ON 0x1 + #define BTC_RF_A 0x0 #define BTC_RF_B 0x1 #define BTC_RF_C 0x2 @@ -42,6 +45,15 @@ typedef enum _BTC_POWERSAVE_TYPE{ BTC_PS_MAX } BTC_POWERSAVE_TYPE, *PBTC_POWERSAVE_TYPE; +typedef enum _BTC_BT_REG_TYPE{ + BTC_BT_REG_RF = 0, + BTC_BT_REG_MODEM = 1, + BTC_BT_REG_BLUEWIZE = 2, + BTC_BT_REG_VENDOR = 3, + BTC_BT_REG_LE = 4, + BTC_BT_REG_MAX +} BTC_BT_REG_TYPE, *PBTC_BT_REG_TYPE; + typedef enum _BTC_CHIP_INTERFACE{ BTC_INTF_UNKNOWN = 0, BTC_INTF_PCI = 1, @@ -156,7 +168,8 @@ typedef struct _BTC_BOARD_INFO{ u1Byte pgAntNum; // pg ant number u1Byte btdmAntNum; // ant number for btdm u1Byte btdmAntPos; //Bryant Add to indicate Antenna Position for (pgAntNum = 2) && (btdmAntNum =1) (DPDT+1Ant case) - BOOLEAN bBtExist; + u1Byte singleAntPath; // current used for 8723b only, 1=>s0, 0=>s1 + //BOOLEAN bBtExist; } BTC_BOARD_INFO, *PBTC_BOARD_INFO; typedef enum _BTC_DBG_OPCODE{ @@ -190,10 +203,18 @@ typedef enum _BTC_WIFI_ROLE{ BTC_ROLE_MAX }BTC_WIFI_ROLE,*PBTC_WIFI_ROLE; +typedef enum _BTC_WIRELESS_FREQ{ + BTC_FREQ_2_4G = 0x0, + BTC_FREQ_5G = 0x1, + BTC_FREQ_MAX +}BTC_WIRELESS_FREQ,*PBTC_WIRELESS_FREQ; + typedef enum _BTC_WIFI_BW_MODE{ BTC_WIFI_BW_LEGACY = 0x0, BTC_WIFI_BW_HT20 = 0x1, BTC_WIFI_BW_HT40 = 0x2, + BTC_WIFI_BW_HT80 = 0x3, + BTC_WIFI_BW_HT160 = 0x4, BTC_WIFI_BW_MAX }BTC_WIFI_BW_MODE,*PBTC_WIFI_BW_MODE; @@ -209,6 +230,26 @@ typedef enum _BTC_WIFI_PNP{ BTC_WIFI_PNP_MAX }BTC_WIFI_PNP,*PBTC_WIFI_PNP; +//for 8723b-d cut large current issue +typedef enum _BT_WIFI_COEX_STATE{ + BTC_WIFI_STAT_INIT, + BTC_WIFI_STAT_IQK, + BTC_WIFI_STAT_NORMAL_OFF, + BTC_WIFI_STAT_MP_OFF, + BTC_WIFI_STAT_NORMAL, + BTC_WIFI_STAT_ANT_DIV, + BTC_WIFI_STAT_MAX +}BT_WIFI_COEX_STATE,*PBT_WIFI_COEX_STATE; + +typedef enum _BT_ANT_TYPE{ + BTC_ANT_TYPE_0, + BTC_ANT_TYPE_1, + BTC_ANT_TYPE_2, + BTC_ANT_TYPE_3, + BTC_ANT_TYPE_4, + BTC_ANT_TYPE_MAX +}BT_ANT_TYPE,*PBT_ANT_TYPE; + // defined for BFP_BTC_GET typedef enum _BTC_GET_TYPE{ // type BOOLEAN @@ -225,6 +266,8 @@ typedef enum _BTC_GET_TYPE{ BTC_GET_BL_WIFI_ENABLE_ENCRYPTION, BTC_GET_BL_WIFI_UNDER_B_MODE, BTC_GET_BL_EXT_SWITCH, + BTC_GET_BL_WIFI_IS_IN_MP_MODE, + BTC_GET_BL_IS_ASUS_8723B, // type s4Byte BTC_GET_S4_WIFI_RSSI, @@ -243,6 +286,7 @@ typedef enum _BTC_GET_TYPE{ BTC_GET_U1_WIFI_HS_CHNL, BTC_GET_U1_MAC_PHY_MODE, BTC_GET_U1_AP_NUM, + BTC_GET_U1_ANT_TYPE, //===== for 1Ant ====== BTC_GET_U1_LPS_MODE, @@ -260,6 +304,8 @@ typedef enum _BTC_SET_TYPE{ BTC_SET_BL_TO_REJ_AP_AGG_PKT, BTC_SET_BL_BT_CTRL_AGG_SIZE, BTC_SET_BL_INC_SCAN_DEV_NUM, + BTC_SET_BL_BT_TX_RX_MASK, + BTC_SET_BL_MIRACAST_PLUS_BT, // type u1Byte BTC_SET_U1_RSSI_ADJ_VAL_FOR_AGC_TABLE_ON, @@ -285,6 +331,7 @@ typedef enum _BTC_SET_TYPE{ // BT Coex related BTC_SET_ACT_CTRL_BT_INFO, BTC_SET_ACT_CTRL_BT_COEX, + BTC_SET_ACT_CTRL_8723B_ANT, //================= BTC_SET_MAX }BTC_SET_TYPE,*PBTC_SET_TYPE; @@ -292,7 +339,7 @@ typedef enum _BTC_SET_TYPE{ typedef enum _BTC_DBG_DISP_TYPE{ BTC_DBG_DISP_COEX_STATISTICS = 0x0, BTC_DBG_DISP_BT_LINK_INFO = 0x1, - BTC_DBG_DISP_FW_PWR_MODE_CMD = 0x2, + BTC_DBG_DISP_WIFI_STATUS = 0x2, BTC_DBG_DISP_MAX }BTC_DBG_DISP_TYPE,*PBTC_DBG_DISP_TYPE; @@ -382,6 +429,12 @@ typedef VOID IN u4Byte Data ); typedef VOID +(*BFP_BTC_LOCAL_REG_W1)( + IN PVOID pBtcContext, + IN u4Byte RegAddr, + IN u1Byte Data + ); +typedef VOID (*BFP_BTC_SET_BB_REG)( IN PVOID pBtcContext, IN u4Byte RegAddr, @@ -410,13 +463,6 @@ typedef u4Byte IN u4Byte BitMask ); typedef VOID -(*BFP_BTC_SET_BT_REG)( - IN PVOID pBtcContext, - IN u1Byte RegType, - IN u4Byte RegAddr, - IN u4Byte Data - ); -typedef VOID (*BFP_BTC_FILL_H2C)( IN PVOID pBtcContext, IN u1Byte elementId, @@ -438,6 +484,19 @@ typedef BOOLEAN OUT PVOID pInBuf ); typedef VOID +(*BFP_BTC_SET_BT_REG)( + IN PVOID pBtcContext, + IN u1Byte regType, + IN u4Byte offset, + IN u4Byte value + ); +typedef u4Byte +(*BFP_BTC_GET_BT_REG)( + IN PVOID pBtcContext, + IN u1Byte regType, + IN u4Byte offset + ); +typedef VOID (*BFP_BTC_DISP_DBG_MSG)( IN PVOID pBtCoexist, IN u1Byte dispType @@ -449,8 +508,10 @@ typedef struct _BTC_BT_INFO{ u1Byte rssiAdjustFor1AntCoexType; BOOLEAN bPreBtCtrlAggBufSize; BOOLEAN bBtCtrlAggBufSize; + BOOLEAN bPreRejectAggPkt; BOOLEAN bRejectAggPkt; BOOLEAN bIncreaseScanDevNum; + BOOLEAN bBtTxRxMask; u1Byte preAggBufSize; u1Byte aggBufSize; BOOLEAN bBtBusy; @@ -458,6 +519,8 @@ typedef struct _BTC_BT_INFO{ u2Byte btHciVer; u2Byte btRealFwVer; u1Byte btFwVer; + u4Byte getBtFwVerCnt; + BOOLEAN bMiracastPlusBt; BOOLEAN bBtDisableLowPwr; @@ -486,6 +549,7 @@ typedef struct _BTC_STACK_INFO{ typedef struct _BTC_BT_LINK_INFO{ BOOLEAN bBtLinkExist; + BOOLEAN bBtHiPriLinkExist; BOOLEAN bScoExist; BOOLEAN bScoOnly; BOOLEAN bA2dpExist; @@ -494,10 +558,14 @@ typedef struct _BTC_BT_LINK_INFO{ BOOLEAN bHidOnly; BOOLEAN bPanExist; BOOLEAN bPanOnly; + BOOLEAN bSlaveRole; + BOOLEAN bAclBusy; } BTC_BT_LINK_INFO, *PBTC_BT_LINK_INFO; typedef struct _BTC_STATISTICS{ u4Byte cntBind; + u4Byte cntPowerOn; + u4Byte cntPreLoadFirmware; u4Byte cntInitHwConfig; u4Byte cntInitCoexDm; u4Byte cntIpsNotify; @@ -507,6 +575,7 @@ typedef struct _BTC_STATISTICS{ u4Byte cntMediaStatusNotify; u4Byte cntSpecialPacketNotify; u4Byte cntBtInfoNotify; + u4Byte cntRfStatusNotify; u4Byte cntPeriodical; u4Byte cntCoexDmSwitch; u4Byte cntStackOperationNotify; @@ -538,6 +607,7 @@ typedef struct _BTC_COEXIST{ BFP_BTC_W2 fBtcWrite2Byte; BFP_BTC_R4 fBtcRead4Byte; BFP_BTC_W4 fBtcWrite4Byte; + BFP_BTC_LOCAL_REG_W1 fBtcWriteLocalReg1Byte; // read/write bb related BFP_BTC_SET_BB_REG fBtcSetBbReg; BFP_BTC_GET_BB_REG fBtcGetBbReg; @@ -546,9 +616,6 @@ typedef struct _BTC_COEXIST{ BFP_BTC_SET_RF_REG fBtcSetRfReg; BFP_BTC_GET_RF_REG fBtcGetRfReg; - //write bt reg related - BFP_BTC_SET_BT_REG fBtcSetBtReg; - // fill h2c related BFP_BTC_FILL_H2C fBtcFillH2c; // other @@ -556,19 +623,31 @@ typedef struct _BTC_COEXIST{ // normal get/set related BFP_BTC_GET fBtcGet; BFP_BTC_SET fBtcSet; + + BFP_BTC_GET_BT_REG fBtcGetBtReg; + BFP_BTC_SET_BT_REG fBtcSetBtReg; } BTC_COEXIST, *PBTC_COEXIST; extern BTC_COEXIST GLBtCoexist; BOOLEAN EXhalbtcoutsrc_InitlizeVariables( - IN PVOID Adapter + IN PVOID Adapter ); VOID -EXhalbtcoutsrc_InitHwConfig( +EXhalbtcoutsrc_PowerOnSetting( + IN PBTC_COEXIST pBtCoexist + ); +VOID +EXhalbtcoutsrc_PreLoadFirmware( IN PBTC_COEXIST pBtCoexist ); VOID +EXhalbtcoutsrc_InitHwConfig( + IN PBTC_COEXIST pBtCoexist, + IN BOOLEAN bWifiOnly + ); +VOID EXhalbtcoutsrc_InitCoexDm( IN PBTC_COEXIST pBtCoexist ); @@ -609,6 +688,11 @@ EXhalbtcoutsrc_BtInfoNotify( IN u1Byte length ); VOID +EXhalbtcoutsrc_RfStatusNotify( + IN PBTC_COEXIST pBtCoexist, + IN u1Byte type + ); +VOID EXhalbtcoutsrc_StackOperationNotify( IN PBTC_COEXIST pBtCoexist, IN u1Byte type @@ -618,10 +702,6 @@ EXhalbtcoutsrc_HaltNotify( IN PBTC_COEXIST pBtCoexist ); VOID -EXhalbtcoutsrc_SwitchGntBt( - IN PBTC_COEXIST pBtCoexist - ); -VOID EXhalbtcoutsrc_PnpNotify( IN PBTC_COEXIST pBtCoexist, IN u1Byte pnpState @@ -642,6 +722,14 @@ EXhalbtcoutsrc_DbgControl( IN pu1Byte pData ); VOID +EXhalbtcoutsrc_AntennaDetection( + IN PBTC_COEXIST pBtCoexist, + IN u4Byte centFreq, + IN u4Byte offset, + IN u4Byte span, + IN u4Byte seconds + ); +VOID EXhalbtcoutsrc_StackUpdateProfileInfo( VOID ); @@ -658,10 +746,12 @@ VOID EXhalbtcoutsrc_UpdateMinBtRssi( IN s1Byte btRssi ); +#if 0 VOID EXhalbtcoutsrc_SetBtExist( IN BOOLEAN bBtExist ); +#endif VOID EXhalbtcoutsrc_SetChipType( IN u1Byte chipType @@ -672,8 +762,16 @@ EXhalbtcoutsrc_SetAntNum( IN u1Byte antNum ); VOID +EXhalbtcoutsrc_SetSingleAntPath( + IN u1Byte singleAntPath + ); +VOID EXhalbtcoutsrc_DisplayBtCoexInfo( IN PBTC_COEXIST pBtCoexist ); +VOID +EXhalbtcoutsrc_DisplayAntIsolation( + IN PBTC_COEXIST pBtCoexist + ); #endif diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/Mp_Precomp.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/Mp_Precomp.h index fdd940611f6f4f..b1fc17ba14844a 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/Mp_Precomp.h +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC-BTCoexist/Mp_Precomp.h @@ -52,5 +52,6 @@ #include "HalBtc8812a2Ant.h" #include "HalBtc8821a1Ant.h" #include "HalBtc8821a2Ant.h" +#include "HalBtc8821aCsr2Ant.h" #endif // __MP_PRECOMP_H__ diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/HalPhyRf.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/HalPhyRf.c index d74846cb30479e..7eaaa54e8e7b19 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/HalPhyRf.c +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/HalPhyRf.c @@ -18,8 +18,8 @@ * ******************************************************************************/ -//#include "Mp_Precomp.h" -#include "odm_precomp.h" +#include "Mp_Precomp.h" +#include "phydm_precomp.h" #define CALCULATE_SWINGTALBE_OFFSET(_offset, _direction, _size, _deltaThermal) \ @@ -37,12 +37,70 @@ _offset = _size-1;\ } while(0) +#if (RTL8192C_SUPPORT||RTL8192D_SUPPORT||RTL8723A_SUPPORT) +void phydm_txpwrtrack_setpwr_dummy( + PDM_ODM_T pDM_Odm, + PWRTRACK_METHOD Method, + u1Byte RFPath, + u1Byte ChannelMappedIndex + ) +{}; + +void doiqk_dummy( + PDM_ODM_T pDM_Odm, + u1Byte DeltaThermalIndex, + u1Byte ThermalValue, + u1Byte Threshold + ) +{}; + +VOID phy_lccalibrate_dummy( + IN PDM_ODM_T pDM_Odm + ) +{}; + +VOID get_delta_swing_table_dummy( + IN PDM_ODM_T pDM_Odm, + OUT pu1Byte *TemperatureUP_A, + OUT pu1Byte *TemperatureDOWN_A, + OUT pu1Byte *TemperatureUP_B, + OUT pu1Byte *TemperatureDOWN_B + ) +{}; + +void configure_txpower_track_dummy( + PTXPWRTRACK_CFG pConfig + ) +{ + + pConfig->ODM_TxPwrTrackSetPwr = phydm_txpwrtrack_setpwr_dummy; + pConfig->DoIQK = doiqk_dummy; + pConfig->PHY_LCCalibrate = phy_lccalibrate_dummy; + pConfig->GetDeltaSwingTable = get_delta_swing_table_dummy; +} +#endif void ConfigureTxpowerTrack( IN PDM_ODM_T pDM_Odm, OUT PTXPWRTRACK_CFG pConfig ) { + +#if RTL8192C_SUPPORT + if(pDM_Odm->SupportICType==ODM_RTL8192C) + configure_txpower_track_dummy(pConfig); +#endif + +#if RTL8192D_SUPPORT + if(pDM_Odm->SupportICType==ODM_RTL8192D) + configure_txpower_track_dummy(pConfig); +#endif + +#if RTL8723A_SUPPORT + if(pDM_Odm->SupportICType==ODM_RTL8723A) + configure_txpower_track_dummy(pConfig); +#endif + #if RTL8192E_SUPPORT if(pDM_Odm->SupportICType==ODM_RTL8192E) ConfigureTxpowerTrack_8192E(pConfig); @@ -161,7 +219,7 @@ ODM_TXPowerTrackingCallback_ThermalMeter( #endif #if (DM_ODM_SUPPORT_TYPE == ODM_CE) - if ( *(pDM_Odm->mp_mode) == 1) + if (pDM_Odm->mp_mode == TRUE) #endif // RFCalibrateInfo.RegA24 will be initialized when ODM HW configuring, but MP configures with para files. pDM_Odm->RFCalibrateInfo.RegA24 = 0x090e1317; diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/Mp_Precomp.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/Mp_Precomp.h new file mode 100644 index 00000000000000..43ea006e752ba5 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/Mp_Precomp.h @@ -0,0 +1,24 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +//#include +//#include "phydm_precomp.h" +//#include "../phydm_precomp.h" + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/PhyDM_Adaptivity.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/PhyDM_Adaptivity.c new file mode 100644 index 00000000000000..4b1420e0dfefd2 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/PhyDM_Adaptivity.c @@ -0,0 +1,922 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +//============================================================ +// include files +//============================================================ +#include "Mp_Precomp.h" +#include "phydm_precomp.h" + +#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) +#if WPP_SOFTWARE_TRACE +#include "PhyDM_Adaptivity.tmh" +#endif +#endif + + +VOID +Phydm_CheckAdaptivity( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + if(pDM_Odm->SupportAbility & ODM_BB_ADAPTIVITY) + { + if(pDM_Odm->DynamicLinkAdaptivity == TRUE) + { + if(pDM_Odm->bLinked && pDM_Odm->bCheck == FALSE) + { + Phydm_NHMCounterStatistics(pDM_Odm); + Phydm_CheckEnvironment(pDM_Odm); + } + else if(!pDM_Odm->bLinked) + { + pDM_Odm->bCheck = FALSE; + } + } + else + { + pDM_Odm->Adaptivity_enable = TRUE; + + if(pDM_Odm->SupportICType & ODM_RTL8814A) + pDM_Odm->adaptivity_flag = FALSE; + else + pDM_Odm->adaptivity_flag = TRUE; + + } + } + else + { + pDM_Odm->Adaptivity_enable = FALSE; + pDM_Odm->adaptivity_flag = FALSE; + } + +} + +VOID +Phydm_NHMCounterStatisticsInit( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + + if(pDM_Odm->SupportICType & ODM_IC_11AC_SERIES) + { + //PHY parameters initialize for ac series + ODM_Write2Byte(pDM_Odm, ODM_REG_NHM_TIMER_11AC+2, 0xC350); //0x990[31:16]=0xC350 Time duration for NHM unit: us, 0xc350=200ms + ODM_Write2Byte(pDM_Odm, ODM_REG_NHM_TH9_TH10_11AC+2, 0xffff); //0x994[31:16]=0xffff th_9, th_10 + //ODM_Write4Byte(pDM_Odm, ODM_REG_NHM_TH3_TO_TH0_11AC, 0xffffff5c); //0x998=0xffffff5c th_3, th_2, th_1, th_0 + ODM_Write4Byte(pDM_Odm, ODM_REG_NHM_TH3_TO_TH0_11AC, 0xffffff50); //0x998=0xffffff52 th_3, th_2, th_1, th_0 + ODM_Write4Byte(pDM_Odm, ODM_REG_NHM_TH7_TO_TH4_11AC, 0xffffffff); //0x99c=0xffffffff th_7, th_6, th_5, th_4 + ODM_SetBBReg(pDM_Odm, ODM_REG_NHM_TH8_11AC, bMaskByte0, 0xff); //0x9a0[7:0]=0xff th_8 + //ODM_SetBBReg(pDM_Odm, ODM_REG_NHM_TH9_TH10_11AC, BIT8|BIT9|BIT10, 0x7); //0x994[9:8]=3 enable CCX + ODM_SetBBReg(pDM_Odm, ODM_REG_NHM_TH9_TH10_11AC, BIT8|BIT9|BIT10, 0x1); //0x994[10:8]=1 ignoreCCA ignore PHYTXON enable CCX + ODM_SetBBReg(pDM_Odm, ODM_REG_NHM_9E8_11AC, BIT0, 0x1); //0x9e8[7]=1 max power among all RX ants + + } + else if (pDM_Odm->SupportICType & ODM_IC_11N_SERIES) + { + //PHY parameters initialize for n series + ODM_Write2Byte(pDM_Odm, ODM_REG_NHM_TIMER_11N+2, 0xC350); //0x894[31:16]=0x0xC350 Time duration for NHM unit: us, 0xc350=200ms + //ODM_Write2Byte(pDM_Odm, ODM_REG_NHM_TIMER_11N+2, 0x4e20); //0x894[31:16]=0x4e20 Time duration for NHM unit: 4us, 0x4e20=80ms + ODM_Write2Byte(pDM_Odm, ODM_REG_NHM_TH9_TH10_11N+2, 0xffff); //0x890[31:16]=0xffff th_9, th_10 + //ODM_Write4Byte(pDM_Odm, ODM_REG_NHM_TH3_TO_TH0_11N, 0xffffff5c); //0x898=0xffffff5c th_3, th_2, th_1, th_0 + ODM_Write4Byte(pDM_Odm, ODM_REG_NHM_TH3_TO_TH0_11N, 0xffffff50); //0x898=0xffffff52 th_3, th_2, th_1, th_0 + ODM_Write4Byte(pDM_Odm, ODM_REG_NHM_TH7_TO_TH4_11N, 0xffffffff); //0x89c=0xffffffff th_7, th_6, th_5, th_4 + ODM_SetBBReg(pDM_Odm, ODM_REG_FPGA0_IQK_11N, bMaskByte0, 0xff); //0xe28[7:0]=0xff th_8 + //ODM_SetBBReg(pDM_Odm, ODM_REG_NHM_TH9_TH10_11N, BIT10|BIT9|BIT8, 0x7); //0x890[9:8]=3 enable CCX + ODM_SetBBReg(pDM_Odm, ODM_REG_NHM_TH9_TH10_11N, BIT10|BIT9|BIT8, 0x1); //0x890[10:8]=1 ignoreCCA ignore PHYTXON enable CCX + ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_RSTC_11N, BIT7, 0x1); //0xc0c[7]=1 max power among all RX ants + } +} + +VOID +Phydm_NHMCounterStatistics( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + + if(!(pDM_Odm->SupportAbility & ODM_BB_NHM_CNT)) + return; + + // Get NHM report + Phydm_GetNHMCounterStatistics(pDM_Odm); + + // Reset NHM counter + Phydm_NHMCounterStatisticsReset(pDM_Odm); +} + +VOID +Phydm_GetNHMCounterStatistics( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + u4Byte value32 = 0; + + if (pDM_Odm->SupportICType & ODM_IC_11AC_SERIES) + value32 = ODM_GetBBReg(pDM_Odm, ODM_REG_NHM_CNT_11AC, bMaskDWord); + else if (pDM_Odm->SupportICType & ODM_IC_11N_SERIES) + value32 = ODM_GetBBReg(pDM_Odm, ODM_REG_NHM_CNT_11N, bMaskDWord); + + pDM_Odm->NHM_cnt_0 = (u1Byte)(value32 & bMaskByte0); + pDM_Odm->NHM_cnt_1 = (u1Byte)((value32 & bMaskByte1)>>8); + +} + +VOID +Phydm_NHMCounterStatisticsReset( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + + if (pDM_Odm->SupportICType & ODM_IC_11AC_SERIES) + { + ODM_SetBBReg(pDM_Odm, ODM_REG_NHM_TH9_TH10_11AC, BIT1, 0); + ODM_SetBBReg(pDM_Odm, ODM_REG_NHM_TH9_TH10_11AC, BIT1, 1); + } + else if (pDM_Odm->SupportICType & ODM_IC_11N_SERIES) + { + ODM_SetBBReg(pDM_Odm, ODM_REG_NHM_TH9_TH10_11N, BIT1, 0); + ODM_SetBBReg(pDM_Odm, ODM_REG_NHM_TH9_TH10_11N, BIT1, 1); + } +} + +VOID +Phydm_SetEDCCAThreshold( + IN PVOID pDM_VOID, + IN s1Byte H2L, + IN s1Byte L2H +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + + if(pDM_Odm->SupportICType & ODM_IC_11N_SERIES) + { + ODM_SetBBReg(pDM_Odm,rOFDM0_ECCAThreshold, bMaskByte0, (u1Byte)L2H); + ODM_SetBBReg(pDM_Odm,rOFDM0_ECCAThreshold, bMaskByte2, (u1Byte)H2L); + } + else if(pDM_Odm->SupportICType & ODM_IC_11AC_SERIES) + { + ODM_SetBBReg(pDM_Odm, rFPGA0_XB_LSSIReadBack, bMaskByte0, (u1Byte)L2H); + ODM_SetBBReg(pDM_Odm, rFPGA0_XB_LSSIReadBack, bMaskByte1, (u1Byte)H2L); + } + +} + +VOID +Phydm_SetTRxMux( + IN PVOID pDM_VOID, + IN PhyDM_Trx_MUX_Type txMode, + IN PhyDM_Trx_MUX_Type rxMode +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + + if (pDM_Odm->SupportICType & ODM_IC_11N_SERIES) + { + ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_RPT_FORMAT_11N, BIT3|BIT2|BIT1, txMode); // set TXmod to standby mode to remove outside noise affect + ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_RPT_FORMAT_11N, BIT22|BIT21|BIT20, rxMode); // set RXmod to standby mode to remove outside noise affect + if(pDM_Odm->RFType > ODM_1T1R) + { + ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_RPT_FORMAT_11N_B, BIT3|BIT2|BIT1, txMode); // set TXmod to standby mode to remove outside noise affect + ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_RPT_FORMAT_11N_B, BIT22|BIT21|BIT20, rxMode); // set RXmod to standby mode to remove outside noise affect + } + } + else if(pDM_Odm->SupportICType & ODM_IC_11AC_SERIES) + { + ODM_SetBBReg(pDM_Odm, ODM_REG_TRMUX_11AC, BIT11|BIT10|BIT9|BIT8, txMode); // set TXmod to standby mode to remove outside noise affect + ODM_SetBBReg(pDM_Odm, ODM_REG_TRMUX_11AC, BIT7|BIT6|BIT5|BIT4, rxMode); // set RXmod to standby mode to remove outside noise affect + if(pDM_Odm->RFType > ODM_1T1R) + { + ODM_SetBBReg(pDM_Odm, ODM_REG_TRMUX_11AC_B, BIT11|BIT10|BIT9|BIT8, txMode); // set TXmod to standby mode to remove outside noise affect + ODM_SetBBReg(pDM_Odm, ODM_REG_TRMUX_11AC_B, BIT7|BIT6|BIT5|BIT4, rxMode); // set RXmod to standby mode to remove outside noise affect + } + } + +} + +VOID +Phydm_MACEDCCAState( + IN PVOID pDM_VOID, + IN PhyDM_MACEDCCA_Type State +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + if(State == PhyDM_IGNORE_EDCCA) + { + ODM_SetMACReg(pDM_Odm, REG_TX_PTCL_CTRL, BIT15, 1); //ignore EDCCA reg520[15]=1 + ODM_SetMACReg(pDM_Odm, REG_RD_CTRL, BIT11, 0); //reg524[11]=0 + } + else // don't set MAC ignore EDCCA signal + { + ODM_SetMACReg(pDM_Odm, REG_TX_PTCL_CTRL, BIT15, 0); //don't ignore EDCCA reg520[15]=0 + ODM_SetMACReg(pDM_Odm, REG_RD_CTRL, BIT11, 1); //reg524[11]=1 + } + + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("EDCCA enable State = %d \n", State)); + +} + +BOOLEAN +Phydm_CalNHMcnt( + IN PVOID pDM_VOID +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + u2Byte Base = 0; + + Base = pDM_Odm->NHM_cnt_0 + pDM_Odm->NHM_cnt_1; + + if(Base != 0) + { + pDM_Odm->NHM_cnt_0 = ((pDM_Odm->NHM_cnt_0) << 8) / Base; + pDM_Odm->NHM_cnt_1 = ((pDM_Odm->NHM_cnt_1) << 8) / Base; + } + if((pDM_Odm->NHM_cnt_0 - pDM_Odm->NHM_cnt_1) >= 100) + return TRUE; // clean environment + else + return FALSE; //noisy environment + +} + + +VOID +Phydm_CheckEnvironment( + IN PVOID pDM_VOID +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + BOOLEAN isCleanEnvironment = FALSE; + u1Byte clean = 0; + + if(pDM_Odm->bFirstLink == TRUE) + { + if(pDM_Odm->SupportICType & ODM_RTL8814A) + pDM_Odm->adaptivity_flag = FALSE; + else + pDM_Odm->adaptivity_flag = TRUE; + + pDM_Odm->bFirstLink = FALSE; + return; + } + else + { + if(pDM_Odm->NHMWait < 3) // Start enter NHM after 4 NHMWait + { + pDM_Odm->NHMWait ++; + Phydm_NHMCounterStatistics(pDM_Odm); + return; + } + else + { + Phydm_NHMCounterStatistics(pDM_Odm); + isCleanEnvironment = Phydm_CalNHMcnt(pDM_Odm); + if(isCleanEnvironment == TRUE) + { +#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) + pDM_Odm->TH_L2H_ini = pDM_Odm->TH_L2H_ini_backup; //mode 1 + pDM_Odm->TH_EDCCA_HL_diff= pDM_Odm->TH_EDCCA_HL_diff_backup; +#endif + pDM_Odm->Adaptivity_enable = TRUE; + + if(pDM_Odm->SupportICType & ODM_RTL8814A) + pDM_Odm->adaptivity_flag = FALSE; + else + pDM_Odm->adaptivity_flag = TRUE; + } + else + { +#if(DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) + Phydm_SetEDCCAThreshold(pDM_Odm, 0x7f, 0x7f); +#else + pDM_Odm->TH_L2H_ini = pDM_Odm->TH_L2H_ini_mode2; // for AP mode 2 + pDM_Odm->TH_EDCCA_HL_diff= pDM_Odm->TH_EDCCA_HL_diff_mode2; +#endif + pDM_Odm->adaptivity_flag = FALSE; + pDM_Odm->Adaptivity_enable = FALSE; + } + + pDM_Odm->bFirstLink = TRUE; + pDM_Odm->bCheck = TRUE; + } + + } + + +} + +VOID +Phydm_SearchPwdBLowerBound( + IN PVOID pDM_VOID +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + u4Byte value32 =0; + u1Byte cnt, IGI_Pause = 0x7f, IGI_Resume = 0x20, IGI = 0x50; //IGI = 0x50 for cal EDCCA lower bound + u1Byte txEdcca1 = 0, txEdcca0 = 0; + BOOLEAN bAdjust=TRUE; + s1Byte TH_L2H_dmc, TH_H2L_dmc, IGI_target = 0x32; + s1Byte Diff; + + Phydm_SetTRxMux(pDM_Odm, PhyDM_STANDBY_MODE, PhyDM_STANDBY_MODE); + ODM_Write_DIG(pDM_Odm, IGI_Pause); + + Diff = IGI_target -(s1Byte)IGI; + TH_L2H_dmc = pDM_Odm->TH_L2H_ini + Diff; + if(TH_L2H_dmc > 10) + TH_L2H_dmc = 10; + TH_H2L_dmc = TH_L2H_dmc - pDM_Odm->TH_EDCCA_HL_diff; + + Phydm_SetEDCCAThreshold(pDM_Odm, TH_H2L_dmc, TH_L2H_dmc); + ODM_delay_ms(5); + + while(bAdjust) + { + for(cnt=0; cnt<20; cnt ++) + { + if (pDM_Odm->SupportICType & ODM_IC_11N_SERIES) + value32 = ODM_GetBBReg(pDM_Odm,ODM_REG_RPT_11N, bMaskDWord); + else if(pDM_Odm->SupportICType & ODM_IC_11AC_SERIES) + value32 = ODM_GetBBReg(pDM_Odm,ODM_REG_RPT_11AC, bMaskDWord); + + if (value32 & BIT30 && (pDM_Odm->SupportICType & (ODM_RTL8723A|ODM_RTL8723B|ODM_RTL8188E))) + txEdcca1 = txEdcca1 + 1; + else if(value32 & BIT29) + txEdcca1 = txEdcca1 + 1; + else + txEdcca0 = txEdcca0 + 1; + } + + if(txEdcca1 > 9 ) + { + IGI = IGI -1; + TH_L2H_dmc = TH_L2H_dmc + 1; + if(TH_L2H_dmc > 10) + TH_L2H_dmc = 10; + TH_H2L_dmc = TH_L2H_dmc - pDM_Odm->TH_EDCCA_HL_diff; + + Phydm_SetEDCCAThreshold(pDM_Odm, TH_H2L_dmc, TH_L2H_dmc); + + txEdcca1 = 0; + txEdcca0 = 0; + + if(TH_L2H_dmc == 10) + { + bAdjust = FALSE; + pDM_Odm->H2L_lb = TH_H2L_dmc; + pDM_Odm->L2H_lb = TH_L2H_dmc; + pDM_Odm->Adaptivity_IGI_upper = IGI; + } + } + else + { + bAdjust = FALSE; + pDM_Odm->H2L_lb = TH_H2L_dmc; + pDM_Odm->L2H_lb = TH_L2H_dmc; + pDM_Odm->Adaptivity_IGI_upper = IGI; + } + } + + Phydm_SetTRxMux(pDM_Odm, PhyDM_TX_MODE, PhyDM_RX_MODE); + ODM_Write_DIG(pDM_Odm, IGI_Resume); + Phydm_SetEDCCAThreshold(pDM_Odm, 0x7f, 0x7f); // resume to no link state +} + +VOID +Phydm_AdaptivityInit( + IN PVOID pDM_VOID +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; +#if(DM_ODM_SUPPORT_TYPE == ODM_WIN) + PADAPTER pAdapter = pDM_Odm->Adapter; + PMGNT_INFO pMgntInfo = &(pAdapter->MgntInfo); + pDM_Odm->Carrier_Sense_enable = (BOOLEAN)pMgntInfo->RegEnableCarrierSense; + pDM_Odm->DynamicLinkAdaptivity = (BOOLEAN)pMgntInfo->RegDmLinkAdaptivity; +#elif(DM_ODM_SUPPORT_TYPE == ODM_CE) + pDM_Odm->Carrier_Sense_enable = (pDM_Odm->Adapter->registrypriv.adaptivity_mode!=0)?TRUE:FALSE; + pDM_Odm->DynamicLinkAdaptivity = (pDM_Odm->Adapter->registrypriv.adaptivity_dml!=0)?TRUE:FALSE; +#endif + +#if(DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_WIN)) + + if(pDM_Odm->Carrier_Sense_enable == FALSE) + { +#if(DM_ODM_SUPPORT_TYPE == ODM_WIN) + if( pMgntInfo->RegL2HForAdaptivity != 0 ) + pDM_Odm->TH_L2H_ini = pMgntInfo->RegL2HForAdaptivity; + else +#endif + pDM_Odm->TH_L2H_ini = 0xf5; // -7 + } + else + { +#if(DM_ODM_SUPPORT_TYPE == ODM_WIN) + if( pMgntInfo->RegL2HForAdaptivity != 0 ) + pDM_Odm->TH_L2H_ini = pMgntInfo->RegL2HForAdaptivity; + else +#endif + pDM_Odm->TH_L2H_ini = 0xa; + } + +#if(DM_ODM_SUPPORT_TYPE == ODM_WIN) + if( pMgntInfo->RegHLDiffForAdaptivity != 0 ) + pDM_Odm->TH_EDCCA_HL_diff = pMgntInfo->RegHLDiffForAdaptivity; + else +#endif + pDM_Odm->TH_EDCCA_HL_diff = 7; + + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("TH_L2H_ini = 0x%x, TH_EDCCA_HL_diff = 0x%x\n", pDM_Odm->TH_L2H_ini, pDM_Odm->TH_EDCCA_HL_diff)); + +#elif (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) + prtl8192cd_priv priv = pDM_Odm->priv; + + if(pDM_Odm->Carrier_Sense_enable){ + pDM_Odm->TH_L2H_ini = 10; + pDM_Odm->TH_EDCCA_HL_diff = 7; + } + else + { + pDM_Odm->TH_L2H_ini = pDM_Odm->TH_L2H_ini_backup; //set by mib + pDM_Odm->TH_EDCCA_HL_diff = 7; + } + + pDM_Odm->TH_L2H_ini_mode2 = 20; + pDM_Odm->TH_EDCCA_HL_diff_mode2 = 8; + //pDM_Odm->TH_L2H_ini_backup = pDM_Odm->TH_L2H_ini; + pDM_Odm->TH_EDCCA_HL_diff_backup = pDM_Odm->TH_EDCCA_HL_diff ; + if(priv->pshare->rf_ft_var.adaptivity_enable == 2) + pDM_Odm->DynamicLinkAdaptivity = TRUE; + else + pDM_Odm->DynamicLinkAdaptivity = FALSE; + +#endif + + pDM_Odm->IGI_Base = 0x32; + pDM_Odm->IGI_target = 0x1c; + pDM_Odm->FABound = 6000; + pDM_Odm->H2L_lb= 0; + pDM_Odm->L2H_lb= 0; + pDM_Odm->Adaptivity_IGI_upper = 0; + pDM_Odm->NHMWait = 0; + pDM_Odm->bCheck = FALSE; + pDM_Odm->bFirstLink = TRUE; + pDM_Odm->Adaptivity_enable = FALSE; // use this flag to judge enable or disable + + Phydm_MACEDCCAState(pDM_Odm, PhyDM_DONT_IGNORE_EDCCA); + + //Search pwdB lower bound + if (pDM_Odm->SupportICType & ODM_IC_11N_SERIES) + { + ODM_SetBBReg(pDM_Odm, ODM_REG_DBG_RPT_11N, bMaskDWord, 0x208); + ODM_SetBBReg(pDM_Odm, rOFDM0_ECCAThreshold, BIT9|BIT8, 0x0); /* set forgetting factor = 0 for all n series IC*/ + } else if (pDM_Odm->SupportICType & ODM_IC_11AC_SERIES) { + ODM_SetBBReg(pDM_Odm, ODM_REG_DBG_RPT_11AC, bMaskDWord, 0x209); + ODM_SetBBReg(pDM_Odm, rFPGA0_XA_LSSIReadBack, BIT1|BIT0, 0x0); + } + + if (pDM_Odm->SupportICType & ODM_RTL8814A) /* 8814a no need to find pwdB lower bound, maybe */ + { + ODM_SetBBReg(pDM_Odm, ODM_REG_EDCCA_DOWN_OPT, BIT30|BIT29|BIT28, 0x7); /* interfernce need > 2^x us, and then EDCCA will be 1 */ + ODM_SetBBReg(pDM_Odm, ODM_REG_EDCCA_POWER_CAL, BIT5, 1); /* 0: mean, 1:max pwdB */ + ODM_SetBBReg(pDM_Odm, ODM_REG_ACBB_EDCCA_ENHANCE, BIT29|BIT28, 0x1); /* 0 : rx_dfir, 1: dcnf_out, 2 :rx_iq, 3: rx_nbi_nf_out */ + } + else + Phydm_SearchPwdBLowerBound(pDM_Odm); + +} + + +VOID +Phydm_Adaptivity( + IN PVOID pDM_VOID, + IN u1Byte IGI +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + s1Byte TH_L2H_dmc, TH_H2L_dmc, L2H_nolink_Band4 = 0x7f, H2L_nolink_Band4 = 0x7f; + s1Byte Diff, IGI_target; + BOOLEAN EDCCA_State = FALSE; + PFALSE_ALARM_STATISTICS FalseAlmCnt = (PFALSE_ALARM_STATISTICS)PhyDM_Get_Structure( pDM_Odm, PHYDM_FALSEALMCNT); +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + PADAPTER pAdapter = pDM_Odm->Adapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); + BOOLEAN bFwCurrentInPSMode=FALSE; + PMGNT_INFO pMgntInfo = &(pAdapter->MgntInfo); + + pAdapter->HalFunc.GetHwRegHandler(pAdapter, HW_VAR_FW_PSMODE_STATUS, (pu1Byte)(&bFwCurrentInPSMode)); + + // Disable EDCCA mode while under LPS mode, added by Roger, 2012.09.14. + if(bFwCurrentInPSMode) + return; +#endif + + if(!(pDM_Odm->SupportAbility & ODM_BB_ADAPTIVITY)) + { + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("Go to odm_DynamicEDCCA() \n")); + // Add by Neil Chen to enable edcca to MP Platform +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + // Adjust EDCCA. + if(pDM_Odm->SupportICType & ODM_IC_11N_SERIES) + Phydm_DynamicEDCCA(pDM_Odm); +#endif + return; + } + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + if(pMgntInfo->RegEnableAdaptivity== 2) + { + if(pDM_Odm->Carrier_Sense_enable == FALSE) // check domain Code for Adaptivity or CarrierSense + { + if ((*pDM_Odm->pBandType == ODM_BAND_5G) && + !(pDM_Odm->odm_Regulation5G == REGULATION_ETSI || pDM_Odm->odm_Regulation5G == REGULATION_WW)) + { + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("Adaptivity skip 5G domain code : %d \n", pDM_Odm->odm_Regulation5G)); + return; + } + + else if((*pDM_Odm->pBandType == ODM_BAND_2_4G) && + !(pDM_Odm->odm_Regulation2_4G == REGULATION_ETSI || pDM_Odm->odm_Regulation2_4G == REGULATION_WW)) + { + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("Adaptivity skip 2.4G domain code : %d \n", pDM_Odm->odm_Regulation2_4G)); + return; + + } + else if ((*pDM_Odm->pBandType != ODM_BAND_2_4G) && (*pDM_Odm->pBandType != ODM_BAND_5G)) + { + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("Adaptivity neither 2G nor 5G band, return\n")); + return; + } + } + else + { + if ((*pDM_Odm->pBandType == ODM_BAND_5G) && + !(pDM_Odm->odm_Regulation5G == REGULATION_MKK || pDM_Odm->odm_Regulation5G == REGULATION_WW)) + { + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("CarrierSense skip 5G domain code : %d\n", pDM_Odm->odm_Regulation5G)); + return; + } + + else if((*pDM_Odm->pBandType == ODM_BAND_2_4G) && + !(pDM_Odm->odm_Regulation2_4G == REGULATION_MKK || pDM_Odm->odm_Regulation2_4G == REGULATION_WW)) + { + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("CarrierSense skip 2.4G domain code : %d\n", pDM_Odm->odm_Regulation2_4G)); + return; + + } + else if ((*pDM_Odm->pBandType != ODM_BAND_2_4G) && (*pDM_Odm->pBandType != ODM_BAND_5G)) + { + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("CarrierSense neither 2G nor 5G band, return\n")); + return; + } + } + } +#endif + + + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("odm_Adaptivity() =====> \n")); + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("IGI_Base=0x%x, TH_L2H_ini = %d, TH_EDCCA_HL_diff = %d\n", + pDM_Odm->IGI_Base, pDM_Odm->TH_L2H_ini, pDM_Odm->TH_EDCCA_HL_diff)); + + if(pDM_Odm->SupportICType & ODM_IC_11AC_SERIES) + { // fix AC series when enable EDCCA hang issue + ODM_SetBBReg(pDM_Odm, 0x800, BIT10, 1); //ADC_mask disable + ODM_SetBBReg(pDM_Odm, 0x800, BIT10, 0); //ADC_mask enable + } + + if(*pDM_Odm->pBandWidth == ODM_BW20M) //CHANNEL_WIDTH_20 + IGI_target = pDM_Odm->IGI_Base; + else if(*pDM_Odm->pBandWidth == ODM_BW40M) + IGI_target = pDM_Odm->IGI_Base + 2; + else if(*pDM_Odm->pBandWidth == ODM_BW80M) + IGI_target = pDM_Odm->IGI_Base + 2; + else + IGI_target = pDM_Odm->IGI_Base; + pDM_Odm->IGI_target = (u1Byte) IGI_target; + + if(*pDM_Odm->pChannel >= 149) // Band4 -> for AP : mode2 + { +#if (DM_ODM_SUPPORT_TYPE & ODM_AP) + if(pDM_Odm->bLinked) + { + if(pDM_Odm->SupportICType & ODM_RTL8814A) + { + L2H_nolink_Band4 = (s1Byte)pDM_Odm->TH_L2H_ini_mode2 + IGI_target; + H2L_nolink_Band4 = L2H_nolink_Band4 - pDM_Odm->TH_EDCCA_HL_diff_mode2; + } + else + { + Diff = IGI_target -(s1Byte)IGI; + L2H_nolink_Band4 = pDM_Odm->TH_L2H_ini_mode2 + Diff; + if(L2H_nolink_Band4 > 10) + L2H_nolink_Band4 = 10; + H2L_nolink_Band4 = L2H_nolink_Band4 - pDM_Odm->TH_EDCCA_HL_diff_mode2; + } + } + else + { + L2H_nolink_Band4 = 0x7f; + H2L_nolink_Band4 = 0x7f; + } + Phydm_SetEDCCAThreshold(pDM_Odm, H2L_nolink_Band4, L2H_nolink_Band4); + return; +#endif + } + + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("BandWidth=%s, IGI_target=0x%x, FABound = %d, DynamicLinkAdaptivity = %d\n", + (*pDM_Odm->pBandWidth==ODM_BW80M)?"80M":((*pDM_Odm->pBandWidth==ODM_BW40M)?"40M":"20M"), IGI_target, pDM_Odm->FABound, pDM_Odm->DynamicLinkAdaptivity)); + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("RSSI_min = %d, AdapIGIUpper= 0x%x, adaptivity_flag = %d, Adaptivity_enable = %d\n", + pDM_Odm->RSSI_Min, pDM_Odm->Adaptivity_IGI_upper, pDM_Odm->adaptivity_flag, pDM_Odm->Adaptivity_enable)); + + if((pDM_Odm->DynamicLinkAdaptivity == TRUE) && (!pDM_Odm->bLinked) && (pDM_Odm->Adaptivity_enable == FALSE)) + { + Phydm_SetEDCCAThreshold(pDM_Odm, 0x7f, 0x7f); + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("In DynamicLink mode(noisy) and No link, Turn off EDCCA!!\n")); + return; + } +#if (!(DM_ODM_SUPPORT_TYPE & ODM_AP)) + else if((pDM_Odm->DynamicLinkAdaptivity == TRUE) && (pDM_Odm->Adaptivity_enable == FALSE)) + { + Phydm_SetEDCCAThreshold(pDM_Odm, 0x7f, 0x7f); + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("In DynamicLink mode(noisy) disable EDCCA, return!!\n")); + return; + } +#endif + + if((pDM_Odm->SupportICType & ODM_RTL8723B) && (pDM_Odm->CutVersion & ODM_CUT_B) && (FalseAlmCnt->Cnt_all > pDM_Odm->FABound) && (IGI == pDM_Odm->Adaptivity_IGI_upper)) + { + pDM_Odm->Adaptivity_IGI_upper = pDM_Odm->Adaptivity_IGI_upper + 3; + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("FA > %d, IGI upper bound + 3!!\n", pDM_Odm->FABound)); + } + + + if(pDM_Odm->SupportICType & ODM_RTL8814A) + { + TH_L2H_dmc = (s1Byte)pDM_Odm->TH_L2H_ini + IGI_target; + TH_H2L_dmc = TH_L2H_dmc - pDM_Odm->TH_EDCCA_HL_diff; + } + else + { + Diff = IGI_target -(s1Byte)IGI; + TH_L2H_dmc = pDM_Odm->TH_L2H_ini + Diff; + if(TH_L2H_dmc > 10) + TH_L2H_dmc = 10; + + TH_H2L_dmc = TH_L2H_dmc - pDM_Odm->TH_EDCCA_HL_diff; + + //replace lower bound to prevent EDCCA always equal 1 + if(TH_H2L_dmc < pDM_Odm->H2L_lb) + TH_H2L_dmc = pDM_Odm->H2L_lb; + if(TH_L2H_dmc < pDM_Odm->L2H_lb) + TH_L2H_dmc = pDM_Odm->L2H_lb; + } + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("IGI=0x%x, TH_L2H_dmc = %d, TH_H2L_dmc = %d\n", IGI, TH_L2H_dmc, TH_H2L_dmc)); + + Phydm_SetEDCCAThreshold(pDM_Odm, TH_H2L_dmc, TH_L2H_dmc); + return; +} + + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + +VOID +Phydm_AdaptivityBSOD( + IN PVOID pDM_VOID +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PADAPTER pAdapter = pDM_Odm->Adapter; + PMGNT_INFO pMgntInfo = &(pAdapter->MgntInfo); + u1Byte count = 0; + u4Byte u4Value; + + /* + 1. turn off RF (TRX Mux in standby mode) + 2. H2C mac id drop + 3. ignore EDCCA + 4. wait for clear FIFO + 5. don't ignore EDCCA + 6. turn on RF (TRX Mux in TRx mdoe) + 7. H2C mac id resume + */ + + RT_TRACE(COMP_MLME, DBG_WARNING, ("MAC id drop packet!!!!!\n")); + + pAdapter->dropPktByMacIdCnt++; + pMgntInfo->bDropPktInProgress = TRUE; + + pAdapter->HalFunc.GetHwRegHandler(pAdapter, HW_VAR_MAX_Q_PAGE_NUM, (pu1Byte)(&u4Value)); + RT_TRACE(COMP_INIT, DBG_LOUD, ("Queue Reserved Page Number = 0x%08x\n", u4Value)); + pAdapter->HalFunc.GetHwRegHandler(pAdapter, HW_VAR_AVBL_Q_PAGE_NUM, (pu1Byte)(&u4Value)); + RT_TRACE(COMP_INIT, DBG_LOUD, ("Available Queue Page Number = 0x%08x\n", u4Value)); + +#if 1 + + //3 Standby mode + Phydm_SetTRxMux(pDM_Odm, PhyDM_STANDBY_MODE, PhyDM_STANDBY_MODE); + ODM_Write_DIG(pDM_Odm, 0x20); + + //3 H2C mac id drop + MacIdIndicateDisconnect(pAdapter); + + //3 Ignore EDCCA + Phydm_MACEDCCAState(pDM_Odm, PhyDM_IGNORE_EDCCA); + + delay_ms(50); + count = 5; + +#else + + do + { + + u8Byte diffTime, curTime, oldestTime; + u1Byte queueIdx + + //3 Standby mode + Phydm_SetTRxMux(pDM_Odm, PhyDM_STANDBY_MODE, PhyDM_STANDBY_MODE); + ODM_Write_DIG(pDM_Odm, 0x20); + + //3 H2C mac id drop + MacIdIndicateDisconnect(pAdapter); + + //3 Ignore EDCCA + Phydm_MACEDCCAState(pDM_Odm, PhyDM_IGNORE_EDCCA); + + count++; + delay_ms(10); + + // Check latest packet + curTime = PlatformGetCurrentTime(); + oldestTime = 0xFFFFFFFFFFFFFFFF; + + for(queueIdx = 0; queueIdx < MAX_TX_QUEUE; queueIdx++) + { + if(!IS_DATA_QUEUE(queueIdx)) + continue; + + if(!pAdapter->bTcbBusyQEmpty[queueIdx]) + { + RT_TRACE(COMP_MLME, DBG_WARNING, ("oldestTime = %llu\n", oldestTime)); + RT_TRACE(COMP_MLME, DBG_WARNING, ("Q[%d] = %llu\n", queueIdx, pAdapter->firstTcbSysTime[queueIdx])); + if(pAdapter->firstTcbSysTime[queueIdx] < oldestTime) + { + oldestTime = pAdapter->firstTcbSysTime[queueIdx]; + } + } + } + + diffTime = curTime - oldestTime; + + RT_TRACE(COMP_MLME, DBG_WARNING, ("diff s = %llu\n", (diffTime/1000000))); + + }while(((diffTime/1000000) >= 4) && (oldestTime != 0xFFFFFFFFFFFFFFFF)); +#endif + + //3 Resume EDCCA + Phydm_MACEDCCAState(pDM_Odm, PhyDM_DONT_IGNORE_EDCCA); + + //3 Turn on TRx mode + Phydm_SetTRxMux(pDM_Odm, PhyDM_TX_MODE, PhyDM_RX_MODE); + ODM_Write_DIG(pDM_Odm, 0x20); + + //3 Resume H2C macid + MacIdRecoverMediaStatus(pAdapter); + + pAdapter->HalFunc.GetHwRegHandler(pAdapter, HW_VAR_AVBL_Q_PAGE_NUM, (pu1Byte)(&u4Value)); + RT_TRACE(COMP_INIT, DBG_LOUD, ("Available Queue Page Number = 0x%08x\n", u4Value)); + + pMgntInfo->bDropPktInProgress = FALSE; + RT_TRACE(COMP_MLME, DBG_WARNING, ("End of MAC id drop packet, spent %dms\n", count*10)); + +} + +VOID +Phydm_EnableEDCCA( + IN PVOID pDM_VOID +) +{ + + // This should be moved out of OUTSRC + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PADAPTER pAdapter = pDM_Odm->Adapter; + // Enable EDCCA. The value is suggested by SD3 Wilson. + + // + // Revised for ASUS 11b/g performance issues, suggested by BB Neil, 2012.04.13. + // + if((pDM_Odm->SupportICType == ODM_RTL8723A)&&(IS_WIRELESS_MODE_G(pAdapter))) + { + //PlatformEFIOWrite1Byte(Adapter, rOFDM0_ECCAThreshold, 0x00); + ODM_Write1Byte(pDM_Odm,rOFDM0_ECCAThreshold,0x00); + ODM_Write1Byte(pDM_Odm,rOFDM0_ECCAThreshold+2,0xFD); + + } + else + { + //PlatformEFIOWrite1Byte(Adapter, rOFDM0_ECCAThreshold, 0x03); + ODM_Write1Byte(pDM_Odm,rOFDM0_ECCAThreshold,0x03); + ODM_Write1Byte(pDM_Odm,rOFDM0_ECCAThreshold+2,0x00); + } + + //PlatformEFIOWrite1Byte(Adapter, rOFDM0_ECCAThreshold+2, 0x00); +} + +VOID +Phydm_DisableEDCCA( + IN PVOID pDM_VOID +) +{ + // Disable EDCCA.. + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + ODM_Write1Byte(pDM_Odm, rOFDM0_ECCAThreshold, 0x7f); + ODM_Write1Byte(pDM_Odm, rOFDM0_ECCAThreshold+2, 0x7f); +} + +// +// Description: According to initial gain value to determine to enable or disable EDCCA. +// +// Suggested by SD3 Wilson. Added by tynli. 2011.11.25. +// +VOID +Phydm_DynamicEDCCA( + IN PVOID pDM_VOID +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PADAPTER pAdapter = pDM_Odm->Adapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); + u1Byte RegC50, RegC58; + BOOLEAN bEDCCAenable = FALSE; + +#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) + BOOLEAN bFwCurrentInPSMode=FALSE; + + pAdapter->HalFunc.GetHwRegHandler(pAdapter, HW_VAR_FW_PSMODE_STATUS, (pu1Byte)(&bFwCurrentInPSMode)); + + // Disable EDCCA mode while under LPS mode, added by Roger, 2012.09.14. + if(bFwCurrentInPSMode) + return; +#endif + // + // 2013/11/14 Ken According to BB team Jame's suggestion, we need to disable soft AP mode EDCCA. + // 2014/01/08 MH For Miracst AP mode test. We need to disable EDCCA. Otherwise, we may stop + // to send beacon in noisy environment or platform. + // + if(ACTING_AS_AP(pAdapter) || ACTING_AS_AP(GetFirstAPAdapter(pAdapter))) + //if(ACTING_AS_AP(pAdapter)) + { + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("At least One Port as AP disable EDCCA\n")); + Phydm_DisableEDCCA(pDM_Odm); + if(pHalData->bPreEdccaEnable) + Phydm_DisableEDCCA(pDM_Odm); + pHalData->bPreEdccaEnable = FALSE; + return; + } + + RegC50 = (u1Byte)ODM_GetBBReg(pDM_Odm, rOFDM0_XAAGCCore1, bMaskByte0); + RegC58 = (u1Byte)ODM_GetBBReg(pDM_Odm, rOFDM0_XBAGCCore1, bMaskByte0); + + + if((RegC50 > 0x28 && RegC58 > 0x28) || + ((pDM_Odm->SupportICType == ODM_RTL8723A && IS_WIRELESS_MODE_G(pAdapter) && RegC50>0x26)) || + (pDM_Odm->SupportICType == ODM_RTL8188E && RegC50 > 0x28)) + { + if(!pHalData->bPreEdccaEnable) + { + Phydm_EnableEDCCA(pDM_Odm); + pHalData->bPreEdccaEnable = TRUE; + } + + } + else if((RegC50 < 0x25 && RegC58 < 0x25) || (pDM_Odm->SupportICType == ODM_RTL8188E && RegC50 < 0x25)) + { + if(pHalData->bPreEdccaEnable) + { + Phydm_DisableEDCCA(pDM_Odm); + pHalData->bPreEdccaEnable = FALSE; + } + } +} + +#endif diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/PhyDM_Adaptivity.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/PhyDM_Adaptivity.h new file mode 100644 index 00000000000000..36e4f389a57802 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/PhyDM_Adaptivity.h @@ -0,0 +1,143 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +#ifndef __PHYDMADAPTIVITY_H__ +#define __PHYDMADAPTIVITY_H__ + +#define ADAPTIVITY_VERSION "8.2" + +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN)) +typedef enum _tag_PhyDM_REGULATION_Type { + REGULATION_FCC = 0, + REGULATION_MKK = 1, + REGULATION_ETSI = 2, + REGULATION_WW = 3, + + MAX_REGULATION_NUM = 4 +} PhyDM_REGULATION_TYPE; +#endif + + +typedef enum tag_PhyDM_TRx_MUX_Type +{ + PhyDM_SHUTDOWN = 0, + PhyDM_STANDBY_MODE = 1, + PhyDM_TX_MODE = 2, + PhyDM_RX_MODE = 3 +}PhyDM_Trx_MUX_Type; + +typedef enum tag_PhyDM_MACEDCCA_Type +{ + PhyDM_IGNORE_EDCCA = 0, + PhyDM_DONT_IGNORE_EDCCA = 1 +}PhyDM_MACEDCCA_Type; + + +VOID +Phydm_CheckAdaptivity( + IN PVOID pDM_VOID + ); + +VOID +Phydm_CheckEnvironment( + IN PVOID pDM_VOID + ); + +VOID +Phydm_NHMCounterStatisticsInit( + IN PVOID pDM_VOID + ); + +VOID +Phydm_NHMCounterStatistics( + IN PVOID pDM_VOID + ); + +VOID +Phydm_NHMCounterStatisticsReset( + IN PVOID pDM_VOID +); + +VOID +Phydm_GetNHMCounterStatistics( + IN PVOID pDM_VOID +); + +VOID +Phydm_MACEDCCAState( + IN PVOID pDM_VOID, + IN PhyDM_MACEDCCA_Type State +); + +VOID +Phydm_SetEDCCAThreshold( + IN PVOID pDM_VOID, + IN s1Byte H2L, + IN s1Byte L2H +); + +VOID +Phydm_SetTRxMux( + IN PVOID pDM_VOID, + IN PhyDM_Trx_MUX_Type txMode, + IN PhyDM_Trx_MUX_Type rxMode +); + +BOOLEAN +Phydm_CalNHMcnt( + IN PVOID pDM_VOID +); + +VOID +Phydm_SearchPwdBLowerBound( + IN PVOID pDM_VOID +); + +VOID +Phydm_AdaptivityInit( + IN PVOID pDM_VOID + ); + +VOID +Phydm_Adaptivity( + IN PVOID pDM_VOID, + IN u1Byte IGI + ); + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) +VOID +Phydm_DisableEDCCA( + IN PVOID pDM_VOID +); + +VOID +Phydm_DynamicEDCCA( + IN PVOID pDM_VOID +); + +VOID +Phydm_AdaptivityBSOD( + IN PVOID pDM_VOID +); + +#endif + + +#endif diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm.c deleted file mode 100755 index 4128c608af37e9..00000000000000 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm.c +++ /dev/null @@ -1,14176 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * - ******************************************************************************/ - -//============================================================ -// include files -//============================================================ - -#include "odm_precomp.h" - - -const u2Byte dB_Invert_Table[8][12] = { - { 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4}, - { 4, 5, 6, 6, 7, 8, 9, 10, 11, 13, 14, 16}, - { 18, 20, 22, 25, 28, 32, 35, 40, 45, 50, 56, 63}, - { 71, 79, 89, 100, 112, 126, 141, 158, 178, 200, 224, 251}, - { 282, 316, 355, 398, 447, 501, 562, 631, 708, 794, 891, 1000}, - { 1122, 1259, 1413, 1585, 1778, 1995, 2239, 2512, 2818, 3162, 3548, 3981}, - { 4467, 5012, 5623, 6310, 7079, 7943, 8913, 10000, 11220, 12589, 14125, 15849}, - { 17783, 19953, 22387, 25119, 28184, 31623, 35481, 39811, 44668, 50119, 56234, 65535}}; - - -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) -static u4Byte edca_setting_UL[HT_IOT_PEER_MAX] = -// UNKNOWN REALTEK_90 REALTEK_92SE BROADCOM RALINK ATHEROS CISCO MERU MARVELL 92U_AP SELF_AP(DownLink/Tx) -{ 0x5e4322, 0xa44f, 0x5e4322, 0x5ea32b, 0x5ea422, 0x5ea322, 0x3ea430, 0x5ea42b, 0x5ea44f, 0x5e4322, 0x5e4322}; - - -static u4Byte edca_setting_DL[HT_IOT_PEER_MAX] = -// UNKNOWN REALTEK_90 REALTEK_92SE BROADCOM RALINK ATHEROS CISCO MERU, MARVELL 92U_AP SELF_AP(UpLink/Rx) -{ 0xa44f, 0x5ea44f, 0x5e4322, 0x5ea42b, 0xa44f, 0xa630, 0x5ea630, 0x5ea42b, 0xa44f, 0xa42b, 0xa42b}; - -static u4Byte edca_setting_DL_GMode[HT_IOT_PEER_MAX] = -// UNKNOWN REALTEK_90 REALTEK_92SE BROADCOM RALINK ATHEROS CISCO MERU, MARVELL 92U_AP SELF_AP -{ 0x4322, 0xa44f, 0x5e4322, 0xa42b, 0x5e4322, 0x4322, 0xa42b, 0x5ea42b, 0xa44f, 0x5e4322, 0x5ea42b}; - - -//============================================================ -// EDCA Paramter for AP/ADSL by Mingzhi 2011-11-22 -//============================================================ -#elif (DM_ODM_SUPPORT_TYPE &ODM_ADSL) -enum qos_prio { BK, BE, VI, VO, VI_AG, VO_AG }; - -static const struct ParaRecord rtl_ap_EDCA[] = -{ -//ACM,AIFSN, ECWmin, ECWmax, TXOplimit - {0, 7, 4, 10, 0}, //BK - {0, 3, 4, 6, 0}, //BE - {0, 1, 3, 4, 188}, //VI - {0, 1, 2, 3, 102}, //VO - {0, 1, 3, 4, 94}, //VI_AG - {0, 1, 2, 3, 47}, //VO_AG -}; - -static const struct ParaRecord rtl_sta_EDCA[] = -{ -//ACM,AIFSN, ECWmin, ECWmax, TXOplimit - {0, 7, 4, 10, 0}, - {0, 3, 4, 10, 0}, - {0, 2, 3, 4, 188}, - {0, 2, 2, 3, 102}, - {0, 2, 3, 4, 94}, - {0, 2, 2, 3, 47}, -}; -#endif - -//============================================================ -// Global var -//============================================================ - -u4Byte OFDMSwingTable[OFDM_TABLE_SIZE] = { - 0x7f8001fe, // 0, +6.0dB - 0x788001e2, // 1, +5.5dB - 0x71c001c7, // 2, +5.0dB - 0x6b8001ae, // 3, +4.5dB - 0x65400195, // 4, +4.0dB - 0x5fc0017f, // 5, +3.5dB - 0x5a400169, // 6, +3.0dB - 0x55400155, // 7, +2.5dB - 0x50800142, // 8, +2.0dB - 0x4c000130, // 9, +1.5dB - 0x47c0011f, // 10, +1.0dB - 0x43c0010f, // 11, +0.5dB - 0x40000100, // 12, +0dB - 0x3c8000f2, // 13, -0.5dB - 0x390000e4, // 14, -1.0dB - 0x35c000d7, // 15, -1.5dB - 0x32c000cb, // 16, -2.0dB - 0x300000c0, // 17, -2.5dB - 0x2d4000b5, // 18, -3.0dB - 0x2ac000ab, // 19, -3.5dB - 0x288000a2, // 20, -4.0dB - 0x26000098, // 21, -4.5dB - 0x24000090, // 22, -5.0dB - 0x22000088, // 23, -5.5dB - 0x20000080, // 24, -6.0dB - 0x1e400079, // 25, -6.5dB - 0x1c800072, // 26, -7.0dB - 0x1b00006c, // 27. -7.5dB - 0x19800066, // 28, -8.0dB - 0x18000060, // 29, -8.5dB - 0x16c0005b, // 30, -9.0dB - 0x15800056, // 31, -9.5dB - 0x14400051, // 32, -10.0dB - 0x1300004c, // 33, -10.5dB - 0x12000048, // 34, -11.0dB - 0x11000044, // 35, -11.5dB - 0x10000040, // 36, -12.0dB -}; - -u1Byte CCKSwingTable_Ch1_Ch13[CCK_TABLE_SIZE][8] = { - {0x36, 0x35, 0x2e, 0x25, 0x1c, 0x12, 0x09, 0x04}, // 0, +0dB - {0x33, 0x32, 0x2b, 0x23, 0x1a, 0x11, 0x08, 0x04}, // 1, -0.5dB - {0x30, 0x2f, 0x29, 0x21, 0x19, 0x10, 0x08, 0x03}, // 2, -1.0dB - {0x2d, 0x2d, 0x27, 0x1f, 0x18, 0x0f, 0x08, 0x03}, // 3, -1.5dB - {0x2b, 0x2a, 0x25, 0x1e, 0x16, 0x0e, 0x07, 0x03}, // 4, -2.0dB - {0x28, 0x28, 0x22, 0x1c, 0x15, 0x0d, 0x07, 0x03}, // 5, -2.5dB - {0x26, 0x25, 0x21, 0x1b, 0x14, 0x0d, 0x06, 0x03}, // 6, -3.0dB - {0x24, 0x23, 0x1f, 0x19, 0x13, 0x0c, 0x06, 0x03}, // 7, -3.5dB - {0x22, 0x21, 0x1d, 0x18, 0x11, 0x0b, 0x06, 0x02}, // 8, -4.0dB - {0x20, 0x20, 0x1b, 0x16, 0x11, 0x08, 0x05, 0x02}, // 9, -4.5dB - {0x1f, 0x1e, 0x1a, 0x15, 0x10, 0x0a, 0x05, 0x02}, // 10, -5.0dB - {0x1d, 0x1c, 0x18, 0x14, 0x0f, 0x0a, 0x05, 0x02}, // 11, -5.5dB - {0x1b, 0x1a, 0x17, 0x13, 0x0e, 0x09, 0x04, 0x02}, // 12, -6.0dB <== default - {0x1a, 0x19, 0x16, 0x12, 0x0d, 0x09, 0x04, 0x02}, // 13, -6.5dB - {0x18, 0x17, 0x15, 0x11, 0x0c, 0x08, 0x04, 0x02}, // 14, -7.0dB - {0x17, 0x16, 0x13, 0x10, 0x0c, 0x08, 0x04, 0x02}, // 15, -7.5dB - {0x16, 0x15, 0x12, 0x0f, 0x0b, 0x07, 0x04, 0x01}, // 16, -8.0dB - {0x14, 0x14, 0x11, 0x0e, 0x0b, 0x07, 0x03, 0x02}, // 17, -8.5dB - {0x13, 0x13, 0x10, 0x0d, 0x0a, 0x06, 0x03, 0x01}, // 18, -9.0dB - {0x12, 0x12, 0x0f, 0x0c, 0x09, 0x06, 0x03, 0x01}, // 19, -9.5dB - {0x11, 0x11, 0x0f, 0x0c, 0x09, 0x06, 0x03, 0x01}, // 20, -10.0dB - {0x10, 0x10, 0x0e, 0x0b, 0x08, 0x05, 0x03, 0x01}, // 21, -10.5dB - {0x0f, 0x0f, 0x0d, 0x0b, 0x08, 0x05, 0x03, 0x01}, // 22, -11.0dB - {0x0e, 0x0e, 0x0c, 0x0a, 0x08, 0x05, 0x02, 0x01}, // 23, -11.5dB - {0x0d, 0x0d, 0x0c, 0x0a, 0x07, 0x05, 0x02, 0x01}, // 24, -12.0dB - {0x0d, 0x0c, 0x0b, 0x09, 0x07, 0x04, 0x02, 0x01}, // 25, -12.5dB - {0x0c, 0x0c, 0x0a, 0x09, 0x06, 0x04, 0x02, 0x01}, // 26, -13.0dB - {0x0b, 0x0b, 0x0a, 0x08, 0x06, 0x04, 0x02, 0x01}, // 27, -13.5dB - {0x0b, 0x0a, 0x09, 0x08, 0x06, 0x04, 0x02, 0x01}, // 28, -14.0dB - {0x0a, 0x0a, 0x09, 0x07, 0x05, 0x03, 0x02, 0x01}, // 29, -14.5dB - {0x0a, 0x09, 0x08, 0x07, 0x05, 0x03, 0x02, 0x01}, // 30, -15.0dB - {0x09, 0x09, 0x08, 0x06, 0x05, 0x03, 0x01, 0x01}, // 31, -15.5dB - {0x09, 0x08, 0x07, 0x06, 0x04, 0x03, 0x01, 0x01} // 32, -16.0dB -}; - - -u1Byte CCKSwingTable_Ch14[CCK_TABLE_SIZE][8] = { - {0x36, 0x35, 0x2e, 0x1b, 0x00, 0x00, 0x00, 0x00}, // 0, +0dB - {0x33, 0x32, 0x2b, 0x19, 0x00, 0x00, 0x00, 0x00}, // 1, -0.5dB - {0x30, 0x2f, 0x29, 0x18, 0x00, 0x00, 0x00, 0x00}, // 2, -1.0dB - {0x2d, 0x2d, 0x17, 0x17, 0x00, 0x00, 0x00, 0x00}, // 3, -1.5dB - {0x2b, 0x2a, 0x25, 0x15, 0x00, 0x00, 0x00, 0x00}, // 4, -2.0dB - {0x28, 0x28, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00}, // 5, -2.5dB - {0x26, 0x25, 0x21, 0x13, 0x00, 0x00, 0x00, 0x00}, // 6, -3.0dB - {0x24, 0x23, 0x1f, 0x12, 0x00, 0x00, 0x00, 0x00}, // 7, -3.5dB - {0x22, 0x21, 0x1d, 0x11, 0x00, 0x00, 0x00, 0x00}, // 8, -4.0dB - {0x20, 0x20, 0x1b, 0x10, 0x00, 0x00, 0x00, 0x00}, // 9, -4.5dB - {0x1f, 0x1e, 0x1a, 0x0f, 0x00, 0x00, 0x00, 0x00}, // 10, -5.0dB - {0x1d, 0x1c, 0x18, 0x0e, 0x00, 0x00, 0x00, 0x00}, // 11, -5.5dB - {0x1b, 0x1a, 0x17, 0x0e, 0x00, 0x00, 0x00, 0x00}, // 12, -6.0dB <== default - {0x1a, 0x19, 0x16, 0x0d, 0x00, 0x00, 0x00, 0x00}, // 13, -6.5dB - {0x18, 0x17, 0x15, 0x0c, 0x00, 0x00, 0x00, 0x00}, // 14, -7.0dB - {0x17, 0x16, 0x13, 0x0b, 0x00, 0x00, 0x00, 0x00}, // 15, -7.5dB - {0x16, 0x15, 0x12, 0x0b, 0x00, 0x00, 0x00, 0x00}, // 16, -8.0dB - {0x14, 0x14, 0x11, 0x0a, 0x00, 0x00, 0x00, 0x00}, // 17, -8.5dB - {0x13, 0x13, 0x10, 0x0a, 0x00, 0x00, 0x00, 0x00}, // 18, -9.0dB - {0x12, 0x12, 0x0f, 0x09, 0x00, 0x00, 0x00, 0x00}, // 19, -9.5dB - {0x11, 0x11, 0x0f, 0x09, 0x00, 0x00, 0x00, 0x00}, // 20, -10.0dB - {0x10, 0x10, 0x0e, 0x08, 0x00, 0x00, 0x00, 0x00}, // 21, -10.5dB - {0x0f, 0x0f, 0x0d, 0x08, 0x00, 0x00, 0x00, 0x00}, // 22, -11.0dB - {0x0e, 0x0e, 0x0c, 0x07, 0x00, 0x00, 0x00, 0x00}, // 23, -11.5dB - {0x0d, 0x0d, 0x0c, 0x07, 0x00, 0x00, 0x00, 0x00}, // 24, -12.0dB - {0x0d, 0x0c, 0x0b, 0x06, 0x00, 0x00, 0x00, 0x00}, // 25, -12.5dB - {0x0c, 0x0c, 0x0a, 0x06, 0x00, 0x00, 0x00, 0x00}, // 26, -13.0dB - {0x0b, 0x0b, 0x0a, 0x06, 0x00, 0x00, 0x00, 0x00}, // 27, -13.5dB - {0x0b, 0x0a, 0x09, 0x05, 0x00, 0x00, 0x00, 0x00}, // 28, -14.0dB - {0x0a, 0x0a, 0x09, 0x05, 0x00, 0x00, 0x00, 0x00}, // 29, -14.5dB - {0x0a, 0x09, 0x08, 0x05, 0x00, 0x00, 0x00, 0x00}, // 30, -15.0dB - {0x09, 0x09, 0x08, 0x05, 0x00, 0x00, 0x00, 0x00}, // 31, -15.5dB - {0x09, 0x08, 0x07, 0x04, 0x00, 0x00, 0x00, 0x00} // 32, -16.0dB -}; - - -u4Byte OFDMSwingTable_New[OFDM_TABLE_SIZE] = { - 0x0b40002d, // 0, -15.0dB - 0x0c000030, // 1, -14.5dB - 0x0cc00033, // 2, -14.0dB - 0x0d800036, // 3, -13.5dB - 0x0e400039, // 4, -13.0dB - 0x0f00003c, // 5, -12.5dB - 0x10000040, // 6, -12.0dB - 0x11000044, // 7, -11.5dB - 0x12000048, // 8, -11.0dB - 0x1300004c, // 9, -10.5dB - 0x14400051, // 10, -10.0dB - 0x15800056, // 11, -9.5dB - 0x16c0005b, // 12, -9.0dB - 0x18000060, // 13, -8.5dB - 0x19800066, // 14, -8.0dB - 0x1b00006c, // 15, -7.5dB - 0x1c800072, // 16, -7.0dB - 0x1e400079, // 17, -6.5dB - 0x20000080, // 18, -6.0dB - 0x22000088, // 19, -5.5dB - 0x24000090, // 20, -5.0dB - 0x26000098, // 21, -4.5dB - 0x288000a2, // 22, -4.0dB - 0x2ac000ab, // 23, -3.5dB - 0x2d4000b5, // 24, -3.0dB - 0x300000c0, // 25, -2.5dB - 0x32c000cb, // 26, -2.0dB - 0x35c000d7, // 27, -1.5dB - 0x390000e4, // 28, -1.0dB - 0x3c8000f2, // 29, -0.5dB - 0x40000100, // 30, +0dB - 0x43c0010f, // 31, +0.5dB - 0x47c0011f, // 32, +1.0dB - 0x4c000130, // 33, +1.5dB - 0x50800142, // 34, +2.0dB - 0x55400155, // 35, +2.5dB - 0x5a400169, // 36, +3.0dB - 0x5fc0017f, // 37, +3.5dB - 0x65400195, // 38, +4.0dB - 0x6b8001ae, // 39, +4.5dB - 0x71c001c7, // 40, +5.0dB - 0x788001e2, // 41, +5.5dB - 0x7f8001fe // 42, +6.0dB -}; - - -u1Byte CCKSwingTable_Ch1_Ch13_New[CCK_TABLE_SIZE][8] = { - {0x09, 0x08, 0x07, 0x06, 0x04, 0x03, 0x01, 0x01}, // 0, -16.0dB - {0x09, 0x09, 0x08, 0x06, 0x05, 0x03, 0x01, 0x01}, // 1, -15.5dB - {0x0a, 0x09, 0x08, 0x07, 0x05, 0x03, 0x02, 0x01}, // 2, -15.0dB - {0x0a, 0x0a, 0x09, 0x07, 0x05, 0x03, 0x02, 0x01}, // 3, -14.5dB - {0x0b, 0x0a, 0x09, 0x08, 0x06, 0x04, 0x02, 0x01}, // 4, -14.0dB - {0x0b, 0x0b, 0x0a, 0x08, 0x06, 0x04, 0x02, 0x01}, // 5, -13.5dB - {0x0c, 0x0c, 0x0a, 0x09, 0x06, 0x04, 0x02, 0x01}, // 6, -13.0dB - {0x0d, 0x0c, 0x0b, 0x09, 0x07, 0x04, 0x02, 0x01}, // 7, -12.5dB - {0x0d, 0x0d, 0x0c, 0x0a, 0x07, 0x05, 0x02, 0x01}, // 8, -12.0dB - {0x0e, 0x0e, 0x0c, 0x0a, 0x08, 0x05, 0x02, 0x01}, // 9, -11.5dB - {0x0f, 0x0f, 0x0d, 0x0b, 0x08, 0x05, 0x03, 0x01}, // 10, -11.0dB - {0x10, 0x10, 0x0e, 0x0b, 0x08, 0x05, 0x03, 0x01}, // 11, -10.5dB - {0x11, 0x11, 0x0f, 0x0c, 0x09, 0x06, 0x03, 0x01}, // 12, -10.0dB - {0x12, 0x12, 0x0f, 0x0c, 0x09, 0x06, 0x03, 0x01}, // 13, -9.5dB - {0x13, 0x13, 0x10, 0x0d, 0x0a, 0x06, 0x03, 0x01}, // 14, -9.0dB - {0x14, 0x14, 0x11, 0x0e, 0x0b, 0x07, 0x03, 0x02}, // 15, -8.5dB - {0x16, 0x15, 0x12, 0x0f, 0x0b, 0x07, 0x04, 0x01}, // 16, -8.0dB - {0x17, 0x16, 0x13, 0x10, 0x0c, 0x08, 0x04, 0x02}, // 17, -7.5dB - {0x18, 0x17, 0x15, 0x11, 0x0c, 0x08, 0x04, 0x02}, // 18, -7.0dB - {0x1a, 0x19, 0x16, 0x12, 0x0d, 0x09, 0x04, 0x02}, // 19, -6.5dB - {0x1b, 0x1a, 0x17, 0x13, 0x0e, 0x09, 0x04, 0x02}, // 20, -6.0dB - {0x1d, 0x1c, 0x18, 0x14, 0x0f, 0x0a, 0x05, 0x02}, // 21, -5.5dB - {0x1f, 0x1e, 0x1a, 0x15, 0x10, 0x0a, 0x05, 0x02}, // 22, -5.0dB - {0x20, 0x20, 0x1b, 0x16, 0x11, 0x08, 0x05, 0x02}, // 23, -4.5dB - {0x22, 0x21, 0x1d, 0x18, 0x11, 0x0b, 0x06, 0x02}, // 24, -4.0dB - {0x24, 0x23, 0x1f, 0x19, 0x13, 0x0c, 0x06, 0x03}, // 25, -3.5dB - {0x26, 0x25, 0x21, 0x1b, 0x14, 0x0d, 0x06, 0x03}, // 26, -3.0dB - {0x28, 0x28, 0x22, 0x1c, 0x15, 0x0d, 0x07, 0x03}, // 27, -2.5dB - {0x2b, 0x2a, 0x25, 0x1e, 0x16, 0x0e, 0x07, 0x03}, // 28, -2.0dB - {0x2d, 0x2d, 0x27, 0x1f, 0x18, 0x0f, 0x08, 0x03}, // 29, -1.5dB - {0x30, 0x2f, 0x29, 0x21, 0x19, 0x10, 0x08, 0x03}, // 30, -1.0dB - {0x33, 0x32, 0x2b, 0x23, 0x1a, 0x11, 0x08, 0x04}, // 31, -0.5dB - {0x36, 0x35, 0x2e, 0x25, 0x1c, 0x12, 0x09, 0x04} // 32, +0dB -}; - - -u1Byte CCKSwingTable_Ch14_New[CCK_TABLE_SIZE][8]= { - {0x09, 0x08, 0x07, 0x04, 0x00, 0x00, 0x00, 0x00}, // 0, -16.0dB - {0x09, 0x09, 0x08, 0x05, 0x00, 0x00, 0x00, 0x00}, // 1, -15.5dB - {0x0a, 0x09, 0x08, 0x05, 0x00, 0x00, 0x00, 0x00}, // 2, -15.0dB - {0x0a, 0x0a, 0x09, 0x05, 0x00, 0x00, 0x00, 0x00}, // 3, -14.5dB - {0x0b, 0x0a, 0x09, 0x05, 0x00, 0x00, 0x00, 0x00}, // 4, -14.0dB - {0x0b, 0x0b, 0x0a, 0x06, 0x00, 0x00, 0x00, 0x00}, // 5, -13.5dB - {0x0c, 0x0c, 0x0a, 0x06, 0x00, 0x00, 0x00, 0x00}, // 6, -13.0dB - {0x0d, 0x0c, 0x0b, 0x06, 0x00, 0x00, 0x00, 0x00}, // 7, -12.5dB - {0x0d, 0x0d, 0x0c, 0x07, 0x00, 0x00, 0x00, 0x00}, // 8, -12.0dB - {0x0e, 0x0e, 0x0c, 0x07, 0x00, 0x00, 0x00, 0x00}, // 9, -11.5dB - {0x0f, 0x0f, 0x0d, 0x08, 0x00, 0x00, 0x00, 0x00}, // 10, -11.0dB - {0x10, 0x10, 0x0e, 0x08, 0x00, 0x00, 0x00, 0x00}, // 11, -10.5dB - {0x11, 0x11, 0x0f, 0x09, 0x00, 0x00, 0x00, 0x00}, // 12, -10.0dB - {0x12, 0x12, 0x0f, 0x09, 0x00, 0x00, 0x00, 0x00}, // 13, -9.5dB - {0x13, 0x13, 0x10, 0x0a, 0x00, 0x00, 0x00, 0x00}, // 14, -9.0dB - {0x14, 0x14, 0x11, 0x0a, 0x00, 0x00, 0x00, 0x00}, // 15, -8.5dB - {0x16, 0x15, 0x12, 0x0b, 0x00, 0x00, 0x00, 0x00}, // 16, -8.0dB - {0x17, 0x16, 0x13, 0x0b, 0x00, 0x00, 0x00, 0x00}, // 17, -7.5dB - {0x18, 0x17, 0x15, 0x0c, 0x00, 0x00, 0x00, 0x00}, // 18, -7.0dB - {0x1a, 0x19, 0x16, 0x0d, 0x00, 0x00, 0x00, 0x00}, // 19, -6.5dB - {0x1b, 0x1a, 0x17, 0x0e, 0x00, 0x00, 0x00, 0x00}, // 20, -6.0dB - {0x1d, 0x1c, 0x18, 0x0e, 0x00, 0x00, 0x00, 0x00}, // 21, -5.5dB - {0x1f, 0x1e, 0x1a, 0x0f, 0x00, 0x00, 0x00, 0x00}, // 22, -5.0dB - {0x20, 0x20, 0x1b, 0x10, 0x00, 0x00, 0x00, 0x00}, // 23, -4.5dB - {0x22, 0x21, 0x1d, 0x11, 0x00, 0x00, 0x00, 0x00}, // 24, -4.0dB - {0x24, 0x23, 0x1f, 0x12, 0x00, 0x00, 0x00, 0x00}, // 25, -3.5dB - {0x26, 0x25, 0x21, 0x13, 0x00, 0x00, 0x00, 0x00}, // 26, -3.0dB - {0x28, 0x28, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00}, // 27, -2.5dB - {0x2b, 0x2a, 0x25, 0x15, 0x00, 0x00, 0x00, 0x00}, // 28, -2.0dB - {0x2d, 0x2d, 0x17, 0x17, 0x00, 0x00, 0x00, 0x00}, // 29, -1.5dB - {0x30, 0x2f, 0x29, 0x18, 0x00, 0x00, 0x00, 0x00}, // 30, -1.0dB - {0x33, 0x32, 0x2b, 0x19, 0x00, 0x00, 0x00, 0x00}, // 31, -0.5dB - {0x36, 0x35, 0x2e, 0x1b, 0x00, 0x00, 0x00, 0x00} // 32, +0dB -}; - -u4Byte TxScalingTable_Jaguar[TXSCALE_TABLE_SIZE] = -{ - 0x081, // 0, -12.0dB - 0x088, // 1, -11.5dB - 0x090, // 2, -11.0dB - 0x099, // 3, -10.5dB - 0x0A2, // 4, -10.0dB - 0x0AC, // 5, -9.5dB - 0x0B6, // 6, -9.0dB - 0x0C0, // 7, -8.5dB - 0x0CC, // 8, -8.0dB - 0x0D8, // 9, -7.5dB - 0x0E5, // 10, -7.0dB - 0x0F2, // 11, -6.5dB - 0x101, // 12, -6.0dB - 0x110, // 13, -5.5dB - 0x120, // 14, -5.0dB - 0x131, // 15, -4.5dB - 0x143, // 16, -4.0dB - 0x156, // 17, -3.5dB - 0x16A, // 18, -3.0dB - 0x180, // 19, -2.5dB - 0x197, // 20, -2.0dB - 0x1AF, // 21, -1.5dB - 0x1C8, // 22, -1.0dB - 0x1E3, // 23, -0.5dB - 0x200, // 24, +0 dB - 0x21E, // 25, +0.5dB - 0x23E, // 26, +1.0dB - 0x261, // 27, +1.5dB - 0x285, // 28, +2.0dB - 0x2AB, // 29, +2.5dB - 0x2D3, // 30, +3.0dB - 0x2FE, // 31, +3.5dB - 0x32B, // 32, +4.0dB - 0x35C, // 33, +4.5dB - 0x38E, // 34, +5.0dB - 0x3C4, // 35, +5.5dB - 0x3FE // 36, +6.0dB -}; - -#ifdef AP_BUILD_WORKAROUND - -unsigned int TxPwrTrk_OFDM_SwingTbl[TxPwrTrk_OFDM_SwingTbl_Len] = { - /* +6.0dB */ 0x7f8001fe, - /* +5.5dB */ 0x788001e2, - /* +5.0dB */ 0x71c001c7, - /* +4.5dB */ 0x6b8001ae, - /* +4.0dB */ 0x65400195, - /* +3.5dB */ 0x5fc0017f, - /* +3.0dB */ 0x5a400169, - /* +2.5dB */ 0x55400155, - /* +2.0dB */ 0x50800142, - /* +1.5dB */ 0x4c000130, - /* +1.0dB */ 0x47c0011f, - /* +0.5dB */ 0x43c0010f, - /* 0.0dB */ 0x40000100, - /* -0.5dB */ 0x3c8000f2, - /* -1.0dB */ 0x390000e4, - /* -1.5dB */ 0x35c000d7, - /* -2.0dB */ 0x32c000cb, - /* -2.5dB */ 0x300000c0, - /* -3.0dB */ 0x2d4000b5, - /* -3.5dB */ 0x2ac000ab, - /* -4.0dB */ 0x288000a2, - /* -4.5dB */ 0x26000098, - /* -5.0dB */ 0x24000090, - /* -5.5dB */ 0x22000088, - /* -6.0dB */ 0x20000080, - /* -6.5dB */ 0x1a00006c, - /* -7.0dB */ 0x1c800072, - /* -7.5dB */ 0x18000060, - /* -8.0dB */ 0x19800066, - /* -8.5dB */ 0x15800056, - /* -9.0dB */ 0x26c0005b, - /* -9.5dB */ 0x14400051, - /* -10.0dB */ 0x24400051, - /* -10.5dB */ 0x1300004c, - /* -11.0dB */ 0x12000048, - /* -11.5dB */ 0x11000044, - /* -12.0dB */ 0x10000040 -}; -#endif - -//============================================================ -// Local Function predefine. -//============================================================ - -//START------------COMMON INFO RELATED---------------// -VOID -odm_CommonInfoSelfInit( - IN PDM_ODM_T pDM_Odm - ); - -VOID -odm_CommonInfoSelfUpdate( - IN PDM_ODM_T pDM_Odm - ); - -VOID -odm_CmnInfoInit_Debug( - IN PDM_ODM_T pDM_Odm - ); - -VOID -odm_CmnInfoHook_Debug( - IN PDM_ODM_T pDM_Odm - ); - -VOID -odm_CmnInfoUpdate_Debug( - IN PDM_ODM_T pDM_Odm - ); -VOID -odm_BasicDbgMessage -( - IN PDM_ODM_T pDM_Odm - ); - -//END------------COMMON INFO RELATED---------------// - -//START---------------DIG---------------------------// -VOID -odm_FalseAlarmCounterStatistics( - IN PDM_ODM_T pDM_Odm - ); - -VOID -odm_DIGInit( - IN PDM_ODM_T pDM_Odm - ); - -VOID -odm_DIG( - IN PDM_ODM_T pDM_Odm - ); - -BOOLEAN -odm_DigAbort( - IN PDM_ODM_T pDM_Odm - ); - -VOID -odm_CCKPacketDetectionThresh( - IN PDM_ODM_T pDM_Odm - ); - -VOID -odm_AdaptivityInit( - IN PDM_ODM_T pDM_Odm -); - -VOID -odm_Adaptivity( - IN PDM_ODM_T pDM_Odm, - IN u1Byte IGI -); -//END---------------DIG---------------------------// - -//START-------BB POWER SAVE-----------------------// -VOID -odm_DynamicBBPowerSavingInit( - IN PDM_ODM_T pDM_Odm - ); - -VOID -odm_DynamicBBPowerSaving( - IN PDM_ODM_T pDM_Odm - ); - -VOID -odm_1R_CCA( - IN PDM_ODM_T pDM_Odm - ); -//END---------BB POWER SAVE-----------------------// - -//START-----------------PSD-----------------------// -#if(DM_ODM_SUPPORT_TYPE & (ODM_WIN)) -//============================================================ -// Function predefine. -//============================================================ -VOID odm_PathDiversityInit_92C( IN PADAPTER Adapter); -VOID odm_2TPathDiversityInit_92C( IN PADAPTER Adapter); -VOID odm_1TPathDiversityInit_92C( IN PADAPTER Adapter); -BOOLEAN odm_IsConnected_92C(IN PADAPTER Adapter); -VOID odm_PathDiversityAfterLink_92C( IN PADAPTER Adapter); - -VOID -odm_CCKTXPathDiversityCallback( - PRT_TIMER pTimer - ); - -VOID -odm_CCKTXPathDiversityWorkItemCallback( - IN PVOID pContext - ); - -VOID -odm_PathDivChkAntSwitchCallback( - PRT_TIMER pTimer - ); - -VOID -odm_PathDivChkAntSwitchWorkitemCallback( - IN PVOID pContext - ); - -VOID odm_SetRespPath_92C( IN PADAPTER Adapter, IN u1Byte DefaultRespPath); -VOID odm_OFDMTXPathDiversity_92C( IN PADAPTER Adapter); -VOID odm_CCKTXPathDiversity_92C( IN PADAPTER Adapter); -VOID odm_ResetPathDiversity_92C( IN PADAPTER Adapter); - -//Start-------------------- RX High Power------------------------// -VOID odm_RXHPInit( IN PDM_ODM_T pDM_Odm); -VOID odm_RXHP( IN PDM_ODM_T pDM_Odm); -VOID odm_Write_RXHP( IN PDM_ODM_T pDM_Odm); - -VOID odm_PSD_RXHP( IN PDM_ODM_T pDM_Odm); -VOID odm_PSD_RXHPCallback( PRT_TIMER pTimer); -VOID odm_PSD_RXHPWorkitemCallback( IN PVOID pContext); -//End--------------------- RX High Power -----------------------// - -VOID odm_PathDivInit_92D( IN PDM_ODM_T pDM_Odm); - -VOID -odm_SetRespPath_92C( - IN PADAPTER Adapter, - IN u1Byte DefaultRespPath - ); - -#endif -//END-------------------PSD-----------------------// - -VOID -odm_RefreshRateAdaptiveMaskMP( - IN PDM_ODM_T pDM_Odm - ); - -VOID -odm_RefreshRateAdaptiveMaskCE( - IN PDM_ODM_T pDM_Odm - ); - -VOID -odm_RefreshRateAdaptiveMaskAPADSL( - IN PDM_ODM_T pDM_Odm - ); - -VOID -ODM_DynamicATCSwitch_init( - IN PDM_ODM_T pDM_Odm - ); - -VOID -ODM_DynamicATCSwitch( - IN PDM_ODM_T pDM_Odm - ); - -VOID -odm_Write_CrystalCap( - IN PDM_ODM_T pDM_Odm, - IN u1Byte CrystalCap -); - -VOID -odm_DynamicTxPowerInit( - IN PDM_ODM_T pDM_Odm - ); - -VOID -odm_DynamicTxPowerRestorePowerIndex( - IN PDM_ODM_T pDM_Odm - ); - -VOID -odm_DynamicTxPowerNIC( - IN PDM_ODM_T pDM_Odm - ); - -#if(DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) -VOID -odm_DynamicTxPowerSavePowerIndex( - IN PDM_ODM_T pDM_Odm - ); - -VOID -odm_DynamicTxPowerWritePowerIndex( - IN PDM_ODM_T pDM_Odm, - IN u1Byte Value); - -VOID -odm_DynamicTxPower_92C( - IN PDM_ODM_T pDM_Odm - ); - -VOID -odm_DynamicTxPower_92D( - IN PDM_ODM_T pDM_Odm - ); - -VOID -odm_MPT_DIGCallback( - PRT_TIMER pTimer -); - -VOID -odm_MPT_DIGWorkItemCallback( - IN PVOID pContext - ); -#endif - - -VOID -odm_RSSIMonitorInit( - IN PDM_ODM_T pDM_Odm - ); - -VOID -odm_RSSIMonitorCheckMP( - IN PDM_ODM_T pDM_Odm - ); - -VOID -odm_RSSIMonitorCheckCE( - IN PDM_ODM_T pDM_Odm - ); -VOID -odm_RSSIMonitorCheckAP( - IN PDM_ODM_T pDM_Odm - ); - - - -VOID -odm_RSSIMonitorCheck( - IN PDM_ODM_T pDM_Odm - ); -VOID -odm_DynamicTxPower( - IN PDM_ODM_T pDM_Odm - ); - -VOID -odm_DynamicTxPowerAP( - IN PDM_ODM_T pDM_Odm - ); - - -VOID -odm_SwAntDivInit( - IN PDM_ODM_T pDM_Odm - ); - -VOID -odm_SwAntDivInit_NIC( - IN PDM_ODM_T pDM_Odm - ); - -VOID -odm_SwAntDetectInit( - IN PDM_ODM_T pDM_Odm - ); - -VOID -odm_SwAntDivChkAntSwitch( - IN PDM_ODM_T pDM_Odm, - IN u1Byte Step - ); - -VOID -odm_SwAntDivChkAntSwitchNIC( - IN PDM_ODM_T pDM_Odm, - IN u1Byte Step - ); - - -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) -VOID -odm_SwAntDivChkAntSwitchCallback( - PRT_TIMER pTimer -); -VOID -odm_SwAntDivChkAntSwitchWorkitemCallback( - IN PVOID pContext - ); -VOID -ODM_UpdateInitRateWorkItemCallback( - IN PVOID pContext - ); -#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) -VOID odm_SwAntDivChkAntSwitchCallback(void *FunctionContext); -#elif (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) -VOID odm_SwAntDivChkAntSwitchCallback(void *FunctionContext); -#endif - - - -VOID -odm_GlobalAdapterCheck( - IN VOID - ); - -VOID -odm_RefreshBasicRateMask( - IN PDM_ODM_T pDM_Odm - ); - -VOID -odm_RefreshRateAdaptiveMask( - IN PDM_ODM_T pDM_Odm - ); - -VOID -ODM_TXPowerTrackingCheck( - IN PDM_ODM_T pDM_Odm - ); - -VOID -odm_TXPowerTrackingCheckAP( - IN PDM_ODM_T pDM_Odm - ); - - - - - - - -VOID -odm_RateAdaptiveMaskInit( - IN PDM_ODM_T pDM_Odm - ); - -VOID -odm_TXPowerTrackingThermalMeterInit( - IN PDM_ODM_T pDM_Odm - ); - - -VOID -odm_IQCalibrate( - IN PDM_ODM_T pDM_Odm - ); - -VOID -odm_TXPowerTrackingInit( - IN PDM_ODM_T pDM_Odm - ); - -VOID -odm_TXPowerTrackingCheckMP( - IN PDM_ODM_T pDM_Odm - ); - - -VOID -odm_TXPowerTrackingCheckCE( - IN PDM_ODM_T pDM_Odm - ); - -#if(DM_ODM_SUPPORT_TYPE & (ODM_WIN)) - -VOID -ODM_RateAdaptiveStateApInit( - IN PADAPTER Adapter , - IN PRT_WLAN_STA pEntry - ); - -VOID -odm_TXPowerTrackingCallbackThermalMeter92C( - IN PADAPTER Adapter - ); - -VOID -odm_TXPowerTrackingCallbackRXGainThermalMeter92D( - IN PADAPTER Adapter - ); - -VOID -odm_TXPowerTrackingCallbackThermalMeter92D( - IN PADAPTER Adapter - ); - -VOID -odm_TXPowerTrackingDirectCall92C( - IN PADAPTER Adapter - ); - -VOID -odm_TXPowerTrackingThermalMeterCheck( - IN PADAPTER Adapter - ); - -#endif - -VOID -odm_EdcaTurboCheck( - IN PDM_ODM_T pDM_Odm - ); -VOID -ODM_EdcaTurboInit( - IN PDM_ODM_T pDM_Odm -); - -#if(DM_ODM_SUPPORT_TYPE==ODM_WIN) -VOID -odm_EdcaTurboCheckMP( - IN PDM_ODM_T pDM_Odm - ); - -//check if edca turbo is disabled -BOOLEAN -odm_IsEdcaTurboDisable( - IN PDM_ODM_T pDM_Odm -); -//choose edca paramter for special IOT case -VOID -ODM_EdcaParaSelByIot( - IN PDM_ODM_T pDM_Odm, - OUT u4Byte *EDCA_BE_UL, - OUT u4Byte *EDCA_BE_DL - ); -//check if it is UL or DL -VOID -odm_EdcaChooseTrafficIdx( - IN PDM_ODM_T pDM_Odm, - IN u8Byte cur_tx_bytes, - IN u8Byte cur_rx_bytes, - IN BOOLEAN bBiasOnRx, - OUT BOOLEAN *pbIsCurRDLState - ); - -#elif (DM_ODM_SUPPORT_TYPE==ODM_CE) -VOID -odm_EdcaTurboCheckCE( - IN PDM_ODM_T pDM_Odm - ); -#else -VOID -odm_IotEngine( - IN PDM_ODM_T pDM_Odm - ); - -VOID -odm_EdcaParaInit( - IN PDM_ODM_T pDM_Odm - ); -#endif - - - -#define RxDefaultAnt1 0x65a9 -#define RxDefaultAnt2 0x569a - -VOID -odm_InitHybridAntDiv( - IN PDM_ODM_T pDM_Odm - ); - -BOOLEAN -odm_StaDefAntSel( - IN PDM_ODM_T pDM_Odm, - IN u4Byte OFDM_Ant1_Cnt, - IN u4Byte OFDM_Ant2_Cnt, - IN u4Byte CCK_Ant1_Cnt, - IN u4Byte CCK_Ant2_Cnt, - OUT u1Byte *pDefAnt - ); - -VOID -odm_SetRxIdleAnt( - IN PDM_ODM_T pDM_Odm, - IN u1Byte Ant, - IN BOOLEAN bDualPath -); - - - -VOID -odm_HwAntDiv( - IN PDM_ODM_T pDM_Odm -); - -VOID odm_PathDiversityInit(IN PDM_ODM_T pDM_Odm); -VOID odm_PathDiversity( IN PDM_ODM_T pDM_Odm); - - - -//============================================================ -//3 Export Interface -//============================================================ - -// -// 2011/09/21 MH Add to describe different team necessary resource allocate?? -// -VOID -ODM_DMInit( - IN PDM_ODM_T pDM_Odm - ) -{ - - //2012.05.03 Luke: For all IC series - odm_CommonInfoSelfInit(pDM_Odm); - odm_CmnInfoInit_Debug(pDM_Odm); - odm_DIGInit(pDM_Odm); - odm_AdaptivityInit(pDM_Odm); - odm_RateAdaptiveMaskInit(pDM_Odm); - odm_RSSIMonitorInit(pDM_Odm); - -#if (RTL8192E_SUPPORT == 1) - if(pDM_Odm->SupportICType==ODM_RTL8192E) - { - odm_PrimaryCCA_Check_Init(pDM_Odm); - } -#endif - -//#if (MP_DRIVER != 1) - if ( *(pDM_Odm->mp_mode) != 1) - odm_PathDiversityInit(pDM_Odm); -//#endif - ODM_EdcaTurboInit(pDM_Odm); - - if(pDM_Odm->SupportICType & ODM_IC_11AC_SERIES) - { - odm_TXPowerTrackingInit(pDM_Odm); -//#if (MP_DRIVER != 1) - if ( *(pDM_Odm->mp_mode) != 1) - ODM_AntDivInit(pDM_Odm); -//#endif - } - else if(pDM_Odm->SupportICType & ODM_IC_11N_SERIES) - { - odm_DynamicBBPowerSavingInit(pDM_Odm); - odm_DynamicTxPowerInit(pDM_Odm); - odm_TXPowerTrackingInit(pDM_Odm); - //ODM_EdcaTurboInit(pDM_Odm); -//#if (MP_DRIVER != 1) - if ( *(pDM_Odm->mp_mode) != 1) { - if(pDM_Odm->SupportICType==ODM_RTL8723A) - odm_SwAntDivInit(pDM_Odm); - else if(pDM_Odm->SupportICType & (ODM_RTL8192C|ODM_RTL8192D)) - { - if(pDM_Odm->AntDivType == HW_ANTDIV) - odm_InitHybridAntDiv(pDM_Odm); - else - odm_SwAntDivInit(pDM_Odm); - } - else - ODM_AntDivInit(pDM_Odm); - - if(pDM_Odm->SupportICType == ODM_RTL8723B) - odm_SwAntDetectInit(pDM_Odm); - } -//#endif - -//2010.05.30 LukeLee: For CE platform, files in IC subfolders may not be included to be compiled, -// so compile flags must be left here to prevent from compile errors -#if (RTL8188E_SUPPORT == 1) - if(pDM_Odm->SupportICType==ODM_RTL8188E) - { - odm_PrimaryCCA_Init(pDM_Odm); // Gary - ODM_RAInfo_Init_all(pDM_Odm); - } -#endif - -//2010.05.30 LukeLee: Following are not incorporated into ODM structure yet. -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - if(pDM_Odm->SupportICType&ODM_RTL8723A) - odm_PSDMonitorInit(pDM_Odm); - - if(!(pDM_Odm->SupportICType & (ODM_RTL8723A|ODM_RTL8188E))) - { - odm_RXHPInit(pDM_Odm); - } - if(pDM_Odm->SupportICType==ODM_RTL8192D) - { - odm_PathDivInit_92D(pDM_Odm); //92D Path Div Init //Neil Chen - } -#endif - } - - ODM_DynamicATCSwitch_init(pDM_Odm); - ODM_ClearTxPowerTrackingState(pDM_Odm); - -} - -// -// 2011/09/20 MH This is the entry pointer for all team to execute HW out source DM. -// You can not add any dummy function here, be care, you can only use DM structure -// to perform any new ODM_DM. -// -VOID -ODM_DMWatchdog( - IN PDM_ODM_T pDM_Odm - ) -{ - if((pDM_Odm->SupportICType == ODM_RTL8821) && (pDM_Odm->SupportInterface == ODM_ITRF_USB)) - { - if(pDM_Odm->RSSI_Min > 25) - ODM_Write1Byte(pDM_Odm, 0x4CF, 0x02); - else if(pDM_Odm->RSSI_Min < 20) - ODM_Write1Byte(pDM_Odm, 0x4CF, 0x00); - } - - - odm_CommonInfoSelfUpdate(pDM_Odm); - odm_BasicDbgMessage(pDM_Odm); - odm_FalseAlarmCounterStatistics(pDM_Odm); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): RSSI=0x%x\n",pDM_Odm->RSSI_Min)); - - odm_RSSIMonitorCheck(pDM_Odm); - -#if (DM_ODM_SUPPORT_TYPE == ODM_CE) -//#ifdef CONFIG_PLATFORM_SPRD - //For CE Platform(SPRD or Tablet) - //8723A or 8189ES platform - //NeilChen--2012--08--24-- - //Fix Leave LPS issue - if( (adapter_to_pwrctl(pDM_Odm->Adapter)->pwr_mode != PS_MODE_ACTIVE) // in LPS mode - //&&( - // (pDM_Odm->SupportICType & (ODM_RTL8723A ) )|| - // (pDM_Odm->SupportICType & (ODM_RTL8188E) &&((pDM_Odm->SupportInterface == ODM_ITRF_SDIO)) ) - //) - ) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("----Step1: odm_DIG is in LPS mode\n")); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("---Step2: 8723AS is in LPS mode\n")); - odm_DIGbyRSSI_LPS(pDM_Odm); - } - else -//#endif -#endif - { - odm_DIG(pDM_Odm); - } - - { - pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable; - odm_Adaptivity(pDM_Odm, pDM_DigTable->CurIGValue); - } - odm_CCKPacketDetectionThresh(pDM_Odm); - - if(*(pDM_Odm->pbPowerSaving)==TRUE) - return; - - - odm_RefreshRateAdaptiveMask(pDM_Odm); - odm_RefreshBasicRateMask(pDM_Odm); - odm_DynamicBBPowerSaving(pDM_Odm); - odm_EdcaTurboCheck(pDM_Odm); - odm_PathDiversity(pDM_Odm); - ODM_DynamicATCSwitch(pDM_Odm); - odm_DynamicTxPower(pDM_Odm); - -#if (RTL8192E_SUPPORT == 1) - if(pDM_Odm->SupportICType==ODM_RTL8192E) - odm_DynamicPrimaryCCA_Check(pDM_Odm); -#endif - //if(pDM_Odm->SupportICType == ODM_RTL8192E) - // return; - - -//#if (MP_DRIVER != 1) -if ( *(pDM_Odm->mp_mode) != 1) { - if(pDM_Odm->SupportICType==ODM_RTL8723A) - { - odm_SwAntDivChkAntSwitch(pDM_Odm, SWAW_STEP_PEAK); - } - else if(pDM_Odm->SupportICType & (ODM_RTL8192C|ODM_RTL8192D)) - { - if(pDM_Odm->AntDivType == HW_ANTDIV) - odm_HwAntDiv(pDM_Odm); - else - odm_SwAntDivChkAntSwitch(pDM_Odm, SWAW_STEP_PEAK); - } - else - ODM_AntDiv(pDM_Odm); -} -//#endif - - if(pDM_Odm->SupportICType & ODM_IC_11AC_SERIES) - { - ODM_TXPowerTrackingCheck(pDM_Odm); - - odm_IQCalibrate(pDM_Odm); - } - else if(pDM_Odm->SupportICType & ODM_IC_11N_SERIES) - { - ODM_TXPowerTrackingCheck(pDM_Odm); - - //odm_EdcaTurboCheck(pDM_Odm); - - #if( DM_ODM_SUPPORT_TYPE & (ODM_WIN)) - if(!(pDM_Odm->SupportICType & (ODM_RTL8723A|ODM_RTL8188E))) - odm_RXHP(pDM_Odm); - #endif - - //2010.05.30 LukeLee: For CE platform, files in IC subfolders may not be included to be compiled, - // so compile flags must be left here to prevent from compile errors -#if (RTL8192D_SUPPORT == 1) - if(pDM_Odm->SupportICType==ODM_RTL8192D) - ODM_DynamicEarlyMode(pDM_Odm); -#endif - odm_DynamicBBPowerSaving(pDM_Odm); -#if (RTL8188E_SUPPORT == 1) - if(pDM_Odm->SupportICType==ODM_RTL8188E) - odm_DynamicPrimaryCCA(pDM_Odm); -#endif - - } - pDM_Odm->PhyDbgInfo.NumQryBeaconPkt = 0; - -#if (DM_ODM_SUPPORT_TYPE == ODM_CE) - odm_dtc(pDM_Odm); -#endif -} - - -// -// Init /.. Fixed HW value. Only init time. -// -VOID -ODM_CmnInfoInit( - IN PDM_ODM_T pDM_Odm, - IN ODM_CMNINFO_E CmnInfo, - IN u4Byte Value - ) -{ - // - // This section is used for init value - // - switch (CmnInfo) - { - // - // Fixed ODM value. - // - case ODM_CMNINFO_ABILITY: - pDM_Odm->SupportAbility = (u4Byte)Value; - break; - - case ODM_CMNINFO_RF_TYPE: - pDM_Odm->RFType = (u1Byte)Value; - break; - - case ODM_CMNINFO_PLATFORM: - pDM_Odm->SupportPlatform = (u1Byte)Value; - break; - - case ODM_CMNINFO_INTERFACE: - pDM_Odm->SupportInterface = (u1Byte)Value; - break; - - case ODM_CMNINFO_MP_TEST_CHIP: - pDM_Odm->bIsMPChip= (u1Byte)Value; - break; - - case ODM_CMNINFO_IC_TYPE: - pDM_Odm->SupportICType = Value; - break; - - case ODM_CMNINFO_CUT_VER: - pDM_Odm->CutVersion = (u1Byte)Value; - break; - - case ODM_CMNINFO_FAB_VER: - pDM_Odm->FabVersion = (u1Byte)Value; - break; - - case ODM_CMNINFO_RFE_TYPE: - pDM_Odm->RFEType = (u1Byte)Value; - break; - - case ODM_CMNINFO_RF_ANTENNA_TYPE: - pDM_Odm->AntDivType= (u1Byte)Value; - break; - - case ODM_CMNINFO_BOARD_TYPE: - pDM_Odm->BoardType = (u1Byte)Value; - break; - - case ODM_CMNINFO_PACKAGE_TYPE: - pDM_Odm->PackageType = (u1Byte)Value; - break; - - case ODM_CMNINFO_EXT_LNA: - pDM_Odm->ExtLNA = (u1Byte)Value; - break; - - case ODM_CMNINFO_5G_EXT_LNA: - pDM_Odm->ExtLNA5G = (u1Byte)Value; - break; - - case ODM_CMNINFO_EXT_PA: - pDM_Odm->ExtPA = (u1Byte)Value; - break; - - case ODM_CMNINFO_5G_EXT_PA: - pDM_Odm->ExtPA5G = (u1Byte)Value; - break; - - case ODM_CMNINFO_GPA: - pDM_Odm->TypeGPA= (ODM_TYPE_GPA_E)Value; - break; - case ODM_CMNINFO_APA: - pDM_Odm->TypeAPA= (ODM_TYPE_APA_E)Value; - break; - case ODM_CMNINFO_GLNA: - pDM_Odm->TypeGLNA= (ODM_TYPE_GLNA_E)Value; - break; - case ODM_CMNINFO_ALNA: - pDM_Odm->TypeALNA= (ODM_TYPE_ALNA_E)Value; - break; - - case ODM_CMNINFO_EXT_TRSW: - pDM_Odm->ExtTRSW = (u1Byte)Value; - break; - case ODM_CMNINFO_PATCH_ID: - pDM_Odm->PatchID = (u1Byte)Value; - break; - case ODM_CMNINFO_BINHCT_TEST: - pDM_Odm->bInHctTest = (BOOLEAN)Value; - break; - case ODM_CMNINFO_BWIFI_TEST: - pDM_Odm->bWIFITest = (BOOLEAN)Value; - break; - - case ODM_CMNINFO_SMART_CONCURRENT: - pDM_Odm->bDualMacSmartConcurrent = (BOOLEAN )Value; - break; - - //To remove the compiler warning, must add an empty default statement to handle the other values. - default: - //do nothing - break; - - } - -} - - -VOID -ODM_CmnInfoHook( - IN PDM_ODM_T pDM_Odm, - IN ODM_CMNINFO_E CmnInfo, - IN PVOID pValue - ) -{ - // - // Hook call by reference pointer. - // - switch (CmnInfo) - { - // - // Dynamic call by reference pointer. - // - case ODM_CMNINFO_MAC_PHY_MODE: - pDM_Odm->pMacPhyMode = (u1Byte *)pValue; - break; - - case ODM_CMNINFO_TX_UNI: - pDM_Odm->pNumTxBytesUnicast = (u8Byte *)pValue; - break; - - case ODM_CMNINFO_RX_UNI: - pDM_Odm->pNumRxBytesUnicast = (u8Byte *)pValue; - break; - - case ODM_CMNINFO_WM_MODE: - pDM_Odm->pWirelessMode = (u1Byte *)pValue; - break; - - case ODM_CMNINFO_BAND: - pDM_Odm->pBandType = (u1Byte *)pValue; - break; - - case ODM_CMNINFO_SEC_CHNL_OFFSET: - pDM_Odm->pSecChOffset = (u1Byte *)pValue; - break; - - case ODM_CMNINFO_SEC_MODE: - pDM_Odm->pSecurity = (u1Byte *)pValue; - break; - - case ODM_CMNINFO_BW: - pDM_Odm->pBandWidth = (u1Byte *)pValue; - break; - - case ODM_CMNINFO_CHNL: - pDM_Odm->pChannel = (u1Byte *)pValue; - break; - - case ODM_CMNINFO_DMSP_GET_VALUE: - pDM_Odm->pbGetValueFromOtherMac = (BOOLEAN *)pValue; - break; - - case ODM_CMNINFO_BUDDY_ADAPTOR: - pDM_Odm->pBuddyAdapter = (PADAPTER *)pValue; - break; - - case ODM_CMNINFO_DMSP_IS_MASTER: - pDM_Odm->pbMasterOfDMSP = (BOOLEAN *)pValue; - break; - - case ODM_CMNINFO_SCAN: - pDM_Odm->pbScanInProcess = (BOOLEAN *)pValue; - break; - - case ODM_CMNINFO_POWER_SAVING: - pDM_Odm->pbPowerSaving = (BOOLEAN *)pValue; - break; - - case ODM_CMNINFO_ONE_PATH_CCA: - pDM_Odm->pOnePathCCA = (u1Byte *)pValue; - break; - - case ODM_CMNINFO_DRV_STOP: - pDM_Odm->pbDriverStopped = (BOOLEAN *)pValue; - break; - - case ODM_CMNINFO_PNP_IN: - pDM_Odm->pbDriverIsGoingToPnpSetPowerSleep = (BOOLEAN *)pValue; - break; - - case ODM_CMNINFO_INIT_ON: - pDM_Odm->pinit_adpt_in_progress = (BOOLEAN *)pValue; - break; - - case ODM_CMNINFO_ANT_TEST: - pDM_Odm->pAntennaTest = (u1Byte *)pValue; - break; - - case ODM_CMNINFO_NET_CLOSED: - pDM_Odm->pbNet_closed = (BOOLEAN *)pValue; - break; - - case ODM_CMNINFO_FORCED_RATE: - pDM_Odm->pForcedDataRate = (pu2Byte)pValue; - break; - - case ODM_CMNINFO_FORCED_IGI_LB: - pDM_Odm->pu1ForcedIgiLb = (u1Byte *)pValue; - break; - - case ODM_CMNINFO_MP_MODE: - pDM_Odm->mp_mode = (u1Byte *)pValue; - break; - - //case ODM_CMNINFO_RTSTA_AID: - // pDM_Odm->pAidMap = (u1Byte *)pValue; - // break; - - //case ODM_CMNINFO_BT_COEXIST: - // pDM_Odm->BTCoexist = (BOOLEAN *)pValue; - - //case ODM_CMNINFO_STA_STATUS: - //pDM_Odm->pODM_StaInfo[] = (PSTA_INFO_T)pValue; - //break; - - //case ODM_CMNINFO_PHY_STATUS: - // pDM_Odm->pPhyInfo = (ODM_PHY_INFO *)pValue; - // break; - - //case ODM_CMNINFO_MAC_STATUS: - // pDM_Odm->pMacInfo = (ODM_MAC_INFO *)pValue; - // break; - //To remove the compiler warning, must add an empty default statement to handle the other values. - default: - //do nothing - break; - - } - -} - - -VOID -ODM_CmnInfoPtrArrayHook( - IN PDM_ODM_T pDM_Odm, - IN ODM_CMNINFO_E CmnInfo, - IN u2Byte Index, - IN PVOID pValue - ) -{ - // - // Hook call by reference pointer. - // - switch (CmnInfo) - { - // - // Dynamic call by reference pointer. - // - case ODM_CMNINFO_STA_STATUS: - pDM_Odm->pODM_StaInfo[Index] = (PSTA_INFO_T)pValue; - break; - //To remove the compiler warning, must add an empty default statement to handle the other values. - default: - //do nothing - break; - } - -} - - -// -// Update Band/CHannel/.. The values are dynamic but non-per-packet. -// -VOID -ODM_CmnInfoUpdate( - IN PDM_ODM_T pDM_Odm, - IN u4Byte CmnInfo, - IN u8Byte Value - ) -{ - // - // This init variable may be changed in run time. - // - switch (CmnInfo) - { - case ODM_CMNINFO_LINK_IN_PROGRESS: - pDM_Odm->bLinkInProcess = (BOOLEAN)Value; - break; - - case ODM_CMNINFO_ABILITY: - pDM_Odm->SupportAbility = (u4Byte)Value; - break; - - case ODM_CMNINFO_RF_TYPE: - pDM_Odm->RFType = (u1Byte)Value; - break; - - case ODM_CMNINFO_WIFI_DIRECT: - pDM_Odm->bWIFI_Direct = (BOOLEAN)Value; - break; - - case ODM_CMNINFO_WIFI_DISPLAY: - pDM_Odm->bWIFI_Display = (BOOLEAN)Value; - break; - - case ODM_CMNINFO_LINK: - pDM_Odm->bLinked = (BOOLEAN)Value; - break; - - case ODM_CMNINFO_STATION_STATE: - pDM_Odm->bsta_state = (BOOLEAN)Value; - break; - - case ODM_CMNINFO_RSSI_MIN: - pDM_Odm->RSSI_Min= (u1Byte)Value; - break; - - case ODM_CMNINFO_DBG_COMP: - pDM_Odm->DebugComponents = Value; - break; - - case ODM_CMNINFO_DBG_LEVEL: - pDM_Odm->DebugLevel = (u4Byte)Value; - break; - case ODM_CMNINFO_RA_THRESHOLD_HIGH: - pDM_Odm->RateAdaptive.HighRSSIThresh = (u1Byte)Value; - break; - - case ODM_CMNINFO_RA_THRESHOLD_LOW: - pDM_Odm->RateAdaptive.LowRSSIThresh = (u1Byte)Value; - break; - // The following is for BT HS mode and BT coexist mechanism. - case ODM_CMNINFO_BT_DISABLED: - pDM_Odm->bBtDisabled = (BOOLEAN)Value; - break; - - case ODM_CMNINFO_BT_HS_CONNECT_PROCESS: - pDM_Odm->bBtConnectProcess = (BOOLEAN)Value; - break; - - case ODM_CMNINFO_BT_HS_RSSI: - pDM_Odm->btHsRssi = (u1Byte)Value; - break; - - case ODM_CMNINFO_BT_OPERATION: - pDM_Odm->bBtHsOperation = (BOOLEAN)Value; - break; - - case ODM_CMNINFO_BT_LIMITED_DIG: - pDM_Odm->bBtLimitedDig = (BOOLEAN)Value; - break; - - case ODM_CMNINFO_BT_DISABLE_EDCA: - pDM_Odm->bBtDisableEdcaTurbo = (BOOLEAN)Value; - break; - -/* - case ODM_CMNINFO_OP_MODE: - pDM_Odm->OPMode = (u1Byte)Value; - break; - - case ODM_CMNINFO_WM_MODE: - pDM_Odm->WirelessMode = (u1Byte)Value; - break; - - case ODM_CMNINFO_BAND: - pDM_Odm->BandType = (u1Byte)Value; - break; - - case ODM_CMNINFO_SEC_CHNL_OFFSET: - pDM_Odm->SecChOffset = (u1Byte)Value; - break; - - case ODM_CMNINFO_SEC_MODE: - pDM_Odm->Security = (u1Byte)Value; - break; - - case ODM_CMNINFO_BW: - pDM_Odm->BandWidth = (u1Byte)Value; - break; - - case ODM_CMNINFO_CHNL: - pDM_Odm->Channel = (u1Byte)Value; - break; -*/ - default: - //do nothing - break; - } - - -} - -VOID -odm_CommonInfoSelfInit( - IN PDM_ODM_T pDM_Odm - ) -{ - pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; - pDM_Odm->bCckHighPower = (BOOLEAN) ODM_GetBBReg(pDM_Odm, ODM_REG(CCK_RPT_FORMAT,pDM_Odm), ODM_BIT(CCK_RPT_FORMAT,pDM_Odm)); - pDM_Odm->RFPathRxEnable = (u1Byte) ODM_GetBBReg(pDM_Odm, ODM_REG(BB_RX_PATH,pDM_Odm), ODM_BIT(BB_RX_PATH,pDM_Odm)); -#if (DM_ODM_SUPPORT_TYPE != ODM_CE) - pDM_Odm->pbNet_closed = &pDM_Odm->BOOLEAN_temp; -#endif - - ODM_InitDebugSetting(pDM_Odm); - - if(pDM_Odm->SupportICType==ODM_RTL8723A) - { - pDM_Odm->AntDivType = SW_ANTDIV; - } - else if(pDM_Odm->SupportICType & (ODM_RTL8192C|ODM_RTL8192D)) - { - #if(defined(CONFIG_HW_ANTENNA_DIVERSITY)) - pDM_Odm->AntDivType = HW_ANTDIV; - #elif (defined(CONFIG_SW_ANTENNA_DIVERSITY)) - pDM_Odm->AntDivType = SW_ANTDIV; - #endif - } - pDM_Odm->TxRate = 0xFF; -#if(defined(CONFIG_HW_ANTENNA_DIVERSITY)) -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) - - if(pDM_Odm->SupportICType==ODM_RTL8723B) - { - if((!pDM_Odm->DM_SWAT_Table.ANTA_ON || !pDM_Odm->DM_SWAT_Table.ANTB_ON)) - pDM_Odm->SupportAbility &= ~(ODM_BB_ANT_DIV); - } - -#elif (DM_ODM_SUPPORT_TYPE == ODM_AP) - - #if(defined(CONFIG_NOT_SUPPORT_ANTDIV)) - pDM_Odm->SupportAbility &= ~(ODM_BB_ANT_DIV); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ Disable AntDiv function] : Not Support 2.4G & 5G Antenna Diversity\n")); - #elif(defined(CONFIG_2G5G_SUPPORT_ANTDIV)) - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ Enable AntDiv function] : 2.4G & 5G Support Antenna Diversity Simultaneously \n")); - pDM_FatTable->AntDiv_2G_5G = (ODM_ANTDIV_2G|ODM_ANTDIV_5G); - if(pDM_Odm->SupportICType & ODM_ANTDIV_SUPPORT) - pDM_Odm->SupportAbility |= ODM_BB_ANT_DIV; - if(*pDM_Odm->pBandType == ODM_BAND_5G ) - { - #if ( defined(CONFIG_5G_CGCS_RX_DIVERSITY) ) - pDM_Odm->AntDivType = CGCS_RX_HW_ANTDIV; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ 5G] : AntDiv Type = CGCS_RX_HW_ANTDIV\n")); - #elif( defined(CONFIG_5G_CG_TRX_DIVERSITY) ) - pDM_Odm->AntDivType = CG_TRX_HW_ANTDIV; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ 5G] : AntDiv Type = CG_TRX_HW_ANTDIV\n")); - #elif( defined(CONFIG_5G_CG_SMART_ANT_DIVERSITY) ) - pDM_Odm->AntDivType = CG_TRX_SMART_ANTDIV; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ 5G] : AntDiv Type = CG_SMART_ANTDIV\n")); - #endif - } - else if(*pDM_Odm->pBandType == ODM_BAND_2_4G ) - { - #if ( defined(CONFIG_2G_CGCS_RX_DIVERSITY) ) - pDM_Odm->AntDivType = CGCS_RX_HW_ANTDIV; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ 2.4G] : AntDiv Type = CGCS_RX_HW_ANTDIV\n")); - #elif( defined(CONFIG_2G_CG_TRX_DIVERSITY) ) - pDM_Odm->AntDivType = CG_TRX_HW_ANTDIV; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ 2.4G] : AntDiv Type = CG_TRX_HW_ANTDIV\n")); - #elif( defined(CONFIG_2G_CG_SMART_ANT_DIVERSITY) ) - pDM_Odm->AntDivType = CG_TRX_SMART_ANTDIV; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ 2.4G] : AntDiv Type = CG_SMART_ANTDIV\n")); - #endif - } - #elif(defined(CONFIG_5G_SUPPORT_ANTDIV)) - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ Enable AntDiv function] : Only 5G Support Antenna Diversity\n")); - pDM_FatTable->AntDiv_2G_5G = (ODM_ANTDIV_5G); - if(*pDM_Odm->pBandType == ODM_BAND_5G ) - { - if(pDM_Odm->SupportICType & ODM_ANTDIV_5G_SUPPORT_IC) - pDM_Odm->SupportAbility |= ODM_BB_ANT_DIV; - #if ( defined(CONFIG_5G_CGCS_RX_DIVERSITY) ) - pDM_Odm->AntDivType = CGCS_RX_HW_ANTDIV; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ 5G] : AntDiv Type = CGCS_RX_HW_ANTDIV\n")); - #elif( defined(CONFIG_5G_CG_TRX_DIVERSITY) ) - pDM_Odm->AntDivType = CG_TRX_HW_ANTDIV; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ 5G] : AntDiv Type = CG_TRX_HW_ANTDIV\n")); - #elif( defined(CONFIG_5G_CG_SMART_ANT_DIVERSITY) ) - pDM_Odm->AntDivType = CG_TRX_SMART_ANTDIV; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ 5G] : AntDiv Type = CG_SMART_ANTDIV\n")); - #endif - } - else if(*pDM_Odm->pBandType == ODM_BAND_2_4G ) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("Not Support 2G AntDivType\n")); - pDM_Odm->SupportAbility &= ~(ODM_BB_ANT_DIV); - } - #elif(defined(CONFIG_2G_SUPPORT_ANTDIV)) - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ Enable AntDiv function] : Only 2.4G Support Antenna Diversity\n")); - pDM_FatTable->AntDiv_2G_5G = (ODM_ANTDIV_2G); - if(*pDM_Odm->pBandType == ODM_BAND_2_4G ) - { - if(pDM_Odm->SupportICType & ODM_ANTDIV_2G_SUPPORT_IC) - pDM_Odm->SupportAbility |= ODM_BB_ANT_DIV; - #if ( defined(CONFIG_2G_CGCS_RX_DIVERSITY) ) - pDM_Odm->AntDivType = CGCS_RX_HW_ANTDIV; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ 2.4G] : AntDiv Type = CGCS_RX_HW_ANTDIV\n")); - #elif( defined(CONFIG_2G_CG_TRX_DIVERSITY) ) - pDM_Odm->AntDivType = CG_TRX_HW_ANTDIV; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ 2.4G] : AntDiv Type = CG_TRX_HW_ANTDIV\n")); - #elif( defined(CONFIG_2G_CG_SMART_ANT_DIVERSITY) ) - pDM_Odm->AntDivType = CG_TRX_SMART_ANTDIV; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ 2.4G] : AntDiv Type = CG_SMART_ANTDIV\n")); - #endif - } - else if(*pDM_Odm->pBandType == ODM_BAND_5G ) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("Not Support 5G AntDivType\n")); - pDM_Odm->SupportAbility &= ~(ODM_BB_ANT_DIV); - } - #endif -#endif //#if (DM_ODM_SUPPORT_TYPE == ODM_AP) -#endif //#if(defined(CONFIG_HW_ANTENNA_DIVERSITY)) - -} - -VOID -odm_CommonInfoSelfUpdate( - IN PDM_ODM_T pDM_Odm - ) -{ - u1Byte EntryCnt=0; - u1Byte i; - PSTA_INFO_T pEntry; - -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - - PADAPTER Adapter = pDM_Odm->Adapter; - PMGNT_INFO pMgntInfo = &Adapter->MgntInfo; - - pEntry = pDM_Odm->pODM_StaInfo[0]; - if(pMgntInfo->mAssoc) - { - pEntry->bUsed=TRUE; - for (i=0; i<6; i++) - pEntry->MacAddr[i] = pMgntInfo->Bssid[i]; - } - else - { - pEntry->bUsed=FALSE; - for (i=0; i<6; i++) - pEntry->MacAddr[i] = 0; - } -#endif - - - if(*(pDM_Odm->pBandWidth) == ODM_BW40M) - { - if(*(pDM_Odm->pSecChOffset) == 1) - pDM_Odm->ControlChannel = *(pDM_Odm->pChannel) -2; - else if(*(pDM_Odm->pSecChOffset) == 2) - pDM_Odm->ControlChannel = *(pDM_Odm->pChannel) +2; - } - else - pDM_Odm->ControlChannel = *(pDM_Odm->pChannel); - - for (i=0; ipODM_StaInfo[i]; - if(IS_STA_VALID(pEntry)) - EntryCnt++; - } - if(EntryCnt == 1) - pDM_Odm->bOneEntryOnly = TRUE; - else - pDM_Odm->bOneEntryOnly = FALSE; -} - -VOID -odm_CmnInfoInit_Debug( - IN PDM_ODM_T pDM_Odm - ) -{ - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("odm_CmnInfoInit_Debug==>\n")); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("SupportPlatform=%d\n",pDM_Odm->SupportPlatform) ); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("SupportAbility=0x%x\n",pDM_Odm->SupportAbility) ); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("SupportInterface=%d\n",pDM_Odm->SupportInterface) ); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("SupportICType=0x%x\n",pDM_Odm->SupportICType) ); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("CutVersion=%d\n",pDM_Odm->CutVersion) ); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("FabVersion=%d\n",pDM_Odm->FabVersion) ); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("RFType=%d\n",pDM_Odm->RFType) ); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("BoardType=%d\n",pDM_Odm->BoardType) ); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("ExtLNA=%d\n",pDM_Odm->ExtLNA) ); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("ExtPA=%d\n",pDM_Odm->ExtPA) ); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("ExtTRSW=%d\n",pDM_Odm->ExtTRSW) ); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("PatchID=%d\n",pDM_Odm->PatchID) ); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("bInHctTest=%d\n",pDM_Odm->bInHctTest) ); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("bWIFITest=%d\n",pDM_Odm->bWIFITest) ); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("bDualMacSmartConcurrent=%d\n",pDM_Odm->bDualMacSmartConcurrent) ); - -} - -VOID -odm_CmnInfoHook_Debug( - IN PDM_ODM_T pDM_Odm - ) -{ - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("odm_CmnInfoHook_Debug==>\n")); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("pNumTxBytesUnicast=%llu\n",*(pDM_Odm->pNumTxBytesUnicast)) ); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("pNumRxBytesUnicast=%llu\n",*(pDM_Odm->pNumRxBytesUnicast)) ); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("pWirelessMode=0x%x\n",*(pDM_Odm->pWirelessMode)) ); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("pSecChOffset=%d\n",*(pDM_Odm->pSecChOffset)) ); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("pSecurity=%d\n",*(pDM_Odm->pSecurity)) ); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("pBandWidth=%d\n",*(pDM_Odm->pBandWidth)) ); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("pChannel=%d\n",*(pDM_Odm->pChannel)) ); - - if(pDM_Odm->SupportICType==ODM_RTL8192D) - { - if(pDM_Odm->pBandType) - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("pBandType=%d\n",*(pDM_Odm->pBandType)) ); - if(pDM_Odm->pMacPhyMode) - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("pMacPhyMode=%d\n",*(pDM_Odm->pMacPhyMode)) ); - if(pDM_Odm->pBuddyAdapter) - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("pbGetValueFromOtherMac=%d\n",*(pDM_Odm->pbGetValueFromOtherMac)) ); - if(pDM_Odm->pBuddyAdapter) - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("pBuddyAdapter=%p\n",*(pDM_Odm->pBuddyAdapter)) ); - if(pDM_Odm->pbMasterOfDMSP) - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("pbMasterOfDMSP=%d\n",*(pDM_Odm->pbMasterOfDMSP)) ); - } - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("pbScanInProcess=%d\n",*(pDM_Odm->pbScanInProcess)) ); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("pbPowerSaving=%d\n",*(pDM_Odm->pbPowerSaving)) ); - - if(pDM_Odm->SupportPlatform & (ODM_AP|ODM_ADSL)) - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("pOnePathCCA=%d\n",*(pDM_Odm->pOnePathCCA)) ); -} - -VOID -odm_CmnInfoUpdate_Debug( - IN PDM_ODM_T pDM_Odm - ) -{ - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("odm_CmnInfoUpdate_Debug==>\n")); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("bWIFI_Direct=%d\n",pDM_Odm->bWIFI_Direct) ); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("bWIFI_Display=%d\n",pDM_Odm->bWIFI_Display) ); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("bLinked=%d\n",pDM_Odm->bLinked) ); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("RSSI_Min=%d\n",pDM_Odm->RSSI_Min) ); -} - -VOID -odm_BasicDbgMessage -( - IN PDM_ODM_T pDM_Odm - ) -{ - PFALSE_ALARM_STATISTICS FalseAlmCnt = &(pDM_Odm->FalseAlmCnt); - pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable; - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("odm_BasicDbgMsg==>\n")); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("bLinked = %d, RSSI_Min = %d, CurrentIGI = 0x%x \n", - pDM_Odm->bLinked, pDM_Odm->RSSI_Min, pDM_DigTable->CurIGValue) ); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("Cnt_Cck_fail = %d, Cnt_Ofdm_fail = %d, Total False Alarm = %d\n", - FalseAlmCnt->Cnt_Cck_fail, FalseAlmCnt->Cnt_Ofdm_fail, FalseAlmCnt->Cnt_all)); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("RxRate = 0x%x, RSSI_A = %d, RSSI_B = %d\n", - pDM_Odm->RxRate, pDM_Odm->RSSI_A, pDM_Odm->RSSI_B)); - -} - -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) -VOID -ODM_InitAllWorkItems(IN PDM_ODM_T pDM_Odm ) -{ -#if USE_WORKITEM - PADAPTER pAdapter = pDM_Odm->Adapter; - - ODM_InitializeWorkItem( pDM_Odm, - &pDM_Odm->DM_SWAT_Table.SwAntennaSwitchWorkitem_8723B, - (RT_WORKITEM_CALL_BACK)ODM_SW_AntDiv_WorkitemCallback, - (PVOID)pAdapter, - "AntennaSwitchWorkitem"); - - ODM_InitializeWorkItem( pDM_Odm, - &pDM_Odm->DM_SWAT_Table.SwAntennaSwitchWorkitem, - (RT_WORKITEM_CALL_BACK)odm_SwAntDivChkAntSwitchWorkitemCallback, - (PVOID)pAdapter, - "AntennaSwitchWorkitem"); - - - ODM_InitializeWorkItem( - pDM_Odm, - &(pDM_Odm->PathDivSwitchWorkitem), - (RT_WORKITEM_CALL_BACK)odm_PathDivChkAntSwitchWorkitemCallback, - (PVOID)pAdapter, - "SWAS_WorkItem"); - - ODM_InitializeWorkItem( - pDM_Odm, - &(pDM_Odm->CCKPathDiversityWorkitem), - (RT_WORKITEM_CALL_BACK)odm_CCKTXPathDiversityWorkItemCallback, - (PVOID)pAdapter, - "CCKTXPathDiversityWorkItem"); - - ODM_InitializeWorkItem( - pDM_Odm, - &(pDM_Odm->MPT_DIGWorkitem), - (RT_WORKITEM_CALL_BACK)odm_MPT_DIGWorkItemCallback, - (PVOID)pAdapter, - "MPT_DIGWorkitem"); - - ODM_InitializeWorkItem( - pDM_Odm, - &(pDM_Odm->RaRptWorkitem), - (RT_WORKITEM_CALL_BACK)ODM_UpdateInitRateWorkItemCallback, - (PVOID)pAdapter, - "RaRptWorkitem"); - -#if(defined(CONFIG_HW_ANTENNA_DIVERSITY)) -#if (RTL8188E_SUPPORT == 1) - ODM_InitializeWorkItem( - pDM_Odm, - &(pDM_Odm->FastAntTrainingWorkitem), - (RT_WORKITEM_CALL_BACK)odm_FastAntTrainingWorkItemCallback, - (PVOID)pAdapter, - "FastAntTrainingWorkitem"); -#endif -#endif - ODM_InitializeWorkItem( - pDM_Odm, - &(pDM_Odm->DM_RXHP_Table.PSDTimeWorkitem), - (RT_WORKITEM_CALL_BACK)odm_PSD_RXHPWorkitemCallback, - (PVOID)pAdapter, - "PSDRXHP_WorkItem"); -#endif -} - -VOID -ODM_FreeAllWorkItems(IN PDM_ODM_T pDM_Odm ) -{ -#if USE_WORKITEM - ODM_FreeWorkItem( &(pDM_Odm->DM_SWAT_Table.SwAntennaSwitchWorkitem_8723B)); - - ODM_FreeWorkItem( &(pDM_Odm->DM_SWAT_Table.SwAntennaSwitchWorkitem)); - - ODM_FreeWorkItem(&(pDM_Odm->PathDivSwitchWorkitem)); - - ODM_FreeWorkItem(&(pDM_Odm->CCKPathDiversityWorkitem)); - - ODM_FreeWorkItem(&(pDM_Odm->FastAntTrainingWorkitem)); - - ODM_FreeWorkItem(&(pDM_Odm->MPT_DIGWorkitem)); - - ODM_FreeWorkItem(&(pDM_Odm->RaRptWorkitem)); - - ODM_FreeWorkItem((&pDM_Odm->DM_RXHP_Table.PSDTimeWorkitem)); -#endif - -} -#endif - -/* -VOID -odm_FindMinimumRSSI( - IN PDM_ODM_T pDM_Odm - ) -{ - u4Byte i; - u1Byte RSSI_Min = 0xFF; - - for(i=0; ipODM_StaInfo[i] != NULL) - if(IS_STA_VALID(pDM_Odm->pODM_StaInfo[i]) ) - { - if(pDM_Odm->pODM_StaInfo[i]->RSSI_Ave < RSSI_Min) - { - RSSI_Min = pDM_Odm->pODM_StaInfo[i]->RSSI_Ave; - } - } - } - - pDM_Odm->RSSI_Min = RSSI_Min; - -} - -VOID -odm_IsLinked( - IN PDM_ODM_T pDM_Odm - ) -{ - u4Byte i; - BOOLEAN Linked = FALSE; - - for(i=0; ipODM_StaInfo[i]) ) - { - Linked = TRUE; - break; - } - - } - - pDM_Odm->bLinked = Linked; -} -*/ - - -//3============================================================ -//3 DIG -//3============================================================ -/*----------------------------------------------------------------------------- - * Function: odm_DIGInit() - * - * Overview: Set DIG scheme init value. - * - * Input: NONE - * - * Output: NONE - * - * Return: NONE - * - * Revised History: - * When Who Remark - * - *---------------------------------------------------------------------------*/ -VOID -ODM_ChangeDynamicInitGainThresh( - IN PDM_ODM_T pDM_Odm, - IN u4Byte DM_Type, - IN u4Byte DM_Value - ) -{ - pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable; - - if (DM_Type == DIG_TYPE_THRESH_HIGH) - { - pDM_DigTable->RssiHighThresh = DM_Value; - } - else if (DM_Type == DIG_TYPE_THRESH_LOW) - { - pDM_DigTable->RssiLowThresh = DM_Value; - } - else if (DM_Type == DIG_TYPE_ENABLE) - { - pDM_DigTable->Dig_Enable_Flag = TRUE; - } - else if (DM_Type == DIG_TYPE_DISABLE) - { - pDM_DigTable->Dig_Enable_Flag = FALSE; - } - else if (DM_Type == DIG_TYPE_BACKOFF) - { - if(DM_Value > 30) - DM_Value = 30; - pDM_DigTable->BackoffVal = (u1Byte)DM_Value; - } - else if(DM_Type == DIG_TYPE_RX_GAIN_MIN) - { - if(DM_Value == 0) - DM_Value = 0x1; - pDM_DigTable->rx_gain_range_min = (u1Byte)DM_Value; - } - else if(DM_Type == DIG_TYPE_RX_GAIN_MAX) - { - if(DM_Value > 0x50) - DM_Value = 0x50; - pDM_DigTable->rx_gain_range_max = (u1Byte)DM_Value; - } -} /* DM_ChangeDynamicInitGainThresh */ - -int getIGIForDiff(int value_IGI) -{ - #define ONERCCA_LOW_TH 0x30 - #define ONERCCA_LOW_DIFF 8 - - if (value_IGI < ONERCCA_LOW_TH) { - if ((ONERCCA_LOW_TH - value_IGI) < ONERCCA_LOW_DIFF) - return ONERCCA_LOW_TH; - else - return value_IGI + ONERCCA_LOW_DIFF; - } else { - return value_IGI; - } -} - - -VOID -odm_AdaptivityInit( -IN PDM_ODM_T pDM_Odm -) -{ - if(pDM_Odm->SupportICType == ODM_RTL8723B) - { - pDM_Odm->TH_L2H_ini = 0xf8; // -8 - } - if((pDM_Odm->SupportICType == ODM_RTL8192E)&&(pDM_Odm->SupportInterface == ODM_ITRF_PCIE)) - { - pDM_Odm->TH_L2H_ini = 0xf0; // -16 - } - else - { - pDM_Odm->TH_L2H_ini = 0xf9; // -7 - } - - pDM_Odm->TH_EDCCA_HL_diff = 7; - pDM_Odm->IGI_Base = 0x32; - pDM_Odm->IGI_target = 0x1c; - pDM_Odm->ForceEDCCA = 0; - pDM_Odm->AdapEn_RSSI = 20; - - //Reg524[11]=0 is easily to transmit packets during adaptivity test - - //ODM_SetBBReg(pDM_Odm, 0x524, BIT11, 1);// stop counting if EDCCA is asserted -} - -// Add by Neil Chen to enable edcca to MP Platform -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - -VOID -odm_EnableEDCCA( - IN PDM_ODM_T pDM_Odm -) -{ - - // This should be moved out of OUTSRC - PADAPTER pAdapter = pDM_Odm->Adapter; - // Enable EDCCA. The value is suggested by SD3 Wilson. - - // - // Revised for ASUS 11b/g performance issues, suggested by BB Neil, 2012.04.13. - // - if((pDM_Odm->SupportICType == ODM_RTL8723A)&&(IS_WIRELESS_MODE_G(pAdapter))) - { - //PlatformEFIOWrite1Byte(Adapter, rOFDM0_ECCAThreshold, 0x00); - ODM_Write1Byte(pDM_Odm,rOFDM0_ECCAThreshold,0x00); - ODM_Write1Byte(pDM_Odm,rOFDM0_ECCAThreshold+2,0xFD); - - } - else - { - //PlatformEFIOWrite1Byte(Adapter, rOFDM0_ECCAThreshold, 0x03); - ODM_Write1Byte(pDM_Odm,rOFDM0_ECCAThreshold,0x03); - ODM_Write1Byte(pDM_Odm,rOFDM0_ECCAThreshold+2,0x00); - } - - //PlatformEFIOWrite1Byte(Adapter, rOFDM0_ECCAThreshold+2, 0x00); -} - -VOID -odm_DisableEDCCA( - IN PDM_ODM_T pDM_Odm -) -{ - // Disable EDCCA.. - ODM_Write1Byte(pDM_Odm, rOFDM0_ECCAThreshold, 0x7f); - ODM_Write1Byte(pDM_Odm, rOFDM0_ECCAThreshold+2, 0x7f); -} - -// -// Description: According to initial gain value to determine to enable or disable EDCCA. -// -// Suggested by SD3 Wilson. Added by tynli. 2011.11.25. -// -VOID -odm_DynamicEDCCA( - IN PDM_ODM_T pDM_Odm -) -{ - PADAPTER pAdapter = pDM_Odm->Adapter; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); - u1Byte RegC50, RegC58; - BOOLEAN bFwCurrentInPSMode=FALSE; - - pAdapter->HalFunc.GetHwRegHandler(pAdapter, HW_VAR_FW_PSMODE_STATUS, (pu1Byte)(&bFwCurrentInPSMode)); - - // Disable EDCCA mode while under LPS mode, added by Roger, 2012.09.14. - if(bFwCurrentInPSMode) - return; - - RegC50 = (u1Byte)ODM_GetBBReg(pDM_Odm, rOFDM0_XAAGCCore1, bMaskByte0); - RegC58 = (u1Byte)ODM_GetBBReg(pDM_Odm, rOFDM0_XBAGCCore1, bMaskByte0); - - - if((RegC50 > 0x28 && RegC58 > 0x28) || - ((pDM_Odm->SupportICType == ODM_RTL8723A && IS_WIRELESS_MODE_G(pAdapter) && RegC50>0x26)) || - (pDM_Odm->SupportICType == ODM_RTL8188E && RegC50 > 0x28)) - { - if(!pHalData->bPreEdccaEnable) - { - odm_EnableEDCCA(pDM_Odm); - pHalData->bPreEdccaEnable = TRUE; - } - - } - else if((RegC50 < 0x25 && RegC58 < 0x25) || (pDM_Odm->SupportICType == ODM_RTL8188E && RegC50 < 0x25)) - { - if(pHalData->bPreEdccaEnable) - { - odm_DisableEDCCA(pDM_Odm); - pHalData->bPreEdccaEnable = FALSE; - } - } -} - - -#endif // end MP platform support - -VOID -odm_Adaptivity( - IN PDM_ODM_T pDM_Odm, - IN u1Byte IGI -) -{ - s1Byte TH_L2H_dmc, TH_H2L_dmc; - s1Byte Diff, IGI_target; - BOOLEAN EDCCA_State = 0; - -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - PADAPTER pAdapter = pDM_Odm->Adapter; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); - BOOLEAN bFwCurrentInPSMode=FALSE; - PMGNT_INFO pMgntInfo = &(pAdapter->MgntInfo); - - pAdapter->HalFunc.GetHwRegHandler(pAdapter, HW_VAR_FW_PSMODE_STATUS, (pu1Byte)(&bFwCurrentInPSMode)); - - // Disable EDCCA mode while under LPS mode, added by Roger, 2012.09.14. - if(bFwCurrentInPSMode) - return; -#endif - - if(!(pDM_Odm->SupportAbility & ODM_BB_ADAPTIVITY)) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("Go to odm_DynamicEDCCA() \n")); - // Add by Neil Chen to enable edcca to MP Platform -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - // Adjust EDCCA. - if(pDM_Odm->SupportICType & ODM_IC_11N_SERIES) - odm_DynamicEDCCA(pDM_Odm); -#endif - return; - } - ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_Adaptivity() =====> \n")); - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("ForceEDCCA=%d, IGI_Base=0x%x, TH_L2H_ini = %d, TH_EDCCA_HL_diff = %d, AdapEn_RSSI = %d\n", - pDM_Odm->ForceEDCCA, pDM_Odm->IGI_Base, pDM_Odm->TH_L2H_ini, pDM_Odm->TH_EDCCA_HL_diff, pDM_Odm->AdapEn_RSSI)); - - if(pDM_Odm->SupportICType & ODM_IC_11AC_SERIES) - ODM_SetBBReg(pDM_Odm, 0x800, BIT10, 0); //ADC_mask enable - - if((!pDM_Odm->bLinked)||(*pDM_Odm->pChannel > 149)) // Band4 doesn't need adaptivity - { - if(pDM_Odm->SupportICType & ODM_IC_11N_SERIES) - { - ODM_SetBBReg(pDM_Odm,rOFDM0_ECCAThreshold, bMaskByte0, 0x7f); - ODM_SetBBReg(pDM_Odm,rOFDM0_ECCAThreshold, bMaskByte2, 0x7f); - } - else - ODM_SetBBReg(pDM_Odm, rFPGA0_XB_LSSIReadBack, 0xFFFF, (0x7f<<8) | 0x7f); - return; - } - -#if (DM_ODM_SUPPORT_TYPE==ODM_WIN) - if(pMgntInfo->IOTPeer == HT_IOT_PEER_BROADCOM) - ODM_Write1Byte(pDM_Odm, REG_TRX_SIFS_OFDM, 0x0a); - else - ODM_Write1Byte(pDM_Odm, REG_TRX_SIFS_OFDM, 0x0e); -#endif - if(!pDM_Odm->ForceEDCCA) - { - if(pDM_Odm->RSSI_Min > pDM_Odm->AdapEn_RSSI) - EDCCA_State = 1; - else if(pDM_Odm->RSSI_Min < (pDM_Odm->AdapEn_RSSI - 5)) - EDCCA_State = 0; - } - else - EDCCA_State = 1; - //if((pDM_Odm->SupportICType & ODM_IC_11AC_SERIES) && (*pDM_Odm->pBandType == BAND_ON_5G)) - //IGI_target = pDM_Odm->IGI_Base; - //else - { - - if(*pDM_Odm->pBandWidth == ODM_BW20M) //CHANNEL_WIDTH_20 - IGI_target = pDM_Odm->IGI_Base; - else if(*pDM_Odm->pBandWidth == ODM_BW40M) - IGI_target = pDM_Odm->IGI_Base + 2; - else if(*pDM_Odm->pBandWidth == ODM_BW80M) - IGI_target = pDM_Odm->IGI_Base + 6; - else - IGI_target = pDM_Odm->IGI_Base; - } - - pDM_Odm->IGI_target = (u1Byte) IGI_target; - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("BandWidth=%s, IGI_target=0x%x, EDCCA_State=%d\n", - (*pDM_Odm->pBandWidth==ODM_BW80M)?"80M":((*pDM_Odm->pBandWidth==ODM_BW40M)?"40M":"20M"), IGI_target, EDCCA_State)); - - if(EDCCA_State == 1) - { - Diff = IGI_target -(s1Byte)IGI; - TH_L2H_dmc = pDM_Odm->TH_L2H_ini + Diff; - if(TH_L2H_dmc > 10) TH_L2H_dmc = 10; - TH_H2L_dmc = TH_L2H_dmc - pDM_Odm->TH_EDCCA_HL_diff; - } - else - { - TH_L2H_dmc = 0x7f; - TH_H2L_dmc = 0x7f; - } - ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("IGI=0x%x, TH_L2H_dmc = %d, TH_H2L_dmc = %d\n", - IGI, TH_L2H_dmc, TH_H2L_dmc)); - - if(pDM_Odm->SupportICType & ODM_IC_11N_SERIES) - { - ODM_SetBBReg(pDM_Odm,rOFDM0_ECCAThreshold, bMaskByte0, (u1Byte)TH_L2H_dmc); - ODM_SetBBReg(pDM_Odm,rOFDM0_ECCAThreshold, bMaskByte2, (u1Byte)TH_H2L_dmc); - } - else - ODM_SetBBReg(pDM_Odm, rFPGA0_XB_LSSIReadBack, 0xFFFF, ((u1Byte)TH_H2L_dmc<<8) | (u1Byte)TH_L2H_dmc); -} - -VOID -ODM_DynamicATCSwitch_init( - IN PDM_ODM_T pDM_Odm -) -{ - PADAPTER Adapter = pDM_Odm->Adapter; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN ) - - pDM_Odm->CrystalCap = pHalData->CrystalCap; - pDM_Odm->bATCStatus = (u1Byte)ODM_GetBBReg(pDM_Odm, rOFDM1_CFOTracking, BIT11); - pDM_Odm->CFOThreshold = CFO_Threshold_Xtal; - -#endif -} - -VOID -ODM_DynamicATCSwitch( - IN PDM_ODM_T pDM_Odm -) -{ - PADAPTER Adapter = pDM_Odm->Adapter; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - u1Byte CrystalCap,ATC_status_temp = 0; - u4Byte packet_count; - int CFO_kHz_A,CFO_kHz_B,CFO_ave = 0, Adjust_Xtal = 0; - int CFO_ave_diff; - -#if (MP_DRIVER == 1) - if ( *(pDM_Odm->mp_mode) == 1) - pDM_Odm->bLinked = TRUE; -#endif - -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN ) - - if(!(pDM_Odm->SupportAbility & ODM_BB_DYNAMIC_ATC)) - return; - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DYNAMIC_ATC, ODM_DBG_LOUD, ("=========> ODM_DynamicATCSwitch()\n")); - - //2 No link! - // - if(!pDM_Odm->bLinked) - { - //3 - //3 1.Enable ATC - if(pDM_Odm->bATCStatus == ATC_Status_Off) - { - if(pDM_Odm->SupportICType & ODM_IC_11N_SERIES) - ODM_SetBBReg(pDM_Odm, rOFDM1_CFOTracking, BIT11, ATC_Status_On); - - if(pDM_Odm->SupportICType & ODM_IC_11AC_SERIES) - ODM_SetBBReg(pDM_Odm, rFc_area_Jaguar, BIT14, ATC_Status_On); - - pDM_Odm->bATCStatus = ATC_Status_On; - } - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DYNAMIC_ATC, ODM_DBG_LOUD, ("ODM_DynamicATCSwitch(): No link!!\n")); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DYNAMIC_ATC, ODM_DBG_LOUD, ("ODM_DynamicATCSwitch(): ATCStatus = %d\n", pDM_Odm->bATCStatus)); - - //3 2.Disable CFO tracking for BT - if(!pDM_Odm->bBtDisabled) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DYNAMIC_ATC, ODM_DBG_LOUD, ("ODM_DynamicATCSwitch(): Disable CFO tracking for BT!!\n")); - return; - } - - //3 3.Reset Crystal Cap. - if(pDM_Odm->CrystalCap != pHalData->CrystalCap) - { - pDM_Odm->CrystalCap = pHalData->CrystalCap; - CrystalCap = pDM_Odm->CrystalCap & 0x3f; - odm_Write_CrystalCap(pDM_Odm,CrystalCap); - } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DYNAMIC_ATC, ODM_DBG_LOUD, ("ODM_DynamicATCSwitch(): CrystalCap = 0x%x\n", pDM_Odm->CrystalCap)); - - } - else - { - - //2 Initialization - // - //3 1. Calculate CFO for path-A & path-B - CFO_kHz_A = (int)(pDM_Odm->CFO_tail[0] * 3125) / 1280; - CFO_kHz_B = (int)(pDM_Odm->CFO_tail[1] * 3125) / 1280; - packet_count = pDM_Odm->packetCount; - - //3 2.No new packet - if(packet_count == pDM_Odm->packetCount_pre) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DYNAMIC_ATC, ODM_DBG_LOUD, ("ODM_DynamicATCSwitch(): packet counter doesn't change\n")); - return; - } - pDM_Odm->packetCount_pre = packet_count; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DYNAMIC_ATC, ODM_DBG_LOUD, ("ODM_DynamicATCSwitch(): packet counter = %d\n", pDM_Odm->packetCount)); - - //3 3.Average CFO - if(pDM_Odm->RFType == ODM_1T1R) - CFO_ave = CFO_kHz_A; - else - CFO_ave = (int)(CFO_kHz_A + CFO_kHz_B) >> 1; - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DYNAMIC_ATC, ODM_DBG_LOUD, ("ODM_DynamicATCSwitch(): CFO_kHz_A = %dkHz, CFO_kHz_B = %dkHz, CFO_ave = %dkHz\n", - CFO_kHz_A, CFO_kHz_B, CFO_ave)); - - //3 4.Avoid abnormal large CFO - CFO_ave_diff = (pDM_Odm->CFO_ave_pre >= CFO_ave)?(pDM_Odm->CFO_ave_pre - CFO_ave):(CFO_ave - pDM_Odm->CFO_ave_pre); - if(CFO_ave_diff > 20 && pDM_Odm->largeCFOHit == 0) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DYNAMIC_ATC, ODM_DBG_LOUD, ("ODM_DynamicATCSwitch(): first large CFO hit\n")); - pDM_Odm->largeCFOHit = 1; - return; - } - else - pDM_Odm->largeCFOHit = 0; - pDM_Odm->CFO_ave_pre = CFO_ave; - - //2 CFO tracking by adjusting Xtal cap. - // - if (pDM_Odm->bBtDisabled) - { - //3 1.Dynamic Xtal threshold - if(CFO_ave >= -pDM_Odm->CFOThreshold && CFO_ave <= pDM_Odm->CFOThreshold && pDM_Odm->bIsfreeze == 0) - { - if (pDM_Odm->CFOThreshold == CFO_Threshold_Xtal) - { - pDM_Odm->CFOThreshold = CFO_Threshold_Xtal + 10; - pDM_Odm->bIsfreeze = 1; - } - else - pDM_Odm->CFOThreshold = CFO_Threshold_Xtal; - } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DYNAMIC_ATC, ODM_DBG_LOUD, ("ODM_DynamicATCSwitch(): Dynamic threshold = %d\n", pDM_Odm->CFOThreshold)); - - //3 2.Calculate Xtal offset - if(CFO_ave > pDM_Odm->CFOThreshold && pDM_Odm->CrystalCap < 0x3f) - Adjust_Xtal = ((CFO_ave - CFO_Threshold_Xtal) >> 2) + 1; - else if(CFO_ave < (-pDM_Odm->CFOThreshold) && pDM_Odm->CrystalCap > 0) - Adjust_Xtal = ((CFO_ave + CFO_Threshold_Xtal) >> 2) - 1; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DYNAMIC_ATC, ODM_DBG_LOUD, ("ODM_DynamicATCSwitch(): Crystal cap = 0x%x, Crystal cap offset = %d\n", pDM_Odm->CrystalCap, Adjust_Xtal)); - - //3 3.Adjudt Crystal Cap. - if(Adjust_Xtal != 0) - { - pDM_Odm->bIsfreeze = 0; - pDM_Odm->CrystalCap = pDM_Odm->CrystalCap + Adjust_Xtal; - - if(pDM_Odm->CrystalCap > 0x3f) - pDM_Odm->CrystalCap = 0x3f; - else if (pDM_Odm->CrystalCap < 0) - pDM_Odm->CrystalCap = 0; - - CrystalCap = pDM_Odm->CrystalCap & 0x3f; - odm_Write_CrystalCap(pDM_Odm,CrystalCap); - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DYNAMIC_ATC, ODM_DBG_LOUD, ("ODM_DynamicATCSwitch(): New crystal cap = 0x%x \n", pDM_Odm->CrystalCap)); - } - } - else if(pDM_Odm->CrystalCap != pHalData->CrystalCap) - { - //3 Reset Xtal Cap when BT is enable - pDM_Odm->CrystalCap = pHalData->CrystalCap; - CrystalCap = pDM_Odm->CrystalCap & 0x3f; - odm_Write_CrystalCap(pDM_Odm,CrystalCap); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DYNAMIC_ATC, ODM_DBG_LOUD, ("ODM_DynamicATCSwitch(): Disable CFO tracking for BT!! (CrystalCap is reset)\n")); - } - else - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DYNAMIC_ATC, ODM_DBG_LOUD, ("ODM_DynamicATCSwitch(): Disable CFO tracking for BT!! (CrystalCap is unchanged)\n")); - if(pDM_Odm->SupportICType & ODM_IC_11N_SERIES){ - //2 Dynamic ATC switch - // - //3 1.Enable ATC when CFO is larger then 80kHz - if(CFO_ave < CFO_Threshold_ATC && CFO_ave > -CFO_Threshold_ATC) - { - if(pDM_Odm->bATCStatus == ATC_Status_On) - { - ODM_SetBBReg(pDM_Odm, rOFDM1_CFOTracking, BIT11, ATC_Status_Off); - pDM_Odm->bATCStatus = ATC_Status_Off; - } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DYNAMIC_ATC, ODM_DBG_LOUD, ("ODM_DynamicATCSwitch(): Disable ATC!!\n")); - } - else - { - if(pDM_Odm->bATCStatus == ATC_Status_Off) - { - ODM_SetBBReg(pDM_Odm, rOFDM1_CFOTracking, BIT11, ATC_Status_On); - pDM_Odm->bATCStatus = ATC_Status_On; - } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DYNAMIC_ATC, ODM_DBG_LOUD, ("ODM_DynamicATCSwitch(): Enable ATC!!\n")); - } - } - } -#endif -} - -VOID -odm_Write_CrystalCap( - IN PDM_ODM_T pDM_Odm, - IN u1Byte CrystalCap -) -{ - PADAPTER Adapter = pDM_Odm->Adapter; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - - if(IS_HARDWARE_TYPE_8192D(Adapter)) - { - PHY_SetBBReg(Adapter, 0x24, 0xF0, CrystalCap & 0x0F); - PHY_SetBBReg(Adapter, 0x28, 0xF0000000, ((CrystalCap & 0xF0) >> 4)); - } - - if(IS_HARDWARE_TYPE_8188E(Adapter)) - { - // write 0x24[16:11] = 0x24[22:17] = CrystalCap - PHY_SetBBReg(Adapter, REG_AFE_XTAL_CTRL, 0x7ff800, (CrystalCap | (CrystalCap << 6))); - } - - if(IS_HARDWARE_TYPE_8812(Adapter)) - { - // write 0x2C[30:25] = 0x2C[24:19] = CrystalCap - CrystalCap = CrystalCap & 0x3F; - PHY_SetBBReg(Adapter, REG_MAC_PHY_CTRL, 0x7FF80000, (CrystalCap | (CrystalCap << 6))); - } - - //only for B-cut - if ((IS_HARDWARE_TYPE_8723A(Adapter) && pHalData->EEPROMVersion >= 0x01) || - IS_HARDWARE_TYPE_8723B(Adapter) ||IS_HARDWARE_TYPE_8192E(Adapter) || IS_HARDWARE_TYPE_8821(Adapter)) - { - // 0x2C[23:18] = 0x2C[17:12] = CrystalCap - CrystalCap = CrystalCap & 0x3F; - PHY_SetBBReg(Adapter, REG_MAC_PHY_CTRL, 0xFFF000, (CrystalCap | (CrystalCap << 6))); - } - - if(IS_HARDWARE_TYPE_8723AE(Adapter)) - PHY_SetBBReg(Adapter, REG_LDOA15_CTRL, bMaskDWord, 0x01572505); - -} - - -VOID -ODM_Write_DIG( - IN PDM_ODM_T pDM_Odm, - IN u1Byte CurrentIGI - ) -{ - pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable; - - if(pDM_Odm->StopDIG) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("Stop Writing IGI\n")); - return; - } - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("ODM_REG(IGI_A,pDM_Odm)=0x%x, ODM_BIT(IGI,pDM_Odm)=0x%x \n", - ODM_REG(IGI_A,pDM_Odm),ODM_BIT(IGI,pDM_Odm))); - - if(pDM_DigTable->CurIGValue != CurrentIGI)//if(pDM_DigTable->PreIGValue != CurrentIGI) - { - if(pDM_Odm->SupportPlatform & (ODM_CE|ODM_WIN)) - { - ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_A,pDM_Odm), ODM_BIT(IGI,pDM_Odm), CurrentIGI); - if(pDM_Odm->RFType != ODM_1T1R) - ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_B,pDM_Odm), ODM_BIT(IGI,pDM_Odm), CurrentIGI); - } - else if(pDM_Odm->SupportPlatform & (ODM_AP|ODM_ADSL)) - { - switch(*(pDM_Odm->pOnePathCCA)) - { - case ODM_CCA_2R: - ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_A,pDM_Odm), ODM_BIT(IGI,pDM_Odm), CurrentIGI); - if(pDM_Odm->RFType != ODM_1T1R) - ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_B,pDM_Odm), ODM_BIT(IGI,pDM_Odm), CurrentIGI); - break; - case ODM_CCA_1R_A: - ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_A,pDM_Odm), ODM_BIT(IGI,pDM_Odm), CurrentIGI); - if(pDM_Odm->RFType != ODM_1T1R) - ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_B,pDM_Odm), ODM_BIT(IGI,pDM_Odm), getIGIForDiff(CurrentIGI)); - break; - case ODM_CCA_1R_B: - ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_A,pDM_Odm), ODM_BIT(IGI,pDM_Odm), getIGIForDiff(CurrentIGI)); - if(pDM_Odm->RFType != ODM_1T1R) - ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_B,pDM_Odm), ODM_BIT(IGI,pDM_Odm), CurrentIGI); - break; - } - } - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("CurrentIGI(0x%02x). \n",CurrentIGI)); - //pDM_DigTable->PreIGValue = pDM_DigTable->CurIGValue; - pDM_DigTable->CurIGValue = CurrentIGI; - } - ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("ODM_Write_DIG():CurrentIGI=0x%x \n",CurrentIGI)); - -} - -VOID -odm_DIGbyRSSI_LPS( - IN PDM_ODM_T pDM_Odm - ) -{ - //PADAPTER pAdapter =pDM_Odm->Adapter; - //pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable; - PFALSE_ALARM_STATISTICS pFalseAlmCnt = &pDM_Odm->FalseAlmCnt; - -#if 0 //and 2.3.5 coding rule - struct mlme_priv *pmlmepriv = &(pAdapter->mlmepriv); - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); - struct dm_priv *pdmpriv = &pHalData->dmpriv; -#endif - - u1Byte RSSI_Lower=DM_DIG_MIN_NIC; //0x1E or 0x1C - u1Byte CurrentIGI=pDM_Odm->RSSI_Min; - - CurrentIGI=CurrentIGI+RSSI_OFFSET_DIG; - - - //ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG_LPS, ODM_DBG_LOUD, ("odm_DIG()==>\n")); - - // Using FW PS mode to make IGI - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("---Neil---odm_DIG is in LPS mode\n")); - //Adjust by FA in LPS MODE - if(pFalseAlmCnt->Cnt_all> DM_DIG_FA_TH2_LPS) - CurrentIGI = CurrentIGI+2; - else if (pFalseAlmCnt->Cnt_all > DM_DIG_FA_TH1_LPS) - CurrentIGI = CurrentIGI+1; - else if(pFalseAlmCnt->Cnt_all < DM_DIG_FA_TH0_LPS) - CurrentIGI = CurrentIGI-1; - - - //Lower bound checking - - //RSSI Lower bound check - if((pDM_Odm->RSSI_Min-10) > DM_DIG_MIN_NIC) - RSSI_Lower =(pDM_Odm->RSSI_Min-10); - else - RSSI_Lower =DM_DIG_MIN_NIC; - - //Upper and Lower Bound checking - if(CurrentIGI > DM_DIG_MAX_NIC) - CurrentIGI=DM_DIG_MAX_NIC; - else if(CurrentIGI < RSSI_Lower) - CurrentIGI =RSSI_Lower; - - ODM_Write_DIG(pDM_Odm, CurrentIGI);//ODM_Write_DIG(pDM_Odm, pDM_DigTable->CurIGValue); - -} - -VOID -odm_DIGInit( - IN PDM_ODM_T pDM_Odm - ) -{ - pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable; - - //pDM_DigTable->Dig_Enable_Flag = TRUE; - //pDM_DigTable->Dig_Ext_Port_Stage = DIG_EXT_PORT_STAGE_MAX; - pDM_DigTable->CurIGValue = (u1Byte) ODM_GetBBReg(pDM_Odm, ODM_REG(IGI_A,pDM_Odm), ODM_BIT(IGI,pDM_Odm)); - //pDM_DigTable->PreIGValue = 0x0; - //pDM_DigTable->CurSTAConnectState = pDM_DigTable->PreSTAConnectState = DIG_STA_DISCONNECT; - //pDM_DigTable->CurMultiSTAConnectState = DIG_MultiSTA_DISCONNECT; - pDM_DigTable->RssiLowThresh = DM_DIG_THRESH_LOW; - pDM_DigTable->RssiHighThresh = DM_DIG_THRESH_HIGH; - pDM_DigTable->FALowThresh = DM_FALSEALARM_THRESH_LOW; - pDM_DigTable->FAHighThresh = DM_FALSEALARM_THRESH_HIGH; - if(pDM_Odm->BoardType & (ODM_BOARD_EXT_PA|ODM_BOARD_EXT_LNA)) - { - pDM_DigTable->rx_gain_range_max = DM_DIG_MAX_NIC; - pDM_DigTable->rx_gain_range_min = DM_DIG_MIN_NIC; - } - else - { - pDM_DigTable->rx_gain_range_max = DM_DIG_MAX_NIC; - pDM_DigTable->rx_gain_range_min = DM_DIG_MIN_NIC; - } - pDM_DigTable->BackoffVal = DM_DIG_BACKOFF_DEFAULT; - pDM_DigTable->BackoffVal_range_max = DM_DIG_BACKOFF_MAX; - pDM_DigTable->BackoffVal_range_min = DM_DIG_BACKOFF_MIN; - pDM_DigTable->PreCCK_CCAThres = 0xFF; - pDM_DigTable->CurCCK_CCAThres = 0x83; - pDM_DigTable->ForbiddenIGI = DM_DIG_MIN_NIC; - pDM_DigTable->LargeFAHit = 0; - pDM_DigTable->Recover_cnt = 0; - pDM_DigTable->DIG_Dynamic_MIN_0 = DM_DIG_MIN_NIC; - pDM_DigTable->DIG_Dynamic_MIN_1 = DM_DIG_MIN_NIC; - pDM_DigTable->bMediaConnect_0 = FALSE; - pDM_DigTable->bMediaConnect_1 = FALSE; - - //To Initialize pDM_Odm->bDMInitialGainEnable == FALSE to avoid DIG error - pDM_Odm->bDMInitialGainEnable = TRUE; - - //To Initi BT30 IGI - pDM_DigTable->BT30_CurIGI=0x32; - -} - -VOID -odm_DigForBtHsMode( - IN PDM_ODM_T pDM_Odm - ) -{ -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - pDIG_T pDM_DigTable=&pDM_Odm->DM_DigTable; - u1Byte digForBtHs=0; - u1Byte digUpBound=0x5a; - - if(pDM_Odm->bBtConnectProcess) - { - if(pDM_Odm->SupportICType&(ODM_RTL8723A)) - digForBtHs = 0x28; - else - digForBtHs = 0x22; - } - else - { - // - // Decide DIG value by BT HS RSSI. - // - digForBtHs = pDM_Odm->btHsRssi+4; - - //DIG Bound - if(pDM_Odm->SupportICType&(ODM_RTL8723A)) - digUpBound = 0x3e; - - if(digForBtHs > digUpBound) - digForBtHs = digUpBound; - if(digForBtHs < 0x1c) - digForBtHs = 0x1c; - - // update Current IGI - pDM_DigTable->BT30_CurIGI = digForBtHs; - } - ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DigForBtHsMode() : set DigValue=0x%x\n", digForBtHs)); -#endif -} - -VOID -odm_DIG( - IN PDM_ODM_T pDM_Odm - ) -{ - pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable; - PFALSE_ALARM_STATISTICS pFalseAlmCnt = &pDM_Odm->FalseAlmCnt; - pRXHP_T pRX_HP_Table = &pDM_Odm->DM_RXHP_Table; - u1Byte DIG_Dynamic_MIN; - u1Byte DIG_MaxOfMin; - BOOLEAN FirstConnect, FirstDisConnect; - u1Byte dm_dig_max, dm_dig_min, offset; - u1Byte CurrentIGI = pDM_DigTable->CurIGValue; - u1Byte Adap_IGI_Upper = pDM_Odm->IGI_target + 30 + (u1Byte) pDM_Odm->TH_L2H_ini -(u1Byte) pDM_Odm->TH_EDCCA_HL_diff; - -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) -// This should be moved out of OUTSRC - PADAPTER pAdapter = pDM_Odm->Adapter; -#if OS_WIN_FROM_WIN7(OS_VERSION) - if(IsAPModeExist( pAdapter) && pAdapter->bInHctTest) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG() Return: Is AP mode or In HCT Test \n")); - return; - } -#endif -/* - if (pDM_Odm->SupportICType==ODM_RTL8723B) - return; -*/ - - if(pDM_Odm->bBtHsOperation) - { - odm_DigForBtHsMode(pDM_Odm); - } - - if(!(pDM_Odm->SupportICType &(ODM_RTL8723A|ODM_RTL8188E))) - { - if(pRX_HP_Table->RXHP_flag == 1) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG() Return: In RXHP Operation \n")); - return; - } - } -#endif -#if (DM_ODM_SUPPORT_TYPE == ODM_CE) -#ifdef CONFIG_SPECIAL_SETTING_FOR_FUNAI_TV - if((pDM_Odm->bLinked) && (pDM_Odm->Adapter->registrypriv.force_igi !=0)) - { - printk("pDM_Odm->RSSI_Min=%d \n",pDM_Odm->RSSI_Min); - ODM_Write_DIG(pDM_Odm,pDM_Odm->Adapter->registrypriv.force_igi); - return; - } -#endif -#endif -#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) - prtl8192cd_priv priv = pDM_Odm->priv; - if (!((priv->up_time > 5) && (priv->up_time % 2)) ) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG() Return: Not In DIG Operation Period \n")); - return; - } -#endif - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG()==>\n")); - //if(!(pDM_Odm->SupportAbility & (ODM_BB_DIG|ODM_BB_FA_CNT))) - if((!(pDM_Odm->SupportAbility&ODM_BB_DIG)) ||(!(pDM_Odm->SupportAbility&ODM_BB_FA_CNT))) - { -#if 0 - if(pDM_Odm->SupportPlatform & (ODM_AP|ODM_ADSL)) - { - if ((pDM_Odm->SupportICType == ODM_RTL8192C) && (pDM_Odm->ExtLNA == 1)) - CurrentIGI = 0x30; //pDM_DigTable->CurIGValue = 0x30; - else - CurrentIGI = 0x20; //pDM_DigTable->CurIGValue = 0x20; - ODM_Write_DIG(pDM_Odm, CurrentIGI);//ODM_Write_DIG(pDM_Odm, pDM_DigTable->CurIGValue); - } -#endif - ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG() Return: SupportAbility ODM_BB_DIG or ODM_BB_FA_CNT is disabled\n")); - return; - } - - if(*(pDM_Odm->pbScanInProcess)) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG() Return: In Scan Progress \n")); - return; - } - - //add by Neil Chen to avoid PSD is processing - if(pDM_Odm->SupportICType==ODM_RTL8723A) - { - if(pDM_Odm->bDMInitialGainEnable == FALSE) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG() Return: PSD is Processing \n")); - return; - } - } - - if(pDM_Odm->SupportICType == ODM_RTL8192D) - { - if(*(pDM_Odm->pMacPhyMode) == ODM_DMSP) - { - if(*(pDM_Odm->pbMasterOfDMSP)) - { - DIG_Dynamic_MIN = pDM_DigTable->DIG_Dynamic_MIN_0; - FirstConnect = (pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_0 == FALSE); - FirstDisConnect = (!pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_0 == TRUE); - } - else - { - DIG_Dynamic_MIN = pDM_DigTable->DIG_Dynamic_MIN_1; - FirstConnect = (pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_1 == FALSE); - FirstDisConnect = (!pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_1 == TRUE); - } - } - else - { - if(*(pDM_Odm->pBandType) == ODM_BAND_5G) - { - DIG_Dynamic_MIN = pDM_DigTable->DIG_Dynamic_MIN_0; - FirstConnect = (pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_0 == FALSE); - FirstDisConnect = (!pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_0 == TRUE); - } - else - { - DIG_Dynamic_MIN = pDM_DigTable->DIG_Dynamic_MIN_1; - FirstConnect = (pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_1 == FALSE); - FirstDisConnect = (!pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_1 == TRUE); - } - } - } - else - { - DIG_Dynamic_MIN = pDM_DigTable->DIG_Dynamic_MIN_0; - FirstConnect = (pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_0 == FALSE); - FirstDisConnect = (!pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_0 == TRUE); - } - - //1 Boundary Decision - if(pDM_Odm->SupportICType & (ODM_RTL8192C) &&(pDM_Odm->BoardType & (ODM_BOARD_EXT_LNA | ODM_BOARD_EXT_PA))) - { - if(pDM_Odm->SupportPlatform & (ODM_AP|ODM_ADSL)) - { - - dm_dig_max = DM_DIG_MAX_AP_HP; - dm_dig_min = DM_DIG_MIN_AP_HP; - } - else - { - dm_dig_max = DM_DIG_MAX_NIC_HP; - dm_dig_min = DM_DIG_MIN_NIC_HP; - } - DIG_MaxOfMin = DM_DIG_MAX_AP_HP; - } - else - { - if(pDM_Odm->SupportPlatform & (ODM_AP|ODM_ADSL)) - { -#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) -#ifdef DFS - if (!priv->pmib->dot11DFSEntry.disable_DFS && - (OPMODE & WIFI_AP_STATE) && - (((pDM_Odm->ControlChannel >= 52) && - (pDM_Odm->ControlChannel <= 64)) || - ((pDM_Odm->ControlChannel >= 100) && - (pDM_Odm->ControlChannel <= 140)))) - dm_dig_max = 0x24; - else -#endif - if (priv->pmib->dot11RFEntry.tx2path) { - if (*(pDM_Odm->pWirelessMode) == ODM_WM_B)//(priv->pmib->dot11BssType.net_work_type == WIRELESS_11B) - dm_dig_max = 0x2A; - else - dm_dig_max = 0x32; - } - else -#endif - dm_dig_max = DM_DIG_MAX_AP; - dm_dig_min = DM_DIG_MIN_AP; - DIG_MaxOfMin = dm_dig_max; - } - else - { - if((pDM_Odm->SupportICType >= ODM_RTL8188E) && (pDM_Odm->SupportPlatform & (ODM_WIN|ODM_CE))) - dm_dig_max = 0x5A; - else - dm_dig_max = DM_DIG_MAX_NIC; - - if(pDM_Odm->SupportICType != ODM_RTL8821) - dm_dig_min = DM_DIG_MIN_NIC; - else - dm_dig_min = 0x1C; - - DIG_MaxOfMin = DM_DIG_MAX_AP; - } - } - - if(0 < *pDM_Odm->pu1ForcedIgiLb) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): force IGI lb to: %u\n", *pDM_Odm->pu1ForcedIgiLb)); - dm_dig_min = *pDM_Odm->pu1ForcedIgiLb; - dm_dig_max = (dm_dig_min <= dm_dig_max) ? (dm_dig_max) : (dm_dig_min + 1); - } - - if(pDM_Odm->bLinked) - { - if(pDM_Odm->SupportICType&(ODM_RTL8723A/*|ODM_RTL8821*/)) - { - //2 Upper Bound - if(( pDM_Odm->RSSI_Min + 10) > DM_DIG_MAX_NIC ) - pDM_DigTable->rx_gain_range_max = DM_DIG_MAX_NIC; - else if(( pDM_Odm->RSSI_Min + 10) < DM_DIG_MIN_NIC ) - pDM_DigTable->rx_gain_range_max = DM_DIG_MIN_NIC; - else - pDM_DigTable->rx_gain_range_max = pDM_Odm->RSSI_Min + 10; - - //BT is Concurrent - - if(pDM_Odm->bBtLimitedDig) - { - if(pDM_Odm->RSSI_Min>10) - { - if((pDM_Odm->RSSI_Min - 10) > DM_DIG_MAX_NIC) - DIG_Dynamic_MIN = DM_DIG_MAX_NIC; - else if((pDM_Odm->RSSI_Min - 10) < DM_DIG_MIN_NIC) - DIG_Dynamic_MIN = DM_DIG_MIN_NIC; - else - DIG_Dynamic_MIN = pDM_Odm->RSSI_Min - 10; - } - else - DIG_Dynamic_MIN=DM_DIG_MIN_NIC; - } - else - { - if((pDM_Odm->RSSI_Min + 20) > dm_dig_max ) - pDM_DigTable->rx_gain_range_max = dm_dig_max; - else if((pDM_Odm->RSSI_Min + 20) < dm_dig_min ) - pDM_DigTable->rx_gain_range_max = dm_dig_min; - else - pDM_DigTable->rx_gain_range_max = pDM_Odm->RSSI_Min + 20; - - } - } - else - { - if((pDM_Odm->SupportICType & (ODM_RTL8192E|ODM_RTL8723B|ODM_RTL8812|ODM_RTL8821)) && (pDM_Odm->bBtLimitedDig==1)){ - //2 Modify DIG upper bound for 92E, 8723B, 8821 & 8812 BT - if((pDM_Odm->RSSI_Min + 10) > dm_dig_max ) - pDM_DigTable->rx_gain_range_max = dm_dig_max; - else if((pDM_Odm->RSSI_Min + 10) < dm_dig_min ) - pDM_DigTable->rx_gain_range_max = dm_dig_min; - else - pDM_DigTable->rx_gain_range_max = pDM_Odm->RSSI_Min + 10; - } - else{ - - //2 Modify DIG upper bound - //2013.03.19 Luke: Modified upper bound for Netgear rental house test - if(pDM_Odm->SupportICType != ODM_RTL8821 && pDM_Odm->SupportICType != ODM_RTL8192E) - offset = 20; - else - offset = 10; - - if((pDM_Odm->RSSI_Min + offset) > dm_dig_max ) - pDM_DigTable->rx_gain_range_max = dm_dig_max; - else if((pDM_Odm->RSSI_Min + offset) < dm_dig_min ) - pDM_DigTable->rx_gain_range_max = dm_dig_min; - else - pDM_DigTable->rx_gain_range_max = pDM_Odm->RSSI_Min + offset; - - } - - //2 Modify DIG lower bound - /* - if((pFalseAlmCnt->Cnt_all > 500)&&(DIG_Dynamic_MIN < 0x25)) - DIG_Dynamic_MIN++; - else if(((pFalseAlmCnt->Cnt_all < 500)||(pDM_Odm->RSSI_Min < 8))&&(DIG_Dynamic_MIN > dm_dig_min)) - DIG_Dynamic_MIN--; - */ - if(pDM_Odm->bOneEntryOnly) - { - if(pDM_Odm->SupportICType != ODM_RTL8723B) - offset = 0; - else - offset = 12; - - if(pDM_Odm->RSSI_Min - offset < dm_dig_min) - DIG_Dynamic_MIN = dm_dig_min; - else if (pDM_Odm->RSSI_Min - offset > DIG_MaxOfMin) - DIG_Dynamic_MIN = DIG_MaxOfMin; - else - DIG_Dynamic_MIN = pDM_Odm->RSSI_Min - offset; - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG() : bOneEntryOnly=TRUE, DIG_Dynamic_MIN=0x%x\n",DIG_Dynamic_MIN)); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG() : pDM_Odm->RSSI_Min=%d",pDM_Odm->RSSI_Min)); - } - //1 Lower Bound for 88E AntDiv -#if (defined(CONFIG_HW_ANTENNA_DIVERSITY)) - else if( (pDM_Odm->SupportICType & ODM_ANTDIV_SUPPORT) &&(pDM_Odm->SupportAbility & ODM_BB_ANT_DIV) ) - //else if((pDM_Odm->SupportICType == ODM_RTL8188E)&&(pDM_Odm->SupportAbility & ODM_BB_ANT_DIV)) - { - if((pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV)||(pDM_Odm->AntDivType == CGCS_RX_HW_ANTDIV) ||pDM_Odm->AntDivType == S0S1_SW_ANTDIV) - { - DIG_Dynamic_MIN = (u1Byte) pDM_DigTable->AntDiv_RSSI_max; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("odm_DIG(): pDM_DigTable->AntDiv_RSSI_max=%d \n",pDM_DigTable->AntDiv_RSSI_max)); - } - } -#endif - else - { - DIG_Dynamic_MIN=dm_dig_min; - } - } - } - else - { - pDM_DigTable->rx_gain_range_max = dm_dig_max; - DIG_Dynamic_MIN = dm_dig_min; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG() : No Link\n")); - } - - //1 Modify DIG lower bound, deal with abnorally large false alarm - if(pFalseAlmCnt->Cnt_all > 10000) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("dm_DIG(): Abnornally false alarm case. \n")); - - if(pDM_DigTable->LargeFAHit != 3) - pDM_DigTable->LargeFAHit++; - if(pDM_DigTable->ForbiddenIGI < CurrentIGI)//if(pDM_DigTable->ForbiddenIGI < pDM_DigTable->CurIGValue) - { - pDM_DigTable->ForbiddenIGI = (u1Byte)CurrentIGI;//pDM_DigTable->ForbiddenIGI = pDM_DigTable->CurIGValue; - pDM_DigTable->LargeFAHit = 1; - } - - if(pDM_DigTable->LargeFAHit >= 3) - { - if((pDM_DigTable->ForbiddenIGI+1) >pDM_DigTable->rx_gain_range_max) - pDM_DigTable->rx_gain_range_min = pDM_DigTable->rx_gain_range_max; - else - pDM_DigTable->rx_gain_range_min = (pDM_DigTable->ForbiddenIGI + 1); - pDM_DigTable->Recover_cnt = 3600; //3600=2hr - } - - } - else - { - //Recovery mechanism for IGI lower bound - if(pDM_DigTable->Recover_cnt != 0) - pDM_DigTable->Recover_cnt --; - else - { - if(pDM_DigTable->LargeFAHit < 3) - { - if((pDM_DigTable->ForbiddenIGI -1) < DIG_Dynamic_MIN) //DM_DIG_MIN) - { - pDM_DigTable->ForbiddenIGI = DIG_Dynamic_MIN; //DM_DIG_MIN; - pDM_DigTable->rx_gain_range_min = DIG_Dynamic_MIN; //DM_DIG_MIN; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Normal Case: At Lower Bound\n")); - } - else - { - pDM_DigTable->ForbiddenIGI --; - pDM_DigTable->rx_gain_range_min = (pDM_DigTable->ForbiddenIGI + 1); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Normal Case: Approach Lower Bound\n")); - } - } - else - { - pDM_DigTable->LargeFAHit = 0; - } - } - } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): pDM_DigTable->LargeFAHit=%d\n",pDM_DigTable->LargeFAHit)); - - #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - if(IS_STA_VALID(pDM_Odm->pODM_StaInfo[0])) //STA mode is linked to AP - pDM_Odm->bsta_state = _TRUE; - #endif - - if((pDM_Odm->SupportPlatform&(ODM_WIN|ODM_CE))&&(pDM_Odm->PhyDbgInfo.NumQryBeaconPkt < 2) && (pDM_Odm->bsta_state) ) - { - pDM_DigTable->rx_gain_range_min = dm_dig_min; - } - - if(pDM_DigTable->rx_gain_range_min > pDM_DigTable->rx_gain_range_max) - pDM_DigTable->rx_gain_range_min = pDM_DigTable->rx_gain_range_max; - - //1 Adjust initial gain by false alarm - if(pDM_Odm->bLinked) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): DIG AfterLink\n")); - if(FirstConnect) - { - if(pDM_Odm->RSSI_Min <= DIG_MaxOfMin) - CurrentIGI = pDM_Odm->RSSI_Min; - else - CurrentIGI = DIG_MaxOfMin; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("DIG: First Connect\n")); - - ODM_ConfigBBWithHeaderFile(pDM_Odm, CONFIG_BB_AGC_TAB_DIFF); - } - else - { - if(pDM_Odm->SupportICType == ODM_RTL8192D) - { - if(pFalseAlmCnt->Cnt_all > DM_DIG_FA_TH2_92D) - CurrentIGI = CurrentIGI + 4;//pDM_DigTable->CurIGValue = pDM_DigTable->PreIGValue+2; - else if (pFalseAlmCnt->Cnt_all > DM_DIG_FA_TH1_92D) - CurrentIGI = CurrentIGI + 2; //pDM_DigTable->CurIGValue = pDM_DigTable->PreIGValue+1; - else if(pFalseAlmCnt->Cnt_all < DM_DIG_FA_TH0_92D) - CurrentIGI = CurrentIGI - 2;//pDM_DigTable->CurIGValue =pDM_DigTable->PreIGValue-1; - } - else - { - //FA for Combo IC--NeilChen--2012--09--28 - if(pDM_Odm->SupportICType == ODM_RTL8723A) - { - //WLAN and BT ConCurrent - if(pDM_Odm->bBtLimitedDig) - { - if(pFalseAlmCnt->Cnt_all > 0x300) - CurrentIGI = CurrentIGI + 4; - else if (pFalseAlmCnt->Cnt_all > 0x250) - CurrentIGI = CurrentIGI + 2; - else if(pFalseAlmCnt->Cnt_all < DM_DIG_FA_TH0) - CurrentIGI = CurrentIGI -2; - } - else //Not Concurrent - { - if(pFalseAlmCnt->Cnt_all > DM_DIG_FA_TH2) - CurrentIGI = CurrentIGI + 4;//pDM_DigTable->CurIGValue = pDM_DigTable->PreIGValue+2; - else if (pFalseAlmCnt->Cnt_all > DM_DIG_FA_TH1) - CurrentIGI = CurrentIGI + 2;//pDM_DigTable->CurIGValue = pDM_DigTable->PreIGValue+1; - else if(pFalseAlmCnt->Cnt_all < DM_DIG_FA_TH0) - CurrentIGI = CurrentIGI - 2;//pDM_DigTable->CurIGValue =pDM_DigTable->PreIGValue-1; - } - } - else - { - if(pFalseAlmCnt->Cnt_all > DM_DIG_FA_TH2) - CurrentIGI = CurrentIGI + 4;//pDM_DigTable->CurIGValue = pDM_DigTable->PreIGValue+2; - else if (pFalseAlmCnt->Cnt_all > DM_DIG_FA_TH1) - CurrentIGI = CurrentIGI + 2;//pDM_DigTable->CurIGValue = pDM_DigTable->PreIGValue+1; - else if(pFalseAlmCnt->Cnt_all < DM_DIG_FA_TH0) - CurrentIGI = CurrentIGI - 2;//pDM_DigTable->CurIGValue =pDM_DigTable->PreIGValue-1; - - #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - if(IS_STA_VALID(pDM_Odm->pODM_StaInfo[0])) //STA mode is linked to AP - pDM_Odm->bsta_state = _TRUE; - #endif - - if((pDM_Odm->SupportPlatform&(ODM_WIN|ODM_CE))&&(pDM_Odm->PhyDbgInfo.NumQryBeaconPkt < 2) - &&(pFalseAlmCnt->Cnt_all < DM_DIG_FA_TH1) && (pDM_Odm->bsta_state)) - { - CurrentIGI = pDM_DigTable->rx_gain_range_min; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Beacon is less than 10 and FA is less than 768, IGI GOES TO 0x1E!!!!!!!!!!!!\n")); - } - /*{ - u2Byte value16; - value16 = (u2Byte) ODM_GetBBReg(pDM_Odm, 0x664, bMaskLWord); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): NumQryBeaconPkt = %d, OFDM_OK_Cnt = %d\n", - pDM_Odm->PhyDbgInfo.NumQryBeaconPkt, value16)); - }*/ - } - } - } - } - else - { - //CurrentIGI = pDM_DigTable->rx_gain_range_min;//pDM_DigTable->CurIGValue = pDM_DigTable->rx_gain_range_min - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): DIG BeforeLink\n")); - if(FirstDisConnect) - { - CurrentIGI = pDM_DigTable->rx_gain_range_min; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): First DisConnect \n")); - } - else - { - //2012.03.30 LukeLee: enable DIG before link but with very high thresholds - if(pFalseAlmCnt->Cnt_all > 10000) - CurrentIGI = CurrentIGI + 4; - else if (pFalseAlmCnt->Cnt_all > 8000) - CurrentIGI = CurrentIGI + 2; - else if(pFalseAlmCnt->Cnt_all < 500) - CurrentIGI = CurrentIGI - 2; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): England DIG \n")); - } - } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): DIG End Adjust IGI\n")); - //1 Check initial gain by upper/lower bound - - if(CurrentIGI > pDM_DigTable->rx_gain_range_max) - CurrentIGI = pDM_DigTable->rx_gain_range_max; - if(CurrentIGI < pDM_DigTable->rx_gain_range_min) - CurrentIGI = pDM_DigTable->rx_gain_range_min; - - if(pDM_Odm->SupportAbility & ODM_BB_ADAPTIVITY) - { - if(CurrentIGI > Adap_IGI_Upper) - CurrentIGI = Adap_IGI_Upper; - - if(pDM_Odm->IGI_LowerBound != 0) - { - if(CurrentIGI < pDM_Odm->IGI_LowerBound) - CurrentIGI = pDM_Odm->IGI_LowerBound; - } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): pDM_Odm->IGI_LowerBound = %d\n", pDM_Odm->IGI_LowerBound)); - } - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): rx_gain_range_max=0x%x, rx_gain_range_min=0x%x\n", - pDM_DigTable->rx_gain_range_max, pDM_DigTable->rx_gain_range_min)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): TotalFA=%d\n", pFalseAlmCnt->Cnt_all)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): CurIGValue=0x%x\n", CurrentIGI)); - - //2 High power RSSI threshold -#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) -{ - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pDM_Odm->Adapter); - //PMGNT_INFO pMgntInfo = &(pAdapter->MgntInfo); - // for LC issue to dymanic modify DIG lower bound----------LC Mocca Issue - u8Byte curTxOkCnt=0, curRxOkCnt=0; - static u8Byte lastTxOkCnt=0, lastRxOkCnt=0; - - //u8Byte OKCntAll=0; - //static u8Byte TXByteCnt_A=0, TXByteCnt_B=0, RXByteCnt_A=0, RXByteCnt_B=0; - //u8Byte CurByteCnt=0, PreByteCnt=0; - - curTxOkCnt = pAdapter->TxStats.NumTxBytesUnicast - lastTxOkCnt; - curRxOkCnt =pAdapter->RxStats.NumRxBytesUnicast - lastRxOkCnt; - lastTxOkCnt = pAdapter->TxStats.NumTxBytesUnicast; - lastRxOkCnt = pAdapter->RxStats.NumRxBytesUnicast; - //----------------------------------------------------------end for LC Mocca issue - if((pDM_Odm->SupportICType == ODM_RTL8723A)&& (pHalData->UndecoratedSmoothedPWDB > DM_DIG_HIGH_PWR_THRESHOLD)) - { - // High power IGI lower bound - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): UndecoratedSmoothedPWDB(%#x)\n", pHalData->UndecoratedSmoothedPWDB)); - if(CurrentIGI < DM_DIG_HIGH_PWR_IGI_LOWER_BOUND) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): CurIGValue(%#x)\n", pDM_DigTable->CurIGValue)); - //pDM_DigTable->CurIGValue = DM_DIG_HIGH_PWR_IGI_LOWER_BOUND; - CurrentIGI=DM_DIG_HIGH_PWR_IGI_LOWER_BOUND; - } - } - if((pDM_Odm->SupportICType & ODM_RTL8723A) && - IS_WIRELESS_MODE_G(pAdapter)) - { - if(pHalData->UndecoratedSmoothedPWDB > 0x28) - { - if(CurrentIGI < DM_DIG_Gmode_HIGH_PWR_IGI_LOWER_BOUND) - { - //pDM_DigTable->CurIGValue = DM_DIG_Gmode_HIGH_PWR_IGI_LOWER_BOUND; - CurrentIGI = DM_DIG_Gmode_HIGH_PWR_IGI_LOWER_BOUND; - } - } - } -#if 0 - if((pDM_Odm->SupportICType & ODM_RTL8723A)&&(pMgntInfo->CustomerID = RT_CID_LENOVO_CHINA)) - { - OKCntAll = (curTxOkCnt+curRxOkCnt); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): CurIGValue(%#x)\n", CurrentIGI)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): UndecoratedSmoothedPWDB(%#x)\n", pHalData->UndecoratedSmoothedPWDB)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): OKCntAll(%#x)\n", OKCntAll)); - //8723AS_VAU - if(pDM_Odm->SupportInterface==ODM_ITRF_USB) - { - if(pHalData->UndecoratedSmoothedPWDB < 12) - { - if(CurrentIGI > DM_DIG_MIN_NIC) - { - if(OKCntAll >= 1500000) // >=6Mbps - CurrentIGI=0x1B; - else if(OKCntAll >= 1000000) //4Mbps - CurrentIGI=0x1A; - else if(OKCntAll >= 500000) //2Mbps - CurrentIGI=0x19; - else if(OKCntAll >= 250000) //1Mbps - CurrentIGI=0x18; - else - { - CurrentIGI=0x17; //SCAN mode - } - } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("Modify---->CurIGValue(%#x)\n", CurrentIGI)); - } - } - } -#endif -} -#endif - -#if (RTL8192D_SUPPORT==1) - if(pDM_Odm->SupportICType == ODM_RTL8192D) - { - //sherry delete DualMacSmartConncurrent 20110517 - if(*(pDM_Odm->pMacPhyMode) == ODM_DMSP) - { - ODM_Write_DIG_DMSP(pDM_Odm, (u1Byte)CurrentIGI);//ODM_Write_DIG_DMSP(pDM_Odm, pDM_DigTable->CurIGValue); - if(*(pDM_Odm->pbMasterOfDMSP)) - { - pDM_DigTable->bMediaConnect_0 = pDM_Odm->bLinked; - pDM_DigTable->DIG_Dynamic_MIN_0 = DIG_Dynamic_MIN; - } - else - { - pDM_DigTable->bMediaConnect_1 = pDM_Odm->bLinked; - pDM_DigTable->DIG_Dynamic_MIN_1 = DIG_Dynamic_MIN; - } - } - else - { - ODM_Write_DIG(pDM_Odm, CurrentIGI);//ODM_Write_DIG(pDM_Odm, pDM_DigTable->CurIGValue); - if(*(pDM_Odm->pBandType) == ODM_BAND_5G) - { - pDM_DigTable->bMediaConnect_0 = pDM_Odm->bLinked; - pDM_DigTable->DIG_Dynamic_MIN_0 = DIG_Dynamic_MIN; - } - else - { - pDM_DigTable->bMediaConnect_1 = pDM_Odm->bLinked; - pDM_DigTable->DIG_Dynamic_MIN_1 = DIG_Dynamic_MIN; - } - } - } - else -#endif - { - if(pDM_Odm->bBtHsOperation) - { - if(pDM_Odm->bLinked) - { - if(pDM_DigTable->BT30_CurIGI > (CurrentIGI)) - { - ODM_Write_DIG(pDM_Odm, CurrentIGI); - - } - else - { - ODM_Write_DIG(pDM_Odm, pDM_DigTable->BT30_CurIGI); - } - pDM_DigTable->bMediaConnect_0 = pDM_Odm->bLinked; - pDM_DigTable->DIG_Dynamic_MIN_0 = DIG_Dynamic_MIN; - } - else - { - if(pDM_Odm->bLinkInProcess) - { - ODM_Write_DIG(pDM_Odm, 0x1c); - } - else if(pDM_Odm->bBtConnectProcess) - { - ODM_Write_DIG(pDM_Odm, 0x28); - } - else - { - ODM_Write_DIG(pDM_Odm, pDM_DigTable->BT30_CurIGI);//ODM_Write_DIG(pDM_Odm, pDM_DigTable->CurIGValue); - } - } - } - else // BT is not using - { - ODM_Write_DIG(pDM_Odm, CurrentIGI);//ODM_Write_DIG(pDM_Odm, pDM_DigTable->CurIGValue); - pDM_DigTable->bMediaConnect_0 = pDM_Odm->bLinked; - pDM_DigTable->DIG_Dynamic_MIN_0 = DIG_Dynamic_MIN; - } - } -} - - -BOOLEAN -odm_DigAbort( - IN PDM_ODM_T pDM_Odm - ) -{ -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) -// This should be moved out of OUTSRC - PADAPTER pAdapter = pDM_Odm->Adapter; - pRXHP_T pRX_HP_Table = &pDM_Odm->DM_RXHP_Table; - -#if OS_WIN_FROM_WIN7(OS_VERSION) - if(IsAPModeExist( pAdapter) && pAdapter->bInHctTest) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG() Return: Is AP mode or In HCT Test \n")); - return TRUE; - } -#endif - - if(pRX_HP_Table->RXHP_flag == 1) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG() Return: In RXHP Operation \n")); - return TRUE; - } - - return FALSE; -#else // For Other team any special case for DIG? - return FALSE; -#endif - - -} - -//3============================================================ -//3 FASLE ALARM CHECK -//3============================================================ - -VOID -odm_FalseAlarmCounterStatistics( - IN PDM_ODM_T pDM_Odm - ) -{ - u4Byte ret_value; - PFALSE_ALARM_STATISTICS FalseAlmCnt = &(pDM_Odm->FalseAlmCnt); - -#if (DM_ODM_SUPPORT_TYPE == ODM_AP) - prtl8192cd_priv priv = pDM_Odm->priv; - if( (priv->auto_channel != 0) && (priv->auto_channel != 2) ) - return; -#endif - -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - if((pDM_Odm->SupportICType == ODM_RTL8192D) && - (*(pDM_Odm->pMacPhyMode)==ODM_DMSP)&& ////modify by Guo.Mingzhi 2011-12-29 - (!(*(pDM_Odm->pbMasterOfDMSP)))) - { - odm_FalseAlarmCounterStatistics_ForSlaveOfDMSP(pDM_Odm); - return; - } -#endif - - if(!(pDM_Odm->SupportAbility & ODM_BB_FA_CNT)) - return; - - if(pDM_Odm->SupportICType & ODM_IC_11N_SERIES) - { - - //hold ofdm counter - ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_HOLDC_11N, BIT31, 1); //hold page C counter - ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_RSTD_11N, BIT31, 1); //hold page D counter - - ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_OFDM_FA_TYPE1_11N, bMaskDWord); - FalseAlmCnt->Cnt_Fast_Fsync = (ret_value&0xffff); - FalseAlmCnt->Cnt_SB_Search_fail = ((ret_value&0xffff0000)>>16); - ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_OFDM_FA_TYPE2_11N, bMaskDWord); - FalseAlmCnt->Cnt_OFDM_CCA = (ret_value&0xffff); - FalseAlmCnt->Cnt_Parity_Fail = ((ret_value&0xffff0000)>>16); - ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_OFDM_FA_TYPE3_11N, bMaskDWord); - FalseAlmCnt->Cnt_Rate_Illegal = (ret_value&0xffff); - FalseAlmCnt->Cnt_Crc8_fail = ((ret_value&0xffff0000)>>16); - ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_OFDM_FA_TYPE4_11N, bMaskDWord); - FalseAlmCnt->Cnt_Mcs_fail = (ret_value&0xffff); - - FalseAlmCnt->Cnt_Ofdm_fail = FalseAlmCnt->Cnt_Parity_Fail + FalseAlmCnt->Cnt_Rate_Illegal + - FalseAlmCnt->Cnt_Crc8_fail + FalseAlmCnt->Cnt_Mcs_fail + - FalseAlmCnt->Cnt_Fast_Fsync + FalseAlmCnt->Cnt_SB_Search_fail; - -#if (RTL8188E_SUPPORT==1) - if((pDM_Odm->SupportICType == ODM_RTL8188E)||(pDM_Odm->SupportICType == ODM_RTL8192E)) - { - ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_SC_CNT_11N, bMaskDWord); - FalseAlmCnt->Cnt_BW_LSC = (ret_value&0xffff); - FalseAlmCnt->Cnt_BW_USC = ((ret_value&0xffff0000)>>16); - } -#endif - -#if (RTL8192D_SUPPORT==1) - if(pDM_Odm->SupportICType == ODM_RTL8192D) - { - odm_GetCCKFalseAlarm_92D(pDM_Odm); - } - else -#endif - { - //hold cck counter - ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_FA_RST_11N, BIT12, 1); - ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_FA_RST_11N, BIT14, 1); - - ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_CCK_FA_LSB_11N, bMaskByte0); - FalseAlmCnt->Cnt_Cck_fail = ret_value; - ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_CCK_FA_MSB_11N, bMaskByte3); - FalseAlmCnt->Cnt_Cck_fail += (ret_value& 0xff)<<8; - - ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_CCK_CCA_CNT_11N, bMaskDWord); - FalseAlmCnt->Cnt_CCK_CCA = ((ret_value&0xFF)<<8) |((ret_value&0xFF00)>>8); - } - - FalseAlmCnt->Cnt_all = ( FalseAlmCnt->Cnt_Fast_Fsync + - FalseAlmCnt->Cnt_SB_Search_fail + - FalseAlmCnt->Cnt_Parity_Fail + - FalseAlmCnt->Cnt_Rate_Illegal + - FalseAlmCnt->Cnt_Crc8_fail + - FalseAlmCnt->Cnt_Mcs_fail + - FalseAlmCnt->Cnt_Cck_fail); - - FalseAlmCnt->Cnt_CCA_all = FalseAlmCnt->Cnt_OFDM_CCA + FalseAlmCnt->Cnt_CCK_CCA; - -#if (RTL8192C_SUPPORT==1) - if(pDM_Odm->SupportICType == ODM_RTL8192C) - odm_ResetFACounter_92C(pDM_Odm); -#endif - -#if (RTL8192D_SUPPORT==1) - if(pDM_Odm->SupportICType == ODM_RTL8192D) - odm_ResetFACounter_92D(pDM_Odm); -#endif - - if(pDM_Odm->SupportICType >=ODM_RTL8723A) - { - //reset false alarm counter registers - ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_RSTC_11N, BIT31, 1); - ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_RSTC_11N, BIT31, 0); - ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_RSTD_11N, BIT27, 1); - ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_RSTD_11N, BIT27, 0); - //update ofdm counter - ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_HOLDC_11N, BIT31, 0); //update page C counter - ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_RSTD_11N, BIT31, 0); //update page D counter - - //reset CCK CCA counter - ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_FA_RST_11N, BIT13|BIT12, 0); - ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_FA_RST_11N, BIT13|BIT12, 2); - //reset CCK FA counter - ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_FA_RST_11N, BIT15|BIT14, 0); - ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_FA_RST_11N, BIT15|BIT14, 2); - } - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Enter odm_FalseAlarmCounterStatistics\n")); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Cnt_Fast_Fsync=%d, Cnt_SB_Search_fail=%d\n", - FalseAlmCnt->Cnt_Fast_Fsync, FalseAlmCnt->Cnt_SB_Search_fail)); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Cnt_Parity_Fail=%d, Cnt_Rate_Illegal=%d\n", - FalseAlmCnt->Cnt_Parity_Fail, FalseAlmCnt->Cnt_Rate_Illegal)); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Cnt_Crc8_fail=%d, Cnt_Mcs_fail=%d\n", - FalseAlmCnt->Cnt_Crc8_fail, FalseAlmCnt->Cnt_Mcs_fail)); - } - else if(pDM_Odm->SupportICType & ODM_IC_11AC_SERIES) - { - u4Byte CCKenable; - //read OFDM FA counter - FalseAlmCnt->Cnt_Ofdm_fail = ODM_GetBBReg(pDM_Odm, ODM_REG_OFDM_FA_11AC, bMaskLWord); - FalseAlmCnt->Cnt_Cck_fail = ODM_GetBBReg(pDM_Odm, ODM_REG_CCK_FA_11AC, bMaskLWord); - - CCKenable = ODM_GetBBReg(pDM_Odm, ODM_REG_BB_RX_PATH_11AC, BIT28); - if(CCKenable)//if(*pDM_Odm->pBandType == ODM_BAND_2_4G) - FalseAlmCnt->Cnt_all = FalseAlmCnt->Cnt_Ofdm_fail + FalseAlmCnt->Cnt_Cck_fail; - else - FalseAlmCnt->Cnt_all = FalseAlmCnt->Cnt_Ofdm_fail; - - // reset OFDM FA coutner - ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_RST_11AC, BIT17, 1); - ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_RST_11AC, BIT17, 0); - // reset CCK FA counter - ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_FA_RST_11AC, BIT15, 0); - ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_FA_RST_11AC, BIT15, 1); - } - ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Cnt_Cck_fail=%d\n", FalseAlmCnt->Cnt_Cck_fail)); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Cnt_Ofdm_fail=%d\n", FalseAlmCnt->Cnt_Ofdm_fail)); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Total False Alarm=%d\n", FalseAlmCnt->Cnt_all)); -} - -//3============================================================ -//3 CCK Packet Detect Threshold -//3============================================================ - -VOID -odm_CCKPacketDetectionThresh( - IN PDM_ODM_T pDM_Odm - ) -{ - - u1Byte CurCCK_CCAThres; - PFALSE_ALARM_STATISTICS FalseAlmCnt = &(pDM_Odm->FalseAlmCnt); - -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) -//modify by Guo.Mingzhi 2011-12-29 - if (pDM_Odm->bDualMacSmartConcurrent == TRUE) -// if (pDM_Odm->bDualMacSmartConcurrent == FALSE) - return; - - if(pDM_Odm->bBtHsOperation) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_CCKPacketDetectionThresh() write 0xcd for BT HS mode!!\n")); - ODM_Write_CCK_CCA_Thres(pDM_Odm, 0xcd); - return; - } - -#endif - - if(!(pDM_Odm->SupportAbility & (ODM_BB_CCK_PD|ODM_BB_FA_CNT))) - return; - - if(pDM_Odm->ExtLNA) - return; - - if(pDM_Odm->bLinked) - { - if(pDM_Odm->RSSI_Min > 25) - CurCCK_CCAThres = 0xcd; - else if((pDM_Odm->RSSI_Min <= 25) && (pDM_Odm->RSSI_Min > 10)) - CurCCK_CCAThres = 0x83; - else - { - if(FalseAlmCnt->Cnt_Cck_fail > 1000) - CurCCK_CCAThres = 0x83; - else - CurCCK_CCAThres = 0x40; - } - } - else - { - if(FalseAlmCnt->Cnt_Cck_fail > 1000) - CurCCK_CCAThres = 0x83; - else - CurCCK_CCAThres = 0x40; - } - -#if (RTL8192D_SUPPORT==1) - if((pDM_Odm->SupportICType == ODM_RTL8192D)&&(*pDM_Odm->pBandType == ODM_BAND_2_4G)) - ODM_Write_CCK_CCA_Thres_92D(pDM_Odm, CurCCK_CCAThres); - else -#endif - ODM_Write_CCK_CCA_Thres(pDM_Odm, CurCCK_CCAThres); -} - -VOID -ODM_Write_CCK_CCA_Thres( - IN PDM_ODM_T pDM_Odm, - IN u1Byte CurCCK_CCAThres - ) -{ - pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable; - - if(pDM_DigTable->CurCCK_CCAThres!=CurCCK_CCAThres) //modify by Guo.Mingzhi 2012-01-03 - { - ODM_Write1Byte(pDM_Odm, ODM_REG(CCK_CCA,pDM_Odm), CurCCK_CCAThres); - } - pDM_DigTable->PreCCK_CCAThres = pDM_DigTable->CurCCK_CCAThres; - pDM_DigTable->CurCCK_CCAThres = CurCCK_CCAThres; - -} - -//3============================================================ -//3 BB Power Save -//3============================================================ -VOID -odm_DynamicBBPowerSavingInit( - IN PDM_ODM_T pDM_Odm - ) -{ - pPS_T pDM_PSTable = &pDM_Odm->DM_PSTable; - - pDM_PSTable->PreCCAState = CCA_MAX; - pDM_PSTable->CurCCAState = CCA_MAX; - pDM_PSTable->PreRFState = RF_MAX; - pDM_PSTable->CurRFState = RF_MAX; - pDM_PSTable->Rssi_val_min = 0; - pDM_PSTable->initialize = 0; -} - - -VOID -odm_DynamicBBPowerSaving( - IN PDM_ODM_T pDM_Odm - ) -{ -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) - - if (pDM_Odm->SupportICType != ODM_RTL8723A) - return; - if(!(pDM_Odm->SupportAbility & ODM_BB_PWR_SAVE)) - return; - if(!(pDM_Odm->SupportPlatform & (ODM_WIN|ODM_CE))) - return; - - //1 2.Power Saving for 92C - if((pDM_Odm->SupportICType == ODM_RTL8192C) &&(pDM_Odm->RFType == ODM_2T2R)) - { - odm_1R_CCA(pDM_Odm); - } - - // 20100628 Joseph: Turn off BB power save for 88CE because it makesthroughput unstable. - // 20100831 Joseph: Turn ON BB power save again after modifying AGC delay from 900ns ot 600ns. - //1 3.Power Saving for 88C - else - { - ODM_RF_Saving(pDM_Odm, FALSE); - } -#endif // #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - -} - -VOID -odm_1R_CCA( - IN PDM_ODM_T pDM_Odm - ) -{ - pPS_T pDM_PSTable = &pDM_Odm->DM_PSTable; - - if(pDM_Odm->RSSI_Min!= 0xFF) - { - - if(pDM_PSTable->PreCCAState == CCA_2R) - { - if(pDM_Odm->RSSI_Min >= 35) - pDM_PSTable->CurCCAState = CCA_1R; - else - pDM_PSTable->CurCCAState = CCA_2R; - - } - else{ - if(pDM_Odm->RSSI_Min <= 30) - pDM_PSTable->CurCCAState = CCA_2R; - else - pDM_PSTable->CurCCAState = CCA_1R; - } - } - else{ - pDM_PSTable->CurCCAState=CCA_MAX; - } - - if(pDM_PSTable->PreCCAState != pDM_PSTable->CurCCAState) - { - if(pDM_PSTable->CurCCAState == CCA_1R) - { - if( pDM_Odm->RFType ==ODM_2T2R ) - { - ODM_SetBBReg(pDM_Odm, 0xc04 , bMaskByte0, 0x13); - //PHY_SetBBReg(pAdapter, 0xe70, bMaskByte3, 0x20); - } - else - { - ODM_SetBBReg(pDM_Odm, 0xc04 , bMaskByte0, 0x23); - //PHY_SetBBReg(pAdapter, 0xe70, 0x7fc00000, 0x10c); // Set RegE70[30:22] = 9b'100001100 - } - } - else - { - ODM_SetBBReg(pDM_Odm, 0xc04 , bMaskByte0, 0x33); - //PHY_SetBBReg(pAdapter,0xe70, bMaskByte3, 0x63); - } - pDM_PSTable->PreCCAState = pDM_PSTable->CurCCAState; - } - //ODM_RT_TRACE(pDM_Odm, COMP_BB_POWERSAVING, DBG_LOUD, ("CCAStage = %s\n",(pDM_PSTable->CurCCAState==0)?"1RCCA":"2RCCA")); -} - -void -ODM_RF_Saving( - IN PDM_ODM_T pDM_Odm, - IN u1Byte bForceInNormal - ) -{ -#if (DM_ODM_SUPPORT_TYPE != ODM_AP) - pPS_T pDM_PSTable = &pDM_Odm->DM_PSTable; - u1Byte Rssi_Up_bound = 30 ; - u1Byte Rssi_Low_bound = 25; - #if (DM_ODM_SUPPORT_TYPE == ODM_CE) - if(pDM_Odm->PatchID == 40 ) //RT_CID_819x_FUNAI_TV - { - Rssi_Up_bound = 50 ; - Rssi_Low_bound = 45; - } - #endif - if(pDM_PSTable->initialize == 0){ - - pDM_PSTable->Reg874 = (ODM_GetBBReg(pDM_Odm, 0x874, bMaskDWord)&0x1CC000)>>14; - pDM_PSTable->RegC70 = (ODM_GetBBReg(pDM_Odm, 0xc70, bMaskDWord)&BIT3)>>3; - pDM_PSTable->Reg85C = (ODM_GetBBReg(pDM_Odm, 0x85c, bMaskDWord)&0xFF000000)>>24; - pDM_PSTable->RegA74 = (ODM_GetBBReg(pDM_Odm, 0xa74, bMaskDWord)&0xF000)>>12; - //Reg818 = PHY_QueryBBReg(pAdapter, 0x818, bMaskDWord); - pDM_PSTable->initialize = 1; - } - - if(!bForceInNormal) - { - if(pDM_Odm->RSSI_Min != 0xFF) - { - if(pDM_PSTable->PreRFState == RF_Normal) - { - if(pDM_Odm->RSSI_Min >= Rssi_Up_bound) - pDM_PSTable->CurRFState = RF_Save; - else - pDM_PSTable->CurRFState = RF_Normal; - } - else{ - if(pDM_Odm->RSSI_Min <= Rssi_Low_bound) - pDM_PSTable->CurRFState = RF_Normal; - else - pDM_PSTable->CurRFState = RF_Save; - } - } - else - pDM_PSTable->CurRFState=RF_MAX; - } - else - { - pDM_PSTable->CurRFState = RF_Normal; - } - - if(pDM_PSTable->PreRFState != pDM_PSTable->CurRFState) - { - if(pDM_PSTable->CurRFState == RF_Save) - { - // 8723 RSSI report will be wrong. Set 0x874[5]=1 when enter BB power saving mode. - // Suggested by SD3 Yu-Nan. 2011.01.20. - if(pDM_Odm->SupportICType == ODM_RTL8723A) - { - ODM_SetBBReg(pDM_Odm, 0x874 , BIT5, 0x1); //Reg874[5]=1b'1 - } - ODM_SetBBReg(pDM_Odm, 0x874 , 0x1C0000, 0x2); //Reg874[20:18]=3'b010 - ODM_SetBBReg(pDM_Odm, 0xc70, BIT3, 0); //RegC70[3]=1'b0 - ODM_SetBBReg(pDM_Odm, 0x85c, 0xFF000000, 0x63); //Reg85C[31:24]=0x63 - ODM_SetBBReg(pDM_Odm, 0x874, 0xC000, 0x2); //Reg874[15:14]=2'b10 - ODM_SetBBReg(pDM_Odm, 0xa74, 0xF000, 0x3); //RegA75[7:4]=0x3 - ODM_SetBBReg(pDM_Odm, 0x818, BIT28, 0x0); //Reg818[28]=1'b0 - ODM_SetBBReg(pDM_Odm, 0x818, BIT28, 0x1); //Reg818[28]=1'b1 - //ODM_RT_TRACE(pDM_Odm, COMP_BB_POWERSAVING, DBG_LOUD, (" RF_Save")); - } - else - { - ODM_SetBBReg(pDM_Odm, 0x874 , 0x1CC000, pDM_PSTable->Reg874); - ODM_SetBBReg(pDM_Odm, 0xc70, BIT3, pDM_PSTable->RegC70); - ODM_SetBBReg(pDM_Odm, 0x85c, 0xFF000000, pDM_PSTable->Reg85C); - ODM_SetBBReg(pDM_Odm, 0xa74, 0xF000, pDM_PSTable->RegA74); - ODM_SetBBReg(pDM_Odm,0x818, BIT28, 0x0); - - if(pDM_Odm->SupportICType == ODM_RTL8723A) - { - ODM_SetBBReg(pDM_Odm,0x874 , BIT5, 0x0); //Reg874[5]=1b'0 - } - //ODM_RT_TRACE(pDM_Odm, COMP_BB_POWERSAVING, DBG_LOUD, (" RF_Normal")); - } - pDM_PSTable->PreRFState =pDM_PSTable->CurRFState; - } -#endif -} - - -//3============================================================ -//3 RATR MASK -//3============================================================ -//3============================================================ -//3 Rate Adaptive -//3============================================================ - -VOID -odm_RateAdaptiveMaskInit( - IN PDM_ODM_T pDM_Odm - ) -{ - PODM_RATE_ADAPTIVE pOdmRA = &pDM_Odm->RateAdaptive; - -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - PMGNT_INFO pMgntInfo = &pDM_Odm->Adapter->MgntInfo; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pDM_Odm->Adapter); - - pMgntInfo->Ratr_State = DM_RATR_STA_INIT; - - if (pMgntInfo->DM_Type == DM_Type_ByDriver) - pHalData->bUseRAMask = TRUE; - else - pHalData->bUseRAMask = FALSE; - -#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) - pOdmRA->Type = DM_Type_ByDriver; - if (pOdmRA->Type == DM_Type_ByDriver) - pDM_Odm->bUseRAMask = _TRUE; - else - pDM_Odm->bUseRAMask = _FALSE; -#endif - - pOdmRA->RATRState = DM_RATR_STA_INIT; - pOdmRA->LdpcThres = 35; - pOdmRA->bUseLdpc = FALSE; - pOdmRA->HighRSSIThresh = 50; - pOdmRA->LowRSSIThresh = 20; -} - -#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) -VOID -ODM_RateAdaptiveStateApInit( - IN PADAPTER Adapter , - IN PRT_WLAN_STA pEntry - ) -{ - pEntry->Ratr_State = DM_RATR_STA_INIT; -} -#endif - -#if (DM_ODM_SUPPORT_TYPE == ODM_CE) -u4Byte ODM_Get_Rate_Bitmap( - IN PDM_ODM_T pDM_Odm, - IN u4Byte macid, - IN u4Byte ra_mask, - IN u1Byte rssi_level) -{ - PSTA_INFO_T pEntry; - u4Byte rate_bitmap = 0; - u1Byte WirelessMode; - //u1Byte WirelessMode =*(pDM_Odm->pWirelessMode); - - - pEntry = pDM_Odm->pODM_StaInfo[macid]; - if(!IS_STA_VALID(pEntry)) - return ra_mask; - - WirelessMode = pEntry->wireless_mode; - - switch(WirelessMode) - { - case ODM_WM_B: - if(ra_mask & 0x0000000c) //11M or 5.5M enable - rate_bitmap = 0x0000000d; - else - rate_bitmap = 0x0000000f; - break; - - case (ODM_WM_G): - case (ODM_WM_A): - if(rssi_level == DM_RATR_STA_HIGH) - rate_bitmap = 0x00000f00; - else - rate_bitmap = 0x00000ff0; - break; - - case (ODM_WM_B|ODM_WM_G): - if(rssi_level == DM_RATR_STA_HIGH) - rate_bitmap = 0x00000f00; - else if(rssi_level == DM_RATR_STA_MIDDLE) - rate_bitmap = 0x00000ff0; - else - rate_bitmap = 0x00000ff5; - break; - - case (ODM_WM_B|ODM_WM_G|ODM_WM_N24G) : - case (ODM_WM_B|ODM_WM_N24G) : - case (ODM_WM_G|ODM_WM_N24G) : - case (ODM_WM_A|ODM_WM_N5G) : - { - if ( pDM_Odm->RFType == ODM_1T2R ||pDM_Odm->RFType == ODM_1T1R) - { - if(rssi_level == DM_RATR_STA_HIGH) - { - rate_bitmap = 0x000f0000; - } - else if(rssi_level == DM_RATR_STA_MIDDLE) - { - rate_bitmap = 0x000ff000; - } - else{ - if (*(pDM_Odm->pBandWidth) == ODM_BW40M) - rate_bitmap = 0x000ff015; - else - rate_bitmap = 0x000ff005; - } - } - else - { - if(rssi_level == DM_RATR_STA_HIGH) - { - rate_bitmap = 0x0f8f0000; - } - else if(rssi_level == DM_RATR_STA_MIDDLE) - { - rate_bitmap = 0x0f8ff000; - } - else - { - if (*(pDM_Odm->pBandWidth) == ODM_BW40M) - rate_bitmap = 0x0f8ff015; - else - rate_bitmap = 0x0f8ff005; - } - } - } - break; - - case (ODM_WM_AC|ODM_WM_G): - if(rssi_level == 1) - rate_bitmap = 0xfc3f0000; - else if(rssi_level == 2) - rate_bitmap = 0xfffff000; - else - rate_bitmap = 0xffffffff; - break; - - case (ODM_WM_AC|ODM_WM_A): - - if (pDM_Odm->RFType == RF_1T1R) - { - if(rssi_level == 1) // add by Gary for ac-series - rate_bitmap = 0x003f8000; - else if (rssi_level == 2) - rate_bitmap = 0x003ff000; - else - rate_bitmap = 0x003ff010; - } - else - { - if(rssi_level == 1) // add by Gary for ac-series - rate_bitmap = 0xfe3f8000; // VHT 2SS MCS3~9 - else if (rssi_level == 2) - rate_bitmap = 0xfffff000; // VHT 2SS MCS0~9 - else - rate_bitmap = 0xfffff010; // All - } - break; - - default: - if(pDM_Odm->RFType == RF_1T2R) - rate_bitmap = 0x000fffff; - else - rate_bitmap = 0x0fffffff; - break; - - } - - //printk("%s ==> rssi_level:0x%02x, WirelessMode:0x%02x, rate_bitmap:0x%08x \n",__FUNCTION__,rssi_level,WirelessMode,rate_bitmap); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, (" ==> rssi_level:0x%02x, WirelessMode:0x%02x, rate_bitmap:0x%08x \n",rssi_level,WirelessMode,rate_bitmap)); - - return (ra_mask&rate_bitmap); - -} -#endif - - -VOID -odm_RefreshBasicRateMask( - IN PDM_ODM_T pDM_Odm - ) -{ -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - PADAPTER Adapter = pDM_Odm->Adapter; - static u1Byte Stage = 0; - u1Byte CurStage = 0; - OCTET_STRING osRateSet; - PMGNT_INFO pMgntInfo = GetDefaultMgntInfo(Adapter); - u1Byte RateSet[5] = {MGN_1M, MGN_2M, MGN_5_5M, MGN_11M, MGN_6M}; - - if(pDM_Odm->SupportICType != ODM_RTL8812 && pDM_Odm->SupportICType != ODM_RTL8821 ) - return; - - if(pDM_Odm->bLinked == FALSE) // unlink Default port information - CurStage = 0; - else if(pDM_Odm->RSSI_Min < 40) // link RSSI < 40% - CurStage = 1; - else if(pDM_Odm->RSSI_Min > 45) // link RSSI > 45% - CurStage = 3; - else - CurStage = 2; // link 25% <= RSSI <= 30% - - if(CurStage != Stage) - { - if(CurStage == 1) - { - FillOctetString(osRateSet, RateSet, 5); - FilterSupportRate(pMgntInfo->mBrates, &osRateSet, FALSE); - Adapter->HalFunc.SetHwRegHandler(Adapter, HW_VAR_BASIC_RATE, (pu1Byte)&osRateSet); - } - else if(CurStage == 3 && (Stage == 1 || Stage == 2)) - { - Adapter->HalFunc.SetHwRegHandler( Adapter, HW_VAR_BASIC_RATE, (pu1Byte)(&pMgntInfo->mBrates) ); - } - } - - Stage = CurStage; -#endif -} - -/*----------------------------------------------------------------------------- - * Function: odm_RefreshRateAdaptiveMask() - * - * Overview: Update rate table mask according to rssi - * - * Input: NONE - * - * Output: NONE - * - * Return: NONE - * - * Revised History: - * When Who Remark - * 05/27/2009 hpfan Create Version 0. - * - *---------------------------------------------------------------------------*/ -VOID -odm_RefreshRateAdaptiveMask( - IN PDM_ODM_T pDM_Odm - ) -{ - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_TRACE, ("odm_RefreshRateAdaptiveMask()---------->\n")); - if (!(pDM_Odm->SupportAbility & ODM_BB_RA_MASK)) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_TRACE, ("odm_RefreshRateAdaptiveMask(): Return cos not supported\n")); - return; - } - // - // 2011/09/29 MH In HW integration first stage, we provide 4 different handle to operate - // at the same time. In the stage2/3, we need to prive universal interface and merge all - // HW dynamic mechanism. - // - switch (pDM_Odm->SupportPlatform) - { - case ODM_WIN: - odm_RefreshRateAdaptiveMaskMP(pDM_Odm); - break; - - case ODM_CE: - odm_RefreshRateAdaptiveMaskCE(pDM_Odm); - break; - - case ODM_AP: - case ODM_ADSL: - odm_RefreshRateAdaptiveMaskAPADSL(pDM_Odm); - break; - } - -} - -VOID -odm_RefreshRateAdaptiveMaskMP( - IN PDM_ODM_T pDM_Odm - ) -{ -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - PADAPTER pAdapter = pDM_Odm->Adapter; - PADAPTER pTargetAdapter = NULL; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); - PMGNT_INFO pMgntInfo = GetDefaultMgntInfo(pAdapter); - PODM_RATE_ADAPTIVE pRA = &pDM_Odm->RateAdaptive; - - if(pAdapter->bDriverStopped) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_TRACE, ("<---- odm_RefreshRateAdaptiveMask(): driver is going to unload\n")); - return; - } - - if(!pHalData->bUseRAMask) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("<---- odm_RefreshRateAdaptiveMask(): driver does not control rate adaptive mask\n")); - return; - } - - // if default port is connected, update RA table for default port (infrastructure mode only) - if(pMgntInfo->mAssoc && (!ACTING_AS_AP(pAdapter))) - { - - if(pHalData->UndecoratedSmoothedPWDB < pRA->LdpcThres) - { - pRA->bUseLdpc = TRUE; - pRA->bLowerRtsRate = TRUE; - if((pDM_Odm->SupportICType == ODM_RTL8821) && (pDM_Odm->CutVersion == ODM_CUT_A)) - MgntSet_TX_LDPC(pAdapter,0,TRUE); - //DbgPrint("RSSI=%d, bUseLdpc = TRUE\n", pHalData->UndecoratedSmoothedPWDB); - } - else if(pHalData->UndecoratedSmoothedPWDB > (pRA->LdpcThres-5)) - { - pRA->bUseLdpc = FALSE; - pRA->bLowerRtsRate = FALSE; - if((pDM_Odm->SupportICType == ODM_RTL8821) && (pDM_Odm->CutVersion == ODM_CUT_A)) - MgntSet_TX_LDPC(pAdapter,0,FALSE); - //DbgPrint("RSSI=%d, bUseLdpc = FALSE\n", pHalData->UndecoratedSmoothedPWDB); - } - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("odm_RefreshRateAdaptiveMask(): Infrasture Mode\n")); - if( ODM_RAStateCheck(pDM_Odm, pHalData->UndecoratedSmoothedPWDB, pMgntInfo->bSetTXPowerTrainingByOid, &pMgntInfo->Ratr_State) ) - { - ODM_PRINT_ADDR(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("Target AP addr : "), pMgntInfo->Bssid); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("RSSI:%d, RSSI_LEVEL:%d\n", pHalData->UndecoratedSmoothedPWDB, pMgntInfo->Ratr_State)); - pAdapter->HalFunc.UpdateHalRAMaskHandler(pAdapter, pMgntInfo->mMacId, NULL, pMgntInfo->Ratr_State); - } - } - - // - // The following part configure AP/VWifi/IBSS rate adaptive mask. - // - - if(pMgntInfo->mIbss) // Target: AP/IBSS peer. - pTargetAdapter = GetDefaultAdapter(pAdapter); - else - pTargetAdapter = GetFirstAPAdapter(pAdapter); - - // if extension port (softap) is started, updaet RA table for more than one clients associate - if(pTargetAdapter != NULL) - { - int i; - PRT_WLAN_STA pEntry; - - for(i = 0; i < ODM_ASSOCIATE_ENTRY_NUM; i++) - { - pEntry = AsocEntry_EnumStation(pTargetAdapter, i); - if(NULL != pEntry) - { - if(pEntry->bAssociated) - { - if(ODM_RAStateCheck(pDM_Odm, pEntry->rssi_stat.UndecoratedSmoothedPWDB, pMgntInfo->bSetTXPowerTrainingByOid, &pEntry->Ratr_State) ) - { - ODM_PRINT_ADDR(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("Target STA addr : "), pEntry->MacAddr); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("RSSI:%d, RSSI_LEVEL:%d\n", pEntry->rssi_stat.UndecoratedSmoothedPWDB, pEntry->Ratr_State)); - pAdapter->HalFunc.UpdateHalRAMaskHandler(pTargetAdapter, pEntry->AssociatedMacId, pEntry, pEntry->Ratr_State); - } - } - } - } - } - - if(pMgntInfo->bSetTXPowerTrainingByOid) - pMgntInfo->bSetTXPowerTrainingByOid = FALSE; -#endif // #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) -} - - -VOID -odm_RefreshRateAdaptiveMaskCE( - IN PDM_ODM_T pDM_Odm - ) -{ -#if (DM_ODM_SUPPORT_TYPE == ODM_CE) - u1Byte i; - PADAPTER pAdapter = pDM_Odm->Adapter; - PODM_RATE_ADAPTIVE pRA = &pDM_Odm->RateAdaptive; - - if(pAdapter->bDriverStopped) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_TRACE, ("<---- odm_RefreshRateAdaptiveMask(): driver is going to unload\n")); - return; - } - - if(!pDM_Odm->bUseRAMask) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("<---- odm_RefreshRateAdaptiveMask(): driver does not control rate adaptive mask\n")); - return; - } - - //printk("==> %s \n",__FUNCTION__); - - for(i=0; ipODM_StaInfo[i]; - if(IS_STA_VALID(pstat) ) { - if(IS_MCAST( pstat->hwaddr)) //if(psta->mac_id ==1) - continue; - if(IS_MCAST( pstat->hwaddr)) - continue; - - #if((RTL8812A_SUPPORT==1)||(RTL8821A_SUPPORT==1)) - if((pDM_Odm->SupportICType == ODM_RTL8812)||(pDM_Odm->SupportICType == ODM_RTL8821)) - { - if(pstat->rssi_stat.UndecoratedSmoothedPWDB < pRA->LdpcThres) - { - pRA->bUseLdpc = TRUE; - pRA->bLowerRtsRate = TRUE; - if((pDM_Odm->SupportICType == ODM_RTL8821) && (pDM_Odm->CutVersion == ODM_CUT_A)) - Set_RA_LDPC_8812(pstat, TRUE); - //DbgPrint("RSSI=%d, bUseLdpc = TRUE\n", pHalData->UndecoratedSmoothedPWDB); - } - else if(pstat->rssi_stat.UndecoratedSmoothedPWDB > (pRA->LdpcThres-5)) - { - pRA->bUseLdpc = FALSE; - pRA->bLowerRtsRate = FALSE; - if((pDM_Odm->SupportICType == ODM_RTL8821) && (pDM_Odm->CutVersion == ODM_CUT_A)) - Set_RA_LDPC_8812(pstat, FALSE); - //DbgPrint("RSSI=%d, bUseLdpc = FALSE\n", pHalData->UndecoratedSmoothedPWDB); - } - } - #endif - - if( TRUE == ODM_RAStateCheck(pDM_Odm, pstat->rssi_stat.UndecoratedSmoothedPWDB, FALSE , &pstat->rssi_level) ) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("RSSI:%d, RSSI_LEVEL:%d\n", pstat->rssi_stat.UndecoratedSmoothedPWDB, pstat->rssi_level)); - //printk("RSSI:%d, RSSI_LEVEL:%d\n", pstat->rssi_stat.UndecoratedSmoothedPWDB, pstat->rssi_level); - rtw_hal_update_ra_mask(pstat, pstat->rssi_level); - } - - } - } - -#endif -} - -VOID -odm_RefreshRateAdaptiveMaskAPADSL( - IN PDM_ODM_T pDM_Odm - ) -{ -#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) - struct rtl8192cd_priv *priv = pDM_Odm->priv; - struct stat_info *pstat; - - if (!priv->pmib->dot11StationConfigEntry.autoRate) - return; - - if (list_empty(&priv->asoc_list)) - return; - - list_for_each_entry(pstat, &priv->asoc_list, asoc_list) { - if(ODM_RAStateCheck(pDM_Odm, (s4Byte)pstat->rssi, FALSE, &pstat->rssi_level) ) { - ODM_PRINT_ADDR(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("Target STA addr : "), pstat->hwaddr); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("RSSI:%d, RSSI_LEVEL:%d\n", pstat->rssi, pstat->rssi_level)); - -#ifdef CONFIG_RTL_88E_SUPPORT - if (GET_CHIP_VER(priv)==VERSION_8188E) { -#ifdef TXREPORT - add_RATid(priv, pstat); -#endif - } else -#endif - { -#if defined(CONFIG_RTL_92D_SUPPORT) || defined(CONFIG_RTL_92C_SUPPORT) - add_update_RATid(priv, pstat); -#endif - } - } - } -#endif -} - -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) -VOID -ODM_DynamicARFBSelect( - IN PDM_ODM_T pDM_Odm, - IN u1Byte rate, - IN BOOLEAN Collision_State -) -{ - - if(pDM_Odm->SupportICType != ODM_RTL8192E) - return; - - if (rate >= DESC_RATEMCS8 && rate <= DESC_RATEMCS12){ - if (Collision_State == 1){ - if(rate == DESC_RATEMCS12){ - - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x0); - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x07060501); - } - else if(rate == DESC_RATEMCS11){ - - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x0); - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x07070605); - } - else if(rate == DESC_RATEMCS10){ - - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x0); - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x08080706); - } - else if(rate == DESC_RATEMCS9){ - - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x0); - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x08080707); - } - else{ - - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x0); - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x09090808); - } - } - else{ // Collision_State == 0 - if(rate == DESC_RATEMCS12){ - - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x05010000); - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x09080706); - } - else if(rate == DESC_RATEMCS11){ - - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x06050000); - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x09080807); - } - else if(rate == DESC_RATEMCS10){ - - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x07060000); - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x0a090908); - } - else if(rate == DESC_RATEMCS9){ - - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x07070000); - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x0a090808); - } - else{ - - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x08080000); - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x0b0a0909); - } - } - } - else{ // MCS13~MCS15, 1SS, G-mode - if (Collision_State == 1){ - if(rate == DESC_RATEMCS15){ - - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x00000000); - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x05040302); - } - else if(rate == DESC_RATEMCS14){ - - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x00000000); - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x06050302); - } - else if(rate == DESC_RATEMCS13){ - - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x00000000); - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x07060502); - } - else{ - - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x00000000); - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x06050402); - } - } - else{ // Collision_State == 0 - if(rate == DESC_RATEMCS15){ - - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x03020000); - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x07060504); - } - else if(rate == DESC_RATEMCS14){ - - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x03020000); - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x08070605); - } - else if(rate == DESC_RATEMCS13){ - - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x05020000); - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x09080706); - } - else{ - - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x04020000); - ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x08070605); - } - - - } - - } - -} - -#endif - -// Return Value: BOOLEAN -// - TRUE: RATRState is changed. -BOOLEAN -ODM_RAStateCheck( - IN PDM_ODM_T pDM_Odm, - IN s4Byte RSSI, - IN BOOLEAN bForceUpdate, - OUT pu1Byte pRATRState - ) -{ - PODM_RATE_ADAPTIVE pRA = &pDM_Odm->RateAdaptive; - const u1Byte GoUpGap = 5; - u1Byte HighRSSIThreshForRA = pRA->HighRSSIThresh; - u1Byte LowRSSIThreshForRA = pRA->LowRSSIThresh; - u1Byte RATRState; - - // Threshold Adjustment: - // when RSSI state trends to go up one or two levels, make sure RSSI is high enough. - // Here GoUpGap is added to solve the boundary's level alternation issue. - switch (*pRATRState) - { - case DM_RATR_STA_INIT: - case DM_RATR_STA_HIGH: - break; - - case DM_RATR_STA_MIDDLE: - HighRSSIThreshForRA += GoUpGap; - break; - - case DM_RATR_STA_LOW: - HighRSSIThreshForRA += GoUpGap; - LowRSSIThreshForRA += GoUpGap; - break; - - default: - ODM_RT_ASSERT(pDM_Odm, FALSE, ("wrong rssi level setting %d !", *pRATRState) ); - break; - } - - // Decide RATRState by RSSI. - if(RSSI > HighRSSIThreshForRA) - RATRState = DM_RATR_STA_HIGH; - else if(RSSI > LowRSSIThreshForRA) - RATRState = DM_RATR_STA_MIDDLE; - else - RATRState = DM_RATR_STA_LOW; - //printk("==>%s,RATRState:0x%02x ,RSSI:%d \n",__FUNCTION__,RATRState,RSSI); - - if( *pRATRState!=RATRState || bForceUpdate) - { - ODM_RT_TRACE( pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("RSSI Level %d -> %d\n", *pRATRState, RATRState) ); - *pRATRState = RATRState; - return TRUE; - } - - return FALSE; -} - - -//============================================================ - -//3============================================================ -//3 Dynamic Tx Power -//3============================================================ - -VOID -odm_DynamicTxPowerInit( - IN PDM_ODM_T pDM_Odm - ) -{ -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - PADAPTER Adapter = pDM_Odm->Adapter; - PMGNT_INFO pMgntInfo = &Adapter->MgntInfo; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - - #if DEV_BUS_TYPE==RT_USB_INTERFACE - if(RT_GetInterfaceSelection(Adapter) == INTF_SEL1_USB_High_Power) - { - odm_DynamicTxPowerSavePowerIndex(pDM_Odm); - pMgntInfo->bDynamicTxPowerEnable = TRUE; - } - else - #else - //so 92c pci do not need dynamic tx power? vivi check it later - if(IS_HARDWARE_TYPE_8192D(Adapter)) - pMgntInfo->bDynamicTxPowerEnable = TRUE; - else - pMgntInfo->bDynamicTxPowerEnable = FALSE; - #endif - - - pHalData->LastDTPLvl = TxHighPwrLevel_Normal; - pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_Normal; -#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) - PADAPTER Adapter = pDM_Odm->Adapter; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - struct dm_priv *pdmpriv = &pHalData->dmpriv; - pdmpriv->bDynamicTxPowerEnable = _FALSE; - - #if (RTL8192C_SUPPORT==1) - #ifdef CONFIG_USB_HCI - - #ifdef CONFIG_INTEL_PROXIM - if((pHalData->BoardType == BOARD_USB_High_PA)||(Adapter->proximity.proxim_support==_TRUE)) - #else - if(pHalData->BoardType == BOARD_USB_High_PA) - #endif - - { - //odm_SavePowerIndex(Adapter); - odm_DynamicTxPowerSavePowerIndex(pDM_Odm); - pdmpriv->bDynamicTxPowerEnable = _TRUE; - } - else - #else - pdmpriv->bDynamicTxPowerEnable = _FALSE; - #endif - #endif - - pdmpriv->LastDTPLvl = TxHighPwrLevel_Normal; - pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_Normal; - -#endif - -} - -VOID -odm_DynamicTxPowerSavePowerIndex( - IN PDM_ODM_T pDM_Odm - ) -{ - u1Byte index; - u4Byte Power_Index_REG[6] = {0xc90, 0xc91, 0xc92, 0xc98, 0xc99, 0xc9a}; - -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - PADAPTER Adapter = pDM_Odm->Adapter; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - for(index = 0; index< 6; index++) - pHalData->PowerIndex_backup[index] = PlatformEFIORead1Byte(Adapter, Power_Index_REG[index]); -#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) - PADAPTER Adapter = pDM_Odm->Adapter; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - struct dm_priv *pdmpriv = &pHalData->dmpriv; - for(index = 0; index< 6; index++) - pdmpriv->PowerIndex_backup[index] = rtw_read8(Adapter, Power_Index_REG[index]); -#endif -} - -VOID -odm_DynamicTxPowerRestorePowerIndex( - IN PDM_ODM_T pDM_Odm - ) -{ - u1Byte index; - PADAPTER Adapter = pDM_Odm->Adapter; - -#if (DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_WIN)) - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - u4Byte Power_Index_REG[6] = {0xc90, 0xc91, 0xc92, 0xc98, 0xc99, 0xc9a}; -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - for(index = 0; index< 6; index++) - PlatformEFIOWrite1Byte(Adapter, Power_Index_REG[index], pHalData->PowerIndex_backup[index]); -#elif(DM_ODM_SUPPORT_TYPE == ODM_CE) - struct dm_priv *pdmpriv = &pHalData->dmpriv; - for(index = 0; index< 6; index++) - rtw_write8(Adapter, Power_Index_REG[index], pdmpriv->PowerIndex_backup[index]); -#endif -#endif -} - -VOID -odm_DynamicTxPowerWritePowerIndex( - IN PDM_ODM_T pDM_Odm, - IN u1Byte Value) -{ - - u1Byte index; - u4Byte Power_Index_REG[6] = {0xc90, 0xc91, 0xc92, 0xc98, 0xc99, 0xc9a}; - - for(index = 0; index< 6; index++) - //PlatformEFIOWrite1Byte(Adapter, Power_Index_REG[index], Value); - ODM_Write1Byte(pDM_Odm, Power_Index_REG[index], Value); - -} - - -VOID -odm_DynamicTxPower( - IN PDM_ODM_T pDM_Odm - ) -{ - // - // For AP/ADSL use prtl8192cd_priv - // For CE/NIC use PADAPTER - // - //PADAPTER pAdapter = pDM_Odm->Adapter; -// prtl8192cd_priv priv = pDM_Odm->priv; - - if (!(pDM_Odm->SupportAbility & ODM_BB_DYNAMIC_TXPWR)) - return; - - // - // 2011/09/29 MH In HW integration first stage, we provide 4 different handle to operate - // at the same time. In the stage2/3, we need to prive universal interface and merge all - // HW dynamic mechanism. - // - switch (pDM_Odm->SupportPlatform) - { - case ODM_WIN: - case ODM_CE: - odm_DynamicTxPowerNIC(pDM_Odm); - break; - case ODM_AP: - odm_DynamicTxPowerAP(pDM_Odm); - break; - - case ODM_ADSL: - //odm_DIGAP(pDM_Odm); - break; - } - - -} - - -VOID -odm_DynamicTxPowerNIC( - IN PDM_ODM_T pDM_Odm - ) -{ - if (!(pDM_Odm->SupportAbility & ODM_BB_DYNAMIC_TXPWR)) - return; - -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) - - if(pDM_Odm->SupportICType == ODM_RTL8192C) - { - odm_DynamicTxPower_92C(pDM_Odm); - } - else if(pDM_Odm->SupportICType == ODM_RTL8192D) - { - odm_DynamicTxPower_92D(pDM_Odm); - } - else if (pDM_Odm->SupportICType == ODM_RTL8821) - { -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN)) - PADAPTER Adapter = pDM_Odm->Adapter; - PMGNT_INFO pMgntInfo = GetDefaultMgntInfo(Adapter); - - if (pMgntInfo->RegRspPwr == 1) - { - if(pDM_Odm->RSSI_Min > 60) - { - ODM_SetMACReg(pDM_Odm, ODM_REG_RESP_TX_11AC, BIT20|BIT19|BIT18, 1); // Resp TXAGC offset = -3dB - - } - else if(pDM_Odm->RSSI_Min < 55) - { - ODM_SetMACReg(pDM_Odm, ODM_REG_RESP_TX_11AC, BIT20|BIT19|BIT18, 0); // Resp TXAGC offset = 0dB - } - } -#endif - } -#endif -} - -VOID -odm_DynamicTxPowerAP( - IN PDM_ODM_T pDM_Odm - - ) -{ -#if (DM_ODM_SUPPORT_TYPE == ODM_AP) - prtl8192cd_priv priv = pDM_Odm->priv; - s4Byte i; - - if(!priv->pshare->rf_ft_var.tx_pwr_ctrl) - return; - -#ifdef HIGH_POWER_EXT_PA - if(pDM_Odm->ExtPA) - tx_power_control(priv); -#endif - - /* - * Check if station is near by to use lower tx power - */ - - if ((priv->up_time % 3) == 0 ) { - for(i=0; ipODM_StaInfo[i]; - if(IS_STA_VALID(pstat) ) { - if ((pstat->hp_level == 0) && (pstat->rssi > TX_POWER_NEAR_FIELD_THRESH_AP+4)) - pstat->hp_level = 1; - else if ((pstat->hp_level == 1) && (pstat->rssi < TX_POWER_NEAR_FIELD_THRESH_AP)) - pstat->hp_level = 0; - } - } - } - -#endif -} - - -VOID -odm_DynamicTxPower_92C( - IN PDM_ODM_T pDM_Odm - ) -{ -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - PADAPTER Adapter = pDM_Odm->Adapter; - PMGNT_INFO pMgntInfo = &Adapter->MgntInfo; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - s4Byte UndecoratedSmoothedPWDB; - - // 2012/01/12 MH According to Luke's suggestion, only high power will support the feature. - if (pDM_Odm->ExtPA == FALSE) - return; - - // STA not connected and AP not connected - if((!pMgntInfo->bMediaConnect) && - (pHalData->EntryMinUndecoratedSmoothedPWDB == 0)) - { - ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("Not connected to any \n")); - pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_Normal; - - //the LastDTPlvl should reset when disconnect, - //otherwise the tx power level wouldn't change when disconnect and connect again. - // Maddest 20091220. - pHalData->LastDTPLvl=TxHighPwrLevel_Normal; - return; - } - -#if (INTEL_PROXIMITY_SUPPORT == 1) - // Intel set fixed tx power - if(pMgntInfo->IntelProximityModeInfo.PowerOutput > 0) - { - switch(pMgntInfo->IntelProximityModeInfo.PowerOutput){ - case 1: - pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_100; - ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("TxHighPwrLevel_100\n")); - break; - case 2: - pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_70; - ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("TxHighPwrLevel_70\n")); - break; - case 3: - pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_50; - ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("TxHighPwrLevel_50\n")); - break; - case 4: - pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_35; - ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("TxHighPwrLevel_35\n")); - break; - case 5: - pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_15; - ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("TxHighPwrLevel_15\n")); - break; - default: - pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_100; - ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("TxHighPwrLevel_100\n")); - break; - } - } - else -#endif - { - if( (pMgntInfo->bDynamicTxPowerEnable != TRUE) || - (pHalData->DMFlag & HAL_DM_HIPWR_DISABLE) || - pMgntInfo->IOTAction & HT_IOT_ACT_DISABLE_HIGH_POWER) - { - pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_Normal; - } - else - { - if(pMgntInfo->bMediaConnect) // Default port - { - if(ACTING_AS_AP(Adapter) || ACTING_AS_IBSS(Adapter)) - { - UndecoratedSmoothedPWDB = pHalData->EntryMinUndecoratedSmoothedPWDB; - ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("AP Client PWDB = 0x%x \n", UndecoratedSmoothedPWDB)); - } - else - { - UndecoratedSmoothedPWDB = pHalData->UndecoratedSmoothedPWDB; - ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("STA Default Port PWDB = 0x%x \n", UndecoratedSmoothedPWDB)); - } - } - else // associated entry pwdb - { - UndecoratedSmoothedPWDB = pHalData->EntryMinUndecoratedSmoothedPWDB; - ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("AP Ext Port PWDB = 0x%x \n", UndecoratedSmoothedPWDB)); - } - - if(UndecoratedSmoothedPWDB >= TX_POWER_NEAR_FIELD_THRESH_LVL2) - { - pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_Level2; - ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("TxHighPwrLevel_Level1 (TxPwr=0x0)\n")); - } - else if((UndecoratedSmoothedPWDB < (TX_POWER_NEAR_FIELD_THRESH_LVL2-3)) && - (UndecoratedSmoothedPWDB >= TX_POWER_NEAR_FIELD_THRESH_LVL1) ) - { - pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_Level1; - ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("TxHighPwrLevel_Level1 (TxPwr=0x10)\n")); - } - else if(UndecoratedSmoothedPWDB < (TX_POWER_NEAR_FIELD_THRESH_LVL1-5)) - { - pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_Normal; - ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("TxHighPwrLevel_Normal\n")); - } - } - } - if( pHalData->DynamicTxHighPowerLvl != pHalData->LastDTPLvl ) - { - ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("PHY_SetTxPowerLevel8192C() Channel = %d \n" , pHalData->CurrentChannel)); - PHY_SetTxPowerLevel8192C(Adapter, pHalData->CurrentChannel); - if( (pHalData->DynamicTxHighPowerLvl == TxHighPwrLevel_Normal) && - (pHalData->LastDTPLvl == TxHighPwrLevel_Level1 || pHalData->LastDTPLvl == TxHighPwrLevel_Level2)) //TxHighPwrLevel_Normal - odm_DynamicTxPowerRestorePowerIndex(pDM_Odm); - else if(pHalData->DynamicTxHighPowerLvl == TxHighPwrLevel_Level1) - odm_DynamicTxPowerWritePowerIndex(pDM_Odm, 0x14); - else if(pHalData->DynamicTxHighPowerLvl == TxHighPwrLevel_Level2) - odm_DynamicTxPowerWritePowerIndex(pDM_Odm, 0x10); - } - pHalData->LastDTPLvl = pHalData->DynamicTxHighPowerLvl; - - -#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) - - #if (RTL8192C_SUPPORT==1) - PADAPTER Adapter = pDM_Odm->Adapter; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - struct dm_priv *pdmpriv = &pHalData->dmpriv; - struct mlme_priv *pmlmepriv = &(Adapter->mlmepriv); - struct mlme_ext_priv *pmlmeext = &Adapter->mlmeextpriv; - int UndecoratedSmoothedPWDB; - - if(!pdmpriv->bDynamicTxPowerEnable) - return; - -#ifdef CONFIG_INTEL_PROXIM - if(Adapter->proximity.proxim_on== _TRUE){ - struct proximity_priv *prox_priv=Adapter->proximity.proximity_priv; - // Intel set fixed tx power - printk("\n %s Adapter->proximity.proxim_on=%d prox_priv->proxim_modeinfo->power_output=%d \n",__FUNCTION__,Adapter->proximity.proxim_on,prox_priv->proxim_modeinfo->power_output); - if(prox_priv!=NULL){ - if(prox_priv->proxim_modeinfo->power_output> 0) - { - switch(prox_priv->proxim_modeinfo->power_output) - { - case 1: - pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_100; - printk("TxHighPwrLevel_100\n"); - break; - case 2: - pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_70; - printk("TxHighPwrLevel_70\n"); - break; - case 3: - pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_50; - printk("TxHighPwrLevel_50\n"); - break; - case 4: - pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_35; - printk("TxHighPwrLevel_35\n"); - break; - case 5: - pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_15; - printk("TxHighPwrLevel_15\n"); - break; - default: - pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_100; - printk("TxHighPwrLevel_100\n"); - break; - } - } - } - } - else -#endif - { - // STA not connected and AP not connected - if((check_fwstate(pmlmepriv, _FW_LINKED) != _TRUE) && - (pdmpriv->EntryMinUndecoratedSmoothedPWDB == 0)) - { - //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("Not connected to any \n")); - pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_Normal; - - //the LastDTPlvl should reset when disconnect, - //otherwise the tx power level wouldn't change when disconnect and connect again. - // Maddest 20091220. - pdmpriv->LastDTPLvl=TxHighPwrLevel_Normal; - return; - } - - if(check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) // Default port - { - #if 0 - //todo: AP Mode - if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE) || - (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == _TRUE)) - { - UndecoratedSmoothedPWDB = pdmpriv->EntryMinUndecoratedSmoothedPWDB; - //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("AP Client PWDB = 0x%x \n", UndecoratedSmoothedPWDB)); - } - else - { - UndecoratedSmoothedPWDB = pdmpriv->UndecoratedSmoothedPWDB; - //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("STA Default Port PWDB = 0x%x \n", UndecoratedSmoothedPWDB)); - } - #else - UndecoratedSmoothedPWDB = pdmpriv->EntryMinUndecoratedSmoothedPWDB; - #endif - } - else // associated entry pwdb - { - UndecoratedSmoothedPWDB = pdmpriv->EntryMinUndecoratedSmoothedPWDB; - //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("AP Ext Port PWDB = 0x%x \n", UndecoratedSmoothedPWDB)); - } - - if(UndecoratedSmoothedPWDB >= TX_POWER_NEAR_FIELD_THRESH_LVL2) - { - pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_Level2; - //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("TxHighPwrLevel_Level1 (TxPwr=0x0)\n")); - } - else if((UndecoratedSmoothedPWDB < (TX_POWER_NEAR_FIELD_THRESH_LVL2-3)) && - (UndecoratedSmoothedPWDB >= TX_POWER_NEAR_FIELD_THRESH_LVL1) ) - { - pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_Level1; - //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("TxHighPwrLevel_Level1 (TxPwr=0x10)\n")); - } - else if(UndecoratedSmoothedPWDB < (TX_POWER_NEAR_FIELD_THRESH_LVL1-5)) - { - pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_Normal; - //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("TxHighPwrLevel_Normal\n")); - } - } - if( (pdmpriv->DynamicTxHighPowerLvl != pdmpriv->LastDTPLvl) ) - { - PHY_SetTxPowerLevel8192C(Adapter, pHalData->CurrentChannel); - if(pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_Normal) // HP1 -> Normal or HP2 -> Normal - odm_DynamicTxPowerRestorePowerIndex(pDM_Odm); - else if(pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_Level1) - odm_DynamicTxPowerWritePowerIndex(pDM_Odm, 0x14); - else if(pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_Level2) - odm_DynamicTxPowerWritePowerIndex(pDM_Odm, 0x10); - } - pdmpriv->LastDTPLvl = pdmpriv->DynamicTxHighPowerLvl; - #endif -#endif // #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - -} - - -VOID -odm_DynamicTxPower_92D( - IN PDM_ODM_T pDM_Odm - ) -{ -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - PADAPTER Adapter = pDM_Odm->Adapter; - PMGNT_INFO pMgntInfo = &Adapter->MgntInfo; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - s4Byte UndecoratedSmoothedPWDB; - - PADAPTER BuddyAdapter = Adapter->BuddyAdapter; - BOOLEAN bGetValueFromBuddyAdapter = dm_DualMacGetParameterFromBuddyAdapter(Adapter); - u1Byte HighPowerLvlBackForMac0 = TxHighPwrLevel_Level1; - - // 2012/01/12 MH According to Luke's suggestion, only high power will support the feature. - if (pDM_Odm->ExtPA == FALSE) - return; - - // If dynamic high power is disabled. - if( (pMgntInfo->bDynamicTxPowerEnable != TRUE) || - (pHalData->DMFlag & HAL_DM_HIPWR_DISABLE) || - pMgntInfo->IOTAction & HT_IOT_ACT_DISABLE_HIGH_POWER) - { - pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_Normal; - return; - } - - // STA not connected and AP not connected - if((!pMgntInfo->bMediaConnect) && - (pHalData->EntryMinUndecoratedSmoothedPWDB == 0)) - { - ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("Not connected to any \n")); - pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_Normal; - - //the LastDTPlvl should reset when disconnect, - //otherwise the tx power level wouldn't change when disconnect and connect again. - // Maddest 20091220. - pHalData->LastDTPLvl=TxHighPwrLevel_Normal; - return; - } - - if(pMgntInfo->bMediaConnect) // Default port - { - if(ACTING_AS_AP(Adapter) || pMgntInfo->mIbss) - { - UndecoratedSmoothedPWDB = pHalData->EntryMinUndecoratedSmoothedPWDB; - ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("AP Client PWDB = 0x%x \n", UndecoratedSmoothedPWDB)); - } - else - { - UndecoratedSmoothedPWDB = pHalData->UndecoratedSmoothedPWDB; - ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("STA Default Port PWDB = 0x%x \n", UndecoratedSmoothedPWDB)); - } - } - else // associated entry pwdb - { - UndecoratedSmoothedPWDB = pHalData->EntryMinUndecoratedSmoothedPWDB; - ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("AP Ext Port PWDB = 0x%x \n", UndecoratedSmoothedPWDB)); - } - - if(IS_HARDWARE_TYPE_8192D(Adapter) && GET_HAL_DATA(Adapter)->CurrentBandType == 1){ - if(UndecoratedSmoothedPWDB >= 0x33) - { - pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_Level2; - ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("5G:TxHighPwrLevel_Level2 (TxPwr=0x0)\n")); - } - else if((UndecoratedSmoothedPWDB <0x33) && - (UndecoratedSmoothedPWDB >= 0x2b) ) - { - pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_Level1; - ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("5G:TxHighPwrLevel_Level1 (TxPwr=0x10)\n")); - } - else if(UndecoratedSmoothedPWDB < 0x2b) - { - pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_Normal; - ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("5G:TxHighPwrLevel_Normal\n")); - } - - } - else - - { - if(UndecoratedSmoothedPWDB >= TX_POWER_NEAR_FIELD_THRESH_LVL2) - { - pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_Level1; - ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("TxHighPwrLevel_Level1 (TxPwr=0x0)\n")); - } - else if((UndecoratedSmoothedPWDB < (TX_POWER_NEAR_FIELD_THRESH_LVL2-3)) && - (UndecoratedSmoothedPWDB >= TX_POWER_NEAR_FIELD_THRESH_LVL1) ) - { - pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_Level1; - ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("TxHighPwrLevel_Level1 (TxPwr=0x10)\n")); - } - else if(UndecoratedSmoothedPWDB < (TX_POWER_NEAR_FIELD_THRESH_LVL1-5)) - { - pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_Normal; - ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("TxHighPwrLevel_Normal\n")); - } - - } - -//sherry delete flag 20110517 - if(bGetValueFromBuddyAdapter) - { - ODM_RT_TRACE(pDM_Odm,COMP_MLME,DBG_LOUD,("dm_DynamicTxPower() mac 0 for mac 1 \n")); - if(Adapter->DualMacDMSPControl.bChangeTxHighPowerLvlForAnotherMacOfDMSP) - { - ODM_RT_TRACE(pDM_Odm,COMP_MLME,DBG_LOUD,("dm_DynamicTxPower() change value \n")); - HighPowerLvlBackForMac0 = pHalData->DynamicTxHighPowerLvl; - pHalData->DynamicTxHighPowerLvl = Adapter->DualMacDMSPControl.CurTxHighLvlForAnotherMacOfDMSP; - PHY_SetTxPowerLevel8192C(Adapter, pHalData->CurrentChannel); - pHalData->DynamicTxHighPowerLvl = HighPowerLvlBackForMac0; - Adapter->DualMacDMSPControl.bChangeTxHighPowerLvlForAnotherMacOfDMSP = FALSE; - } - } - - if( (pHalData->DynamicTxHighPowerLvl != pHalData->LastDTPLvl) ) - { - ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("PHY_SetTxPowerLevel8192S() Channel = %d \n" , pHalData->CurrentChannel)); - if(Adapter->DualMacSmartConcurrent == TRUE) - { - if(BuddyAdapter == NULL) - { - ODM_RT_TRACE(pDM_Odm,COMP_MLME,DBG_LOUD,("dm_DynamicTxPower() BuddyAdapter == NULL case \n")); - if(!Adapter->bSlaveOfDMSP) - { - PHY_SetTxPowerLevel8192C(Adapter, pHalData->CurrentChannel); - } - } - else - { - if(pHalData->MacPhyMode92D == DUALMAC_SINGLEPHY) - { - ODM_RT_TRACE(pDM_Odm,COMP_MLME,DBG_LOUD,("dm_DynamicTxPower() BuddyAdapter DMSP \n")); - if(Adapter->bSlaveOfDMSP) - { - ODM_RT_TRACE(pDM_Odm,COMP_MLME,DBG_LOUD,("dm_DynamicTxPower() bslave case \n")); - BuddyAdapter->DualMacDMSPControl.bChangeTxHighPowerLvlForAnotherMacOfDMSP = TRUE; - BuddyAdapter->DualMacDMSPControl.CurTxHighLvlForAnotherMacOfDMSP = pHalData->DynamicTxHighPowerLvl; - } - else - { - ODM_RT_TRACE(pDM_Odm,COMP_MLME,DBG_LOUD,("dm_DynamicTxPower() master case \n")); - if(!bGetValueFromBuddyAdapter) - { - ODM_RT_TRACE(pDM_Odm,COMP_MLME,DBG_LOUD,("dm_DynamicTxPower() mac 0 for mac 0 \n")); - PHY_SetTxPowerLevel8192C(Adapter, pHalData->CurrentChannel); - } - } - } - else - { - ODM_RT_TRACE(pDM_Odm,COMP_MLME,DBG_LOUD,("dm_DynamicTxPower() BuddyAdapter DMDP\n")); - PHY_SetTxPowerLevel8192C(Adapter, pHalData->CurrentChannel); - } - } - } - else - { - PHY_SetTxPowerLevel8192C(Adapter, pHalData->CurrentChannel); - } - - } - pHalData->LastDTPLvl = pHalData->DynamicTxHighPowerLvl; -#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) -#if (RTL8192D_SUPPORT==1) - PADAPTER Adapter = pDM_Odm->Adapter; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - struct mlme_priv *pmlmepriv = &(Adapter->mlmepriv); - - struct dm_priv *pdmpriv = &pHalData->dmpriv; - DM_ODM_T *podmpriv = &pHalData->odmpriv; - int UndecoratedSmoothedPWDB; - #if (RTL8192D_EASY_SMART_CONCURRENT == 1) - PADAPTER BuddyAdapter = Adapter->BuddyAdapter; - BOOLEAN bGetValueFromBuddyAdapter = DualMacGetParameterFromBuddyAdapter(Adapter); - u8 HighPowerLvlBackForMac0 = TxHighPwrLevel_Level1; - #endif - - // If dynamic high power is disabled. - if( (pdmpriv->bDynamicTxPowerEnable != _TRUE) || - (!(podmpriv->SupportAbility& ODM_BB_DYNAMIC_TXPWR)) ) - { - pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_Normal; - return; - } - - // STA not connected and AP not connected - if((check_fwstate(pmlmepriv, _FW_LINKED) != _TRUE) && - (pdmpriv->EntryMinUndecoratedSmoothedPWDB == 0)) - { - //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("Not connected to any \n")); - pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_Normal; - //the LastDTPlvl should reset when disconnect, - //otherwise the tx power level wouldn't change when disconnect and connect again. - // Maddest 20091220. - pdmpriv->LastDTPLvl=TxHighPwrLevel_Normal; - return; - } - - if(check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) // Default port - { - #if 0 - //todo: AP Mode - if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE) || - (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == _TRUE)) - { - UndecoratedSmoothedPWDB = pdmpriv->EntryMinUndecoratedSmoothedPWDB; - //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("AP Client PWDB = 0x%x \n", UndecoratedSmoothedPWDB)); - } - else - { - UndecoratedSmoothedPWDB = pdmpriv->UndecoratedSmoothedPWDB; - //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("STA Default Port PWDB = 0x%x \n", UndecoratedSmoothedPWDB)); - } - #else - UndecoratedSmoothedPWDB = pdmpriv->EntryMinUndecoratedSmoothedPWDB; - #endif - } - else // associated entry pwdb - { - UndecoratedSmoothedPWDB = pdmpriv->EntryMinUndecoratedSmoothedPWDB; - //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("AP Ext Port PWDB = 0x%x \n", UndecoratedSmoothedPWDB)); - } -#if TX_POWER_FOR_5G_BAND == 1 - if(pHalData->CurrentBandType92D == BAND_ON_5G){ - if(UndecoratedSmoothedPWDB >= 0x33) - { - pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_Level2; - //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("5G:TxHighPwrLevel_Level2 (TxPwr=0x0)\n")); - } - else if((UndecoratedSmoothedPWDB <0x33) && - (UndecoratedSmoothedPWDB >= 0x2b) ) - { - pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_Level1; - //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("5G:TxHighPwrLevel_Level1 (TxPwr=0x10)\n")); - } - else if(UndecoratedSmoothedPWDB < 0x2b) - { - pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_Normal; - //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("5G:TxHighPwrLevel_Normal\n")); - } - } - else -#endif - { - if(UndecoratedSmoothedPWDB >= TX_POWER_NEAR_FIELD_THRESH_LVL2) - { - pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_Level2; - //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("TxHighPwrLevel_Level1 (TxPwr=0x0)\n")); - } - else if((UndecoratedSmoothedPWDB < (TX_POWER_NEAR_FIELD_THRESH_LVL2-3)) && - (UndecoratedSmoothedPWDB >= TX_POWER_NEAR_FIELD_THRESH_LVL1) ) - { - pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_Level1; - //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("TxHighPwrLevel_Level1 (TxPwr=0x10)\n")); - } - else if(UndecoratedSmoothedPWDB < (TX_POWER_NEAR_FIELD_THRESH_LVL1-5)) - { - pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_Normal; - //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("TxHighPwrLevel_Normal\n")); - } - } -#if (RTL8192D_EASY_SMART_CONCURRENT == 1) - if(bGetValueFromBuddyAdapter) - { - //ODM_RT_TRACE(pDM_Odm,COMP_MLME,DBG_LOUD,("dm_DynamicTxPower() mac 0 for mac 1 \n")); - if(Adapter->DualMacDMSPControl.bChangeTxHighPowerLvlForAnotherMacOfDMSP) - { - //ODM_RT_TRACE(pDM_Odm,COMP_MLME,DBG_LOUD,("dm_DynamicTxPower() change value \n")); - HighPowerLvlBackForMac0 = pHalData->DynamicTxHighPowerLvl; - pHalData->DynamicTxHighPowerLvl = Adapter->DualMacDMSPControl.CurTxHighLvlForAnotherMacOfDMSP; - PHY_SetTxPowerLevel8192D(Adapter, pHalData->CurrentChannel); - pHalData->DynamicTxHighPowerLvl = HighPowerLvlBackForMac0; - Adapter->DualMacDMSPControl.bChangeTxHighPowerLvlForAnotherMacOfDMSP = _FALSE; - } - } -#endif - - if( (pdmpriv->DynamicTxHighPowerLvl != pdmpriv->LastDTPLvl) ) - { - //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("PHY_SetTxPowerLevel8192S() Channel = %d \n" , pHalData->CurrentChannel)); -#if (RTL8192D_EASY_SMART_CONCURRENT == 1) - if(BuddyAdapter == NULL) - { - //ODM_RT_TRACE(pDM_Odm,COMP_MLME,DBG_LOUD,("dm_DynamicTxPower() BuddyAdapter == NULL case \n")); - if(!Adapter->bSlaveOfDMSP) - { - PHY_SetTxPowerLevel8192D(Adapter, pHalData->CurrentChannel); - } - } - else - { - if(pHalData->MacPhyMode92D == DUALMAC_SINGLEPHY) - { - //ODM_RT_TRACE(pDM_Odm,COMP_MLME,DBG_LOUD,("dm_DynamicTxPower() BuddyAdapter DMSP \n")); - if(Adapter->bSlaveOfDMSP) - { - //ODM_RT_TRACE(pDM_Odm,COMP_MLME,DBG_LOUD,("dm_DynamicTxPower() bslave case \n")); - BuddyAdapter->DualMacDMSPControl.bChangeTxHighPowerLvlForAnotherMacOfDMSP = _TRUE; - BuddyAdapter->DualMacDMSPControl.CurTxHighLvlForAnotherMacOfDMSP = pHalData->DynamicTxHighPowerLvl; - } - else - { - //ODM_RT_TRACE(pDM_Odm,COMP_MLME,DBG_LOUD,("dm_DynamicTxPower() master case \n")); - if(!bGetValueFromBuddyAdapter) - { - //ODM_RT_TRACE(pDM_Odm,COMP_MLME,DBG_LOUD,("dm_DynamicTxPower() mac 0 for mac 0 \n")); - PHY_SetTxPowerLevel8192D(Adapter, pHalData->CurrentChannel); - } - } - } - else - { - //ODM_RT_TRACE(pDM_Odm,COMP_MLME,DBG_LOUD,("dm_DynamicTxPower() BuddyAdapter DMDP\n")); - PHY_SetTxPowerLevel8192D(Adapter, pHalData->CurrentChannel); - } - } -#else - PHY_SetTxPowerLevel8192D(Adapter, pHalData->CurrentChannel); -#endif - } - pdmpriv->LastDTPLvl = pdmpriv->DynamicTxHighPowerLvl; -#endif -#endif // #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - -} - - -//3============================================================ -//3 RSSI Monitor -//3============================================================ - -VOID -odm_RSSIDumpToRegister( - IN PDM_ODM_T pDM_Odm - ) -{ -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - PADAPTER Adapter = pDM_Odm->Adapter; - - if(pDM_Odm->SupportICType == ODM_RTL8812) - { - PlatformEFIOWrite1Byte(Adapter, rA_RSSIDump_Jaguar, Adapter->RxStats.RxRSSIPercentage[0]); - PlatformEFIOWrite1Byte(Adapter, rB_RSSIDump_Jaguar, Adapter->RxStats.RxRSSIPercentage[1]); - - // Rx EVM - PlatformEFIOWrite1Byte(Adapter, rS1_RXevmDump_Jaguar, Adapter->RxStats.RxEVMdbm[0]); - PlatformEFIOWrite1Byte(Adapter, rS2_RXevmDump_Jaguar, Adapter->RxStats.RxEVMdbm[1]); - - // Rx SNR - PlatformEFIOWrite1Byte(Adapter, rA_RXsnrDump_Jaguar, (u1Byte)(Adapter->RxStats.RxSNRdB[0])); - PlatformEFIOWrite1Byte(Adapter, rB_RXsnrDump_Jaguar, (u1Byte)(Adapter->RxStats.RxSNRdB[1])); - - // Rx Cfo_Short - PlatformEFIOWrite2Byte(Adapter, rA_CfoShortDump_Jaguar, Adapter->RxStats.RxCfoShort[0]); - PlatformEFIOWrite2Byte(Adapter, rB_CfoShortDump_Jaguar, Adapter->RxStats.RxCfoShort[1]); - - // Rx Cfo_Tail - PlatformEFIOWrite2Byte(Adapter, rA_CfoLongDump_Jaguar, Adapter->RxStats.RxCfoTail[0]); - PlatformEFIOWrite2Byte(Adapter, rB_CfoLongDump_Jaguar, Adapter->RxStats.RxCfoTail[1]); - } - else if(pDM_Odm->SupportICType == ODM_RTL8192E) - { - PlatformEFIOWrite1Byte(Adapter, rA_RSSIDump_92E, Adapter->RxStats.RxRSSIPercentage[0]); - PlatformEFIOWrite1Byte(Adapter, rB_RSSIDump_92E, Adapter->RxStats.RxRSSIPercentage[1]); - // Rx EVM - PlatformEFIOWrite1Byte(Adapter, rS1_RXevmDump_92E, Adapter->RxStats.RxEVMdbm[0]); - PlatformEFIOWrite1Byte(Adapter, rS2_RXevmDump_92E, Adapter->RxStats.RxEVMdbm[1]); - // Rx SNR - PlatformEFIOWrite1Byte(Adapter, rA_RXsnrDump_92E, (u1Byte)(Adapter->RxStats.RxSNRdB[0])); - PlatformEFIOWrite1Byte(Adapter, rB_RXsnrDump_92E, (u1Byte)(Adapter->RxStats.RxSNRdB[1])); - // Rx Cfo_Short - PlatformEFIOWrite2Byte(Adapter, rA_CfoShortDump_92E, Adapter->RxStats.RxCfoShort[0]); - PlatformEFIOWrite2Byte(Adapter, rB_CfoShortDump_92E, Adapter->RxStats.RxCfoShort[1]); - // Rx Cfo_Tail - PlatformEFIOWrite2Byte(Adapter, rA_CfoLongDump_92E, Adapter->RxStats.RxCfoTail[0]); - PlatformEFIOWrite2Byte(Adapter, rB_CfoLongDump_92E, Adapter->RxStats.RxCfoTail[1]); - } -#endif -} - - -VOID -odm_RSSIMonitorInit( - IN PDM_ODM_T pDM_Odm - ) -{ - pRA_T pRA_Table = &pDM_Odm->DM_RA_Table; - - pRA_Table->firstconnect = FALSE; - -} - -VOID -odm_RSSIMonitorCheck( - IN PDM_ODM_T pDM_Odm - ) -{ - // - // For AP/ADSL use prtl8192cd_priv - // For CE/NIC use PADAPTER - // - - if (!(pDM_Odm->SupportAbility & ODM_BB_RSSI_MONITOR)) - return; - - // - // 2011/09/29 MH In HW integration first stage, we provide 4 different handle to operate - // at the same time. In the stage2/3, we need to prive universal interface and merge all - // HW dynamic mechanism. - // - switch (pDM_Odm->SupportPlatform) - { - case ODM_WIN: - odm_RSSIMonitorCheckMP(pDM_Odm); - break; - - case ODM_CE: - odm_RSSIMonitorCheckCE(pDM_Odm); - break; - - case ODM_AP: - odm_RSSIMonitorCheckAP(pDM_Odm); - break; - - case ODM_ADSL: - //odm_DIGAP(pDM_Odm); - break; - } - -} // odm_RSSIMonitorCheck - - -VOID -odm_RSSIMonitorCheckMP( - IN PDM_ODM_T pDM_Odm - ) -{ -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - PADAPTER Adapter = pDM_Odm->Adapter; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - PRT_WLAN_STA pEntry; - u1Byte i; - s4Byte tmpEntryMaxPWDB=0, tmpEntryMinPWDB=0xff; - u1Byte H2C_Parameter[4] ={0}; - PMGNT_INFO pMgntInfo = &Adapter->MgntInfo; - u8Byte curTxOkCnt = 0, curRxOkCnt = 0; - u1Byte STBC_TX = 0; - BOOLEAN FirstConnect; - pRA_T pRA_Table = &pDM_Odm->DM_RA_Table; -#if (BEAMFORMING_SUPPORT == 1) - BEAMFORMING_CAP Beamform_cap = BEAMFORMING_CAP_NONE; - u1Byte TxBF_EN = 0; -#endif - - RT_DISP(FDM, DM_PWDB, ("pHalData->UndecoratedSmoothedPWDB = 0x%x( %d)\n", - pHalData->UndecoratedSmoothedPWDB, - pHalData->UndecoratedSmoothedPWDB)); - - curTxOkCnt = Adapter->TxStats.NumTxBytesUnicast - pMgntInfo->lastTxOkCnt; - curRxOkCnt = Adapter->RxStats.NumRxBytesUnicast - pMgntInfo->lastRxOkCnt; - pMgntInfo->lastTxOkCnt = curTxOkCnt; - pMgntInfo->lastRxOkCnt = curRxOkCnt; - - RT_DISP(FDM, DM_PWDB, ("Tx = %d Rx = %d\n", curTxOkCnt, curRxOkCnt)); - - FirstConnect = (pHalData->bLinked) && (pRA_Table->firstconnect == FALSE); - pRA_Table->firstconnect = pHalData->bLinked; - H2C_Parameter[3] |= FirstConnect << 5; - - if(pDM_Odm->SupportICType == ODM_RTL8188E && (pMgntInfo->CustomerID==RT_CID_819x_HP)) - { - if(curRxOkCnt >(curTxOkCnt*6)) - PlatformEFIOWrite4Byte(Adapter, REG_ARFR0, 0x8f015); - else - PlatformEFIOWrite4Byte(Adapter, REG_ARFR0, 0xff015); - } - - if(pDM_Odm->SupportICType == ODM_RTL8812 || pDM_Odm->SupportICType == ODM_RTL8821) - { - if(curRxOkCnt >(curTxOkCnt*6)) - H2C_Parameter[3]=0x01; - else - H2C_Parameter[3]=0x00; - } - - for(i = 0; i < ODM_ASSOCIATE_ENTRY_NUM; i++) - { - if(IsAPModeExist(Adapter) && GetFirstExtAdapter(Adapter) != NULL) - { - pEntry = AsocEntry_EnumStation(GetFirstExtAdapter(Adapter), i); - } - else - { - pEntry = AsocEntry_EnumStation(GetDefaultAdapter(Adapter), i); - } - - if(pEntry != NULL) - { - if(pEntry->bAssociated) - { - - RT_DISP_ADDR(FDM, DM_PWDB, ("pEntry->MacAddr ="), pEntry->MacAddr); - RT_DISP(FDM, DM_PWDB, ("pEntry->rssi = 0x%x(%d)\n", - pEntry->rssi_stat.UndecoratedSmoothedPWDB, pEntry->rssi_stat.UndecoratedSmoothedPWDB)); - - if(pDM_Odm->SupportICType == ODM_RTL8192E || pDM_Odm->SupportICType == ODM_RTL8812) - { - -#if (BEAMFORMING_SUPPORT == 1) - Beamform_cap = Beamforming_GetEntryBeamCapByMacId(pMgntInfo, pEntry->AssociatedMacId); - if(Beamform_cap & (BEAMFORMER_CAP_HT_EXPLICIT |BEAMFORMER_CAP_VHT_SU)) - TxBF_EN = 1; - else - TxBF_EN = 0; - - H2C_Parameter[3] |= TxBF_EN << 6; - - if(TxBF_EN) - STBC_TX = 0; - else -#endif - { - if(IS_WIRELESS_MODE_AC(Adapter)) - STBC_TX = TEST_FLAG(pEntry->VHTInfo.STBC, STBC_VHT_ENABLE_TX); - else - STBC_TX = TEST_FLAG(pEntry->HTInfo.STBC, STBC_HT_ENABLE_TX); - } - - H2C_Parameter[3] |= STBC_TX << 1; - } - - if(pEntry->rssi_stat.UndecoratedSmoothedPWDB < tmpEntryMinPWDB) - tmpEntryMinPWDB = pEntry->rssi_stat.UndecoratedSmoothedPWDB; - if(pEntry->rssi_stat.UndecoratedSmoothedPWDB > tmpEntryMaxPWDB) - tmpEntryMaxPWDB = pEntry->rssi_stat.UndecoratedSmoothedPWDB; - - H2C_Parameter[2] = (u1Byte)(pEntry->rssi_stat.UndecoratedSmoothedPWDB & 0xFF); - H2C_Parameter[1] = 0x20; // fw v12 cmdid 5:use max macid ,for nic ,default macid is 0 ,max macid is 1 - H2C_Parameter[0] = (pEntry->AssociatedMacId); - if(pDM_Odm->SupportICType == ODM_RTL8812) - ODM_FillH2CCmd(Adapter, ODM_H2C_RSSI_REPORT, 4, H2C_Parameter); - else if(pDM_Odm->SupportICType == ODM_RTL8192E) - ODM_FillH2CCmd(Adapter, ODM_H2C_RSSI_REPORT, 4, H2C_Parameter); - else - ODM_FillH2CCmd(Adapter, ODM_H2C_RSSI_REPORT, 3, H2C_Parameter); - } - } - else - { - break; - } - } - - if(tmpEntryMaxPWDB != 0) // If associated entry is found - { - pHalData->EntryMaxUndecoratedSmoothedPWDB = tmpEntryMaxPWDB; - RT_DISP(FDM, DM_PWDB, ("EntryMaxPWDB = 0x%x(%d)\n", tmpEntryMaxPWDB, tmpEntryMaxPWDB)); - } - else - { - pHalData->EntryMaxUndecoratedSmoothedPWDB = 0; - } - - if(tmpEntryMinPWDB != 0xff) // If associated entry is found - { - pHalData->EntryMinUndecoratedSmoothedPWDB = tmpEntryMinPWDB; - RT_DISP(FDM, DM_PWDB, ("EntryMinPWDB = 0x%x(%d)\n", tmpEntryMinPWDB, tmpEntryMinPWDB)); - - } - else - { - pHalData->EntryMinUndecoratedSmoothedPWDB = 0; - } - - // Indicate Rx signal strength to FW. - if(pHalData->bUseRAMask) - { - if(pDM_Odm->SupportICType == ODM_RTL8192E || pDM_Odm->SupportICType == ODM_RTL8812) - { - PRT_HIGH_THROUGHPUT pHTInfo = GET_HT_INFO(pMgntInfo); - PRT_VERY_HIGH_THROUGHPUT pVHTInfo = GET_VHT_INFO(pMgntInfo); - -#if (BEAMFORMING_SUPPORT == 1) - - Beamform_cap = Beamforming_GetEntryBeamCapByMacId(pMgntInfo, pMgntInfo->mMacId); - - if(Beamform_cap & (BEAMFORMER_CAP_HT_EXPLICIT |BEAMFORMER_CAP_VHT_SU)) - TxBF_EN = 1; - else - TxBF_EN = 0; - - H2C_Parameter[3] |= TxBF_EN << 6; - - if(TxBF_EN) - STBC_TX = 0; - else -#endif - { - if(IS_WIRELESS_MODE_AC(Adapter)) - STBC_TX = TEST_FLAG(pVHTInfo->VhtCurStbc, STBC_VHT_ENABLE_TX); - else - STBC_TX = TEST_FLAG(pHTInfo->HtCurStbc, STBC_HT_ENABLE_TX); - } - - H2C_Parameter[3] |= STBC_TX << 1; - } - - H2C_Parameter[2] = (u1Byte)(pHalData->UndecoratedSmoothedPWDB & 0xFF); - H2C_Parameter[1] = 0x20; // fw v12 cmdid 5:use max macid ,for nic ,default macid is 0 ,max macid is 1 - H2C_Parameter[0] = 0; // fw v12 cmdid 5:use max macid ,for nic ,default macid is 0 ,max macid is 1 - if(pDM_Odm->SupportICType == ODM_RTL8812) - ODM_FillH2CCmd(Adapter, ODM_H2C_RSSI_REPORT, 4, H2C_Parameter); - else if(pDM_Odm->SupportICType == ODM_RTL8192E) - ODM_FillH2CCmd(Adapter, ODM_H2C_RSSI_REPORT, 4, H2C_Parameter); - else - ODM_FillH2CCmd(Adapter, ODM_H2C_RSSI_REPORT, 3, H2C_Parameter); - } - else - { - PlatformEFIOWrite1Byte(Adapter, 0x4fe, (u1Byte)pHalData->UndecoratedSmoothedPWDB); - } - - if((pDM_Odm->SupportICType == ODM_RTL8812)||(pDM_Odm->SupportICType == ODM_RTL8192E)) - odm_RSSIDumpToRegister(pDM_Odm); - - odm_FindMinimumRSSI(Adapter); - ODM_CmnInfoUpdate(&pHalData->DM_OutSrc ,ODM_CMNINFO_LINK, (u8Byte)pHalData->bLinked); - ODM_CmnInfoUpdate(&pHalData->DM_OutSrc ,ODM_CMNINFO_RSSI_MIN, (u8Byte)pHalData->MinUndecoratedPWDBForDM); -#endif // #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) -} - -#if (DM_ODM_SUPPORT_TYPE == ODM_CE) -// -//sherry move from DUSC to here 20110517 -// -static VOID -FindMinimumRSSI_Dmsp( - IN PADAPTER pAdapter -) -{ -#if 0 - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); - struct dm_priv *pdmpriv = &pHalData->dmpriv; - s32 Rssi_val_min_back_for_mac0; - BOOLEAN bGetValueFromBuddyAdapter = dm_DualMacGetParameterFromBuddyAdapter(pAdapter); - BOOLEAN bRestoreRssi = _FALSE; - PADAPTER BuddyAdapter = pAdapter->BuddyAdapter; - - if(pHalData->MacPhyMode92D == DUALMAC_SINGLEPHY) - { - if(BuddyAdapter!= NULL) - { - if(pHalData->bSlaveOfDMSP) - { - //ODM_RT_TRACE(pDM_Odm,COMP_EASY_CONCURRENT,DBG_LOUD,("bSlavecase of dmsp\n")); - BuddyAdapter->DualMacDMSPControl.RssiValMinForAnotherMacOfDMSP = pdmpriv->MinUndecoratedPWDBForDM; - } - else - { - if(bGetValueFromBuddyAdapter) - { - //ODM_RT_TRACE(pDM_Odm,COMP_EASY_CONCURRENT,DBG_LOUD,("get new RSSI\n")); - bRestoreRssi = _TRUE; - Rssi_val_min_back_for_mac0 = pdmpriv->MinUndecoratedPWDBForDM; - pdmpriv->MinUndecoratedPWDBForDM = pAdapter->DualMacDMSPControl.RssiValMinForAnotherMacOfDMSP; - } - } - } - - } - - if(bRestoreRssi) - { - bRestoreRssi = _FALSE; - pdmpriv->MinUndecoratedPWDBForDM = Rssi_val_min_back_for_mac0; - } -#endif -} - -static void -FindMinimumRSSI( -IN PADAPTER pAdapter - ) -{ - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); - struct dm_priv *pdmpriv = &pHalData->dmpriv; - PDM_ODM_T pDM_Odm = &(pHalData->odmpriv); - - //1 1.Determine the minimum RSSI - - if((pDM_Odm->bLinked != _TRUE) && - (pdmpriv->EntryMinUndecoratedSmoothedPWDB == 0)) - { - pdmpriv->MinUndecoratedPWDBForDM = 0; - //ODM_RT_TRACE(pDM_Odm,COMP_BB_POWERSAVING, DBG_LOUD, ("Not connected to any \n")); - } - else - { - pdmpriv->MinUndecoratedPWDBForDM = pdmpriv->EntryMinUndecoratedSmoothedPWDB; - } - - //DBG_8192C("%s=>MinUndecoratedPWDBForDM(%d)\n",__FUNCTION__,pdmpriv->MinUndecoratedPWDBForDM); - //ODM_RT_TRACE(pDM_Odm,COMP_DIG, DBG_LOUD, ("MinUndecoratedPWDBForDM =%d\n",pHalData->MinUndecoratedPWDBForDM)); -} -#endif - -VOID -odm_RSSIMonitorCheckCE( - IN PDM_ODM_T pDM_Odm - ) -{ -#if (DM_ODM_SUPPORT_TYPE == ODM_CE) - PADAPTER Adapter = pDM_Odm->Adapter; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - struct dm_priv *pdmpriv = &pHalData->dmpriv; - struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(Adapter); - int i; - int tmpEntryMaxPWDB=0, tmpEntryMinPWDB=0xff; - u8 sta_cnt=0; - u8 UL_DL_STATE = 0, STBC_TX = 0; - u32 PWDB_rssi[NUM_STA]={0};//[0~15]:MACID, [16~31]:PWDB_rssi - BOOLEAN FirstConnect = FALSE; - pRA_T pRA_Table = &pDM_Odm->DM_RA_Table; - - if(pDM_Odm->bLinked != _TRUE) - return; - - #if((RTL8812A_SUPPORT==1)||(RTL8821A_SUPPORT==1)) - if((pDM_Odm->SupportICType == ODM_RTL8812)||(pDM_Odm->SupportICType == ODM_RTL8821)) - { - u64 curTxOkCnt = pdvobjpriv->traffic_stat.cur_tx_bytes; - u64 curRxOkCnt = pdvobjpriv->traffic_stat.cur_rx_bytes; - - if(curRxOkCnt >(curTxOkCnt*6)) - UL_DL_STATE = 1; - else - UL_DL_STATE = 0; - } - #endif - - FirstConnect = (pDM_Odm->bLinked) && (pRA_Table->firstconnect == FALSE); - pRA_Table->firstconnect = pDM_Odm->bLinked; - - //if(check_fwstate(&Adapter->mlmepriv, WIFI_AP_STATE|WIFI_ADHOC_STATE|WIFI_ADHOC_MASTER_STATE) == _TRUE) - { - #if 1 - struct sta_info *psta; - - for(i=0; ipODM_StaInfo[i])) - { - if(IS_MCAST( psta->hwaddr)) //if(psta->mac_id ==1) - continue; - - if(psta->rssi_stat.UndecoratedSmoothedPWDB == (-1)) - continue; - - if(psta->rssi_stat.UndecoratedSmoothedPWDB < tmpEntryMinPWDB) - tmpEntryMinPWDB = psta->rssi_stat.UndecoratedSmoothedPWDB; - - if(psta->rssi_stat.UndecoratedSmoothedPWDB > tmpEntryMaxPWDB) - tmpEntryMaxPWDB = psta->rssi_stat.UndecoratedSmoothedPWDB; - - #if 0 - DBG_871X("%s mac_id:%u, mac:"MAC_FMT", rssi:%d\n", __func__, - psta->mac_id, MAC_ARG(psta->hwaddr), psta->rssi_stat.UndecoratedSmoothedPWDB); - #endif - - if(psta->rssi_stat.UndecoratedSmoothedPWDB != (-1)) { - - #ifdef CONFIG_80211N_HT - if(pDM_Odm->SupportICType == ODM_RTL8192E || pDM_Odm->SupportICType == ODM_RTL8812) - { - #ifdef CONFIG_80211AC_VHT - if(IsSupportedVHT(psta->wireless_mode)) - STBC_TX = TEST_FLAG(psta->vhtpriv.stbc_cap, STBC_VHT_ENABLE_TX); - else - #endif - STBC_TX = TEST_FLAG(psta->htpriv.stbc_cap, STBC_HT_ENABLE_TX); - } - #endif - - if(pDM_Odm->SupportICType == ODM_RTL8192D) - PWDB_rssi[sta_cnt++] = (psta->mac_id | (psta->rssi_stat.UndecoratedSmoothedPWDB<<16) | ((Adapter->stapriv.asoc_sta_count+1) << 8)); - else if ((pDM_Odm->SupportICType == ODM_RTL8192E)||(pDM_Odm->SupportICType == ODM_RTL8812)||(pDM_Odm->SupportICType == ODM_RTL8821)) - PWDB_rssi[sta_cnt++] = (((u8)(psta->mac_id&0xFF)) | ((psta->rssi_stat.UndecoratedSmoothedPWDB&0x7F)<<16) | (STBC_TX << 25) | (FirstConnect << 29)); - else - PWDB_rssi[sta_cnt++] = (psta->mac_id | (psta->rssi_stat.UndecoratedSmoothedPWDB<<16) ); - } - } - } - #else - _irqL irqL; - _list *plist, *phead; - struct sta_info *psta; - struct sta_priv *pstapriv = &Adapter->stapriv; - u8 bcast_addr[ETH_ALEN]= {0xff,0xff,0xff,0xff,0xff,0xff}; - - _enter_critical_bh(&pstapriv->sta_hash_lock, &irqL); - - for(i=0; i< NUM_STA; i++) - { - phead = &(pstapriv->sta_hash[i]); - plist = get_next(phead); - - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) - { - psta = LIST_CONTAINOR(plist, struct sta_info, hash_list); - - plist = get_next(plist); - - if(_rtw_memcmp(psta->hwaddr, bcast_addr, ETH_ALEN) || - _rtw_memcmp(psta->hwaddr, myid(&Adapter->eeprompriv), ETH_ALEN)) - continue; - - if(psta->state & WIFI_ASOC_STATE) - { - - if(psta->rssi_stat.UndecoratedSmoothedPWDB < tmpEntryMinPWDB) - tmpEntryMinPWDB = psta->rssi_stat.UndecoratedSmoothedPWDB; - - if(psta->rssi_stat.UndecoratedSmoothedPWDB > tmpEntryMaxPWDB) - tmpEntryMaxPWDB = psta->rssi_stat.UndecoratedSmoothedPWDB; - - if(psta->rssi_stat.UndecoratedSmoothedPWDB != (-1)){ - //printk("%s==> mac_id(%d),rssi(%d)\n",__FUNCTION__,psta->mac_id,psta->rssi_stat.UndecoratedSmoothedPWDB); - #if(RTL8192D_SUPPORT==1) - PWDB_rssi[sta_cnt++] = (psta->mac_id | (psta->rssi_stat.UndecoratedSmoothedPWDB<<16) | ((Adapter->stapriv.asoc_sta_count+1) << 8)); - #else - PWDB_rssi[sta_cnt++] = (psta->mac_id | (psta->rssi_stat.UndecoratedSmoothedPWDB<<16) ); - #endif - } - } - - } - - } - - _exit_critical_bh(&pstapriv->sta_hash_lock, &irqL); - #endif - - //printk("%s==> sta_cnt(%d)\n",__FUNCTION__,sta_cnt); - - for(i=0; i< sta_cnt; i++) - { - if(PWDB_rssi[i] != (0)){ - if(pHalData->fw_ractrl == _TRUE)// Report every sta's RSSI to FW - { - #if(RTL8192D_SUPPORT==1) - if(pDM_Odm->SupportICType == ODM_RTL8192D){ - FillH2CCmd92D(Adapter, H2C_RSSI_REPORT, 3, (u8 *)(&PWDB_rssi[i])); - } - #endif - - #if((RTL8192C_SUPPORT==1)||(RTL8723A_SUPPORT==1)) - if((pDM_Odm->SupportICType == ODM_RTL8192C)||(pDM_Odm->SupportICType == ODM_RTL8723A)){ - rtl8192c_set_rssi_cmd(Adapter, (u8*)&PWDB_rssi[i]); - } - #endif - - #if((RTL8812A_SUPPORT==1)||(RTL8821A_SUPPORT==1)) - if((pDM_Odm->SupportICType == ODM_RTL8812)||(pDM_Odm->SupportICType == ODM_RTL8821)){ - PWDB_rssi[i] |= (UL_DL_STATE << 24); - rtl8812_set_rssi_cmd(Adapter, (u8 *)(&PWDB_rssi[i])); - } - #endif - #if(RTL8192E_SUPPORT==1) - if(pDM_Odm->SupportICType == ODM_RTL8192E){ - rtl8192e_set_rssi_cmd(Adapter, (u8 *)(&PWDB_rssi[i])); - } - #endif - #if(RTL8723B_SUPPORT==1) - if(pDM_Odm->SupportICType == ODM_RTL8723B){ - rtl8723b_set_rssi_cmd(Adapter, (u8 *)(&PWDB_rssi[i])); - } - #endif - } - else{ - #if((RTL8188E_SUPPORT==1)&&(RATE_ADAPTIVE_SUPPORT == 1)) - if(pDM_Odm->SupportICType == ODM_RTL8188E){ - ODM_RA_SetRSSI_8188E( - &(pHalData->odmpriv), (PWDB_rssi[i]&0xFF), (u8)((PWDB_rssi[i]>>16) & 0xFF)); - } - #endif - } - } - } - } - - - - if(tmpEntryMaxPWDB != 0) // If associated entry is found - { - pdmpriv->EntryMaxUndecoratedSmoothedPWDB = tmpEntryMaxPWDB; - } - else - { - pdmpriv->EntryMaxUndecoratedSmoothedPWDB = 0; - } - - if(tmpEntryMinPWDB != 0xff) // If associated entry is found - { - pdmpriv->EntryMinUndecoratedSmoothedPWDB = tmpEntryMinPWDB; - } - else - { - pdmpriv->EntryMinUndecoratedSmoothedPWDB = 0; - } - - FindMinimumRSSI(Adapter);//get pdmpriv->MinUndecoratedPWDBForDM - - #if(RTL8192D_SUPPORT==1) - FindMinimumRSSI_Dmsp(Adapter); - #endif - pDM_Odm->RSSI_Min = pdmpriv->MinUndecoratedPWDBForDM; - //ODM_CmnInfoUpdate(&pHalData->odmpriv ,ODM_CMNINFO_RSSI_MIN, pdmpriv->MinUndecoratedPWDBForDM); -#endif//if (DM_ODM_SUPPORT_TYPE == ODM_CE) -} -VOID -odm_RSSIMonitorCheckAP( - IN PDM_ODM_T pDM_Odm - ) -{ -#if (DM_ODM_SUPPORT_TYPE == ODM_AP) -#ifdef CONFIG_RTL_92C_SUPPORT || defined(CONFIG_RTL_92D_SUPPORT) - - u4Byte i; - PSTA_INFO_T pstat; - - for(i=0; ipODM_StaInfo[i]; - if(IS_STA_VALID(pstat) ) - { -#ifdef STA_EXT - if (REMAP_AID(pstat) < (FW_NUM_STAT - 1)) -#endif - add_update_rssi(pDM_Odm->priv, pstat); - - } - } -#endif -#endif - -} - - - -VOID -ODM_InitAllTimers( - IN PDM_ODM_T pDM_Odm - ) -{ -#if(defined(CONFIG_HW_ANTENNA_DIVERSITY)) -#if (RTL8723B_SUPPORT == 1)||(RTL8821A_SUPPORT == 1) - ODM_InitializeTimer(pDM_Odm,&pDM_Odm->DM_SWAT_Table.SwAntennaSwitchTimer_8723B, - (RT_TIMER_CALL_BACK)ODM_SW_AntDiv_Callback, NULL, "SwAntennaSwitchTimer_8723B"); -#endif -#endif - -#if(defined(CONFIG_SW_ANTENNA_DIVERSITY)) - ODM_InitializeTimer(pDM_Odm,&pDM_Odm->DM_SWAT_Table.SwAntennaSwitchTimer, - (RT_TIMER_CALL_BACK)odm_SwAntDivChkAntSwitchCallback, NULL, "SwAntennaSwitchTimer"); -#endif - -#if (!(DM_ODM_SUPPORT_TYPE == ODM_CE)) -#if(defined(CONFIG_HW_ANTENNA_DIVERSITY)) -#if (RTL8188E_SUPPORT == 1) - ODM_InitializeTimer(pDM_Odm,&pDM_Odm->FastAntTrainingTimer, - (RT_TIMER_CALL_BACK)odm_FastAntTrainingCallback, NULL, "FastAntTrainingTimer"); -#endif -#endif -#endif - -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - ODM_InitializeTimer(pDM_Odm, &pDM_Odm->PSDTimer, - (RT_TIMER_CALL_BACK)dm_PSDMonitorCallback, NULL, "PSDTimer"); - // - //Path Diversity - //Neil Chen--2011--06--16-- / 2012/02/23 MH Revise Arch. - // - ODM_InitializeTimer(pDM_Odm, &pDM_Odm->PathDivSwitchTimer, - (RT_TIMER_CALL_BACK)odm_PathDivChkAntSwitchCallback, NULL, "PathDivTimer"); - - ODM_InitializeTimer(pDM_Odm, &pDM_Odm->CCKPathDiversityTimer, - (RT_TIMER_CALL_BACK)odm_CCKTXPathDiversityCallback, NULL, "CCKPathDiversityTimer"); - - ODM_InitializeTimer(pDM_Odm, &pDM_Odm->MPT_DIGTimer, - (RT_TIMER_CALL_BACK)odm_MPT_DIGCallback, NULL, "MPT_DIGTimer"); - - ODM_InitializeTimer(pDM_Odm, &pDM_Odm->DM_RXHP_Table.PSDTimer, - (RT_TIMER_CALL_BACK)odm_PSD_RXHPCallback, NULL, "PSDRXHPTimer"); -#endif -} - -VOID -ODM_CancelAllTimers( - IN PDM_ODM_T pDM_Odm - ) -{ -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - // - // 2012/01/12 MH Temp BSOD fix. We need to find NIC allocate mem fail reason in - // win7 platform. - // - HAL_ADAPTER_STS_CHK(pDM_Odm) -#endif -#if(defined(CONFIG_HW_ANTENNA_DIVERSITY)) -#if (RTL8723B_SUPPORT == 1)||(RTL8821A_SUPPORT == 1) - ODM_CancelTimer(pDM_Odm,&pDM_Odm->DM_SWAT_Table.SwAntennaSwitchTimer_8723B); -#endif -#endif - -#if(defined(CONFIG_SW_ANTENNA_DIVERSITY)) - ODM_CancelTimer(pDM_Odm,&pDM_Odm->DM_SWAT_Table.SwAntennaSwitchTimer); -#endif - -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - -#if (RTL8188E_SUPPORT == 1) - ODM_CancelTimer(pDM_Odm,&pDM_Odm->FastAntTrainingTimer); -#endif - ODM_CancelTimer(pDM_Odm, &pDM_Odm->PSDTimer); - // - //Path Diversity - //Neil Chen--2011--06--16-- / 2012/02/23 MH Revise Arch. - // - ODM_CancelTimer(pDM_Odm, &pDM_Odm->PathDivSwitchTimer); - - ODM_CancelTimer(pDM_Odm, &pDM_Odm->CCKPathDiversityTimer); - - ODM_CancelTimer(pDM_Odm, &pDM_Odm->MPT_DIGTimer); - - ODM_CancelTimer(pDM_Odm, &pDM_Odm->DM_RXHP_Table.PSDTimer); -#endif -} - - -VOID -ODM_ReleaseAllTimers( - IN PDM_ODM_T pDM_Odm - ) -{ -#if(defined(CONFIG_HW_ANTENNA_DIVERSITY)) -#if (RTL8723B_SUPPORT == 1)||(RTL8821A_SUPPORT == 1) - ODM_ReleaseTimer(pDM_Odm,&pDM_Odm->DM_SWAT_Table.SwAntennaSwitchTimer_8723B); -#endif -#endif - -#if(defined(CONFIG_SW_ANTENNA_DIVERSITY)) - ODM_ReleaseTimer(pDM_Odm,&pDM_Odm->DM_SWAT_Table.SwAntennaSwitchTimer); -#endif - -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - -#if (RTL8188E_SUPPORT == 1) - ODM_ReleaseTimer(pDM_Odm,&pDM_Odm->FastAntTrainingTimer); -#endif - - ODM_ReleaseTimer(pDM_Odm, &pDM_Odm->PSDTimer); - // - //Path Diversity - //Neil Chen--2011--06--16-- / 2012/02/23 MH Revise Arch. - // - ODM_ReleaseTimer(pDM_Odm, &pDM_Odm->PathDivSwitchTimer); - - ODM_ReleaseTimer(pDM_Odm, &pDM_Odm->CCKPathDiversityTimer); - - ODM_ReleaseTimer(pDM_Odm, &pDM_Odm->MPT_DIGTimer); - - ODM_ReleaseTimer(pDM_Odm, &pDM_Odm->DM_RXHP_Table.PSDTimer); -#endif -} - - -//3============================================================ -//3 Tx Power Tracking -//3============================================================ - -VOID -odm_IQCalibrate( - IN PDM_ODM_T pDM_Odm - ) -{ - PADAPTER Adapter = pDM_Odm->Adapter; - - if(!IS_HARDWARE_TYPE_JAGUAR(Adapter)) - return; - else if(IS_HARDWARE_TYPE_8812AU(Adapter)) - return; -#if (RTL8821A_SUPPORT == 1) - if(pDM_Odm->bLinked) - { - if((*pDM_Odm->pChannel != pDM_Odm->preChannel) && (!*pDM_Odm->pbScanInProcess)) - { - pDM_Odm->preChannel = *pDM_Odm->pChannel; - pDM_Odm->LinkedInterval = 0; - } - - if(pDM_Odm->LinkedInterval < 3) - pDM_Odm->LinkedInterval++; - - if(pDM_Odm->LinkedInterval == 2) - { - // Mark out IQK flow to prevent tx stuck. by Maddest 20130306 - // Open it verified by James 20130715 - PHY_IQCalibrate_8821A(Adapter, FALSE); - } - } - else - pDM_Odm->LinkedInterval = 0; -#endif -} - - -VOID -odm_TXPowerTrackingInit( - IN PDM_ODM_T pDM_Odm - ) -{ - odm_TXPowerTrackingThermalMeterInit(pDM_Odm); -} - -u1Byte -getSwingIndex( - IN PDM_ODM_T pDM_Odm - ) -{ - PADAPTER Adapter = pDM_Odm->Adapter; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - u1Byte i = 0; - u4Byte bbSwing; - u4Byte swingTableSize; - pu4Byte pSwingTable; - - if (pDM_Odm->SupportICType == ODM_RTL8188E || pDM_Odm->SupportICType == ODM_RTL8723B || - pDM_Odm->SupportICType == ODM_RTL8192E) - { - bbSwing = PHY_QueryBBReg(Adapter, rOFDM0_XATxIQImbalance, 0xFFC00000); - - pSwingTable = OFDMSwingTable_New; - swingTableSize = OFDM_TABLE_SIZE; - } else { -#if ((RTL8812A_SUPPORT==1)||(RTL8821A_SUPPORT==1)) - if (pDM_Odm->SupportICType == ODM_RTL8812 || pDM_Odm->SupportICType == ODM_RTL8821) - { - bbSwing = PHY_GetTxBBSwing_8812A(Adapter, pHalData->CurrentBandType, ODM_RF_PATH_A); - pSwingTable = TxScalingTable_Jaguar; - swingTableSize = TXSCALE_TABLE_SIZE; - } - else -#endif - { - bbSwing = 0; - pSwingTable = OFDMSwingTable; - swingTableSize = OFDM_TABLE_SIZE; - } - } - - for (i = 0; i < swingTableSize; ++i) { - u4Byte tableValue = pSwingTable[i]; - - if (tableValue >= 0x100000 ) - tableValue >>= 22; - if (bbSwing == tableValue) - break; - } - return i; -} - -VOID -odm_TXPowerTrackingThermalMeterInit( - IN PDM_ODM_T pDM_Odm - ) -{ - u1Byte defaultSwingIndex = getSwingIndex(pDM_Odm); - u1Byte p = 0; -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - PADAPTER Adapter = pDM_Odm->Adapter; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - - #if MP_DRIVER != 1 //for mp driver, turn off txpwrtracking as default - pHalData->TxPowerTrackControl = TRUE; - #endif -#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) - PADAPTER Adapter = pDM_Odm->Adapter; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - - - if (pDM_Odm->SupportICType >= ODM_RTL8188E) - { - pDM_Odm->RFCalibrateInfo.bTXPowerTracking = _TRUE; - pDM_Odm->RFCalibrateInfo.TXPowercount = 0; - pDM_Odm->RFCalibrateInfo.bTXPowerTrackingInit = _FALSE; - //#if (MP_DRIVER != 1) //for mp driver, turn off txpwrtracking as default - if ( *(pDM_Odm->mp_mode) != 1) - pDM_Odm->RFCalibrateInfo.TxPowerTrackControl = _TRUE; - //#endif//#if (MP_DRIVER != 1) - MSG_8192C("pDM_Odm TxPowerTrackControl = %d\n", pDM_Odm->RFCalibrateInfo.TxPowerTrackControl); - } - else - { - struct dm_priv *pdmpriv = &pHalData->dmpriv; - - pdmpriv->bTXPowerTracking = _TRUE; - pdmpriv->TXPowercount = 0; - pdmpriv->bTXPowerTrackingInit = _FALSE; - //#if (MP_DRIVER != 1) //for mp driver, turn off txpwrtracking as default - - if (*(pDM_Odm->mp_mode) != 1) - pdmpriv->TxPowerTrackControl = _TRUE; - //#endif//#if (MP_DRIVER != 1) - - //MSG_8192C("pdmpriv->TxPowerTrackControl = %d\n", pdmpriv->TxPowerTrackControl); - } - -#elif (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) - #ifdef RTL8188E_SUPPORT - { - pDM_Odm->RFCalibrateInfo.bTXPowerTracking = _TRUE; - pDM_Odm->RFCalibrateInfo.TXPowercount = 0; - pDM_Odm->RFCalibrateInfo.bTXPowerTrackingInit = _FALSE; - pDM_Odm->RFCalibrateInfo.TxPowerTrackControl = _TRUE; - } - #endif -#endif - - pDM_Odm->RFCalibrateInfo.TxPowerTrackControl = TRUE; - pDM_Odm->RFCalibrateInfo.ThermalValue = pHalData->EEPROMThermalMeter; - pDM_Odm->RFCalibrateInfo.ThermalValue_IQK = pHalData->EEPROMThermalMeter; - pDM_Odm->RFCalibrateInfo.ThermalValue_LCK = pHalData->EEPROMThermalMeter; - - // The index of "0 dB" in SwingTable. - if (pDM_Odm->SupportICType == ODM_RTL8188E || pDM_Odm->SupportICType == ODM_RTL8723B || - pDM_Odm->SupportICType == ODM_RTL8192E) - { - pDM_Odm->DefaultOfdmIndex = (defaultSwingIndex >= OFDM_TABLE_SIZE) ? 30 : defaultSwingIndex; - pDM_Odm->DefaultCckIndex = 20; - } - else - { - pDM_Odm->DefaultOfdmIndex = (defaultSwingIndex >= TXSCALE_TABLE_SIZE) ? 24 : defaultSwingIndex; - pDM_Odm->DefaultCckIndex = 24; - } - - pDM_Odm->BbSwingIdxCckBase = pDM_Odm->DefaultCckIndex; - pDM_Odm->RFCalibrateInfo.CCK_index = pDM_Odm->DefaultCckIndex; - - for (p = ODM_RF_PATH_A; p < MAX_RF_PATH; ++p) - { - pDM_Odm->BbSwingIdxOfdmBase[p] = pDM_Odm->DefaultOfdmIndex; - pDM_Odm->RFCalibrateInfo.OFDM_index[p] = pDM_Odm->DefaultOfdmIndex; - pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[p] = 0; - pDM_Odm->RFCalibrateInfo.DeltaPowerIndexLast[p] = 0; - pDM_Odm->RFCalibrateInfo.PowerIndexOffset[p] = 0; - } - -} - - -VOID -ODM_TXPowerTrackingCheck( - IN PDM_ODM_T pDM_Odm - ) -{ - // - // 2011/09/29 MH In HW integration first stage, we provide 4 different handle to operate - // at the same time. In the stage2/3, we need to prive universal interface and merge all - // HW dynamic mechanism. - // - switch (pDM_Odm->SupportPlatform) - { - case ODM_WIN: - odm_TXPowerTrackingCheckMP(pDM_Odm); - break; - - case ODM_CE: - odm_TXPowerTrackingCheckCE(pDM_Odm); - break; - - case ODM_AP: - odm_TXPowerTrackingCheckAP(pDM_Odm); - break; - - case ODM_ADSL: - //odm_DIGAP(pDM_Odm); - break; - } - -} - -VOID -odm_TXPowerTrackingCheckCE( - IN PDM_ODM_T pDM_Odm - ) -{ -#if (DM_ODM_SUPPORT_TYPE == ODM_CE) - PADAPTER Adapter = pDM_Odm->Adapter; - #if( (RTL8192C_SUPPORT==1) || (RTL8723A_SUPPORT==1) ) - if(IS_HARDWARE_TYPE_8192C(Adapter)){ - rtl8192c_odm_CheckTXPowerTracking(Adapter); - return; - } - #endif - - #if (RTL8192D_SUPPORT==1) - if(IS_HARDWARE_TYPE_8192D(Adapter)){ - #if (RTL8192D_EASY_SMART_CONCURRENT == 1) - if(!Adapter->bSlaveOfDMSP) - #endif - rtl8192d_odm_CheckTXPowerTracking(Adapter); - return; - } - #endif - - #if(((RTL8188E_SUPPORT==1) || (RTL8812A_SUPPORT==1) || (RTL8821A_SUPPORT==1) || (RTL8192E_SUPPORT==1) || (RTL8723B_SUPPORT==1) )) - if(!(pDM_Odm->SupportAbility & ODM_RF_TX_PWR_TRACK)) - { - return; - } - - if(!pDM_Odm->RFCalibrateInfo.TM_Trigger) //at least delay 1 sec - { - //pHalData->TxPowerCheckCnt++; //cosa add for debug - if(IS_HARDWARE_TYPE_8188E(Adapter) || IS_HARDWARE_TYPE_JAGUAR(Adapter) || IS_HARDWARE_TYPE_8192E(Adapter)||IS_HARDWARE_TYPE_8723B(Adapter)) - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_T_METER_NEW, (BIT17 | BIT16), 0x03); - else - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_T_METER_OLD, bRFRegOffsetMask, 0x60); - - //DBG_871X("Trigger Thermal Meter!!\n"); - - pDM_Odm->RFCalibrateInfo.TM_Trigger = 1; - return; - } - else - { - //DBG_871X("Schedule TxPowerTracking direct call!!\n"); - ODM_TXPowerTrackingCallback_ThermalMeter(Adapter); - pDM_Odm->RFCalibrateInfo.TM_Trigger = 0; - } - #endif -#endif -} - -VOID -odm_TXPowerTrackingCheckMP( - IN PDM_ODM_T pDM_Odm - ) -{ -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - PADAPTER Adapter = pDM_Odm->Adapter; - - if (ODM_CheckPowerStatus(Adapter) == FALSE) - { - RT_TRACE(COMP_POWER_TRACKING, DBG_LOUD, ("===>ODM_CheckPowerStatus() return FALSE\n")); - return; - } - - if(IS_HARDWARE_TYPE_8723A(Adapter)) - return; - - if(!Adapter->bSlaveOfDMSP || Adapter->DualMacSmartConcurrent == FALSE) - odm_TXPowerTrackingThermalMeterCheck(Adapter); - else { - RT_TRACE(COMP_POWER_TRACKING, DBG_LOUD, ("!Adapter->bSlaveOfDMSP || Adapter->DualMacSmartConcurrent == FALSE\n")); - } -#endif - -} - - -VOID -odm_TXPowerTrackingCheckAP( - IN PDM_ODM_T pDM_Odm - ) -{ -#if (DM_ODM_SUPPORT_TYPE == ODM_AP) - prtl8192cd_priv priv = pDM_Odm->priv; - - if ( (priv->pmib->dot11RFEntry.ther) && ((priv->up_time % priv->pshare->rf_ft_var.tpt_period) == 0)){ -#ifdef CONFIG_RTL_92D_SUPPORT - if (GET_CHIP_VER(priv)==VERSION_8192D){ - tx_power_tracking_92D(priv); - } else -#endif - { -#ifdef CONFIG_RTL_92C_SUPPORT - tx_power_tracking(priv); -#endif - } - } -#endif - -} - - - -//antenna mapping info -// 1: right-side antenna -// 2/0: left-side antenna -//PDM_SWAT_Table->CCK_Ant1_Cnt /OFDM_Ant1_Cnt: for right-side antenna: Ant:1 RxDefaultAnt1 -//PDM_SWAT_Table->CCK_Ant2_Cnt /OFDM_Ant2_Cnt: for left-side antenna: Ant:0 RxDefaultAnt2 -// We select left antenna as default antenna in initial process, modify it as needed -// - -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - -VOID -odm_TXPowerTrackingThermalMeterCheck( - IN PADAPTER Adapter - ) -{ -#ifndef AP_BUILD_WORKAROUND - static u1Byte TM_Trigger = 0; - - if(!(GET_HAL_DATA(Adapter)->DM_OutSrc.SupportAbility & ODM_RF_TX_PWR_TRACK)) - { - RT_TRACE(COMP_POWER_TRACKING, DBG_LOUD, - ("===>odm_TXPowerTrackingThermalMeterCheck(),pMgntInfo->bTXPowerTracking is FALSE, return!!\n")); - return; - } - - if(!TM_Trigger) //at least delay 1 sec - { - if(IS_HARDWARE_TYPE_8192D(Adapter)) - PHY_SetRFReg(Adapter, ODM_RF_PATH_A, RF_T_METER_92D, BIT17 | BIT16, 0x03); - else if(IS_HARDWARE_TYPE_8188E(Adapter) || IS_HARDWARE_TYPE_JAGUAR(Adapter) || IS_HARDWARE_TYPE_8192E(Adapter) || - IS_HARDWARE_TYPE_8723B(Adapter)) - PHY_SetRFReg(Adapter, ODM_RF_PATH_A, RF_T_METER_88E, BIT17 | BIT16, 0x03); - else - PHY_SetRFReg(Adapter, ODM_RF_PATH_A, RF_T_METER, bRFRegOffsetMask, 0x60); - - RT_TRACE(COMP_POWER_TRACKING, DBG_LOUD,("Trigger Thermal Meter!!\n")); - - TM_Trigger = 1; - return; - } - else - { - RT_TRACE(COMP_POWER_TRACKING, DBG_LOUD,("Schedule TxPowerTracking direct call!!\n")); - odm_TXPowerTrackingDirectCall(Adapter); //Using direct call is instead, added by Roger, 2009.06.18. - TM_Trigger = 0; - } -#endif -} - -// Only for 8723A SW ANT DIV INIT--2012--07--17 -VOID -odm_SwAntDivInit_NIC_8723A( - IN PDM_ODM_T pDM_Odm) -{ - pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; - PADAPTER Adapter = pDM_Odm->Adapter; - - u1Byte btAntNum=BT_GetPgAntNum(Adapter); - - if(IS_HARDWARE_TYPE_8723A(Adapter)) - { - pDM_SWAT_Table->ANTA_ON =TRUE; - - // Set default antenna B status by PG - if(btAntNum == 2) - pDM_SWAT_Table->ANTB_ON = TRUE; - else if(btAntNum == 1) - pDM_SWAT_Table->ANTB_ON = FALSE; - else - pDM_SWAT_Table->ANTB_ON = TRUE; - } - -} - -#endif //end #ifMP - - - -//3============================================================ -//3 SW Antenna Diversity -//3============================================================ -#if(defined(CONFIG_SW_ANTENNA_DIVERSITY)) -VOID -odm_SwAntDivInit( - IN PDM_ODM_T pDM_Odm - ) -{ -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) - odm_SwAntDivInit_NIC(pDM_Odm); -#elif(DM_ODM_SUPPORT_TYPE == ODM_AP) - dm_SW_AntennaSwitchInit(pDM_Odm->priv); -#endif -} - -VOID -odm_SwAntDivInit_NIC( - IN PDM_ODM_T pDM_Odm - ) -{ - pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; - - -// Init SW ANT DIV mechanism for 8723AE/AU/AS -// Neil Chen--2012--07--17--- -// CE/AP/ADSL no using SW ANT DIV for 8723A Series IC -//#if (DM_ODM_SUPPORT_TYPE==ODM_WIN) -#if (RTL8723A_SUPPORT==1) - if(pDM_Odm->SupportICType == ODM_RTL8723A) - { - odm_SwAntDivInit_NIC_8723A(pDM_Odm); - } -#endif - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("SWAS:Init SW Antenna Switch\n")); - pDM_SWAT_Table->RSSI_sum_A = 0; - pDM_SWAT_Table->RSSI_cnt_A = 0; - pDM_SWAT_Table->RSSI_sum_B = 0; - pDM_SWAT_Table->RSSI_cnt_B = 0; - pDM_SWAT_Table->CurAntenna = MAIN_ANT; - pDM_SWAT_Table->PreAntenna = MAIN_ANT; - pDM_SWAT_Table->try_flag = 0xff; - pDM_SWAT_Table->PreRSSI = 0; - pDM_SWAT_Table->SWAS_NoLink_State = 0; - pDM_SWAT_Table->bTriggerAntennaSwitch = 0; - pDM_SWAT_Table->SelectAntennaMap=0xAA; - pDM_SWAT_Table->lastTxOkCnt = 0; - pDM_SWAT_Table->lastRxOkCnt = 0; - pDM_SWAT_Table->TXByteCnt_A = 0; - pDM_SWAT_Table->TXByteCnt_B = 0; - pDM_SWAT_Table->RXByteCnt_A = 0; - pDM_SWAT_Table->RXByteCnt_B = 0; - pDM_SWAT_Table->TrafficLoad = TRAFFIC_LOW; - pDM_SWAT_Table->SWAS_NoLink_BK_Reg860 = ODM_Read4Byte(pDM_Odm, 0x860); - -} - -// -// 20100514 Joseph: -// Add new function to reset the state of antenna diversity before link. -// -VOID -ODM_SwAntDivResetBeforeLink( - IN PDM_ODM_T pDM_Odm - ) -{ - - pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; - - pDM_SWAT_Table->SWAS_NoLink_State = 0; - -} - -// -// 20100514 Luke/Joseph: -// Add new function to reset antenna diversity state after link. -// -VOID -ODM_SwAntDivRestAfterLink( - IN PDM_ODM_T pDM_Odm - ) -{ - pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; - pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; - u4Byte i; - - if(pDM_Odm->SupportICType == ODM_RTL8723A) - { - pDM_SWAT_Table->RSSI_cnt_A = 0; - pDM_SWAT_Table->RSSI_cnt_B = 0; - pDM_Odm->RSSI_test = FALSE; - pDM_SWAT_Table->try_flag = 0xff; - pDM_SWAT_Table->RSSI_Trying = 0; - pDM_SWAT_Table->SelectAntennaMap=0xAA; - - } - else if(pDM_Odm->SupportICType & (ODM_RTL8723B|ODM_RTL8821)) - { - pDM_Odm->RSSI_test = FALSE; - pDM_SWAT_Table->try_flag = 0xff; - pDM_SWAT_Table->RSSI_Trying = 0; - pDM_SWAT_Table->Double_chk_flag= 0; - - pDM_FatTable->RxIdleAnt=MAIN_ANT; - - for (i=0; iMainAnt_Sum[i] = 0; - pDM_FatTable->AuxAnt_Sum[i] = 0; - pDM_FatTable->MainAnt_Cnt[i] = 0; - pDM_FatTable->AuxAnt_Cnt[i] = 0; - } - - } -} - -void -odm_SwAntDetectInit( - IN PDM_ODM_T pDM_Odm - ) -{ - pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; -#if (RTL8723B_SUPPORT == 1) - pDM_SWAT_Table->SWAS_NoLink_BK_Reg92c = ODM_Read4Byte(pDM_Odm, rDPDT_control); -#endif - pDM_SWAT_Table->PreAntenna = MAIN_ANT; - pDM_SWAT_Table->CurAntenna = MAIN_ANT; - pDM_SWAT_Table->SWAS_NoLink_State = 0; -} - -VOID -ODM_SwAntDivChkPerPktRssi( - IN PDM_ODM_T pDM_Odm, - IN u1Byte StationID, - IN PODM_PHY_INFO_T pPhyInfo - ) -{ - SWAT_T *pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; - - if(!(pDM_Odm->SupportAbility & (ODM_BB_ANT_DIV))) - return; - -// temporary Fix 8723A MP SW ANT DIV Bug --NeilChen--2012--07--11 -#if (DM_ODM_SUPPORT_TYPE==ODM_WIN) - if(pDM_Odm->SupportICType == ODM_RTL8723A) - { - //if(StationID == pDM_SWAT_Table->RSSI_target) - //{ - //1 RSSI for SW Antenna Switch - if(pDM_SWAT_Table->CurAntenna == MAIN_ANT) - { - pDM_SWAT_Table->RSSI_sum_A += pPhyInfo->RxPWDBAll; - pDM_SWAT_Table->RSSI_cnt_A++; - } - else - { - pDM_SWAT_Table->RSSI_sum_B += pPhyInfo->RxPWDBAll; - pDM_SWAT_Table->RSSI_cnt_B++; - - } - //} - } - else - { - if(StationID == pDM_SWAT_Table->RSSI_target) - { - //1 RSSI for SW Antenna Switch - if(pDM_SWAT_Table->CurAntenna == MAIN_ANT) - { - pDM_SWAT_Table->RSSI_sum_A += pPhyInfo->RxPWDBAll; - pDM_SWAT_Table->RSSI_cnt_A++; - } - else - { - pDM_SWAT_Table->RSSI_sum_B += pPhyInfo->RxPWDBAll; - pDM_SWAT_Table->RSSI_cnt_B++; - - } - } - } -#else - if(StationID == pDM_SWAT_Table->RSSI_target) - { - //1 RSSI for SW Antenna Switch - if(pDM_SWAT_Table->CurAntenna == MAIN_ANT) - { - pDM_SWAT_Table->RSSI_sum_A += pPhyInfo->RxPWDBAll; - pDM_SWAT_Table->RSSI_cnt_A++; - } - else - { - pDM_SWAT_Table->RSSI_sum_B += pPhyInfo->RxPWDBAll; - pDM_SWAT_Table->RSSI_cnt_B++; - - } - } -#endif -} - -// -VOID -odm_SwAntDivChkAntSwitch( - IN PDM_ODM_T pDM_Odm, - IN u1Byte Step - ) -{ - // - // For AP/ADSL use prtl8192cd_priv - // For CE/NIC use PADAPTER - // - prtl8192cd_priv priv = pDM_Odm->priv; - - // - // 2011/09/29 MH In HW integration first stage, we provide 4 different handle to operate - // at the same time. In the stage2/3, we need to prive universal interface and merge all - // HW dynamic mechanism. - // - switch (pDM_Odm->SupportPlatform) - { - case ODM_WIN: - odm_SwAntDivChkAntSwitchNIC(pDM_Odm, Step); - break; - case ODM_CE: - odm_SwAntDivChkAntSwitchNIC(pDM_Odm, Step); - break; - - case ODM_AP: - case ODM_ADSL: -#if (DM_ODM_SUPPORT_TYPE & (ODM_AP |ODM_ADSL)) - if (priv->pshare->rf_ft_var.antSw_enable && (priv->up_time % 4==1)) - dm_SW_AntennaSwitch(priv, SWAW_STEP_PEAK); -#endif - break; - } - -} - -// -// 20100514 Luke/Joseph: -// Add new function for antenna diversity after link. -// This is the main function of antenna diversity after link. -// This function is called in HalDmWatchDog() and ODM_SwAntDivChkAntSwitchCallback(). -// HalDmWatchDog() calls this function with SWAW_STEP_PEAK to initialize the antenna test. -// In SWAW_STEP_PEAK, another antenna and a 500ms timer will be set for testing. -// After 500ms, ODM_SwAntDivChkAntSwitchCallback() calls this function to compare the signal just -// listened on the air with the RSSI of original antenna. -// It chooses the antenna with better RSSI. -// There is also a aged policy for error trying. Each error trying will cost more 5 seconds waiting -// penalty to get next try. - - -VOID -ODM_SetAntenna( - IN PDM_ODM_T pDM_Odm, - IN u1Byte Antenna) -{ - ODM_SetBBReg(pDM_Odm, 0x860, BIT8|BIT9, Antenna); -} - -VOID -odm_SwAntDivChkAntSwitchNIC( - IN PDM_ODM_T pDM_Odm, - IN u1Byte Step - ) -{ -#if ((RTL8192C_SUPPORT==1)||(RTL8723A_SUPPORT==1)) - //PMGNT_INFO pMgntInfo = &(Adapter->MgntInfo); - //HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - -#if (DM_ODM_SUPPORT_TYPE==ODM_WIN) - PADAPTER Adapter=pDM_Odm->Adapter; -#endif - - pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; - s4Byte curRSSI=100, RSSI_A, RSSI_B; - u1Byte nextAntenna=AUX_ANT; - //static u8Byte lastTxOkCnt=0, lastRxOkCnt=0; - u8Byte curTxOkCnt=0, curRxOkCnt=0; - //static u8Byte TXByteCnt_A=0, TXByteCnt_B=0, RXByteCnt_A=0, RXByteCnt_B=0; - u8Byte CurByteCnt=0, PreByteCnt=0; - //static u1Byte TrafficLoad = TRAFFIC_LOW; - u1Byte Score_A=0, Score_B=0; //A: Main; B: AUX - u1Byte i; - - if(!(pDM_Odm->SupportAbility & ODM_BB_ANT_DIV)) - return; - - if (pDM_Odm->SupportICType & (ODM_RTL8192D|ODM_RTL8188E)) - return; - - if((pDM_Odm->SupportICType == ODM_RTL8192C) &&(pDM_Odm->RFType == ODM_2T2R)) - return; - - if(pDM_Odm->SupportPlatform & ODM_WIN) - { - if(*(pDM_Odm->pAntennaTest)) - return; - } - - if((pDM_SWAT_Table->ANTA_ON == FALSE) ||(pDM_SWAT_Table->ANTB_ON == FALSE)) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, - ("odm_SwAntDivChkAntSwitch(): No AntDiv Mechanism, Antenna A or B is off\n")); - return; - } - - // Radio off: Status reset to default and return. - if(*(pDM_Odm->pbPowerSaving)==TRUE) //pHalData->eRFPowerState==eRfOff - { - ODM_SwAntDivRestAfterLink(pDM_Odm); - return; - } - - - // Handling step mismatch condition. - // Peak step is not finished at last time. Recover the variable and check again. - if( Step != pDM_SWAT_Table->try_flag ) - { - ODM_SwAntDivRestAfterLink(pDM_Odm); - } - -#if (DM_ODM_SUPPORT_TYPE &( ODM_WIN| ODM_CE )) - - if(pDM_SWAT_Table->try_flag == 0xff) - { - pDM_SWAT_Table->RSSI_target = 0xff; - - #if(DM_ODM_SUPPORT_TYPE & ODM_CE) - { - u1Byte index = 0; - PSTA_INFO_T pEntry = NULL; - - - for(index=0; indexpODM_StaInfo[index]; - if(IS_STA_VALID(pEntry) ) { - break; - } - } - if(pEntry == NULL) - { - ODM_SwAntDivRestAfterLink(pDM_Odm); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("odm_SwAntDivChkAntSwitch(): No Link.\n")); - return; - } - else - { - pDM_SWAT_Table->RSSI_target = index; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("odm_SwAntDivChkAntSwitch(): RSSI_target is PEER STA\n")); - } - } - #elif (DM_ODM_SUPPORT_TYPE & ODM_WIN) - { - PADAPTER pAdapter = pDM_Odm->Adapter; - PMGNT_INFO pMgntInfo=&pAdapter->MgntInfo; - - // Select RSSI checking target - if(pMgntInfo->mAssoc && !ACTING_AS_AP(pAdapter)) - { - // Target: Infrastructure mode AP. - //pDM_SWAT_Table->RSSI_target = NULL; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("odm_SwAntDivChkAntSwitch(): RSSI_target is DEF AP!\n")); - } - else - { - u1Byte index = 0; - PSTA_INFO_T pEntry = NULL; - PADAPTER pTargetAdapter = NULL; - - if(pMgntInfo->mIbss ) - { - // Target: AP/IBSS peer. - pTargetAdapter = pAdapter; - } - else - { - pTargetAdapter = GetFirstAPAdapter(pAdapter); - } - - if(pTargetAdapter != NULL) - { - for(index=0; indexbAssociated) - break; - } - - } - - } - - if(pEntry == NULL) - { - ODM_SwAntDivRestAfterLink(pDM_Odm); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("odm_SwAntDivChkAntSwitch(): No Link.\n")); - return; - } - else - { - //pDM_SWAT_Table->RSSI_target = pEntry; - pDM_SWAT_Table->RSSI_target = index; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("odm_SwAntDivChkAntSwitch(): RSSI_target is PEER STA\n")); - } - }//end if(pMgntInfo->mAssoc && !ACTING_AS_AP(Adapter)) - - } - #endif - - pDM_SWAT_Table->RSSI_cnt_A = 0; - pDM_SWAT_Table->RSSI_cnt_B = 0; - pDM_SWAT_Table->try_flag = 0; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("odm_SwAntDivChkAntSwitch(): Set try_flag to 0 prepare for peak!\n")); - return; - } - else - { - -// To Fix 8723A SW ANT DIV Bug issue -#if (DM_ODM_SUPPORT_TYPE==ODM_WIN) - if (pDM_Odm->SupportICType & ODM_RTL8723A) - { - curTxOkCnt = Adapter->TxStats.NumTxBytesUnicast - pDM_SWAT_Table->lastTxOkCnt; - curRxOkCnt =Adapter->RxStats.NumRxBytesUnicast - pDM_SWAT_Table->lastRxOkCnt; - pDM_SWAT_Table->lastTxOkCnt = Adapter->TxStats.NumTxBytesUnicast; - pDM_SWAT_Table->lastRxOkCnt = Adapter->RxStats.NumRxBytesUnicast; - } -#else - curTxOkCnt = *(pDM_Odm->pNumTxBytesUnicast) - pDM_SWAT_Table->lastTxOkCnt; - curRxOkCnt = *(pDM_Odm->pNumRxBytesUnicast) - pDM_SWAT_Table->lastRxOkCnt; - pDM_SWAT_Table->lastTxOkCnt = *(pDM_Odm->pNumTxBytesUnicast); - pDM_SWAT_Table->lastRxOkCnt = *(pDM_Odm->pNumRxBytesUnicast); -#endif - if(pDM_SWAT_Table->try_flag == 1) - { - if(pDM_SWAT_Table->CurAntenna == MAIN_ANT) - { - pDM_SWAT_Table->TXByteCnt_A += curTxOkCnt; - pDM_SWAT_Table->RXByteCnt_A += curRxOkCnt; - } - else - { - pDM_SWAT_Table->TXByteCnt_B += curTxOkCnt; - pDM_SWAT_Table->RXByteCnt_B += curRxOkCnt; - } - - nextAntenna = (pDM_SWAT_Table->CurAntenna == MAIN_ANT)? AUX_ANT : MAIN_ANT; - pDM_SWAT_Table->RSSI_Trying--; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("RSSI_Trying = %d\n",pDM_SWAT_Table->RSSI_Trying)); - if(pDM_SWAT_Table->RSSI_Trying == 0) - { - CurByteCnt = (pDM_SWAT_Table->CurAntenna == MAIN_ANT)? (pDM_SWAT_Table->TXByteCnt_A+pDM_SWAT_Table->RXByteCnt_A) : (pDM_SWAT_Table->TXByteCnt_B+pDM_SWAT_Table->RXByteCnt_B); - PreByteCnt = (pDM_SWAT_Table->CurAntenna == MAIN_ANT)? (pDM_SWAT_Table->TXByteCnt_B+pDM_SWAT_Table->RXByteCnt_B) : (pDM_SWAT_Table->TXByteCnt_A+pDM_SWAT_Table->RXByteCnt_A); - - if(pDM_SWAT_Table->TrafficLoad == TRAFFIC_HIGH) - //CurByteCnt = PlatformDivision64(CurByteCnt, 9); - PreByteCnt = PreByteCnt*9; - else if(pDM_SWAT_Table->TrafficLoad == TRAFFIC_LOW) - //CurByteCnt = PlatformDivision64(CurByteCnt, 2); - PreByteCnt = PreByteCnt*2; - - if(pDM_SWAT_Table->RSSI_cnt_A > 0) - RSSI_A = pDM_SWAT_Table->RSSI_sum_A/pDM_SWAT_Table->RSSI_cnt_A; - else - RSSI_A = 0; - if(pDM_SWAT_Table->RSSI_cnt_B > 0) - RSSI_B = pDM_SWAT_Table->RSSI_sum_B/pDM_SWAT_Table->RSSI_cnt_B; - else - RSSI_B = 0; - curRSSI = (pDM_SWAT_Table->CurAntenna == MAIN_ANT)? RSSI_A : RSSI_B; - pDM_SWAT_Table->PreRSSI = (pDM_SWAT_Table->CurAntenna == MAIN_ANT)? RSSI_B : RSSI_A; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Luke:PreRSSI = %d, CurRSSI = %d\n",pDM_SWAT_Table->PreRSSI, curRSSI)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("SWAS: preAntenna= %s, curAntenna= %s \n", - (pDM_SWAT_Table->PreAntenna == MAIN_ANT?"MAIN":"AUX"), (pDM_SWAT_Table->CurAntenna == MAIN_ANT?"MAIN":"AUX"))); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Luke:RSSI_A= %d, RSSI_cnt_A = %d, RSSI_B= %d, RSSI_cnt_B = %d\n", - RSSI_A, pDM_SWAT_Table->RSSI_cnt_A, RSSI_B, pDM_SWAT_Table->RSSI_cnt_B)); - } - - } - else - { - - if(pDM_SWAT_Table->RSSI_cnt_A > 0) - RSSI_A = pDM_SWAT_Table->RSSI_sum_A/pDM_SWAT_Table->RSSI_cnt_A; - else - RSSI_A = 0; - if(pDM_SWAT_Table->RSSI_cnt_B > 0) - RSSI_B = pDM_SWAT_Table->RSSI_sum_B/pDM_SWAT_Table->RSSI_cnt_B; - else - RSSI_B = 0; - curRSSI = (pDM_SWAT_Table->CurAntenna == MAIN_ANT)? RSSI_A : RSSI_B; - pDM_SWAT_Table->PreRSSI = (pDM_SWAT_Table->PreAntenna == MAIN_ANT)? RSSI_A : RSSI_B; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Ekul:PreRSSI = %d, CurRSSI = %d\n", pDM_SWAT_Table->PreRSSI, curRSSI)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("SWAS: preAntenna= %s, curAntenna= %s \n", - (pDM_SWAT_Table->PreAntenna == MAIN_ANT?"MAIN":"AUX"), (pDM_SWAT_Table->CurAntenna == MAIN_ANT?"MAIN":"AUX"))); - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Ekul:RSSI_A= %d, RSSI_cnt_A = %d, RSSI_B= %d, RSSI_cnt_B = %d\n", - RSSI_A, pDM_SWAT_Table->RSSI_cnt_A, RSSI_B, pDM_SWAT_Table->RSSI_cnt_B)); - //RT_TRACE(COMP_SWAS, DBG_LOUD, ("Ekul:curTxOkCnt = %d\n", curTxOkCnt)); - //RT_TRACE(COMP_SWAS, DBG_LOUD, ("Ekul:curRxOkCnt = %d\n", curRxOkCnt)); - } - - //1 Trying State - if((pDM_SWAT_Table->try_flag == 1)&&(pDM_SWAT_Table->RSSI_Trying == 0)) - { - - if(pDM_SWAT_Table->TestMode == TP_MODE) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("SWAS: TestMode = TP_MODE")); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("TRY:CurByteCnt = %lld,", CurByteCnt)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("TRY:PreByteCnt = %lld\n",PreByteCnt)); - if(CurByteCnt < PreByteCnt) - { - if(pDM_SWAT_Table->CurAntenna == MAIN_ANT) - pDM_SWAT_Table->SelectAntennaMap=pDM_SWAT_Table->SelectAntennaMap<<1; - else - pDM_SWAT_Table->SelectAntennaMap=(pDM_SWAT_Table->SelectAntennaMap<<1)+1; - } - else - { - if(pDM_SWAT_Table->CurAntenna == MAIN_ANT) - pDM_SWAT_Table->SelectAntennaMap=(pDM_SWAT_Table->SelectAntennaMap<<1)+1; - else - pDM_SWAT_Table->SelectAntennaMap=pDM_SWAT_Table->SelectAntennaMap<<1; - } - for (i= 0; i<8; i++) - { - if(((pDM_SWAT_Table->SelectAntennaMap>>i)&BIT0) == 1) - Score_A++; - else - Score_B++; - } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("SelectAntennaMap=%x\n ",pDM_SWAT_Table->SelectAntennaMap)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Score_A=%d, Score_B=%d\n", Score_A, Score_B)); - - if(pDM_SWAT_Table->CurAntenna == MAIN_ANT) - { - nextAntenna = (Score_A > Score_B)?MAIN_ANT:AUX_ANT; - } - else - { - nextAntenna = (Score_B > Score_A)?AUX_ANT:MAIN_ANT; - } - //RT_TRACE(COMP_SWAS, DBG_LOUD, ("nextAntenna=%s\n",(nextAntenna==Antenna_A)?"A":"B")); - //RT_TRACE(COMP_SWAS, DBG_LOUD, ("preAntenna= %s, curAntenna= %s \n", - //(DM_SWAT_Table.PreAntenna == Antenna_A?"A":"B"), (DM_SWAT_Table.CurAntenna == Antenna_A?"A":"B"))); - - if(nextAntenna != pDM_SWAT_Table->CurAntenna) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("SWAS: Switch back to another antenna")); - } - else - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("SWAS: current anntena is good\n")); - } - } - - if(pDM_SWAT_Table->TestMode == RSSI_MODE) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("SWAS: TestMode = RSSI_MODE")); - pDM_SWAT_Table->SelectAntennaMap=0xAA; - if(curRSSI < pDM_SWAT_Table->PreRSSI) //Current antenna is worse than previous antenna - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("SWAS: Switch back to another antenna")); - nextAntenna = (pDM_SWAT_Table->CurAntenna == MAIN_ANT)? AUX_ANT : MAIN_ANT; - } - else // current anntena is good - { - nextAntenna =pDM_SWAT_Table->CurAntenna; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("SWAS: current anntena is good\n")); - } - } - pDM_SWAT_Table->try_flag = 0; - pDM_Odm->RSSI_test = FALSE; - pDM_SWAT_Table->RSSI_sum_A = 0; - pDM_SWAT_Table->RSSI_cnt_A = 0; - pDM_SWAT_Table->RSSI_sum_B = 0; - pDM_SWAT_Table->RSSI_cnt_B = 0; - pDM_SWAT_Table->TXByteCnt_A = 0; - pDM_SWAT_Table->TXByteCnt_B = 0; - pDM_SWAT_Table->RXByteCnt_A = 0; - pDM_SWAT_Table->RXByteCnt_B = 0; - - } - - //1 Normal State - else if(pDM_SWAT_Table->try_flag == 0) - { - if(pDM_SWAT_Table->TrafficLoad == TRAFFIC_HIGH) - { - if ((curTxOkCnt+curRxOkCnt) > 3750000)//if(PlatformDivision64(curTxOkCnt+curRxOkCnt, 2) > 1875000) - pDM_SWAT_Table->TrafficLoad = TRAFFIC_HIGH; - else - pDM_SWAT_Table->TrafficLoad = TRAFFIC_LOW; - } - else if(pDM_SWAT_Table->TrafficLoad == TRAFFIC_LOW) - { - if ((curTxOkCnt+curRxOkCnt) > 3750000) //if(PlatformDivision64(curTxOkCnt+curRxOkCnt, 2) > 1875000) - pDM_SWAT_Table->TrafficLoad = TRAFFIC_HIGH; - else - pDM_SWAT_Table->TrafficLoad = TRAFFIC_LOW; - } - if(pDM_SWAT_Table->TrafficLoad == TRAFFIC_HIGH) - pDM_SWAT_Table->bTriggerAntennaSwitch = 0; - //RT_TRACE(COMP_SWAS, DBG_LOUD, ("Normal:TrafficLoad = %llu\n", curTxOkCnt+curRxOkCnt)); - - //Prepare To Try Antenna - nextAntenna = (pDM_SWAT_Table->CurAntenna == MAIN_ANT)? AUX_ANT : MAIN_ANT; - pDM_SWAT_Table->try_flag = 1; - pDM_Odm->RSSI_test = TRUE; - if((curRxOkCnt+curTxOkCnt) > 1000) - { - pDM_SWAT_Table->RSSI_Trying = 4; - pDM_SWAT_Table->TestMode = TP_MODE; - } - else - { - pDM_SWAT_Table->RSSI_Trying = 2; - pDM_SWAT_Table->TestMode = RSSI_MODE; - - } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("SWAS: Normal State -> Begin Trying!\n")); - - - pDM_SWAT_Table->RSSI_sum_A = 0; - pDM_SWAT_Table->RSSI_cnt_A = 0; - pDM_SWAT_Table->RSSI_sum_B = 0; - pDM_SWAT_Table->RSSI_cnt_B = 0; - } - } - - //1 4.Change TRX antenna - if(nextAntenna != pDM_SWAT_Table->CurAntenna) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("SWAS: Change TX Antenna!\n ")); - //PHY_SetBBReg(Adapter, rFPGA0_XA_RFInterfaceOE, 0x300, nextAntenna); - #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - ODM_SetAntenna(pDM_Odm,nextAntenna); - #elif (DM_ODM_SUPPORT_TYPE == ODM_CE) - { - BOOLEAN bEnqueue; - bEnqueue = (pDM_Odm->SupportInterface == ODM_ITRF_PCIE)?FALSE :TRUE; - rtw_antenna_select_cmd(pDM_Odm->Adapter, nextAntenna, bEnqueue); - } - #endif - - } - - //1 5.Reset Statistics - pDM_SWAT_Table->PreAntenna = pDM_SWAT_Table->CurAntenna; - pDM_SWAT_Table->CurAntenna = nextAntenna; - pDM_SWAT_Table->PreRSSI = curRSSI; - - //1 6.Set next timer - { - //PADAPTER pAdapter = pDM_Odm->Adapter; - //HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); - - - if(pDM_SWAT_Table->RSSI_Trying == 0) - return; - - if(pDM_SWAT_Table->RSSI_Trying%2 == 0) - { - if(pDM_SWAT_Table->TestMode == TP_MODE) - { - if(pDM_SWAT_Table->TrafficLoad == TRAFFIC_HIGH) - { - ODM_SetTimer(pDM_Odm,&pDM_SWAT_Table->SwAntennaSwitchTimer, 10 ); //ms - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("dm_SW_AntennaSwitch(): Test another antenna for 10 ms\n")); - } - else if(pDM_SWAT_Table->TrafficLoad == TRAFFIC_LOW) - { - ODM_SetTimer(pDM_Odm,&pDM_SWAT_Table->SwAntennaSwitchTimer, 50 ); //ms - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("dm_SW_AntennaSwitch(): Test another antenna for 50 ms\n")); - } - } - else - { - ODM_SetTimer(pDM_Odm,&pDM_SWAT_Table->SwAntennaSwitchTimer, 500 ); //ms - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("dm_SW_AntennaSwitch(): Test another antenna for 500 ms\n")); - } - } - else - { - if(pDM_SWAT_Table->TestMode == TP_MODE) - { - if(pDM_SWAT_Table->TrafficLoad == TRAFFIC_HIGH) - ODM_SetTimer(pDM_Odm,&pDM_SWAT_Table->SwAntennaSwitchTimer, 90 ); //ms - else if(pDM_SWAT_Table->TrafficLoad == TRAFFIC_LOW) - ODM_SetTimer(pDM_Odm,&pDM_SWAT_Table->SwAntennaSwitchTimer, 100 ); //ms - } - else - ODM_SetTimer(pDM_Odm,&pDM_SWAT_Table->SwAntennaSwitchTimer, 500 ); //ms - } - } -#endif // #if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) -#endif // #if (RTL8192C_SUPPORT==1) -} - - -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - -u1Byte -odm_SwAntDivSelectScanChnl( - IN PADAPTER Adapter - ) -{ -#if (RT_MEM_SIZE_LEVEL != RT_MEM_SIZE_MINIMUM) - PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter); - PMGNT_INFO pMgntInfo = &(Adapter->MgntInfo); - PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; - u1Byte i, j, ScanChannel = 0, ChannelNum = 0; - PRT_CHANNEL_LIST pChannelList = GET_RT_CHANNEL_LIST(pMgntInfo); - u1Byte EachChannelSTAs[MAX_SCAN_CHANNEL_NUM] = {0}; - - if(pMgntInfo->tmpNumBssDesc == 0) - return 0; - - for(i = 0; i < pMgntInfo->tmpNumBssDesc; i++) - { - ChannelNum = pMgntInfo->tmpbssDesc[i].ChannelNumber; - for(j = 0; j < pChannelList->ChannelLen; j++) - { - if(pChannelList->ChnlListEntry[j].ChannelNum == ChannelNum) - { - EachChannelSTAs[j]++; - break; - } - } - } - - for(i = 0; i < MAX_SCAN_CHANNEL_NUM; i++) - { - if(EachChannelSTAs[i] > EachChannelSTAs[ScanChannel]) - ScanChannel = i; - } - - if(EachChannelSTAs[ScanChannel] == 0) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, DBG_LOUD, ("odm_SwAntDivSelectScanChnl(): Scan List is empty.\n")); - return 0; - } - - ScanChannel = pChannelList->ChnlListEntry[ScanChannel].ChannelNum; - - - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, DBG_LOUD, - ("odm_SwAntDivSelectScanChnl(): Channel %d is select as scan channel.\n", ScanChannel)); - - return ScanChannel; -#else - return 0; -#endif -} - - -VOID -odm_SwAntDivConstructScanChnl( - IN PADAPTER Adapter, - IN u1Byte ScanChnl - ) -{ - - PMGNT_INFO pMgntInfo = &Adapter->MgntInfo; - - if(ScanChnl == 0) - { - u1Byte i; - PRT_CHANNEL_LIST pChannelList = GET_RT_CHANNEL_LIST(pMgntInfo); - - // 20100519 Joseph: Original antenna scanned nothing. - // Test antenna shall scan all channel with half period in this condition. - RtActChannelList(Adapter, RT_CHNL_LIST_ACTION_CONSTRUCT_SCAN_LIST, NULL, NULL); - for(i = 0; i < pChannelList->ChannelLen; i++) - pChannelList->ChnlListEntry[i].ScanPeriod /= 2; - } - else - { - // The using of this CustomizedScanRequest is a trick to rescan the two channels - // under the NORMAL scanning process. It will not affect MGNT_INFO.CustomizedScanRequest. - CUSTOMIZED_SCAN_REQUEST CustomScanReq; - - CustomScanReq.bEnabled = TRUE; - CustomScanReq.Channels[0] = ScanChnl; - CustomScanReq.Channels[1] = pMgntInfo->dot11CurrentChannelNumber; - CustomScanReq.nChannels = 2; - CustomScanReq.ScanType = SCAN_ACTIVE; - CustomScanReq.Duration = DEFAULT_PASSIVE_SCAN_PERIOD; - - RtActChannelList(Adapter, RT_CHNL_LIST_ACTION_CONSTRUCT_SCAN_LIST, &CustomScanReq, NULL); - } - -} -#endif //#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - -// -// 20100514 Luke/Joseph: -// Callback function for 500ms antenna test trying. -// -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) -VOID -odm_SwAntDivChkAntSwitchCallback( - PRT_TIMER pTimer -) -{ - PADAPTER Adapter = (PADAPTER)pTimer->Adapter; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - pSWAT_T pDM_SWAT_Table = &pHalData->DM_OutSrc.DM_SWAT_Table; - - #if DEV_BUS_TYPE==RT_PCI_INTERFACE - #if USE_WORKITEM - ODM_ScheduleWorkItem(&pDM_SWAT_Table->SwAntennaSwitchWorkitem); - #else - odm_SwAntDivChkAntSwitch(&pHalData->DM_OutSrc, SWAW_STEP_DETERMINE); - #endif - #else - ODM_ScheduleWorkItem(&pDM_SWAT_Table->SwAntennaSwitchWorkitem); - #endif - -} -VOID -odm_SwAntDivChkAntSwitchWorkitemCallback( - IN PVOID pContext - ) -{ - - PADAPTER pAdapter = (PADAPTER)pContext; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); - - odm_SwAntDivChkAntSwitch(&pHalData->DM_OutSrc, SWAW_STEP_DETERMINE); - -} -#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) -VOID odm_SwAntDivChkAntSwitchCallback(void *FunctionContext) -{ - PDM_ODM_T pDM_Odm= (PDM_ODM_T)FunctionContext; - PADAPTER padapter = pDM_Odm->Adapter; - if(padapter->net_closed == _TRUE) - return; - odm_SwAntDivChkAntSwitch(pDM_Odm, SWAW_STEP_DETERMINE); -} -#elif (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) -VOID odm_SwAntDivChkAntSwitchCallback(void *FunctionContext) -{ - PDM_ODM_T pDM_Odm= (PDM_ODM_T)FunctionContext; - odm_SwAntDivChkAntSwitch(pDM_Odm, SWAW_STEP_DETERMINE); -} -#endif - -#else //#if(defined(CONFIG_SW_ANTENNA_DIVERSITY)) - -VOID odm_SwAntDivInit( IN PDM_ODM_T pDM_Odm ) {} -VOID ODM_SwAntDivChkPerPktRssi( - IN PDM_ODM_T pDM_Odm, - IN u1Byte StationID, - IN PODM_PHY_INFO_T pPhyInfo - ) {} -VOID odm_SwAntDivChkAntSwitch( - IN PDM_ODM_T pDM_Odm, - IN u1Byte Step - ) {} -VOID ODM_SwAntDivResetBeforeLink( IN PDM_ODM_T pDM_Odm ){} -VOID ODM_SwAntDivRestAfterLink( IN PDM_ODM_T pDM_Odm ){} -VOID odm_SwAntDetectInit( IN PDM_ODM_T pDM_Odm){} -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) -VOID odm_SwAntDivChkAntSwitchCallback( PRT_TIMER pTimer){} -VOID odm_SwAntDivChkAntSwitchWorkitemCallback( IN PVOID pContext ){} -#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) -VOID odm_SwAntDivChkAntSwitchCallback(void *FunctionContext){} -#elif (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) -VOID odm_SwAntDivChkAntSwitchCallback(void *FunctionContext){} -#endif - -#endif //#if(defined(CONFIG_SW_ANTENNA_DIVERSITY)) - - - -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) -BOOLEAN -ODM_SwAntDivCheckBeforeLink( - IN PDM_ODM_T pDM_Odm - ) -{ - -#if (RT_MEM_SIZE_LEVEL != RT_MEM_SIZE_MINIMUM) - - PADAPTER Adapter = pDM_Odm->Adapter; - HAL_DATA_TYPE* pHalData = GET_HAL_DATA(Adapter); - PMGNT_INFO pMgntInfo = &Adapter->MgntInfo; - pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; - pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; - s1Byte Score = 0; - PRT_WLAN_BSS pTmpBssDesc, pTestBssDesc; - s4Byte power_diff = 0, power_target = 10; - u1Byte index, counter = 0; - static u1Byte ScanChannel; - u8Byte tStamp_diff = 0; - - - if (pDM_Odm->Adapter == NULL) //For BSOD when plug/unplug fast. //By YJ,120413 - { // The ODM structure is not initialized. - return FALSE; - } - - // Retrieve antenna detection registry info, added by Roger, 2012.11.27. - if(!IS_ANT_DETECT_SUPPORT_RSSI(Adapter)) - return FALSE; - - // Since driver is going to set BB register, it shall check if there is another thread controlling BB/RF. - PlatformAcquireSpinLock(Adapter, RT_RF_STATE_SPINLOCK); - if(pHalData->eRFPowerState!=eRfOn || pMgntInfo->RFChangeInProgress || pMgntInfo->bMediaConnect) - { - PlatformReleaseSpinLock(Adapter, RT_RF_STATE_SPINLOCK); - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, - ("ODM_SwAntDivCheckBeforeLink(): RFChangeInProgress(%x), eRFPowerState(%x)\n", - pMgntInfo->RFChangeInProgress, pHalData->eRFPowerState)); - - pDM_SWAT_Table->SWAS_NoLink_State = 0; - - return FALSE; - } - else - { - PlatformReleaseSpinLock(Adapter, RT_RF_STATE_SPINLOCK); - } - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("pDM_SWAT_Table->SWAS_NoLink_State = %d\n", pDM_SWAT_Table->SWAS_NoLink_State)); - //1 Run AntDiv mechanism "Before Link" part. - if(pDM_SWAT_Table->SWAS_NoLink_State == 0) - { - //1 Prepare to do Scan again to check current antenna state. - - // Set check state to next step. - pDM_SWAT_Table->SWAS_NoLink_State = 1; - - // Copy Current Scan list. - pMgntInfo->tmpNumBssDesc = pMgntInfo->NumBssDesc; - PlatformMoveMemory((PVOID)Adapter->MgntInfo.tmpbssDesc, (PVOID)pMgntInfo->bssDesc, sizeof(RT_WLAN_BSS)*MAX_BSS_DESC); - - // Go back to scan function again. - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SwAntDivCheckBeforeLink: Scan one more time\n")); - pMgntInfo->ScanStep=0; - pMgntInfo->bScanAntDetect = TRUE; - ScanChannel = odm_SwAntDivSelectScanChnl(Adapter); - - - if(pDM_Odm->SupportICType & (ODM_RTL8188E|ODM_RTL8821)) - { - if(pDM_FatTable->RxIdleAnt == MAIN_ANT) - ODM_UpdateRxIdleAnt(pDM_Odm, AUX_ANT); - else - ODM_UpdateRxIdleAnt(pDM_Odm, MAIN_ANT); - if(ScanChannel == 0) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, - ("ODM_SwAntDivCheckBeforeLink(): No AP List Avaiable, Using Ant(%s)\n", (pDM_FatTable->RxIdleAnt==MAIN_ANT)?"AUX_ANT":"MAIN_ANT")); - - if(IS_5G_WIRELESS_MODE(pMgntInfo->dot11CurrentWirelessMode)) - { - pDM_SWAT_Table->Ant5G = pDM_FatTable->RxIdleAnt; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("pDM_SWAT_Table->Ant5G=%s\n", (pDM_FatTable->RxIdleAnt==MAIN_ANT)?"MAIN_ANT":"AUX_ANT")); - } - else - { - pDM_SWAT_Table->Ant2G = pDM_FatTable->RxIdleAnt; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("pDM_SWAT_Table->Ant2G=%s\n", (pDM_FatTable->RxIdleAnt==MAIN_ANT)?"MAIN_ANT":"AUX_ANT")); - } - return FALSE; - } - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, - ("ODM_SwAntDivCheckBeforeLink: Change to %s for testing.\n", ((pDM_FatTable->RxIdleAnt == MAIN_ANT)?"MAIN_ANT":"AUX_ANT"))); - } - else if(pDM_Odm->SupportICType & (ODM_RTL8192C|ODM_RTL8723B)) - { - // Switch Antenna to another one. - pDM_SWAT_Table->PreAntenna = pDM_SWAT_Table->CurAntenna; - pDM_SWAT_Table->CurAntenna = (pDM_SWAT_Table->CurAntenna==MAIN_ANT)?AUX_ANT:MAIN_ANT; - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, - ("ODM_SwAntDivCheckBeforeLink: Change to Ant(%s) for testing.\n", (pDM_SWAT_Table->CurAntenna==MAIN_ANT)?"MAIN":"AUX")); - //PHY_SetBBReg(Adapter, rFPGA0_XA_RFInterfaceOE, 0x300, DM_SWAT_Table.CurAntenna); - if(pDM_Odm->SupportICType == ODM_RTL8192C) - { - pDM_SWAT_Table->SWAS_NoLink_BK_Reg860 = ((pDM_SWAT_Table->SWAS_NoLink_BK_Reg860 & 0xfffffcff) | (pDM_SWAT_Table->CurAntenna<<8)); - ODM_SetBBReg(pDM_Odm, rFPGA0_XA_RFInterfaceOE, bMaskDWord, pDM_SWAT_Table->SWAS_NoLink_BK_Reg860); - } - else if(pDM_Odm->SupportICType == ODM_RTL8723B) - { - pDM_SWAT_Table->SWAS_NoLink_BK_Reg92c = ((pDM_SWAT_Table->SWAS_NoLink_BK_Reg92c & 0xfffffffc) | (pDM_SWAT_Table->CurAntenna)); - ODM_SetBBReg(pDM_Odm, rfe_ctrl_anta_src, 0xff, 0x77); - ODM_SetBBReg(pDM_Odm, rDPDT_control, bMaskDWord, pDM_SWAT_Table->SWAS_NoLink_BK_Reg92c); - } - } - - odm_SwAntDivConstructScanChnl(Adapter, ScanChannel); - PlatformSetTimer(Adapter, &pMgntInfo->ScanTimer, 5); - - return TRUE; - } - else - { - //1 ScanComple() is called after antenna swiched. - //1 Check scan result and determine which antenna is going - //1 to be used. - - for(index = 0; index < pMgntInfo->tmpNumBssDesc; index++) - { - pTmpBssDesc = &(pMgntInfo->tmpbssDesc[index]); // Antenna 1 - pTestBssDesc = &(pMgntInfo->bssDesc[index]); // Antenna 2 - - if(PlatformCompareMemory(pTestBssDesc->bdBssIdBuf, pTmpBssDesc->bdBssIdBuf, 6)!=0) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SwAntDivCheckBeforeLink(): ERROR!! This shall not happen.\n")); - continue; - } - - if(pDM_Odm->SupportICType != ODM_RTL8723B) - { - if(pTmpBssDesc->ChannelNumber == ScanChannel) - { - if(pTmpBssDesc->RecvSignalPower > pTestBssDesc->RecvSignalPower) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SwAntDivCheckBeforeLink: Compare scan entry: Score++\n")); - RT_PRINT_STR(COMP_SCAN, DBG_WARNING, "GetScanInfo(): new Bss SSID:", pTmpBssDesc->bdSsIdBuf, pTmpBssDesc->bdSsIdLen); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("at ch %d, Original: %d, Test: %d\n\n", pTmpBssDesc->ChannelNumber, pTmpBssDesc->RecvSignalPower, pTestBssDesc->RecvSignalPower)); - - Score++; - PlatformMoveMemory(pTestBssDesc, pTmpBssDesc, sizeof(RT_WLAN_BSS)); - } - else if(pTmpBssDesc->RecvSignalPower < pTestBssDesc->RecvSignalPower) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SwAntDivCheckBeforeLink: Compare scan entry: Score--\n")); - RT_PRINT_STR(COMP_SCAN, DBG_WARNING, "GetScanInfo(): new Bss SSID:", pTmpBssDesc->bdSsIdBuf, pTmpBssDesc->bdSsIdLen); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("at ch %d, Original: %d, Test: %d\n\n", pTmpBssDesc->ChannelNumber, pTmpBssDesc->RecvSignalPower, pTestBssDesc->RecvSignalPower)); - Score--; - } - else - { - if(pTestBssDesc->bdTstamp - pTmpBssDesc->bdTstamp < 5000) - { - RT_PRINT_STR(COMP_SCAN, DBG_WARNING, "GetScanInfo(): new Bss SSID:", pTmpBssDesc->bdSsIdBuf, pTmpBssDesc->bdSsIdLen); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("at ch %d, Original: %d, Test: %d\n", pTmpBssDesc->ChannelNumber, pTmpBssDesc->RecvSignalPower, pTestBssDesc->RecvSignalPower)); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("The 2nd Antenna didn't get this AP\n\n")); - } - } - } - } - else - { - if(pTmpBssDesc->ChannelNumber == ScanChannel) - { - if(pTmpBssDesc->RecvSignalPower > pTestBssDesc->RecvSignalPower) - { - counter++; - power_diff = power_diff + (pTmpBssDesc->RecvSignalPower - pTestBssDesc->RecvSignalPower); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Original: %d, Test: %d\n", pTmpBssDesc->RecvSignalPower, pTestBssDesc->RecvSignalPower)); - ODM_PRINT_ADDR(pDM_Odm,ODM_COMP_ANT_DIV, DBG_LOUD, ("SSID:"), pTmpBssDesc->bdSsIdBuf); - ODM_PRINT_ADDR(pDM_Odm,ODM_COMP_ANT_DIV, DBG_LOUD, ("BSSID:"), pTmpBssDesc->bdBssIdBuf); - PlatformMoveMemory(pTestBssDesc, pTmpBssDesc, sizeof(RT_WLAN_BSS)); - } - else if(pTestBssDesc->RecvSignalPower > pTmpBssDesc->RecvSignalPower) - { - counter++; - power_diff = power_diff + (pTestBssDesc->RecvSignalPower - pTmpBssDesc->RecvSignalPower); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Original: %d, Test: %d\n", pTmpBssDesc->RecvSignalPower, pTestBssDesc->RecvSignalPower)); - ODM_PRINT_ADDR(pDM_Odm,ODM_COMP_ANT_DIV, DBG_LOUD, ("SSID:"), pTmpBssDesc->bdSsIdBuf); - ODM_PRINT_ADDR(pDM_Odm,ODM_COMP_ANT_DIV, DBG_LOUD, ("BSSID:"), pTmpBssDesc->bdBssIdBuf) - } - else if(pTestBssDesc->bdTstamp > pTmpBssDesc->bdTstamp) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("time_diff: %lld\n", (pTestBssDesc->bdTstamp-pTmpBssDesc->bdTstamp)/1000)); - if(pTestBssDesc->bdTstamp - pTmpBssDesc->bdTstamp > 5000) - { - counter++; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Original: %d, Test: %d\n", pTmpBssDesc->RecvSignalPower, pTestBssDesc->RecvSignalPower)); - ODM_PRINT_ADDR(pDM_Odm,ODM_COMP_ANT_DIV, DBG_LOUD, ("SSID:"), pTmpBssDesc->bdSsIdBuf); - ODM_PRINT_ADDR(pDM_Odm,ODM_COMP_ANT_DIV, DBG_LOUD, ("BSSID:"), pTmpBssDesc->bdBssIdBuf) - } - } - } - } - } - - if(pDM_Odm->SupportICType == ODM_RTL8723B) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("counter: %d power_diff: %d\n", counter, power_diff)); - - if(counter != 0) - power_diff = power_diff / counter; - - if(power_diff <= power_target && counter != 0) - Score++; - } - - if(pDM_Odm->SupportICType & (ODM_RTL8188E|ODM_RTL8821)) - { - if(pMgntInfo->NumBssDesc!=0 && Score<0) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, - ("ODM_SwAntDivCheckBeforeLink(): Using Ant(%s)\n", (pDM_FatTable->RxIdleAnt==MAIN_ANT)?"MAIN_ANT":"AUX_ANT")); - } - else - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, - ("ODM_SwAntDivCheckBeforeLink(): Remain Ant(%s)\n", (pDM_FatTable->RxIdleAnt==MAIN_ANT)?"AUX_ANT":"MAIN_ANT")); - - if(pDM_FatTable->RxIdleAnt == MAIN_ANT) - ODM_UpdateRxIdleAnt(pDM_Odm, AUX_ANT); - else - ODM_UpdateRxIdleAnt(pDM_Odm, MAIN_ANT); - } - - if(IS_5G_WIRELESS_MODE(pMgntInfo->dot11CurrentWirelessMode)) - { - pDM_SWAT_Table->Ant5G = pDM_FatTable->RxIdleAnt; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("pDM_SWAT_Table->Ant5G=%s\n", (pDM_FatTable->RxIdleAnt==MAIN_ANT)?"MAIN_ANT":"AUX_ANT")); - } - else - { - pDM_SWAT_Table->Ant2G = pDM_FatTable->RxIdleAnt; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("pDM_SWAT_Table->Ant2G=%s\n", (pDM_FatTable->RxIdleAnt==MAIN_ANT)?"MAIN_ANT":"AUX_ANT")); - } - } - else if(pDM_Odm->SupportICType == ODM_RTL8723B) - { - pDM_SWAT_Table->CurAntenna = pDM_SWAT_Table->PreAntenna; - pDM_SWAT_Table->SWAS_NoLink_BK_Reg92c = ((pDM_SWAT_Table->SWAS_NoLink_BK_Reg92c & 0xfffffffc) | (pDM_SWAT_Table->CurAntenna)); - ODM_SetBBReg(pDM_Odm, rfe_ctrl_anta_src, 0xff, 0x77); - ODM_SetBBReg(pDM_Odm, rDPDT_control,bMaskDWord, pDM_SWAT_Table->SWAS_NoLink_BK_Reg92c); - - if(counter != 0) - { - if(pMgntInfo->NumBssDesc != 0 && Score > 0) - { - if(pDM_Odm->DM_SWAT_Table.ANTB_ON == FALSE) - { - pDM_Odm->DM_SWAT_Table.ANTA_ON = TRUE; - pDM_Odm->DM_SWAT_Table.ANTB_ON = TRUE; - } - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("ODM_SwAntDivCheckBeforeLink(): Dual antenna\n")); - } - else - { - if(pDM_Odm->DM_SWAT_Table.ANTB_ON == TRUE) - { - pDM_Odm->DM_SWAT_Table.ANTA_ON = TRUE; - pDM_Odm->DM_SWAT_Table.ANTB_ON = FALSE; - BT_SetBtCoexAntNum(Adapter, BT_COEX_ANT_TYPE_DETECTED, 1); - } - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SwAntDivCheckBeforeLink(): Single antenna\n")); - } - } - else - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("ODM_SwAntDivCheckBeforeLink(): Igone result\n")); - } - else if(pDM_Odm->SupportICType == ODM_RTL8192C) - { - if(pMgntInfo->NumBssDesc!=0 && Score<=0) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, - ("ODM_SwAntDivCheckBeforeLink(): Using Ant(%s)\n", (pDM_SWAT_Table->CurAntenna==MAIN_ANT)?"MAIN":"AUX")); - - pDM_SWAT_Table->PreAntenna = pDM_SWAT_Table->CurAntenna; - } - else - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, - ("ODM_SwAntDivCheckBeforeLink(): Remain Ant(%s)\n", (pDM_SWAT_Table->CurAntenna==MAIN_ANT)?"AUX":"MAIN")); - - pDM_SWAT_Table->CurAntenna = pDM_SWAT_Table->PreAntenna; - - //PHY_SetBBReg(Adapter, rFPGA0_XA_RFInterfaceOE, 0x300, DM_SWAT_Table.CurAntenna); - pDM_SWAT_Table->SWAS_NoLink_BK_Reg860 = ((pDM_SWAT_Table->SWAS_NoLink_BK_Reg860 & 0xfffffcff) | (pDM_SWAT_Table->CurAntenna<<8)); - PHY_SetBBReg(Adapter, rFPGA0_XA_RFInterfaceOE, bMaskDWord, pDM_SWAT_Table->SWAS_NoLink_BK_Reg860); - } - } - - // Check state reset to default and wait for next time. - pDM_SWAT_Table->SWAS_NoLink_State = 0; - pMgntInfo->bScanAntDetect = FALSE; - - return FALSE; - } - -#else - return FALSE; -#endif - -return FALSE; -} - -#endif //#if(DM_ODM_SUPPORT_TYPE==ODM_WIN) - - -//3============================================================ -//3 SW Antenna Diversity -//3============================================================ - -#if(defined(CONFIG_HW_ANTENNA_DIVERSITY)) -VOID -odm_InitHybridAntDiv_88C_92D( - IN PDM_ODM_T pDM_Odm - ) -{ - -#if((DM_ODM_SUPPORT_TYPE==ODM_AP)||(DM_ODM_SUPPORT_TYPE==ODM_ADSL)) - struct rtl8192cd_priv *priv=pDM_Odm->priv; -#endif - SWAT_T *pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; - u1Byte bTxPathSel=0; //0:Path-A 1:Path-B - u1Byte i; - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("odm_InitHybridAntDiv==============>\n")); - - //whether to do antenna diversity or not -#if(DM_ODM_SUPPORT_TYPE==ODM_AP) - if(priv==NULL) return; - if(!priv->pshare->rf_ft_var.antHw_enable) - return; - - #ifdef SW_ANT_SWITCH - priv->pshare->rf_ft_var.antSw_enable =0; - #endif -#endif - - if((pDM_Odm->SupportICType != ODM_RTL8192C) && (pDM_Odm->SupportICType != ODM_RTL8192D)) - return; - - - bTxPathSel=(pDM_Odm->RFType==ODM_1T1R)?FALSE:TRUE; - - ODM_SetBBReg(pDM_Odm,ODM_REG_BB_PWR_SAV1_11N, BIT23, 0); //No update ANTSEL during GNT_BT=1 - ODM_SetBBReg(pDM_Odm,ODM_REG_TX_ANT_CTRL_11N, BIT21, 1); //TX atenna selection from tx_info - ODM_SetBBReg(pDM_Odm,ODM_REG_ANTSEL_PIN_11N, BIT23, 1); //enable LED[1:0] pin as ANTSEL - ODM_SetBBReg(pDM_Odm,ODM_REG_ANTSEL_CTRL_11N, BIT8|BIT9, 0x01); // 0x01: left antenna, 0x02: right antenna - // check HW setting: ANTSEL pin connection - #if(DM_ODM_SUPPORT_TYPE==ODM_AP) - ODM_Write2Byte(pDM_Odm,ODM_REG_RF_PIN_11N, (ODM_Read2Byte(pDM_Odm,0x804)&0xf0ff )| BIT(8) ); // b11-b8=0001,update RFPin setting - #endif - - // only AP support different path selection temperarly - if(!bTxPathSel){ //PATH-A - ODM_SetBBReg(pDM_Odm,ODM_REG_PIN_CTRL_11N, BIT8|BIT9, 0 ); // ANTSEL as HW control - ODM_SetBBReg(pDM_Odm,ODM_REG_ANTSEL_PATH_11N, BIT13, 1); //select TX ANTESEL from path A - } - else { - ODM_SetBBReg(pDM_Odm,ODM_REG_PIN_CTRL_11N, BIT24|BIT25, 0 ); // ANTSEL as HW control - ODM_SetBBReg(pDM_Odm,ODM_REG_ANTSEL_PATH_11N, BIT13, 0); //select ANTESEL from path B - } - - //Set OFDM HW RX Antenna Diversity - ODM_SetBBReg(pDM_Odm,ODM_REG_ANTDIV_PARA1_11N, 0x7FF, 0x0c0); //Pwdb threshold=8dB - ODM_SetBBReg(pDM_Odm,ODM_REG_ANTDIV_PARA1_11N, BIT11, 0); //Switch to another antenna by checking pwdb threshold - ODM_SetBBReg(pDM_Odm,ODM_REG_ANTDIV_PARA3_11N, BIT23, 1); // Decide final antenna by comparing 2 antennas' pwdb - - //Set CCK HW RX Antenna Diversity - ODM_SetBBReg(pDM_Odm,ODM_REG_CCK_ANTDIV_PARA2_11N, BIT4, 0); //Antenna diversity decision period = 32 sample - ODM_SetBBReg(pDM_Odm,ODM_REG_CCK_ANTDIV_PARA2_11N, 0xf, 0xf); //Threshold for antenna diversity. Check another antenna power if input power < ANT_lim*4 - ODM_SetBBReg(pDM_Odm,ODM_REG_CCK_ANTDIV_PARA3_11N, BIT13, 1); //polarity ana_A=1 and ana_B=0 - ODM_SetBBReg(pDM_Odm,ODM_REG_CCK_ANTDIV_PARA4_11N, 0x1f, 0x8); //default antenna power = inpwr*(0.5 + r_ant_step/16) - - - //Enable HW Antenna Diversity - if(!bTxPathSel) //PATH-A - ODM_SetBBReg(pDM_Odm,ODM_REG_IGI_A_11N, BIT7,1); // Enable Hardware antenna switch - else - ODM_SetBBReg(pDM_Odm,ODM_REG_IGI_B_11N, BIT7,1); // Enable Hardware antenna switch - ODM_SetBBReg(pDM_Odm,ODM_REG_CCK_ANTDIV_PARA1_11N, BIT15, 1);//Enable antenna diversity - - pDM_SWAT_Table->CurAntenna=0; //choose left antenna as default antenna - pDM_SWAT_Table->PreAntenna=0; - for(i=0; iCCK_Ant1_Cnt[i] = 0; - pDM_SWAT_Table->CCK_Ant2_Cnt[i] = 0; - pDM_SWAT_Table->OFDM_Ant1_Cnt[i] = 0; - pDM_SWAT_Table->OFDM_Ant2_Cnt[i] = 0; - pDM_SWAT_Table->RSSI_Ant1_Sum[i] = 0; - pDM_SWAT_Table->RSSI_Ant2_Sum[i] = 0; - } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("<==============odm_InitHybridAntDiv\n")); -} - - -VOID -odm_InitHybridAntDiv( - IN PDM_ODM_T pDM_Odm - ) -{ - if(!(pDM_Odm->SupportAbility & ODM_BB_ANT_DIV)) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("Return: Not Support HW AntDiv\n")); - return; - } - - if(pDM_Odm->SupportICType & (ODM_RTL8192C | ODM_RTL8192D)) - { -#if ((RTL8192C_SUPPORT == 1)||(RTL8192D_SUPPORT == 1)) - odm_InitHybridAntDiv_88C_92D(pDM_Odm); -#endif - } -} - - -BOOLEAN -odm_StaDefAntSel( - IN PDM_ODM_T pDM_Odm, - IN u4Byte OFDM_Ant1_Cnt, - IN u4Byte OFDM_Ant2_Cnt, - IN u4Byte CCK_Ant1_Cnt, - IN u4Byte CCK_Ant2_Cnt, - OUT u1Byte *pDefAnt - - ) -{ -#if 1 - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("odm_StaDefAntSelect==============>\n")); - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("OFDM_Ant1_Cnt:%d, OFDM_Ant2_Cnt:%d\n",OFDM_Ant1_Cnt,OFDM_Ant2_Cnt)); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("CCK_Ant1_Cnt:%d, CCK_Ant2_Cnt:%d\n",CCK_Ant1_Cnt,CCK_Ant2_Cnt)); - - - if(((OFDM_Ant1_Cnt+OFDM_Ant2_Cnt)==0)&&((CCK_Ant1_Cnt + CCK_Ant2_Cnt) <10)){ - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("odm_StaDefAntSelect Fail: No enough packet info!\n")); - return FALSE; - } - - if(OFDM_Ant1_Cnt || OFDM_Ant2_Cnt ) { - //if RX OFDM packet number larger than 0 - if(OFDM_Ant1_Cnt > OFDM_Ant2_Cnt) - (*pDefAnt)=1; - else - (*pDefAnt)=0; - } - // else if RX CCK packet number larger than 10 - else if((CCK_Ant1_Cnt + CCK_Ant2_Cnt) >=10 ) - { - if(CCK_Ant1_Cnt > (5*CCK_Ant2_Cnt)) - (*pDefAnt)=1; - else if(CCK_Ant2_Cnt > (5*CCK_Ant1_Cnt)) - (*pDefAnt)=0; - else if(CCK_Ant1_Cnt > CCK_Ant2_Cnt) - (*pDefAnt)=0; - else - (*pDefAnt)=1; - - } - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("TxAnt = %s\n",((*pDefAnt)==1)?"Ant1":"Ant2")); - -#endif - //u4Byte antsel = ODM_GetBBReg(pDM_Odm, 0xc88, bMaskByte0); - //(*pDefAnt)= (u1Byte) antsel; - - - - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("<==============odm_StaDefAntSelect\n")); - - return TRUE; - - -} - - -VOID -odm_SetRxIdleAnt( - IN PDM_ODM_T pDM_Odm, - IN u1Byte Ant, - IN BOOLEAN bDualPath -) -{ - SWAT_T *pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; - - //ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("odm_SetRxIdleAnt==============>\n")); - - if(Ant != pDM_SWAT_Table->RxIdleAnt) - { - //for path-A - if(Ant==1) - ODM_SetBBReg(pDM_Odm,ODM_REG_RX_DEFUALT_A_11N, 0xFFFF, 0x65a9); //right-side antenna - else - ODM_SetBBReg(pDM_Odm,ODM_REG_RX_DEFUALT_A_11N, 0xFFFF, 0x569a); //left-side antenna - - //for path-B - if(bDualPath){ - if(Ant==0) - ODM_SetBBReg(pDM_Odm,ODM_REG_RX_DEFUALT_A_11N, 0xFFFF0000, 0x65a9); //right-side antenna - else - ODM_SetBBReg(pDM_Odm,ODM_REG_RX_DEFUALT_A_11N, 0xFFFF0000, 0x569a); //left-side antenna - } - } - pDM_SWAT_Table->RxIdleAnt = Ant; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("RxIdleAnt: %s Reg858=0x%x\n",(Ant==1)?"Ant1":"Ant2",(Ant==1)?0x65a9:0x569a)); - - //ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("<==============odm_SetRxIdleAnt\n")); - - } - -VOID -ODM_AntselStatistics_88C( - IN PDM_ODM_T pDM_Odm, - IN u1Byte MacId, - IN u4Byte PWDBAll, - IN BOOLEAN isCCKrate -) -{ - SWAT_T *pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; - - if(pDM_SWAT_Table->antsel == 1) - { - if(isCCKrate) - pDM_SWAT_Table->CCK_Ant1_Cnt[MacId]++; - else - { - pDM_SWAT_Table->OFDM_Ant1_Cnt[MacId]++; - pDM_SWAT_Table->RSSI_Ant1_Sum[MacId] += PWDBAll; - } - } - else - { - if(isCCKrate) - pDM_SWAT_Table->CCK_Ant2_Cnt[MacId]++; - else - { - pDM_SWAT_Table->OFDM_Ant2_Cnt[MacId]++; - pDM_SWAT_Table->RSSI_Ant2_Sum[MacId] += PWDBAll; - } - } - -} - - - - -#if(DM_ODM_SUPPORT_TYPE==ODM_WIN) -VOID -ODM_SetTxAntByTxInfo_88C_92D( - IN PDM_ODM_T pDM_Odm, - IN pu1Byte pDesc, - IN u1Byte macId -) -{ - SWAT_T *pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; - u1Byte antsel; - - if(!(pDM_Odm->SupportAbility&ODM_BB_ANT_DIV)) - return; - - if(pDM_SWAT_Table->RxIdleAnt == 1) - antsel=(pDM_SWAT_Table->TxAnt[macId] == 1)?0:1; - else - antsel=(pDM_SWAT_Table->TxAnt[macId] == 1)?1:0; - - SET_TX_DESC_ANTSEL_A_92C(pDesc, antsel); - //SET_TX_DESC_ANTSEL_B_92C(pDesc, antsel); - //ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("SET_TX_DESC_ANTSEL_A_92C=%d\n", pDM_SWAT_Table->TxAnt[macId])); -} -#elif(DM_ODM_SUPPORT_TYPE==ODM_CE) -VOID -ODM_SetTxAntByTxInfo_88C_92D( - IN PDM_ODM_T pDM_Odm -) -{ - -} -#elif(DM_ODM_SUPPORT_TYPE==ODM_AP) -VOID -ODM_SetTxAntByTxInfo_88C_92D( - IN PDM_ODM_T pDM_Odm -) -{ - -} -#endif - -VOID -odm_HwAntDiv_92C_92D( - IN PDM_ODM_T pDM_Odm -) -{ - SWAT_T *pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; - u4Byte RSSI_Min=0xFF, RSSI, RSSI_Ant1, RSSI_Ant2; - u1Byte RxIdleAnt, i; - BOOLEAN bRet=FALSE; - PSTA_INFO_T pEntry; - -#if (DM_ODM_SUPPORT_TYPE==ODM_AP) - struct rtl8192cd_priv *priv=pDM_Odm->priv; - //if test, return - if(priv->pshare->rf_ft_var.CurAntenna & 0x80) - return; -#endif - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("odm_HwAntDiv==============>\n")); - - if(!(pDM_Odm->SupportAbility&ODM_BB_ANT_DIV)) //if don't support antenna diveristy - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("odm_HwAntDiv: Not supported!\n")); - return; - } - - if((pDM_Odm->SupportICType != ODM_RTL8192C) && (pDM_Odm->SupportICType != ODM_RTL8192D)) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("Return: IC Type is not 92C or 92D\n")); - return; - } - -#if (DM_ODM_SUPPORT_TYPE&(ODM_WIN|ODM_CE)) - if(!pDM_Odm->bLinked) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("Return: bLinked is FALSE\n")); - return; - } -#endif - - for (i=0; ipODM_StaInfo[i]; - if(IS_STA_VALID(pEntry)) - { - - RSSI_Ant1 = (pDM_SWAT_Table->OFDM_Ant1_Cnt[i] == 0)?0:(pDM_SWAT_Table->RSSI_Ant1_Sum[i]/pDM_SWAT_Table->OFDM_Ant1_Cnt[i]); - RSSI_Ant2 = (pDM_SWAT_Table->OFDM_Ant2_Cnt[i] == 0)?0:(pDM_SWAT_Table->RSSI_Ant2_Sum[i]/pDM_SWAT_Table->OFDM_Ant2_Cnt[i]); - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("RSSI_Ant1=%d, RSSI_Ant2=%d\n", RSSI_Ant1, RSSI_Ant2)); - - if(RSSI_Ant1 ||RSSI_Ant2) - { -#if (DM_ODM_SUPPORT_TYPE==ODM_AP) - if(pDM_Odm->pODM_StaInfo[i]->expire_to) -#endif - { - RSSI = (RSSI_Ant1 < RSSI_Ant2) ? RSSI_Ant1 : RSSI_Ant2; - if((!RSSI) || ( RSSI < RSSI_Min) ) { - pDM_SWAT_Table->TargetSTA = i; - RSSI_Min = RSSI; - } - } - } - ///STA: found out default antenna - bRet=odm_StaDefAntSel(pDM_Odm, - pDM_SWAT_Table->OFDM_Ant1_Cnt[i], - pDM_SWAT_Table->OFDM_Ant2_Cnt[i], - pDM_SWAT_Table->CCK_Ant1_Cnt[i], - pDM_SWAT_Table->CCK_Ant2_Cnt[i], - &pDM_SWAT_Table->TxAnt[i]); - - //if Tx antenna selection: successful - if(bRet){ - pDM_SWAT_Table->RSSI_Ant1_Sum[i] = 0; - pDM_SWAT_Table->RSSI_Ant2_Sum[i] = 0; - pDM_SWAT_Table->OFDM_Ant1_Cnt[i] = 0; - pDM_SWAT_Table->OFDM_Ant2_Cnt[i] = 0; - pDM_SWAT_Table->CCK_Ant1_Cnt[i] = 0; - pDM_SWAT_Table->CCK_Ant2_Cnt[i] = 0; - } - } - } - - //set RX Idle Ant - RxIdleAnt = pDM_SWAT_Table->TxAnt[pDM_SWAT_Table->TargetSTA]; - odm_SetRxIdleAnt(pDM_Odm, RxIdleAnt, FALSE); - -#if (DM_ODM_SUPPORT_TYPE==ODM_AP) -#ifdef TX_SHORTCUT - if (!priv->pmib->dot11OperationEntry.disable_txsc) { - plist = phead->next; - while(plist != phead) { - pstat = list_entry(plist, struct stat_info, asoc_list); - if(pstat->expire_to) { - for (i=0; itx_sc_ent[i].hwdesc1); - pdesc->Dword2 &= set_desc(~ (BIT(24)|BIT(25))); - if((pstat->CurAntenna^priv->pshare->rf_ft_var.CurAntenna)&1) - pdesc->Dword2 |= set_desc(BIT(24)|BIT(25)); - pdesc= &(pstat->tx_sc_ent[i].hwdesc2); - pdesc->Dword2 &= set_desc(~ (BIT(24)|BIT(25))); - if((pstat->CurAntenna^priv->pshare->rf_ft_var.CurAntenna)&1) - pdesc->Dword2 |= set_desc(BIT(24)|BIT(25)); - } - } - - if (plist == plist->next) - break; - plist = plist->next; - }; - } -#endif -#endif - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("<==============odm_HwAntDiv\n")); - -} - -VOID -odm_HwAntDiv( - IN PDM_ODM_T pDM_Odm -) -{ - - PADAPTER pAdapter = pDM_Odm->Adapter; - -#if(DM_ODM_SUPPORT_TYPE==ODM_WIN) - if(pAdapter->MgntInfo.AntennaTest) - return; -#endif - if(!(pDM_Odm->SupportAbility & ODM_BB_ANT_DIV)) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("Return: Not Support HW AntDiv\n")); - return; - } - - if(pDM_Odm->SupportICType & (ODM_RTL8192C | ODM_RTL8192D)) - { -#if ((RTL8192C_SUPPORT == 1)||(RTL8192D_SUPPORT == 1)) - odm_HwAntDiv_92C_92D(pDM_Odm); -#endif - } -} - - -#if(DM_ODM_SUPPORT_TYPE==ODM_AP) -#if 0 -VOID -odm_HwAntDiv( - IN PDM_ODM_T pDM_Odm -) -{ - struct rtl8192cd_priv *priv=pDM_Odm->priv; - struct stat_info *pstat, *pstat_min=NULL; - struct list_head *phead, *plist; - int rssi_min= 0xff, i; - u1Byte idleAnt=priv->pshare->rf_ft_var.CurAntenna; - u1Byte nextAnt; - BOOLEAN bRet=FALSE; - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("odm_HwAntDiv==============>\n")); - - if((!priv->pshare->rf_ft_var.antHw_enable) ||(!(pDM_Odm->SupportAbility & ODM_BB_ANT_DIV))) - return; - - //if test, return - if(priv->pshare->rf_ft_var.CurAntenna & 0x80) - return; - - phead = &priv->asoc_list; - plist = phead->next; - ////========================= - //find mimum rssi sta - ////========================= - while(plist != phead) { - pstat = list_entry(plist, struct stat_info, asoc_list); - if((pstat->expire_to) && (pstat->AntRSSI[0] || pstat->AntRSSI[1])) { - int rssi = (pstat->AntRSSI[0] < pstat->AntRSSI[1]) ? pstat->AntRSSI[0] : pstat->AntRSSI[1]; - if((!pstat_min) || ( rssi < rssi_min) ) { - pstat_min = pstat; - rssi_min = rssi; - } - } - ///STA: found out default antenna - bRet=odm_StaDefAntSel(pDM_Odm, - pstat->hwRxAntSel[1], - pstat->hwRxAntSel[0], - pstat->cckPktCount[1], - pstat->cckPktCount[0], - &nextAnt - ); - - //if default antenna selection: successful - if(bRet){ - pstat->CurAntenna = nextAnt; - //update rssi - for(i=0; i<2; i++) { - if(pstat->cckPktCount[i]==0 && pstat->hwRxAntSel[i]==0) - pstat->AntRSSI[i] = 0; - } - if(pstat->AntRSSI[idleAnt]==0) - pstat->AntRSSI[idleAnt] = pstat->AntRSSI[idleAnt^1]; - // reset variables - pstat->hwRxAntSel[1] = pstat->hwRxAntSel[0] =0; - pstat->cckPktCount[1]= pstat->cckPktCount[0] =0; - } - - if (plist == plist->next) - break; - plist = plist->next; - - }; - ////========================= - //Choose RX Idle antenna according to minmum rssi - ////========================= - if(pstat_min) { - if(priv->pshare->rf_ft_var.CurAntenna!=pstat_min->CurAntenna) - odm_SetRxIdleAnt(pDM_Odm,pstat_min->CurAntenna,TRUE); - priv->pshare->rf_ft_var.CurAntenna = pstat_min->CurAntenna; - } - - -#ifdef TX_SHORTCUT - if (!priv->pmib->dot11OperationEntry.disable_txsc) { - plist = phead->next; - while(plist != phead) { - pstat = list_entry(plist, struct stat_info, asoc_list); - if(pstat->expire_to) { - for (i=0; itx_sc_ent[i].hwdesc1); - pdesc->Dword2 &= set_desc(~ (BIT(24)|BIT(25))); - if((pstat->CurAntenna^priv->pshare->rf_ft_var.CurAntenna)&1) - pdesc->Dword2 |= set_desc(BIT(24)|BIT(25)); - pdesc= &(pstat->tx_sc_ent[i].hwdesc2); - pdesc->Dword2 &= set_desc(~ (BIT(24)|BIT(25))); - if((pstat->CurAntenna^priv->pshare->rf_ft_var.CurAntenna)&1) - pdesc->Dword2 |= set_desc(BIT(24)|BIT(25)); - } - } - - if (plist == plist->next) - break; - plist = plist->next; - }; - } -#endif - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,"<==============odm_HwAntDiv\n"); -} -#endif - -u1Byte -ODM_Diversity_AntennaSelect( - IN PDM_ODM_T pDM_Odm, - IN u1Byte *data -) -{ - struct rtl8192cd_priv *priv=pDM_Odm->priv; - - int ant = _atoi(data, 16); - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("ODM_Diversity_AntennaSelect==============>\n")); - - #ifdef PCIE_POWER_SAVING - PCIeWakeUp(priv, POWER_DOWN_T0); - #endif - - if (ant==AUX_ANT || ant==MAIN_ANT) - { - if ( !priv->pshare->rf_ft_var.antSw_select) { - ODM_Write4Byte(pDM_Odm,0x870, ODM_Read4Byte(pDM_Odm,0x870) | BIT(8)| BIT(9) ); // ANTSEL A as SW control - ODM_Write1Byte(pDM_Odm,0xc50, ODM_Read1Byte(pDM_Odm,0xc50) & (~ BIT(7))); // rx OFDM SW control - PHY_SetBBReg(priv, 0x860, 0x300, ant); - } else { - ODM_Write4Byte(pDM_Odm,0x870, ODM_Read4Byte(pDM_Odm,0x870) | BIT(24)| BIT(25) ); // ANTSEL B as HW control - PHY_SetBBReg(priv, 0x864, 0x300, ant); - ODM_Write1Byte(pDM_Odm,0xc58, ODM_Read1Byte(pDM_Odm,0xc58) & (~ BIT(7))); // rx OFDM SW control - } - - ODM_Write1Byte(pDM_Odm,0xa01, ODM_Read1Byte(pDM_Odm,0xa01) & (~ BIT(7))); // rx CCK SW control - ODM_Write4Byte(pDM_Odm,0x80c, ODM_Read4Byte(pDM_Odm,0x80c) & (~ BIT(21))); // select ant by tx desc - ODM_Write4Byte(pDM_Odm,0x858, 0x569a569a); - - priv->pshare->rf_ft_var.antHw_enable = 0; - priv->pshare->rf_ft_var.CurAntenna = (ant%2); - - #ifdef SW_ANT_SWITCH - priv->pshare->rf_ft_var.antSw_enable = 0; - priv->pshare->DM_SWAT_Table.CurAntenna = ant; - priv->pshare->RSSI_test =0; - #endif - } - else if(ant==0){ - - if ( !priv->pshare->rf_ft_var.antSw_select) { - ODM_Write4Byte(pDM_Odm,0x870, ODM_Read4Byte(pDM_Odm,0x870) & ~(BIT(8)| BIT(9)) ); - ODM_Write1Byte(pDM_Odm,0xc50, ODM_Read1Byte(pDM_Odm,0xc50) | BIT(7)); // OFDM HW control - } else { - ODM_Write4Byte(pDM_Odm,0x870, ODM_Read4Byte(pDM_Odm,0x870) & ~(BIT(24)| BIT(25)) ); - ODM_Write1Byte(pDM_Odm,0xc58, ODM_Read1Byte(pDM_Odm,0xc58) | BIT(7)); // OFDM HW control - } - - ODM_Write1Byte(pDM_Odm,0xa01, ODM_Read1Byte(pDM_Odm,0xa01) | BIT(7)); // CCK HW control - ODM_Write4Byte(pDM_Odm,0x80c, ODM_Read4Byte(pDM_Odm,0x80c) | BIT(21) ); // by tx desc - priv->pshare->rf_ft_var.CurAntenna = 0; - ODM_Write4Byte(pDM_Odm,0x858, 0x569a569a); - priv->pshare->rf_ft_var.antHw_enable = 1; -#ifdef SW_ANT_SWITCH - priv->pshare->rf_ft_var.antSw_enable = 0; - priv->pshare->RSSI_test =0; -#endif - } -#ifdef SW_ANT_SWITCH - else if(ant==3) { - if(!priv->pshare->rf_ft_var.antSw_enable) { - - dm_SW_AntennaSwitchInit(priv); - ODM_Write4Byte(pDM_Odm,0x858, 0x569a569a); - priv->pshare->lastTxOkCnt = priv->net_stats.tx_bytes; - priv->pshare->lastRxOkCnt = priv->net_stats.rx_bytes; - } - if ( !priv->pshare->rf_ft_var.antSw_select) - ODM_Write1Byte(pDM_Odm,0xc50, ODM_Read1Byte(pDM_Odm,0xc50) & (~ BIT(7))); // rx OFDM SW control - else - ODM_Write1Byte(pDM_Odm,0xc58, ODM_Read1Byte(pDM_Odm,0xc58) & (~ BIT(7))); // rx OFDM SW control - - ODM_Write1Byte(pDM_Odm,0xa01, ODM_Read1Byte(pDM_Odm,0xa01) & (~ BIT(7))); // rx CCK SW control - ODM_Write4Byte(pDM_Odm,0x80c, ODM_Read4Byte(pDM_Odm,0x80c) & (~ BIT(21))); // select ant by tx desc - priv->pshare->rf_ft_var.antHw_enable = 0; - priv->pshare->rf_ft_var.antSw_enable = 1; - - } -#endif - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("<==============ODM_Diversity_AntennaSelect\n")); - - return 1; -} -#endif - -#else //#if(defined(CONFIG_HW_ANTENNA_DIVERSITY)) - -VOID odm_InitHybridAntDiv( IN PDM_ODM_T pDM_Odm ){} -VOID odm_HwAntDiv( IN PDM_ODM_T pDM_Odm){} -#if(DM_ODM_SUPPORT_TYPE==ODM_WIN) -VOID ODM_SetTxAntByTxInfo_88C_92D( - IN PDM_ODM_T pDM_Odm, - IN pu1Byte pDesc, - IN u1Byte macId -){} -#elif(DM_ODM_SUPPORT_TYPE==ODM_CE) -VOID ODM_SetTxAntByTxInfo_88C_92D( IN PDM_ODM_T pDM_Odm){ } -#elif(DM_ODM_SUPPORT_TYPE==ODM_AP) -VOID ODM_SetTxAntByTxInfo_88C_92D( IN PDM_ODM_T pDM_Odm){ } -#endif - -#endif //#if(defined(CONFIG_HW_ANTENNA_DIVERSITY)) - - - -//============================================================ -//EDCA Turbo -//============================================================ -VOID -ODM_EdcaTurboInit( - IN PDM_ODM_T pDM_Odm) -{ - -#if ((DM_ODM_SUPPORT_TYPE == ODM_AP)||(DM_ODM_SUPPORT_TYPE==ODM_ADSL)) - odm_EdcaParaInit(pDM_Odm); -#elif (DM_ODM_SUPPORT_TYPE==ODM_WIN) - PADAPTER Adapter = NULL; - HAL_DATA_TYPE *pHalData = NULL; - - if(pDM_Odm->Adapter==NULL) { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("EdcaTurboInit fail!!!\n")); - return; - } - - Adapter=pDM_Odm->Adapter; - pHalData=GET_HAL_DATA(Adapter); - - pDM_Odm->DM_EDCA_Table.bCurrentTurboEDCA = FALSE; - pDM_Odm->DM_EDCA_Table.bIsCurRDLState = FALSE; - pHalData->bIsAnyNonBEPkts = FALSE; - -#elif(DM_ODM_SUPPORT_TYPE==ODM_CE) - PADAPTER Adapter = pDM_Odm->Adapter; - pDM_Odm->DM_EDCA_Table.bCurrentTurboEDCA = FALSE; - pDM_Odm->DM_EDCA_Table.bIsCurRDLState = FALSE; - Adapter->recvpriv.bIsAnyNonBEPkts =FALSE; - -#endif - ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("Orginial VO PARAM: 0x%x\n",ODM_Read4Byte(pDM_Odm,ODM_EDCA_VO_PARAM))); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("Orginial VI PARAM: 0x%x\n",ODM_Read4Byte(pDM_Odm,ODM_EDCA_VI_PARAM))); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("Orginial BE PARAM: 0x%x\n",ODM_Read4Byte(pDM_Odm,ODM_EDCA_BE_PARAM))); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("Orginial BK PARAM: 0x%x\n",ODM_Read4Byte(pDM_Odm,ODM_EDCA_BK_PARAM))); - - -} // ODM_InitEdcaTurbo - -VOID -odm_EdcaTurboCheck( - IN PDM_ODM_T pDM_Odm - ) -{ - // - // For AP/ADSL use prtl8192cd_priv - // For CE/NIC use PADAPTER - // - - // - // 2011/09/29 MH In HW integration first stage, we provide 4 different handle to operate - // at the same time. In the stage2/3, we need to prive universal interface and merge all - // HW dynamic mechanism. - // - ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("odm_EdcaTurboCheck========================>\n")); - - if(!(pDM_Odm->SupportAbility& ODM_MAC_EDCA_TURBO )) - return; - - switch (pDM_Odm->SupportPlatform) - { - case ODM_WIN: - -#if(DM_ODM_SUPPORT_TYPE==ODM_WIN) - odm_EdcaTurboCheckMP(pDM_Odm); -#endif - break; - - case ODM_CE: -#if(DM_ODM_SUPPORT_TYPE==ODM_CE) - odm_EdcaTurboCheckCE(pDM_Odm); -#endif - break; - - case ODM_AP: - case ODM_ADSL: - -#if ((DM_ODM_SUPPORT_TYPE == ODM_AP)||(DM_ODM_SUPPORT_TYPE==ODM_ADSL)) - odm_IotEngine(pDM_Odm); -#endif - break; - } - ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("<========================odm_EdcaTurboCheck\n")); - -} // odm_CheckEdcaTurbo - -#if(DM_ODM_SUPPORT_TYPE==ODM_CE) - - -VOID -odm_EdcaTurboCheckCE( - IN PDM_ODM_T pDM_Odm - ) -{ - -#if(DM_ODM_SUPPORT_TYPE==ODM_CE) - - PADAPTER Adapter = pDM_Odm->Adapter; - u32 EDCA_BE_UL = 0x5ea42b;//Parameter suggested by Scott //edca_setting_UL[pMgntInfo->IOTPeer]; - u32 EDCA_BE_DL = 0x5ea42b;//Parameter suggested by Scott //edca_setting_DL[pMgntInfo->IOTPeer]; - u32 ICType=pDM_Odm->SupportICType; - u32 IOTPeer=0; - u8 WirelessMode=0xFF; //invalid value - u32 trafficIndex; - u32 edca_param; - u64 cur_tx_bytes = 0; - u64 cur_rx_bytes = 0; - u8 bbtchange = _FALSE; - u8 bBiasOnRx = _FALSE; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(Adapter); - struct xmit_priv *pxmitpriv = &(Adapter->xmitpriv); - struct recv_priv *precvpriv = &(Adapter->recvpriv); - struct registry_priv *pregpriv = &Adapter->registrypriv; - struct mlme_ext_priv *pmlmeext = &(Adapter->mlmeextpriv); - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - - if(pDM_Odm->bLinked != _TRUE) - goto dm_CheckEdcaTurbo_EXIT; - - if ((pregpriv->wifi_spec == 1) )//|| (pmlmeinfo->HT_enable == 0)) - { - goto dm_CheckEdcaTurbo_EXIT; - } - - if(pDM_Odm->pWirelessMode!=NULL) - WirelessMode=*(pDM_Odm->pWirelessMode); - - IOTPeer = pmlmeinfo->assoc_AP_vendor; - - if (IOTPeer >= HT_IOT_PEER_MAX) - { - goto dm_CheckEdcaTurbo_EXIT; - } - - if( (pDM_Odm->SupportICType == ODM_RTL8192C) || - (pDM_Odm->SupportICType == ODM_RTL8723A) || - (pDM_Odm->SupportICType == ODM_RTL8188E)) - { - if((IOTPeer == HT_IOT_PEER_RALINK)||(IOTPeer == HT_IOT_PEER_ATHEROS)) - bBiasOnRx = _TRUE; - } - - // Check if the status needs to be changed. - if((bbtchange) || (!precvpriv->bIsAnyNonBEPkts) ) - { - cur_tx_bytes = pdvobjpriv->traffic_stat.cur_tx_bytes; - cur_rx_bytes = pdvobjpriv->traffic_stat.cur_rx_bytes; - - //traffic, TX or RX - if(bBiasOnRx) - { - if (cur_tx_bytes > (cur_rx_bytes << 2)) - { // Uplink TP is present. - trafficIndex = UP_LINK; - } - else - { // Balance TP is present. - trafficIndex = DOWN_LINK; - } - } - else - { - if (cur_rx_bytes > (cur_tx_bytes << 2)) - { // Downlink TP is present. - trafficIndex = DOWN_LINK; - } - else - { // Balance TP is present. - trafficIndex = UP_LINK; - } - } - - //if ((pDM_Odm->DM_EDCA_Table.prv_traffic_idx != trafficIndex) || (!pDM_Odm->DM_EDCA_Table.bCurrentTurboEDCA)) - { - if(ICType==ODM_RTL8192D) - { - // Single PHY - if(pDM_Odm->RFType==ODM_2T2R) - { - EDCA_BE_UL = 0x60a42b; //0x5ea42b; - EDCA_BE_DL = 0x60a42b; //0x5ea42b; - } - else - { - EDCA_BE_UL = 0x6ea42b; - EDCA_BE_DL = 0x6ea42b; - } - } - else - { - if(pDM_Odm->SupportInterface==ODM_ITRF_PCIE) { - if((ICType==ODM_RTL8192C)&&(pDM_Odm->RFType==ODM_2T2R)) { - EDCA_BE_UL = 0x60a42b; - EDCA_BE_DL = 0x60a42b; - } - else - { - EDCA_BE_UL = 0x6ea42b; - EDCA_BE_DL = 0x6ea42b; - } - } - } - - //92D txop can't be set to 0x3e for cisco1250 - if((ICType!=ODM_RTL8192D) && (IOTPeer== HT_IOT_PEER_CISCO) &&(WirelessMode==ODM_WM_N24G)) - { - EDCA_BE_DL = edca_setting_DL[IOTPeer]; - EDCA_BE_UL = edca_setting_UL[IOTPeer]; - } - //merge from 92s_92c_merge temp brunch v2445 20120215 - else if((IOTPeer == HT_IOT_PEER_CISCO) &&((WirelessMode==ODM_WM_G)||(WirelessMode==(ODM_WM_B|ODM_WM_G))||(WirelessMode==ODM_WM_A)||(WirelessMode==ODM_WM_B))) - { - EDCA_BE_DL = edca_setting_DL_GMode[IOTPeer]; - } - else if((IOTPeer== HT_IOT_PEER_AIRGO )&& ((WirelessMode==ODM_WM_G)||(WirelessMode==ODM_WM_A))) - { - EDCA_BE_DL = 0xa630; - } - else if(IOTPeer == HT_IOT_PEER_MARVELL) - { - EDCA_BE_DL = edca_setting_DL[IOTPeer]; - EDCA_BE_UL = edca_setting_UL[IOTPeer]; - } - else if(IOTPeer == HT_IOT_PEER_ATHEROS) - { - // Set DL EDCA for Atheros peer to 0x3ea42b. Suggested by SD3 Wilson for ASUS TP issue. - EDCA_BE_DL = edca_setting_DL[IOTPeer]; - } - - if((ICType==ODM_RTL8812)||(ICType==ODM_RTL8821)||(ICType==ODM_RTL8192E)) //add 8812AU/8812AE - { - EDCA_BE_UL = 0x5ea42b; - EDCA_BE_DL = 0x5ea42b; - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("8812A: EDCA_BE_UL=0x%x EDCA_BE_DL =0x%x",EDCA_BE_UL,EDCA_BE_DL)); - } - - if (trafficIndex == DOWN_LINK) - edca_param = EDCA_BE_DL; - else - edca_param = EDCA_BE_UL; - - rtw_write32(Adapter, REG_EDCA_BE_PARAM, edca_param); - - pDM_Odm->DM_EDCA_Table.prv_traffic_idx = trafficIndex; - } - - pDM_Odm->DM_EDCA_Table.bCurrentTurboEDCA = _TRUE; - } - else - { - // - // Turn Off EDCA turbo here. - // Restore original EDCA according to the declaration of AP. - // - if(pDM_Odm->DM_EDCA_Table.bCurrentTurboEDCA) - { - rtw_write32(Adapter, REG_EDCA_BE_PARAM, pHalData->AcParam_BE); - pDM_Odm->DM_EDCA_Table.bCurrentTurboEDCA = _FALSE; - } - } - -dm_CheckEdcaTurbo_EXIT: - // Set variables for next time. - precvpriv->bIsAnyNonBEPkts = _FALSE; -#endif -} - - -#elif(DM_ODM_SUPPORT_TYPE==ODM_WIN) -VOID -odm_EdcaTurboCheckMP( - IN PDM_ODM_T pDM_Odm - ) -{ - - - PADAPTER Adapter = pDM_Odm->Adapter; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - - PADAPTER pDefaultAdapter = GetDefaultAdapter(Adapter); - PADAPTER pExtAdapter = GetFirstExtAdapter(Adapter);//NULL; - PMGNT_INFO pMgntInfo = &Adapter->MgntInfo; - PSTA_QOS pStaQos = Adapter->MgntInfo.pStaQos; - //[Win7 Count Tx/Rx statistic for Extension Port] odm_CheckEdcaTurbo's Adapter is always Default. 2009.08.20, by Bohn - u8Byte Ext_curTxOkCnt = 0; - u8Byte Ext_curRxOkCnt = 0; - //For future Win7 Enable Default Port to modify AMPDU size dynamically, 2009.08.20, Bohn. - u1Byte TwoPortStatus = (u1Byte)TWO_PORT_STATUS__WITHOUT_ANY_ASSOCIATE; - - // Keep past Tx/Rx packet count for RT-to-RT EDCA turbo. - u8Byte curTxOkCnt = 0; - u8Byte curRxOkCnt = 0; - u4Byte EDCA_BE_UL = 0x5ea42b;//Parameter suggested by Scott //edca_setting_UL[pMgntInfo->IOTPeer]; - u4Byte EDCA_BE_DL = 0x5ea42b;//Parameter suggested by Scott //edca_setting_DL[pMgntInfo->IOTPeer]; - u4Byte EDCA_BE = 0x5ea42b; - u1Byte IOTPeer=0; - BOOLEAN *pbIsCurRDLState=NULL; - BOOLEAN bLastIsCurRDLState=FALSE; - BOOLEAN bBiasOnRx=FALSE; - BOOLEAN bEdcaTurboOn=FALSE; - u1Byte TxRate = 0xFF; - u8Byte value64; - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("odm_EdcaTurboCheckMP========================>")); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("Orginial BE PARAM: 0x%x\n",ODM_Read4Byte(pDM_Odm,ODM_EDCA_BE_PARAM))); - -////=============================== -////list paramter for different platform -////=============================== - bLastIsCurRDLState=pDM_Odm->DM_EDCA_Table.bIsCurRDLState; - pbIsCurRDLState=&(pDM_Odm->DM_EDCA_Table.bIsCurRDLState); - - //2012/09/14 MH Add - if (pMgntInfo->NumNonBePkt > pMgntInfo->RegEdcaThresh && !Adapter->MgntInfo.bWiFiConfg) - pHalData->bIsAnyNonBEPkts = TRUE; - - pMgntInfo->NumNonBePkt = 0; - - // Caculate TX/RX TP: - //curTxOkCnt = Adapter->TxStats.NumTxBytesUnicast - pMgntInfo->lastTxOkCnt; - //curRxOkCnt = Adapter->RxStats.NumRxBytesUnicast - pMgntInfo->lastRxOkCnt; - curTxOkCnt = Adapter->TxStats.NumTxBytesUnicast - pDM_Odm->lastTxOkCnt; - curRxOkCnt = Adapter->RxStats.NumRxBytesUnicast - pDM_Odm->lastRxOkCnt; - pDM_Odm->lastTxOkCnt = Adapter->TxStats.NumTxBytesUnicast; - pDM_Odm->lastRxOkCnt = Adapter->RxStats.NumRxBytesUnicast; - - if(pExtAdapter == NULL) - pExtAdapter = pDefaultAdapter; - - Ext_curTxOkCnt = pExtAdapter->TxStats.NumTxBytesUnicast - pMgntInfo->Ext_lastTxOkCnt; - Ext_curRxOkCnt = pExtAdapter->RxStats.NumRxBytesUnicast - pMgntInfo->Ext_lastRxOkCnt; - GetTwoPortSharedResource(Adapter,TWO_PORT_SHARED_OBJECT__STATUS,NULL,&TwoPortStatus); - //For future Win7 Enable Default Port to modify AMPDU size dynamically, 2009.08.20, Bohn. - if(TwoPortStatus == TWO_PORT_STATUS__EXTENSION_ONLY) - { - curTxOkCnt = Ext_curTxOkCnt ; - curRxOkCnt = Ext_curRxOkCnt ; - } - // - IOTPeer=pMgntInfo->IOTPeer; - bBiasOnRx=(pMgntInfo->IOTAction & HT_IOT_ACT_EDCA_BIAS_ON_RX)?TRUE:FALSE; - bEdcaTurboOn=((!pHalData->bIsAnyNonBEPkts) && (!pMgntInfo->bDisableFrameBursting))?TRUE:FALSE; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("bIsAnyNonBEPkts : 0x%lx bDisableFrameBursting : 0x%lx \n",pHalData->bIsAnyNonBEPkts,pMgntInfo->bDisableFrameBursting)); - - -////=============================== -////check if edca turbo is disabled -////=============================== - if(odm_IsEdcaTurboDisable(pDM_Odm)) - goto dm_CheckEdcaTurbo_EXIT; - - -////=============================== -////remove iot case out -////=============================== - ODM_EdcaParaSelByIot(pDM_Odm, &EDCA_BE_UL, &EDCA_BE_DL); - - -////=============================== -////Check if the status needs to be changed. -////=============================== - if(bEdcaTurboOn) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("bEdcaTurboOn : 0x%x bBiasOnRx : 0x%x\n",bEdcaTurboOn,bBiasOnRx)); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("curTxOkCnt : 0x%lx \n",curTxOkCnt)); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("curRxOkCnt : 0x%lx \n",curRxOkCnt)); - if(bBiasOnRx) - odm_EdcaChooseTrafficIdx(pDM_Odm,curTxOkCnt, curRxOkCnt, TRUE, pbIsCurRDLState); - else - odm_EdcaChooseTrafficIdx(pDM_Odm,curTxOkCnt, curRxOkCnt, FALSE, pbIsCurRDLState); - -//modify by Guo.Mingzhi 2011-12-29 - EDCA_BE=((*pbIsCurRDLState)==TRUE)?EDCA_BE_DL:EDCA_BE_UL; - if(IS_HARDWARE_TYPE_8821U(Adapter)) - { - if(pMgntInfo->RegTxDutyEnable) - { - //2013.01.23 LukeLee: debug for 8811AU thermal issue (reduce Tx duty cycle) - if(!pMgntInfo->ForcedDataRate) //auto rate - { - if(pDM_Odm->TxRate != 0xFF) - TxRate = Adapter->HalFunc.GetHwRateFromMRateHandler(pDM_Odm->TxRate); - } - else //force rate - { - TxRate = (u1Byte) pMgntInfo->ForcedDataRate; - } - - value64 = (curRxOkCnt<<2); - if(curTxOkCnt < value64) //Downlink - ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,EDCA_BE); - else //Uplink - { - //DbgPrint("pDM_Odm->RFCalibrateInfo.ThermalValue = 0x%X\n", pDM_Odm->RFCalibrateInfo.ThermalValue); - //if(pDM_Odm->RFCalibrateInfo.ThermalValue < pHalData->EEPROMThermalMeter) - if((pDM_Odm->RFCalibrateInfo.ThermalValue < 0x2c) || (*pDM_Odm->pBandType == BAND_ON_2_4G)) - ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,EDCA_BE); - else - { - switch (TxRate) - { - case MGN_VHT1SS_MCS6: - case MGN_VHT1SS_MCS5: - case MGN_MCS6: - case MGN_MCS5: - case MGN_48M: - case MGN_54M: - ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,0x1ea42b); - break; - case MGN_VHT1SS_MCS4: - case MGN_MCS4: - case MGN_36M: - ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,0xa42b); - break; - case MGN_VHT1SS_MCS3: - case MGN_MCS3: - case MGN_24M: - ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,0xa47f); - break; - case MGN_VHT1SS_MCS2: - case MGN_MCS2: - case MGN_18M: - ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,0xa57f); - break; - case MGN_VHT1SS_MCS1: - case MGN_MCS1: - case MGN_9M: - case MGN_12M: - ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,0xa77f); - break; - case MGN_VHT1SS_MCS0: - case MGN_MCS0: - case MGN_6M: - ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,0xa87f); - break; - default: - ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,EDCA_BE); - break; - } - } - } - } - else - { - ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,EDCA_BE); - } - - } - else if (IS_HARDWARE_TYPE_8812AU(Adapter)){ - if(pMgntInfo->RegTxDutyEnable) - { - //2013.07.26 Wilson: debug for 8812AU thermal issue (reduce Tx duty cycle) - // it;s the same issue as 8811AU - if(!pMgntInfo->ForcedDataRate) //auto rate - { - if(pDM_Odm->TxRate != 0xFF) - TxRate = Adapter->HalFunc.GetHwRateFromMRateHandler(pDM_Odm->TxRate); - } - else //force rate - { - TxRate = (u1Byte) pMgntInfo->ForcedDataRate; - } - - value64 = (curRxOkCnt<<2); - if(curTxOkCnt < value64) //Downlink - ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,EDCA_BE); - else //Uplink - { - //DbgPrint("pDM_Odm->RFCalibrateInfo.ThermalValue = 0x%X\n", pDM_Odm->RFCalibrateInfo.ThermalValue); - //if(pDM_Odm->RFCalibrateInfo.ThermalValue < pHalData->EEPROMThermalMeter) - if((pDM_Odm->RFCalibrateInfo.ThermalValue < 0x2c) || (*pDM_Odm->pBandType == BAND_ON_2_4G)) - ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,EDCA_BE); - else - { - switch (TxRate) - { - case MGN_VHT2SS_MCS9: - case MGN_VHT1SS_MCS9: - case MGN_VHT1SS_MCS8: - case MGN_MCS15: - case MGN_MCS7: - ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,0x1ea44f); - case MGN_VHT2SS_MCS8: - case MGN_VHT1SS_MCS7: - case MGN_MCS14: - case MGN_MCS6: - case MGN_54M: - ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,0xa44f); - case MGN_VHT2SS_MCS7: - case MGN_VHT2SS_MCS6: - case MGN_VHT1SS_MCS6: - case MGN_VHT1SS_MCS5: - case MGN_MCS13: - case MGN_MCS5: - case MGN_48M: - ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,0xa630); - break; - case MGN_VHT2SS_MCS5: - case MGN_VHT2SS_MCS4: - case MGN_VHT1SS_MCS4: - case MGN_VHT1SS_MCS3: - case MGN_MCS12: - case MGN_MCS4: - case MGN_MCS3: - case MGN_36M: - case MGN_24M: - ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,0xa730); - break; - case MGN_VHT2SS_MCS3: - case MGN_VHT2SS_MCS2: - case MGN_VHT2SS_MCS1: - case MGN_VHT1SS_MCS2: - case MGN_VHT1SS_MCS1: - case MGN_MCS11: - case MGN_MCS10: - case MGN_MCS9: - case MGN_MCS2: - case MGN_MCS1: - case MGN_18M: - case MGN_12M: - ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,0xa830); - break; - case MGN_VHT2SS_MCS0: - case MGN_VHT1SS_MCS0: - case MGN_MCS0: - case MGN_MCS8: - case MGN_9M: - case MGN_6M: - ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,0xa87f); - break; - default: - ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,EDCA_BE); - break; - } - } - } - } - else - { - ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,EDCA_BE); - } - } - else - ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,EDCA_BE); - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("EDCA Turbo on: EDCA_BE:0x%lx\n",EDCA_BE)); - - pDM_Odm->DM_EDCA_Table.bCurrentTurboEDCA = TRUE; - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("EDCA_BE_DL : 0x%lx EDCA_BE_UL : 0x%lx EDCA_BE : 0x%lx \n",EDCA_BE_DL,EDCA_BE_UL,EDCA_BE)); - - } - else - { - // Turn Off EDCA turbo here. - // Restore original EDCA according to the declaration of AP. - if(pDM_Odm->DM_EDCA_Table.bCurrentTurboEDCA) - { - Adapter->HalFunc.SetHwRegHandler(Adapter, HW_VAR_AC_PARAM, GET_WMM_PARAM_ELE_SINGLE_AC_PARAM(pStaQos->WMMParamEle, AC0_BE) ); - - pDM_Odm->DM_EDCA_Table.bCurrentTurboEDCA = FALSE; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("Restore EDCA BE: 0x%lx \n",pDM_Odm->WMMEDCA_BE)); - - } - } - -////=============================== -////Set variables for next time. -////=============================== -dm_CheckEdcaTurbo_EXIT: -#if (DM_ODM_SUPPORT_TYPE==ODM_WIN) - pHalData->bIsAnyNonBEPkts = FALSE; - pMgntInfo->lastTxOkCnt = Adapter->TxStats.NumTxBytesUnicast; - pMgntInfo->lastRxOkCnt = Adapter->RxStats.NumRxBytesUnicast; - pMgntInfo->Ext_lastTxOkCnt = pExtAdapter->TxStats.NumTxBytesUnicast; - pMgntInfo->Ext_lastRxOkCnt = pExtAdapter->RxStats.NumRxBytesUnicast; -#elif (DM_ODM_SUPPORT_TYPE==ODM_CE) - precvpriv->bIsAnyNonBEPkts = FALSE; - pxmitpriv->last_tx_bytes = pxmitpriv->tx_bytes; - precvpriv->last_rx_bytes = precvpriv->rx_bytes; -#endif - -} - - -//check if edca turbo is disabled -BOOLEAN -odm_IsEdcaTurboDisable( - IN PDM_ODM_T pDM_Odm -) -{ - PADAPTER Adapter = pDM_Odm->Adapter; - -#if(DM_ODM_SUPPORT_TYPE==ODM_WIN) - PMGNT_INFO pMgntInfo = &Adapter->MgntInfo; - u4Byte IOTPeer=pMgntInfo->IOTPeer; -#elif (DM_ODM_SUPPORT_TYPE==ODM_CE) - struct registry_priv *pregpriv = &Adapter->registrypriv; - struct mlme_ext_priv *pmlmeext = &(Adapter->mlmeextpriv); - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - u4Byte IOTPeer=pmlmeinfo->assoc_AP_vendor; - u1Byte WirelessMode=0xFF; //invalid value - - if(pDM_Odm->pWirelessMode!=NULL) - WirelessMode=*(pDM_Odm->pWirelessMode); - -#endif - - if(pDM_Odm->bBtDisableEdcaTurbo) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD, ("EdcaTurboDisable for BT!!\n")); - return TRUE; - } - - if((!(pDM_Odm->SupportAbility& ODM_MAC_EDCA_TURBO ))|| - (pDM_Odm->bWIFITest)|| - (IOTPeer>= HT_IOT_PEER_MAX)) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD, ("EdcaTurboDisable\n")); - return TRUE; - } - - -#if (DM_ODM_SUPPORT_TYPE ==ODM_WIN) - // 1. We do not turn on EDCA turbo mode for some AP that has IOT issue - // 2. User may disable EDCA Turbo mode with OID settings. - if(pMgntInfo->IOTAction & HT_IOT_ACT_DISABLE_EDCA_TURBO){ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD, ("IOTAction:EdcaTurboDisable\n")); - return TRUE; - } - -#elif(DM_ODM_SUPPORT_TYPE==ODM_CE) - //suggested by Jr.Luke: open TXOP for B/G/BG/A mode 2012-0215 - if((WirelessMode==ODM_WM_B)||(WirelessMode==(ODM_WM_B|ODM_WM_G)||(WirelessMode==ODM_WM_G)||(WirelessMode=ODM_WM_A)) - ODM_Write4Byte(pDM_Odm, ODM_EDCA_BE_PARAM, ODM_Read4Byte(pDM_Odm, ODM_EDCA_BE_PARAM)|0x5E0000); - - if(pDM_Odm->SupportICType==ODM_RTL8192D) { - if ((pregpriv->wifi_spec == 1) || (pmlmeext->cur_wireless_mode == WIRELESS_11B)) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD, ("92D:EdcaTurboDisable\n")); - return TRUE; - } - } - else - { - if((pregpriv->wifi_spec == 1) || (pmlmeinfo->HT_enable == 0)){ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD, ("Others:EdcaTurboDisable\n")); - return TRUE; - } - } - -#endif - - return FALSE; - - -} - -//add iot case here: for MP/CE -VOID -ODM_EdcaParaSelByIot( - IN PDM_ODM_T pDM_Odm, - OUT u4Byte *EDCA_BE_UL, - OUT u4Byte *EDCA_BE_DL - ) -{ - - PADAPTER Adapter = pDM_Odm->Adapter; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - u4Byte IOTPeer=0; - u4Byte ICType=pDM_Odm->SupportICType; - u1Byte WirelessMode=0xFF; //invalid value - u4Byte RFType=pDM_Odm->RFType; - u4Byte IOTPeerSubType=0; - -#if(DM_ODM_SUPPORT_TYPE==ODM_WIN) - PMGNT_INFO pMgntInfo = &Adapter->MgntInfo; - u1Byte TwoPortStatus = (u1Byte)TWO_PORT_STATUS__WITHOUT_ANY_ASSOCIATE; - -#elif(DM_ODM_SUPPORT_TYPE==ODM_CE) - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - #ifdef CONFIG_BT_COEXIST - struct btcoexist_priv *pbtpriv = &(pHalData->bt_coexist); - #endif - u1Byte bbtchange =FALSE; -#endif - - if(pDM_Odm->pWirelessMode!=NULL) - WirelessMode=*(pDM_Odm->pWirelessMode); - -/////////////////////////////////////////////////////////// -////list paramter for different platform -#if (DM_ODM_SUPPORT_TYPE==ODM_WIN) - IOTPeer=pMgntInfo->IOTPeer; - IOTPeerSubType=pMgntInfo->IOTPeerSubtype; - GetTwoPortSharedResource(Adapter,TWO_PORT_SHARED_OBJECT__STATUS,NULL,&TwoPortStatus); - -#elif(DM_ODM_SUPPORT_TYPE==ODM_CE) - IOTPeer=pmlmeinfo->assoc_AP_vendor; - #ifdef CONFIG_BT_COEXIST - if(pbtpriv->BT_Coexist) - { - if( (pbtpriv->BT_EDCA[UP_LINK]!=0) || (pbtpriv->BT_EDCA[DOWN_LINK]!=0)) - bbtchange = TRUE; - } - #endif - -#endif - - if(ICType==ODM_RTL8192D) - { - // Single PHY - if(pDM_Odm->RFType==ODM_2T2R) - { - (*EDCA_BE_UL) = 0x60a42b; //0x5ea42b; - (*EDCA_BE_DL) = 0x60a42b; //0x5ea42b; - - } - else - { - (*EDCA_BE_UL) = 0x6ea42b; - (*EDCA_BE_DL) = 0x6ea42b; - } - - } -////============================ -/// IOT case for MP -////============================ -#if (DM_ODM_SUPPORT_TYPE==ODM_WIN) - else - { - - if(pDM_Odm->SupportInterface==ODM_ITRF_PCIE){ - if((ICType==ODM_RTL8192C)&&(pDM_Odm->RFType==ODM_2T2R)) { - (*EDCA_BE_UL) = 0x60a42b; - (*EDCA_BE_DL) = 0x60a42b; - } - else - { - (*EDCA_BE_UL) = 0x6ea42b; - (*EDCA_BE_DL) = 0x6ea42b; - } - } - } - - if(TwoPortStatus == TWO_PORT_STATUS__EXTENSION_ONLY) - { - (*EDCA_BE_UL) = 0x5ea42b;//Parameter suggested by Scott //edca_setting_UL[ExtAdapter->MgntInfo.IOTPeer]; - (*EDCA_BE_DL) = 0x5ea42b;//Parameter suggested by Scott //edca_setting_DL[ExtAdapter->MgntInfo.IOTPeer]; - } - - #if (INTEL_PROXIMITY_SUPPORT == 1) - if(pMgntInfo->IntelClassModeInfo.bEnableCA == TRUE) - { - (*EDCA_BE_UL) = (*EDCA_BE_DL) = 0xa44f; - } - else - #endif - { - if((!pMgntInfo->bDisableFrameBursting) && - (pMgntInfo->IOTAction & (HT_IOT_ACT_FORCED_ENABLE_BE_TXOP|HT_IOT_ACT_AMSDU_ENABLE))) - {// To check whether we shall force turn on TXOP configuration. - if(!((*EDCA_BE_UL) & 0xffff0000)) - (*EDCA_BE_UL) |= 0x005e0000; // Force TxOP limit to 0x005e for UL. - if(!((*EDCA_BE_DL) & 0xffff0000)) - (*EDCA_BE_DL) |= 0x005e0000; // Force TxOP limit to 0x005e for DL. - } - - //92D txop can't be set to 0x3e for cisco1250 - if((ICType!=ODM_RTL8192D) && (IOTPeer== HT_IOT_PEER_CISCO) &&(WirelessMode==ODM_WM_N24G)) - { - (*EDCA_BE_DL) = edca_setting_DL[IOTPeer]; - (*EDCA_BE_UL) = edca_setting_UL[IOTPeer]; - } - //merge from 92s_92c_merge temp brunch v2445 20120215 - else if((IOTPeer == HT_IOT_PEER_CISCO) &&((WirelessMode==ODM_WM_G)||(WirelessMode==(ODM_WM_B|ODM_WM_G))||(WirelessMode==ODM_WM_A)||(WirelessMode==ODM_WM_B))) - { - (*EDCA_BE_DL) = edca_setting_DL_GMode[IOTPeer]; - } - else if((IOTPeer== HT_IOT_PEER_AIRGO )&& ((WirelessMode==ODM_WM_G)||(WirelessMode==ODM_WM_A))) - { - (*EDCA_BE_DL) = 0xa630; - } - - else if(IOTPeer == HT_IOT_PEER_MARVELL) - { - (*EDCA_BE_DL) = edca_setting_DL[IOTPeer]; - (*EDCA_BE_UL) = edca_setting_UL[IOTPeer]; - } - else if(IOTPeer == HT_IOT_PEER_ATHEROS) - { - // Set DL EDCA for Atheros peer to 0x3ea42b. Suggested by SD3 Wilson for ASUS TP issue. - (*EDCA_BE_DL) = edca_setting_DL[IOTPeer]; - - if(ICType == ODM_RTL8821) - (*EDCA_BE_DL) = 0x5ea630; - - } - } - - if((ICType == ODM_RTL8192D)&&(IOTPeerSubType == HT_IOT_PEER_LINKSYS_E4200_V1)&&((WirelessMode==ODM_WM_N5G))) - { - (*EDCA_BE_DL) = 0x432b; - (*EDCA_BE_UL) = 0x432b; - } - - - - if((ICType==ODM_RTL8812)||(ICType==ODM_RTL8192E)) //add 8812AU/8812AE - { - (*EDCA_BE_UL) = 0x5ea42b; - (*EDCA_BE_DL) = 0x5ea42b; - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("8812A: EDCA_BE_UL=0x%lx EDCA_BE_DL =0x%lx",(*EDCA_BE_UL),(*EDCA_BE_DL))); - } - - // Revised for Atheros DIR-655 IOT issue to improve down link TP, added by Roger, 2013.03.22. - if((ICType == ODM_RTL8723A) && (IOTPeerSubType== HT_IOT_PEER_ATHEROS_DIR655) && - (pMgntInfo->dot11CurrentChannelNumber == 6)) - { - (*EDCA_BE_DL) = 0xa92b; - } - -////============================ -/// IOT case for CE -////============================ -#elif (DM_ODM_SUPPORT_TYPE==ODM_CE) - - if(RFType==ODM_RTL8192D) - { - if((IOTPeer == HT_IOT_PEER_CISCO) &&(WirelessMode==ODM_WM_N24G)) - { - (*EDCA_BE_UL) = EDCAParam[IOTPeer][UP_LINK]; - (*EDCA_BE_DL)=EDCAParam[IOTPeer][DOWN_LINK]; - } - else if((IOTPeer == HT_IOT_PEER_AIRGO) && - ((WirelessMode==ODM_WM_B)||(WirelessMode==(ODM_WM_B|ODM_WM_G)))) - (*EDCA_BE_DL)=0x00a630; - - else if((IOTPeer== HT_IOT_PEER_ATHEROS) && - (WirelessMode&ODM_WM_N5G) && - (Adapter->securitypriv.dot11PrivacyAlgrthm == _AES_ )) - (*EDCA_BE_DL)=0xa42b; - - } - //92C IOT case: - else - { - #ifdef CONFIG_BT_COEXIST - if(bbtchange) - { - (*EDCA_BE_UL) = pbtpriv->BT_EDCA[UP_LINK]; - (*EDCA_BE_DL) = pbtpriv->BT_EDCA[DOWN_LINK]; - } - else - #endif - { - if((IOTPeer == HT_IOT_PEER_CISCO) &&(WirelessMode==ODM_WM_N24G)) - { - (*EDCA_BE_UL) = EDCAParam[IOTPeer][UP_LINK]; - (*EDCA_BE_DL)=EDCAParam[IOTPeer][DOWN_LINK]; - } - else - { - (*EDCA_BE_UL)=EDCAParam[HT_IOT_PEER_UNKNOWN][UP_LINK]; - (*EDCA_BE_DL)=EDCAParam[HT_IOT_PEER_UNKNOWN][DOWN_LINK]; - } - } - if(pDM_Odm->SupportInterface==ODM_ITRF_PCIE){ - if((ICType==ODM_RTL8192C)&&(pDM_Odm->RFType==ODM_2T2R)) - { - (*EDCA_BE_UL) = 0x60a42b; - (*EDCA_BE_DL) = 0x60a42b; - } - else - { - (*EDCA_BE_UL) = 0x6ea42b; - (*EDCA_BE_DL) = 0x6ea42b; - } - } - - } -#endif - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("Special: EDCA_BE_UL=0x%lx EDCA_BE_DL =0x%lx",(*EDCA_BE_UL),(*EDCA_BE_DL))); - -} - - -VOID -odm_EdcaChooseTrafficIdx( - IN PDM_ODM_T pDM_Odm, - IN u8Byte cur_tx_bytes, - IN u8Byte cur_rx_bytes, - IN BOOLEAN bBiasOnRx, - OUT BOOLEAN *pbIsCurRDLState - ) -{ - - - if(bBiasOnRx) - { - - if(cur_tx_bytes>(cur_rx_bytes*4)) - { - *pbIsCurRDLState=FALSE; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("Uplink Traffic\n ")); - - } - else - { - *pbIsCurRDLState=TRUE; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("Balance Traffic\n")); - - } - } - else - { - if(cur_rx_bytes>(cur_tx_bytes*4)) - { - *pbIsCurRDLState=TRUE; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("Downlink Traffic\n")); - - } - else - { - *pbIsCurRDLState=FALSE; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("Balance Traffic\n")); - } - } - - return ; -} - -#endif - -#if((DM_ODM_SUPPORT_TYPE==ODM_AP)||(DM_ODM_SUPPORT_TYPE==ODM_ADSL)) - -void odm_EdcaParaInit( - IN PDM_ODM_T pDM_Odm - ) -{ - prtl8192cd_priv priv = pDM_Odm->priv; - int mode=priv->pmib->dot11BssType.net_work_type; - - static unsigned int slot_time, VO_TXOP, VI_TXOP, sifs_time; - struct ParaRecord EDCA[4]; - - memset(EDCA, 0, 4*sizeof(struct ParaRecord)); - - sifs_time = 10; - slot_time = 20; - - if (mode & (ODM_WM_N24G|ODM_WM_N5G)) - sifs_time = 16; - - if (mode & (ODM_WM_N24G|ODM_WM_N5G| ODM_WM_G|ODM_WM_A)) - slot_time = 9; - - -#if((defined(RTL_MANUAL_EDCA))&&(DM_ODM_SUPPORT_TYPE==ODM_AP)) - if( priv->pmib->dot11QosEntry.ManualEDCA ) { - if( OPMODE & WIFI_AP_STATE ) - memcpy(EDCA, priv->pmib->dot11QosEntry.AP_manualEDCA, 4*sizeof(struct ParaRecord)); - else - memcpy(EDCA, priv->pmib->dot11QosEntry.STA_manualEDCA, 4*sizeof(struct ParaRecord)); - - #ifdef WIFI_WMM - if (QOS_ENABLE) - ODM_Write4Byte(pDM_Odm, ODM_EDCA_VI_PARAM, (EDCA[VI].TXOPlimit<< 16) | (EDCA[VI].ECWmax<< 12) | (EDCA[VI].ECWmin<< 8) | (sifs_time + EDCA[VI].AIFSN* slot_time)); - else - #endif - ODM_Write4Byte(pDM_Odm, ODM_EDCA_VI_PARAM, (EDCA[BE].TXOPlimit<< 16) | (EDCA[BE].ECWmax<< 12) | (EDCA[BE].ECWmin<< 8) | (sifs_time + EDCA[VI].AIFSN* slot_time)); - - }else - #endif //RTL_MANUAL_EDCA - { - - if(OPMODE & WIFI_AP_STATE) - { - memcpy(EDCA, rtl_ap_EDCA, 2*sizeof(struct ParaRecord)); - - if(mode & (ODM_WM_A|ODM_WM_G|ODM_WM_N24G|ODM_WM_N5G)) - memcpy(&EDCA[VI], &rtl_ap_EDCA[VI_AG], 2*sizeof(struct ParaRecord)); - else - memcpy(&EDCA[VI], &rtl_ap_EDCA[VI], 2*sizeof(struct ParaRecord)); - } - else - { - memcpy(EDCA, rtl_sta_EDCA, 2*sizeof(struct ParaRecord)); - - if(mode & (ODM_WM_A|ODM_WM_G|ODM_WM_N24G|ODM_WM_N5G)) - memcpy(&EDCA[VI], &rtl_sta_EDCA[VI_AG], 2*sizeof(struct ParaRecord)); - else - memcpy(&EDCA[VI], &rtl_sta_EDCA[VI], 2*sizeof(struct ParaRecord)); - } - - #ifdef WIFI_WMM - if (QOS_ENABLE) - ODM_Write4Byte(pDM_Odm, ODM_EDCA_VI_PARAM, (EDCA[VI].TXOPlimit<< 16) | (EDCA[VI].ECWmax<< 12) | (EDCA[VI].ECWmin<< 8) | (sifs_time + EDCA[VI].AIFSN* slot_time)); - else - #endif - -#if (DM_ODM_SUPPORT_TYPE==ODM_AP) - ODM_Write4Byte(pDM_Odm, ODM_EDCA_VI_PARAM, (EDCA[BK].ECWmax<< 12) | (EDCA[BK].ECWmin<< 8) | (sifs_time + EDCA[VI].AIFSN* slot_time)); -#elif(DM_ODM_SUPPORT_TYPE==ODM_ADSL) - ODM_Write4Byte(pDM_Odm, ODM_EDCA_VI_PARAM, (EDCA[BK].ECWmax<< 12) | (EDCA[BK].ECWmin<< 8) | (sifs_time + 2* slot_time)); -#endif - - - } - - ODM_Write4Byte(pDM_Odm, ODM_EDCA_VO_PARAM, (EDCA[VO].TXOPlimit<< 16) | (EDCA[VO].ECWmax<< 12) | (EDCA[VO].ECWmin<< 8) | (sifs_time + EDCA[VO].AIFSN* slot_time)); - ODM_Write4Byte(pDM_Odm, ODM_EDCA_BE_PARAM, (EDCA[BE].TXOPlimit<< 16) | (EDCA[BE].ECWmax<< 12) | (EDCA[BE].ECWmin<< 8) | (sifs_time + EDCA[BE].AIFSN* slot_time)); - ODM_Write4Byte(pDM_Odm, ODM_EDCA_BK_PARAM, (EDCA[BK].TXOPlimit<< 16) | (EDCA[BK].ECWmax<< 12) | (EDCA[BK].ECWmin<< 8) | (sifs_time + EDCA[BK].AIFSN* slot_time)); -// ODM_Write1Byte(pDM_Odm,ACMHWCTRL, 0x00); - - priv->pshare->iot_mode_enable = 0; -#if(DM_ODM_SUPPORT_TYPE==ODM_AP) - if (priv->pshare->rf_ft_var.wifi_beq_iot) - priv->pshare->iot_mode_VI_exist = 0; - - #ifdef WMM_VIBE_PRI - priv->pshare->iot_mode_BE_exist = 0; - #endif - - #ifdef LOW_TP_TXOP - priv->pshare->BE_cwmax_enhance = 0; - #endif - -#elif (DM_ODM_SUPPORT_TYPE==ODM_ADSL) - priv->pshare->iot_mode_BE_exist = 0; -#endif - priv->pshare->iot_mode_VO_exist = 0; -} - -BOOLEAN -ODM_ChooseIotMainSTA( - IN PDM_ODM_T pDM_Odm, - IN PSTA_INFO_T pstat - ) -{ - prtl8192cd_priv priv = pDM_Odm->priv; - BOOLEAN bhighTP_found_pstat=FALSE; - - if ((GET_ROOT(priv)->up_time % 2) == 0) { - unsigned int tx_2s_avg = 0; - unsigned int rx_2s_avg = 0; - int i=0, aggReady=0; - unsigned long total_sum = (priv->pshare->current_tx_bytes+priv->pshare->current_rx_bytes); - - pstat->current_tx_bytes += pstat->tx_byte_cnt; - pstat->current_rx_bytes += pstat->rx_byte_cnt; - - if (total_sum != 0) { - if (total_sum <= 100) { - tx_2s_avg = (unsigned int)((pstat->current_tx_bytes*100) / total_sum); - rx_2s_avg = (unsigned int)((pstat->current_rx_bytes*100) / total_sum); - } else { - tx_2s_avg = (unsigned int)(pstat->current_tx_bytes / (total_sum / 100)); - rx_2s_avg = (unsigned int)(pstat->current_rx_bytes / (total_sum / 100)); - } - - } - -#if(DM_ODM_SUPPORT_TYPE==ODM_ADSL) - if (pstat->ht_cap_len) { - if ((tx_2s_avg + rx_2s_avg) >=25 /*50*/) { - - priv->pshare->highTP_found_pstat = pstat; - bhighTP_found_pstat=TRUE; - } - } -#elif(DM_ODM_SUPPORT_TYPE==ODM_AP) - for(i=0; i<8; i++) - aggReady += (pstat->ADDBA_ready[i]); - if (pstat->ht_cap_len && aggReady) - { - if ((tx_2s_avg + rx_2s_avg >= 25)) { - priv->pshare->highTP_found_pstat = pstat; - } - - #ifdef CLIENT_MODE - if (OPMODE & WIFI_STATION_STATE) { -#if (DM_ODM_SUPPORT_TYPE &ODM_AP) && defined(USE_OUT_SRC) - if ((pstat->IOTPeer==HT_IOT_PEER_RALINK) && ((tx_2s_avg + rx_2s_avg) >= 45)) -#else - if(pstat->is_ralink_sta && ((tx_2s_avg + rx_2s_avg) >= 45)) -#endif - priv->pshare->highTP_found_pstat = pstat; - } - #endif - } -#endif - } else { - pstat->current_tx_bytes = pstat->tx_byte_cnt; - pstat->current_rx_bytes = pstat->rx_byte_cnt; - } - - return bhighTP_found_pstat; -} - - -#ifdef WIFI_WMM -VOID -ODM_IotEdcaSwitch( - IN PDM_ODM_T pDM_Odm, - IN unsigned char enable - ) -{ - prtl8192cd_priv priv = pDM_Odm->priv; - int mode=priv->pmib->dot11BssType.net_work_type; - unsigned int slot_time = 20, sifs_time = 10, BE_TXOP = 47, VI_TXOP = 94; - unsigned int vi_cw_max = 4, vi_cw_min = 3, vi_aifs; - -#if (DM_ODM_SUPPORT_TYPE==ODM_AP) - if (!(!priv->pmib->dot11OperationEntry.wifi_specific || - ((OPMODE & WIFI_AP_STATE) && (priv->pmib->dot11OperationEntry.wifi_specific == 2)) - #ifdef CLIENT_MODE - || ((OPMODE & WIFI_STATION_STATE) && (priv->pmib->dot11OperationEntry.wifi_specific == 2)) - #endif - )) - return; -#endif - - if ((mode & (ODM_WM_N24G|ODM_WM_N5G)) && (priv->pshare->ht_sta_num - #ifdef WDS - || ((OPMODE & WIFI_AP_STATE) && priv->pmib->dot11WdsInfo.wdsEnabled && priv->pmib->dot11WdsInfo.wdsNum) - #endif - )) - sifs_time = 16; - - if (mode & (ODM_WM_N24G|ODM_WM_N5G|ODM_WM_G|ODM_WM_A)) { - slot_time = 9; - } - else - { - BE_TXOP = 94; - VI_TXOP = 188; - } - -#if (DM_ODM_SUPPORT_TYPE==ODM_ADSL) - if (priv->pshare->iot_mode_VO_exist) { - // to separate AC_VI and AC_BE to avoid using the same EDCA settings - if (priv->pshare->iot_mode_BE_exist) { - vi_cw_max = 5; - vi_cw_min = 3; - } else { - vi_cw_max = 6; - vi_cw_min = 4; - } - } - vi_aifs = (sifs_time + ((OPMODE & WIFI_AP_STATE)?1:2) * slot_time); - - ODM_Write4Byte(pDM_Odm, ODM_EDCA_VI_PARAM, ((VI_TXOP*(1-priv->pshare->iot_mode_VO_exist)) << 16)| (vi_cw_max << 12) | (vi_cw_min << 8) | vi_aifs); - - -#elif (DM_ODM_SUPPORT_TYPE==ODM_AP) - if ((OPMODE & WIFI_AP_STATE) && priv->pmib->dot11OperationEntry.wifi_specific) { - if (priv->pshare->iot_mode_VO_exist) { - #ifdef WMM_VIBE_PRI - if (priv->pshare->iot_mode_BE_exist) - { - vi_cw_max = 5; - vi_cw_min = 3; - vi_aifs = (sifs_time + ((OPMODE & WIFI_AP_STATE)?1:2) * slot_time); - } - else - #endif - { - vi_cw_max = 6; - vi_cw_min = 4; - vi_aifs = 0x2b; - } - } - else { - vi_aifs = (sifs_time + ((OPMODE & WIFI_AP_STATE)?1:2) * slot_time); - } - - ODM_Write4Byte(pDM_Odm, ODM_EDCA_VI_PARAM, ((VI_TXOP*(1-priv->pshare->iot_mode_VO_exist)) << 16) - | (vi_cw_max << 12) | (vi_cw_min << 8) | vi_aifs); - } -#endif - - - -#if (DM_ODM_SUPPORT_TYPE==ODM_AP) - if (priv->pshare->rf_ft_var.wifi_beq_iot && priv->pshare->iot_mode_VI_exist) - ODM_Write4Byte(pDM_Odm, ODM_EDCA_BE_PARAM, (10 << 12) | (4 << 8) | 0x4f); - else if(!enable) -#elif(DM_ODM_SUPPORT_TYPE==ODM_ADSL) - if(!enable) //if iot is disable ,maintain original BEQ PARAM -#endif - ODM_Write4Byte(pDM_Odm, ODM_EDCA_BE_PARAM, (((OPMODE & WIFI_AP_STATE)?6:10) << 12) | (4 << 8) - | (sifs_time + 3 * slot_time)); - else - { - int txop_enlarge; - int txop; - unsigned int cw_max; - unsigned int txop_close; - - #if((DM_ODM_SUPPORT_TYPE==ODM_AP)&&(defined LOW_TP_TXOP)) - cw_max = ((priv->pshare->BE_cwmax_enhance) ? 10 : 6); - txop_close = ((priv->pshare->rf_ft_var.low_tp_txop && priv->pshare->rf_ft_var.low_tp_txop_close) ? 1 : 0); - - if(priv->pshare->txop_enlarge == 0xe) //if intel case - txop = (txop_close ? 0 : (BE_TXOP*2)); - else //if other case - txop = (txop_close ? 0: (BE_TXOP*priv->pshare->txop_enlarge)); - #else - cw_max=6; - if((priv->pshare->txop_enlarge==0xe)||(priv->pshare->txop_enlarge==0xd)) - txop=BE_TXOP*2; - else - txop=BE_TXOP*priv->pshare->txop_enlarge; - - #endif - - if (priv->pshare->ht_sta_num - #ifdef WDS - || ((OPMODE & WIFI_AP_STATE) && (mode & (ODM_WM_N24G|ODM_WM_N5G)) && - priv->pmib->dot11WdsInfo.wdsEnabled && priv->pmib->dot11WdsInfo.wdsNum) - #endif - ) - { - - if (priv->pshare->txop_enlarge == 0xe) { - // is intel client, use a different edca value - ODM_Write4Byte(pDM_Odm, ODM_EDCA_BE_PARAM, (txop<< 16) | (cw_max<< 12) | (4 << 8) | 0x1f); - priv->pshare->txop_enlarge = 2; - } -#if(DM_ODM_SUPPORT_TYPE==ODM_AP) - #ifndef LOW_TP_TXOP - else if (priv->pshare->txop_enlarge == 0xd) { - // is intel ralink, use a different edca value - ODM_Write4Byte(pDM_Odm, ODM_EDCA_BE_PARAM, (txop << 16) | (4 << 12) | (3 << 8) | 0x19); - priv->pshare->txop_enlarge = 2; - } - #endif -#endif - else - { - if (pDM_Odm->RFType==ODM_2T2R) - ODM_Write4Byte(pDM_Odm, ODM_EDCA_BE_PARAM, (txop << 16) | - (cw_max << 12) | (4 << 8) | (sifs_time + 3 * slot_time)); - else - #if(DM_ODM_SUPPORT_TYPE==ODM_AP)&&(defined LOW_TP_TXOP) - ODM_Write4Byte(pDM_Odm, ODM_EDCA_BE_PARAM, (txop << 16) | - (((priv->pshare->BE_cwmax_enhance) ? 10 : 5) << 12) | (3 << 8) | (sifs_time + 2 * slot_time)); - #else - ODM_Write4Byte(pDM_Odm, ODM_EDCA_BE_PARAM, (txop << 16) | - (5 << 12) | (3 << 8) | (sifs_time + 2 * slot_time)); - - #endif - } - } - else - { - #if((DM_ODM_SUPPORT_TYPE==ODM_AP)&&(defined LOW_TP_TXOP)) - ODM_Write4Byte(pDM_Odm, ODM_EDCA_BE_PARAM, (BE_TXOP << 16) | (cw_max << 12) | (4 << 8) | (sifs_time + 3 * slot_time)); - #else - #if defined(CONFIG_RTL_8196D) || defined(CONFIG_RTL_8196E) || (defined(CONFIG_RTL_8197D) && !defined(CONFIG_PORT0_EXT_GIGA)) - ODM_Write4Byte(pDM_Odm, ODM_EDCA_BE_PARAM, (BE_TXOP*2 << 16) | (cw_max << 12) | (5 << 8) | (sifs_time + 3 * slot_time)); - #else - ODM_Write4Byte(pDM_Odm, ODM_EDCA_BE_PARAM, (BE_TXOP*2 << 16) | (cw_max << 12) | (4 << 8) | (sifs_time + 3 * slot_time)); - #endif - - #endif - } - - } -} -#endif - -VOID -odm_IotEngine( - IN PDM_ODM_T pDM_Odm - ) -{ - - struct rtl8192cd_priv *priv=pDM_Odm->priv; - PSTA_INFO_T pstat = NULL; - u4Byte i; - -#ifdef WIFI_WMM - unsigned int switch_turbo = 0; -#endif -//////////////////////////////////////////////////////// -// if EDCA Turbo function is not supported or Manual EDCA Setting -// then return -//////////////////////////////////////////////////////// - if(!(pDM_Odm->SupportAbility&ODM_MAC_EDCA_TURBO)){ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_EDCA_TURBO, ODM_DBG_LOUD, ("ODM_MAC_EDCA_TURBO NOT SUPPORTED\n")); - return; - } - -#if((DM_ODM_SUPPORT_TYPE==ODM_AP)&& defined(RTL_MANUAL_EDCA) && defined(WIFI_WMM)) - if(priv->pmib->dot11QosEntry.ManualEDCA){ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_EDCA_TURBO, ODM_DBG_LOUD, ("ODM_MAC_EDCA_TURBO OFF: MANUAL SETTING\n")); - return ; - } -#endif - -#if !(DM_ODM_SUPPORT_TYPE &ODM_AP) - ////////////////////////////////////////////////////// - //find high TP STA every 2s -////////////////////////////////////////////////////// - if ((GET_ROOT(priv)->up_time % 2) == 0) - priv->pshare->highTP_found_pstat==NULL; - -#if 0 - phead = &priv->asoc_list; - plist = phead->next; - while(plist != phead) { - pstat = list_entry(plist, struct stat_info, asoc_list); - - if(ODM_ChooseIotMainSTA(pDM_Odm, pstat)); //find the correct station - break; - if (plist == plist->next) //the last plist - break; - plist = plist->next; - }; -#endif - - //find highTP STA - for(i=0; ipODM_StaInfo[i]; - if(IS_STA_VALID(pstat) && (ODM_ChooseIotMainSTA(pDM_Odm, pstat))) //find the correct station - break; - } - - ////////////////////////////////////////////////////// - //if highTP STA is not found, then return - ////////////////////////////////////////////////////// - if(priv->pshare->highTP_found_pstat==NULL) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_EDCA_TURBO, ODM_DBG_LOUD, ("ODM_MAC_EDCA_TURBO OFF: NO HT STA FOUND\n")); - return; - } -#endif - - pstat=priv->pshare->highTP_found_pstat; - - -#ifdef WIFI_WMM - if (QOS_ENABLE) { - if (!priv->pmib->dot11OperationEntry.wifi_specific - #if(DM_ODM_SUPPORT_TYPE==ODM_AP) - ||((OPMODE & WIFI_AP_STATE) && (priv->pmib->dot11OperationEntry.wifi_specific == 2)) - #elif(DM_ODM_SUPPORT_TYPE==ODM_ADSL) - || (priv->pmib->dot11OperationEntry.wifi_specific == 2) - #endif - ) { - if (priv->pshare->iot_mode_enable && - ((priv->pshare->phw->VO_pkt_count > 50) || - (priv->pshare->phw->VI_pkt_count > 50) || - (priv->pshare->phw->BK_pkt_count > 50))) { - priv->pshare->iot_mode_enable = 0; - switch_turbo++; - } else if ((!priv->pshare->iot_mode_enable) && - ((priv->pshare->phw->VO_pkt_count < 50) && - (priv->pshare->phw->VI_pkt_count < 50) && - (priv->pshare->phw->BK_pkt_count < 50))) { - priv->pshare->iot_mode_enable++; - switch_turbo++; - } - } - - - #if(DM_ODM_SUPPORT_TYPE==ODM_AP) - if ((OPMODE & WIFI_AP_STATE) && priv->pmib->dot11OperationEntry.wifi_specific) - #elif (DM_ODM_SUPPORT_TYPE==ODM_ADSL) - if (priv->pmib->dot11OperationEntry.wifi_specific) - #endif - { - if (!priv->pshare->iot_mode_VO_exist && (priv->pshare->phw->VO_pkt_count > 50)) { - priv->pshare->iot_mode_VO_exist++; - switch_turbo++; - } else if (priv->pshare->iot_mode_VO_exist && (priv->pshare->phw->VO_pkt_count < 50)) { - priv->pshare->iot_mode_VO_exist = 0; - switch_turbo++; - } -#if((DM_ODM_SUPPORT_TYPE==ODM_ADSL)||((DM_ODM_SUPPORT_TYPE==ODM_AP)&&(defined WMM_VIBE_PRI))) - if (priv->pshare->iot_mode_VO_exist) { - //printk("[%s %d] BE_pkt_count=%d\n", __FUNCTION__, __LINE__, priv->pshare->phw->BE_pkt_count); - if (!priv->pshare->iot_mode_BE_exist && (priv->pshare->phw->BE_pkt_count > 250)) { - priv->pshare->iot_mode_BE_exist++; - switch_turbo++; - } else if (priv->pshare->iot_mode_BE_exist && (priv->pshare->phw->BE_pkt_count < 250)) { - priv->pshare->iot_mode_BE_exist = 0; - switch_turbo++; - } - } -#endif - -#if (DM_ODM_SUPPORT_TYPE==ODM_AP) - if (priv->pshare->rf_ft_var.wifi_beq_iot) - { - if (!priv->pshare->iot_mode_VI_exist && (priv->pshare->phw->VI_rx_pkt_count > 50)) { - priv->pshare->iot_mode_VI_exist++; - switch_turbo++; - } else if (priv->pshare->iot_mode_VI_exist && (priv->pshare->phw->VI_rx_pkt_count < 50)) { - priv->pshare->iot_mode_VI_exist = 0; - switch_turbo++; - } - } -#endif - - } - else if (!pstat || pstat->rssi < priv->pshare->rf_ft_var.txop_enlarge_lower) { - if (priv->pshare->txop_enlarge) { - priv->pshare->txop_enlarge = 0; - if (priv->pshare->iot_mode_enable) - switch_turbo++; - } - } - -#if(defined(CLIENT_MODE) && (DM_ODM_SUPPORT_TYPE==ODM_AP)) - if ((OPMODE & WIFI_STATION_STATE) && (priv->pmib->dot11OperationEntry.wifi_specific == 2)) - { - if (priv->pshare->iot_mode_enable && - (((priv->pshare->phw->VO_pkt_count > 50) || - (priv->pshare->phw->VI_pkt_count > 50) || - (priv->pshare->phw->BK_pkt_count > 50)) || - (pstat && (!pstat->ADDBA_ready[0]) & (!pstat->ADDBA_ready[3])))) - { - priv->pshare->iot_mode_enable = 0; - switch_turbo++; - } - else if ((!priv->pshare->iot_mode_enable) && - (((priv->pshare->phw->VO_pkt_count < 50) && - (priv->pshare->phw->VI_pkt_count < 50) && - (priv->pshare->phw->BK_pkt_count < 50)) && - (pstat && (pstat->ADDBA_ready[0] | pstat->ADDBA_ready[3])))) - { - priv->pshare->iot_mode_enable++; - switch_turbo++; - } - } -#endif - - priv->pshare->phw->VO_pkt_count = 0; - priv->pshare->phw->VI_pkt_count = 0; - priv->pshare->phw->BK_pkt_count = 0; - - #if((DM_ODM_SUPPORT_TYPE==ODM_ADSL)||((DM_ODM_SUPPORT_TYPE==ODM_AP)&&(defined WMM_VIBE_PRI))) - priv->pshare->phw->BE_pkt_count = 0; - #endif - - #if(DM_ODM_SUPPORT_TYPE==ODM_AP) - if (priv->pshare->rf_ft_var.wifi_beq_iot) - priv->pshare->phw->VI_rx_pkt_count = 0; - #endif - - } -#endif - - if ((priv->up_time % 2) == 0) { - /* - * decide EDCA content for different chip vendor - */ -#ifdef WIFI_WMM - #if(DM_ODM_SUPPORT_TYPE==ODM_ADSL) - if (QOS_ENABLE && (!priv->pmib->dot11OperationEntry.wifi_specific || (priv->pmib->dot11OperationEntry.wifi_specific == 2) - - #elif(DM_ODM_SUPPORT_TYPE==ODM_AP) - if (QOS_ENABLE && (!priv->pmib->dot11OperationEntry.wifi_specific || - ((OPMODE & WIFI_AP_STATE) && (priv->pmib->dot11OperationEntry.wifi_specific == 2)) - #ifdef CLIENT_MODE - || ((OPMODE & WIFI_STATION_STATE) && (priv->pmib->dot11OperationEntry.wifi_specific == 2)) - #endif - #endif - )) - - { - - if (pstat && pstat->rssi >= priv->pshare->rf_ft_var.txop_enlarge_upper) { -#ifdef LOW_TP_TXOP -#if (DM_ODM_SUPPORT_TYPE &ODM_AP) && defined(USE_OUT_SRC) - if (pstat->IOTPeer==HT_IOT_PEER_INTEL) -#else - if (pstat->is_intel_sta) -#endif - { - if (priv->pshare->txop_enlarge != 0xe) - { - priv->pshare->txop_enlarge = 0xe; - - if (priv->pshare->iot_mode_enable) - switch_turbo++; - } - } - else if (priv->pshare->txop_enlarge != 2) - { - priv->pshare->txop_enlarge = 2; - if (priv->pshare->iot_mode_enable) - switch_turbo++; - } -#else - if (priv->pshare->txop_enlarge != 2) - { -#if (DM_ODM_SUPPORT_TYPE &ODM_AP) && defined(USE_OUT_SRC) - if (pstat->IOTPeer==HT_IOT_PEER_INTEL) -#else - if (pstat->is_intel_sta) -#endif - priv->pshare->txop_enlarge = 0xe; -#if (DM_ODM_SUPPORT_TYPE &ODM_AP) && defined(USE_OUT_SRC) - else if (pstat->IOTPeer==HT_IOT_PEER_RALINK) -#else - else if (pstat->is_ralink_sta) -#endif - priv->pshare->txop_enlarge = 0xd; - else - priv->pshare->txop_enlarge = 2; - - if (priv->pshare->iot_mode_enable) - switch_turbo++; - } -#endif -#if 0 - if (priv->pshare->txop_enlarge != 2) - { - #if(DM_ODM_SUPPORT_TYPE==ODM_AP) - if (pstat->IOTPeer==HT_IOT_PEER_INTEL) - #else - if (pstat->is_intel_sta) - #endif - priv->pshare->txop_enlarge = 0xe; - #if(DM_ODM_SUPPORT_TYPE==ODM_AP) - else if (pstat->IOTPeer==HT_IOT_PEER_RALINK) - priv->pshare->txop_enlarge = 0xd; - #endif - else - priv->pshare->txop_enlarge = 2; - if (priv->pshare->iot_mode_enable) - switch_turbo++; - } -#endif - } - else if (!pstat || pstat->rssi < priv->pshare->rf_ft_var.txop_enlarge_lower) - { - if (priv->pshare->txop_enlarge) { - priv->pshare->txop_enlarge = 0; - if (priv->pshare->iot_mode_enable) - switch_turbo++; - } - } - -#if((DM_ODM_SUPPORT_TYPE==ODM_AP)&&( defined LOW_TP_TXOP)) - // for Intel IOT, need to enlarge CW MAX from 6 to 10 - if (pstat && pstat->is_intel_sta && (((pstat->tx_avarage+pstat->rx_avarage)>>10) < - priv->pshare->rf_ft_var.cwmax_enhance_thd)) - { - if (!priv->pshare->BE_cwmax_enhance && priv->pshare->iot_mode_enable) - { - priv->pshare->BE_cwmax_enhance = 1; - switch_turbo++; - } - } else { - if (priv->pshare->BE_cwmax_enhance) { - priv->pshare->BE_cwmax_enhance = 0; - switch_turbo++; - } - } -#endif - } -#endif - priv->pshare->current_tx_bytes = 0; - priv->pshare->current_rx_bytes = 0; - } - -#if((DM_ODM_SUPPORT_TYPE==ODM_AP)&& defined( SW_TX_QUEUE)) - if ((priv->assoc_num > 1) && (AMPDU_ENABLE)) - { - if (priv->swq_txmac_chg >= priv->pshare->rf_ft_var.swq_en_highthd){ - if ((priv->swq_en == 0)){ - switch_turbo++; - if (priv->pshare->txop_enlarge == 0) - priv->pshare->txop_enlarge = 2; - priv->swq_en = 1; - } - else - { - if ((switch_turbo > 0) && (priv->pshare->txop_enlarge == 0) && (priv->pshare->iot_mode_enable != 0)) - { - priv->pshare->txop_enlarge = 2; - switch_turbo--; - } - } - } - else if(priv->swq_txmac_chg <= priv->pshare->rf_ft_var.swq_dis_lowthd){ - priv->swq_en = 0; - } - else if ((priv->swq_en == 1) && (switch_turbo > 0) && (priv->pshare->txop_enlarge == 0) && (priv->pshare->iot_mode_enable != 0)) { - priv->pshare->txop_enlarge = 2; - switch_turbo--; - } - } -#if ((DM_ODM_SUPPORT_TYPE==ODM_AP)&&(defined CONFIG_RTL_819XD)) - else if( (priv->assoc_num == 1) && (AMPDU_ENABLE)) { - if (pstat) { - int en_thd = 14417920>>(priv->up_time % 2); - if ((priv->swq_en == 0) && (pstat->current_tx_bytes > en_thd) && (pstat->current_rx_bytes > en_thd) ) { //50Mbps - priv->swq_en = 1; - priv->swqen_keeptime = priv->up_time; - } - else if ((priv->swq_en == 1) && ((pstat->tx_avarage < 4587520) || (pstat->rx_avarage < 4587520))) { //35Mbps - priv->swq_en = 0; - priv->swqen_keeptime = 0; - } - } - else { - priv->swq_en = 0; - priv->swqen_keeptime = 0; - } - } -#endif -#endif - -#ifdef WIFI_WMM -#ifdef LOW_TP_TXOP - if ((!priv->pmib->dot11OperationEntry.wifi_specific || (priv->pmib->dot11OperationEntry.wifi_specific == 2)) - && QOS_ENABLE) { - if (switch_turbo || priv->pshare->rf_ft_var.low_tp_txop) { - unsigned int thd_tp; - unsigned char under_thd; - unsigned int curr_tp; - - if (priv->pmib->dot11BssType.net_work_type & (ODM_WM_N24G|ODM_WM_N5G| ODM_WM_G)) - { - // Determine the upper bound throughput threshold. - if (priv->pmib->dot11BssType.net_work_type & (ODM_WM_N24G|ODM_WM_N5G)) { - if (priv->assoc_num && priv->assoc_num != priv->pshare->ht_sta_num) - thd_tp = priv->pshare->rf_ft_var.low_tp_txop_thd_g; - else - thd_tp = priv->pshare->rf_ft_var.low_tp_txop_thd_n; - } - else - thd_tp = priv->pshare->rf_ft_var.low_tp_txop_thd_g; - - // Determine to close txop. - curr_tp = (unsigned int)(priv->ext_stats.tx_avarage>>17) + (unsigned int)(priv->ext_stats.rx_avarage>>17); - if (curr_tp <= thd_tp && curr_tp >= priv->pshare->rf_ft_var.low_tp_txop_thd_low) - under_thd = 1; - else - under_thd = 0; - } - else - { - under_thd = 0; - } - - if (switch_turbo) - { - priv->pshare->rf_ft_var.low_tp_txop_close = under_thd; - priv->pshare->rf_ft_var.low_tp_txop_count = 0; - } - else if (priv->pshare->iot_mode_enable && (priv->pshare->rf_ft_var.low_tp_txop_close != under_thd)) { - priv->pshare->rf_ft_var.low_tp_txop_count++; - if (priv->pshare->rf_ft_var.low_tp_txop_close) { - priv->pshare->rf_ft_var.low_tp_txop_count = priv->pshare->rf_ft_var.low_tp_txop_delay; - } - if (priv->pshare->rf_ft_var.low_tp_txop_count ==priv->pshare->rf_ft_var.low_tp_txop_delay) - - { - priv->pshare->rf_ft_var.low_tp_txop_count = 0; - priv->pshare->rf_ft_var.low_tp_txop_close = under_thd; - switch_turbo++; - } - } - else - { - priv->pshare->rf_ft_var.low_tp_txop_count = 0; - } - } - } -#endif - - if (switch_turbo) - ODM_IotEdcaSwitch( pDM_Odm, priv->pshare->iot_mode_enable ); -#endif -} -#endif - - -#if( DM_ODM_SUPPORT_TYPE == ODM_WIN) -// -// 2011/07/26 MH Add an API for testing IQK fail case. -// -BOOLEAN -ODM_CheckPowerStatus( - IN PADAPTER Adapter) -{ - - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; - RT_RF_POWER_STATE rtState; - PMGNT_INFO pMgntInfo = &(Adapter->MgntInfo); - - // 2011/07/27 MH We are not testing ready~~!! We may fail to get correct value when init sequence. - if (pMgntInfo->init_adpt_in_progress == TRUE) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("ODM_CheckPowerStatus Return TRUE, due to initadapter")); - return TRUE; - } - - // - // 2011/07/19 MH We can not execute tx pwoer tracking/ LLC calibrate or IQK. - // - Adapter->HalFunc.GetHwRegHandler(Adapter, HW_VAR_RF_STATE, (pu1Byte)(&rtState)); - if(Adapter->bDriverStopped || Adapter->bDriverIsGoingToPnpSetPowerSleep || rtState == eRfOff) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("ODM_CheckPowerStatus Return FALSE, due to %d/%d/%d\n", - Adapter->bDriverStopped, Adapter->bDriverIsGoingToPnpSetPowerSleep, rtState)); - return FALSE; - } - return TRUE; -} -#endif - -// need to ODM CE Platform -//move to here for ANT detection mechanism using - -#if ((DM_ODM_SUPPORT_TYPE == ODM_WIN)||(DM_ODM_SUPPORT_TYPE == ODM_CE)) -u4Byte -GetPSDData( - IN PDM_ODM_T pDM_Odm, - unsigned int point, - u1Byte initial_gain_psd) -{ - //unsigned int val, rfval; - //int psd_report; - u4Byte psd_report; - - //HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - //Debug Message - //val = PHY_QueryBBReg(Adapter,0x908, bMaskDWord); - //DbgPrint("Reg908 = 0x%x\n",val); - //val = PHY_QueryBBReg(Adapter,0xDF4, bMaskDWord); - //rfval = PHY_QueryRFReg(Adapter, ODM_RF_PATH_A, 0x00, bRFRegOffsetMask); - //DbgPrint("RegDF4 = 0x%x, RFReg00 = 0x%x\n",val, rfval); - //DbgPrint("PHYTXON = %x, OFDMCCA_PP = %x, CCKCCA_PP = %x, RFReg00 = %x\n", - //(val&BIT25)>>25, (val&BIT14)>>14, (val&BIT15)>>15, rfval); - - //Set DCO frequency index, offset=(40MHz/SamplePts)*point - ODM_SetBBReg(pDM_Odm, 0x808, 0x3FF, point); - - //Start PSD calculation, Reg808[22]=0->1 - ODM_SetBBReg(pDM_Odm, 0x808, BIT22, 1); - //Need to wait for HW PSD report - ODM_StallExecution(1000); - ODM_SetBBReg(pDM_Odm, 0x808, BIT22, 0); - //Read PSD report, Reg8B4[15:0] - psd_report = ODM_GetBBReg(pDM_Odm,0x8B4, bMaskDWord) & 0x0000FFFF; - -#if 1//(DEV_BUS_TYPE == RT_PCI_INTERFACE) && ( (RT_PLATFORM == PLATFORM_LINUX) || (RT_PLATFORM == PLATFORM_MACOSX)) - psd_report = (u4Byte) (ConvertTo_dB(psd_report))+(u4Byte)(initial_gain_psd-0x1c); -#else - psd_report = (int) (20*log10((double)psd_report))+(int)(initial_gain_psd-0x1c); -#endif - - return psd_report; - -} - -u4Byte -ConvertTo_dB( - u4Byte Value) -{ - u1Byte i; - u1Byte j; - u4Byte dB; - - Value = Value & 0xFFFF; - - for (i=0;i<8;i++) - { - if (Value <= dB_Invert_Table[i][11]) - { - break; - } - } - - if (i >= 8) - { - return (96); // maximum 96 dB - } - - for (j=0;j<12;j++) - { - if (Value <= dB_Invert_Table[i][j]) - { - break; - } - } - - dB = i*12 + j + 1; - - return (dB); -} - -#endif - -// -// LukeLee: -// PSD function will be moved to FW in future IC, but now is only implemented in MP platform -// So PSD function will not be incorporated to common ODM -// -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - -#define AFH_PSD 1 //0:normal PSD scan, 1: only do 20 pts PSD -#define MODE_40M 0 //0:20M, 1:40M -#define PSD_TH2 3 -#define PSD_CHMIN 20 // Minimum channel number for BT AFH -#define SIR_STEP_SIZE 3 -#define Smooth_Size_1 5 -#define Smooth_TH_1 3 -#define Smooth_Size_2 10 -#define Smooth_TH_2 4 -#define Smooth_Size_3 20 -#define Smooth_TH_3 4 -#define Smooth_Step_Size 5 -#define Adaptive_SIR 1 -//#if(RTL8723_FPGA_VERIFICATION == 1) -//#define PSD_RESCAN 1 -//#else -//#define PSD_RESCAN 4 -//#endif -#define SCAN_INTERVAL 1500 //ms -#define SYN_Length 5 // for 92D - -#define LNA_Low_Gain_1 0x64 -#define LNA_Low_Gain_2 0x5A -#define LNA_Low_Gain_3 0x58 - -#define pw_th_10dB 0x0 -#define pw_th_16dB 0x3 - -#define FA_RXHP_TH1 5000 -#define FA_RXHP_TH2 1500 -#define FA_RXHP_TH3 800 -#define FA_RXHP_TH4 600 -#define FA_RXHP_TH5 500 - -#define Idle_Mode 0 -#define High_TP_Mode 1 -#define Low_TP_Mode 2 - - -VOID -odm_PSDMonitorInit( - IN PDM_ODM_T pDM_Odm) -{ -#if (DEV_BUS_TYPE == RT_PCI_INTERFACE)|(DEV_BUS_TYPE == RT_USB_INTERFACE) - //HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - //PSD Monitor Setting - //Which path in ADC/DAC is turnned on for PSD: both I/Q - ODM_SetBBReg(pDM_Odm, ODM_PSDREG, BIT10|BIT11, 0x3); - //Ageraged number: 8 - ODM_SetBBReg(pDM_Odm, ODM_PSDREG, BIT12|BIT13, 0x1); - pDM_Odm->bPSDinProcess = FALSE; - pDM_Odm->bUserAssignLevel = FALSE; - pDM_Odm->bPSDactive = FALSE; - //pDM_Odm->bDMInitialGainEnable=TRUE; //change the initialization to DIGinit - //Set Debug Port - //PHY_SetBBReg(Adapter, 0x908, bMaskDWord, 0x803); - //PHY_SetBBReg(Adapter, 0xB34, bMaskByte0, 0x00); // pause PSD - //PHY_SetBBReg(Adapter, 0xB38, bMaskByte0, 10); //rescan - //PHY_SetBBReg(Adapter, 0xB38, bMaskByte2|bMaskByte3, 100); //interval - - //PlatformSetTimer( Adapter, &pHalData->PSDTriggerTimer, 0); //ms -#endif -} - -VOID -PatchDCTone( - IN PDM_ODM_T pDM_Odm, - pu4Byte PSD_report, - u1Byte initial_gain_psd -) -{ - //HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - //PADAPTER pAdapter; - - u4Byte psd_report; - - //2 Switch to CH11 to patch CH9 and CH13 DC tone - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_CHNLBW, 0x3FF, 11); - - if(pDM_Odm->SupportICType== ODM_RTL8192D) - { - if((*(pDM_Odm->pMacPhyMode) == ODM_SMSP)||(*(pDM_Odm->pMacPhyMode) == ODM_DMSP)) - { - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, RF_CHNLBW, 0x3FF, 11); - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x25, 0xfffff, 0x643BC); - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x26, 0xfffff, 0xFC038); - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x27, 0xfffff, 0x77C1A); - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x2B, 0xfffff, 0x41289); - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x2C, 0xfffff, 0x01840); - } - else - { - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x25, 0xfffff, 0x643BC); - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x26, 0xfffff, 0xFC038); - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x27, 0xfffff, 0x77C1A); - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x2B, 0xfffff, 0x41289); - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x2C, 0xfffff, 0x01840); - } - } - - //Ch9 DC tone patch - psd_report = GetPSDData(pDM_Odm, 96, initial_gain_psd); - PSD_report[50] = psd_report; - //Ch13 DC tone patch - psd_report = GetPSDData(pDM_Odm, 32, initial_gain_psd); - PSD_report[70] = psd_report; - - //2 Switch to CH3 to patch CH1 and CH5 DC tone - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_CHNLBW, 0x3FF, 3); - - - if(pDM_Odm->SupportICType==ODM_RTL8192D) - { - if((*(pDM_Odm->pMacPhyMode) == ODM_SMSP)||(*(pDM_Odm->pMacPhyMode) == ODM_DMSP)) - { - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, RF_CHNLBW, 0x3FF, 3); - //PHY_SetRFReg(Adapter, ODM_RF_PATH_B, 0x25, 0xfffff, 0x643BC); - //PHY_SetRFReg(Adapter, ODM_RF_PATH_B, 0x26, 0xfffff, 0xFC038); - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x27, 0xfffff, 0x07C1A); - //PHY_SetRFReg(Adapter, ODM_RF_PATH_B, 0x2B, 0xfffff, 0x61289); - //PHY_SetRFReg(Adapter, ODM_RF_PATH_B, 0x2C, 0xfffff, 0x01C41); - } - else - { - //PHY_SetRFReg(Adapter, ODM_RF_PATH_A, 0x25, 0xfffff, 0x643BC); - //PHY_SetRFReg(Adapter, ODM_RF_PATH_A, 0x26, 0xfffff, 0xFC038); - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x27, 0xfffff, 0x07C1A); - //PHY_SetRFReg(Adapter, ODM_RF_PATH_A, 0x2B, 0xfffff, 0x61289); - //PHY_SetRFReg(Adapter, ODM_RF_PATH_A, 0x2C, 0xfffff, 0x01C41); - } - } - - //Ch1 DC tone patch - psd_report = GetPSDData(pDM_Odm, 96, initial_gain_psd); - PSD_report[10] = psd_report; - //Ch5 DC tone patch - psd_report = GetPSDData(pDM_Odm, 32, initial_gain_psd); - PSD_report[30] = psd_report; - -} - - -VOID -GoodChannelDecision( - PDM_ODM_T pDM_Odm, - pu4Byte PSD_report, - pu1Byte PSD_bitmap, - u1Byte RSSI_BT, - pu1Byte PSD_bitmap_memory) -{ - pRXHP_T pRX_HP_Table = &pDM_Odm->DM_RXHP_Table; - //s4Byte TH1 = SSBT-0x15; // modify TH by Neil Chen - s4Byte TH1= RSSI_BT+0x14; - s4Byte TH2 = RSSI_BT+85; - //u2Byte TH3; -// s4Byte RegB34; - u1Byte bitmap, Smooth_size[3], Smooth_TH[3]; - //u1Byte psd_bit; - u4Byte i,n,j, byte_idx, bit_idx, good_cnt, good_cnt_smoothing, Smooth_Interval[3]; - int start_byte_idx,start_bit_idx,cur_byte_idx, cur_bit_idx,NOW_byte_idx ; - -// RegB34 = PHY_QueryBBReg(Adapter,0xB34, bMaskDWord)&0xFF; - - if((pDM_Odm->SupportICType == ODM_RTL8192C)||(pDM_Odm->SupportICType == ODM_RTL8192D)) - { - TH1 = RSSI_BT + 0x14; - } - - Smooth_size[0]=Smooth_Size_1; - Smooth_size[1]=Smooth_Size_2; - Smooth_size[2]=Smooth_Size_3; - Smooth_TH[0]=Smooth_TH_1; - Smooth_TH[1]=Smooth_TH_2; - Smooth_TH[2]=Smooth_TH_3; - Smooth_Interval[0]=16; - Smooth_Interval[1]=15; - Smooth_Interval[2]=13; - good_cnt = 0; - if(pDM_Odm->SupportICType==ODM_RTL8723A) - { - //2 Threshold - - if(RSSI_BT >=41) - TH1 = 113; - else if(RSSI_BT >=38) // >= -15dBm - TH1 = 105; //0x69 - else if((RSSI_BT >=33)&(RSSI_BT <38)) - TH1 = 99+(RSSI_BT-33); //0x63 - else if((RSSI_BT >=26)&(RSSI_BT<33)) - TH1 = 99-(33-RSSI_BT)+2; //0x5e - else if((RSSI_BT >=24)&(RSSI_BT<26)) - TH1 = 88-((RSSI_BT-24)*3); //0x58 - else if((RSSI_BT >=18)&(RSSI_BT<24)) - TH1 = 77+((RSSI_BT-18)*2); - else if((RSSI_BT >=14)&(RSSI_BT<18)) - TH1 = 63+((RSSI_BT-14)*2); - else if((RSSI_BT >=8)&(RSSI_BT<14)) - TH1 = 58+((RSSI_BT-8)*2); - else if((RSSI_BT >=3)&(RSSI_BT<8)) - TH1 = 52+(RSSI_BT-3); - else - TH1 = 51; - } - - for (i = 0; i< 10; i++) - PSD_bitmap[i] = 0; - - - // Add By Gary - for (i=0; i<80; i++) - pRX_HP_Table->PSD_bitmap_RXHP[i] = 0; - // End - - - - if(pDM_Odm->SupportICType==ODM_RTL8723A) - { - TH1 =TH1-SIR_STEP_SIZE; - } - while (good_cnt < PSD_CHMIN) - { - good_cnt = 0; - if(pDM_Odm->SupportICType==ODM_RTL8723A) - { - if(TH1 ==TH2) - break; - if((TH1+SIR_STEP_SIZE) < TH2) - TH1 += SIR_STEP_SIZE; - else - TH1 = TH2; - } - else - { - if(TH1==(RSSI_BT+0x1E)) - break; - if((TH1+2) < (RSSI_BT+0x1E)) - TH1+=3; - else - TH1 = RSSI_BT+0x1E; - - } - ODM_RT_TRACE(pDM_Odm,COMP_PSD,DBG_LOUD,("PSD: decision threshold is: %d", TH1)); - - for (i = 0; i< 80; i++) - { - if((s4Byte)(PSD_report[i]) < TH1) - { - byte_idx = i / 8; - bit_idx = i -8*byte_idx; - bitmap = PSD_bitmap[byte_idx]; - PSD_bitmap[byte_idx] = bitmap | (u1Byte) (1 << bit_idx); - } - } - -#if DBG - ODM_RT_TRACE(pDM_Odm,COMP_PSD, DBG_LOUD,("PSD: before smoothing\n")); - for(n=0;n<10;n++) - { - //DbgPrint("PSD_bitmap[%u]=%x\n", n, PSD_bitmap[n]); - for (i = 0; i<8; i++) - ODM_RT_TRACE(pDM_Odm,COMP_PSD, DBG_LOUD,("PSD_bitmap[%u] = %d\n", 2402+n*8+i, (PSD_bitmap[n]&BIT(i))>>i)); - } -#endif - - //1 Start of smoothing function - - for (j=0;j<3;j++) - { - start_byte_idx=0; - start_bit_idx=0; - for(n=0; n 7 ) - { - start_byte_idx= start_byte_idx+start_bit_idx/8; - start_bit_idx = start_bit_idx%8; - } - } - - ODM_RT_TRACE( pDM_Odm,COMP_PSD, DBG_LOUD,("PSD: after %u smoothing", j+1)); - for(n=0;n<10;n++) - { - for (i = 0; i<8; i++) - { - ODM_RT_TRACE(pDM_Odm,COMP_PSD, DBG_LOUD,("PSD_bitmap[%u] = %d\n", 2402+n*8+i, (PSD_bitmap[n]&BIT(i))>>i)); - - if ( ((PSD_bitmap[n]&BIT(i))>>i) ==1) //----- Add By Gary - { - pRX_HP_Table->PSD_bitmap_RXHP[8*n+i] = 1; - } // ------end by Gary - } - } - - } - - - good_cnt = 0; - for ( i = 0; i < 10; i++) - { - for (n = 0; n < 8; n++) - if((PSD_bitmap[i]& BIT(n)) != 0) - good_cnt++; - } - ODM_RT_TRACE(pDM_Odm,COMP_PSD, DBG_LOUD,("PSD: good channel cnt = %u",good_cnt)); - } - - //RT_TRACE(COMP_PSD, DBG_LOUD,("PSD: SSBT=%d, TH2=%d, TH1=%d",SSBT,TH2,TH1)); - for (i = 0; i <10; i++) - ODM_RT_TRACE(pDM_Odm,COMP_PSD, DBG_LOUD,("PSD: PSD_bitmap[%u]=%x",i,PSD_bitmap[i])); -/* - //Update bitmap memory - for(i = 0; i < 80; i++) - { - byte_idx = i / 8; - bit_idx = i -8*byte_idx; - psd_bit = (PSD_bitmap[byte_idx] & BIT(bit_idx)) >> bit_idx; - bitmap = PSD_bitmap_memory[i]; - PSD_bitmap_memory[i] = (bitmap << 1) |psd_bit; - } -*/ -} - - - -VOID -odm_PSD_Monitor( - PDM_ODM_T pDM_Odm -) -{ - //HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - //PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; - - unsigned int pts, start_point, stop_point; - u1Byte initial_gain ; - static u1Byte PSD_bitmap_memory[80], init_memory = 0; - static u1Byte psd_cnt=0; - static u4Byte PSD_report[80], PSD_report_tmp; - static u8Byte lastTxOkCnt=0, lastRxOkCnt=0; - u1Byte H2C_PSD_DATA[5]={0,0,0,0,0}; - static u1Byte H2C_PSD_DATA_last[5] ={0,0,0,0,0}; - u1Byte idx[20]={96,99,102,106,109,112,115,118,122,125, - 0,3,6,10,13,16,19,22,26,29}; - u1Byte n, i, channel, BBReset,tone_idx; - u1Byte PSD_bitmap[10], SSBT=0,initial_gain_psd=0, RSSI_BT=0, initialGainUpper; - s4Byte PSD_skip_start, PSD_skip_stop; - u4Byte CurrentChannel, RXIQI, RxIdleLowPwr, wlan_channel; - u4Byte ReScan, Interval, Is40MHz; - u8Byte curTxOkCnt, curRxOkCnt; - int cur_byte_idx, cur_bit_idx; - PADAPTER Adapter = pDM_Odm->Adapter; - PMGNT_INFO pMgntInfo = &Adapter->MgntInfo; - - if( (*(pDM_Odm->pbScanInProcess)) || - pDM_Odm->bLinkInProcess) - { - if((pDM_Odm->SupportICType==ODM_RTL8723A)&(pDM_Odm->SupportInterface==ODM_ITRF_PCIE)) - { - ODM_SetTimer( pDM_Odm, &pDM_Odm->PSDTimer, 1500); //ms - //psd_cnt=0; - } - return; - } - - if(pDM_Odm->bBtHsOperation) - { - ReScan = 1; - Interval = SCAN_INTERVAL; - } - else - { - ReScan = PSD_RESCAN; - Interval = SCAN_INTERVAL; - } - - //1 Initialization - if(init_memory == 0) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PSD, DBG_LOUD,("Init memory\n")); - for(i = 0; i < 80; i++) - PSD_bitmap_memory[i] = 0xFF; // channel is always good - init_memory = 1; - } - if(psd_cnt == 0) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PSD, DBG_LOUD,("Enter dm_PSD_Monitor\n")); - for(i = 0; i < 80; i++) - PSD_report[i] = 0; - } - - //1 Backup Current Settings - CurrentChannel = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_CHNLBW, bRFRegOffsetMask); -/* - if(pDM_Odm->SupportICType==ODM_RTL8192D) - { - //2 Record Current synthesizer parameters based on current channel - if((*pDM_Odm->MacPhyMode92D == SINGLEMAC_SINGLEPHY)||(*pDM_Odm->MacPhyMode92D == DUALMAC_SINGLEPHY)) - { - SYN_RF25 = ODM_GetRFReg(Adapter, ODM_RF_PATH_B, 0x25, bMaskDWord); - SYN_RF26 = ODM_GetRFReg(Adapter, ODM_RF_PATH_B, 0x26, bMaskDWord); - SYN_RF27 = ODM_GetRFReg(Adapter, ODM_RF_PATH_B, 0x27, bMaskDWord); - SYN_RF2B = ODM_GetRFReg(Adapter, ODM_RF_PATH_B, 0x2B, bMaskDWord); - SYN_RF2C = ODM_GetRFReg(Adapter, ODM_RF_PATH_B, 0x2C, bMaskDWord); - } - else // DualMAC_DualPHY 2G - { - SYN_RF25 = ODM_GetRFReg(Adapter, ODM_RF_PATH_A, 0x25, bMaskDWord); - SYN_RF26 = ODM_GetRFReg(Adapter, ODM_RF_PATH_A, 0x26, bMaskDWord); - SYN_RF27 = ODM_GetRFReg(Adapter, ODM_RF_PATH_A, 0x27, bMaskDWord); - SYN_RF2B = ODM_GetRFReg(Adapter, ODM_RF_PATH_A, 0x2B, bMaskDWord); - SYN_RF2C = ODM_GetRFReg(Adapter, ODM_RF_PATH_A, 0x2C, bMaskDWord); - } - } -*/ - //RXIQI = PHY_QueryBBReg(Adapter, 0xC14, bMaskDWord); - RXIQI = ODM_GetBBReg(pDM_Odm, 0xC14, bMaskDWord); - - //RxIdleLowPwr = (PHY_QueryBBReg(Adapter, 0x818, bMaskDWord)&BIT28)>>28; - RxIdleLowPwr = (ODM_GetBBReg(pDM_Odm, 0x818, bMaskDWord)&BIT28)>>28; - - //2??? - if(CHNL_RUN_ABOVE_40MHZ(pMgntInfo)) - Is40MHz = TRUE; - else - Is40MHz = FALSE; - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_PSD, DBG_LOUD,("PSD Scan Start\n")); - //1 Turn off CCK - //PHY_SetBBReg(Adapter, rFPGA0_RFMOD, BIT24, 0); - ODM_SetBBReg(pDM_Odm, rFPGA0_RFMOD, BIT24, 0); - //1 Turn off TX - //Pause TX Queue - //PlatformEFIOWrite1Byte(Adapter, REG_TXPAUSE, 0xFF); - ODM_Write1Byte(pDM_Odm,REG_TXPAUSE, 0xFF); - - //Force RX to stop TX immediately - //PHY_SetRFReg(Adapter, ODM_RF_PATH_A, RF_AC, bRFRegOffsetMask, 0x32E13); - - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_AC, bRFRegOffsetMask, 0x32E13); - //1 Turn off RX - //Rx AGC off RegC70[0]=0, RegC7C[20]=0 - //PHY_SetBBReg(Adapter, 0xC70, BIT0, 0); - //PHY_SetBBReg(Adapter, 0xC7C, BIT20, 0); - - ODM_SetBBReg(pDM_Odm, 0xC70, BIT0, 0); - ODM_SetBBReg(pDM_Odm, 0xC7C, BIT20, 0); - - - //Turn off CCA - //PHY_SetBBReg(Adapter, 0xC14, bMaskDWord, 0x0); - ODM_SetBBReg(pDM_Odm, 0xC14, bMaskDWord, 0x0); - - //BB Reset - //BBReset = PlatformEFIORead1Byte(Adapter, 0x02); - BBReset = ODM_Read1Byte(pDM_Odm, 0x02); - - //PlatformEFIOWrite1Byte(Adapter, 0x02, BBReset&(~BIT0)); - //PlatformEFIOWrite1Byte(Adapter, 0x02, BBReset|BIT0); - ODM_SetBBReg(pDM_Odm, 0x87C, BIT31, 1); //clock gated to prevent from AGC table mess - ODM_Write1Byte(pDM_Odm, 0x02, BBReset&(~BIT0)); - ODM_Write1Byte(pDM_Odm, 0x02, BBReset|BIT0); - ODM_SetBBReg(pDM_Odm, 0x87C, BIT31, 0); - - //1 Leave RX idle low power - //PHY_SetBBReg(Adapter, 0x818, BIT28, 0x0); - - ODM_SetBBReg(pDM_Odm, 0x818, BIT28, 0x0); - //1 Fix initial gain - //if (IS_HARDWARE_TYPE_8723AE(Adapter)) - //RSSI_BT = pHalData->RSSI_BT; - //else if((IS_HARDWARE_TYPE_8192C(Adapter))||(IS_HARDWARE_TYPE_8192D(Adapter))) // Add by Gary - // RSSI_BT = RSSI_BT_new; - - if((pDM_Odm->SupportICType==ODM_RTL8723A)&(pDM_Odm->SupportInterface==ODM_ITRF_PCIE)) - RSSI_BT=pDM_Odm->RSSI_BT; //need to check C2H to pDM_Odm RSSI BT - - if(RSSI_BT>=47) - RSSI_BT=47; - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PSD, DBG_LOUD,("PSD: RSSI_BT= %d\n", RSSI_BT)); - - if(pDM_Odm->SupportICType==ODM_RTL8723A) - { - //Neil add--2011--10--12 - //2 Initial Gain index - if(RSSI_BT >=35) // >= -15dBm - initial_gain_psd = RSSI_BT*2; - else if((RSSI_BT >=33)&(RSSI_BT<35)) - initial_gain_psd = RSSI_BT*2+6; - else if((RSSI_BT >=24)&(RSSI_BT<33)) - initial_gain_psd = 70-(33-RSSI_BT); - else if((RSSI_BT >=19)&(RSSI_BT<24)) - initial_gain_psd = 64-((24-RSSI_BT)*4); - else if((RSSI_BT >=14)&(RSSI_BT<19)) - initial_gain_psd = 44-((18-RSSI_BT)*2); - else if((RSSI_BT >=8)&(RSSI_BT<14)) - initial_gain_psd = 35-(14-RSSI_BT); - else - initial_gain_psd = 0x1B; - } - else - { - - //need to do - initial_gain_psd = pDM_Odm->RSSI_Min; // PSD report based on RSSI - //} - } - //if(RSSI_BT<0x17) - // RSSI_BT +=3; - //DbgPrint("PSD: RSSI_BT= %d\n", RSSI_BT); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PSD, DBG_LOUD,("PSD: RSSI_BT= %d\n", RSSI_BT)); - - //initialGainUpper = 0x5E; //Modify by neil chen - - if(pDM_Odm->bUserAssignLevel) - { - pDM_Odm->bUserAssignLevel = FALSE; - initialGainUpper = 0x7f; - } - else - { - initialGainUpper = 0x5E; - } - - /* - if (initial_gain_psd < 0x1a) - initial_gain_psd = 0x1a; - if (initial_gain_psd > initialGainUpper) - initial_gain_psd = initialGainUpper; - */ - - //if(pDM_Odm->SupportICType==ODM_RTL8723A) - SSBT = RSSI_BT * 2 +0x3E; - - - //if(IS_HARDWARE_TYPE_8723AE(Adapter)) - // SSBT = RSSI_BT * 2 +0x3E; - //else if((IS_HARDWARE_TYPE_8192C(Adapter))||(IS_HARDWARE_TYPE_8192D(Adapter))) // Add by Gary - //{ - // RSSI_BT = initial_gain_psd; - // SSBT = RSSI_BT; - //} - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PSD, DBG_LOUD,("PSD: SSBT= %d\n", SSBT)); - ODM_RT_TRACE( pDM_Odm,ODM_COMP_PSD, DBG_LOUD,("PSD: initial gain= 0x%x\n", initial_gain_psd)); - //DbgPrint("PSD: SSBT= %d", SSBT); - //need to do - //pMgntInfo->bDMInitialGainEnable = FALSE; - pDM_Odm->bDMInitialGainEnable = FALSE; - initial_gain =(u1Byte) (ODM_GetBBReg(pDM_Odm, 0xc50, bMaskDWord) & 0x7F); - - // make sure the initial gain is under the correct range. - //initial_gain_psd &= 0x7f; - ODM_Write_DIG(pDM_Odm, initial_gain_psd); - //1 Turn off 3-wire - ODM_SetBBReg(pDM_Odm, 0x88c, BIT20|BIT21|BIT22|BIT23, 0xF); - - //pts value = 128, 256, 512, 1024 - pts = 128; - - if(pts == 128) - { - ODM_SetBBReg(pDM_Odm, 0x808, BIT14|BIT15, 0x0); - start_point = 64; - stop_point = 192; - } - else if(pts == 256) - { - ODM_SetBBReg(pDM_Odm, 0x808, BIT14|BIT15, 0x1); - start_point = 128; - stop_point = 384; - } - else if(pts == 512) - { - ODM_SetBBReg(pDM_Odm, 0x808, BIT14|BIT15, 0x2); - start_point = 256; - stop_point = 768; - } - else - { - ODM_SetBBReg(pDM_Odm, 0x808, BIT14|BIT15, 0x3); - start_point = 512; - stop_point = 1536; - } - - -//3 Skip WLAN channels if WLAN busy - - curTxOkCnt = *(pDM_Odm->pNumTxBytesUnicast) - lastTxOkCnt; - curRxOkCnt = *(pDM_Odm->pNumRxBytesUnicast) - lastRxOkCnt; - lastTxOkCnt = *(pDM_Odm->pNumTxBytesUnicast); - lastRxOkCnt = *(pDM_Odm->pNumRxBytesUnicast); - - PSD_skip_start=80; - PSD_skip_stop = 0; - wlan_channel = CurrentChannel & 0x0f; - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PSD,DBG_LOUD,("PSD: current channel: %x, BW:%d \n", wlan_channel, Is40MHz)); - if(pDM_Odm->SupportICType==ODM_RTL8723A) - { - if(pDM_Odm->bBtHsOperation) - { - if(pDM_Odm->bLinked) - { - if(Is40MHz) - { - PSD_skip_start = ((wlan_channel-1)*5 -Is40MHz*10)-2; // Modify by Neil to add 10 chs to mask - PSD_skip_stop = (PSD_skip_start + (1+Is40MHz)*20)+4; - } - else - { - PSD_skip_start = ((wlan_channel-1)*5 -Is40MHz*10)-10; // Modify by Neil to add 10 chs to mask - PSD_skip_stop = (PSD_skip_start + (1+Is40MHz)*20)+18; - } - } - else - { - // mask for 40MHz - PSD_skip_start = ((wlan_channel-1)*5 -Is40MHz*10)-2; // Modify by Neil to add 10 chs to mask - PSD_skip_stop = (PSD_skip_start + (1+Is40MHz)*20)+4; - } - if(PSD_skip_start < 0) - PSD_skip_start = 0; - if(PSD_skip_stop >80) - PSD_skip_stop = 80; - } - else - { - if((curRxOkCnt+curTxOkCnt) > 5) - { - if(Is40MHz) - { - PSD_skip_start = ((wlan_channel-1)*5 -Is40MHz*10)-2; // Modify by Neil to add 10 chs to mask - PSD_skip_stop = (PSD_skip_start + (1+Is40MHz)*20)+4; - } - else - { - PSD_skip_start = ((wlan_channel-1)*5 -Is40MHz*10)-10; // Modify by Neil to add 10 chs to mask - PSD_skip_stop = (PSD_skip_start + (1+Is40MHz)*20)+18; - } - - if(PSD_skip_start < 0) - PSD_skip_start = 0; - if(PSD_skip_stop >80) - PSD_skip_stop = 80; - } - } - } -#if 0 - else - { - if((curRxOkCnt+curTxOkCnt) > 1000) - { - PSD_skip_start = (wlan_channel-1)*5 -Is40MHz*10; - PSD_skip_stop = PSD_skip_start + (1+Is40MHz)*20; - } - } -#endif //Reove RXHP Issue - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PSD,DBG_LOUD,("PSD: Skip tone from %d to %d \n", PSD_skip_start, PSD_skip_stop)); - - for (n=0;n<80;n++) - { - if((n%20)==0) - { - channel = (n/20)*4 + 1; - - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_CHNLBW, 0x3FF, channel); - } - tone_idx = n%20; - if ((n>=PSD_skip_start) && (n PSD_report[n]) - PSD_report[n] = PSD_report_tmp; - - } - } - - PatchDCTone(pDM_Odm, PSD_report, initial_gain_psd); - - //----end - //1 Turn on RX - //Rx AGC on - ODM_SetBBReg(pDM_Odm, 0xC70, BIT0, 1); - ODM_SetBBReg(pDM_Odm, 0xC7C, BIT20, 1); - //CCK on - ODM_SetBBReg(pDM_Odm, rFPGA0_RFMOD, BIT24, 1); - //1 Turn on TX - //Resume TX Queue - - ODM_Write1Byte(pDM_Odm,REG_TXPAUSE, 0x00); - //Turn on 3-wire - ODM_SetBBReg(pDM_Odm, 0x88c, BIT20|BIT21|BIT22|BIT23, 0x0); - //1 Restore Current Settings - //Resume DIG - pDM_Odm->bDMInitialGainEnable = TRUE; - - ODM_Write_DIG(pDM_Odm, initial_gain); - - // restore originl center frequency - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_CHNLBW, bRFRegOffsetMask, CurrentChannel); - - //Turn on CCA - ODM_SetBBReg(pDM_Odm, 0xC14, bMaskDWord, RXIQI); - //Restore RX idle low power - if(RxIdleLowPwr == TRUE) - ODM_SetBBReg(pDM_Odm, 0x818, BIT28, 1); - - psd_cnt++; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PSD, DBG_LOUD,("PSD:psd_cnt = %d \n",psd_cnt)); - if (psd_cnt < ReScan) - ODM_SetTimer(pDM_Odm, &pDM_Odm->PSDTimer, Interval); - else - { - psd_cnt = 0; - for(i=0;i<80;i++) - //DbgPrint("psd_report[%d]= %d \n", 2402+i, PSD_report[i]); - RT_TRACE( COMP_PSD, DBG_LOUD,("psd_report[%d]= %d \n", 2402+i, PSD_report[i])); - - - GoodChannelDecision(pDM_Odm, PSD_report, PSD_bitmap,RSSI_BT, PSD_bitmap_memory); - - if(pDM_Odm->SupportICType==ODM_RTL8723A) - { - cur_byte_idx=0; - cur_bit_idx=0; - - //2 Restore H2C PSD Data to Last Data - H2C_PSD_DATA_last[0] = H2C_PSD_DATA[0]; - H2C_PSD_DATA_last[1] = H2C_PSD_DATA[1]; - H2C_PSD_DATA_last[2] = H2C_PSD_DATA[2]; - H2C_PSD_DATA_last[3] = H2C_PSD_DATA[3]; - H2C_PSD_DATA_last[4] = H2C_PSD_DATA[4]; - - - //2 Translate 80bit channel map to 40bit channel - for ( i=0;i<5;i++) - { - for(n=0;n<8;n++) - { - cur_byte_idx = i*2 + n/4; - cur_bit_idx = (n%4)*2; - if ( ((PSD_bitmap[cur_byte_idx]& BIT(cur_bit_idx)) != 0) && ((PSD_bitmap[cur_byte_idx]& BIT(cur_bit_idx+1)) != 0)) - H2C_PSD_DATA[i] = H2C_PSD_DATA[i] | (u1Byte) (1 << n); - } - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PSD, DBG_LOUD,("H2C_PSD_DATA[%d]=0x%x\n" ,i, H2C_PSD_DATA[i])); - } - - //3 To Compare the difference - for ( i=0;i<5;i++) - { - if(H2C_PSD_DATA[i] !=H2C_PSD_DATA_last[i]) - { - FillH2CCmd(Adapter, H2C_92C_PSD_RESULT, 5, H2C_PSD_DATA); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_PSD, DBG_LOUD,("Need to Update the AFH Map \n")); - break; - } - else - { - if(i==5) - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PSD, DBG_LOUD,("Not need to Update\n")); - } - } - if(pDM_Odm->bBtHsOperation) - { - ODM_SetTimer(pDM_Odm, &pDM_Odm->PSDTimer, 10000); - ODM_RT_TRACE( pDM_Odm,ODM_COMP_PSD, DBG_LOUD,("Leave dm_PSD_Monitor\n")); - } - else - { - ODM_SetTimer(pDM_Odm, &pDM_Odm->PSDTimer, 1500); - ODM_RT_TRACE( pDM_Odm,ODM_COMP_PSD, DBG_LOUD,("Leave dm_PSD_Monitor\n")); - } - } - } -} -/* -//Neil for Get BT RSSI -// Be Triggered by BT C2H CMD -VOID -ODM_PSDGetRSSI( - IN u1Byte RSSI_BT) -{ - - -} - -*/ - -VOID -ODM_PSDMonitor( - IN PDM_ODM_T pDM_Odm - ) -{ - //HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - - //if(IS_HARDWARE_TYPE_8723AE(Adapter)) - - if(pDM_Odm->SupportICType == ODM_RTL8723A) //may need to add other IC type - { - if(pDM_Odm->SupportInterface==ODM_ITRF_PCIE) - { - if(pDM_Odm->bBtDisabled) //need to check upper layer connection - { - pDM_Odm->bPSDactive=FALSE; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PSD, DBG_LOUD, ("odm_PSDMonitor, return for BT is disabled!!!\n")); - return; - } - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PSD, DBG_LOUD, ("odm_PSDMonitor\n")); - //{ - pDM_Odm->bPSDinProcess = TRUE; - pDM_Odm->bPSDactive=TRUE; - odm_PSD_Monitor(pDM_Odm); - pDM_Odm->bPSDinProcess = FALSE; - } - } - -} -VOID -odm_PSDMonitorCallback( - PRT_TIMER pTimer -) -{ - PADAPTER Adapter = (PADAPTER)pTimer->Adapter; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - - PlatformScheduleWorkItem(&pHalData->PSDMonitorWorkitem); -} - -VOID -odm_PSDMonitorWorkItemCallback( - IN PVOID pContext - ) -{ - PADAPTER Adapter = (PADAPTER)pContext; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; - - ODM_PSDMonitor(pDM_Odm); -} - -// <20130108, Kordan> E.g., With LNA used, we make the Rx power smaller to have a better EVM. (Asked by Willis) -VOID -odm_RFEControl( - IN PDM_ODM_T pDM_Odm, - IN u8Byte RSSIVal - ) -{ - PADAPTER Adapter = (PADAPTER)pDM_Odm->Adapter; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - static u1Byte TRSW_HighPwr = 0; - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, DBG_LOUD, ("===> odm_RFEControl, RSSI = %d, TRSW_HighPwr = 0x%X, pHalData->RFEType = %d\n", - RSSIVal, TRSW_HighPwr, pHalData->RFEType )); - - if (pHalData->RFEType == 3) { - - pDM_Odm->RSSI_TRSW = RSSIVal; - - if (pDM_Odm->RSSI_TRSW >= pDM_Odm->RSSI_TRSW_H) - { - TRSW_HighPwr = 1; // Switch to - PHY_SetBBReg(Adapter, r_ANTSEL_SW_Jaguar, BIT1|BIT0, 0x1); // Set ANTSW=1/ANTSWB=0 for SW control - PHY_SetBBReg(Adapter, r_ANTSEL_SW_Jaguar, BIT9|BIT8, 0x3); // Set ANTSW=1/ANTSWB=0 for SW control - - } - else if (pDM_Odm->RSSI_TRSW <= pDM_Odm->RSSI_TRSW_L) - { - TRSW_HighPwr = 0; // Switched back - PHY_SetBBReg(Adapter, r_ANTSEL_SW_Jaguar, BIT1|BIT0, 0x1); // Set ANTSW=1/ANTSWB=0 for SW control - PHY_SetBBReg(Adapter, r_ANTSEL_SW_Jaguar, BIT9|BIT8, 0x0); // Set ANTSW=1/ANTSWB=0 for SW control - - } - } - - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, DBG_LOUD, ("(pDM_Odm->RSSI_TRSW_H, pDM_Odm->RSSI_TRSW_L) = (%d, %d)\n", pDM_Odm->RSSI_TRSW_H, pDM_Odm->RSSI_TRSW_L)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, DBG_LOUD, ("(RSSIVal, RSSIVal, pDM_Odm->RSSI_TRSW_iso) = (%d, %d, %d)\n", - RSSIVal, pDM_Odm->RSSI_TRSW_iso, pDM_Odm->RSSI_TRSW)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, DBG_LOUD, ("<=== odm_RFEControl, RSSI = %d, TRSW_HighPwr = 0x%X\n", RSSIVal, TRSW_HighPwr)); -} - -VOID -ODM_MPT_DIG( - IN PDM_ODM_T pDM_Odm - ) -{ - pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable; - PFALSE_ALARM_STATISTICS pFalseAlmCnt = &pDM_Odm->FalseAlmCnt; - u1Byte CurrentIGI = (u1Byte)pDM_DigTable->CurIGValue; - u1Byte DIG_Upper = 0x40, DIG_Lower = 0x20, C50, E50; - u8Byte RXOK_cal; - u1Byte IGI_A = 0x20, IGI_B = 0x20; - -#if ODM_FIX_2G_DIG - IGI_A = 0x22; - IGI_B = 0x24; -#endif - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_MP, DBG_LOUD, ("===> ODM_MPT_DIG, pBandType = %d\n", *pDM_Odm->pBandType)); - - odm_FalseAlarmCounterStatistics( pDM_Odm); - pDM_Odm->LastNumQryPhyStatusAll = pDM_Odm->NumQryPhyStatusAll; - pDM_Odm->NumQryPhyStatusAll = pDM_Odm->PhyDbgInfo.NumQryPhyStatusCCK + pDM_Odm->PhyDbgInfo.NumQryPhyStatusOFDM; - RXOK_cal = pDM_Odm->NumQryPhyStatusAll - pDM_Odm->LastNumQryPhyStatusAll; - - if (RXOK_cal == 0) - pDM_Odm->RxPWDBAve_final= 0; - else - pDM_Odm->RxPWDBAve_final= pDM_Odm->RxPWDBAve/RXOK_cal; - - pDM_Odm->RxPWDBAve = 0; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, DBG_LOUD, ("RX OK = %d\n", RXOK_cal)); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, DBG_LOUD, ("pDM_Odm->RxPWDBAve_final = %d\n", pDM_Odm->RxPWDBAve_final)); - - // <20130315, Kordan> Except Cameo, we should always trun on 2.4G/5G DIG. - // (Cameo fixes the IGI of 2.4G, so only DIG on 5G. Asked by James.) -#if ODM_FIX_2G_DIG - if (*pDM_Odm->pBandType == BAND_ON_5G){ // for 5G -#else - if (1){ // for both 2G/5G -#endif - pDM_Odm->MPDIG_2G = FALSE; - pDM_Odm->Times_2G = 0; - - if (RXOK_cal >= 70 && pDM_Odm->RxPWDBAve_final<= 30) - { - if (CurrentIGI > 0x24){ - ODM_Write1Byte( pDM_Odm, rA_IGI_Jaguar, 0x24); - ODM_Write1Byte( pDM_Odm, rB_IGI_Jaguar, 0x24); - } - } - else - { - if(pFalseAlmCnt->Cnt_all > 1000){ - CurrentIGI = CurrentIGI + 8; - } - else if(pFalseAlmCnt->Cnt_all > 200){ - CurrentIGI = CurrentIGI + 4; - } - else if (pFalseAlmCnt->Cnt_all > 50){ - CurrentIGI = CurrentIGI + 2; - } - else if (pFalseAlmCnt->Cnt_all < 2){ - CurrentIGI = CurrentIGI - 2; - } - - if (CurrentIGI < DIG_Lower ){ - CurrentIGI = DIG_Lower; - } - else if(CurrentIGI > DIG_Upper){ - CurrentIGI = DIG_Upper; - } - - pDM_DigTable->CurIGValue = CurrentIGI; - - ODM_Write1Byte( pDM_Odm, rA_IGI_Jaguar, (u1Byte)CurrentIGI); - ODM_Write1Byte( pDM_Odm, rB_IGI_Jaguar, (u1Byte)CurrentIGI); - - C50 = ODM_Read1Byte( pDM_Odm, 0xc50); - E50 = ODM_Read1Byte( pDM_Odm, 0xe50); - //pDM_Odm->MPDIG_2G = FALSE; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_MP, DBG_LOUD, ("DIG = (%x, %x), Cnt_all = %d, Cnt_Ofdm_fail = %d, Cnt_Cck_fail = %d\n", C50, E50, pFalseAlmCnt->Cnt_all, pFalseAlmCnt->Cnt_Ofdm_fail, pFalseAlmCnt->Cnt_Cck_fail)); - } - - } - else - { //2G - ODM_RT_TRACE(pDM_Odm,ODM_COMP_MP, DBG_LOUD, ("MPDIG_2G = %d,\n", pDM_Odm->MPDIG_2G)); - - if(pDM_Odm->MPDIG_2G == FALSE){ - ODM_RT_TRACE(pDM_Odm,ODM_COMP_MP, DBG_LOUD, ("===> Fix IGI\n")); - ODM_Write1Byte( pDM_Odm, rA_IGI_Jaguar, (u1Byte)IGI_A); - ODM_Write1Byte( pDM_Odm, rB_IGI_Jaguar, (u1Byte)IGI_B); - } - if (pDM_Odm->Times_2G == 2) - pDM_Odm->MPDIG_2G = TRUE; - pDM_Odm->Times_2G++; - } - ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, DBG_LOUD, ("pDM_Odm->RxPWDBAve_final = %d\n", pDM_Odm->RxPWDBAve_final)); - - if (pDM_Odm->SupportICType == ODM_RTL8812) - odm_RFEControl(pDM_Odm, pDM_Odm->RxPWDBAve_final); - - ODM_SetTimer(pDM_Odm, &pDM_Odm->MPT_DIGTimer, 700); - -} - -VOID -odm_MPT_DIGCallback( - PRT_TIMER pTimer -) -{ - PADAPTER Adapter = (PADAPTER)pTimer->Adapter; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; - - - #if DEV_BUS_TYPE==RT_PCI_INTERFACE - #if USE_WORKITEM - PlatformScheduleWorkItem(&pDM_Odm->MPT_DIGWorkitem); - #else - ODM_MPT_DIG(pDM_Odm); - #endif - #else - PlatformScheduleWorkItem(&pDM_Odm->MPT_DIGWorkitem); - #endif - -} - -VOID -odm_MPT_DIGWorkItemCallback( - IN PVOID pContext - ) -{ - PADAPTER Adapter = (PADAPTER)pContext; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; - - ODM_MPT_DIG(pDM_Odm); -} - - - - - //cosa debug tool need to modify - -VOID -ODM_PSDDbgControl( - IN PADAPTER Adapter, - IN u4Byte mode, - IN u4Byte btRssi - ) -{ -#if (DEV_BUS_TYPE == RT_PCI_INTERFACE) - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; - - ODM_RT_TRACE(pDM_Odm,COMP_PSD, DBG_LOUD, (" Monitor mode=%d, btRssi=%d\n", mode, btRssi)); - if(mode) - { - pDM_Odm->RSSI_BT = (u1Byte)btRssi; - pDM_Odm->bUserAssignLevel = TRUE; - ODM_SetTimer( pDM_Odm, &pDM_Odm->PSDTimer, 0); //ms - } - else - { - ODM_CancelTimer(pDM_Odm, &pDM_Odm->PSDTimer); - } -#endif -} - - -//#if(DEV_BUS_TYPE == RT_PCI_INTERFACE)|(DEV_BUS_TYPE == RT_USB_INTERFACE) - -void odm_RXHPInit( - IN PDM_ODM_T pDM_Odm) -{ -#if (DEV_BUS_TYPE == RT_PCI_INTERFACE)|(DEV_BUS_TYPE == RT_USB_INTERFACE) - pRXHP_T pRX_HP_Table = &pDM_Odm->DM_RXHP_Table; - u1Byte index; - - pRX_HP_Table->RXHP_enable = TRUE; - pRX_HP_Table->RXHP_flag = 0; - pRX_HP_Table->PSD_func_trigger = 0; - pRX_HP_Table->Pre_IGI = 0x20; - pRX_HP_Table->Cur_IGI = 0x20; - pRX_HP_Table->Cur_pw_th = pw_th_10dB; - pRX_HP_Table->Pre_pw_th = pw_th_10dB; - for(index=0; index<80; index++) - pRX_HP_Table->PSD_bitmap_RXHP[index] = 1; - -#if(DEV_BUS_TYPE == RT_USB_INTERFACE) - pRX_HP_Table->TP_Mode = Idle_Mode; -#endif -#endif -} - -void odm_RXHP( - IN PDM_ODM_T pDM_Odm) -{ -#if( DM_ODM_SUPPORT_TYPE & (ODM_WIN)) -#if (DEV_BUS_TYPE == RT_PCI_INTERFACE) | (DEV_BUS_TYPE == RT_USB_INTERFACE) - PADAPTER Adapter = pDM_Odm->Adapter; - PMGNT_INFO pMgntInfo = &(Adapter->MgntInfo); - pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable; - pRXHP_T pRX_HP_Table = &pDM_Odm->DM_RXHP_Table; - PFALSE_ALARM_STATISTICS FalseAlmCnt = &(pDM_Odm->FalseAlmCnt); - - u1Byte i, j, sum; - u1Byte Is40MHz; - s1Byte Intf_diff_idx, MIN_Intf_diff_idx = 16; - s4Byte cur_channel; - u1Byte ch_map_intf_5M[17] = {0}; - static u4Byte FA_TH = 0; - static u1Byte psd_intf_flag = 0; - static s4Byte curRssi = 0; - static s4Byte preRssi = 0; - static u1Byte PSDTriggerCnt = 1; - - u1Byte RX_HP_enable = (u1Byte)(ODM_GetBBReg(pDM_Odm, rOFDM0_XAAGCCore2, bMaskDWord)>>31); // for debug!! - -#if(DEV_BUS_TYPE == RT_USB_INTERFACE) - static s8Byte lastTxOkCnt = 0, lastRxOkCnt = 0; - s8Byte curTxOkCnt, curRxOkCnt; - s8Byte curTPOkCnt; - s8Byte TP_Acc3, TP_Acc5; - static s8Byte TP_Buff[5] = {0}; - static u1Byte pre_state = 0, pre_state_flag = 0; - static u1Byte Intf_HighTP_flag = 0, De_counter = 16; - static u1Byte TP_Degrade_flag = 0; -#endif - static u1Byte LatchCnt = 0; - - if(pDM_Odm->SupportICType & (ODM_RTL8723A|ODM_RTL8188E)) - return; - //AGC RX High Power Mode is only applied on 2G band in 92D!!! - if(pDM_Odm->SupportICType == ODM_RTL8192D) - { - if(*(pDM_Odm->pBandType) != ODM_BAND_2_4G) - return; - } - - if(!(pDM_Odm->SupportAbility==ODM_BB_RXHP)) - return; - - - //RX HP ON/OFF - if(RX_HP_enable == 1) - pRX_HP_Table->RXHP_enable = FALSE; - else - pRX_HP_Table->RXHP_enable = TRUE; - - if(pRX_HP_Table->RXHP_enable == FALSE) - { - if(pRX_HP_Table->RXHP_flag == 1) - { - pRX_HP_Table->RXHP_flag = 0; - psd_intf_flag = 0; - } - return; - } - -#if(DEV_BUS_TYPE == RT_USB_INTERFACE) - //2 Record current TP for USB interface - curTxOkCnt = *(pDM_Odm->pNumTxBytesUnicast)-lastTxOkCnt; - curRxOkCnt = *(pDM_Odm->pNumRxBytesUnicast)-lastRxOkCnt; - lastTxOkCnt = *(pDM_Odm->pNumTxBytesUnicast); - lastRxOkCnt = *(pDM_Odm->pNumRxBytesUnicast); - - curTPOkCnt = curTxOkCnt+curRxOkCnt; - TP_Buff[0] = curTPOkCnt; // current TP - TP_Acc3 = PlatformDivision64((TP_Buff[1]+TP_Buff[2]+TP_Buff[3]), 3); - TP_Acc5 = PlatformDivision64((TP_Buff[0]+TP_Buff[1]+TP_Buff[2]+TP_Buff[3]+TP_Buff[4]), 5); - - if(TP_Acc5 < 1000) - pRX_HP_Table->TP_Mode = Idle_Mode; - else if((1000 < TP_Acc5)&&(TP_Acc5 < 3750000)) - pRX_HP_Table->TP_Mode = Low_TP_Mode; - else - pRX_HP_Table->TP_Mode = High_TP_Mode; - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RX HP TP Mode = %d\n", pRX_HP_Table->TP_Mode)); - // Since TP result would be sampled every 2 sec, it needs to delay 4sec to wait PSD processing. - // When LatchCnt = 0, we would Get PSD result. - if(TP_Degrade_flag == 1) - { - LatchCnt--; - if(LatchCnt == 0) - { - TP_Degrade_flag = 0; - } - } - // When PSD function triggered by TP degrade 20%, and Interference Flag = 1 - // Set a De_counter to wait IGI = upper bound. If time is UP, the Interference flag will be pull down. - if(Intf_HighTP_flag == 1) - { - De_counter--; - if(De_counter == 0) - { - Intf_HighTP_flag = 0; - psd_intf_flag = 0; - } - } -#endif - - //2 AGC RX High Power Mode by PSD only applied to STA Mode - //3 NOT applied 1. Ad Hoc Mode. - //3 NOT applied 2. AP Mode - if ((pMgntInfo->mAssoc) && (!pMgntInfo->mIbss) && (!ACTING_AS_AP(Adapter))) - { - Is40MHz = *(pDM_Odm->pBandWidth); - curRssi = pDM_Odm->RSSI_Min; - cur_channel = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_CHNLBW, 0x0fff) & 0x0f; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RXHP RX HP flag = %d\n", pRX_HP_Table->RXHP_flag)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RXHP FA = %d\n", FalseAlmCnt->Cnt_all)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RXHP cur RSSI = %d, pre RSSI=%d\n", curRssi, preRssi)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RXHP current CH = %d\n", cur_channel)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RXHP Is 40MHz = %d\n", Is40MHz)); - //2 PSD function would be triggered - //3 1. Every 4 sec for PCIE - //3 2. Before TP Mode (Idle TP<4kbps) for USB - //3 3. After TP Mode (High TP) for USB - if((curRssi > 68) && (pRX_HP_Table->RXHP_flag == 0)) // Only RSSI>TH and RX_HP_flag=0 will Do PSD process - { -#if (DEV_BUS_TYPE == RT_USB_INTERFACE) - //2 Before TP Mode ==> PSD would be trigger every 4 sec - if(pRX_HP_Table->TP_Mode == Idle_Mode) //2.1 less wlan traffic <4kbps - { -#endif - if(PSDTriggerCnt == 1) - { - odm_PSD_RXHP(pDM_Odm); - pRX_HP_Table->PSD_func_trigger = 1; - PSDTriggerCnt = 0; - } - else - { - PSDTriggerCnt++; - } -#if(DEV_BUS_TYPE == RT_USB_INTERFACE) - } - //2 After TP Mode ==> Check if TP degrade larger than 20% would trigger PSD function - if(pRX_HP_Table->TP_Mode == High_TP_Mode) - { - if((pre_state_flag == 0)&&(LatchCnt == 0)) - { - // TP var < 5% - if((((curTPOkCnt-TP_Acc3)*20)<(TP_Acc3))&&(((curTPOkCnt-TP_Acc3)*20)>(-TP_Acc3))) - { - pre_state++; - if(pre_state == 3) // hit pre_state condition => consecutive 3 times - { - pre_state_flag = 1; - pre_state = 0; - } - - } - else - { - pre_state = 0; - } - } - //3 If pre_state_flag=1 ==> start to monitor TP degrade 20% - if(pre_state_flag == 1) - { - if(((TP_Acc3-curTPOkCnt)*5)>(TP_Acc3)) // degrade 20% - { - odm_PSD_RXHP(pDM_Odm); - pRX_HP_Table->PSD_func_trigger = 1; - TP_Degrade_flag = 1; - LatchCnt = 2; - pre_state_flag = 0; - } - else if(((TP_Buff[2]-curTPOkCnt)*5)>TP_Buff[2]) - { - odm_PSD_RXHP(pDM_Odm); - pRX_HP_Table->PSD_func_trigger = 1; - TP_Degrade_flag = 1; - LatchCnt = 2; - pre_state_flag = 0; - } - else if(((TP_Buff[3]-curTPOkCnt)*5)>TP_Buff[3]) - { - odm_PSD_RXHP(pDM_Odm); - pRX_HP_Table->PSD_func_trigger = 1; - TP_Degrade_flag = 1; - LatchCnt = 2; - pre_state_flag = 0; - } - } - } -#endif -} - -#if (DEV_BUS_TYPE == RT_USB_INTERFACE) - for (i=0;i<4;i++) - { - TP_Buff[4-i] = TP_Buff[3-i]; - } -#endif - //2 Update PSD bitmap according to PSD report - if((pRX_HP_Table->PSD_func_trigger == 1)&&(LatchCnt == 0)) - { - //2 Separate 80M bandwidth into 16 group with smaller 5M BW. - for (i = 0 ; i < 16 ; i++) - { - sum = 0; - for(j = 0; j < 5 ; j++) - sum += pRX_HP_Table->PSD_bitmap_RXHP[5*i + j]; - - if(sum < 5) - { - ch_map_intf_5M[i] = 1; // interference flag - } - } - //=============just for debug========================= - //for(i=0;i<16;i++) - //DbgPrint("RX HP: ch_map_intf_5M[%d] = %d\n", i, ch_map_intf_5M[i]); - //=============================================== - //2 Mask target channel 5M index - for(i = 0; i < (4+4*Is40MHz) ; i++) - { - ch_map_intf_5M[cur_channel - (1+2*Is40MHz) + i] = 0; - } - - psd_intf_flag = 0; - for(i = 0; i < 16; i++) - { - if(ch_map_intf_5M[i] == 1) - { - psd_intf_flag = 1; // interference is detected!!! - break; - } - } - -#if (DEV_BUS_TYPE == RT_USB_INTERFACE) - if(pRX_HP_Table->TP_Mode!=Idle_Mode) - { - if(psd_intf_flag == 1) // to avoid psd_intf_flag always 1 - { - Intf_HighTP_flag = 1; - De_counter = 32; // 0x1E -> 0x3E needs 32 times by each IGI step =1 - } - } -#endif - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RX HP psd_intf_flag = %d\n", psd_intf_flag)); - //2 Distance between target channel and interference - for(i = 0; i < 16; i++) - { - if(ch_map_intf_5M[i] == 1) - { - Intf_diff_idx = ((cur_channel+Is40MHz-(i+1))>0) ? (s1Byte)(cur_channel-2*Is40MHz-(i-2)) : (s1Byte)((i+1)-(cur_channel+2*Is40MHz)); - if(Intf_diff_idx < MIN_Intf_diff_idx) - MIN_Intf_diff_idx = Intf_diff_idx; // the min difference index between interference and target - } - } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RX HP MIN_Intf_diff_idx = %d\n", MIN_Intf_diff_idx)); - //2 Choose False Alarm Threshold - switch (MIN_Intf_diff_idx){ - case 0: - case 1: - case 2: - case 3: - FA_TH = FA_RXHP_TH1; - break; - case 4: // CH5 - case 5: // CH6 - FA_TH = FA_RXHP_TH2; - break; - case 6: // CH7 - case 7: // CH8 - FA_TH = FA_RXHP_TH3; - break; - case 8: // CH9 - case 9: //CH10 - FA_TH = FA_RXHP_TH4; - break; - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - FA_TH = FA_RXHP_TH5; - break; - } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RX HP FA_TH = %d\n", FA_TH)); - pRX_HP_Table->PSD_func_trigger = 0; - } - //1 Monitor RSSI variation to choose the suitable IGI or Exit AGC RX High Power Mode - if(pRX_HP_Table->RXHP_flag == 1) - { - if ((curRssi > 80)&&(preRssi < 80)) - { - pRX_HP_Table->Cur_IGI = LNA_Low_Gain_1; - } - else if ((curRssi < 80)&&(preRssi > 80)) - { - pRX_HP_Table->Cur_IGI = LNA_Low_Gain_2; - } - else if ((curRssi > 72)&&(preRssi < 72)) - { - pRX_HP_Table->Cur_IGI = LNA_Low_Gain_2; - } - else if ((curRssi < 72)&&( preRssi > 72)) - { - pRX_HP_Table->Cur_IGI = LNA_Low_Gain_3; - } - else if (curRssi < 68) //RSSI is NOT large enough!!==> Exit AGC RX High Power Mode - { - pRX_HP_Table->Cur_pw_th = pw_th_10dB; - pRX_HP_Table->RXHP_flag = 0; // Back to Normal DIG Mode - psd_intf_flag = 0; - } - } - else // pRX_HP_Table->RXHP_flag == 0 - { - //1 Decide whether to enter AGC RX High Power Mode - if ((curRssi > 70) && (psd_intf_flag == 1) && (FalseAlmCnt->Cnt_all > FA_TH) && - (pDM_DigTable->CurIGValue == pDM_DigTable->rx_gain_range_max)) - { - if (curRssi > 80) - { - pRX_HP_Table->Cur_IGI = LNA_Low_Gain_1; - } - else if (curRssi > 72) - { - pRX_HP_Table->Cur_IGI = LNA_Low_Gain_2; - } - else - { - pRX_HP_Table->Cur_IGI = LNA_Low_Gain_3; - } - pRX_HP_Table->Cur_pw_th = pw_th_16dB; //RegC54[9:8]=2'b11: to enter AGC Flow 3 - pRX_HP_Table->First_time_enter = TRUE; - pRX_HP_Table->RXHP_flag = 1; // RXHP_flag=1: AGC RX High Power Mode, RXHP_flag=0: Normal DIG Mode - } - } - preRssi = curRssi; - odm_Write_RXHP(pDM_Odm); - } -#endif //#if( DM_ODM_SUPPORT_TYPE & (ODM_WIN)) -#endif //#if (DEV_BUS_TYPE == RT_PCI_INTERFACE) | (DEV_BUS_TYPE == RT_USB_INTERFACE) -} - -void odm_Write_RXHP( - IN PDM_ODM_T pDM_Odm) -{ - pRXHP_T pRX_HP_Table = &pDM_Odm->DM_RXHP_Table; - u4Byte currentIGI; - - if(pRX_HP_Table->Cur_IGI != pRX_HP_Table->Pre_IGI) - { - ODM_SetBBReg(pDM_Odm, rOFDM0_XAAGCCore1, bMaskByte0, pRX_HP_Table->Cur_IGI); - ODM_SetBBReg(pDM_Odm, rOFDM0_XBAGCCore1, bMaskByte0, pRX_HP_Table->Cur_IGI); - } - - if(pRX_HP_Table->Cur_pw_th != pRX_HP_Table->Pre_pw_th) -{ - ODM_SetBBReg(pDM_Odm, rOFDM0_XAAGCCore2, BIT8|BIT9, pRX_HP_Table->Cur_pw_th); // RegC54[9:8]=2'b11: AGC Flow 3 - } - - if(pRX_HP_Table->RXHP_flag == 0) - { - pRX_HP_Table->Cur_IGI = 0x20; - } - else - { - currentIGI = ODM_GetBBReg(pDM_Odm, rOFDM0_XAAGCCore1, bMaskByte0); - if(currentIGI<0x50) - { - ODM_SetBBReg(pDM_Odm, rOFDM0_XAAGCCore1, bMaskByte0, pRX_HP_Table->Cur_IGI); - ODM_SetBBReg(pDM_Odm, rOFDM0_XBAGCCore1, bMaskByte0, pRX_HP_Table->Cur_IGI); - } - } - pRX_HP_Table->Pre_IGI = pRX_HP_Table->Cur_IGI; - pRX_HP_Table->Pre_pw_th = pRX_HP_Table->Cur_pw_th; - -} - -VOID -odm_PSD_RXHP( - IN PDM_ODM_T pDM_Odm -) -{ - pRXHP_T pRX_HP_Table = &pDM_Odm->DM_RXHP_Table; - PADAPTER Adapter = pDM_Odm->Adapter; - PMGNT_INFO pMgntInfo = &(Adapter->MgntInfo); - unsigned int pts, start_point, stop_point, initial_gain ; - static u1Byte PSD_bitmap_memory[80], init_memory = 0; - static u1Byte psd_cnt=0; - static u4Byte PSD_report[80], PSD_report_tmp; - static u8Byte lastTxOkCnt=0, lastRxOkCnt=0; - u1Byte idx[20]={96,99,102,106,109,112,115,118,122,125, - 0,3,6,10,13,16,19,22,26,29}; - u1Byte n, i, channel, BBReset,tone_idx; - u1Byte PSD_bitmap[10]/*, SSBT=0*/,initial_gain_psd=0, RSSI_BT=0, initialGainUpper; - s4Byte PSD_skip_start, PSD_skip_stop; - u4Byte CurrentChannel, RXIQI, RxIdleLowPwr, wlan_channel; - u4Byte ReScan, Interval, Is40MHz; - u8Byte curTxOkCnt, curRxOkCnt; - //--------------2G band synthesizer for 92D switch RF channel using----------------- - u1Byte group_idx=0; - u4Byte SYN_RF25=0, SYN_RF26=0, SYN_RF27=0, SYN_RF2B=0, SYN_RF2C=0; - u4Byte SYN[5] = {0x25, 0x26, 0x27, 0x2B, 0x2C}; // synthesizer RF register for 2G channel - u4Byte SYN_group[3][5] = {{0x643BC, 0xFC038, 0x77C1A, 0x41289, 0x01840}, // For CH1,2,4,9,10.11.12 {0x643BC, 0xFC038, 0x77C1A, 0x41289, 0x01840} - {0x643BC, 0xFC038, 0x07C1A, 0x41289, 0x01840}, // For CH3,13,14 - {0x243BC, 0xFC438, 0x07C1A, 0x4128B, 0x0FC41}}; // For Ch5,6,7,8 - //--------------------- Add by Gary for Debug setting ---------------------- - u1Byte RSSI_BT_new = (u1Byte) ODM_GetBBReg(pDM_Odm, 0xB9C, 0xFF); - u1Byte rssi_ctrl = (u1Byte) ODM_GetBBReg(pDM_Odm, 0xB38, 0xFF); - //--------------------------------------------------------------------- - - if(pMgntInfo->bScanInProgress) - { - return; - } - - ReScan = PSD_RESCAN; - Interval = SCAN_INTERVAL; - - - //1 Initialization - if(init_memory == 0) - { - RT_TRACE( COMP_PSD, DBG_LOUD,("Init memory\n")); - for(i = 0; i < 80; i++) - PSD_bitmap_memory[i] = 0xFF; // channel is always good - init_memory = 1; - } - if(psd_cnt == 0) - { - RT_TRACE(COMP_PSD, DBG_LOUD,("Enter dm_PSD_Monitor\n")); - for(i = 0; i < 80; i++) - PSD_report[i] = 0; - } - - //1 Backup Current Settings - CurrentChannel = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_CHNLBW, bRFRegOffsetMask); - if(pDM_Odm->SupportICType == ODM_RTL8192D) - { - //2 Record Current synthesizer parameters based on current channel - if((*(pDM_Odm->pMacPhyMode)==ODM_SMSP)||(*(pDM_Odm->pMacPhyMode)==ODM_DMSP)) - { - SYN_RF25 = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x25, bMaskDWord); - SYN_RF26 = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x26, bMaskDWord); - SYN_RF27 = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x27, bMaskDWord); - SYN_RF2B = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x2B, bMaskDWord); - SYN_RF2C = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x2C, bMaskDWord); - } - else // DualMAC_DualPHY 2G - { - SYN_RF25 = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x25, bMaskDWord); - SYN_RF26 = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x26, bMaskDWord); - SYN_RF27 = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x27, bMaskDWord); - SYN_RF2B = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x2B, bMaskDWord); - SYN_RF2C = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x2C, bMaskDWord); - } - } - RXIQI = ODM_GetBBReg(pDM_Odm, 0xC14, bMaskDWord); - RxIdleLowPwr = (ODM_GetBBReg(pDM_Odm, 0x818, bMaskDWord)&BIT28)>>28; - Is40MHz = *(pDM_Odm->pBandWidth); - ODM_RT_TRACE(pDM_Odm, COMP_PSD, DBG_LOUD,("PSD Scan Start\n")); - //1 Turn off CCK - ODM_SetBBReg(pDM_Odm, rFPGA0_RFMOD, BIT24, 0); - //1 Turn off TX - //Pause TX Queue - ODM_Write1Byte(pDM_Odm, REG_TXPAUSE, 0xFF); - //Force RX to stop TX immediately - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_AC, bRFRegOffsetMask, 0x32E13); - //1 Turn off RX - //Rx AGC off RegC70[0]=0, RegC7C[20]=0 - ODM_SetBBReg(pDM_Odm, 0xC70, BIT0, 0); - ODM_SetBBReg(pDM_Odm, 0xC7C, BIT20, 0); - //Turn off CCA - ODM_SetBBReg(pDM_Odm, 0xC14, bMaskDWord, 0x0); - //BB Reset - ODM_SetBBReg(pDM_Odm, 0x87C, BIT31, 1); //clock gated to prevent from AGC table mess - BBReset = ODM_Read1Byte(pDM_Odm, 0x02); - ODM_Write1Byte(pDM_Odm, 0x02, BBReset&(~BIT0)); - ODM_Write1Byte(pDM_Odm, 0x02, BBReset|BIT0); - ODM_SetBBReg(pDM_Odm, 0x87C, BIT31, 0); - //1 Leave RX idle low power - ODM_SetBBReg(pDM_Odm, 0x818, BIT28, 0x0); - //1 Fix initial gain - RSSI_BT = RSSI_BT_new; - RT_TRACE(COMP_PSD, DBG_LOUD,("PSD: RSSI_BT= %d\n", RSSI_BT)); - - if(rssi_ctrl == 1) // just for debug!! - initial_gain_psd = RSSI_BT_new; - else - initial_gain_psd = pDM_Odm->RSSI_Min; // PSD report based on RSSI - - RT_TRACE(COMP_PSD, DBG_LOUD,("PSD: RSSI_BT= %d\n", RSSI_BT)); - - initialGainUpper = 0x54; - - RSSI_BT = initial_gain_psd; - //SSBT = RSSI_BT; - - //RT_TRACE( COMP_PSD, DBG_LOUD,("PSD: SSBT= %d\n", SSBT)); - RT_TRACE( COMP_PSD, DBG_LOUD,("PSD: initial gain= 0x%x\n", initial_gain_psd)); - - pDM_Odm->bDMInitialGainEnable = FALSE; - initial_gain = ODM_GetBBReg(pDM_Odm, 0xc50, bMaskDWord) & 0x7F; - //ODM_SetBBReg(pDM_Odm, 0xc50, 0x7F, initial_gain_psd); - ODM_Write_DIG(pDM_Odm, initial_gain_psd); - //1 Turn off 3-wire - ODM_SetBBReg(pDM_Odm, 0x88c, BIT20|BIT21|BIT22|BIT23, 0xF); - - //pts value = 128, 256, 512, 1024 - pts = 128; - - if(pts == 128) - { - ODM_SetBBReg(pDM_Odm, 0x808, BIT14|BIT15, 0x0); - start_point = 64; - stop_point = 192; - } - else if(pts == 256) - { - ODM_SetBBReg(pDM_Odm, 0x808, BIT14|BIT15, 0x1); - start_point = 128; - stop_point = 384; - } - else if(pts == 512) - { - ODM_SetBBReg(pDM_Odm, 0x808, BIT14|BIT15, 0x2); - start_point = 256; - stop_point = 768; - } - else - { - ODM_SetBBReg(pDM_Odm, 0x808, BIT14|BIT15, 0x3); - start_point = 512; - stop_point = 1536; - } - - -//3 Skip WLAN channels if WLAN busy - curTxOkCnt = *(pDM_Odm->pNumTxBytesUnicast) - lastTxOkCnt; - curRxOkCnt = *(pDM_Odm->pNumRxBytesUnicast) - lastRxOkCnt; - lastTxOkCnt = *(pDM_Odm->pNumTxBytesUnicast); - lastRxOkCnt = *(pDM_Odm->pNumRxBytesUnicast); - - PSD_skip_start=80; - PSD_skip_stop = 0; - wlan_channel = CurrentChannel & 0x0f; - - RT_TRACE(COMP_PSD,DBG_LOUD,("PSD: current channel: %x, BW:%d \n", wlan_channel, Is40MHz)); - - if((curRxOkCnt+curTxOkCnt) > 1000) - { - PSD_skip_start = (wlan_channel-1)*5 -Is40MHz*10; - PSD_skip_stop = PSD_skip_start + (1+Is40MHz)*20; - } - - RT_TRACE(COMP_PSD,DBG_LOUD,("PSD: Skip tone from %d to %d \n", PSD_skip_start, PSD_skip_stop)); - - for (n=0;n<80;n++) - { - if((n%20)==0) - { - channel = (n/20)*4 + 1; - if(pDM_Odm->SupportICType == ODM_RTL8192D) - { - switch(channel) - { - case 1: - case 9: - group_idx = 0; - break; - case 5: - group_idx = 2; - break; - case 13: - group_idx = 1; - break; - } - if((*(pDM_Odm->pMacPhyMode)==ODM_SMSP)||(*(pDM_Odm->pMacPhyMode)==ODM_DMSP)) - { - for(i = 0; i < SYN_Length; i++) - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, SYN[i], bMaskDWord, SYN_group[group_idx][i]); - - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_CHNLBW, 0x3FF, channel); - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, RF_CHNLBW, 0x3FF, channel); - } - else // DualMAC_DualPHY 2G - { - for(i = 0; i < SYN_Length; i++) - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, SYN[i], bMaskDWord, SYN_group[group_idx][i]); - - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_CHNLBW, 0x3FF, channel); - } - } - else - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_CHNLBW, 0x3FF, channel); - } - tone_idx = n%20; - if ((n>=PSD_skip_start) && (n PSD_report[n]) - PSD_report[n] = PSD_report_tmp; - - } - } - - PatchDCTone(pDM_Odm, PSD_report, initial_gain_psd); - - //----end - //1 Turn on RX - //Rx AGC on - ODM_SetBBReg(pDM_Odm, 0xC70, BIT0, 1); - ODM_SetBBReg(pDM_Odm, 0xC7C, BIT20, 1); - //CCK on - ODM_SetBBReg(pDM_Odm, rFPGA0_RFMOD, BIT24, 1); - //1 Turn on TX - //Resume TX Queue - ODM_Write1Byte(pDM_Odm, REG_TXPAUSE, 0x00); - //Turn on 3-wire - ODM_SetBBReg(pDM_Odm, 0x88c, BIT20|BIT21|BIT22|BIT23, 0x0); - //1 Restore Current Settings - //Resume DIG - pDM_Odm->bDMInitialGainEnable= TRUE; - //ODM_SetBBReg(pDM_Odm, 0xc50, 0x7F, initial_gain); - ODM_Write_DIG(pDM_Odm,(u1Byte) initial_gain); - // restore originl center frequency - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_CHNLBW, bRFRegOffsetMask, CurrentChannel); - if(pDM_Odm->SupportICType == ODM_RTL8192D) - { - if((*(pDM_Odm->pMacPhyMode)==ODM_SMSP)||(*(pDM_Odm->pMacPhyMode)==ODM_DMSP)) - { - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, RF_CHNLBW, bMaskDWord, CurrentChannel); - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x25, bMaskDWord, SYN_RF25); - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x26, bMaskDWord, SYN_RF26); - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x27, bMaskDWord, SYN_RF27); - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x2B, bMaskDWord, SYN_RF2B); - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x2C, bMaskDWord, SYN_RF2C); - } - else // DualMAC_DualPHY - { - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x25, bMaskDWord, SYN_RF25); - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x26, bMaskDWord, SYN_RF26); - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x27, bMaskDWord, SYN_RF27); - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x2B, bMaskDWord, SYN_RF2B); - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x2C, bMaskDWord, SYN_RF2C); - } - } - //Turn on CCA - ODM_SetBBReg(pDM_Odm, 0xC14, bMaskDWord, RXIQI); - //Restore RX idle low power - if(RxIdleLowPwr == TRUE) - ODM_SetBBReg(pDM_Odm, 0x818, BIT28, 1); - - psd_cnt++; - //gPrint("psd cnt=%d\n", psd_cnt); - ODM_RT_TRACE(pDM_Odm,COMP_PSD, DBG_LOUD,("PSD:psd_cnt = %d \n",psd_cnt)); - if (psd_cnt < ReScan) - { - ODM_SetTimer(pDM_Odm, &pRX_HP_Table->PSDTimer, Interval); //ms - } - else - { - psd_cnt = 0; - for(i=0;i<80;i++) - RT_TRACE( COMP_PSD, DBG_LOUD,("psd_report[%d]= %d \n", 2402+i, PSD_report[i])); - //DbgPrint("psd_report[%d]= %d \n", 2402+i, PSD_report[i]); - - GoodChannelDecision(pDM_Odm, PSD_report, PSD_bitmap,RSSI_BT, PSD_bitmap_memory); - - } - } - -VOID -odm_PSD_RXHPCallback( - PRT_TIMER pTimer -) -{ - PADAPTER Adapter = (PADAPTER)pTimer->Adapter; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; - pRXHP_T pRX_HP_Table = &pDM_Odm->DM_RXHP_Table; - -#if DEV_BUS_TYPE==RT_PCI_INTERFACE - #if USE_WORKITEM - ODM_ScheduleWorkItem(&pRX_HP_Table->PSDTimeWorkitem); - #else - odm_PSD_RXHP(pDM_Odm); - #endif -#else - ODM_ScheduleWorkItem(&pRX_HP_Table->PSDTimeWorkitem); -#endif - - } - -VOID -odm_PSD_RXHPWorkitemCallback( - IN PVOID pContext - ) -{ - PADAPTER pAdapter = (PADAPTER)pContext; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); - PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; - - odm_PSD_RXHP(pDM_Odm); -} - -#endif //#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - -VOID -odm_PathDiversityInit( - IN PDM_ODM_T pDM_Odm -) -{ - if(!(pDM_Odm->SupportAbility & ODM_BB_PATH_DIV)) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_PATH_DIV,ODM_DBG_LOUD,("Return: Not Support PathDiv\n")); - return; - } - -#if RTL8812A_SUPPORT - - if(pDM_Odm->SupportICType & ODM_RTL8812) - ODM_PathDiversityInit_8812A(pDM_Odm); -#endif -} - - -VOID -odm_PathDiversity( - IN PDM_ODM_T pDM_Odm -) -{ - if(!(pDM_Odm->SupportAbility & ODM_BB_PATH_DIV)) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_PATH_DIV,ODM_DBG_LOUD,("Return: Not Support PathDiv\n")); - return; - } - -#if RTL8812A_SUPPORT - - if(pDM_Odm->SupportICType & ODM_RTL8812) - ODM_PathDiversity_8812A(pDM_Odm); -#endif -} - - -// -// 2011/12/02 MH Copy from MP oursrc for temporarily test. -// -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) -VOID -odm_OFDMTXPathDiversity_92C( - IN PADAPTER Adapter) -{ -// HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - PMGNT_INFO pMgntInfo = &(Adapter->MgntInfo); - PRT_WLAN_STA pEntry; - u1Byte i, DefaultRespPath = 0; - s4Byte MinRSSI = 0xFF; - pPD_T pDM_PDTable = &Adapter->DM_PDTable; - pDM_PDTable->OFDMTXPath = 0; - - //1 Default Port - if(pMgntInfo->mAssoc) - { - RT_TRACE( COMP_SWAS, DBG_LOUD, ("odm_OFDMTXPathDiversity_92C: Default port RSSI[0]=%d, RSSI[1]=%d\n", - Adapter->RxStats.RxRSSIPercentage[0], Adapter->RxStats.RxRSSIPercentage[1])); - if(Adapter->RxStats.RxRSSIPercentage[0] > Adapter->RxStats.RxRSSIPercentage[1]) - { - pDM_PDTable->OFDMTXPath = pDM_PDTable->OFDMTXPath & (~BIT0); - MinRSSI = Adapter->RxStats.RxRSSIPercentage[1]; - DefaultRespPath = 0; - RT_TRACE( COMP_SWAS, DBG_LOUD, ("odm_OFDMTXPathDiversity_92C: Default port Select Path-0\n")); - } - else - { - pDM_PDTable->OFDMTXPath = pDM_PDTable->OFDMTXPath | BIT0; - MinRSSI = Adapter->RxStats.RxRSSIPercentage[0]; - DefaultRespPath = 1; - RT_TRACE( COMP_SWAS, DBG_LOUD, ("odm_OFDMTXPathDiversity_92C: Default port Select Path-1\n")); - } - //RT_TRACE( COMP_SWAS, DBG_LOUD, ("pDM_PDTable->OFDMTXPath =0x%x\n",pDM_PDTable->OFDMTXPath)); - } - //1 Extension Port - for(i = 0; i < ODM_ASSOCIATE_ENTRY_NUM; i++) - { - if(IsAPModeExist(Adapter) && GetFirstExtAdapter(Adapter) != NULL) - pEntry = AsocEntry_EnumStation(GetFirstExtAdapter(Adapter), i); - else - pEntry = AsocEntry_EnumStation(GetDefaultAdapter(Adapter), i); - - if(pEntry!=NULL) - { - if(pEntry->bAssociated) - { - RT_TRACE( COMP_SWAS, DBG_LOUD, ("odm_OFDMTXPathDiversity_92C: MACID=%d, RSSI_0=%d, RSSI_1=%d\n", - pEntry->AssociatedMacId, pEntry->rssi_stat.RxRSSIPercentage[0], pEntry->rssi_stat.RxRSSIPercentage[1])); - - if(pEntry->rssi_stat.RxRSSIPercentage[0] > pEntry->rssi_stat.RxRSSIPercentage[1]) - { - pDM_PDTable->OFDMTXPath = pDM_PDTable->OFDMTXPath & ~(BIT(pEntry->AssociatedMacId)); - //pHalData->TXPath = pHalData->TXPath & ~(1<<(pEntry->AssociatedMacId)); - RT_TRACE( COMP_SWAS, DBG_LOUD, ("odm_OFDMTXPathDiversity_92C: MACID=%d Select Path-0\n", pEntry->AssociatedMacId)); - if(pEntry->rssi_stat.RxRSSIPercentage[1] < MinRSSI) - { - MinRSSI = pEntry->rssi_stat.RxRSSIPercentage[1]; - DefaultRespPath = 0; - } - } - else - { - pDM_PDTable->OFDMTXPath = pDM_PDTable->OFDMTXPath | BIT(pEntry->AssociatedMacId); - //pHalData->TXPath = pHalData->TXPath | (1 << (pEntry->AssociatedMacId)); - RT_TRACE( COMP_SWAS, DBG_LOUD, ("odm_OFDMTXPathDiversity_92C: MACID=%d Select Path-1\n", pEntry->AssociatedMacId)); - if(pEntry->rssi_stat.RxRSSIPercentage[0] < MinRSSI) - { - MinRSSI = pEntry->rssi_stat.RxRSSIPercentage[0]; - DefaultRespPath = 1; - } - } - } - } - else - { - break; - } - } - - pDM_PDTable->OFDMDefaultRespPath = DefaultRespPath; -} - - -BOOLEAN -odm_IsConnected_92C( - IN PADAPTER Adapter -) -{ - PRT_WLAN_STA pEntry; - PMGNT_INFO pMgntInfo = &(Adapter->MgntInfo); - u4Byte i; - BOOLEAN bConnected=FALSE; - - if(pMgntInfo->mAssoc) - { - bConnected = TRUE; - } - else - { - for(i = 0; i < ODM_ASSOCIATE_ENTRY_NUM; i++) - { - if(IsAPModeExist(Adapter) && GetFirstExtAdapter(Adapter) != NULL) - pEntry = AsocEntry_EnumStation(GetFirstExtAdapter(Adapter), i); - else - pEntry = AsocEntry_EnumStation(GetDefaultAdapter(Adapter), i); - - if(pEntry!=NULL) - { - if(pEntry->bAssociated) - { - bConnected = TRUE; - break; - } - } - else - { - break; - } - } - } - return bConnected; -} - - -VOID -odm_ResetPathDiversity_92C( - IN PADAPTER Adapter -) -{ - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - pPD_T pDM_PDTable = &Adapter->DM_PDTable; - PRT_WLAN_STA pEntry; - u4Byte i,j; - - pHalData->RSSI_test = FALSE; - pDM_PDTable->CCK_Pkt_Cnt = 0; - pDM_PDTable->OFDM_Pkt_Cnt = 0; - pHalData->CCK_Pkt_Cnt =0; - pHalData->OFDM_Pkt_Cnt =0; - - if(pDM_PDTable->CCKPathDivEnable == TRUE) - PHY_SetBBReg(Adapter, rCCK0_AFESetting , 0x0F000000, 0x01); //RX path = PathAB - - for(i=0; i<2; i++) - { - pDM_PDTable->RSSI_CCK_Path_cnt[i]=0; - pDM_PDTable->RSSI_CCK_Path[i] = 0; - } - for(i = 0; i < ODM_ASSOCIATE_ENTRY_NUM; i++) - { - if(IsAPModeExist(Adapter) && GetFirstExtAdapter(Adapter) != NULL) - pEntry = AsocEntry_EnumStation(GetFirstExtAdapter(Adapter), i); - else - pEntry = AsocEntry_EnumStation(GetDefaultAdapter(Adapter), i); - - if(pEntry!=NULL) - { - pEntry->rssi_stat.CCK_Pkt_Cnt = 0; - pEntry->rssi_stat.OFDM_Pkt_Cnt = 0; - for(j=0; j<2; j++) - { - pEntry->rssi_stat.RSSI_CCK_Path_cnt[j] = 0; - pEntry->rssi_stat.RSSI_CCK_Path[j] = 0; - } - } - else - break; - } -} - - -VOID -odm_CCKTXPathDiversity_92C( - IN PADAPTER Adapter -) -{ - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - PMGNT_INFO pMgntInfo = &(Adapter->MgntInfo); - PRT_WLAN_STA pEntry; - s4Byte MinRSSI = 0xFF; - u1Byte i, DefaultRespPath = 0; -// BOOLEAN bBModePathDiv = FALSE; - pPD_T pDM_PDTable = &Adapter->DM_PDTable; - - //1 Default Port - if(pMgntInfo->mAssoc) - { - if(pHalData->OFDM_Pkt_Cnt == 0) - { - for(i=0; i<2; i++) - { - if(pDM_PDTable->RSSI_CCK_Path_cnt[i] > 1) //Because the first packet is discarded - pDM_PDTable->RSSI_CCK_Path[i] = pDM_PDTable->RSSI_CCK_Path[i] / (pDM_PDTable->RSSI_CCK_Path_cnt[i]-1); - else - pDM_PDTable->RSSI_CCK_Path[i] = 0; - } - RT_TRACE( COMP_SWAS, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: pDM_PDTable->RSSI_CCK_Path[0]=%d, pDM_PDTable->RSSI_CCK_Path[1]=%d\n", - pDM_PDTable->RSSI_CCK_Path[0], pDM_PDTable->RSSI_CCK_Path[1])); - RT_TRACE( COMP_SWAS, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: pDM_PDTable->RSSI_CCK_Path_cnt[0]=%d, pDM_PDTable->RSSI_CCK_Path_cnt[1]=%d\n", - pDM_PDTable->RSSI_CCK_Path_cnt[0], pDM_PDTable->RSSI_CCK_Path_cnt[1])); - - if(pDM_PDTable->RSSI_CCK_Path[0] > pDM_PDTable->RSSI_CCK_Path[1]) - { - pDM_PDTable->CCKTXPath = pDM_PDTable->CCKTXPath & (~BIT0); - MinRSSI = pDM_PDTable->RSSI_CCK_Path[1]; - DefaultRespPath = 0; - RT_TRACE( COMP_SWAS, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: Default port Select CCK Path-0\n")); - } - else if(pDM_PDTable->RSSI_CCK_Path[0] < pDM_PDTable->RSSI_CCK_Path[1]) - { - pDM_PDTable->CCKTXPath = pDM_PDTable->CCKTXPath | BIT0; - MinRSSI = pDM_PDTable->RSSI_CCK_Path[0]; - DefaultRespPath = 1; - RT_TRACE( COMP_SWAS, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: Default port Select CCK Path-1\n")); - } - else - { - if((pDM_PDTable->RSSI_CCK_Path[0] != 0) && (pDM_PDTable->RSSI_CCK_Path[0] < MinRSSI)) - { - pDM_PDTable->CCKTXPath = pDM_PDTable->CCKTXPath & (~BIT0); - RT_TRACE( COMP_SWAS, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: Default port Select CCK Path-0\n")); - MinRSSI = pDM_PDTable->RSSI_CCK_Path[1]; - DefaultRespPath = 0; - } - else - { - RT_TRACE( COMP_SWAS, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: Default port unchange CCK Path\n")); - } - } - } - else //Follow OFDM decision - { - pDM_PDTable->CCKTXPath = (pDM_PDTable->CCKTXPath & (~BIT0)) | (pDM_PDTable->OFDMTXPath &BIT0); - RT_TRACE( COMP_SWAS, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: Follow OFDM decision, Default port Select CCK Path-%d\n", - pDM_PDTable->CCKTXPath &BIT0)); - } - } - //1 Extension Port - for(i = 0; i < ODM_ASSOCIATE_ENTRY_NUM; i++) - { - if(IsAPModeExist(Adapter) && GetFirstExtAdapter(Adapter) != NULL) - pEntry = AsocEntry_EnumStation(GetFirstExtAdapter(Adapter), i); - else - pEntry = AsocEntry_EnumStation(GetDefaultAdapter(Adapter), i); - - if(pEntry!=NULL) - { - if(pEntry->bAssociated) - { - if(pEntry->rssi_stat.OFDM_Pkt_Cnt == 0) - { - u1Byte j=0; - for(j=0; j<2; j++) - { - if(pEntry->rssi_stat.RSSI_CCK_Path_cnt[j] > 1) - pEntry->rssi_stat.RSSI_CCK_Path[j] = pEntry->rssi_stat.RSSI_CCK_Path[j] / (pEntry->rssi_stat.RSSI_CCK_Path_cnt[j]-1); - else - pEntry->rssi_stat.RSSI_CCK_Path[j] = 0; - } - RT_TRACE( COMP_SWAS, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: MACID=%d, RSSI_CCK0=%d, RSSI_CCK1=%d\n", - pEntry->AssociatedMacId, pEntry->rssi_stat.RSSI_CCK_Path[0], pEntry->rssi_stat.RSSI_CCK_Path[1])); - - if(pEntry->rssi_stat.RSSI_CCK_Path[0] >pEntry->rssi_stat.RSSI_CCK_Path[1]) - { - pDM_PDTable->CCKTXPath = pDM_PDTable->CCKTXPath & ~(BIT(pEntry->AssociatedMacId)); - RT_TRACE( COMP_SWAS, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: MACID=%d Select CCK Path-0\n", pEntry->AssociatedMacId)); - if(pEntry->rssi_stat.RSSI_CCK_Path[1] < MinRSSI) - { - MinRSSI = pEntry->rssi_stat.RSSI_CCK_Path[1]; - DefaultRespPath = 0; - } - } - else if(pEntry->rssi_stat.RSSI_CCK_Path[0] rssi_stat.RSSI_CCK_Path[1]) - { - pDM_PDTable->CCKTXPath = pDM_PDTable->CCKTXPath | BIT(pEntry->AssociatedMacId); - RT_TRACE( COMP_SWAS, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: MACID=%d Select CCK Path-1\n", pEntry->AssociatedMacId)); - if(pEntry->rssi_stat.RSSI_CCK_Path[0] < MinRSSI) - { - MinRSSI = pEntry->rssi_stat.RSSI_CCK_Path[0]; - DefaultRespPath = 1; - } - } - else - { - if((pEntry->rssi_stat.RSSI_CCK_Path[0] != 0) && (pEntry->rssi_stat.RSSI_CCK_Path[0] < MinRSSI)) - { - pDM_PDTable->CCKTXPath = pDM_PDTable->CCKTXPath & ~(BIT(pEntry->AssociatedMacId)); - MinRSSI = pEntry->rssi_stat.RSSI_CCK_Path[1]; - DefaultRespPath = 0; - RT_TRACE( COMP_SWAS, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: MACID=%d Select CCK Path-0\n", pEntry->AssociatedMacId)); - } - else - { - RT_TRACE( COMP_SWAS, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: MACID=%d unchange CCK Path\n", pEntry->AssociatedMacId)); - } - } - } - else //Follow OFDM decision - { - pDM_PDTable->CCKTXPath = (pDM_PDTable->CCKTXPath & (~(BIT(pEntry->AssociatedMacId)))) | (pDM_PDTable->OFDMTXPath & BIT(pEntry->AssociatedMacId)); - RT_TRACE( COMP_SWAS, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: Follow OFDM decision, MACID=%d Select CCK Path-%d\n", - pEntry->AssociatedMacId, (pDM_PDTable->CCKTXPath & BIT(pEntry->AssociatedMacId))>>(pEntry->AssociatedMacId))); - } - } - } - else - { - break; - } - } - - RT_TRACE( COMP_SWAS, DBG_LOUD, ("odm_CCKTXPathDiversity_92C:MinRSSI=%d\n",MinRSSI)); - - if(MinRSSI == 0xFF) - DefaultRespPath = pDM_PDTable->CCKDefaultRespPath; - - pDM_PDTable->CCKDefaultRespPath = DefaultRespPath; -} - - - -VOID -odm_PathDiversityAfterLink_92C( - IN PADAPTER Adapter -) -{ - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; - pPD_T pDM_PDTable = &Adapter->DM_PDTable; - u1Byte DefaultRespPath=0; - - if((!IS_92C_SERIAL(pHalData->VersionID)) || (pHalData->PathDivCfg != 1) || (pHalData->eRFPowerState == eRfOff)) - { - if(pHalData->PathDivCfg == 0) - { - RT_TRACE( COMP_SWAS, DBG_LOUD, ("No ODM_TXPathDiversity()\n")); - } - else - { - RT_TRACE( COMP_SWAS, DBG_LOUD, ("2T ODM_TXPathDiversity()\n")); - } - return; - } - if(!odm_IsConnected_92C(Adapter)) - { - RT_TRACE( COMP_SWAS, DBG_LOUD, ("ODM_TXPathDiversity(): No Connections\n")); - return; - } - - - if(pDM_PDTable->TrainingState == 0) - { - RT_TRACE( COMP_SWAS, DBG_LOUD, ("ODM_TXPathDiversity() ==>\n")); - odm_OFDMTXPathDiversity_92C(Adapter); - - if((pDM_PDTable->CCKPathDivEnable == TRUE) && (pDM_PDTable->OFDM_Pkt_Cnt < 100)) - { - //RT_TRACE( COMP_SWAS, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: TrainingState=0\n")); - - if(pDM_PDTable->CCK_Pkt_Cnt > 300) - pDM_PDTable->Timer = 20; - else if(pDM_PDTable->CCK_Pkt_Cnt > 100) - pDM_PDTable->Timer = 60; - else - pDM_PDTable->Timer = 250; - RT_TRACE( COMP_SWAS, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: timer=%d\n",pDM_PDTable->Timer)); - - PHY_SetBBReg(Adapter, rCCK0_AFESetting , 0x0F000000, 0x00); // RX path = PathA - pDM_PDTable->TrainingState = 1; - pHalData->RSSI_test = TRUE; - ODM_SetTimer( pDM_Odm, &pDM_Odm->CCKPathDiversityTimer, pDM_PDTable->Timer); //ms - } - else - { - pDM_PDTable->CCKTXPath = pDM_PDTable->OFDMTXPath; - DefaultRespPath = pDM_PDTable->OFDMDefaultRespPath; - RT_TRACE( COMP_SWAS, DBG_LOUD, ("odm_SetRespPath_92C: Skip odm_CCKTXPathDiversity_92C, DefaultRespPath is OFDM\n")); - odm_SetRespPath_92C(Adapter, DefaultRespPath); - odm_ResetPathDiversity_92C(Adapter); - RT_TRACE( COMP_SWAS, DBG_LOUD, ("ODM_TXPathDiversity() <==\n")); - } - } - else if(pDM_PDTable->TrainingState == 1) - { - //RT_TRACE( COMP_SWAS, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: TrainingState=1\n")); - PHY_SetBBReg(Adapter, rCCK0_AFESetting , 0x0F000000, 0x05); // RX path = PathB - pDM_PDTable->TrainingState = 2; - ODM_SetTimer( pDM_Odm, &pDM_Odm->CCKPathDiversityTimer, pDM_PDTable->Timer); //ms - } - else - { - //RT_TRACE( COMP_SWAS, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: TrainingState=2\n")); - pDM_PDTable->TrainingState = 0; - odm_CCKTXPathDiversity_92C(Adapter); - if(pDM_PDTable->OFDM_Pkt_Cnt != 0) - { - DefaultRespPath = pDM_PDTable->OFDMDefaultRespPath; - RT_TRACE( COMP_SWAS, DBG_LOUD, ("odm_SetRespPath_92C: DefaultRespPath is OFDM\n")); - } - else - { - DefaultRespPath = pDM_PDTable->CCKDefaultRespPath; - RT_TRACE( COMP_SWAS, DBG_LOUD, ("odm_SetRespPath_92C: DefaultRespPath is CCK\n")); - } - odm_SetRespPath_92C(Adapter, DefaultRespPath); - odm_ResetPathDiversity_92C(Adapter); - RT_TRACE( COMP_SWAS, DBG_LOUD, ("ODM_TXPathDiversity() <==\n")); - } - -} - - - -VOID -odm_CCKTXPathDiversityCallback( - PRT_TIMER pTimer -) -{ -#if USE_WORKITEM - PADAPTER Adapter = (PADAPTER)pTimer->Adapter; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; -#else - PADAPTER Adapter = (PADAPTER)pTimer->Adapter; -#endif - -#if DEV_BUS_TYPE==RT_PCI_INTERFACE -#if USE_WORKITEM - PlatformScheduleWorkItem(&pDM_Odm->CCKPathDiversityWorkitem); -#else - odm_PathDiversityAfterLink_92C(Adapter); -#endif -#else - PlatformScheduleWorkItem(&pDM_Odm->CCKPathDiversityWorkitem); -#endif - -} - - -VOID -odm_CCKTXPathDiversityWorkItemCallback( - IN PVOID pContext - ) -{ - PADAPTER Adapter = (PADAPTER)pContext; - - odm_CCKTXPathDiversity_92C(Adapter); -} - - -VOID -ODM_CCKPathDiversityChkPerPktRssi( - PADAPTER Adapter, - BOOLEAN bIsDefPort, - BOOLEAN bMatchBSSID, - PRT_WLAN_STA pEntry, - PRT_RFD pRfd, - pu1Byte pDesc - ) -{ - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - BOOLEAN bCount = FALSE; - pPD_T pDM_PDTable = &Adapter->DM_PDTable; - //BOOLEAN isCCKrate = RX_HAL_IS_CCK_RATE_92C(pDesc); -#if DEV_BUS_TYPE != RT_SDIO_INTERFACE - BOOLEAN isCCKrate = RX_HAL_IS_CCK_RATE(Adapter, pDesc); -#else //below code would be removed if we have verified SDIO - BOOLEAN isCCKrate = IS_HARDWARE_TYPE_8188E(Adapter) ? RX_HAL_IS_CCK_RATE_88E(pDesc) : RX_HAL_IS_CCK_RATE_92C(pDesc); -#endif - - if((pHalData->PathDivCfg != 1) || (pHalData->RSSI_test == FALSE)) - return; - - if(pHalData->RSSI_target==NULL && bIsDefPort && bMatchBSSID) - bCount = TRUE; - else if(pHalData->RSSI_target!=NULL && pEntry!=NULL && pHalData->RSSI_target==pEntry) - bCount = TRUE; - - if(bCount && isCCKrate) - { - if(pDM_PDTable->TrainingState == 1 ) - { - if(pEntry) - { - if(pEntry->rssi_stat.RSSI_CCK_Path_cnt[0] != 0) - pEntry->rssi_stat.RSSI_CCK_Path[0] += pRfd->Status.RxPWDBAll; - pEntry->rssi_stat.RSSI_CCK_Path_cnt[0]++; - } - else - { - if(pDM_PDTable->RSSI_CCK_Path_cnt[0] != 0) - pDM_PDTable->RSSI_CCK_Path[0] += pRfd->Status.RxPWDBAll; - pDM_PDTable->RSSI_CCK_Path_cnt[0]++; - } - } - else if(pDM_PDTable->TrainingState == 2 ) - { - if(pEntry) - { - if(pEntry->rssi_stat.RSSI_CCK_Path_cnt[1] != 0) - pEntry->rssi_stat.RSSI_CCK_Path[1] += pRfd->Status.RxPWDBAll; - pEntry->rssi_stat.RSSI_CCK_Path_cnt[1]++; - } - else - { - if(pDM_PDTable->RSSI_CCK_Path_cnt[1] != 0) - pDM_PDTable->RSSI_CCK_Path[1] += pRfd->Status.RxPWDBAll; - pDM_PDTable->RSSI_CCK_Path_cnt[1]++; - } - } - } -} - - -BOOLEAN -ODM_PathDiversityBeforeLink92C( - //IN PADAPTER Adapter - IN PDM_ODM_T pDM_Odm - ) -{ -#if (RT_MEM_SIZE_LEVEL != RT_MEM_SIZE_MINIMUM) - PADAPTER Adapter = pDM_Odm->Adapter; - HAL_DATA_TYPE* pHalData = NULL; - PMGNT_INFO pMgntInfo = NULL; - //pSWAT_T pDM_SWAT_Table = &Adapter->DM_SWAT_Table; - pPD_T pDM_PDTable = NULL; - - s1Byte Score = 0; - PRT_WLAN_BSS pTmpBssDesc; - PRT_WLAN_BSS pTestBssDesc; - - u1Byte target_chnl = 0; - u1Byte index; - - if (pDM_Odm->Adapter == NULL) //For BSOD when plug/unplug fast. //By YJ,120413 - { // The ODM structure is not initialized. - return FALSE; - } - pHalData = GET_HAL_DATA(Adapter); - pMgntInfo = &Adapter->MgntInfo; - pDM_PDTable = &Adapter->DM_PDTable; - - // Condition that does not need to use path diversity. - if((!IS_92C_SERIAL(pHalData->VersionID)) || (pHalData->PathDivCfg!=1) || pMgntInfo->AntennaTest ) - { - RT_TRACE(COMP_SWAS, DBG_LOUD, - ("ODM_PathDiversityBeforeLink92C(): No PathDiv Mechanism before link.\n")); - return FALSE; - } - - // Since driver is going to set BB register, it shall check if there is another thread controlling BB/RF. - PlatformAcquireSpinLock(Adapter, RT_RF_STATE_SPINLOCK); - if(pHalData->eRFPowerState!=eRfOn || pMgntInfo->RFChangeInProgress || pMgntInfo->bMediaConnect) - { - PlatformReleaseSpinLock(Adapter, RT_RF_STATE_SPINLOCK); - - RT_TRACE(COMP_SWAS, DBG_LOUD, - ("ODM_PathDiversityBeforeLink92C(): RFChangeInProgress(%x), eRFPowerState(%x)\n", - pMgntInfo->RFChangeInProgress, - pHalData->eRFPowerState)); - - //pDM_SWAT_Table->SWAS_NoLink_State = 0; - pDM_PDTable->PathDiv_NoLink_State = 0; - - return FALSE; - } - else - { - PlatformReleaseSpinLock(Adapter, RT_RF_STATE_SPINLOCK); - } - - //1 Run AntDiv mechanism "Before Link" part. - //if(pDM_SWAT_Table->SWAS_NoLink_State == 0) - if(pDM_PDTable->PathDiv_NoLink_State == 0) - { - //1 Prepare to do Scan again to check current antenna state. - - // Set check state to next step. - //pDM_SWAT_Table->SWAS_NoLink_State = 1; - pDM_PDTable->PathDiv_NoLink_State = 1; - - // Copy Current Scan list. - Adapter->MgntInfo.tmpNumBssDesc = pMgntInfo->NumBssDesc; - PlatformMoveMemory((PVOID)Adapter->MgntInfo.tmpbssDesc, (PVOID)pMgntInfo->bssDesc, sizeof(RT_WLAN_BSS)*MAX_BSS_DESC); - - // Switch Antenna to another one. - if(pDM_PDTable->DefaultRespPath == 0) - { - PHY_SetBBReg(Adapter, rCCK0_AFESetting , 0x0F000000, 0x05); // TRX path = PathB - odm_SetRespPath_92C(Adapter, 1); - pDM_PDTable->OFDMTXPath = 0xFFFFFFFF; - pDM_PDTable->CCKTXPath = 0xFFFFFFFF; - } - else - { - PHY_SetBBReg(Adapter, rCCK0_AFESetting , 0x0F000000, 0x00); // TRX path = PathA - odm_SetRespPath_92C(Adapter, 0); - pDM_PDTable->OFDMTXPath = 0x0; - pDM_PDTable->CCKTXPath = 0x0; - } -#if 0 - - pDM_SWAT_Table->PreAntenna = pDM_SWAT_Table->CurAntenna; - pDM_SWAT_Table->CurAntenna = (pDM_SWAT_Table->CurAntenna==Antenna_A)?Antenna_B:Antenna_A; - - RT_TRACE(COMP_SWAS, DBG_LOUD, - ("ODM_SwAntDivCheckBeforeLink: Change to Ant(%s) for testing.\n", (pDM_SWAT_Table->CurAntenna==Antenna_A)?"A":"B")); - //PHY_SetBBReg(Adapter, rFPGA0_XA_RFInterfaceOE, 0x300, DM_SWAT_Table.CurAntenna); - pDM_SWAT_Table->SWAS_NoLink_BK_Reg860 = ((pDM_SWAT_Table->SWAS_NoLink_BK_Reg860 & 0xfffffcff) | (pDM_SWAT_Table->CurAntenna<<8)); - PHY_SetBBReg(Adapter, rFPGA0_XA_RFInterfaceOE, bMaskDWord, pDM_SWAT_Table->SWAS_NoLink_BK_Reg860); -#endif - - // Go back to scan function again. - RT_TRACE(COMP_SWAS, DBG_LOUD, ("ODM_PathDiversityBeforeLink92C: Scan one more time\n")); - pMgntInfo->ScanStep=0; - target_chnl = odm_SwAntDivSelectScanChnl(Adapter); - odm_SwAntDivConstructScanChnl(Adapter, target_chnl); - PlatformSetTimer(Adapter, &pMgntInfo->ScanTimer, 5); - - return TRUE; - } - else - { - //1 ScanComple() is called after antenna swiched. - //1 Check scan result and determine which antenna is going - //1 to be used. - - for(index=0; indexMgntInfo.tmpNumBssDesc; index++) - { - pTmpBssDesc = &(Adapter->MgntInfo.tmpbssDesc[index]); - pTestBssDesc = &(pMgntInfo->bssDesc[index]); - - if(PlatformCompareMemory(pTestBssDesc->bdBssIdBuf, pTmpBssDesc->bdBssIdBuf, 6)!=0) - { - RT_TRACE(COMP_SWAS, DBG_LOUD, ("ODM_PathDiversityBeforeLink92C(): ERROR!! This shall not happen.\n")); - continue; - } - - if(pTmpBssDesc->RecvSignalPower > pTestBssDesc->RecvSignalPower) - { - RT_TRACE(COMP_SWAS, DBG_LOUD, ("ODM_PathDiversityBeforeLink92C: Compare scan entry: Score++\n")); - RT_PRINT_STR(COMP_SWAS, DBG_LOUD, "SSID: ", pTestBssDesc->bdSsIdBuf, pTestBssDesc->bdSsIdLen); - RT_TRACE(COMP_SWAS, DBG_LOUD, ("Original: %d, Test: %d\n", pTmpBssDesc->RecvSignalPower, pTestBssDesc->RecvSignalPower)); - - Score++; - PlatformMoveMemory(pTestBssDesc, pTmpBssDesc, sizeof(RT_WLAN_BSS)); - } - else if(pTmpBssDesc->RecvSignalPower < pTestBssDesc->RecvSignalPower) - { - RT_TRACE(COMP_SWAS, DBG_LOUD, ("ODM_PathDiversityBeforeLink92C: Compare scan entry: Score--\n")); - RT_PRINT_STR(COMP_SWAS, DBG_LOUD, "SSID: ", pTestBssDesc->bdSsIdBuf, pTestBssDesc->bdSsIdLen); - RT_TRACE(COMP_SWAS, DBG_LOUD, ("Original: %d, Test: %d\n", pTmpBssDesc->RecvSignalPower, pTestBssDesc->RecvSignalPower)); - Score--; - } - - } - - if(pMgntInfo->NumBssDesc!=0 && Score<=0) - { - RT_TRACE(COMP_SWAS, DBG_LOUD, - ("ODM_PathDiversityBeforeLink92C(): DefaultRespPath=%d\n", pDM_PDTable->DefaultRespPath)); - - //pDM_SWAT_Table->PreAntenna = pDM_SWAT_Table->CurAntenna; - } - else - { - RT_TRACE(COMP_SWAS, DBG_LOUD, - ("ODM_PathDiversityBeforeLink92C(): DefaultRespPath=%d\n", pDM_PDTable->DefaultRespPath)); - - if(pDM_PDTable->DefaultRespPath == 0) - { - pDM_PDTable->OFDMTXPath = 0xFFFFFFFF; - pDM_PDTable->CCKTXPath = 0xFFFFFFFF; - odm_SetRespPath_92C(Adapter, 1); - } - else - { - pDM_PDTable->OFDMTXPath = 0x0; - pDM_PDTable->CCKTXPath = 0x0; - odm_SetRespPath_92C(Adapter, 0); - } - PHY_SetBBReg(Adapter, rCCK0_AFESetting , 0x0F000000, 0x01); // RX path = PathAB - - //pDM_SWAT_Table->CurAntenna = pDM_SWAT_Table->PreAntenna; - - //PHY_SetBBReg(Adapter, rFPGA0_XA_RFInterfaceOE, 0x300, DM_SWAT_Table.CurAntenna); - //pDM_SWAT_Table->SWAS_NoLink_BK_Reg860 = ((pDM_SWAT_Table->SWAS_NoLink_BK_Reg860 & 0xfffffcff) | (pDM_SWAT_Table->CurAntenna<<8)); - //PHY_SetBBReg(Adapter, rFPGA0_XA_RFInterfaceOE, bMaskDWord, pDM_SWAT_Table->SWAS_NoLink_BK_Reg860); - } - - // Check state reset to default and wait for next time. - //pDM_SWAT_Table->SWAS_NoLink_State = 0; - pDM_PDTable->PathDiv_NoLink_State = 0; - - return FALSE; - } -#else - return FALSE; -#endif - -} - - -//Neil Chen---2011--06--22 -//----92D Path Diversity----// -//#ifdef PathDiv92D -//================================== -//3 Path Diversity -//================================== -// -// 20100514 Luke/Joseph: -// Add new function for antenna diversity after link. -// This is the main function of antenna diversity after link. -// This function is called in HalDmWatchDog() and ODM_SwAntDivChkAntSwitchCallback(). -// HalDmWatchDog() calls this function with SWAW_STEP_PEAK to initialize the antenna test. -// In SWAW_STEP_PEAK, another antenna and a 500ms timer will be set for testing. -// After 500ms, ODM_SwAntDivChkAntSwitchCallback() calls this function to compare the signal just -// listened on the air with the RSSI of original antenna. -// It chooses the antenna with better RSSI. -// There is also a aged policy for error trying. Each error trying will cost more 5 seconds waiting -// penalty to get next try. -// -// -// 20100503 Joseph: -// Add new function SwAntDivCheck8192C(). -// This is the main function of Antenna diversity function before link. -// Mainly, it just retains last scan result and scan again. -// After that, it compares the scan result to see which one gets better RSSI. -// It selects antenna with better receiving power and returns better scan result. -// - - -// -// 20100514 Luke/Joseph: -// This function is used to gather the RSSI information for antenna testing. -// It selects the RSSI of the peer STA that we want to know. -// -VOID -ODM_PathDivChkPerPktRssi( - PADAPTER Adapter, - BOOLEAN bIsDefPort, - BOOLEAN bMatchBSSID, - PRT_WLAN_STA pEntry, - PRT_RFD pRfd - ) -{ - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - BOOLEAN bCount = FALSE; - PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; - pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; - - if(pHalData->RSSI_target==NULL && bIsDefPort && bMatchBSSID) - bCount = TRUE; - else if(pHalData->RSSI_target!=NULL && pEntry!=NULL && pHalData->RSSI_target==pEntry) - bCount = TRUE; - - if(bCount) - { - //1 RSSI for SW Antenna Switch - if(pDM_SWAT_Table->CurAntenna == MAIN_ANT) - { - pHalData->RSSI_sum_A += pRfd->Status.RxPWDBAll; - pHalData->RSSI_cnt_A++; - } - else - { - pHalData->RSSI_sum_B += pRfd->Status.RxPWDBAll; - pHalData->RSSI_cnt_B++; - - } - } -} - - - -// -// 20100514 Luke/Joseph: -// Add new function to reset antenna diversity state after link. -// -VOID -ODM_PathDivRestAfterLink( - IN PDM_ODM_T pDM_Odm - ) -{ - PADAPTER Adapter=pDM_Odm->Adapter; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; - - pHalData->RSSI_cnt_A = 0; - pHalData->RSSI_cnt_B = 0; - pHalData->RSSI_test = FALSE; - pDM_SWAT_Table->try_flag = 0x0; // NOT 0xff - pDM_SWAT_Table->RSSI_Trying = 0; - pDM_SWAT_Table->SelectAntennaMap=0xAA; - pDM_SWAT_Table->CurAntenna = MAIN_ANT; -} - - -// -// 20100514 Luke/Joseph: -// Callback function for 500ms antenna test trying. -// -VOID -odm_PathDivChkAntSwitchCallback( - PRT_TIMER pTimer -) -{ - PADAPTER Adapter = (PADAPTER)pTimer->Adapter; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; - -#if DEV_BUS_TYPE==RT_PCI_INTERFACE - -#if USE_WORKITEM - PlatformScheduleWorkItem(&pDM_Odm->PathDivSwitchWorkitem); -#else - odm_PathDivChkAntSwitch(pDM_Odm); -#endif -#else - PlatformScheduleWorkItem(&pDM_Odm->PathDivSwitchWorkitem); -#endif - -//odm_SwAntDivChkAntSwitch(Adapter, SWAW_STEP_DETERMINE); - -} - - -VOID -odm_PathDivChkAntSwitchWorkitemCallback( - IN PVOID pContext - ) -{ - PADAPTER pAdapter = (PADAPTER)pContext; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); - PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; - - odm_PathDivChkAntSwitch(pDM_Odm); -} - - - //MAC0_ACCESS_PHY1 - -// 2011-06-22 Neil Chen & Gary Hsin -// Refer to Jr.Luke's SW ANT DIV -// 92D Path Diversity Main function -// refer to 88C software antenna diversity -// -VOID -odm_PathDivChkAntSwitch( - PDM_ODM_T pDM_Odm - //PADAPTER Adapter, - //u1Byte Step -) -{ - PADAPTER Adapter = pDM_Odm->Adapter; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - PMGNT_INFO pMgntInfo = &Adapter->MgntInfo; - - - pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; - s4Byte curRSSI=100, RSSI_A, RSSI_B; - u1Byte nextAntenna=AUX_ANT; - static u8Byte lastTxOkCnt=0, lastRxOkCnt=0; - u8Byte curTxOkCnt, curRxOkCnt; - static u8Byte TXByteCnt_A=0, TXByteCnt_B=0, RXByteCnt_A=0, RXByteCnt_B=0; - u8Byte CurByteCnt=0, PreByteCnt=0; - static u1Byte TrafficLoad = TRAFFIC_LOW; - u1Byte Score_A=0, Score_B=0; - u1Byte i=0x0; - // Neil Chen - static u1Byte pathdiv_para=0x0; - static u1Byte switchfirsttime=0x00; - // u1Byte regB33 = (u1Byte) PHY_QueryBBReg(Adapter, 0xB30,BIT27); - u1Byte regB33 = (u1Byte)ODM_GetBBReg(pDM_Odm, PATHDIV_REG, BIT27); - - - //u1Byte reg637 =0x0; - static u1Byte fw_value=0x0; - //u8Byte curTxOkCnt_tmp, curRxOkCnt_tmp; - PADAPTER BuddyAdapter = Adapter->BuddyAdapter; // another adapter MAC - // Path Diversity //Neil Chen--2011--06--22 - - //u1Byte PathDiv_Trigger = (u1Byte) PHY_QueryBBReg(Adapter, 0xBA0,BIT31); - u1Byte PathDiv_Trigger = (u1Byte) ODM_GetBBReg(pDM_Odm, PATHDIV_TRI,BIT31); - u1Byte PathDiv_Enable = pHalData->bPathDiv_Enable; - - - //DbgPrint("Path Div PG Value:%x \n",PathDiv_Enable); - if((BuddyAdapter==NULL)||(!PathDiv_Enable)||(PathDiv_Trigger)||(pHalData->CurrentBandType == BAND_ON_2_4G)) - { - return; - } - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD,("===================>odm_PathDivChkAntSwitch()\n")); - - // The first time to switch path excluding 2nd, 3rd, ....etc.... - if(switchfirsttime==0) - { - if(regB33==0) - { - pDM_SWAT_Table->CurAntenna = MAIN_ANT; // Default MAC0_5G-->Path A (current antenna) - } - } - - // Condition that does not need to use antenna diversity. - if(pDM_Odm->SupportICType != ODM_RTL8192D) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("odm_PathDiversityMechanims(): No PathDiv Mechanism.\n")); - return; - } - - // Radio off: Status reset to default and return. - if(pHalData->eRFPowerState==eRfOff) - { - //ODM_SwAntDivRestAfterLink(Adapter); - return; - } - - /* - // Handling step mismatch condition. - // Peak step is not finished at last time. Recover the variable and check again. - if( Step != pDM_SWAT_Table->try_flag ) - { - ODM_SwAntDivRestAfterLink(Adapter); - } */ - - if(pDM_SWAT_Table->try_flag == 0xff) - { - // Select RSSI checking target - if(pMgntInfo->mAssoc && !ACTING_AS_AP(Adapter)) - { - // Target: Infrastructure mode AP. - pHalData->RSSI_target = NULL; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("odm_PathDivMechanism(): RSSI_target is DEF AP!\n")); - } - else - { - u1Byte index = 0; - PRT_WLAN_STA pEntry = NULL; - PADAPTER pTargetAdapter = NULL; - - if( pMgntInfo->mIbss || ACTING_AS_AP(Adapter) ) - { - // Target: AP/IBSS peer. - pTargetAdapter = Adapter; - } - else if(IsAPModeExist(Adapter) && GetFirstExtAdapter(Adapter) != NULL) - { - // Target: VWIFI peer. - pTargetAdapter = GetFirstExtAdapter(Adapter); - } - - if(pTargetAdapter != NULL) - { - for(index=0; indexbAssociated) - break; - } - } - } - - if(pEntry == NULL) - { - ODM_PathDivRestAfterLink(pDM_Odm); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("odm_SwAntDivChkAntSwitch(): No Link.\n")); - return; - } - else - { - pHalData->RSSI_target = pEntry; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("odm_SwAntDivChkAntSwitch(): RSSI_target is PEER STA\n")); - } - } - - pHalData->RSSI_cnt_A = 0; - pHalData->RSSI_cnt_B = 0; - pDM_SWAT_Table->try_flag = 0; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("odm_SwAntDivChkAntSwitch(): Set try_flag to 0 prepare for peak!\n")); - return; - } - else - { - // 1st step - curTxOkCnt = Adapter->TxStats.NumTxBytesUnicast - lastTxOkCnt; - curRxOkCnt = Adapter->RxStats.NumRxBytesUnicast - lastRxOkCnt; - lastTxOkCnt = Adapter->TxStats.NumTxBytesUnicast; - lastRxOkCnt = Adapter->RxStats.NumRxBytesUnicast; - - if(pDM_SWAT_Table->try_flag == 1) // Training State - { - if(pDM_SWAT_Table->CurAntenna == MAIN_ANT) - { - TXByteCnt_A += curTxOkCnt; - RXByteCnt_A += curRxOkCnt; - } - else - { - TXByteCnt_B += curTxOkCnt; - RXByteCnt_B += curRxOkCnt; - } - - nextAntenna = (pDM_SWAT_Table->CurAntenna == MAIN_ANT)? AUX_ANT : MAIN_ANT; - pDM_SWAT_Table->RSSI_Trying--; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH DIV=: RSSI_Trying = %d\n",pDM_SWAT_Table->RSSI_Trying)); - if(pDM_SWAT_Table->RSSI_Trying == 0) - { - CurByteCnt = (pDM_SWAT_Table->CurAntenna == MAIN_ANT)? (TXByteCnt_A+RXByteCnt_A) : (TXByteCnt_B+RXByteCnt_B); - PreByteCnt = (pDM_SWAT_Table->CurAntenna == MAIN_ANT)? (TXByteCnt_B+RXByteCnt_B) : (TXByteCnt_A+RXByteCnt_A); - - if(TrafficLoad == TRAFFIC_HIGH) - { - //CurByteCnt = PlatformDivision64(CurByteCnt, 9); - PreByteCnt =PreByteCnt*9; - } - else if(TrafficLoad == TRAFFIC_LOW) - { - //CurByteCnt = PlatformDivision64(CurByteCnt, 2); - PreByteCnt =PreByteCnt*2; - } - if(pHalData->RSSI_cnt_A > 0) - RSSI_A = pHalData->RSSI_sum_A/pHalData->RSSI_cnt_A; - else - RSSI_A = 0; - if(pHalData->RSSI_cnt_B > 0) - RSSI_B = pHalData->RSSI_sum_B/pHalData->RSSI_cnt_B; - else - RSSI_B = 0; - curRSSI = (pDM_SWAT_Table->CurAntenna == MAIN_ANT)? RSSI_A : RSSI_B; - pDM_SWAT_Table->PreRSSI = (pDM_SWAT_Table->CurAntenna == MAIN_ANT)? RSSI_B : RSSI_A; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH DIV=: PreRSSI = %d, CurRSSI = %d\n",pDM_SWAT_Table->PreRSSI, curRSSI)); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH DIV=: preAntenna= %s, curAntenna= %s \n", - (pDM_SWAT_Table->PreAntenna == MAIN_ANT?"MAIN":"AUX"), (pDM_SWAT_Table->CurAntenna == MAIN_ANT?"MAIN":"AUX"))); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH DIV=: RSSI_A= %d, RSSI_cnt_A = %d, RSSI_B= %d, RSSI_cnt_B = %d\n", - RSSI_A, pHalData->RSSI_cnt_A, RSSI_B, pHalData->RSSI_cnt_B)); - } - - } - else // try_flag=0 - { - - if(pHalData->RSSI_cnt_A > 0) - RSSI_A = pHalData->RSSI_sum_A/pHalData->RSSI_cnt_A; - else - RSSI_A = 0; - if(pHalData->RSSI_cnt_B > 0) - RSSI_B = pHalData->RSSI_sum_B/pHalData->RSSI_cnt_B; - else - RSSI_B = 0; - curRSSI = (pDM_SWAT_Table->CurAntenna == MAIN_ANT)? RSSI_A : RSSI_B; - pDM_SWAT_Table->PreRSSI = (pDM_SWAT_Table->PreAntenna == MAIN_ANT)? RSSI_A : RSSI_B; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH DIV=: PreRSSI = %d, CurRSSI = %d\n", pDM_SWAT_Table->PreRSSI, curRSSI)); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH DIV=: preAntenna= %s, curAntenna= %s \n", - (pDM_SWAT_Table->PreAntenna == MAIN_ANT?"MAIN":"AUX"), (pDM_SWAT_Table->CurAntenna == MAIN_ANT?"MAIN":"AUX"))); - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH DIV=: RSSI_A= %d, RSSI_cnt_A = %d, RSSI_B= %d, RSSI_cnt_B = %d\n", - RSSI_A, pHalData->RSSI_cnt_A, RSSI_B, pHalData->RSSI_cnt_B)); - //RT_TRACE(COMP_SWAS, DBG_LOUD, ("Ekul:curTxOkCnt = %d\n", curTxOkCnt)); - //RT_TRACE(COMP_SWAS, DBG_LOUD, ("Ekul:curRxOkCnt = %d\n", curRxOkCnt)); - } - - //1 Trying State - if((pDM_SWAT_Table->try_flag == 1)&&(pDM_SWAT_Table->RSSI_Trying == 0)) - { - - if(pDM_SWAT_Table->TestMode == TP_MODE) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH=: TestMode = TP_MODE")); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH= TRY:CurByteCnt = %"i64fmt"d,", CurByteCnt)); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH= TRY:PreByteCnt = %"i64fmt"d\n",PreByteCnt)); - if(CurByteCnt < PreByteCnt) - { - if(pDM_SWAT_Table->CurAntenna == MAIN_ANT) - pDM_SWAT_Table->SelectAntennaMap=pDM_SWAT_Table->SelectAntennaMap<<1; - else - pDM_SWAT_Table->SelectAntennaMap=(pDM_SWAT_Table->SelectAntennaMap<<1)+1; - } - else - { - if(pDM_SWAT_Table->CurAntenna == MAIN_ANT) - pDM_SWAT_Table->SelectAntennaMap=(pDM_SWAT_Table->SelectAntennaMap<<1)+1; - else - pDM_SWAT_Table->SelectAntennaMap=pDM_SWAT_Table->SelectAntennaMap<<1; - } - for (i= 0; i<8; i++) - { - if(((pDM_SWAT_Table->SelectAntennaMap>>i)&BIT0) == 1) - Score_A++; - else - Score_B++; - } - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("SelectAntennaMap=%x\n ",pDM_SWAT_Table->SelectAntennaMap)); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH=: Score_A=%d, Score_B=%d\n", Score_A, Score_B)); - - if(pDM_SWAT_Table->CurAntenna == MAIN_ANT) - { - nextAntenna = (Score_A >= Score_B)?MAIN_ANT:AUX_ANT; - } - else - { - nextAntenna = (Score_B >= Score_A)?AUX_ANT:MAIN_ANT; - } - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH=: nextAntenna=%s\n",(nextAntenna==MAIN_ANT)?"MAIN":"AUX")); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH=: preAntenna= %s, curAntenna= %s \n", - (pDM_SWAT_Table->PreAntenna == MAIN_ANT?"MAIN":"AUX"), (pDM_SWAT_Table->CurAntenna == MAIN_ANT?"MAIN":"AUX"))); - - if(nextAntenna != pDM_SWAT_Table->CurAntenna) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH=: Switch back to another antenna")); - } - else - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH=: current anntena is good\n")); - } - } - - - if(pDM_SWAT_Table->TestMode == RSSI_MODE) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH=: TestMode = RSSI_MODE")); - pDM_SWAT_Table->SelectAntennaMap=0xAA; - if(curRSSI < pDM_SWAT_Table->PreRSSI) //Current antenna is worse than previous antenna - { - //RT_TRACE(COMP_SWAS, DBG_LOUD, ("SWAS: Switch back to another antenna")); - nextAntenna = (pDM_SWAT_Table->CurAntenna == MAIN_ANT)?AUX_ANT : MAIN_ANT; - } - else // current anntena is good - { - nextAntenna =pDM_SWAT_Table->CurAntenna; - //RT_TRACE(COMP_SWAS, DBG_LOUD, ("SWAS: current anntena is good\n")); - } - } - - pDM_SWAT_Table->try_flag = 0; - pHalData->RSSI_test = FALSE; - pHalData->RSSI_sum_A = 0; - pHalData->RSSI_cnt_A = 0; - pHalData->RSSI_sum_B = 0; - pHalData->RSSI_cnt_B = 0; - TXByteCnt_A = 0; - TXByteCnt_B = 0; - RXByteCnt_A = 0; - RXByteCnt_B = 0; - - } - - //1 Normal State - else if(pDM_SWAT_Table->try_flag == 0) - { - if(TrafficLoad == TRAFFIC_HIGH) - { - if ((curTxOkCnt+curRxOkCnt) > 3750000)//if(PlatformDivision64(curTxOkCnt+curRxOkCnt, 2) > 1875000) - TrafficLoad = TRAFFIC_HIGH; - else - TrafficLoad = TRAFFIC_LOW; - } - else if(TrafficLoad == TRAFFIC_LOW) - { - if ((curTxOkCnt+curRxOkCnt) > 3750000)//if(PlatformDivision64(curTxOkCnt+curRxOkCnt, 2) > 1875000) - TrafficLoad = TRAFFIC_HIGH; - else - TrafficLoad = TRAFFIC_LOW; - } - if(TrafficLoad == TRAFFIC_HIGH) - pDM_SWAT_Table->bTriggerAntennaSwitch = 0; - //RT_TRACE(COMP_SWAS, DBG_LOUD, ("Normal:TrafficLoad = %llu\n", curTxOkCnt+curRxOkCnt)); - - //Prepare To Try Antenna - nextAntenna = (pDM_SWAT_Table->CurAntenna == MAIN_ANT)? AUX_ANT : MAIN_ANT; - pDM_SWAT_Table->try_flag = 1; - pHalData->RSSI_test = TRUE; - if((curRxOkCnt+curTxOkCnt) > 1000) - { -#if DEV_BUS_TYPE==RT_PCI_INTERFACE - pDM_SWAT_Table->RSSI_Trying = 4; -#else - pDM_SWAT_Table->RSSI_Trying = 2; -#endif - pDM_SWAT_Table->TestMode = TP_MODE; - } - else - { - pDM_SWAT_Table->RSSI_Trying = 2; - pDM_SWAT_Table->TestMode = RSSI_MODE; - - } - - //RT_TRACE(COMP_SWAS, DBG_LOUD, ("SWAS: Normal State -> Begin Trying!\n")); - pHalData->RSSI_sum_A = 0; - pHalData->RSSI_cnt_A = 0; - pHalData->RSSI_sum_B = 0; - pHalData->RSSI_cnt_B = 0; - } // end of try_flag=0 - } - - //1 4.Change TRX antenna - if(nextAntenna != pDM_SWAT_Table->CurAntenna) - { - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH=: Change TX Antenna!\n ")); - //PHY_SetBBReg(Adapter, rFPGA0_XA_RFInterfaceOE, 0x300, nextAntenna); for 88C - if(nextAntenna==MAIN_ANT) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH=: Next Antenna is RF PATH A\n ")); - pathdiv_para = 0x02; //02 to switchback to RF path A - fw_value = 0x03; -#if DEV_BUS_TYPE==RT_PCI_INTERFACE - odm_PathDiversity_8192D(pDM_Odm, pathdiv_para); -#else - ODM_FillH2CCmd(Adapter, ODM_H2C_PathDiv,1,(pu1Byte)(&fw_value)); -#endif - } - else if(nextAntenna==AUX_ANT) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH=: Next Antenna is RF PATH B\n ")); - if(switchfirsttime==0) // First Time To Enter Path Diversity - { - switchfirsttime=0x01; - pathdiv_para = 0x00; - fw_value=0x00; // to backup RF Path A Releated Registers - -#if DEV_BUS_TYPE==RT_PCI_INTERFACE - odm_PathDiversity_8192D(pDM_Odm, pathdiv_para); -#else - ODM_FillH2CCmd(Adapter, ODM_H2C_PathDiv,1,(pu1Byte)(&fw_value)); - //for(u1Byte n=0; n<80,n++) - //{ - //delay_us(500); - ODM_delay_ms(500); - odm_PathDiversity_8192D(pDM_Odm, pathdiv_para); - - fw_value=0x01; // to backup RF Path A Releated Registers - ODM_FillH2CCmd(Adapter, ODM_H2C_PathDiv,1,(pu1Byte)(&fw_value)); -#endif - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH=: FIRST TIME To DO PATH SWITCH!\n ")); - } - else - { - pathdiv_para = 0x01; - fw_value = 0x02; -#if DEV_BUS_TYPE==RT_PCI_INTERFACE - odm_PathDiversity_8192D(pDM_Odm, pathdiv_para); -#else - ODM_FillH2CCmd(Adapter, ODM_H2C_PathDiv,1,(pu1Byte)(&fw_value)); -#endif - } - } - // odm_PathDiversity_8192D(Adapter, pathdiv_para); - } - - //1 5.Reset Statistics - pDM_SWAT_Table->PreAntenna = pDM_SWAT_Table->CurAntenna; - pDM_SWAT_Table->CurAntenna = nextAntenna; - pDM_SWAT_Table->PreRSSI = curRSSI; - - //1 6.Set next timer - - if(pDM_SWAT_Table->RSSI_Trying == 0) - return; - - if(pDM_SWAT_Table->RSSI_Trying%2 == 0) - { - if(pDM_SWAT_Table->TestMode == TP_MODE) - { - if(TrafficLoad == TRAFFIC_HIGH) - { -#if DEV_BUS_TYPE==RT_PCI_INTERFACE - ODM_SetTimer( pDM_Odm, &pDM_Odm->PathDivSwitchTimer, 10 ); //ms - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH=: Test another antenna for 10 ms\n")); -#else - ODM_SetTimer( pDM_Odm, &pDM_Odm->PathDivSwitchTimer, 20 ); //ms - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH=: Test another antenna for 20 ms\n")); -#endif - } - else if(TrafficLoad == TRAFFIC_LOW) - { - ODM_SetTimer( pDM_Odm, &pDM_Odm->PathDivSwitchTimer, 50 ); //ms - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH=: Test another antenna for 50 ms\n")); - } - } - else // TestMode == RSSI_MODE - { - ODM_SetTimer( pDM_Odm, &pDM_Odm->PathDivSwitchTimer, 500 ); //ms - ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH=: Test another antenna for 500 ms\n")); - } - } - else - { - if(pDM_SWAT_Table->TestMode == TP_MODE) - { - if(TrafficLoad == TRAFFIC_HIGH) - -#if DEV_BUS_TYPE==RT_PCI_INTERFACE - ODM_SetTimer( pDM_Odm, &pDM_Odm->PathDivSwitchTimer, 90 ); //ms - //ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH=: Test another antenna for 90 ms\n")); -#else - ODM_SetTimer( pDM_Odm, &pDM_Odm->PathDivSwitchTimer, 180); //ms -#endif - else if(TrafficLoad == TRAFFIC_LOW) - ODM_SetTimer( pDM_Odm, &pDM_Odm->PathDivSwitchTimer, 100 ); //ms - } - else - ODM_SetTimer( pDM_Odm, &pDM_Odm->PathDivSwitchTimer, 500 ); //ms - } -} - -//================================================== -//3 PathDiv End -//================================================== - -VOID -odm_SetRespPath_92C( - IN PADAPTER Adapter, - IN u1Byte DefaultRespPath - ) -{ - pPD_T pDM_PDTable = &Adapter->DM_PDTable; - - RT_TRACE( COMP_SWAS, DBG_LOUD, ("odm_SetRespPath_92C: Select Response Path=%d\n",DefaultRespPath)); - if(DefaultRespPath != pDM_PDTable->DefaultRespPath) - { - if(DefaultRespPath == 0) - { - PlatformEFIOWrite1Byte(Adapter, 0x6D8, (PlatformEFIORead1Byte(Adapter, 0x6D8)&0xc0)|0x15); - } - else - { - PlatformEFIOWrite1Byte(Adapter, 0x6D8, (PlatformEFIORead1Byte(Adapter, 0x6D8)&0xc0)|0x2A); - } - } - pDM_PDTable->DefaultRespPath = DefaultRespPath; -} - - -VOID -ODM_FillTXPathInTXDESC( - IN PADAPTER Adapter, - IN PRT_TCB pTcb, - IN pu1Byte pDesc -) -{ - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - u4Byte TXPath; - pPD_T pDM_PDTable = &Adapter->DM_PDTable; - - //2011.09.05 Add by Luke Lee for path diversity - if(pHalData->PathDivCfg == 1) - { - TXPath = (pDM_PDTable->OFDMTXPath >> pTcb->macId) & BIT0; - //RT_TRACE( COMP_SWAS, DBG_LOUD, ("Fill TXDESC: macID=%d, TXPath=%d\n", pTcb->macId, TXPath)); - //SET_TX_DESC_TX_ANT_CCK(pDesc,TXPath); - if(TXPath == 0) - { - SET_TX_DESC_TX_ANTL_92C(pDesc,1); - SET_TX_DESC_TX_ANT_HT_92C(pDesc,1); - } - else - { - SET_TX_DESC_TX_ANTL_92C(pDesc,2); - SET_TX_DESC_TX_ANT_HT_92C(pDesc,2); - } - TXPath = (pDM_PDTable->CCKTXPath >> pTcb->macId) & BIT0; - if(TXPath == 0) - { - SET_TX_DESC_TX_ANT_CCK_92C(pDesc,1); - } - else - { - SET_TX_DESC_TX_ANT_CCK_92C(pDesc,2); - } - } -} - -//Only for MP //Neil Chen--2012--0502-- -VOID -odm_PathDivInit_92D( -IN PDM_ODM_T pDM_Odm) -{ - pPATHDIV_PARA pathIQK = &pDM_Odm->pathIQK; - - pathIQK->org_2g_RegC14=0x0; - pathIQK->org_2g_RegC4C=0x0; - pathIQK->org_2g_RegC80=0x0; - pathIQK->org_2g_RegC94=0x0; - pathIQK->org_2g_RegCA0=0x0; - pathIQK->org_5g_RegC14=0x0; - pathIQK->org_5g_RegCA0=0x0; - pathIQK->org_5g_RegE30=0x0; - pathIQK->swt_2g_RegC14=0x0; - pathIQK->swt_2g_RegC4C=0x0; - pathIQK->swt_2g_RegC80=0x0; - pathIQK->swt_2g_RegC94=0x0; - pathIQK->swt_2g_RegCA0=0x0; - pathIQK->swt_5g_RegC14=0x0; - pathIQK->swt_5g_RegCA0=0x0; - pathIQK->swt_5g_RegE30=0x0; - -} - -#endif // #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN| ODM_CE)) - -VOID -odm_PHY_SaveAFERegisters( - IN PDM_ODM_T pDM_Odm, - IN pu4Byte AFEReg, - IN pu4Byte AFEBackup, - IN u4Byte RegisterNum - ) -{ - u4Byte i; - - //RT_DISP(FINIT, INIT_IQK, ("Save ADDA parameters.\n")); - for( i = 0 ; i < RegisterNum ; i++){ - AFEBackup[i] = ODM_GetBBReg(pDM_Odm, AFEReg[i], bMaskDWord); - } -} - -VOID -odm_PHY_ReloadAFERegisters( - IN PDM_ODM_T pDM_Odm, - IN pu4Byte AFEReg, - IN pu4Byte AFEBackup, - IN u4Byte RegiesterNum - ) -{ - u4Byte i; - - //RT_DISP(FINIT, INIT_IQK, ("Reload ADDA power saving parameters !\n")); - for(i = 0 ; i < RegiesterNum; i++) - { - - ODM_SetBBReg(pDM_Odm, AFEReg[i], bMaskDWord, AFEBackup[i]); - } -} - -// -// Description: -// Set Single/Dual Antenna default setting for products that do not do detection in advance. -// -// Added by Joseph, 2012.03.22 -// -VOID -ODM_SingleDualAntennaDefaultSetting( - IN PDM_ODM_T pDM_Odm - ) -{ - pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; - PADAPTER pAdapter = pDM_Odm->Adapter; - u1Byte btAntNum = 2; -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN)) - btAntNum=BT_GetPgAntNum(pAdapter); -#elif (DM_ODM_SUPPORT_TYPE & (ODM_CE)) -#ifdef CONFIG_BT_COEXIST - btAntNum = hal_btcoex_GetPgAntNum(pAdapter); -#endif -#endif - - // Set default antenna A and B status - if(btAntNum == 2) - { - pDM_SWAT_Table->ANTA_ON=TRUE; - pDM_SWAT_Table->ANTB_ON=TRUE; - //RT_TRACE(COMP_ANTENNA, DBG_LOUD, ("Dual antenna\n")); - } - else if(btAntNum == 1) - {// Set antenna A as default - pDM_SWAT_Table->ANTA_ON=TRUE; - pDM_SWAT_Table->ANTB_ON=FALSE; - //RT_TRACE(COMP_ANTENNA, DBG_LOUD, ("Single antenna\n")); - } - else - { - //RT_ASSERT(FALSE, ("Incorrect antenna number!!\n")); - } -} - - - -//2 8723A ANT DETECT -// -// Description: -// Implement IQK single tone for RF DPK loopback and BB PSD scanning. -// This function is cooperated with BB team Neil. -// -// Added by Roger, 2011.12.15 -// -BOOLEAN -ODM_SingleDualAntennaDetection( - IN PDM_ODM_T pDM_Odm, - IN u1Byte mode - ) -{ - PADAPTER pAdapter = pDM_Odm->Adapter; - pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; - u4Byte CurrentChannel,RfLoopReg; - u1Byte n; - u4Byte Reg88c, Regc08, Reg874, Regc50, Reg948=0, Regb2c=0, Reg92c=0, AFE_rRx_Wait_CCA=0; - u1Byte initial_gain = 0x5a; - u4Byte PSD_report_tmp; - u4Byte AntA_report = 0x0, AntB_report = 0x0,AntO_report=0x0; - BOOLEAN bResult = TRUE; - u4Byte AFE_Backup[16]; - u4Byte AFE_REG_8723A[16] = { - rRx_Wait_CCA, rTx_CCK_RFON, - rTx_CCK_BBON, rTx_OFDM_RFON, - rTx_OFDM_BBON, rTx_To_Rx, - rTx_To_Tx, rRx_CCK, - rRx_OFDM, rRx_Wait_RIFS, - rRx_TO_Rx, rStandby, - rSleep, rPMPD_ANAEN, - rFPGA0_XCD_SwitchControl, rBlue_Tooth}; - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SingleDualAntennaDetection()============> \n")); - - - if(!(pDM_Odm->SupportICType & (ODM_RTL8723A|ODM_RTL8192C|ODM_RTL8723B))) - return bResult; - - // Retrieve antenna detection registry info, added by Roger, 2012.11.27. - if(!IS_ANT_DETECT_SUPPORT_SINGLE_TONE(pAdapter)) - return bResult; - - if(pDM_Odm->SupportICType == ODM_RTL8192C) - { - //Which path in ADC/DAC is turnned on for PSD: both I/Q - ODM_SetBBReg(pDM_Odm, 0x808, BIT10|BIT11, 0x3); - //Ageraged number: 8 - ODM_SetBBReg(pDM_Odm, 0x808, BIT12|BIT13, 0x1); - //pts = 128; - ODM_SetBBReg(pDM_Odm, 0x808, BIT14|BIT15, 0x0); - } - - //1 Backup Current RF/BB Settings - - CurrentChannel = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_A, ODM_CHANNEL, bRFRegOffsetMask); - RfLoopReg = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x00, bRFRegOffsetMask); - if(!(pDM_Odm->SupportICType == ODM_RTL8723B)) - ODM_SetBBReg(pDM_Odm, rFPGA0_XA_RFInterfaceOE, ODM_DPDT, Antenna_A); // change to Antenna A -#if (RTL8723B_SUPPORT == 1) - else - { - Reg92c = ODM_GetBBReg(pDM_Odm, 0x92c, bMaskDWord); - Reg948 = ODM_GetBBReg(pDM_Odm, rS0S1_PathSwitch, bMaskDWord); - Regb2c = ODM_GetBBReg(pDM_Odm, AGC_table_select, bMaskDWord); - ODM_SetBBReg(pDM_Odm, rDPDT_control, 0x3, 0x1); - ODM_SetBBReg(pDM_Odm, rfe_ctrl_anta_src, 0xff, 0x77); - ODM_SetBBReg(pDM_Odm, rS0S1_PathSwitch, 0x3ff, 0x000); - ODM_SetBBReg(pDM_Odm, AGC_table_select, BIT31, 0x0); - } -#endif - ODM_StallExecution(10); - - //Store A Path Register 88c, c08, 874, c50 - Reg88c = ODM_GetBBReg(pDM_Odm, rFPGA0_AnalogParameter4, bMaskDWord); - Regc08 = ODM_GetBBReg(pDM_Odm, rOFDM0_TRMuxPar, bMaskDWord); - Reg874 = ODM_GetBBReg(pDM_Odm, rFPGA0_XCD_RFInterfaceSW, bMaskDWord); - Regc50 = ODM_GetBBReg(pDM_Odm, rOFDM0_XAAGCCore1, bMaskDWord); - - // Store AFE Registers - if(pDM_Odm->SupportICType & (ODM_RTL8723A|ODM_RTL8192C)) - odm_PHY_SaveAFERegisters(pDM_Odm, AFE_REG_8723A, AFE_Backup, 16); - else if(pDM_Odm->SupportICType == ODM_RTL8723B) - AFE_rRx_Wait_CCA = ODM_GetBBReg(pDM_Odm, rRx_Wait_CCA,bMaskDWord); - - //Set PSD 128 pts - ODM_SetBBReg(pDM_Odm, rFPGA0_PSDFunction, BIT14|BIT15, 0x0); //128 pts - - // To SET CH1 to do - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, ODM_CHANNEL, bRFRegOffsetMask, 0x7401); //Channel 1 - - // AFE all on step - if(pDM_Odm->SupportICType & (ODM_RTL8723A|ODM_RTL8192C)) - { - ODM_SetBBReg(pDM_Odm, rRx_Wait_CCA, bMaskDWord, 0x6FDB25A4); - ODM_SetBBReg(pDM_Odm, rTx_CCK_RFON, bMaskDWord, 0x6FDB25A4); - ODM_SetBBReg(pDM_Odm, rTx_CCK_BBON, bMaskDWord, 0x6FDB25A4); - ODM_SetBBReg(pDM_Odm, rTx_OFDM_RFON, bMaskDWord, 0x6FDB25A4); - ODM_SetBBReg(pDM_Odm, rTx_OFDM_BBON, bMaskDWord, 0x6FDB25A4); - ODM_SetBBReg(pDM_Odm, rTx_To_Rx, bMaskDWord, 0x6FDB25A4); - ODM_SetBBReg(pDM_Odm, rTx_To_Tx, bMaskDWord, 0x6FDB25A4); - ODM_SetBBReg(pDM_Odm, rRx_CCK, bMaskDWord, 0x6FDB25A4); - ODM_SetBBReg(pDM_Odm, rRx_OFDM, bMaskDWord, 0x6FDB25A4); - ODM_SetBBReg(pDM_Odm, rRx_Wait_RIFS, bMaskDWord, 0x6FDB25A4); - ODM_SetBBReg(pDM_Odm, rRx_TO_Rx, bMaskDWord, 0x6FDB25A4); - ODM_SetBBReg(pDM_Odm, rStandby, bMaskDWord, 0x6FDB25A4); - ODM_SetBBReg(pDM_Odm, rSleep, bMaskDWord, 0x6FDB25A4); - ODM_SetBBReg(pDM_Odm, rPMPD_ANAEN, bMaskDWord, 0x6FDB25A4); - ODM_SetBBReg(pDM_Odm, rFPGA0_XCD_SwitchControl, bMaskDWord, 0x6FDB25A4); - ODM_SetBBReg(pDM_Odm, rBlue_Tooth, bMaskDWord, 0x6FDB25A4); - } - else if(pDM_Odm->SupportICType == ODM_RTL8723B) - { - ODM_SetBBReg(pDM_Odm, rRx_Wait_CCA, bMaskDWord, 0x01c00016); - } - - // 3 wire Disable - ODM_SetBBReg(pDM_Odm, rFPGA0_AnalogParameter4, bMaskDWord, 0xCCF000C0); - - //BB IQK Setting - ODM_SetBBReg(pDM_Odm, rOFDM0_TRMuxPar, bMaskDWord, 0x000800E4); - ODM_SetBBReg(pDM_Odm, rFPGA0_XCD_RFInterfaceSW, bMaskDWord, 0x22208000); - - //IQK setting tone@ 4.34Mhz - ODM_SetBBReg(pDM_Odm, rTx_IQK_Tone_A, bMaskDWord, 0x10008C1C); - ODM_SetBBReg(pDM_Odm, rTx_IQK, bMaskDWord, 0x01007c00); - - //Page B init - ODM_SetBBReg(pDM_Odm, rConfig_AntA, bMaskDWord, 0x00080000); - ODM_SetBBReg(pDM_Odm, rConfig_AntA, bMaskDWord, 0x0f600000); - ODM_SetBBReg(pDM_Odm, rRx_IQK, bMaskDWord, 0x01004800); - ODM_SetBBReg(pDM_Odm, rRx_IQK_Tone_A, bMaskDWord, 0x10008c1f); - ODM_SetBBReg(pDM_Odm, rTx_IQK_PI_A, bMaskDWord, 0x82150008); - ODM_SetBBReg(pDM_Odm, rRx_IQK_PI_A, bMaskDWord, 0x28150008); - ODM_SetBBReg(pDM_Odm, rIQK_AGC_Rsp, bMaskDWord, 0x001028d0); - - //RF loop Setting - if(pDM_Odm->SupportICType & (ODM_RTL8723A|ODM_RTL8192C)) - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x0, 0xFFFFF, 0x50008); - - //IQK Single tone start - ODM_SetBBReg(pDM_Odm, rFPGA0_IQK, bMaskDWord, 0x80800000); - ODM_SetBBReg(pDM_Odm, rIQK_AGC_Pts, bMaskDWord, 0xf9000000); - ODM_SetBBReg(pDM_Odm, rIQK_AGC_Pts, bMaskDWord, 0xf8000000); - - ODM_StallExecution(10000); - - // PSD report of antenna A - PSD_report_tmp=0x0; - for (n=0;n<2;n++) - { - PSD_report_tmp = GetPSDData(pDM_Odm, 14, initial_gain); - if(PSD_report_tmp >AntA_report) - AntA_report=PSD_report_tmp; - } - - // change to Antenna B - if(pDM_Odm->SupportICType & (ODM_RTL8723A|ODM_RTL8192C)) - ODM_SetBBReg(pDM_Odm, rFPGA0_XA_RFInterfaceOE, ODM_DPDT, Antenna_B); -#if (RTL8723B_SUPPORT == 1) - else if(pDM_Odm->SupportICType == ODM_RTL8723B) - ODM_SetBBReg(pDM_Odm, rDPDT_control, 0x3, 0x2); -#endif - - ODM_StallExecution(10); - - // PSD report of antenna B - PSD_report_tmp=0x0; - for (n=0;n<2;n++) - { - PSD_report_tmp = GetPSDData(pDM_Odm, 14, initial_gain); - if(PSD_report_tmp > AntB_report) - AntB_report=PSD_report_tmp; - } - - // change to open case - if(pDM_Odm->SupportICType & (ODM_RTL8723A|ODM_RTL8192C)) - ODM_SetBBReg(pDM_Odm, rFPGA0_XA_RFInterfaceOE, ODM_DPDT, 0); // change to Antenna A -#if (RTL8723B_SUPPORT == 1) - else if(pDM_Odm->SupportICType == ODM_RTL8723B) - ODM_SetBBReg(pDM_Odm, rDPDT_control, 0x3, 0x0); -#endif - - ODM_StallExecution(10); - - // PSD report of open case - PSD_report_tmp=0x0; - for (n=0;n<2;n++) - { - PSD_report_tmp = GetPSDData(pDM_Odm, 14, initial_gain); - if(PSD_report_tmp > AntO_report) - AntO_report=PSD_report_tmp; - } - - //Close IQK Single Tone function - ODM_SetBBReg(pDM_Odm, rFPGA0_IQK, bMaskDWord, 0x00000000); - - //1 Return to antanna A - if(pDM_Odm->SupportICType & (ODM_RTL8723A|ODM_RTL8192C)) - ODM_SetBBReg(pDM_Odm, rFPGA0_XA_RFInterfaceOE, ODM_DPDT, Antenna_A); // change to Antenna A -#if (RTL8723B_SUPPORT == 1) - else if(pDM_Odm->SupportICType == ODM_RTL8723B) - { - // external DPDT - ODM_SetBBReg(pDM_Odm, rDPDT_control, bMaskDWord, Reg92c); - - //internal S0/S1 - ODM_SetBBReg(pDM_Odm, rS0S1_PathSwitch, bMaskDWord, Reg948); - ODM_SetBBReg(pDM_Odm, AGC_table_select, bMaskDWord, Regb2c); - } -#endif - ODM_SetBBReg(pDM_Odm, rFPGA0_AnalogParameter4, bMaskDWord, Reg88c); - ODM_SetBBReg(pDM_Odm, rOFDM0_TRMuxPar, bMaskDWord, Regc08); - ODM_SetBBReg(pDM_Odm, rFPGA0_XCD_RFInterfaceSW, bMaskDWord, Reg874); - ODM_SetBBReg(pDM_Odm, rOFDM0_XAAGCCore1, 0x7F, 0x40); - ODM_SetBBReg(pDM_Odm, rOFDM0_XAAGCCore1, bMaskDWord, Regc50); - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_CHNLBW, bRFRegOffsetMask,CurrentChannel); - ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x00, bRFRegOffsetMask,RfLoopReg); - - //Reload AFE Registers - if(pDM_Odm->SupportICType & (ODM_RTL8723A|ODM_RTL8192C)) - odm_PHY_ReloadAFERegisters(pDM_Odm, AFE_REG_8723A, AFE_Backup, 16); - else if(pDM_Odm->SupportICType == ODM_RTL8723B) - ODM_SetBBReg(pDM_Odm, rRx_Wait_CCA, bMaskDWord, AFE_rRx_Wait_CCA); - - if(pDM_Odm->SupportICType == ODM_RTL8723A) - { - //2 Test Ant B based on Ant A is ON - if(mode==ANTTESTB) - { - if(AntA_report >= 100) - { - if(AntB_report > (AntA_report+1)) - { - pDM_SWAT_Table->ANTB_ON=FALSE; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SingleDualAntennaDetection(): Single Antenna A\n")); - } - else - { - pDM_SWAT_Table->ANTB_ON=TRUE; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SingleDualAntennaDetection(): Dual Antenna is A and B\n")); - } - } - else - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SingleDualAntennaDetection(): Need to check again\n")); - pDM_SWAT_Table->ANTB_ON=FALSE; // Set Antenna B off as default - bResult = FALSE; - } - } - //2 Test Ant A and B based on DPDT Open - else if(mode==ANTTESTALL) - { - if((AntO_report >=100) && (AntO_report <=118)) - { - if(AntA_report > (AntO_report+1)) - { - pDM_SWAT_Table->ANTA_ON=FALSE; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("Ant A is OFF\n")); - } - else - { - pDM_SWAT_Table->ANTA_ON=TRUE; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("Ant A is ON\n")); - } - - if(AntB_report > (AntO_report+2)) - { - pDM_SWAT_Table->ANTB_ON=FALSE; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("Ant B is OFF\n")); - } - else - { - pDM_SWAT_Table->ANTB_ON=TRUE; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("Ant B is ON\n")); - } - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("psd_report_A[%d]= %d \n", 2416, AntA_report)); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("psd_report_B[%d]= %d \n", 2416, AntB_report)); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("psd_report_O[%d]= %d \n", 2416, AntO_report)); - - pDM_Odm->AntDetectedInfo.bAntDetected= TRUE; - pDM_Odm->AntDetectedInfo.dBForAntA = AntA_report; - pDM_Odm->AntDetectedInfo.dBForAntB = AntB_report; - pDM_Odm->AntDetectedInfo.dBForAntO = AntO_report; - - } - else - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("return FALSE!!\n")); - bResult = FALSE; - } - } - } - else if(pDM_Odm->SupportICType == ODM_RTL8192C) - { - if(AntA_report >= 100) - { - if(AntB_report > (AntA_report+2)) - { - pDM_SWAT_Table->ANTA_ON=FALSE; - pDM_SWAT_Table->ANTB_ON=TRUE; - ODM_SetBBReg(pDM_Odm, rFPGA0_XA_RFInterfaceOE, 0x300, Antenna_B); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SingleDualAntennaDetection(): Single Antenna B\n")); - } - else if(AntA_report > (AntB_report+2)) - { - pDM_SWAT_Table->ANTA_ON=TRUE; - pDM_SWAT_Table->ANTB_ON=FALSE; - ODM_SetBBReg(pDM_Odm, rFPGA0_XA_RFInterfaceOE, 0x300, Antenna_A); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SingleDualAntennaDetection(): Single Antenna A\n")); - } - else - { - pDM_SWAT_Table->ANTA_ON=TRUE; - pDM_SWAT_Table->ANTB_ON=TRUE; - RT_TRACE(COMP_ANTENNA, DBG_LOUD, ("ODM_SingleDualAntennaDetection(): Dual Antenna \n")); - } - } - else - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SingleDualAntennaDetection(): Need to check again\n")); - pDM_SWAT_Table->ANTA_ON=TRUE; // Set Antenna A on as default - pDM_SWAT_Table->ANTB_ON=FALSE; // Set Antenna B off as default - bResult = FALSE; - } - } - else if(pDM_Odm->SupportICType == ODM_RTL8723B) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("psd_report_A[%d]= %d \n", 2416, AntA_report)); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("psd_report_B[%d]= %d \n", 2416, AntB_report)); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("psd_report_O[%d]= %d \n", 2416, AntO_report)); - - //2 Test Ant B based on Ant A is ON - if(mode==ANTTESTB) - { - if(AntA_report >=100 && AntA_report <= 116) - { - if(AntB_report >= (AntA_report+4) && AntB_report > 116) - { - pDM_SWAT_Table->ANTB_ON=FALSE; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SingleDualAntennaDetection(): Single Antenna A\n")); - } - else if(AntB_report >=100 && AntB_report <= 116) - { - pDM_SWAT_Table->ANTB_ON=TRUE; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SingleDualAntennaDetection(): Dual Antenna is A and B\n")); - } - else - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SingleDualAntennaDetection(): Need to check again\n")); - pDM_SWAT_Table->ANTB_ON=FALSE; // Set Antenna B off as default - bResult = FALSE; - } - } - else - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SingleDualAntennaDetection(): Need to check again\n")); - pDM_SWAT_Table->ANTB_ON=FALSE; // Set Antenna B off as default - bResult = FALSE; - } - } - //2 Test Ant A and B based on DPDT Open - else if(mode==ANTTESTALL) - { - if((AntA_report >= 100) && (AntB_report >= 100) && (AntA_report <= 120) && (AntB_report <= 120)) - { - if((AntA_report - AntB_report < 2) || (AntB_report - AntA_report < 2)) - { - pDM_SWAT_Table->ANTA_ON=TRUE; - pDM_SWAT_Table->ANTB_ON=TRUE; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("ODM_SingleDualAntennaDetection(): Dual Antenna\n")); - } - else if(((AntA_report - AntB_report >= 2) && (AntA_report - AntB_report <= 4)) || - ((AntB_report - AntA_report >= 2) && (AntB_report - AntA_report <= 4))) - { - pDM_SWAT_Table->ANTA_ON=FALSE; - pDM_SWAT_Table->ANTB_ON=FALSE; - bResult = FALSE; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SingleDualAntennaDetection(): Need to check again\n")); - } - else - { - pDM_SWAT_Table->ANTA_ON = TRUE; - pDM_SWAT_Table->ANTB_ON=FALSE; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("ODM_SingleDualAntennaDetection(): Single Antenna A\n")); - } - - pDM_Odm->AntDetectedInfo.bAntDetected= TRUE; - pDM_Odm->AntDetectedInfo.dBForAntA = AntA_report; - pDM_Odm->AntDetectedInfo.dBForAntB = AntB_report; - pDM_Odm->AntDetectedInfo.dBForAntO = AntO_report; - - } - else - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("return FALSE!!\n")); - bResult = FALSE; - } - } - } - - return bResult; - -} - - -#endif // end odm_CE - -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN| ODM_CE)) - -VOID -odm_Set_RA_DM_ARFB_by_Noisy( - IN PDM_ODM_T pDM_Odm -) -{ - //DbgPrint("DM_ARFB ====> \n"); - if (pDM_Odm->bNoisyState){ - ODM_Write4Byte(pDM_Odm,0x430,0x00000000); - ODM_Write4Byte(pDM_Odm,0x434,0x05040200); - //DbgPrint("DM_ARFB ====> Noisy State\n"); - } - else{ - ODM_Write4Byte(pDM_Odm,0x430,0x02010000); - ODM_Write4Byte(pDM_Odm,0x434,0x07050403); - //DbgPrint("DM_ARFB ====> Clean State\n"); - } - -} - -VOID -ODM_UpdateNoisyState( - IN PDM_ODM_T pDM_Odm, - IN BOOLEAN bNoisyStateFromC2H - ) -{ - //DbgPrint("Get C2H Command! NoisyState=0x%x\n ", bNoisyStateFromC2H); - if(pDM_Odm->SupportICType == ODM_RTL8821 || pDM_Odm->SupportICType == ODM_RTL8812 || - pDM_Odm->SupportICType == ODM_RTL8723B || pDM_Odm->SupportICType == ODM_RTL8192E || pDM_Odm->SupportICType == ODM_RTL8188E) - { - pDM_Odm->bNoisyState = bNoisyStateFromC2H; - } - odm_Set_RA_DM_ARFB_by_Noisy(pDM_Odm); -}; - -u4Byte -Set_RA_DM_Ratrbitmap_by_Noisy( - IN PDM_ODM_T pDM_Odm, - IN WIRELESS_MODE WirelessMode, - IN u4Byte ratr_bitmap, - IN u1Byte rssi_level -) -{ - u4Byte ret_bitmap = ratr_bitmap; - switch (WirelessMode) - { - case WIRELESS_MODE_AC_24G : - case WIRELESS_MODE_AC_5G : - case WIRELESS_MODE_AC_ONLY: - if (pDM_Odm->bNoisyState){ // in Noisy State - if (rssi_level==1) - ret_bitmap&=0xfe3f0e08; - else if (rssi_level==2) - ret_bitmap&=0xff3f8f8c; - else if (rssi_level==3) - ret_bitmap&=0xffffffcc ; - else - ret_bitmap&=0xffffffff ; - } - else{ // in SNR State - if (rssi_level==1){ - ret_bitmap&=0xfc3e0c08; - } - else if (rssi_level==2){ - ret_bitmap&=0xfe3f0e08; - } - else if (rssi_level==3){ - ret_bitmap&=0xffbfefcc; - } - else{ - ret_bitmap&=0x0fffffff; - } - } - break; - case WIRELESS_MODE_B: - case WIRELESS_MODE_A: - case WIRELESS_MODE_G: - case WIRELESS_MODE_N_24G: - case WIRELESS_MODE_N_5G: - if (pDM_Odm->bNoisyState){ - if (rssi_level==1) - ret_bitmap&=0x0f0e0c08; - else if (rssi_level==2) - ret_bitmap&=0x0f8f0e0c; - else if (rssi_level==3) - ret_bitmap&=0x0fefefcc ; - else - ret_bitmap&=0xffffffff ; - } - else{ - if (rssi_level==1){ - ret_bitmap&=0x0f8f0e08; - } - else if (rssi_level==2){ - ret_bitmap&=0x0fcf8f8c; - } - else if (rssi_level==3){ - ret_bitmap&=0x0fffffcc; - } - else{ - ret_bitmap&=0x0fffffff; - } - } - break; - default: - break; - } - //DbgPrint("DM_RAMask ====> rssi_LV = %d, BITMAP = %x \n", rssi_level, ret_bitmap); - return ret_bitmap; - -} - - - -VOID -ODM_UpdateInitRate( - IN PDM_ODM_T pDM_Odm, - IN u1Byte Rate - ) -{ - u1Byte p = 0; - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,("Get C2H Command! Rate=0x%x\n", Rate)); - - if(pDM_Odm->SupportICType == ODM_RTL8821 || pDM_Odm->SupportICType == ODM_RTL8812 || - pDM_Odm->SupportICType == ODM_RTL8723B || pDM_Odm->SupportICType == ODM_RTL8192E || pDM_Odm->SupportICType == ODM_RTL8188E) - { - pDM_Odm->TxRate = Rate; -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - #if DEV_BUS_TYPE==RT_PCI_INTERFACE - #if USE_WORKITEM - PlatformScheduleWorkItem(&pDM_Odm->RaRptWorkitem); - #else - if(pDM_Odm->SupportICType == ODM_RTL8821) - { - ODM_TxPwrTrackSetPwr8821A(pDM_Odm, MIX_MODE, ODM_RF_PATH_A, 0); - } - else if(pDM_Odm->SupportICType == ODM_RTL8812) - { - for (p = ODM_RF_PATH_A; p < MAX_PATH_NUM_8812A; p++) - { - ODM_TxPwrTrackSetPwr8812A(pDM_Odm, MIX_MODE, p, 0); - } - } - else if(pDM_Odm->SupportICType == ODM_RTL8723B) - { - ODM_TxPwrTrackSetPwr_8723B(pDM_Odm, MIX_MODE, ODM_RF_PATH_A, 0); - } - else if(pDM_Odm->SupportICType == ODM_RTL8192E) - { - for (p = ODM_RF_PATH_A; p < MAX_PATH_NUM_8192E; p++) - { - ODM_TxPwrTrackSetPwr92E(pDM_Odm, MIX_MODE, p, 0); - } - } - else if(pDM_Odm->SupportICType == ODM_RTL8188E) - { - ODM_TxPwrTrackSetPwr88E(pDM_Odm, MIX_MODE, ODM_RF_PATH_A, 0); - } - #endif - #else - PlatformScheduleWorkItem(&pDM_Odm->RaRptWorkitem); - #endif -#endif - } - else - return; -} - -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) -VOID -ODM_UpdateInitRateWorkItemCallback( - IN PVOID pContext - ) -{ - PADAPTER Adapter = (PADAPTER)pContext; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; - - u1Byte p = 0; - - if(pDM_Odm->SupportICType == ODM_RTL8821) - { - ODM_TxPwrTrackSetPwr8821A(pDM_Odm, MIX_MODE, ODM_RF_PATH_A, 0); - } - else if(pDM_Odm->SupportICType == ODM_RTL8812) - { - for (p = ODM_RF_PATH_A; p < MAX_PATH_NUM_8812A; p++) //DOn't know how to include &c - { - ODM_TxPwrTrackSetPwr8812A(pDM_Odm, MIX_MODE, p, 0); - } - } - else if(pDM_Odm->SupportICType == ODM_RTL8723B) - { - ODM_TxPwrTrackSetPwr_8723B(pDM_Odm, MIX_MODE, ODM_RF_PATH_A, 0); - } - else if(pDM_Odm->SupportICType == ODM_RTL8192E) - { - for (p = ODM_RF_PATH_A; p < MAX_PATH_NUM_8192E; p++) //DOn't know how to include &c - { - ODM_TxPwrTrackSetPwr92E(pDM_Odm, MIX_MODE, p, 0); - } - } - else if(pDM_Odm->SupportICType == ODM_RTL8188E) - { - ODM_TxPwrTrackSetPwr88E(pDM_Odm, MIX_MODE, ODM_RF_PATH_A, 0); - } -} -#endif -#endif - -#if (DM_ODM_SUPPORT_TYPE == ODM_CE) -/* Justin: According to the current RRSI to adjust Response Frame TX power, 2012/11/05 */ -void odm_dtc(PDM_ODM_T pDM_Odm) -{ -#ifdef CONFIG_DM_RESP_TXAGC - #define DTC_BASE 35 /* RSSI higher than this value, start to decade TX power */ - #define DTC_DWN_BASE (DTC_BASE-5) /* RSSI lower than this value, start to increase TX power */ - - /* RSSI vs TX power step mapping: decade TX power */ - static const u8 dtc_table_down[]={ - DTC_BASE, - (DTC_BASE+5), - (DTC_BASE+10), - (DTC_BASE+15), - (DTC_BASE+20), - (DTC_BASE+25) - }; - - /* RSSI vs TX power step mapping: increase TX power */ - static const u8 dtc_table_up[]={ - DTC_DWN_BASE, - (DTC_DWN_BASE-5), - (DTC_DWN_BASE-10), - (DTC_DWN_BASE-15), - (DTC_DWN_BASE-15), - (DTC_DWN_BASE-20), - (DTC_DWN_BASE-20), - (DTC_DWN_BASE-25), - (DTC_DWN_BASE-25), - (DTC_DWN_BASE-30), - (DTC_DWN_BASE-35) - }; - - u8 i; - u8 dtc_steps=0; - u8 sign; - u8 resp_txagc=0; - - #if 0 - /* As DIG is disabled, DTC is also disable */ - if(!(pDM_Odm->SupportAbility & ODM_XXXXXX)) - return; - #endif - - if (DTC_BASE < pDM_Odm->RSSI_Min) { - /* need to decade the CTS TX power */ - sign = 1; - for (i=0;i= pDM_Odm->RSSI_Min) || (dtc_steps >= 6)) - break; - else - dtc_steps++; - } - } -#if 0 - else if (DTC_DWN_BASE > pDM_Odm->RSSI_Min) - { - /* needs to increase the CTS TX power */ - sign = 0; - dtc_steps = 1; - for (i=0;iRSSI_Min) || (dtc_steps>=10)) - break; - else - dtc_steps++; - } - } -#endif - else - { - sign = 0; - dtc_steps = 0; - } - - resp_txagc = dtc_steps | (sign << 4); - resp_txagc = resp_txagc | (resp_txagc << 5); - ODM_Write1Byte(pDM_Odm, 0x06d9, resp_txagc); - - DBG_871X("%s RSSI_Min:%u, set RESP_TXAGC to %s %u\n", - __func__, pDM_Odm->RSSI_Min, sign?"minus":"plus", dtc_steps); -#endif /* CONFIG_RESP_TXAGC_ADJUST */ -} - -#endif /* #if (DM_ODM_SUPPORT_TYPE == ODM_CE) */ - diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm.h deleted file mode 100755 index 81bc89005b8428..00000000000000 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm.h +++ /dev/null @@ -1,2366 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * - ******************************************************************************/ - - -#ifndef __HALDMOUTSRC_H__ -#define __HALDMOUTSRC_H__ - -//============================================================ -// Definition -//============================================================ -// -// 2011/09/22 MH Define all team supprt ability. -// - -// -// 2011/09/22 MH Define for all teams. Please Define the constan in your precomp header. -// -//#define DM_ODM_SUPPORT_AP 0 -//#define DM_ODM_SUPPORT_ADSL 0 -//#define DM_ODM_SUPPORT_CE 0 -//#define DM_ODM_SUPPORT_MP 1 - -// -// 2011/09/28 MH Define ODM SW team support flag. -// - - - -// -// Antenna Switch Relative Definition. -// - -// -// 20100503 Joseph: -// Add new function SwAntDivCheck8192C(). -// This is the main function of Antenna diversity function before link. -// Mainly, it just retains last scan result and scan again. -// After that, it compares the scan result to see which one gets better RSSI. -// It selects antenna with better receiving power and returns better scan result. -// -#define TP_MODE 0 -#define RSSI_MODE 1 -#define TRAFFIC_LOW 0 -#define TRAFFIC_HIGH 1 - - -//============================================================ -//3 Tx Power Tracking -//3============================================================ -#define DPK_DELTA_MAPPING_NUM 13 -#define index_mapping_HP_NUM 15 -#define OFDM_TABLE_SIZE 43 -#define CCK_TABLE_SIZE 33 -#define TXSCALE_TABLE_SIZE 37 -#define TXPWR_TRACK_TABLE_SIZE 30 -#define DELTA_SWINGIDX_SIZE 30 -#define BAND_NUM 4 - -//============================================================ -//3 PSD Handler -//3============================================================ - -#define AFH_PSD 1 //0:normal PSD scan, 1: only do 20 pts PSD -#define MODE_40M 0 //0:20M, 1:40M -#define PSD_TH2 3 -#define PSD_CHMIN 20 // Minimum channel number for BT AFH -#define SIR_STEP_SIZE 3 -#define Smooth_Size_1 5 -#define Smooth_TH_1 3 -#define Smooth_Size_2 10 -#define Smooth_TH_2 4 -#define Smooth_Size_3 20 -#define Smooth_TH_3 4 -#define Smooth_Step_Size 5 -#define Adaptive_SIR 1 -#if(RTL8723_FPGA_VERIFICATION == 1) -#define PSD_RESCAN 1 -#else -#define PSD_RESCAN 4 -#endif -#define PSD_SCAN_INTERVAL 700 //ms - - - -//8723A High Power IGI Setting -#define DM_DIG_HIGH_PWR_IGI_LOWER_BOUND 0x22 -#define DM_DIG_Gmode_HIGH_PWR_IGI_LOWER_BOUND 0x28 -#define DM_DIG_HIGH_PWR_THRESHOLD 0x3a -#define DM_DIG_LOW_PWR_THRESHOLD 0x14 - -//ANT Test -#define ANTTESTALL 0x00 //Ant A or B will be Testing -#define ANTTESTA 0x01 //Ant A will be Testing -#define ANTTESTB 0x02 //Ant B will be testing - -// LPS define -#define DM_DIG_FA_TH0_LPS 4 //-> 4 in lps -#define DM_DIG_FA_TH1_LPS 15 //-> 15 lps -#define DM_DIG_FA_TH2_LPS 30 //-> 30 lps -#define RSSI_OFFSET_DIG 0x05; - - - -//for 8723A Ant Definition--2012--06--07 due to different IC may be different ANT define -#define MAIN_ANT 1 //Ant A or Ant Main -#define AUX_ANT 2 //AntB or Ant Aux -#define MAX_ANT 3 // 3 for AP using - - -//Antenna Diversity Type -#define SW_ANTDIV 0 -#define HW_ANTDIV 1 -//============================================================ -// structure and define -//============================================================ - -// -// 2011/09/20 MH Add for AP/ADSLpseudo DM structuer requirement. -// We need to remove to other position??? -// -#if(DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_WIN)) -typedef struct rtl8192cd_priv { - u1Byte temp; - -}rtl8192cd_priv, *prtl8192cd_priv; -#endif - - -#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) -typedef struct _ADAPTER{ - u1Byte temp; - #ifdef AP_BUILD_WORKAROUND - HAL_DATA_TYPE* temp2; - prtl8192cd_priv priv; - #endif -}ADAPTER, *PADAPTER; -#endif - -#if (DM_ODM_SUPPORT_TYPE == ODM_AP) - -typedef struct _WLAN_STA{ - u1Byte temp; -} WLAN_STA, *PRT_WLAN_STA; - -#endif - -typedef struct _Dynamic_Initial_Gain_Threshold_ -{ - u1Byte Dig_Enable_Flag; - u1Byte Dig_Ext_Port_Stage; - - int RssiLowThresh; - int RssiHighThresh; - - u4Byte FALowThresh; - u4Byte FAHighThresh; - - u1Byte CurSTAConnectState; - u1Byte PreSTAConnectState; - u1Byte CurMultiSTAConnectState; - - u1Byte PreIGValue; - u1Byte CurIGValue; - u1Byte BT30_CurIGI; - u1Byte BackupIGValue; - - s1Byte BackoffVal; - s1Byte BackoffVal_range_max; - s1Byte BackoffVal_range_min; - u1Byte rx_gain_range_max; - u1Byte rx_gain_range_min; - u1Byte Rssi_val_min; - - u1Byte PreCCK_CCAThres; - u1Byte CurCCK_CCAThres; - u1Byte PreCCKPDState; - u1Byte CurCCKPDState; - - u1Byte LargeFAHit; - u1Byte ForbiddenIGI; - u4Byte Recover_cnt; - - u1Byte DIG_Dynamic_MIN_0; - u1Byte DIG_Dynamic_MIN_1; - BOOLEAN bMediaConnect_0; - BOOLEAN bMediaConnect_1; - - u4Byte AntDiv_RSSI_max; - u4Byte RSSI_max; -}DIG_T,*pDIG_T; - -typedef struct _Dynamic_Power_Saving_ -{ - u1Byte PreCCAState; - u1Byte CurCCAState; - - u1Byte PreRFState; - u1Byte CurRFState; - - int Rssi_val_min; - - u1Byte initialize; - u4Byte Reg874,RegC70,Reg85C,RegA74; - -}PS_T,*pPS_T; - -typedef struct _FALSE_ALARM_STATISTICS{ - u4Byte Cnt_Parity_Fail; - u4Byte Cnt_Rate_Illegal; - u4Byte Cnt_Crc8_fail; - u4Byte Cnt_Mcs_fail; - u4Byte Cnt_Ofdm_fail; - u4Byte Cnt_Cck_fail; - u4Byte Cnt_all; - u4Byte Cnt_Fast_Fsync; - u4Byte Cnt_SB_Search_fail; - u4Byte Cnt_OFDM_CCA; - u4Byte Cnt_CCK_CCA; - u4Byte Cnt_CCA_all; - u4Byte Cnt_BW_USC; //Gary - u4Byte Cnt_BW_LSC; //Gary -}FALSE_ALARM_STATISTICS, *PFALSE_ALARM_STATISTICS; - -typedef struct _Dynamic_Primary_CCA{ - u1Byte PriCCA_flag; - u1Byte intf_flag; - u1Byte intf_type; - u1Byte DupRTS_flag; - u1Byte Monitor_flag; - u1Byte CH_offset; - u1Byte MF_state; -}Pri_CCA_T, *pPri_CCA_T; - -typedef struct _Rate_Adaptive_Table_{ - u1Byte firstconnect; -}RA_T, *pRA_T; - -typedef struct _RX_High_Power_ -{ - u1Byte RXHP_flag; - u1Byte PSD_func_trigger; - u1Byte PSD_bitmap_RXHP[80]; - u1Byte Pre_IGI; - u1Byte Cur_IGI; - u1Byte Pre_pw_th; - u1Byte Cur_pw_th; - BOOLEAN First_time_enter; - BOOLEAN RXHP_enable; - u1Byte TP_Mode; - RT_TIMER PSDTimer; -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - #if USE_WORKITEM - RT_WORK_ITEM PSDTimeWorkitem; - #endif -#endif - -}RXHP_T, *pRXHP_T; - -#if(DM_ODM_SUPPORT_TYPE & (ODM_CE)) -#define ASSOCIATE_ENTRY_NUM 32 // Max size of AsocEntry[]. -#define ODM_ASSOCIATE_ENTRY_NUM ASSOCIATE_ENTRY_NUM - -#elif(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) -#define ASSOCIATE_ENTRY_NUM NUM_STAT -#define ODM_ASSOCIATE_ENTRY_NUM ASSOCIATE_ENTRY_NUM+1 - -#else -// -// 2012/01/12 MH Revise for compatiable with other SW team. -// 0 is for STA 1-n is for AP clients. -// -#define ODM_ASSOCIATE_ENTRY_NUM ASSOCIATE_ENTRY_NUM+1// Default port only one -#endif - -//#ifdef CONFIG_ANTENNA_DIVERSITY -// This indicates two different the steps. -// In SWAW_STEP_PEAK, driver needs to switch antenna and listen to the signal on the air. -// In SWAW_STEP_DETERMINE, driver just compares the signal captured in SWAW_STEP_PEAK -// with original RSSI to determine if it is necessary to switch antenna. -#define SWAW_STEP_PEAK 0 -#define SWAW_STEP_DETERMINE 1 - -#define TP_MODE 0 -#define RSSI_MODE 1 -#define TRAFFIC_LOW 0 -#define TRAFFIC_HIGH 1 -#define TRAFFIC_UltraLOW 2 - -typedef struct _SW_Antenna_Switch_ -{ - u1Byte Double_chk_flag; - u1Byte try_flag; - s4Byte PreRSSI; - u1Byte CurAntenna; - u1Byte PreAntenna; - u1Byte RSSI_Trying; - u1Byte TestMode; - u1Byte bTriggerAntennaSwitch; - u1Byte SelectAntennaMap; - u1Byte RSSI_target; - u1Byte reset_idx; - - // Before link Antenna Switch check - u1Byte SWAS_NoLink_State; - u4Byte SWAS_NoLink_BK_Reg860; - u4Byte SWAS_NoLink_BK_Reg92c; - BOOLEAN ANTA_ON; //To indicate Ant A is or not - BOOLEAN ANTB_ON; //To indicate Ant B is on or not - u1Byte Ant5G; - u1Byte Ant2G; - - s4Byte RSSI_sum_A; - s4Byte RSSI_sum_B; - s4Byte RSSI_cnt_A; - s4Byte RSSI_cnt_B; - - u8Byte lastTxOkCnt; - u8Byte lastRxOkCnt; - u8Byte TXByteCnt_A; - u8Byte TXByteCnt_B; - u8Byte RXByteCnt_A; - u8Byte RXByteCnt_B; - u1Byte TrafficLoad; - u1Byte Train_time; - u1Byte Train_time_flag; - RT_TIMER SwAntennaSwitchTimer; - RT_TIMER SwAntennaSwitchTimer_8723B; -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - #if USE_WORKITEM - RT_WORK_ITEM SwAntennaSwitchWorkitem; - RT_WORK_ITEM SwAntennaSwitchWorkitem_8723B; - #endif -#endif -/* CE Platform use -#ifdef CONFIG_SW_ANTENNA_DIVERSITY - _timer SwAntennaSwitchTimer; - u8Byte lastTxOkCnt; - u8Byte lastRxOkCnt; - u8Byte TXByteCnt_A; - u8Byte TXByteCnt_B; - u8Byte RXByteCnt_A; - u8Byte RXByteCnt_B; - u1Byte DoubleComfirm; - u1Byte TrafficLoad; - //SW Antenna Switch - - -#endif -*/ -#ifdef CONFIG_HW_ANTENNA_DIVERSITY - //Hybrid Antenna Diversity - u4Byte CCK_Ant1_Cnt[ASSOCIATE_ENTRY_NUM+1]; - u4Byte CCK_Ant2_Cnt[ASSOCIATE_ENTRY_NUM+1]; - u4Byte OFDM_Ant1_Cnt[ASSOCIATE_ENTRY_NUM+1]; - u4Byte OFDM_Ant2_Cnt[ASSOCIATE_ENTRY_NUM+1]; - u4Byte RSSI_Ant1_Sum[ASSOCIATE_ENTRY_NUM+1]; - u4Byte RSSI_Ant2_Sum[ASSOCIATE_ENTRY_NUM+1]; - u1Byte TxAnt[ASSOCIATE_ENTRY_NUM+1]; - u1Byte TargetSTA; - u1Byte antsel; - u1Byte RxIdleAnt; - -#endif - -}SWAT_T, *pSWAT_T; -//#endif - -typedef struct _EDCA_TURBO_ -{ - BOOLEAN bCurrentTurboEDCA; - BOOLEAN bIsCurRDLState; - - #if(DM_ODM_SUPPORT_TYPE == ODM_CE ) - u4Byte prv_traffic_idx; // edca turbo - #endif - -}EDCA_T,*pEDCA_T; - -typedef struct _ODM_RATE_ADAPTIVE -{ - u1Byte Type; // DM_Type_ByFW/DM_Type_ByDriver - u1Byte LdpcThres; // if RSSI > LdpcThres => switch from LPDC to BCC - BOOLEAN bUseLdpc; - BOOLEAN bLowerRtsRate; - u1Byte HighRSSIThresh; // if RSSI > HighRSSIThresh => RATRState is DM_RATR_STA_HIGH - u1Byte LowRSSIThresh; // if RSSI <= LowRSSIThresh => RATRState is DM_RATR_STA_LOW - u1Byte RATRState; // Current RSSI level, DM_RATR_STA_HIGH/DM_RATR_STA_MIDDLE/DM_RATR_STA_LOW - -} ODM_RATE_ADAPTIVE, *PODM_RATE_ADAPTIVE; - - -#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) - - -#ifdef ADSL_AP_BUILD_WORKAROUND -#define MAX_TOLERANCE 5 -#define IQK_DELAY_TIME 1 //ms -#endif - -// -// Indicate different AP vendor for IOT issue. -// -typedef enum _HT_IOT_PEER -{ - HT_IOT_PEER_UNKNOWN = 0, - HT_IOT_PEER_REALTEK = 1, - HT_IOT_PEER_REALTEK_92SE = 2, - HT_IOT_PEER_BROADCOM = 3, - HT_IOT_PEER_RALINK = 4, - HT_IOT_PEER_ATHEROS = 5, - HT_IOT_PEER_CISCO = 6, - HT_IOT_PEER_MERU = 7, - HT_IOT_PEER_MARVELL = 8, - HT_IOT_PEER_REALTEK_SOFTAP = 9,// peer is RealTek SOFT_AP, by Bohn, 2009.12.17 - HT_IOT_PEER_SELF_SOFTAP = 10, // Self is SoftAP - HT_IOT_PEER_AIRGO = 11, - HT_IOT_PEER_INTEL = 12, - HT_IOT_PEER_RTK_APCLIENT = 13, - HT_IOT_PEER_REALTEK_81XX = 14, - HT_IOT_PEER_REALTEK_WOW = 15, - HT_IOT_PEER_MAX = 16 -}HT_IOT_PEER_E, *PHTIOT_PEER_E; -#endif//#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) - - - -#define IQK_MAC_REG_NUM 4 -#define IQK_ADDA_REG_NUM 16 -#define IQK_BB_REG_NUM_MAX 10 -#if (RTL8192D_SUPPORT==1) -#define IQK_BB_REG_NUM 10 -#else -#define IQK_BB_REG_NUM 9 -#endif -#define HP_THERMAL_NUM 8 - -#define AVG_THERMAL_NUM 8 -#define IQK_Matrix_REG_NUM 8 -#define IQK_Matrix_Settings_NUM 14+24+21 // Channels_2_4G_NUM + Channels_5G_20M_NUM + Channels_5G - -#define DM_Type_ByFW 0 -#define DM_Type_ByDriver 1 - -// -// Declare for common info -// -#define MAX_PATH_NUM_92CS 2 -#define MAX_PATH_NUM_8188E 1 -#define MAX_PATH_NUM_8192E 2 -#define MAX_PATH_NUM_8723B 1 -#define MAX_PATH_NUM_8812A 2 -#define MAX_PATH_NUM_8821A 1 - -#define IQK_THRESHOLD 8 - -typedef struct _ODM_Phy_Status_Info_ -{ - // - // Be care, if you want to add any element please insert between - // RxPWDBAll & SignalStrength. - // -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN)) - u4Byte RxPWDBAll; -#else - u1Byte RxPWDBAll; -#endif - - u1Byte SignalQuality; // in 0-100 index. - s1Byte RxMIMOSignalQuality[4]; //per-path's EVM - u1Byte RxMIMOEVMdbm[4]; //per-path's EVM dbm - - u1Byte RxMIMOSignalStrength[4];// in 0~100 index - - u2Byte Cfo_short[4]; // per-path's Cfo_short - u2Byte Cfo_tail[4]; // per-path's Cfo_tail - -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) - s1Byte RxPower; // in dBm Translate from PWdB - s1Byte RecvSignalPower; // Real power in dBm for this packet, no beautification and aggregation. Keep this raw info to be used for the other procedures. - u1Byte BTRxRSSIPercentage; - u1Byte SignalStrength; // in 0-100 index. - - u1Byte RxPwr[4]; //per-path's pwdb -#endif - u1Byte RxSNR[4]; //per-path's SNR - u1Byte BandWidth; - u1Byte btCoexPwrAdjust; -}ODM_PHY_INFO_T,*PODM_PHY_INFO_T; - - -typedef struct _ODM_Per_Pkt_Info_ -{ - //u1Byte Rate; - u1Byte DataRate; - u1Byte StationID; - BOOLEAN bPacketMatchBSSID; - BOOLEAN bPacketToSelf; - BOOLEAN bPacketBeacon; -}ODM_PACKET_INFO_T,*PODM_PACKET_INFO_T; - - -typedef struct _ODM_Phy_Dbg_Info_ -{ - //ODM Write,debug info - s1Byte RxSNRdB[4]; - u8Byte NumQryPhyStatus; - u8Byte NumQryPhyStatusCCK; - u8Byte NumQryPhyStatusOFDM; - u1Byte NumQryBeaconPkt; - //Others - s4Byte RxEVM[4]; - -}ODM_PHY_DBG_INFO_T; - - -typedef struct _ODM_Mac_Status_Info_ -{ - u1Byte test; - -}ODM_MAC_INFO; - - -typedef enum tag_Dynamic_ODM_Support_Ability_Type -{ - // BB Team - ODM_DIG = 0x00000001, - ODM_HIGH_POWER = 0x00000002, - ODM_CCK_CCA_TH = 0x00000004, - ODM_FA_STATISTICS = 0x00000008, - ODM_RAMASK = 0x00000010, - ODM_RSSI_MONITOR = 0x00000020, - ODM_SW_ANTDIV = 0x00000040, - ODM_HW_ANTDIV = 0x00000080, - ODM_BB_PWRSV = 0x00000100, - ODM_2TPATHDIV = 0x00000200, - ODM_1TPATHDIV = 0x00000400, - ODM_PSD2AFH = 0x00000800 -}ODM_Ability_E; - -// -// 2011/20/20 MH For MP driver RT_WLAN_STA = STA_INFO_T -// Please declare below ODM relative info in your STA info structure. -// -#if 1 -typedef struct _ODM_STA_INFO{ - // Driver Write - BOOLEAN bUsed; // record the sta status link or not? - //u1Byte WirelessMode; // - u1Byte IOTPeer; // Enum value. HT_IOT_PEER_E - - // ODM Write - //1 PHY_STATUS_INFO - u1Byte RSSI_Path[4]; // - u1Byte RSSI_Ave; - u1Byte RXEVM[4]; - u1Byte RXSNR[4]; - - // ODM Write - //1 TX_INFO (may changed by IC) - //TX_INFO_T pTxInfo; // Define in IC folder. Move lower layer. -#if 0 - u1Byte ANTSEL_A; //in Jagar: 4bit; others: 2bit - u1Byte ANTSEL_B; //in Jagar: 4bit; others: 2bit - u1Byte ANTSEL_C; //only in Jagar: 4bit - u1Byte ANTSEL_D; //only in Jagar: 4bit - u1Byte TX_ANTL; //not in Jagar: 2bit - u1Byte TX_ANT_HT; //not in Jagar: 2bit - u1Byte TX_ANT_CCK; //not in Jagar: 2bit - u1Byte TXAGC_A; //not in Jagar: 4bit - u1Byte TXAGC_B; //not in Jagar: 4bit - u1Byte TXPWR_OFFSET; //only in Jagar: 3bit - u1Byte TX_ANT; //only in Jagar: 4bit for TX_ANTL/TX_ANTHT/TX_ANT_CCK -#endif - - // - // Please use compile flag to disabe the strcutrue for other IC except 88E. - // Move To lower layer. - // - // ODM Write Wilson will handle this part(said by Luke.Lee) - //TX_RPT_T pTxRpt; // Define in IC folder. Move lower layer. -#if 0 - //1 For 88E RA (don't redefine the naming) - u1Byte rate_id; - u1Byte rate_SGI; - u1Byte rssi_sta_ra; - u1Byte SGI_enable; - u1Byte Decision_rate; - u1Byte Pre_rate; - u1Byte Active; - - // Driver write Wilson handle. - //1 TX_RPT (don't redefine the naming) - u2Byte RTY[4]; // ??? - u2Byte TOTAL; // ??? - u2Byte DROP; // ??? - // - // Please use compile flag to disabe the strcutrue for other IC except 88E. - // -#endif - -}ODM_STA_INFO_T, *PODM_STA_INFO_T; -#endif - -// -// 2011/10/20 MH Define Common info enum for all team. -// -typedef enum _ODM_Common_Info_Definition -{ -//-------------REMOVED CASE-----------// - //ODM_CMNINFO_CCK_HP, - //ODM_CMNINFO_RFPATH_ENABLE, // Define as ODM write??? - //ODM_CMNINFO_BT_COEXIST, // ODM_BT_COEXIST_E - //ODM_CMNINFO_OP_MODE, // ODM_OPERATION_MODE_E -//-------------REMOVED CASE-----------// - - // - // Fixed value: - // - - //-----------HOOK BEFORE REG INIT-----------// - ODM_CMNINFO_PLATFORM = 0, - ODM_CMNINFO_ABILITY, // ODM_ABILITY_E - ODM_CMNINFO_INTERFACE, // ODM_INTERFACE_E - ODM_CMNINFO_MP_TEST_CHIP, - ODM_CMNINFO_IC_TYPE, // ODM_IC_TYPE_E - ODM_CMNINFO_CUT_VER, // ODM_CUT_VERSION_E - ODM_CMNINFO_FAB_VER, // ODM_FAB_E - ODM_CMNINFO_RF_TYPE, // ODM_RF_PATH_E or ODM_RF_TYPE_E? - ODM_CMNINFO_RFE_TYPE, - ODM_CMNINFO_BOARD_TYPE, // ODM_BOARD_TYPE_E - ODM_CMNINFO_PACKAGE_TYPE, - ODM_CMNINFO_EXT_LNA, // TRUE - ODM_CMNINFO_5G_EXT_LNA, - ODM_CMNINFO_EXT_PA, - ODM_CMNINFO_5G_EXT_PA, - ODM_CMNINFO_GPA, - ODM_CMNINFO_APA, - ODM_CMNINFO_GLNA, - ODM_CMNINFO_ALNA, - ODM_CMNINFO_EXT_TRSW, - ODM_CMNINFO_PATCH_ID, //CUSTOMER ID - ODM_CMNINFO_BINHCT_TEST, - ODM_CMNINFO_BWIFI_TEST, - ODM_CMNINFO_SMART_CONCURRENT, - //-----------HOOK BEFORE REG INIT-----------// - - - // - // Dynamic value: - // -//--------- POINTER REFERENCE-----------// - ODM_CMNINFO_MAC_PHY_MODE, // ODM_MAC_PHY_MODE_E - ODM_CMNINFO_TX_UNI, - ODM_CMNINFO_RX_UNI, - ODM_CMNINFO_WM_MODE, // ODM_WIRELESS_MODE_E - ODM_CMNINFO_BAND, // ODM_BAND_TYPE_E - ODM_CMNINFO_SEC_CHNL_OFFSET, // ODM_SEC_CHNL_OFFSET_E - ODM_CMNINFO_SEC_MODE, // ODM_SECURITY_E - ODM_CMNINFO_BW, // ODM_BW_E - ODM_CMNINFO_CHNL, - ODM_CMNINFO_FORCED_RATE, - - ODM_CMNINFO_DMSP_GET_VALUE, - ODM_CMNINFO_BUDDY_ADAPTOR, - ODM_CMNINFO_DMSP_IS_MASTER, - ODM_CMNINFO_SCAN, - ODM_CMNINFO_POWER_SAVING, - ODM_CMNINFO_ONE_PATH_CCA, // ODM_CCA_PATH_E - ODM_CMNINFO_DRV_STOP, - ODM_CMNINFO_PNP_IN, - ODM_CMNINFO_INIT_ON, - ODM_CMNINFO_ANT_TEST, - ODM_CMNINFO_NET_CLOSED, - ODM_CMNINFO_MP_MODE, - //ODM_CMNINFO_RTSTA_AID, // For win driver only? - ODM_CMNINFO_FORCED_IGI_LB, -//--------- POINTER REFERENCE-----------// - -//------------CALL BY VALUE-------------// - ODM_CMNINFO_WIFI_DIRECT, - ODM_CMNINFO_WIFI_DISPLAY, - ODM_CMNINFO_LINK_IN_PROGRESS, - ODM_CMNINFO_LINK, - ODM_CMNINFO_STATION_STATE, - ODM_CMNINFO_RSSI_MIN, - ODM_CMNINFO_DBG_COMP, // u8Byte - ODM_CMNINFO_DBG_LEVEL, // u4Byte - ODM_CMNINFO_RA_THRESHOLD_HIGH, // u1Byte - ODM_CMNINFO_RA_THRESHOLD_LOW, // u1Byte - ODM_CMNINFO_RF_ANTENNA_TYPE, // u1Byte - ODM_CMNINFO_BT_DISABLED, - ODM_CMNINFO_BT_HS_CONNECT_PROCESS, - ODM_CMNINFO_BT_HS_RSSI, - ODM_CMNINFO_BT_OPERATION, - ODM_CMNINFO_BT_LIMITED_DIG, //Need to Limited Dig or not - ODM_CMNINFO_BT_DISABLE_EDCA, -//------------CALL BY VALUE-------------// - - // - // Dynamic ptr array hook itms. - // - ODM_CMNINFO_STA_STATUS, - ODM_CMNINFO_PHY_STATUS, - ODM_CMNINFO_MAC_STATUS, - - ODM_CMNINFO_MAX, - - -}ODM_CMNINFO_E; - -// -// 2011/10/20 MH Define ODM support ability. ODM_CMNINFO_ABILITY -// -typedef enum _ODM_Support_Ability_Definition -{ - // - // BB ODM section BIT 0-15 - // - ODM_BB_DIG = BIT0, - ODM_BB_RA_MASK = BIT1, - ODM_BB_DYNAMIC_TXPWR = BIT2, - ODM_BB_FA_CNT = BIT3, - ODM_BB_RSSI_MONITOR = BIT4, - ODM_BB_CCK_PD = BIT5, - ODM_BB_ANT_DIV = BIT6, - ODM_BB_PWR_SAVE = BIT7, - ODM_BB_PWR_TRAIN = BIT8, - ODM_BB_RATE_ADAPTIVE = BIT9, - ODM_BB_PATH_DIV = BIT10, - ODM_BB_PSD = BIT11, - ODM_BB_RXHP = BIT12, - ODM_BB_ADAPTIVITY = BIT13, - ODM_BB_DYNAMIC_ATC = BIT14, - - // - // MAC DM section BIT 16-23 - // - ODM_MAC_EDCA_TURBO = BIT16, - ODM_MAC_EARLY_MODE = BIT17, - - // - // RF ODM section BIT 24-31 - // - ODM_RF_TX_PWR_TRACK = BIT24, - ODM_RF_RX_GAIN_TRACK = BIT25, - ODM_RF_CALIBRATION = BIT26, - -}ODM_ABILITY_E; - -// ODM_CMNINFO_INTERFACE -typedef enum tag_ODM_Support_Interface_Definition -{ - ODM_ITRF_PCIE = 0x1, - ODM_ITRF_USB = 0x2, - ODM_ITRF_SDIO = 0x4, - ODM_ITRF_ALL = 0x7, -}ODM_INTERFACE_E; - -// ODM_CMNINFO_IC_TYPE -typedef enum tag_ODM_Support_IC_Type_Definition -{ - ODM_RTL8192S = BIT0, - ODM_RTL8192C = BIT1, - ODM_RTL8192D = BIT2, - ODM_RTL8723A = BIT3, - ODM_RTL8188E = BIT4, - ODM_RTL8812 = BIT5, - ODM_RTL8821 = BIT6, - ODM_RTL8192E = BIT7, - ODM_RTL8723B = BIT8, - ODM_RTL8813A = BIT9, - ODM_RTL8881A = BIT10 -}ODM_IC_TYPE_E; - -#define ODM_IC_11N_SERIES (ODM_RTL8192S|ODM_RTL8192C|ODM_RTL8192D|ODM_RTL8723A|ODM_RTL8188E|ODM_RTL8192E|ODM_RTL8723B) -#define ODM_IC_11AC_SERIES (ODM_RTL8812|ODM_RTL8821|ODM_RTL8813A|ODM_RTL8881A) - -#if (DM_ODM_SUPPORT_TYPE == ODM_AP) -#ifdef RTK_AC_SUPPORT -#define ODM_IC_11AC_SERIES_SUPPORT 1 -#else -#define ODM_IC_11AC_SERIES_SUPPORT 0 -#endif -#else -#define ODM_IC_11AC_SERIES_SUPPORT 1 -#endif - -//ODM_CMNINFO_CUT_VER -typedef enum tag_ODM_Cut_Version_Definition -{ - ODM_CUT_A = 0, - ODM_CUT_B = 1, - ODM_CUT_C = 2, - ODM_CUT_D = 3, - ODM_CUT_E = 4, - ODM_CUT_F = 5, - - ODM_CUT_I = 8, - ODM_CUT_TEST = 15, -}ODM_CUT_VERSION_E; - -// ODM_CMNINFO_FAB_VER -typedef enum tag_ODM_Fab_Version_Definition -{ - ODM_TSMC = 0, - ODM_UMC = 1, -}ODM_FAB_E; - -// ODM_CMNINFO_RF_TYPE -// -// For example 1T2R (A+AB = BIT0|BIT4|BIT5) -// -typedef enum tag_ODM_RF_Path_Bit_Definition -{ - ODM_RF_TX_A = BIT0, - ODM_RF_TX_B = BIT1, - ODM_RF_TX_C = BIT2, - ODM_RF_TX_D = BIT3, - ODM_RF_RX_A = BIT4, - ODM_RF_RX_B = BIT5, - ODM_RF_RX_C = BIT6, - ODM_RF_RX_D = BIT7, -}ODM_RF_PATH_E; - - -typedef enum tag_ODM_RF_Type_Definition -{ - ODM_1T1R = 0, - ODM_1T2R = 1, - ODM_2T2R = 2, - ODM_2T3R = 3, - ODM_2T4R = 4, - ODM_3T3R = 5, - ODM_3T4R = 6, - ODM_4T4R = 7, -}ODM_RF_TYPE_E; - - -// -// ODM Dynamic common info value definition -// - -//typedef enum _MACPHY_MODE_8192D{ -// SINGLEMAC_SINGLEPHY, -// DUALMAC_DUALPHY, -// DUALMAC_SINGLEPHY, -//}MACPHY_MODE_8192D,*PMACPHY_MODE_8192D; -// Above is the original define in MP driver. Please use the same define. THX. -typedef enum tag_ODM_MAC_PHY_Mode_Definition -{ - ODM_SMSP = 0, - ODM_DMSP = 1, - ODM_DMDP = 2, -}ODM_MAC_PHY_MODE_E; - - -typedef enum tag_BT_Coexist_Definition -{ - ODM_BT_BUSY = 1, - ODM_BT_ON = 2, - ODM_BT_OFF = 3, - ODM_BT_NONE = 4, -}ODM_BT_COEXIST_E; - -// ODM_CMNINFO_OP_MODE -typedef enum tag_Operation_Mode_Definition -{ - ODM_NO_LINK = BIT0, - ODM_LINK = BIT1, - ODM_SCAN = BIT2, - ODM_POWERSAVE = BIT3, - ODM_AP_MODE = BIT4, - ODM_CLIENT_MODE = BIT5, - ODM_AD_HOC = BIT6, - ODM_WIFI_DIRECT = BIT7, - ODM_WIFI_DISPLAY = BIT8, -}ODM_OPERATION_MODE_E; - -// ODM_CMNINFO_WM_MODE -#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_CE)) -typedef enum tag_Wireless_Mode_Definition -{ - ODM_WM_UNKNOW = 0x0, - ODM_WM_B = BIT0, - ODM_WM_G = BIT1, - ODM_WM_A = BIT2, - ODM_WM_N24G = BIT3, - ODM_WM_N5G = BIT4, - ODM_WM_AUTO = BIT5, - ODM_WM_AC = BIT6, -}ODM_WIRELESS_MODE_E; -#else -typedef enum tag_Wireless_Mode_Definition -{ - ODM_WM_UNKNOWN = 0x00, - ODM_WM_A = BIT0, - ODM_WM_B = BIT1, - ODM_WM_G = BIT2, - ODM_WM_AUTO = BIT3, - ODM_WM_N24G = BIT4, - ODM_WM_N5G = BIT5, - ODM_WM_AC_5G = BIT6, - ODM_WM_AC_24G = BIT7, - ODM_WM_AC_ONLY = BIT8, - ODM_WM_MAX = BIT9 -}ODM_WIRELESS_MODE_E; -#endif - -// ODM_CMNINFO_BAND -typedef enum tag_Band_Type_Definition -{ - ODM_BAND_2_4G = 0, - ODM_BAND_5G, - ODM_BAND_ON_BOTH, - ODM_BANDMAX - -}ODM_BAND_TYPE_E; - -// ODM_CMNINFO_SEC_CHNL_OFFSET -typedef enum tag_Secondary_Channel_Offset_Definition -{ - ODM_DONT_CARE = 0, - ODM_BELOW = 1, - ODM_ABOVE = 2 -}ODM_SEC_CHNL_OFFSET_E; - -// ODM_CMNINFO_SEC_MODE -typedef enum tag_Security_Definition -{ - ODM_SEC_OPEN = 0, - ODM_SEC_WEP40 = 1, - ODM_SEC_TKIP = 2, - ODM_SEC_RESERVE = 3, - ODM_SEC_AESCCMP = 4, - ODM_SEC_WEP104 = 5, - ODM_WEP_WPA_MIXED = 6, // WEP + WPA - ODM_SEC_SMS4 = 7, -}ODM_SECURITY_E; - -// ODM_CMNINFO_BW -typedef enum tag_Bandwidth_Definition -{ - ODM_BW20M = 0, - ODM_BW40M = 1, - ODM_BW80M = 2, - ODM_BW160M = 3, - ODM_BW10M = 4, -}ODM_BW_E; - - -// ODM_CMNINFO_BOARD_TYPE -// For non-AC-series IC , ODM_BOARD_5G_EXT_PA and ODM_BOARD_5G_EXT_LNA are ignored -// For AC-series IC, external PA & LNA can be indivisuallly added on 2.4G and/or 5G -typedef enum tag_Board_Definition -{ - ODM_BOARD_DEFAULT = 0, // The DEFAULT case. - ODM_BOARD_MINICARD = BIT(0), // 0 = non-mini card, 1= mini card. - ODM_BOARD_SLIM = BIT(1), // 0 = non-slim card, 1 = slim card - ODM_BOARD_BT = BIT(2), // 0 = without BT card, 1 = with BT - ODM_BOARD_EXT_PA = BIT(3), // 0 = no 2G ext-PA, 1 = existing 2G ext-PA - ODM_BOARD_EXT_LNA = BIT(4), // 0 = no 2G ext-LNA, 1 = existing 2G ext-LNA - ODM_BOARD_EXT_TRSW = BIT(5), // 0 = no ext-TRSW, 1 = existing ext-TRSW - ODM_BOARD_EXT_PA_5G = BIT(6), // 0 = no 5G ext-PA, 1 = existing 5G ext-PA - ODM_BOARD_EXT_LNA_5G= BIT(7), // 0 = no 5G ext-LNA, 1 = existing 5G ext-LNA -}ODM_BOARD_TYPE_E; - -typedef enum tag_ODM_Package_Definition -{ - ODM_PACKAGE_DEFAULT = 0, - ODM_PACKAGE_QFN68 = BIT(0), - ODM_PACKAGE_TFBGA90 = BIT(1), - ODM_PACKAGE_TFBGA79 = BIT(2), -}ODM_Package_TYPE_E; - -typedef enum tag_ODM_TYPE_GPA_Definition -{ - TYPE_GPA0 = 0, - TYPE_GPA1 = BIT(1)|BIT(0) -}ODM_TYPE_GPA_E; - -typedef enum tag_ODM_TYPE_APA_Definition -{ - TYPE_APA0 = 0, - TYPE_APA1 = BIT(1)|BIT(0) -}ODM_TYPE_APA_E; - -typedef enum tag_ODM_TYPE_GLNA_Definition -{ - TYPE_GLNA0 = 0, - TYPE_GLNA1 = BIT(2)|BIT(0), - TYPE_GLNA2 = BIT(3)|BIT(1), - TYPE_GLNA3 = BIT(3)|BIT(2)|BIT(1)|BIT(0) -}ODM_TYPE_GLNA_E; - -typedef enum tag_ODM_TYPE_ALNA_Definition -{ - TYPE_ALNA0 = 0, - TYPE_ALNA1 = BIT(2)|BIT(0), - TYPE_ALNA2 = BIT(3)|BIT(1), - TYPE_ALNA3 = BIT(3)|BIT(2)|BIT(1)|BIT(0) -}ODM_TYPE_ALNA_E; - -// ODM_CMNINFO_ONE_PATH_CCA -typedef enum tag_CCA_Path -{ - ODM_CCA_2R = 0, - ODM_CCA_1R_A = 1, - ODM_CCA_1R_B = 2, -}ODM_CCA_PATH_E; - - -typedef struct _ODM_RA_Info_ -{ - u1Byte RateID; - u4Byte RateMask; - u4Byte RAUseRate; - u1Byte RateSGI; - u1Byte RssiStaRA; - u1Byte PreRssiStaRA; - u1Byte SGIEnable; - u1Byte DecisionRate; - u1Byte PreRate; - u1Byte HighestRate; - u1Byte LowestRate; - u4Byte NscUp; - u4Byte NscDown; - u2Byte RTY[5]; - u4Byte TOTAL; - u2Byte DROP; - u1Byte Active; - u2Byte RptTime; - u1Byte RAWaitingCounter; - u1Byte RAPendingCounter; -#if 1 //POWER_TRAINING_ACTIVE == 1 // For compile pass only~! - u1Byte PTActive; // on or off - u1Byte PTTryState; // 0 trying state, 1 for decision state - u1Byte PTStage; // 0~6 - u1Byte PTStopCount; //Stop PT counter - u1Byte PTPreRate; // if rate change do PT - u1Byte PTPreRssi; // if RSSI change 5% do PT - u1Byte PTModeSS; // decide whitch rate should do PT - u1Byte RAstage; // StageRA, decide how many times RA will be done between PT - u1Byte PTSmoothFactor; -#endif -} ODM_RA_INFO_T,*PODM_RA_INFO_T; - -typedef struct _IQK_MATRIX_REGS_SETTING{ - BOOLEAN bIQKDone; - s4Byte Value[3][IQK_Matrix_REG_NUM]; - BOOLEAN bBWIqkResultSaved[3]; -}IQK_MATRIX_REGS_SETTING,*PIQK_MATRIX_REGS_SETTING; - -#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) -typedef struct _PathDiv_Parameter_define_ -{ - u4Byte org_5g_RegE30; - u4Byte org_5g_RegC14; - u4Byte org_5g_RegCA0; - u4Byte swt_5g_RegE30; - u4Byte swt_5g_RegC14; - u4Byte swt_5g_RegCA0; - //for 2G IQK information - u4Byte org_2g_RegC80; - u4Byte org_2g_RegC4C; - u4Byte org_2g_RegC94; - u4Byte org_2g_RegC14; - u4Byte org_2g_RegCA0; - - u4Byte swt_2g_RegC80; - u4Byte swt_2g_RegC4C; - u4Byte swt_2g_RegC94; - u4Byte swt_2g_RegC14; - u4Byte swt_2g_RegCA0; -}PATHDIV_PARA,*pPATHDIV_PARA; -#endif - - -typedef struct ODM_RF_Calibration_Structure -{ - //for tx power tracking - - u4Byte RegA24; // for TempCCK - s4Byte RegE94; - s4Byte RegE9C; - s4Byte RegEB4; - s4Byte RegEBC; - - u1Byte TXPowercount; - BOOLEAN bTXPowerTrackingInit; - BOOLEAN bTXPowerTracking; - u1Byte TxPowerTrackControl; //for mp mode, turn off txpwrtracking as default - u1Byte TM_Trigger; - u1Byte InternalPA5G[2]; //pathA / pathB - - u1Byte ThermalMeter[2]; // ThermalMeter, index 0 for RFIC0, and 1 for RFIC1 - u1Byte ThermalValue; - u1Byte ThermalValue_LCK; - u1Byte ThermalValue_IQK; - u1Byte ThermalValue_DPK; - u1Byte ThermalValue_AVG[AVG_THERMAL_NUM]; - u1Byte ThermalValue_AVG_index; - u1Byte ThermalValue_RxGain; - u1Byte ThermalValue_Crystal; - u1Byte ThermalValue_DPKstore; - u1Byte ThermalValue_DPKtrack; - BOOLEAN TxPowerTrackingInProgress; - - BOOLEAN bReloadtxpowerindex; - u1Byte bRfPiEnable; - u4Byte TXPowerTrackingCallbackCnt; //cosa add for debug - - - //------------------------- Tx power Tracking -------------------------// - u1Byte bCCKinCH14; - u1Byte CCK_index; - u1Byte OFDM_index[MAX_RF_PATH]; - s1Byte PowerIndexOffset[MAX_RF_PATH]; - s1Byte DeltaPowerIndex[MAX_RF_PATH]; - s1Byte DeltaPowerIndexLast[MAX_RF_PATH]; - BOOLEAN bTxPowerChanged; - - u1Byte ThermalValue_HP[HP_THERMAL_NUM]; - u1Byte ThermalValue_HP_index; - IQK_MATRIX_REGS_SETTING IQKMatrixRegSetting[IQK_Matrix_Settings_NUM]; - BOOLEAN bNeedIQK; - BOOLEAN bIQKInProgress; - u1Byte Delta_IQK; - u1Byte Delta_LCK; - s1Byte BBSwingDiff2G, BBSwingDiff5G; // Unit: dB - u1Byte DeltaSwingTableIdx_2GCCKA_P[DELTA_SWINGIDX_SIZE]; - u1Byte DeltaSwingTableIdx_2GCCKA_N[DELTA_SWINGIDX_SIZE]; - u1Byte DeltaSwingTableIdx_2GCCKB_P[DELTA_SWINGIDX_SIZE]; - u1Byte DeltaSwingTableIdx_2GCCKB_N[DELTA_SWINGIDX_SIZE]; - u1Byte DeltaSwingTableIdx_2GA_P[DELTA_SWINGIDX_SIZE]; - u1Byte DeltaSwingTableIdx_2GA_N[DELTA_SWINGIDX_SIZE]; - u1Byte DeltaSwingTableIdx_2GB_P[DELTA_SWINGIDX_SIZE]; - u1Byte DeltaSwingTableIdx_2GB_N[DELTA_SWINGIDX_SIZE]; - u1Byte DeltaSwingTableIdx_5GA_P[BAND_NUM][DELTA_SWINGIDX_SIZE]; - u1Byte DeltaSwingTableIdx_5GA_N[BAND_NUM][DELTA_SWINGIDX_SIZE]; - u1Byte DeltaSwingTableIdx_5GB_P[BAND_NUM][DELTA_SWINGIDX_SIZE]; - u1Byte DeltaSwingTableIdx_5GB_N[BAND_NUM][DELTA_SWINGIDX_SIZE]; - u1Byte DeltaSwingTableIdx_2GA_P_8188E[DELTA_SWINGIDX_SIZE]; - u1Byte DeltaSwingTableIdx_2GA_N_8188E[DELTA_SWINGIDX_SIZE]; - - //--------------------------------------------------------------------// - - //for IQK - u4Byte RegC04; - u4Byte Reg874; - u4Byte RegC08; - u4Byte RegB68; - u4Byte RegB6C; - u4Byte Reg870; - u4Byte Reg860; - u4Byte Reg864; - - BOOLEAN bIQKInitialized; - BOOLEAN bLCKInProgress; - BOOLEAN bAntennaDetected; - u4Byte ADDA_backup[IQK_ADDA_REG_NUM]; - u4Byte IQK_MAC_backup[IQK_MAC_REG_NUM]; - u4Byte IQK_BB_backup_recover[9]; - u4Byte IQK_BB_backup[IQK_BB_REG_NUM]; - - //for APK - u4Byte APKoutput[2][2]; //path A/B; output1_1a/output1_2a - u1Byte bAPKdone; - u1Byte bAPKThermalMeterIgnore; - u1Byte bDPdone; - u1Byte bDPPathAOK; - u1Byte bDPPathBOK; - - u4Byte TxIQC_8723B[2][3][2]; // { {S1: 0xc94, 0xc80, 0xc4c} , {S0: 0xc9c, 0xc88, 0xc4c}} - u4Byte RxIQC_8723B[2][2][2]; // { {S1: 0xc14, 0xca0} , {S0: 0xc14, 0xca0}} - u4Byte TxLOK[2]; - -}ODM_RF_CAL_T,*PODM_RF_CAL_T; -// -// ODM Dynamic common info value definition -// - -typedef struct _FAST_ANTENNA_TRAINNING_ -{ - u1Byte Bssid[6]; - u1Byte antsel_rx_keep_0; - u1Byte antsel_rx_keep_1; - u1Byte antsel_rx_keep_2; - u4Byte antSumRSSI[7]; - u4Byte antRSSIcnt[7]; - u4Byte antAveRSSI[7]; - u1Byte FAT_State; - u4Byte TrainIdx; - u1Byte antsel_a[ODM_ASSOCIATE_ENTRY_NUM]; - u1Byte antsel_b[ODM_ASSOCIATE_ENTRY_NUM]; - u1Byte antsel_c[ODM_ASSOCIATE_ENTRY_NUM]; - u4Byte MainAnt_Sum[ODM_ASSOCIATE_ENTRY_NUM]; - u4Byte AuxAnt_Sum[ODM_ASSOCIATE_ENTRY_NUM]; - u4Byte MainAnt_Cnt[ODM_ASSOCIATE_ENTRY_NUM]; - u4Byte AuxAnt_Cnt[ODM_ASSOCIATE_ENTRY_NUM]; - u1Byte RxIdleAnt; - BOOLEAN bBecomeLinked; - u4Byte MinMaxRSSI; - u1Byte idx_AntDiv_counter_2G; - u1Byte idx_AntDiv_counter_5G; - u4Byte AntDiv_2G_5G; - u4Byte CCK_counter_main; - u4Byte CCK_counter_aux; - u4Byte OFDM_counter_main; - u4Byte OFDM_counter_aux; - -}FAT_T,*pFAT_T; - -typedef enum _FAT_STATE -{ - FAT_NORMAL_STATE = 0, - FAT_TRAINING_STATE = 1, -}FAT_STATE_E, *PFAT_STATE_E; - -typedef enum _ANT_DIV_TYPE -{ - NO_ANTDIV = 0xFF, - CG_TRX_HW_ANTDIV = 0x01, - CGCS_RX_HW_ANTDIV = 0x02, - FIXED_HW_ANTDIV = 0x03, - CG_TRX_SMART_ANTDIV = 0x04, - CGCS_RX_SW_ANTDIV = 0x05, - S0S1_SW_ANTDIV = 0x06 //8723B intrnal switch S0 S1 -}ANT_DIV_TYPE_E, *PANT_DIV_TYPE_E; - -typedef struct _ODM_PATH_DIVERSITY_ -{ - u1Byte RespTxPath; - u1Byte PathSel[ODM_ASSOCIATE_ENTRY_NUM]; - u4Byte PathA_Sum[ODM_ASSOCIATE_ENTRY_NUM]; - u4Byte PathB_Sum[ODM_ASSOCIATE_ENTRY_NUM]; - u4Byte PathA_Cnt[ODM_ASSOCIATE_ENTRY_NUM]; - u4Byte PathB_Cnt[ODM_ASSOCIATE_ENTRY_NUM]; -}PATHDIV_T, *pPATHDIV_T; - - -typedef enum _BASEBAND_CONFIG_PHY_REG_PG_VALUE_TYPE{ - PHY_REG_PG_RELATIVE_VALUE = 0, - PHY_REG_PG_EXACT_VALUE = 1 -} PHY_REG_PG_TYPE; - - -// -// Antenna detection information from single tone mechanism, added by Roger, 2012.11.27. -// -typedef struct _ANT_DETECTED_INFO{ - BOOLEAN bAntDetected; - u4Byte dBForAntA; - u4Byte dBForAntB; - u4Byte dBForAntO; -}ANT_DETECTED_INFO, *PANT_DETECTED_INFO; - -// -// 2011/09/22 MH Copy from SD4 defined structure. We use to support PHY DM integration. -// -#if(DM_ODM_SUPPORT_TYPE & ODM_WIN) -#if (RT_PLATFORM != PLATFORM_LINUX) -typedef -#endif -struct DM_Out_Source_Dynamic_Mechanism_Structure -#else// for AP,ADSL,CE Team -typedef struct DM_Out_Source_Dynamic_Mechanism_Structure -#endif -{ - //RT_TIMER FastAntTrainingTimer; - // - // Add for different team use temporarily - // - PADAPTER Adapter; // For CE/NIC team - prtl8192cd_priv priv; // For AP/ADSL team - // WHen you use Adapter or priv pointer, you must make sure the pointer is ready. - BOOLEAN odm_ready; - -#if(DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_WIN)) - rtl8192cd_priv fake_priv; -#endif -#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) - // ADSL_AP_BUILD_WORKAROUND - ADAPTER fake_adapter; -#endif - - PHY_REG_PG_TYPE PhyRegPgValueType; - u1Byte PhyRegPgVersion; - - u8Byte DebugComponents; - u4Byte DebugLevel; - - u8Byte NumQryPhyStatusAll; //CCK + OFDM - u8Byte LastNumQryPhyStatusAll; - u8Byte RxPWDBAve; - u8Byte RxPWDBAve_final; - BOOLEAN MPDIG_2G; //off MPDIG - u1Byte Times_2G; - -//------ ODM HANDLE, DRIVER NEEDS NOT TO HOOK------// - BOOLEAN bCckHighPower; - u1Byte RFPathRxEnable; // ODM_CMNINFO_RFPATH_ENABLE - u1Byte ControlChannel; -//------ ODM HANDLE, DRIVER NEEDS NOT TO HOOK------// - -//--------REMOVED COMMON INFO----------// - //u1Byte PseudoMacPhyMode; - //BOOLEAN *BTCoexist; - //BOOLEAN PseudoBtCoexist; - //u1Byte OPMode; - //BOOLEAN bAPMode; - //BOOLEAN bClientMode; - //BOOLEAN bAdHocMode; - //BOOLEAN bSlaveOfDMSP; -//--------REMOVED COMMON INFO----------// - - -//1 COMMON INFORMATION - - // - // Init Value - // -//-----------HOOK BEFORE REG INIT-----------// - // ODM Platform info AP/ADSL/CE/MP = 1/2/3/4 - u1Byte SupportPlatform; - // ODM Support Ability DIG/RATR/TX_PWR_TRACK/ KK = 1/2/3/K - u4Byte SupportAbility; - // ODM PCIE/USB/SDIO = 1/2/3 - u1Byte SupportInterface; - // ODM composite or independent. Bit oriented/ 92C+92D+ .... or any other type = 1/2/3/... - u4Byte SupportICType; - // Cut Version TestChip/A-cut/B-cut... = 0/1/2/3/... - u1Byte CutVersion; - // Fab Version TSMC/UMC = 0/1 - u1Byte FabVersion; - // RF Type 4T4R/3T3R/2T2R/1T2R/1T1R/... - u1Byte RFType; - u1Byte RFEType; - // Board Type Normal/HighPower/MiniCard/SLIM/Combo/... = 0/1/2/3/4/... - u1Byte BoardType; - u1Byte PackageType; - u1Byte TypeGLNA; - u1Byte TypeGPA; - u1Byte TypeALNA; - u1Byte TypeAPA; - // with external LNA NO/Yes = 0/1 - u1Byte ExtLNA; - u1Byte ExtLNA5G; - // with external PA NO/Yes = 0/1 - u1Byte ExtPA; - u1Byte ExtPA5G; - // with external TRSW NO/Yes = 0/1 - u1Byte ExtTRSW; - u1Byte PatchID; //Customer ID - BOOLEAN bInHctTest; - BOOLEAN bWIFITest; - - BOOLEAN bDualMacSmartConcurrent; - u4Byte BK_SupportAbility; - u1Byte AntDivType; -//-----------HOOK BEFORE REG INIT-----------// - - // - // Dynamic Value - // -//--------- POINTER REFERENCE-----------// - - u1Byte u1Byte_temp; - BOOLEAN BOOLEAN_temp; - PADAPTER PADAPTER_temp; - - // MAC PHY Mode SMSP/DMSP/DMDP = 0/1/2 - u1Byte *pMacPhyMode; - //TX Unicast byte count - u8Byte *pNumTxBytesUnicast; - //RX Unicast byte count - u8Byte *pNumRxBytesUnicast; - // Wireless mode B/G/A/N = BIT0/BIT1/BIT2/BIT3 - u1Byte *pWirelessMode; //ODM_WIRELESS_MODE_E - // Frequence band 2.4G/5G = 0/1 - u1Byte *pBandType; - // Secondary channel offset don't_care/below/above = 0/1/2 - u1Byte *pSecChOffset; - // Security mode Open/WEP/AES/TKIP = 0/1/2/3 - u1Byte *pSecurity; - // BW info 20M/40M/80M = 0/1/2 - u1Byte *pBandWidth; - // Central channel location Ch1/Ch2/.... - u1Byte *pChannel; //central channel number - BOOLEAN DPK_Done; - // Common info for 92D DMSP - - BOOLEAN *pbGetValueFromOtherMac; - PADAPTER *pBuddyAdapter; - BOOLEAN *pbMasterOfDMSP; //MAC0: master, MAC1: slave - // Common info for Status - BOOLEAN *pbScanInProcess; - BOOLEAN *pbPowerSaving; - // CCA Path 2-path/path-A/path-B = 0/1/2; using ODM_CCA_PATH_E. - u1Byte *pOnePathCCA; - //pMgntInfo->AntennaTest - u1Byte *pAntennaTest; - BOOLEAN *pbNet_closed; - u1Byte *mp_mode; - //u1Byte *pAidMap; - u1Byte *pu1ForcedIgiLb; -//--------- POINTER REFERENCE-----------// - pu2Byte pForcedDataRate; -//------------CALL BY VALUE-------------// - BOOLEAN bLinkInProcess; - BOOLEAN bWIFI_Direct; - BOOLEAN bWIFI_Display; - BOOLEAN bLinked; - - BOOLEAN bsta_state; - u1Byte RSSI_Min; - u1Byte InterfaceIndex; // Add for 92D dual MAC: 0--Mac0 1--Mac1 - BOOLEAN bIsMPChip; - BOOLEAN bOneEntryOnly; - // Common info for BTDM - BOOLEAN bBtDisabled; // BT is disabled - BOOLEAN bBtConnectProcess; // BT HS is under connection progress. - u1Byte btHsRssi; // BT HS mode wifi rssi value. - BOOLEAN bBtHsOperation; // BT HS mode is under progress - BOOLEAN bBtDisableEdcaTurbo; // Under some condition, don't enable the EDCA Turbo - BOOLEAN bBtLimitedDig; // BT is busy. -//------------CALL BY VALUE-------------// - u1Byte RSSI_A; - u1Byte RSSI_B; - u8Byte RSSI_TRSW; - u8Byte RSSI_TRSW_H; - u8Byte RSSI_TRSW_L; - u8Byte RSSI_TRSW_iso; - - u1Byte RxRate; - BOOLEAN StopDIG; - BOOLEAN bNoisyState; - u1Byte TxRate; - u1Byte LinkedInterval; - u1Byte preChannel; - u4Byte TxagcOffsetValueA; - BOOLEAN IsTxagcOffsetPositiveA; - u4Byte TxagcOffsetValueB; - BOOLEAN IsTxagcOffsetPositiveB; - u8Byte lastTxOkCnt; - u8Byte lastRxOkCnt; - u4Byte BbSwingOffsetA; - BOOLEAN IsBbSwingOffsetPositiveA; - u4Byte BbSwingOffsetB; - BOOLEAN IsBbSwingOffsetPositiveB; - s1Byte TH_L2H_ini; - s1Byte TH_EDCCA_HL_diff; - s1Byte IGI_Base; - u1Byte IGI_target; - BOOLEAN ForceEDCCA; - u1Byte AdapEn_RSSI; - s1Byte Force_TH_H; - s1Byte Force_TH_L; - u1Byte IGI_LowerBound; - u1Byte antdiv_rssi; - u1Byte AntType; - u1Byte pre_AntType; - u1Byte antdiv_period; - u1Byte antdiv_select; - //2 Define STA info. - // _ODM_STA_INFO - // 2012/01/12 MH For MP, we need to reduce one array pointer for default port.?? - PSTA_INFO_T pODM_StaInfo[ODM_ASSOCIATE_ENTRY_NUM]; - -#if (RATE_ADAPTIVE_SUPPORT == 1) - u2Byte CurrminRptTime; - ODM_RA_INFO_T RAInfo[ODM_ASSOCIATE_ENTRY_NUM]; //See HalMacID support -#endif - // - // 2012/02/14 MH Add to share 88E ra with other SW team. - // We need to colelct all support abilit to a proper area. - // - BOOLEAN RaSupport88E; - - // Define ........... - - // Latest packet phy info (ODM write) - ODM_PHY_DBG_INFO_T PhyDbgInfo; - //PHY_INFO_88E PhyInfo; - - // Latest packet phy info (ODM write) - ODM_MAC_INFO *pMacInfo; - //MAC_INFO_88E MacInfo; - - // Different Team independt structure?? - - // - //TX_RTP_CMN TX_retrpo; - //TX_RTP_88E TX_retrpo; - //TX_RTP_8195 TX_retrpo; - - // - //ODM Structure - // - FAT_T DM_FatTable; - DIG_T DM_DigTable; - PS_T DM_PSTable; - Pri_CCA_T DM_PriCCA; - RXHP_T DM_RXHP_Table; - RA_T DM_RA_Table; - FALSE_ALARM_STATISTICS FalseAlmCnt; - FALSE_ALARM_STATISTICS FlaseAlmCntBuddyAdapter; - //#ifdef CONFIG_ANTENNA_DIVERSITY - SWAT_T DM_SWAT_Table; - BOOLEAN RSSI_test; - //#endif - -#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) - //Path Div Struct - PATHDIV_PARA pathIQK; -#endif - - EDCA_T DM_EDCA_Table; - u4Byte WMMEDCA_BE; - PATHDIV_T DM_PathDiv; - // Copy from SD4 structure - // - // ================================================== - // - - //common - //u1Byte DM_Type; - //u1Byte PSD_Report_RXHP[80]; // Add By Gary - //u1Byte PSD_func_flag; // Add By Gary - //for DIG - //u1Byte bDMInitialGainEnable; - //u1Byte binitialized; // for dm_initial_gain_Multi_STA use. - //for Antenna diversity - //u8 AntDivCfg;// 0:OFF , 1:ON, 2:by efuse - //PSTA_INFO_T RSSI_target; - - BOOLEAN *pbDriverStopped; - BOOLEAN *pbDriverIsGoingToPnpSetPowerSleep; - BOOLEAN *pinit_adpt_in_progress; - - //PSD - BOOLEAN bUserAssignLevel; - RT_TIMER PSDTimer; - u1Byte RSSI_BT; //come from BT - BOOLEAN bPSDinProcess; - BOOLEAN bPSDactive; - BOOLEAN bDMInitialGainEnable; - - //MPT DIG - RT_TIMER MPT_DIGTimer; - - //for rate adaptive, in fact, 88c/92c fw will handle this - u1Byte bUseRAMask; - - ODM_RATE_ADAPTIVE RateAdaptive; - - ANT_DETECTED_INFO AntDetectedInfo; // Antenna detected information for RSSI tool - - ODM_RF_CAL_T RFCalibrateInfo; - - // - // TX power tracking - // - u1Byte BbSwingIdxOfdm[MAX_RF_PATH]; - u1Byte BbSwingIdxOfdmCurrent; - u1Byte BbSwingIdxOfdmBase[MAX_RF_PATH]; - BOOLEAN BbSwingFlagOfdm; - u1Byte BbSwingIdxCck; - u1Byte BbSwingIdxCckCurrent; - u1Byte BbSwingIdxCckBase; - u1Byte DefaultOfdmIndex; - u1Byte DefaultCckIndex; - BOOLEAN BbSwingFlagCck; - - s1Byte Absolute_OFDMSwingIdx[MAX_RF_PATH]; - s1Byte Remnant_OFDMSwingIdx[MAX_RF_PATH]; - s1Byte Remnant_CCKSwingIdx; - s1Byte Modify_TxAGC_Value; //Remnat compensate value at TxAGC - BOOLEAN Modify_TxAGC_Flag_PathA; - BOOLEAN Modify_TxAGC_Flag_PathB; - BOOLEAN Modify_TxAGC_Flag_PathA_CCK; - - // - // Dynamic ATC switch - // - BOOLEAN bATCStatus; - BOOLEAN largeCFOHit; - BOOLEAN bIsfreeze; - int CFO_tail[2]; - int CFO_ave_pre; - int CrystalCap; - u1Byte CFOThreshold; - u4Byte packetCount; - u4Byte packetCount_pre; - - // - // ODM system resource. - // - - // ODM relative time. - RT_TIMER PathDivSwitchTimer; - //2011.09.27 add for Path Diversity - RT_TIMER CCKPathDiversityTimer; - RT_TIMER FastAntTrainingTimer; - - // ODM relative workitem. -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - #if USE_WORKITEM - RT_WORK_ITEM PathDivSwitchWorkitem; - RT_WORK_ITEM CCKPathDiversityWorkitem; - RT_WORK_ITEM FastAntTrainingWorkitem; - RT_WORK_ITEM MPT_DIGWorkitem; - RT_WORK_ITEM RaRptWorkitem; - #endif -#endif - -#if(DM_ODM_SUPPORT_TYPE & ODM_WIN) - -#if (RT_PLATFORM != PLATFORM_LINUX) -} DM_ODM_T, *PDM_ODM_T; // DM_Dynamic_Mechanism_Structure -#else -}; -#endif - -#else// for AP,ADSL,CE Team -} DM_ODM_T, *PDM_ODM_T; // DM_Dynamic_Mechanism_Structure -#endif - - - -#if 1 //92c-series -#define ODM_RF_PATH_MAX 2 -#else //jaguar - series -#define ODM_RF_PATH_MAX 4 -#endif - -typedef enum _ODM_RF_RADIO_PATH { - ODM_RF_PATH_A = 0, //Radio Path A - ODM_RF_PATH_B = 1, //Radio Path B - ODM_RF_PATH_C = 2, //Radio Path C - ODM_RF_PATH_D = 3, //Radio Path D - ODM_RF_PATH_AB, - ODM_RF_PATH_AC, - ODM_RF_PATH_AD, - ODM_RF_PATH_BC, - ODM_RF_PATH_BD, - ODM_RF_PATH_CD, - ODM_RF_PATH_ABC, - ODM_RF_PATH_ACD, - ODM_RF_PATH_BCD, - ODM_RF_PATH_ABCD, - // ODM_RF_PATH_MAX, //Max RF number 90 support -} ODM_RF_RADIO_PATH_E, *PODM_RF_RADIO_PATH_E; - - typedef enum _ODM_RF_CONTENT{ - odm_radioa_txt = 0x1000, - odm_radiob_txt = 0x1001, - odm_radioc_txt = 0x1002, - odm_radiod_txt = 0x1003 -} ODM_RF_CONTENT; - -typedef enum _ODM_BB_Config_Type{ - CONFIG_BB_PHY_REG, - CONFIG_BB_AGC_TAB, - CONFIG_BB_AGC_TAB_2G, - CONFIG_BB_AGC_TAB_5G, - CONFIG_BB_PHY_REG_PG, - CONFIG_BB_PHY_REG_MP, - CONFIG_BB_AGC_TAB_DIFF, -} ODM_BB_Config_Type, *PODM_BB_Config_Type; - -typedef enum _ODM_RF_Config_Type{ - CONFIG_RF_RADIO, - CONFIG_RF_TXPWR_LMT, -} ODM_RF_Config_Type, *PODM_RF_Config_Type; - -typedef enum _ODM_FW_Config_Type{ - CONFIG_FW_NIC, - CONFIG_FW_NIC_2, - CONFIG_FW_AP, - CONFIG_FW_MP, - CONFIG_FW_WoWLAN, - CONFIG_FW_WoWLAN_2, - CONFIG_FW_AP_WoWLAN, - CONFIG_FW_BT, -} ODM_FW_Config_Type; - -// Status code -#if (DM_ODM_SUPPORT_TYPE != ODM_WIN) -typedef enum _RT_STATUS{ - RT_STATUS_SUCCESS, - RT_STATUS_FAILURE, - RT_STATUS_PENDING, - RT_STATUS_RESOURCE, - RT_STATUS_INVALID_CONTEXT, - RT_STATUS_INVALID_PARAMETER, - RT_STATUS_NOT_SUPPORT, - RT_STATUS_OS_API_FAILED, -}RT_STATUS,*PRT_STATUS; -#endif // end of RT_STATUS definition - -#ifdef REMOVE_PACK -#pragma pack() -#endif - -//#include "odm_function.h" - -//3=========================================================== -//3 DIG -//3=========================================================== - -typedef enum tag_Dynamic_Init_Gain_Operation_Type_Definition -{ - DIG_TYPE_THRESH_HIGH = 0, - DIG_TYPE_THRESH_LOW = 1, - DIG_TYPE_BACKOFF = 2, - DIG_TYPE_RX_GAIN_MIN = 3, - DIG_TYPE_RX_GAIN_MAX = 4, - DIG_TYPE_ENABLE = 5, - DIG_TYPE_DISABLE = 6, - DIG_OP_TYPE_MAX -}DM_DIG_OP_E; -/* -typedef enum tag_CCK_Packet_Detection_Threshold_Type_Definition -{ - CCK_PD_STAGE_LowRssi = 0, - CCK_PD_STAGE_HighRssi = 1, - CCK_PD_STAGE_MAX = 3, -}DM_CCK_PDTH_E; - -typedef enum tag_DIG_EXT_PORT_ALGO_Definition -{ - DIG_EXT_PORT_STAGE_0 = 0, - DIG_EXT_PORT_STAGE_1 = 1, - DIG_EXT_PORT_STAGE_2 = 2, - DIG_EXT_PORT_STAGE_3 = 3, - DIG_EXT_PORT_STAGE_MAX = 4, -}DM_DIG_EXT_PORT_ALG_E; - -typedef enum tag_DIG_Connect_Definition -{ - DIG_STA_DISCONNECT = 0, - DIG_STA_CONNECT = 1, - DIG_STA_BEFORE_CONNECT = 2, - DIG_MultiSTA_DISCONNECT = 3, - DIG_MultiSTA_CONNECT = 4, - DIG_CONNECT_MAX -}DM_DIG_CONNECT_E; - - -#define DM_MultiSTA_InitGainChangeNotify(Event) {DM_DigTable.CurMultiSTAConnectState = Event;} - -#define DM_MultiSTA_InitGainChangeNotify_CONNECT(_ADAPTER) \ - DM_MultiSTA_InitGainChangeNotify(DIG_MultiSTA_CONNECT) - -#define DM_MultiSTA_InitGainChangeNotify_DISCONNECT(_ADAPTER) \ - DM_MultiSTA_InitGainChangeNotify(DIG_MultiSTA_DISCONNECT) -*/ -#define DM_DIG_THRESH_HIGH 40 -#define DM_DIG_THRESH_LOW 35 - -#define DM_FALSEALARM_THRESH_LOW 400 -#define DM_FALSEALARM_THRESH_HIGH 1000 - -#define DM_DIG_MAX_NIC 0x3e -#define DM_DIG_MIN_NIC 0x1e //0x22//0x1c - -#define DM_DIG_MAX_AP 0x32 -#define DM_DIG_MIN_AP 0x20 - -#define DM_DIG_MAX_NIC_HP 0x46 -#define DM_DIG_MIN_NIC_HP 0x2e - -#define DM_DIG_MAX_AP_HP 0x42 -#define DM_DIG_MIN_AP_HP 0x30 - -//vivi 92c&92d has different definition, 20110504 -//this is for 92c -#ifdef CONFIG_SPECIAL_SETTING_FOR_FUNAI_TV -#define DM_DIG_FA_TH0 0x80//0x20 -#else -#define DM_DIG_FA_TH0 0x200//0x20 -#endif -#define DM_DIG_FA_TH1 0x300//0x100 -#define DM_DIG_FA_TH2 0x400//0x200 -//this is for 92d -#define DM_DIG_FA_TH0_92D 0x100 -#define DM_DIG_FA_TH1_92D 0x400 -#define DM_DIG_FA_TH2_92D 0x600 - -#define DM_DIG_BACKOFF_MAX 12 -#define DM_DIG_BACKOFF_MIN -4 -#define DM_DIG_BACKOFF_DEFAULT 10 - -//3=========================================================== -//3 AGC RX High Power Mode -//3=========================================================== -#define LNA_Low_Gain_1 0x64 -#define LNA_Low_Gain_2 0x5A -#define LNA_Low_Gain_3 0x58 - -#define FA_RXHP_TH1 5000 -#define FA_RXHP_TH2 1500 -#define FA_RXHP_TH3 800 -#define FA_RXHP_TH4 600 -#define FA_RXHP_TH5 500 - -//3=========================================================== -//3 EDCA -//3=========================================================== - -//3=========================================================== -//3 Dynamic Tx Power -//3=========================================================== -//Dynamic Tx Power Control Threshold -#define TX_POWER_NEAR_FIELD_THRESH_LVL2 74 -#define TX_POWER_NEAR_FIELD_THRESH_LVL1 67 -#define TX_POWER_NEAR_FIELD_THRESH_AP 0x3F - -#define TxHighPwrLevel_Normal 0 -#define TxHighPwrLevel_Level1 1 -#define TxHighPwrLevel_Level2 2 -#define TxHighPwrLevel_BT1 3 -#define TxHighPwrLevel_BT2 4 -#define TxHighPwrLevel_15 5 -#define TxHighPwrLevel_35 6 -#define TxHighPwrLevel_50 7 -#define TxHighPwrLevel_70 8 -#define TxHighPwrLevel_100 9 - -//3=========================================================== -//3 Tx Power Tracking -//3=========================================================== -#if 0 //mask this, since these have been defined in typdef.h, vivi -#define OFDM_TABLE_SIZE 43 -#define CCK_TABLE_SIZE 33 -#endif - - -//3=========================================================== -//3 Rate Adaptive -//3=========================================================== -#define DM_RATR_STA_INIT 0 -#define DM_RATR_STA_HIGH 1 -#define DM_RATR_STA_MIDDLE 2 -#define DM_RATR_STA_LOW 3 - -//3=========================================================== -//3 BB Power Save -//3=========================================================== - - -//3=========================================================== -//3 Dynamic ATC switch -//3=========================================================== -#define ATC_Status_Off 0x0 // enable -#define ATC_Status_On 0x1 // disable -#define CFO_Threshold_Xtal 10 // kHz -#define CFO_Threshold_ATC 80 // kHz - -typedef enum tag_1R_CCA_Type_Definition -{ - CCA_1R =0, - CCA_2R = 1, - CCA_MAX = 2, -}DM_1R_CCA_E; - -typedef enum tag_RF_Type_Definition -{ - RF_Save =0, - RF_Normal = 1, - RF_MAX = 2, -}DM_RF_E; - -//3=========================================================== -//3 Antenna Diversity -//3=========================================================== -typedef enum tag_SW_Antenna_Switch_Definition -{ - Antenna_A = 1, - Antenna_B = 2, - Antenna_MAX = 3, -}DM_SWAS_E; - - -// Maximal number of antenna detection mechanism needs to perform, added by Roger, 2011.12.28. -#define MAX_ANTENNA_DETECTION_CNT 10 - -// -// Extern Global Variables. -// -extern u4Byte OFDMSwingTable[OFDM_TABLE_SIZE]; -extern u1Byte CCKSwingTable_Ch1_Ch13[CCK_TABLE_SIZE][8]; -extern u1Byte CCKSwingTable_Ch14 [CCK_TABLE_SIZE][8]; - -extern u4Byte OFDMSwingTable_New[OFDM_TABLE_SIZE]; -extern u1Byte CCKSwingTable_Ch1_Ch13_New[CCK_TABLE_SIZE][8]; -extern u1Byte CCKSwingTable_Ch14_New [CCK_TABLE_SIZE][8]; - -extern u4Byte TxScalingTable_Jaguar[TXSCALE_TABLE_SIZE]; - -// <20121018, Kordan> In case fail to read TxPowerTrack.txt, we use the table of 88E as the default table. -static u1Byte DeltaSwingTableIdx_2GA_P_8188E[] = {0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9}; -static u1Byte DeltaSwingTableIdx_2GA_N_8188E[] = {0, 0, 0, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5, 6, 6, 7, 7, 7, 7, 8, 8, 9, 9, 10, 10, 10, 11, 11, 11, 11}; - -// -// check Sta pointer valid or not -// -#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) -#define IS_STA_VALID(pSta) (pSta && pSta->expire_to) -#elif (DM_ODM_SUPPORT_TYPE & ODM_WIN) -#define IS_STA_VALID(pSta) (pSta && pSta->bUsed) -#else -#define IS_STA_VALID(pSta) (pSta) -#endif -// 20100514 Joseph: Add definition for antenna switching test after link. -// This indicates two different the steps. -// In SWAW_STEP_PEAK, driver needs to switch antenna and listen to the signal on the air. -// In SWAW_STEP_DETERMINE, driver just compares the signal captured in SWAW_STEP_PEAK -// with original RSSI to determine if it is necessary to switch antenna. -#define SWAW_STEP_PEAK 0 -#define SWAW_STEP_DETERMINE 1 - -VOID ODM_Write_DIG(IN PDM_ODM_T pDM_Odm, IN u1Byte CurrentIGI); -VOID ODM_Write_CCK_CCA_Thres(IN PDM_ODM_T pDM_Odm, IN u1Byte CurCCK_CCAThres); - -VOID -ODM_SetAntenna( - IN PDM_ODM_T pDM_Odm, - IN u1Byte Antenna); - - -#define dm_RF_Saving ODM_RF_Saving -void ODM_RF_Saving( IN PDM_ODM_T pDM_Odm, - IN u1Byte bForceInNormal ); - -#define SwAntDivRestAfterLink ODM_SwAntDivRestAfterLink -VOID ODM_SwAntDivRestAfterLink( IN PDM_ODM_T pDM_Odm); - -#define dm_CheckTXPowerTracking ODM_TXPowerTrackingCheck -VOID -ODM_TXPowerTrackingCheck( - IN PDM_ODM_T pDM_Odm - ); - -BOOLEAN -ODM_RAStateCheck( - IN PDM_ODM_T pDM_Odm, - IN s4Byte RSSI, - IN BOOLEAN bForceUpdate, - OUT pu1Byte pRATRState - ); - -#if(DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_AP|ODM_ADSL)) -//============================================================ -// function prototype -//============================================================ -//#define DM_ChangeDynamicInitGainThresh ODM_ChangeDynamicInitGainThresh -//void ODM_ChangeDynamicInitGainThresh(IN PADAPTER pAdapter, -// IN INT32 DM_Type, -// IN INT32 DM_Value); -VOID -ODM_ChangeDynamicInitGainThresh( - IN PDM_ODM_T pDM_Odm, - IN u4Byte DM_Type, - IN u4Byte DM_Value - ); - -BOOLEAN -ODM_CheckPowerStatus( - IN PADAPTER Adapter - ); - - -#if (DM_ODM_SUPPORT_TYPE != ODM_ADSL) -VOID -ODM_RateAdaptiveStateApInit( - IN PADAPTER Adapter , - IN PRT_WLAN_STA pEntry - ); -#endif -#define AP_InitRateAdaptiveState ODM_RateAdaptiveStateApInit - - -#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) -#ifdef WIFI_WMM -VOID -ODM_IotEdcaSwitch( - IN PDM_ODM_T pDM_Odm, - IN unsigned char enable - ); -#endif - -BOOLEAN -ODM_ChooseIotMainSTA( - IN PDM_ODM_T pDM_Odm, - IN PSTA_INFO_T pstat - ); -#endif - -#if(DM_ODM_SUPPORT_TYPE==ODM_AP) -#ifdef HW_ANT_SWITCH -u1Byte -ODM_Diversity_AntennaSelect( - IN PDM_ODM_T pDM_Odm, - IN u1Byte *data -); -#endif -#endif - -#define SwAntDivResetBeforeLink ODM_SwAntDivResetBeforeLink -VOID ODM_SwAntDivResetBeforeLink(IN PDM_ODM_T pDM_Odm); - -#define SwAntDivCheckBeforeLink ODM_SwAntDivCheckBeforeLink - -BOOLEAN -ODM_SwAntDivCheckBeforeLink( - IN PDM_ODM_T pDM_Odm - ); - - -#endif - -#define dm_SWAW_RSSI_Check ODM_SwAntDivChkPerPktRssi -VOID ODM_SwAntDivChkPerPktRssi( - IN PDM_ODM_T pDM_Odm, - IN u1Byte StationID, - IN PODM_PHY_INFO_T pPhyInfo - ); - -#if((DM_ODM_SUPPORT_TYPE==ODM_WIN)||(DM_ODM_SUPPORT_TYPE==ODM_CE)) - -u4Byte ConvertTo_dB(u4Byte Value); - -u4Byte -GetPSDData( - PDM_ODM_T pDM_Odm, - unsigned int point, - u1Byte initial_gain_psd); - -#endif - -#if (DM_ODM_SUPPORT_TYPE == ODM_CE) - -VOID -odm_DIGbyRSSI_LPS( - IN PDM_ODM_T pDM_Odm - ); - -u4Byte ODM_Get_Rate_Bitmap( - IN PDM_ODM_T pDM_Odm, - IN u4Byte macid, - IN u4Byte ra_mask, - IN u1Byte rssi_level); - -#endif - - -#if(DM_ODM_SUPPORT_TYPE & (ODM_WIN)) -#define dm_PSDMonitorCallback odm_PSDMonitorCallback -VOID odm_PSDMonitorCallback(PRT_TIMER pTimer); - -VOID -odm_PSDMonitorWorkItemCallback( - IN PVOID pContext - ); - -VOID -ODM_MPT_DIG( - IN PDM_ODM_T pDM_Odm -); - -VOID -PatchDCTone( - IN PDM_ODM_T pDM_Odm, - pu4Byte PSD_report, - u1Byte initial_gain_psd -); -VOID -ODM_PSDMonitor( - IN PDM_ODM_T pDM_Odm - ); -VOID odm_PSD_Monitor(PDM_ODM_T pDM_Odm); -VOID odm_PSDMonitorInit(PDM_ODM_T pDM_Odm); - -VOID -ODM_PSDDbgControl( - IN PADAPTER Adapter, - IN u4Byte mode, - IN u4Byte btRssi - ); - -#endif // DM_ODM_SUPPORT_TYPE - - -#if (BEAMFORMING_SUPPORT == 1) -BEAMFORMING_CAP -Beamforming_GetEntryBeamCapByMacId( - IN PMGNT_INFO pMgntInfo, - IN u1Byte MacId - ); -#endif - - - -VOID ODM_DMInit( IN PDM_ODM_T pDM_Odm); - -VOID -ODM_DMWatchdog( - IN PDM_ODM_T pDM_Odm // For common use in the future - ); - -VOID -ODM_CmnInfoInit( - IN PDM_ODM_T pDM_Odm, - IN ODM_CMNINFO_E CmnInfo, - IN u4Byte Value - ); - -VOID -ODM_CmnInfoHook( - IN PDM_ODM_T pDM_Odm, - IN ODM_CMNINFO_E CmnInfo, - IN PVOID pValue - ); - -VOID -ODM_CmnInfoPtrArrayHook( - IN PDM_ODM_T pDM_Odm, - IN ODM_CMNINFO_E CmnInfo, - IN u2Byte Index, - IN PVOID pValue - ); - -VOID -ODM_CmnInfoUpdate( - IN PDM_ODM_T pDM_Odm, - IN u4Byte CmnInfo, - IN u8Byte Value - ); - -VOID -ODM_InitAllTimers( - IN PDM_ODM_T pDM_Odm - ); - -VOID -ODM_CancelAllTimers( - IN PDM_ODM_T pDM_Odm - ); - -VOID -ODM_ReleaseAllTimers( - IN PDM_ODM_T pDM_Odm - ); - -VOID -ODM_ResetIQKResult( - IN PDM_ODM_T pDM_Odm - ); - - -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) -VOID ODM_InitAllWorkItems(IN PDM_ODM_T pDM_Odm ); -VOID ODM_FreeAllWorkItems(IN PDM_ODM_T pDM_Odm ); - -VOID odm_PathDivChkAntSwitch(PDM_ODM_T pDM_Odm); -VOID ODM_PathDivRestAfterLink( - IN PDM_ODM_T pDM_Odm - ); - - -//===========================================// -// Neil Chen----2011--06--15-- - -//3 Path Diversity -//=========================================================== - -#define TP_MODE 0 -#define RSSI_MODE 1 -#define TRAFFIC_LOW 0 -#define TRAFFIC_HIGH 1 - -//#define PATHDIV_ENABLE 1 - -//VOID odm_PathDivChkAntSwitch(PADAPTER Adapter,u1Byte Step); -VOID ODM_PathDivRestAfterLink( - IN PDM_ODM_T pDM_Odm - ); - -#define dm_PathDiv_RSSI_Check ODM_PathDivChkPerPktRssi -VOID ODM_PathDivChkPerPktRssi(PADAPTER Adapter, - BOOLEAN bIsDefPort, - BOOLEAN bMatchBSSID, - PRT_WLAN_STA pEntry, - PRT_RFD pRfd ); - -u8Byte -PlatformDivision64( - IN u8Byte x, - IN u8Byte y -); - - -// 20100514 Joseph: Add definition for antenna switching test after link. -// This indicates two different the steps. -// In SWAW_STEP_PEAK, driver needs to switch antenna and listen to the signal on the air. -// In SWAW_STEP_DETERMINE, driver just compares the signal captured in SWAW_STEP_PEAK -// with original RSSI to determine if it is necessary to switch antenna. -#define SWAW_STEP_PEAK 0 -#define SWAW_STEP_DETERMINE 1 - -//==================================================== -//3 PathDiV End -//==================================================== - -#define PathDivCheckBeforeLink8192C ODM_PathDiversityBeforeLink92C -BOOLEAN -ODM_PathDiversityBeforeLink92C( - //IN PADAPTER Adapter - IN PDM_ODM_T pDM_Odm - ); - -#define DM_ChangeDynamicInitGainThresh ODM_ChangeDynamicInitGainThresh -//void ODM_ChangeDynamicInitGainThresh(IN PADAPTER pAdapter, -// IN INT32 DM_Type, -// IN INT32 DM_Value); -// - - -VOID -ODM_CCKPathDiversityChkPerPktRssi( - PADAPTER Adapter, - BOOLEAN bIsDefPort, - BOOLEAN bMatchBSSID, - PRT_WLAN_STA pEntry, - PRT_RFD pRfd, - pu1Byte pDesc - ); - - -typedef enum tag_DIG_Connect_Definition -{ - DIG_STA_DISCONNECT = 0, - DIG_STA_CONNECT = 1, - DIG_STA_BEFORE_CONNECT = 2, - DIG_MultiSTA_DISCONNECT = 3, - DIG_MultiSTA_CONNECT = 4, - DIG_CONNECT_MAX -}DM_DIG_CONNECT_E; - - -VOID -ODM_FillTXPathInTXDESC( - IN PADAPTER Adapter, - IN PRT_TCB pTcb, - IN pu1Byte pDesc -); - - -#define dm_SWAW_RSSI_Check ODM_SwAntDivChkPerPktRssi - -// -// 2012/01/12 MH Check afapter status. Temp fix BSOD. -// -#define HAL_ADAPTER_STS_CHK(pDM_Odm)\ - if (pDM_Odm->Adapter == NULL)\ - {\ - return;\ - }\ - - -// -// For new definition in MP temporarily fro power tracking, -// -#define odm_TXPowerTrackingDirectCall(_Adapter) \ - IS_HARDWARE_TYPE_8192D(_Adapter) ? odm_TXPowerTrackingCallback_ThermalMeter_92D(_Adapter) : \ - IS_HARDWARE_TYPE_8192C(_Adapter) ? odm_TXPowerTrackingCallback_ThermalMeter_92C(_Adapter) : \ - IS_HARDWARE_TYPE_8723A(_Adapter) ? odm_TXPowerTrackingCallback_ThermalMeter_8723A(_Adapter) :\ - ODM_TXPowerTrackingCallback_ThermalMeter(_Adapter) - -VOID -ODM_SetTxAntByTxInfo_88C_92D( - IN PDM_ODM_T pDM_Odm, - IN pu1Byte pDesc, - IN u1Byte macId - ); - -#endif // #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) -VOID -ODM_AntselStatistics_88C( - IN PDM_ODM_T pDM_Odm, - IN u1Byte MacId, - IN u4Byte PWDBAll, - IN BOOLEAN isCCKrate -); - -#if( DM_ODM_SUPPORT_TYPE & (ODM_WIN |ODM_CE)) - -VOID -ODM_SingleDualAntennaDefaultSetting( - IN PDM_ODM_T pDM_Odm - ); - -BOOLEAN -ODM_SingleDualAntennaDetection( - IN PDM_ODM_T pDM_Odm, - IN u1Byte mode - ); - -VOID -ODM_DynamicATCSwitch( - IN PDM_ODM_T pDM_Odm -); - - -#endif // #if((DM_ODM_SUPPORT_TYPE==ODM_WIN)||(DM_ODM_SUPPORT_TYPE==ODM_CE)) -VOID -ODM_UpdateNoisyState( - IN PDM_ODM_T pDM_Odm, - IN BOOLEAN bNoisyStateFromC2H -); - -u4Byte -Set_RA_DM_Ratrbitmap_by_Noisy( - IN PDM_ODM_T pDM_Odm, - IN WIRELESS_MODE WirelessMode, - IN u4Byte ratr_bitmap, - IN u1Byte rssi_level -); - -VOID -ODM_UpdateInitRate( - IN PDM_ODM_T pDM_Odm, - IN u1Byte Rate - ); - -VOID -ODM_DynamicARFBSelect( - IN PDM_ODM_T pDM_Odm, - IN u1Byte rate, - IN BOOLEAN Collision_State - ); - -#if (DM_ODM_SUPPORT_TYPE == ODM_CE) -void odm_dtc(PDM_ODM_T pDM_Odm); -#endif /* #if (DM_ODM_SUPPORT_TYPE == ODM_CE) */ - -#endif - diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_AntDiv.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_AntDiv.c deleted file mode 100755 index 4b361e2c5d5ec6..00000000000000 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_AntDiv.c +++ /dev/null @@ -1,2269 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * - ******************************************************************************/ - -//============================================================ -// include files -//============================================================ - -#include "odm_precomp.h" - -#if (defined(CONFIG_HW_ANTENNA_DIVERSITY)) -VOID -odm_AntDiv_on_off( IN PDM_ODM_T pDM_Odm ,IN u1Byte swch) -{ - if(pDM_Odm->AntDivType==S0S1_SW_ANTDIV || pDM_Odm->AntDivType==CGCS_RX_SW_ANTDIV) - return; - - if(pDM_Odm->SupportICType & ODM_N_ANTDIV_SUPPORT) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("(( Turn %s )) N-Series AntDiv Function\n",(swch==ANTDIV_ON)?"ON" : "OFF")); - ODM_SetBBReg(pDM_Odm, 0xc50 , BIT7, swch); //OFDM AntDiv function block enable - ODM_SetBBReg(pDM_Odm, 0xa00 , BIT15, swch); //CCK AntDiv function block enable - } - else if(pDM_Odm->SupportICType & ODM_AC_ANTDIV_SUPPORT) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("(( Turn %s )) AC-Series AntDiv Function\n",(swch==ANTDIV_ON)?"ON" : "OFF")); - if(pDM_Odm->SupportICType == ODM_RTL8812) - { - ODM_SetBBReg(pDM_Odm, 0xc50 , BIT7, swch); //OFDM AntDiv function block enable - ODM_SetBBReg(pDM_Odm, 0xa00 , BIT15, swch); //CCK AntDiv function block enable - } - else - { - ODM_SetBBReg(pDM_Odm, 0x8D4 , BIT24, swch); //OFDM AntDiv function block enable - ODM_SetBBReg(pDM_Odm, 0x800 , BIT25, swch); //CCK AntDiv function block enable - } - } -} - -VOID -ODM_UpdateRxIdleAnt(IN PDM_ODM_T pDM_Odm, IN u1Byte Ant) -{ - pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; - u4Byte DefaultAnt, OptionalAnt,value32; - - #if (DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_WIN)) - PADAPTER pAdapter = pDM_Odm->Adapter; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); - #endif - - if(pDM_FatTable->RxIdleAnt != Ant) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ Update Rx-Idle-Ant ] RxIdleAnt =%s\n",(Ant==MAIN_ANT)?"MAIN_ANT":"AUX_ANT")); - pDM_FatTable->RxIdleAnt = Ant; - - if(Ant == MAIN_ANT) - { - DefaultAnt = ANT1_2G; - OptionalAnt = ANT2_2G; - } - else - { - DefaultAnt = ANT2_2G; - OptionalAnt = ANT1_2G; - } - - if(pDM_Odm->SupportICType & ODM_N_ANTDIV_SUPPORT) - { - if(pDM_Odm->SupportICType==ODM_RTL8192E) - { - ODM_SetBBReg(pDM_Odm, 0xB38 , BIT5|BIT4|BIT3, DefaultAnt); //Default RX - ODM_SetBBReg(pDM_Odm, 0xB38 , BIT8|BIT7|BIT6, OptionalAnt);//Optional RX - } - else - { - ODM_SetBBReg(pDM_Odm, 0x864 , BIT5|BIT4|BIT3, DefaultAnt); //Default RX - ODM_SetBBReg(pDM_Odm, 0x864 , BIT8|BIT7|BIT6, OptionalAnt); //Optional RX - - if(pDM_Odm->SupportICType == ODM_RTL8723B) - { - value32 = ODM_GetBBReg(pDM_Odm, 0x948, 0xFFF); - - if (value32 !=0x280) - ODM_SetBBReg(pDM_Odm, 0x948 , BIT9, DefaultAnt); - - rtw_hal_set_tx_power_level(pAdapter, pHalData->CurrentChannel); - } - - } - ODM_SetBBReg(pDM_Odm, 0x860, BIT14|BIT13|BIT12, DefaultAnt); //Default TX - } - else if(pDM_Odm->SupportICType & ODM_AC_ANTDIV_SUPPORT) - { - ODM_SetBBReg(pDM_Odm, 0xC08 , BIT21|BIT20|BIT19, DefaultAnt); //Default RX - ODM_SetBBReg(pDM_Odm, 0xC08 , BIT24|BIT23|BIT22, OptionalAnt);//Optional RX - ODM_SetBBReg(pDM_Odm, 0xC08 , BIT27|BIT26|BIT25, DefaultAnt); //Default TX - } - ODM_SetMACReg(pDM_Odm, 0x6D8 , BIT10|BIT9|BIT8, DefaultAnt); //PathA Resp Tx - } - else// pDM_FatTable->RxIdleAnt == Ant - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ Stay in Ori-Ant ] RxIdleAnt =%s\n",(Ant==MAIN_ANT)?"MAIN_ANT":"AUX_ANT")); - pDM_FatTable->RxIdleAnt = Ant; - } -} - - -VOID -odm_UpdateTxAnt(IN PDM_ODM_T pDM_Odm, IN u1Byte Ant, IN u4Byte MacId) -{ - pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; - u1Byte TxAnt; - - if(Ant == MAIN_ANT) - TxAnt = ANT1_2G; - else - TxAnt = ANT2_2G; - - pDM_FatTable->antsel_a[MacId] = TxAnt&BIT0; - pDM_FatTable->antsel_b[MacId] = (TxAnt&BIT1)>>1; - pDM_FatTable->antsel_c[MacId] = (TxAnt&BIT2)>>2; - #if (DM_ODM_SUPPORT_TYPE == ODM_AP) - if (pDM_Odm->antdiv_rssi) - { - //panic_printk("[Tx from TxInfo]: MacID:(( %d )), TxAnt = (( %s ))\n",MacId,(Ant==MAIN_ANT)?"MAIN_ANT":"AUX_ANT"); - //panic_printk("antsel_tr_mux=(( 3'b%d%d%d ))\n", pDM_FatTable->antsel_c[MacId] , pDM_FatTable->antsel_b[MacId] , pDM_FatTable->antsel_a[MacId] ); - } - #endif - //ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[Tx from TxInfo]: MacID:(( %d )), TxAnt = (( %s ))\n", - // MacId,(Ant==MAIN_ANT)?"MAIN_ANT":"AUX_ANT")); - //ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("antsel_tr_mux=(( 3'b%d%d%d ))\n", - //pDM_FatTable->antsel_c[MacId] , pDM_FatTable->antsel_b[MacId] , pDM_FatTable->antsel_a[MacId] )); - -} - - - -#if (RTL8188E_SUPPORT == 1) - - -VOID -odm_RX_HWAntDiv_Init_88E( - IN PDM_ODM_T pDM_Odm -) -{ - u4Byte value32; - - pDM_Odm->AntType = ODM_AUTO_ANT; - - #if (MP_DRIVER == 1) - pDM_Odm->AntDivType = CGCS_RX_SW_ANTDIV; - ODM_SetBBReg(pDM_Odm, ODM_REG_IGI_A_11N , BIT7, 0); // disable HW AntDiv - ODM_SetBBReg(pDM_Odm, ODM_REG_LNA_SWITCH_11N , BIT31, 1); // 1:CG, 0:CS - return; - #endif - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8188E AntDiv_Init => AntDivType=[CGCS_RX_HW_ANTDIV]\n")); - - //MAC Setting - value32 = ODM_GetMACReg(pDM_Odm, ODM_REG_ANTSEL_PIN_11N, bMaskDWord); - ODM_SetMACReg(pDM_Odm, ODM_REG_ANTSEL_PIN_11N, bMaskDWord, value32|(BIT23|BIT25)); //Reg4C[25]=1, Reg4C[23]=1 for pin output - //Pin Settings - ODM_SetBBReg(pDM_Odm, ODM_REG_PIN_CTRL_11N , BIT9|BIT8, 0);//Reg870[8]=1'b0, Reg870[9]=1'b0 //antsel antselb by HW - ODM_SetBBReg(pDM_Odm, ODM_REG_RX_ANT_CTRL_11N , BIT10, 0); //Reg864[10]=1'b0 //antsel2 by HW - ODM_SetBBReg(pDM_Odm, ODM_REG_LNA_SWITCH_11N , BIT22, 1); //Regb2c[22]=1'b0 //disable CS/CG switch - ODM_SetBBReg(pDM_Odm, ODM_REG_LNA_SWITCH_11N , BIT31, 1); //Regb2c[31]=1'b1 //output at CG only - //OFDM Settings - ODM_SetBBReg(pDM_Odm, ODM_REG_ANTDIV_PARA1_11N , bMaskDWord, 0x000000a0); - //CCK Settings - ODM_SetBBReg(pDM_Odm, ODM_REG_BB_PWR_SAV4_11N , BIT7, 1); //Fix CCK PHY status report issue - ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_ANTDIV_PARA2_11N , BIT4, 1); //CCK complete HW AntDiv within 64 samples - - ODM_SetBBReg(pDM_Odm, ODM_REG_ANT_MAPPING1_11N , 0xFFFF, 0x0102); //antenna mapping table - -} - -VOID -odm_TRX_HWAntDiv_Init_88E( - IN PDM_ODM_T pDM_Odm -) -{ - u4Byte value32; - - #if (MP_DRIVER == 1) - pDM_Odm->AntDivType = CGCS_RX_SW_ANTDIV; - ODM_SetBBReg(pDM_Odm, ODM_REG_IGI_A_11N , BIT7, 0); // disable HW AntDiv - ODM_SetBBReg(pDM_Odm, ODM_REG_RX_ANT_CTRL_11N , BIT5|BIT4|BIT3, 0); //Default RX (0/1) - return; - #endif - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8188E AntDiv_Init => AntDivType=[CG_TRX_HW_ANTDIV (SPDT)]\n")); - - //MAC Setting - value32 = ODM_GetMACReg(pDM_Odm, ODM_REG_ANTSEL_PIN_11N, bMaskDWord); - ODM_SetMACReg(pDM_Odm, ODM_REG_ANTSEL_PIN_11N, bMaskDWord, value32|(BIT23|BIT25)); //Reg4C[25]=1, Reg4C[23]=1 for pin output - //Pin Settings - ODM_SetBBReg(pDM_Odm, ODM_REG_PIN_CTRL_11N , BIT9|BIT8, 0);//Reg870[8]=1'b0, Reg870[9]=1'b0 //antsel antselb by HW - ODM_SetBBReg(pDM_Odm, ODM_REG_RX_ANT_CTRL_11N , BIT10, 0); //Reg864[10]=1'b0 //antsel2 by HW - ODM_SetBBReg(pDM_Odm, ODM_REG_LNA_SWITCH_11N , BIT22, 0); //Regb2c[22]=1'b0 //disable CS/CG switch - ODM_SetBBReg(pDM_Odm, ODM_REG_LNA_SWITCH_11N , BIT31, 1); //Regb2c[31]=1'b1 //output at CG only - //OFDM Settings - ODM_SetBBReg(pDM_Odm, ODM_REG_ANTDIV_PARA1_11N , bMaskDWord, 0x000000a0); - //CCK Settings - ODM_SetBBReg(pDM_Odm, ODM_REG_BB_PWR_SAV4_11N , BIT7, 1); //Fix CCK PHY status report issue - ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_ANTDIV_PARA2_11N , BIT4, 1); //CCK complete HW AntDiv within 64 samples - - //antenna mapping table - if(!pDM_Odm->bIsMPChip) //testchip - { - ODM_SetBBReg(pDM_Odm, ODM_REG_RX_DEFUALT_A_11N , BIT10|BIT9|BIT8, 1); //Reg858[10:8]=3'b001 - ODM_SetBBReg(pDM_Odm, ODM_REG_RX_DEFUALT_A_11N , BIT13|BIT12|BIT11, 2); //Reg858[13:11]=3'b010 - } - else //MPchip - ODM_SetBBReg(pDM_Odm, ODM_REG_ANT_MAPPING1_11N , bMaskDWord, 0x0201); //Reg914=3'b010, Reg915=3'b001 -} - -VOID -odm_Smart_HWAntDiv_Init_88E( - IN PDM_ODM_T pDM_Odm -) -{ - u4Byte value32, i; - pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; - u4Byte AntCombination = 2; - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8188E AntDiv_Init => AntDivType=[CG_TRX_SMART_ANTDIV]\n")); - -#if (MP_DRIVER == 1) - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("pDM_Odm->AntDivType: %d\n", pDM_Odm->AntDivType)); - return; -#endif - - for(i=0; i<6; i++) - { - pDM_FatTable->Bssid[i] = 0; - pDM_FatTable->antSumRSSI[i] = 0; - pDM_FatTable->antRSSIcnt[i] = 0; - pDM_FatTable->antAveRSSI[i] = 0; - } - pDM_FatTable->TrainIdx = 0; - pDM_FatTable->FAT_State = FAT_NORMAL_STATE; - - //MAC Setting - value32 = ODM_GetMACReg(pDM_Odm, 0x4c, bMaskDWord); - ODM_SetMACReg(pDM_Odm, 0x4c, bMaskDWord, value32|(BIT23|BIT25)); //Reg4C[25]=1, Reg4C[23]=1 for pin output - value32 = ODM_GetMACReg(pDM_Odm, 0x7B4, bMaskDWord); - ODM_SetMACReg(pDM_Odm, 0x7b4, bMaskDWord, value32|(BIT16|BIT17)); //Reg7B4[16]=1 enable antenna training, Reg7B4[17]=1 enable A2 match - //value32 = PlatformEFIORead4Byte(Adapter, 0x7B4); - //PlatformEFIOWrite4Byte(Adapter, 0x7b4, value32|BIT18); //append MACID in reponse packet - - //Match MAC ADDR - ODM_SetMACReg(pDM_Odm, 0x7b4, 0xFFFF, 0); - ODM_SetMACReg(pDM_Odm, 0x7b0, bMaskDWord, 0); - - ODM_SetBBReg(pDM_Odm, 0x870 , BIT9|BIT8, 0);//Reg870[8]=1'b0, Reg870[9]=1'b0 //antsel antselb by HW - ODM_SetBBReg(pDM_Odm, 0x864 , BIT10, 0); //Reg864[10]=1'b0 //antsel2 by HW - ODM_SetBBReg(pDM_Odm, 0xb2c , BIT22, 0); //Regb2c[22]=1'b0 //disable CS/CG switch - ODM_SetBBReg(pDM_Odm, 0xb2c , BIT31, 1); //Regb2c[31]=1'b1 //output at CG only - ODM_SetBBReg(pDM_Odm, 0xca4 , bMaskDWord, 0x000000a0); - - //antenna mapping table - if(AntCombination == 2) - { - if(!pDM_Odm->bIsMPChip) //testchip - { - ODM_SetBBReg(pDM_Odm, 0x858 , BIT10|BIT9|BIT8, 1); //Reg858[10:8]=3'b001 - ODM_SetBBReg(pDM_Odm, 0x858 , BIT13|BIT12|BIT11, 2); //Reg858[13:11]=3'b010 - } - else //MPchip - { - ODM_SetBBReg(pDM_Odm, 0x914 , bMaskByte0, 1); - ODM_SetBBReg(pDM_Odm, 0x914 , bMaskByte1, 2); - } - } - else if(AntCombination == 7) - { - if(!pDM_Odm->bIsMPChip) //testchip - { - ODM_SetBBReg(pDM_Odm, 0x858 , BIT10|BIT9|BIT8, 0); //Reg858[10:8]=3'b000 - ODM_SetBBReg(pDM_Odm, 0x858 , BIT13|BIT12|BIT11, 1); //Reg858[13:11]=3'b001 - ODM_SetBBReg(pDM_Odm, 0x878 , BIT16, 0); - ODM_SetBBReg(pDM_Odm, 0x858 , BIT15|BIT14, 2); //(Reg878[0],Reg858[14:15])=3'b010 - ODM_SetBBReg(pDM_Odm, 0x878 , BIT19|BIT18|BIT17, 3);//Reg878[3:1]=3b'011 - ODM_SetBBReg(pDM_Odm, 0x878 , BIT22|BIT21|BIT20, 4);//Reg878[6:4]=3b'100 - ODM_SetBBReg(pDM_Odm, 0x878 , BIT25|BIT24|BIT23, 5);//Reg878[9:7]=3b'101 - ODM_SetBBReg(pDM_Odm, 0x878 , BIT28|BIT27|BIT26, 6);//Reg878[12:10]=3b'110 - ODM_SetBBReg(pDM_Odm, 0x878 , BIT31|BIT30|BIT29, 7);//Reg878[15:13]=3b'111 - } - else //MPchip - { - ODM_SetBBReg(pDM_Odm, 0x914 , bMaskByte0, 0); - ODM_SetBBReg(pDM_Odm, 0x914 , bMaskByte1, 1); - ODM_SetBBReg(pDM_Odm, 0x914 , bMaskByte2, 2); - ODM_SetBBReg(pDM_Odm, 0x914 , bMaskByte3, 3); - ODM_SetBBReg(pDM_Odm, 0x918 , bMaskByte0, 4); - ODM_SetBBReg(pDM_Odm, 0x918 , bMaskByte1, 5); - ODM_SetBBReg(pDM_Odm, 0x918 , bMaskByte2, 6); - ODM_SetBBReg(pDM_Odm, 0x918 , bMaskByte3, 7); - } - } - - //Default Ant Setting when no fast training - ODM_SetBBReg(pDM_Odm, 0x80c , BIT21, 1); //Reg80c[21]=1'b1 //from TX Info - ODM_SetBBReg(pDM_Odm, 0x864 , BIT5|BIT4|BIT3, 0); //Default RX - ODM_SetBBReg(pDM_Odm, 0x864 , BIT8|BIT7|BIT6, 1); //Optional RX - //ODM_SetBBReg(pDM_Odm, 0x860 , BIT14|BIT13|BIT12, 1); //Default TX - - //Enter Traing state - ODM_SetBBReg(pDM_Odm, 0x864 , BIT2|BIT1|BIT0, (AntCombination-1)); //Reg864[2:0]=3'd6 //ant combination=reg864[2:0]+1 - //ODM_SetBBReg(pDM_Odm, 0xc50 , BIT7, 0); //RegC50[7]=1'b0 //disable HW AntDiv - //ODM_SetBBReg(pDM_Odm, 0xe08 , BIT16, 0); //RegE08[16]=1'b0 //disable fast training - //ODM_SetBBReg(pDM_Odm, 0xe08 , BIT16, 1); //RegE08[16]=1'b1 //enable fast training - ODM_SetBBReg(pDM_Odm, 0xc50 , BIT7, 1); //RegC50[7]=1'b1 //enable HW AntDiv - - //SW Control - //PHY_SetBBReg(Adapter, 0x864 , BIT10, 1); - //PHY_SetBBReg(Adapter, 0x870 , BIT9, 1); - //PHY_SetBBReg(Adapter, 0x870 , BIT8, 1); - //PHY_SetBBReg(Adapter, 0x864 , BIT11, 1); - //PHY_SetBBReg(Adapter, 0x860 , BIT9, 0); - //PHY_SetBBReg(Adapter, 0x860 , BIT8, 0); -} -#endif //#if (RTL8188E_SUPPORT == 1) - - -#if (RTL8192E_SUPPORT == 1) -VOID -odm_RX_HWAntDiv_Init_92E( - IN PDM_ODM_T pDM_Odm -) -{ - -#if (MP_DRIVER == 1) - //pDM_Odm->AntDivType = CGCS_RX_SW_ANTDIV; - odm_AntDiv_on_off(pDM_Odm, ANTDIV_OFF); - ODM_SetBBReg(pDM_Odm, 0xc50 , BIT8, 0); //r_rxdiv_enable_anta Regc50[8]=1'b0 0: control by c50[9] - ODM_SetBBReg(pDM_Odm, 0xc50 , BIT9, 1); // 1:CG, 0:CS - return; -#endif - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8192E AntDiv_Init => AntDivType=[CGCS_RX_HW_ANTDIV]\n")); - - //Pin Settings - ODM_SetBBReg(pDM_Odm, 0x870 , BIT8, 0);//Reg870[8]=1'b0, // "antsel" is controled by HWs - ODM_SetBBReg(pDM_Odm, 0xc50 , BIT8, 1); //Regc50[8]=1'b1 //" CS/CG switching" is controled by HWs - - //Mapping table - ODM_SetBBReg(pDM_Odm, 0x914 , 0xFFFF, 0x0100); //antenna mapping table - - //OFDM Settings - ODM_SetBBReg(pDM_Odm, 0xca4 , 0x7FF, 0xA0); //thershold - ODM_SetBBReg(pDM_Odm, 0xca4 , 0x7FF000, 0x0); //bias - - //CCK Settings - ODM_SetBBReg(pDM_Odm, 0xa04 , 0xF000000, 0); //Select which path to receive for CCK_1 & CCK_2 - ODM_SetBBReg(pDM_Odm, 0xb34 , BIT30, 1); //(92E) ANTSEL_CCK_opt = r_en_antsel_cck? ANTSEL_CCK: 1'b0 - ODM_SetBBReg(pDM_Odm, 0xa74 , BIT7, 1); //Fix CCK PHY status report issue - ODM_SetBBReg(pDM_Odm, 0xa0c , BIT4, 1); //CCK complete HW AntDiv within 64 samples -} - -VOID -odm_TRX_HWAntDiv_Init_92E( - IN PDM_ODM_T pDM_Odm -) -{ - -#if (MP_DRIVER == 1) - //pDM_Odm->AntDivType = CGCS_RX_SW_ANTDIV; - odm_AntDiv_on_off(pDM_Odm, ANTDIV_OFF); - ODM_SetBBReg(pDM_Odm, 0xc50 , BIT8, 0); //r_rxdiv_enable_anta Regc50[8]=1'b0 0: control by c50[9] - ODM_SetBBReg(pDM_Odm, 0xc50 , BIT9, 1); // 1:CG, 0:CS - return; -#endif - -#if (DM_ODM_SUPPORT_TYPE & ODM_AP) - pDM_Odm->antdiv_rssi=0; -#endif - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8192E AntDiv_Init => AntDivType=[CG_TRX_HW_ANTDIV]\n")); - - //3 --RFE pin setting--------- - //[MAC] - ODM_SetMACReg(pDM_Odm, 0x38, BIT11, 1); //DBG PAD Driving control (GPIO 8) - ODM_SetMACReg(pDM_Odm, 0x4c, BIT23, 0); //path-A , RFE_CTRL_3 & RFE_CTRL_4 - //[BB] - ODM_SetBBReg(pDM_Odm, 0x944 , BIT4|BIT3, 0x3); //RFE_buffer - ODM_SetBBReg(pDM_Odm, 0x940 , BIT7|BIT6, 0x0); // r_rfe_path_sel_ (RFE_CTRL_3) - ODM_SetBBReg(pDM_Odm, 0x940 , BIT9|BIT8, 0x0); // r_rfe_path_sel_ (RFE_CTRL_4) - ODM_SetBBReg(pDM_Odm, 0x944 , BIT31, 0); //RFE_buffer - ODM_SetBBReg(pDM_Odm, 0x92C , BIT3, 0); //rfe_inv (RFE_CTRL_3) - ODM_SetBBReg(pDM_Odm, 0x92C , BIT4, 1); //rfe_inv (RFE_CTRL_4) - ODM_SetBBReg(pDM_Odm, 0x930 , 0xFF000, 0x88); //path-A , RFE_CTRL_3 & 4=> ANTSEL[0] - //3 ------------------------- - - //Pin Settings - ODM_SetBBReg(pDM_Odm, 0xC50 , BIT8, 0); //path-A //disable CS/CG switch - ODM_SetBBReg(pDM_Odm, 0xC50 , BIT9, 1); //path-A //output at CG only - ODM_SetBBReg(pDM_Odm, 0x870 , BIT9|BIT8, 0); //path-A //antsel antselb by HW - ODM_SetBBReg(pDM_Odm, 0xB38 , BIT10, 0); //path-A //antsel2 by HW - - //Mapping table - ODM_SetBBReg(pDM_Odm, 0x914 , 0xFFFF, 0x0100); //antenna mapping table - - //OFDM Settings - ODM_SetBBReg(pDM_Odm, 0xca4 , 0x7FF, 0xA0); //thershold - ODM_SetBBReg(pDM_Odm, 0xca4 , 0x7FF000, 0x0); //bias - - //CCK Settings - ODM_SetBBReg(pDM_Odm, 0xa04 , 0xF000000, 0); //Select which path to receive for CCK_1 & CCK_2 - ODM_SetBBReg(pDM_Odm, 0xb34 , BIT30, 1); //(92E) ANTSEL_CCK_opt = r_en_antsel_cck? ANTSEL_CCK: 1'b0 - ODM_SetBBReg(pDM_Odm, 0xa74 , BIT7, 1); //Fix CCK PHY status report issue - ODM_SetBBReg(pDM_Odm, 0xa0c , BIT4, 1); //CCK complete HW AntDiv within 64 samples - - //Timming issue - ODM_SetBBReg(pDM_Odm, 0xE20 , BIT23|BIT22|BIT21|BIT20, 8); //keep antidx after tx for ACK ( unit x 32 mu sec) -} - -VOID -odm_Smart_HWAntDiv_Init_92E( - IN PDM_ODM_T pDM_Odm -) -{ - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8188E AntDiv_Init => AntDivType=[CG_TRX_SMART_ANTDIV]\n")); -} -#endif //#if (RTL8192E_SUPPORT == 1) - - -#if (RTL8723B_SUPPORT == 1) -VOID -odm_TRX_HWAntDiv_Init_8723B( - IN PDM_ODM_T pDM_Odm -) -{ - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8723B AntDiv_Init => AntDivType=[CG_TRX_HW_ANTDIV(DPDT)]\n")); - - //Mapping Table - ODM_SetBBReg(pDM_Odm, 0x914 , bMaskByte0, 0); - ODM_SetBBReg(pDM_Odm, 0x914 , bMaskByte1, 1); - - //OFDM HW AntDiv Parameters - ODM_SetBBReg(pDM_Odm, 0xCA4 , 0x7FF, 0xa0); //thershold - ODM_SetBBReg(pDM_Odm, 0xCA4 , 0x7FF000, 0x00); //bias - - //CCK HW AntDiv Parameters - ODM_SetBBReg(pDM_Odm, 0xA74 , BIT7, 1); //patch for clk from 88M to 80M - ODM_SetBBReg(pDM_Odm, 0xA0C , BIT4, 1); //do 64 samples - - //BT Coexistence - ODM_SetBBReg(pDM_Odm, 0x864, BIT12, 0); //keep antsel_map when GNT_BT = 1 - ODM_SetBBReg(pDM_Odm, 0x874 , BIT23, 0); //Disable hw antsw & fast_train.antsw when GNT_BT=1 - - //Output Pin Settings - ODM_SetBBReg(pDM_Odm, 0x870 , BIT8, 0); // - - ODM_SetBBReg(pDM_Odm, 0x948 , BIT6, 0); //WL_BB_SEL_BTG_TRXG_anta, (1: HW CTRL 0: SW CTRL) - ODM_SetBBReg(pDM_Odm, 0x948 , BIT7, 0); - - ODM_SetMACReg(pDM_Odm, 0x40 , BIT3, 1); - ODM_SetMACReg(pDM_Odm, 0x38 , BIT11, 1); - ODM_SetMACReg(pDM_Odm, 0x4C , BIT24|BIT23, 2); //select DPDT_P and DPDT_N as output pin - - ODM_SetBBReg(pDM_Odm, 0x944 , BIT0|BIT1, 3); //in/out - ODM_SetBBReg(pDM_Odm, 0x944 , BIT31, 0); // - - ODM_SetBBReg(pDM_Odm, 0x92C , BIT1, 0); //DPDT_P non-inverse - ODM_SetBBReg(pDM_Odm, 0x92C , BIT0, 1); //DPDT_N inverse - - ODM_SetBBReg(pDM_Odm, 0x930 , 0xF0, 8); // DPDT_P = ANTSEL[0] - ODM_SetBBReg(pDM_Odm, 0x930 , 0xF, 8); // DPDT_N = ANTSEL[0] - - //Timming issue - ODM_SetBBReg(pDM_Odm, 0xE20 , BIT23|BIT22|BIT21|BIT20, 8); //keep antidx after tx for ACK ( unit x 32 mu sec) - - //2 [--For HW Bug Setting] - if(pDM_Odm->AntType == ODM_AUTO_ANT) - ODM_SetBBReg(pDM_Odm, 0xA00 , BIT15, 0); //CCK AntDiv function block enable - - //ODM_SetBBReg(pDM_Odm, 0x80C , BIT21, 0); //TX Ant by Reg - - -} - - - -VOID -odm_S0S1_SWAntDiv_Init_8723B( - IN PDM_ODM_T pDM_Odm -) -{ - pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; - pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8723B AntDiv_Init => AntDivType=[ S0S1_SW_AntDiv] \n")); - - //Mapping Table - ODM_SetBBReg(pDM_Odm, 0x914 , bMaskByte0, 0); - ODM_SetBBReg(pDM_Odm, 0x914 , bMaskByte1, 1); - - //Output Pin Settings - //ODM_SetBBReg(pDM_Odm, 0x948 , BIT6, 0x1); - ODM_SetBBReg(pDM_Odm, 0x870 , BIT9|BIT8, 0); - - pDM_FatTable->bBecomeLinked =FALSE; - pDM_SWAT_Table->try_flag = 0xff; - pDM_SWAT_Table->Double_chk_flag = 0; - pDM_SWAT_Table->TrafficLoad = TRAFFIC_LOW; - - //Timming issue - ODM_SetBBReg(pDM_Odm, 0xE20 , BIT23|BIT22|BIT21|BIT20, 8); //keep antidx after tx for ACK ( unit x 32 mu sec) - - //2 [--For HW Bug Setting] - ODM_SetBBReg(pDM_Odm, 0x80C , BIT21, 0); //TX Ant by Reg - -} -#endif //#if (RTL8723B_SUPPORT == 1) - - -#if (RTL8821A_SUPPORT == 1) -VOID -odm_TRX_HWAntDiv_Init_8821A( - IN PDM_ODM_T pDM_Odm -) -{ - -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - - PADAPTER pAdapter = pDM_Odm->Adapter; - pAdapter->HalFunc.GetHalDefVarHandler(pAdapter, HAL_DEF_5G_ANT_SELECT, (pu1Byte)(&pDM_Odm->AntType)); -#else - pDM_Odm->AntType = ODM_AUTO_ANT; -#endif - pAdapter->HalFunc.GetHalDefVarHandler(pAdapter, HAL_DEF_5G_ANT_SELECT, (pu1Byte)(&pDM_Odm->AntType)); - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8821A AntDiv_Init => AntDivType=[ CG_TRX_HW_ANTDIV (DPDT)] \n")); - - //Output Pin Settings - ODM_SetMACReg(pDM_Odm, 0x4C , BIT25, 0); - - ODM_SetMACReg(pDM_Odm, 0x64 , BIT29, 1); //PAPE by WLAN control - ODM_SetMACReg(pDM_Odm, 0x64 , BIT28, 1); //LNAON by WLAN control - - ODM_SetBBReg(pDM_Odm, 0xCB0 , bMaskDWord, 0x77775745); - ODM_SetBBReg(pDM_Odm, 0xCB8 , BIT16, 0); - - ODM_SetMACReg(pDM_Odm, 0x4C , BIT23, 0); //select DPDT_P and DPDT_N as output pin - ODM_SetMACReg(pDM_Odm, 0x4C , BIT24, 1); //by WLAN control - ODM_SetBBReg(pDM_Odm, 0xCB4 , 0xF, 8); // DPDT_P = ANTSEL[0] - ODM_SetBBReg(pDM_Odm, 0xCB4 , 0xF0, 8); // DPDT_N = ANTSEL[0] - ODM_SetBBReg(pDM_Odm, 0xCB4 , BIT29, 0); //DPDT_P non-inverse - ODM_SetBBReg(pDM_Odm, 0xCB4 , BIT28, 1); //DPDT_N inverse - - //Mapping Table - ODM_SetBBReg(pDM_Odm, 0xCA4 , bMaskByte0, 0); - ODM_SetBBReg(pDM_Odm, 0xCA4 , bMaskByte1, 1); - - //Set ANT1_8821A as MAIN_ANT - if((pDM_Odm->AntType == ODM_FIX_MAIN_ANT) || (pDM_Odm->AntType == ODM_AUTO_ANT)) - ODM_UpdateRxIdleAnt(pDM_Odm, MAIN_ANT); - else - ODM_UpdateRxIdleAnt(pDM_Odm, AUX_ANT); - - //OFDM HW AntDiv Parameters - ODM_SetBBReg(pDM_Odm, 0x8D4 , 0x7FF, 0xA0); //thershold - ODM_SetBBReg(pDM_Odm, 0x8D4 , 0x7FF000, 0x10); //bias - - //CCK HW AntDiv Parameters - ODM_SetBBReg(pDM_Odm, 0xA74 , BIT7, 1); //patch for clk from 88M to 80M - ODM_SetBBReg(pDM_Odm, 0xA0C , BIT4, 1); //do 64 samples - - ODM_SetBBReg(pDM_Odm, 0x800 , BIT25, 0); //CCK AntDiv function block enable - - //BT Coexistence - ODM_SetBBReg(pDM_Odm, 0xCAC , BIT9, 1); //keep antsel_map when GNT_BT = 1 - ODM_SetBBReg(pDM_Odm, 0x804 , BIT4, 1); //Disable hw antsw & fast_train.antsw when GNT_BT=1 - - //Timming issue - ODM_SetBBReg(pDM_Odm, 0x818 , BIT23|BIT22|BIT21|BIT20, 8); //keep antidx after tx for ACK ( unit x 32 mu sec) - ODM_SetBBReg(pDM_Odm, 0x8CC , BIT20|BIT19|BIT18, 3); //settling time of antdiv by RF LNA = 100ns - - //response TX ant by RX ant - ODM_SetMACReg(pDM_Odm, 0x668 , BIT3, 1); - - //2 [--For HW Bug Setting] - if(pDM_Odm->AntType == ODM_AUTO_ANT) - ODM_SetBBReg(pDM_Odm, 0x800 , BIT25, 0); //CCK AntDiv function block enable - -} - -VOID -odm_S0S1_SWAntDiv_Init_8821A( - IN PDM_ODM_T pDM_Odm -) -{ - pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; - pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; - - - -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - - PADAPTER pAdapter = pDM_Odm->Adapter; - pAdapter->HalFunc.GetHalDefVarHandler(pAdapter, HAL_DEF_5G_ANT_SELECT, (pu1Byte)(&pDM_Odm->AntType)); -#else - pDM_Odm->AntType = ODM_AUTO_ANT; -#endif - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8821A AntDiv_Init => AntDivType=[ S0S1_SW_AntDiv] \n")); - - //Output Pin Settings - ODM_SetMACReg(pDM_Odm, 0x4C , BIT25, 0); - - ODM_SetMACReg(pDM_Odm, 0x64 , BIT29, 1); //PAPE by WLAN control - ODM_SetMACReg(pDM_Odm, 0x64 , BIT28, 1); //LNAON by WLAN control - - ODM_SetBBReg(pDM_Odm, 0xCB0 , bMaskDWord, 0x77775745); - ODM_SetBBReg(pDM_Odm, 0xCB8 , BIT16, 0); - - ODM_SetMACReg(pDM_Odm, 0x4C , BIT23, 0); //select DPDT_P and DPDT_N as output pin - ODM_SetMACReg(pDM_Odm, 0x4C , BIT24, 1); //by WLAN control - ODM_SetBBReg(pDM_Odm, 0xCB4 , 0xF, 8); // DPDT_P = ANTSEL[0] - ODM_SetBBReg(pDM_Odm, 0xCB4 , 0xF0, 8); // DPDT_N = ANTSEL[0] - ODM_SetBBReg(pDM_Odm, 0xCB4 , BIT29, 0); //DPDT_P non-inverse - ODM_SetBBReg(pDM_Odm, 0xCB4 , BIT28, 1); //DPDT_N inverse - - //Mapping Table - ODM_SetBBReg(pDM_Odm, 0xCA4 , bMaskByte0, 0); - ODM_SetBBReg(pDM_Odm, 0xCA4 , bMaskByte1, 1); - - //Set ANT1_8821A as MAIN_ANT - if((pDM_Odm->AntType == ODM_FIX_MAIN_ANT) || (pDM_Odm->AntType == ODM_AUTO_ANT)) - ODM_UpdateRxIdleAnt(pDM_Odm, MAIN_ANT); - else - ODM_UpdateRxIdleAnt(pDM_Odm, AUX_ANT); - - //OFDM HW AntDiv Parameters - ODM_SetBBReg(pDM_Odm, 0x8D4 , 0x7FF, 0xA0); //thershold - ODM_SetBBReg(pDM_Odm, 0x8D4 , 0x7FF000, 0x10); //bias - - //CCK HW AntDiv Parameters - ODM_SetBBReg(pDM_Odm, 0xA74 , BIT7, 1); //patch for clk from 88M to 80M - ODM_SetBBReg(pDM_Odm, 0xA0C , BIT4, 1); //do 64 samples - - ODM_SetBBReg(pDM_Odm, 0x800 , BIT25, 0); //CCK AntDiv function block enable - - //BT Coexistence - ODM_SetBBReg(pDM_Odm, 0xCAC , BIT9, 1); //keep antsel_map when GNT_BT = 1 - ODM_SetBBReg(pDM_Odm, 0x804 , BIT4, 1); //Disable hw antsw & fast_train.antsw when GNT_BT=1 - - //Timming issue - ODM_SetBBReg(pDM_Odm, 0x818 , BIT23|BIT22|BIT21|BIT20, 8); //keep antidx after tx for ACK ( unit x 32 mu sec) - ODM_SetBBReg(pDM_Odm, 0x8CC , BIT20|BIT19|BIT18, 3); //settling time of antdiv by RF LNA = 100ns - - //response TX ant by RX ant - ODM_SetMACReg(pDM_Odm, 0x668 , BIT3, 1); - - //2 [--For HW Bug Setting] - if(pDM_Odm->AntType == ODM_AUTO_ANT) - ODM_SetBBReg(pDM_Odm, 0x800 , BIT25, 0); //CCK AntDiv function block enable - - - ODM_SetBBReg(pDM_Odm, 0x900 , BIT18, 0); - - pDM_SWAT_Table->try_flag = 0xff; - pDM_SWAT_Table->Double_chk_flag = 0; - pDM_SWAT_Table->TrafficLoad = TRAFFIC_LOW; - pDM_SWAT_Table->CurAntenna = MAIN_ANT; - pDM_SWAT_Table->PreAntenna = MAIN_ANT; - pDM_SWAT_Table->SWAS_NoLink_State = 0; - -} -#endif //#if (RTL8821A_SUPPORT == 1) - -#if (RTL8881A_SUPPORT == 1) -VOID -odm_RX_HWAntDiv_Init_8881A( - IN PDM_ODM_T pDM_Odm -) -{ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8881A AntDiv_Init => AntDivType=[ CGCS_RX_HW_ANTDIV] \n")); - -} - -VOID -odm_TRX_HWAntDiv_Init_8881A( - IN PDM_ODM_T pDM_Odm -) -{ - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8881A AntDiv_Init => AntDivType=[ CG_TRX_HW_ANTDIV (SPDT)] \n")); - - //Output Pin Settings - // [SPDT related] - ODM_SetMACReg(pDM_Odm, 0x4C , BIT25, 0); - ODM_SetMACReg(pDM_Odm, 0x4C , BIT26, 0); - ODM_SetBBReg(pDM_Odm, 0xCB4 , BIT31, 0); //delay buffer - ODM_SetBBReg(pDM_Odm, 0xCB4 , BIT22, 0); - ODM_SetBBReg(pDM_Odm, 0xCB4 , BIT24, 1); - ODM_SetBBReg(pDM_Odm, 0xCB0 , 0xF00, 8); // DPDT_P = ANTSEL[0] - ODM_SetBBReg(pDM_Odm, 0xCB0 , 0xF0000, 8); // DPDT_N = ANTSEL[0] - - //Mapping Table - ODM_SetBBReg(pDM_Odm, 0xCA4 , bMaskByte0, 0); - ODM_SetBBReg(pDM_Odm, 0xCA4 , bMaskByte1, 1); - - //OFDM HW AntDiv Parameters - ODM_SetBBReg(pDM_Odm, 0x8D4 , 0x7FF, 0xA0); //thershold - ODM_SetBBReg(pDM_Odm, 0x8D4 , 0x7FF000, 0x0); //bias - ODM_SetBBReg(pDM_Odm, 0x8CC , BIT20|BIT19|BIT18, 3); //settling time of antdiv by RF LNA = 100ns - - //CCK HW AntDiv Parameters - ODM_SetBBReg(pDM_Odm, 0xA74 , BIT7, 1); //patch for clk from 88M to 80M - ODM_SetBBReg(pDM_Odm, 0xA0C , BIT4, 1); //do 64 samples - - //Timming issue - ODM_SetBBReg(pDM_Odm, 0x818 , BIT23|BIT22|BIT21|BIT20, 8); //keep antidx after tx for ACK ( unit x 32 mu sec) - - //2 [--For HW Bug Setting] - - ODM_SetBBReg(pDM_Odm, 0x900 , BIT18, 0); //TX Ant by Reg // A-cut bug -} - -#endif //#if (RTL8881A_SUPPORT == 1) - - -#if (RTL8812A_SUPPORT == 1) -VOID -odm_TRX_HWAntDiv_Init_8812A( - IN PDM_ODM_T pDM_Odm -) -{ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8812A AntDiv_Init => AntDivType=[ CG_TRX_HW_ANTDIV (SPDT)] \n")); - - //3 //3 --RFE pin setting--------- - //[BB] - ODM_SetBBReg(pDM_Odm, 0x900 , BIT10|BIT9|BIT8, 0x0); //disable SW switch - ODM_SetBBReg(pDM_Odm, 0x900 , BIT17|BIT16, 0x0); - ODM_SetBBReg(pDM_Odm, 0x974 , BIT7|BIT6, 0x3); // in/out - ODM_SetBBReg(pDM_Odm, 0xCB4 , BIT31, 0); //delay buffer - ODM_SetBBReg(pDM_Odm, 0xCB4 , BIT26, 0); - ODM_SetBBReg(pDM_Odm, 0xCB4 , BIT27, 1); - ODM_SetBBReg(pDM_Odm, 0xCB0 , 0xF000000, 8); // DPDT_P = ANTSEL[0] - ODM_SetBBReg(pDM_Odm, 0xCB0 , 0xF0000000, 8); // DPDT_N = ANTSEL[0] - //3 ------------------------- - - //Mapping Table - ODM_SetBBReg(pDM_Odm, 0xCA4 , bMaskByte0, 0); - ODM_SetBBReg(pDM_Odm, 0xCA4 , bMaskByte1, 1); - - //OFDM HW AntDiv Parameters - ODM_SetBBReg(pDM_Odm, 0x8D4 , 0x7FF, 0xA0); //thershold - ODM_SetBBReg(pDM_Odm, 0x8D4 , 0x7FF000, 0x0); //bias - ODM_SetBBReg(pDM_Odm, 0x8CC , BIT20|BIT19|BIT18, 3); //settling time of antdiv by RF LNA = 100ns - - //CCK HW AntDiv Parameters - ODM_SetBBReg(pDM_Odm, 0xA74 , BIT7, 1); //patch for clk from 88M to 80M - ODM_SetBBReg(pDM_Odm, 0xA0C , BIT4, 1); //do 64 samples - - //Timming issue - ODM_SetBBReg(pDM_Odm, 0x818 , BIT23|BIT22|BIT21|BIT20, 8); //keep antidx after tx for ACK ( unit x 32 mu sec) - - //2 [--For HW Bug Setting] - - ODM_SetBBReg(pDM_Odm, 0x900 , BIT18, 0); //TX Ant by Reg // A-cut bug - -} - -#endif //#if (RTL8812A_SUPPORT == 1) - -VOID -odm_HW_AntDiv( - IN PDM_ODM_T pDM_Odm -) -{ - u4Byte i,MinMaxRSSI=0xFF, AntDivMaxRSSI=0, MaxRSSI=0, LocalMaxRSSI; - u4Byte Main_RSSI, Aux_RSSI, pkt_ratio_m=0, pkt_ratio_a=0,pkt_threshold=10; - u1Byte RxIdleAnt=0, TargetAnt=7; - pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; - pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable; - PSTA_INFO_T pEntry; - - if(!pDM_Odm->bLinked) //bLinked==False - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[No Link!!!]\n")); - - #if(DM_ODM_SUPPORT_TYPE == ODM_AP) - if (pDM_Odm->antdiv_rssi) - panic_printk("[No Link!!!]\n"); - #endif - - if(pDM_FatTable->bBecomeLinked == TRUE) - { - odm_AntDiv_on_off(pDM_Odm, ANTDIV_OFF); - ODM_UpdateRxIdleAnt(pDM_Odm, MAIN_ANT); - - pDM_FatTable->bBecomeLinked = pDM_Odm->bLinked; - } - return; - } - else - { - if(pDM_FatTable->bBecomeLinked ==FALSE) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[Linked !!!]\n")); - odm_AntDiv_on_off(pDM_Odm, ANTDIV_ON); - if(pDM_Odm->SupportICType == ODM_RTL8821 ) - ODM_SetBBReg(pDM_Odm, 0x800 , BIT25, 0); //CCK AntDiv function disable - - #if(DM_ODM_SUPPORT_TYPE == ODM_AP) - else if(pDM_Odm->SupportICType == ODM_RTL8881 ) - ODM_SetBBReg(pDM_Odm, 0x800 , BIT25, 0); //CCK AntDiv function disable - #endif - - else if(pDM_Odm->SupportICType == ODM_RTL8723B ||pDM_Odm->SupportICType == ODM_RTL8812) - ODM_SetBBReg(pDM_Odm, 0xA00 , BIT15, 0); //CCK AntDiv function disable - - pDM_FatTable->bBecomeLinked = pDM_Odm->bLinked; - - if(pDM_Odm->SupportICType==ODM_RTL8723B && pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV) - { - ODM_SetBBReg(pDM_Odm, 0x930 , 0xF0, 8); // DPDT_P = ANTSEL[0] // for 8723B AntDiv function patch. BB Dino 130412 - ODM_SetBBReg(pDM_Odm, 0x930 , 0xF, 8); // DPDT_N = ANTSEL[0] - } - } - } - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("\n[HW AntDiv] Start =>\n")); - - for (i=0; ipODM_StaInfo[i]; - if(IS_STA_VALID(pEntry)) - { - //2 Caculate RSSI per Antenna - Main_RSSI = (pDM_FatTable->MainAnt_Cnt[i]!=0)?(pDM_FatTable->MainAnt_Sum[i]/pDM_FatTable->MainAnt_Cnt[i]):0; - Aux_RSSI = (pDM_FatTable->AuxAnt_Cnt[i]!=0)?(pDM_FatTable->AuxAnt_Sum[i]/pDM_FatTable->AuxAnt_Cnt[i]):0; - TargetAnt = (Main_RSSI==Aux_RSSI)?pDM_FatTable->RxIdleAnt:((Main_RSSI>=Aux_RSSI)?MAIN_ANT:AUX_ANT); - /* - if( pDM_FatTable->MainAnt_Cnt[i]!=0 && pDM_FatTable->AuxAnt_Cnt[i]!=0 ) - { - pkt_ratio_m=( pDM_FatTable->MainAnt_Cnt[i] / pDM_FatTable->AuxAnt_Cnt[i] ); - pkt_ratio_a=( pDM_FatTable->AuxAnt_Cnt[i] / pDM_FatTable->MainAnt_Cnt[i] ); - - if (pkt_ratio_m >= pkt_threshold) - TargetAnt=MAIN_ANT; - - else if(pkt_ratio_a >= pkt_threshold) - TargetAnt=AUX_ANT; - } - */ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("*** SupportICType=[%u] \n",pDM_Odm->SupportICType)); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*** Main_Cnt = (( %u )) , Main_RSSI= (( %u )) \n", pDM_FatTable->MainAnt_Cnt[i], Main_RSSI)); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*** Aux_Cnt = (( %u )) , Aux_RSSI = (( %u )) \n", pDM_FatTable->AuxAnt_Cnt[i] , Aux_RSSI )); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*** MAC ID:[ %u ] , TargetAnt = (( %s )) \n", i ,( TargetAnt ==MAIN_ANT)?"MAIN_ANT":"AUX_ANT")); - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("*** Phy_AntSel_A=[ %d, %d, %d] \n",((pDM_Odm->DM_FatTable.antsel_rx_keep_0)&BIT2)>>2, - ((pDM_Odm->DM_FatTable.antsel_rx_keep_0)&BIT1) >>1, ((pDM_Odm->DM_FatTable.antsel_rx_keep_0)&BIT0))); - #if(DM_ODM_SUPPORT_TYPE == ODM_AP) - if (pDM_Odm->antdiv_rssi) - { - panic_printk("*** SupportICType=[%lu] \n",pDM_Odm->SupportICType); - //panic_printk("*** Phy_AntSel_A=[ %d, %d, %d] \n",((pDM_Odm->DM_FatTable.antsel_rx_keep_0)&BIT2)>>2, - // ((pDM_Odm->DM_FatTable.antsel_rx_keep_0)&BIT1) >>1, ((pDM_Odm->DM_FatTable.antsel_rx_keep_0)&BIT0)); - //panic_printk("*** Phy_AntSel_B=[ %d, %d, %d] \n",((pDM_Odm->DM_FatTable.antsel_rx_keep_1)&BIT2)>>2, - // ((pDM_Odm->DM_FatTable.antsel_rx_keep_1)&BIT1) >>1, ((pDM_Odm->DM_FatTable.antsel_rx_keep_1)&BIT0)) - panic_printk("*** Client[ %lu ] , Main_Cnt = (( %lu )) , Main_RSSI= (( %lu )) \n",i, pDM_FatTable->MainAnt_Cnt[i], Main_RSSI); - panic_printk("*** Client[ %lu ] , Aux_Cnt = (( %lu )) , Aux_RSSI = (( %lu )) \n" ,i, pDM_FatTable->AuxAnt_Cnt[i] , Aux_RSSI); - } - #endif - - - LocalMaxRSSI = (Main_RSSI>Aux_RSSI)?Main_RSSI:Aux_RSSI; - //2 Select MaxRSSI for DIG - if((LocalMaxRSSI > AntDivMaxRSSI) && (LocalMaxRSSI < 40)) - AntDivMaxRSSI = LocalMaxRSSI; - if(LocalMaxRSSI > MaxRSSI) - MaxRSSI = LocalMaxRSSI; - - //2 Select RX Idle Antenna - if ( (LocalMaxRSSI != 0) && (LocalMaxRSSI < MinMaxRSSI) ) - { - RxIdleAnt = TargetAnt; - MinMaxRSSI = LocalMaxRSSI; - } - /* - if((pDM_FatTable->RxIdleAnt == MAIN_ANT) && (Main_RSSI == 0)) - Main_RSSI = Aux_RSSI; - else if((pDM_FatTable->RxIdleAnt == AUX_ANT) && (Aux_RSSI == 0)) - Aux_RSSI = Main_RSSI; - - LocalMinRSSI = (Main_RSSI>Aux_RSSI)?Aux_RSSI:Main_RSSI; - if(LocalMinRSSI < MinRSSI) - { - MinRSSI = LocalMinRSSI; - RxIdleAnt = TargetAnt; - } - */ - //2 Select TX Antenna - - #if TX_BY_REG - - #else - if(pDM_Odm->AntDivType != CGCS_RX_HW_ANTDIV) - odm_UpdateTxAnt(pDM_Odm, TargetAnt, i); - #endif - - } - pDM_FatTable->MainAnt_Sum[i] = 0; - pDM_FatTable->AuxAnt_Sum[i] = 0; - pDM_FatTable->MainAnt_Cnt[i] = 0; - pDM_FatTable->AuxAnt_Cnt[i] = 0; - } - - //2 Set RX Idle Antenna - ODM_UpdateRxIdleAnt(pDM_Odm, RxIdleAnt); - - #if(DM_ODM_SUPPORT_TYPE == ODM_AP) - if (pDM_Odm->antdiv_rssi) - panic_printk("*** RxIdleAnt = (( %s )) \n \n", ( RxIdleAnt ==MAIN_ANT)?"MAIN_ANT":"AUX_ANT"); - #endif - - pDM_DigTable->AntDiv_RSSI_max = AntDivMaxRSSI; - pDM_DigTable->RSSI_max = MaxRSSI; -} - - - -#if (RTL8723B_SUPPORT == 1)||(RTL8821A_SUPPORT == 1) -VOID -odm_S0S1_SwAntDiv( - IN PDM_ODM_T pDM_Odm, - IN u1Byte Step - ) -{ - u4Byte i,MinMaxRSSI=0xFF, LocalMaxRSSI,LocalMinRSSI; - u4Byte Main_RSSI, Aux_RSSI; - u1Byte reset_period=10, SWAntDiv_threshold=35; - u1Byte HighTraffic_TrainTime_U=0x32,HighTraffic_TrainTime_L,Train_time_temp; - u1Byte LowTraffic_TrainTime_U=200,LowTraffic_TrainTime_L; - u1Byte RxIdleAnt, TargetAnt, nextAnt; - pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; - pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; - PSTA_INFO_T pEntry=NULL; - //static u1Byte reset_idx; - u4Byte value32; - PADAPTER Adapter = pDM_Odm->Adapter; - u8Byte curTxOkCnt=0, curRxOkCnt=0,TxCntOffset, RxCntOffset; - - if(!pDM_Odm->bLinked) //bLinked==False - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[No Link!!!]\n")); - if(pDM_FatTable->bBecomeLinked == TRUE) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Set REG 948[9:6]=0x0 \n")); - if(pDM_Odm->SupportICType == ODM_RTL8723B) - ODM_SetBBReg(pDM_Odm, 0x948 , BIT9|BIT8|BIT7|BIT6, 0x0); - - pDM_FatTable->bBecomeLinked = pDM_Odm->bLinked; - } - return; - } - else - { - if(pDM_FatTable->bBecomeLinked ==FALSE) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[Linked !!!]\n")); - - if(pDM_Odm->SupportICType == ODM_RTL8723B) - { - value32 = ODM_GetBBReg(pDM_Odm, 0x864, BIT5|BIT4|BIT3); - - if (value32==0x0) - ODM_UpdateRxIdleAnt(pDM_Odm, MAIN_ANT); - else if (value32==0x1) - ODM_UpdateRxIdleAnt(pDM_Odm, AUX_ANT); - - ODM_SetBBReg(pDM_Odm, 0x948 , BIT6, 0x1); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Set REG 948[6]=0x1 , Set REG 864[5:3]=0x%x \n",value32 )); - } - - pDM_SWAT_Table->lastTxOkCnt = 0; - pDM_SWAT_Table->lastRxOkCnt =0; - TxCntOffset = Adapter->TxStats.NumTxBytesUnicast; - RxCntOffset = Adapter->RxStats.NumRxBytesUnicast; - - pDM_FatTable->bBecomeLinked = pDM_Odm->bLinked; - } - else - { - TxCntOffset = 0; - RxCntOffset = 0; - } - } - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[%d] { try_flag=(( %d )), Step=(( %d )), Double_chk_flag = (( %d )) }\n", - __LINE__,pDM_SWAT_Table->try_flag,Step,pDM_SWAT_Table->Double_chk_flag)); - - // Handling step mismatch condition. - // Peak step is not finished at last time. Recover the variable and check again. - if( Step != pDM_SWAT_Table->try_flag ) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[Step != try_flag] Need to Reset After Link\n")); - ODM_SwAntDivRestAfterLink(pDM_Odm); - } - - if(pDM_SWAT_Table->try_flag == 0xff) - { - pDM_SWAT_Table->try_flag = 0; - pDM_SWAT_Table->Train_time_flag=0; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("[set try_flag = 0] Prepare for peak!\n\n")); - return; - } - else//if( try_flag != 0xff ) - { - //1 Normal State (Begin Trying) - if(pDM_SWAT_Table->try_flag == 0) - { - - //---trafic decision--- - curTxOkCnt = Adapter->TxStats.NumTxBytesUnicast - pDM_SWAT_Table->lastTxOkCnt - TxCntOffset; - curRxOkCnt =Adapter->RxStats.NumRxBytesUnicast - pDM_SWAT_Table->lastRxOkCnt - RxCntOffset; - pDM_SWAT_Table->lastTxOkCnt = Adapter->TxStats.NumTxBytesUnicast; - pDM_SWAT_Table->lastRxOkCnt = Adapter->RxStats.NumRxBytesUnicast; - - if (curTxOkCnt > 1875000 || curRxOkCnt > 1875000)//if(PlatformDivision64(curTxOkCnt+curRxOkCnt, 2) > 1875000) ( 1.875M * 8bit ) / 2= 7.5M bits /sec ) - { - pDM_SWAT_Table->TrafficLoad = TRAFFIC_HIGH; - Train_time_temp=pDM_SWAT_Table->Train_time ; - - if(pDM_SWAT_Table->Train_time_flag==3) - { - HighTraffic_TrainTime_L=0xa; - - if(Train_time_temp<=16) - Train_time_temp=HighTraffic_TrainTime_L; - else - Train_time_temp-=16; - - } - else if(pDM_SWAT_Table->Train_time_flag==2) - { - Train_time_temp-=8; - HighTraffic_TrainTime_L=0xf; - } - else if(pDM_SWAT_Table->Train_time_flag==1) - { - Train_time_temp-=4; - HighTraffic_TrainTime_L=0x1e; - } - else if(pDM_SWAT_Table->Train_time_flag==0) - { - Train_time_temp+=8; - HighTraffic_TrainTime_L=0x28; - } - - - //ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*** Train_time_temp = ((%d))\n",Train_time_temp)); - - //-- - if(Train_time_temp > HighTraffic_TrainTime_U) - Train_time_temp=HighTraffic_TrainTime_U; - - else if(Train_time_temp < HighTraffic_TrainTime_L) - Train_time_temp=HighTraffic_TrainTime_L; - - pDM_SWAT_Table->Train_time = Train_time_temp; //50ms~10ms - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,(" Train_time_flag=((%d)) , Train_time=((%d)) \n",pDM_SWAT_Table->Train_time_flag, pDM_SWAT_Table->Train_time)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, (" [HIGH Traffic] \n" )); - } - else if (curTxOkCnt > 125000 || curRxOkCnt > 125000) // ( 0.125M * 8bit ) / 2 = 0.5M bits /sec ) - { - pDM_SWAT_Table->TrafficLoad = TRAFFIC_LOW; - Train_time_temp=pDM_SWAT_Table->Train_time ; - - if(pDM_SWAT_Table->Train_time_flag==3) - { - LowTraffic_TrainTime_L=10; - if(Train_time_temp<50) - Train_time_temp=LowTraffic_TrainTime_L; - else - Train_time_temp-=50; - } - else if(pDM_SWAT_Table->Train_time_flag==2) - { - Train_time_temp-=30; - LowTraffic_TrainTime_L=36; - } - else if(pDM_SWAT_Table->Train_time_flag==1) - { - Train_time_temp-=10; - LowTraffic_TrainTime_L=40; - } - else - Train_time_temp+=10; - - //-- - if(Train_time_temp >= LowTraffic_TrainTime_U) - Train_time_temp=LowTraffic_TrainTime_U; - - else if(Train_time_temp <= LowTraffic_TrainTime_L) - Train_time_temp=LowTraffic_TrainTime_L; - - pDM_SWAT_Table->Train_time = Train_time_temp; //50ms~20ms - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,(" Train_time_flag=((%d)) , Train_time=((%d)) \n",pDM_SWAT_Table->Train_time_flag, pDM_SWAT_Table->Train_time)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, (" [Low Traffic] \n" )); - } - else - { - pDM_SWAT_Table->TrafficLoad = TRAFFIC_UltraLOW; - pDM_SWAT_Table->Train_time = 0xc8; //200ms - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, (" [Ultra-Low Traffic] \n" )); - } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("TxOkCnt=(( %llu )), RxOkCnt=(( %llu )) \n", - curTxOkCnt ,curRxOkCnt )); - - //----------------- - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,(" Current MinMaxRSSI is ((%d)) \n",pDM_FatTable->MinMaxRSSI)); - - //---reset index--- - if(pDM_SWAT_Table->reset_idx>=reset_period) - { - pDM_FatTable->MinMaxRSSI=0; // - pDM_SWAT_Table->reset_idx=0; - } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("reset_idx = (( %d )) \n",pDM_SWAT_Table->reset_idx )); - //ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("reset_idx=%d\n",pDM_SWAT_Table->reset_idx)); - pDM_SWAT_Table->reset_idx++; - - //---double check flag--- - if(pDM_FatTable->MinMaxRSSI > SWAntDiv_threshold && pDM_SWAT_Table->Double_chk_flag== 0) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,(" MinMaxRSSI is ((%d)), and > %d \n", - pDM_FatTable->MinMaxRSSI,SWAntDiv_threshold)); - - pDM_SWAT_Table->Double_chk_flag =1; - pDM_SWAT_Table->try_flag = 1; - pDM_SWAT_Table->RSSI_Trying = 0; - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, (" Test the current Ant for (( %d )) ms again \n", pDM_SWAT_Table->Train_time)); - ODM_UpdateRxIdleAnt(pDM_Odm, pDM_FatTable->RxIdleAnt); - ODM_SetTimer(pDM_Odm,&pDM_SWAT_Table->SwAntennaSwitchTimer_8723B, pDM_SWAT_Table->Train_time ); //ms - return; - } - - nextAnt = (pDM_FatTable->RxIdleAnt == MAIN_ANT)? AUX_ANT : MAIN_ANT; - - pDM_SWAT_Table->try_flag = 1; - - if(pDM_SWAT_Table->reset_idx<=1) - pDM_SWAT_Table->RSSI_Trying = 2; - else - pDM_SWAT_Table->RSSI_Trying = 1; - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("[set try_flag=1] Normal State: Begin Trying!! \n")); - - } - - else if(pDM_SWAT_Table->try_flag == 1 && pDM_SWAT_Table->Double_chk_flag== 0) - { - nextAnt = (pDM_FatTable->RxIdleAnt == MAIN_ANT)? AUX_ANT : MAIN_ANT; - pDM_SWAT_Table->RSSI_Trying--; - } - - //1 Decision State - if((pDM_SWAT_Table->try_flag == 1)&&(pDM_SWAT_Table->RSSI_Trying == 0) ) - { - - for (i=0; ipODM_StaInfo[i]; - if(IS_STA_VALID(pEntry)) - { - //2 Caculate RSSI per Antenna - Main_RSSI = (pDM_FatTable->MainAnt_Cnt[i]!=0)?(pDM_FatTable->MainAnt_Sum[i]/pDM_FatTable->MainAnt_Cnt[i]):0; - Aux_RSSI = (pDM_FatTable->AuxAnt_Cnt[i]!=0)?(pDM_FatTable->AuxAnt_Sum[i]/pDM_FatTable->AuxAnt_Cnt[i]):0; - - if(pDM_FatTable->MainAnt_Cnt[i]<=1 && pDM_FatTable->CCK_counter_main>=1) - Main_RSSI=0; - - if(pDM_FatTable->AuxAnt_Cnt[i]<=1 && pDM_FatTable->CCK_counter_aux>=1) - Aux_RSSI=0; - - TargetAnt = (Main_RSSI==Aux_RSSI)?pDM_SWAT_Table->PreAntenna:((Main_RSSI>=Aux_RSSI)?MAIN_ANT:AUX_ANT); - LocalMaxRSSI = (Main_RSSI>=Aux_RSSI) ? Main_RSSI : Aux_RSSI; - LocalMinRSSI = (Main_RSSI>=Aux_RSSI) ? Aux_RSSI : Main_RSSI; - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*** CCK_counter_main = (( %d )) , CCK_counter_aux= (( %d )) \n", pDM_FatTable->CCK_counter_main, pDM_FatTable->CCK_counter_aux)); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*** OFDM_counter_main = (( %d )) , OFDM_counter_aux= (( %d )) \n", pDM_FatTable->OFDM_counter_main, pDM_FatTable->OFDM_counter_aux)); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*** Main_Cnt = (( %d )) , Main_RSSI= (( %d )) \n", pDM_FatTable->MainAnt_Cnt[i], Main_RSSI)); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*** Aux_Cnt = (( %d )) , Aux_RSSI = (( %d )) \n", pDM_FatTable->AuxAnt_Cnt[i] , Aux_RSSI )); - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*** MAC ID:[ %d ] , TargetAnt = (( %s )) \n", i ,( TargetAnt ==MAIN_ANT)?"MAIN_ANT":"AUX_ANT")); - - //2 Select RX Idle Antenna - - if (LocalMaxRSSI != 0 && LocalMaxRSSI < MinMaxRSSI) - { - RxIdleAnt = TargetAnt; - MinMaxRSSI = LocalMaxRSSI; - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*** LocalMaxRSSI-LocalMinRSSI = ((%d))\n",(LocalMaxRSSI-LocalMinRSSI))); - - if((LocalMaxRSSI-LocalMinRSSI)>8) - { - if(LocalMinRSSI != 0) - pDM_SWAT_Table->Train_time_flag=3; - else - { - if(MinMaxRSSI > SWAntDiv_threshold) - pDM_SWAT_Table->Train_time_flag=0; - else - pDM_SWAT_Table->Train_time_flag=3; - } - } - else if((LocalMaxRSSI-LocalMinRSSI)>5) - pDM_SWAT_Table->Train_time_flag=2; - else if((LocalMaxRSSI-LocalMinRSSI)>2) - pDM_SWAT_Table->Train_time_flag=1; - else - pDM_SWAT_Table->Train_time_flag=0; - - } - - //2 Select TX Antenna - if(TargetAnt == MAIN_ANT) - pDM_FatTable->antsel_a[i] = ANT1_2G; - else - pDM_FatTable->antsel_a[i] = ANT2_2G; - - } - pDM_FatTable->MainAnt_Sum[i] = 0; - pDM_FatTable->AuxAnt_Sum[i] = 0; - pDM_FatTable->MainAnt_Cnt[i] = 0; - pDM_FatTable->AuxAnt_Cnt[i] = 0; - pDM_FatTable->CCK_counter_main=0; - pDM_FatTable->CCK_counter_aux=0; - pDM_FatTable->OFDM_counter_main=0; - pDM_FatTable->OFDM_counter_aux=0; - - } - - - pDM_FatTable->MinMaxRSSI=MinMaxRSSI; - pDM_SWAT_Table->try_flag = 0; - - if( pDM_SWAT_Table->Double_chk_flag==1) - { - pDM_SWAT_Table->Double_chk_flag=0; - if(pDM_FatTable->MinMaxRSSI > SWAntDiv_threshold) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,(" [Double check] MinMaxRSSI ((%d)) > %d again!! \n", - pDM_FatTable->MinMaxRSSI,SWAntDiv_threshold)); - - ODM_UpdateRxIdleAnt(pDM_Odm, RxIdleAnt); - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("[reset try_flag = 0] Training accomplished !!!] \n\n\n")); - return; - } - else - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,(" [Double check] MinMaxRSSI ((%d)) <= %d !! \n", - pDM_FatTable->MinMaxRSSI,SWAntDiv_threshold)); - - nextAnt = (pDM_FatTable->RxIdleAnt == MAIN_ANT)? AUX_ANT : MAIN_ANT; - pDM_SWAT_Table->try_flag = 0; - pDM_SWAT_Table->reset_idx=reset_period; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("[set try_flag=0] Normal State: Need to tryg again!! \n\n\n")); - return; - } - } - else - { - pDM_SWAT_Table->PreAntenna =RxIdleAnt; - ODM_UpdateRxIdleAnt(pDM_Odm, RxIdleAnt ); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("[reset try_flag = 0] Training accomplished !!!] \n\n\n")); - return; - } - - } - - } - - //1 4.Change TRX antenna - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("RSSI_Trying = (( %d )), Ant: (( %s )) >>> (( %s )) \n", - pDM_SWAT_Table->RSSI_Trying, (pDM_FatTable->RxIdleAnt == MAIN_ANT?"MAIN":"AUX"),(nextAnt == MAIN_ANT?"MAIN":"AUX"))); - - ODM_UpdateRxIdleAnt(pDM_Odm, nextAnt); - - //1 5.Reset Statistics - - pDM_FatTable->RxIdleAnt = nextAnt; - - //1 6.Set next timer (Trying State) - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, (" Test ((%s)) Ant for (( %d )) ms \n", (nextAnt == MAIN_ANT?"MAIN":"AUX"), pDM_SWAT_Table->Train_time)); - ODM_SetTimer(pDM_Odm,&pDM_SWAT_Table->SwAntennaSwitchTimer_8723B, pDM_SWAT_Table->Train_time ); //ms -} - - -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) -VOID -ODM_SW_AntDiv_Callback( - PRT_TIMER pTimer -) -{ - PADAPTER Adapter = (PADAPTER)pTimer->Adapter; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - pSWAT_T pDM_SWAT_Table = &pHalData->DM_OutSrc.DM_SWAT_Table; - - #if DEV_BUS_TYPE==RT_PCI_INTERFACE - #if USE_WORKITEM - ODM_ScheduleWorkItem(&pDM_SWAT_Table->SwAntennaSwitchWorkitem_8723B); - #else - { - //DbgPrint("SW_antdiv_Callback"); - odm_S0S1_SwAntDiv(&pHalData->DM_OutSrc, SWAW_STEP_DETERMINE); - } - #endif - #else - ODM_ScheduleWorkItem(&pDM_SWAT_Table->SwAntennaSwitchWorkitem_8723B); - #endif -} -VOID -ODM_SW_AntDiv_WorkitemCallback( - IN PVOID pContext - ) -{ - PADAPTER pAdapter = (PADAPTER)pContext; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); - - //DbgPrint("SW_antdiv_Workitem_Callback"); - odm_S0S1_SwAntDiv(&pHalData->DM_OutSrc, SWAW_STEP_DETERMINE); -} -#endif //#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - -#if (DM_ODM_SUPPORT_TYPE == ODM_CE) -VOID -ODM_SW_AntDiv_Callback(void *FunctionContext) -{ - PDM_ODM_T pDM_Odm= (PDM_ODM_T)FunctionContext; - PADAPTER padapter = pDM_Odm->Adapter; - if(padapter->net_closed == _TRUE) - return; - //odm_S0S1_SwAntDiv(pDM_Odm, SWAW_STEP_DETERMINE); -} -#endif //#if (DM_ODM_SUPPORT_TYPE == ODM_CE) - -#endif //#if (RTL8723B_SUPPORT == 1) - - -#if(RTL8188E_SUPPORT == 1 || RTL8192E_SUPPORT == 1) -#if (!(DM_ODM_SUPPORT_TYPE == ODM_CE)) -VOID -odm_SetNextMACAddrTarget( - IN PDM_ODM_T pDM_Odm -) -{ - pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; - PSTA_INFO_T pEntry; - //u1Byte Bssid[6]; - u4Byte value32, i; - - // - //2012.03.26 LukeLee: The MAC address is changed according to MACID in turn - // - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("odm_SetNextMACAddrTarget() ==>\n")); - if(pDM_Odm->bLinked) - { - for (i=0; iTrainIdx+1) == ODM_ASSOCIATE_ENTRY_NUM) - pDM_FatTable->TrainIdx = 0; - else - pDM_FatTable->TrainIdx++; - - pEntry = pDM_Odm->pODM_StaInfo[pDM_FatTable->TrainIdx]; - if(IS_STA_VALID(pEntry)) - { - //Match MAC ADDR -#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) - value32 = (pEntry->hwaddr[5]<<8)|pEntry->hwaddr[4]; -#else - value32 = (pEntry->MacAddr[5]<<8)|pEntry->MacAddr[4]; -#endif - ODM_SetMACReg(pDM_Odm, 0x7b4, 0xFFFF, value32); -#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) - value32 = (pEntry->hwaddr[3]<<24)|(pEntry->hwaddr[2]<<16) |(pEntry->hwaddr[1]<<8) |pEntry->hwaddr[0]; -#else - value32 = (pEntry->MacAddr[3]<<24)|(pEntry->MacAddr[2]<<16) |(pEntry->MacAddr[1]<<8) |pEntry->MacAddr[0]; -#endif - ODM_SetMACReg(pDM_Odm, 0x7b0, bMaskDWord, value32); - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("pDM_FatTable->TrainIdx=%lu\n",pDM_FatTable->TrainIdx)); -#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Training MAC Addr = %x:%x:%x:%x:%x:%x\n", - pEntry->hwaddr[5],pEntry->hwaddr[4],pEntry->hwaddr[3],pEntry->hwaddr[2],pEntry->hwaddr[1],pEntry->hwaddr[0])); -#else - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Training MAC Addr = %x:%x:%x:%x:%x:%x\n", - pEntry->MacAddr[5],pEntry->MacAddr[4],pEntry->MacAddr[3],pEntry->MacAddr[2],pEntry->MacAddr[1],pEntry->MacAddr[0])); -#endif - - break; - } - } - - } - -#if 0 - // - //2012.03.26 LukeLee: This should be removed later, the MAC address is changed according to MACID in turn - // - #if( DM_ODM_SUPPORT_TYPE & ODM_WIN) - { - PADAPTER Adapter = pDM_Odm->Adapter; - PMGNT_INFO pMgntInfo = &Adapter->MgntInfo; - - for (i=0; i<6; i++) - { - Bssid[i] = pMgntInfo->Bssid[i]; - //DbgPrint("Bssid[%d]=%x\n", i, Bssid[i]); - } - } - #endif - - //odm_SetNextMACAddrTarget(pDM_Odm); - - //1 Select MAC Address Filter - for (i=0; i<6; i++) - { - if(Bssid[i] != pDM_FatTable->Bssid[i]) - { - bMatchBSSID = FALSE; - break; - } - } - if(bMatchBSSID == FALSE) - { - //Match MAC ADDR - value32 = (Bssid[5]<<8)|Bssid[4]; - ODM_SetMACReg(pDM_Odm, 0x7b4, 0xFFFF, value32); - value32 = (Bssid[3]<<24)|(Bssid[2]<<16) |(Bssid[1]<<8) |Bssid[0]; - ODM_SetMACReg(pDM_Odm, 0x7b0, bMaskDWord, value32); - } - - return bMatchBSSID; -#endif - -} - -VOID -odm_FastAntTraining( - IN PDM_ODM_T pDM_Odm -) -{ - u4Byte i, MaxRSSI=0; - u1Byte TargetAnt=2; - pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; - BOOLEAN bPktFilterMacth = FALSE; - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("==>odm_FastAntTraining()\n")); - - //1 TRAINING STATE - if(pDM_FatTable->FAT_State == FAT_TRAINING_STATE) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Enter FAT_TRAINING_STATE\n")); - //2 Caculate RSSI per Antenna - for (i=0; i<7; i++) - { - if(pDM_FatTable->antRSSIcnt[i] == 0) - pDM_FatTable->antAveRSSI[i] = 0; - else - { - pDM_FatTable->antAveRSSI[i] = pDM_FatTable->antSumRSSI[i] /pDM_FatTable->antRSSIcnt[i]; - bPktFilterMacth = TRUE; - } - if(pDM_FatTable->antAveRSSI[i] > MaxRSSI) - { - MaxRSSI = pDM_FatTable->antAveRSSI[i]; - TargetAnt = (u1Byte) i; - } - - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("pDM_FatTable->antAveRSSI[%lu] = %lu, pDM_FatTable->antRSSIcnt[%lu] = %lu\n", - i, pDM_FatTable->antAveRSSI[i], i, pDM_FatTable->antRSSIcnt[i])); - } - - //2 Select TRX Antenna - if(bPktFilterMacth == FALSE) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("None Packet is matched\n")); - - ODM_SetBBReg(pDM_Odm, 0xe08 , BIT16, 0); //RegE08[16]=1'b0 //disable fast training - ODM_SetBBReg(pDM_Odm, 0xc50 , BIT7, 0); //RegC50[7]=1'b0 //disable HW AntDiv - } - else - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("TargetAnt=%d, MaxRSSI=%lu\n",TargetAnt,MaxRSSI)); - - ODM_SetBBReg(pDM_Odm, 0xe08 , BIT16, 0); //RegE08[16]=1'b0 //disable fast training - //ODM_SetBBReg(pDM_Odm, 0xc50 , BIT7, 0); //RegC50[7]=1'b0 //disable HW AntDiv - ODM_SetBBReg(pDM_Odm, 0x864 , BIT8|BIT7|BIT6, TargetAnt); //Default RX is Omni, Optional RX is the best decision by FAT - //ODM_SetBBReg(pDM_Odm, 0x860 , BIT14|BIT13|BIT12, TargetAnt); //Default TX - ODM_SetBBReg(pDM_Odm, 0x80c , BIT21, 1); //Reg80c[21]=1'b1 //from TX Info - -#if 0 - pEntry = pDM_Odm->pODM_StaInfo[pDM_FatTable->TrainIdx]; - - if(IS_STA_VALID(pEntry)) - { - pEntry->antsel_a = TargetAnt&BIT0; - pEntry->antsel_b = (TargetAnt&BIT1)>>1; - pEntry->antsel_c = (TargetAnt&BIT2)>>2; - } -#else - pDM_FatTable->antsel_a[pDM_FatTable->TrainIdx] = TargetAnt&BIT0; - pDM_FatTable->antsel_b[pDM_FatTable->TrainIdx] = (TargetAnt&BIT1)>>1; - pDM_FatTable->antsel_c[pDM_FatTable->TrainIdx] = (TargetAnt&BIT2)>>2; -#endif - - - if(TargetAnt == 0) - ODM_SetBBReg(pDM_Odm, 0xc50 , BIT7, 0); //RegC50[7]=1'b0 //disable HW AntDiv - - } - - //2 Reset Counter - for(i=0; i<7; i++) - { - pDM_FatTable->antSumRSSI[i] = 0; - pDM_FatTable->antRSSIcnt[i] = 0; - } - - pDM_FatTable->FAT_State = FAT_NORMAL_STATE; - return; - } - - //1 NORMAL STATE - if(pDM_FatTable->FAT_State == FAT_NORMAL_STATE) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Enter FAT_NORMAL_STATE\n")); - - odm_SetNextMACAddrTarget(pDM_Odm); - -#if 0 - pEntry = pDM_Odm->pODM_StaInfo[pDM_FatTable->TrainIdx]; - if(IS_STA_VALID(pEntry)) - { - pEntry->antsel_a = TargetAnt&BIT0; - pEntry->antsel_b = (TargetAnt&BIT1)>>1; - pEntry->antsel_c = (TargetAnt&BIT2)>>2; - } -#endif - - //2 Prepare Training - pDM_FatTable->FAT_State = FAT_TRAINING_STATE; - ODM_SetBBReg(pDM_Odm, 0xe08 , BIT16, 1); //RegE08[16]=1'b1 //enable fast training - ODM_SetBBReg(pDM_Odm, 0xc50 , BIT7, 1); //RegC50[7]=1'b1 //enable HW AntDiv - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Start FAT_TRAINING_STATE\n")); - ODM_SetTimer(pDM_Odm,&pDM_Odm->FastAntTrainingTimer, 500 ); //ms - - } - -} - -VOID -odm_FastAntTrainingCallback( - IN PDM_ODM_T pDM_Odm -) -{ - -#if (DM_ODM_SUPPORT_TYPE == ODM_CE) - PADAPTER padapter = pDM_Odm->Adapter; - if(padapter->net_closed == _TRUE) - return; - //if(*pDM_Odm->pbNet_closed == TRUE) - // return; -#endif - -#if USE_WORKITEM - ODM_ScheduleWorkItem(&pDM_Odm->FastAntTrainingWorkitem); -#else - odm_FastAntTraining(pDM_Odm); -#endif -} - -VOID -odm_FastAntTrainingWorkItemCallback( - IN PDM_ODM_T pDM_Odm -) -{ - odm_FastAntTraining(pDM_Odm); -} -#endif - -#endif - - -VOID -ODM_AntDivInit( - IN PDM_ODM_T pDM_Odm - ) -{ - pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; - pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; - - - if(!(pDM_Odm->SupportAbility & ODM_BB_ANT_DIV)) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("[Return!!!] Not Support Antenna Diversity Function\n")); - return; - } - //--- -#if (DM_ODM_SUPPORT_TYPE == ODM_AP) - if(pDM_FatTable->AntDiv_2G_5G == ODM_ANTDIV_2G) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("[2G AntDiv Init]: Only Support 2G Antenna Diversity Function\n")); - if(!(pDM_Odm->SupportICType & ODM_ANTDIV_2G_SUPPORT_IC)) - return; - } - else if(pDM_FatTable->AntDiv_2G_5G == ODM_ANTDIV_5G) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("[5G AntDiv Init]: Only Support 5G Antenna Diversity Function\n")); - if(!(pDM_Odm->SupportICType & ODM_ANTDIV_5G_SUPPORT_IC)) - return; - } - else if(pDM_FatTable->AntDiv_2G_5G == (ODM_ANTDIV_2G|ODM_ANTDIV_5G)) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("[2G & 5G AntDiv Init]:Support Both 2G & 5G Antenna Diversity Function\n")); - } - - pDM_Odm->antdiv_rssi=0; - -#endif - //--- - - //2 [--General---] - pDM_Odm->antdiv_period=0; - pDM_Odm->antdiv_select=0; - pDM_SWAT_Table->Ant5G = MAIN_ANT; - pDM_SWAT_Table->Ant2G = MAIN_ANT; - pDM_FatTable->CCK_counter_main=0; - pDM_FatTable->CCK_counter_aux=0; - pDM_FatTable->OFDM_counter_main=0; - pDM_FatTable->OFDM_counter_aux=0; - - //3 [Set MAIN_ANT as default antenna if Auto-Ant enable] - if (pDM_Odm->antdiv_select==1) - pDM_Odm->AntType = ODM_FIX_MAIN_ANT; - else if (pDM_Odm->antdiv_select==2) - pDM_Odm->AntType = ODM_FIX_AUX_ANT; - else if(pDM_Odm->antdiv_select==0) - pDM_Odm->AntType = ODM_AUTO_ANT; - - if(pDM_Odm->AntType == ODM_AUTO_ANT) - { - odm_AntDiv_on_off(pDM_Odm, ANTDIV_OFF); - ODM_UpdateRxIdleAnt(pDM_Odm, MAIN_ANT); - } - else - { - odm_AntDiv_on_off(pDM_Odm, ANTDIV_OFF); - - if(pDM_Odm->AntType == ODM_FIX_MAIN_ANT) - { - ODM_UpdateRxIdleAnt(pDM_Odm, MAIN_ANT); - return; - } - else if(pDM_Odm->AntType == ODM_FIX_AUX_ANT) - { - ODM_UpdateRxIdleAnt(pDM_Odm, AUX_ANT); - return; - } - } - //--- - if(pDM_Odm->AntDivType != CGCS_RX_HW_ANTDIV) - { - if(pDM_Odm->SupportICType & ODM_N_ANTDIV_SUPPORT) - { - #if TX_BY_REG - ODM_SetBBReg(pDM_Odm, 0x80c , BIT21, 0); //Reg80c[21]=1'b0 //from Reg - #else - ODM_SetBBReg(pDM_Odm, 0x80c , BIT21, 1); - #endif - } - else if(pDM_Odm->SupportICType & ODM_AC_ANTDIV_SUPPORT) - { - #if TX_BY_REG - ODM_SetBBReg(pDM_Odm, 0x900 , BIT18, 0); - #else - ODM_SetBBReg(pDM_Odm, 0x900 , BIT18, 1); - #endif - } - } - - //2 [--88E---] - if(pDM_Odm->SupportICType == ODM_RTL8188E) - { - #if (RTL8188E_SUPPORT == 1) - //pDM_Odm->AntDivType = CGCS_RX_HW_ANTDIV; - //pDM_Odm->AntDivType = CG_TRX_HW_ANTDIV; - //pDM_Odm->AntDivType = CG_TRX_SMART_ANTDIV; - - if( (pDM_Odm->AntDivType != CGCS_RX_HW_ANTDIV) && (pDM_Odm->AntDivType != CG_TRX_HW_ANTDIV) && (pDM_Odm->AntDivType != CG_TRX_SMART_ANTDIV)) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("[Return!!!] 88E Not Supprrt This AntDiv Type\n")); - pDM_Odm->SupportAbility &= ~(ODM_BB_ANT_DIV); - return; - } - - if(pDM_Odm->AntDivType == CGCS_RX_HW_ANTDIV) - odm_RX_HWAntDiv_Init_88E(pDM_Odm); - else if(pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV) - odm_TRX_HWAntDiv_Init_88E(pDM_Odm); - else if(pDM_Odm->AntDivType == CG_TRX_SMART_ANTDIV) - odm_Smart_HWAntDiv_Init_88E(pDM_Odm); - #endif - } - - //2 [--92E---] - #if (RTL8192E_SUPPORT == 1) - else if(pDM_Odm->SupportICType == ODM_RTL8192E) - { - //pDM_Odm->AntDivType = CGCS_RX_HW_ANTDIV; - //pDM_Odm->AntDivType = CG_TRX_HW_ANTDIV; - //pDM_Odm->AntDivType = CG_TRX_SMART_ANTDIV; - - if( (pDM_Odm->AntDivType != CGCS_RX_HW_ANTDIV) && (pDM_Odm->AntDivType != CG_TRX_HW_ANTDIV) && (pDM_Odm->AntDivType != CG_TRX_SMART_ANTDIV)) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("[Return!!!] 8192E Not Supprrt This AntDiv Type\n")); - pDM_Odm->SupportAbility &= ~(ODM_BB_ANT_DIV); - return; - } - - if(pDM_Odm->AntDivType == CGCS_RX_HW_ANTDIV) - odm_RX_HWAntDiv_Init_92E(pDM_Odm); - else if(pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV) - odm_TRX_HWAntDiv_Init_92E(pDM_Odm); - else if(pDM_Odm->AntDivType == CG_TRX_SMART_ANTDIV) - odm_Smart_HWAntDiv_Init_92E(pDM_Odm); - - } - #endif - - //2 [--8723B---] - #if (RTL8723B_SUPPORT == 1) - else if(pDM_Odm->SupportICType == ODM_RTL8723B) - { - //pDM_Odm->AntDivType = S0S1_SW_ANTDIV; - //pDM_Odm->AntDivType = CG_TRX_HW_ANTDIV; - - if(pDM_Odm->AntDivType != S0S1_SW_ANTDIV && pDM_Odm->AntDivType != CG_TRX_HW_ANTDIV) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("[Return!!!] 8723B Not Supprrt This AntDiv Type\n")); - pDM_Odm->SupportAbility &= ~(ODM_BB_ANT_DIV); - return; - } - - if( pDM_Odm->AntDivType==S0S1_SW_ANTDIV) - odm_S0S1_SWAntDiv_Init_8723B(pDM_Odm); - else if(pDM_Odm->AntDivType==CG_TRX_HW_ANTDIV) - odm_TRX_HWAntDiv_Init_8723B(pDM_Odm); - } - #endif - - //2 [--8811A 8821A---] - #if (RTL8821A_SUPPORT == 1) - else if(pDM_Odm->SupportICType == ODM_RTL8821) - { - //pDM_Odm->AntDivType = CG_TRX_HW_ANTDIV; - pDM_Odm->AntDivType = S0S1_SW_ANTDIV; - - if( pDM_Odm->AntDivType != CG_TRX_HW_ANTDIV && pDM_Odm->AntDivType != S0S1_SW_ANTDIV) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("[Return!!!] 8821A & 8811A Not Supprrt This AntDiv Type\n")); - pDM_Odm->SupportAbility &= ~(ODM_BB_ANT_DIV); - return; - } - if(pDM_Odm->AntDivType==CG_TRX_HW_ANTDIV) - odm_TRX_HWAntDiv_Init_8821A(pDM_Odm); - else if( pDM_Odm->AntDivType==S0S1_SW_ANTDIV) - odm_S0S1_SWAntDiv_Init_8821A(pDM_Odm); - } - #endif - - //2 [--8881A---] - #if (RTL8881A_SUPPORT == 1) - else if(pDM_Odm->SupportICType == ODM_RTL8881A) - { - //pDM_Odm->AntDivType = CGCS_RX_HW_ANTDIV; - //pDM_Odm->AntDivType = CG_TRX_HW_ANTDIV; - - if(pDM_Odm->AntDivType != CGCS_RX_HW_ANTDIV && pDM_Odm->AntDivType != CG_TRX_HW_ANTDIV) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("[Return!!!] 8881A Not Supprrt This AntDiv Type\n")); - pDM_Odm->SupportAbility &= ~(ODM_BB_ANT_DIV); - return; - } - if(pDM_Odm->AntDivType == CGCS_RX_HW_ANTDIV) - odm_RX_HWAntDiv_Init_8881A(pDM_Odm); - else if(pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV) - odm_TRX_HWAntDiv_Init_8881A(pDM_Odm); - } - #endif - - //2 [--8812---] - #if (RTL8812A_SUPPORT == 1) - else if(pDM_Odm->SupportICType == ODM_RTL8812) - { - //pDM_Odm->AntDivType = CG_TRX_HW_ANTDIV; - - if( pDM_Odm->AntDivType != CG_TRX_HW_ANTDIV) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("[Return!!!] 8812A Not Supprrt This AntDiv Type\n")); - pDM_Odm->SupportAbility &= ~(ODM_BB_ANT_DIV); - return; - } - odm_TRX_HWAntDiv_Init_8812A(pDM_Odm); - } - #endif - //ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("*** SupportICType=[%lu] \n",pDM_Odm->SupportICType)); - //ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("*** AntDiv SupportAbility=[%lu] \n",(pDM_Odm->SupportAbility & ODM_BB_ANT_DIV)>>6)); - //ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("*** AntDiv Type=[%d] \n",pDM_Odm->AntDivType)); - -} - -VOID -ODM_AntDiv( - IN PDM_ODM_T pDM_Odm -) -{ - PADAPTER pAdapter = pDM_Odm->Adapter; - pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; - -//#if (DM_ODM_SUPPORT_TYPE == ODM_AP) - if(*pDM_Odm->pBandType == ODM_BAND_5G ) - { - if(pDM_FatTable->idx_AntDiv_counter_5G < pDM_Odm->antdiv_period ) - { - pDM_FatTable->idx_AntDiv_counter_5G++; - return; - } - else - pDM_FatTable->idx_AntDiv_counter_5G=0; - } - else if(*pDM_Odm->pBandType == ODM_BAND_2_4G ) - { - if(pDM_FatTable->idx_AntDiv_counter_2G < pDM_Odm->antdiv_period ) - { - pDM_FatTable->idx_AntDiv_counter_2G++; - return; - } - else - pDM_FatTable->idx_AntDiv_counter_2G=0; - } -//#endif - //---------- - if(!(pDM_Odm->SupportAbility & ODM_BB_ANT_DIV)) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("[Return!!!] Not Support Antenna Diversity Function\n")); - return; - } - - //---------- -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - if(pAdapter->MgntInfo.AntennaTest) - return; - - { - #if (BEAMFORMING_SUPPORT == 1) - BEAMFORMING_CAP BeamformCap = (pAdapter->MgntInfo.BeamformingInfo.BeamformCap); - - if( BeamformCap & BEAMFORMEE_CAP ) // BFmee On && Div On -> Div Off - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("[ AntDiv : OFF ] BFmee ==1 \n")); - if(pDM_Odm->SupportAbility & ODM_BB_ANT_DIV) - { - odm_AntDiv_on_off(pDM_Odm, ANTDIV_OFF); - pDM_Odm->SupportAbility &= ~(ODM_BB_ANT_DIV); - return; - } - } - else // BFmee Off && Div Off -> Div On - #endif - { - if(!(pDM_Odm->SupportAbility & ODM_BB_ANT_DIV) && pDM_Odm->bLinked) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("[ AntDiv : ON ] BFmee ==0 \n")); - if((pDM_Odm->AntDivType!=S0S1_SW_ANTDIV) ) - odm_AntDiv_on_off(pDM_Odm, ANTDIV_ON); - - pDM_Odm->SupportAbility |= (ODM_BB_ANT_DIV); - } - } - } -#endif - - //---------- -#if (DM_ODM_SUPPORT_TYPE == ODM_AP) - if(pDM_FatTable->AntDiv_2G_5G == ODM_ANTDIV_2G) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("[ 2G AntDiv Running ]\n")); - if(!(pDM_Odm->SupportICType & ODM_ANTDIV_2G_SUPPORT_IC)) - return; - } - else if(pDM_FatTable->AntDiv_2G_5G == ODM_ANTDIV_5G) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("[ 5G AntDiv Running ]\n")); - if(!(pDM_Odm->SupportICType & ODM_ANTDIV_5G_SUPPORT_IC)) - return; - } - else if(pDM_FatTable->AntDiv_2G_5G == (ODM_ANTDIV_2G|ODM_ANTDIV_5G)) - { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("[ 2G & 5G AntDiv Running ]\n")); - } -#endif - - //---------- - - if (pDM_Odm->antdiv_select==1) - pDM_Odm->AntType = ODM_FIX_MAIN_ANT; - else if (pDM_Odm->antdiv_select==2) - pDM_Odm->AntType = ODM_FIX_AUX_ANT; - else if (pDM_Odm->antdiv_select==0) - pDM_Odm->AntType = ODM_AUTO_ANT; - - //ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("AntType= (( %d )) , pre_AntType= (( %d )) \n",pDM_Odm->AntType,pDM_Odm->pre_AntType)); - - if(pDM_Odm->AntType != ODM_AUTO_ANT) - { - ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Fix Antenna at (( %s ))\n",(pDM_Odm->AntType == ODM_FIX_MAIN_ANT)?"MAIN":"AUX")); - - if(pDM_Odm->AntType != pDM_Odm->pre_AntType) - { - odm_AntDiv_on_off(pDM_Odm, ANTDIV_OFF); - - if(pDM_Odm->SupportICType & ODM_N_ANTDIV_SUPPORT) - ODM_SetBBReg(pDM_Odm, 0x80c , BIT21, 0); - else if(pDM_Odm->SupportICType & ODM_AC_ANTDIV_SUPPORT) - ODM_SetBBReg(pDM_Odm, 0x900 , BIT18, 0); - - if(pDM_Odm->AntType == ODM_FIX_MAIN_ANT) - ODM_UpdateRxIdleAnt(pDM_Odm, MAIN_ANT); - else if(pDM_Odm->AntType == ODM_FIX_AUX_ANT) - ODM_UpdateRxIdleAnt(pDM_Odm, AUX_ANT); - } - pDM_Odm->pre_AntType=pDM_Odm->AntType; - return; - } - else - { - if(pDM_Odm->AntType != pDM_Odm->pre_AntType) - { - odm_AntDiv_on_off(pDM_Odm, ANTDIV_ON); - if(pDM_Odm->SupportICType & ODM_N_ANTDIV_SUPPORT) - ODM_SetBBReg(pDM_Odm, 0x80c , BIT21, 1); - else if(pDM_Odm->SupportICType & ODM_AC_ANTDIV_SUPPORT) - ODM_SetBBReg(pDM_Odm, 0x900 , BIT18, 1); - } - pDM_Odm->pre_AntType=pDM_Odm->AntType; - } - - - //3 ----------------------------------------------------------------------------------------------------------- - //2 [--88E---] - if(pDM_Odm->SupportICType == ODM_RTL8188E) - { - #if (RTL8188E_SUPPORT == 1) - if(pDM_Odm->AntDivType==CG_TRX_HW_ANTDIV ||pDM_Odm->AntDivType==CGCS_RX_HW_ANTDIV) - odm_HW_AntDiv(pDM_Odm); - #if (!(DM_ODM_SUPPORT_TYPE == ODM_CE)) - else if (pDM_Odm->AntDivType==CG_TRX_SMART_ANTDIV) - odm_FastAntTraining(pDM_Odm); - #endif - #endif - } - //2 [--92E---] - #if (RTL8192E_SUPPORT == 1) - else if(pDM_Odm->SupportICType == ODM_RTL8192E) - { - if(pDM_Odm->AntDivType==CGCS_RX_HW_ANTDIV) - odm_HW_AntDiv(pDM_Odm); - #if (!(DM_ODM_SUPPORT_TYPE == ODM_CE)) - else if (pDM_Odm->AntDivType==CG_TRX_SMART_ANTDIV) - odm_FastAntTraining(pDM_Odm); - #endif - } - #endif - - #if (RTL8723B_SUPPORT == 1) - //2 [--8723B---] - else if(pDM_Odm->SupportICType == ODM_RTL8723B) - { - if (pDM_Odm->AntDivType==S0S1_SW_ANTDIV) - odm_S0S1_SwAntDiv(pDM_Odm, SWAW_STEP_PEAK); - else if (pDM_Odm->AntDivType==CG_TRX_HW_ANTDIV) - odm_HW_AntDiv(pDM_Odm); - } - #endif - - //2 [--8821A---] - #if (RTL8821A_SUPPORT == 1) - else if(pDM_Odm->SupportICType == ODM_RTL8821) - { - if(pDM_Odm->bBtDisabled) //BT disabled - { - if(pDM_Odm->AntDivType == S0S1_SW_ANTDIV) - { - pDM_Odm->AntDivType=CG_TRX_HW_ANTDIV; - ODM_SetBBReg(pDM_Odm, 0x8D4 , BIT24, 1); - } - } - else //BT enabled - { - if(pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV) - { - pDM_Odm->AntDivType=S0S1_SW_ANTDIV; - ODM_SetBBReg(pDM_Odm, 0x8D4 , BIT24, 0); - } - } - - if (pDM_Odm->AntDivType==S0S1_SW_ANTDIV) - odm_S0S1_SwAntDiv(pDM_Odm, SWAW_STEP_PEAK); - else if (pDM_Odm->AntDivType==CG_TRX_HW_ANTDIV) - odm_HW_AntDiv(pDM_Odm); - } - #endif - //2 [--8881A---] - #if (RTL8881A_SUPPORT == 1) - else if(pDM_Odm->SupportICType == ODM_RTL8881A) - odm_HW_AntDiv(pDM_Odm); - #endif - //2 [--8812A---] - #if (RTL8812A_SUPPORT == 1) - else if(pDM_Odm->SupportICType == ODM_RTL8812) - odm_HW_AntDiv(pDM_Odm); - #endif -} - - -VOID -odm_AntselStatistics( - IN PDM_ODM_T pDM_Odm, - IN u1Byte antsel_tr_mux, - IN u4Byte MacId, - IN u4Byte RxPWDBAll -) -{ - pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; - - if(antsel_tr_mux == ANT1_2G) - { - pDM_FatTable->MainAnt_Sum[MacId]+=RxPWDBAll; - pDM_FatTable->MainAnt_Cnt[MacId]++; - } - else - { - pDM_FatTable->AuxAnt_Sum[MacId]+=RxPWDBAll; - pDM_FatTable->AuxAnt_Cnt[MacId]++; - } -} - - -VOID -ODM_Process_RSSIForAntDiv( - IN OUT PDM_ODM_T pDM_Odm, - IN PODM_PHY_INFO_T pPhyInfo, - IN PODM_PACKET_INFO_T pPktinfo - ) -{ -u1Byte isCCKrate=0,CCKMaxRate=DESC_RATE11M; -pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; - -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN)) - u4Byte RxPower_Ant0, RxPower_Ant1; -#else - u1Byte RxPower_Ant0, RxPower_Ant1; -#endif - - if(pDM_Odm->SupportICType & ODM_N_ANTDIV_SUPPORT) - CCKMaxRate=DESC_RATE11M; - else if(pDM_Odm->SupportICType & ODM_AC_ANTDIV_SUPPORT) - CCKMaxRate=DESC_RATE11M; - isCCKrate = (pPktinfo->DataRate <= CCKMaxRate)?TRUE:FALSE; - -#if ((RTL8192C_SUPPORT == 1) ||(RTL8192D_SUPPORT == 1)) - if(pDM_Odm->SupportICType & ODM_RTL8192C|ODM_RTL8192D) - { - if(pPktinfo->bPacketToSelf || pPktinfo->bPacketBeacon) - { - //if(pPktinfo->bPacketBeacon) - //{ - // DbgPrint("This is beacon, isCCKrate=%d\n", isCCKrate); - //} - ODM_AntselStatistics_88C(pDM_Odm, pPktinfo->StationID, pPhyInfo->RxPWDBAll, isCCKrate); - } - } -#endif - - if( (pDM_Odm->SupportICType == ODM_RTL8192E||pDM_Odm->SupportICType == ODM_RTL8812) && (pPktinfo->DataRate > CCKMaxRate) ) - { - RxPower_Ant0 = pPhyInfo->RxMIMOSignalStrength[0]; - RxPower_Ant1= pPhyInfo->RxMIMOSignalStrength[1]; - } - else - RxPower_Ant0=pPhyInfo->RxPWDBAll; - - if(pDM_Odm->AntDivType == CG_TRX_SMART_ANTDIV) - { - if( (pDM_Odm->SupportICType & ODM_SMART_ANT_SUPPORT) && pPktinfo->bPacketToSelf && pDM_FatTable->FAT_State == FAT_TRAINING_STATE )//(pPktinfo->bPacketMatchBSSID && (!pPktinfo->bPacketBeacon)) - { - u1Byte antsel_tr_mux; - antsel_tr_mux = (pDM_FatTable->antsel_rx_keep_2<<2) |(pDM_FatTable->antsel_rx_keep_1 <<1) |pDM_FatTable->antsel_rx_keep_0; - pDM_FatTable->antSumRSSI[antsel_tr_mux] += RxPower_Ant0; - pDM_FatTable->antRSSIcnt[antsel_tr_mux]++; - } - } - else //AntDivType != CG_TRX_SMART_ANTDIV - { - if( ( pDM_Odm->SupportICType & ODM_ANTDIV_SUPPORT ) && (pPktinfo->bPacketToSelf || pPktinfo->bPacketMatchBSSID) ) - { - if(pDM_Odm->SupportICType == ODM_RTL8188E || pDM_Odm->SupportICType == ODM_RTL8192E) - odm_AntselStatistics(pDM_Odm, pDM_FatTable->antsel_rx_keep_0, pPktinfo->StationID,RxPower_Ant0); - else// SupportICType == ODM_RTL8821 and ODM_RTL8723B and ODM_RTL8812) - { - if(isCCKrate && (pDM_Odm->AntDivType == S0S1_SW_ANTDIV)) - { - pDM_FatTable->antsel_rx_keep_0 = (pDM_FatTable->RxIdleAnt == MAIN_ANT) ? ANT1_2G : ANT2_2G; - - - if(pDM_FatTable->antsel_rx_keep_0==ANT1_2G) - pDM_FatTable->CCK_counter_main++; - else// if(pDM_FatTable->antsel_rx_keep_0==ANT2_2G) - pDM_FatTable->CCK_counter_aux++; - - odm_AntselStatistics(pDM_Odm, pDM_FatTable->antsel_rx_keep_0, pPktinfo->StationID, RxPower_Ant0); - } - else - { - - if(pDM_FatTable->antsel_rx_keep_0==ANT1_2G) - pDM_FatTable->OFDM_counter_main++; - else// if(pDM_FatTable->antsel_rx_keep_0==ANT2_2G) - pDM_FatTable->OFDM_counter_aux++; - odm_AntselStatistics(pDM_Odm, pDM_FatTable->antsel_rx_keep_0, pPktinfo->StationID, RxPower_Ant0); - } - } - } - } - //ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("isCCKrate=%d, PWDB_ALL=%d\n",isCCKrate, pPhyInfo->RxPWDBAll)); - //ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("antsel_tr_mux=3'b%d%d%d\n",pDM_FatTable->antsel_rx_keep_2, pDM_FatTable->antsel_rx_keep_1, pDM_FatTable->antsel_rx_keep_0)); -} - -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) -VOID -ODM_SetTxAntByTxInfo( - IN PDM_ODM_T pDM_Odm, - IN pu1Byte pDesc, - IN u1Byte macId -) -{ - pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; - - if(!(pDM_Odm->SupportAbility & ODM_BB_ANT_DIV)) - return; - - if(pDM_Odm->AntDivType==CGCS_RX_HW_ANTDIV) - return; - - - if(pDM_Odm->SupportICType == ODM_RTL8723B) - { -#if (RTL8723B_SUPPORT == 1) - SET_TX_DESC_ANTSEL_A_8723B(pDesc, pDM_FatTable->antsel_a[macId]); - //ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[8723B] SetTxAntByTxInfo_WIN: MacID=%d, antsel_tr_mux=3'b%d%d%d\n", - //macId, pDM_FatTable->antsel_c[macId], pDM_FatTable->antsel_b[macId], pDM_FatTable->antsel_a[macId])); -#endif - } - else if(pDM_Odm->SupportICType == ODM_RTL8821) - { -#if (RTL8821A_SUPPORT == 1) - SET_TX_DESC_ANTSEL_A_8812(pDesc, pDM_FatTable->antsel_a[macId]); - //ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[8821A] SetTxAntByTxInfo_WIN: MacID=%d, antsel_tr_mux=3'b%d%d%d\n", - //macId, pDM_FatTable->antsel_c[macId], pDM_FatTable->antsel_b[macId], pDM_FatTable->antsel_a[macId])); -#endif - } - else if(pDM_Odm->SupportICType == ODM_RTL8188E) - { -#if (RTL8188E_SUPPORT == 1) - SET_TX_DESC_ANTSEL_A_88E(pDesc, pDM_FatTable->antsel_a[macId]); - SET_TX_DESC_ANTSEL_B_88E(pDesc, pDM_FatTable->antsel_b[macId]); - SET_TX_DESC_ANTSEL_C_88E(pDesc, pDM_FatTable->antsel_c[macId]); - //ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[8188E] SetTxAntByTxInfo_WIN: MacID=%d, antsel_tr_mux=3'b%d%d%d\n", - //macId, pDM_FatTable->antsel_c[macId], pDM_FatTable->antsel_b[macId], pDM_FatTable->antsel_a[macId])); -#endif - } - else if(pDM_Odm->SupportICType == ODM_RTL8192E) - { - - - } -} -#else// (DM_ODM_SUPPORT_TYPE == ODM_AP) - -VOID -ODM_SetTxAntByTxInfo( - //IN PDM_ODM_T pDM_Odm, - struct rtl8192cd_priv *priv, - struct tx_desc *pdesc, - struct tx_insn *txcfg, - unsigned short aid -) -{ - pFAT_T pDM_FatTable = &priv->pshare->_dmODM.DM_FatTable; - u4Byte SupportICType=priv->pshare->_dmODM.SupportICType; - - if(SupportICType == ODM_RTL8881A) - { - //panic_printk("[%s] [%d] ******ODM_SetTxAntByTxInfo_8881E****** \n",__FUNCTION__,__LINE__); - pdesc->Dword6 &= set_desc(~ (BIT(18)|BIT(17)|BIT(16))); - pdesc->Dword6 |= set_desc(pDM_FatTable->antsel_a[aid]<<16); - } - else if(SupportICType == ODM_RTL8192E) - { - //panic_printk("[%s] [%d] ******ODM_SetTxAntByTxInfo_8192E****** \n",__FUNCTION__,__LINE__); - pdesc->Dword6 &= set_desc(~ (BIT(18)|BIT(17)|BIT(16))); - pdesc->Dword6 |= set_desc(pDM_FatTable->antsel_a[aid]<<16); - } - else if(SupportICType == ODM_RTL8812) - { - //3 [path-A] - //panic_printk("[%s] [%d] ******ODM_SetTxAntByTxInfo_8881E****** \n",__FUNCTION__,__LINE__); - - pdesc->Dword6 &= set_desc(~ BIT(16)); - pdesc->Dword6 &= set_desc(~ BIT(17)); - pdesc->Dword6 &= set_desc(~ BIT(18)); - if(txcfg->pstat) - { - pdesc->Dword6 |= set_desc(pDM_FatTable->antsel_a[aid]<<16); - pdesc->Dword6 |= set_desc(pDM_FatTable->antsel_b[aid]<<17); - pdesc->Dword6 |= set_desc(pDM_FatTable->antsel_c[aid]<<18); - } - } -} -#endif - -#else - -VOID ODM_AntDivInit( IN PDM_ODM_T pDM_Odm ){} -VOID ODM_AntDiv( IN PDM_ODM_T pDM_Odm){} - -#endif //#if (defined(CONFIG_HW_ANTENNA_DIVERSITY)) - - diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_AntDiv.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_AntDiv.h deleted file mode 100755 index 832ee6b4f3cb7c..00000000000000 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_AntDiv.h +++ /dev/null @@ -1,136 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * - ******************************************************************************/ - -#ifndef __ODMANTDIV_H__ -#define __ODMANTDIV_H__ - - - -#define ANT1_2G 0 // = ANT2_5G -#define ANT2_2G 1 // = ANT1_5G - -//Antenna Diversty Control Type -#define ODM_AUTO_ANT 0 -#define ODM_FIX_MAIN_ANT 1 -#define ODM_FIX_AUX_ANT 2 - -#define TX_BY_REG 0 - -#if (DM_ODM_SUPPORT_TYPE != ODM_AP) -#define ODM_RTL8881A 0 //Just for windows driver to jointly use ODM-driver -#endif - -#define ODM_ANTDIV_SUPPORT (ODM_RTL8188E|ODM_RTL8192E|ODM_RTL8723B|ODM_RTL8821|ODM_RTL8881A|ODM_RTL8812) -#define ODM_N_ANTDIV_SUPPORT (ODM_RTL8188E|ODM_RTL8192E|ODM_RTL8723B) -#define ODM_AC_ANTDIV_SUPPORT (ODM_RTL8821|ODM_RTL8881A|ODM_RTL8812) -#define ODM_SMART_ANT_SUPPORT (ODM_RTL8188E|ODM_RTL8192E) - -#define ODM_ANTDIV_2G_SUPPORT_IC (ODM_RTL8188E|ODM_RTL8192E|ODM_RTL8723B|ODM_RTL8881A) -#define ODM_ANTDIV_5G_SUPPORT_IC (ODM_RTL8821|ODM_RTL8881A|ODM_RTL8812) -#define ODM_ANTDIV_2G BIT0 -#define ODM_ANTDIV_5G BIT1 - -#define ANTDIV_ON 1 -#define ANTDIV_OFF 0 - -VOID -ODM_AntDivInit( - IN PDM_ODM_T pDM_Odm -); - -VOID -ODM_AntDiv( - IN PDM_ODM_T pDM_Odm -); - -#if (defined(CONFIG_HW_ANTENNA_DIVERSITY)) - -VOID -ODM_UpdateRxIdleAnt( - IN PDM_ODM_T pDM_Odm, - IN u1Byte Ant -); - -#if (RTL8723B_SUPPORT == 1)||(RTL8821A_SUPPORT == 1) -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) -VOID -ODM_SW_AntDiv_Callback( - IN PRT_TIMER pTimer -); - -VOID -ODM_SW_AntDiv_WorkitemCallback( - IN PVOID pContext -); -#endif //#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) -#if (DM_ODM_SUPPORT_TYPE == ODM_CE) -VOID -ODM_SW_AntDiv_Callback(void *FunctionContext); -#endif //#if (DM_ODM_SUPPORT_TYPE == ODM_CE) -#endif - -#if(RTL8188E_SUPPORT == 1 || RTL8192E_SUPPORT == 1) -#if ( !(DM_ODM_SUPPORT_TYPE == ODM_CE)) -VOID -odm_FastAntTraining( - IN PDM_ODM_T pDM_Odm -); - -VOID -odm_FastAntTrainingCallback( - IN PDM_ODM_T pDM_Odm -); - -VOID -odm_FastAntTrainingWorkItemCallback( - IN PDM_ODM_T pDM_Odm -); -#endif -#endif - -VOID -ODM_Process_RSSIForAntDiv( - IN OUT PDM_ODM_T pDM_Odm, - IN PODM_PHY_INFO_T pPhyInfo, - IN PODM_PACKET_INFO_T pPktinfo -); - -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) -VOID -ODM_SetTxAntByTxInfo( - IN PDM_ODM_T pDM_Odm, - IN pu1Byte pDesc, - IN u1Byte macId -); - -#else// (DM_ODM_SUPPORT_TYPE == ODM_AP) -VOID -ODM_SetTxAntByTxInfo( - //IN PDM_ODM_T pDM_Odm, - struct rtl8192cd_priv *priv, - struct tx_desc *pdesc, - struct tx_insn *txcfg, - unsigned short aid -); - -#endif - -#endif //#if (defined(CONFIG_HW_ANTENNA_DIVERSITY)) -#endif //#ifndef __ODMANTDIV_H__ diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_debug.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_debug.c deleted file mode 100755 index 1547ff10450bfb..00000000000000 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_debug.c +++ /dev/null @@ -1,629 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * - ******************************************************************************/ - -//============================================================ -// include files -//============================================================ - -#include "odm_precomp.h" - - -VOID -ODM_InitDebugSetting( - IN PDM_ODM_T pDM_Odm - ) -{ -pDM_Odm->DebugLevel = ODM_DBG_LOUD; - -pDM_Odm->DebugComponents = -\ -#if DBG -//BB Functions -// ODM_COMP_DIG | -// ODM_COMP_RA_MASK | -// ODM_COMP_DYNAMIC_TXPWR | -// ODM_COMP_FA_CNT | -// ODM_COMP_RSSI_MONITOR | -// ODM_COMP_CCK_PD | -// ODM_COMP_ANT_DIV | -// ODM_COMP_PWR_SAVE | -// ODM_COMP_PWR_TRAIN | -// ODM_COMP_RATE_ADAPTIVE | -// ODM_COMP_PATH_DIV | -// ODM_COMP_DYNAMIC_PRICCA | -// ODM_COMP_RXHP | -// ODM_COMP_MP | -// ODM_COMP_DYNAMIC_ATC | - -//MAC Functions -// ODM_COMP_EDCA_TURBO | -// ODM_COMP_EARLY_MODE | -//RF Functions -// ODM_COMP_TX_PWR_TRACK | -// ODM_COMP_RX_GAIN_TRACK | -// ODM_COMP_CALIBRATION | -//Common -// ODM_COMP_COMMON | -// ODM_COMP_INIT | -// ODM_COMP_PSD | -#endif - 0; -} - -#if 0 -/*------------------Declare variable----------------------- -// Define debug flag array for common debug print macro. */ -u4Byte ODM_DBGP_Type[ODM_DBGP_TYPE_MAX]; - -/* Define debug print header for every service module. */ -ODM_DBGP_HEAD_T ODM_DBGP_Head; - - -/*----------------------------------------------------------------------------- - * Function: DBGP_Flag_Init - * - * Overview: Refresh all debug print control flag content to zero. - * - * Input: NONE - * - * Output: NONE - * - * Return: NONE - * - * Revised History: - * When Who Remark - * 10/20/2006 MHC Create Version 0. - * - *---------------------------------------------------------------------------*/ -extern void ODM_DBGP_Flag_Init(void) -{ - u1Byte i; - - for (i = 0; i < ODM_DBGP_TYPE_MAX; i++) - { - ODM_DBGP_Type[i] = 0; - } - -#ifndef ADSL_AP_BUILD_WORKAROUND -#if DBG - // 2010/06/02 MH Free build driver can not out any debug message!!! - // Init Debug flag enable condition - - ODM_DBGP_Type[FINIT] = \ -// INIT_EEPROM | -// INIT_TxPower | -// INIT_IQK | -// INIT_RF | - 0; - - ODM_DBGP_Type[FDM] = \ -// WA_IOT | -// DM_PWDB | -// DM_Monitor | -// DM_DIG | -// DM_EDCA_Turbo | -// DM_BT30 | - 0; - - ODM_DBGP_Type[FIOCTL] = \ -// IOCTL_IRP | -// IOCTL_IRP_DETAIL | -// IOCTL_IRP_STATISTICS | -// IOCTL_IRP_HANDLE | -// IOCTL_BT_HCICMD | -// IOCTL_BT_HCICMD_DETAIL | -// IOCTL_BT_HCICMD_EXT | -// IOCTL_BT_EVENT | -// IOCTL_BT_EVENT_DETAIL | -// IOCTL_BT_EVENT_PERIODICAL | -// IOCTL_BT_TX_ACLDATA | -// IOCTL_BT_TX_ACLDATA_DETAIL | -// IOCTL_BT_RX_ACLDATA | -// IOCTL_BT_RX_ACLDATA_DETAIL | -// IOCTL_BT_TP | -// IOCTL_STATE | -// IOCTL_BT_LOGO | -// IOCTL_CALLBACK_FUN | -// IOCTL_PARSE_BT_PKT | - 0; - - ODM_DBGP_Type[FBT] = \ -// BT_TRACE | - 0; - - ODM_DBGP_Type[FEEPROM] = \ -// EEPROM_W | -// EFUSE_PG | -// EFUSE_READ_ALL | -// EFUSE_ANALYSIS | -// EFUSE_PG_DETAIL | - 0; - - ODM_DBGP_Type[FDBG_CTRL] = \ -// DBG_CTRL_TRACE | -// DBG_CTRL_INBAND_NOISE | - 0; - - // 2011/07/20 MH Add for short cut - ODM_DBGP_Type[FSHORT_CUT] = \ -// SHCUT_TX | -// SHCUT_RX | - 0; - -#endif -#endif - /* Define debug header of every service module. */ - //ODM_DBGP_Head.pMANS = "\n\r[MANS] "; - //ODM_DBGP_Head.pRTOS = "\n\r[RTOS] "; - //ODM_DBGP_Head.pALM = "\n\r[ALM] "; - //ODM_DBGP_Head.pPEM = "\n\r[PEM] "; - //ODM_DBGP_Head.pCMPK = "\n\r[CMPK] "; - //ODM_DBGP_Head.pRAPD = "\n\r[RAPD] "; - //ODM_DBGP_Head.pTXPB = "\n\r[TXPB] "; - //ODM_DBGP_Head.pQUMG = "\n\r[QUMG] "; - -} /* DBGP_Flag_Init */ - -#endif - - -#if 0 -u4Byte GlobalDebugLevel = DBG_LOUD; -// -// 2009/06/22 MH Allow Fre build to print none debug info at init time. -// -#if DBG -u8Byte GlobalDebugComponents = \ -// COMP_TRACE | -// COMP_DBG | -// COMP_INIT | -// COMP_OID_QUERY | -// COMP_OID_SET | -// COMP_RECV | -// COMP_SEND | -// COMP_IO | -// COMP_POWER | -// COMP_MLME | -// COMP_SCAN | -// COMP_SYSTEM | -// COMP_SEC | -// COMP_AP | -// COMP_TURBO | -// COMP_QOS | -// COMP_AUTHENTICATOR | -// COMP_BEACON | -// COMP_ANTENNA | -// COMP_RATE | -// COMP_EVENTS | -// COMP_FPGA | -// COMP_RM | -// COMP_MP | -// COMP_RXDESC | -// COMP_CKIP | -// COMP_DIG | -// COMP_TXAGC | -// COMP_HIPWR | -// COMP_HALDM | -// COMP_RSNA | -// COMP_INDIC | -// COMP_LED | -// COMP_RF | -// COMP_DUALMACSWITCH | -// COMP_EASY_CONCURRENT | - -//1!!!!!!!!!!!!!!!!!!!!!!!!!!! -//1//1Attention Please!!!<11n or 8190 specific code should be put below this line> -//1!!!!!!!!!!!!!!!!!!!!!!!!!!! - -// COMP_HT | -// COMP_POWER_TRACKING | -// COMP_RX_REORDER | -// COMP_AMSDU | -// COMP_WPS | -// COMP_RATR | -// COMP_RESET | -// COMP_CMD | -// COMP_EFUSE | -// COMP_MESH_INTERWORKING | -// COMP_CCX | -// COMP_IOCTL | -// COMP_GP | -// COMP_TXAGG | -// COMP_BB_POWERSAVING | -// COMP_SWAS | -// COMP_P2P | -// COMP_MUX | -// COMP_FUNC | -// COMP_TDLS | -// COMP_OMNIPEEK | -// COMP_PSD | - 0; - - -#else -u8Byte GlobalDebugComponents = 0; -#endif - -#if (RT_PLATFORM==PLATFORM_LINUX) -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) -EXPORT_SYMBOL(GlobalDebugComponents); -EXPORT_SYMBOL(GlobalDebugLevel); -#endif -#endif - -/*------------------Declare variable----------------------- -// Define debug flag array for common debug print macro. */ -u4Byte DBGP_Type[DBGP_TYPE_MAX]; - -/* Define debug print header for every service module. */ -DBGP_HEAD_T DBGP_Head; - - -/*----------------------------------------------------------------------------- - * Function: DBGP_Flag_Init - * - * Overview: Refresh all debug print control flag content to zero. - * - * Input: NONE - * - * Output: NONE - * - * Return: NONE - * - * Revised History: - * When Who Remark - * 10/20/2006 MHC Create Version 0. - * - *---------------------------------------------------------------------------*/ -extern void DBGP_Flag_Init(void) -{ - u1Byte i; - - for (i = 0; i < DBGP_TYPE_MAX; i++) - { - DBGP_Type[i] = 0; - } - -#if DBG - // 2010/06/02 MH Free build driver can not out any debug message!!! - // Init Debug flag enable condition - - DBGP_Type[FINIT] = \ -// INIT_EEPROM | -// INIT_TxPower | -// INIT_IQK | -// INIT_RF | - 0; - - DBGP_Type[FDM] = \ -// WA_IOT | -// DM_PWDB | -// DM_Monitor | -// DM_DIG | -// DM_EDCA_Turbo | -// DM_BT30 | - 0; - - DBGP_Type[FIOCTL] = \ -// IOCTL_IRP | -// IOCTL_IRP_DETAIL | -// IOCTL_IRP_STATISTICS | -// IOCTL_IRP_HANDLE | -// IOCTL_BT_HCICMD | -// IOCTL_BT_HCICMD_DETAIL | -// IOCTL_BT_HCICMD_EXT | -// IOCTL_BT_EVENT | -// IOCTL_BT_EVENT_DETAIL | -// IOCTL_BT_EVENT_PERIODICAL | -// IOCTL_BT_TX_ACLDATA | -// IOCTL_BT_TX_ACLDATA_DETAIL | -// IOCTL_BT_RX_ACLDATA | -// IOCTL_BT_RX_ACLDATA_DETAIL | -// IOCTL_BT_TP | -// IOCTL_STATE | -// IOCTL_BT_LOGO | -// IOCTL_CALLBACK_FUN | -// IOCTL_PARSE_BT_PKT | - 0; - - DBGP_Type[FBT] = \ -// BT_TRACE | - 0; - - DBGP_Type[FEEPROM] = \ -// EEPROM_W | -// EFUSE_PG | -// EFUSE_READ_ALL | -// EFUSE_ANALYSIS | -// EFUSE_PG_DETAIL | - 0; - - DBGP_Type[FDBG_CTRL] = \ -// DBG_CTRL_TRACE | -// DBG_CTRL_INBAND_NOISE | - 0; - - // 2011/07/20 MH Add for short cut - DBGP_Type[FSHORT_CUT] = \ -// SHCUT_TX | -// SHCUT_RX | - 0; - -#endif - /* Define debug header of every service module. */ - DBGP_Head.pMANS = "\n\r[MANS] "; - DBGP_Head.pRTOS = "\n\r[RTOS] "; - DBGP_Head.pALM = "\n\r[ALM] "; - DBGP_Head.pPEM = "\n\r[PEM] "; - DBGP_Head.pCMPK = "\n\r[CMPK] "; - DBGP_Head.pRAPD = "\n\r[RAPD] "; - DBGP_Head.pTXPB = "\n\r[TXPB] "; - DBGP_Head.pQUMG = "\n\r[QUMG] "; - -} /* DBGP_Flag_Init */ - - -/*----------------------------------------------------------------------------- - * Function: DBG_PrintAllFlag - * - * Overview: Print All debug flag - * - * Input: NONE - * - * Output: NONE - * - * Return: NONE - * - * Revised History: - * When Who Remark - * 12/10/2008 MHC Create Version 0. - * - *---------------------------------------------------------------------------*/ -extern void DBG_PrintAllFlag(void) -{ - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 0 FQoS\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 1 FTX\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 2 FRX\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 3 FSEC\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 4 FMGNT\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 5 FMLME\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 6 FRESOURCE\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 7 FBEACON\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 8 FISR\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 9 FPHY\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 11 FMP\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 12 FPWR\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 13 FDM\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 14 FDBG_CTRL\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 15 FC2H\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 16 FBT\n")); -} // DBG_PrintAllFlag - - -extern void DBG_PrintAllComp(void) -{ - u1Byte i; - - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("GlobalDebugComponents Definition\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT0 COMP_TRACE\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT1 COMP_DBG\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT2 COMP_INIT\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT3 COMP_OID_QUERY\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT4 COMP_OID_SET\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT5 COMP_RECV\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT6 COMP_SEND\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT7 COMP_IO\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT8 COMP_POWER\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT9 COMP_MLME\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT10 COMP_SCAN\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT11 COMP_SYSTEM\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT12 COMP_SEC\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT13 COMP_AP\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT14 COMP_TURBO\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT15 COMP_QOS\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT16 COMP_AUTHENTICATOR\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT17 COMP_BEACON\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT18 COMP_BEACON\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT19 COMP_RATE\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT20 COMP_EVENTS\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT21 COMP_FPGA\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT22 COMP_RM\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT23 COMP_MP\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT24 COMP_RXDESC\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT25 COMP_CKIP\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT26 COMP_DIG\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT27 COMP_TXAGC\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT28 COMP_HIPWR\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT29 COMP_HALDM\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT30 COMP_RSNA\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT31 COMP_INDIC\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT32 COMP_LED\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT33 COMP_RF\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT34 COMP_HT\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT35 COMP_POWER_TRACKING\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT36 COMP_POWER_TRACKING\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT37 COMP_AMSDU\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT38 COMP_WPS\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT39 COMP_RATR\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT40 COMP_RESET\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT41 COMP_CMD\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT42 COMP_EFUSE\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT43 COMP_MESH_INTERWORKING\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT43 COMP_CCX\n")); - - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("GlobalDebugComponents = %"i64fmt"x\n", GlobalDebugComponents)); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("Enable DBG COMP =")); - for (i = 0; i < 64; i++) - { - if (GlobalDebugComponents & ((u8Byte)0x1 << i) ) - { - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT%02d |\n", i)); - } - } - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("\n")); - -} // DBG_PrintAllComp - - -/*----------------------------------------------------------------------------- - * Function: DBG_PrintFlagEvent - * - * Overview: Print dedicated debug flag event - * - * Input: NONE - * - * Output: NONE - * - * Return: NONE - * - * Revised History: - * When Who Remark - * 12/10/2008 MHC Create Version 0. - * - *---------------------------------------------------------------------------*/ -extern void DBG_PrintFlagEvent(u1Byte DbgFlag) -{ - switch(DbgFlag) - { - case FQoS: - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 QoS_INIT\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 QoS_VISTA\n")); - break; - - case FTX: - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 TX_DESC\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 TX_DESC_TID\n")); - break; - - case FRX: - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 RX_DATA\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 RX_PHY_STS\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 2 RX_PHY_SS\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 3 RX_PHY_SQ\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 4 RX_PHY_ASTS\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 5 RX_ERR_LEN\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 6 RX_DEFRAG\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 7 RX_ERR_RATE\n")); - break; - - case FSEC: - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("NA\n")); - break; - - case FMGNT: - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("NA\n")); - break; - - case FMLME: - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 MEDIA_STS\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 LINK_STS\n")); - break; - - case FRESOURCE: - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 OS_CHK\n")); - break; - - case FBEACON: - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 BCN_SHOW\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 BCN_PEER\n")); - break; - - case FISR: - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 ISR_CHK\n")); - break; - - case FPHY: - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 PHY_BBR\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 PHY_BBW\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 2 PHY_RFR\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 3 PHY_RFW\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 4 PHY_MACR\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 5 PHY_MACW\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 6 PHY_ALLR\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 7 PHY_ALLW\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 8 PHY_TXPWR\n")); - break; - - case FMP: - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 MP_RX\n")); - break; - - case FEEPROM: - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 EEPROM_W\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 EFUSE_PG\n")); - break; - - case FPWR: - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 LPS\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 IPS\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 2 PWRSW\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 3 PWRHW\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 4 PWRHAL\n")); - break; - - case FDM: - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 WA_IOT\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 DM_PWDB\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 2 DM_Monitor\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 3 DM_DIG\n")); - break; - - case FDBG_CTRL: - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 DBG_CTRL_TRACE\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 DBG_CTRL_INBAND_NOISE\n")); - break; - - case FC2H: - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 C2H_Summary\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 C2H_PacketData\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 2 C2H_ContentData\n")); - break; - - case FBT: - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 BT_TRACE\n")); - ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 BT_RFPoll\n")); - break; - - default: - break; - } - -} // DBG_PrintFlagEvent - - -extern void DBG_DumpMem(const u1Byte DbgComp, - const u1Byte DbgLevel, - pu1Byte pMem, - u2Byte Len) -{ - u2Byte i; - - for (i=0;i<((Len>>3) + 1);i++) - { - ODM_RT_TRACE(pDM_Odm,DbgComp, DbgLevel, ("%02X %02X %02X %02X %02X %02X %02X %02X\n", - *(pMem+(i*8)), *(pMem+(i*8+1)), *(pMem+(i*8+2)), *(pMem+(i*8+3)), - *(pMem+(i*8+4)), *(pMem+(i*8+5)), *(pMem+(i*8+6)), *(pMem+(i*8+7)))); - - } -} - - -#endif - diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_debug.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_debug.h deleted file mode 100755 index 0a32f85ef34d35..00000000000000 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_debug.h +++ /dev/null @@ -1,892 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * - ******************************************************************************/ - - -#ifndef __ODM_DBG_H__ -#define __ODM_DBG_H__ - - -//----------------------------------------------------------------------------- -// Define the debug levels -// -// 1. DBG_TRACE and DBG_LOUD are used for normal cases. -// So that, they can help SW engineer to develope or trace states changed -// and also help HW enginner to trace every operation to and from HW, -// e.g IO, Tx, Rx. -// -// 2. DBG_WARNNING and DBG_SERIOUS are used for unusual or error cases, -// which help us to debug SW or HW. -// -//----------------------------------------------------------------------------- -// -// Never used in a call to ODM_RT_TRACE()! -// -#define ODM_DBG_OFF 1 - -// -// Fatal bug. -// For example, Tx/Rx/IO locked up, OS hangs, memory access violation, -// resource allocation failed, unexpected HW behavior, HW BUG and so on. -// -#define ODM_DBG_SERIOUS 2 - -// -// Abnormal, rare, or unexpeted cases. -// For example, IRP/Packet/OID canceled, device suprisely unremoved and so on. -// -#define ODM_DBG_WARNING 3 - -// -// Normal case with useful information about current SW or HW state. -// For example, Tx/Rx descriptor to fill, Tx/Rx descriptor completed status, -// SW protocol state change, dynamic mechanism state change and so on. -// -#define ODM_DBG_LOUD 4 - -// -// Normal case with detail execution flow or information. -// -#define ODM_DBG_TRACE 5 - -//----------------------------------------------------------------------------- -// Define the tracing components -// -//----------------------------------------------------------------------------- -//BB Functions -#define ODM_COMP_DIG BIT0 -#define ODM_COMP_RA_MASK BIT1 -#define ODM_COMP_DYNAMIC_TXPWR BIT2 -#define ODM_COMP_FA_CNT BIT3 -#define ODM_COMP_RSSI_MONITOR BIT4 -#define ODM_COMP_CCK_PD BIT5 -#define ODM_COMP_ANT_DIV BIT6 -#define ODM_COMP_PWR_SAVE BIT7 -#define ODM_COMP_PWR_TRAIN BIT8 -#define ODM_COMP_RATE_ADAPTIVE BIT9 -#define ODM_COMP_PATH_DIV BIT10 -#define ODM_COMP_PSD BIT11 -#define ODM_COMP_DYNAMIC_PRICCA BIT12 -#define ODM_COMP_RXHP BIT13 -#define ODM_COMP_MP BIT14 -#define ODM_COMP_DYNAMIC_ATC BIT15 -//MAC Functions -#define ODM_COMP_EDCA_TURBO BIT16 -#define ODM_COMP_EARLY_MODE BIT17 -//RF Functions -#define ODM_COMP_TX_PWR_TRACK BIT24 -#define ODM_COMP_RX_GAIN_TRACK BIT25 -#define ODM_COMP_CALIBRATION BIT26 -//Common Functions -#define ODM_COMP_COMMON BIT30 -#define ODM_COMP_INIT BIT31 - -/*------------------------Export Marco Definition---------------------------*/ -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - #define RT_PRINTK DbgPrint -#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) - #define DbgPrint printk - #define RT_PRINTK(fmt, args...) DbgPrint( "%s(): " fmt, __FUNCTION__, ## args); - #define RT_DISP(dbgtype, dbgflag, printstr) -#else - #define DbgPrint panic_printk - #define RT_PRINTK(fmt, args...) DbgPrint( "%s(): " fmt, __FUNCTION__, ## args); -#endif - -#ifndef ASSERT - #define ASSERT(expr) -#endif - -#if DBG -#define ODM_RT_TRACE(pDM_Odm, comp, level, fmt) \ - if(((comp) & pDM_Odm->DebugComponents) && (level <= pDM_Odm->DebugLevel || level == ODM_DBG_SERIOUS)) \ - { \ - RT_PRINTK fmt; \ - } - -#define ODM_RT_TRACE_F(pDM_Odm, comp, level, fmt) \ - if(((comp) & pDM_Odm->DebugComponents) && (level <= pDM_Odm->DebugLevel)) \ - { \ - RT_PRINTK fmt; \ - } - -#define ODM_RT_ASSERT(pDM_Odm, expr, fmt) \ - if(!(expr)) { \ - DbgPrint( "Assertion failed! %s at ......\n", #expr); \ - DbgPrint( " ......%s,%s,line=%d\n",__FILE__,__FUNCTION__,__LINE__); \ - RT_PRINTK fmt; \ - ASSERT(FALSE); \ - } -#define ODM_dbg_enter() { DbgPrint("==> %s\n", __FUNCTION__); } -#define ODM_dbg_exit() { DbgPrint("<== %s\n", __FUNCTION__); } -#define ODM_dbg_trace(str) { DbgPrint("%s:%s\n", __FUNCTION__, str); } - -#define ODM_PRINT_ADDR(pDM_Odm, comp, level, title_str, ptr) \ - if(((comp) & pDM_Odm->DebugComponents) && (level <= pDM_Odm->DebugLevel)) \ - { \ - int __i; \ - pu1Byte __ptr = (pu1Byte)ptr; \ - DbgPrint("[ODM] "); \ - DbgPrint(title_str); \ - DbgPrint(" "); \ - for( __i=0; __i<6; __i++ ) \ - DbgPrint("%02X%s", __ptr[__i], (__i==5)?"":"-"); \ - DbgPrint("\n"); \ - } -#else -#define ODM_RT_TRACE(pDM_Odm, comp, level, fmt) -#define ODM_RT_TRACE_F(pDM_Odm, comp, level, fmt) -#define ODM_RT_ASSERT(pDM_Odm, expr, fmt) -#define ODM_dbg_enter() -#define ODM_dbg_exit() -#define ODM_dbg_trace(str) -#define ODM_PRINT_ADDR(pDM_Odm, comp, level, title_str, ptr) -#endif - - -VOID -ODM_InitDebugSetting( - IN PDM_ODM_T pDM_Odm - ); - - - -#if 0 -#if DBG -#define DbgPrint printk - -#define PRINT_DATA(_TitleString, _HexData, _HexDataLen) \ - { \ - char *szTitle = _TitleString; \ - pu1Byte pbtHexData = _HexData; \ - u4Byte u4bHexDataLen = _HexDataLen; \ - u4Byte __i; \ - DbgPrint("%s", szTitle); \ - for (__i=0;__i=' ' &&_ch<='~' ) // I want to see ASCII 33 to 126 only. Otherwise, I print '?'. Annie, 2005-11-22. - -#define RT_PRINT_STR(_Comp, _Level, _TitleString, _Ptr, _Len) \ - if(((_Comp) & ODM_GlobalDebugComponents) && (_Level <= ODM_GlobalDebugLevel)) \ - { \ - int __i; \ - u1Byte buffer[MAX_STR_LEN]; \ - int length = (_Len\n", _Len, buffer); \ - } - -#else // of #if DBG -#define DbgPrint(...) -#define PRINT_DATA(_TitleString, _HexData, _HexDataLen) -#define RT_PRINT_DATA(_Comp, _Level, _TitleString, _HexData, _HexDataLen) -#define RT_PRINT_ADDR(_Comp, _Level, _TitleString, _Ptr) -#define RT_PRINT_ADDRS(_Comp, _Level, _TitleString, _Ptr, _AddNum) -#define RT_PRINT_STR(_Comp, _Level, _TitleString, _Ptr, _Len) -#endif // of #if DBG - -#endif - - -#if 0 -/* Define debug print header for every service module.*/ -typedef struct tag_ODM_DBGP_Service_Module_Header_Name_Structure -{ - const char *pMANS; - const char *pRTOS; - const char *pALM; - const char *pPEM; - const char *pCMPK; - const char *pRAPD; - const char *pTXPB; - const char *pQUMG; -}ODM_DBGP_HEAD_T; - - -/* Define different debug flag for dedicated service modules in debug flag array. */ -// Each module has independt 32 bit debug flag you cnn define the flag as yout require. -typedef enum tag_ODM_DBGP_Flag_Type_Definition -{ - ODM_FTX = 0, - ODM_FRX , - ODM_FPHY , - ODM_FPWR , - ODM_FDM , - ODM_FC2H , - ODM_FBT , - ODM_DBGP_TYPE_MAX -}ODM_DBGP_FLAG_E; - - -// Define TX relative debug bit --> FTX -#define ODM_TX_DESC BIT0 -#define ODM_TX_DESC_TID BIT1 -#define ODM_TX_PATH BIT2 - -// Define RX relative debug bit --> FRX -#define ODM_RX_DATA BIT0 -#define ODM_RX_PHY_STS BIT1 -#define ODM_RX_PHY_SS BIT2 -#define ODM_RX_PHY_SQ BIT3 -#define ODM_RX_PHY_ASTS BIT4 -#define ODM_RX_ERR_LEN BIT5 -#define ODM_RX_DEFRAG BIT6 -#define ODM_RX_ERR_RATE BIT7 -#define ODM_RX_PATH BIT8 -#define ODM_RX_BEACON BIT9 - -// Define PHY-BB/RF/MAC check module bit --> FPHY -#define ODM_PHY_BBR BIT0 -#define ODM_PHY_BBW BIT1 -#define ODM_PHY_RFR BIT2 -#define ODM_PHY_RFW BIT3 -#define ODM_PHY_MACR BIT4 -#define ODM_PHY_MACW BIT5 -#define ODM_PHY_ALLR BIT6 -#define ODM_PHY_ALLW BIT7 -#define ODM_PHY_TXPWR BIT8 -#define ODM_PHY_PWRDIFF BIT9 -#define ODM_PHY_SICR BIT10 -#define ODM_PHY_SICW BIT11 - - - - -extern u4Byte ODM_GlobalDebugLevel; - - -#if DBG -extern u8Byte ODM_GlobalDebugComponents; -#endif -#endif -#if 0 - -//----------------------------------------------------------------------------- -// Define the debug levels -// -// 1. DBG_TRACE and DBG_LOUD are used for normal cases. -// So that, they can help SW engineer to develope or trace states changed -// and also help HW enginner to trace every operation to and from HW, -// e.g IO, Tx, Rx. -// -// 2. DBG_WARNNING and DBG_SERIOUS are used for unusual or error cases, -// which help us to debug SW or HW. -// -//----------------------------------------------------------------------------- -// -// Never used in a call to ODM_RT_TRACE(pDM_Odm,)! -// -#define DBG_OFF 0 - -// -// Deprecated! Don't use it! -// TODO: fix related debug message! -// -//#define DBG_SEC 1 - -// -// Fatal bug. -// For example, Tx/Rx/IO locked up, OS hangs, memory access violation, -// resource allocation failed, unexpected HW behavior, HW BUG and so on. -// -#define DBG_SERIOUS 2 - -// -// Abnormal, rare, or unexpeted cases. -// For example, IRP/Packet/OID canceled, device suprisely unremoved and so on. -// -#define DBG_WARNING 3 - -// -// Normal case with useful information about current SW or HW state. -// For example, Tx/Rx descriptor to fill, Tx/Rx descriptor completed status, -// SW protocol state change, dynamic mechanism state change and so on. -// -#define DBG_LOUD 4 - -// -// Normal case with detail execution flow or information. -// -#define DBG_TRACE 5 - - - -//----------------------------------------------------------------------------- -// Define the tracing components -// -//----------------------------------------------------------------------------- -#define COMP_TRACE BIT0 // For function call tracing. -#define COMP_DBG BIT1 // Only for temporary debug message. -#define COMP_INIT BIT2 // during driver initialization / halt / reset. -#define COMP_OID_QUERY BIT3 // Query OID. -#define COMP_OID_SET BIT4 // Set OID. -#define COMP_RECV BIT5 // Reveive part data path. -#define COMP_SEND BIT6 // Send part path. -#define COMP_IO BIT7 // I/O Related. Added by Annie, 2006-03-02. -#define COMP_POWER BIT8 // 802.11 Power Save mode or System/Device Power state related. -#define COMP_MLME BIT9 // 802.11 link related: join/start BSS, leave BSS. -#define COMP_SCAN BIT10 // For site survey. -#define COMP_SYSTEM BIT11 // For general platform function. -#define COMP_SEC BIT12 // For Security. -#define COMP_AP BIT13 // For AP mode related. -#define COMP_TURBO BIT14 // For Turbo Mode related. By Annie, 2005-10-21. -#define COMP_QOS BIT15 // For QoS. -#define COMP_AUTHENTICATOR BIT16 // For AP mode Authenticator. Added by Annie, 2006-01-30. -#define COMP_BEACON BIT17 // For Beacon related, by rcnjko. -#define COMP_ANTENNA BIT18 // For Antenna diversity related, by rcnjko. -#define COMP_RATE BIT19 // For Rate Adaptive mechanism, 2006.07.02, by rcnjko. #define COMP_EVENTS 0x00000080 // Event handling -#define COMP_EVENTS BIT20 // Event handling -#define COMP_FPGA BIT21 // For FPGA verfication -#define COMP_RM BIT22 // For Radio Measurement. -#define COMP_MP BIT23 // For mass production test, by shien chang, 2006.07.13 -#define COMP_RXDESC BIT24 // Show Rx desc information for SD3 debug. Added by Annie, 2006-07-15. -#define COMP_CKIP BIT25 // For CCX 1 S13: CKIP. Added by Annie, 2006-08-14. -#define COMP_DIG BIT26 // For DIG, 2006.09.25, by rcnjko. -#define COMP_TXAGC BIT27 // For Tx power, 060928, by rcnjko. -#define COMP_HIPWR BIT28 // For High Power Mechanism, 060928, by rcnjko. -#define COMP_HALDM BIT29 // For HW Dynamic Mechanism, 061010, by rcnjko. -#define COMP_RSNA BIT30 // For RSNA IBSS , 061201, by CCW. -#define COMP_INDIC BIT31 // For link indication -#define COMP_LED BIT32 // For LED. -#define COMP_RF BIT33 // For RF. -//1!!!!!!!!!!!!!!!!!!!!!!!!!!! -//1//1Attention Please!!!<11n or 8190 specific code should be put below this line> -//1!!!!!!!!!!!!!!!!!!!!!!!!!!! - -#define COMP_HT BIT34 // For 802.11n HT related information. by Emily 2006-8-11 -#define COMP_POWER_TRACKING BIT35 //FOR 8190 TX POWER TRACKING -#define COMP_RX_REORDER BIT36 // 8190 Rx Reorder -#define COMP_AMSDU BIT37 // For A-MSDU Debugging -#define COMP_WPS BIT38 //WPS Debug Message -#define COMP_RATR BIT39 -#define COMP_RESET BIT40 -// For debug command to print on dbgview!! -#define COMP_CMD BIT41 -#define COMP_EFUSE BIT42 -#define COMP_MESH_INTERWORKING BIT43 -#define COMP_CCX BIT44 //CCX Debug Flag -#define COMP_IOCTL BIT45 // IO Control -#define COMP_GP BIT46 // For generic parser. -#define COMP_TXAGG BIT47 -#define COMP_HVL BIT48 // For Ndis 6.2 Context Swirch and Hardware Virtualiztion Layer -#define COMP_TEST BIT49 -#define COMP_BB_POWERSAVING BIT50 -#define COMP_SWAS BIT51 // For SW Antenna Switch -#define COMP_P2P BIT52 -#define COMP_MUX BIT53 -#define COMP_FUNC BIT54 -#define COMP_TDLS BIT55 -#define COMP_OMNIPEEK BIT56 -#define COMP_DUALMACSWITCH BIT60 // 2010/12/27 Add for Dual mac mode debug -#define COMP_EASY_CONCURRENT BIT61 // 2010/12/27 Add for easy cncurrent mode debug -#define COMP_PSD BIT63 //2011/3/9 Add for WLAN PSD for BT AFH - -#define COMP_DFS BIT62 - -#define COMP_ALL UINT64_C(0xFFFFFFFFFFFFFFFF) // All components -// For debug print flag to use -/*------------------------------Define structure----------------------------*/ -/* 2007/07/13 MH *//*------For DeBuG Print modeue------*/ - -/* Defnie structure to store different debug flag variable. Every debug flag - is a UINT32 integer and you can assign 32 different events. */ -typedef struct tag_DBGP_Debug_Flag_Structure -{ - u4Byte Mans; /* Main Scheduler module. */ - u4Byte Rtos; /* RTOS module. */ - u4Byte Alarm; /* Alarm module. */ - u4Byte Pm; /* Performance monitor module. */ -}DBGP_FLAG_T; - -/* Define debug print header for every service module.*/ -typedef struct tag_DBGP_Service_Module_Header_Name_Structure -{ - const char *pMANS; - const char *pRTOS; - const char *pALM; - const char *pPEM; - const char *pCMPK; - const char *pRAPD; - const char *pTXPB; - const char *pQUMG; -}DBGP_HEAD_T; - - -/* Define different debug flag for dedicated service modules in debug flag array. */ -// Each module has independt 32 bit debug flag you cnn define the flag as yout require. -typedef enum tag_DBGP_Flag_Type_Definition -{ - FQoS = 0, - FTX = 1, - FRX = 2, - FSEC = 3, - FMGNT = 4, - FMLME = 5, - FRESOURCE = 6, - FBEACON = 7, - FISR = 8, - FPHY = 9, - FMP = 10, - FEEPROM = 11, - FPWR = 12, - FDM = 13, - FDBG_CTRL = 14, - FC2H = 15, - FBT = 16, - FINIT = 17, - FIOCTL = 18, - FSHORT_CUT = 19, - DBGP_TYPE_MAX -}DBGP_FLAG_E; - - -// Define Qos Relative debug flag bit --> FQoS -#define QoS_INIT BIT0 -#define QoS_VISTA BIT1 - -// Define TX relative debug bit --> FTX -#define TX_DESC BIT0 -#define TX_DESC_TID BIT1 -#define TX_PATH BIT2 - -// Define RX relative debug bit --> FRX -#define RX_DATA BIT0 -#define RX_PHY_STS BIT1 -#define RX_PHY_SS BIT2 -#define RX_PHY_SQ BIT3 -#define RX_PHY_ASTS BIT4 -#define RX_ERR_LEN BIT5 -#define RX_DEFRAG BIT6 -#define RX_ERR_RATE BIT7 -#define RX_PATH BIT8 -#define RX_BEACON BIT9 - -// Define Security relative debug bit --> FSEC - -// Define MGNT relative debug bit --> FMGNT - -// Define MLME relative debug bit --> FMLME -#define MEDIA_STS BIT0 -#define LINK_STS BIT1 - -// Define OS resource check module bit --> FRESOURCE -#define OS_CHK BIT0 - -// Define beacon content check module bit --> FBEACON -#define BCN_SHOW BIT0 -#define BCN_PEER BIT1 - -// Define ISR/IMR check module bit --> FISR -#define ISR_CHK BIT0 - -// Define PHY-BB/RF/MAC check module bit --> FPHY -#define PHY_BBR BIT0 -#define PHY_BBW BIT1 -#define PHY_RFR BIT2 -#define PHY_RFW BIT3 -#define PHY_MACR BIT4 -#define PHY_MACW BIT5 -#define PHY_ALLR BIT6 -#define PHY_ALLW BIT7 -#define PHY_TXPWR BIT8 -#define PHY_PWRDIFF BIT9 -#define PHY_SICR BIT10 -#define PHY_SICW BIT11 - -// Define MPT driver check module bit --> FMP -#define MP_RX BIT0 -#define MP_SWICH_CH BIT1 - -// Define EEPROM and EFUSE check module bit --> FEEPROM -#define EEPROM_W BIT0 -#define EFUSE_PG BIT1 -#define EFUSE_READ_ALL BIT2 -#define EFUSE_ANALYSIS BIT3 -#define EFUSE_PG_DETAIL BIT4 - -// Define power save check module bit --> FPWR -#define LPS BIT0 -#define IPS BIT1 -#define PWRSW BIT2 -#define PWRHW BIT3 -#define PWRHAL BIT4 - -// Define Dynamic Mechanism check module bit --> FDM -#define WA_IOT BIT0 -#define DM_PWDB BIT1 -#define DM_Monitor BIT2 -#define DM_DIG BIT3 -#define DM_EDCA_Turbo BIT4 -#define DM_BT30 BIT5 - -// Define Dbg Control module bit --> FDBG_CTRL -#define DBG_CTRL_TRACE BIT0 -#define DBG_CTRL_INBAND_NOISE BIT1 - -// Define FW C2H Cmd check module bit --> FC2H -#define C2H_Summary BIT0 -#define C2H_PacketData BIT1 -#define C2H_ContentData BIT2 -// Define BT Cmd check module bit --> FBT -#define BT_TRACE BIT0 -#define BT_RFPoll BIT1 - -// Define init check for module bit --> FINIT -#define INIT_EEPROM BIT0 -#define INIT_TxPower BIT1 -#define INIT_IQK BIT2 -#define INIT_RF BIT3 - -// Define IOCTL Cmd check module bit --> FIOCTL -// section 1 : IRP related -#define IOCTL_IRP BIT0 -#define IOCTL_IRP_DETAIL BIT1 -#define IOCTL_IRP_STATISTICS BIT2 -#define IOCTL_IRP_HANDLE BIT3 -// section 2 : HCI command/event -#define IOCTL_BT_HCICMD BIT8 -#define IOCTL_BT_HCICMD_DETAIL BIT9 -#define IOCTL_BT_HCICMD_EXT BIT10 -#define IOCTL_BT_EVENT BIT11 -#define IOCTL_BT_EVENT_DETAIL BIT12 -#define IOCTL_BT_EVENT_PERIODICAL BIT13 -// section 3 : BT tx/rx data and throughput -#define IOCTL_BT_TX_ACLDATA BIT16 -#define IOCTL_BT_TX_ACLDATA_DETAIL BIT17 -#define IOCTL_BT_RX_ACLDATA BIT18 -#define IOCTL_BT_RX_ACLDATA_DETAIL BIT19 -#define IOCTL_BT_TP BIT20 -// section 4 : BT connection state machine. -#define IOCTL_STATE BIT21 -#define IOCTL_BT_LOGO BIT22 -// section 5 : BT function trace -#define IOCTL_CALLBACK_FUN BIT24 -#define IOCTL_PARSE_BT_PKT BIT25 -#define IOCTL_BT_TX_PKT BIT26 -#define IOCTL_BT_FLAG_MON BIT27 - -// -// Define init check for module bit --> FSHORT_CUT -// 2011/07/20 MH Add for short but definition. -// -#define SHCUT_TX BIT0 -#define SHCUT_RX BIT1 - - -/* 2007/07/13 MH *//*------For DeBuG Print modeue------*/ -/*------------------------------Define structure----------------------------*/ - - -/*------------------------Export Marco Definition---------------------------*/ -#if (DM_ODM_SUPPORT_TYPE != ODM_WIN) -#define RT_PRINTK(fmt, args...) printk( "%s(): " fmt, __FUNCTION__, ## args); - -#if DBG -#define ODM_RT_TRACE(pDM_Odm,comp, level, fmt) \ - if(((comp) & GlobalDebugComponents) && (level <= GlobalDebugLevel)) \ - { \ - RT_PRINTK fmt; \ - } - -#define RT_TRACE_F(comp, level, fmt) \ - if(((comp) & GlobalDebugComponents) && (level <= GlobalDebugLevel)) \ - { \ - RT_PRINTK fmt; \ - } - -#define RT_ASSERT(expr,fmt) \ - if(!(expr)) { \ - printk( "Assertion failed! %s at ......\n", #expr); \ - printk( " ......%s,%s,line=%d\n",__FILE__,__FUNCTION__,__LINE__); \ - } -#define dbg_enter() { printk("==> %s\n", __FUNCTION__); } -#define dbg_exit() { printk("<== %s\n", __FUNCTION__); } -#define dbg_trace(str) { printk("%s:%s\n", __FUNCTION__, str); } -#else -#define ODM_RT_TRACE(pDM_Odm,comp, level, fmt) -#define RT_TRACE_F(comp, level, fmt) -#define RT_ASSERT(expr, fmt) -#define dbg_enter() -#define dbg_exit() -#define dbg_trace(str) -#endif - -#if DBG -#define DbgPrint printk - -#define PRINT_DATA(_TitleString, _HexData, _HexDataLen) \ - { \ - char *szTitle = _TitleString; \ - pu1Byte pbtHexData = _HexData; \ - u4Byte u4bHexDataLen = _HexDataLen; \ - u4Byte __i; \ - DbgPrint("%s", szTitle); \ - for (__i=0;__i=' ' &&_ch<='~' ) // I want to see ASCII 33 to 126 only. Otherwise, I print '?'. Annie, 2005-11-22. - -#define RT_PRINT_STR(_Comp, _Level, _TitleString, _Ptr, _Len) \ - if(((_Comp) & GlobalDebugComponents) && (_Level <= GlobalDebugLevel)) \ - { \ - int __i; \ - u1Byte buffer[MAX_STR_LEN]; \ - int length = (_Len\n", _Len, buffer); \ - } - -#else // of #if DBG -#define DbgPrint(...) -#define PRINT_DATA(_TitleString, _HexData, _HexDataLen) -#define RT_PRINT_DATA(_Comp, _Level, _TitleString, _HexData, _HexDataLen) -#define RT_PRINT_ADDR(_Comp, _Level, _TitleString, _Ptr) -#define RT_PRINT_ADDRS(_Comp, _Level, _TitleString, _Ptr, _AddNum) -#define RT_PRINT_STR(_Comp, _Level, _TitleString, _Ptr, _Len) -#endif // of #if DBG - - - -#endif // #if (DM_ODM_SUPPORT_TYPE != ODM_WIN) - -#define DEBUG_PRINT 1 - -// Please add new OS's print API by yourself - -//#if (RT_PLATFORM==PLATFORM_WINDOWS) -#if (DEBUG_PRINT == 1) && DBG -#define RT_DISP(dbgtype, dbgflag, printstr)\ -{\ - if (DBGP_Type[dbgtype] & dbgflag)\ - {\ - DbgPrint printstr;\ - }\ -} - -#define RT_DISP_ADDR(dbgtype, dbgflag, printstr, _Ptr)\ -{\ - if (DBGP_Type[dbgtype] & dbgflag)\ - {\ - int __i; \ - pu1Byte ptr = (pu1Byte)_Ptr; \ - DbgPrint printstr; \ - DbgPrint(" "); \ - for( __i=0; __i<6; __i++ ) \ - DbgPrint("%02X%s", ptr[__i], (__i==5)?"":"-"); \ - DbgPrint("\n"); \ - }\ -} - -#define RT_DISP_DATA(dbgtype, dbgflag, _TitleString, _HexData, _HexDataLen)\ -{\ - if (DBGP_Type[dbgtype] & dbgflag)\ - {\ - int __i; \ - pu1Byte ptr = (pu1Byte)_HexData; \ - DbgPrint(_TitleString); \ - for( __i=0; __i<(int)_HexDataLen; __i++ ) \ - { \ - DbgPrint("%02X%s", ptr[__i], (((__i + 1) % 4) == 0)?" ":" ");\ - if (((__i + 1) % 16) == 0) DbgPrint("\n");\ - } \ - DbgPrint("\n"); \ - }\ -} - -#define FunctionIn(_comp) ODM_RT_TRACE(pDM_Odm,(_comp), DBG_LOUD, ("==========> %s\n", __FUNCTION__)) -#define FunctionOut(_comp) ODM_RT_TRACE(pDM_Odm,(_comp), DBG_LOUD, ("<========== %s\n", __FUNCTION__)) - - -#else - -#define RT_DISP(dbgtype, dbgflag, printstr) -#define RT_DISP_ADDR(dbgtype, dbgflag, printstr, _Ptr) -#define RT_DISP_DATA(dbgtype, dbgflag, _TitleString, _HexData, _HexDataLen) - -#define FunctionIn(_comp) -#define FunctionOut(_comp) -#endif -/*------------------------Export Marco Definition---------------------------*/ - - -/*------------------------Export global variable----------------------------*/ -extern u4Byte DBGP_Type[DBGP_TYPE_MAX]; -extern DBGP_HEAD_T DBGP_Head; - -/*------------------------Export global variable----------------------------*/ - - -/*--------------------------Exported Function prototype---------------------*/ -extern void DBGP_Flag_Init(void); -extern void DBG_PrintAllFlag(void); -extern void DBG_PrintAllComp(void); -extern void DBG_PrintFlagEvent(u1Byte DbgFlag); -extern void DBG_DumpMem(const u1Byte DbgComp, - const u1Byte DbgLevel, - pu1Byte pMem, - u2Byte Len); - -/*--------------------------Exported Function prototype---------------------*/ - - - - - - - - - -extern u4Byte GlobalDebugLevel; -extern u8Byte GlobalDebugComponents; - - -#endif - - -#endif // __ODM_DBG_H__ - diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_precomp.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_precomp.h deleted file mode 100755 index e3c71d2d34dac3..00000000000000 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_precomp.h +++ /dev/null @@ -1,307 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * - ******************************************************************************/ - -#ifndef __ODM_PRECOMP_H__ -#define __ODM_PRECOMP_H__ - -#include "odm_types.h" - -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) -#include "Precomp.h" // We need to include mp_precomp.h due to batch file setting. - -#else - -#define TEST_FALG___ 1 - -#endif - -//2 Config Flags and Structs - defined by each ODM Type - -#if (DM_ODM_SUPPORT_TYPE == ODM_AP) - #include "../8192cd_cfg.h" - #include "../odm_inc.h" - - #include "../8192cd.h" - #include "../8192cd_util.h" - #ifdef _BIG_ENDIAN_ - #define ODM_ENDIAN_TYPE ODM_ENDIAN_BIG - #else - #define ODM_ENDIAN_TYPE ODM_ENDIAN_LITTLE - #endif - - #ifdef AP_BUILD_WORKAROUND - #include "../8192cd_headers.h" - #include "../8192cd_debug.h" - #endif - -#elif (DM_ODM_SUPPORT_TYPE == ODM_ADSL) - // Flags - #include "../8192cd_cfg.h" // OUTSRC needs ADSL config flags. - #include "../odm_inc.h" // OUTSRC needs some extra flags. - // Data Structure - #include "../common_types.h" // OUTSRC and rtl8192cd both needs basic type such as UINT8 and BIT0. - #include "../8192cd.h" // OUTSRC needs basic ADSL struct definition. - #include "../8192cd_util.h" // OUTSRC needs basic I/O function. - #ifdef _BIG_ENDIAN_ - #define ODM_ENDIAN_TYPE ODM_ENDIAN_BIG - #else - #define ODM_ENDIAN_TYPE ODM_ENDIAN_LITTLE - #endif - - #ifdef ADSL_AP_BUILD_WORKAROUND - // NESTED_INC: Functions defined outside should not be included!! Marked by Annie, 2011-10-14. - #include "../8192cd_headers.h" - #include "../8192cd_debug.h" - #endif - -#elif (DM_ODM_SUPPORT_TYPE ==ODM_CE) - //#include - //#include - //#include - //#include - //#include - //#include -#define BEAMFORMING_SUPPORT 0 -#elif (DM_ODM_SUPPORT_TYPE == ODM_WIN) - #include "Mp_Precomp.h" - #define ODM_ENDIAN_TYPE ODM_ENDIAN_LITTLE -#endif - - -//2 Hardware Parameter Files - - -#if (DM_ODM_SUPPORT_TYPE == ODM_AP) -#if (RTL8192C_SUPPORT==1) - #include "rtl8192c/Hal8192CEFWImg_AP.h" - #include "rtl8192c/Hal8192CEPHYImg_AP.h" - #include "rtl8192c/Hal8192CEMACImg_AP.h" -#endif -#elif (DM_ODM_SUPPORT_TYPE == ODM_ADSL) - #include "rtl8192c/Hal8192CEFWImg_ADSL.h" - #include "rtl8192c/Hal8192CEPHYImg_ADSL.h" - #include "rtl8192c/Hal8192CEMACImg_ADSL.h" - -#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) - #if(RTL8192CE_SUPPORT ==1) - #include "rtl8192c/Hal8192CEFWImg_CE.h" - #include "rtl8192c/Hal8192CEPHYImg_CE.h" - #include "rtl8192c/Hal8192CEMACImg_CE.h" - #endif - - #if(RTL8192CU_SUPPORT ==1) - #include "rtl8192c/Hal8192CUFWImg_CE.h" - #include "rtl8192c/Hal8192CUPHYImg_CE.h" - #include "rtl8192c/Hal8192CUMACImg_CE.h" - #endif - - #if(RTL8192DE_SUPPORT ==1) - #include "rtl8192d/Hal8192DEFWImg_CE.h" - #include "rtl8192d/Hal8192DEPHYImg_CE.h" - #include "rtl8192d/Hal8192DEMACImg_CE.h" - #endif - - #if(RTL8192DU_SUPPORT ==1) - #include "rtl8192d/Hal8192DUFWImg_CE.h" - #include "rtl8192d/Hal8192DUPHYImg_CE.h" - #include "rtl8192d/Hal8192DUMACImg_CE.h" - #endif - - #if(RTL8723AS_SUPPORT==1) - #include "rtl8723a/Hal8723SHWImg_CE.h" - #endif - - #if(RTL8723AU_SUPPORT==1) - #include "rtl8723a/Hal8723UHWImg_CE.h" - #endif - -#elif (DM_ODM_SUPPORT_TYPE == ODM_WIN) - -#endif - - -//2 OutSrc Header Files - -#include "odm.h" -#include "odm_HWConfig.h" -#include "odm_debug.h" -#include "odm_RegDefine11AC.h" -#include "odm_RegDefine11N.h" -#include "odm_AntDiv.h" - -#if (DM_ODM_SUPPORT_TYPE == ODM_AP) -#if (RTL8192C_SUPPORT==1) - #include "rtl8192c/HalDMOutSrc8192C_AP.h" -#endif -#if (RTL8188E_SUPPORT==1) - #include "rtl8188e/Hal8188ERateAdaptive.h"//for RA,Power training -#endif - -#elif (DM_ODM_SUPPORT_TYPE == ODM_ADSL) - #include "rtl8192c/HalDMOutSrc8192C_ADSL.h" - -#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) - //#include "hal_com.h" - #include "HalPhyRf.h" - #if (RTL8192C_SUPPORT==1) - #ifdef CONFIG_INTEL_PROXIM - #include "../proxim/intel_proxim.h" - #endif - #include "rtl8192c/HalDMOutSrc8192C_CE.h" - #include - #endif - - #if (RTL8192D_SUPPORT==1) - #include "rtl8192d/HalDMOutSrc8192D_CE.h" - #include "rtl8192d_hal.h" - #endif - - #if (RTL8723A_SUPPORT==1) - #include "rtl8192c/HalDMOutSrc8192C_CE.h" //for IQK,LCK,Power-tracking - #include "rtl8723a_hal.h" - #endif - - #if (RTL8188E_SUPPORT==1) - #include "rtl8188e/HalPhyRf_8188e.h"//for IQK,LCK,Power-tracking - #include "rtl8188e/Hal8188ERateAdaptive.h"//for RA,Power training - #include "rtl8188e_hal.h" - #endif - - #if (RTL8192E_SUPPORT==1) - #include "rtl8192e/HalPhyRf_8192e.h"//for IQK,LCK,Power-tracking - #include "rtl8192e_hal.h" - #endif - - #if (RTL8812A_SUPPORT==1) - #include "rtl8812a/HalPhyRf_8812A.h"//for IQK,LCK,Power-tracking - #include "rtl8812a_hal.h" - #endif - - #if (RTL8821A_SUPPORT==1) - #include "rtl8821a/HalPhyRf_8821A.h"//for IQK,LCK,Power-tracking - #include "rtl8812a/HalPhyRf_8812A.h"//for IQK,LCK,Power-tracking - #include "rtl8812a_hal.h" - #endif - - #if (RTL8723B_SUPPORT==1) - #include "rtl8723b/HalPhyRf_8723B.h"//for IQK,LCK,Power-tracking - #include "rtl8723b_hal.h" - #endif -#endif - -#include "odm_interface.h" -#include "odm_reg.h" - -#if (RTL8192C_SUPPORT==1) -#if (DM_ODM_SUPPORT_TYPE == ODM_AP) -#include "rtl8192c/Hal8192CHWImg_MAC.h" -#include "rtl8192c/Hal8192CHWImg_RF.h" -#include "rtl8192c/Hal8192CHWImg_BB.h" -#include "rtl8192c/Hal8192CHWImg_FW.h" -#endif -#include "rtl8192c/odm_RTL8192C.h" -#endif -#if (RTL8192D_SUPPORT==1) -#include "rtl8192d/odm_RTL8192D.h" -#endif - -#if (RTL8723A_SUPPORT==1) -#include "rtl8723a/HalHWImg8723A_MAC.h" -#include "rtl8723a/HalHWImg8723A_RF.h" -#include "rtl8723a/HalHWImg8723A_BB.h" -#include "rtl8723a/HalHWImg8723A_FW.h" -#include "rtl8723a/odm_RegConfig8723A.h" -#endif - -#if (RTL8188E_SUPPORT==1) -#include "rtl8188e/HalHWImg8188E_MAC.h" -#include "rtl8188e/HalHWImg8188E_RF.h" -#include "rtl8188e/HalHWImg8188E_BB.h" -#include "rtl8188e/HalHWImg8188E_FW.h" -#include "rtl8188e/Hal8188EReg.h" - -#if (DM_ODM_SUPPORT_TYPE & ODM_AP) -#include "rtl8188e/HalPhyRf_8188e.h" -#endif - -#if (TESTCHIP_SUPPORT == 1) -#include "rtl8188e/HalHWImg8188E_TestChip_MAC.h" -#include "rtl8188e/HalHWImg8188E_TestChip_RF.h" -#include "rtl8188e/HalHWImg8188E_TestChip_BB.h" -#endif - - -#include "rtl8188e/odm_RegConfig8188E.h" -#include "rtl8188e/odm_RTL8188E.h" -#endif - -#if (RTL8192E_SUPPORT==1) -#include "rtl8192e/HalHWImg8192E_MAC.h" -#include "rtl8192e/HalHWImg8192E_RF.h" -#include "rtl8192e/HalHWImg8192E_BB.h" -#include "rtl8192e/HalHWImg8192E_FW.h" -#include "rtl8192e/Hal8192EReg.h" -#include "rtl8192e/odm_RegConfig8192E.h" -#include "rtl8192e/odm_RTL8192E.h" -#endif - -#if (RTL8723B_SUPPORT==1) -#include "rtl8723b/HalHWImg8723B_MAC.h" -#include "rtl8723b/HalHWImg8723B_RF.h" -#include "rtl8723b/HalHWImg8723B_BB.h" -#include "rtl8723b/HalHWImg8723B_FW.h" -#include "rtl8723b/HalHWImg8723B_MP.h" -#include "rtl8723b/Hal8723BReg.h" -#include "rtl8723b/odm_RTL8723B.h" -#include "rtl8723b/odm_RegConfig8723B.h" -#endif - -#if (RTL8812A_SUPPORT==1) -#include "rtl8812a/HalHWImg8812A_MAC.h" -#include "rtl8812a/HalHWImg8812A_RF.h" -#include "rtl8812a/HalHWImg8812A_BB.h" -#include "rtl8812a/HalHWImg8812A_FW.h" -#include "rtl8812a/odm_RegConfig8812A.h" -#include "rtl8812a/odm_RTL8812A.h" -#if (TESTCHIP_SUPPORT == 1) -#include "rtl8812a/HalHWImg8812A_TestChip_MAC.h" -#include "rtl8812a/HalHWImg8812A_TestChip_RF.h" -#include "rtl8812a/HalHWImg8812A_TestChip_BB.h" -#endif -#endif - - -#if (RTL8821A_SUPPORT==1) -#include "rtl8821a/HalHWImg8821A_MAC.h" -#include "rtl8821a/HalHWImg8821A_RF.h" -#include "rtl8821a/HalHWImg8821A_BB.h" -#include "rtl8821a/HalHWImg8821A_FW.h" -#include "rtl8821a/odm_RegConfig8821A.h" -#include "rtl8821a/odm_RTL8821A.h" -#if (TESTCHIP_SUPPORT == 1) -#include "rtl8821a/HalHWImg8821A_TestChip_MAC.h" -#include "rtl8821a/HalHWImg8821A_TestChip_RF.h" -#include "rtl8821a/HalHWImg8821A_TestChip_BB.h" -#include "rtl8821a/HalHWImg8821A_TestChip_FW.h" -#endif -#endif - -#endif // __ODM_PRECOMP_H__ - diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_reg.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_reg.h deleted file mode 100755 index 16999a10519340..00000000000000 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_reg.h +++ /dev/null @@ -1,122 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * - ******************************************************************************/ -//============================================================ -// File Name: odm_reg.h -// -// Description: -// -// This file is for general register definition. -// -// -//============================================================ -#ifndef __HAL_ODM_REG_H__ -#define __HAL_ODM_REG_H__ - -// -// Register Definition -// - -//MAC REG -#define ODM_BB_RESET 0x002 -#define ODM_DUMMY 0x4fe -#define RF_T_METER_OLD 0x24 -#define RF_T_METER_NEW 0x42 - -#define ODM_EDCA_VO_PARAM 0x500 -#define ODM_EDCA_VI_PARAM 0x504 -#define ODM_EDCA_BE_PARAM 0x508 -#define ODM_EDCA_BK_PARAM 0x50C -#define ODM_TXPAUSE 0x522 - -//BB REG -#define ODM_FPGA_PHY0_PAGE8 0x800 -#define ODM_PSD_SETTING 0x808 -#define ODM_AFE_SETTING 0x818 -#define ODM_TXAGC_B_24_54 0x834 -#define ODM_TXAGC_B_MCS32_5 0x838 -#define ODM_TXAGC_B_MCS0_MCS3 0x83c -#define ODM_TXAGC_B_MCS4_MCS7 0x848 -#define ODM_TXAGC_B_MCS8_MCS11 0x84c -#define ODM_ANALOG_REGISTER 0x85c -#define ODM_RF_INTERFACE_OUTPUT 0x860 -#define ODM_TXAGC_B_MCS12_MCS15 0x868 -#define ODM_TXAGC_B_11_A_2_11 0x86c -#define ODM_AD_DA_LSB_MASK 0x874 -#define ODM_ENABLE_3_WIRE 0x88c -#define ODM_PSD_REPORT 0x8b4 -#define ODM_R_ANT_SELECT 0x90c -#define ODM_CCK_ANT_SELECT 0xa07 -#define ODM_CCK_PD_THRESH 0xa0a -#define ODM_CCK_RF_REG1 0xa11 -#define ODM_CCK_MATCH_FILTER 0xa20 -#define ODM_CCK_RAKE_MAC 0xa2e -#define ODM_CCK_CNT_RESET 0xa2d -#define ODM_CCK_TX_DIVERSITY 0xa2f -#define ODM_CCK_FA_CNT_MSB 0xa5b -#define ODM_CCK_FA_CNT_LSB 0xa5c -#define ODM_CCK_NEW_FUNCTION 0xa75 -#define ODM_OFDM_PHY0_PAGE_C 0xc00 -#define ODM_OFDM_RX_ANT 0xc04 -#define ODM_R_A_RXIQI 0xc14 -#define ODM_R_A_AGC_CORE1 0xc50 -#define ODM_R_A_AGC_CORE2 0xc54 -#define ODM_R_B_AGC_CORE1 0xc58 -#define ODM_R_AGC_PAR 0xc70 -#define ODM_R_HTSTF_AGC_PAR 0xc7c -#define ODM_TX_PWR_TRAINING_A 0xc90 -#define ODM_TX_PWR_TRAINING_B 0xc98 -#define ODM_OFDM_FA_CNT1 0xcf0 -#define ODM_OFDM_PHY0_PAGE_D 0xd00 -#define ODM_OFDM_FA_CNT2 0xda0 -#define ODM_OFDM_FA_CNT3 0xda4 -#define ODM_OFDM_FA_CNT4 0xda8 -#define ODM_TXAGC_A_6_18 0xe00 -#define ODM_TXAGC_A_24_54 0xe04 -#define ODM_TXAGC_A_1_MCS32 0xe08 -#define ODM_TXAGC_A_MCS0_MCS3 0xe10 -#define ODM_TXAGC_A_MCS4_MCS7 0xe14 -#define ODM_TXAGC_A_MCS8_MCS11 0xe18 -#define ODM_TXAGC_A_MCS12_MCS15 0xe1c - -//RF REG -#define ODM_GAIN_SETTING 0x00 -#define ODM_CHANNEL 0x18 - -//Ant Detect Reg -#define ODM_DPDT 0x300 - -//PSD Init -#define ODM_PSDREG 0x808 - -//92D Path Div -#define PATHDIV_REG 0xB30 -#define PATHDIV_TRI 0xBA0 - - -// -// Bitmap Definition -// - -#define BIT_FA_RESET BIT0 - - - -#endif - diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm.c new file mode 100644 index 00000000000000..44718e4d65e718 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm.c @@ -0,0 +1,1731 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +//============================================================ +// include files +//============================================================ + +#include "Mp_Precomp.h" +#include "phydm_precomp.h" + + +const u2Byte dB_Invert_Table[12][8] = { + { 1, 1, 1, 2, 2, 2, 2, 3}, + { 3, 3, 4, 4, 4, 5, 6, 6}, + { 7, 8, 9, 10, 11, 13, 14, 16}, + { 18, 20, 22, 25, 28, 32, 35, 40}, + { 45, 50, 56, 63, 71, 79, 89, 100}, + { 112, 126, 141, 158, 178, 200, 224, 251}, + { 282, 316, 355, 398, 447, 501, 562, 631}, + { 708, 794, 891, 1000, 1122, 1259, 1413, 1585}, + { 1778, 1995, 2239, 2512, 2818, 3162, 3548, 3981}, + { 4467, 5012, 5623, 6310, 7079, 7943, 8913, 10000}, + { 11220, 12589, 14125, 15849, 17783, 19953, 22387, 25119}, + { 28184, 31623, 35481, 39811, 44668, 50119, 56234, 65535} +}; + + +//============================================================ +// Local Function predefine. +//============================================================ + +/* START------------COMMON INFO RELATED--------------- */ + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) +VOID +ODM_UpdateInitRateWorkItemCallback( + IN PVOID pContext + ); +#endif + +VOID +odm_GlobalAdapterCheck( + IN VOID + ); + +//move to odm_PowerTacking.h by YuChen + + +VOID +odm_IQCalibrate( + IN PDM_ODM_T pDM_Odm + ); + +//remove by YuChen for PT + +VOID +odm_UpdatePowerTrainingState( + IN PDM_ODM_T pDM_Odm +); + +//============================================================ +//3 Export Interface +//============================================================ + +/*Y = 10*log(X)*/ +s4Byte +ODM_PWdB_Conversion( + IN s4Byte X, + IN u4Byte TotalBit, + IN u4Byte DecimalBit + ) +{ + s4Byte Y, integer = 0, decimal = 0; + u4Byte i; + + if(X == 0) + X = 1; // log2(x), x can't be 0 + + for(i = (TotalBit-1); i > 0; i--) + { + if(X & BIT(i)) + { + integer = i; + if(i > 0) + decimal = (X & BIT(i-1))?2:0; //decimal is 0.5dB*3=1.5dB~=2dB + break; + } + } + + Y = 3*(integer-DecimalBit)+decimal; //10*log(x)=3*log2(x), + + return Y; +} + +s4Byte +ODM_SignConversion( + IN s4Byte value, + IN u4Byte TotalBit + ) +{ + if(value&BIT(TotalBit-1)) + value -= BIT(TotalBit); + return value; +} + +VOID +ODM_InitMpDriverStatus( + IN PDM_ODM_T pDM_Odm +) +{ +#if(DM_ODM_SUPPORT_TYPE & ODM_WIN) + + // Decide when compile time + #if(MP_DRIVER == 1) + pDM_Odm->mp_mode = TRUE; + #else + pDM_Odm->mp_mode = FALSE; + #endif + +#elif(DM_ODM_SUPPORT_TYPE & ODM_CE) + + PADAPTER Adapter = pDM_Odm->Adapter; + + // Update information every period + pDM_Odm->mp_mode = (BOOLEAN)Adapter->registrypriv.mp_mode; + +#else + + // MP mode is always false at AP side + pDM_Odm->mp_mode = FALSE; + +#endif +} + +VOID +ODM_UpdateMpDriverStatus( + IN PDM_ODM_T pDM_Odm +) +{ +#if(DM_ODM_SUPPORT_TYPE & ODM_WIN) + + // Do nothing. + +#elif(DM_ODM_SUPPORT_TYPE & ODM_CE) + PADAPTER Adapter = pDM_Odm->Adapter; + + // Update information erery period + pDM_Odm->mp_mode = (BOOLEAN)Adapter->registrypriv.mp_mode; + +#else + + // Do nothing. + +#endif +} + +VOID +odm_CommonInfoSelfInit( + IN PDM_ODM_T pDM_Odm + ) +{ + pDM_Odm->bCckHighPower = (BOOLEAN) ODM_GetBBReg(pDM_Odm, ODM_REG(CCK_RPT_FORMAT,pDM_Odm), ODM_BIT(CCK_RPT_FORMAT,pDM_Odm)); + pDM_Odm->RFPathRxEnable = (u1Byte) ODM_GetBBReg(pDM_Odm, ODM_REG(BB_RX_PATH,pDM_Odm), ODM_BIT(BB_RX_PATH,pDM_Odm)); +#if (DM_ODM_SUPPORT_TYPE != ODM_CE) + pDM_Odm->pbNet_closed = &pDM_Odm->BOOLEAN_temp; +#endif + + PHYDM_InitDebugSetting(pDM_Odm); + ODM_InitMpDriverStatus(pDM_Odm); + + pDM_Odm->TxRate = 0xFF; + +} + +VOID +odm_CommonInfoSelfUpdate( + IN PDM_ODM_T pDM_Odm + ) +{ + u1Byte EntryCnt=0; + u4Byte i,OneEntry_MACID=0; + PSTA_INFO_T pEntry; + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + + PADAPTER Adapter = pDM_Odm->Adapter; + PMGNT_INFO pMgntInfo = &Adapter->MgntInfo; + + pEntry = pDM_Odm->pODM_StaInfo[0]; + if(pMgntInfo->mAssoc) + { + pEntry->bUsed=TRUE; + for (i=0; i<6; i++) + pEntry->MacAddr[i] = pMgntInfo->Bssid[i]; + } + else + { + pEntry->bUsed=FALSE; + for (i=0; i<6; i++) + pEntry->MacAddr[i] = 0; + } + + //STA mode is linked to AP + if(IS_STA_VALID(pDM_Odm->pODM_StaInfo[0]) && !ACTING_AS_AP(Adapter)) + pDM_Odm->bsta_state = TRUE; + else + pDM_Odm->bsta_state = FALSE; +#endif + + + if(*(pDM_Odm->pBandWidth) == ODM_BW40M) + { + if(*(pDM_Odm->pSecChOffset) == 1) + pDM_Odm->ControlChannel = *(pDM_Odm->pChannel) -2; + else if(*(pDM_Odm->pSecChOffset) == 2) + pDM_Odm->ControlChannel = *(pDM_Odm->pChannel) +2; + } + else + pDM_Odm->ControlChannel = *(pDM_Odm->pChannel); + + for (i=0; ipODM_StaInfo[i]; + if(IS_STA_VALID(pEntry)) + { + EntryCnt++; + if(EntryCnt==1) + { + OneEntry_MACID=i; + } + } + } + + if(EntryCnt == 1) + { + pDM_Odm->bOneEntryOnly = TRUE; + pDM_Odm->OneEntry_MACID=OneEntry_MACID; + } + else + pDM_Odm->bOneEntryOnly = FALSE; + + // Update MP driver status + ODM_UpdateMpDriverStatus(pDM_Odm); +} + +VOID +odm_CommonInfoSelfReset( + IN PDM_ODM_T pDM_Odm + ) +{ +#if( DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) + pDM_Odm->PhyDbgInfo.NumQryBeaconPkt = 0; +#endif +} + +PVOID +PhyDM_Get_Structure( + IN PDM_ODM_T pDM_Odm, + IN u1Byte Structure_Type +) + +{ + PVOID pStruct = NULL; +#if RTL8195A_SUPPORT + switch (Structure_Type){ + case PHYDM_FALSEALMCNT: + pStruct = &FalseAlmCnt; + break; + + case PHYDM_CFOTRACK: + pStruct = &DM_CfoTrack; + break; + + default: + break; + } + +#else + switch (Structure_Type){ + case PHYDM_FALSEALMCNT: + pStruct = &(pDM_Odm->FalseAlmCnt); + break; + + case PHYDM_CFOTRACK: + pStruct = &(pDM_Odm->DM_CfoTrack); + break; + + default: + break; + } + +#endif + return pStruct; +} + +VOID +odm_HWSetting( + IN PDM_ODM_T pDM_Odm + ) +{ +#if (RTL8821A_SUPPORT == 1) + if(pDM_Odm->SupportICType & ODM_RTL8821) + odm_HWSetting_8821A(pDM_Odm); +#endif + +} + +// +// 2011/09/21 MH Add to describe different team necessary resource allocate?? +// +VOID +ODM_DMInit( + IN PDM_ODM_T pDM_Odm + ) +{ + + odm_CommonInfoSelfInit(pDM_Odm); + odm_DIGInit(pDM_Odm); + Phydm_NHMCounterStatisticsInit(pDM_Odm); + Phydm_AdaptivityInit(pDM_Odm); + odm_RateAdaptiveMaskInit(pDM_Odm); + odm_RA_ParaAdjust_init(pDM_Odm); + ODM_CfoTrackingInit(pDM_Odm); + ODM_EdcaTurboInit(pDM_Odm); + odm_RSSIMonitorInit(pDM_Odm); + odm_TXPowerTrackingInit(pDM_Odm); + odm_AntennaDiversityInit(pDM_Odm); + odm_AutoChannelSelectInit(pDM_Odm); + odm_PathDiversityInit(pDM_Odm); + +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) + ODM_ClearTxPowerTrackingState(pDM_Odm); +#endif + + if(pDM_Odm->SupportICType & ODM_IC_11N_SERIES) + { + odm_DynamicBBPowerSavingInit(pDM_Odm); + odm_DynamicTxPowerInit(pDM_Odm); + +#if (RTL8188E_SUPPORT == 1) + if(pDM_Odm->SupportICType==ODM_RTL8188E) + { + odm_PrimaryCCA_Init(pDM_Odm); + ODM_RAInfo_Init_all(pDM_Odm); + } +#endif + +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) + + #if (RTL8723B_SUPPORT == 1) + if(pDM_Odm->SupportICType == ODM_RTL8723B) + odm_SwAntDetectInit(pDM_Odm); + #endif + + #if (RTL8192E_SUPPORT == 1) + if(pDM_Odm->SupportICType==ODM_RTL8192E) + odm_PrimaryCCA_Check_Init(pDM_Odm); + #endif + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + #if (RTL8723A_SUPPORT == 1) + if(pDM_Odm->SupportICType == ODM_RTL8723A) + odm_PSDMonitorInit(pDM_Odm); + #endif + + #if (RTL8192D_SUPPORT == 1) + if(pDM_Odm->SupportICType==ODM_RTL8192D) + odm_PathDivInit_92D(pDM_Odm); + #endif + + #if ((RTL8192C_SUPPORT == 1) || (RTL8192D_SUPPORT == 1)) + if(pDM_Odm->SupportICType & (ODM_RTL8192C|ODM_RTL8192D)) + odm_RXHPInit(pDM_Odm); + #endif +#endif +#endif + + } + +} + +VOID +ODM_DMReset( + IN PDM_ODM_T pDM_Odm + ) +{ + ODM_AntDivReset(pDM_Odm); +} + +#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) +// +//tmp modify for LC Only +// +VOID +ODM_DMWatchdog_LPS( + IN PDM_ODM_T pDM_Odm + ) +{ + odm_CommonInfoSelfUpdate(pDM_Odm); + odm_FalseAlarmCounterStatistics(pDM_Odm); + odm_RSSIMonitorCheck(pDM_Odm); + odm_DIGbyRSSI_LPS(pDM_Odm); + odm_CCKPacketDetectionThresh(pDM_Odm); + odm_CommonInfoSelfReset(pDM_Odm); + + if(*(pDM_Odm->pbPowerSaving)==TRUE) + return; +} +#endif +// +// 2011/09/20 MH This is the entry pointer for all team to execute HW out source DM. +// You can not add any dummy function here, be care, you can only use DM structure +// to perform any new ODM_DM. +// +VOID +ODM_DMWatchdog( + IN PDM_ODM_T pDM_Odm + ) +{ + ODM_AsocEntry_Init(pDM_Odm); + odm_CommonInfoSelfUpdate(pDM_Odm); + phydm_BasicDbgMessage(pDM_Odm); + odm_HWSetting(pDM_Odm); + +#if (DM_ODM_SUPPORT_TYPE == ODM_AP) + { + prtl8192cd_priv priv = pDM_Odm->priv; + if( (priv->auto_channel != 0) && (priv->auto_channel != 2) )//if ACS running, do not do FA/CCA counter read + return; + } +#endif + odm_FalseAlarmCounterStatistics(pDM_Odm); + odm_RSSIMonitorCheck(pDM_Odm); + + if(*(pDM_Odm->pbPowerSaving) == TRUE) + { + odm_DIGbyRSSI_LPS(pDM_Odm); + { + pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable; + Phydm_Adaptivity(pDM_Odm, pDM_DigTable->CurIGValue); + } + ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("DMWatchdog in power saving mode\n")); + return; + } + + Phydm_CheckAdaptivity(pDM_Odm); + odm_UpdatePowerTrainingState(pDM_Odm); + odm_DIG(pDM_Odm); + { + pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable; + Phydm_Adaptivity(pDM_Odm, pDM_DigTable->CurIGValue); + } + odm_CCKPacketDetectionThresh(pDM_Odm); + odm_RefreshRateAdaptiveMask(pDM_Odm); + odm_RefreshBasicRateMask(pDM_Odm); + odm_DynamicBBPowerSaving(pDM_Odm); + odm_EdcaTurboCheck(pDM_Odm); + odm_PathDiversity(pDM_Odm); + ODM_CfoTracking(pDM_Odm); + odm_DynamicTxPower(pDM_Odm); + odm_AntennaDiversity(pDM_Odm); + +#if( DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) + + ODM_TXPowerTrackingCheck(pDM_Odm); + + if(pDM_Odm->SupportICType & ODM_IC_11AC_SERIES) + odm_IQCalibrate(pDM_Odm); + else +#endif + if(pDM_Odm->SupportICType & ODM_IC_11N_SERIES) + { +#if (RTL8192D_SUPPORT == 1) + if(pDM_Odm->SupportICType==ODM_RTL8192D) + ODM_DynamicEarlyMode(pDM_Odm); +#endif + +#if (RTL8188E_SUPPORT == 1) + if(pDM_Odm->SupportICType==ODM_RTL8188E) + odm_DynamicPrimaryCCA(pDM_Odm); +#endif + +#if( DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) + + #if (RTL8192E_SUPPORT == 1) + if(pDM_Odm->SupportICType==ODM_RTL8192E) + odm_DynamicPrimaryCCA_Check(pDM_Odm); + #endif + +#if( DM_ODM_SUPPORT_TYPE == ODM_WIN) + #if ((RTL8192C_SUPPORT == 1) || (RTL8192D_SUPPORT == 1)) + if(pDM_Odm->SupportICType & (ODM_RTL8192C|ODM_RTL8192D)) + odm_RXHP(pDM_Odm); + #endif +#endif +#endif + } + +#if (DM_ODM_SUPPORT_TYPE == ODM_CE) + odm_dtc(pDM_Odm); +#endif + + odm_CommonInfoSelfReset(pDM_Odm); + +} + + +// +// Init /.. Fixed HW value. Only init time. +// +VOID +ODM_CmnInfoInit( + IN PDM_ODM_T pDM_Odm, + IN ODM_CMNINFO_E CmnInfo, + IN u4Byte Value + ) +{ + // + // This section is used for init value + // + switch (CmnInfo) + { + // + // Fixed ODM value. + // + case ODM_CMNINFO_ABILITY: + pDM_Odm->SupportAbility = (u4Byte)Value; + break; + + case ODM_CMNINFO_RF_TYPE: + pDM_Odm->RFType = (u1Byte)Value; + break; + + case ODM_CMNINFO_PLATFORM: + pDM_Odm->SupportPlatform = (u1Byte)Value; + break; + + case ODM_CMNINFO_INTERFACE: + pDM_Odm->SupportInterface = (u1Byte)Value; + break; + + case ODM_CMNINFO_MP_TEST_CHIP: + pDM_Odm->bIsMPChip= (u1Byte)Value; + break; + + case ODM_CMNINFO_IC_TYPE: + pDM_Odm->SupportICType = Value; + break; + + case ODM_CMNINFO_CUT_VER: + pDM_Odm->CutVersion = (u1Byte)Value; + break; + + case ODM_CMNINFO_FAB_VER: + pDM_Odm->FabVersion = (u1Byte)Value; + break; + + case ODM_CMNINFO_RFE_TYPE: + pDM_Odm->RFEType = (u1Byte)Value; + break; + + case ODM_CMNINFO_RF_ANTENNA_TYPE: + pDM_Odm->AntDivType= (u1Byte)Value; + break; + + case ODM_CMNINFO_BOARD_TYPE: + pDM_Odm->BoardType = (u1Byte)Value; + break; + + case ODM_CMNINFO_PACKAGE_TYPE: + pDM_Odm->PackageType = (u1Byte)Value; + break; + + case ODM_CMNINFO_EXT_LNA: + pDM_Odm->ExtLNA = (u1Byte)Value; + break; + + case ODM_CMNINFO_5G_EXT_LNA: + pDM_Odm->ExtLNA5G = (u1Byte)Value; + break; + + case ODM_CMNINFO_EXT_PA: + pDM_Odm->ExtPA = (u1Byte)Value; + break; + + case ODM_CMNINFO_5G_EXT_PA: + pDM_Odm->ExtPA5G = (u1Byte)Value; + break; + + case ODM_CMNINFO_GPA: + pDM_Odm->TypeGPA= (ODM_TYPE_GPA_E)Value; + break; + case ODM_CMNINFO_APA: + pDM_Odm->TypeAPA= (ODM_TYPE_APA_E)Value; + break; + case ODM_CMNINFO_GLNA: + pDM_Odm->TypeGLNA= (ODM_TYPE_GLNA_E)Value; + break; + case ODM_CMNINFO_ALNA: + pDM_Odm->TypeALNA= (ODM_TYPE_ALNA_E)Value; + break; + + case ODM_CMNINFO_EXT_TRSW: + pDM_Odm->ExtTRSW = (u1Byte)Value; + break; + case ODM_CMNINFO_PATCH_ID: + pDM_Odm->PatchID = (u1Byte)Value; + break; + case ODM_CMNINFO_BINHCT_TEST: + pDM_Odm->bInHctTest = (BOOLEAN)Value; + break; + case ODM_CMNINFO_BWIFI_TEST: + pDM_Odm->bWIFITest = (BOOLEAN)Value; + break; + case ODM_CMNINFO_SMART_CONCURRENT: + pDM_Odm->bDualMacSmartConcurrent = (BOOLEAN )Value; + break; + case ODM_CMNINFO_DOMAIN_CODE_2G: + pDM_Odm->odm_Regulation2_4G = (u1Byte)Value; + break; + case ODM_CMNINFO_DOMAIN_CODE_5G: + pDM_Odm->odm_Regulation5G = (u1Byte)Value; + break; + case ODM_CMNINFO_CONFIG_BB_RF: + pDM_Odm->ConfigBBRF = (BOOLEAN)Value; + break; + case ODM_CMNINFO_IQKFWOFFLOAD: + pDM_Odm->IQKFWOffload = (u1Byte)Value; + break; + //To remove the compiler warning, must add an empty default statement to handle the other values. + default: + //do nothing + break; + + } + +} + + +VOID +ODM_CmnInfoHook( + IN PDM_ODM_T pDM_Odm, + IN ODM_CMNINFO_E CmnInfo, + IN PVOID pValue + ) +{ + // + // Hook call by reference pointer. + // + switch (CmnInfo) + { + // + // Dynamic call by reference pointer. + // + case ODM_CMNINFO_MAC_PHY_MODE: + pDM_Odm->pMacPhyMode = (u1Byte *)pValue; + break; + + case ODM_CMNINFO_TX_UNI: + pDM_Odm->pNumTxBytesUnicast = (u8Byte *)pValue; + break; + + case ODM_CMNINFO_RX_UNI: + pDM_Odm->pNumRxBytesUnicast = (u8Byte *)pValue; + break; + + case ODM_CMNINFO_WM_MODE: + pDM_Odm->pWirelessMode = (u1Byte *)pValue; + break; + + case ODM_CMNINFO_BAND: + pDM_Odm->pBandType = (u1Byte *)pValue; + break; + + case ODM_CMNINFO_SEC_CHNL_OFFSET: + pDM_Odm->pSecChOffset = (u1Byte *)pValue; + break; + + case ODM_CMNINFO_SEC_MODE: + pDM_Odm->pSecurity = (u1Byte *)pValue; + break; + + case ODM_CMNINFO_BW: + pDM_Odm->pBandWidth = (u1Byte *)pValue; + break; + + case ODM_CMNINFO_CHNL: + pDM_Odm->pChannel = (u1Byte *)pValue; + break; + + case ODM_CMNINFO_DMSP_GET_VALUE: + pDM_Odm->pbGetValueFromOtherMac = (BOOLEAN *)pValue; + break; + + case ODM_CMNINFO_BUDDY_ADAPTOR: + pDM_Odm->pBuddyAdapter = (PADAPTER *)pValue; + break; + + case ODM_CMNINFO_DMSP_IS_MASTER: + pDM_Odm->pbMasterOfDMSP = (BOOLEAN *)pValue; + break; + + case ODM_CMNINFO_SCAN: + pDM_Odm->pbScanInProcess = (BOOLEAN *)pValue; + break; + + case ODM_CMNINFO_POWER_SAVING: + pDM_Odm->pbPowerSaving = (BOOLEAN *)pValue; + break; + + case ODM_CMNINFO_ONE_PATH_CCA: + pDM_Odm->pOnePathCCA = (u1Byte *)pValue; + break; + + case ODM_CMNINFO_DRV_STOP: + pDM_Odm->pbDriverStopped = (BOOLEAN *)pValue; + break; + + case ODM_CMNINFO_PNP_IN: + pDM_Odm->pbDriverIsGoingToPnpSetPowerSleep = (BOOLEAN *)pValue; + break; + + case ODM_CMNINFO_INIT_ON: + pDM_Odm->pinit_adpt_in_progress = (BOOLEAN *)pValue; + break; + + case ODM_CMNINFO_ANT_TEST: + pDM_Odm->pAntennaTest = (u1Byte *)pValue; + break; + + case ODM_CMNINFO_NET_CLOSED: + pDM_Odm->pbNet_closed = (BOOLEAN *)pValue; + break; + + case ODM_CMNINFO_FORCED_RATE: + pDM_Odm->pForcedDataRate = (pu2Byte)pValue; + break; + + case ODM_CMNINFO_FORCED_IGI_LB: + pDM_Odm->pu1ForcedIgiLb = (u1Byte *)pValue; + break; + + case ODM_CMNINFO_P2P_LINK: + pDM_Odm->DM_DigTable.pbP2pLinkInProgress = (u1Byte *)pValue; + break; + + case ODM_CMNINFO_IS1ANTENNA: + pDM_Odm->pIs1Antenna = (BOOLEAN *)pValue; + break; + + case ODM_CMNINFO_RFDEFAULTPATH: + pDM_Odm->pRFDefaultPath= (u1Byte *)pValue; + break; + + case ODM_CMNINFO_FCS_MODE: + pDM_Odm->pIsFcsModeEnable = (BOOLEAN *)pValue; + break; + + //case ODM_CMNINFO_RTSTA_AID: + // pDM_Odm->pAidMap = (u1Byte *)pValue; + // break; + + //case ODM_CMNINFO_BT_COEXIST: + // pDM_Odm->BTCoexist = (BOOLEAN *)pValue; + + //case ODM_CMNINFO_STA_STATUS: + //pDM_Odm->pODM_StaInfo[] = (PSTA_INFO_T)pValue; + //break; + + //case ODM_CMNINFO_PHY_STATUS: + // pDM_Odm->pPhyInfo = (ODM_PHY_INFO *)pValue; + // break; + + //case ODM_CMNINFO_MAC_STATUS: + // pDM_Odm->pMacInfo = (ODM_MAC_INFO *)pValue; + // break; + //To remove the compiler warning, must add an empty default statement to handle the other values. + default: + //do nothing + break; + + } + +} + + +VOID +ODM_CmnInfoPtrArrayHook( + IN PDM_ODM_T pDM_Odm, + IN ODM_CMNINFO_E CmnInfo, + IN u2Byte Index, + IN PVOID pValue + ) +{ + // + // Hook call by reference pointer. + // + switch (CmnInfo) + { + // + // Dynamic call by reference pointer. + // + case ODM_CMNINFO_STA_STATUS: + pDM_Odm->pODM_StaInfo[Index] = (PSTA_INFO_T)pValue; + break; + //To remove the compiler warning, must add an empty default statement to handle the other values. + default: + //do nothing + break; + } + +} + + +// +// Update Band/CHannel/.. The values are dynamic but non-per-packet. +// +VOID +ODM_CmnInfoUpdate( + IN PDM_ODM_T pDM_Odm, + IN u4Byte CmnInfo, + IN u8Byte Value + ) +{ + // + // This init variable may be changed in run time. + // + switch (CmnInfo) + { + case ODM_CMNINFO_LINK_IN_PROGRESS: + pDM_Odm->bLinkInProcess = (BOOLEAN)Value; + break; + + case ODM_CMNINFO_ABILITY: + pDM_Odm->SupportAbility = (u4Byte)Value; + break; + + case ODM_CMNINFO_RF_TYPE: + pDM_Odm->RFType = (u1Byte)Value; + break; + + case ODM_CMNINFO_WIFI_DIRECT: + pDM_Odm->bWIFI_Direct = (BOOLEAN)Value; + break; + + case ODM_CMNINFO_WIFI_DISPLAY: + pDM_Odm->bWIFI_Display = (BOOLEAN)Value; + break; + + case ODM_CMNINFO_LINK: + pDM_Odm->bLinked = (BOOLEAN)Value; + break; + + case ODM_CMNINFO_STATION_STATE: + pDM_Odm->bsta_state = (BOOLEAN)Value; + break; + + case ODM_CMNINFO_RSSI_MIN: + pDM_Odm->RSSI_Min= (u1Byte)Value; + break; + + case ODM_CMNINFO_DBG_COMP: + pDM_Odm->DebugComponents = Value; + break; + + case ODM_CMNINFO_DBG_LEVEL: + pDM_Odm->DebugLevel = (u4Byte)Value; + break; + case ODM_CMNINFO_RA_THRESHOLD_HIGH: + pDM_Odm->RateAdaptive.HighRSSIThresh = (u1Byte)Value; + break; + + case ODM_CMNINFO_RA_THRESHOLD_LOW: + pDM_Odm->RateAdaptive.LowRSSIThresh = (u1Byte)Value; + break; +#if defined(BT_30_SUPPORT) && (BT_30_SUPPORT == 1) + // The following is for BT HS mode and BT coexist mechanism. + case ODM_CMNINFO_BT_ENABLED: + pDM_Odm->bBtEnabled = (BOOLEAN)Value; + break; + + case ODM_CMNINFO_BT_HS_CONNECT_PROCESS: + pDM_Odm->bBtConnectProcess = (BOOLEAN)Value; + break; + + case ODM_CMNINFO_BT_HS_RSSI: + pDM_Odm->btHsRssi = (u1Byte)Value; + break; + + case ODM_CMNINFO_BT_OPERATION: + pDM_Odm->bBtHsOperation = (BOOLEAN)Value; + break; + + case ODM_CMNINFO_BT_LIMITED_DIG: + pDM_Odm->bBtLimitedDig = (BOOLEAN)Value; + break; + + case ODM_CMNINFO_BT_DIG: + pDM_Odm->btHsDigVal = (u1Byte)Value; + break; + + case ODM_CMNINFO_BT_BUSY: + pDM_Odm->bBtBusy = (BOOLEAN)Value; + break; + + case ODM_CMNINFO_BT_DISABLE_EDCA: + pDM_Odm->bBtDisableEdcaTurbo = (BOOLEAN)Value; + break; +#endif + +#if(DM_ODM_SUPPORT_TYPE & ODM_AP) // for repeater mode add by YuChen 2014.06.23 +#ifdef UNIVERSAL_REPEATER + case ODM_CMNINFO_VXD_LINK: + pDM_Odm->VXD_bLinked= (BOOLEAN)Value; + break; +#endif +#endif +/* + case ODM_CMNINFO_OP_MODE: + pDM_Odm->OPMode = (u1Byte)Value; + break; + + case ODM_CMNINFO_WM_MODE: + pDM_Odm->WirelessMode = (u1Byte)Value; + break; + + case ODM_CMNINFO_BAND: + pDM_Odm->BandType = (u1Byte)Value; + break; + + case ODM_CMNINFO_SEC_CHNL_OFFSET: + pDM_Odm->SecChOffset = (u1Byte)Value; + break; + + case ODM_CMNINFO_SEC_MODE: + pDM_Odm->Security = (u1Byte)Value; + break; + + case ODM_CMNINFO_BW: + pDM_Odm->BandWidth = (u1Byte)Value; + break; + + case ODM_CMNINFO_CHNL: + pDM_Odm->Channel = (u1Byte)Value; + break; +*/ + default: + //do nothing + break; + } + + +} + + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) +VOID +ODM_InitAllWorkItems(IN PDM_ODM_T pDM_Odm ) +{ +#if USE_WORKITEM + PADAPTER pAdapter = pDM_Odm->Adapter; + +#if (RTL8723B_SUPPORT == 1)||(RTL8821A_SUPPORT == 1) + ODM_InitializeWorkItem( pDM_Odm, + &pDM_Odm->DM_SWAT_Table.SwAntennaSwitchWorkitem_8723B, + (RT_WORKITEM_CALL_BACK)ODM_SW_AntDiv_WorkitemCallback, + (PVOID)pAdapter, + "AntennaSwitchWorkitem"); +#endif + + ODM_InitializeWorkItem( pDM_Odm, + &pDM_Odm->DM_SWAT_Table.SwAntennaSwitchWorkitem, + (RT_WORKITEM_CALL_BACK)odm_SwAntDivChkAntSwitchWorkitemCallback, + (PVOID)pAdapter, + "AntennaSwitchWorkitem"); + + + ODM_InitializeWorkItem( + pDM_Odm, + &(pDM_Odm->PathDivSwitchWorkitem), + (RT_WORKITEM_CALL_BACK)odm_PathDivChkAntSwitchWorkitemCallback, + (PVOID)pAdapter, + "SWAS_WorkItem"); + + ODM_InitializeWorkItem( + pDM_Odm, + &(pDM_Odm->CCKPathDiversityWorkitem), + (RT_WORKITEM_CALL_BACK)odm_CCKTXPathDiversityWorkItemCallback, + (PVOID)pAdapter, + "CCKTXPathDiversityWorkItem"); + + ODM_InitializeWorkItem( + pDM_Odm, + &(pDM_Odm->MPT_DIGWorkitem), + (RT_WORKITEM_CALL_BACK)odm_MPT_DIGWorkItemCallback, + (PVOID)pAdapter, + "MPT_DIGWorkitem"); + + ODM_InitializeWorkItem( + pDM_Odm, + &(pDM_Odm->RaRptWorkitem), + (RT_WORKITEM_CALL_BACK)ODM_UpdateInitRateWorkItemCallback, + (PVOID)pAdapter, + "RaRptWorkitem"); + + ODM_InitializeWorkItem( + pDM_Odm, + &(pDM_Odm->sbdcnt_workitem), + (RT_WORKITEM_CALL_BACK)phydm_sbd_workitem_callback, + (PVOID)pAdapter, + "SbdCntWorkitem"); + +#if( defined(CONFIG_5G_CG_SMART_ANT_DIVERSITY) ) ||( defined(CONFIG_2G_CG_SMART_ANT_DIVERSITY) ) + ODM_InitializeWorkItem( + pDM_Odm, + &(pDM_Odm->FastAntTrainingWorkitem), + (RT_WORKITEM_CALL_BACK)odm_FastAntTrainingWorkItemCallback, + (PVOID)pAdapter, + "FastAntTrainingWorkitem"); +#endif + ODM_InitializeWorkItem( + pDM_Odm, + &(pDM_Odm->DM_RXHP_Table.PSDTimeWorkitem), + (RT_WORKITEM_CALL_BACK)odm_PSD_RXHPWorkitemCallback, + (PVOID)pAdapter, + "PSDRXHP_WorkItem"); +#endif +} + +VOID +ODM_FreeAllWorkItems(IN PDM_ODM_T pDM_Odm ) +{ +#if USE_WORKITEM +#if (RTL8723B_SUPPORT == 1)||(RTL8821A_SUPPORT == 1) + ODM_FreeWorkItem( &(pDM_Odm->DM_SWAT_Table.SwAntennaSwitchWorkitem_8723B)); +#endif + ODM_FreeWorkItem( &(pDM_Odm->DM_SWAT_Table.SwAntennaSwitchWorkitem)); + ODM_FreeWorkItem(&(pDM_Odm->PathDivSwitchWorkitem)); + ODM_FreeWorkItem(&(pDM_Odm->CCKPathDiversityWorkitem)); + ODM_FreeWorkItem(&(pDM_Odm->FastAntTrainingWorkitem)); + ODM_FreeWorkItem(&(pDM_Odm->MPT_DIGWorkitem)); + ODM_FreeWorkItem(&(pDM_Odm->RaRptWorkitem)); + ODM_FreeWorkItem((&pDM_Odm->DM_RXHP_Table.PSDTimeWorkitem)); + ODM_FreeWorkItem((&pDM_Odm->sbdcnt_workitem)); +#endif +} +#endif + +/* +VOID +odm_FindMinimumRSSI( + IN PDM_ODM_T pDM_Odm + ) +{ + u4Byte i; + u1Byte RSSI_Min = 0xFF; + + for(i=0; ipODM_StaInfo[i] != NULL) + if(IS_STA_VALID(pDM_Odm->pODM_StaInfo[i]) ) + { + if(pDM_Odm->pODM_StaInfo[i]->RSSI_Ave < RSSI_Min) + { + RSSI_Min = pDM_Odm->pODM_StaInfo[i]->RSSI_Ave; + } + } + } + + pDM_Odm->RSSI_Min = RSSI_Min; + +} + +VOID +odm_IsLinked( + IN PDM_ODM_T pDM_Odm + ) +{ + u4Byte i; + BOOLEAN Linked = FALSE; + + for(i=0; ipODM_StaInfo[i]) ) + { + Linked = TRUE; + break; + } + + } + + pDM_Odm->bLinked = Linked; +} +*/ + +VOID +ODM_InitAllTimers( + IN PDM_ODM_T pDM_Odm + ) +{ +#if(defined(CONFIG_HW_ANTENNA_DIVERSITY)) + ODM_AntDivTimers(pDM_Odm,INIT_ANTDIV_TIMMER); +#elif(defined(CONFIG_SW_ANTENNA_DIVERSITY)) + ODM_InitializeTimer(pDM_Odm,&pDM_Odm->DM_SWAT_Table.SwAntennaSwitchTimer, + (RT_TIMER_CALL_BACK)odm_SwAntDivChkAntSwitchCallback, NULL, "SwAntennaSwitchTimer"); +#endif + +#if (DM_ODM_SUPPORT_TYPE == ODM_AP) +#ifdef MP_TEST + if (pDM_Odm->priv->pshare->rf_ft_var.mp_specific) + ODM_InitializeTimer(pDM_Odm, &pDM_Odm->MPT_DIGTimer, + (RT_TIMER_CALL_BACK)odm_MPT_DIGCallback, NULL, "MPT_DIGTimer"); +#endif +#elif(DM_ODM_SUPPORT_TYPE == ODM_WIN) + ODM_InitializeTimer(pDM_Odm, &pDM_Odm->MPT_DIGTimer, + (RT_TIMER_CALL_BACK)odm_MPT_DIGCallback, NULL, "MPT_DIGTimer"); +#endif + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + ODM_InitializeTimer(pDM_Odm, &pDM_Odm->PSDTimer, + (RT_TIMER_CALL_BACK)dm_PSDMonitorCallback, NULL, "PSDTimer"); + ODM_InitializeTimer(pDM_Odm, &pDM_Odm->PathDivSwitchTimer, + (RT_TIMER_CALL_BACK)odm_PathDivChkAntSwitchCallback, NULL, "PathDivTimer"); + ODM_InitializeTimer(pDM_Odm, &pDM_Odm->CCKPathDiversityTimer, + (RT_TIMER_CALL_BACK)odm_CCKTXPathDiversityCallback, NULL, "CCKPathDiversityTimer"); + ODM_InitializeTimer(pDM_Odm, &pDM_Odm->DM_RXHP_Table.PSDTimer, + (RT_TIMER_CALL_BACK)odm_PSD_RXHPCallback, NULL, "PSDRXHPTimer"); + ODM_InitializeTimer(pDM_Odm, &pDM_Odm->sbdcnt_timer, + (RT_TIMER_CALL_BACK)phydm_sbd_callback, NULL, "SbdTimer"); + +#endif +} + +VOID +ODM_CancelAllTimers( + IN PDM_ODM_T pDM_Odm + ) +{ +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + // + // 2012/01/12 MH Temp BSOD fix. We need to find NIC allocate mem fail reason in + // win7 platform. + // + HAL_ADAPTER_STS_CHK(pDM_Odm) +#endif + +#if(defined(CONFIG_HW_ANTENNA_DIVERSITY)) + ODM_AntDivTimers(pDM_Odm,CANCEL_ANTDIV_TIMMER); +#elif(defined(CONFIG_SW_ANTENNA_DIVERSITY)) + ODM_CancelTimer(pDM_Odm,&pDM_Odm->DM_SWAT_Table.SwAntennaSwitchTimer); +#endif + +#if (DM_ODM_SUPPORT_TYPE == ODM_AP) +#ifdef MP_TEST + if (pDM_Odm->priv->pshare->rf_ft_var.mp_specific) + ODM_CancelTimer(pDM_Odm, &pDM_Odm->MPT_DIGTimer); +#endif +#elif (DM_ODM_SUPPORT_TYPE == ODM_WIN) + ODM_CancelTimer(pDM_Odm, &pDM_Odm->MPT_DIGTimer); +#endif + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + ODM_CancelTimer(pDM_Odm, &pDM_Odm->PSDTimer); + ODM_CancelTimer(pDM_Odm, &pDM_Odm->PathDivSwitchTimer); + ODM_CancelTimer(pDM_Odm, &pDM_Odm->CCKPathDiversityTimer); + ODM_CancelTimer(pDM_Odm, &pDM_Odm->DM_RXHP_Table.PSDTimer); + ODM_CancelTimer(pDM_Odm, &pDM_Odm->sbdcnt_timer); +#endif +} + + +VOID +ODM_ReleaseAllTimers( + IN PDM_ODM_T pDM_Odm + ) +{ +#if(defined(CONFIG_HW_ANTENNA_DIVERSITY)) + ODM_AntDivTimers(pDM_Odm,RELEASE_ANTDIV_TIMMER); +#elif(defined(CONFIG_SW_ANTENNA_DIVERSITY)) + ODM_ReleaseTimer(pDM_Odm,&pDM_Odm->DM_SWAT_Table.SwAntennaSwitchTimer); +#endif + +#if (DM_ODM_SUPPORT_TYPE == ODM_AP) + #ifdef MP_TEST + if (pDM_Odm->priv->pshare->rf_ft_var.mp_specific) + ODM_ReleaseTimer(pDM_Odm, &pDM_Odm->MPT_DIGTimer); + #endif +#elif(DM_ODM_SUPPORT_TYPE == ODM_WIN) +ODM_ReleaseTimer(pDM_Odm, &pDM_Odm->MPT_DIGTimer); +#endif + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + ODM_ReleaseTimer(pDM_Odm, &pDM_Odm->PSDTimer); + ODM_ReleaseTimer(pDM_Odm, &pDM_Odm->PathDivSwitchTimer); + ODM_ReleaseTimer(pDM_Odm, &pDM_Odm->CCKPathDiversityTimer); + ODM_ReleaseTimer(pDM_Odm, &pDM_Odm->DM_RXHP_Table.PSDTimer); + ODM_ReleaseTimer(pDM_Odm, &pDM_Odm->sbdcnt_timer); +#endif +} + + +//3============================================================ +//3 Tx Power Tracking +//3============================================================ + +VOID +odm_IQCalibrate( + IN PDM_ODM_T pDM_Odm + ) +{ + PADAPTER Adapter = pDM_Odm->Adapter; + +#if( DM_ODM_SUPPORT_TYPE == ODM_WIN) + if(*pDM_Odm->pIsFcsModeEnable) + return; +#endif + + if(!IS_HARDWARE_TYPE_JAGUAR(Adapter)) + return; + else if(IS_HARDWARE_TYPE_8812AU(Adapter)) + return; +#if (RTL8821A_SUPPORT == 1) + if(pDM_Odm->bLinked) + { + if((*pDM_Odm->pChannel != pDM_Odm->preChannel) && (!*pDM_Odm->pbScanInProcess)) + { + pDM_Odm->preChannel = *pDM_Odm->pChannel; + pDM_Odm->LinkedInterval = 0; + } + + if(pDM_Odm->LinkedInterval < 3) + pDM_Odm->LinkedInterval++; + + if(pDM_Odm->LinkedInterval == 2) + { + // Mark out IQK flow to prevent tx stuck. by Maddest 20130306 + // Open it verified by James 20130715 + PHY_IQCalibrate_8821A(pDM_Odm, FALSE); + } + } + else + pDM_Odm->LinkedInterval = 0; +#endif +} + + +#if (DM_ODM_SUPPORT_TYPE == ODM_AP) +VOID +ODM_InitAllThreads( + IN PDM_ODM_T pDM_Odm + ) +{ + #ifdef TPT_THREAD + kTPT_task_init(pDM_Odm->priv); + #endif +} + +VOID +ODM_StopAllThreads( + IN PDM_ODM_T pDM_Odm + ) +{ + #ifdef TPT_THREAD + kTPT_task_stop(pDM_Odm->priv); + #endif +} +#endif + + +#if( DM_ODM_SUPPORT_TYPE == ODM_WIN) +// +// 2011/07/26 MH Add an API for testing IQK fail case. +// +BOOLEAN +ODM_CheckPowerStatus( + IN PADAPTER Adapter) +{ + + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; + RT_RF_POWER_STATE rtState; + PMGNT_INFO pMgntInfo = &(Adapter->MgntInfo); + + // 2011/07/27 MH We are not testing ready~~!! We may fail to get correct value when init sequence. + if (pMgntInfo->init_adpt_in_progress == TRUE) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("ODM_CheckPowerStatus Return TRUE, due to initadapter\n")); + return TRUE; + } + + // + // 2011/07/19 MH We can not execute tx pwoer tracking/ LLC calibrate or IQK. + // + Adapter->HalFunc.GetHwRegHandler(Adapter, HW_VAR_RF_STATE, (pu1Byte)(&rtState)); + if(Adapter->bDriverStopped || Adapter->bDriverIsGoingToPnpSetPowerSleep || rtState == eRfOff) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("ODM_CheckPowerStatus Return FALSE, due to %d/%d/%d\n", + Adapter->bDriverStopped, Adapter->bDriverIsGoingToPnpSetPowerSleep, rtState)); + return FALSE; + } + return TRUE; +} +#elif( DM_ODM_SUPPORT_TYPE == ODM_AP) +BOOLEAN +ODM_CheckPowerStatus( + IN PADAPTER Adapter) +{ + /* + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; + RT_RF_POWER_STATE rtState; + PMGNT_INFO pMgntInfo = &(Adapter->MgntInfo); + + // 2011/07/27 MH We are not testing ready~~!! We may fail to get correct value when init sequence. + if (pMgntInfo->init_adpt_in_progress == TRUE) + { + ODM_RT_TRACE(pDM_Odm,COMP_INIT, DBG_LOUD, ("ODM_CheckPowerStatus Return TRUE, due to initadapter")); + return TRUE; + } + + // + // 2011/07/19 MH We can not execute tx pwoer tracking/ LLC calibrate or IQK. + // + Adapter->HalFunc.GetHwRegHandler(Adapter, HW_VAR_RF_STATE, (pu1Byte)(&rtState)); + if(Adapter->bDriverStopped || Adapter->bDriverIsGoingToPnpSetPowerSleep || rtState == eRfOff) + { + ODM_RT_TRACE(pDM_Odm,COMP_INIT, DBG_LOUD, ("ODM_CheckPowerStatus Return FALSE, due to %d/%d/%d\n", + Adapter->bDriverStopped, Adapter->bDriverIsGoingToPnpSetPowerSleep, rtState)); + return FALSE; + } + */ + return TRUE; +} +#endif + +// need to ODM CE Platform +//move to here for ANT detection mechanism using + +#if ((DM_ODM_SUPPORT_TYPE == ODM_WIN)||(DM_ODM_SUPPORT_TYPE == ODM_CE)) +u4Byte +GetPSDData( + IN PDM_ODM_T pDM_Odm, + unsigned int point, + u1Byte initial_gain_psd) +{ + //unsigned int val, rfval; + //int psd_report; + u4Byte psd_report; + + //HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + //Debug Message + //val = PHY_QueryBBReg(Adapter,0x908, bMaskDWord); + //DbgPrint("Reg908 = 0x%x\n",val); + //val = PHY_QueryBBReg(Adapter,0xDF4, bMaskDWord); + //rfval = PHY_QueryRFReg(Adapter, ODM_RF_PATH_A, 0x00, bRFRegOffsetMask); + //DbgPrint("RegDF4 = 0x%x, RFReg00 = 0x%x\n",val, rfval); + //DbgPrint("PHYTXON = %x, OFDMCCA_PP = %x, CCKCCA_PP = %x, RFReg00 = %x\n", + //(val&BIT25)>>25, (val&BIT14)>>14, (val&BIT15)>>15, rfval); + + //Set DCO frequency index, offset=(40MHz/SamplePts)*point + ODM_SetBBReg(pDM_Odm, 0x808, 0x3FF, point); + + //Start PSD calculation, Reg808[22]=0->1 + ODM_SetBBReg(pDM_Odm, 0x808, BIT22, 1); + //Need to wait for HW PSD report + ODM_StallExecution(1000); + ODM_SetBBReg(pDM_Odm, 0x808, BIT22, 0); + //Read PSD report, Reg8B4[15:0] + psd_report = ODM_GetBBReg(pDM_Odm,0x8B4, bMaskDWord) & 0x0000FFFF; + +#if 1//(DEV_BUS_TYPE == RT_PCI_INTERFACE) && ( (RT_PLATFORM == PLATFORM_LINUX) || (RT_PLATFORM == PLATFORM_MACOSX)) + psd_report = (u4Byte) (odm_ConvertTo_dB(psd_report))+(u4Byte)(initial_gain_psd-0x1c); +#else + psd_report = (int) (20*log10((double)psd_report))+(int)(initial_gain_psd-0x1c); +#endif + + return psd_report; + +} +#endif + +u4Byte +odm_ConvertTo_dB( + u4Byte Value) +{ + u1Byte i; + u1Byte j; + u4Byte dB; + + Value = Value & 0xFFFF; + + for (i = 0; i < 12; i++) + { + if (Value <= dB_Invert_Table[i][7]) + { + break; + } + } + + if (i >= 12) + { + return (96); // maximum 96 dB + } + + for (j = 0; j < 8; j++) + { + if (Value <= dB_Invert_Table[i][j]) + { + break; + } + } + + dB = (i << 3) + j + 1; + + return (dB); +} + +u4Byte +odm_ConvertTo_linear( + u4Byte Value) +{ + u1Byte i; + u1Byte j; + u4Byte linear; + + Value = Value & 0xFF; + + i = (u1Byte)((Value - 1) >> 3); + j = (u1Byte)(Value-1) - (i << 3); + + linear = dB_Invert_Table[i][j]; + + return (linear); +} + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) +VOID +ODM_UpdateInitRateWorkItemCallback( + IN PVOID pContext + ) +{ + PADAPTER Adapter = (PADAPTER)pContext; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; + + u1Byte p = 0; + + if(pDM_Odm->SupportICType == ODM_RTL8821) + { + ODM_TxPwrTrackSetPwr8821A(pDM_Odm, MIX_MODE, ODM_RF_PATH_A, 0); + } + else if(pDM_Odm->SupportICType == ODM_RTL8812) + { + for (p = ODM_RF_PATH_A; p < MAX_PATH_NUM_8812A; p++) //DOn't know how to include &c + { + ODM_TxPwrTrackSetPwr8812A(pDM_Odm, MIX_MODE, p, 0); + } + } + else if(pDM_Odm->SupportICType == ODM_RTL8723B) + { + ODM_TxPwrTrackSetPwr_8723B(pDM_Odm, MIX_MODE, ODM_RF_PATH_A, 0); + } + else if(pDM_Odm->SupportICType == ODM_RTL8192E) + { + for (p = ODM_RF_PATH_A; p < MAX_PATH_NUM_8192E; p++) //DOn't know how to include &c + { + ODM_TxPwrTrackSetPwr92E(pDM_Odm, MIX_MODE, p, 0); + } + } + else if(pDM_Odm->SupportICType == ODM_RTL8188E) + { + ODM_TxPwrTrackSetPwr88E(pDM_Odm, MIX_MODE, ODM_RF_PATH_A, 0); + } +} +#endif + +// +// ODM multi-port consideration, added by Roger, 2013.10.01. +// +VOID +ODM_AsocEntry_Init( + IN PDM_ODM_T pDM_Odm + ) +{ +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + PADAPTER pLoopAdapter = GetDefaultAdapter(pDM_Odm->Adapter); + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pLoopAdapter); + PDM_ODM_T pDM_OutSrc = &pHalData->DM_OutSrc; + u1Byte TotalAssocEntryNum = 0; + u1Byte index = 0; + + + ODM_CmnInfoPtrArrayHook(pDM_OutSrc, ODM_CMNINFO_STA_STATUS, 0, &pLoopAdapter->MgntInfo.DefaultPort[0]); + pLoopAdapter->MgntInfo.DefaultPort[0].MultiPortStationIdx = TotalAssocEntryNum; + + pLoopAdapter = GetNextExtAdapter(pLoopAdapter); + TotalAssocEntryNum +=1; + + while(pLoopAdapter) + { + for (index = 0; index MgntInfo.AsocEntry[index]); + pLoopAdapter->MgntInfo.AsocEntry[index].MultiPortStationIdx = TotalAssocEntryNum+index; + } + + TotalAssocEntryNum+= index; + if(IS_HARDWARE_TYPE_8188E((pDM_Odm->Adapter))) + pLoopAdapter->RASupport = TRUE; + pLoopAdapter = GetNextExtAdapter(pLoopAdapter); + } +#endif +} + +#if (DM_ODM_SUPPORT_TYPE == ODM_CE) +/* Justin: According to the current RRSI to adjust Response Frame TX power, 2012/11/05 */ +void odm_dtc(PDM_ODM_T pDM_Odm) +{ +#ifdef CONFIG_DM_RESP_TXAGC + #define DTC_BASE 35 /* RSSI higher than this value, start to decade TX power */ + #define DTC_DWN_BASE (DTC_BASE-5) /* RSSI lower than this value, start to increase TX power */ + + /* RSSI vs TX power step mapping: decade TX power */ + static const u8 dtc_table_down[]={ + DTC_BASE, + (DTC_BASE+5), + (DTC_BASE+10), + (DTC_BASE+15), + (DTC_BASE+20), + (DTC_BASE+25) + }; + + /* RSSI vs TX power step mapping: increase TX power */ + static const u8 dtc_table_up[]={ + DTC_DWN_BASE, + (DTC_DWN_BASE-5), + (DTC_DWN_BASE-10), + (DTC_DWN_BASE-15), + (DTC_DWN_BASE-15), + (DTC_DWN_BASE-20), + (DTC_DWN_BASE-20), + (DTC_DWN_BASE-25), + (DTC_DWN_BASE-25), + (DTC_DWN_BASE-30), + (DTC_DWN_BASE-35) + }; + + u8 i; + u8 dtc_steps=0; + u8 sign; + u8 resp_txagc=0; + + #if 0 + /* As DIG is disabled, DTC is also disable */ + if(!(pDM_Odm->SupportAbility & ODM_XXXXXX)) + return; + #endif + + if (DTC_BASE < pDM_Odm->RSSI_Min) { + /* need to decade the CTS TX power */ + sign = 1; + for (i=0;i= pDM_Odm->RSSI_Min) || (dtc_steps >= 6)) + break; + else + dtc_steps++; + } + } +#if 0 + else if (DTC_DWN_BASE > pDM_Odm->RSSI_Min) + { + /* needs to increase the CTS TX power */ + sign = 0; + dtc_steps = 1; + for (i=0;iRSSI_Min) || (dtc_steps>=10)) + break; + else + dtc_steps++; + } + } +#endif + else + { + sign = 0; + dtc_steps = 0; + } + + resp_txagc = dtc_steps | (sign << 4); + resp_txagc = resp_txagc | (resp_txagc << 5); + ODM_Write1Byte(pDM_Odm, 0x06d9, resp_txagc); + + DBG_871X("%s RSSI_Min:%u, set RESP_TXAGC to %s %u\n", + __func__, pDM_Odm->RSSI_Min, sign?"minus":"plus", dtc_steps); +#endif /* CONFIG_RESP_TXAGC_ADJUST */ +} + +#endif /* #if (DM_ODM_SUPPORT_TYPE == ODM_CE) */ + +VOID +odm_UpdatePowerTrainingState( + IN PDM_ODM_T pDM_Odm + ) +{ +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) + PFALSE_ALARM_STATISTICS FalseAlmCnt = (PFALSE_ALARM_STATISTICS)PhyDM_Get_Structure( pDM_Odm , PHYDM_FALSEALMCNT); + pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable; + u4Byte score = 0; + + if(!(pDM_Odm->SupportAbility & ODM_BB_PWR_TRAIN)) + return; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_RA_MASK, ODM_DBG_LOUD,("odm_UpdatePowerTrainingState()============>\n")); + pDM_Odm->bChangeState = FALSE; + + // Debug command + if(pDM_Odm->ForcePowerTrainingState) + { + if(pDM_Odm->ForcePowerTrainingState == 1 && !pDM_Odm->bDisablePowerTraining) + { + pDM_Odm->bChangeState = TRUE; + pDM_Odm->bDisablePowerTraining = TRUE; + } + else if(pDM_Odm->ForcePowerTrainingState == 2 && pDM_Odm->bDisablePowerTraining) + { + pDM_Odm->bChangeState = TRUE; + pDM_Odm->bDisablePowerTraining = FALSE; + } + + pDM_Odm->PT_score = 0; + pDM_Odm->PhyDbgInfo.NumQryPhyStatusOFDM = 0; + pDM_Odm->PhyDbgInfo.NumQryPhyStatusCCK = 0; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_RA_MASK, ODM_DBG_LOUD,("odm_UpdatePowerTrainingState(): ForcePowerTrainingState = %d\n", + pDM_Odm->ForcePowerTrainingState)); + return; + } + + if(!pDM_Odm->bLinked) + return; + + // First connect + if((pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_0 == FALSE)) + { + pDM_Odm->PT_score = 0; + pDM_Odm->bChangeState = TRUE; + pDM_Odm->PhyDbgInfo.NumQryPhyStatusOFDM = 0; + pDM_Odm->PhyDbgInfo.NumQryPhyStatusCCK = 0; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_RA_MASK, ODM_DBG_LOUD,("odm_UpdatePowerTrainingState(): First Connect\n")); + return; + } + + // Compute score + if(pDM_Odm->NHM_cnt_0 >= 215) + score = 2; + else if(pDM_Odm->NHM_cnt_0 >= 190) + score = 1; // unknow state + else + { + u4Byte RX_Pkt_Cnt; + + RX_Pkt_Cnt = (u4Byte)(pDM_Odm->PhyDbgInfo.NumQryPhyStatusOFDM) + (u4Byte)(pDM_Odm->PhyDbgInfo.NumQryPhyStatusCCK); + + if((FalseAlmCnt->Cnt_CCA_all > 31 && RX_Pkt_Cnt > 31) && (FalseAlmCnt->Cnt_CCA_all >= RX_Pkt_Cnt)) + { + if((RX_Pkt_Cnt + (RX_Pkt_Cnt >> 1)) <= FalseAlmCnt->Cnt_CCA_all) + score = 0; + else if((RX_Pkt_Cnt + (RX_Pkt_Cnt >> 2)) <= FalseAlmCnt->Cnt_CCA_all) + score = 1; + else + score = 2; + } + ODM_RT_TRACE(pDM_Odm,ODM_COMP_RA_MASK, ODM_DBG_LOUD,("odm_UpdatePowerTrainingState(): RX_Pkt_Cnt = %d, Cnt_CCA_all = %d\n", + RX_Pkt_Cnt, FalseAlmCnt->Cnt_CCA_all)); + } + ODM_RT_TRACE(pDM_Odm,ODM_COMP_RA_MASK, ODM_DBG_LOUD,("odm_UpdatePowerTrainingState(): NumQryPhyStatusOFDM = %d, NumQryPhyStatusCCK = %d\n", + (u4Byte)(pDM_Odm->PhyDbgInfo.NumQryPhyStatusOFDM), (u4Byte)(pDM_Odm->PhyDbgInfo.NumQryPhyStatusCCK))); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_RA_MASK, ODM_DBG_LOUD,("odm_UpdatePowerTrainingState(): NHM_cnt_0 = %d, score = %d\n", + pDM_Odm->NHM_cnt_0, score)); + + // smoothing + pDM_Odm->PT_score = (score << 4) + (pDM_Odm->PT_score>>1) + (pDM_Odm->PT_score>>2); + score = (pDM_Odm->PT_score + 32) >> 6; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_RA_MASK, ODM_DBG_LOUD,("odm_UpdatePowerTrainingState(): PT_score = %d, score after smoothing = %d\n", + pDM_Odm->PT_score, score)); + + // Mode decision + if(score == 2) + { + if(pDM_Odm->bDisablePowerTraining) + { + pDM_Odm->bChangeState = TRUE; + pDM_Odm->bDisablePowerTraining = FALSE; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_RA_MASK, ODM_DBG_LOUD,("odm_UpdatePowerTrainingState(): Change state\n")); + } + ODM_RT_TRACE(pDM_Odm,ODM_COMP_RA_MASK, ODM_DBG_LOUD,("odm_UpdatePowerTrainingState(): Enable Power Training\n")); + } + else if(score == 0) + { + if(!pDM_Odm->bDisablePowerTraining) + { + pDM_Odm->bChangeState = TRUE; + pDM_Odm->bDisablePowerTraining = TRUE; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_RA_MASK, ODM_DBG_LOUD,("odm_UpdatePowerTrainingState(): Change state\n")); + } + ODM_RT_TRACE(pDM_Odm,ODM_COMP_RA_MASK, ODM_DBG_LOUD,("odm_UpdatePowerTrainingState(): Disable Power Training\n")); + } + + pDM_Odm->PhyDbgInfo.NumQryPhyStatusOFDM = 0; + pDM_Odm->PhyDbgInfo.NumQryPhyStatusCCK = 0; +#endif +} + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm.h new file mode 100644 index 00000000000000..3632d851603e12 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm.h @@ -0,0 +1,1335 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + + +#ifndef __HALDMOUTSRC_H__ +#define __HALDMOUTSRC_H__ + +//============================================================ +// include files +//============================================================ +#include "phydm_pre_define.h" +#include "phydm_DIG.h" +#include "phydm_EdcaTurboCheck.h" +#include "phydm_PathDiv.h" +#include "phydm_AntDiv.h" +#include "phydm_AntDect.h" +#include "phydm_DynamicBBPowerSaving.h" +#include "phydm_RaInfo.h" +#include "phydm_DynamicTxPower.h" +#include "phydm_CfoTracking.h" +#include "phydm_ACS.h" +#include "phydm_PowerTracking.h" +#include "PhyDM_Adaptivity.h" +#include "phydm_NoiseMonitor.h" +#if(DM_ODM_SUPPORT_TYPE & (ODM_WIN)) +#include "phydm_RXHP.h" +#endif + +//============================================================ +// Definition +//============================================================ +// +// 2011/09/22 MH Define all team supprt ability. +// + +// +// 2011/09/22 MH Define for all teams. Please Define the constan in your precomp header. +// +//#define DM_ODM_SUPPORT_AP 0 +//#define DM_ODM_SUPPORT_ADSL 0 +//#define DM_ODM_SUPPORT_CE 0 +//#define DM_ODM_SUPPORT_MP 1 + +// +// 2011/09/28 MH Define ODM SW team support flag. +// + + +//For SW AntDiv, PathDiv, 8192C AntDiv joint use +#define TP_MODE 0 +#define RSSI_MODE 1 + +#define TRAFFIC_LOW 0 +#define TRAFFIC_HIGH 1 +#define TRAFFIC_UltraLOW 2 + +#define NONE 0 + + + + +//8723A High Power IGI Setting +#define DM_DIG_HIGH_PWR_IGI_LOWER_BOUND 0x22 +#define DM_DIG_Gmode_HIGH_PWR_IGI_LOWER_BOUND 0x28 +#define DM_DIG_HIGH_PWR_THRESHOLD 0x3a +#define DM_DIG_LOW_PWR_THRESHOLD 0x14 + + +//============================================================ +// structure and define +//============================================================ + +// +// 2011/09/20 MH Add for AP/ADSLpseudo DM structuer requirement. +// We need to remove to other position??? +// +#if(DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_WIN)) +typedef struct rtl8192cd_priv { + u1Byte temp; + +}rtl8192cd_priv, *prtl8192cd_priv; +#endif + + +#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) +typedef struct _ADAPTER{ + u1Byte temp; + #ifdef AP_BUILD_WORKAROUND + HAL_DATA_TYPE* temp2; + prtl8192cd_priv priv; + #endif +}ADAPTER, *PADAPTER; +#endif + +#if (DM_ODM_SUPPORT_TYPE == ODM_AP) + +typedef struct _WLAN_STA{ + u1Byte temp; +} WLAN_STA, *PRT_WLAN_STA; + +#endif + +typedef struct _Dynamic_Primary_CCA{ + u1Byte PriCCA_flag; + u1Byte intf_flag; + u1Byte intf_type; + u1Byte DupRTS_flag; + u1Byte Monitor_flag; + u1Byte CH_offset; + u1Byte MF_state; +}Pri_CCA_T, *pPri_CCA_T; + + +#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) + + +#ifdef ADSL_AP_BUILD_WORKAROUND +#define MAX_TOLERANCE 5 +#define IQK_DELAY_TIME 1 //ms +#endif +#if 0//defined in 8192cd.h +// +// Indicate different AP vendor for IOT issue. +// +typedef enum _HT_IOT_PEER +{ + HT_IOT_PEER_UNKNOWN = 0, + HT_IOT_PEER_REALTEK = 1, + HT_IOT_PEER_REALTEK_92SE = 2, + HT_IOT_PEER_BROADCOM = 3, + HT_IOT_PEER_RALINK = 4, + HT_IOT_PEER_ATHEROS = 5, + HT_IOT_PEER_CISCO = 6, + HT_IOT_PEER_MERU = 7, + HT_IOT_PEER_MARVELL = 8, + HT_IOT_PEER_REALTEK_SOFTAP = 9,// peer is RealTek SOFT_AP, by Bohn, 2009.12.17 + HT_IOT_PEER_SELF_SOFTAP = 10, // Self is SoftAP + HT_IOT_PEER_AIRGO = 11, + HT_IOT_PEER_INTEL = 12, + HT_IOT_PEER_RTK_APCLIENT = 13, + HT_IOT_PEER_REALTEK_81XX = 14, + HT_IOT_PEER_REALTEK_WOW = 15, + HT_IOT_PEER_MAX = 16 +}HT_IOT_PEER_E, *PHTIOT_PEER_E; +#endif +#endif//#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) + + +#define DM_Type_ByFW 0 +#define DM_Type_ByDriver 1 + +// +// Declare for common info +// + +#define IQK_THRESHOLD 8 +#define DPK_THRESHOLD 4 + + +#if (DM_ODM_SUPPORT_TYPE & (ODM_AP)) +typedef struct _ODM_Phy_Status_Info_ +{ + u1Byte RxPWDBAll; + u1Byte SignalQuality; // in 0-100 index. + u1Byte RxMIMOSignalStrength[4];// in 0~100 index + s1Byte RxMIMOSignalQuality[4]; //EVM + u1Byte RxSNR[4];//per-path's SNR + u1Byte BandWidth; + +}ODM_PHY_INFO_T,*PODM_PHY_INFO_T; + +typedef struct _ODM_Phy_Status_Info_Append_ +{ + u1Byte MAC_CRC32; + +}ODM_PHY_INFO_Append_T,*PODM_PHY_INFO_Append_T; + +#else + +typedef struct _ODM_Phy_Status_Info_ +{ + // + // Be care, if you want to add any element please insert between + // RxPWDBAll & SignalStrength. + // +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN)) + u4Byte RxPWDBAll; +#else + u1Byte RxPWDBAll; +#endif + u1Byte SignalQuality; // in 0-100 index. + s1Byte RxMIMOSignalQuality[4]; //per-path's EVM + u1Byte RxMIMOEVMdbm[4]; //per-path's EVM dbm + + u1Byte RxMIMOSignalStrength[4];// in 0~100 index + + u2Byte Cfo_short[4]; // per-path's Cfo_short + u2Byte Cfo_tail[4]; // per-path's Cfo_tail + +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) + s1Byte RxPower; // in dBm Translate from PWdB + s1Byte RecvSignalPower; // Real power in dBm for this packet, no beautification and aggregation. Keep this raw info to be used for the other procedures. + u1Byte BTRxRSSIPercentage; + u1Byte SignalStrength; // in 0-100 index. + + s1Byte RxPwr[4]; //per-path's pwdb +#endif + u1Byte RxSNR[4]; //per-path's SNR + u1Byte BandWidth; + u1Byte btCoexPwrAdjust; +}ODM_PHY_INFO_T,*PODM_PHY_INFO_T; +#endif + +typedef struct _ODM_Per_Pkt_Info_ +{ + //u1Byte Rate; + u1Byte DataRate; + u1Byte StationID; + BOOLEAN bPacketMatchBSSID; + BOOLEAN bPacketToSelf; + BOOLEAN bPacketBeacon; + BOOLEAN bToSelf; +}ODM_PACKET_INFO_T,*PODM_PACKET_INFO_T; + + +typedef struct _ODM_Phy_Dbg_Info_ +{ + //ODM Write,debug info + s1Byte RxSNRdB[4]; + u4Byte NumQryPhyStatus; + u4Byte NumQryPhyStatusCCK; + u4Byte NumQryPhyStatusOFDM; + u1Byte NumQryBeaconPkt; + //Others + s4Byte RxEVM[4]; + +}ODM_PHY_DBG_INFO_T; + + +typedef struct _ODM_Mac_Status_Info_ +{ + u1Byte test; + +}ODM_MAC_INFO; + +// +// 2011/20/20 MH For MP driver RT_WLAN_STA = STA_INFO_T +// Please declare below ODM relative info in your STA info structure. +// +#if 1 +typedef struct _ODM_STA_INFO{ + // Driver Write + BOOLEAN bUsed; // record the sta status link or not? + //u1Byte WirelessMode; // + u1Byte IOTPeer; // Enum value. HT_IOT_PEER_E + + // ODM Write + //1 PHY_STATUS_INFO + u1Byte RSSI_Path[4]; // + u1Byte RSSI_Ave; + u1Byte RXEVM[4]; + u1Byte RXSNR[4]; + + // ODM Write + //1 TX_INFO (may changed by IC) + //TX_INFO_T pTxInfo; // Define in IC folder. Move lower layer. +#if 0 + u1Byte ANTSEL_A; //in Jagar: 4bit; others: 2bit + u1Byte ANTSEL_B; //in Jagar: 4bit; others: 2bit + u1Byte ANTSEL_C; //only in Jagar: 4bit + u1Byte ANTSEL_D; //only in Jagar: 4bit + u1Byte TX_ANTL; //not in Jagar: 2bit + u1Byte TX_ANT_HT; //not in Jagar: 2bit + u1Byte TX_ANT_CCK; //not in Jagar: 2bit + u1Byte TXAGC_A; //not in Jagar: 4bit + u1Byte TXAGC_B; //not in Jagar: 4bit + u1Byte TXPWR_OFFSET; //only in Jagar: 3bit + u1Byte TX_ANT; //only in Jagar: 4bit for TX_ANTL/TX_ANTHT/TX_ANT_CCK +#endif + + // + // Please use compile flag to disabe the strcutrue for other IC except 88E. + // Move To lower layer. + // + // ODM Write Wilson will handle this part(said by Luke.Lee) + //TX_RPT_T pTxRpt; // Define in IC folder. Move lower layer. +#if 0 + //1 For 88E RA (don't redefine the naming) + u1Byte rate_id; + u1Byte rate_SGI; + u1Byte rssi_sta_ra; + u1Byte SGI_enable; + u1Byte Decision_rate; + u1Byte Pre_rate; + u1Byte Active; + + // Driver write Wilson handle. + //1 TX_RPT (don't redefine the naming) + u2Byte RTY[4]; // ??? + u2Byte TOTAL; // ??? + u2Byte DROP; // ??? + // + // Please use compile flag to disabe the strcutrue for other IC except 88E. + // +#endif + +}ODM_STA_INFO_T, *PODM_STA_INFO_T; +#endif + +// +// 2011/10/20 MH Define Common info enum for all team. +// +typedef enum _ODM_Common_Info_Definition +{ +//-------------REMOVED CASE-----------// + //ODM_CMNINFO_CCK_HP, + //ODM_CMNINFO_RFPATH_ENABLE, // Define as ODM write??? + //ODM_CMNINFO_BT_COEXIST, // ODM_BT_COEXIST_E + //ODM_CMNINFO_OP_MODE, // ODM_OPERATION_MODE_E +//-------------REMOVED CASE-----------// + + // + // Fixed value: + // + + //-----------HOOK BEFORE REG INIT-----------// + ODM_CMNINFO_PLATFORM = 0, + ODM_CMNINFO_ABILITY, // ODM_ABILITY_E + ODM_CMNINFO_INTERFACE, // ODM_INTERFACE_E + ODM_CMNINFO_MP_TEST_CHIP, + ODM_CMNINFO_IC_TYPE, // ODM_IC_TYPE_E + ODM_CMNINFO_CUT_VER, // ODM_CUT_VERSION_E + ODM_CMNINFO_FAB_VER, // ODM_FAB_E + ODM_CMNINFO_RF_TYPE, // ODM_RF_PATH_E or ODM_RF_TYPE_E? + ODM_CMNINFO_RFE_TYPE, + ODM_CMNINFO_BOARD_TYPE, // ODM_BOARD_TYPE_E + ODM_CMNINFO_PACKAGE_TYPE, + ODM_CMNINFO_EXT_LNA, // TRUE + ODM_CMNINFO_5G_EXT_LNA, + ODM_CMNINFO_EXT_PA, + ODM_CMNINFO_5G_EXT_PA, + ODM_CMNINFO_GPA, + ODM_CMNINFO_APA, + ODM_CMNINFO_GLNA, + ODM_CMNINFO_ALNA, + ODM_CMNINFO_EXT_TRSW, + ODM_CMNINFO_PATCH_ID, //CUSTOMER ID + ODM_CMNINFO_BINHCT_TEST, + ODM_CMNINFO_BWIFI_TEST, + ODM_CMNINFO_SMART_CONCURRENT, + ODM_CMNINFO_CONFIG_BB_RF, + ODM_CMNINFO_DOMAIN_CODE_2G, + ODM_CMNINFO_DOMAIN_CODE_5G, + ODM_CMNINFO_IQKFWOFFLOAD, + //-----------HOOK BEFORE REG INIT-----------// + + + // + // Dynamic value: + // +//--------- POINTER REFERENCE-----------// + ODM_CMNINFO_MAC_PHY_MODE, // ODM_MAC_PHY_MODE_E + ODM_CMNINFO_TX_UNI, + ODM_CMNINFO_RX_UNI, + ODM_CMNINFO_WM_MODE, // ODM_WIRELESS_MODE_E + ODM_CMNINFO_BAND, // ODM_BAND_TYPE_E + ODM_CMNINFO_SEC_CHNL_OFFSET, // ODM_SEC_CHNL_OFFSET_E + ODM_CMNINFO_SEC_MODE, // ODM_SECURITY_E + ODM_CMNINFO_BW, // ODM_BW_E + ODM_CMNINFO_CHNL, + ODM_CMNINFO_FORCED_RATE, + + ODM_CMNINFO_DMSP_GET_VALUE, + ODM_CMNINFO_BUDDY_ADAPTOR, + ODM_CMNINFO_DMSP_IS_MASTER, + ODM_CMNINFO_SCAN, + ODM_CMNINFO_POWER_SAVING, + ODM_CMNINFO_ONE_PATH_CCA, // ODM_CCA_PATH_E + ODM_CMNINFO_DRV_STOP, + ODM_CMNINFO_PNP_IN, + ODM_CMNINFO_INIT_ON, + ODM_CMNINFO_ANT_TEST, + ODM_CMNINFO_NET_CLOSED, + //ODM_CMNINFO_RTSTA_AID, // For win driver only? + ODM_CMNINFO_FORCED_IGI_LB, + ODM_CMNINFO_P2P_LINK, + ODM_CMNINFO_FCS_MODE, + ODM_CMNINFO_IS1ANTENNA, + ODM_CMNINFO_RFDEFAULTPATH, +//--------- POINTER REFERENCE-----------// + +//------------CALL BY VALUE-------------// + ODM_CMNINFO_WIFI_DIRECT, + ODM_CMNINFO_WIFI_DISPLAY, + ODM_CMNINFO_LINK_IN_PROGRESS, + ODM_CMNINFO_LINK, + ODM_CMNINFO_STATION_STATE, + ODM_CMNINFO_RSSI_MIN, + ODM_CMNINFO_DBG_COMP, // u8Byte + ODM_CMNINFO_DBG_LEVEL, // u4Byte + ODM_CMNINFO_RA_THRESHOLD_HIGH, // u1Byte + ODM_CMNINFO_RA_THRESHOLD_LOW, // u1Byte + ODM_CMNINFO_RF_ANTENNA_TYPE, // u1Byte + ODM_CMNINFO_BT_ENABLED, + ODM_CMNINFO_BT_HS_CONNECT_PROCESS, + ODM_CMNINFO_BT_HS_RSSI, + ODM_CMNINFO_BT_OPERATION, + ODM_CMNINFO_BT_LIMITED_DIG, //Need to Limited Dig or not + ODM_CMNINFO_BT_DIG, + ODM_CMNINFO_BT_BUSY, //Check Bt is using or not//neil + ODM_CMNINFO_BT_DISABLE_EDCA, +#if(DM_ODM_SUPPORT_TYPE & ODM_AP) // for repeater mode add by YuChen 2014.06.23 +#ifdef UNIVERSAL_REPEATER + ODM_CMNINFO_VXD_LINK, +#endif +#endif + +//------------CALL BY VALUE-------------// + + // + // Dynamic ptr array hook itms. + // + ODM_CMNINFO_STA_STATUS, + ODM_CMNINFO_PHY_STATUS, + ODM_CMNINFO_MAC_STATUS, + + ODM_CMNINFO_MAX, + + +}ODM_CMNINFO_E; + +// +// 2011/10/20 MH Define ODM support ability. ODM_CMNINFO_ABILITY +// +typedef enum _ODM_Support_Ability_Definition +{ + // + // BB ODM section BIT 0-19 + // + ODM_BB_DIG = BIT0, + ODM_BB_RA_MASK = BIT1, + ODM_BB_DYNAMIC_TXPWR = BIT2, + ODM_BB_FA_CNT = BIT3, + ODM_BB_RSSI_MONITOR = BIT4, + ODM_BB_CCK_PD = BIT5, + ODM_BB_ANT_DIV = BIT6, + ODM_BB_PWR_SAVE = BIT7, + ODM_BB_PWR_TRAIN = BIT8, + ODM_BB_RATE_ADAPTIVE = BIT9, + ODM_BB_PATH_DIV = BIT10, + ODM_BB_PSD = BIT11, + ODM_BB_RXHP = BIT12, + ODM_BB_ADAPTIVITY = BIT13, + ODM_BB_CFO_TRACKING = BIT14, + ODM_BB_NHM_CNT = BIT15, + ODM_BB_PRIMARY_CCA = BIT16, + + // + // MAC DM section BIT 20-23 + // + ODM_MAC_EDCA_TURBO = BIT20, + ODM_MAC_EARLY_MODE = BIT21, + + // + // RF ODM section BIT 24-31 + // + ODM_RF_TX_PWR_TRACK = BIT24, + ODM_RF_RX_GAIN_TRACK = BIT25, + ODM_RF_CALIBRATION = BIT26, + +}ODM_ABILITY_E; + +//Move some non-DM enum,define, struc. form phydm.h to phydm_types.h by Dino + +// ODM_CMNINFO_ONE_PATH_CCA +typedef enum tag_CCA_Path +{ + ODM_CCA_2R = 0, + ODM_CCA_1R_A = 1, + ODM_CCA_1R_B = 2, +}ODM_CCA_PATH_E; + +//move RAInfo to Phydm_RaInfo.h + +//Remove struct PATHDIV_PARA to odm_PathDiv.h + +//Remove struct to odm_PowerTracking.h by YuChen +// +// ODM Dynamic common info value definition +// +//Move AntDiv form phydm.h to Phydm_AntDiv.h by Dino + +//move PathDiv to Phydm_PathDiv.h + +typedef enum _BASEBAND_CONFIG_PHY_REG_PG_VALUE_TYPE{ + PHY_REG_PG_RELATIVE_VALUE = 0, + PHY_REG_PG_EXACT_VALUE = 1 +} PHY_REG_PG_TYPE; + +// +// 2011/09/22 MH Copy from SD4 defined structure. We use to support PHY DM integration. +// +#if(DM_ODM_SUPPORT_TYPE & ODM_WIN) +#if (RT_PLATFORM != PLATFORM_LINUX) +typedef +#endif + +struct DM_Out_Source_Dynamic_Mechanism_Structure +#else// for AP,ADSL,CE Team +typedef struct DM_Out_Source_Dynamic_Mechanism_Structure +#endif +{ + //RT_TIMER FastAntTrainingTimer; + // + // Add for different team use temporarily + // + PADAPTER Adapter; // For CE/NIC team + prtl8192cd_priv priv; // For AP/ADSL team + // WHen you use Adapter or priv pointer, you must make sure the pointer is ready. + BOOLEAN odm_ready; + +#if(DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_WIN)) + rtl8192cd_priv fake_priv; +#endif +#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) + // ADSL_AP_BUILD_WORKAROUND + ADAPTER fake_adapter; +#endif + + PHY_REG_PG_TYPE PhyRegPgValueType; + u1Byte PhyRegPgVersion; + + u8Byte DebugComponents; + u4Byte DebugLevel; + + u4Byte NumQryPhyStatusAll; //CCK + OFDM + u4Byte LastNumQryPhyStatusAll; + u4Byte RxPWDBAve; + BOOLEAN MPDIG_2G; //off MPDIG + u1Byte Times_2G; + +//------ ODM HANDLE, DRIVER NEEDS NOT TO HOOK------// + BOOLEAN bCckHighPower; + u1Byte RFPathRxEnable; // ODM_CMNINFO_RFPATH_ENABLE + u1Byte ControlChannel; +//------ ODM HANDLE, DRIVER NEEDS NOT TO HOOK------// + +//--------REMOVED COMMON INFO----------// + //u1Byte PseudoMacPhyMode; + //BOOLEAN *BTCoexist; + //BOOLEAN PseudoBtCoexist; + //u1Byte OPMode; + //BOOLEAN bAPMode; + //BOOLEAN bClientMode; + //BOOLEAN bAdHocMode; + //BOOLEAN bSlaveOfDMSP; +//--------REMOVED COMMON INFO----------// + + +//1 COMMON INFORMATION + + // + // Init Value + // +//-----------HOOK BEFORE REG INIT-----------// + // ODM Platform info AP/ADSL/CE/MP = 1/2/3/4 + u1Byte SupportPlatform; + // ODM Support Ability DIG/RATR/TX_PWR_TRACK/ KK = 1/2/3/K + u4Byte SupportAbility; + // ODM PCIE/USB/SDIO = 1/2/3 + u1Byte SupportInterface; + // ODM composite or independent. Bit oriented/ 92C+92D+ .... or any other type = 1/2/3/... + u4Byte SupportICType; + // Cut Version TestChip/A-cut/B-cut... = 0/1/2/3/... + u1Byte CutVersion; + // Fab Version TSMC/UMC = 0/1 + u1Byte FabVersion; + // RF Type 4T4R/3T3R/2T2R/1T2R/1T1R/... + u1Byte RFType; + u1Byte RFEType; + // Board Type Normal/HighPower/MiniCard/SLIM/Combo/... = 0/1/2/3/4/... + u1Byte BoardType; + u1Byte PackageType; + u1Byte TypeGLNA; + u1Byte TypeGPA; + u1Byte TypeALNA; + u1Byte TypeAPA; + // with external LNA NO/Yes = 0/1 + u1Byte ExtLNA; // 2G + u1Byte ExtLNA5G; //5G + // with external PA NO/Yes = 0/1 + u1Byte ExtPA; // 2G + u1Byte ExtPA5G; //5G + // with external TRSW NO/Yes = 0/1 + u1Byte ExtTRSW; + u1Byte PatchID; //Customer ID + BOOLEAN bInHctTest; + BOOLEAN bWIFITest; + + BOOLEAN bDualMacSmartConcurrent; + u4Byte BK_SupportAbility; + u1Byte AntDivType; + BOOLEAN ConfigBBRF; + u1Byte odm_Regulation2_4G; + u1Byte odm_Regulation5G; + u1Byte IQKFWOffload; +//-----------HOOK BEFORE REG INIT-----------// + + // + // Dynamic Value + // +//--------- POINTER REFERENCE-----------// + + u1Byte u1Byte_temp; + BOOLEAN BOOLEAN_temp; + PADAPTER PADAPTER_temp; + + // MAC PHY Mode SMSP/DMSP/DMDP = 0/1/2 + u1Byte *pMacPhyMode; + //TX Unicast byte count + u8Byte *pNumTxBytesUnicast; + //RX Unicast byte count + u8Byte *pNumRxBytesUnicast; + // Wireless mode B/G/A/N = BIT0/BIT1/BIT2/BIT3 + u1Byte *pWirelessMode; //ODM_WIRELESS_MODE_E + // Frequence band 2.4G/5G = 0/1 + u1Byte *pBandType; + // Secondary channel offset don't_care/below/above = 0/1/2 + u1Byte *pSecChOffset; + // Security mode Open/WEP/AES/TKIP = 0/1/2/3 + u1Byte *pSecurity; + // BW info 20M/40M/80M = 0/1/2 + u1Byte *pBandWidth; + // Central channel location Ch1/Ch2/.... + u1Byte *pChannel; //central channel number + BOOLEAN DPK_Done; + // Common info for 92D DMSP + + BOOLEAN *pbGetValueFromOtherMac; + PADAPTER *pBuddyAdapter; + BOOLEAN *pbMasterOfDMSP; //MAC0: master, MAC1: slave + // Common info for Status + BOOLEAN *pbScanInProcess; + BOOLEAN *pbPowerSaving; + // CCA Path 2-path/path-A/path-B = 0/1/2; using ODM_CCA_PATH_E. + u1Byte *pOnePathCCA; + //pMgntInfo->AntennaTest + u1Byte *pAntennaTest; + BOOLEAN *pbNet_closed; + //u1Byte *pAidMap; + u1Byte *pu1ForcedIgiLb; + BOOLEAN *pIsFcsModeEnable; +//--------- For 8723B IQK-----------// + BOOLEAN *pIs1Antenna; + u1Byte *pRFDefaultPath; + // 0:S1, 1:S0 + +//--------- POINTER REFERENCE-----------// + pu2Byte pForcedDataRate; +//------------CALL BY VALUE-------------// + BOOLEAN bLinkInProcess; + BOOLEAN bWIFI_Direct; + BOOLEAN bWIFI_Display; + BOOLEAN bLinked; + BOOLEAN bsta_state; +#if(DM_ODM_SUPPORT_TYPE & ODM_AP) // for repeater mode add by YuChen 2014.06.23 +#ifdef UNIVERSAL_REPEATER + BOOLEAN VXD_bLinked; +#endif +#endif // for repeater mode add by YuChen 2014.06.23 + u1Byte RSSI_Min; + u1Byte InterfaceIndex; // Add for 92D dual MAC: 0--Mac0 1--Mac1 + BOOLEAN bIsMPChip; + BOOLEAN bOneEntryOnly; + BOOLEAN mp_mode; + u4Byte OneEntry_MACID; + // Common info for BTDM + BOOLEAN bBtEnabled; // BT is enabled + BOOLEAN bBtConnectProcess; // BT HS is under connection progress. + u1Byte btHsRssi; // BT HS mode wifi rssi value. + BOOLEAN bBtHsOperation; // BT HS mode is under progress + u1Byte btHsDigVal; // use BT rssi to decide the DIG value + BOOLEAN bBtDisableEdcaTurbo; // Under some condition, don't enable the EDCA Turbo + BOOLEAN bBtBusy; // BT is busy. + BOOLEAN bBtLimitedDig; // BT is busy. +//------------CALL BY VALUE-------------// + u1Byte RSSI_A; + u1Byte RSSI_B; + u1Byte RSSI_C; + u1Byte RSSI_D; + u8Byte RSSI_TRSW; + u8Byte RSSI_TRSW_H; + u8Byte RSSI_TRSW_L; + u8Byte RSSI_TRSW_iso; + + u1Byte RxRate; + BOOLEAN bNoisyState; + u1Byte TxRate; + u1Byte LinkedInterval; + u1Byte preChannel; + u4Byte TxagcOffsetValueA; + BOOLEAN IsTxagcOffsetPositiveA; + u4Byte TxagcOffsetValueB; + BOOLEAN IsTxagcOffsetPositiveB; + u8Byte lastTxOkCnt; + u8Byte lastRxOkCnt; + u4Byte BbSwingOffsetA; + BOOLEAN IsBbSwingOffsetPositiveA; + u4Byte BbSwingOffsetB; + BOOLEAN IsBbSwingOffsetPositiveB; + u1Byte antdiv_rssi; + u1Byte fat_comb_a; + u1Byte fat_comb_b; + u1Byte antdiv_intvl; + u1Byte AntType; + u1Byte pre_AntType; + u1Byte antdiv_period; + u1Byte antdiv_select; + u1Byte path_select; + u1Byte antdiv_evm_en; + u1Byte bdc_holdstate; + u1Byte NdpaPeriod; + BOOLEAN H2C_RARpt_connect; + + u1Byte dm_dig_max_TH; + u1Byte dm_dig_min_TH; + u1Byte print_agc; + + //For Adaptivtiy + s1Byte TH_L2H_ini; + s1Byte TH_L2H_ini_mode2; + s1Byte TH_L2H_ini_backup; + s1Byte TH_EDCCA_HL_diff; + s1Byte TH_EDCCA_HL_diff_mode2; + s1Byte TH_EDCCA_HL_diff_backup; + s1Byte IGI_Base; + u1Byte IGI_target; + u4Byte FABound; + BOOLEAN adaptivity_flag; + u1Byte NHMWait; + s1Byte H2L_lb; + s1Byte L2H_lb; + u1Byte Adaptivity_IGI_upper; + u2Byte NHM_cnt_0; + u2Byte NHM_cnt_1; + BOOLEAN Carrier_Sense_enable; + BOOLEAN bFirstLink; + BOOLEAN bCheck; + BOOLEAN DynamicLinkAdaptivity; + BOOLEAN Adaptivity_enable; + //For Adaptivtiy +#if (DM_ODM_SUPPORT_TYPE & (ODM_CE)) + ODM_NOISE_MONITOR noise_level;//[ODM_MAX_CHANNEL_NUM]; +#endif + // + //2 Define STA info. + // _ODM_STA_INFO + // 2012/01/12 MH For MP, we need to reduce one array pointer for default port.?? + PSTA_INFO_T pODM_StaInfo[ODM_ASSOCIATE_ENTRY_NUM]; + +#if (RATE_ADAPTIVE_SUPPORT == 1) + u2Byte CurrminRptTime; + ODM_RA_INFO_T RAInfo[ODM_ASSOCIATE_ENTRY_NUM]; //Use MacID as array index. STA MacID=0, VWiFi Client MacID={1, ODM_ASSOCIATE_ENTRY_NUM-1} //YJ,add,120119 +#endif + // + // 2012/02/14 MH Add to share 88E ra with other SW team. + // We need to colelct all support abilit to a proper area. + // + BOOLEAN RaSupport88E; + + // Define ........... + + // Latest packet phy info (ODM write) + ODM_PHY_DBG_INFO_T PhyDbgInfo; + //PHY_INFO_88E PhyInfo; + + // Latest packet phy info (ODM write) + ODM_MAC_INFO *pMacInfo; + //MAC_INFO_88E MacInfo; + + // Different Team independt structure?? + + // + //TX_RTP_CMN TX_retrpo; + //TX_RTP_88E TX_retrpo; + //TX_RTP_8195 TX_retrpo; + + // + //ODM Structure + // + #if (defined(CONFIG_HW_ANTENNA_DIVERSITY)) + #if (DM_ODM_SUPPORT_TYPE & (ODM_AP)) + BDC_T DM_BdcTable; + #endif + #endif + FAT_T DM_FatTable; + DIG_T DM_DigTable; + PS_T DM_PSTable; + Pri_CCA_T DM_PriCCA; +#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) + RXHP_T DM_RXHP_Table; +#endif + RA_T DM_RA_Table; + FALSE_ALARM_STATISTICS FalseAlmCnt; + FALSE_ALARM_STATISTICS FlaseAlmCntBuddyAdapter; + //#ifdef CONFIG_ANTENNA_DIVERSITY + SWAT_T DM_SWAT_Table; + BOOLEAN RSSI_test; + CFO_TRACKING DM_CfoTrack; + ACS DM_ACS; + //#endif + +#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) + //Path Div Struct + PATHDIV_PARA pathIQK; +#endif +#if(defined(CONFIG_PATH_DIVERSITY)) + PATHDIV_T DM_PathDiv; +#endif + + EDCA_T DM_EDCA_Table; + u4Byte WMMEDCA_BE; + + // Copy from SD4 structure + // + // ================================================== + // + + //common + //u1Byte DM_Type; + //u1Byte PSD_Report_RXHP[80]; // Add By Gary + //u1Byte PSD_func_flag; // Add By Gary + //for DIG + //u1Byte bDMInitialGainEnable; + //u1Byte binitialized; // for dm_initial_gain_Multi_STA use. + //for Antenna diversity + //u8 AntDivCfg;// 0:OFF , 1:ON, 2:by efuse + //PSTA_INFO_T RSSI_target; + + BOOLEAN *pbDriverStopped; + BOOLEAN *pbDriverIsGoingToPnpSetPowerSleep; + BOOLEAN *pinit_adpt_in_progress; + + //PSD + BOOLEAN bUserAssignLevel; + RT_TIMER PSDTimer; + u1Byte RSSI_BT; //come from BT + BOOLEAN bPSDinProcess; + BOOLEAN bPSDactive; + BOOLEAN bDMInitialGainEnable; + + //MPT DIG + RT_TIMER MPT_DIGTimer; + + //for rate adaptive, in fact, 88c/92c fw will handle this + u1Byte bUseRAMask; + + ODM_RATE_ADAPTIVE RateAdaptive; +//#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN | ODM_CE)) +#if(defined(CONFIG_ANT_DETECTION)) + ANT_DETECTED_INFO AntDetectedInfo; // Antenna detected information for RSSI tool +#endif + ODM_RF_CAL_T RFCalibrateInfo; + + // + // TX power tracking + // + u1Byte BbSwingIdxOfdm[MAX_RF_PATH]; + u1Byte BbSwingIdxOfdmCurrent; + u1Byte BbSwingIdxOfdmBase[MAX_RF_PATH]; + BOOLEAN BbSwingFlagOfdm; + u1Byte BbSwingIdxCck; + u1Byte BbSwingIdxCckCurrent; + u1Byte BbSwingIdxCckBase; + u1Byte DefaultOfdmIndex; + u1Byte DefaultCckIndex; + BOOLEAN BbSwingFlagCck; + + s1Byte Absolute_OFDMSwingIdx[MAX_RF_PATH]; + s1Byte Remnant_OFDMSwingIdx[MAX_RF_PATH]; + s1Byte Remnant_CCKSwingIdx; + s1Byte Modify_TxAGC_Value; //Remnat compensate value at TxAGC + BOOLEAN Modify_TxAGC_Flag_PathA; + BOOLEAN Modify_TxAGC_Flag_PathB; + BOOLEAN Modify_TxAGC_Flag_PathC; + BOOLEAN Modify_TxAGC_Flag_PathD; + BOOLEAN Modify_TxAGC_Flag_PathA_CCK; + + s1Byte KfreeOffset[MAX_RF_PATH]; + + // + // Dynamic ATC switch + // + +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) + // + // Power Training + // + BOOLEAN bDisablePowerTraining; + u1Byte ForcePowerTrainingState; + BOOLEAN bChangeState; + u4Byte PT_score; + u8Byte OFDM_RX_Cnt; + u8Byte CCK_RX_Cnt; +#endif + + // + // ODM system resource. + // + + // ODM relative time. + RT_TIMER PathDivSwitchTimer; + //2011.09.27 add for Path Diversity + RT_TIMER CCKPathDiversityTimer; + RT_TIMER FastAntTrainingTimer; +#ifdef ODM_EVM_ENHANCE_ANTDIV + RT_TIMER EVM_FastAntTrainingTimer; +#endif + RT_TIMER sbdcnt_timer; + + // ODM relative workitem. +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + #if USE_WORKITEM + RT_WORK_ITEM PathDivSwitchWorkitem; + RT_WORK_ITEM CCKPathDiversityWorkitem; + RT_WORK_ITEM FastAntTrainingWorkitem; + RT_WORK_ITEM MPT_DIGWorkitem; + RT_WORK_ITEM RaRptWorkitem; + RT_WORK_ITEM sbdcnt_workitem; + #endif +#endif + + #if (BEAMFORMING_SUPPORT == 1) + RT_BEAMFORMING_INFO BeamformingInfo; + #endif + +#if(DM_ODM_SUPPORT_TYPE & ODM_WIN) + +#if (RT_PLATFORM != PLATFORM_LINUX) +} DM_ODM_T, *PDM_ODM_T; // DM_Dynamic_Mechanism_Structure +#else +}; +#endif + +#else// for AP,ADSL,CE Team +} DM_ODM_T, *PDM_ODM_T; // DM_Dynamic_Mechanism_Structure +#endif + + +typedef enum _PHYDM_STRUCTURE_TYPE{ + PHYDM_FALSEALMCNT, + PHYDM_CFOTRACK, + PHYDM_ROMINFO, + +}PHYDM_STRUCTURE_TYPE; + + + + typedef enum _ODM_RF_CONTENT{ + odm_radioa_txt = 0x1000, + odm_radiob_txt = 0x1001, + odm_radioc_txt = 0x1002, + odm_radiod_txt = 0x1003 +} ODM_RF_CONTENT; + +typedef enum _ODM_BB_Config_Type{ + CONFIG_BB_PHY_REG, + CONFIG_BB_AGC_TAB, + CONFIG_BB_AGC_TAB_2G, + CONFIG_BB_AGC_TAB_5G, + CONFIG_BB_PHY_REG_PG, + CONFIG_BB_PHY_REG_MP, + CONFIG_BB_AGC_TAB_DIFF, +} ODM_BB_Config_Type, *PODM_BB_Config_Type; + +typedef enum _ODM_RF_Config_Type{ + CONFIG_RF_RADIO, + CONFIG_RF_TXPWR_LMT, +} ODM_RF_Config_Type, *PODM_RF_Config_Type; + +typedef enum _ODM_FW_Config_Type{ + CONFIG_FW_NIC, + CONFIG_FW_NIC_2, + CONFIG_FW_AP, + CONFIG_FW_MP, + CONFIG_FW_WoWLAN, + CONFIG_FW_WoWLAN_2, + CONFIG_FW_AP_WoWLAN, + CONFIG_FW_BT, +} ODM_FW_Config_Type; + +// Status code +#if (DM_ODM_SUPPORT_TYPE != ODM_WIN) +typedef enum _RT_STATUS{ + RT_STATUS_SUCCESS, + RT_STATUS_FAILURE, + RT_STATUS_PENDING, + RT_STATUS_RESOURCE, + RT_STATUS_INVALID_CONTEXT, + RT_STATUS_INVALID_PARAMETER, + RT_STATUS_NOT_SUPPORT, + RT_STATUS_OS_API_FAILED, +}RT_STATUS,*PRT_STATUS; +#endif // end of RT_STATUS definition + +#ifdef REMOVE_PACK +#pragma pack() +#endif + +//#include "odm_function.h" + +//3=========================================================== +//3 DIG +//3=========================================================== + +//Remove DIG by Yuchen + +//3=========================================================== +//3 AGC RX High Power Mode +//3=========================================================== +#define LNA_Low_Gain_1 0x64 +#define LNA_Low_Gain_2 0x5A +#define LNA_Low_Gain_3 0x58 + +#define FA_RXHP_TH1 5000 +#define FA_RXHP_TH2 1500 +#define FA_RXHP_TH3 800 +#define FA_RXHP_TH4 600 +#define FA_RXHP_TH5 500 + +//3=========================================================== +//3 EDCA +//3=========================================================== + +//3=========================================================== +//3 Dynamic Tx Power +//3=========================================================== +//Dynamic Tx Power Control Threshold + +//Remove By YuChen + +//3=========================================================== +//3 Tx Power Tracking +//3=========================================================== + + + +//3=========================================================== +//3 Rate Adaptive +//3=========================================================== +//Remove to odm_RaInfo.h by RS_James + +//3=========================================================== +//3 BB Power Save +//3=========================================================== + +typedef enum tag_1R_CCA_Type_Definition +{ + CCA_1R =0, + CCA_2R = 1, + CCA_MAX = 2, +}DM_1R_CCA_E; + +typedef enum tag_RF_Type_Definition +{ + RF_Save =0, + RF_Normal = 1, + RF_MAX = 2, +}DM_RF_E; + + +// +// Extern Global Variables. +// +//PowerTracking move to odm_powerTrakcing.h by YuChen +// +// check Sta pointer valid or not +// +#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) +#define IS_STA_VALID(pSta) (pSta && pSta->expire_to) +#elif (DM_ODM_SUPPORT_TYPE & ODM_WIN) +#define IS_STA_VALID(pSta) (pSta && pSta->bUsed) +#else +#define IS_STA_VALID(pSta) (pSta) +#endif + +//Remove DIG by yuchen + +//Remove BB power saving by Yuchen + +//remove PT by yuchen + +//ODM_RAStateCheck() Remove by RS_James + +#if(DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_AP|ODM_ADSL)) +//============================================================ +// function prototype +//============================================================ +//#define DM_ChangeDynamicInitGainThresh ODM_ChangeDynamicInitGainThresh +//void ODM_ChangeDynamicInitGainThresh(IN PADAPTER pAdapter, +// IN INT32 DM_Type, +// IN INT32 DM_Value); + +//Remove DIG by yuchen + + +BOOLEAN +ODM_CheckPowerStatus( + IN PADAPTER Adapter + ); + + +//Remove ODM_RateAdaptiveStateApInit() by RS_James + +//Remove Edca by YuChen + +#endif + + + +u4Byte odm_ConvertTo_dB(u4Byte Value); + +u4Byte odm_ConvertTo_linear(u4Byte Value); + +#if((DM_ODM_SUPPORT_TYPE==ODM_WIN)||(DM_ODM_SUPPORT_TYPE==ODM_CE)) + +u4Byte +GetPSDData( + PDM_ODM_T pDM_Odm, + unsigned int point, + u1Byte initial_gain_psd); + +#endif + +#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) +VOID +ODM_DMWatchdog_LPS( + IN PDM_ODM_T pDM_Odm +); +#endif + + + +#if (BEAMFORMING_SUPPORT == 1) +BEAMFORMING_CAP +Beamforming_GetEntryBeamCapByMacId( + IN PMGNT_INFO pMgntInfo, + IN u1Byte MacId + ); +#endif + +s4Byte +ODM_PWdB_Conversion( + IN s4Byte X, + IN u4Byte TotalBit, + IN u4Byte DecimalBit + ); + +s4Byte +ODM_SignConversion( + IN s4Byte value, + IN u4Byte TotalBit + ); + +VOID +ODM_DMInit( + IN PDM_ODM_T pDM_Odm +); + +VOID +ODM_DMReset( + IN PDM_ODM_T pDM_Odm + ); + +VOID +ODM_DMWatchdog( + IN PDM_ODM_T pDM_Odm // For common use in the future + ); + +VOID +ODM_CmnInfoInit( + IN PDM_ODM_T pDM_Odm, + IN ODM_CMNINFO_E CmnInfo, + IN u4Byte Value + ); + +VOID +ODM_CmnInfoHook( + IN PDM_ODM_T pDM_Odm, + IN ODM_CMNINFO_E CmnInfo, + IN PVOID pValue + ); + +VOID +ODM_CmnInfoPtrArrayHook( + IN PDM_ODM_T pDM_Odm, + IN ODM_CMNINFO_E CmnInfo, + IN u2Byte Index, + IN PVOID pValue + ); + +VOID +ODM_CmnInfoUpdate( + IN PDM_ODM_T pDM_Odm, + IN u4Byte CmnInfo, + IN u8Byte Value + ); + +#if(DM_ODM_SUPPORT_TYPE==ODM_AP) +VOID +ODM_InitAllThreads( + IN PDM_ODM_T pDM_Odm + ); + +VOID +ODM_StopAllThreads( + IN PDM_ODM_T pDM_Odm + ); +#endif + +VOID +ODM_InitAllTimers( + IN PDM_ODM_T pDM_Odm + ); + +VOID +ODM_CancelAllTimers( + IN PDM_ODM_T pDM_Odm + ); + +VOID +ODM_ReleaseAllTimers( + IN PDM_ODM_T pDM_Odm + ); + +VOID +ODM_ResetIQKResult( + IN PDM_ODM_T pDM_Odm + ); + + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) +VOID ODM_InitAllWorkItems(IN PDM_ODM_T pDM_Odm ); +VOID ODM_FreeAllWorkItems(IN PDM_ODM_T pDM_Odm ); + + + +u8Byte +PlatformDivision64( + IN u8Byte x, + IN u8Byte y +); + +//==================================================== +//3 PathDiV End +//==================================================== + + +#define DM_ChangeDynamicInitGainThresh ODM_ChangeDynamicInitGainThresh +//void ODM_ChangeDynamicInitGainThresh(IN PADAPTER pAdapter, +// IN INT32 DM_Type, +// IN INT32 DM_Value); +// +// PathDiveristy Remove by RS_James + +typedef enum tag_DIG_Connect_Definition +{ + DIG_STA_DISCONNECT = 0, + DIG_STA_CONNECT = 1, + DIG_STA_BEFORE_CONNECT = 2, + DIG_MultiSTA_DISCONNECT = 3, + DIG_MultiSTA_CONNECT = 4, + DIG_CONNECT_MAX +}DM_DIG_CONNECT_E; + + +// +// 2012/01/12 MH Check afapter status. Temp fix BSOD. +// +#define HAL_ADAPTER_STS_CHK(pDM_Odm)\ + if (pDM_Odm->Adapter == NULL)\ + {\ + return;\ + }\ + + +// +// For new definition in MP temporarily fro power tracking, +// +#define odm_TXPowerTrackingDirectCall(_Adapter) \ + IS_HARDWARE_TYPE_8192D(_Adapter) ? odm_TXPowerTrackingCallback_ThermalMeter_92D(_Adapter) : \ + IS_HARDWARE_TYPE_8192C(_Adapter) ? odm_TXPowerTrackingCallback_ThermalMeter_92C(_Adapter) : \ + IS_HARDWARE_TYPE_8723A(_Adapter) ? odm_TXPowerTrackingCallback_ThermalMeter_8723A(_Adapter) :\ + ODM_TXPowerTrackingCallback_ThermalMeter(_Adapter) + + + +#endif // #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + +VOID +ODM_AsocEntry_Init( + IN PDM_ODM_T pDM_Odm + ); + +//Remove ODM_DynamicARFBSelect() by RS_James + +PVOID +PhyDM_Get_Structure( + IN PDM_ODM_T pDM_Odm, + IN u1Byte Structure_Type +); + +#if (DM_ODM_SUPPORT_TYPE == ODM_CE) +void odm_dtc(PDM_ODM_T pDM_Odm); +#endif /* #if (DM_ODM_SUPPORT_TYPE == ODM_CE) */ + +#endif + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_ACS.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_ACS.c new file mode 100644 index 00000000000000..f82846d71e6ca0 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_ACS.c @@ -0,0 +1,213 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +//============================================================ +// include files +//============================================================ +#include "Mp_Precomp.h" +#include "phydm_precomp.h" + + +u1Byte +ODM_GetAutoChannelSelectResult( + IN PVOID pDM_VOID, + IN u1Byte Band +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PACS pACS = &pDM_Odm->DM_ACS; + +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) + if(Band == ODM_BAND_2_4G) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ACS, ODM_DBG_LOUD, ("[ACS] ODM_GetAutoChannelSelectResult(): CleanChannel_2G(%d)\n", pACS->CleanChannel_2G)); + return (u1Byte)pACS->CleanChannel_2G; + } + else + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ACS, ODM_DBG_LOUD, ("[ACS] ODM_GetAutoChannelSelectResult(): CleanChannel_5G(%d)\n", pACS->CleanChannel_5G)); + return (u1Byte)pACS->CleanChannel_5G; + } +#else + return (u1Byte)pACS->CleanChannel_2G; +#endif + +} + +VOID +odm_AutoChannelSelectSetting( + IN PVOID pDM_VOID, + IN BOOLEAN IsEnable +) +{ +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + u2Byte period = 0x2710;// 40ms in default + u2Byte NHMType = 0x7; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ACS, ODM_DBG_LOUD, ("odm_AutoChannelSelectSetting()=========> \n")); + + if(IsEnable) + {//20 ms + period = 0x1388; + NHMType = 0x1; + } + + if(pDM_Odm->SupportICType & ODM_IC_11AC_SERIES) + { + //PHY parameters initialize for ac series + ODM_Write2Byte(pDM_Odm, ODM_REG_NHM_TIMER_11AC+2, period); //0x990[31:16]=0x2710 Time duration for NHM unit: 4us, 0x2710=40ms + //ODM_SetBBReg(pDM_Odm, ODM_REG_NHM_TH9_TH10_11AC, BIT8|BIT9|BIT10, NHMType); //0x994[9:8]=3 enable CCX + } + else if (pDM_Odm->SupportICType & ODM_IC_11N_SERIES) + { + //PHY parameters initialize for n series + ODM_Write2Byte(pDM_Odm, ODM_REG_NHM_TIMER_11N+2, period); //0x894[31:16]=0x2710 Time duration for NHM unit: 4us, 0x2710=40ms + //ODM_SetBBReg(pDM_Odm, ODM_REG_NHM_TH9_TH10_11N, BIT10|BIT9|BIT8, NHMType); //0x890[9:8]=3 enable CCX + } +#endif +} + +VOID +odm_AutoChannelSelectInit( + IN PVOID pDM_VOID +) +{ +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PACS pACS = &pDM_Odm->DM_ACS; + u1Byte i; + + if(!(pDM_Odm->SupportAbility & ODM_BB_NHM_CNT)) + return; + + if(pACS->bForceACSResult) + return; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ACS, ODM_DBG_LOUD, ("odm_AutoChannelSelectInit()=========> \n")); + + pACS->CleanChannel_2G = 1; + pACS->CleanChannel_5G = 36; + + for (i = 0; i < ODM_MAX_CHANNEL_2G; ++i) + { + pACS->Channel_Info_2G[0][i] = 0; + pACS->Channel_Info_2G[1][i] = 0; + } + + if(pDM_Odm->SupportICType & (ODM_IC_11AC_SERIES|ODM_RTL8192D)) + { + for (i = 0; i < ODM_MAX_CHANNEL_5G; ++i) + { + pACS->Channel_Info_5G[0][i] = 0; + pACS->Channel_Info_5G[1][i] = 0; + } + } +#endif +} + +VOID +odm_AutoChannelSelectReset( + IN PVOID pDM_VOID +) +{ +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PACS pACS = &pDM_Odm->DM_ACS; + + if(!(pDM_Odm->SupportAbility & ODM_BB_NHM_CNT)) + return; + + if(pACS->bForceACSResult) + return; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ACS, ODM_DBG_LOUD, ("odm_AutoChannelSelectReset()=========> \n")); + + odm_AutoChannelSelectSetting(pDM_Odm,TRUE);// for 20ms measurement + Phydm_NHMCounterStatisticsReset(pDM_Odm); +#endif +} + +VOID +odm_AutoChannelSelect( + IN PVOID pDM_VOID, + IN u1Byte Channel +) +{ +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PACS pACS = &pDM_Odm->DM_ACS; + u1Byte ChannelIDX = 0, SearchIDX = 0; + u2Byte MaxScore=0; + + if(!(pDM_Odm->SupportAbility & ODM_BB_NHM_CNT)) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_AutoChannelSelect(): Return: SupportAbility ODM_BB_NHM_CNT is disabled\n")); + return; + } + + if(pACS->bForceACSResult) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_AutoChannelSelect(): Force 2G clean channel = %d, 5G clean channel = %d\n", + pACS->CleanChannel_2G, pACS->CleanChannel_5G)); + return; + } + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ACS, ODM_DBG_LOUD, ("odm_AutoChannelSelect(): Channel = %d=========> \n", Channel)); + + Phydm_GetNHMCounterStatistics(pDM_Odm); + odm_AutoChannelSelectSetting(pDM_Odm,FALSE); + + if(Channel >=1 && Channel <=14) + { + ChannelIDX = Channel - 1; + pACS->Channel_Info_2G[1][ChannelIDX]++; + + if(pACS->Channel_Info_2G[1][ChannelIDX] >= 2) + pACS->Channel_Info_2G[0][ChannelIDX] = (pACS->Channel_Info_2G[0][ChannelIDX] >> 1) + + (pACS->Channel_Info_2G[0][ChannelIDX] >> 2) + (pDM_Odm->NHM_cnt_0>>2); + else + pACS->Channel_Info_2G[0][ChannelIDX] = pDM_Odm->NHM_cnt_0; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ACS, ODM_DBG_LOUD, ("odm_AutoChannelSelect(): NHM_cnt_0 = %d \n", pDM_Odm->NHM_cnt_0)); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ACS, ODM_DBG_LOUD, ("odm_AutoChannelSelect(): Channel_Info[0][%d] = %d, Channel_Info[1][%d] = %d\n", ChannelIDX, pACS->Channel_Info_2G[0][ChannelIDX], ChannelIDX, pACS->Channel_Info_2G[1][ChannelIDX])); + + for(SearchIDX = 0; SearchIDX < ODM_MAX_CHANNEL_2G; SearchIDX++) + { + if(pACS->Channel_Info_2G[1][SearchIDX] != 0) + { + if(pACS->Channel_Info_2G[0][SearchIDX] >= MaxScore) + { + MaxScore = pACS->Channel_Info_2G[0][SearchIDX]; + pACS->CleanChannel_2G = SearchIDX+1; + } + } + } + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ACS, ODM_DBG_LOUD, ("(1)odm_AutoChannelSelect(): 2G: CleanChannel_2G = %d, MaxScore = %d \n", + pACS->CleanChannel_2G, MaxScore)); + + } + else if(Channel >= 36) + { + // Need to do + pACS->CleanChannel_5G = Channel; + } +#endif +} diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_ACS.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_ACS.h new file mode 100644 index 00000000000000..d24c4c63bbdee2 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_ACS.h @@ -0,0 +1,61 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +#ifndef __PHYDMACS_H__ +#define __PHYDMACS_H__ + +#define ACS_VERSION "1.0" + +#define ODM_MAX_CHANNEL_2G 14 +#define ODM_MAX_CHANNEL_5G 24 + +typedef struct _ACS_ +{ + BOOLEAN bForceACSResult; + u1Byte CleanChannel_2G; + u1Byte CleanChannel_5G; + u2Byte Channel_Info_2G[2][ODM_MAX_CHANNEL_2G]; //Channel_Info[1]: Channel Score, Channel_Info[2]:Channel_Scan_Times + u2Byte Channel_Info_5G[2][ODM_MAX_CHANNEL_5G]; +}ACS, *PACS; + + +VOID +odm_AutoChannelSelectInit( + IN PVOID pDM_VOID +); + +VOID +odm_AutoChannelSelectReset( + IN PVOID pDM_VOID +); + +VOID +odm_AutoChannelSelect( + IN PVOID pDM_VOID, + IN u1Byte Channel +); + +u1Byte +ODM_GetAutoChannelSelectResult( + IN PVOID pDM_VOID, + IN u1Byte Band +); + +#endif \ No newline at end of file diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_AntDect.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_AntDect.c new file mode 100644 index 00000000000000..14366cb56e8b49 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_AntDect.c @@ -0,0 +1,1215 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +//============================================================ +// include files +//============================================================ + +#include "Mp_Precomp.h" +#include "phydm_precomp.h" + +//#if( DM_ODM_SUPPORT_TYPE & (ODM_WIN |ODM_CE)) +#if(defined(CONFIG_ANT_DETECTION)) + +//IS_ANT_DETECT_SUPPORT_SINGLE_TONE(Adapter) +//IS_ANT_DETECT_SUPPORT_RSSI(Adapter) +//IS_ANT_DETECT_SUPPORT_PSD(Adapter) + +//1 [1. Single Tone Method] =================================================== + + +VOID +odm_PHY_SaveAFERegisters( + IN PVOID pDM_VOID, + IN pu4Byte AFEReg, + IN pu4Byte AFEBackup, + IN u4Byte RegisterNum + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + u4Byte i; + + //RT_DISP(FINIT, INIT_IQK, ("Save ADDA parameters.\n")); + for( i = 0 ; i < RegisterNum ; i++){ + AFEBackup[i] = ODM_GetBBReg(pDM_Odm, AFEReg[i], bMaskDWord); + } +} + +VOID +odm_PHY_ReloadAFERegisters( + IN PVOID pDM_VOID, + IN pu4Byte AFEReg, + IN pu4Byte AFEBackup, + IN u4Byte RegiesterNum + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + u4Byte i; + + //RT_DISP(FINIT, INIT_IQK, ("Reload ADDA power saving parameters !\n")); + for(i = 0 ; i < RegiesterNum; i++) + { + + ODM_SetBBReg(pDM_Odm, AFEReg[i], bMaskDWord, AFEBackup[i]); + } +} + +// +// Description: +// Set Single/Dual Antenna default setting for products that do not do detection in advance. +// +// Added by Joseph, 2012.03.22 +// +VOID +ODM_SingleDualAntennaDefaultSetting( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; + PADAPTER pAdapter = pDM_Odm->Adapter; + + u1Byte btAntNum=BT_GetPgAntNum(pAdapter); + // Set default antenna A and B status + if(btAntNum == 2) + { + pDM_SWAT_Table->ANTA_ON=TRUE; + pDM_SWAT_Table->ANTB_ON=TRUE; + + } + else if(btAntNum == 1) + {// Set antenna A as default + pDM_SWAT_Table->ANTA_ON=TRUE; + pDM_SWAT_Table->ANTB_ON=FALSE; + + } + else + { + RT_ASSERT(FALSE, ("Incorrect antenna number!!\n")); + } +} + + +//2 8723A ANT DETECT +// +// Description: +// Implement IQK single tone for RF DPK loopback and BB PSD scanning. +// This function is cooperated with BB team Neil. +// +// Added by Roger, 2011.12.15 +// +BOOLEAN +ODM_SingleDualAntennaDetection( + IN PVOID pDM_VOID, + IN u1Byte mode + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PADAPTER pAdapter = pDM_Odm->Adapter; + pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; + u4Byte CurrentChannel,RfLoopReg; + u1Byte n; + u4Byte Reg88c, Regc08, Reg874, Regc50, Reg948, Regb2c, Reg92c, Reg930, Reg064, AFE_rRx_Wait_CCA; + u1Byte initial_gain = 0x5a; + u4Byte PSD_report_tmp; + u4Byte AntA_report = 0x0, AntB_report = 0x0,AntO_report=0x0,temp; + BOOLEAN bResult = TRUE; + u4Byte AFE_Backup[16]; + u4Byte AFE_REG_8723A[16] = { + rRx_Wait_CCA, rTx_CCK_RFON, + rTx_CCK_BBON, rTx_OFDM_RFON, + rTx_OFDM_BBON, rTx_To_Rx, + rTx_To_Tx, rRx_CCK, + rRx_OFDM, rRx_Wait_RIFS, + rRx_TO_Rx, rStandby, + rSleep, rPMPD_ANAEN, + rFPGA0_XCD_SwitchControl, rBlue_Tooth}; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SingleDualAntennaDetection()============> \n")); + + + if(!(pDM_Odm->SupportICType & (ODM_RTL8723A|ODM_RTL8192C|ODM_RTL8723B))) + return bResult; + + // Retrieve antenna detection registry info, added by Roger, 2012.11.27. + if(!IS_ANT_DETECT_SUPPORT_SINGLE_TONE(pAdapter)) + return bResult; + + if(pDM_Odm->SupportICType == ODM_RTL8192C) + { + //Which path in ADC/DAC is turnned on for PSD: both I/Q + ODM_SetBBReg(pDM_Odm, 0x808, BIT10|BIT11, 0x3); + //Ageraged number: 8 + ODM_SetBBReg(pDM_Odm, 0x808, BIT12|BIT13, 0x1); + //pts = 128; + ODM_SetBBReg(pDM_Odm, 0x808, BIT14|BIT15, 0x0); + } + + //1 Backup Current RF/BB Settings + + CurrentChannel = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_A, ODM_CHANNEL, bRFRegOffsetMask); + RfLoopReg = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x00, bRFRegOffsetMask); + if(pDM_Odm->SupportICType & (ODM_RTL8723A|ODM_RTL8192C)) + ODM_SetBBReg(pDM_Odm, rFPGA0_XA_RFInterfaceOE, ODM_DPDT, Antenna_A); // change to Antenna A + else if(pDM_Odm->SupportICType == ODM_RTL8723B) + { + Reg92c = ODM_GetBBReg(pDM_Odm, rDPDT_control, bMaskDWord); + Reg930 = ODM_GetBBReg(pDM_Odm, rfe_ctrl_anta_src, bMaskDWord); + Reg948 = ODM_GetBBReg(pDM_Odm, rS0S1_PathSwitch, bMaskDWord); + Regb2c = ODM_GetBBReg(pDM_Odm, rAGC_table_select, bMaskDWord); + Reg064 = ODM_GetMACReg(pDM_Odm, rSYM_WLBT_PAPE_SEL, BIT29); + ODM_SetBBReg(pDM_Odm, rDPDT_control, 0x3, 0x1); + ODM_SetBBReg(pDM_Odm, rfe_ctrl_anta_src, 0xff, 0x77); + ODM_SetMACReg(pDM_Odm, rSYM_WLBT_PAPE_SEL, BIT29, 0x1); //dbg 7 + ODM_SetBBReg(pDM_Odm, rS0S1_PathSwitch, 0x3c0, 0x0);//dbg 8 + ODM_SetBBReg(pDM_Odm, rAGC_table_select, BIT31, 0x0); + } + + ODM_StallExecution(10); + + //Store A Path Register 88c, c08, 874, c50 + Reg88c = ODM_GetBBReg(pDM_Odm, rFPGA0_AnalogParameter4, bMaskDWord); + Regc08 = ODM_GetBBReg(pDM_Odm, rOFDM0_TRMuxPar, bMaskDWord); + Reg874 = ODM_GetBBReg(pDM_Odm, rFPGA0_XCD_RFInterfaceSW, bMaskDWord); + Regc50 = ODM_GetBBReg(pDM_Odm, rOFDM0_XAAGCCore1, bMaskDWord); + + // Store AFE Registers + if(pDM_Odm->SupportICType & (ODM_RTL8723A|ODM_RTL8192C)) + odm_PHY_SaveAFERegisters(pDM_Odm, AFE_REG_8723A, AFE_Backup, 16); + else if(pDM_Odm->SupportICType == ODM_RTL8723B) + AFE_rRx_Wait_CCA = ODM_GetBBReg(pDM_Odm, rRx_Wait_CCA,bMaskDWord); + + //Set PSD 128 pts + ODM_SetBBReg(pDM_Odm, rFPGA0_PSDFunction, BIT14|BIT15, 0x0); //128 pts + + // To SET CH1 to do + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, ODM_CHANNEL, bRFRegOffsetMask, 0x7401); //Channel 1 + + // AFE all on step + if(pDM_Odm->SupportICType & (ODM_RTL8723A|ODM_RTL8192C)) + { + ODM_SetBBReg(pDM_Odm, rRx_Wait_CCA, bMaskDWord, 0x6FDB25A4); + ODM_SetBBReg(pDM_Odm, rTx_CCK_RFON, bMaskDWord, 0x6FDB25A4); + ODM_SetBBReg(pDM_Odm, rTx_CCK_BBON, bMaskDWord, 0x6FDB25A4); + ODM_SetBBReg(pDM_Odm, rTx_OFDM_RFON, bMaskDWord, 0x6FDB25A4); + ODM_SetBBReg(pDM_Odm, rTx_OFDM_BBON, bMaskDWord, 0x6FDB25A4); + ODM_SetBBReg(pDM_Odm, rTx_To_Rx, bMaskDWord, 0x6FDB25A4); + ODM_SetBBReg(pDM_Odm, rTx_To_Tx, bMaskDWord, 0x6FDB25A4); + ODM_SetBBReg(pDM_Odm, rRx_CCK, bMaskDWord, 0x6FDB25A4); + ODM_SetBBReg(pDM_Odm, rRx_OFDM, bMaskDWord, 0x6FDB25A4); + ODM_SetBBReg(pDM_Odm, rRx_Wait_RIFS, bMaskDWord, 0x6FDB25A4); + ODM_SetBBReg(pDM_Odm, rRx_TO_Rx, bMaskDWord, 0x6FDB25A4); + ODM_SetBBReg(pDM_Odm, rStandby, bMaskDWord, 0x6FDB25A4); + ODM_SetBBReg(pDM_Odm, rSleep, bMaskDWord, 0x6FDB25A4); + ODM_SetBBReg(pDM_Odm, rPMPD_ANAEN, bMaskDWord, 0x6FDB25A4); + ODM_SetBBReg(pDM_Odm, rFPGA0_XCD_SwitchControl, bMaskDWord, 0x6FDB25A4); + ODM_SetBBReg(pDM_Odm, rBlue_Tooth, bMaskDWord, 0x6FDB25A4); + } + else if(pDM_Odm->SupportICType == ODM_RTL8723B) + { + ODM_SetBBReg(pDM_Odm, rRx_Wait_CCA, bMaskDWord, 0x01c00016); + } + + // 3 wire Disable + ODM_SetBBReg(pDM_Odm, rFPGA0_AnalogParameter4, bMaskDWord, 0xCCF000C0); + + //BB IQK Setting + ODM_SetBBReg(pDM_Odm, rOFDM0_TRMuxPar, bMaskDWord, 0x000800E4); + ODM_SetBBReg(pDM_Odm, rFPGA0_XCD_RFInterfaceSW, bMaskDWord, 0x22208000); + + //IQK setting tone@ 4.34Mhz + ODM_SetBBReg(pDM_Odm, rTx_IQK_Tone_A, bMaskDWord, 0x10008C1C); + ODM_SetBBReg(pDM_Odm, rTx_IQK, bMaskDWord, 0x01007c00); + + //Page B init + ODM_SetBBReg(pDM_Odm, rConfig_AntA, bMaskDWord, 0x00080000); + ODM_SetBBReg(pDM_Odm, rConfig_AntA, bMaskDWord, 0x0f600000); + ODM_SetBBReg(pDM_Odm, rRx_IQK, bMaskDWord, 0x01004800); + ODM_SetBBReg(pDM_Odm, rRx_IQK_Tone_A, bMaskDWord, 0x10008c1f); + if(pDM_Odm->SupportICType & (ODM_RTL8723A|ODM_RTL8192C)) + { + ODM_SetBBReg(pDM_Odm, rTx_IQK_PI_A, bMaskDWord, 0x82150008); + ODM_SetBBReg(pDM_Odm, rRx_IQK_PI_A, bMaskDWord, 0x28150008); + } + else if(pDM_Odm->SupportICType == ODM_RTL8723B) + { + ODM_SetBBReg(pDM_Odm, rTx_IQK_PI_A, bMaskDWord, 0x82150016); + ODM_SetBBReg(pDM_Odm, rRx_IQK_PI_A, bMaskDWord, 0x28150016); + } + ODM_SetBBReg(pDM_Odm, rIQK_AGC_Rsp, bMaskDWord, 0x001028d0); + ODM_SetBBReg(pDM_Odm, rOFDM0_XAAGCCore1, 0x7f, initial_gain); + + //RF loop Setting + if(pDM_Odm->SupportICType & (ODM_RTL8723A|ODM_RTL8192C)) + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x0, 0xFFFFF, 0x50008); + + //IQK Single tone start + ODM_SetBBReg(pDM_Odm, rFPGA0_IQK, 0xffffff00, 0x808000); + ODM_SetBBReg(pDM_Odm, rIQK_AGC_Pts, bMaskDWord, 0xf9000000); + ODM_SetBBReg(pDM_Odm, rIQK_AGC_Pts, bMaskDWord, 0xf8000000); + + ODM_StallExecution(10000); + + // PSD report of antenna A + PSD_report_tmp=0x0; + for (n=0;n<2;n++) + { + PSD_report_tmp = GetPSDData(pDM_Odm, 14, initial_gain); + if(PSD_report_tmp >AntA_report) + AntA_report=PSD_report_tmp; + } + + // change to Antenna B + if(pDM_Odm->SupportICType & (ODM_RTL8723A|ODM_RTL8192C)) + ODM_SetBBReg(pDM_Odm, rFPGA0_XA_RFInterfaceOE, ODM_DPDT, Antenna_B); + else if(pDM_Odm->SupportICType == ODM_RTL8723B) + { + //ODM_SetBBReg(pDM_Odm, rDPDT_control, 0x3, 0x2); + ODM_SetBBReg(pDM_Odm, rS0S1_PathSwitch, 0xfff, 0x280); + ODM_SetBBReg(pDM_Odm, rAGC_table_select, BIT31, 0x1); + } + + ODM_StallExecution(10); + + // PSD report of antenna B + PSD_report_tmp=0x0; + for (n=0;n<2;n++) + { + PSD_report_tmp = GetPSDData(pDM_Odm, 14, initial_gain); + if(PSD_report_tmp > AntB_report) + AntB_report=PSD_report_tmp; + } + + // change to open case + if(pDM_Odm->SupportICType & (ODM_RTL8723A|ODM_RTL8192C)) + { + ODM_SetBBReg(pDM_Odm, rFPGA0_XA_RFInterfaceOE, ODM_DPDT, 0); // change to Antenna A + + ODM_StallExecution(10); + + // PSD report of open case + PSD_report_tmp=0x0; + for (n=0;n<2;n++) + { + PSD_report_tmp = GetPSDData(pDM_Odm, 14, initial_gain); + if(PSD_report_tmp > AntO_report) + AntO_report=PSD_report_tmp; + } + } + //Close IQK Single Tone function + ODM_SetBBReg(pDM_Odm, rFPGA0_IQK, 0xffffff00, 0x000000); + + //1 Return to antanna A + if(pDM_Odm->SupportICType & (ODM_RTL8723A|ODM_RTL8192C)) + ODM_SetBBReg(pDM_Odm, rFPGA0_XA_RFInterfaceOE, ODM_DPDT, Antenna_A); // change to Antenna A + else if(pDM_Odm->SupportICType == ODM_RTL8723B) + { + // external DPDT + ODM_SetBBReg(pDM_Odm, rDPDT_control, bMaskDWord, Reg92c); + + //internal S0/S1 + ODM_SetBBReg(pDM_Odm, rS0S1_PathSwitch, bMaskDWord, Reg948); + ODM_SetBBReg(pDM_Odm, rAGC_table_select, bMaskDWord, Regb2c); + ODM_SetBBReg(pDM_Odm, rfe_ctrl_anta_src, bMaskDWord, Reg930); + ODM_SetMACReg(pDM_Odm, rSYM_WLBT_PAPE_SEL, BIT29, Reg064); + } + + ODM_SetBBReg(pDM_Odm, rFPGA0_AnalogParameter4, bMaskDWord, Reg88c); + ODM_SetBBReg(pDM_Odm, rOFDM0_TRMuxPar, bMaskDWord, Regc08); + ODM_SetBBReg(pDM_Odm, rFPGA0_XCD_RFInterfaceSW, bMaskDWord, Reg874); + ODM_SetBBReg(pDM_Odm, rOFDM0_XAAGCCore1, 0x7F, 0x40); + ODM_SetBBReg(pDM_Odm, rOFDM0_XAAGCCore1, bMaskDWord, Regc50); + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_CHNLBW, bRFRegOffsetMask,CurrentChannel); + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x00, bRFRegOffsetMask,RfLoopReg); + + //Reload AFE Registers + if(pDM_Odm->SupportICType & (ODM_RTL8723A|ODM_RTL8192C)) + odm_PHY_ReloadAFERegisters(pDM_Odm, AFE_REG_8723A, AFE_Backup, 16); + else if(pDM_Odm->SupportICType == ODM_RTL8723B) + ODM_SetBBReg(pDM_Odm, rRx_Wait_CCA, bMaskDWord, AFE_rRx_Wait_CCA); + + if(pDM_Odm->SupportICType == ODM_RTL8723A) + { + //2 Test Ant B based on Ant A is ON + if(mode==ANTTESTB) + { + if(AntA_report >= 100) + { + if(AntB_report > (AntA_report+1)) + { + pDM_SWAT_Table->ANTB_ON=FALSE; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SingleDualAntennaDetection(): Single Antenna A\n")); + } + else + { + pDM_SWAT_Table->ANTB_ON=TRUE; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SingleDualAntennaDetection(): Dual Antenna is A and B\n")); + } + } + else + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SingleDualAntennaDetection(): Need to check again\n")); + pDM_SWAT_Table->ANTB_ON=FALSE; // Set Antenna B off as default + bResult = FALSE; + } + } + //2 Test Ant A and B based on DPDT Open + else if(mode==ANTTESTALL) + { + if((AntO_report >=100) && (AntO_report <=118)) + { + if(AntA_report > (AntO_report+1)) + { + pDM_SWAT_Table->ANTA_ON=FALSE; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("Ant A is OFF\n")); + } + else + { + pDM_SWAT_Table->ANTA_ON=TRUE; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("Ant A is ON\n")); + } + + if(AntB_report > (AntO_report+2)) + { + pDM_SWAT_Table->ANTB_ON=FALSE; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("Ant B is OFF\n")); + } + else + { + pDM_SWAT_Table->ANTB_ON=TRUE; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("Ant B is ON\n")); + } + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("psd_report_A[%d]= %d \n", 2416, AntA_report)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("psd_report_B[%d]= %d \n", 2416, AntB_report)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("psd_report_O[%d]= %d \n", 2416, AntO_report)); + + pDM_Odm->AntDetectedInfo.bAntDetected= TRUE; + pDM_Odm->AntDetectedInfo.dBForAntA = AntA_report; + pDM_Odm->AntDetectedInfo.dBForAntB = AntB_report; + pDM_Odm->AntDetectedInfo.dBForAntO = AntO_report; + + } + else + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("return FALSE!!\n")); + bResult = FALSE; + } + } + } + else if(pDM_Odm->SupportICType == ODM_RTL8192C) + { + if(AntA_report >= 100) + { + if(AntB_report > (AntA_report+2)) + { + pDM_SWAT_Table->ANTA_ON=FALSE; + pDM_SWAT_Table->ANTB_ON=TRUE; + ODM_SetBBReg(pDM_Odm, rFPGA0_XA_RFInterfaceOE, 0x300, Antenna_B); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SingleDualAntennaDetection(): Single Antenna B\n")); + } + else if(AntA_report > (AntB_report+2)) + { + pDM_SWAT_Table->ANTA_ON=TRUE; + pDM_SWAT_Table->ANTB_ON=FALSE; + ODM_SetBBReg(pDM_Odm, rFPGA0_XA_RFInterfaceOE, 0x300, Antenna_A); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SingleDualAntennaDetection(): Single Antenna A\n")); + } + else + { + pDM_SWAT_Table->ANTA_ON=TRUE; + pDM_SWAT_Table->ANTB_ON=TRUE; + } + } + else + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SingleDualAntennaDetection(): Need to check again\n")); + pDM_SWAT_Table->ANTA_ON=TRUE; // Set Antenna A on as default + pDM_SWAT_Table->ANTB_ON=FALSE; // Set Antenna B off as default + bResult = FALSE; + } + } + else if(pDM_Odm->SupportICType == ODM_RTL8723B) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("psd_report_A[%d]= %d \n", 2416, AntA_report)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("psd_report_B[%d]= %d \n", 2416, AntB_report)); + + //2 Test Ant B based on Ant A is ON + if((AntA_report >= 100) && (AntB_report >= 100) && (AntA_report <= 135) && (AntB_report <= 135)) + { + u1Byte TH1=2, TH2=6; + + if((AntA_report - AntB_report < TH1) || (AntB_report - AntA_report < TH1)) + { + pDM_SWAT_Table->ANTA_ON=TRUE; + pDM_SWAT_Table->ANTB_ON=TRUE; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("ODM_SingleDualAntennaDetection(): Dual Antenna\n")); + } + else if(((AntA_report - AntB_report >= TH1) && (AntA_report - AntB_report <= TH2)) || + ((AntB_report - AntA_report >= TH1) && (AntB_report - AntA_report <= TH2))) + { + pDM_SWAT_Table->ANTA_ON=FALSE; + pDM_SWAT_Table->ANTB_ON=FALSE; + bResult = FALSE; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SingleDualAntennaDetection(): Need to check again\n")); + } + else + { + pDM_SWAT_Table->ANTA_ON = TRUE; + pDM_SWAT_Table->ANTB_ON=FALSE; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("ODM_SingleDualAntennaDetection(): Single Antenna\n")); + } + pDM_Odm->AntDetectedInfo.bAntDetected= TRUE; + pDM_Odm->AntDetectedInfo.dBForAntA = AntA_report; + pDM_Odm->AntDetectedInfo.dBForAntB = AntB_report; + pDM_Odm->AntDetectedInfo.dBForAntO = AntO_report; + + } + else + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("return FALSE!!\n")); + bResult = FALSE; + } + } + return bResult; + +} + + + +//1 [2. Scan AP RSSI Method] ================================================== + + + + +BOOLEAN +ODM_SwAntDivCheckBeforeLink( + IN PVOID pDM_VOID + ) +{ + +#if (RT_MEM_SIZE_LEVEL != RT_MEM_SIZE_MINIMUM) + + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PADAPTER Adapter = pDM_Odm->Adapter; + HAL_DATA_TYPE* pHalData = GET_HAL_DATA(Adapter); + PMGNT_INFO pMgntInfo = &Adapter->MgntInfo; + pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; + pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; + s1Byte Score = 0; + PRT_WLAN_BSS pTmpBssDesc, pTestBssDesc; + u1Byte power_target = 10, power_target_L = 9, power_target_H = 16; + u1Byte tmp_power_diff = 0,power_diff = 0,avg_power_diff = 0,max_power_diff = 0,min_power_diff = 0xff; + u2Byte index, counter = 0; + static u1Byte ScanChannel; + u8Byte tStamp_diff = 0; + u4Byte tmp_SWAS_NoLink_BK_Reg948; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ANTA_ON = (( %d )) , ANTB_ON = (( %d )) \n",pDM_Odm->DM_SWAT_Table.ANTA_ON ,pDM_Odm->DM_SWAT_Table.ANTB_ON )); + + //if(HP id) + { + if(pDM_Odm->DM_SWAT_Table.RSSI_AntDect_bResult==TRUE && pDM_Odm->SupportICType == ODM_RTL8723B) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("8723B RSSI-based Antenna Detection is done\n")); + return FALSE; + } + + if(pDM_Odm->SupportICType == ODM_RTL8723B) + { + if(pDM_SWAT_Table->SWAS_NoLink_BK_Reg948 == 0xff) + pDM_SWAT_Table->SWAS_NoLink_BK_Reg948 = ODM_Read4Byte(pDM_Odm, rS0S1_PathSwitch ); + } + } + + if (pDM_Odm->Adapter == NULL) //For BSOD when plug/unplug fast. //By YJ,120413 + { // The ODM structure is not initialized. + return FALSE; + } + + // Retrieve antenna detection registry info, added by Roger, 2012.11.27. + if(!IS_ANT_DETECT_SUPPORT_RSSI(Adapter)) + { + return FALSE; + } + else + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Antenna Detection: RSSI Method\n")); + } + + // Since driver is going to set BB register, it shall check if there is another thread controlling BB/RF. + PlatformAcquireSpinLock(Adapter, RT_RF_STATE_SPINLOCK); + if(pHalData->eRFPowerState!=eRfOn || pMgntInfo->RFChangeInProgress || pMgntInfo->bMediaConnect) + { + PlatformReleaseSpinLock(Adapter, RT_RF_STATE_SPINLOCK); + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, + ("ODM_SwAntDivCheckBeforeLink(): RFChangeInProgress(%x), eRFPowerState(%x)\n", + pMgntInfo->RFChangeInProgress, pHalData->eRFPowerState)); + + pDM_SWAT_Table->SWAS_NoLink_State = 0; + + return FALSE; + } + else + { + PlatformReleaseSpinLock(Adapter, RT_RF_STATE_SPINLOCK); + } + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("pDM_SWAT_Table->SWAS_NoLink_State = %d\n", pDM_SWAT_Table->SWAS_NoLink_State)); + //1 Run AntDiv mechanism "Before Link" part. + if(pDM_SWAT_Table->SWAS_NoLink_State == 0) + { + //1 Prepare to do Scan again to check current antenna state. + + // Set check state to next step. + pDM_SWAT_Table->SWAS_NoLink_State = 1; + + // Copy Current Scan list. + pMgntInfo->tmpNumBssDesc = pMgntInfo->NumBssDesc; + PlatformMoveMemory((PVOID)Adapter->MgntInfo.tmpbssDesc, (PVOID)pMgntInfo->bssDesc, sizeof(RT_WLAN_BSS)*MAX_BSS_DESC); + + // Go back to scan function again. + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SwAntDivCheckBeforeLink: Scan one more time\n")); + pMgntInfo->ScanStep=0; + pMgntInfo->bScanAntDetect = TRUE; + ScanChannel = odm_SwAntDivSelectScanChnl(Adapter); + + + if(pDM_Odm->SupportICType & (ODM_RTL8188E|ODM_RTL8821)) + { + if(pDM_FatTable->RxIdleAnt == MAIN_ANT) + ODM_UpdateRxIdleAnt(pDM_Odm, AUX_ANT); + else + ODM_UpdateRxIdleAnt(pDM_Odm, MAIN_ANT); + if(ScanChannel == 0) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, + ("ODM_SwAntDivCheckBeforeLink(): No AP List Avaiable, Using Ant(%s)\n", (pDM_FatTable->RxIdleAnt==MAIN_ANT)?"AUX_ANT":"MAIN_ANT")); + + if(IS_5G_WIRELESS_MODE(pMgntInfo->dot11CurrentWirelessMode)) + { + pDM_SWAT_Table->Ant5G = pDM_FatTable->RxIdleAnt; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("pDM_SWAT_Table->Ant5G=%s\n", (pDM_FatTable->RxIdleAnt==MAIN_ANT)?"MAIN_ANT":"AUX_ANT")); + } + else + { + pDM_SWAT_Table->Ant2G = pDM_FatTable->RxIdleAnt; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("pDM_SWAT_Table->Ant2G=%s\n", (pDM_FatTable->RxIdleAnt==MAIN_ANT)?"MAIN_ANT":"AUX_ANT")); + } + return FALSE; + } + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, + ("ODM_SwAntDivCheckBeforeLink: Change to %s for testing.\n", ((pDM_FatTable->RxIdleAnt == MAIN_ANT)?"MAIN_ANT":"AUX_ANT"))); + } + else if(pDM_Odm->SupportICType & (ODM_RTL8192C|ODM_RTL8723B)) + { + if(pDM_Odm->SupportICType == ODM_RTL8192C) + { + // Switch Antenna to another one. + pDM_SWAT_Table->PreAntenna = pDM_SWAT_Table->CurAntenna; + pDM_SWAT_Table->CurAntenna = (pDM_SWAT_Table->CurAntenna==MAIN_ANT)?AUX_ANT:MAIN_ANT; + + pDM_SWAT_Table->SWAS_NoLink_BK_Reg860 = ((pDM_SWAT_Table->SWAS_NoLink_BK_Reg860 & 0xfffffcff) | (pDM_SWAT_Table->CurAntenna<<8)); + ODM_SetBBReg(pDM_Odm, rFPGA0_XA_RFInterfaceOE, bMaskDWord, pDM_SWAT_Table->SWAS_NoLink_BK_Reg860); + } + else if(pDM_Odm->SupportICType == ODM_RTL8723B) + { + // Switch Antenna to another one. + + tmp_SWAS_NoLink_BK_Reg948 = ODM_Read4Byte(pDM_Odm, rS0S1_PathSwitch ); + + if( (pDM_SWAT_Table->CurAntenna = MAIN_ANT) && (tmp_SWAS_NoLink_BK_Reg948==0x200)) + { + ODM_SetBBReg(pDM_Odm, rS0S1_PathSwitch, 0xfff, 0x280); + ODM_SetBBReg(pDM_Odm, rAGC_table_select, BIT31, 0x1); + pDM_SWAT_Table->CurAntenna = AUX_ANT; + } + else + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("Reg[948]= (( %x )) was in wrong state\n", tmp_SWAS_NoLink_BK_Reg948 )); + return FALSE; + } + ODM_StallExecution(10); + + } + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SwAntDivCheckBeforeLink: Change to (( %s-ant)) for testing.\n", (pDM_SWAT_Table->CurAntenna==MAIN_ANT)?"MAIN":"AUX")); + } + + odm_SwAntDivConstructScanChnl(Adapter, ScanChannel); + PlatformSetTimer(Adapter, &pMgntInfo->ScanTimer, 5); + + return TRUE; + } + else //pDM_SWAT_Table->SWAS_NoLink_State == 1 + { + //1 ScanComple() is called after antenna swiched. + //1 Check scan result and determine which antenna is going + //1 to be used. + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,(" tmpNumBssDesc= (( %d )) \n",pMgntInfo->tmpNumBssDesc));// debug for Dino + + for(index = 0; index < pMgntInfo->tmpNumBssDesc; index++) + { + pTmpBssDesc = &(pMgntInfo->tmpbssDesc[index]); // Antenna 1 + pTestBssDesc = &(pMgntInfo->bssDesc[index]); // Antenna 2 + + if(PlatformCompareMemory(pTestBssDesc->bdBssIdBuf, pTmpBssDesc->bdBssIdBuf, 6)!=0) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SwAntDivCheckBeforeLink(): ERROR!! This shall not happen.\n")); + continue; + } + + if(pDM_Odm->SupportICType != ODM_RTL8723B) + { + if(pTmpBssDesc->ChannelNumber == ScanChannel) + { + if(pTmpBssDesc->RecvSignalPower > pTestBssDesc->RecvSignalPower) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SwAntDivCheckBeforeLink: Compare scan entry: Score++\n")); + RT_PRINT_STR(COMP_SCAN, DBG_WARNING, "GetScanInfo(): new Bss SSID:", pTmpBssDesc->bdSsIdBuf, pTmpBssDesc->bdSsIdLen); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("at ch %d, Original: %d, Test: %d\n\n", pTmpBssDesc->ChannelNumber, pTmpBssDesc->RecvSignalPower, pTestBssDesc->RecvSignalPower)); + + Score++; + PlatformMoveMemory(pTestBssDesc, pTmpBssDesc, sizeof(RT_WLAN_BSS)); + } + else if(pTmpBssDesc->RecvSignalPower < pTestBssDesc->RecvSignalPower) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SwAntDivCheckBeforeLink: Compare scan entry: Score--\n")); + RT_PRINT_STR(COMP_SCAN, DBG_WARNING, "GetScanInfo(): new Bss SSID:", pTmpBssDesc->bdSsIdBuf, pTmpBssDesc->bdSsIdLen); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("at ch %d, Original: %d, Test: %d\n\n", pTmpBssDesc->ChannelNumber, pTmpBssDesc->RecvSignalPower, pTestBssDesc->RecvSignalPower)); + Score--; + } + else + { + if(pTestBssDesc->bdTstamp - pTmpBssDesc->bdTstamp < 5000) + { + RT_PRINT_STR(COMP_SCAN, DBG_WARNING, "GetScanInfo(): new Bss SSID:", pTmpBssDesc->bdSsIdBuf, pTmpBssDesc->bdSsIdLen); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("at ch %d, Original: %d, Test: %d\n", pTmpBssDesc->ChannelNumber, pTmpBssDesc->RecvSignalPower, pTestBssDesc->RecvSignalPower)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("The 2nd Antenna didn't get this AP\n\n")); + } + } + } + } + else // 8723B + { + if(pTmpBssDesc->ChannelNumber == ScanChannel) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("ChannelNumber == ScanChannel -> (( %d )) \n", pTmpBssDesc->ChannelNumber )); + + if(pTmpBssDesc->RecvSignalPower > pTestBssDesc->RecvSignalPower) // Pow(Ant1) > Pow(Ant2) + { + counter++; + tmp_power_diff=(u1Byte)(pTmpBssDesc->RecvSignalPower - pTestBssDesc->RecvSignalPower); + power_diff = power_diff + tmp_power_diff; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Original: %d, Test: %d\n", pTmpBssDesc->RecvSignalPower, pTestBssDesc->RecvSignalPower)); + ODM_PRINT_ADDR(pDM_Odm,ODM_COMP_ANT_DIV, DBG_LOUD, ("SSID:"), pTmpBssDesc->bdSsIdBuf); + ODM_PRINT_ADDR(pDM_Odm,ODM_COMP_ANT_DIV, DBG_LOUD, ("BSSID:"), pTmpBssDesc->bdBssIdBuf); + + //ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("tmp_power_diff: (( %d)),max_power_diff: (( %d)),min_power_diff: (( %d)) \n", tmp_power_diff,max_power_diff,min_power_diff)); + if(tmp_power_diff > max_power_diff) + max_power_diff=tmp_power_diff; + if(tmp_power_diff < min_power_diff) + min_power_diff=tmp_power_diff; + //ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("max_power_diff: (( %d)),min_power_diff: (( %d)) \n",max_power_diff,min_power_diff)); + + PlatformMoveMemory(pTestBssDesc, pTmpBssDesc, sizeof(RT_WLAN_BSS)); + } + else if(pTestBssDesc->RecvSignalPower > pTmpBssDesc->RecvSignalPower) // Pow(Ant1) < Pow(Ant2) + { + counter++; + tmp_power_diff=(u1Byte)(pTestBssDesc->RecvSignalPower - pTmpBssDesc->RecvSignalPower); + power_diff = power_diff + tmp_power_diff; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Original: %d, Test: %d\n", pTmpBssDesc->RecvSignalPower, pTestBssDesc->RecvSignalPower)); + ODM_PRINT_ADDR(pDM_Odm,ODM_COMP_ANT_DIV, DBG_LOUD, ("SSID:"), pTmpBssDesc->bdSsIdBuf); + ODM_PRINT_ADDR(pDM_Odm,ODM_COMP_ANT_DIV, DBG_LOUD, ("BSSID:"), pTmpBssDesc->bdBssIdBuf); + if(tmp_power_diff > max_power_diff) + max_power_diff=tmp_power_diff; + if(tmp_power_diff < min_power_diff) + min_power_diff=tmp_power_diff; + } + else // Pow(Ant1) = Pow(Ant2) + { + if(pTestBssDesc->bdTstamp > pTmpBssDesc->bdTstamp) // Stamp(Ant1) < Stamp(Ant2) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("time_diff: %lld\n", (pTestBssDesc->bdTstamp-pTmpBssDesc->bdTstamp)/1000)); + if(pTestBssDesc->bdTstamp - pTmpBssDesc->bdTstamp > 5000) + { + counter++; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Original: %d, Test: %d\n", pTmpBssDesc->RecvSignalPower, pTestBssDesc->RecvSignalPower)); + ODM_PRINT_ADDR(pDM_Odm,ODM_COMP_ANT_DIV, DBG_LOUD, ("SSID:"), pTmpBssDesc->bdSsIdBuf); + ODM_PRINT_ADDR(pDM_Odm,ODM_COMP_ANT_DIV, DBG_LOUD, ("BSSID:"), pTmpBssDesc->bdBssIdBuf); + min_power_diff = 0; + } + } + else + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[Error !!!]: Time_diff: %lld\n", (pTestBssDesc->bdTstamp-pTmpBssDesc->bdTstamp)/1000)); + } + } + } + } + } + + if(pDM_Odm->SupportICType & (ODM_RTL8188E|ODM_RTL8821)) + { + if(pMgntInfo->NumBssDesc!=0 && Score<0) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, + ("ODM_SwAntDivCheckBeforeLink(): Using Ant(%s)\n", (pDM_FatTable->RxIdleAnt==MAIN_ANT)?"MAIN_ANT":"AUX_ANT")); + } + else + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, + ("ODM_SwAntDivCheckBeforeLink(): Remain Ant(%s)\n", (pDM_FatTable->RxIdleAnt==MAIN_ANT)?"AUX_ANT":"MAIN_ANT")); + + if(pDM_FatTable->RxIdleAnt == MAIN_ANT) + ODM_UpdateRxIdleAnt(pDM_Odm, AUX_ANT); + else + ODM_UpdateRxIdleAnt(pDM_Odm, MAIN_ANT); + } + + if(IS_5G_WIRELESS_MODE(pMgntInfo->dot11CurrentWirelessMode)) + { + pDM_SWAT_Table->Ant5G = pDM_FatTable->RxIdleAnt; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("pDM_SWAT_Table->Ant5G=%s\n", (pDM_FatTable->RxIdleAnt==MAIN_ANT)?"MAIN_ANT":"AUX_ANT")); + } + else + { + pDM_SWAT_Table->Ant2G = pDM_FatTable->RxIdleAnt; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("pDM_SWAT_Table->Ant2G=%s\n", (pDM_FatTable->RxIdleAnt==MAIN_ANT)?"MAIN_ANT":"AUX_ANT")); + } + } + else if(pDM_Odm->SupportICType == ODM_RTL8723B) + { + if(counter == 0) + { + if(pDM_Odm->DM_SWAT_Table.Pre_Aux_FailDetec == FALSE) + { + pDM_Odm->DM_SWAT_Table.Pre_Aux_FailDetec = TRUE; + pDM_Odm->DM_SWAT_Table.RSSI_AntDect_bResult=FALSE; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Counter=(( 0 )) , [[ Cannot find any AP with Aux-ant ]] -> Scan Target-channel again \n")); + + //3 [ Scan again ] + odm_SwAntDivConstructScanChnl(Adapter, ScanChannel); + PlatformSetTimer(Adapter, &pMgntInfo->ScanTimer, 5); + return TRUE; + } + else// Pre_Aux_FailDetec == TRUE + { + //2 [ Single Antenna ] + pDM_Odm->DM_SWAT_Table.Pre_Aux_FailDetec = FALSE; + pDM_Odm->DM_SWAT_Table.RSSI_AntDect_bResult=TRUE; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Counter=(( 0 )) , [[ Still cannot find any AP ]] \n")); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SwAntDivCheckBeforeLink(): Single antenna\n")); + } + pDM_Odm->DM_SWAT_Table.Aux_FailDetec_Counter++; + } + else + { + pDM_Odm->DM_SWAT_Table.Pre_Aux_FailDetec = FALSE; + + if(counter==3) + { + avg_power_diff = ((power_diff-max_power_diff - min_power_diff)>>1)+ ((max_power_diff + min_power_diff)>>2); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("counter: (( %d )) , power_diff: (( %d )) \n", counter, power_diff)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ counter==3 ] Modified avg_power_diff: (( %d )) , max_power_diff: (( %d )) , min_power_diff: (( %d )) \n", avg_power_diff,max_power_diff, min_power_diff)); + } + else if(counter>=4) + { + avg_power_diff=(power_diff-max_power_diff - min_power_diff) / (counter - 2); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("counter: (( %d )) , power_diff: (( %d )) \n", counter, power_diff)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ counter>=4 ] Modified avg_power_diff: (( %d )) , max_power_diff: (( %d )) , min_power_diff: (( %d )) \n", avg_power_diff,max_power_diff, min_power_diff)); + + } + else//counter==1,2 + { + avg_power_diff=power_diff/counter; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("avg_power_diff: (( %d )) , counter: (( %d )) , power_diff: (( %d )) \n", avg_power_diff,counter, power_diff)); + } + + //2 [ Retry ] + if( (avg_power_diff >=power_target_L) && (avg_power_diff <=power_target_H) ) + { + pDM_Odm->DM_SWAT_Table.Retry_Counter++; + + if(pDM_Odm->DM_SWAT_Table.Retry_Counter<=3) + { + pDM_Odm->DM_SWAT_Table.RSSI_AntDect_bResult=FALSE; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[[ Low confidence result ]] avg_power_diff= (( %d )) -> Scan Target-channel again ]] \n", avg_power_diff)); + + //3 [ Scan again ] + odm_SwAntDivConstructScanChnl(Adapter, ScanChannel); + PlatformSetTimer(Adapter, &pMgntInfo->ScanTimer, 5); + return TRUE; + } + else + { + pDM_Odm->DM_SWAT_Table.RSSI_AntDect_bResult=TRUE; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[[ Still Low confidence result ]] (( Retry_Counter > 3 )) \n")); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SwAntDivCheckBeforeLink(): Single antenna\n")); + } + + } + //2 [ Dual Antenna ] + else if( (pMgntInfo->NumBssDesc != 0) && (avg_power_diff < power_target_L) ) + { + pDM_Odm->DM_SWAT_Table.RSSI_AntDect_bResult=TRUE; + if(pDM_Odm->DM_SWAT_Table.ANTB_ON == FALSE) + { + pDM_Odm->DM_SWAT_Table.ANTA_ON = TRUE; + pDM_Odm->DM_SWAT_Table.ANTB_ON = TRUE; + } + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("ODM_SwAntDivCheckBeforeLink(): Dual antenna\n")); + pDM_Odm->DM_SWAT_Table.Dual_Ant_Counter++; + + // set bt coexDM from 1ant coexDM to 2ant coexDM + BT_SetBtCoexAntNum(Adapter, BT_COEX_ANT_TYPE_DETECTED, 2); + + //3 [ Init antenna diversity ] + pDM_Odm->SupportAbility |= ODM_BB_ANT_DIV; + ODM_AntDivInit(pDM_Odm); + } + //2 [ Single Antenna ] + else if(avg_power_diff > power_target_H) + { + pDM_Odm->DM_SWAT_Table.RSSI_AntDect_bResult=TRUE; + if(pDM_Odm->DM_SWAT_Table.ANTB_ON == TRUE) + { + pDM_Odm->DM_SWAT_Table.ANTA_ON = TRUE; + pDM_Odm->DM_SWAT_Table.ANTB_ON = FALSE; + //BT_SetBtCoexAntNum(Adapter, BT_COEX_ANT_TYPE_DETECTED, 1); + } + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SwAntDivCheckBeforeLink(): Single antenna\n")); + pDM_Odm->DM_SWAT_Table.Single_Ant_Counter++; + } + } + //ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("bResult=(( %d ))\n",pDM_Odm->DM_SWAT_Table.RSSI_AntDect_bResult)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("Dual_Ant_Counter = (( %d )), Single_Ant_Counter = (( %d )) , Retry_Counter = (( %d )) , Aux_FailDetec_Counter = (( %d ))\n\n\n", + pDM_Odm->DM_SWAT_Table.Dual_Ant_Counter,pDM_Odm->DM_SWAT_Table.Single_Ant_Counter,pDM_Odm->DM_SWAT_Table.Retry_Counter,pDM_Odm->DM_SWAT_Table.Aux_FailDetec_Counter)); + + //2 recover the antenna setting + + if(pDM_Odm->DM_SWAT_Table.ANTB_ON == FALSE) + ODM_SetBBReg(pDM_Odm, rS0S1_PathSwitch, 0xfff, (pDM_SWAT_Table->SWAS_NoLink_BK_Reg948)); + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("bResult=(( %d )), Recover Reg[948]= (( %x )) \n\n",pDM_Odm->DM_SWAT_Table.RSSI_AntDect_bResult, pDM_SWAT_Table->SWAS_NoLink_BK_Reg948 )); + + + } + else if(pDM_Odm->SupportICType == ODM_RTL8192C) + { + if(pMgntInfo->NumBssDesc!=0 && Score<=0) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, + ("ODM_SwAntDivCheckBeforeLink(): Using Ant(%s)\n", (pDM_SWAT_Table->CurAntenna==MAIN_ANT)?"MAIN":"AUX")); + + pDM_SWAT_Table->PreAntenna = pDM_SWAT_Table->CurAntenna; + } + else + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, + ("ODM_SwAntDivCheckBeforeLink(): Remain Ant(%s)\n", (pDM_SWAT_Table->CurAntenna==MAIN_ANT)?"AUX":"MAIN")); + + pDM_SWAT_Table->CurAntenna = pDM_SWAT_Table->PreAntenna; + + //PHY_SetBBReg(Adapter, rFPGA0_XA_RFInterfaceOE, 0x300, DM_SWAT_Table.CurAntenna); + pDM_SWAT_Table->SWAS_NoLink_BK_Reg860 = ((pDM_SWAT_Table->SWAS_NoLink_BK_Reg860 & 0xfffffcff) | (pDM_SWAT_Table->CurAntenna<<8)); + PHY_SetBBReg(Adapter, rFPGA0_XA_RFInterfaceOE, bMaskDWord, pDM_SWAT_Table->SWAS_NoLink_BK_Reg860); + } + } + + // Check state reset to default and wait for next time. + pDM_SWAT_Table->SWAS_NoLink_State = 0; + pMgntInfo->bScanAntDetect = FALSE; + + return FALSE; + } + +#else + return FALSE; +#endif + +return FALSE; +} + + + + + + +//1 [3. PSD Method] ========================================================== + + + + +u4Byte +odm_GetPSDData( + IN PVOID pDM_VOID, + IN u2Byte point, + IN u1Byte initial_gain) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + u4Byte psd_report; + + ODM_SetBBReg(pDM_Odm, 0x808, 0x3FF, point); + ODM_SetBBReg(pDM_Odm, 0x808, BIT22, 1); //Start PSD calculation, Reg808[22]=0->1 + ODM_StallExecution(150);//Wait for HW PSD report + ODM_SetBBReg(pDM_Odm, 0x808, BIT22, 0);//Stop PSD calculation, Reg808[22]=1->0 + psd_report = ODM_GetBBReg(pDM_Odm,0x8B4, bMaskDWord) & 0x0000FFFF;//Read PSD report, Reg8B4[15:0] + + psd_report = (u4Byte) (odm_ConvertTo_dB(psd_report));//+(u4Byte)(initial_gain); + return psd_report; +} + + + +VOID +ODM_SingleDualAntennaDetection_PSD( + IN PVOID pDM_VOID +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PADAPTER pAdapter = pDM_Odm->Adapter; + pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; + u4Byte Channel_ori; + u1Byte initial_gain = 0x36; + u1Byte tone_idx; + u1Byte Tone_lenth_1=7, Tone_lenth_2=4; + u2Byte Tone_idx_1[7]={88, 104, 120, 8, 24, 40, 56}; + u2Byte Tone_idx_2[4]={8, 24, 40, 56}; + u4Byte PSD_report_Main[11]={0}, PSD_report_Aux[11]={0}; + //u1Byte Tone_lenth_1=4, Tone_lenth_2=2; + //u2Byte Tone_idx_1[4]={88, 120, 24, 56}; + //u2Byte Tone_idx_2[2]={ 24, 56}; + //u4Byte PSD_report_Main[6]={0}, PSD_report_Aux[6]={0}; + + u4Byte PSD_report_temp,MAX_PSD_report_Main=0,MAX_PSD_report_Aux=0; + u4Byte PSD_power_threshold; + u4Byte Main_psd_result=0, Aux_psd_result=0; + u4Byte Regc50, Reg948, Regb2c,Regc14,Reg908; + u4Byte i=0,test_num=8; + + + if(pDM_Odm->SupportICType != ODM_RTL8723B) + return; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SingleDualAntennaDetection_PSD()============> \n")); + + //2 [ Backup Current RF/BB Settings ] + + Channel_ori = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_A, ODM_CHANNEL, bRFRegOffsetMask); + Reg948 = ODM_GetBBReg(pDM_Odm, rS0S1_PathSwitch, bMaskDWord); + Regb2c = ODM_GetBBReg(pDM_Odm, rAGC_table_select, bMaskDWord); + Regc50 = ODM_GetBBReg(pDM_Odm, rOFDM0_XAAGCCore1, bMaskDWord); + Regc14 = ODM_GetBBReg(pDM_Odm, 0xc14, bMaskDWord); + Reg908 = ODM_GetBBReg(pDM_Odm, 0x908, bMaskDWord); + + //2 [ Setting for doing PSD function (CH4)] + ODM_SetBBReg(pDM_Odm, rFPGA0_RFMOD, BIT24, 0); //disable whole CCK block + ODM_Write1Byte(pDM_Odm, REG_TXPAUSE, 0xFF); // Turn off TX -> Pause TX Queue + ODM_SetBBReg(pDM_Odm, 0xC14, bMaskDWord, 0x0); // [ Set IQK Matrix = 0 ] equivalent to [ Turn off CCA] + + // PHYTXON while loop + ODM_SetBBReg(pDM_Odm, 0x908, bMaskDWord, 0x803); + while (ODM_GetBBReg(pDM_Odm, 0xdf4, BIT6)) + { + i++; + if (i > 1000000) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Wait in %s() more than %d times!\n", __FUNCTION__, i)); + break; + } + } + + ODM_SetBBReg(pDM_Odm, 0xc50, 0x7f, initial_gain); + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, ODM_CHANNEL, 0x7ff, 0x04); // Set RF to CH4 & 40M + ODM_SetBBReg(pDM_Odm, rFPGA0_AnalogParameter4, 0xf00000, 0xf); // 3 wire Disable 88c[23:20]=0xf + ODM_SetBBReg(pDM_Odm, rFPGA0_PSDFunction, BIT14|BIT15, 0x0); //128 pt //Set PSD 128 ptss + ODM_StallExecution(3000); + + + //2 [ Doing PSD Function in (CH4)] + + //Antenna A + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Switch to Main-ant (CH4)\n")); + ODM_SetBBReg(pDM_Odm, 0x948, 0xfff, 0x200); + ODM_StallExecution(10); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("dbg\n")); + for (i=0;iPSD_report_Main[tone_idx] ) + PSD_report_Main[tone_idx]+=PSD_report_temp; + } + } + //Antenna B + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Switch to Aux-ant (CH4)\n")); + ODM_SetBBReg(pDM_Odm, 0x948, 0xfff, 0x280); + ODM_StallExecution(10); + for (i=0;iPSD_report_Aux[tone_idx] ) + PSD_report_Aux[tone_idx]+=PSD_report_temp; + } + } + //2 [ Doing PSD Function in (CH8)] + + ODM_SetBBReg(pDM_Odm, rFPGA0_AnalogParameter4, 0xf00000, 0x0); // 3 wire enable 88c[23:20]=0x0 + ODM_StallExecution(3000); + + ODM_SetBBReg(pDM_Odm, 0xc50, 0x7f, initial_gain); + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, ODM_CHANNEL, 0x7ff, 0x04); // Set RF to CH8 & 40M + + ODM_SetBBReg(pDM_Odm, rFPGA0_AnalogParameter4, 0xf00000, 0xf); // 3 wire Disable 88c[23:20]=0xf + ODM_StallExecution(3000); + + //Antenna A + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Switch to Main-ant (CH8)\n")); + ODM_SetBBReg(pDM_Odm, 0x948, 0xfff, 0x200); + ODM_StallExecution(10); + + for (i=0;iPSD_report_Main[tone_idx] ) + PSD_report_Main[Tone_lenth_1+tone_idx]+=PSD_report_temp; + } + } + + //Antenna B + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Switch to Aux-ant (CH8)\n")); + ODM_SetBBReg(pDM_Odm, 0x948, 0xfff, 0x280); + ODM_StallExecution(10); + + for (i=0;iPSD_report_Aux[tone_idx] ) + PSD_report_Aux[Tone_lenth_1+tone_idx]+=PSD_report_temp; + } + } + + //2 [ Calculate Result ] + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("\nMain PSD Result: (ALL) \n")); + for (tone_idx=0;tone_idx<(Tone_lenth_1+Tone_lenth_2);tone_idx++) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[Tone-%d]: %d, \n",(tone_idx+1), PSD_report_Main[tone_idx] )); + Main_psd_result+= PSD_report_Main[tone_idx]; + if(PSD_report_Main[tone_idx]>MAX_PSD_report_Main) + MAX_PSD_report_Main=PSD_report_Main[tone_idx]; + } + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("--------------------------- \nTotal_Main= (( %d ))\n", Main_psd_result)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("MAX_Main = (( %d ))\n", MAX_PSD_report_Main)); + + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("\nAux PSD Result: (ALL) \n")); + for (tone_idx=0;tone_idx<(Tone_lenth_1+Tone_lenth_2);tone_idx++) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[Tone-%d]: %d, \n",(tone_idx+1), PSD_report_Aux[tone_idx] )); + Aux_psd_result+= PSD_report_Aux[tone_idx]; + if(PSD_report_Aux[tone_idx]>MAX_PSD_report_Aux) + MAX_PSD_report_Aux=PSD_report_Aux[tone_idx]; + } + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("--------------------------- \nTotal_Aux= (( %d ))\n", Aux_psd_result)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("MAX_Aux = (( %d ))\n\n", MAX_PSD_report_Aux)); + + //Main_psd_result=Main_psd_result-MAX_PSD_report_Main; + //Aux_psd_result=Aux_psd_result-MAX_PSD_report_Aux; + PSD_power_threshold=(Main_psd_result*7)>>3; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ Main_result , Aux_result ] = [ %d , %d ], PSD_power_threshold=(( %d ))\n", Main_psd_result, Aux_psd_result,PSD_power_threshold)); + + //3 [ Dual Antenna ] + if(Aux_psd_result >= PSD_power_threshold ) + { + if(pDM_Odm->DM_SWAT_Table.ANTB_ON == FALSE) + { + pDM_Odm->DM_SWAT_Table.ANTA_ON = TRUE; + pDM_Odm->DM_SWAT_Table.ANTB_ON = TRUE; + } + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("ODM_SwAntDivCheckBeforeLink(): Dual antenna\n")); + + // set bt coexDM from 1ant coexDM to 2ant coexDM + //BT_SetBtCoexAntNum(pAdapter, BT_COEX_ANT_TYPE_DETECTED, 2); + + // Init antenna diversity + pDM_Odm->SupportAbility |= ODM_BB_ANT_DIV; + ODM_AntDivInit(pDM_Odm); + } + //3 [ Single Antenna ] + else + { + if(pDM_Odm->DM_SWAT_Table.ANTB_ON == TRUE) + { + pDM_Odm->DM_SWAT_Table.ANTA_ON = TRUE; + pDM_Odm->DM_SWAT_Table.ANTB_ON = FALSE; + } + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SwAntDivCheckBeforeLink(): Single antenna\n")); + } + + //2 [ Recover all parameters ] + + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_CHNLBW, bRFRegOffsetMask,Channel_ori); + ODM_SetBBReg(pDM_Odm, rFPGA0_AnalogParameter4, 0xf00000, 0x0); // 3 wire enable 88c[23:20]=0x0 + ODM_SetBBReg(pDM_Odm, 0xc50, 0x7f, Regc50); + + ODM_SetBBReg(pDM_Odm, rS0S1_PathSwitch, bMaskDWord, Reg948); + ODM_SetBBReg(pDM_Odm, rAGC_table_select, bMaskDWord, Regb2c); + + ODM_SetBBReg(pDM_Odm, rFPGA0_RFMOD, BIT24, 1); //enable whole CCK block + ODM_Write1Byte(pDM_Odm, REG_TXPAUSE, 0x0); //Turn on TX // Resume TX Queue + ODM_SetBBReg(pDM_Odm, 0xC14, bMaskDWord, Regc14); // [ Set IQK Matrix = 0 ] equivalent to [ Turn on CCA] + ODM_SetBBReg(pDM_Odm, 0x908, bMaskDWord, Reg908); + + return; + +} + +#endif +void +odm_SwAntDetectInit( + IN PVOID pDM_VOID + ) +{ +#if(defined(CONFIG_ANT_DETECTION)) + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; + + //pDM_SWAT_Table->SWAS_NoLink_BK_Reg92c = ODM_Read4Byte(pDM_Odm, rDPDT_control); + //pDM_SWAT_Table->PreAntenna = MAIN_ANT; + //pDM_SWAT_Table->CurAntenna = MAIN_ANT; + pDM_SWAT_Table->SWAS_NoLink_State = 0; + pDM_SWAT_Table->Pre_Aux_FailDetec = FALSE; + pDM_SWAT_Table->SWAS_NoLink_BK_Reg948 = 0xff; +#endif +} + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_AntDect.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_AntDect.h new file mode 100644 index 00000000000000..fe5bfa4ab8a142 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_AntDect.h @@ -0,0 +1,98 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +#ifndef __PHYDMANTDECT_H__ +#define __PHYDMANTDECT_H__ + +#define ANTDECT_VERSION "2.0" //2014.11.04 + +#if(defined(CONFIG_ANT_DETECTION)) +//#if( DM_ODM_SUPPORT_TYPE & (ODM_WIN |ODM_CE)) +//ANT Test +#define ANTTESTALL 0x00 //Ant A or B will be Testing +#define ANTTESTA 0x01 //Ant A will be Testing +#define ANTTESTB 0x02 //Ant B will be testing + +#define MAX_ANTENNA_DETECTION_CNT 10 + + +typedef struct _ANT_DETECTED_INFO{ + BOOLEAN bAntDetected; + u4Byte dBForAntA; + u4Byte dBForAntB; + u4Byte dBForAntO; +}ANT_DETECTED_INFO, *PANT_DETECTED_INFO; + + +typedef enum tag_SW_Antenna_Switch_Definition +{ + Antenna_A = 1, + Antenna_B = 2, + Antenna_MAX = 3, +}DM_SWAS_E; + + + +//1 [1. Single Tone Method] =================================================== + + + +VOID +ODM_SingleDualAntennaDefaultSetting( + IN PVOID pDM_VOID + ); + +BOOLEAN +ODM_SingleDualAntennaDetection( + IN PVOID pDM_VOID, + IN u1Byte mode + ); + +//1 [2. Scan AP RSSI Method] ================================================== + +#define SwAntDivCheckBeforeLink ODM_SwAntDivCheckBeforeLink + +BOOLEAN +ODM_SwAntDivCheckBeforeLink( + IN PVOID pDM_VOID + ); + + + + +//1 [3. PSD Method] ========================================================== + + +VOID +ODM_SingleDualAntennaDetection_PSD( + IN PVOID pDM_VOID +); + +#endif + +VOID +odm_SwAntDetectInit( + IN PVOID pDM_VOID + ); + + +#endif + + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_AntDiv.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_AntDiv.c new file mode 100644 index 00000000000000..5966b0c826a8e8 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_AntDiv.c @@ -0,0 +1,4059 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +//============================================================ +// include files +//============================================================ + +#include "Mp_Precomp.h" +#include "phydm_precomp.h" + +//====================================================== +// when antenna test utility is on or some testing need to disable antenna diversity +// call this function to disable all ODM related mechanisms which will switch antenna. +//====================================================== +VOID +ODM_StopAntennaSwitchDm( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + // disable ODM antenna diversity + pDM_Odm->SupportAbility &= ~ODM_BB_ANT_DIV; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("STOP Antenna Diversity \n")); +} + +VOID +ODM_SetAntConfig( + IN PVOID pDM_VOID, + IN u1Byte antSetting // 0=A, 1=B, 2=C, .... + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + if(pDM_Odm->SupportICType == ODM_RTL8723B) + { + if(antSetting == 0) // ant A + ODM_SetBBReg(pDM_Odm, 0x948, bMaskDWord, 0x00000000); + else if(antSetting == 1) + ODM_SetBBReg(pDM_Odm, 0x948, bMaskDWord, 0x00000280); + } +} + +//====================================================== + + +VOID +ODM_SwAntDivRestAfterLink( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; + pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; + u4Byte i; + + if(pDM_Odm->SupportICType == ODM_RTL8723A) + { + pDM_SWAT_Table->RSSI_cnt_A = 0; + pDM_SWAT_Table->RSSI_cnt_B = 0; + pDM_Odm->RSSI_test = FALSE; + pDM_SWAT_Table->try_flag = 0xff; + pDM_SWAT_Table->RSSI_Trying = 0; + pDM_SWAT_Table->SelectAntennaMap=0xAA; + + } + else if(pDM_Odm->SupportICType & (ODM_RTL8723B|ODM_RTL8821)) + { + pDM_Odm->RSSI_test = FALSE; + pDM_SWAT_Table->try_flag = 0xff; + pDM_SWAT_Table->RSSI_Trying = 0; + pDM_SWAT_Table->Double_chk_flag= 0; + + pDM_FatTable->RxIdleAnt=MAIN_ANT; + + for (i=0; iMainAnt_Sum[i] = 0; + pDM_FatTable->AuxAnt_Sum[i] = 0; + pDM_FatTable->MainAnt_Cnt[i] = 0; + pDM_FatTable->AuxAnt_Cnt[i] = 0; + } + + } +} + + +#if (defined(CONFIG_HW_ANTENNA_DIVERSITY)) +VOID +odm_AntDiv_on_off( + IN PVOID pDM_VOID , + IN u1Byte swch + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; + + if(pDM_FatTable->AntDiv_OnOff != swch) + { + if(pDM_Odm->AntDivType==S0S1_SW_ANTDIV || pDM_Odm->AntDivType==CGCS_RX_SW_ANTDIV) + return; + + if(pDM_Odm->SupportICType & ODM_N_ANTDIV_SUPPORT) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("(( Turn %s )) N-Series HW-AntDiv block\n",(swch==ANTDIV_ON)?"ON" : "OFF")); + ODM_SetBBReg(pDM_Odm, 0xc50 , BIT7, swch); //OFDM AntDiv function block enable + ODM_SetBBReg(pDM_Odm, 0xa00 , BIT15, swch); //CCK AntDiv function block enable + } + else if(pDM_Odm->SupportICType & ODM_AC_ANTDIV_SUPPORT) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("(( Turn %s )) AC-Series HW-AntDiv block\n",(swch==ANTDIV_ON)?"ON" : "OFF")); + if(pDM_Odm->SupportICType == ODM_RTL8812) + { + ODM_SetBBReg(pDM_Odm, 0xc50 , BIT7, swch); //OFDM AntDiv function block enable + ODM_SetBBReg(pDM_Odm, 0xa00 , BIT15, swch); //CCK AntDiv function block enable + } + else + { + ODM_SetBBReg(pDM_Odm, 0x8D4 , BIT24, swch); //OFDM AntDiv function block enable + + if( (pDM_Odm->CutVersion >= ODM_CUT_C) && (pDM_Odm->SupportICType == ODM_RTL8821) && ( pDM_Odm->AntDivType != S0S1_SW_ANTDIV)) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("(( Turn %s )) CCK HW-AntDiv block\n",(swch==ANTDIV_ON)?"ON" : "OFF")); + ODM_SetBBReg(pDM_Odm, 0x800 , BIT25, swch); + ODM_SetBBReg(pDM_Odm, 0xA00 , BIT15, swch); //CCK AntDiv function block enable + } + } + } + } + pDM_FatTable->AntDiv_OnOff =swch; + +} + +VOID +odm_FastTraining_enable( + IN PVOID pDM_VOID, + IN u1Byte swch + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + u1Byte enable; + + if( swch== FAT_ON) + enable=1; + else + enable=0; + + if(pDM_Odm->SupportICType == ODM_RTL8188E) + { + + ODM_SetBBReg(pDM_Odm, 0xe08 , BIT16, enable); //enable fast training + } + else if(pDM_Odm->SupportICType == ODM_RTL8192E) + { + ODM_SetBBReg(pDM_Odm, 0xB34 , BIT28, enable); //enable fast training (path-A) + //ODM_SetBBReg(pDM_Odm, 0xB34 , BIT29, enable); //enable fast training (path-B) + } +} + +VOID +odm_Tx_By_TxDesc_or_Reg( + IN PVOID pDM_VOID, + IN u1Byte swch + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + u1Byte enable; + + if( swch== TX_BY_DESC) + enable=1; + else + enable=0; + + if(pDM_Odm->AntDivType != CGCS_RX_HW_ANTDIV) + { + if(pDM_Odm->SupportICType & ODM_N_ANTDIV_SUPPORT) + { + ODM_SetBBReg(pDM_Odm, 0x80c , BIT21, enable); + } + else if(pDM_Odm->SupportICType & ODM_AC_ANTDIV_SUPPORT) + { + ODM_SetBBReg(pDM_Odm, 0x900 , BIT18, enable); + } + } +} + +VOID +ODM_UpdateRxIdleAnt( + IN PVOID pDM_VOID, + IN u1Byte Ant + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; + u4Byte DefaultAnt, OptionalAnt,value32; + + //#if (DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_WIN)) + //PADAPTER pAdapter = pDM_Odm->Adapter; + //HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); + //#endif + + if(pDM_FatTable->RxIdleAnt != Ant) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ Update Rx-Idle-Ant ] RxIdleAnt =%s\n",(Ant==MAIN_ANT)?"MAIN_ANT":"AUX_ANT")); + + if(!(pDM_Odm->SupportICType & ODM_RTL8723B)) + pDM_FatTable->RxIdleAnt = Ant; + + if(Ant == MAIN_ANT) + { + DefaultAnt = ANT1_2G; + OptionalAnt = ANT2_2G; + } + else + { + DefaultAnt = ANT2_2G; + OptionalAnt = ANT1_2G; + } + + if(pDM_Odm->SupportICType & ODM_N_ANTDIV_SUPPORT) + { + if(pDM_Odm->SupportICType==ODM_RTL8192E) + { + ODM_SetBBReg(pDM_Odm, 0xB38 , BIT5|BIT4|BIT3, DefaultAnt); //Default RX + ODM_SetBBReg(pDM_Odm, 0xB38 , BIT8|BIT7|BIT6, OptionalAnt);//Optional RX + ODM_SetBBReg(pDM_Odm, 0x860, BIT14|BIT13|BIT12, DefaultAnt);//Default TX + } + #if (RTL8723B_SUPPORT == 1) + else if(pDM_Odm->SupportICType==ODM_RTL8723B) + { + value32 = ODM_GetBBReg(pDM_Odm, 0x948, 0xFFF); + + if(value32 !=0x280) + ODM_UpdateRxIdleAnt_8723B(pDM_Odm, Ant, DefaultAnt, OptionalAnt); + else + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ Update Rx-Idle-Ant ] 8723B: Fail to set RX antenna due to 0x948 = 0x280\n")); + } + #endif + else //88E + { + ODM_SetBBReg(pDM_Odm, 0x864 , BIT5|BIT4|BIT3, DefaultAnt); //Default RX + ODM_SetBBReg(pDM_Odm, 0x864 , BIT8|BIT7|BIT6, OptionalAnt); //Optional RX + ODM_SetBBReg(pDM_Odm, 0x860, BIT14|BIT13|BIT12, DefaultAnt); //Default TX + } + } + else if(pDM_Odm->SupportICType & ODM_AC_ANTDIV_SUPPORT) + { + u2Byte value16 = ODM_Read2Byte(pDM_Odm, ODM_REG_TRMUX_11AC+2); + // + // 2014/01/14 MH/Luke.Lee Add direct write for register 0xc0a to prevnt + // incorrect 0xc08 bit0-15 .We still not know why it is changed. + // + value16 &= ~(BIT11|BIT10|BIT9|BIT8|BIT7|BIT6|BIT5|BIT4|BIT3); + value16 |= ((u2Byte)DefaultAnt <<3); + value16 |= ((u2Byte)OptionalAnt <<6); + value16 |= ((u2Byte)DefaultAnt <<9); + ODM_Write2Byte(pDM_Odm, ODM_REG_TRMUX_11AC+2, value16); + /* + ODM_SetBBReg(pDM_Odm, ODM_REG_TRMUX_11AC , BIT21|BIT20|BIT19, DefaultAnt); //Default RX + ODM_SetBBReg(pDM_Odm, ODM_REG_TRMUX_11AC , BIT24|BIT23|BIT22, OptionalAnt);//Optional RX + ODM_SetBBReg(pDM_Odm, ODM_REG_TRMUX_11AC , BIT27|BIT26|BIT25, DefaultAnt); //Default TX + */ + } + + if(pDM_Odm->SupportICType==ODM_RTL8188E) + { + ODM_SetMACReg(pDM_Odm, 0x6D8 , BIT7|BIT6, DefaultAnt); //PathA Resp Tx + } + else + { + ODM_SetMACReg(pDM_Odm, 0x6D8 , BIT10|BIT9|BIT8, DefaultAnt); //PathA Resp Tx + } + + } + else// pDM_FatTable->RxIdleAnt == Ant + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ Stay in Ori-Ant ] RxIdleAnt =%s\n",(Ant==MAIN_ANT)?"MAIN_ANT":"AUX_ANT")); + pDM_FatTable->RxIdleAnt = Ant; + } +} + + +VOID +odm_UpdateTxAnt( + IN PVOID pDM_VOID, + IN u1Byte Ant, + IN u4Byte MacId + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; + u1Byte TxAnt; + + if (pDM_Odm->AntDivType==CG_TRX_SMART_ANTDIV) + { + TxAnt=Ant; + } + else + { + if(Ant == MAIN_ANT) + TxAnt = ANT1_2G; + else + TxAnt = ANT2_2G; + } + + pDM_FatTable->antsel_a[MacId] = TxAnt&BIT0; + pDM_FatTable->antsel_b[MacId] = (TxAnt&BIT1)>>1; + pDM_FatTable->antsel_c[MacId] = (TxAnt&BIT2)>>2; + + //ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[Tx from TxInfo]: MacID:(( %d )), TxAnt = (( %s ))\n", MacId,(Ant==MAIN_ANT)?"MAIN_ANT":"AUX_ANT")); + //ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("antsel_tr_mux=(( 3'b%d%d%d ))\n",pDM_FatTable->antsel_c[MacId] , pDM_FatTable->antsel_b[MacId] , pDM_FatTable->antsel_a[MacId] )); + +} + +#ifdef BEAMFORMING_SUPPORT +#if(DM_ODM_SUPPORT_TYPE == ODM_AP) + +VOID +odm_BDC_Init( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pBDC_T pDM_BdcTable=&pDM_Odm->DM_BdcTable; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("\n[ BDC Initialization......] \n")); + pDM_BdcTable->BDC_state=BDC_DIV_TRAIN_STATE; + pDM_BdcTable->BDC_Mode=BDC_MODE_NULL; + pDM_BdcTable->BDC_Try_flag=0; + pDM_BdcTable->BDCcoexType_wBfer=0; + pDM_Odm->bdc_holdstate=0xff; + + if(pDM_Odm->SupportICType == ODM_RTL8192E) + { + ODM_SetBBReg(pDM_Odm, 0xd7c , 0x0FFFFFFF, 0x1081008); + ODM_SetBBReg(pDM_Odm, 0xd80 , 0x0FFFFFFF, 0); + } + else if(pDM_Odm->SupportICType == ODM_RTL8812) + { + ODM_SetBBReg(pDM_Odm, 0x9b0 , 0x0FFFFFFF, 0x1081008); //0x9b0[30:0] = 01081008 + ODM_SetBBReg(pDM_Odm, 0x9b4 , 0x0FFFFFFF, 0); //0x9b4[31:0] = 00000000 + } + +} + + +VOID +odm_CSI_on_off( + IN PVOID pDM_VOID, + IN u1Byte CSI_en + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + if(CSI_en==CSI_ON) + { + if(pDM_Odm->SupportICType == ODM_RTL8192E) + { + ODM_SetMACReg(pDM_Odm, 0xd84 , BIT11, 1); //0xd84[11]=1 + } + else if(pDM_Odm->SupportICType == ODM_RTL8812) + { + ODM_SetMACReg(pDM_Odm, 0x9b0 , BIT31, 1); //0x9b0[31]=1 + } + + } + else if(CSI_en==CSI_OFF) + { + if(pDM_Odm->SupportICType == ODM_RTL8192E) + { + ODM_SetMACReg(pDM_Odm, 0xd84 , BIT11, 0); //0xd84[11]=0 + } + else if(pDM_Odm->SupportICType == ODM_RTL8812) + { + ODM_SetMACReg(pDM_Odm, 0x9b0 , BIT31, 0); //0x9b0[31]=0 + } + } +} + +VOID +odm_BDCcoexType_withBferClient( + IN PVOID pDM_VOID, + IN u1Byte swch + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pBDC_T pDM_BdcTable = &pDM_Odm->DM_BdcTable; + u1Byte BDCcoexType_wBfer; + + if(swch==DIVON_CSIOFF) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[BDCcoexType: 1] {DIV,CSI} ={1,0} \n")); + BDCcoexType_wBfer=1; + + if(BDCcoexType_wBfer != pDM_BdcTable->BDCcoexType_wBfer) + { + odm_AntDiv_on_off(pDM_Odm, ANTDIV_ON); + odm_CSI_on_off(pDM_Odm,CSI_OFF); + pDM_BdcTable->BDCcoexType_wBfer=1; + } + } + else if(swch==DIVOFF_CSION) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[BDCcoexType: 2] {DIV,CSI} ={0,1}\n")); + BDCcoexType_wBfer=2; + + if(BDCcoexType_wBfer != pDM_BdcTable->BDCcoexType_wBfer) + { + odm_AntDiv_on_off(pDM_Odm, ANTDIV_OFF); + odm_CSI_on_off(pDM_Odm,CSI_ON); + pDM_BdcTable->BDCcoexType_wBfer=2; + } + } +} + +VOID +odm_BF_AntDiv_ModeArbitration( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pBDC_T pDM_BdcTable = &pDM_Odm->DM_BdcTable; + u1Byte current_BDC_Mode; + + #if(DM_ODM_SUPPORT_TYPE == ODM_AP) + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("\n")); + + //2 Mode 1 + if((pDM_BdcTable->num_Txbfee_Client !=0) && (pDM_BdcTable->num_Txbfer_Client == 0)) + { + current_BDC_Mode=BDC_MODE_1; + + if(current_BDC_Mode != pDM_BdcTable->BDC_Mode) + { + pDM_BdcTable->BDC_Mode=BDC_MODE_1; + odm_BDCcoexType_withBferClient( pDM_Odm, DIVON_CSIOFF); + pDM_BdcTable->BDC_RxIdleUpdate_counter=1; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Change to (( Mode1 ))\n")); + } + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[Antdiv + BF coextance Mode] : (( Mode1 ))\n")); + } + //2 Mode 2 + else if((pDM_BdcTable->num_Txbfee_Client ==0) && (pDM_BdcTable->num_Txbfer_Client != 0)) + { + current_BDC_Mode=BDC_MODE_2; + + if(current_BDC_Mode != pDM_BdcTable->BDC_Mode) + { + pDM_BdcTable->BDC_Mode=BDC_MODE_2; + pDM_BdcTable->BDC_state=BDC_DIV_TRAIN_STATE; + pDM_BdcTable->BDC_Try_flag=0; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Change to (( Mode2 ))\n")); + + } + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[Antdiv + BF coextance Mode] : (( Mode2 ))\n")); + } + //2 Mode 3 + else if((pDM_BdcTable->num_Txbfee_Client !=0) && (pDM_BdcTable->num_Txbfer_Client != 0)) + { + current_BDC_Mode=BDC_MODE_3; + + if(current_BDC_Mode != pDM_BdcTable->BDC_Mode) + { + pDM_BdcTable->BDC_Mode=BDC_MODE_3; + pDM_BdcTable->BDC_state=BDC_DIV_TRAIN_STATE; + pDM_BdcTable->BDC_Try_flag=0; + pDM_BdcTable->BDC_RxIdleUpdate_counter=1; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Change to (( Mode3 ))\n")); + } + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[Antdiv + BF coextance Mode] : (( Mode3 ))\n")); + } + //2 Mode 4 + else if((pDM_BdcTable->num_Txbfee_Client ==0) && (pDM_BdcTable->num_Txbfer_Client == 0)) + { + current_BDC_Mode=BDC_MODE_4; + + if(current_BDC_Mode != pDM_BdcTable->BDC_Mode) + { + pDM_BdcTable->BDC_Mode=BDC_MODE_4; + odm_BDCcoexType_withBferClient( pDM_Odm, DIVON_CSIOFF); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Change to (( Mode4 ))\n")); + } + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[Antdiv + BF coextance Mode] : (( Mode4 ))\n")); + } + #endif + +} + +VOID +odm_DivTrainState_setting( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pBDC_T pDM_BdcTable=&pDM_Odm->DM_BdcTable; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("\n*****[S T A R T ]***** [2-0. DIV_TRAIN_STATE] \n")); + pDM_BdcTable->BDC_Try_counter =2; + pDM_BdcTable->BDC_Try_flag=1; + pDM_BdcTable->BDC_state=BDC_BFer_TRAIN_STATE; + odm_BDCcoexType_withBferClient( pDM_Odm, DIVON_CSIOFF); +} + +VOID +odm_BDCcoex_BFeeRxDiv_Arbitration( + IN PVOID pDM_VOID +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pBDC_T pDM_BdcTable = &pDM_Odm->DM_BdcTable; + BOOLEAN StopBF_flag; + u1Byte BDC_active_Mode; + + + #if(DM_ODM_SUPPORT_TYPE == ODM_AP) + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***{ num_BFee, num_BFer , num_Client} = (( %d , %d , %d)) \n",pDM_BdcTable->num_Txbfee_Client,pDM_BdcTable->num_Txbfer_Client,pDM_BdcTable->num_Client)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***{ num_BF_tars, num_DIV_tars } = (( %d , %d )) \n",pDM_BdcTable->num_BfTar , pDM_BdcTable->num_DivTar )); + + //2 [ MIB control ] + if (pDM_Odm->bdc_holdstate==2) + { + odm_BDCcoexType_withBferClient( pDM_Odm, DIVOFF_CSION); + pDM_BdcTable->BDC_state=BDC_BF_HOLD_STATE; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Force in [ BF STATE] \n")); + return; + } + else if (pDM_Odm->bdc_holdstate==1) + { + pDM_BdcTable->BDC_state=BDC_DIV_HOLD_STATE; + odm_BDCcoexType_withBferClient( pDM_Odm, DIVON_CSIOFF); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Force in [ DIV STATE] \n")); + return; + } + + //------------------------------------------------------------ + + + + //2 Mode 2 & 3 + if(pDM_BdcTable->BDC_Mode==BDC_MODE_2 ||pDM_BdcTable->BDC_Mode==BDC_MODE_3) + { + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("\n{ Try_flag , Try_counter } = { %d , %d } \n",pDM_BdcTable->BDC_Try_flag,pDM_BdcTable->BDC_Try_counter)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("BDCcoexType = (( %d )) \n\n", pDM_BdcTable->BDCcoexType_wBfer)); + + // All Client have Bfer-Cap------------------------------- + if(pDM_BdcTable->num_Txbfer_Client == pDM_BdcTable->num_Client) //BFer STA Only?: yes + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("BFer STA only? (( Yes ))\n")); + pDM_BdcTable->BDC_Try_flag=0; + pDM_BdcTable->BDC_state=BDC_DIV_TRAIN_STATE; + odm_BDCcoexType_withBferClient( pDM_Odm, DIVOFF_CSION); + return; + } + else + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("BFer STA only? (( No ))\n")); + } + // + if(pDM_BdcTable->bAll_BFSta_Idle==FALSE && pDM_BdcTable->bAll_DivSta_Idle==TRUE) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("All DIV-STA are idle, but BF-STA not\n")); + pDM_BdcTable->BDC_Try_flag=0; + pDM_BdcTable->BDC_state=BDC_BFer_TRAIN_STATE; + odm_BDCcoexType_withBferClient( pDM_Odm, DIVOFF_CSION); + return; + } + else if(pDM_BdcTable->bAll_BFSta_Idle==TRUE && pDM_BdcTable->bAll_DivSta_Idle==FALSE) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("All BF-STA are idle, but DIV-STA not\n")); + pDM_BdcTable->BDC_Try_flag=0; + pDM_BdcTable->BDC_state=BDC_DIV_TRAIN_STATE; + odm_BDCcoexType_withBferClient( pDM_Odm, DIVON_CSIOFF); + return; + } + + //Select active mode-------------------------------------- + if(pDM_BdcTable->num_BfTar ==0) // Selsect_1, Selsect_2 + { + if(pDM_BdcTable->num_DivTar ==0) // Selsect_3 + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Select active mode (( 1 )) \n")); + pDM_BdcTable->BDC_active_Mode=1; + } + else + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Select active mode (( 2 ))\n")); + pDM_BdcTable->BDC_active_Mode=2; + } + pDM_BdcTable->BDC_Try_flag=0; + pDM_BdcTable->BDC_state=BDC_DIV_TRAIN_STATE; + odm_BDCcoexType_withBferClient( pDM_Odm, DIVON_CSIOFF); + return; + } + else // num_BfTar > 0 + { + if(pDM_BdcTable->num_DivTar ==0) // Selsect_3 + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Select active mode (( 3 ))\n")); + pDM_BdcTable->BDC_active_Mode=3; + pDM_BdcTable->BDC_Try_flag=0; + pDM_BdcTable->BDC_state=BDC_BFer_TRAIN_STATE; + odm_BDCcoexType_withBferClient( pDM_Odm, DIVOFF_CSION); + return; + } + else // Selsect_4 + { + BDC_active_Mode=4; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Select active mode (( 4 ))\n")); + + if(BDC_active_Mode!=pDM_BdcTable->BDC_active_Mode) + { + pDM_BdcTable->BDC_active_Mode=4; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Change to active mode (( 4 )) & return!!! \n")); + return; + } + } + } + +#if 1 + if (pDM_Odm->bdc_holdstate==0xff) + { + pDM_BdcTable->BDC_state=BDC_DIV_HOLD_STATE; + odm_BDCcoexType_withBferClient( pDM_Odm, DIVON_CSIOFF); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Force in [ DIV STATE] \n")); + return; + } +#endif + + // Does Client number changed ? ------------------------------- + if(pDM_BdcTable->num_Client !=pDM_BdcTable->pre_num_Client) + { + pDM_BdcTable->BDC_Try_flag=0; + pDM_BdcTable->BDC_state=BDC_DIV_TRAIN_STATE; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ The number of client has been changed !!!] return to (( BDC_DIV_TRAIN_STATE )) \n")); + } + pDM_BdcTable->pre_num_Client=pDM_BdcTable->num_Client; + + if( pDM_BdcTable->BDC_Try_flag==0) + { + //2 DIV_TRAIN_STATE (Mode 2-0) + if(pDM_BdcTable->BDC_state==BDC_DIV_TRAIN_STATE) + { + odm_DivTrainState_setting( pDM_Odm); + } + //2 BFer_TRAIN_STATE (Mode 2-1) + else if(pDM_BdcTable->BDC_state==BDC_BFer_TRAIN_STATE) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*****[2-1. BFer_TRAIN_STATE ]***** \n")); + + //if(pDM_BdcTable->num_BfTar==0) + //{ + // ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("BF_tars exist? : (( No )), [ BDC_BFer_TRAIN_STATE ] >> [BDC_DIV_TRAIN_STATE] \n")); + // odm_DivTrainState_setting( pDM_Odm); + //} + //else //num_BfTar != 0 + //{ + pDM_BdcTable->BDC_Try_counter=2; + pDM_BdcTable->BDC_Try_flag=1; + pDM_BdcTable->BDC_state=BDC_DECISION_STATE; + odm_BDCcoexType_withBferClient( pDM_Odm, DIVOFF_CSION); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("BF_tars exist? : (( Yes )), [ BDC_BFer_TRAIN_STATE ] >> [BDC_DECISION_STATE] \n")); + //} + } + //2 DECISION_STATE (Mode 2-2) + else if(pDM_BdcTable->BDC_state==BDC_DECISION_STATE) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*****[2-2. DECISION_STATE]***** \n")); + //if(pDM_BdcTable->num_BfTar==0) + //{ + // ODM_AntDiv_Printk(("BF_tars exist? : (( No )), [ DECISION_STATE ] >> [BDC_DIV_TRAIN_STATE] \n")); + // odm_DivTrainState_setting( pDM_Odm); + //} + //else //num_BfTar != 0 + //{ + if(pDM_BdcTable->BF_pass==FALSE || pDM_BdcTable->DIV_pass == FALSE) + StopBF_flag=TRUE; + else + StopBF_flag=FALSE; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("BF_tars exist? : (( Yes )), {BF_pass, DIV_pass, StopBF_flag } = { %d, %d, %d } \n" ,pDM_BdcTable->BF_pass,pDM_BdcTable->DIV_pass,StopBF_flag)); + + if(StopBF_flag==TRUE) //DIV_en + { + pDM_BdcTable->BDC_Hold_counter=10; //20 + odm_BDCcoexType_withBferClient( pDM_Odm, DIVON_CSIOFF); + pDM_BdcTable->BDC_state=BDC_DIV_HOLD_STATE; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ StopBF_flag= ((TRUE)), BDC_DECISION_STATE ] >> [BDC_DIV_HOLD_STATE] \n")); + } + else //BF_en + { + pDM_BdcTable->BDC_Hold_counter=10; //20 + odm_BDCcoexType_withBferClient( pDM_Odm, DIVOFF_CSION); + pDM_BdcTable->BDC_state=BDC_BF_HOLD_STATE; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[StopBF_flag= ((FALSE)), BDC_DECISION_STATE ] >> [BDC_BF_HOLD_STATE] \n")); + } + //} + } + //2 BF-HOLD_STATE (Mode 2-3) + else if(pDM_BdcTable->BDC_state==BDC_BF_HOLD_STATE) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*****[2-3. BF_HOLD_STATE ]*****\n")); + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("BDC_Hold_counter = (( %d )) \n",pDM_BdcTable->BDC_Hold_counter )); + + if(pDM_BdcTable->BDC_Hold_counter==1) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ BDC_BF_HOLD_STATE ] >> [BDC_DIV_TRAIN_STATE] \n")); + odm_DivTrainState_setting( pDM_Odm); + } + else + { + pDM_BdcTable->BDC_Hold_counter--; + + //if(pDM_BdcTable->num_BfTar==0) + //{ + // ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("BF_tars exist? : (( No )), [ BDC_BF_HOLD_STATE ] >> [BDC_DIV_TRAIN_STATE] \n")); + // odm_DivTrainState_setting( pDM_Odm); + //} + //else //num_BfTar != 0 + //{ + //ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("BF_tars exist? : (( Yes ))\n")); + pDM_BdcTable->BDC_state=BDC_BF_HOLD_STATE; + odm_BDCcoexType_withBferClient( pDM_Odm, DIVOFF_CSION); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ BDC_BF_HOLD_STATE ] >> [BDC_BF_HOLD_STATE] \n")); + //} + } + + } + //2 DIV-HOLD_STATE (Mode 2-4) + else if(pDM_BdcTable->BDC_state==BDC_DIV_HOLD_STATE) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*****[2-4. DIV_HOLD_STATE ]*****\n")); + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("BDC_Hold_counter = (( %d )) \n",pDM_BdcTable->BDC_Hold_counter )); + + if(pDM_BdcTable->BDC_Hold_counter==1) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ BDC_DIV_HOLD_STATE ] >> [BDC_DIV_TRAIN_STATE] \n")); + odm_DivTrainState_setting( pDM_Odm); + } + else + { + pDM_BdcTable->BDC_Hold_counter--; + pDM_BdcTable->BDC_state=BDC_DIV_HOLD_STATE; + odm_BDCcoexType_withBferClient( pDM_Odm, DIVON_CSIOFF); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ BDC_DIV_HOLD_STATE ] >> [BDC_DIV_HOLD_STATE] \n")); + } + + } + + } + else if( pDM_BdcTable->BDC_Try_flag==1) + { + //2 Set Training Counter + if(pDM_BdcTable->BDC_Try_counter >1) + { + pDM_BdcTable->BDC_Try_counter--; + if(pDM_BdcTable->BDC_Try_counter ==1) + pDM_BdcTable->BDC_Try_flag=0; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Training !!\n")); + //return ; + } + + } + + } + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("\n[end]\n")); + + #endif //#if(DM_ODM_SUPPORT_TYPE == ODM_AP) + + + + + + +} + +#endif +#endif //#ifdef BEAMFORMING_SUPPORT + + +#if (RTL8188E_SUPPORT == 1) + + +VOID +odm_RX_HWAntDiv_Init_88E( + IN PVOID pDM_VOID +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + u4Byte value32; + + if(pDM_Odm->mp_mode == TRUE) + { + pDM_Odm->AntDivType = CGCS_RX_SW_ANTDIV; + ODM_SetBBReg(pDM_Odm, ODM_REG_IGI_A_11N , BIT7, 0); // disable HW AntDiv + ODM_SetBBReg(pDM_Odm, ODM_REG_LNA_SWITCH_11N , BIT31, 1); // 1:CG, 0:CS + return; + } + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8188E AntDiv_Init => AntDivType=[CGCS_RX_HW_ANTDIV]\n")); + + //MAC Setting + value32 = ODM_GetMACReg(pDM_Odm, ODM_REG_ANTSEL_PIN_11N, bMaskDWord); + ODM_SetMACReg(pDM_Odm, ODM_REG_ANTSEL_PIN_11N, bMaskDWord, value32|(BIT23|BIT25)); //Reg4C[25]=1, Reg4C[23]=1 for pin output + //Pin Settings + ODM_SetBBReg(pDM_Odm, ODM_REG_PIN_CTRL_11N , BIT9|BIT8, 0);//Reg870[8]=1'b0, Reg870[9]=1'b0 //antsel antselb by HW + ODM_SetBBReg(pDM_Odm, ODM_REG_RX_ANT_CTRL_11N , BIT10, 0); //Reg864[10]=1'b0 //antsel2 by HW + ODM_SetBBReg(pDM_Odm, ODM_REG_LNA_SWITCH_11N , BIT22, 1); //Regb2c[22]=1'b0 //disable CS/CG switch + ODM_SetBBReg(pDM_Odm, ODM_REG_LNA_SWITCH_11N , BIT31, 1); //Regb2c[31]=1'b1 //output at CG only + //OFDM Settings + ODM_SetBBReg(pDM_Odm, ODM_REG_ANTDIV_PARA1_11N , bMaskDWord, 0x000000a0); + //CCK Settings + ODM_SetBBReg(pDM_Odm, ODM_REG_BB_PWR_SAV4_11N , BIT7, 1); //Fix CCK PHY status report issue + ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_ANTDIV_PARA2_11N , BIT4, 1); //CCK complete HW AntDiv within 64 samples + + ODM_SetBBReg(pDM_Odm, ODM_REG_ANT_MAPPING1_11N , 0xFFFF, 0x0001); //antenna mapping table +} + +VOID +odm_TRX_HWAntDiv_Init_88E( + IN PVOID pDM_VOID +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + u4Byte value32; + + if(pDM_Odm->mp_mode == TRUE) + { + pDM_Odm->AntDivType = CGCS_RX_SW_ANTDIV; + ODM_SetBBReg(pDM_Odm, ODM_REG_IGI_A_11N , BIT7, 0); // disable HW AntDiv + ODM_SetBBReg(pDM_Odm, ODM_REG_RX_ANT_CTRL_11N , BIT5|BIT4|BIT3, 0); //Default RX (0/1) + return; + } + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8188E AntDiv_Init => AntDivType=[CG_TRX_HW_ANTDIV (SPDT)]\n")); + + //MAC Setting + value32 = ODM_GetMACReg(pDM_Odm, ODM_REG_ANTSEL_PIN_11N, bMaskDWord); + ODM_SetMACReg(pDM_Odm, ODM_REG_ANTSEL_PIN_11N, bMaskDWord, value32|(BIT23|BIT25)); //Reg4C[25]=1, Reg4C[23]=1 for pin output + //Pin Settings + ODM_SetBBReg(pDM_Odm, ODM_REG_PIN_CTRL_11N , BIT9|BIT8, 0);//Reg870[8]=1'b0, Reg870[9]=1'b0 //antsel antselb by HW + ODM_SetBBReg(pDM_Odm, ODM_REG_RX_ANT_CTRL_11N , BIT10, 0); //Reg864[10]=1'b0 //antsel2 by HW + ODM_SetBBReg(pDM_Odm, ODM_REG_LNA_SWITCH_11N , BIT22, 0); //Regb2c[22]=1'b0 //disable CS/CG switch + ODM_SetBBReg(pDM_Odm, ODM_REG_LNA_SWITCH_11N , BIT31, 1); //Regb2c[31]=1'b1 //output at CG only + //OFDM Settings + ODM_SetBBReg(pDM_Odm, ODM_REG_ANTDIV_PARA1_11N , bMaskDWord, 0x000000a0); + //CCK Settings + ODM_SetBBReg(pDM_Odm, ODM_REG_BB_PWR_SAV4_11N , BIT7, 1); //Fix CCK PHY status report issue + ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_ANTDIV_PARA2_11N , BIT4, 1); //CCK complete HW AntDiv within 64 samples + + //antenna mapping table + if(!pDM_Odm->bIsMPChip) //testchip + { + ODM_SetBBReg(pDM_Odm, ODM_REG_RX_DEFUALT_A_11N , BIT10|BIT9|BIT8, 1); //Reg858[10:8]=3'b001 + ODM_SetBBReg(pDM_Odm, ODM_REG_RX_DEFUALT_A_11N , BIT13|BIT12|BIT11, 2); //Reg858[13:11]=3'b010 + } + else //MPchip + ODM_SetBBReg(pDM_Odm, ODM_REG_ANT_MAPPING1_11N , bMaskDWord, 0x0001); //Reg914=3'b010, Reg915=3'b001 +} + + +#if( defined(CONFIG_5G_CG_SMART_ANT_DIVERSITY) ) ||( defined(CONFIG_2G_CG_SMART_ANT_DIVERSITY) ) +VOID +odm_Smart_HWAntDiv_Init_88E( + IN PVOID pDM_VOID +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + u4Byte value32, i; + pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8188E AntDiv_Init => AntDivType=[CG_TRX_SMART_ANTDIV]\n")); + + if(pDM_Odm->mp_mode == TRUE) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("pDM_Odm->AntDivType: %d\n", pDM_Odm->AntDivType)); + return; + } + + pDM_FatTable->TrainIdx = 0; + pDM_FatTable->FAT_State = FAT_NORMAL_STATE; + + pDM_Odm->fat_comb_a=5; + pDM_Odm->antdiv_intvl = 0x64; // 100ms + + for(i=0; i<6; i++) + { + pDM_FatTable->Bssid[i] = 0; + } + for(i=0; i< (pDM_Odm->fat_comb_a) ; i++) + { + pDM_FatTable->antSumRSSI[i] = 0; + pDM_FatTable->antRSSIcnt[i] = 0; + pDM_FatTable->antAveRSSI[i] = 0; + } + + //MAC Setting + value32 = ODM_GetMACReg(pDM_Odm, 0x4c, bMaskDWord); + ODM_SetMACReg(pDM_Odm, 0x4c, bMaskDWord, value32|(BIT23|BIT25)); //Reg4C[25]=1, Reg4C[23]=1 for pin output + value32 = ODM_GetMACReg(pDM_Odm, 0x7B4, bMaskDWord); + ODM_SetMACReg(pDM_Odm, 0x7b4, bMaskDWord, value32|(BIT16|BIT17)); //Reg7B4[16]=1 enable antenna training, Reg7B4[17]=1 enable A2 match + //value32 = PlatformEFIORead4Byte(Adapter, 0x7B4); + //PlatformEFIOWrite4Byte(Adapter, 0x7b4, value32|BIT18); //append MACID in reponse packet + + //Match MAC ADDR + ODM_SetMACReg(pDM_Odm, 0x7b4, 0xFFFF, 0); + ODM_SetMACReg(pDM_Odm, 0x7b0, bMaskDWord, 0); + + ODM_SetBBReg(pDM_Odm, 0x870 , BIT9|BIT8, 0);//Reg870[8]=1'b0, Reg870[9]=1'b0 //antsel antselb by HW + ODM_SetBBReg(pDM_Odm, 0x864 , BIT10, 0); //Reg864[10]=1'b0 //antsel2 by HW + ODM_SetBBReg(pDM_Odm, 0xb2c , BIT22, 0); //Regb2c[22]=1'b0 //disable CS/CG switch + ODM_SetBBReg(pDM_Odm, 0xb2c , BIT31, 0); //Regb2c[31]=1'b1 //output at CS only + ODM_SetBBReg(pDM_Odm, 0xca4 , bMaskDWord, 0x000000a0); + + //antenna mapping table + if(pDM_Odm->fat_comb_a == 2) + { + if(!pDM_Odm->bIsMPChip) //testchip + { + ODM_SetBBReg(pDM_Odm, 0x858 , BIT10|BIT9|BIT8, 1); //Reg858[10:8]=3'b001 + ODM_SetBBReg(pDM_Odm, 0x858 , BIT13|BIT12|BIT11, 2); //Reg858[13:11]=3'b010 + } + else //MPchip + { + ODM_SetBBReg(pDM_Odm, 0x914 , bMaskByte0, 1); + ODM_SetBBReg(pDM_Odm, 0x914 , bMaskByte1, 2); + } + } + else + { + if(!pDM_Odm->bIsMPChip) //testchip + { + ODM_SetBBReg(pDM_Odm, 0x858 , BIT10|BIT9|BIT8, 0); //Reg858[10:8]=3'b000 + ODM_SetBBReg(pDM_Odm, 0x858 , BIT13|BIT12|BIT11, 1); //Reg858[13:11]=3'b001 + ODM_SetBBReg(pDM_Odm, 0x878 , BIT16, 0); + ODM_SetBBReg(pDM_Odm, 0x858 , BIT15|BIT14, 2); //(Reg878[0],Reg858[14:15])=3'b010 + ODM_SetBBReg(pDM_Odm, 0x878 , BIT19|BIT18|BIT17, 3);//Reg878[3:1]=3b'011 + ODM_SetBBReg(pDM_Odm, 0x878 , BIT22|BIT21|BIT20, 4);//Reg878[6:4]=3b'100 + ODM_SetBBReg(pDM_Odm, 0x878 , BIT25|BIT24|BIT23, 5);//Reg878[9:7]=3b'101 + ODM_SetBBReg(pDM_Odm, 0x878 , BIT28|BIT27|BIT26, 6);//Reg878[12:10]=3b'110 + ODM_SetBBReg(pDM_Odm, 0x878 , BIT31|BIT30|BIT29, 7);//Reg878[15:13]=3b'111 + } + else //MPchip + { + ODM_SetBBReg(pDM_Odm, 0x914 , bMaskByte0, 4); // 0: 3b'000 + ODM_SetBBReg(pDM_Odm, 0x914 , bMaskByte1, 2); // 1: 3b'001 + ODM_SetBBReg(pDM_Odm, 0x914 , bMaskByte2, 0); // 2: 3b'010 + ODM_SetBBReg(pDM_Odm, 0x914 , bMaskByte3, 1); // 3: 3b'011 + ODM_SetBBReg(pDM_Odm, 0x918 , bMaskByte0, 3); // 4: 3b'100 + ODM_SetBBReg(pDM_Odm, 0x918 , bMaskByte1, 5); // 5: 3b'101 + ODM_SetBBReg(pDM_Odm, 0x918 , bMaskByte2, 6); // 6: 3b'110 + ODM_SetBBReg(pDM_Odm, 0x918 , bMaskByte3, 255); // 7: 3b'111 + } + } + + //Default Ant Setting when no fast training + ODM_SetBBReg(pDM_Odm, 0x864 , BIT5|BIT4|BIT3, 0); //Default RX + ODM_SetBBReg(pDM_Odm, 0x864 , BIT8|BIT7|BIT6, 1); //Optional RX + ODM_SetBBReg(pDM_Odm, 0x860 , BIT14|BIT13|BIT12, 0);//Default TX + + //Enter Traing state + ODM_SetBBReg(pDM_Odm, 0x864 , BIT2|BIT1|BIT0, (pDM_Odm->fat_comb_a-1)); //Reg864[2:0]=3'd6 //ant combination=reg864[2:0]+1 + + //SW Control + //PHY_SetBBReg(Adapter, 0x864 , BIT10, 1); + //PHY_SetBBReg(Adapter, 0x870 , BIT9, 1); + //PHY_SetBBReg(Adapter, 0x870 , BIT8, 1); + //PHY_SetBBReg(Adapter, 0x864 , BIT11, 1); + //PHY_SetBBReg(Adapter, 0x860 , BIT9, 0); + //PHY_SetBBReg(Adapter, 0x860 , BIT8, 0); +} +#endif + +#endif //#if (RTL8188E_SUPPORT == 1) + + +#if (RTL8192E_SUPPORT == 1) +VOID +odm_RX_HWAntDiv_Init_92E( + IN PVOID pDM_VOID +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; + + if(pDM_Odm->mp_mode == TRUE) + { + //pDM_Odm->AntDivType = CGCS_RX_SW_ANTDIV; + odm_AntDiv_on_off(pDM_Odm, ANTDIV_OFF); + ODM_SetBBReg(pDM_Odm, 0xc50 , BIT8, 0); //r_rxdiv_enable_anta Regc50[8]=1'b0 0: control by c50[9] + ODM_SetBBReg(pDM_Odm, 0xc50 , BIT9, 1); // 1:CG, 0:CS + return; + } + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8192E AntDiv_Init => AntDivType=[CGCS_RX_HW_ANTDIV]\n")); + + //Pin Settings + ODM_SetBBReg(pDM_Odm, 0x870 , BIT8, 0);//Reg870[8]=1'b0, // "antsel" is controled by HWs + ODM_SetBBReg(pDM_Odm, 0xc50 , BIT8, 1); //Regc50[8]=1'b1 //" CS/CG switching" is controled by HWs + + //Mapping table + ODM_SetBBReg(pDM_Odm, 0x914 , 0xFFFF, 0x0100); //antenna mapping table + + //OFDM Settings + ODM_SetBBReg(pDM_Odm, 0xca4 , 0x7FF, 0xA0); //thershold + ODM_SetBBReg(pDM_Odm, 0xca4 , 0x7FF000, 0x0); //bias + + //CCK Settings + ODM_SetBBReg(pDM_Odm, 0xa04 , 0xF000000, 0); //Select which path to receive for CCK_1 & CCK_2 + ODM_SetBBReg(pDM_Odm, 0xb34 , BIT30, 0); //(92E) ANTSEL_CCK_opt = r_en_antsel_cck? ANTSEL_CCK: 1'b0 + ODM_SetBBReg(pDM_Odm, 0xa74 , BIT7, 1); //Fix CCK PHY status report issue + ODM_SetBBReg(pDM_Odm, 0xa0c , BIT4, 1); //CCK complete HW AntDiv within 64 samples + + #ifdef ODM_EVM_ENHANCE_ANTDIV + //EVM enhance AntDiv method init---------------------------------------------------------------------- + pDM_FatTable->EVM_method_enable=0; + pDM_FatTable->FAT_State = NORMAL_STATE_MIAN; + pDM_Odm->antdiv_intvl = 0x64; + ODM_SetBBReg(pDM_Odm, 0x910 , 0x3f, 0xf ); + pDM_Odm->antdiv_evm_en=1; + //pDM_Odm->antdiv_period=1; + + #endif + +} + +VOID +odm_TRX_HWAntDiv_Init_92E( + IN PVOID pDM_VOID +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; + + if(pDM_Odm->mp_mode == TRUE) + { + //pDM_Odm->AntDivType = CGCS_RX_SW_ANTDIV; + odm_AntDiv_on_off(pDM_Odm, ANTDIV_OFF); + ODM_SetBBReg(pDM_Odm, 0xc50 , BIT8, 0); //r_rxdiv_enable_anta Regc50[8]=1'b0 0: control by c50[9] + ODM_SetBBReg(pDM_Odm, 0xc50 , BIT9, 1); // 1:CG, 0:CS + return; + } + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8192E AntDiv_Init => AntDivType=[ Only for DIR605, CG_TRX_HW_ANTDIV]\n")); + + //3 --RFE pin setting--------- + //[MAC] + ODM_SetMACReg(pDM_Odm, 0x38, BIT11, 1); //DBG PAD Driving control (GPIO 8) + ODM_SetMACReg(pDM_Odm, 0x4c, BIT23, 0); //path-A , RFE_CTRL_3 + ODM_SetMACReg(pDM_Odm, 0x4c, BIT29, 1); //path-A , RFE_CTRL_8 + //[BB] + ODM_SetBBReg(pDM_Odm, 0x944 , BIT3, 1); //RFE_buffer + ODM_SetBBReg(pDM_Odm, 0x944 , BIT8, 1); + ODM_SetBBReg(pDM_Odm, 0x940 , BIT7|BIT6, 0x0); // r_rfe_path_sel_ (RFE_CTRL_3) + ODM_SetBBReg(pDM_Odm, 0x940 , BIT17|BIT16, 0x0); // r_rfe_path_sel_ (RFE_CTRL_8) + ODM_SetBBReg(pDM_Odm, 0x944 , BIT31, 0); //RFE_buffer + ODM_SetBBReg(pDM_Odm, 0x92C , BIT3, 0); //rfe_inv (RFE_CTRL_3) + ODM_SetBBReg(pDM_Odm, 0x92C , BIT8, 1); //rfe_inv (RFE_CTRL_8) + ODM_SetBBReg(pDM_Odm, 0x930 , 0xF000, 0x8); //path-A , RFE_CTRL_3 + ODM_SetBBReg(pDM_Odm, 0x934 , 0xF, 0x8); //path-A , RFE_CTRL_8 + //3 ------------------------- + + //Pin Settings + ODM_SetBBReg(pDM_Odm, 0xC50 , BIT8, 0); //path-A //disable CS/CG switch + +/* Let it follows PHY_REG for bit9 setting + if(pDM_Odm->priv->pshare->rf_ft_var.use_ext_pa || pDM_Odm->priv->pshare->rf_ft_var.use_ext_lna) + ODM_SetBBReg(pDM_Odm, 0xC50 , BIT9, 1);//path-A //output at CS + else + ODM_SetBBReg(pDM_Odm, 0xC50 , BIT9, 0); //path-A //output at CG ->normal power +*/ + + ODM_SetBBReg(pDM_Odm, 0x870 , BIT9|BIT8, 0); //path-A //antsel antselb by HW + ODM_SetBBReg(pDM_Odm, 0xB38 , BIT10, 0); //path-A //antsel2 by HW + + //Mapping table + ODM_SetBBReg(pDM_Odm, 0x914 , 0xFFFF, 0x0100); //antenna mapping table + + //OFDM Settings + ODM_SetBBReg(pDM_Odm, 0xca4 , 0x7FF, 0xA0); //thershold + ODM_SetBBReg(pDM_Odm, 0xca4 , 0x7FF000, 0x0); //bias + + //CCK Settings + ODM_SetBBReg(pDM_Odm, 0xa04 , 0xF000000, 0); //Select which path to receive for CCK_1 & CCK_2 + ODM_SetBBReg(pDM_Odm, 0xb34 , BIT30, 0); //(92E) ANTSEL_CCK_opt = r_en_antsel_cck? ANTSEL_CCK: 1'b0 + ODM_SetBBReg(pDM_Odm, 0xa74 , BIT7, 1); //Fix CCK PHY status report issue + ODM_SetBBReg(pDM_Odm, 0xa0c , BIT4, 1); //CCK complete HW AntDiv within 64 samples + + //Timming issue + ODM_SetBBReg(pDM_Odm, 0xE20 , BIT23|BIT22|BIT21|BIT20, 8); //keep antidx after tx for ACK ( unit x 32 mu sec) + + #ifdef ODM_EVM_ENHANCE_ANTDIV + //EVM enhance AntDiv method init---------------------------------------------------------------------- + pDM_FatTable->EVM_method_enable=0; + pDM_FatTable->FAT_State = NORMAL_STATE_MIAN; + pDM_Odm->antdiv_intvl = 0x64; + ODM_SetBBReg(pDM_Odm, 0x910 , 0x3f, 0xf ); + pDM_Odm->antdiv_evm_en=1; + //pDM_Odm->antdiv_period=1; + #endif +} + +#if( defined(CONFIG_5G_CG_SMART_ANT_DIVERSITY) ) ||( defined(CONFIG_2G_CG_SMART_ANT_DIVERSITY) ) +VOID +odm_Smart_HWAntDiv_Init_92E( + IN PVOID pDM_VOID +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8188E AntDiv_Init => AntDivType=[CG_TRX_SMART_ANTDIV]\n")); +} +#endif + +#endif //#if (RTL8192E_SUPPORT == 1) + + +#if (RTL8723B_SUPPORT == 1) +VOID +odm_TRX_HWAntDiv_Init_8723B( + IN PVOID pDM_VOID +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8723B AntDiv_Init => AntDivType=[CG_TRX_HW_ANTDIV(DPDT)]\n")); + + //Mapping Table + ODM_SetBBReg(pDM_Odm, 0x914 , bMaskByte0, 0); + ODM_SetBBReg(pDM_Odm, 0x914 , bMaskByte1, 1); + + //OFDM HW AntDiv Parameters + ODM_SetBBReg(pDM_Odm, 0xCA4 , 0x7FF, 0xa0); //thershold + ODM_SetBBReg(pDM_Odm, 0xCA4 , 0x7FF000, 0x00); //bias + + //CCK HW AntDiv Parameters + ODM_SetBBReg(pDM_Odm, 0xA74 , BIT7, 1); //patch for clk from 88M to 80M + ODM_SetBBReg(pDM_Odm, 0xA0C , BIT4, 1); //do 64 samples + + //BT Coexistence + ODM_SetBBReg(pDM_Odm, 0x864, BIT12, 0); //keep antsel_map when GNT_BT = 1 + ODM_SetBBReg(pDM_Odm, 0x874 , BIT23, 0); //Disable hw antsw & fast_train.antsw when GNT_BT=1 + + //Output Pin Settings + ODM_SetBBReg(pDM_Odm, 0x870 , BIT8, 0); // + + ODM_SetBBReg(pDM_Odm, 0x948 , BIT6, 0); //WL_BB_SEL_BTG_TRXG_anta, (1: HW CTRL 0: SW CTRL) + ODM_SetBBReg(pDM_Odm, 0x948 , BIT7, 0); + + ODM_SetMACReg(pDM_Odm, 0x40 , BIT3, 1); + ODM_SetMACReg(pDM_Odm, 0x38 , BIT11, 1); + ODM_SetMACReg(pDM_Odm, 0x4C , BIT24|BIT23, 2); //select DPDT_P and DPDT_N as output pin + + ODM_SetBBReg(pDM_Odm, 0x944 , BIT0|BIT1, 3); //in/out + ODM_SetBBReg(pDM_Odm, 0x944 , BIT31, 0); // + + ODM_SetBBReg(pDM_Odm, 0x92C , BIT1, 0); //DPDT_P non-inverse + ODM_SetBBReg(pDM_Odm, 0x92C , BIT0, 1); //DPDT_N inverse + + ODM_SetBBReg(pDM_Odm, 0x930 , 0xF0, 8); // DPDT_P = ANTSEL[0] + ODM_SetBBReg(pDM_Odm, 0x930 , 0xF, 8); // DPDT_N = ANTSEL[0] + + //Timming issue + ODM_SetBBReg(pDM_Odm, 0xE20 , BIT23|BIT22|BIT21|BIT20, 8); //keep antidx after tx for ACK ( unit x 32 mu sec) + + //2 [--For HW Bug Setting] + if(pDM_Odm->AntType == ODM_AUTO_ANT) + ODM_SetBBReg(pDM_Odm, 0xA00 , BIT15, 0); //CCK AntDiv function block enable + +} + + + +VOID +odm_S0S1_SWAntDiv_Init_8723B( + IN PVOID pDM_VOID +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; + pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8723B AntDiv_Init => AntDivType=[ S0S1_SW_AntDiv] \n")); + + //Mapping Table + ODM_SetBBReg(pDM_Odm, 0x914 , bMaskByte0, 0); + ODM_SetBBReg(pDM_Odm, 0x914 , bMaskByte1, 1); + + //Output Pin Settings + //ODM_SetBBReg(pDM_Odm, 0x948 , BIT6, 0x1); + ODM_SetBBReg(pDM_Odm, 0x870 , BIT9|BIT8, 0); + + pDM_FatTable->bBecomeLinked =FALSE; + pDM_SWAT_Table->try_flag = 0xff; + pDM_SWAT_Table->Double_chk_flag = 0; + pDM_SWAT_Table->TrafficLoad = TRAFFIC_LOW; + + //Timming issue + ODM_SetBBReg(pDM_Odm, 0xE20 , BIT23|BIT22|BIT21|BIT20, 8); //keep antidx after tx for ACK ( unit x 32 mu sec) + + //2 [--For HW Bug Setting] + ODM_SetBBReg(pDM_Odm, 0x80C , BIT21, 0); //TX Ant by Reg + +} + +VOID +odm_S0S1_SWAntDiv_Reset_8723B( + IN PVOID pDM_VOID +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; + pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; + + pDM_FatTable->bBecomeLinked =FALSE; + pDM_SWAT_Table->try_flag = 0xff; + pDM_SWAT_Table->Double_chk_flag = 0; + pDM_SWAT_Table->TrafficLoad = TRAFFIC_LOW; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("odm_S0S1_SWAntDiv_Reset_8723B(): pDM_FatTable->bBecomeLinked = %d\n", pDM_FatTable->bBecomeLinked)); +} + +VOID +ODM_UpdateRxIdleAnt_8723B( + IN PVOID pDM_VOID, + IN u1Byte Ant, + IN u4Byte DefaultAnt, + IN u4Byte OptionalAnt +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; + PADAPTER pAdapter = pDM_Odm->Adapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); + u1Byte count=0; + u1Byte u1Temp; + u1Byte H2C_Parameter; + u4Byte value32; + + if(!pDM_Odm->bLinked) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ Update Rx-Idle-Ant ] 8723B: Fail to set RX antenna due to no link\n")); + return; + } + + // Send H2C command to FW + // Enable wifi calibration + H2C_Parameter = TRUE; + ODM_FillH2CCmd(pDM_Odm, ODM_H2C_WIFI_CALIBRATION, 1, &H2C_Parameter); + + // Check if H2C command sucess or not (0x1e6) + u1Temp = ODM_Read1Byte(pDM_Odm, 0x1e6); + while((u1Temp != 0x1) && (count < 100)) + { + ODM_delay_us(10); + u1Temp = ODM_Read1Byte(pDM_Odm, 0x1e6); + count++; + } + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ Update Rx-Idle-Ant ] 8723B: H2C command status = %d, count = %d\n", u1Temp, count)); + + if(u1Temp == 0x1) + { + // Check if BT is doing IQK (0x1e7) + count = 0; + u1Temp = ODM_Read1Byte(pDM_Odm, 0x1e7); + while((!(u1Temp & BIT0)) && (count < 100)) + { + ODM_delay_us(50); + u1Temp = ODM_Read1Byte(pDM_Odm, 0x1e7); + count++; + } + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ Update Rx-Idle-Ant ] 8723B: BT IQK status = %d, count = %d\n", u1Temp, count)); + + if(u1Temp & BIT0) + { + ODM_SetBBReg(pDM_Odm, 0x948 , BIT6, 0x1); + ODM_SetBBReg(pDM_Odm, 0x948 , BIT9, DefaultAnt); + ODM_SetBBReg(pDM_Odm, 0x864 , BIT5|BIT4|BIT3, DefaultAnt); //Default RX + ODM_SetBBReg(pDM_Odm, 0x864 , BIT8|BIT7|BIT6, OptionalAnt); //Optional RX + ODM_SetBBReg(pDM_Odm, 0x860, BIT14|BIT13|BIT12, DefaultAnt); //Default TX + pDM_FatTable->RxIdleAnt = Ant; + + // Set TX AGC by S0/S1 + // Need to consider Linux driver +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + pAdapter->HalFunc.SetTxPowerLevelHandler(pAdapter, pHalData->CurrentChannel); +#elif(DM_ODM_SUPPORT_TYPE == ODM_CE) + rtw_hal_set_tx_power_level(pAdapter, pHalData->CurrentChannel); +#endif + + // Set IQC by S0/S1 + ODM_SetIQCbyRFpath(pDM_Odm,DefaultAnt); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ Update Rx-Idle-Ant ] 8723B: Sucess to set RX antenna\n")); + } + else + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ Update Rx-Idle-Ant ] 8723B: Fail to set RX antenna due to BT IQK\n")); + } + else + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ Update Rx-Idle-Ant ] 8723B: Fail to set RX antenna due to H2C command fail\n")); + + // Send H2C command to FW + // Disable wifi calibration + H2C_Parameter = FALSE; + ODM_FillH2CCmd(pDM_Odm, ODM_H2C_WIFI_CALIBRATION, 1, &H2C_Parameter); + +} + +#endif //#if (RTL8723B_SUPPORT == 1) + +#if (RTL8821A_SUPPORT == 1) +VOID +odm_TRX_HWAntDiv_Init_8821A( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8821A AntDiv_Init => AntDivType=[ CG_TRX_HW_ANTDIV (DPDT)] \n")); + + //Output Pin Settings + ODM_SetMACReg(pDM_Odm, 0x4C , BIT25, 0); + + ODM_SetMACReg(pDM_Odm, 0x64 , BIT29, 1); //PAPE by WLAN control + ODM_SetMACReg(pDM_Odm, 0x64 , BIT28, 1); //LNAON by WLAN control + + ODM_SetBBReg(pDM_Odm, 0xCB0 , bMaskDWord, 0x77775745); + ODM_SetBBReg(pDM_Odm, 0xCB8 , BIT16, 0); + + ODM_SetMACReg(pDM_Odm, 0x4C , BIT23, 0); //select DPDT_P and DPDT_N as output pin + ODM_SetMACReg(pDM_Odm, 0x4C , BIT24, 1); //by WLAN control + ODM_SetBBReg(pDM_Odm, 0xCB4 , 0xF, 8); // DPDT_P = ANTSEL[0] + ODM_SetBBReg(pDM_Odm, 0xCB4 , 0xF0, 8); // DPDT_N = ANTSEL[0] + ODM_SetBBReg(pDM_Odm, 0xCB4 , BIT29, 0); //DPDT_P non-inverse + ODM_SetBBReg(pDM_Odm, 0xCB4 , BIT28, 1); //DPDT_N inverse + + //Mapping Table + ODM_SetBBReg(pDM_Odm, 0xCA4 , bMaskByte0, 0); + ODM_SetBBReg(pDM_Odm, 0xCA4 , bMaskByte1, 1); + + //OFDM HW AntDiv Parameters + ODM_SetBBReg(pDM_Odm, 0x8D4 , 0x7FF, 0xA0); //thershold + ODM_SetBBReg(pDM_Odm, 0x8D4 , 0x7FF000, 0x10); //bias + + //CCK HW AntDiv Parameters + ODM_SetBBReg(pDM_Odm, 0xA74 , BIT7, 1); //patch for clk from 88M to 80M + ODM_SetBBReg(pDM_Odm, 0xA0C , BIT4, 1); //do 64 samples + + ODM_SetBBReg(pDM_Odm, 0x800 , BIT25, 0); //ANTSEL_CCK sent to the smart_antenna circuit + ODM_SetBBReg(pDM_Odm, 0xA00 , BIT15, 0); //CCK AntDiv function block enable + + //BT Coexistence + ODM_SetBBReg(pDM_Odm, 0xCAC , BIT9, 1); //keep antsel_map when GNT_BT = 1 + ODM_SetBBReg(pDM_Odm, 0x804 , BIT4, 1); //Disable hw antsw & fast_train.antsw when GNT_BT=1 + + //Timming issue + ODM_SetBBReg(pDM_Odm, 0x818 , BIT23|BIT22|BIT21|BIT20, 8); //keep antidx after tx for ACK ( unit x 32 mu sec) + ODM_SetBBReg(pDM_Odm, 0x8CC , BIT20|BIT19|BIT18, 3); //settling time of antdiv by RF LNA = 100ns + + //response TX ant by RX ant + ODM_SetMACReg(pDM_Odm, 0x668 , BIT3, 1); + +} + +VOID +odm_S0S1_SWAntDiv_Init_8821A( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; + pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8821A AntDiv_Init => AntDivType=[ S0S1_SW_AntDiv] \n")); + + //Output Pin Settings + ODM_SetMACReg(pDM_Odm, 0x4C , BIT25, 0); + + ODM_SetMACReg(pDM_Odm, 0x64 , BIT29, 1); //PAPE by WLAN control + ODM_SetMACReg(pDM_Odm, 0x64 , BIT28, 1); //LNAON by WLAN control + + ODM_SetBBReg(pDM_Odm, 0xCB0 , bMaskDWord, 0x77775745); + ODM_SetBBReg(pDM_Odm, 0xCB8 , BIT16, 0); + + ODM_SetMACReg(pDM_Odm, 0x4C , BIT23, 0); //select DPDT_P and DPDT_N as output pin + ODM_SetMACReg(pDM_Odm, 0x4C , BIT24, 1); //by WLAN control + ODM_SetBBReg(pDM_Odm, 0xCB4 , 0xF, 8); // DPDT_P = ANTSEL[0] + ODM_SetBBReg(pDM_Odm, 0xCB4 , 0xF0, 8); // DPDT_N = ANTSEL[0] + ODM_SetBBReg(pDM_Odm, 0xCB4 , BIT29, 0); //DPDT_P non-inverse + ODM_SetBBReg(pDM_Odm, 0xCB4 , BIT28, 1); //DPDT_N inverse + + //Mapping Table + ODM_SetBBReg(pDM_Odm, 0xCA4 , bMaskByte0, 0); + ODM_SetBBReg(pDM_Odm, 0xCA4 , bMaskByte1, 1); + + //OFDM HW AntDiv Parameters + ODM_SetBBReg(pDM_Odm, 0x8D4 , 0x7FF, 0xA0); //thershold + ODM_SetBBReg(pDM_Odm, 0x8D4 , 0x7FF000, 0x10); //bias + + //CCK HW AntDiv Parameters + ODM_SetBBReg(pDM_Odm, 0xA74 , BIT7, 1); //patch for clk from 88M to 80M + ODM_SetBBReg(pDM_Odm, 0xA0C , BIT4, 1); //do 64 samples + + ODM_SetBBReg(pDM_Odm, 0x800 , BIT25, 0); //ANTSEL_CCK sent to the smart_antenna circuit + ODM_SetBBReg(pDM_Odm, 0xA00 , BIT15, 0); //CCK AntDiv function block enable + + //BT Coexistence + ODM_SetBBReg(pDM_Odm, 0xCAC , BIT9, 1); //keep antsel_map when GNT_BT = 1 + ODM_SetBBReg(pDM_Odm, 0x804 , BIT4, 1); //Disable hw antsw & fast_train.antsw when GNT_BT=1 + + //Timming issue + ODM_SetBBReg(pDM_Odm, 0x818 , BIT23|BIT22|BIT21|BIT20, 8); //keep antidx after tx for ACK ( unit x 32 mu sec) + ODM_SetBBReg(pDM_Odm, 0x8CC , BIT20|BIT19|BIT18, 3); //settling time of antdiv by RF LNA = 100ns + + //response TX ant by RX ant + ODM_SetMACReg(pDM_Odm, 0x668 , BIT3, 1); + + + ODM_SetBBReg(pDM_Odm, 0x900 , BIT18, 0); + + pDM_SWAT_Table->try_flag = 0xff; + pDM_SWAT_Table->Double_chk_flag = 0; + pDM_SWAT_Table->TrafficLoad = TRAFFIC_LOW; + pDM_SWAT_Table->CurAntenna = MAIN_ANT; + pDM_SWAT_Table->PreAntenna = MAIN_ANT; + pDM_SWAT_Table->SWAS_NoLink_State = 0; + +} +#endif //#if (RTL8821A_SUPPORT == 1) + +#if (RTL8881A_SUPPORT == 1) +VOID +odm_RX_HWAntDiv_Init_8881A( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8881A AntDiv_Init => AntDivType=[ CGCS_RX_HW_ANTDIV] \n")); + +} + +VOID +odm_TRX_HWAntDiv_Init_8881A( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8881A AntDiv_Init => AntDivType=[ CG_TRX_HW_ANTDIV (SPDT)] \n")); + + //Output Pin Settings + // [SPDT related] + ODM_SetMACReg(pDM_Odm, 0x4C , BIT25, 0); + ODM_SetMACReg(pDM_Odm, 0x4C , BIT26, 0); + ODM_SetBBReg(pDM_Odm, 0xCB4 , BIT31, 0); //delay buffer + ODM_SetBBReg(pDM_Odm, 0xCB4 , BIT22, 0); + ODM_SetBBReg(pDM_Odm, 0xCB4 , BIT24, 1); + ODM_SetBBReg(pDM_Odm, 0xCB0 , 0xF00, 8); // DPDT_P = ANTSEL[0] + ODM_SetBBReg(pDM_Odm, 0xCB0 , 0xF0000, 8); // DPDT_N = ANTSEL[0] + + //Mapping Table + ODM_SetBBReg(pDM_Odm, 0xCA4 , bMaskByte0, 0); + ODM_SetBBReg(pDM_Odm, 0xCA4 , bMaskByte1, 1); + + //OFDM HW AntDiv Parameters + ODM_SetBBReg(pDM_Odm, 0x8D4 , 0x7FF, 0xA0); //thershold + ODM_SetBBReg(pDM_Odm, 0x8D4 , 0x7FF000, 0x0); //bias + ODM_SetBBReg(pDM_Odm, 0x8CC , BIT20|BIT19|BIT18, 3); //settling time of antdiv by RF LNA = 100ns + + //CCK HW AntDiv Parameters + ODM_SetBBReg(pDM_Odm, 0xA74 , BIT7, 1); //patch for clk from 88M to 80M + ODM_SetBBReg(pDM_Odm, 0xA0C , BIT4, 1); //do 64 samples + + //Timming issue + ODM_SetBBReg(pDM_Odm, 0x818 , BIT23|BIT22|BIT21|BIT20, 8); //keep antidx after tx for ACK ( unit x 32 mu sec) + + //2 [--For HW Bug Setting] + + ODM_SetBBReg(pDM_Odm, 0x900 , BIT18, 0); //TX Ant by Reg // A-cut bug +} + +#endif //#if (RTL8881A_SUPPORT == 1) + + +#if (RTL8812A_SUPPORT == 1) +VOID +odm_TRX_HWAntDiv_Init_8812A( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8812A AntDiv_Init => AntDivType=[ CG_TRX_HW_ANTDIV (SPDT)] \n")); + + //3 //3 --RFE pin setting--------- + //[BB] + ODM_SetBBReg(pDM_Odm, 0x900 , BIT10|BIT9|BIT8, 0x0); //disable SW switch + ODM_SetBBReg(pDM_Odm, 0x900 , BIT17|BIT16, 0x0); + ODM_SetBBReg(pDM_Odm, 0x974 , BIT7|BIT6, 0x3); // in/out + ODM_SetBBReg(pDM_Odm, 0xCB4 , BIT31, 0); //delay buffer + ODM_SetBBReg(pDM_Odm, 0xCB4 , BIT26, 0); + ODM_SetBBReg(pDM_Odm, 0xCB4 , BIT27, 1); + ODM_SetBBReg(pDM_Odm, 0xCB0 , 0xF000000, 8); // DPDT_P = ANTSEL[0] + ODM_SetBBReg(pDM_Odm, 0xCB0 , 0xF0000000, 8); // DPDT_N = ANTSEL[0] + //3 ------------------------- + + //Mapping Table + ODM_SetBBReg(pDM_Odm, 0xCA4 , bMaskByte0, 0); + ODM_SetBBReg(pDM_Odm, 0xCA4 , bMaskByte1, 1); + + //OFDM HW AntDiv Parameters + ODM_SetBBReg(pDM_Odm, 0x8D4 , 0x7FF, 0xA0); //thershold + ODM_SetBBReg(pDM_Odm, 0x8D4 , 0x7FF000, 0x0); //bias + ODM_SetBBReg(pDM_Odm, 0x8CC , BIT20|BIT19|BIT18, 3); //settling time of antdiv by RF LNA = 100ns + + //CCK HW AntDiv Parameters + ODM_SetBBReg(pDM_Odm, 0xA74 , BIT7, 1); //patch for clk from 88M to 80M + ODM_SetBBReg(pDM_Odm, 0xA0C , BIT4, 1); //do 64 samples + + //Timming issue + ODM_SetBBReg(pDM_Odm, 0x818 , BIT23|BIT22|BIT21|BIT20, 8); //keep antidx after tx for ACK ( unit x 32 mu sec) + + //2 [--For HW Bug Setting] + + ODM_SetBBReg(pDM_Odm, 0x900 , BIT18, 0); //TX Ant by Reg // A-cut bug + +} + +#endif //#if (RTL8812A_SUPPORT == 1) + + + + +#ifdef ODM_EVM_ENHANCE_ANTDIV + + + +VOID +odm_EVM_FastAnt_Reset( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; + + pDM_FatTable->EVM_method_enable=0; + odm_AntDiv_on_off(pDM_Odm, ANTDIV_ON); + pDM_FatTable->FAT_State = NORMAL_STATE_MIAN; + pDM_Odm->antdiv_period=0; + ODM_SetMACReg(pDM_Odm, 0x608, BIT8, 0); +} + + +VOID +odm_EVM_Enhance_AntDiv( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + u4Byte Main_RSSI, Aux_RSSI ; + u4Byte Main_CRC_utility=0,Aux_CRC_utility=0,utility_ratio=1; + u4Byte Main_EVM, Aux_EVM,Diff_RSSI=0,diff_EVM=0; + u1Byte score_EVM=0,score_CRC=0; + pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; + u4Byte value32, i; + BOOLEAN Main_above1=FALSE,Aux_above1=FALSE; + BOOLEAN Force_antenna=FALSE; + PSTA_INFO_T pEntry; + pDM_FatTable->TargetAnt_enhance=0xFF; + + + if((pDM_Odm->SupportICType & ODM_EVM_ENHANCE_ANTDIV_SUPPORT_IC)) + { + if(pDM_Odm->bOneEntryOnly) + { + //ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[One Client only] \n")); + i = pDM_Odm->OneEntry_MACID; + + Main_RSSI = (pDM_FatTable->MainAnt_Cnt[i]!=0)?(pDM_FatTable->MainAnt_Sum[i]/pDM_FatTable->MainAnt_Cnt[i]):0; + Aux_RSSI = (pDM_FatTable->AuxAnt_Cnt[i]!=0)?(pDM_FatTable->AuxAnt_Sum[i]/pDM_FatTable->AuxAnt_Cnt[i]):0; + + if((Main_RSSI==0 && Aux_RSSI !=0 && Aux_RSSI>=FORCE_RSSI_DIFF) || (Main_RSSI!=0 && Aux_RSSI==0 && Main_RSSI>=FORCE_RSSI_DIFF)) + { + Diff_RSSI=FORCE_RSSI_DIFF; + } + else if(Main_RSSI!=0 && Aux_RSSI !=0) + { + Diff_RSSI = (Main_RSSI>=Aux_RSSI)?(Main_RSSI-Aux_RSSI):(Aux_RSSI-Main_RSSI); + } + + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, (" Main_Cnt = (( %d )) , Main_RSSI= (( %d )) \n", pDM_FatTable->MainAnt_Cnt[i], Main_RSSI)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, (" Aux_Cnt = (( %d )) , Aux_RSSI = (( %d )) \n" , pDM_FatTable->AuxAnt_Cnt[i] , Aux_RSSI)); + + if( ((Main_RSSI>=Evm_RSSI_TH_High||Aux_RSSI>=Evm_RSSI_TH_High )|| (pDM_FatTable->EVM_method_enable==1) ) + //&& (Diff_RSSI <= FORCE_RSSI_DIFF + 1) + ) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[> TH_H || EVM_method_enable==1] && ")); + + if(((Main_RSSI>=Evm_RSSI_TH_Low)||(Aux_RSSI>=Evm_RSSI_TH_Low) )) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[> TH_L ] \n")); + + //2 [ Normal state Main] + if(pDM_FatTable->FAT_State == NORMAL_STATE_MIAN) + { + + pDM_FatTable->EVM_method_enable=1; + odm_AntDiv_on_off(pDM_Odm, ANTDIV_OFF); + pDM_Odm->antdiv_period=3; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ start training: MIAN] \n")); + pDM_FatTable->MainAntEVM_Sum[i] = 0; + pDM_FatTable->AuxAntEVM_Sum[i] = 0; + pDM_FatTable->MainAntEVM_Cnt[i] = 0; + pDM_FatTable->AuxAntEVM_Cnt[i] = 0; + + pDM_FatTable->FAT_State = NORMAL_STATE_AUX; + ODM_SetMACReg(pDM_Odm, 0x608, BIT8, 1); //Accept CRC32 Error packets. + ODM_UpdateRxIdleAnt(pDM_Odm, MAIN_ANT); + + pDM_FatTable->CRC32_Ok_Cnt=0; + pDM_FatTable->CRC32_Fail_Cnt=0; + ODM_SetTimer(pDM_Odm,&pDM_Odm->EVM_FastAntTrainingTimer, pDM_Odm->antdiv_intvl ); //m + } + //2 [ Normal state Aux ] + else if(pDM_FatTable->FAT_State == NORMAL_STATE_AUX) + { + pDM_FatTable->MainCRC32_Ok_Cnt=pDM_FatTable->CRC32_Ok_Cnt; + pDM_FatTable->MainCRC32_Fail_Cnt=pDM_FatTable->CRC32_Fail_Cnt; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ start training: AUX] \n")); + pDM_FatTable->FAT_State = TRAINING_STATE; + ODM_UpdateRxIdleAnt(pDM_Odm, AUX_ANT); + + pDM_FatTable->CRC32_Ok_Cnt=0; + pDM_FatTable->CRC32_Fail_Cnt=0; + ODM_SetTimer(pDM_Odm,&pDM_Odm->EVM_FastAntTrainingTimer, pDM_Odm->antdiv_intvl ); //ms + } + else if(pDM_FatTable->FAT_State == TRAINING_STATE) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[Training state ] \n")); + pDM_FatTable->FAT_State = NORMAL_STATE_MIAN; + + //3 [CRC32 statistic] + pDM_FatTable->AuxCRC32_Ok_Cnt=pDM_FatTable->CRC32_Ok_Cnt; + pDM_FatTable->AuxCRC32_Fail_Cnt=pDM_FatTable->CRC32_Fail_Cnt; + + if( (pDM_FatTable->MainCRC32_Ok_Cnt >= ((pDM_FatTable->AuxCRC32_Ok_Cnt)<<1)) || (Diff_RSSI>=18)) + { + pDM_FatTable->TargetAnt_CRC32=MAIN_ANT; + Force_antenna=TRUE; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("CRC32 Force Main \n")); + } + else if((pDM_FatTable->AuxCRC32_Ok_Cnt >= ((pDM_FatTable->MainCRC32_Ok_Cnt)<<1)) || (Diff_RSSI>=18)) + { + pDM_FatTable->TargetAnt_CRC32=AUX_ANT; + Force_antenna=TRUE; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("CRC32 Force Aux \n")); + } + else + { + if(pDM_FatTable->MainCRC32_Fail_Cnt<=5) + pDM_FatTable->MainCRC32_Fail_Cnt=5; + + if(pDM_FatTable->AuxCRC32_Fail_Cnt<=5) + pDM_FatTable->AuxCRC32_Fail_Cnt=5; + + if(pDM_FatTable->MainCRC32_Ok_Cnt >pDM_FatTable->MainCRC32_Fail_Cnt ) + Main_above1=TRUE; + + if(pDM_FatTable->AuxCRC32_Ok_Cnt >pDM_FatTable->AuxCRC32_Fail_Cnt ) + Aux_above1=TRUE; + + if(Main_above1==TRUE && Aux_above1==FALSE) + { + Force_antenna=TRUE; + pDM_FatTable->TargetAnt_CRC32=MAIN_ANT; + } + else if(Main_above1==FALSE && Aux_above1==TRUE) + { + Force_antenna=TRUE; + pDM_FatTable->TargetAnt_CRC32=AUX_ANT; + } + else if(Main_above1==TRUE && Aux_above1==TRUE) + { + Main_CRC_utility=((pDM_FatTable->MainCRC32_Ok_Cnt)<<7)/pDM_FatTable->MainCRC32_Fail_Cnt; + Aux_CRC_utility=((pDM_FatTable->AuxCRC32_Ok_Cnt)<<7)/pDM_FatTable->AuxCRC32_Fail_Cnt; + pDM_FatTable->TargetAnt_CRC32 = (Main_CRC_utility==Aux_CRC_utility)?(pDM_FatTable->pre_TargetAnt_enhance):((Main_CRC_utility>=Aux_CRC_utility)?MAIN_ANT:AUX_ANT); + + if(Main_CRC_utility!=0 && Aux_CRC_utility!=0) + { + if(Main_CRC_utility>=Aux_CRC_utility) + utility_ratio=(Main_CRC_utility<<1)/Aux_CRC_utility; + else + utility_ratio=(Aux_CRC_utility<<1)/Main_CRC_utility; + } + } + else if(Main_above1==FALSE && Aux_above1==FALSE) + { + if(pDM_FatTable->MainCRC32_Ok_Cnt==0) + pDM_FatTable->MainCRC32_Ok_Cnt=1; + if(pDM_FatTable->AuxCRC32_Ok_Cnt==0) + pDM_FatTable->AuxCRC32_Ok_Cnt=1; + + Main_CRC_utility=((pDM_FatTable->MainCRC32_Fail_Cnt)<<7)/pDM_FatTable->MainCRC32_Ok_Cnt; + Aux_CRC_utility=((pDM_FatTable->AuxCRC32_Fail_Cnt)<<7)/pDM_FatTable->AuxCRC32_Ok_Cnt; + pDM_FatTable->TargetAnt_CRC32 = (Main_CRC_utility==Aux_CRC_utility)?(pDM_FatTable->pre_TargetAnt_enhance):((Main_CRC_utility<=Aux_CRC_utility)?MAIN_ANT:AUX_ANT); + + if(Main_CRC_utility!=0 && Aux_CRC_utility!=0) + { + if(Main_CRC_utility>=Aux_CRC_utility) + utility_ratio=(Main_CRC_utility<<1)/(Aux_CRC_utility); + else + utility_ratio=(Aux_CRC_utility<<1)/(Main_CRC_utility); + } + } + } + ODM_SetMACReg(pDM_Odm, 0x608, BIT8, 0);//NOT Accept CRC32 Error packets. + + //3 [EVM statistic] + Main_EVM = (pDM_FatTable->MainAntEVM_Cnt[i]!=0)?(pDM_FatTable->MainAntEVM_Sum[i]/pDM_FatTable->MainAntEVM_Cnt[i]):0; + Aux_EVM = (pDM_FatTable->AuxAntEVM_Cnt[i]!=0)?(pDM_FatTable->AuxAntEVM_Sum[i]/pDM_FatTable->AuxAntEVM_Cnt[i]):0; + pDM_FatTable->TargetAnt_EVM = (Main_EVM==Aux_EVM)?(pDM_FatTable->pre_TargetAnt_enhance):((Main_EVM>=Aux_EVM)?MAIN_ANT:AUX_ANT); + + if((Main_EVM==0 || Aux_EVM==0)) + diff_EVM=0; + else if(Main_EVM>=Aux_EVM) + diff_EVM=Main_EVM-Aux_EVM; + else + diff_EVM=Aux_EVM-Main_EVM; + + //2 [ Decision state ] + if(pDM_FatTable->TargetAnt_EVM ==pDM_FatTable->TargetAnt_CRC32 ) + { + if( (utility_ratio<2 && Force_antenna==FALSE) && diff_EVM<=2) + pDM_FatTable->TargetAnt_enhance=pDM_FatTable->pre_TargetAnt_enhance; + else + pDM_FatTable->TargetAnt_enhance=pDM_FatTable->TargetAnt_EVM; + } + else if(diff_EVM<=2 && (utility_ratio > 4 && Force_antenna==FALSE)) + { + pDM_FatTable->TargetAnt_enhance=pDM_FatTable->TargetAnt_CRC32; + } + else if(diff_EVM>=20) // + { + pDM_FatTable->TargetAnt_enhance=pDM_FatTable->TargetAnt_EVM; + } + else if(utility_ratio>=6 && Force_antenna==FALSE) // utility_ratio>3 + { + pDM_FatTable->TargetAnt_enhance=pDM_FatTable->TargetAnt_CRC32; + } + else + { + if(Force_antenna==TRUE) + score_CRC=3; + else if(utility_ratio>=4) //>2 + score_CRC=2; + else if(utility_ratio>=3) //>1.5 + score_CRC=1; + else + score_CRC=0; + + if(diff_EVM>=10) + score_EVM=2; + else if(diff_EVM>=5) + score_EVM=1; + else + score_EVM=0; + + if(score_CRC>score_EVM) + pDM_FatTable->TargetAnt_enhance=pDM_FatTable->TargetAnt_CRC32; + else if(score_CRCTargetAnt_enhance=pDM_FatTable->TargetAnt_EVM; + else + pDM_FatTable->TargetAnt_enhance=pDM_FatTable->pre_TargetAnt_enhance; + } + pDM_FatTable->pre_TargetAnt_enhance=pDM_FatTable->TargetAnt_enhance; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*** Client[ %d ] : MainEVM_Cnt = (( %d )) , Main_EVM= (( %d )) \n",i, pDM_FatTable->MainAntEVM_Cnt[i], Main_EVM)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*** Client[ %d ] : AuxEVM_Cnt = (( %d )) , Aux_EVM = (( %d )) \n" ,i, pDM_FatTable->AuxAntEVM_Cnt[i] , Aux_EVM)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*** TargetAnt_EVM = (( %s ))\n", ( pDM_FatTable->TargetAnt_EVM ==MAIN_ANT)?"MAIN_ANT":"AUX_ANT")); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("M_CRC_Ok = (( %d )) , M_CRC_Fail = (( %d )), Main_CRC_utility = (( %d )) \n" , pDM_FatTable->MainCRC32_Ok_Cnt, pDM_FatTable->MainCRC32_Fail_Cnt,Main_CRC_utility)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("A_CRC_Ok = (( %d )) , A_CRC_Fail = (( %d )), Aux_CRC_utility = (( %d )) \n" , pDM_FatTable->AuxCRC32_Ok_Cnt, pDM_FatTable->AuxCRC32_Fail_Cnt,Aux_CRC_utility)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*** TargetAnt_CRC32 = (( %s ))\n", ( pDM_FatTable->TargetAnt_CRC32 ==MAIN_ANT)?"MAIN_ANT":"AUX_ANT")); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("****** TargetAnt_enhance = (( %s ))******\n", ( pDM_FatTable->TargetAnt_enhance ==MAIN_ANT)?"MAIN_ANT":"AUX_ANT")); + + + } + } + else // RSSI< = Evm_RSSI_TH_Low + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ TH_L ] \n")); + odm_EVM_FastAnt_Reset(pDM_Odm); + } + } + else + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[escape from> TH_H || EVM_method_enable==1] \n")); + odm_EVM_FastAnt_Reset(pDM_Odm); + } + } + else + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[multi-Client] \n")); + odm_EVM_FastAnt_Reset(pDM_Odm); + } + } +} + +VOID +odm_EVM_FastAntTrainingCallback( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("******odm_EVM_FastAntTrainingCallback****** \n")); + odm_HW_AntDiv(pDM_Odm); +} +#endif + +VOID +odm_HW_AntDiv( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + u4Byte i,MinMaxRSSI=0xFF, AntDivMaxRSSI=0, MaxRSSI=0, LocalMaxRSSI; + u4Byte Main_RSSI, Aux_RSSI; + u1Byte RxIdleAnt=0, TargetAnt=7; + pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; + pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable; + PSTA_INFO_T pEntry; + + #ifdef BEAMFORMING_SUPPORT + #if(DM_ODM_SUPPORT_TYPE == ODM_AP) + pBDC_T pDM_BdcTable = &pDM_Odm->DM_BdcTable; + u4Byte TH1=500000; + u4Byte TH2=10000000; + u4Byte MA_rx_Temp, degrade_TP_temp, improve_TP_temp; + u1Byte Monitor_RSSI_threshold=30; + + pDM_BdcTable->BF_pass=TRUE; + pDM_BdcTable->DIV_pass=TRUE; + pDM_BdcTable->bAll_DivSta_Idle=TRUE; + pDM_BdcTable->bAll_BFSta_Idle=TRUE; + pDM_BdcTable->num_BfTar=0 ; + pDM_BdcTable->num_DivTar=0; + pDM_BdcTable->num_Client=0; + #endif + #endif + + if(!pDM_Odm->bLinked) //bLinked==False + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[No Link!!!]\n")); + + if(pDM_FatTable->bBecomeLinked == TRUE) + { + odm_AntDiv_on_off(pDM_Odm, ANTDIV_OFF); + ODM_UpdateRxIdleAnt(pDM_Odm, MAIN_ANT); + odm_Tx_By_TxDesc_or_Reg(pDM_Odm , REG); + pDM_Odm->antdiv_period=0; + + pDM_FatTable->bBecomeLinked = pDM_Odm->bLinked; + } + return; + } + else + { + if(pDM_FatTable->bBecomeLinked ==FALSE) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[Linked !!!]\n")); + odm_AntDiv_on_off(pDM_Odm, ANTDIV_ON); + odm_Tx_By_TxDesc_or_Reg(pDM_Odm , TX_BY_DESC); + + //if(pDM_Odm->SupportICType == ODM_RTL8821 ) + //ODM_SetBBReg(pDM_Odm, 0x800 , BIT25, 0); //CCK AntDiv function disable + + //#if(DM_ODM_SUPPORT_TYPE == ODM_AP) + //else if(pDM_Odm->SupportICType == ODM_RTL8881A) + // ODM_SetBBReg(pDM_Odm, 0x800 , BIT25, 0); //CCK AntDiv function disable + //#endif + + //else if(pDM_Odm->SupportICType == ODM_RTL8723B ||pDM_Odm->SupportICType == ODM_RTL8812) + //ODM_SetBBReg(pDM_Odm, 0xA00 , BIT15, 0); //CCK AntDiv function disable + + pDM_FatTable->bBecomeLinked = pDM_Odm->bLinked; + + if(pDM_Odm->SupportICType==ODM_RTL8723B && pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV) + { + ODM_SetBBReg(pDM_Odm, 0x930 , 0xF0, 8); // DPDT_P = ANTSEL[0] // for 8723B AntDiv function patch. BB Dino 130412 + ODM_SetBBReg(pDM_Odm, 0x930 , 0xF, 8); // DPDT_N = ANTSEL[0] + } + + //2 BDC Init + #ifdef BEAMFORMING_SUPPORT + #if(DM_ODM_SUPPORT_TYPE == ODM_AP) + odm_BDC_Init(pDM_Odm); + #endif + #endif + + #ifdef ODM_EVM_ENHANCE_ANTDIV + odm_EVM_FastAnt_Reset(pDM_Odm); + #endif + } + } + + //ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("\n AntDiv Start =>\n")); + + #ifdef ODM_EVM_ENHANCE_ANTDIV + if(pDM_Odm->antdiv_evm_en==1) + { + odm_EVM_Enhance_AntDiv(pDM_Odm); + if(pDM_FatTable->FAT_State !=NORMAL_STATE_MIAN) + return; + } + else + { + odm_EVM_FastAnt_Reset(pDM_Odm); + } + #endif + + //2 BDC Mode Arbitration + #ifdef BEAMFORMING_SUPPORT + #if(DM_ODM_SUPPORT_TYPE == ODM_AP) + if(pDM_Odm->antdiv_evm_en == 0 ||pDM_FatTable->EVM_method_enable==0) + { + odm_BF_AntDiv_ModeArbitration(pDM_Odm); + } + #endif + #endif + + for (i=0; ipODM_StaInfo[i]; + if(IS_STA_VALID(pEntry)) + { + //2 Caculate RSSI per Antenna + Main_RSSI = (pDM_FatTable->MainAnt_Cnt[i]!=0)?(pDM_FatTable->MainAnt_Sum[i]/pDM_FatTable->MainAnt_Cnt[i]):0; + Aux_RSSI = (pDM_FatTable->AuxAnt_Cnt[i]!=0)?(pDM_FatTable->AuxAnt_Sum[i]/pDM_FatTable->AuxAnt_Cnt[i]):0; + TargetAnt = (Main_RSSI==Aux_RSSI)?pDM_FatTable->RxIdleAnt:((Main_RSSI>=Aux_RSSI)?MAIN_ANT:AUX_ANT); + + //ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("*** SupportICType=[%d] \n",pDM_Odm->SupportICType)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*** Client[ %d ] : Main_Cnt = (( %d )) , Main_RSSI= (( %d )) \n",i, pDM_FatTable->MainAnt_Cnt[i], Main_RSSI)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*** Client[ %d ] : Aux_Cnt = (( %d )) , Aux_RSSI = (( %d )) \n" ,i, pDM_FatTable->AuxAnt_Cnt[i] , Aux_RSSI)); + //ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*** MAC ID:[ %d ] , TargetAnt = (( %s )) \n", i ,( TargetAnt ==MAIN_ANT)?"MAIN_ANT":"AUX_ANT")); + //ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("*** Phy_AntSel_A=[ %d, %d, %d] \n",((pDM_Odm->DM_FatTable.antsel_rx_keep_0)&BIT2)>>2, + // ((pDM_Odm->DM_FatTable.antsel_rx_keep_0)&BIT1) >>1, ((pDM_Odm->DM_FatTable.antsel_rx_keep_0)&BIT0))); + + LocalMaxRSSI = (Main_RSSI>Aux_RSSI)?Main_RSSI:Aux_RSSI; + //2 Select MaxRSSI for DIG + if((LocalMaxRSSI > AntDivMaxRSSI) && (LocalMaxRSSI < 40)) + AntDivMaxRSSI = LocalMaxRSSI; + if(LocalMaxRSSI > MaxRSSI) + MaxRSSI = LocalMaxRSSI; + + //2 Select RX Idle Antenna + if ( (LocalMaxRSSI != 0) && (LocalMaxRSSI < MinMaxRSSI) ) + { + RxIdleAnt = TargetAnt; + MinMaxRSSI = LocalMaxRSSI; + } + + #ifdef ODM_EVM_ENHANCE_ANTDIV + if(pDM_Odm->antdiv_evm_en==1) + { + if(pDM_FatTable->TargetAnt_enhance!=0xFF) + { + TargetAnt=pDM_FatTable->TargetAnt_enhance; + RxIdleAnt = pDM_FatTable->TargetAnt_enhance; + } + } + #endif + + //2 Select TX Antenna + if(pDM_Odm->AntDivType != CGCS_RX_HW_ANTDIV) + { + #ifdef BEAMFORMING_SUPPORT + #if(DM_ODM_SUPPORT_TYPE == ODM_AP) + if(pDM_BdcTable->w_BFee_Client[i]==0) + #endif + #endif + { + odm_UpdateTxAnt(pDM_Odm, TargetAnt, i); + } + } + + //------------------------------------------------------------ + + #ifdef BEAMFORMING_SUPPORT + #if(DM_ODM_SUPPORT_TYPE == ODM_AP) + + pDM_BdcTable->num_Client++; + + if(pDM_BdcTable->BDC_Mode==BDC_MODE_2 ||pDM_BdcTable->BDC_Mode==BDC_MODE_3) + { + //2 Byte Counter + + MA_rx_Temp= (pEntry->rx_byte_cnt_LowMAW)<<3 ; // RX TP ( bit /sec) + + if(pDM_BdcTable->BDC_state==BDC_BFer_TRAIN_STATE) + { + pDM_BdcTable->MA_rx_TP_DIV[i]= MA_rx_Temp ; + } + else + { + pDM_BdcTable->MA_rx_TP[i] =MA_rx_Temp ; + } + + if( (MA_rx_Temp < TH2) && (MA_rx_Temp > TH1) && (LocalMaxRSSI<=Monitor_RSSI_threshold)) + { + if(pDM_BdcTable->w_BFer_Client[i]==1) // Bfer_Target + { + pDM_BdcTable->num_BfTar++; + + if(pDM_BdcTable->BDC_state==BDC_DECISION_STATE && pDM_BdcTable->BDC_Try_flag==0) + { + improve_TP_temp = (pDM_BdcTable->MA_rx_TP_DIV[i] * 9)>>3 ; //* 1.125 + pDM_BdcTable->BF_pass = (pDM_BdcTable->MA_rx_TP[i] > improve_TP_temp)?TRUE:FALSE; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*** Client[ %d ] : { MA_rx_TP,improve_TP_temp , MA_rx_TP_DIV, BF_pass}={ %d, %d, %d , %d } \n" ,i,pDM_BdcTable->MA_rx_TP[i],improve_TP_temp,pDM_BdcTable->MA_rx_TP_DIV[i], pDM_BdcTable->BF_pass )); + } + } + else// DIV_Target + { + pDM_BdcTable->num_DivTar++; + + if(pDM_BdcTable->BDC_state==BDC_DECISION_STATE && pDM_BdcTable->BDC_Try_flag==0) + { + degrade_TP_temp=(pDM_BdcTable->MA_rx_TP_DIV[i]*5)>>3;//* 0.625 + pDM_BdcTable->DIV_pass = (pDM_BdcTable->MA_rx_TP[i] >degrade_TP_temp)?TRUE:FALSE; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*** Client[ %d ] : { MA_rx_TP, degrade_TP_temp , MA_rx_TP_DIV, DIV_pass}=\n{ %d, %d, %d , %d } \n" ,i,pDM_BdcTable->MA_rx_TP[i],degrade_TP_temp,pDM_BdcTable->MA_rx_TP_DIV[i], pDM_BdcTable->DIV_pass )); + } + } + } + + if(MA_rx_Temp > TH1) + { + if(pDM_BdcTable->w_BFer_Client[i]==1) // Bfer_Target + { + pDM_BdcTable->bAll_BFSta_Idle=FALSE; + } + else// DIV_Target + { + pDM_BdcTable->bAll_DivSta_Idle=FALSE; + } + } + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*** Client[ %d ] : { BFmeeCap , BFmerCap} = { %d , %d } \n" ,i, pDM_BdcTable->w_BFee_Client[i] , pDM_BdcTable->w_BFer_Client[i])); + + if(pDM_BdcTable->BDC_state==BDC_BFer_TRAIN_STATE) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*** Client[ %d ] : MA_rx_TP_DIV = (( %d )) \n",i,pDM_BdcTable->MA_rx_TP_DIV[i] )); + + } + else + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*** Client[ %d ] : MA_rx_TP = (( %d )) \n",i,pDM_BdcTable->MA_rx_TP[i] )); + } + + } + #endif + #endif + + } + + #ifdef BEAMFORMING_SUPPORT + #if(DM_ODM_SUPPORT_TYPE == ODM_AP) + if(pDM_BdcTable->BDC_Try_flag==0) + #endif + #endif + { + pDM_FatTable->MainAnt_Sum[i] = 0; + pDM_FatTable->AuxAnt_Sum[i] = 0; + pDM_FatTable->MainAnt_Cnt[i] = 0; + pDM_FatTable->AuxAnt_Cnt[i] = 0; + } + } + + + + //2 Set RX Idle Antenna & TX Antenna(Because of HW Bug ) + #if(DM_ODM_SUPPORT_TYPE == ODM_AP ) + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*** RxIdleAnt = (( %s ))\n\n", ( RxIdleAnt ==MAIN_ANT)?"MAIN_ANT":"AUX_ANT")); + + #ifdef BEAMFORMING_SUPPORT + #if(DM_ODM_SUPPORT_TYPE == ODM_AP) + if(pDM_BdcTable->BDC_Mode==BDC_MODE_1 ||pDM_BdcTable->BDC_Mode==BDC_MODE_3) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*** BDC_RxIdleUpdate_counter = (( %d ))\n", pDM_BdcTable->BDC_RxIdleUpdate_counter)); + + if(pDM_BdcTable->BDC_RxIdleUpdate_counter==1) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***Update RxIdle Antenna!!! \n")); + pDM_BdcTable->BDC_RxIdleUpdate_counter=30; + ODM_UpdateRxIdleAnt(pDM_Odm, RxIdleAnt); + } + else + { + pDM_BdcTable->BDC_RxIdleUpdate_counter--; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***NOT update RxIdle Antenna because of BF ( need to fix TX-ant)\n")); + } + } + else + #endif + #endif + ODM_UpdateRxIdleAnt(pDM_Odm, RxIdleAnt); + #else + + ODM_UpdateRxIdleAnt(pDM_Odm, RxIdleAnt); + + #endif//#if(DM_ODM_SUPPORT_TYPE == ODM_AP) + + + + //2 BDC Main Algorithm + #ifdef BEAMFORMING_SUPPORT + #if(DM_ODM_SUPPORT_TYPE == ODM_AP) + if(pDM_Odm->antdiv_evm_en ==0 ||pDM_FatTable->EVM_method_enable==0) + { + odm_BDCcoex_BFeeRxDiv_Arbitration(pDM_Odm); + } + #endif + #endif + + if(AntDivMaxRSSI == 0) + pDM_DigTable->AntDiv_RSSI_max = pDM_Odm->RSSI_Min; + else + pDM_DigTable->AntDiv_RSSI_max = AntDivMaxRSSI; + + pDM_DigTable->RSSI_max = MaxRSSI; +} + + + +#if (RTL8723B_SUPPORT == 1)||(RTL8821A_SUPPORT == 1) +VOID +odm_S0S1_SwAntDiv( + IN PVOID pDM_VOID, + IN u1Byte Step + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + u4Byte i,MinMaxRSSI=0xFF, LocalMaxRSSI,LocalMinRSSI; + u4Byte Main_RSSI, Aux_RSSI; + u1Byte reset_period=10, SWAntDiv_threshold=35; + u1Byte HighTraffic_TrainTime_U=0x32,HighTraffic_TrainTime_L=0,Train_time_temp; + u1Byte LowTraffic_TrainTime_U=200,LowTraffic_TrainTime_L=0; + pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; + pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; + u1Byte RxIdleAnt = pDM_SWAT_Table->PreAntenna, TargetAnt, nextAnt=0; + PSTA_INFO_T pEntry=NULL; + //static u1Byte reset_idx; + u4Byte value32; + PADAPTER Adapter = pDM_Odm->Adapter; + u8Byte curTxOkCnt=0, curRxOkCnt=0,TxCntOffset, RxCntOffset; + + if(!pDM_Odm->bLinked) //bLinked==False + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[No Link!!!]\n")); + if(pDM_FatTable->bBecomeLinked == TRUE) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Set REG 948[9:6]=0x0 \n")); + if(pDM_Odm->SupportICType == ODM_RTL8723B) + ODM_SetBBReg(pDM_Odm, 0x948 , BIT9|BIT8|BIT7|BIT6, 0x0); + + pDM_FatTable->bBecomeLinked = pDM_Odm->bLinked; + } + return; + } + else + { + if(pDM_FatTable->bBecomeLinked ==FALSE) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[Linked !!!]\n")); + + if(pDM_Odm->SupportICType == ODM_RTL8723B) + { + value32 = ODM_GetBBReg(pDM_Odm, 0x864, BIT5|BIT4|BIT3); + + if (value32==0x0) + ODM_UpdateRxIdleAnt_8723B(pDM_Odm, MAIN_ANT, ANT1_2G, ANT2_2G); + else if (value32==0x1) + ODM_UpdateRxIdleAnt_8723B(pDM_Odm, AUX_ANT, ANT2_2G, ANT1_2G); + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("8723B: First link! Force antenna to %s\n",(value32 == 0x0?"MAIN":"AUX") )); + } + + pDM_SWAT_Table->lastTxOkCnt = 0; + pDM_SWAT_Table->lastRxOkCnt =0; + TxCntOffset = *(pDM_Odm->pNumTxBytesUnicast); + RxCntOffset = *(pDM_Odm->pNumRxBytesUnicast); + + pDM_FatTable->bBecomeLinked = pDM_Odm->bLinked; + } + else + { + TxCntOffset = 0; + RxCntOffset = 0; + } + } + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[%d] { try_flag=(( %d )), Step=(( %d )), Double_chk_flag = (( %d )) }\n", + __LINE__,pDM_SWAT_Table->try_flag,Step,pDM_SWAT_Table->Double_chk_flag)); + + // Handling step mismatch condition. + // Peak step is not finished at last time. Recover the variable and check again. + if( Step != pDM_SWAT_Table->try_flag ) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[Step != try_flag] Need to Reset After Link\n")); + ODM_SwAntDivRestAfterLink(pDM_Odm); + } + + if(pDM_SWAT_Table->try_flag == 0xff) + { + pDM_SWAT_Table->try_flag = 0; + pDM_SWAT_Table->Train_time_flag=0; + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("[set try_flag = 0] Prepare for peak!\n\n")); + return; + } + else//if( try_flag != 0xff ) + { + //1 Normal State (Begin Trying) + if(pDM_SWAT_Table->try_flag == 0) + { + + //---trafic decision--- + curTxOkCnt = *(pDM_Odm->pNumTxBytesUnicast) - pDM_SWAT_Table->lastTxOkCnt - TxCntOffset; + curRxOkCnt = *(pDM_Odm->pNumRxBytesUnicast) - pDM_SWAT_Table->lastRxOkCnt - RxCntOffset; + pDM_SWAT_Table->lastTxOkCnt = *(pDM_Odm->pNumTxBytesUnicast); + pDM_SWAT_Table->lastRxOkCnt = *(pDM_Odm->pNumRxBytesUnicast); + + if (curTxOkCnt > 1875000 || curRxOkCnt > 1875000)//if(PlatformDivision64(curTxOkCnt+curRxOkCnt, 2) > 1875000) ( 1.875M * 8bit ) / 2= 7.5M bits /sec ) + { + pDM_SWAT_Table->TrafficLoad = TRAFFIC_HIGH; + Train_time_temp = pDM_SWAT_Table->Train_time ; + + if(pDM_SWAT_Table->Train_time_flag==3) + { + HighTraffic_TrainTime_L=0xa; + + if(Train_time_temp<=16) + Train_time_temp=HighTraffic_TrainTime_L; + else + Train_time_temp-=16; + + } + else if(pDM_SWAT_Table->Train_time_flag==2) + { + Train_time_temp-=8; + HighTraffic_TrainTime_L=0xf; + } + else if(pDM_SWAT_Table->Train_time_flag==1) + { + Train_time_temp-=4; + HighTraffic_TrainTime_L=0x1e; + } + else if(pDM_SWAT_Table->Train_time_flag==0) + { + Train_time_temp+=8; + HighTraffic_TrainTime_L=0x28; + } + + + //ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*** Train_time_temp = ((%d))\n",Train_time_temp)); + + //-- + if(Train_time_temp > HighTraffic_TrainTime_U) + Train_time_temp=HighTraffic_TrainTime_U; + + else if(Train_time_temp < HighTraffic_TrainTime_L) + Train_time_temp=HighTraffic_TrainTime_L; + + pDM_SWAT_Table->Train_time = Train_time_temp; //50ms~10ms + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,(" Train_time_flag=((%d)) , Train_time=((%d)) \n",pDM_SWAT_Table->Train_time_flag, pDM_SWAT_Table->Train_time)); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, (" [HIGH Traffic] \n" )); + } + else if (curTxOkCnt > 125000 || curRxOkCnt > 125000) // ( 0.125M * 8bit ) / 2 = 0.5M bits /sec ) + { + pDM_SWAT_Table->TrafficLoad = TRAFFIC_LOW; + Train_time_temp=pDM_SWAT_Table->Train_time ; + + if(pDM_SWAT_Table->Train_time_flag==3) + { + LowTraffic_TrainTime_L=10; + if(Train_time_temp<50) + Train_time_temp=LowTraffic_TrainTime_L; + else + Train_time_temp-=50; + } + else if(pDM_SWAT_Table->Train_time_flag==2) + { + Train_time_temp-=30; + LowTraffic_TrainTime_L=36; + } + else if(pDM_SWAT_Table->Train_time_flag==1) + { + Train_time_temp-=10; + LowTraffic_TrainTime_L=40; + } + else + Train_time_temp+=10; + + //-- + if(Train_time_temp >= LowTraffic_TrainTime_U) + Train_time_temp=LowTraffic_TrainTime_U; + + else if(Train_time_temp <= LowTraffic_TrainTime_L) + Train_time_temp=LowTraffic_TrainTime_L; + + pDM_SWAT_Table->Train_time = Train_time_temp; //50ms~20ms + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,(" Train_time_flag=((%d)) , Train_time=((%d)) \n",pDM_SWAT_Table->Train_time_flag, pDM_SWAT_Table->Train_time)); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, (" [Low Traffic] \n" )); + } + else + { + pDM_SWAT_Table->TrafficLoad = TRAFFIC_UltraLOW; + pDM_SWAT_Table->Train_time = 0xc8; //200ms + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, (" [Ultra-Low Traffic] \n" )); + } + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("TxOkCnt=(( %llu )), RxOkCnt=(( %llu )) \n", + curTxOkCnt ,curRxOkCnt )); + + //----------------- + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,(" Current MinMaxRSSI is ((%d)) \n",pDM_FatTable->MinMaxRSSI)); + + //---reset index--- + if(pDM_SWAT_Table->reset_idx>=reset_period) + { + pDM_FatTable->MinMaxRSSI=0; // + pDM_SWAT_Table->reset_idx=0; + } + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("reset_idx = (( %d )) \n",pDM_SWAT_Table->reset_idx )); + //ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("reset_idx=%d\n",pDM_SWAT_Table->reset_idx)); + pDM_SWAT_Table->reset_idx++; + + //---double check flag--- + if(pDM_FatTable->MinMaxRSSI > SWAntDiv_threshold && pDM_SWAT_Table->Double_chk_flag== 0) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,(" MinMaxRSSI is ((%d)), and > %d \n", + pDM_FatTable->MinMaxRSSI,SWAntDiv_threshold)); + + pDM_SWAT_Table->Double_chk_flag =1; + pDM_SWAT_Table->try_flag = 1; + pDM_SWAT_Table->RSSI_Trying = 0; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, (" Test the current Ant for (( %d )) ms again \n", pDM_SWAT_Table->Train_time)); + ODM_UpdateRxIdleAnt(pDM_Odm, pDM_FatTable->RxIdleAnt); + ODM_SetTimer(pDM_Odm,&pDM_SWAT_Table->SwAntennaSwitchTimer_8723B, pDM_SWAT_Table->Train_time ); //ms + return; + } + + nextAnt = (pDM_FatTable->RxIdleAnt == MAIN_ANT)? AUX_ANT : MAIN_ANT; + + pDM_SWAT_Table->try_flag = 1; + + if(pDM_SWAT_Table->reset_idx<=1) + pDM_SWAT_Table->RSSI_Trying = 2; + else + pDM_SWAT_Table->RSSI_Trying = 1; + + odm_S0S1_SwAntDivByCtrlFrame(pDM_Odm, SWAW_STEP_PEAK); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("[set try_flag=1] Normal State: Begin Trying!! \n")); + } + + else if(pDM_SWAT_Table->try_flag == 1 && pDM_SWAT_Table->Double_chk_flag== 0) + { + nextAnt = (pDM_FatTable->RxIdleAnt == MAIN_ANT)? AUX_ANT : MAIN_ANT; + pDM_SWAT_Table->RSSI_Trying--; + } + + //1 Decision State + if((pDM_SWAT_Table->try_flag == 1)&&(pDM_SWAT_Table->RSSI_Trying == 0) ) + { + BOOLEAN bByCtrlFrame = FALSE; + u8Byte pkt_cnt_total = 0; + + for (i=0; ipODM_StaInfo[i]; + if(IS_STA_VALID(pEntry)) + { + //2 Caculate RSSI per Antenna + Main_RSSI = (pDM_FatTable->MainAnt_Cnt[i]!=0)?(pDM_FatTable->MainAnt_Sum[i]/pDM_FatTable->MainAnt_Cnt[i]):0; + Aux_RSSI = (pDM_FatTable->AuxAnt_Cnt[i]!=0)?(pDM_FatTable->AuxAnt_Sum[i]/pDM_FatTable->AuxAnt_Cnt[i]):0; + + if(pDM_FatTable->MainAnt_Cnt[i]<=1 && pDM_FatTable->CCK_counter_main>=1) + Main_RSSI=0; + + if(pDM_FatTable->AuxAnt_Cnt[i]<=1 && pDM_FatTable->CCK_counter_aux>=1) + Aux_RSSI=0; + + TargetAnt = (Main_RSSI==Aux_RSSI)?pDM_SWAT_Table->PreAntenna:((Main_RSSI>=Aux_RSSI)?MAIN_ANT:AUX_ANT); + LocalMaxRSSI = (Main_RSSI>=Aux_RSSI) ? Main_RSSI : Aux_RSSI; + LocalMinRSSI = (Main_RSSI>=Aux_RSSI) ? Aux_RSSI : Main_RSSI; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*** CCK_counter_main = (( %d )) , CCK_counter_aux= (( %d )) \n", pDM_FatTable->CCK_counter_main, pDM_FatTable->CCK_counter_aux)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*** OFDM_counter_main = (( %d )) , OFDM_counter_aux= (( %d )) \n", pDM_FatTable->OFDM_counter_main, pDM_FatTable->OFDM_counter_aux)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*** Main_Cnt = (( %d )) , Main_RSSI= (( %d )) \n", pDM_FatTable->MainAnt_Cnt[i], Main_RSSI)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*** Aux_Cnt = (( %d )) , Aux_RSSI = (( %d )) \n", pDM_FatTable->AuxAnt_Cnt[i] , Aux_RSSI )); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*** MAC ID:[ %d ] , TargetAnt = (( %s )) \n", i ,( TargetAnt ==MAIN_ANT)?"MAIN_ANT":"AUX_ANT")); + + //2 Select RX Idle Antenna + + if (LocalMaxRSSI != 0 && LocalMaxRSSI < MinMaxRSSI) + { + RxIdleAnt = TargetAnt; + MinMaxRSSI = LocalMaxRSSI; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*** LocalMaxRSSI-LocalMinRSSI = ((%d))\n",(LocalMaxRSSI-LocalMinRSSI))); + + if((LocalMaxRSSI-LocalMinRSSI)>8) + { + if(LocalMinRSSI != 0) + pDM_SWAT_Table->Train_time_flag=3; + else + { + if(MinMaxRSSI > SWAntDiv_threshold) + pDM_SWAT_Table->Train_time_flag=0; + else + pDM_SWAT_Table->Train_time_flag=3; + } + } + else if((LocalMaxRSSI-LocalMinRSSI)>5) + pDM_SWAT_Table->Train_time_flag=2; + else if((LocalMaxRSSI-LocalMinRSSI)>2) + pDM_SWAT_Table->Train_time_flag=1; + else + pDM_SWAT_Table->Train_time_flag=0; + + } + + //2 Select TX Antenna + if(TargetAnt == MAIN_ANT) + pDM_FatTable->antsel_a[i] = ANT1_2G; + else + pDM_FatTable->antsel_a[i] = ANT2_2G; + + } + pDM_FatTable->MainAnt_Sum[i] = 0; + pDM_FatTable->AuxAnt_Sum[i] = 0; + pDM_FatTable->MainAnt_Cnt[i] = 0; + pDM_FatTable->AuxAnt_Cnt[i] = 0; + } + + if(pDM_SWAT_Table->bSWAntDivByCtrlFrame) + { + odm_S0S1_SwAntDivByCtrlFrame(pDM_Odm, SWAW_STEP_DETERMINE); + bByCtrlFrame = TRUE; + } + + pkt_cnt_total = pDM_FatTable->CCK_counter_main + pDM_FatTable->CCK_counter_aux + + pDM_FatTable->OFDM_counter_main + pDM_FatTable->OFDM_counter_aux; + pDM_FatTable->CCK_counter_main=0; + pDM_FatTable->CCK_counter_aux=0; + pDM_FatTable->OFDM_counter_main=0; + pDM_FatTable->OFDM_counter_aux=0; + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("Control frame packet counter = %d, Data frame packet counter = %llu\n", + pDM_SWAT_Table->PktCnt_SWAntDivByCtrlFrame, pkt_cnt_total)); + + if(MinMaxRSSI == 0xff || ((pkt_cnt_total < (pDM_SWAT_Table->PktCnt_SWAntDivByCtrlFrame >> 1)) && pDM_Odm->PhyDbgInfo.NumQryBeaconPkt < 2)) + { + MinMaxRSSI = 0; + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("Check RSSI of control frame because MinMaxRSSI == 0xff\n")); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("bByCtrlFrame = %d\n", bByCtrlFrame)); + + if(bByCtrlFrame) + { + Main_RSSI = (pDM_FatTable->MainAnt_CtrlFrame_Cnt!=0)?(pDM_FatTable->MainAnt_CtrlFrame_Sum/pDM_FatTable->MainAnt_CtrlFrame_Cnt):0; + Aux_RSSI = (pDM_FatTable->AuxAnt_CtrlFrame_Cnt!=0)?(pDM_FatTable->AuxAnt_CtrlFrame_Sum/pDM_FatTable->AuxAnt_CtrlFrame_Cnt):0; + + if(pDM_FatTable->MainAnt_CtrlFrame_Cnt<=1 && pDM_FatTable->CCK_CtrlFrame_Cnt_main>=1) + Main_RSSI=0; + + if(pDM_FatTable->AuxAnt_CtrlFrame_Cnt<=1 && pDM_FatTable->CCK_CtrlFrame_Cnt_aux>=1) + Aux_RSSI=0; + + if (Main_RSSI != 0 || Aux_RSSI != 0) + { + RxIdleAnt = (Main_RSSI==Aux_RSSI)?pDM_SWAT_Table->PreAntenna:((Main_RSSI>=Aux_RSSI)?MAIN_ANT:AUX_ANT); + LocalMaxRSSI = (Main_RSSI>=Aux_RSSI) ? Main_RSSI : Aux_RSSI; + LocalMinRSSI = (Main_RSSI>=Aux_RSSI) ? Aux_RSSI : Main_RSSI; + + if((LocalMaxRSSI-LocalMinRSSI)>8) + pDM_SWAT_Table->Train_time_flag=3; + else if((LocalMaxRSSI-LocalMinRSSI)>5) + pDM_SWAT_Table->Train_time_flag=2; + else if((LocalMaxRSSI-LocalMinRSSI)>2) + pDM_SWAT_Table->Train_time_flag=1; + else + pDM_SWAT_Table->Train_time_flag=0; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("Control frame: Main_RSSI = %d, Aux_RSSI = %d\n", Main_RSSI, Aux_RSSI)); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("RxIdleAnt decided by control frame = %s\n", (RxIdleAnt == MAIN_ANT?"MAIN":"AUX"))); + } + } + } + + pDM_FatTable->MinMaxRSSI = MinMaxRSSI; + pDM_SWAT_Table->try_flag = 0; + + if( pDM_SWAT_Table->Double_chk_flag==1) + { + pDM_SWAT_Table->Double_chk_flag=0; + if(pDM_FatTable->MinMaxRSSI > SWAntDiv_threshold) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,(" [Double check] MinMaxRSSI ((%d)) > %d again!! \n", + pDM_FatTable->MinMaxRSSI,SWAntDiv_threshold)); + + ODM_UpdateRxIdleAnt(pDM_Odm, RxIdleAnt); + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("[reset try_flag = 0] Training accomplished !!!] \n\n\n")); + return; + } + else + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,(" [Double check] MinMaxRSSI ((%d)) <= %d !! \n", + pDM_FatTable->MinMaxRSSI,SWAntDiv_threshold)); + + nextAnt = (pDM_FatTable->RxIdleAnt == MAIN_ANT)? AUX_ANT : MAIN_ANT; + pDM_SWAT_Table->try_flag = 0; + pDM_SWAT_Table->reset_idx=reset_period; + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("[set try_flag=0] Normal State: Need to tryg again!! \n\n\n")); + return; + } + } + else + { + if(pDM_FatTable->MinMaxRSSI < SWAntDiv_threshold) + pDM_SWAT_Table->reset_idx=reset_period; + + pDM_SWAT_Table->PreAntenna =RxIdleAnt; + ODM_UpdateRxIdleAnt(pDM_Odm, RxIdleAnt ); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("[reset try_flag = 0] Training accomplished !!!] \n\n\n")); + return; + } + + } + + } + + //1 4.Change TRX antenna + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("RSSI_Trying = (( %d )), Ant: (( %s )) >>> (( %s )) \n", + pDM_SWAT_Table->RSSI_Trying, (pDM_FatTable->RxIdleAnt == MAIN_ANT?"MAIN":"AUX"),(nextAnt == MAIN_ANT?"MAIN":"AUX"))); + + ODM_UpdateRxIdleAnt(pDM_Odm, nextAnt); + + //1 5.Reset Statistics + + pDM_FatTable->RxIdleAnt = nextAnt; + + //1 6.Set next timer (Trying State) + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, (" Test ((%s)) Ant for (( %d )) ms \n", (nextAnt == MAIN_ANT?"MAIN":"AUX"), pDM_SWAT_Table->Train_time)); + ODM_SetTimer(pDM_Odm,&pDM_SWAT_Table->SwAntennaSwitchTimer_8723B, pDM_SWAT_Table->Train_time ); //ms +} + + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) +VOID +ODM_SW_AntDiv_Callback( + PRT_TIMER pTimer +) +{ + PADAPTER Adapter = (PADAPTER)pTimer->Adapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + pSWAT_T pDM_SWAT_Table = &pHalData->DM_OutSrc.DM_SWAT_Table; + + #if DEV_BUS_TYPE==RT_PCI_INTERFACE + #if USE_WORKITEM + ODM_ScheduleWorkItem(&pDM_SWAT_Table->SwAntennaSwitchWorkitem_8723B); + #else + { + //DbgPrint("SW_antdiv_Callback"); + odm_S0S1_SwAntDiv(&pHalData->DM_OutSrc, SWAW_STEP_DETERMINE); + } + #endif + #else + ODM_ScheduleWorkItem(&pDM_SWAT_Table->SwAntennaSwitchWorkitem_8723B); + #endif +} +VOID +ODM_SW_AntDiv_WorkitemCallback( + IN PVOID pContext + ) +{ + PADAPTER pAdapter = (PADAPTER)pContext; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); + + //DbgPrint("SW_antdiv_Workitem_Callback"); + odm_S0S1_SwAntDiv(&pHalData->DM_OutSrc, SWAW_STEP_DETERMINE); +} + +#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) + +VOID +ODM_SW_AntDiv_Callback(void *FunctionContext) +{ + PDM_ODM_T pDM_Odm= (PDM_ODM_T)FunctionContext; + PADAPTER padapter = pDM_Odm->Adapter; + if(padapter->net_closed == _TRUE) + return; + odm_S0S1_SwAntDiv(pDM_Odm, SWAW_STEP_DETERMINE); +} + + +#endif + +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) +VOID +odm_S0S1_SwAntDivByCtrlFrame( + IN PVOID pDM_VOID, + IN u1Byte Step + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; + pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; + + switch(Step) + { + case SWAW_STEP_PEAK: + pDM_SWAT_Table->PktCnt_SWAntDivByCtrlFrame = 0; + pDM_SWAT_Table->bSWAntDivByCtrlFrame = TRUE; + pDM_FatTable->MainAnt_CtrlFrame_Cnt = 0; + pDM_FatTable->AuxAnt_CtrlFrame_Cnt = 0; + pDM_FatTable->MainAnt_CtrlFrame_Sum = 0; + pDM_FatTable->AuxAnt_CtrlFrame_Sum = 0; + pDM_FatTable->CCK_CtrlFrame_Cnt_main = 0; + pDM_FatTable->CCK_CtrlFrame_Cnt_aux = 0; + pDM_FatTable->OFDM_CtrlFrame_Cnt_main = 0; + pDM_FatTable->OFDM_CtrlFrame_Cnt_aux = 0; + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("odm_S0S1_SwAntDivForAPMode(): Start peak and reset counter\n")); + break; + case SWAW_STEP_DETERMINE: + pDM_SWAT_Table->bSWAntDivByCtrlFrame = FALSE; + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("odm_S0S1_SwAntDivForAPMode(): Stop peak\n")); + break; + default: + pDM_SWAT_Table->bSWAntDivByCtrlFrame = FALSE; + break; + } +} + +VOID +odm_AntselStatisticsOfCtrlFrame( + IN PVOID pDM_VOID, + IN u1Byte antsel_tr_mux, + IN u4Byte RxPWDBAll + + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; + + if(antsel_tr_mux == ANT1_2G) + { + pDM_FatTable->MainAnt_CtrlFrame_Sum+=RxPWDBAll; + pDM_FatTable->MainAnt_CtrlFrame_Cnt++; + } + else + { + pDM_FatTable->AuxAnt_CtrlFrame_Sum+=RxPWDBAll; + pDM_FatTable->AuxAnt_CtrlFrame_Cnt++; + } +} + +VOID +odm_S0S1_SwAntDivByCtrlFrame_ProcessRSSI( + IN PVOID pDM_VOID, + IN PVOID p_phy_info_void, + IN PVOID p_pkt_info_void + //IN PODM_PHY_INFO_T pPhyInfo, + //IN PODM_PACKET_INFO_T pPktinfo + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PODM_PHY_INFO_T pPhyInfo=(PODM_PHY_INFO_T)p_phy_info_void; + PODM_PACKET_INFO_T pPktinfo=(PODM_PACKET_INFO_T)p_pkt_info_void; + pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; + pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; + BOOLEAN isCCKrate; + + if(!(pDM_Odm->SupportAbility & ODM_BB_ANT_DIV)) + return; + + if(pDM_Odm->AntDivType != S0S1_SW_ANTDIV) + return; + + // In try state + if(!pDM_SWAT_Table->bSWAntDivByCtrlFrame) + return; + + // No HW error and match receiver address + if(!pPktinfo->bToSelf) + return; + + pDM_SWAT_Table->PktCnt_SWAntDivByCtrlFrame++; + isCCKrate = ((pPktinfo->DataRate >= DESC_RATE1M ) && (pPktinfo->DataRate <= DESC_RATE11M ))?TRUE :FALSE; + + if(isCCKrate) + { + pDM_FatTable->antsel_rx_keep_0 = (pDM_FatTable->RxIdleAnt == MAIN_ANT) ? ANT1_2G : ANT2_2G; + + if(pDM_FatTable->antsel_rx_keep_0==ANT1_2G) + pDM_FatTable->CCK_CtrlFrame_Cnt_main++; + else + pDM_FatTable->CCK_CtrlFrame_Cnt_aux++; + + odm_AntselStatisticsOfCtrlFrame(pDM_Odm, pDM_FatTable->antsel_rx_keep_0, pPhyInfo->RxMIMOSignalStrength[ODM_RF_PATH_A]); + } + else + { + if(pDM_FatTable->antsel_rx_keep_0==ANT1_2G) + pDM_FatTable->OFDM_CtrlFrame_Cnt_main++; + else + pDM_FatTable->OFDM_CtrlFrame_Cnt_aux++; + + odm_AntselStatisticsOfCtrlFrame(pDM_Odm, pDM_FatTable->antsel_rx_keep_0, pPhyInfo->RxPWDBAll); + } +} +#endif //#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + + +#endif //#if (RTL8723B_SUPPORT == 1)||(RTL8821A_SUPPORT == 1) + + +#if( defined(CONFIG_5G_CG_SMART_ANT_DIVERSITY) ) ||( defined(CONFIG_2G_CG_SMART_ANT_DIVERSITY) ) + +VOID +odm_SetNextMACAddrTarget( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; + PSTA_INFO_T pEntry; + //u1Byte Bssid[6]; + u4Byte value32, i; + + // + //2012.03.26 LukeLee: The MAC address is changed according to MACID in turn + // + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("odm_SetNextMACAddrTarget() ==>\n")); + if(pDM_Odm->bLinked) + { + for (i=0; iTrainIdx+1) == ODM_ASSOCIATE_ENTRY_NUM) + pDM_FatTable->TrainIdx = 0; + else + pDM_FatTable->TrainIdx++; + + pEntry = pDM_Odm->pODM_StaInfo[pDM_FatTable->TrainIdx]; + if(IS_STA_VALID(pEntry)) + { + //Match MAC ADDR +#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) + value32 = (pEntry->hwaddr[5]<<8)|pEntry->hwaddr[4]; +#else + value32 = (pEntry->MacAddr[5]<<8)|pEntry->MacAddr[4]; +#endif + + ODM_SetMACReg(pDM_Odm, 0x7b4, 0xFFFF, value32);//0x7b4~0x7b5 + +#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) + value32 = (pEntry->hwaddr[3]<<24)|(pEntry->hwaddr[2]<<16) |(pEntry->hwaddr[1]<<8) |pEntry->hwaddr[0]; +#else + value32 = (pEntry->MacAddr[3]<<24)|(pEntry->MacAddr[2]<<16) |(pEntry->MacAddr[1]<<8) |pEntry->MacAddr[0]; +#endif + ODM_SetMACReg(pDM_Odm, 0x7b0, bMaskDWord, value32);//0x7b0~0x7b3 + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("pDM_FatTable->TrainIdx=%d\n",pDM_FatTable->TrainIdx)); + +#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Training MAC Addr = %x:%x:%x:%x:%x:%x\n", + pEntry->hwaddr[5],pEntry->hwaddr[4],pEntry->hwaddr[3],pEntry->hwaddr[2],pEntry->hwaddr[1],pEntry->hwaddr[0])); +#else + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Training MAC Addr = %x:%x:%x:%x:%x:%x\n", + pEntry->MacAddr[5],pEntry->MacAddr[4],pEntry->MacAddr[3],pEntry->MacAddr[2],pEntry->MacAddr[1],pEntry->MacAddr[0])); +#endif + + break; + } + } + + } + +#if 0 + // + //2012.03.26 LukeLee: This should be removed later, the MAC address is changed according to MACID in turn + // + #if( DM_ODM_SUPPORT_TYPE & ODM_WIN) + { + PADAPTER Adapter = pDM_Odm->Adapter; + PMGNT_INFO pMgntInfo = &Adapter->MgntInfo; + + for (i=0; i<6; i++) + { + Bssid[i] = pMgntInfo->Bssid[i]; + //DbgPrint("Bssid[%d]=%x\n", i, Bssid[i]); + } + } + #endif + + //odm_SetNextMACAddrTarget(pDM_Odm); + + //1 Select MAC Address Filter + for (i=0; i<6; i++) + { + if(Bssid[i] != pDM_FatTable->Bssid[i]) + { + bMatchBSSID = FALSE; + break; + } + } + if(bMatchBSSID == FALSE) + { + //Match MAC ADDR + value32 = (Bssid[5]<<8)|Bssid[4]; + ODM_SetMACReg(pDM_Odm, 0x7b4, 0xFFFF, value32); + value32 = (Bssid[3]<<24)|(Bssid[2]<<16) |(Bssid[1]<<8) |Bssid[0]; + ODM_SetMACReg(pDM_Odm, 0x7b0, bMaskDWord, value32); + } + + return bMatchBSSID; +#endif + +} + +VOID +odm_FastAntTraining( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; + + u4Byte MaxRSSI_pathA=0, Pckcnt_pathA=0; + u1Byte i,TargetAnt_pathA=0; + BOOLEAN bPktFilterMacth_pathA = FALSE; + #if(RTL8192E_SUPPORT == 1) + u4Byte MaxRSSI_pathB=0, Pckcnt_pathB=0; + u1Byte TargetAnt_pathB=0; + BOOLEAN bPktFilterMacth_pathB = FALSE; + #endif + + + if(!pDM_Odm->bLinked) //bLinked==False + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[No Link!!!]\n")); + + if(pDM_FatTable->bBecomeLinked == TRUE) + { + odm_AntDiv_on_off(pDM_Odm, ANTDIV_OFF); + odm_FastTraining_enable(pDM_Odm , FAT_OFF); + odm_Tx_By_TxDesc_or_Reg(pDM_Odm , REG); + pDM_FatTable->bBecomeLinked = pDM_Odm->bLinked; + } + return; + } + else + { + if(pDM_FatTable->bBecomeLinked ==FALSE) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[Linked!!!]\n")); + odm_Tx_By_TxDesc_or_Reg(pDM_Odm , TX_BY_DESC); + pDM_FatTable->bBecomeLinked = pDM_Odm->bLinked; + } + } + + + if(pDM_Odm->SupportICType == ODM_RTL8188E) + { + ODM_SetBBReg(pDM_Odm, 0x864 , BIT2|BIT1|BIT0, ((pDM_Odm->fat_comb_a)-1)); + } + #if(RTL8192E_SUPPORT == 1) + else if(pDM_Odm->SupportICType == ODM_RTL8192E) + { + ODM_SetBBReg(pDM_Odm, 0xB38 , BIT2|BIT1|BIT0, ((pDM_Odm->fat_comb_a)-1) ); //path-A // ant combination=regB38[2:0]+1 + ODM_SetBBReg(pDM_Odm, 0xB38 , BIT18|BIT17|BIT16, ((pDM_Odm->fat_comb_b)-1) ); //path-B // ant combination=regB38[18:16]+1 + } + #endif + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("==>odm_FastAntTraining()\n")); + + //1 TRAINING STATE + if(pDM_FatTable->FAT_State == FAT_TRAINING_STATE) + { + //2 Caculate RSSI per Antenna + + //3 [path-A]--------------------------- + for (i=0; i<(pDM_Odm->fat_comb_a); i++) // i : antenna index + { + if(pDM_FatTable->antRSSIcnt[i] == 0) + pDM_FatTable->antAveRSSI[i] = 0; + else + { + pDM_FatTable->antAveRSSI[i] = pDM_FatTable->antSumRSSI[i] /pDM_FatTable->antRSSIcnt[i]; + bPktFilterMacth_pathA = TRUE; + } + + if(pDM_FatTable->antAveRSSI[i] > MaxRSSI_pathA) + { + MaxRSSI_pathA = pDM_FatTable->antAveRSSI[i]; + Pckcnt_pathA = pDM_FatTable ->antRSSIcnt[i]; + TargetAnt_pathA = i ; + } + else if(pDM_FatTable->antAveRSSI[i] == MaxRSSI_pathA) + { + if( (pDM_FatTable->antRSSIcnt[i] ) > Pckcnt_pathA) + { + MaxRSSI_pathA = pDM_FatTable->antAveRSSI[i]; + Pckcnt_pathA = pDM_FatTable ->antRSSIcnt[i]; + TargetAnt_pathA = i ; + } + } + + ODM_RT_TRACE("*** Ant-Index : [ %d ], Counter = (( %d )), Avg RSSI = (( %d )) \n", i, pDM_FatTable->antRSSIcnt[i], pDM_FatTable->antAveRSSI[i] ); + } + + + /* + #if(RTL8192E_SUPPORT == 1) + //3 [path-B]--------------------------- + for (i=0; i<(pDM_Odm->fat_comb_b); i++) + { + if(pDM_FatTable->antRSSIcnt_pathB[i] == 0) + pDM_FatTable->antAveRSSI_pathB[i] = 0; + else // (antRSSIcnt[i] != 0) + { + pDM_FatTable->antAveRSSI_pathB[i] = pDM_FatTable->antSumRSSI_pathB[i] /pDM_FatTable->antRSSIcnt_pathB[i]; + bPktFilterMacth_pathB = TRUE; + } + if(pDM_FatTable->antAveRSSI_pathB[i] > MaxRSSI_pathB) + { + MaxRSSI_pathB = pDM_FatTable->antAveRSSI_pathB[i]; + Pckcnt_pathB = pDM_FatTable ->antRSSIcnt_pathB[i]; + TargetAnt_pathB = (u1Byte) i; + } + if(pDM_FatTable->antAveRSSI_pathB[i] == MaxRSSI_pathB) + { + if(pDM_FatTable ->antRSSIcnt_pathB > Pckcnt_pathB) + { + MaxRSSI_pathB = pDM_FatTable->antAveRSSI_pathB[i]; + TargetAnt_pathB = (u1Byte) i; + } + } + if (pDM_Odm->fat_print_rssi==1) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***{Path-B}: Sum RSSI[%d] = (( %d )), cnt RSSI [%d] = (( %d )), Avg RSSI[%d] = (( %d )) \n", + i, pDM_FatTable->antSumRSSI_pathB[i], i, pDM_FatTable->antRSSIcnt_pathB[i], i, pDM_FatTable->antAveRSSI_pathB[i])); + } + } + #endif + */ + + //1 DECISION STATE + + //2 Select TRX Antenna + + odm_FastTraining_enable(pDM_Odm , FAT_OFF); + + //3 [path-A]--------------------------- + if(bPktFilterMacth_pathA == FALSE) + { + //ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("{Path-A}: None Packet is matched\n")); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("{Path-A}: None Packet is matched\n")); + odm_AntDiv_on_off(pDM_Odm, ANTDIV_OFF); + } + else + { + ODM_RT_TRACE("TargetAnt_pathA = (( %d )) , MaxRSSI_pathA = (( %d )) \n",TargetAnt_pathA,MaxRSSI_pathA); + + //3 [ update RX-optional ant ] Default RX is Omni, Optional RX is the best decision by FAT + if(pDM_Odm->SupportICType == ODM_RTL8188E) + { + ODM_SetBBReg(pDM_Odm, 0x864 , BIT8|BIT7|BIT6, TargetAnt_pathA); + } + else if(pDM_Odm->SupportICType == ODM_RTL8192E) + { + ODM_SetBBReg(pDM_Odm, 0xB38 , BIT8|BIT7|BIT6, TargetAnt_pathA);//Optional RX [pth-A] + } + //3 [ update TX ant ] + odm_UpdateTxAnt(pDM_Odm, TargetAnt_pathA, (pDM_FatTable->TrainIdx)); + + if(TargetAnt_pathA == 0) + odm_AntDiv_on_off(pDM_Odm, ANTDIV_OFF); + } + /* + #if(RTL8192E_SUPPORT == 1) + //3 [path-B]--------------------------- + if(bPktFilterMacth_pathB == FALSE) + { + if (pDM_Odm->fat_print_rssi==1) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***[%d]{Path-B}: None Packet is matched\n\n\n",__LINE__)); + } + } + else + { + if (pDM_Odm->fat_print_rssi==1) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, + (" ***TargetAnt_pathB = (( %d )) *** MaxRSSI = (( %d ))***\n\n\n",TargetAnt_pathB,MaxRSSI_pathB)); + } + ODM_SetBBReg(pDM_Odm, 0xB38 , BIT21|BIT20|BIT19, TargetAnt_pathB); //Default RX is Omni, Optional RX is the best decision by FAT + ODM_SetBBReg(pDM_Odm, 0x80c , BIT21, 1); //Reg80c[21]=1'b1 //from TX Info + + pDM_FatTable->antsel_pathB[pDM_FatTable->TrainIdx] = TargetAnt_pathB; + } + #endif + */ + + //2 Reset Counter + for(i=0; i<(pDM_Odm->fat_comb_a); i++) + { + pDM_FatTable->antSumRSSI[i] = 0; + pDM_FatTable->antRSSIcnt[i] = 0; + } + /* + #if(RTL8192E_SUPPORT == 1) + for(i=0; i<=(pDM_Odm->fat_comb_b); i++) + { + pDM_FatTable->antSumRSSI_pathB[i] = 0; + pDM_FatTable->antRSSIcnt_pathB[i] = 0; + } + #endif + */ + + pDM_FatTable->FAT_State = FAT_NORMAL_STATE; + return; + } + + //1 NORMAL STATE + if(pDM_FatTable->FAT_State == FAT_NORMAL_STATE) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ Start Normal State]\n")); + + odm_SetNextMACAddrTarget(pDM_Odm); + + //2 Prepare Training + pDM_FatTable->FAT_State = FAT_TRAINING_STATE; + odm_FastTraining_enable(pDM_Odm , FAT_ON); + odm_AntDiv_on_off(pDM_Odm, ANTDIV_ON); //enable HW AntDiv + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[Start Training State]\n")); + + ODM_SetTimer(pDM_Odm,&pDM_Odm->FastAntTrainingTimer, pDM_Odm->antdiv_intvl ); //ms + } + +} + +VOID +odm_FastAntTrainingCallback( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + +#if (DM_ODM_SUPPORT_TYPE == ODM_CE) + PADAPTER padapter = pDM_Odm->Adapter; + if(padapter->net_closed == _TRUE) + return; + //if(*pDM_Odm->pbNet_closed == TRUE) + // return; +#endif + +#if USE_WORKITEM + ODM_ScheduleWorkItem(&pDM_Odm->FastAntTrainingWorkitem); +#else + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("******odm_FastAntTrainingCallback****** \n")); + odm_FastAntTraining(pDM_Odm); +#endif +} + +VOID +odm_FastAntTrainingWorkItemCallback( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("******odm_FastAntTrainingWorkItemCallback****** \n")); + odm_FastAntTraining(pDM_Odm); +} + +#endif + +VOID +ODM_AntDivInit( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; + pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; + + + if(!(pDM_Odm->SupportAbility & ODM_BB_ANT_DIV)) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("[Return!!!] Not Support Antenna Diversity Function\n")); + return; + } + //--- +#if (DM_ODM_SUPPORT_TYPE == ODM_AP) + if(pDM_FatTable->AntDiv_2G_5G == ODM_ANTDIV_2G) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("[2G AntDiv Init]: Only Support 2G Antenna Diversity Function\n")); + if(!(pDM_Odm->SupportICType & ODM_ANTDIV_2G_SUPPORT_IC)) + return; + } + else if(pDM_FatTable->AntDiv_2G_5G == ODM_ANTDIV_5G) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("[5G AntDiv Init]: Only Support 5G Antenna Diversity Function\n")); + if(!(pDM_Odm->SupportICType & ODM_ANTDIV_5G_SUPPORT_IC)) + return; + } + else if(pDM_FatTable->AntDiv_2G_5G == (ODM_ANTDIV_2G|ODM_ANTDIV_5G)) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("[2G & 5G AntDiv Init]:Support Both 2G & 5G Antenna Diversity Function\n")); + } + +#endif + //--- + + //2 [--General---] + pDM_Odm->antdiv_period=0; + + pDM_FatTable->bBecomeLinked =FALSE; + pDM_FatTable->AntDiv_OnOff =0xff; + + //3 - AP - + #if (DM_ODM_SUPPORT_TYPE == ODM_AP) + + #ifdef BEAMFORMING_SUPPORT + #if(DM_ODM_SUPPORT_TYPE == ODM_AP) + odm_BDC_Init(pDM_Odm); + #endif + #endif + + //3 - WIN - + #elif (DM_ODM_SUPPORT_TYPE == ODM_WIN) + pDM_SWAT_Table->Ant5G = MAIN_ANT; + pDM_SWAT_Table->Ant2G = MAIN_ANT; + pDM_FatTable->CCK_counter_main=0; + pDM_FatTable->CCK_counter_aux=0; + pDM_FatTable->OFDM_counter_main=0; + pDM_FatTable->OFDM_counter_aux=0; + #endif + + //2 [---Set MAIN_ANT as default antenna if Auto-Ant enable---] + odm_AntDiv_on_off(pDM_Odm, ANTDIV_OFF); + + pDM_Odm->AntType = ODM_AUTO_ANT; + ODM_UpdateRxIdleAnt(pDM_Odm, MAIN_ANT); + + //2 [---Set TX Antenna---] + odm_Tx_By_TxDesc_or_Reg(pDM_Odm , REG); + + + //2 [--88E---] + if(pDM_Odm->SupportICType == ODM_RTL8188E) + { + #if (RTL8188E_SUPPORT == 1) + //pDM_Odm->AntDivType = CGCS_RX_HW_ANTDIV; + //pDM_Odm->AntDivType = CG_TRX_HW_ANTDIV; + //pDM_Odm->AntDivType = CG_TRX_SMART_ANTDIV; + + if( (pDM_Odm->AntDivType != CGCS_RX_HW_ANTDIV) && (pDM_Odm->AntDivType != CG_TRX_HW_ANTDIV) && (pDM_Odm->AntDivType != CG_TRX_SMART_ANTDIV)) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("[Return!!!] 88E Not Supprrt This AntDiv Type\n")); + pDM_Odm->SupportAbility &= ~(ODM_BB_ANT_DIV); + return; + } + + if(pDM_Odm->AntDivType == CGCS_RX_HW_ANTDIV) + odm_RX_HWAntDiv_Init_88E(pDM_Odm); + else if(pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV) + odm_TRX_HWAntDiv_Init_88E(pDM_Odm); + #if( defined(CONFIG_5G_CG_SMART_ANT_DIVERSITY) ) ||( defined(CONFIG_2G_CG_SMART_ANT_DIVERSITY) ) + else if(pDM_Odm->AntDivType == CG_TRX_SMART_ANTDIV) + odm_Smart_HWAntDiv_Init_88E(pDM_Odm); + #endif + #endif + } + + //2 [--92E---] + #if (RTL8192E_SUPPORT == 1) + else if(pDM_Odm->SupportICType == ODM_RTL8192E) + { + //pDM_Odm->AntDivType = CGCS_RX_HW_ANTDIV; + //pDM_Odm->AntDivType = CG_TRX_HW_ANTDIV; + //pDM_Odm->AntDivType = CG_TRX_SMART_ANTDIV; + + if( (pDM_Odm->AntDivType != CGCS_RX_HW_ANTDIV) && (pDM_Odm->AntDivType != CG_TRX_HW_ANTDIV) && (pDM_Odm->AntDivType != CG_TRX_SMART_ANTDIV)) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("[Return!!!] 8192E Not Supprrt This AntDiv Type\n")); + pDM_Odm->SupportAbility &= ~(ODM_BB_ANT_DIV); + return; + } + + if(pDM_Odm->AntDivType == CGCS_RX_HW_ANTDIV) + odm_RX_HWAntDiv_Init_92E(pDM_Odm); + else if(pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV) + odm_TRX_HWAntDiv_Init_92E(pDM_Odm); + #if( defined(CONFIG_5G_CG_SMART_ANT_DIVERSITY) ) ||( defined(CONFIG_2G_CG_SMART_ANT_DIVERSITY) ) + else if(pDM_Odm->AntDivType == CG_TRX_SMART_ANTDIV) + odm_Smart_HWAntDiv_Init_92E(pDM_Odm); + #endif + + } + #endif + + //2 [--8723B---] + #if (RTL8723B_SUPPORT == 1) + else if(pDM_Odm->SupportICType == ODM_RTL8723B) + { + //pDM_Odm->AntDivType = S0S1_SW_ANTDIV; + //pDM_Odm->AntDivType = CG_TRX_HW_ANTDIV; + + if(pDM_Odm->AntDivType != S0S1_SW_ANTDIV && pDM_Odm->AntDivType != CG_TRX_HW_ANTDIV) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("[Return!!!] 8723B Not Supprrt This AntDiv Type\n")); + pDM_Odm->SupportAbility &= ~(ODM_BB_ANT_DIV); + return; + } + + if( pDM_Odm->AntDivType==S0S1_SW_ANTDIV) + odm_S0S1_SWAntDiv_Init_8723B(pDM_Odm); + else if(pDM_Odm->AntDivType==CG_TRX_HW_ANTDIV) + odm_TRX_HWAntDiv_Init_8723B(pDM_Odm); + } + #endif + + //2 [--8811A 8821A---] + #if (RTL8821A_SUPPORT == 1) + else if(pDM_Odm->SupportICType == ODM_RTL8821) + { + //pDM_Odm->AntDivType = CG_TRX_HW_ANTDIV; + pDM_Odm->AntDivType = S0S1_SW_ANTDIV; + + if( pDM_Odm->AntDivType != CG_TRX_HW_ANTDIV && pDM_Odm->AntDivType != S0S1_SW_ANTDIV) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("[Return!!!] 8821A & 8811A Not Supprrt This AntDiv Type\n")); + pDM_Odm->SupportAbility &= ~(ODM_BB_ANT_DIV); + return; + } + if(pDM_Odm->AntDivType==CG_TRX_HW_ANTDIV) + odm_TRX_HWAntDiv_Init_8821A(pDM_Odm); + else if( pDM_Odm->AntDivType==S0S1_SW_ANTDIV) + odm_S0S1_SWAntDiv_Init_8821A(pDM_Odm); + } + #endif + + //2 [--8881A---] + #if (RTL8881A_SUPPORT == 1) + else if(pDM_Odm->SupportICType == ODM_RTL8881A) + { + //pDM_Odm->AntDivType = CGCS_RX_HW_ANTDIV; + //pDM_Odm->AntDivType = CG_TRX_HW_ANTDIV; + + if(pDM_Odm->AntDivType != CGCS_RX_HW_ANTDIV && pDM_Odm->AntDivType != CG_TRX_HW_ANTDIV) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("[Return!!!] 8881A Not Supprrt This AntDiv Type\n")); + pDM_Odm->SupportAbility &= ~(ODM_BB_ANT_DIV); + return; + } + if(pDM_Odm->AntDivType == CGCS_RX_HW_ANTDIV) + odm_RX_HWAntDiv_Init_8881A(pDM_Odm); + else if(pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV) + odm_TRX_HWAntDiv_Init_8881A(pDM_Odm); + } + #endif + + //2 [--8812---] + #if (RTL8812A_SUPPORT == 1) + else if(pDM_Odm->SupportICType == ODM_RTL8812) + { + //pDM_Odm->AntDivType = CG_TRX_HW_ANTDIV; + + if( pDM_Odm->AntDivType != CG_TRX_HW_ANTDIV) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("[Return!!!] 8812A Not Supprrt This AntDiv Type\n")); + pDM_Odm->SupportAbility &= ~(ODM_BB_ANT_DIV); + return; + } + odm_TRX_HWAntDiv_Init_8812A(pDM_Odm); + } + #endif + //ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("*** SupportICType=[%lu] \n",pDM_Odm->SupportICType)); + //ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("*** AntDiv SupportAbility=[%lu] \n",(pDM_Odm->SupportAbility & ODM_BB_ANT_DIV)>>6)); + //ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("*** AntDiv Type=[%d] \n",pDM_Odm->AntDivType)); + +} + +VOID +ODM_AntDiv( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PADAPTER pAdapter = pDM_Odm->Adapter; + pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; + + if(*pDM_Odm->pBandType == ODM_BAND_5G ) + { + if(pDM_FatTable->idx_AntDiv_counter_5G < pDM_Odm->antdiv_period ) + { + pDM_FatTable->idx_AntDiv_counter_5G++; + return; + } + else + pDM_FatTable->idx_AntDiv_counter_5G=0; + } + else if(*pDM_Odm->pBandType == ODM_BAND_2_4G ) + { + if(pDM_FatTable->idx_AntDiv_counter_2G < pDM_Odm->antdiv_period ) + { + pDM_FatTable->idx_AntDiv_counter_2G++; + return; + } + else + pDM_FatTable->idx_AntDiv_counter_2G=0; + } + + //---------- + if(!(pDM_Odm->SupportAbility & ODM_BB_ANT_DIV)) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("[Return!!!] Not Support Antenna Diversity Function\n")); + return; + } + + //---------- +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + if(pAdapter->MgntInfo.AntennaTest) + return; + + { + #if (BEAMFORMING_SUPPORT == 1) + BEAMFORMING_CAP BeamformCap = (pDM_Odm->BeamformingInfo.BeamformCap); + + if( BeamformCap & BEAMFORMEE_CAP ) // BFmee On && Div On -> Div Off + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("[ AntDiv : OFF ] BFmee ==1 \n")); + if(pDM_FatTable->fix_ant_bfee == 0) + { + odm_AntDiv_on_off(pDM_Odm, ANTDIV_OFF); + pDM_FatTable->fix_ant_bfee = 1; + } + return; + } + else // BFmee Off && Div Off -> Div On + { + if((pDM_FatTable->fix_ant_bfee == 1) && pDM_Odm->bLinked) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("[ AntDiv : ON ] BFmee ==0 \n")); + if((pDM_Odm->AntDivType!=S0S1_SW_ANTDIV) ) + odm_AntDiv_on_off(pDM_Odm, ANTDIV_ON); + + pDM_FatTable->fix_ant_bfee = 0; + } + } + } + #endif +#elif (DM_ODM_SUPPORT_TYPE == ODM_AP) + //----------just for fool proof + + if(pDM_Odm->antdiv_rssi) + pDM_Odm->DebugComponents |= ODM_COMP_ANT_DIV; + else + pDM_Odm->DebugComponents &= ~ODM_COMP_ANT_DIV; + + if(pDM_FatTable->AntDiv_2G_5G == ODM_ANTDIV_2G) + { + //ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("[ 2G AntDiv Running ]\n")); + if(!(pDM_Odm->SupportICType & ODM_ANTDIV_2G_SUPPORT_IC)) + return; + } + else if(pDM_FatTable->AntDiv_2G_5G == ODM_ANTDIV_5G) + { + //ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("[ 5G AntDiv Running ]\n")); + if(!(pDM_Odm->SupportICType & ODM_ANTDIV_5G_SUPPORT_IC)) + return; + } + //else if(pDM_FatTable->AntDiv_2G_5G == (ODM_ANTDIV_2G|ODM_ANTDIV_5G)) + //{ + //ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("[ 2G & 5G AntDiv Running ]\n")); + //} +#endif + + //---------- + + if (pDM_Odm->antdiv_select==1) + pDM_Odm->AntType = ODM_FIX_MAIN_ANT; + else if (pDM_Odm->antdiv_select==2) + pDM_Odm->AntType = ODM_FIX_AUX_ANT; + else //if (pDM_Odm->antdiv_select==0) + pDM_Odm->AntType = ODM_AUTO_ANT; + + //ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("AntType= (( %d )) , pre_AntType= (( %d )) \n",pDM_Odm->AntType,pDM_Odm->pre_AntType)); + + if(pDM_Odm->AntType != ODM_AUTO_ANT) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Fix Antenna at (( %s ))\n",(pDM_Odm->AntType == ODM_FIX_MAIN_ANT)?"MAIN":"AUX")); + + if(pDM_Odm->AntType != pDM_Odm->pre_AntType) + { + odm_AntDiv_on_off(pDM_Odm, ANTDIV_OFF); + odm_Tx_By_TxDesc_or_Reg(pDM_Odm , REG); + + if(pDM_Odm->AntType == ODM_FIX_MAIN_ANT) + ODM_UpdateRxIdleAnt(pDM_Odm, MAIN_ANT); + else if(pDM_Odm->AntType == ODM_FIX_AUX_ANT) + ODM_UpdateRxIdleAnt(pDM_Odm, AUX_ANT); + } + pDM_Odm->pre_AntType=pDM_Odm->AntType; + return; + } + else + { + if(pDM_Odm->AntType != pDM_Odm->pre_AntType) + { + odm_AntDiv_on_off(pDM_Odm, ANTDIV_ON); + odm_Tx_By_TxDesc_or_Reg(pDM_Odm , TX_BY_DESC); + } + pDM_Odm->pre_AntType=pDM_Odm->AntType; + } + + + //3 ----------------------------------------------------------------------------------------------------------- + //2 [--88E---] + if(pDM_Odm->SupportICType == ODM_RTL8188E) + { + #if (RTL8188E_SUPPORT == 1) + if(pDM_Odm->AntDivType==CG_TRX_HW_ANTDIV ||pDM_Odm->AntDivType==CGCS_RX_HW_ANTDIV) + odm_HW_AntDiv(pDM_Odm); + + #if( defined(CONFIG_5G_CG_SMART_ANT_DIVERSITY) ) ||( defined(CONFIG_2G_CG_SMART_ANT_DIVERSITY) ) + else if (pDM_Odm->AntDivType==CG_TRX_SMART_ANTDIV) + odm_FastAntTraining(pDM_Odm); + #endif + + #endif + + } + //2 [--92E---] + #if (RTL8192E_SUPPORT == 1) + else if(pDM_Odm->SupportICType == ODM_RTL8192E) + { + if(pDM_Odm->AntDivType==CGCS_RX_HW_ANTDIV || pDM_Odm->AntDivType==CG_TRX_HW_ANTDIV) + odm_HW_AntDiv(pDM_Odm); + + #if( defined(CONFIG_5G_CG_SMART_ANT_DIVERSITY) ) ||( defined(CONFIG_2G_CG_SMART_ANT_DIVERSITY) ) + else if (pDM_Odm->AntDivType==CG_TRX_SMART_ANTDIV) + odm_FastAntTraining(pDM_Odm); + #endif + + } + #endif + + #if (RTL8723B_SUPPORT == 1) + //2 [--8723B---] + else if(pDM_Odm->SupportICType == ODM_RTL8723B) + { + if (pDM_Odm->AntDivType==S0S1_SW_ANTDIV) + odm_S0S1_SwAntDiv(pDM_Odm, SWAW_STEP_PEAK); + else if (pDM_Odm->AntDivType==CG_TRX_HW_ANTDIV) + odm_HW_AntDiv(pDM_Odm); + } + #endif + + //2 [--8821A---] + #if (RTL8821A_SUPPORT == 1) + else if(pDM_Odm->SupportICType == ODM_RTL8821) + { + if(!pDM_Odm->bBtEnabled) //BT disabled + { + if(pDM_Odm->AntDivType == S0S1_SW_ANTDIV) + { + pDM_Odm->AntDivType=CG_TRX_HW_ANTDIV; + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,(" [S0S1_SW_ANTDIV] -> [CG_TRX_HW_ANTDIV]\n")); + //ODM_SetBBReg(pDM_Odm, 0x8D4 , BIT24, 1); + if(pDM_FatTable->bBecomeLinked ==TRUE) + odm_AntDiv_on_off(pDM_Odm, ANTDIV_ON); + } + } + else //BT enabled + { + if(pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV) + { + pDM_Odm->AntDivType=S0S1_SW_ANTDIV; + ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,(" [CG_TRX_HW_ANTDIV] -> [S0S1_SW_ANTDIV]\n")); + //ODM_SetBBReg(pDM_Odm, 0x8D4 , BIT24, 0); + odm_AntDiv_on_off(pDM_Odm, ANTDIV_OFF); + } + } + + if (pDM_Odm->AntDivType==S0S1_SW_ANTDIV) + odm_S0S1_SwAntDiv(pDM_Odm, SWAW_STEP_PEAK); + else if (pDM_Odm->AntDivType==CG_TRX_HW_ANTDIV) + odm_HW_AntDiv(pDM_Odm); + } + #endif + + //2 [--8881A---] + #if (RTL8881A_SUPPORT == 1) + else if(pDM_Odm->SupportICType == ODM_RTL8881A) + odm_HW_AntDiv(pDM_Odm); + #endif + + //2 [--8812A---] + #if (RTL8812A_SUPPORT == 1) + else if(pDM_Odm->SupportICType == ODM_RTL8812) + odm_HW_AntDiv(pDM_Odm); + #endif +} + + +VOID +odm_AntselStatistics( + IN PVOID pDM_VOID, + IN u1Byte antsel_tr_mux, + IN u4Byte MacId, + IN u4Byte utility, + IN u1Byte method + + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; + if(method==RSSI_METHOD) + { + if(antsel_tr_mux == ANT1_2G) + { + pDM_FatTable->MainAnt_Sum[MacId]+=utility; + pDM_FatTable->MainAnt_Cnt[MacId]++; + } + else + { + pDM_FatTable->AuxAnt_Sum[MacId]+=utility; + pDM_FatTable->AuxAnt_Cnt[MacId]++; + } + } + #ifdef ODM_EVM_ENHANCE_ANTDIV + else if(method==EVM_METHOD) + { + if(antsel_tr_mux == ANT1_2G) + { + pDM_FatTable->MainAntEVM_Sum[MacId]+=(utility<<5); + pDM_FatTable->MainAntEVM_Cnt[MacId]++; + } + else + { + pDM_FatTable->AuxAntEVM_Sum[MacId]+=(utility<<5); + pDM_FatTable->AuxAntEVM_Cnt[MacId]++; + } + } + else if(method==CRC32_METHOD) + { + if(utility==0) + pDM_FatTable->CRC32_Fail_Cnt++; + else + pDM_FatTable->CRC32_Ok_Cnt+=utility; + } + #endif +} + + +VOID +ODM_Process_RSSIForAntDiv( + IN OUT PVOID pDM_VOID, + IN PVOID p_phy_info_void, + IN PVOID p_pkt_info_void + //IN PODM_PHY_INFO_T pPhyInfo, + //IN PODM_PACKET_INFO_T pPktinfo + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PODM_PHY_INFO_T pPhyInfo=(PODM_PHY_INFO_T)p_phy_info_void; + PODM_PACKET_INFO_T pPktinfo=(PODM_PACKET_INFO_T)p_pkt_info_void; + u1Byte isCCKrate=0,CCKMaxRate=ODM_RATE11M; + pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; + +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN)) + u4Byte RxPower_Ant0, RxPower_Ant1; + u4Byte RxEVM_Ant0, RxEVM_Ant1; +#else + u1Byte RxPower_Ant0, RxPower_Ant1; + u1Byte RxEVM_Ant0, RxEVM_Ant1; +#endif + + CCKMaxRate=ODM_RATE11M; + isCCKrate = (pPktinfo->DataRate <= CCKMaxRate)?TRUE:FALSE; + +#if ((RTL8192C_SUPPORT == 1) ||(RTL8192D_SUPPORT == 1)) + if(pDM_Odm->SupportICType & ODM_RTL8192C|ODM_RTL8192D) + { + if(pPktinfo->bPacketToSelf || pPktinfo->bPacketBeacon) + { + ODM_AntselStatistics_88C(pDM_Odm, pPktinfo->StationID, pPhyInfo->RxPWDBAll, isCCKrate); + } + } +#endif + + if( (pDM_Odm->SupportICType == ODM_RTL8192E||pDM_Odm->SupportICType == ODM_RTL8812) && (pPktinfo->DataRate > CCKMaxRate) ) + { + RxPower_Ant0 = pPhyInfo->RxMIMOSignalStrength[0]; + RxPower_Ant1= pPhyInfo->RxMIMOSignalStrength[1]; + + RxEVM_Ant0 =pPhyInfo->RxMIMOSignalQuality[0]; + RxEVM_Ant1 =pPhyInfo->RxMIMOSignalQuality[1]; + } + else + RxPower_Ant0=pPhyInfo->RxPWDBAll; + + if(pDM_Odm->AntDivType == CG_TRX_SMART_ANTDIV) + { + if( (pDM_Odm->SupportICType & ODM_SMART_ANT_SUPPORT) && (pPktinfo->bPacketToSelf) && (pDM_FatTable->FAT_State == FAT_TRAINING_STATE) )//(pPktinfo->bPacketMatchBSSID && (!pPktinfo->bPacketBeacon)) + { + u1Byte antsel_tr_mux; + antsel_tr_mux = (pDM_FatTable->antsel_rx_keep_2<<2) |(pDM_FatTable->antsel_rx_keep_1 <<1) |pDM_FatTable->antsel_rx_keep_0; + pDM_FatTable->antSumRSSI[antsel_tr_mux] += RxPower_Ant0; + pDM_FatTable->antRSSIcnt[antsel_tr_mux]++; + } + } + else //AntDivType != CG_TRX_SMART_ANTDIV + { + if( ( pDM_Odm->SupportICType & ODM_ANTDIV_SUPPORT ) && (pPktinfo->bPacketToSelf || pPktinfo->bPacketMatchBSSID) ) + { + if(pDM_Odm->SupportICType == ODM_RTL8188E || pDM_Odm->SupportICType == ODM_RTL8192E) + { + odm_AntselStatistics(pDM_Odm, pDM_FatTable->antsel_rx_keep_0, pPktinfo->StationID,RxPower_Ant0,RSSI_METHOD); + + #ifdef ODM_EVM_ENHANCE_ANTDIV + if(!isCCKrate) + { + odm_AntselStatistics(pDM_Odm, pDM_FatTable->antsel_rx_keep_0, pPktinfo->StationID,RxEVM_Ant0,EVM_METHOD); + } + #endif + } + else// SupportICType == ODM_RTL8821 and ODM_RTL8723B and ODM_RTL8812) + { + if(isCCKrate && (pDM_Odm->AntDivType == S0S1_SW_ANTDIV)) + { + pDM_FatTable->antsel_rx_keep_0 = (pDM_FatTable->RxIdleAnt == MAIN_ANT) ? ANT1_2G : ANT2_2G; + + + if(pDM_FatTable->antsel_rx_keep_0==ANT1_2G) + pDM_FatTable->CCK_counter_main++; + else// if(pDM_FatTable->antsel_rx_keep_0==ANT2_2G) + pDM_FatTable->CCK_counter_aux++; + + odm_AntselStatistics(pDM_Odm, pDM_FatTable->antsel_rx_keep_0, pPktinfo->StationID, RxPower_Ant0,RSSI_METHOD); + } + else + { + if(pDM_FatTable->antsel_rx_keep_0==ANT1_2G) + pDM_FatTable->OFDM_counter_main++; + else// if(pDM_FatTable->antsel_rx_keep_0==ANT2_2G) + pDM_FatTable->OFDM_counter_aux++; + odm_AntselStatistics(pDM_Odm, pDM_FatTable->antsel_rx_keep_0, pPktinfo->StationID, RxPower_Ant0,RSSI_METHOD); + } + } + } + } + //ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("isCCKrate=%d, PWDB_ALL=%d\n",isCCKrate, pPhyInfo->RxPWDBAll)); + //ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("antsel_tr_mux=3'b%d%d%d\n",pDM_FatTable->antsel_rx_keep_2, pDM_FatTable->antsel_rx_keep_1, pDM_FatTable->antsel_rx_keep_0)); +} + +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) +VOID +ODM_SetTxAntByTxInfo( + IN PVOID pDM_VOID, + IN pu1Byte pDesc, + IN u1Byte macId + + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; + + if(!(pDM_Odm->SupportAbility & ODM_BB_ANT_DIV)) + return; + + if(pDM_Odm->AntDivType==CGCS_RX_HW_ANTDIV) + return; + + + if(pDM_Odm->SupportICType == ODM_RTL8723B) + { +#if (RTL8723B_SUPPORT == 1) + SET_TX_DESC_ANTSEL_A_8723B(pDesc, pDM_FatTable->antsel_a[macId]); + //ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[8723B] SetTxAntByTxInfo_WIN: MacID=%d, antsel_tr_mux=3'b%d%d%d\n", + //macId, pDM_FatTable->antsel_c[macId], pDM_FatTable->antsel_b[macId], pDM_FatTable->antsel_a[macId])); +#endif + } + else if(pDM_Odm->SupportICType == ODM_RTL8821) + { +#if (RTL8821A_SUPPORT == 1) + SET_TX_DESC_ANTSEL_A_8812(pDesc, pDM_FatTable->antsel_a[macId]); + //ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[8821A] SetTxAntByTxInfo_WIN: MacID=%d, antsel_tr_mux=3'b%d%d%d\n", + //macId, pDM_FatTable->antsel_c[macId], pDM_FatTable->antsel_b[macId], pDM_FatTable->antsel_a[macId])); +#endif + } + else if(pDM_Odm->SupportICType == ODM_RTL8188E) + { +#if (RTL8188E_SUPPORT == 1) + SET_TX_DESC_ANTSEL_A_88E(pDesc, pDM_FatTable->antsel_a[macId]); + SET_TX_DESC_ANTSEL_B_88E(pDesc, pDM_FatTable->antsel_b[macId]); + SET_TX_DESC_ANTSEL_C_88E(pDesc, pDM_FatTable->antsel_c[macId]); + //ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[8188E] SetTxAntByTxInfo_WIN: MacID=%d, antsel_tr_mux=3'b%d%d%d\n", + //macId, pDM_FatTable->antsel_c[macId], pDM_FatTable->antsel_b[macId], pDM_FatTable->antsel_a[macId])); +#endif + } + else if(pDM_Odm->SupportICType == ODM_RTL8192E) + { + + + } +} +#elif(DM_ODM_SUPPORT_TYPE == ODM_AP) + +VOID +ODM_SetTxAntByTxInfo( + struct rtl8192cd_priv *priv, + struct tx_desc *pdesc, + unsigned short aid +) +{ + pFAT_T pDM_FatTable = &priv->pshare->_dmODM.DM_FatTable; + u4Byte SupportICType=priv->pshare->_dmODM.SupportICType; + + if(SupportICType == ODM_RTL8881A) + { + //panic_printk("[%s] [%d] ******ODM_SetTxAntByTxInfo_8881E****** \n",__FUNCTION__,__LINE__); + pdesc->Dword6 &= set_desc(~ (BIT(18)|BIT(17)|BIT(16))); + pdesc->Dword6 |= set_desc(pDM_FatTable->antsel_a[aid]<<16); + } + else if(SupportICType == ODM_RTL8192E) + { + //panic_printk("[%s] [%d] ******ODM_SetTxAntByTxInfo_8192E****** \n",__FUNCTION__,__LINE__); + pdesc->Dword6 &= set_desc(~ (BIT(18)|BIT(17)|BIT(16))); + pdesc->Dword6 |= set_desc(pDM_FatTable->antsel_a[aid]<<16); + } + else if(SupportICType == ODM_RTL8188E) + { + //panic_printk("[%s] [%d] ******ODM_SetTxAntByTxInfo_8188E****** \n",__FUNCTION__,__LINE__); + pdesc->Dword2 &= set_desc(~ BIT(24)); + pdesc->Dword2 &= set_desc(~ BIT(25)); + pdesc->Dword7 &= set_desc(~ BIT(29)); + + pdesc->Dword2 |= set_desc(pDM_FatTable->antsel_a[aid]<<24); + pdesc->Dword2 |= set_desc(pDM_FatTable->antsel_b[aid]<<25); + pdesc->Dword7 |= set_desc(pDM_FatTable->antsel_c[aid]<<29); + + + } + else if(SupportICType == ODM_RTL8812) + { + //3 [path-A] + //panic_printk("[%s] [%d] ******ODM_SetTxAntByTxInfo_8881E****** \n",__FUNCTION__,__LINE__); + + pdesc->Dword6 &= set_desc(~ BIT(16)); + pdesc->Dword6 &= set_desc(~ BIT(17)); + pdesc->Dword6 &= set_desc(~ BIT(18)); + + pdesc->Dword6 |= set_desc(pDM_FatTable->antsel_a[aid]<<16); + pdesc->Dword6 |= set_desc(pDM_FatTable->antsel_b[aid]<<17); + pdesc->Dword6 |= set_desc(pDM_FatTable->antsel_c[aid]<<18); + + } +} +#endif + + +VOID +ODM_AntDiv_Config( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN)) + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("WIN Config Antenna Diversity\n")); + if(pDM_Odm->SupportICType==ODM_RTL8723B) + { + if((!pDM_Odm->DM_SWAT_Table.ANTA_ON || !pDM_Odm->DM_SWAT_Table.ANTB_ON)) + pDM_Odm->SupportAbility &= ~(ODM_BB_ANT_DIV); + } +#elif (DM_ODM_SUPPORT_TYPE & (ODM_CE)) + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("CE Config Antenna Diversity\n")); + if(pDM_Odm->SupportICType & ODM_ANTDIV_SUPPORT) + { + pDM_Odm->SupportAbility |= ODM_BB_ANT_DIV; + } + + if(pDM_Odm->SupportICType==ODM_RTL8723B) + { + pDM_Odm->AntDivType = S0S1_SW_ANTDIV; + } + +#elif (DM_ODM_SUPPORT_TYPE & (ODM_AP)) + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("AP Config Antenna Diversity\n")); + + //2 [ NOT_SUPPORT_ANTDIV ] + #if(defined(CONFIG_NOT_SUPPORT_ANTDIV)) + pDM_Odm->SupportAbility &= ~(ODM_BB_ANT_DIV); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ Disable AntDiv function] : Not Support 2.4G & 5G Antenna Diversity\n")); + + //2 [ 2G&5G_SUPPORT_ANTDIV ] + #elif(defined(CONFIG_2G5G_SUPPORT_ANTDIV)) + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ Enable AntDiv function] : 2.4G & 5G Support Antenna Diversity Simultaneously \n")); + pDM_FatTable->AntDiv_2G_5G = (ODM_ANTDIV_2G|ODM_ANTDIV_5G); + + if(pDM_Odm->SupportICType & ODM_ANTDIV_SUPPORT) + pDM_Odm->SupportAbility |= ODM_BB_ANT_DIV; + if(*pDM_Odm->pBandType == ODM_BAND_5G ) + { + #if ( defined(CONFIG_5G_CGCS_RX_DIVERSITY) ) + pDM_Odm->AntDivType = CGCS_RX_HW_ANTDIV; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ 5G] : AntDiv Type = CGCS_RX_HW_ANTDIV\n")); + panic_printk("[ 5G] : AntDiv Type = CGCS_RX_HW_ANTDIV\n"); + #elif( defined(CONFIG_5G_CG_TRX_DIVERSITY)||defined(CONFIG_2G5G_CG_TRX_DIVERSITY_8881A)) + pDM_Odm->AntDivType = CG_TRX_HW_ANTDIV; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ 5G] : AntDiv Type = CG_TRX_HW_ANTDIV\n")); + panic_printk("[ 5G] : AntDiv Type = CG_TRX_HW_ANTDIV\n"); + #elif( defined(CONFIG_5G_CG_SMART_ANT_DIVERSITY) ) + pDM_Odm->AntDivType = CG_TRX_SMART_ANTDIV; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ 5G] : AntDiv Type = CG_SMART_ANTDIV\n")); + #elif( defined(CONFIG_5G_S0S1_SW_ANT_DIVERSITY) ) + pDM_Odm->AntDivType = S0S1_SW_ANTDIV; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ 5G] : AntDiv Type = S0S1_SW_ANTDIV\n")); + #endif + } + else if(*pDM_Odm->pBandType == ODM_BAND_2_4G ) + { + #if ( defined(CONFIG_2G_CGCS_RX_DIVERSITY) ) + pDM_Odm->AntDivType = CGCS_RX_HW_ANTDIV; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ 2.4G] : AntDiv Type = CGCS_RX_HW_ANTDIV\n")); + #elif( defined(CONFIG_2G_CG_TRX_DIVERSITY) || defined(CONFIG_2G5G_CG_TRX_DIVERSITY_8881A)) + pDM_Odm->AntDivType = CG_TRX_HW_ANTDIV; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ 2.4G] : AntDiv Type = CG_TRX_HW_ANTDIV\n")); + #elif( defined(CONFIG_2G_CG_SMART_ANT_DIVERSITY) ) + pDM_Odm->AntDivType = CG_TRX_SMART_ANTDIV; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ 2.4G] : AntDiv Type = CG_SMART_ANTDIV\n")); + #elif( defined(CONFIG_2G_S0S1_SW_ANT_DIVERSITY) ) + pDM_Odm->AntDivType = S0S1_SW_ANTDIV; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ 2.4G] : AntDiv Type = S0S1_SW_ANTDIV\n")); + #endif + } + + //2 [ 5G_SUPPORT_ANTDIV ] + #elif(defined(CONFIG_5G_SUPPORT_ANTDIV)) + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ Enable AntDiv function] : Only 5G Support Antenna Diversity\n")); + panic_printk("[ Enable AntDiv function] : Only 5G Support Antenna Diversity\n"); + pDM_FatTable->AntDiv_2G_5G = (ODM_ANTDIV_5G); + if(*pDM_Odm->pBandType == ODM_BAND_5G ) + { + if(pDM_Odm->SupportICType & ODM_ANTDIV_5G_SUPPORT_IC) + pDM_Odm->SupportAbility |= ODM_BB_ANT_DIV; + #if ( defined(CONFIG_5G_CGCS_RX_DIVERSITY) ) + pDM_Odm->AntDivType = CGCS_RX_HW_ANTDIV; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ 5G] : AntDiv Type = CGCS_RX_HW_ANTDIV\n")); + panic_printk("[ 5G] : AntDiv Type = CGCS_RX_HW_ANTDIV\n"); + #elif( defined(CONFIG_5G_CG_TRX_DIVERSITY) ) + pDM_Odm->AntDivType = CG_TRX_HW_ANTDIV; + panic_printk("[ 5G] : AntDiv Type = CG_TRX_HW_ANTDIV\n"); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ 5G] : AntDiv Type = CG_TRX_HW_ANTDIV\n")); + #elif( defined(CONFIG_5G_CG_SMART_ANT_DIVERSITY) ) + pDM_Odm->AntDivType = CG_TRX_SMART_ANTDIV; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ 5G] : AntDiv Type = CG_SMART_ANTDIV\n")); + #elif( defined(CONFIG_5G_S0S1_SW_ANT_DIVERSITY) ) + pDM_Odm->AntDivType = S0S1_SW_ANTDIV; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ 5G] : AntDiv Type = S0S1_SW_ANTDIV\n")); + #endif + } + else if(*pDM_Odm->pBandType == ODM_BAND_2_4G ) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("Not Support 2G AntDivType\n")); + pDM_Odm->SupportAbility &= ~(ODM_BB_ANT_DIV); + } + + //2 [ 2G_SUPPORT_ANTDIV ] + #elif(defined(CONFIG_2G_SUPPORT_ANTDIV)) + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ Enable AntDiv function] : Only 2.4G Support Antenna Diversity\n")); + pDM_FatTable->AntDiv_2G_5G = (ODM_ANTDIV_2G); + if(*pDM_Odm->pBandType == ODM_BAND_2_4G ) + { + if(pDM_Odm->SupportICType & ODM_ANTDIV_2G_SUPPORT_IC) + pDM_Odm->SupportAbility |= ODM_BB_ANT_DIV; + #if ( defined(CONFIG_2G_CGCS_RX_DIVERSITY) ) + pDM_Odm->AntDivType = CGCS_RX_HW_ANTDIV; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ 2.4G] : AntDiv Type = CGCS_RX_HW_ANTDIV\n")); + #elif( defined(CONFIG_2G_CG_TRX_DIVERSITY) ) + pDM_Odm->AntDivType = CG_TRX_HW_ANTDIV; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ 2.4G] : AntDiv Type = CG_TRX_HW_ANTDIV\n")); + #elif( defined(CONFIG_2G_CG_SMART_ANT_DIVERSITY) ) + pDM_Odm->AntDivType = CG_TRX_SMART_ANTDIV; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ 2.4G] : AntDiv Type = CG_SMART_ANTDIV\n")); + #elif( defined(CONFIG_2G_S0S1_SW_ANT_DIVERSITY) ) + pDM_Odm->AntDivType = S0S1_SW_ANTDIV; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ 2.4G] : AntDiv Type = S0S1_SW_ANTDIV\n")); + #endif + } + else if(*pDM_Odm->pBandType == ODM_BAND_5G ) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("Not Support 5G AntDivType\n")); + pDM_Odm->SupportAbility &= ~(ODM_BB_ANT_DIV); + } + #endif +#endif + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("SupportAbility = (( %x ))\n", pDM_Odm->SupportAbility )); + +} + + +VOID +ODM_AntDivTimers( + IN PVOID pDM_VOID, + IN u1Byte state + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + if(state==INIT_ANTDIV_TIMMER) + { + #if (RTL8723B_SUPPORT == 1)||(RTL8821A_SUPPORT == 1) + ODM_InitializeTimer(pDM_Odm,&pDM_Odm->DM_SWAT_Table.SwAntennaSwitchTimer_8723B, + (RT_TIMER_CALL_BACK)ODM_SW_AntDiv_Callback, NULL, "SwAntennaSwitchTimer_8723B"); + #elif ( defined(CONFIG_5G_CG_SMART_ANT_DIVERSITY) ) ||( defined(CONFIG_2G_CG_SMART_ANT_DIVERSITY) ) + ODM_InitializeTimer(pDM_Odm,&pDM_Odm->FastAntTrainingTimer, + (RT_TIMER_CALL_BACK)odm_FastAntTrainingCallback, NULL, "FastAntTrainingTimer"); + #endif + + #ifdef ODM_EVM_ENHANCE_ANTDIV + ODM_InitializeTimer(pDM_Odm,&pDM_Odm->EVM_FastAntTrainingTimer, + (RT_TIMER_CALL_BACK)odm_EVM_FastAntTrainingCallback, NULL, "EVM_FastAntTrainingTimer"); + #endif + } + else if(state==CANCEL_ANTDIV_TIMMER) + { + #if (RTL8723B_SUPPORT == 1)||(RTL8821A_SUPPORT == 1) + ODM_CancelTimer(pDM_Odm,&pDM_Odm->DM_SWAT_Table.SwAntennaSwitchTimer_8723B); + #elif ( defined(CONFIG_5G_CG_SMART_ANT_DIVERSITY) ) ||( defined(CONFIG_2G_CG_SMART_ANT_DIVERSITY) ) + ODM_CancelTimer(pDM_Odm,&pDM_Odm->FastAntTrainingTimer); + #endif + + #ifdef ODM_EVM_ENHANCE_ANTDIV + ODM_CancelTimer(pDM_Odm,&pDM_Odm->EVM_FastAntTrainingTimer); + #endif + } + else if(state==RELEASE_ANTDIV_TIMMER) + { + #if (RTL8723B_SUPPORT == 1)||(RTL8821A_SUPPORT == 1) + ODM_ReleaseTimer(pDM_Odm,&pDM_Odm->DM_SWAT_Table.SwAntennaSwitchTimer_8723B); + #elif ( defined(CONFIG_5G_CG_SMART_ANT_DIVERSITY) ) ||( defined(CONFIG_2G_CG_SMART_ANT_DIVERSITY) ) + ODM_ReleaseTimer(pDM_Odm,&pDM_Odm->FastAntTrainingTimer); + #endif + + #ifdef ODM_EVM_ENHANCE_ANTDIV + ODM_ReleaseTimer(pDM_Odm,&pDM_Odm->EVM_FastAntTrainingTimer); + #endif + } + +} + +#endif //#if (defined(CONFIG_HW_ANTENNA_DIVERSITY)) + +VOID +ODM_AntDivReset( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + //2 [--8723B---] +#if (RTL8723B_SUPPORT == 1) + if(pDM_Odm->SupportICType == ODM_RTL8723B) + { + #if(defined(CONFIG_HW_ANTENNA_DIVERSITY)) + odm_S0S1_SWAntDiv_Reset_8723B(pDM_Odm); + #endif + } +#endif +} + +VOID +odm_AntennaDiversityInit( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + if(pDM_Odm->mp_mode == TRUE) + return; + + if(pDM_Odm->SupportICType & (ODM_OLD_IC_ANTDIV_SUPPORT)) + { + #if (RTL8192C_SUPPORT==1) + #if (!(DM_ODM_SUPPORT_TYPE & (ODM_AP))) + ODM_OldIC_AntDiv_Init(pDM_Odm); + #endif + #endif + } + else + { + #if(defined(CONFIG_HW_ANTENNA_DIVERSITY)) + ODM_AntDiv_Config(pDM_Odm); + ODM_AntDivInit(pDM_Odm); + #endif + } +} + +VOID +odm_AntennaDiversity( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + if(pDM_Odm->mp_mode == TRUE) + return; + + if(pDM_Odm->SupportICType & (ODM_OLD_IC_ANTDIV_SUPPORT)) + { + #if (RTL8192C_SUPPORT==1) + #if (!(DM_ODM_SUPPORT_TYPE & (ODM_AP))) + ODM_OldIC_AntDiv(pDM_Odm); + #endif + #endif + } + else + { + #if(defined(CONFIG_HW_ANTENNA_DIVERSITY)) + ODM_AntDiv(pDM_Odm); + #endif + } +} + + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_AntDiv.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_AntDiv.h new file mode 100644 index 00000000000000..574dc5334eb793 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_AntDiv.h @@ -0,0 +1,538 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +#ifndef __PHYDMANTDIV_H__ +#define __PHYDMANTDIV_H__ + +#define ANTDIV_VERSION "2.0" //2014.11.04 + +//1 ============================================================ +//1 Definition +//1 ============================================================ + + +#define MAIN_ANT 1 //Ant A or Ant Main +#define AUX_ANT 2 //AntB or Ant Aux +#define MAX_ANT 3 // 3 for AP using + +#define ANT1_2G 0 // = ANT2_5G +#define ANT2_2G 1 // = ANT1_5G + +//Antenna Diversty Control Type +#define ODM_AUTO_ANT 0 +#define ODM_FIX_MAIN_ANT 1 +#define ODM_FIX_AUX_ANT 2 + +#define ODM_ANTDIV_SUPPORT (ODM_RTL8188E|ODM_RTL8192E|ODM_RTL8723B|ODM_RTL8821|ODM_RTL8881A|ODM_RTL8812) +#define ODM_N_ANTDIV_SUPPORT (ODM_RTL8188E|ODM_RTL8192E|ODM_RTL8723B) +#define ODM_AC_ANTDIV_SUPPORT (ODM_RTL8821|ODM_RTL8881A|ODM_RTL8812) +#define ODM_SMART_ANT_SUPPORT (ODM_RTL8188E|ODM_RTL8192E) + +#define ODM_OLD_IC_ANTDIV_SUPPORT (ODM_RTL8723A|ODM_RTL8192C|ODM_RTL8192D) + +#define ODM_ANTDIV_2G_SUPPORT_IC (ODM_RTL8188E|ODM_RTL8192E|ODM_RTL8723B|ODM_RTL8881A) +#define ODM_ANTDIV_5G_SUPPORT_IC (ODM_RTL8821|ODM_RTL8881A|ODM_RTL8812) + +#define ODM_EVM_ENHANCE_ANTDIV_SUPPORT_IC (ODM_RTL8192E) + +#define ODM_ANTDIV_2G BIT0 +#define ODM_ANTDIV_5G BIT1 + +#define ANTDIV_ON 1 +#define ANTDIV_OFF 0 + +#define FAT_ON 1 +#define FAT_OFF 0 + +#define TX_BY_DESC 1 +#define REG 0 + +#define RSSI_METHOD 0 +#define EVM_METHOD 1 +#define CRC32_METHOD 2 + +#define INIT_ANTDIV_TIMMER 0 +#define CANCEL_ANTDIV_TIMMER 1 +#define RELEASE_ANTDIV_TIMMER 2 + +#define CRC32_FAIL 1 +#define CRC32_OK 0 + +#define Evm_RSSI_TH_High 25 +#define Evm_RSSI_TH_Low 20 + +#define NORMAL_STATE_MIAN 1 +#define NORMAL_STATE_AUX 2 +#define TRAINING_STATE 3 + +#define FORCE_RSSI_DIFF 10 + +#define CSI_ON 1 +#define CSI_OFF 0 + +#define DIVON_CSIOFF 1 +#define DIVOFF_CSION 2 + +#define BDC_DIV_TRAIN_STATE 0 +#define BDC_BFer_TRAIN_STATE 1 +#define BDC_DECISION_STATE 2 +#define BDC_BF_HOLD_STATE 3 +#define BDC_DIV_HOLD_STATE 4 + +#define BDC_MODE_1 1 +#define BDC_MODE_2 2 +#define BDC_MODE_3 3 +#define BDC_MODE_4 4 +#define BDC_MODE_NULL 0xff + +#define SWAW_STEP_PEAK 0 +#define SWAW_STEP_DETERMINE 1 + +//1 ============================================================ +//1 structure +//1 ============================================================ + + +typedef struct _SW_Antenna_Switch_ +{ + u1Byte Double_chk_flag; + u1Byte try_flag; + s4Byte PreRSSI; + u1Byte CurAntenna; + u1Byte PreAntenna; + u1Byte RSSI_Trying; + u1Byte TestMode; + u1Byte bTriggerAntennaSwitch; + u1Byte SelectAntennaMap; + u1Byte RSSI_target; + u1Byte reset_idx; + u2Byte Single_Ant_Counter; + u2Byte Dual_Ant_Counter; + u2Byte Aux_FailDetec_Counter; + u2Byte Retry_Counter; + + // Before link Antenna Switch check + u1Byte SWAS_NoLink_State; + u4Byte SWAS_NoLink_BK_Reg860; + u4Byte SWAS_NoLink_BK_Reg92c; + u4Byte SWAS_NoLink_BK_Reg948; + BOOLEAN ANTA_ON; //To indicate Ant A is or not + BOOLEAN ANTB_ON; //To indicate Ant B is on or not + BOOLEAN Pre_Aux_FailDetec; + BOOLEAN RSSI_AntDect_bResult; + u1Byte Ant5G; + u1Byte Ant2G; + + s4Byte RSSI_sum_A; + s4Byte RSSI_sum_B; + s4Byte RSSI_cnt_A; + s4Byte RSSI_cnt_B; + + u8Byte lastTxOkCnt; + u8Byte lastRxOkCnt; + u8Byte TXByteCnt_A; + u8Byte TXByteCnt_B; + u8Byte RXByteCnt_A; + u8Byte RXByteCnt_B; + u1Byte TrafficLoad; + u1Byte Train_time; + u1Byte Train_time_flag; + RT_TIMER SwAntennaSwitchTimer; +#if (RTL8723B_SUPPORT == 1)||(RTL8821A_SUPPORT == 1) + RT_TIMER SwAntennaSwitchTimer_8723B; + u4Byte PktCnt_SWAntDivByCtrlFrame; + BOOLEAN bSWAntDivByCtrlFrame; +#endif + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + #if USE_WORKITEM + RT_WORK_ITEM SwAntennaSwitchWorkitem; +#if (RTL8723B_SUPPORT == 1)||(RTL8821A_SUPPORT == 1) + RT_WORK_ITEM SwAntennaSwitchWorkitem_8723B; + #endif +#endif +#endif +/* CE Platform use +#ifdef CONFIG_SW_ANTENNA_DIVERSITY + _timer SwAntennaSwitchTimer; + u8Byte lastTxOkCnt; + u8Byte lastRxOkCnt; + u8Byte TXByteCnt_A; + u8Byte TXByteCnt_B; + u8Byte RXByteCnt_A; + u8Byte RXByteCnt_B; + u1Byte DoubleComfirm; + u1Byte TrafficLoad; + //SW Antenna Switch + + +#endif +*/ +#ifdef CONFIG_HW_ANTENNA_DIVERSITY + //Hybrid Antenna Diversity + u4Byte CCK_Ant1_Cnt[ODM_ASSOCIATE_ENTRY_NUM]; + u4Byte CCK_Ant2_Cnt[ODM_ASSOCIATE_ENTRY_NUM]; + u4Byte OFDM_Ant1_Cnt[ODM_ASSOCIATE_ENTRY_NUM]; + u4Byte OFDM_Ant2_Cnt[ODM_ASSOCIATE_ENTRY_NUM]; + u4Byte RSSI_Ant1_Sum[ODM_ASSOCIATE_ENTRY_NUM]; + u4Byte RSSI_Ant2_Sum[ODM_ASSOCIATE_ENTRY_NUM]; + u1Byte TxAnt[ODM_ASSOCIATE_ENTRY_NUM]; + u1Byte TargetSTA; + u1Byte antsel; + u1Byte RxIdleAnt; + +#endif + +}SWAT_T, *pSWAT_T; + + +#if (DM_ODM_SUPPORT_TYPE & (ODM_AP)) +#if (defined(CONFIG_HW_ANTENNA_DIVERSITY)) +typedef struct _BF_DIV_COEX_ +{ + BOOLEAN w_BFer_Client[ODM_ASSOCIATE_ENTRY_NUM]; + BOOLEAN w_BFee_Client[ODM_ASSOCIATE_ENTRY_NUM]; + u4Byte MA_rx_TP[ODM_ASSOCIATE_ENTRY_NUM]; + u4Byte MA_rx_TP_DIV[ODM_ASSOCIATE_ENTRY_NUM]; + + u1Byte BDCcoexType_wBfer; + u1Byte num_Txbfee_Client; + u1Byte num_Txbfer_Client; + u1Byte BDC_Try_counter; + u1Byte BDC_Hold_counter; + u1Byte BDC_Mode; + u1Byte BDC_active_Mode; + u1Byte BDC_state; + u1Byte BDC_RxIdleUpdate_counter; + u1Byte num_Client; + u1Byte pre_num_Client; + u1Byte num_BfTar; + u1Byte num_DivTar; + + BOOLEAN bAll_DivSta_Idle; + BOOLEAN bAll_BFSta_Idle; + BOOLEAN BDC_Try_flag; + BOOLEAN BF_pass; + BOOLEAN DIV_pass; +}BDC_T,*pBDC_T; +#endif +#endif + + +typedef struct _FAST_ANTENNA_TRAINNING_ +{ + u1Byte Bssid[6]; + u1Byte antsel_rx_keep_0; + u1Byte antsel_rx_keep_1; + u1Byte antsel_rx_keep_2; + u1Byte antsel_rx_keep_3; + u4Byte antSumRSSI[7]; + u4Byte antRSSIcnt[7]; + u4Byte antAveRSSI[7]; + u1Byte FAT_State; + u4Byte TrainIdx; + u1Byte antsel_a[ODM_ASSOCIATE_ENTRY_NUM]; + u1Byte antsel_b[ODM_ASSOCIATE_ENTRY_NUM]; + u1Byte antsel_c[ODM_ASSOCIATE_ENTRY_NUM]; + u4Byte MainAnt_Sum[ODM_ASSOCIATE_ENTRY_NUM]; + u4Byte AuxAnt_Sum[ODM_ASSOCIATE_ENTRY_NUM]; + u4Byte MainAnt_Cnt[ODM_ASSOCIATE_ENTRY_NUM]; + u4Byte AuxAnt_Cnt[ODM_ASSOCIATE_ENTRY_NUM]; + u1Byte RxIdleAnt; + u1Byte AntDiv_OnOff; + BOOLEAN bBecomeLinked; + u4Byte MinMaxRSSI; + u1Byte idx_AntDiv_counter_2G; + u1Byte idx_AntDiv_counter_5G; + u1Byte AntDiv_2G_5G; + u4Byte CCK_counter_main; + u4Byte CCK_counter_aux; + u4Byte OFDM_counter_main; + u4Byte OFDM_counter_aux; + + #ifdef ODM_EVM_ENHANCE_ANTDIV + u4Byte MainAntEVM_Sum[ODM_ASSOCIATE_ENTRY_NUM]; + u4Byte AuxAntEVM_Sum[ODM_ASSOCIATE_ENTRY_NUM]; + u4Byte MainAntEVM_Cnt[ODM_ASSOCIATE_ENTRY_NUM]; + u4Byte AuxAntEVM_Cnt[ODM_ASSOCIATE_ENTRY_NUM]; + BOOLEAN EVM_method_enable; + u1Byte TargetAnt_EVM; + u1Byte TargetAnt_CRC32; + u1Byte TargetAnt_enhance; + u1Byte pre_TargetAnt_enhance; + u2Byte Main_MPDU_OK_cnt; + u2Byte Aux_MPDU_OK_cnt; + + u4Byte CRC32_Ok_Cnt; + u4Byte CRC32_Fail_Cnt; + u4Byte MainCRC32_Ok_Cnt; + u4Byte AuxCRC32_Ok_Cnt; + u4Byte MainCRC32_Fail_Cnt; + u4Byte AuxCRC32_Fail_Cnt; + #endif + #if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) + u4Byte CCK_CtrlFrame_Cnt_main; + u4Byte CCK_CtrlFrame_Cnt_aux; + u4Byte OFDM_CtrlFrame_Cnt_main; + u4Byte OFDM_CtrlFrame_Cnt_aux; + u4Byte MainAnt_CtrlFrame_Sum; + u4Byte AuxAnt_CtrlFrame_Sum; + u4Byte MainAnt_CtrlFrame_Cnt; + u4Byte AuxAnt_CtrlFrame_Cnt; + #endif + BOOLEAN fix_ant_bfee; +}FAT_T,*pFAT_T; + + +//1 ============================================================ +//1 enumeration +//1 ============================================================ + + + +typedef enum _FAT_STATE +{ + FAT_NORMAL_STATE = 0, + FAT_TRAINING_STATE = 1, +}FAT_STATE_E, *PFAT_STATE_E; + + +typedef enum _ANT_DIV_TYPE +{ + NO_ANTDIV = 0xFF, + CG_TRX_HW_ANTDIV = 0x01, + CGCS_RX_HW_ANTDIV = 0x02, + FIXED_HW_ANTDIV = 0x03, + CG_TRX_SMART_ANTDIV = 0x04, + CGCS_RX_SW_ANTDIV = 0x05, + S0S1_SW_ANTDIV = 0x06 //8723B intrnal switch S0 S1 +}ANT_DIV_TYPE_E, *PANT_DIV_TYPE_E; + + +//1 ============================================================ +//1 function prototype +//1 ============================================================ + + +VOID +ODM_StopAntennaSwitchDm( + IN PVOID pDM_VOID + ); +VOID +ODM_SetAntConfig( + IN PVOID pDM_VOID, + IN u1Byte antSetting // 0=A, 1=B, 2=C, .... + ); + + +#define SwAntDivRestAfterLink ODM_SwAntDivRestAfterLink +VOID ODM_SwAntDivRestAfterLink( + IN PVOID pDM_VOID + ); + +#if (defined(CONFIG_HW_ANTENNA_DIVERSITY)) + +VOID +ODM_UpdateRxIdleAnt( + IN PVOID pDM_VOID, + IN u1Byte Ant +); + +#if (RTL8723B_SUPPORT == 1)||(RTL8821A_SUPPORT == 1) +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) +VOID +ODM_SW_AntDiv_Callback( + IN PRT_TIMER pTimer + ); + +VOID +ODM_SW_AntDiv_WorkitemCallback( + IN PVOID pContext + ); + + +#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) + +VOID +ODM_SW_AntDiv_Callback( + void *FunctionContext + ); + +#endif + +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) +VOID +odm_S0S1_SwAntDivByCtrlFrame( + IN PVOID pDM_VOID, + IN u1Byte Step +); + +VOID +odm_AntselStatisticsOfCtrlFrame( + IN PVOID pDM_VOID, + IN u1Byte antsel_tr_mux, + IN u4Byte RxPWDBAll +); + +VOID +odm_S0S1_SwAntDivByCtrlFrame_ProcessRSSI( + IN PVOID pDM_VOID, + IN PVOID p_phy_info_void, + IN PVOID p_pkt_info_void +); + +/* +VOID +odm_S0S1_SwAntDivByCtrlFrame_ProcessRSSI( + IN PVOID pDM_VOID, + IN PVOID p_phy_info_void, + IN PVOID p_pkt_info_void +); +*/ + +#endif +#endif + +#ifdef ODM_EVM_ENHANCE_ANTDIV +VOID +odm_EVM_FastAntTrainingCallback( + IN PVOID pDM_VOID +); +#endif + +VOID +odm_HW_AntDiv( + IN PVOID pDM_VOID +); + +#if( defined(CONFIG_5G_CG_SMART_ANT_DIVERSITY) ) ||( defined(CONFIG_2G_CG_SMART_ANT_DIVERSITY) ) +VOID +odm_FastAntTraining( + IN PVOID pDM_VOID +); + +VOID +odm_FastAntTrainingCallback( + IN PVOID pDM_VOID +); + +VOID +odm_FastAntTrainingWorkItemCallback( + IN PVOID pDM_VOID +); +#endif + + +VOID +ODM_AntDivInit( + IN PVOID pDM_VOID +); + +VOID +ODM_AntDiv( + IN PVOID pDM_VOID +); + +VOID +odm_AntselStatistics( + IN PVOID pDM_VOID, + IN u1Byte antsel_tr_mux, + IN u4Byte MacId, + IN u4Byte utility, + IN u1Byte method +); +/* +VOID +ODM_Process_RSSIForAntDiv( + IN OUT PVOID pDM_VOID, + IN PVOID p_phy_info_void, + IN PVOID p_pkt_info_void +); +*/ + + +VOID +ODM_Process_RSSIForAntDiv( + IN OUT PVOID pDM_VOID, + IN PVOID p_phy_info_void, + IN PVOID p_pkt_info_void +); + + + +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) +VOID +ODM_SetTxAntByTxInfo( + IN PVOID pDM_VOID, + IN pu1Byte pDesc, + IN u1Byte macId +); + +#elif(DM_ODM_SUPPORT_TYPE == ODM_AP) + +VOID +ODM_SetTxAntByTxInfo( + struct rtl8192cd_priv *priv, + struct tx_desc *pdesc, + unsigned short aid +); + +#endif + + +VOID +ODM_AntDiv_Config( + IN PVOID pDM_VOID +); + + +VOID +ODM_UpdateRxIdleAnt_8723B( + IN PVOID pDM_VOID, + IN u1Byte Ant, + IN u4Byte DefaultAnt, + IN u4Byte OptionalAnt +); + +VOID +ODM_AntDivTimers( + IN PVOID pDM_VOID, + IN u1Byte state +); + +#endif //#if (defined(CONFIG_HW_ANTENNA_DIVERSITY)) + +VOID +ODM_AntDivReset( + IN PVOID pDM_VOID +); + +VOID +odm_AntennaDiversityInit( + IN PVOID pDM_VOID +); + +VOID +odm_AntennaDiversity( + IN PVOID pDM_VOID +); + + +#endif //#ifndef __ODMANTDIV_H__ diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_CfoTracking.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_CfoTracking.c new file mode 100644 index 00000000000000..4978e35d490f8c --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_CfoTracking.c @@ -0,0 +1,357 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ +#include "Mp_Precomp.h" +#include "phydm_precomp.h" + +VOID +odm_SetCrystalCap( + IN PVOID pDM_VOID, + IN u1Byte CrystalCap +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PCFO_TRACKING pCfoTrack = (PCFO_TRACKING)PhyDM_Get_Structure( pDM_Odm, PHYDM_CFOTRACK); + BOOLEAN bEEPROMCheck; +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) + PADAPTER Adapter = pDM_Odm->Adapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + + bEEPROMCheck = (pHalData->EEPROMVersion >= 0x01)?TRUE:FALSE; +#else + bEEPROMCheck = TRUE; +#endif + + if(pCfoTrack->CrystalCap == CrystalCap) + return; + + pCfoTrack->CrystalCap = CrystalCap; + + if(pDM_Odm->SupportICType & ODM_RTL8192D) + { + ODM_SetBBReg(pDM_Odm, REG_AFE_XTAL_CTRL, 0x000000F0, CrystalCap & 0x0F); + ODM_SetBBReg(pDM_Odm, REG_AFE_PLL_CTRL, 0xF0000000, ((CrystalCap & 0xF0) >> 4)); + } + else if(pDM_Odm->SupportICType & ODM_RTL8188E) + { + // write 0x24[22:17] = 0x24[16:11] = CrystalCap + CrystalCap = CrystalCap & 0x3F; + ODM_SetBBReg(pDM_Odm, REG_AFE_XTAL_CTRL, 0x007ff800, (CrystalCap | (CrystalCap << 6))); + } + else if(pDM_Odm->SupportICType & ODM_RTL8812) + { + // write 0x2C[30:25] = 0x2C[24:19] = CrystalCap + CrystalCap = CrystalCap & 0x3F; + ODM_SetBBReg(pDM_Odm, REG_MAC_PHY_CTRL, 0x7FF80000, (CrystalCap | (CrystalCap << 6))); + } + else if (((pDM_Odm->SupportICType & ODM_RTL8723A) && bEEPROMCheck) || + (pDM_Odm->SupportICType & ODM_RTL8723B) ||(pDM_Odm->SupportICType & ODM_RTL8192E) || + (pDM_Odm->SupportICType & ODM_RTL8821)) + { + // 0x2C[23:18] = 0x2C[17:12] = CrystalCap + CrystalCap = CrystalCap & 0x3F; + ODM_SetBBReg(pDM_Odm, REG_MAC_PHY_CTRL, 0x00FFF000, (CrystalCap | (CrystalCap << 6))); + } + else if(pDM_Odm->SupportICType & ODM_RTL8821B) + { + // write 0x28[6:1] = 0x24[30:25] = CrystalCap + CrystalCap = CrystalCap & 0x3F; + ODM_SetBBReg(pDM_Odm, REG_AFE_XTAL_CTRL, 0x7E000000, CrystalCap); + ODM_SetBBReg(pDM_Odm, REG_AFE_PLL_CTRL, 0x7E, CrystalCap); + } + else if(pDM_Odm->SupportICType & (ODM_RTL8814A|ODM_RTL8822B)) + { + // write 0x2C[26:21] = 0x2C[20:15] = CrystalCap + CrystalCap = CrystalCap & 0x3F; + ODM_SetBBReg(pDM_Odm, REG_MAC_PHY_CTRL, 0x07FF8000, (CrystalCap | (CrystalCap << 6))); + } + else + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CFO_TRACKING, ODM_DBG_LOUD, ("odm_SetCrystalCap(): Use default setting.\n")); + ODM_SetBBReg(pDM_Odm, REG_MAC_PHY_CTRL, 0xFFF000, (CrystalCap | (CrystalCap << 6))); + } + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CFO_TRACKING, ODM_DBG_LOUD, ("odm_SetCrystalCap(): CrystalCap = 0x%x\n", CrystalCap)); +} + +u1Byte +odm_GetDefaultCrytaltalCap( + IN PVOID pDM_VOID +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + u1Byte CrystalCap = 0x20; + +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) + PADAPTER Adapter = pDM_Odm->Adapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + + CrystalCap = pHalData->CrystalCap; +#else + prtl8192cd_priv priv = pDM_Odm->priv; + + if(priv->pmib->dot11RFEntry.xcap > 0) + CrystalCap = priv->pmib->dot11RFEntry.xcap; +#endif + + CrystalCap = CrystalCap & 0x3f; + + return CrystalCap; +} + +VOID +odm_SetATCStatus( + IN PVOID pDM_VOID, + IN BOOLEAN ATCStatus +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PCFO_TRACKING pCfoTrack = (PCFO_TRACKING)PhyDM_Get_Structure( pDM_Odm, PHYDM_CFOTRACK); + + if(pCfoTrack->bATCStatus == ATCStatus) + return; + + ODM_SetBBReg(pDM_Odm, ODM_REG(BB_ATC,pDM_Odm), ODM_BIT(BB_ATC,pDM_Odm), ATCStatus); + pCfoTrack->bATCStatus = ATCStatus; +} + +BOOLEAN +odm_GetATCStatus( + IN PVOID pDM_VOID +) +{ + BOOLEAN ATCStatus; + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + + ATCStatus = (BOOLEAN)ODM_GetBBReg(pDM_Odm, ODM_REG(BB_ATC,pDM_Odm), ODM_BIT(BB_ATC,pDM_Odm)); + return ATCStatus; +} + +VOID +ODM_CfoTrackingReset( + IN PVOID pDM_VOID +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PCFO_TRACKING pCfoTrack = (PCFO_TRACKING)PhyDM_Get_Structure( pDM_Odm, PHYDM_CFOTRACK); + u1Byte CrystalCap; + + pCfoTrack->DefXCap = odm_GetDefaultCrytaltalCap(pDM_Odm); + pCfoTrack->bAdjust = TRUE; + +#if(DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) + odm_SetCrystalCap(pDM_Odm, pCfoTrack->DefXCap); + odm_SetATCStatus(pDM_Odm, TRUE); +#else + if(pCfoTrack->CrystalCap > pCfoTrack->DefXCap) + { + for(CrystalCap = pCfoTrack->CrystalCap; CrystalCap >= pCfoTrack->DefXCap; CrystalCap--) + odm_SetCrystalCap(pDM_Odm, CrystalCap); + } + else + { + for(CrystalCap = pCfoTrack->CrystalCap; CrystalCap <= pCfoTrack->DefXCap; CrystalCap++) + odm_SetCrystalCap(pDM_Odm, CrystalCap); + } +#endif +} + +VOID +ODM_CfoTrackingInit( + IN PVOID pDM_VOID +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PCFO_TRACKING pCfoTrack = (PCFO_TRACKING)PhyDM_Get_Structure( pDM_Odm, PHYDM_CFOTRACK); + + pCfoTrack->DefXCap = pCfoTrack->CrystalCap = odm_GetDefaultCrytaltalCap(pDM_Odm); + pCfoTrack->bATCStatus = odm_GetATCStatus(pDM_Odm); + pCfoTrack->bAdjust = TRUE; + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CFO_TRACKING, ODM_DBG_LOUD, ("ODM_CfoTracking_init()=========> \n")); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CFO_TRACKING, ODM_DBG_LOUD, ("ODM_CfoTracking_init(): bATCStatus = %d, CrystalCap = 0x%x \n",pCfoTrack->bATCStatus, pCfoTrack->DefXCap)); +} + +VOID +ODM_CfoTracking( + IN PVOID pDM_VOID +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PCFO_TRACKING pCfoTrack = (PCFO_TRACKING)PhyDM_Get_Structure( pDM_Odm, PHYDM_CFOTRACK); + int CFO_kHz_A, CFO_kHz_B, CFO_ave = 0; + int CFO_ave_diff; + int CrystalCap = (int)pCfoTrack->CrystalCap; + u1Byte Adjust_Xtal = 1; + + //4 Support ability + if(!(pDM_Odm->SupportAbility & ODM_BB_CFO_TRACKING)) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CFO_TRACKING, ODM_DBG_LOUD, ("ODM_CfoTracking(): Return: SupportAbility ODM_BB_CFO_TRACKING is disabled\n")); + return; + } + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CFO_TRACKING, ODM_DBG_LOUD, ("ODM_CfoTracking()=========> \n")); + + if(!pDM_Odm->bLinked || !pDM_Odm->bOneEntryOnly) + { + //4 No link or more than one entry + ODM_CfoTrackingReset(pDM_Odm); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CFO_TRACKING, ODM_DBG_LOUD, ("ODM_CfoTracking(): Reset: bLinked = %d, bOneEntryOnly = %d\n", + pDM_Odm->bLinked, pDM_Odm->bOneEntryOnly)); + } + else + { + //3 1. CFO Tracking + //4 1.1 No new packet + if(pCfoTrack->packetCount == pCfoTrack->packetCount_pre) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CFO_TRACKING, ODM_DBG_LOUD, ("ODM_CfoTracking(): packet counter doesn't change\n")); + return; + } + pCfoTrack->packetCount_pre = pCfoTrack->packetCount; + + //4 1.2 Calculate CFO + CFO_kHz_A = (int)(pCfoTrack->CFO_tail[0] * 3125) / 1280; + CFO_kHz_B = (int)(pCfoTrack->CFO_tail[1] * 3125) / 1280; + + if(pDM_Odm->RFType < ODM_2T2R) + CFO_ave = CFO_kHz_A; + else + CFO_ave = (int)(CFO_kHz_A + CFO_kHz_B) >> 1; + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CFO_TRACKING, ODM_DBG_LOUD, ("ODM_CfoTracking(): CFO_kHz_A = %dkHz, CFO_kHz_B = %dkHz, CFO_ave = %dkHz\n", + CFO_kHz_A, CFO_kHz_B, CFO_ave)); + + //4 1.3 Avoid abnormal large CFO + CFO_ave_diff = (pCfoTrack->CFO_ave_pre >= CFO_ave)?(pCfoTrack->CFO_ave_pre - CFO_ave):(CFO_ave - pCfoTrack->CFO_ave_pre); + if(CFO_ave_diff > 20 && pCfoTrack->largeCFOHit == 0 && !pCfoTrack->bAdjust) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CFO_TRACKING, ODM_DBG_LOUD, ("ODM_CfoTracking(): first large CFO hit\n")); + pCfoTrack->largeCFOHit = 1; + return; + } + else + pCfoTrack->largeCFOHit = 0; + pCfoTrack->CFO_ave_pre = CFO_ave; + + //4 1.4 Dynamic Xtal threshold + if(pCfoTrack->bAdjust == FALSE) + { + if(CFO_ave > CFO_TH_XTAL_HIGH || CFO_ave < (-CFO_TH_XTAL_HIGH)) + pCfoTrack->bAdjust = TRUE; + } + else + { + if(CFO_ave < CFO_TH_XTAL_LOW && CFO_ave > (-CFO_TH_XTAL_LOW)) + pCfoTrack->bAdjust = FALSE; + } + +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) + //4 1.5 BT case: Disable CFO tracking + if(pDM_Odm->bBtEnabled) + { + pCfoTrack->bAdjust = FALSE; + odm_SetCrystalCap(pDM_Odm, pCfoTrack->DefXCap); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CFO_TRACKING, ODM_DBG_LOUD, ("ODM_CfoTracking(): Disable CFO tracking for BT!!\n")); + } + + //4 1.6 Big jump + if(pCfoTrack->bAdjust) + { + if(CFO_ave > CFO_TH_XTAL_LOW) + Adjust_Xtal = Adjust_Xtal + ((CFO_ave - CFO_TH_XTAL_LOW) >> 2); + else if(CFO_ave < (-CFO_TH_XTAL_LOW)) + Adjust_Xtal = Adjust_Xtal + ((CFO_TH_XTAL_LOW - CFO_ave) >> 2); + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CFO_TRACKING, ODM_DBG_LOUD, ("ODM_CfoTracking(): Crystal cap offset = %d\n", Adjust_Xtal)); + } +#endif + + //4 1.7 Adjust Crystal Cap. + if(pCfoTrack->bAdjust) + { + if(CFO_ave > CFO_TH_XTAL_LOW) + CrystalCap = CrystalCap + Adjust_Xtal; + else if(CFO_ave < (-CFO_TH_XTAL_LOW)) + CrystalCap = CrystalCap - Adjust_Xtal; + + if(CrystalCap > 0x3f) + CrystalCap = 0x3f; + else if (CrystalCap < 0) + CrystalCap = 0; + + odm_SetCrystalCap(pDM_Odm, (u1Byte)CrystalCap); + } + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CFO_TRACKING, ODM_DBG_LOUD, ("ODM_CfoTracking(): Crystal cap = 0x%x, Default Crystal cap = 0x%x\n", + pCfoTrack->CrystalCap, pCfoTrack->DefXCap)); + +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) + if(pDM_Odm->SupportICType & ODM_IC_11AC_SERIES) + return; + + //3 2. Dynamic ATC switch + if(CFO_ave < CFO_TH_ATC && CFO_ave > -CFO_TH_ATC) + { + odm_SetATCStatus(pDM_Odm, FALSE); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CFO_TRACKING, ODM_DBG_LOUD, ("ODM_CfoTracking(): Disable ATC!!\n")); + } + else + { + odm_SetATCStatus(pDM_Odm, TRUE); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CFO_TRACKING, ODM_DBG_LOUD, ("ODM_CfoTracking(): Enable ATC!!\n")); + } +#endif + } +} + +VOID +ODM_ParsingCFO( + IN PVOID pDM_VOID, + IN PVOID pPktinfo_VOID, + IN s1Byte* pcfotail + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PODM_PACKET_INFO_T pPktinfo = (PODM_PACKET_INFO_T)pPktinfo_VOID; + PCFO_TRACKING pCfoTrack = (PCFO_TRACKING)PhyDM_Get_Structure( pDM_Odm, PHYDM_CFOTRACK); + u1Byte i; + + if(!(pDM_Odm->SupportAbility & ODM_BB_CFO_TRACKING)) + return; + +#if(DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) + if(pPktinfo->bPacketMatchBSSID) +#else + if(pPktinfo->StationID != 0) +#endif + { + //3 Update CFO report for path-A & path-B + // Only paht-A and path-B have CFO tail and short CFO + for(i = ODM_RF_PATH_A; i <= ODM_RF_PATH_B; i++) + { + pCfoTrack->CFO_tail[i] = (int)pcfotail[i]; + } + + //3 Update packet counter + if(pCfoTrack->packetCount == 0xffffffff) + pCfoTrack->packetCount = 0; + else + pCfoTrack->packetCount++; + } +} + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_CfoTracking.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_CfoTracking.h new file mode 100644 index 00000000000000..77e0a4baa3f18a --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_CfoTracking.h @@ -0,0 +1,68 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +#ifndef __PHYDMCFOTRACK_H__ +#define __PHYDMCFOTRACK_H__ + +#define CFO_TRACKING_VERSION "1.0" + +#define CFO_TH_XTAL_HIGH 20 // kHz +#define CFO_TH_XTAL_LOW 10 // kHz +#define CFO_TH_ATC 80 // kHz + +typedef struct _CFO_TRACKING_ +{ + BOOLEAN bATCStatus; + BOOLEAN largeCFOHit; + BOOLEAN bAdjust; + u1Byte CrystalCap; + u1Byte DefXCap; + int CFO_tail[2]; + int CFO_ave_pre; + u4Byte packetCount; + u4Byte packetCount_pre; + + BOOLEAN bForceXtalCap; + BOOLEAN bReset; +}CFO_TRACKING, *PCFO_TRACKING; + +VOID +ODM_CfoTrackingReset( + IN PVOID pDM_VOID +); + +VOID +ODM_CfoTrackingInit( + IN PVOID pDM_VOID +); + +VOID +ODM_CfoTracking( + IN PVOID pDM_VOID +); + +VOID +ODM_ParsingCFO( + IN PVOID pDM_VOID, + IN PVOID pPktinfo_VOID, + IN s1Byte* pcfotail +); + +#endif \ No newline at end of file diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_DIG.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_DIG.c new file mode 100644 index 00000000000000..471630cce0bdc5 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_DIG.c @@ -0,0 +1,2008 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +//============================================================ +// include files +//============================================================ +#include "Mp_Precomp.h" +#include "phydm_precomp.h" + + +VOID +ODM_ChangeDynamicInitGainThresh( + IN PVOID pDM_VOID, + IN u4Byte DM_Type, + IN u4Byte DM_Value + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable; + + if (DM_Type == DIG_TYPE_THRESH_HIGH) + { + pDM_DigTable->RssiHighThresh = DM_Value; + } + else if (DM_Type == DIG_TYPE_THRESH_LOW) + { + pDM_DigTable->RssiLowThresh = DM_Value; + } + else if (DM_Type == DIG_TYPE_ENABLE) + { + pDM_DigTable->Dig_Enable_Flag = TRUE; + } + else if (DM_Type == DIG_TYPE_DISABLE) + { + pDM_DigTable->Dig_Enable_Flag = FALSE; + } + else if (DM_Type == DIG_TYPE_BACKOFF) + { + if(DM_Value > 30) + DM_Value = 30; + pDM_DigTable->BackoffVal = (u1Byte)DM_Value; + } + else if(DM_Type == DIG_TYPE_RX_GAIN_MIN) + { + if(DM_Value == 0) + DM_Value = 0x1; + pDM_DigTable->rx_gain_range_min = (u1Byte)DM_Value; + } + else if(DM_Type == DIG_TYPE_RX_GAIN_MAX) + { + if(DM_Value > 0x50) + DM_Value = 0x50; + pDM_DigTable->rx_gain_range_max = (u1Byte)DM_Value; + } +} // DM_ChangeDynamicInitGainThresh // + +int +getIGIForDiff(int value_IGI) +{ + #define ONERCCA_LOW_TH 0x30 + #define ONERCCA_LOW_DIFF 8 + + if (value_IGI < ONERCCA_LOW_TH) { + if ((ONERCCA_LOW_TH - value_IGI) < ONERCCA_LOW_DIFF) + return ONERCCA_LOW_TH; + else + return value_IGI + ONERCCA_LOW_DIFF; + } else { + return value_IGI; + } +} + +VOID +odm_FAThresholdCheck( + IN PVOID pDM_VOID, + IN BOOLEAN bDFSBand, + IN BOOLEAN bPerformance, + IN u4Byte RxTp, + IN u4Byte TxTp, + OUT u4Byte* dm_FA_thres + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + + if(pDM_Odm->bLinked && (bPerformance||bDFSBand)) + { + if(pDM_Odm->SupportICType == ODM_RTL8192D) + { + // 8192D special case + dm_FA_thres[0] = DM_DIG_FA_TH0_92D; + dm_FA_thres[1] = DM_DIG_FA_TH1_92D; + dm_FA_thres[2] = DM_DIG_FA_TH2_92D; + } +#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) + else if(pDM_Odm->SupportPlatform & (ODM_AP|ODM_ADSL)) + { + // For AP + if((RxTp>>2) > TxTp && RxTp < 10000 && RxTp > 500) // 10Mbps & 0.5Mbps + { + dm_FA_thres[0] = 0x080; + dm_FA_thres[1] = 0x100; + dm_FA_thres[2] = 0x200; + } + else + { + dm_FA_thres[0] = 0x100; + dm_FA_thres[1] = 0x200; + dm_FA_thres[2] = 0x300; + } + } +#else + else if(pDM_Odm->SupportICType == ODM_RTL8723A && pDM_Odm->bBtLimitedDig) + { + // 8723A BT special case + dm_FA_thres[0] = DM_DIG_FA_TH0; + dm_FA_thres[1] = 0x250; + dm_FA_thres[2] = 0x300; + } +#endif + else + { + // For NIC + dm_FA_thres[0] = DM_DIG_FA_TH0; + dm_FA_thres[1] = DM_DIG_FA_TH1; + dm_FA_thres[2] = DM_DIG_FA_TH2; + } + } + else + { +#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) + if(bDFSBand) + { + // For DFS band and no link + dm_FA_thres[0] = 250; + dm_FA_thres[1] = 1000; + dm_FA_thres[2] = 2000; + } + else +#endif + { + dm_FA_thres[0] = 2000; + dm_FA_thres[1] = 4000; + dm_FA_thres[2] = 5000; + } + } + return; +} + +u1Byte +odm_ForbiddenIGICheck( + IN PVOID pDM_VOID, + IN u1Byte DIG_Dynamic_MIN, + IN u1Byte CurrentIGI + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable; + PFALSE_ALARM_STATISTICS pFalseAlmCnt = (PFALSE_ALARM_STATISTICS)PhyDM_Get_Structure( pDM_Odm, PHYDM_FALSEALMCNT); + u1Byte rx_gain_range_min = pDM_DigTable->rx_gain_range_min; + + if(pFalseAlmCnt->Cnt_all > 10000) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Abnormally false alarm case. \n")); + + if(pDM_DigTable->LargeFAHit != 3) + pDM_DigTable->LargeFAHit++; + + if(pDM_DigTable->ForbiddenIGI < CurrentIGI)//if(pDM_DigTable->ForbiddenIGI < pDM_DigTable->CurIGValue) + { + pDM_DigTable->ForbiddenIGI = CurrentIGI;//pDM_DigTable->ForbiddenIGI = pDM_DigTable->CurIGValue; + pDM_DigTable->LargeFAHit = 1; + } + + if(pDM_DigTable->LargeFAHit >= 3) + { + if((pDM_DigTable->ForbiddenIGI + 2) > pDM_DigTable->rx_gain_range_max) + rx_gain_range_min = pDM_DigTable->rx_gain_range_max; + else + rx_gain_range_min = (pDM_DigTable->ForbiddenIGI + 2); + pDM_DigTable->Recover_cnt = 1800; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Abnormally false alarm case: Recover_cnt = %d \n", pDM_DigTable->Recover_cnt)); + } + } + else + { + if(pDM_DigTable->Recover_cnt != 0) + { + pDM_DigTable->Recover_cnt --; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Normal Case: Recover_cnt = %d \n", pDM_DigTable->Recover_cnt)); + } + else + { + if(pDM_DigTable->LargeFAHit < 3) + { + if((pDM_DigTable->ForbiddenIGI - 2) < DIG_Dynamic_MIN) //DM_DIG_MIN) + { + pDM_DigTable->ForbiddenIGI = DIG_Dynamic_MIN; //DM_DIG_MIN; + rx_gain_range_min = DIG_Dynamic_MIN; //DM_DIG_MIN; + ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Normal Case: At Lower Bound\n")); + } + else + { + pDM_DigTable->ForbiddenIGI -= 2; + rx_gain_range_min = (pDM_DigTable->ForbiddenIGI + 2); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Normal Case: Approach Lower Bound\n")); + } + } + else + { + pDM_DigTable->LargeFAHit = 0; + } + } + } + + return rx_gain_range_min; + +} + +VOID +odm_InbandNoiseCalculate ( + IN PVOID pDM_VOID + ) +{ +#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable; + u1Byte IGIBackup, TimeCnt = 0, ValidCnt = 0; + BOOLEAN bTimeout = TRUE; + s1Byte sNoise_A, sNoise_B; + s4Byte NoiseRpt_A = 0,NoiseRpt_B = 0; + u4Byte tmp = 0; + static u1Byte failCnt = 0; + + if(!(pDM_Odm->SupportICType & (ODM_RTL8192E))) + return; + + if(pDM_Odm->RFType == ODM_1T1R || *(pDM_Odm->pOnePathCCA) != ODM_CCA_2R) + return; + + if(!pDM_DigTable->bNoiseEst) + return; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_InbandNoiseEstimate()========>\n")); + + //1 Set initial gain. + IGIBackup = pDM_DigTable->CurIGValue; + pDM_DigTable->IGIOffset_A = 0; + pDM_DigTable->IGIOffset_B = 0; + ODM_Write_DIG(pDM_Odm, 0x24); + + //1 Update idle time power report + if(pDM_Odm->SupportICType & ODM_IC_11N_SERIES) + ODM_SetBBReg(pDM_Odm, ODM_REG_TX_ANT_CTRL_11N, BIT25, 0x0); + + delay_ms(2); + + //1 Get noise power level + while(1) + { + //2 Read Noise Floor Report + if(pDM_Odm->SupportICType & ODM_IC_11N_SERIES) + tmp = ODM_GetBBReg(pDM_Odm, 0x8f8, bMaskLWord); + + sNoise_A = (s1Byte)(tmp & 0xff); + sNoise_B = (s1Byte)((tmp & 0xff00)>>8); + + //ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("sNoise_A = %d, sNoise_B = %d\n",sNoise_A, sNoise_B)); + + if((sNoise_A < 20 && sNoise_A >= -70) && (sNoise_B < 20 && sNoise_B >= -70)) + { + ValidCnt++; + NoiseRpt_A += sNoise_A; + NoiseRpt_B += sNoise_B; + //ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("sNoise_A = %d, sNoise_B = %d\n",sNoise_A, sNoise_B)); + } + + TimeCnt++; + bTimeout = (TimeCnt >= 150)?TRUE:FALSE; + + if(ValidCnt == 20 || bTimeout) + break; + + delay_ms(2); + + } + + //1 Keep idle time power report + if(pDM_Odm->SupportICType & ODM_IC_11N_SERIES) + ODM_SetBBReg(pDM_Odm, ODM_REG_TX_ANT_CTRL_11N, BIT25, 0x1); + + //1 Recover IGI + ODM_Write_DIG(pDM_Odm, IGIBackup); + + //1 Calculate Noise Floor + if(ValidCnt != 0) + { + NoiseRpt_A /= (ValidCnt<<1); + NoiseRpt_B /= (ValidCnt<<1); + } + + if(bTimeout) + { + NoiseRpt_A = 0; + NoiseRpt_B = 0; + + failCnt ++; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("Noise estimate fail time = %d\n", failCnt)); + + if(failCnt == 3) + { + failCnt = 0; + pDM_DigTable->bNoiseEst = FALSE; + } + } + else + { + NoiseRpt_A = -110 + 0x24 + NoiseRpt_A -6; + NoiseRpt_B = -110 + 0x24 + NoiseRpt_B -6; + pDM_DigTable->bNoiseEst = FALSE; + failCnt = 0; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("NoiseRpt_A = %d, NoiseRpt_B = %d\n", NoiseRpt_A, NoiseRpt_B)); + } + + //1 Calculate IGI Offset + if(NoiseRpt_A > NoiseRpt_B) + { + pDM_DigTable->IGIOffset_A = NoiseRpt_A - NoiseRpt_B; + pDM_DigTable->IGIOffset_B = 0; + } + else + { + pDM_DigTable->IGIOffset_A = 0; + pDM_DigTable->IGIOffset_B = NoiseRpt_B - NoiseRpt_A; + } + +#endif + return; +} + +VOID +odm_DigForBtHsMode( + IN PVOID pDM_VOID + ) +{ +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pDIG_T pDM_DigTable=&pDM_Odm->DM_DigTable; + u1Byte digForBtHs=0; + u1Byte digUpBound=0x5a; + + if(pDM_Odm->bBtConnectProcess) + { + if(pDM_Odm->SupportICType&(ODM_RTL8723A)) + digForBtHs = 0x28; + else + digForBtHs = 0x22; + } + else + { + // + // Decide DIG value by BT HS RSSI. + // + digForBtHs = pDM_Odm->btHsRssi+4; + + //DIG Bound + if(pDM_Odm->SupportICType&(ODM_RTL8723A)) + digUpBound = 0x3e; + + if(digForBtHs > digUpBound) + digForBtHs = digUpBound; + if(digForBtHs < 0x1c) + digForBtHs = 0x1c; + + // update Current IGI + pDM_DigTable->BT30_CurIGI = digForBtHs; + } + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DigForBtHsMode() : set DigValue=0x%x\n", digForBtHs)); +#endif +} + +VOID +ODM_Write_DIG( + IN PVOID pDM_VOID, + IN u1Byte CurrentIGI + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable; + + if(pDM_DigTable->bStopDIG) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("Stop Writing IGI\n")); + return; + } + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_TRACE, ("ODM_REG(IGI_A,pDM_Odm)=0x%x, ODM_BIT(IGI,pDM_Odm)=0x%x \n", + ODM_REG(IGI_A,pDM_Odm),ODM_BIT(IGI,pDM_Odm))); + + //1 Check initial gain by upper bound + if(!pDM_DigTable->bPSDInProgress) + { + if(CurrentIGI > pDM_DigTable->rx_gain_range_max) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_TRACE, ("CurrentIGI(0x%02x) is larger than upper bound !!\n",CurrentIGI)); + CurrentIGI = pDM_DigTable->rx_gain_range_max; + } + if(pDM_Odm->SupportAbility & ODM_BB_ADAPTIVITY && pDM_Odm->adaptivity_flag == TRUE) + { + if(CurrentIGI > pDM_Odm->Adaptivity_IGI_upper) + CurrentIGI = pDM_Odm->Adaptivity_IGI_upper; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_write_DIG(): Adaptivity case: Force upper bound to 0x%x !!!!!!\n", CurrentIGI)); + } + } + + if(pDM_DigTable->CurIGValue != CurrentIGI) + { + //1 Set IGI value + if(pDM_Odm->SupportPlatform & (ODM_WIN|ODM_CE)) + { + ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_A,pDM_Odm), ODM_BIT(IGI,pDM_Odm), CurrentIGI); + + if(pDM_Odm->RFType > ODM_1T1R) + ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_B,pDM_Odm), ODM_BIT(IGI,pDM_Odm), CurrentIGI); + + if((pDM_Odm->SupportICType & ODM_IC_11AC_SERIES) && (pDM_Odm->RFType > ODM_2T2R)) + { + ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_C,pDM_Odm), ODM_BIT(IGI,pDM_Odm), CurrentIGI); + ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_D,pDM_Odm), ODM_BIT(IGI,pDM_Odm), CurrentIGI); + } + } + else if(pDM_Odm->SupportPlatform & (ODM_AP|ODM_ADSL)) + { + switch(*(pDM_Odm->pOnePathCCA)) + { + case ODM_CCA_2R: + ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_A,pDM_Odm), ODM_BIT(IGI,pDM_Odm), CurrentIGI); + + if(pDM_Odm->RFType > ODM_1T1R) + ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_B,pDM_Odm), ODM_BIT(IGI,pDM_Odm), CurrentIGI); + + if((pDM_Odm->SupportICType & ODM_IC_11AC_SERIES) && (pDM_Odm->RFType > ODM_2T2R)) + { + ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_C,pDM_Odm), ODM_BIT(IGI,pDM_Odm), CurrentIGI); + ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_D,pDM_Odm), ODM_BIT(IGI,pDM_Odm), CurrentIGI); + } + break; + case ODM_CCA_1R_A: + ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_A,pDM_Odm), ODM_BIT(IGI,pDM_Odm), CurrentIGI); + if(pDM_Odm->RFType != ODM_1T1R) + ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_B,pDM_Odm), ODM_BIT(IGI,pDM_Odm), getIGIForDiff(CurrentIGI)); + break; + case ODM_CCA_1R_B: + ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_A,pDM_Odm), ODM_BIT(IGI,pDM_Odm), getIGIForDiff(CurrentIGI)); + if(pDM_Odm->RFType != ODM_1T1R) + ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_B,pDM_Odm), ODM_BIT(IGI,pDM_Odm), CurrentIGI); + break; + } + } + pDM_DigTable->CurIGValue = CurrentIGI; + } + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_TRACE, ("CurrentIGI(0x%02x). \n",CurrentIGI)); + +} + +VOID +odm_PauseDIG( + IN PVOID pDM_VOID, + IN ODM_Pause_DIG_TYPE PauseType, + IN u1Byte IGIValue +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_PauseDIG()=========>\n")); + +#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) + if(*pDM_DigTable->pbP2pLinkInProgress) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_PauseDIG(): P2P in progress !!\n")); + return; + } +#endif + + if(!pDM_DigTable->bPauseDIG && (!(pDM_Odm->SupportAbility & ODM_BB_DIG) || !(pDM_Odm->SupportAbility & ODM_BB_FA_CNT))) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_PauseDIG(): Return: SupportAbility ODM_BB_DIG or ODM_BB_FA_CNT is disabled\n")); + return; + } + + switch(PauseType) + { + //1 Pause DIG + case ODM_PAUSE_DIG: + //2 Disable DIG + ODM_CmnInfoUpdate(pDM_Odm, ODM_CMNINFO_ABILITY, pDM_Odm->SupportAbility & (~ODM_BB_DIG)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_PauseDIG(): Pause DIG !!\n")); + + //2 Backup IGI value + if(!pDM_DigTable->bPauseDIG) + { + pDM_DigTable->IGIBackup = pDM_DigTable->CurIGValue; + pDM_DigTable->bPauseDIG = TRUE; + } + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_PauseDIG(): Backup IGI = 0x%x\n", pDM_DigTable->IGIBackup)); + + //2 Write new IGI value + ODM_Write_DIG(pDM_Odm, IGIValue); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_PauseDIG(): Write new IGI = 0x%x\n", IGIValue)); + break; + + //1 Resume DIG + case ODM_RESUME_DIG: + if(pDM_DigTable->bPauseDIG) + { + //2 Write backup IGI value + ODM_Write_DIG(pDM_Odm, pDM_DigTable->IGIBackup); + pDM_DigTable->bPauseDIG = FALSE; + pDM_DigTable->bIgnoreDIG = TRUE; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_PauseDIG(): Write original IGI = 0x%x\n", pDM_DigTable->IGIBackup)); + + //2 Enable DIG + ODM_CmnInfoUpdate(pDM_Odm, ODM_CMNINFO_ABILITY, pDM_Odm->SupportAbility | ODM_BB_DIG); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_PauseDIG(): Resume DIG !!\n")); + } + break; + + default: + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_PauseDIG(): Wrong type !!\n")); + break; + } +} + +BOOLEAN +odm_DigAbort( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable; + +#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) + prtl8192cd_priv priv = pDM_Odm->priv; +#elif(DM_ODM_SUPPORT_TYPE & ODM_WIN) + PADAPTER pAdapter = pDM_Odm->Adapter; + pRXHP_T pRX_HP_Table = &pDM_Odm->DM_RXHP_Table; +#endif + + //SupportAbility + if(!(pDM_Odm->SupportAbility & ODM_BB_FA_CNT)) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Return: SupportAbility ODM_BB_FA_CNT is disabled\n")); + return TRUE; + } + + //SupportAbility + if(!(pDM_Odm->SupportAbility & ODM_BB_DIG)) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Return: SupportAbility ODM_BB_DIG is disabled\n")); + return TRUE; + } + + //ScanInProcess + if(*(pDM_Odm->pbScanInProcess)) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Return: In Scan Progress \n")); + return TRUE; + } + + if(pDM_DigTable->bIgnoreDIG) + { + pDM_DigTable->bIgnoreDIG = FALSE; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Return: Ignore DIG \n")); + return TRUE; + } + + //add by Neil Chen to avoid PSD is processing + if(pDM_Odm->bDMInitialGainEnable == FALSE) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Return: PSD is Processing \n")); + return TRUE; + } + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + #if OS_WIN_FROM_WIN7(OS_VERSION) + if(IsAPModeExist( pAdapter) && pAdapter->bInHctTest) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Return: Is AP mode or In HCT Test \n")); + return TRUE; + } + #endif + + if(pDM_Odm->bBtHsOperation) + { + odm_DigForBtHsMode(pDM_Odm); + } + + if(!(pDM_Odm->SupportICType &(ODM_RTL8723A|ODM_RTL8188E))) + { + if(pRX_HP_Table->RXHP_flag == 1) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Return: In RXHP Operation \n")); + return TRUE; + } + } +#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) + #ifdef CONFIG_SPECIAL_SETTING_FOR_FUNAI_TV + if((pDM_Odm->bLinked) && (pDM_Odm->Adapter->registrypriv.force_igi !=0)) + { + printk("pDM_Odm->RSSI_Min=%d \n",pDM_Odm->RSSI_Min); + ODM_Write_DIG(pDM_Odm,pDM_Odm->Adapter->registrypriv.force_igi); + return TRUE; + } + #endif +#else + if (!(priv->up_time > 5)) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Return: Not In DIG Operation Period \n")); + return TRUE; + } +#endif + + return FALSE; +} + +VOID +odm_DIGInit( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable; +#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) + PFALSE_ALARM_STATISTICS FalseAlmCnt = (PFALSE_ALARM_STATISTICS)PhyDM_Get_Structure( pDM_Odm, PHYDM_FALSEALMCNT); +#endif + + pDM_DigTable->bStopDIG = FALSE; + pDM_DigTable->bPauseDIG = FALSE; + pDM_DigTable->bIgnoreDIG = FALSE; + pDM_DigTable->bPSDInProgress = FALSE; + pDM_DigTable->CurIGValue = (u1Byte) ODM_GetBBReg(pDM_Odm, ODM_REG(IGI_A,pDM_Odm), ODM_BIT(IGI,pDM_Odm)); + pDM_DigTable->RssiLowThresh = DM_DIG_THRESH_LOW; + pDM_DigTable->RssiHighThresh = DM_DIG_THRESH_HIGH; + pDM_DigTable->FALowThresh = DM_FALSEALARM_THRESH_LOW; + pDM_DigTable->FAHighThresh = DM_FALSEALARM_THRESH_HIGH; + pDM_DigTable->BackoffVal = DM_DIG_BACKOFF_DEFAULT; + pDM_DigTable->BackoffVal_range_max = DM_DIG_BACKOFF_MAX; + pDM_DigTable->BackoffVal_range_min = DM_DIG_BACKOFF_MIN; + pDM_DigTable->PreCCK_CCAThres = 0xFF; + pDM_DigTable->CurCCK_CCAThres = 0x83; + pDM_DigTable->ForbiddenIGI = DM_DIG_MIN_NIC; + pDM_DigTable->LargeFAHit = 0; + pDM_DigTable->Recover_cnt = 0; + pDM_DigTable->bMediaConnect_0 = FALSE; + pDM_DigTable->bMediaConnect_1 = FALSE; + + //To Initialize pDM_Odm->bDMInitialGainEnable == FALSE to avoid DIG error + pDM_Odm->bDMInitialGainEnable = TRUE; + +#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) + pDM_DigTable->DIG_Dynamic_MIN_0 = 0x25; + pDM_DigTable->DIG_Dynamic_MIN_1 = 0x25; + + // For AP\ ADSL modified DIG + pDM_DigTable->bTpTarget = FALSE; + pDM_DigTable->bNoiseEst = TRUE; + pDM_DigTable->IGIOffset_A = 0; + pDM_DigTable->IGIOffset_B = 0; + pDM_DigTable->TpTrainTH_min = 0; + + // For RTL8881A + FalseAlmCnt->Cnt_Ofdm_fail_pre = 0; + + //Dyanmic EDCCA + if(pDM_Odm->SupportICType & ODM_IC_11AC_SERIES) + { + ODM_SetBBReg(pDM_Odm, 0xC50, 0xFFFF0000, 0xfafd); + } +#else + pDM_DigTable->DIG_Dynamic_MIN_0 = DM_DIG_MIN_NIC; + pDM_DigTable->DIG_Dynamic_MIN_1 = DM_DIG_MIN_NIC; + + //To Initi BT30 IGI + pDM_DigTable->BT30_CurIGI=0x32; + + #if (DM_ODM_SUPPORT_TYPE & ODM_WIN) + *pDM_DigTable->pbP2pLinkInProgress= FALSE; + #endif +#endif + + if(pDM_Odm->BoardType & (ODM_BOARD_EXT_PA|ODM_BOARD_EXT_LNA)) + { + pDM_DigTable->rx_gain_range_max = DM_DIG_MAX_NIC; + pDM_DigTable->rx_gain_range_min = DM_DIG_MIN_NIC; + } + else + { + pDM_DigTable->rx_gain_range_max = DM_DIG_MAX_NIC; + pDM_DigTable->rx_gain_range_min = DM_DIG_MIN_NIC; + } + +} + + +VOID +odm_DIG( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; +#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) + PADAPTER pAdapter = pDM_Odm->Adapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pDM_Odm->Adapter); +#elif (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) + prtl8192cd_priv priv = pDM_Odm->priv; + PSTA_INFO_T pEntry; +#endif + + // Common parameters + pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable; + PFALSE_ALARM_STATISTICS pFalseAlmCnt = (PFALSE_ALARM_STATISTICS)PhyDM_Get_Structure( pDM_Odm, PHYDM_FALSEALMCNT); + BOOLEAN FirstConnect,FirstDisConnect; + u1Byte DIG_MaxOfMin, DIG_Dynamic_MIN; + u1Byte dm_dig_max, dm_dig_min; + u1Byte CurrentIGI = pDM_DigTable->CurIGValue; + u1Byte offset; + u4Byte dm_FA_thres[3]; + u4Byte TxTp = 0, RxTp = 0; + BOOLEAN bDFSBand = FALSE; + BOOLEAN bPerformance = TRUE, bFirstTpTarget = FALSE, bFirstCoverage = FALSE; +#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) + u4Byte TpTrainTH_MIN = DM_DIG_TP_Target_TH0; + static u1Byte TimeCnt = 0; + u1Byte i; +#endif + + if(odm_DigAbort(pDM_Odm) == TRUE) + return; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG()===========================>\n\n")); + + + //1 Update status +#if (RTL8192D_SUPPORT==1) + if(pDM_Odm->SupportICType == ODM_RTL8192D) + { + if(*(pDM_Odm->pMacPhyMode) == ODM_DMSP) + { + if(*(pDM_Odm->pbMasterOfDMSP)) + { + DIG_Dynamic_MIN = pDM_DigTable->DIG_Dynamic_MIN_0; + FirstConnect = (pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_0 == FALSE); + FirstDisConnect = (!pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_0 == TRUE); + } + else + { + DIG_Dynamic_MIN = pDM_DigTable->DIG_Dynamic_MIN_1; + FirstConnect = (pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_1 == FALSE); + FirstDisConnect = (!pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_1 == TRUE); + } + } + else + { + if(*(pDM_Odm->pBandType) == ODM_BAND_5G) + { + DIG_Dynamic_MIN = pDM_DigTable->DIG_Dynamic_MIN_0; + FirstConnect = (pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_0 == FALSE); + FirstDisConnect = (!pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_0 == TRUE); + } + else + { + DIG_Dynamic_MIN = pDM_DigTable->DIG_Dynamic_MIN_1; + FirstConnect = (pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_1 == FALSE); + FirstDisConnect = (!pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_1 == TRUE); + } + } + } + else +#endif + { + DIG_Dynamic_MIN = pDM_DigTable->DIG_Dynamic_MIN_0; + FirstConnect = (pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_0 == FALSE); + FirstDisConnect = (!pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_0 == TRUE); + } + +#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) + //1 Noise Floor Estimate + //pDM_DigTable->bNoiseEst = (FirstConnect)?TRUE:pDM_DigTable->bNoiseEst; + //odm_InbandNoiseCalculate (pDM_Odm); + + //1 Mode decision + if(pDM_Odm->bLinked) + { + //2 Calculate total TP + for (i=0; ipODM_StaInfo[i]; + if(IS_STA_VALID(pEntry)) + { + RxTp += (u4Byte)(pEntry->rx_byte_cnt_LowMAW>>7); + TxTp += (u4Byte)(pEntry->tx_byte_cnt_LowMAW>>7); //Kbps + } + } + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): TX TP = %dkbps, RX TP = %dkbps\n", TxTp, RxTp)); + } + + switch(pDM_Odm->priv->pshare->rf_ft_var.dig_cov_enable) + { + case 0: + { + bPerformance = TRUE; + break; + } + case 1: + { + bPerformance = FALSE; + break; + } + case 2: + { + if(pDM_Odm->bLinked) + { + if(pDM_DigTable->TpTrainTH_min > DM_DIG_TP_Target_TH0) + TpTrainTH_MIN = pDM_DigTable->TpTrainTH_min; + + if(pDM_DigTable->TpTrainTH_min > DM_DIG_TP_Target_TH1) + TpTrainTH_MIN = DM_DIG_TP_Target_TH1; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): TP training mode lower bound = %dkbps\n", TpTrainTH_MIN)); + + //2 Decide DIG mode by total TP + if((TxTp + RxTp) > DM_DIG_TP_Target_TH1) // change to performance mode + { + bFirstTpTarget = (!pDM_DigTable->bTpTarget)?TRUE:FALSE; + pDM_DigTable->bTpTarget = TRUE; + bPerformance = TRUE; + } + else if((TxTp + RxTp) < TpTrainTH_MIN) // change to coverage mode + { + bFirstCoverage = (pDM_DigTable->bTpTarget)?TRUE:FALSE; + + if(TimeCnt < DM_DIG_TP_Training_Period) + { + pDM_DigTable->bTpTarget = FALSE; + bPerformance = FALSE; + TimeCnt++; + } + else + { + pDM_DigTable->bTpTarget = TRUE; + bPerformance = TRUE; + bFirstTpTarget = TRUE; + TimeCnt = 0; + } + } + else // remain previous mode + { + bPerformance = pDM_DigTable->bTpTarget; + + if(!bPerformance) + { + if(TimeCnt < DM_DIG_TP_Training_Period) + TimeCnt++; + else + { + pDM_DigTable->bTpTarget = TRUE; + bPerformance = TRUE; + bFirstTpTarget = TRUE; + TimeCnt = 0; + } + } + } + + if(!bPerformance) + pDM_DigTable->TpTrainTH_min = RxTp + TxTp; + + } + else + { + bPerformance = FALSE; + pDM_DigTable->TpTrainTH_min = 0; + } + break; + } + default: + bPerformance = TRUE; + } + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("====== DIG mode = %d ======\n", pDM_Odm->priv->pshare->rf_ft_var.dig_cov_enable)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("====== bPerformance = %d ======\n", bPerformance)); +#endif + + //1 Boundary Decision +#if (RTL8192C_SUPPORT==1) + if((pDM_Odm->SupportICType & ODM_RTL8192C) && (pDM_Odm->BoardType & (ODM_BOARD_EXT_LNA | ODM_BOARD_EXT_PA))) + { + //2 High power case + if(pDM_Odm->SupportPlatform & (ODM_AP|ODM_ADSL)) + { + dm_dig_max = DM_DIG_MAX_AP_HP; + dm_dig_min = DM_DIG_MIN_AP_HP; + } + else + { + dm_dig_max = DM_DIG_MAX_NIC_HP; + dm_dig_min = DM_DIG_MIN_NIC_HP; + } + DIG_MaxOfMin = DM_DIG_MAX_AP_HP; + } + else +#endif + { +#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) + //2 For AP\ADSL + if(!bPerformance) + { + dm_dig_max = DM_DIG_MAX_AP_COVERAGR; + dm_dig_min = DM_DIG_MIN_AP_COVERAGE; + DIG_MaxOfMin = DM_DIG_MAX_OF_MIN_COVERAGE; + } + else + { + dm_dig_max = DM_DIG_MAX_AP; + dm_dig_min = DM_DIG_MIN_AP; + DIG_MaxOfMin = DM_DIG_MAX_OF_MIN; + } + + //4 DFS band + if (((*pDM_Odm->pChannel>= 52) &&(*pDM_Odm->pChannel <= 64)) || + ((*pDM_Odm->pChannel >= 100) && (*pDM_Odm->pChannel <= 140))) + { + bDFSBand = TRUE; + dm_dig_min = DM_DIG_MIN_AP_DFS; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): ====== In DFS band ======\n")); + } + + //4 TX2path + if (priv->pmib->dot11RFEntry.tx2path && !bDFSBand && (*(pDM_Odm->pWirelessMode) == ODM_WM_B)) + dm_dig_max = 0x2A; + +#if RTL8192E_SUPPORT +#ifdef HIGH_POWER_EXT_LNA + if ((pDM_Odm->SupportICType & (ODM_RTL8192E)) && (pDM_Odm->ExtLNA)) + dm_dig_max = 0x42; +#endif +#endif + +#else + //2 For WIN\CE + if(pDM_Odm->SupportICType >= ODM_RTL8188E) + dm_dig_max = 0x5A; + else + dm_dig_max = DM_DIG_MAX_NIC; + + if(pDM_Odm->SupportICType != ODM_RTL8821) + dm_dig_min = DM_DIG_MIN_NIC; + else + dm_dig_min = 0x1C; + + DIG_MaxOfMin = DM_DIG_MAX_AP; +#endif + } + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Absolutly upper bound = 0x%x, lower bound = 0x%x\n",dm_dig_max, dm_dig_min)); + +#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) + // for P2P case + if(0 < *pDM_Odm->pu1ForcedIgiLb) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): P2P case: Force IGI lb to: %u !!!!!!\n", *pDM_Odm->pu1ForcedIgiLb)); + dm_dig_min = *pDM_Odm->pu1ForcedIgiLb; + dm_dig_max = (dm_dig_min <= dm_dig_max) ? (dm_dig_max) : (dm_dig_min + 1); + } +#endif + + //1 Adjust boundary by RSSI + if(pDM_Odm->bLinked && bPerformance) + { + //2 Modify DIG upper bound +#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) + offset = 15; +#else + //4 Modify DIG upper bound for 92E, 8723A\B, 8821 & 8812 BT + if((pDM_Odm->SupportICType & (ODM_RTL8192E|ODM_RTL8723B|ODM_RTL8812|ODM_RTL8821|ODM_RTL8723A)) && (pDM_Odm->bBtLimitedDig==1)) + { + offset = 10; + ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Coex. case: Force upper bound to RSSI + %d !!!!!!\n", offset)); + } + else + offset = 15; +#endif + + if((pDM_Odm->RSSI_Min + offset) > dm_dig_max ) + pDM_DigTable->rx_gain_range_max = dm_dig_max; + else if((pDM_Odm->RSSI_Min + offset) < dm_dig_min ) + pDM_DigTable->rx_gain_range_max = dm_dig_min; + else + pDM_DigTable->rx_gain_range_max = pDM_Odm->RSSI_Min + offset; + +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) + //2 Modify DIG lower bound + //if(pDM_Odm->bOneEntryOnly) + { + if(pDM_Odm->RSSI_Min < dm_dig_min) + DIG_Dynamic_MIN = dm_dig_min; + else if (pDM_Odm->RSSI_Min > DIG_MaxOfMin) + DIG_Dynamic_MIN = DIG_MaxOfMin; + else + DIG_Dynamic_MIN = pDM_Odm->RSSI_Min; + } +#else + { + //4 For AP +#ifdef __ECOS + HAL_REORDER_BARRIER(); +#else + rmb(); +#endif + if (bDFSBand) + { + DIG_Dynamic_MIN = dm_dig_min; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): DFS band: Force lower bound to 0x%x after link !!!!!!\n", dm_dig_min)); + } + else + { + if(pDM_Odm->RSSI_Min < dm_dig_min) + DIG_Dynamic_MIN = dm_dig_min; + else if (pDM_Odm->RSSI_Min > DIG_MaxOfMin) + DIG_Dynamic_MIN = DIG_MaxOfMin; + else + DIG_Dynamic_MIN = pDM_Odm->RSSI_Min; + } + } +#endif + } + else + { +#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) + if(bPerformance && bDFSBand) + { + pDM_DigTable->rx_gain_range_max = 0x28; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): DFS band: Force upper bound to 0x%x before link !!!!!!\n", pDM_DigTable->rx_gain_range_max)); + } + else +#endif + { + pDM_DigTable->rx_gain_range_max = DM_DIG_MAX_OF_MIN; + } + DIG_Dynamic_MIN = dm_dig_min; + } + + //1 Force Lower Bound for AntDiv + if(pDM_Odm->bLinked && !pDM_Odm->bOneEntryOnly) + { + if((pDM_Odm->SupportICType & ODM_ANTDIV_SUPPORT) && (pDM_Odm->SupportAbility & ODM_BB_ANT_DIV)) + { + if(pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV || pDM_Odm->AntDivType == CG_TRX_SMART_ANTDIV ||pDM_Odm->AntDivType == S0S1_SW_ANTDIV) + { + if(pDM_DigTable->AntDiv_RSSI_max > DIG_MaxOfMin) + DIG_Dynamic_MIN = DIG_MaxOfMin; + else + DIG_Dynamic_MIN = (u1Byte) pDM_DigTable->AntDiv_RSSI_max; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("odm_DIG(): Antenna diversity case: Force lower bound to 0x%x !!!!!!\n", DIG_Dynamic_MIN)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("odm_DIG(): Antenna diversity case: RSSI_max = 0x%x !!!!!!\n", pDM_DigTable->AntDiv_RSSI_max)); + } + } + } + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Adjust boundary by RSSI Upper bound = 0x%x, Lower bound = 0x%x\n", + pDM_DigTable->rx_gain_range_max, DIG_Dynamic_MIN)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Link status: bLinked = %d, RSSI = %d, bFirstConnect = %d, bFirsrDisConnect = %d\n\n", + pDM_Odm->bLinked, pDM_Odm->RSSI_Min, FirstConnect, FirstDisConnect)); + + //1 Modify DIG lower bound, deal with abnormal case + //2 Abnormal false alarm case +#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) + if(bDFSBand) + { + pDM_DigTable->rx_gain_range_min = DIG_Dynamic_MIN; + } + else +#endif + { + if(!pDM_Odm->bLinked) + { + pDM_DigTable->rx_gain_range_min = DIG_Dynamic_MIN; + + if(FirstDisConnect) + pDM_DigTable->ForbiddenIGI = DIG_Dynamic_MIN; + } + else + pDM_DigTable->rx_gain_range_min = odm_ForbiddenIGICheck(pDM_Odm, DIG_Dynamic_MIN, CurrentIGI); + } + + //2 Abnormal # beacon case +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) + if(pDM_Odm->bLinked && !FirstConnect) + { + if((pDM_Odm->PhyDbgInfo.NumQryBeaconPkt < 5) && (pDM_Odm->bsta_state)) + { + pDM_DigTable->rx_gain_range_min = dm_dig_min; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Abnrormal #beacon (%d) case in STA mode: Force lower bound to 0x%x !!!!!!\n\n", + pDM_Odm->PhyDbgInfo.NumQryBeaconPkt, pDM_DigTable->rx_gain_range_min)); + } + } +#endif + + //2 Abnormal lower bound case + if(pDM_DigTable->rx_gain_range_min > pDM_DigTable->rx_gain_range_max) + { + pDM_DigTable->rx_gain_range_min = pDM_DigTable->rx_gain_range_max; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Abnrormal lower bound case: Force lower bound to 0x%x !!!!!!\n\n",pDM_DigTable->rx_gain_range_min)); + } + + + //1 False alarm threshold decision + odm_FAThresholdCheck(pDM_Odm, bDFSBand, bPerformance, RxTp, TxTp, dm_FA_thres); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): False alarm threshold = %d, %d, %d \n\n", dm_FA_thres[0], dm_FA_thres[1], dm_FA_thres[2])); + + //1 Adjust initial gain by false alarm + if(pDM_Odm->bLinked && bPerformance) + { + //2 After link + ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Adjust IGI after link\n")); + + if(bFirstTpTarget || (FirstConnect && bPerformance)) + { + pDM_DigTable->LargeFAHit = 0; + +#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) + if(bDFSBand) + { + if(pDM_Odm->RSSI_Min > 0x28) + CurrentIGI = 0x28; + else + CurrentIGI = pDM_Odm->RSSI_Min; + ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): DFS band: One-shot to 0x28 upmost!!!!!!\n")); + } + else +#endif + { + if(pDM_Odm->RSSI_Min < DIG_MaxOfMin) + { + if(CurrentIGI < pDM_Odm->RSSI_Min) + CurrentIGI = pDM_Odm->RSSI_Min; + } + else + { + if(CurrentIGI < DIG_MaxOfMin) + CurrentIGI = DIG_MaxOfMin; + } + +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) +#if (RTL8812A_SUPPORT==1) + if(pDM_Odm->SupportICType == ODM_RTL8812) + ODM_ConfigBBWithHeaderFile(pDM_Odm, CONFIG_BB_AGC_TAB_DIFF); +#endif +#endif + } + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): First connect case: IGI does on-shot to 0x%x\n", CurrentIGI)); + + } + else + { + if(pFalseAlmCnt->Cnt_all > dm_FA_thres[2]) + CurrentIGI = CurrentIGI + 4; + else if (pFalseAlmCnt->Cnt_all > dm_FA_thres[1]) + CurrentIGI = CurrentIGI + 2; + else if(pFalseAlmCnt->Cnt_all < dm_FA_thres[0]) + CurrentIGI = CurrentIGI - 2; + + //4 Abnormal # beacon case +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) + if((pDM_Odm->PhyDbgInfo.NumQryBeaconPkt < 5) && (pFalseAlmCnt->Cnt_all < DM_DIG_FA_TH1) && (pDM_Odm->bsta_state)) + { + CurrentIGI = pDM_DigTable->rx_gain_range_min; + ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Abnormal #beacon (%d) case: IGI does one-shot to 0x%x\n", + pDM_Odm->PhyDbgInfo.NumQryBeaconPkt, CurrentIGI)); + } +#endif + } + } + else + { + //2 Before link + ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Adjust IGI before link\n")); + + if(FirstDisConnect || bFirstCoverage) + { + CurrentIGI = dm_dig_min; + ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): First disconnect case: IGI does on-shot to lower bound\n")); + } + else + { + if(pFalseAlmCnt->Cnt_all > dm_FA_thres[2]) + CurrentIGI = CurrentIGI + 4; + else if (pFalseAlmCnt->Cnt_all > dm_FA_thres[1]) + CurrentIGI = CurrentIGI + 2; + else if(pFalseAlmCnt->Cnt_all < dm_FA_thres[0]) + CurrentIGI = CurrentIGI - 2; + } + } + + //1 Check initial gain by upper/lower bound + if(CurrentIGI < pDM_DigTable->rx_gain_range_min) + CurrentIGI = pDM_DigTable->rx_gain_range_min; + + if(CurrentIGI > pDM_DigTable->rx_gain_range_max) + CurrentIGI = pDM_DigTable->rx_gain_range_max; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): CurIGValue=0x%x, TotalFA = %d\n\n", CurrentIGI, pFalseAlmCnt->Cnt_all)); + + //1 High power RSSI threshold +#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) + if((pDM_Odm->SupportICType == ODM_RTL8723A)&& (pHalData->UndecoratedSmoothedPWDB > DM_DIG_HIGH_PWR_THRESHOLD)) + { + // High power IGI lower bound + ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): UndecoratedSmoothedPWDB(%#x)\n", pHalData->UndecoratedSmoothedPWDB)); + if(CurrentIGI < DM_DIG_HIGH_PWR_IGI_LOWER_BOUND) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): CurIGValue(%#x)\n", pDM_DigTable->CurIGValue)); + //pDM_DigTable->CurIGValue = DM_DIG_HIGH_PWR_IGI_LOWER_BOUND; + CurrentIGI=DM_DIG_HIGH_PWR_IGI_LOWER_BOUND; + } + } + if((pDM_Odm->SupportICType & ODM_RTL8723A) && IS_WIRELESS_MODE_G(pAdapter)) + { + if(pHalData->UndecoratedSmoothedPWDB > 0x28) + { + if(CurrentIGI < DM_DIG_Gmode_HIGH_PWR_IGI_LOWER_BOUND) + { + //pDM_DigTable->CurIGValue = DM_DIG_Gmode_HIGH_PWR_IGI_LOWER_BOUND; + CurrentIGI = DM_DIG_Gmode_HIGH_PWR_IGI_LOWER_BOUND; + } + } + } +#endif + + //1 Update status +#if (RTL8192D_SUPPORT==1) + if(pDM_Odm->SupportICType == ODM_RTL8192D) + { + //sherry delete DualMacSmartConncurrent 20110517 + if(*(pDM_Odm->pMacPhyMode) == ODM_DMSP) + { + ODM_Write_DIG_DMSP(pDM_Odm, CurrentIGI);//ODM_Write_DIG_DMSP(pDM_Odm, pDM_DigTable->CurIGValue); + if(*(pDM_Odm->pbMasterOfDMSP)) + { + pDM_DigTable->bMediaConnect_0 = pDM_Odm->bLinked; + pDM_DigTable->DIG_Dynamic_MIN_0 = DIG_Dynamic_MIN; + } + else + { + pDM_DigTable->bMediaConnect_1 = pDM_Odm->bLinked; + pDM_DigTable->DIG_Dynamic_MIN_1 = DIG_Dynamic_MIN; + } + } + else + { + ODM_Write_DIG(pDM_Odm, CurrentIGI);//ODM_Write_DIG(pDM_Odm, pDM_DigTable->CurIGValue); + if(*(pDM_Odm->pBandType) == ODM_BAND_5G) + { + pDM_DigTable->bMediaConnect_0 = pDM_Odm->bLinked; + pDM_DigTable->DIG_Dynamic_MIN_0 = DIG_Dynamic_MIN; + } + else + { + pDM_DigTable->bMediaConnect_1 = pDM_Odm->bLinked; + pDM_DigTable->DIG_Dynamic_MIN_1 = DIG_Dynamic_MIN; + } + } + } + else +#endif + { +#if ((DM_ODM_SUPPORT_TYPE & ODM_WIN) || ((DM_ODM_SUPPORT_TYPE & ODM_CE) && (ODM_CONFIG_BT_COEXIST == 1))) + if(pDM_Odm->bBtHsOperation) + { + if(pDM_Odm->bLinked) + { + if(pDM_DigTable->BT30_CurIGI > (CurrentIGI)) + ODM_Write_DIG(pDM_Odm, CurrentIGI); + else + ODM_Write_DIG(pDM_Odm, pDM_DigTable->BT30_CurIGI); + + pDM_DigTable->bMediaConnect_0 = pDM_Odm->bLinked; + pDM_DigTable->DIG_Dynamic_MIN_0 = DIG_Dynamic_MIN; + } + else + { + if(pDM_Odm->bLinkInProcess) + ODM_Write_DIG(pDM_Odm, 0x1c); + else if(pDM_Odm->bBtConnectProcess) + ODM_Write_DIG(pDM_Odm, 0x28); + else + ODM_Write_DIG(pDM_Odm, pDM_DigTable->BT30_CurIGI);//ODM_Write_DIG(pDM_Odm, pDM_DigTable->CurIGValue); + } + } + else // BT is not using +#endif + { + ODM_Write_DIG(pDM_Odm, CurrentIGI);//ODM_Write_DIG(pDM_Odm, pDM_DigTable->CurIGValue); + pDM_DigTable->bMediaConnect_0 = pDM_Odm->bLinked; + pDM_DigTable->DIG_Dynamic_MIN_0 = DIG_Dynamic_MIN; + } + } +} + +VOID +odm_DIGbyRSSI_LPS( + IN PVOID pDM_VOID + ) +{ +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PFALSE_ALARM_STATISTICS pFalseAlmCnt = (PFALSE_ALARM_STATISTICS)PhyDM_Get_Structure( pDM_Odm, PHYDM_FALSEALMCNT); + +#if (DM_ODM_SUPPORT_TYPE & ODM_CE) +#if 0 //and 2.3.5 coding rule + struct mlme_priv *pmlmepriv = &(pAdapter->mlmepriv); + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); + struct dm_priv *pdmpriv = &pHalData->dmpriv; +#endif +#endif + + u1Byte RSSI_Lower=DM_DIG_MIN_NIC; //0x1E or 0x1C + u1Byte CurrentIGI=pDM_Odm->RSSI_Min; + + if(odm_DigAbort(pDM_Odm) == TRUE) + return; + + CurrentIGI=CurrentIGI+RSSI_OFFSET_DIG; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIGbyRSSI_LPS()==>\n")); + + // Using FW PS mode to make IGI + //Adjust by FA in LPS MODE + if(pFalseAlmCnt->Cnt_all> DM_DIG_FA_TH2_LPS) + CurrentIGI = CurrentIGI+4; + else if (pFalseAlmCnt->Cnt_all > DM_DIG_FA_TH1_LPS) + CurrentIGI = CurrentIGI+2; + else if(pFalseAlmCnt->Cnt_all < DM_DIG_FA_TH0_LPS) + CurrentIGI = CurrentIGI-2; + + + //Lower bound checking + + //RSSI Lower bound check + if((pDM_Odm->RSSI_Min-10) > DM_DIG_MIN_NIC) + RSSI_Lower =(pDM_Odm->RSSI_Min-10); + else + RSSI_Lower =DM_DIG_MIN_NIC; + + //Upper and Lower Bound checking + if(CurrentIGI > DM_DIG_MAX_NIC) + CurrentIGI=DM_DIG_MAX_NIC; + else if(CurrentIGI < RSSI_Lower) + CurrentIGI =RSSI_Lower; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIGbyRSSI_LPS(): pFalseAlmCnt->Cnt_all = %d\n",pFalseAlmCnt->Cnt_all)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIGbyRSSI_LPS(): pDM_Odm->RSSI_Min = %d\n",pDM_Odm->RSSI_Min)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIGbyRSSI_LPS(): CurrentIGI = 0x%x\n",CurrentIGI)); + + ODM_Write_DIG(pDM_Odm, CurrentIGI);//ODM_Write_DIG(pDM_Odm, pDM_DigTable->CurIGValue); +#endif +} + +//3============================================================ +//3 FASLE ALARM CHECK +//3============================================================ + +VOID +odm_FalseAlarmCounterStatistics( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PFALSE_ALARM_STATISTICS FalseAlmCnt = (PFALSE_ALARM_STATISTICS)PhyDM_Get_Structure( pDM_Odm, PHYDM_FALSEALMCNT); + u4Byte ret_value; + +#if (DM_ODM_SUPPORT_TYPE == ODM_AP) +//Mark there, and check this in odm_DMWatchDog +#if 0 //(DM_ODM_SUPPORT_TYPE == ODM_AP) + prtl8192cd_priv priv = pDM_Odm->priv; + if( (priv->auto_channel != 0) && (priv->auto_channel != 2) ) + return; +#endif +#endif + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + if((pDM_Odm->SupportICType == ODM_RTL8192D) && + (*(pDM_Odm->pMacPhyMode)==ODM_DMSP)&& ////modify by Guo.Mingzhi 2011-12-29 + (!(*(pDM_Odm->pbMasterOfDMSP)))) + { + odm_FalseAlarmCounterStatistics_ForSlaveOfDMSP(pDM_Odm); + return; + } +#endif + + if(!(pDM_Odm->SupportAbility & ODM_BB_FA_CNT)) + return; + +#if (ODM_IC_11N_SERIES_SUPPORT == 1) + if(pDM_Odm->SupportICType & ODM_IC_11N_SERIES) + { + + //hold ofdm counter + ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_HOLDC_11N, BIT31, 1); //hold page C counter + ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_RSTD_11N, BIT31, 1); //hold page D counter + + ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_OFDM_FA_TYPE1_11N, bMaskDWord); + FalseAlmCnt->Cnt_Fast_Fsync = (ret_value&0xffff); + FalseAlmCnt->Cnt_SB_Search_fail = ((ret_value&0xffff0000)>>16); + + ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_OFDM_FA_TYPE2_11N, bMaskDWord); + FalseAlmCnt->Cnt_OFDM_CCA = (ret_value&0xffff); + FalseAlmCnt->Cnt_Parity_Fail = ((ret_value&0xffff0000)>>16); + + ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_OFDM_FA_TYPE3_11N, bMaskDWord); + FalseAlmCnt->Cnt_Rate_Illegal = (ret_value&0xffff); + FalseAlmCnt->Cnt_Crc8_fail = ((ret_value&0xffff0000)>>16); + + ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_OFDM_FA_TYPE4_11N, bMaskDWord); + FalseAlmCnt->Cnt_Mcs_fail = (ret_value&0xffff); + + FalseAlmCnt->Cnt_Ofdm_fail = FalseAlmCnt->Cnt_Parity_Fail + FalseAlmCnt->Cnt_Rate_Illegal + + FalseAlmCnt->Cnt_Crc8_fail + FalseAlmCnt->Cnt_Mcs_fail + + FalseAlmCnt->Cnt_Fast_Fsync + FalseAlmCnt->Cnt_SB_Search_fail; + +#if (RTL8188E_SUPPORT==1) + if(pDM_Odm->SupportICType == ODM_RTL8188E) + { + ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_SC_CNT_11N, bMaskDWord); + FalseAlmCnt->Cnt_BW_LSC = (ret_value&0xffff); + FalseAlmCnt->Cnt_BW_USC = ((ret_value&0xffff0000)>>16); + } +#endif + +#if (RTL8192D_SUPPORT==1) + if(pDM_Odm->SupportICType == ODM_RTL8192D) + { + odm_GetCCKFalseAlarm_92D(pDM_Odm); + } + else +#endif + { + //hold cck counter + ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_FA_RST_11N, BIT12, 1); + ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_FA_RST_11N, BIT14, 1); + + ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_CCK_FA_LSB_11N, bMaskByte0); + FalseAlmCnt->Cnt_Cck_fail = ret_value; + + ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_CCK_FA_MSB_11N, bMaskByte3); + FalseAlmCnt->Cnt_Cck_fail += (ret_value& 0xff)<<8; + + ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_CCK_CCA_CNT_11N, bMaskDWord); + FalseAlmCnt->Cnt_CCK_CCA = ((ret_value&0xFF)<<8) |((ret_value&0xFF00)>>8); + } + + FalseAlmCnt->Cnt_all = ( FalseAlmCnt->Cnt_Fast_Fsync + + FalseAlmCnt->Cnt_SB_Search_fail + + FalseAlmCnt->Cnt_Parity_Fail + + FalseAlmCnt->Cnt_Rate_Illegal + + FalseAlmCnt->Cnt_Crc8_fail + + FalseAlmCnt->Cnt_Mcs_fail + + FalseAlmCnt->Cnt_Cck_fail); + + FalseAlmCnt->Cnt_CCA_all = FalseAlmCnt->Cnt_OFDM_CCA + FalseAlmCnt->Cnt_CCK_CCA; + +#if (RTL8192C_SUPPORT==1) + if(pDM_Odm->SupportICType == ODM_RTL8192C) + odm_ResetFACounter_92C(pDM_Odm); +#endif + +#if (RTL8192D_SUPPORT==1) + if(pDM_Odm->SupportICType == ODM_RTL8192D) + odm_ResetFACounter_92D(pDM_Odm); +#endif + + if(pDM_Odm->SupportICType >=ODM_RTL8723A) + { + //reset false alarm counter registers + ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_RSTC_11N, BIT31, 1); + ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_RSTC_11N, BIT31, 0); + ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_RSTD_11N, BIT27, 1); + ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_RSTD_11N, BIT27, 0); + + //update ofdm counter + ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_HOLDC_11N, BIT31, 0); //update page C counter + ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_RSTD_11N, BIT31, 0); //update page D counter + + //reset CCK CCA counter + ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_FA_RST_11N, BIT13|BIT12, 0); + ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_FA_RST_11N, BIT13|BIT12, 2); + //reset CCK FA counter + ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_FA_RST_11N, BIT15|BIT14, 0); + ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_FA_RST_11N, BIT15|BIT14, 2); + } + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Enter odm_FalseAlarmCounterStatistics\n")); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Cnt_Fast_Fsync=%d, Cnt_SB_Search_fail=%d\n", + FalseAlmCnt->Cnt_Fast_Fsync, FalseAlmCnt->Cnt_SB_Search_fail)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Cnt_Parity_Fail=%d, Cnt_Rate_Illegal=%d\n", + FalseAlmCnt->Cnt_Parity_Fail, FalseAlmCnt->Cnt_Rate_Illegal)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Cnt_Crc8_fail=%d, Cnt_Mcs_fail=%d\n", + FalseAlmCnt->Cnt_Crc8_fail, FalseAlmCnt->Cnt_Mcs_fail)); + } +#endif + +#if (ODM_IC_11AC_SERIES_SUPPORT == 1) + if(pDM_Odm->SupportICType & ODM_IC_11AC_SERIES) + { + u4Byte CCKenable; + + //read OFDM FA counter + FalseAlmCnt->Cnt_Ofdm_fail = ODM_GetBBReg(pDM_Odm, ODM_REG_OFDM_FA_11AC, bMaskLWord); + FalseAlmCnt->Cnt_Cck_fail = ODM_GetBBReg(pDM_Odm, ODM_REG_CCK_FA_11AC, bMaskLWord); + + //read CCK/OFDM CCA counter + ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_CCK_CCA_CNT_11AC, bMaskDWord); + FalseAlmCnt->Cnt_OFDM_CCA = (ret_value & 0xffff0000) >> 16; + FalseAlmCnt->Cnt_CCK_CCA = ret_value & 0xffff; + +#if (RTL8881A_SUPPORT==1) + // For 8881A + if(pDM_Odm->SupportICType == ODM_RTL8881A) + { + u4Byte Cnt_Ofdm_fail_temp = 0; + + if(FalseAlmCnt->Cnt_Ofdm_fail >= FalseAlmCnt->Cnt_Ofdm_fail_pre) + { + Cnt_Ofdm_fail_temp = FalseAlmCnt->Cnt_Ofdm_fail_pre; + FalseAlmCnt->Cnt_Ofdm_fail_pre = FalseAlmCnt->Cnt_Ofdm_fail; + FalseAlmCnt->Cnt_Ofdm_fail = FalseAlmCnt->Cnt_Ofdm_fail - Cnt_Ofdm_fail_temp; + } + else + FalseAlmCnt->Cnt_Ofdm_fail_pre = FalseAlmCnt->Cnt_Ofdm_fail; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Cnt_Ofdm_fail=%d\n", FalseAlmCnt->Cnt_Ofdm_fail_pre)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Cnt_Ofdm_fail_pre=%d\n", Cnt_Ofdm_fail_temp)); + + // Reset FA counter by enable/disable OFDM + if(FalseAlmCnt->Cnt_Ofdm_fail_pre >= 0x7fff) + { + // reset OFDM + ODM_SetBBReg(pDM_Odm, ODM_REG_BB_RX_PATH_11AC, BIT29,0); + ODM_SetBBReg(pDM_Odm, ODM_REG_BB_RX_PATH_11AC, BIT29,1); + FalseAlmCnt->Cnt_Ofdm_fail_pre = 0; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Reset false alarm counter\n")); + } + } +#endif + + // reset OFDM FA coutner + ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_RST_11AC, BIT17, 1); + ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_RST_11AC, BIT17, 0); + + // reset CCK FA counter + ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_FA_RST_11AC, BIT15, 0); + ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_FA_RST_11AC, BIT15, 1); + + // reset CCA counter + ODM_SetBBReg(pDM_Odm, ODM_REG_RST_RPT_11AC, BIT0, 1); + ODM_SetBBReg(pDM_Odm, ODM_REG_RST_RPT_11AC, BIT0, 0); + + CCKenable = ODM_GetBBReg(pDM_Odm, ODM_REG_BB_RX_PATH_11AC, BIT28); + if(CCKenable)//if(*pDM_Odm->pBandType == ODM_BAND_2_4G) + { + FalseAlmCnt->Cnt_all = FalseAlmCnt->Cnt_Ofdm_fail + FalseAlmCnt->Cnt_Cck_fail; + FalseAlmCnt->Cnt_CCA_all = FalseAlmCnt->Cnt_CCK_CCA + FalseAlmCnt->Cnt_OFDM_CCA; + } + else + { + FalseAlmCnt->Cnt_all = FalseAlmCnt->Cnt_Ofdm_fail; + FalseAlmCnt->Cnt_CCA_all = FalseAlmCnt->Cnt_OFDM_CCA; + } + + } +#endif + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Cnt_OFDM_CCA=%d\n", FalseAlmCnt->Cnt_OFDM_CCA)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Cnt_CCK_CCA=%d\n", FalseAlmCnt->Cnt_CCK_CCA)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Cnt_CCA_all=%d\n", FalseAlmCnt->Cnt_CCA_all)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Cnt_Ofdm_fail=%d\n", FalseAlmCnt->Cnt_Ofdm_fail)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Cnt_Cck_fail=%d\n", FalseAlmCnt->Cnt_Cck_fail)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Cnt_Ofdm_fail=%d\n", FalseAlmCnt->Cnt_Ofdm_fail)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Total False Alarm=%d\n", FalseAlmCnt->Cnt_all)); +} + +//3============================================================ +//3 CCK Packet Detect Threshold +//3============================================================ + +VOID +odm_PauseCCKPacketDetection( + IN PVOID pDM_VOID, + IN ODM_Pause_CCKPD_TYPE PauseType, + IN u1Byte CCKPDThreshold +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable; + static BOOLEAN bPaused = FALSE; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_CCK_PD, ODM_DBG_LOUD, ("odm_PauseCCKPacketDetection()=========>\n")); + +#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) + if(*pDM_DigTable->pbP2pLinkInProgress) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_CCK_PD, ODM_DBG_LOUD, ("P2P in progress !!\n")); + return; + } +#endif + + if(!bPaused && (!(pDM_Odm->SupportAbility & ODM_BB_CCK_PD) || !(pDM_Odm->SupportAbility & ODM_BB_FA_CNT))) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_CCK_PD, ODM_DBG_LOUD, ("Return: SupportAbility ODM_BB_CCK_PD or ODM_BB_FA_CNT is disabled\n")); + return; + } + + switch(PauseType) + { + //1 Pause CCK Packet Detection Threshold + case ODM_PAUSE_CCKPD: + //2 Disable DIG + ODM_CmnInfoUpdate(pDM_Odm, ODM_CMNINFO_ABILITY, pDM_Odm->SupportAbility & (~ODM_BB_CCK_PD)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_CCK_PD, ODM_DBG_LOUD, ("Pause CCK packet detection threshold !!\n")); + + //2 Backup CCK Packet Detection Threshold value + if(!bPaused) + { + pDM_DigTable->CCKPDBackup = pDM_DigTable->CurCCK_CCAThres; + bPaused = TRUE; + } + ODM_RT_TRACE(pDM_Odm,ODM_COMP_CCK_PD, ODM_DBG_LOUD, ("Backup CCK packet detection tgreshold = %d\n", pDM_DigTable->CCKPDBackup)); + + //2 Write new CCK Packet Detection Threshold value + ODM_Write_CCK_CCA_Thres(pDM_Odm, CCKPDThreshold); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_CCK_PD, ODM_DBG_LOUD, ("Write new CCK packet detection tgreshold = %d\n", CCKPDThreshold)); + break; + + //1 Resume CCK Packet Detection Threshold + case ODM_RESUME_CCKPD: + if(bPaused) + { + //2 Write backup CCK Packet Detection Threshold value + ODM_Write_CCK_CCA_Thres(pDM_Odm, pDM_DigTable->CCKPDBackup); + bPaused = FALSE; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_CCK_PD, ODM_DBG_LOUD, ("Write original CCK packet detection tgreshold = %d\n", pDM_DigTable->CCKPDBackup)); + + //2 Enable CCK Packet Detection Threshold + ODM_CmnInfoUpdate(pDM_Odm, ODM_CMNINFO_ABILITY, pDM_Odm->SupportAbility | ODM_BB_CCK_PD); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_CCK_PD, ODM_DBG_LOUD, ("Resume CCK packet detection threshold !!\n")); + } + break; + + default: + ODM_RT_TRACE(pDM_Odm,ODM_COMP_CCK_PD, ODM_DBG_LOUD, ("Wrong type !!\n")); + break; + } + return; +} + + +VOID +odm_CCKPacketDetectionThresh( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PFALSE_ALARM_STATISTICS FalseAlmCnt = (PFALSE_ALARM_STATISTICS)PhyDM_Get_Structure( pDM_Odm, PHYDM_FALSEALMCNT); + u1Byte CurCCK_CCAThres; + + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) +//modify by Guo.Mingzhi 2011-12-29 + if (pDM_Odm->bDualMacSmartConcurrent == TRUE) +// if (pDM_Odm->bDualMacSmartConcurrent == FALSE) + return; + if(pDM_Odm->bBtHsOperation) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_CCK_PD, ODM_DBG_LOUD, ("odm_CCKPacketDetectionThresh() write 0xcd for BT HS mode!!\n")); + ODM_Write_CCK_CCA_Thres(pDM_Odm, 0xcd); + return; + } +#endif + + if((!(pDM_Odm->SupportAbility & ODM_BB_CCK_PD)) ||(!(pDM_Odm->SupportAbility & ODM_BB_FA_CNT))) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_CCK_PD, ODM_DBG_LOUD, ("odm_CCKPacketDetectionThresh() return==========\n")); + return; + } + +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) + if(pDM_Odm->ExtLNA) + return; +#endif + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_CCK_PD, ODM_DBG_LOUD, ("odm_CCKPacketDetectionThresh() ==========>\n")); + + if(pDM_Odm->bLinked) + { + if(pDM_Odm->RSSI_Min > 25) + CurCCK_CCAThres = 0xcd; + else if((pDM_Odm->RSSI_Min <= 25) && (pDM_Odm->RSSI_Min > 10)) + CurCCK_CCAThres = 0x83; + else + { + if(FalseAlmCnt->Cnt_Cck_fail > 1000) + CurCCK_CCAThres = 0x83; + else + CurCCK_CCAThres = 0x40; + } + } + else + { + if(FalseAlmCnt->Cnt_Cck_fail > 1000) + CurCCK_CCAThres = 0x83; + else + CurCCK_CCAThres = 0x40; + } + +#if (RTL8192D_SUPPORT==1) + if((pDM_Odm->SupportICType == ODM_RTL8192D) && (*pDM_Odm->pBandType == ODM_BAND_2_4G)) + ODM_Write_CCK_CCA_Thres_92D(pDM_Odm, CurCCK_CCAThres); + else +#endif + ODM_Write_CCK_CCA_Thres(pDM_Odm, CurCCK_CCAThres); + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_CCK_PD, ODM_DBG_LOUD, ("odm_CCKPacketDetectionThresh() CurCCK_CCAThres = 0x%x\n",CurCCK_CCAThres)); +} + +VOID +ODM_Write_CCK_CCA_Thres( + IN PVOID pDM_VOID, + IN u1Byte CurCCK_CCAThres + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable; + + if(pDM_DigTable->CurCCK_CCAThres!=CurCCK_CCAThres) //modify by Guo.Mingzhi 2012-01-03 + { + ODM_Write1Byte(pDM_Odm, ODM_REG(CCK_CCA,pDM_Odm), CurCCK_CCAThres); + } + pDM_DigTable->PreCCK_CCAThres = pDM_DigTable->CurCCK_CCAThres; + pDM_DigTable->CurCCK_CCAThres = CurCCK_CCAThres; +} + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + +// <20130108, Kordan> E.g., With LNA used, we make the Rx power smaller to have a better EVM. (Asked by Willis) +VOID +odm_RFEControl( + IN PDM_ODM_T pDM_Odm, + IN u8Byte RSSIVal + ) +{ + PADAPTER Adapter = (PADAPTER)pDM_Odm->Adapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + static u1Byte TRSW_HighPwr = 0; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("===> odm_RFEControl, RSSI = %d, TRSW_HighPwr = 0x%X, pHalData->RFEType = %d\n", + RSSIVal, TRSW_HighPwr, pHalData->RFEType )); + + if (pHalData->RFEType == 3) { + + pDM_Odm->RSSI_TRSW = RSSIVal; + + if (pDM_Odm->RSSI_TRSW >= pDM_Odm->RSSI_TRSW_H) + { + TRSW_HighPwr = 1; // Switch to + PHY_SetBBReg(Adapter, r_ANTSEL_SW_Jaguar, BIT1|BIT0, 0x1); // Set ANTSW=1/ANTSWB=0 for SW control + PHY_SetBBReg(Adapter, r_ANTSEL_SW_Jaguar, BIT9|BIT8, 0x3); // Set ANTSW=1/ANTSWB=0 for SW control + + } + else if (pDM_Odm->RSSI_TRSW <= pDM_Odm->RSSI_TRSW_L) + { + TRSW_HighPwr = 0; // Switched back + PHY_SetBBReg(Adapter, r_ANTSEL_SW_Jaguar, BIT1|BIT0, 0x1); // Set ANTSW=1/ANTSWB=0 for SW control + PHY_SetBBReg(Adapter, r_ANTSEL_SW_Jaguar, BIT9|BIT8, 0x0); // Set ANTSW=1/ANTSWB=0 for SW control + + } + } + + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("(pDM_Odm->RSSI_TRSW_H, pDM_Odm->RSSI_TRSW_L) = (%d, %d)\n", pDM_Odm->RSSI_TRSW_H, pDM_Odm->RSSI_TRSW_L)); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("(RSSIVal, RSSIVal, pDM_Odm->RSSI_TRSW_iso) = (%d, %d, %d)\n", + RSSIVal, pDM_Odm->RSSI_TRSW_iso, pDM_Odm->RSSI_TRSW)); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("<=== odm_RFEControl, RSSI = %d, TRSW_HighPwr = 0x%X\n", RSSIVal, TRSW_HighPwr)); +} + +VOID +odm_MPT_DIGWorkItemCallback( + IN PVOID pContext + ) +{ + PADAPTER Adapter = (PADAPTER)pContext; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; + + ODM_MPT_DIG(pDM_Odm); +} + +VOID +odm_MPT_DIGCallback( + PRT_TIMER pTimer +) +{ + PADAPTER Adapter = (PADAPTER)pTimer->Adapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; + + + #if DEV_BUS_TYPE==RT_PCI_INTERFACE + #if USE_WORKITEM + PlatformScheduleWorkItem(&pDM_Odm->MPT_DIGWorkitem); + #else + ODM_MPT_DIG(pDM_Odm); + #endif + #else + PlatformScheduleWorkItem(&pDM_Odm->MPT_DIGWorkitem); + #endif + +} + +#endif + +#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) +VOID +odm_MPT_DIGCallback( + IN PVOID pDM_VOID +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; +#if USE_WORKITEM + PlatformScheduleWorkItem(&pDM_Odm->MPT_DIGWorkitem); +#else + ODM_MPT_DIG(pDM_Odm); +#endif +} +#endif + +#if (DM_ODM_SUPPORT_TYPE != ODM_CE) +VOID +odm_MPT_Write_DIG( + IN PVOID pDM_VOID, + IN u1Byte CurIGValue +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable; + + ODM_Write1Byte( pDM_Odm, ODM_REG(IGI_A,pDM_Odm), CurIGValue); + + if(pDM_Odm->RFType > ODM_1T1R) + ODM_Write1Byte( pDM_Odm, ODM_REG(IGI_B,pDM_Odm), CurIGValue); + + if((pDM_Odm->SupportICType & ODM_IC_11AC_SERIES) && (pDM_Odm->RFType > ODM_2T2R)) + { + ODM_Write1Byte( pDM_Odm, ODM_REG(IGI_C,pDM_Odm), CurIGValue); + ODM_Write1Byte( pDM_Odm, ODM_REG(IGI_D,pDM_Odm), CurIGValue); + } + + pDM_DigTable->CurIGValue = CurIGValue; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("CurIGValue = 0x%x\n", CurIGValue)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("pDM_Odm->RFType = 0x%x\n", pDM_Odm->RFType)); +} + +VOID +ODM_MPT_DIG( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable; + PFALSE_ALARM_STATISTICS pFalseAlmCnt = (PFALSE_ALARM_STATISTICS)PhyDM_Get_Structure( pDM_Odm, PHYDM_FALSEALMCNT); + u1Byte CurrentIGI = pDM_DigTable->CurIGValue; + u1Byte DIG_Upper = 0x40, DIG_Lower = 0x20; + u4Byte RXOK_cal; + u4Byte RxPWDBAve_final; + u1Byte IGI_A = 0x20, IGI_B = 0x20; + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + + #if ODM_FIX_2G_DIG + IGI_A = 0x22; + IGI_B = 0x24; + #endif + +#else + if (!(pDM_Odm->priv->pshare->rf_ft_var.mp_specific && pDM_Odm->priv->pshare->mp_dig_on)) + return; + + if (*pDM_Odm->pBandType == ODM_BAND_5G) + DIG_Lower = 0x22; +#endif + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("===> ODM_MPT_DIG, pBandType = %d\n", *pDM_Odm->pBandType)); + +#if (ODM_FIX_2G_DIG || (DM_ODM_SUPPORT_TYPE & ODM_AP)) + if (*pDM_Odm->pBandType == ODM_BAND_5G || (pDM_Odm->SupportICType & (ODM_RTL8814A|ODM_RTL8822B))) // for 5G or 8814 +#else + if (1) // for both 2G/5G +#endif + { + odm_FalseAlarmCounterStatistics(pDM_Odm); + + RXOK_cal = pDM_Odm->PhyDbgInfo.NumQryPhyStatusCCK + pDM_Odm->PhyDbgInfo.NumQryPhyStatusOFDM; + RxPWDBAve_final = (RXOK_cal != 0)?pDM_Odm->RxPWDBAve/RXOK_cal:0; + + pDM_Odm->PhyDbgInfo.NumQryPhyStatusCCK = 0; + pDM_Odm->PhyDbgInfo.NumQryPhyStatusOFDM = 0; + pDM_Odm->RxPWDBAve = 0; + pDM_Odm->MPDIG_2G = FALSE; + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + pDM_Odm->Times_2G = 0; +#endif + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("RX OK = %d\n", RXOK_cal)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("RSSI = %d\n", RxPWDBAve_final)); + + if (RXOK_cal >= 70 && RxPWDBAve_final <= 40) + { + if (CurrentIGI > 0x24) + odm_MPT_Write_DIG(pDM_Odm, 0x24); + } + else + { + if(pFalseAlmCnt->Cnt_all > 1000){ + CurrentIGI = CurrentIGI + 8; + } + else if(pFalseAlmCnt->Cnt_all > 200){ + CurrentIGI = CurrentIGI + 4; + } + else if (pFalseAlmCnt->Cnt_all > 50){ + CurrentIGI = CurrentIGI + 2; + } + else if (pFalseAlmCnt->Cnt_all < 2){ + CurrentIGI = CurrentIGI - 2; + } + + if (CurrentIGI < DIG_Lower ){ + CurrentIGI = DIG_Lower; + } + + if(CurrentIGI > DIG_Upper){ + CurrentIGI = DIG_Upper; + } + + odm_MPT_Write_DIG(pDM_Odm, CurrentIGI); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("DIG = 0x%x, Cnt_all = %d, Cnt_Ofdm_fail = %d, Cnt_Cck_fail = %d\n", + CurrentIGI, pFalseAlmCnt->Cnt_all, pFalseAlmCnt->Cnt_Ofdm_fail, pFalseAlmCnt->Cnt_Cck_fail)); + } + } + else + { + if(pDM_Odm->MPDIG_2G == FALSE) + { + if((pDM_Odm->SupportPlatform & ODM_WIN) && !(pDM_Odm->SupportICType & (ODM_RTL8814A|ODM_RTL8822B))) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("===> Fix IGI\n")); + ODM_Write1Byte( pDM_Odm, ODM_REG(IGI_A,pDM_Odm), IGI_A); + ODM_Write1Byte( pDM_Odm, ODM_REG(IGI_B,pDM_Odm), IGI_B); + pDM_DigTable->CurIGValue = IGI_B; + } + else + odm_MPT_Write_DIG(pDM_Odm, IGI_A); + } + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + pDM_Odm->Times_2G++; + + if (pDM_Odm->Times_2G == 3) +#endif + { + pDM_Odm->MPDIG_2G = TRUE; + } + } + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + if (pDM_Odm->SupportICType == ODM_RTL8812) + odm_RFEControl(pDM_Odm, RxPWDBAve_final); +#endif + + ODM_SetTimer(pDM_Odm, &pDM_Odm->MPT_DIGTimer, 700); +} +#endif diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_DIG.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_DIG.h new file mode 100644 index 00000000000000..6b309fe3743be7 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_DIG.h @@ -0,0 +1,309 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +#ifndef __PHYDMDIG_H__ +#define __PHYDMDIG_H__ + +#define DIG_VERSION "1.3" + +typedef struct _Dynamic_Initial_Gain_Threshold_ +{ + BOOLEAN bStopDIG; // for debug + BOOLEAN bPauseDIG; + BOOLEAN bIgnoreDIG; + BOOLEAN bPSDInProgress; + + u1Byte Dig_Enable_Flag; + u1Byte Dig_Ext_Port_Stage; + + int RssiLowThresh; + int RssiHighThresh; + + u4Byte FALowThresh; + u4Byte FAHighThresh; + + u1Byte CurSTAConnectState; + u1Byte PreSTAConnectState; + u1Byte CurMultiSTAConnectState; + + u1Byte PreIGValue; + u1Byte CurIGValue; + u1Byte BackupIGValue; //MP DIG + u1Byte BT30_CurIGI; + u1Byte IGIBackup; + + s1Byte BackoffVal; + s1Byte BackoffVal_range_max; + s1Byte BackoffVal_range_min; + u1Byte rx_gain_range_max; + u1Byte rx_gain_range_min; + u1Byte Rssi_val_min; + + u1Byte PreCCK_CCAThres; + u1Byte CurCCK_CCAThres; + u1Byte PreCCKPDState; + u1Byte CurCCKPDState; + u1Byte CCKPDBackup; + + u1Byte LargeFAHit; + u1Byte ForbiddenIGI; + u4Byte Recover_cnt; + + u1Byte DIG_Dynamic_MIN_0; + u1Byte DIG_Dynamic_MIN_1; + BOOLEAN bMediaConnect_0; + BOOLEAN bMediaConnect_1; + + u4Byte AntDiv_RSSI_max; + u4Byte RSSI_max; + + u1Byte *pbP2pLinkInProgress; + +#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) + BOOLEAN bTpTarget; + BOOLEAN bNoiseEst; + u4Byte TpTrainTH_min; + u1Byte IGIOffset_A; + u1Byte IGIOffset_B; +#endif +}DIG_T,*pDIG_T; + +typedef struct _FALSE_ALARM_STATISTICS{ + u4Byte Cnt_Parity_Fail; + u4Byte Cnt_Rate_Illegal; + u4Byte Cnt_Crc8_fail; + u4Byte Cnt_Mcs_fail; + u4Byte Cnt_Ofdm_fail; + u4Byte Cnt_Ofdm_fail_pre; //For RTL8881A + u4Byte Cnt_Cck_fail; + u4Byte Cnt_all; + u4Byte Cnt_Fast_Fsync; + u4Byte Cnt_SB_Search_fail; + u4Byte Cnt_OFDM_CCA; + u4Byte Cnt_CCK_CCA; + u4Byte Cnt_CCA_all; + u4Byte Cnt_BW_USC; //Gary + u4Byte Cnt_BW_LSC; //Gary +}FALSE_ALARM_STATISTICS, *PFALSE_ALARM_STATISTICS; + +typedef enum tag_Dynamic_Init_Gain_Operation_Type_Definition +{ + DIG_TYPE_THRESH_HIGH = 0, + DIG_TYPE_THRESH_LOW = 1, + DIG_TYPE_BACKOFF = 2, + DIG_TYPE_RX_GAIN_MIN = 3, + DIG_TYPE_RX_GAIN_MAX = 4, + DIG_TYPE_ENABLE = 5, + DIG_TYPE_DISABLE = 6, + DIG_OP_TYPE_MAX +}DM_DIG_OP_E; + +typedef enum tag_ODM_PauseDIG_Type { + ODM_PAUSE_DIG = BIT0, + ODM_RESUME_DIG = BIT1 +} ODM_Pause_DIG_TYPE; + +typedef enum tag_ODM_PauseCCKPD_Type { + ODM_PAUSE_CCKPD = BIT0, + ODM_RESUME_CCKPD = BIT1 +} ODM_Pause_CCKPD_TYPE; + +/* +typedef enum tag_CCK_Packet_Detection_Threshold_Type_Definition +{ + CCK_PD_STAGE_LowRssi = 0, + CCK_PD_STAGE_HighRssi = 1, + CCK_PD_STAGE_MAX = 3, +}DM_CCK_PDTH_E; + +typedef enum tag_DIG_EXT_PORT_ALGO_Definition +{ + DIG_EXT_PORT_STAGE_0 = 0, + DIG_EXT_PORT_STAGE_1 = 1, + DIG_EXT_PORT_STAGE_2 = 2, + DIG_EXT_PORT_STAGE_3 = 3, + DIG_EXT_PORT_STAGE_MAX = 4, +}DM_DIG_EXT_PORT_ALG_E; + +typedef enum tag_DIG_Connect_Definition +{ + DIG_STA_DISCONNECT = 0, + DIG_STA_CONNECT = 1, + DIG_STA_BEFORE_CONNECT = 2, + DIG_MultiSTA_DISCONNECT = 3, + DIG_MultiSTA_CONNECT = 4, + DIG_CONNECT_MAX +}DM_DIG_CONNECT_E; + + +#define DM_MultiSTA_InitGainChangeNotify(Event) {DM_DigTable.CurMultiSTAConnectState = Event;} + +#define DM_MultiSTA_InitGainChangeNotify_CONNECT(_ADAPTER) \ + DM_MultiSTA_InitGainChangeNotify(DIG_MultiSTA_CONNECT) + +#define DM_MultiSTA_InitGainChangeNotify_DISCONNECT(_ADAPTER) \ + DM_MultiSTA_InitGainChangeNotify(DIG_MultiSTA_DISCONNECT) +*/ +#define DM_DIG_THRESH_HIGH 40 +#define DM_DIG_THRESH_LOW 35 + +#define DM_FALSEALARM_THRESH_LOW 400 +#define DM_FALSEALARM_THRESH_HIGH 1000 + +#define DM_DIG_MAX_NIC 0x3e +#define DM_DIG_MIN_NIC 0x1e //0x22//0x1c +#define DM_DIG_MAX_OF_MIN_NIC 0x3e + +#define DM_DIG_MAX_AP 0x3e +#define DM_DIG_MIN_AP 0x1c +#define DM_DIG_MAX_OF_MIN 0x2A //0x32 +#define DM_DIG_MIN_AP_DFS 0x20 + +#define DM_DIG_MAX_NIC_HP 0x46 +#define DM_DIG_MIN_NIC_HP 0x2e + +#define DM_DIG_MAX_AP_HP 0x42 +#define DM_DIG_MIN_AP_HP 0x30 + +#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) +#define DM_DIG_MAX_AP_COVERAGR 0x26 +#define DM_DIG_MIN_AP_COVERAGE 0x1c +#define DM_DIG_MAX_OF_MIN_COVERAGE 0x22 + +#define DM_DIG_TP_Target_TH0 500 +#define DM_DIG_TP_Target_TH1 1000 +#define DM_DIG_TP_Training_Period 10 +#endif + +//vivi 92c&92d has different definition, 20110504 +//this is for 92c +#if (DM_ODM_SUPPORT_TYPE & ODM_CE) + #ifdef CONFIG_SPECIAL_SETTING_FOR_FUNAI_TV + #define DM_DIG_FA_TH0 0x80//0x20 + #else + #define DM_DIG_FA_TH0 0x200//0x20 + #endif +#else + #define DM_DIG_FA_TH0 0x200//0x20 +#endif + +#define DM_DIG_FA_TH1 0x300 +#define DM_DIG_FA_TH2 0x400 +//this is for 92d +#define DM_DIG_FA_TH0_92D 0x100 +#define DM_DIG_FA_TH1_92D 0x400 +#define DM_DIG_FA_TH2_92D 0x600 + +#define DM_DIG_BACKOFF_MAX 12 +#define DM_DIG_BACKOFF_MIN -4 +#define DM_DIG_BACKOFF_DEFAULT 10 + +#define DM_DIG_FA_TH0_LPS 4 //-> 4 in lps +#define DM_DIG_FA_TH1_LPS 15 //-> 15 lps +#define DM_DIG_FA_TH2_LPS 30 //-> 30 lps +#define RSSI_OFFSET_DIG 0x05 + +VOID +ODM_ChangeDynamicInitGainThresh( + IN PVOID pDM_VOID, + IN u4Byte DM_Type, + IN u4Byte DM_Value + ); + +VOID +ODM_Write_DIG( + IN PVOID pDM_VOID, + IN u1Byte CurrentIGI + ); + +VOID +odm_PauseDIG( + IN PVOID pDM_VOID, + IN ODM_Pause_DIG_TYPE PauseType, + IN u1Byte IGIValue + ); + +VOID +odm_DIGInit( + IN PVOID pDM_VOID + ); + +VOID +odm_DIG( + IN PVOID pDM_VOID + ); + +VOID +odm_DIGbyRSSI_LPS( + IN PVOID pDM_VOID + ); + +VOID +odm_FalseAlarmCounterStatistics( + IN PVOID pDM_VOID + ); + +VOID +odm_PauseCCKPacketDetection( + IN PVOID pDM_VOID, + IN ODM_Pause_CCKPD_TYPE PauseType, + IN u1Byte CCKPDThreshold + ); + +VOID +odm_CCKPacketDetectionThresh( + IN PVOID pDM_VOID + ); + +VOID +ODM_Write_CCK_CCA_Thres( + IN PVOID pDM_VOID, + IN u1Byte CurCCK_CCAThres + ); + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) +VOID +odm_MPT_DIGCallback( + PRT_TIMER pTimer +); + +VOID +odm_MPT_DIGWorkItemCallback( + IN PVOID pContext + ); + +#endif + +#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) +VOID +odm_MPT_DIGCallback( + IN PVOID pDM_VOID +); +#endif + +#if (DM_ODM_SUPPORT_TYPE != ODM_CE) +VOID +ODM_MPT_DIG( + IN PVOID pDM_VOID +); +#endif + + +#endif diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_DynamicBBPowerSaving.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_DynamicBBPowerSaving.c new file mode 100644 index 00000000000000..a9099ade38a337 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_DynamicBBPowerSaving.c @@ -0,0 +1,218 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +//============================================================ +// include files +//============================================================ +#include "Mp_Precomp.h" +#include "phydm_precomp.h" + +VOID +odm_DynamicBBPowerSavingInit( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pPS_T pDM_PSTable = &pDM_Odm->DM_PSTable; + + pDM_PSTable->PreCCAState = CCA_MAX; + pDM_PSTable->CurCCAState = CCA_MAX; + pDM_PSTable->PreRFState = RF_MAX; + pDM_PSTable->CurRFState = RF_MAX; + pDM_PSTable->Rssi_val_min = 0; + pDM_PSTable->initialize = 0; +} + + +VOID +odm_DynamicBBPowerSaving( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) + + if (pDM_Odm->SupportICType != ODM_RTL8723A) + return; + if(!(pDM_Odm->SupportAbility & ODM_BB_PWR_SAVE)) + return; + if(!(pDM_Odm->SupportPlatform & (ODM_WIN|ODM_CE))) + return; + + //1 2.Power Saving for 92C + if((pDM_Odm->SupportICType == ODM_RTL8192C) &&(pDM_Odm->RFType == ODM_2T2R)) + { + odm_1R_CCA(pDM_Odm); + } + + // 20100628 Joseph: Turn off BB power save for 88CE because it makesthroughput unstable. + // 20100831 Joseph: Turn ON BB power save again after modifying AGC delay from 900ns ot 600ns. + //1 3.Power Saving for 88C + else + { + ODM_RF_Saving(pDM_Odm, FALSE); + } +#endif // #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + +} + +VOID +odm_1R_CCA( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pPS_T pDM_PSTable = &pDM_Odm->DM_PSTable; + + if(pDM_Odm->RSSI_Min!= 0xFF) + { + + if(pDM_PSTable->PreCCAState == CCA_2R) + { + if(pDM_Odm->RSSI_Min >= 35) + pDM_PSTable->CurCCAState = CCA_1R; + else + pDM_PSTable->CurCCAState = CCA_2R; + + } + else{ + if(pDM_Odm->RSSI_Min <= 30) + pDM_PSTable->CurCCAState = CCA_2R; + else + pDM_PSTable->CurCCAState = CCA_1R; + } + } + else{ + pDM_PSTable->CurCCAState=CCA_MAX; + } + + if(pDM_PSTable->PreCCAState != pDM_PSTable->CurCCAState) + { + if(pDM_PSTable->CurCCAState == CCA_1R) + { + if( pDM_Odm->RFType ==ODM_2T2R ) + { + ODM_SetBBReg(pDM_Odm, 0xc04 , bMaskByte0, 0x13); + //PHY_SetBBReg(pAdapter, 0xe70, bMaskByte3, 0x20); + } + else + { + ODM_SetBBReg(pDM_Odm, 0xc04 , bMaskByte0, 0x23); + //PHY_SetBBReg(pAdapter, 0xe70, 0x7fc00000, 0x10c); // Set RegE70[30:22] = 9b'100001100 + } + } + else + { + ODM_SetBBReg(pDM_Odm, 0xc04 , bMaskByte0, 0x33); + //PHY_SetBBReg(pAdapter,0xe70, bMaskByte3, 0x63); + } + pDM_PSTable->PreCCAState = pDM_PSTable->CurCCAState; + } +} + +void +ODM_RF_Saving( + IN PVOID pDM_VOID, + IN u1Byte bForceInNormal + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; +#if (DM_ODM_SUPPORT_TYPE != ODM_AP) + pPS_T pDM_PSTable = &pDM_Odm->DM_PSTable; + u1Byte Rssi_Up_bound = 30 ; + u1Byte Rssi_Low_bound = 25; +#if (DM_ODM_SUPPORT_TYPE == ODM_CE) + if(pDM_Odm->PatchID == 40 ) //RT_CID_819x_FUNAI_TV + { + Rssi_Up_bound = 50 ; + Rssi_Low_bound = 45; + } +#endif + if(pDM_PSTable->initialize == 0){ + + pDM_PSTable->Reg874 = (ODM_GetBBReg(pDM_Odm, 0x874, bMaskDWord)&0x1CC000)>>14; + pDM_PSTable->RegC70 = (ODM_GetBBReg(pDM_Odm, 0xc70, bMaskDWord)&BIT3)>>3; + pDM_PSTable->Reg85C = (ODM_GetBBReg(pDM_Odm, 0x85c, bMaskDWord)&0xFF000000)>>24; + pDM_PSTable->RegA74 = (ODM_GetBBReg(pDM_Odm, 0xa74, bMaskDWord)&0xF000)>>12; + //Reg818 = PHY_QueryBBReg(pAdapter, 0x818, bMaskDWord); + pDM_PSTable->initialize = 1; + } + + if(!bForceInNormal) + { + if(pDM_Odm->RSSI_Min != 0xFF) + { + if(pDM_PSTable->PreRFState == RF_Normal) + { + if(pDM_Odm->RSSI_Min >= Rssi_Up_bound) + pDM_PSTable->CurRFState = RF_Save; + else + pDM_PSTable->CurRFState = RF_Normal; + } + else{ + if(pDM_Odm->RSSI_Min <= Rssi_Low_bound) + pDM_PSTable->CurRFState = RF_Normal; + else + pDM_PSTable->CurRFState = RF_Save; + } + } + else + pDM_PSTable->CurRFState=RF_MAX; + } + else + { + pDM_PSTable->CurRFState = RF_Normal; + } + + if(pDM_PSTable->PreRFState != pDM_PSTable->CurRFState) + { + if(pDM_PSTable->CurRFState == RF_Save) + { + // 8723 RSSI report will be wrong. Set 0x874[5]=1 when enter BB power saving mode. + // Suggested by SD3 Yu-Nan. 2011.01.20. + if(pDM_Odm->SupportICType == ODM_RTL8723A) + { + ODM_SetBBReg(pDM_Odm, 0x874 , BIT5, 0x1); //Reg874[5]=1b'1 + } + ODM_SetBBReg(pDM_Odm, 0x874 , 0x1C0000, 0x2); //Reg874[20:18]=3'b010 + ODM_SetBBReg(pDM_Odm, 0xc70, BIT3, 0); //RegC70[3]=1'b0 + ODM_SetBBReg(pDM_Odm, 0x85c, 0xFF000000, 0x63); //Reg85C[31:24]=0x63 + ODM_SetBBReg(pDM_Odm, 0x874, 0xC000, 0x2); //Reg874[15:14]=2'b10 + ODM_SetBBReg(pDM_Odm, 0xa74, 0xF000, 0x3); //RegA75[7:4]=0x3 + ODM_SetBBReg(pDM_Odm, 0x818, BIT28, 0x0); //Reg818[28]=1'b0 + ODM_SetBBReg(pDM_Odm, 0x818, BIT28, 0x1); //Reg818[28]=1'b1 + } + else + { + ODM_SetBBReg(pDM_Odm, 0x874 , 0x1CC000, pDM_PSTable->Reg874); + ODM_SetBBReg(pDM_Odm, 0xc70, BIT3, pDM_PSTable->RegC70); + ODM_SetBBReg(pDM_Odm, 0x85c, 0xFF000000, pDM_PSTable->Reg85C); + ODM_SetBBReg(pDM_Odm, 0xa74, 0xF000, pDM_PSTable->RegA74); + ODM_SetBBReg(pDM_Odm,0x818, BIT28, 0x0); + + if(pDM_Odm->SupportICType == ODM_RTL8723A) + { + ODM_SetBBReg(pDM_Odm,0x874 , BIT5, 0x0); //Reg874[5]=1b'0 + } + } + pDM_PSTable->PreRFState =pDM_PSTable->CurRFState; + } +#endif +} \ No newline at end of file diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_DynamicBBPowerSaving.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_DynamicBBPowerSaving.h new file mode 100644 index 00000000000000..ef045098afbf58 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_DynamicBBPowerSaving.h @@ -0,0 +1,63 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +#ifndef __PHYDMDYNAMICBBPOWERSAVING_H__ +#define __PHYDMDYNAMICBBPOWERSAVING_H__ + +#define DYNAMIC_BBPWRSAV_VERSION "1.0" + +typedef struct _Dynamic_Power_Saving_ +{ + u1Byte PreCCAState; + u1Byte CurCCAState; + + u1Byte PreRFState; + u1Byte CurRFState; + + int Rssi_val_min; + + u1Byte initialize; + u4Byte Reg874,RegC70,Reg85C,RegA74; + +}PS_T,*pPS_T; + +#define dm_RF_Saving ODM_RF_Saving + +void ODM_RF_Saving( + IN PVOID pDM_VOID, + IN u1Byte bForceInNormal + ); + +VOID +odm_DynamicBBPowerSavingInit( + IN PVOID pDM_VOID + ); + +VOID +odm_DynamicBBPowerSaving( + IN PVOID pDM_VOID + ); + +VOID +odm_1R_CCA( + IN PVOID pDM_VOID + ); + +#endif \ No newline at end of file diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_DynamicTxPower.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_DynamicTxPower.c new file mode 100644 index 00000000000000..6ade46530eed23 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_DynamicTxPower.c @@ -0,0 +1,882 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +//============================================================ +// include files +//============================================================ +#include "Mp_Precomp.h" +#include "phydm_precomp.h" + +VOID +odm_DynamicTxPowerInit( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + PADAPTER Adapter = pDM_Odm->Adapter; + PMGNT_INFO pMgntInfo = &Adapter->MgntInfo; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + + #if DEV_BUS_TYPE==RT_USB_INTERFACE + if(RT_GetInterfaceSelection(Adapter) == INTF_SEL1_USB_High_Power) + { + odm_DynamicTxPowerSavePowerIndex(pDM_Odm); + pMgntInfo->bDynamicTxPowerEnable = TRUE; + } + else + #else + //so 92c pci do not need dynamic tx power? vivi check it later + if(IS_HARDWARE_TYPE_8192D(Adapter)) + pMgntInfo->bDynamicTxPowerEnable = TRUE; + else + pMgntInfo->bDynamicTxPowerEnable = FALSE; + #endif + + + pHalData->LastDTPLvl = TxHighPwrLevel_Normal; + pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_Normal; +#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) + PADAPTER Adapter = pDM_Odm->Adapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + struct dm_priv *pdmpriv = &pHalData->dmpriv; + pdmpriv->bDynamicTxPowerEnable = _FALSE; + + #if (RTL8192C_SUPPORT==1) + #ifdef CONFIG_USB_HCI + + #ifdef CONFIG_INTEL_PROXIM + if((pHalData->BoardType == BOARD_USB_High_PA)||(Adapter->proximity.proxim_support==_TRUE)) + #else + if(pHalData->BoardType == BOARD_USB_High_PA) + #endif + + { + //odm_SavePowerIndex(Adapter); + odm_DynamicTxPowerSavePowerIndex(pDM_Odm); + pdmpriv->bDynamicTxPowerEnable = _TRUE; + } + else + #else + pdmpriv->bDynamicTxPowerEnable = _FALSE; + #endif + #endif + + pdmpriv->LastDTPLvl = TxHighPwrLevel_Normal; + pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_Normal; + +#endif + +} + +VOID +odm_DynamicTxPowerSavePowerIndex( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; +#if (DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_WIN)) + u1Byte index; + u4Byte Power_Index_REG[6] = {0xc90, 0xc91, 0xc92, 0xc98, 0xc99, 0xc9a}; + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + PADAPTER Adapter = pDM_Odm->Adapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + for(index = 0; index< 6; index++) + pHalData->PowerIndex_backup[index] = PlatformEFIORead1Byte(Adapter, Power_Index_REG[index]); +#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) + PADAPTER Adapter = pDM_Odm->Adapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + struct dm_priv *pdmpriv = &pHalData->dmpriv; + for(index = 0; index< 6; index++) + pdmpriv->PowerIndex_backup[index] = rtw_read8(Adapter, Power_Index_REG[index]); +#endif +#endif +} + +VOID +odm_DynamicTxPowerRestorePowerIndex( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; +#if (DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_WIN)) + u1Byte index; + PADAPTER Adapter = pDM_Odm->Adapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + u4Byte Power_Index_REG[6] = {0xc90, 0xc91, 0xc92, 0xc98, 0xc99, 0xc9a}; +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + for(index = 0; index< 6; index++) + PlatformEFIOWrite1Byte(Adapter, Power_Index_REG[index], pHalData->PowerIndex_backup[index]); +#elif(DM_ODM_SUPPORT_TYPE == ODM_CE) + struct dm_priv *pdmpriv = &pHalData->dmpriv; + for(index = 0; index< 6; index++) + rtw_write8(Adapter, Power_Index_REG[index], pdmpriv->PowerIndex_backup[index]); +#endif +#endif +} + +VOID +odm_DynamicTxPowerWritePowerIndex( + IN PVOID pDM_VOID, + IN u1Byte Value) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + u1Byte index; + u4Byte Power_Index_REG[6] = {0xc90, 0xc91, 0xc92, 0xc98, 0xc99, 0xc9a}; + + for(index = 0; index< 6; index++) + //PlatformEFIOWrite1Byte(Adapter, Power_Index_REG[index], Value); + ODM_Write1Byte(pDM_Odm, Power_Index_REG[index], Value); + +} + + +VOID +odm_DynamicTxPower( + IN PVOID pDM_VOID + ) +{ + // + // For AP/ADSL use prtl8192cd_priv + // For CE/NIC use PADAPTER + // + //PADAPTER pAdapter = pDM_Odm->Adapter; +// prtl8192cd_priv priv = pDM_Odm->priv; + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + if (!(pDM_Odm->SupportAbility & ODM_BB_DYNAMIC_TXPWR)) + return; + // + // 2011/09/29 MH In HW integration first stage, we provide 4 different handle to operate + // at the same time. In the stage2/3, we need to prive universal interface and merge all + // HW dynamic mechanism. + // + switch (pDM_Odm->SupportPlatform) + { + case ODM_WIN: + case ODM_CE: + odm_DynamicTxPowerNIC(pDM_Odm); + break; + case ODM_AP: + odm_DynamicTxPowerAP(pDM_Odm); + break; + + case ODM_ADSL: + //odm_DIGAP(pDM_Odm); + break; + } + + +} + + +VOID +odm_DynamicTxPowerNIC( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + + if (!(pDM_Odm->SupportAbility & ODM_BB_DYNAMIC_TXPWR)) + return; + +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) + + if(pDM_Odm->SupportICType == ODM_RTL8192C) + { + odm_DynamicTxPower_92C(pDM_Odm); + } + else if(pDM_Odm->SupportICType == ODM_RTL8192D) + { + odm_DynamicTxPower_92D(pDM_Odm); + } + else if (pDM_Odm->SupportICType == ODM_RTL8821) + { +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN)) + PADAPTER Adapter = pDM_Odm->Adapter; + PMGNT_INFO pMgntInfo = GetDefaultMgntInfo(Adapter); + + if (pMgntInfo->RegRspPwr == 1) + { + if(pDM_Odm->RSSI_Min > 60) + { + ODM_SetMACReg(pDM_Odm, ODM_REG_RESP_TX_11AC, BIT20|BIT19|BIT18, 1); // Resp TXAGC offset = -3dB + + } + else if(pDM_Odm->RSSI_Min < 55) + { + ODM_SetMACReg(pDM_Odm, ODM_REG_RESP_TX_11AC, BIT20|BIT19|BIT18, 0); // Resp TXAGC offset = 0dB + } + } +#endif + } +#endif +} + +VOID +odm_DynamicTxPowerAP( + IN PVOID pDM_VOID + + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; +#if (DM_ODM_SUPPORT_TYPE == ODM_AP) + +//#if ((RTL8192C_SUPPORT==1) || (RTL8192D_SUPPORT==1) || (RTL8188E_SUPPORT==1) || (RTL8812E_SUPPORT==1)) + + + prtl8192cd_priv priv = pDM_Odm->priv; + s4Byte i; + s2Byte pwr_thd = TX_POWER_NEAR_FIELD_THRESH_AP; + + if(!priv->pshare->rf_ft_var.tx_pwr_ctrl) + return; + +#if ((RTL8812E_SUPPORT==1) || (RTL8881A_SUPPORT==1) || (RTL8814A_SUPPORT==1)) + if (pDM_Odm->SupportICType & (ODM_RTL8812 | ODM_RTL8881A | ODM_RTL8814A)) + pwr_thd = TX_POWER_NEAR_FIELD_THRESH_8812; +#endif + +#if defined(CONFIG_RTL_92D_SUPPORT) || defined(CONFIG_RTL_92C_SUPPORT) + if(CHIP_VER_92X_SERIES(priv)) + { +#ifdef HIGH_POWER_EXT_PA + if(pDM_Odm->ExtPA) + tx_power_control(priv); +#endif + } +#endif + /* + * Check if station is near by to use lower tx power + */ + + if ((priv->up_time % 3) == 0 ) { + int disable_pwr_ctrl = ((pDM_Odm->FalseAlmCnt.Cnt_all > 1000 ) || ((pDM_Odm->FalseAlmCnt.Cnt_all > 300 ) && ((RTL_R8(0xc50) & 0x7f) >= 0x32))) ? 1 : 0; + + for(i=0; ipODM_StaInfo[i]; + if(IS_STA_VALID(pstat) ) { + if(disable_pwr_ctrl) + pstat->hp_level = 0; + else if ((pstat->hp_level == 0) && (pstat->rssi > pwr_thd)) + pstat->hp_level = 1; + else if ((pstat->hp_level == 1) && (pstat->rssi < (pwr_thd-8))) + pstat->hp_level = 0; + } + } + +#if defined(CONFIG_WLAN_HAL_8192EE) + if (GET_CHIP_VER(priv) == VERSION_8192E) { + if( !disable_pwr_ctrl && (pDM_Odm->RSSI_Min != 0xff) ) { + if(pDM_Odm->RSSI_Min > pwr_thd) + RRSR_power_control_11n(priv, 1 ); + else if(pDM_Odm->RSSI_Min < (pwr_thd-8)) + RRSR_power_control_11n(priv, 0 ); + } else { + RRSR_power_control_11n(priv, 0 ); + } + } +#endif + } +//#endif + +#endif +} + + +VOID +odm_DynamicTxPower_92C( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + PADAPTER Adapter = pDM_Odm->Adapter; + PMGNT_INFO pMgntInfo = &Adapter->MgntInfo; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + s4Byte UndecoratedSmoothedPWDB; + + // 2012/01/12 MH According to Luke's suggestion, only high power will support the feature. + if (pDM_Odm->ExtPA == FALSE) + return; + + // STA not connected and AP not connected + if((!pMgntInfo->bMediaConnect) && + (pHalData->EntryMinUndecoratedSmoothedPWDB == 0)) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_TXPWR, DBG_LOUD, ("Not connected to any \n")); + pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_Normal; + + //the LastDTPlvl should reset when disconnect, + //otherwise the tx power level wouldn't change when disconnect and connect again. + // Maddest 20091220. + pHalData->LastDTPLvl=TxHighPwrLevel_Normal; + return; + } + +#if (INTEL_PROXIMITY_SUPPORT == 1) + // Intel set fixed tx power + if(pMgntInfo->IntelProximityModeInfo.PowerOutput > 0) + { + switch(pMgntInfo->IntelProximityModeInfo.PowerOutput){ + case 1: + pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_100; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_TXPWR, DBG_LOUD, ("TxHighPwrLevel_100\n")); + break; + case 2: + pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_70; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_TXPWR, DBG_LOUD, ("TxHighPwrLevel_70\n")); + break; + case 3: + pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_50; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_TXPWR, DBG_LOUD, ("TxHighPwrLevel_50\n")); + break; + case 4: + pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_35; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_TXPWR, DBG_LOUD, ("TxHighPwrLevel_35\n")); + break; + case 5: + pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_15; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_TXPWR, DBG_LOUD, ("TxHighPwrLevel_15\n")); + break; + default: + pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_100; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_TXPWR, DBG_LOUD, ("TxHighPwrLevel_100\n")); + break; + } + } + else +#endif + { + if( (pMgntInfo->bDynamicTxPowerEnable != TRUE) || + pMgntInfo->IOTAction & HT_IOT_ACT_DISABLE_HIGH_POWER) + { + pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_Normal; + } + else + { + if(pMgntInfo->bMediaConnect) // Default port + { + if(ACTING_AS_AP(Adapter) || ACTING_AS_IBSS(Adapter)) + { + UndecoratedSmoothedPWDB = pHalData->EntryMinUndecoratedSmoothedPWDB; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_TXPWR, DBG_LOUD, ("AP Client PWDB = 0x%x \n", UndecoratedSmoothedPWDB)); + } + else + { + UndecoratedSmoothedPWDB = pHalData->UndecoratedSmoothedPWDB; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_TXPWR, DBG_LOUD, ("STA Default Port PWDB = 0x%x \n", UndecoratedSmoothedPWDB)); + } + } + else // associated entry pwdb + { + UndecoratedSmoothedPWDB = pHalData->EntryMinUndecoratedSmoothedPWDB; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_TXPWR, DBG_LOUD, ("AP Ext Port PWDB = 0x%x \n", UndecoratedSmoothedPWDB)); + } + + if(UndecoratedSmoothedPWDB >= TX_POWER_NEAR_FIELD_THRESH_LVL2) + { + pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_Level2; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_TXPWR, DBG_LOUD, ("TxHighPwrLevel_Level1 (TxPwr=0x0)\n")); + } + else if((UndecoratedSmoothedPWDB < (TX_POWER_NEAR_FIELD_THRESH_LVL2-3)) && + (UndecoratedSmoothedPWDB >= TX_POWER_NEAR_FIELD_THRESH_LVL1) ) + { + pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_Level1; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_TXPWR, DBG_LOUD, ("TxHighPwrLevel_Level1 (TxPwr=0x10)\n")); + } + else if(UndecoratedSmoothedPWDB < (TX_POWER_NEAR_FIELD_THRESH_LVL1-5)) + { + pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_Normal; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_TXPWR, DBG_LOUD, ("TxHighPwrLevel_Normal\n")); + } + } + } + if( pHalData->DynamicTxHighPowerLvl != pHalData->LastDTPLvl ) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_TXPWR, DBG_LOUD, ("PHY_SetTxPowerLevel8192C() Channel = %d \n" , pHalData->CurrentChannel)); + PHY_SetTxPowerLevel8192C(Adapter, pHalData->CurrentChannel); + if( (pHalData->DynamicTxHighPowerLvl == TxHighPwrLevel_Normal) && + (pHalData->LastDTPLvl == TxHighPwrLevel_Level1 || pHalData->LastDTPLvl == TxHighPwrLevel_Level2)) //TxHighPwrLevel_Normal + odm_DynamicTxPowerRestorePowerIndex(pDM_Odm); + else if(pHalData->DynamicTxHighPowerLvl == TxHighPwrLevel_Level1) + odm_DynamicTxPowerWritePowerIndex(pDM_Odm, 0x14); + else if(pHalData->DynamicTxHighPowerLvl == TxHighPwrLevel_Level2) + odm_DynamicTxPowerWritePowerIndex(pDM_Odm, 0x10); + } + pHalData->LastDTPLvl = pHalData->DynamicTxHighPowerLvl; + + +#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) + + #if (RTL8192C_SUPPORT==1) + PADAPTER Adapter = pDM_Odm->Adapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + struct dm_priv *pdmpriv = &pHalData->dmpriv; + struct mlme_priv *pmlmepriv = &(Adapter->mlmepriv); + struct mlme_ext_priv *pmlmeext = &Adapter->mlmeextpriv; + int UndecoratedSmoothedPWDB; + + if(!pdmpriv->bDynamicTxPowerEnable) + return; + +#ifdef CONFIG_INTEL_PROXIM + if(Adapter->proximity.proxim_on== _TRUE){ + struct proximity_priv *prox_priv=Adapter->proximity.proximity_priv; + // Intel set fixed tx power + printk("\n %s Adapter->proximity.proxim_on=%d prox_priv->proxim_modeinfo->power_output=%d \n",__FUNCTION__,Adapter->proximity.proxim_on,prox_priv->proxim_modeinfo->power_output); + if(prox_priv!=NULL){ + if(prox_priv->proxim_modeinfo->power_output> 0) + { + switch(prox_priv->proxim_modeinfo->power_output) + { + case 1: + pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_100; + printk("TxHighPwrLevel_100\n"); + break; + case 2: + pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_70; + printk("TxHighPwrLevel_70\n"); + break; + case 3: + pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_50; + printk("TxHighPwrLevel_50\n"); + break; + case 4: + pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_35; + printk("TxHighPwrLevel_35\n"); + break; + case 5: + pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_15; + printk("TxHighPwrLevel_15\n"); + break; + default: + pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_100; + printk("TxHighPwrLevel_100\n"); + break; + } + } + } + } + else +#endif + { + // STA not connected and AP not connected + if((check_fwstate(pmlmepriv, _FW_LINKED) != _TRUE) && + (pdmpriv->EntryMinUndecoratedSmoothedPWDB == 0)) + { + //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("Not connected to any \n")); + pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_Normal; + + //the LastDTPlvl should reset when disconnect, + //otherwise the tx power level wouldn't change when disconnect and connect again. + // Maddest 20091220. + pdmpriv->LastDTPLvl=TxHighPwrLevel_Normal; + return; + } + + if(check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) // Default port + { + #if 0 + //todo: AP Mode + if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE) || + (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == _TRUE)) + { + UndecoratedSmoothedPWDB = pdmpriv->EntryMinUndecoratedSmoothedPWDB; + //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("AP Client PWDB = 0x%x \n", UndecoratedSmoothedPWDB)); + } + else + { + UndecoratedSmoothedPWDB = pdmpriv->UndecoratedSmoothedPWDB; + //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("STA Default Port PWDB = 0x%x \n", UndecoratedSmoothedPWDB)); + } + #else + UndecoratedSmoothedPWDB = pdmpriv->EntryMinUndecoratedSmoothedPWDB; + #endif + } + else // associated entry pwdb + { + UndecoratedSmoothedPWDB = pdmpriv->EntryMinUndecoratedSmoothedPWDB; + //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("AP Ext Port PWDB = 0x%x \n", UndecoratedSmoothedPWDB)); + } + + if(UndecoratedSmoothedPWDB >= TX_POWER_NEAR_FIELD_THRESH_LVL2) + { + pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_Level2; + //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("TxHighPwrLevel_Level1 (TxPwr=0x0)\n")); + } + else if((UndecoratedSmoothedPWDB < (TX_POWER_NEAR_FIELD_THRESH_LVL2-3)) && + (UndecoratedSmoothedPWDB >= TX_POWER_NEAR_FIELD_THRESH_LVL1) ) + { + pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_Level1; + //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("TxHighPwrLevel_Level1 (TxPwr=0x10)\n")); + } + else if(UndecoratedSmoothedPWDB < (TX_POWER_NEAR_FIELD_THRESH_LVL1-5)) + { + pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_Normal; + //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("TxHighPwrLevel_Normal\n")); + } + } + if( (pdmpriv->DynamicTxHighPowerLvl != pdmpriv->LastDTPLvl) ) + { + PHY_SetTxPowerLevel8192C(Adapter, pHalData->CurrentChannel); + if(pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_Normal) // HP1 -> Normal or HP2 -> Normal + odm_DynamicTxPowerRestorePowerIndex(pDM_Odm); + else if(pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_Level1) + odm_DynamicTxPowerWritePowerIndex(pDM_Odm, 0x14); + else if(pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_Level2) + odm_DynamicTxPowerWritePowerIndex(pDM_Odm, 0x10); + } + pdmpriv->LastDTPLvl = pdmpriv->DynamicTxHighPowerLvl; + #endif +#endif // #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + +} + + +VOID +odm_DynamicTxPower_92D( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + PADAPTER Adapter = pDM_Odm->Adapter; + PMGNT_INFO pMgntInfo = &Adapter->MgntInfo; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + s4Byte UndecoratedSmoothedPWDB; + + PADAPTER BuddyAdapter = Adapter->BuddyAdapter; + BOOLEAN bGetValueFromBuddyAdapter = dm_DualMacGetParameterFromBuddyAdapter(Adapter); + u1Byte HighPowerLvlBackForMac0 = TxHighPwrLevel_Level1; + + // 2012/01/12 MH According to Luke's suggestion, only high power will support the feature. + if (pDM_Odm->ExtPA == FALSE) + return; + + // If dynamic high power is disabled. + if( (pMgntInfo->bDynamicTxPowerEnable != TRUE) || + pMgntInfo->IOTAction & HT_IOT_ACT_DISABLE_HIGH_POWER) + { + pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_Normal; + return; + } + + // STA not connected and AP not connected + if((!pMgntInfo->bMediaConnect) && + (pHalData->EntryMinUndecoratedSmoothedPWDB == 0)) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_TXPWR, DBG_LOUD, ("Not connected to any \n")); + pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_Normal; + + //the LastDTPlvl should reset when disconnect, + //otherwise the tx power level wouldn't change when disconnect and connect again. + // Maddest 20091220. + pHalData->LastDTPLvl=TxHighPwrLevel_Normal; + return; + } + + if(pMgntInfo->bMediaConnect) // Default port + { + if(ACTING_AS_AP(Adapter) || pMgntInfo->mIbss) + { + UndecoratedSmoothedPWDB = pHalData->EntryMinUndecoratedSmoothedPWDB; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_TXPWR, DBG_LOUD, ("AP Client PWDB = 0x%x \n", UndecoratedSmoothedPWDB)); + } + else + { + UndecoratedSmoothedPWDB = pHalData->UndecoratedSmoothedPWDB; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_TXPWR, DBG_LOUD, ("STA Default Port PWDB = 0x%x \n", UndecoratedSmoothedPWDB)); + } + } + else // associated entry pwdb + { + UndecoratedSmoothedPWDB = pHalData->EntryMinUndecoratedSmoothedPWDB; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_TXPWR, DBG_LOUD, ("AP Ext Port PWDB = 0x%x \n", UndecoratedSmoothedPWDB)); + } + + if(IS_HARDWARE_TYPE_8192D(Adapter) && GET_HAL_DATA(Adapter)->CurrentBandType == 1){ + if(UndecoratedSmoothedPWDB >= 0x33) + { + pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_Level2; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_TXPWR, DBG_LOUD, ("5G:TxHighPwrLevel_Level2 (TxPwr=0x0)\n")); + } + else if((UndecoratedSmoothedPWDB <0x33) && + (UndecoratedSmoothedPWDB >= 0x2b) ) + { + pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_Level1; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_TXPWR, DBG_LOUD, ("5G:TxHighPwrLevel_Level1 (TxPwr=0x10)\n")); + } + else if(UndecoratedSmoothedPWDB < 0x2b) + { + pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_Normal; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_TXPWR, DBG_LOUD, ("5G:TxHighPwrLevel_Normal\n")); + } + + } + else + + { + if(UndecoratedSmoothedPWDB >= TX_POWER_NEAR_FIELD_THRESH_LVL2) + { + pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_Level1; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_TXPWR, DBG_LOUD, ("TxHighPwrLevel_Level1 (TxPwr=0x0)\n")); + } + else if((UndecoratedSmoothedPWDB < (TX_POWER_NEAR_FIELD_THRESH_LVL2-3)) && + (UndecoratedSmoothedPWDB >= TX_POWER_NEAR_FIELD_THRESH_LVL1) ) + { + pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_Level1; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_TXPWR, DBG_LOUD, ("TxHighPwrLevel_Level1 (TxPwr=0x10)\n")); + } + else if(UndecoratedSmoothedPWDB < (TX_POWER_NEAR_FIELD_THRESH_LVL1-5)) + { + pHalData->DynamicTxHighPowerLvl = TxHighPwrLevel_Normal; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_TXPWR, DBG_LOUD, ("TxHighPwrLevel_Normal\n")); + } + + } + +//sherry delete flag 20110517 + if(bGetValueFromBuddyAdapter) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_TXPWR,DBG_LOUD,("dm_DynamicTxPower() mac 0 for mac 1 \n")); + if(Adapter->DualMacDMSPControl.bChangeTxHighPowerLvlForAnotherMacOfDMSP) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_TXPWR,DBG_LOUD,("dm_DynamicTxPower() change value \n")); + HighPowerLvlBackForMac0 = pHalData->DynamicTxHighPowerLvl; + pHalData->DynamicTxHighPowerLvl = Adapter->DualMacDMSPControl.CurTxHighLvlForAnotherMacOfDMSP; + PHY_SetTxPowerLevel8192C(Adapter, pHalData->CurrentChannel); + pHalData->DynamicTxHighPowerLvl = HighPowerLvlBackForMac0; + Adapter->DualMacDMSPControl.bChangeTxHighPowerLvlForAnotherMacOfDMSP = FALSE; + } + } + + if( (pHalData->DynamicTxHighPowerLvl != pHalData->LastDTPLvl) ) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_TXPWR, DBG_LOUD, ("PHY_SetTxPowerLevel8192S() Channel = %d \n" , pHalData->CurrentChannel)); + if(Adapter->DualMacSmartConcurrent == TRUE) + { + if(BuddyAdapter == NULL) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_TXPWR,DBG_LOUD,("dm_DynamicTxPower() BuddyAdapter == NULL case \n")); + if(!Adapter->bSlaveOfDMSP) + { + PHY_SetTxPowerLevel8192C(Adapter, pHalData->CurrentChannel); + } + } + else + { + if(pHalData->MacPhyMode92D == DUALMAC_SINGLEPHY) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_TXPWR,DBG_LOUD,("dm_DynamicTxPower() BuddyAdapter DMSP \n")); + if(Adapter->bSlaveOfDMSP) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_TXPWR,DBG_LOUD,("dm_DynamicTxPower() bslave case \n")); + BuddyAdapter->DualMacDMSPControl.bChangeTxHighPowerLvlForAnotherMacOfDMSP = TRUE; + BuddyAdapter->DualMacDMSPControl.CurTxHighLvlForAnotherMacOfDMSP = pHalData->DynamicTxHighPowerLvl; + } + else + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_TXPWR,DBG_LOUD,("dm_DynamicTxPower() master case \n")); + if(!bGetValueFromBuddyAdapter) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_TXPWR,DBG_LOUD,("dm_DynamicTxPower() mac 0 for mac 0 \n")); + PHY_SetTxPowerLevel8192C(Adapter, pHalData->CurrentChannel); + } + } + } + else + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_TXPWR,DBG_LOUD,("dm_DynamicTxPower() BuddyAdapter DMDP\n")); + PHY_SetTxPowerLevel8192C(Adapter, pHalData->CurrentChannel); + } + } + } + else + { + PHY_SetTxPowerLevel8192C(Adapter, pHalData->CurrentChannel); + } + + } + pHalData->LastDTPLvl = pHalData->DynamicTxHighPowerLvl; +#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) +#if (RTL8192D_SUPPORT==1) + PADAPTER Adapter = pDM_Odm->Adapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + struct mlme_priv *pmlmepriv = &(Adapter->mlmepriv); + + struct dm_priv *pdmpriv = &pHalData->dmpriv; + DM_ODM_T *podmpriv = &pHalData->odmpriv; + int UndecoratedSmoothedPWDB; + #if (RTL8192D_EASY_SMART_CONCURRENT == 1) + PADAPTER BuddyAdapter = Adapter->BuddyAdapter; + BOOLEAN bGetValueFromBuddyAdapter = DualMacGetParameterFromBuddyAdapter(Adapter); + u8 HighPowerLvlBackForMac0 = TxHighPwrLevel_Level1; + #endif + + // If dynamic high power is disabled. + if( (pdmpriv->bDynamicTxPowerEnable != _TRUE) || + (!(podmpriv->SupportAbility& ODM_BB_DYNAMIC_TXPWR)) ) + { + pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_Normal; + return; + } + + // STA not connected and AP not connected + if((check_fwstate(pmlmepriv, _FW_LINKED) != _TRUE) && + (pdmpriv->EntryMinUndecoratedSmoothedPWDB == 0)) + { + //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("Not connected to any \n")); + pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_Normal; + //the LastDTPlvl should reset when disconnect, + //otherwise the tx power level wouldn't change when disconnect and connect again. + // Maddest 20091220. + pdmpriv->LastDTPLvl=TxHighPwrLevel_Normal; + return; + } + + if(check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) // Default port + { + #if 0 + //todo: AP Mode + if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE) || + (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == _TRUE)) + { + UndecoratedSmoothedPWDB = pdmpriv->EntryMinUndecoratedSmoothedPWDB; + //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("AP Client PWDB = 0x%x \n", UndecoratedSmoothedPWDB)); + } + else + { + UndecoratedSmoothedPWDB = pdmpriv->UndecoratedSmoothedPWDB; + //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("STA Default Port PWDB = 0x%x \n", UndecoratedSmoothedPWDB)); + } + #else + UndecoratedSmoothedPWDB = pdmpriv->EntryMinUndecoratedSmoothedPWDB; + #endif + } + else // associated entry pwdb + { + UndecoratedSmoothedPWDB = pdmpriv->EntryMinUndecoratedSmoothedPWDB; + //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("AP Ext Port PWDB = 0x%x \n", UndecoratedSmoothedPWDB)); + } +#if TX_POWER_FOR_5G_BAND == 1 + if(pHalData->CurrentBandType92D == BAND_ON_5G){ + if(UndecoratedSmoothedPWDB >= 0x33) + { + pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_Level2; + //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("5G:TxHighPwrLevel_Level2 (TxPwr=0x0)\n")); + } + else if((UndecoratedSmoothedPWDB <0x33) && + (UndecoratedSmoothedPWDB >= 0x2b) ) + { + pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_Level1; + //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("5G:TxHighPwrLevel_Level1 (TxPwr=0x10)\n")); + } + else if(UndecoratedSmoothedPWDB < 0x2b) + { + pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_Normal; + //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("5G:TxHighPwrLevel_Normal\n")); + } + } + else +#endif + { + if(UndecoratedSmoothedPWDB >= TX_POWER_NEAR_FIELD_THRESH_LVL2) + { + pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_Level2; + //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("TxHighPwrLevel_Level1 (TxPwr=0x0)\n")); + } + else if((UndecoratedSmoothedPWDB < (TX_POWER_NEAR_FIELD_THRESH_LVL2-3)) && + (UndecoratedSmoothedPWDB >= TX_POWER_NEAR_FIELD_THRESH_LVL1) ) + { + pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_Level1; + //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("TxHighPwrLevel_Level1 (TxPwr=0x10)\n")); + } + else if(UndecoratedSmoothedPWDB < (TX_POWER_NEAR_FIELD_THRESH_LVL1-5)) + { + pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_Normal; + //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("TxHighPwrLevel_Normal\n")); + } + } +#if (RTL8192D_EASY_SMART_CONCURRENT == 1) + if(bGetValueFromBuddyAdapter) + { + //ODM_RT_TRACE(pDM_Odm,COMP_MLME,DBG_LOUD,("dm_DynamicTxPower() mac 0 for mac 1 \n")); + if(Adapter->DualMacDMSPControl.bChangeTxHighPowerLvlForAnotherMacOfDMSP) + { + //ODM_RT_TRACE(pDM_Odm,COMP_MLME,DBG_LOUD,("dm_DynamicTxPower() change value \n")); + HighPowerLvlBackForMac0 = pHalData->DynamicTxHighPowerLvl; + pHalData->DynamicTxHighPowerLvl = Adapter->DualMacDMSPControl.CurTxHighLvlForAnotherMacOfDMSP; + PHY_SetTxPowerLevel8192D(Adapter, pHalData->CurrentChannel); + pHalData->DynamicTxHighPowerLvl = HighPowerLvlBackForMac0; + Adapter->DualMacDMSPControl.bChangeTxHighPowerLvlForAnotherMacOfDMSP = _FALSE; + } + } +#endif + + if( (pdmpriv->DynamicTxHighPowerLvl != pdmpriv->LastDTPLvl) ) + { + //ODM_RT_TRACE(pDM_Odm,COMP_HIPWR, DBG_LOUD, ("PHY_SetTxPowerLevel8192S() Channel = %d \n" , pHalData->CurrentChannel)); +#if (RTL8192D_EASY_SMART_CONCURRENT == 1) + if(BuddyAdapter == NULL) + { + //ODM_RT_TRACE(pDM_Odm,COMP_MLME,DBG_LOUD,("dm_DynamicTxPower() BuddyAdapter == NULL case \n")); + if(!Adapter->bSlaveOfDMSP) + { + PHY_SetTxPowerLevel8192D(Adapter, pHalData->CurrentChannel); + } + } + else + { + if(pHalData->MacPhyMode92D == DUALMAC_SINGLEPHY) + { + //ODM_RT_TRACE(pDM_Odm,COMP_MLME,DBG_LOUD,("dm_DynamicTxPower() BuddyAdapter DMSP \n")); + if(Adapter->bSlaveOfDMSP) + { + //ODM_RT_TRACE(pDM_Odm,COMP_MLME,DBG_LOUD,("dm_DynamicTxPower() bslave case \n")); + BuddyAdapter->DualMacDMSPControl.bChangeTxHighPowerLvlForAnotherMacOfDMSP = _TRUE; + BuddyAdapter->DualMacDMSPControl.CurTxHighLvlForAnotherMacOfDMSP = pHalData->DynamicTxHighPowerLvl; + } + else + { + //ODM_RT_TRACE(pDM_Odm,COMP_MLME,DBG_LOUD,("dm_DynamicTxPower() master case \n")); + if(!bGetValueFromBuddyAdapter) + { + //ODM_RT_TRACE(pDM_Odm,COMP_MLME,DBG_LOUD,("dm_DynamicTxPower() mac 0 for mac 0 \n")); + PHY_SetTxPowerLevel8192D(Adapter, pHalData->CurrentChannel); + } + } + } + else + { + //ODM_RT_TRACE(pDM_Odm,COMP_MLME,DBG_LOUD,("dm_DynamicTxPower() BuddyAdapter DMDP\n")); + PHY_SetTxPowerLevel8192D(Adapter, pHalData->CurrentChannel); + } + } +#else + PHY_SetTxPowerLevel8192D(Adapter, pHalData->CurrentChannel); +#endif + } + pdmpriv->LastDTPLvl = pdmpriv->DynamicTxHighPowerLvl; +#endif +#endif // #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + +} + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_DynamicTxPower.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_DynamicTxPower.h new file mode 100644 index 00000000000000..508cd31277d30a --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_DynamicTxPower.h @@ -0,0 +1,89 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +#ifndef __PHYDMDYNAMICTXPOWER_H__ +#define __PHYDMDYNAMICTXPOWER_H__ + +#define DYNAMIC_TXPWR_VERSION "1.0" + +#define TX_POWER_NEAR_FIELD_THRESH_LVL2 74 +#define TX_POWER_NEAR_FIELD_THRESH_LVL1 67 +#define TX_POWER_NEAR_FIELD_THRESH_AP 0x3F +#define TX_POWER_NEAR_FIELD_THRESH_8812 60 + +#define TxHighPwrLevel_Normal 0 +#define TxHighPwrLevel_Level1 1 +#define TxHighPwrLevel_Level2 2 +#define TxHighPwrLevel_BT1 3 +#define TxHighPwrLevel_BT2 4 +#define TxHighPwrLevel_15 5 +#define TxHighPwrLevel_35 6 +#define TxHighPwrLevel_50 7 +#define TxHighPwrLevel_70 8 +#define TxHighPwrLevel_100 9 + +VOID +odm_DynamicTxPowerInit( + IN PVOID pDM_VOID + ); + +VOID +odm_DynamicTxPowerRestorePowerIndex( + IN PVOID pDM_VOID + ); + +VOID +odm_DynamicTxPowerNIC( + IN PVOID pDM_VOID + ); + +#if(DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) +VOID +odm_DynamicTxPowerSavePowerIndex( + IN PVOID pDM_VOID + ); + +VOID +odm_DynamicTxPowerWritePowerIndex( + IN PVOID pDM_VOID, + IN u1Byte Value); + +VOID +odm_DynamicTxPower_92C( + IN PVOID pDM_VOID + ); + +VOID +odm_DynamicTxPower_92D( + IN PVOID pDM_VOID + ); +#endif + +VOID +odm_DynamicTxPower( + IN PVOID pDM_VOID + ); + +VOID +odm_DynamicTxPowerAP( + IN PVOID pDM_VOID + ); + +#endif diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_EdcaTurboCheck.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_EdcaTurboCheck.c new file mode 100644 index 00000000000000..b63158f380504c --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_EdcaTurboCheck.c @@ -0,0 +1,831 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +//============================================================ +// include files +//============================================================ +#include "Mp_Precomp.h" +#include "phydm_precomp.h" + +VOID +ODM_EdcaTurboInit( + IN PVOID pDM_VOID) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + +#if (DM_ODM_SUPPORT_TYPE==ODM_WIN) + PADAPTER Adapter = NULL; + HAL_DATA_TYPE *pHalData = NULL; + + if(pDM_Odm->Adapter==NULL) { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("EdcaTurboInit fail!!!\n")); + return; + } + + Adapter=pDM_Odm->Adapter; + pHalData=GET_HAL_DATA(Adapter); + + pDM_Odm->DM_EDCA_Table.bCurrentTurboEDCA = FALSE; + pDM_Odm->DM_EDCA_Table.bIsCurRDLState = FALSE; + pHalData->bIsAnyNonBEPkts = FALSE; + +#elif(DM_ODM_SUPPORT_TYPE==ODM_CE) + PADAPTER Adapter = pDM_Odm->Adapter; + pDM_Odm->DM_EDCA_Table.bCurrentTurboEDCA = FALSE; + pDM_Odm->DM_EDCA_Table.bIsCurRDLState = FALSE; + Adapter->recvpriv.bIsAnyNonBEPkts =FALSE; + +#endif + ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("Orginial VO PARAM: 0x%x\n",ODM_Read4Byte(pDM_Odm,ODM_EDCA_VO_PARAM))); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("Orginial VI PARAM: 0x%x\n",ODM_Read4Byte(pDM_Odm,ODM_EDCA_VI_PARAM))); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("Orginial BE PARAM: 0x%x\n",ODM_Read4Byte(pDM_Odm,ODM_EDCA_BE_PARAM))); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("Orginial BK PARAM: 0x%x\n",ODM_Read4Byte(pDM_Odm,ODM_EDCA_BK_PARAM))); + + +} // ODM_InitEdcaTurbo + +VOID +odm_EdcaTurboCheck( + IN PVOID pDM_VOID + ) +{ + // + // For AP/ADSL use prtl8192cd_priv + // For CE/NIC use PADAPTER + // + + // + // 2011/09/29 MH In HW integration first stage, we provide 4 different handle to operate + // at the same time. In the stage2/3, we need to prive universal interface and merge all + // HW dynamic mechanism. + // + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("odm_EdcaTurboCheck========================>\n")); + + if(!(pDM_Odm->SupportAbility& ODM_MAC_EDCA_TURBO )) + return; + + switch (pDM_Odm->SupportPlatform) + { + case ODM_WIN: + +#if(DM_ODM_SUPPORT_TYPE==ODM_WIN) + odm_EdcaTurboCheckMP(pDM_Odm); +#endif + break; + + case ODM_CE: +#if(DM_ODM_SUPPORT_TYPE==ODM_CE) + odm_EdcaTurboCheckCE(pDM_Odm); +#endif + break; + } + ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("<========================odm_EdcaTurboCheck\n")); + +} // odm_CheckEdcaTurbo + +#if(DM_ODM_SUPPORT_TYPE==ODM_CE) + + +VOID +odm_EdcaTurboCheckCE( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PADAPTER Adapter = pDM_Odm->Adapter; + u32 EDCA_BE_UL = 0x5ea42b;//Parameter suggested by Scott //edca_setting_UL[pMgntInfo->IOTPeer]; + u32 EDCA_BE_DL = 0x5ea42b;//Parameter suggested by Scott //edca_setting_DL[pMgntInfo->IOTPeer]; + u32 ICType=pDM_Odm->SupportICType; + u32 IOTPeer=0; + u8 WirelessMode=0xFF; //invalid value + u32 trafficIndex; + u32 edca_param; + u64 cur_tx_bytes = 0; + u64 cur_rx_bytes = 0; + u8 bbtchange = _FALSE; + u8 bBiasOnRx = _FALSE; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(Adapter); + struct xmit_priv *pxmitpriv = &(Adapter->xmitpriv); + struct recv_priv *precvpriv = &(Adapter->recvpriv); + struct registry_priv *pregpriv = &Adapter->registrypriv; + struct mlme_ext_priv *pmlmeext = &(Adapter->mlmeextpriv); + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + + if(pDM_Odm->bLinked != _TRUE) + { + precvpriv->bIsAnyNonBEPkts = _FALSE; + return; + } + + if ((pregpriv->wifi_spec == 1) )//|| (pmlmeinfo->HT_enable == 0)) + { + precvpriv->bIsAnyNonBEPkts = _FALSE; + return; + } + + if(pDM_Odm->pWirelessMode!=NULL) + WirelessMode=*(pDM_Odm->pWirelessMode); + + IOTPeer = pmlmeinfo->assoc_AP_vendor; + + if (IOTPeer >= HT_IOT_PEER_MAX) + { + precvpriv->bIsAnyNonBEPkts = _FALSE; + return; + } + + if( (pDM_Odm->SupportICType == ODM_RTL8192C) || + (pDM_Odm->SupportICType == ODM_RTL8723A) || + (pDM_Odm->SupportICType == ODM_RTL8188E)) + { + if((IOTPeer == HT_IOT_PEER_RALINK)||(IOTPeer == HT_IOT_PEER_ATHEROS)) + bBiasOnRx = _TRUE; + } + + // Check if the status needs to be changed. + if((bbtchange) || (!precvpriv->bIsAnyNonBEPkts) ) + { + cur_tx_bytes = pdvobjpriv->traffic_stat.cur_tx_bytes; + cur_rx_bytes = pdvobjpriv->traffic_stat.cur_rx_bytes; + + //traffic, TX or RX + if(bBiasOnRx) + { + if (cur_tx_bytes > (cur_rx_bytes << 2)) + { // Uplink TP is present. + trafficIndex = UP_LINK; + } + else + { // Balance TP is present. + trafficIndex = DOWN_LINK; + } + } + else + { + if (cur_rx_bytes > (cur_tx_bytes << 2)) + { // Downlink TP is present. + trafficIndex = DOWN_LINK; + } + else + { // Balance TP is present. + trafficIndex = UP_LINK; + } + } + + //if ((pDM_Odm->DM_EDCA_Table.prv_traffic_idx != trafficIndex) || (!pDM_Odm->DM_EDCA_Table.bCurrentTurboEDCA)) + { + if(ICType==ODM_RTL8192D) + { + // Single PHY + if(pDM_Odm->RFType==ODM_2T2R) + { + EDCA_BE_UL = 0x60a42b; //0x5ea42b; + EDCA_BE_DL = 0x60a42b; //0x5ea42b; + } + else + { + EDCA_BE_UL = 0x6ea42b; + EDCA_BE_DL = 0x6ea42b; + } + } + else + { + if(pDM_Odm->SupportInterface==ODM_ITRF_PCIE) { + if((ICType==ODM_RTL8192C)&&(pDM_Odm->RFType==ODM_2T2R)) { + EDCA_BE_UL = 0x60a42b; + EDCA_BE_DL = 0x60a42b; + } + else + { + EDCA_BE_UL = 0x6ea42b; + EDCA_BE_DL = 0x6ea42b; + } + } + } + + //92D txop can't be set to 0x3e for cisco1250 + if((ICType!=ODM_RTL8192D) && (IOTPeer== HT_IOT_PEER_CISCO) &&(WirelessMode==ODM_WM_N24G)) + { + EDCA_BE_DL = edca_setting_DL[IOTPeer]; + EDCA_BE_UL = edca_setting_UL[IOTPeer]; + } + //merge from 92s_92c_merge temp brunch v2445 20120215 + else if((IOTPeer == HT_IOT_PEER_CISCO) &&((WirelessMode==ODM_WM_G)||(WirelessMode==(ODM_WM_B|ODM_WM_G))||(WirelessMode==ODM_WM_A)||(WirelessMode==ODM_WM_B))) + { + EDCA_BE_DL = edca_setting_DL_GMode[IOTPeer]; + } + else if((IOTPeer== HT_IOT_PEER_AIRGO )&& ((WirelessMode==ODM_WM_G)||(WirelessMode==ODM_WM_A))) + { + EDCA_BE_DL = 0xa630; + } + else if(IOTPeer == HT_IOT_PEER_MARVELL) + { + EDCA_BE_DL = edca_setting_DL[IOTPeer]; + EDCA_BE_UL = edca_setting_UL[IOTPeer]; + } + else if(IOTPeer == HT_IOT_PEER_ATHEROS) + { + // Set DL EDCA for Atheros peer to 0x3ea42b. Suggested by SD3 Wilson for ASUS TP issue. + EDCA_BE_DL = edca_setting_DL[IOTPeer]; + } + + if((ICType==ODM_RTL8812)||(ICType==ODM_RTL8821)||(ICType==ODM_RTL8192E)) //add 8812AU/8812AE + { + EDCA_BE_UL = 0x5ea42b; + EDCA_BE_DL = 0x5ea42b; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("8812A: EDCA_BE_UL=0x%x EDCA_BE_DL =0x%x",EDCA_BE_UL,EDCA_BE_DL)); + } + + if (trafficIndex == DOWN_LINK) + edca_param = EDCA_BE_DL; + else + edca_param = EDCA_BE_UL; + + rtw_write32(Adapter, REG_EDCA_BE_PARAM, edca_param); + + pDM_Odm->DM_EDCA_Table.prv_traffic_idx = trafficIndex; + } + + pDM_Odm->DM_EDCA_Table.bCurrentTurboEDCA = _TRUE; + } + else + { + // + // Turn Off EDCA turbo here. + // Restore original EDCA according to the declaration of AP. + // + if(pDM_Odm->DM_EDCA_Table.bCurrentTurboEDCA) + { + rtw_write32(Adapter, REG_EDCA_BE_PARAM, pHalData->AcParam_BE); + pDM_Odm->DM_EDCA_Table.bCurrentTurboEDCA = _FALSE; + } + } + +} + + +#elif(DM_ODM_SUPPORT_TYPE==ODM_WIN) +VOID +odm_EdcaTurboCheckMP( + IN PVOID pDM_VOID + ) +{ + + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PADAPTER Adapter = pDM_Odm->Adapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + + PADAPTER pDefaultAdapter = GetDefaultAdapter(Adapter); + PADAPTER pExtAdapter = GetFirstExtAdapter(Adapter);//NULL; + PMGNT_INFO pMgntInfo = &Adapter->MgntInfo; + PSTA_QOS pStaQos = Adapter->MgntInfo.pStaQos; + //[Win7 Count Tx/Rx statistic for Extension Port] odm_CheckEdcaTurbo's Adapter is always Default. 2009.08.20, by Bohn + u8Byte Ext_curTxOkCnt = 0; + u8Byte Ext_curRxOkCnt = 0; + //For future Win7 Enable Default Port to modify AMPDU size dynamically, 2009.08.20, Bohn. + u1Byte TwoPortStatus = (u1Byte)TWO_PORT_STATUS__WITHOUT_ANY_ASSOCIATE; + + // Keep past Tx/Rx packet count for RT-to-RT EDCA turbo. + u8Byte curTxOkCnt = 0; + u8Byte curRxOkCnt = 0; + u4Byte EDCA_BE_UL = 0x5ea42b;//Parameter suggested by Scott //edca_setting_UL[pMgntInfo->IOTPeer]; + u4Byte EDCA_BE_DL = 0x5ea42b;//Parameter suggested by Scott //edca_setting_DL[pMgntInfo->IOTPeer]; + u4Byte EDCA_BE = 0x5ea42b; + u1Byte IOTPeer=0; + BOOLEAN *pbIsCurRDLState=NULL; + BOOLEAN bLastIsCurRDLState=FALSE; + BOOLEAN bBiasOnRx=FALSE; + BOOLEAN bEdcaTurboOn=FALSE; + u1Byte TxRate = 0xFF; + u8Byte value64; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("odm_EdcaTurboCheckMP========================>")); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("Orginial BE PARAM: 0x%x\n",ODM_Read4Byte(pDM_Odm,ODM_EDCA_BE_PARAM))); + +////=============================== +////list paramter for different platform +////=============================== + bLastIsCurRDLState=pDM_Odm->DM_EDCA_Table.bIsCurRDLState; + pbIsCurRDLState=&(pDM_Odm->DM_EDCA_Table.bIsCurRDLState); + + //2012/09/14 MH Add + if (pMgntInfo->NumNonBePkt > pMgntInfo->RegEdcaThresh && !Adapter->MgntInfo.bWiFiConfg) + pHalData->bIsAnyNonBEPkts = TRUE; + + pMgntInfo->NumNonBePkt = 0; + + // Caculate TX/RX TP: + //curTxOkCnt = Adapter->TxStats.NumTxBytesUnicast - pMgntInfo->lastTxOkCnt; + //curRxOkCnt = Adapter->RxStats.NumRxBytesUnicast - pMgntInfo->lastRxOkCnt; + curTxOkCnt = Adapter->TxStats.NumTxBytesUnicast - pDM_Odm->lastTxOkCnt; + curRxOkCnt = Adapter->RxStats.NumRxBytesUnicast - pDM_Odm->lastRxOkCnt; + pDM_Odm->lastTxOkCnt = Adapter->TxStats.NumTxBytesUnicast; + pDM_Odm->lastRxOkCnt = Adapter->RxStats.NumRxBytesUnicast; + + if(pExtAdapter == NULL) + pExtAdapter = pDefaultAdapter; + + Ext_curTxOkCnt = pExtAdapter->TxStats.NumTxBytesUnicast - pMgntInfo->Ext_lastTxOkCnt; + Ext_curRxOkCnt = pExtAdapter->RxStats.NumRxBytesUnicast - pMgntInfo->Ext_lastRxOkCnt; + GetTwoPortSharedResource(Adapter,TWO_PORT_SHARED_OBJECT__STATUS,NULL,&TwoPortStatus); + //For future Win7 Enable Default Port to modify AMPDU size dynamically, 2009.08.20, Bohn. + if(TwoPortStatus == TWO_PORT_STATUS__EXTENSION_ONLY) + { + curTxOkCnt = Ext_curTxOkCnt ; + curRxOkCnt = Ext_curRxOkCnt ; + } + // + IOTPeer=pMgntInfo->IOTPeer; + bBiasOnRx=(pMgntInfo->IOTAction & HT_IOT_ACT_EDCA_BIAS_ON_RX)?TRUE:FALSE; + bEdcaTurboOn=((!pHalData->bIsAnyNonBEPkts))?TRUE:FALSE; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("bIsAnyNonBEPkts : 0x%lx \n",pHalData->bIsAnyNonBEPkts)); + + +////=============================== +////check if edca turbo is disabled +////=============================== + if(odm_IsEdcaTurboDisable(pDM_Odm)) + { + pHalData->bIsAnyNonBEPkts = FALSE; + pMgntInfo->lastTxOkCnt = Adapter->TxStats.NumTxBytesUnicast; + pMgntInfo->lastRxOkCnt = Adapter->RxStats.NumRxBytesUnicast; + pMgntInfo->Ext_lastTxOkCnt = pExtAdapter->TxStats.NumTxBytesUnicast; + pMgntInfo->Ext_lastRxOkCnt = pExtAdapter->RxStats.NumRxBytesUnicast; + + } + +////=============================== +////remove iot case out +////=============================== + ODM_EdcaParaSelByIot(pDM_Odm, &EDCA_BE_UL, &EDCA_BE_DL); + + +////=============================== +////Check if the status needs to be changed. +////=============================== + if(bEdcaTurboOn) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("bEdcaTurboOn : 0x%x bBiasOnRx : 0x%x\n",bEdcaTurboOn,bBiasOnRx)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("curTxOkCnt : 0x%lx \n",curTxOkCnt)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("curRxOkCnt : 0x%lx \n",curRxOkCnt)); + if(bBiasOnRx) + odm_EdcaChooseTrafficIdx(pDM_Odm,curTxOkCnt, curRxOkCnt, TRUE, pbIsCurRDLState); + else + odm_EdcaChooseTrafficIdx(pDM_Odm,curTxOkCnt, curRxOkCnt, FALSE, pbIsCurRDLState); + +//modify by Guo.Mingzhi 2011-12-29 + EDCA_BE=((*pbIsCurRDLState)==TRUE)?EDCA_BE_DL:EDCA_BE_UL; + if(IS_HARDWARE_TYPE_8821U(Adapter)) + { + if(pMgntInfo->RegTxDutyEnable) + { + //2013.01.23 LukeLee: debug for 8811AU thermal issue (reduce Tx duty cycle) + if(!pMgntInfo->ForcedDataRate) //auto rate + { + if(pDM_Odm->TxRate != 0xFF) + TxRate = Adapter->HalFunc.GetHwRateFromMRateHandler(pDM_Odm->TxRate); + } + else //force rate + { + TxRate = (u1Byte) pMgntInfo->ForcedDataRate; + } + + value64 = (curRxOkCnt<<2); + if(curTxOkCnt < value64) //Downlink + ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,EDCA_BE); + else //Uplink + { + //DbgPrint("pDM_Odm->RFCalibrateInfo.ThermalValue = 0x%X\n", pDM_Odm->RFCalibrateInfo.ThermalValue); + //if(pDM_Odm->RFCalibrateInfo.ThermalValue < pHalData->EEPROMThermalMeter) + if((pDM_Odm->RFCalibrateInfo.ThermalValue < 0x2c) || (*pDM_Odm->pBandType == BAND_ON_2_4G)) + ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,EDCA_BE); + else + { + switch (TxRate) + { + case MGN_VHT1SS_MCS6: + case MGN_VHT1SS_MCS5: + case MGN_MCS6: + case MGN_MCS5: + case MGN_48M: + case MGN_54M: + ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,0x1ea42b); + break; + case MGN_VHT1SS_MCS4: + case MGN_MCS4: + case MGN_36M: + ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,0xa42b); + break; + case MGN_VHT1SS_MCS3: + case MGN_MCS3: + case MGN_24M: + ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,0xa47f); + break; + case MGN_VHT1SS_MCS2: + case MGN_MCS2: + case MGN_18M: + ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,0xa57f); + break; + case MGN_VHT1SS_MCS1: + case MGN_MCS1: + case MGN_9M: + case MGN_12M: + ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,0xa77f); + break; + case MGN_VHT1SS_MCS0: + case MGN_MCS0: + case MGN_6M: + ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,0xa87f); + break; + default: + ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,EDCA_BE); + break; + } + } + } + } + else + { + ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,EDCA_BE); + } + + } + else if (IS_HARDWARE_TYPE_8812AU(Adapter)){ + if(pMgntInfo->RegTxDutyEnable) + { + //2013.07.26 Wilson: debug for 8812AU thermal issue (reduce Tx duty cycle) + // it;s the same issue as 8811AU + if(!pMgntInfo->ForcedDataRate) //auto rate + { + if(pDM_Odm->TxRate != 0xFF) + TxRate = Adapter->HalFunc.GetHwRateFromMRateHandler(pDM_Odm->TxRate); + } + else //force rate + { + TxRate = (u1Byte) pMgntInfo->ForcedDataRate; + } + + value64 = (curRxOkCnt<<2); + if(curTxOkCnt < value64) //Downlink + ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,EDCA_BE); + else //Uplink + { + //DbgPrint("pDM_Odm->RFCalibrateInfo.ThermalValue = 0x%X\n", pDM_Odm->RFCalibrateInfo.ThermalValue); + //if(pDM_Odm->RFCalibrateInfo.ThermalValue < pHalData->EEPROMThermalMeter) + if((pDM_Odm->RFCalibrateInfo.ThermalValue < 0x2c) || (*pDM_Odm->pBandType == BAND_ON_2_4G)) + ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,EDCA_BE); + else + { + switch (TxRate) + { + case MGN_VHT2SS_MCS9: + case MGN_VHT1SS_MCS9: + case MGN_VHT1SS_MCS8: + case MGN_MCS15: + case MGN_MCS7: + ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,0x1ea44f); + case MGN_VHT2SS_MCS8: + case MGN_VHT1SS_MCS7: + case MGN_MCS14: + case MGN_MCS6: + case MGN_54M: + ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,0xa44f); + case MGN_VHT2SS_MCS7: + case MGN_VHT2SS_MCS6: + case MGN_VHT1SS_MCS6: + case MGN_VHT1SS_MCS5: + case MGN_MCS13: + case MGN_MCS5: + case MGN_48M: + ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,0xa630); + break; + case MGN_VHT2SS_MCS5: + case MGN_VHT2SS_MCS4: + case MGN_VHT1SS_MCS4: + case MGN_VHT1SS_MCS3: + case MGN_MCS12: + case MGN_MCS4: + case MGN_MCS3: + case MGN_36M: + case MGN_24M: + ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,0xa730); + break; + case MGN_VHT2SS_MCS3: + case MGN_VHT2SS_MCS2: + case MGN_VHT2SS_MCS1: + case MGN_VHT1SS_MCS2: + case MGN_VHT1SS_MCS1: + case MGN_MCS11: + case MGN_MCS10: + case MGN_MCS9: + case MGN_MCS2: + case MGN_MCS1: + case MGN_18M: + case MGN_12M: + ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,0xa830); + break; + case MGN_VHT2SS_MCS0: + case MGN_VHT1SS_MCS0: + case MGN_MCS0: + case MGN_MCS8: + case MGN_9M: + case MGN_6M: + ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,0xa87f); + break; + default: + ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,EDCA_BE); + break; + } + } + } + } + else + { + ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,EDCA_BE); + } + } + else + ODM_Write4Byte(pDM_Odm,ODM_EDCA_BE_PARAM,EDCA_BE); + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("EDCA Turbo on: EDCA_BE:0x%lx\n",EDCA_BE)); + + pDM_Odm->DM_EDCA_Table.bCurrentTurboEDCA = TRUE; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("EDCA_BE_DL : 0x%lx EDCA_BE_UL : 0x%lx EDCA_BE : 0x%lx \n",EDCA_BE_DL,EDCA_BE_UL,EDCA_BE)); + + } + else + { + // Turn Off EDCA turbo here. + // Restore original EDCA according to the declaration of AP. + if(pDM_Odm->DM_EDCA_Table.bCurrentTurboEDCA) + { + Adapter->HalFunc.SetHwRegHandler(Adapter, HW_VAR_AC_PARAM, GET_WMM_PARAM_ELE_SINGLE_AC_PARAM(pStaQos->WMMParamEle, AC0_BE) ); + + pDM_Odm->DM_EDCA_Table.bCurrentTurboEDCA = FALSE; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("Restore EDCA BE: 0x%lx \n",pDM_Odm->WMMEDCA_BE)); + + } + } + +} + + +//check if edca turbo is disabled +BOOLEAN +odm_IsEdcaTurboDisable( + IN PVOID pDM_VOID +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PADAPTER Adapter = pDM_Odm->Adapter; + PMGNT_INFO pMgntInfo = &Adapter->MgntInfo; + u4Byte IOTPeer=pMgntInfo->IOTPeer; + + if(pDM_Odm->bBtDisableEdcaTurbo) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD, ("EdcaTurboDisable for BT!!\n")); + return TRUE; + } + + if((!(pDM_Odm->SupportAbility& ODM_MAC_EDCA_TURBO ))|| + (pDM_Odm->bWIFITest)|| + (IOTPeer>= HT_IOT_PEER_MAX)) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD, ("EdcaTurboDisable\n")); + return TRUE; + } + + + // 1. We do not turn on EDCA turbo mode for some AP that has IOT issue + // 2. User may disable EDCA Turbo mode with OID settings. + if(pMgntInfo->IOTAction & HT_IOT_ACT_DISABLE_EDCA_TURBO){ + ODM_RT_TRACE(pDM_Odm, ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD, ("IOTAction:EdcaTurboDisable\n")); + return TRUE; + } + + return FALSE; + + +} + +//add iot case here: for MP/CE +VOID +ODM_EdcaParaSelByIot( + IN PVOID pDM_VOID, + OUT u4Byte *EDCA_BE_UL, + OUT u4Byte *EDCA_BE_DL + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PADAPTER Adapter = pDM_Odm->Adapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + u4Byte IOTPeer=0; + u4Byte ICType=pDM_Odm->SupportICType; + u1Byte WirelessMode=0xFF; //invalid value + u4Byte RFType=pDM_Odm->RFType; + u4Byte IOTPeerSubType=0; + + PMGNT_INFO pMgntInfo = &Adapter->MgntInfo; + u1Byte TwoPortStatus = (u1Byte)TWO_PORT_STATUS__WITHOUT_ANY_ASSOCIATE; + + if(pDM_Odm->pWirelessMode!=NULL) + WirelessMode=*(pDM_Odm->pWirelessMode); + +/////////////////////////////////////////////////////////// +////list paramter for different platform + + IOTPeer=pMgntInfo->IOTPeer; + IOTPeerSubType=pMgntInfo->IOTPeerSubtype; + GetTwoPortSharedResource(Adapter,TWO_PORT_SHARED_OBJECT__STATUS,NULL,&TwoPortStatus); + + + if(ICType==ODM_RTL8192D) + { + // Single PHY + if(pDM_Odm->RFType==ODM_2T2R) + { + (*EDCA_BE_UL) = 0x60a42b; //0x5ea42b; + (*EDCA_BE_DL) = 0x60a42b; //0x5ea42b; + + } + else + { + (*EDCA_BE_UL) = 0x6ea42b; + (*EDCA_BE_DL) = 0x6ea42b; + } + + } +////============================ +/// IOT case for MP +////============================ + + else + { + + if(pDM_Odm->SupportInterface==ODM_ITRF_PCIE){ + if((ICType==ODM_RTL8192C)&&(pDM_Odm->RFType==ODM_2T2R)) { + (*EDCA_BE_UL) = 0x60a42b; + (*EDCA_BE_DL) = 0x60a42b; + } + else + { + (*EDCA_BE_UL) = 0x6ea42b; + (*EDCA_BE_DL) = 0x6ea42b; + } + } + } + + if(TwoPortStatus == TWO_PORT_STATUS__EXTENSION_ONLY) + { + (*EDCA_BE_UL) = 0x5ea42b;//Parameter suggested by Scott //edca_setting_UL[ExtAdapter->MgntInfo.IOTPeer]; + (*EDCA_BE_DL) = 0x5ea42b;//Parameter suggested by Scott //edca_setting_DL[ExtAdapter->MgntInfo.IOTPeer]; + } + + #if (INTEL_PROXIMITY_SUPPORT == 1) + if(pMgntInfo->IntelClassModeInfo.bEnableCA == TRUE) + { + (*EDCA_BE_UL) = (*EDCA_BE_DL) = 0xa44f; + } + else + #endif + { + if((pMgntInfo->IOTAction & (HT_IOT_ACT_FORCED_ENABLE_BE_TXOP|HT_IOT_ACT_AMSDU_ENABLE))) + {// To check whether we shall force turn on TXOP configuration. + if(!((*EDCA_BE_UL) & 0xffff0000)) + (*EDCA_BE_UL) |= 0x005e0000; // Force TxOP limit to 0x005e for UL. + if(!((*EDCA_BE_DL) & 0xffff0000)) + (*EDCA_BE_DL) |= 0x005e0000; // Force TxOP limit to 0x005e for DL. + } + + //92D txop can't be set to 0x3e for cisco1250 + if((ICType!=ODM_RTL8192D) && (IOTPeer== HT_IOT_PEER_CISCO) &&(WirelessMode==ODM_WM_N24G)) + { + (*EDCA_BE_DL) = edca_setting_DL[IOTPeer]; + (*EDCA_BE_UL) = edca_setting_UL[IOTPeer]; + } + //merge from 92s_92c_merge temp brunch v2445 20120215 + else if((IOTPeer == HT_IOT_PEER_CISCO) &&((WirelessMode==ODM_WM_G)||(WirelessMode==(ODM_WM_B|ODM_WM_G))||(WirelessMode==ODM_WM_A)||(WirelessMode==ODM_WM_B))) + { + (*EDCA_BE_DL) = edca_setting_DL_GMode[IOTPeer]; + } + else if((IOTPeer== HT_IOT_PEER_AIRGO )&& ((WirelessMode==ODM_WM_G)||(WirelessMode==ODM_WM_A))) + { + (*EDCA_BE_DL) = 0xa630; + } + + else if(IOTPeer == HT_IOT_PEER_MARVELL) + { + (*EDCA_BE_DL) = edca_setting_DL[IOTPeer]; + (*EDCA_BE_UL) = edca_setting_UL[IOTPeer]; + } + else if(IOTPeer == HT_IOT_PEER_ATHEROS) + { + // Set DL EDCA for Atheros peer to 0x3ea42b. Suggested by SD3 Wilson for ASUS TP issue. + if(WirelessMode==ODM_WM_G) + (*EDCA_BE_DL) = edca_setting_DL_GMode[IOTPeer]; + else + (*EDCA_BE_DL) = edca_setting_DL[IOTPeer]; + + if(ICType == ODM_RTL8821) + (*EDCA_BE_DL) = 0x5ea630; + + } + } + + if((ICType == ODM_RTL8192D)&&(IOTPeerSubType == HT_IOT_PEER_LINKSYS_E4200_V1)&&((WirelessMode==ODM_WM_N5G))) + { + (*EDCA_BE_DL) = 0x432b; + (*EDCA_BE_UL) = 0x432b; + } + + + + if((ICType==ODM_RTL8812)||(ICType==ODM_RTL8192E)) //add 8812AU/8812AE + { + (*EDCA_BE_UL) = 0x5ea42b; + (*EDCA_BE_DL) = 0x5ea42b; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("8812A: EDCA_BE_UL=0x%lx EDCA_BE_DL =0x%lx",(*EDCA_BE_UL),(*EDCA_BE_DL))); + } + + // Revised for Atheros DIR-655 IOT issue to improve down link TP, added by Roger, 2013.03.22. + if((ICType == ODM_RTL8723A) && (IOTPeerSubType== HT_IOT_PEER_ATHEROS_DIR655) && + (pMgntInfo->dot11CurrentChannelNumber == 6)) + { + (*EDCA_BE_DL) = 0xa92b; + } + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("Special: EDCA_BE_UL=0x%lx EDCA_BE_DL =0x%lx",(*EDCA_BE_UL),(*EDCA_BE_DL))); + +} + + +VOID +odm_EdcaChooseTrafficIdx( + IN PVOID pDM_VOID, + IN u8Byte cur_tx_bytes, + IN u8Byte cur_rx_bytes, + IN BOOLEAN bBiasOnRx, + OUT BOOLEAN *pbIsCurRDLState + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + + if(bBiasOnRx) + { + + if(cur_tx_bytes>(cur_rx_bytes*4)) + { + *pbIsCurRDLState=FALSE; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("Uplink Traffic\n ")); + + } + else + { + *pbIsCurRDLState=TRUE; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("Balance Traffic\n")); + + } + } + else + { + if(cur_rx_bytes>(cur_tx_bytes*4)) + { + *pbIsCurRDLState=TRUE; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("Downlink Traffic\n")); + + } + else + { + *pbIsCurRDLState=FALSE; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_EDCA_TURBO,ODM_DBG_LOUD,("Balance Traffic\n")); + } + } + + return ; +} + +#endif + + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_EdcaTurboCheck.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_EdcaTurboCheck.h new file mode 100644 index 00000000000000..dce861a3053bb5 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_EdcaTurboCheck.h @@ -0,0 +1,99 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +#ifndef __PHYDMEDCATURBOCHECK_H__ +#define __PHYDMEDCATURBOCHECK_H__ + +#define EDCATURBO_VERSION "2.0" + +typedef struct _EDCA_TURBO_ +{ + BOOLEAN bCurrentTurboEDCA; + BOOLEAN bIsCurRDLState; + + #if(DM_ODM_SUPPORT_TYPE == ODM_CE ) + u4Byte prv_traffic_idx; // edca turbo + #endif + +}EDCA_T,*pEDCA_T; + +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) +static u4Byte edca_setting_UL[HT_IOT_PEER_MAX] = +// UNKNOWN REALTEK_90 REALTEK_92SE BROADCOM RALINK ATHEROS CISCO MERU MARVELL 92U_AP SELF_AP(DownLink/Tx) +{ 0x5e4322, 0xa44f, 0x5e4322, 0x5ea32b, 0x5ea422, 0x5ea322, 0x3ea430, 0x5ea42b, 0x5ea44f, 0x5e4322, 0x5e4322}; + + +static u4Byte edca_setting_DL[HT_IOT_PEER_MAX] = +// UNKNOWN REALTEK_90 REALTEK_92SE BROADCOM RALINK ATHEROS CISCO MERU, MARVELL 92U_AP SELF_AP(UpLink/Rx) +{ 0xa44f, 0x5ea44f, 0x5e4322, 0x5ea42b, 0xa44f, 0xa630, 0x5ea630, 0x5ea42b, 0xa44f, 0xa42b, 0xa42b}; + +static u4Byte edca_setting_DL_GMode[HT_IOT_PEER_MAX] = +// UNKNOWN REALTEK_90 REALTEK_92SE BROADCOM RALINK ATHEROS CISCO MERU, MARVELL 92U_AP SELF_AP +{ 0x4322, 0xa44f, 0x5e4322, 0xa42b, 0x5e4322, 0x4322, 0xa42b, 0x5ea42b, 0xa44f, 0x5e4322, 0x5ea42b}; + +#endif + + + +VOID +odm_EdcaTurboCheck( + IN PVOID pDM_VOID + ); +VOID +ODM_EdcaTurboInit( + IN PVOID pDM_VOID +); + +#if(DM_ODM_SUPPORT_TYPE==ODM_WIN) +VOID +odm_EdcaTurboCheckMP( + IN PVOID pDM_VOID + ); + +//check if edca turbo is disabled +BOOLEAN +odm_IsEdcaTurboDisable( + IN PVOID pDM_VOID +); +//choose edca paramter for special IOT case +VOID +ODM_EdcaParaSelByIot( + IN PVOID pDM_VOID, + OUT u4Byte *EDCA_BE_UL, + OUT u4Byte *EDCA_BE_DL + ); +//check if it is UL or DL +VOID +odm_EdcaChooseTrafficIdx( + IN PVOID pDM_VOID, + IN u8Byte cur_tx_bytes, + IN u8Byte cur_rx_bytes, + IN BOOLEAN bBiasOnRx, + OUT BOOLEAN *pbIsCurRDLState + ); + +#elif (DM_ODM_SUPPORT_TYPE==ODM_CE) +VOID +odm_EdcaTurboCheckCE( + IN PVOID pDM_VOID + ); +#endif + +#endif diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_HWConfig.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_HWConfig.c old mode 100755 new mode 100644 similarity index 71% rename from backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_HWConfig.c rename to backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_HWConfig.c index 0d5ba4bbffe8dc..f54beb67605e9b --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_HWConfig.c +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_HWConfig.c @@ -22,8 +22,8 @@ // include files //============================================================ - -#include "odm_precomp.h" +#include "Mp_Precomp.h" +#include "phydm_precomp.h" #define READ_AND_CONFIG_MP(ic, txt) (ODM_ReadAndConfig_MP_##ic##txt(pDM_Odm)) #define READ_AND_CONFIG_TC(ic, txt) (ODM_ReadAndConfig_TC_##ic##txt(pDM_Odm)) @@ -57,14 +57,7 @@ #define GET_VERSION_MP(ic, txt) (ODM_GetVersion_MP_##ic##txt()) #define GET_VERSION_TC(ic, txt) (ODM_GetVersion_TC_##ic##txt()) - -#define GET_VERSION(ic, txt) do {\ - if (pDM_Odm->bIsMPChip)\ - GET_VERSION_MP(ic,txt);\ - else\ - GET_VERSION_TC(ic,txt);\ - } while(0) - +#define GET_VERSION(ic, txt) (pDM_Odm->bIsMPChip?GET_VERSION_MP(ic,txt):GET_VERSION_TC(ic,txt)) u1Byte odm_QueryRxPwrPercentage( @@ -577,9 +570,19 @@ odm_EVMdbToPercentage( //DbgPrint("Value=%d\n", Value); //ODM_RT_DISP(FRX, RX_PHY_SQ, ("EVMdbToPercentage92C Value=%d / %x \n", ret_val, ret_val)); + #ifdef ODM_EVM_ENHANCE_ANTDIV if(ret_val >= 0) ret_val = 0; + if(ret_val <= -40) + ret_val = -40; + + ret_val = 0 - ret_val; + ret_val*=3; + + #else + if(ret_val >= 0) + ret_val = 0; if(ret_val <= -33) ret_val = -33; @@ -588,6 +591,7 @@ odm_EVMdbToPercentage( if(ret_val == 99) ret_val = 100; + #endif return(ret_val); } @@ -630,7 +634,7 @@ odm_Cfo( return ret_val; } - +#if(ODM_IC_11N_SERIES_SUPPORT == 1) VOID odm_RxPhyStatus92CSeries_Parsing( IN OUT PDM_ODM_T pDM_Odm, @@ -682,60 +686,60 @@ odm_RxPhyStatus92CSeries_Parsing( VGA_idx = (cck_agc_rpt & 0x1F); if(pDM_Odm->SupportICType & (ODM_RTL8188E|ODM_RTL8192E)) { - switch(LNA_idx) - { - case 7: - if(VGA_idx <= 27) - rx_pwr_all = -100 + 2*(27-VGA_idx); //VGA_idx = 27~2 - else - rx_pwr_all = -100; - break; - case 6: - rx_pwr_all = -48 + 2*(2-VGA_idx); //VGA_idx = 2~0 - break; - case 5: - rx_pwr_all = -42 + 2*(7-VGA_idx); //VGA_idx = 7~5 - break; - case 4: - rx_pwr_all = -36 + 2*(7-VGA_idx); //VGA_idx = 7~4 - break; - case 3: - //rx_pwr_all = -28 + 2*(7-VGA_idx); //VGA_idx = 7~0 - rx_pwr_all = -24 + 2*(7-VGA_idx); //VGA_idx = 7~0 - break; - case 2: - if(cck_highpwr) - rx_pwr_all = -12 + 2*(5-VGA_idx); //VGA_idx = 5~0 - else - rx_pwr_all = -6+ 2*(5-VGA_idx); - break; - case 1: - rx_pwr_all = 8-2*VGA_idx; - break; - case 0: - rx_pwr_all = 14-2*VGA_idx; - break; - default: - //DbgPrint("CCK Exception default\n"); - break; - } - rx_pwr_all += 6; + switch(LNA_idx) + { + case 7: + if(VGA_idx <= 27) + rx_pwr_all = -100 + 2*(27-VGA_idx); //VGA_idx = 27~2 + else + rx_pwr_all = -100; + break; + case 6: + rx_pwr_all = -48 + 2*(2-VGA_idx); //VGA_idx = 2~0 + break; + case 5: + rx_pwr_all = -42 + 2*(7-VGA_idx); //VGA_idx = 7~5 + break; + case 4: + rx_pwr_all = -36 + 2*(7-VGA_idx); //VGA_idx = 7~4 + break; + case 3: + //rx_pwr_all = -28 + 2*(7-VGA_idx); //VGA_idx = 7~0 + rx_pwr_all = -24 + 2*(7-VGA_idx); //VGA_idx = 7~0 + break; + case 2: + if(cck_highpwr) + rx_pwr_all = -12 + 2*(5-VGA_idx); //VGA_idx = 5~0 + else + rx_pwr_all = -6+ 2*(5-VGA_idx); + break; + case 1: + rx_pwr_all = 8-2*VGA_idx; + break; + case 0: + rx_pwr_all = 14-2*VGA_idx; + break; + default: + //DbgPrint("CCK Exception default\n"); + break; + } + rx_pwr_all += 6; - //2012.10.08 LukeLee: Modify for 92E CCK RSSI - if(pDM_Odm->SupportICType == ODM_RTL8192E) - rx_pwr_all += 10; - - PWDB_ALL = odm_QueryRxPwrPercentage(rx_pwr_all); - if(cck_highpwr == FALSE) - { - if(PWDB_ALL >= 80) - PWDB_ALL = ((PWDB_ALL-80)<<1)+((PWDB_ALL-80)>>1)+80; - else if((PWDB_ALL <= 78) && (PWDB_ALL >= 20)) - PWDB_ALL += 3; - if(PWDB_ALL>100) - PWDB_ALL = 100; + //2012.10.08 LukeLee: Modify for 92E CCK RSSI + if(pDM_Odm->SupportICType == ODM_RTL8192E) + rx_pwr_all += 10; + + PWDB_ALL = odm_QueryRxPwrPercentage(rx_pwr_all); + if(cck_highpwr == FALSE) + { + if(PWDB_ALL >= 80) + PWDB_ALL = ((PWDB_ALL-80)<<1)+((PWDB_ALL-80)>>1)+80; + else if((PWDB_ALL <= 78) && (PWDB_ALL >= 20)) + PWDB_ALL += 3; + if(PWDB_ALL>100) + PWDB_ALL = 100; + } } - } else if(pDM_Odm->SupportICType & (ODM_RTL8723B)) { #if (RTL8723B_SUPPORT == 1) @@ -832,7 +836,7 @@ odm_RxPhyStatus92CSeries_Parsing( // // (3) Get Signal Quality (EVM) // - if(pPktinfo->bPacketMatchBSSID) + //if(pPktinfo->bPacketMatchBSSID) { u1Byte SQ,SQ_rpt; @@ -866,7 +870,7 @@ odm_RxPhyStatus92CSeries_Parsing( pPhyInfo->RxMIMOSignalQuality[ODM_RF_PATH_B] = -1; } } - else //is OFDM rate + else //2 is OFDM rate { pDM_Odm->PhyDbgInfo.NumQryPhyStatusOFDM++; @@ -884,7 +888,6 @@ odm_RxPhyStatus92CSeries_Parsing( rx_pwr[i] = ((pPhyStaRpt->path_agc[i].gain& 0x3F)*2) - 110; - #if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) pPhyInfo->RxPwr[i] = rx_pwr[i]; #endif @@ -894,9 +897,10 @@ odm_RxPhyStatus92CSeries_Parsing( total_rssi += RSSI; //RT_DISP(FRX, RX_PHY_SS, ("RF-%d RXPWR=%x RSSI=%d\n", i, rx_pwr[i], RSSI)); - //Modification for ext-LNA board + if(pDM_Odm->SupportICType&ODM_RTL8192C) { + //Modification for ext-LNA board if(pDM_Odm->BoardType & (ODM_BOARD_EXT_LNA | ODM_BOARD_EXT_PA)) { if((pPhyStaRpt->path_agc[i].trsw) == 1) @@ -911,14 +915,15 @@ odm_RxPhyStatus92CSeries_Parsing( pPhyInfo->RxMIMOSignalStrength[i] =(u1Byte) RSSI; - #if (DM_ODM_SUPPORT_TYPE & (/*ODM_WIN|*/ODM_CE|ODM_AP|ODM_ADSL)) + #if (DM_ODM_SUPPORT_TYPE & (/*ODM_WIN|*/ODM_CE|ODM_AP)) //Get Rx snr value in DB pPhyInfo->RxSNR[i] = pDM_Odm->PhyDbgInfo.RxSNRdB[i] = (s4Byte)(pPhyStaRpt->path_rxsnr[i]/2); #endif /* Record Signal Strength for next packet */ - if(pPktinfo->bPacketMatchBSSID) + //if(pPktinfo->bPacketMatchBSSID) { +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) if((pDM_Odm->SupportPlatform == ODM_WIN) && (pDM_Odm->PatchID==RT_CID_819x_Lenovo)) { @@ -931,7 +936,7 @@ odm_RxPhyStatus92CSeries_Parsing( { pPhyInfo->SignalQuality = odm_SQ_process_patch_RT_CID_819x_Acer(pDM_Odm,isCCKrate,PWDB_ALL,0,RSSI); } - +#endif } } @@ -942,7 +947,7 @@ odm_RxPhyStatus92CSeries_Parsing( rx_pwr_all = (((pPhyStaRpt->cck_sig_qual_ofdm_pwdb_all) >> 1 )& 0x7f) -110; PWDB_ALL_BT = PWDB_ALL = odm_QueryRxPwrPercentage(rx_pwr_all); - //RT_DISP(FRX, RX_PHY_SS, ("PWDB_ALL=%d\n",PWDB_ALL)); + pPhyInfo->RxPWDBAll = PWDB_ALL; //ODM_RT_TRACE(pDM_Odm,ODM_COMP_RSSI_MONITOR, ODM_DBG_LOUD, ("ODM OFDM RSSI=%d\n",pPhyInfo->RxPWDBAll)); @@ -973,10 +978,9 @@ odm_RxPhyStatus92CSeries_Parsing( // value to positive one, then the dbm value (which is supposed to be negative) is not correct anymore. EVM = odm_EVMdbToPercentage( (pPhyStaRpt->stream_rxevm[i] )); //dbm - //RT_DISP(FRX, RX_PHY_SQ, ("RXRATE=%x RXEVM=%x EVM=%s%d\n", //GET_RX_STATUS_DESC_RX_MCS(pDesc), pDrvInfo->rxevm[i], "%", EVM)); - if(pPktinfo->bPacketMatchBSSID) + //if(pPktinfo->bPacketMatchBSSID) { if(i==ODM_RF_PATH_A) // Fill value in RFD, Get the first spatial stream only { @@ -987,29 +991,7 @@ odm_RxPhyStatus92CSeries_Parsing( } } - //2 For dynamic ATC switch - if(pDM_Odm->SupportAbility & ODM_BB_DYNAMIC_ATC) - { - if(pPktinfo->bPacketMatchBSSID && ( *(pDM_Odm->mp_mode) == 0)) - { - // TODO: - - //3 Update CFO report for path-A & path-B - for(i = ODM_RF_PATH_A; i < ODM_RF_PATH_MAX; i++) - { - pDM_Odm->CFO_tail[i] = (int)pPhyStaRpt->path_cfotail[i]; - } - - //3 Update packet counter - if(pDM_Odm->packetCount == 0xffffffff) - pDM_Odm->packetCount = 0; - else - pDM_Odm->packetCount++; - - //ODM_RT_TRACE(pDM_Odm, ODM_COMP_DYNAMIC_ATC, ODM_DBG_LOUD, - //("pPhyStaRpt->path_cfotail[i] = 0x%x, pDM_Odm->CFO_tail[i] = 0x%x\n", pPhyStaRpt->path_cfotail[0], pDM_Odm->CFO_tail[1])); - } - } + ODM_ParsingCFO(pDM_Odm, pPktinfo, pPhyStaRpt->path_cfotail); } #if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) @@ -1020,8 +1002,12 @@ odm_RxPhyStatus92CSeries_Parsing( #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) // 2012/01/12 MH Use customeris signal strength from HalComRxdDesc.c/ pPhyInfo->SignalStrength = (u1Byte)(SignalScaleMapping(pDM_Odm->Adapter, PWDB_ALL));//PWDB_ALL; +#else +#ifdef CONFIG_SKIP_SIGNAL_SCALE_MAPPING + pPhyInfo->SignalStrength = (u1Byte)PWDB_ALL; #else pPhyInfo->SignalStrength = (u1Byte)(odm_SignalScaleMapping(pDM_Odm, PWDB_ALL));//PWDB_ALL; +#endif #endif } else @@ -1031,13 +1017,20 @@ odm_RxPhyStatus92CSeries_Parsing( #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) // 2012/01/12 MH Use customeris signal strength from HalComRxdDesc.c/ pPhyInfo->SignalStrength = (u1Byte)(SignalScaleMapping(pDM_Odm->Adapter, total_rssi/=rf_rx_num));//PWDB_ALL; +#else +#ifdef CONFIG_SKIP_SIGNAL_SCALE_MAPPING + total_rssi/=rf_rx_num; + pPhyInfo->SignalStrength = (u1Byte)total_rssi; #else pPhyInfo->SignalStrength = (u1Byte)(odm_SignalScaleMapping(pDM_Odm, total_rssi/=rf_rx_num)); +#endif #endif } } #endif + //DbgPrint("pPhyInfo->RxPWDBAll=%d\n", pPhyInfo->RxPWDBAll); + //DbgPrint("pPhyInfo->SignalStrength=%d\n", pPhyInfo->SignalStrength); //DbgPrint("isCCKrate = %d, pPhyInfo->RxPWDBAll = %d, pPhyStaRpt->cck_agc_rpt_ofdm_cfosho_a = 0x%x\n", //isCCKrate, pPhyInfo->RxPWDBAll, pPhyStaRpt->cck_agc_rpt_ofdm_cfosho_a); @@ -1050,6 +1043,7 @@ odm_RxPhyStatus92CSeries_Parsing( pDM_Odm->DM_FatTable.antsel_rx_keep_2 = pPhyStaRpt->antsel_rx_keep_2; #endif } +#endif #if ODM_IC_11AC_SERIES_SUPPORT @@ -1122,9 +1116,9 @@ odm_RxPhyStatusJaguarSeries_Parsing( // cck_highpwr = FALSE; cck_agc_rpt = pPhyStaRpt->cfosho[0] ; - LNA_idx = ((cck_agc_rpt & 0xE0) >>5); VGA_idx = (cck_agc_rpt & 0x1F); + if(pDM_Odm->SupportICType == ODM_RTL8812) { switch(LNA_idx) @@ -1166,6 +1160,7 @@ odm_RxPhyStatusJaguarSeries_Parsing( } rx_pwr_all += 6; PWDB_ALL = odm_QueryRxPwrPercentage(rx_pwr_all); + if(cck_highpwr == FALSE) { if(PWDB_ALL >= 80) @@ -1214,18 +1209,21 @@ odm_RxPhyStatusJaguarSeries_Parsing( // // (3) Get Signal Quality (EVM) // - if(pPktinfo->bPacketMatchBSSID) + //if(pPktinfo->bPacketMatchBSSID) { u1Byte SQ,SQ_rpt; if((pDM_Odm->SupportPlatform == ODM_WIN) && - (pDM_Odm->PatchID==RT_CID_819x_Lenovo)){ + (pDM_Odm->PatchID==RT_CID_819x_Lenovo)) + { SQ = odm_SQ_process_patch_RT_CID_819x_Lenovo(pDM_Odm,isCCKrate,PWDB_ALL,0,0); } - else if(pPhyInfo->RxPWDBAll > 40 && !pDM_Odm->bInHctTest){ + else if(pPhyInfo->RxPWDBAll > 40 && !pDM_Odm->bInHctTest) + { SQ = 100; } - else{ + else + { SQ_rpt = pPhyStaRpt->pwdb_all; if(SQ_rpt > 64) @@ -1293,7 +1291,7 @@ odm_RxPhyStatusJaguarSeries_Parsing( pPhyInfo->Cfo_tail[i] = odm_Cfo( (pPhyStaRpt->cfotail[i]) ); /* Record Signal Strength for next packet */ - if(pPktinfo->bPacketMatchBSSID) + //if(pPktinfo->bPacketMatchBSSID) { if((pDM_Odm->SupportPlatform == ODM_WIN) && (pDM_Odm->PatchID==RT_CID_819x_Lenovo)) @@ -1315,10 +1313,8 @@ odm_RxPhyStatusJaguarSeries_Parsing( else rx_pwr_all = (((pPhyStaRpt->pwdb_all) >> 1 )& 0x7f) -110; //OLD FORMULA - PWDB_ALL_BT = PWDB_ALL = odm_QueryRxPwrPercentage(rx_pwr_all); - pPhyInfo->RxPWDBAll = PWDB_ALL; //ODM_RT_TRACE(pDM_Odm,ODM_COMP_RSSI_MONITOR, ODM_DBG_LOUD, ("ODM OFDM RSSI=%d\n",pPhyInfo->RxPWDBAll)); #if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) @@ -1327,14 +1323,12 @@ odm_RxPhyStatusJaguarSeries_Parsing( pPhyInfo->RecvSignalPower = rx_pwr_all; #endif - //DbgPrint("OFDM: pPhyInfo->RxPWDBAll = %d, pPhyInfo->RxMIMOSignalStrength[0] = %d, pPhyInfo->RxMIMOSignalStrength[1] = %d\n", - // pPhyInfo->RxPWDBAll, pPhyInfo->RxMIMOSignalStrength[0], pPhyInfo->RxMIMOSignalStrength[1]); - - - if((pDM_Odm->SupportPlatform == ODM_WIN) &&(pDM_Odm->PatchID==19)){ + if((pDM_Odm->SupportPlatform == ODM_WIN) &&(pDM_Odm->PatchID==19)) + { //do nothing } - else{//pMgntInfo->CustomerID != RT_CID_819x_Lenovo + else + { //pMgntInfo->CustomerID != RT_CID_819x_Lenovo // // (4)EVM of OFDM rate // @@ -1347,7 +1341,7 @@ odm_RxPhyStatusJaguarSeries_Parsing( else Max_spatial_stream = 1; - if(pPktinfo->bPacketMatchBSSID) + //if(pPktinfo->bPacketMatchBSSID) { //DbgPrint("pPktinfo->DataRate = %d\n", pPktinfo->DataRate); @@ -1386,7 +1380,6 @@ odm_RxPhyStatusJaguarSeries_Parsing( //RT_DISP(FRX, RX_PHY_SQ, ("RXRATE=%x RXEVM=%x EVM=%s%d\n", //pPktinfo->DataRate, pPhyStaRpt->rxevm[i], "%", EVM)); - { if(i==ODM_RF_PATH_A) // Fill value in RFD, Get the first spatial stream only { @@ -1398,27 +1391,9 @@ odm_RxPhyStatusJaguarSeries_Parsing( } } } - //2 For dynamic ATC switch - if(pDM_Odm->SupportAbility & ODM_BB_DYNAMIC_ATC) - { - if(pPktinfo->bPacketMatchBSSID && ( *(pDM_Odm->mp_mode) == 0) ) - { - //3 Update CFO report for path-A & path-B - for(i = ODM_RF_PATH_A; i < ODM_RF_PATH_MAX; i++) - { - pDM_Odm->CFO_tail[i] = (int)pPhyStaRpt->cfotail[i]; - } - //3 Update packet counter - if(pDM_Odm->packetCount == 0xffffffff) - pDM_Odm->packetCount = 0; - else - pDM_Odm->packetCount++; - - //ODM_RT_TRACE(pDM_Odm, ODM_COMP_DYNAMIC_ATC, ODM_DBG_LOUD, - //("pPhyStaRpt->path_cfotail[i] = 0x%x, pDM_Odm->CFO_tail[i] = 0x%x\n", pPhyStaRpt->path_cfotail[0], pDM_Odm->CFO_tail[1])); - } - } + ODM_ParsingCFO(pDM_Odm, pPktinfo, pPhyStaRpt->cfotail); + } //DbgPrint("isCCKrate= %d, pPhyInfo->SignalStrength=%d % PWDB_AL=%d rf_rx_num=%d\n", isCCKrate, pPhyInfo->SignalStrength, PWDB_ALL, rf_rx_num); @@ -1483,16 +1458,21 @@ odm_Process_RSSIForDM( { s4Byte UndecoratedSmoothedPWDB, UndecoratedSmoothedCCK, UndecoratedSmoothedOFDM, RSSI_Ave; - u1Byte isCCKrate=0; - u1Byte RSSI_max, RSSI_min, i; + u1Byte i, isCCKrate=0; + u1Byte RSSI_max, RSSI_min; u4Byte OFDM_pkt=0; u4Byte Weighting=0; PSTA_INFO_T pEntry; - - if(pPktinfo->StationID == 0xFF) + if (pPktinfo->StationID >= ODM_ASSOCIATE_ENTRY_NUM) return; +#if (RTL8723B_SUPPORT == 1)||(RTL8821A_SUPPORT == 1) +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + odm_S0S1_SwAntDivByCtrlFrame_ProcessRSSI(pDM_Odm, pPhyInfo, pPktinfo); +#endif +#endif + // // 2012/05/30 MH/Luke.Lee Add some description // In windows driver: AP/IBSS mode STA @@ -1504,9 +1484,11 @@ odm_Process_RSSIForDM( //else pEntry = pDM_Odm->pODM_StaInfo[pPktinfo->StationID]; - if(!IS_STA_VALID(pEntry) ){ + if(!IS_STA_VALID(pEntry) ) + { return; } + if((!pPktinfo->bPacketMatchBSSID) ) { return; @@ -1532,22 +1514,12 @@ odm_Process_RSSIForDM( ODM_Process_RSSIForAntDiv(pDM_Odm,pPhyInfo,pPktinfo); #endif } + #if(defined(CONFIG_PATH_DIVERSITY)) else if(pDM_Odm->SupportAbility & ODM_BB_PATH_DIV) { - #if (RTL8812A_SUPPORT == 1) - if(pDM_Odm->SupportICType == ODM_RTL8812) - { - pPATHDIV_T pDM_PathDiv = &pDM_Odm->DM_PathDiv; - if(pPktinfo->bPacketToSelf || pPktinfo->bPacketMatchBSSID) - { - if(pPktinfo->DataRate > DESC_RATE11M) - ODM_PathStatistics_8812A(pDM_Odm, pPktinfo->StationID, pPhyInfo->RxMIMOSignalStrength[ODM_RF_PATH_A], - pPhyInfo->RxMIMOSignalStrength[ODM_RF_PATH_B]); - } - } - #endif + phydm_process_rssi_for_path_div(pDM_Odm,pPhyInfo,pPktinfo); } - + #endif //-----------------Smart Antenna Debug Message------------------// UndecoratedSmoothedCCK = pEntry->rssi_stat.UndecoratedSmoothedCCK; @@ -1559,7 +1531,8 @@ odm_Process_RSSIForDM( if(!isCCKrate)//ofdm rate { - if(pPhyInfo->RxMIMOSignalStrength[ODM_RF_PATH_B] == 0){ + if(pPhyInfo->RxMIMOSignalStrength[ODM_RF_PATH_B] == 0) + { RSSI_Ave = pPhyInfo->RxMIMOSignalStrength[ODM_RF_PATH_A]; pDM_Odm->RSSI_A = pPhyInfo->RxMIMOSignalStrength[ODM_RF_PATH_A]; pDM_Odm->RSSI_B = 0; @@ -1620,7 +1593,7 @@ odm_Process_RSSIForDM( { RSSI_Ave = pPhyInfo->RxPWDBAll; pDM_Odm->RSSI_A = (u1Byte) pPhyInfo->RxPWDBAll; - pDM_Odm->RSSI_B = 0xFF; + pDM_Odm->RSSI_B = 0; //1 Process CCK RSSI if(UndecoratedSmoothedCCK <= 0) // initialize @@ -1684,6 +1657,7 @@ odm_Process_RSSIForDM( } +#if(ODM_IC_11N_SERIES_SUPPORT ==1) // // Endianness before calling this API // @@ -1695,7 +1669,7 @@ ODM_PhyStatusQuery_92CSeries( IN PODM_PACKET_INFO_T pPktinfo ) { - + odm_RxPhyStatus92CSeries_Parsing( pDM_Odm, pPhyInfo, @@ -1720,21 +1694,25 @@ ODM_PhyStatusQuery_92CSeries( //odm_SwAntDivRSSICheck8192C(padapter, precvframe->u.hdr.attrib.RxPWDBAll); #endif */ +#if (RTL8192C_SUPPORT == 1) ODM_SwAntDivChkPerPktRssi(pDM_Odm,pPktinfo->StationID,pPhyInfo); +#endif } } else { odm_Process_RSSIForDM(pDM_Odm,pPhyInfo,pPktinfo); } - -} +} +#endif // // Endianness before calling this API // +#if(ODM_IC_11AC_SERIES_SUPPORT == 1) + VOID ODM_PhyStatusQuery_JaguarSeries( IN OUT PDM_ODM_T pDM_Odm, @@ -1750,7 +1728,11 @@ ODM_PhyStatusQuery_JaguarSeries( pPktinfo); odm_Process_RSSIForDM(pDM_Odm,pPhyInfo,pPktinfo); +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + //phydm_sbd_check(pDM_Odm); +#endif } +#endif VOID ODM_PhyStatusQuery( @@ -1760,15 +1742,15 @@ ODM_PhyStatusQuery( IN PODM_PACKET_INFO_T pPktinfo ) { - +#if(ODM_IC_11AC_SERIES_SUPPORT == 1) if(pDM_Odm->SupportICType & ODM_IC_11AC_SERIES ) - { ODM_PhyStatusQuery_JaguarSeries(pDM_Odm,pPhyInfo,pPhyStatus,pPktinfo); - } - else - { +#endif + +#if(ODM_IC_11N_SERIES_SUPPORT ==1) + if(pDM_Odm->SupportICType & ODM_IC_11N_SERIES ) ODM_PhyStatusQuery_92CSeries(pDM_Odm,pPhyInfo,pPhyStatus,pPktinfo); - } +#endif } // For future use. @@ -1799,78 +1781,73 @@ ODM_ConfigRFWithHeaderFile( IN ODM_RF_RADIO_PATH_E eRFPath ) { - PADAPTER Adapter = pDM_Odm->Adapter; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===>ODM_ConfigRFWithHeaderFile (%s)\n", (pDM_Odm->bIsMPChip) ? "MPChip" : "TestChip")); ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("pDM_Odm->SupportPlatform: 0x%X, pDM_Odm->SupportInterface: 0x%X, pDM_Odm->BoardType: 0x%X\n", pDM_Odm->SupportPlatform, pDM_Odm->SupportInterface, pDM_Odm->BoardType)); +//1 AP doesn't use PHYDM power tracking table in these ICs +#if (DM_ODM_SUPPORT_TYPE != ODM_AP) #if (RTL8723A_SUPPORT == 1) if (pDM_Odm->SupportICType == ODM_RTL8723A) { if(ConfigType == CONFIG_RF_RADIO) { if(eRFPath == ODM_RF_PATH_A) - READ_AND_CONFIG_MP(8723A,_RadioA_1T); - } - } -#endif - -#if (RTL8188E_SUPPORT == 1) - if (pDM_Odm->SupportICType == ODM_RTL8188E) - { - if(ConfigType == CONFIG_RF_RADIO) { - if(eRFPath == ODM_RF_PATH_A){ - if(IS_VENDOR_8188E_I_CUT_SERIES(Adapter)) - READ_AND_CONFIG(8188E,_RadioA_1T_ICUT); - else - READ_AND_CONFIG(8188E,_RadioA_1T); - } - } - else if(ConfigType == CONFIG_RF_TXPWR_LMT) { - READ_AND_CONFIG(8188E,_TXPWR_LMT); + READ_AND_CONFIG_MP(8723A,_RadioA); } } #endif - #if (RTL8812A_SUPPORT == 1) if (pDM_Odm->SupportICType == ODM_RTL8812) { if(ConfigType == CONFIG_RF_RADIO) { if(eRFPath == ODM_RF_PATH_A) - { - READ_AND_CONFIG(8812A,_RadioA); - } + READ_AND_CONFIG_MP(8812A,_RadioA); else if(eRFPath == ODM_RF_PATH_B) - { - READ_AND_CONFIG(8812A,_RadioB); - } + READ_AND_CONFIG_MP(8812A,_RadioB); } else if(ConfigType == CONFIG_RF_TXPWR_LMT) { - READ_AND_CONFIG(8812A,_TXPWR_LMT); + #if (DM_ODM_SUPPORT_TYPE & ODM_WIN) && (DEV_BUS_TYPE == RT_PCI_INTERFACE) + PADAPTER Adapter = pDM_Odm->Adapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + if ((pHalData->EEPROMSVID == 0x17AA && pHalData->EEPROMSMID == 0xA811) || + (pHalData->EEPROMSVID == 0x10EC && pHalData->EEPROMSMID == 0xA812) || + (pHalData->EEPROMSVID == 0x10EC && pHalData->EEPROMSMID == 0x8812)) + READ_AND_CONFIG_MP(8812A,_TXPWR_LMT_HM812A03); + #endif + READ_AND_CONFIG_MP(8812A,_TXPWR_LMT); } } #endif - #if (RTL8821A_SUPPORT == 1) if (pDM_Odm->SupportICType == ODM_RTL8821) { if(ConfigType == CONFIG_RF_RADIO) { if(eRFPath == ODM_RF_PATH_A) - { - READ_AND_CONFIG(8821A,_RadioA); - } + READ_AND_CONFIG_MP(8821A,_RadioA); } else if(ConfigType == CONFIG_RF_TXPWR_LMT) { + + if (pDM_Odm->SupportInterface == ODM_ITRF_USB) { if (pDM_Odm->ExtPA5G || pDM_Odm->ExtLNA5G) - READ_AND_CONFIG(8821A,_TXPWR_LMT_8811AU_FEM); + READ_AND_CONFIG_MP(8821A,_TXPWR_LMT_8811AU_FEM); + else + READ_AND_CONFIG_MP(8821A,_TXPWR_LMT_8811AU_IPA); + } + else { + #if (DM_ODM_SUPPORT_TYPE & ODM_WIN) + PADAPTER Adapter = pDM_Odm->Adapter; + PMGNT_INFO pMgntInfo = &(Adapter->MgntInfo); + if (pMgntInfo->CustomerID == RT_CID_8821AE_ASUS_MB) + READ_AND_CONFIG_MP(8821A,_TXPWR_LMT_8821A_SAR_8mm); + else if (pMgntInfo->CustomerID == RT_CID_8821AE_ASUS_NB) + READ_AND_CONFIG_MP(8821A,_TXPWR_LMT_8821A_SAR_5mm); else - READ_AND_CONFIG(8821A,_TXPWR_LMT_8811AU_IPA); - } else { - READ_AND_CONFIG(8821A,_TXPWR_LMT_8821A); + #endif + READ_AND_CONFIG_MP(8821A,_TXPWR_LMT_8821A); } } ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("<===8821_ODM_ConfigRFWithHeaderFile\n")); @@ -1880,12 +1857,10 @@ ODM_ConfigRFWithHeaderFile( #if (RTL8723B_SUPPORT == 1) if (pDM_Odm->SupportICType == ODM_RTL8723B) { - if(ConfigType == CONFIG_RF_RADIO) { - READ_AND_CONFIG(8723B,_RadioA); - } - else if(ConfigType == CONFIG_RF_TXPWR_LMT) { - READ_AND_CONFIG(8723B,_TXPWR_LMT); - } + if(ConfigType == CONFIG_RF_RADIO) + READ_AND_CONFIG_MP(8723B,_RadioA); + else if(ConfigType == CONFIG_RF_TXPWR_LMT) + READ_AND_CONFIG_MP(8723B,_TXPWR_LMT); } #endif @@ -1894,27 +1869,91 @@ ODM_ConfigRFWithHeaderFile( { if(ConfigType == CONFIG_RF_RADIO) { if(eRFPath == ODM_RF_PATH_A) - READ_AND_CONFIG(8192E,_RadioA); + READ_AND_CONFIG_MP(8192E,_RadioA); else if(eRFPath == ODM_RF_PATH_B) - READ_AND_CONFIG(8192E,_RadioB); - } - else if(ConfigType == CONFIG_RF_TXPWR_LMT) { - READ_AND_CONFIG(8192E,_TXPWR_LMT); + READ_AND_CONFIG_MP(8192E,_RadioB); } + else if(ConfigType == CONFIG_RF_TXPWR_LMT) + READ_AND_CONFIG_MP(8192E,_TXPWR_LMT); } #endif +#endif//(DM_ODM_SUPPORT_TYPE != ODM_AP) -#if (RTL8813A_SUPPORT == 1) - if (pDM_Odm->SupportICType == ODM_RTL8813A) +//1 All platforms support +#if (RTL8188E_SUPPORT == 1) + if (pDM_Odm->SupportICType == ODM_RTL8188E) { - /* - if(ConfigType == CONFIG_RF_TXPWR_LMT) { - READ_AND_CONFIG(8813A,_TXPWR_LMT); + if(ConfigType == CONFIG_RF_RADIO) { + if(eRFPath == ODM_RF_PATH_A) + READ_AND_CONFIG_MP(8188E,_RadioA); } - */ + else if(ConfigType == CONFIG_RF_TXPWR_LMT) + READ_AND_CONFIG_MP(8188E,_TXPWR_LMT); } #endif - +#if (RTL8814A_SUPPORT == 1) + if (pDM_Odm->SupportICType == ODM_RTL8814A) + { + if(ConfigType == CONFIG_RF_RADIO) { + if(eRFPath == ODM_RF_PATH_A) + READ_AND_CONFIG_MP(8814A,_RadioA); + else if(eRFPath == ODM_RF_PATH_B) + READ_AND_CONFIG_MP(8814A,_RadioB); + else if(eRFPath == ODM_RF_PATH_C) + READ_AND_CONFIG_MP(8814A,_RadioC); + else if(eRFPath == ODM_RF_PATH_D) + READ_AND_CONFIG_MP(8814A,_RadioD); + } + else if(ConfigType == CONFIG_RF_TXPWR_LMT) + READ_AND_CONFIG_MP(8814A,_TXPWR_LMT); + } +#endif + +//1 New ICs (WIN only) +#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) +#if (RTL8821B_SUPPORT == 1) + if (pDM_Odm->SupportICType == ODM_RTL8821B) + { + if (ConfigType == CONFIG_RF_RADIO) { + if (eRFPath == ODM_RF_PATH_A) + READ_AND_CONFIG(8821B, _RadioA); + } else if (ConfigType == CONFIG_RF_TXPWR_LMT) + READ_AND_CONFIG(8821B, _TXPWR_LMT); + } +#endif +#if (RTL8822B_SUPPORT == 1) + if (pDM_Odm->SupportICType == ODM_RTL8822B) + { + if(ConfigType == CONFIG_RF_RADIO) { + if(eRFPath == ODM_RF_PATH_A) + READ_AND_CONFIG_TC(8822B,_RadioA); + else if(eRFPath == ODM_RF_PATH_B) + READ_AND_CONFIG_TC(8822B,_RadioB); + } + } +#endif +#if (RTL8703B_SUPPORT == 1) + if (pDM_Odm->SupportICType == ODM_RTL8703B) + { + if(ConfigType == CONFIG_RF_RADIO) { + if(eRFPath == ODM_RF_PATH_A) + READ_AND_CONFIG_TC(8703B,_RadioA); + } + } +#endif +#if ((DEV_BUS_TYPE == RT_USB_INTERFACE) || (DEV_BUS_TYPE == RT_SDIO_INTERFACE)) +#if (RTL8188F_SUPPORT == 1) + if (pDM_Odm->SupportICType == ODM_RTL8188F) + { + if(ConfigType == CONFIG_RF_RADIO) { + if(eRFPath == ODM_RF_PATH_A) + READ_AND_CONFIG_TC(8188F,_RadioA); + } + } +#endif +#endif +#endif//(DM_ODM_SUPPORT_TYPE & ODM_WIN) + return HAL_STATUS_SUCCESS; } @@ -1929,63 +1968,105 @@ ODM_ConfigRFWithTxPwrTrackHeaderFile( ("pDM_Odm->SupportPlatform: 0x%X, pDM_Odm->SupportInterface: 0x%X, pDM_Odm->BoardType: 0x%X\n", pDM_Odm->SupportPlatform, pDM_Odm->SupportInterface, pDM_Odm->BoardType)); - if(0) - { - } -#if (RTL8821A_SUPPORT == 1) - else if(pDM_Odm->SupportICType == ODM_RTL8821) + +//1 AP doesn't use PHYDM power tracking table in these ICs +#if (DM_ODM_SUPPORT_TYPE != ODM_AP) +#if RTL8821A_SUPPORT + if(pDM_Odm->SupportICType == ODM_RTL8821) { if (pDM_Odm->SupportInterface == ODM_ITRF_PCIE) - READ_AND_CONFIG(8821A,_TxPowerTrack_PCIE); + READ_AND_CONFIG_MP(8821A,_TxPowerTrack_PCIE); else if (pDM_Odm->SupportInterface == ODM_ITRF_USB) - READ_AND_CONFIG(8821A,_TxPowerTrack_USB); - else - READ_AND_CONFIG(8821A,_TxPowerTrack_PCIE); + READ_AND_CONFIG_MP(8821A,_TxPowerTrack_USB); + else if (pDM_Odm->SupportInterface == ODM_ITRF_SDIO) + READ_AND_CONFIG_MP(8821A,_TxPowerTrack_SDIO); } -#endif -#if (RTL8812A_SUPPORT == 1) - else if(pDM_Odm->SupportICType == ODM_RTL8812) +#endif +#if RTL8812A_SUPPORT + if(pDM_Odm->SupportICType == ODM_RTL8812) { if (pDM_Odm->SupportInterface == ODM_ITRF_PCIE) - READ_AND_CONFIG(8812A,_TxPowerTrack_PCIE); + READ_AND_CONFIG_MP(8812A,_TxPowerTrack_PCIE); else if (pDM_Odm->SupportInterface == ODM_ITRF_USB) { if (pDM_Odm->RFEType == 3 && pDM_Odm->bIsMPChip) READ_AND_CONFIG_MP(8812A,_TxPowerTrack_RFE3); else - READ_AND_CONFIG(8812A,_TxPowerTrack_USB); + READ_AND_CONFIG_MP(8812A,_TxPowerTrack_USB); } } -#endif -#if (RTL8192E_SUPPORT == 1) - else if(pDM_Odm->SupportICType == ODM_RTL8192E) +#endif +#if RTL8192E_SUPPORT + if(pDM_Odm->SupportICType == ODM_RTL8192E) { if (pDM_Odm->SupportInterface == ODM_ITRF_PCIE) - READ_AND_CONFIG(8192E,_TxPowerTrack_PCIE); + READ_AND_CONFIG_MP(8192E,_TxPowerTrack_PCIE); else if (pDM_Odm->SupportInterface == ODM_ITRF_USB) - READ_AND_CONFIG(8192E,_TxPowerTrack_USB); + READ_AND_CONFIG_MP(8192E,_TxPowerTrack_USB); + else if (pDM_Odm->SupportInterface == ODM_ITRF_SDIO) + READ_AND_CONFIG_MP(8192E,_TxPowerTrack_SDIO); } #endif #if RTL8723B_SUPPORT - else if(pDM_Odm->SupportICType == ODM_RTL8723B) + if(pDM_Odm->SupportICType == ODM_RTL8723B) { if (pDM_Odm->SupportInterface == ODM_ITRF_PCIE) - READ_AND_CONFIG(8723B,_TxPowerTrack_PCIE); + READ_AND_CONFIG_MP(8723B,_TxPowerTrack_PCIE); else if (pDM_Odm->SupportInterface == ODM_ITRF_USB) - READ_AND_CONFIG(8723B,_TxPowerTrack_USB); + READ_AND_CONFIG_MP(8723B,_TxPowerTrack_USB); else if (pDM_Odm->SupportInterface == ODM_ITRF_SDIO) - READ_AND_CONFIG(8723B,_TxPowerTrack_SDIO); + READ_AND_CONFIG_MP(8723B,_TxPowerTrack_SDIO); } #endif #if RTL8188E_SUPPORT - else if(pDM_Odm->SupportICType == ODM_RTL8188E) + if(pDM_Odm->SupportICType == ODM_RTL8188E) { if (pDM_Odm->SupportInterface == ODM_ITRF_PCIE) - READ_AND_CONFIG(8188E,_TxPowerTrack_PCIE); + READ_AND_CONFIG_MP(8188E,_TxPowerTrack_PCIE); else if (pDM_Odm->SupportInterface == ODM_ITRF_USB) - READ_AND_CONFIG(8188E,_TxPowerTrack_USB); + READ_AND_CONFIG_MP(8188E,_TxPowerTrack_USB); + else if (pDM_Odm->SupportInterface == ODM_ITRF_SDIO) + READ_AND_CONFIG_MP(8188E,_TxPowerTrack_SDIO); + } +#endif +#endif//(DM_ODM_SUPPORT_TYPE != ODM_AP) + +//1 All platforms support +#if RTL8814A_SUPPORT + if(pDM_Odm->SupportICType == ODM_RTL8814A) + { + if(pDM_Odm->RFEType == 0) + READ_AND_CONFIG_MP(8814A,_TxPowerTrack_Type0); + else if(pDM_Odm->RFEType == 2) + READ_AND_CONFIG_MP(8814A,_TxPowerTrack_Type2); + else + READ_AND_CONFIG_MP(8814A,_TxPowerTrack); } +#endif + +//1 New ICs (WIN only) +#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) +#if RTL8821B_SUPPORT + if(pDM_Odm->SupportICType == ODM_RTL8821B) + READ_AND_CONFIG(8821B,_TxPowerTrack); +#endif +#if RTL8822B_SUPPORT + if(pDM_Odm->SupportICType == ODM_RTL8822B) + READ_AND_CONFIG_TC(8822B,_TxPowerTrack); +#endif +#if RTL8703B_SUPPORT + if(pDM_Odm->SupportICType == ODM_RTL8703B) + READ_AND_CONFIG_TC(8703B,_TxPowerTrack_PCIE); +#endif + +#if ((DEV_BUS_TYPE == RT_USB_INTERFACE) || (DEV_BUS_TYPE == RT_SDIO_INTERFACE)) +#if RTL8188F_SUPPORT + if(pDM_Odm->SupportICType == ODM_RTL8188F) + READ_AND_CONFIG_TC(8188F,_TxPowerTrack_PCIE); +#endif #endif +#endif//(DM_ODM_SUPPORT_TYPE & ODM_WIN) + return HAL_STATUS_SUCCESS; } @@ -1996,83 +2077,42 @@ ODM_ConfigBBWithHeaderFile( IN ODM_BB_Config_Type ConfigType ) { -#if (DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_WIN)) - PADAPTER Adapter = pDM_Odm->Adapter; -#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) - PMGNT_INFO pMgntInfo = &(Adapter->MgntInfo); -#endif -#endif - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, - ("===>ODM_ConfigBBWithHeaderFile (%s)\n", (pDM_Odm->bIsMPChip) ? "MPChip" : "TestChip")); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, - ("pDM_Odm->SupportPlatform: 0x%X, pDM_Odm->SupportInterface: 0x%X, pDM_Odm->BoardType: 0x%X\n", - pDM_Odm->SupportPlatform, pDM_Odm->SupportInterface, pDM_Odm->BoardType)); +//1 AP doesn't use PHYDM initialization in these ICs +#if (DM_ODM_SUPPORT_TYPE != ODM_AP) #if (RTL8723A_SUPPORT == 1) - if(pDM_Odm->SupportICType == ODM_RTL8723A) + if(pDM_Odm->SupportICType == ODM_RTL8723A) { if(ConfigType == CONFIG_BB_PHY_REG) - { - READ_AND_CONFIG_MP(8723A,_PHY_REG_1T); - } + READ_AND_CONFIG_MP(8723A,_PHY_REG); else if(ConfigType == CONFIG_BB_AGC_TAB) - { - READ_AND_CONFIG_MP(8723A,_AGC_TAB_1T); - } + READ_AND_CONFIG_MP(8723A,_AGC_TAB); } #endif - -#if (RTL8188E_SUPPORT == 1) - if(pDM_Odm->SupportICType == ODM_RTL8188E) - { - if(ConfigType == CONFIG_BB_PHY_REG) - { - if(IS_VENDOR_8188E_I_CUT_SERIES(Adapter)) - READ_AND_CONFIG(8188E,_PHY_REG_1T_ICUT); - else - READ_AND_CONFIG(8188E,_PHY_REG_1T); - } - else if(ConfigType == CONFIG_BB_AGC_TAB) - { - if(IS_VENDOR_8188E_I_CUT_SERIES(Adapter)) - READ_AND_CONFIG(8188E,_AGC_TAB_1T_ICUT); - else - READ_AND_CONFIG(8188E,_AGC_TAB_1T); - } - else if(ConfigType == CONFIG_BB_PHY_REG_PG) - { - READ_AND_CONFIG(8188E,_PHY_REG_PG); - } - } -#endif - #if (RTL8812A_SUPPORT == 1) if(pDM_Odm->SupportICType == ODM_RTL8812) { if(ConfigType == CONFIG_BB_PHY_REG) - { - READ_AND_CONFIG(8812A,_PHY_REG); - } + READ_AND_CONFIG_MP(8812A,_PHY_REG); else if(ConfigType == CONFIG_BB_AGC_TAB) - { - READ_AND_CONFIG(8812A,_AGC_TAB); - } + READ_AND_CONFIG_MP(8812A,_AGC_TAB); else if(ConfigType == CONFIG_BB_PHY_REG_PG) { + #if (DM_ODM_SUPPORT_TYPE & ODM_WIN) + PADAPTER Adapter = pDM_Odm->Adapter; + PMGNT_INFO pMgntInfo = &(Adapter->MgntInfo); + #endif if (pDM_Odm->RFEType == 3 && pDM_Odm->bIsMPChip) READ_AND_CONFIG_MP(8812A,_PHY_REG_PG_ASUS); -#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) + #if (DM_ODM_SUPPORT_TYPE & ODM_WIN) else if (pMgntInfo->CustomerID == RT_CID_WNC_NEC && pDM_Odm->bIsMPChip) READ_AND_CONFIG_MP(8812A,_PHY_REG_PG_NEC); -#endif + #endif else - READ_AND_CONFIG(8812A,_PHY_REG_PG); + READ_AND_CONFIG_MP(8812A,_PHY_REG_PG); } else if(ConfigType == CONFIG_BB_PHY_REG_MP) - { READ_AND_CONFIG_MP(8812A,_PHY_REG_MP); - } else if(ConfigType == CONFIG_BB_AGC_TAB_DIFF) { if ((36 <= *pDM_Odm->pChannel) && (*pDM_Odm->pChannel <= 64)) @@ -2082,78 +2122,132 @@ ODM_ConfigBBWithHeaderFile( } } #endif - #if (RTL8821A_SUPPORT == 1) if(pDM_Odm->SupportICType == ODM_RTL8821) { if(ConfigType == CONFIG_BB_PHY_REG) - { - READ_AND_CONFIG(8821A,_PHY_REG); - } + READ_AND_CONFIG_MP(8821A,_PHY_REG); else if(ConfigType == CONFIG_BB_AGC_TAB) - { - READ_AND_CONFIG(8821A,_AGC_TAB); - } + READ_AND_CONFIG_MP(8821A,_AGC_TAB); else if(ConfigType == CONFIG_BB_PHY_REG_PG) - { - READ_AND_CONFIG(8821A,_PHY_REG_PG); - } - } + READ_AND_CONFIG_MP(8821A,_PHY_REG_PG); + } #endif #if (RTL8723B_SUPPORT == 1) - if(pDM_Odm->SupportICType == ODM_RTL8723B) + if(pDM_Odm->SupportICType == ODM_RTL8723B) { - if(ConfigType == CONFIG_BB_PHY_REG) - { - READ_AND_CONFIG(8723B,_PHY_REG); - } + READ_AND_CONFIG_MP(8723B,_PHY_REG); else if(ConfigType == CONFIG_BB_AGC_TAB) - { - READ_AND_CONFIG(8723B,_AGC_TAB); - } + READ_AND_CONFIG_MP(8723B,_AGC_TAB); else if(ConfigType == CONFIG_BB_PHY_REG_PG) - { - READ_AND_CONFIG(8723B,_PHY_REG_PG); - } + READ_AND_CONFIG_MP(8723B,_PHY_REG_PG); } #endif #if (RTL8192E_SUPPORT == 1) - if(pDM_Odm->SupportICType == ODM_RTL8192E) + if(pDM_Odm->SupportICType == ODM_RTL8192E) { + if(ConfigType == CONFIG_BB_PHY_REG) + READ_AND_CONFIG_MP(8192E,_PHY_REG); + else if(ConfigType == CONFIG_BB_AGC_TAB) + READ_AND_CONFIG_MP(8192E,_AGC_TAB); + else if(ConfigType == CONFIG_BB_PHY_REG_PG) + READ_AND_CONFIG_MP(8192E,_PHY_REG_PG); + } +#endif +#endif//(DM_ODM_SUPPORT_TYPE != ODM_AP) + +//1 All platforms support +#if (RTL8188E_SUPPORT == 1) + if(pDM_Odm->SupportICType == ODM_RTL8188E) + { if(ConfigType == CONFIG_BB_PHY_REG) - { - READ_AND_CONFIG(8192E,_PHY_REG); - } + READ_AND_CONFIG_MP(8188E,_PHY_REG); else if(ConfigType == CONFIG_BB_AGC_TAB) - { - READ_AND_CONFIG(8192E,_AGC_TAB); - } + READ_AND_CONFIG_MP(8188E,_AGC_TAB); else if(ConfigType == CONFIG_BB_PHY_REG_PG) - { - READ_AND_CONFIG(8192E,_PHY_REG_PG); - } + READ_AND_CONFIG_MP(8188E,_PHY_REG_PG); } #endif -#if (RTL8813A_SUPPORT == 1) - if(pDM_Odm->SupportICType == ODM_RTL8813A) +#if (RTL8814A_SUPPORT == 1) + if(pDM_Odm->SupportICType == ODM_RTL8814A) { - if(ConfigType == CONFIG_BB_PHY_REG) - { - READ_AND_CONFIG(8813A,_PHY_REG); - } + READ_AND_CONFIG_MP(8814A,_PHY_REG); else if(ConfigType == CONFIG_BB_AGC_TAB) - { - READ_AND_CONFIG(8813A,_AGC_TAB); - } + READ_AND_CONFIG_MP(8814A,_AGC_TAB); else if(ConfigType == CONFIG_BB_PHY_REG_PG) - { - //READ_AND_CONFIG(8813A,_PHY_REG_PG); + READ_AND_CONFIG_MP(8814A,_PHY_REG_PG); + else if(ConfigType == CONFIG_BB_PHY_REG_MP) + READ_AND_CONFIG_MP(8814A,_PHY_REG_MP); + } +#endif + +//1 New ICs (WIN only) +#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) +#if (RTL8821B_SUPPORT == 1) + if(pDM_Odm->SupportICType == ODM_RTL8821B) + { + if (ConfigType == CONFIG_BB_PHY_REG) { + READ_AND_CONFIG(8821B,_PHY_REG); + } else if (ConfigType == CONFIG_BB_AGC_TAB) { + READ_AND_CONFIG(8821B,_AGC_TAB); + } else if (ConfigType == CONFIG_BB_PHY_REG_PG) { + READ_AND_CONFIG(8821B,_PHY_REG_PG); } + } +#endif +#if (RTL8822B_SUPPORT == 1) + if(pDM_Odm->SupportICType == ODM_RTL8822B) + { + if(ConfigType == CONFIG_BB_PHY_REG) + READ_AND_CONFIG_TC(8822B,_PHY_REG); + else if(ConfigType == CONFIG_BB_AGC_TAB) + READ_AND_CONFIG_TC(8822B,_AGC_TAB); + else if(ConfigType == CONFIG_BB_PHY_REG_PG) + READ_AND_CONFIG_TC(8822B,_PHY_REG_PG); + else if(ConfigType == CONFIG_BB_PHY_REG_MP) + READ_AND_CONFIG_TC(8822B,_PHY_REG_MP); } #endif +#if (RTL8703B_SUPPORT == 1) + if(pDM_Odm->SupportICType == ODM_RTL8703B) + { + if(ConfigType == CONFIG_BB_PHY_REG) + READ_AND_CONFIG_TC(8703B,_PHY_REG); + else if(ConfigType == CONFIG_BB_AGC_TAB) + READ_AND_CONFIG_TC(8703B,_AGC_TAB); + else if(ConfigType == CONFIG_BB_PHY_REG_PG) + READ_AND_CONFIG_TC(8703B,_PHY_REG_PG); + } +#endif +#if ((DEV_BUS_TYPE == RT_USB_INTERFACE) || (DEV_BUS_TYPE == RT_SDIO_INTERFACE)) +#if (RTL8188F_SUPPORT == 1) + if(pDM_Odm->SupportICType == ODM_RTL8188F) + { + if(ConfigType == CONFIG_BB_PHY_REG) + READ_AND_CONFIG_TC(8188F,_PHY_REG); + else if(ConfigType == CONFIG_BB_AGC_TAB) + READ_AND_CONFIG_TC(8188F,_AGC_TAB); + else if(ConfigType == CONFIG_BB_PHY_REG_PG) + READ_AND_CONFIG_TC(8188F,_PHY_REG_PG); + } +#endif +#endif +#if (RTL8195A_SUPPORT == 1) + if(pDM_Odm->SupportICType == ODM_RTL8195A) + { + if(ConfigType == CONFIG_BB_PHY_REG) + READ_AND_CONFIG(8195A,_PHY_REG); + else if(ConfigType == CONFIG_BB_AGC_TAB) + READ_AND_CONFIG(8195A,_AGC_TAB); + else if(ConfigType == CONFIG_BB_PHY_REG_PG) + READ_AND_CONFIG(8195A,_PHY_REG_PG); + } +#endif +#endif//(DM_ODM_SUPPORT_TYPE & ODM_WIN) + return HAL_STATUS_SUCCESS; } @@ -2162,60 +2256,74 @@ ODM_ConfigMACWithHeaderFile( IN PDM_ODM_T pDM_Odm ) { -#if (DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_WIN)) - PADAPTER Adapter = pDM_Odm->Adapter; -#endif - u1Byte result = HAL_STATUS_SUCCESS; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===>ODM_ConfigMACWithHeaderFile (%s)\n", (pDM_Odm->bIsMPChip) ? "MPChip" : "TestChip")); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("pDM_Odm->SupportPlatform: 0x%X, pDM_Odm->SupportInterface: 0x%X, pDM_Odm->BoardType: 0x%X\n", pDM_Odm->SupportPlatform, pDM_Odm->SupportInterface, pDM_Odm->BoardType)); - + +//1 AP doesn't use PHYDM initialization in these ICs +#if (DM_ODM_SUPPORT_TYPE != ODM_AP) #if (RTL8723A_SUPPORT == 1) if (pDM_Odm->SupportICType == ODM_RTL8723A) - { READ_AND_CONFIG_MP(8723A,_MAC_REG); - } -#endif -#if (RTL8188E_SUPPORT == 1) - if (pDM_Odm->SupportICType == ODM_RTL8188E) - { - if(IS_VENDOR_8188E_I_CUT_SERIES(Adapter)) - result = READ_AND_CONFIG(8188E,_MAC_REG_ICUT); - else - result = READ_AND_CONFIG(8188E,_MAC_REG); - } #endif #if (RTL8812A_SUPPORT == 1) if (pDM_Odm->SupportICType == ODM_RTL8812) - { - READ_AND_CONFIG(8812A,_MAC_REG); - } + READ_AND_CONFIG_MP(8812A,_MAC_REG); #endif #if (RTL8821A_SUPPORT == 1) if (pDM_Odm->SupportICType == ODM_RTL8821) - { - READ_AND_CONFIG(8821A,_MAC_REG); - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("<===8821_ODM_ConfigMACwithHeaderFile\n")); - } + READ_AND_CONFIG_MP(8821A,_MAC_REG); #endif #if (RTL8723B_SUPPORT == 1) if (pDM_Odm->SupportICType == ODM_RTL8723B) - { - READ_AND_CONFIG(8723B,_MAC_REG); - } + READ_AND_CONFIG_MP(8723B,_MAC_REG); #endif #if (RTL8192E_SUPPORT == 1) if (pDM_Odm->SupportICType == ODM_RTL8192E) - { - READ_AND_CONFIG(8192E,_MAC_REG); - } + READ_AND_CONFIG_MP(8192E,_MAC_REG); +#endif +#endif//(DM_ODM_SUPPORT_TYPE != ODM_AP) + +//1 All platforms support +#if (RTL8188E_SUPPORT == 1) + if (pDM_Odm->SupportICType == ODM_RTL8188E) + READ_AND_CONFIG_MP(8188E,_MAC_REG); +#endif +#if (RTL8814A_SUPPORT == 1) + if (pDM_Odm->SupportICType == ODM_RTL8814A) + READ_AND_CONFIG_MP(8814A,_MAC_REG); +#endif + +//1 New ICs (WIN only) +#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) +#if (RTL8821B_SUPPORT == 1) + if (pDM_Odm->SupportICType == ODM_RTL8821B) + READ_AND_CONFIG(8821B,_MAC_REG); +#endif +#if (RTL8822B_SUPPORT == 1) + if (pDM_Odm->SupportICType == ODM_RTL8822B) + READ_AND_CONFIG_TC(8822B,_MAC_REG); +#endif +#if (RTL8703B_SUPPORT == 1) + if (pDM_Odm->SupportICType == ODM_RTL8703B) + READ_AND_CONFIG_TC(8703B,_MAC_REG); #endif - return result; +#if ((DEV_BUS_TYPE == RT_USB_INTERFACE) || (DEV_BUS_TYPE == RT_SDIO_INTERFACE)) +#if (RTL8188F_SUPPORT == 1) + if (pDM_Odm->SupportICType == ODM_RTL8188F) + READ_AND_CONFIG_TC(8188F,_MAC_REG); +#endif +#endif +#if (RTL8195A_SUPPORT == 1) + if (pDM_Odm->SupportICType == ODM_RTL8195A) + READ_AND_CONFIG_MP(8195A,_MAC_REG); +#endif +#endif + + return HAL_STATUS_SUCCESS; } HAL_STATUS @@ -2226,129 +2334,192 @@ ODM_ConfigFWWithHeaderFile( OUT u4Byte *pSize ) { +#if (DM_ODM_SUPPORT_TYPE != ODM_AP) #if (RTL8188E_SUPPORT == 1) if (pDM_Odm->SupportICType == ODM_RTL8188E) { + #ifdef CONFIG_SFW_SUPPORTED if (ConfigType == CONFIG_FW_NIC) - { - READ_FIRMWARE(8188E,_FW_NIC_T); - } + READ_FIRMWARE_MP(8188E,_FW_NIC_T); else if (ConfigType == CONFIG_FW_WoWLAN) - { - READ_FIRMWARE(8188E,_FW_WoWLAN_T); - } + READ_FIRMWARE_MP(8188E,_FW_WoWLAN_T); else if(ConfigType == CONFIG_FW_NIC_2) - { - READ_FIRMWARE(8188E,_FW_NIC_S); - } + READ_FIRMWARE_MP(8188E,_FW_NIC_S); else if (ConfigType == CONFIG_FW_WoWLAN_2) - { - READ_FIRMWARE(8188E,_FW_WoWLAN_S); - } + READ_FIRMWARE_MP(8188E,_FW_WoWLAN_S); + #else + if (ConfigType == CONFIG_FW_NIC) + READ_FIRMWARE_MP(8188E,_FW_NIC); + else if (ConfigType == CONFIG_FW_WoWLAN) + READ_FIRMWARE_MP(8188E,_FW_WoWLAN); + #endif } #endif #if (RTL8723B_SUPPORT == 1) if (pDM_Odm->SupportICType == ODM_RTL8723B) { if (ConfigType == CONFIG_FW_NIC) - { - READ_FIRMWARE(8723B,_FW_NIC); - } + READ_FIRMWARE_MP(8723B,_FW_NIC); else if (ConfigType == CONFIG_FW_WoWLAN) - { - READ_FIRMWARE(8723B,_FW_WoWLAN); - } -#ifdef CONFIG_AP_WOWLAN + READ_FIRMWARE_MP(8723B,_FW_WoWLAN); + #ifdef CONFIG_AP_WOWLAN else if (ConfigType == CONFIG_FW_AP_WoWLAN) - { READ_FIRMWARE(8723B,_FW_AP_WoWLAN); - } -#endif + #endif else if (ConfigType == CONFIG_FW_BT) - { READ_FIRMWARE_MP(8723B,_FW_BT); - } + #if (DM_ODM_SUPPORT_TYPE == ODM_CE) else if (ConfigType == CONFIG_FW_MP) - { READ_FIRMWARE_MP(8723B,_FW_MP); - } + #endif } #endif #if (RTL8812A_SUPPORT == 1) if (pDM_Odm->SupportICType == ODM_RTL8812) { if (ConfigType == CONFIG_FW_NIC) - { - READ_FIRMWARE(8812A,_FW_NIC); - } + READ_FIRMWARE_MP(8812A,_FW_NIC); else if (ConfigType == CONFIG_FW_WoWLAN) - { - READ_FIRMWARE(8812A,_FW_WoWLAN); - } + READ_FIRMWARE_MP(8812A,_FW_WoWLAN); else if (ConfigType == CONFIG_FW_BT) - { - READ_FIRMWARE(8812A,_FW_NIC_BT); - } - + READ_FIRMWARE_MP(8812A,_FW_NIC_BT); } #endif #if (RTL8821A_SUPPORT == 1) if (pDM_Odm->SupportICType == ODM_RTL8821) { if (ConfigType == CONFIG_FW_NIC) - { READ_FIRMWARE_MP(8821A,_FW_NIC); - } else if (ConfigType == CONFIG_FW_WoWLAN) - { - READ_FIRMWARE(8821A,_FW_WoWLAN); - } + READ_FIRMWARE_MP(8821A,_FW_WoWLAN); else if (ConfigType == CONFIG_FW_BT) - { READ_FIRMWARE_MP(8821A,_FW_NIC_BT); - } } #endif #if (RTL8192E_SUPPORT == 1) if (pDM_Odm->SupportICType == ODM_RTL8192E) { if (ConfigType == CONFIG_FW_NIC) - { - READ_FIRMWARE(8192E,_FW_NIC); - } + READ_FIRMWARE_MP(8192E,_FW_NIC); else if (ConfigType == CONFIG_FW_WoWLAN) - { - READ_FIRMWARE(8192E,_FW_WoWLAN); - } -#ifdef CONFIG_AP_WOWLAN + READ_FIRMWARE_MP(8192E,_FW_WoWLAN); + #ifdef CONFIG_AP_WOWLAN else if (ConfigType == CONFIG_FW_AP_WoWLAN) - { - READ_FIRMWARE(8192E,_FW_AP_WoWLAN); - } + READ_FIRMWARE_MP(8192E,_FW_AP_WoWLAN); + #endif + } +#endif +#if (RTL8814A_SUPPORT == 1) + if (pDM_Odm->SupportICType == ODM_RTL8814A) + { + if (ConfigType == CONFIG_FW_NIC) + READ_FIRMWARE_MP(8814A,_FW_NIC); + } #endif +//1 New ICs (WIN only) +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) +#if (RTL8821B_SUPPORT == 1) + if (pDM_Odm->SupportICType == ODM_RTL8821B) + { } #endif +#if (RTL8822B_SUPPORT == 1) + if (pDM_Odm->SupportICType == ODM_RTL8822B) + { + if (ConfigType == CONFIG_FW_NIC) + READ_FIRMWARE_MP(8822B,_FW_NIC); + else if (ConfigType == CONFIG_FW_WoWLAN) + READ_FIRMWARE(8822B,_FW_WoWLAN); + } +#endif +#if (RTL8703B_SUPPORT == 1) + if (pDM_Odm->SupportICType == ODM_RTL8703B) + { + if (ConfigType == CONFIG_FW_NIC) + READ_FIRMWARE_MP(8703B,_FW_NIC); + } +#endif +#if ((DEV_BUS_TYPE == RT_USB_INTERFACE) || (DEV_BUS_TYPE == RT_SDIO_INTERFACE)) +#if (RTL8188F_SUPPORT == 1) + if (pDM_Odm->SupportICType == ODM_RTL8188F) + { + if (ConfigType == CONFIG_FW_NIC) + READ_FIRMWARE_MP(8188F,_FW_NIC); + } +#endif +#endif +#endif//(DM_ODM_SUPPORT_TYPE == ODM_WIN) + +#endif//(DM_ODM_SUPPORT_TYPE != ODM_AP) return HAL_STATUS_SUCCESS; } - u4Byte ODM_GetHWImgVersion( IN PDM_ODM_T pDM_Odm ) { + u4Byte Version=0; +//1 AP doesn't use PHYDM initialization in these ICs +#if (DM_ODM_SUPPORT_TYPE != ODM_AP) +#if (RTL8723A_SUPPORT == 1) + if (pDM_Odm->SupportICType == ODM_RTL8723A) + Version = GET_VERSION_MP(8723A,_MAC_REG); +#endif +#if (RTL8723B_SUPPORT == 1) + if (pDM_Odm->SupportICType == ODM_RTL8723B) + Version = GET_VERSION_MP(8723B,_MAC_REG); +#endif +#if (RTL8821A_SUPPORT == 1) + if (pDM_Odm->SupportICType == ODM_RTL8821) + Version = GET_VERSION_MP(8821A,_MAC_REG); +#endif +#if (RTL8192E_SUPPORT == 1) + if (pDM_Odm->SupportICType == ODM_RTL8192E) + Version = GET_VERSION_MP(8192E,_MAC_REG); +#endif #if (RTL8812A_SUPPORT == 1) if (pDM_Odm->SupportICType == ODM_RTL8812) - return GET_VERSION_MP(8812A,_MAC_REG); + Version = GET_VERSION_MP(8812A,_MAC_REG); #endif +#endif //(DM_ODM_SUPPORT_TYPE != ODM_AP) - return 0; -} - +//1 All platforms support +#if (RTL8188E_SUPPORT == 1) + if (pDM_Odm->SupportICType == ODM_RTL8188E) + Version = GET_VERSION_MP(8188E,_MAC_REG); +#endif +#if (RTL8814A_SUPPORT == 1) + if (pDM_Odm->SupportICType == ODM_RTL8814A) + Version = GET_VERSION_MP(8814A,_MAC_REG); +#endif +//1 New ICs (WIN only) +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) +#if (RTL8821B_SUPPORT == 1) + if (pDM_Odm->SupportICType == ODM_RTL8821B) + Version = GET_VERSION(8821B,_MAC_REG); +#endif +#if (RTL8822B_SUPPORT == 1) + if (pDM_Odm->SupportICType == ODM_RTL8822B) + Version = GET_VERSION(8822B, _MAC_REG); +#endif +#if (RTL8703B_SUPPORT == 1) + if (pDM_Odm->SupportICType == ODM_RTL8703B) + Version = GET_VERSION_TC(8703B, _MAC_REG); +#endif +#if ((DEV_BUS_TYPE == RT_USB_INTERFACE) || (DEV_BUS_TYPE == RT_SDIO_INTERFACE)) +#if (RTL8188F_SUPPORT == 1) + if (pDM_Odm->SupportICType == ODM_RTL8188F) + Version = GET_VERSION_TC(8188F, _MAC_REG); +#endif +#endif +#endif //(DM_ODM_SUPPORT_TYPE == ODM_WIN) + return Version; +} diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_HWConfig.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_HWConfig.h old mode 100755 new mode 100644 similarity index 93% rename from backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_HWConfig.h rename to backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_HWConfig.h index 16a26f6da78011..da0e5fc1cfcec8 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_HWConfig.h +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_HWConfig.h @@ -24,7 +24,7 @@ /*--------------------------Define -------------------------------------------*/ -#define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0) +//#define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0) #define AGC_DIFF_CONFIG_MP(ic, band) (ODM_ReadAndConfig_MP_##ic##_AGC_TAB_DIFF(pDM_Odm, Array_MP_##ic##_AGC_TAB_DIFF_##band, \ sizeof(Array_MP_##ic##_AGC_TAB_DIFF_##band)/sizeof(u4Byte))) #define AGC_DIFF_CONFIG_TC(ic, band) (ODM_ReadAndConfig_TC_##ic##_AGC_TAB_DIFF(pDM_Odm, Array_TC_##ic##_AGC_TAB_DIFF_##band, \ @@ -225,6 +225,12 @@ ODM_GetHWImgVersion( IN PDM_ODM_T pDM_Odm ); +s4Byte +odm_SignalScaleMapping( + IN OUT PDM_ODM_T pDM_Odm, + IN s4Byte CurrSig + ); + #endif #endif diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_NoiseMonitor.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_NoiseMonitor.c new file mode 100644 index 00000000000000..f8c207b099072e --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_NoiseMonitor.c @@ -0,0 +1,197 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +//============================================================ +// include files +//============================================================ +//#include "Mp_Precomp.h" +#include "phydm_precomp.h" + +//================================================= +// This function is for inband noise test utility only +// To obtain the inband noise level(dbm), do the following. +// 1. disable DIG and Power Saving +// 2. Set initial gain = 0x1a +// 3. Stop updating idle time pwer report (for driver read) +// - 0x80c[25] +// +//================================================= + +#define Valid_Min -35 +#define Valid_Max 10 +#define ValidCnt 5 + +s2Byte odm_InbandNoise_Monitor_NSeries(PDM_ODM_T pDM_Odm,u8 bPauseDIG,u8 IGIValue,u32 max_time) +{ + u4Byte tmp4b; + u1Byte max_rf_path=0,rf_path; + u1Byte reg_c50, reg_c58,valid_done=0; + struct noise_level noise_data; + u32 start = 0, func_start=0, func_end = 0; + + func_start = ODM_GetCurrentTime(pDM_Odm); + pDM_Odm->noise_level.noise_all = 0; + + if((pDM_Odm->RFType == ODM_1T2R) ||(pDM_Odm->RFType == ODM_2T2R)) + max_rf_path = 2; + else + max_rf_path = 1; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD,("odm_DebugControlInbandNoise_Nseries() ==> \n")); + + ODM_Memory_Set(pDM_Odm,&noise_data,0,sizeof(struct noise_level)); + + // + // Step 1. Disable DIG && Set initial gain. + // + + if(bPauseDIG) + { + odm_PauseDIG(pDM_Odm,ODM_PAUSE_DIG,IGIValue); + } + // + // Step 2. Disable all power save for read registers + // + //dcmd_DebugControlPowerSave(pAdapter, PSDisable); + + // + // Step 3. Get noise power level + // + start = ODM_GetCurrentTime(pDM_Odm); + while(1) + { + + //Stop updating idle time pwer report (for driver read) + ODM_SetBBReg(pDM_Odm, rFPGA0_TxGainStage, BIT25, 1); + + //Read Noise Floor Report + tmp4b = ODM_GetBBReg(pDM_Odm, 0x8f8,bMaskDWord ); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD,("Noise Floor Report (0x8f8) = 0x%08x\n", tmp4b)); + + //ODM_SetBBReg(pDM_Odm, rOFDM0_XAAGCCore1, bMaskByte0, TestInitialGain); + //if(max_rf_path == 2) + // ODM_SetBBReg(pDM_Odm, rOFDM0_XBAGCCore1, bMaskByte0, TestInitialGain); + + //update idle time pwer report per 5us + ODM_SetBBReg(pDM_Odm, rFPGA0_TxGainStage, BIT25, 0); + + noise_data.value[ODM_RF_PATH_A] = (u1Byte)(tmp4b&0xff); + noise_data.value[ODM_RF_PATH_B] = (u1Byte)((tmp4b&0xff00)>>8); + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("value_a = 0x%x(%d), value_b = 0x%x(%d)\n", + noise_data.value[ODM_RF_PATH_A], noise_data.value[ODM_RF_PATH_A], noise_data.value[ODM_RF_PATH_B], noise_data.value[ODM_RF_PATH_B])); + + for(rf_path = ODM_RF_PATH_A; rf_path < max_rf_path; rf_path++) + { + noise_data.sval[rf_path] = (s1Byte)noise_data.value[rf_path]; + noise_data.sval[rf_path] /= 2; + } + + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD,("sval_a = %d, sval_b = %d\n", + noise_data.sval[ODM_RF_PATH_A], noise_data.sval[ODM_RF_PATH_B])); + //ODM_delay_ms(10); + //ODM_sleep_ms(10); + + for(rf_path = ODM_RF_PATH_A; rf_path < max_rf_path; rf_path++) + { + if( (noise_data.valid_cnt[rf_path] < ValidCnt) && (noise_data.sval[rf_path] < Valid_Max && noise_data.sval[rf_path] >= Valid_Min)) + { + noise_data.valid_cnt[rf_path]++; + noise_data.sum[rf_path] += noise_data.sval[rf_path]; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD,("RF_Path:%d Valid sval = %d\n", rf_path,noise_data.sval[rf_path])); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD,("Sum of sval = %d, \n", noise_data.sum[rf_path])); + if(noise_data.valid_cnt[rf_path] == ValidCnt) + { + valid_done++; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD,("After divided, RF_Path:%d ,sum = %d \n", rf_path,noise_data.sum[rf_path])); + } + + } + + } + + //printk("####### valid_done:%d #############\n",valid_done); + if ((valid_done==max_rf_path) || (ODM_GetProgressingTime(pDM_Odm,start) > max_time)) + { + for(rf_path = ODM_RF_PATH_A; rf_path < max_rf_path; rf_path++) + { + //printk("%s PATH_%d - sum = %d, valid_cnt = %d \n",__FUNCTION__,rf_path,noise_data.sum[rf_path], noise_data.valid_cnt[rf_path]); + if(noise_data.valid_cnt[rf_path]) + noise_data.sum[rf_path] /= noise_data.valid_cnt[rf_path]; + else + noise_data.sum[rf_path] = 0; + } + break; + } + } + reg_c50 = (s4Byte)ODM_GetBBReg(pDM_Odm,rOFDM0_XAAGCCore1,bMaskByte0); + reg_c50 &= ~BIT7; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD,("0x%x = 0x%02x(%d)\n", rOFDM0_XAAGCCore1, reg_c50, reg_c50)); + pDM_Odm->noise_level.noise[ODM_RF_PATH_A] = -110 + reg_c50 + noise_data.sum[ODM_RF_PATH_A]; + pDM_Odm->noise_level.noise_all += pDM_Odm->noise_level.noise[ODM_RF_PATH_A]; + + if(max_rf_path == 2){ + reg_c58 = (s4Byte)ODM_GetBBReg(pDM_Odm,rOFDM0_XBAGCCore1,bMaskByte0); + reg_c58 &= ~BIT7; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD,("0x%x = 0x%02x(%d)\n", rOFDM0_XBAGCCore1, reg_c58, reg_c58)); + pDM_Odm->noise_level.noise[ODM_RF_PATH_B] = -110 + reg_c58 + noise_data.sum[ODM_RF_PATH_B]; + pDM_Odm->noise_level.noise_all += pDM_Odm->noise_level.noise[ODM_RF_PATH_B]; + } + pDM_Odm->noise_level.noise_all /= max_rf_path; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD,("noise_a = %d, noise_b = %d\n", + pDM_Odm->noise_level.noise[ODM_RF_PATH_A], + pDM_Odm->noise_level.noise[ODM_RF_PATH_B])); + + // + // Step 4. Recover the Dig + // + if(bPauseDIG) + { + odm_PauseDIG(pDM_Odm,ODM_RESUME_DIG,IGIValue); + } + func_end = ODM_GetProgressingTime(pDM_Odm,func_start) ; + //printk("%s noise_a = %d, noise_b = %d noise_all:%d (%d ms)\n",__FUNCTION__, + // pDM_Odm->noise_level.noise[ODM_RF_PATH_A], + // pDM_Odm->noise_level.noise[ODM_RF_PATH_B], + // pDM_Odm->noise_level.noise_all,func_end); + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD,("odm_DebugControlInbandNoise_Nseries() <== \n")); + return pDM_Odm->noise_level.noise_all; + +} +s2Byte ODM_InbandNoise_Monitor(PVOID pDM_VOID,u8 bPauseDIG,u8 IGIValue,u32 max_time) +{ + + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + if(pDM_Odm->SupportICType & ODM_IC_11AC_SERIES ) + { + //odm_InbandNoise_Monitor_JaguarSeries(pDM_Odm,bPauseDIG,IGIValue,max_time); + return 0; + } + else + { + return odm_InbandNoise_Monitor_NSeries(pDM_VOID,bPauseDIG,IGIValue,max_time); + } +} + + + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_NoiseMonitor.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_NoiseMonitor.h new file mode 100644 index 00000000000000..6625be61633aad --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_NoiseMonitor.h @@ -0,0 +1,49 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + *****************************************************************************/ +#ifndef __ODMNOISEMONITOR_H__ +#define __ODMNOISEMONITOR_H__ + +#define ODM_MAX_CHANNEL_NUM 38//14+24 +struct noise_level +{ + //u1Byte value_a, value_b; + u1Byte value[MAX_RF_PATH]; + //s1Byte sval_a, sval_b; + s1Byte sval[MAX_RF_PATH]; + + //s4Byte noise_a=0, noise_b=0,sum_a=0, sum_b=0; + //s4Byte noise[ODM_RF_PATH_MAX]; + s4Byte sum[MAX_RF_PATH]; + //u1Byte valid_cnt_a=0, valid_cnt_b=0, + u1Byte valid[MAX_RF_PATH]; + u1Byte valid_cnt[MAX_RF_PATH]; + +}; + + +typedef struct _ODM_NOISE_MONITOR_ +{ + s1Byte noise[MAX_RF_PATH]; + s2Byte noise_all; +}ODM_NOISE_MONITOR; + +s2Byte ODM_InbandNoise_Monitor(PVOID pDM_VOID,u8 bPauseDIG,u8 IGIValue,u32 max_time); + +#endif diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_PathDiv.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_PathDiv.c new file mode 100644 index 00000000000000..900fa61553a8aa --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_PathDiv.c @@ -0,0 +1,2239 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +//============================================================ +// include files +//============================================================ +#include "Mp_Precomp.h" +#include "phydm_precomp.h" + +#if(defined(CONFIG_PATH_DIVERSITY)) +#if RTL8814A_SUPPORT + +VOID +phydm_dtp_fix_tx_path( + IN PVOID pDM_VOID, + IN u1Byte path + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pPATHDIV_T pDM_PathDiv = &pDM_Odm->DM_PathDiv; + u1Byte i,num_enable_path=0; + + if(path==pDM_PathDiv->pre_tx_path) + { + return; + } + else + { + pDM_PathDiv->pre_tx_path=path; + } + + ODM_SetBBReg( pDM_Odm, 0x93c, BIT18|BIT19, 3); + + for(i=0; i<4; i++) + { + if(path&BIT(i)) + num_enable_path++; + } + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, (" Number of trun-on path : (( %d ))\n", num_enable_path)); + + if(num_enable_path == 1) + { + ODM_SetBBReg( pDM_Odm, 0x93c, 0xf00000, path); + + if(path==PHYDM_A)//1-1 + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, (" Trun on path (( A ))\n")); + ODM_SetBBReg( pDM_Odm, 0x93c, BIT25|BIT24, 0); + } + else if(path==PHYDM_B)//1-2 + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, (" Trun on path (( B ))\n")); + ODM_SetBBReg( pDM_Odm, 0x93c, BIT27|BIT26, 0); + } + else if(path==PHYDM_C)//1-3 + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, (" Trun on path (( C ))\n")); + ODM_SetBBReg( pDM_Odm, 0x93c, BIT29|BIT28, 0); + + } + else if(path==PHYDM_D)//1-4 + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, (" Trun on path (( D ))\n")); + ODM_SetBBReg( pDM_Odm, 0x93c, BIT31|BIT30, 0); + } + + } + else if(num_enable_path == 2) + { + ODM_SetBBReg( pDM_Odm, 0x93c, 0xf00000, path); + ODM_SetBBReg( pDM_Odm, 0x940, 0xf0, path); + + if(path==PHYDM_AB)//2-1 + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, (" Trun on path (( A B ))\n")); + //set for 1ss + ODM_SetBBReg( pDM_Odm, 0x93c, BIT25|BIT24, 0); + ODM_SetBBReg( pDM_Odm, 0x93c, BIT27|BIT26, 1); + //set for 2ss + ODM_SetBBReg( pDM_Odm, 0x940, BIT9|BIT8, 0); + ODM_SetBBReg( pDM_Odm, 0x940, BIT11|BIT10, 1); + } + else if(path==PHYDM_AC)//2-2 + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, (" Trun on path (( A C ))\n")); + //set for 1ss + ODM_SetBBReg( pDM_Odm, 0x93c, BIT25|BIT24, 0); + ODM_SetBBReg( pDM_Odm, 0x93c, BIT29|BIT28, 1); + //set for 2ss + ODM_SetBBReg( pDM_Odm, 0x940, BIT9|BIT8, 0); + ODM_SetBBReg( pDM_Odm, 0x940, BIT13|BIT12, 1); + } + else if(path==PHYDM_AD)//2-3 + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, (" Trun on path (( A D ))\n")); + //set for 1ss + ODM_SetBBReg( pDM_Odm, 0x93c, BIT25|BIT24, 0); + ODM_SetBBReg( pDM_Odm, 0x93c, BIT31|BIT30, 1); + //set for 2ss + ODM_SetBBReg( pDM_Odm, 0x940, BIT9|BIT8, 0); + ODM_SetBBReg( pDM_Odm, 0x940, BIT15|BIT14, 1); + } + else if(path==PHYDM_BC)//2-4 + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, (" Trun on path (( B C ))\n")); + //set for 1ss + ODM_SetBBReg( pDM_Odm, 0x93c, BIT27|BIT26, 0); + ODM_SetBBReg( pDM_Odm, 0x93c, BIT29|BIT28, 1); + //set for 2ss + ODM_SetBBReg( pDM_Odm, 0x940, BIT11|BIT10, 0); + ODM_SetBBReg( pDM_Odm, 0x940, BIT13|BIT12, 1); + } + else if(path==PHYDM_BD)//2-5 + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, (" Trun on path (( B D ))\n")); + //set for 1ss + ODM_SetBBReg( pDM_Odm, 0x93c, BIT27|BIT26, 0); + ODM_SetBBReg( pDM_Odm, 0x93c, BIT31|BIT30, 1); + //set for 2ss + ODM_SetBBReg( pDM_Odm, 0x940, BIT11|BIT10, 0); + ODM_SetBBReg( pDM_Odm, 0x940, BIT15|BIT14, 1); + } + else if(path==PHYDM_CD)//2-6 + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, (" Trun on path (( C D ))\n")); + //set for 1ss + ODM_SetBBReg( pDM_Odm, 0x93c, BIT29|BIT28, 0); + ODM_SetBBReg( pDM_Odm, 0x93c, BIT31|BIT30, 1); + //set for 2ss + ODM_SetBBReg( pDM_Odm, 0x940, BIT13|BIT12, 0); + ODM_SetBBReg( pDM_Odm, 0x940, BIT15|BIT14, 1); + } + + } + else if(num_enable_path == 3) + { + ODM_SetBBReg( pDM_Odm, 0x93c, 0xf00000, path); + ODM_SetBBReg( pDM_Odm, 0x940, 0xf0, path); + ODM_SetBBReg( pDM_Odm, 0x940, 0xf0000, path); + + if(path==PHYDM_ABC)//3-1 + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, (" Trun on path (( A B C))\n")); + //set for 1ss + ODM_SetBBReg( pDM_Odm, 0x93c, BIT25|BIT24, 0); + ODM_SetBBReg( pDM_Odm, 0x93c, BIT27|BIT26, 1); + ODM_SetBBReg( pDM_Odm, 0x93c, BIT29|BIT28, 2); + //set for 2ss + ODM_SetBBReg( pDM_Odm, 0x940, BIT9|BIT8, 0); + ODM_SetBBReg( pDM_Odm, 0x940, BIT11|BIT10, 1); + ODM_SetBBReg( pDM_Odm, 0x940, BIT13|BIT12, 2); + //set for 3ss + ODM_SetBBReg( pDM_Odm, 0x940, BIT21|BIT20, 0); + ODM_SetBBReg( pDM_Odm, 0x940, BIT23|BIT22, 1); + ODM_SetBBReg( pDM_Odm, 0x940, BIT25|BIT24, 2); + } + else if(path==PHYDM_ABD)//3-2 + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, (" Trun on path (( A B D ))\n")); + //set for 1ss + ODM_SetBBReg( pDM_Odm, 0x93c, BIT25|BIT24, 0); + ODM_SetBBReg( pDM_Odm, 0x93c, BIT27|BIT26, 1); + ODM_SetBBReg( pDM_Odm, 0x93c, BIT31|BIT30, 2); + //set for 2ss + ODM_SetBBReg( pDM_Odm, 0x940, BIT9|BIT8, 0); + ODM_SetBBReg( pDM_Odm, 0x940, BIT11|BIT10, 1); + ODM_SetBBReg( pDM_Odm, 0x940, BIT15|BIT14, 2); + //set for 3ss + ODM_SetBBReg( pDM_Odm, 0x940, BIT21|BIT20, 0); + ODM_SetBBReg( pDM_Odm, 0x940, BIT23|BIT22, 1); + ODM_SetBBReg( pDM_Odm, 0x940, BIT27|BIT26, 2); + + } + else if(path==PHYDM_ACD)//3-3 + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, (" Trun on path (( A C D ))\n")); + //set for 1ss + ODM_SetBBReg( pDM_Odm, 0x93c, BIT25|BIT24, 0); + ODM_SetBBReg( pDM_Odm, 0x93c, BIT29|BIT28, 1); + ODM_SetBBReg( pDM_Odm, 0x93c, BIT31|BIT30, 2); + //set for 2ss + ODM_SetBBReg( pDM_Odm, 0x940, BIT9|BIT8, 0); + ODM_SetBBReg( pDM_Odm, 0x940, BIT13|BIT12, 1); + ODM_SetBBReg( pDM_Odm, 0x940, BIT15|BIT14, 2); + //set for 3ss + ODM_SetBBReg( pDM_Odm, 0x940, BIT21|BIT20, 0); + ODM_SetBBReg( pDM_Odm, 0x940, BIT25|BIT24, 1); + ODM_SetBBReg( pDM_Odm, 0x940, BIT27|BIT26, 2); + } + else if(path==PHYDM_BCD)//3-4 + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, (" Trun on path (( B C D))\n")); + //set for 1ss + ODM_SetBBReg( pDM_Odm, 0x93c, BIT27|BIT26, 0); + ODM_SetBBReg( pDM_Odm, 0x93c, BIT29|BIT28, 1); + ODM_SetBBReg( pDM_Odm, 0x93c, BIT31|BIT30, 2); + //set for 2ss + ODM_SetBBReg( pDM_Odm, 0x940, BIT11|BIT10, 0); + ODM_SetBBReg( pDM_Odm, 0x940, BIT13|BIT12, 1); + ODM_SetBBReg( pDM_Odm, 0x940, BIT15|BIT14, 2); + //set for 3ss + ODM_SetBBReg( pDM_Odm, 0x940, BIT23|BIT22, 0); + ODM_SetBBReg( pDM_Odm, 0x940, BIT25|BIT24, 1); + ODM_SetBBReg( pDM_Odm, 0x940, BIT27|BIT26, 2); + } + } + else if(num_enable_path == 4) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, (" Trun on path ((A B C D))\n")); + } + +} + +VOID +phydm_find_default_path( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pPATHDIV_T pDM_PathDiv = &pDM_Odm->DM_PathDiv; + u4Byte rssi_avg_a=0, rssi_avg_b=0, rssi_avg_c=0, rssi_avg_d=0, rssi_avg_bcd=0; + u4Byte rssi_total_a=0, rssi_total_b=0, rssi_total_c=0, rssi_total_d=0; + + //2 Default Path Selection By RSSI + + rssi_avg_a = (pDM_PathDiv->path_a_cnt_all > 0)? (pDM_PathDiv->path_a_sum_all / pDM_PathDiv->path_a_cnt_all) :0 ; + rssi_avg_b = (pDM_PathDiv->path_b_cnt_all > 0)? (pDM_PathDiv->path_b_sum_all / pDM_PathDiv->path_b_cnt_all) :0 ; + rssi_avg_c = (pDM_PathDiv->path_c_cnt_all > 0)? (pDM_PathDiv->path_c_sum_all / pDM_PathDiv->path_c_cnt_all) :0 ; + rssi_avg_d = (pDM_PathDiv->path_d_cnt_all > 0)? (pDM_PathDiv->path_d_sum_all / pDM_PathDiv->path_d_cnt_all) :0 ; + + + pDM_PathDiv->path_a_sum_all = 0; + pDM_PathDiv->path_a_cnt_all = 0; + pDM_PathDiv->path_b_sum_all = 0; + pDM_PathDiv->path_b_cnt_all = 0; + pDM_PathDiv->path_c_sum_all = 0; + pDM_PathDiv->path_c_cnt_all = 0; + pDM_PathDiv->path_d_sum_all = 0; + pDM_PathDiv->path_d_cnt_all = 0; + + if(pDM_PathDiv->use_path_a_as_default_ant == 1) + { + rssi_avg_bcd=(rssi_avg_b+rssi_avg_c+rssi_avg_d)/3; + + if( (rssi_avg_a + ANT_DECT_RSSI_TH) > rssi_avg_bcd ) + { + pDM_PathDiv->is_pathA_exist=TRUE; + pDM_PathDiv->default_path=PATH_A; + } + else + { + pDM_PathDiv->is_pathA_exist=FALSE; + } + } + else + { + if( (rssi_avg_a >=rssi_avg_b) && (rssi_avg_a >=rssi_avg_c)&&(rssi_avg_a >=rssi_avg_d)) + pDM_PathDiv->default_path=PATH_A; + else if( (rssi_avg_b >=rssi_avg_c)&&(rssi_avg_b >=rssi_avg_d)) + pDM_PathDiv->default_path=PATH_B; + else if( rssi_avg_c >=rssi_avg_d) + pDM_PathDiv->default_path=PATH_C; + else + pDM_PathDiv->default_path=PATH_D; + } + + +} + + +VOID +phydm_candidate_dtp_update( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pPATHDIV_T pDM_PathDiv = &pDM_Odm->DM_PathDiv; + + pDM_PathDiv->num_candidate=3; + + if(pDM_PathDiv->use_path_a_as_default_ant == 1) + { + if(pDM_PathDiv->num_tx_path==3) + { + if(pDM_PathDiv->is_pathA_exist) + { + pDM_PathDiv->ant_candidate_1 = PHYDM_ABC; + pDM_PathDiv->ant_candidate_2 = PHYDM_ABD; + pDM_PathDiv->ant_candidate_3 = PHYDM_ACD; + } + else // use path BCD + { + pDM_PathDiv->num_candidate=1; + phydm_dtp_fix_tx_path(pDM_Odm, PHYDM_BCD); + return; + } + } + else if(pDM_PathDiv->num_tx_path==2) + { + if(pDM_PathDiv->is_pathA_exist) + { + pDM_PathDiv->ant_candidate_1 = PHYDM_AB; + pDM_PathDiv->ant_candidate_2 = PHYDM_AC; + pDM_PathDiv->ant_candidate_3 = PHYDM_AD; + } + else + { + pDM_PathDiv->ant_candidate_1 = PHYDM_BC; + pDM_PathDiv->ant_candidate_2 = PHYDM_BD; + pDM_PathDiv->ant_candidate_3 = PHYDM_CD; + } + } + } + else + { + //2 3 TX Mode + if(pDM_PathDiv->num_tx_path==3)//choose 3 ant form 4 + { + if(pDM_PathDiv->default_path == PATH_A) //choose 2 ant form 3 + { + pDM_PathDiv->ant_candidate_1 = PHYDM_ABC; + pDM_PathDiv->ant_candidate_2 = PHYDM_ABD; + pDM_PathDiv->ant_candidate_3 = PHYDM_ACD; + } + else if(pDM_PathDiv->default_path==PATH_B) + { + pDM_PathDiv->ant_candidate_1 = PHYDM_ABC; + pDM_PathDiv->ant_candidate_2 = PHYDM_ABD; + pDM_PathDiv->ant_candidate_3 = PHYDM_BCD; + } + else if(pDM_PathDiv->default_path == PATH_C) + { + pDM_PathDiv->ant_candidate_1 = PHYDM_ABC; + pDM_PathDiv->ant_candidate_2 = PHYDM_ACD; + pDM_PathDiv->ant_candidate_3 = PHYDM_BCD; + } + else if(pDM_PathDiv->default_path == PATH_D) + { + pDM_PathDiv->ant_candidate_1 = PHYDM_ABD; + pDM_PathDiv->ant_candidate_2 = PHYDM_ACD; + pDM_PathDiv->ant_candidate_3 = PHYDM_BCD; + } + } + + //2 2 TX Mode + else if(pDM_PathDiv->num_tx_path==2)//choose 2 ant form 4 + { + if(pDM_PathDiv->default_path == PATH_A) //choose 2 ant form 3 + { + pDM_PathDiv->ant_candidate_1 = PHYDM_AB; + pDM_PathDiv->ant_candidate_2 = PHYDM_AC; + pDM_PathDiv->ant_candidate_3 = PHYDM_AD; + } + else if(pDM_PathDiv->default_path==PATH_B) + { + pDM_PathDiv->ant_candidate_1 = PHYDM_AB; + pDM_PathDiv->ant_candidate_2 = PHYDM_BC; + pDM_PathDiv->ant_candidate_3 = PHYDM_BD; + } + else if(pDM_PathDiv->default_path == PATH_C) + { + pDM_PathDiv->ant_candidate_1 = PHYDM_AC; + pDM_PathDiv->ant_candidate_2 = PHYDM_BC; + pDM_PathDiv->ant_candidate_3 = PHYDM_CD; + } + else if(pDM_PathDiv->default_path == PATH_D) + { + pDM_PathDiv->ant_candidate_1= PHYDM_AD; + pDM_PathDiv->ant_candidate_2 = PHYDM_BD; + pDM_PathDiv->ant_candidate_3= PHYDM_CD; + } + } + } +} + + +VOID +phydm_dynamic_tx_path( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pPATHDIV_T pDM_PathDiv = &pDM_Odm->DM_PathDiv; + + PSTA_INFO_T pEntry; + u4Byte i; + u1Byte num_client=0; + u1Byte H2C_Parameter[6] ={0}; + + + if(!pDM_Odm->bLinked) //bLinked==False + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("DTP_8814 [No Link!!!]\n")); + + if(pDM_PathDiv->bBecomeLinked == TRUE) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, (" [Be disconnected]----->\n")); + pDM_PathDiv->bBecomeLinked = pDM_Odm->bLinked; + } + return; + } + else + { + if(pDM_PathDiv->bBecomeLinked ==FALSE) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, (" [Be Linked !!!]----->\n")); + pDM_PathDiv->bBecomeLinked = pDM_Odm->bLinked; + } + } + + //2 [Period CTRL] + if(pDM_PathDiv->dtp_period >=2) + { + pDM_PathDiv->dtp_period=0; + } + else + { + //ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("Phydm_Dynamic_Tx_Path_8814A() Stay = (( %d ))\n",pDM_PathDiv->dtp_period)); + pDM_PathDiv->dtp_period++; + return; + } + + + //2 [Fix Path] + if (pDM_Odm->path_select != PHYDM_AUTO_PATH) + { + return; + } + + //2 [Check Bfer] + #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + #if (BEAMFORMING_SUPPORT == 1) + { + BEAMFORMING_CAP BeamformCap = (pDM_Odm->BeamformingInfo.BeamformCap); + + if( BeamformCap & BEAMFORMER_CAP ) // BFmer On && Div On -> Div Off + { + if( pDM_PathDiv->fix_path_bfer == 0) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_PATH_DIV,ODM_DBG_LOUD,("[ PathDiv : OFF ] BFmer ==1 \n")); + pDM_PathDiv->fix_path_bfer = 1 ; + } + return; + } + else // BFmer Off && Div Off -> Div On + { + if( pDM_PathDiv->fix_path_bfer == 1 ) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_PATH_DIV,ODM_DBG_LOUD,("[ PathDiv : ON ] BFmer ==0 \n")); + pDM_PathDiv->fix_path_bfer = 0; + } + } + } + #endif + #endif + + if(pDM_PathDiv->use_path_a_as_default_ant ==1) + { + phydm_find_default_path(pDM_Odm); + phydm_candidate_dtp_update(pDM_Odm); + } + else + { + if( pDM_PathDiv->dtp_state == PHYDM_DTP_INIT) + { + phydm_find_default_path(pDM_Odm); + phydm_candidate_dtp_update(pDM_Odm); + pDM_PathDiv->dtp_state = PHYDM_DTP_RUNNING_1; + } + + else if( pDM_PathDiv->dtp_state == PHYDM_DTP_RUNNING_1) + { + pDM_PathDiv->dtp_check_patha_counter++; + + if(pDM_PathDiv->dtp_check_patha_counter>=NUM_RESET_DTP_PERIOD) + { + pDM_PathDiv->dtp_check_patha_counter=0; + pDM_PathDiv->dtp_state = PHYDM_DTP_INIT; + } + //2 Search space update + else + { + // 1. find the worst candidate + + + // 2. repalce the worst candidate + } + } + } + + //2 Dynamic Path Selection H2C + + if(pDM_PathDiv->num_candidate == 1) + { + return; + } + else + { + H2C_Parameter[0] = pDM_PathDiv->num_candidate; + H2C_Parameter[1] = pDM_PathDiv->num_tx_path; + H2C_Parameter[2] = pDM_PathDiv->ant_candidate_1; + H2C_Parameter[3] = pDM_PathDiv->ant_candidate_2; + H2C_Parameter[4] = pDM_PathDiv->ant_candidate_3; + + ODM_FillH2CCmd(pDM_Odm, PHYDM_H2C_DYNAMIC_TX_PATH, 6, H2C_Parameter); + } + +} + + + +VOID +phydm_dynamic_tx_path_init( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pPATHDIV_T pDM_PathDiv = &(pDM_Odm->DM_PathDiv); + PADAPTER pAdapter = pDM_Odm->Adapter; + USB_MODE_MECH *pUsbModeMech = &pAdapter->UsbModeMechanism; + + u1Byte search_space_2[NUM_CHOOSE2_FROM4]= {PHYDM_AB, PHYDM_AC, PHYDM_AD, PHYDM_BC, PHYDM_BD, PHYDM_CD }; + u1Byte search_space_3[NUM_CHOOSE3_FROM4]= {PHYDM_BCD, PHYDM_ACD, PHYDM_ABD, PHYDM_ABC}; + + memcpy(&(pDM_PathDiv->search_space_2[0]), &(search_space_2[0]), NUM_CHOOSE2_FROM4); + memcpy(&(pDM_PathDiv->search_space_3[0]), &(search_space_3[0]), NUM_CHOOSE3_FROM4); + + pDM_PathDiv->use_path_a_as_default_ant= 1; + pDM_PathDiv->dtp_state = PHYDM_DTP_INIT; + pDM_Odm->path_select = PHYDM_AUTO_PATH; + pDM_PathDiv->path_div_type = PHYDM_4R_PATH_DIV; + pDM_PathDiv->is_u3_mode = (pUsbModeMech->CurUsbMode==USB_MODE_U3)? 1 : 0 ; + + if(pDM_PathDiv->is_u3_mode ) + { + pDM_PathDiv->num_tx_path=3; + phydm_dtp_fix_tx_path(pDM_Odm, PHYDM_ABC);// 3TX // Set Init TX Path + + } + else + { + pDM_PathDiv->num_tx_path=2; + phydm_dtp_fix_tx_path(pDM_Odm, PHYDM_AB); // 2TX // Set Init TX Path + } + +} + + +VOID +phydm_process_rssi_for_path_div( + IN OUT PVOID pDM_VOID, + IN PVOID p_phy_info_void, + IN PVOID p_pkt_info_void + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PODM_PHY_INFO_T pPhyInfo=(PODM_PHY_INFO_T)p_phy_info_void; + PODM_PACKET_INFO_T pPktinfo=(PODM_PACKET_INFO_T)p_pkt_info_void; + pPATHDIV_T pDM_PathDiv = &(pDM_Odm->DM_PathDiv); + + if(pPktinfo->bPacketToSelf || pPktinfo->bPacketMatchBSSID) + { + if(pPktinfo->DataRate > ODM_RATE11M) + { + if(pDM_PathDiv->path_div_type == PHYDM_4R_PATH_DIV) + { + #if RTL8814A_SUPPORT + if(pDM_Odm->SupportICType & ODM_RTL8814A) + { + pDM_PathDiv->path_a_sum_all+=pPhyInfo->RxMIMOSignalStrength[0]; + pDM_PathDiv->path_a_cnt_all++; + + pDM_PathDiv->path_b_sum_all+=pPhyInfo->RxMIMOSignalStrength[1]; + pDM_PathDiv->path_b_cnt_all++; + + pDM_PathDiv->path_c_sum_all+=pPhyInfo->RxMIMOSignalStrength[2]; + pDM_PathDiv->path_c_cnt_all++; + + pDM_PathDiv->path_d_sum_all+=pPhyInfo->RxMIMOSignalStrength[3]; + pDM_PathDiv->path_d_cnt_all++; + } + #endif + } + else + { + pDM_PathDiv->PathA_Sum[pPktinfo->StationID]+=pPhyInfo->RxMIMOSignalStrength[0]; + pDM_PathDiv->PathA_Cnt[pPktinfo->StationID]++; + + pDM_PathDiv->PathB_Sum[pPktinfo->StationID]+=pPhyInfo->RxMIMOSignalStrength[1]; + pDM_PathDiv->PathB_Cnt[pPktinfo->StationID]++; + } + } + } + + +} + +#endif //#if RTL8814A_SUPPORT + +VOID +odm_pathdiv_debug( + IN PVOID pDM_VOID, + IN u4Byte *const dm_value + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pPATHDIV_T pDM_PathDiv = &(pDM_Odm->DM_PathDiv); + pDM_Odm->path_select = (dm_value[0] & 0xf); + + //2 [Fix Path] + if (pDM_Odm->path_select != PHYDM_AUTO_PATH) + { + phydm_dtp_fix_tx_path( pDM_Odm, pDM_Odm->path_select ); + } +} + +#endif // #if(defined(CONFIG_PATH_DIVERSITY)) + +VOID +phydm_c2h_dtp_handler( + IN PVOID pDM_VOID, + IN pu1Byte CmdBuf, + IN u1Byte CmdLen +) +{ +#if(defined(CONFIG_PATH_DIVERSITY)) + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pPATHDIV_T pDM_PathDiv = &(pDM_Odm->DM_PathDiv); + + u1Byte macid = CmdBuf[0]; + u1Byte nsc_1 = CmdBuf[1]; + u1Byte nsc_2 = CmdBuf[2]; + u1Byte nsc_3 = CmdBuf[3]; + + if( (nsc_1 >= nsc_2) && (nsc_1 >= nsc_3)) + { + phydm_dtp_fix_tx_path(pDM_Odm, pDM_PathDiv->ant_candidate_1); + } + else if( nsc_2 >= nsc_3) + { + phydm_dtp_fix_tx_path(pDM_Odm, pDM_PathDiv->ant_candidate_2); + } + else + { + phydm_dtp_fix_tx_path(pDM_Odm, pDM_PathDiv->ant_candidate_3); + } +#endif +} + +VOID +odm_PathDiversity( + IN PVOID pDM_VOID +) +{ +#if(defined(CONFIG_PATH_DIVERSITY)) + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + if(!(pDM_Odm->SupportAbility & ODM_BB_PATH_DIV)) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_PATH_DIV,ODM_DBG_LOUD,("Return: Not Support PathDiv\n")); + return; + } + + #if RTL8812A_SUPPORT + + if(pDM_Odm->SupportICType & ODM_RTL8812) + ODM_PathDiversity_8812A(pDM_Odm); + else + #endif + + #if RTL8814A_SUPPORT + if(pDM_Odm->SupportICType & ODM_RTL8814A) + phydm_dynamic_tx_path(pDM_Odm); + else + #endif + {} +#endif +} + +VOID +odm_PathDiversityInit( + IN PVOID pDM_VOID +) +{ +#if(defined(CONFIG_PATH_DIVERSITY)) + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + + if(pDM_Odm->mp_mode == TRUE) + return; + + if(!(pDM_Odm->SupportAbility & ODM_BB_PATH_DIV)) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_PATH_DIV,ODM_DBG_LOUD,("Return: Not Support PathDiv\n")); + return; + } + + #if RTL8812A_SUPPORT + if(pDM_Odm->SupportICType & ODM_RTL8812) + ODM_PathDiversityInit_8812A(pDM_Odm); + else + #endif + + #if RTL8814A_SUPPORT + if(pDM_Odm->SupportICType & ODM_RTL8814A) + phydm_dynamic_tx_path_init(pDM_Odm); + else + #endif + {} +#endif +} + + + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) +// +// 2011/12/02 MH Copy from MP oursrc for temporarily test. +// + +BOOLEAN +odm_IsConnected_92C( + IN PADAPTER Adapter +) +{ + PRT_WLAN_STA pEntry; + PMGNT_INFO pMgntInfo = &(Adapter->MgntInfo); + u4Byte i; + BOOLEAN bConnected=FALSE; + + if(pMgntInfo->mAssoc) + { + bConnected = TRUE; + } + else + { + for(i = 0; i < ODM_ASSOCIATE_ENTRY_NUM; i++) + { + if(IsAPModeExist(Adapter) && GetFirstExtAdapter(Adapter) != NULL) + pEntry = AsocEntry_EnumStation(GetFirstExtAdapter(Adapter), i); + else + pEntry = AsocEntry_EnumStation(GetDefaultAdapter(Adapter), i); + + if(pEntry!=NULL) + { + if(pEntry->bAssociated) + { + bConnected = TRUE; + break; + } + } + else + { + break; + } + } + } + return bConnected; +} + +BOOLEAN +ODM_PathDiversityBeforeLink92C( + //IN PADAPTER Adapter + IN PDM_ODM_T pDM_Odm + ) +{ +#if (RT_MEM_SIZE_LEVEL != RT_MEM_SIZE_MINIMUM) + PADAPTER Adapter = pDM_Odm->Adapter; + HAL_DATA_TYPE* pHalData = NULL; + PMGNT_INFO pMgntInfo = NULL; + //pSWAT_T pDM_SWAT_Table = &Adapter->DM_SWAT_Table; + pPD_T pDM_PDTable = NULL; + + s1Byte Score = 0; + PRT_WLAN_BSS pTmpBssDesc; + PRT_WLAN_BSS pTestBssDesc; + + u1Byte target_chnl = 0; + u2Byte index; + + if (pDM_Odm->Adapter == NULL) //For BSOD when plug/unplug fast. //By YJ,120413 + { // The ODM structure is not initialized. + return FALSE; + } + pHalData = GET_HAL_DATA(Adapter); + pMgntInfo = &Adapter->MgntInfo; + pDM_PDTable = &Adapter->DM_PDTable; + + // Condition that does not need to use path diversity. + if((!(pHalData->CVID_Version==VERSION_1_BEFORE_8703B && IS_92C_SERIAL(pHalData->VersionID))) || (pHalData->PathDivCfg!=1) || pMgntInfo->AntennaTest ) + { + RT_TRACE(COMP_INIT, DBG_LOUD, + ("ODM_PathDiversityBeforeLink92C(): No PathDiv Mechanism before link.\n")); + return FALSE; + } + + // Since driver is going to set BB register, it shall check if there is another thread controlling BB/RF. + PlatformAcquireSpinLock(Adapter, RT_RF_STATE_SPINLOCK); + if(pHalData->eRFPowerState!=eRfOn || pMgntInfo->RFChangeInProgress || pMgntInfo->bMediaConnect) + { + PlatformReleaseSpinLock(Adapter, RT_RF_STATE_SPINLOCK); + + RT_TRACE(COMP_INIT, DBG_LOUD, + ("ODM_PathDiversityBeforeLink92C(): RFChangeInProgress(%x), eRFPowerState(%x)\n", + pMgntInfo->RFChangeInProgress, + pHalData->eRFPowerState)); + + //pDM_SWAT_Table->SWAS_NoLink_State = 0; + pDM_PDTable->PathDiv_NoLink_State = 0; + + return FALSE; + } + else + { + PlatformReleaseSpinLock(Adapter, RT_RF_STATE_SPINLOCK); + } + + //1 Run AntDiv mechanism "Before Link" part. + //if(pDM_SWAT_Table->SWAS_NoLink_State == 0) + if(pDM_PDTable->PathDiv_NoLink_State == 0) + { + //1 Prepare to do Scan again to check current antenna state. + + // Set check state to next step. + //pDM_SWAT_Table->SWAS_NoLink_State = 1; + pDM_PDTable->PathDiv_NoLink_State = 1; + + // Copy Current Scan list. + Adapter->MgntInfo.tmpNumBssDesc = pMgntInfo->NumBssDesc; + PlatformMoveMemory((PVOID)Adapter->MgntInfo.tmpbssDesc, (PVOID)pMgntInfo->bssDesc, sizeof(RT_WLAN_BSS)*MAX_BSS_DESC); + + // Switch Antenna to another one. + if(pDM_PDTable->DefaultRespPath == 0) + { + PHY_SetBBReg(Adapter, rCCK0_AFESetting , 0x0F000000, 0x05); // TRX path = PathB + odm_SetRespPath_92C(Adapter, 1); + pDM_PDTable->OFDMTXPath = 0xFFFFFFFF; + pDM_PDTable->CCKTXPath = 0xFFFFFFFF; + } + else + { + PHY_SetBBReg(Adapter, rCCK0_AFESetting , 0x0F000000, 0x00); // TRX path = PathA + odm_SetRespPath_92C(Adapter, 0); + pDM_PDTable->OFDMTXPath = 0x0; + pDM_PDTable->CCKTXPath = 0x0; + } +#if 0 + + pDM_SWAT_Table->PreAntenna = pDM_SWAT_Table->CurAntenna; + pDM_SWAT_Table->CurAntenna = (pDM_SWAT_Table->CurAntenna==Antenna_A)?Antenna_B:Antenna_A; + + RT_TRACE(COMP_INIT, DBG_LOUD, + ("ODM_SwAntDivCheckBeforeLink: Change to Ant(%s) for testing.\n", (pDM_SWAT_Table->CurAntenna==Antenna_A)?"A":"B")); + //PHY_SetBBReg(Adapter, rFPGA0_XA_RFInterfaceOE, 0x300, DM_SWAT_Table.CurAntenna); + pDM_SWAT_Table->SWAS_NoLink_BK_Reg860 = ((pDM_SWAT_Table->SWAS_NoLink_BK_Reg860 & 0xfffffcff) | (pDM_SWAT_Table->CurAntenna<<8)); + PHY_SetBBReg(Adapter, rFPGA0_XA_RFInterfaceOE, bMaskDWord, pDM_SWAT_Table->SWAS_NoLink_BK_Reg860); +#endif + + // Go back to scan function again. + RT_TRACE(COMP_INIT, DBG_LOUD, ("ODM_PathDiversityBeforeLink92C: Scan one more time\n")); + pMgntInfo->ScanStep=0; + target_chnl = odm_SwAntDivSelectScanChnl(Adapter); + odm_SwAntDivConstructScanChnl(Adapter, target_chnl); + PlatformSetTimer(Adapter, &pMgntInfo->ScanTimer, 5); + + return TRUE; + } + else + { + //1 ScanComple() is called after antenna swiched. + //1 Check scan result and determine which antenna is going + //1 to be used. + + for(index=0; indexMgntInfo.tmpNumBssDesc; index++) + { + pTmpBssDesc = &(Adapter->MgntInfo.tmpbssDesc[index]); + pTestBssDesc = &(pMgntInfo->bssDesc[index]); + + if(PlatformCompareMemory(pTestBssDesc->bdBssIdBuf, pTmpBssDesc->bdBssIdBuf, 6)!=0) + { + RT_TRACE(COMP_INIT, DBG_LOUD, ("ODM_PathDiversityBeforeLink92C(): ERROR!! This shall not happen.\n")); + continue; + } + + if(pTmpBssDesc->RecvSignalPower > pTestBssDesc->RecvSignalPower) + { + RT_TRACE(COMP_INIT, DBG_LOUD, ("ODM_PathDiversityBeforeLink92C: Compare scan entry: Score++\n")); + RT_PRINT_STR(COMP_INIT, DBG_LOUD, "SSID: ", pTestBssDesc->bdSsIdBuf, pTestBssDesc->bdSsIdLen); + RT_TRACE(COMP_INIT, DBG_LOUD, ("Original: %d, Test: %d\n", pTmpBssDesc->RecvSignalPower, pTestBssDesc->RecvSignalPower)); + + Score++; + PlatformMoveMemory(pTestBssDesc, pTmpBssDesc, sizeof(RT_WLAN_BSS)); + } + else if(pTmpBssDesc->RecvSignalPower < pTestBssDesc->RecvSignalPower) + { + RT_TRACE(COMP_INIT, DBG_LOUD, ("ODM_PathDiversityBeforeLink92C: Compare scan entry: Score--\n")); + RT_PRINT_STR(COMP_INIT, DBG_LOUD, "SSID: ", pTestBssDesc->bdSsIdBuf, pTestBssDesc->bdSsIdLen); + RT_TRACE(COMP_INIT, DBG_LOUD, ("Original: %d, Test: %d\n", pTmpBssDesc->RecvSignalPower, pTestBssDesc->RecvSignalPower)); + Score--; + } + + } + + if(pMgntInfo->NumBssDesc!=0 && Score<=0) + { + RT_TRACE(COMP_INIT, DBG_LOUD, + ("ODM_PathDiversityBeforeLink92C(): DefaultRespPath=%d\n", pDM_PDTable->DefaultRespPath)); + + //pDM_SWAT_Table->PreAntenna = pDM_SWAT_Table->CurAntenna; + } + else + { + RT_TRACE(COMP_INIT, DBG_LOUD, + ("ODM_PathDiversityBeforeLink92C(): DefaultRespPath=%d\n", pDM_PDTable->DefaultRespPath)); + + if(pDM_PDTable->DefaultRespPath == 0) + { + pDM_PDTable->OFDMTXPath = 0xFFFFFFFF; + pDM_PDTable->CCKTXPath = 0xFFFFFFFF; + odm_SetRespPath_92C(Adapter, 1); + } + else + { + pDM_PDTable->OFDMTXPath = 0x0; + pDM_PDTable->CCKTXPath = 0x0; + odm_SetRespPath_92C(Adapter, 0); + } + PHY_SetBBReg(Adapter, rCCK0_AFESetting , 0x0F000000, 0x01); // RX path = PathAB + + //pDM_SWAT_Table->CurAntenna = pDM_SWAT_Table->PreAntenna; + + //PHY_SetBBReg(Adapter, rFPGA0_XA_RFInterfaceOE, 0x300, DM_SWAT_Table.CurAntenna); + //pDM_SWAT_Table->SWAS_NoLink_BK_Reg860 = ((pDM_SWAT_Table->SWAS_NoLink_BK_Reg860 & 0xfffffcff) | (pDM_SWAT_Table->CurAntenna<<8)); + //PHY_SetBBReg(Adapter, rFPGA0_XA_RFInterfaceOE, bMaskDWord, pDM_SWAT_Table->SWAS_NoLink_BK_Reg860); + } + + // Check state reset to default and wait for next time. + //pDM_SWAT_Table->SWAS_NoLink_State = 0; + pDM_PDTable->PathDiv_NoLink_State = 0; + + return FALSE; + } +#else + return FALSE; +#endif + +} + + + +VOID +odm_PathDiversityAfterLink_92C( + IN PADAPTER Adapter +) +{ + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; + pPD_T pDM_PDTable = &Adapter->DM_PDTable; + u1Byte DefaultRespPath=0; + + if((!(pHalData->CVID_Version==VERSION_1_BEFORE_8703B && IS_92C_SERIAL(pHalData->VersionID))) || (pHalData->PathDivCfg != 1) || (pHalData->eRFPowerState == eRfOff)) + { + if(pHalData->PathDivCfg == 0) + { + RT_TRACE( COMP_INIT, DBG_LOUD, ("No ODM_TXPathDiversity()\n")); + } + else + { + RT_TRACE( COMP_INIT, DBG_LOUD, ("2T ODM_TXPathDiversity()\n")); + } + return; + } + if(!odm_IsConnected_92C(Adapter)) + { + RT_TRACE( COMP_INIT, DBG_LOUD, ("ODM_TXPathDiversity(): No Connections\n")); + return; + } + + + if(pDM_PDTable->TrainingState == 0) + { + RT_TRACE( COMP_INIT, DBG_LOUD, ("ODM_TXPathDiversity() ==>\n")); + odm_OFDMTXPathDiversity_92C(Adapter); + + if((pDM_PDTable->CCKPathDivEnable == TRUE) && (pDM_PDTable->OFDM_Pkt_Cnt < 100)) + { + //RT_TRACE( COMP_INIT, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: TrainingState=0\n")); + + if(pDM_PDTable->CCK_Pkt_Cnt > 300) + pDM_PDTable->Timer = 20; + else if(pDM_PDTable->CCK_Pkt_Cnt > 100) + pDM_PDTable->Timer = 60; + else + pDM_PDTable->Timer = 250; + RT_TRACE( COMP_INIT, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: timer=%d\n",pDM_PDTable->Timer)); + + PHY_SetBBReg(Adapter, rCCK0_AFESetting , 0x0F000000, 0x00); // RX path = PathA + pDM_PDTable->TrainingState = 1; + pHalData->RSSI_test = TRUE; + ODM_SetTimer( pDM_Odm, &pDM_Odm->CCKPathDiversityTimer, pDM_PDTable->Timer); //ms + } + else + { + pDM_PDTable->CCKTXPath = pDM_PDTable->OFDMTXPath; + DefaultRespPath = pDM_PDTable->OFDMDefaultRespPath; + RT_TRACE( COMP_INIT, DBG_LOUD, ("odm_SetRespPath_92C: Skip odm_CCKTXPathDiversity_92C, DefaultRespPath is OFDM\n")); + odm_SetRespPath_92C(Adapter, DefaultRespPath); + odm_ResetPathDiversity_92C(Adapter); + RT_TRACE( COMP_INIT, DBG_LOUD, ("ODM_TXPathDiversity() <==\n")); + } + } + else if(pDM_PDTable->TrainingState == 1) + { + //RT_TRACE( COMP_INIT, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: TrainingState=1\n")); + PHY_SetBBReg(Adapter, rCCK0_AFESetting , 0x0F000000, 0x05); // RX path = PathB + pDM_PDTable->TrainingState = 2; + ODM_SetTimer( pDM_Odm, &pDM_Odm->CCKPathDiversityTimer, pDM_PDTable->Timer); //ms + } + else + { + //RT_TRACE( COMP_INIT, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: TrainingState=2\n")); + pDM_PDTable->TrainingState = 0; + odm_CCKTXPathDiversity_92C(Adapter); + if(pDM_PDTable->OFDM_Pkt_Cnt != 0) + { + DefaultRespPath = pDM_PDTable->OFDMDefaultRespPath; + RT_TRACE( COMP_INIT, DBG_LOUD, ("odm_SetRespPath_92C: DefaultRespPath is OFDM\n")); + } + else + { + DefaultRespPath = pDM_PDTable->CCKDefaultRespPath; + RT_TRACE( COMP_INIT, DBG_LOUD, ("odm_SetRespPath_92C: DefaultRespPath is CCK\n")); + } + odm_SetRespPath_92C(Adapter, DefaultRespPath); + odm_ResetPathDiversity_92C(Adapter); + RT_TRACE( COMP_INIT, DBG_LOUD, ("ODM_TXPathDiversity() <==\n")); + } + +} + +VOID +odm_SetRespPath_92C( + IN PADAPTER Adapter, + IN u1Byte DefaultRespPath + ) +{ + pPD_T pDM_PDTable = &Adapter->DM_PDTable; + + RT_TRACE( COMP_INIT, DBG_LOUD, ("odm_SetRespPath_92C: Select Response Path=%d\n",DefaultRespPath)); + if(DefaultRespPath != pDM_PDTable->DefaultRespPath) + { + if(DefaultRespPath == 0) + { + PlatformEFIOWrite1Byte(Adapter, 0x6D8, (PlatformEFIORead1Byte(Adapter, 0x6D8)&0xc0)|0x15); + } + else + { + PlatformEFIOWrite1Byte(Adapter, 0x6D8, (PlatformEFIORead1Byte(Adapter, 0x6D8)&0xc0)|0x2A); + } + } + pDM_PDTable->DefaultRespPath = DefaultRespPath; +} + +VOID +odm_OFDMTXPathDiversity_92C( + IN PADAPTER Adapter) +{ +// HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + PMGNT_INFO pMgntInfo = &(Adapter->MgntInfo); + PRT_WLAN_STA pEntry; + u1Byte i, DefaultRespPath = 0; + s4Byte MinRSSI = 0xFF; + pPD_T pDM_PDTable = &Adapter->DM_PDTable; + pDM_PDTable->OFDMTXPath = 0; + + //1 Default Port + if(pMgntInfo->mAssoc) + { + RT_TRACE( COMP_INIT, DBG_LOUD, ("odm_OFDMTXPathDiversity_92C: Default port RSSI[0]=%d, RSSI[1]=%d\n", + Adapter->RxStats.RxRSSIPercentage[0], Adapter->RxStats.RxRSSIPercentage[1])); + if(Adapter->RxStats.RxRSSIPercentage[0] > Adapter->RxStats.RxRSSIPercentage[1]) + { + pDM_PDTable->OFDMTXPath = pDM_PDTable->OFDMTXPath & (~BIT0); + MinRSSI = Adapter->RxStats.RxRSSIPercentage[1]; + DefaultRespPath = 0; + RT_TRACE( COMP_INIT, DBG_LOUD, ("odm_OFDMTXPathDiversity_92C: Default port Select Path-0\n")); + } + else + { + pDM_PDTable->OFDMTXPath = pDM_PDTable->OFDMTXPath | BIT0; + MinRSSI = Adapter->RxStats.RxRSSIPercentage[0]; + DefaultRespPath = 1; + RT_TRACE( COMP_INIT, DBG_LOUD, ("odm_OFDMTXPathDiversity_92C: Default port Select Path-1\n")); + } + //RT_TRACE( COMP_INIT, DBG_LOUD, ("pDM_PDTable->OFDMTXPath =0x%x\n",pDM_PDTable->OFDMTXPath)); + } + //1 Extension Port + for(i = 0; i < ODM_ASSOCIATE_ENTRY_NUM; i++) + { + if(IsAPModeExist(Adapter) && GetFirstExtAdapter(Adapter) != NULL) + pEntry = AsocEntry_EnumStation(GetFirstExtAdapter(Adapter), i); + else + pEntry = AsocEntry_EnumStation(GetDefaultAdapter(Adapter), i); + + if(pEntry!=NULL) + { + if(pEntry->bAssociated) + { + RT_TRACE( COMP_INIT, DBG_LOUD, ("odm_OFDMTXPathDiversity_92C: MACID=%d, RSSI_0=%d, RSSI_1=%d\n", + pEntry->AssociatedMacId, pEntry->rssi_stat.RxRSSIPercentage[0], pEntry->rssi_stat.RxRSSIPercentage[1])); + + if(pEntry->rssi_stat.RxRSSIPercentage[0] > pEntry->rssi_stat.RxRSSIPercentage[1]) + { + pDM_PDTable->OFDMTXPath = pDM_PDTable->OFDMTXPath & ~(BIT(pEntry->AssociatedMacId)); + //pHalData->TXPath = pHalData->TXPath & ~(1<<(pEntry->AssociatedMacId)); + RT_TRACE( COMP_INIT, DBG_LOUD, ("odm_OFDMTXPathDiversity_92C: MACID=%d Select Path-0\n", pEntry->AssociatedMacId)); + if(pEntry->rssi_stat.RxRSSIPercentage[1] < MinRSSI) + { + MinRSSI = pEntry->rssi_stat.RxRSSIPercentage[1]; + DefaultRespPath = 0; + } + } + else + { + pDM_PDTable->OFDMTXPath = pDM_PDTable->OFDMTXPath | BIT(pEntry->AssociatedMacId); + //pHalData->TXPath = pHalData->TXPath | (1 << (pEntry->AssociatedMacId)); + RT_TRACE( COMP_INIT, DBG_LOUD, ("odm_OFDMTXPathDiversity_92C: MACID=%d Select Path-1\n", pEntry->AssociatedMacId)); + if(pEntry->rssi_stat.RxRSSIPercentage[0] < MinRSSI) + { + MinRSSI = pEntry->rssi_stat.RxRSSIPercentage[0]; + DefaultRespPath = 1; + } + } + } + } + else + { + break; + } + } + + pDM_PDTable->OFDMDefaultRespPath = DefaultRespPath; +} + + +VOID +odm_CCKTXPathDiversity_92C( + IN PADAPTER Adapter +) +{ + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + PMGNT_INFO pMgntInfo = &(Adapter->MgntInfo); + PRT_WLAN_STA pEntry; + s4Byte MinRSSI = 0xFF; + u1Byte i, DefaultRespPath = 0; +// BOOLEAN bBModePathDiv = FALSE; + pPD_T pDM_PDTable = &Adapter->DM_PDTable; + + //1 Default Port + if(pMgntInfo->mAssoc) + { + if(pHalData->OFDM_Pkt_Cnt == 0) + { + for(i=0; i<2; i++) + { + if(pDM_PDTable->RSSI_CCK_Path_cnt[i] > 1) //Because the first packet is discarded + pDM_PDTable->RSSI_CCK_Path[i] = pDM_PDTable->RSSI_CCK_Path[i] / (pDM_PDTable->RSSI_CCK_Path_cnt[i]-1); + else + pDM_PDTable->RSSI_CCK_Path[i] = 0; + } + RT_TRACE( COMP_INIT, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: pDM_PDTable->RSSI_CCK_Path[0]=%d, pDM_PDTable->RSSI_CCK_Path[1]=%d\n", + pDM_PDTable->RSSI_CCK_Path[0], pDM_PDTable->RSSI_CCK_Path[1])); + RT_TRACE( COMP_INIT, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: pDM_PDTable->RSSI_CCK_Path_cnt[0]=%d, pDM_PDTable->RSSI_CCK_Path_cnt[1]=%d\n", + pDM_PDTable->RSSI_CCK_Path_cnt[0], pDM_PDTable->RSSI_CCK_Path_cnt[1])); + + if(pDM_PDTable->RSSI_CCK_Path[0] > pDM_PDTable->RSSI_CCK_Path[1]) + { + pDM_PDTable->CCKTXPath = pDM_PDTable->CCKTXPath & (~BIT0); + MinRSSI = pDM_PDTable->RSSI_CCK_Path[1]; + DefaultRespPath = 0; + RT_TRACE( COMP_INIT, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: Default port Select CCK Path-0\n")); + } + else if(pDM_PDTable->RSSI_CCK_Path[0] < pDM_PDTable->RSSI_CCK_Path[1]) + { + pDM_PDTable->CCKTXPath = pDM_PDTable->CCKTXPath | BIT0; + MinRSSI = pDM_PDTable->RSSI_CCK_Path[0]; + DefaultRespPath = 1; + RT_TRACE( COMP_INIT, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: Default port Select CCK Path-1\n")); + } + else + { + if((pDM_PDTable->RSSI_CCK_Path[0] != 0) && (pDM_PDTable->RSSI_CCK_Path[0] < MinRSSI)) + { + pDM_PDTable->CCKTXPath = pDM_PDTable->CCKTXPath & (~BIT0); + RT_TRACE( COMP_INIT, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: Default port Select CCK Path-0\n")); + MinRSSI = pDM_PDTable->RSSI_CCK_Path[1]; + DefaultRespPath = 0; + } + else + { + RT_TRACE( COMP_INIT, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: Default port unchange CCK Path\n")); + } + } + } + else //Follow OFDM decision + { + pDM_PDTable->CCKTXPath = (pDM_PDTable->CCKTXPath & (~BIT0)) | (pDM_PDTable->OFDMTXPath &BIT0); + RT_TRACE( COMP_INIT, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: Follow OFDM decision, Default port Select CCK Path-%d\n", + pDM_PDTable->CCKTXPath &BIT0)); + } + } + //1 Extension Port + for(i = 0; i < ODM_ASSOCIATE_ENTRY_NUM; i++) + { + if(IsAPModeExist(Adapter) && GetFirstExtAdapter(Adapter) != NULL) + pEntry = AsocEntry_EnumStation(GetFirstExtAdapter(Adapter), i); + else + pEntry = AsocEntry_EnumStation(GetDefaultAdapter(Adapter), i); + + if(pEntry!=NULL) + { + if(pEntry->bAssociated) + { + if(pEntry->rssi_stat.OFDM_Pkt_Cnt == 0) + { + u1Byte j=0; + for(j=0; j<2; j++) + { + if(pEntry->rssi_stat.RSSI_CCK_Path_cnt[j] > 1) + pEntry->rssi_stat.RSSI_CCK_Path[j] = pEntry->rssi_stat.RSSI_CCK_Path[j] / (pEntry->rssi_stat.RSSI_CCK_Path_cnt[j]-1); + else + pEntry->rssi_stat.RSSI_CCK_Path[j] = 0; + } + RT_TRACE( COMP_INIT, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: MACID=%d, RSSI_CCK0=%d, RSSI_CCK1=%d\n", + pEntry->AssociatedMacId, pEntry->rssi_stat.RSSI_CCK_Path[0], pEntry->rssi_stat.RSSI_CCK_Path[1])); + + if(pEntry->rssi_stat.RSSI_CCK_Path[0] >pEntry->rssi_stat.RSSI_CCK_Path[1]) + { + pDM_PDTable->CCKTXPath = pDM_PDTable->CCKTXPath & ~(BIT(pEntry->AssociatedMacId)); + RT_TRACE( COMP_INIT, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: MACID=%d Select CCK Path-0\n", pEntry->AssociatedMacId)); + if(pEntry->rssi_stat.RSSI_CCK_Path[1] < MinRSSI) + { + MinRSSI = pEntry->rssi_stat.RSSI_CCK_Path[1]; + DefaultRespPath = 0; + } + } + else if(pEntry->rssi_stat.RSSI_CCK_Path[0] rssi_stat.RSSI_CCK_Path[1]) + { + pDM_PDTable->CCKTXPath = pDM_PDTable->CCKTXPath | BIT(pEntry->AssociatedMacId); + RT_TRACE( COMP_INIT, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: MACID=%d Select CCK Path-1\n", pEntry->AssociatedMacId)); + if(pEntry->rssi_stat.RSSI_CCK_Path[0] < MinRSSI) + { + MinRSSI = pEntry->rssi_stat.RSSI_CCK_Path[0]; + DefaultRespPath = 1; + } + } + else + { + if((pEntry->rssi_stat.RSSI_CCK_Path[0] != 0) && (pEntry->rssi_stat.RSSI_CCK_Path[0] < MinRSSI)) + { + pDM_PDTable->CCKTXPath = pDM_PDTable->CCKTXPath & ~(BIT(pEntry->AssociatedMacId)); + MinRSSI = pEntry->rssi_stat.RSSI_CCK_Path[1]; + DefaultRespPath = 0; + RT_TRACE( COMP_INIT, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: MACID=%d Select CCK Path-0\n", pEntry->AssociatedMacId)); + } + else + { + RT_TRACE( COMP_INIT, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: MACID=%d unchange CCK Path\n", pEntry->AssociatedMacId)); + } + } + } + else //Follow OFDM decision + { + pDM_PDTable->CCKTXPath = (pDM_PDTable->CCKTXPath & (~(BIT(pEntry->AssociatedMacId)))) | (pDM_PDTable->OFDMTXPath & BIT(pEntry->AssociatedMacId)); + RT_TRACE( COMP_INIT, DBG_LOUD, ("odm_CCKTXPathDiversity_92C: Follow OFDM decision, MACID=%d Select CCK Path-%d\n", + pEntry->AssociatedMacId, (pDM_PDTable->CCKTXPath & BIT(pEntry->AssociatedMacId))>>(pEntry->AssociatedMacId))); + } + } + } + else + { + break; + } + } + + RT_TRACE( COMP_INIT, DBG_LOUD, ("odm_CCKTXPathDiversity_92C:MinRSSI=%d\n",MinRSSI)); + + if(MinRSSI == 0xFF) + DefaultRespPath = pDM_PDTable->CCKDefaultRespPath; + + pDM_PDTable->CCKDefaultRespPath = DefaultRespPath; +} + + +VOID +odm_ResetPathDiversity_92C( + IN PADAPTER Adapter +) +{ + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + pPD_T pDM_PDTable = &Adapter->DM_PDTable; + PRT_WLAN_STA pEntry; + u4Byte i,j; + + pHalData->RSSI_test = FALSE; + pDM_PDTable->CCK_Pkt_Cnt = 0; + pDM_PDTable->OFDM_Pkt_Cnt = 0; + pHalData->CCK_Pkt_Cnt =0; + pHalData->OFDM_Pkt_Cnt =0; + + if(pDM_PDTable->CCKPathDivEnable == TRUE) + PHY_SetBBReg(Adapter, rCCK0_AFESetting , 0x0F000000, 0x01); //RX path = PathAB + + for(i=0; i<2; i++) + { + pDM_PDTable->RSSI_CCK_Path_cnt[i]=0; + pDM_PDTable->RSSI_CCK_Path[i] = 0; + } + for(i = 0; i < ODM_ASSOCIATE_ENTRY_NUM; i++) + { + if(IsAPModeExist(Adapter) && GetFirstExtAdapter(Adapter) != NULL) + pEntry = AsocEntry_EnumStation(GetFirstExtAdapter(Adapter), i); + else + pEntry = AsocEntry_EnumStation(GetDefaultAdapter(Adapter), i); + + if(pEntry!=NULL) + { + pEntry->rssi_stat.CCK_Pkt_Cnt = 0; + pEntry->rssi_stat.OFDM_Pkt_Cnt = 0; + for(j=0; j<2; j++) + { + pEntry->rssi_stat.RSSI_CCK_Path_cnt[j] = 0; + pEntry->rssi_stat.RSSI_CCK_Path[j] = 0; + } + } + else + break; + } +} + + + + + +VOID +odm_CCKTXPathDiversityCallback( + PRT_TIMER pTimer +) +{ +#if USE_WORKITEM + PADAPTER Adapter = (PADAPTER)pTimer->Adapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; +#else + PADAPTER Adapter = (PADAPTER)pTimer->Adapter; +#endif + +#if DEV_BUS_TYPE==RT_PCI_INTERFACE +#if USE_WORKITEM + PlatformScheduleWorkItem(&pDM_Odm->CCKPathDiversityWorkitem); +#else + odm_PathDiversityAfterLink_92C(Adapter); +#endif +#else + PlatformScheduleWorkItem(&pDM_Odm->CCKPathDiversityWorkitem); +#endif + +} + + +VOID +odm_CCKTXPathDiversityWorkItemCallback( + IN PVOID pContext + ) +{ + PADAPTER Adapter = (PADAPTER)pContext; + + odm_CCKTXPathDiversity_92C(Adapter); +} + +// +// 20100514 Luke/Joseph: +// Callback function for 500ms antenna test trying. +// +VOID +odm_PathDivChkAntSwitchCallback( + PRT_TIMER pTimer +) +{ + PADAPTER Adapter = (PADAPTER)pTimer->Adapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; + +#if DEV_BUS_TYPE==RT_PCI_INTERFACE + +#if USE_WORKITEM + PlatformScheduleWorkItem(&pDM_Odm->PathDivSwitchWorkitem); +#else + odm_PathDivChkAntSwitch(pDM_Odm); +#endif +#else + PlatformScheduleWorkItem(&pDM_Odm->PathDivSwitchWorkitem); +#endif + +//odm_SwAntDivChkAntSwitch(Adapter, SWAW_STEP_DETERMINE); + +} + + +VOID +odm_PathDivChkAntSwitchWorkitemCallback( + IN PVOID pContext + ) +{ + PADAPTER pAdapter = (PADAPTER)pContext; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); + PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; + + odm_PathDivChkAntSwitch(pDM_Odm); +} + + + //MAC0_ACCESS_PHY1 + +// 2011-06-22 Neil Chen & Gary Hsin +// Refer to Jr.Luke's SW ANT DIV +// 92D Path Diversity Main function +// refer to 88C software antenna diversity +// +VOID +odm_PathDivChkAntSwitch( + PDM_ODM_T pDM_Odm + //PADAPTER Adapter, + //u1Byte Step +) +{ + PADAPTER Adapter = pDM_Odm->Adapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + PMGNT_INFO pMgntInfo = &Adapter->MgntInfo; + + + pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; + s4Byte curRSSI=100, RSSI_A, RSSI_B; + u1Byte nextAntenna=AUX_ANT; + static u8Byte lastTxOkCnt=0, lastRxOkCnt=0; + u8Byte curTxOkCnt, curRxOkCnt; + static u8Byte TXByteCnt_A=0, TXByteCnt_B=0, RXByteCnt_A=0, RXByteCnt_B=0; + u8Byte CurByteCnt=0, PreByteCnt=0; + static u1Byte TrafficLoad = TRAFFIC_LOW; + u1Byte Score_A=0, Score_B=0; + u1Byte i=0x0; + // Neil Chen + static u1Byte pathdiv_para=0x0; + static u1Byte switchfirsttime=0x00; + // u1Byte regB33 = (u1Byte) PHY_QueryBBReg(Adapter, 0xB30,BIT27); + u1Byte regB33 = (u1Byte)ODM_GetBBReg(pDM_Odm, PATHDIV_REG, BIT27); + + + //u1Byte reg637 =0x0; + static u1Byte fw_value=0x0; + //u8Byte curTxOkCnt_tmp, curRxOkCnt_tmp; + PADAPTER BuddyAdapter = Adapter->BuddyAdapter; // another adapter MAC + // Path Diversity //Neil Chen--2011--06--22 + + //u1Byte PathDiv_Trigger = (u1Byte) PHY_QueryBBReg(Adapter, 0xBA0,BIT31); + u1Byte PathDiv_Trigger = (u1Byte) ODM_GetBBReg(pDM_Odm, PATHDIV_TRI,BIT31); + u1Byte PathDiv_Enable = pHalData->bPathDiv_Enable; + + + //DbgPrint("Path Div PG Value:%x \n",PathDiv_Enable); + if((BuddyAdapter==NULL)||(!PathDiv_Enable)||(PathDiv_Trigger)||(pHalData->CurrentBandType == BAND_ON_2_4G)) + { + return; + } + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD,("===================>odm_PathDivChkAntSwitch()\n")); + + // The first time to switch path excluding 2nd, 3rd, ....etc.... + if(switchfirsttime==0) + { + if(regB33==0) + { + pDM_SWAT_Table->CurAntenna = MAIN_ANT; // Default MAC0_5G-->Path A (current antenna) + } + } + + // Condition that does not need to use antenna diversity. + if(pDM_Odm->SupportICType != ODM_RTL8192D) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("odm_PathDiversityMechanims(): No PathDiv Mechanism.\n")); + return; + } + + // Radio off: Status reset to default and return. + if(pHalData->eRFPowerState==eRfOff) + { + //ODM_SwAntDivRestAfterLink(Adapter); + return; + } + + /* + // Handling step mismatch condition. + // Peak step is not finished at last time. Recover the variable and check again. + if( Step != pDM_SWAT_Table->try_flag ) + { + ODM_SwAntDivRestAfterLink(Adapter); + } */ + + if(pDM_SWAT_Table->try_flag == 0xff) + { + // Select RSSI checking target + if(pMgntInfo->mAssoc && !ACTING_AS_AP(Adapter)) + { + // Target: Infrastructure mode AP. + pHalData->RSSI_target = NULL; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("odm_PathDivMechanism(): RSSI_target is DEF AP!\n")); + } + else + { + u1Byte index = 0; + PRT_WLAN_STA pEntry = NULL; + PADAPTER pTargetAdapter = NULL; + + if( pMgntInfo->mIbss || ACTING_AS_AP(Adapter) ) + { + // Target: AP/IBSS peer. + pTargetAdapter = Adapter; + } + else if(IsAPModeExist(Adapter) && GetFirstExtAdapter(Adapter) != NULL) + { + // Target: VWIFI peer. + pTargetAdapter = GetFirstExtAdapter(Adapter); + } + + if(pTargetAdapter != NULL) + { + for(index=0; indexbAssociated) + break; + } + } + } + + if(pEntry == NULL) + { + ODM_PathDivRestAfterLink(pDM_Odm); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("odm_SwAntDivChkAntSwitch(): No Link.\n")); + return; + } + else + { + pHalData->RSSI_target = pEntry; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("odm_SwAntDivChkAntSwitch(): RSSI_target is PEER STA\n")); + } + } + + pHalData->RSSI_cnt_A = 0; + pHalData->RSSI_cnt_B = 0; + pDM_SWAT_Table->try_flag = 0; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("odm_SwAntDivChkAntSwitch(): Set try_flag to 0 prepare for peak!\n")); + return; + } + else + { + // 1st step + curTxOkCnt = Adapter->TxStats.NumTxBytesUnicast - lastTxOkCnt; + curRxOkCnt = Adapter->RxStats.NumRxBytesUnicast - lastRxOkCnt; + lastTxOkCnt = Adapter->TxStats.NumTxBytesUnicast; + lastRxOkCnt = Adapter->RxStats.NumRxBytesUnicast; + + if(pDM_SWAT_Table->try_flag == 1) // Training State + { + if(pDM_SWAT_Table->CurAntenna == MAIN_ANT) + { + TXByteCnt_A += curTxOkCnt; + RXByteCnt_A += curRxOkCnt; + } + else + { + TXByteCnt_B += curTxOkCnt; + RXByteCnt_B += curRxOkCnt; + } + + nextAntenna = (pDM_SWAT_Table->CurAntenna == MAIN_ANT)? AUX_ANT : MAIN_ANT; + pDM_SWAT_Table->RSSI_Trying--; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH DIV=: RSSI_Trying = %d\n",pDM_SWAT_Table->RSSI_Trying)); + if(pDM_SWAT_Table->RSSI_Trying == 0) + { + CurByteCnt = (pDM_SWAT_Table->CurAntenna == MAIN_ANT)? (TXByteCnt_A+RXByteCnt_A) : (TXByteCnt_B+RXByteCnt_B); + PreByteCnt = (pDM_SWAT_Table->CurAntenna == MAIN_ANT)? (TXByteCnt_B+RXByteCnt_B) : (TXByteCnt_A+RXByteCnt_A); + + if(TrafficLoad == TRAFFIC_HIGH) + { + //CurByteCnt = PlatformDivision64(CurByteCnt, 9); + PreByteCnt =PreByteCnt*9; + } + else if(TrafficLoad == TRAFFIC_LOW) + { + //CurByteCnt = PlatformDivision64(CurByteCnt, 2); + PreByteCnt =PreByteCnt*2; + } + if(pHalData->RSSI_cnt_A > 0) + RSSI_A = pHalData->RSSI_sum_A/pHalData->RSSI_cnt_A; + else + RSSI_A = 0; + if(pHalData->RSSI_cnt_B > 0) + RSSI_B = pHalData->RSSI_sum_B/pHalData->RSSI_cnt_B; + else + RSSI_B = 0; + curRSSI = (pDM_SWAT_Table->CurAntenna == MAIN_ANT)? RSSI_A : RSSI_B; + pDM_SWAT_Table->PreRSSI = (pDM_SWAT_Table->CurAntenna == MAIN_ANT)? RSSI_B : RSSI_A; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH DIV=: PreRSSI = %d, CurRSSI = %d\n",pDM_SWAT_Table->PreRSSI, curRSSI)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH DIV=: preAntenna= %s, curAntenna= %s \n", + (pDM_SWAT_Table->PreAntenna == MAIN_ANT?"MAIN":"AUX"), (pDM_SWAT_Table->CurAntenna == MAIN_ANT?"MAIN":"AUX"))); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH DIV=: RSSI_A= %d, RSSI_cnt_A = %d, RSSI_B= %d, RSSI_cnt_B = %d\n", + RSSI_A, pHalData->RSSI_cnt_A, RSSI_B, pHalData->RSSI_cnt_B)); + } + + } + else // try_flag=0 + { + + if(pHalData->RSSI_cnt_A > 0) + RSSI_A = pHalData->RSSI_sum_A/pHalData->RSSI_cnt_A; + else + RSSI_A = 0; + if(pHalData->RSSI_cnt_B > 0) + RSSI_B = pHalData->RSSI_sum_B/pHalData->RSSI_cnt_B; + else + RSSI_B = 0; + curRSSI = (pDM_SWAT_Table->CurAntenna == MAIN_ANT)? RSSI_A : RSSI_B; + pDM_SWAT_Table->PreRSSI = (pDM_SWAT_Table->PreAntenna == MAIN_ANT)? RSSI_A : RSSI_B; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH DIV=: PreRSSI = %d, CurRSSI = %d\n", pDM_SWAT_Table->PreRSSI, curRSSI)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH DIV=: preAntenna= %s, curAntenna= %s \n", + (pDM_SWAT_Table->PreAntenna == MAIN_ANT?"MAIN":"AUX"), (pDM_SWAT_Table->CurAntenna == MAIN_ANT?"MAIN":"AUX"))); + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH DIV=: RSSI_A= %d, RSSI_cnt_A = %d, RSSI_B= %d, RSSI_cnt_B = %d\n", + RSSI_A, pHalData->RSSI_cnt_A, RSSI_B, pHalData->RSSI_cnt_B)); + //RT_TRACE(COMP_INIT, DBG_LOUD, ("Ekul:curTxOkCnt = %d\n", curTxOkCnt)); + //RT_TRACE(COMP_INIT, DBG_LOUD, ("Ekul:curRxOkCnt = %d\n", curRxOkCnt)); + } + + //1 Trying State + if((pDM_SWAT_Table->try_flag == 1)&&(pDM_SWAT_Table->RSSI_Trying == 0)) + { + + if(pDM_SWAT_Table->TestMode == TP_MODE) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH=: TestMode = TP_MODE")); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH= TRY:CurByteCnt = %"i64fmt"d,", CurByteCnt)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH= TRY:PreByteCnt = %"i64fmt"d\n",PreByteCnt)); + if(CurByteCnt < PreByteCnt) + { + if(pDM_SWAT_Table->CurAntenna == MAIN_ANT) + pDM_SWAT_Table->SelectAntennaMap=pDM_SWAT_Table->SelectAntennaMap<<1; + else + pDM_SWAT_Table->SelectAntennaMap=(pDM_SWAT_Table->SelectAntennaMap<<1)+1; + } + else + { + if(pDM_SWAT_Table->CurAntenna == MAIN_ANT) + pDM_SWAT_Table->SelectAntennaMap=(pDM_SWAT_Table->SelectAntennaMap<<1)+1; + else + pDM_SWAT_Table->SelectAntennaMap=pDM_SWAT_Table->SelectAntennaMap<<1; + } + for (i= 0; i<8; i++) + { + if(((pDM_SWAT_Table->SelectAntennaMap>>i)&BIT0) == 1) + Score_A++; + else + Score_B++; + } + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("SelectAntennaMap=%x\n ",pDM_SWAT_Table->SelectAntennaMap)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH=: Score_A=%d, Score_B=%d\n", Score_A, Score_B)); + + if(pDM_SWAT_Table->CurAntenna == MAIN_ANT) + { + nextAntenna = (Score_A >= Score_B)?MAIN_ANT:AUX_ANT; + } + else + { + nextAntenna = (Score_B >= Score_A)?AUX_ANT:MAIN_ANT; + } + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH=: nextAntenna=%s\n",(nextAntenna==MAIN_ANT)?"MAIN":"AUX")); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH=: preAntenna= %s, curAntenna= %s \n", + (pDM_SWAT_Table->PreAntenna == MAIN_ANT?"MAIN":"AUX"), (pDM_SWAT_Table->CurAntenna == MAIN_ANT?"MAIN":"AUX"))); + + if(nextAntenna != pDM_SWAT_Table->CurAntenna) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH=: Switch back to another antenna")); + } + else + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH=: current anntena is good\n")); + } + } + + + if(pDM_SWAT_Table->TestMode == RSSI_MODE) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH=: TestMode = RSSI_MODE")); + pDM_SWAT_Table->SelectAntennaMap=0xAA; + if(curRSSI < pDM_SWAT_Table->PreRSSI) //Current antenna is worse than previous antenna + { + //RT_TRACE(COMP_INIT, DBG_LOUD, ("SWAS: Switch back to another antenna")); + nextAntenna = (pDM_SWAT_Table->CurAntenna == MAIN_ANT)?AUX_ANT : MAIN_ANT; + } + else // current anntena is good + { + nextAntenna =pDM_SWAT_Table->CurAntenna; + //RT_TRACE(COMP_INIT, DBG_LOUD, ("SWAS: current anntena is good\n")); + } + } + + pDM_SWAT_Table->try_flag = 0; + pHalData->RSSI_test = FALSE; + pHalData->RSSI_sum_A = 0; + pHalData->RSSI_cnt_A = 0; + pHalData->RSSI_sum_B = 0; + pHalData->RSSI_cnt_B = 0; + TXByteCnt_A = 0; + TXByteCnt_B = 0; + RXByteCnt_A = 0; + RXByteCnt_B = 0; + + } + + //1 Normal State + else if(pDM_SWAT_Table->try_flag == 0) + { + if(TrafficLoad == TRAFFIC_HIGH) + { + if ((curTxOkCnt+curRxOkCnt) > 3750000)//if(PlatformDivision64(curTxOkCnt+curRxOkCnt, 2) > 1875000) + TrafficLoad = TRAFFIC_HIGH; + else + TrafficLoad = TRAFFIC_LOW; + } + else if(TrafficLoad == TRAFFIC_LOW) + { + if ((curTxOkCnt+curRxOkCnt) > 3750000)//if(PlatformDivision64(curTxOkCnt+curRxOkCnt, 2) > 1875000) + TrafficLoad = TRAFFIC_HIGH; + else + TrafficLoad = TRAFFIC_LOW; + } + if(TrafficLoad == TRAFFIC_HIGH) + pDM_SWAT_Table->bTriggerAntennaSwitch = 0; + //RT_TRACE(COMP_INIT, DBG_LOUD, ("Normal:TrafficLoad = %llu\n", curTxOkCnt+curRxOkCnt)); + + //Prepare To Try Antenna + nextAntenna = (pDM_SWAT_Table->CurAntenna == MAIN_ANT)? AUX_ANT : MAIN_ANT; + pDM_SWAT_Table->try_flag = 1; + pHalData->RSSI_test = TRUE; + if((curRxOkCnt+curTxOkCnt) > 1000) + { +#if DEV_BUS_TYPE==RT_PCI_INTERFACE + pDM_SWAT_Table->RSSI_Trying = 4; +#else + pDM_SWAT_Table->RSSI_Trying = 2; +#endif + pDM_SWAT_Table->TestMode = TP_MODE; + } + else + { + pDM_SWAT_Table->RSSI_Trying = 2; + pDM_SWAT_Table->TestMode = RSSI_MODE; + + } + + //RT_TRACE(COMP_INIT, DBG_LOUD, ("SWAS: Normal State -> Begin Trying!\n")); + pHalData->RSSI_sum_A = 0; + pHalData->RSSI_cnt_A = 0; + pHalData->RSSI_sum_B = 0; + pHalData->RSSI_cnt_B = 0; + } // end of try_flag=0 + } + + //1 4.Change TRX antenna + if(nextAntenna != pDM_SWAT_Table->CurAntenna) + { + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH=: Change TX Antenna!\n ")); + //PHY_SetBBReg(Adapter, rFPGA0_XA_RFInterfaceOE, 0x300, nextAntenna); for 88C + if(nextAntenna==MAIN_ANT) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH=: Next Antenna is RF PATH A\n ")); + pathdiv_para = 0x02; //02 to switchback to RF path A + fw_value = 0x03; +#if DEV_BUS_TYPE==RT_PCI_INTERFACE + odm_PathDiversity_8192D(pDM_Odm, pathdiv_para); +#else + ODM_FillH2CCmd(pDM_Odm, ODM_H2C_PathDiv,1,(pu1Byte)(&fw_value)); +#endif + } + else if(nextAntenna==AUX_ANT) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH=: Next Antenna is RF PATH B\n ")); + if(switchfirsttime==0) // First Time To Enter Path Diversity + { + switchfirsttime=0x01; + pathdiv_para = 0x00; + fw_value=0x00; // to backup RF Path A Releated Registers + +#if DEV_BUS_TYPE==RT_PCI_INTERFACE + odm_PathDiversity_8192D(pDM_Odm, pathdiv_para); +#else + ODM_FillH2CCmd(pDM_Odm, ODM_H2C_PathDiv,1,(pu1Byte)(&fw_value)); + //for(u1Byte n=0; n<80,n++) + //{ + //delay_us(500); + ODM_delay_ms(500); + odm_PathDiversity_8192D(pDM_Odm, pathdiv_para); + + fw_value=0x01; // to backup RF Path A Releated Registers + ODM_FillH2CCmd(pDM_Odm, ODM_H2C_PathDiv,1,(pu1Byte)(&fw_value)); +#endif + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH=: FIRST TIME To DO PATH SWITCH!\n ")); + } + else + { + pathdiv_para = 0x01; + fw_value = 0x02; +#if DEV_BUS_TYPE==RT_PCI_INTERFACE + odm_PathDiversity_8192D(pDM_Odm, pathdiv_para); +#else + ODM_FillH2CCmd(pDM_Odm, ODM_H2C_PathDiv,1,(pu1Byte)(&fw_value)); +#endif + } + } + // odm_PathDiversity_8192D(Adapter, pathdiv_para); + } + + //1 5.Reset Statistics + pDM_SWAT_Table->PreAntenna = pDM_SWAT_Table->CurAntenna; + pDM_SWAT_Table->CurAntenna = nextAntenna; + pDM_SWAT_Table->PreRSSI = curRSSI; + + //1 6.Set next timer + + if(pDM_SWAT_Table->RSSI_Trying == 0) + return; + + if(pDM_SWAT_Table->RSSI_Trying%2 == 0) + { + if(pDM_SWAT_Table->TestMode == TP_MODE) + { + if(TrafficLoad == TRAFFIC_HIGH) + { +#if DEV_BUS_TYPE==RT_PCI_INTERFACE + ODM_SetTimer( pDM_Odm, &pDM_Odm->PathDivSwitchTimer, 10 ); //ms + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH=: Test another antenna for 10 ms\n")); +#else + ODM_SetTimer( pDM_Odm, &pDM_Odm->PathDivSwitchTimer, 20 ); //ms + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH=: Test another antenna for 20 ms\n")); +#endif + } + else if(TrafficLoad == TRAFFIC_LOW) + { + ODM_SetTimer( pDM_Odm, &pDM_Odm->PathDivSwitchTimer, 50 ); //ms + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH=: Test another antenna for 50 ms\n")); + } + } + else // TestMode == RSSI_MODE + { + ODM_SetTimer( pDM_Odm, &pDM_Odm->PathDivSwitchTimer, 500 ); //ms + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH=: Test another antenna for 500 ms\n")); + } + } + else + { + if(pDM_SWAT_Table->TestMode == TP_MODE) + { + if(TrafficLoad == TRAFFIC_HIGH) + +#if DEV_BUS_TYPE==RT_PCI_INTERFACE + ODM_SetTimer( pDM_Odm, &pDM_Odm->PathDivSwitchTimer, 90 ); //ms + //ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("=PATH=: Test another antenna for 90 ms\n")); +#else + ODM_SetTimer( pDM_Odm, &pDM_Odm->PathDivSwitchTimer, 180); //ms +#endif + else if(TrafficLoad == TRAFFIC_LOW) + ODM_SetTimer( pDM_Odm, &pDM_Odm->PathDivSwitchTimer, 100 ); //ms + } + else + ODM_SetTimer( pDM_Odm, &pDM_Odm->PathDivSwitchTimer, 500 ); //ms + } +} + + + +VOID +ODM_CCKPathDiversityChkPerPktRssi( + PADAPTER Adapter, + BOOLEAN bIsDefPort, + BOOLEAN bMatchBSSID, + PRT_WLAN_STA pEntry, + PRT_RFD pRfd, + pu1Byte pDesc + ) +{ + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + BOOLEAN bCount = FALSE; + pPD_T pDM_PDTable = &Adapter->DM_PDTable; + //BOOLEAN isCCKrate = RX_HAL_IS_CCK_RATE_92C(pDesc); +#if DEV_BUS_TYPE != RT_SDIO_INTERFACE + BOOLEAN isCCKrate = RX_HAL_IS_CCK_RATE(Adapter, pDesc); +#else //below code would be removed if we have verified SDIO + BOOLEAN isCCKrate = IS_HARDWARE_TYPE_8188E(Adapter) ? RX_HAL_IS_CCK_RATE_88E(pDesc) : RX_HAL_IS_CCK_RATE_92C(pDesc); +#endif + + if((pHalData->PathDivCfg != 1) || (pHalData->RSSI_test == FALSE)) + return; + + if(pHalData->RSSI_target==NULL && bIsDefPort && bMatchBSSID) + bCount = TRUE; + else if(pHalData->RSSI_target!=NULL && pEntry!=NULL && pHalData->RSSI_target==pEntry) + bCount = TRUE; + + if(bCount && isCCKrate) + { + if(pDM_PDTable->TrainingState == 1 ) + { + if(pEntry) + { + if(pEntry->rssi_stat.RSSI_CCK_Path_cnt[0] != 0) + pEntry->rssi_stat.RSSI_CCK_Path[0] += pRfd->Status.RxPWDBAll; + pEntry->rssi_stat.RSSI_CCK_Path_cnt[0]++; + } + else + { + if(pDM_PDTable->RSSI_CCK_Path_cnt[0] != 0) + pDM_PDTable->RSSI_CCK_Path[0] += pRfd->Status.RxPWDBAll; + pDM_PDTable->RSSI_CCK_Path_cnt[0]++; + } + } + else if(pDM_PDTable->TrainingState == 2 ) + { + if(pEntry) + { + if(pEntry->rssi_stat.RSSI_CCK_Path_cnt[1] != 0) + pEntry->rssi_stat.RSSI_CCK_Path[1] += pRfd->Status.RxPWDBAll; + pEntry->rssi_stat.RSSI_CCK_Path_cnt[1]++; + } + else + { + if(pDM_PDTable->RSSI_CCK_Path_cnt[1] != 0) + pDM_PDTable->RSSI_CCK_Path[1] += pRfd->Status.RxPWDBAll; + pDM_PDTable->RSSI_CCK_Path_cnt[1]++; + } + } + } +} + + + + +//Neil Chen---2011--06--22 +//----92D Path Diversity----// +//#ifdef PathDiv92D +//================================== +//3 Path Diversity +//================================== +// +// 20100514 Luke/Joseph: +// Add new function for antenna diversity after link. +// This is the main function of antenna diversity after link. +// This function is called in HalDmWatchDog() and ODM_SwAntDivChkAntSwitchCallback(). +// HalDmWatchDog() calls this function with SWAW_STEP_PEAK to initialize the antenna test. +// In SWAW_STEP_PEAK, another antenna and a 500ms timer will be set for testing. +// After 500ms, ODM_SwAntDivChkAntSwitchCallback() calls this function to compare the signal just +// listened on the air with the RSSI of original antenna. +// It chooses the antenna with better RSSI. +// There is also a aged policy for error trying. Each error trying will cost more 5 seconds waiting +// penalty to get next try. +// +// +// 20100503 Joseph: +// Add new function SwAntDivCheck8192C(). +// This is the main function of Antenna diversity function before link. +// Mainly, it just retains last scan result and scan again. +// After that, it compares the scan result to see which one gets better RSSI. +// It selects antenna with better receiving power and returns better scan result. +// + + +// +// 20100514 Luke/Joseph: +// This function is used to gather the RSSI information for antenna testing. +// It selects the RSSI of the peer STA that we want to know. +// +VOID +ODM_PathDivChkPerPktRssi( + PADAPTER Adapter, + BOOLEAN bIsDefPort, + BOOLEAN bMatchBSSID, + PRT_WLAN_STA pEntry, + PRT_RFD pRfd + ) +{ + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + BOOLEAN bCount = FALSE; + PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; + pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; + + if(pHalData->RSSI_target==NULL && bIsDefPort && bMatchBSSID) + bCount = TRUE; + else if(pHalData->RSSI_target!=NULL && pEntry!=NULL && pHalData->RSSI_target==pEntry) + bCount = TRUE; + + if(bCount) + { + //1 RSSI for SW Antenna Switch + if(pDM_SWAT_Table->CurAntenna == MAIN_ANT) + { + pHalData->RSSI_sum_A += pRfd->Status.RxPWDBAll; + pHalData->RSSI_cnt_A++; + } + else + { + pHalData->RSSI_sum_B += pRfd->Status.RxPWDBAll; + pHalData->RSSI_cnt_B++; + + } + } +} + + +// +// 20100514 Luke/Joseph: +// Add new function to reset antenna diversity state after link. +// +VOID +ODM_PathDivRestAfterLink( + IN PDM_ODM_T pDM_Odm + ) +{ + PADAPTER Adapter=pDM_Odm->Adapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; + + pHalData->RSSI_cnt_A = 0; + pHalData->RSSI_cnt_B = 0; + pHalData->RSSI_test = FALSE; + pDM_SWAT_Table->try_flag = 0x0; // NOT 0xff + pDM_SWAT_Table->RSSI_Trying = 0; + pDM_SWAT_Table->SelectAntennaMap=0xAA; + pDM_SWAT_Table->CurAntenna = MAIN_ANT; +} + + +//================================================== +//3 PathDiv End +//================================================== + + +VOID +ODM_FillTXPathInTXDESC( + IN PADAPTER Adapter, + IN PRT_TCB pTcb, + IN pu1Byte pDesc +) +{ + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + u4Byte TXPath; + pPD_T pDM_PDTable = &Adapter->DM_PDTable; + + //2011.09.05 Add by Luke Lee for path diversity + if(pHalData->PathDivCfg == 1) + { + TXPath = (pDM_PDTable->OFDMTXPath >> pTcb->macId) & BIT0; + //RT_TRACE( COMP_INIT, DBG_LOUD, ("Fill TXDESC: macID=%d, TXPath=%d\n", pTcb->macId, TXPath)); + //SET_TX_DESC_TX_ANT_CCK(pDesc,TXPath); + if(TXPath == 0) + { + SET_TX_DESC_TX_ANTL_92C(pDesc,1); + SET_TX_DESC_TX_ANT_HT_92C(pDesc,1); + } + else + { + SET_TX_DESC_TX_ANTL_92C(pDesc,2); + SET_TX_DESC_TX_ANT_HT_92C(pDesc,2); + } + TXPath = (pDM_PDTable->CCKTXPath >> pTcb->macId) & BIT0; + if(TXPath == 0) + { + SET_TX_DESC_TX_ANT_CCK_92C(pDesc,1); + } + else + { + SET_TX_DESC_TX_ANT_CCK_92C(pDesc,2); + } + } +} + +//Only for MP //Neil Chen--2012--0502-- +VOID +odm_PathDivInit_92D( +IN PDM_ODM_T pDM_Odm) +{ + pPATHDIV_PARA pathIQK = &pDM_Odm->pathIQK; + + pathIQK->org_2g_RegC14=0x0; + pathIQK->org_2g_RegC4C=0x0; + pathIQK->org_2g_RegC80=0x0; + pathIQK->org_2g_RegC94=0x0; + pathIQK->org_2g_RegCA0=0x0; + pathIQK->org_5g_RegC14=0x0; + pathIQK->org_5g_RegCA0=0x0; + pathIQK->org_5g_RegE30=0x0; + pathIQK->swt_2g_RegC14=0x0; + pathIQK->swt_2g_RegC4C=0x0; + pathIQK->swt_2g_RegC80=0x0; + pathIQK->swt_2g_RegC94=0x0; + pathIQK->swt_2g_RegCA0=0x0; + pathIQK->swt_5g_RegC14=0x0; + pathIQK->swt_5g_RegCA0=0x0; + pathIQK->swt_5g_RegE30=0x0; + +} + + +u1Byte +odm_SwAntDivSelectScanChnl( + IN PADAPTER Adapter + ) +{ +#if (RT_MEM_SIZE_LEVEL != RT_MEM_SIZE_MINIMUM) + PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter); + PMGNT_INFO pMgntInfo = &(Adapter->MgntInfo); + PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; + u2Byte i; + u1Byte j, ScanChannel = 0, ChannelNum = 0; + PRT_CHANNEL_LIST pChannelList = GET_RT_CHANNEL_LIST(pMgntInfo); + u1Byte EachChannelSTAs[MAX_SCAN_CHANNEL_NUM] = {0}; + + if(pMgntInfo->tmpNumBssDesc == 0) + return 0; + + for(i = 0; i < pMgntInfo->tmpNumBssDesc; i++) + { + ChannelNum = pMgntInfo->tmpbssDesc[i].ChannelNumber; + for(j = 0; j < pChannelList->ChannelLen; j++) + { + if(pChannelList->ChnlListEntry[j].ChannelNum == ChannelNum) + { + EachChannelSTAs[j]++; + break; + } + } + } + + for(i = 0; i < MAX_SCAN_CHANNEL_NUM; i++) + { + if(EachChannelSTAs[i] > EachChannelSTAs[ScanChannel]) + ScanChannel = (u1Byte)i; + } + + if(EachChannelSTAs[ScanChannel] == 0) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, DBG_LOUD, ("odm_SwAntDivSelectScanChnl(): Scan List is empty.\n")); + return 0; + } + + ScanChannel = pChannelList->ChnlListEntry[ScanChannel].ChannelNum; + + + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, DBG_LOUD, + ("odm_SwAntDivSelectScanChnl(): Channel (( %d )) is select as scan channel.\n", ScanChannel)); + + return ScanChannel; +#else + return 0; +#endif +} + + +VOID +odm_SwAntDivConstructScanChnl( + IN PADAPTER Adapter, + IN u1Byte ScanChnl + ) +{ + + PMGNT_INFO pMgntInfo = &Adapter->MgntInfo; + + if(ScanChnl == 0) + { + u1Byte i; + PRT_CHANNEL_LIST pChannelList = GET_RT_CHANNEL_LIST(pMgntInfo); + + // 20100519 Joseph: Original antenna scanned nothing. + // Test antenna shall scan all channel with half period in this condition. + + RT_TRACE_F(COMP_SCAN, DBG_TRACE, (" RT_CHNL_LIST_ACTION_CONSTRUCT chnl %d \n", ScanChnl)); + + RtActChannelList(Adapter, RT_CHNL_LIST_ACTION_CONSTRUCT_SCAN_LIST, NULL, NULL); + for(i = 0; i < pChannelList->ChannelLen; i++) + pChannelList->ChnlListEntry[i].ScanPeriod /= 2; + } + else + { + // The using of this CustomizedScanRequest is a trick to rescan the two channels + // under the NORMAL scanning process. It will not affect MGNT_INFO.CustomizedScanRequest. + CUSTOMIZED_SCAN_REQUEST CustomScanReq; + + CustomScanReq.bEnabled = TRUE; + CustomScanReq.Channels[0] = ScanChnl; + CustomScanReq.Channels[1] = pMgntInfo->dot11CurrentChannelNumber; + CustomScanReq.nChannels = 2; + CustomScanReq.ScanType = SCAN_ACTIVE; + CustomScanReq.Duration = DEFAULT_PASSIVE_SCAN_PERIOD; + + RT_TRACE_F(COMP_SCAN, DBG_TRACE, (" RT_CHNL_LIST_ACTION_CONSTRUCT chnl %d \n", ScanChnl)); + + RtActChannelList(Adapter, RT_CHNL_LIST_ACTION_CONSTRUCT_SCAN_LIST, &CustomScanReq, NULL); + } + +} + + +#endif // #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_PathDiv.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_PathDiv.h new file mode 100644 index 00000000000000..84a2639fd530f3 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_PathDiv.h @@ -0,0 +1,320 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +#ifndef __PHYDMPATHDIV_H__ +#define __PHYDMPATHDIV_H__ +#define PATHDIV_VERSION "2.0" //2014.11.04 + +#if(defined(CONFIG_PATH_DIVERSITY)) +#define USE_PATH_A_AS_DEFAULT_ANT //for 8814 dynamic TX path selection + +#define NUM_RESET_DTP_PERIOD 5 +#define ANT_DECT_RSSI_TH 3 + +#define PATH_A 1 +#define PATH_B 2 +#define PATH_C 3 +#define PATH_D 4 + +#define PHYDM_AUTO_PATH 0 +#define PHYDM_FIX_PATH 1 + +#define NUM_CHOOSE2_FROM4 6 +#define NUM_CHOOSE3_FROM4 4 + + +#define PHYDM_A BIT0 +#define PHYDM_B BIT1 +#define PHYDM_C BIT2 +#define PHYDM_D BIT3 +#define PHYDM_AB (BIT0 | BIT1) // 0 +#define PHYDM_AC (BIT0 | BIT2) // 1 +#define PHYDM_AD (BIT0 | BIT3) // 2 +#define PHYDM_BC (BIT1 | BIT2) // 3 +#define PHYDM_BD (BIT1 | BIT3) // 4 +#define PHYDM_CD (BIT2 | BIT3) // 5 + +#define PHYDM_ABC (BIT0 | BIT1 | BIT2) // 0 +#define PHYDM_ABD (BIT0 | BIT1 | BIT4) // 1 +#define PHYDM_ACD (BIT0 | BIT3 | BIT4) // 2 +#define PHYDM_BCD (BIT2 | BIT3 | BIT4) // 3 + +#define PHYDM_ABCD (BIT0 | BIT1 | BIT2 | BIT3) + + +typedef enum dtp_state +{ + PHYDM_DTP_INIT=1, + PHYDM_DTP_RUNNING_1 + +}PHYDM_DTP_STATE; + +typedef enum path_div_type +{ + PHYDM_2R_PATH_DIV = 1, + PHYDM_4R_PATH_DIV = 2 +}PHYDM_PATH_DIV_TYPE; + +VOID +phydm_process_rssi_for_path_div( + IN OUT PVOID pDM_VOID, + IN PVOID p_phy_info_void, + IN PVOID p_pkt_info_void + ); + +typedef struct _ODM_PATH_DIVERSITY_ +{ + u1Byte RespTxPath; + u1Byte PathSel[ODM_ASSOCIATE_ENTRY_NUM]; + u4Byte PathA_Sum[ODM_ASSOCIATE_ENTRY_NUM]; + u4Byte PathB_Sum[ODM_ASSOCIATE_ENTRY_NUM]; + u2Byte PathA_Cnt[ODM_ASSOCIATE_ENTRY_NUM]; + u2Byte PathB_Cnt[ODM_ASSOCIATE_ENTRY_NUM]; + u1Byte path_div_type; + #if RTL8814A_SUPPORT + + u4Byte path_a_sum_all; + u4Byte path_b_sum_all; + u4Byte path_c_sum_all; + u4Byte path_d_sum_all; + + u4Byte path_a_cnt_all; + u4Byte path_b_cnt_all; + u4Byte path_c_cnt_all; + u4Byte path_d_cnt_all; + + u1Byte dtp_period; + BOOLEAN bBecomeLinked; + BOOLEAN is_u3_mode; + u1Byte num_tx_path; + u1Byte default_path; + u1Byte num_candidate; + u1Byte ant_candidate_1; + u1Byte ant_candidate_2; + u1Byte ant_candidate_3; + u1Byte dtp_state; + u1Byte dtp_check_patha_counter; + BOOLEAN fix_path_bfer; + u1Byte search_space_2[NUM_CHOOSE2_FROM4]; + u1Byte search_space_3[NUM_CHOOSE3_FROM4]; + + u1Byte pre_tx_path; + u1Byte use_path_a_as_default_ant; + BOOLEAN is_pathA_exist; + + #endif +}PATHDIV_T, *pPATHDIV_T; + + +#endif //#if(defined(CONFIG_PATH_DIVERSITY)) + +VOID +phydm_c2h_dtp_handler( + IN PVOID pDM_VOID, + IN pu1Byte CmdBuf, + IN u1Byte CmdLen + ); + +VOID +odm_PathDiversityInit( + IN PVOID pDM_VOID + ); + +VOID +odm_PathDiversity( + IN PVOID pDM_VOID + ); + +VOID +odm_pathdiv_debug( + IN PVOID pDM_VOID, + IN u4Byte *const dm_value + ); + + + +//1 [OLD IC]-------------------------------------------------------------------------------- + + + + + + +#if(DM_ODM_SUPPORT_TYPE & (ODM_WIN)) + +//#define PATHDIV_ENABLE 1 +#define dm_PathDiv_RSSI_Check ODM_PathDivChkPerPktRssi +#define PathDivCheckBeforeLink8192C ODM_PathDiversityBeforeLink92C + + + + +typedef struct _PathDiv_Parameter_define_ +{ + u4Byte org_5g_RegE30; + u4Byte org_5g_RegC14; + u4Byte org_5g_RegCA0; + u4Byte swt_5g_RegE30; + u4Byte swt_5g_RegC14; + u4Byte swt_5g_RegCA0; + //for 2G IQK information + u4Byte org_2g_RegC80; + u4Byte org_2g_RegC4C; + u4Byte org_2g_RegC94; + u4Byte org_2g_RegC14; + u4Byte org_2g_RegCA0; + + u4Byte swt_2g_RegC80; + u4Byte swt_2g_RegC4C; + u4Byte swt_2g_RegC94; + u4Byte swt_2g_RegC14; + u4Byte swt_2g_RegCA0; +}PATHDIV_PARA,*pPATHDIV_PARA; + +VOID +odm_PathDiversityInit_92C( + IN PADAPTER Adapter + ); + +VOID +odm_2TPathDiversityInit_92C( + IN PADAPTER Adapter + ); + +VOID +odm_1TPathDiversityInit_92C( + IN PADAPTER Adapter + ); + +BOOLEAN +odm_IsConnected_92C( + IN PADAPTER Adapter + ); + +BOOLEAN +ODM_PathDiversityBeforeLink92C( + //IN PADAPTER Adapter + IN PDM_ODM_T pDM_Odm + ); + +VOID +odm_PathDiversityAfterLink_92C( + IN PADAPTER Adapter + ); + +VOID +odm_SetRespPath_92C( + IN PADAPTER Adapter, + IN u1Byte DefaultRespPath + ); + +VOID +odm_OFDMTXPathDiversity_92C( + IN PADAPTER Adapter + ); + +VOID +odm_CCKTXPathDiversity_92C( + IN PADAPTER Adapter + ); + +VOID +odm_ResetPathDiversity_92C( + IN PADAPTER Adapter + ); + +VOID +odm_CCKTXPathDiversityCallback( + PRT_TIMER pTimer + ); + +VOID +odm_CCKTXPathDiversityWorkItemCallback( + IN PVOID pContext + ); + +VOID +odm_PathDivChkAntSwitchCallback( + PRT_TIMER pTimer + ); + +VOID +odm_PathDivChkAntSwitchWorkitemCallback( + IN PVOID pContext + ); + + +VOID +odm_PathDivChkAntSwitch( + PDM_ODM_T pDM_Odm + ); + +VOID +ODM_CCKPathDiversityChkPerPktRssi( + PADAPTER Adapter, + BOOLEAN bIsDefPort, + BOOLEAN bMatchBSSID, + PRT_WLAN_STA pEntry, + PRT_RFD pRfd, + pu1Byte pDesc + ); + +VOID +ODM_PathDivChkPerPktRssi( + PADAPTER Adapter, + BOOLEAN bIsDefPort, + BOOLEAN bMatchBSSID, + PRT_WLAN_STA pEntry, + PRT_RFD pRfd + ); + +VOID +ODM_PathDivRestAfterLink( + IN PDM_ODM_T pDM_Odm + ); + +VOID +ODM_FillTXPathInTXDESC( + IN PADAPTER Adapter, + IN PRT_TCB pTcb, + IN pu1Byte pDesc + ); + +VOID +odm_PathDivInit_92D( + IN PDM_ODM_T pDM_Odm + ); + +u1Byte +odm_SwAntDivSelectScanChnl( + IN PADAPTER Adapter + ); + +VOID +odm_SwAntDivConstructScanChnl( + IN PADAPTER Adapter, + IN u1Byte ScanChnl + ); + + #endif //#if(DM_ODM_SUPPORT_TYPE & (ODM_WIN)) + + + #endif //#ifndef __ODMPATHDIV_H__ + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_PowerTracking.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_PowerTracking.c new file mode 100644 index 00000000000000..507b250ec17457 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_PowerTracking.c @@ -0,0 +1,687 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +//============================================================ +// include files +//============================================================ +#include "Mp_Precomp.h" +#include "phydm_precomp.h" + +//============================================================ +// Global var +//============================================================ + +u4Byte OFDMSwingTable[OFDM_TABLE_SIZE] = { + 0x7f8001fe, // 0, +6.0dB + 0x788001e2, // 1, +5.5dB + 0x71c001c7, // 2, +5.0dB + 0x6b8001ae, // 3, +4.5dB + 0x65400195, // 4, +4.0dB + 0x5fc0017f, // 5, +3.5dB + 0x5a400169, // 6, +3.0dB + 0x55400155, // 7, +2.5dB + 0x50800142, // 8, +2.0dB + 0x4c000130, // 9, +1.5dB + 0x47c0011f, // 10, +1.0dB + 0x43c0010f, // 11, +0.5dB + 0x40000100, // 12, +0dB + 0x3c8000f2, // 13, -0.5dB + 0x390000e4, // 14, -1.0dB + 0x35c000d7, // 15, -1.5dB + 0x32c000cb, // 16, -2.0dB + 0x300000c0, // 17, -2.5dB + 0x2d4000b5, // 18, -3.0dB + 0x2ac000ab, // 19, -3.5dB + 0x288000a2, // 20, -4.0dB + 0x26000098, // 21, -4.5dB + 0x24000090, // 22, -5.0dB + 0x22000088, // 23, -5.5dB + 0x20000080, // 24, -6.0dB + 0x1e400079, // 25, -6.5dB + 0x1c800072, // 26, -7.0dB + 0x1b00006c, // 27. -7.5dB + 0x19800066, // 28, -8.0dB + 0x18000060, // 29, -8.5dB + 0x16c0005b, // 30, -9.0dB + 0x15800056, // 31, -9.5dB + 0x14400051, // 32, -10.0dB + 0x1300004c, // 33, -10.5dB + 0x12000048, // 34, -11.0dB + 0x11000044, // 35, -11.5dB + 0x10000040, // 36, -12.0dB +}; + +u1Byte CCKSwingTable_Ch1_Ch13[CCK_TABLE_SIZE][8] = { + {0x36, 0x35, 0x2e, 0x25, 0x1c, 0x12, 0x09, 0x04}, // 0, +0dB + {0x33, 0x32, 0x2b, 0x23, 0x1a, 0x11, 0x08, 0x04}, // 1, -0.5dB + {0x30, 0x2f, 0x29, 0x21, 0x19, 0x10, 0x08, 0x03}, // 2, -1.0dB + {0x2d, 0x2d, 0x27, 0x1f, 0x18, 0x0f, 0x08, 0x03}, // 3, -1.5dB + {0x2b, 0x2a, 0x25, 0x1e, 0x16, 0x0e, 0x07, 0x03}, // 4, -2.0dB + {0x28, 0x28, 0x22, 0x1c, 0x15, 0x0d, 0x07, 0x03}, // 5, -2.5dB + {0x26, 0x25, 0x21, 0x1b, 0x14, 0x0d, 0x06, 0x03}, // 6, -3.0dB + {0x24, 0x23, 0x1f, 0x19, 0x13, 0x0c, 0x06, 0x03}, // 7, -3.5dB + {0x22, 0x21, 0x1d, 0x18, 0x11, 0x0b, 0x06, 0x02}, // 8, -4.0dB + {0x20, 0x20, 0x1b, 0x16, 0x11, 0x08, 0x05, 0x02}, // 9, -4.5dB + {0x1f, 0x1e, 0x1a, 0x15, 0x10, 0x0a, 0x05, 0x02}, // 10, -5.0dB + {0x1d, 0x1c, 0x18, 0x14, 0x0f, 0x0a, 0x05, 0x02}, // 11, -5.5dB + {0x1b, 0x1a, 0x17, 0x13, 0x0e, 0x09, 0x04, 0x02}, // 12, -6.0dB <== default + {0x1a, 0x19, 0x16, 0x12, 0x0d, 0x09, 0x04, 0x02}, // 13, -6.5dB + {0x18, 0x17, 0x15, 0x11, 0x0c, 0x08, 0x04, 0x02}, // 14, -7.0dB + {0x17, 0x16, 0x13, 0x10, 0x0c, 0x08, 0x04, 0x02}, // 15, -7.5dB + {0x16, 0x15, 0x12, 0x0f, 0x0b, 0x07, 0x04, 0x01}, // 16, -8.0dB + {0x14, 0x14, 0x11, 0x0e, 0x0b, 0x07, 0x03, 0x02}, // 17, -8.5dB + {0x13, 0x13, 0x10, 0x0d, 0x0a, 0x06, 0x03, 0x01}, // 18, -9.0dB + {0x12, 0x12, 0x0f, 0x0c, 0x09, 0x06, 0x03, 0x01}, // 19, -9.5dB + {0x11, 0x11, 0x0f, 0x0c, 0x09, 0x06, 0x03, 0x01}, // 20, -10.0dB + {0x10, 0x10, 0x0e, 0x0b, 0x08, 0x05, 0x03, 0x01}, // 21, -10.5dB + {0x0f, 0x0f, 0x0d, 0x0b, 0x08, 0x05, 0x03, 0x01}, // 22, -11.0dB + {0x0e, 0x0e, 0x0c, 0x0a, 0x08, 0x05, 0x02, 0x01}, // 23, -11.5dB + {0x0d, 0x0d, 0x0c, 0x0a, 0x07, 0x05, 0x02, 0x01}, // 24, -12.0dB + {0x0d, 0x0c, 0x0b, 0x09, 0x07, 0x04, 0x02, 0x01}, // 25, -12.5dB + {0x0c, 0x0c, 0x0a, 0x09, 0x06, 0x04, 0x02, 0x01}, // 26, -13.0dB + {0x0b, 0x0b, 0x0a, 0x08, 0x06, 0x04, 0x02, 0x01}, // 27, -13.5dB + {0x0b, 0x0a, 0x09, 0x08, 0x06, 0x04, 0x02, 0x01}, // 28, -14.0dB + {0x0a, 0x0a, 0x09, 0x07, 0x05, 0x03, 0x02, 0x01}, // 29, -14.5dB + {0x0a, 0x09, 0x08, 0x07, 0x05, 0x03, 0x02, 0x01}, // 30, -15.0dB + {0x09, 0x09, 0x08, 0x06, 0x05, 0x03, 0x01, 0x01}, // 31, -15.5dB + {0x09, 0x08, 0x07, 0x06, 0x04, 0x03, 0x01, 0x01} // 32, -16.0dB +}; + + +u1Byte CCKSwingTable_Ch14[CCK_TABLE_SIZE][8] = { + {0x36, 0x35, 0x2e, 0x1b, 0x00, 0x00, 0x00, 0x00}, // 0, +0dB + {0x33, 0x32, 0x2b, 0x19, 0x00, 0x00, 0x00, 0x00}, // 1, -0.5dB + {0x30, 0x2f, 0x29, 0x18, 0x00, 0x00, 0x00, 0x00}, // 2, -1.0dB + {0x2d, 0x2d, 0x17, 0x17, 0x00, 0x00, 0x00, 0x00}, // 3, -1.5dB + {0x2b, 0x2a, 0x25, 0x15, 0x00, 0x00, 0x00, 0x00}, // 4, -2.0dB + {0x28, 0x28, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00}, // 5, -2.5dB + {0x26, 0x25, 0x21, 0x13, 0x00, 0x00, 0x00, 0x00}, // 6, -3.0dB + {0x24, 0x23, 0x1f, 0x12, 0x00, 0x00, 0x00, 0x00}, // 7, -3.5dB + {0x22, 0x21, 0x1d, 0x11, 0x00, 0x00, 0x00, 0x00}, // 8, -4.0dB + {0x20, 0x20, 0x1b, 0x10, 0x00, 0x00, 0x00, 0x00}, // 9, -4.5dB + {0x1f, 0x1e, 0x1a, 0x0f, 0x00, 0x00, 0x00, 0x00}, // 10, -5.0dB + {0x1d, 0x1c, 0x18, 0x0e, 0x00, 0x00, 0x00, 0x00}, // 11, -5.5dB + {0x1b, 0x1a, 0x17, 0x0e, 0x00, 0x00, 0x00, 0x00}, // 12, -6.0dB <== default + {0x1a, 0x19, 0x16, 0x0d, 0x00, 0x00, 0x00, 0x00}, // 13, -6.5dB + {0x18, 0x17, 0x15, 0x0c, 0x00, 0x00, 0x00, 0x00}, // 14, -7.0dB + {0x17, 0x16, 0x13, 0x0b, 0x00, 0x00, 0x00, 0x00}, // 15, -7.5dB + {0x16, 0x15, 0x12, 0x0b, 0x00, 0x00, 0x00, 0x00}, // 16, -8.0dB + {0x14, 0x14, 0x11, 0x0a, 0x00, 0x00, 0x00, 0x00}, // 17, -8.5dB + {0x13, 0x13, 0x10, 0x0a, 0x00, 0x00, 0x00, 0x00}, // 18, -9.0dB + {0x12, 0x12, 0x0f, 0x09, 0x00, 0x00, 0x00, 0x00}, // 19, -9.5dB + {0x11, 0x11, 0x0f, 0x09, 0x00, 0x00, 0x00, 0x00}, // 20, -10.0dB + {0x10, 0x10, 0x0e, 0x08, 0x00, 0x00, 0x00, 0x00}, // 21, -10.5dB + {0x0f, 0x0f, 0x0d, 0x08, 0x00, 0x00, 0x00, 0x00}, // 22, -11.0dB + {0x0e, 0x0e, 0x0c, 0x07, 0x00, 0x00, 0x00, 0x00}, // 23, -11.5dB + {0x0d, 0x0d, 0x0c, 0x07, 0x00, 0x00, 0x00, 0x00}, // 24, -12.0dB + {0x0d, 0x0c, 0x0b, 0x06, 0x00, 0x00, 0x00, 0x00}, // 25, -12.5dB + {0x0c, 0x0c, 0x0a, 0x06, 0x00, 0x00, 0x00, 0x00}, // 26, -13.0dB + {0x0b, 0x0b, 0x0a, 0x06, 0x00, 0x00, 0x00, 0x00}, // 27, -13.5dB + {0x0b, 0x0a, 0x09, 0x05, 0x00, 0x00, 0x00, 0x00}, // 28, -14.0dB + {0x0a, 0x0a, 0x09, 0x05, 0x00, 0x00, 0x00, 0x00}, // 29, -14.5dB + {0x0a, 0x09, 0x08, 0x05, 0x00, 0x00, 0x00, 0x00}, // 30, -15.0dB + {0x09, 0x09, 0x08, 0x05, 0x00, 0x00, 0x00, 0x00}, // 31, -15.5dB + {0x09, 0x08, 0x07, 0x04, 0x00, 0x00, 0x00, 0x00} // 32, -16.0dB +}; + + +u4Byte OFDMSwingTable_New[OFDM_TABLE_SIZE] = { + 0x0b40002d, // 0, -15.0dB + 0x0c000030, // 1, -14.5dB + 0x0cc00033, // 2, -14.0dB + 0x0d800036, // 3, -13.5dB + 0x0e400039, // 4, -13.0dB + 0x0f00003c, // 5, -12.5dB + 0x10000040, // 6, -12.0dB + 0x11000044, // 7, -11.5dB + 0x12000048, // 8, -11.0dB + 0x1300004c, // 9, -10.5dB + 0x14400051, // 10, -10.0dB + 0x15800056, // 11, -9.5dB + 0x16c0005b, // 12, -9.0dB + 0x18000060, // 13, -8.5dB + 0x19800066, // 14, -8.0dB + 0x1b00006c, // 15, -7.5dB + 0x1c800072, // 16, -7.0dB + 0x1e400079, // 17, -6.5dB + 0x20000080, // 18, -6.0dB + 0x22000088, // 19, -5.5dB + 0x24000090, // 20, -5.0dB + 0x26000098, // 21, -4.5dB + 0x288000a2, // 22, -4.0dB + 0x2ac000ab, // 23, -3.5dB + 0x2d4000b5, // 24, -3.0dB + 0x300000c0, // 25, -2.5dB + 0x32c000cb, // 26, -2.0dB + 0x35c000d7, // 27, -1.5dB + 0x390000e4, // 28, -1.0dB + 0x3c8000f2, // 29, -0.5dB + 0x40000100, // 30, +0dB + 0x43c0010f, // 31, +0.5dB + 0x47c0011f, // 32, +1.0dB + 0x4c000130, // 33, +1.5dB + 0x50800142, // 34, +2.0dB + 0x55400155, // 35, +2.5dB + 0x5a400169, // 36, +3.0dB + 0x5fc0017f, // 37, +3.5dB + 0x65400195, // 38, +4.0dB + 0x6b8001ae, // 39, +4.5dB + 0x71c001c7, // 40, +5.0dB + 0x788001e2, // 41, +5.5dB + 0x7f8001fe // 42, +6.0dB +}; + + +u1Byte CCKSwingTable_Ch1_Ch13_New[CCK_TABLE_SIZE][8] = { + {0x09, 0x08, 0x07, 0x06, 0x04, 0x03, 0x01, 0x01}, // 0, -16.0dB + {0x09, 0x09, 0x08, 0x06, 0x05, 0x03, 0x01, 0x01}, // 1, -15.5dB + {0x0a, 0x09, 0x08, 0x07, 0x05, 0x03, 0x02, 0x01}, // 2, -15.0dB + {0x0a, 0x0a, 0x09, 0x07, 0x05, 0x03, 0x02, 0x01}, // 3, -14.5dB + {0x0b, 0x0a, 0x09, 0x08, 0x06, 0x04, 0x02, 0x01}, // 4, -14.0dB + {0x0b, 0x0b, 0x0a, 0x08, 0x06, 0x04, 0x02, 0x01}, // 5, -13.5dB + {0x0c, 0x0c, 0x0a, 0x09, 0x06, 0x04, 0x02, 0x01}, // 6, -13.0dB + {0x0d, 0x0c, 0x0b, 0x09, 0x07, 0x04, 0x02, 0x01}, // 7, -12.5dB + {0x0d, 0x0d, 0x0c, 0x0a, 0x07, 0x05, 0x02, 0x01}, // 8, -12.0dB + {0x0e, 0x0e, 0x0c, 0x0a, 0x08, 0x05, 0x02, 0x01}, // 9, -11.5dB + {0x0f, 0x0f, 0x0d, 0x0b, 0x08, 0x05, 0x03, 0x01}, // 10, -11.0dB + {0x10, 0x10, 0x0e, 0x0b, 0x08, 0x05, 0x03, 0x01}, // 11, -10.5dB + {0x11, 0x11, 0x0f, 0x0c, 0x09, 0x06, 0x03, 0x01}, // 12, -10.0dB + {0x12, 0x12, 0x0f, 0x0c, 0x09, 0x06, 0x03, 0x01}, // 13, -9.5dB + {0x13, 0x13, 0x10, 0x0d, 0x0a, 0x06, 0x03, 0x01}, // 14, -9.0dB + {0x14, 0x14, 0x11, 0x0e, 0x0b, 0x07, 0x03, 0x02}, // 15, -8.5dB + {0x16, 0x15, 0x12, 0x0f, 0x0b, 0x07, 0x04, 0x01}, // 16, -8.0dB + {0x17, 0x16, 0x13, 0x10, 0x0c, 0x08, 0x04, 0x02}, // 17, -7.5dB + {0x18, 0x17, 0x15, 0x11, 0x0c, 0x08, 0x04, 0x02}, // 18, -7.0dB + {0x1a, 0x19, 0x16, 0x12, 0x0d, 0x09, 0x04, 0x02}, // 19, -6.5dB + {0x1b, 0x1a, 0x17, 0x13, 0x0e, 0x09, 0x04, 0x02}, // 20, -6.0dB + {0x1d, 0x1c, 0x18, 0x14, 0x0f, 0x0a, 0x05, 0x02}, // 21, -5.5dB + {0x1f, 0x1e, 0x1a, 0x15, 0x10, 0x0a, 0x05, 0x02}, // 22, -5.0dB + {0x20, 0x20, 0x1b, 0x16, 0x11, 0x08, 0x05, 0x02}, // 23, -4.5dB + {0x22, 0x21, 0x1d, 0x18, 0x11, 0x0b, 0x06, 0x02}, // 24, -4.0dB + {0x24, 0x23, 0x1f, 0x19, 0x13, 0x0c, 0x06, 0x03}, // 25, -3.5dB + {0x26, 0x25, 0x21, 0x1b, 0x14, 0x0d, 0x06, 0x03}, // 26, -3.0dB + {0x28, 0x28, 0x22, 0x1c, 0x15, 0x0d, 0x07, 0x03}, // 27, -2.5dB + {0x2b, 0x2a, 0x25, 0x1e, 0x16, 0x0e, 0x07, 0x03}, // 28, -2.0dB + {0x2d, 0x2d, 0x27, 0x1f, 0x18, 0x0f, 0x08, 0x03}, // 29, -1.5dB + {0x30, 0x2f, 0x29, 0x21, 0x19, 0x10, 0x08, 0x03}, // 30, -1.0dB + {0x33, 0x32, 0x2b, 0x23, 0x1a, 0x11, 0x08, 0x04}, // 31, -0.5dB + {0x36, 0x35, 0x2e, 0x25, 0x1c, 0x12, 0x09, 0x04} // 32, +0dB +}; + + +u1Byte CCKSwingTable_Ch14_New[CCK_TABLE_SIZE][8]= { + {0x09, 0x08, 0x07, 0x04, 0x00, 0x00, 0x00, 0x00}, // 0, -16.0dB + {0x09, 0x09, 0x08, 0x05, 0x00, 0x00, 0x00, 0x00}, // 1, -15.5dB + {0x0a, 0x09, 0x08, 0x05, 0x00, 0x00, 0x00, 0x00}, // 2, -15.0dB + {0x0a, 0x0a, 0x09, 0x05, 0x00, 0x00, 0x00, 0x00}, // 3, -14.5dB + {0x0b, 0x0a, 0x09, 0x05, 0x00, 0x00, 0x00, 0x00}, // 4, -14.0dB + {0x0b, 0x0b, 0x0a, 0x06, 0x00, 0x00, 0x00, 0x00}, // 5, -13.5dB + {0x0c, 0x0c, 0x0a, 0x06, 0x00, 0x00, 0x00, 0x00}, // 6, -13.0dB + {0x0d, 0x0c, 0x0b, 0x06, 0x00, 0x00, 0x00, 0x00}, // 7, -12.5dB + {0x0d, 0x0d, 0x0c, 0x07, 0x00, 0x00, 0x00, 0x00}, // 8, -12.0dB + {0x0e, 0x0e, 0x0c, 0x07, 0x00, 0x00, 0x00, 0x00}, // 9, -11.5dB + {0x0f, 0x0f, 0x0d, 0x08, 0x00, 0x00, 0x00, 0x00}, // 10, -11.0dB + {0x10, 0x10, 0x0e, 0x08, 0x00, 0x00, 0x00, 0x00}, // 11, -10.5dB + {0x11, 0x11, 0x0f, 0x09, 0x00, 0x00, 0x00, 0x00}, // 12, -10.0dB + {0x12, 0x12, 0x0f, 0x09, 0x00, 0x00, 0x00, 0x00}, // 13, -9.5dB + {0x13, 0x13, 0x10, 0x0a, 0x00, 0x00, 0x00, 0x00}, // 14, -9.0dB + {0x14, 0x14, 0x11, 0x0a, 0x00, 0x00, 0x00, 0x00}, // 15, -8.5dB + {0x16, 0x15, 0x12, 0x0b, 0x00, 0x00, 0x00, 0x00}, // 16, -8.0dB + {0x17, 0x16, 0x13, 0x0b, 0x00, 0x00, 0x00, 0x00}, // 17, -7.5dB + {0x18, 0x17, 0x15, 0x0c, 0x00, 0x00, 0x00, 0x00}, // 18, -7.0dB + {0x1a, 0x19, 0x16, 0x0d, 0x00, 0x00, 0x00, 0x00}, // 19, -6.5dB + {0x1b, 0x1a, 0x17, 0x0e, 0x00, 0x00, 0x00, 0x00}, // 20, -6.0dB + {0x1d, 0x1c, 0x18, 0x0e, 0x00, 0x00, 0x00, 0x00}, // 21, -5.5dB + {0x1f, 0x1e, 0x1a, 0x0f, 0x00, 0x00, 0x00, 0x00}, // 22, -5.0dB + {0x20, 0x20, 0x1b, 0x10, 0x00, 0x00, 0x00, 0x00}, // 23, -4.5dB + {0x22, 0x21, 0x1d, 0x11, 0x00, 0x00, 0x00, 0x00}, // 24, -4.0dB + {0x24, 0x23, 0x1f, 0x12, 0x00, 0x00, 0x00, 0x00}, // 25, -3.5dB + {0x26, 0x25, 0x21, 0x13, 0x00, 0x00, 0x00, 0x00}, // 26, -3.0dB + {0x28, 0x28, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00}, // 27, -2.5dB + {0x2b, 0x2a, 0x25, 0x15, 0x00, 0x00, 0x00, 0x00}, // 28, -2.0dB + {0x2d, 0x2d, 0x17, 0x17, 0x00, 0x00, 0x00, 0x00}, // 29, -1.5dB + {0x30, 0x2f, 0x29, 0x18, 0x00, 0x00, 0x00, 0x00}, // 30, -1.0dB + {0x33, 0x32, 0x2b, 0x19, 0x00, 0x00, 0x00, 0x00}, // 31, -0.5dB + {0x36, 0x35, 0x2e, 0x1b, 0x00, 0x00, 0x00, 0x00} // 32, +0dB +}; + +u4Byte TxScalingTable_Jaguar[TXSCALE_TABLE_SIZE] = +{ + 0x081, // 0, -12.0dB + 0x088, // 1, -11.5dB + 0x090, // 2, -11.0dB + 0x099, // 3, -10.5dB + 0x0A2, // 4, -10.0dB + 0x0AC, // 5, -9.5dB + 0x0B6, // 6, -9.0dB + 0x0C0, // 7, -8.5dB + 0x0CC, // 8, -8.0dB + 0x0D8, // 9, -7.5dB + 0x0E5, // 10, -7.0dB + 0x0F2, // 11, -6.5dB + 0x101, // 12, -6.0dB + 0x110, // 13, -5.5dB + 0x120, // 14, -5.0dB + 0x131, // 15, -4.5dB + 0x143, // 16, -4.0dB + 0x156, // 17, -3.5dB + 0x16A, // 18, -3.0dB + 0x180, // 19, -2.5dB + 0x197, // 20, -2.0dB + 0x1AF, // 21, -1.5dB + 0x1C8, // 22, -1.0dB + 0x1E3, // 23, -0.5dB + 0x200, // 24, +0 dB + 0x21E, // 25, +0.5dB + 0x23E, // 26, +1.0dB + 0x261, // 27, +1.5dB + 0x285, // 28, +2.0dB + 0x2AB, // 29, +2.5dB + 0x2D3, // 30, +3.0dB + 0x2FE, // 31, +3.5dB + 0x32B, // 32, +4.0dB + 0x35C, // 33, +4.5dB + 0x38E, // 34, +5.0dB + 0x3C4, // 35, +5.5dB + 0x3FE // 36, +6.0dB +}; + +#ifdef AP_BUILD_WORKAROUND + +unsigned int TxPwrTrk_OFDM_SwingTbl[TxPwrTrk_OFDM_SwingTbl_Len] = { + /* +6.0dB */ 0x7f8001fe, + /* +5.5dB */ 0x788001e2, + /* +5.0dB */ 0x71c001c7, + /* +4.5dB */ 0x6b8001ae, + /* +4.0dB */ 0x65400195, + /* +3.5dB */ 0x5fc0017f, + /* +3.0dB */ 0x5a400169, + /* +2.5dB */ 0x55400155, + /* +2.0dB */ 0x50800142, + /* +1.5dB */ 0x4c000130, + /* +1.0dB */ 0x47c0011f, + /* +0.5dB */ 0x43c0010f, + /* 0.0dB */ 0x40000100, + /* -0.5dB */ 0x3c8000f2, + /* -1.0dB */ 0x390000e4, + /* -1.5dB */ 0x35c000d7, + /* -2.0dB */ 0x32c000cb, + /* -2.5dB */ 0x300000c0, + /* -3.0dB */ 0x2d4000b5, + /* -3.5dB */ 0x2ac000ab, + /* -4.0dB */ 0x288000a2, + /* -4.5dB */ 0x26000098, + /* -5.0dB */ 0x24000090, + /* -5.5dB */ 0x22000088, + /* -6.0dB */ 0x20000080, + /* -6.5dB */ 0x1a00006c, + /* -7.0dB */ 0x1c800072, + /* -7.5dB */ 0x18000060, + /* -8.0dB */ 0x19800066, + /* -8.5dB */ 0x15800056, + /* -9.0dB */ 0x26c0005b, + /* -9.5dB */ 0x14400051, + /* -10.0dB */ 0x24400051, + /* -10.5dB */ 0x1300004c, + /* -11.0dB */ 0x12000048, + /* -11.5dB */ 0x11000044, + /* -12.0dB */ 0x10000040 +}; +#endif + + + +VOID +odm_TXPowerTrackingInit( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; +#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) + if(!(pDM_Odm->SupportICType & (ODM_RTL8814A|ODM_IC_11N_SERIES))) + return; +#endif + + odm_TXPowerTrackingThermalMeterInit(pDM_Odm); +} + +u1Byte +getSwingIndex( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PADAPTER Adapter = pDM_Odm->Adapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + u1Byte i = 0; + u4Byte bbSwing; + u4Byte swingTableSize; + pu4Byte pSwingTable; + + if (pDM_Odm->SupportICType == ODM_RTL8188E || pDM_Odm->SupportICType == ODM_RTL8723B || + pDM_Odm->SupportICType == ODM_RTL8192E) + { + bbSwing = PHY_QueryBBReg(Adapter, rOFDM0_XATxIQImbalance, 0xFFC00000); + + pSwingTable = OFDMSwingTable_New; + swingTableSize = OFDM_TABLE_SIZE; + } else { +#if ((RTL8812A_SUPPORT==1)||(RTL8821A_SUPPORT==1)) + if (pDM_Odm->SupportICType == ODM_RTL8812 || pDM_Odm->SupportICType == ODM_RTL8821) + { + bbSwing = PHY_GetTxBBSwing_8812A(Adapter, pHalData->CurrentBandType, ODM_RF_PATH_A); + pSwingTable = TxScalingTable_Jaguar; + swingTableSize = TXSCALE_TABLE_SIZE; + } + else +#endif + { + bbSwing = 0; + pSwingTable = OFDMSwingTable; + swingTableSize = OFDM_TABLE_SIZE; + } + } + + for (i = 0; i < swingTableSize; ++i) { + u4Byte tableValue = pSwingTable[i]; + + if (tableValue >= 0x100000 ) + tableValue >>= 22; + if (bbSwing == tableValue) + break; + } + return i; +} + +VOID +odm_TXPowerTrackingThermalMeterInit( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + u1Byte defaultSwingIndex = getSwingIndex(pDM_Odm); + u1Byte p = 0; +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + PADAPTER Adapter = pDM_Odm->Adapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + + if(pDM_Odm->mp_mode == FALSE) + pHalData->TxPowerTrackControl = TRUE; +#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) + PADAPTER Adapter = pDM_Odm->Adapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + + + if (pDM_Odm->SupportICType >= ODM_RTL8188E) + { + pDM_Odm->RFCalibrateInfo.bTXPowerTracking = _TRUE; + pDM_Odm->RFCalibrateInfo.TXPowercount = 0; + pDM_Odm->RFCalibrateInfo.bTXPowerTrackingInit = _FALSE; + + if(pDM_Odm->mp_mode == FALSE) + pDM_Odm->RFCalibrateInfo.TxPowerTrackControl = _TRUE; + else + pDM_Odm->RFCalibrateInfo.TxPowerTrackControl = _FALSE; + + MSG_8192C("pDM_Odm TxPowerTrackControl = %d\n", pDM_Odm->RFCalibrateInfo.TxPowerTrackControl); + } + else + { + struct dm_priv *pdmpriv = &pHalData->dmpriv; + + pdmpriv->bTXPowerTracking = _TRUE; + pdmpriv->TXPowercount = 0; + pdmpriv->bTXPowerTrackingInit = _FALSE; + //#if (MP_DRIVER != 1) //for mp driver, turn off txpwrtracking as default + + if(pDM_Odm->mp_mode == FALSE) + pdmpriv->TxPowerTrackControl = _TRUE; + else + pdmpriv->TxPowerTrackControl = _FALSE; + + + //MSG_8192C("pdmpriv->TxPowerTrackControl = %d\n", pdmpriv->TxPowerTrackControl); + } + +#elif (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) + #ifdef RTL8188E_SUPPORT + { + pDM_Odm->RFCalibrateInfo.bTXPowerTracking = _TRUE; + pDM_Odm->RFCalibrateInfo.TXPowercount = 0; + pDM_Odm->RFCalibrateInfo.bTXPowerTrackingInit = _FALSE; + pDM_Odm->RFCalibrateInfo.TxPowerTrackControl = _TRUE; + } + #endif +#endif + + //pDM_Odm->RFCalibrateInfo.TxPowerTrackControl = TRUE; + pDM_Odm->RFCalibrateInfo.ThermalValue = pHalData->EEPROMThermalMeter; + pDM_Odm->RFCalibrateInfo.ThermalValue_IQK = pHalData->EEPROMThermalMeter; + pDM_Odm->RFCalibrateInfo.ThermalValue_LCK = pHalData->EEPROMThermalMeter; + + // The index of "0 dB" in SwingTable. + if (pDM_Odm->SupportICType == ODM_RTL8188E || pDM_Odm->SupportICType == ODM_RTL8723B || + pDM_Odm->SupportICType == ODM_RTL8192E) + { + pDM_Odm->DefaultOfdmIndex = (defaultSwingIndex >= OFDM_TABLE_SIZE) ? 30 : defaultSwingIndex; + pDM_Odm->DefaultCckIndex = 20; + } + else + { + pDM_Odm->DefaultOfdmIndex = (defaultSwingIndex >= TXSCALE_TABLE_SIZE) ? 24 : defaultSwingIndex; + pDM_Odm->DefaultCckIndex = 24; + } + + pDM_Odm->BbSwingIdxCckBase = pDM_Odm->DefaultCckIndex; + pDM_Odm->RFCalibrateInfo.CCK_index = pDM_Odm->DefaultCckIndex; + + for (p = ODM_RF_PATH_A; p < MAX_RF_PATH; ++p) + { + pDM_Odm->BbSwingIdxOfdmBase[p] = pDM_Odm->DefaultOfdmIndex; + pDM_Odm->RFCalibrateInfo.OFDM_index[p] = pDM_Odm->DefaultOfdmIndex; + pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[p] = 0; + pDM_Odm->RFCalibrateInfo.DeltaPowerIndexLast[p] = 0; + pDM_Odm->RFCalibrateInfo.PowerIndexOffset[p] = 0; + } + +} + + +VOID +ODM_TXPowerTrackingCheck( + IN PVOID pDM_VOID + ) +{ + // + // 2011/09/29 MH In HW integration first stage, we provide 4 different handle to operate + // at the same time. In the stage2/3, we need to prive universal interface and merge all + // HW dynamic mechanism. + // + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + switch (pDM_Odm->SupportPlatform) + { + case ODM_WIN: + odm_TXPowerTrackingCheckMP(pDM_Odm); + break; + + case ODM_CE: + odm_TXPowerTrackingCheckCE(pDM_Odm); + break; + + case ODM_AP: + odm_TXPowerTrackingCheckAP(pDM_Odm); + break; + + case ODM_ADSL: + //odm_DIGAP(pDM_Odm); + break; + } + +} + +VOID +odm_TXPowerTrackingCheckCE( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; +#if (DM_ODM_SUPPORT_TYPE == ODM_CE) + PADAPTER Adapter = pDM_Odm->Adapter; + #if( (RTL8192C_SUPPORT==1) || (RTL8723A_SUPPORT==1) ) + if(IS_HARDWARE_TYPE_8192C(Adapter)){ + rtl8192c_odm_CheckTXPowerTracking(Adapter); + return; + } + #endif + + #if (RTL8192D_SUPPORT==1) + if(IS_HARDWARE_TYPE_8192D(Adapter)){ + #if (RTL8192D_EASY_SMART_CONCURRENT == 1) + if(!Adapter->bSlaveOfDMSP) + #endif + rtl8192d_odm_CheckTXPowerTracking(Adapter); + return; + } + #endif + + #if(((RTL8188E_SUPPORT==1) || (RTL8812A_SUPPORT==1) || (RTL8821A_SUPPORT==1) || (RTL8192E_SUPPORT==1) || (RTL8723B_SUPPORT==1) )) + if(!(pDM_Odm->SupportAbility & ODM_RF_TX_PWR_TRACK)) + { + return; + } + + if(!pDM_Odm->RFCalibrateInfo.TM_Trigger) //at least delay 1 sec + { + //pHalData->TxPowerCheckCnt++; //cosa add for debug + if(IS_HARDWARE_TYPE_8188E(Adapter) || IS_HARDWARE_TYPE_JAGUAR(Adapter) || IS_HARDWARE_TYPE_8192E(Adapter)||IS_HARDWARE_TYPE_8723B(Adapter)) + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_T_METER_NEW, (BIT17 | BIT16), 0x03); + else + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_T_METER_OLD, bRFRegOffsetMask, 0x60); + + //DBG_871X("Trigger Thermal Meter!!\n"); + + pDM_Odm->RFCalibrateInfo.TM_Trigger = 1; + return; + } + else + { + //DBG_871X("Schedule TxPowerTracking direct call!!\n"); + ODM_TXPowerTrackingCallback_ThermalMeter(Adapter); + pDM_Odm->RFCalibrateInfo.TM_Trigger = 0; + } + #endif +#endif +} + +VOID +odm_TXPowerTrackingCheckMP( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + PADAPTER Adapter = pDM_Odm->Adapter; + + if (ODM_CheckPowerStatus(Adapter) == FALSE) + { + RT_TRACE(COMP_POWER_TRACKING, DBG_LOUD, ("===>ODM_CheckPowerStatus() return FALSE\n")); + return; + } + + if(IS_HARDWARE_TYPE_8723A(Adapter)) + return; + + if(!Adapter->bSlaveOfDMSP || Adapter->DualMacSmartConcurrent == FALSE) + odm_TXPowerTrackingThermalMeterCheck(Adapter); + else { + RT_TRACE(COMP_POWER_TRACKING, DBG_LOUD, ("!Adapter->bSlaveOfDMSP || Adapter->DualMacSmartConcurrent == FALSE\n")); + } +#endif + +} + + +VOID +odm_TXPowerTrackingCheckAP( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; +#if (DM_ODM_SUPPORT_TYPE == ODM_AP) + prtl8192cd_priv priv = pDM_Odm->priv; + + if ( (priv->pmib->dot11RFEntry.ther) && ((priv->up_time % priv->pshare->rf_ft_var.tpt_period) == 0)){ +#ifdef CONFIG_RTL_92D_SUPPORT + if (GET_CHIP_VER(priv)==VERSION_8192D){ + tx_power_tracking_92D(priv); + } else +#endif + { +#ifdef CONFIG_RTL_92C_SUPPORT + tx_power_tracking(priv); +#endif + } + } +#endif + +} + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) +VOID +odm_TXPowerTrackingThermalMeterCheck( + IN PADAPTER Adapter + ) +{ +#ifndef AP_BUILD_WORKAROUND + static u1Byte TM_Trigger = 0; + + if(!(GET_HAL_DATA(Adapter)->DM_OutSrc.SupportAbility & ODM_RF_TX_PWR_TRACK)) + { + RT_TRACE(COMP_POWER_TRACKING, DBG_LOUD, + ("===>odm_TXPowerTrackingThermalMeterCheck(),pMgntInfo->bTXPowerTracking is FALSE, return!!\n")); + return; + } + + if(!TM_Trigger) //at least delay 1 sec + { + if(IS_HARDWARE_TYPE_8192D(Adapter)) + PHY_SetRFReg(Adapter, ODM_RF_PATH_A, RF_T_METER_92D, BIT17 | BIT16, 0x03); + else if(IS_HARDWARE_TYPE_8188E(Adapter) || IS_HARDWARE_TYPE_JAGUAR(Adapter) || IS_HARDWARE_TYPE_8192E(Adapter) || + IS_HARDWARE_TYPE_8723B(Adapter)) + PHY_SetRFReg(Adapter, ODM_RF_PATH_A, RF_T_METER_88E, BIT17 | BIT16, 0x03); + else + PHY_SetRFReg(Adapter, ODM_RF_PATH_A, RF_T_METER, bRFRegOffsetMask, 0x60); + + RT_TRACE(COMP_POWER_TRACKING, DBG_LOUD,("Trigger Thermal Meter!!\n")); + + TM_Trigger = 1; + return; + } + else + { + RT_TRACE(COMP_POWER_TRACKING, DBG_LOUD,("Schedule TxPowerTracking direct call!!\n")); + odm_TXPowerTrackingDirectCall(Adapter); //Using direct call is instead, added by Roger, 2009.06.18. + TM_Trigger = 0; + } +#endif +} +#endif + + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_PowerTracking.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_PowerTracking.h new file mode 100644 index 00000000000000..727cdb14a8167c --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_PowerTracking.h @@ -0,0 +1,248 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +#ifndef __PHYDMPOWERTRACKING_H__ +#define __PHYDMPOWERTRACKING_H__ + +#define POWRTRACKING_VERSION "1.0" + +#define DPK_DELTA_MAPPING_NUM 13 +#define index_mapping_HP_NUM 15 +#define OFDM_TABLE_SIZE 43 +#define CCK_TABLE_SIZE 33 +#define TXSCALE_TABLE_SIZE 37 +#define TXPWR_TRACK_TABLE_SIZE 30 +#define DELTA_SWINGIDX_SIZE 30 +#define BAND_NUM 4 + +#define AVG_THERMAL_NUM 8 +#define HP_THERMAL_NUM 8 +#define IQK_MAC_REG_NUM 4 +#define IQK_ADDA_REG_NUM 16 +#define IQK_BB_REG_NUM_MAX 10 +#if (RTL8192D_SUPPORT==1) +#define IQK_BB_REG_NUM 10 +#else +#define IQK_BB_REG_NUM 9 +#endif + + +#define IQK_Matrix_REG_NUM 8 +#define IQK_Matrix_Settings_NUM 14+24+21 // Channels_2_4G_NUM + Channels_5G_20M_NUM + Channels_5G + +extern u4Byte OFDMSwingTable[OFDM_TABLE_SIZE]; +extern u1Byte CCKSwingTable_Ch1_Ch13[CCK_TABLE_SIZE][8]; +extern u1Byte CCKSwingTable_Ch14 [CCK_TABLE_SIZE][8]; + +extern u4Byte OFDMSwingTable_New[OFDM_TABLE_SIZE]; +extern u1Byte CCKSwingTable_Ch1_Ch13_New[CCK_TABLE_SIZE][8]; +extern u1Byte CCKSwingTable_Ch14_New [CCK_TABLE_SIZE][8]; + +extern u4Byte TxScalingTable_Jaguar[TXSCALE_TABLE_SIZE]; + +// <20121018, Kordan> In case fail to read TxPowerTrack.txt, we use the table of 88E as the default table. +static u1Byte DeltaSwingTableIdx_2GA_P_8188E[] = {0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9}; +static u1Byte DeltaSwingTableIdx_2GA_N_8188E[] = {0, 0, 0, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5, 6, 6, 7, 7, 7, 7, 8, 8, 9, 9, 10, 10, 10, 11, 11, 11, 11}; + +#define dm_CheckTXPowerTracking ODM_TXPowerTrackingCheck + +typedef struct _IQK_MATRIX_REGS_SETTING{ + BOOLEAN bIQKDone; + s4Byte Value[3][IQK_Matrix_REG_NUM]; + BOOLEAN bBWIqkResultSaved[3]; +}IQK_MATRIX_REGS_SETTING,*PIQK_MATRIX_REGS_SETTING; + +typedef struct ODM_RF_Calibration_Structure +{ + //for tx power tracking + + u4Byte RegA24; // for TempCCK + s4Byte RegE94; + s4Byte RegE9C; + s4Byte RegEB4; + s4Byte RegEBC; + + u1Byte TXPowercount; + BOOLEAN bTXPowerTrackingInit; + BOOLEAN bTXPowerTracking; + u1Byte TxPowerTrackControl; //for mp mode, turn off txpwrtracking as default + u1Byte TM_Trigger; + u1Byte InternalPA5G[2]; //pathA / pathB + + u1Byte ThermalMeter[2]; // ThermalMeter, index 0 for RFIC0, and 1 for RFIC1 + u1Byte ThermalValue; + u1Byte ThermalValue_LCK; + u1Byte ThermalValue_IQK; + u1Byte ThermalValue_DPK; + u1Byte ThermalValue_AVG[AVG_THERMAL_NUM]; + u1Byte ThermalValue_AVG_index; + u1Byte ThermalValue_RxGain; + u1Byte ThermalValue_Crystal; + u1Byte ThermalValue_DPKstore; + u1Byte ThermalValue_DPKtrack; + BOOLEAN TxPowerTrackingInProgress; + + BOOLEAN bReloadtxpowerindex; + u1Byte bRfPiEnable; + u4Byte TXPowerTrackingCallbackCnt; //cosa add for debug + + + //------------------------- Tx power Tracking -------------------------// + u1Byte bCCKinCH14; + u1Byte CCK_index; + u1Byte OFDM_index[MAX_RF_PATH]; + s1Byte PowerIndexOffset[MAX_RF_PATH]; + s1Byte DeltaPowerIndex[MAX_RF_PATH]; + s1Byte DeltaPowerIndexLast[MAX_RF_PATH]; + BOOLEAN bTxPowerChanged; + + u1Byte ThermalValue_HP[HP_THERMAL_NUM]; + u1Byte ThermalValue_HP_index; + IQK_MATRIX_REGS_SETTING IQKMatrixRegSetting[IQK_Matrix_Settings_NUM]; + u1Byte Delta_LCK; + s1Byte BBSwingDiff2G, BBSwingDiff5G; // Unit: dB + u1Byte DeltaSwingTableIdx_2GCCKA_P[DELTA_SWINGIDX_SIZE]; + u1Byte DeltaSwingTableIdx_2GCCKA_N[DELTA_SWINGIDX_SIZE]; + u1Byte DeltaSwingTableIdx_2GCCKB_P[DELTA_SWINGIDX_SIZE]; + u1Byte DeltaSwingTableIdx_2GCCKB_N[DELTA_SWINGIDX_SIZE]; + u1Byte DeltaSwingTableIdx_2GA_P[DELTA_SWINGIDX_SIZE]; + u1Byte DeltaSwingTableIdx_2GA_N[DELTA_SWINGIDX_SIZE]; + u1Byte DeltaSwingTableIdx_2GB_P[DELTA_SWINGIDX_SIZE]; + u1Byte DeltaSwingTableIdx_2GB_N[DELTA_SWINGIDX_SIZE]; + u1Byte DeltaSwingTableIdx_5GA_P[BAND_NUM][DELTA_SWINGIDX_SIZE]; + u1Byte DeltaSwingTableIdx_5GA_N[BAND_NUM][DELTA_SWINGIDX_SIZE]; + u1Byte DeltaSwingTableIdx_5GB_P[BAND_NUM][DELTA_SWINGIDX_SIZE]; + u1Byte DeltaSwingTableIdx_5GB_N[BAND_NUM][DELTA_SWINGIDX_SIZE]; + u1Byte DeltaSwingTableIdx_2GA_P_8188E[DELTA_SWINGIDX_SIZE]; + u1Byte DeltaSwingTableIdx_2GA_N_8188E[DELTA_SWINGIDX_SIZE]; + + + //--------------------------------------------------------------------// + + //for IQK + u4Byte RegC04; + u4Byte Reg874; + u4Byte RegC08; + u4Byte RegB68; + u4Byte RegB6C; + u4Byte Reg870; + u4Byte Reg860; + u4Byte Reg864; + + BOOLEAN bIQKInitialized; + BOOLEAN bLCKInProgress; + BOOLEAN bAntennaDetected; + BOOLEAN bNeedIQK; + BOOLEAN bIQKInProgress; + u1Byte Delta_IQK; + u4Byte ADDA_backup[IQK_ADDA_REG_NUM]; + u4Byte IQK_MAC_backup[IQK_MAC_REG_NUM]; + u4Byte IQK_BB_backup_recover[9]; + u4Byte IQK_BB_backup[IQK_BB_REG_NUM]; + u4Byte TxIQC_8723B[2][3][2]; // { {S1: 0xc94, 0xc80, 0xc4c} , {S0: 0xc9c, 0xc88, 0xc4c}} + u4Byte RxIQC_8723B[2][2][2]; // { {S1: 0xc14, 0xca0} , {S0: 0xc14, 0xca0}} + + // IQK time measurement + u8Byte IQK_StartTime; + u8Byte IQK_ProgressingTime; + + //for APK + u4Byte APKoutput[2][2]; //path A/B; output1_1a/output1_2a + u1Byte bAPKdone; + u1Byte bAPKThermalMeterIgnore; + + // DPK + BOOLEAN bDPKFail; + u1Byte bDPdone; + u1Byte bDPPathAOK; + u1Byte bDPPathBOK; + + u4Byte TxLOK[2]; + +}ODM_RF_CAL_T,*PODM_RF_CAL_T; + + +VOID +ODM_TXPowerTrackingCheck( + IN PVOID pDM_VOID + ); + + +VOID +odm_TXPowerTrackingInit( + IN PVOID pDM_VOID + ); + +VOID +odm_TXPowerTrackingCheckAP( + IN PVOID pDM_VOID + ); + +VOID +odm_TXPowerTrackingThermalMeterInit( + IN PVOID pDM_VOID + ); + +VOID +odm_TXPowerTrackingInit( + IN PVOID pDM_VOID + ); + +VOID +odm_TXPowerTrackingCheckMP( + IN PVOID pDM_VOID + ); + + +VOID +odm_TXPowerTrackingCheckCE( + IN PVOID pDM_VOID + ); + +#if(DM_ODM_SUPPORT_TYPE & (ODM_WIN)) + +VOID +odm_TXPowerTrackingCallbackThermalMeter92C( + IN PADAPTER Adapter + ); + +VOID +odm_TXPowerTrackingCallbackRXGainThermalMeter92D( + IN PADAPTER Adapter + ); + +VOID +odm_TXPowerTrackingCallbackThermalMeter92D( + IN PADAPTER Adapter + ); + +VOID +odm_TXPowerTrackingDirectCall92C( + IN PADAPTER Adapter + ); + +VOID +odm_TXPowerTrackingThermalMeterCheck( + IN PADAPTER Adapter + ); + +#endif + +#endif diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_RXHP.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_RXHP.c new file mode 100644 index 00000000000000..fcdcb0eca35405 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_RXHP.c @@ -0,0 +1,1685 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ +//============================================================ +// include files +//============================================================ +#include "Mp_Precomp.h" +#include "phydm_precomp.h" + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + +#define AFH_PSD 1 //0:normal PSD scan, 1: only do 20 pts PSD +#define MODE_40M 0 //0:20M, 1:40M +#define PSD_TH2 3 +#define PSD_CHMIN 20 // Minimum channel number for BT AFH +#define SIR_STEP_SIZE 3 +#define Smooth_Size_1 5 +#define Smooth_TH_1 3 +#define Smooth_Size_2 10 +#define Smooth_TH_2 4 +#define Smooth_Size_3 20 +#define Smooth_TH_3 4 +#define Smooth_Step_Size 5 +#define Adaptive_SIR 1 +#define SCAN_INTERVAL 1500 //ms +#define SYN_Length 5 // for 92D + +#define LNA_Low_Gain_1 0x64 +#define LNA_Low_Gain_2 0x5A +#define LNA_Low_Gain_3 0x58 + +#define pw_th_10dB 0x0 +#define pw_th_16dB 0x3 + +#define FA_RXHP_TH1 5000 +#define FA_RXHP_TH2 1500 +#define FA_RXHP_TH3 800 +#define FA_RXHP_TH4 600 +#define FA_RXHP_TH5 500 + +#define Idle_Mode 0 +#define High_TP_Mode 1 +#define Low_TP_Mode 2 + + +VOID +odm_PSDMonitorInit( + IN PVOID pDM_VOID + ) +{ +#if (DEV_BUS_TYPE == RT_PCI_INTERFACE)|(DEV_BUS_TYPE == RT_USB_INTERFACE) + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + + //HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + //PSD Monitor Setting + //Which path in ADC/DAC is turnned on for PSD: both I/Q + ODM_SetBBReg(pDM_Odm, ODM_PSDREG, BIT10|BIT11, 0x3); + //Ageraged number: 8 + ODM_SetBBReg(pDM_Odm, ODM_PSDREG, BIT12|BIT13, 0x1); + pDM_Odm->bPSDinProcess = FALSE; + pDM_Odm->bUserAssignLevel = FALSE; + pDM_Odm->bPSDactive = FALSE; + //pDM_Odm->bDMInitialGainEnable=TRUE; //change the initialization to DIGinit + //Set Debug Port + //PHY_SetBBReg(Adapter, 0x908, bMaskDWord, 0x803); + //PHY_SetBBReg(Adapter, 0xB34, bMaskByte0, 0x00); // pause PSD + //PHY_SetBBReg(Adapter, 0xB38, bMaskByte0, 10); //rescan + //PHY_SetBBReg(Adapter, 0xB38, bMaskByte2|bMaskByte3, 100); //interval + + //PlatformSetTimer( Adapter, &pHalData->PSDTriggerTimer, 0); //ms +#endif +} + +VOID +PatchDCTone( + IN PVOID pDM_VOID, + pu4Byte PSD_report, + u1Byte initial_gain_psd +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + //HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + //PADAPTER pAdapter; + + u4Byte psd_report; + + //2 Switch to CH11 to patch CH9 and CH13 DC tone + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_CHNLBW, 0x3FF, 11); + + if(pDM_Odm->SupportICType== ODM_RTL8192D) + { + if((*(pDM_Odm->pMacPhyMode) == ODM_SMSP)||(*(pDM_Odm->pMacPhyMode) == ODM_DMSP)) + { + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, RF_CHNLBW, 0x3FF, 11); + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x25, 0xfffff, 0x643BC); + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x26, 0xfffff, 0xFC038); + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x27, 0xfffff, 0x77C1A); + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x2B, 0xfffff, 0x41289); + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x2C, 0xfffff, 0x01840); + } + else + { + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x25, 0xfffff, 0x643BC); + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x26, 0xfffff, 0xFC038); + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x27, 0xfffff, 0x77C1A); + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x2B, 0xfffff, 0x41289); + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x2C, 0xfffff, 0x01840); + } + } + + //Ch9 DC tone patch + psd_report = GetPSDData(pDM_Odm, 96, initial_gain_psd); + PSD_report[50] = psd_report; + //Ch13 DC tone patch + psd_report = GetPSDData(pDM_Odm, 32, initial_gain_psd); + PSD_report[70] = psd_report; + + //2 Switch to CH3 to patch CH1 and CH5 DC tone + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_CHNLBW, 0x3FF, 3); + + + if(pDM_Odm->SupportICType==ODM_RTL8192D) + { + if((*(pDM_Odm->pMacPhyMode) == ODM_SMSP)||(*(pDM_Odm->pMacPhyMode) == ODM_DMSP)) + { + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, RF_CHNLBW, 0x3FF, 3); + //PHY_SetRFReg(Adapter, ODM_RF_PATH_B, 0x25, 0xfffff, 0x643BC); + //PHY_SetRFReg(Adapter, ODM_RF_PATH_B, 0x26, 0xfffff, 0xFC038); + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x27, 0xfffff, 0x07C1A); + //PHY_SetRFReg(Adapter, ODM_RF_PATH_B, 0x2B, 0xfffff, 0x61289); + //PHY_SetRFReg(Adapter, ODM_RF_PATH_B, 0x2C, 0xfffff, 0x01C41); + } + else + { + //PHY_SetRFReg(Adapter, ODM_RF_PATH_A, 0x25, 0xfffff, 0x643BC); + //PHY_SetRFReg(Adapter, ODM_RF_PATH_A, 0x26, 0xfffff, 0xFC038); + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x27, 0xfffff, 0x07C1A); + //PHY_SetRFReg(Adapter, ODM_RF_PATH_A, 0x2B, 0xfffff, 0x61289); + //PHY_SetRFReg(Adapter, ODM_RF_PATH_A, 0x2C, 0xfffff, 0x01C41); + } + } + + //Ch1 DC tone patch + psd_report = GetPSDData(pDM_Odm, 96, initial_gain_psd); + PSD_report[10] = psd_report; + //Ch5 DC tone patch + psd_report = GetPSDData(pDM_Odm, 32, initial_gain_psd); + PSD_report[30] = psd_report; + +} + + +VOID +GoodChannelDecision( + IN PVOID pDM_VOID, + pu4Byte PSD_report, + pu1Byte PSD_bitmap, + u1Byte RSSI_BT, + pu1Byte PSD_bitmap_memory) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pRXHP_T pRX_HP_Table = &pDM_Odm->DM_RXHP_Table; + //s4Byte TH1 = SSBT-0x15; // modify TH by Neil Chen + s4Byte TH1= RSSI_BT+0x14; + s4Byte TH2 = RSSI_BT+85; + //u2Byte TH3; +// s4Byte RegB34; + u1Byte bitmap, Smooth_size[3], Smooth_TH[3]; + //u1Byte psd_bit; + u4Byte i,n,j, byte_idx, bit_idx, good_cnt, good_cnt_smoothing, Smooth_Interval[3]; + int start_byte_idx,start_bit_idx,cur_byte_idx, cur_bit_idx,NOW_byte_idx ; + +// RegB34 = PHY_QueryBBReg(Adapter,0xB34, bMaskDWord)&0xFF; + + if((pDM_Odm->SupportICType == ODM_RTL8192C)||(pDM_Odm->SupportICType == ODM_RTL8192D)) + { + TH1 = RSSI_BT + 0x14; + } + + Smooth_size[0]=Smooth_Size_1; + Smooth_size[1]=Smooth_Size_2; + Smooth_size[2]=Smooth_Size_3; + Smooth_TH[0]=Smooth_TH_1; + Smooth_TH[1]=Smooth_TH_2; + Smooth_TH[2]=Smooth_TH_3; + Smooth_Interval[0]=16; + Smooth_Interval[1]=15; + Smooth_Interval[2]=13; + good_cnt = 0; + if(pDM_Odm->SupportICType==ODM_RTL8723A) + { + //2 Threshold + + if(RSSI_BT >=41) + TH1 = 113; + else if(RSSI_BT >=38) // >= -15dBm + TH1 = 105; //0x69 + else if((RSSI_BT >=33)&(RSSI_BT <38)) + TH1 = 99+(RSSI_BT-33); //0x63 + else if((RSSI_BT >=26)&(RSSI_BT<33)) + TH1 = 99-(33-RSSI_BT)+2; //0x5e + else if((RSSI_BT >=24)&(RSSI_BT<26)) + TH1 = 88-((RSSI_BT-24)*3); //0x58 + else if((RSSI_BT >=18)&(RSSI_BT<24)) + TH1 = 77+((RSSI_BT-18)*2); + else if((RSSI_BT >=14)&(RSSI_BT<18)) + TH1 = 63+((RSSI_BT-14)*2); + else if((RSSI_BT >=8)&(RSSI_BT<14)) + TH1 = 58+((RSSI_BT-8)*2); + else if((RSSI_BT >=3)&(RSSI_BT<8)) + TH1 = 52+(RSSI_BT-3); + else + TH1 = 51; + } + + for (i = 0; i< 10; i++) + PSD_bitmap[i] = 0; + + + // Add By Gary + for (i=0; i<80; i++) + pRX_HP_Table->PSD_bitmap_RXHP[i] = 0; + // End + + + + if(pDM_Odm->SupportICType==ODM_RTL8723A) + { + TH1 =TH1-SIR_STEP_SIZE; + } + while (good_cnt < PSD_CHMIN) + { + good_cnt = 0; + if(pDM_Odm->SupportICType==ODM_RTL8723A) + { + if(TH1 ==TH2) + break; + if((TH1+SIR_STEP_SIZE) < TH2) + TH1 += SIR_STEP_SIZE; + else + TH1 = TH2; + } + else + { + if(TH1==(RSSI_BT+0x1E)) + break; + if((TH1+2) < (RSSI_BT+0x1E)) + TH1+=3; + else + TH1 = RSSI_BT+0x1E; + + } + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PSD,DBG_LOUD,("PSD: decision threshold is: %d", TH1)); + + for (i = 0; i< 80; i++) + { + if((s4Byte)(PSD_report[i]) < TH1) + { + byte_idx = i / 8; + bit_idx = i -8*byte_idx; + bitmap = PSD_bitmap[byte_idx]; + PSD_bitmap[byte_idx] = bitmap | (u1Byte) (1 << bit_idx); + } + } + +#if DBG + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PSD, DBG_LOUD,("PSD: before smoothing\n")); + for(n=0;n<10;n++) + { + //DbgPrint("PSD_bitmap[%u]=%x\n", n, PSD_bitmap[n]); + for (i = 0; i<8; i++) + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PSD, DBG_LOUD,("PSD_bitmap[%u] = %d\n", 2402+n*8+i, (PSD_bitmap[n]&BIT(i))>>i)); + } +#endif + + //1 Start of smoothing function + + for (j=0;j<3;j++) + { + start_byte_idx=0; + start_bit_idx=0; + for(n=0; n 7 ) + { + start_byte_idx= start_byte_idx+start_bit_idx/8; + start_bit_idx = start_bit_idx%8; + } + } + + ODM_RT_TRACE( pDM_Odm,ODM_COMP_PSD, DBG_LOUD,("PSD: after %u smoothing", j+1)); + for(n=0;n<10;n++) + { + for (i = 0; i<8; i++) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PSD, DBG_LOUD,("PSD_bitmap[%u] = %d\n", 2402+n*8+i, (PSD_bitmap[n]&BIT(i))>>i)); + + if ( ((PSD_bitmap[n]&BIT(i))>>i) ==1) //----- Add By Gary + { + pRX_HP_Table->PSD_bitmap_RXHP[8*n+i] = 1; + } // ------end by Gary + } + } + + } + + + good_cnt = 0; + for ( i = 0; i < 10; i++) + { + for (n = 0; n < 8; n++) + if((PSD_bitmap[i]& BIT(n)) != 0) + good_cnt++; + } + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PSD, ODM_COMP_PSD,("PSD: good channel cnt = %u",good_cnt)); + } + + //RT_TRACE(ODM_COMP_PSD, DBG_LOUD,("PSD: SSBT=%d, TH2=%d, TH1=%d",SSBT,TH2,TH1)); + for (i = 0; i <10; i++) + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PSD, DBG_LOUD,("PSD: PSD_bitmap[%u]=%x",i,PSD_bitmap[i])); +/* + //Update bitmap memory + for(i = 0; i < 80; i++) + { + byte_idx = i / 8; + bit_idx = i -8*byte_idx; + psd_bit = (PSD_bitmap[byte_idx] & BIT(bit_idx)) >> bit_idx; + bitmap = PSD_bitmap_memory[i]; + PSD_bitmap_memory[i] = (bitmap << 1) |psd_bit; + } +*/ +} + + + +VOID +odm_PSD_Monitor( + IN PVOID pDM_VOID +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + //HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + //PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; + + unsigned int pts, start_point, stop_point; + u1Byte initial_gain ; + static u1Byte PSD_bitmap_memory[80], init_memory = 0; + static u1Byte psd_cnt=0; + static u4Byte PSD_report[80], PSD_report_tmp; + static u8Byte lastTxOkCnt=0, lastRxOkCnt=0; + u1Byte H2C_PSD_DATA[5]={0,0,0,0,0}; + static u1Byte H2C_PSD_DATA_last[5] ={0,0,0,0,0}; + u1Byte idx[20]={96,99,102,106,109,112,115,118,122,125, + 0,3,6,10,13,16,19,22,26,29}; + u1Byte n, i, channel, BBReset,tone_idx; + u1Byte PSD_bitmap[10], SSBT=0,initial_gain_psd=0, RSSI_BT=0, initialGainUpper; + s4Byte PSD_skip_start, PSD_skip_stop; + u4Byte CurrentChannel, RXIQI, RxIdleLowPwr, wlan_channel; + u4Byte ReScan, Interval, Is40MHz; + u8Byte curTxOkCnt, curRxOkCnt; + int cur_byte_idx, cur_bit_idx; + PADAPTER Adapter = pDM_Odm->Adapter; + PMGNT_INFO pMgntInfo = &Adapter->MgntInfo; + + + if(*pDM_Odm->pbDriverIsGoingToPnpSetPowerSleep) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PSD, DBG_LOUD,("pbDriverIsGoingToPnpSetPowerSleep!!!!!!!!!!!!!!!\n")); + return; + } + + + if( (*(pDM_Odm->pbScanInProcess)) || + pDM_Odm->bLinkInProcess) + { + if((pDM_Odm->SupportICType==ODM_RTL8723A)&(pDM_Odm->SupportInterface==ODM_ITRF_PCIE)) + { + ODM_SetTimer( pDM_Odm, &pDM_Odm->PSDTimer, 1500); //ms + //psd_cnt=0; + } + return; + } + + if(pDM_Odm->bBtHsOperation) + { + ReScan = 1; + Interval = SCAN_INTERVAL; + } + else + { + ReScan = PSD_RESCAN; + Interval = SCAN_INTERVAL; + } + + //1 Initialization + if(init_memory == 0) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PSD, DBG_LOUD,("Init memory\n")); + for(i = 0; i < 80; i++) + PSD_bitmap_memory[i] = 0xFF; // channel is always good + init_memory = 1; + } + if(psd_cnt == 0) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PSD, DBG_LOUD,("Enter dm_PSD_Monitor\n")); + for(i = 0; i < 80; i++) + PSD_report[i] = 0; + } + + //1 Backup Current Settings + CurrentChannel = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_CHNLBW, bRFRegOffsetMask); +/* + if(pDM_Odm->SupportICType==ODM_RTL8192D) + { + //2 Record Current synthesizer parameters based on current channel + if((*pDM_Odm->MacPhyMode92D == SINGLEMAC_SINGLEPHY)||(*pDM_Odm->MacPhyMode92D == DUALMAC_SINGLEPHY)) + { + SYN_RF25 = ODM_GetRFReg(Adapter, ODM_RF_PATH_B, 0x25, bMaskDWord); + SYN_RF26 = ODM_GetRFReg(Adapter, ODM_RF_PATH_B, 0x26, bMaskDWord); + SYN_RF27 = ODM_GetRFReg(Adapter, ODM_RF_PATH_B, 0x27, bMaskDWord); + SYN_RF2B = ODM_GetRFReg(Adapter, ODM_RF_PATH_B, 0x2B, bMaskDWord); + SYN_RF2C = ODM_GetRFReg(Adapter, ODM_RF_PATH_B, 0x2C, bMaskDWord); + } + else // DualMAC_DualPHY 2G + { + SYN_RF25 = ODM_GetRFReg(Adapter, ODM_RF_PATH_A, 0x25, bMaskDWord); + SYN_RF26 = ODM_GetRFReg(Adapter, ODM_RF_PATH_A, 0x26, bMaskDWord); + SYN_RF27 = ODM_GetRFReg(Adapter, ODM_RF_PATH_A, 0x27, bMaskDWord); + SYN_RF2B = ODM_GetRFReg(Adapter, ODM_RF_PATH_A, 0x2B, bMaskDWord); + SYN_RF2C = ODM_GetRFReg(Adapter, ODM_RF_PATH_A, 0x2C, bMaskDWord); + } + } +*/ + //RXIQI = PHY_QueryBBReg(Adapter, 0xC14, bMaskDWord); + RXIQI = ODM_GetBBReg(pDM_Odm, 0xC14, bMaskDWord); + + //RxIdleLowPwr = (PHY_QueryBBReg(Adapter, 0x818, bMaskDWord)&BIT28)>>28; + RxIdleLowPwr = (ODM_GetBBReg(pDM_Odm, 0x818, bMaskDWord)&BIT28)>>28; + + //2??? + if(CHNL_RUN_ABOVE_40MHZ(pMgntInfo)) + Is40MHz = TRUE; + else + Is40MHz = FALSE; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_PSD, DBG_LOUD,("PSD Scan Start\n")); + //1 Turn off CCK + //PHY_SetBBReg(Adapter, rFPGA0_RFMOD, BIT24, 0); + ODM_SetBBReg(pDM_Odm, rFPGA0_RFMOD, BIT24, 0); + //1 Turn off TX + //Pause TX Queue + //PlatformEFIOWrite1Byte(Adapter, REG_TXPAUSE, 0xFF); + ODM_Write1Byte(pDM_Odm,REG_TXPAUSE, 0xFF); + + //Force RX to stop TX immediately + //PHY_SetRFReg(Adapter, ODM_RF_PATH_A, RF_AC, bRFRegOffsetMask, 0x32E13); + + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_AC, bRFRegOffsetMask, 0x32E13); + //1 Turn off RX + //Rx AGC off RegC70[0]=0, RegC7C[20]=0 + //PHY_SetBBReg(Adapter, 0xC70, BIT0, 0); + //PHY_SetBBReg(Adapter, 0xC7C, BIT20, 0); + + ODM_SetBBReg(pDM_Odm, 0xC70, BIT0, 0); + ODM_SetBBReg(pDM_Odm, 0xC7C, BIT20, 0); + + + //Turn off CCA + //PHY_SetBBReg(Adapter, 0xC14, bMaskDWord, 0x0); + ODM_SetBBReg(pDM_Odm, 0xC14, bMaskDWord, 0x0); + + //BB Reset + //BBReset = PlatformEFIORead1Byte(Adapter, 0x02); + BBReset = ODM_Read1Byte(pDM_Odm, 0x02); + + //PlatformEFIOWrite1Byte(Adapter, 0x02, BBReset&(~BIT0)); + //PlatformEFIOWrite1Byte(Adapter, 0x02, BBReset|BIT0); + ODM_SetBBReg(pDM_Odm, 0x87C, BIT31, 1); //clock gated to prevent from AGC table mess + ODM_Write1Byte(pDM_Odm, 0x02, BBReset&(~BIT0)); + ODM_Write1Byte(pDM_Odm, 0x02, BBReset|BIT0); + ODM_SetBBReg(pDM_Odm, 0x87C, BIT31, 0); + + //1 Leave RX idle low power + //PHY_SetBBReg(Adapter, 0x818, BIT28, 0x0); + + ODM_SetBBReg(pDM_Odm, 0x818, BIT28, 0x0); + //1 Fix initial gain + //if (IS_HARDWARE_TYPE_8723AE(Adapter)) + //RSSI_BT = pHalData->RSSI_BT; + //else if((IS_HARDWARE_TYPE_8192C(Adapter))||(IS_HARDWARE_TYPE_8192D(Adapter))) // Add by Gary + // RSSI_BT = RSSI_BT_new; + + if((pDM_Odm->SupportICType==ODM_RTL8723A)&(pDM_Odm->SupportInterface==ODM_ITRF_PCIE)) + RSSI_BT=pDM_Odm->RSSI_BT; //need to check C2H to pDM_Odm RSSI BT + + if(RSSI_BT>=47) + RSSI_BT=47; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PSD, DBG_LOUD,("PSD: RSSI_BT= %d\n", RSSI_BT)); + + if(pDM_Odm->SupportICType==ODM_RTL8723A) + { + //Neil add--2011--10--12 + //2 Initial Gain index + if(RSSI_BT >=35) // >= -15dBm + initial_gain_psd = RSSI_BT*2; + else if((RSSI_BT >=33)&(RSSI_BT<35)) + initial_gain_psd = RSSI_BT*2+6; + else if((RSSI_BT >=24)&(RSSI_BT<33)) + initial_gain_psd = 70-(33-RSSI_BT); + else if((RSSI_BT >=19)&(RSSI_BT<24)) + initial_gain_psd = 64-((24-RSSI_BT)*4); + else if((RSSI_BT >=14)&(RSSI_BT<19)) + initial_gain_psd = 44-((18-RSSI_BT)*2); + else if((RSSI_BT >=8)&(RSSI_BT<14)) + initial_gain_psd = 35-(14-RSSI_BT); + else + initial_gain_psd = 0x1B; + } + else + { + + //need to do + initial_gain_psd = pDM_Odm->RSSI_Min; // PSD report based on RSSI + //} + } + //if(RSSI_BT<0x17) + // RSSI_BT +=3; + //DbgPrint("PSD: RSSI_BT= %d\n", RSSI_BT); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PSD, DBG_LOUD,("PSD: RSSI_BT= %d\n", RSSI_BT)); + + //initialGainUpper = 0x5E; //Modify by neil chen + + if(pDM_Odm->bUserAssignLevel) + { + pDM_Odm->bUserAssignLevel = FALSE; + initialGainUpper = 0x7f; + } + else + { + initialGainUpper = 0x5E; + } + + /* + if (initial_gain_psd < 0x1a) + initial_gain_psd = 0x1a; + if (initial_gain_psd > initialGainUpper) + initial_gain_psd = initialGainUpper; + */ + + //if(pDM_Odm->SupportICType==ODM_RTL8723A) + SSBT = RSSI_BT * 2 +0x3E; + + + //if(IS_HARDWARE_TYPE_8723AE(Adapter)) + // SSBT = RSSI_BT * 2 +0x3E; + //else if((IS_HARDWARE_TYPE_8192C(Adapter))||(IS_HARDWARE_TYPE_8192D(Adapter))) // Add by Gary + //{ + // RSSI_BT = initial_gain_psd; + // SSBT = RSSI_BT; + //} + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PSD, DBG_LOUD,("PSD: SSBT= %d\n", SSBT)); + ODM_RT_TRACE( pDM_Odm,ODM_COMP_PSD, DBG_LOUD,("PSD: initial gain= 0x%x\n", initial_gain_psd)); + //DbgPrint("PSD: SSBT= %d", SSBT); + //need to do + pDM_Odm->bDMInitialGainEnable = FALSE; + initial_gain =(u1Byte) (ODM_GetBBReg(pDM_Odm, 0xc50, bMaskDWord) & 0x7F); + + // make sure the initial gain is under the correct range. + //initial_gain_psd &= 0x7f; + ODM_Write_DIG(pDM_Odm, initial_gain_psd); + //1 Turn off 3-wire + ODM_SetBBReg(pDM_Odm, 0x88c, BIT20|BIT21|BIT22|BIT23, 0xF); + + //pts value = 128, 256, 512, 1024 + pts = 128; + + if(pts == 128) + { + ODM_SetBBReg(pDM_Odm, 0x808, BIT14|BIT15, 0x0); + start_point = 64; + stop_point = 192; + } + else if(pts == 256) + { + ODM_SetBBReg(pDM_Odm, 0x808, BIT14|BIT15, 0x1); + start_point = 128; + stop_point = 384; + } + else if(pts == 512) + { + ODM_SetBBReg(pDM_Odm, 0x808, BIT14|BIT15, 0x2); + start_point = 256; + stop_point = 768; + } + else + { + ODM_SetBBReg(pDM_Odm, 0x808, BIT14|BIT15, 0x3); + start_point = 512; + stop_point = 1536; + } + + +//3 Skip WLAN channels if WLAN busy + + curTxOkCnt = *(pDM_Odm->pNumTxBytesUnicast) - lastTxOkCnt; + curRxOkCnt = *(pDM_Odm->pNumRxBytesUnicast) - lastRxOkCnt; + lastTxOkCnt = *(pDM_Odm->pNumTxBytesUnicast); + lastRxOkCnt = *(pDM_Odm->pNumRxBytesUnicast); + + PSD_skip_start=80; + PSD_skip_stop = 0; + wlan_channel = CurrentChannel & 0x0f; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PSD,DBG_LOUD,("PSD: current channel: %x, BW:%d \n", wlan_channel, Is40MHz)); + if(pDM_Odm->SupportICType==ODM_RTL8723A) + { + if(pDM_Odm->bBtHsOperation) + { + if(pDM_Odm->bLinked) + { + if(Is40MHz) + { + PSD_skip_start = ((wlan_channel-1)*5 -Is40MHz*10)-2; // Modify by Neil to add 10 chs to mask + PSD_skip_stop = (PSD_skip_start + (1+Is40MHz)*20)+4; + } + else + { + PSD_skip_start = ((wlan_channel-1)*5 -Is40MHz*10)-10; // Modify by Neil to add 10 chs to mask + PSD_skip_stop = (PSD_skip_start + (1+Is40MHz)*20)+18; + } + } + else + { + // mask for 40MHz + PSD_skip_start = ((wlan_channel-1)*5 -Is40MHz*10)-2; // Modify by Neil to add 10 chs to mask + PSD_skip_stop = (PSD_skip_start + (1+Is40MHz)*20)+4; + } + if(PSD_skip_start < 0) + PSD_skip_start = 0; + if(PSD_skip_stop >80) + PSD_skip_stop = 80; + } + else + { + if((curRxOkCnt+curTxOkCnt) > 5) + { + if(Is40MHz) + { + PSD_skip_start = ((wlan_channel-1)*5 -Is40MHz*10)-2; // Modify by Neil to add 10 chs to mask + PSD_skip_stop = (PSD_skip_start + (1+Is40MHz)*20)+4; + } + else + { + PSD_skip_start = ((wlan_channel-1)*5 -Is40MHz*10)-10; // Modify by Neil to add 10 chs to mask + PSD_skip_stop = (PSD_skip_start + (1+Is40MHz)*20)+18; + } + + if(PSD_skip_start < 0) + PSD_skip_start = 0; + if(PSD_skip_stop >80) + PSD_skip_stop = 80; + } + } + } +#if 0 + else + { + if((curRxOkCnt+curTxOkCnt) > 1000) + { + PSD_skip_start = (wlan_channel-1)*5 -Is40MHz*10; + PSD_skip_stop = PSD_skip_start + (1+Is40MHz)*20; + } + } +#endif //Reove RXHP Issue + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PSD,DBG_LOUD,("PSD: Skip tone from %d to %d \n", PSD_skip_start, PSD_skip_stop)); + + for (n=0;n<80;n++) + { + if((n%20)==0) + { + channel = (n/20)*4 + 1; + + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_CHNLBW, 0x3FF, channel); + } + tone_idx = n%20; + if ((n>=PSD_skip_start) && (n PSD_report[n]) + PSD_report[n] = PSD_report_tmp; + + } + } + + PatchDCTone(pDM_Odm, PSD_report, initial_gain_psd); + + //----end + //1 Turn on RX + //Rx AGC on + ODM_SetBBReg(pDM_Odm, 0xC70, BIT0, 1); + ODM_SetBBReg(pDM_Odm, 0xC7C, BIT20, 1); + //CCK on + ODM_SetBBReg(pDM_Odm, rFPGA0_RFMOD, BIT24, 1); + //1 Turn on TX + //Resume TX Queue + + ODM_Write1Byte(pDM_Odm,REG_TXPAUSE, 0x00); + //Turn on 3-wire + ODM_SetBBReg(pDM_Odm, 0x88c, BIT20|BIT21|BIT22|BIT23, 0x0); + //1 Restore Current Settings + //Resume DIG + pDM_Odm->bDMInitialGainEnable = TRUE; + + ODM_Write_DIG(pDM_Odm, initial_gain); + + // restore originl center frequency + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_CHNLBW, bRFRegOffsetMask, CurrentChannel); + + //Turn on CCA + ODM_SetBBReg(pDM_Odm, 0xC14, bMaskDWord, RXIQI); + //Restore RX idle low power + if(RxIdleLowPwr == TRUE) + ODM_SetBBReg(pDM_Odm, 0x818, BIT28, 1); + + psd_cnt++; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PSD, DBG_LOUD,("PSD:psd_cnt = %d \n",psd_cnt)); + if (psd_cnt < ReScan) + ODM_SetTimer(pDM_Odm, &pDM_Odm->PSDTimer, Interval); + else + { + psd_cnt = 0; + for(i=0;i<80;i++) + //DbgPrint("psd_report[%d]= %d \n", 2402+i, PSD_report[i]); + RT_TRACE( ODM_COMP_PSD, DBG_LOUD,("psd_report[%d]= %d \n", 2402+i, PSD_report[i])); + + + GoodChannelDecision(pDM_Odm, PSD_report, PSD_bitmap,RSSI_BT, PSD_bitmap_memory); + + if(pDM_Odm->SupportICType==ODM_RTL8723A) + { + cur_byte_idx=0; + cur_bit_idx=0; + + //2 Restore H2C PSD Data to Last Data + H2C_PSD_DATA_last[0] = H2C_PSD_DATA[0]; + H2C_PSD_DATA_last[1] = H2C_PSD_DATA[1]; + H2C_PSD_DATA_last[2] = H2C_PSD_DATA[2]; + H2C_PSD_DATA_last[3] = H2C_PSD_DATA[3]; + H2C_PSD_DATA_last[4] = H2C_PSD_DATA[4]; + + + //2 Translate 80bit channel map to 40bit channel + for ( i=0;i<5;i++) + { + for(n=0;n<8;n++) + { + cur_byte_idx = i*2 + n/4; + cur_bit_idx = (n%4)*2; + if ( ((PSD_bitmap[cur_byte_idx]& BIT(cur_bit_idx)) != 0) && ((PSD_bitmap[cur_byte_idx]& BIT(cur_bit_idx+1)) != 0)) + H2C_PSD_DATA[i] = H2C_PSD_DATA[i] | (u1Byte) (1 << n); + } + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PSD, DBG_LOUD,("H2C_PSD_DATA[%d]=0x%x\n" ,i, H2C_PSD_DATA[i])); + } + + //3 To Compare the difference + for ( i=0;i<5;i++) + { + if(H2C_PSD_DATA[i] !=H2C_PSD_DATA_last[i]) + { + FW_FillH2CCmd(Adapter, H2C_92C_PSD_RESULT, 5, H2C_PSD_DATA); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_PSD, DBG_LOUD,("Need to Update the AFH Map \n")); + break; + } + else + { + if(i==5) + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PSD, DBG_LOUD,("Not need to Update\n")); + } + } + if(pDM_Odm->bBtHsOperation) + { + ODM_SetTimer(pDM_Odm, &pDM_Odm->PSDTimer, 10000); + ODM_RT_TRACE( pDM_Odm,ODM_COMP_PSD, DBG_LOUD,("Leave dm_PSD_Monitor\n")); + } + else + { + ODM_SetTimer(pDM_Odm, &pDM_Odm->PSDTimer, 1500); + ODM_RT_TRACE( pDM_Odm,ODM_COMP_PSD, DBG_LOUD,("Leave dm_PSD_Monitor\n")); + } + } + } +} +/* +//Neil for Get BT RSSI +// Be Triggered by BT C2H CMD +VOID +ODM_PSDGetRSSI( + IN u1Byte RSSI_BT) +{ + + +} + +*/ + +VOID +ODM_PSDMonitor( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + //HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + + //if(IS_HARDWARE_TYPE_8723AE(Adapter)) + + if(pDM_Odm->SupportICType == ODM_RTL8723A) //may need to add other IC type + { + if(pDM_Odm->SupportInterface==ODM_ITRF_PCIE) + { + if(!pDM_Odm->bBtEnabled) //need to check upper layer connection + { + pDM_Odm->bPSDactive=FALSE; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PSD, DBG_LOUD, ("odm_PSDMonitor, return for BT is disabled!!!\n")); + return; + } + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PSD, DBG_LOUD, ("odm_PSDMonitor\n")); + //{ + pDM_Odm->bPSDinProcess = TRUE; + pDM_Odm->bPSDactive=TRUE; + odm_PSD_Monitor(pDM_Odm); + pDM_Odm->bPSDinProcess = FALSE; + } + } + +} +VOID +odm_PSDMonitorCallback( + PRT_TIMER pTimer +) +{ + PADAPTER Adapter = (PADAPTER)pTimer->Adapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + + PlatformScheduleWorkItem(&pHalData->PSDMonitorWorkitem); +} + +VOID +odm_PSDMonitorWorkItemCallback( + IN PVOID pContext + ) +{ + PADAPTER Adapter = (PADAPTER)pContext; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; + + ODM_PSDMonitor(pDM_Odm); +} + + + //cosa debug tool need to modify + +VOID +ODM_PSDDbgControl( + IN PADAPTER Adapter, + IN u4Byte mode, + IN u4Byte btRssi + ) +{ +#if (DEV_BUS_TYPE == RT_PCI_INTERFACE) + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PSD, DBG_LOUD, (" Monitor mode=%d, btRssi=%d\n", mode, btRssi)); + if(mode) + { + pDM_Odm->RSSI_BT = (u1Byte)btRssi; + pDM_Odm->bUserAssignLevel = TRUE; + ODM_SetTimer( pDM_Odm, &pDM_Odm->PSDTimer, 0); //ms + } + else + { + ODM_CancelTimer(pDM_Odm, &pDM_Odm->PSDTimer); + } +#endif +} + + +//#if(DEV_BUS_TYPE == RT_PCI_INTERFACE)|(DEV_BUS_TYPE == RT_USB_INTERFACE) + +void odm_RXHPInit( + IN PVOID pDM_VOID) +{ +#if (DEV_BUS_TYPE == RT_PCI_INTERFACE)|(DEV_BUS_TYPE == RT_USB_INTERFACE) + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pRXHP_T pRX_HP_Table = &pDM_Odm->DM_RXHP_Table; + u1Byte index; + + pRX_HP_Table->RXHP_enable = TRUE; + pRX_HP_Table->RXHP_flag = 0; + pRX_HP_Table->PSD_func_trigger = 0; + pRX_HP_Table->Pre_IGI = 0x20; + pRX_HP_Table->Cur_IGI = 0x20; + pRX_HP_Table->Cur_pw_th = pw_th_10dB; + pRX_HP_Table->Pre_pw_th = pw_th_10dB; + for(index=0; index<80; index++) + pRX_HP_Table->PSD_bitmap_RXHP[index] = 1; + +#if(DEV_BUS_TYPE == RT_USB_INTERFACE) + pRX_HP_Table->TP_Mode = Idle_Mode; +#endif +#endif +} + +VOID +odm_PSD_RXHP( + IN PVOID pDM_VOID +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pRXHP_T pRX_HP_Table = &pDM_Odm->DM_RXHP_Table; + PADAPTER Adapter = pDM_Odm->Adapter; + PMGNT_INFO pMgntInfo = &(Adapter->MgntInfo); + unsigned int pts, start_point, stop_point, initial_gain ; + static u1Byte PSD_bitmap_memory[80], init_memory = 0; + static u1Byte psd_cnt=0; + static u4Byte PSD_report[80], PSD_report_tmp; + static u8Byte lastTxOkCnt=0, lastRxOkCnt=0; + u1Byte idx[20]={96,99,102,106,109,112,115,118,122,125, + 0,3,6,10,13,16,19,22,26,29}; + u1Byte n, i, channel, BBReset,tone_idx; + u1Byte PSD_bitmap[10]/*, SSBT=0*/,initial_gain_psd=0, RSSI_BT=0, initialGainUpper; + s4Byte PSD_skip_start, PSD_skip_stop; + u4Byte CurrentChannel, RXIQI, RxIdleLowPwr, wlan_channel; + u4Byte ReScan, Interval, Is40MHz; + u8Byte curTxOkCnt, curRxOkCnt; + //--------------2G band synthesizer for 92D switch RF channel using----------------- + u1Byte group_idx=0; + u4Byte SYN_RF25=0, SYN_RF26=0, SYN_RF27=0, SYN_RF2B=0, SYN_RF2C=0; + u4Byte SYN[5] = {0x25, 0x26, 0x27, 0x2B, 0x2C}; // synthesizer RF register for 2G channel + u4Byte SYN_group[3][5] = {{0x643BC, 0xFC038, 0x77C1A, 0x41289, 0x01840}, // For CH1,2,4,9,10.11.12 {0x643BC, 0xFC038, 0x77C1A, 0x41289, 0x01840} + {0x643BC, 0xFC038, 0x07C1A, 0x41289, 0x01840}, // For CH3,13,14 + {0x243BC, 0xFC438, 0x07C1A, 0x4128B, 0x0FC41}}; // For Ch5,6,7,8 + //--------------------- Add by Gary for Debug setting ---------------------- + u1Byte RSSI_BT_new = (u1Byte) ODM_GetBBReg(pDM_Odm, 0xB9C, 0xFF); + u1Byte rssi_ctrl = (u1Byte) ODM_GetBBReg(pDM_Odm, 0xB38, 0xFF); + //--------------------------------------------------------------------- + + if(pMgntInfo->bScanInProgress) + { + return; + } + + ReScan = PSD_RESCAN; + Interval = SCAN_INTERVAL; + + + //1 Initialization + if(init_memory == 0) + { + RT_TRACE( ODM_COMP_PSD, DBG_LOUD,("Init memory\n")); + for(i = 0; i < 80; i++) + PSD_bitmap_memory[i] = 0xFF; // channel is always good + init_memory = 1; + } + if(psd_cnt == 0) + { + RT_TRACE(ODM_COMP_PSD, DBG_LOUD,("Enter dm_PSD_Monitor\n")); + for(i = 0; i < 80; i++) + PSD_report[i] = 0; + } + + //1 Backup Current Settings + CurrentChannel = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_CHNLBW, bRFRegOffsetMask); + if(pDM_Odm->SupportICType == ODM_RTL8192D) + { + //2 Record Current synthesizer parameters based on current channel + if((*(pDM_Odm->pMacPhyMode)==ODM_SMSP)||(*(pDM_Odm->pMacPhyMode)==ODM_DMSP)) + { + SYN_RF25 = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x25, bMaskDWord); + SYN_RF26 = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x26, bMaskDWord); + SYN_RF27 = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x27, bMaskDWord); + SYN_RF2B = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x2B, bMaskDWord); + SYN_RF2C = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x2C, bMaskDWord); + } + else // DualMAC_DualPHY 2G + { + SYN_RF25 = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x25, bMaskDWord); + SYN_RF26 = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x26, bMaskDWord); + SYN_RF27 = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x27, bMaskDWord); + SYN_RF2B = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x2B, bMaskDWord); + SYN_RF2C = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x2C, bMaskDWord); + } + } + RXIQI = ODM_GetBBReg(pDM_Odm, 0xC14, bMaskDWord); + RxIdleLowPwr = (ODM_GetBBReg(pDM_Odm, 0x818, bMaskDWord)&BIT28)>>28; + Is40MHz = *(pDM_Odm->pBandWidth); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_PSD, DBG_LOUD,("PSD Scan Start\n")); + //1 Turn off CCK + ODM_SetBBReg(pDM_Odm, rFPGA0_RFMOD, BIT24, 0); + //1 Turn off TX + //Pause TX Queue + ODM_Write1Byte(pDM_Odm, REG_TXPAUSE, 0xFF); + //Force RX to stop TX immediately + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_AC, bRFRegOffsetMask, 0x32E13); + //1 Turn off RX + //Rx AGC off RegC70[0]=0, RegC7C[20]=0 + ODM_SetBBReg(pDM_Odm, 0xC70, BIT0, 0); + ODM_SetBBReg(pDM_Odm, 0xC7C, BIT20, 0); + //Turn off CCA + ODM_SetBBReg(pDM_Odm, 0xC14, bMaskDWord, 0x0); + //BB Reset + ODM_SetBBReg(pDM_Odm, 0x87C, BIT31, 1); //clock gated to prevent from AGC table mess + BBReset = ODM_Read1Byte(pDM_Odm, 0x02); + ODM_Write1Byte(pDM_Odm, 0x02, BBReset&(~BIT0)); + ODM_Write1Byte(pDM_Odm, 0x02, BBReset|BIT0); + ODM_SetBBReg(pDM_Odm, 0x87C, BIT31, 0); + //1 Leave RX idle low power + ODM_SetBBReg(pDM_Odm, 0x818, BIT28, 0x0); + //1 Fix initial gain + RSSI_BT = RSSI_BT_new; + RT_TRACE(ODM_COMP_PSD, DBG_LOUD,("PSD: RSSI_BT= %d\n", RSSI_BT)); + + if(rssi_ctrl == 1) // just for debug!! + initial_gain_psd = RSSI_BT_new; + else + initial_gain_psd = pDM_Odm->RSSI_Min; // PSD report based on RSSI + + RT_TRACE(ODM_COMP_PSD, DBG_LOUD,("PSD: RSSI_BT= %d\n", RSSI_BT)); + + initialGainUpper = 0x54; + + RSSI_BT = initial_gain_psd; + //SSBT = RSSI_BT; + + //RT_TRACE( ODM_COMP_PSD, DBG_LOUD,("PSD: SSBT= %d\n", SSBT)); + RT_TRACE( ODM_COMP_PSD, DBG_LOUD,("PSD: initial gain= 0x%x\n", initial_gain_psd)); + + pDM_Odm->bDMInitialGainEnable = FALSE; + initial_gain = ODM_GetBBReg(pDM_Odm, 0xc50, bMaskDWord) & 0x7F; + //ODM_SetBBReg(pDM_Odm, 0xc50, 0x7F, initial_gain_psd); + ODM_Write_DIG(pDM_Odm, initial_gain_psd); + //1 Turn off 3-wire + ODM_SetBBReg(pDM_Odm, 0x88c, BIT20|BIT21|BIT22|BIT23, 0xF); + + //pts value = 128, 256, 512, 1024 + pts = 128; + + if(pts == 128) + { + ODM_SetBBReg(pDM_Odm, 0x808, BIT14|BIT15, 0x0); + start_point = 64; + stop_point = 192; + } + else if(pts == 256) + { + ODM_SetBBReg(pDM_Odm, 0x808, BIT14|BIT15, 0x1); + start_point = 128; + stop_point = 384; + } + else if(pts == 512) + { + ODM_SetBBReg(pDM_Odm, 0x808, BIT14|BIT15, 0x2); + start_point = 256; + stop_point = 768; + } + else + { + ODM_SetBBReg(pDM_Odm, 0x808, BIT14|BIT15, 0x3); + start_point = 512; + stop_point = 1536; + } + + +//3 Skip WLAN channels if WLAN busy + curTxOkCnt = *(pDM_Odm->pNumTxBytesUnicast) - lastTxOkCnt; + curRxOkCnt = *(pDM_Odm->pNumRxBytesUnicast) - lastRxOkCnt; + lastTxOkCnt = *(pDM_Odm->pNumTxBytesUnicast); + lastRxOkCnt = *(pDM_Odm->pNumRxBytesUnicast); + + PSD_skip_start=80; + PSD_skip_stop = 0; + wlan_channel = CurrentChannel & 0x0f; + + RT_TRACE(ODM_COMP_PSD,DBG_LOUD,("PSD: current channel: %x, BW:%d \n", wlan_channel, Is40MHz)); + + if((curRxOkCnt+curTxOkCnt) > 1000) + { + PSD_skip_start = (wlan_channel-1)*5 -Is40MHz*10; + PSD_skip_stop = PSD_skip_start + (1+Is40MHz)*20; + } + + RT_TRACE(ODM_COMP_PSD,DBG_LOUD,("PSD: Skip tone from %d to %d \n", PSD_skip_start, PSD_skip_stop)); + + for (n=0;n<80;n++) + { + if((n%20)==0) + { + channel = (n/20)*4 + 1; + if(pDM_Odm->SupportICType == ODM_RTL8192D) + { + switch(channel) + { + case 1: + case 9: + group_idx = 0; + break; + case 5: + group_idx = 2; + break; + case 13: + group_idx = 1; + break; + } + if((*(pDM_Odm->pMacPhyMode)==ODM_SMSP)||(*(pDM_Odm->pMacPhyMode)==ODM_DMSP)) + { + for(i = 0; i < SYN_Length; i++) + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, SYN[i], bMaskDWord, SYN_group[group_idx][i]); + + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_CHNLBW, 0x3FF, channel); + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, RF_CHNLBW, 0x3FF, channel); + } + else // DualMAC_DualPHY 2G + { + for(i = 0; i < SYN_Length; i++) + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, SYN[i], bMaskDWord, SYN_group[group_idx][i]); + + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_CHNLBW, 0x3FF, channel); + } + } + else + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_CHNLBW, 0x3FF, channel); + } + tone_idx = n%20; + if ((n>=PSD_skip_start) && (n PSD_report[n]) + PSD_report[n] = PSD_report_tmp; + + } + } + + PatchDCTone(pDM_Odm, PSD_report, initial_gain_psd); + + //----end + //1 Turn on RX + //Rx AGC on + ODM_SetBBReg(pDM_Odm, 0xC70, BIT0, 1); + ODM_SetBBReg(pDM_Odm, 0xC7C, BIT20, 1); + //CCK on + ODM_SetBBReg(pDM_Odm, rFPGA0_RFMOD, BIT24, 1); + //1 Turn on TX + //Resume TX Queue + ODM_Write1Byte(pDM_Odm, REG_TXPAUSE, 0x00); + //Turn on 3-wire + ODM_SetBBReg(pDM_Odm, 0x88c, BIT20|BIT21|BIT22|BIT23, 0x0); + //1 Restore Current Settings + //Resume DIG + pDM_Odm->bDMInitialGainEnable= TRUE; + //ODM_SetBBReg(pDM_Odm, 0xc50, 0x7F, initial_gain); + ODM_Write_DIG(pDM_Odm,(u1Byte) initial_gain); + // restore originl center frequency + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_CHNLBW, bRFRegOffsetMask, CurrentChannel); + if(pDM_Odm->SupportICType == ODM_RTL8192D) + { + if((*(pDM_Odm->pMacPhyMode)==ODM_SMSP)||(*(pDM_Odm->pMacPhyMode)==ODM_DMSP)) + { + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, RF_CHNLBW, bMaskDWord, CurrentChannel); + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x25, bMaskDWord, SYN_RF25); + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x26, bMaskDWord, SYN_RF26); + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x27, bMaskDWord, SYN_RF27); + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x2B, bMaskDWord, SYN_RF2B); + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x2C, bMaskDWord, SYN_RF2C); + } + else // DualMAC_DualPHY + { + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x25, bMaskDWord, SYN_RF25); + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x26, bMaskDWord, SYN_RF26); + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x27, bMaskDWord, SYN_RF27); + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x2B, bMaskDWord, SYN_RF2B); + ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x2C, bMaskDWord, SYN_RF2C); + } + } + //Turn on CCA + ODM_SetBBReg(pDM_Odm, 0xC14, bMaskDWord, RXIQI); + //Restore RX idle low power + if(RxIdleLowPwr == TRUE) + ODM_SetBBReg(pDM_Odm, 0x818, BIT28, 1); + + psd_cnt++; + //gPrint("psd cnt=%d\n", psd_cnt); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_PSD, DBG_LOUD,("PSD:psd_cnt = %d \n",psd_cnt)); + if (psd_cnt < ReScan) + { + ODM_SetTimer(pDM_Odm, &pRX_HP_Table->PSDTimer, Interval); //ms + } + else + { + psd_cnt = 0; + for(i=0;i<80;i++) + RT_TRACE( ODM_COMP_PSD, DBG_LOUD,("psd_report[%d]= %d \n", 2402+i, PSD_report[i])); + //DbgPrint("psd_report[%d]= %d \n", 2402+i, PSD_report[i]); + + GoodChannelDecision(pDM_Odm, PSD_report, PSD_bitmap,RSSI_BT, PSD_bitmap_memory); + + } +} + +void odm_Write_RXHP( + IN PVOID pDM_VOID) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pRXHP_T pRX_HP_Table = &pDM_Odm->DM_RXHP_Table; + u4Byte currentIGI; + + if(pRX_HP_Table->Cur_IGI != pRX_HP_Table->Pre_IGI) + { + ODM_SetBBReg(pDM_Odm, rOFDM0_XAAGCCore1, bMaskByte0, pRX_HP_Table->Cur_IGI); + ODM_SetBBReg(pDM_Odm, rOFDM0_XBAGCCore1, bMaskByte0, pRX_HP_Table->Cur_IGI); + } + + if(pRX_HP_Table->Cur_pw_th != pRX_HP_Table->Pre_pw_th) +{ + ODM_SetBBReg(pDM_Odm, rOFDM0_XAAGCCore2, BIT8|BIT9, pRX_HP_Table->Cur_pw_th); // RegC54[9:8]=2'b11: AGC Flow 3 + } + + if(pRX_HP_Table->RXHP_flag == 0) + { + pRX_HP_Table->Cur_IGI = 0x20; + } + else + { + currentIGI = ODM_GetBBReg(pDM_Odm, rOFDM0_XAAGCCore1, bMaskByte0); + if(currentIGI<0x50) + { + ODM_SetBBReg(pDM_Odm, rOFDM0_XAAGCCore1, bMaskByte0, pRX_HP_Table->Cur_IGI); + ODM_SetBBReg(pDM_Odm, rOFDM0_XBAGCCore1, bMaskByte0, pRX_HP_Table->Cur_IGI); + } + } + pRX_HP_Table->Pre_IGI = pRX_HP_Table->Cur_IGI; + pRX_HP_Table->Pre_pw_th = pRX_HP_Table->Cur_pw_th; + +} + + +void odm_RXHP( + IN PVOID pDM_VOID) +{ +#if( DM_ODM_SUPPORT_TYPE & (ODM_WIN)) +#if (DEV_BUS_TYPE == RT_PCI_INTERFACE) | (DEV_BUS_TYPE == RT_USB_INTERFACE) + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PADAPTER Adapter = pDM_Odm->Adapter; + PMGNT_INFO pMgntInfo = &(Adapter->MgntInfo); + pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable; + pRXHP_T pRX_HP_Table = &pDM_Odm->DM_RXHP_Table; + PFALSE_ALARM_STATISTICS FalseAlmCnt = (PFALSE_ALARM_STATISTICS)PhyDM_Get_Structure( pDM_Odm , PHYDM_FALSEALMCNT); + + u1Byte i, j, sum; + u1Byte Is40MHz; + s1Byte Intf_diff_idx, MIN_Intf_diff_idx = 16; + s4Byte cur_channel; + u1Byte ch_map_intf_5M[17] = {0}; + static u4Byte FA_TH = 0; + static u1Byte psd_intf_flag = 0; + static s4Byte curRssi = 0; + static s4Byte preRssi = 0; + static u1Byte PSDTriggerCnt = 1; + + u1Byte RX_HP_enable = (u1Byte)(ODM_GetBBReg(pDM_Odm, rOFDM0_XAAGCCore2, bMaskDWord)>>31); // for debug!! + +#if(DEV_BUS_TYPE == RT_USB_INTERFACE) + static s8Byte lastTxOkCnt = 0, lastRxOkCnt = 0; + s8Byte curTxOkCnt, curRxOkCnt; + s8Byte curTPOkCnt; + s8Byte TP_Acc3, TP_Acc5; + static s8Byte TP_Buff[5] = {0}; + static u1Byte pre_state = 0, pre_state_flag = 0; + static u1Byte Intf_HighTP_flag = 0, De_counter = 16; + static u1Byte TP_Degrade_flag = 0; +#endif + static u1Byte LatchCnt = 0; + + if(pDM_Odm->SupportICType & (ODM_RTL8723A|ODM_RTL8188E)) + return; + //AGC RX High Power Mode is only applied on 2G band in 92D!!! + if(pDM_Odm->SupportICType == ODM_RTL8192D) + { + if(*(pDM_Odm->pBandType) != ODM_BAND_2_4G) + return; + } + + if(!(pDM_Odm->SupportAbility & ODM_BB_RXHP)) + return; + + + //RX HP ON/OFF + if(RX_HP_enable == 1) + pRX_HP_Table->RXHP_enable = FALSE; + else + pRX_HP_Table->RXHP_enable = TRUE; + + if(pRX_HP_Table->RXHP_enable == FALSE) + { + if(pRX_HP_Table->RXHP_flag == 1) + { + pRX_HP_Table->RXHP_flag = 0; + psd_intf_flag = 0; + } + return; + } + +#if(DEV_BUS_TYPE == RT_USB_INTERFACE) + //2 Record current TP for USB interface + curTxOkCnt = *(pDM_Odm->pNumTxBytesUnicast)-lastTxOkCnt; + curRxOkCnt = *(pDM_Odm->pNumRxBytesUnicast)-lastRxOkCnt; + lastTxOkCnt = *(pDM_Odm->pNumTxBytesUnicast); + lastRxOkCnt = *(pDM_Odm->pNumRxBytesUnicast); + + curTPOkCnt = curTxOkCnt+curRxOkCnt; + TP_Buff[0] = curTPOkCnt; // current TP + TP_Acc3 = PlatformDivision64((TP_Buff[1]+TP_Buff[2]+TP_Buff[3]), 3); + TP_Acc5 = PlatformDivision64((TP_Buff[0]+TP_Buff[1]+TP_Buff[2]+TP_Buff[3]+TP_Buff[4]), 5); + + if(TP_Acc5 < 1000) + pRX_HP_Table->TP_Mode = Idle_Mode; + else if((1000 < TP_Acc5)&&(TP_Acc5 < 3750000)) + pRX_HP_Table->TP_Mode = Low_TP_Mode; + else + pRX_HP_Table->TP_Mode = High_TP_Mode; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RX HP TP Mode = %d\n", pRX_HP_Table->TP_Mode)); + // Since TP result would be sampled every 2 sec, it needs to delay 4sec to wait PSD processing. + // When LatchCnt = 0, we would Get PSD result. + if(TP_Degrade_flag == 1) + { + LatchCnt--; + if(LatchCnt == 0) + { + TP_Degrade_flag = 0; + } + } + // When PSD function triggered by TP degrade 20%, and Interference Flag = 1 + // Set a De_counter to wait IGI = upper bound. If time is UP, the Interference flag will be pull down. + if(Intf_HighTP_flag == 1) + { + De_counter--; + if(De_counter == 0) + { + Intf_HighTP_flag = 0; + psd_intf_flag = 0; + } + } +#endif + + //2 AGC RX High Power Mode by PSD only applied to STA Mode + //3 NOT applied 1. Ad Hoc Mode. + //3 NOT applied 2. AP Mode + if ((pMgntInfo->mAssoc) && (!pMgntInfo->mIbss) && (!ACTING_AS_AP(Adapter))) + { + Is40MHz = *(pDM_Odm->pBandWidth); + curRssi = pDM_Odm->RSSI_Min; + cur_channel = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_CHNLBW, 0x0fff) & 0x0f; + ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RXHP RX HP flag = %d\n", pRX_HP_Table->RXHP_flag)); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RXHP FA = %d\n", FalseAlmCnt->Cnt_all)); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RXHP cur RSSI = %d, pre RSSI=%d\n", curRssi, preRssi)); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RXHP current CH = %d\n", cur_channel)); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RXHP Is 40MHz = %d\n", Is40MHz)); + //2 PSD function would be triggered + //3 1. Every 4 sec for PCIE + //3 2. Before TP Mode (Idle TP<4kbps) for USB + //3 3. After TP Mode (High TP) for USB + if((curRssi > 68) && (pRX_HP_Table->RXHP_flag == 0)) // Only RSSI>TH and RX_HP_flag=0 will Do PSD process + { +#if (DEV_BUS_TYPE == RT_USB_INTERFACE) + //2 Before TP Mode ==> PSD would be trigger every 4 sec + if(pRX_HP_Table->TP_Mode == Idle_Mode) //2.1 less wlan traffic <4kbps + { +#endif + if(PSDTriggerCnt == 1) + { + odm_PSD_RXHP(pDM_Odm); + pRX_HP_Table->PSD_func_trigger = 1; + PSDTriggerCnt = 0; + } + else + { + PSDTriggerCnt++; + } +#if(DEV_BUS_TYPE == RT_USB_INTERFACE) + } + //2 After TP Mode ==> Check if TP degrade larger than 20% would trigger PSD function + if(pRX_HP_Table->TP_Mode == High_TP_Mode) + { + if((pre_state_flag == 0)&&(LatchCnt == 0)) + { + // TP var < 5% + if((((curTPOkCnt-TP_Acc3)*20)<(TP_Acc3))&&(((curTPOkCnt-TP_Acc3)*20)>(-TP_Acc3))) + { + pre_state++; + if(pre_state == 3) // hit pre_state condition => consecutive 3 times + { + pre_state_flag = 1; + pre_state = 0; + } + + } + else + { + pre_state = 0; + } + } + //3 If pre_state_flag=1 ==> start to monitor TP degrade 20% + if(pre_state_flag == 1) + { + if(((TP_Acc3-curTPOkCnt)*5)>(TP_Acc3)) // degrade 20% + { + odm_PSD_RXHP(pDM_Odm); + pRX_HP_Table->PSD_func_trigger = 1; + TP_Degrade_flag = 1; + LatchCnt = 2; + pre_state_flag = 0; + } + else if(((TP_Buff[2]-curTPOkCnt)*5)>TP_Buff[2]) + { + odm_PSD_RXHP(pDM_Odm); + pRX_HP_Table->PSD_func_trigger = 1; + TP_Degrade_flag = 1; + LatchCnt = 2; + pre_state_flag = 0; + } + else if(((TP_Buff[3]-curTPOkCnt)*5)>TP_Buff[3]) + { + odm_PSD_RXHP(pDM_Odm); + pRX_HP_Table->PSD_func_trigger = 1; + TP_Degrade_flag = 1; + LatchCnt = 2; + pre_state_flag = 0; + } + } + } +#endif +} + +#if (DEV_BUS_TYPE == RT_USB_INTERFACE) + for (i=0;i<4;i++) + { + TP_Buff[4-i] = TP_Buff[3-i]; + } +#endif + //2 Update PSD bitmap according to PSD report + if((pRX_HP_Table->PSD_func_trigger == 1)&&(LatchCnt == 0)) + { + //2 Separate 80M bandwidth into 16 group with smaller 5M BW. + for (i = 0 ; i < 16 ; i++) + { + sum = 0; + for(j = 0; j < 5 ; j++) + sum += pRX_HP_Table->PSD_bitmap_RXHP[5*i + j]; + + if(sum < 5) + { + ch_map_intf_5M[i] = 1; // interference flag + } + } + //=============just for debug========================= + //for(i=0;i<16;i++) + //DbgPrint("RX HP: ch_map_intf_5M[%d] = %d\n", i, ch_map_intf_5M[i]); + //=============================================== + //2 Mask target channel 5M index + for(i = 0; i < (4+4*Is40MHz) ; i++) + { + ch_map_intf_5M[cur_channel - (1+2*Is40MHz) + i] = 0; + } + + psd_intf_flag = 0; + for(i = 0; i < 16; i++) + { + if(ch_map_intf_5M[i] == 1) + { + psd_intf_flag = 1; // interference is detected!!! + break; + } + } + +#if (DEV_BUS_TYPE == RT_USB_INTERFACE) + if(pRX_HP_Table->TP_Mode!=Idle_Mode) + { + if(psd_intf_flag == 1) // to avoid psd_intf_flag always 1 + { + Intf_HighTP_flag = 1; + De_counter = 32; // 0x1E -> 0x3E needs 32 times by each IGI step =1 + } + } +#endif + ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RX HP psd_intf_flag = %d\n", psd_intf_flag)); + //2 Distance between target channel and interference + for(i = 0; i < 16; i++) + { + if(ch_map_intf_5M[i] == 1) + { + Intf_diff_idx = ((cur_channel+Is40MHz-(i+1))>0) ? (s1Byte)(cur_channel-2*Is40MHz-(i-2)) : (s1Byte)((i+1)-(cur_channel+2*Is40MHz)); + if(Intf_diff_idx < MIN_Intf_diff_idx) + MIN_Intf_diff_idx = Intf_diff_idx; // the min difference index between interference and target + } + } + ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RX HP MIN_Intf_diff_idx = %d\n", MIN_Intf_diff_idx)); + //2 Choose False Alarm Threshold + switch (MIN_Intf_diff_idx){ + case 0: + case 1: + case 2: + case 3: + FA_TH = FA_RXHP_TH1; + break; + case 4: // CH5 + case 5: // CH6 + FA_TH = FA_RXHP_TH2; + break; + case 6: // CH7 + case 7: // CH8 + FA_TH = FA_RXHP_TH3; + break; + case 8: // CH9 + case 9: //CH10 + FA_TH = FA_RXHP_TH4; + break; + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + FA_TH = FA_RXHP_TH5; + break; + } + ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RX HP FA_TH = %d\n", FA_TH)); + pRX_HP_Table->PSD_func_trigger = 0; + } + //1 Monitor RSSI variation to choose the suitable IGI or Exit AGC RX High Power Mode + if(pRX_HP_Table->RXHP_flag == 1) + { + if ((curRssi > 80)&&(preRssi < 80)) + { + pRX_HP_Table->Cur_IGI = LNA_Low_Gain_1; + } + else if ((curRssi < 80)&&(preRssi > 80)) + { + pRX_HP_Table->Cur_IGI = LNA_Low_Gain_2; + } + else if ((curRssi > 72)&&(preRssi < 72)) + { + pRX_HP_Table->Cur_IGI = LNA_Low_Gain_2; + } + else if ((curRssi < 72)&&( preRssi > 72)) + { + pRX_HP_Table->Cur_IGI = LNA_Low_Gain_3; + } + else if (curRssi < 68) //RSSI is NOT large enough!!==> Exit AGC RX High Power Mode + { + pRX_HP_Table->Cur_pw_th = pw_th_10dB; + pRX_HP_Table->RXHP_flag = 0; // Back to Normal DIG Mode + psd_intf_flag = 0; + } + } + else // pRX_HP_Table->RXHP_flag == 0 + { + //1 Decide whether to enter AGC RX High Power Mode + if ((curRssi > 70) && (psd_intf_flag == 1) && (FalseAlmCnt->Cnt_all > FA_TH) && + (pDM_DigTable->CurIGValue == pDM_DigTable->rx_gain_range_max)) + { + if (curRssi > 80) + { + pRX_HP_Table->Cur_IGI = LNA_Low_Gain_1; + } + else if (curRssi > 72) + { + pRX_HP_Table->Cur_IGI = LNA_Low_Gain_2; + } + else + { + pRX_HP_Table->Cur_IGI = LNA_Low_Gain_3; + } + pRX_HP_Table->Cur_pw_th = pw_th_16dB; //RegC54[9:8]=2'b11: to enter AGC Flow 3 + pRX_HP_Table->First_time_enter = TRUE; + pRX_HP_Table->RXHP_flag = 1; // RXHP_flag=1: AGC RX High Power Mode, RXHP_flag=0: Normal DIG Mode + } + } + preRssi = curRssi; + odm_Write_RXHP(pDM_Odm); + } +#endif //#if( DM_ODM_SUPPORT_TYPE & (ODM_WIN)) +#endif //#if (DEV_BUS_TYPE == RT_PCI_INTERFACE) | (DEV_BUS_TYPE == RT_USB_INTERFACE) +} + + +VOID +odm_PSD_RXHPCallback( + PRT_TIMER pTimer +) +{ + PADAPTER Adapter = (PADAPTER)pTimer->Adapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; + pRXHP_T pRX_HP_Table = &pDM_Odm->DM_RXHP_Table; + +#if DEV_BUS_TYPE==RT_PCI_INTERFACE + #if USE_WORKITEM + ODM_ScheduleWorkItem(&pRX_HP_Table->PSDTimeWorkitem); + #else + odm_PSD_RXHP(pDM_Odm); + #endif +#else + ODM_ScheduleWorkItem(&pRX_HP_Table->PSDTimeWorkitem); +#endif + + } + +VOID +odm_PSD_RXHPWorkitemCallback( + IN PVOID pContext + ) +{ + PADAPTER pAdapter = (PADAPTER)pContext; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); + PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; + + odm_PSD_RXHP(pDM_Odm); +} + +#endif //#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + + + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_RXHP.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_RXHP.h new file mode 100644 index 00000000000000..ef07bba0119f4c --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_RXHP.h @@ -0,0 +1,105 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ +#ifndef __PHYDMRXHP_H__ +#define __PHYDMRXHP_H__ + +#define RXHP_VERSION "1.0" + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + +#define AFH_PSD 1 //0:normal PSD scan, 1: only do 20 pts PSD +#define MODE_40M 0 //0:20M, 1:40M +#define PSD_TH2 3 +#define PSD_CHMIN 20 // Minimum channel number for BT AFH +#define SIR_STEP_SIZE 3 +#define Smooth_Size_1 5 +#define Smooth_TH_1 3 +#define Smooth_Size_2 10 +#define Smooth_TH_2 4 +#define Smooth_Size_3 20 +#define Smooth_TH_3 4 +#define Smooth_Step_Size 5 +#define Adaptive_SIR 1 +#define PSD_RESCAN 4 +#define PSD_SCAN_INTERVAL 700 //ms + +typedef struct _RX_High_Power_ +{ + u1Byte RXHP_flag; + u1Byte PSD_func_trigger; + u1Byte PSD_bitmap_RXHP[80]; + u1Byte Pre_IGI; + u1Byte Cur_IGI; + u1Byte Pre_pw_th; + u1Byte Cur_pw_th; + BOOLEAN First_time_enter; + BOOLEAN RXHP_enable; + u1Byte TP_Mode; + RT_TIMER PSDTimer; + #if USE_WORKITEM + RT_WORK_ITEM PSDTimeWorkitem; + #endif +}RXHP_T, *pRXHP_T; + +#define dm_PSDMonitorCallback odm_PSDMonitorCallback +VOID odm_PSDMonitorCallback(PRT_TIMER pTimer); + +VOID +odm_PSDMonitorInit( + IN PVOID pDM_VOID + ); + +void odm_RXHPInit( + IN PVOID pDM_VOID); + +void odm_RXHP( + IN PVOID pDM_VOID); + +VOID +odm_PSD_RXHPCallback( + PRT_TIMER pTimer +); + + VOID +ODM_PSDDbgControl( + IN PADAPTER Adapter, + IN u4Byte mode, + IN u4Byte btRssi + ); + + VOID +odm_PSD_RXHPCallback( + PRT_TIMER pTimer +); + +VOID +odm_PSD_RXHPWorkitemCallback( + IN PVOID pContext + ); + +VOID +odm_PSDMonitorWorkItemCallback( + IN PVOID pContext + ); + + #endif + + #endif + \ No newline at end of file diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_RaInfo.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_RaInfo.c new file mode 100644 index 00000000000000..0aada4c719c8a4 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_RaInfo.c @@ -0,0 +1,2233 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +//============================================================ +// include files +//============================================================ +#include "Mp_Precomp.h" +#include "phydm_precomp.h" + +#if (defined(CONFIG_RA_DBG_CMD)) +VOID +ODM_C2HRaParaReportHandler( + IN PVOID pDM_VOID, + IN pu1Byte CmdBuf, + IN u1Byte CmdLen +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pRA_T pRA_Table = &pDM_Odm->DM_RA_Table; + + u1Byte para_idx = CmdBuf[0]; //Retry Penalty, NH, NL + u1Byte RateTypeStart = CmdBuf[1]; + u1Byte RateTypeLength = CmdLen-2; + u1Byte i; + + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, ("[ From FW C2H RA Para ] CmdBuf[0]= (( %d ))\n", CmdBuf[0])); + + if(para_idx==RADBG_RTY_PENALTY) + { + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, (" |Rate Index| |RTY Penality Index| \n")); + + for(i=0 ; i<(RateTypeLength) ; i++) + { + if(pRA_Table->is_ra_dbg_init) + pRA_Table->RTY_P_default[RateTypeStart + i] = CmdBuf[2+i]; + + pRA_Table->RTY_P[RateTypeStart + i] = CmdBuf[2+i]; + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, ("%8d %15d \n",(RateTypeStart + i), pRA_Table->RTY_P[RateTypeStart + i] )); + } + + } + else if(para_idx==RADBG_N_HIGH) + { + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, (" |Rate Index| |N-High| \n")); + + + } + else if(para_idx==RADBG_N_LOW) + { + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, (" |Rate Index| |N-Low| \n")); + + } + else if(para_idx==RADBG_RATE_UP_RTY_RATIO) + { + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, (" |Rate Index| |Rate Up RTY Ratio| \n")); + + for(i=0 ; i<(RateTypeLength) ; i++) + { + if(pRA_Table->is_ra_dbg_init) + pRA_Table->RATE_UP_RTY_RATIO_default[RateTypeStart + i] = CmdBuf[2+i]; + + pRA_Table->RATE_UP_RTY_RATIO[RateTypeStart + i] = CmdBuf[2+i]; + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, ("%8d %15d \n",(RateTypeStart + i), pRA_Table->RATE_UP_RTY_RATIO[RateTypeStart + i] )); + } + } + else if(para_idx==RADBG_RATE_DOWN_RTY_RATIO) + { + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, (" |Rate Index| |Rate Down RTY Ratio| \n")); + + for(i=0 ; i<(RateTypeLength) ; i++) + { + if(pRA_Table->is_ra_dbg_init) + pRA_Table->RATE_DOWN_RTY_RATIO_default[RateTypeStart + i] = CmdBuf[2+i]; + + pRA_Table->RATE_DOWN_RTY_RATIO[RateTypeStart + i] = CmdBuf[2+i]; + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, ("%8d %15d \n",(RateTypeStart + i), pRA_Table->RATE_DOWN_RTY_RATIO[RateTypeStart + i] )); + } + } + + +} + +VOID +odm_RA_ParaAdjust_Send_H2C( + IN PVOID pDM_VOID + ) +{ + + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pRA_T pRA_Table = &pDM_Odm->DM_RA_Table; + u1Byte H2C_Parameter[6] ={0}; + + H2C_Parameter[0] = RA_FIRST_MACID; + + //ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, ("RA_Para_feedback_req= (( %d )) \n",pRA_Table->RA_Para_feedback_req )); + if(pRA_Table->RA_Para_feedback_req) //H2C_Parameter[5]=1 ; ask FW for all RA parameters + { + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, ("[H2C] Ask FW for RA parameter \n")); + H2C_Parameter[5] |=BIT1; //ask FW to report RA parameters + H2C_Parameter[1] = pRA_Table->para_idx; //pRA_Table->para_idx; + pRA_Table->RA_Para_feedback_req=0; + } + else + { + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, ("[H2C] Send H2C to FW for modifying RA parameter \n")); + + H2C_Parameter[1] = pRA_Table->para_idx; + H2C_Parameter[2] = pRA_Table->rate_idx; + //1 [8 bit] + if (pRA_Table->para_idx==RADBG_RTY_PENALTY || pRA_Table->para_idx==RADBG_RATE_UP_RTY_RATIO|| pRA_Table->para_idx==RADBG_RATE_DOWN_RTY_RATIO) + { + H2C_Parameter[3] =pRA_Table->value; + H2C_Parameter[4] =0; + } + //1 [16 bit] + else //if ((pRA_Table->rate_idx==RADBG_N_HIGH)||(pRA_Table->rate_idx==RADBG_N_LOW)) + { + H2C_Parameter[3] =(u1Byte)(((pRA_Table->value_16)& 0xf0)>>4); //byte1 + H2C_Parameter[4] =(u1Byte)((pRA_Table->value_16) & 0x0f); //byte0 + } + } + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, (" H2C_Parameter[1] = 0x%x \n", H2C_Parameter[1] )); + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, (" H2C_Parameter[2] = 0x%x \n", H2C_Parameter[2] )); + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, (" H2C_Parameter[3] = 0x%x \n", H2C_Parameter[3] )); + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, (" H2C_Parameter[4] = 0x%x \n", H2C_Parameter[4] )); + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, (" H2C_Parameter[5] = 0x%x \n", H2C_Parameter[5] )); + + ODM_FillH2CCmd(pDM_Odm, ODM_H2C_RA_PARA_ADJUST, 6, H2C_Parameter); + +} + + +VOID +odm_RA_ParaAdjust( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pRA_T pRA_Table = &pDM_Odm->DM_RA_Table; + u1Byte para_idx= pRA_Table->para_idx; + u1Byte rate_idx= pRA_Table->rate_idx; + u1Byte value= pRA_Table->value; + u1Byte Pre_value=0xff; + + u1Byte temp_idx; + BOOLEAN sign=0; + + if(pRA_Table->para_idx ==RADBG_RTY_PENALTY) + { + Pre_value=pRA_Table->RTY_P[rate_idx]; + pRA_Table->RTY_P[rate_idx] = value; + pRA_Table->RTY_P_modify_note[rate_idx] =1; + } + else if(pRA_Table->para_idx ==RADBG_N_HIGH) + { + + } + else if(pRA_Table->para_idx ==RADBG_N_LOW) + { + + } + else if(pRA_Table->para_idx==RADBG_RATE_UP_RTY_RATIO) + { + Pre_value=pRA_Table->RATE_UP_RTY_RATIO[rate_idx]; + pRA_Table->RATE_UP_RTY_RATIO[rate_idx] = value; + pRA_Table->RATE_UP_RTY_RATIO_modify_note[rate_idx] =1; + } + else if(pRA_Table->para_idx==RADBG_RATE_DOWN_RTY_RATIO) + { + Pre_value=pRA_Table->RATE_DOWN_RTY_RATIO[rate_idx]; + pRA_Table->RATE_DOWN_RTY_RATIO[rate_idx] = value; + pRA_Table->RATE_DOWN_RTY_RATIO_modify_note[rate_idx] =1; + } + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, (" Change RA Papa[%d], Rate[ %d ], ((%d)) -> ((%d)) \n",pRA_Table->para_idx,rate_idx,Pre_value,value )); + odm_RA_ParaAdjust_Send_H2C(pDM_Odm); +} + + +VOID +phydm_ra_print_msg( + IN PVOID pDM_VOID, + IN u1Byte *value, + IN u1Byte *value_default, + IN u1Byte *modify_note + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pRA_T pRA_Table = &pDM_Odm->DM_RA_Table; + u4Byte i; + + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, (" |Rate index| |Current-value| |Default-value| |Modify?| \n")); + for(i=0 ; i<=(pRA_Table->rate_length); i++) + { + #if(DM_ODM_SUPPORT_TYPE & (ODM_WIN)) + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, (" [ %d ] %20d %25d %20s \n",i, value[i], value_default[i],((modify_note[i]==1)?"V":" . ") )); + #else + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, (" [ %d ] %10d %14d %14s \n",i, value[i], value_default[i],((modify_note[i]==1)?"V":" . ") )); + #endif + } + +} + +VOID +odm_RA_debug( + IN PVOID pDM_VOID, + IN u4Byte *const dm_value + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pRA_T pRA_Table = &pDM_Odm->DM_RA_Table; + u4Byte i; + + pRA_Table->is_ra_dbg_init=FALSE; + + if(dm_value[0]==100) //1 Print RA Parameters + { + u1Byte default_pointer_value; + u1Byte *pvalue; + u1Byte *pvalue_default; + u1Byte *pmodify_note; + + pvalue = pvalue_default = pmodify_note = &default_pointer_value; + + ODM_CmnInfoUpdate(pDM_Odm, ODM_CMNINFO_DBG_COMP, PHYDM_COMP_RA_DBG); + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, ("\n------------------------------------------------------------------------------------\n")); + + if(dm_value[1]==RADBG_RTY_PENALTY) //1 [1] + { + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, (" [1] RTY_PENALTY \n")); + pvalue = &(pRA_Table->RTY_P[0]); + pvalue_default = &(pRA_Table->RTY_P_default[0]); + pmodify_note = &(pRA_Table->RTY_P_modify_note[0]); + } + else if(dm_value[1]==RADBG_N_HIGH) //1 [2] + { + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, (" [2] N_HIGH \n")); + + } + else if(dm_value[1]==RADBG_N_LOW) //1 [3] + { + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, (" [3] N_LOW \n")); + + } + else if(dm_value[1]==RADBG_RATE_UP_RTY_RATIO) //1 [8] + { + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, (" [8] RATE_UP_RTY_RATIO \n")); + pvalue = &(pRA_Table->RATE_UP_RTY_RATIO[0]); + pvalue_default = &(pRA_Table->RATE_UP_RTY_RATIO_default[0]); + pmodify_note = &(pRA_Table->RATE_UP_RTY_RATIO_modify_note[0]); + } + else if(dm_value[1]==RADBG_RATE_DOWN_RTY_RATIO) //1 [9] + { + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, (" [9] RATE_DOWN_RTY_RATIO \n")); + pvalue = &(pRA_Table->RATE_DOWN_RTY_RATIO[0]); + pvalue_default = &(pRA_Table->RATE_DOWN_RTY_RATIO_default[0]); + pmodify_note = &(pRA_Table->RATE_DOWN_RTY_RATIO_modify_note[0]); + } + + phydm_ra_print_msg(pDM_Odm, pvalue, pvalue_default, pmodify_note); + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, ("\n------------------------------------------------------------------------------------\n\n")); + + } + else if(dm_value[0]==101) + { + pRA_Table->para_idx =(u1Byte)dm_value[1]; + + pRA_Table->RA_Para_feedback_req=1; + odm_RA_ParaAdjust_Send_H2C(pDM_Odm); + } + else + { + pRA_Table->para_idx = (u1Byte)dm_value[0]; + pRA_Table->rate_idx = (u1Byte)dm_value[1]; + pRA_Table->value = (u1Byte)dm_value[2]; + + odm_RA_ParaAdjust(pDM_Odm); + } + +} + +VOID +odm_RA_ParaAdjust_init( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pRA_T pRA_Table = &pDM_Odm->DM_RA_Table; + u1Byte i; + u1Byte ra_para_pool_u8[3]= { RADBG_RTY_PENALTY, RADBG_RATE_UP_RTY_RATIO, RADBG_RATE_DOWN_RTY_RATIO}; +/* + RTY_PENALTY = 1, //u8 + N_HIGH = 2, + N_LOW = 3, + RATE_UP_TABLE = 4, + RATE_DOWN_TABLE = 5, + TRYING_NECESSARY = 6, + DROPING_NECESSARY = 7, + RATE_UP_RTY_RATIO = 8, //u8 + RATE_DOWN_RTY_RATIO= 9, //u8 + ALL_PARA = 0xff + +*/ + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, ("odm_RA_ParaAdjust_init \n")); + + pRA_Table->is_ra_dbg_init=TRUE; + for(i=0;i<3;i++) + { + pRA_Table->RA_Para_feedback_req=1; + pRA_Table->para_idx = ra_para_pool_u8[i]; + odm_RA_ParaAdjust_Send_H2C(pDM_Odm); + } + + if(pDM_Odm->SupportICType == ODM_RTL8192E) + pRA_Table->rate_length = ODM_RATEMCS15; + else if((pDM_Odm->SupportICType == ODM_RTL8723B) ||(pDM_Odm->SupportICType == ODM_RTL8188E)) + pRA_Table->rate_length = ODM_RATEMCS7; + else if((pDM_Odm->SupportICType == ODM_RTL8821) ||(pDM_Odm->SupportICType == ODM_RTL8881A)) + pRA_Table->rate_length = ODM_RATEVHTSS1MCS9; + else if(pDM_Odm->SupportICType == ODM_RTL8812) + pRA_Table->rate_length = ODM_RATEVHTSS2MCS9; + else if(pDM_Odm->SupportICType == ODM_RTL8814A) + pRA_Table->rate_length = ODM_RATEVHTSS3MCS9; + else + pRA_Table->rate_length = ODM_RATEVHTSS4MCS9; + +} + +#else + +VOID +ODM_C2HRaParaReportHandler( + IN PVOID pDM_VOID, + IN pu1Byte CmdBuf, + IN u1Byte CmdLen + ) +{ +} + +VOID +odm_RA_debug( + IN PVOID pDM_VOID, + IN u4Byte *const dm_value + ) +{ +} + +VOID +odm_RA_ParaAdjust_init( + IN PVOID pDM_VOID +) + +{ +} + +#endif //#if (defined(CONFIG_RA_DBG_CMD)) + +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN| ODM_CE)) +u1Byte +odm_Find_RTS_Rate( + IN PVOID pDM_VOID, + IN u1Byte Tx_Rate, + IN BOOLEAN bErpProtect +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + u1Byte RTS_Ini_Rate = ODM_RATE6M; + if(bErpProtect) // use CCK rate as RTS + { + RTS_Ini_Rate = ODM_RATE1M; + } + else + { + switch (Tx_Rate) + { + case ODM_RATEVHTSS2MCS9: + case ODM_RATEVHTSS2MCS8: + case ODM_RATEVHTSS2MCS7: + case ODM_RATEVHTSS2MCS6: + case ODM_RATEVHTSS2MCS5: + case ODM_RATEVHTSS2MCS4: + case ODM_RATEVHTSS2MCS3: + case ODM_RATEVHTSS1MCS9: + case ODM_RATEVHTSS1MCS8: + case ODM_RATEVHTSS1MCS7: + case ODM_RATEVHTSS1MCS6: + case ODM_RATEVHTSS1MCS5: + case ODM_RATEVHTSS1MCS4: + case ODM_RATEVHTSS1MCS3: + case ODM_RATEMCS15: + case ODM_RATEMCS14: + case ODM_RATEMCS13: + case ODM_RATEMCS12: + case ODM_RATEMCS11: + case ODM_RATEMCS7: + case ODM_RATEMCS6: + case ODM_RATEMCS5: + case ODM_RATEMCS4: + case ODM_RATEMCS3: + case ODM_RATE54M: + case ODM_RATE48M: + case ODM_RATE36M: + case ODM_RATE24M: + RTS_Ini_Rate = ODM_RATE24M; + break; + case ODM_RATEVHTSS2MCS2: + case ODM_RATEVHTSS2MCS1: + case ODM_RATEVHTSS1MCS2: + case ODM_RATEVHTSS1MCS1: + case ODM_RATEMCS10: + case ODM_RATEMCS9: + case ODM_RATEMCS2: + case ODM_RATEMCS1: + case ODM_RATE18M: + case ODM_RATE12M: + RTS_Ini_Rate = ODM_RATE12M; + break; + case ODM_RATEVHTSS2MCS0: + case ODM_RATEVHTSS1MCS0: + case ODM_RATEMCS8: + case ODM_RATEMCS0: + case ODM_RATE9M: + case ODM_RATE6M: + RTS_Ini_Rate = ODM_RATE6M; + break; + case ODM_RATE11M: + case ODM_RATE5_5M: + case ODM_RATE2M: + case ODM_RATE1M: + RTS_Ini_Rate = ODM_RATE1M; + break; + default: + RTS_Ini_Rate = ODM_RATE6M; + break; + } + } + + if (*pDM_Odm->pBandType == 1) { + if(RTS_Ini_Rate < ODM_RATE6M) + RTS_Ini_Rate = ODM_RATE6M; + } + return RTS_Ini_Rate; + +} + +VOID +odm_Set_RA_DM_ARFB_by_Noisy( + IN PDM_ODM_T pDM_Odm +) +{ + //DbgPrint("DM_ARFB ====> \n"); + if (pDM_Odm->bNoisyState){ + ODM_Write4Byte(pDM_Odm,0x430,0x00000000); + ODM_Write4Byte(pDM_Odm,0x434,0x05040200); + //DbgPrint("DM_ARFB ====> Noisy State\n"); + } + else{ + ODM_Write4Byte(pDM_Odm,0x430,0x02010000); + ODM_Write4Byte(pDM_Odm,0x434,0x07050403); + //DbgPrint("DM_ARFB ====> Clean State\n"); + } + +} + +VOID +ODM_UpdateNoisyState( + IN PVOID pDM_VOID, + IN BOOLEAN bNoisyStateFromC2H + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + + //DbgPrint("Get C2H Command! NoisyState=0x%x\n ", bNoisyStateFromC2H); + if(pDM_Odm->SupportICType == ODM_RTL8821 || pDM_Odm->SupportICType == ODM_RTL8812 || + pDM_Odm->SupportICType == ODM_RTL8723B || pDM_Odm->SupportICType == ODM_RTL8192E || pDM_Odm->SupportICType == ODM_RTL8188E) + { + pDM_Odm->bNoisyState = bNoisyStateFromC2H; + } + odm_Set_RA_DM_ARFB_by_Noisy(pDM_Odm); +}; + +u4Byte +Set_RA_DM_Ratrbitmap_by_Noisy( + IN PVOID pDM_VOID, + IN WIRELESS_MODE WirelessMode, + IN u4Byte ratr_bitmap, + IN u1Byte rssi_level +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + u4Byte ret_bitmap = ratr_bitmap; + switch (WirelessMode) + { + case WIRELESS_MODE_AC_24G : + case WIRELESS_MODE_AC_5G : + case WIRELESS_MODE_AC_ONLY: + if (pDM_Odm->bNoisyState){ // in Noisy State + if (rssi_level==1) + ret_bitmap&=0xfe3f0e08; + else if (rssi_level==2) + ret_bitmap&=0xff3f8f8c; + else if (rssi_level==3) + ret_bitmap&=0xffffffff ; + else + ret_bitmap&=0xffffffff ; + } + else{ // in SNR State + if (rssi_level==1){ + ret_bitmap&=0xfc3e0c08; + } + else if (rssi_level==2){ + ret_bitmap&=0xfe3f0e08; + } + else if (rssi_level==3){ + ret_bitmap&=0xffffffff; + } + else{ + ret_bitmap&=0xffffffff; + } + } + break; + case WIRELESS_MODE_B: + case WIRELESS_MODE_A: + case WIRELESS_MODE_G: + case WIRELESS_MODE_N_24G: + case WIRELESS_MODE_N_5G: + if (pDM_Odm->bNoisyState){ + if (rssi_level==1) + ret_bitmap&=0x0f0e0c08; + else if (rssi_level==2) + ret_bitmap&=0x0f8f0e0c; + else if (rssi_level==3) + ret_bitmap&=0xffffffff ; + else + ret_bitmap&=0xffffffff ; + } + else{ + if (rssi_level==1){ + ret_bitmap&=0x0f8f0e08; + } + else if (rssi_level==2){ + ret_bitmap&=0x0fcf8f8c; + } + else if (rssi_level==3){ + ret_bitmap&=0xffffffff; + } + else{ + ret_bitmap&=0xffffffff; + } + } + break; + default: + break; + } + //DbgPrint("DM_RAMask ====> rssi_LV = %d, BITMAP = %x \n", rssi_level, ret_bitmap); + return ret_bitmap; + +} + +VOID +ODM_UpdateInitRate( + IN PVOID pDM_VOID, + IN u1Byte Rate + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + u1Byte p = 0; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,("Get C2H Command! Rate=0x%x\n", Rate)); + + if(pDM_Odm->SupportICType == ODM_RTL8821 || pDM_Odm->SupportICType == ODM_RTL8812 || + pDM_Odm->SupportICType == ODM_RTL8723B || pDM_Odm->SupportICType == ODM_RTL8192E || pDM_Odm->SupportICType == ODM_RTL8188E) + { + pDM_Odm->TxRate = Rate; +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + #if DEV_BUS_TYPE==RT_PCI_INTERFACE + #if USE_WORKITEM + PlatformScheduleWorkItem(&pDM_Odm->RaRptWorkitem); + #else + if(pDM_Odm->SupportICType == ODM_RTL8821) + { + #if (RTL8821A_SUPPORT==1) + ODM_TxPwrTrackSetPwr8821A(pDM_Odm, MIX_MODE, ODM_RF_PATH_A, 0); + #endif + } + else if(pDM_Odm->SupportICType == ODM_RTL8812) + { + for (p = ODM_RF_PATH_A; p < MAX_PATH_NUM_8812A; p++) + { + #if (RTL8812A_SUPPORT==1) + ODM_TxPwrTrackSetPwr8812A(pDM_Odm, MIX_MODE, p, 0); + #endif + } + } + else if(pDM_Odm->SupportICType == ODM_RTL8723B) + { + #if (RTL8723B_SUPPORT==1) + ODM_TxPwrTrackSetPwr_8723B(pDM_Odm, MIX_MODE, ODM_RF_PATH_A, 0); + #endif + } + else if(pDM_Odm->SupportICType == ODM_RTL8192E) + { + for (p = ODM_RF_PATH_A; p < MAX_PATH_NUM_8192E; p++) + { + #if (RTL8192E_SUPPORT==1) + ODM_TxPwrTrackSetPwr92E(pDM_Odm, MIX_MODE, p, 0); + #endif + } + } + else if(pDM_Odm->SupportICType == ODM_RTL8188E) + { + #if (RTL8188E_SUPPORT==1) + ODM_TxPwrTrackSetPwr88E(pDM_Odm, MIX_MODE, ODM_RF_PATH_A, 0); + #endif + } + #endif + #else + PlatformScheduleWorkItem(&pDM_Odm->RaRptWorkitem); + #endif +#endif +} + + else + return; +} + +#endif + + +VOID +odm_RSSIMonitorInit( + IN PVOID pDM_VOID + ) +{ +#if(DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pRA_T pRA_Table = &pDM_Odm->DM_RA_Table; + pRA_Table->firstconnect = FALSE; + +#if(DM_ODM_SUPPORT_TYPE & (ODM_WIN)) + pRA_Table->PT_collision_pre = TRUE; //used in ODM_DynamicARFBSelect(WIN only) +#endif +#endif +} + +VOID +ODM_RAPostActionOnAssoc( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + + pDM_Odm->H2C_RARpt_connect=1; + odm_RSSIMonitorCheck(pDM_Odm); + pDM_Odm->H2C_RARpt_connect=0; +} + +VOID +odm_RSSIMonitorCheck( + IN PVOID pDM_VOID + ) +{ + // + // For AP/ADSL use prtl8192cd_priv + // For CE/NIC use PADAPTER + // +PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + if (!(pDM_Odm->SupportAbility & ODM_BB_RSSI_MONITOR)) + return; + + // + // 2011/09/29 MH In HW integration first stage, we provide 4 different handle to operate + // at the same time. In the stage2/3, we need to prive universal interface and merge all + // HW dynamic mechanism. + // + switch (pDM_Odm->SupportPlatform) + { + case ODM_WIN: + odm_RSSIMonitorCheckMP(pDM_Odm); + break; + + case ODM_CE: + odm_RSSIMonitorCheckCE(pDM_Odm); + break; + + case ODM_AP: + odm_RSSIMonitorCheckAP(pDM_Odm); + break; + + case ODM_ADSL: + //odm_DIGAP(pDM_Odm); + break; + } + +} // odm_RSSIMonitorCheck + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) +VOID +odm_RSSIDumpToRegister( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PADAPTER Adapter = pDM_Odm->Adapter; + + if(pDM_Odm->SupportICType == ODM_RTL8812) + { + PlatformEFIOWrite1Byte(Adapter, rA_RSSIDump_Jaguar, Adapter->RxStats.RxRSSIPercentage[0]); + PlatformEFIOWrite1Byte(Adapter, rB_RSSIDump_Jaguar, Adapter->RxStats.RxRSSIPercentage[1]); + + // Rx EVM + PlatformEFIOWrite1Byte(Adapter, rS1_RXevmDump_Jaguar, Adapter->RxStats.RxEVMdbm[0]); + PlatformEFIOWrite1Byte(Adapter, rS2_RXevmDump_Jaguar, Adapter->RxStats.RxEVMdbm[1]); + + // Rx SNR + PlatformEFIOWrite1Byte(Adapter, rA_RXsnrDump_Jaguar, (u1Byte)(Adapter->RxStats.RxSNRdB[0])); + PlatformEFIOWrite1Byte(Adapter, rB_RXsnrDump_Jaguar, (u1Byte)(Adapter->RxStats.RxSNRdB[1])); + + // Rx Cfo_Short + PlatformEFIOWrite2Byte(Adapter, rA_CfoShortDump_Jaguar, Adapter->RxStats.RxCfoShort[0]); + PlatformEFIOWrite2Byte(Adapter, rB_CfoShortDump_Jaguar, Adapter->RxStats.RxCfoShort[1]); + + // Rx Cfo_Tail + PlatformEFIOWrite2Byte(Adapter, rA_CfoLongDump_Jaguar, Adapter->RxStats.RxCfoTail[0]); + PlatformEFIOWrite2Byte(Adapter, rB_CfoLongDump_Jaguar, Adapter->RxStats.RxCfoTail[1]); + } + else if(pDM_Odm->SupportICType == ODM_RTL8192E) + { + PlatformEFIOWrite1Byte(Adapter, rA_RSSIDump_92E, Adapter->RxStats.RxRSSIPercentage[0]); + PlatformEFIOWrite1Byte(Adapter, rB_RSSIDump_92E, Adapter->RxStats.RxRSSIPercentage[1]); + // Rx EVM + PlatformEFIOWrite1Byte(Adapter, rS1_RXevmDump_92E, Adapter->RxStats.RxEVMdbm[0]); + PlatformEFIOWrite1Byte(Adapter, rS2_RXevmDump_92E, Adapter->RxStats.RxEVMdbm[1]); + // Rx SNR + PlatformEFIOWrite1Byte(Adapter, rA_RXsnrDump_92E, (u1Byte)(Adapter->RxStats.RxSNRdB[0])); + PlatformEFIOWrite1Byte(Adapter, rB_RXsnrDump_92E, (u1Byte)(Adapter->RxStats.RxSNRdB[1])); + // Rx Cfo_Short + PlatformEFIOWrite2Byte(Adapter, rA_CfoShortDump_92E, Adapter->RxStats.RxCfoShort[0]); + PlatformEFIOWrite2Byte(Adapter, rB_CfoShortDump_92E, Adapter->RxStats.RxCfoShort[1]); + // Rx Cfo_Tail + PlatformEFIOWrite2Byte(Adapter, rA_CfoLongDump_92E, Adapter->RxStats.RxCfoTail[0]); + PlatformEFIOWrite2Byte(Adapter, rB_CfoLongDump_92E, Adapter->RxStats.RxCfoTail[1]); + } +} +#endif + +VOID +odm_RSSIMonitorCheckMP( + IN PVOID pDM_VOID + ) +{ +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + u1Byte H2C_Parameter[4] ={0}; + u4Byte i; + BOOLEAN bExtRAInfo = FALSE; + u1Byte cmdlen=3; + u1Byte TxBF_EN = 0,stbc_en=0; + + PADAPTER Adapter = pDM_Odm->Adapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + PRT_WLAN_STA pEntry = NULL; + s4Byte tmpEntryMaxPWDB=0, tmpEntryMinPWDB=0xff; + PMGNT_INFO pMgntInfo = &Adapter->MgntInfo; + PMGNT_INFO pDefaultMgntInfo = &Adapter->MgntInfo; + u8Byte curTxOkCnt = 0, curRxOkCnt = 0; + //BOOLEAN FirstConnect = 0; + pRA_T pRA_Table = &pDM_Odm->DM_RA_Table; + pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable; + +#if (BEAMFORMING_SUPPORT ) + BEAMFORMING_CAP Beamform_cap = BEAMFORMING_CAP_NONE; +#endif + + PADAPTER pLoopAdapter = GetDefaultAdapter(Adapter); + + if(pDM_Odm->SupportICType & EXT_RA_INFO_SUPPORT_IC) + { + bExtRAInfo = TRUE; + cmdlen=4; + } + + //FirstConnect = (pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_0 == FALSE); + //pRA_Table->firstconnect = pHalData->bLinked; + + +/* + if(pDM_Odm->SupportICType == ODM_RTL8188E && (pDefaultMgntInfo->CustomerID==RT_CID_819x_HP)) + { + if(curRxOkCnt >(curTxOkCnt*6)) + PlatformEFIOWrite4Byte(Adapter, REG_ARFR0, 0x8f015); + else + PlatformEFIOWrite4Byte(Adapter, REG_ARFR0, 0xff015); + } + + + if(pDM_Odm->SupportICType == ODM_RTL8812 || pDM_Odm->SupportICType == ODM_RTL8821 || + pDM_Odm->SupportICType == ODM_RTL8814A|| pDM_Odm->SupportICType == ODM_RTL8822B) + { + if(curRxOkCnt >(curTxOkCnt*6)) + H2C_Parameter[3]|=RAINFO_BE_RX_STATE; + } +*/ + + while(pLoopAdapter) + { + + if(pLoopAdapter != NULL){ + pMgntInfo = &pLoopAdapter->MgntInfo; + curTxOkCnt = pLoopAdapter->TxStats.NumTxBytesUnicast - pMgntInfo->lastTxOkCnt; + curRxOkCnt = pLoopAdapter->RxStats.NumRxBytesUnicast - pMgntInfo->lastRxOkCnt; + pMgntInfo->lastTxOkCnt = curTxOkCnt; + pMgntInfo->lastRxOkCnt = curRxOkCnt; + } + + for(i = 0; i < ASSOCIATE_ENTRY_NUM; i++) + { + + if(IsAPModeExist(pLoopAdapter)) + { + if(GetFirstExtAdapter(pLoopAdapter) != NULL && + GetFirstExtAdapter(pLoopAdapter) == pLoopAdapter){ + pEntry = AsocEntry_EnumStation(pLoopAdapter, i); + } + else if(GetFirstGOPort(pLoopAdapter) != NULL && + IsFirstGoAdapter(pLoopAdapter)){ + pEntry = AsocEntry_EnumStation(pLoopAdapter, i); + } + } + else + { + if(GetDefaultAdapter(pLoopAdapter) == pLoopAdapter){ + pEntry = AsocEntry_EnumStation(pLoopAdapter, i); + } + } + + if(pEntry != NULL) + { + if(pEntry->bAssociated) + { + + RT_DISP_ADDR(FDM, DM_PWDB, ("pEntry->MacAddr ="), pEntry->MacAddr); + RT_DISP(FDM, DM_PWDB, ("pEntry->rssi = 0x%x(%d)\n", + pEntry->rssi_stat.UndecoratedSmoothedPWDB, pEntry->rssi_stat.UndecoratedSmoothedPWDB)); + + //2 BF_en + #if (BEAMFORMING_SUPPORT) + Beamform_cap = Beamforming_GetEntryBeamCapByMacId(Adapter, pEntry->AssociatedMacId); + if(Beamform_cap & (BEAMFORMER_CAP_HT_EXPLICIT |BEAMFORMER_CAP_VHT_SU)) + TxBF_EN = 1; + #endif + //2 STBC_en + if( ( IS_WIRELESS_MODE_AC(Adapter) && TEST_FLAG(pEntry->VHTInfo.STBC, STBC_VHT_ENABLE_TX) ) || + TEST_FLAG(pEntry->HTInfo.STBC, STBC_HT_ENABLE_TX)) + { + stbc_en=1; + } + + if(pEntry->rssi_stat.UndecoratedSmoothedPWDB < tmpEntryMinPWDB) + tmpEntryMinPWDB = pEntry->rssi_stat.UndecoratedSmoothedPWDB; + if(pEntry->rssi_stat.UndecoratedSmoothedPWDB > tmpEntryMaxPWDB) + tmpEntryMaxPWDB = pEntry->rssi_stat.UndecoratedSmoothedPWDB; + + if(bExtRAInfo) + { + if(curRxOkCnt >(curTxOkCnt*6)) + H2C_Parameter[3]|=RAINFO_BE_RX_STATE; + + if(TxBF_EN) + H2C_Parameter[3] |= RAINFO_BF_STATE; + else + { + if(stbc_en) + H2C_Parameter[3] |= RAINFO_STBC_STATE; + } + + if(pDM_Odm->H2C_RARpt_connect) + H2C_Parameter[3] |= RAINFO_INIT_RSSI_RATE_STATE; + } + + H2C_Parameter[2] = (u1Byte)(pEntry->rssi_stat.UndecoratedSmoothedPWDB & 0xFF); + //H2C_Parameter[1] = 0x20; // fw v12 cmdid 5:use max macid ,for nic ,default macid is 0 ,max macid is 1 + H2C_Parameter[0] = (pEntry->AssociatedMacId); + + ODM_FillH2CCmd(pDM_Odm, ODM_H2C_RSSI_REPORT, cmdlen, H2C_Parameter); + } + } + else + { + break; + } + } + + pLoopAdapter = GetNextExtAdapter(pLoopAdapter); + } + + if(tmpEntryMaxPWDB != 0) // If associated entry is found + { + pHalData->EntryMaxUndecoratedSmoothedPWDB = tmpEntryMaxPWDB; + RT_DISP(FDM, DM_PWDB, ("EntryMaxPWDB = 0x%x(%d)\n", tmpEntryMaxPWDB, tmpEntryMaxPWDB)); + } + else + { + pHalData->EntryMaxUndecoratedSmoothedPWDB = 0; + } + + if(tmpEntryMinPWDB != 0xff) // If associated entry is found + { + pHalData->EntryMinUndecoratedSmoothedPWDB = tmpEntryMinPWDB; + RT_DISP(FDM, DM_PWDB, ("EntryMinPWDB = 0x%x(%d)\n", tmpEntryMinPWDB, tmpEntryMinPWDB)); + + } + else + { + pHalData->EntryMinUndecoratedSmoothedPWDB = 0; + } + + // Indicate Rx signal strength to FW. + if(pHalData->bUseRAMask) + { + PRT_HIGH_THROUGHPUT pHTInfo = GET_HT_INFO(pDefaultMgntInfo); + PRT_VERY_HIGH_THROUGHPUT pVHTInfo = GET_VHT_INFO(pDefaultMgntInfo); + + //2 BF_en + #if (BEAMFORMING_SUPPORT == 1) + Beamform_cap = Beamforming_GetEntryBeamCapByMacId(Adapter, pDefaultMgntInfo->mMacId); + + if(Beamform_cap & (BEAMFORMER_CAP_HT_EXPLICIT |BEAMFORMER_CAP_VHT_SU)) + TxBF_EN = 1; + #endif + + //2 STBC_en + if( ( IS_WIRELESS_MODE_AC(Adapter) && TEST_FLAG(pVHTInfo->VhtCurStbc, STBC_VHT_ENABLE_TX ) ) || + TEST_FLAG(pHTInfo->HtCurStbc, STBC_HT_ENABLE_TX)) + { + stbc_en=1; + } + + if(bExtRAInfo) + { + if(TxBF_EN) + H2C_Parameter[3] |= RAINFO_BF_STATE; + else + { + if( stbc_en) + H2C_Parameter[3] |= RAINFO_STBC_STATE; + } + + if(pDM_Odm->H2C_RARpt_connect) + H2C_Parameter[3] |= RAINFO_INIT_RSSI_RATE_STATE; + } + + H2C_Parameter[2] = (u1Byte)(pHalData->UndecoratedSmoothedPWDB & 0xFF); + //H2C_Parameter[1] = 0x20; // fw v12 cmdid 5:use max macid ,for nic ,default macid is 0 ,max macid is 1 + H2C_Parameter[0] = 0; // fw v12 cmdid 5:use max macid ,for nic ,default macid is 0 ,max macid is 1 + + ODM_FillH2CCmd(pDM_Odm, ODM_H2C_RSSI_REPORT, cmdlen, H2C_Parameter); + + // BT 3.0 HS mode Rssi + if(pDM_Odm->bBtHsOperation) + { + H2C_Parameter[2] = pDM_Odm->btHsRssi; + //H2C_Parameter[1] = 0x0; + H2C_Parameter[0] = 2; + + ODM_FillH2CCmd(pDM_Odm, ODM_H2C_RSSI_REPORT, cmdlen, H2C_Parameter); + } + } + else + { + PlatformEFIOWrite1Byte(Adapter, 0x4fe, (u1Byte)pHalData->UndecoratedSmoothedPWDB); + } + + if((pDM_Odm->SupportICType == ODM_RTL8812)||(pDM_Odm->SupportICType == ODM_RTL8192E)) + odm_RSSIDumpToRegister(pDM_Odm); + + + { + PADAPTER pLoopAdapter = GetDefaultAdapter(Adapter); + s4Byte GlobalRSSI_min = 0xFF, LocalRSSI_Min; + BOOLEAN bLink= FALSE; + + while(pLoopAdapter) + { + LocalRSSI_Min = odm_FindMinimumRSSI(pLoopAdapter); + //DbgPrint("pHalData->bLinked=%d, LocalRSSI_Min=%d\n", pHalData->bLinked, LocalRSSI_Min); + if((LocalRSSI_Min < GlobalRSSI_min) && (LocalRSSI_Min != 0)) + GlobalRSSI_min = LocalRSSI_Min; + + if(pHalData->bLinked) + bLink = TRUE; + + pLoopAdapter = GetNextExtAdapter(pLoopAdapter); + } + + pHalData->bLinked = bLink; + ODM_CmnInfoUpdate(&pHalData->DM_OutSrc ,ODM_CMNINFO_LINK, (u8Byte)bLink); + ODM_CmnInfoUpdate(&pHalData->DM_OutSrc ,ODM_CMNINFO_RSSI_MIN, (u8Byte)GlobalRSSI_min); + + } + +#endif // #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) +} + +#if(DM_ODM_SUPPORT_TYPE==ODM_CE) +// +//sherry move from DUSC to here 20110517 +// +static VOID +FindMinimumRSSI_Dmsp( + IN PADAPTER pAdapter +) +{ +#if 0 + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); + struct dm_priv *pdmpriv = &pHalData->dmpriv; + s32 Rssi_val_min_back_for_mac0; + BOOLEAN bGetValueFromBuddyAdapter = dm_DualMacGetParameterFromBuddyAdapter(pAdapter); + BOOLEAN bRestoreRssi = _FALSE; + PADAPTER BuddyAdapter = pAdapter->BuddyAdapter; + + if(pHalData->MacPhyMode92D == DUALMAC_SINGLEPHY) + { + if(BuddyAdapter!= NULL) + { + if(pHalData->bSlaveOfDMSP) + { + //ODM_RT_TRACE(pDM_Odm,COMP_EASY_CONCURRENT,DBG_LOUD,("bSlavecase of dmsp\n")); + BuddyAdapter->DualMacDMSPControl.RssiValMinForAnotherMacOfDMSP = pdmpriv->MinUndecoratedPWDBForDM; + } + else + { + if(bGetValueFromBuddyAdapter) + { + //ODM_RT_TRACE(pDM_Odm,COMP_EASY_CONCURRENT,DBG_LOUD,("get new RSSI\n")); + bRestoreRssi = _TRUE; + Rssi_val_min_back_for_mac0 = pdmpriv->MinUndecoratedPWDBForDM; + pdmpriv->MinUndecoratedPWDBForDM = pAdapter->DualMacDMSPControl.RssiValMinForAnotherMacOfDMSP; + } + } + } + + } + + if(bRestoreRssi) + { + bRestoreRssi = _FALSE; + pdmpriv->MinUndecoratedPWDBForDM = Rssi_val_min_back_for_mac0; + } +#endif +} + +static void +FindMinimumRSSI( +IN PADAPTER pAdapter + ) +{ + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); + struct dm_priv *pdmpriv = &pHalData->dmpriv; + PDM_ODM_T pDM_Odm = &(pHalData->odmpriv); + + //1 1.Determine the minimum RSSI + + if((pDM_Odm->bLinked != _TRUE) && + (pdmpriv->EntryMinUndecoratedSmoothedPWDB == 0)) + { + pdmpriv->MinUndecoratedPWDBForDM = 0; + //ODM_RT_TRACE(pDM_Odm,COMP_BB_POWERSAVING, DBG_LOUD, ("Not connected to any \n")); + } + else + { + pdmpriv->MinUndecoratedPWDBForDM = pdmpriv->EntryMinUndecoratedSmoothedPWDB; + } + + //DBG_8192C("%s=>MinUndecoratedPWDBForDM(%d)\n",__FUNCTION__,pdmpriv->MinUndecoratedPWDBForDM); + //ODM_RT_TRACE(pDM_Odm,COMP_DIG, DBG_LOUD, ("MinUndecoratedPWDBForDM =%d\n",pHalData->MinUndecoratedPWDBForDM)); +} +#endif + +VOID +odm_RSSIMonitorCheckCE( + IN PVOID pDM_VOID + ) +{ +#if (DM_ODM_SUPPORT_TYPE == ODM_CE) + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PADAPTER Adapter = pDM_Odm->Adapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + struct dm_priv *pdmpriv = &pHalData->dmpriv; + struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(Adapter); + int i; + int tmpEntryMaxPWDB=0, tmpEntryMinPWDB=0xff; + u8 sta_cnt=0; + u32 UL_DL_STATE = 0, STBC_TX = 0, TxBF_EN = 0; + u32 PWDB_rssi[NUM_STA]={0};//[0~15]:MACID, [16~31]:PWDB_rssi + BOOLEAN FirstConnect = FALSE; + pRA_T pRA_Table = &pDM_Odm->DM_RA_Table; + + if(pDM_Odm->bLinked != _TRUE) + return; + + #if((RTL8812A_SUPPORT==1)||(RTL8821A_SUPPORT==1)) + if((pDM_Odm->SupportICType == ODM_RTL8812)||(pDM_Odm->SupportICType == ODM_RTL8821)) + { + u64 curTxOkCnt = pdvobjpriv->traffic_stat.cur_tx_bytes; + u64 curRxOkCnt = pdvobjpriv->traffic_stat.cur_rx_bytes; + + if(curRxOkCnt >(curTxOkCnt*6)) + UL_DL_STATE = 1; + else + UL_DL_STATE = 0; + } + #endif + + FirstConnect = (pDM_Odm->bLinked) && (pRA_Table->firstconnect == FALSE); + pRA_Table->firstconnect = pDM_Odm->bLinked; + + //if(check_fwstate(&Adapter->mlmepriv, WIFI_AP_STATE|WIFI_ADHOC_STATE|WIFI_ADHOC_MASTER_STATE) == _TRUE) + { + #if 1 + struct sta_info *psta; + + for(i=0; ipODM_StaInfo[i])) + { + if(IS_MCAST( psta->hwaddr)) //if(psta->mac_id ==1) + continue; + + if(psta->rssi_stat.UndecoratedSmoothedPWDB == (-1)) + continue; + + if(psta->rssi_stat.UndecoratedSmoothedPWDB < tmpEntryMinPWDB) + tmpEntryMinPWDB = psta->rssi_stat.UndecoratedSmoothedPWDB; + + if(psta->rssi_stat.UndecoratedSmoothedPWDB > tmpEntryMaxPWDB) + tmpEntryMaxPWDB = psta->rssi_stat.UndecoratedSmoothedPWDB; + + #if 0 + DBG_871X("%s mac_id:%u, mac:"MAC_FMT", rssi:%d\n", __func__, + psta->mac_id, MAC_ARG(psta->hwaddr), psta->rssi_stat.UndecoratedSmoothedPWDB); + #endif + + if(psta->rssi_stat.UndecoratedSmoothedPWDB != (-1)) { + +#ifdef CONFIG_80211N_HT + if(pDM_Odm->SupportICType == ODM_RTL8192E || pDM_Odm->SupportICType == ODM_RTL8812) + { +#ifdef CONFIG_BEAMFORMING + BEAMFORMING_CAP Beamform_cap = beamforming_get_entry_beam_cap_by_mac_id(&Adapter->mlmepriv, psta->mac_id); + + if(Beamform_cap & (BEAMFORMER_CAP_HT_EXPLICIT |BEAMFORMER_CAP_VHT_SU)) + TxBF_EN = 1; + else + TxBF_EN = 0; + + if (TxBF_EN) { + STBC_TX = 0; + } + else +#endif + { +#ifdef CONFIG_80211AC_VHT + if(IsSupportedVHT(psta->wireless_mode)) + STBC_TX = TEST_FLAG(psta->vhtpriv.stbc_cap, STBC_VHT_ENABLE_TX); + else +#endif + STBC_TX = TEST_FLAG(psta->htpriv.stbc_cap, STBC_HT_ENABLE_TX); + } + } +#endif + + if(pDM_Odm->SupportICType == ODM_RTL8192D) + PWDB_rssi[sta_cnt++] = (psta->mac_id | (psta->rssi_stat.UndecoratedSmoothedPWDB<<16) | ((Adapter->stapriv.asoc_sta_count+1) << 8)); + else if ((pDM_Odm->SupportICType == ODM_RTL8192E)||(pDM_Odm->SupportICType == ODM_RTL8812)||(pDM_Odm->SupportICType == ODM_RTL8821)) + PWDB_rssi[sta_cnt++] = (((u8)(psta->mac_id&0xFF)) | ((psta->rssi_stat.UndecoratedSmoothedPWDB&0x7F)<<16) |(STBC_TX << 25) | (FirstConnect << 29) | (TxBF_EN << 30)); + else + PWDB_rssi[sta_cnt++] = (psta->mac_id | (psta->rssi_stat.UndecoratedSmoothedPWDB<<16) ); + } + } + } + #else + _irqL irqL; + _list *plist, *phead; + struct sta_info *psta; + struct sta_priv *pstapriv = &Adapter->stapriv; + u8 bcast_addr[ETH_ALEN]= {0xff,0xff,0xff,0xff,0xff,0xff}; + + _enter_critical_bh(&pstapriv->sta_hash_lock, &irqL); + + for(i=0; i< NUM_STA; i++) + { + phead = &(pstapriv->sta_hash[i]); + plist = get_next(phead); + + while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) + { + psta = LIST_CONTAINOR(plist, struct sta_info, hash_list); + + plist = get_next(plist); + + if(_rtw_memcmp(psta->hwaddr, bcast_addr, ETH_ALEN) || + _rtw_memcmp(psta->hwaddr, myid(&Adapter->eeprompriv), ETH_ALEN)) + continue; + + if(psta->state & WIFI_ASOC_STATE) + { + + if(psta->rssi_stat.UndecoratedSmoothedPWDB < tmpEntryMinPWDB) + tmpEntryMinPWDB = psta->rssi_stat.UndecoratedSmoothedPWDB; + + if(psta->rssi_stat.UndecoratedSmoothedPWDB > tmpEntryMaxPWDB) + tmpEntryMaxPWDB = psta->rssi_stat.UndecoratedSmoothedPWDB; + + if(psta->rssi_stat.UndecoratedSmoothedPWDB != (-1)){ + //printk("%s==> mac_id(%d),rssi(%d)\n",__FUNCTION__,psta->mac_id,psta->rssi_stat.UndecoratedSmoothedPWDB); + #if(RTL8192D_SUPPORT==1) + PWDB_rssi[sta_cnt++] = (psta->mac_id | (psta->rssi_stat.UndecoratedSmoothedPWDB<<16) | ((Adapter->stapriv.asoc_sta_count+1) << 8)); + #else + PWDB_rssi[sta_cnt++] = (psta->mac_id | (psta->rssi_stat.UndecoratedSmoothedPWDB<<16) ); + #endif + } + } + + } + + } + + _exit_critical_bh(&pstapriv->sta_hash_lock, &irqL); + #endif + + //printk("%s==> sta_cnt(%d)\n",__FUNCTION__,sta_cnt); + + for(i=0; i< sta_cnt; i++) + { + if(PWDB_rssi[i] != (0)){ + if(pHalData->fw_ractrl == _TRUE)// Report every sta's RSSI to FW + { + #if(RTL8192D_SUPPORT==1) + if(pDM_Odm->SupportICType == ODM_RTL8192D){ + FillH2CCmd92D(Adapter, H2C_RSSI_REPORT, 3, (u8 *)(&PWDB_rssi[i])); + } + #endif + + #if((RTL8192C_SUPPORT==1)||(RTL8723A_SUPPORT==1)) + if((pDM_Odm->SupportICType == ODM_RTL8192C)||(pDM_Odm->SupportICType == ODM_RTL8723A)){ + rtl8192c_set_rssi_cmd(Adapter, (u8*)&PWDB_rssi[i]); + } + #endif + + #if((RTL8812A_SUPPORT==1)||(RTL8821A_SUPPORT==1)) + if((pDM_Odm->SupportICType == ODM_RTL8812)||(pDM_Odm->SupportICType == ODM_RTL8821)){ + PWDB_rssi[i] |= (UL_DL_STATE << 24); + rtl8812_set_rssi_cmd(Adapter, (u8 *)(&PWDB_rssi[i])); + } + #endif + #if(RTL8192E_SUPPORT==1) + if(pDM_Odm->SupportICType == ODM_RTL8192E){ + rtl8192e_set_rssi_cmd(Adapter, (u8 *)(&PWDB_rssi[i])); + } + #endif + #if(RTL8723B_SUPPORT==1) + if(pDM_Odm->SupportICType == ODM_RTL8723B){ + rtl8723b_set_rssi_cmd(Adapter, (u8 *)(&PWDB_rssi[i])); + } + #endif + + #if(RTL8188E_SUPPORT==1) + if(pDM_Odm->SupportICType == ODM_RTL8188E){ + rtl8188e_set_rssi_cmd(Adapter, (u8 *)(&PWDB_rssi[i])); + } + #endif + + } + else{ + #if((RTL8188E_SUPPORT==1)&&(RATE_ADAPTIVE_SUPPORT == 1)) + if(pDM_Odm->SupportICType == ODM_RTL8188E){ + ODM_RA_SetRSSI_8188E( + &(pHalData->odmpriv), (PWDB_rssi[i]&0xFF), (u8)((PWDB_rssi[i]>>16) & 0xFF)); + } + #endif + } + } + } + } + + + + if(tmpEntryMaxPWDB != 0) // If associated entry is found + { + pdmpriv->EntryMaxUndecoratedSmoothedPWDB = tmpEntryMaxPWDB; + } + else + { + pdmpriv->EntryMaxUndecoratedSmoothedPWDB = 0; + } + + if(tmpEntryMinPWDB != 0xff) // If associated entry is found + { + pdmpriv->EntryMinUndecoratedSmoothedPWDB = tmpEntryMinPWDB; + } + else + { + pdmpriv->EntryMinUndecoratedSmoothedPWDB = 0; + } + + FindMinimumRSSI(Adapter);//get pdmpriv->MinUndecoratedPWDBForDM + + #if(RTL8192D_SUPPORT==1) + FindMinimumRSSI_Dmsp(Adapter); + #endif + pDM_Odm->RSSI_Min = pdmpriv->MinUndecoratedPWDBForDM; + //ODM_CmnInfoUpdate(&pHalData->odmpriv ,ODM_CMNINFO_RSSI_MIN, pdmpriv->MinUndecoratedPWDBForDM); +#endif//if (DM_ODM_SUPPORT_TYPE == ODM_CE) +} + + +VOID +odm_RSSIMonitorCheckAP( + IN PVOID pDM_VOID + ) +{ +#if (DM_ODM_SUPPORT_TYPE == ODM_AP) +#if (RTL8812A_SUPPORT||RTL8881A_SUPPORT||RTL8192E_SUPPORT||RTL8814A_SUPPORT) + + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + u1Byte H2C_Parameter[4]={0}; + u4Byte i; + BOOLEAN bExtRAInfo = FALSE; + u1Byte cmdlen = 3 ; + u1Byte TxBF_EN = 0,stbc_en=0; + + prtl8192cd_priv priv = pDM_Odm->priv; + PSTA_INFO_T pstat; + BOOLEAN act_bfer=FALSE; + + #ifdef BEAMFORMING_SUPPORT + #if (defined(CONFIG_HW_ANTENNA_DIVERSITY)) + pBDC_T pDM_BdcTable = &pDM_Odm->DM_BdcTable; + pDM_BdcTable->num_Txbfee_Client=0; + pDM_BdcTable->num_Txbfer_Client=0; + #endif + #endif + + + if( priv->up_time % 2 ) + return; + + if(pDM_Odm->SupportICType & EXT_RA_INFO_SUPPORT_IC) + { + bExtRAInfo = TRUE; + cmdlen=4; + } + + for(i=0; ipODM_StaInfo[i]; + + if(IS_STA_VALID(pstat) ) + { + if(pstat->sta_in_firmware != 1) + continue; + + //2 BF_en + #ifdef BEAMFORMING_SUPPORT + BEAMFORMING_CAP Beamform_cap = Beamforming_GetEntryBeamCapByMacId(priv, pstat->aid); + + if(Beamform_cap == BEAMFORMER_CAP_HT_EXPLICIT || Beamform_cap == BEAMFORMER_CAP_VHT_SU || + Beamform_cap == (BEAMFORMER_CAP_HT_EXPLICIT|BEAMFORMEE_CAP_HT_EXPLICIT) || + Beamform_cap == (BEAMFORMER_CAP_VHT_SU|BEAMFORMEE_CAP_VHT_SU)) + { + TxBF_EN = 1; + act_bfer=TRUE; + } + + #if (defined(CONFIG_HW_ANTENNA_DIVERSITY)) //BDC + + if( act_bfer == TRUE ) + { + pDM_BdcTable->w_BFee_Client[i]=1; //AP act as BFer + pDM_BdcTable->num_Txbfee_Client++; + } + else + { + pDM_BdcTable->w_BFee_Client[i]=0; //AP act as BFer + } + + if((Beamform_cap & BEAMFORMEE_CAP_HT_EXPLICIT) || (Beamform_cap & BEAMFORMEE_CAP_VHT_SU) ) + { + pDM_BdcTable->w_BFer_Client[i]=1; //AP act as BFee + pDM_BdcTable->num_Txbfer_Client++; + } + else + { + pDM_BdcTable->w_BFer_Client[i]=0; //AP act as BFer + } + #endif + #endif + + //2 STBC_en + if ((priv->pmib->dot11nConfigEntry.dot11nSTBC) && + ( (pstat->ht_cap_buf.ht_cap_info & cpu_to_le16(_HTCAP_RX_STBC_CAP_)) + #ifdef RTK_AC_SUPPORT + || (pstat->vht_cap_buf.vht_cap_info & cpu_to_le32(_VHTCAP_RX_STBC_CAP_)) + #endif + )) + { + stbc_en=1; + } + + //2 RAINFO + + if(bExtRAInfo) + { + if( (pstat->rx_avarage) > ((pstat->tx_avarage)*6) ) + H2C_Parameter[3]|=RAINFO_BE_RX_STATE; + + if(TxBF_EN) + H2C_Parameter[3] |= RAINFO_BF_STATE; + else + { + if (stbc_en) + H2C_Parameter[3] |= RAINFO_STBC_STATE; + } + + if(pDM_Odm->H2C_RARpt_connect) + H2C_Parameter[3] |= RAINFO_INIT_RSSI_RATE_STATE; + + //ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, ("[RAINFO] H2C_Para[3] = %x, \n",H2C_Parameter[3])); + } + + H2C_Parameter[2] = (u1Byte)(pstat->rssi & 0xFF); + H2C_Parameter[0] = REMAP_AID(pstat); + + //ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, ("[RSSI] H2C_Para[2] = %x, \n",H2C_Parameter[2])); + //ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, ("[MACID] H2C_Para[0] = %x, \n",H2C_Parameter[0])); + + ODM_FillH2CCmd(pDM_Odm, ODM_H2C_RSSI_REPORT, cmdlen, H2C_Parameter); + + } + } + +#endif +#endif + +} + + +VOID +odm_RateAdaptiveMaskInit( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PODM_RATE_ADAPTIVE pOdmRA = &pDM_Odm->RateAdaptive; + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + PMGNT_INFO pMgntInfo = &pDM_Odm->Adapter->MgntInfo; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pDM_Odm->Adapter); + + pMgntInfo->Ratr_State = DM_RATR_STA_INIT; + + if (pMgntInfo->DM_Type == DM_Type_ByDriver) + pHalData->bUseRAMask = TRUE; + else + pHalData->bUseRAMask = FALSE; + +#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) + pOdmRA->Type = DM_Type_ByDriver; + if (pOdmRA->Type == DM_Type_ByDriver) + pDM_Odm->bUseRAMask = _TRUE; + else + pDM_Odm->bUseRAMask = _FALSE; +#endif + + pOdmRA->RATRState = DM_RATR_STA_INIT; + +#if(DM_ODM_SUPPORT_TYPE & ODM_WIN) + if(pDM_Odm->SupportICType == ODM_RTL8812) + pOdmRA->LdpcThres = 50; + else + pOdmRA->LdpcThres = 35; + + pOdmRA->RtsThres = 35; + +#elif(DM_ODM_SUPPORT_TYPE & ODM_CE) + pOdmRA->LdpcThres = 35; + pOdmRA->bUseLdpc = FALSE; + +#else + pOdmRA->UltraLowRSSIThresh = 9; + +#endif + + pOdmRA->HighRSSIThresh = 50; + pOdmRA->LowRSSIThresh = 20; +} +/*----------------------------------------------------------------------------- + * Function: odm_RefreshRateAdaptiveMask() + * + * Overview: Update rate table mask according to rssi + * + * Input: NONE + * + * Output: NONE + * + * Return: NONE + * + * Revised History: + * When Who Remark + * 05/27/2009 hpfan Create Version 0. + * + *---------------------------------------------------------------------------*/ +VOID +odm_RefreshRateAdaptiveMask( + IN PVOID pDM_VOID + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_TRACE, ("odm_RefreshRateAdaptiveMask()---------->\n")); + if (!(pDM_Odm->SupportAbility & ODM_BB_RA_MASK)) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_TRACE, ("odm_RefreshRateAdaptiveMask(): Return cos not supported\n")); + return; + } + // + // 2011/09/29 MH In HW integration first stage, we provide 4 different handle to operate + // at the same time. In the stage2/3, we need to prive universal interface and merge all + // HW dynamic mechanism. + // + switch (pDM_Odm->SupportPlatform) + { + case ODM_WIN: + odm_RefreshRateAdaptiveMaskMP(pDM_Odm); + break; + + case ODM_CE: + odm_RefreshRateAdaptiveMaskCE(pDM_Odm); + break; + + case ODM_AP: + case ODM_ADSL: + odm_RefreshRateAdaptiveMaskAPADSL(pDM_Odm); + break; + } + +} + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) +VOID +odm_RefreshLdpcRtsMP( + IN PADAPTER pAdapter, + IN PDM_ODM_T pDM_Odm, + IN u1Byte mMacId, + IN u1Byte IOTPeer, + IN s4Byte UndecoratedSmoothedPWDB + ) +{ + BOOLEAN bCtlLdpc = FALSE; + PMGNT_INFO pMgntInfo = GetDefaultMgntInfo(pAdapter); + PODM_RATE_ADAPTIVE pRA = &pDM_Odm->RateAdaptive; + + if(pDM_Odm->SupportICType != ODM_RTL8821 && pDM_Odm->SupportICType != ODM_RTL8812) + return; + + if((pDM_Odm->SupportICType == ODM_RTL8821) && (pDM_Odm->CutVersion == ODM_CUT_A)) + bCtlLdpc = TRUE; + else if( pDM_Odm->SupportICType == ODM_RTL8812 && + IOTPeer == HT_IOT_PEER_REALTEK_JAGUAR_CCUTAP) + bCtlLdpc = TRUE; + + if(bCtlLdpc) + { + if(UndecoratedSmoothedPWDB < (pRA->LdpcThres-5)) + MgntSet_TX_LDPC(pAdapter, mMacId, TRUE); + else if(UndecoratedSmoothedPWDB > pRA->LdpcThres) + MgntSet_TX_LDPC(pAdapter, mMacId, FALSE); + } + + if(UndecoratedSmoothedPWDB < (pRA->RtsThres-5)) + pRA->bLowerRtsRate = TRUE; + else if(UndecoratedSmoothedPWDB > pRA->RtsThres) + pRA->bLowerRtsRate = FALSE; +} +#endif + + +VOID +odm_RefreshRateAdaptiveMaskMP( + IN PVOID pDM_VOID + ) +{ +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PADAPTER pAdapter = pDM_Odm->Adapter; + PADAPTER pTargetAdapter = NULL; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); + PMGNT_INFO pMgntInfo = GetDefaultMgntInfo(pAdapter); + + if(pAdapter->bDriverStopped) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_TRACE, ("<---- odm_RefreshRateAdaptiveMask(): driver is going to unload\n")); + return; + } + + if(!pHalData->bUseRAMask) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("<---- odm_RefreshRateAdaptiveMask(): driver does not control rate adaptive mask\n")); + return; + } + + // if default port is connected, update RA table for default port (infrastructure mode only) + if(pMgntInfo->mAssoc && (!ACTING_AS_AP(pAdapter))) + { + odm_RefreshLdpcRtsMP(pAdapter, pDM_Odm, pMgntInfo->mMacId, pMgntInfo->IOTPeer, pHalData->UndecoratedSmoothedPWDB); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("odm_RefreshRateAdaptiveMask(): Infrasture Mode\n")); + if( ODM_RAStateCheck(pDM_Odm, pHalData->UndecoratedSmoothedPWDB, pMgntInfo->bSetTXPowerTrainingByOid, &pMgntInfo->Ratr_State) ) + { + ODM_PRINT_ADDR(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("Target AP addr : "), pMgntInfo->Bssid); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("RSSI:%d, RSSI_LEVEL:%d\n", pHalData->UndecoratedSmoothedPWDB, pMgntInfo->Ratr_State)); + pAdapter->HalFunc.UpdateHalRAMaskHandler(pAdapter, pMgntInfo->mMacId, NULL, pMgntInfo->Ratr_State); + } + else if(pDM_Odm->bChangeState) + { + ODM_PRINT_ADDR(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("Target AP addr : "), pMgntInfo->Bssid); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("Change Power Training State, bDisablePowerTraining = %d\n", pDM_Odm->bDisablePowerTraining)); + pAdapter->HalFunc.UpdateHalRAMaskHandler(pAdapter, pMgntInfo->mMacId, NULL, pMgntInfo->Ratr_State); + } + } + + // + // The following part configure AP/VWifi/IBSS rate adaptive mask. + // + + if(pMgntInfo->mIbss) // Target: AP/IBSS peer. + pTargetAdapter = GetDefaultAdapter(pAdapter); + else + pTargetAdapter = GetFirstAPAdapter(pAdapter); + + // if extension port (softap) is started, updaet RA table for more than one clients associate + if(pTargetAdapter != NULL) + { + int i; + PRT_WLAN_STA pEntry; + + for(i = 0; i < ODM_ASSOCIATE_ENTRY_NUM; i++) + { + pEntry = AsocEntry_EnumStation(pTargetAdapter, i); + if(NULL != pEntry) + { + if(pEntry->bAssociated) + { + odm_RefreshLdpcRtsMP(pAdapter, pDM_Odm, pEntry->AssociatedMacId, pEntry->IOTPeer, pEntry->rssi_stat.UndecoratedSmoothedPWDB); + + if(ODM_RAStateCheck(pDM_Odm, pEntry->rssi_stat.UndecoratedSmoothedPWDB, pMgntInfo->bSetTXPowerTrainingByOid, &pEntry->Ratr_State) ) + { + ODM_PRINT_ADDR(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("Target STA addr : "), pEntry->MacAddr); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("RSSI:%d, RSSI_LEVEL:%d\n", pEntry->rssi_stat.UndecoratedSmoothedPWDB, pEntry->Ratr_State)); + pAdapter->HalFunc.UpdateHalRAMaskHandler(pTargetAdapter, pEntry->AssociatedMacId, pEntry, pEntry->Ratr_State); + } + else if(pDM_Odm->bChangeState) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("Change Power Training State, bDisablePowerTraining = %d\n", pDM_Odm->bDisablePowerTraining)); + pAdapter->HalFunc.UpdateHalRAMaskHandler(pAdapter, pMgntInfo->mMacId, NULL, pMgntInfo->Ratr_State); + } + } + } + } + } + + if(pMgntInfo->bSetTXPowerTrainingByOid) + pMgntInfo->bSetTXPowerTrainingByOid = FALSE; +#endif // #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) +} + + +VOID +odm_RefreshRateAdaptiveMaskCE( + IN PVOID pDM_VOID + ) +{ +#if (DM_ODM_SUPPORT_TYPE == ODM_CE) + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + u1Byte i; + PADAPTER pAdapter = pDM_Odm->Adapter; + PODM_RATE_ADAPTIVE pRA = &pDM_Odm->RateAdaptive; + + if(pAdapter->bDriverStopped) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_TRACE, ("<---- odm_RefreshRateAdaptiveMask(): driver is going to unload\n")); + return; + } + + if(!pDM_Odm->bUseRAMask) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("<---- odm_RefreshRateAdaptiveMask(): driver does not control rate adaptive mask\n")); + return; + } + + //printk("==> %s \n",__FUNCTION__); + + for(i=0; ipODM_StaInfo[i]; + if(IS_STA_VALID(pstat) ) { + if(IS_MCAST( pstat->hwaddr)) //if(psta->mac_id ==1) + continue; + if(IS_MCAST( pstat->hwaddr)) + continue; + + #if((RTL8812A_SUPPORT==1)||(RTL8821A_SUPPORT==1)) + if((pDM_Odm->SupportICType == ODM_RTL8812)||(pDM_Odm->SupportICType == ODM_RTL8821)) + { + if(pstat->rssi_stat.UndecoratedSmoothedPWDB < pRA->LdpcThres) + { + pRA->bUseLdpc = TRUE; + pRA->bLowerRtsRate = TRUE; + if((pDM_Odm->SupportICType == ODM_RTL8821) && (pDM_Odm->CutVersion == ODM_CUT_A)) + Set_RA_LDPC_8812(pstat, TRUE); + //DbgPrint("RSSI=%d, bUseLdpc = TRUE\n", pHalData->UndecoratedSmoothedPWDB); + } + else if(pstat->rssi_stat.UndecoratedSmoothedPWDB > (pRA->LdpcThres-5)) + { + pRA->bUseLdpc = FALSE; + pRA->bLowerRtsRate = FALSE; + if((pDM_Odm->SupportICType == ODM_RTL8821) && (pDM_Odm->CutVersion == ODM_CUT_A)) + Set_RA_LDPC_8812(pstat, FALSE); + //DbgPrint("RSSI=%d, bUseLdpc = FALSE\n", pHalData->UndecoratedSmoothedPWDB); + } + } + #endif + + if( TRUE == ODM_RAStateCheck(pDM_Odm, pstat->rssi_stat.UndecoratedSmoothedPWDB, FALSE , &pstat->rssi_level) ) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("RSSI:%d, RSSI_LEVEL:%d\n", pstat->rssi_stat.UndecoratedSmoothedPWDB, pstat->rssi_level)); + //printk("RSSI:%d, RSSI_LEVEL:%d\n", pstat->rssi_stat.UndecoratedSmoothedPWDB, pstat->rssi_level); + rtw_hal_update_ra_mask(pstat, pstat->rssi_level); + } + else if(pDM_Odm->bChangeState) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("Change Power Training State, bDisablePowerTraining = %d\n", pDM_Odm->bDisablePowerTraining)); + rtw_hal_update_ra_mask(pstat, pstat->rssi_level); + } + + } + } + +#endif +} + +VOID +odm_RefreshRateAdaptiveMaskAPADSL( + IN PVOID pDM_VOID + ) +{ +#if (DM_ODM_SUPPORT_TYPE & ODM_AP) + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + struct rtl8192cd_priv *priv = pDM_Odm->priv; + struct aid_obj *aidarray; + u4Byte i; + PSTA_INFO_T pstat; + + if(priv->up_time % 2) + return; + + for(i=0; ipODM_StaInfo[i]; + + if(IS_STA_VALID(pstat) ) + { +#if defined(UNIVERSAL_REPEATER) || defined(MBSSID) + aidarray = container_of(pstat, struct aid_obj, station); + priv = aidarray->priv; +#endif + + if (!priv->pmib->dot11StationConfigEntry.autoRate) + continue; + + if(ODM_RAStateCheck(pDM_Odm, (s4Byte)pstat->rssi, FALSE, &pstat->rssi_level) ) { + ODM_PRINT_ADDR(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("Target STA addr : "), pstat->hwaddr); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("RSSI:%d, RSSI_LEVEL:%d\n", pstat->rssi, pstat->rssi_level)); + +#if defined(CONFIG_PCI_HCI) +#ifdef CONFIG_WLAN_HAL + if (IS_HAL_CHIP(priv)) { +#ifdef WDS +// if(!(pstat->state & WIFI_WDS))//if WDS donot setting +#endif + GET_HAL_INTERFACE(priv)->UpdateHalRAMaskHandler(priv, pstat, pstat->rssi_level); + } else +#endif +#ifdef CONFIG_RTL_8812_SUPPORT + if(GET_CHIP_VER(priv)== VERSION_8812E) { + UpdateHalRAMask8812(priv, pstat, 3); + } else +#endif +#ifdef CONFIG_RTL_88E_SUPPORT + if (GET_CHIP_VER(priv)==VERSION_8188E) { +#ifdef TXREPORT + add_RATid(priv, pstat); +#endif + } else +#endif + { +#if defined(CONFIG_RTL_92D_SUPPORT) || defined(CONFIG_RTL_92C_SUPPORT) + add_update_RATid(priv, pstat); +#endif + } +#elif defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) + update_STA_RATid(priv, pstat); +#endif + } + } + } +#endif +} + + +// Return Value: BOOLEAN +// - TRUE: RATRState is changed. +BOOLEAN +ODM_RAStateCheck( + IN PVOID pDM_VOID, + IN s4Byte RSSI, + IN BOOLEAN bForceUpdate, + OUT pu1Byte pRATRState + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PODM_RATE_ADAPTIVE pRA = &pDM_Odm->RateAdaptive; + const u1Byte GoUpGap = 5; + u1Byte HighRSSIThreshForRA = pRA->HighRSSIThresh; + u1Byte LowRSSIThreshForRA = pRA->LowRSSIThresh; + u1Byte RATRState; + + // Threshold Adjustment: + // when RSSI state trends to go up one or two levels, make sure RSSI is high enough. + // Here GoUpGap is added to solve the boundary's level alternation issue. +#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) + u1Byte UltraLowRSSIThreshForRA = pRA->UltraLowRSSIThresh; + if(pDM_Odm->SupportICType == ODM_RTL8881A) + LowRSSIThreshForRA = 30; // for LDPC / BCC switch +#endif + + switch (*pRATRState) + { + case DM_RATR_STA_INIT: + case DM_RATR_STA_HIGH: + break; + + case DM_RATR_STA_MIDDLE: + HighRSSIThreshForRA += GoUpGap; + break; + + case DM_RATR_STA_LOW: + HighRSSIThreshForRA += GoUpGap; + LowRSSIThreshForRA += GoUpGap; + break; + +#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) + case DM_RATR_STA_ULTRA_LOW: + HighRSSIThreshForRA += GoUpGap; + LowRSSIThreshForRA += GoUpGap; + UltraLowRSSIThreshForRA += GoUpGap; + break; +#endif + + default: + ODM_RT_ASSERT(pDM_Odm, FALSE, ("wrong rssi level setting %d !", *pRATRState) ); + break; + } + + // Decide RATRState by RSSI. + if(RSSI > HighRSSIThreshForRA) + RATRState = DM_RATR_STA_HIGH; + else if(RSSI > LowRSSIThreshForRA) + RATRState = DM_RATR_STA_MIDDLE; + +#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) + else if(RSSI > UltraLowRSSIThreshForRA) + RATRState = DM_RATR_STA_LOW; + else + RATRState = DM_RATR_STA_ULTRA_LOW; +#else + else + RATRState = DM_RATR_STA_LOW; +#endif + //printk("==>%s,RATRState:0x%02x ,RSSI:%d \n",__FUNCTION__,RATRState,RSSI); + + if( *pRATRState!=RATRState || bForceUpdate) + { + ODM_RT_TRACE( pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("RSSI Level %d -> %d\n", *pRATRState, RATRState) ); + *pRATRState = RATRState; + return TRUE; + } + + return FALSE; +} + +VOID +odm_RefreshBasicRateMask( + IN PVOID pDM_VOID + ) +{ +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PADAPTER Adapter = pDM_Odm->Adapter; + static u1Byte Stage = 0; + u1Byte CurStage = 0; + OCTET_STRING osRateSet; + PMGNT_INFO pMgntInfo = GetDefaultMgntInfo(Adapter); + u1Byte RateSet[5] = {MGN_1M, MGN_2M, MGN_5_5M, MGN_11M, MGN_6M}; + + if(pDM_Odm->SupportICType != ODM_RTL8812 && pDM_Odm->SupportICType != ODM_RTL8821 ) + return; + + if(pDM_Odm->bLinked == FALSE) // unlink Default port information + CurStage = 0; + else if(pDM_Odm->RSSI_Min < 40) // link RSSI < 40% + CurStage = 1; + else if(pDM_Odm->RSSI_Min > 45) // link RSSI > 45% + CurStage = 3; + else + CurStage = 2; // link 25% <= RSSI <= 30% + + if(CurStage != Stage) + { + if(CurStage == 1) + { + FillOctetString(osRateSet, RateSet, 5); + FilterSupportRate(pMgntInfo->mBrates, &osRateSet, FALSE); + Adapter->HalFunc.SetHwRegHandler(Adapter, HW_VAR_BASIC_RATE, (pu1Byte)&osRateSet); + } + else if(CurStage == 3 && (Stage == 1 || Stage == 2)) + { + Adapter->HalFunc.SetHwRegHandler( Adapter, HW_VAR_BASIC_RATE, (pu1Byte)(&pMgntInfo->mBrates) ); + } + } + + Stage = CurStage; +#endif +} + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) +VOID +ODM_DynamicARFBSelect( + IN PVOID pDM_VOID, + IN u1Byte rate, + IN BOOLEAN Collision_State +) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + pRA_T pRA_Table = &pDM_Odm->DM_RA_Table; + + if(pDM_Odm->SupportICType != ODM_RTL8192E) + return; + + if(Collision_State == pRA_Table->PT_collision_pre) + return; + + if (rate >= DESC_RATEMCS8 && rate <= DESC_RATEMCS12){ + if (Collision_State == 1){ + if(rate == DESC_RATEMCS12){ + + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x0); + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x07060501); + } + else if(rate == DESC_RATEMCS11){ + + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x0); + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x07070605); + } + else if(rate == DESC_RATEMCS10){ + + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x0); + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x08080706); + } + else if(rate == DESC_RATEMCS9){ + + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x0); + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x08080707); + } + else{ + + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x0); + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x09090808); + } + } + else{ // Collision_State == 0 + if(rate == DESC_RATEMCS12){ + + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x05010000); + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x09080706); + } + else if(rate == DESC_RATEMCS11){ + + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x06050000); + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x09080807); + } + else if(rate == DESC_RATEMCS10){ + + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x07060000); + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x0a090908); + } + else if(rate == DESC_RATEMCS9){ + + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x07070000); + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x0a090808); + } + else{ + + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x08080000); + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x0b0a0909); + } + } + } + else{ // MCS13~MCS15, 1SS, G-mode + if (Collision_State == 1){ + if(rate == DESC_RATEMCS15){ + + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x00000000); + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x05040302); + } + else if(rate == DESC_RATEMCS14){ + + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x00000000); + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x06050302); + } + else if(rate == DESC_RATEMCS13){ + + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x00000000); + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x07060502); + } + else{ + + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x00000000); + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x06050402); + } + } + else{ // Collision_State == 0 + if(rate == DESC_RATEMCS15){ + + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x03020000); + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x07060504); + } + else if(rate == DESC_RATEMCS14){ + + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x03020000); + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x08070605); + } + else if(rate == DESC_RATEMCS13){ + + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x05020000); + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x09080706); + } + else{ + + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E, 0x04020000); + ODM_Write4Byte(pDM_Odm, REG_DARFRC_8192E+4, 0x08070605); + } + + + } + + } + pRA_Table->PT_collision_pre = Collision_State; +} + +VOID +ODM_RateAdaptiveStateApInit( + IN PVOID PADAPTER_VOID, + IN PRT_WLAN_STA pEntry + ) +{ + PADAPTER Adapter = (PADAPTER)PADAPTER_VOID; + pEntry->Ratr_State = DM_RATR_STA_INIT; +} +#endif //#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + + +#if (DM_ODM_SUPPORT_TYPE == ODM_CE) +u4Byte +ODM_Get_Rate_Bitmap( + IN PVOID pDM_VOID, + IN u4Byte macid, + IN u4Byte ra_mask, + IN u1Byte rssi_level + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PSTA_INFO_T pEntry; + u4Byte rate_bitmap = 0; + u1Byte WirelessMode; + //u1Byte WirelessMode =*(pDM_Odm->pWirelessMode); + + + pEntry = pDM_Odm->pODM_StaInfo[macid]; + if(!IS_STA_VALID(pEntry)) + return ra_mask; + + WirelessMode = pEntry->wireless_mode; + + switch(WirelessMode) + { + case ODM_WM_B: + if(ra_mask & 0x0000000c) //11M or 5.5M enable + rate_bitmap = 0x0000000d; + else + rate_bitmap = 0x0000000f; + break; + + case (ODM_WM_G): + case (ODM_WM_A): + if(rssi_level == DM_RATR_STA_HIGH) + rate_bitmap = 0x00000f00; + else + rate_bitmap = 0x00000ff0; + break; + + case (ODM_WM_B|ODM_WM_G): + if(rssi_level == DM_RATR_STA_HIGH) + rate_bitmap = 0x00000f00; + else if(rssi_level == DM_RATR_STA_MIDDLE) + rate_bitmap = 0x00000ff0; + else + rate_bitmap = 0x00000ff5; + break; + + case (ODM_WM_B|ODM_WM_G|ODM_WM_N24G) : + case (ODM_WM_B|ODM_WM_N24G) : + case (ODM_WM_G|ODM_WM_N24G) : + case (ODM_WM_A|ODM_WM_N5G) : + { + if ( pDM_Odm->RFType == ODM_1T2R ||pDM_Odm->RFType == ODM_1T1R) + { + if(rssi_level == DM_RATR_STA_HIGH) + { + rate_bitmap = 0x000f0000; + } + else if(rssi_level == DM_RATR_STA_MIDDLE) + { + rate_bitmap = 0x000ff000; + } + else{ + if (*(pDM_Odm->pBandWidth) == ODM_BW40M) + rate_bitmap = 0x000ff015; + else + rate_bitmap = 0x000ff005; + } + } + else + { + if(rssi_level == DM_RATR_STA_HIGH) + { + rate_bitmap = 0x0f8f0000; + } + else if(rssi_level == DM_RATR_STA_MIDDLE) + { + rate_bitmap = 0x0f8ff000; + } + else + { + if (*(pDM_Odm->pBandWidth) == ODM_BW40M) + rate_bitmap = 0x0f8ff015; + else + rate_bitmap = 0x0f8ff005; + } + } + } + break; + + case (ODM_WM_AC|ODM_WM_G): + if(rssi_level == 1) + rate_bitmap = 0xfc3f0000; + else if(rssi_level == 2) + rate_bitmap = 0xfffff000; + else + rate_bitmap = 0xffffffff; + break; + + case (ODM_WM_AC|ODM_WM_A): + + if (pDM_Odm->RFType == RF_1T1R) + { + if(rssi_level == 1) // add by Gary for ac-series + rate_bitmap = 0x003f8000; + else if (rssi_level == 2) + rate_bitmap = 0x003ff000; + else + rate_bitmap = 0x003ff010; + } + else + { + if(rssi_level == 1) // add by Gary for ac-series + rate_bitmap = 0xfe3f8000; // VHT 2SS MCS3~9 + else if (rssi_level == 2) + rate_bitmap = 0xfffff000; // VHT 2SS MCS0~9 + else + rate_bitmap = 0xfffff010; // All + } + break; + + default: + if(pDM_Odm->RFType == RF_1T2R) + rate_bitmap = 0x000fffff; + else + rate_bitmap = 0x0fffffff; + break; + + } + + //printk("%s ==> rssi_level:0x%02x, WirelessMode:0x%02x, rate_bitmap:0x%08x \n",__FUNCTION__,rssi_level,WirelessMode,rate_bitmap); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, (" ==> rssi_level:0x%02x, WirelessMode:0x%02x, rate_bitmap:0x%08x \n",rssi_level,WirelessMode,rate_bitmap)); + + return (ra_mask&rate_bitmap); + +} + +#endif //#if (DM_ODM_SUPPORT_TYPE == ODM_CE) diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_RaInfo.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_RaInfo.h new file mode 100644 index 00000000000000..f0435073dc7270 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_RaInfo.h @@ -0,0 +1,328 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +#ifndef __PHYDMRAINFO_H__ +#define __PHYDMRAINFO_H__ + +#define RAINFO_VERSION "2.0" //2014.11.04 + + + +#define RAINFO_BE_RX_STATE BIT0 // 1:RX //ULDL +#define RAINFO_STBC_STATE BIT1 +#define RAINFO_LDPC_STATE BIT2 +#define RAINFO_SHURTCUT_STATE BIT3 +#define RAINFO_SHURTCUT_FLAG BIT4 +#define RAINFO_INIT_RSSI_RATE_STATE BIT5 +#define RAINFO_BF_STATE BIT6 +#define RAINFO_BE_TX_STATE BIT7 // 1:TX + + + +#if(DM_ODM_SUPPORT_TYPE == ODM_AP) +#define EXT_RA_INFO_SUPPORT_IC (ODM_RTL8881A |ODM_RTL8192E |ODM_RTL8812 |ODM_RTL8814A|ODM_RTL8822B) +#define RA_FIRST_MACID 1 +#elif(DM_ODM_SUPPORT_TYPE == ODM_WIN) +#define EXT_RA_INFO_SUPPORT_IC (ODM_RTL8192E|ODM_RTL8812|ODM_RTL8821|ODM_RTL8723B|ODM_RTL8814A|ODM_RTL8822B) +#define RA_FIRST_MACID 0 +#elif(DM_ODM_SUPPORT_TYPE == ODM_CE) +//#define EXT_RA_INFO_SUPPORT_IC (ODM_RTL8192E|ODM_RTL8812|ODM_RTL8821|ODM_RTL8723B|ODM_RTL8814A|ODM_RTL8822B) +#define RA_FIRST_MACID 0 +#endif + + +#define AP_InitRateAdaptiveState ODM_RateAdaptiveStateApInit + +#define DM_RATR_STA_INIT 0 +#define DM_RATR_STA_HIGH 1 +#define DM_RATR_STA_MIDDLE 2 +#define DM_RATR_STA_LOW 3 +#if(DM_ODM_SUPPORT_TYPE & ODM_AP) +#define DM_RATR_STA_ULTRA_LOW 4 +#endif + +#if (defined(CONFIG_RA_DBG_CMD)) +typedef enum _Phydm_ra_dbg_para +{ + RADBG_RTY_PENALTY = 1, //u8 + RADBG_N_HIGH = 2, + RADBG_N_LOW = 3, + RADBG_TRATE_UP_TABLE = 4, + RADBG_TRATE_DOWN_TABLE = 5, + RADBG_TRYING_NECESSARY = 6, + RADBG_TDROPING_NECESSARY = 7, + RADBG_RATE_UP_RTY_RATIO = 8, //u8 + RADBG_RATE_DOWN_RTY_RATIO= 9, //u8 + NUM_RA_PARA +}PHYDM_RA_DBG_PARA_E; +#endif + +#if (RATE_ADAPTIVE_SUPPORT == 1)//88E RA +typedef struct _ODM_RA_Info_ +{ + u1Byte RateID; + u4Byte RateMask; + u4Byte RAUseRate; + u1Byte RateSGI; + u1Byte RssiStaRA; + u1Byte PreRssiStaRA; + u1Byte SGIEnable; + u1Byte DecisionRate; + u1Byte PreRate; + u1Byte HighestRate; + u1Byte LowestRate; + u4Byte NscUp; + u4Byte NscDown; + u2Byte RTY[5]; + u4Byte TOTAL; + u2Byte DROP; + u1Byte Active; + u2Byte RptTime; + u1Byte RAWaitingCounter; + u1Byte RAPendingCounter; +#if 1 //POWER_TRAINING_ACTIVE == 1 // For compile pass only~! + u1Byte PTActive; // on or off + u1Byte PTTryState; // 0 trying state, 1 for decision state + u1Byte PTStage; // 0~6 + u1Byte PTStopCount; //Stop PT counter + u1Byte PTPreRate; // if rate change do PT + u1Byte PTPreRssi; // if RSSI change 5% do PT + u1Byte PTModeSS; // decide whitch rate should do PT + u1Byte RAstage; // StageRA, decide how many times RA will be done between PT + u1Byte PTSmoothFactor; +#endif +} ODM_RA_INFO_T,*PODM_RA_INFO_T; +#endif + + +typedef struct _Rate_Adaptive_Table_{ + u1Byte firstconnect; + #if(DM_ODM_SUPPORT_TYPE==ODM_WIN) + BOOLEAN PT_collision_pre; + #endif + + #if (defined(CONFIG_RA_DBG_CMD)) + BOOLEAN is_ra_dbg_init; + + u1Byte RTY_P[ODM_NUM_RATE_IDX+1];//retry penalty + u1Byte RTY_P_default[ODM_NUM_RATE_IDX+1];//retry penalty + BOOLEAN RTY_P_modify_note[ODM_NUM_RATE_IDX+1]; + + u1Byte RATE_UP_RTY_RATIO[ODM_NUM_RATE_IDX+1];//retry penalty + u1Byte RATE_UP_RTY_RATIO_default[ODM_NUM_RATE_IDX+1];//retry penalty + BOOLEAN RATE_UP_RTY_RATIO_modify_note[ODM_NUM_RATE_IDX+1]; + + u1Byte RATE_DOWN_RTY_RATIO[ODM_NUM_RATE_IDX+1];//retry penalty + u1Byte RATE_DOWN_RTY_RATIO_default[ODM_NUM_RATE_IDX+1];//retry penalty + BOOLEAN RATE_DOWN_RTY_RATIO_modify_note[ODM_NUM_RATE_IDX+1]; + + BOOLEAN RA_Para_feedback_req; + + u1Byte para_idx; + u1Byte rate_idx; + u1Byte value; + u2Byte value_16; + u1Byte rate_length; + #endif + + +}RA_T, *pRA_T; + +typedef struct _ODM_RATE_ADAPTIVE +{ + u1Byte Type; // DM_Type_ByFW/DM_Type_ByDriver + u1Byte HighRSSIThresh; // if RSSI > HighRSSIThresh => RATRState is DM_RATR_STA_HIGH + u1Byte LowRSSIThresh; // if RSSI <= LowRSSIThresh => RATRState is DM_RATR_STA_LOW + u1Byte RATRState; // Current RSSI level, DM_RATR_STA_HIGH/DM_RATR_STA_MIDDLE/DM_RATR_STA_LOW + + #if(DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) + u1Byte LdpcThres; // if RSSI > LdpcThres => switch from LPDC to BCC + BOOLEAN bLowerRtsRate; + #endif + + #if(DM_ODM_SUPPORT_TYPE & ODM_WIN) + u1Byte RtsThres; + #elif(DM_ODM_SUPPORT_TYPE & ODM_CE) + BOOLEAN bUseLdpc; + #else + u1Byte UltraLowRSSIThresh; + u4Byte LastRATR; // RATR Register Content + #endif + +} ODM_RATE_ADAPTIVE, *PODM_RATE_ADAPTIVE; + +VOID +ODM_C2HRaParaReportHandler( + IN PVOID pDM_VOID, + IN pu1Byte CmdBuf, + IN u1Byte CmdLen +); + +VOID +odm_RA_ParaAdjust_Send_H2C( + IN PVOID pDM_VOID + ); + +VOID +odm_RA_debug( + IN PVOID pDM_VOID, + IN u4Byte *const dm_value + ); + +VOID +odm_RA_ParaAdjust_init( + IN PVOID pDM_VOID + ); + +VOID +odm_RA_ParaAdjust( + IN PVOID pDM_VOID + ); + +u1Byte +odm_Find_RTS_Rate( + IN PVOID pDM_VOID, + IN u1Byte Tx_Rate, + IN BOOLEAN bErpProtect + ); + +VOID +ODM_UpdateNoisyState( + IN PVOID pDM_VOID, + IN BOOLEAN bNoisyStateFromC2H +); + +u4Byte +Set_RA_DM_Ratrbitmap_by_Noisy( + IN PVOID pDM_VOID, + IN WIRELESS_MODE WirelessMode, + IN u4Byte ratr_bitmap, + IN u1Byte rssi_level +); + +VOID +ODM_UpdateInitRate( + IN PVOID pDM_VOID, + IN u1Byte Rate + ); + +VOID +odm_RSSIMonitorInit( + IN PVOID pDM_VOID + ); + +VOID +odm_RSSIMonitorCheck( + IN PVOID pDM_VOID + ); + +#if(DM_ODM_SUPPORT_TYPE==ODM_WIN) +VOID +odm_RSSIDumpToRegister( + IN PVOID pDM_VOID + ); +#endif + +VOID +odm_RSSIMonitorCheckMP( + IN PVOID pDM_VOID + ); + +VOID +odm_RSSIMonitorCheckCE( + IN PVOID pDM_VOID + ); + +VOID +odm_RSSIMonitorCheckAP( + IN PVOID pDM_VOID + ); + + +VOID +odm_RateAdaptiveMaskInit( + IN PVOID pDM_VOID + ); + +VOID +odm_RefreshRateAdaptiveMask( + IN PVOID pDM_VOID + ); + +VOID +odm_RefreshRateAdaptiveMaskMP( + IN PVOID pDM_VOID + ); + +VOID +odm_RefreshRateAdaptiveMaskCE( + IN PVOID pDM_VOID + ); + +VOID +odm_RefreshRateAdaptiveMaskAPADSL( + IN PVOID pDM_VOID + ); + +BOOLEAN +ODM_RAStateCheck( + IN PVOID pDM_VOID, + IN s4Byte RSSI, + IN BOOLEAN bForceUpdate, + OUT pu1Byte pRATRState + ); + +VOID +odm_RefreshBasicRateMask( + IN PVOID pDM_VOID + ); +VOID +ODM_RAPostActionOnAssoc( + IN PVOID pDM_VOID + ); + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) +VOID +ODM_DynamicARFBSelect( + IN PVOID pDM_VOID, + IN u1Byte rate, + IN BOOLEAN Collision_State + ); + +VOID +ODM_RateAdaptiveStateApInit( + IN PVOID PADAPTER_VOID, + IN PRT_WLAN_STA pEntry + ); +#endif + +#if (DM_ODM_SUPPORT_TYPE == ODM_CE) +u4Byte +ODM_Get_Rate_Bitmap( + IN PVOID pDM_VOID, + IN u4Byte macid, + IN u4Byte ra_mask, + IN u1Byte rssi_level + ); +#endif + +#endif //#ifndef __ODMRAINFO_H__ + + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_RegDefine11AC.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_RegDefine11AC.h old mode 100755 new mode 100644 similarity index 65% rename from backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_RegDefine11AC.h rename to backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_RegDefine11AC.h index 1193653a52726a..12b0d683c705de --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_RegDefine11AC.h +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_RegDefine11AC.h @@ -29,19 +29,40 @@ //PAGE 8 #define ODM_REG_CCK_RPT_FORMAT_11AC 0x804 #define ODM_REG_BB_RX_PATH_11AC 0x808 +#define ODM_REG_BB_ATC_11AC 0x860 +#define ODM_REG_EDCCA_POWER_CAL 0x8dc +#define ODM_REG_DBG_RPT_11AC 0x8fc //PAGE 9 +#define ODM_REG_EDCCA_DOWN_OPT 0x900 +#define ODM_REG_ACBB_EDCCA_ENHANCE 0x944 #define ODM_REG_OFDM_FA_RST_11AC 0x9A4 +#define ODM_REG_NHM_TIMER_11AC 0x990 +#define ODM_REG_NHM_TH9_TH10_11AC 0x994 +#define ODM_REG_NHM_TH3_TO_TH0_11AC 0x998 +#define ODM_REG_NHM_TH7_TO_TH4_11AC 0x99c +#define ODM_REG_NHM_TH8_11AC 0x9a0 +#define ODM_REG_NHM_9E8_11AC 0x9e8 //PAGE A #define ODM_REG_CCK_CCA_11AC 0xA0A #define ODM_REG_CCK_FA_RST_11AC 0xA2C #define ODM_REG_CCK_FA_11AC 0xA5C +//PAGE B +#define ODM_REG_RST_RPT_11AC 0xB58 //PAGE C +#define ODM_REG_TRMUX_11AC 0xC08 #define ODM_REG_IGI_A_11AC 0xC50 //PAGE E #define ODM_REG_IGI_B_11AC 0xE50 +#define ODM_REG_TRMUX_11AC_B 0xE08 //PAGE F +#define ODM_REG_CCK_CCA_CNT_11AC 0xF08 #define ODM_REG_OFDM_FA_11AC 0xF48 - +#define ODM_REG_RPT_11AC 0xfa0 +#define ODM_REG_NHM_CNT_11AC 0xfa8 +//PAGE 18 +#define ODM_REG_IGI_C_11AC 0x1850 +//PAGE 1A +#define ODM_REG_IGI_D_11AC 0x1A50 //2 MAC REG LIST #define ODM_REG_RESP_TX_11AC 0x6D8 @@ -52,6 +73,7 @@ #define ODM_BIT_IGI_11AC 0xFFFFFFFF #define ODM_BIT_CCK_RPT_FORMAT_11AC BIT16 #define ODM_BIT_BB_RX_PATH_11AC 0xF +#define ODM_BIT_BB_ATC_11AC BIT14 #endif diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_RegDefine11N.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_RegDefine11N.h old mode 100755 new mode 100644 similarity index 84% rename from backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_RegDefine11N.h rename to backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_RegDefine11N.h index b6236092fb5a4d..9d07509f6febf8 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_RegDefine11N.h +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_RegDefine11N.h @@ -44,20 +44,28 @@ #define ODM_REG_RF_PIN_11N 0x804 #define ODM_REG_PSD_CTRL_11N 0x808 #define ODM_REG_TX_ANT_CTRL_11N 0x80C -#define ODM_REG_BB_PWR_SAV5_11N 0x818 +#define ODM_REG_BB_PWR_SAV5_11N 0x818 #define ODM_REG_CCK_RPT_FORMAT_11N 0x824 +#define ODM_REG_CCK_RPT_FORMAT_11N_B 0x82C #define ODM_REG_RX_DEFUALT_A_11N 0x858 #define ODM_REG_RX_DEFUALT_B_11N 0x85A -#define ODM_REG_BB_PWR_SAV3_11N 0x85C +#define ODM_REG_BB_PWR_SAV3_11N 0x85C #define ODM_REG_ANTSEL_CTRL_11N 0x860 #define ODM_REG_RX_ANT_CTRL_11N 0x864 #define ODM_REG_PIN_CTRL_11N 0x870 -#define ODM_REG_BB_PWR_SAV1_11N 0x874 +#define ODM_REG_BB_PWR_SAV1_11N 0x874 #define ODM_REG_ANTSEL_PATH_11N 0x878 #define ODM_REG_BB_3WIRE_11N 0x88C #define ODM_REG_SC_CNT_11N 0x8C4 -#define ODM_REG_PSD_DATA_11N 0x8B4 +#define ODM_REG_PSD_DATA_11N 0x8B4 +#define ODM_REG_PSD_DATA_11N 0x8B4 +#define ODM_REG_NHM_TIMER_11N 0x894 +#define ODM_REG_NHM_TH9_TH10_11N 0x890 +#define ODM_REG_NHM_TH3_TO_TH0_11N 0x898 +#define ODM_REG_NHM_TH7_TO_TH4_11N 0x89c +#define ODM_REG_NHM_CNT_11N 0x8d8 //PAGE 9 +#define ODM_REG_DBG_RPT_11N 0x908 #define ODM_REG_ANT_MAPPING1_11N 0x914 #define ODM_REG_ANT_MAPPING2_11N 0x918 //PAGE A @@ -78,7 +86,7 @@ #define ODM_REG_CCK_FA_MSB_11N 0xA58 #define ODM_REG_CCK_FA_LSB_11N 0xA5C #define ODM_REG_CCK_CCA_CNT_11N 0xA60 -#define ODM_REG_BB_PWR_SAV4_11N 0xA74 +#define ODM_REG_BB_PWR_SAV4_11N 0xA74 //PAGE B #define ODM_REG_LNA_SWITCH_11N 0xB2C #define ODM_REG_PATH_SWITCH_11N 0xB30 @@ -90,9 +98,9 @@ #define ODM_REG_BB_RX_PATH_11N 0xC04 #define ODM_REG_TRMUX_11N 0xC08 #define ODM_REG_OFDM_FA_RSTC_11N 0xC0C -#define ODM_REG_RXIQI_MATRIX_11N 0xC14 +#define ODM_REG_RXIQI_MATRIX_11N 0xC14 #define ODM_REG_TXIQK_MATRIX_LSB1_11N 0xC4C -#define ODM_REG_IGI_A_11N 0xC50 +#define ODM_REG_IGI_A_11N 0xC50 #define ODM_REG_ANTDIV_PARA2_11N 0xC54 #define ODM_REG_IGI_B_11N 0xC58 #define ODM_REG_ANTDIV_PARA3_11N 0xC5C @@ -108,9 +116,11 @@ #define ODM_REG_OFDM_FA_TYPE1_11N 0xCF0 //PAGE D #define ODM_REG_OFDM_FA_RSTD_11N 0xD00 +#define ODM_REG_BB_ATC_11N 0xD2C #define ODM_REG_OFDM_FA_TYPE2_11N 0xDA0 #define ODM_REG_OFDM_FA_TYPE3_11N 0xDA4 #define ODM_REG_OFDM_FA_TYPE4_11N 0xDA8 +#define ODM_REG_RPT_11N 0xDF4 //PAGE E #define ODM_REG_TXAGC_A_6_18_11N 0xE00 #define ODM_REG_TXAGC_A_24_54_11N 0xE04 @@ -143,12 +153,8 @@ #define ODM_REG_STANDBY_11N 0xEDC #define ODM_REG_SLEEP_11N 0xEE0 #define ODM_REG_PMPD_ANAEN_11N 0xEEC - - - - - - +#define ODM_REG_IGI_C_11N 0xF84 +#define ODM_REG_IGI_D_11N 0xF88 //2 MAC REG LIST #define ODM_REG_BB_RST_11N 0x02 @@ -161,14 +167,15 @@ #define ODM_REG_EDCA_BK_11N 0x50C #define ODM_REG_TXPAUSE_11N 0x522 #define ODM_REG_RESP_TX_11N 0x6D8 -#define ODM_REG_ANT_TRAIN_PARA1_11N 0x7b0 -#define ODM_REG_ANT_TRAIN_PARA2_11N 0x7b4 +#define ODM_REG_ANT_TRAIN_PARA1_11N 0x7b0 +#define ODM_REG_ANT_TRAIN_PARA2_11N 0x7b4 //DIG Related #define ODM_BIT_IGI_11N 0x0000007F #define ODM_BIT_CCK_RPT_FORMAT_11N BIT9 #define ODM_BIT_BB_RX_PATH_11N 0xF +#define ODM_BIT_BB_ATC_11N BIT11 #endif diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_debug.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_debug.c new file mode 100644 index 00000000000000..ed763a3ca27698 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_debug.c @@ -0,0 +1,1030 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +//============================================================ +// include files +//============================================================ + +#include "Mp_Precomp.h" +#include "phydm_precomp.h" + + +VOID +PHYDM_InitDebugSetting( + IN PDM_ODM_T pDM_Odm + ) +{ +pDM_Odm->DebugLevel = ODM_DBG_TRACE; + +pDM_Odm->DebugComponents = +\ +#if DBG +//BB Functions +// ODM_COMP_DIG | +// ODM_COMP_RA_MASK | +// ODM_COMP_DYNAMIC_TXPWR | +// ODM_COMP_FA_CNT | +// ODM_COMP_RSSI_MONITOR | +// ODM_COMP_CCK_PD | +// ODM_COMP_ANT_DIV | +// ODM_COMP_PWR_SAVE | +// ODM_COMP_PWR_TRAIN | +// ODM_COMP_RATE_ADAPTIVE | +// ODM_COMP_PATH_DIV | +// ODM_COMP_DYNAMIC_PRICCA | +// ODM_COMP_RXHP | +// ODM_COMP_MP | +// ODM_COMP_CFO_TRACKING | +// ODM_COMP_ACS | +// PHYDM_COMP_ADAPTIVITY | +// PHYDM_COMP_RA_DBG | +//MAC Functions +// ODM_COMP_EDCA_TURBO | +// ODM_COMP_EARLY_MODE | +//RF Functions +// ODM_COMP_TX_PWR_TRACK | +// ODM_COMP_RX_GAIN_TRACK | +// ODM_COMP_CALIBRATION | +//Common +// ODM_COMP_COMMON | +// ODM_COMP_INIT | +// ODM_COMP_PSD | +#endif + 0; +} + +#if(DM_ODM_SUPPORT_TYPE & ODM_WIN) + +static u1Byte BbDbgBuf[BB_TMP_BUF_SIZE]; +VOID +phydm_BB_Debug_Info(IN PDM_ODM_T pDM_Odm) +{ + + u1Byte RX_HT_BW, RX_VHT_BW, RXSC, RX_HT, RX_BW; + static u1Byte vRX_BW ; + u4Byte value32, value32_1, value32_2, value32_3; + s4Byte SFO_A, SFO_B, SFO_C, SFO_D; + s4Byte LFO_A, LFO_B, LFO_C, LFO_D; + static u1Byte MCSS,Tail,Parity,rsv,vrsv,idx,smooth,htsound,agg,stbc,vstbc,fec,fecext,sgi,sgiext,htltf,vgid,vNsts,vtxops,vrsv2,vbrsv,bf,vbcrc; + static u2Byte HLength,htcrc8,Length; + static u2Byte vpaid; + static u2Byte vLength,vhtcrc8,vMCSS,vTail,vbTail; + static u1Byte HMCSS,HRX_BW; + + + u1Byte pwDB; + s1Byte RXEVM_0, RXEVM_1, RXEVM_2 ; + u1Byte RF_gain_pathA, RF_gain_pathB, RF_gain_pathC, RF_gain_pathD; + u1Byte RX_SNR_pathA, RX_SNR_pathB, RX_SNR_pathC, RX_SNR_pathD; + s4Byte sig_power; + const char *RXHT_table[] = {"legacy", "HT", "VHT"}; + const char *BW_table[] = {"20M", "40M", "80M"}; + const char *RXSC_table[] = {"duplicate/full bw", "usc20-1", "lsc20-1", "usc20-2", "lsc20-2", "usc40", "lsc40"}; + + const char *L_rate[]={"6M","9M","12M","18M","24M","36M","48M","54M"}; + + + /* + const double evm_comp_20M = 0.579919469776867; //10*log10(64.0/56.0) + const double evm_comp_40M = 0.503051183113957; //10*log10(128.0/114.0) + const double evm_comp_80M = 0.244245993314183; //10*log10(256.0/242.0) + const double evm_comp_160M = 0.244245993314183; //10*log10(512.0/484.0) + */ + + if(pDM_Odm->SupportICType & ODM_IC_11N_SERIES) + return; + + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s \n", "BB Report Info"); + DCMD_Printf(BbDbgBuf); + + //BW & Mode Detection + /////////////////////////////////////////////////////// + value32 = ODM_GetBBReg(pDM_Odm, 0xf80 ,bMaskDWord); + value32_2 =value32; + RX_HT_BW = (u1Byte)(value32&0x1) ; + RX_VHT_BW = (u1Byte)((value32>>1)&0x3); + RXSC = (u1Byte)(value32&0x78); + value32_1= (value32&0x180)>>7; + RX_HT = (u1Byte)(value32_1); + /* + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d", "F80", value32_2); + DCMD_Printf(BbDbgBuf); + + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d", "RX_HT_BW", RX_HT_BW); + DCMD_Printf(BbDbgBuf); + + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d", "RX_VHT_BW", RX_VHT_BW); + DCMD_Printf(BbDbgBuf); + + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d", "RX_SC", RXSC); + DCMD_Printf(BbDbgBuf); + + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d", "RX_HT", RX_HT); + DCMD_Printf(BbDbgBuf); + */ + + //rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n RX_HT:%s ", RXHT_table[RX_HT]); + //DCMD_Printf(BbDbgBuf); + RX_BW = 0; + + if(RX_HT == 2) + { + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n Mode: VHT Mode"); + DCMD_Printf(BbDbgBuf); + if(RX_VHT_BW==0) + { + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, " BW=20M"); + DCMD_Printf(BbDbgBuf); + } + else if(RX_VHT_BW==1) + { + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, " BW=40M"); + DCMD_Printf(BbDbgBuf); + } + else + { + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, " BW=80M"); + DCMD_Printf(BbDbgBuf); + } + RX_BW = RX_VHT_BW; + } + else if(RX_HT == 1) + { + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n Mode: HT Mode"); + DCMD_Printf(BbDbgBuf); + if(RX_HT_BW==0) + { + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, " BW=20M"); + DCMD_Printf(BbDbgBuf); + } + else if(RX_HT_BW==1) + { + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, " BW=40M"); + DCMD_Printf(BbDbgBuf); + } + RX_BW = RX_HT_BW; + } + else + { + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n Mode: Legeacy Mode"); + DCMD_Printf(BbDbgBuf); + } + + if(RX_HT !=0) + { + if(RXSC==0) + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n duplicate/full bw"); + else if(RXSC==1) + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n usc20-1"); + else if(RXSC==2) + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n lsc20-1"); + else if(RXSC==3) + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n usc20-2"); + else if(RXSC==4) + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n lsc20-2"); + else if(RXSC==9) + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n usc40"); + else if(RXSC==10) + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n lsc40"); + DCMD_Printf(BbDbgBuf); + } + /* + if(RX_HT == 2){ + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, " BW:%s", BW_table[RX_VHT_BW]); + RX_BW = RX_VHT_BW; + } + else if(RX_HT == 1){ + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, " BW:%s", BW_table[RX_HT_BW]); + RX_BW = RX_HT_BW; + } + else + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, ""); + + DCMD_Printf(BbDbgBuf); + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, " RXSC:%s", RXSC_table[RXSC]); + DCMD_Printf(BbDbgBuf); + */ + /////////////////////////////////////////////////////// + +// rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d", "dB Conversion: 10log(65)", ODM_PWdB_Conversion(65,10,0)); +// DCMD_Printf(BbDbgBuf); + + // RX signal power and AGC related info + /////////////////////////////////////////////////////// + value32 = ODM_GetBBReg(pDM_Odm, 0xF90 ,bMaskDWord); + pwDB = (u1Byte) ((value32 & bMaskByte1) >> 8); + pwDB=pwDB>>1; + sig_power = -110+pwDB; + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d", "OFDM RX Signal Power(dB)", sig_power); + DCMD_Printf(BbDbgBuf); + + + value32 = ODM_GetBBReg(pDM_Odm, 0xd14 ,bMaskDWord); + RX_SNR_pathA = (u1Byte)(value32&0xFF)>>1; + RF_gain_pathA = (s1Byte) ((value32 & bMaskByte1) >> 8); + RF_gain_pathA *=2; + value32 = ODM_GetBBReg(pDM_Odm, 0xd54 ,bMaskDWord); + RX_SNR_pathB = (u1Byte)(value32&0xFF)>>1; + RF_gain_pathB = (s1Byte) ((value32 & bMaskByte1) >> 8); + RF_gain_pathB *=2; + value32 = ODM_GetBBReg(pDM_Odm, 0xd94 ,bMaskDWord); + RX_SNR_pathC = (u1Byte)(value32&0xFF)>>1; + RF_gain_pathC = (s1Byte) ((value32 & bMaskByte1) >> 8); + RF_gain_pathC *=2; + value32 = ODM_GetBBReg(pDM_Odm, 0xdd4 ,bMaskDWord); + RX_SNR_pathD = (u1Byte)(value32&0xFF)>>1; + RF_gain_pathD = (s1Byte) ((value32 & bMaskByte1) >> 8); + RF_gain_pathD *=2; + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d / %d / %d", "OFDM RX RF Gain(A/B/C/D)", RF_gain_pathA, RF_gain_pathA, RF_gain_pathC, RF_gain_pathD); + DCMD_Printf(BbDbgBuf); + /////////////////////////////////////////////////////// + + // RX Counter related info + /////////////////////////////////////////////////////// + value32 = ODM_GetBBReg(pDM_Odm, 0xF08 ,bMaskDWord); + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d", "OFDM CCA Counter", ((value32&0xFFFF0000)>>16)); + DCMD_Printf(BbDbgBuf); + + value32 = ODM_GetBBReg(pDM_Odm, 0xFD0 ,bMaskDWord); + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d", "OFDM SBD Fail Counter", value32&0xFFFF); + DCMD_Printf(BbDbgBuf); + + value32 = ODM_GetBBReg(pDM_Odm, 0xFC4 ,bMaskDWord); + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d", "VHT SIGA/SIGB CRC8 Fail Counter", value32&0xFFFF, ((value32&0xFFFF0000)>>16)); + DCMD_Printf(BbDbgBuf); + + value32 = ODM_GetBBReg(pDM_Odm, 0xFCC ,bMaskDWord); + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d", "CCK CCA Counter", value32&0xFFFF); + DCMD_Printf(BbDbgBuf); + + value32 = ODM_GetBBReg(pDM_Odm, 0xFBC ,bMaskDWord); + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d", "LSIG (\"Parity Fail\"/\"Rate Illegal\") Counter", value32&0xFFFF, ((value32&0xFFFF0000)>>16)); + DCMD_Printf(BbDbgBuf); + + value32_1 = ODM_GetBBReg(pDM_Odm, 0xFC8 ,bMaskDWord); + value32_2 = ODM_GetBBReg(pDM_Odm, 0xFC0 ,bMaskDWord); + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d", "HT/VHT MCS NOT SUPPORT counter", ((value32_2&0xFFFF0000)>>16), value32_1&0xFFFF); + DCMD_Printf(BbDbgBuf); + /////////////////////////////////////////////////////// + + // PostFFT related info + /////////////////////////////////////////////////////// + + value32 = ODM_GetBBReg(pDM_Odm, 0xF8c ,bMaskDWord); + RXEVM_0 = (s1Byte) ((value32 & bMaskByte2) >> 16); + RXEVM_0 /=2; + if(RXEVM_0 < -63) + RXEVM_0=0; + + DCMD_Printf(BbDbgBuf); + RXEVM_1 = (s1Byte) ((value32 & bMaskByte3) >> 24); + RXEVM_1 /=2; + value32 = ODM_GetBBReg(pDM_Odm, 0xF88 ,bMaskDWord); + RXEVM_2 = (s1Byte) ((value32 & bMaskByte2) >> 16); + RXEVM_2 /=2; + + if(RXEVM_1 < -63) + RXEVM_1=0; + if(RXEVM_2 < -63) + RXEVM_2=0; + + /* + if(RX_BW == 0){ + RXEVM_0 -= evm_comp_20M; + RXEVM_1 -= evm_comp_20M; + RXEVM_2 -= evm_comp_20M; + } + else if(RX_BW == 1){ + RXEVM_0 -= evm_comp_40M; + RXEVM_1 -= evm_comp_40M; + RXEVM_2 -= evm_comp_40M; + } + else if (RX_BW == 2){ + RXEVM_0 -= evm_comp_80M; + RXEVM_1 -= evm_comp_80M; + RXEVM_2 -= evm_comp_80M; + } + */ + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d / %d", "RXEVM (1ss/2ss/3ss)", RXEVM_0, RXEVM_1, RXEVM_2); + DCMD_Printf(BbDbgBuf); + +// value32 = ODM_GetBBReg(pDM_Odm, 0xD14 ,bMaskDWord); + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d / %d / %d", "RXSNR(A/B/C/D, dB)", RX_SNR_pathA, RX_SNR_pathB, RX_SNR_pathC, RX_SNR_pathD); + DCMD_Printf(BbDbgBuf); +// rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d", "B_RXSNR", (value32&0xFF00)>>9); +// DCMD_Printf(BbDbgBuf); + + value32 = ODM_GetBBReg(pDM_Odm, 0xF8C ,bMaskDWord); + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d", "CSI_1st /CSI_2nd", value32&0xFFFF, ((value32&0xFFFF0000)>>16)); + DCMD_Printf(BbDbgBuf); + /////////////////////////////////////////////////////// + + //BW & Mode Detection + + //Reset Page F Counter + ODM_SetBBReg(pDM_Odm, 0xB58 ,BIT0, 1); + ODM_SetBBReg(pDM_Odm, 0xB58 ,BIT0, 0); + + //CFO Report Info + //Short CFO + value32 = ODM_GetBBReg(pDM_Odm, 0xd0c ,bMaskDWord); + value32_1 = ODM_GetBBReg(pDM_Odm, 0xd4c ,bMaskDWord); + value32_2 = ODM_GetBBReg(pDM_Odm, 0xd8c ,bMaskDWord); + value32_3 = ODM_GetBBReg(pDM_Odm, 0xdcc ,bMaskDWord); + + SFO_A=(s4Byte)(value32&bMask12Bits); + SFO_B=(s4Byte)(value32_1&bMask12Bits); + SFO_C=(s4Byte)(value32_2&bMask12Bits); + SFO_D=(s4Byte)(value32_3&bMask12Bits); + + LFO_A=(s4Byte)(value32>>16); + LFO_B=(s4Byte)(value32_1>>16); + LFO_C=(s4Byte)(value32_2>>16); + LFO_D=(s4Byte)(value32_3>>16); + + //SFO 2's to dec + if(SFO_A >2047) + { + SFO_A=SFO_A-4096; + } + SFO_A=(SFO_A*312500)/2048; + + if(SFO_B >2047) + { + SFO_B=SFO_B-4096; + } + SFO_B=(SFO_B*312500)/2048; + if(SFO_C >2047) + { + SFO_C=SFO_C-4096; + } + SFO_C=(SFO_C*312500)/2048; + if(SFO_D >2047) + { + SFO_D=SFO_D-4096; + } + SFO_D=(SFO_D*312500)/2048; + + //LFO 2's to dec + + if(LFO_A >4095) + { + LFO_A=LFO_A-8192; + } + + if(LFO_B >4095) + { + LFO_B=LFO_B-8192; + } + + if(LFO_C>4095) + { + LFO_C=LFO_C-8192; + } + + if(LFO_D >4095) + { + LFO_D=LFO_D-8192; + } + LFO_A=LFO_A*312500/4096; + LFO_B=LFO_B*312500/4096; + LFO_C=LFO_C*312500/4096; + LFO_D=LFO_D*312500/4096; + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "CFO Report Info"); + DCMD_Printf(BbDbgBuf); + + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d/ %d/ %d", " Short CFO(Hz) ", SFO_A,SFO_B,SFO_C,SFO_D); + DCMD_Printf(BbDbgBuf); + + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d/ %d/ %d", " Long CFO(Hz) ", LFO_A,LFO_B,LFO_C,LFO_D); + DCMD_Printf(BbDbgBuf); + + //SCFO + value32 = ODM_GetBBReg(pDM_Odm, 0xd10 ,bMaskDWord); + value32_1 = ODM_GetBBReg(pDM_Odm, 0xd50 ,bMaskDWord); + value32_2 = ODM_GetBBReg(pDM_Odm, 0xd90 ,bMaskDWord); + value32_3 = ODM_GetBBReg(pDM_Odm, 0xdd0 ,bMaskDWord); + + SFO_A=(s4Byte)(value32&0x7ff); + SFO_B=(s4Byte)(value32_1&0x7ff); + SFO_C=(s4Byte)(value32_2&0x7ff); + SFO_D=(s4Byte)(value32_3&0x7ff); + + if(SFO_A >1023) + { + SFO_A=SFO_A-2048; + } + + if(SFO_B >2047) + { + SFO_B=SFO_B-4096; +} + + if(SFO_C >2047) + { + SFO_C=SFO_C-4096; + } + + if(SFO_D >2047) + { + SFO_D=SFO_D-4096; + } + + SFO_A=SFO_A*312500/1024; + SFO_B=SFO_B*312500/1024; + SFO_C=SFO_C*312500/1024; + SFO_D=SFO_D*312500/1024; + + LFO_A=(s4Byte)(value32>>16); + LFO_B=(s4Byte)(value32_1>>16); + LFO_C=(s4Byte)(value32_2>>16); + LFO_D=(s4Byte)(value32_3>>16); + + if(LFO_A >4095) + { + LFO_A=LFO_A-8192; + } + + if(LFO_B >4095) + { + LFO_B=LFO_B-8192; + } + + if(LFO_C>4095) + { + LFO_C=LFO_C-8192; + } + + if(LFO_D >4095) + { + LFO_D=LFO_D-8192; + } + LFO_A=LFO_A*312500/4096; + LFO_B=LFO_B*312500/4096; + LFO_C=LFO_C*312500/4096; + LFO_D=LFO_D*312500/4096; + + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d/ %d/ %d", " Value SCFO(Hz) ", SFO_A,SFO_B,SFO_C,SFO_D); + DCMD_Printf(BbDbgBuf); + + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d/ %d/ %d", " ACQ CFO(Hz) ", LFO_A,LFO_B,LFO_C,LFO_D); + DCMD_Printf(BbDbgBuf); + + value32 = ODM_GetBBReg(pDM_Odm, 0xd14 ,bMaskDWord); + value32_1 = ODM_GetBBReg(pDM_Odm, 0xd54 ,bMaskDWord); + value32_2 = ODM_GetBBReg(pDM_Odm, 0xd94 ,bMaskDWord); + value32_3 = ODM_GetBBReg(pDM_Odm, 0xdd4 ,bMaskDWord); + + LFO_A=(s4Byte)(value32>>16); + LFO_B=(s4Byte)(value32_1>>16); + LFO_C=(s4Byte)(value32_2>>16); + LFO_D=(s4Byte)(value32_3>>16); + + if(LFO_A >4095) + { + LFO_A=LFO_A-8192; + } + + if(LFO_B >4095) + { + LFO_B=LFO_B-8192; + } + + if(LFO_C>4095) + { + LFO_C=LFO_C-8192; + } + + if(LFO_D >4095) + { + LFO_D=LFO_D-8192; + } + LFO_A=LFO_A*312500/4096; + LFO_B=LFO_B*312500/4096; + LFO_C=LFO_C*312500/4096; + LFO_D=LFO_D*312500/4096; + + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d/ %d/ %d", " End CFO(Hz) ", LFO_A,LFO_B,LFO_C,LFO_D); + DCMD_Printf(BbDbgBuf); + + value32 = ODM_GetBBReg(pDM_Odm, 0xf20 ,bMaskDWord); //L SIG + + Tail=(u1Byte)((value32&0xfc0000)>>16); + Parity = (u1Byte)((value32&0x20000)>>16); + Length =(u2Byte)((value32&0x1ffe00)>>8); + rsv = (u1Byte)(value32&0x10); + MCSS=(u1Byte)(value32&0x0f); + + switch(MCSS) + { + case 0x0b: + idx=0; + break; + case 0x0f: + idx=1; + break; + case 0x0a: + idx=2; + break; + case 0x0e: + idx=3; + break; + case 0x09: + idx=4; + break; + case 0x08: + idx=5; + break; + case 0x0c: + idx=6; + break; + default: + idx=6; + break; + + } + + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "L-SIG"); + DCMD_Printf(BbDbgBuf); + + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n Rate:%s", L_rate[idx]); + DCMD_Printf(BbDbgBuf); + + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %x/ %x /%x", " Rsv/Length/Parity",rsv,RX_BW,Length); + DCMD_Printf(BbDbgBuf); + + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "HT-SIG1"); + DCMD_Printf(BbDbgBuf); + + value32 = ODM_GetBBReg(pDM_Odm, 0xf2c ,bMaskDWord); //HT SIG + if(RX_HT == 1) + { + + HMCSS=(u1Byte)(value32&0x7F); + HRX_BW = (u1Byte)(value32&0x80); + HLength =(u2Byte)((value32>>8)&0xffff); + } + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %x / %x/ %x", " MCS/BW/Length",HMCSS,HRX_BW,HLength); + DCMD_Printf(BbDbgBuf); + + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "HT-SIG2"); + DCMD_Printf(BbDbgBuf); + + value32 = ODM_GetBBReg(pDM_Odm, 0xf30 ,bMaskDWord); //HT SIG + + if(RX_HT == 1) + { + smooth = (u1Byte)(value32&0x01); + htsound = (u1Byte)(value32&0x02); + rsv=(u1Byte)(value32&0x04); + agg =(u1Byte)(value32&0x08); + stbc =(u1Byte)(value32&0x30); + fec=(u1Byte)(value32&0x40); + sgi=(u1Byte)(value32&0x80); + htltf=(u1Byte)((value32&0x300)>>8); + htcrc8=(u2Byte)((value32&0x3fc00)>>8); + Tail=(u1Byte)((value32&0xfc0000)>>16); + + + } + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %x / %x/ %x/ %x/ %x/ %x", " Smooth/NoSound/Rsv/Aggregate/STBC/LDPC",smooth,htsound,rsv,agg,stbc,fec); + DCMD_Printf(BbDbgBuf); + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %x / %x/ %x/ %x", " SGI/E-HT-LTFs/CRC/Tail",sgi,htltf,htcrc8,Tail); + DCMD_Printf(BbDbgBuf); + + + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "VHT-SIG-A1"); + DCMD_Printf(BbDbgBuf); + value32 = ODM_GetBBReg(pDM_Odm, 0xf2c ,bMaskDWord); //VHT SIG A1 + if(RX_HT == 2) + { + //value32 = ODM_GetBBReg(pDM_Odm, 0xf2c ,bMaskDWord); //VHT SIG A1 + vRX_BW=(u1Byte)(value32&0x03); + vrsv=(u1Byte)(value32&0x04); + vstbc =(u1Byte)(value32&0x08); + vgid = (u1Byte)((value32&0x3f0)>>4); + vNsts = (u1Byte)(((value32&0x1c00)>>8)+1); + vpaid = (u2Byte)(value32&0x3fe); + vtxops =(u1Byte)((value32&0x400000)>>20); + vrsv2 = (u1Byte)((value32&0x800000)>>20); + } + + //rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %x", "F2C", value32); + //DCMD_Printf(BbDbgBuf); + + + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %x / %x/ %x/ %x/ %x/ %x /%x /%x", " BW/Rsv1/STBC/GID/Nsts/PAID/TXOPPS/Rsv2",vRX_BW,vrsv,vstbc,vgid,vNsts,vpaid,vtxops,vrsv2); + DCMD_Printf(BbDbgBuf); + + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "VHT-SIG-A2"); + DCMD_Printf(BbDbgBuf); + value32 = ODM_GetBBReg(pDM_Odm, 0xf30 ,bMaskDWord); //VHT SIG + + + if(RX_HT == 2) + { + //value32 = ODM_GetBBReg(pDM_Odm, 0xf30 ,bMaskDWord); //VHT SIG + + //sgi=(u1Byte)(value32&0x01); + sgiext =(u1Byte)(value32&0x03); + //fec = (u1Byte)(value32&0x04); + fecext = (u1Byte)(value32&0x0C); + + vMCSS =(u1Byte)(value32&0xf0); + bf = (u1Byte)((value32&0x100)>>8); + vrsv =(u1Byte)((value32&0x200)>>8); + vhtcrc8=(u2Byte)((value32&0x3fc00)>>8); + vTail=(u1Byte)((value32&0xfc0000)>>16); + } + //rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %x", "F30", value32); + //DCMD_Printf(BbDbgBuf); + + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %x / %x/ %x/ %x/ %x/ %x/ %x", " SGI/FEC/MCS/BF/Rsv/CRC/Tail",sgiext,fecext,vMCSS,bf,vrsv,vhtcrc8,vTail); + DCMD_Printf(BbDbgBuf); + + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "VHT-SIG-B"); + DCMD_Printf(BbDbgBuf); + value32 = ODM_GetBBReg(pDM_Odm, 0xf34 ,bMaskDWord); //VHT SIG + { + vLength=(u2Byte)(value32&0x1fffff); + vbrsv = (u1Byte)((value32&0x600000)>>20); + vbTail =(u2Byte)((value32&0x1f800000)>>20); + vbcrc = (u1Byte)((value32&0x80000000)>>28); + + } + //rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %x", "F34", value32); + //DCMD_Printf(BbDbgBuf); + rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %x / %x/ %x/ %x/", " Length/Rsv/Tail/CRC",vLength,vbrsv,vbTail,vbcrc); + DCMD_Printf(BbDbgBuf); + + +} + +void phydm_sbd_check( + IN PDM_ODM_T pDM_Odm + ) +{ + static u4Byte pkt_cnt = 0; + static BOOLEAN sbd_state = 0; + u4Byte sym_count, count, value32; + + if(sbd_state == 0) + { + pkt_cnt++; + if(pkt_cnt%5 == 0) //read SBD conter once every 5 packets + { + ODM_SetTimer(pDM_Odm,&pDM_Odm->sbdcnt_timer, 0); //ms + sbd_state = 1; + } + } + else //read counter + { + value32 = ODM_GetBBReg(pDM_Odm, 0xF98, bMaskDWord); + sym_count = (value32 & 0x7C000000)>>26; + count = (value32 & 0x3F00000) >> 20; + DbgPrint("#SBD# sym_count %d count %d\n", sym_count, count); + sbd_state = 0; + } +} + +void phydm_sbd_callback( + PRT_TIMER pTimer + ) +{ + PADAPTER Adapter = (PADAPTER)pTimer->Adapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; + + #if USE_WORKITEM + ODM_ScheduleWorkItem(&pDM_Odm->sbdcnt_workitem); + #else + phydm_sbd_check(pDM_Odm); + #endif +} + +void phydm_sbd_workitem_callback( + IN PVOID pContext + ) +{ + PADAPTER pAdapter = (PADAPTER)pContext; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); + PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; + + phydm_sbd_check(pDM_Odm); +} +#endif +VOID +phydm_BasicDbgMessage +( + IN PVOID pDM_VOID + ) +{ +#if( DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + PFALSE_ALARM_STATISTICS FalseAlmCnt = (PFALSE_ALARM_STATISTICS)PhyDM_Get_Structure( pDM_Odm , PHYDM_FALSEALMCNT); + pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("odm_BasicDbgMsg==>\n")); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("bLinked = %d, RSSI_Min = %d, CurrentIGI = 0x%x \n", + pDM_Odm->bLinked, pDM_Odm->RSSI_Min, pDM_DigTable->CurIGValue) ); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("Cnt_Cck_fail = %d, Cnt_Ofdm_fail = %d, Total False Alarm = %d\n", + FalseAlmCnt->Cnt_Cck_fail, FalseAlmCnt->Cnt_Ofdm_fail, FalseAlmCnt->Cnt_all)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("RxRate = 0x%x, RSSI_A = %d, RSSI_B = %d\n", + pDM_Odm->RxRate, pDM_Odm->RSSI_A, pDM_Odm->RSSI_B)); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("RSSI_C = %d, RSSI_D = %d\n", pDM_Odm->RSSI_C, pDM_Odm->RSSI_D)); +#endif +} + + +VOID phydm_BasicProfile( + IN PVOID pDM_VOID, + IN u4Byte *_used, + OUT char *output, + IN u4Byte *_out_len + ) +{ + PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; + char* Cut = NULL; + char* ICType = NULL; + u4Byte used = *_used; + u4Byte out_len = *_out_len; + + PHYDM_SNPRINTF((output+used, out_len-used,"%-35s\n", "% Basic Profile %")); + + if(pDM_Odm->SupportICType == ODM_RTL8192C) ICType = "RTL8192C"; + else if(pDM_Odm->SupportICType == ODM_RTL8192D) ICType = "RTL8192D"; + else if(pDM_Odm->SupportICType == ODM_RTL8723A) ICType = "RTL8723A"; + else if(pDM_Odm->SupportICType == ODM_RTL8188E) ICType = "RTL8188E"; + else if(pDM_Odm->SupportICType == ODM_RTL8812) ICType = "RTL8812A"; + else if(pDM_Odm->SupportICType == ODM_RTL8821) ICType = "RTL8821A"; + else if(pDM_Odm->SupportICType == ODM_RTL8192E) ICType = "RTL8192E"; + else if(pDM_Odm->SupportICType == ODM_RTL8723B) ICType = "RTL8723B"; + else if(pDM_Odm->SupportICType == ODM_RTL8814A) ICType = "RTL8814A"; + else if(pDM_Odm->SupportICType == ODM_RTL8881A) ICType = "RTL8881A"; + else if(pDM_Odm->SupportICType == ODM_RTL8821B) ICType = "RTL8821B"; + else if(pDM_Odm->SupportICType == ODM_RTL8822B) ICType = "RTL8822B"; + else if(pDM_Odm->SupportICType == ODM_RTL8703B) ICType = "RTL8703B"; + else if(pDM_Odm->SupportICType == ODM_RTL8195A) ICType = "RTL8195A"; + else if(pDM_Odm->SupportICType == ODM_RTL8188F) ICType = "RTL8188F"; + PHYDM_SNPRINTF((output+used, out_len-used, " %-35s: %s (MP Chip: %s)\n","IC Type", ICType, pDM_Odm->bIsMPChip?"Yes":"No")); + + if(pDM_Odm->CutVersion==ODM_CUT_A) Cut = "A"; + else if(pDM_Odm->CutVersion==ODM_CUT_B) Cut = "B"; + else if(pDM_Odm->CutVersion==ODM_CUT_C) Cut = "C"; + else if(pDM_Odm->CutVersion==ODM_CUT_D) Cut = "D"; + else if(pDM_Odm->CutVersion==ODM_CUT_E) Cut = "E"; + else if(pDM_Odm->CutVersion==ODM_CUT_F) Cut = "F"; + else if(pDM_Odm->CutVersion==ODM_CUT_I) Cut = "I"; + PHYDM_SNPRINTF((output+used, out_len-used, " %-35s: %s\n","Cut Version", Cut)); + PHYDM_SNPRINTF((output+used, out_len-used, " %-35s: %d\n","PHY Parameter Version", ODM_GetHWImgVersion(pDM_Odm))); +#if(DM_ODM_SUPPORT_TYPE & ODM_WIN) + { + PADAPTER Adapter = pDM_Odm->Adapter; + PHYDM_SNPRINTF((output+used, out_len-used, " %-35s: %d (Subversion: %d)\n","FW Version", Adapter->MgntInfo.FirmwareVersion, Adapter->MgntInfo.FirmwareSubVersion)); + } +#elif (DM_ODM_SUPPORT_TYPE & ODM_AP) + { + struct rtl8192cd_priv *priv = pDM_Odm->priv; + PHYDM_SNPRINTF((output+used, out_len-used, " %-35s: %d (Subversion: %d)\n","FW Version", priv->pshare->fw_version, priv->pshare->fw_sub_version)); + } +#else + { + PADAPTER Adapter = pDM_Odm->Adapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + PHYDM_SNPRINTF((output+used, out_len-used, " %-35s: %d (Subversion: %d)\n","FW Version", pHalData->FirmwareVersion, pHalData->FirmwareSubVersion)); + } +#endif + //1 PHY DM Version List + PHYDM_SNPRINTF((output+used, out_len-used, "%-35s\n","% PHYDM Version %")); + PHYDM_SNPRINTF((output+used, out_len-used, " %-35s: %s\n","Adaptivity", ADAPTIVITY_VERSION)); + PHYDM_SNPRINTF((output+used, out_len-used, " %-35s: %s\n","DIG", DIG_VERSION)); + PHYDM_SNPRINTF((output+used, out_len-used, " %-35s: %s\n","Dynamic BB PowerSaving", DYNAMIC_BBPWRSAV_VERSION)); + PHYDM_SNPRINTF((output+used, out_len-used, " %-35s: %s\n","CFO Tracking", CFO_TRACKING_VERSION)); + PHYDM_SNPRINTF((output+used, out_len-used, " %-35s: %s\n","Antenna Diversity", ANTDIV_VERSION)); + PHYDM_SNPRINTF((output+used, out_len-used, " %-35s: %s\n","Power Tracking", POWRTRACKING_VERSION)); + PHYDM_SNPRINTF((output+used, out_len-used, " %-35s: %s\n","Dynamic TxPower", DYNAMIC_TXPWR_VERSION)); + PHYDM_SNPRINTF((output+used, out_len-used, " %-35s: %s\n","RA Info", RAINFO_VERSION)); +#if(DM_ODM_SUPPORT_TYPE & ODM_WIN) + PHYDM_SNPRINTF((output+used, out_len-used, " %-35s: %s\n","Antenna Detection", ANTDECT_VERSION)); +#endif + PHYDM_SNPRINTF((output+used, out_len-used, " %-35s: %s\n","Auto Channel Selection", ACS_VERSION)); + PHYDM_SNPRINTF((output+used, out_len-used, " %-35s: %s\n","EDCA Turbo", EDCATURBO_VERSION)); + PHYDM_SNPRINTF((output+used, out_len-used, " %-35s: %s\n","Path Diversity", PATHDIV_VERSION)); +#if(DM_ODM_SUPPORT_TYPE & ODM_WIN) + PHYDM_SNPRINTF((output+used, out_len-used, " %-35s: %s\n","RxHP", RXHP_VERSION)); +#endif + *_used = used; + *_out_len = out_len; + +} + +struct _PHYDM_COMMAND { + char name[16]; + u1Byte id; +}; + +enum PHYDM_CMD_ID { + PHYDM_DEMO, + PHYDM_RA, + PHYDM_PROFILE, + PHYDM_PATHDIV +}; + +struct _PHYDM_COMMAND phy_dm_ary[] = { + {"demo", PHYDM_DEMO}, + {"ra", PHYDM_RA}, + {"profile", PHYDM_PROFILE}, + {"pathdiv",PHYDM_PATHDIV} +}; + +VOID +phydm_cmd_parser( + IN PDM_ODM_T pDM_Odm, + IN char input[][MAX_ARGV], + IN u4Byte input_num, + IN u1Byte flag, + OUT char *output, + IN u4Byte out_len + ) +{ + u4Byte used = 0; + u1Byte id = 0; + int var1[5] = {0}; + int i, input_idx = 0; + + if (flag == 0) + { + PHYDM_SNPRINTF((output+used, out_len-used, "GET, nothing to print\n")); + return; + } + + PHYDM_SNPRINTF((output+used, out_len-used, "\n")); + + //Parsing Cmd ID + if (input_num) + { + int n, i; + n = sizeof(phy_dm_ary)/sizeof(struct _PHYDM_COMMAND); + for (i = 0; i < n; i++) + { + if (strcmp(phy_dm_ary[i].name, input[0]) == 0) + { + id = phy_dm_ary[i].id; + break; + } + } + if (i == n) + { + PHYDM_SNPRINTF((output+used, out_len-used, "SET, command not found!\n")); + return; + } + } + + switch (id) + { + case PHYDM_DEMO: //echo demo 10 0x3a z abcde >cmd + { + u4Byte directory; +#if(DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_AP)) + char char_temp; +#else + u4Byte char_temp; +#endif + PHYDM_SSCANF(input[1], DCMD_DECIMAL, &directory); + PHYDM_SNPRINTF((output+used, out_len-used, "Decimal Value = %d\n", directory)); + PHYDM_SSCANF(input[2], DCMD_HEX, &directory); + PHYDM_SNPRINTF((output+used, out_len-used, "Hex Value = 0x%x\n", directory)); + PHYDM_SSCANF(input[3], DCMD_CHAR, &char_temp); + PHYDM_SNPRINTF((output+used, out_len-used, "Char = %c\n", char_temp)); + PHYDM_SNPRINTF((output+used, out_len-used, "String = %s\n", input[4])); + } + break; + + case PHYDM_RA: + + for(i=0;i<5;i++) + { + if(input[i+1]) + { + PHYDM_SSCANF(input[i+1], DCMD_DECIMAL, &var1[i]); + + PHYDM_SNPRINTF((output+used, out_len-used, "new SET, RA_var[%d]= (( %d ))\n", i , var1[i])); + input_idx++; + } + } + + if(input_idx>=1) + { + PHYDM_SNPRINTF((output+used, out_len-used, "odm_RA_debug\n")); + #if (defined(CONFIG_RA_DBG_CMD)) + odm_RA_debug(pDM_Odm, var1); + #endif + } + + + break; + + case PHYDM_PATHDIV: + + for(i=0;i<5;i++) + { + if(input[i+1]) + { + PHYDM_SSCANF(input[i+1], DCMD_HEX, &var1[i]); + + PHYDM_SNPRINTF((output+used, out_len-used, "new SET, PATHDIV_var[%d]= (( %d ))\n", i , var1[i])); + input_idx++; + } + } + + if(input_idx>=1) + { + PHYDM_SNPRINTF((output+used, out_len-used, "odm_PATHDIV_debug\n")); + #if (defined(CONFIG_PATH_DIVERSITY)) + odm_pathdiv_debug(pDM_Odm, var1); + #endif + } + + + break; + + case PHYDM_PROFILE: //echo profile, >cmd + phydm_BasicProfile(pDM_Odm, &used, output, &out_len); + break; + + default: + PHYDM_SNPRINTF((output+used, out_len-used, "SET, unknown command!\n")); + break; + + } + } + +#ifdef __ECOS +char *strsep(char **s, const char *ct) +{ + char *sbegin = *s; + char *end; + + if (sbegin == NULL) + return NULL; + + end = strpbrk(sbegin, ct); + if (end) + *end++ = '\0'; + *s = end; + return sbegin; +} +#endif + +#if(DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_AP)) +s4Byte +phydm_cmd( + IN PDM_ODM_T pDM_Odm, + IN char *input, + IN u4Byte in_len, + IN u1Byte flag, + OUT char *output, + IN u4Byte out_len + ) +{ + char *token; + u4Byte Argc = 0; + char Argv[MAX_ARGC][MAX_ARGV]; + + do + { + token = strsep(&input, ", "); + if(token) + { + strcpy(Argv[Argc], token); + Argc++; + } + else + break; + }while(Argc < MAX_ARGC); + + if(Argc == 1) + Argv[0][strlen(Argv[0])-1] = '\0'; + + phydm_cmd_parser(pDM_Odm, Argv, Argc, flag, output, out_len); + + return 0; +} +#endif \ No newline at end of file diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_debug.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_debug.h new file mode 100644 index 00000000000000..2ef5537a2e67b5 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_debug.h @@ -0,0 +1,279 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + + +#ifndef __ODM_DBG_H__ +#define __ODM_DBG_H__ + + +//----------------------------------------------------------------------------- +// Define the debug levels +// +// 1. DBG_TRACE and DBG_LOUD are used for normal cases. +// So that, they can help SW engineer to develope or trace states changed +// and also help HW enginner to trace every operation to and from HW, +// e.g IO, Tx, Rx. +// +// 2. DBG_WARNNING and DBG_SERIOUS are used for unusual or error cases, +// which help us to debug SW or HW. +// +//----------------------------------------------------------------------------- +// +// Never used in a call to ODM_RT_TRACE()! +// +#define ODM_DBG_OFF 1 + +// +// Fatal bug. +// For example, Tx/Rx/IO locked up, OS hangs, memory access violation, +// resource allocation failed, unexpected HW behavior, HW BUG and so on. +// +#define ODM_DBG_SERIOUS 2 + +// +// Abnormal, rare, or unexpeted cases. +// For example, IRP/Packet/OID canceled, device suprisely unremoved and so on. +// +#define ODM_DBG_WARNING 3 + +// +// Normal case with useful information about current SW or HW state. +// For example, Tx/Rx descriptor to fill, Tx/Rx descriptor completed status, +// SW protocol state change, dynamic mechanism state change and so on. +// +#define ODM_DBG_LOUD 4 + +// +// Normal case with detail execution flow or information. +// +#define ODM_DBG_TRACE 5 + +//----------------------------------------------------------------------------- +// Define the tracing components +// +//----------------------------------------------------------------------------- +//BB Functions +#define ODM_COMP_DIG BIT0 +#define ODM_COMP_RA_MASK BIT1 +#define ODM_COMP_DYNAMIC_TXPWR BIT2 +#define ODM_COMP_FA_CNT BIT3 +#define ODM_COMP_RSSI_MONITOR BIT4 +#define ODM_COMP_CCK_PD BIT5 +#define ODM_COMP_ANT_DIV BIT6 +#define ODM_COMP_PWR_SAVE BIT7 +#define ODM_COMP_PWR_TRAIN BIT8 +#define ODM_COMP_RATE_ADAPTIVE BIT9 +#define ODM_COMP_PATH_DIV BIT10 +#define ODM_COMP_PSD BIT11 +#define ODM_COMP_DYNAMIC_PRICCA BIT12 +#define ODM_COMP_RXHP BIT13 +#define ODM_COMP_MP BIT14 +#define ODM_COMP_CFO_TRACKING BIT15 +#define ODM_COMP_ACS BIT16 +#define PHYDM_COMP_ADAPTIVITY BIT17 +#define PHYDM_COMP_RA_DBG BIT18 +//MAC Functions +#define ODM_COMP_EDCA_TURBO BIT20 +#define ODM_COMP_EARLY_MODE BIT21 +//RF Functions +#define ODM_COMP_TX_PWR_TRACK BIT24 +#define ODM_COMP_RX_GAIN_TRACK BIT25 +#define ODM_COMP_CALIBRATION BIT26 +//Common Functions +#define BEAMFORMING_DEBUG BIT29 +#define ODM_COMP_COMMON BIT30 +#define ODM_COMP_INIT BIT31 + +/*------------------------Export Marco Definition---------------------------*/ +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + #define RT_PRINTK DbgPrint +#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) + #define DbgPrint printk + #define RT_PRINTK(fmt, args...) DbgPrint( "%s(): " fmt, __FUNCTION__, ## args); + #define RT_DISP(dbgtype, dbgflag, printstr) +#else + #define DbgPrint panic_printk + #define RT_PRINTK(fmt, args...) DbgPrint( "%s(): " fmt, __FUNCTION__, ## args); +#endif + +#ifndef ASSERT + #define ASSERT(expr) +#endif + +#if DBG +#define ODM_RT_TRACE(pDM_Odm, comp, level, fmt) \ + if(((comp) & pDM_Odm->DebugComponents) && (level <= pDM_Odm->DebugLevel || level == ODM_DBG_SERIOUS)) \ + { \ + if(pDM_Odm->SupportICType == ODM_RTL8192C) \ + DbgPrint("[ODM-92C] "); \ + else if(pDM_Odm->SupportICType == ODM_RTL8192D) \ + DbgPrint("[ODM-92D] "); \ + else if(pDM_Odm->SupportICType == ODM_RTL8723A) \ + DbgPrint("[ODM-8723A] "); \ + else if(pDM_Odm->SupportICType == ODM_RTL8188E) \ + DbgPrint("[ODM-8188E] "); \ + else if(pDM_Odm->SupportICType == ODM_RTL8192E) \ + DbgPrint("[ODM-8192E] "); \ + else if(pDM_Odm->SupportICType == ODM_RTL8812) \ + DbgPrint("[ODM-8812] "); \ + else if(pDM_Odm->SupportICType == ODM_RTL8821) \ + DbgPrint("[ODM-8821] "); \ + else if(pDM_Odm->SupportICType == ODM_RTL8814A) \ + DbgPrint("[ODM-8814] "); \ + else if(pDM_Odm->SupportICType == ODM_RTL8822B) \ + DbgPrint("[ODM-8822] "); \ + RT_PRINTK fmt; \ + } + +#define ODM_RT_TRACE_F(pDM_Odm, comp, level, fmt) \ + if(((comp) & pDM_Odm->DebugComponents) && (level <= pDM_Odm->DebugLevel)) \ + { \ + RT_PRINTK fmt; \ + } + +#define ODM_RT_ASSERT(pDM_Odm, expr, fmt) \ + if(!(expr)) { \ + DbgPrint( "Assertion failed! %s at ......\n", #expr); \ + DbgPrint( " ......%s,%s,line=%d\n",__FILE__,__FUNCTION__,__LINE__); \ + RT_PRINTK fmt; \ + ASSERT(FALSE); \ + } +#define ODM_dbg_enter() { DbgPrint("==> %s\n", __FUNCTION__); } +#define ODM_dbg_exit() { DbgPrint("<== %s\n", __FUNCTION__); } +#define ODM_dbg_trace(str) { DbgPrint("%s:%s\n", __FUNCTION__, str); } + +#define ODM_PRINT_ADDR(pDM_Odm, comp, level, title_str, ptr) \ + if(((comp) & pDM_Odm->DebugComponents) && (level <= pDM_Odm->DebugLevel)) \ + { \ + int __i; \ + pu1Byte __ptr = (pu1Byte)ptr; \ + DbgPrint("[ODM] "); \ + DbgPrint(title_str); \ + DbgPrint(" "); \ + for( __i=0; __i<6; __i++ ) \ + DbgPrint("%02X%s", __ptr[__i], (__i==5)?"":"-"); \ + DbgPrint("\n"); \ + } +#else +#define ODM_RT_TRACE(pDM_Odm, comp, level, fmt) +#define ODM_RT_TRACE_F(pDM_Odm, comp, level, fmt) +#define ODM_RT_ASSERT(pDM_Odm, expr, fmt) +#define ODM_dbg_enter() +#define ODM_dbg_exit() +#define ODM_dbg_trace(str) +#define ODM_PRINT_ADDR(pDM_Odm, comp, level, title_str, ptr) +#endif + + +VOID +PHYDM_InitDebugSetting(IN PDM_ODM_T pDM_Odm); + +#define BB_TMP_BUF_SIZE 100 +VOID phydm_BB_Debug_Info(IN PDM_ODM_T pDM_Odm); +VOID phydm_BasicDbgMessage( IN PVOID pDM_VOID); + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) +#define PHYDM_DBGPRINT 0 +#define PHYDM_SSCANF(x, y, z) DCMD_Scanf(x, y, z) +#if (PHYDM_DBGPRINT == 1) +#define PHYDM_SNPRINTF(msg) \ + {\ + rsprintf msg;\ + DbgPrint(output);\ + } +#else +#define PHYDM_SNPRINTF(msg) \ + {\ + rsprintf msg;\ + DCMD_Printf(output);\ + } +#endif +#else +#if (DM_ODM_SUPPORT_TYPE == ODM_CE) +#define PHYDM_DBGPRINT 0 +#else +#define PHYDM_DBGPRINT 1 +#endif +#define MAX_ARGC 20 +#define MAX_ARGV 16 +#define DCMD_DECIMAL "%d" +#define DCMD_CHAR "%c" +#define DCMD_HEX "%x" + +#define PHYDM_SSCANF(x, y, z) sscanf(x, y, z) +#if (PHYDM_DBGPRINT == 1) +#define PHYDM_SNPRINTF(msg)\ + {\ + snprintf msg;\ + DbgPrint(output);\ + } +#else +#define PHYDM_SNPRINTF(msg)\ + {\ + if(out_len > used)\ + used+=snprintf msg;\ + } +#endif +#endif + + +VOID phydm_BasicProfile( + IN PVOID pDM_VOID, + IN u4Byte *_used, + OUT char *output, + IN u4Byte *_out_len + ); +#if(DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_AP)) +s4Byte +phydm_cmd( + IN PDM_ODM_T pDM_Odm, + IN char *input, + IN u4Byte in_len, + IN u1Byte flag, + OUT char *output, + IN u4Byte out_len +); +#endif +VOID +phydm_cmd_parser( + IN PDM_ODM_T pDM_Odm, + IN char input[][16], + IN u4Byte input_num, + IN u1Byte flag, + OUT char *output, + IN u4Byte out_len +); + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) +void phydm_sbd_check( + IN PDM_ODM_T pDM_Odm + ); + +void phydm_sbd_callback( + PRT_TIMER pTimer + ); + +void phydm_sbd_workitem_callback( + IN PVOID pContext + ); +#endif + +#endif // __ODM_DBG_H__ + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_interface.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_interface.c old mode 100755 new mode 100644 similarity index 59% rename from backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_interface.c rename to backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_interface.c index 9cf4ff45d3ef41..cad72749d1bd01 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_interface.c +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_interface.c @@ -22,8 +22,8 @@ // include files //============================================================ - -#include "odm_precomp.h" +#include "Mp_Precomp.h" +#include "phydm_precomp.h" // // ODM IO Relative API. @@ -177,12 +177,9 @@ ODM_GetMACReg( ) { #if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) - return PHY_QueryMacReg(pDM_Odm->priv, RegAddr, BitMask); -#elif(DM_ODM_SUPPORT_TYPE & (ODM_WIN)) - PADAPTER Adapter = pDM_Odm->Adapter; - return PHY_QueryMacReg(Adapter, RegAddr, BitMask); -#elif(DM_ODM_SUPPORT_TYPE & (ODM_CE)) - return PHY_QueryBBReg(pDM_Odm->Adapter, RegAddr, BitMask); + return PHY_QueryBBReg(pDM_Odm->priv, RegAddr, BitMask); +#elif(DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) + return PHY_QueryMacReg(pDM_Odm->Adapter, RegAddr, BitMask); #endif } @@ -304,7 +301,7 @@ ODM_MoveMemory( ) { #if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) - + memcpy(pDest, pSrc, Length); #elif (DM_ODM_SUPPORT_TYPE & ODM_CE ) _rtw_memcpy(pDest, pSrc, Length); #elif(DM_ODM_SUPPORT_TYPE & ODM_WIN) @@ -312,6 +309,20 @@ ODM_MoveMemory( #endif } +void ODM_Memory_Set + (IN PDM_ODM_T pDM_Odm, + IN PVOID pbuf, + IN s1Byte value, + IN u4Byte length) +{ +#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) + +#elif (DM_ODM_SUPPORT_TYPE & ODM_CE ) + _rtw_memset(pbuf,value, length); +#elif(DM_ODM_SUPPORT_TYPE & ODM_WIN) + PlatformFillMemory(pbuf,length,value); +#endif +} s4Byte ODM_CompareMemory( IN PDM_ODM_T pDM_Odm, IN PVOID pBuf1, @@ -342,7 +353,8 @@ ODM_AcquireSpinLock( #if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) #elif(DM_ODM_SUPPORT_TYPE & ODM_CE) - + PADAPTER Adapter = pDM_Odm->Adapter; + rtw_odm_acquirespinlock(Adapter, type); #elif(DM_ODM_SUPPORT_TYPE & ODM_WIN) PADAPTER Adapter = pDM_Odm->Adapter; PlatformAcquireSpinLock(Adapter, type); @@ -357,7 +369,8 @@ ODM_ReleaseSpinLock( #if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) #elif (DM_ODM_SUPPORT_TYPE & ODM_CE ) - + PADAPTER Adapter = pDM_Odm->Adapter; + rtw_odm_releasespinlock(Adapter, type); #elif(DM_ODM_SUPPORT_TYPE & ODM_WIN) PADAPTER Adapter = pDM_Odm->Adapter; PlatformReleaseSpinLock(Adapter, type); @@ -534,7 +547,7 @@ ODM_SetTimer( ) { #if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) - mod_timer(pTimer, jiffies + (msDelay+9)/10); + mod_timer(pTimer, jiffies + RTL_MILISECONDS_TO_JIFFIES(msDelay)); #elif(DM_ODM_SUPPORT_TYPE & ODM_CE) _set_timer(pTimer,msDelay ); //ms #elif(DM_ODM_SUPPORT_TYPE & ODM_WIN) @@ -554,9 +567,10 @@ ODM_InitializeTimer( ) { #if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) + init_timer(pTimer); pTimer->function = CallBackFunc; pTimer->data = (unsigned long)pDM_Odm; - init_timer(pTimer); + mod_timer(pTimer, jiffies+RTL_MILISECONDS_TO_JIFFIES(10)); #elif(DM_ODM_SUPPORT_TYPE & ODM_CE) PADAPTER Adapter = pDM_Odm->Adapter; _init_timer(pTimer,Adapter->pnetdev,CallBackFunc,pDM_Odm); @@ -611,113 +625,283 @@ ODM_ReleaseTimer( } +u1Byte +phydm_trans_h2c_id( + IN PDM_ODM_T pDM_Odm, + IN u1Byte phydm_h2c_id +) +{ + u1Byte platform_h2c_id=0xff; + + + switch(phydm_h2c_id) + { + //1 [0] + case ODM_H2C_RSSI_REPORT: + + #if(DM_ODM_SUPPORT_TYPE & ODM_WIN) + if(pDM_Odm->SupportICType == ODM_RTL8188E) + { + platform_h2c_id = H2C_88E_RSSI_REPORT; + } + else if(pDM_Odm->SupportICType == ODM_RTL8814A) + { + platform_h2c_id =H2C_8814A_RSSI_REPORT; + } + else + { + platform_h2c_id = H2C_RSSI_REPORT; + } + + #elif(DM_ODM_SUPPORT_TYPE & ODM_CE) + #if((RTL8812A_SUPPORT==1) ||(RTL8821A_SUPPORT==1)) + platform_h2c_id = H2C_8812_RSSI_REPORT; + #elif(RTL8192E_SUPPORT==1) + platform_h2c_id =H2C_8192E_RSSI_REPORT; + #elif(RTL8723B_SUPPORT==1) + platform_h2c_id =H2C_8723B_RSSI_SETTING; + #elif(RTL8188E_SUPPORT==1) + platform_h2c_id =H2C_RSSI_REPORT; + #elif(RTL8723A_SUPPORT==1) + platform_h2c_id =RSSI_SETTING_EID; + #elif(RTL8192D_SUPPORT==1) + platform_h2c_id =H2C_RSSI_REPORT; + #elif(RTL8192C_SUPPORT==1) + platform_h2c_id =RSSI_SETTING_EID; + #endif + + #elif(DM_ODM_SUPPORT_TYPE & ODM_AP) + #if((RTL8881A_SUPPORT==1)||(RTL8192E_SUPPORT==1)||(RTL8814A_SUPPORT==1) ) + if(pDM_Odm->SupportICType == ODM_RTL8881A || pDM_Odm->SupportICType == ODM_RTL8192E|| pDM_Odm->SupportICType == ODM_RTL8814A) + { + platform_h2c_id =H2C_88XX_RSSI_REPORT; + //ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, ("[H2C] H2C_88XX_RSSI_REPORT CMD_ID = (( %d )) \n", platform_h2c_id)); + } else + #endif + #if(RTL8812A_SUPPORT==1) + if(pDM_Odm->SupportICType == ODM_RTL8812) + { + platform_h2c_id = H2C_8812_RSSI_REPORT; + } else + #endif + {} + #endif + + break; + + //1 [3] + case ODM_H2C_WIFI_CALIBRATION: + #if(DM_ODM_SUPPORT_TYPE & ODM_WIN) + platform_h2c_id =H2C_WIFI_CALIBRATION; + + #elif(DM_ODM_SUPPORT_TYPE & ODM_CE) + #if(RTL8723B_SUPPORT==1) + platform_h2c_id = H2C_8723B_BT_WLAN_CALIBRATION; + #endif + + #elif(DM_ODM_SUPPORT_TYPE & ODM_AP) + + + #endif + + break; + + + //1 [4] + case ODM_H2C_IQ_CALIBRATION: + #if(DM_ODM_SUPPORT_TYPE & ODM_WIN) + platform_h2c_id =H2C_IQ_CALIBRATION; + + #elif(DM_ODM_SUPPORT_TYPE & ODM_CE) + #if((RTL8812A_SUPPORT==1) ||(RTL8821A_SUPPORT==1)) + platform_h2c_id = H2C_8812_IQ_CALIBRATION; + #endif + #elif(DM_ODM_SUPPORT_TYPE & ODM_AP) + + + #endif + + break; + //1 [5] + case ODM_H2C_RA_PARA_ADJUST: + + #if(DM_ODM_SUPPORT_TYPE & ODM_WIN) + if(pDM_Odm->SupportICType == ODM_RTL8814A) + { + platform_h2c_id =H2C_8814A_RA_PARA_ADJUST; + } + else + { + platform_h2c_id = H2C_RA_PARA_ADJUST; + } + #elif(DM_ODM_SUPPORT_TYPE & ODM_CE) + #if((RTL8812A_SUPPORT==1) ||(RTL8821A_SUPPORT==1)) + platform_h2c_id = H2C_8812_RA_PARA_ADJUST; + #elif(RTL8192E_SUPPORT==1) + platform_h2c_id =H2C_8192E_RA_PARA_ADJUST; + #elif(RTL8723B_SUPPORT==1) + platform_h2c_id =H2C_8723B_RA_PARA_ADJUST; + #endif + + #elif(DM_ODM_SUPPORT_TYPE & ODM_AP) + #if((RTL8881A_SUPPORT==1)||(RTL8192E_SUPPORT==1)||(RTL8814A_SUPPORT==1)) + if(pDM_Odm->SupportICType == ODM_RTL8881A || pDM_Odm->SupportICType == ODM_RTL8192E) + { + platform_h2c_id =H2C_88XX_RA_PARA_ADJUST; + //ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, ("[H2C] H2C_88XX_RA_PARA_ADJUST CMD_ID = (( %d )) \n", platform_h2c_id)); + } else if(pDM_Odm->SupportICType == ODM_RTL8814A) { + platform_h2c_id =H2C_88XX_RA_PARA_ADJUST_8814; + } else + #endif + #if(RTL8812A_SUPPORT==1) + if(pDM_Odm->SupportICType == ODM_RTL8812) + { + platform_h2c_id = H2C_8812_RA_PARA_ADJUST; + } else + #endif + {} + #endif + + break; + + + //1 [6] + case PHYDM_H2C_DYNAMIC_TX_PATH: + + #if(DM_ODM_SUPPORT_TYPE & ODM_WIN) + if(pDM_Odm->SupportICType == ODM_RTL8814A) + { + platform_h2c_id =H2C_8814A_DYNAMIC_TX_PATH; + } + #elif(DM_ODM_SUPPORT_TYPE & ODM_CE) + + + #elif(DM_ODM_SUPPORT_TYPE & ODM_AP) + #if(RTL8814A_SUPPORT==1) + if( pDM_Odm->SupportICType == ODM_RTL8814A) + { + //platform_h2c_id =H2C_88XX_DYNAMIC_TX_PATH; + } + #endif + + #endif + + break; + + default: + platform_h2c_id=0xff; + break; + } + + return platform_h2c_id; + +} + // // ODM FW relative API. // -#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) + VOID ODM_FillH2CCmd( - IN PADAPTER Adapter, - IN u1Byte ElementID, - IN u4Byte CmdLen, - IN pu1Byte pCmdBuffer + IN PDM_ODM_T pDM_Odm, + IN u1Byte phydm_h2c_id, + IN u4Byte CmdLen, + IN pu1Byte pCmdBuffer ) { - if(IS_HARDWARE_TYPE_JAGUAR(Adapter)) - { - switch(ElementID) - { - case ODM_H2C_RSSI_REPORT: - FillH2CCmd8812(Adapter, H2C_8812_RSSI_REPORT, CmdLen, pCmdBuffer); - break; - default: - break; - } + PADAPTER Adapter = pDM_Odm->Adapter; + u1Byte platform_h2c_id; - } - else if(IS_HARDWARE_TYPE_8192E(Adapter)) + platform_h2c_id=phydm_trans_h2c_id(pDM_Odm, phydm_h2c_id); + + if(platform_h2c_id==0xff) { - switch(ElementID) - { - case ODM_H2C_RSSI_REPORT: - FillH2CCmd8812(Adapter, H2C_8812_RSSI_REPORT, CmdLen, pCmdBuffer); - break; - default: - break; - } + ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, ("[H2C] Wrong H2C CMD-ID !! platform_h2c_id==0xff , PHYDM_ElementID=((%d )) \n",phydm_h2c_id)); + return; } - else if(IS_HARDWARE_TYPE_8723B(Adapter)) - { - // - // We should take RTL8723B into consideration, 2012.10.08 - // - switch(ElementID) + + #if(DM_ODM_SUPPORT_TYPE & ODM_WIN) + if(pDM_Odm->SupportICType == ODM_RTL8188E) { - case ODM_H2C_RSSI_REPORT: - FillH2CCmd8723B(Adapter, H2C_8723B_RSSI_REPORT, CmdLen, pCmdBuffer); - break; - - default: - break; + if(!pDM_Odm->RaSupport88E) + FillH2CCmd88E(Adapter, platform_h2c_id, CmdLen, pCmdBuffer); } - - } - else if(IS_HARDWARE_TYPE_8188E(Adapter)) - { - switch(ElementID) + else if(pDM_Odm->SupportICType == ODM_RTL8192C) { - case ODM_H2C_PSD_RESULT: - FillH2CCmd88E(Adapter, H2C_88E_PSD_RESULT, CmdLen, pCmdBuffer); - break; - case ODM_H2C_RSSI_REPORT: - if(IS_VENDOR_8188E_I_CUT_SERIES(Adapter)) - FillH2CCmd88E(Adapter, H2C_88E_RSSI_REPORT, CmdLen, pCmdBuffer); - break; - default: - break; + FillH2CCmd92C(Adapter, platform_h2c_id, CmdLen, pCmdBuffer); } - } - else - { - switch(ElementID) + else if(pDM_Odm->SupportICType == ODM_RTL8814A) { - case ODM_H2C_RSSI_REPORT: - FillH2CCmd92C(Adapter, H2C_RSSI_REPORT, CmdLen, pCmdBuffer); - break; - case ODM_H2C_PSD_RESULT: - FillH2CCmd92C(Adapter, H2C_92C_PSD_RESULT, CmdLen, pCmdBuffer); - break; - default: - break; + FillH2CCmd8814A(Adapter, platform_h2c_id, CmdLen, pCmdBuffer); } - } -} -#else -u4Byte -ODM_FillH2CCmd( - IN pu1Byte pH2CBuffer, - IN u4Byte H2CBufferLen, - IN u4Byte CmdNum, - IN pu4Byte pElementID, - IN pu4Byte pCmdLen, - IN pu1Byte* pCmbBuffer, - IN pu1Byte CmdStartSeq + else + { + FillH2CCmd(Adapter, platform_h2c_id, CmdLen, pCmdBuffer); + } + #elif(DM_ODM_SUPPORT_TYPE & ODM_CE) + + #if((RTL8812A_SUPPORT==1) ||(RTL8821A_SUPPORT==1)) + FillH2CCmd_8812(Adapter, platform_h2c_id, CmdLen, pCmdBuffer); + #elif(RTL8192E_SUPPORT==1) + FillH2CCmd_8192E(Adapter, platform_h2c_id, CmdLen, pCmdBuffer); + #elif(RTL8723B_SUPPORT==1) + FillH2CCmd8723B(Adapter, platform_h2c_id, CmdLen, pCmdBuffer); + #elif(RTL8188E_SUPPORT==1) + if(!pDM_Odm->RaSupport88E) + FillH2CCmd_88E(Adapter, platform_h2c_id, CmdLen, pCmdBuffer); + #elif(RTL8723A_SUPPORT==1) + FillH2CCmd(Adapter, platform_h2c_id, CmdLen, pCmdBuffer); + #elif(RTL8192D_SUPPORT==1) + FillH2CCmd92D(Adapter, platform_h2c_id, CmdLen, pCmdBuffer); + #elif(RTL8192C_SUPPORT==1) + rtl8192c_FillH2CCmd(Adapter, platform_h2c_id, CmdLen, pCmdBuffer); + #endif + + #elif(DM_ODM_SUPPORT_TYPE & ODM_AP) + #if((RTL8881A_SUPPORT==1)||(RTL8192E_SUPPORT==1)||(RTL8814A_SUPPORT==1)) + if(pDM_Odm->SupportICType == ODM_RTL8881A || pDM_Odm->SupportICType == ODM_RTL8192E|| pDM_Odm->SupportICType == ODM_RTL8814A) + { + GET_HAL_INTERFACE(pDM_Odm->priv)->FillH2CCmdHandler(pDM_Odm->priv, platform_h2c_id, CmdLen, pCmdBuffer); + //FillH2CCmd88XX(pDM_Odm->priv, platform_h2c_id, CmdLen, pCmdBuffer); + } else + #endif + #if(RTL8812A_SUPPORT==1) + if(pDM_Odm->SupportICType == ODM_RTL8812) + { + FillH2CCmd8812(pDM_Odm->priv, platform_h2c_id, CmdLen, pCmdBuffer); + } else + #endif + {} + #endif +} + +u8Byte +ODM_GetCurrentTime( + IN PDM_ODM_T pDM_Odm ) { #if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) - + return 0; #elif(DM_ODM_SUPPORT_TYPE & ODM_CE) - + return (u8Byte)rtw_get_current_time(); #elif(DM_ODM_SUPPORT_TYPE & ODM_WIN) - //FillH2CCmd(pH2CBuffer, H2CBufferLen, CmdNum, pElementID, pCmdLen, pCmbBuffer, CmdStartSeq); - return FALSE; + return PlatformGetCurrentTime(); #endif - - return TRUE; } -#endif - - +u8Byte +ODM_GetProgressingTime( + IN PDM_ODM_T pDM_Odm, + IN u8Byte Start_Time + ) +{ +#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) + return 0; +#elif(DM_ODM_SUPPORT_TYPE & ODM_CE) + return rtw_get_passing_time_ms((u4Byte)Start_Time); +#elif(DM_ODM_SUPPORT_TYPE & ODM_WIN) + return ((PlatformGetCurrentTime() - Start_Time)>>10); +#endif +} diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_interface.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_interface.h old mode 100755 new mode 100644 similarity index 80% rename from backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_interface.h rename to backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_interface.h index 7d75575cc58520..f255c31651a5b5 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_interface.h +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_interface.h @@ -60,36 +60,52 @@ ODM_REG(DIG,_pDM_Odm) #define _bit_11N(_name) ODM_BIT_##_name##_11N #define _bit_11AC(_name) ODM_BIT_##_name##_11AC -#if 1 //TODO: enable it if we need to support run-time to differentiate between 92C_SERIES and JAGUAR_SERIES. -#define _cat(_name, _ic_type, _func) \ - ( \ +#ifdef __ECOS +#define _rtk_cat(_name, _ic_type, _func) \ + ( \ ((_ic_type) & ODM_IC_11N_SERIES)? _func##_11N(_name): \ - _func##_11AC(_name) \ + _func##_11AC(_name) \ ) -#endif -#if 0 // only sample code +#else + #define _cat(_name, _ic_type, _func) \ ( \ - ((_ic_type) & ODM_RTL8192C)? _func##_ic(_name, _8192C): \ - ((_ic_type) & ODM_RTL8192D)? _func##_ic(_name, _8192D): \ - ((_ic_type) & ODM_RTL8192S)? _func##_ic(_name, _8192S): \ - ((_ic_type) & ODM_RTL8723A)? _func##_ic(_name, _8723A): \ - ((_ic_type) & ODM_RTL8188E)? _func##_ic(_name, _8188E): \ - _func##_ic(_name, _8195) \ + ((_ic_type) & ODM_IC_11N_SERIES)? _func##_11N(_name): \ + _func##_11AC(_name) \ ) #endif +/* +// only sample code +//#define _cat(_name, _ic_type, _func) \ +// ( \ +// ((_ic_type) & ODM_RTL8192C)? _func##_ic(_name, _8192C): \ +// ((_ic_type) & ODM_RTL8192D)? _func##_ic(_name, _8192D): \ +// ((_ic_type) & ODM_RTL8192S)? _func##_ic(_name, _8192S): \ +// ((_ic_type) & ODM_RTL8723A)? _func##_ic(_name, _8723A): \ +// ((_ic_type) & ODM_RTL8188E)? _func##_ic(_name, _8188E): \ +// _func##_ic(_name, _8195) \ +// ) +*/ // _name: name of register or bit. // Example: "ODM_REG(R_A_AGC_CORE1, pDM_Odm)" // gets "ODM_R_A_AGC_CORE1" or "ODM_R_A_AGC_CORE1_8192C", depends on SupportICType. +#ifdef __ECOS +#define ODM_REG(_name, _pDM_Odm) _rtk_cat(_name, _pDM_Odm->SupportICType, _reg) +#define ODM_BIT(_name, _pDM_Odm) _rtk_cat(_name, _pDM_Odm->SupportICType, _bit) +#else #define ODM_REG(_name, _pDM_Odm) _cat(_name, _pDM_Odm->SupportICType, _reg) #define ODM_BIT(_name, _pDM_Odm) _cat(_name, _pDM_Odm->SupportICType, _bit) - +#endif typedef enum _ODM_H2C_CMD { ODM_H2C_RSSI_REPORT = 0, ODM_H2C_PSD_RESULT=1, - ODM_H2C_PathDiv = 2, + ODM_H2C_PathDiv = 2, + ODM_H2C_WIFI_CALIBRATION = 3, + ODM_H2C_IQ_CALIBRATION = 4, + ODM_H2C_RA_PARA_ADJUST=5, + PHYDM_H2C_DYNAMIC_TX_PATH=6, ODM_MAX_H2CCMD }ODM_H2C_CMD; @@ -251,6 +267,12 @@ s4Byte ODM_CompareMemory( IN PVOID pBuf2, IN u4Byte length ); + +void ODM_Memory_Set + (IN PDM_ODM_T pDM_Odm, + IN PVOID pbuf, + IN s1Byte value, + IN u4Byte length); // // ODM MISC-spin lock relative API. @@ -359,25 +381,23 @@ ODM_ReleaseTimer( // // ODM FW relative API. // -#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) VOID ODM_FillH2CCmd( - IN PADAPTER Adapter, - IN u1Byte ElementID, - IN u4Byte CmdLen, - IN pu1Byte pCmdBuffer + IN PDM_ODM_T pDM_Odm, + IN u1Byte ElementID, + IN u4Byte CmdLen, + IN pu1Byte pCmdBuffer ); -#else -u4Byte -ODM_FillH2CCmd( - IN pu1Byte pH2CBuffer, - IN u4Byte H2CBufferLen, - IN u4Byte CmdNum, - IN pu4Byte pElementID, - IN pu4Byte pCmdLen, - IN pu1Byte* pCmbBuffer, - IN pu1Byte CmdStartSeq + +u8Byte +ODM_GetCurrentTime( + IN PDM_ODM_T pDM_Odm ); -#endif +u8Byte +ODM_GetProgressingTime( + IN PDM_ODM_T pDM_Odm, + IN u8Byte Start_Time + ); + #endif // __ODM_INTERFACE_H__ diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_pre_define.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_pre_define.h new file mode 100644 index 00000000000000..7f0366d1741f04 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_pre_define.h @@ -0,0 +1,483 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + + +#ifndef __PHYDMPREDEFINE_H__ +#define __PHYDMPREDEFINE_H__ + +//1 ============================================================ +//1 Definition +//1 ============================================================ + +//Max path of IC +#define MAX_PATH_NUM_92CS 2 +#define MAX_PATH_NUM_8188E 1 +#define MAX_PATH_NUM_8192E 2 +#define MAX_PATH_NUM_8723B 1 +#define MAX_PATH_NUM_8812A 2 +#define MAX_PATH_NUM_8821A 1 +#define MAX_PATH_NUM_8814A 4 +#define MAX_PATH_NUM_8822B 2 +#define MAX_PATH_NUM_8821B 2 + +//Max RF path +#define ODM_RF_PATH_MAX 2 +#define ODM_RF_PATH_MAX_JAGUAR 4 + +//number of entry +#if(DM_ODM_SUPPORT_TYPE & (ODM_CE)) + #define ASSOCIATE_ENTRY_NUM 32 // Max size of AsocEntry[]. + #define ODM_ASSOCIATE_ENTRY_NUM ASSOCIATE_ENTRY_NUM +#elif(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) + #define ASSOCIATE_ENTRY_NUM NUM_STAT + #define ODM_ASSOCIATE_ENTRY_NUM ASSOCIATE_ENTRY_NUM+1 +#else + #define ODM_ASSOCIATE_ENTRY_NUM (ASSOCIATE_ENTRY_NUM*3)+1// Default port only one // 0 is for STA 1-n is for AP clients. +#endif + + +#define ODM_RATEMCS15_SG 0x1c +#define ODM_RATEMCS32 0x20 + + +// CCK Rates, TxHT = 0 +#define ODM_RATE1M 0x00 +#define ODM_RATE2M 0x01 +#define ODM_RATE5_5M 0x02 +#define ODM_RATE11M 0x03 +// OFDM Rates, TxHT = 0 +#define ODM_RATE6M 0x04 +#define ODM_RATE9M 0x05 +#define ODM_RATE12M 0x06 +#define ODM_RATE18M 0x07 +#define ODM_RATE24M 0x08 +#define ODM_RATE36M 0x09 +#define ODM_RATE48M 0x0A +#define ODM_RATE54M 0x0B +// MCS Rates, TxHT = 1 +#define ODM_RATEMCS0 0x0C +#define ODM_RATEMCS1 0x0D +#define ODM_RATEMCS2 0x0E +#define ODM_RATEMCS3 0x0F +#define ODM_RATEMCS4 0x10 +#define ODM_RATEMCS5 0x11 +#define ODM_RATEMCS6 0x12 +#define ODM_RATEMCS7 0x13 +#define ODM_RATEMCS8 0x14 +#define ODM_RATEMCS9 0x15 +#define ODM_RATEMCS10 0x16 +#define ODM_RATEMCS11 0x17 +#define ODM_RATEMCS12 0x18 +#define ODM_RATEMCS13 0x19 +#define ODM_RATEMCS14 0x1A +#define ODM_RATEMCS15 0x1B +#define ODM_RATEMCS16 0x1C +#define ODM_RATEMCS17 0x1D +#define ODM_RATEMCS18 0x1E +#define ODM_RATEMCS19 0x1F +#define ODM_RATEMCS20 0x20 +#define ODM_RATEMCS21 0x21 +#define ODM_RATEMCS22 0x22 +#define ODM_RATEMCS23 0x23 +#define ODM_RATEMCS24 0x24 +#define ODM_RATEMCS25 0x25 +#define ODM_RATEMCS26 0x26 +#define ODM_RATEMCS27 0x27 +#define ODM_RATEMCS28 0x28 +#define ODM_RATEMCS29 0x29 +#define ODM_RATEMCS30 0x2A +#define ODM_RATEMCS31 0x2B +#define ODM_RATEVHTSS1MCS0 0x2C +#define ODM_RATEVHTSS1MCS1 0x2D +#define ODM_RATEVHTSS1MCS2 0x2E +#define ODM_RATEVHTSS1MCS3 0x2F +#define ODM_RATEVHTSS1MCS4 0x30 +#define ODM_RATEVHTSS1MCS5 0x31 +#define ODM_RATEVHTSS1MCS6 0x32 +#define ODM_RATEVHTSS1MCS7 0x33 +#define ODM_RATEVHTSS1MCS8 0x34 +#define ODM_RATEVHTSS1MCS9 0x35 +#define ODM_RATEVHTSS2MCS0 0x36 +#define ODM_RATEVHTSS2MCS1 0x37 +#define ODM_RATEVHTSS2MCS2 0x38 +#define ODM_RATEVHTSS2MCS3 0x39 +#define ODM_RATEVHTSS2MCS4 0x3A +#define ODM_RATEVHTSS2MCS5 0x3B +#define ODM_RATEVHTSS2MCS6 0x3C +#define ODM_RATEVHTSS2MCS7 0x3D +#define ODM_RATEVHTSS2MCS8 0x3E +#define ODM_RATEVHTSS2MCS9 0x3F +#define ODM_RATEVHTSS3MCS0 0x40 +#define ODM_RATEVHTSS3MCS1 0x41 +#define ODM_RATEVHTSS3MCS2 0x42 +#define ODM_RATEVHTSS3MCS3 0x43 +#define ODM_RATEVHTSS3MCS4 0x44 +#define ODM_RATEVHTSS3MCS5 0x45 +#define ODM_RATEVHTSS3MCS6 0x46 +#define ODM_RATEVHTSS3MCS7 0x47 +#define ODM_RATEVHTSS3MCS8 0x48 +#define ODM_RATEVHTSS3MCS9 0x49 +#define ODM_RATEVHTSS4MCS0 0x4A +#define ODM_RATEVHTSS4MCS1 0x4B +#define ODM_RATEVHTSS4MCS2 0x4C +#define ODM_RATEVHTSS4MCS3 0x4D +#define ODM_RATEVHTSS4MCS4 0x4E +#define ODM_RATEVHTSS4MCS5 0x4F +#define ODM_RATEVHTSS4MCS6 0x50 +#define ODM_RATEVHTSS4MCS7 0x51 +#define ODM_RATEVHTSS4MCS8 0x52 +#define ODM_RATEVHTSS4MCS9 0x53 + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + #define ODM_NUM_RATE_IDX ODM_RATEVHTSS4MCS9 +#else + #if (RTL8192E_SUPPORT == 1) + #define ODM_NUM_RATE_IDX ODM_RATEMCS15 + #elif (RTL8723B_SUPPORT == 1)|| (RTL8188E_SUPPORT == 1) + #define ODM_NUM_RATE_IDX ODM_RATEMCS7 + #elif (RTL8821A_SUPPORT == 1) || (RTL8881A_SUPPORT == 1) + #define ODM_NUM_RATE_IDX ODM_RATEVHTSS1MCS9 + #elif (RTL8812A_SUPPORT == 1) + #define ODM_NUM_RATE_IDX ODM_RATEVHTSS2MCS9 + #elif(RTL8814A_SUPPORT == 1) + #define ODM_NUM_RATE_IDX ODM_RATEVHTSS3MCS9 + #else + #define ODM_NUM_RATE_IDX ODM_RATEVHTSS4MCS9 + #endif +#endif + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) +#define CONFIG_SFW_SUPPORTED +#endif + +//1 ============================================================ +//1 enumeration +//1 ============================================================ + + +// ODM_CMNINFO_INTERFACE +typedef enum tag_ODM_Support_Interface_Definition +{ + ODM_ITRF_PCIE = 0x1, + ODM_ITRF_USB = 0x2, + ODM_ITRF_SDIO = 0x4, + ODM_ITRF_ALL = 0x7, +}ODM_INTERFACE_E; + +// ODM_CMNINFO_IC_TYPE +typedef enum tag_ODM_Support_IC_Type_Definition +{ + ODM_RTL8192S = BIT0, + ODM_RTL8192C = BIT1, + ODM_RTL8192D = BIT2, + ODM_RTL8723A = BIT3, + ODM_RTL8188E = BIT4, + ODM_RTL8812 = BIT5, + ODM_RTL8821 = BIT6, + ODM_RTL8192E = BIT7, + ODM_RTL8723B = BIT8, + ODM_RTL8814A = BIT9, + ODM_RTL8881A = BIT10, + ODM_RTL8821B = BIT11, + ODM_RTL8822B = BIT12, + ODM_RTL8703B = BIT13, + ODM_RTL8195A = BIT14, + ODM_RTL8188F = BIT15 +}ODM_IC_TYPE_E; + + + + +#define ODM_IC_11N_SERIES (ODM_RTL8192S|ODM_RTL8192C|ODM_RTL8192D|ODM_RTL8723A|ODM_RTL8188E|ODM_RTL8192E|ODM_RTL8723B|ODM_RTL8703B|ODM_RTL8188F) +#define ODM_IC_11AC_SERIES (ODM_RTL8812|ODM_RTL8821|ODM_RTL8814A|ODM_RTL8881A|ODM_RTL8821B|ODM_RTL8822B) + +#if (DM_ODM_SUPPORT_TYPE == ODM_AP) + +#ifdef RTK_AC_SUPPORT +#define ODM_IC_11AC_SERIES_SUPPORT 1 +#else +#define ODM_IC_11AC_SERIES_SUPPORT 0 +#endif + +#define ODM_IC_11N_SERIES_SUPPORT 1 +#define ODM_CONFIG_BT_COEXIST 0 + +#elif (DM_ODM_SUPPORT_TYPE == ODM_WIN) + +#define ODM_IC_11AC_SERIES_SUPPORT 1 +#define ODM_IC_11N_SERIES_SUPPORT 1 +#define ODM_CONFIG_BT_COEXIST 1 + +#else + +#if((RTL8192C_SUPPORT == 1) || (RTL8192D_SUPPORT == 1) || (RTL8723A_SUPPORT == 1) || (RTL8188E_SUPPORT == 1) ||\ +(RTL8723B_SUPPORT == 1) || (RTL8192E_SUPPORT == 1) || (RTL8195A_SUPPORT == 1)) +#define ODM_IC_11N_SERIES_SUPPORT 1 +#define ODM_IC_11AC_SERIES_SUPPORT 0 +#else +#define ODM_IC_11N_SERIES_SUPPORT 0 +#define ODM_IC_11AC_SERIES_SUPPORT 1 +#endif + +#ifdef CONFIG_BT_COEXIST +#define ODM_CONFIG_BT_COEXIST 1 +#else +#define ODM_CONFIG_BT_COEXIST 0 +#endif + +#endif + + +//ODM_CMNINFO_CUT_VER +typedef enum tag_ODM_Cut_Version_Definition +{ + ODM_CUT_A = 0, + ODM_CUT_B = 1, + ODM_CUT_C = 2, + ODM_CUT_D = 3, + ODM_CUT_E = 4, + ODM_CUT_F = 5, + + ODM_CUT_I = 8, + ODM_CUT_J = 9, + ODM_CUT_K = 10, + ODM_CUT_TEST = 15, +}ODM_CUT_VERSION_E; + +// ODM_CMNINFO_FAB_VER +typedef enum tag_ODM_Fab_Version_Definition +{ + ODM_TSMC = 0, + ODM_UMC = 1, +}ODM_FAB_E; + +// ODM_CMNINFO_RF_TYPE +// +// For example 1T2R (A+AB = BIT0|BIT4|BIT5) +// +typedef enum tag_ODM_RF_Path_Bit_Definition +{ + ODM_RF_TX_A = BIT0, + ODM_RF_TX_B = BIT1, + ODM_RF_TX_C = BIT2, + ODM_RF_TX_D = BIT3, + ODM_RF_RX_A = BIT4, + ODM_RF_RX_B = BIT5, + ODM_RF_RX_C = BIT6, + ODM_RF_RX_D = BIT7, +}ODM_RF_PATH_E; + + +typedef enum tag_ODM_RF_Type_Definition +{ + ODM_1T1R = 0, + ODM_1T2R = 1, + ODM_2T2R = 2, + ODM_2T3R = 3, + ODM_2T4R = 4, + ODM_3T3R = 5, + ODM_3T4R = 6, + ODM_4T4R = 7, +}ODM_RF_TYPE_E; + + +typedef enum tag_ODM_MAC_PHY_Mode_Definition +{ + ODM_SMSP = 0, + ODM_DMSP = 1, + ODM_DMDP = 2, +}ODM_MAC_PHY_MODE_E; + + +typedef enum tag_BT_Coexist_Definition +{ + ODM_BT_BUSY = 1, + ODM_BT_ON = 2, + ODM_BT_OFF = 3, + ODM_BT_NONE = 4, +}ODM_BT_COEXIST_E; + +// ODM_CMNINFO_OP_MODE +typedef enum tag_Operation_Mode_Definition +{ + ODM_NO_LINK = BIT0, + ODM_LINK = BIT1, + ODM_SCAN = BIT2, + ODM_POWERSAVE = BIT3, + ODM_AP_MODE = BIT4, + ODM_CLIENT_MODE = BIT5, + ODM_AD_HOC = BIT6, + ODM_WIFI_DIRECT = BIT7, + ODM_WIFI_DISPLAY = BIT8, +}ODM_OPERATION_MODE_E; + +// ODM_CMNINFO_WM_MODE +#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_CE)) +typedef enum tag_Wireless_Mode_Definition +{ + ODM_WM_UNKNOW = 0x0, + ODM_WM_B = BIT0, + ODM_WM_G = BIT1, + ODM_WM_A = BIT2, + ODM_WM_N24G = BIT3, + ODM_WM_N5G = BIT4, + ODM_WM_AUTO = BIT5, + ODM_WM_AC = BIT6, +}ODM_WIRELESS_MODE_E; +#else +typedef enum tag_Wireless_Mode_Definition +{ + ODM_WM_UNKNOWN = 0x00, + ODM_WM_A = BIT0, + ODM_WM_B = BIT1, + ODM_WM_G = BIT2, + ODM_WM_AUTO = BIT3, + ODM_WM_N24G = BIT4, + ODM_WM_N5G = BIT5, + ODM_WM_AC_5G = BIT6, + ODM_WM_AC_24G = BIT7, + ODM_WM_AC_ONLY = BIT8, + ODM_WM_MAX = BIT9 +}ODM_WIRELESS_MODE_E; +#endif + +// ODM_CMNINFO_BAND +typedef enum tag_Band_Type_Definition +{ +#if (DM_ODM_SUPPORT_TYPE & (ODM_AP)) + ODM_BAND_2_4G = BIT0, + ODM_BAND_5G = BIT1, +#else + ODM_BAND_2_4G = 0, + ODM_BAND_5G, + ODM_BAND_ON_BOTH, + ODM_BANDMAX +#endif +}ODM_BAND_TYPE_E; + + +// ODM_CMNINFO_SEC_CHNL_OFFSET +typedef enum tag_Secondary_Channel_Offset_Definition +{ + ODM_DONT_CARE = 0, + ODM_BELOW = 1, + ODM_ABOVE = 2 +}ODM_SEC_CHNL_OFFSET_E; + +// ODM_CMNINFO_SEC_MODE +typedef enum tag_Security_Definition +{ + ODM_SEC_OPEN = 0, + ODM_SEC_WEP40 = 1, + ODM_SEC_TKIP = 2, + ODM_SEC_RESERVE = 3, + ODM_SEC_AESCCMP = 4, + ODM_SEC_WEP104 = 5, + ODM_WEP_WPA_MIXED = 6, // WEP + WPA + ODM_SEC_SMS4 = 7, +}ODM_SECURITY_E; + +// ODM_CMNINFO_BW +typedef enum tag_Bandwidth_Definition +{ + ODM_BW20M = 0, + ODM_BW40M = 1, + ODM_BW80M = 2, + ODM_BW160M = 3, + ODM_BW10M = 4, +}ODM_BW_E; + +// ODM_CMNINFO_CHNL + +// ODM_CMNINFO_BOARD_TYPE +typedef enum tag_Board_Definition +{ + ODM_BOARD_DEFAULT = 0, // The DEFAULT case. + ODM_BOARD_MINICARD = BIT(0), // 0 = non-mini card, 1= mini card. + ODM_BOARD_SLIM = BIT(1), // 0 = non-slim card, 1 = slim card + ODM_BOARD_BT = BIT(2), // 0 = without BT card, 1 = with BT + ODM_BOARD_EXT_PA = BIT(3), // 0 = no 2G ext-PA, 1 = existing 2G ext-PA + ODM_BOARD_EXT_LNA = BIT(4), // 0 = no 2G ext-LNA, 1 = existing 2G ext-LNA + ODM_BOARD_EXT_TRSW = BIT(5), // 0 = no ext-TRSW, 1 = existing ext-TRSW + ODM_BOARD_EXT_PA_5G = BIT(6), // 0 = no 5G ext-PA, 1 = existing 5G ext-PA + ODM_BOARD_EXT_LNA_5G= BIT(7), // 0 = no 5G ext-LNA, 1 = existing 5G ext-LNA +}ODM_BOARD_TYPE_E; + +typedef enum tag_ODM_Package_Definition +{ + ODM_PACKAGE_DEFAULT = 0, + ODM_PACKAGE_QFN68 = BIT(0), + ODM_PACKAGE_TFBGA90 = BIT(1), + ODM_PACKAGE_TFBGA79 = BIT(2), +}ODM_Package_TYPE_E; + +typedef enum tag_ODM_TYPE_GPA_Definition +{ + TYPE_GPA0 = 0, + TYPE_GPA1 = BIT(1)|BIT(0) +}ODM_TYPE_GPA_E; + +typedef enum tag_ODM_TYPE_APA_Definition +{ + TYPE_APA0 = 0, + TYPE_APA1 = BIT(1)|BIT(0) +}ODM_TYPE_APA_E; + +typedef enum tag_ODM_TYPE_GLNA_Definition +{ + TYPE_GLNA0 = 0, + TYPE_GLNA1 = BIT(2)|BIT(0), + TYPE_GLNA2 = BIT(3)|BIT(1), + TYPE_GLNA3 = BIT(3)|BIT(2)|BIT(1)|BIT(0) +}ODM_TYPE_GLNA_E; + +typedef enum tag_ODM_TYPE_ALNA_Definition +{ + TYPE_ALNA0 = 0, + TYPE_ALNA1 = BIT(2)|BIT(0), + TYPE_ALNA2 = BIT(3)|BIT(1), + TYPE_ALNA3 = BIT(3)|BIT(2)|BIT(1)|BIT(0) +}ODM_TYPE_ALNA_E; + + +typedef enum _ODM_RF_RADIO_PATH { + ODM_RF_PATH_A = 0, //Radio Path A + ODM_RF_PATH_B = 1, //Radio Path B + ODM_RF_PATH_C = 2, //Radio Path C + ODM_RF_PATH_D = 3, //Radio Path D + ODM_RF_PATH_AB, + ODM_RF_PATH_AC, + ODM_RF_PATH_AD, + ODM_RF_PATH_BC, + ODM_RF_PATH_BD, + ODM_RF_PATH_CD, + ODM_RF_PATH_ABC, + ODM_RF_PATH_ACD, + ODM_RF_PATH_BCD, + ODM_RF_PATH_ABCD, + // ODM_RF_PATH_MAX, //Max RF number 90 support +} ODM_RF_RADIO_PATH_E, *PODM_RF_RADIO_PATH_E; + + + + + + +#endif diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_precomp.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_precomp.h new file mode 100644 index 00000000000000..c2496f371d1255 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_precomp.h @@ -0,0 +1,275 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +#ifndef __ODM_PRECOMP_H__ +#define __ODM_PRECOMP_H__ + +#include "phydm_types.h" + +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) +#include "Precomp.h" // We need to include mp_precomp.h due to batch file setting. +#else +#define TEST_FALG___ 1 +#endif + +//2 Config Flags and Structs - defined by each ODM Type + +#if (DM_ODM_SUPPORT_TYPE == ODM_AP) + #include "../8192cd_cfg.h" + #include "../odm_inc.h" + + #include "../8192cd.h" + #include "../8192cd_util.h" + #ifdef _BIG_ENDIAN_ + #define ODM_ENDIAN_TYPE ODM_ENDIAN_BIG + #else + #define ODM_ENDIAN_TYPE ODM_ENDIAN_LITTLE + #endif + + #ifdef AP_BUILD_WORKAROUND + #include "../8192cd_headers.h" + #include "../8192cd_debug.h" + #endif + +#elif (DM_ODM_SUPPORT_TYPE ==ODM_CE) + #define BEAMFORMING_SUPPORT 0 +#elif (DM_ODM_SUPPORT_TYPE == ODM_WIN) + #include "Mp_Precomp.h" + #define ODM_ENDIAN_TYPE ODM_ENDIAN_LITTLE +#endif + +//2 OutSrc Header Files + +#include "phydm.h" +#include "phydm_HWConfig.h" +#include "phydm_debug.h" +#include "phydm_RegDefine11AC.h" +#include "phydm_RegDefine11N.h" +#include "phydm_interface.h" +#include "phydm_reg.h" +#include "HalPhyRf.h" + +#if (DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_AP)) +#define RTL8821B_SUPPORT 0 +#define RTL8822B_SUPPORT 0 +#define RTL8703B_SUPPORT 0 +#define RTL8188F_SUPPORT 0 +#endif + +#if (RTL8192C_SUPPORT==1) +#include "rtl8192c/phydm_RTL8192C.h" +#if (DM_ODM_SUPPORT_TYPE == ODM_AP) + #include "rtl8192c/Hal8192CEFWImg_AP.h" + #include "rtl8192c/Hal8192CEPHYImg_AP.h" + #include "rtl8192c/Hal8192CEMACImg_AP.h" + #include "rtl8192c/HalDMOutSrc8192C_AP.h" +#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) + #if(RTL8192CE_SUPPORT ==1) + #include "rtl8192c/Hal8192CEFWImg_CE.h" + #include "rtl8192c/Hal8192CEPHYImg_CE.h" + #include "rtl8192c/Hal8192CEMACImg_CE.h" + #elif(RTL8192CU_SUPPORT ==1) + #include "rtl8192c/Hal8192CUFWImg_CE.h" + #include "rtl8192c/Hal8192CUPHYImg_CE.h" + #include "rtl8192c/Hal8192CUMACImg_CE.h" + #endif + #ifdef CONFIG_INTEL_PROXIM + #include "../proxim/intel_proxim.h" + #endif + #include "rtl8192c/HalDMOutSrc8192C_CE.h" + #include +#endif +#endif + +#if (RTL8192D_SUPPORT==1) +#include "rtl8192d/phydm_RTL8192D.h" +#if (DM_ODM_SUPPORT_TYPE == ODM_CE) + #if(RTL8192DE_SUPPORT ==1) + #include "rtl8192d/Hal8192DEFWImg_CE.h" + #include "rtl8192d/Hal8192DEPHYImg_CE.h" + #include "rtl8192d/Hal8192DEMACImg_CE.h" + #elif(RTL8192DU_SUPPORT ==1) + #include "rtl8192d/Hal8192DUFWImg_CE.h" + #include "rtl8192d/Hal8192DUPHYImg_CE.h" + #include "rtl8192d/Hal8192DUMACImg_CE.h" + #endif + #include "rtl8192d/HalDMOutSrc8192D_CE.h" + #include "rtl8192d_hal.h" +#endif +#endif + +#if (RTL8723A_SUPPORT==1) +#include "rtl8723a/HalHWImg8723A_MAC.h" +#include "rtl8723a/HalHWImg8723A_RF.h" +#include "rtl8723a/HalHWImg8723A_BB.h" +#include "rtl8723a/HalHWImg8723A_FW.h" +#include "rtl8723a/phydm_RegConfig8723A.h" +#if (DM_ODM_SUPPORT_TYPE == ODM_CE) + #if(RTL8723AS_SUPPORT==1) + #include "rtl8723a/Hal8723SHWImg_CE.h" + #elif(RTL8723AU_SUPPORT==1) + #include "rtl8723a/Hal8723UHWImg_CE.h" + #endif + #include "rtl8192c/HalDMOutSrc8192C_CE.h" //for IQK,LCK,Power-tracking + #include "rtl8723a_hal.h" +#endif +#endif + +#if (RTL8188E_SUPPORT==1) +#include "rtl8188e/Hal8188ERateAdaptive.h"//for RA,Power training +#include "rtl8188e/HalHWImg8188E_MAC.h" +#include "rtl8188e/HalHWImg8188E_RF.h" +#include "rtl8188e/HalHWImg8188E_BB.h" +#include "rtl8188e/HalHWImg8188E_FW.h" +#include "rtl8188e/phydm_RegConfig8188E.h" +#include "rtl8188e/phydm_RTL8188E.h" +#include "rtl8188e/HalPhyRf_8188e.h" +#include "rtl8188e/Hal8188EReg.h" +#if (DM_ODM_SUPPORT_TYPE == ODM_CE) + #include "rtl8188e_hal.h" +#endif +#endif //88E END + +#if (RTL8192E_SUPPORT==1) +#include "rtl8192e/HalPhyRf_8192e.h" //FOR_8192E_IQK +#include "rtl8192e/phydm_RTL8192E.h" //FOR_8192E_IQK +#if (DM_ODM_SUPPORT_TYPE != ODM_AP) + #include "rtl8192e/HalHWImg8192E_BB.h" + #include "rtl8192e/HalHWImg8192E_MAC.h" + #include "rtl8192e/HalHWImg8192E_RF.h" + #include "rtl8192e/phydm_RegConfig8192E.h" + #include "rtl8192e/HalHWImg8192E_FW.h" + #include "rtl8192e/Hal8192EReg.h" +#endif +#if (DM_ODM_SUPPORT_TYPE == ODM_CE) + #include "rtl8192e_hal.h" +#endif +#endif //92E END + +#if (RTL8812A_SUPPORT==1) +#include "rtl8812a/HalPhyRf_8812A.h" //FOR_8812_IQK +#if (DM_ODM_SUPPORT_TYPE != ODM_AP) + #include "rtl8812a/HalHWImg8812A_BB.h" + #include "rtl8812a/HalHWImg8812A_MAC.h" + #include "rtl8812a/HalHWImg8812A_RF.h" + #include "rtl8812a/phydm_RegConfig8812A.h" + #include "rtl8812a/HalHWImg8812A_FW.h" + #include "rtl8812a/phydm_RTL8812A.h" +#endif +#if (DM_ODM_SUPPORT_TYPE == ODM_CE) + #include "rtl8812a_hal.h" +#endif +#endif //8812 END + +#if (RTL8814A_SUPPORT==1) +#include "rtl8814a/HalPhyRf_8814A.h" +#include "rtl8814a/HalHWImg8814A_MAC.h" +#include "rtl8814a/HalHWImg8814A_RF.h" +#include "rtl8814a/HalHWImg8814A_BB.h" +#if (DM_ODM_SUPPORT_TYPE != ODM_AP) + #include "rtl8814a/HalHWImg8814A_FW.h" + #include "rtl8814a/phydm_RTL8814A.h" +#endif + #include "rtl8814a/phydm_RegConfig8814A.h" +#endif //8814 END + +#if (RTL8881A_SUPPORT==1)//FOR_8881_IQK +#include "rtl8821a/PhyDM_IQK_8821A.h" +//#include "rtl8881a/HalHWImg8881A_BB.h" +//#include "rtl8881a/HalHWImg8881A_MAC.h" +//#include "rtl8881a/HalHWImg8881A_RF.h" +//#include "rtl8881a/odm_RegConfig8881A.h" +#endif + +#if (RTL8723B_SUPPORT==1) +#include "rtl8723b/HalHWImg8723B_MAC.h" +#include "rtl8723b/HalHWImg8723B_RF.h" +#include "rtl8723b/HalHWImg8723B_BB.h" +#include "rtl8723b/HalHWImg8723B_FW.h" +//#include "rtl8723b/Hal8723BReg.h" +#include "rtl8723b/phydm_RegConfig8723B.h" +#include "rtl8723b/phydm_RTL8723B.h" +#include "rtl8723b/HalPhyRf_8723B.h" +#include "rtl8723b/Hal8723BReg.h" +#if (DM_ODM_SUPPORT_TYPE == ODM_CE) + #include "rtl8723b/HalHWImg8723B_MP.h" + #include "rtl8723b_hal.h" +#endif +#endif + +#if (RTL8821A_SUPPORT==1) +#include "rtl8821a/HalHWImg8821A_MAC.h" +#include "rtl8821a/HalHWImg8821A_RF.h" +#include "rtl8821a/HalHWImg8821A_BB.h" +#include "rtl8821a/HalHWImg8821A_FW.h" +#include "rtl8821a/phydm_RegConfig8821A.h" +#include "rtl8821a/phydm_RTL8821A.h" +#include "rtl8821a/HalPhyRf_8821A.h" +#include "rtl8821a/PhyDM_IQK_8821A.h"//for IQK +#if (DM_ODM_SUPPORT_TYPE == ODM_CE) + #include "rtl8812a/HalPhyRf_8812A.h"//for IQK,LCK,Power-tracking + #include "rtl8812a_hal.h" +#endif +#endif + +#if (RTL8821B_SUPPORT==1) +#include "rtl8821b/HalHWImg8821B_MAC.h" +#include "rtl8821b/HalHWImg8821B_RF.h" +#include "rtl8821b/HalHWImg8821B_BB.h" +#include "rtl8821b/HalHWImg8821B_FW.h" +#include "rtl8821b/phydm_RegConfig8821B.h" +#include "rtl8821b/HalHWImg8821B_TestChip_MAC.h" +#include "rtl8821b/HalHWImg8821B_TestChip_RF.h" +#include "rtl8821b/HalHWImg8821B_TestChip_BB.h" +#include "rtl8821b/HalHWImg8821B_TestChip_FW.h" +#include "rtl8821b/HalPhyRf_8821B.h" +#endif + +#if (RTL8822B_SUPPORT==1) +#include "rtl8822B/HalHWImg8822B_MAC.h" +#include "rtl8822B/HalHWImg8822B_RF.h" +#include "rtl8822B/HalHWImg8822B_BB.h" +#include "rtl8822B/HalHWImg8822B_FW.h" +#include "rtl8822B/phydm_RegConfig8822B.h" +#include "rtl8822B/HalHWImg8822B_TestChip_MAC.h" +#include "rtl8822B/HalHWImg8822B_TestChip_RF.h" +#include "rtl8822B/HalHWImg8822B_TestChip_BB.h" +#include "rtl8822B/HalHWImg8822B_TestChip_FW.h" +#include "rtl8822b/HalPhyRf_8822B.h" +#endif + +#if (RTL8703B_SUPPORT==1) +#include "rtl8703b/phydm_RegConfig8703B.h" +#include "rtl8703b/HalHWImg8703B_TestChip_MAC.h" +#include "rtl8703b/HalHWImg8703B_TestChip_RF.h" +#include "rtl8703b/HalHWImg8703B_TestChip_BB.h" +#include "rtl8703b/HalHWImg8703B_FW.h" +#endif + +#if (RTL8188F_SUPPORT==1) +#include "rtl8188f/phydm_RegConfig8188F.h" +#include "rtl8188f/HalHWImg8188F_TestChip_MAC.h" +#include "rtl8188f/HalHWImg8188F_TestChip_RF.h" +#include "rtl8188f/HalHWImg8188F_TestChip_BB.h" +#include "rtl8188f/HalHWImg8188F_FW.h" +#endif + +#endif // __ODM_PRECOMP_H__ + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_reg.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_reg.h new file mode 100644 index 00000000000000..8deff91364f45e --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_reg.h @@ -0,0 +1,208 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ +//============================================================ +// File Name: odm_reg.h +// +// Description: +// +// This file is for general register definition. +// +// +//============================================================ +#ifndef __HAL_ODM_REG_H__ +#define __HAL_ODM_REG_H__ + +// +// Register Definition +// + +//MAC REG +#define ODM_BB_RESET 0x002 +#define ODM_DUMMY 0x4fe +#define RF_T_METER_OLD 0x24 +#define RF_T_METER_NEW 0x42 + +#define ODM_EDCA_VO_PARAM 0x500 +#define ODM_EDCA_VI_PARAM 0x504 +#define ODM_EDCA_BE_PARAM 0x508 +#define ODM_EDCA_BK_PARAM 0x50C +#define ODM_TXPAUSE 0x522 + +//BB REG +#define ODM_FPGA_PHY0_PAGE8 0x800 +#define ODM_PSD_SETTING 0x808 +#define ODM_AFE_SETTING 0x818 +#define ODM_TXAGC_B_6_18 0x830 +#define ODM_TXAGC_B_24_54 0x834 +#define ODM_TXAGC_B_MCS32_5 0x838 +#define ODM_TXAGC_B_MCS0_MCS3 0x83c +#define ODM_TXAGC_B_MCS4_MCS7 0x848 +#define ODM_TXAGC_B_MCS8_MCS11 0x84c +#define ODM_ANALOG_REGISTER 0x85c +#define ODM_RF_INTERFACE_OUTPUT 0x860 +#define ODM_TXAGC_B_MCS12_MCS15 0x868 +#define ODM_TXAGC_B_11_A_2_11 0x86c +#define ODM_AD_DA_LSB_MASK 0x874 +#define ODM_ENABLE_3_WIRE 0x88c +#define ODM_PSD_REPORT 0x8b4 +#define ODM_R_ANT_SELECT 0x90c +#define ODM_CCK_ANT_SELECT 0xa07 +#define ODM_CCK_PD_THRESH 0xa0a +#define ODM_CCK_RF_REG1 0xa11 +#define ODM_CCK_MATCH_FILTER 0xa20 +#define ODM_CCK_RAKE_MAC 0xa2e +#define ODM_CCK_CNT_RESET 0xa2d +#define ODM_CCK_TX_DIVERSITY 0xa2f +#define ODM_CCK_FA_CNT_MSB 0xa5b +#define ODM_CCK_FA_CNT_LSB 0xa5c +#define ODM_CCK_NEW_FUNCTION 0xa75 +#define ODM_OFDM_PHY0_PAGE_C 0xc00 +#define ODM_OFDM_RX_ANT 0xc04 +#define ODM_R_A_RXIQI 0xc14 +#define ODM_R_A_AGC_CORE1 0xc50 +#define ODM_R_A_AGC_CORE2 0xc54 +#define ODM_R_B_AGC_CORE1 0xc58 +#define ODM_R_AGC_PAR 0xc70 +#define ODM_R_HTSTF_AGC_PAR 0xc7c +#define ODM_TX_PWR_TRAINING_A 0xc90 +#define ODM_TX_PWR_TRAINING_B 0xc98 +#define ODM_OFDM_FA_CNT1 0xcf0 +#define ODM_OFDM_PHY0_PAGE_D 0xd00 +#define ODM_OFDM_FA_CNT2 0xda0 +#define ODM_OFDM_FA_CNT3 0xda4 +#define ODM_OFDM_FA_CNT4 0xda8 +#define ODM_TXAGC_A_6_18 0xe00 +#define ODM_TXAGC_A_24_54 0xe04 +#define ODM_TXAGC_A_1_MCS32 0xe08 +#define ODM_TXAGC_A_MCS0_MCS3 0xe10 +#define ODM_TXAGC_A_MCS4_MCS7 0xe14 +#define ODM_TXAGC_A_MCS8_MCS11 0xe18 +#define ODM_TXAGC_A_MCS12_MCS15 0xe1c + +//RF REG +#define ODM_GAIN_SETTING 0x00 +#define ODM_CHANNEL 0x18 +#define ODM_RF_T_METER 0x24 +#define ODM_RF_T_METER_92D 0x42 +#define ODM_RF_T_METER_88E 0x42 +#define ODM_RF_T_METER_92E 0x42 +#define ODM_RF_T_METER_8812 0x42 + +//Ant Detect Reg +#define ODM_DPDT 0x300 + +//PSD Init +#define ODM_PSDREG 0x808 + +//92D Path Div +#define PATHDIV_REG 0xB30 +#define PATHDIV_TRI 0xBA0 + + +// +// Bitmap Definition +// +#if(DM_ODM_SUPPORT_TYPE & (ODM_AP)) +// TX AGC +#define rTxAGC_A_CCK11_CCK1_JAguar 0xc20 +#define rTxAGC_A_Ofdm18_Ofdm6_JAguar 0xc24 +#define rTxAGC_A_Ofdm54_Ofdm24_JAguar 0xc28 +#define rTxAGC_A_MCS3_MCS0_JAguar 0xc2c +#define rTxAGC_A_MCS7_MCS4_JAguar 0xc30 +#define rTxAGC_A_MCS11_MCS8_JAguar 0xc34 +#define rTxAGC_A_MCS15_MCS12_JAguar 0xc38 +#define rTxAGC_A_Nss1Index3_Nss1Index0_JAguar 0xc3c +#define rTxAGC_A_Nss1Index7_Nss1Index4_JAguar 0xc40 +#define rTxAGC_A_Nss2Index1_Nss1Index8_JAguar 0xc44 +#define rTxAGC_A_Nss2Index5_Nss2Index2_JAguar 0xc48 +#define rTxAGC_A_Nss2Index9_Nss2Index6_JAguar 0xc4c +#if defined(CONFIG_WLAN_HAL_8814AE) +#define rTxAGC_A_MCS19_MCS16_JAguar 0xcd8 +#define rTxAGC_A_MCS23_MCS20_JAguar 0xcdc +#define rTxAGC_A_Nss3Index3_Nss3Index0_JAguar 0xce0 +#define rTxAGC_A_Nss3Index7_Nss3Index4_JAguar 0xce4 +#define rTxAGC_A_Nss3Index9_Nss3Index8_JAguar 0xce8 +#endif +#define rTxAGC_B_CCK11_CCK1_JAguar 0xe20 +#define rTxAGC_B_Ofdm18_Ofdm6_JAguar 0xe24 +#define rTxAGC_B_Ofdm54_Ofdm24_JAguar 0xe28 +#define rTxAGC_B_MCS3_MCS0_JAguar 0xe2c +#define rTxAGC_B_MCS7_MCS4_JAguar 0xe30 +#define rTxAGC_B_MCS11_MCS8_JAguar 0xe34 +#define rTxAGC_B_MCS15_MCS12_JAguar 0xe38 +#define rTxAGC_B_Nss1Index3_Nss1Index0_JAguar 0xe3c +#define rTxAGC_B_Nss1Index7_Nss1Index4_JAguar 0xe40 +#define rTxAGC_B_Nss2Index1_Nss1Index8_JAguar 0xe44 +#define rTxAGC_B_Nss2Index5_Nss2Index2_JAguar 0xe48 +#define rTxAGC_B_Nss2Index9_Nss2Index6_JAguar 0xe4c +#if defined(CONFIG_WLAN_HAL_8814AE) +#define rTxAGC_B_MCS19_MCS16_JAguar 0xed8 +#define rTxAGC_B_MCS23_MCS20_JAguar 0xedc +#define rTxAGC_B_Nss3Index3_Nss3Index0_JAguar 0xee0 +#define rTxAGC_B_Nss3Index7_Nss3Index4_JAguar 0xee4 +#define rTxAGC_B_Nss3Index9_Nss3Index8_JAguar 0xee8 +#define rTxAGC_C_CCK11_CCK1_JAguar 0x1820 +#define rTxAGC_C_Ofdm18_Ofdm6_JAguar 0x1824 +#define rTxAGC_C_Ofdm54_Ofdm24_JAguar 0x1828 +#define rTxAGC_C_MCS3_MCS0_JAguar 0x182c +#define rTxAGC_C_MCS7_MCS4_JAguar 0x1830 +#define rTxAGC_C_MCS11_MCS8_JAguar 0x1834 +#define rTxAGC_C_MCS15_MCS12_JAguar 0x1838 +#define rTxAGC_C_Nss1Index3_Nss1Index0_JAguar 0x183c +#define rTxAGC_C_Nss1Index7_Nss1Index4_JAguar 0x1840 +#define rTxAGC_C_Nss2Index1_Nss1Index8_JAguar 0x1844 +#define rTxAGC_C_Nss2Index5_Nss2Index2_JAguar 0x1848 +#define rTxAGC_C_Nss2Index9_Nss2Index6_JAguar 0x184c +#define rTxAGC_C_MCS19_MCS16_JAguar 0x18d8 +#define rTxAGC_C_MCS23_MCS20_JAguar 0x18dc +#define rTxAGC_C_Nss3Index3_Nss3Index0_JAguar 0x18e0 +#define rTxAGC_C_Nss3Index7_Nss3Index4_JAguar 0x18e4 +#define rTxAGC_C_Nss3Index9_Nss3Index8_JAguar 0x18e8 +#define rTxAGC_D_CCK11_CCK1_JAguar 0x1a20 +#define rTxAGC_D_Ofdm18_Ofdm6_JAguar 0x1a24 +#define rTxAGC_D_Ofdm54_Ofdm24_JAguar 0x1a28 +#define rTxAGC_D_MCS3_MCS0_JAguar 0x1a2c +#define rTxAGC_D_MCS7_MCS4_JAguar 0x1a30 +#define rTxAGC_D_MCS11_MCS8_JAguar 0x1a34 +#define rTxAGC_D_MCS15_MCS12_JAguar 0x1a38 +#define rTxAGC_D_Nss1Index3_Nss1Index0_JAguar 0x1a3c +#define rTxAGC_D_Nss1Index7_Nss1Index4_JAguar 0x1a40 +#define rTxAGC_D_Nss2Index1_Nss1Index8_JAguar 0x1a44 +#define rTxAGC_D_Nss2Index5_Nss2Index2_JAguar 0x1a48 +#define rTxAGC_D_Nss2Index9_Nss2Index6_JAguar 0x1a4c +#define rTxAGC_D_MCS19_MCS16_JAguar 0x1ad8 +#define rTxAGC_D_MCS23_MCS20_JAguar 0x1adc +#define rTxAGC_D_Nss3Index3_Nss3Index0_JAguar 0x1ae0 +#define rTxAGC_D_Nss3Index7_Nss3Index4_JAguar 0x1ae4 +#define rTxAGC_D_Nss3Index9_Nss3Index8_JAguar 0x1ae8 +#endif + +#define bTxAGC_byte0_Jaguar 0xff +#define bTxAGC_byte1_Jaguar 0xff00 +#define bTxAGC_byte2_Jaguar 0xff0000 +#define bTxAGC_byte3_Jaguar 0xff000000 +#endif + +#define BIT_FA_RESET BIT0 + + + +#endif + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_types.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_types.h old mode 100755 new mode 100644 similarity index 73% rename from backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_types.h rename to backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_types.h index 27cecceeec61a0..5836c413b0798a --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/odm_types.h +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/phydm_types.h @@ -34,6 +34,12 @@ #define ODM_ENDIAN_BIG 0 #define ODM_ENDIAN_LITTLE 1 +#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) +#define GET_PDM_ODM(__pAdapter) ((PDM_ODM_T)(&((GET_HAL_DATA(__pAdapter))->DM_OutSrc))) +#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) +#define GET_PDM_ODM(__pAdapter) ((PDM_ODM_T)(&((GET_HAL_DATA(__pAdapter))->odmpriv))) +#endif + #if (DM_ODM_SUPPORT_TYPE != ODM_WIN) #define RT_PCI_INTERFACE 1 #define RT_USB_INTERFACE 2 @@ -51,8 +57,10 @@ typedef enum _HAL_STATUS{ RT_STATUS_OS_API_FAILED,*/ }HAL_STATUS,*PHAL_STATUS; - -#if( (DM_ODM_SUPPORT_TYPE == ODM_AP) ||(DM_ODM_SUPPORT_TYPE == ODM_ADSL) || (DM_ODM_SUPPORT_TYPE == ODM_CE)) +#if( DM_ODM_SUPPORT_TYPE == ODM_AP) +#define MP_DRIVER 0 +#endif +#if(DM_ODM_SUPPORT_TYPE != ODM_WIN) #define VISTA_USB_RX_REVISE 0 @@ -77,6 +85,8 @@ typedef enum _RT_SPINLOCK_TYPE{ #endif //Shall we define Ndis 6.2 SpinLock Here ? RT_PORT_SPINLOCK=16, + RT_VNIC_SPINLOCK=17, + RT_HVL_SPINLOCK=18, RT_H2C_SPINLOCK = 20, // For H2C cmd. Added by tynli. 2009.11.09. RT_BTData_SPINLOCK=25, @@ -99,6 +109,8 @@ typedef enum _RT_SPINLOCK_TYPE{ RT_PENDED_OID_SPINLOCK = 39, RT_CHNLLIST_SPINLOCK = 40, RT_INDIC_SPINLOCK = 41, //protect indication + RT_RFD_SPINLOCK = 42, + RT_LAST_SPINLOCK, }RT_SPINLOCK_TYPE; #endif @@ -111,26 +123,53 @@ typedef enum _RT_SPINLOCK_TYPE{ // typedef unsigned long u4Byte,*pu4Byte; #define CONFIG_HW_ANTENNA_DIVERSITY #define CONFIG_SW_ANTENNA_DIVERSITY +//#define CONFIG_PATH_DIVERSITY +#define CONFIG_ANT_DETECTION +#define CONFIG_RA_DBG_CMD #elif (DM_ODM_SUPPORT_TYPE == ODM_AP) // To let ADSL/AP project compile ok; it should be removed after all conflict are solved. Added by Annie, 2011-10-07. #define ADSL_AP_BUILD_WORKAROUND #define AP_BUILD_WORKAROUND - // -#ifdef CONFIG_ANT_SWITCH + + //2 [ Configure RA Debug H2C CMD ] + #define CONFIG_RA_DBG_CMD + + //2 [ Configure Antenna Diversity ] +#if defined(CONFIG_RTL_8881A_ANT_SWITCH) || defined(CONFIG_SLOT_0_ANT_SWITCH) || defined(CONFIG_SLOT_1_ANT_SWITCH) #define CONFIG_HW_ANTENNA_DIVERSITY + #define ODM_EVM_ENHANCE_ANTDIV + + //---------- + #if(!defined(CONFIG_NO_2G_DIVERSITY) && !defined(CONFIG_2G5G_CG_TRX_DIVERSITY_8881A) && !defined(CONFIG_2G_CGCS_RX_DIVERSITY) && !defined(CONFIG_2G_CG_TRX_DIVERSITY) && !defined(CONFIG_2G_CG_SMART_ANT_DIVERSITY)) + #define CONFIG_NO_2G_DIVERSITY + #endif + + #ifdef CONFIG_NO_5G_DIVERSITY_8881A + #define CONFIG_NO_5G_DIVERSITY + #elif defined(CONFIG_5G_CGCS_RX_DIVERSITY_8881A) + #define CONFIG_5G_CGCS_RX_DIVERSITY + #elif defined(CONFIG_5G_CG_TRX_DIVERSITY_8881A) + #define CONFIG_5G_CG_TRX_DIVERSITY + #elif defined(CONFIG_2G5G_CG_TRX_DIVERSITY_8881A) + #define CONFIG_2G5G_CG_TRX_DIVERSITY + #endif + #if(!defined(CONFIG_NO_5G_DIVERSITY) && !defined(CONFIG_5G_CGCS_RX_DIVERSITY) && !defined(CONFIG_5G_CG_TRX_DIVERSITY) && !defined(CONFIG_2G5G_CG_TRX_DIVERSITY) && !defined(CONFIG_5G_CG_SMART_ANT_DIVERSITY)) + #define CONFIG_NO_5G_DIVERSITY + #endif + //---------- #if ( defined(CONFIG_NO_2G_DIVERSITY) && defined(CONFIG_NO_5G_DIVERSITY) ) #define CONFIG_NOT_SUPPORT_ANTDIV #elif( !defined(CONFIG_NO_2G_DIVERSITY) && defined(CONFIG_NO_5G_DIVERSITY) ) #define CONFIG_2G_SUPPORT_ANTDIV #elif( defined(CONFIG_NO_2G_DIVERSITY) && !defined(CONFIG_NO_5G_DIVERSITY) ) #define CONFIG_5G_SUPPORT_ANTDIV - #elif( !defined(CONFIG_NO_2G_DIVERSITY) && !defined(CONFIG_NO_5G_DIVERSITY) ) + #elif( (!defined(CONFIG_NO_2G_DIVERSITY) && !defined(CONFIG_NO_5G_DIVERSITY)) || defined(CONFIG_2G5G_CG_TRX_DIVERSITY) ) #define CONFIG_2G5G_SUPPORT_ANTDIV #endif + //---------- #endif - #ifdef AP_BUILD_WORKAROUND #include "../typedef.h" #else @@ -140,7 +179,13 @@ typedef enum _RT_SPINLOCK_TYPE{ typedef unsigned short u2Byte,*pu2Byte; typedef unsigned int u4Byte,*pu4Byte; typedef unsigned long long u8Byte,*pu8Byte; +#if 1 +/* In ARM platform, system would use the type -- "char" as "unsigned char" + * And we only use s1Byte/ps1Byte as INT8 now, so changes the type of s1Byte.*/ + typedef signed char s1Byte,*ps1Byte; +#else typedef char s1Byte,*ps1Byte; +#endif typedef short s2Byte,*ps2Byte; typedef long s4Byte,*ps4Byte; typedef long long s8Byte,*ps8Byte; @@ -151,41 +196,20 @@ typedef enum _RT_SPINLOCK_TYPE{ typedef struct timer_list RT_TIMER, *PRT_TIMER; typedef void * RT_TIMER_CALL_BACK; +#ifdef CONFIG_PCI_HCI #define DEV_BUS_TYPE RT_PCI_INTERFACE +#endif #define _TRUE 1 #define _FALSE 0 -#elif (DM_ODM_SUPPORT_TYPE == ODM_ADSL) - - // To let ADSL/AP project compile ok; it should be removed after all conflict are solved. Added by Annie, 2011-10-07. - #define ADSL_AP_BUILD_WORKAROUND - #define ADSL_BUILD_WORKAROUND - // - - typedef unsigned char BOOLEAN,*PBOOLEAN; - typedef unsigned char u1Byte,*pu1Byte; - typedef unsigned short u2Byte,*pu2Byte; - typedef unsigned int u4Byte,*pu4Byte; - typedef unsigned long long u8Byte,*pu8Byte; - typedef char s1Byte,*ps1Byte; - typedef short s2Byte,*ps2Byte; - typedef long s4Byte,*ps4Byte; - typedef long long s8Byte,*ps8Byte; - - typedef struct rtl8192cd_priv *prtl8192cd_priv; - typedef struct stat_info STA_INFO_T,*PSTA_INFO_T; - typedef struct timer_list RT_TIMER, *PRT_TIMER; - typedef void * RT_TIMER_CALL_BACK; - - #define DEV_BUS_TYPE RT_PCI_INTERFACE - - #define _TRUE 1 - #define _FALSE 0 - #elif (DM_ODM_SUPPORT_TYPE == ODM_CE) #include + //#define CONFIG_RA_DBG_CMD + //#define CONFIG_ANT_DETECTION + //#define CONFIG_PATH_DIVERSITY + #if 0 typedef u8 u1Byte, *pu1Byte; typedef u16 u2Byte,*pu2Byte; @@ -260,6 +284,9 @@ typedef enum _RT_SPINLOCK_TYPE{ #define RTL8881A_SUPPORT 0 #endif +#define READ_NEXT_PAIR(v1, v2, i) do { if (i+2 >= ArrayLen) break; i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0) +#define COND_ELSE 2 +#define COND_ENDIF 3 #endif // __ODM_TYPES_H__ diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_BB.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_BB.c index 48addb5979a707..db56426e4fb48b 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_BB.c +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_BB.c @@ -18,7 +18,8 @@ * ******************************************************************************/ -#include "../odm_precomp.h" +#include "Mp_Precomp.h" +#include "../phydm_precomp.h" #if (RTL8812A_SUPPORT == 1) static BOOLEAN @@ -28,49 +29,74 @@ CheckPositive( IN const u4Byte Condition2 ) { - u1Byte _GLNA = (pDM_Odm->BoardType & BIT4) >> 4; - u1Byte _GPA = (pDM_Odm->BoardType & BIT3) >> 3; - u1Byte _ALNA = (pDM_Odm->BoardType & BIT7) >> 7; - u1Byte _APA = (pDM_Odm->BoardType & BIT6) >> 6; - - u1Byte cBoard = (u1Byte)((Condition1 & bMaskByte0) >> 0); - u1Byte cInterface = (u1Byte)((Condition1 & (BIT11|BIT10|BIT9|BIT8)) >> 8); - u1Byte cPackage = (u1Byte)((Condition1 & (BIT15|BIT14|BIT13|BIT12)) >> 12); - u1Byte cPlatform = (u1Byte)((Condition1 & (BIT19|BIT18|BIT17|BIT16)) >> 16); - u1Byte cCut = (u1Byte)((Condition1 & (BIT27|BIT26|BIT25|BIT24)) >> 24); - u1Byte cGLNA = (cBoard & BIT0) >> 0; - u1Byte cGPA = (cBoard & BIT1) >> 1; - u1Byte cALNA = (cBoard & BIT2) >> 2; - u1Byte cAPA = (cBoard & BIT3) >> 3; - u1Byte cTypeGLNA = (u1Byte)((Condition2 & bMaskByte0) >> 0); - u1Byte cTypeGPA = (u1Byte)((Condition2 & bMaskByte1) >> 8); - u1Byte cTypeALNA = (u1Byte)((Condition2 & bMaskByte2) >> 16); - u1Byte cTypeAPA = (u1Byte)((Condition2 & bMaskByte3) >> 24); - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, - ("===> [8812A] CheckPositive(0x%X 0x%X)\n", Condition1, Condition2)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, - (" (Platform, Interface) = (0x%X, 0x%X)", pDM_Odm->SupportPlatform, pDM_Odm->SupportInterface)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, - (" (Board, Package) = (0x%X, 0x%X\n", pDM_Odm->BoardType, pDM_Odm->PackageType)); - - if ((cPlatform != pDM_Odm->SupportPlatform && cPlatform != 0) || - (cInterface != pDM_Odm->SupportInterface && cInterface != 0) || - (cCut != pDM_Odm->CutVersion && cCut != 0)) - return FALSE; - - if (cPackage != pDM_Odm->PackageType && cPackage != 0) - return FALSE; - - if (((_GLNA != 0) && (_GLNA == cGLNA) && (cTypeGLNA == pDM_Odm->TypeGLNA)) || - ((_GPA != 0) && (_GPA == cGPA ) && (cTypeGPA == pDM_Odm->TypeGPA )) || - ((_ALNA != 0) && (_ALNA == cALNA) && (cTypeALNA == pDM_Odm->TypeALNA)) || - ((_APA != 0) && (_APA == cAPA ) && (cTypeAPA == pDM_Odm->TypeAPA ))) - return TRUE; - else - return FALSE; + u1Byte _BoardType = ((pDM_Odm->BoardType & BIT4) >> 4) << 0 | // _GLNA + ((pDM_Odm->BoardType & BIT3) >> 3) << 1 | // _GPA + ((pDM_Odm->BoardType & BIT7) >> 7) << 2 | // _ALNA + ((pDM_Odm->BoardType & BIT6) >> 6) << 3 | // _APA + ((pDM_Odm->BoardType & BIT2) >> 2) << 4; // _BT + + u4Byte cond1 = Condition1, cond2 = Condition2; + u4Byte driver1 = pDM_Odm->CutVersion << 24 | + pDM_Odm->SupportPlatform << 16 | + pDM_Odm->PackageType << 12 | + pDM_Odm->SupportInterface << 8 | + _BoardType; + + u4Byte driver2 = pDM_Odm->TypeGLNA << 0 | + pDM_Odm->TypeGPA << 8 | + pDM_Odm->TypeALNA << 16 | + pDM_Odm->TypeAPA << 24; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, + ("===> [8812A] CheckPositive (cond1, cond2) = (0x%X 0x%X)\n", cond1, cond2)); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, + ("===> [8812A] CheckPositive (driver1, driver2) = (0x%X 0x%X)\n", driver1, driver2)); + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, + (" (Platform, Interface) = (0x%X, 0x%X)\n", pDM_Odm->SupportPlatform, pDM_Odm->SupportInterface)); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, + (" (Board, Package) = (0x%X, 0x%X)\n", pDM_Odm->BoardType, pDM_Odm->PackageType)); + + + //============== Value Defined Check ===============// + //QFN Type [15:12] and Cut Version [27:24] need to do value check + + if(((cond1 & 0x0000F000) != 0) &&((cond1 & 0x0000F000) != (driver1 & 0x0000F000))) + return FALSE; + if(((cond1 & 0x0F000000) != 0) &&((cond1 & 0x0F000000) != (driver1 & 0x0F000000))) + return FALSE; + + //=============== Bit Defined Check ================// + // We don't care [31:28] and [23:20] + // + cond1 &= 0x000F0FFF; + driver1 &= 0x000F0FFF; + + if ((cond1 & driver1) == cond1) + { + u4Byte bitMask = 0; + if ((cond1 & 0x0F) == 0) // BoardType is DONTCARE + return TRUE; + + if ((cond1 & BIT0) != 0) //GLNA + bitMask |= 0x000000FF; + if ((cond1 & BIT1) != 0) //GPA + bitMask |= 0x0000FF00; + if ((cond1 & BIT2) != 0) //ALNA + bitMask |= 0x00FF0000; + if ((cond1 & BIT3) != 0) //APA + bitMask |= 0xFF000000; + + if ((cond2 & bitMask) == (driver2 & bitMask)) // BoardType of each RF path is matched + return TRUE; + else + return FALSE; + } + else + { + return FALSE; + } } - static BOOLEAN CheckNegative( IN PDM_ODM_T pDM_Odm, @@ -425,77 +451,209 @@ ODM_ReadAndConfig_MP_8812A_AGC_TAB( IN PDM_ODM_T pDM_Odm ) { - #define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0) - #define COND_ELSE 2 - #define COND_ENDIF 3 u4Byte i = 0; + u1Byte cCond; + BOOLEAN bMatched = TRUE, bSkipped = FALSE; +//ask by Luke.Lee u4Byte ArrayLen = sizeof(Array_MP_8812A_AGC_TAB)/sizeof(u4Byte); pu4Byte Array = Array_MP_8812A_AGC_TAB; ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ReadAndConfig_MP_8812A_AGC_TAB\n")); - for (i = 0; i < ArrayLen; i += 2 ) - { - u4Byte v1 = Array[i]; - u4Byte v2 = Array[i+1]; - - // This (offset, data) pair doesn't care the condition. - if ( v1 < 0x40000000 ) - { - odm_ConfigBB_AGC_8812A(pDM_Odm, v1, bMaskDWord, v2); - continue; - } - else - { // This line is the beginning of branch. - BOOLEAN bMatched = TRUE; - u1Byte cCond = (u1Byte)((v1 & (BIT29|BIT28)) >> 28); - - if (cCond == COND_ELSE) { // ELSE, ENDIF - bMatched = TRUE; - READ_NEXT_PAIR(v1, v2, i); - } else if ( ! CheckPositive(pDM_Odm, v1, v2) ) { - bMatched = FALSE; - READ_NEXT_PAIR(v1, v2, i); - READ_NEXT_PAIR(v1, v2, i); - } else { - READ_NEXT_PAIR(v1, v2, i); - if ( ! CheckNegative(pDM_Odm, v1, v2) ) - bMatched = FALSE; - else - bMatched = TRUE; - READ_NEXT_PAIR(v1, v2, i); - } - - if ( bMatched == FALSE ) - { // Condition isn't matched. Discard the following (offset, data) pairs. - while (v1 < 0x40000000 && i < ArrayLen -2) - READ_NEXT_PAIR(v1, v2, i); - - i -= 2; // prevent from for-loop += 2 - } - else // Configure matched pairs and skip to end of if-else. - { - while (v1 < 0x40000000 && i < ArrayLen-2) { - odm_ConfigBB_AGC_8812A(pDM_Odm, v1, bMaskDWord, v2); - READ_NEXT_PAIR(v1, v2, i); - } - - // Keeps reading until ENDIF. - cCond = (u1Byte)((v1 & (BIT29|BIT28)) >> 28); - while (cCond != COND_ENDIF && i < ArrayLen-2) { - READ_NEXT_PAIR(v1, v2, i); - cCond = (u1Byte)((v1 & (BIT29|BIT28)) >> 28); - } - } - } - } + while(( i+1) < ArrayLen) + { + u4Byte v1 = Array[i]; + u4Byte v2 = Array[i+1]; + + if(v1 & (BIT31|BIT30)) //positive & negative condition + { + if(v1 & BIT31) // positive condition + { + cCond = (u1Byte)((v1 & (BIT29|BIT28)) >> 28); + if(cCond == COND_ENDIF) //end + { + bMatched = TRUE; + bSkipped = FALSE; + } + else if(cCond == COND_ELSE) //else + { + bMatched = bSkipped?FALSE:TRUE; + } + else //if , else if + { + if(bSkipped) + bMatched = FALSE; + else + { + if(CheckPositive(pDM_Odm, v1, v2)) + { + bMatched = TRUE; + bSkipped = TRUE; + } + else + { + bMatched = FALSE; + bSkipped = FALSE; + } + } + } + } + else if(v1 & BIT30){ //negative condition + //do nothing + } + } + else + { + if(bMatched) + odm_ConfigBB_AGC_8812A(pDM_Odm, v1, bMaskDWord, v2); + } + i = i + 2; + } +} + +u4Byte +ODM_GetVersion_MP_8812A_AGC_TAB(void) +{ + return 49; +} + +/****************************************************************************** +* AGC_TAB_DIFF.TXT +******************************************************************************/ + +u4Byte Array_MP_8812A_AGC_TAB_DIFF_LB[] = { + 0x80000004,0x00000000,0x40000000,0x00000000, + 0x81C, 0x47CE0001, + 0x81C, 0x46D00001, + 0x81C, 0x45D20001, + 0x81C, 0x44D40001, + 0x81C, 0x43D60001, + 0x81C, 0x42D80001, + 0x81C, 0x08DA0001, + 0x81C, 0x07DC0001, + 0x81C, 0x06DE0001, + 0x81C, 0x05E00001, + 0x81C, 0x04E20001, + 0x81C, 0x03E40001, + 0x81C, 0x02E60001, + 0xA0000000,0x00000000, + 0x81C, 0x47D80001, + 0x81C, 0x46DA0001, + 0x81C, 0x45DC0001, + 0x81C, 0x44DE0001, + 0x81C, 0x43E00001, + 0x81C, 0x42E20001, + 0x81C, 0x08E40001, + 0x81C, 0x07E60001, + 0x81C, 0x06E80001, + 0x81C, 0x05EA0001, + 0x81C, 0x04EC0001, + 0x81C, 0x03EE0001, + 0x81C, 0x02F00001, + 0xB0000000,0x00000000, +}; + +u4Byte Array_MP_8812A_AGC_TAB_DIFF_HB[] = { + 0x80000004,0x00000000,0x40000000,0x00000000, + 0x81C, 0x45CE0001, + 0x81C, 0x44D00001, + 0x81C, 0x43D20001, + 0x81C, 0x42D40001, + 0x81C, 0x08D60001, + 0x81C, 0x07D80001, + 0x81C, 0x06DA0001, + 0x81C, 0x05DC0001, + 0x81C, 0x04DE0001, + 0x81C, 0x03E00001, + 0x81C, 0x02E20001, + 0x81C, 0x01E40001, + 0x81C, 0x01E60001, + 0xA0000000,0x00000000, + 0x81C, 0x45D80001, + 0x81C, 0x44DA0001, + 0x81C, 0x43DC0001, + 0x81C, 0x42DE0001, + 0x81C, 0x08E00001, + 0x81C, 0x07E20001, + 0x81C, 0x06E40001, + 0x81C, 0x05E60001, + 0x81C, 0x04E80001, + 0x81C, 0x03EA0001, + 0x81C, 0x02EC0001, + 0x81C, 0x01EE0001, + 0x81C, 0x01F00001, + 0xB0000000,0x00000000, +}; + +void +ODM_ReadAndConfig_MP_8812A_AGC_TAB_DIFF( + IN PDM_ODM_T pDM_Odm, + IN u4Byte Array[], + IN u4Byte ArrayLen + ) +{ + u4Byte i = 0; + u1Byte cCond; + BOOLEAN bMatched = TRUE, bSkipped = FALSE; +//ask by Luke.Lee + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ReadAndConfig_MP_8812A_AGC_TAB_DIFF\n")); + + while(( i+1) < ArrayLen) + { + u4Byte v1 = Array[i]; + u4Byte v2 = Array[i+1]; + + if(v1 & (BIT31|BIT30)) //positive & negative condition + { + if(v1 & BIT31) // positive condition + { + cCond = (u1Byte)((v1 & (BIT29|BIT28)) >> 28); + if(cCond == COND_ENDIF) //end + { + bMatched = TRUE; + bSkipped = FALSE; + } + else if(cCond == COND_ELSE) //else + { + bMatched = bSkipped?FALSE:TRUE; + } + else //if , else if + { + if(bSkipped) + bMatched = FALSE; + else + { + if(CheckPositive(pDM_Odm, v1, v2)) + { + bMatched = TRUE; + bSkipped = TRUE; + } + else + { + bMatched = FALSE; + bSkipped = FALSE; + } + } + } + } + else if(v1 & BIT30){ //negative condition + //do nothing + } + } + else + { + if(bMatched) + odm_ConfigBB_AGC_8812A(pDM_Odm, v1, bMaskDWord, v2); + } + i = i + 2; + } } u4Byte -ODM_GetVersion_MP_8812A_AGC_TAB( -) +ODM_GetVersion_MP_8812A_AGC_TAB_DIFF(void) { - return 40; + return 49; } /****************************************************************************** @@ -514,7 +672,7 @@ u4Byte Array_MP_8812A_PHY_REG[] = { 0x824, 0x00030FE0, 0x828, 0x00000000, 0x82C, 0x002083DD, - 0x830, 0x2AAA6C86, + 0x830, 0x2EAAEEB8, 0x834, 0x0037A706, 0x838, 0x06C89B44, 0x83C, 0x0000095B, @@ -544,7 +702,7 @@ u4Byte Array_MP_8812A_PHY_REG[] = { 0x8BC, 0x4CA520A3, 0x8C0, 0x27F00020, 0x8C4, 0x00000000, - 0x8C8, 0x00013169, + 0x8C8, 0x00012D69, 0x8CC, 0x08248492, 0x8D0, 0x0000B800, 0x8DC, 0x00000000, @@ -740,223 +898,151 @@ ODM_ReadAndConfig_MP_8812A_PHY_REG( IN PDM_ODM_T pDM_Odm ) { - #define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0) - #define COND_ELSE 2 - #define COND_ENDIF 3 u4Byte i = 0; + u1Byte cCond; + BOOLEAN bMatched = TRUE, bSkipped = FALSE; +//ask by Luke.Lee u4Byte ArrayLen = sizeof(Array_MP_8812A_PHY_REG)/sizeof(u4Byte); pu4Byte Array = Array_MP_8812A_PHY_REG; ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ReadAndConfig_MP_8812A_PHY_REG\n")); - for (i = 0; i < ArrayLen; i += 2 ) - { - u4Byte v1 = Array[i]; - u4Byte v2 = Array[i+1]; - - // This (offset, data) pair doesn't care the condition. - if ( v1 < 0x40000000 ) - { - odm_ConfigBB_PHY_8812A(pDM_Odm, v1, bMaskDWord, v2); - continue; - } - else - { // This line is the beginning of branch. - BOOLEAN bMatched = TRUE; - u1Byte cCond = (u1Byte)((v1 & (BIT29|BIT28)) >> 28); - - if (cCond == COND_ELSE) { // ELSE, ENDIF - bMatched = TRUE; - READ_NEXT_PAIR(v1, v2, i); - } else if ( ! CheckPositive(pDM_Odm, v1, v2) ) { - bMatched = FALSE; - READ_NEXT_PAIR(v1, v2, i); - READ_NEXT_PAIR(v1, v2, i); - } else { - READ_NEXT_PAIR(v1, v2, i); - if ( ! CheckNegative(pDM_Odm, v1, v2) ) - bMatched = FALSE; - else - bMatched = TRUE; - READ_NEXT_PAIR(v1, v2, i); - } - - if ( bMatched == FALSE ) - { // Condition isn't matched. Discard the following (offset, data) pairs. - while (v1 < 0x40000000 && i < ArrayLen -2) - READ_NEXT_PAIR(v1, v2, i); - - i -= 2; // prevent from for-loop += 2 - } - else // Configure matched pairs and skip to end of if-else. - { - while (v1 < 0x40000000 && i < ArrayLen-2) { - odm_ConfigBB_PHY_8812A(pDM_Odm, v1, bMaskDWord, v2); - READ_NEXT_PAIR(v1, v2, i); - } - - // Keeps reading until ENDIF. - cCond = (u1Byte)((v1 & (BIT29|BIT28)) >> 28); - while (cCond != COND_ENDIF && i < ArrayLen-2) { - READ_NEXT_PAIR(v1, v2, i); - cCond = (u1Byte)((v1 & (BIT29|BIT28)) >> 28); - } - } - } - } + while(( i+1) < ArrayLen) + { + u4Byte v1 = Array[i]; + u4Byte v2 = Array[i+1]; + + if(v1 & (BIT31|BIT30)) //positive & negative condition + { + if(v1 & BIT31) // positive condition + { + cCond = (u1Byte)((v1 & (BIT29|BIT28)) >> 28); + if(cCond == COND_ENDIF) //end + { + bMatched = TRUE; + bSkipped = FALSE; + } + else if(cCond == COND_ELSE) //else + { + bMatched = bSkipped?FALSE:TRUE; + } + else //if , else if + { + if(bSkipped) + bMatched = FALSE; + else + { + if(CheckPositive(pDM_Odm, v1, v2)) + { + bMatched = TRUE; + bSkipped = TRUE; + } + else + { + bMatched = FALSE; + bSkipped = FALSE; + } + } + } + } + else if(v1 & BIT30){ //negative condition + //do nothing + } + } + else + { + if(bMatched) + odm_ConfigBB_PHY_8812A(pDM_Odm, v1, bMaskDWord, v2); + } + i = i + 2; + } } u4Byte -ODM_GetVersion_MP_8812A_PHY_REG( -) +ODM_GetVersion_MP_8812A_PHY_REG(void) { - return 40; + return 49; } /****************************************************************************** -* AGC_TAB_DIFF.TXT +* PHY_REG_MP.TXT ******************************************************************************/ -u4Byte Array_MP_8812A_AGC_TAB_DIFF_LB[] = { - 0x80000004,0x00000000,0x40000000,0x00000000, - 0x81C, 0x47CE0001, - 0x81C, 0x46D00001, - 0x81C, 0x45D20001, - 0x81C, 0x44D40001, - 0x81C, 0x43D60001, - 0x81C, 0x42D80001, - 0x81C, 0x08DA0001, - 0x81C, 0x07DC0001, - 0x81C, 0x06DE0001, - 0x81C, 0x05E00001, - 0x81C, 0x04E20001, - 0x81C, 0x03E40001, - 0x81C, 0x02E60001, - 0xA0000000,0x00000000, - 0x81C, 0x47D80001, - 0x81C, 0x46DA0001, - 0x81C, 0x45DC0001, - 0x81C, 0x44DE0001, - 0x81C, 0x43E00001, - 0x81C, 0x42E20001, - 0x81C, 0x08E40001, - 0x81C, 0x07E60001, - 0x81C, 0x06E80001, - 0x81C, 0x05EA0001, - 0x81C, 0x04EC0001, - 0x81C, 0x03EE0001, - 0x81C, 0x02F00001, - 0xB0000000,0x00000000, -}; +u4Byte Array_MP_8812A_PHY_REG_MP[] = { + 0x800, 0x8020D410, + 0x830, 0x2EAA8EB8, -u4Byte Array_MP_8812A_AGC_TAB_DIFF_HB[] = { - 0x80000004,0x00000000,0x40000000,0x00000000, - 0x81C, 0x45CE0001, - 0x81C, 0x44D00001, - 0x81C, 0x43D20001, - 0x81C, 0x42D40001, - 0x81C, 0x08D60001, - 0x81C, 0x07D80001, - 0x81C, 0x06DA0001, - 0x81C, 0x05DC0001, - 0x81C, 0x04DE0001, - 0x81C, 0x03E00001, - 0x81C, 0x02E20001, - 0x81C, 0x01E40001, - 0x81C, 0x01E60001, - 0xA0000000,0x00000000, - 0x81C, 0x45D80001, - 0x81C, 0x44DA0001, - 0x81C, 0x43DC0001, - 0x81C, 0x42DE0001, - 0x81C, 0x08E00001, - 0x81C, 0x07E20001, - 0x81C, 0x06E40001, - 0x81C, 0x05E60001, - 0x81C, 0x04E80001, - 0x81C, 0x03EA0001, - 0x81C, 0x02EC0001, - 0x81C, 0x01EE0001, - 0x81C, 0x01F00001, - 0xB0000000,0x00000000, }; void -ODM_ReadAndConfig_MP_8812A_AGC_TAB_DIFF( - IN PDM_ODM_T pDM_Odm, - IN u4Byte Array[], - IN u4Byte ArrayLen +ODM_ReadAndConfig_MP_8812A_PHY_REG_MP( + IN PDM_ODM_T pDM_Odm ) { - #define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0) - #define COND_ELSE 2 - #define COND_ENDIF 3 u4Byte i = 0; + u1Byte cCond; + BOOLEAN bMatched = TRUE, bSkipped = FALSE; +//ask by Luke.Lee + u4Byte ArrayLen = sizeof(Array_MP_8812A_PHY_REG_MP)/sizeof(u4Byte); + pu4Byte Array = Array_MP_8812A_PHY_REG_MP; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ReadAndConfig_MP_8812A_AGC_TAB_DIFF\n")); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ReadAndConfig_MP_8812A_PHY_REG_MP\n")); - for (i = 0; i < ArrayLen; i += 2 ) - { - u4Byte v1 = Array[i]; - u4Byte v2 = Array[i+1]; - - // This (offset, data) pair doesn't care the condition. - if ( v1 < 0x40000000 ) - { - odm_ConfigBB_AGC_8812A(pDM_Odm, v1, bMaskDWord, v2); - continue; - } - else - { // This line is the beginning of branch. - BOOLEAN bMatched = TRUE; - u1Byte cCond = (u1Byte)((v1 & (BIT29|BIT28)) >> 28); - - if (cCond == COND_ELSE) { // ELSE, ENDIF - bMatched = TRUE; - READ_NEXT_PAIR(v1, v2, i); - } else if ( ! CheckPositive(pDM_Odm, v1, v2) ) { - bMatched = FALSE; - READ_NEXT_PAIR(v1, v2, i); - READ_NEXT_PAIR(v1, v2, i); - } else { - READ_NEXT_PAIR(v1, v2, i); - if ( ! CheckNegative(pDM_Odm, v1, v2) ) - bMatched = FALSE; - else - bMatched = TRUE; - READ_NEXT_PAIR(v1, v2, i); - } - - if ( bMatched == FALSE ) - { // Condition isn't matched. Discard the following (offset, data) pairs. - while (v1 < 0x40000000 && i < ArrayLen -2) - READ_NEXT_PAIR(v1, v2, i); - - i -= 2; // prevent from for-loop += 2 - } - else // Configure matched pairs and skip to end of if-else. - { - while (v1 < 0x40000000 && i < ArrayLen-2) { - odm_ConfigBB_AGC_8812A(pDM_Odm, v1, bMaskDWord, v2); - READ_NEXT_PAIR(v1, v2, i); - } - - // Keeps reading until ENDIF. - cCond = (u1Byte)((v1 & (BIT29|BIT28)) >> 28); - while (cCond != COND_ENDIF && i < ArrayLen-2) { - READ_NEXT_PAIR(v1, v2, i); - cCond = (u1Byte)((v1 & (BIT29|BIT28)) >> 28); - } - } - } - } + while(( i+1) < ArrayLen) + { + u4Byte v1 = Array[i]; + u4Byte v2 = Array[i+1]; + + if(v1 & (BIT31|BIT30)) //positive & negative condition + { + if(v1 & BIT31) // positive condition + { + cCond = (u1Byte)((v1 & (BIT29|BIT28)) >> 28); + if(cCond == COND_ENDIF) //end + { + bMatched = TRUE; + bSkipped = FALSE; + } + else if(cCond == COND_ELSE) //else + { + bMatched = bSkipped?FALSE:TRUE; + } + else //if , else if + { + if(bSkipped) + bMatched = FALSE; + else + { + if(CheckPositive(pDM_Odm, v1, v2)) + { + bMatched = TRUE; + bSkipped = TRUE; + } + else + { + bMatched = FALSE; + bSkipped = FALSE; + } + } + } + } + else if(v1 & BIT30){ //negative condition + //do nothing + } + } + else + { + if(bMatched) + odm_ConfigBB_PHY_8812A(pDM_Odm, v1, bMaskDWord, v2); + } + i = i + 2; + } } u4Byte -ODM_GetVersion_MP_8812A_AGC_TAB_DIFF( -) +ODM_GetVersion_MP_8812A_PHY_REG_MP(void) { - return 40; + return 49; } /****************************************************************************** @@ -1017,22 +1103,15 @@ ODM_ReadAndConfig_MP_8812A_PHY_REG_PG( IN PDM_ODM_T pDM_Odm ) { - u4Byte hex = 0; - u4Byte i = 0; - u2Byte count = 0; - pu4Byte ptr_array = NULL; - u1Byte platform = pDM_Odm->SupportPlatform; - u1Byte _interface = pDM_Odm->SupportInterface; - u1Byte board = pDM_Odm->BoardType; - u4Byte ArrayLen = sizeof(Array_MP_8812A_PHY_REG_PG)/sizeof(u4Byte); - pu4Byte Array = Array_MP_8812A_PHY_REG_PG; + u4Byte i = 0; + u4Byte ArrayLen = sizeof(Array_MP_8812A_PHY_REG_PG)/sizeof(u4Byte); + pu4Byte Array = Array_MP_8812A_PHY_REG_PG; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ReadAndConfig_MP_8812A_PHY_REG_PG\n")); pDM_Odm->PhyRegPgVersion = 1; pDM_Odm->PhyRegPgValueType = PHY_REG_PG_EXACT_VALUE; - hex += board; - hex += _interface << 8; - hex += platform << 16; - hex += 0xFF000000; + for (i = 0; i < ArrayLen; i += 6 ) { u4Byte v1 = Array[i]; @@ -1042,8 +1121,7 @@ ODM_ReadAndConfig_MP_8812A_PHY_REG_PG( u4Byte v5 = Array[i+4]; u4Byte v6 = Array[i+5]; - // this line is a line of pure_body - odm_ConfigBB_PHY_REG_PG_8812A(pDM_Odm, v1, v2, v3, v4, v5, v6); + odm_ConfigBB_PHY_REG_PG_8812A(pDM_Odm, v1, v2, v3, v4, v5, v6); } } @@ -1054,52 +1132,52 @@ ODM_ReadAndConfig_MP_8812A_PHY_REG_PG( ******************************************************************************/ u4Byte Array_MP_8812A_PHY_REG_PG_ASUS[] = { - 0, 0, 0, 0x00000c20, 0xffffffff, 0x30323438, - 0, 0, 0, 0x00000c24, 0xffffffff, 0x34343438, - 0, 0, 0, 0x00000c28, 0xffffffff, 0x28323434, - 0, 0, 0, 0x00000c2c, 0xffffffff, 0x32323438, - 0, 0, 0, 0x00000c30, 0xffffffff, 0x28283030, - 0, 0, 1, 0x00000c34, 0xffffffff, 0x30303234, - 0, 0, 1, 0x00000c38, 0xffffffff, 0x26262828, - 0, 0, 0, 0x00000c3c, 0xffffffff, 0x32323438, - 0, 0, 0, 0x00000c40, 0xffffffff, 0x28283030, - 0, 0, 0, 0x00000c44, 0xffffffff, 0x36382224, - 0, 0, 1, 0x00000c48, 0xffffffff, 0x30343636, - 0, 0, 1, 0x00000c4c, 0xffffffff, 0x22242628, - 0, 1, 0, 0x00000e20, 0xffffffff, 0x30323438, - 0, 1, 0, 0x00000e24, 0xffffffff, 0x34343438, - 0, 1, 0, 0x00000e28, 0xffffffff, 0x28323434, - 0, 1, 0, 0x00000e2c, 0xffffffff, 0x32323438, - 0, 1, 0, 0x00000e30, 0xffffffff, 0x28283030, - 0, 1, 1, 0x00000e34, 0xffffffff, 0x30303234, - 0, 1, 1, 0x00000e38, 0xffffffff, 0x26262828, - 0, 1, 0, 0x00000e3c, 0xffffffff, 0x32323438, - 0, 1, 0, 0x00000e40, 0xffffffff, 0x28283030, - 0, 1, 0, 0x00000e44, 0xffffffff, 0x36382224, - 0, 1, 1, 0x00000e48, 0xffffffff, 0x30343636, - 0, 1, 1, 0x00000e4c, 0xffffffff, 0x22242628, - 1, 0, 0, 0x00000c24, 0xffffffff, 0x36363636, - 1, 0, 0, 0x00000c28, 0xffffffff, 0x28343636, - 1, 0, 0, 0x00000c2c, 0xffffffff, 0x36363636, - 1, 0, 0, 0x00000c30, 0xffffffff, 0x28323436, - 1, 0, 1, 0x00000c34, 0xffffffff, 0x36363636, - 1, 0, 1, 0x00000c38, 0xffffffff, 0x26303234, - 1, 0, 0, 0x00000c3c, 0xffffffff, 0x36363636, - 1, 0, 0, 0x00000c40, 0xffffffff, 0x28303234, - 1, 0, 0, 0x00000c44, 0xffffffff, 0x34342828, - 1, 0, 1, 0x00000c48, 0xffffffff, 0x30323434, - 1, 0, 1, 0x00000c4c, 0xffffffff, 0x26262628, - 1, 1, 0, 0x00000e24, 0xffffffff, 0x36363636, - 1, 1, 0, 0x00000e28, 0xffffffff, 0x28343636, - 1, 1, 0, 0x00000e2c, 0xffffffff, 0x36363636, - 1, 1, 0, 0x00000e30, 0xffffffff, 0x28323436, - 1, 1, 1, 0x00000e34, 0xffffffff, 0x36363636, - 1, 1, 1, 0x00000e38, 0xffffffff, 0x26303234, - 1, 1, 0, 0x00000e3c, 0xffffffff, 0x36363636, - 1, 1, 0, 0x00000e40, 0xffffffff, 0x28303234, - 1, 1, 0, 0x00000e44, 0xffffffff, 0x34342828, - 1, 1, 1, 0x00000e48, 0xffffffff, 0x30323434, - 1, 1, 1, 0x00000e4c, 0xffffffff, 0x26262628 + 0, 0, 0, 0x00000c20, 0xffffffff, 0x34343434, + 0, 0, 0, 0x00000c24, 0xffffffff, 0x32323232, + 0, 0, 0, 0x00000c28, 0xffffffff, 0x28303232, + 0, 0, 0, 0x00000c2c, 0xffffffff, 0x32323232, + 0, 0, 0, 0x00000c30, 0xffffffff, 0x28303232, + 0, 0, 1, 0x00000c34, 0xffffffff, 0x32323232, + 0, 0, 1, 0x00000c38, 0xffffffff, 0x26283032, + 0, 0, 0, 0x00000c3c, 0xffffffff, 0x32323232, + 0, 0, 0, 0x00000c40, 0xffffffff, 0x28303232, + 0, 0, 0, 0x00000c44, 0xffffffff, 0x32322426, + 0, 0, 1, 0x00000c48, 0xffffffff, 0x32323232, + 0, 0, 1, 0x00000c4c, 0xffffffff, 0x24262830, + 0, 1, 0, 0x00000e20, 0xffffffff, 0x34343434, + 0, 1, 0, 0x00000e24, 0xffffffff, 0x32323232, + 0, 1, 0, 0x00000e28, 0xffffffff, 0x28303232, + 0, 1, 0, 0x00000e2c, 0xffffffff, 0x32323232, + 0, 1, 0, 0x00000e30, 0xffffffff, 0x28303232, + 0, 1, 1, 0x00000e34, 0xffffffff, 0x32323232, + 0, 1, 1, 0x00000e38, 0xffffffff, 0x26283032, + 0, 1, 0, 0x00000e3c, 0xffffffff, 0x32323232, + 0, 1, 0, 0x00000e40, 0xffffffff, 0x28303232, + 0, 1, 0, 0x00000e44, 0xffffffff, 0x32322426, + 0, 1, 1, 0x00000e48, 0xffffffff, 0x32323232, + 0, 1, 1, 0x00000e4c, 0xffffffff, 0x24262830, + 1, 0, 0, 0x00000c24, 0xffffffff, 0x32323232, + 1, 0, 0, 0x00000c28, 0xffffffff, 0x28303232, + 1, 0, 0, 0x00000c2c, 0xffffffff, 0x32323232, + 1, 0, 0, 0x00000c30, 0xffffffff, 0x24262830, + 1, 0, 1, 0x00000c34, 0xffffffff, 0x32323232, + 1, 0, 1, 0x00000c38, 0xffffffff, 0x24262830, + 1, 0, 0, 0x00000c3c, 0xffffffff, 0x32323232, + 1, 0, 0, 0x00000c40, 0xffffffff, 0x24262830, + 1, 0, 0, 0x00000c44, 0xffffffff, 0x32322222, + 1, 0, 1, 0x00000c48, 0xffffffff, 0x28303232, + 1, 0, 1, 0x00000c4c, 0xffffffff, 0x22222426, + 1, 1, 0, 0x00000e24, 0xffffffff, 0x32323232, + 1, 1, 0, 0x00000e28, 0xffffffff, 0x28303232, + 1, 1, 0, 0x00000e2c, 0xffffffff, 0x32323232, + 1, 1, 0, 0x00000e30, 0xffffffff, 0x24262830, + 1, 1, 1, 0x00000e34, 0xffffffff, 0x32323232, + 1, 1, 1, 0x00000e38, 0xffffffff, 0x24262830, + 1, 1, 0, 0x00000e3c, 0xffffffff, 0x32323232, + 1, 1, 0, 0x00000e40, 0xffffffff, 0x24262830, + 1, 1, 0, 0x00000e44, 0xffffffff, 0x32322222, + 1, 1, 1, 0x00000e48, 0xffffffff, 0x28303232, + 1, 1, 1, 0x00000e4c, 0xffffffff, 0x22222426 }; void @@ -1107,22 +1185,15 @@ ODM_ReadAndConfig_MP_8812A_PHY_REG_PG_ASUS( IN PDM_ODM_T pDM_Odm ) { - u4Byte hex = 0; - u4Byte i = 0; - u2Byte count = 0; - pu4Byte ptr_array = NULL; - u1Byte platform = pDM_Odm->SupportPlatform; - u1Byte _interface = pDM_Odm->SupportInterface; - u1Byte board = pDM_Odm->BoardType; - u4Byte ArrayLen = sizeof(Array_MP_8812A_PHY_REG_PG)/sizeof(u4Byte); - pu4Byte Array = Array_MP_8812A_PHY_REG_PG; + u4Byte i = 0; + u4Byte ArrayLen = sizeof(Array_MP_8812A_PHY_REG_PG_ASUS)/sizeof(u4Byte); + pu4Byte Array = Array_MP_8812A_PHY_REG_PG_ASUS; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ReadAndConfig_MP_8812A_PHY_REG_PG_ASUS\n")); pDM_Odm->PhyRegPgVersion = 1; pDM_Odm->PhyRegPgValueType = PHY_REG_PG_EXACT_VALUE; - hex += board; - hex += _interface << 8; - hex += platform << 16; - hex += 0xFF000000; + for (i = 0; i < ArrayLen; i += 6 ) { u4Byte v1 = Array[i]; @@ -1132,8 +1203,7 @@ ODM_ReadAndConfig_MP_8812A_PHY_REG_PG_ASUS( u4Byte v5 = Array[i+4]; u4Byte v6 = Array[i+5]; - // this line is a line of pure_body - odm_ConfigBB_PHY_REG_PG_8812A(pDM_Odm, v1, v2, v3, v4, v5, v6); + odm_ConfigBB_PHY_REG_PG_8812A(pDM_Odm, v1, v2, v3, v4, v5, v6); } } @@ -1197,22 +1267,15 @@ ODM_ReadAndConfig_MP_8812A_PHY_REG_PG_NEC( IN PDM_ODM_T pDM_Odm ) { - u4Byte hex = 0; - u4Byte i = 0; - u2Byte count = 0; - pu4Byte ptr_array = NULL; - u1Byte platform = pDM_Odm->SupportPlatform; - u1Byte _interface = pDM_Odm->SupportInterface; - u1Byte board = pDM_Odm->BoardType; - u4Byte ArrayLen = sizeof(Array_MP_8812A_PHY_REG_PG)/sizeof(u4Byte); - pu4Byte Array = Array_MP_8812A_PHY_REG_PG; + u4Byte i = 0; + u4Byte ArrayLen = sizeof(Array_MP_8812A_PHY_REG_PG_NEC)/sizeof(u4Byte); + pu4Byte Array = Array_MP_8812A_PHY_REG_PG_NEC; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ReadAndConfig_MP_8812A_PHY_REG_PG_NEC\n")); pDM_Odm->PhyRegPgVersion = 1; pDM_Odm->PhyRegPgValueType = PHY_REG_PG_EXACT_VALUE; - hex += board; - hex += _interface << 8; - hex += platform << 16; - hex += 0xFF000000; + for (i = 0; i < ArrayLen; i += 6 ) { u4Byte v1 = Array[i]; @@ -1222,101 +1285,11 @@ ODM_ReadAndConfig_MP_8812A_PHY_REG_PG_NEC( u4Byte v5 = Array[i+4]; u4Byte v6 = Array[i+5]; - // this line is a line of pure_body - odm_ConfigBB_PHY_REG_PG_8812A(pDM_Odm, v1, v2, v3, v4, v5, v6); + odm_ConfigBB_PHY_REG_PG_8812A(pDM_Odm, v1, v2, v3, v4, v5, v6); } } -/****************************************************************************** -* PHY_REG_MP.TXT -******************************************************************************/ - -u4Byte Array_MP_8812A_PHY_REG_MP[] = { - 0x800, 0x8020D410, - 0x830, 0x2EAA8EB6, - 0xC90, 0x01E00000, - -}; - -void -ODM_ReadAndConfig_MP_8812A_PHY_REG_MP( - IN PDM_ODM_T pDM_Odm - ) -{ - #define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0) - #define COND_ELSE 2 - #define COND_ENDIF 3 - u4Byte i = 0; - u4Byte ArrayLen = sizeof(Array_MP_8812A_PHY_REG_MP)/sizeof(u4Byte); - pu4Byte Array = Array_MP_8812A_PHY_REG_MP; - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ReadAndConfig_MP_8812A_PHY_REG_MP\n")); - - for (i = 0; i < ArrayLen; i += 2 ) - { - u4Byte v1 = Array[i]; - u4Byte v2 = Array[i+1]; - - // This (offset, data) pair doesn't care the condition. - if ( v1 < 0x40000000 ) - { - odm_ConfigBB_PHY_8812A(pDM_Odm, v1, bMaskDWord, v2); - continue; - } - else - { // This line is the beginning of branch. - BOOLEAN bMatched = TRUE; - u1Byte cCond = (u1Byte)((v1 & (BIT29|BIT28)) >> 28); - - if (cCond == COND_ELSE) { // ELSE, ENDIF - bMatched = TRUE; - READ_NEXT_PAIR(v1, v2, i); - } else if ( ! CheckPositive(pDM_Odm, v1, v2) ) { - bMatched = FALSE; - READ_NEXT_PAIR(v1, v2, i); - READ_NEXT_PAIR(v1, v2, i); - } else { - READ_NEXT_PAIR(v1, v2, i); - if ( ! CheckNegative(pDM_Odm, v1, v2) ) - bMatched = FALSE; - else - bMatched = TRUE; - READ_NEXT_PAIR(v1, v2, i); - } - - if ( bMatched == FALSE ) - { // Condition isn't matched. Discard the following (offset, data) pairs. - while (v1 < 0x40000000 && i < ArrayLen -2) - READ_NEXT_PAIR(v1, v2, i); - - i -= 2; // prevent from for-loop += 2 - } - else // Configure matched pairs and skip to end of if-else. - { - while (v1 < 0x40000000 && i < ArrayLen-2) { - odm_ConfigBB_PHY_8812A(pDM_Odm, v1, bMaskDWord, v2); - READ_NEXT_PAIR(v1, v2, i); - } - - // Keeps reading until ENDIF. - cCond = (u1Byte)((v1 & (BIT29|BIT28)) >> 28); - while (cCond != COND_ENDIF && i < ArrayLen-2) { - READ_NEXT_PAIR(v1, v2, i); - cCond = (u1Byte)((v1 & (BIT29|BIT28)) >> 28); - } - } - } - } -} - -u4Byte -ODM_GetVersion_MP_8812A_PHY_REG_MP( -) -{ - return 40; -} - #endif // end of HWIMG_SUPPORT diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_BB.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_BB.h index 30c2629c1faa8c..f10305324f6739 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_BB.h +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_BB.h @@ -22,8 +22,6 @@ #ifndef __INC_MP_BB_HW_IMG_8812A_H #define __INC_MP_BB_HW_IMG_8812A_H -//static BOOLEAN CheckPositive(PDM_ODM_T pDM_Odm, const u4Byte Condition1, const u4Byte Condition2); -//static BOOLEAN CheckNegative(PDM_ODM_T pDM_Odm, const u4Byte Condition1, const u4Byte Condition2); /****************************************************************************** * AGC_TAB.TXT @@ -33,8 +31,21 @@ void ODM_ReadAndConfig_MP_8812A_AGC_TAB( // TC: Test Chip, MP: MP Chip IN PDM_ODM_T pDM_Odm ); -u4Byte -ODM_GetVersion_MP_8812A_AGC_TAB(VOID); +u4Byte ODM_GetVersion_MP_8812A_AGC_TAB(void); + +/****************************************************************************** +* AGC_TAB_DIFF.TXT +******************************************************************************/ + +extern u4Byte Array_MP_8812A_AGC_TAB_DIFF_LB[60]; +extern u4Byte Array_MP_8812A_AGC_TAB_DIFF_HB[60]; +void +ODM_ReadAndConfig_MP_8812A_AGC_TAB_DIFF( + IN PDM_ODM_T pDM_Odm, + IN u4Byte Array[], + IN u4Byte ArrayLen +); +u4Byte ODM_GetVersion_MP_8812A_AGC_TAB_DIFF(void); /****************************************************************************** * PHY_REG.TXT @@ -44,23 +55,17 @@ void ODM_ReadAndConfig_MP_8812A_PHY_REG( // TC: Test Chip, MP: MP Chip IN PDM_ODM_T pDM_Odm ); -u4Byte -ODM_GetVersion_MP_8812A_PHY_REG(VOID); +u4Byte ODM_GetVersion_MP_8812A_PHY_REG(void); /****************************************************************************** -* AGC_TAB_DIFF.TXT +* PHY_REG_MP.TXT ******************************************************************************/ -extern u4Byte Array_MP_8812A_AGC_TAB_DIFF_LB[60]; -extern u4Byte Array_MP_8812A_AGC_TAB_DIFF_HB[60]; void -ODM_ReadAndConfig_MP_8812A_AGC_TAB_DIFF( - IN PDM_ODM_T pDM_Odm, - IN u4Byte Array[], - IN u4Byte ArrayLen +ODM_ReadAndConfig_MP_8812A_PHY_REG_MP( // TC: Test Chip, MP: MP Chip + IN PDM_ODM_T pDM_Odm ); -u4Byte -ODM_GetVersion_MP_8812A_AGC_TAB_DIFF(VOID); +u4Byte ODM_GetVersion_MP_8812A_PHY_REG_MP(void); /****************************************************************************** * PHY_REG_PG.TXT @@ -70,8 +75,7 @@ void ODM_ReadAndConfig_MP_8812A_PHY_REG_PG( // TC: Test Chip, MP: MP Chip IN PDM_ODM_T pDM_Odm ); -u4Byte -ODM_GetVersion_MP_8812A_PHY_REG_PG(VOID); +u4Byte ODM_GetVersion_MP_8812A_PHY_REG_PG(void); /****************************************************************************** * PHY_REG_PG_ASUS.TXT @@ -81,8 +85,7 @@ void ODM_ReadAndConfig_MP_8812A_PHY_REG_PG_ASUS( // TC: Test Chip, MP: MP Chip IN PDM_ODM_T pDM_Odm ); -u4Byte -ODM_GetVersion_MP_8812A_PHY_REG_PG_ASUS(VOID); +u4Byte ODM_GetVersion_MP_8812A_PHY_REG_PG_ASUS(void); /****************************************************************************** * PHY_REG_PG_NEC.TXT @@ -92,19 +95,7 @@ void ODM_ReadAndConfig_MP_8812A_PHY_REG_PG_NEC( // TC: Test Chip, MP: MP Chip IN PDM_ODM_T pDM_Odm ); -u4Byte -ODM_GetVersion_MP_8812A_PHY_REG_PG_NEC(VOID); - -/****************************************************************************** -* PHY_REG_MP.TXT -******************************************************************************/ - -void -ODM_ReadAndConfig_MP_8812A_PHY_REG_MP( // TC: Test Chip, MP: MP Chip - IN PDM_ODM_T pDM_Odm -); -u4Byte -ODM_GetVersion_MP_8812A_PHY_REG_MP(VOID); +u4Byte ODM_GetVersion_MP_8812A_PHY_REG_PG_NEC(void); #endif #endif // end of HWIMG_SUPPORT diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_FW.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_FW.c index f47729eca9210e..3d8d8024be0f27 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_FW.c +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_FW.c @@ -18,94 +18,80 @@ * ******************************************************************************/ -#include "../odm_precomp.h" +#include "Mp_Precomp.h" +#include "../phydm_precomp.h" #if (RTL8812A_SUPPORT == 1) u1Byte Array_MP_8812A_FW_NIC[] = { -0x01, 0x95, 0x10, 0x00, 0x19, 0x00, 0x00, 0x00, 0x07, 0x23, 0x13, 0x24, 0x1C, 0x7D, 0x00, 0x00, -0xFE, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x02, 0x4B, 0xA0, 0x02, 0x68, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x69, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x70, 0xFD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x95, 0x10, 0x00, 0x26, 0x00, 0x00, 0x00, 0x11, 0x04, 0x19, 0x53, 0xA0, 0x7C, 0x00, 0x00, +0x81, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x02, 0x4C, 0x4D, 0x02, 0x97, 0xE9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x02, 0x99, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x02, 0x9F, 0xDE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x68, 0xD7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x6F, 0x98, 0x00, 0x00, -0x15, 0xF0, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x15, 0xF0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x05, 0xF0, -0xFF, 0x0F, 0x00, 0x00, 0x00, 0x05, 0xF0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x10, 0xF0, 0xFF, 0x0F, -0x00, 0x00, 0x00, 0x10, 0xF0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x0F, 0x00, 0x00, 0x00, 0x00, -0x00, 0xF0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, -0xF0, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x10, 0xF0, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x15, 0xF0, 0x3F, -0x00, 0x00, 0x00, 0x00, 0x15, 0xF0, 0xCF, 0xFF, 0x00, 0x00, 0x00, 0x16, 0x0D, 0x17, 0x0E, 0x17, -0x0F, 0x18, 0x10, 0x19, 0x11, 0x1A, 0x12, 0x1A, 0x13, 0x1A, 0x14, 0x1A, 0x15, 0x1B, 0xFF, 0x17, -0x0E, 0x18, 0x10, 0x19, 0x11, 0x12, 0x1A, 0x1B, 0x15, 0x1C, 0xFF, 0x1D, 0xFF, 0x1E, 0xFF, 0x1F, -0xFF, 0xFF, 0xFF, 0x14, 0x0D, 0x0E, 0x15, 0x15, 0x0F, 0x16, 0x10, 0x17, 0x11, 0x18, 0x12, 0x18, -0x13, 0x18, 0xFF, 0x15, 0x0D, 0x16, 0x10, 0x10, 0x17, 0x18, 0x12, 0x19, 0xFF, 0x1A, 0xFF, 0x1B, -0xFF, 0x1C, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x0C, 0x0C, 0x0D, 0x0C, 0x0E, 0x0D, 0x17, -0x0F, 0x18, 0x10, 0x19, 0x11, 0x19, 0x11, 0x19, 0x12, 0x1A, 0x14, 0x0C, 0x0C, 0x16, 0x0D, 0x17, -0x0F, 0x18, 0x10, 0x19, 0x13, 0x1A, 0x14, 0x1B, 0x15, 0x1C, 0x1B, 0x1D, 0x1C, 0x1E, 0x1D, 0x04, -0x04, 0x0C, 0x14, 0x0D, 0x14, 0x0E, 0x14, 0x0F, 0x15, 0x10, 0x16, 0x17, 0x11, 0x12, 0x17, 0x0C, -0x0C, 0x14, 0x0E, 0x15, 0x0F, 0x16, 0x10, 0x17, 0x12, 0x18, 0x18, 0x19, 0x19, 0x1A, 0x19, 0x0A, -0x08, 0x03, 0x03, 0x00, 0x04, 0x09, 0x07, 0x03, 0x03, 0x00, 0x04, 0x08, 0x06, 0x03, 0x02, 0x00, -0x04, 0x08, 0x05, 0x03, 0x01, 0x00, 0x04, 0x0D, 0x0A, 0x07, 0x05, 0x00, 0x08, 0x0C, 0x0A, 0x07, -0x04, 0x00, 0x08, 0x0B, 0x0A, 0x06, 0x05, 0x00, 0x08, 0x0B, 0x0A, 0x05, 0x03, 0x00, 0x08, 0x0B, -0x0A, 0x03, 0x02, 0x00, 0x08, 0x14, 0x12, 0x0C, 0x04, 0x00, 0x10, 0x14, 0x12, 0x09, 0x04, 0x00, -0x10, 0x24, 0x22, 0x1C, 0x12, 0x00, 0x20, 0x24, 0x22, 0x18, 0x0C, 0x00, 0x20, 0x24, 0x22, 0x14, -0x06, 0x00, 0x20, 0x24, 0x22, 0x0F, 0x04, 0x00, 0x20, 0x24, 0x21, 0x0A, 0x04, 0x00, 0x20, 0x23, -0x21, 0x0C, 0x04, 0x00, 0x20, 0x23, 0x1F, 0x0A, 0x04, 0x00, 0x20, 0x22, 0x1F, 0x0F, 0x04, 0x00, -0x20, 0x21, 0x1F, 0x16, 0x0C, 0x00, 0x20, 0x31, 0x2F, 0x20, 0x14, 0x00, 0x30, 0x31, 0x2F, 0x18, -0x10, 0x00, 0x30, 0x31, 0x2C, 0x18, 0x0C, 0x00, 0x30, 0x31, 0x2A, 0x14, 0x0C, 0x00, 0x30, 0x31, -0x28, 0x14, 0x00, 0x00, 0x30, 0x31, 0x24, 0x14, 0x00, 0x00, 0x30, 0x31, 0x1E, 0x14, 0x00, 0x00, -0x30, 0x04, 0x04, 0x04, 0x05, 0x04, 0x04, 0x05, 0x07, 0x07, 0x07, 0x08, 0x0A, 0x04, 0x07, 0x0A, -0x0E, 0x11, 0x13, 0x14, 0x15, 0x03, 0x04, 0x07, 0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x05, 0x05, 0x07, -0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x05, 0x05, 0x07, 0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x07, 0x08, 0x08, -0x0A, 0x0A, 0x0C, 0x0E, 0x10, 0x11, 0x11, 0x07, 0x09, 0x09, 0x0B, 0x0B, 0x0D, 0x0F, 0x11, 0x11, -0x12, 0x05, 0x05, 0x07, 0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x0F, 0x0F, 0x05, 0x05, 0x07, 0x07, 0x08, -0x0B, 0x0D, 0x0F, 0x0F, 0x0F, 0x04, 0x04, 0x04, 0x05, 0x07, 0x07, 0x09, 0x09, 0x0C, 0x0E, 0x10, -0x12, 0x05, 0x06, 0x07, 0x0D, 0x10, 0x11, 0x12, 0x12, 0x07, 0x08, 0x09, 0x09, 0x0C, 0x0E, 0x11, -0x13, 0x09, 0x09, 0x09, 0x09, 0x0C, 0x0E, 0x11, 0x13, 0x09, 0x09, 0x09, 0x09, 0x0C, 0x0E, 0x11, -0x13, 0x05, 0x06, 0x08, 0x09, 0x0C, 0x0E, 0x12, 0x12, 0x13, 0x14, 0x07, 0x08, 0x0A, 0x0B, 0x0D, -0x10, 0x11, 0x11, 0x14, 0x16, 0x09, 0x09, 0x09, 0x09, 0x0C, 0x0E, 0x11, 0x13, 0x13, 0x13, 0x09, -0x09, 0x09, 0x09, 0x0C, 0x0E, 0x11, 0x13, 0x13, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x24, 0x26, 0x2A, 0x00, 0x00, 0x00, 0x1F, 0x21, 0x25, 0x27, 0x28, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x02, 0x98, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x7B, 0x61, 0x00, 0x00, +0x00, 0x04, 0x0C, 0x14, 0x2C, 0x36, 0x04, 0x08, 0x08, 0x08, 0x0A, 0x0A, 0x15, 0xF0, 0xFF, 0x0F, +0x00, 0x00, 0x00, 0x15, 0xF0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x05, 0xF0, 0xFF, 0x0F, 0x00, 0x00, +0x00, 0x05, 0xF0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x10, 0xF0, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x10, +0xF0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x0F, 0x00, +0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xF0, 0xFF, 0xFF, 0x00, +0x00, 0x00, 0x10, 0xF0, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x15, 0xF0, 0x3F, 0x00, 0x00, 0x00, 0x00, +0x15, 0xF0, 0xCF, 0xFF, 0x00, 0x00, 0x00, 0x16, 0x0D, 0x17, 0x0E, 0x17, 0x0F, 0x18, 0x10, 0x19, +0x11, 0x1A, 0x12, 0x1A, 0x13, 0x1A, 0x14, 0x1A, 0x15, 0x1B, 0xFF, 0x17, 0x0E, 0x18, 0x10, 0x19, +0x11, 0x1A, 0x12, 0x1B, 0x15, 0x1C, 0xFF, 0x1D, 0xFF, 0x1E, 0xFF, 0x1F, 0xFF, 0xFF, 0xFF, 0x14, +0x0D, 0x0E, 0x15, 0x15, 0x0F, 0x16, 0x10, 0x17, 0x11, 0x18, 0x12, 0x18, 0x13, 0x18, 0xFF, 0x15, +0x0D, 0x16, 0x10, 0x10, 0x17, 0x18, 0x12, 0x19, 0xFF, 0x1A, 0xFF, 0x1B, 0xFF, 0x1C, 0xFF, 0x00, +0x00, 0x00, 0x00, 0x04, 0x04, 0x0C, 0x0C, 0x0D, 0x0C, 0x0E, 0x0D, 0x0F, 0x17, 0x18, 0x10, 0x19, +0x11, 0x19, 0x11, 0x19, 0x12, 0x1A, 0x14, 0x0C, 0x0C, 0x16, 0x0D, 0x17, 0x0F, 0x18, 0x10, 0x19, +0x13, 0x1A, 0x14, 0x1B, 0x15, 0x1C, 0x1B, 0x1D, 0x1C, 0x1E, 0x1D, 0x04, 0x04, 0x0C, 0x14, 0x0D, +0x14, 0x0E, 0x14, 0x0F, 0x15, 0x10, 0x16, 0x17, 0x11, 0x12, 0x17, 0x0C, 0x0C, 0x14, 0x0E, 0x15, +0x0F, 0x16, 0x10, 0x17, 0x12, 0x18, 0x18, 0x19, 0x19, 0x1A, 0x19, 0x0A, 0x08, 0x03, 0x03, 0x00, +0x04, 0x09, 0x07, 0x03, 0x03, 0x00, 0x04, 0x08, 0x06, 0x03, 0x02, 0x00, 0x04, 0x08, 0x05, 0x03, +0x01, 0x00, 0x04, 0x0D, 0x0A, 0x07, 0x05, 0x00, 0x08, 0x0C, 0x0A, 0x07, 0x04, 0x00, 0x08, 0x0B, +0x0A, 0x06, 0x05, 0x00, 0x08, 0x0B, 0x0A, 0x05, 0x03, 0x00, 0x08, 0x0B, 0x0A, 0x03, 0x02, 0x00, +0x08, 0x14, 0x12, 0x0C, 0x04, 0x00, 0x10, 0x14, 0x12, 0x09, 0x04, 0x00, 0x10, 0x24, 0x22, 0x1C, +0x12, 0x00, 0x20, 0x24, 0x22, 0x18, 0x0C, 0x00, 0x20, 0x24, 0x22, 0x14, 0x06, 0x00, 0x20, 0x24, +0x22, 0x0F, 0x04, 0x00, 0x20, 0x24, 0x21, 0x0A, 0x04, 0x00, 0x20, 0x23, 0x21, 0x0C, 0x04, 0x00, +0x20, 0x23, 0x1F, 0x0A, 0x04, 0x00, 0x20, 0x22, 0x1F, 0x0F, 0x04, 0x00, 0x20, 0x21, 0x1F, 0x16, +0x0C, 0x00, 0x20, 0x31, 0x2F, 0x20, 0x14, 0x00, 0x30, 0x31, 0x2F, 0x18, 0x10, 0x00, 0x30, 0x31, +0x2C, 0x18, 0x0C, 0x00, 0x30, 0x31, 0x2A, 0x14, 0x0C, 0x00, 0x30, 0x31, 0x28, 0x14, 0x00, 0x00, +0x30, 0x31, 0x24, 0x14, 0x00, 0x00, 0x30, 0x31, 0x1E, 0x14, 0x00, 0x00, 0x30, 0x04, 0x04, 0x04, +0x05, 0x04, 0x04, 0x05, 0x07, 0x07, 0x07, 0x08, 0x0A, 0x04, 0x07, 0x0A, 0x0E, 0x11, 0x13, 0x14, +0x15, 0x03, 0x04, 0x07, 0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x05, 0x05, 0x07, 0x07, 0x08, 0x0B, 0x0D, +0x0F, 0x05, 0x05, 0x07, 0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x07, 0x08, 0x08, 0x0A, 0x0A, 0x0C, 0x0E, +0x10, 0x11, 0x11, 0x07, 0x09, 0x09, 0x0B, 0x0B, 0x0D, 0x0F, 0x13, 0x13, 0x14, 0x05, 0x05, 0x07, +0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x0F, 0x0F, 0x05, 0x05, 0x07, 0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x0F, +0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x26, 0x2A, 0x00, 0x00, 0x00, +0x1F, 0x21, 0x25, 0x27, 0x28, 0x00, 0x00, 0x00, 0x00, 0x23, 0x26, 0x28, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x23, 0x26, 0x28, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x23, 0x26, 0x28, 0x2A, 0x00, 0x00, 0x00, -0x00, 0x23, 0x26, 0x28, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x20, 0x25, 0x27, 0x29, 0x29, 0x2A, 0x00, -0x00, 0x00, 0x00, 0x20, 0x25, 0x27, 0x29, 0x29, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x23, 0x26, 0x28, -0x2A, 0x2A, 0x2A, 0x00, 0x00, 0x00, 0x1F, 0x23, 0x26, 0x28, 0x2A, 0x2A, 0x2A, 0x00, 0x00, 0x00, -0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, -0x18, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, -0x60, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0xD8, 0x00, 0x00, 0x00, -0x3C, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xA0, 0x00, 0x00, 0x00, -0xF0, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x01, 0x90, 0x00, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x00, -0xA0, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x01, 0x90, 0x00, 0x00, 0x02, -0x58, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, 0x04, 0xB0, 0x00, 0x00, 0x06, 0x40, 0x00, 0x00, 0x00, -0xC8, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x02, 0xD0, 0x00, 0x00, 0x03, -0xE8, 0x00, 0x00, 0x04, 0xB0, 0x00, 0x00, 0x06, 0x40, 0x00, 0x00, 0x07, 0xD0, 0x00, 0x00, 0x00, -0xC8, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x02, 0xD0, 0x00, 0x00, 0x03, -0xE8, 0x00, 0x00, 0x04, 0xB0, 0x00, 0x00, 0x06, 0x40, 0x00, 0x00, 0x07, 0xD0, 0x00, 0x00, 0x00, -0x3C, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xA0, 0x00, 0x00, 0x00, -0xF0, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x01, 0x90, 0x00, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x02, -0x58, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, 0x00, 0xC8, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x01, -0xE0, 0x00, 0x00, 0x02, 0xD0, 0x00, 0x00, 0x03, 0xE8, 0x00, 0x00, 0x07, 0xD0, 0x00, 0x00, 0x0B, -0xB8, 0x00, 0x00, 0x13, 0x88, 0x00, 0x00, 0x17, 0x70, 0x00, 0x00, 0x1F, 0x40, 0x00, 0x00, 0x00, -0xC8, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x02, 0xD0, 0x00, 0x00, 0x03, -0xE8, 0x00, 0x00, 0x04, 0xB0, 0x00, 0x00, 0x06, 0x40, 0x00, 0x00, 0x07, 0xD0, 0x00, 0x00, 0x07, -0xD0, 0x00, 0x00, 0x07, 0xD0, 0x00, 0x00, 0x00, 0xC8, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x01, -0xE0, 0x00, 0x00, 0x02, 0xD0, 0x00, 0x00, 0x03, 0xE8, 0x00, 0x00, 0x04, 0xB0, 0x00, 0x00, 0x06, -0x40, 0x00, 0x00, 0x07, 0xD0, 0x00, 0x00, 0x07, 0xD0, 0x00, 0x00, 0x07, 0xD0, 0x00, 0x02, 0x00, +0x00, 0x20, 0x25, 0x27, 0x29, 0x29, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x20, 0x25, 0x27, 0x29, 0x29, +0x2A, 0x00, 0x00, 0x00, 0x00, 0x23, 0x26, 0x28, 0x2A, 0x2A, 0x2A, 0x00, 0x00, 0x00, 0x1F, 0x23, +0x26, 0x28, 0x2A, 0x2A, 0x2A, 0x00, 0x04, 0x00, 0x04, 0x00, 0x08, 0x00, 0x10, 0x00, 0x18, 0x00, +0x24, 0x00, 0x30, 0x00, 0x48, 0x00, 0x60, 0x00, 0x90, 0x00, 0xC0, 0x00, 0xD8, 0x00, 0x3C, 0x00, +0x64, 0x00, 0x78, 0x00, 0xA0, 0x00, 0xF0, 0x01, 0x40, 0x01, 0x90, 0x01, 0xE0, 0x00, 0xA0, 0x00, +0xF0, 0x01, 0x40, 0x01, 0x90, 0x02, 0x58, 0x03, 0x20, 0x04, 0xB0, 0x06, 0x40, 0x00, 0xC8, 0x01, +0x18, 0x01, 0xE0, 0x02, 0xD0, 0x03, 0xE8, 0x04, 0xB0, 0x06, 0x40, 0x07, 0xD0, 0x00, 0xC8, 0x01, +0x18, 0x01, 0xE0, 0x02, 0xD0, 0x03, 0xE8, 0x04, 0xB0, 0x06, 0x40, 0x07, 0xD0, 0x00, 0x3C, 0x00, +0x50, 0x00, 0x64, 0x00, 0xA0, 0x00, 0xF0, 0x01, 0x40, 0x01, 0x90, 0x01, 0xE0, 0x02, 0x58, 0x03, +0x20, 0x00, 0x78, 0x00, 0xF0, 0x01, 0x90, 0x02, 0x58, 0x03, 0xE8, 0x07, 0xD0, 0x09, 0x60, 0x0F, +0xA0, 0x12, 0xC0, 0x15, 0x18, 0x00, 0xC8, 0x01, 0x18, 0x01, 0xE0, 0x02, 0xD0, 0x03, 0xE8, 0x04, +0xB0, 0x06, 0x40, 0x07, 0xD0, 0x07, 0xD0, 0x07, 0xD0, 0x00, 0xC8, 0x01, 0x18, 0x01, 0xE0, 0x02, +0xD0, 0x03, 0xE8, 0x04, 0xB0, 0x06, 0x40, 0x07, 0xD0, 0x07, 0xD0, 0x07, 0xD0, 0x00, 0x02, 0x00, 0x02, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x12, 0x00, 0x18, 0x00, 0x24, 0x00, 0x30, 0x00, 0x48, 0x00, 0x60, 0x00, 0x6C, 0x00, 0x14, 0x00, 0x32, 0x00, 0x3C, 0x00, 0x50, 0x00, 0x78, 0x00, 0xA0, 0x00, 0xC8, 0x00, 0xF0, 0x00, 0x50, 0x00, 0x78, 0x00, 0xA0, 0x00, 0xC8, 0x01, 0x2C, 0x01, 0x90, 0x02, 0x58, 0x03, 0x20, 0x00, 0x64, 0x00, 0x8C, 0x00, 0xF0, 0x01, 0x68, 0x01, 0xF4, 0x02, 0x58, 0x03, 0x20, 0x03, 0xE8, 0x00, 0x64, 0x00, 0x8C, 0x00, 0xF0, 0x01, 0x68, 0x01, 0xF4, 0x02, -0x58, 0x03, 0x20, 0x03, 0xE8, 0x00, 0x1E, 0x00, 0x32, 0x00, 0x3C, 0x00, 0x50, 0x00, 0x78, 0x00, -0xA0, 0x00, 0xC8, 0x00, 0xF0, 0x01, 0x2C, 0x01, 0x90, 0x00, 0x64, 0x00, 0x8C, 0x00, 0xF0, 0x01, -0x68, 0x01, 0xF4, 0x03, 0xE8, 0x05, 0xDC, 0x09, 0xC4, 0x0B, 0xB8, 0x0F, 0xA0, 0x00, 0x64, 0x00, +0x58, 0x03, 0x20, 0x03, 0xE8, 0x00, 0x1E, 0x00, 0x28, 0x00, 0x32, 0x00, 0x50, 0x00, 0x78, 0x00, +0xA0, 0x00, 0xC8, 0x00, 0xF0, 0x01, 0x2C, 0x01, 0x90, 0x00, 0x3C, 0x00, 0x78, 0x00, 0xC8, 0x01, +0x2C, 0x01, 0xF4, 0x03, 0xE8, 0x04, 0xB0, 0x07, 0xD0, 0x09, 0x60, 0x0A, 0xF0, 0x00, 0x64, 0x00, 0x8C, 0x00, 0xF0, 0x01, 0x68, 0x01, 0xF4, 0x02, 0x58, 0x03, 0x20, 0x03, 0xE8, 0x03, 0xE8, 0x03, 0xE8, 0x00, 0x64, 0x00, 0x8C, 0x00, 0xF0, 0x01, 0x68, 0x01, 0xF4, 0x02, 0x58, 0x03, 0x20, 0x03, 0xE8, 0x03, 0xE8, 0x03, 0xE8, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x10, 0x18, 0x20, 0x30, 0x40, 0x50, 0x01, 0x01, 0x01, 0x02, 0x01, 0x02, 0x03, 0x03, 0x04, 0x04, 0x05, 0x05, 0x02, 0x04, 0x06, 0x07, 0x07, 0x08, 0x08, 0x08, 0x02, 0x02, 0x03, 0x03, 0x05, 0x05, 0x06, 0x06, 0x05, 0x06, 0x06, -0x07, 0x07, 0x08, 0x09, 0x0A, 0x05, 0x06, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0A, 0x01, 0x03, 0x06, -0x07, 0x07, 0x07, 0x08, 0x08, 0x0A, 0x0A, 0x02, 0x05, 0x06, 0x07, 0x07, 0x07, 0x08, 0x08, 0x0A, +0x07, 0x07, 0x08, 0x09, 0x0A, 0x05, 0x06, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0A, 0x05, 0x06, 0x06, +0x07, 0x07, 0x08, 0x09, 0x0A, 0x0A, 0x0B, 0x05, 0x06, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0B, 0x05, 0x06, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0A, 0x0A, 0x0B, 0x05, 0x06, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0A, 0x0A, 0x0B, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x02, 0x04, 0x06, 0x07, 0x08, 0x0A, 0x0B, @@ -113,13 +99,26 @@ u1Byte Array_MP_8812A_FW_NIC[] = { 0x0C, 0x02, 0x04, 0x06, 0x07, 0x08, 0x09, 0x0B, 0x0C, 0x0C, 0x0C, 0x03, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0B, 0x0C, 0x0C, 0x0C, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0C, 0x0C, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0C, 0x0C, 0x19, 0x06, 0x04, 0x02, 0x00, 0x18, 0x05, -0x22, 0x05, 0x50, 0x05, 0x51, 0x0B, 0x00, 0x08, 0x08, 0x09, 0x0C, 0x0C, 0x00, 0x0E, 0x00, 0x08, -0xC4, 0x08, 0x38, 0x08, 0x2C, 0x0C, 0x5C, 0x0C, 0x60, 0x0C, 0x64, 0x0C, 0x68, 0x0C, 0xB8, 0x0C, -0xB0, 0x0C, 0xB4, 0x0E, 0x5C, 0x0E, 0x60, 0x0E, 0x64, 0x0E, 0x68, 0x0E, 0xB8, 0x0E, 0xB0, 0x0E, -0xB4, 0x0C, 0x00, 0x0C, 0x94, 0x0C, 0x88, 0x0C, 0x8C, 0x0C, 0xE8, 0x0C, 0x10, 0x0D, 0x00, 0x0C, -0x90, 0x0C, 0xC4, 0x0C, 0xC8, 0x0C, 0xCC, 0x0C, 0xD4, 0x0C, 0x80, 0x0C, 0x84, 0x0E, 0x00, 0x0E, -0x94, 0x0E, 0x88, 0x0E, 0x8C, 0x0E, 0xE8, 0x0E, 0x10, 0x0D, 0x40, 0x0E, 0x90, 0x0E, 0xC4, 0x0E, -0xC8, 0x0E, 0xCC, 0x0E, 0xD4, 0x0E, 0x80, 0x0E, 0x84, 0x00, 0x01, 0x04, 0x02, 0x03, 0x05, 0x00, +0x22, 0x05, 0x50, 0x05, 0x51, 0x08, 0x08, 0x0A, 0x04, 0x09, 0x0C, 0x0C, 0x00, 0x0E, 0x00, 0x08, +0x38, 0x08, 0x2C, 0x0C, 0x5C, 0x0C, 0x60, 0x0C, 0x64, 0x0C, 0x68, 0x0C, 0xB0, 0x0C, 0xB4, 0x0E, +0x5C, 0x0E, 0x60, 0x0E, 0x64, 0x0E, 0x68, 0x0E, 0xB0, 0x0E, 0xB4, 0x0C, 0x00, 0x0C, 0x94, 0x0C, +0x88, 0x0C, 0x8C, 0x0C, 0xE8, 0x0C, 0x10, 0x0D, 0x00, 0x0C, 0x90, 0x0C, 0xC4, 0x0C, 0xC8, 0x0C, +0xCC, 0x0C, 0xD4, 0x0C, 0x80, 0x0C, 0x84, 0x0C, 0xB8, 0x0E, 0x00, 0x0E, 0x94, 0x0E, 0x88, 0x0E, +0x8C, 0x0E, 0xE8, 0x0E, 0x10, 0x0D, 0x40, 0x0E, 0x90, 0x0E, 0xC4, 0x0E, 0xC8, 0x0E, 0xCC, 0x0E, +0xD4, 0x0E, 0x80, 0x0E, 0x84, 0x0E, 0xB8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x78, 0xE3, 0x09, 0xF2, 0x08, 0xDF, 0xFA, 0x80, 0x70, 0x88, 0x82, 0x8C, 0x83, @@ -135,7 +134,7 @@ u1Byte Array_MP_8812A_FW_NIC[] = { 0xE8, 0x80, 0xDB, 0x89, 0x82, 0x8A, 0x83, 0xE4, 0x93, 0xA3, 0xF2, 0x08, 0xDF, 0xF9, 0x80, 0xCC, 0x88, 0xF0, 0xEF, 0x60, 0x01, 0x0E, 0x4E, 0x60, 0xC3, 0x88, 0xF0, 0xED, 0x24, 0x02, 0xB4, 0x04, 0x00, 0x50, 0xB9, 0xF5, 0x82, 0xEB, 0x24, 0x02, 0xB4, 0x04, 0x00, 0x50, 0xAF, 0x23, 0x23, 0x45, -0x82, 0x23, 0x90, 0x46, 0x50, 0x73, 0xC5, 0xF0, 0xF8, 0xA3, 0xE0, 0x28, 0xF0, 0xC5, 0xF0, 0xF8, +0x82, 0x23, 0x90, 0x46, 0x30, 0x73, 0xC5, 0xF0, 0xF8, 0xA3, 0xE0, 0x28, 0xF0, 0xC5, 0xF0, 0xF8, 0xE5, 0x82, 0x15, 0x82, 0x70, 0x02, 0x15, 0x83, 0xE0, 0x38, 0xF0, 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, @@ -143,1891 +142,1886 @@ u1Byte Array_MP_8812A_FW_NIC[] = { 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,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xE6, 0xCD, 0xF8, 0xE5, 0x81, 0x6D, 0x60, 0x06, 0xD0, 0xE0, 0xF6, -0x18, 0x80, 0xF5, 0xE5, 0x0C, 0x24, 0x86, 0xC8, 0xF6, 0x15, 0x0C, 0x80, 0xD3, 0xE5, 0x0C, 0x23, -0x24, 0x81, 0xF8, 0x7F, 0x04, 0xC2, 0xAF, 0xE6, 0x30, 0xE0, 0x03, 0x10, 0xE2, 0x0C, 0x7F, 0x00, -0x30, 0xE1, 0x07, 0x30, 0xE3, 0x04, 0x7F, 0x08, 0x54, 0xF4, 0x54, 0x7C, 0xC6, 0xD2, 0xAF, 0x54, -0x80, 0x42, 0x07, 0x22, 0x78, 0x86, 0xA6, 0x81, 0x74, 0x02, 0x60, 0x06, 0xFF, 0x08, 0x76, 0xFF, -0xDF, 0xFB, 0x7F, 0x03, 0xE4, 0x78, 0x80, 0xF6, 0x08, 0xF6, 0x08, 0xDF, 0xFA, 0x78, 0x81, 0x76, -0x30, 0x90, 0x4C, 0x62, 0x74, 0x01, 0x93, 0xC0, 0xE0, 0xE4, 0x93, 0xC0, 0xE0, 0x43, 0x89, 0x01, -0x75, 0x8A, 0x60, 0x75, 0x8C, 0x79, 0xD2, 0x8C, 0xD2, 0xAF, 0x22, 0x02, 0xEF, 0xD3, 0x94, 0x02, -0x40, 0x03, 0x7F, 0xFF, 0x22, 0x74, 0x81, 0x2F, 0x2F, 0xF8, 0xE6, 0x20, 0xE5, 0xF4, 0xC2, 0xAF, -0xE6, 0x44, 0x30, 0xF6, 0xD2, 0xAF, 0xAE, 0x0C, 0xEE, 0xC3, 0x9F, 0x50, 0x21, 0x0E, 0x74, 0x86, -0x2E, 0xF8, 0xE6, 0xF9, 0x08, 0xE6, 0x18, 0xBE, 0x02, 0x02, 0x74, 0xFF, 0xFD, 0xED, 0x69, 0x60, -0x09, 0x09, 0xE7, 0x19, 0x19, 0xF7, 0x09, 0x09, 0x80, 0xF3, 0x16, 0x16, 0x80, 0xDA, 0xEE, 0xD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, 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, 0x4C, -0x23, 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, 0x00, 0x41, 0xA6, 0xBA, 0x00, 0x41, 0xA6, 0xBB, 0x00, 0x41, 0xA6, 0xBC, 0x00, -0x60, 0x26, 0xA6, 0x1C, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, -0x0D, 0x0E, 0x24, 0x28, 0x2C, 0x30, 0x34, 0x38, 0x3C, 0x40, 0x64, 0x68, 0x6C, 0x70, 0x74, 0x78, -0x7C, 0x80, 0x84, 0x88, 0x8C, 0x95, 0x99, 0x9D, 0xA1, 0xA5, 0x41, 0xA6, 0xE2, 0x00, 0x41, 0xA6, -0xE5, 0x00, 0x4D, 0xE8, 0x50, 0x08, 0x57, 0xF1, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xE4, -0x90, 0xA4, 0x81, 0xF0, 0x90, 0xA4, 0x86, 0xF0, 0x90, 0xA4, 0x84, 0xF0, 0x90, 0xA4, 0x84, 0xE0, -0xFF, 0xC3, 0x94, 0x02, 0x40, 0x02, 0xA1, 0x17, 0xC3, 0x74, 0xFD, 0x9F, 0xFF, 0x74, 0x03, 0x94, -0x00, 0xFE, 0x7B, 0x01, 0x7A, 0xA4, 0x79, 0x80, 0x12, 0x33, 0xC7, 0xEF, 0x64, 0x01, 0x60, 0x02, -0xA1, 0x80, 0x90, 0xA4, 0x80, 0xE0, 0xFF, 0x54, 0xC0, 0xFE, 0x60, 0x05, 0xEF, 0x54, 0x0C, 0x70, -0x1C, 0x90, 0xA4, 0x80, 0xE0, 0xFF, 0x54, 0x30, 0x60, 0x05, 0xEF, 0x54, 0x03, 0x70, 0x08, 0x90, -0xA4, 0x84, 0xE0, 0x60, 0x4A, 0x80, 0x00, 0x90, 0xA4, 0x81, 0x74, 0x01, 0xF0, 0x90, 0xA4, 0x81, -0xE0, 0x90, 0xA4, 0x80, 0x70, 0x17, 0xE0, 0xFF, 0xEE, 0xC4, 0x13, 0x13, 0x54, 0x03, 0x90, 0xA4, -0x82, 0xF0, 0xEF, 0x54, 0x0C, 0x13, 0x13, 0x54, 0x3F, 0xA3, 0xF0, 0x80, 0x10, 0xE0, 0xFF, 0x54, -0x30, 0xC4, 0x54, 0x0F, 0x90, 0xA4, 0x82, 0xF0, 0xEF, 0x54, 0x03, 0xA3, 0xF0, 0x90, 0xA4, 0x82, -0xE0, 0x90, 0xA4, 0x7C, 0xF0, 0x90, 0xA4, 0x83, 0xE0, 0x90, 0xA4, 0x7D, 0xF0, 0x80, 0x08, 0x90, -0xA4, 0x84, 0xE0, 0x04, 0xF0, 0x81, 0x7C, 0xE4, 0x90, 0xA4, 0x84, 0xF0, 0x90, 0xA4, 0x84, 0xE0, -0xFF, 0xC3, 0x94, 0x02, 0x50, 0x6A, 0xC3, 0x74, 0xFB, 0x9F, 0xFF, 0x74, 0x03, 0x94, 0x00, 0xFE, -0x7B, 0x01, 0x7A, 0xA4, 0x79, 0x85, 0x12, 0x33, 0xC7, 0xEF, 0x64, 0x01, 0x70, 0x42, 0x90, 0xA4, -0x85, 0xE0, 0xFF, 0x54, 0xE0, 0xFE, 0x70, 0x13, 0xEF, 0x54, 0x0E, 0x70, 0x08, 0x90, 0xA4, 0x84, -0xE0, 0x60, 0x35, 0x80, 0x00, 0x90, 0xA4, 0x86, 0x74, 0x01, 0xF0, 0x90, 0xA4, 0x86, 0xE0, 0x70, -0x09, 0xEE, 0xC4, 0x13, 0x54, 0x07, 0xA3, 0xF0, 0x80, 0x0C, 0x90, 0xA4, 0x85, 0xE0, 0x54, 0x0E, -0xC3, 0x13, 0x90, 0xA4, 0x87, 0xF0, 0x90, 0xA4, 0x87, 0xE0, 0x90, 0xA4, 0x7E, 0xF0, 0x80, 0x10, -0x90, 0xA4, 0x88, 0x74, 0x01, 0xF0, 0x80, 0x40, 0x90, 0xA4, 0x84, 0xE0, 0x04, 0xF0, 0x80, 0x8C, -0x90, 0xA4, 0x7D, 0xE0, 0x25, 0xE0, 0x25, 0xE0, 0x54, 0x0C, 0xFF, 0x90, 0xA4, 0x7C, 0xE0, 0x54, -0x03, 0x4F, 0xFF, 0x90, 0xA4, 0x7E, 0xE0, 0xFE, 0xC4, 0x54, 0x70, 0x4F, 0x44, 0x80, 0xFD, 0x7F, -0x8B, 0x12, 0x3A, 0x96, 0x90, 0xA4, 0x7C, 0xE0, 0x60, 0x08, 0xA3, 0xE0, 0x60, 0x04, 0xA3, 0xE0, -0x70, 0x21, 0x90, 0xA4, 0x88, 0x74, 0x03, 0xF0, 0x90, 0x01, 0xC4, 0x74, 0x68, 0xF0, 0x74, 0x4C, -0xA3, 0xF0, 0x90, 0xA4, 0x88, 0xE0, 0x90, 0x01, 0xC8, 0xF0, 0xE4, 0xFD, 0x7F, 0x1F, 0x12, 0x3A, -0x96, 0x80, 0xE5, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0x00, 0x80, 0xE0, 0x44, 0x80, 0xFD, 0x7F, -0x80, 0x12, 0x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 0xA3, 0xF0, 0x12, 0x3A, -0xEB, 0xBF, 0x01, 0x03, 0x12, 0x31, 0x69, 0x90, 0xA3, 0xA1, 0xE0, 0x60, 0x0E, 0x90, 0xA3, 0xA4, -0xE0, 0xFF, 0x90, 0xA3, 0xA3, 0xE0, 0x6F, 0x60, 0x02, 0x11, 0x4E, 0xC2, 0xAF, 0x12, 0x78, 0x13, -0xBF, 0x01, 0x02, 0x51, 0xB0, 0xD2, 0xAF, 0x51, 0xBB, 0x12, 0x49, 0x44, 0x80, 0xBF, 0x90, 0xA3, -0xA3, 0xE0, 0xFF, 0x7D, 0x01, 0x80, 0x04, 0x7D, 0x01, 0x7F, 0x04, 0xD3, 0x10, 0xAF, 0x01, 0xC3, -0xC0, 0xD0, 0x90, 0xA6, 0xE4, 0xED, 0xF0, 0x90, 0xA3, 0x9E, 0xE0, 0xFE, 0xC4, 0x13, 0x13, 0x54, -0x03, 0x30, 0xE0, 0x02, 0x21, 0xA7, 0xEE, 0xC4, 0x13, 0x13, 0x13, 0x54, 0x01, 0x30, 0xE0, 0x02, -0x21, 0xA7, 0x90, 0xA3, 0xA4, 0xE0, 0xFE, 0x6F, 0x70, 0x02, 0x21, 0xA7, 0xEF, 0x70, 0x02, 0x21, -0x1C, 0x24, 0xFE, 0x70, 0x02, 0x21, 0x56, 0x24, 0xFE, 0x60, 0x49, 0x24, 0xFC, 0x70, 0x02, 0x21, -0x91, 0x24, 0xFC, 0x60, 0x02, 0x21, 0xA7, 0xEE, 0xB4, 0x0E, 0x02, 0x51, 0x18, 0x90, 0xA3, 0xA4, -0xE0, 0x70, 0x04, 0x7F, 0x01, 0x51, 0x40, 0x90, 0xA3, 0xA4, 0xE0, 0xB4, 0x06, 0x02, 0x31, 0xF2, -0x90, 0xA3, 0xA4, 0xE0, 0xB4, 0x04, 0x0F, 0x90, 0xA6, 0xE4, 0xE0, 0xFF, 0x60, 0x05, 0x12, 0xBC, -0x09, 0x80, 0x03, 0x12, 0x72, 0x54, 0x90, 0xA3, 0xA4, 0xE0, 0x64, 0x08, 0x60, 0x02, 0x21, 0xA7, -0xD1, 0x46, 0x21, 0xA7, 0x90, 0xA3, 0xA4, 0xE0, 0x70, 0x04, 0x7F, 0x01, 0x51, 0x40, 0x90, 0xA3, -0xA4, 0xE0, 0xB4, 0x06, 0x02, 0x31, 0xF2, 0x90, 0xA3, 0xA4, 0xE0, 0xB4, 0x0E, 0x07, 0x31, 0xAC, -0xBF, 0x01, 0x02, 0x51, 0x18, 0x90, 0xA3, 0xA4, 0xE0, 0x64, 0x0C, 0x60, 0x02, 0x21, 0xA7, 0x31, -0xAC, 0xEF, 0x64, 0x01, 0x60, 0x02, 0x21, 0xA7, 0x51, 0x59, 0x21, 0xA7, 0x90, 0xA3, 0xA4, 0xE0, -0xB4, 0x0E, 0x07, 0x31, 0xAC, 0xBF, 0x01, 0x02, 0x51, 0x18, 0x90, 0xA3, 0xA4, 0xE0, 0xB4, 0x06, -0x02, 0x31, 0xF2, 0x90, 0xA3, 0xA4, 0xE0, 0xB4, 0x0C, 0x07, 0x31, 0xAC, 0xBF, 0x01, 0x02, 0x51, -0x59, 0x90, 0xA3, 0xA4, 0xE0, 0x64, 0x04, 0x70, 0x5E, 0x12, 0xBB, 0x59, 0xEF, 0x64, 0x01, 0x70, -0x56, 0x12, 0x64, 0x80, 0x80, 0x51, 0x90, 0xA3, 0xA4, 0xE0, 0xB4, 0x0E, 0x07, 0x31, 0xAC, 0xBF, -0x01, 0x02, 0x51, 0x18, 0x90, 0xA3, 0xA4, 0xE0, 0xB4, 0x06, 0x02, 0x31, 0xF2, 0x90, 0xA3, 0xA4, -0xE0, 0xB4, 0x0C, 0x07, 0x31, 0xAC, 0xBF, 0x01, 0x02, 0x51, 0x59, 0x90, 0xA3, 0xA4, 0xE0, 0x70, -0x04, 0x7F, 0x01, 0x51, 0x40, 0x90, 0xA3, 0xA4, 0xE0, 0xB4, 0x04, 0x1B, 0x12, 0xBC, 0x4B, 0x80, -0x16, 0x90, 0xA3, 0xA4, 0xE0, 0xB4, 0x0C, 0x0F, 0x90, 0xA3, 0x9F, 0xE0, 0xFF, 0x13, 0x13, 0x54, -0x3F, 0x30, 0xE0, 0x03, 0x12, 0x64, 0x71, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x12, 0xBB, 0x40, 0xEF, -0x64, 0x01, 0x60, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x01, 0xF0, 0x80, 0x2D, 0x90, 0xA3, 0x9E, 0xE0, -0x13, 0x13, 0x13, 0x54, 0x1F, 0x30, 0xE0, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x02, 0xF0, 0x80, 0x19, -0x90, 0xA3, 0xA3, 0xE0, 0xD3, 0x94, 0x04, 0x40, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x08, 0xF0, 0x80, -0x08, 0x90, 0x01, 0xB8, 0xE4, 0xF0, 0x7F, 0x01, 0x22, 0x90, 0x01, 0xB9, 0x74, 0x02, 0xF0, 0x7F, -0x00, 0x22, 0x90, 0xA3, 0x9F, 0xE0, 0x90, 0x06, 0x04, 0x20, 0xE0, 0x0C, 0xE0, 0x44, 0x40, 0xF0, -0x90, 0xA3, 0xA4, 0x74, 0x04, 0xF0, 0x80, 0x0A, 0xE0, 0x54, 0x7F, 0xF0, 0x90, 0xA3, 0xA4, 0x74, -0x0C, 0xF0, 0x90, 0x05, 0x22, 0xE4, 0xF0, 0x22, 0x90, 0xA3, 0x9F, 0xE0, 0xC3, 0x13, 0x20, 0xE0, -0x08, 0x90, 0xA3, 0xA4, 0x74, 0x0C, 0xF0, 0x80, 0x11, 0x90, 0x06, 0x04, 0xE0, 0x44, 0x40, 0xF0, -0xE0, 0x44, 0x80, 0xF0, 0x90, 0xA3, 0xA4, 0x74, 0x04, 0xF0, 0x90, 0x05, 0x22, 0xE4, 0xF0, 0x22, -0x90, 0xA6, 0xE3, 0xEF, 0xF0, 0xD1, 0x54, 0x90, 0xA6, 0xE3, 0xE0, 0x60, 0x05, 0x90, 0x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 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, 0x10, 0xEC, 0xA2, +0xE7, 0x13, 0xFC, 0xED, 0x13, 0xFD, 0xEE, 0x13, 0xFE, 0xEF, 0x13, 0xFF, 0xD8, 0xF0, 0x22, 0xBB, +0x01, 0x07, 0x89, 0x82, 0x8A, 0x83, 0x02, 0x48, 0x4D, 0x50, 0x05, 0xE9, 0xF8, 0x02, 0x48, 0xD5, +0xBB, 0xFE, 0x05, 0xE9, 0xF8, 0x02, 0x48, 0xE1, 0x89, 0x82, 0x8A, 0x83, 0x02, 0x48, 0xED, 0xBB, +0x01, 0x0D, 0xE5, 0x82, 0x29, 0xF5, 0x82, 0xE5, 0x83, 0x3A, 0xF5, 0x83, 0x02, 0x48, 0x4D, 0x50, +0x07, 0xE9, 0x25, 0x82, 0xF8, 0x02, 0x48, 0xD5, 0xBB, 0xFE, 0x07, 0xE9, 0x25, 0x82, 0xF8, 0x02, +0x48, 0xE1, 0xE5, 0x82, 0x29, 0xF5, 0x82, 0xE5, 0x83, 0x3A, 0xF5, 0x83, 0x02, 0x48, 0xED, 0xBB, +0x01, 0x07, 0x89, 0x82, 0x8A, 0x83, 0x02, 0x27, 0x48, 0x50, 0x05, 0xE9, 0xF8, 0x02, 0x48, 0xFD, +0xBB, 0xFE, 0x05, 0xE9, 0xF8, 0x02, 0x49, 0x09, 0x22, 0xBB, 0x01, 0x0D, 0xE5, 0x82, 0x29, 0xF5, +0x82, 0xE5, 0x83, 0x3A, 0xF5, 0x83, 0x02, 0x27, 0x48, 0x50, 0x07, 0xE9, 0x25,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xBE, 0x02, 0x02, 0x74, +0xFF, 0xFD, 0x18, 0xE6, 0xCD, 0xF8, 0xE5, 0x81, 0x6D, 0x60, 0x06, 0xD0, 0xE0, 0xF6, 0x18, 0x80, +0xF5, 0xE5, 0x0C, 0x24, 0x86, 0xC8, 0xF6, 0x15, 0x0C, 0x80, 0xD3, 0xE5, 0x0C, 0x23, 0x24, 0x81, +0xF8, 0x7F, 0x04, 0xC2, 0xAF, 0xE6, 0x30, 0xE0, 0x03, 0x10, 0xE2, 0x0C, 0x7F, 0x00, 0x30, 0xE1, +0x07, 0x30, 0xE3, 0x04, 0x7F, 0x08, 0x54, 0xF4, 0x54, 0x7C, 0xC6, 0xD2, 0xAF, 0x54, 0x80, 0x42, +0x07, 0x22, 0x78, 0x86, 0xA6, 0x81, 0x74, 0x02, 0x60, 0x06, 0xFF, 0x08, 0x76, 0xFF, 0xDF, 0xFB, +0x7F, 0x03, 0xE4, 0x78, 0x80, 0xF6, 0x08, 0xF6, 0x08, 0xDF, 0xFA, 0x78, 0x81, 0x76, 0x30, 0x90, +0x4C, 0xD0, 0x74, 0x01, 0x93, 0xC0, 0xE0, 0xE4, 0x93, 0xC0, 0xE0, 0x43, 0x89, 0x01, 0x75, 0x8A, +0x60, 0x75, 0x8C, 0x79, 0xD2, 0x8C, 0xD2, 0xAF, 0x22, 0x02, 0xEF, 0xD3, 0x94, 0x02, 0x40, 0x03, +0x7F, 0xFF, 0x22, 0x74, 0x81, 0x2F, 0x2F, 0xF8, 0xE6, 0x20, 0xE5, 0xF4, 0xC2, 0xAF, 0xE6, 0x44, +0x30, 0xF6, 0xD2, 0xAF, 0xAE, 0x0C, 0xEE, 0xC3, 0x9F, 0x50, 0x21, 0x0E, 0x74, 0x86, 0x2E, 0xF8, +0xE6, 0xF9, 0x08, 0xE6, 0x18, 0xBE, 0x02, 0x02, 0x74, 0xFF, 0xFD, 0xED, 0x69, 0x60, 0x09, 0x09, +0xE7, 0x19, 0x19, 0xF7, 0x09, 0x09, 0x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, +0x0C, 0xB5, 0x07, 0x02, 0xAC, 0x81, 0xED, 0x6C, 0x60, 0x08, 0x0D, 0x09, 0xA8, 0x05, 0xE6, 0xF7, +0x80, 0xF4, 0xE5, 0x0C, 0xB5, 0x07, 0xDE, 0x89, 0x81, 0x7F, 0x00, 0x22, 0xEF, 0xD3, 0x94, 0x02, +0x40, 0x03, 0x7F, 0xFF, 0x22, 0xEF, 0x23, 0x24, 0x81, 0xF8, 0xC2, 0xAF, 0xE6, 0x30, 0xE5, 0x05, +0x30, 0xE0, 0x02, 0xD2, 0xE4, 0xD2, 0xE2, 0xC6, 0xD2, 0xAF, 0x7F, 0x00, 0x30, 0xE2, 0x01, 0x0F, +0x02, 0x49, 0x61, 0x8F, 0xF0, 0xE4, 0xFF, 0xFE, 0xE5, 0x0C, 0x23, 0x24, 0x80, 0xF8, 0xC2, 0xA9, +0x30, 0xF7, 0x0D, 0x7F, 0x08, 0xE6, 0x60, 0x0B, 0x2D, 0xF6, 0x60, 0x30, 0x50, 0x2E, 0x80, 0x07, +0x30, 0xF1, 0x06, 0xED, 0xF6, 0x60, 0x25, 0x7E, 0x02, 0x08, 0x30, 0xF0, 0x10, 0xC2, 0xAF, 0xE6, +0x10, 0xE7, 0x23, 0x0E, 0x30, 0xE2, 0x0C, 0xD2, 0xAF, 0x7F, 0x04, 0x80, 0x12, 0xC2, 0xAF, 0xE6, +0x10, 0xE7, 0x13, 0x54, 0xEC, 0x4E, 0xF6, 0xD2, 0xAF, 0x02, 0x49, 0x62, 0x7F, 0x08, 0x08, 0xEF, +0x44, 0x83, 0xF4, 0xC2, 0xAF, 0x56, 0xC6, 0xD2, 0xAF, 0x54, 0x80, 0x4F, 0xFF, 0x22, 0x41, 0xA5, +0xEB, 0x00, 0x41, 0xA5, 0xEC, 0x00, 0x60, 0x54, 0xA0, 0x21, 0x04, 0x04, 0x04, 0x05, 0x07, 0x07, +0x09, 0x09, 0x0C, 0x0E, 0x10, 0x12, 0x05, 0x06, 0x07, 0x0D, 0x10, 0x11, 0x12, 0x12, 0x07, 0x08, +0x09, 0x09, 0x0C, 0x0E, 0x11, 0x13, 0x09, 0x09, 0x09, 0x09, 0x0C, 0x0E, 0x11, 0x13, 0x09, 0x09, +0x09, 0x09, 0x0C, 0x0E, 0x11, 0x13, 0x05, 0x06, 0x08, 0x09, 0x0C, 0x0E, 0x12, 0x12, 0x13, 0x14, +0x07, 0x08, 0x09, 0x0A, 0x0C, 0x0F, 0x12, 0x12, 0x14, 0x16, 0x09, 0x09, 0x09, 0x09, 0x0C, 0x0E, +0x11, 0x13, 0x13, 0x13, 0x09, 0x09, 0x09, 0x09, 0x0C, 0x0E, 0x11, 0x13, 0x13, 0x13, 0x60, 0x26, +0xA5, 0x14, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, +0x24, 0x28, 0x2C, 0x30, 0x34, 0x38, 0x3C, 0x40, 0x64, 0x68, 0x6C, 0x70, 0x74, 0x78, 0x7C, 0x80, +0x84, 0x88, 0x8C, 0x95, 0x99, 0x9D, 0xA1, 0xA5, 0x41, 0xA6, 0x03, 0x00, 0x00, 0x02, 0x4C, 0x8B, +0x02, 0x49, 0xF2, 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, 0x4B, 0xBE, 0xE4, 0x7E, +0x01, 0x93, 0x60, 0xBC, 0xA3, 0xFF, 0x54, 0x3F, 0x30, 0xE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4, 0x54, 0x0F, 0x90, 0xA4, 0x24, 0xF0, 0xEF, 0x54, 0x03, 0xA3, 0xF0, 0x90, 0xA4, +0x24, 0xE0, 0x90, 0xA4, 0x1E, 0xF0, 0x90, 0xA4, 0x25, 0xE0, 0x90, 0xA4, 0x1F, 0xF0, 0x80, 0x08, +0x90, 0xA4, 0x26, 0xE0, 0x04, 0xF0, 0x81, 0xEA, 0xE4, 0x90, 0xA4, 0x26, 0xF0, 0xD1, 0x36, 0x50, +0x63, 0xC3, 0x74, 0xFB, 0xD1, 0x3F, 0x7A, 0xA4, 0x79, 0x27, 0x12, 0x33, 0xC7, 0xEF, 0x64, 0x01, +0x70, 0x42, 0x90, 0xA4, 0x27, 0xE0, 0xFF, 0x54, 0xE0, 0xFE, 0x70, 0x13, 0xEF, 0x54, 0x0E, 0x70, +0x08, 0x90, 0xA4, 0x26, 0xE0, 0x60, 0x35, 0x80, 0x00, 0x90, 0xA4, 0x28, 0x74, 0x01, 0xF0, 0x90, +0xA4, 0x28, 0xE0, 0x70, 0x09, 0xEE, 0xC4, 0x13, 0x54, 0x07, 0xA3, 0xF0, 0x80, 0x0C, 0x90, 0xA4, +0x27, 0xE0, 0x54, 0x0E, 0xC3, 0x13, 0x90, 0xA4, 0x29, 0xF0, 0x90, 0xA4, 0x29, 0xE0, 0x90, 0xA4, +0x20, 0xF0, 0x80, 0x10, 0x90, 0xA4, 0x2A, 0x74, 0x01, 0xF0, 0x80, 0x40, 0x90, 0xA4, 0x26, 0xE0, +0x04, 0xF0, 0x80, 0x99, 0x90, 0xA4, 0x1F, 0xE0, 0x25, 0xE0, 0x25, 0xE0, 0x54, 0x0C, 0xFF, 0x90, +0xA4, 0x1E, 0xE0, 0x54, 0x03, 0x4F, 0xFF, 0x90, 0xA4, 0x20, 0xE0, 0xFE, 0xC4, 0x54, 0x70, 0x4F, +0x44, 0x80, 0xFD, 0x7F, 0x8B, 0x12, 0x3A, 0x96, 0x90, 0xA4, 0x1E, 0xE0, 0x60, 0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4, 0x33, +0xFE, 0xF1, 0xC4, 0x8F, 0x82, 0x8E, 0x83, 0x12, 0x26, 0x37, 0xFF, 0x75, 0xF0, 0x08, 0xE5, 0x0D, +0x12, 0x72, 0x47, 0x25, 0x14, 0x12, 0x72, 0x2A, 0xEF, 0xF0, 0x05, 0x14, 0xE5, 0x14, 0xB4, 0x04, +0xD8, 0xAF, 0x0D, 0x12, 0x6F, 0xF5, 0x22, 0xFF, 0x75, 0xF0, 0x04, 0xE5, 0x0D, 0x90, 0x96, 0x14, +0x11, 0x65, 0xE0, 0x22, 0x4F, 0xF0, 0x90, 0x00, 0x02, 0x02, 0x26, 0x37, 0xF0, 0x90, 0x00, 0x01, +0x02, 0x26, 0x37, 0xF0, 0x90, 0xA4, 0x31, 0x01, 0x71, 0x12, 0x7F, 0x8F, 0xF1, 0xC4, 0xF1, 0xB6, +0x90, 0xA5, 0xD3, 0xF0, 0xE4, 0xFB, 0xFD, 0x12, 0xB3, 0xC8, 0x90, 0xA4, 0x34, 0x74, 0x10, 0xF0, +0x90, 0xA4, 0x42, 0x74, 0x07, 0xF1, 0xC3, 0x12, 0x26, 0x1E, 0x90, 0xA4, 0x36, 0xF0, 0x7B, 0x01, +0x7A, 0xA4, 0x79, 0x34, 0x12, 0x97, 0x1F, 0x7F, 0x04, 0x02, 0x97, 0x04, 0x90, 0x00, 0xF0, 0xE0, +0x7F, 0x01, 0x20, 0xE2, 0x02, 0x7F, 0x03, 0x22, 0x12, 0x4F, 0xFC, 0x90, 0xA1, 0x7C, 0xEF, 0xF0, +0x11, 0x1B, 0x90, 0x01, 0x64, 0x74, 0x01, 0xF0, 0x02, 0x35, 0x95, 0x11, 0x40, 0x11, 0x70, 0x12, +0xA7, 0xF2, 0x12, 0xA8, 0x11, 0x12, 0xA7, 0xCC, 0xE4, 0xF5, 0x51, 0x75, 0x52, 0x58, 0xAB, 0x51, +0x7D, 0x02, 0x7F, 0x01, 0x12, 0x39, 0x04, 0xAB, 0x52, 0x7D, 0x03, 0x7F, 0x01, 0x02, 0x39, 0x04, +0x90, 0x01, 0x30, 0xE4, 0x11, 0x68, 0x90, 0x01, 0x38, 0x11, 0x68, 0xFD, 0x7F, 0x50, 0x12, 0x3A, +0x96, 0xE4, 0xFD, 0x7F, 0x51, 0x12, 0x3A, 0x96, 0xE4, 0xFD, 0x7F, 0x52, 0x12, 0x3A, 0x96, 0xE4, +0xFD, 0x7F, 0x53, 0x02, 0x3A, 0x96, 0xF0, 0xA3, 0xF0, 0xA3, 0xF0, 0xA3, 0xF0, 0xA3, 0xF0, 0x22, +0x90, 0x01, 0x34, 0x74, 0xFF, 0x11, 0x68, 0x90, 0x01, 0x3C, 0x11, 0x68, 0xFD, 0x7F, 0x54, 0x12, +0x3A, 0x96, 0x7D, 0xFF, 0x7F, 0x55, 0x12, 0x3A, 0x96, 0x7D, 0xFF, 0x7F, 0x56, 0x12, 0x3A, 0x96, +0x7D, 0xFF, 0x7F, 0x57, 0x02, 0x3A, 0x96, 0x90, 0xA4, 0x16, 0x74, 0xFF, 0xF0, 0xE4, 0x11, 0x69, +0xA3, 0xE0, 0x54, 0xFC, 0x44, 0x02, 0xF0, 0xE4, 0x80, 0xBF, 0x12, 0x9F, 0xB1, 0x12, 0xA3, 0x43, +0x12, 0x72, 0x50, 0x12, 0xB8, 0x3F, 0x11, 0xBD, 0x12, 0xA2, 0x21, 0x80, 0xDA, 0x7E, 0x00, 0x7F, +0xAC, 0x7D, 0x00, 0x7B, 0x01, 0x7A, 0xA2, 0x79, 0x88, 0x12, 0x48, 0xA9, 0x90, 0xA2, 0x8B, 0x74, +0x02, 0xF0, 0x90, 0xA2, 0x92, 0x14, 0xF0, 0xA3, 0xF0, 0xA3, 0x74, 0x08, 0xF0, 0x90, 0xA2, 0x98, +0xE4, 0xF0, 0xA3, 0x74, 0x02, 0x31, 0xB8, 0x74, 0x08, 0xF0, 0xE4, 0xFD, 0xFF, 0x31, 0x55, 0x7D, +0x0C, 0x7F, 0x02, 0x31, 0x55, 0x31, 0x51, 0x90, 0xA1, 0x7C, 0xE0, 0xFF, 0xB4, 0x01, 0x08, 0x90, +0xA2, 0x97, 0x74, 0xFF, 0xF0, 0x80, 0x0F, 0xEF, 0x90, 0xA2, 0x97, 0xB4, 0x03, 0x05, 0x74, 0xD4, +0xF0, 0x80, 0x03, 0x74, 0x41, 0xF0, 0x12, 0xBA, 0xB4, 0x31, 0xB8, 0x74, 0x08, 0xF0, 0x7F, 0x01, +0x12, 0xB9, 0x4D, 0x90, 0xA2, 0x9A, 0x12, 0x27, 0x54, 0x54, 0x33, 0x77, 0x70, 0x7E, 0x00, 0x7F, +0x02, 0x7D, 0x00, 0x7B, 0x01, 0x7A, 0xA3, 0x79, 0x38, 0x12, 0x48, 0xA9, 0x90, 0x06, 0x04, 0xE0, +0x54, 0x7F, 0x12, 0xBB, 0xF9, 0x71, 0xCB, 0xE4, 0x90, 0xA3, 0x3A, 0xF0, 0x22, 0xE0, 0x54, 0x7F, +0xF0, 0x7D, 0x0C, 0x7F, 0x01, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xAC, 0x07, 0xEF, 0x14, +0x60, 0x15, 0x14, 0x60, 0x19, 0x24, 0x02, 0x70, 0x1A, 0xED, 0x54, 0x01, 0xFE, 0x90, 0xA2, 0x88, +0xE0, 0x54, 0xFE, 0x4E, 0xF0, 0x80, 0x0C, 0x90, 0xA2, 0x8F, 0xED, 0xF0, 0x80, 0x05, 0x90, 0xA2, +0x8E, 0xED, 0xF0, 0x90, 0x00, 0x8F, 0xE0, 0x30, 0xE4, 0x29, 0xEC, 0x14, 0x60, 0x07, 0x14, 0x60, +0x18, 0x24, 0x02, 0x70, 0x1E, 0x90, 0xA2, 0x88, 0xE0, 0x12, 0xBC, 0x02, 0xFF, 0x90, 0xA2, 0x8F, +0xE0, 0x54, 0x7F, 0x4F, 0xFD, 0x7F, 0x88, 0x80, 0x07, 0x90, 0xA2, 0x8E, 0xE0, 0xFD, 0x7F, 0x89, +0x12, 0x3A, 0x96, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xF0, 0x90, 0xA2, 0xC2, 0xE0, 0x24, 0x04, 0x90, +0xA2, 0xA4, 0xF0, 0xA3, 0x22, 0x90, 0xA2, 0x89, 0xE0, 0xC3, 0x13, 0x20, 0xE0, 0x04, 0x31, 0x51, +0x80, 0x0E, 0x12, 0xBA, 0x03, 0x71, 0xBE, 0x90, 0x05, 0x27, 0xE0, 0x44, 0x80, 0xF0, 0x71, 0xB7, +0xE4, 0xFD, 0xFF, 0x61, 0xE1, 0x7D, 0x01, 0x7F, 0x04, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, +0x90, 0xA6, 0x01, 0xED, 0xF0, 0x90, 0xA2, 0x88, 0xE0, 0xFE, 0xC4, 0x13, 0x13, 0x54, 0x03, 0x30, +0xE0, 0x02, 0x61, 0x31, 0xEE, 0x12, 0x7A, 0xF5, 0x30, 0xE0, 0x02, 0x61, 0x31, 0x90, 0xA2, 0x8F, +0xE0, 0xFE, 0x6F, 0x70, 0x02, 0x61, 0x31, 0xEF, 0x70, 0x02, 0x41, 0xA7, 0x24, 0xFE, 0x70, 0x02, +0x41, 0xE0, 0x24, 0xFE, 0x60, 0x49, 0x24, 0xFC, 0x70, 0x02, 0x61, 0x1B, 0x24, 0xFC, 0x60, 0x02, +0x61, 0x31, 0xEE, 0xB4, 0x0E, 0x02, 0x31, 0xC5, 0x90, 0xA2, 0x8F, 0xE0, 0x70, 0x04, 0x7F, 0x01, +0x71, 0xA5, 0x90, 0xA2, 0x8F, 0xE0, 0xB4, 0x06, 0x02, 0x71, 0x51, 0x90, 0xA2, 0x8F, 0xE0, 0xB4, +0x04, 0x0E, 0x90, 0xA6, 0x01, 0xE0, 0xFF, 0x60, 0x04, 0xF1, 0xBA, 0x80, 0x03, 0x12, 0xB9, 0x30, +0x90, 0xA2, 0x8F, 0xE0, 0x64, 0x08, 0x60, 0x02, 0x61, 0x31, 0x12, 0xB9, 0x93, 0x61, 0x31, 0x90, +0xA2, 0x8F, 0xE0, 0x70, 0x04, 0x7F, 0x01, 0x71, 0xA5, 0x90, 0xA2, 0x8F, 0xE0, 0xB4, 0x06, 0x02, +0x71, 0x51, 0x90, 0xA2, 0x8F, 0xE0, 0xB4, 0x0E, 0x07, 0x71, 0x36, 0xBF, 0x01, 0x02, 0x31, 0xC5, +0x90, 0xA2, 0x8F, 0xE0, 0x64, 0x0C, 0x60, 0x02, 0x61, 0x31, 0x71, 0x36, 0xEF, 0x64, 0x01, 0x60, +0x02, 0x61, 0x31, 0x71, 0x76, 0x61, 0x31, 0x90, 0xA2, 0x8F, 0xE0, 0xB4, 0x0E, 0x07, 0x71, 0x36, +0xBF, 0x01, 0x02, 0x31, 0xC5, 0x90, 0xA2, 0x8F, 0xE0, 0xB4, 0x06, 0x02, 0x71, 0x51, 0x90, 0xA2, +0x8F, 0xE0, 0xB4, 0x0C, 0x07, 0x71, 0x36, 0xBF, 0x01, 0x02, 0x71, 0x76, 0x90, 0xA2, 0x8F, 0xE0, +0x64, 0x04, 0x70, 0x5D, 0x12, 0xB8, 0xF3, 0xEF, 0x64, 0x01, 0x70, 0x55, 0xD1, 0x62, 0x80, 0x51, +0x90, 0xA2, 0x8F, 0xE0, 0xB4, 0x0E, 0x07, 0x71, 0x36, 0xBF, 0x01, 0x02, 0x31, 0xC5, 0x90, 0xA2, +0x8F, 0xE0, 0xB4, 0x06, 0x02, 0x71, 0x51, 0x90, 0xA2, 0x8F, 0xE0, 0xB4, 0x0C, 0x07, 0x71, 0x36, +0xBF, 0x01, 0x02, 0x71, 0x76, 0x90, 0xA2, 0x8F, 0xE0, 0x70, 0x04, 0x7F, 0x01, 0x71, 0xA5, 0x90, +0xA2, 0x8F, 0xE0, 0xB4, 0x04, 0x1B, 0x12, 0xB8, 0x82, 0x80, 0x16, 0x90, 0xA2, 0x8F, 0xE0, 0xB4, +0x0C, 0x0F, 0x90, 0xA2, 0x89, 0xE0, 0xFF, 0x13, 0x13, 0x54, 0x3F, 0x30, 0xE0, 0x03, 0x12, 0xB9, +0x7B, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x12, 0x7F, 0xBE, 0xBF, 0x01, 0x12, 0x12, 0x7F, 0x7A, 0x20, +0xE0, 0x0C, 0x90, 0xA2, 0x8E, 0xE0, 0xD3, 0x94, 0x04, 0x50, 0x03, 0x7F, 0x01, 0x22, 0x7F, 0x00, +0x22, 0x90, 0xA2, 0x89, 0xE0, 0x90, 0x06, 0x04, 0x20, 0xE0, 0x07, 0xE0, 0x44, 0x40, 0x71, 0xBE, +0x80, 0x0F, 0x31, 0x4D, 0x90, 0x05, 0x27, 0xE0, 0x54, 0x7F, 0xF0, 0x90, 0xA2, 0x87, 0x74, 0x0C, +0xF0, 0xE4, 0xFD, 0xFF, 0x80, 0x6B, 0x12, 0x66, 0x1B, 0x70, 0x29, 0x90, 0xA2, 0x89, 0xE0, 0x54, +0xFD, 0xF0, 0x7D, 0x2C, 0x7F, 0x6F, 0x71, 0xE1, 0x7D, 0x08, 0x7F, 0x01, 0xD1, 0x85, 0xBF, 0x01, +0x13, 0x90, 0xA2, 0x88, 0xE0, 0x44, 0x80, 0xF0, 0x7D, 0x0E, 0x7F, 0x01, 0x31, 0x55, 0x90, 0xA2, +0x87, 0x74, 0x0E, 0xF0, 0x22, 0x90, 0xA6, 0x00, 0xEF, 0xF0, 0x12, 0x9D, 0xA8, 0x90, 0xA6, 0x00, +0xE0, 0x60, 0x02, 0x71, 0xCB, 0x71, 0xBF, 0x90, 0xA2, 0x87, 0x74, 0x04, 0xF0, 0x22, 0xF0, 0x7D, +0x04, 0x7F, 0x01, 0x21, 0x55, 0xE4, 0xFD, 0x7F, 0x0C, 0x31, 0xE9, 0xE4, 0xFD, 0xFF, 0x80, 0x11, +0x90, 0xA3, 0x4B, 0x12, 0x48, 0x65, 0xE0, 0xFF, 0x7E, 0x00, 0xE4, 0xFD, 0x71, 0xEC, 0xE4, 0xFD, +0xFF, 0x90, 0x05, 0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 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, +0x83, 0xE0, 0x22, 0x90, 0xA5, 0xB3, 0xE0, 0xFF, 0xD1, 0xE3, 0x90, 0xA3, 0x3C, 0xE0, 0x22, 0x12, +0x78, 0x48, 0x90, 0xA2, 0x8F, 0xE0, 0x64, 0x0C, 0x60, 0x04, 0x71, 0xC5, 0xD1, 0x81, 0x22, 0x90, +0xA2, 0x8C, 0xE0, 0x64, 0x01, 0x70, 0x12, 0x12, 0x79, 0x40, 0x60, 0x05, 0x71, 0xC5, 0x02, 0x78, +0x48, 0x90, 0xA2, 0x8F, 0xE0, 0x70, 0x02, 0x31, 0xE5, 0x22, 0xEF, 0x60, 0x31, 0x12, 0x66, 0x1B, +0x70, 0x2C, 0x90, 0xA2, 0x89, 0xE0, 0x54, 0xFE, 0xF0, 0x7D, 0x2B, 0x7F, 0x0F, 0x71, 0xE1, 0x90, +0x06, 0x04, 0xE0, 0x54, 0xBF, 0xF0, 0xD1, 0x81, 0xBF, 0x01, 0x13, 0x90, 0xA2, 0x88, 0xE0, 0x44, +0x40, 0xF0, 0x7D, 0x06, 0x7F, 0x01, 0x31, 0x55, 0x90, 0xA2, 0x87, 0x74, 0x06, 0xF0, 0x22, 0x7D, +0x1F, 0x7F, 0x6F, 0x71, 0xE1, 0x90, 0x05, 0x27, 0xE0, 0x54, 0xBF, 0xF0, 0x90, 0xA2, 0x86, 0x74, +0x04, 0xF0, 0x22, 0x75, 0xE8, 0x03, 0x75, 0xA8, 0x85, 0x22, 0x90, 0x00, 0x80, 0xE0, 0x44, 0x80, +0xFD, 0x7F, 0x80, 0x12, 0x3A, 0x96, 0x12, 0xA8, 0x30, 0x12, 0x3A, 0xB8, 0x12, 0xA8, 0x3D, 0xF1, +0xB8, 0x7F, 0x01, 0x12, 0x4A, 0x2A, 0x90, 0xA3, 0x3B, 0x74, 0x02, 0xF0, 0xFF, 0x12, 0x4A, 0x2A, +0x90, 0xA3, 0x3B, 0xE0, 0x04, 0xF0, 0x12, 0x50, 0x08, 0x12, 0x50, 0xAA, 0x12, 0x4C, 0xD6, 0x90, +0x00, 0x80, 0xE0, 0x44, 0x40, 0xFD, 0x7F, 0x80, 0x12, 0x3A, 0x96, 0x75, 0x28, 0xFF, 0x11, 0x03, +0x11, 0x5A, 0x12, 0xA8, 0xA1, 0xE4, 0xFF, 0x02, 0x4A, 0xB3, 0xE4, 0x90, 0xA4, 0x22, 0xF0, 0xA3, +0xF0, 0x90, 0x01, 0x98, 0xE0, 0x7F, 0x00, 0x30, 0xE4, 0x02, 0x7F, 0x01, 0xEF, 0x64, 0x01, 0x60, +0x3B, 0xC3, 0x90, 0xA4, 0x23, 0xE0, 0x94, 0x88, 0x90, 0xA4, 0x22, 0xE0, 0x94, 0x13, 0x40, 0x0F, +0x90, 0x01, 0xC1, 0xE0, 0x44, 0x10, 0xF0, 0x90, 0x01, 0xC7, 0x74, 0xFD, 0xF0, 0x80, 0x1D, 0x90, +0xA4, 0x22, 0x11, 0xB3, 0xF1, 0xBF, 0xD3, 0x90, 0xA4, 0x23, 0xE0, 0x94, 0x32, 0x90, 0xA4, 0x22, +0xE0, 0x94, 0x00, 0x40, 0xBC, 0x90, 0x01, 0xC6, 0xE0, 0x30, 0xE3, 0xB5, 0x90, 0x01, 0xC7, 0x74, +0xFE, 0xF0, 0x22, 0xE4, 0x75, 0xF0, 0x01, 0x02, 0x46, 0xD6, 0xE4, 0x90, 0xA5, 0xE8, 0xF0, 0xA3, +0xF0, 0x90, 0x05, 0x22, 0xE0, 0x90, 0xA5, 0xEA, 0xF0, 0x90, 0x04, 0x2D, 0xE0, 0x54, 0x01, 0xF0, +0x90, 0x04, 0x1D, 0xE0, 0x60, 0x37, 0xC3, 0x90, 0xA5, 0xE9, 0xE0, 0x94, 0xD0, 0x90, 0xA5, 0xE8, +0xE0, 0x94, 0x07, 0x50, 0x28, 0x90, 0xA4, 0x16, 0xE0, 0xB4, 0xFF, 0x0D, 0x7D, 0x18, 0x7F, 0xFF,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xF0, 0x31, 0xEF, 0x54, 0xC0, 0xF0, 0xAF, 0x05, +0x74, 0x12, 0x2F, 0x31, 0xE7, 0xE0, 0x54, 0x01, 0xFE, 0x90, 0xA5, 0xE1, 0xE0, 0x25, 0xE0, 0x25, +0xE0, 0xFB, 0xEE, 0x44, 0x02, 0x4B, 0xFE, 0x74, 0x12, 0x2F, 0x31, 0xE7, 0xEE, 0xF0, 0x74, 0x11, +0x2F, 0x51, 0x75, 0x74, 0xFF, 0xF0, 0x74, 0x29, 0x2F, 0x51, 0x80, 0x54, 0xF7, 0xF0, 0xAE, 0x04, +0xAF, 0x05, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0x22, 0x74, +0x21, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xE0, 0x22, 0x90, 0xA5, 0xB5, 0xE0, 0xFE, +0xA3, 0xE0, 0xFF, 0x90, 0x81, 0x00, 0xE0, 0x54, 0x0F, 0xFD, 0xAC, 0x07, 0x51, 0x69, 0x44, 0x01, +0xF0, 0x51, 0x69, 0x54, 0xFB, 0xF0, 0xAC, 0x07, 0x74, 0x12, 0x2C, 0x31, 0xE7, 0xE0, 0x44, 0xFA, +0xF0, 0x74, 0x11, 0x2C, 0x51, 0x75, 0xE0, 0x44, 0x1F, 0xF0, 0xAC, 0x07, 0x74, 0x06, 0x2C, 0xF5, +0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xE0, 0x44, 0x0E, 0xF0, 0x90, 0x04, 0xA7, 0xE4, 0xF0, 0x90, +0x04, 0xA6, 0xF0, 0x90, 0x04, 0xA5, 0x74, 0xFF, 0xF0, 0x90, 0x04, 0xA4, 0x74, 0xFD, 0xF0, 0x74, +0x14, 0x2C, 0x51, 0x61, 0xE0, 0x54, 0xC0, 0x4D, 0xFD, 0x74, 0x14, 0x2F, 0x51, 0x61, 0xED, 0xF0, +0x22, 0xF5, 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x5B, 0x74, 0x41, 0x5B, 0x6B, +0x42, 0x5B, 0x78, 0x45, 0x5B, 0x6F, 0x46, 0x5B, 0x7D, 0x87, 0x00, 0x00, 0x5B, 0x82, 0x71, 0x92, +0xE1, 0x0A, 0x71, 0x92, 0x02, 0x9D, 0x52, 0x71, 0x92, 0x02, 0x7F, 0x20, 0x71, 0x92, 0x02, 0xA0, +0x0F, 0x71, 0x92, 0x02, 0xA0, 0x32, 0x71, 0x92, 0x02, 0xA2, 0x30, 0x71, 0x92, 0x02, 0xA2, 0xD0, +0x71, 0x92, 0x02, 0x7A, 0x1A, 0x71, 0x92, 0xC1, 0xE0, 0x71, 0x92, 0xE1, 0xCD, 0x71, 0x92, 0x02, +0x60, 0x52, 0x71, 0x92, 0xE1, 0xD5, 0x71, 0x92, 0x02, 0x4E, 0x7E, 0x71, 0x92, 0x80, 0x29, 0x71, +0x92, 0x02, 0xB1, 0xF1, 0x71, 0x92, 0x41, 0xB7, 0x71, 0x92, 0x02, 0xA7, 0xB8, 0x71, 0x92, 0x02, +0x4F, 0xC9, 0x90, 0x01, 0xC0, 0xE0, 0x44, 0x01, 0xF0, 0x90, 0xA4, 0x2D, 0xE0, 0x90, 0x01, 0xC2, +0xF0, 0x22, 0x90, 0xA4, 0x2E, 0x02, 0x48, 0x71, 0x90, 0xA4, 0x31, 0x12, 0x48, 0x7A, 0x12, 0x26, +0x1E, 0xF5, 0x0D, 0x24, 0x91, 0x91, 0x23, 0xE0, 0x54, 0x9C, 0x91, 0x1E, 0xC0, 0x83, 0xC0, 0x82, +0x91, 0x2B, 0x54, 0x01, 0xFE, 0xEF, 0x4E, 0xD0, 0x82, 0xD0, 0x83, 0x91, 0x1E, 0xC0, 0x83, 0xC0, +0x82, 0x91, 0x2B, 0x54, 0x02, 0xFE, 0xEF, 0x4E, 0xD0, 0x82, 0xD0, 0x83, 0x91, 0x1E, 0xC0, 0x83, +0xC0, 0x82, 0x91, 0x2B, 0x54, 0x40, 0xFE, 0xEF, 0x4E, 0xD0, 0x82, 0xD0, 0x83, 0x91, 0x1E, 0xC0, +0x83, 0xC0, 0x82, 0x91, 0x2B, 0x54, 0x20, 0xFE, 0xEF, 0x4E, 0xD0, 0x82, 0xD0, 0x83, 0xF0, 0xE5, +0x0D, 0xC3, 0x94, 0x80, 0x50, 0x11, 0x12, 0x4F, 0xB6, 0xFF, 0x74, 0x11, 0x25, 0x0D, 0xF5, 0x82, +0xE4, 0x34, 0x9A, 0xF5, 0x83, 0xEF, 0xF0, 0x91, 0x1F, 0xE0, 0x30, 0xE5, 0x10, 0x12, 0x4F, 0xA8, +0x13, 0x13, 0x54, 0x03, 0xFB, 0x91, 0x3A, 0xFD, 0xAF, 0x0D, 0x12, 0x76, 0xB3, 0x22, 0xF0, 0x74, +0x91, 0x25, 0x0D, 0xF5, 0x82, 0xE4, 0x34, 0x99, 0xF5, 0x83, 0x22, 0xE0, 0xFF, 0x90, 0xA4, 0x31, +0x12, 0x48, 0x71, 0x90, 0x00, 0x03, 0x02, 0x26, 0x37, 0xFF, 0x74, 0x11, 0x25, 0x0D, 0xF5, 0x82, +0xE4, 0x34, 0x9A, 0xF5, 0x83, 0xE0, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x00, +0x8F, 0xE0, 0x20, 0xE6, 0x02, 0xA1, 0x36, 0x90, 0x00, 0x8C, 0xE0, 0xF5, 0x71, 0xA3, 0xE0, 0xFF, +0xA3, 0xE0, 0xF5, 0x72, 0xEF, 0x24, 0xFC, 0x60, 0x13, 0x24, 0xEE, 0x70, 0x02, 0x81, 0xF2, 0x24, +0x15, 0x60, 0x02, 0xA1, 0x2D, 0xAF, 0x71, 0x12, 0xB2, 0x4A, 0xA1, 0x2D, 0x74, 0x11, 0x25, 0x71, +0x91, 0x3E, 0xFB, 0xE4, 0xFD, 0xB1, 0x75, 0x12, 0x4F, 0xAD, 0x13, 0x13, 0xB1, 0x70, 0x12, 0x4F, +0xAD, 0x12, 0x7A, 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 0x4B, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0x7F, 0xB0, 0x7E, 0x0E, 0x12, 0x37, -0x5D, 0x90, 0x00, 0x10, 0xE0, 0x44, 0x0C, 0xFD, 0x7F, 0x10, 0x12, 0x3A, 0x96, 0x90, 0x00, 0x72, -0xE0, 0x54, 0xF3, 0xFD, 0x7F, 0x72, 0x12, 0x3A, 0x96, 0x90, 0x01, 0x01, 0xE0, 0x44, 0x02, 0xF0, -0x90, 0x01, 0x00, 0x74, 0xFF, 0xF0, 0x90, 0x06, 0xB7, 0x74, 0x09, 0xF0, 0x90, 0x06, 0xB4, 0x74, -0x86, 0xF0, 0x7F, 0xB4, 0x7E, 0x08, 0x12, 0x36, 0xCE, 0xEF, 0x54, 0xBF, 0xFF, 0xEC, 0x90, 0xA6, -0x96, 0x12, 0x27, 0x48, 0x90, 0xA6, 0x96, 0x12, 0x48, 0x4B, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, -0x7F, 0xB4, 0x7E, 0x08, 0x12, 0x37, 0x5D, 0x90, 0x00, 0x02, 0xE0, 0x44, 0x01, 0xFD, 0x7F, 0x02, -0x12, 0x3A, 0x96, 0x7F, 0x00, 0x7E, 0x0C, 0x12, 0x36, 0xCE, 0xEF, 0x44, 0x03, 0xFF, 0xEC, 0x90, -0xA6, 0x96, 0x12, 0x27, 0x48, 0x90, 0xA6, 0x96, 0x12, 0x48, 0x4B, 0x90, 0xAC, 0xB9, 0x12, 0x27, -0x48, 0x7F, 0x00, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x7F, 0x00, 0x7E, 0x0E, 0x12, 0x36, 0xCE, 0xEF, -0x44, 0x03, 0xFF, 0xEC, 0x90, 0xA6, 0x96, 0x12, 0x27, 0x48, 0x90, 0xA6, 0x96, 0x12, 0x48, 0x4B, -0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0x7F, 0x00, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0x00, 0xFF, -0xE0, 0x70, 0x1D, 0x12, 0x66, 0xBF, 0x90, 0xA6, 0x9A, 0xE0, 0x54, 0xE7, 0x12, 0x79, 0xB9, 0x12, -0x66, 0xBF, 0x90, 0xA6, 0x9A, 0xE0, 0x54, 0x18, 0x70, 0x06, 0x90, 0x01, 0xBF, 0xE0, 0x04, 0xF0, -0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xF1, 0x6A, 0x90, 0xA3, 0xA4, 0xE0, 0x64, 0x0C, 0x60, 0x0A, 0xE4, -0xFD, 0x7F, 0x0C, 0x11, 0x5B, 0xE4, 0xFF, 0xF1, 0xA6, 0x22, 0x90, 0xA3, 0x9E, 0xE0, 0x13, 0x13, -0x13, 0x54, 0x1F, 0x30, 0xE0, 0x05, 0x90, 0x01, 0x5B, 0xE4, 0xF0, 0x90, 0x06, 0x92, 0x74, 0x02, -0xF0, 0x90, 0x01, 0x3C, 0x74, 0x04, 0xF0, 0xE4, 0xF5, 0x22, 0x90, 0xA3, 0xB4, 0xE0, 0xC3, 0x13, -0x54, 0x7F, 0xF5, 0x23, 0xE4, 0xFB, 0xFD, 0x7F, 0x58, 0x7E, 0x01, 0x12, 0x60, 0x58, 0x90, 0xA3, -0x9E, 0xE0, 0x44, 0x08, 0xF0, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x8F, 0x24, 0x90, -0x04, 0x1D, 0xE0, 0x60, 0x1F, 0x90, 0x05, 0x22, 0xE0, 0xF5, 0x27, 0x74, 0xFF, 0xF0, 0x12, 0x66, -0x77, 0xBF, 0x01, 0x08, 0xAF, 0x24, 0x12, 0xBC, 0xAF, 0x12, 0x67, 0x16, 0x90, 0x05, 0x22, 0xE5, -0x27, 0xF0, 0x80, 0x03, 0x12, 0x67, 0x16, 0x90, 0x04, 0x1F, 0x74, 0x20, 0xF0, 0x7F, 0x01, 0xD0, -0xD0, 0x92, 0xAF, 0x22, 0xE4, 0xFF, 0x80, 0xBE, 0x90, 0xA3, 0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, 0xFF, 0x90, 0xA2, 0x80, 0xE0, 0xB5, 0x07, 0x04, 0x7F, 0x01, 0x80, 0x02, 0x7F, 0x00, -0xEF, 0x70, 0x43, 0x90, 0xA2, 0x80, 0xE0, 0xFE, 0x75, 0xF0, 0x08, 0x90, 0xA2, 0x30, 0x12, 0x48, -0x83, 0xE0, 0xFD, 0xEE, 0x75, 0xF0, 0x08, 0xA4, 0x24, 0x31, 0xF9, 0x74, 0xA2, 0x35, 0xF0, 0xFA, -0x7B, 0x01, 0xAF, 0x05, 0x31, 0x71, 0x90, 0xA2, 0x80, 0xE0, 0x04, 0xF0, 0xE0, 0x7F, 0x00, 0xB4, -0x0A, 0x02, 0x7F, 0x01, 0xEF, 0x60, 0x05, 0xE4, 0x90, 0xA2, 0x80, 0xF0, 0x12, 0x73, 0x95, 0x90, -0xA2, 0x26, 0xE0, 0x44, 0x02, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, -0xC0, 0xD0, 0x90, 0xA6, 0xB2, 0x12, 0x48, 0x98, 0x7F, 0x96, 0x7E, 0x02, 0x12, 0x74, 0xD3, 0xEF, -0x60, 0x5A, 0x90, 0x01, 0x17, 0xE0, 0xFE, 0x90, 0x01, 0x16, 0xE0, 0x7C, 0x00, 0x24, 0x00, 0xFF, -0xEC, 0x3E, 0xFE, 0xEF, 0x24, 0x01, 0xFF, 0xE4, 0x3E, 0xFE, 0x90, 0xA6, 0xB5, 0xEF, 0xF0, 0xEE, -0xFF, 0x90, 0xFD, 0x11, 0xF0, 0x90, 0xA6, 0xB5, 0xE0, 0xFD, 0x90, 0x02, 0x94, 0xF0, 0xA3, 0xEF, -0xF0, 0x90, 0xA6, 0xB2, 0x12, 0x48, 0x8F, 0x90, 0x00, 0x0E, 0x12, 0x26, 0x37, 0x24, 0x02, 0xFF, -0xE4, 0x33, 0xFE, 0x12, 0x75, 0x8C, 0x90, 0xA6, 0xB5, 0xE0, 0x24, 0x18, 0xFF, 0x90, 0xA6, 0xB2, -0x12, 0x48, 0x8F, 0x12, 0x75, 0xE7, 0x90, 0x02, 0x96, 0x74, 0x01, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, -0x22, 0x90, 0xA4, 0x8E, 0x12, 0x48, 0x98, 0xEF, 0x12, 0x48, 0xA1, 0x59, 0xB5, 0x00, 0x59, 0xBE, -0x01, 0x59, 0xC7, 0x02, 0x59, 0xD0, 0x03, 0x59, 0xD9, 0x04, 0x59, 0xE2, 0x12, 0x59, 0xEA, 0x14, -0x59, 0xF2, 0x20, 0x59, 0xFB, 0x21, 0x5A, 0x04, 0x23, 0x5A, 0x0C, 0x25, 0x5A, 0x14, 0x27, 0x5A, -0x1D, 0x40, 0x5A, 0x38, 0x41, 0x5A, 0x26, 0x42, 0x5A, 0x2F, 0x43, 0x5A, 0x41, 0x45, 0x5A, 0x49, -0x87, 0x00, 0x00, 0x5A, 0x51, 0x90, 0xA4, 0x8E, 0x12, 0x48, 0x8F, 0x02, 0x71, 0x49, 0x90, 0xA4, -0x8E, 0x12, 0x48, 0x8F, 0x02, 0x71, 0x91, 0x90, 0xA4, 0x8E, 0x12, 0x48, 0x8F, 0x02, 0x72, 0x67, -0x90, 0xA4, 0x8E, 0x12, 0x48, 0x8F, 0x02, 0xBA, 0x10, 0x90, 0xA4, 0x8E, 0x12, 0x48, 0x8F, 0x02, -0x4F, 0x79, 0x90, 0xA4, 0x8E, 0x12, 0x48, 0x8F, 0x80, 0x6F, 0x90, 0xA4, 0x8E, 0x12, 0x48, 0x8F, -0xE1, 0xBE, 0x90, 0xA4, 0x8E, 0x12, 0x48, 0x8F, 0x02, 0x72, 0x9F, 0x90, 0xA4, 0x8E, 0x12, 0x48, -0x8F, 0x02, 0x73, 0x1B, 0x90, 0xA4, 0x8E, 0x12, 0x48, 0x8F, 0xE1, 0xB6, 0x90, 0xA4, 0x8E, 0x12, -0x48, 0x8F, 0xE1, 0xCD, 0x90, 0xA4, 0x8E, 0x12, 0x48, 0x8F, 0x02, 0x73, 0x61, 0x90, 0xA4, 0x8E, -0x12, 0x48, 0x8F, 0x02, 0x96, 0x6D, 0x90, 0xA4, 0x8E, 0x12, 0x48, 0x8F, 0x02, 0x98, 0x4F, 0x90, -0xA4, 0x8E, 0x12, 0x48, 0x8F, 0x02, 0x99, 0x08, 0x90, 0xA4, 0x8E, 0x12, 0x48, 0x8F, 0x02, 0xB9, -0xA2, 0x90, 0xA4, 0x8E, 0x12, 0x48, 0x8F, 0x80, 0x24, 0x90, 0xA4, 0x8E, 0x12, 0x48, 0x8F, 0x80, -0x6B, 0x90, 0x01, 0xC0, 0xE0, 0x44, 0x01, 0xF0, 0x22, 0x12, 0x26, 0x1E, 0xFF, 0x90, 0xA3, 0x1C, -0xF0, 0xBF, 0x01, 0x08, 0x12, 0x76, 0x95, 0xE4, 0x90, 0xA3, 0x1C, 0xF0, 0x22, 0x90, 0x00, 0x01, -0x12, 0x26, 0x37, 0x90, 0xA3, 0xC7, 0xF0, 0x90, 0x00, 0x02, 0x12, 0x26, 0x37, 0x90, 0xA3, 0xC8, -0xF0, 0x12, 0xA2, 0x6B, 0x7F, 0x01, 0x90, 0xA4, 0x91, 0x74, 0x11, 0xF0, 0x90, 0xA4, 0x9F, 0x74, -0x01, 0xF0, 0x90, 0xA4, 0x93, 0xEF, 0xF0, 0x7B, 0x01, 0x7A, 0xA4, 0x79, 0x91, 0xF1, 0xDD, 0x7F, -0x04, 0x90, 0xA6, 0xDF, 0xEF, 0xF0, 0x7F, 0x02, 0x12, 0x4B, 0x1E, 0x90, 0xA2, 0x26, 0xE0, 0xFF, -0x90, 0xA6, 0xDF, 0xE0, 0xFE, 0xEF, 0x4E, 0x90, 0xA2, 0x26, 0xF0, 0x22, 0x90, 0xA4, 0x91, 0x12, -0x48, 0x98, 0x12, 0x26, 0x1E, 0xFF, 0x90, 0xA4, 0x91, 0x12, 0x48, 0x8F, 0x90, 0x00, 0x02, 0x12, -0x26, 0x37, 0x90, 0xA6, 0xA8, 0xF0, 0xE4, 0xFB, 0xFD, 0x71, 0x00, 0x90, 0xA4, 0x94, 0x74, 0x10, -0xF0, 0x90, 0xA4, 0xA2, 0x74, 0x07, 0xF0, 0x90, 0xA4, 0x91, 0x12, 0x48, 0x8F, 0x12, 0x26, 0x1E, -0x90, 0xA4, 0x96, 0xF0, 0x7B, 0x01, 0x7A, 0xA4, 0x79, 0x94, 0xF1, 0xDD, 0x7F, 0x04, 0x80, 0xA1, -0x90, 0xA6, 0xA6, 0xED, 0xF0, 0xA3, 0xEB, 0xF0, 0x90, 0xA6, 0xA5, 0xEF, 0xF0, 0x90, 0xA6, 0xA8, -0xE0, 0xFD, 0x12, 0x9D, 0x84, 0x90, 0xA6, 0xA5, 0xE0, 0xC3, 0x94, 0x0E, 0x50, 0x46, 0x90, 0xA6, -0x6B, 0x12, 0x27, 0x54, 0x1F, 0xFE, 0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x12, 0xD4, -0x00, 0x00, 0x7F, 0x60, 0x7E, 0x08, 0xD1, 0xAA, 0x90, 0xA6, 0x59, 0x12, 0x27, 0x54, 0x00, 0x07, -0x03, 0x00, 0x90, 0xA6, 0x5D, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0xB1, 0x9F, 0x90, 0xA6, -0x59, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0x00, 0x90, 0xA6, 0x5D, 0x12, 0x27, 0x54, 0x00, 0x00, -0x00, 0x00, 0x81, 0xA8, 0x90, 0xA6, 0xA5, 0xE0, 0xFF, 0x74, 0x24, 0xD3, 0x9F, 0x50, 0x1B, 0xEF, -0x94, 0x30, 0x50, 0x16, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x1F, 0xFE, 0x00, 0x00, 0x90, 0xA6, -0x6F, 0x12, 0x27, 0x54, 0x09, 0x28, 0x00, 0x00, 0x80, 0x6B, 0x90, 0xA6, 0xA5, 0xE0, 0xFF, 0x74, -0x32, 0xD3, 0x9F, 0x50, 0x1B, 0xEF, 0x94, 0x40, 0x50, 0x16, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, -0x1F, 0xFE, 0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x08, 0xA6, 0x00, 0x00, 0x80, 0x45, -0x90, 0xA6, 0xA5, 0xE0, 0xFF, 0x74, 0x64, 0xD3, 0x9F, 0x50, 0x1B, 0xEF, 0x94, 0x74, 0x50, 0x16, -0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x1F, 0xFE, 0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, -0x08, 0xA4, 0x00, 0x00, 0x80, 0x1F, 0x90, 0xA6, 0xA5, 0xE0, 0xFF, 0x74, 0x76, 0xD3, 0x9F, 0x50, -0x1A, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x1F, 0xFE, 0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, -0x54, 0x08, 0x24, 0x00, 0x00, 0x7F, 0x60, 0x7E, 0x08, 0xD1, 0xAA, 0x90, 0xA6, 0xA5, 0xE0, 0xFF, -0x74, 0x24, 0xD3, 0x9F, 0x50, 0x31, 0xEF, 0x94, 0x40, 0x50, 0x2C, 0x90, 0xA6, 0x59, 0x12, 0x27, -0x54, 0x00, 0x07, 0x03, 0x00, 0x90, 0xA6, 0x5D, 0x12, 0x27, 0x54, 0x00, 0x01, 0x01, 0x00, 0xB1, -0x9F, 0x90, 0xA6, 0x59, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0x00, 0x90, 0xA6, 0x5D, 0x12, 0x27, -0x54, 0x00, 0x01, 0x01, 0x00, 0x80, 0x71, 0x90, 0xA6, 0xA5, 0xE0, 0xFF, 0x74, 0x64, 0xD3, 0x9F, -0x50, 0x31, 0xEF, 0x94, 0x8C, 0x50, 0x2C, 0x90, 0xA6, 0x59, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, -0x00, 0x90, 0xA6, 0x5D, 0x12, 0x27, 0x54, 0x00, 0x03, 0x01, 0x00, 0xB1, 0x9F, 0x90, 0xA6, 0x59, -0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0x00, 0x90, 0xA6, 0x5D, 0x12, 0x27, 0x54, 0x00, 0x03, 0x01, -0x00, 0x80, 0x35, 0x90, 0xA6, 0xA5, 0xE0, 0xFF, 0x74, 0x8C, 0xC3, 0x9F, 0x50, 0x32, 0x90, 0xA6, -0x59, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0x00, 0x90, 0xA6, 0x5D, 0x12, 0x27, 0x54, 0x00, 0x05, -0x01, 0x00, 0xB1, 0x9F, 0x90, 0xA6, 0x59, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0x00, 0x90, 0xA6, -0x5D, 0x12, 0x27, 0x54, 0x00, 0x05, 0x01, 0x00, 0x7D, 0x18, 0x7C, 0x00, 0x7F, 0x01, 0xB1, 0xA5, -0x90, 0xA6, 0xA5, 0xE0, 0xFF, 0xA3, 0xE0, 0xFD, 0x12, 0x9C, 0x44, 0x90, 0xA6, 0xA6, 0xE0, 0x64, -0x02, 0x70, 0x66, 0x90, 0xA6, 0xA5, 0xE0, 0xFF, 0xD3, 0x94, 0x30, 0x50, 0x08, 0x90, 0xA6, 0xA9, -0x74, 0x2A, 0xF0, 0x80, 0x70, 0xEF, 0xD3, 0x94, 0x40, 0x50, 0x08, 0x90, 0xA6, 0xA9, 0x74, 0x3A, -0xF0, 0x80, 0x62, 0xEF, 0xD3, 0x94, 0x70, 0x50, 0x08, 0x90, 0xA6, 0xA9, 0x74, 0x6A, 0xF0, 0x80, -0x54, 0xEF, 0xD3, 0x94, 0x80, 0x50, 0x08, 0x90, 0xA6, 0xA9, 0x74, 0x7A, 0xF0, 0x80, 0x46, 0xEF, -0xD3, 0x94, 0x90, 0x50, 0x08, 0x90, 0xA6, 0xA9, 0x74, 0x8A, 0xF0, 0x80, 0x38, 0xEF, 0xD3, 0x94, -0xA1, 0x50, 0x08, 0x90, 0xA6, 0xA9, 0x74, 0x9B, 0xF0, 0x80, 0x2A, 0xEF, 0xD3, 0x94, 0xB1, 0x50, -0x24, 0x90, 0xA6, 0xA9, 0x74, 0xAB, 0xF0, 0x80, 0x1C, 0x90, 0xA6, 0xA6, 0xE0, 0x64, 0x01, 0x70, -0x32, 0xA3, 0xE0, 0x90, 0xA6, 0xA5, 0xB4, 0x01, 0x05, 0xE0, 0x24, 0x02, 0x80, 0x03, 0xE0, 0x24, -0xFE, 0x90, 0xA6, 0xA9, 0xF0, 0x90, 0xA6, 0x59, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0xFF, 0x90, -0xA6, 0xA9, 0xB1, 0x93, 0x90, 0xA6, 0x59, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0xFF, 0x90, 0xA6, -0xA9, 0x80, 0x1C, 0x90, 0xA6, 0x59, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0xFF, 0x90, 0xA6, 0xA5, -0xB1, 0x93, 0x90, 0xA6, 0x59, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0xFF, 0x90, 0xA6, 0xA5, 0xE0, -0xFF, 0xE4, 0xFC, 0xFD, 0xFE, 0x90, 0xA6, 0x5D, 0x12, 0x27, 0x48, 0x7D, 0x18, 0x7C, 0x00, 0x7F, -0x01, 0x80, 0x12, 0xE0, 0xFF, 0xE4, 0xFC, 0xFD, 0xFE, 0x90, 0xA6, 0x5D, 0x12, 0x27, 0x48, 0x7D, -0x18, 0x7C, 0x00, 0xE4, 0xFF, 0x90, 0xA6, 0x57, 0xEC, 0xF0, 0xA3, 0xED, 0xF0, 0x90, 0xA6, 0x56, -0xEF, 0xF0, 0xA3, 0xA3, 0xE0, 0xFD, 0xD1, 0x16, 0x90, 0xA6, 0x61, 0x12, 0x27, 0x48, 0x90, 0xA6, -0x59, 0x12, 0x48, 0x4B, 0x12, 0x27, 0x15, 0x90, 0xA6, 0x61, 0x12, 0x48, 0x67, 0x12, 0x47, 0x7C, -0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xA6, 0x59, 0x12, 0x48, 0x4B, 0x90, 0xA6, -0x5D, 0x12, 0x48, 0x67, 0x12, 0x47, 0x7C, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0x12, -0x47, 0x89, 0x90, 0xA6, 0x65, 0x12, 0x27, 0x48, 0x90, 0xA6, 0x57, 0xA3, 0xE0, 0xFD, 0xC0, 0x05, -0x90, 0xA6, 0x65, 0x12, 0x48, 0x4B, 0x90, 0xAC, 0x96, 0x12, 0x27, 0x48, 0x90, 0xA6, 0x56, 0xE0, -0xFF, 0xD0, 0x05, 0x02, 0x39, 0xBA, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x12, 0x67, 0xDD, -0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0xA5, 0x04, 0x12, 0x48, 0x98, 0x90, 0xA6, 0x6B, 0x12, 0x27, -0x54, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0xD1, -0xA6, 0x7D, 0x65, 0xE4, 0xFF, 0xD1, 0x16, 0x90, 0xA5, 0x04, 0x12, 0x48, 0x8F, 0x12, 0x48, 0x0D, -0x7D, 0x8F, 0xE4, 0xFF, 0xD1, 0x16, 0x90, 0xA5, 0x04, 0x12, 0x48, 0x8F, 0x90, 0x00, 0x04, 0x12, -0x48, 0x27, 0xE4, 0xFD, 0xFF, 0xD1, 0x16, 0x90, 0xA5, 0x04, 0x12, 0x48, 0x8F, 0x90, 0x00, 0x08, -0x12, 0x48, 0x27, 0x7D, 0x65, 0x7F, 0x01, 0xD1, 0x16, 0x90, 0xA5, 0x07, 0x12, 0x48, 0x8F, 0x12, -0x48, 0x0D, 0x7D, 0x8F, 0x7F, 0x01, 0xD1, 0x16, 0x90, 0xA5, 0x07, 0x12, 0x48, 0x8F, 0x90, 0x00, -0x04, 0x12, 0x48, 0x27, 0xE4, 0xFD, 0x7F, 0x01, 0xD1, 0x16, 0x90, 0xA5, 0x07, 0x12, 0x48, 0x8F, -0x90, 0x00, 0x08, 0x02, 0x48, 0x27, 0x7F, 0x2C, 0x7E, 0x08, 0x90, 0xA6, 0x69, 0xEE, 0xF0, 0xA3, -0xEF, 0xF0, 0x12, 0x36, 0xCE, 0x90, 0xA6, 0x73, 0x12, 0x27, 0x48, 0x90, 0xA6, 0x6B, 0x12, 0x48, -0x4B, 0x12, 0x27, 0x15, 0x90, 0xA6, 0x73, 0x12, 0x48, 0x67, 0x12, 0x47, 0x7C, 0xC0, 0x04, 0xC0, -0x05, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xA6, 0x6B, 0x12, 0x48, 0x4B, 0x90, 0xA6, 0x6F, 0x12, 0x48, -0x67, 0x12, 0x47, 0x7C, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0x12, 0x47, 0x89, 0x90, -0xA6, 0x77, 0x12, 0x27, 0x48, 0x90, 0xA6, 0x77, 0x12, 0x48, 0x4B, 0x90, 0xAC, 0xB9, 0x12, 0x27, -0x48, 0x90, 0xA6, 0x69, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x02, 0x37, 0x5D, 0x90, 0xA5, 0x04, 0xEF, -0xF0, 0xA3, 0x12, 0x48, 0x98, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0x90, -0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0xD1, 0xA6, 0x90, 0xA5, 0x05, 0x12, 0x48, -0x8F, 0x12, 0x47, 0xBD, 0x90, 0xA5, 0x48, 0x12, 0x27, 0x48, 0x90, 0xA5, 0x04, 0xE0, 0xFF, 0x7D, -0x65, 0xF1, 0x93, 0x90, 0xA5, 0x05, 0x12, 0x48, 0x8F, 0x90, 0x00, 0x04, 0x12, 0x47, 0xDD, 0x90, -0xA5, 0x48, 0x12, 0x27, 0x48, 0x90, 0xA5, 0x04, 0xE0, 0xFF, 0x7D, 0x8F, 0xF1, 0x93, 0x90, 0xA5, -0x05, 0x12, 0x48, 0x8F, 0x90, 0x00, 0x08, 0x12, 0x47, 0xDD, 0x90, 0xA5, 0x48, 0x12, 0x27, 0x48, -0x90, 0xA5, 0x04, 0xE0, 0xFF, 0xE4, 0xFD, 0xF1, 0x93, 0x90, 0xA5, 0x48, 0x12, 0x27, 0x54, 0x00, -0x00, 0x00, 0x00, 0x90, 0xA5, 0x04, 0xE0, 0xFF, 0x7D, 0xEF, 0x80, 0x07, 0x90, 0xA5, 0x04, 0xE0, -0xFF, 0x7D, 0xEF, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xC0, 0x07, 0xC0, 0x05, 0x90, 0xA5, -0x48, 0x12, 0x48, 0x4B, 0x90, 0xAC, 0x9C, 0x12, 0x27, 0x48, 0xD0, 0x05, 0xD0, 0x07, 0x12, 0x32, -0x65, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x12, 0x26, 0x1E, 0x90, 0xA3, 0xAB, 0xF0, 0x22, 0x12, 0x26, -0x1E, 0x54, 0x01, 0xFF, 0x90, 0xA4, 0x7F, 0xE0, 0x54, 0xFE, 0x4F, 0xF0, 0x22, 0x12, 0x26, 0x1E, -0x90, 0xA3, 0xB8, 0xF0, 0x90, 0xA3, 0xB8, 0xE0, 0x90, 0x01, 0xE7, 0xF0, 0x22, 0xD3, 0x10, 0xAF, -0x01, 0xC3, 0xC0, 0xD0, 0x90, 0xA3, 0x18, 0xE0, 0xFF, 0x70, 0x06, 0xA3, 0xE0, 0x64, 0x09, 0x60, -0x0A, 0xEF, 0x14, 0xFF, 0x90, 0xA3, 0x19, 0xE0, 0xB5, 0x07, 0x04, 0x7F, 0x01, 0x80, 0x02, 0x7F, -0x00, 0xEF,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 0x74, 0x21, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xE0, 0x54, 0xC0, -0xF0, 0x74, 0x29, 0x2D, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xE0, 0x54, 0xF7, 0xF0, 0xAE, -0x04, 0xAF, 0x05, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xE4, 0xF5, 0x71, 0xF5, 0x72, 0x90, 0x05, 0x22, -0xE0, 0xF5, 0x73, 0x90, 0x04, 0x2D, 0xE0, 0x54, 0x01, 0xF0, 0x90, 0x04, 0x1D, 0xE0, 0x60, 0x35, -0xC3, 0xE5, 0x72, 0x94, 0xD0, 0xE5, 0x71, 0x94, 0x07, 0x50, 0x2A, 0x90, 0xA4, 0x74, 0xE0, 0xB4, -0xFF, 0x0C, 0x90, 0x05, 0x22, 0xE5, 0x73, 0xF0, 0xE4, 0x90, 0xA4, 0x7B, 0xF0, 0x22, 0x90, 0x05, -0x22, 0x74, 0xFF, 0xF0, 0x7F, 0x01, 0x7E, 0x00, 0x12, 0x3A, 0xF7, 0x05, 0x72, 0xE5, 0x72, 0x70, -0x02, 0x05, 0x71, 0x80, 0xC5, 0x90, 0xA4, 0x74, 0xE0, 0xFF, 0x7D, 0x01, 0x31, 0x2C, 0xAB, 0x07, -0xAA, 0x06, 0x74, 0x28, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xE0, 0xB4, 0x54, 0x03, -0x12, 0xB9, 0x7F, 0x74, 0x14, 0x2B, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xE0, 0xC4, 0x13, -0x54, 0x03, 0xFF, 0x90, 0xA4, 0x78, 0xE0, 0x54, 0xFC, 0x4F, 0xF0, 0xE5, 0x73, 0x54, 0xEF, 0x90, -0x05, 0x22, 0xF0, 0x90, 0x04, 0x1F, 0x74, 0x20, 0xF0, 0x90, 0xA4, 0x79, 0xE4, 0x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90, 0xA3, 0xB9, 0xE0, 0x30, 0xE0, 0x11, 0x90, -0x01, 0x3B, 0xE0, 0x30, 0xE4, 0x0A, 0x51, 0xCE, 0x90, 0xA3, 0xBB, 0xE0, 0x90, 0x05, 0x73, 0xF0, -0x22, 0x90, 0x05, 0x22, 0x74, 0xFF, 0xF0, 0x91, 0x9B, 0x90, 0xA3, 0xA4, 0x74, 0x08, 0xF0, 0x22, -0x90, 0x05, 0x22, 0x74, 0xFF, 0xF0, 0xD1, 0x77, 0x90, 0x01, 0x37, 0x74, 0x02, 0xF0, 0xFD, 0x7F, -0x03, 0x71, 0xAA, 0x91, 0x9B, 0xE4, 0x90, 0xA3, 0xA4, 0xF0, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, -0xC0, 0xD0, 0xD1, 0x77, 0x7F, 0x00, 0x7E, 0x0C, 0x12, 0x36, 0xCE, 0xEF, 0x54, 0xFC, 0xFF, 0xEC, -0x90, 0xA6, 0x9C, 0x12, 0x27, 0x48, 0x90, 0xA6, 0x9C, 0x12, 0x48, 0x4B, 0x90, 0xAC, 0xB9, 0x12, -0x27, 0x48, 0x7F, 0x00, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x7F, 0x00, 0x7E, 0x0E, 0x12, 0x36, 0xCE, -0xEF, 0x54, 0xFC, 0xFF, 0xEC, 0x90, 0xA6, 0x9C, 0x12, 0x27, 0x48, 0x90, 0xA6, 0x9C, 0x12, 0x48, -0x4B, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0x7F, 0x00, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0x00, -0x02, 0xE0, 0x54, 0xFE, 0xFD, 0x7F, 0x02, 0x12, 0x3A, 0x96, 0x90, 0x00, 0x02, 0xE0, 0x44, 0x01, -0xFD, 0x7F, 0x02, 0x12, 0x3A, 0x96, 0x90, 0x00, 0x02, 0xE0, 0x54, 0xFE, 0xFD, 0x7F, 0x02, 0x12, -0x3A, 0x96, 0x90, 0x00, 0x02, 0xE0, 0x44, 0x01, 0xFD, 0x7F, 0x02, 0x12, 0x3A, 0x96, 0x90, 0x00, -0x02, 0xE0, 0x54, 0xFE, 0xFD, 0x7F, 0x02, 0x12, 0x3A, 0x96, 0x7F, 0xB4, 0x7E, 0x08, 0x12, 0x36, -0xCE, 0xEF, 0x44, 0x40, 0xFF, 0xEC, 0x90, 0xA6, 0x9C, 0x12, 0x27, 0x48, 0x90, 0xA6, 0x9C, 0x12, -0x48, 0x4B, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0x7F, 0xB4, 0x7E, 0x08, 0x12, 0x37, 0x5D, 0x90, -0x01, 0x00, 0x74, 0x3F, 0xF0, 0xA3, 0xE0, 0x54, 0xFD, 0xF0, 0x90, 0x05, 0x53, 0xE0, 0x44, 0x20, -0xF0, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x36, 0xCE, 0x90, 0xA3, 0xAE, 0x12, 0x27, 0x48, 0x90, 0xAC, -0xB9, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, 0x77, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, -0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, 0x77, 0x7F, 0xB0, 0x7E, 0x0E, 0x12, 0x37, 0x5D, -0x90, 0x00, 0xFF, 0xE0, 0x70, 0x11, 0x7B, 0x01, 0x7A, 0xA6, 0x79, 0x9B, 0xD1, 0xC5, 0x90, 0xA6, -0x9B, 0xE0, 0x44, 0x18, 0x12, 0x79, 0xB9, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xEF, 0x14, 0x90, 0x05, -0x73, 0xF0, 0x90, 0x01, 0x3F, 0x74, 0x10, 0xF0, 0xFD, 0x7F, 0x03, 0x74, 0x65, 0x2F, 0xF8, 0xE6, -0x4D, 0xFE, 0xF6, 0x74, 0x38, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x01, 0xF5, 0x83, 0xEE, 0xF0, 0x22, -0xAC, 0x07, 0xEF, 0x54, 0x01, 0xFE, 0x90, 0xA3, 0xB9, 0xE0, 0x54, 0xFE, 0x4E, 0xF0, 0xEF, 0x90, -0x01, 0x53, 0xB4, 0x01, 0x11, 0xE4, 0xF0, 0x7D, 0x10, 0x7F, 0x03, 0xB1, 0xBB, 0x90, 0xA3, 0xBB, -0xE0, 0x90, 0x05, 0x73, 0xF0, 0x22, 0x74, 0x03, 0xF0, 0x7D, 0x10, 0xFF, 0xD1, 0x01, 0x02, 0x56, -0x46, 0x74, 0x65, 0x2F, 0xF8, 0xE6, 0xFE, 0xED, 0xF4, 0x5E, 0xFE, 0xF6, 0x74, 0x38, 0x2F, 0xF5, -0x82, 0xE4, 0x34, 0x01, 0xF5, 0x83, 0xEE, 0xF0, 0x22, 0x90, 0xA3, 0xA1, 0xE0, 0x60, 0x28, 0x90, -0xA3, 0x1D, 0xE0, 0x64, 0x01, 0x70, 0x20, 0x90, 0xA3, 0xA8, 0xF0, 0x04, 0x60, 0x19, 0x90, 0xA3, -0xA5, 0xE0, 0x44, 0x10, 0xF0, 0xE4, 0xF5, 0x22, 0x90, 0xA3, 0xA9, 0x11, 0x4E, 0x90, 0xA3, 0xA4, -0xE0, 0x20, 0xE2, 0x03, 0x12, 0x50, 0x57, 0x22, 0x90, 0xA4, 0x91, 0x12, 0x48, 0x98, 0xF1, 0xCC, -0x90, 0xA3, 0xA1, 0xE0, 0xFF, 0x71, 0x27, 0x90, 0xA3, 0xA1, 0xE0, 0x60, 0x19, 0x90, 0xA4, 0x91, -0x12, 0x48, 0x8F, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0x54, 0x0F, 0xFF, 0x90, 0x00, 0x02, 0x12, -0x26, 0x37, 0xFD, 0x12, 0xBB, 0xD8, 0x22, 0xE4, 0x90, 0xA6, 0xD1, 0xF0, 0xA3, 0xF0, 0x90, 0x05, -0xF8, 0xE0, 0x70, 0x0F, 0xA3, 0xE0, 0x70, 0x0B, 0xA3, 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, 0xE4, 0xFF, 0xEC, 0x90, 0xA5, -0x48, 0x12, 0x27, 0x48, 0x90, 0xA5, 0x48, 0x12, 0x48, 0x67, 0x90, 0xA5, 0x47, 0xE0, 0xFF, 0xE4, -0xFC, 0xFD, 0xFE, 0x12, 0x47, 0x89, 0xA3, 0x12, 0x27, 0x48, 0x90, 0xA5, 0x48, 0x12, 0x48, 0x4B, -0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0x7F, 0xB0, 0x7E, 0x08, 0x12, 0x37, 0x5D, 0x7F, 0x14, 0x7E, -0x00, 0x12, 0x3A, 0xF7, 0x90, 0xA5, 0x46, 0xE0, 0x75, 0xF0, 0x08, 0xA4, 0x24, 0x73, 0xF5, 0x82, -0xE4, 0x34, 0xAF, 0xF5, 0x83, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x12, 0x36, 0xCE, 0xED, 0x54, 0x0F, -0xFD, 0xE4, 0xFC, 0x22, 0xC0, 0xE0, 0xC0, 0xF0, 0xC0, 0x83, 0xC0, 0x82, 0xC0, 0xD0, 0x75, 0xD0, -0x00, 0xC0, 0x00, 0xC0, 0x01, 0xC0, 0x02, 0xC0, 0x03, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, -0x07, 0x90, 0x01, 0xC4, 0x74, 0x54, 0xF0, 0x74, 0x68, 0xA3, 0xF0, 0x11, 0xA3, 0x74, 0x54, 0x04, -0x90, 0x01, 0xC4, 0xF0, 0x74, 0x68, 0xA3, 0xF0, 0xD0, 0x07, 0xD0, 0x06, 0xD0, 0x05, 0xD0, 0x04, -0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0xD0, 0xD0, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xF0, -0xD0, 0xE0, 0x32, 0x7B, 0x00, 0x7A, 0x00, 0x79, 0x53, 0xE4, 0xFD, 0x7F, 0x01, 0x12, 0x39, 0x33, -0xE5, 0x51, 0x52, 0x53, 0x7B, 0x00, 0x7A, 0x00, 0x79, 0x54, 0x7D, 0x01, 0x7F, 0x01, 0x12, 0x39, -0x33, 0xE5, 0x52, 0x52, 0x54, 0xAB, 0x53, 0xE4, 0xFD, 0x7F, 0x01, 0x12, 0x39, 0x04, 0xAB, 0x54, -0x7D, 0x01, 0x7F, 0x01, 0x02, 0x39, 0x04, 0xC0, 0xE0, 0xC0, 0xF0, 0xC0, 0x83, 0xC0, 0x82, 0xC0, -0xD0, 0x75, 0xD0, 0x00, 0xC0, 0x00, 0xC0, 0x01, 0xC0, 0x02, 0xC0, 0x03, 0xC0, 0x04, 0xC0, 0x05, -0xC0, 0x06, 0xC0, 0x07, 0x90, 0x01, 0xC4, 0x74, 0xD7, 0xF0, 0x74, 0x68, 0xA3, 0xF0, 0x31, 0x39, -0xE5, 0x5C, 0x30, 0xE7, 0x02, 0x31, 0x2D, 0x74, 0xD7, 0x04, 0x90, 0x01, 0xC4, 0xF0, 0x74, 0x68, -0xA3, 0xF0, 0xD0, 0x07, 0xD0, 0x06, 0xD0, 0x05, 0xD0, 0x04, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, -0xD0, 0x00, 0xD0, 0xD0, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xF0, 0xD0, 0xE0, 0x32, 0x90, 0x00, 0x05, -0xE0, 0x44, 0x80, 0xFD, 0x7F, 0x05, 0x02, 0x3A, 0x96, 0x90, 0x00, 0x54, 0xE0, 0x55, 0x55, 0xF5, -0x59, 0xA3, 0xE0, 0x55, 0x56, 0xF5, 0x5A, 0xA3, 0xE0, 0x55, 0x57, 0xF5, 0x5B, 0xA3, 0xE0, 0x55, -0x58, 0xF5, 0x5C, 0xAD, 0x59, 0x7F, 0x54, 0x12, 0x3A, 0x96, 0xAD, 0x5A, 0x7F, 0x55, 0x12, 0x3A, -0x96, 0xAD, 0x5B, 0x7F, 0x56, 0x12, 0x3A, 0x96, 0xAD, 0x5C, 0x7F, 0x57, 0x12, 0x3A, 0x96, 0x53, -0x91, 0xEF, 0x22, 0xC0, 0xE0, 0xC0, 0xF0, 0xC0, 0x83, 0xC0, 0x82, 0xC0, 0xD0, 0x75, 0xD0, 0x00, -0xC0, 0x00, 0xC0, 0x01, 0xC0, 0x02, 0xC0, 0x03, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, -0x90, 0x01, 0xC4, 0x74, 0x73, 0xF0, 0x74, 0x69, 0xA3, 0xF0, 0xF1, 0x00, 0xE5, 0x61, 0x30, 0xE1, -0x02, 0x71, 0xEF, 0xE5, 0x61, 0x30, 0xE4, 0x03, 0x12, 0x67, 0xC5, 0xE5, 0x61, 0x30, 0xE5, 0x02, -0xF1, 0x5C, 0xE5, 0x63, 0x30, 0xE0, 0x02, 0x51, 0x28, 0xE5, 0x63, 0x30, 0xE1, 0x03, 0x12, 0x64, -0x03, 0xE5, 0x63, 0x30, 0xE2, 0x03, 0x12, 0x62, 0xF0, 0xE5, 0x63, 0x30, 0xE3, 0x02, 0xD1, 0xAA, -0xE5, 0x63, 0x30, 0xE4, 0x02, 0xF1, 0x2D, 0xE5, 0x63, 0x30, 0xE5, 0x02, 0xD1, 0xE2, 0xE5, 0x63, -0x30, 0xE6, 0x02, 0xD1, 0xC6, 0xE5, 0x64, 0x30, 0xE1, 0x03, 0x12, 0x57, 0xE8, 0xE5, 0x64, 0x30, -0xE4, 0x02, 0x91, 0x75, 0xE5, 0x64, 0x30, 0xE5, 0x02, 0x51, 0xA4, 0xE5, 0x64, 0x30, 0xE6, 0x02, -0x71, 0xAB, 0x74, 0x73, 0x04, 0x90, 0x01, 0xC4, 0xF0, 0x74, 0x69, 0xA3, 0xF0, 0xD0, 0x07, 0xD0, -0x06, 0xD0, 0x05, 0xD0, 0x04, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0xD0, 0xD0, 0xD0, -0x82, 0xD0, 0x83, 0xD0, 0xF0, 0xD0, 0xE0, 0x32, 0xE4, 0xFF, 0x90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x07, 0x08, 0x80, 0x05, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, 0xF9, 0xFF, -0xEF, 0x5D, 0x70, 0x02, 0x61, 0x9F, 0x75, 0xF0, 0x10, 0xE5, 0x1A, 0x90, 0x81, 0x01, 0x12, 0x48, -0x83, 0xE0, 0x20, 0xE7, 0x02, 0x80, 0x10, 0x75, 0xF0, 0x10, 0xE5, 0x1A, 0x90, 0x81, 0x02, 0x12, -0x48, 0x83, 0xE0, 0xFF, 0x20, 0xE7, 0x09, 0x90, 0x01, 0xC1, 0xE0, 0x44, 0x20, 0xF0, 0x80, 0x7F, -0xEF, 0x30, 0xE6, 0x23, 0x75, 0xF0, 0x10, 0xE5, 0x1A, 0x90, 0x81, 0x00, 0x12, 0x48, 0x83, 0xE0, -0xFD, 0x75, 0xF0, 0x10, 0xE5, 0x1A, 0x90, 0x81, 0x05, 0x12, 0x48, 0x83, 0xE0, 0x54, 0x03, 0x90, -0xA6, 0x8D, 0xF0, 0xE4, 0xFB, 0x80, 0x53, 0x74, 0xA6, 0x25, 0x1A, 0xF5, 0x82, 0xE4, 0x34, 0xA0, -0xF5, 0x83, 0xE0, 0x04, 0xF0, 0x74, 0xA6, 0x25, 0x1A, 0xF5, 0x82, 0xE4, 0x34, 0xA0, 0xF5, 0x83, -0xE0, 0xD3, 0x94, 0x03, 0x40, 0x13, 0xAF, 0x1A, 0xB1, 0xA2, 0x74, 0xA6, 0x25, 0x1A, 0xF5, 0x82, -0xE4, 0x34, 0xA0, 0xF5, 0x83, 0xE4, 0xF0, 0x80, 0x26, 0x75, 0xF0, 0x10, 0xE5, 0x1A, 0x90, 0x81, -0x00, 0x12, 0x48, 0x83, 0xE0, 0xFD, 0x75, 0xF0, 0x10, 0xE5, 0x1A, 0x90, 0x81, 0x05, 0x12, 0x48, -0x83, 0xE0, 0x54, 0x03, 0x90, 0xA6, 0x8D, 0xF0, 0x7B, 0x01, 0xAF, 0x1A, 0x12, 0x87, 0xCF, 0x05, -0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0xB4, 0x0F, 0x03, 0xE4, 0xF5, 0x1C, -0x90, 0x04, 0x7F, 0xE5, 0x1C, 0xF0, 0x90, 0xA5, 0x4F, 0xE0, 0x7F, 0x04, 0x70, 0x03, 0x02, 0x67, -0xB6, 0x12, 0x5A, 0xA1, 0x22, 0xE4, 0xFF, 0x90, 0xA5, 0x63, 0xEF, 0xF0, 0xE4, 0xF5, 0x70, 0x74, -0x64, 0x25, 0x70, 0xF5, 0x82, 0xE4, 0x34, 0xA5, 0xF5, 0x83, 0xE4, 0xF0, 0x75, 0xF0, 0x10, 0xE5, -0x70, 0x90, 0x81, 0x03, 0x12, 0x48, 0x83, 0xE0, 0xFF, 0x30, 0xE7, 0x0A, 0xE5, 0x70, 0x70, 0x18, -0xEF, 0x30, 0xE6, 0x14, 0x80, 0x12, 0xAF, 0x70, 0xD1, 0x9B, 0x74, 0x64, 0x25, 0x70, 0xF5, 0x82, -0xE4, 0x34, 0xA5, 0xF5, 0x83, 0x74, 0x01, 0xF0, 0x05, 0x70, 0xE5, 0x70, 0xC3, 0x94, 0x80, 0x40, -0xBE, 0x7F, 0x0C, 0x7E, 0x00, 0x12, 0x3A, 0xF7, 0xE4, 0xF5, 0x70, 0x74, 0x64, 0x25, 0x70, 0xF5, -0x82, 0xE4, 0x34, 0xA5, 0xF5, 0x83, 0xE0, 0x70, 0x02, 0xA1, 0x96, 0x75, 0xF0, 0x10, 0xE5, 0x70, -0x90, 0x81, 0x06, 0x12, 0x48, 0x83, 0xE0, 0xF5, 0x6E, 0x75, 0xF0, 0x10, 0xE5, 0x70, 0x90, 0x81, -0x07, 0x12, 0x48, 0x83, 0xE0, 0xF5, 0x6F, 0xFE, 0xE5, 0x6E, 0xFF, 0xE5, 0x70, 0x25, 0xE0, 0x24, -0x01, 0xF5, 0x82, 0xE4, 0x34, 0x92, 0xF5, 0x83, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0x75, 0xF0, 0x10, -0xE5, 0x70, 0x90, 0x81, 0x0A, 0x12, 0x48, 0x83, 0xE0, 0xF5, 0x6E, 0x75, 0xF0, 0x10, 0xE5, 0x70, -0x90, 0x81, 0x0B, 0x12, 0x48, 0x83, 0xE0, 0xF5, 0x6F, 0xFE, 0xE5, 0x6E, 0xFF, 0x75, 0xF0, 0x0A, -0xE5, 0x70, 0x90, 0x8D, 0x01, 0x12, 0x48, 0x83, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0x7F, 0x01, 0x75, -0xF0, 0x10, 0xE5, 0x70, 0x90, 0x81, 0x0B, 0x12, 0x48, 0x83, 0xE5, 0x82, 0x2F, 0xF5, 0x82, 0xE4, -0x35, 0x83, 0xF5, 0x83, 0xE0, 0xFD, 0x75, 0xF0, 0x0A, 0xE5, 0x70, 0x90, 0x8D, 0x01, 0x12, 0x48, -0x83, 0x75, 0xF0, 0x02, 0xEF, 0x12, 0x48, 0x83, 0xE4, 0xF0, 0xA3, 0xED, 0xF0, 0x0F, 0xEF, 0xB4, -0x05, 0xCD, 0x75, 0xF0, 0x10, 0xE5, 0x70, 0x90, 0x81, 0x09, 0x12, 0x48, 0x83, 0xE0, 0xFF, 0x74, -0x16, 0x25, 0x70, 0xF5, 0x82, 0xE4, 0x34, 0x98, 0xF5, 0x83, 0xEF, 0xF0, 0x90, 0xA5, 0x63, 0xE0, -0xFD, 0xAF, 0x70, 0x12, 0x89, 0xBF, 0x05, 0x70, 0xE5, 0x70, 0xC3, 0x94, 0x80, 0x50, 0x02, 0x81, -0xCB, 0x22, 0xAD, 0x07, 0x90, 0x01, 0xC4, 0x74, 0xA2, 0xF0, 0x74, 0x6D, 0xA3, 0xF0, 0x75, 0xF0, -0x10, 0xED, 0x90, 0x81, 0x05, 0x12, 0x48, 0x83, 0xE0, 0x54, 0x03, 0xF5, 0x1C, 0x75, 0xF0, 0x04, -0xED, 0x90, 0x96, 0x16, 0x12, 0x48, 0x83, 0xE0, 0xF5, 0x1D, 0x74, 0xA6, 0x2D, 0xF5, 0x82, 0xE4, -0x34, 0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0xAF, 0x05, 0x90, 0xA6, 0x8D, 0xE5, 0x1C, -0xF0, 0xE4, 0xFB, 0xAD, 0x1B, 0x12, 0x87, 0xCF, 0xAF, 0x1B, 0x22, 0x75, 0xF0, 0x10, 0xEF, 0x90, -0x81, 0x03, 0x12, 0x48, 0x83, 0xE0, 0x44, 0x40, 0xF0, 0x22, 0x90, 0xA3, 0x1D, 0xE0, 0x64, 0x01, -0x70, 0x13, 0x90, 0xA3, 0xA1, 0xE0, 0x60, 0x0D, 0x90, 0x01, 0x57, 0xE4, 0xF0, 0x90, 0x01, 0x3C, -0x74, 0x02, 0x12, 0x60, 0x47, 0x22, 0x90, 0xA3, 0x1D, 0xE0, 0xB4, 0x01, 0x14, 0x90, 0xA3, 0xA1, -0xE0, 0x60, 0x0E, 0x90, 0xA3, 0xA5, 0xE0, 0x54, 0xFE, 0xF0, 0x54, 0x07, 0x70, 0x03, 0x12, 0x50, -0x4E, 0x22, 0x90, 0xA3, 0x1D, 0xE0, 0xB4, 0x01, 0x16, 0x90, 0xA3, 0xA1, 0xE0, 0x60, 0x10, 0x90, -0xA3, 0xA0, 0xE0, 0x54, 0x0F, 0x64, 0x02, 0x60, 0x03, 0x02, 0x61, 0x12, 0x12, 0x57, 0x55, 0x22, -0x90, 0x01, 0x34, 0xE0, 0x55, 0x5D, 0xF5, 0x61, 0xA3, 0xE0, 0x55, 0x5E, 0xF5, 0x62, 0xA3, 0xE0, -0x55, 0x5F, 0xF5, 0x63, 0xA3, 0xE0, 0x55, 0x60, 0xF5, 0x64, 0x90, 0x01, 0x34, 0xE5, 0x61, 0xF0, -0xA3, 0xE5, 0x62, 0xF0, 0xA3, 0xE5, 0x63, 0xF0, 0xA3, 0xE5, 0x64, 0xF0, 0x22, 0x90, 0xA3, 0x1D, -0xE0, 0x64, 0x01, 0x70, 0x26, 0x90, 0xA3, 0xA1, 0xE0, 0x60, 0x20, 0x90, 0x01, 0x57, 0xE4, 0xF0, -0x90, 0x01, 0x3C, 0x74, 0x02, 0xF0, 0x90, 0xA3, 0x9E, 0xE0, 0x54, 0xFB, 0xF0, 0x90, 0xA3, 0xA5, -0xE0, 0x54, 0xFD, 0xF0, 0x54, 0x07, 0x70, 0x03, 0x12, 0x50, 0x4E, 0x22, 0x90, 0x01, 0xCF, 0xE0, -0x90, 0xA5, 0x4F, 0xF0, 0xE0, 0xFF, 0x30, 0xE0, 0x07, 0x90, 0x01, 0xCF, 0xE0, 0x54, 0xFE, 0xF0, -0xEF, 0x30, 0xE5, 0x23, 0x90, 0x01, 0xCF, 0xE0, 0x54, 0xDF, 0xF0, 0x90, 0x01, 0x34, 0x74, 0x20, -0xF0, 0xE4, 0xF5, 0xA8, 0xF5, 0xE8, 0x12, 0x4F, 0xA5, 0x90, 0x00, 0x03, 0xE0, 0x54, 0xFB, 0xFD, -0x7F, 0x03, 0x12, 0x3A, 0x96, 0x80, 0xFE, 0x22, 0xC0, 0xE0, 0xC0, 0xF0, 0xC0, 0x83, 0xC0, 0x82, -0xC0, 0xD0, 0x75, 0xD0, 0x00, 0xC0, 0x00, 0xC0, 0x01, 0xC0, 0x02, 0xC0, 0x03, 0xC0, 0x04, 0xC0, -0x05, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0x01, 0xC4, 0x74, 0x98, 0xF0, 0x74, 0x6F, 0xA3, 0xF0, 0x12, -0x78, 0x3A, 0xE5, 0x69, 0x30, 0xE1, 0x03, 0x12, 0x78, 0x79, 0xE5, 0x69, 0x30, 0xE2, 0x03, 0x12, -0x78, 0xE0, 0xE5, 0x69, 0x30, 0xE3, 0x03, 0x12, 0x67, 0xB4, 0xE5, 0x6A, 0x30, 0xE0, 0x03, 0x12, -0x78, 0xFB, 0xE5, 0x6C, 0x30, 0xE1, 0x05, 0x7F, 0x04, 0x12, 0x67, 0xB6, 0xE5, 0x6C, 0x30, 0xE4, -0x03, 0x12, 0x63, 0xF4, 0xE5, 0x6C, 0x30, 0xE5, 0x03, 0x12, 0x70, 0x29, 0xE5, 0x6C, 0x30, 0xE6, -0x02, 0x11, 0xAF, 0x74, 0x98, 0x04, 0x90, 0x01, 0xC4, 0xF0, 0x74, 0x6F, 0xA3, 0xF0, 0xD0, 0x07, +0x04, 0x74, 0xF8, 0x80, 0x06, 0xEF, 0xB4, 0x03, 0x08, 0x74, 0xFC, 0x2D, 0x12, 0xA7, 0x90, 0xEB, +0xF0, 0x22, 0x12, 0x48, 0x65, 0xE0, 0xFB, 0x0D, 0xB1, 0x3E, 0x75, 0xF0, 0x08, 0xE5, 0x71, 0x22, +0x54, 0x03, 0xFB, 0x0D, 0xE4, 0xFF, 0xB1, 0x3E, 0x75, 0xF0, 0x04, 0xE5, 0x71, 0x22, 0x90, 0xA4, +0x49, 0xEB, 0xF0, 0xEF, 0x54, 0x7F, 0x24, 0xF4, 0x90, 0xA4, 0x4D, 0xF0, 0xED, 0x70, 0x2E, 0xD1, +0xC1, 0x70, 0x15, 0xE0, 0x25, 0xE0, 0x24, 0xDF, 0xF5, 0x82, 0xE4, 0x34, 0x40, 0xD1, 0xA1, 0x24, +0xE0, 0xF5, 0x82, 0xE4, 0x34, 0x40, 0x80, 0x41, 0xE0, 0x25, 0xE0, 0x24, 0xB7, 0xF5, 0x82, 0xE4, +0x34, 0x40, 0xD1, 0xA1, 0x24, 0xB8, 0xF5, 0x82, 0xE4, 0x34, 0x40, 0x80, 0x2C, 0xD1, 0xC1, 0x70, +0x15, 0xE0, 0x25, 0xE0, 0x24, 0x2B, 0xF5, 0x82, 0xE4, 0x34, 0x41, 0xD1, 0xA1, 0x24, 0x2C, 0xF5, +0x82, 0xE4, 0x34, 0x41, 0x80, 0x13, 0xE0, 0x25, 0xE0, 0x24, 0x03, 0xF5, 0x82, 0xE4, 0x34, 0x41, +0xD1, 0xA1, 0x24, 0x04, 0xF5, 0x82, 0xE4, 0x34, 0x41, 0xF5, 0x83, 0xE4, 0x93, 0xFF, 0x90, 0xA4, +0x49, 0xE0, 0xFD, 0xD1, 0x7C, 0xA9, 0x07, 0x7F, 0x0C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, 0xE0, 0x6F, 0x60, 0x02, 0x11, 0x3D, 0xC2, 0xAF, 0x12, 0xA8, 0x6D, 0xBF, 0x01, 0x03, +0x12, 0xAA, 0xA7, 0xD2, 0xAF, 0x12, 0x5F, 0xAE, 0x12, 0x49, 0x62, 0x80, 0xBD, 0x90, 0xA2, 0x83, +0xE0, 0x90, 0xA2, 0x8E, 0x30, 0xE0, 0x04, 0xE0, 0xFF, 0xE1, 0xAE, 0xE0, 0xFF, 0x7D, 0x01, 0x02, +0x51, 0xE9, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x12, 0x7F, 0x60, 0x90, 0x05, 0x27, 0xE0, +0xF5, 0x10, 0x12, 0x26, 0x1E, 0xFF, 0x54, 0x01, 0xFE, 0x90, 0xA2, 0x83, 0xE0, 0x54, 0xFE, 0x4E, +0xFE, 0xF0, 0xEF, 0x54, 0x02, 0xFF, 0xEE, 0x54, 0xFD, 0x4F, 0x71, 0x06, 0x54, 0x04, 0xFD, 0xEF, +0x54, 0xFB, 0x71, 0x0D, 0x54, 0x08, 0xFE, 0xEF, 0x54, 0xF7, 0x71, 0x05, 0x54, 0x10, 0xFD, 0xEF, +0x54, 0xEF, 0x71, 0x0D, 0x54, 0x20, 0xFE, 0xEF, 0x54, 0xDF, 0x71, 0x05, 0x54, 0x40, 0xFD, 0xEF, +0x54, 0xBF, 0x4D, 0x90, 0xA2, 0x83, 0xF0, 0xEE, 0xC3, 0x13, 0x20, 0xE0, 0x02, 0x21, 0x39, 0xE0, +0x30, 0xE0, 0x72, 0x71, 0x3E, 0x75, 0x10, 0x21, 0x71, 0x1E, 0x30, 0xE0, 0x07, 0x71, 0x66, 0x43, +0x10, 0x08, 0x80, 0x0C, 0xE4, 0x90, 0xA2, 0x84, 0xF0, 0xA3, 0xF0, 0x7D, 0x40, 0xFF, 0x71, 0x5B, +0x90, 0xA2, 0x83, 0x71, 0x2A, 0x30, 0xE0, 0x03, 0x43, 0x10, 0x12, 0xEF, 0xC4, 0x54, 0x0F, 0x30, +0xE0, 0x03, 0x43, 0x10, 0x14, 0x90, 0xA2, 0x83, 0xE0, 0xC4, 0x13, 0x54, 0x07, 0x30, 0xE0, 0x03, +0x43, 0x10, 0x80, 0x90, 0xA2, 0x83, 0x12, 0xBB, 0x7C, 0x20, 0xE0, 0x03, 0x43, 0x10, 0x40, 0x31, +0xE3, 0x90, 0xA2, 0x86, 0xE0, 0x70, 0x04, 0x7F, 0x01, 0x31, 0xEA, 0x71, 0x15, 0x54, 0x03, 0x30, +0xE0, 0x04, 0x7F, 0x04, 0x80, 0x0B, 0x71, 0x32, 0xEF, 0x60, 0x04, 0x7F, 0x01, 0x80, 0x02, 0x7F, +0x02, 0x31, 0xEA, 0x21, 0xAB, 0x75, 0x10, 0x01, 0x31, 0xE3, 0x90, 0xA2, 0x86, 0xE0, 0x64, 0x04, +0x60, 0x02, 0x21, 0xDE, 0xFF, 0x31, 0xEA, 0x21, 0xDE, 0x90, 0xA2, 0x83, 0xE0, 0x30, 0xE0, 0x73, +0x71, 0x3E, 0x43, 0x10, 0x31, 0x71, 0x1E, 0x30, 0xE0, 0x07, 0x71, 0x66, 0x43, 0x10, 0x08, 0x80, +0x06, 0x7D, 0x40, 0xE4, 0xFF, 0x71, 0x5B, 0x90, 0xA2, 0x83, 0x71, 0x2A, 0x30, 0xE0, 0x03, 0x43, +0x10, 0x02, 0xEF, 0xC4, 0x54, 0x0F, 0x30, 0xE0, 0x03, 0x43, 0x10, 0x04, 0x31, 0xE3, 0x71, 0x15, +0x54, 0x03, 0x30, 0xE0, 0x0B, 0x12, 0x79, 0xCD, 0x60, 0x31, 0xE4, 0xFD, 0x7F, 0x02, 0x80, 0x1E, +0x12, 0x9F, 0xCD, 0x90, 0xA2, 0x87, 0xE0, 0xB4, 0x02, 0x19, 0x12, 0xB9, 0x41, 0x71, 0x32, 0xBF, +0x01, 0x09, 0x90, 0xA2, 0x8E, 0xE0, 0xFF, 0x7D, 0x01, 0x80, 0x03, 0xE4, 0xFD, 0xFF, 0x12, 0x51, +0xE9, 0x80, 0x08, 0x90, 0xA2, 0x8F, 0xE0, 0x90, 0xA2, 0x87, 0xF0, 0x90, 0x05, 0x40, 0x74, 0x22, +0xF0, 0x80, 0x2B, 0x75, 0x10, 0x01, 0x31, 0xE3, 0x90, 0xA2, 0x87, 0xE0, 0xB4, 0x02, 0x06, 0x7D, +0x01, 0x7F, 0x04, 0x80, 0x0B, 0x90, 0xA2, 0x87, 0xE0, 0xB4, 0x08, 0x07, 0x7D, 0x01, 0x7F, 0x0C, +0x12, 0x51, 0xE9, 0x12, 0x7F, 0xD7, 0x90, 0xA2, 0x8E, 0x11, 0x4B, 0x12, 0xB8, 0x3F, 0xD0, 0xD0, +0x92, 0xAF, 0x22, 0x90, 0x05, 0x27, 0xE5, 0x10, 0xF0, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, +0xD0, 0x90, 0xA2, 0x86, 0xE0, 0x90, 0xA5, 0xFF, 0xF0, 0x6F, 0x70, 0x02, 0x61, 0x00, 0xEF, 0x14, +0x60, 0x46, 0x14, 0x60, 0x71, 0x14, 0x70, 0x02, 0x41, 0xA4, 0x14, 0x70, 0x02, 0x41, 0xD3, 0x24, +0x04, 0x60, 0x02, 0x61, 0x00, 0x90, 0xA5, 0xFF, 0xE0, 0xB4, 0x04, 0x05, 0x12, 0xB8, 0x6A, 0x61, +0x00, 0x90, 0xA5, 0xFF, 0xE0, 0xB4, 0x02, 0x05, 0x12, 0xB8, 0x6F, 0x61, 0x00, 0x90, 0xA5, 0xFF, +0xE0, 0xB4, 0x03, 0x05, 0x12, 0xB8, 0x66, 0x61, 0x00, 0x90, 0xA5, 0xFF, 0xE0, 0x64, 0x01, 0x60, +0x02, 0x61, 0x00, 0x12, 0xB8, 0x5E, 0x61, 0x00, 0x90, 0xA5, 0xFF, 0xE0, 0xB4, 0x04, 0x04, 0xF1, +0xD2, 0x61, 0x00, 0x90, 0xA5, 0xFF, 0xE0, 0xB4, 0x02, 0x04, 0xF1, 0xDA, 0x61, 0x00, 0x90, 0xA5, +0xFF, 0xE0, 0xB4, 0x03, 0x05, 0x12, 0xB8, 0x74, 0x61, 0x00, 0x90, 0xA5, 0xFF, 0xE0, 0x60, 0x02, +0x61, 0x00, 0xF1, 0xCB, 0x61, 0x00, 0x90, 0xA5, 0xFF, 0xE0, 0xB4, 0x04, 0x05, 0x12, 0x9F, 0xBF, +0x80, 0x7E, 0x90, 0xA5, 0xFF, 0xE0, 0xB4, 0x01, 0x04, 0xF1, 0xE2, 0x80, 0x73, 0x90, 0xA5, 0xFF, +0xE0, 0xB4, 0x03, 0x05, 0x12, 0x9F, 0xAE, 0x80, 0x67, 0x90, 0xA5, 0xFF, 0xE0, 0x70, 0x61, 0x12, +0xB8, 0xAE, 0x80, 0x5C, 0x90, 0xA5, 0xFF, 0xE0, 0xB4, 0x04, 0x05, 0x12, 0xB8, 0xB4, 0x80, 0x50, +0x90, 0xA5, 0xFF, 0xE0, 0xB4, 0x01, 0x05, 0x12, 0xB8, 0x99, 0x80, 0x44, 0x90, 0xA5, 0xFF, 0xE0, +0xB4, 0x02, 0x05, 0x12, 0x9F, 0xB6, 0x80, 0x38, 0x90, 0xA5, 0xFF, 0xE0, 0x70, 0x32, 0x12, 0xB8, +0xA3, 0x80, 0x2D, 0x90, 0xA5, 0xFF, 0xE0, 0xB4, 0x03, 0x05, 0x12, 0xB8, 0xC1, 0x80, 0x21, 0x90, +0xA5, 0xFF, 0xE0, 0xB4, 0x01, 0x05, 0x12, 0x57, 0xEF, 0x80, 0x15, 0x90, 0xA5, 0xFF, 0xE0, 0xB4, +0x02, 0x05, 0x12, 0x9F, 0xC6, 0x80, 0x09, 0x90, 0xA5, 0xFF, 0xE0, 0x70, 0x03, 0x12, 0xB8, 0xA8, +0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x4E, 0xFF, 0xF0, 0x12, 0x26, 0x1E, 0xFE, 0x22, 0x4D, 0xFF, 0x90, +0xA2, 0x83,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, 0x7F, 0x84, 0xF1, 0x45, +0xF1, 0x8A, 0x54, 0xEF, 0xF0, 0xF1, 0x06, 0x24, 0xFD, 0x50, 0x02, 0x80, 0x0F, 0x90, 0xA2, 0x83, +0xE0, 0x30, 0xE0, 0x05, 0x12, 0x78, 0xCE, 0x80, 0x03, 0x12, 0x78, 0x80, 0x71, 0x27, 0x30, 0xE0, +0x5A, 0xEF, 0xC4, 0x13, 0x13, 0x54, 0x03, 0x20, 0xE0, 0x20, 0xF1, 0x28, 0x6F, 0x70, 0x4C, 0x90, +0xA2, 0x89, 0xE0, 0x44, 0x40, 0xF0, 0x12, 0xBC, 0x3E, 0xF1, 0x3A, 0x71, 0x42, 0x12, 0x9C, 0xA7, +0x71, 0x57, 0x90, 0xA2, 0x93, 0xE0, 0x14, 0xF0, 0x80, 0x31, 0x90, 0xA2, 0x8A, 0xE0, 0xC4, 0x54, +0x0F, 0x64, 0x01, 0x70, 0x26, 0xF1, 0x28, 0xFE, 0x6F, 0x60, 0x20, 0x90, 0x05, 0x73, 0xE0, 0xFF, +0xEE, 0x6F, 0x60, 0x17, 0x90, 0xA2, 0x89, 0xE0, 0xFF, 0x13, 0x13, 0x54, 0x3F, 0x30, 0xE0, 0x0B, +0xEF, 0x54, 0xBF, 0xF1, 0x3A, 0xB1, 0x56, 0xF1, 0x92, 0x71, 0x6F, 0x91, 0xF3, 0x90, 0xA2, 0x83, +0xE0, 0xC3, 0x13, 0x20, 0xE0, 0x02, 0x91, 0xF3, 0x22, 0x71, 0x27, 0x30, 0xE0, 0x0B, 0xEF, 0xC4, +0x13, 0x13, 0x54, 0x03, 0x30, 0xE0, 0x02, 0x71, 0x57, 0x12, 0xBC, 0x36, 0x54, 0x3F, 0x30, 0xE0, +0x08, 0xF1, 0x86, 0x54, 0x07, 0x70, 0x3B, 0x80, 0x37, 0x12, 0xBA, 0x38, 0x40, 0x32, 0xD1, 0x1B, +0x70, 0x30, 0x12, 0x79, 0x40, 0x70, 0x07, 0x12, 0x7D, 0x0A, 0x91, 0xB3, 0xF0, 0x22, 0x12, 0x7D, +0x0A, 0x90, 0xA2, 0x96, 0xE0, 0x04, 0xF0, 0xE0, 0xD3, 0x94, 0x02, 0x40, 0x0A, 0x91, 0xB3, 0xF0, +0xE4, 0x90, 0xA2, 0x96, 0xF0, 0x80, 0x03, 0x12, 0x57, 0x8F, 0xE4, 0x90, 0xA2, 0x95, 0xF0, 0x22, +0x11, 0x3D, 0x22, 0x90, 0xA2, 0x89, 0xE0, 0x54, 0xFB, 0x22, 0x90, 0x01, 0x36, 0x74, 0x78, 0xF0, +0xA3, 0x74, 0x02, 0xF0, 0x7D, 0x78, 0xFF, 0x71, 0x6F, 0x7D, 0x02, 0x7F, 0x03, 0x71, 0x6F, 0x90, +0x06, 0x0A, 0xE0, 0x44, 0x07, 0x12, 0x7F, 0x84, 0xE4, 0xFF, 0x91, 0xFB, 0xBF, 0x01, 0x11, 0x91, +0xB3, 0xF0, 0x90, 0xA2, 0x8F, 0xE0, 0x20, 0xE2, 0x09, 0x7D, 0x01, 0x7F, 0x04, 0x02, 0x51, 0xE9, +0x91, 0xF3, 0x22, 0x90, 0xA2, 0x89, 0xE0, 0x44, 0x04, 0xF0, 0x22, 0x12, 0xBB, 0x70, 0x12, 0x9D, +0x0B, 0xE0, 0xFD, 0x7C, 0x00, 0x12, 0x9C, 0xB1, 0x80, 0x05, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, +0xF9, 0x12, 0xBC, 0x7E, 0x7F, 0x00, 0x60, 0x02, 0x7F, 0x01, 0x22, 0xEF, 0x70, 0x32, 0x7D, 0x78, +0x7F, 0x02, 0x71, 0x5B, 0x7D, 0x02, 0x7F, 0x03, 0x71, 0x5B, 0x7D, 0xC8, 0x7F, 0x02, 0xB1, 0x56, +0xF1, 0x45, 0xE4, 0xFF, 0x91, 0xFB, 0xEF, 0x70, 0x07, 0xF1, 0x9D, 0x54, 0x7F, 0xF0, 0x80, 0x07, +0x7D, 0x01, 0x7F, 0x0C, 0x12, 0x51, 0xE9, 0x90, 0xA2, 0x88, 0xE0, 0x54, 0xF7, 0x02, 0xBB, 0xF9, +0x81, 0xBA, 0x7D, 0x20, 0xE4, 0xFF, 0x74, 0x65, 0x12, 0xBC, 0x6E, 0x61, 0x48, 0x90, 0xA2, 0x88, +0xE0, 0x54, 0xFB, 0xF0, 0xE4, 0x90, 0xA2, 0x95, 0xF0, 0xA3, 0xF0, 0x90, 0xA2, 0x90, 0xF0, 0x90, +0xA2, 0x89, 0xF1, 0xA6, 0xF1, 0x92, 0x71, 0x6F, 0x7D, 0x10, 0x7F, 0x03, 0x80, 0xD8, 0xE4, 0x90, +0xA5, 0x08, 0xF0, 0x90, 0xA2, 0x8C, 0xE0, 0x70, 0x02, 0xC1, 0x1A, 0xD1, 0x1B, 0x60, 0x02, 0xC1, +0x1A, 0x12, 0xBC, 0x3E, 0xD1, 0xE5, 0x12, 0x47, 0x77, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, +0x07, 0x90, 0x05, 0x62, 0xD1, 0xFF, 0x78, 0x10, 0x12, 0x27, 0x35, 0xD0, 0x03, 0xD0, 0x02, 0xD0, +0x01, 0xD0, 0x00, 0x12, 0x47, 0x77, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0xA3, 0xD1, +0xFF, 0x78, 0x18, 0x12, 0x27, 0x35, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0x12, 0xBB, +0x8D, 0x90, 0xA5, 0x08, 0x74, 0x01, 0xF0, 0xE4, 0x90, 0xA2, 0x93, 0xF0, 0x90, 0xA2, 0x83, 0xE0, +0x30, 0xE0, 0x15, 0x90, 0xA2, 0x87, 0xE0, 0xB4, 0x02, 0x05, 0xE4, 0x90, 0xA5, 0x08, 0xF0, 0x71, +0x32, 0xEF, 0x70, 0x04, 0x90, 0xA5, 0x08, 0xF0, 0x90, 0xA5, 0x08, 0xE0, 0x60, 0x1C, 0x12, 0xBC, +0x46, 0xE4, 0x90, 0xA5, 0x9B, 0xF0, 0x90, 0xA2, 0x94, 0xE0, 0x90, 0xA5, 0x9C, 0x12, 0x78, 0x14, +0x90, 0xA2, 0x8F, 0xE0, 0x20, 0xE2, 0x03, 0x12, 0x51, 0xE5, 0x22, 0xE4, 0xFF, 0x91, 0xFB, 0xEF, +0x64, 0x01, 0x22, 0xE4, 0xF5, 0x20, 0x90, 0xA2, 0x8C, 0xE0, 0x70, 0x02, 0xC1, 0xE4, 0xD1, 0x1B, +0x60, 0x02, 0xC1, 0xE4, 0xD1, 0xE6, 0x12, 0x47, 0x77, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, +0x07, 0x90, 0x05, 0x62, 0xD1, 0xFF, 0x78, 0x10, 0x12, 0x27, 0x35, 0xD0, 0x03, 0xD0, 0x02, 0xD0, +0x01, 0xD0, 0x00, 0x12, 0x47, 0x77, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0xA3, 0xD1, +0xFF, 0x78, 0x18, 0x12, 0x27, 0x35, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0x12, 0xBB, +0x8D, 0xF1, 0x06, 0x60, 0x22, 0x24, 0xFE, 0x60, 0x03, 0x04, 0x70, 0x1E, 0x90, 0xA2, 0x93, 0xE0, +0x14, 0xF0, 0xE0, 0xFF, 0x60, 0x06, 0x90, 0xA2, 0x95, 0xE0, 0x60, 0x0E, 0xEF, 0x70, 0x08, 0x90, +0xA2, 0x92, 0xE0, 0xA3, 0xF0, 0x80, 0x00, 0x75, 0x20, 0x01, 0x90, 0xA2, 0x83, 0xE0, 0x30, 0xE0, +0x11, 0x90, 0xA2, 0x87, 0xE0, 0xB4, 0x02, 0x03, 0xE4, 0xF5, 0x20, 0x71, 0x32, 0xEF, 0x70, 0x02, +0xF5, 0x20, 0xE5, 0x20, 0x60, 0x2E, 0x12, 0xBC, 0x46, 0x90, 0xA2, 0x95, 0xE0, 0x60, 0x03, 0xB4, +0x01, 0x04, 0xF1, 0x30, 0x80, 0x08, 0xF1, 0x30, 0x75, 0xF0, 0x03, 0xA4, 0x24, 0xFE, 0xFF, 0x90, +0xA2, 0x94, 0xE0, 0x2F, 0x90, 0xA5, 0x9C, 0x12, 0x78, 0x14, 0x90, 0xA2, 0x8F, 0xE0, 0x20, 0xE2, +0x03, 0x12, 0x51, 0xE5, 0x22, 0xF0, 0x90, 0x05, 0x61, 0xE0, 0xFF, 0xE4, 0xFC, 0xFD, 0xFE, 0x78, +0x08, 0x12, 0x27, 0x35, 0xA8, 0x04, 0xA9, 0x05, 0xAA, 0x06, 0xAB, 0x07, 0x90, 0x05, 0x60, 0xE0, +0xFF, 0xE4, 0xFC, 0xFD, 0xFE, 0x22, 0x90, 0xA2, 0x8A, 0xE0, 0xFF, 0xC4, 0x54, 0x0F, 0x22, 0xD1, +0x1B, 0x70, 0x14, 0x90, 0xA2, 0x8C, 0xE0, 0x60, 0x0E, 0xF1, 0x45, 0x90, 0xA2, 0x88, 0xE0, 0xF1, +0x87, 0x54, 0x07, 0x70, 0x02, 0x11, 0x3D, 0x22, 0x90, 0xA2, 0x92, 0xE0, 0xFF, 0xA3, 0xE0, 0x22, +0xE4, 0x90, 0xA5, 0x9B, 0xF0, 0x90, 0xA2, 0x95, 0xE0, 0x22, 0xF0, 0x90, 0x01, 0x3F, 0x74, 0x10, +0xF0, 0xFD, 0x7F, 0x03, 0x22, 0x90, 0x01, 0x57, 0xE4, 0xF0, 0x90, 0x01, 0x3C, 0x74, 0x02, 0xF0, +0x22, 0xD1, 0x1B, 0x70, 0x0E, 0x90, 0xA2, 0x8C, 0xE0, 0x60, 0x08, 0xF1, 0x45, 0x12, 0x79, 0x53, +0x12, 0x78, 0x14, 0x22, 0x90, 0x01, 0x57, 0xE0, 0x60, 0x1B, 0xF1, 0x48, 0x12, 0xBC, 0x36, 0x54, +0x3F, 0x30, 0xE0, 0x02, 0x80, 0x10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x65, 0xE0, 0xC3, 0x94, 0x05, +0x40, 0x02, 0x81, 0x7D, 0x90, 0xA4, 0x3B, 0xE0, 0xFF, 0xE5, 0x0F, 0x9F, 0x40, 0x08, 0x8F, 0x0F, +0x53, 0x0E, 0x80, 0xEF, 0x42, 0x0E, 0xE5, 0x0F, 0x90, 0x42, 0x41, 0x93, 0x12, 0x5C, 0x39, 0xC3, +0x9F, 0x40, 0x0A, 0xE5, 0x0F, 0x90, 0x41, 0xED, 0x93, 0xF5, 0x14, 0x80, 0x0A, 0x74, 0x21, 0x25, +0x0F, 0x12, 0xB2, 0x42, 0xE0, 0xF5, 0x14, 0xE5, 0x14, 0x75, 0xF0, 0x06, 0xA4, 0x24, 0x4B, 0xF9, +0x74, 0x41, 0x35, 0xF0, 0xFA, 0x7B, 0xFF, 0x90, 0xA4, 0x2D, 0x12, 0x48, 0x7A, 0xC3, 0xE5, 0x13, +0x94, 0x0F, 0xE5, 0x12, 0x94, 0x00, 0x40, 0x02, 0x41, 0x82, 0x90, 0xA4, 0x30, 0x12, 0x48, 0x71, +0x90, 0x00, 0x06, 0x12, 0x47, 0x17, 0xFF, 0xAE, 0xF0, 0xD1, 0x7D, 0x2F, 0xFD, 0xE5, 0xF0, 0x3E, +0xFC, 0x12, 0xBB, 0xDC, 0xD3, 0xED, 0x9F, 0xEC, 0x9E, 0x40, 0x02, 0x81, 0x56, 0xE5, 0x13, 0xAE, +0x12, 0x78, 0x02, 0xCE, 0xC3, 0x13, 0xCE, 0x13, 0xD8, 0xF9, 0xFD, 0xAC, 0x06, 0xE5, 0x12, 0xC3, +0x13, 0xFE, 0xE5, 0x13, 0x13, 0x2D, 0xFF, 0xEE, 0x3C, 0xFE, 0x90, 0xA4, 0x30, 0x12, 0x48, 0x71, +0x12, 0x46, 0xEC, 0xD3, 0x9F, 0xE5, 0xF0, 0x9E, 0x50, 0x02, 0x81, 0x5D, 0xE5, 0x0F, 0x94, 0x38, +0x40, 0x0A, 0x12, 0x5C, 0x3A, 0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0x33, +0xCE, 0xD8, 0xF9, 0x12, 0xBC, 0x7E, 0x60, 0x29, 0x74, 0xA1, 0x25, 0x0D, 0x12, 0x5F, 0x53, 0xE0, +0xFF, 0xF4, 0x60, 0x1D, 0x8F, 0x0E, 0x90, 0xA4, 0x3C, 0xE0, 0xF5, 0x27, 0x7B, 0x01, 0xAD, 0x0E, +0xAF, 0x0D, 0x12, 0x73, 0x7D, 0x74, 0xA1, 0x25, 0x0D, 0x12, 0x5F, 0x53, 0x74, 0xFF, 0xF0, 0x81, +0x5D, 0x12, 0xBB, 0xBE, 0x40, 0x05, 0x75, 0x15, 0x05, 0x80, 0x13, 0xD3, 0xE5, 0x13, 0x94, 0xC8, +0xE5, 0x12, 0x94, 0x00, 0x40, 0x05, 0x75, 0x15, 0x02, 0x80, 0x03, 0xE4, 0xF5, 0x15, 0xE5, 0x0D, +0x12, 0xAE, 0xC0, 0xE0, 0xF5, 0x10, 0xA3, 0xE0, 0xF5, 0x11, 0xE4, 0xF5, 0x18, 0x12, 0xBB, 0xB4, +0xE5, 0x18, 0x12, 0xA7, 0x0A, 0x12, 0xBC, 0x2E, 0x08, 0x80, 0x05, 0xCE, 0xC3, 0x13, 0xCE, 0x13, +0xD8, 0xF9, 0xFF, 0x90, 0xA4, 0x2D, 0x12, 0x48, 0x71, 0x85, 0x18, 0x82, 0x12, 0xA5, 0x60, 0x12, +0xBA, 0xE6, 0x05, 0x18, 0xE5, 0x18, 0xB4, 0x05, 0xD4, 0x90, 0xA4, 0x2D, 0x12, 0x48, 0x71, 0x90, +0x00, 0x05, 0x12, 0x26, 0x37, 0xFD, 0x7C, 0x00, 0x12, 0xBC, 0x76, 0x80, 0x05, 0xCE, 0xC3, 0x13, +0xCE, 0x13, 0xD8, 0xF9, 0xFF, 0x12, 0x26, 0x98, 0xD3, 0xE5, 0x11, 0x9F, 0xE5, 0x10, 0x9E, 0x40, +0x0C, 0xE5, 0x11, 0x9F, 0xF5, 0x11, 0xE5, 0x10, 0x9E, 0x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65, 0xE0, +0xFC, 0x64, 0x05, 0x60, 0x02, 0xA1, 0x44, 0xAD, 0x0F, 0xAF, 0x0D, 0x12, 0x77, 0x16, 0x12, 0xBB, +0x58, 0xEF, 0xD1, 0x99, 0xE0, 0x54, 0x07, 0xF5, 0x17, 0x12, 0x5C, 0x3A, 0xFF, 0xC3, 0x94, 0x30, +0x50, 0x06, 0xE4, 0xD1, 0x63, 0xE4, 0x80, 0x56, 0x12, 0xBB, 0x58, 0xE0, 0x64, 0x01, 0x70, 0x66, +0x12, 0xBA, 0x91, 0xE0, 0x64, 0x0A, 0x60, 0x28, 0xEF, 0x24, 0x05, 0xFF, 0xE4, 0x33, 0xFE, 0x12, +0xBB, 0x4C, 0xE0, 0xFD, 0x12, 0xBB, 0xC8, 0x50, 0x17, 0xED, 0x24, 0x05, 0xFF, 0xE4, 0x33, 0xFE, +0x12, 0x5C, 0x3A, 0x12, 0xBB, 0xC8, 0x50, 0x08, 0x12, 0x77, 0x97, 0xE0, 0x65, 0x0F, 0x60, 0x2A, +0xE5, 0x17, 0x70, 0x05, 0x75, 0x17, 0x01, 0x80, 0x0D, 0xE5, 0x17, 0xB4, 0x01, 0x05, 0x75, 0x17, +0x03, 0x80, 0x03, 0x75, 0x17, 0x05, 0x12, 0x5C, 0x3A, 0xFF, 0x12, 0xBB, 0x4C, 0xEF, 0xF0, 0x74, +0x21, 0x25, 0x0D, 0xF5, 0x82, 0xE4, 0x34, 0x9D, 0x80, 0x18, 0xD1, 0x65, 0xE4, 0xF0, 0x12, 0xBA, +0x91, 0xE0, 0x04, 0xF0, 0x80, 0x10, 0xE4, 0xF5, 0x17, 0x74, 0xA1, 0x25, 0x0D, 0xF5, 0x82, 0xE4, +0x34, 0x9E, 0xF5, 0x83, 0xE4, 0xF0, 0x12, 0x77, 0x97, 0xE5, 0x0F, 0xF0, 0x12, 0x4F, 0xA8, 0xC4, +0x13, 0x13, 0x54, 0x03, 0x20, 0xE0, 0x02, 0xC1, 0x2E, 0x12, 0xBA, 0x91, 0xE4, 0xF0, 0xD1, 0x63, +0xE4, 0xF0, 0xC1, 0x2E, 0xEC, 0x64, 0x06, 0x60, 0x02, 0xC1, 0x3E, 0xF5, 0x10, 0xF5, 0x11, 0xD1, +0x9A, 0xE0, 0x54, 0x07, 0xF5, 0x17, 0x12, 0xBB, 0xBE, 0x40, 0x05, 0x75, 0x15, 0x05, 0x80, 0x13, +0xD3, 0xE5, 0x13, 0x94, 0xFA, 0xE5, 0x12, 0x94, 0x00, 0x40, 0x05, 0x75, 0x15, 0x02, 0x80, 0x03, +0xE4, 0xF5, 0x15, 0x12, 0xBC, 0x76, 0x80, 0x05, 0xCE, 0xC3, 0x13, 0xCE, 0x13, 0xD8, 0xF9, 0xFF, +0x90, 0x44, 0x9E, 0xE4, 0x93, 0xFD, 0x7C, 0x00, 0x12, 0x26, 0x98, 0x90, 0xA4, 0x3E, 0xEE, 0xF0, +0xA3, 0xEF, 0xF0, 0xE4, 0xF5, 0x16, 0x12, 0xBB, 0xB4, 0xE5, 0x16, 0x12, 0xA7, 0x0A, 0x12, 0xBC, +0x2E, 0x08, 0x80, 0x05, 0xCE, 0xC3, 0x13, 0xCE, 0x13, 0xD8, 0xF9, 0xFF, 0xE5, 0x16, 0x90, 0x44, +0x99, 0x93, 0x12, 0xBA, 0xE6, 0xC3, 0x90, 0xA4, 0x3F, 0xE0, 0x95, 0x11, 0x90, 0xA4, 0x3E, 0xE0, +0x95, 0x10, 0x40, 0x07, 0x05, 0x16, 0xE5, 0x16, 0xB4, 0x05, 0xCB, 0xE5, 0x16, 0xC3, 0x13, 0xF5, +0x16, 0xE5, 0x17, 0x24, 0x01, 0xFF, 0xE4, 0x33, 0xA2, 0xE7, 0x13, 0xEF, 0x13, 0xFF, 0xD3, 0x95, +0x16, 0x40, 0x06, 0xEF, 0x95, 0x16, 0xFF, 0x80, 0x02, 0xE4, 0xFF, 0xD1, 0x71, 0xE0, 0xC3, 0x13, +0xFE, 0xEF, 0xC4, 0x33, 0x54, 0xE0, 0x2E, 0x04, 0xFE, 0xD1, 0x71, 0xEE, 0xF0, 0xD1, 0x71, 0xE0, +0xC3, 0x94, 0xC0, 0x40, 0x05, 0xD1, 0x71, 0x74, 0xC0, 0xF0, 0xD1, 0x71, 0x12, 0xBB, 0x7C, 0x25, +0xE0, 0xFF, 0x70, 0x04, 0xF5, 0x17, 0x80, 0x04, 0xEF, 0x14, 0xF5, 0x17, 0xD3, 0x90, 0xA4, 0x34, +0xE0, 0x94, 0x03, 0x90, 0xA4, 0x33, 0xE0, 0x94, 0x00, 0x40, 0x03, 0xE4, 0xF5, 0x17, 0xD1, 0x9A, +0xE0, 0x54, 0xF8, 0x90, 0xA4, 0x40, 0xF0, 0x45, 0x17, 0xFF, 0xD1, 0x99, 0xEF, 0xF0, 0xD1, 0x65, +0xE0, 0xD3, 0x94, 0x05, 0x50, 0x07, 0xD1, 0x65, 0xE0, 0x04, 0xF0, 0x80, 0x0A, 0xD1, 0x83, 0xE0, +0x54, 0xF8, 0xF0, 0xD1, 0x65, 0xE4, 0xF0, 0xE4, 0xFD, 0xAF, 0x0D, 0x12, 0x76, 0x61, 0x05, 0x0D, +0x01, 0x41, 0x22, 0xF5, 0x17, 0x74, 0xA1, 0x25, 0x0D, 0xF5, 0x82, 0xE4, 0x34, 0x9E, 0xF5, 0x83, +0x22, 0x74, 0x01, 0x25, 0x0D, 0xF5, 0x82, 0xE4, 0x34, 0x93, 0xF5, 0x83, 0x22, 0x90, 0x00, 0x08, +0x02, 0x47, 0x17, 0x75, 0xF0, 0x04, 0xE5, 0x0D, 0x90, 0x9B, 0x11, 0x02, 0x48, 0x65, 0x75, 0xF0, +0x04, 0xE5, 0x0D, 0x90, 0x9B, 0x12, 0x02, 0x48, 0x65, 0xF0, 0x75, 0xF0, 0x10, 0xE5, 0x0D, 0x90, +0x81, 0x01, 0x02, 0x48, 0x65, 0xE4, 0xF5, 0x20, 0x90, 0xA2, 0x81, 0xE0, 0xFF, 0xE5, 0x20, 0xC3, +0x9F, 0x40, 0x02, 0xE1, 0xCE, 0x90, 0x04, 0xCF, 0x74, 0x30, 0xF0, 0xAF, 0x20, 0x12, 0x64, 0xFB, +0xEF, 0x70, 0x02, 0xE1, 0xCA, 0xE5, 0x20, 0x13, 0x13, 0x13, 0x54, 0x1F, 0xF5, 0x21, 0xE5, 0x20, +0x54, 0x07, 0xF5, 0x22, 0x74, 0x81, 0x25, 0x21, 0x12, 0x76, 0x11, 0xE0, 0xFD, 0x12, 0xBC, 0x96, +0x80, 0x05, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, 0xF9, 0xFF, 0xEF, 0x5D, 0x70, 0x02, 0xE1, 0xCA, +0x75, 0xF0, 0x10, 0xE5, 0x20, 0xD1, 0x9F, 0xE0, 0x20, 0xE7, 0x02, 0x80, 0x10, 0x75, 0xF0, 0x10, +0xE5, 0x20, 0x90, 0x81, 0x02, 0x12, 0x48, 0x65, 0xE0, 0xFF, 0x20, 0xE7, 0x09, 0x90, 0x01, 0xC1, +0xE0, 0x44, 0x20, 0xF0, 0xE1, 0xCA, 0x75, 0xF0, 0x04, 0xE5, 0x20, 0xD1, 0x88, 0xE0, 0x54, 0x07, +0x44, 0x50, 0xF0, 0xEF, 0x30, 0xE6, 0x35, 0xF1, 0xCF, 0x12, 0xBB, 0x83, 0x80, 0x02, 0xC3, 0x33, +0xD8, 0xFC, 0xF4, 0x5F, 0xF0, 0x75, 0xF0, 0x10, 0xE5, 0x20, 0xF1, 0xEF, 0xE0, 0xFD, 0x75, 0xF0, +0x04, 0xE5, 0x20, 0x12, 0x4F, 0xAD, 0xF1, 0xE2, 0xE4, 0xFB, 0xAF, 0x20, 0x12, 0x73, 0x7D, 0x75, +0xF0, 0x04, 0xE5, 0x20, 0xD1, 0x88, 0xE0, 0x54, 0xF8, 0xF0, 0x80, 0x6E, 0x12, 0xBA, 0xC9, 0xE0, +0x04, 0xF0, 0x12, 0xBA, 0xC9, 0xE0, 0xD3, 0x94, 0x01, 0x40, 0x45, 0xAF, 0x20, 0x12, 0xAD, 0xF9, +0x12, 0xBA, 0xC9, 0xE4, 0xF0, 0xF1, 0xCF, 0xE0, 0xFD, 0xFB, 0x7A, 0x00, 0x12, 0xBC, 0x96, 0x80, +0x05, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, 0xF9, 0x12, 0x5F, 0xDD, 0x70, 0x13, 0xF1, 0xCF, 0xAF, +0x22, 0x74, 0x01, 0xA8, 0x07, 0x08, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0x4D, 0xF0, 0x80, 0x2A, +0xF1, 0xCF, 0x12, 0xBB, 0x83, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0xF4, 0x5F, 0xF0, 0x80, 0x1A, +0x75, 0xF0, 0x10, 0xE5, 0x20, 0xF1, 0xEF, 0xE0, 0xFD, 0x75, 0xF0, 0x04, 0xE5, 0x20, 0x12, 0x4F, +0xAD, 0xF1, 0xE2, 0x7B, 0x01, 0xAF, 0x20, 0x12, 0x73, 0x7D, 0x05, 0x20, 0xC1, 0xA8, 0x22, 0x74, +0x11, 0x25, 0x21, 0xF5, 0x82, 0xE4, 0x34, 0x9D, 0xF5, 0x83, 0x22, 0x12, 0x47, 0x17, 0x2F, 0xFF, +0xEE, 0x22, 0x13, 0x13, 0x54, 0x03, 0xF5, 0x27, 0x22, 0xF0, 0x75, 0xF0, 0x10, 0xE5, 0x0D, 0x90, +0x81, 0x00, 0x02, 0x48, 0x65, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0xA5, 0xC8, 0xEF, +0xF0, 0x75, 0xF0, 0x04, 0x12, 0x5F, 0xA6, 0x54, 0x1F, 0xFB, 0x60, 0x12, 0x64, 0x02, 0x60, 0x0E, +0xEB, 0x64, 0x04, 0x60, 0x09, 0xEB, 0x64, 0x09, 0x60, 0x04, 0xEB, 0xB4, 0x0C, 0x08, 0x12, 0x5E, +0xD2, 0x74, 0x02, 0xF0, 0x80, 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 0x24, 0x21, 0xF1, 0x9B, 0xE5, 0x70, 0xF0, 0x75, 0xF0, 0x04, 0xEF, +0x12, 0x4F, 0xAD, 0x12, 0x6F, 0xE2, 0x90, 0xA5, 0xC8, 0xE0, 0xFF, 0xE4, 0xFB, 0xAD, 0x70, 0x71, +0x7D, 0x90, 0xA5, 0xC8, 0xE0, 0xFF, 0x75, 0xF0, 0x10, 0xD1, 0xAD, 0xE4, 0xF0, 0x90, 0xA5, 0xC9, +0xE0, 0xFE, 0xC3, 0x94, 0x36, 0x40, 0x0A, 0x74, 0x91, 0x2F, 0x51, 0x38, 0x74, 0x05, 0xF0, 0x80, +0x43, 0xEE, 0xC3, 0x94, 0x2C, 0x40, 0x07, 0x51, 0x32, 0x74, 0x04, 0xF0, 0x80, 0x36, 0x90, 0xA5, +0xC9, 0xE0, 0xFF, 0xC3, 0x94, 0x14, 0x40, 0x07, 0x51, 0x32, 0x74, 0x03, 0xF0, 0x80, 0x25, 0xEF, +0xC3, 0x94, 0x0C, 0x40, 0x07, 0x51, 0x32, 0x74, 0x02, 0xF0, 0x80, 0x18, 0x90, 0xA5, 0xC9, 0xE0, +0xC3, 0x94, 0x04, 0x90, 0xA5, 0xC8, 0xE0, 0x40, 0x07, 0x51, 0x36, 0x74, 0x01, 0xF0, 0x80, 0x04, +0x51, 0x36, 0xE4, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xFF, 0x90, 0xA5, 0xC8, 0xE0, 0x75, 0xF0, +0x08, 0x90, 0x89, 0x00, 0x12, 0x48, 0x65, 0xE5, 0x82, 0x2F, 0xF5, 0x82, 0xE4, 0x35, 0x83, 0xF5, +0x83, 0x22, 0x90, 0xA5, 0xC8, 0xE0, 0x24, 0x91, 0xF5, 0x82, 0xE4, 0x34, 0x95, 0xF5, 0x83, 0x22, +0x90, 0xA5, 0xC8, 0xE0, 0x75, 0xF0, 0x08, 0x90, 0x89, 0x00, 0x12, 0x48, 0x65, 0xE5, 0x82, 0x22, +0xE4,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x90, 0x00, 0x8A, 0xB1, 0xFA, 0x90, 0x01, +0xD0, 0x12, 0x48, 0x65, 0xE0, 0x90, 0x01, 0xC3, 0xF0, 0x22, 0xF0, 0x90, 0xA5, 0xEB, 0xE0, 0x75, +0xF0, 0x04, 0x22, 0x75, 0xF0, 0x03, 0x12, 0x48, 0x65, 0xE0, 0xFE, 0x74, 0x01, 0xA8, 0x06, 0x08, +0x22, 0xF5, 0x82, 0xE4, 0x34, 0x94, 0xF5, 0x83, 0x22, 0x74, 0x01, 0x7E, 0x00, 0xA8, 0x6E, 0x08, +0x22, 0xE5, 0x6F, 0x75, 0xF0, 0x08, 0xA4, 0x25, 0x6E, 0x22, 0xFF, 0x90, 0xA5, 0xCA, 0xE0, 0xFB, +0xEF, 0x5B, 0x22, 0xE5, 0x25, 0x54, 0x7F, 0x90, 0xA5, 0x89, 0xF0, 0x22, 0xF0, 0x75, 0xF0, 0x04, +0xEF, 0x90, 0x96, 0x11, 0x02, 0x48, 0x65, 0x8F, 0x13, 0x75, 0xF0, 0x10, 0xEF, 0x90, 0x81, 0x05, +0x02, 0x48, 0x65, 0x2F, 0xF5, 0x82, 0x74, 0x01, 0x3E, 0xF5, 0x83, 0xE0, 0xFF, 0x90, 0xA1, 0xD5, +0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xED, 0x60, 0x21, 0x75, 0xF0, 0x0A, 0xEF, 0x90, +0x8D, 0x01, 0xD1, 0x9D, 0x90, 0x8D, 0x03, 0xD1, 0x9D, 0x90, 0x8D, 0x05, 0xD1, 0x9D, 0x90, 0x8D, +0x07, 0xD1, 0x9D, 0x90, 0x8D, 0x09, 0xF1, 0x7B, 0xF1, 0xA3, 0xE4, 0xF0, 0xD1, 0xA9, 0xE0, 0x54, +0xBF, 0x44, 0x80, 0xFE, 0xD1, 0xA9, 0xEE, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x12, 0x48, 0x65, +0xE4, 0xF0, 0xA3, 0xF0, 0x75, 0xF0, 0x0A, 0xEF, 0x22, 0x75, 0xF0, 0x10, 0xEF, 0x90, 0x81, 0x03, +0x02, 0x48, 0x65, 0x8F, 0x0E, 0x8D, 0x0F, 0x8B, 0x10, 0x75, 0xF0, 0x04, 0xEF, 0x12, 0x4F, 0xAD, +0xC4, 0x54, 0x03, 0x90, 0xA4, 0x36, 0xF0, 0x90, 0xA4, 0x34, 0x60, 0x09, 0x74, 0x32, 0xF0, 0xA3, +0x74, 0x2F, 0xF0, 0x80, 0x07, 0x74, 0x11, 0xF0, 0xA3, 0x74, 0x0F, 0xF0, 0xE5, 0x0F, 0xD3, 0x94, +0x2D, 0x40, 0x09, 0x75, 0xF0, 0x04, 0xE5, 0x0E, 0xD1, 0x41, 0x80, 0x1F, 0xE5, 0x0F, 0xD3, 0x94, +0x1E, 0x40, 0x05, 0x90, 0xA4, 0x34, 0x80, 0x13, 0xE5, 0x0F, 0xD3, 0x94, 0x14, 0x40, 0x05, 0x90, +0xA4, 0x35, 0x80, 0x07, 0x75, 0xF0, 0x04, 0xE5, 0x0E, 0x71, 0x73, 0xE0, 0xFD, 0x85, 0x10, 0x27, +0xE4, 0xFB, 0xAF, 0x0E, 0x61, 0x7D, 0xE4, 0xF5, 0x19, 0x74, 0x91, 0x2F, 0x51, 0x38, 0xE0, 0xFE, +0xB4, 0x05, 0x08, 0xED, 0xC3, 0x94, 0x3B, 0x40, 0x4F, 0x80, 0x45, 0xEE, 0xB4, 0x04, 0x08, 0xED, +0xC3, 0x94, 0x31, 0x40, 0x43, 0x80, 0x39, 0x74, 0x91, 0x2F, 0x51, 0x38, 0xE0, 0xFE, 0xB4, 0x03, +0x08, 0xED, 0xC3, 0x94, 0x19, 0x40, 0x31, 0x80, 0x27, 0xEE, 0xB4, 0x02, 0x08, 0xED, 0xC3, 0x94, +0x11, 0x40, 0x25, 0x80, 0x1B, 0x74, 0x91, 0x2F, 0x51, 0x38, 0xE0, 0xFE, 0xB4, 0x01, 0x08, 0xED, +0xC3, 0x94, 0x0A, 0x40, 0x13, 0x80, 0x09, 0xEE, 0x70, 0x0B, 0xED, 0xC3, 0x94, 0x03, 0x40, 0x08, +0x75, 0x19, 0x01, 0x80, 0x03, 0xE4, 0xF5, 0x19, 0xAF, 0x19, 0x22, 0x12, 0x48, 0x65, 0xE4, 0xF0, +0xA3, 0x22, 0x24, 0x11, 0xF5, 0x82, 0xE4, 0x34, 0x99, 0xF5, 0x83, 0x22, 0xD1, 0x47, 0xE0, 0x54, +0xFB, 0x12, 0xBB, 0x64, 0x02, 0x27, 0x48, 0x74, 0x21, 0x25, 0x0D, 0xF5, 0x82, 0xE4, 0x34, 0x9F, +0xF5, 0x83, 0x22, 0xF0, 0xEF, 0x25, 0xE0, 0x24, 0x01, 0xF5, 0x82, 0xE4, 0x34, 0x92, 0xF5, 0x83, +0xE4, 0xF0, 0xA3, 0xF0, 0x74, 0x91, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x98, 0xF5, 0x83, 0x22, 0x90, +0x8D, 0x01, 0x02, 0x48, 0x65, 0xE0, 0x04, 0xF0, 0xE0, 0x7F, 0x00, 0x22, 0xD1, 0x47, 0xE0, 0x44, +0x04, 0xF0, 0x22, 0x91, 0xEF, 0x7F, 0x02, 0x8F, 0x73, 0x7F, 0x02, 0x12, 0x4B, 0x3C, 0x90, 0xA1, +0x76, 0xE0, 0x45, 0x73, 0xF0, 0x22, 0xD1, 0xA9, 0xE0, 0x44, 0x40, 0xF0, 0x22, 0x90, 0xA3, 0x3C, +0xE0, 0xC3, 0x13, 0x54, 0x07, 0xFF, 0x75, 0xF0, 0x0E, 0x90, 0xA3, 0x49, 0x12, 0x48, 0x65, 0xE0, +0xFE, 0x75, 0xF0, 0x0E, 0xEF, 0x90, 0xA3, 0x48, 0x12, 0x48, 0x65, 0xE0, 0x90, 0xA5, 0x9C, 0xF0, +0x90, 0xA5, 0x9B, 0xEE, 0xF0, 0xE4, 0xFB, 0xFD, 0x7F, 0x54, 0x7E, 0x01, 0xD3, 0x10, 0xAF, 0x01, +0xC3, 0xC0, 0xD0, 0x90, 0xA5, 0x97, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0x90, 0xA5, 0x9B, 0xE0, 0xF5, +0x3B, 0xA3, 0xE0, 0xF5, 0x3C, 0x12, 0x34, 0x8C, 0x90, 0xA5, 0x97, 0xF1, 0x67, 0xA3, 0xA3, 0xA3, +0x74, 0x05, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xF1, 0x7A, 0x30, 0xE0, 0x05, 0x90, 0x01, 0x5B, +0xE4, 0xF0, 0x90, 0x06, 0x92, 0x74, 0x02, 0xF0, 0x90, 0x01, 0x3C, 0x74, 0x04, 0xF0, 0xE4, 0x90, +0xA5, 0x9B, 0xF0, 0x90, 0xA3, 0x36, 0xE0, 0xC3, 0x13, 0x54, 0x7F, 0x90, 0xA5, 0x9C, 0xF0, 0xE4, +0xFB, 0xFD, 0x7F, 0x58, 0x7E, 0x01, 0x11, 0x1C, 0x90, 0xA2, 0x88, 0xE0, 0x44, 0x08, 0xF0, 0x22, +0xE4, 0xF5, 0x20, 0x90, 0x06, 0xA9, 0xE0, 0xF5, 0x20, 0x54, 0xC0, 0x70, 0x08, 0x11, 0xC6, 0x54, +0xFD, 0xF0, 0x02, 0x60, 0x3D, 0xE5, 0x20, 0x30, 0xE6, 0x17, 0x90, 0xA2, 0x8C, 0xE0, 0x64, 0x01, +0x70, 0x11, 0x31, 0x39, 0x64, 0x02, 0x60, 0x04, 0x31, 0x92, 0x80, 0x07, 0x12, 0x57, 0x8F, 0x80, +0x02, 0x11, 0xC6, 0xE5, 0x20, 0x90, 0xA2, 0x90, 0x30, 0xE7, 0x06, 0x31, 0x4F, 0x11, 0x14, 0x21, +0x47, 0xE0, 0x54, 0xFD, 0xF0, 0x22, 0x90, 0xA2, 0x90, 0xE0, 0x54, 0xFE, 0xF0, 0x22, 0x90, 0x06, +0xA9, 0xE0, 0x90, 0xA4, 0xFA, 0xF0, 0xE0, 0xFD, 0x54, 0xC0, 0x70, 0x04, 0x11, 0xC6, 0x80, 0x55, +0xED, 0x30, 0xE6, 0x3E, 0x90, 0xA2, 0x8C, 0xE0, 0x64, 0x02, 0x70, 0x27, 0x90, 0xA2, 0x88, 0xE0, +0xFF, 0xC3, 0x13, 0x20, 0xE0, 0x09, 0x90, 0xA2, 0x90, 0xE0, 0x44, 0x01, 0xF0, 0x80, 0x1A, 0x31, +0x40, 0x64, 0x01, 0x70, 0x1F, 0x90, 0xA2, 0x90, 0xE0, 0x44, 0x04, 0xF0, 0x7F, 0x01, 0x12, 0x57, +0x01, 0x80, 0x11, 0x31, 0x39, 0x64, 0x02, 0x60, 0x04, 0x31, 0x92, 0x80, 0x07, 0x12, 0x57, 0x8F, +0x80, 0x02, 0x11, 0xC6, 0x90, 0xA4, 0xFA, 0xE0, 0x90, 0xA2, 0x90, 0x30, 0xE7, 0x06, 0x31, 0x4F, +0x11, 0x14, 0x80, 0x13, 0xE0, 0x54, 0xFD, 0xF0, 0x22, 0x90, 0xA2, 0x90, 0xE0, 0x44, 0x01, 0xF0, +0x90, 0xA2, 0x8A, 0xE0, 0x54, 0x0F, 0x22, 0x90, 0xA2, 0x88, 0xE0, 0x44, 0x04, 0xF0, 0x22, 0xE0, +0x44, 0x02, 0xF0, 0xE4, 0x90, 0xA5, 0x9B, 0xF0, 0x90, 0xA3, 0x35, 0xE0, 0x90, 0xA5, 0x9C, 0x22, +0x90, 0xA2, 0x8C, 0xE0, 0x64, 0x02, 0x60, 0x0F, 0x31, 0x40, 0x60, 0x0B, 0xF1, 0xBE, 0xEF, 0x70, +0x06, 0xFD, 0x7F, 0x0C, 0x12, 0x51, 0xE9, 0x22, 0xE4, 0xFF, 0x12, 0x64, 0xFB, 0xBF, 0x01, 0x11, +0x90, 0xA2, 0x8C, 0xE0, 0x60, 0x0B, 0x31, 0x40, 0x64, 0x02, 0x60, 0x02, 0x80, 0x04, 0x12, 0x57, +0x8F, 0x22, 0x90, 0x04, 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, 0xFF, 0x31, +0x40, 0x12, 0x4F, 0xB4, 0x90, 0xA2, 0x8B, 0xF0, 0x90, 0x00, 0x06, 0x12, 0x26, 0x37, 0x30, 0xE0, +0x57, 0xC3, 0x13, 0x54, 0x07, 0xFF, 0xC3, 0x94, 0x04, 0x90, 0xA2, 0x9F, 0x50, 0x04, 0xEF, 0xF0, +0x80, 0x2A, 0x74, 0x03, 0x12, 0x4F, 0xC3, 0xE9, 0x24, 0x06, 0xF9, 0xE4, 0x3A, 0xFA, 0x12, 0x26, +0x1E, 0xFF, 0x74, 0x03, 0x24, 0xFD, 0xFE, 0xEF, 0xC4, 0x54, 0x0F, 0xFD, 0xEF, 0x54, 0x0F, 0xFF, +0xED, 0x2E, 0x54, 0x0F, 0xFE, 0xC4, 0x54, 0xF0, 0x4F, 0x12, 0x26, 0x64, 0x12, 0x4F, 0xC4, 0x90, +0x00, 0x06, 0x12, 0x26, 0x37, 0xC4, 0x54, 0x0F, 0xFF, 0xC3, 0x94, 0x04, 0x90, 0xA2, 0x94, 0x50, +0x05, 0x74, 0x04, 0xF0, 0x80, 0x02, 0xEF, 0xF0, 0x12, 0x4F, 0xC4, 0x12, 0x5F, 0xB2, 0xFD, 0x7F, +0x02, 0x12, 0x51, 0x55, 0x12, 0x4F, 0xC4, 0x90, 0xA4, 0x34, 0x12, 0x48, 0x7A, 0x12, 0x65, 0x5D, +0x90, 0xA2, 0x8C, 0xE0, 0xFF, 0x12, 0x65, 0x1B, 0x90, 0xA2, 0x8C, 0xE0, 0x60, 0x13, 0x90, 0xA4, +0x34, 0x12, 0x48, 0x71, 0x12, 0x4F, 0xBD, 0x54, 0x0F, 0xFF, 0x12, 0x4F, 0xB6, 0xFD, 0x12, 0xB8, +0xC6, 0x22, 0xEF, 0x54, 0x80, 0xC4, 0x13, 0x13, 0x13, 0x54, 0x01, 0x22, 0x90, 0xA2, 0x88, 0xE0, +0xFF, 0x51, 0xF5, 0x30, 0xE0, 0x1B, 0xEF, 0x54, 0x7F, 0x91, 0x59, 0x30, 0xE1, 0x06, 0xE0, 0x44, +0x02, 0xF0, 0x80, 0x04, 0xE0, 0x54, 0xFD, 0xF0, 0x90, 0xA2, 0x8C, 0xE0, 0x60, 0x03, 0x12, 0x60, +0x3D, 0x90, 0x04, 0xE0, 0xE0, 0x30, 0xE1, 0x02, 0x71, 0x2B, 0x22, 0x90, 0xA3, 0x3C, 0xE0, 0x30, +0xE0, 0x24, 0xC3, 0x13, 0x54, 0x07, 0x71, 0x57, 0xE0, 0xFE, 0x30, 0xE0, 0x19, 0x75, 0xF0, 0x0E, +0xEF, 0x71, 0x5B, 0xEE, 0x54, 0xFE, 0xF0, 0x90, 0xA3, 0x3E, 0x74, 0x05, 0xF0, 0x12, 0x56, 0x04, +0xFD, 0x7F, 0x01, 0x12, 0x54, 0x7F, 0x22, 0xFF, 0x75, 0xF0, 0x0E, 0x90, 0xA3, 0x47, 0x02, 0x48, +0x65, 0xC0, 0xE0, 0xC0, 0xF0, 0xC0, 0x83, 0xC0, 0x82, 0xC0, 0xD0, 0x75, 0xD0, 0x00, 0xC0, 0x00, +0xC0, 0x01, 0xC0, 0x02, 0xC0, 0x03, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0x01, +0xC4, 0x74, 0x61, 0xF0, 0x74, 0x7B, 0xA3, 0xF0, 0x12, 0xA8, 0xD8, 0xE5, 0x69, 0x30, 0xE1, 0x02, +0xF1, 0x9A, 0xE5, 0x69, 0x30, 0xE2, 0x02, 0x91, 0x1C, 0xE5, 0x69, 0x30, 0xE3, 0x03, 0x12, 0x5F, +0xB0, 0xE5, 0x69, 0x30, 0xE5, 0x02, 0x91, 0x09, 0xE5, 0x6A, 0x30, 0xE0, 0x02, 0x91, 0x62, 0xE5, +0x6B, 0x30, 0xE1, 0x02, 0xD1, 0xB2, 0xE5, 0x6B, 0x30, 0xE0, 0x02, 0x31, 0xD4, 0xE5, 0x6B, 0x30, +0xE3, 0x02, 0xF1, 0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 0x90, 0xA2, 0x2B, 0xF0, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, -0xFF, 0xED, 0x2F, 0x90, 0xA2, 0x2C, 0xF0, 0x90, 0x00, 0x02, 0x12, 0x26, 0x37, 0xFF, 0xED, 0x2F, -0x90, 0xA2, 0x2D, 0xF0, 0x90, 0x00, 0x03, 0x12, 0x26, 0x37, 0xFF, 0xED, 0x2F, 0x90, 0xA2, 0x2E, -0xF0, 0x90, 0x00, 0x04, 0x12, 0x26, 0x37, 0xFF, 0xAE, 0x05, 0xED, 0x2F, 0x90, 0xA2, 0x2F, 0xF0, -0x22, 0x90, 0xA4, 0x91, 0x12, 0x48, 0x98, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0xFF, 0xFE, 0x12, -0x26, 0x1E, 0xFD, 0xC3, 0x13, 0x30, 0xE0, 0x12, 0x90, 0xA4, 0x91, 0x12, 0x48, 0x8F, 0x90, 0x00, -0x02, 0x12, 0x26, 0x37, 0x90, 0xA4, 0x95, 0xF0, 0x80, 0x05, 0x90, 0xA4, 0x95, 0xEF, 0xF0, 0x90, -0xA4, 0x94, 0xEE, 0xF0, 0x90, 0xA4, 0x95, 0xE0, 0xFE, 0x90, 0xA4, 0x94, 0xE0, 0xFF, 0xD3, 0x9E, -0x50, 0x38, 0x90, 0xA4, 0x91, 0x12, 0x48, 0x8F, 0x12, 0x26, 0x1E, 0x54, 0x01, 0xFE, 0x74, 0x1D, -0x2F, 0xF5, 0x82, 0xE4, 0x34, 0xA3, 0xF5, 0x83, 0xEE, 0xF0, 0x74, 0x1D, 0x2F, 0xF5, 0x82, 0xE4, -0x34, 0xA3, 0xF5, 0x83, 0xE0, 0x70, 0x04, 0x51, 0x43, 0x80, 0x07, 0x90, 0xA4, 0x94, 0xE0, 0xFF, -0x51, 0x32, 0x90, 0xA4, 0x94, 0xE0, 0x04, 0xF0, 0x80, 0xBA, 0x90, 0xA3, 0x1D, 0xE0, 0x70, 0x21, -0x90, 0xA3, 0xA4, 0xE0, 0x70, 0x04, 0xFF, 0x12, 0x52, 0x40, 0x90, 0xA3, 0xA4, 0xE0, 0x64, 0x0C, -0x60, 0x02, 0x51, 0x54, 0x90, 0xA3, 0x9E, 0xE0, 0x54, 0xF7, 0xF0, 0x54, 0xBF, 0xF0, 0x54, 0x7F, -0xF0, 0x22, 0x8F, 0x0F, 0x75, 0xF0, 0x10, 0xEF, 0x90, 0x81, 0x05, 0x12, 0x48, 0x83, 0xE0, 0x54, -0xFB, 0xF0, 0x22, 0x8F, 0x0F, 0x75, 0xF0, 0x10, 0xEF, 0x90, 0x81, 0x05, 0x12, 0x48, 0x83, 0xE0, -0x44, 0x04, 0xF0, 0x22, 0x90, 0x06, 0x04, 0xE0, 0x54, 0x7F, 0xF0, 0x90, 0x05, 0x22, 0xE4, 0xF0, -0x90, 0xA3, 0xA4, 0x74, 0x0C, 0xF0, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x12, 0x26, -0x1E, 0xFF, 0x90, 0xA3, 0x9D, 0xF0, 0xBF, 0x01, 0x12, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0x64, -0x01, 0x60, 0x17, 0x90, 0x05, 0x22, 0x74, 0x6F, 0xF0, 0x80, 0x0F, 0x90, 0x00, 0x01, 0x12, 0x26, -0x37, 0x64, 0x01, 0x60, 0x05, 0x90, 0x05, 0x22, 0xE4, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x12, -0x26, 0x1E, 0xFF, 0x54, 0x7F, 0x90, 0xA3, 0xA1, 0xF0, 0xEF, 0xC4, 0x13, 0x13, 0x13, 0x54, 0x01, -0xA3, 0xF0, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0xFF, 0x54, 0xF0, 0xC4, 0x54, 0x0F, 0xFE, 0x90, -0xA3, 0xA0, 0xE0, 0x54, 0xF0, 0x4E, 0xF0, 0x90, 0x00, 0x03, 0x12, 0x26, 0x37, 0x54, 0x01, 0x25, -0xE0, 0xFE, 0x90, 0xA3, 0x9E, 0xE0, 0x54, 0xFD, 0x4E, 0xF0, 0xEF, 0x54, 0x0F, 0xC4, 0x54, 0xF0, -0xFF, 0x90, 0xA3, 0xA0, 0xE0, 0x54, 0x0F, 0x4F, 0xF0, 0x90, 0x00, 0x04, 0x12, 0x26, 0x37, 0x90, -0xA3, 0xA3, 0xF0, 0x12, 0x66, 0x48, 0x90, 0x01, 0xB9, 0x74, 0x01, 0xF0, 0x90, 0x01, 0xB8, 0xF0, -0x90, 0xA3, 0xA1, 0xE0, 0x90, 0x01, 0xBA, 0xF0, 0x90, 0xA3, 0xA3, 0xE0, 0x90, 0x01, 0xBB, 0xF0, -0x90, 0xA3, 0xA0, 0xE0, 0x54, 0x0F, 0x90, 0x01, 0xBE, 0xF0, 0x22, 0x90, 0x00, 0x02, 0x12, 0x26, -0x37, 0xFF, 0x30, 0xE0, 0x26, 0x12, 0x26, 0x1E, 0x90, 0xA3, 0xB2, 0xF0, 0x90, 0x00, 0x01, 0x12, -0x26, 0x37, 0x90, 0xA3, 0xB3, 0xF0, 0xEF, 0x54, 0xFE, 0xFF, 0xA3, 0xE0, 0x54, 0x01, 0x4F, 0xF0, -0x90, 0x00, 0x03, 0x12, 0x26, 0x37, 0x90, 0xA3, 0xB5, 0xF0, 0x22, 0x90, 0xA3, 0xB2, 0x74, 0x01, -0xF0, 0xA3, 0x74, 0x05, 0xF0, 0xA3, 0xE0, 0x54, 0x01, 0x44, 0x28, 0xF0, 0xA3, 0x74, 0x05, 0xF0, -0x22, 0x12, 0x26, 0x1E, 0x54, 0x01, 0xFF, 0x90, 0xA3, 0xB9, 0xE0, 0x54, 0xFE, 0x4F, 0xF0, 0x90, -0x00, 0x01, 0x12, 0x26, 0x37, 0x90, 0xA3, 0xBA, 0xF0, 0x90, 0x00, 0x02, 0x12, 0x26, 0x37, 0x90, -0xA3, 0xBB, 0xF0, 0x90, 0xA3, 0xBA, 0xE0, 0x90, 0xA3, 0xBC, 0xF0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xE8, 0x90, 0xA6, 0xAC, 0xE0, -0x94, 0x03, 0x40, 0x0B, 0x90, 0x01, 0xC0, 0xE0, 0x44, 0x80, 0xF0, 0x7F, 0x00, 0x80, 0x15, 0x90, -0xA6, 0xAC, 0xE4, 0x75, 0xF0, 0x01, 0x12, 0x46, 0xF6, 0x7F, 0x0A, 0x7E, 0x00, 0x12, 0x3A, 0xF7, -0x80, 0xC5, 0x7F, 0x01, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, -0x90, 0xA6, 0xBD, 0x12, 0x48, 0x98, 0x90, 0xA6, 0xBC, 0xE0, 0xFF, 0x04, 0xF0, 0x90, 0x00, 0x01, -0xEF, 0x12, 0x26, 0x76, 0x7F, 0xAF, 0x7E, 0x01, 0x91, 0xD3, 0xEF, 0x60, 0x3A, 0x90, 0xA6, 0xBD, -0x12, 0x48, 0x8F, 0x8B, 0x40, 0x8A, 0x41, 0x89, 0x42, 0x90, 0x00, 0x0E, 0x12, 0x26, 0x37, 0x24, -0x02, 0xF5, 0x43, 0x7B, 0x01, 0x7A, 0x01, 0x79, 0xA0, 0x12, 0x34, 0x2C, 0x90, 0xA6, 0xBD, 0x12, -0x48, 0x8F, 0x90, 0x00, 0x0E, 0x12, 0x26, 0x37, 0x90, 0x01, 0xAE, 0xF0, 0xA3, 0x74, 0xFF, 0xF0, -0x90, 0x01, 0xCB, 0xE0, 0x64, 0x80, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xE4, 0xFC, 0xED, 0x2C, -0x24, 0x00, 0xF5, 0x82, 0xE4, 0x34, 0xFB, 0xF5, 0x83, 0xE4, 0xF0, 0x0C, 0xEC, 0xB4, 0x18, 0xEE, -0x74, 0x00, 0x2D, 0xF5, 0x82, 0xE4, 0x34, 0xFB, 0xF5, 0x83, 0xEF, 0xF0, 0xEE, 0x54, 0x3F, 0xFF, +0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xF0, 0xD0, 0xE0, 0x32, 0x90, 0xA3, 0x3C, 0xE0, 0x30, 0xE0, 0x0B, +0x12, 0x65, 0x52, 0xE4, 0x90, 0xA3, 0x3E, 0xF0, 0x12, 0x77, 0xED, 0x22, 0x90, 0xA2, 0x8C, 0xE0, +0x60, 0x13, 0x90, 0x06, 0x92, 0xE0, 0x30, 0xE1, 0x02, 0x01, 0x48, 0x90, 0xA2, 0x88, 0xE0, 0x54, +0xF7, 0xF0, 0x12, 0x60, 0x3D, 0x22, 0x90, 0xA2, 0x88, 0xE0, 0xFF, 0xC4, 0x13, 0x13, 0x54, 0x03, +0x30, 0xE0, 0x15, 0xEF, 0x54, 0xBF, 0x91, 0x59, 0x30, 0xE0, 0x06, 0xE0, 0x44, 0x01, 0xF0, 0x80, +0x04, 0xE0, 0x54, 0xFE, 0xF0, 0x12, 0x60, 0x3D, 0x22, 0xF0, 0x90, 0x04, 0xE0, 0xE0, 0x90, 0xA2, +0x89, 0x22, 0x12, 0xA9, 0xC6, 0x90, 0xA5, 0x08, 0xEF, 0xF0, 0x30, 0xE0, 0x05, 0x7D, 0x01, 0xE4, +0x80, 0x02, 0xE4, 0xFD, 0xFF, 0x12, 0x51, 0x55, 0x90, 0xA5, 0x08, 0xE0, 0x30, 0xE6, 0x11, 0x90, +0x01, 0x2F, 0xE0, 0x30, 0xE7, 0x04, 0xE4, 0xF0, 0x80, 0x06, 0x90, 0x01, 0x2F, 0x74, 0x80, 0xF0, +0xB1, 0x2E, 0x90, 0xA2, 0xA5, 0xE0, 0xFB, 0xAC, 0x07, 0x90, 0xA2, 0x88, 0xE0, 0x30, 0xE0, 0x16, +0x90, 0xA2, 0xC2, 0xE0, 0x24, 0x04, 0x90, 0xA2, 0xA1, 0xF0, 0x90, 0xA2, 0xC2, 0xE0, 0x24, 0x03, +0x90, 0xA2, 0xA0, 0xF0, 0x80, 0x0B, 0x90, 0xA2, 0xA1, 0x74, 0x02, 0xF0, 0x90, 0xA2, 0xA0, 0x14, +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0x80, 0x0A, 0x90, 0xA2, 0x87, 0xE0, +0xB4, 0x04, 0x06, 0xE4, 0xFD, 0xFF, 0x12, 0x51, 0xE9, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, +0xD0, 0x90, 0xA2, 0x82, 0xE0, 0xB4, 0x01, 0x04, 0x7F, 0x04, 0x80, 0x0C, 0x12, 0x63, 0x32, 0xBF, +0x01, 0x04, 0x7F, 0x01, 0x80, 0x02, 0x7F, 0x02, 0x12, 0x61, 0xEA, 0xD0, 0xD0, 0x92, 0xAF, 0x22, +0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xF1, 0x60, 0x12, 0x26, 0x1E, 0xFF, 0x90, 0xA2, 0x82, +0xF0, 0xBF, 0x01, 0x09, 0x12, 0x4F, 0xBD, 0x64, 0x01, 0x60, 0x1F, 0x80, 0x1B, 0xAB, 0x0D, 0xAA, +0x0E, 0xA9, 0x0F, 0x12, 0x4F, 0xBD, 0x64, 0x01, 0x60, 0x10, 0x90, 0xA2, 0x83, 0xE0, 0x20, 0xE0, +0x07, 0xE4, 0xFF, 0x12, 0x61, 0xEA, 0x80, 0x02, 0xD1, 0xFA, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x22, +0x8B, 0x0D, 0x8A, 0x0E, 0x89, 0x0F, 0x22, 0xE0, 0xFE, 0xA3, 0xE0, 0xF5, 0x82, 0x8E, 0x83, 0x22, +0x12, 0x65, 0x7E, 0x7D, 0x02, 0x7F, 0x02, 0x02, 0x63, 0x6F, 0x90, 0xA2, 0x88, 0xE0, 0x13, 0x13, +0x13, 0x54, 0x1F, 0x22, 0xF0, 0x90, 0xA2, 0x98, 0xA3, 0xE0, 0x90, 0x05, 0x58, 0xF0, 0x22, 0x90, +0xA4, 0x31, 0x12, 0x48, 0x7A, 0x12, 0x26, 0x1E, 0xFF, 0x22, 0x90, 0xA2, 0x8C, 0xE0, 0x60, 0x03, +0x12, 0x64, 0x59, 0x02, 0x55, 0x21, 0xE4, 0xFF, 0x12, 0x64, 0xFB, 0xBF, 0x01, 0x0F, 0x90, 0xA2, +0x8C, 0xE0, 0x60, 0x09, 0x11, 0xC6, 0x54, 0x07, 0x70, 0x03, 0x12, 0x60, 0x3D, 0x22, 0x90, 0x04, +0x1A, 0xE0, 0xF4, 0x60, 0x03, 0x7F, 0x00, 0x22, 0x90, 0x04, 0x1B, 0xE0, 0x54, 0x07, 0x64, 0x07, +0x7F, 0x01, 0x60, 0x02, 0x7F, 0x00, 0x22, 0xF1, 0xBE, 0xEF, 0x70, 0x03, 0x12, 0x57, 0x9F, 0x22, +0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0xA5, 0x90, 0xEF, 0xF0, 0xA3, 0xED, 0xF0, 0xFB, +0x7D, 0x00, 0x7C, 0x00, 0xE4, 0x90, 0xA5, 0x96, 0xF0, 0xEB, 0x90, 0xA5, 0x91, 0xF0, 0x7F, 0xB0, +0x7E, 0x08, 0x12, 0x36, 0xCE, 0xE4, 0xFF, 0xEC, 0x90, 0xA5, 0x92, 0x12, 0x27, 0x48, 0x90, 0xA5, +0x92, 0x12, 0x48, 0x59, 0x90, 0xA5, 0x91, 0x12, 0x66, 0xFF, 0x12, 0x47, 0x77, 0xA3, 0x12, 0x27, +0x48, 0x90, 0xA5, 0x92, 0x11, 0x65, 0x7F, 0xB0, 0x7E, 0x08, 0x12, 0x37, 0x5D, 0x12, 0x5F, 0xBF, +0x90, 0xA5, 0x90, 0xE0, 0x75, 0xF0, 0x08, 0xA4, 0x24, 0x73, 0xF5, 0x82, 0xE4, 0x34, 0xAF, 0xF5, +0x83, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x12, 0x36, 0xCE, 0xED, 0x54, 0x0F, 0xFD, 0xE4, 0xFC, 0xD0, +0xD0, 0x92, 0xAF, 0x22, 0x12, 0x36, 0xCE, 0xEF, 0x54, 0xFC, 0xFF, 0xEC, 0x90, 0xA5, 0xAF, 0x12, +0x27, 0x48, 0x90, 0xA5, 0xAF, 0x12, 0x48, 0x4D, 0x90, 0xAC, 0xB9, 0x02, 0x27, 0x48, 0x90, 0xA4, +0x98, 0x12, 0x48, 0x7A, 0x90, 0xA5, 0x78, 0x12, 0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA5, +0x7C, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0xD1, 0x50, 0xE4, 0x90, 0xA4, 0x9E, 0xF0, 0x90, +0xA4, 0x9E, 0xE0, 0xFD, 0x12, 0xA7, 0x98, 0x51, 0x11, 0xC0, 0x06, 0xC0, 0x07, 0xF1, 0xAC, 0x75, +0xF0, 0x04, 0xED, 0x12, 0xA7, 0x0A, 0x12, 0x47, 0xDF, 0x11, 0x68, 0xD0, 0x07, 0xD0, 0x06, 0x12, +0x37, 0x5D, 0x90, 0xA4, 0x9E, 0xE0, 0xFD, 0x12, 0xA7, 0xA2, 0x51, 0x11, 0xC0, 0x06, 0xC0, 0x07, +0x12, 0xA5, 0xD9, 0x75, 0xF0, 0x04, 0xED, 0x12, 0xA7, 0x0A, 0x12, 0x47, 0xDF, 0x11, 0x68, 0xD0, +0x07, 0xD0, 0x06, 0x12, 0xA7, 0xAC, 0x94, 0x06, 0x40, 0xB5, 0x90, 0xA5, 0x78, 0x12, 0x27, 0x54, +0x80, 0x00, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0xD1, 0x50, +0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x80, 0x31, 0xCE, 0x12, 0x27, +0x54, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x84, 0x31, 0xCE, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, +0x7F, 0x88, 0x31, 0xCE, 0x12, 0x27, 0x54, 0x3C, 0x00, 0x00, 0x00, 0x7F, 0x8C, 0x31, 0xCE, 0x12, +0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xB8, 0x31, 0xCE, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, +0x80, 0x7F, 0x90, 0x31, 0xCE, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x94, 0x31, 0xCE, +0x12, 0x27, 0x54, 0x20, 0x04, 0x00, 0x00, 0x7F, 0xC4, 0x31, 0xCE, 0x12, 0x27, 0x54, 0x20, 0x00, +0x00, 0x00, 0x7F, 0xC8, 0x31, 0xCE, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x80, 0x7E, +0x0E, 0x31, 0xD0, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x84, 0x7E, 0x0E, 0x31, 0xD0, +0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x88, 0x7E, 0x0E, 0x31, 0xD0, 0x12, 0x27, 0x54, +0x3C, 0x00, 0x00, 0x00, 0x7F, 0x8C, 0x7E, 0x0E, 0x31, 0xD0, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, +0x00, 0x7F, 0xB8, 0x7E, 0x0E, 0x31, 0xD0, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x80, 0x7F, 0x90, +0x7E, 0x0E, 0x31, 0xD0, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x94, 0x7E, 0x0E, 0x31, +0xD0, 0x12, 0x27, 0x54, 0x20, 0x04, 0x00, 0x00, 0x7F, 0xC4, 0x7E, 0x0E, 0x31, 0xD0, 0x12, 0x27, +0x54, 0x20, 0x00, 0x00, 0x00, 0x7F, 0xC8, 0x7E, 0x0E, 0x02, 0x37, 0x5D, 0x7F, 0xB0, 0x7E, 0x0C, +0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x22, 0x12, 0x37, 0x5D, 0x90, 0xA4, 0xEA, 0xE0, 0x75, 0xF0, +0x1E, 0xA4, 0x24, 0xD7, 0xF5, 0x82, 0xE4, 0x34, 0x44, 0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, +0x93, 0xFF, 0x12, 0x36, 0xCE, 0xE4, 0xFF, 0xFE, 0xEC, 0x54, 0x07, 0xFC, 0x90, 0xA5, 0x0C, 0x12, +0x27, 0x48, 0x90, 0xA4, 0xEA, 0xE0, 0x75, 0xF0, 0x1E, 0xA4, 0x24, 0xE7, 0xF5, 0x82, 0xE4, 0x34, +0x44, 0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0x22, 0x90, 0xA4, 0xEA, 0x12, 0xBC, +0x0B, 0x51, 0x02, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x00, 0x10, 0x00, +0x00, 0xD0, 0x07, 0xD0, 0x06, 0x31, 0xD0, 0x12, 0x27, 0x54, 0xFA, 0x00, 0x00, 0x00, 0x7F, 0x80, +0x7E, 0x09, 0x31, 0xD0, 0x12, 0x27, 0x54, 0xF8, 0x00, 0x00, 0x00, 0x7F, 0x80, 0x7E, 0x09, 0x12, +0x37, 0x5D, 0x7F, 0x03, 0x7E, 0x00, 0x12, 0x3A, 0x69, 0x90, 0xA4, 0xEA, 0xE0, 0x60, 0x04, 0xA3, +0xE0, 0x70, 0x07, 0x7F, 0x04, 0x7E, 0x00, 0x12, 0x3A, 0x69, 0x51, 0x02, 0xC0, 0x06, 0xC0, 0x07, +0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x37, +0x5D, 0xE4, 0x90, 0xA4, 0xED, 0xF0, 0x71, 0xD1, 0x51, 0x11, 0x12, 0x36, 0xCE, 0xE4, 0xFF, 0xEE, +0x54, 0x04, 0xFE, 0xE4, 0xFD, 0xFC, 0x78, 0x0A, 0x12, 0x27, 0x22, 0xEF, 0x70, 0x14, 0x90, 0xA4, +0xED, 0xE0, 0xD3, 0x94, 0x14, 0x50, 0x0B, 0x12, 0x98, 0xD8, 0x90, 0xA4, 0xED, 0xE0, 0x04, 0xF0, +0x80, 0xD4, 0x90, 0xA4, 0xED, 0xE0, 0xC3, 0x94, 0x14, 0x40, 0x02, 0x61, 0xC2, 0x90, 0xA4, 0xEB, +0xE0, 0x70, 0x41, 0x71, 0xD1, 0x51, 0x11, 0xF1, 0xD8, 0x70, 0x31, 0x51, 0x02, 0xC0, 0x06, 0xC0, +0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x02, 0x00, 0x00, 0x00, 0xD0, 0x07, 0xD0, 0x06, 0x31, +0xD7, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x04, 0x00, 0x00, 0x00, 0xD0, +0x07, 0xD0, 0x06, 0x71, 0xCE, 0x51, 0x11, 0x12, 0xBA, 0x9D, 0x61, 0xC8, 0xF1, 0xC9, 0x60, 0x02, +0x41, 0x21, 0x61, 0xC8, 0x71, 0xD1, 0x51, 0x11, 0xF1, 0xD8, 0x60, 0x02, 0x61, 0xBA, 0x51, 0x02, +0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x06, 0x00, 0x00, 0x00, 0xD0, 0x07, +0xD0, 0x06, 0x31, 0xD7, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x08, 0x00, +0x00, 0x00, 0xD0, 0x07, 0xD0, 0x06, 0x71, 0xCE, 0x51, 0x11, 0x12, 0xBA, 0x9D, 0x51, 0x02, 0xC0, +0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x05, 0x00, 0x00, 0x00, 0xD0, 0x07, 0xD0, +0x06, 0x71, 0xCE, 0x51, 0x11, 0x12, 0x36, 0xCE, 0x90, 0xA4, 0xF0, 0x31, 0xFF, 0xC0, 0x06, 0xC0, +0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x06, 0x00, 0x00, 0x00, 0xD0, 0x07, 0xD0, 0x06, 0x71, +0xCE, 0x51, 0x11, 0x12, 0xBB, 0x34, 0x90, 0xA4, 0xF4, 0x31, 0xFF, 0xC0, 0x06, 0xC0, 0x07, 0x90, +0xAC, 0xB9, 0x12, 0x27, 0x54, 0x07, 0x00, 0x00, 0x00, 0xD0, 0x07, 0xD0, 0x06, 0x71, 0xCE, 0x51, +0x11, 0x12, 0x36, 0xCE, 0x90, 0xA4, 0xF0, 0x31, 0xFF, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, +0x12, 0x27, 0x54, 0x08, 0x00, 0x00, 0x00, 0xD0, 0x07, 0xD0, 0x06, 0x71, 0xCE, 0x51, 0x11, 0x12, +0xBB, 0x34, 0x90, 0xA4, 0xF4, 0x12, 0x27, 0x48, 0x80, 0x0E, 0xF1, 0xC9, 0x60, 0x02, 0x41, 0x21, +0x80, 0x06, 0xF1, 0xC9, 0x60, 0x02, 0x41, 0x21, 0x90, 0xA4, 0xEF, 0xE0, 0xFF, 0x22, 0x12, 0x37, +0x5D, 0x90, 0xA4, 0xEA, 0xE0, 0x75, 0xF0, 0x1E, 0xA4, 0x24, 0xD7, 0xF5, 0x82, 0xE4, 0x34, 0x44, +0x22, 0x90, 0xA5, 0xFE, 0xED, 0xF0, 0xEF, 0x60, 0x02, 0x81, 0xAC, 0xE0, 0x24, 0xFD, 0x50, 0x0A, +0x60, 0x1D, 0x14, 0x60, 0x2F, 0x14, 0x60, 0x6B, 0xC1, 0x31, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, +0x77, 0x77, 0x77, 0x77, 0x31, 0xCC, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, 0x77, 0xA1, 0x1F, 0x90, +0xAC, 0xB9, 0x12, 0x27, 0x54, 0x54, 0x33, 0x77, 0x70, 0x31, 0xCC, 0x12, 0x27, 0x54, 0x54, 0x33, +0x77, 0x70, 0xA1, 0x9D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, 0x77, 0x31, 0xCC, +0x12, 0x27, 0x54, 0x77, 0x77, 0x77, 0x77, 0xF1, 0x92, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, +0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x10, 0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0C, 0xD1, 0x4A, +0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x10, 0x00, +0x00, 0xC1, 0x2B, 0x90, 0xA5, 0x78, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0xFF, 0x90, 0xA5, 0x7C, +0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x77, 0xF1, 0xB2, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, 0x77, +0xF1, 0x92, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, +0x00, 0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0C, 0xD1, 0x4A, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, +0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0xC1, 0x2B, 0x90, 0xA5, 0xFE, 0xE0, +0x14, 0x60, 0x59, 0x14, 0x70, 0x02, 0xA1, 0x4B, 0x14, 0x70, 0x02, 0xA1, 0x8A, 0x14, 0x70, 0x02, +0xA1, 0x4B, 0x14, 0x70, 0x02, 0xA1, 0xE4, 0x24, 0x05, 0x60, 0x02, 0xC1, 0x31, 0x90, 0xAC, 0xB9, +0x12, 0x27, 0x54, 0x77, 0x33, 0x77, 0x17, 0x31, 0xCC, 0x12, 0x27, 0x54, 0x77, 0x33, 0x77, 0x17, +0xF1, 0x92, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x01, +0x00, 0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0C, 0xD1, 0x4A, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, +0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0xC1, 0x2B, 0x90, 0xAC, 0xB9, 0x12, +0x27, 0x54, 0x77, 0x33, 0x77, 0x17, 0x31, 0xCC, 0x12, 0x27, 0x54, 0x77, 0x33, 0x77, 0x17, 0xF1, +0x92, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x00, +0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0C, 0xD1, 0x4A, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, +0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0xC1, 0x2B, 0x90, 0xAC, 0xB9, 0x12, 0x27, +0x54, 0x77, 0x33, 0x77, 0x77, 0x31, 0xCC, 0x12, 0x27, 0x54, 0x77, 0x33, 0x77, 0x77, 0xF1, 0x92, +0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, +0x00, 0x7F, 0xB4, 0x7E, 0x0C, 0xD1, 0x4A, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA5, +0x7C, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0xC1, 0x2B, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, +0x54, 0x33, 0x77, 0x17, 0x31, 0xCC, 0x12, 0x27, 0x54, 0x54, 0x33, 0x77, 0x17, 0xF1, 0x92, 0x12, +0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, +0x7F, 0xB4, 0x7E, 0x0C, 0xD1, 0x4A, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA5, 0x7C, +0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0E, 0xD1, 0x4A, 0x12, 0x27, 0x54, +0x00, 0x00, 0x03, 0x03, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x01, 0x7F, 0x00, +0x7E, 0x09, 0x80, 0x4B, 0x90, 0xA5, 0x78, 0x12, 0x27, 0x54, 0x00, 0xFF, 0x00, 0x00, 0x90, 0xA5, +0x7C, 0x12, 0x27, 0x54, 0x00, 0x33, 0x00, 0x00, 0xF1, 0xB2, 0x12, 0x27, 0x54, 0x77, 0x33, 0x77, +0x77, 0xF1, 0x92, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, +0x01, 0x00, 0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0C, 0xD1, 0x4A, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, +0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0E, 0xD1, +0x54, 0x22, 0x90, 0xA5, 0xA4, 0xE0, 0xFF, 0xE4, 0xFC, 0xFD, 0xFE, 0x78, 0x1C, 0x12, 0x27, 0x35, +0x90, 0xA5, 0x7C, 0x12, 0x27, 0x48, 0x7F, 0x38, 0x7E, 0x08, 0xD1, 0x54, 0x90, 0xA5, 0x78, 0x22, +0x7F, 0x2C, 0x7E, 0x08, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0xA5, 0x76, 0xEE, 0xF0, +0xA3, 0xEF, 0xF0, 0x12, 0x36, 0xCE, 0x90, 0xA5, 0x80, 0x12, 0x27, 0x48, 0x90, 0xA5, 0x78, 0x12, +0x48, 0x4D, 0x12, 0x27, 0x15, 0x90, 0xA5, 0x80, 0xF1, 0x9D, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, +0xC0, 0x07, 0x90, 0xA5, 0x78, 0x12, 0x48, 0x4D, 0x90, 0xA5, 0x7C, 0xF1, 0x9D, 0xD0, 0x03, 0xD0, +0x02, 0xD0, 0x01, 0xD0, 0x00, 0x12, 0x47, 0x77, 0x90, 0xA5, 0x84, 0x12, 0x27, 0x48, 0x90, 0xA5, +0x84, 0x11, 0x65, 0x90, 0xA5, 0x76, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x12, 0x37, 0x5D, 0xD0, 0xD0, +0x92, 0xAF, 0x22, 0x90, 0xA5, 0xE6, 0xED, 0xF0, 0x90, 0xA5, 0xE5, 0xEF, 0xF0, 0x70, 0x65, 0x90, +0xA5, 0x78, 0x12, 0x27, 0x54, 0x30, 0x00, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, +0x00, 0x00, 0x00, 0x74, 0x08, 0xFF, 0xFE, 0xD1, 0x4A, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x0E, +0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x08, 0x7F, 0x30, 0xD1, 0x48, 0x12, 0x27, +0x54, 0x00, 0x00, 0x00, 0x03, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x01, 0xF1, +0xBC, 0xE0, 0xFD, 0x71, 0xE1, 0x90, 0xA5, 0x78, 0x12, 0x27, 0x54, 0x30, 0x00, 0x00, 0x00, 0x90, +0xA5, 0x7C, 0x12, 0x27, 0x54, 0x30, 0x00, 0x00, 0x00, 0xF1, 0xA3, 0x90, 0x04, 0x54, 0xE0, 0x54, +0x7F, 0x02, 0xBB, 0x96, 0x90, 0xA5, 0xE5, 0xE0, 0x64, 0x01, 0x70, 0x65, 0x90, 0x04, 0x54, 0xE0, +0x44, 0x80, 0x12, 0xBB, 0x96, 0x90, 0xA5, 0x78, 0x12, 0x27, 0x54, 0x30, 0x00, 0x00, 0x00, 0x90, +0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x74, 0x08, 0xFF, 0xFE, 0xD1, 0x4A, 0x12, +0x27, 0x54, 0x00, 0x00, 0x00, 0x0E, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x06, +0x7F, 0x30, 0xD1, 0x48, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x03, 0x90, 0xA5, 0x7C, 0x12, 0x27, +0x54, 0x00, 0x00, 0x00, 0x02, 0xF1, 0xBC, 0xE0, 0xFD, 0x71, 0xE1, 0x90, 0xA5, 0x78, 0x12, 0x27, +0x54, 0x30, 0x00, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x20, 0x00, 0x00, 0x00, 0xF1, +0xA3, 0x22, 0x7F, 0xB0, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0xA5, 0x78, 0x22, 0x12, 0x48, 0x59, +0x02, 0x47, 0x6A, 0x74, 0x08, 0xFF, 0xFE, 0xC1, 0x54, 0xFF, 0xF1, 0xE1, 0x90, 0xA4, 0x98, 0x02, +0x48, 0x71, 0x7F, 0xB0, 0x7E, 0x0C, 0xD1, 0x54, 0x90, 0xAC, 0xB9, 0x22, 0x7F, 0x34, 0x7E, 0x08, +0xD1, 0x54, 0x90, 0xA5, 0xE5, 0xE0, 0xFF, 0xA3, 0x22, 0xE4, 0x90, 0xA4, 0xEF, 0xF0, 0x90, 0xA4, +0xEC, 0xE0, 0x04, 0xF0, 0xE0, 0x64, 0x0A, 0x22, 0x12, 0x36, 0xCE, 0xE4, 0x90, 0xA4, 0xEE, 0xF0, +0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x12, 0x7F, 0xE0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, +0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xC0, 0x07, 0xC0, 0x05, 0x90, 0xA4, 0xEC, 0x12, 0x48, +0x4D, 0x90, 0xAC, 0x9C, 0x12, 0x27, 0x48, 0xD0, 0x05, 0xD0, 0x07, 0x12, 0x32, 0x65, 0xD0, 0xD0, +0x92, 0xAF, 0x22, 0x90, 0xA4, 0x98, 0xE0, 0xFF, 0x7D, 0x65, 0x12, 0x87, 0xF0, 0x90, 0xA4, 0xEC, +0x22, 0x90, 0xA4, 0x98, 0xEF, 0xF0, 0xA3, 0x12, 0x48, 0x7A, 0x90, 0xA5, 0x78, 0x12, 0x27, 0x54, +0x80, 0x00, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x12, 0x86, +0x50, 0x12, 0xBB, 0x15, 0x12, 0x47, 0xBF, 0x12, 0xBA, 0x70, 0x7D, 0x65, 0x12, 0xBB, 0x12, 0x90, +0x00, 0x04, 0x12, 0xBA, 0x6D, 0x7D, 0x8F, 0x12, 0xBB, 0x12, 0x90, 0x00, 0x08, 0x12, 0xBA, 0x6D, +0xE4, 0xFD, 0x11, 0x1A, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x90, 0xA4, 0x98, 0xE0, 0xFF, +0x7D, 0xEF, 0x02, 0x87, 0xF0, 0x90, 0xA4, 0x98, 0xEF, 0xF0, 0xE4, 0xA3, 0xF0, 0x90, 0xA4, 0xE4, +0x12, 0x50, 0x66, 0xA3, 0xF0, 0x90, 0xA5, 0x78, 0x12, 0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0x90, +0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x12, 0x86, 0x50, 0x90, 0xA4, 0x98, 0xE0, +0x90, 0xAC, 0xB9, 0x70, 0x39, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, 0x77, 0x90, 0x44, 0xB5, 0x12, +0x82, 0x13, 0x12, 0x81, 0xD0, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, 0x77, 0x90, 0x44, 0xB7, 0x12, +0x82, 0x13, 0x12, 0x81, 0xD0, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x90, 0x44, 0xC1, 0x12, +0x82, 0x13, 0x12, 0x81, 0xD0, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x80, 0x37, 0x12, 0x27, +0x54, 0x00, 0x00, 0x00, 0x00, 0x90, 0x44, 0xB5, 0x12, 0x82, 0x13, 0x12, 0x81, 0xD0, 0x12, 0x27, +0x54, 0x00, 0x00, 0x00, 0x00, 0x90, 0x44, 0xB7, 0x12, 0x82, 0x13, 0x12, 0x81, 0xD0, 0x12, 0x27, +0x54, 0x77, 0x77, 0x77, 0x77, 0x90, 0x44, 0xC1, 0x12, 0x82, 0x13, 0x12, 0x81, 0xD0, 0x12, 0x27, +0x54, 0x77, 0x77, 0x77, 0x77, 0x90, 0x44, 0xC3, 0x12, 0x82, 0x13, 0x12, 0x37, 0x5D, 0x90, 0xA4, +0x98, 0xE0, 0x75, 0xF0, 0x0C, 0xA4, 0x24, 0xB9, 0xF5, 0x82, 0xE4, 0x34, 0x44, 0x12, 0x82, 0x11, +0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x19, 0x79, 0x19, 0x79, 0xD0, 0x07, +0xD0, 0x06, 0x12, 0xBA, 0x2C, 0x24, 0xCB, 0xF5, 0x82, 0xE4, 0x34, 0x44, 0x12, 0x82, 0x11, 0xC0, +0x06, 0xC0, 0x07, 0x90, 0xA5, 0x78, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x0F, 0x90, 0xA5, 0x7C, +0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x04, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x86, 0x54, 0x90, 0xA4, +0x98, 0xE0, 0x75, 0xF0, 0x0C, 0xA4, 0x12, 0xA7, 0x9A, 0x12, 0x82, 0x11, 0xC0, 0x06, 0xC0, 0x07, +0x90, 0xA5, 0x78, 0x12, 0x27, 0x54, 0x07, 0x00, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, +0x07, 0x00, 0x00, 0x00, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x86, 0x4A, 0x12, 0x27, 0x54, 0x80, 0x00, +0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x12, 0x86, 0x50, 0x90, +0xA4, 0xEC, 0x12, 0x27, 0x54, 0x00, 0x08, 0x00, 0x02, 0x90, 0xA4, 0x98, 0xE0, 0xFF, 0x7D, 0xEF, +0x11, 0x1A, 0x12, 0x27, 0x54, 0x00, 0x02, 0x00, 0x00, 0x12, 0xBC, 0x5E, 0x11, 0x1A, 0x12, 0x27, +0x54, 0x00, 0x03, 0xFF, 0xFD, 0x12, 0xBC, 0x56, 0x11, 0x1A, 0x12, 0x27, 0x54, 0x00, 0x0F, 0xE8, +0x3F, 0x12, 0xBC, 0x4E, 0x11, 0x1A, 0x12, 0x27, 0x54, 0x00, 0x09, 0x31, 0xD5, 0x11, 0x13, 0x12, +0x27, 0x54, 0x00, 0x08, 0xA0, 0x01, 0x12, 0xBC, 0x26, 0x12, 0x87, 0xF0, 0x90, 0xAC, 0xB9, 0x12, +0x27, 0x54, 0x00, 0x00, 0x80, 0x00, 0x7F, 0x0C, 0x7E, 0x09, 0x12, 0xBA, 0x2C, 0x24, 0xCD, 0xF5, +0x82, 0xE4, 0x34, 0x44, 0x12, 0x82, 0x11, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xA5, 0x78, 0x12, 0x27, +0x54, 0x00, 0x00, 0x00, 0x01, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x01, 0xD0, +0x07, 0xD0, 0x06, 0x12, 0x87, 0xB6, 0x12, 0x27, 0x54, 0x29, 0x00, 0x20, 0x00, 0x7F, 0x78, 0x7E, +0x09, 0x12, 0x81, 0xD0, 0x12, 0x27, 0x54, 0xA9, 0x00, 0x20, 0x00, 0x7F, 0x7C, 0x7E, 0x09, 0x12, +0x81, 0xD0, 0x12, 0x27, 0x54, 0x00, 0x46, 0x29, 0x10, 0x7F, 0x84, 0x7E, 0x09, 0x12, 0x87, 0x96, +0x12, 0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x80, 0x00, 0x00, +0x00, 0x12, 0x86, 0x50, 0x90, 0xA3, 0x6A, 0xE0, 0x30, 0xE0, 0x39, 0x12, 0xBA, 0x89, 0x90, 0xA4, +0x98, 0xE0, 0x75, 0xF0, 0x1E, 0xBF, 0x01, 0x16, 0x12, 0xBA, 0x7C, 0x12, 0x82, 0x11, 0xC0, 0x06, +0xC0, 0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x82, 0x14, 0x03, 0xE3, 0x80, 0x2D, 0x12, 0xBA, +0x7C, 0x12, 0x82, 0x11, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x82, 0x14, +0x03, 0xF7, 0x80, 0x17, 0x12, 0xBA, 0x2F, 0x12, 0xBA, 0x7D, 0x12, 0x82, 0x11, 0xC0, 0x06, 0xC0, +0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x82, 0x14, 0x03, 0xF1, 0xD0, 0x07, 0xD0, 0x06, 0x12, +0x37, 0x5D, 0x90, 0xA3, 0x69, 0xE0, 0x30, 0xE5, 0x1D, 0x12, 0xBA, 0x2F, 0x24, 0xD1, 0xF5, 0x82, +0xE4, 0x34, 0x44, 0x12, 0x82, 0x11, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, +0x68, 0x16, 0x3E, 0x96, 0x80, 0x60, 0x90, 0xA3, 0x69, 0xE0, 0x30, 0xE4, 0x60, 0x12, 0xBA, 0x2F, +0x24, 0xD1, 0xF5, 0x82, 0xE4, 0x34, 0x44, 0x12, 0x82, 0x11, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, +0xB9, 0x12, 0x27, 0x54, 0x28, 0x16, 0x3E, 0x96, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x37, 0x5D, 0x12, +0xBA, 0x85, 0x90, 0xA4, 0x98, 0xE0, 0x75, 0xF0, 0x1E, 0xBF, 0x03, 0x16, 0x12, 0xBA, 0x7C, 0x12, +0x82, 0x11, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x82, 0x14, 0x03, 0xE3, +0x80, 0x14, 0x12, 0xBA, 0x7C, 0x12, 0x82, 0x11, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, 0x12, +0x27, 0x54, 0x82, 0x14, 0x03, 0xF7, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x37, 0x5D, 0x12, 0xBA, 0x2F, +0x24, 0xE3, 0xF5, 0x82, 0xE4, 0x34, 0x44, 0x12, 0x82, 0x11, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, +0xB9, 0x12, 0x27, 0x54, 0x18, 0x00, 0x8C, 0x10, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0xBA, 0x2C, 0x24, +0xE5, 0xF5, 0x82, 0xE4, 0x34, 0x44, 0x12, 0x82, 0x11, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, +0x12, 0x27, 0x54, 0x38, 0x00, 0x8C, 0x10, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0xBA, 0x2C, 0x24, 0xD3, +0xF5, 0x82, 0xE4, 0x34, 0x44, 0x12, 0x82, 0x11, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, 0x12, +0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x37, 0x5D, 0xE4, 0x90, 0xA4, +0x99, 0xF0, 0x90, 0xA4, 0x98, 0xE0, 0xFF, 0xE4, 0xFD, 0x12, 0x82, 0x1B, 0x90, 0xA4, 0xE8, 0xEF, +0xF0, 0x90, 0xA5, 0x0C, 0x12, 0x93, 0x60, 0x90, 0xA4, 0xE4, 0xE0, 0xFB, 0x12, 0xBA, 0x61, 0x12, +0x93, 0x58, 0xEB, 0x12, 0xBA, 0x55, 0x12, 0x97, 0xD2, 0x90, 0xA4, 0xE4, 0x12, 0x97, 0xBD, 0x40, +0x02, 0x81, 0x9E, 0xEE, 0x04, 0xA3, 0xF0, 0x90, 0xA4, 0xE4, 0x12, 0x97, 0xB3, 0x40, 0x02, 0x81, +0x96, 0xEE, 0x12, 0xBA, 0x61, 0x12, 0x92, 0xDB, 0x12, 0xBA, 0x65, 0x12, 0x93, 0x18, 0x12, 0x93, +0x51, 0x50, 0x7B, 0x74, 0xFF, 0x7F, 0xFC, 0x12, 0x93, 0x2E, 0x12, 0x93, 0x11, 0x40, 0x6F, 0x12, +0xBA, 0x51, 0x12, 0x92, 0xDB, 0x12, 0xBA, 0x59, 0x12, 0x93, 0x35, 0x50, 0x61, 0x12, 0x93, 0x07, +0x40, 0x5C, 0x90, 0xA4, 0x9B, 0xE0, 0x12, 0xBA, 0x61, 0x12, 0x91, 0xE6, 0xC0, 0x04, 0xC0, 0x05, +0xC0, 0x06, 0xC0, 0x07, 0x12, 0x92, 0xE0, 0x12, 0xBA, 0x65, 0x12, 0x91, 0xE6, 0xD0, 0x03, 0xD0, +0x02, 0xD0, 0x01, 0xD0, 0x00, 0x12, 0x92, 0xFC, 0x90, 0xA4, 0xB4, 0x12, 0x27, 0x48, 0x12, 0xBA, +0x51, 0x12, 0x91, 0xE6, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x12, 0x92, 0xE0, 0x12, +0xBA, 0x59, 0x12, 0x91, 0xE6, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0x12, 0x92, 0xFC, +0x90, 0xA4, 0xB8, 0x12, 0x27, 0x48, 0x90, 0xA4, 0xE6, 0x74, 0x01, 0xF0, 0x80, 0x08, 0x90, 0xA4, +0x9B, 0xE0, 0x04, 0xF0, 0x61, 0xF7, 0x90, 0xA4, 0x9A, 0xE0, 0x04, 0xF0, 0x61, 0xE9, 0x90, 0xA4, +0xE8, 0xE0, 0x60, 0x06, 0x90, 0xA4, 0xE4, 0xE0, 0x04, 0xF0, 0x90, 0xA4, 0xE6, 0xE0, 0x64, 0x01, +0x60, 0x07, 0x12, 0x97, 0xC7, 0x50, 0x02, 0x61, 0xC2, 0x90, 0xA5, 0x78, 0x12, 0x27, 0x54, 0x80, +0x00, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x12, 0x86, 0x50, +0x90, 0xA4, 0x98, 0xE0, 0xFF, 0x7D, 0x08, 0x12, 0x87, 0xE1, 0xE4, 0xFF, 0xEE, 0x54, 0xFC, 0xFE, +0xED, 0x54, 0x0F, 0xFD, 0xE4, 0xFC, 0x90, 0xA5, 0x6A, 0x12, 0x27, 0x48, 0x90, 0xA5, 0x66, 0x12, +0x27, 0x54, 0x00, 0x07, 0xFE, 0x00, 0x90, 0xA4, 0x98, 0xE0, 0xFF, 0x7D, 0x58, 0x7C, 0x00, 0x12, +0x96, 0x52, 0x90, 0xA5, 0x78, 0x12, 0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, +0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0x12, 0x86, 0x50, 0x90, 0xA4, 0xE6, 0xE0, 0xB4, 0x01, 0x17, +0x90, 0xA4, 0xB4, 0x12, 0x97, 0xA1, 0x90, 0xA4, 0xB8, 0x12, 0x48, 0x4D, 0x90, 0xA4, 0xEF, 0x12, +0xBA, 0x73, 0x12, 0x92, 0x07, 0x80, 0x1F, 0x90, 0xA4, 0xEB, 0x12, 0x27, 0x54, 0x00, 0x00, 0x02, +0x00, 0x90, 0xA4, 0xEF, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x90, 0xA4, 0x98, 0xE0, 0xFF, +0x12, 0x92, 0x07, 0x02, 0x90, 0xBA, 0x90, 0xA5, 0x78, 0x12, 0x27, 0x54, 0x80, 0x00, 0x00, 0x00, +0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x12, 0x86, 0x50, 0x90, 0xA4, 0xEC, +0x12, 0x27, 0x54, 0x00, 0x08, 0x00, 0x00, 0x90, 0xA4, 0x98, 0xE0, 0xFF, 0x7D, 0xEF, 0x11, 0x1A, +0x12, 0x27, 0x54, 0x00, 0x03, 0x00, 0x00, 0x12, 0xBC, 0x5E, 0x11, 0x1A, 0x12, 0x27, 0x54, 0x00, +0x03, 0xF7, 0xFF, 0x12, 0xBC, 0x56, 0x11, 0x1A, 0x12, 0x27, 0x54, 0x00, 0x0F, 0xE7, 0xBF, 0x12, +0xBC, 0x4E, 0x11, 0x1A, 0x12, 0x27, 0x54, 0x00, 0x08, 0x80, 0x01, 0x12, 0xBC, 0x26, 0x11, 0x1A, +0x12, 0x27, 0x54, 0x00, 0x09, 0x31, 0xD1, 0x11, 0x13, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, +0x90, 0xA4, 0x98, 0xE0, 0xFF, 0x7D, 0xEF, 0x12, 0x87, 0xF0, 0x90, 0xA5, 0x78, 0x12, 0x27, 0x54, +0x80, 0x00, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0x7F, 0x78, +0x7E, 0x09, 0x12, 0x86, 0x4A, 0x12, 0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, +0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x7C, 0x7E, 0x09, 0x12, 0x87, 0xB6, 0x12, 0x27, 0x54, +0x00, 0x00, 0x80, 0x00, 0x7F, 0x0C, 0x7E, 0x09, 0x12, 0x37, 0x5D, 0x90, 0xA3, 0x69, 0xE0, 0x90, +0xAC, 0xB9, 0x30, 0xE5, 0x09, 0x12, 0x27, 0x54, 0x00, 0x46, 0xA8, 0x91, 0x80, 0x07, 0x12, 0x27, +0x54, 0x00, 0x46, 0xA8, 0x90, 0x7F, 0x84, 0x7E, 0x09, 0x12, 0x37, 0x5D, 0x90, 0xA3, 0x6A, 0xE0, +0x54, 0xE0, 0xC4, 0x13, 0x54, 0x07, 0x64, 0x01, 0x90, 0xA4, 0x98, 0x70, 0x30, 0x12, 0xBB, 0x05, +0x12, 0x82, 0x11, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, +0x17, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0xBA, 0xD5, 0x34, 0x44, 0x12, 0x82, 0x11, 0xC0, 0x06, 0xC0, +0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x77, 0x80, 0x2E, 0x12, 0xBB, 0x05, +0x12, 0x82, 0x11, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, +0x17, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0xBA, 0xD5, 0x34, 0x44, 0x12, 0x82, 0x11, 0xC0, 0x06, 0xC0, +0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x02, 0x00, 0x00, 0x77, 0xD0, 0x07, 0xD0, 0x06, 0x12, +0x37, 0x5D, 0x90, 0xA5, 0x78, 0x12, 0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, +0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0x12, 0x86, 0x50, 0x12, 0xBA, 0x2F, 0x24, 0xE3, 0xF5, 0x82, +0xE4, 0x34, 0x44, 0x12, 0x82, 0x11, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, +0x38, 0x00, 0x8C, 0x10, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0xBA, 0x2C, 0x24, 0xE5, 0xF5, 0x82, 0xE4, +0x34, 0x44, 0x12, 0x82, 0x11, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x18, +0x00, 0x8C, 0x10, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0xBA, 0x2C, 0x12, 0xBA, 0x7D, 0x12, 0x82, 0x11, +0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x82, 0x14, 0x01, 0x19, 0xD0, 0x07, +0xD0, 0x06, 0x12, 0x37, 0x5D, 0x90, 0xA4, 0x98, 0xE0, 0x70, 0x1E, 0x12, 0xBA, 0x85, 0x90, 0xAC, +0xB9, 0xBF, 0x01, 0x09, 0x12, 0x27, 0x54, 0x28, 0x16, 0x15, 0x00, 0x80, 0x07, 0x12, 0x27, 0x54, +0x28, 0x16, 0x0C, 0xC0, 0x90, 0x44, 0xD1, 0x80, 0x1F, 0x12, 0xBA, 0x85, 0x90, 0xAC, 0xB9, 0xBF, +0x01, 0x0C, 0x12, 0x27, 0x54, 0x28, 0x16, 0x15, 0x00, 0x90, 0x44, 0xEF, 0x80, 0x0A, 0x12, 0x27, +0x54, 0x28, 0x16, 0x0C, 0xA0, 0x90, 0x44, 0xEF, 0x12, 0x82, 0x13, 0x12, 0x37, 0x5D, 0x90, 0xA5, +0x78, 0x12, 0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x00, +0x00, 0x00, 0x7F, 0x2C, 0x12, 0x86, 0x48, 0x12, 0x27, 0x54, 0x03, 0xFF, 0x80, 0x00, 0x90, 0xA4, +0xB4, 0x12, 0x48, 0x4D, 0x78, 0x0F, 0x12, 0x27, 0x35, 0xE4, 0xFF, 0xEE, 0x54, 0x80, 0xFE, 0xEC, +0x54, 0x03, 0xFC, 0x12, 0x92, 0xEE, 0x7F, 0x78, 0x7E, 0x09, 0x12, 0x86, 0x4A, 0x12, 0x27, 0x54, +0x00, 0x00, 0x07, 0xFF, 0x90, 0xA4, 0xB8, 0x12, 0x48, 0x4D, 0x12, 0x92, 0xFF, 0x12, 0x92, 0xEE, +0x7F, 0x78, 0x7E, 0x09, 0x12, 0x86, 0x4A, 0x12, 0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA5, +0x7C, 0x12, 0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0x12, 0x86, 0x50, 0xE4, 0x90, 0xA4, 0x99, 0xF0, +0x90, 0xA4, 0x98, 0xE0, 0xFF, 0x7D, 0x01, 0x12, 0x82, 0x1B, 0x90, 0xA4, 0xE9, 0xEF, 0xF0, 0x90, +0xA5, 0x0C, 0x12, 0x93, 0x60, 0x90, 0xA4, 0xE5, 0xE0, 0xFB, 0x12, 0x92, 0xCF, 0x12, 0x93, 0x58, +0xEB, 0x75, 0xF0, 0x08, 0xA4, 0x12, 0x92, 0xF4, 0x12, 0x97, 0xD2, 0x90, 0xA4, 0xE5, 0xF1, 0xBD, +0x40, 0x02, 0x01, 0x9F, 0xEE, 0x04, 0xA3, 0xF0, 0x90, 0xA4, 0xE5, 0xF1, 0xB3, 0x40, 0x02, 0x01, +0x96, 0xEE, 0x51, 0xCF, 0x51, 0xDB, 0x51, 0xD3, 0x71, 0x18, 0x71, 0x51, 0x50, 0x70, 0x74, 0xFF, +0x7F, 0xFC, 0x71, 0x2E, 0x71, 0x11, 0x40, 0x66, 0x90, 0xA4, 0x9B, 0xE0, 0x75, 0xF0, 0x08, 0xA4, +0x51, 0xF4, 0x51, 0xDB, 0x51, 0xF4, 0x71, 0x35, 0x50, 0x54, 0x71, 0x07, 0x40, 0x50, 0x90, 0xA4, +0x9B, 0xE0, 0x51, 0xCF, 0x31, 0xE6, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x51, 0xE0, +0x51, 0xD3, 0x31, 0xE6, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0x51, 0xFC, 0x90, 0xA4, +0xDC, 0x12, 0x27, 0x48, 0x90, 0xA4, 0x9B, 0x31, 0xDA, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, +0x07, 0x90, 0xA4, 0x9A, 0x31, 0xDA, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0x51, 0xFC, +0x90, 0xA4, 0xE0, 0x12, 0x27, 0x48, 0x90, 0xA4, 0xE7, 0x74, 0x01, 0xF0, 0x80, 0x08, 0x90, 0xA4, +0x9B, 0xE0, 0x04, 0xF0, 0x01, 0x08, 0x90, 0xA4, 0x9A, 0xE0, 0x04, 0xF0, 0x02, 0x8F, 0xFB, 0x90, +0xA4, 0xE9, 0xE0, 0x60, 0x06, 0x90, 0xA4, 0xE5, 0xE0, 0x04, 0xF0, 0x90, 0xA4, 0xE7, 0xE0, 0x64, +0x01, 0x60, 0x07, 0xF1, 0xC7, 0x50, 0x03, 0x02, 0x8F, 0xD0, 0x90, 0xA4, 0xE7, 0xE0, 0xB4, 0x01, +0x13, 0x90, 0xA4, 0xDC, 0xF1, 0xA1, 0x90, 0xA4, 0xE0, 0x12, 0x48, 0x4D, 0x90, 0xA4, 0xEF, 0x12, +0x27, 0x48, 0x80, 0x14, 0x90, 0xA4, 0xEB, 0x12, 0x27, 0x54, 0x00, 0x00, 0x02, 0x00, 0x90, 0xA4, +0xEF, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x90, 0xA4, 0x98, 0xE0, 0xFF, 0xB1, 0x57, 0x12, +0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, +0x12, 0x86, 0x50, 0x31, 0xF0, 0xE4, 0x7B, 0x12, 0x7A, 0x01, 0xF9, 0xF8, 0xD3, 0x12, 0x47, 0x9A, +0x40, 0x2D, 0x31, 0xF0, 0xE4, 0x7B, 0xEE, 0x1A, 0xF8, 0xC3, 0x12, 0x47, 0x9A, 0x50, 0x20, 0x90, +0xA4, 0xEF, 0x31, 0xF3, 0xE4, 0x7B, 0x12, 0xF8, 0xD3, 0x12, 0x47, 0x9A, 0x50, 0x5F, 0x90, 0xA4, +0xEF, 0x31, 0xF3, 0xE4, 0x7B, 0xEE, 0x7A, 0x03, 0xF8, 0xC3, 0x12, 0x47, 0x9A, 0x40, 0x4E, 0x31, +0xFE, 0x24, 0xD5, 0xF5, 0x82, 0xE4, 0x34, 0x44, 0x12, 0x82, 0x11, 0xC0, 0x06, 0xC0, 0x07, 0x90, +0xA5, 0x78, 0x12, 0x27, 0x54, 0x00, 0x00, 0x03, 0xFF, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, +0x00, 0x01, 0x00, 0xD0, 0x07, 0xD0, 0x06, 0x31, 0xFB, 0x24, 0xD5, 0xF5, 0x82, 0xE4, 0x34, 0x44, +0x12, 0x82, 0x11, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xA5, 0x78, 0x12, 0x27, 0x54, 0x03, 0xFF, 0x00, +0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x80, 0x46, 0x31, 0xFE, 0x24, +0xD5, 0xF5, 0x82, 0xE4, 0x34, 0x44, 0x12, 0x82, 0x11, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xA5, 0x78, +0x12, 0x27, 0x54, 0x00, 0x00, 0x03, 0xFF, 0x31, 0xF0, 0x51, 0xEE, 0xD0, 0x07, 0xD0, 0x06, 0x31, +0xFB, 0x24, 0xD5, 0xF5, 0x82, 0xE4, 0x34, 0x44, 0x12, 0x82, 0x11, 0xC0, 0x06, 0xC0, 0x07, 0x90, +0xA5, 0x78, 0x12, 0x27, 0x54, 0x03, 0xFF, 0x00, 0x00, 0x90, 0xA4, 0xEF, 0x12, 0x48, 0x4D, 0x78, +0x0F, 0x51, 0xEB, 0xD0, 0x07, 0xD0, 0x06, 0x02, 0x86, 0x54, 0xE0, 0x75, 0xF0, 0x08, 0xA4, 0x24, +0xC8, 0xF5, 0x82, 0xE4, 0x34, 0xA4, 0xF5, 0x83, 0x12, 0x48, 0x4D, 0x78, 0x16, 0x02, 0x47, 0xAB, +0x90, 0xA4, 0xEB, 0x12, 0x48, 0x4D, 0x78, 0x01, 0x02, 0x27, 0x22, 0x12, 0x86, 0x54, 0x90, 0xA4, +0xEA, 0xE0, 0x75, 0xF0, 0x1E, 0xA4, 0x22, 0xB1, 0x57, 0x12, 0x27, 0x54, 0x80, 0x00, 0x00, 0x00, +0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0x12, 0x86, 0x50, 0x31, 0xFE, 0x24, +0xD9, 0xF5, 0x82, 0xE4, 0x34, 0x44, 0x12, 0x82, 0x11, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, +0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x80, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x37, 0x5D, 0x31, 0xFE, +0x24, 0xDB, 0xF5, 0x82, 0xE4, 0x34, 0x44, 0x12, 0x82, 0x11, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, +0xB9, 0x12, 0x27, 0x54, 0x20, 0x04, 0x00, 0x00, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x37, 0x5D, 0x31, +0xFE, 0x24, 0xDD, 0xF5, 0x82, 0xE4, 0x34, 0x44, 0x12, 0x82, 0x11, 0xC0, 0x06, 0xC0, 0x07, 0x90, +0xAC, 0xB9, 0x12, 0x27, 0x54, 0x20, 0x00, 0x00, 0x00, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x37, 0x5D, +0x31, 0xFE, 0x24, 0xDF, 0xF5, 0x82, 0xE4, 0x34, 0x44, 0x12, 0x82, 0x11, 0xC0, 0x06, 0xC0, 0x07, +0x90, 0xA5, 0x78, 0x12, 0x27, 0x54, 0x00, 0x00, 0x07, 0xFF, 0x90, 0xA4, 0xEF, 0x12, 0x48, 0x4D, +0x51, 0xEE, 0xD0, 0x07, 0xD0, 0x06, 0x31, 0xFB, 0x24, 0xE1, 0xF5, 0x82, 0xE4, 0x34, 0x44, 0x12, +0x82, 0x11, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xA5, 0x78, 0x12, 0x27, 0x54, 0x00, 0x00, 0x07, 0xFF, +0x90, 0xA4, 0xEB, 0x12, 0x48, 0x4D, 0x51, 0xEE, 0xD0, 0x07, 0xD0, 0x06, 0x02, 0x86, 0x54, 0x75, +0xF0, 0x08, 0xA4, 0x24, 0xC4, 0xF5, 0x82, 0xE4, 0x34, 0xA4, 0x22, 0xF5, 0x83, 0x12, 0x48, 0x59, +0x90, 0xA4, 0x9A, 0xE0, 0x75, 0xF0, 0x08, 0xA4, 0x22, 0x78, 0x02, 0x12, 0x27, 0x35, 0x90, 0xA5, +0x7C, 0x02, 0x27, 0x48, 0x24, 0xC8, 0xF5, 0x82, 0xE4, 0x34, 0xA4, 0x22, 0x12, 0x47, 0x4F, 0xEE, +0x54, 0x07, 0xFE, 0xE4, 0xFD, 0xFC, 0x22, 0x74, 0xFF, 0x7F, 0xFC, 0xFE, 0xFD, 0xFC, 0x90, 0xA4, +0xC0, 0x12, 0x48, 0x59, 0xD3, 0x02, 0x47, 0x84, 0xF5, 0x83, 0x12, 0x48, 0x4D, 0x12, 0x47, 0x5C, +0x78, 0x15, 0x12, 0x47, 0xAB, 0x90, 0xA4, 0xBC, 0x12, 0x27, 0x48, 0xE4, 0x7F, 0x04, 0xFE, 0xFD, +0xFC, 0x90, 0xA4, 0xBC, 0x22, 0xF5, 0x83, 0x12, 0x48, 0x4D, 0x12, 0x47, 0x5C, 0x78, 0x15, 0x12, +0x47, 0xAB, 0x90, 0xA4, 0xC0, 0x12, 0x27, 0x48, 0xE4, 0x7F, 0x04, 0xFE, 0xFD, 0xFC, 0x90, 0xA4, +0xC0, 0x12, 0x48, 0x59, 0xC3, 0x02, 0x47, 0x84, 0xF5, 0x83, 0x12, 0x27, 0x48, 0x90, 0xA5, 0x10, +0x12, 0x48, 0x4D, 0x78, 0x05, 0x02, 0x27, 0x35, 0x90, 0xA5, 0xA3, 0xD1, 0xCA, 0x12, 0x27, 0x54, +0x00, 0x00, 0x00, 0x00, 0x7F, 0x34, 0x7E, 0x08, 0x12, 0x36, 0xCE, 0x90, 0xA5, 0xA5, 0x12, 0x27, +0x48, 0x90, 0xA5, 0xA3, 0xE0, 0x14, 0x60, 0x63, 0x14, 0x70, 0x02, 0x81, 0xAC, 0x24, 0x02, 0x60, +0x02, 0xA1, 0x3D, 0x90, 0xA5, 0x78, 0x12, 0x27, 0x54, 0x00, 0x30, 0x03, 0xC3, 0x90, 0xA5, 0x7C, +0x12, 0x27, 0x54, 0x00, 0x30, 0x02, 0x00, 0x7F, 0xAC, 0x12, 0x86, 0x48, 0x12, 0x27, 0x54, 0x40, +0x00, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xC4, 0x12, +0x86, 0x48, 0x12, 0x27, 0x54, 0x00, 0x1C, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, +0x10, 0x00, 0x00, 0x7F, 0x64, 0x12, 0x86, 0x48, 0x12, 0x27, 0x54, 0x03, 0xC0, 0x00, 0x00, 0x90, +0xA5, 0x7C, 0x12, 0x27, 0x54, 0x01, 0xC0, 0x00, 0x00, 0xA1, 0x1F, 0x90, 0xA5, 0x78, 0x12, 0x27, +0x54, 0x00, 0x30, 0x03, 0xC3, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x30, 0x02, 0x01, 0x7F, +0xAC, 0x12, 0x86, 0x48, 0x12, 0x27, 0x54, 0x40, 0x00, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, +0x54, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xC4, 0x12, 0x86, 0x48, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, +0x3C, 0x90, 0xA5, 0xA4, 0x12, 0x66, 0xFF, 0x51, 0xE9, 0x7F, 0xAC, 0x12, 0x86, 0x48, 0x12, 0x27, +0x54, 0xF0, 0x00, 0x00, 0x00, 0x12, 0x86, 0x32, 0x12, 0x27, 0x54, 0x00, 0x1C, 0x00, 0x00, 0x90, +0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x08, 0x00, 0x00, 0xB1, 0x3E, 0x60, 0x13, 0x12, 0x27, 0x54, +0x03, 0xC0, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x01, 0x80, 0x00, 0x00, 0x80, 0x11, +0x12, 0x27, 0x54, 0x03, 0xC0, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x01, 0xC0, 0x00, +0x00, 0x7F, 0x48, 0x7E, 0x08, 0x12, 0x86, 0x54, 0x90, 0xA5, 0xA4, 0xE0, 0x90, 0xA5, 0x78, 0xB4, +0x01, 0x13, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x10, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, +0x00, 0x00, 0x10, 0x80, 0x11, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x10, 0x90, 0xA5, 0x7C, 0x12, +0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x00, 0x7E, 0x0A, 0xA1, 0x3A, 0x90, 0xA5, 0x78, 0x12, +0x27, 0x54, 0x00, 0x30, 0x03, 0xC3, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x30, 0x02, 0x02, +0x7F, 0xAC, 0x12, 0x86, 0x48, 0x12, 0x27, 0x54, 0x40, 0x00, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, +0x27, 0x54, 0x40, 0x00, 0x00, 0x00, 0x7F, 0xC4, 0x12, 0x86, 0x48, 0x12, 0x27, 0x54, 0x00, 0x00, +0x00, 0x3C, 0x90, 0xA5, 0xA4, 0x12, 0x66, 0xFF, 0x51, 0xE9, 0x7F, 0xAC, 0x12, 0x86, 0x48, 0x12, +0x27, 0x54, 0xF0, 0x00, 0x00, 0x00, 0x12, 0x86, 0x32, 0x12, 0x27, 0x54, 0x00, 0x1C, 0x00, 0x00, +0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x08, 0x00, 0x00, 0xB1, 0x3E, 0x60, 0x17, 0x12, 0x27, +0x54, 0x03, 0xC0, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x01, 0x40, 0x00, 0x00, 0x7F, +0x48, 0x7E, 0x08, 0x80, 0x15, 0x12, 0x27, 0x54, 0x03, 0xC0, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, +0x27, 0x54, 0x01, 0x80, 0x00, 0x00, 0x7F, 0x48, 0x7E, 0x08, 0x12, 0x86, 0x54, 0x22, 0x7F, 0x64, +0x7E, 0x08, 0x12, 0x86, 0x54, 0x90, 0xA5, 0xA5, 0x12, 0x48, 0x4D, 0xE4, 0xFF, 0xFE, 0xFD, 0xEC, +0x54, 0x04, 0xFC, 0x90, 0xA5, 0x78, 0x22, 0x90, 0xA4, 0xEA, 0xEF, 0xF0, 0x90, 0xA5, 0x78, 0x22, +0xFE, 0x13, 0x13, 0x54, 0x07, 0xFB, 0x90, 0xA5, 0xD4, 0xD1, 0xCA, 0xEB, 0xF0, 0xE4, 0xFE, 0x7D, +0x18, 0xFF, 0x12, 0x3A, 0xA9, 0x90, 0xA5, 0xD7, 0xEF, 0xF0, 0x90, 0xA5, 0xD4, 0xE0, 0xFF, 0x12, +0xB6, 0x87, 0x90, 0xA5, 0xD4, 0xF1, 0xAA, 0x12, 0xB6, 0xDE, 0xAE, 0x07, 0x90, 0x04, 0x83, 0xEE, +0xF0, 0x90, 0xA5, 0xD4, 0xE0, 0xFF, 0xAD, 0x06, 0x71, 0x68, 0x90, 0xA5, 0xD7, 0xE0, 0xFF, 0x90, +0xA5, 0xD4, 0xE0, 0xFD, 0x12, 0xB2, 0xA0, 0x90, 0xA5, 0xD4, 0xE0, 0xFF, 0xD3, 0x10, 0xAF, 0x01, +0xC3, 0xC0, 0xD0, 0xEF, 0x14, 0x60, 0x30, 0x14, 0x60, 0x56, 0x24, 0x02, 0x70, 0x7D, 0x90, 0xA5, +0x66, 0x12, 0x27, 0x54, 0x00, 0x00, 0x0C, 0x00, 0x90, 0xA5, 0x6A, 0x12, 0x27, 0x54, 0x00, 0x00, +0x0C, 0x00, 0xD1, 0x46, 0x12, 0x27, 0x54, 0x00, 0x00, 0x0C, 0x00, 0x90, 0xA5, 0x6A, 0x12, 0x27, +0x54, 0x00, 0x00, 0x0C, 0x00, 0x80, 0x50, 0x90, 0xA5, 0x66, 0x12, 0x27, 0x54, 0x00, 0x00, 0x0C, +0x00, 0x90, 0xA5, 0x6A, 0x12, 0x27, 0x54, 0x00, 0x00, 0x04, 0x00, 0xD1, 0x46, 0x12, 0x27, 0x54, +0x00, 0x00, 0x0C, 0x00, 0x90, 0xA5, 0x6A, 0x12, 0x27, 0x54, 0x00, 0x00, 0x04, 0x00, 0x80, 0x27, +0x90, 0xA5, 0x66, 0x12, 0x27, 0x54, 0x00, 0x00, 0x0C, 0x00, 0x90, 0xA5, 0x6A, 0x12, 0x27, 0x54, +0x00, 0x00, 0x00, 0x00, 0xD1, 0x46, 0x12, 0x27, 0x54, 0x00, 0x00, 0x0C, 0x00, 0x90, 0xA5, 0x6A, +0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0xF1, 0x9A, 0xD1, 0x52, 0xD0, 0xD0, 0x92, 0xAF, 0x22, +0x90, 0xA5, 0x6A, 0x12, 0x27, 0x48, 0x7D, 0x18, 0x7C, 0x00, 0xE4, 0xFF, 0xD1, 0x52, 0x90, 0xA5, +0x66, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0xA5, 0x64, 0xEC, 0xF0, 0xA3, 0xED, +0xF0, 0x90, 0xA5, 0x63, 0xEF, 0xF0, 0xA3, 0xA3, 0xE0, 0xFD, 0x12, 0x87, 0xE1, 0x90, 0xA5, 0x6E, +0x12, 0x27, 0x48, 0x90, 0xA5, 0x66, 0x12, 0x48, 0x4D, 0x12, 0x27, 0x15, 0x90, 0xA5, 0x6E, 0x12, +0x87, 0x9D, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xA5, 0x66, 0x12, 0x48, 0x4D, +0x90, 0xA5, 0x6A, 0x12, 0x87, 0x9D, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0x12, 0x47, +0x77, 0x90, 0xA5, 0x72, 0x12, 0x27, 0x48, 0x90, 0xA5, 0x64, 0xA3, 0xE0, 0xFD, 0xC0, 0x05, 0x90, +0xA5, 0x72, 0x12, 0x48, 0x4D, 0x90, 0xAC, 0x96, 0x12, 0x27, 0x48, 0x90, 0xA5, 0x63, 0xE0, 0xFF, +0xD0, 0x05, 0x12, 0x39, 0xBA, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xEF, 0xF0, 0xA3, 0xED, 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53, 0xE4, 0xFD, +0x7F, 0x01, 0x12, 0x39, 0x33, 0xE5, 0x51, 0x52, 0x53, 0x7B, 0x00, 0x7A, 0x00, 0x79, 0x54, 0x7D, +0x01, 0x7F, 0x01, 0x12, 0x39, 0x33, 0xE5, 0x52, 0x52, 0x54, 0xAB, 0x53, 0xE4, 0xFD, 0x7F, 0x01, +0x12, 0x39, 0x04, 0xAB, 0x54, 0x7D, 0x01, 0x7F, 0x01, 0x02, 0x39, 0x04, 0xC0, 0xE0, 0xC0, 0xF0, +0xC0, 0x83, 0xC0, 0x82, 0xC0, 0xD0, 0x75, 0xD0, 0x00, 0xC0, 0x00, 0xC0, 0x01, 0xC0, 0x02, 0xC0, +0x03, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0x01, 0xC4, 0x74, 0x6C, 0xF0, 0x74, +0x98, 0xA3, 0xF0, 0x11, 0xDF, 0xE5, 0x5C, 0x30, 0xE7, 0x02, 0x11, 0xC2, 0x74, 0x6C, 0x04, 0x90, +0x01, 0xC4, 0xF0, 0x74, 0x98, 0xA3, 0xF0, 0xD0, 0x07, 0xD0, 0x06, 0xD0, 0x05, 0xD0, 0x04, 0xD0, +0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0xD0, 0xD0, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xF0, 0xD0, +0xE0, 0x32, 0x11, 0xD8, 0x90, 0x00, 0xF2, 0xE0, 0x20, 0xE6, 0x0C, 0x90, 0x00, 0x05, 0xE0, 0x44, +0x80, 0xFD, 0x7F, 0x05, 0x12, 0x3A, 0x96, 0x22, 0x7F, 0x01, 0x7E, 0x00, 0x02, 0x3A, 0x69, 0x90, +0x00, 0x54, 0xE0, 0x55, 0x55, 0xF5, 0x59, 0xA3, 0xE0, 0x55, 0x56, 0xF5, 0x5A, 0xA3, 0xE0, 0x55, +0x57, 0xF5, 0x5B, 0xA3, 0xE0, 0x55, 0x58, 0xF5, 0x5C, 0xAD, 0x59, 0x7F, 0x54, 0x12, 0x3A, 0x96, +0xAD, 0x5A, 0x7F, 0x55, 0x12, 0x3A, 0x96, 0xAD, 0x5B, 0x7F, 0x56, 0x12, 0x3A, 0x96, 0xAD, 0x5C, +0x7F, 0x57, 0x12, 0x3A, 0x96, 0x53, 0x91, 0xEF, 0x22, 0xC0, 0xE0, 0xC0, 0xF0, 0xC0, 0x83, 0xC0, +0x82, 0xC0, 0xD0, 0x75, 0xD0, 0x00, 0xC0, 0x00, 0xC0, 0x01, 0xC0, 0x02, 0xC0, 0x03, 0xC0, 0x04, +0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0x01, 0xC4, 0x74, 0x19, 0xF0, 0x74, 0x99, 0xA3, 0xF0, +0x12, 0xA8, 0xAB, 0xE5, 0x61, 0x30, 0xE1, 0x02, 0x51, 0x3D, 0xE5, 0x61, 0x30, 0xE4, 0x03, 0x12, +0x77, 0xD3, 0xE5, 0x61, 0x30, 0xE5, 0x03, 0x12, 0xA9, 0x08, 0xE5, 0x61, 0x30, 0xE6, 0x03, 0x12, +0xA9, 0x44, 0xE5, 0x63, 0x30, 0xE0, 0x03, 0x12, 0xA9, 0x51, 0xE5, 0x63, 0x30, 0xE1, 0x02, 0x91, +0x40, 0xE5, 0x63, 0x30, 0xE2, 0x03, 0x12, 0xA9, 0x6C, 0xE5, 0x63, 0x30, 0xE3, 0x03, 0x12, 0x67, +0x51, 0xE5, 0x63, 0x30, 0xE4, 0x03, 0x12, 0x67, 0x0F, 0xE5, 0x63, 0x30, 0xE5, 0x03, 0x12, 0x79, +0x78, 0xE5, 0x63, 0x30, 0xE6, 0x03, 0x12, 0x7F, 0xA6, 0xE5, 0x64, 0x30, 0xE1, 0x03, 0x12, 0xA9, +0x8F, 0xE5, 0x64, 0x30, 0xE4, 0x02, 0x51, 0xBF, 0xE5, 0x64, 0x30, 0xE5, 0x02, 0x91, 0xA4, 0xE5, +0x64, 0x30, 0xE6, 0x02, 0x31, 0xDC, 0x74, 0x19, 0x04, 0x90, 0x01, 0xC4, 0xF0, 0x74, 0x99, 0xA3, +0xF0, 0xD0, 0x07, 0xD0, 0x06, 0xD0, 0x05, 0xD0, 0x04, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, +0x00, 0xD0, 0xD0, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xF0, 0xD0, 0xE0, 0x32, 0x90, 0x07, 0x1F, 0xE0, +0x54, 0x7F, 0xF0, 0x90, 0x07, 0x1C, 0xE0, 0x54, 0x01, 0xFF, 0x60, 0x2F, 0x90, 0xA4, 0x1D, 0xE0, +0x60, 0x29, 0x90, 0xA4, 0x1A, 0xE0, 0x54, 0x03, 0x14, 0x60, 0x10, 0x14, 0x60, 0x16, 0x24, 0x02, +0x70, 0x19, 0x90, 0x04, 0x2D, 0xE0, 0x44, 0x02, 0xF0, 0x80, 0x10, 0x90, 0x04, 0x2D, 0xE0, 0x44, +0x06, 0xF0, 0x80, 0x07, 0x90, 0x04, 0x2D, 0xE0, 0x44, 0x0E, 0xF0, 0xE4, 0x90, 0xA4, 0x1D, 0xF0, +0x90, 0xA4, 0xFA, 0xEF, 0xF0, 0x90, 0xA4, 0xF8, 0x74, 0x02, 0xF0, 0x90, 0xA5, 0x06, 0x14, 0xF0, +0xFB, 0x7A, 0xA4, 0x79, 0xF8, 0x12, 0x97, 0x1F, 0x7F, 0x04, 0x02, 0x97, 0x04, 0xE4, 0xFF, 0x90, +0xA4, 0xF8, 0xEF, 0xF0, 0x90, 0x04, 0x7E, 0xE0, 0xF5, 0x21, 0xA3, 0xE0, 0xF5, 0x22, 0x65, 0x21, +0x60, 0x6C, 0x90, 0xA4, 0xF9, 0x74, 0x03, 0xF0, 0x90, 0xA5, 0x07, 0x74, 0x08, 0xF0, 0xE5, 0x22, +0x04, 0x54, 0x0F, 0xF5, 0x23, 0xE4, 0xF5, 0x20, 0xE5, 0x23, 0x75, 0xF0, 0x08, 0xA4, 0x24, 0x00, +0xF5, 0x82, 0xE4, 0x34, 0x80, 0xF5, 0x83, 0xE5, 0x82, 0x25, 0x20, 0x12, 0x72, 0x2A, 0xE0, 0xFF, +0x74, 0xFB, 0x25, 0x20, 0xF5, 0x82, 0xE4, 0x34, 0xA4, 0xF5, 0x83, 0xEF, 0xF0, 0x05, 0x20, 0xE5, +0x20, 0xB4, 0x08, 0xD4, 0x7B, 0x01, 0x7A, 0xA4, 0x79, 0xF9, 0x12, 0x97, 0x1F, 0xE5, 0x22, 0x04, +0x54, 0x0F, 0xF5, 0x22, 0xB4, 0x0F, 0x03, 0xE4, 0xF5, 0x22, 0x90, 0x04, 0x7F, 0xE5, 0x22, 0xF0, +0x90, 0xA4, 0xF8, 0xE0, 0x7F, 0x04, 0x70, 0x03, 0x02, 0x77, 0xD7, 0x12, 0x97, 0x04, 0x22, 0xE4, +0xFF, 0x90, 0xA5, 0x3A, 0xEF, 0xF0, 0x7E, 0x00, 0x7F, 0x10, 0x7D, 0x00, 0x7B, 0x01, 0x7A, 0xA5, +0x79, 0x3C, 0x12, 0x48, 0xA9, 0x90, 0xA2, 0x81, 0xE0, 0x90, 0xA5, 0x4E, 0xF0, 0xE4, 0x90, 0xA5, +0x3B, 0xF0, 0x90, 0xA5, 0x4E, 0xE0, 0xFE, 0x90, 0xA5, 0x3B, 0xE0, 0xFD, 0xC3, 0x9E, 0x50, 0x43, +0xED, 0x91, 0x10, 0xED, 0x54, 0x07, 0xA3, 0xF0, 0x75, 0xF0, 0x10, 0xED, 0x12, 0x76, 0xAD, 0xE0, +0x30, 0xE7, 0x09, 0x74, 0x81, 0x2D, 0x71, 0xF6, 0xE4, 0xF0, 0x80, 0x1F, 0xAF, 0x05, 0x12, 0x77, +0xE6, 0x91, 0x26, 0xC0, 0x83, 0xC0, 0x82, 0xE0, 0xFF, 0x90, 0xA5, 0x4D, 0x12, 0x76, 0x09, 0x80, +0x02, 0xC3, 0x33, 0xD8, 0xFC, 0x4F, 0xD0, 0x82, 0xD0, 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, 0x90, 0xA5, 0x3B, 0xE0, 0x24, 0x81, 0x71, 0xF6, 0x74, 0x01, 0xF0, 0x90, 0xA5, 0x3B, +0xE0, 0x04, 0xF0, 0x61, 0x3F, 0x22, 0xF5, 0x82, 0xE4, 0x34, 0x93, 0xF5, 0x83, 0x22, 0x90, 0xA5, +0x3B, 0xE0, 0xFF, 0x75, 0xF0, 0x10, 0x22, 0x12, 0x48, 0x65, 0xE0, 0xFD, 0x75, 0xF0, 0x10, 0x22, +0x13, 0x13, 0x13, 0x54, 0x1F, 0x90, 0xA5, 0x4C, 0xF0, 0x22, 0x12, 0x48, 0x65, 0xE0, 0xFE, 0xED, +0xFF, 0x90, 0xA5, 0x3B, 0xE0, 0x22, 0x90, 0xA5, 0x4C, 0xE0, 0x24, 0x3C, 0xF5, 0x82, 0xE4, 0x34, +0xA5, 0xF5, 0x83, 0x22, 0x25, 0xE0, 0x24, 0x01, 0xF5, 0x82, 0xE4, 0x34, 0x92, 0xF5, 0x83, 0x22, +0x90, 0xA2, 0x83, 0xE0, 0x30, 0xE0, 0x06, 0x90, 0xA2, 0x85, 0x74, 0x01, 0xF0, 0x90, 0xA2, 0x8C, +0xE0, 0x60, 0x4C, 0x90, 0xA2, 0x88, 0xE0, 0x30, 0xE0, 0x19, 0x90, 0xA2, 0xA3, 0xE0, 0x04, 0xF0, +0x12, 0xBA, 0xF7, 0xCE, 0xC3, 0x13, 0xCE, 0x13, 0xD8, 0xF9, 0xFF, 0x90, 0xA2, 0xC3, 0xEE, 0xF0, +0xA3, 0xEF, 0xF0, 0x90, 0xA2, 0x89, 0x12, 0x7F, 0x7D, 0x30, 0xE0, 0x0C, 0x90, 0x01, 0x3B, 0xE0, +0x30, 0xE4, 0x05, 0x12, 0x63, 0x57, 0x91, 0xA7, 0x90, 0xA5, 0xFD, 0xE0, 0x04, 0xF0, 0xE0, 0xC3, +0x94, 0x80, 0x40, 0x0B, 0x90, 0x01, 0x98, 0xE0, 0x54, 0xFE, 0xF0, 0xE0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, 0x12, 0x4F, 0xBD, 0xFF, 0xF5, 0x11, 0x12, 0x26, 0x1E, 0xFE, 0xC3, +0x13, 0x30, 0xE0, 0x07, 0x12, 0x4F, 0xB6, 0xF5, 0x12, 0x80, 0x02, 0x8F, 0x12, 0x85, 0x11, 0x10, +0xE5, 0x10, 0xD3, 0x95, 0x12, 0x50, 0x1F, 0xF1, 0xD5, 0x54, 0x01, 0xFD, 0xAF, 0x10, 0xB1, 0x16, +0xAF, 0x10, 0x12, 0x64, 0xFB, 0xEF, 0xAF, 0x10, 0x70, 0x05, 0x12, 0x77, 0xCC, 0x80, 0x03, 0x12, +0x77, 0x8C, 0x05, 0x10, 0x80, 0xDA, 0xE5, 0x11, 0x70, 0x0D, 0xFF, 0x12, 0x64, 0xFB, 0xEF, 0x70, +0x06, 0x12, 0x67, 0x9D, 0x54, 0x7F, 0xF0, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, +0xA2, 0x9A, 0x12, 0x80, 0x65, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0xA2, 0x9A, 0x12, +0x80, 0x65, 0x7F, 0xB0, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0x00, 0x10, 0xE0, 0x44, 0x0C, 0xFD, +0x7F, 0x10, 0x12, 0x3A, 0x96, 0x90, 0x00, 0x72, 0xE0, 0x54, 0xF3, 0xFD, 0x7F, 0x72, 0x12, 0x3A, +0x96, 0x90, 0x01, 0x01, 0xE0, 0x44, 0x02, 0xF0, 0x90, 0x01, 0x00, 0x74, 0xFF, 0xF0, 0x90, 0x06, +0xB7, 0x74, 0x09, 0xF0, 0x90, 0x06, 0xB4, 0x74, 0x86, 0xF0, 0xF1, 0x8F, 0x54, 0xBF, 0xD1, 0x46, +0x12, 0x80, 0x65, 0xF1, 0x88, 0x90, 0x00, 0x02, 0xE0, 0x44, 0x01, 0xFD, 0x7F, 0x02, 0x12, 0x3A, +0x96, 0x7F, 0x00, 0x7E, 0x0C, 0xD1, 0x40, 0x12, 0x80, 0x65, 0xF1, 0xA2, 0xD1, 0x40, 0x12, 0x80, +0x65, 0x7F, 0x00, 0xF1, 0x98, 0x70, 0x14, 0xD1, 0x96, 0xE0, 0x54, 0xE7, 0xD1, 0xA6, 0xD1, 0x96, +0xE0, 0x54, 0x18, 0x70, 0x06, 0x90, 0x01, 0xBF, 0xE0, 0x04, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, +0x12, 0x36, 0xCE, 0xEF, 0x44, 0x03, 0xFF, 0xEC, 0x90, 0xA5, 0xA9, 0x12, 0x27, 0x48, 0x90, 0xA5, +0xA9, 0x22, 0x90, 0xA5, 0xC4, 0x12, 0x48, 0x7A, 0xEF, 0x70, 0x07, 0x90, 0xA5, 0xC7, 0x04, 0xF0, +0x80, 0x0B, 0xEF, 0x64, 0x01, 0x70, 0x25, 0x90, 0xA5, 0xC7, 0x74, 0x40, 0xF0, 0x7F, 0xE2, 0x12, +0x3A, 0x96, 0x90, 0xA5, 0xC7, 0xE0, 0xD1, 0xE9, 0x90, 0x00, 0xE1, 0xE0, 0xFF, 0x90, 0xA5, 0xC4, +0x12, 0x48, 0x71, 0xEF, 0x12, 0x26, 0x64, 0xD1, 0xE8, 0x7F, 0x01, 0x22, 0x90, 0x01, 0xC2, 0xE0, +0x44, 0x01, 0xF0, 0x7F, 0x00, 0x22, 0x7B, 0x01, 0x7A, 0xA5, 0x79, 0xAD, 0x7D, 0x08, 0x7F, 0x01, +0xD1, 0x52, 0x90, 0xA5, 0xAD, 0x22, 0xFB, 0x7D, 0x08, 0x7F, 0x01, 0x90, 0xA5, 0xEF, 0xEB, 0xF0, +0xEF, 0x70, 0x06, 0xA3, 0x74, 0x03, 0xF0, 0x80, 0x0B, 0xEF, 0x64, 0x01, 0x70, 0x28, 0x90, 0xA5, +0xF0, 0x74, 0x42, 0xF0, 0x7F, 0xE2, 0x12, 0x3A, 0x96, 0x90, 0xA5, 0xEF, 0xE0, 0xFD, 0x7F, 0xE0, +0x12, 0x3A, 0x96, 0x90, 0xA5, 0xF0, 0xE0, 0xD1, 0xE9, 0x90, 0xA5, 0xF0, 0xE0, 0x54, 0xFD, 0xD1, +0xE9, 0xD1, 0xE8, 0x7F, 0x01, 0x22, 0x80, 0xA4, 0xE4, 0xFD, 0x7F, 0xE3, 0x02, 0x3A, 0x96, 0xD3, +0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x12, 0x56, 0x1E, 0x7F, 0x00, 0x7E, 0x0C, 0x12, 0x80, 0x54, +0xF1, 0xA2, 0x12, 0x80, 0x54, 0x7F, 0x00, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0x00, 0x02, 0xE0, +0xF1, 0x6F, 0xF1, 0x6F, 0x54, 0xFE, 0xFD, 0x7F, 0x02, 0x12, 0x3A, 0x96, 0xF1, 0x8F, 0x44, 0x40, +0x12, 0x80, 0x5A, 0xF1, 0x88, 0x90, 0x01, 0x00, 0x74, 0x3F, 0xF0, 0xA3, 0xE0, 0x54, 0xFD, 0xF0, +0x90, 0x05, 0x53, 0xE0, 0x44, 0x20, 0x12, 0xBB, 0x64, 0x12, 0x27, 0x48, 0x90, 0xAC, 0xB9, 0x12, +0x27, 0x54, 0x77, 0x77, 0x77, 0x77, 0x12, 0x81, 0xCC, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, 0x77, +0x7F, 0xB0, 0xF1, 0x98, 0x70, 0x14, 0x7B, 0x01, 0x7A, 0xA5, 0x79, 0xAE, 0x7D, 0x08, 0x7F, 0x01, +0xD1, 0x52, 0x90, 0xA5, 0xAE, 0xE0, 0x44, 0x18, 0xD1, 0xA6, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x54, +0xFE, 0xFD, 0x7F, 0x02, 0x12, 0x3A, 0x96, 0x90, 0x00, 0x02, 0xE0, 0x44, 0x01, 0xFD, 0x7F, 0x02, +0x12, 0x3A, 0x96, 0x90, 0x00, 0x02, 0x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0x90, +0xA3, 0x3C, 0xE0, 0x54, 0xFE, 0xF0, 0x12, 0x65, 0x52, 0x12, 0x9F, 0xD5, 0x54, 0x0F, 0xFF, 0x12, +0x54, 0x3A, 0x41, 0x21, 0xAB, 0x0D, 0xAA, 0x0E, 0xA9, 0x0F, 0x12, 0x4F, 0xBD, 0x31, 0xFC, 0x51, +0x17, 0xEF, 0x12, 0x4F, 0xB5, 0x54, 0x03, 0xFF, 0x75, 0xF0, 0x0E, 0xED, 0x12, 0x56, 0x12, 0x54, +0xFC, 0x12, 0x4F, 0xB4, 0x54, 0x1C, 0xFF, 0xEE, 0x54, 0x0F, 0xFE, 0x75, 0xF0, 0x0E, 0x12, 0x56, +0x12, 0x54, 0xE3, 0x12, 0x4F, 0xB4, 0x54, 0xE0, 0xFF, 0x75, 0xF0, 0x0E, 0xEE, 0x12, 0x56, 0x12, +0x54, 0x1F, 0x4F, 0xF0, 0x12, 0x5F, 0xB2, 0x31, 0xF4, 0xE4, 0xFB, 0x31, 0xED, 0xA9, 0x0F, 0x90, +0x00, 0x05, 0x12, 0x26, 0x37, 0x31, 0xF4, 0x7B, 0x01, 0x31, 0xED, 0xA9, 0x0F, 0x12, 0x5C, 0x33, +0x33, 0x33, 0x33, 0x54, 0xF8, 0x31, 0xFC, 0xFD, 0x75, 0xF0, 0x0E, 0x90, 0xA3, 0x48, 0x12, 0x48, +0x65, 0xEF, 0xF0, 0x12, 0x5C, 0x33, 0xC4, 0x13, 0x54, 0x07, 0xFF, 0x75, 0xF0, 0x0E, 0xED, 0x90, +0xA3, 0x49, 0x12, 0x48, 0x65, 0xEF, 0xF0, 0xEE, 0xC4, 0x54, 0x0F, 0xFF, 0x14, 0x6D, 0x70, 0x26, +0x90, 0xA3, 0x3D, 0xEF, 0xF0, 0x90, 0x00, 0x06, 0x12, 0x26, 0x37, 0x54, 0x0F, 0xC4, 0x54, 0xF0, +0xFF, 0x90, 0xA3, 0x3C, 0xE0, 0x54, 0x0F, 0x4F, 0xF0, 0x54, 0xF1, 0xF0, 0x44, 0x01, 0xF0, 0x7D, +0x20, 0xE4, 0xFF, 0x12, 0x63, 0x42, 0x22, 0x8F, 0x10, 0x8D, 0x11, 0xAE, 0x03, 0x74, 0x1F, 0xC3, +0x95, 0x10, 0x40, 0x0F, 0x90, 0xA4, 0x35, 0xEE, 0xF0, 0xAB, 0x11, 0xE4, 0xFD, 0x31, 0xE5, 0x24, +0xD4, 0x80, 0x40, 0x74, 0x3F, 0xC3, 0x95, 0x10, 0x40, 0x0F, 0x90, 0xA4, 0x35, 0xEE, 0xF0, 0xAB, +0x11, 0x7D, 0x20, 0x31, 0xE3, 0x24, 0x88, 0x80, 0x2A, 0x74, 0x5F, 0xC3, 0x95, 0x10, 0x40, 0x0F, +0x90, 0xA4, 0x35, 0xEE, 0xF0, 0xAB, 0x11, 0x7D, 0x40, 0x31, 0xE3, 0x24, 0xD0, 0x80, 0x14, 0x74, +0x7F, 0xC3, 0x95, 0x10, 0x40, 0x25, 0x90, 0xA4, 0x35, 0xEE, 0xF0, 0xAB, 0x11, 0x7D, 0x60, 0x31, +0xE3, 0x24, 0x84, 0xFD, 0xE4, 0x34, 0x04, 0xFC, 0x75, 0xF0, 0x0E, 0xE5, 0x11, 0x51, 0x11, 0x75, +0xF0, 0x03, 0xEE, 0x12, 0x48, 0x65, 0xEC, 0xF0, 0xA3, 0xED, 0xF0, 0x22, 0xC3, 0xEF, 0x9D, 0xF5, +0x12, 0xC3, 0x94, 0x08, 0x50, 0x1C, 0xE4, 0xF5, 0x13, 0x51, 0x04, 0xC0, 0x83, 0xC0, 0x82, 0x90, +0xA4, 0x35, 0xE0, 0xD0, 0x82, 0xD0, 0x83, 0x75, 0xF0, 0x03, 0x12, 0x48, 0x65, 0xE5, 0x12, 0xF0, +0x80, 0x3E, 0xE5, 0x12, 0xC3, 0x94, 0x10, 0x50, 0x09, 0x75, 0x13, 0x01, 0xE5, 0x12, 0x24, 0xF8, +0x80, 0x17, 0xE5, 0x12, 0xC3, 0x94, 0x18, 0x50, 0x09, 0x75, 0x13, 0x02, 0xE5, 0x12, 0x24, 0xF0, +0x80, 0x07, 0x75, 0x13, 0x03, 0xE5, 0x12, 0x24, 0xE8, 0xFF, 0x51, 0x04, 0xC0, 0x83, 0xC0, 0x82, +0x90, 0xA4, 0x35, 0xE0, 0xD0, 0x82, 0xD0, 0x83, 0x75, 0xF0, 0x03, 0x12, 0x48, 0x65, 0xEF, 0xF0, +0xAF, 0x13, 0x22, 0xAF, 0x10, 0x31, 0x7C, 0x90, 0xA4, 0x31, 0xEF, 0xF0, 0x22, 0x31, 0x07, 0xAB, +0x0D, 0xAA, 0x0E, 0x22, 0xFF, 0x12, 0x26, 0x1E, 0x54, 0x0F, 0xFD, 0x22, 0xFF, 0x12, 0x26, 0x1E, +0xFE, 0x54, 0x0F, 0x22, 0x75, 0xF0, 0x0E, 0xEB, 0x90, 0xA3, 0x43, 0x02, 0x48, 0x65, 0x75, 0xF0, +0x0E, 0x90, 0xA3, 0x41, 0x02, 0x48, 0x65, 0xFD, 0x75, 0xF0, 0x0E, 0x90, 0xA3, 0x3F, 0x02, 0x48, +0x65, 0x7E, 0x00, 0x7F, 0x2D, 0x7D, 0x00, 0x7B, 0x01, 0x7A, 0xA3, 0x79, 0x3C, 0x02, 0x48, 0xA9, +0x12, 0x26, 0x1E, 0xFF, 0x90, 0xA2, 0x70, 0xF0, 0xBF, 0x01, 0x07, 0x51, 0x43, 0xE4, 0x90, 0xA2, +0x70, 0xF0, 0x22, 0x7B, 0x01, 0x7A, 0xA4, 0x79, 0x31, 0x7F, 0xF5, 0x7E, 0x03, 0x12, 0x33, 0xC7, +0xBF, 0x01, 0x06, 0x90, 0xA4, 0x31, 0xE0, 0xA3, 0xF0, 0x7B, 0x01, 0x7A, 0xA4, 0x79, 0x31, 0x7F, +0xF6, 0x7E, 0x03, 0x12, 0x33, 0xC7, 0xBF, 0x01, 0x08, 0x90, 0xA4, 0x31, 0xE0, 0x90, 0xA4, 0x33, +0xF0, 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74, 0x49, 0xF0, 0x90, -0x01, 0x9A, 0x74, 0xE0, 0xF0, 0x90, 0x01, 0x99, 0xE4, 0xF0, 0x90, 0x01, 0x98, 0x04, 0xF0, 0x22, -0xE4, 0x90, 0xA4, 0x80, 0xF0, 0xA3, 0xF0, 0x90, 0x01, 0x98, 0xE0, 0x7F, 0x00, 0x30, 0xE4, 0x02, -0x7F, 0x01, 0xEF, 0x64, 0x01, 0x60, 0x45, 0xC3, 0x90, 0xA4, 0x81, 0xE0, 0x94, 0x88, 0x90, 0xA4, -0x80, 0xE0, 0x94, 0x13, 0x40, 0x0F, 0x90, 0x01, 0xC1, 0xE0, 0x44, 0x10, 0xF0, 0x90, 0x01, 0xC7, -0x74, 0x03, 0xF0, 0x80, 0x27, 0x90, 0xA4, 0x80, 0xE4, 0x75, 0xF0, 0x01, 0x12, 0x46, 0xF6, 0x7F, -0x14, 0x7E, 0x00, 0x12, 0x3A, 0xF7, 0xD3, 0x90, 0xA4, 0x81, 0xE0, 0x94, 0x32, 0x90, 0xA4, 0x80, -0xE0, 0x94, 0x00, 0x40, 0xB2, 0x90, 0x01, 0xC6, 0xE0, 0x30, 0xE3, 0xAB, 0x90, 0x01, 0xC7, 0x74, -0x05, 0xF0, 0x22, 0x7F, 0x02, 0x90, 0xA3, 0xBD, 0xE0, 0xFE, 0xEF, 0xC3, 0x9E, 0x50, 0x18, 0xEF, -0x25, 0xE0, 0x24, 0x81, 0xF8, 0xE6, 0x30, 0xE4, 0x0B, 0x90, 0x01, 0xB8, 0x74, 0x08, 0xF0, 0xA3, -0xF0, 0x7F, 0x00, 0x22, 0x0F, 0x80, 0xDE, 0x7F, 0x01, 0x22, 0x90, 0x01, 0x3C, 0xE0, 0x55, 0x65, -0xF5, 0x69, 0xA3, 0xE0, 0x55, 0x66, 0xF5, 0x6A, 0xA3, 0xE0, 0x55, 0x67, 0xF5, 0x6B, 0xA3, 0xE0, -0x55, 0x68, 0xF5, 0x6C, 0x90, 0x01, 0x3C, 0xE5,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E, 0xF0, 0x90, 0xA5, 0x5F, 0xE0, 0x30, 0xE6, 0x11, 0x90, 0x01, 0x2F, 0xE0, 0x30, 0xE7, 0x04, -0xE4, 0xF0, 0x80, 0x06, 0x90, 0x01, 0x2F, 0x74, 0x80, 0xF0, 0x90, 0xA3, 0x9E, 0xE0, 0x30, 0xE0, -0x12, 0x90, 0xA3, 0xAC, 0xE4, 0xF0, 0xA3, 0x74, 0x04, 0xF0, 0x90, 0xA3, 0xAC, 0xA3, 0xE0, 0x90, -0x05, 0x58, 0xF0, 0x22, 0xE4, 0x90, 0xA5, 0x60, 0xF0, 0xA3, 0xF0, 0xA3, 0xF0, 0x90, 0x00, 0x83, -0xE0, 0x90, 0xA5, 0x60, 0xF0, 0x90, 0x00, 0x83, 0xE0, 0xFE, 0x90, 0xA5, 0x60, 0xE0, 0xFF, 0xB5, -0x06, 0x01, 0x22, 0xC3, 0x90, 0xA5, 0x62, 0xE0, 0x94, 0x64, 0x90, 0xA5, 0x61, 0xE0, 0x94, 0x00, -0x40, 0x0D, 0x90, 0x01, 0xC0, 0xE0, 0x44, 0x40, 0xF0, 0x90, 0xA5, 0x60, 0xE0, 0xFF, 0x22, 0x90, -0xA5, 0x61, 0xE4, 0x75, 0xF0, 0x01, 0x12, 0x46, 0xF6, 0x80, 0xC2, 0xD3, 0x10, 0xAF, 0x01, 0xC3, -0xC0, 0xD0, 0x90, 0x04, 0x1D, 0xE0, 0x60, 0x1A, 0x90, 0x05, 0x22, 0xE0, 0x54, 0x90, 0x60, 0x07, -0x90, 0x01, 0xC0, 0xE0, 0x44, 0x08, 0xF0, 0x90, 0x01, 0xC6, 0xE0, 0x30, 0xE1, 0xE4, 0x7F, 0x00, -0x80, 0x02, 0x7F, 0x01, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xFB, 0x7D, 0x08, 0x7F, 0x01, 0x90, 0xA6, -0xCF, 0xEB, 0xF0, 0xEF, 0x70, 0x06, 0xA3, 0x74, 0x03, 0xF0, 0x80, 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0xE0, 0x54, 0x7F, 0xFD, 0x7F, 0x70, 0x12, 0x3A, 0x96, 0x22, 0xD3, 0x10, -0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x51, 0xB6, 0x51, 0x68, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0xA3, -0xA4, 0xE0, 0xFF, 0x60, 0x03, 0xB4, 0x08, 0x0D, 0x71, 0x16, 0xBF, 0x01, 0x08, 0x51, 0x8E, 0x90, -0x01, 0xE5, 0xE0, 0x04, 0xF0, 0x22, 0x90, 0xA2, 0x2A, 0xE0, 0xB4, 0x03, 0x0C, 0x90, 0x00, 0x70, -0xE0, 0x44, 0x80, 0xFD, 0x7F, 0x70, 0x12, 0x3A, 0x96, 0x90, 0xA3, 0xAB, 0xE0, 0xFD, 0x7F, 0x93, -0x12, 0x3A, 0x96, 0x90, 0xA3, 0xA2, 0xE0, 0x60, 0x12, 0x90, 0x01, 0x2F, 0xE0, 0x30, 0xE7, 0x05, -0x74, 0x10, 0xF0, 0x80, 0x06, 0x90, 0x01, 0x2F, 0x74, 0x90, 0xF0, 0x90, 0x00, 0x08, 0xE0, 0x44, -0x10, 0xFD, 0x7F, 0x08, 0x12, 0x3A, 0x96, 0x7F, 0x01, 0x51, 0x10, 0x90, 0x00, 0x90, 0xE0, 0x44, -0x01, 0xFD, 0x7F, 0x90, 0x12, 0x3A, 0x96, 0x7F, 0x14, 0x7E, 0x00, 0x02, 0x3A, 0xF7, 0x90, 0x00, -0x90, 0xE0, 0x20, 0xE0, 0xF9, 0x22, 0x90, 0x02, 0x87, 0xE0, 0x60, 0x08, 0x90, 0x01, 0xB8, 0x74, -0x01, 0xF0, 0x80, 0x25, 0x90, 0x02, 0x96, 0xE0, 0x60, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x10, 0xF0, -0x80, 0x17, 0x90, 0x02, 0x86, 0xE0, 0x20, 0xE1, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x04, 0xF0, 0x80, -0x08, 0x90, 0x01, 0xB8, 0xE4, 0xF0, 0x7F, 0x01, 0x22, 0x90, 0x01, 0xB9, 0x74, 0x08, 0xF0, 0x7F, -0x00, 0x22, 0xE4, 0x90, 0xA4, 0x80, 0xF0, 0xE4, 0x90, 0xA4, 0x81, 0xF0, 0x90, 0xA4, 0x81, 0xE0, -0xFF, 0xC3, 0x94, 0x10, 0x50, 0x75, 0x90, 0xA4, 0x80, 0xE0, 0xFE, 0x24, 0x16, 0xF5, 0x82, 0xE4, -0x34, 0x99, 0xF5, 0x83, 0xE0, 0x54, 0xFE, 0xF0, 0xEF, 0x90, 0xA4, 0x81, 0xB4, 0x03, 0x1B, 0xE0, -0xFF, 0x75, 0xF0, 0x10, 0xEE, 0x90, 0x81, 0x00, 0x12, 0x48, 0x83, 0xE5, 0x82, 0x2F, 0xF5, 0x82, -0xE4, 0x35, 0x83, 0xF5, 0x83, 0x74, 0x80, 0xF0, 0x80, 0x1B, 0xE0, 0xFF, 0x90, 0xA4, 0x80, 0xE0, -0x75, 0xF0, 0x10, 0x90, 0x81, 0x00, 0x12, 0x48, 0x83, 0xE5, 0x82, 0x2F, 0xF5, 0x82, 0xE4, 0x35, -0x83, 0xF5, 0x83, 0xE4, 0xF0, 0x90, 0xA4, 0x81, 0xE0, 0xFF, 0x90, 0xA4, 0x80, 0xE0, 0x75, 0xF0, -0x08, 0x90, 0x89, 0x00, 0x12, 0x48, 0x83, 0xE5, 0x82, 0x2F, 0xF5, 0x82, 0xE4, 0x35, 0x83, 0xF5, -0x83, 0xE4, 0xF0, 0x90, 0xA4, 0x81, 0xE0, 0x04, 0xF0, 0x80, 0x81, 0x90, 0xA4, 0x80, 0xE0, 0x04, -0xF0, 0xE0, 0x64, 0x80, 0x60, 0x02, 0x61, 0x57, 0xE4, 0x90, 0xAF, 0x7D, 0xF0, 0x90, 0x94, 0x91, -0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0xE4, 0x90, 0xA4, 0x80, 0xF0, 0x90, 0xA4, 0x80, 0xE0, -0xFF, 0xC3, 0x94, 0x80, 0x40, 0x02, 0xA1, 0x5F, 0xE4, 0x90, 0xA4, 0x82, 0xF0, 0x90, 0xA4, 0x82, -0xE0, 0xFE, 0xC3, 0x94, 0x05, 0x50, 0x20, 0x90, 0xA4, 0x80, 0xE0, 0x75, 0xF0, 0x0A, 0x90, 0x8D, -0x01, 0x12, 0x48, 0x83, 0x75, 0xF0, 0x02, 0xEE, 0x12, 0x48, 0x83, 0xE4, 0xF0, 0xA3, 0xF0, 0x90, -0xA4, 0x82, 0xE0, 0x04, 0xF0, 0x80, 0xD6, 0xE4, 0x90, 0x9C, 0x26, 0xF0, 0x90, 0xA4, 0x80, 0xE0, -0xFE, 0x24, 0x26, 0xF5, 0x82, 0xE4, 0x34, 0xA0, 0xF5, 0x83, 0x74, 0x3F, 0xF0, 0x74, 0x26, 0x2E, -0xF5, 0x82, 0xE4, 0x34, 0x9C, 0xF5, 0x83, 0xE4, 0xF0, 0x74, 0x01, 0x2E, 0xF5, 0x82, 0xE4, 0x34, -0x93, 0xF5, 0x83, 0x74, 0xC0, 0xF0, 0xEE, 0x25, 0xE0, 0x24, 0x01, 0xF5, 0x82, 0xE4, 0x34, 0x92, -0xF5, 0x83, 0xE4, 0xF0, 0xA3, 0xF0, 0x74, 0x16, 0x2E, 0xF5, 0x82, 0xE4, 0x34, 0x98, 0xF5, 0x83, -0xE4, 0xF0, 0xEE, 0x25, 0xE0, 0x24, 0xA6, 0xF5, 0x82, 0xE4, 0x34, 0x9C, 0xF5, 0x83, 0xE4, 0xF0, -0xA3, 0xF0, 0xEE, 0x25, 0xE0, 0x24, 0xA6, 0xF5, 0x82, 0xE4, 0x34, 0x9D, 0xF5, 0x83, 0xE4, 0xF0, -0xA3, 0xF0, 0x75, 0xF0, 0x04, 0xEE, 0x90, 0x96, 0x16, 0x12, 0x48, 0x83, 0x74, 0x3F, 0xF0, 0x75, -0xF0, 0x04, 0xEE, 0x90, 0x96, 0x17, 0x12, 0x48, 0x83, 0x74, 0x03, 0xF0, 0x75, 0xF0, 0x04, 0xEE, -0x90, 0x96, 0x18, 0x12, 0x48, 0x83, 0xE0, 0x54, 0xE0, 0x44, 0x09, 0xF0, 0x90, 0xA4, 0x80, 0xE0, -0xFE, 0x75, 0xF0, 0x04, 0x90, 0x96, 0x19, 0x12, 0x48, 0x83, 0xE0, 0x54, 0xF3, 0xF0, 0x75, 0xF0, -0x04, 0xEE, 0x90, 0x96, 0x19, 0x12, 0x48, 0x83, 0xE0, 0x54, 0xFC, 0xF0, 0x90, 0xA4, 0x80, 0xE0, -0xFE, 0x75, 0xF0, 0x04, 0x90, 0x96, 0x18, 0x12, 0x48, 0x83, 0xE0, 0x44, 0x20, 0xF0, 0x75, 0xF0, -0x04, 0xEE, 0x90, 0x96, 0x19, 0x12, 0x48, 0x83, 0xE0, 0x54, 0xCF, 0xF0, 0x90, 0xA4, 0x80, 0xE0, -0xFE, 0x75, 0xF0, 0x04, 0x90, 0x96, 0x19, 0x12, 0x48, 0x83, 0xE0, 0x44, 0x40, 0xF0, 0x75, 0xF0, -0x04, 0xEE, 0x90, 0x96, 0x19, 0x12, 0x48, 0x83, 0xE0, 0x54, 0x7F, 0xF0, 0x90, 0xA4, 0x80, 0xE0, -0xFE, 0x75, 0xF0, 0x04, 0x90, 0x96, 0x16, 0x12, 0x48, 0x83, 0xE0, 0xFD, 0x75, 0xF0, 0x10, 0xEE, -0x90, 0x81, 0x00, 0x12, 0x48, 0x83, 0xED, 0xF0, 0x90, 0xA4, 0x80, 0xE0, 0x24, 0x16, 0xF5, 0x82, -0xE4, 0x34, 0x99, 0xF5, 0x83, 0xE4, 0xF0, 0x90, 0xA4, 0x80, 0xE0, 0x04, 0xF0, 0x61, 0xFC, 0x90, -0x04, 0x49, 0x74, 0xF0, 0xF0, 0xA3, 0xE4, 0xF0, 0xA3, 0x74, 0xFF, 0xF0, 0x90, 0x04, 0x33, 0x74, -0x02, 0xF0, 0xA3, 0x74, 0x04, 0xF0, 0xA3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5, 0x83, 0xEF, -0xF0, 0x74, 0xA6, 0x25, 0x19, 0xF5, 0x82, 0xE4, 0x34, 0x9E, 0xF5, 0x83, 0x74, 0xFF, 0xF0, 0x80, -0x1C, 0x90, 0xA4, 0xAC, 0xE0, 0xFF, 0x74, 0xA6, 0x25, 0x19, 0xF5, 0x82, 0xE4, 0x34, 0xA1, 0xF5, -0x83, 0xEF, 0xF0, 0x80, 0x08, 0x90, 0xA4, 0xAE, 0xE0, 0x90, 0xA4, 0xA6, 0xF0, 0x90, 0xA4, 0xA6, -0xE0, 0xFD, 0x90, 0xA4, 0xA8, 0xE0, 0x90, 0xA6, 0x8D, 0xF0, 0x7B, 0x01, 0xAF, 0x19, 0xF1, 0xCF, -0x90, 0xA4, 0xA6, 0xE0, 0xFF, 0x22, 0x75, 0xF0, 0x04, 0xEF, 0x90, 0x96, 0x19, 0x12, 0x48, 0x83, -0xE0, 0xC4, 0x54, 0x03, 0x70, 0x2E, 0xED, 0xC3, 0x94, 0x14, 0x40, 0x15, 0xED, 0xD3, 0x94, 0x18, -0x50, 0x0F, 0x90, 0x04, 0x33, 0x74, 0x06, 0xF0, 0xA3, 0x04, 0xF0, 0xA3, 0x04, 0xF0, 0xA3, 0x80, -0x0F, 0x90, 0x04, 0x33, 0x74, 0x02, 0xF0, 0xA3, 0x74, 0x04, 0xF0, 0xA3, 0x04, 0xF0, 0xA3, 0x04, -0xF0, 0xA3, 0x04, 0xF0, 0x22, 0xE4, 0xFE, 0x74, 0x96, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x95, 0xF5, -0x83, 0xE0, 0xFC, 0xB4, 0x05, 0x09, 0xED, 0xC3, 0x94, 0x3B, 0x40, 0x60, 0x0E, 0x80, 0x5D, 0xEC, -0xB4, 0x04, 0x0A, 0xED, 0xC3, 0x94, 0x31, 0x40, 0x53, 0x7E, 0x01, 0x80, 0x4F, 0x74, 0x96, 0x2F, -0xF5, 0x82, 0xE4, 0x34, 0x95, 0xF5, 0x83, 0xE0, 0xFC, 0xB4, 0x03, 0x0A, 0xED, 0xC3, 0x94, 0x19, -0x40, 0x3A, 0x7E, 0x01, 0x80, 0x36, 0xEC, 0xB4, 0x02, 0x0A, 0xED, 0xC3, 0x94, 0x11, 0x40, 0x2C, -0x7E, 0x01, 0x80, 0x28, 0x74, 0x96, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x95, 0xF5, 0x83, 0xE0, 0xFC, -0xB4, 0x01, 0x0A, 0xED, 0xC3, 0x94, 0x0A, 0x40, 0x13, 0x7E, 0x01, 0x80, 0x0F, 0xEC, 0x70, 0x0A, -0xED, 0xC3, 0x94, 0x03, 0x40, 0x06, 0x7E, 0x01, 0x80, 0x02, 0xE4, 0xFE, 0xAF, 0x06, 0x22, 0xD3, -0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0xA6, 0x8A, 0xEF, 0xF0, 0xA3, 0xED, 0xF0, 0xA3, 0xEB, -0xF0, 0xE4, 0x90, 0xA6, 0x93, 0xF0, 0x90, 0xA6, 0x8A, 0xE0, 0xFF, 0x13, 0x13, 0x13, 0x54, 0x1F, -0x90, 0xA6, 0x8E, 0xF0, 0xEF, 0x54, 0x07, 0x90, 0xA6, 0x90, 0xF0, 0x90, 0xA6, 0x8A, 0xE0, 0x75, -0xF0, 0x10, 0x90, 0x81, 0x01, 0x12, 0x48, 0x83, 0xE0, 0x90, 0xA6, 0x91, 0xF0, 0x75, 0xF0, 0x04, -0xEF, 0x90, 0x96, 0x16, 0x12, 0x48, 0x83, 0xE0, 0x54, 0x7F, 0x90, 0xA6, 0x94, 0xF0, 0x90, 0xA6, -0x8A, 0xE0, 0x75, 0xF0, 0x04, 0x90, 0x96, 0x17, 0x12, 0x48, 0x83, 0xE0, 0x90, 0xA6, 0x95, 0xF0, -0xED, 0x54, 0x7F, 0x90, 0xA6, 0x8F, 0xF0, 0xEB, 0x70, 0x40, 0xE0, 0xFB, 0x25, 0xE0, 0x24, 0x2D, -0xF5, 0x82, 0xE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0, 0x80, 0x6C, 0x90, 0xA6, -0x8A, 0xE0, 0xFF, 0x24, 0x16, 0xF5, 0x82, 0xE4, 0x34, 0x99, 0xF5, 0x83, 0xE0, 0x90, 0x04, 0xCF, -0x30, 0xE0, 0x05, 0x74, 0x20, 0xF0, 0x80, 0x02, 0xE4, 0xF0, 0x90, 0xA6, 0x8E, 0xE0, 0x24, 0x01, -0xF5, 0x82, 0xE4, 0x34, 0x94, 0xF5, 0x83, 0xC0, 0x83, 0xC0, 0x82, 0xE0, 0xFE, 0x90, 0xA6, 0x90, -0xE0, 0xFD, 0x74, 0x01, 0xA8, 0x05, 0x08, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0x4E, 0xD0, 0x82, -0xD0, 0x83, 0xF0, 0x75, 0xF0, 0x10, 0xEF, 0x90, 0x81, 0x01, 0x12, 0x48, 0x83, 0xE0, 0x54, 0x07, -0xFF, 0x90, 0xA6, 0x91, 0xF0, 0x90, 0xA6, 0x8F, 0xE0, 0x90, 0x44, 0xE1, 0x93, 0x33, 0x33, 0x33, -0x54, 0xF8, 0x4F, 0x90, 0xA6, 0x91, 0xF0, 0x44, 0x80, 0xF0, 0x90, 0xA6, 0x8B, 0xE0, 0xFF, 0x90, -0xA6, 0x8A, 0xE0, 0xFE, 0x75, 0xF0, 0x10, 0x90, 0x81, 0x00, 0x12, 0x48, 0x83, 0xEF, 0xF0, 0x90, -0xA6, 0x91, 0xE0, 0xFF, 0x75, 0xF0, 0x10, 0xEE, 0x90, 0x81, 0x01, 0x12, 0x48, 0x83, 0xEF, 0xF0, -0x75, 0xF0, 0x10, 0xEE, 0x90, 0x81, 0x05, 0x12, 0x48, 0x83, 0xE0, 0x54, 0xFC, 0xFF, 0x90, 0xA6, -0x8D, 0xE0, 0x54, 0x03, 0x4F, 0xFE, 0x90, 0xA6, 0x8A, 0xE0, 0xFF, 0x75, 0xF0, 0x10, 0x90, 0x81, -0x05, 0x12, 0x48, 0x83, 0xEE, 0xF0, 0x7D, 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90, 0xA4, 0x97, 0xF0, 0xA3, 0xEF, -0xF0, 0x75, 0xF0, 0x10, 0xE5, 0x0F, 0x90, 0x81, 0x00, 0x12, 0x48, 0x83, 0xE0, 0x90, 0xA4, 0x90, -0xF0, 0x90, 0xA4, 0x8E, 0xF0, 0x54, 0x7F, 0xA3, 0xF0, 0x75, 0xF0, 0x04, 0xE5, 0x0F, 0x90, 0x96, -0x16, 0x12, 0x48, 0x83, 0xE0, 0x90, 0xA4, 0x9A, 0xF0, 0x75, 0xF0, 0x04, 0xE5, 0x0F, 0x90, 0x96, -0x19, 0x12, 0x48, 0x83, 0xE0, 0x13, 0x13, 0x54, 0x03, 0x90, 0xA4, 0x9C, 0xF0, 0x74, 0xA6, 0x25, -0x0F, 0xF5, 0x82, 0xE4, 0x34, 0x9F, 0xF5, 0x83, 0xE0, 0xC3, 0x94, 0x05, 0x40, 0x02, 0xE1, 0x5D, -0x90, 0xA4, 0x9A, 0xE0, 0xFF, 0x90, 0xA4, 0x8F, 0xE0, 0x9F, 0x40, 0x13, 0x90, 0xA4, 0x9A, 0xE0, -0x90, 0xA4, 0x8F, 0xF0, 0x90, 0xA4, 0x8E, 0xE0, 0x54, 0x80, 0xFE, 0xF0, 0xEF, 0x4E, 0xF0, 0x90, -0xA4, 0x8F, 0xE0, 0xFF, 0x90, 0x42, 0x89, 0x93, 0xFE, 0x74, 0x96, 0x25, 0x0F, 0xF5, 0x82, 0xE4, -0x34, 0x99, 0xF5, 0x83, 0xE0, 0xC3, 0x9E, 0x40, 0x06, 0xEF, 0x90, 0x41, 0xE1, 0x80, 0x07, 0x90, -0xA4, 0x8F, 0xE0, 0x90, 0x42, 0x35, 0x93, 0x90, 0xA4, 0x99, 0xF0, 0x90, 0xA4, 0x99, 0xE0, 0x75, -0xF0, 0x06, 0xA4, 0x24, 0x3F, 0xF9, 0x74, 0x41, 0x35, 0xF0, 0x75, 0x10, 0xFF, 0xF5, 0x11, 0x89, -0x12, 0x90, 0xA4, 0x8E, 0xE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, 0xF5, 0x82, 0xE4, 0x34, 0x9A, 0xF5, 0x83, -0x74, 0xFF, 0xF5, 0xF0, 0x12, 0x46, 0xF6, 0x90, 0xA4, 0x8F, 0xE0, 0x75, 0xF0, 0x04, 0x90, 0x42, -0xDD, 0x12, 0x48, 0x83, 0x12, 0x48, 0x57, 0xE5, 0x0F, 0x25, 0xE0, 0x24, 0x95, 0xF5, 0x82, 0xE4, -0x34, 0x94, 0xF5, 0x83, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0xE5, 0x0F, 0x25, 0xE0, 0x24, 0xA6, 0xF5, -0x82, 0xE4, 0x34, 0x9A, 0xF5, 0x83, 0xE0, 0xFE, 0xA3, 0xE0, 0x4E, 0x70, 0x25, 0xAF, 0x0F, 0x12, -0x80, 0x1A, 0x80, 0x1E, 0x90, 0xA4, 0x8F, 0xE0, 0x25, 0xE0, 0x24, 0x2D, 0xF5, 0x82, 0xE4, 0x34, -0x44, 0xF5, 0x83, 0xD3, 0x74, 0x01, 0x93, 0x95, 0x17, 0xE4, 0x93, 0x95, 0x16, 0x40, 0x03, 0x12, -0x83, 0x92, 0xE5, 0x0F, 0x25, 0xE0, 0x24, 0x95, 0xF5, 0x82, 0xE4, 0x34, 0x94, 0xF5, 0x83, 0xA3, -0xE0, 0x90, 0xA6, 0x46, 0xF0, 0x90, 0xA4, 0x8E, 0xE0, 0x90, 0xA6, 0x45, 0xF0, 0xAB, 0x0F, 0xE4, -0xFD, 0xFF, 0x12, 0x7F, 0x9F, 0xE4, 0xF5, 0x16, 0xF5, 0x17, 0x02, 0x92, 0x86, 0x74, 0xA6, 0x25, -0x0F, 0xF5, 0x82, 0xE4, 0x34, 0x9F, 0xF5, 0x83, 0xE0, 0xFB, 0x64, 0x05, 0x60, 0x03, 0x02, 0x90, -0xEA, 0x90, 0xA4, 0x8F, 0xE0, 0xFD, 0xAF, 0x0F, 0x12, 0x87, 0x55, 0x74, 0x16, 0x25, 0x0F, 0xF5, -0x82, 0xE4, 0x34, 0x9A, 0xF5, 0x83, 0xEF, 0xF0, 0x75, 0xF0, 0x10, 0xE5, 0x0F, 0x90, 0x81, 0x01, -0x12, 0x48, 0x83, 0xE0, 0x54, 0x07, 0x90, 0xA4, 0x9E, 0xF0, 0x74, 0x96, 0x25, 0x0F, 0xF5, 0x82, -0xE4, 0x34, 0x99, 0xF5, 0x83, 0xE0, 0xFF, 0xC3, 0x94, 0x30, 0x50, 0x14, 0xE4, 0x90, 0xA4, 0x9E, -0xF0, 0x74, 0xA6, 0x25, 0x0F, 0xF5, 0x82, 0xE4, 0x34, 0x9F, 0xF5, 0x83, 0xE4, 0x02, 0x90, 0x67, -0x74, 0x16, 0x25, 0x0F, 0xF5, 0x82, 0xE4, 0x34, 0x9A, 0xF5, 0x83, 0xE0, 0x64, 0x01, 0x60, 0x03, -0x02, 0x90, 0x90, 0x74, 0x26, 0x25, 0x0F, 0xF5, 0x82, 0xE4, 0x34, 0x9C, 0xF5, 0x83, 0xE0, 0x64, -0x0A, 0x60, 0x51, 0xEF, 0x24, 0x05, 0xFF, 0xE4, 0x33, 0xFE, 0x74, 0x81, 0x25, 0x0F, 0xF5, 0x82, -0xE4, 0x34, 0x93, 0xF5, 0x83, 0xE0, 0xFD, 0xD3, 0x9F, 0xEE, 0x64, 0x80, 0xF8, 0x74, 0x80, 0x98, -0x50, 0x32, 0xED, 0x24, 0x05, 0xFF, 0xE4, 0x33, 0xFE, 0x74, 0x96, 0x25, 0x0F, 0xF5, 0x82, 0xE4, -0x34, 0x99, 0xF5, 0x83, 0xE0, 0xD3, 0x9F, 0xEE, 0x64, 0x80, 0xF8, 0x74, 0x80, 0x98, 0x50, 0x14, -0x74, 0x26, 0x25, 0x0F, 0xF5, 0x82, 0xE4, 0x34, 0xA0, 0xF5, 0x83, 0xE0, 0xFF, 0x90, 0xA4, 0x8F, -0xE0, 0x6F, 0x60, 0x3F, 0x90, 0xA4, 0x9E, 0xE0, 0xFF, 0x70, 0x04, 0x04, 0xF0, 0x80, 0x0F, 0xEF, -0x90, 0xA4, 0x9E, 0xB4, 0x01, 0x05, 0x74, 0x03, 0xF0, 0x80, 0x03, 0x74, 0x05, 0xF0, 0x74, 0x96, -0x25, 0x0F, 0xF5, 0x82, 0xE4, 0x34, 0x99, 0xF5, 0x83, 0xE0, 0xFF, 0x74, 0x81, 0x25, 0x0F, 0xF5, -0x82, 0xE4, 0x34, 0x93, 0xF5, 0x83, 0xEF, 0xF0, 0x74, 0x26, 0x25, 0x0F, 0xF5, 0x82, 0xE4, 0x34, -0x9C, 0x80, 0x2B, 0x74, 0xA6, 0x25, 0x0F, 0xF5, 0x82, 0xE4, 0x34, 0x9F, 0xF5, 0x83, 0xE4, 0xF0, -0x74, 0x26, 0x25, 0x0F, 0xF5, 0x82, 0xE4, 0x34, 0x9C, 0xF5, 0x83, 0xE0, 0x04, 0xF0, 0x80, 0x12, -0xE4, 0x90, 0xA4, 0x9E, 0xF0, 0x74, 0xA6, 0x25, 0x0F, 0xF5, 0x82, 0xE4, 0x34, 0x9F, 0xF5, 0x83, -0xE4, 0xF0, 0x90, 0xA4, 0x8F, 0xE0, 0xFF, 0x74, 0x26, 0x25, 0x0F, 0xF5, 0x82, 0xE4, 0x34, 0xA0, -0xF5, 0x83, 0xEF, 0xF0, 0x75, 0xF0, 0x04, 0xE5, 0x0F, 0x90, 0x96, 0x19, 0x12, 0x48, 0x83, 0xE0, -0xC4, 0x13, 0x13, 0x54, 0x03, 0x20, 0xE0, 0x02, 0x41, 0x5C, 0x74, 0x26, 0x25, 0x0F, 0xF5, 0x82, -0xE4, 0x34, 0x9C, 0xF5, 0x83, 0xE4, 0xF0, 0x90, 0xA4, 0x9E, 0xF0, 0x74, 0xA6, 0x25, 0x0F, 0xF5, -0x82, 0xE4, 0x34, 0x9F, 0xF5, 0x83, 0xE4, 0xF0, 0x41, 0x5C, 0xEB, 0x64, 0x06, 0x60, 0x02, 0x41, -0x86, 0xF5, 0x16, 0xF5, 0x17, 0x75, 0xF0, 0x10, 0xE5, 0x0F, 0x90, 0x81, 0x01, 0x12, 0x48, 0x83, -0xE0, 0x54, 0x07, 0x90, 0xA4, 0x9E, 0xF0, 0x90, 0xA4, 0x91, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0xD3, -0x94, 0xE8, 0xEE, 0x94, 0x03, 0x40, 0x08, 0x90, 0xA4, 0x9B, 0x74, 0x05, 0xF0, 0x80, 0x16, 0xD3, -0xEF, 0x94, 0xFA, 0xEE, 0x94, 0x00, 0x40, 0x08, 0x90, 0xA4, 0x9B, 0x74, 0x02, 0xF0, 0x80, 0x05, -0xE4, 0x90, 0xA4, 0x9B, 0xF0, 0x90, 0xA4, 0x9B, 0xE0, 0xFD, 0xEF, 0xA8, 0x05, 0x08, 0x80, 0x05, -0xCE, 0xC3, 0x13, 0xCE, 0x13, 0xD8, 0xF9, 0xFF, 0x90, 0x45, 0x8E, 0xE4, 0x93, 0xFD, 0x7C, 0x00, -0x12, 0x26, 0x98, 0x90, 0xA4, 0x9F, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0xE4, 0xF5, 0x18, 0xAB, 0x13, -0xAA, 0x14, 0xA9, 0x15, 0x75, 0xF0, 0x02, 0xE5, 0x18, 0xA4, 0xF5, 0x82, 0x85, 0xF0, 0x83, 0x12, -0x47, 0x37, 0xFF, 0xAE, 0xF0, 0x90, 0xA4, 0x9B, 0xE0, 0xFD, 0xEF, 0xA8, 0x05, 0x08, 0x80, 0x05, -0xCE, 0xC3, 0x13, 0xCE, 0x13, 0xD8, 0xF9, 0xFF, 0xE5, 0x18, 0x90, 0x45, 0x89, 0x93, 0xFD, 0x7C, -0x00, 0x12, 0x26, 0x98, 0xEF, 0x25, 0x17, 0xF5, 0x17, 0xEE, 0x35, 0x16, 0xF5, 0x16, 0xC3, 0x90, -0xA4, 0xA0, 0xE0, 0x95, 0x17, 0x90, 0xA4, 0x9F, 0xE0, 0x95, 0x16, 0x40, 0x07, 0x05, 0x18, 0xE5, -0x18, 0xB4, 0x05, 0xAA, 0xE5, 0x18, 0xC3, 0x13, 0xF5, 0x18, 0x90, 0xA4, 0x9E, 0xE0, 0x24, 0x01, -0xFF, 0xE4, 0x33, 0xA2, 0xE7, 0x13, 0xEF, 0x13, 0x90, 0xA4, 0xA2, 0xF0, 0xD3, 0x95, 0x18, 0x40, -0x06, 0xE0, 0x95, 0x18, 0xF0, 0x80, 0x05, 0xE4, 0x90, 0xA4, 0xA2, 0xF0, 0x74, 0x01, 0x25, 0x0F, -0xF5, 0x82, 0xE4, 0x34, 0x93, 0xF5, 0x83, 0xE0, 0xC3, 0x13, 0xFF, 0x90, 0xA4, 0xA2, 0xE0, 0xC4, -0x33, 0x54, 0xE0, 0x2F, 0x04, 0xFF, 0x74, 0x01, 0x25, 0x0F, 0xF5, 0x82, 0xE4, 0x34, 0x93, 0xF5, -0x83, 0xEF, 0xF0, 0x74, 0x01, 0x25, 0x0F, 0xF5, 0x82, 0xE4, 0x34, 0x93, 0xF5, 0x83, 0xE0, 0xC3, -0x94, 0xC0, 0x40, 0x0E, 0x74, 0x01, 0x25, 0x0F, 0xF5, 0x82, 0xE4, 0x34, 0x93, 0xF5, 0x83, 0x74, -0xC0, 0xF0, 0x74, 0x01, 0x25, 0x0F, 0xF5, 0x82, 0xE4, 0x34, 0x93, 0xF5, 0x83, 0xE0, 0xC4, 0x13, -0x13, 0x54, 0x03, 0x90, 0xA4, 0xA2, 0xF0, 0xE0, 0x25, 0xE0, 0xF0, 0x70, 0x02, 0x80, 0x05, 0x90, -0xA4, 0xA2, 0xE0, 0x14, 0x90, 0xA4, 0x9E, 0xF0, 0xD3, 0x90, 0xA4, 0x94, 0xE0, 0x94, 0x03, 0x90, -0xA4, 0x93, 0xE0, 0x94, 0x00, 0x40, 0x05, 0xE4, 0x90, 0xA4, 0x9E, 0xF0, 0x75, 0xF0, 0x10, 0xE5, -0x0F, 0x90, 0x81, 0x01, 0x12, 0x48, 0x83, 0xE0, 0x54, 0xF8, 0xFF, 0x90, 0xA4, 0xA1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0xEA, 0x9C, 0xE5, 0x0F, 0x50, 0x13, 0x25, 0xE0, 0x24, 0xA6, 0xF5, 0x82, 0xE4, -0x34, 0x9D, 0xF5, 0x83, 0xEE, 0x8F, 0xF0, 0x12, 0x46, 0xF6, 0x80, 0x10, 0x25, 0xE0, 0x24, 0xA6, -0xF5, 0x82, 0xE4, 0x34, 0x9D, 0xF5, 0x83, 0x74, 0xFF, 0xF0, 0xA3, 0xF0, 0x90, 0xA4, 0x97, 0xE0, -0xFE, 0xA3, 0xE0, 0xFB, 0xC3, 0x74, 0xFF, 0x9B, 0xFF, 0x74, 0xFF, 0x9E, 0xFE, 0x74, 0xFF, 0x94, -0x00, 0xFD, 0x74, 0xFF, 0x94, 0x00, 0xFC, 0x90, 0x94, 0x91, 0x12, 0x48, 0x67, 0xD3, 0x12, 0x47, -0xAC, 0x90, 0x94, 0x91, 0x50, 0x19, 0x12, 0x48, 0x67, 0x90, 0xA4, 0x97, 0xE0, 0xFE, 0xA3, 0xE0, -0xFF, 0xE4, 0xFC, 0xFD, 0x12, 0x47, 0x6F, 0x90, 0x94, 0x91, 0x12, 0x27, 0x48, 0x80, 0x07, 0x12, -0x27, 0x54, 0xFF, 0xFF, 0xFF, 0xFF, 0xE4, 0xFD, 0xAF, 0x0F, 0x12, 0x89, 0xBF, 0x05, 0x0F, 0xE5, -0x0F, 0xC3, 0x94, 0x80, 0x50, 0x03, 0x02, 0x8A, 0x59, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, -0xD0, 0x8F, 0x74, 0x75, 0xF0, 0x04, 0xEF, 0x90, 0x96, 0x18, 0x12, 0x48, 0x83, 0xE0, 0x54, 0x1F, -0x90, 0xA6, 0xA2, 0xF0, 0x24, 0xF1, 0x50, 0x02, 0x81, 0x4C, 0xE4, 0xF5, 0x75, 0x75, 0xF0, 0x08, -0xE5, 0x74, 0x90, 0x89, 0x00, 0x12, 0x48, 0x83, 0xE5, 0x82, 0x25, 0x75, 0xF5, 0x82, 0xE4, 0x35, -0x83, 0xF5, 0x83, 0xE0, 0xFF, 0x90, 0xA6, 0xA2, 0xE0, 0x75, 0xF0, 0x07, 0xA4, 0x24, 0x50, 0xF5, -0x82, 0xE4, 0x34, 0x40, 0xF5, 0x83, 0xE5, 0x82, 0x25, 0x75, 0xF5, 0x82, 0xE4, 0x35, 0x83, 0xF5, -0x83, 0xE4, 0x93, 0xFE, 0xEF, 0x5E, 0x90, 0xA6, 0xA4, 0xF0, 0x75, 0xF0, 0x04, 0xE5, 0x74, 0x90, -0x96, 0x19, 0x12, 0x48, 0x83, 0xE0, 0x54, 0x03, 0xFF, 0xBF, 0x02, 0x0B, 0xE5, 0x75, 0x70, 0x07, -0x90, 0xA6, 0xA4, 0xE0, 0x54, 0xF0, 0xF0, 0x90, 0xA6, 0xA4, 0xE0, 0xFF, 0x75, 0xF0, 0x08, 0xE5, -0x74, 0x90, 0x89, 0x00, 0x12, 0x48, 0x83, 0xE5, 0x82, 0x25, 0x75, 0xF5, 0x82, 0xE4, 0x35, 0x83, -0xF5, 0x83, 0xEF, 0xF0, 0x05, 0x75, 0xE5, 0x75, 0x64, 0x07, 0x70, 0x81, 0x75, 0xF0, 0x04, 0xE5, -0x74, 0x90, 0x96, 0x19, 0x12, 0x48, 0x83, 0xE0, 0xFF, 0xC4, 0x54, 0x03, 0xFD, 0xE4, 0x90, 0xA6, -0xA0, 0xF0, 0x7C, 0x06, 0x75, 0xF0, 0x08, 0xE5, 0x74, 0x90, 0x89, 0x00, 0xBC, 0x06, 0x12, 0x12, -0x48, 0x83, 0xE5, 0x82, 0x2C, 0xF5, 0x82, 0xE4, 0x35, 0x83, 0xF5, 0x83, 0xE0, 0x54, 0x0F, 0x80, -0x0E, 0x12, 0x48, 0x83, 0xE5, 0x82, 0x2C, 0xF5, 0x82, 0xE4, 0x35, 0x83, 0xF5, 0x83, 0xE0, 0x90, -0xA6, 0xA3, 0xF0, 0x90, 0xA6, 0xA3, 0xE0, 0x60, 0x40, 0x75, 0x75, 0x07, 0x74, 0x01, 0x7E, 0x00, -0xA8, 0x75, 0x08, 0x80, 0x05, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, 0xF9, 0xFF, 0x90, 0xA6, 0xA3, -0xE0, 0xFB, 0xEF, 0x5B, 0x60, 0x1A, 0xEC, 0x75, 0xF0, 0x08, 0xA4, 0x25, 0x75, 0x90, 0xA6, 0xA0, -0xF0, 0xED, 0x60, 0x1F, 0xE0, 0xD3, 0x94, 0x0B, 0x40, 0x19, 0xE0, 0x24, 0x20, 0xF0, 0x80, 0x13, -0x15, 0x75, 0xE5, 0x75, 0xC3, 0x94, 0x00, 0x50, 0xC3, 0xEC, 0x60, 0x07, 0x1C, 0xEC, 0xC3, 0x94, -0x00, 0x50, 0x81, 0xE4, 0x90, 0xA6, 0xA1, 0xF0, 0xFC, 0x75, 0xF0, 0x08, 0xE5, 0x74, 0x90, 0x89, -0x00, 0xBC, 0x06, 0x12, 0x12, 0x48, 0x83, 0xE5, 0x82, 0x2C, 0xF5, 0x82, 0xE4, 0x35, 0x83, 0xF5, -0x83, 0xE0, 0x54, 0x0F, 0x80, 0x0E, 0x12, 0x48, 0x83, 0xE5, 0x82, 0x2C, 0xF5, 0x82, 0xE4, 0x35, -0x83, 0xF5, 0x83, 0xE0, 0x90, 0xA6, 0xA3, 0xF0, 0x90, 0xA6, 0xA3, 0xE0, 0x60, 0x3E, 0xE4, 0xF5, -0x75, 0x74, 0x01, 0x7E, 0x00, 0xA8, 0x75, 0x08, 0x80, 0x05, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, -0xF9, 0xFF, 0x90, 0xA6, 0xA3, 0xE0, 0xFB, 0xEF, 0x5B, 0x60, 0x1A, 0xEC, 0x75, 0xF0, 0x08, 0xA4, -0x25, 0x75, 0x90, 0xA6, 0xA1, 0xF0, 0xED, 0x60, 0x19, 0xE0, 0xD3, 0x94, 0x0B, 0x40, 0x13, 0xE0, -0x24, 0x20, 0xF0, 0x80, 0x0D, 0x05, 0x75, 0xE5, 0x75, 0xB4, 0x08, 0xC5, 0x0C, 0xEC, 0x64, 0x07, -0x70, 0x87, 0x90, 0xA6, 0xA0, 0xE0, 0xFF, 0x75, 0xF0, 0x04, 0xE5, 0x74, 0x90, 0x96, 0x16, 0x12, -0x48, 0x83, 0xEF, 0xF0, 0x90, 0xA6, 0xA1, 0xE0, 0xFE, 0x75, 0xF0, 0x04, 0xE5, 0x74, 0x90, 0x96, -0x17, 0x12, 0x48, 0x83, 0xEE, 0xF0, 0x75, 0xF0, 0x10, 0xE5, 0x74, 0x90, 0x81, 0x00, 0x12, 0x48, -0x83, 0xE0, 0xFC, 0x54, 0x7F, 0xFD, 0xEC, 0x54, 0x80, 0xFC, 0xED, 0xD3, 0x9F, 0x40, 0x05, 0x90, -0xA6, 0xA0, 0x80, 0x08, 0xED, 0xC3, 0x9E, 0x50, 0x06, 0x90, 0xA6, 0xA1, 0xE0, 0x4C, 0xFD, 0x74, -0x26, 0x25, 0x74, 0xF5, 0x82, 0xE4, 0x34, 0xA0, 0xF5, 0x83, 0xED, 0xF0, 0x75, 0xF0, 0x04, 0xE5, -0x74, 0x90, 0x96, 0x19, 0x12, 0x48, 0x83, 0xE0, 0x13, 0x13, 0x54, 0x03, 0x90, 0xA6, 0x8D, 0xF0, -0xE4, 0xFB, 0xAF, 0x74, 0x12, 0x87, 0xCF, 0x75, 0xF0, 0x10, 0xE5, 0x74, 0x90, 0x81, 0x03, 0x12, -0x48, 0x83, 0xE4, 0xF0, 0x90, 0xA6, 0xA0, 0xE0, 0xFF, 0xC3, 0x94, 0x36, 0x40, 0x10, 0x74, 0x96, -0x25, 0x74, 0xF5, 0x82, 0xE4, 0x34, 0x95, 0xF5, 0x83, 0x74, 0x05, 0xF0, 0x80, 0x6A, 0xEF, 0xC3, -0x94, 0x2C, 0x40, 0x10, 0x74, 0x96, 0x25, 0x74, 0xF5, 0x82, 0xE4, 0x34, 0x95, 0xF5, 0x83, 0x74, -0x04, 0xF0, 0x80, 0x54, 0x90, 0xA6, 0xA0, 0xE0, 0xFF, 0xC3, 0x94, 0x14, 0x40, 0x10, 0x74, 0x96, -0x25, 0x74, 0xF5, 0x82, 0xE4, 0x34, 0x95, 0xF5, 0x83, 0x74, 0x03, 0xF0, 0x80, 0x3A, 0xEF, 0xC3, -0x94, 0x0C, 0x40, 0x10, 0x74, 0x96, 0x25, 0x74, 0xF5, 0x82, 0xE4, 0x34, 0x95, 0xF5, 0x83, 0x74, -0x02, 0xF0, 0x80, 0x24, 0x90, 0xA6, 0xA0, 0xE0, 0xC3, 0x94, 0x04, 0x74, 0x96, 0x40, 0x0E, 0x25, -0x74, 0xF5, 0x82, 0xE4, 0x34, 0x95, 0xF5, 0x83, 0x74, 0x01, 0xF0, 0x80, 0x0B, 0x25, 0x74, 0xF5, -0x82, 0xE4, 0x34, 0x95, 0xF5, 0x83, 0xE4, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0xA4, 0x91, -0x12, 0x48, 0x98, 0x12, 0x26, 0x1E, 0x54, 0x7F, 0x90, 0xA4, 0x94, 0xF0, 0x90, 0x00, 0x01, 0x12, -0x26, 0x37, 0xFF, 0x54, 0x1F, 0x90, 0xA4, 0x96, 0xF0, 0xEF, 0x54, 0x80, 0xC4, 0x13, 0x13, 0x13, -0x54, 0x01, 0x90, 0xA4, 0x95, 0xF0, 0x90, 0x00, 0x02, 0x12, 0x26, 0x37, 0xFF, 0x54, 0x03, 0x90, -0xA4, 0x97, 0xF0, 0xEF, 0x54, 0x30, 0xC4, 0x54, 0x0F, 0x90, 0xA4, 0x9A, 0xF0, 0x90, 0x00, 0x02, -0x12, 0x26, 0x37, 0xFF, 0x54, 0x40, 0xC4, 0x13, 0x13, 0x54, 0x03, 0x90, 0xA4, 0x98, 0xF0, 0xEF, -0x54, 0x80, 0xC4, 0x13, 0x13, 0x13, 0x54, 0x01, 0xA3, 0xF0, 0x90, 0x00, 0x02, 0x12, 0x26, 0x37, -0xFF, 0x54, 0x08, 0xFE, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x90, 0xA4, 0x9B, 0xF0, 0xEF, 0x54, 0x04, -0x13, 0x13, 0x54, 0x3F, 0xA3, 0xF0, 0x90, 0xA4, 0x7D, 0xE0, 0xB4, 0x02, 0x0B, 0x90, 0xA4, 0x9A, -0xE0, 0x60, 0x05, 0xE4, 0xFF, 0x12, 0x4F, 0xD5, 0x90, 0xA4, 0x7E, 0xE0, 0xB4, 0x01, 0x1D, 0x90, -0xA4, 0x91, 0x12, 0x48, 0x8F, 0x90, 0x00, 0x05, 0x12, 0x26, 0x37, 0x54, 0xF0, 0x70, 0x08, 0x90, -0x00, 0x06, 0x12, 0x26, 0x37, 0x60, 0x05, 0x7F, 0x01, 0x12, 0x4F, 0xD5, 0x90, 0xA4, 0x99, 0xE0, -0x54, 0x01, 0xC4, 0x33, 0x33, 0x33, 0x54, 0x80, 0xFF, 0x90, 0xA4, 0x94, 0xE0, 0xFE, 0x75, 0xF0, -0x04, 0x90, 0x96, 0x19, 0x12, 0x48, 0x83, 0xE0, 0x54, 0x7F, 0x4F, 0xF0, 0x90, 0xA4, 0x98, 0xE0, -0x54, 0x01, 0xC4, 0x33, 0x33, 0x54, 0xC0, 0xFF, 0x75, 0xF0, 0x04, 0xEE, 0x90, 0x96, 0x19, 0x12, -0x48, 0x83, 0xE0, 0x54, 0xBF, 0x4F, 0xF0, 0x90, 0xA4, 0x9B, 0xE0, 0x60, 0x03, 0x02, 0x98, 0x4E, -0x90, 0xA4, 0x96, 0xE0, 0x54, 0x1F, 0xFF, 0x90, 0xA4, 0x94, 0xE0, 0xFE, 0x75, 0xF0, 0x04, 0x90, -0x96, 0x18, 0x12, 0x48, 0x83, 0xE0, 0x54, 0xE0, 0x4F, 0xF0, 0x90, 0xA4, 0x97, 0xE0, 0x54, 0x03, -0xFF, 0x75, 0xF0, 0x04, 0xEE, 0x90, 0x96, 0x19, 0x12, 0x48, 0x83, 0xE0, 0x54, 0xFC, 0x4F, 0xF0, -0xEF, 0x25, 0xE0, 0x25, 0xE0, 0xFF, 0x90, 0xA4, 0x94, 0xE0, 0xFE, 0x75, 0xF0, 0x04, 0x90, 0x96, -0x19, 0x12, 0x48, 0x83, 0xE0, 0x54, 0xF3, 0x4F, 0xF0, 0x90, 0xA4, 0x95, 0xE0, 0x54, 0x01, 0xC4, -0x33, 0x54, 0xE0, 0xFF, 0x75, 0xF0, 0x04, 0xEE, 0x90, 0x96, 0x18, 0x12, 0x48, 0x83, 0xE0, 0x54, -0xDF, 0x4F, 0xF0, 0x90, 0xA4, 0x9A, 0xE0, 0x54, 0x03, 0xC4, 0x54, 0xF0, 0xFF, 0x90, 0xA4, 0x94, -0xE0, 0xFE, 0x75, 0xF0, 0x04, 0x90, 0x96, 0x19, 0x12, 0x48, 0x83, 0xE0, 0x54, 0xCF, 0x4F, 0xF0, -0x74, 0x16, 0x2E, 0xF5, 0x82, 0xE4, 0x34, 0x99, 0xF5, 0x83, 0xE0, 0x54, 0xFB, 0xF0, 0x90, 0xA4, -0x94, 0xE0, 0x24, 0x16, 0xF5, 0x82, 0xE4, 0x34, 0x99, 0xF5, 0x83, 0xC0, 0x83, 0xC0, 0x82, 0xE0, -0xFF, 0x90, 0xA4, 0x9C, 0xE0, 0x25, 0xE0, 0x25, 0xE0, 0xFE, 0xEF, 0x4E, 0xD0, 0x82, 0xD0, 0x83, -0xF0, 0xE4, 0xFF, 0xEF, 0x24, 0x03, 0xFD, 0xE4, 0x33, 0xFC, 0x90, 0xA4, 0x91, 0x12, 0x48, 0x8F, -0x8D, 0x82, 0x8C, 0x83, 0x12, 0x26, 0x37, 0xFE, 0x90, 0xA4, 0x94, 0xE0, 0x75, 0xF0, 0x08, 0x90, -0x89, 0x00, 0x12, 0x48, 0x83, 0xE5, 0x82, 0x2F, 0xF5, 0x82, 0xE4, 0x35, 0x83, 0xF5, 0x83, 0xEE, -0xF0, 0x0F, 0xEF, 0xB4, 0x04, 0xCD, 0x90, 0xA4, 0x94, 0xE0, 0xFF, 0x12, 0x93, 0xAA, 0x22, 0x90, -0xA4, 0x91, 0x12, 0x48, 0x98, 0x12, 0x26, 0x1E, 0xF5, 0x0F, 0x24, 0x16, 0xF5, 0x82, 0xE4, 0x34, -0x99, 0xF5, 0x83, 0xE0, 0x54, 0xBC, 0xF0, 0x74, 0x16, 0x25, 0x0F, 0xF5, 0x82, 0xE4, 0x34, 0x99, -0xF5, 0x83, 0xC0, 0x83, 0xC0, 0x82, 0xE0, 0xFF, 0x90, 0xA4, 0x91, 0x12, 0x48, 0x8F, 0x90, 0x00, -0x03, 0x12, 0x26, 0x37, 0x54, 0x01, 0xFE, 0xEF, 0x4E, 0xD0, 0x82, 0xD0, 0x83, 0xF0, 0x74, 0x16, -0x25, 0x0F, 0xF5, 0x82, 0xE4, 0x34, 0x99, 0xF5, 0x83, 0xC0, 0x83, 0xC0, 0x82, 0xE0, 0xFF, 0x90, -0xA4, 0x91, 0x12, 0x48, 0x8F, 0x90, 0x00, 0x03, 0x12, 0x26, 0x37, 0x54, 0x02, 0xFE, 0xEF, 0x4E, -0xD0, 0x82, 0xD0, 0x83, 0xF0, 0x74, 0x16, 0x25, 0x0F, 0xF5, 0x82, 0xE4, 0x34, 0x99, 0xF5, 0x83, -0xC0, 0x83, 0xC0, 0x82, 0xE0, 0xFF, 0x90, 0xA4, 0x91, 0x12, 0x48, 0x8F, 0x90, 0x00, 0x03, 0x12, -0x26, 0x37, 0x54, 0x40, 0xFE, 0xEF, 0x4E, 0xD0, 0x82, 0xD0, 0x83, 0xF0, 0xE5, 0x0F, 0xC3, 0x94, -0x80, 0x50, 0x15, 0x90, 0x00, 0x02, 0x12, 0x26, 0x37, 0xFF, 0x74, 0x96, 0x25, 0x0F, 0xF5, 0x82, -0xE4, 0x34, 0x99, 0xF5, 0x83, 0xEF, 0xF0, 0x22, 0xE5, 0x0F, 0xB4, 0x80, 0x0A, 0x90, 0x00, 0x02, -0x12, 0x26, 0x37, 0x90, 0x95, 0x95, 0xF0, 0x22, 0x12, 0x26, 0x1E, 0x90, 0xA4, 0x91, 0xF0, 0x90, -0x00, 0x01, 0x12, 0x26, 0x37, 0x90, 0xA4, 0x92, 0xF0, 0x90, 0x00, 0x02, 0x12, 0x26, 0x37, 0x54, -0x01, 0xFF, 0x60, 0x68, 0x90, 0xA4, 0x91, 0xE0, 0xD3, 0x94, 0x80, 0x40, 0x5F, 0xA3, 0xE0, 0xD3, -0x94, 0x80, 0x40, 0x58, 0x90, 0xA4, 0x95, 0xEF, 0xF0, 0x90, 0x94, 0x91, 0x12, 0x48, 0x4B, 0x90, -0xA4, 0x96, 0xEF, 0xF0, 0x90, 0x94, 0x91, 0x12, 0x48, 0x4B, 0x78, 0x08, 0x12, 0x27, 0x22, 0x90, -0xA4, 0x97, 0xEF, 0xF0, 0x90, 0x94, 0x91, 0x12, 0x48, 0x4B, 0x78, 0x10, 0x12, 0x27, 0x22, 0x90, -0xA4, 0x98, 0xEF, 0xF0, 0x90, 0x94, 0x91, 0x12, 0x48, 0x4B, 0x78, 0x18, 0x12, 0x27, 0x22, 0x90, -0xA4, 0x99, 0xEF, 0xF0, 0x90, 0xA4, 0x93, 0x74, 0x0D, 0xF0, 0x90, 0xA4, 0xA1, 0x74, 0x05, 0xF0, -0x90, 0x94, 0x91, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x41, 0x97, 0xEF, 0x60, 0x02, 0x41, -0x97, 0x90, 0xA4, 0x91, 0xE0, 0xFF, 0xD3, 0x94, 0x80, 0x50, 0x47, 0x90, 0xA4, 0x95, 0xEF, 0xF0, -0x25, 0xE0, 0x24, 0xA6, 0xF5, 0x82, 0xE4, 0x34, 0x9D, 0xF5, 0x83, 0xE0, 0xFE, 0xA3, 0xE0, 0x90, -0xA4, 0x96, 0xF0, 0xEE, 0xA3, 0xF0, 0x90, 0xA4, 0x91, 0xE0, 0xFD, 0x25, 0xE0, 0x24, 0xA6, 0xF5, -0x82, 0xE4, 0x34, 0x9C, 0xF5, 0x83, 0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F, 0xB4, 0x0E, 0x1D, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, -0x00, 0x00, 0x03, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x03, 0x00, 0x7F, 0xAC, -0x7E, 0x08, 0x12, 0x5E, 0xAA, 0x80, 0x0E, 0x90, 0xA6, 0xDA, 0xE0, 0xB4, 0x01, 0x1D, 0x90, 0xA6, -0xD9, 0xE0, 0xB4, 0x0B, 0x16, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x40, 0x00, 0x00, 0x00, 0x90, -0xA6, 0x6F, 0x12, 0x27, 0x54, 0x40, 0x00, 0x00, 0x00, 0x80, 0x39, 0x90, 0xA6, 0xDA, 0xE0, 0x64, -0x02, 0x70, 0x02, 0xA1, 0x77, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x00, 0x00, 0x03, 0x00, 0x90, -0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x02, 0x00, 0x7F, 0xAC, 0x7E, 0x08, 0x12, 0x5E, 0xAA, -0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x40, 0x00, 0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, -0x00, 0x00, 0x00, 0x00, 0x7F, 0xC4, 0x80, 0x4A, 0x90, 0xA6, 0xDA, 0xE0, 0x70, 0x25, 0x90, 0xA6, -0xD9, 0xE0, 0xFF, 0x64, 0x0D, 0x60, 0x04, 0xEF, 0xB4, 0x0E, 0x18, 0x90, 0xA6, 0x6B, 0x12, 0x27, -0x54, 0x00, 0x00, 0x03, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x03, 0x00, 0x7F, -0xAC, 0x80, 0x1F, 0x90, 0xA6, 0xD9, 0xE0, 0xD3, 0x94, 0x0E, 0x50, 0x1B, 0x90, 0xA6, 0x6B, 0x12, -0x27, 0x54, 0x00, 0x00, 0x03, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x02, 0x00, -0x7F, 0xAC, 0x7E, 0x08, 0x12, 0x5E, 0xAA, 0x22, 0x90, 0x04, 0x54, 0xE0, 0x7F, 0x00, 0x30, 0xE7, -0x02, 0x7F, 0x01, 0x22, 0x90, 0xA6, 0xDC, 0xED, 0xF0, 0x90, 0xA6, 0xDB, 0xEF, 0xF0, 0xD3, 0x94, -0x0E, 0x50, 0x15, 0xB1, 0x78, 0xEF, 0x60, 0x29, 0xB1, 0x78, 0xEF, 0x64, 0x01, 0x70, 0x22, 0x90, -0xA6, 0xDC, 0xE0, 0xFD, 0xE4, 0xFF, 0x80, 0x15, 0x90, 0xA6, 0xDB, 0xE0, 0xD3, 0x94, 0x0E, 0x40, -0x10, 0xB1, 0x78, 0xEF, 0x70, 0x09, 0x90, 0xA6, 0xDC, 0xE0, 0xFD, 0x7F, 0x01, 0x80, 0x03, 0xB1, -0x78, 0x22, 0x90, 0xA6, 0xC7, 0xED, 0xF0, 0x90, 0xA6, 0xC6, 0xEF, 0xF0, 0x70, 0x77, 0x90, 0xA6, -0x6B, 0x12, 0x27, 0x54, 0x30, 0x00, 0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, 0x00, -0x00, 0x00, 0x74, 0x08, 0xFF, 0xFE, 0x12, 0x5E, 0xAA, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x00, -0x00, 0x00, 0x0E, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x08, 0x7F, 0x30, 0x7E, -0x08, 0x12, 0x5E, 0xAA, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x03, 0x90, 0xA6, -0x6F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x01, 0xD1, 0xC4, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, -0x30, 0x00, 0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x30, 0x00, 0x00, 0x00, 0x74, 0x08, -0xFF, 0xFE, 0x12, 0x5E, 0xAA, 0x90, 0x04, 0x54, 0xE0, 0x54, 0x7F, 0x90, 0xA6, 0xC8, 0xF0, 0xE0, -0x90, 0x04, 0x54, 0xF0, 0x22, 0x90, 0xA6, 0xC6, 0xE0, 0x64, 0x01, 0x70, 0x76, 0x90, 0x04, 0x54, -0xE0, 0x44, 0x80, 0x90, 0xA6, 0xC8, 0xF0, 0xE0, 0x90, 0x04, 0x54, 0xF0, 0x90, 0xA6, 0x6B, 0x12, -0x27, 0x54, 0x30, 0x00, 0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, -0x74, 0x08, 0xFF, 0xFE, 0x12, 0x5E, 0xAA, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, -0x0E, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x06, 0x7F, 0x30, 0x7E, 0x08, 0x12, -0x5E, 0xAA, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x03, 0x90, 0xA6, 0x6F, 0x12, -0x27, 0x54, 0x00, 0x00, 0x00, 0x02, 0xD1, 0xC4, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x30, 0x00, -0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x20, 0x00, 0x00, 0x00, 0x74, 0x08, 0xFF, 0xFE, -0x12, 0x5E, 0xAA, 0x22, 0x7F, 0x34, 0x7E, 0x08, 0x12, 0x5E, 0xAA, 0x90, 0xA6, 0xC6, 0xE0, 0xFF, -0xA3, 0xE0, 0xFD, 0x90, 0xA6, 0xE1, 0xED, 0xF0, 0xEF, 0x60, 0x02, 0xE1, 0xDD, 0xE0, 0x24, 0xFD, -0x50, 0x0D, 0x60, 0x29, 0x14, 0x60, 0x44, 0x14, 0x70, 0x02, 0xE1, 0x7F, 0x02, 0xA1, 0xCF, 0x90, -0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, 0x77, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x37, 0x5D, -0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, 0x77, 0x02, 0xA0, 0x70, 0x90, 0xAC, 0xB9, -0x12, 0x27, 0x54, 0x54, 0x33, 0x77, 0x70, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0xAC, -0xB9, 0x12, 0x27, 0x54, 0x54, 0x33, 0x77, 0x70, 0x02, 0xA1, 0x16, 0x90, 0xAC, 0xB9, 0x12, 0x27, -0x54, 0x77, 0x77, 0x77, 0x77, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, -0x27, 0x54, 0x77, 0x77, 0x77, 0x77, 0x7F, 0xB0, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0xA6, 0x6B, -0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, 0x10, 0x00, -0x00, 0x7F, 0xB4, 0x7E, 0x0C, 0x12, 0x5E, 0xAA, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x3F, 0xF0, -0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, 0x10, 0x00, 0x00, 0x02, 0xA1, 0xC8, 0x90, -0xA6, 0x6B, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0xFF, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, -0x00, 0x00, 0x77, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x5E, 0xAA, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, -0x77, 0x77, 0x77, 0x77, 0x7F, 0xB0, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0xA6, 0x6B, 0x12, 0x27, -0x54, 0x01, 0x00, 0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7F, -0xB4, 0x7E, 0x0C, 0x12, 0x5E, 0xAA, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, -0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x02, 0xA1, 0xC8, 0x90, 0xA6, 0xE1, -0xE0, 0x14, 0x60, 0x71, 0x14, 0x70, 0x03, 0x02, 0xA0, 0xA8, 0x14, 0x70, 0x03, 0x02, 0xA0, 0xFB, -0x14, 0x70, 0x03, 0x02, 0xA0, 0xA8, 0x14, 0x70, 0x03, 0x02, 0xA1, 0x6D, 0x24, 0x05, 0x60, 0x02, -0x21, 0xCF, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x33, 0x77, 0x17, 0x7F, 0xB0, 0x7E, 0x0C, -0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x33, 0x77, 0x17, 0x7F, 0xB0, 0x7E, -0x0E, 0x12, 0x37, 0x5D, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA6, -0x6F, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0C, 0x12, 0x5E, 0xAA, 0x90, -0xA6, 0x6B, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x01, -0x00, 0x00, 0x00, 0x21, 0xC8, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x33, 0x77, 0x17, 0x7F, -0xB0, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x33, 0x77, 0x17, -0x7F, 0xB0, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, -0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0C, 0x12, -0x5E, 0xAA, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, -0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x21, 0xC8, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x33, -0x77, 0x77, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, -0x33, 0x77, 0x77, 0x7F, 0xB0, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, -0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0x7F, 0xB4, -0x7E, 0x0C, 0x12, 0x5E, 0xAA, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, -0xA6, 0x6F, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0x21, 0xC8, 0x90, 0xAC, 0xB9, 0x12, 0x27, -0x54, 0x54, 0x33, 0x77, 0x17, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, -0x27, 0x54, 0x54, 0x33, 0x77, 0x17, 0x7F, 0xB0, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0xA6, 0x6B, -0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, -0x00, 0x7F, 0xB4, 0x7E, 0x0C, 0x12, 0x5E, 0xAA, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x3F, 0xF0, -0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0E, -0x12, 0x5E, 0xAA, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x00, 0x00, 0x03, 0x03, 0x90, 0xA6, 0x6F, -0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x01, 0x7F, 0x00, 0x7E, 0x09, 0x80, 0x5F, 0x90, 0xA6, 0x6B, -0x12, 0x27, 0x54, 0x00, 0xFF, 0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, 0x33, 0x00, -0x00, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x5E, 0xAA, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x33, -0x77, 0x77, 0x7F, 0xB0, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x01, -0x00, 0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0x7F, 0xB4, 0x7E, -0x0C, 0x12, 0x5E, 0xAA, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA6, -0x6F, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0E, 0x12, 0x5E, 0xAA, 0x22, -0x90, 0xA5, 0x04, 0x12, 0x48, 0x98, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x80, 0x00, 0x00, 0x00, -0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x12, 0x5E, 0xA6, 0xE4, 0x90, 0xA5, -0x0A, 0xF0, 0x90, 0xA5, 0x0A, 0xE0, 0xFF, 0x25, 0xE0, 0x24, 0x8F, 0xF5, 0x82, 0xE4, 0x34, 0x45, -0xF5, 0x83, 0xE4, 0x93, 0xFC, 0x74, 0x01, 0x93, 0xF5, 0x82, 0x8C, 0x83, 0xE0, 0xFE, 0x90, 0xA5, -0x04, 0x12, 0x48, 0x8F, 0x8F, 0x82, 0x75, 0x83, 0x00, 0xEE, 0x12, 0x26, 0x76, 0x90, 0xA5, 0x0A, -0xE0, 0x04, 0xF0, 0xE0, 0xB4, 0x03, 0xCB, 0xE4, 0x90, 0xA5, 0x0A, 0xF0, 0x90, 0xA5, 0x0A, 0xE0, -0xFF, 0xC3, 0x94, 0x08, 0x50, 0x34, 0xEF, 0x25, 0xE0, 0x24, 0x95, 0xF5, 0x82, 0xE4, 0x34, 0x45, -0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0x12, 0x36, 0xCE, 0x90, 0xA5, 0x07, 0x12, -0x48, 0x8F, 0x90, 0xA5, 0x0A, 0xE0, 0x75, 0xF0, 0x04, 0xA4, 0xF5, 0x82, 0x85, 0xF0, 0x83, 0x12, -0x48, 0x27, 0x90, 0xA5, 0x0A, 0xE0, 0x04, 0xF0, 0x80, 0xC2, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, -0xC0, 0xD0, 0x7B, 0x01, 0x7A, 0xA4, 0x79, 0x94, 0x90, 0xA5, 0x07, 0x12, 0x48, 0x98, 0x7A, 0xA4, -0x79, 0x91, 0x31, 0xD0, 0x7B, 0x01, 0x7A, 0xA4, 0x79, 0xD0, 0x90, 0xA5, 0x07, 0x12, 0x48, 0x98, -0x7A, 0xA4, 0x79, 0xB4, 0x71, 0x53, 0x7B, 0x01, 0x7A, 0xA4, 0x79, 0xF8, 0x90, 0xA5, 0x07, 0x12, -0x48, 0x98, 0x7A, 0xA4, 0x79, 0xEC, 0x12, 0x5E, 0x25, 0x51, 0xF4, 0xE4, 0xFF, 0x12, 0xAB, 0xF6, -0x7B, 0x01, 0x7A, 0xA4, 0x79, 0xEC, 0xE4, 0xFF, 0x12, 0x5F, 0x0C, 0x7F, 0x01, 0x12, 0xAB, 0xF6, -0x7B, 0x01, 0x7A, 0xA4, 0x79, 0xF8, 0x7F, 0x01, 0x12, 0x5F, 0x0C, 0x7B, 0x01, 0x7A, 0xA4, 0x79, -0xD0, 0x90, 0xA5, 0x07, 0x12, 0x48, 0x98, 0x7A, 0xA4, 0x79, 0xB4, 0x91, 0x88, 0x7B, 0x01, 0x7A, -0xA4, 0x79, 0x94, 0x90, 0xA5, 0x07, 0x12, 0x48, 0x98, 0x7A, 0xA4, 0x79, 0x91, 0x71, 0xE3, 0xD0, -0xD0, 0x92, 0xAF, 0x22, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA6, -0x6F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x12, 0x5E, 0xA6, 0x90, 0x05, 0x22, 0x74, 0x3F, -0xF0, 0x90, 0x05, 0x50, 0xE0, 0x54, 0xF7, 0xF0, 0xA3, 0xE0, 0x54, 0xF7, 0xF0, 0x90, 0xA6, 0x6B, -0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0xFF, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, -0x00, 0x74, 0x08, 0xFF, 0xFE, 0x12, 0x5E, 0xAA, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x00, 0x00, -0x00, 0x0F, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x0C, 0x7F, 0x38, 0x7E, 0x08, -0x02, 0x5E, 0xAA, 0x90, 0xA5, 0x04, 0x12, 0x48, 0x98, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x80, -0x00, 0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x12, 0x5E, 0xA6, -0xE4, 0x90, 0xA5, 0x0A, 0xF0, 0x90, 0xA5, 0x0A, 0xE0, 0xFF, 0xC3, 0x94, 0x07, 0x50, 0x63, 0xEF, -0x25, 0xE0, 0x24, 0xA5, 0xF5, 0x82, 0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, -0x93, 0xFF, 0x12, 0x36, 0xCE, 0x90, 0xA5, 0x04, 0x12, 0x48, 0x8F, 0x90, 0xA5, 0x0A, 0xE0, 0x75, -0xF0, 0x04, 0xA4, 0xF5, 0x82, 0x85, 0xF0, 0x83, 0x12, 0x48, 0x27, 0x90, 0xA5, 0x0A, 0xE0, 0x25, -0xE0, 0x24, 0xB3, 0xF5, 0x82, 0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, -0xFF, 0x12, 0x36, 0xCE, 0x90, 0xA5, 0x07, 0x12, 0x48, 0x8F, 0x90, 0xA5, 0x0A, 0xE0, 0x75, 0xF0, -0x04, 0xA4, 0xF5, 0x82, 0x85, 0xF0, 0x83, 0x12, 0x48, 0x27, 0x90, 0xA5, 0x0A, 0xE0, 0x04, 0xF0, -0x80, 0x93, 0x22, 0x90, 0xA5, 0x04, 0x12, 0x48, 0x98, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x80, -0x00, 0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x12, 0x5E, 0xA6, -0xE4, 0x90, 0xA5, 0x0A, 0xF0, 0x90, 0xA5, 0x04, 0x12, 0x48, 0x8F, 0x90, 0xA5, 0x0A, 0xE0, 0xFF, -0xF5, 0x82, 0x75, 0x83, 0x00, 0x12, 0x26, 0x37, 0xFE, 0xEF, 0x25, 0xE0, 0x24, 0x8F, 0xF5, 0x82, -0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, 0x93, 0xFC, 0x74, 0x01, 0x93, 0xF5, 0x82, 0x8C, 0x83, 0xEE, -0xF0, 0x90, 0xA5, 0x0A, 0xE0, 0x04, 0xF0, 0xE0, 0xB4, 0x03, 0xCA, 0xE4, 0x90, 0xA5, 0x0A, 0xF0, -0x90, 0xA5, 0x0A, 0xE0, 0xFD, 0x25, 0xE0, 0x24, 0x95, 0xF5, 0x82, 0xE4, 0x34, 0x45, 0xF5, 0x83, -0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xA5, 0x07, 0x12, 0x48, -0x8F, 0x75, 0xF0, 0x04, 0xED, 0xA4, 0xF5, 0x82, 0x85, 0xF0, 0x83, 0x12, 0x47, 0xDD, 0x90, 0xAC, -0xB9, 0x12, 0x27, 0x48, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x37, 0x5D, 0x90, 0xA5, 0x0A, 0xE0, 0x04, -0xF0, 0xE0, 0xC3, 0x94, 0x08, 0x40, 0xB9, 0x22, 0x90, 0xA5, 0x04, 0x12, 0x48, 0x98, 0x90, 0xA6, -0x6B, 0x12, 0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, 0x00, -0x00, 0x00, 0x12, 0x5E, 0xA6, 0xE4, 0x90, 0xA5, 0x0A, 0xF0, 0x90, 0xA5, 0x0A, 0xE0, 0xFD, 0x25, -0xE0, 0x24, 0xA5, 0xF5, 0x82, 0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, -0xFF, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xA5, 0x04, 0x12, 0x48, 0x8F, 0x75, 0xF0, 0x04, 0xED, 0xA4, -0xF5, 0x82, 0x85, 0xF0, 0x83, 0x12, 0x47, 0xDD, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0xD0, 0x07, -0xD0, 0x06, 0x12, 0x37, 0x5D, 0x90, 0xA5, 0x0A, 0xE0, 0xFD, 0x25, 0xE0, 0x24, 0xB3, 0xF5, 0x82, -0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0xC0, 0x06, 0xC0, 0x07, -0x90, 0xA5, 0x07, 0x12, 0x48, 0x8F, 0x75, 0xF0, 0x04, 0xED, 0xA4, 0xF5, 0x82, 0x85, 0xF0, 0x83, -0x12, 0x47, 0xDD, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x37, 0x5D, -0x90, 0xA5, 0x0A, 0xE0, 0x04, 0xF0, 0xE0, 0xC3, 0x94, 0x07, 0x50, 0x02, 0x81, 0xAA, 0x90, 0xA6, -0x6B, 0x12, 0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x80, 0x00, -0x00, 0x00, 0x12, 0x5E, 0xA6, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7F, -0x80, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, -0x7F, 0x84, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, -0x00, 0x7F, 0x88, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x3C, 0x00, -0x00, 0x00, 0x7F, 0x8C, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x00, -0x00, 0x00, 0x00, 0x7F, 0xB8, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, -0x00, 0x00, 0x00, 0x80, 0x7F, 0x90, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, -0x54, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x94, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, -0x27, 0x54, 0x20, 0x04, 0x00, 0x00, 0x7F, 0xC4, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, -0x12, 0x27, 0x54, 0x20, 0x00, 0x00, 0x00, 0x7F, 0xC8, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0xAC, -0xB9, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x80, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, -0xAC, 0xB9, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x84, 0x7E, 0x0E, 0x12, 0x37, 0x5D, -0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x88, 0x7E, 0x0E, 0x12, 0x37, -0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x3C, 0x00, 0x00, 0x00, 0x7F, 0x8C, 0x7E, 0x0E, 0x12, -0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xB8, 0x7E, 0x0E, -0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x80, 0x7F, 0x90, 0x7E, -0x0E, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x94, -0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x20, 0x04, 0x00, 0x00, 0x7F, -0xC4, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x20, 0x00, 0x00, 0x00, -0x7F, 0xC8, 0x7E, 0x0E, 0x02, 0x37, 0x5D, 0x90, 0xA5, 0x46, 0xEF, 0xF0, 0x90, 0xA6, 0x6B, 0x12, -0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, -0x12, 0x5E, 0xA6, 0x90, 0xA5, 0x47, 0x12, 0x48, 0x4B, 0x78, 0x01, 0x12, 0x27, 0x22, 0xE4, 0x7B, -0x12, 0x7A, 0x01, 0xF9, 0xF8, 0xC3, 0x12, 0x47, 0xAC, 0x60, 0x17, 0x90, 0xA5, 0x4B, 0x12, 0x48, -0x4B, 0x78, 0x01, 0x12, 0x27, 0x22, 0xE4, 0x7B, 0xEE, 0x7A, 0x03, 0xF8, 0xC3, 0x12, 0x47, 0xAC, -0x70, 0x69, 0x90, 0xA5, 0x46, 0xE0, 0x75, 0xF0, 0x1C, 0xA4, 0x24, 0xCB, 0xF5, 0x82, 0xE4, 0x34, -0x45, 0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xA6, -0x6B, 0x12, 0x27, 0x54, 0x00, 0x00, 0x03, 0xFF, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, 0x00, -0x01, 0x00, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x5E, 0xAA, 0x90, 0xA5, 0x46, 0xE0, 0x75, 0xF0, 0x1C, -0xA4, 0x24, 0xCB, 0xF5, 0x82, 0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, -0xFF, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x03, 0xFF, 0x00, 0x00, 0x90, -0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x80, 0x70, 0x90, 0xA5, 0x46, 0xE0, 0x75, -0xF0, 0x1C, 0xA4, 0x24, 0xCB, 0xF5, 0x82, 0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, -0x01, 0x93, 0xFF, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x00, 0x00, 0x03, -0xFF, 0x90, 0xA5, 0x47, 0x12, 0x48, 0x4B, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x48, 0xD0, 0x07, 0xD0, -0x06, 0x12, 0x5E, 0xAA, 0x90, 0xA5, 0x46, 0xE0, 0x75, 0xF0, 0x1C, 0xA4, 0x24, 0xCB, 0xF5, 0x82, -0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0xC0, 0x06, 0xC0, 0x07, -0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x03, 0xFF, 0x00, 0x00, 0x90, 0xA5, 0x4B, 0x12, 0x48, 0x4B, -0x78, 0x10, 0x12, 0x27, 0x35, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x48, 0xD0, 0x07, 0xD0, 0x06, 0x02, -0x5E, 0xAA, 0x90, 0xA5, 0x46, 0xEF, 0xF0, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x80, 0x00, 0x00, -0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0x12, 0x5E, 0xA6, 0x90, 0xA5, -0x46, 0xE0, 0x75, 0xF0, 0x1C, 0xA4, 0x24, 0xCF, 0xF5, 0x82, 0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, -0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, -0x00, 0x00, 0x00, 0x80, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x37, 0x5D, 0x90, 0xA5, 0x46, 0xE0, 0x75, -0xF0, 0x1C, 0xA4, 0x24, 0xD1, 0xF5, 0x82, 0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, -0x01, 0x93, 0xFF, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x20, 0x04, 0x00, -0x00, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x37, 0x5D, 0x90, 0xA5, 0x46, 0xE0, 0x75, 0xF0, 0x1C, 0xA4, -0x24, 0xD3, 0xF5, 0x82, 0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, -0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x20, 0x00, 0x00, 0x00, 0xD0, 0x07, -0xD0, 0x06, 0x12, 0x37, 0x5D, 0x90, 0xA5, 0x46, 0xE0, 0x75, 0xF0, 0x1C, 0xA4, 0x24, 0xD5, 0xF5, -0x82, 0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0xC0, 0x06, 0xC0, -0x07, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x00, 0x00, 0x07, 0xFF, 0x90, 0xA5, 0x4B, 0x12, 0x48, -0x4B, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x48, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x5E, 0xAA, 0x90, 0xA5, -0x46, 0xE0, 0x75, 0xF0, 0x1C, 0xA4, 0x24, 0xD7, 0xF5, 0x82, 0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, -0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, -0x00, 0x00, 0x07, 0xFF, 0x90, 0xA5, 0x47, 0x12, 0x48, 0x4B, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x48, -0xD0, 0x07, 0xD0, 0x06, 0x02, 0x5E, 0xAA, 0x90, 0xA5, 0x46, 0xEF, 0xF0, 0xA3, 0xED, 0xF0, 0xE4, -0xA3, 0xF0, 0x90, 0xA5, 0x46, 0xE0, 0x75, 0xF0, 0x0E, 0xA4, 0x24, 0xAD, 0xF5, 0x82, 0xE4, 0x34, -0x45, 0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, -0xB9, 0x12, 0x27, 0x54, 0x00, 0x10, 0x00, 0x00, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x37, 0x5D, 0x90, -0xAC, 0xB9, 0x12, 0x27, 0x54, 0xFA, 0x00, 0x00, 0x00, 0x7F, 0x80, 0x7E, 0x09, 0x12, 0x37, 0x5D, -0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0xF8, 0x00, 0x00, 0x00, 0x7F, 0x80, 0x7E, 0x09, 0x12, 0x37, -0x5D, 0x7F, 0x03, 0x7E, 0x00, 0x12, 0x3A, 0x69, 0x90, 0xA5, 0x46, 0xE0, 0x75, 0xF0, 0x0E, 0xA4, -0x24, 0xAD, 0xF5, 0x82, 0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, -0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0xD0, 0x07, -0xD0, 0x06, 0x12, 0x37, 0x5D, 0xE4, 0x90, 0xA5, 0x49, 0xF0, 0x90, 0xA5, 0x46, 0xE0, 0x75, 0xF0, -0x1C, 0xA4, 0x24, 0xCD, 0xF5, 0x82, 0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, -0x93, 0xFF, 0x12, 0x36, 0xCE, 0xE4, 0xFF, 0xEE, 0x54, 0x04, 0xFE, 0xE4, 0xFD, 0xFC, 0x78, 0x0A, -0x12, 0x27, 0x22, 0xEF, 0x70, 0x18, 0x90, 0xA5, 0x49, 0xE0, 0xD3, 0x94, 0x14, 0x50, 0x0F, 0x7F, -0x01, 0x7E, 0x00, 0x12, 0x3A, 0x69, 0x90, 0xA5, 0x49, 0xE0, 0x04, 0xF0, 0x80, 0xBC, 0x90, 0xA5, -0x49, 0xE0, 0xC3, 0x94, 0x14, 0x40, 0x02, 0x61, 0xDE, 0x90, 0xA5, 0x47, 0xE0, 0x60, 0x02, 0x41, -0x6D, 0x90, 0xA5, 0x46, 0xE0, 0x75, 0xF0, 0x1C, 0xA4, 0x24, 0xCD, 0xF5, 0x82, 0xE4, 0x34, 0x45, -0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0x12, 0x36, 0xCE, 0xE4, 0xFF, 0xEE, 0x54, -0x10, 0xFE, 0xE4, 0xFD, 0xFC, 0x90, 0xA5, 0x4A, 0x12, 0x27, 0x48, 0xE4, 0xFF, 0xFE, 0xFD, 0xFC, -0x90, 0xA5, 0x4A, 0x12, 0x48, 0x67, 0xC3, 0x12, 0x47, 0xAC, 0x70, 0x7D, 0x90, 0xA5, 0x46, 0xE0, -0x75, 0xF0, 0x0E, 0xA4, 0x24, 0xAD, 0xF5, 0x82, 0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, 0x93, 0xFE, -0x74, 0x01, 0x93, 0xFF, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x02, 0x00, -0x00, 0x00, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x37, 0x5D, 0x90, 0xA5, 0x46, 0xE0, 0x75, 0xF0, 0x1C, -0xA4, 0x24, 0xCD, 0xF5, 0x82, 0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, -0xFF, 0x12, 0x36, 0xCE, 0xE4, 0xFF, 0xFE, 0xEC, 0x54, 0x07, 0xFC, 0x90, 0xA6, 0x14, 0x12, 0x27, -0x48, 0x90, 0xA5, 0x46, 0xE0, 0x75, 0xF0, 0x0E, 0xA4, 0x24, 0xAD, 0xF5, 0x82, 0xE4, 0x34, 0x45, -0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, -0x12, 0x27, 0x54, 0x04, 0x00, 0x00, 0x00, 0x61, 0x25, 0xE4, 0x90, 0xA5, 0x4E, 0xF0, 0x90, 0xA5, -0x48, 0xE0, 0x04, 0xF0, 0xE0, 0x64, 0x0A, 0x60, 0x02, 0x01, 0xC2, 0x61, 0xF0, 0x90, 0xA5, 0x46, -0xE0, 0x75, 0xF0, 0x1C, 0xA4, 0x24, 0xCD, 0xF5, 0x82, 0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, 0x93, -0xFE, 0x74, 0x01, 0x93, 0xFF, 0x12, 0x36, 0xCE, 0xE4, 0xFF, 0xEE, 0x54, 0x08, 0xFE, 0xE4, 0xFD, -0xFC, 0x90, 0xA5, 0x4A, 0x12, 0x27, 0x48, 0xE4, 0xFF, 0xFE, 0xFD, 0xFC, 0x90, 0xA5, 0x4A, 0x12, -0x48, 0x67, 0xC3, 0x12, 0x47, 0xAC, 0x60, 0x02, 0x61, 0x5C, 0x90, 0xA5, 0x46, 0xE0, 0x75, 0xF0, -0x0E, 0xA4, 0x24, 0xAD, 0xF5, 0x82, 0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, -0x93, 0xFF, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x06, 0x00, 0x00, 0x00, -0xD0, 0x07, 0xD0, 0x06, 0x12, 0x37, 0x5D, 0x90, 0xA5, 0x46, 0xE0, 0x75, 0xF0, 0x1C, 0xA4, 0x24, -0xCD, 0xF5, 0x82, 0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0x12, -0x36, 0xCE, 0xE4, 0xFF, 0xFE, 0xEC, 0x54, 0x07, 0xFC, 0x90, 0xA6, 0x14, 0x12, 0x27, 0x48, 0x90, -0xA5, 0x46, 0xE0, 0x75, 0xF0, 0x0E, 0xA4, 0x24, 0xAD, 0xF5, 0x82, 0xE4, 0x34, 0x45, 0xF5, 0x83, -0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, -0x54, 0x08, 0x00, 0x00, 0x00, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x37, 0x5D, 0x90, 0xA5, 0x46, 0xE0, -0x75, 0xF0, 0x1C, 0xA4, 0x24, 0xCD, 0xF5, 0x82, 0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, 0x93, 0xFE, -0x74, 0x01, 0x93, 0xFF, 0x12, 0x36, 0xCE, 0xE4, 0xFF, 0xFE, 0xEC, 0x54, 0x07, 0xFC, 0x90, 0xA6, -0x18, 0x12, 0x27, 0x48, 0x90, 0xA5, 0x4E, 0x74, 0x01, 0xF0, 0x61, 0xF0, 0x90, 0xA5, 0x46, 0xE0, -0x75, 0xF0, 0x1C, 0xA4, 0x24, 0xCB, 0xF5, 0x82, 0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, 0x93, 0xFE, -0x74, 0x01, 0x93, 0xFF, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x00, 0x00, -0x03, 0xFF, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x01, 0x00, 0xD0, 0x07, 0xD0, 0x06, -0x12, 0x5E, 0xAA, 0x90, 0xA5, 0x46, 0xE0, 0x75, 0xF0, 0x1C, 0xA4, 0x24, 0xCB, 0xF5, 0x82, 0xE4, -0x34, 0x45, 0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0xC0, 0x06, 0xC0, 0x07, 0x90, -0xA6, 0x6B, 0x12, 0x27, 0x54, 0x03, 0xFF, 0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, -0x00, 0x00, 0x00, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x5E, 0xAA, 0xE4, 0x90, 0xA5, 0x4E, 0xF0, 0x90, -0xA5, 0x48, 0xE0, 0x04, 0xF0, 0xE0, 0x64, 0x0A, 0x60, 0x02, 0x01, 0xC2, 0x80, 0x12, 0xE4, 0x90, -0xA5, 0x4E, 0xF0, 0x90, 0xA5, 0x48, 0xE0, 0x04, 0xF0, 0xE0, 0x64, 0x0A, 0x60, 0x02, 0x01, 0xC2, -0x90, 0xA5, 0x4E, 0xE0, 0xFF, 0x22, 0x90, 0xA5, 0x04, 0xEF, 0xF0, 0xE4, 0xA3, 0xF0, 0x90, 0xA5, -0x21, 0xF0, 0xA3, 0xF0, 0xA3, 0xF0, 0xA3, 0xF0, 0x78, 0x28, 0x7C, 0xA5, 0x7D, 0x01, 0x7B, 0xFF, -0x7A, 0x45, 0x79, 0xF9, 0xFE, 0x7F, 0x06, 0x12, 0x46, 0xD0, 0xE4, 0x90, 0xA5, 0x25, 0xF0, 0xA3, -0xF0, 0x90, 0xA3, 0xC7, 0xE0, 0x90, 0xA5, 0x27, 0xF0, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x80, -0x00, 0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x12, 0x5E, 0xA6, -0x90, 0xA5, 0x04, 0xE0, 0x90, 0xAC, 0xB9, 0x70, 0x4E, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, 0x77, -0x90, 0x45, 0xA7, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, -0x12, 0x27, 0x54, 0x77, 0x77, 0x77, 0x77, 0x90, 0x45, 0xA9, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, -0xFF, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x90, 0x45, -0xB5, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, -0x54, 0x00, 0x00, 0x00, 0x00, 0x80, 0x4C, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x90, 0x45, -0xA7, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, -0x54, 0x00, 0x00, 0x00, 0x00, 0x90, 0x45, 0xA9, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0x12, -0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, 0x77, 0x90, 0x45, 0xB5, 0xE4, -0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, -0x77, 0x77, 0x77, 0x90, 0x45, 0xB7, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0x12, 0x37, 0x5D, -0x90, 0xA5, 0x04, 0xE0, 0x75, 0xF0, 0x0E, 0xA4, 0x24, 0xAB, 0xF5, 0x82, 0xE4, 0x34, 0x45, 0xF5, -0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, 0x12, -0x27, 0x54, 0x19, 0x79, 0x19, 0x79, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x37, 0x5D, 0x90, 0xA5, 0x04, -0xE0, 0x75, 0xF0, 0x1C, 0xA4, 0x24, 0xC1, 0xF5, 0x82, 0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, 0x93, -0xFE, 0x74, 0x01, 0x93, 0xFF, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x00, -0x00, 0x00, 0x0F, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x04, 0xD0, 0x07, 0xD0, -0x06, 0x12, 0x5E, 0xAA, 0x90, 0xA5, 0x04, 0xE0, 0x75, 0xF0, 0x0E, 0xA4, 0x24, 0xA5, 0xF5, 0x82, -0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0xC0, 0x06, 0xC0, 0x07, -0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x07, 0x00, 0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, -0x07, 0x00, 0x00, 0x00, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x5E, 0xAA, 0x90, 0xA6, 0x6B, 0x12, 0x27, -0x54, 0x40, 0x00, 0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x40, 0x00, 0x00, 0x00, 0x7F, -0xC4, 0x7E, 0x08, 0x12, 0x5E, 0xAA, 0x90, 0xA5, 0x04, 0xE0, 0x75, 0xF0, 0x0E, 0xA4, 0x24, 0xB3, -0xF5, 0x82, 0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0xC0, 0x06, -0xC0, 0x07, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0xFF, 0x90, 0xA6, 0x6F, 0x12, -0x27, 0x54, 0x00, 0x00, 0x00, 0x04, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x5E, 0xAA, 0x90, 0xA6, 0x6B, -0x12, 0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, -0x00, 0x12, 0x5E, 0xA6, 0x90, 0xA5, 0x48, 0x12, 0x27, 0x54, 0x00, 0x08, 0x00, 0x02, 0x12, 0x5F, -0x8C, 0x90, 0xA5, 0x48, 0x12, 0x27, 0x54, 0x00, 0x02, 0x00, 0x00, 0x90, 0xA5, 0x04, 0xE0, 0xFF, -0x7D, 0x30, 0x12, 0x5F, 0x93, 0x90, 0xA5, 0x48, 0x12, 0x27, 0x54, 0x00, 0x03, 0xFF, 0xFD, 0x90, -0xA5, 0x04, 0xE0, 0xFF, 0x7D, 0x31, 0x12, 0x5F, 0x93, 0x90, 0xA5, 0x48, 0x12, 0x27, 0x54, 0x00, -0x0F, 0xE8, 0x3F, 0x90, 0xA5, 0x04, 0xE0, 0xFF, 0x7D, 0x32, 0x12, 0x5F, 0x93, 0x90, 0xA5, 0x48, -0x12, 0x27, 0x54, 0x00, 0x09, 0x31, 0xD5, 0x90, 0xA5, 0x04, 0xE0, 0xFF, 0x7D, 0x65, 0x12, 0x5F, -0x93, 0x90, 0xA5, 0x48, 0x12, 0x27, 0x54, 0x00, 0x08, 0xA0, 0x01, 0x90, 0xA5, 0x04, 0xE0, 0xFF, -0x7D, 0x8F, 0x12, 0x5F, 0x93, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x00, 0x00, 0x80, 0x00, 0x7F, -0x0C, 0x7E, 0x09, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x03, 0x00, 0x01, 0x00, -0x7F, 0x00, 0x7E, 0x0B, 0x12, 0x37, 0x5D, 0x90, 0xA5, 0x04, 0xE0, 0x75, 0xF0, 0x1C, 0xA4, 0x24, -0xC3, 0xF5, 0x82, 0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0xC0, -0x06, 0xC0, 0x07, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x01, 0x90, 0xA6, 0x6F, -0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x01, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x5E, 0xAA, 0x90, 0xAC, -0xB9, 0x12, 0x27, 0x54, 0x29, 0x00, 0x20, 0x00, 0x7F, 0x78, 0x7E, 0x09, 0x12, 0x37, 0x5D, 0x90, -0xAC, 0xB9, 0x12, 0x27, 0x54, 0xA9, 0x00, 0x20, 0x00, 0x7F, 0x7C, 0x7E, 0x09, 0x12, 0x37, 0x5D, -0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x00, 0x46, 0x29, 0x10, 0x7F, 0x84, 0x7E, 0x09, 0x12, 0x37, -0x5D, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, -0x54, 0x80, 0x00, 0x00, 0x00, 0x12, 0x5E, 0xA6, 0x90, 0xA3, 0xC8, 0xE0, 0x90, 0xA5, 0x04, 0x30, -0xE0, 0x25, 0xE0, 0x75, 0xF0, 0x1C, 0xA4, 0x24, 0xC5, 0xF5, 0x82, 0xE4, 0x34, 0x45, 0xF5, 0x83, -0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, -0x54, 0x82, 0x14, 0x03, 0xF7, 0x80, 0x23, 0xE0, 0x75, 0xF0, 0x1C, 0xA4, 0x24, 0xC5, 0xF5, 0x82, -0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0xC0, 0x06, 0xC0, 0x07, -0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x82, 0x14, 0x03, 0xF1, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x37, -0x5D, 0x90, 0xA3, 0xC7, 0xE0, 0x30, 0xE5, 0x28, 0x90, 0xA5, 0x04, 0xE0, 0x75, 0xF0, 0x1C, 0xA4, -0x24, 0xC7, 0xF5, 0x82, 0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, -0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x68, 0x16, 0x3E, 0x96, 0x80, 0x2D, -0x90, 0xA3, 0xC7, 0xE0, 0x30, 0xE4, 0x2D, 0x90, 0xA5, 0x04, 0xE0, 0x75, 0xF0, 0x1C, 0xA4, 0x24, -0xC7, 0xF5, 0x82, 0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0xC0, -0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x28, 0x16, 0x3E, 0x96, 0xD0, 0x07, 0xD0, -0x06, 0x12, 0x37, 0x5D, 0x90, 0xA5, 0x04, 0xE0, 0x75, 0xF0, 0x1C, 0xA4, 0x24, 0xD9, 0xF5, 0x82, -0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0xC0, 0x06, 0xC0, 0x07, -0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x18, 0x00, 0x8C, 0x10, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x37, -0x5D, 0x90, 0xA5, 0x04, 0xE0, 0x75, 0xF0, 0x1C, 0xA4, 0x24, 0xDB, 0xF5, 0x82, 0xE4, 0x34, 0x45, -0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, -0x12, 0x27, 0x54, 0x38, 0x00, 0x8C, 0x10, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x37, 0x5D, 0x90, 0xA5, -0x04, 0xE0, 0x75, 0xF0, 0x1C, 0xA4, 0x24, 0xC9, 0xF5, 0x82, 0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, -0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, -0x00, 0x00, 0x00, 0x00, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x37, 0x5D, 0xE4, 0x90, 0xA5, 0x05, 0xF0, -0x90, 0xA5, 0x04, 0xE0, 0xFF, 0xE4, 0xFD, 0x12, 0xA8, 0xB7, 0x90, 0xA5, 0x25, 0xEF, 0xF0, 0xFB, -0x90, 0xA6, 0x14, 0x12, 0x48, 0x4B, 0x90, 0xA5, 0x05, 0xE0, 0xFA, 0x25, 0xE0, 0x25, 0xE0, 0x24, -0xE4, 0xF5, 0x82, 0xE4, 0x34, 0xA5, 0xF5, 0x83, 0x12, 0x27, 0x48, 0x90, 0xA6, 0x18, 0x12, 0x48, -0x4B, 0xEA, 0x25, 0xE0, 0x25, 0xE0, 0x24, 0xF0, 0xF5, 0x82, 0xE4, 0x34, 0xA5, 0xF5, 0x83, 0x12, -0x27, 0x48, 0xEB, 0x60, 0x06, 0x90, 0xA5, 0x21, 0xE0, 0x04, 0xF0, 0x90, 0xA5, 0x05, 0xE0, 0x04, -0xF0, 0xE0, 0xC3, 0x94, 0x03, 0x40, 0xA9, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x80, 0x00, 0x00, -0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x12, 0x5E, 0xA6, 0x90, 0xA5, -0x04, 0xE0, 0xFF, 0x7D, 0x08, 0x12, 0x5E, 0x16, 0xE4, 0xFF, 0xEE, 0x54, 0xFC, 0xFE, 0xED, 0x54, -0x0F, 0xFD, 0xE4, 0xFC, 0x90, 0xA6, 0x5D, 0x12, 0x27, 0x48, 0x90, 0xA6, 0x59, 0x12, 0x27, 0x54, -0x00, 0x07, 0xFE, 0x00, 0x90, 0xA5, 0x04, 0xE0, 0xFF, 0x7D, 0x58, 0x7C, 0x00, 0x12, 0x5D, 0xA5, -0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, -0x80, 0x00, 0x00, 0x00, 0x12, 0x5E, 0xA6, 0x90, 0xA5, 0x25, 0xE0, 0x70, 0x02, 0x61, 0xF0, 0x90, -0xA6, 0x6B, 0x12, 0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, -0x00, 0x00, 0x00, 0x12, 0x5E, 0xA6, 0x90, 0xA5, 0x48, 0x12, 0x27, 0x54, 0x00, 0x08, 0x00, 0x00, -0x12, 0x5F, 0x8C, 0x90, 0xA5, 0x48, 0x12, 0x27, 0x54, 0x00, 0x03, 0x00, 0x00, 0x90, 0xA5, 0x04, -0xE0, 0xFF, 0x7D, 0x30, 0x12, 0x5F, 0x93, 0x90, 0xA5, 0x48, 0x12, 0x27, 0x54, 0x00, 0x03, 0xF7, -0xFF, 0x90, 0xA5, 0x04, 0xE0, 0xFF, 0x7D, 0x31, 0x12, 0x5F, 0x93, 0x90, 0xA5, 0x48, 0x12, 0x27, -0x54, 0x00, 0x0F, 0xE7, 0xBF, 0x90, 0xA5, 0x04, 0xE0, 0xFF, 0x7D, 0x32, 0x12, 0x5F, 0x93, 0x90, -0xA5, 0x48, 0x12, 0x27, 0x54, 0x00, 0x08, 0x80, 0x01, 0x90, 0xA5, 0x04, 0xE0, 0xFF, 0x7D, 0x8F, -0x12, 0x5F, 0x93, 0x90, 0xA5, 0x48, 0x12, 0x27, 0x54, 0x00, 0x09, 0x31, 0xD0, 0x90, 0xA5, 0x04, -0xE0, 0xFF, 0x7D, 0x65, 0x12, 0x5F, 0x93, 0x90, 0xA5, 0x48, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, -0x00, 0x12, 0x5F, 0x8C, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA6, -0x6F, 0x12, 0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0x7F, 0x78, 0x7E, 0x09, 0x12, 0x5E, 0xAA, 0x90, -0xA6, 0x6B, 0x12, 0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, -0x00, 0x00, 0x00, 0x7F, 0x7C, 0x7E, 0x09, 0x12, 0x5E, 0xAA, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, -0x00, 0x00, 0x80, 0x00, 0x7F, 0x0C, 0x7E, 0x09, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, -0x54, 0x00, 0x46, 0xA8, 0x91, 0x7F, 0x84, 0x7E, 0x09, 0x12, 0x37, 0x5D, 0x90, 0xA6, 0x6B, 0x12, -0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x80, 0x00, 0x00, 0x00, -0x12, 0x5E, 0xA6, 0x90, 0xA5, 0x04, 0xE0, 0x75, 0xF0, 0x1C, 0xA4, 0x24, 0xD9, 0xF5, 0x82, 0xE4, -0x34, 0x45, 0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0xC0, 0x06, 0xC0, 0x07, 0x90, -0xAC, 0xB9, 0x12, 0x27, 0x54, 0x38, 0x00, 0x8C, 0x10, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x37, 0x5D, -0x90, 0xA5, 0x04, 0xE0, 0x75, 0xF0, 0x1C, 0xA4, 0x24, 0xDB, 0xF5, 0x82, 0xE4, 0x34, 0x45, 0xF5, -0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, 0x12, -0x27, 0x54, 0x18, 0x00, 0x8C, 0x10, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x37, 0x5D, 0x90, 0xA5, 0x04, -0xE0, 0x75, 0xF0, 0x1C, 0xA4, 0x24, 0xC5, 0xF5, 0x82, 0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, 0x93, -0xFE, 0x74, 0x01, 0x93, 0xFF, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x02, -0x14, 0x01, 0x19, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x37, 0x5D, 0x90, 0xA5, 0x04, 0xE0, 0xFF, 0x70, -0x25, 0xEF, 0x75, 0xF0, 0x1C, 0xA4, 0x24, 0xC7, 0xF5, 0x82, 0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, -0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, -0x28, 0x16, 0x0D, 0x40, 0x80, 0x26, 0x90, 0xA5, 0x04, 0xE0, 0x75, 0xF0, 0x1C, 0xA4, 0x24, 0xC7, -0xF5, 0x82, 0xE4, 0x34, 0x45, 0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0xC0, 0x06, -0xC0, 0x07, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x28, 0x16, 0x11, 0x80, 0xD0, 0x07, 0xD0, 0x06, -0x12, 0x37, 0x5D, 0xE4, 0x90, 0xA5, 0x07, 0xF0, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x80, 0x00, -0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x12, 0x5E, 0xA6, 0x90, -0xA6, 0x6B, 0x12, 0x27, 0x54, 0x03, 0xFF, 0x80, 0x00, 0x90, 0xA5, 0x07, 0xE0, 0x25, 0xE0, 0x25, -0xE0, 0x24, 0xE4, 0xF5, 0x82, 0xE4, 0x34, 0xA5, 0xF5, 0x83, 0x12, 0x48, 0x4B, 0x78, 0x01, 0x12, -0x27, 0x22, 0xE4, 0xFF, 0xEE, 0x54, 0x80, 0xFE, 0xEC, 0x54, 0x03, 0xFC, 0x90, 0xA6, 0x6F, 0x12, -0x27, 0x48, 0x7F, 0x78, 0x7E, 0x09, 0x12, 0x5E, 0xAA, 0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x00, -0x00, 0x07, 0xFF, 0x90, 0xA5, 0x07, 0xE0, 0x25, 0xE0, 0x25, 0xE0, 0x24, 0xF0, 0xF5, 0x82, 0xE4, -0x34, 0xA5, 0xF5, 0x83, 0x12, 0x48, 0x4B, 0x78, 0x10, 0x12, 0x27, 0x22, 0xEE, 0x54, 0x07, 0xFE, -0xE4, 0xFD, 0xFC, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x48, 0x7F, 0x78, 0x7E, 0x09, 0x12, 0x5E, 0xAA, -0x90, 0xA6, 0x6B, 0x12, 0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA6, 0x6F, 0x12, 0x27, 0x54, -0x80, 0x00, 0x00, 0x00, 0x12, 0x5E, 0xA6, 0x90, 0xA5, 0x04, 0xE0, 0xFF, 0x7D, 0x01, 0x12, 0xA8, -0xB7, 0x90, 0xA5, 0x26, 0xEF, 0xF0, 0xFB, 0x90, 0xA6, 0x14, 0x12, 0x48, 0x4B, 0x90, 0xA5, 0x07, -0xE0, 0xFA, 0x25, 0xE0, 0x25, 0xE0, 0x24, 0xFC, 0xF5, 0x82, 0xE4, 0x34, 0xA5, 0xF5, 0x83, 0x12, -0x27, 0x48, 0x90, 0xA6, 0x18, 0x12, 0x48, 0x4B, 0xEA, 0x25, 0xE0, 0x25, 0xE0, 0x24, 0x08, 0xF5, -0x82, 0xE4, 0x34, 0xA6, 0xF5, 0x83, 0x12, 0x27, 0x48, 0xEB, 0x60, 0x06, 0x90, 0xA5, 0x22, 0xE0, -0x04, 0xF0, 0x90, 0xA5, 0x07, 0xE0, 0x04, 0xF0, 0xE0, 0xC3, 0x94, 0x03, 0x50, 0x02, 0x41, 0xF8, -0x90, 0xA5, 0x21, 0xE0, 0x70, 0x1C, 0x90, 0xA5, 0x47, 0x12, 0x27, 0x54, 0x00, 0x00, 0x02, 0x00, -0x90, 0xA5, 0x4B, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x90, 0xA5, 0x04, 0xE0, 0xFF, 0x02, -0xA7, 0xA2, 0xE4, 0x90, 0xA5, 0x07, 0xF0, 0x90, 0xA5, 0x07, 0xE0, 0xFB, 0x25, 0xE0, 0x25, 0xE0, -0x24, 0xE4, 0xF5, 0x82, 0xE4, 0x34, 0xA5, 0xF5, 0x83, 0x12, 0x48, 0x4B, 0x78, 0x10, 0x12, 0x27, -0x22, 0xEB, 0x25, 0xE0, 0x24, 0x2E, 0xF5, 0x82, 0xE4, 0x34, 0xA5, 0xF5, 0x83, 0xEE, 0xF0, 0xA3, -0xEF, 0xF0, 0x90, 0xA5, 0x07, 0xE0, 0xFB, 0x25, 0xE0, 0x25, 0xE0, 0x24, 0xF0, 0xF5, 0x82, 0xE4, -0x34, 0xA5, 0xF5, 0x83, 0x12, 0x48, 0x4B, 0x78, 0x10, 0x12, 0x27, 0x22, 0xEB, 0x25, 0xE0, 0x24, -0x34, 0xF5, 0x82, 0xE4, 0x34, 0xA5, 0xF5, 0x83, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0x90, 0xA5, 0x07, -0xE0, 0xFB, 0x25, 0xE0, 0x25, 0xE0, 0x24, 0xFC, 0xF5, 0x82, 0xE4, 0x34, 0xA5, 0xF5, 0x83, 0x12, -0x48, 0x4B, 0x78, 0x11, 0x12, 0x27, 0x22, 0xEB, 0x25, 0xE0, 0x24, 0x3A, 0xF5, 0x82, 0xE4, 0x34, -0xA5, 0xF5, 0x83, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0x90, 0xA5, 0x07, 0xE0, 0xFB, 0x25, 0xE0, 0x25, -0xE0, 0x24, 0x08, 0xF5, 0x82, 0xE4, 0x34, 0xA6, 0xF5, 0x83, 0x12, 0x48, 0x4B, 0x78, 0x11, 0x12, -0x27, 0x22, 0xEB, 0x25, 0xE0, 0x24, 0x40, 0xF5, 0x82, 0xE4, 0x34, 0xA5, 0xF5, 0x83, 0xEE, 0xF0, -0xA3, 0xEF, 0xF0, 0x90, 0xA5, 0x07, 0xE0, 0x04, 0xF0, 0xE0, 0x64, 0x03, 0x60, 0x02, 0x81, 0x17, -0xE4, 0x90, 0xA5, 0x06, 0xF0, 0x90, 0xA5, 0x21, 0xE0, 0xFF, 0x90, 0xA5, 0x06, 0xE0, 0xFE, 0xC3, -0x9F, 0x40, 0x02, 0xC1, 0x52, 0xEE, 0x04, 0x90, 0xA5, 0x08, 0xF0, 0x90, 0xA5, 0x21, 0xE0, 0xFF, -0x90, 0xA5, 0x08, 0xE0, 0xFE, 0xC3, 0x9F, 0x40, 0x02, 0xC1, 0x42, 0xEE, 0x25, 0xE0, 0x24, 0x2E, -0xF5, 0x82, 0xE4, 0x34, 0xA5, 0xF5, 0x83, 0xE0, 0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00, 0x00, 0x02, 0x00, 0x90, 0xA5, 0x4B, -0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x90, 0xA5, 0x04, 0xE0, 0xFF, 0x12, 0xA7, 0xA2, 0x90, -0xA5, 0x22, 0xE0, 0x70, 0x17, 0x90, 0xA5, 0x47, 0x12, 0x27, 0x54, 0x00, 0x00, 0x01, 0x00, 0x90, -0xA5, 0x4B, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x02, 0xB8, 0x6B, 0xE4, 0x90, 0xA5, 0x06, -0xF0, 0x90, 0xA5, 0x22, 0xE0, 0xFF, 0x90, 0xA5, 0x06, 0xE0, 0xFE, 0xC3, 0x9F, 0x40, 0x03, 0x02, -0xB8, 0x36, 0xEE, 0x04, 0x90, 0xA5, 0x08, 0xF0, 0x90, 0xA5, 0x22, 0xE0, 0xFF, 0x90, 0xA5, 0x08, -0xE0, 0xFE, 0xC3, 0x9F, 0x40, 0x03, 0x02, 0xB8, 0x25, 0xEE, 0x25, 0xE0, 0x24, 0x3A, 0xF5, 0x82, -0xE4, 0x34, 0xA5, 0xF5, 0x83, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x90, 0xA5, 0x06, 0xE0, 0x25, 0xE0, -0x24, 0x3A, 0xF5, 0x82, 0xE4, 0x34, 0xA5, 0xF5, 0x83, 0xE0, 0xFC, 0xA3, 0xE0, 0xC3, 0x9F, 0xFF, -0xEC, 0x9E, 0xFE, 0x33, 0x95, 0xE0, 0xFD, 0xFC, 0x90, 0xA5, 0x19, 0x12, 0x27, 0x48, 0xE4, 0x7F, -0x04, 0xFE, 0xFD, 0xFC, 0x90, 0xA5, 0x19, 0x12, 0x48, 0x67, 0xC3, 0x12, 0x47, 0x96, 0x40, 0x03, -0x02, 0xB8, 0x1C, 0x74, 0xFF, 0x7F, 0xFC, 0xFE, 0xFD, 0xFC, 0x90, 0xA5, 0x19, 0x12, 0x48, 0x67, -0xD3, 0x12, 0x47, 0x96, 0x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, 0xFF, 0xEA, 0x25, 0xE0, -0x24, 0x40, 0xF5, 0x82, 0xE4, 0x34, 0xA5, 0xF5, 0x83, 0xE0, 0xFC, 0xA3, 0xE0, 0x2F, 0xFF, 0xEC, -0x3E, 0xA2, 0xE7, 0x13, 0xFE, 0xEF, 0x13, 0xFF, 0xEE, 0x33, 0x95, 0xE0, 0xFD, 0xFC, 0x90, 0xA5, -0x15, 0x12, 0x27, 0x48, 0x90, 0xA5, 0x24, 0x74, 0x01, 0xF0, 0x80, 0x09, 0x90, 0xA5, 0x08, 0xE0, -0x04, 0xF0, 0x02, 0xB6, 0xC8, 0x90, 0xA5, 0x24, 0xE0, 0x64, 0x01, 0x60, 0x09, 0x90, 0xA5, 0x06, -0xE0, 0x04, 0xF0, 0x02, 0xB6, 0xB1, 0x90, 0xA5, 0x24, 0xE0, 0xB4, 0x01, 0x1A, 0x90, 0xA5, 0x11, -0x12, 0x48, 0x4B, 0x90, 0xA5, 0x47, 0x12, 0x27, 0x48, 0x90, 0xA5, 0x15, 0x12, 0x48, 0x4B, 0x90, -0xA5, 0x4B, 0x12, 0x27, 0x48, 0x80, 0x14, 0x90, 0xA5, 0x47, 0x12, 0x27, 0x54, 0x00, 0x00, 0x01, -0x00, 0x90, 0xA5, 0x4B, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x90, 0xA5, 0x04, 0xE0, 0xFF, -0x02, 0xA6, 0x77, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0xA6, 0xDE, 0xED, 0xF0, 0x90, -0xA6, 0xDD, 0xEF, 0xF0, 0xD3, 0x94, 0x07, 0x50, 0x70, 0xE0, 0xFF, 0x74, 0x01, 0xA8, 0x07, 0x08, -0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0xF4, 0xFF, 0x90, 0x00, 0x47, 0xE0, 0x5F, 0xFD, 0x7F, 0x47, -0x12, 0x3A, 0x96, 0x90, 0xA6, 0xDD, 0xE0, 0xFF, 0x74, 0x01, 0xA8, 0x07, 0x08, 0x80, 0x02, 0xC3, -0x33, 0xD8, 0xFC, 0xFF, 0x90, 0x00, 0x46, 0xE0, 0x4F, 0xFD, 0x7F, 0x46, 0x12, 0x3A, 0x96, 0x90, -0xA6, 0xDE, 0xE0, 0x60, 0x18, 0x90, 0xA6, 0xDD, 0xE0, 0xFF, 0x74, 0x01, 0xA8, 0x07, 0x08, 0x80, -0x02, 0xC3, 0x33, 0xD8, 0xFC, 0xFF, 0x90, 0x00, 0x45, 0xE0, 0x4F, 0x80, 0x17, 0x90, 0xA6, 0xDD, -0xE0, 0xFF, 0x74, 0x01, 0xA8, 0x07, 0x08, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0xF4, 0xFF, 0x90, -0x00, 0x45, 0xE0, 0x5F, 0xFD, 0x7F, 0x45, 0x80, 0x7E, 0x90, 0xA6, 0xDD, 0xE0, 0x24, 0xF8, 0xF0, -0xE0, 0x24, 0x04, 0xFF, 0x74, 0x01, 0xA8, 0x07, 0x08, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0xF4, -0xFF, 0x90, 0x00, 0x43, 0xE0, 0x5F, 0xFD, 0x7F, 0x43, 0x12, 0x3A, 0x96, 0x90, 0xA6, 0xDD, 0xE0, -0xFF, 0x74, 0x01, 0xA8, 0x07, 0x08, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0xFF, 0x90, 0x00, 0x43, -0xE0, 0x4F, 0xFD, 0x7F, 0x43, 0x12, 0x3A, 0x96, 0x90, 0xA6, 0xDE, 0xE0, 0x60, 0x1D, 0x90, 0xA6, -0xDD, 0xE0, 0x24, 0x04, 0xFF, 0x74, 0x01, 0xA8, 0x07, 0x08, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, -0xFF, 0x90, 0x00, 0x42, 0xE0, 0x4F, 0xFD, 0x7F, 0x42, 0x80, 0x1C, 0x90, 0xA6, 0xDD, 0xE0, 0x24, -0x04, 0x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F0, -0x90, 0xA3, 0x9E, 0xE0, 0x54, 0xBF, 0xF0, 0x54, 0x7F, 0xF0, 0xA3, 0xE0, 0x54, 0xFE, 0xF0, 0x54, -0xFD, 0xF0, 0x54, 0xF7, 0xF0, 0x90, 0xA3, 0xAE, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x90, -0xA2, 0x2A, 0xE0, 0xB4, 0x01, 0x08, 0x90, 0xA3, 0xAB, 0x74, 0xFF, 0xF0, 0x80, 0x12, 0x90, 0xA2, -0x2A, 0xE0, 0x90, 0xA3, 0xAB, 0xB4, 0x03, 0x05, 0x74, 0xD4, 0xF0, 0x80, 0x03, 0x74, 0x41, 0xF0, -0x90, 0xA3, 0xB2, 0x74, 0x01, 0xF0, 0xA3, 0x74, 0x05, 0xF0, 0xA3, 0xE0, 0x54, 0x01, 0x44, 0x28, -0xF0, 0xA3, 0x74, 0x05, 0xF0, 0xE4, 0xA3, 0xF0, 0xA3, 0xE0, 0x54, 0xFD, 0xF0, 0x54, 0xFB, 0xF0, -0x54, 0xF7, 0xF0, 0x54, 0xEF, 0xF0, 0x54, 0xDF, 0xF0, 0x54, 0xBF, 0xF0, 0xE4, 0xA3, 0xF0, 0x22, -0x90, 0x04, 0x1A, 0xE0, 0xF4, 0x60, 0x03, 0x7F, 0x00, 0x22, 0x90, 0x04, 0x1B, 0xE0, 0x54, 0x07, -0x64, 0x07, 0x7F, 0x01, 0x60, 0x02, 0x7F, 0x00, 0x22, 0x71, 0x40, 0xEF, 0x64, 0x01, 0x60, 0x08, -0x90, 0x01, 0xB8, 0x74, 0x01, 0xF0, 0x80, 0x67, 0x90, 0xA3, 0xA5, 0xE0, 0xFF, 0x54, 0x03, 0x60, -0x08, 0x90, 0x01, 0xB8, 0x74, 0x02, 0xF0, 0x80, 0x56, 0x90, 0xA3, 0xA3, 0xE0, 0xFE, 0xE4, 0xC3, -0x9E, 0x50, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x04, 0xF0, 0x80, 0x44, 0xEF, 0x30, 0xE2, 0x08, 0x90, -0x01, 0xB8, 0x74, 0x08, 0xF0, 0x80, 0x38, 0x90, 0xA3, 0xA5, 0xE0, 0x30, 0xE4, 0x08, 0x90, 0x01, -0xB8, 0x74, 0x10, 0xF0, 0x80, 0x29, 0x90, 0xA3, 0x9F, 0xE0, 0x13, 0x13, 0x54, 0x3F, 0x20, 0xE0, -0x08, 0x90, 0x01, 0xB8, 0x74, 0x20, 0xF0, 0x80, 0x16, 0x90, 0xA3, 0xB8, 0xE0, 0x60, 0x08, 0x90, -0x01, 0xB8, 0x74, 0x80, 0xF0, 0x80, 0x08, 0x90, 0x01, 0xB8, 0xE4, 0xF0, 0x7F, 0x01, 0x22, 0x90, -0x01, 0xB9, 0x74, 0x04, 0xF0, 0x7F, 0x00, 0x22, 0xEF, 0x24, 0xFE, 0x60, 0x0C, 0x04, 0x70, 0x28, -0x90, 0xA3, 0xA7, 0x74, 0x01, 0xF0, 0xA3, 0xF0, 0x22, 0xED, 0x70, 0x0A, 0x90, 0xA3, 0xB5, 0xE0, -0x90, 0xA3, 0xA7, 0xF0, 0x80, 0x05, 0x90, 0xA3, 0xA7, 0xED, 0xF0, 0x90, 0xA3, 0xA7, 0xE0, 0xA3, -0xF0, 0x90, 0xA3, 0x9F, 0xE0, 0x44, 0x08, 0xF0, 0x22, 0xEF, 0x60, 0x3E, 0x90, 0xA3, 0x1D, 0xE0, -0x64, 0x01, 0x70, 0x36, 0x90, 0xA3, 0x9F, 0xE0, 0x54, 0xFE, 0xF0, 0x90, 0x05, 0x22, 0x74, 0x0F, -0xF0, 0x90, 0x06, 0x04, 0xE0, 0x54, 0xBF, 0xF0, 0xE4, 0xFF, 0x12, 0x57, 0xA6, 0xBF, 0x01, 0x0E, -0x90, 0xA3, 0x9E, 0xE0, 0x44, 0x40, 0xF0, 0x90, 0xA3, 0xA4, 0x74, 0x06, 0xF0, 0x22, 0x90, 0x01, -0xB9, 0x74, 0x01, 0xF0, 0x90, 0x01,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, -0xE0, 0xFD, 0xEF, 0xC3, 0x94, 0x80, 0x90, 0xFD, 0x12, 0x50, 0x04, 0xE4, 0xF0, 0x80, 0x03, 0x74, -0x01, 0xF0, 0x90, 0xFD, 0x10, 0xED, 0xF0, 0xAF, 0x06, 0x22, 0x8E, 0x9B, +0xF5, 0x83, 0xE0, 0x44, 0x10, 0xF0, 0x22, 0xF5, 0x82, 0xE4, 0x34, 0xFB, 0xF5, 0x83, 0x22, 0x90, +0xA5, 0xBC, 0xEF, 0xF0, 0xA3, 0x12, 0x48, 0x7A, 0x90, 0xA5, 0xEC, 0xE0, 0xFE, 0x04, 0xF0, 0x90, +0x00, 0x01, 0xEE, 0x12, 0x26, 0x76, 0x74, 0x00, 0x2F, 0xF9, 0xE4, 0x34, 0xFB, 0xFA, 0x7B, 0x01, +0xC0, 0x03, 0xC0, 0x02, 0xC0, 0x01, 0x90, 0xA5, 0xBD, 0x12, 0x48, 0x71, 0x8B, 0x40, 0x8A, 0x41, +0x89, 0x42, 0x75, 0x43, 0x02, 0xD0, 0x01, 0xD0, 0x02, 0xD0, 0x03, 0x12, 0x34, 0x2C, 0x90, 0xA5, +0xBC, 0xE0, 0x24, 0x02, 0xF9, 0xE4, 0x34, 0xFB, 0xFA, 0x7B, 0x01, 0xC0, 0x03, 0xC0, 0x02, 0xC0, +0x01, 0xA3, 0x12, 0x48, 0x71, 0xE9, 0x24, 0x02, 0xF9, 0xE4, 0x3A, 0x8B, 0x40, 0xF5, 0x41, 0x89, +0x42, 0x90, 0xA5, 0xBD, 0x91, 0xD1, 0xF5, 0x43, 0xD0, 0x01, 0xD0, 0x02, 0xD0, 0x03, 0x02, 0x34, +0x2C, 0x12, 0x48, 0x71, 0x90, 0x00, 0x0E, 0x02, 0x26, 0x37, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, +0xD0, 0xE4, 0xFF, 0x90, 0xA2, 0x6D, 0xE0, 0xFE, 0x90, 0xA2, 0x6C, 0xE0, 0xFD, 0xB5, 0x06, 0x04, +0x7E, 0x01, 0x80, 0x02, 0x7E, 0x00, 0xEE, 0x64, 0x01, 0x60, 0x40, 0xED, 0x12, 0x97, 0xDD, 0xFA, +0x7B, 0x01, 0x71, 0x9A, 0x7F, 0x01, 0xEF, 0x60, 0x32, 0x90, 0xA2, 0x6C, 0xE0, 0x04, 0xF0, 0xE0, +0xB4, 0x0A, 0x02, 0x80, 0x02, 0x7F, 0x00, 0xEF, 0x60, 0x05, 0xE4, 0x90, 0xA2, 0x6C, 0xF0, 0x90, +0xA2, 0x6D, 0xE0, 0xFF, 0x90, 0xA2, 0x6C, 0xE0, 0xB5, 0x07, 0x04, 0x7F, 0x01, 0x80, 0x02, 0x7F, +0x00, 0xEF, 0x70, 0x07, 0x90, 0xA1, 0x76, 0xE0, 0x44, 0x04, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, +0x90, 0xA5, 0xDC, 0x12, 0x48, 0x7A, 0xE4, 0xFF, 0x90, 0xA5, 0xDC, 0x12, 0x48, 0x71, 0x8F, 0x82, +0xB1, 0x60, 0xFE, 0x74, 0xF0, 0x2F, 0xF1, 0x90, 0xEE, 0xF0, 0x0F, 0xEF, 0xB4, 0x10, 0xE9, 0x22, +0x75, 0x83, 0x00, 0x02, 0x26, 0x37, 0x90, 0xA4, 0x98, 0x12, 0x48, 0x7A, 0x90, 0xA5, 0x78, 0x12, +0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, +0x12, 0x86, 0x50, 0xE4, 0x90, 0xA4, 0x9E, 0xF0, 0x12, 0x87, 0xAC, 0x90, 0xA4, 0x9E, 0xE0, 0xFF, +0xF5, 0x82, 0xB1, 0x60, 0xFE, 0xEF, 0xF1, 0x7E, 0xF5, 0x82, 0x8C, 0x83, 0xEE, 0xF0, 0x90, 0xA4, +0x9E, 0xE0, 0x04, 0xF0, 0xE0, 0xB4, 0x03, 0xE0, 0xE4, 0x90, 0xA4, 0x9E, 0xF0, 0x90, 0xA4, 0x9E, +0xE0, 0xFD, 0xF1, 0x74, 0x12, 0x82, 0x11, 0xC0, 0x06, 0xC0, 0x07, 0xB1, 0xD9, 0x75, 0xF0, 0x04, +0xED, 0xF1, 0x0A, 0x12, 0x47, 0xDF, 0x12, 0x80, 0x68, 0xD0, 0x07, 0xD0, 0x06, 0xF1, 0xAC, 0x94, +0x07, 0x40, 0xDA, 0x22, 0x7F, 0x01, 0x12, 0x87, 0xE1, 0x90, 0xA4, 0x9B, 0x02, 0x48, 0x71, 0x90, +0xA4, 0x98, 0x12, 0x48, 0x7A, 0x90, 0xA5, 0x78, 0x12, 0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0x90, +0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x12, 0x86, 0x50, 0x7D, 0x65, 0xE4, 0x12, +0x87, 0xA9, 0x12, 0x48, 0x0F, 0x7D, 0x8F, 0xE4, 0x12, 0x87, 0xA9, 0xD1, 0x2B, 0x12, 0x87, 0xA9, +0x90, 0x00, 0x08, 0x12, 0x48, 0x29, 0x7D, 0x65, 0xB1, 0xD4, 0x12, 0x48, 0x0F, 0x7D, 0x8F, 0xB1, +0xD4, 0xD1, 0x2B, 0xB1, 0xD4, 0x90, 0x00, 0x08, 0x02, 0x48, 0x29, 0x90, 0x00, 0x04, 0x12, 0x48, +0x29, 0xE4, 0xFD, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xD1, 0x86, 0xF1, 0x11, 0xD1, +0x97, 0xD1, 0xA8, 0x7B, 0x01, 0x7A, 0xA4, 0x79, 0x8C, 0x90, 0xA4, 0x9B, 0x12, 0x48, 0x7A, 0x7A, +0xA4, 0x79, 0x80, 0xB1, 0xDF, 0x12, 0xB7, 0xAC, 0xE4, 0xFF, 0x12, 0x88, 0x75, 0x7B, 0x01, 0x7A, +0xA4, 0x79, 0x80, 0xE4, 0xFF, 0x12, 0x88, 0x21, 0x7F, 0x01, 0x12, 0x88, 0x75, 0x7B, 0x01, 0x7A, +0xA4, 0x79, 0x8C, 0x7F, 0x01, 0x12, 0x88, 0x21, 0xD1, 0x97, 0x12, 0x80, 0x6E, 0xD1, 0x86, 0xB1, +0x66, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x7B, 0x01, 0x7A, 0xA4, 0x79, 0x34, 0x90, 0xA4, 0x9B, 0x12, +0x48, 0x7A, 0x7A, 0xA4, 0x79, 0x31, 0x22, 0x7B, 0x01, 0x7A, 0xA4, 0x79, 0x68, 0x90, 0xA4, 0x9B, +0x12, 0x48, 0x7A, 0x7A, 0xA4, 0x79, 0x50, 0x22, 0x90, 0xA4, 0x98, 0x12, 0x48, 0x7A, 0x90, 0xA5, +0x78, 0x12, 0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x00, +0x00, 0x00, 0x12, 0x86, 0x50, 0xE4, 0x90, 0xA4, 0x9E, 0xF0, 0x90, 0xA4, 0x9E, 0xE0, 0xFF, 0xC3, +0x94, 0x06, 0x50, 0x1D, 0xEF, 0xF1, 0x98, 0x12, 0x82, 0x11, 0x12, 0x36, 0xCE, 0x90, 0xA4, 0x98, +0xF1, 0x00, 0xD1, 0xF2, 0xF1, 0xA2, 0x12, 0x82, 0x11, 0xD1, 0xFA, 0xD1, 0xF2, 0x04, 0xF0, 0x80, +0xD9, 0x22, 0x12, 0x48, 0x29, 0x90, 0xA4, 0x9E, 0xE0, 0x22, 0x12, 0x36, 0xCE, 0x90, 0xA4, 0x9B, +0x12, 0x48, 0x71, 0x90, 0xA4, 0x9E, 0xE0, 0x75, 0xF0, 0x04, 0xA4, 0xF5, 0x82, 0x85, 0xF0, 0x83, +0x22, 0x90, 0xA4, 0x98, 0x12, 0x48, 0x7A, 0x90, 0xA5, 0x78, 0x12, 0x27, 0x54, 0x80, 0x00, 0x00, +0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x12, 0x86, 0x50, 0xE4, 0x90, +0xA4, 0x9E, 0xF0, 0x90, 0xA4, 0x9E, 0xE0, 0xFF, 0xF1, 0x7E, 0xF5, 0x82, 0x8C, 0x83, 0xE0, 0xFE, +0x12, 0x87, 0xAC, 0x8F, 0x82, 0x75, 0x83, 0x00, 0xEE, 0x12, 0x26, 0x76, 0x90, 0xA4, 0x9E, 0xE0, +0x04, 0xF0, 0xE0, 0xB4, 0x03, 0xDD, 0xE4, 0x90, 0xA4, 0x9E, 0xF0, 0x90, 0xA4, 0x9E, 0xE0, 0xFF, +0xC3, 0x94, 0x07, 0x50, 0x0E, 0xEF, 0xF1, 0x74, 0x12, 0x82, 0x11, 0xD1, 0xFA, 0xD1, 0xF2, 0x04, +0xF0, 0x80, 0xE8, 0x22, 0x25, 0xE0, 0x24, 0xA5, 0xF5, 0x82, 0xE4, 0x34, 0x44, 0x22, 0x25, 0xE0, +0x24, 0x9F, 0xF5, 0x82, 0xE4, 0x34, 0x44, 0xF5, 0x83, 0xE4, 0x93, 0xFC, 0x74, 0x01, 0x93, 0x22, +0xF5, 0x82, 0xE4, 0x34, 0x02, 0xF5, 0x83, 0x22, 0x25, 0xE0, 0x24, 0xB3, 0xF5, 0x82, 0xE4, 0x34, +0x44, 0x22, 0x25, 0xE0, 0x24, 0xBF, 0xF5, 0x82, 0xE4, 0x34, 0x44, 0x22, 0x12, 0x37, 0x5D, 0x90, +0xA4, 0x9E, 0xE0, 0x04, 0xF0, 0xE0, 0xC3, 0x22, 0x12, 0x4F, 0xBD, 0x90, 0xA3, 0x69, 0x12, 0x4F, +0xB5, 0x90, 0xA3, 0x6A, 0xF0, 0xD1, 0x34, 0x7F, 0x01, 0x02, 0x97, 0x7D, 0xE4, 0xF5, 0x55, 0xF5, +0x56, 0xF5, 0x57, 0x75, 0x58, 0x80, 0xAD, 0x55, 0x7F, 0x50, 0x12, 0x3A, 0x96, 0xAD, 0x56, 0x7F, +0x51, 0x12, 0x3A, 0x96, 0xAD, 0x57, 0x7F, 0x52, 0x12, 0x3A, 0x96, 0xAD, 0x58, 0x7F, 0x53, 0x02, +0x3A, 0x96, 0x75, 0x5D, 0x12, 0xE4, 0xF5, 0x5E, 0x75, 0x5F, 0x07, 0x75, 0x60, 0x72, 0x90, 0x01, +0x30, 0xE5, 0x5D, 0xF0, 0xA3, 0xE5, 0x5E, 0xF0, 0xA3, 0xE5, 0x5F, 0xF0, 0xA3, 0xE5, 0x60, 0xF0, +0x22, 0x75, 0x65, 0x0E, 0x75, 0x66, 0x01, 0x75, 0x67, 0x03, 0x75, 0x68, 0x62, 0x90, 0x01, 0x38, +0xE5, 0x65, 0xF0, 0xA3, 0xE5, 0x66, 0xF0, 0xA3, 0xE5, 0x67, 0xF0, 0xA3, 0xE5, 0x68, 0xF0, 0x22, +0x90, 0x01, 0x94, 0xE0, 0x44, 0x01, 0xF0, 0x90, 0x01, 0xC7, 0xE4, 0xF0, 0x22, 0x90, 0x01, 0x01, +0xE0, 0x44, 0x04, 0xF0, 0x90, 0x01, 0x9C, 0x74, 0x7E, 0xF0, 0xA3, 0x74, 0x92, 0xF0, 0xA3, 0x74, +0xA0, 0xF0, 0xA3, 0x74, 0x24, 0xF0, 0x90, 0x01, 0x9B, 0x74, 0x49, 0xF0, 0x90, 0x01, 0x9A, 0x74, +0xE0, 0xF0, 0x90, 0x01, 0x99, 0xE4, 0xF0, 0x90, 0x01, 0x98, 0x04, 0xF0, 0x22, 0x7D, 0x02, 0x90, +0x01, 0xC4, 0x74, 0x6D, 0xF0, 0x74, 0xA8, 0xA3, 0xF0, 0x90, 0xA3, 0x3B, 0xE0, 0xFF, 0xED, 0xC3, +0x9F, 0x50, 0x10, 0xED, 0x25, 0xE0, 0x24, 0x81, 0xF8, 0xE6, 0x30, 0xE4, 0x03, 0x7F, 0x00, 0x22, +0x0D, 0x80, 0xE6, 0x74, 0x6D, 0x04, 0x90, 0x01, 0xC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22, 0x90, 0xA2, 0x83, 0xE0, 0x30, 0xE0, 0x11, 0xA3, 0x74, 0x01, 0xF0, 0x90, 0xA2, 0x83, 0xE0, +0xFF, 0xC3, 0x13, 0x30, 0xE0, 0x03, 0x12, 0x7E, 0xFA, 0x02, 0x66, 0x23, 0x90, 0xA2, 0x83, 0xE0, +0xFF, 0x30, 0xE0, 0x05, 0x12, 0x79, 0xCD, 0x60, 0x15, 0x90, 0xA2, 0x8C, 0xE0, 0x70, 0x04, 0xEF, +0x30, 0xE0, 0x0B, 0x90, 0xA2, 0x8F, 0xE0, 0x64, 0x02, 0x60, 0x03, 0x12, 0x63, 0x7B, 0x22, 0x90, +0xA2, 0x8C, 0xE0, 0x70, 0x07, 0x90, 0xA2, 0x83, 0xE0, 0x30, 0xE0, 0x13, 0x90, 0xA2, 0x83, 0xE0, +0x30, 0xE0, 0x09, 0x12, 0x63, 0x32, 0xBF, 0x01, 0x06, 0x02, 0x79, 0x60, 0x12, 0x57, 0x9F, 0x22, +0xEF, 0x90, 0x02, 0x86, 0x60, 0x06, 0xE0, 0x44, 0x04, 0xF0, 0x80, 0x04, 0xE0, 0x54, 0xFB, 0xF0, +0x90, 0xA1, 0x7B, 0xED, 0xF0, 0x22, 0xE4, 0x90, 0xA5, 0x09, 0xF0, 0xA3, 0xF0, 0xA3, 0xF0, 0x90, +0x00, 0x83, 0xE0, 0x90, 0xA5, 0x09, 0xF0, 0x90, 0x00, 0x83, 0xE0, 0xFE, 0x90, 0xA5, 0x09, 0xE0, +0xFF, 0xB5, 0x06, 0x01, 0x22, 0xC3, 0x90, 0xA5, 0x0B, 0xE0, 0x94, 0x64, 0x90, 0xA5, 0x0A, 0xE0, +0x94, 0x00, 0x40, 0x0D, 0x90, 0x01, 0xC0, 0xE0, 0x44, 0x40, 0xF0, 0x90, 0xA5, 0x09, 0xE0, 0xFF, +0x22, 0x90, 0xA5, 0x0A, 0x12, 0x58, 0xB3, 0x80, 0xC6, 0x90, 0xA5, 0xE2, 0x12, 0x5F, 0xE5, 0x90, +0x01, 0x09, 0xE0, 0x7F, 0x00, 0x30, 0xE7, 0x02, 0x7F, 0x01, 0x90, 0xA5, 0xE2, 0xE0, 0x6F, 0x60, +0x36, 0xC3, 0x90, 0xA5, 0xE4, 0xE0, 0x94, 0x88, 0x90, 0xA5, 0xE3, 0xE0, 0x94, 0x13, 0x40, 0x08, +0x90, 0x01, 0xC0, 0xE0, 0x44, 0x10, 0xF0, 0x22, 0x90, 0xA5, 0xE3, 0x12, 0x58, 0xB3, 0x12, 0x5F, +0xBF, 0xD3, 0x90, 0xA5, 0xE4, 0xE0, 0x94, 0x32, 0x90, 0xA5, 0xE3, 0xE0, 0x94, 0x00, 0x40, 0xBF, +0x90, 0x01, 0xC6, 0xE0, 0x30, 0xE0, 0xB8, 0x22, 0x71, 0x33, 0x90, 0x00, 0x08, 0xE0, 0x54, 0xEF, +0xFD, 0x7F, 0x08, 0x12, 0x3A, 0x96, 0xE4, 0xFF, 0x51, 0x09, 0x90, 0xA1, 0x7C, 0xE0, 0xB4, 0x03, +0x0C, 0x90, 0x00, 0x70, 0xE0, 0x54, 0x7F, 0xFD, 0x7F, 0x70, 0x12, 0x3A, 0x96, 0x90, 0xA2, 0x89, +0xE0, 0x54, 0xEF, 0xF0, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x51, 0xC7, 0x51, 0x58, +0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0xA2, 0x8F, 0xE0, 0xFF, 0x60, 0x03, 0xB4, 0x08, 0x07, 0x71, +0x50, 0xBF, 0x01, 0x02, 0x51, 0x85, 0x22, 0x90, 0xA2, 0x88, 0xE0, 0x30, 0xE0, 0x18, 0x90, 0xA2, +0x83, 0xE0, 0xFF, 0x30, 0xE0, 0x0E, 0xC3, 0x13, 0x30, 0xE0, 0x07, 0x71, 0x26, 0xBF, 0x01, 0x06, +0x80, 0x02, 0x80, 0x00, 0x51, 0x95, 0x22, 0x90, 0xA2, 0x89, 0xE0, 0x44, 0x10, 0xF0, 0x90, 0xA1, +0x7C, 0xE0, 0xB4, 0x03, 0x0C, 0x90, 0x00, 0x70, 0xE0, 0x44, 0x80, 0xFD, 0x7F, 0x70, 0x12, 0x3A, +0x96, 0x90, 0xA2, 0x97, 0xE0, 0xFD, 0x7F, 0x93, 0x12, 0x3A, 0x96, 0x90, 0xA2, 0x8D, 0xE0, 0x60, +0x12, 0x90, 0x01, 0x2F, 0xE0, 0x30, 0xE7, 0x05, 0x74, 0x10, 0xF0, 0x80, 0x06, 0x90, 0x01, 0x2F, +0x74, 0x90, 0xF0, 0x90, 0x00, 0x08, 0xE0, 0x44, 0x10, 0xFD, 0x7F, 0x08, 0x12, 0x3A, 0x96, 0x7F, +0x01, 0x51, 0x09, 0x90, 0x00, 0x90, 0xE0, 0x44, 0x01, 0xFD, 0x7F, 0x90, 0x12, 0x3A, 0x96, 0x7F, +0x14, 0x7E, 0x00, 0x02, 0x3A, 0xF7, 0x90, 0xA2, 0x86, 0xE0, 0x64, 0x02, 0x7F, 0x01, 0x60, 0x02, +0x7F, 0x00, 0x22, 0x90, 0x01, 0xC4, 0x74, 0x33, 0xF0, 0x74, 0xAB, 0xA3, 0xF0, 0x90, 0x00, 0x90, +0xE0, 0x20, 0xE0, 0xF9, 0x74, 0x33, 0x04, 0x90, 0x01, 0xC4, 0xF0, 0x74, 0xAB, 0xA3, 0xF0, 0x22, +0x90, 0x02, 0x87, 0xE0, 0x70, 0x1F, 0x90, 0x01, 0x00, 0xE0, 0x64, 0x3F, 0x70, 0x17, 0x90, 0x02, +0x96, 0xE0, 0x70, 0x11, 0x90, 0x02, 0x86, 0xE0, 0x30, 0xE1, 0x0A, 0x90, 0x02, 0x86, 0xE0, 0x20, +0xE3, 0x03, 0x7F, 0x01, 0x22, 0x7F, 0x00, 0x22, 0xED, 0x54, 0x7F, 0xFC, 0xED, 0x54, 0x80, 0x60, +0x03, 0xAF, 0x04, 0x22, 0xEC, 0xB4, 0x3D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, 0xE5, +0x1D, 0xF0, 0xF5, 0x1A, 0x85, 0x1C, 0x27, 0x7B, 0x01, 0x02, 0x73, 0x79, 0x24, 0x75, 0xF5, 0x82, +0xE4, 0x34, 0xA0, 0xF5, 0x83, 0x22, 0xE5, 0x0F, 0x25, 0xE0, 0x24, 0x95, 0xF5, 0x82, 0xE4, 0x34, +0x42, 0x22, 0xEF, 0x60, 0x0A, 0xED, 0xD3, 0x94, 0x0B, 0x40, 0x04, 0x7E, 0x20, 0x80, 0x02, 0xE4, +0xFE, 0xED, 0x2E, 0xFF, 0x22, 0xEF, 0x60, 0x0A, 0xED, 0xC3, 0x94, 0x2C, 0x40, 0x04, 0x7E, 0x20, +0x80, 0x02, 0xE4, 0xFE, 0xC3, 0xED, 0x9E, 0xFF, 0x22, 0xAC, 0x07, 0x75, 0xF0, 0x04, 0xEC, 0x90, +0x96, 0x14, 0x12, 0x48, 0x65, 0x75, 0xF0, 0x04, 0xEC, 0x12, 0x76, 0x41, 0xE0, 0xFA, 0x74, 0x75, +0x2C, 0xB1, 0xBE, 0xE0, 0x54, 0x7F, 0xFD, 0x75, 0xF0, 0x04, 0xEC, 0x12, 0x6E, 0x88, 0xE0, 0xFF, +0x54, 0xF8, 0xFE, 0xEF, 0x04, 0x54, 0x07, 0x4E, 0xF0, 0x75, 0xF0, 0x04, 0xEC, 0x12, 0x6E, 0x88, +0xE0, 0xFF, 0x54, 0x07, 0xD3, 0x94, 0x02, 0x40, 0x47, 0x74, 0xA1, 0x2C, 0x12, 0x5F, 0x53, 0xE0, +0xF4, 0x70, 0x3D, 0x75, 0xF0, 0x04, 0xEC, 0x12, 0x6E, 0x88, 0xEF, 0x54, 0xF8, 0xF0, 0x74, 0x11, +0x2C, 0x12, 0x5C, 0x3E, 0x54, 0x7F, 0xFF, 0x75, 0xF0, 0x04, 0xEC, 0xD1, 0xD1, 0x54, 0x80, 0x4F, +0xF0, 0x74, 0x11, 0x2C, 0x12, 0x5C, 0x3E, 0x25, 0xE0, 0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0xE0, 0x4F, 0x90, 0xA5, 0x58, 0xF0, 0x90, +0xA5, 0x53, 0xE0, 0x90, 0xA5, 0x5A, 0xF0, 0x90, 0xA5, 0x54, 0x74, 0x0C, 0xF0, 0x90, 0xA5, 0x62, +0x74, 0x04, 0xF0, 0x7B, 0x01, 0x7A, 0xA5, 0x79, 0x54, 0x12, 0x97, 0x00, 0x90, 0xA5, 0x52, 0xE0, +0xFF, 0x90, 0xA5, 0x51, 0xE0, 0x12, 0x77, 0x82, 0xEF, 0xF0, 0x22, 0x90, 0x04, 0xA6, 0x74, 0x06, +0xF0, 0xE4, 0x90, 0xA4, 0x46, 0xF0, 0x90, 0xA4, 0x46, 0xE0, 0xFF, 0xC3, 0x94, 0x06, 0x50, 0x57, +0xEF, 0x90, 0x40, 0x56, 0x93, 0xFF, 0x94, 0x0A, 0x50, 0x02, 0x80, 0x02, 0x7F, 0x0A, 0xAE, 0x07, +0xEF, 0x24, 0x02, 0x90, 0xA4, 0x45, 0xF0, 0x90, 0xA4, 0x37, 0x74, 0x0E, 0xF0, 0x90, 0xA4, 0x39, +0x74, 0x01, 0xF0, 0x31, 0xE8, 0x90, 0xA4, 0x3A, 0xF0, 0xE4, 0xFF, 0xEF, 0xC3, 0x9E, 0x50, 0x16, +0x31, 0xE8, 0x2F, 0x51, 0x40, 0xE0, 0xFD, 0x74, 0x3B, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0xA4, 0xF5, +0x83, 0xED, 0xF0, 0x0F, 0x80, 0xE5, 0x7B, 0x01, 0x7A, 0xA4, 0x79, 0x37, 0x12, 0x97, 0x00, 0x90, +0xA4, 0x46, 0xE0, 0x04, 0xF0, 0x80, 0x9F, 0x22, 0x90, 0xA4, 0x46, 0xE0, 0x90, 0x40, 0x50, 0x93, +0x22, 0x90, 0xA4, 0x31, 0x12, 0x48, 0x7A, 0x90, 0x00, 0x05, 0x12, 0x26, 0x37, 0x30, 0xE1, 0x08, +0x90, 0x04, 0xA0, 0x74, 0x11, 0x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5, 0xE0, 0xB4, +0x0B, 0x16, 0x90, 0xA5, 0x78, 0x12, 0x27, 0x54, 0x00, 0x00, 0x0C, 0x00, 0x90, 0xA5, 0x7C, 0x12, +0x27, 0x54, 0x00, 0x00, 0x0C, 0x00, 0x80, 0x14, 0x90, 0xA5, 0x78, 0x12, 0x27, 0x54, 0x00, 0x00, +0x0C, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x00, 0x08, 0x00, 0x71, 0xB9, 0x90, 0xA5, +0xF6, 0xE0, 0x70, 0x20, 0x71, 0xC0, 0x60, 0x04, 0xEF, 0xB4, 0x0E, 0x18, 0x90, 0xA5, 0x78, 0x12, +0x27, 0x54, 0x00, 0x00, 0x03, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x00, 0x03, 0x00, +0x71, 0xB9, 0x80, 0x0E, 0x90, 0xA5, 0xF6, 0xE0, 0xB4, 0x01, 0x1D, 0x90, 0xA5, 0xF5, 0xE0, 0xB4, +0x0B, 0x16, 0x90, 0xA5, 0x78, 0x12, 0x27, 0x54, 0x40, 0x00, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, +0x27, 0x54, 0x40, 0x00, 0x00, 0x00, 0x80, 0x32, 0x90, 0xA5, 0xF6, 0xE0, 0x64, 0x02, 0x60, 0x78, +0x90, 0xA5, 0x78, 0x12, 0x27, 0x54, 0x00, 0x00, 0x03, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, +0x00, 0x00, 0x02, 0x00, 0x7F, 0xAC, 0x12, 0x86, 0x48, 0x12, 0x27, 0x54, 0x40, 0x00, 0x00, 0x00, +0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xC4, 0x80, 0x45, 0x90, 0xA5, +0xF6, 0xE0, 0x70, 0x20, 0x71, 0xC0, 0x60, 0x04, 0xEF, 0xB4, 0x0E, 0x18, 0x90, 0xA5, 0x78, 0x12, +0x27, 0x54, 0x00, 0x00, 0x03, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x00, 0x03, 0x00, +0x7F, 0xAC, 0x80, 0x1F, 0x90, 0xA5, 0xF5, 0xE0, 0xD3, 0x94, 0x0E, 0x50, 0x1B, 0x90, 0xA5, 0x78, +0x12, 0x27, 0x54, 0x00, 0x00, 0x03, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x00, 0x02, +0x00, 0x7F, 0xAC, 0x7E, 0x08, 0x12, 0x86, 0x54, 0x22, 0x7F, 0xAC, 0x7E, 0x08, 0x02, 0x86, 0x54, +0x90, 0xA5, 0xF5, 0xE0, 0xFF, 0x64, 0x0D, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, +0xA5, 0xD1, 0xED, 0xF0, 0xA3, 0xEB, 0xF0, 0x90, 0xA5, 0xD0, 0xEF, 0xF0, 0x90, 0xA5, 0xD3, 0xE0, +0xFD, 0xD1, 0x3C, 0x90, 0xA5, 0xD0, 0xE0, 0xC3, 0x94, 0x0E, 0x50, 0x40, 0x90, 0xA5, 0x78, 0x12, +0x27, 0x54, 0x1F, 0xFE, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x12, 0xD4, 0x00, 0x00, +0xD1, 0x21, 0x90, 0xA5, 0x66, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0x00, 0x90, 0xA5, 0x6A, 0x12, +0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x12, 0x96, 0x46, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0x00, +0x90, 0xA5, 0x6A, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0xA1, 0x4A, 0xD1, 0x32, 0x50, 0x1B, +0xEF, 0x94, 0x30, 0x50, 0x16, 0x90, 0xA5, 0x78, 0x12, 0x27, 0x54, 0x1F, 0xFE, 0x00, 0x00, 0x90, +0xA5, 0x7C, 0x12, 0x27, 0x54, 0x09, 0x28, 0x00, 0x00, 0x80, 0x64, 0x90, 0xA5, 0xD0, 0xE0, 0xFF, +0x74, 0x32, 0xD3, 0x9F, 0x50, 0x1B, 0xEF, 0x94, 0x40, 0x50, 0x16, 0x90, 0xA5, 0x78, 0x12, 0x27, +0x54, 0x1F, 0xFE, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x08, 0xA6, 0x00, 0x00, 0x80, +0x3E, 0xD1, 0x28, 0x50, 0x1B, 0xEF, 0x94, 0x74, 0x50, 0x16, 0x90, 0xA5, 0x78, 0x12, 0x27, 0x54, +0x1F, 0xFE, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x08, 0xA4, 0x00, 0x00, 0x80, 0x1F, +0x90, 0xA5, 0xD0, 0xE0, 0xFF, 0x74, 0x76, 0xD3, 0x9F, 0x50, 0x16, 0x90, 0xA5, 0x78, 0x12, 0x27, +0x54, 0x1F, 0xFE, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x08, 0x24, 0x00, 0x00, 0xD1, +0x21, 0xD1, 0x32, 0x50, 0x2F, 0xEF, 0x94, 0x40, 0x50, 0x2A, 0x90, 0xA5, 0x66, 0x12, 0x27, 0x54, +0x00, 0x07, 0x03, 0x00, 0x90, 0xA5, 0x6A, 0x12, 0x27, 0x54, 0x00, 0x01, 0x01, 0x00, 0x12, 0x96, +0x46, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0x00, 0x90, 0xA5, 0x6A, 0x12, 0x27, 0x54, 0x00, 0x01, +0x01, 0x00, 0x80, 0x66, 0xD1, 0x28, 0x50, 0x2F, 0xEF, 0x94, 0x8C, 0x50, 0x2A, 0x90, 0xA5, 0x66, +0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0x00, 0x90, 0xA5, 0x6A, 0x12, 0x27, 0x54, 0x00, 0x03, 0x01, +0x00, 0x12, 0x96, 0x46, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0x00, 0x90, 0xA5, 0x6A, 0x12, 0x27, +0x54, 0x00, 0x03, 0x01, 0x00, 0x80, 0x33, 0x90, 0xA5, 0xD0, 0xE0, 0xFF, 0x74, 0x8C, 0xC3, 0x9F, +0x50, 0x2E, 0x90, 0xA5, 0x66, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0x00, 0x90, 0xA5, 0x6A, 0x12, +0x27, 0x54, 0x00, 0x05, 0x01, 0x00, 0x12, 0x96, 0x46, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0x00, +0x90, 0xA5, 0x6A, 0x12, 0x27, 0x54, 0x00, 0x05, 0x01, 0x00, 0x12, 0x97, 0x9A, 0x12, 0x96, 0x52, +0x90, 0xA5, 0xD0, 0xE0, 0xFF, 0xA3, 0xE0, 0xFD, 0x51, 0xA0, 0x90, 0xA5, 0xD1, 0xE0, 0x64, 0x02, +0x70, 0x51, 0x90, 0xA5, 0xD0, 0xE0, 0xFF, 0xD3, 0x94, 0x30, 0x50, 0x05, 0x75, 0x74, 0x2A, 0x80, +0x5E, 0xEF, 0xD3, 0x94, 0x40, 0x50, 0x05, 0x75, 0x74, 0x3A, 0x80, 0x53, 0xEF, 0xD3, 0x94, 0x70, +0x50, 0x05, 0x75, 0x74, 0x6A, 0x80, 0x48, 0xEF, 0xD3, 0x94, 0x80, 0x50, 0x05, 0x75, 0x74, 0x7A, +0x80, 0x3D, 0xEF, 0xD3, 0x94, 0x90, 0x50, 0x05, 0x75, 0x74, 0x8A, 0x80, 0x32, 0xEF, 0xD3, 0x94, +0xA1, 0x50, 0x05, 0x75, 0x74, 0x9B, 0x80, 0x27, 0xEF, 0xD3, 0x94, 0xB1, 0x50, 0x21, 0x75, 0x74, +0xAB, 0x80, 0x1C, 0x90, 0xA5, 0xD1, 0xE0, 0x64, 0x01, 0x70, 0x32, 0xA3, 0xE0, 0x90, 0xA5, 0xD0, +0xB4, 0x01, 0x07, 0xE0, 0x24, 0x02, 0xF5, 0x74, 0x80, 0x05, 0xE0, 0x24, 0xFE, 0xF5, 0x74, 0x90, +0xA5, 0x66, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0xFF, 0xAF, 0x74, 0xE4, 0xFC, 0xFD, 0xFE, 0x12, +0x96, 0x40, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0xFF, 0xAF, 0x74, 0x80, 0x1F, 0x90, 0xA5, 0x66, +0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0xFF, 0x90, 0xA5, 0xD0, 0x12, 0x66, 0xFF, 0x12, 0x96, 0x40, +0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0xFF, 0x90, 0xA5, 0xD0, 0xE0, 0xFF, 0xE4, 0xFC, 0xFD, 0xFE, +0x90, 0xA5, 0x6A, 0x12, 0x27, 0x48, 0x12, 0x97, 0x9A, 0x12, 0x96, 0x52, 0xD0, 0xD0, 0x92, 0xAF, +0x22, 0x7F, 0x60, 0x7E, 0x08, 0x02, 0x86, 0x54, 0x90, 0xA5, 0xD0, 0xE0, 0xFF, 0x74, 0x64, 0xD3, +0x9F, 0x22, 0x90, 0xA5, 0xD0, 0xE0, 0xFF, 0x74, 0x24, 0xD3, 0x9F, 0x22, 0x90, 0xA5, 0xF8, 0xED, +0xF0, 0x90, 0xA5, 0xF7, 0xEF, 0xF0, 0xD3, 0x94, 0x0E, 0x50, 0x15, 0xD1, 0x7B, 0xEF, 0x60, 0x2A, +0xD1, 0x7B, 0xEF, 0x64, 0x01, 0x70, 0x23, 0x90, 0xA5, 0xF8, 0xE0, 0xFD, 0xE4, 0xFF, 0x80, 0x15, +0x90, 0xA5, 0xF7, 0xE0, 0xD3, 0x94, 0x0E, 0x40, 0x11, 0xD1, 0x7B, 0xEF, 0x70, 0x0A, 0x90, 0xA5, +0xF8, 0xE0, 0xFD, 0x7F, 0x01, 0x02, 0x86, 0xB3, 0xD1, 0x7B, 0x22, 0x90, 0x04, 0x54, 0xE0, 0x7F, +0x00, 0x30, 0xE7, 0x02, 0x7F, 0x01, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xA9, 0x07, +0x90, 0x06, 0x69, 0xE0, 0xFE, 0x90, 0x06, 0x68, 0xE0, 0x7A, 0x00, 0x24, 0x00, 0xFF, 0xEA, 0x3E, +0xFE, 0xE9, 0x14, 0x60, 0x0F, 0x14, 0x60, 0x1E, 0x24, 0x02, 0x70, 0x25, 0xEE, 0x54, 0xFE, 0xFE, +0xD1, 0xD6, 0x80, 0x1A, 0xEF, 0x44, 0x80, 0xFF, 0xEE, 0x54, 0xFE, 0xFC, 0x90, 0x06, 0x68, 0xEF, +0xF0, 0xEC, 0xA3, 0xF0, 0x80, 0x0B, 0xEE, 0x44, 0x01, 0xFC, 0xD1, 0xD6, 0xAE, 0x04, 0xEE, 0xA3, +0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xEF, 0x54, 0x7F, 0x90, 0x06, 0x68, 0xF0, 0x22, 0xE4, 0xFE, +0xFC, 0xEF, 0x64, 0x02, 0x70, 0x40, 0xED, 0xB4, 0x01, 0x04, 0x7E, 0x0A, 0x80, 0x06, 0xED, 0xB4, +0x02, 0x02, 0x7E, 0x09, 0xEB, 0xB4, 0x01, 0x08, 0xED, 0xB4, 0x01, 0x04, 0x7C, 0x04, 0x80, 0x38, +0xEB, 0xB4, 0x02, 0x08, 0xED, 0xB4, 0x01, 0x04, 0x7C, 0x02, 0x80, 0x2C, 0xEB, 0xB4, 0x01, 0x08, +0xED, 0xB4, 0x02, 0x04, 0x7C, 0x01, 0x80, 0x20, 0xEB, 0x64, 0x02, 0x70, 0x1B, 0xED, 0x64, 0x02, +0x70, 0x16, 0x7C, 0x03, 0x80, 0x12, 0xEF, 0xB4, 0x01, 0x0E, 0xEB, 0xB4, 0x02, 0x04, 0x7C, 0x01, +0x80, 0x06, 0xEB, 0xB4, 0x01, 0x02, 0x7C, 0x02, 0xAF, 0x06, 0xEF, 0xC4, 0x54, 0xF0, 0x4C, 0xFF, +0x22, 0xE4, 0xFE, 0xEF, 0x54, 0xE0, 0xC4, 0x13, 0x54, 0x07, 0xFD, 0xEF, 0x54, 0x1F, 0xFF, 0xED, +0x60, 0x2C, 0x14, 0x60, 0x1E, 0x24, 0xFD, 0x60, 0x0F, 0x24, 0xFE, 0x70, 0x2A, 0xEF, 0x25, 0xE0, +0xFF, 0xC3, 0x74, 0xDE, 0x9F, 0xFE, 0x80, 0x1F, 0xEF, 0x25, 0xE0, 0xFF, 0xC3, 0x74, 0xF2, 0x9F, +0xFE, 0x80, 0x14, 0xEF, 0x25, 0xE0, 0xFF, 0xC3, 0x74, 0x06, 0x9F, 0xFE, 0x80, 0x09, 0xEF, 0x25, +0xE0, 0xFF, 0xC3, 0x74, 0x10, 0x9F, 0xFE, 0xAF, 0x06, 0x22, 0xD3, 0xEF, 0x64, 0x80, 0x94, 0x1C, +0x40, 0x07, 0xEF, 0x64, 0x80, 0x94, 0x94, 0x40, 0x03, 0x7F, 0x00, 0x22, 0xC3, 0xEF, 0x64, 0x80, +0x94, 0x80, 0x40, 0x03, 0x7F, 0x64, 0x22, 0xEF, 0x24, 0x64, 0xFF, 0x22, 0x90, 0xA5, 0x78, 0x12, +0x27, 0x54, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, +0x12, 0x86, 0x50, 0x90, 0x05, 0x22, 0x74, 0x3F, 0xF0, 0x90, 0x05, 0x50, 0xE0, 0x54, 0xF7, 0xF0, +0xA3, 0xE0, 0x54, 0xF7, 0xF0, 0x90, 0xA5, 0x78, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0xFF, 0x90, +0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x74, 0x08, 0xFF, 0xFE, 0x12, 0x86, 0x4A, +0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x0F, 0x90, 0xA5, 0x7C, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, +0x0C, 0x12, 0x86, 0x46, 0x12, 0x27, 0x54, 0xFF, 0x00, 0x00, 0x00, 0x90, 0xA5, 0x7C, 0x12, 0x27, +0x54, 0x00, 0x00, 0x00, 0x0F, 0x7F, 0x04, 0x7E, 0x0A, 0x02, 0x86, 0x54, 0x90, 0xA4, 0x19, 0xE0, +0x75, 0xF0, 0x3F, 0x84, 0xAD, 0xF0, 0xED, 0x25, 0xE0, 0x25, 0xE0, 0xFD, 0x74, 0x38, 0x2F, 0xF5, +0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xED, 0xF0, 0x90, 0xA4, 0x19, 0xE0, 0x04, 0xF0, 0x22, 0x7E, +0x00, 0x7F, 0x01, 0x7D, 0x00, 0x7B, 0x01, 0x7A, 0xA2, 0x79, 0x83, 0x12, 0x48, 0xA9, 0x90, 0xA2, +0x83, 0xE0, 0x54, 0xFD, 0xF0, 0xE4, 0x12, 0x50, 0x69, 0xA3, 0x74, 0x0C, 0xF0, 0x22, 0x11, 0x7A, +0xE4, 0x90, 0xA2, 0x86, 0xF0, 0x22, 0x11, 0x74, 0x80, 0xF4, 0x12, 0x67, 0xD2, 0x80, 0xEF, 0x12, +0x67, 0xDA, 0x80, 0xEA, 0x12, 0x53, 0xCB, 0x02, 0x67, 0xCB, 0x90, 0x05, 0x27, 0xE0, 0x54, 0xBF, +0xF0, 0x22, 0x7D, 0x2E, 0x7F, 0x6F, 0x12, 0x53, 0xE1, 0x7D, 0x02, 0x7F, 0x01, 0x12, 0x51, 0x55, +0x11, 0x7A, 0x90, 0xA2, 0x87, 0x74, 0x02, 0xF0, 0x22, 0x7D, 0x21, 0x7F, 0xFF, 0x12, 0x53, 0xE1, +0x02, 0x9F, 0xB8, 0x12, 0x67, 0xCB, 0x80, 0xF1, 0x12, 0x67, 0xCB, 0x02, 0x57, 0xEF, 0x12, 0x67, +0xCB, 0x02, 0x67, 0xE2, 0x7D, 0x22, 0x7F, 0xFF, 0x12, 0x53, 0xE1, 0x12, 0x9F, 0xCD, 0x02, 0x9F, +0xB8, 0x7D, 0x25, 0x02, 0x57, 0xF1, 0xEF, 0x24, 0xFE, 0x60, 0x0B, 0x04, 0x70, 0x24, 0x90, 0xA2, +0x92, 0x74, 0x02, 0xF0, 0x80, 0x13, 0xED, 0x70, 0x06, 0x90, 0xA3, 0x37, 0xE0, 0x80, 0x02, 0xED, +0x14, 0x90, 0xA2, 0x92, 0xF0, 0x90, 0xA2, 0x92, 0xE0, 0xA3, 0xF0, 0x90, 0xA2, 0x89, 0xE0, 0x44, +0x08, 0xF0, 0x22, 0x12, 0x7F, 0xBE, 0xEF, 0x64, 0x01, 0x70, 0x32, 0x90, 0xA2, 0x90, 0xE0, 0xFF, +0x54, 0x03, 0x70, 0x29, 0x90, 0xA2, 0x8E, 0xE0, 0xFE, 0xE4, 0xC3, 0x9E, 0x40, 0x1F, 0xEF, 0x20, +0xE2, 0x1B, 0x90, 0xA2, 0x90, 0xE0, 0x20, 0xE4, 0x14, 0x90, 0xA2, 0x89, 0xE0, 0x13, 0x13, 0x54, +0x3F, 0x30, 0xE0, 0x09, 0x90, 0xA3, 0x3A, 0xE0, 0x70, 0x03, 0x7F, 0x01, 0x22, 0x7F, 0x00, 0x22, +0x90, 0x06, 0x04, 0xE0, 0x54, 0x7F, 0xF0, 0x12, 0x53, 0xCB, 0x7D, 0x0C, 0x7F, 0x01, 0x02, 0x51, +0x55, 0x12, 0x53, 0xCB, 0x12, 0x53, 0xBF, 0x12, 0x9F, 0xCD, 0x02, 0x53, 0xB7, 0xE4, 0xFE, 0x74, +0xA9, 0x2E, 0xF5, 0x82, 0xE4, 0x34, 0xA2, 0xF5, 0x83, 0xE4, 0xF0, 0x0E, 0xEE, 0xB4, 0x19, 0xEF, +0xE4, 0x90, 0xA2, 0xA2, 0xF0, 0x90, 0xA2, 0xA6, 0xF0, 0x90, 0xA2, 0x9E, 0xF0, 0xEF, 0xB4, 0x01, +0x09, 0x90, 0xA2, 0xA7, 0x74, 0x19, 0xF0, 0xE4, 0xA3, 0xF0, 0x22, 0x7D, 0x2F, 0x7F, 0xFF, 0x12, +0x53, 0xE1, 0x12, 0x9E, 0xEF, 0x7D, 0x08, 0x7F, 0x01, 0x12, 0x51, 0x55, 0x90, 0xA2, 0x87, 0x74, +0x08, 0xF0, 0x22, 0x12, 0x9D, 0xA8, 0x12, 0x53, 0xCB, 0x12, 0x51, 0x51, 0x90, 0xA2, 0x87, 0x74, +0x0C, 0xF0, 0x22, 0x90, 0xA5, 0xB3, 0xE0, 0xFF, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, +0xA6, 0x02, 0xEF, 0xF0, 0x90, 0xA1, 0x7F, 0xE0, 0xFF, 0x90, 0x04, 0x1C, 0xE0, 0x6F, 0x70, 0x3E, +0x90, 0xA2, 0x8F, 0xE0, 0x64, 0x0E, 0x70, 0x15, 0x90, 0xA6, 0x02, 0xE0, 0x70, 0x30, 0x90, 0xA2, +0x88, 0xE0, 0x54, 0x7F, 0xF0, 0x90, 0x06, 0x04, 0x12, 0x51, 0x4D, 0x80, 0x1E, 0x90, 0xA2, 0x8F, +0xE0, 0x64, 0x06, 0x70, 0x19, 0x90, 0xA6, 0x02, 0xE0, 0x60, 0x13, 0x90, 0xA2, 0x88, 0xE0, 0x54, +0xBF, 0xF0, 0x51, 0x03, 0xF0, 0x90, 0xA2, 0x8F, 0x74, 0x04, 0xF0, 0x12, 0x53, 0xCB, 0xD0, 0xD0, +0x92, 0xAF, 0x22, 0x90, 0x06, 0x04, 0xE0, 0x44, 0x40, 0xF0, 0xE0, 0x44, 0x80, 0x22, 0xE4, 0xFE, +0xEF, 0x25, 0xE0, 0xFD, 0xEF, 0xC3, 0x94, 0x80, 0x90, 0xFD, 0x12, 0x50, 0x04, 0xE4, 0xF0, 0x80, +0x03, 0x74, 0x01, 0xF0, 0x90, 0xFD, 0x10, 0xED, 0xF0, 0xAF, 0x06, 0x22, 0x12, 0x37, 0x5D, 0x90, +0xA4, 0x98, 0xE0, 0x75, 0xF0, 0x1E, 0xA4, 0x22, 0x90, 0xA2, 0x95, 0xE0, 0x04, 0xF0, 0x90, 0xA2, +0x90, 0xE0, 0x54, 0xEF, 0xF0, 0x90, 0xA3, 0x34, 0xE0, 0xFF, 0x90, 0xA2, 0x95, 0xE0, 0xD3, 0x9F, +0x22, 0x90, 0xA4, 0x9B, 0xE0, 0x75, 0xF0, 0x08, 0xA4, 0x24, 0xA0, 0xF5, 0x82, 0xE4, 0x34, 0xA4, +0x22, 0x75, 0xF0, 0x08, 0xA4, 0x24, 0x9C, 0xF5, 0x82, 0xE4, 0x34, 0xA4, 0x22, 0x12, 0x47, 0xDF, +0x90, 0xA4, 0xEC, 0x12, 0x27, 0x48, 0x90, 0xA4, 0x98, 0xE0, 0xFF, 0x22, 0xA4, 0x24, 0xCF, 0xF5, +0x82, 0xE4, 0x34, 0x44, 0x22, 0x90, 0xA3, 0x6A, 0xE0, 0x54, 0xE0, 0xC4, 0x13, 0x54, 0x07, 0xFF, +0x22, 0x74, 0x21, 0x25, 0x0D, 0xF5, 0x82, 0xE4, 0x34, 0x9D, 0xF5, 0x83, 0x22, 0x12, 0x36, 0xCE, +0xE4, 0xFF, 0xFE, 0xEC, 0x54, 0x07, 0xFC, 0x90, 0xA5, 0x10, 0x12, 0x27, 0x48, 0x90, 0xA4, 0xEF, +0x74, 0x01, 0xF0, 0x22, 0x90, 0xA3, 0x34, 0x74, 0x02, 0xF0, 0xA3, 0x74, 0x0F, 0xF0, 0xA3, 0xE0, +0x54, 0x01, 0x44, 0x1E, 0xF0, 0xA3, 0x74, 0x07, 0x22, 0x74, 0xA1, 0x25, 0x20, 0xF5, 0x82, 0xE4, +0x34, 0x9F, 0xF5, 0x83, 0x22, 0x12, 0x37, 0x5D, 0x90, 0xA4, 0x98, 0xE0, 0x75, 0xF0, 0x0C, 0xA4, +0x24, 0xBD, 0xF5, 0x82, 0xE4, 0x22, 0xFD, 0x7C, 0x00, 0x12, 0x26, 0x98, 0xEF, 0x25, 0x11, 0xF5, +0x11, 0xEE, 0x35, 0x10, 0xF5, 0x10, 0x22, 0x90, 0x05, 0x62, 0xE0, 0xFE, 0x90, 0x05, 0x61, 0xE0, +0xFD, 0xED, 0x78, 0x02, 0x22, 0xE0, 0x75, 0xF0, 0x0C, 0xA4, 0x24, 0xBB, 0xF5, 0x82, 0xE4, 0x34, +0x44, 0x22, 0x12, 0x87, 0xF0, 0x90, 0xA4, 0x99, 0x02, 0x48, 0x71, 0x90, 0xA3, 0x4B, 0x12, 0x48, +0x65, 0xE0, 0xFF, 0x7E, 0x00, 0x7D, 0x01, 0x22, 0x25, 0xE0, 0x24, 0x3D, 0xF5, 0x82, 0xE4, 0x34, +0x43, 0xF5, 0x83, 0x22, 0x12, 0x36, 0xCE, 0xEF, 0x54, 0x1F, 0xFF, 0xE4, 0xFE, 0xFD, 0xFC, 0x22, +0x12, 0x48, 0x65, 0xE0, 0xFC, 0xA3, 0xE0, 0xF5, 0x82, 0x8C, 0x83, 0x22, 0x74, 0x01, 0x25, 0x0D, +0xF5, 0x82, 0xE4, 0x34, 0x94, 0xF5, 0x83, 0x22, 0x74, 0x91, 0x25, 0x0D, 0xF5, 0x82, 0xE4, 0x34, +0x9A, 0xF5, 0x83, 0x22, 0xF0, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x36, 0xCE, 0x90, 0xA2, 0x9A, 0x22, +0xEF, 0x13, 0x13, 0x13, 0x54, 0x1F, 0xFE, 0xEF, 0x54, 0x07, 0xFF, 0x22, 0xE0, 0xC4, 0x13, 0x13, +0x54, 0x03, 0x22, 0xE0, 0xFF, 0xAE, 0x22, 0x74, 0x01, 0xA8, 0x06, 0x08, 0x22, 0x12, 0x47, 0x77, +0x90, 0xA2, 0xC9, 0x02, 0x27, 0x48, 0x90, 0xA5, 0xE7, 0xF0, 0xE0, 0x90, 0x04, 0x54, 0xF0, 0x22, +0x90, 0xA3, 0x3C, 0xE0, 0xFE, 0xC3, 0x13, 0x54, 0x07, 0x22, 0x90, 0xA5, 0xCF, 0xE0, 0xFF, 0x90, +0xA5, 0xCD, 0xE0, 0x22, 0x90, 0xA4, 0x30, 0x12, 0x48, 0x71, 0x75, 0xF0, 0x02, 0x22, 0xD3, 0xE5, +0x13, 0x94, 0xE8, 0xE5, 0x12, 0x94, 0x03, 0x22, 0xD3, 0x9F, 0xEE, 0x64, 0x80, 0xF8, 0x74, 0x80, +0x98, 0x22, 0x74, 0x01, 0x93, 0x95, 0x11, 0xE4, 0x93, 0x95, 0x10, 0x22, 0xE5, 0x12, 0xC3, 0x13, +0xFE, 0xE5, 0x13, 0x13, 0xFF, 0x22, 0xD2, 0xAF, 0xC2, 0xAF, 0x90, 0xA1, 0x76, 0xE0, 0xFF, 0x22, +0x90, 0x04, 0x1F, 0x74, 0x20, 0xF0, 0x7F, 0x01, 0x22, 0xF0, 0x90, 0x06, 0x0A, 0xE0, 0x54, 0xF8, +0xF0, 0x22, 0x54, 0x01, 0xC4, 0x33, 0x33, 0x33, 0x54, 0x80, 0x22, 0xEF, 0xF0, 0xA3, 0xED, 0xF0, +0xE4, 0xA3, 0xF0, 0x22, 0xE4, 0x90, 0xA5, 0x9B, 0xF0, 0xA3, 0x74, 0x03, 0x22, 0x90, 0xA4, 0x43, +0xE0, 0xFE, 0x75, 0xF0, 0x04, 0x22, 0x90, 0xA4, 0x98, 0xE0, 0xFF, 0x7D, 0x8F, 0x22, 0x12, 0x47, +0x17, 0xAE, 0xF0, 0xA8, 0x15, 0x22, 0x90, 0xA2, 0x88, 0xE0, 0xFF, 0x13, 0x13, 0x22, 0x90, 0xA2, +0x92, 0xE0, 0x90, 0x05, 0x73, 0x22, 0x90, 0xA2, 0x90, 0xE0, 0x44, 0x10, 0xF0, 0x22, 0x90, 0xA4, +0x98, 0xE0, 0xFF, 0x7D, 0x32, 0x22, 0x90, 0xA4, 0x98, 0xE0, 0xFF, 0x7D, 0x31, 0x22, 0x90, 0xA4, +0x98, 0xE0, 0xFF, 0x7D, 0x30, 0x22, 0xC4, 0x54, 0x0F, 0x90, 0xA5, 0xD3, 0xF0, 0x22, 0x2F, 0xF8, +0xE6, 0xFE, 0xED, 0xF4, 0x5E, 0x22, 0xE5, 0x13, 0xAE, 0x12, 0xA8, 0x15, 0x08, 0x22, 0xFF, 0xEE, +0x5C, 0xFE, 0xEF, 0x5D, 0x4E, 0x22, 0xFE, 0x33, 0x33, 0x33, 0x54, 0xF8, 0x4F, 0x22, 0x54, 0x03, +0x4F, 0xFF, 0x75, 0xF0, 0x10, 0x22, 0x74, 0x01, 0x7E, 0x00, 0xA8, 0x22, 0x08, 0x22, 0xEE, 0x26, + }; -u4Byte ArrayLength_MP_8812A_FW_NIC = 32060; +u4Byte ArrayLength_MP_8812A_FW_NIC = 31936; void @@ -2047,90 +2041,75 @@ ODM_ReadFirmware_MP_8812A_FW_NIC( u1Byte Array_MP_8812A_FW_NIC_BT[] = { -0x01, 0x95, 0x13, 0x00, 0x19, 0x00, 0x00, 0x00, 0x07, 0x23, 0x13, 0x25, 0xC6, 0x78, 0x00, 0x00, -0xFE, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x02, 0x4A, 0xCC, 0x02, 0x67, 0xB8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x68, 0xA4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x72, 0xF1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x95, 0x13, 0x00, 0x26, 0x00, 0x00, 0x00, 0x11, 0x04, 0x19, 0x54, 0xA4, 0x74, 0x00, 0x00, +0x81, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x02, 0x4A, 0x9A, 0x02, 0x88, 0x9E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x02, 0x89, 0xCC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x02, 0x97, 0xE3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x68, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x6F, 0xD9, 0x00, 0x00, -0x15, 0xF0, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x15, 0xF0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x05, 0xF0, -0xFF, 0x0F, 0x00, 0x00, 0x00, 0x05, 0xF0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x10, 0xF0, 0xFF, 0x0F, -0x00, 0x00, 0x00, 0x10, 0xF0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x0F, 0x00, 0x00, 0x00, 0x00, -0x00, 0xF0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, -0xF0, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x10, 0xF0, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x15, 0xF0, 0x3F, -0x00, 0x00, 0x00, 0x00, 0x15, 0xF0, 0xCF, 0xFF, 0x00, 0x00, 0x00, 0x16, 0x0D, 0x17, 0x0E, 0x17, -0x0F, 0x18, 0x10, 0x19, 0x11, 0x1A, 0x12, 0x1A, 0x13, 0x1A, 0x14, 0x1A, 0x15, 0x1B, 0xFF, 0x17, -0x0E, 0x18, 0x10, 0x19, 0x11, 0x12, 0x1A, 0x1B, 0x15, 0x1C, 0xFF, 0x1D, 0xFF, 0x1E, 0xFF, 0x1F, -0xFF, 0xFF, 0xFF, 0x14, 0x0D, 0x0E, 0x15, 0x15, 0x0F, 0x16, 0x10, 0x17, 0x11, 0x18, 0x12, 0x18, -0x13, 0x18, 0xFF, 0x15, 0x0D, 0x16, 0x10, 0x10, 0x17, 0x18, 0x12, 0x19, 0xFF, 0x1A, 0xFF, 0x1B, -0xFF, 0x1C, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x0C, 0x0C, 0x0D, 0x0C, 0x0E, 0x0D, 0x17, -0x0F, 0x18, 0x10, 0x19, 0x11, 0x19, 0x11, 0x19, 0x12, 0x1A, 0x14, 0x0C, 0x0C, 0x16, 0x0D, 0x17, -0x0F, 0x18, 0x10, 0x19, 0x13, 0x1A, 0x14, 0x1B, 0x15, 0x1C, 0x1B, 0x1D, 0x1C, 0x1E, 0x1D, 0x04, -0x04, 0x0C, 0x14, 0x0D, 0x14, 0x0E, 0x14, 0x0F, 0x15, 0x10, 0x16, 0x17, 0x11, 0x12, 0x17, 0x0C, -0x0C, 0x14, 0x0E, 0x15, 0x0F, 0x16, 0x10, 0x17, 0x12, 0x18, 0x18, 0x19, 0x19, 0x1A, 0x19, 0x0A, -0x08, 0x03, 0x03, 0x00, 0x04, 0x09, 0x07, 0x03, 0x03, 0x00, 0x04, 0x08, 0x06, 0x03, 0x02, 0x00, -0x04, 0x08, 0x05, 0x03, 0x01, 0x00, 0x04, 0x0D, 0x0A, 0x07, 0x05, 0x00, 0x08, 0x0C, 0x0A, 0x07, -0x04, 0x00, 0x08, 0x0B, 0x0A, 0x06, 0x05, 0x00, 0x08, 0x0B, 0x0A, 0x05, 0x03, 0x00, 0x08, 0x0B, -0x0A, 0x03, 0x02, 0x00, 0x08, 0x14, 0x12, 0x0C, 0x04, 0x00, 0x10, 0x14, 0x12, 0x09, 0x04, 0x00, -0x10, 0x24, 0x22, 0x1C, 0x12, 0x00, 0x20, 0x24, 0x22, 0x18, 0x0C, 0x00, 0x20, 0x24, 0x22, 0x14, -0x06, 0x00, 0x20, 0x24, 0x22, 0x0F, 0x04, 0x00, 0x20, 0x24, 0x21, 0x0A, 0x04, 0x00, 0x20, 0x23, -0x21, 0x0C, 0x04, 0x00, 0x20, 0x23, 0x1F, 0x0A, 0x04, 0x00, 0x20, 0x22, 0x1F, 0x0F, 0x04, 0x00, -0x20, 0x21, 0x1F, 0x16, 0x0C, 0x00, 0x20, 0x31, 0x2F, 0x20, 0x14, 0x00, 0x30, 0x31, 0x2F, 0x18, -0x10, 0x00, 0x30, 0x31, 0x2C, 0x18, 0x0C, 0x00, 0x30, 0x31, 0x2A, 0x14, 0x0C, 0x00, 0x30, 0x31, -0x28, 0x14, 0x00, 0x00, 0x30, 0x31, 0x24, 0x14, 0x00, 0x00, 0x30, 0x31, 0x1E, 0x14, 0x00, 0x00, -0x30, 0x04, 0x04, 0x04, 0x05, 0x04, 0x04, 0x05, 0x07, 0x07, 0x07, 0x08, 0x0A, 0x04, 0x07, 0x0A, -0x0E, 0x11, 0x13, 0x14, 0x15, 0x03, 0x04, 0x07, 0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x05, 0x05, 0x07, -0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x05, 0x05, 0x07, 0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x07, 0x08, 0x08, -0x0A, 0x0A, 0x0C, 0x0E, 0x10, 0x11, 0x11, 0x07, 0x09, 0x09, 0x0B, 0x0B, 0x0D, 0x0F, 0x11, 0x11, -0x12, 0x05, 0x05, 0x07, 0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x0F, 0x0F, 0x05, 0x05, 0x07, 0x07, 0x08, -0x0B, 0x0D, 0x0F, 0x0F, 0x0F, 0x04, 0x04, 0x04, 0x05, 0x07, 0x07, 0x09, 0x09, 0x0C, 0x0E, 0x10, -0x12, 0x05, 0x06, 0x07, 0x0D, 0x10, 0x11, 0x12, 0x12, 0x07, 0x08, 0x09, 0x09, 0x0C, 0x0E, 0x11, -0x13, 0x09, 0x09, 0x09, 0x09, 0x0C, 0x0E, 0x11, 0x13, 0x09, 0x09, 0x09, 0x09, 0x0C, 0x0E, 0x11, -0x13, 0x05, 0x06, 0x08, 0x09, 0x0C, 0x0E, 0x12, 0x12, 0x13, 0x14, 0x07, 0x08, 0x0A, 0x0B, 0x0D, -0x10, 0x11, 0x11, 0x14, 0x16, 0x09, 0x09, 0x09, 0x09, 0x0C, 0x0E, 0x11, 0x13, 0x13, 0x13, 0x09, -0x09, 0x09, 0x09, 0x0C, 0x0E, 0x11, 0x13, 0x13, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x24, 0x26, 0x2A, 0x00, 0x00, 0x00, 0x1F, 0x21, 0x25, 0x27, 0x28, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x02, 0x89, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x8F, 0xE8, 0x00, 0x00, +0x00, 0x04, 0x0C, 0x14, 0x2C, 0x36, 0x04, 0x08, 0x08, 0x08, 0x0A, 0x0A, 0x15, 0xF0, 0xFF, 0x0F, +0x00, 0x00, 0x00, 0x15, 0xF0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x05, 0xF0, 0xFF, 0x0F, 0x00, 0x00, +0x00, 0x05, 0xF0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x10, 0xF0, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x10, +0xF0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x0F, 0x00, +0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xF0, 0xFF, 0xFF, 0x00, +0x00, 0x00, 0x10, 0xF0, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x15, 0xF0, 0x3F, 0x00, 0x00, 0x00, 0x00, +0x15, 0xF0, 0xCF, 0xFF, 0x00, 0x00, 0x00, 0x16, 0x0D, 0x17, 0x0E, 0x17, 0x0F, 0x18, 0x10, 0x19, +0x11, 0x1A, 0x12, 0x1A, 0x13, 0x1A, 0x14, 0x1A, 0x15, 0x1B, 0xFF, 0x17, 0x0E, 0x18, 0x10, 0x19, +0x11, 0x1A, 0x12, 0x1B, 0x15, 0x1C, 0xFF, 0x1D, 0xFF, 0x1E, 0xFF, 0x1F, 0xFF, 0xFF, 0xFF, 0x14, +0x0D, 0x0E, 0x15, 0x15, 0x0F, 0x16, 0x10, 0x17, 0x11, 0x18, 0x12, 0x18, 0x13, 0x18, 0xFF, 0x15, +0x0D, 0x16, 0x10, 0x10, 0x17, 0x18, 0x12, 0x19, 0xFF, 0x1A, 0xFF, 0x1B, 0xFF, 0x1C, 0xFF, 0x00, +0x00, 0x00, 0x00, 0x04, 0x04, 0x0C, 0x0C, 0x0D, 0x0C, 0x0E, 0x0D, 0x0F, 0x17, 0x18, 0x10, 0x19, +0x11, 0x19, 0x11, 0x19, 0x12, 0x1A, 0x14, 0x0C, 0x0C, 0x16, 0x0D, 0x17, 0x0F, 0x18, 0x10, 0x19, +0x13, 0x1A, 0x14, 0x1B, 0x15, 0x1C, 0x1B, 0x1D, 0x1C, 0x1E, 0x1D, 0x04, 0x04, 0x0C, 0x14, 0x0D, +0x14, 0x0E, 0x14, 0x0F, 0x15, 0x10, 0x16, 0x17, 0x11, 0x12, 0x17, 0x0C, 0x0C, 0x14, 0x0E, 0x15, +0x0F, 0x16, 0x10, 0x17, 0x12, 0x18, 0x18, 0x19, 0x19, 0x1A, 0x19, 0x0A, 0x08, 0x03, 0x03, 0x00, +0x04, 0x09, 0x07, 0x03, 0x03, 0x00, 0x04, 0x08, 0x06, 0x03, 0x02, 0x00, 0x04, 0x08, 0x05, 0x03, +0x01, 0x00, 0x04, 0x0D, 0x0A, 0x07, 0x05, 0x00, 0x08, 0x0C, 0x0A, 0x07, 0x04, 0x00, 0x08, 0x0B, +0x0A, 0x06, 0x05, 0x00, 0x08, 0x0B, 0x0A, 0x05, 0x03, 0x00, 0x08, 0x0B, 0x0A, 0x03, 0x02, 0x00, +0x08, 0x14, 0x12, 0x0C, 0x04, 0x00, 0x10, 0x14, 0x12, 0x09, 0x04, 0x00, 0x10, 0x24, 0x22, 0x1C, +0x12, 0x00, 0x20, 0x24, 0x22, 0x18, 0x0C, 0x00, 0x20, 0x24, 0x22, 0x14, 0x06, 0x00, 0x20, 0x24, +0x22, 0x0F, 0x04, 0x00, 0x20, 0x24, 0x21, 0x0A, 0x04, 0x00, 0x20, 0x23, 0x21, 0x0C, 0x04, 0x00, +0x20, 0x23, 0x1F, 0x0A, 0x04, 0x00, 0x20, 0x22, 0x1F, 0x0F, 0x04, 0x00, 0x20, 0x21, 0x1F, 0x16, +0x0C, 0x00, 0x20, 0x31, 0x2F, 0x20, 0x14, 0x00, 0x30, 0x31, 0x2F, 0x18, 0x10, 0x00, 0x30, 0x31, +0x2C, 0x18, 0x0C, 0x00, 0x30, 0x31, 0x2A, 0x14, 0x0C, 0x00, 0x30, 0x31, 0x28, 0x14, 0x00, 0x00, +0x30, 0x31, 0x24, 0x14, 0x00, 0x00, 0x30, 0x31, 0x1E, 0x14, 0x00, 0x00, 0x30, 0x04, 0x04, 0x04, +0x05, 0x04, 0x04, 0x05, 0x07, 0x07, 0x07, 0x08, 0x0A, 0x04, 0x07, 0x0A, 0x0E, 0x11, 0x13, 0x14, +0x15, 0x03, 0x04, 0x07, 0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x05, 0x05, 0x07, 0x07, 0x08, 0x0B, 0x0D, +0x0F, 0x05, 0x05, 0x07, 0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x07, 0x08, 0x08, 0x0A, 0x0A, 0x0C, 0x0E, +0x10, 0x11, 0x11, 0x07, 0x09, 0x09, 0x0B, 0x0B, 0x0D, 0x0F, 0x13, 0x13, 0x14, 0x05, 0x05, 0x07, +0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x0F, 0x0F, 0x05, 0x05, 0x07, 0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x0F, +0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x26, 0x2A, 0x00, 0x00, 0x00, +0x1F, 0x21, 0x25, 0x27, 0x28, 0x00, 0x00, 0x00, 0x00, 0x23, 0x26, 0x28, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x23, 0x26, 0x28, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x23, 0x26, 0x28, 0x2A, 0x00, 0x00, 0x00, -0x00, 0x23, 0x26, 0x28, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x20, 0x25, 0x27, 0x29, 0x29, 0x2A, 0x00, -0x00, 0x00, 0x00, 0x20, 0x25, 0x27, 0x29, 0x29, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x23, 0x26, 0x28, -0x2A, 0x2A, 0x2A, 0x00, 0x00, 0x00, 0x1F, 0x23, 0x26, 0x28, 0x2A, 0x2A, 0x2A, 0x00, 0x00, 0x00, -0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, -0x18, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, -0x60, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0xD8, 0x00, 0x00, 0x00, -0x3C, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xA0, 0x00, 0x00, 0x00, -0xF0, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x01, 0x90, 0x00, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x00, -0xA0, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x01, 0x90, 0x00, 0x00, 0x02, -0x58, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, 0x04, 0xB0, 0x00, 0x00, 0x06, 0x40, 0x00, 0x00, 0x00, -0xC8, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x02, 0xD0, 0x00, 0x00, 0x03, -0xE8, 0x00, 0x00, 0x04, 0xB0, 0x00, 0x00, 0x06, 0x40, 0x00, 0x00, 0x07, 0xD0, 0x00, 0x00, 0x00, -0xC8, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x02, 0xD0, 0x00, 0x00, 0x03, -0xE8, 0x00, 0x00, 0x04, 0xB0, 0x00, 0x00, 0x06, 0x40, 0x00, 0x00, 0x07, 0xD0, 0x00, 0x00, 0x00, -0x3C, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xA0, 0x00, 0x00, 0x00, -0xF0, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x01, 0x90, 0x00, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x02, -0x58, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, 0x00, 0xC8, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x01, -0xE0, 0x00, 0x00, 0x02, 0xD0, 0x00, 0x00, 0x03, 0xE8, 0x00, 0x00, 0x07, 0xD0, 0x00, 0x00, 0x0B, -0xB8, 0x00, 0x00, 0x13, 0x88, 0x00, 0x00, 0x17, 0x70, 0x00, 0x00, 0x1F, 0x40, 0x00, 0x00, 0x00, -0xC8, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x02, 0xD0, 0x00, 0x00, 0x03, -0xE8, 0x00, 0x00, 0x04, 0xB0, 0x00, 0x00, 0x06, 0x40, 0x00, 0x00, 0x07, 0xD0, 0x00, 0x00, 0x07, -0xD0, 0x00, 0x00, 0x07, 0xD0, 0x00, 0x00, 0x00, 0xC8, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x01, -0xE0, 0x00, 0x00, 0x02, 0xD0, 0x00, 0x00, 0x03, 0xE8, 0x00, 0x00, 0x04, 0xB0, 0x00, 0x00, 0x06, -0x40, 0x00, 0x00, 0x07, 0xD0, 0x00, 0x00, 0x07, 0xD0, 0x00, 0x00, 0x07, 0xD0, 0x00, 0x02, 0x00, +0x00, 0x20, 0x25, 0x27, 0x29, 0x29, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x20, 0x25, 0x27, 0x29, 0x29, +0x2A, 0x00, 0x00, 0x00, 0x00, 0x23, 0x26, 0x28, 0x2A, 0x2A, 0x2A, 0x00, 0x00, 0x00, 0x1F, 0x23, +0x26, 0x28, 0x2A, 0x2A, 0x2A, 0x00, 0x04, 0x00, 0x04, 0x00, 0x08, 0x00, 0x10, 0x00, 0x18, 0x00, +0x24, 0x00, 0x30, 0x00, 0x48, 0x00, 0x60, 0x00, 0x90, 0x00, 0xC0, 0x00, 0xD8, 0x00, 0x3C, 0x00, +0x64, 0x00, 0x78, 0x00, 0xA0, 0x00, 0xF0, 0x01, 0x40, 0x01, 0x90, 0x01, 0xE0, 0x00, 0xA0, 0x00, +0xF0, 0x01, 0x40, 0x01, 0x90, 0x02, 0x58, 0x03, 0x20, 0x04, 0xB0, 0x06, 0x40, 0x00, 0xC8, 0x01, +0x18, 0x01, 0xE0, 0x02, 0xD0, 0x03, 0xE8, 0x04, 0xB0, 0x06, 0x40, 0x07, 0xD0, 0x00, 0xC8, 0x01, +0x18, 0x01, 0xE0, 0x02, 0xD0, 0x03, 0xE8, 0x04, 0xB0, 0x06, 0x40, 0x07, 0xD0, 0x00, 0x3C, 0x00, +0x50, 0x00, 0x64, 0x00, 0xA0, 0x00, 0xF0, 0x01, 0x40, 0x01, 0x90, 0x01, 0xE0, 0x02, 0x58, 0x03, +0x20, 0x00, 0x78, 0x00, 0xF0, 0x01, 0x90, 0x02, 0x58, 0x03, 0xE8, 0x07, 0xD0, 0x09, 0x60, 0x0F, +0xA0, 0x12, 0xC0, 0x15, 0x18, 0x00, 0xC8, 0x01, 0x18, 0x01, 0xE0, 0x02, 0xD0, 0x03, 0xE8, 0x04, +0xB0, 0x06, 0x40, 0x07, 0xD0, 0x07, 0xD0, 0x07, 0xD0, 0x00, 0xC8, 0x01, 0x18, 0x01, 0xE0, 0x02, +0xD0, 0x03, 0xE8, 0x04, 0xB0, 0x06, 0x40, 0x07, 0xD0, 0x07, 0xD0, 0x07, 0xD0, 0x00, 0x02, 0x00, 0x02, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x12, 0x00, 0x18, 0x00, 0x24, 0x00, 0x30, 0x00, 0x48, 0x00, 0x60, 0x00, 0x6C, 0x00, 0x14, 0x00, 0x32, 0x00, 0x3C, 0x00, 0x50, 0x00, 0x78, 0x00, 0xA0, 0x00, 0xC8, 0x00, 0xF0, 0x00, 0x50, 0x00, 0x78, 0x00, 0xA0, 0x00, 0xC8, 0x01, 0x2C, 0x01, 0x90, 0x02, 0x58, 0x03, 0x20, 0x00, 0x64, 0x00, 0x8C, 0x00, 0xF0, 0x01, 0x68, 0x01, 0xF4, 0x02, 0x58, 0x03, 0x20, 0x03, 0xE8, 0x00, 0x64, 0x00, 0x8C, 0x00, 0xF0, 0x01, 0x68, 0x01, 0xF4, 0x02, -0x58, 0x03, 0x20, 0x03, 0xE8, 0x00, 0x1E, 0x00, 0x32, 0x00, 0x3C, 0x00, 0x50, 0x00, 0x78, 0x00, -0xA0, 0x00, 0xC8, 0x00, 0xF0, 0x01, 0x2C, 0x01, 0x90, 0x00, 0x64, 0x00, 0x8C, 0x00, 0xF0, 0x01, -0x68, 0x01, 0xF4, 0x03, 0xE8, 0x05, 0xDC, 0x09, 0xC4, 0x0B, 0xB8, 0x0F, 0xA0, 0x00, 0x64, 0x00, +0x58, 0x03, 0x20, 0x03, 0xE8, 0x00, 0x1E, 0x00, 0x28, 0x00, 0x32, 0x00, 0x50, 0x00, 0x78, 0x00, +0xA0, 0x00, 0xC8, 0x00, 0xF0, 0x01, 0x2C, 0x01, 0x90, 0x00, 0x3C, 0x00, 0x78, 0x00, 0xC8, 0x01, +0x2C, 0x01, 0xF4, 0x03, 0xE8, 0x04, 0xB0, 0x07, 0xD0, 0x09, 0x60, 0x0A, 0xF0, 0x00, 0x64, 0x00, 0x8C, 0x00, 0xF0, 0x01, 0x68, 0x01, 0xF4, 0x02, 0x58, 0x03, 0x20, 0x03, 0xE8, 0x03, 0xE8, 0x03, 0xE8, 0x00, 0x64, 0x00, 0x8C, 0x00, 0xF0, 0x01, 0x68, 0x01, 0xF4, 0x02, 0x58, 0x03, 0x20, 0x03, 0xE8, 0x03, 0xE8, 0x03, 0xE8, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x10, 0x18, 0x20, 0x30, 0x40, 0x50, 0x01, 0x01, 0x01, 0x02, 0x01, 0x02, 0x03, 0x03, 0x04, 0x04, 0x05, 0x05, 0x02, 0x04, 0x06, 0x07, 0x07, 0x08, 0x08, 0x08, 0x02, 0x02, 0x03, 0x03, 0x05, 0x05, 0x06, 0x06, 0x05, 0x06, 0x06, -0x07, 0x07, 0x08, 0x09, 0x0A, 0x05, 0x06, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0A, 0x01, 0x03, 0x06, -0x07, 0x07, 0x07, 0x08, 0x08, 0x0A, 0x0A, 0x02, 0x05, 0x06, 0x07, 0x07, 0x07, 0x08, 0x08, 0x0A, +0x07, 0x07, 0x08, 0x09, 0x0A, 0x05, 0x06, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0A, 0x05, 0x06, 0x06, +0x07, 0x07, 0x08, 0x09, 0x0A, 0x0A, 0x0B, 0x05, 0x06, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0B, 0x05, 0x06, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0A, 0x0A, 0x0B, 0x05, 0x06, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0A, 0x0A, 0x0B, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x02, 0x04, 0x06, 0x07, 0x08, 0x0A, 0x0B, @@ -2145,7 +2124,20 @@ u1Byte Array_MP_8812A_FW_NIC_BT[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0xC2, 0xAF, 0x80, 0xFE, 0x32, 0x12, 0x46, 0x04, 0x85, 0xD0, 0x0B, 0x75, 0xD0, 0x08, 0xAA, 0xE0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0xC2, 0xAF, 0x80, 0xFE, 0x32, 0x12, 0x45, 0xE4, 0x85, 0xD0, 0x0B, 0x75, 0xD0, 0x08, 0xAA, 0xE0, 0xC2, 0x8C, 0xE5, 0x8A, 0x24, 0x67, 0xF5, 0x8A, 0xE5, 0x8C, 0x34, 0x79, 0xF5, 0x8C, 0xD2, 0x8C, 0xEC, 0x24, 0x87, 0xF8, 0xE6, 0xBC, 0x02, 0x02, 0x74, 0xFF, 0xC3, 0x95, 0x81, 0xB4, 0x40, 0x00, 0x40, 0xCE, 0x79, 0x03, 0x78, 0x80, 0x16, 0xE6, 0x08, 0x70, 0x0B, 0xC2, 0xAF, 0xE6, 0x30, 0xE1, @@ -2160,7 +2152,7 @@ u1Byte Array_MP_8812A_FW_NIC_BT[] = { 0xE6, 0x30, 0xE0, 0x03, 0x10, 0xE2, 0x0C, 0x7F, 0x00, 0x30, 0xE1, 0x07, 0x30, 0xE3, 0x04, 0x7F, 0x08, 0x54, 0xF4, 0x54, 0x7C, 0xC6, 0xD2, 0xAF, 0x54, 0x80, 0x42, 0x07, 0x22, 0x78, 0x86, 0xA6, 0x81, 0x74, 0x02, 0x60, 0x06, 0xFF, 0x08, 0x76, 0xFF, 0xDF, 0xFB, 0x7F, 0x03, 0xE4, 0x78, 0x80, -0xF6, 0x08, 0xF6, 0x08, 0xDF, 0xFA, 0x78, 0x81, 0x76, 0x30, 0x90, 0x4B, 0x6C, 0x74, 0x01, 0x93, +0xF6, 0x08, 0xF6, 0x08, 0xDF, 0xFA, 0x78, 0x81, 0x76, 0x30, 0x90, 0x4B, 0x8A, 0x74, 0x01, 0x93, 0xC0, 0xE0, 0xE4, 0x93, 0xC0, 0xE0, 0x43, 0x89, 0x01, 0x75, 0x8A, 0x60, 0x75, 0x8C, 0x79, 0xD2, 0x8C, 0xD2, 0xAF, 0x22, 0x02, 0xEF, 0xD3, 0x94, 0x02, 0x40, 0x03, 0x7F, 0xFF, 0x22, 0x74, 0x81, 0x2F, 0x2F, 0xF8, 0xE6, 0x20, 0xE5, 0xF4, 0xC2, 0xAF, 0xE6, 0x44, 0x30, 0xF6, 0xD2, 0xAF, 0xAE, @@ -2170,10 +2162,10 @@ u1Byte Array_MP_8812A_FW_NIC_BT[] = { 0xEE, 0xD3, 0x9F, 0x40, 0x22, 0x74, 0x86, 0x2E, 0xF8, 0x08, 0xE6, 0xF9, 0xEE, 0xB5, 0x0C, 0x02, 0xA9, 0x81, 0x18, 0x06, 0x06, 0xE6, 0xFD, 0xED, 0x69, 0x60, 0x09, 0x19, 0x19, 0xE7, 0x09, 0x09, 0xF7, 0x19, 0x80, 0xF3, 0x1E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 0x83, 0xE7, 0x09, 0xF0, 0xA3, 0xDF, 0xFA, 0x80, 0x32, 0xE3, 0x09, 0xF6, 0x08, 0xDF, 0xFA, 0x80, 0x78, 0xE3, 0x09, 0xF2, @@ -2202,7 +2194,7 @@ u1Byte Array_MP_8812A_FW_NIC_BT[] = { 0x82, 0xC8, 0xCC, 0xC5, 0x83, 0xCC, 0xDF, 0xEA, 0xDE, 0xE8, 0x80, 0xDB, 0x89, 0x82, 0x8A, 0x83, 0xE4, 0x93, 0xA3, 0xF2, 0x08, 0xDF, 0xF9, 0x80, 0xCC, 0x88, 0xF0, 0xEF, 0x60, 0x01, 0x0E, 0x4E, 0x60, 0xC3, 0x88, 0xF0, 0xED, 0x24, 0x02, 0xB4, 0x04, 0x00, 0x50, 0xB9, 0xF5, 0x82, 0xEB, 0x24, -0x02, 0xB4, 0x04, 0x00, 0x50, 0xAF, 0x23, 0x23, 0x45, 0x82, 0x23, 0x90, 0x48, 0xF9, 0x73, 0xC5, +0x02, 0xB4, 0x04, 0x00, 0x50, 0xAF, 0x23, 0x23, 0x45, 0x82, 0x23, 0x90, 0x48, 0xD9, 0x73, 0xC5, 0xF0, 0xF8, 0xA3, 0xE0, 0x28, 0xF0, 0xC5, 0xF0, 0xF8, 0xE5, 0x82, 0x15, 0x82, 0x70, 0x02, 0x15, 0x83, 0xE0, 0x38, 0xF0, 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, @@ -2210,1780 +2202,1716 @@ u1Byte Array_MP_8812A_FW_NIC_BT[] = { 0xBB, 0x01, 0x10, 0xE5, 0x82, 0x29, 0xF5, 0x82, 0xE5, 0x83, 0x3A, 0xF5, 0x83, 0xE0, 0xF5, 0xF0, 0xA3, 0xE0, 0x22, 0x50, 0x09, 0x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 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, 0x02, 0x4B, 0x0A, 0x02, -0x46, 0xDD, 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, 0x4B, 0x4F, 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, 0x00, -0x41, 0xA5, 0x8E, 0x00, 0x41, 0xA5, 0x8F, 0x00, 0x41, 0xA5, 0x90, 0x00, 0x41, 0xA5, 0x91, 0x00, -0x41, 0xA5, 0xC7, 0x00, 0x41, 0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0xF0, 0x61, -0x86, 0xE4, 0x90, 0xA4, 0xBF, 0xF0, 0x90, 0xA4, 0xBF, 0xE0, 0xFF, 0xC3, 0x94, 0x02, 0x50, 0x6A, -0xC3, 0x74, 0xFB, 0x9F, 0xFF, 0x74, 0x03, 0x94, 0x00, 0xFE, 0x7B, 0x01, 0x7A, 0xA4, 0x79, 0xC0, -0x12, 0x33, 0xC7, 0xEF, 0x64, 0x01, 0x70, 0x42, 0x90, 0xA4, 0xC0, 0xE0, 0xFF, 0x54, 0xE0, 0xFE, -0x70, 0x13, 0xEF, 0x54, 0x0E, 0x70, 0x08, 0x90, 0xA4, 0xBF, 0xE0, 0x60, 0x35, 0x80, 0x00, 0x90, -0xA4, 0xC1, 0x74, 0x01, 0xF0, 0x90, 0xA4, 0xC1, 0xE0, 0x70, 0x09, 0xEE, 0xC4, 0x13, 0x54, 0x07, -0xA3, 0xF0, 0x80, 0x0C, 0x90, 0xA4, 0xC0, 0xE0, 0x54, 0x0E, 0xC3, 0x13, 0x90, 0xA4, 0xC2, 0xF0, -0x90, 0xA4, 0xC2, 0xE0, 0x90, 0xA4, 0x38, 0xF0, 0x80, 0x10, 0x90, 0xA4, 0xC3, 0x74, 0x01, 0xF0, -0x80, 0x40, 0x90, 0xA4, 0xBF, 0xE0, 0x04, 0xF0, 0x80, 0x8C, 0x90, 0xA4, 0x37, 0xE0, 0x25, 0xE0, -0x25, 0xE0, 0x54, 0x0C, 0xFF, 0x90, 0xA4, 0x36, 0xE0, 0x54, 0x03, 0x4F, 0xFF, 0x90, 0xA4, 0x38, -0xE0, 0xFE, 0xC4, 0x54, 0x70, 0x4F, 0x44, 0x80, 0xFD, 0x7F, 0x8B, 0x12, 0x3A, 0x96, 0x90, 0xA4, -0x36, 0xE0, 0x60, 0x08, 0xA3, 0xE0, 0x60, 0x04, 0xA3, 0xE0, 0x70, 0x21, 0x90, 0xA4, 0xC3, 0x74, -0x03, 0xF0, 0x90, 0x01, 0xC4, 0x74, 0x72, 0xF0,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0x44, 0x04, 0xF0, 0x90, 0x05, 0x22, 0x74, -0x6F, 0xF0, 0x90, 0xA3, 0xC0, 0xE0, 0x20, 0xE0, 0x02, 0xC1, 0xA7, 0xA1, 0xCF, 0x90, 0xA3, 0xCF, -0xE0, 0x64, 0x02, 0x60, 0x02, 0x61, 0x8C, 0x7F, 0x01, 0x12, 0x7B, 0x17, 0x90, 0xA3, 0xC1, 0xE0, -0xFF, 0x13, 0x13, 0x54, 0x3F, 0x30, 0xE0, 0x09, 0x12, 0x83, 0x58, 0xBF, 0x01, 0x03, 0x12, 0x5B, -0xDF, 0x90, 0xA3, 0xC1, 0xE0, 0xC4, 0x13, 0x13, 0x13, 0x54, 0x01, 0x90, 0x07, 0x78, 0x30, 0xE0, -0x05, 0x74, 0x03, 0xF0, 0x80, 0x03, 0x74, 0x01, 0xF0, 0x90, 0xA3, 0xBE, 0xE0, 0x24, 0x03, 0xFF, -0x90, 0xA3, 0xCD, 0xF1, 0x08, 0x90, 0xA3, 0xBD, 0xE0, 0xC3, 0x13, 0x30, 0xE0, 0x07, 0xE4, 0x90, -0xA5, 0x04, 0xF0, 0x80, 0x06, 0x90, 0xA5, 0x04, 0x74, 0x01, 0xF0, 0x90, 0xA3, 0xC0, 0xE0, 0xC4, -0x13, 0x54, 0x07, 0x20, 0xE0, 0x13, 0x90, 0xA3, 0xFA, 0xE0, 0x60, 0x08, 0x90, 0xA5, 0x05, 0x74, -0x01, 0xF0, 0x80, 0x05, 0xE4, 0x90, 0xA5, 0x05, 0xF0, 0x12, 0x76, 0x21, 0xE4, 0x90, 0xA3, 0xCE, -0xF0, 0xA3, 0xE0, 0x04, 0xF0, 0x90, 0xA3, 0xBD, 0xE0, 0xC4, 0x13, 0x54, 0x07, 0x30, 0xE0, 0x08, -0x90, 0x05, 0x22, 0x74, 0x6F, 0xF0, 0x80, 0x27, 0x90, 0xA3, 0xBD, 0xE0, 0xC4, 0x54, 0x0F, 0x30, -0xE0, 0x0F, 0x90, 0xA3, 0xC1, 0xE0, 0xC4, 0x13, 0x54, 0x07, 0x20, 0xE0, 0x0C, 0x11, 0x77, 0x80, -0x08, 0x90, 0xA3, 0xA1, 0xE0, 0x60, 0x08, 0x11, 0x77, 0x90, 0x05, 0x22, 0x74, 0xFF, 0xF0, 0x90, -0xA3, 0xC0, 0xE0, 0x30, 0xE0, 0x05, 0x90, 0x05, 0x22, 0xE4, 0xF0, 0x90, 0xA3, 0xC0, 0xE0, 0xC4, -0x13, 0x13, 0x13, 0x54, 0x01, 0x20, 0xE0, 0x02, 0xC1, 0xA7, 0xC1, 0xA2, 0x90, 0xA3, 0xCF, 0xE0, -0x64, 0x03, 0x60, 0x02, 0xA1, 0x15, 0xFF, 0x12, 0x7B, 0x17, 0x90, 0xA3, 0xC1, 0xE0, 0xFF, 0x13, -0x13, 0x54, 0x3F, 0x30, 0xE0, 0x03, 0x12, 0x7B, 0x50, 0x90, 0xA3, 0xBD, 0xE0, 0xC4, 0x13, 0x13, -0x54, 0x03, 0x30, 0xE0, 0x08, 0x90, 0x07, 0x78, 0x74, 0x0D, 0xF0, 0x80, 0x14, 0x90, 0xA3, 0xC0, -0xE0, 0xC3, 0x13, 0x90, 0x07, 0x78, 0x30, 0xE0, 0x05, 0x74, 0x03, 0xF0, 0x80, 0x03, 0x74, 0x09, -0xF0, 0x90, 0xA3, 0xC1, 0xE0, 0xC4, 0x13, 0x13, 0x54, 0x03, 0x30, 0xE0, 0x6D, 0x90, 0xA3, 0xC7, -0xE0, 0xFF, 0x90, 0xA3, 0xD1, 0xE0, 0xD3, 0x9F, 0x40, 0x41, 0xE0, 0x75, 0xF0, 0x03, 0xA4, 0xFF, -0x90, 0xA3, 0xC9, 0xE0, 0xFE, 0xC3, 0xEF, 0x9E, 0xFF, 0x24, 0x03, 0xFD, 0xE4, 0x33, 0xFC, 0x90, -0xA3, 0xBF, 0xE0, 0xD3, 0x9D, 0xEC, 0x64, 0x80, 0xF8, 0x74, 0x80, 0x98, 0x40, 0x08, 0xE0, 0x9F, -0x90, 0xA5, 0x06, 0xF0, 0x80, 0x06, 0x90, 0xA5, 0x06, 0x74, 0x03, 0xF0, 0x90, 0xA5, 0x06, 0xE0, -0xFF, 0xF1, 0x0C, 0x90, 0xA3, 0xCF, 0xE0, 0x04, 0xF0, 0x80, 0x18, 0x90, 0xA3, 0xCA, 0xE0, 0xFF, -0xF1, 0x0C, 0x90, 0xA3, 0xC5, 0x74, 0x04, 0xF0, 0xE4, 0x90, 0xA3, 0xCF, 0xF0, 0x90, 0x06, 0x92, -0x74, 0x04, 0xF0, 0xE4, 0x90, 0xA3, 0xD1, 0xF0, 0x80, 0x0D, 0x90, 0xA3, 0xBF, 0xE0, 0xFF, 0xF1, -0x0C, 0x90, 0xA3, 0xCF, 0xE0, 0x04, 0xF0, 0x90, 0xA3, 0xBD, 0xE0, 0xC4, 0x13, 0x13, 0x13, 0x54, -0x01, 0x30, 0xE0, 0x07, 0xE4, 0x90, 0xA5, 0x04, 0xF0, 0x80, 0x06, 0x90, 0xA5, 0x04, 0x74, 0x01, -0xF0, 0x90, 0xA3, 0xC0, 0xE0, 0xC4, 0x13, 0x54, 0x07, 0x20, 0xE0, 0x13, 0x90, 0xA3, 0xFA, 0xE0, -0x60, 0x07, 0xE4, 0x90, 0xA5, 0x05, 0xF0, 0x80, 0x06, 0x90, 0xA5, 0x05, 0x74, 0x01, 0xF0, 0x12, -0x76, 0x21, 0x90, 0xA3, 0xCE, 0x74, 0x01, 0xF0, 0x90, 0xA3, 0xBD, 0xE0, 0xC4, 0x13, 0x54, 0x07, -0x20, 0xE0, 0x32, 0x90, 0xA3, 0xBD, 0xE0, 0xC4, 0x54, 0x0F, 0x30, 0xE0, 0x1C, 0x90, 0xA3, 0xC3, -0xE0, 0x44, 0x20, 0xF0, 0x90, 0xA3, 0xB8, 0xE0, 0x60, 0x04, 0x7D, 0x01, 0x80, 0x13, 0x90, 0x05, -0x22, 0xE4, 0xF0, 0x7D, 0x01, 0x7F, 0x0C, 0x80, 0x0A, 0x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 0x90, 0xA3, 0xC3, 0xE0, 0x54, 0xDF, 0xF0, 0xE4, 0xFD, 0x7F, 0x04, 0x11, 0x7E, 0x90, 0xA3, -0xC1, 0xE0, 0xC4, 0x13, 0x13, 0x54, 0x03, 0x30, 0xE0, 0x26, 0x90, 0xA3, 0xC4, 0xE0, 0x44, 0x02, -0xF0, 0x54, 0xFB, 0xF0, 0xE4, 0x90, 0xA3, 0xD2, 0xF0, 0x90, 0xA3, 0xCF, 0xF0, 0x90, 0xA3, 0xC5, -0x74, 0x07, 0xF0, 0x90, 0xA3, 0xB8, 0xE0, 0x60, 0x07, 0x90, 0xA3, 0xC4, 0xE0, 0x44, 0x04, 0xF0, -0x90, 0x05, 0x22, 0x74, 0x6F, 0xF0, 0x90, 0xA3, 0xC0, 0xE0, 0x20, 0xE0, 0x02, 0xC1, 0xA7, 0x90, -0x05, 0x22, 0xE4, 0xF0, 0x22, 0x90, 0xA3, 0xCF, 0xE0, 0x64, 0x05, 0x60, 0x02, 0xC1, 0xA7, 0x7F, -0x01, 0x12, 0x7B, 0x17, 0x90, 0xA3, 0xC1, 0xE0, 0xFF, 0x13, 0x13, 0x54, 0x3F, 0x30, 0xE0, 0x09, -0x12, 0x83, 0x58, 0xBF, 0x01, 0x03, 0x12, 0x5B, 0xDF, 0x90, 0xA3, 0xC1, 0xE0, 0xC4, 0x13, 0x13, -0x13, 0x54, 0x01, 0x90, 0x07, 0x78, 0x30, 0xE0, 0x05, 0x74, 0x03, 0xF0, 0x80, 0x03, 0x74, 0x01, -0xF0, 0x90, 0xA3, 0xBD, 0xE0, 0xC3, 0x13, 0x30, 0xE0, 0x07, 0xE4, 0x90, 0xA5, 0x04, 0xF0, 0x80, -0x06, 0x90, 0xA5, 0x04, 0x74, 0x01, 0xF0, 0x90, 0xA3, 0xC0, 0xE0, 0xC4, 0x13, 0x54, 0x07, 0x20, -0xE0, 0x13, 0x90, 0xA3, 0xFA, 0xE0, 0x60, 0x08, 0x90, 0xA5, 0x05, 0x74, 0x01, 0xF0, 0x80, 0x05, -0xE4, 0x90, 0xA5, 0x05, 0xF0, 0x12, 0x76, 0x21, 0xE4, 0x90, 0xA3, 0xCE, 0xF0, 0xA3, 0xF0, 0x90, -0xA3, 0xBD, 0xE0, 0xC4, 0x13, 0x54, 0x07, 0x30, 0xE0, 0x08, 0x90, 0x05, 0x22, 0x74, 0x6F, 0xF0, -0x80, 0x27, 0x90, 0xA3, 0xBD, 0xE0, 0xC4, 0x54, 0x0F, 0x30, 0xE0, 0x0F, 0x90, 0xA3, 0xC1, 0xE0, -0xC4, 0x13, 0x54, 0x07, 0x20, 0xE0, 0x0C, 0x11, 0x77, 0x80, 0x08, 0x90, 0xA3, 0xA1, 0xE0, 0x60, -0x08, 0x11, 0x77, 0x90, 0x05, 0x22, 0x74, 0xFF, 0xF0, 0x90, 0xA3, 0xC0, 0xE0, 0x30, 0xE0, 0x05, -0x90, 0x05, 0x22, 0xE4, 0xF0, 0x90, 0xA3, 0xC0, 0xE0, 0xC4, 0x13, 0x13, 0x13, 0x54, 0x01, 0x30, -0xE0, 0x05, 0xE4, 0xFF, 0x12, 0x7C, 0xF9, 0x22, 0x90, 0xA3, 0xBD, 0xE0, 0x30, 0xE0, 0x13, 0x90, -0xA3, 0xC3, 0xE0, 0xC4, 0x13, 0x54, 0x07, 0x30, 0xE0, 0x18, 0x90, 0x01, 0xB8, 0x74, 0x10, 0xF0, -0x80, 0x3D, 0x12, 0xB5, 0xB8, 0xEF, 0x64, 0x01, 0x60, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x01, 0xF0, -0x80, 0x2D, 0x90, 0xA3, 0x9E, 0xE0, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x30, 0xE0, 0x08, 0x90, 0x01, -0xB8, 0x74, 0x02, 0xF0, 0x80, 0x19, 0x90, 0xA3, 0xA3, 0xE0, 0xD3, 0x94, 0x04, 0x40, 0x08, 0x90, -0x01, 0xB8, 0x74, 0x08, 0xF0, 0x80, 0x08, 0x90, 0x01, 0xB8, 0xE4, 0xF0, 0x7F, 0x01, 0x22, 0x90, -0x01, 0xB9, 0x74, 0x02, 0xF0, 0x7F, 0x00, 0x22, 0xE0, 0xC3, 0x9F, 0xFF, 0xE4, 0xF5, 0x23, 0x8F, -0x24, 0xFB, 0xFD, 0x7F, 0x50, 0x7E, 0x01, 0x02, 0x5D, 0x96, 0x90, 0xA5, 0xC9, 0xEF, 0xF0, 0x12, -0x7B, 0x50, 0x90, 0xA5, 0xC9, 0xE0, 0x60, 0x05, 0x90, 0x05, 0x22, 0xE4, 0xF0, 0x90, 0xA3, 0xA4, -0x74, 0x04, 0xF0, 0x22, 0x90, 0xA3, 0x9F, 0xE0, 0x90, 0x06, 0x04, 0x20, 0xE0, 0x0C, 0xE0, 0x44, -0x40, 0xF0, 0x90, 0xA3, 0xA4, 0x74, 0x04, 0xF0, 0x80, 0x0A, 0xE0, 0x54, 0x7F, 0xF0, 0x90, 0xA3, -0xA4, 0x74, 0x0C, 0xF0, 0x90, 0x05, 0x22, 0xE4, 0xF0, 0x22, 0x90, 0xA3, 0x9F, 0xE0, 0xC3, 0x13, -0x20, 0xE0, 0x08, 0x90, 0xA3, 0xA4, 0x74, 0x0C, 0xF0, 0x80, 0x11, 0x90, 0x06, 0x04, 0xE0, 0x44, -0x40, 0xF0, 0xE0, 0x44, 0x80, 0xF0, 0x90, 0xA3, 0xA4, 0x74, 0x04, 0xF0, 0x90, 0x05, 0x22, 0xE4, -0xF0, 0x22, 0x90, 0xA3, 0xBD, 0xE0, 0x20, 0xE0, 0x28, 0x90, 0xA3, 0xA1, 0xE0, 0x64, 0x01, 0x70, -0x20, 0x12, 0xAF, 0x4E, 0x90, 0xA3, 0xA0, 0xE0, 0x54, 0x0F, 0x60, 0x09, 0xE4, 0xFD, 0x7F, 0x0C, -0x11, 0x7E, 0x02, 0x72, 0x10, 0x90, 0xA3, 0xA4, 0xE0, 0x70, 0x06, 0x7D, 0x01, 0x7F, 0x04, 0x11, -0x7E, 0x22, 0x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0x2C, 0xED, 0x75, 0xF0, 0x0F, 0xA4, -0x24, 0x82, 0xF9, 0x74, 0xA2, 0x35, 0xF0, 0xFA, 0x7B, 0x01, 0x31, 0x00, 0x7F, 0x01, 0xEF, 0x60, -0x16, 0x90, 0xA3, 0x18, 0xE0, 0x04, 0xF0, 0xE0, 0xB4, 0x0A, 0x02, 0x80, 0x02, 0x7F, 0x00, 0xEF, -0x60, 0x05, 0xE4, 0x90, 0xA3, 0x18, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xD3, 0x10, 0xAF, 0x01, -0xC3, 0xC0, 0xD0, 0x90, 0xA2, 0x81, 0xE0, 0xFF, 0x90, 0xA2, 0x80, 0xE0, 0xB5, 0x07, 0x04, 0x7F, -0x01, 0x80, 0x02, 0x7F, 0x00, 0xEF, 0x70, 0x43, 0x90, 0xA2, 0x80, 0xE0, 0xFE, 0x75, 0xF0, 0x08, -0x90, 0xA2, 0x30, 0x12, 0x4A, 0x88, 0xE0, 0xFD, 0xEE, 0x75, 0xF0, 0x08, 0xA4, 0x24, 0x31, 0xF9, -0x74, 0xA2, 0x35, 0xF0, 0xFA, 0x7B, 0x01, 0xAF, 0x05, 0x31, 0x76, 0x90, 0xA2, 0x80, 0xE0, 0x04, -0xF0, 0xE0, 0x7F, 0x00, 0xB4, 0x0A, 0x02, 0x7F, 0x01, 0xEF, 0x60, 0x05, 0xE4, 0x90, 0xA2, 0x80, -0xF0, 0x12, 0x7E, 0x6B, 0x90, 0xA2, 0x26, 0xE0, 0x44, 0x02, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, -0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0xA5, 0x9A, 0x12, 0x4A, 0x9D, 0x7F, 0x96, 0x7E, -0x02, 0x12, 0x7F, 0xA9, 0xEF, 0x60, 0x5A, 0x90, 0x01, 0x17, 0xE0, 0xFE, 0x90, 0x01, 0x16, 0xE0, -0x7C, 0x00, 0x24, 0x00, 0xFF, 0xEC, 0x3E, 0xFE, 0xEF, 0x24, 0x01, 0xFF, 0xE4, 0x3E, 0xFE, 0x90, -0xA5, 0x9D, 0xEF, 0xF0, 0xEE, 0xFF, 0x90, 0xFD, 0x11, 0xF0, 0x90, 0xA5, 0x9D, 0xE0, 0xFD, 0x90, -0x02, 0x94, 0xF0, 0xA3, 0xEF, 0xF0, 0x90, 0xA5, 0x9A, 0x12, 0x4A, 0x94, 0x90, 0x00, 0x0E, 0x12, -0x26, 0x37, 0x24, 0x02, 0xFF, 0xE4, 0x33, 0xFE, 0x12, 0x7F, 0xFF, 0x90, 0xA5, 0x9D, 0xE0, 0x24, -0x18, 0xFF, 0x90, 0xA5, 0x9A, 0x12, 0x4A, 0x94, 0x12, 0x80, 0x5A, 0x90, 0x02, 0x96, 0x74, 0x01, -0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0xA4, 0xC9, 0x12, 0x4A, 0x9D, 0xEF, 0x12, 0x4A, 0xA6, -0x59, 0xC0, 0x00, 0x59, 0xC9, 0x01, 0x59, 0xD2, 0x02, 0x59, 0xDB, 0x03, 0x59, 0xE4, 0x04, 0x59, -0xED, 0x12, 0x59, 0xF5, 0x14, 0x59, 0xFD, 0x20, 0x5A, 0x06, 0x21, 0x5A, 0x0F, 0x23, 0x5A, 0x17, -0x25, 0x5A, 0x20, 0x27, 0x5A, 0x28, 0x40, 0x5A, 0x43, 0x41, 0x5A, 0x31, 0x42, 0x5A, 0x3A, 0x43, -0x5A, 0x4B, 0x60, 0x5A, 0x54, 0x64, 0x5A, 0x5D, 0x65, 0x5A, 0x66, 0x87, 0x00, 0x00, 0x5A, 0x6E, -0x90, 0xA4, 0xC9, 0x12, 0x4A, 0x94, 0x02, 0x73, 0x3D, 0x90, 0xA4, 0xC9, 0x12, 0x4A, 0x94, 0x02, -0x73, 0x85, 0x90, 0xA4, 0xC9, 0x12, 0x4A, 0x94, 0x02, 0x74, 0x5B, 0x90, 0xA4, 0xC9, 0x12, 0x4A, -0x94, 0x02, 0xB4, 0x88, 0x90, 0xA4, 0xC9, 0x12, 0x4A, 0x94, 0x02, 0x4E, 0xFB, 0x90, 0xA4, 0xC9, -0x12, 0x4A, 0x94, 0x41, 0x76, 0x90, 0xA4, 0xC9, 0x12, 0x4A, 0x94, 0xE1, 0xDF, 0x90, 0xA4, 0xC9, -0x12, 0x4A, 0x94, 0x02, 0x74, 0x93, 0x90, 0xA4, 0xC9, 0x12, 0x4A, 0x94, 0x02, 0x77, 0x1C, 0x90, -0xA4, 0xC9, 0x12, 0x4A, 0x94, 0xE1, 0xD7, 0x90, 0xA4, 0xC9, 0x12, 0x4A, 0x94, 0x02, 0x77, 0x62, -0x90, 0xA4, 0xC9, 0x12, 0x4A, 0x94, 0x80, 0x62, 0x90, 0xA4, 0xC9, 0x12, 0x4A, 0x94, 0x02, 0xA1, -0x9F, 0x90, 0xA4, 0xC9, 0x12, 0x4A, 0x94, 0x02, 0xA3, 0x80, 0x90, 0xA4, 0xC9, 0x12, 0x4A, 0x94, -0x02, 0xA4, 0x39, 0x90, 0xA4, 0xC9, 0x12, 0x4A, 0x94, 0x41, 0xF8, 0x90, 0xA4, 0xC9, 0x12, 0x4A, -0x94, 0x02, 0x77, 0xAB, 0x90, 0xA4, 0xC9, 0x12, 0x4A, 0x94, 0x02, 0x7D, 0xF8, 0x90, 0xA4, 0xC9, -0x12, 0x4A, 0x94, 0x02, 0x7E, 0x59, 0x90, 0xA4, 0xC9, 0x12, 0x4A, 0x94, 0xA1, 0xBB, 0x90, 0x01, -0xC0, 0xE0, 0x44, 0x01, 0xF0, 0x22, 0x12, 0x26, 0x1E, 0xFF, 0x90, 0xA3, 0x1C, 0xF0, 0xBF, 0x01, -0x08, 0x12, 0x81, 0x37, 0xE4, 0x90, 0xA3, 0x1C, 0xF0, 0x22, 0x12, 0x26, 0x1E, 0x54, 0x01, 0xFF, -0x90, 0xA3, 0xB9, 0xE0, 0x54, 0xFE, 0x4F, 0xF0, 0x90, 0x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x01, 0xA1, 0x96, 0x90, 0x01, 0x5F, 0xE4, 0xF0, 0x22, 0x90, 0xA3, 0xB9, 0xE0, 0x30, 0xE0, -0x2D, 0x90, 0xA3, 0xBB, 0xE0, 0x90, 0x05, 0x73, 0xF0, 0x90, 0xA3, 0xBC, 0xE0, 0x60, 0x04, 0x14, -0xF0, 0x80, 0x47, 0x90, 0xA3, 0xBA, 0xE0, 0x14, 0x90, 0xA3, 0xBC, 0xF0, 0x90, 0x05, 0x73, 0x74, -0x01, 0xF0, 0xE4, 0xFF, 0x51, 0xBB, 0x71, 0x8F, 0x7D, 0x01, 0x7F, 0x02, 0x71, 0x93, 0x22, 0x7D, -0x02, 0x7F, 0x02, 0x74, 0x5D, 0x2F, 0xF8, 0xE6, 0x4D, 0xFE, 0xF6, 0x74, 0x30, 0x2F, 0xF5, 0x82, -0xE4, 0x34, 0x01, 0xF5, 0x83, 0xEE, 0xF0, 0x22, 0xB1, 0x4F, 0x90, 0xA3, 0xA7, 0xE0, 0x14, 0x90, -0x05, 0x73, 0xF0, 0x71, 0x8F, 0x12, 0x6C, 0x5F, 0x80, 0xA0, 0x90, 0x05, 0x22, 0x74, 0xFF, 0xF0, -0x71, 0xDF, 0x90, 0xA3, 0xA4, 0x74, 0x08, 0xF0, 0x22, 0x12, 0x83, 0x58, 0x90, 0x01, 0x37, 0x74, -0x02, 0xF0, 0xFD, 0x7F, 0x03, 0x71, 0x93, 0x71, 0xDF, 0xE4, 0x90, 0xA3, 0xA4, 0xF0, 0x22, 0xD3, -0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x12, 0x83, 0x5E, 0x7F, 0x00, 0x7E, 0x0C, 0x12, 0x36, 0xCE, -0xEF, 0x54, 0xFC, 0xFF, 0xEC, 0x90, 0xA5, 0x78, 0x12, 0x27, 0x48, 0x90, 0xA5, 0x78, 0x12, 0x4A, -0x50, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0x7F, 0x00, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x7F, 0x00, -0x7E, 0x0E, 0x12, 0x36, 0xCE, 0xEF, 0x54, 0xFC, 0xFF, 0xEC, 0x90, 0xA5, 0x78, 0x12, 0x27, 0x48, -0x90, 0xA5, 0x78, 0x12, 0x4A, 0x50, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0x7F, 0x00, 0x7E, 0x0E, -0x12, 0x37, 0x5D, 0x90, 0x00, 0x02, 0xE0, 0x54, 0xFE, 0xFD, 0x7F, 0x02, 0x12, 0x3A, 0x96, 0x90, -0x00, 0x02, 0xE0, 0x44, 0x01, 0xFD, 0x7F, 0x02, 0x12, 0x3A, 0x96, 0x90, 0x00, 0x02, 0xE0, 0x54, -0xFE, 0xFD, 0x7F, 0x02, 0x12, 0x3A, 0x96, 0x90, 0x00, 0x02, 0xE0, 0x44, 0x01, 0xFD, 0x7F, 0x02, -0x12, 0x3A, 0x96, 0x90, 0x00, 0x02, 0xE0, 0x54, 0xFE, 0xFD, 0x7F, 0x02, 0x12, 0x3A, 0x96, 0x7F, -0xB4, 0x7E, 0x08, 0x12, 0x36, 0xCE, 0xEF, 0x44, 0x40, 0xFF, 0xEC, 0x90, 0xA5, 0x78, 0x12, 0x27, -0x48, 0x90, 0xA5, 0x78, 0x12, 0x4A, 0x50, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0x7F, 0xB4, 0x7E, -0x08, 0x12, 0x37, 0x5D, 0x90, 0x01, 0x00, 0x74, 0x3F, 0xF0, 0xA3, 0xE0, 0x54, 0xFD, 0xF0, 0x90, -0x05, 0x53, 0xE0, 0x44, 0x20, 0xF0, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x36, 0xCE, 0x90, 0xA3, 0xAE, -0x12, 0x27, 0x48, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, 0x77, 0x7F, 0xB0, 0x7E, -0x0C, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, 0x77, 0x7F, 0xB0, -0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0xA3, 0xB7, 0xE0, 0xFF, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x30, -0xE0, 0x06, 0x90, 0x07, 0x78, 0x74, 0x01, 0xF0, 0xEF, 0xC3, 0x13, 0x30, 0xE0, 0x3C, 0x90, 0xA3, -0xFA, 0xE0, 0x60, 0x08, 0x90, 0xA5, 0x7C, 0x74, 0x01, 0xF0, 0x80, 0x05, 0xE4, 0x90, 0xA5, 0x7C, -0xF0, 0x90, 0xA3, 0xB7, 0xE0, 0xC4, 0x13, 0x54, 0x07, 0x30, 0xE0, 0x07, 0xE4, 0x90, 0xA5, 0x7D, -0xF0, 0x80, 0x06, 0x90, 0xA5, 0x7D, 0x74, 0x02, 0xF0, 0x90, 0xA5, 0x7C, 0xE0, 0xFF, 0xA3, 0xE0, -0xFD, 0x12, 0x76, 0x2B, 0x90, 0x07, 0x78, 0x74, 0x01, 0xF0, 0x90, 0xA3, 0xB6, 0xE0, 0x60, 0x02, -0xE4, 0xF0, 0x90, 0x00, 0xFF, 0xE0, 0x70, 0x12, 0x7B, 0x01, 0x7A, 0xA5, 0x79, 0x77, 0x12, 0x7C, -0xA8, 0x90, 0xA5, 0x77, 0xE0, 0x44, 0x18, 0x12, 0x7D, 0x46, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, -0xA3, 0xA1, 0xE0, 0x60, 0x2F, 0x90, 0xA3, 0x1D, 0xE0, 0x64, 0x01, 0x70, 0x27, 0x90, 0xA3, 0xA8, -0xF0, 0x04, 0x60, 0x20, 0x90, 0xA3, 0xA5, 0xE0, 0x44, 0x10, 0xF0, 0xE4, 0xF5, 0x23, 0x90, 0xA3, -0xA9, 0xB1, 0x8C, 0x90, 0xA3, 0xA4, 0xE0, 0x20, 0xE2, 0x07, 0x7D, 0x01, 0x7F, 0x04, 0x12, 0x50, -0x7E, 0x12, 0xAF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x01, 0xF5, 0x83, 0xEE, 0xF0, -0x22, 0xEF, 0x14, 0x90, 0x05, 0x73, 0xF0, 0x90, 0x01, 0x3F, 0x74, 0x10, 0xF0, 0xFD, 0x7F, 0x03, -0x74, 0x65, 0x2F, 0xF8, 0xE6, 0x4D, 0xFE, 0xF6, 0x74, 0x38, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x01, -0xF5, 0x83, 0xEE, 0xF0, 0x22, 0x61, 0x2F, 0x12, 0x26, 0x1E, 0x90, 0xA3, 0xAB, 0xF0, 0x22, 0x12, -0x26, 0x1E, 0x54, 0x01, 0xFF, 0x90, 0xA4, 0x39, 0xE0, 0x54, 0xFE, 0x4F, 0xF0, 0x22, 0xD3, 0x10, -0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0xA3, 0x18, 0xE0, 0xFF, 0x70, 0x06, 0xA3, 0xE0, 0x64, 0x09, -0x60, 0x0A, 0xEF, 0x14, 0xFF, 0x90, 0xA3, 0x19, 0xE0, 0xB5, 0x07, 0x04, 0x7F, 0x01, 0x80, 0x02, -0x7F, 0x00, 0xEF, 0x60, 0x09, 0x90, 0x01, 0xC1, 0xE0, 0x44, 0x02, 0xF0, 0x80, 0x35, 0xC0, 0x01, -0x90, 0xA3, 0x19, 0xE0, 0x75, 0xF0, 0x0F, 0xA4, 0x24, 0x82, 0xF9, 0x74, 0xA2, 0x35, 0xF0, 0xA8, -0x01, 0xFC, 0x7D, 0x01, 0xD0, 0x01, 0x7E, 0x00, 0x7F, 0x0F, 0x12, 0x49, 0x79, 0x90, 0xA3, 0x19, -0xE0, 0x04, 0xF0, 0xE0, 0x7F, 0x00, 0xB4, 0x0A, 0x02, 0x7F, 0x01, 0xEF, 0x60, 0x05, 0xE4, 0x90, -0xA3, 0x19, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xD1, 0x5B, 0xB1, 0x73, 0x11, 0xAF, 0xD3, 0x10, -0xAF, 0x01, 0xC3, 0xC0, 0xD0, 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9E, 0xE0, 0x24, -0x96, 0xF5, 0x82, 0xE4, 0x34, 0x99, 0xF5, 0x83, 0xE0, 0xFB, 0xE4, 0xFD, 0xFF, 0x91, 0x83, 0x90, -0xA5, 0x9E, 0xE0, 0x75, 0xF0, 0x04, 0x90, 0x96, 0x19, 0x12, 0x4A, 0x88, 0xE0, 0x13, 0x13, 0x54, -0x03, 0xFB, 0x0D, 0xE4, 0xFF, 0x91, 0x83, 0x90, 0xA5, 0x9E, 0xE0, 0x75, 0xF0, 0x04, 0x90, 0x96, -0x19, 0x12, 0x4A, 0x88, 0xE0, 0xC4, 0x13, 0x13, 0x13, 0x54, 0x01, 0xFB, 0x0D, 0xE4, 0xFF, 0x91, -0x83, 0x90, 0xA5, 0x9E, 0xE0, 0x75, 0xF0, 0x04, 0x90, 0x96, 0x19, 0x12, 0x4A, 0x88, 0xE0, 0xC4, -0x54, 0x03, 0xFB, 0x0D, 0xE4, 0xFF, 0x91, 0x83, 0x90, 0xA5, 0x9E, 0xE0, 0x75, 0xF0, 0x04, 0x90, -0x96, 0x16, 0x12, 0x4A, 0x88, 0xE0, 0xFB, 0xE4, 0xFD, 0x0F, 0x91, 0x83, 0x90, 0xA5, 0x9E, 0xE0, -0x75, 0xF0, 0x04, 0x90, 0x96, 0x17, 0x91, 0x7D, 0x90, 0xA5, 0x9E, 0xE0, 0x75, 0xF0, 0x04, 0x90, -0x96, 0x18, 0x12, 0x4A, 0x88, 0xE0, 0xC4, 0x13, 0x54, 0x01, 0xFB, 0x0D, 0x7F, 0x01, 0x91, 0x83, -0x90, 0xA5, 0x9E, 0xE0, 0x75, 0xF0, 0x04, 0x90, 0x96, 0x18, 0x12, 0x4A, 0x88, 0xE0, 0x54, 0x1F, -0xFB, 0x0D, 0x91, 0x83, 0x90, 0xA5, 0x9E, 0xE0, 0x75, 0xF0, 0x08, 0x90, 0x89, 0x00, 0x12, 0x4A, -0x88, 0xE0, 0xFB, 0xE4, 0xFD, 0x0F, 0x91, 0x83, 0x90, 0xA5, 0x9E, 0xE0, 0x75, 0xF0, 0x08, 0x90, -0x89, 0x01, 0x91, 0x7D, 0x90, 0xA5, 0x9E, 0xE0, 0x75, 0xF0, 0x08, 0x90, 0x89, 0x02, 0x91, 0x7D, -0x90, 0xA5, 0x9E, 0xE0, 0x75, 0xF0, 0x08, 0x90, 0x89, 0x03, 0x91, 0x7D, 0x90, 0xA5, 0x9E, 0xE0, -0x75, 0xF0, 0x08, 0x90, 0x89, 0x04, 0x12, 0x4A, 0x88, 0xE0, 0xFB, 0xE4, 0xFD, 0x0F, 0x91, 0x83, -0x90, 0xA5, 0x9E, 0xE0, 0x75, 0xF0, 0x08, 0x90, 0x89, 0x05, 0x91, 0x7D, 0x90, 0xA5, 0x9E, 0xE0, -0x75, 0xF0, 0x08, 0x90, 0x89, 0x06, 0x91, 0x7D, 0x90, 0xA5, 0x9E, 0xE0, 0x75, 0xF0, 0x08, 0x90, -0x89, 0x07, 0x12, 0x4A, 0x88, 0xE0, 0x81, 0x25, 0x90, 0xA3, 0xA1, 0xE0, 0xFB, 0xE4, 0xFD, 0xFF, -0x91, 0x83, 0x90, 0xA3, 0xA0, 0xE0, 0x54, 0x0F, 0xFB, 0x0D, 0x91, 0x83, 0x90, 0xA3, 0xA3, 0xE0, -0xFB, 0x0D, 0x91, 0x83, 0x90, 0xA3, 0xA4, 0xE0, 0xFB, 0x0D, 0x91, 0x83, 0x90, 0xA5, 0x9E, 0xE0, -0x24, 0x1D, 0xF5, 0x82, 0xE4, 0x34, 0xA3, 0xF5, 0x83, 0xE0, 0xFB, 0xE4, 0xFD, 0x0F, 0x91, 0x83, -0x90, 0xA3, 0x9E, 0xE0, 0x54, 0x01, 0xFB, 0x0D, 0x91, 0x83, 0x90, 0xA3, 0x9E, 0xE0, 0xC4, 0x13, -0x13, 0x54, 0x01, 0xFB, 0x0D, 0x7F, 0x01, 0x91, 0x83, 0x90, 0xA3, 0x9E, 0xE0, 0xC4, 0x13, 0x13, -0x13, 0x54, 0x01, 0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 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, 0x41, 0xA4, 0x6A, +0x00, 0x41, 0xA4, 0x6B, 0x00, 0x41, 0xA4, 0x6C, 0x00, 0x60, 0x54, 0xA0, 0x21, 0x04, 0x04, 0x04, +0x05, 0x07, 0x07, 0x09, 0x09, 0x0C, 0x0E, 0x10, 0x12, 0x05, 0x06, 0x07, 0x0D, 0x10, 0x11, 0x12, +0x12, 0x07, 0x08, 0x09, 0x09, 0x0C, 0x0E, 0x11, 0x13, 0x09, 0x09, 0x09, 0x09, 0x0C, 0x0E, 0x11, +0x13, 0x09, 0x09, 0x09, 0x09, 0x0C, 0x0E, 0x11, 0x13, 0x05, 0x06, 0x08, 0x09, 0x0C, 0x0E, 0x12, +0x12, 0x13, 0x14, 0x07, 0x08, 0x09, 0x0A, 0x0C, 0x0F, 0x12, 0x12, 0x14, 0x16, 0x09, 0x09, 0x09, +0x09, 0x0C, 0x0E, 0x11, 0x13, 0x13, 0x13, 0x09, 0x09, 0x09, 0x09, 0x0C, 0x0E, 0x11, 0x13, 0x13, +0x13, 0x41, 0xA4, 0x8F, 0x00, 0x41, 0xA4, 0x93, 0x00, 0x00, 0x58, 0x02, 0x5F, 0xFF, 0x77, 0xF6, +0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xE4, 0x90, 0xA3, 0x6B, 0xF0, 0x90, 0xA3, 0x70, 0xF0, +0x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 0x08, 0x90, 0xA3, 0x6E, 0xE0, 0x60, +0x35, 0x80, 0x00, 0x90, 0xA3, 0x70, 0x74, 0x01, 0xF0, 0x90, 0xA3, 0x70, 0xE0, 0x70, 0x09, 0xEE, +0xC4, 0x13, 0x54, 0x07, 0xA3, 0xF0, 0x80, 0x0C, 0x90, 0xA3, 0x6F, 0xE0, 0x54, 0x0E, 0xC3, 0x13, +0x90, 0xA3, 0x71, 0xF0, 0x90, 0xA3, 0x71, 0xE0, 0x90, 0xA3, 0x68, 0xF0, 0x80, 0x10, 0x90, 0xA3, +0x72, 0x74, 0x01, 0xF0, 0x80, 0x40, 0x90, 0xA3, 0x6E, 0xE0, 0x04, 0xF0, 0x80, 0x99, 0x90, 0xA3, +0x67, 0xE0, 0x25, 0xE0, 0x25, 0xE0, 0x54, 0x0C, 0xFF, 0x90, 0xA3, 0x66, 0xE0, 0x54, 0x03, 0x4F, +0xFF, 0x90, 0xA3, 0x68, 0xE0, 0xFE, 0xC4, 0x54, 0x70, 0x4F, 0x44, 0x80, 0xFD, 0x7F, 0x8B, 0x12, +0x3A, 0x96, 0x90, 0xA3, 0x66, 0xE0, 0x60, 0x08, 0xA3, 0xE0, 0x60, 0x04, 0xA3, 0xE0, 0x70, 0x1B, +0x90, 0xA3, 0x72, 0x74, 0x03, 0xF0, 0x90, 0x01, 0xC4, 0x74, 0x90, 0xF0, 0x74, 0x4B, 0xA3, 0xF0, +0x90, 0xA3, 0x72, 0xE0, 0x90, 0x01, 0xC8, 0xB1, 0x03, 0x80, 0xEB, 0xD0, 0xD0, 0x92, 0xAF, 0x22, +0x90, 0xA3, 0x6E, 0xE0, 0xFF, 0xC3, 0x94, 0x02, 0x22, 0x9F, 0xFF, 0x74, 0x03, 0x94, 0x00, 0xFE, +0x7B, 0x01, 0x22, 0xF0, 0xE4, 0xFD, 0x7F, 0x1F, 0x02, 0x3A, 0x96, 0xD3, 0x10, 0xAF, 0x01, 0xC3, +0xC0, 0xD0, 0x90, 0xA3, 0x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E, 0xF0, 0x41, 0x4E, 0xE7, 0x42, 0x4E, 0xEB, 0x46, 0x4E, 0xF5, 0x60, +0x4E, 0xFA, 0x64, 0x4E, 0xFF, 0x65, 0x4F, 0x04, 0x6B, 0x4F, 0x09, 0x6D, 0x4F, 0x0E, 0x6E, 0x4F, +0x13, 0x6F, 0x4F, 0x18, 0x70, 0x4F, 0x1D, 0x87, 0x00, 0x00, 0x4F, 0x22, 0xF1, 0x32, 0x02, 0x98, +0x14, 0xF1, 0x32, 0x02, 0x98, 0x72, 0xF1, 0x32, 0x02, 0x99, 0x7C, 0xF1, 0x32, 0x02, 0x98, 0x58, +0xF1, 0x32, 0x02, 0x81, 0x55, 0xF1, 0x32, 0x02, 0x99, 0xB8, 0xF1, 0x32, 0x02, 0x9A, 0x8D, 0xF1, +0x32, 0x02, 0x9A, 0x9C, 0xF1, 0x32, 0x02, 0x9C, 0x4C, 0xF1, 0x32, 0x02, 0x9C, 0x88, 0xF1, 0x32, +0x02, 0x9C, 0x90, 0xF1, 0x32, 0xA1, 0x38, 0xF1, 0x32, 0x80, 0x66, 0xF1, 0x32, 0x02, 0xAA, 0x7D, +0xF1, 0x32, 0x02, 0x7B, 0x14, 0xF1, 0x32, 0x02, 0x51, 0x82, 0xF1, 0x32, 0x02, 0x9C, 0xCD, 0xF1, +0x32, 0x02, 0x9E, 0x6D, 0xF1, 0x32, 0x02, 0x50, 0x95, 0xF1, 0x32, 0x02, 0x9E, 0x7B, 0xF1, 0x32, +0x02, 0x9E, 0xE9, 0xF1, 0x32, 0x02, 0x9F, 0x15, 0xF1, 0x32, 0x02, 0x9F, 0x38, 0xF1, 0x32, 0x02, +0xAB, 0x3F, 0x90, 0x01, 0xC0, 0xE0, 0x44, 0x01, 0xF0, 0x90, 0xA3, 0x75, 0xE0, 0x90, 0x01, 0xC2, +0xF0, 0x22, 0x90, 0xA3, 0x76, 0x41, 0x36, 0xFF, 0x75, 0xF0, 0x04, 0xE5, 0x0D, 0x90, 0x96, 0x14, +0x51, 0x2A, 0xE0, 0x22, 0xF0, 0x74, 0x91, 0x25, 0x0D, 0xF5, 0x82, 0xE4, 0x34, 0x99, 0xF5, 0x83, +0x22, 0xF1, 0xE9, 0xF5, 0x0D, 0x24, 0x91, 0xF1, 0x49, 0xE0, 0x54, 0x9C, 0xF1, 0x44, 0xC0, 0x83, +0xC0, 0x82, 0xF1, 0xD7, 0x54, 0x01, 0xFE, 0xEF, 0x4E, 0xD0, 0x82, 0xD0, 0x83, 0xF1, 0x44, 0xC0, +0x83, 0xC0, 0x82, 0xF1, 0xD7, 0x54, 0x02, 0xFE, 0xEF, 0x4E, 0xD0, 0x82, 0xD0, 0x83, 0xF1, 0x44, +0xC0, 0x83, 0xC0, 0x82, 0xF1, 0xD7, 0x54, 0x40, 0xFE, 0xEF, 0x4E, 0xD0, 0x82, 0xD0, 0x83, 0xF1, +0x44, 0xC0, 0x83, 0xC0, 0x82, 0xF1, 0xD7, 0x54, 0x20, 0xFE, 0xEF, 0x4E, 0xD0, 0x82, 0xD0, 0x83, +0xF0, 0xE5, 0x0D, 0xC3, 0x94, 0x80, 0x50, 0x10, 0xF1, 0xD1, 0xFF, 0x74, 0x11, 0x25, 0x0D, 0xF5, +0x82, 0xE4, 0x34, 0x9A, 0xF5, 0x83, 0xEF, 0xF0, 0xF1, 0x45, 0xE0, 0x30, 0xE5, 0x10, 0xF1, 0x38, +0x13, 0x13, 0x54, 0x03, 0xFB, 0x12, 0x61, 0x84, 0xFD, 0xAF, 0x0D, 0x12, 0xAA, 0x17, 0x22, 0x4F, +0xF0, 0x90, 0x00, 0x02, 0x02, 0x26, 0x37, 0xE0, 0xFF, 0x90, 0xA3, 0x79, 0x51, 0x36, 0x90, 0x00, +0x03, 0x02, 0x26, 0x37, 0x90, 0xA3, 0x79, 0x41, 0x36, 0x90, 0xA3, 0x79, 0x51, 0x3F, 0x02, 0x26, +0x1E, 0x90, 0xA2, 0xD2, 0xE0, 0xC4, 0x13, 0x13, 0x13, 0x54, 0x01, 0x22, 0x90, 0x00, 0xF0, 0xE0, +0x7F, 0x01, 0x20, 0xE2, 0x02, 0x7F, 0x03, 0x22, 0x12, 0x4F, 0xFC, 0x90, 0xA1, 0x7C, 0xEF, 0xF0, +0x11, 0x1B, 0x90, 0x01, 0x64, 0x74, 0x01, 0xF0, 0x02, 0x35, 0x95, 0x11, 0x40, 0x11, 0x6E, 0x12, +0xA0, 0x7A, 0x12, 0xA0, 0x99, 0x12, 0xA0, 0x54, 0xE4, 0xF5, 0x51, 0x75, 0x52, 0x58, 0xAB, 0x51, +0x7D, 0x02, 0x7F, 0x01, 0x12, 0x39, 0x04, 0xAB, 0x52, 0x7D, 0x03, 0x7F, 0x01, 0x02, 0x39, 0x04, +0x90, 0x01, 0x30, 0xE4, 0x11, 0x66, 0x90, 0x01, 0x38, 0x11, 0x66, 0xFD, 0x7F, 0x50, 0x12, 0x3A, +0x96, 0xE4, 0xFD, 0x7F, 0x51, 0x12, 0x3A, 0x96, 0xE4, 0xFD, 0x7F, 0x52, 0x12, 0x3A, 0x96, 0xE4, +0xFD, 0x7F, 0x53, 0x02, 0x3A, 0x96, 0xF0, 0xA3, 0xF0, 0xA3, 0xF0, 0xA3, 0xF0, 0x22, 0x90, 0x01, +0x34, 0x74, 0xFF, 0x11, 0x66, 0x90, 0x01, 0x3C, 0x11, 0x66, 0xFD, 0x7F, 0x54, 0x12, 0x3A, 0x96, +0x7D, 0xFF, 0x7F, 0x55, 0x12, 0x3A, 0x96, 0x7D, 0xFF, 0x7F, 0x56, 0x12, 0x3A, 0x96, 0x7D, 0xFF, +0x7F, 0x57, 0x02, 0x3A, 0x96, 0x12, 0x26, 0x1E, 0xFF, 0x54, 0x01, 0xFE, 0x90, 0xA3, 0x1D, 0xE0, +0x54, 0xFE, 0x4E, 0xFE, 0xF0, 0xEF, 0x54, 0x06, 0xFF, 0xEE, 0x54, 0xF9, 0x4F, 0xFF, 0xF0, 0x12, +0x26, 0x1E, 0xFE, 0x54, 0x08, 0xFD, 0x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0xDC, 0xF0, 0x90, 0x01, +0x3E, 0x74, 0x08, 0xF0, 0xFD, 0x7F, 0x02, 0x12, 0x86, 0xD8, 0xE4, 0x90, 0xA3, 0x0E, 0xF0, 0x12, +0x4F, 0xD9, 0xC4, 0x13, 0x13, 0x54, 0x03, 0x20, 0xE0, 0x36, 0x90, 0xA2, 0xCF, 0xE0, 0xC3, 0x13, +0x20, 0xE0, 0x06, 0x12, 0x4F, 0xF4, 0x30, 0xE0, 0x27, 0x12, 0x26, 0x1E, 0x13, 0x13, 0x13, 0x54, +0x1F, 0x30, 0xE0, 0x08, 0x90, 0xA3, 0x10, 0xE0, 0x60, 0x08, 0x80, 0x0B, 0x90, 0xA3, 0x10, 0xE0, +0x60, 0x05, 0x75, 0x0D, 0x01, 0x80, 0x03, 0xE4, 0xF5, 0x0D, 0x7D, 0x02, 0xAF, 0x0D, 0x91, 0x2B, +0x90, 0xA2, 0xCF, 0xE0, 0xC4, 0x54, 0x0F, 0x30, 0xE0, 0x13, 0xF1, 0xE6, 0x54, 0x07, 0x30, 0xE0, +0x07, 0x7D, 0x04, 0x7F, 0x02, 0x12, 0x58, 0xF6, 0xF1, 0xA1, 0x74, 0x11, 0xF0, 0x90, 0x05, 0x58, +0x74, 0x02, 0xF0, 0x90, 0xA2, 0xD7, 0xE0, 0xB4, 0x01, 0x08, 0x90, 0xA2, 0xE2, 0x74, 0x01, 0xF0, +0x80, 0x27, 0x90, 0xA2, 0xD7, 0xE0, 0xB4, 0x04, 0x08, 0x90, 0xA2, 0xE2, 0x74, 0x04, 0xF0, 0x80, +0x18, 0x90, 0xA2, 0xD7, 0xE0, 0xB4, 0x06, 0x08, 0x90, 0xA2, 0xE2, 0x74, 0x02, 0xF0, 0x80, 0x09, +0x90, 0xA2, 0xD7, 0xE0, 0xB4, 0x07, 0x02, 0xF1, 0xED, 0xE4, 0x90, 0xA2, 0xD7, 0xF0, 0x80, 0x54, +0x12, 0x4F, 0xD9, 0xF1, 0xF4, 0x30, 0xE0, 0x05, 0x75, 0x0E, 0x02, 0x80, 0x11, 0x12, 0x26, 0x1E, +0x12, 0xA7, 0x04, 0x30, 0xE0, 0x05, 0x75, 0x0E, 0x01, 0x80, 0x03, 0xE4, 0xF5, 0x0E, 0x12, 0x9E, +0x57, 0x90, 0xA3, 0x2F, 0xE0, 0x30, 0xE0, 0x04, 0x7D, 0xA0, 0x80, 0x02, 0x7D, 0x20, 0x7F, 0x40, +0x12, 0x3A, 0x96, 0x12, 0x4F, 0xD9, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x30, 0xE0, 0x04, 0x7F, 0x03, +0x80, 0x02, 0x7F, 0x01, 0x12, 0x95, 0x54, 0xAD, 0x0E, 0x7F, 0x02, 0x91, 0x2B, 0xF1, 0xB4, 0xF1, +0xA1, 0x74, 0x43, 0xF0, 0x12, 0x97, 0xDA, 0x90, 0xA2, 0xE1, 0xF0, 0x12, 0x4F, 0xF1, 0x30, 0xE0, +0x09, 0x90, 0xA3, 0x01, 0xE0, 0x44, 0x02, 0xF0, 0x80, 0x0B, 0x7F, 0x01, 0xF1, 0x0D, 0x90, 0xA3, +0x01, 0xE0, 0x54, 0xFD, 0xF0, 0x7F, 0x03, 0x12, 0x97, 0x2E, 0x90, 0xA2, 0xCF, 0xE0, 0x20, 0xE0, +0x07, 0x90, 0xA2, 0xD3, 0xE0, 0x54, 0xBF, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x4E, 0xFF, 0xF0, +0x90, 0x00, 0x04, 0x02, 0x26, 0x37, 0xE0, 0xFF, 0xA3, 0xE0, 0xFD, 0xD3, 0x10, 0xAF, 0x01, 0xC3, +0xC0, 0xD0, 0x8F, 0x74, 0x8D, 0x75, 0xE5, 0x74, 0x64, 0x02, 0x60, 0x23, 0xF1, 0x72, 0x91, 0xB2, +0xE5, 0x74, 0x90, 0xA4, 0x08, 0xB4, 0x01, 0x08, 0x12, 0x4A, 0x12, 0xEC, 0x44, 0x08, 0x80, 0x06, +0x12, 0x4A, 0x12, 0xEC, 0x44, 0x04, 0x91, 0xB2, 0x90, 0xA4, 0x08, 0x91, 0xCA, 0xF1, 0x48, 0xE5, +0x75, 0x64, 0x02, 0x60, 0x48, 0x12, 0x77, 0xB8, 0xE4, 0x91, 0xB2, 0xE5, 0x75, 0x70, 0x08, 0xF1, +0x56, 0x44, 0x77, 0x91, 0xB2, 0x80, 0x2A, 0xF1, 0x56, 0x44, 0x66, 0x91, 0xB2, 0xF1, 0x72, 0xF1, +0x4F, 0x90, 0xA3, 0x10, 0xE0, 0x90, 0xA4, 0x0C, 0x60, 0x08, 0x12, 0x4A, 0x12, 0xEC, 0x44, 0x04, +0x80, 0x06, 0x12, 0x4A, 0x12, 0xEC, 0x44, 0x08, 0xF1, 0x4F, 0x90, 0xA4, 0x0C, 0x91, 0xCA, 0xF1, +0x48, 0x90, 0xA4, 0x08, 0x91, 0xCA, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0xD0, 0xD0, 0x92, +0xAF, 0x22, 0xFC, 0x90, 0xA4, 0x08, 0x02, 0x27, 0x48, 0x12, 0x36, 0xCE, 0xEF, 0x54, 0xFC, 0xFF, +0xEC, 0x90, 0xA4, 0x1F, 0x12, 0x27, 0x48, 0x90, 0xA4, 0x1F, 0x12, 0x4A, 0x12, 0x90, 0xAC, 0xB9, +0x02, 0x27, 0x48, 0x7F, 0xAC, 0x7E, 0x08, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0xA3, +0xEE, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0x12, 0x36, 0xCE, 0x90, 0xA3, 0xF8, 0x12, 0x27, 0x48, 0x90, +0xA3, 0xF0, 0x12, 0x4A, 0x12, 0x12, 0x27, 0x15, 0x90, 0xA3, 0xF8, 0xF1, 0x3B, 0xC0, 0x04, 0xC0, +0x05, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xA3, 0xF0, 0x12, 0x4A, 0x12, 0x90, 0xA3, 0xF4, 0xF1, 0x3B, +0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0x12, 0x4A, 0x05, 0x90, 0xA3, 0xFC, 0x12, 0x27, +0x48, 0x90, 0xA3, 0xFC, 0x91, 0xCA, 0x90, 0xA3, 0xEE, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x12, 0x37, +0x5D, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0xA4, 0x37, 0xEF, 0xF0, 0xA3, 0xED, 0xF0, 0xA3, 0x12, +0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x34, 0x7E, 0x08, 0x12, 0x36, 0xCE, 0x90, 0xA4, 0x39, +0x12, 0x27, 0x48, 0x90, 0xA4, 0x37, 0xE0, 0x14, 0x60, 0x5E, 0x14, 0x70, 0x02, 0xC1, 0x6B, 0x24, +0x02, 0x60, 0x02, 0xC1, 0xEE, 0x90, 0xA3, 0xF0, 0x12, 0x27, 0x54, 0x00, 0x30, 0x03, 0xC3, 0x90, +0xA3, 0xF4, 0x12, 0x27, 0x54, 0x00, 0x30, 0x02, 0x00, 0xF1, 0x03, 0x12, 0x27, 0x54, 0x40, 0x00, +0x00, 0x00, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xC4, 0xF1, 0x05, +0x12, 0x27, 0x54, 0x00, 0x1C, 0x00, 0x00, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x00, 0x10, 0x00, +0x00, 0x7F, 0x64, 0xF1, 0x05, 0x12, 0x27, 0x54, 0x03, 0xC0, 0x00, 0x00, 0x90, 0xA3, 0xF4, 0x12, +0x27, 0x54, 0x01, 0xC0, 0x00, 0x00, 0xC1, 0xD1, 0x90, 0xA3, 0xF0, 0x12, 0x27, 0x54, 0x00, 0x30, +0x03, 0xC3, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x00, 0x30, 0x02, 0x01, 0xF1, 0x03, 0x12, 0x27, +0x54, 0x40, 0x00, 0x00, 0x00, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7F, +0xC4, 0xF1, 0x05, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x3C, 0xD1, 0xEF, 0x12, 0x27, 0x54, 0xF0, +0x00, 0x00, 0x00, 0x12, 0xB3, 0x20, 0xF1, 0x05, 0x12, 0x27, 0x54, 0x00, 0x1C, 0x00, 0x00, 0x90, +0xA3, 0xF4, 0x12, 0x27, 0x54, 0x00, 0x08, 0x00, 0x00, 0xF1, 0x89, 0x60, 0x13, 0x12, 0x27, 0x54, +0x03, 0xC0, 0x00, 0x00, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x01, 0x80, 0x00, 0x00, 0x80, 0x11, +0x12, 0x27, 0x54, 0x03, 0xC0, 0x00, 0x00, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x01, 0xC0, 0x00, +0x00, 0x7F, 0x48, 0x7E, 0x08, 0x91, 0xD7, 0x90, 0xA4, 0x38, 0xE0, 0x90, 0xA3, 0xF0, 0xB4, 0x01, +0x13, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x10, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x00, 0x00, +0x00, 0x10, 0x80, 0x11, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x10, 0x90, 0xA3, 0xF4, 0x12, 0x27, +0x54, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x00, 0x7E, 0x0A, 0xC1, 0xEC, 0x90, 0xA3, 0xF0, 0x12, 0x27, +0x54, 0x00, 0x30, 0x03, 0xC3, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x00, 0x30, 0x02, 0x02, 0xF1, +0x03, 0x12, 0x27, 0x54, 0x40, 0x00, 0x00, 0x00, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x40, 0x00, +0x00, 0x00, 0x7F, 0xC4, 0xF1, 0x05, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x3C, 0xD1, 0xEF, 0x12, +0x27, 0x54, 0xF0, 0x00, 0x00, 0x00, 0x12, 0xB3, 0x20, 0xF1, 0x05, 0x12, 0x27, 0x54, 0x00, 0x1C, +0x00, 0x00, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x00, 0x08, 0x00, 0x00, 0xF1, 0x89, 0x60, 0x17, +0x12, 0x27, 0x54, 0x03, 0xC0, 0x00, 0x00, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x01, 0x40, 0x00, +0x00, 0x7F, 0x48, 0x7E, 0x08, 0x80, 0x15, 0x12, 0x27, 0x54, 0x03, 0xC0, 0x00, 0x00, 0x90, 0xA3, +0xF4, 0x12, 0x27, 0x54, 0x01, 0x80, 0x00, 0x00, 0x7F, 0x48, 0x7E, 0x08, 0x91, 0xD7, 0x22, 0x90, +0xA4, 0x38, 0xE0, 0xFF, 0xE4, 0xFC, 0xFD, 0xFE, 0x78, 0x02, 0x12, 0x27, 0x35, 0x90, 0xA3, 0xF4, +0x12, 0x27, 0x48, 0x7F, 0xAC, 0x7E, 0x08, 0x91, 0xD7, 0x90, 0xA3, 0xF0, 0x22, 0x90, 0xA3, 0x01, +0xE0, 0xFE, 0xC3, 0x13, 0x30, 0xE0, 0x23, 0xEF, 0xB4, 0x01, 0x0C, 0x90, 0xA3, 0x08, 0x91, 0xCA, +0xF1, 0x41, 0x90, 0xA3, 0x08, 0x80, 0x0A, 0x90, 0xA3, 0x04, 0x91, 0xCA, 0xF1, 0x41, 0x90, 0xA3, +0x04, 0x91, 0xCA, 0x7F, 0x58, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x22, 0x12, 0x4A, 0x1E, 0x02, 0x49, +0xF8, 0x7F, 0x58, 0x7E, 0x0C, 0x02, 0x37, 0x5D, 0x7F, 0xB4, 0x7E, 0x0C, 0x02, 0x37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 0x80, 0xFD, 0x7F, 0x80, 0x12, 0x3A, 0x96, 0x12, 0xA0, +0xBB, 0x12, 0x3A, 0xB8, 0x12, 0xA0, 0xC8, 0x12, 0xA1, 0x2C, 0x7F, 0x01, 0x12, 0x46, 0xF5, 0x90, +0xA3, 0x30, 0x74, 0x02, 0xF0, 0xFF, 0x12, 0x46, 0xF5, 0x90, 0xA3, 0x30, 0xE0, 0x04, 0xF0, 0x12, +0x50, 0x08, 0x11, 0x54, 0x12, 0x4B, 0x90, 0x90, 0x00, 0x80, 0xE0, 0x44, 0x40, 0xFD, 0x7F, 0x80, +0x12, 0x3A, 0x96, 0x75, 0x28, 0xFF, 0x12, 0x57, 0xFB, 0x12, 0x7C, 0x42, 0x12, 0xA1, 0x36, 0xE4, +0xFF, 0x02, 0x47, 0x7E, 0x12, 0x99, 0x6B, 0x12, 0x9F, 0x9F, 0x12, 0x6A, 0xC1, 0x11, 0x68, 0x12, +0xAB, 0x30, 0x12, 0x9D, 0x2E, 0x02, 0x57, 0xD3, 0x7E, 0x00, 0x7F, 0x45, 0x7D, 0x00, 0x7B, 0x01, +0x7A, 0xA2, 0x79, 0x83, 0x12, 0x4A, 0x6E, 0x90, 0xA2, 0x86, 0x74, 0x02, 0xF0, 0x90, 0xA2, 0x8D, +0x14, 0xF0, 0xA3, 0xF0, 0xA3, 0x74, 0x08, 0xF0, 0x90, 0xA2, 0x93, 0xE4, 0xF0, 0xA3, 0x74, 0x02, +0xF0, 0x31, 0x59, 0x74, 0x08, 0xF0, 0xE4, 0xFD, 0xFF, 0x11, 0xF6, 0x7D, 0x0C, 0x7F, 0x02, 0x11, +0xF6, 0x11, 0xF2, 0x90, 0xA1, 0x7C, 0xE0, 0xFF, 0xB4, 0x01, 0x08, 0x90, 0xA2, 0x92, 0x74, 0xFF, +0xF0, 0x80, 0x0F, 0xEF, 0x90, 0xA2, 0x92, 0xB4, 0x03, 0x05, 0x74, 0xD4, 0xF0, 0x80, 0x03, 0x74, +0x41, 0xF0, 0x12, 0x9C, 0x72, 0x31, 0x59, 0x74, 0x08, 0xF0, 0x90, 0xA2, 0x95, 0x12, 0x27, 0x54, +0x54, 0x33, 0x77, 0x70, 0x7E, 0x00, 0x7F, 0x02, 0x7D, 0x00, 0x7B, 0x01, 0x7A, 0xA2, 0x79, 0xCC, +0x12, 0x4A, 0x6E, 0x12, 0xB2, 0x8F, 0x12, 0xB4, 0x69, 0x12, 0x57, 0xB4, 0xE4, 0x90, 0xA2, 0xCE, +0xF0, 0x22, 0x7D, 0x0C, 0x7F, 0x01, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xAC, 0x07, 0xEF, +0x14, 0x60, 0x15, 0x14, 0x60, 0x19, 0x24, 0x02, 0x70, 0x1A, 0xED, 0x54, 0x01, 0xFE, 0x90, 0xA2, +0x83, 0xE0, 0x54, 0xFE, 0x4E, 0xF0, 0x80, 0x0C, 0x90, 0xA2, 0x8A, 0xED, 0xF0, 0x80, 0x05, 0x90, +0xA2, 0x89, 0xED, 0xF0, 0x90, 0x00, 0x8F, 0xE0, 0x30, 0xE4, 0x29, 0xEC, 0x14, 0x60, 0x07, 0x14, +0x60, 0x18, 0x24, 0x02, 0x70, 0x1E, 0x90, 0xA2, 0x83, 0xE0, 0x12, 0xB4, 0x21, 0xFF, 0x90, 0xA2, +0x8A, 0xE0, 0x54, 0x7F, 0x4F, 0xFD, 0x7F, 0x88, 0x80, 0x07, 0x90, 0xA2, 0x89, 0xE0, 0xFD, 0x7F, +0x89, 0x12, 0x3A, 0x96, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0xA2, 0xBD, 0xE0, 0x24, 0x04, 0x90, +0xA2, 0x9F, 0xF0, 0xA3, 0x22, 0x90, 0xA4, 0x90, 0xEF, 0xF0, 0x12, 0x8E, 0xB2, 0x90, 0xA4, 0x90, +0xE0, 0x60, 0x03, 0x12, 0x57, 0xB4, 0x7D, 0x04, 0x7F, 0x01, 0x01, 0xF6, 0x7D, 0x01, 0x7F, 0x04, +0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0xA4, 0x91, 0xED, 0xF0, 0x90, 0xA2, 0x83, 0xE0, +0xFE, 0xC4, 0x13, 0x13, 0x54, 0x03, 0x30, 0xE0, 0x02, 0x41, 0xC6, 0xEE, 0x12, 0x4F, 0xF5, 0x30, +0xE0, 0x02, 0x41, 0xC6, 0x90, 0xA2, 0x8A, 0xE0, 0xFE, 0x6F, 0x70, 0x02, 0x41, 0xC6, 0xEF, 0x70, +0x02, 0x41, 0x3F, 0x24, 0xFE, 0x70, 0x02, 0x41, 0x78, 0x24, 0xFE, 0x60, 0x4A, 0x24, 0xFC, 0x70, +0x02, 0x41, 0xB3, 0x24, 0xFC, 0x60, 0x02, 0x41, 0xC6, 0xEE, 0xB4, 0x0E, 0x02, 0x51, 0xF9, 0x90, +0xA2, 0x8A, 0xE0, 0x70, 0x04, 0x7F, 0x01, 0x31, 0x65, 0x90, 0xA2, 0x8A, 0xE0, 0xB4, 0x06, 0x02, +0x71, 0x14, 0x90, 0xA2, 0x8A, 0xE0, 0xB4, 0x04, 0x0F, 0x90, 0xA4, 0x91, 0xE0, 0xFF, 0x60, 0x05, +0x12, 0xA2, 0x26, 0x80, 0x03, 0x12, 0x8F, 0x8C, 0x90, 0xA2, 0x8A, 0xE0, 0x64, 0x08, 0x60, 0x02, +0x41, 0xC6, 0x12, 0xB2, 0x27, 0x41, 0xC6, 0x90, 0xA2, 0x8A, 0xE0, 0x70, 0x04, 0x7F, 0x01, 0x31, +0x65, 0x90, 0xA2, 0x8A, 0xE0, 0xB4, 0x06, 0x02, 0x71, 0x14, 0x90, 0xA2, 0x8A, 0xE0, 0xB4, 0x0E, +0x07, 0x51, 0xCB, 0xBF, 0x01, 0x02, 0x51, 0xF9, 0x90, 0xA2, 0x8A, 0xE0, 0x64, 0x0C, 0x60, 0x02, +0x41, 0xC6, 0x51, 0xCB, 0xEF, 0x64, 0x01, 0x60, 0x02, 0x41, 0xC6, 0x71, 0x35, 0x41, 0xC6, 0x90, +0xA2, 0x8A, 0xE0, 0xB4, 0x0E, 0x07, 0x51, 0xCB, 0xBF, 0x01, 0x02, 0x51, 0xF9, 0x90, 0xA2, 0x8A, +0xE0, 0xB4, 0x06, 0x02, 0x71, 0x14, 0x90, 0xA2, 0x8A, 0xE0, 0xB4, 0x0C, 0x07, 0x51, 0xCB, 0xBF, +0x01, 0x02, 0x71, 0x35, 0x90, 0xA2, 0x8A, 0xE0, 0x64, 0x04, 0x70, 0x5A, 0x12, 0xB1, 0x7B, 0xEF, +0x64, 0x01, 0x70, 0x52, 0xF1, 0xC2, 0x80, 0x4E, 0x90, 0xA2, 0x8A, 0xE0, 0xB4, 0x0E, 0x07, 0x51, +0xCB, 0xBF, 0x01, 0x02, 0x51, 0xF9, 0x90, 0xA2, 0x8A, 0xE0, 0xB4, 0x06, 0x02, 0x71, 0x14, 0x90, +0xA2, 0x8A, 0xE0, 0xB4, 0x0C, 0x07, 0x51, 0xCB, 0xBF, 0x01, 0x02, 0x71, 0x35, 0x90, 0xA2, 0x8A, +0xE0, 0x70, 0x04, 0x7F, 0x01, 0x31, 0x65, 0x90, 0xA2, 0x8A, 0xE0, 0xB4, 0x04, 0x18, 0x12, 0xB1, +0xFD, 0x80, 0x13, 0x90, 0xA2, 0x8A, 0xE0, 0xB4, 0x0C, 0x0C, 0x90, 0xA2, 0x84, 0x12, 0x93, 0xF9, +0x30, 0xE0, 0x03, 0x12, 0xB2, 0x16, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0xA2, 0xCF, 0xE0, 0x30, +0xE0, 0x0D, 0x90, 0xA2, 0xD5, 0xE0, 0xC4, 0x13, 0x54, 0x07, 0x30, 0xE0, 0x08, 0x80, 0x17, 0x12, +0xB1, 0x62, 0xBF, 0x01, 0x11, 0xF1, 0xAD, 0x20, 0xE0, 0x0C, 0x90, 0xA2, 0x89, 0xE0, 0xD3, 0x94, +0x04, 0x50, 0x03, 0x7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22, 0xE4, +0x90, 0xA3, 0x73, 0xF0, 0x90, 0xA3, 0x73, 0xE0, 0x64, 0x01, 0xF0, 0x24, 0xFF, 0x90, 0x01, 0xC4, +0xF0, 0x74, 0x5F, 0xA3, 0xF0, 0x12, 0x3A, 0xEB, 0xBF, 0x01, 0x03, 0x12, 0x31, 0x69, 0x90, 0xA2, +0x87, 0xE0, 0x60, 0x0F, 0x90, 0xA2, 0x8A, 0xE0, 0xFF, 0x90, 0xA2, 0x89, 0xE0, 0x6F, 0x60, 0x03, +0x12, 0xA4, 0xED, 0xC2, 0xAF, 0x12, 0xA0, 0xF8, 0xBF, 0x01, 0x03, 0x12, 0xB2, 0x0B, 0xD2, 0xAF, +0x11, 0x47, 0x12, 0x46, 0x2D, 0x80, 0xBD, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x00, +0x8F, 0xE0, 0x20, 0xE6, 0x02, 0x21, 0x3B, 0x90, 0x00, 0x8C, 0xE0, 0xF5, 0x72, 0xA3, 0xE0, 0xFF, +0xA3, 0xE0, 0xF5, 0x73, 0xEF, 0x24, 0xFC, 0x60, 0x13, 0x24, 0xEE, 0x70, 0x02, 0x01, 0xF6, 0x24, +0x15, 0x60, 0x02, 0x21, 0x31, 0xAF, 0x72, 0x12, 0xAA, 0xD4, 0x21, 0x31, 0x74, 0x11, 0x25, 0x72, +0x31, 0x88, 0xFB, 0xE4, 0xFD, 0x31, 0x7A, 0x12, 0x4F, 0x3D, 0x13, 0x13, 0x31, 0x75, 0x12, 0x4F, +0x3D, 0x12, 0x4F, 0xF5, 0x31, 0x77, 0x12, 0x4F, 0x3D, 0xC4, 0x31, 0x75, 0x12, 0x6F, 0xF9, 0xE0, +0xFB, 0xE4, 0xFD, 0x0F, 0x31, 0x7B, 0x12, 0x6B, 0xDB, 0xE0, 0xFB, 0x0D, 0x31, 0x7B, 0x12, 0x6B, +0xE5, 0xC4, 0x13, 0x54, 0x01, 0xFB, 0x0D, 0x7F, 0x01, 0x31, 0x7B, 0x12, 0x6B, 0xE5, 0x54, 0x1F, +0x31, 0x6B, 0x90, 0x89, 0x00, 0x12, 0xB4, 0x18, 0x31, 0x6D, 0x90, 0x89, 0x01, 0x31, 0x67, 0x90, +0x89, 0x02, 0x31, 0x67, 0x90, 0x89, 0x03, 0x31, 0x67, 0x90, 0x89, 0x04, 0x12, 0xB4, 0x18, 0x31, +0x6D, 0x90, 0x89, 0x05, 0x31, 0x67, 0x90, 0x89, 0x06, 0x31, 0x67, 0x90, 0x89, 0x07, 0x12, 0x4A, +0x2A, 0xE0, 0xFB, 0x0D, 0x80, 0x39, 0x90, 0xA3, 0x5E, 0xE0, 0xFB, 0xE4, 0xFD, 0xFF, 0x31, 0x43, +0x90, 0xA3, 0x5F, 0xA3, 0x31, 0x40, 0x90, 0xA3, 0x61, 0x31, 0x40, 0x90, 0xA3, 0x62, 0xE0, 0x54, +0x03, 0xFB, 0x0D, 0x31, 0x43, 0x90, 0xA3, 0x63, 0xA3, 0xE0, 0xFB, 0xE4, 0xFD, 0x0F, 0x31, 0x43, +0x90, 0xA3, 0x63, 0xE0, 0xFB, 0x0D, 0x31, 0x43, 0x90, 0xA3, 0x65, 0xE0, 0xFB, 0x1D, 0x0F, 0x31, +0x43, 0x90, 0x00, 0x8F, 0xE0, 0x30, 0xE0, 0x03, 0x12, 0xAB, 0x29, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xE0, 0xFB, 0x0D, 0xEF, 0x70, 0x04, 0x74, 0xF0, 0x80, 0x16, 0xEF, 0xB4, 0x01, 0x04, 0x74, 0xF4, -0x80, 0x0E, 0xEF, 0xB4, 0x02, 0x04, 0x74, 0xF8, 0x80, 0x06, 0xEF, 0xB4, 0x03, 0x0C, 0x74, 0xFC, -0x2D, 0xF5, 0x82, 0xE4, 0x34, 0x02, 0xF5, 0x83, 0xEB, 0xF0, 0x22, 0x90, 0xA5, 0xBA, 0xEF, 0xF0, -0x90, 0x00, 0x8F, 0xE0, 0x30, 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x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xC0, 0x07, 0xC0, 0x05, -0x90, 0xA5, 0x80, 0x12, 0x4A, 0x50, 0x90, 0xAC, 0x9C, 0x12, 0x27, 0x48, 0xD0, 0x05, 0xD0, 0x07, -0x12, 0x32, 0x65, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xC0, 0xE0, 0xC0, 0xF0, 0xC0, 0x83, 0xC0, 0x82, -0xC0, 0xD0, 0x75, 0xD0, 0x00, 0xC0, 0x00, 0xC0, 0x01, 0xC0, 0x02, 0xC0, 0x03, 0xC0, 0x04, 0xC0, -0x05, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0x01, 0xC4, 0x74, 0xB8, 0xF0, 0x74, 0x67, 0xA3, 0xF0, 0x12, -0x82, 0x53, 0x74, 0xB8, 0x04, 0x90, 0x01, 0xC4, 0xF0, 0x74, 0x67, 0xA3, 0xF0, 0xD0, 0x07, 0xD0, -0x06, 0xD0, 0x05, 0xD0, 0x04, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0xD0, 0xD0, 0xD0, -0x82, 0xD0, 0x83, 0xD0, 0xF0, 0xD0, 0xE0, 0x32, 0xC0, 0xE0, 0xC0, 0xF0, 0xC0, 0x83, 0xC0, 0x82, -0xC0, 0xD0, 0x75, 0xD0, 0x00, 0xC0, 0x00, 0xC0, 0x01, 0xC0, 0x02, 0xC0, 0x03, 0xC0, 0x04, 0xC0, -0x05, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0x01, 0xC4, 0x74, 0x08, 0xF0, 0x74, 0x68, 0xA3, 0xF0, 0x11, -0x6A, 0xE5, 0x5C, 0x30, 0xE7, 0x02, 0x11, 0x5E, 0x74, 0x08, 0x04, 0x90, 0x01, 0xC4, 0xF0, 0x74, -0x68, 0xA3, 0xF0, 0xD0, 0x07, 0xD0, 0x06, 0xD0, 0x05, 0xD0, 0x04, 0xD0, 0x03, 0xD0, 0x02, 0xD0, -0x01, 0xD0, 0x00, 0xD0, 0xD0, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xF0, 0xD0, 0xE0, 0x32, 0x90, 0x00, -0x05, 0xE0, 0x44, 0x80, 0xFD, 0x7F, 0x05, 0x02, 0x3A, 0x96, 0x90, 0x00, 0x54, 0xE0, 0x55, 0x55, -0xF5, 0x59, 0xA3, 0xE0, 0x55, 0x56, 0xF5, 0x5A, 0xA3, 0xE0, 0x55, 0x57, 0xF5, 0x5B, 0xA3, 0xE0, -0x55, 0x58, 0xF5, 0x5C, 0xAD, 0x59, 0x7F, 0x54, 0x12, 0x3A, 0x96, 0xAD, 0x5A, 0x7F, 0x55, 0x12, -0x3A, 0x96, 0xAD, 0x5B, 0x7F, 0x56, 0x12, 0x3A, 0x96, 0xAD, 0x5C, 0x7F, 0x57, 0x12, 0x3A, 0x96, -0x53, 0x91, 0xEF, 0x22, 0xC0, 0xE0, 0xC0, 0xF0, 0xC0, 0x83, 0xC0, 0x82, 0xC0, 0xD0, 0x75, 0xD0, -0x00, 0xC0, 0x00, 0xC0, 0x01, 0xC0, 0x02, 0xC0, 0x03, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, -0x07, 0x90, 0x01, 0xC4, 0x74, 0xA4, 0xF0, 0x74, 0x68, 0xA3, 0xF0, 0x12, 0x82, 0x87, 0xE5, 0x61, -0x30, 0xE1, 0x02, 0x51, 0xA9, 0xE5, 0x61, 0x30, 0xE4, 0x02, 0xB1, 0x66, 0xE5, 0x61, 0x30, 0xE5, -0x03, 0x12, 0x4F, 0xB8, 0xE5, 0x63, 0x30, 0xE0, 0x02, 0x91, 0x5C, 0xE5, 0x63, 0x30, 0xE1, 0x03, -0x12, 0x5F, 0x27, 0xE5, 0x63, 0x30, 0xE2, 0x03, 0x12, 0x5E, 0xEF, 0xE5, 0x63, 0x30, 0xE3, 0x03, -0x12, 0x82, 0xC3, 0xE5, 0x63, 0x30, 0xE4, 0x03, 0x12, 0x82, 0xDF, 0xE5, 0x63, 0x30, 0xE5, 0x02, -0xB1, 0x7A, 0xE5, 0x63, 0x30, 0xE6, 0x03, 0x12, 0x83, 0x0E, 0xE5, 0x64, 0x30, 0xE1, 0x03, 0x12, -0x57, 0xED, 0xE5, 0x64, 0x30, 0xE4, 0x02, 0x71, 0x2E, 0xE5, 0x64, 0x30, 0xE5, 0x02, 0x31, 0x5D, -0xE5, 0x64, 0x30, 0xE6, 0x02, 0x51, 0x65, 0x74, 0xA4, 0x04, 0x90, 0x01, 0xC4, 0xF0, 0x74, 0x68, -0xA3, 0xF0, 0xD0, 0x07, 0xD0, 0x06, 0xD0, 0x05, 0xD0, 0x04, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, -0xD0, 0x00, 0xD0, 0xD0, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xF0, 0xD0, 0xE0, 0x32, 0xE4, 0xF5, 0x1B, -0x90, 0x04, 0x30, 0xE0, 0xB4, 0x01, 0x06, 0x90, 0x04, 0xCF, 0x74, 0x30, 0xF0, 0x74, 0x1D, 0x25, -0x1B, 0xF5, 0x82, 0xE4, 0x34, 0xA3, 0xF5, 0x83, 0xE0, 0x70, 0x02, 0x41, 0x59, 0xE5, 0x1B, 0x13, -0x13, 0x13, 0x54, 0x1F, 0xFF, 0xE5, 0x1B, 0x54, 0x07, 0xFE, 0x74, 0x01, 0x2F, 0xF5, 0x82, 0xE4, -0x34, 0x94, 0xF5, 0x83, 0xE0, 0xFD, 0xAF, 0x06, 0x74, 0x01, 0x7E, 0x00, 0xA8, 0x07, 0x08, 0x80, -0x05, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, 0xF9, 0xFF, 0xEF, 0x5D, 0x70, 0x02, 0x41, 0x59, 0x75, -0xF0, 0x10, 0xE5, 0x1B, 0x90, 0x81, 0x01, 0x12, 0x4A, 0x88, 0xE0, 0x20, 0xE7, 0x02, 0x80, 0x10, -0x75, 0xF0, 0x10, 0xE5, 0x1B, 0x90, 0x81, 0x02, 0x12, 0x4A, 0x88, 0xE0, 0xFF, 0x20, 0xE7, 0x09, -0x90, 0x01, 0xC1, 0xE0, 0x44, 0x20, 0xF0, 0x41, 0x59, 0xEF, 0x30, 0xE6, 0x23, 0x75, 0xF0, 0x10, -0xE5, 0x1B, 0x90, 0x81, 0x00, 0x12, 0x4A, 0x88, 0xE0, 0xFD, 0x75, 0xF0, 0x10, 0xE5, 0x1B, 0x90, -0x81, 0x05, 0x12, 0x4A, 0x88, 0xE0, 0x54, 0x03, 0x90, 0xA5, 0x5D, 0xF0, 0xE4, 0xFB, 0x80, 0x54, -0x74, 0xA6, 0x25, 0x1B, 0xF5, 0x82, 0xE4, 0x34, 0xA0, 0xF5, 0x83, 0xE0, 0x04, 0xF0, 0x74, 0xA6, -0x25, 0x1B, 0xF5, 0x82, 0xE4, 0x34, 0xA0, 0xF5, 0x83, 0xE0, 0xD3, 0x94, 0x03, 0x40, 0x14, 0xAF, -0x1B, 0x12, 0x93, 0xF1, 0x74, 0xA6, 0x25, 0x1B, 0xF5, 0x82, 0xE4, 0x34, 0xA0, 0xF5, 0x83, 0xE4, -0xF0, 0x80, 0x26, 0x75, 0xF0, 0x10, 0xE5, 0x1B, 0x90, 0x81, 0x00, 0x12, 0x4A, 0x88, 0xE0, 0xFD, -0x75, 0xF0, 0x10, 0xE5, 0x1B, 0x90, 0x81, 0x05, 0x12, 0x4A, 0x88, 0xE0, 0x54, 0x03, 0x90, 0xA5, -0x5D, 0xF0, 0x7B, 0x01, 0xAF, 0x1B, 0x12, 0x8C, 0xAC, 0x05, 0x1B, 0xE5, 0x1B, 0xC3, 0x94, 0x80, -0x50, 0x02, 0x21, 0x60, 0x22, 0x90, 0x07, 0x1F, 0xE0, 0x54, 0x7F, 0xF0, 0x90, 0x07, 0x1C, 0xE0, -0x54, 0x01, 0x60, 0x2F, 0x90, 0xA4, 0x35, 0xE0, 0x60, 0x29, 0x90, 0xA4, 0x32, 0xE0, 0x54, 0x03, -0x14, 0x60, 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, 0x25, 0x27, 0xF5, 0x82, 0xE4, 0x34, -0xA4, 0xF5, 0x83, 0xE4, 0xF0, 0x75, 0xF0, 0x10, 0xE5, 0x27, 0x90, 0x81, 0x03, 0x12, 0x4A, 0x88, -0xE0, 0xFF, 0x30, 0xE7, 0x0A, 0xE5, 0x27, 0x70, 0x19, 0xEF, 0x30, 0xE6, 0x15, 0x80, 0x13, 0xAF, -0x27, 0x12, 0xA5, 0xD6, 0x74, 0x3B, 0x25, 0x27, 0xF5, 0x82, 0xE4, 0x34, 0xA4, 0xF5, 0x83, 0x74, -0x01, 0xF0, 0x05, 0x27, 0xE5, 0x27, 0xC3, 0x94, 0x80, 0x40, 0xBD, 0x7F, 0x0C, 0x7E, 0x00, 0x12, -0x3A, 0xF7, 0xE4, 0xF5, 0x27, 0x74, 0x3B, 0x25, 0x27, 0xF5, 0x82, 0xE4, 0x34, 0xA4, 0xF5, 0x83, -0xE0, 0x70, 0x02, 0x81, 0x50, 0x75, 0xF0, 0x10, 0xE5, 0x27, 0x90, 0x81, 0x06, 0x12, 0x4A, 0x88, -0xE0, 0xF5, 0x25, 0x75, 0xF0, 0x10, 0xE5, 0x27, 0x90, 0x81, 0x07, 0x12, 0x4A, 0x88, 0xE0, 0xF5, -0x26, 0xFE, 0xE5, 0x25, 0xFF, 0xE5, 0x27, 0x25, 0xE0, 0x24, 0x01, 0xF5, 0x82, 0xE4, 0x34, 0x92, -0xF5, 0x83, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0x75, 0xF0, 0x10, 0xE5, 0x27, 0x90, 0x81, 0x0A, 0x12, -0x4A, 0x88, 0xE0, 0xF5, 0x25, 0x75, 0xF0, 0x10, 0xE5, 0x27, 0x90, 0x81, 0x0B, 0x12, 0x4A, 0x88, -0xE0, 0xF5, 0x26, 0xFE, 0xE5, 0x25, 0xFF, 0x75, 0xF0, 0x0A, 0xE5, 0x27, 0x90, 0x8D, 0x01, 0x12, -0x4A, 0x88, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0x7F, 0x01, 0x75, 0xF0, 0x10, 0xE5, 0x27, 0x90, 0x81, -0x0B, 0x12, 0x4A, 0x88, 0xE5, 0x82, 0x2F, 0xF5, 0x82, 0xE4, 0x35, 0x83, 0xF5, 0x83, 0xE0, 0xFD, -0x75, 0xF0, 0x0A, 0xE5, 0x27, 0x90, 0x8D, 0x01, 0x12, 0x4A, 0x88, 0x75, 0xF0, 0x02, 0xEF, 0x12, -0x4A, 0x88, 0xE4, 0xF0, 0xA3, 0xED, 0xF0, 0x0F, 0xEF, 0xB4, 0x05, 0xCD, 0x75, 0xF0, 0x10, 0xE5, -0x27, 0x90, 0x81, 0x09, 0x12, 0x4A, 0x88, 0xE0, 0xFF, 0x74, 0x16, 0x25, 0x27, 0xF5, 0x82, 0xE4, -0x34, 0x98, 0xF5, 0x83, 0xEF, 0xF0, 0x90, 0xA4, 0x3A, 0xE0, 0xFD, 0xAF, 0x27, 0x12, 0x8E, 0xDA, -0x05, 0x27, 0xE5, 0x27, 0xC3, 0x94, 0x80, 0x50, 0x02, 0x61, 0x85, 0x22, 0x12, 0xB7, 0xD6, 0x90, -0xA5, 0xC0, 0x74, 0x02, 0xF0, 0x90, 0xA3, 0xBD, 0xE0, 0x20, 0xE0, 0x02, 0xA1, 0x65, 0xE4, 0xFF, -0x12, 0x7B, 0x17, 0x90, 0xA3, 0xC1, 0xE0, 0xFF, 0x13, 0x13, 0x54, 0x3F, 0x30, 0xE0, 0x03, 0x12, -0x7B, 0x50, 0x90, 0xA3, 0xBD, 0xE0, 0xFF, 0xC4, 0x13, 0x13, 0x54, 0x03, 0x30, 0xE0, 0x08, 0x90, -0x07, 0x78, 0x74, 0x0D, 0xF0, 0x80, 0x2D, 0x90, 0xA3, 0xC0, 0xE0, 0xFE, 0xC4, 0x54, 0x0F, 0x30, -0xE0, 0x0D, 0xEE, 0x13, 0x13, 0x54, 0x3F, 0x90, 0x07, 0x78, 0x30, 0xE0, 0x0F, 0x80, 0x12, 0x90, -0xA3, 0xC0, 0xE0, 0xFE, 0xC3, 0x13, 0x90, 0x07, 0x78, 0x30, 0xE0, 0x05, 0x74, 0x03, 0xF0, 0x80, -0x03, 0x74, 0x09, 0xF0, 0xEF, 0xC4, 0x13, 0x13, 0x13, 0x54, 0x01, 0x30, 0xE0, 0x07, 0xE4, 0x90, -0xA5, 0xC1, 0xF0, 0x80, 0x06, 0x90, 0xA5, 0xC1, 0x74, 0x01, 0xF0, 0x90, 0xA3, 0xC0, 0xE0, 0xC4, -0x13, 0x54, 0x07, 0x20, 0xE0, 0x13, 0x90, 0xA3, 0xFA, 0xE0, 0x60, 0x07, 0xE4, 0x90, 0xA5, 0xC0, -0xF0, 0x80, 0x06, 0x90, 0xA5, 0xC0, 0x74, 0x01, 0xF0, 0x90, 0xA5, 0xC0, 0xE0, 0xFF, 0xA3, 0xE0, -0xFD, 0x12, 0x76, 0x2B, 0x90, 0xA3, 0xCE, 0x74, 0x01, 0xF0, 0x90, 0xA3, 0xBD, 0xE0, 0xFF, 0xC4, -0x13, 0x54, 0x07, 0x30, 0xE0, 0x07, 0x90, 0x05, 0x22, 0xE4, 0xF0, 0x80, 0x26, 0xEF, 0xC4, 0x54, -0x0F, 0x30, 0xE0, 0x1F, 0x90, 0xA3, 0xC3, 0xE0, 0x44, 0x20, 0xF0, 0x90, 0xA3, 0xB8, 0xE0, 0x60, -0x06, 0x7D, 0x01, 0x7F, 0x04, 0x80, 0x09, 0x90, 0x05, 0x22, 0xE4, 0xF0, 0x7D, 0x01, 0x7F, 0x0C, -0x12, 0x50, 0x7E, 0x90, 0xA3, 0xB8, 0xE0, 0x90, 0x05, 0x22, 0x60, 0x05, 0x74, 0x6F, 0xF0, 0x80, -0x02, 0xE4, 0xF0, 0x90, 0xA3, 0xC0, 0xE0, 0xC4, 0x13, 0x13, 0x13, 0x54, 0x01, 0x30, 0xE0, 0x05, -0x7F, 0x01, 0x12, 0x7C, 0xF9, 0x22, 0x12, 0x7E, 0x6B, 0x7F, 0x02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0xF2, 0x8E, 0x77, 0x8F, 0x78, 0x90, 0x04, 0x1F, 0x74, 0x20, 0xF0, 0x22, 0x90, -0xA5, 0x07, 0xEF, 0xF0, 0xA3, 0xED, 0xF0, 0xA3, 0xEB, 0xF0, 0x90, 0x04, 0x1D, 0xE0, 0x60, 0x1B, -0x90, 0x05, 0x22, 0xE0, 0x90, 0xA5, 0x0C, 0xF0, 0x12, 0x83, 0x58, 0xBF, 0x01, 0x03, 0x12, 0xAE, -0xA3, 0x90, 0xA5, 0x0C, 0xE0, 0x90, 0x05, 0x22, 0xF0, 0x80, 0x03, 0x12, 0xAE, 0xA3, 0x90, 0x04, -0x1F, 0x74, 0x20, 0xF0, 0x22, 0xE4, 0xFF, 0xA1, 0xB6, 0xC0, 0xE0, 0xC0, 0xF0, 0xC0, 0x83, 0xC0, -0x82, 0xC0, 0xD0, 0x75, 0xD0, 0x00, 0xC0, 0x00, 0xC0, 0x01, 0xC0, 0x02, 0xC0, 0x03, 0xC0, 0x04, -0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0x01, 0xC4, 0x74, 0xD9, 0xF0, 0x74, 0x6F, 0xA3, 0xF0, -0x31, 0xE0, 0xE5, 0x69, 0x30, 0xE0, 0x03, 0x12, 0x57, 0xE9, 0xE5, 0x69, 0x30, 0xE1, 0x02, 0x11, -0x6D, 0xE5, 0x69, 0x30, 0xE2, 0x02, 0x11, 0x76, 0xE5, 0x69, 0x30, 0xE3, 0x03, 0x12, 0x5F, 0xD5, -0xE5, 0x6A, 0x30, 0xE0, 0x02, 0x11, 0x90, 0xE5, 0x6C, 0x30, 0xE1, 0x05, 0x7F, 0x04, 0x12, 0x6D, -0x6B, 0xE5, 0x6C, 0x30, 0xE4, 0x03, 0x12, 0x5B, 0xA8, 0xE5, 0x6C, 0x30, 0xE5, 0x02, 0x11, 0xD9, -0xE5, 0x6C, 0x30, 0xE6, 0x02, 0x31, 0x74, 0x74, 0xD9, 0x04, 0x90, 0x01, 0xC4, 0xF0, 0x74, 0x6F, -0xA3, 0xF0, 0xD0, 0x07, 0xD0, 0x06, 0xD0, 0x05, 0xD0, 0x04, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, -0xD0, 0x00, 0xD0, 0xD0, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xF0, 0xD0, 0xE0, 0x32, 0x90, 0xA3, 0xA1, -0xE0, 0x60, 0x02, 0x51, 0x93, 0x22, 0x90, 0xA3, 0xA1, 0xE0, 0x60, 0x13, 0x90, 0x06, 0x92, 0xE0, -0x30, 0xE1, 0x02, 0x41, 0x10, 0x90, 0xA3, 0x9E, 0xE0, 0x54, 0xF7, 0xF0, 0x12, 0x50, 0x6E, 0x22, -0x51, 0x4C, 0x90, 0xA5, 0x04, 0xEF, 0xF0, 0x90, 0xA3, 0x9E, 0x30, 0xE0, 0x06, 0xE0, 0x44, 0x01, -0xF0, 0x80, 0x04, 0xE0, 0x54, 0xFE, 0xF0, 0x90, 0xA5, 0x04, 0xE0, 0x30, 0xE6, 0x11, 0x90, 0x01, -0x2F, 0xE0, 0x30, 0xE7, 0x04, 0xE4, 0xF0, 0x80, 0x06, 0x90, 0x01, 0x2F, 0x74, 0x80, 0xF0, 0x90, -0xA3, 0x9E, 0xE0, 0x30, 0xE0, 0x12, 0x90, 0xA3, 0xAC, 0xE4, 0xF0, 0xA3, 0x74, 0x04, 0xF0, 0x90, -0xA3, 0xAC, 0xA3, 0xE0, 0x90, 0x05, 0x58, 0xF0, 0x22, 0x90, 0xA3, 0x9E, 0xE0, 0xFF, 0xC4, 0x13, -0x13, 0x54, 0x03, 0x30, 0xE0, 0x3C, 0xEF, 0x54, 0xBF, 0xF0, 0x90, 0x04, 0xE0, 0xE0, 0x90, 0xA3, -0x9F, 0x30, 0xE0, 0x06, 0xE0, 0x44, 0x01, 0xF0, 0x80, 0x10, 0xE0, 0x54, 0xFE, 0xF0, 0x90, 0x01, -0xB9, 0x74, 0x01, 0xF0, 0x90, 0x01, 0xB8, 0x74, 0x04, 0xF0, 0x90, 0xA3, 0xC3, 0xE0, 0xFF, 0xC4, -0x13, 0x54, 0x07, 0x30, 0xE0, 0x09, 0x7D, 0x01, 0x7F, 0x0C, 0x12, 0x50, 0x7E, 0x80, 0x03, 0x12, -0x50, 0x6E, 0xE4, 0xFF, 0x90, 0xA4, 0x08, 0xE0, 0x30, 0xE0, 0x48, 0x90, 0xA4, 0x0C, 0xE0, 0xFD, -0x60, 0x41, 0x74, 0x01, 0x7E, 0x00, 0xA8, 0x07, 0x08, 0x80, 0x05, 0xC3, 0x33, 0xCE, 0x33, 0xCE, -0xD8, 0xF9, 0xFF, 0x90, 0x04, 0xE0, 0xE0, 0xFB, 0xEF, 0x5B, 0x60, 0x06, 0xE4, 0x90, 0xA4, 0x0C, -0xF0, 0x22, 0x90, 0xA4, 0x0A, 0xE0, 0xD3, 0x9D, 0x50, 0x10, 0x90, 0x01, 0xC7, 0x74, 0x10, 0xF0, -0x31, 0xD0, 0x90, 0xA4, 0x08, 0xE0, 0x54, 0xFE, 0xF0, 0x22, 0x12, 0x6F, 0xD5, 0x90, 0xA4, 0x0C, -0xE0, 0x04, 0xF0, 0x22, 0x90, 0xA3, 0x9E, 0xE0, 0xFF, 0xC4, 0x13, 0x13, 0x13, 0x54, 0x01, 0x30, -0xE0, 0x4A, 0xEF, 0x54, 0x7F, 0xF0, 0x90, 0x04, 0xE0, 0xE0, 0x90, 0xA3, 0x9F, 0x30, 0xE1, 0x06, -0xE0, 0x44, 0x02, 0xF0, 0x80, 0x0F, 0xE0, 0x54, 0xFD, 0xF0, 0x90, 0x01, 0xB9, 0x74, 0x01, 0xF0, -0x90, 0x01, 0xB8, 0x04, 0xF0, 0x90, 0xA3, 0xC1, 0xE0, 0xFF, 0xC4, 0x13, 0x13, 0x54, 0x03, 0x30, -0xE0, 0x11, 0x90, 0xA3, 0xC4, 0xE0, 0xFF, 0xC3, 0x13, 0x30, 0xE0, 0x07, 0xEF, 0x44, 0x04, 0xF0, -0x54, 0xFD, 0xF0, 0x90, 0xA3, 0xA1, 0xE0, 0x60, 0x03, 0x12, 0x50, 0x6E, 0x7F, 0x01, 0x21, 0x24, -0x90, 0xA2, 0x2A, 0xE0, 0x64, 0x02, 0x60, 0x07, 0x90, 0x06, 0x90, 0xE0, 0x44, 0x01, 0xF0, 0x22, -0x90, 0x01, 0x3C, 0xE0, 0x55, 0x65, 0xF5, 0x69, 0xA3, 0xE0, 0x55, 0x66, 0xF5, 0x6A, 0xA3, 0xE0, -0x55, 0x67, 0xF5, 0x6B, 0xA3, 0xE0, 0x55, 0x68, 0xF5, 0x6C, 0x90, 0x01, 0x3C, 0xE5, 0x69, 0xF0, -0xA3, 0xE5, 0x6A, 0xF0, 0xA3, 0xE5, 0x6B, 0xF0, 0xA3, 0xE5, 0x6C, 0xF0, 0x53, 0x91, 0xDF, 0x22, -0x90, 0xA3, 0x9E, 0xE0, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x30, 0xE0, 0x05, 0x90, 0x01, 0x5B, 0xE4, -0xF0, 0x90, 0x06, 0x92, 0x74, 0x02, 0xF0, 0x90, 0x01, 0x3C, 0x74, 0x04, 0xF0, 0xE4, 0xF5, 0x23, -0x90, 0xA3, 0xB4, 0xE0, 0xC3, 0x13, 0x54, 0x7F, 0xF5, 0x24, 0xE4, 0xFB, 0xFD, 0x7F, 0x58, 0x7E, -0x01, 0x12, 0x5D, 0x96, 0x90, 0xA3, 0x9E, 0xE0, 0x44, 0x08, 0xF0, 0x22, 0xE4, 0x90, 0xA5, 0x05, -0xF0, 0xA3, 0xF0, 0xA3, 0xF0, 0x90, 0x00, 0x83, 0xE0, 0x90, 0xA5, 0x05, 0xF0, 0x90, 0x00, 0x83, -0xE0, 0xFE, 0x90, 0xA5, 0x05, 0xE0, 0xFF, 0xB5, 0x06, 0x01, 0x22, 0xC3, 0x90, 0xA5, 0x07, 0xE0, -0x94, 0x64, 0x90, 0xA5, 0x06, 0xE0, 0x94, 0x00, 0x40, 0x0D, 0x90,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0xC5, 0xE0, 0xFE, 0xEF, 0x4E, 0x90, 0xA2, 0x27, 0xF0, 0x22, 0x90, 0x02, 0x09, -0xE0, 0xFD, 0x12, 0x26, 0x1E, 0xFE, 0xAF, 0x05, 0xED, 0x2E, 0x90, 0xA2, 0x2B, 0xF0, 0x90, 0x00, -0x01, 0x12, 0x26, 0x37, 0xFF, 0xED, 0x2F, 0x90, 0xA2, 0x2C, 0xF0, 0x90, 0x00, 0x02, 0x12, 0x26, -0x37, 0xFF, 0xED, 0x2F, 0x90, 0xA2, 0x2D, 0xF0, 0x90, 0x00, 0x03, 0x12, 0x26, 0x37, 0xFF, 0xED, -0x2F, 0x90, 0xA2, 0x2E, 0xF0, 0x90, 0x00, 0x04, 0x12, 0x26, 0x37, 0xFF, 0xAE, 0x05, 0xED, 0x2F, -0x90, 0xA2, 0x2F, 0xF0, 0x22, 0x90, 0xA4, 0xCC, 0x12, 0x4A, 0x9D, 0x90, 0x00, 0x01, 0x12, 0x26, -0x37, 0xFF, 0xFE, 0x12, 0x26, 0x1E, 0xFD, 0xC3, 0x13, 0x30, 0xE0, 0x12, 0x90, 0xA4, 0xCC, 0x12, -0x4A, 0x94, 0x90, 0x00, 0x02, 0x12, 0x26, 0x37, 0x90, 0xA4, 0xD0, 0xF0, 0x80, 0x05, 0x90, 0xA4, -0xD0, 0xEF, 0xF0, 0x90, 0xA4, 0xCF, 0xEE, 0xF0, 0x90, 0xA4, 0xD0, 0xE0, 0xFE, 0x90, 0xA4, 0xCF, -0xE0, 0xFF, 0xD3, 0x9E, 0x50, 0x38, 0x90, 0xA4, 0xCC, 0x12, 0x4A, 0x94, 0x12, 0x26, 0x1E, 0x54, -0x01, 0xFE, 0x74, 0x1D, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0xA3, 0xF5, 0x83, 0xEE, 0xF0, 0x74, 0x1D, -0x2F, 0xF5, 0x82, 0xE4, 0x34, 0xA3, 0xF5, 0x83, 0xE0, 0x70, 0x04, 0x91, 0x37, 0x80, 0x07, 0x90, -0xA4, 0xCF, 0xE0, 0xFF, 0x91, 0x26, 0x90, 0xA4, 0xCF, 0xE0, 0x04, 0xF0, 0x80, 0xBA, 0x90, 0xA3, -0x1D, 0xE0, 0x70, 0x21, 0x90, 0xA3, 0xA4, 0xE0, 0x70, 0x04, 0xFF, 0x12, 0x57, 0x1A, 0x90, 0xA3, -0xA4, 0xE0, 0x64, 0x0C, 0x60, 0x02, 0x91, 0x48, 0x90, 0xA3, 0x9E, 0xE0, 0x54, 0xF7, 0xF0, 0x54, -0xBF, 0xF0, 0x54, 0x7F, 0xF0, 0x22, 0x8F, 0x0F, 0x75, 0xF0, 0x10, 0xEF, 0x90, 0x81, 0x05, 0x12, -0x4A, 0x88, 0xE0, 0x54, 0xFB, 0xF0, 0x22, 0x8F, 0x0F, 0x75, 0xF0, 0x10, 0xEF, 0x90, 0x81, 0x05, -0x12, 0x4A, 0x88, 0xE0, 0x44, 0x04, 0xF0, 0x22, 0x90, 0x06, 0x04, 0xE0, 0x54, 0x7F, 0xF0, 0x90, -0x05, 0x22, 0xE4, 0xF0, 0x90, 0xA3, 0xA4, 0x74, 0x0C, 0xF0, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, -0xC0, 0xD0, 0x12, 0x26, 0x1E, 0xFF, 0x90, 0xA3, 0x9D, 0xF0, 0xBF, 0x01, 0x12, 0x90, 0x00, 0x01, -0x12, 0x26, 0x37, 0x64, 0x01, 0x60, 0x17, 0x90, 0x05, 0x22, 0x74, 0x6F, 0xF0, 0x80, 0x0F, 0x90, -0x00, 0x01, 0x12, 0x26, 0x37, 0x64, 0x01, 0x60, 0x05, 0x90, 0x05, 0x22, 0xE4, 0xF0, 0xD0, 0xD0, -0x92, 0xAF, 0x22, 0x90, 0xA4, 0xCC, 0x12, 0x4A, 0x9D, 0x12, 0x26, 0x1E, 0xFF, 0x54, 0x7F, 0x90, -0xA3, 0xA1, 0xF0, 0xEF, 0xC4, 0x13, 0x13, 0x13, 0x54, 0x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3, 0x9F, 0xE0, 0x44, 0x08, 0xF0, -0x22, 0x90, 0xA5, 0x05, 0xE0, 0xFF, 0x90, 0xA5, 0x04, 0xE0, 0xFD, 0xD3, 0x10, 0xAF, 0x01, 0xC3, -0xC0, 0xD0, 0x90, 0xA5, 0x67, 0xED, 0xF0, 0x90, 0xA5, 0x66, 0xEF, 0xF0, 0x64, 0x02, 0x60, 0x43, -0x7F, 0xB4, 0x7E, 0x0C, 0x12, 0x36, 0xCE, 0xEC, 0x54, 0xF3, 0xFC, 0x90, 0xA5, 0x68, 0x12, 0x27, -0x48, 0x90, 0xA5, 0x66, 0xE0, 0x90, 0xA5, 0x68, 0xB4, 0x01, 0x08, 0x12, 0x4A, 0x50, 0xEC, 0x44, -0x08, 0x80, 0x06, 0x12, 0x4A, 0x50, 0xEC, 0x44, 0x04, 0xFC, 0x90, 0xA5, 0x68, 0x12, 0x27, 0x48, -0x90, 0xA5, 0x68, 0x12, 0x4A, 0x50, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0x7F, 0xB4, 0x7E, 0x0C, -0x12, 0x37, 0x5D, 0x90, 0xA5, 0x67, 0xE0, 0x64, 0x02, 0x70, 0x02, 0xE1, 0x17, 0x7F, 0xB0, 0x7E, -0x0C, 0x12, 0x36, 0xCE, 0xE4, 0xFC, 0x90, 0xA5, 0x68, 0x12, 0x27, 0x48, 0x90, 0xA5, 0x67, 0xE0, -0x70, 0x10, 0xA3, 0x12, 0x4A, 0x50, 0xEC, 0x44, 0x77, 0xFC, 0x90, 0xA5, 0x68, 0x12, 0x27, 0x48, -0x80, 0x52, 0x90, 0xA5, 0x68, 0x12, 0x4A, 0x50, 0xEC, 0x44, 0x66, 0xFC, 0x90, 0xA5, 0x68, 0x12, -0x27, 0x48, 0x7F, 0xB4, 0x7E, 0x0C, 0x12, 0x36, 0xCE, 0xEC, 0x54, 0xF3, 0xFC, 0x90, 0xA5, 0x6C, -0x12, 0x27, 0x48, 0x90, 0xA3, 0xFA, 0xE0, 0x90, 0xA5, 0x6C, 0x60, 0x08, 0x12, 0x4A, 0x50, 0xEC, -0x44, 0x04, 0x80, 0x06, 0x12, 0x4A, 0x50, 0xEC, 0x44, 0x08, 0xFC, 0x90, 0xA5, 0x6C, 0x12, 0x27, -0x48, 0x90, 0xA5, 0x6C, 0x12, 0x4A, 0x50, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0x7F, 0xB4, 0x7E, -0x0C, 0x12, 0x37, 0x5D, 0x90, 0xA5, 0x68, 0x12, 0x4A, 0x50, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, -0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0x00, 0x02, 0x12, -0x26, 0x37, 0xFF, 0x30, 0xE0, 0x26, 0x12, 0x26, 0x1E, 0x90, 0xA3, 0xB2, 0xF0, 0x90, 0x00, 0x01, -0x12, 0x26, 0x37, 0x90, 0xA3, 0xB3, 0xF0, 0xEF, 0x54, 0xFE, 0xFF, 0xA3, 0xE0, 0x54, 0x01, 0x4F, -0xF0, 0x90, 0x00, 0x03, 0x12, 0x26, 0x37, 0x90, 0xA3, 0xB5, 0xF0, 0x22, 0x90, 0xA3, 0xB2, 0x74, -0x01, 0xF0, 0xA3, 0x74, 0x05, 0xF0, 0xA3, 0xE0, 0x54, 0x01, 0x44, 0x28, 0xF0, 0xA3, 0x74, 0x05, -0xF0, 0x22, 0x12, 0x26, 0x1E, 0x90, 0xA3, 0xB8, 0xF0, 0x60, 0x37, 0x90, 0xA3, 0xBD, 0xE0, 0x20, -0xE0, 0x30, 0xE4, 0xFD, 0x7F, 0x04, 0x12, 0x50, 0x7E, 0x90, 0xA3, 0xB7, 0xE0, 0xFF, 0xC3, 0x13, -0x30, 0xE0, 0x1F, 0xEF, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x20, 0xE0, 0x16, 0x90, 0xA3, 0xB7, 0xE0, -0x13, 0x13, 0x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0xEF, 0x4E, 0xFF, 0xF0, 0x90, 0x00, -0x03, 0x12, 0x26, 0x37, 0xFE, 0x54, 0x20, 0xFD, 0xEF, 0x54, 0xDF, 0x4D, 0xFF, 0x90, 0xA3, 0xC0, -0xF0, 0xEE, 0x54, 0x40, 0xFE, 0xEF, 0x54, 0xBF, 0x4E, 0xFF, 0xF0, 0x90, 0x00, 0x03, 0x12, 0x26, -0x37, 0x54, 0x80, 0xFE, 0xEF, 0x54, 0x7F, 0x4E, 0x90, 0xA3, 0xC0, 0xF0, 0x90, 0x00, 0x04, 0x12, -0x26, 0x37, 0xFF, 0x54, 0x20, 0xFE, 0x90, 0xA3, 0xC1, 0xE0, 0x54, 0xDF, 0x4E, 0xFE, 0xF0, 0xEF, -0x54, 0x40, 0xFF, 0xEE, 0x54, 0xBF, 0x4F, 0xFF, 0xF0, 0x90, 0x00, 0x04, 0x12, 0x26, 0x37, 0xFE, -0x54, 0x80, 0xFD, 0xEF, 0x54, 0x7F, 0x4D, 0xFF, 0x90, 0xA3, 0xC1, 0xF0, 0xEE, 0x54, 0x04, 0xFE, -0xEF, 0x54, 0xFB, 0x4E, 0xFF, 0xF0, 0x90, 0x00, 0x04, 0x12, 0x26, 0x37, 0xFE, 0x54, 0x02, 0xFD, -0xEF, 0x54, 0xFD, 0x4D, 0xFF, 0x90, 0xA3, 0xC1, 0xF0, 0xEE, 0x54, 0x10, 0xFE, 0xEF, 0x54, 0xEF, -0x4E, 0xFF, 0xF0, 0x90, 0x00, 0x04, 0x12, 0x26, 0x37, 0x54, 0x08, 0xFE, 0xEF, 0x54, 0xF7, 0x4E, -0x90, 0xA3, 0xC1, 0xF0, 0xE0, 0xFF, 0x13, 0x13, 0x54, 0x3F, 0x20, 0xE0, 0x07, 0x71, 0x50, 0x90, -0x05, 0x22, 0xE4, 0xF0, 0x90, 0xA4, 0xCE, 0x12, 0x4A, 0x94, 0x12, 0x26, 0x1E, 0x20, 0xE0, 0x02, -0x41, 0x6A, 0x90, 0x05, 0x54, 0xE0, 0xC3, 0x13, 0x90, 0xA3, 0xCD, 0xF0, 0x90, 0xA3, 0xC0, 0xE0, -0xC4, 0x54, 0x0F, 0x30, 0xE0, 0x16, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0x90, 0xA3, 0xBE, 0xF0, -0x90, 0x00, 0x02, 0x12, 0x26, 0x37, 0x90, 0xA3, 0xBF, 0xF0, 0x80, 0x48, 0x90, 0x00, 0x01, 0x12, -0x26, 0x37, 0xFF, 0xC3, 0x94, 0x2A, 0x50, 0x12, 0xEF, 0xC3, 0x94, 0x03, 0x90, 0xA3, 0xBE, 0x50, -0x05, 0x74, 0x03, 0xF0, 0x80, 0x0A, 0xEF, 0xF0, 0x80, 0x06, 0x90, 0xA3, 0xBE, 0x74, 0x2A, 0xF0, -0x90, 0x00, 0x02, 0x12, 0x26, 0x37, 0xFF, 0xC3, 0x94, 0x2A, 0x50, 0x12, 0xEF, 0xC3, 0x94, 0x03, -0x90, 0xA3, 0xBF, 0x50, 0x05, 0x74, 0x03, 0xF0, 0x80, 0x0A, 0xEF, 0xF0, 0x80, 0x06, 0x90, 0xA3, -0xBF, 0x74, 0x2A, 0xF0, 0x90, 0xA3, 0xC1, 0xE0, 0xC4, 0x13, 0x13, 0x54, 0x03, 0x30, 0xE0, 0x3D, -0x90, 0xA3, 0xBE, 0xE0, 0x75, 0xF0, 0x03, 0x84, 0x90, 0xA3, 0xC6, 0xF0, 0xE0, 0xC3, 0x13, 0xA3, -0xF0, 0x90, 0xA3, 0xBF, 0xE0, 0x75, 0xF0, 0x03, 0x84, 0x90, 0xA3, 0xC8, 0xF0, 0x90, 0xA3, 0xBE, -0xE0, 0xC3, 0x13, 0x90, 0xA3, 0xC9, 0xF0, 0x90, 0xA3, 0xBF, 0xE0, 0xC3, 0x13, 0x90, 0xA3, 0xCA, -0xF0, 0x90, 0x01, 0x3E, 0x74, 0x08, 0xF0, 0xFD, 0x7F, 0x02, 0x12, 0x5F, 0xC0, 0xE4, 0x90, 0xA3, -0xF8, 0xF0, 0x90, 0xA4, 0xCE, 0x12, 0x4A, 0x94, 0x90, 0x00, 0x03, 0x12, 0x26, 0x37, 0xC4, 0x13, -0x13, 0x54, 0x03, 0x20, 0xE0, 0x30, 0x12, 0x26, 0x1E, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x30, 0xE0, -0x08, 0x90, 0xA3, 0xFA, 0xE0, 0x60, 0x08, 0x80, 0x0E, 0x90, 0xA3, 0xFA, 0xE0, 0x60, 0x08, 0x90, -0xA4, 0xCC, 0x74, 0x01, 0xF0, 0x80, 0x05, 0xE4, 0x90, 0xA4, 0xCC, 0xF0, 0x90, 0xA4, 0xCC, 0xE0, -0xFF, 0x7D, 0x02, 0x12, 0x76, 0x2B, 0x90, 0xA3, 0xBD, 0xE0, 0xC4, 0x54, 0x0F, 0x30, 0xE0, 0x1B, -0x90, 0xA3, 0xC1, 0xE0, 0xC4, 0x13, 0x54, 0x07, 0x30, 0xE0, 0x06, 0x90, 0xA3, 0xA3, 0x74, 0x04, -0xF0, 0x90, 0x05, 0x00, 0x74, 0x1C, 0xF0, 0xA3, 0x74, 0x11, 0xF0, 0x90, 0x05, 0x58, 0x74, 0x02, -0xF0, 0x90, 0xA3, 0xC5, 0xE0, 0xFF, 0xB4, 0x01, 0x08, 0x90, 0xA3, 0xCF, 0x74, 0x01, 0xF0, 0x80, -0x22, 0xEF, 0xB4, 0x04, 0x08, 0x90, 0xA3, 0xCF, 0x74, 0x04, 0xF0, 0x80, 0x16, 0xEF, 0xB4, 0x06, -0x08, 0x90, 0xA3, 0xCF, 0x74, 0x02, 0xF0, 0x80, 0x0A, 0xEF, 0xB4, 0x07, 0x06, 0x90, 0xA3, 0xCF, -0x74, 0x05, 0xF0, 0xE4, 0x90, 0xA3, 0xC5, 0xF0, 0x80, 0x77, 0x90, 0xA4, 0xCE, 0x12, 0x4A, 0x94, -0x90, 0x00, 0x03, 0x12, 0x26, 0x37, 0xFF, 0xC4, 0x13, 0x13, 0x54, 0x03, 0x30, 0xE0, 0x08, 0x90, -0xA4, 0xCD, 0x74, 0x02, 0xF0, 0x80, 0x19, 0x12, 0x26, 0x1E, 0xFF, 0x13, 0x13, 0x13, 0x54, 0x1F, -0x30, 0xE0, 0x08, 0x90, 0xA4, 0xCD, 0x74, 0x01, 0xF0, 0x80, 0x05, 0xE4, 0x90, 0xA4, 0xCD, 0xF0, -0xB1, 0x9D, 0x7D, 0x20, 0x7F, 0x40, 0x12, 0x3A, 0x96, 0x90, 0xA4, 0xCE, 0x12, 0x4A, 0x94, 0x90, -0x00, 0x03, 0x12, 0x26, 0x37, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x90, 0x07, 0x78, 0x30, 0xE0, 0x05, -0x74, 0x03, 0xF0, 0x80, 0x03, 0x74, 0x01, 0xF0, 0x90, 0xA4, 0xCD, 0xE0, 0xFD, 0x7F, 0x02, 0x12, -0x76, 0x2B, 0x90, 0x05, 0x22, 0xE4, 0xF0, 0x90, 0x05, 0x00, 0x74, 0x1C, 0xF0, 0xA3, 0x74, 0x43, -0xF0, 0x90, 0xA3, 0xC3, 0xE0, 0x54, 0xDF, 0xF0, 0xE4, 0x90, 0xA3, 0xCE, 0xF0, 0x90, 0xA3, 0xC0, -0xE0, 0xC4, 0x13, 0x13, 0x13, 0x54, 0x01, 0x30, 0xE0, 0x09, 0x90, 0xA3, 0xEB, 0xE0, 0x44, 0x02, -0xF0, 0x80, 0x0B, 0x7F, 0x01, 0x91, 0xF9, 0x90, 0xA3, 0xEB, 0xE0, 0x54, 0xFD, 0xF0, 0x7F, 0x03, -0x71, 0x17, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xEF, 0xB4, -0x03, 0x13, 0x90, 0xA3, 0xC0, 0xE0, 0xC4, 0x13, 0x13, 0x54, 0x03, 0x90, 0x06, 0xCC, 0x30, 0xE0, -0x17, 0xE4, 0xF0, 0x80, 0x16, 0x90, 0xA3, 0xC1, 0xE0, 0xC4, 0x54, 0x0F, 0x30, 0xE0, 0x0C, 0xEF, -0x90, 0x06, 0xCC, 0x70, 0x03, 0xF0, 0x80, 0x03, 0x74, 0x03, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, -0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0xA3, 0xAE, 0x12, 0x4A, 0x50, 0x90, 0xAC, 0xB9, -0x12, 0x27, 0x48, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0xA3, 0xAE, 0x12, 0x4A, 0x50, -0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0x7F, 0xB0, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0x00, 0x10, -0xE0, 0x44, 0x0C, 0xFD, 0x7F, 0x10, 0x12, 0x3A, 0x96, 0x90, 0x00, 0x72, 0xE0, 0x54, 0xF3, 0xFD, -0x7F, 0x72, 0x12, 0x3A, 0x96, 0x90, 0x01, 0x01, 0xE0, 0x44, 0x02, 0xF0, 0x90, 0x01, 0x00, 0x74, -0xFF, 0xF0, 0x90, 0xA3, 0xB7, 0xE0, 0xFF, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x30, 0xE0, 0x06, 0x90, -0x07, 0x78, 0x74, 0x03, 0xF0, 0x90, 0xA3, 0xD7, 0xE0, 0x20, 0xE0, 0x3A, 0xEF, 0xC3, 0x13, 0x30, -0xE0, 0x34, 0x90, 0xA3, 0xFA, 0xE0, 0x60, 0x07, 0xE4, 0x90, 0xA5, 0x74, 0xF0, 0x80, 0x06, 0x90, -0xA5, 0x74, 0x74, 0x01, 0xF0, 0x90, 0xA3, 0xB7, 0xE0, 0xC4, 0x13, 0x54, 0x07, 0x90, 0xA5, 0x75, -0x30, 0xE0, 0x05, 0x74, 0x01, 0xF0, 0x80, 0x03, 0x74, 0x02, 0xF0, 0x90, 0xA5, 0x74, 0xE0, 0xFF, -0xA3, 0xE0, 0xFD, 0x12, 0x76, 0x2B, 0x90, 0x06, 0xB7, 0x74, 0x09, 0xF0, 0x90, 0x06, 0xB4, 0x74, -0x86, 0xF0, 0x7F, 0xB4, 0x7E, 0x08, 0x12, 0x36, 0xCE, 0xEF, 0x54, 0xBF, 0xFF, 0xEC, 0x90, 0xA5, -0x70, 0x12, 0x27, 0x48, 0x90, 0xA5, 0x70, 0x12, 0x4A, 0x50, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, -0x7F, 0xB4, 0x7E, 0x08, 0x12, 0x37, 0x5D, 0x90, 0x00, 0x02, 0xE0, 0x44, 0x01, 0xFD, 0x7F, 0x02, -0x12, 0x3A, 0x96, 0x7F, 0x00, 0x7E, 0x0C, 0x12, 0x36, 0xCE, 0xEF, 0x44, 0x03, 0xFF, 0xEC, 0x90, -0xA5, 0x70, 0x12, 0x27, 0x48, 0x90, 0xA5, 0x70, 0x12, 0x4A, 0x50, 0x90, 0xAC, 0xB9, 0x12, 0x27, -0x48, 0x7F, 0x00, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x7F, 0x00, 0x7E, 0x0E, 0x12, 0x36, 0xCE, 0xEF, -0x44, 0x03, 0xFF, 0xEC, 0x90, 0xA5, 0x70, 0x12, 0x27, 0x48, 0x90, 0xA5, 0x70, 0x12, 0x4A, 0x50, -0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0x7F, 0x00, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0x00, 0xFF, -0xE0, 0x70, 0x1A, 0x91, 0xA2, 0x90, 0xA5, 0x76, 0xE0, 0x54, 0xE7, 0xB1, 0x46, 0x91, 0xA2, 0x90, -0xA5, 0x76, 0xE0, 0x54, 0x18, 0x70, 0x06, 0x90, 0x01, 0xBF, 0xE0, 0x04, 0xF0, 0xD0, 0xD0, 0x92, -0xAF, 0x22, 0x7B, 0x01, 0x7A, 0xA5, 0x79, 0x76, 0x7D, 0x08, 0x7F, 0x01, 0x90, 0xA5, 0xA2, 0x12, -0x4A, 0x9D, 0xEF, 0x70, 0x07, 0x90, 0xA5, 0xA5, 0x04, 0xF0, 0x80, 0x0B, 0xEF, 0x64, 0x01, 0x70, -0x2E, 0x90, 0xA5, 0xA5, 0x74, 0x40, 0xF0, 0x7F, 0xE2, 0x12, 0x3A, 0x96, 0x90, 0xA5, 0xA5, 0xE0, -0xFD, 0x7F, 0xE3, 0x12, 0x3A, 0x96, 0x90, 0x00, 0xE1, 0xE0, 0xFF, 0x90, 0xA5, 0xA2, 0x12, 0x4A, -0x94, 0xEF, 0x12, 0x26, 0x64, 0xE4, 0xFD, 0x7F, 0xE3, 0x12, 0x3A, 0x96, 0x7F, 0x01, 0x22, 0x90, -0x01, 0xC2, 0xE0, 0x44, 0x01, 0xF0, 0x7F, 0x00, 0x22, 0x90, 0xA3, 0xEB, 0xE0, 0xFE, 0xC3, 0x13, -0x30, 0xE0, 0x42, 0xEF, 0xB4, 0x01, 0x18, 0x90, 0xA3, 0xF2, 0x12, 0x4A, 0x50, 0x90, 0xAC, 0xB9, -0x12, 0x27, 0x48, 0x7F, 0x58, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0xA3, 0xF2, 0x80, 0x16, 0x90, -0xA3, 0xEE, 0x12, 0x4A, 0x50, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0x7F, 0x58, 0x7E, 0x0C, 0x12, -0x37, 0x5D, 0x90, 0xA3, 0xEE, 0x12, 0x4A, 0x50, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0x7F, 0x58, -0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x22, 0xFB, 0x7D, 0x08, 0x7F, 0x01, 0x90, 0xA5, 0xB2, 0xEB, 0xF0, -0xEF, 0x70, 0x06, 0xA3, 0x74, 0x03, 0xF0, 0x80, 0x0B, 0xEF, 0x64, 0x01, 0x70, 0x35, 0x90, 0xA5, -0xB3, 0x74, 0x42, 0xF0, 0x7F, 0xE2, 0x12, 0x3A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 0x12, 0x26, 0x1E, -0xFF, 0xE4, 0xFC, 0xFD, 0xFE, 0x90, 0xA4, 0xCF, 0x12, 0x27, 0x48, 0x90, 0xA3, 0xF2, 0x12, 0x4A, -0x50, 0xEC, 0x54, 0xC1, 0xFC, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xA4, 0xCF, -0x12, 0x4A, 0x50, 0x78, 0x19, 0x12, 0x27, 0x35, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, -0x12, 0x4A, 0x32, 0x90, 0xA3, 0xEE, 0x02, 0x27, 0x48, 0x12, 0x26, 0x1E, 0x90, 0xA3, 0xFA, 0xF0, -0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0x90, 0xA3, 0xFB, 0xF0, 0x22, 0x90, 0x01, 0xCC, 0xE0, 0x54, -0x0F, 0x90, 0xA5, 0xAC, 0xF0, 0x90, 0xA5, 0xAC, 0xE0, 0xFD, 0x70, 0x02, 0xE1, 0xA8, 0x90, 0xA2, -0x80, 0xE0, 0xFF, 0x70, 0x06, 0xA3, 0xE0, 0x64, 0x09, 0x60, 0x0A, 0xEF, 0x14, 0xFF, 0x90, 0xA2, -0x81, 0xE0, 0xB5, 0x07, 0x04, 0x7F, 0x01, 0x80, 0x02, 0x7F, 0x00, 0xEF, 0x60, 0x08, 0x90, 0x01, -0xC1, 0xE0, 0x44, 0x01, 0xF0, 0x22, 0x90, 0xA5, 0x8F, 0xE0, 0xFF, 0x74, 0x01, 0x7E, 0x00, 0xA8, -0x07, 0x08, 0x80, 0x05, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, 0xF9, 0xFF, 0xEF, 0x5D, 0x70, 0x02, -0xE1, 0x97, 0xE4, 0x90, 0xA5, 0xAD, 0xF0, 0x90, 0xA5, 0xAD, 0xE0, 0xF9, 0xC3, 0x94, 0x04, 0x50, -0x73, 0x90, 0xA5, 0x8F, 0xE0, 0x75, 0xF0, 0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, 0x0D, 0xE4, 0xFF, 0x31, 0x43, 0x75, 0xF0, 0x04, +0xE5, 0x72, 0x22, 0xFF, 0x74, 0x11, 0x25, 0x0D, 0xF5, 0x82, 0xE4, 0x34, 0x9A, 0xF5, 0x83, 0xE0, +0x22, 0xAC, 0x07, 0x75, 0xF0, 0x04, 0xEC, 0x90, 0x96, 0x14, 0x12, 0x4A, 0x2A, 0x75, 0xF0, 0x04, +0xEC, 0x12, 0x6F, 0xF9, 0xE0, 0xFA, 0x74, 0x75, 0x2C, 0x91, 0x84, 0xE0, 0x54, 0x7F, 0xFD, 0x75, +0xF0, 0x04, 0xEC, 0x12, 0x76, 0x92, 0xE0, 0xFF, 0x54, 0xF8, 0xFE, 0xEF, 0x04, 0x54, 0x07, 0x4E, +0xF0, 0x75, 0xF0, 0x04, 0xEC, 0x12, 0x76, 0x92, 0xE0, 0xFF, 0x54, 0x07, 0xD3, 0x94, 0x02, 0x40, +0x45, 0x74, 0xA1, 0x2C, 0x51, 0x4C, 0xE0, 0xF4, 0x70, 0x3C, 0x75, 0xF0, 0x04, 0xEC, 0x12, 0x76, +0x92, 0xEF, 0x54, 0xF8, 0xF0, 0x74, 0x11, 0x2C, 0x31, 0x88, 0x54, 0x7F, 0xFF, 0x75, 0xF0, 0x04, +0xEC, 0x12, 0x77, 0x60, 0x54, 0x80, 0x4F, 0xF0, 0x74, 0x11, 0x2C, 0x31, 0x88, 0x25, 0xE0, 0xFF, +0xE4, 0x33, 0xFE, 0xEF, 0x24, 0x32, 0xFF, 0xE4, 0x3E, 0xFE, 0x75, 0xF0, 0x04, 0xEC, 0x12, 0x76, +0x9D, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0x74, 0x21, 0x2C, 0x12, 0xB3, 0xB9, 0xE0, 0xFB, 0x12, 0xB4, +0x11, 0xFF, 0x75, 0xF0, 0x04, 0xEC, 0x12, 0x4F, 0x3D, 0x54, 0xF3, 0x4F, 0xF0, 0xED, 0xD3, 0x9A, +0x40, 0x02,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40, +0x0B, 0xE5, 0x6F, 0x54, 0x80, 0xFD, 0xEF, 0x4D, 0xF5, 0x6F, 0x80, 0x0C, 0x90, 0xA4, 0x07, 0xE0, +0xFF, 0xEE, 0xC3, 0x9F, 0x50, 0x02, 0x8F, 0x6F, 0x12, 0xB4, 0x4E, 0xE5, 0x6F, 0x54, 0x80, 0x90, +0xA4, 0x04, 0xF0, 0xEB, 0x70, 0x26, 0x90, 0x04, 0xCF, 0x74, 0x30, 0xF0, 0x12, 0xB3, 0x50, 0xC0, +0x83, 0xC0, 0x82, 0x12, 0x86, 0x2A, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0xF4, 0x5F, 0xD0, 0x82, +0xD0, 0x83, 0xF0, 0x90, 0xA4, 0x03, 0xE0, 0x54, 0x7F, 0xF0, 0x80, 0x4E, 0x74, 0x91, 0x25, 0x6E, +0x12, 0x4F, 0x49, 0xE0, 0x90, 0x04, 0xCF, 0x30, 0xE0, 0x05, 0x74, 0x20, 0xF0, 0x80, 0x03, 0x74, +0x08, 0xF0, 0x12, 0xB3, 0x50, 0xC0, 0x83, 0xC0, 0x82, 0x12, 0x86, 0x2A, 0x80, 0x02, 0xC3, 0x33, +0xD8, 0xFC, 0x4F, 0xD0, 0x82, 0xD0, 0x83, 0xF0, 0x75, 0xF0, 0x10, 0xE5, 0x6E, 0x12, 0x76, 0xA9, +0xE0, 0x54, 0x07, 0xFF, 0x90, 0xA4, 0x03, 0xF0, 0x90, 0xA4, 0x01, 0xE0, 0x90, 0x43, 0xF1, 0x93, +0x12, 0x77, 0xE6, 0x90, 0xA4, 0x03, 0xF0, 0x44, 0x80, 0xF0, 0x75, 0xF0, 0x10, 0xE5, 0x6E, 0x12, +0x76, 0xD3, 0xE5, 0x6F, 0xF0, 0xE5, 0x6E, 0x70, 0x06, 0x90, 0x01, 0xC8, 0xE5, 0x6F, 0xF0, 0x90, +0xA4, 0x03, 0xE0, 0xFF, 0x75, 0xF0, 0x10, 0xE5, 0x6E, 0x12, 0x76, 0xA9, 0xEF, 0xF0, 0x75, 0xF0, +0x10, 0xE5, 0x6E, 0x12, 0x76, 0xEB, 0xE0, 0x54, 0xFC, 0xFF, 0xE5, 0x71, 0x12, 0x77, 0xEE, 0xE5, +0x6E, 0x12, 0x76, 0xEB, 0xEF, 0xF0, 0x7D, 0x01, 0xAF, 0x6E, 0x11, 0x11, 0xD0, 0xD0, 0x92, 0xAF, +0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xED, 0x60, 0x21, 0x75, 0xF0, 0x0A, 0xEF, 0x90, +0x8D, 0x01, 0x11, 0x4D, 0x90, 0x8D, 0x03, 0x11, 0x4D, 0x90, 0x8D, 0x05, 0x11, 0x4D, 0x90, 0x8D, +0x07, 0x11, 0x4D, 0x90, 0x8D, 0x09, 0xF1, 0x84, 0xF1, 0x9B, 0xE4, 0xF0, 0x11, 0x59, 0xE0, 0x54, +0xBF, 0x44, 0x80, 0xFE, 0x11, 0x59, 0xEE, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x12, 0x4A, 0x2A, +0xE4, 0xF0, 0xA3, 0xF0, 0x75, 0xF0, 0x0A, 0xEF, 0x22, 0x75, 0xF0, 0x10, 0xEF, 0x90, 0x81, 0x03, +0x02, 0x4A, 0x2A, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0xA4, 0x52, 0xEF, 0xF0, 0x75, +0xF0, 0x04, 0x71, 0xE5, 0x54, 0x1F, 0xFB, 0x60, 0x12, 0x64, 0x02, 0x60, 0x0E, 0xEB, 0x64, 0x04, +0x60, 0x09, 0xEB, 0x64, 0x09, 0x60, 0x04, 0xEB, 0xB4, 0x0C, 0x07, 0x71, 0xED, 0x74, 0x02, 0xF0, +0x80, 0x05, 0x71, 0xED, 0x74, 0x01, 0xF0, 0xE4, 0xF5, 0x25, 0x90, 0xA4, 0x52, 0xE0, 0xFD, 0x51, +0xB5, 0x25, 0x25, 0x51, 0x9B, 0xE0, 0xFE, 0xEB, 0x75, 0xF0, 0x07, 0xA4, 0x24, 0x5C, 0xF5, 0x82, +0xE4, 0x34, 0x40, 0xF5, 0x83, 0xE5, 0x82, 0x25, 0x25, 0x51, 0x9B, 0xE4, 0x93, 0xFC, 0xEE, 0x5C, +0x90, 0xA4, 0x55, 0xF0, 0x75, 0xF0, 0x04, 0xED, 0x12, 0x4F, 0x3D, 0x54, 0x03, 0xFF, 0xBF, 0x02, +0x0B, 0xE5, 0x25, 0x70, 0x07, 0x90, 0xA4, 0x55, 0xE0, 0x54, 0xF0, 0xF0, 0x90, 0xA4, 0x55, 0xE0, +0xFF, 0x51, 0xB1, 0x25, 0x25, 0x51, 0x9B, 0xEF, 0xF0, 0x05, 0x25, 0xE5, 0x25, 0x64, 0x07, 0x70, +0xA9, 0x90, 0xA4, 0x52, 0xE0, 0x75, 0xF0, 0x04, 0x12, 0x4F, 0x3D, 0xFF, 0xC4, 0x54, 0x03, 0xFD, +0xE4, 0x90, 0xA4, 0x53, 0xF0, 0x75, 0x26, 0x06, 0xE5, 0x26, 0xB4, 0x06, 0x07, 0x51, 0x8A, 0xE0, +0x54, 0x0F, 0x80, 0x07, 0x51, 0xB1, 0x25, 0x26, 0x51, 0x9B, 0xE0, 0x90, 0xA4, 0x54, 0xF0, 0x90, +0xA4, 0x54, 0xE0, 0x60, 0x32, 0x75, 0x25, 0x07, 0xF1, 0xC6, 0x80, 0x05, 0xC3, 0x33, 0xCE, 0x33, +0xCE, 0xD8, 0xF9, 0x12, 0xB4, 0x33, 0x60, 0x16, 0x12, 0xB4, 0x2A, 0x90, 0xA4, 0x53, 0xF0, 0xED, +0x60, 0x22, 0xE0, 0xD3, 0x94, 0x0B, 0x40, 0x1C, 0xE0, 0x24, 0x20, 0xF0, 0x80, 0x16, 0x15, 0x25, +0xE5, 0x25, 0xC3, 0x94, 0x00, 0x50, 0xD1, 0xE5, 0x26, 0x60, 0x09, 0x15, 0x26, 0xE5, 0x26, 0xC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xE0, 0xFF, 0xE4, 0xFB, 0xAD, 0x27, 0x12, +0x66, 0xB4, 0x90, 0xA4, 0x52, 0xE0, 0xFF, 0x75, 0xF0, 0x10, 0x11, 0x5D, 0xE4, 0xF0, 0x90, 0xA4, +0x53, 0xE0, 0xFE, 0xC3, 0x94, 0x36, 0x40, 0x0A, 0x74, 0x91, 0x2F, 0x51, 0xA9, 0x74, 0x05, 0xF0, +0x80, 0x43, 0xEE, 0xC3, 0x94, 0x2C, 0x40, 0x07, 0x51, 0xA3, 0x74, 0x04, 0xF0, 0x80, 0x36, 0x90, +0xA4, 0x53, 0xE0, 0xFF, 0xC3, 0x94, 0x14, 0x40, 0x07, 0x51, 0xA3, 0x74, 0x03, 0xF0, 0x80, 0x25, +0xEF, 0xC3, 0x94, 0x0C, 0x40, 0x07, 0x51, 0xA3, 0x74, 0x02, 0xF0, 0x80, 0x18, 0x90, 0xA4, 0x53, +0xE0, 0xC3, 0x94, 0x04, 0x90, 0xA4, 0x52, 0xE0, 0x40, 0x07, 0x51, 0xA7, 0x74, 0x01, 0xF0, 0x80, +0x04, 0x51, 0xA7, 0xE4, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xFF, 0x90, 0xA4, 0x52, 0xE0, 0x75, +0xF0, 0x08, 0x90, 0x89, 0x00, 0x12, 0x4A, 0x2A, 0xE5, 0x82, 0x2F, 0xF5, 0x82, 0xE4, 0x35, 0x83, +0xF5, 0x83, 0x22, 0x90, 0xA4, 0x52, 0xE0, 0x24, 0x91, 0xF5, 0x82, 0xE4, 0x34, 0x95, 0xF5, 0x83, +0x22, 0x90, 0xA4, 0x52, 0xE0, 0x75, 0xF0, 0x08, 0x90, 0x89, 0x00, 0x12, 0x4A, 0x2A, 0xE5, 0x82, +0x22, 0xE4, 0xFF, 0xE4, 0xFE, 0x74, 0x91, 0x2F, 0x12, 0x4F, 0x49, 0xE0, 0x54, 0xFE, 0xF0, 0x75, +0xF0, 0x10, 0xEF, 0x90, 0x81, 0x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D, 0x54, 0x7F, 0x71, +0xD6, 0xE0, 0xFE, 0x75, 0xF0, 0x10, 0xEF, 0x12, 0x76, 0xD3, 0xEE, 0xF0, 0x74, 0x91, 0x2F, 0x12, +0x4F, 0x49, 0xE4, 0xF0, 0x0F, 0xEF, 0x64, 0x80, 0x60, 0x02, 0x61, 0x09, 0x90, 0x04, 0x49, 0x74, +0xF0, 0xF0, 0xA3, 0xE4, 0xF0, 0xA3, 0x74, 0xFF, 0xF0, 0x90, 0x04, 0x33, 0x74, 0x02, 0xF0, 0xA3, +0x74, 0x04, 0xF0, 0xA3, 0x04, 0xF0, 0xA3, 0x04, 0xF0, 0xA3, 0x04, 0xF0, 0x74, 0x11, 0x2F, 0x12, +0xA9, 0x80, 0x74, 0xFF, 0xF0, 0x22, 0xF0, 0x75, 0xF0, 0x04, 0xEF, 0x90, 0x96, 0x12, 0x02, 0x4A, +0x2A, 0x75, 0xF0, 0x04, 0xEF, 0x90, 0x96, 0x13, 0x12, 0x4A, 0x2A, 0xE0, 0x22, 0x90, 0xA4, 0x52, +0xE0, 0x24, 0xF5, 0xF5, 0x82, 0xE4, 0x34, 0xA0, 0xF5, 0x83, 0x22, 0x90, 0xA3, 0x91, 0xEB, 0xF0, +0xEF, 0x54, 0x7F, 0x24, 0xF4, 0x90, 0xA3, 0x95, 0xF0, 0xED, 0x70, 0x2E, 0xF1, 0xD6, 0x70, 0x15, +0xE0, 0x25, 0xE0, 0x24, 0xDF, 0xF5, 0x82, 0xE4, 0x34, 0x40, 0xB1, 0x1D, 0x24, 0xE0, 0xF5, 0x82, +0xE4, 0x34, 0x40, 0x80, 0x41, 0xE0, 0x25, 0xE0, 0x24, 0xB7, 0xF5, 0x82, 0xE4, 0x34, 0x40, 0xB1, +0x1D, 0x24, 0xB8, 0xF5, 0x82, 0xE4, 0x34, 0x40, 0x80, 0x2C, 0xF1, 0xD6, 0x70, 0x15, 0xE0, 0x25, +0xE0, 0x24, 0x2B, 0xF5, 0x82, 0xE4, 0x34,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, 0x13, 0x54, 0x03, 0x90, 0xA3, 0x84, +0xF0, 0xD1, 0x6F, 0xE0, 0xC3, 0x94, 0x05, 0x40, 0x02, 0x81, 0x9A, 0x90, 0xA3, 0x83, 0xE0, 0xFF, +0xE5, 0x0F, 0x9F, 0x40, 0x08, 0x8F, 0x0F, 0x53, 0x0E, 0x80, 0xEF, 0x42, 0x0E, 0xE5, 0x0F, 0x90, +0x42, 0x41, 0x93, 0x12, 0x61, 0x83, 0xC3, 0x9F, 0x40, 0x0A, 0xE5, 0x0F, 0x90, 0x41, 0xED, 0x93, +0xF5, 0x14, 0x80, 0x0A, 0x74, 0x21, 0x25, 0x0F, 0x12, 0xAA, 0xCC, 0xE0, 0xF5, 0x14, 0x90, 0xA3, +0x12, 0xE0, 0x60, 0x7D, 0xE5, 0x0F, 0x64, 0x13, 0x60, 0x05, 0xE5, 0x0F, 0xB4, 0x0B, 0x05, 0x90, +0xA3, 0x14, 0x80, 0x23, 0xE5, 0x0F, 0x64, 0x12, 0x60, 0x05, 0xE5, 0x0F, 0xB4, 0x0A, 0x05, 0x90, +0xA3, 0x15, 0x80, 0x13, 0xE5, 0x0F, 0x64, 0x11, 0x60, 0x05, 0xE5, 0x0F, 0xB4, 0x09, 0x05, 0x90, +0xA3, 0x16, 0x80, 0x03, 0x90, 0xA3, 0x13, 0xE0, 0xF5, 0x18, 0xE5, 0x18, 0xC3, 0x94, 0x80, 0x50, +0x28, 0xE5, 0x18, 0x94, 0x1B, 0x40, 0x02, 0x80, 0x13, 0xE5, 0x14, 0x25, 0x18, 0xFF, 0xE4, 0x33, +0xFE, 0xD3, 0xEF, 0x94, 0x1B, 0xEE, 0x64, 0x80, 0x94, 0x80, 0x40, 0x05, 0x75, 0x14, 0x1B, 0x80, +0x20, 0xE5, 0x18, 0x25, 0x14, 0xF5, 0x14, 0x80, 0x18, 0xC3, 0xE4, 0x95, 0x18, 0xF5, 0x18, 0xE5, +0x14, 0xD3, 0x95, 0x18, 0x40, 0x08, 0xE5, 0x14, 0x95, 0x18, 0xF5, 0x14, 0x80, 0x03, 0xE4, 0xF5, +0x14, 0xE5, 0x14, 0x75, 0xF0, 0x06, 0xA4, 0x24, 0x4B, 0xF9, 0x74, 0x41, 0x35, 0xF0, 0xFA, 0x7B, +0xFF, 0x90, 0xA3, 0x75, 0x12, 0x4A, 0x3F, 0xC3, 0xE5, 0x13, 0x94, 0x0F, 0xE5, 0x12, 0x94, 0x00, +0x40, 0x02, 0x41, 0xBB, 0x90, 0xA3, 0x78, 0x12, 0x4A, 0x36, 0x90, 0x00, 0x06, 0x12, 0x49, 0xC0, +0xFF, 0xAE, 0xF0, 0xD1, 0x87, 0x2F, 0xFD, 0xE5, 0xF0, 0x3E, 0xFC, 0xF1, 0x2D, 0xD3, 0xED, 0x9F, +0xEC, 0x9E, 0x40, 0x02, 0x81, 0x76, 0xE5, 0x13, 0xAE, 0x12, 0x78, 0x02, 0xCE, 0xC3, 0x13, 0xCE, +0x13, 0xD8, 0xF9, 0xFD, 0xAC, 0x06, 0xE5, 0x12, 0xC3, 0x13, 0xFE, 0xE5, 0x13, 0x13, 0x2D, 0xFF, +0xEE, 0x3C, 0xFE, 0x90, 0xA3, 0x78, 0x12, 0x4A, 0x36, 0x12, 0x49, 0x95, 0xD3, 0x9F, 0xE5, 0xF0, +0x9E, 0x50, 0x02, 0x81, 0x7D, 0xE5, 0x0F, 0x94, 0x38, 0x40, 0x0A, 0x12, 0x61, 0x84, 0xC3, 0x94, +0x0F, 0x50, 0x02, 0x81, 0x7D, 0xE5, 0x0F, 0xC3, 0x94, 0x3A, 0x40, 0x0A, 0x12, 0x61, 0x84, 0xC3, +0x94, 0x14, 0x50, 0x02, 0x81, 0x7D, 0xE5, 0x0F, 0xC3, 0x94, 0x3C, 0x50, 0x02, 0x81, 0x65, 0x12, +0x61, 0x84, 0xC3, 0x94, 0x19, 0x50, 0x02, 0x81, 0x7D, 0x81, 0x65, 0xE5, 0x0D, 0x70, 0x45, 0x90, +0xA3, 0x78, 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 0x05, 0x75, 0x15, 0x05, 0x80, 0x13, +0xD3, 0xE5, 0x13, 0x94, 0xC8, 0xE5, 0x12, 0x94, 0x00, 0x40, 0x05, 0x75, 0x15, 0x02, 0x80, 0x03, +0xE4, 0xF5, 0x15, 0xD1, 0xAF, 0xE0, 0xF5, 0x10, 0xA3, 0xE0, 0xF5, 0x11, 0xE4, 0xF5, 0x19, 0xF1, +0x0F, 0xE5, 0x19, 0xF1, 0x84, 0x08, 0x80, 0x05, 0xCE, 0xC3, 0x13, 0xCE, 0x13, 0xD8, 0xF9, 0xFF, +0x90, 0xA3, 0x75, 0x12, 0x4A, 0x36, 0x85, 0x19, 0x82, 0x75, 0x83, 0x00, 0x12, 0x26, 0x37, 0xF1, +0x9F, 0x05, 0x19, 0xE5, 0x19, 0xB4, 0x05, 0xD7, 0x90, 0xA3, 0x75, 0x12, 0x4A, 0x36, 0xD1, 0xC7, +0xFD, 0x7C, 0x00, 0xD1, 0xFD, 0x80, 0x05, 0xCE, 0xC3, 0x13, 0xCE, 0x13, 0xD8, 0xF9, 0xFF, 0x12, +0x26, 0x98, 0xD3, 0xE5, 0x11, 0x9F, 0xE5, 0x10, 0x9E, 0x40, 0x0C, 0xE5, 0x11, 0x9F, 0xF5, 0x11, +0xE5, 0x10, 0x9E, 0xF5, 0x10, 0x80, 0x05, 0xE4, 0xF5, 0x10, 0xF5, 0x11, 0xD1, 0xAF, 0xE5, 0x10, +0xF0, 0xA3, 0xE5, 0x11, 0xF0, 0xF1, 0x68, 0xC3, 0xF1, 0x23, 0x50, 0x60, 0xF1, 0x5B, 0x54, 0x7F, +0x12, 0x61, 0x83, 0xFE, 0xD3, 0x9F, 0x40, 0x03, 0xEE, 0x80, 0x09, 0x12, 0x61, 0x84, 0xFF, 0xF1, +0x5B, 0x54, 0x7F, 0xC3, 0x9F, 0x90, 0xA3, 0x85, 0xF0, 0x90, 0xA3, 0x85, 0xE0, 0xD3, 0x94, 0x04, +0x40, 0x08, 0xD1, 0x98, 0xE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F1, 0x05, 0x50, 0x07, 0xF1, +0x37, 0xE0, 0x65, 0x0F, 0x60, 0x29, 0xE5, 0x17, 0x70, 0x05, 0x75, 0x17, 0x01, 0x80, 0x0D, 0xE5, +0x17, 0xB4, 0x01, 0x05, 0x75, 0x17, 0x03, 0x80, 0x03, 0x75, 0x17, 0x05, 0x12, 0x61, 0x84, 0xFF, +0xF1, 0x43, 0xEF, 0xF0, 0x74, 0x21, 0x25, 0x0D, 0xF5, 0x82, 0xE4, 0x34, 0x9D, 0x80, 0x17, 0xD1, +0x6F, 0xE4, 0xF0, 0xD1, 0xF1, 0xE0, 0x04, 0xF0, 0x80, 0x10, 0xE4, 0xF5, 0x17, 0x74, 0xA1, 0x25, +0x0D, 0xF5, 0x82, 0xE4, 0x34, 0x9E, 0xF5, 0x83, 0xE4, 0xF0, 0xF1, 0x37, 0xE5, 0x0F, 0xF0, 0x12, +0x4F, 0x38, 0xC4, 0x13, 0x13, 0x54, 0x03, 0x20, 0xE0, 0x02, 0xC1, 0x38, 0xD1, 0xF1, 0xE4, 0xF0, +0xD1, 0x6D, 0xE4, 0xF0, 0xC1, 0x38, 0xEC, 0x64, 0x06, 0x60, 0x02, 0xC1, 0x48, 0xF5, 0x10, 0xF5, +0x11, 0xD1, 0xA4, 0xE0, 0x54, 0x07, 0xF5, 0x17, 0xF1, 0x19, 0x40, 0x05, 0x75, 0x15, 0x05, 0x80, +0x13, 0xD3, 0xE5, 0x13, 0x94, 0xFA, 0xE5, 0x12, 0x94, 0x00, 0x40, 0x05, 0x75, 0x15, 0x02, 0x80, +0x03, 0xE4, 0xF5, 0x15, 0xD1, 0xFD, 0x80, 0x05, 0xCE, 0xC3, 0x13, 0xCE, 0x13, 0xD8, 0xF9, 0xFF, +0x90, 0x44, 0x9E, 0xE4, 0x93, 0xFD, 0x7C, 0x00, 0x12, 0x26, 0x98, 0x90, 0xA3, 0x86, 0xEE, 0xF0, +0xA3, 0xEF, 0xF0, 0xE4, 0xF5, 0x16, 0xF1,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0xE4, +0xF0, 0xE4, 0xFD, 0xAF, 0x0D, 0x12, 0x68, 0x11, 0x05, 0x0D, 0x01, 0x02, 0x22, 0xF5, 0x17, 0x74, +0xA1, 0x25, 0x0D, 0xF5, 0x82, 0xE4, 0x34, 0x9E, 0xF5, 0x83, 0x22, 0x74, 0x01, 0x25, 0x0D, 0xF5, +0x82, 0xE4, 0x34, 0x93, 0xF5, 0x83, 0x22, 0x90, 0x00, 0x08, 0x02, 0x49, 0xC0, 0x75, 0xF0, 0x04, +0xE5, 0x0D, 0x90, 0x9B, 0x11, 0x02, 0x4A, 0x2A, 0x75, 0xF0, 0x04, 0xE5, 0x0D, 0x90, 0x9B, 0x12, +0x02, 0x4A, 0x2A, 0xF0, 0x75, 0xF0, 0x10, 0xE5, 0x0D, 0x90, 0x81, 0x01, 0x02, 0x4A, 0x2A, 0xE5, +0x0D, 0x25, 0xE0, 0x24, 0x91, 0xF5, 0x82, 0xE4, 0x34, 0x94, 0xF5, 0x83, 0x22, 0x12, 0x49, 0xC0, +0x2F, 0xFF, 0xEE, 0x22, 0x4E, 0xFF, 0xF0, 0x90, 0x00, 0x05, 0x02, 0x26, 0x37, 0xF0, 0x75, 0xF0, +0x10, 0xE5, 0x0D, 0x90, 0x81, 0x00, 0x02, 0x4A, 0x2A, 0x74, 0x11, 0x25, 0x22, 0xF5, 0x82, 0xE4, +0x34, 0x9D, 0xF5, 0x83, 0x22, 0x8F, 0x13, 0x75, 0xF0, 0x10, 0xEF, 0x90, 0x81, 0x05, 0x02, 0x4A, +0x2A, 0x74, 0x21, 0x25, 0x0D, 0xF5, 0x82, 0xE4, 0x34, 0x9D, 0xF5, 0x83, 0x22, 0xE5, 0x13, 0xAE, +0x12, 0xA8, 0x15, 0x08, 0x22, 0xD3, 0x9F, 0xEE, 0x64, 0x80, 0xF8, 0x74, 0x80, 0x98, 0x22, 0x90, +0xA3, 0x78, 0x12, 0x4A, 0x36, 0x75, 0xF0, 0x02, 0x22, 0xD3, 0xE5, 0x13, 0x94, 0xE8, 0xE5, 0x12, +0x94, 0x03, 0x22, 0x74, 0x01, 0x93, 0x95, 0x11, 0xE4, 0x93, 0x95, 0x10, 0x22, 0xE5, 0x12, 0xC3, +0x13, 0xFE, 0xE5, 0x13, 0x13, 0xFF, 0x22, 0x74, 0x21, 0x25, 0x0D, 0xF5, 0x82, 0xE4, 0x34, 0x9F, +0xF5, 0x83, 0x22, 0x74, 0x01, 0x25, 0x0D, 0xF5, 0x82, 0xE4, 0x34, 0x94, 0xF5, 0x83, 0x22, 0x74, +0x91, 0x25, 0x0D, 0xF5, 0x82, 0xE4, 0x34, 0x9A, 0xF5, 0x83, 0x22, 0x75, 0xF0, 0x04, 0xE5, 0x0D, +0x90, 0x9B, 0x14, 0x12, 0x4A, 0x2A, 0xE0, 0x22, 0xE5, 0x0F, 0x25, 0xE0, 0x24, 0x95, 0xF5, 0x82, +0xE4, 0x34, 0x42, 0xF5, 0x83, 0x22, 0xE5, 0x0D, 0x25, 0xE0, 0x24, 0x01, 0xF5, 0x82, 0xE4, 0x34, +0x92, 0xF5, 0x83, 0x22, 0xA4, 0xF5, 0x82, 0x85, 0xF0, 0x83, 0x12, 0x49, 0xC0, 0xAE, 0xF0, 0xA8, +0x15, 0x22, 0xD1, 0xE5, 0xE0, 0x54, 0xFB, 0xF1, 0xB7, 0x90, 0xA2, 0x95, 0x02, 0x27, 0x48, 0xFD, +0x7C, 0x00, 0x12, 0x26, 0x98, 0xEF, 0x25, 0x11, 0xF5, 0x11, 0xEE, 0x35, 0x10, 0xF5, 0x10, 0x22, +0xD1, 0xE5, 0xE0, 0x44, 0x04, 0xF0, 0x22, 0xF0, 0x7F, 0xB0, 0x7E, 0x0C, 0x02, 0x36, 0xCE, 0xFF, +0xEE, 0x5C, 0xFE, 0xEF, 0x5D, 0x4E, 0x22, 0x12, 0x99, 0x70, 0x12, 0x99, 0x0D, 0xE0, 0xFD, 0x7C, +0x00, 0x12, 0x6F, 0x93, 0x80, 0x05, 0xC3, 0x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x0B, 0x2D, 0xF5, 0x82, -0xE4, 0x34, 0xFB, 0xF5, 0x83, 0xE0, 0x44, 0x10, 0xF0, 0x22, 0x90, 0xA5, 0x96, 0xEF, 0xF0, 0xA3, -0x12, 0x4A, 0x9D, 0x90, 0xA5, 0x90, 0xE0, 0xFE, 0x04, 0xF0, 0x90, 0x00, 0x01, 0xEE, 0x12, 0x26, -0x76, 0x74, 0x00, 0x2F, 0xF9, 0xE4, 0x34, 0xFB, 0xFA, 0x7B, 0x01, 0xC0, 0x03, 0xC0, 0x02, 0xC0, -0x01, 0x90, 0xA5, 0x97, 0x12, 0x4A, 0x94, 0x8B, 0x40, 0x8A, 0x41, 0x89, 0x42, 0x75, 0x43, 0x02, -0xD0, 0x01, 0xD0, 0x02, 0xD0, 0x03, 0x12, 0x34, 0x2C, 0x90, 0xA5, 0x96, 0xE0, 0x24, 0x02, 0xF9, -0xE4, 0x34, 0xFB, 0xFA, 0x7B, 0x01, 0xC0, 0x03, 0xC0, 0x02, 0xC0, 0x01, 0xA3, 0x12, 0x4A, 0x94, -0xE9, 0x24, 0x02, 0xF9, 0xE4, 0x3A, 0x8B, 0x40, 0xF5, 0x41, 0x89, 0x42, 0x90, 0xA5, 0x97, 0x12, -0x4A, 0x94, 0x90, 0x00, 0x0E, 0x12, 0x26, 0x37, 0xF5, 0x43, 0xD0, 0x01, 0xD0, 0x02, 0xD0, 0x03, -0x02, 0x34, 0x2C, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0xA5, 0xA6, 0x12, 0x4A, 0x9D, -0x90, 0xA5, 0x91, 0xE0, 0xFF, 0x04, 0xF0, 0x90, 0x00, 0x01, 0xEF, 0x12, 0x26, 0x76, 0x7F, 0xAF, -0x7E, 0x01, 0x12, 0x7F, 0xA9, 0xEF, 0x60, 0x3A, 0x90, 0xA5, 0xA6, 0x12, 0x4A, 0x94, 0x8B, 0x40, -0x8A, 0x41, 0x89, 0x42, 0x90, 0x00, 0x0E, 0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x90, 0xA4, -0xD1, 0xE0, 0x90, 0xA4, 0xD6, 0xF0, 0x02, 0x5E, 0x19, 0xE4, 0x90, 0xA4, 0xBB, 0xF0, 0xA3, 0xF0, -0x90, 0x01, 0x98, 0xE0, 0x7F, 0x00, 0x30, 0xE4, 0x02, 0x7F, 0x01, 0xEF, 0x64, 0x01, 0x60, 0x45, -0xC3, 0x90, 0xA4, 0xBC, 0xE0, 0x94, 0x88, 0x90, 0xA4, 0xBB, 0xE0, 0x94, 0x13, 0x40, 0x0F, 0x90, -0x01, 0xC1, 0xE0, 0x44, 0x10, 0xF0, 0x90, 0x01, 0xC7, 0x74, 0x03, 0xF0, 0x80, 0x27, 0x90, 0xA4, -0xBB, 0xE4, 0x75, 0xF0, 0x01, 0x12, 0x49, 0x9F, 0x7F, 0x14, 0x7E, 0x00, 0x12, 0x3A, 0xF7, 0xD3, -0x90, 0xA4, 0xBC, 0xE0, 0x94, 0x32, 0x90, 0xA4, 0xBB, 0xE0, 0x94, 0x00, 0x40, 0xB2, 0x90, 0x01, -0xC6, 0xE0, 0x30, 0xE3, 0xAB, 0x90, 0x01, 0xC7, 0x74, 0x05, 0xF0, 0x22, 0x7F, 0x02, 0x90, 0xA4, -0x04, 0xE0, 0xFE, 0xEF, 0xC3, 0x9E, 0x50, 0x18, 0xEF, 0x25, 0xE0, 0x24, 0x81, 0xF8, 0xE6, 0x30, -0xE4, 0x0B, 0x90, 0x01, 0xB8, 0x74, 0x08, 0xF0, 0xA3, 0xF0, 0x7F, 0x00, 0x22, 0x0F, 0x80, 0xDE, -0x7F, 0x01, 0x22, 0x7B, 0x00, 0x7A, 0x00, 0x79, 0x53, 0xE4, 0xFD, 0x7F, 0x01, 0x12, 0x39, 0x33, -0xE5, 0x51, 0x52, 0x53, 0x7B, 0x00, 0x7A, 0x00, 0x79, 0x54, 0x7D, 0x01, 0x7F, 0x01, 0x12, 0x39, -0x33, 0xE5, 0x52, 0x52, 0x54, 0xAB, 0x53, 0xE4, 0xFD, 0x7F, 0x01, 0x12, 0x39, 0x04, 0xAB, 0x54, -0x7D, 0x01, 0x7F, 0x01, 0x02, 0x39, 0x04, 0x90, 0x01, 0x34, 0xE0, 0x55, 0x5D, 0xF5, 0x61, 0xA3, -0xE0, 0x55, 0x5E, 0xF5, 0x62, 0xA3, 0xE0, 0x55, 0x5F, 0xF5, 0x63, 0xA3, 0xE0, 0x55, 0x60, 0xF5, -0x64, 0x90, 0x01, 0x34, 0xE5, 0x61, 0xF0, 0xA3, 0xE5, 0x62, 0xF0, 0xA3, 0xE5, 0x63, 0xF0, 0xA3, -0xE5, 0x64, 0xF0, 0x22, 0x8F, 0x7A, 0x7F, 0x02, 0x12, 0x48, 0x27, 0x90, 0xA2, 0x27, 0xE0, 0x45, -0x7A, 0xF0, 0x22, 0x90, 0xA3, 0x1D, 0xE0, 0x64, 0x01, 0x70, 0x13, 0x90, 0xA3, 0xA1, 0xE0, 0x60, -0x0D, 0x90, 0x01, 0x57, 0xE4, 0xF0, 0x90, 0x01, 0x3C, 0x74, 0x02, 0x12, 0x5D, 0x85, 0x22, 0x90, -0xA3, 0x1D, 0xE0, 0x64, 0x01, 0x70, 0x26, 0x90, 0xA3, 0xA1, 0xE0, 0x60, 0x20, 0x90, 0x01, 0x57, -0xE4, 0xF0, 0x90, 0x01, 0x3C, 0x74, 0x02, 0xF0, 0x90, 0xA3, 0x9E, 0xE0, 0x54, 0xFB, 0xF0, 0x90, -0xA3, 0xA5, 0xE0, 0x54, 0xFD, 0xF0, 0x54, 0x07, 0x70, 0x03, 0x12, 0x50, 0x6E, 0x22, 0x90, 0xA3, -0x1D, 0xE0, 0xB4, 0x01, 0x14, 0x90, 0xA3, 0xA1, 0xE0, 0x60, 0x0E, 0x90, 0xA3, 0xA5, 0xE0, 0x54, -0xFE, 0xF0, 0x54, 0x07, 0x70, 0x03, 0x12, 0x50, 0x6E, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, -0xD0, 0x90, 0x04, 0x1D, 0x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x90, 0xA5, -0xB6, 0xE0, 0x94, 0x00, 0x40, 0xB9, 0x90, 0x01, 0xC6, 0xE0, 0x30, 0xE0, 0xB2, 0x22, 0x91, 0xA4, -0x90, 0x00, 0x08, 0xE0, 0x54, 0xEF, 0xFD, 0x7F, 0x08, 0x12, 0x3A, 0x96, 0xE4, 0xFF, 0x71, 0xA6, -0x90, 0xA2, 0x2A, 0xE0, 0xB4, 0x03, 0x0C, 0x90, 0x00, 0x70, 0xE0, 0x54, 0x7F, 0xFD, 0x7F, 0x70, -0x12, 0x3A, 0x96, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x91, 0x4C, 0x71, 0xFE, 0xD0, -0xD0, 0x92, 0xAF, 0x22, 0x90, 0xA3, 0xA4, 0xE0, 0xFF, 0x60, 0x03, 0xB4, 0x08, 0x0D, 0x91, 0xB6, -0xBF, 0x01, 0x08, 0x91, 0x24, 0x90, 0x01, 0xE5, 0xE0, 0x04, 0xF0, 0x22, 0x90, 0xA2, 0x2A, 0xE0, -0xB4, 0x03, 0x0C, 0x90, 0x00, 0x70, 0xE0, 0x44, 0x80, 0xFD, 0x7F, 0x70, 0x12, 0x3A, 0x96, 0x90, -0xA3, 0xAB, 0xE0, 0xFD, 0x7F, 0x93, 0x12, 0x3A, 0x96, 0x90, 0xA3, 0xA2, 0xE0, 0x60, 0x12, 0x90, -0x01, 0x2F, 0xE0, 0x30, 0xE7, 0x05, 0x74, 0x10, 0xF0, 0x80, 0x06, 0x90, 0x01, 0x2F, 0x74, 0x90, -0xF0, 0x90, 0x00, 0x08, 0xE0, 0x44, 0x10, 0xFD, 0x7F, 0x08, 0x12, 0x3A, 0x96, 0x7F, 0x01, 0x71, -0xA6, 0x90, 0x00, 0x90, 0xE0, 0x44, 0x01, 0xFD, 0x7F, 0x90, 0x12, 0x3A, 0x96, 0x7F, 0x14, 0x7E, -0x00, 0x02, 0x3A, 0xF7, 0x90, 0x00, 0x90, 0xE0, 0x20, 0xE0, 0xF9, 0x22, 0x90, 0xA3, 0x9E, 0xE0, -0x30, 0xE0, 0x02, 0x91, 0x34, 0x22, 0x90, 0x02, 0x87, 0xE0, 0x60, 0x08, 0x90, 0x01, 0xB8, 0x74, -0x01, 0xF0, 0x80, 0x25, 0x90, 0x02, 0x96, 0xE0, 0x60, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x10, 0xF0, -0x80, 0x17, 0x90, 0x02, 0x86, 0xE0, 0x20, 0xE1, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x04, 0xF0, 0x80, -0x08, 0x90, 0x01, 0xB8, 0xE4, 0xF0, 0x7F, 0x01, 0x22, 0x90, 0x01, 0xB9, 0x74, 0x08, 0xF0, 0x7F, -0x00, 0x22, 0xE4, 0x90, 0xA4, 0xBB, 0xF0, 0xE4, 0x90, 0xA4, 0xBC, 0xF0, 0x90, 0xA4, 0xBC, 0xE0, -0xFF, 0xC3, 0x94, 0x10, 0x50, 0x75, 0x90, 0xA4, 0xBB, 0xE0, 0xFE, 0x24, 0x16, 0xF5, 0x82, 0xE4, -0x34, 0x99, 0xF5, 0x83, 0xE0, 0x54, 0xFE, 0xF0, 0xEF, 0x90, 0xA4, 0xBC, 0xB4, 0x03, 0x1B, 0xE0, -0xFF, 0x75, 0xF0, 0x10, 0xEE, 0x90, 0x81, 0x00, 0x12, 0x4A, 0x88, 0xE5, 0x82, 0x2F, 0xF5, 0x82, -0xE4, 0x35, 0x83, 0xF5, 0x83, 0x74, 0x80, 0xF0, 0x80, 0x1B, 0xE0, 0xFF, 0x90, 0xA4, 0xBB, 0xE0, -0x75, 0xF0, 0x10, 0x90, 0x81, 0x00, 0x12, 0x4A, 0x88, 0xE5, 0x82, 0x2F, 0xF5, 0x82, 0xE4, 0x35, -0x83, 0xF5, 0x83, 0xE4, 0xF0, 0x90, 0xA4, 0xBC, 0xE0, 0xFF, 0x90, 0xA4, 0xBB, 0xE0, 0x75, 0xF0, -0x08, 0x90, 0x89, 0x00, 0x12, 0x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F5, 0x83, -0xE4, 0xF0, 0xEE, 0x25, 0xE0, 0x24, 0xA6, 0xF5, 0x82, 0xE4, 0x34, 0x9C, 0xF5, 0x83, 0xE4, 0xF0, -0xA3, 0xF0, 0xEE, 0x25, 0xE0, 0x24, 0xA6, 0xF5, 0x82, 0xE4, 0x34, 0x9D, 0xF5, 0x83, 0xE4, 0xF0, -0xA3, 0xF0, 0x75, 0xF0, 0x04, 0xEE, 0x90, 0x96, 0x16, 0x12, 0x4A, 0x88, 0x74, 0x3F, 0xF0, 0x75, -0xF0, 0x04, 0xEE, 0x90, 0x96, 0x17, 0x12, 0x4A, 0x88, 0x74, 0x03, 0xF0, 0x75, 0xF0, 0x04, 0xEE, -0x90, 0x96, 0x18, 0x12, 0x4A, 0x88, 0xE0, 0x54, 0xE0, 0x44, 0x09, 0xF0, 0x90, 0xA4, 0xBB, 0xE0, -0xFE, 0x75, 0xF0, 0x04, 0x90, 0x96, 0x19, 0x12, 0x4A, 0x88, 0xE0, 0x54, 0xF3, 0xF0, 0x75, 0xF0, -0x04, 0xEE, 0x90, 0x96, 0x19, 0x12, 0x4A, 0x88, 0xE0, 0x54, 0xFC, 0xF0, 0x90, 0xA4, 0xBB, 0xE0, -0xFE, 0x75, 0xF0, 0x04, 0x90, 0x96, 0x18, 0x12, 0x4A, 0x88, 0xE0, 0x44, 0x20, 0xF0, 0x75, 0xF0, -0x04, 0xEE, 0x90, 0x96, 0x19, 0x12, 0x4A, 0x88, 0xE0, 0x54, 0xCF, 0xF0, 0x90, 0xA4, 0xBB, 0xE0, -0xFE, 0x75, 0xF0, 0x04, 0x90, 0x96, 0x19, 0x12, 0x4A, 0x88, 0xE0, 0x44, 0x40, 0xF0, 0x75, 0xF0, -0x04, 0xEE, 0x90, 0x96, 0x19, 0x12, 0x4A, 0x88, 0xE0, 0x54, 0x7F, 0xF0, 0x90, 0xA4, 0xBB, 0xE0, -0xFE, 0x75, 0xF0, 0x04, 0x90, 0x96, 0x16, 0x12, 0x4A, 0x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xFE, 0xED, 0x2E, 0xFF, 0x22, 0xEF, 0x60, 0x0A, 0xED, 0xC3, 0x94, 0x2C, 0x40, -0x04, 0x7E, 0x20, 0x80, 0x02, 0xE4, 0xFE, 0xC3, 0xED, 0x9E, 0xFF, 0x22, 0xD3, 0x10, 0xAF, 0x01, -0xC3, 0xC0, 0xD0, 0x90, 0xA5, 0x5A, 0xEF, 0xF0, 0xA3, 0xED, 0xF0, 0xA3, 0xEB, 0xF0, 0xE4, 0x90, -0xA5, 0x63, 0xF0, 0x90, 0xA5, 0x5A, 0xE0, 0xFF, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x90, 0xA5, 0x5E, -0xF0, 0xEF, 0x54, 0x07, 0x90, 0xA5, 0x60, 0xF0, 0x90, 0xA5, 0x5A, 0xE0, 0x75, 0xF0, 0x10, 0x90, -0x81, 0x01, 0x12, 0x4A, 0x88, 0xE0, 0x90, 0xA5, 0x61, 0xF0, 0x75, 0xF0, 0x04, 0xEF, 0x90, 0x96, -0x16, 0x12, 0x4A, 0x88, 0xE0, 0x54, 0x7F, 0x90, 0xA5, 0x64, 0xF0, 0x90, 0xA5, 0x5A, 0xE0, 0x75, -0xF0, 0x04, 0x90, 0x96, 0x17, 0x12, 0x4A, 0x88, 0xE0, 0x90, 0xA5, 0x65, 0xF0, 0xED, 0x54, 0x7F, -0x90, 0xA5, 0x5F, 0xF0, 0xEB, 0x70, 0x40, 0xE0, 0xFB, 0x25, 0xE0, 0x24, 0x2D, 0xF5, 0x82, 0xE4, -0x34, 0x44, 0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0xE4, 0xFC, 0xFD, 0x75, 0xF0, -0x04, 0xEB, 0x90, 0x42, 0xDD, 0x12, 0x4A, 0x88, 0x12, 0x4A, 0x78, 0x12, 0x4A, 0x18, 0x78, 0x01, -0x12, 0x27, 0x22, 0x90, 0xA5, 0x5A, 0xE0, 0x25, 0xE0, 0x24, 0x95, 0xF5, 0x82, 0x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0xC0, 0x82, 0xE0, 0xFE, 0x90, 0xA5, 0x60, 0xE0, 0xFD, 0x74, 0x01, -0xA8, 0x05, 0x08, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0x4E, 0xD0, 0x82, 0xD0, 0x83, 0xF0, 0x75, -0xF0, 0x10, 0xEF, 0x90, 0x81, 0x01, 0x12, 0x4A, 0x88, 0xE0, 0x54, 0x07, 0xFF, 0x90, 0xA5, 0x61, -0xF0, 0x90, 0xA5, 0x5F, 0xE0, 0x90, 0x44, 0xE1, 0x93, 0x33, 0x33, 0x33, 0x54, 0xF8, 0x4F, 0x90, -0xA5, 0x61, 0xF0, 0x44, 0x80, 0xF0, 0x90, 0xA5, 0x5B, 0xE0, 0xFF, 0x90, 0xA5, 0x5A, 0xE0, 0xFE, -0x75, 0xF0, 0x10, 0x90, 0x81, 0x00, 0x12, 0x4A, 0x88, 0xEF, 0xF0, 0x90, 0xA5, 0x61, 0xE0, 0xFF, -0x75, 0xF0, 0x10, 0xEE, 0x90, 0x81, 0x01, 0x12, 0x4A, 0x88, 0xEF, 0xF0, 0x75, 0xF0, 0x10, 0xEE, -0x90, 0x81, 0x05, 0x12, 0x4A, 0x88, 0xE0, 0x54, 0xFC, 0xFF, 0x90, 0xA5, 0x5D, 0xE0, 0x54, 0x03, -0x4F, 0xFE, 0x90, 0xA5, 0x5A, 0xE0, 0xFF, 0x75, 0xF0, 0x10, 0x90, 0x81, 0x05, 0x12, 0x4A, 0x88, -0xEE, 0xF0, 0x7D, 0x01, 0xD1, 0xDA, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x75, 0xF0, 0x04, 0xEF, 0x90, -0x96, 0x19, 0x12, 0x4A, 0x88, 0xE0, 0xC4, 0x54, 0x03, 0x70, 0x2E, 0xED, 0xC3, 0x94, 0x14, 0x40, -0x15, 0xED, 0xD3, 0x94, 0x18, 0x50, 0x0F, 0x90, 0x04, 0x33, 0x74, 0x06, 0xF0, 0xA3, 0x04, 0xF0, -0x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EC, 0xC3, 0x94, 0x3E, 0x40, 0x22, 0xEC, -0xD3, 0x94, 0x3F, 0x50, 0x1C, 0x75, 0xF0, 0x04, 0xEF, 0x90, 0x96, 0x18, 0x12, 0x4A, 0x88, 0xE0, -0xC4, 0x13, 0x54, 0x07, 0x30, 0xE0, 0x06, 0xEC, 0x44, 0x80, 0xFE, 0x80, 0x06, 0x7E, 0xFF, 0x80, -0x02, 0x7E, 0xFF, 0xAF, 0x06, 0x22, 0x90, 0xA5, 0x14, 0xEB, 0xF0, 0x70, 0x5F, 0x90, 0xA5, 0x14, -0xE0, 0xFE, 0x24, 0x96, 0xF5, 0x82, 0xE4, 0x34, 0x98, 0xF5, 0x83, 0xE0, 0xFC, 0x90, 0xA5, 0x15, -0xE0, 0xFB, 0xEC, 0x6B, 0x60, 0x46, 0x90, 0xA5, 0x19, 0xEB, 0xF0, 0xA3, 0xEE, 0xF0, 0xAE, 0x05, -0xEE, 0x25, 0xE0, 0x4F, 0xA3, 0xF0, 0x90, 0xA5, 0x16, 0xE0, 0x90, 0xA5, 0x1D, 0xF0, 0x90, 0xA5, -0x17, 0x74, 0x0C, 0xF0, 0x90, 0xA5, 0x25, 0x74, 0x04, 0xF0, 0x7B, 0x01, 0x7A, 0xA5, 0x79, 0x17, -0x12, 0x5F, 0xEE, 0x7F, 0x04, 0x12, 0x5D, 0xFE, 0x90, 0xA5, 0x15, 0xE0, 0xFF, 0x90, 0xA5, 0x14, -0xE0, 0x24, 0x96, 0xF5, 0x82, 0xE4, 0x34, 0x98, 0xF5, 0x83, 0xEF, 0xF0, 0x22, 0xE4, 0xFE, 0x74, -0x96, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x95, 0xF5, 0x83, 0xE0, 0xFC, 0xB4, 0x05, 0x09, 0xED, 0xC3, -0x94, 0x3B, 0x40, 0x60, 0x0E, 0x80, 0x5D, 0xEC, 0xB4, 0x04, 0x0A, 0xED, 0xC3, 0x94, 0x31, 0x40, -0x53, 0x7E, 0x01, 0x80, 0x4F, 0x74, 0x96, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x95, 0xF5, 0x83, 0xE0, -0xFC, 0xB4, 0x03, 0x0A, 0xED, 0xC3, 0x94, 0x19, 0x40, 0x3A, 0x7E, 0x01, 0x80, 0x36, 0xEC, 0xB4, -0x02, 0x0A, 0xED, 0xC3, 0x94, 0x11, 0x40, 0x2C, 0x7E, 0x01, 0x80, 0x28, 0x74, 0x96, 0x2F, 0xF5, -0x82, 0xE4, 0x34, 0x95, 0xF5, 0x83, 0xE0, 0xFC, 0xB4, 0x01, 0x0A, 0xED, 0xC3, 0x94, 0x0A, 0x40, -0x13, 0x7E, 0x01, 0x80, 0x0F, 0xEC, 0x70, 0x0A, 0xED, 0xC3, 0x94, 0x03, 0x40, 0x06, 0x7E, 0x01, -0x80, 0x02, 0xE4, 0xFE, 0xAF, 0x06, 0x22, 0x90, 0xA4, 0xE1, 0xEF, 0xF0, 0x90, 0x01, 0xC4, 0x74, -0x87, 0xF0, 0x74, 0x90, 0xA3, 0xF0, 0x90, 0xA4, 0xE1, 0xE0, 0xFF, 0x75, 0xF0, 0x10, 0x90, 0x81, -0x00, 0x12, 0x4A, 0x88, 0xE0, 0x90, 0xA4, 0xE2, 0xF0, 0xE4, 0x90, 0xA4, 0xE7, 0xF0, 0x90, 0xA4, -0xE2, 0xE0, 0xFE, 0x54, 0x7F, 0xF9, 0xA3, 0xF0, 0xEE, 0x54, 0x80, 0xFB, 0x75, 0xF0, 0x04, 0xEF, -0x90, 0x96, 0x16, 0x12, 0x4A, 0x88, 0xE0, 0x90, 0xA4, 0xE5, 0xF0, 0x90, 0xA4, 0xE1, 0xE0, 0xFA, -0x75, 0xF0, 0x04, 0x90, 0x96, 0x19, 0x12, 0x4A, 0x88, 0xE0, 0xFF, 0xC4, 0x54, 0x03, 0x90, 0xA4, -0xE6, 0xF0, 0x75, 0xF0, 0x04, 0xE9, 0x90, 0x42, 0xDD, 0x12, 0x4A, 0x88, 0x12, 0x4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0, 0xF5, 0x19, 0xE5, 0x19, -0xC3, 0x94, 0x80, 0x50, 0x2E, 0xE5, 0x19, 0x94, 0x1B, 0x40, 0x05, 0x90, 0xA4, 0xD4, 0x80, 0x15, -0x90, 0xA4, 0xD4, 0xE0, 0x25, 0x19, 0xFF, 0xE4, 0x33, 0xFE, 0xD3, 0xEF, 0x94, 0x1B, 0xEE, 0x64, -0x80, 0x94, 0x80, 0x40, 0x05, 0x74, 0x1B, 0xF0, 0x80, 0x24, 0x90, 0xA4, 0xD4, 0xE0, 0x25, 0x19, -0xF0, 0x80, 0x1B, 0xC3, 0xE4, 0x95, 0x19, 0xF5, 0x19, 0x90, 0xA4, 0xD4, 0xE0, 0xFF, 0xD3, 0x95, -0x19, 0x40, 0x06, 0xEF, 0x95, 0x19, 0xF0, 0x80, 0x05, 0xE4, 0x90, 0xA4, 0xD4, 0xF0, 0x90, 0xA4, -0xD4, 0xE0, 0x75, 0xF0, 0x06, 0xA4, 0x24, 0x3F, 0xF9, 0x74, 0x41, 0x35, 0xF0, 0x75, 0x10, 0xFF, -0xF5, 0x11, 0x89, 0x12, 0x90, 0xA4, 0xC9, 0xE0, 0x90, 0x45, 0x35, 0x93, 0xFF, 0xD3, 0x90, 0xA4, -0xCF, 0xE0, 0x9F, 0x90, 0xA4, 0xCE, 0xE0, 0x94, 0x00, 0x40, 0x06, 0x12, 0x89, 0x02, 0x02, 0x9D, -0xE4, 0xC3, 0x90, 0xA4, 0xCD, 0xE0, 0x94, 0x0F, 0x90, 0xA4, 0xCC, 0xE0, 0x94, 0x00, 0x50, 0x67, -0xAB, 0x13, 0xAA, 0x14, 0xA9, 0x15, 0x90, 0x00, 0x06, 0x12, 0x49, 0xE0, 0xFF, 0xAE, 0xF0, 0x90, -0x00, 0x08, 0x12, 0x49, 0xE0, 0x2F, 0xFD, 0xE5, 0xF0, 0x3E, 0xFC, 0x90, 0xA4, 0xCC, 0xE0, 0xC3, -0x13, 0xFE, 0xA3, 0xE0, 0x13, 0xFF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00, 0x12, 0x26, 0x37, 0xFD, 0x7C, 0x00, 0x12, 0x26, 0x98, 0xEF, -0x25, 0x17, 0xF5, 0x17, 0xEE, 0x35, 0x16, 0xF5, 0x16, 0x90, 0xA4, 0xE0, 0xE0, 0x04, 0xF0, 0xE0, -0xB4, 0x05, 0xAB, 0xAB, 0x10, 0xAA, 0x11, 0xA9, 0x12, 0x90, 0x00, 0x05, 0x12, 0x26, 0x37, 0xFD, -0x7C, 0x00, 0x90, 0xA4, 0xD6, 0xE0, 0xFF, 0x90, 0xA4, 0xCC, 0xE0, 0xFE, 0xA3, 0xE0, 0xA8, 0x07, -0x08, 0x80, 0x05, 0xCE, 0xC3, 0x13, 0xCE, 0x13, 0xD8, 0xF9, 0xFF, 0x12, 0x26, 0x98, 0xD3, 0xE5, -0x17, 0x9F, 0xE5, 0x16, 0x9E, 0x40, 0x0C, 0xE5, 0x17, 0x9F, 0xF5, 0x17, 0xE5, 0x16, 0x9E, 0xF5, -0x16, 0x80, 0x05, 0xE4, 0xF5, 0x16, 0xF5, 0x17, 0x74, 0xA6, 0x25, 0x0F, 0xF5, 0x82, 0xE4, 0x34, -0x9B, 0xF5, 0x83, 0xE0, 0x60, 0x10, 0x74, 0xA6, 0x25, 0x0F, 0xF5, 0x82, 0xE4, 0x34, 0x9B, 0xF5, -0x83, 0xE0, 0x14, 0xF0, 0x41, 0x68, 0xE5, 0x0F, 0x25, 0xE0, 0x24, 0x95, 0xF5, 0x82, 0xE4, 0x34, -0x94, 0xF5, 0x83, 0xE5, 0x16, 0xF0, 0xA3, 0xE5, 0x17, 0xF0, 0xAE, 0x16, 0xAF, 0x17, 0xE4, 0xFC, -0xFD, 0x90, 0xA4, 0xCA, 0xE0, 0x75, 0xF0, 0x04, 0x90, 0x42, 0xDD, 0x12, 0x4A, 0x88, 0x12, 0x4A, -0x78, 0xC3, 0x12, 0x4A, 0x3F, 0x40, 0x02, 0x41, 0x4A, 0x74, 0x11, 0x25, 0x0F, 0xF5, 0x82, 0x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x87, 0x80, 0x1E, 0x90, 0xA4, 0xCA, 0xE0, 0x25, 0xE0, -0x24, 0x2D, 0xF5, 0x82, 0xE4, 0x34, 0x44, 0xF5, 0x83, 0xD3, 0x74, 0x01, 0x93, 0x95, 0x17, 0xE4, -0x93, 0x95, 0x16, 0x40, 0x03, 0x12, 0x89, 0x02, 0xE5, 0x0F, 0x25, 0xE0, 0x24, 0x95, 0xF5, 0x82, -0xE4, 0x34, 0x94, 0xF5, 0x83, 0xA3, 0xE0, 0x90, 0xA5, 0x16, 0xF0, 0x90, 0xA4, 0xC9, 0xE0, 0x90, -0xA5, 0x15, 0xF0, 0xAB, 0x0F, 0xE4, 0xFD, 0xFF, 0x12, 0x8F, 0xA6, 0xE4, 0xF5, 0x16, 0xF5, 0x17, -0xA1, 0xB8, 0x74, 0xA6, 0x25, 0x0F, 0xF5, 0x82, 0xE4, 0x34, 0x9F, 0xF5, 0x83, 0xE0, 0xFB, 0x64, -0x05, 0x60, 0x02, 0x81, 0x1C, 0x90, 0xA4, 0xCA, 0xE0, 0xFD, 0xAF, 0x0F, 0x12, 0x90, 0x0D, 0x74, -0x16, 0x25, 0x0F, 0xF5, 0x82, 0xE4, 0x34, 0x9A, 0xF5, 0x83, 0xEF, 0xF0, 0x75, 0xF0, 0x10, 0xE5, -0x0F, 0x90, 0x81, 0x01, 0x12, 0x4A, 0x88, 0xE0, 0x54, 0x07, 0x90, 0xA4, 0xD9, 0xF0, 0x74, 0x96, -0x25, 0x0F, 0xF5, 0x82, 0xE4, 0x34, 0x99, 0xF5, 0x83, 0xE0, 0xFF, 0xC3, 0x94, 0x30, 0x50, 0x13, -0xE4, 0x90, 0xA4, 0xD9, 0xF0, 0x74, 0xA6, 0x25, 0x0F, 0xF5, 0x82, 0xE4, 0x34, 0x9F, 0xF5, 0x83, -0xE4, 0x61, 0x99, 0x74, 0x16, 0x25, 0x0F, 0xF5, 0x82, 0xE4, 0x34, 0x9A, 0xF5, 0x83, 0xE0, 0x64, -0x01, 0x60, 0x02, 0x61, 0xC2, 0x74, 0x26, 0x25, 0x0F, 0xF5, 0x82, 0xE4, 0x34, 0x9C, 0xF5, 0x83, -0xE0, 0x64, 0x0A, 0x60, 0x51, 0xEF, 0x24, 0x05, 0xFF, 0xE4, 0x33, 0xFE, 0x74, 0x81, 0x25, 0x0F, -0xF5, 0x82, 0xE4, 0x34, 0x93, 0xF5, 0x83, 0xE0, 0xFD, 0xD3, 0x9F, 0xEE, 0x64, 0x80, 0xF8, 0x74, -0x80, 0x98, 0x50, 0x32, 0xED, 0x24, 0x05, 0xFF, 0xE4, 0x33, 0xFE, 0x74, 0x96, 0x25, 0x0F, 0xF5, -0x82, 0xE4, 0x34, 0x99, 0xF5, 0x83, 0xE0, 0xD3, 0x9F, 0xEE, 0x64, 0x80, 0xF8, 0x74, 0x80, 0x98, -0x50, 0x14, 0x74, 0x26, 0x25, 0x0F, 0xF5, 0x82, 0xE4, 0x34, 0xA0, 0xF5, 0x83, 0xE0, 0xFF, 0x90, -0xA4, 0xCA, 0xE0, 0x6F, 0x60, 0x3F, 0x90, 0xA4, 0xD9, 0xE0, 0xFF, 0x70, 0x04, 0x04, 0xF0, 0x80, -0x0F, 0xEF, 0x90, 0xA4, 0xD9, 0xB4, 0x01, 0x05, 0x74, 0x03, 0xF0, 0x80, 0x03, 0x74, 0x05, 0xF0, -0x74, 0x96, 0x25, 0x0F, 0xF5, 0x82, 0xE4, 0x34, 0x99, 0xF5, 0x83, 0xE0, 0xFF, 0x74, 0x81, 0x25, -0x0F, 0xF5, 0x82, 0xE4, 0x34, 0x93, 0xF5, 0x83, 0xEF, 0xF0, 0x74, 0x26, 0x25, 0x0F, 0xF5, 0x82, -0xE4, 0x34, 0x9C, 0x80, 0x2B, 0x74, 0xA6, 0x25, 0x0F, 0xF5, 0x82, 0xE4, 0x34, 0x9F, 0xF5, 0x83, -0xE4, 0xF0, 0x74, 0x26, 0x25, 0x0F, 0xF5, 0x82, 0xE4, 0x34, 0x9C, 0xF5, 0x83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4A, 0x6C, 0xD3, -0x12, 0x4A, 0x3F, 0x90, 0x94, 0x91, 0x50, 0x19, 0x12, 0x4A, 0x6C, 0x90, 0xA4, 0xD2, 0xE0, 0xFE, -0xA3, 0xE0, 0xFF, 0xE4, 0xFC, 0xFD, 0x12, 0x4A, 0x18, 0x90, 0x94, 0x91, 0x12, 0x27, 0x48, 0x80, -0x07, 0x12, 0x27, 0x54, 0xFF, 0xFF, 0xFF, 0xFF, 0xE4, 0xFD, 0xAF, 0x0F, 0x12, 0x8E, 0xDA, 0x05, -0x0F, 0xE5, 0x0F, 0xC3, 0x94, 0x80, 0x50, 0x03, 0x02, 0x94, 0xF7, 0x22, 0xD3, 0x10, 0xAF, 0x01, -0xC3, 0xC0, 0xD0, 0x8F, 0x75, 0x75, 0xF0, 0x04, 0xEF, 0x90, 0x96, 0x18, 0x12, 0x4A, 0x88, 0xE0, -0x54, 0x1F, 0x90, 0xA5, 0x86, 0xF0, 0x24, 0xF1, 0x50, 0x02, 0xE1, 0x7E, 0xE4, 0xF5, 0x76, 0x75, -0xF0, 0x08, 0xE5, 0x75, 0x90, 0x89, 0x00, 0x12, 0x4A, 0x88, 0xE5, 0x82, 0x25, 0x76, 0xF5, 0x82, -0xE4, 0x35, 0x83, 0xF5, 0x83, 0xE0, 0xFF, 0x90, 0xA5, 0x86, 0xE0, 0x75, 0xF0, 0x07, 0xA4, 0x24, -0x50, 0xF5, 0x82, 0xE4, 0x34, 0x40, 0xF5, 0x83, 0xE5, 0x82, 0x25, 0x76, 0xF5, 0x82, 0xE4, 0x35, -0x83, 0xF5, 0x83, 0xE4, 0x93, 0xFE, 0xEF, 0x5E, 0x90, 0xA5, 0x88, 0xF0, 0x75, 0xF0, 0x04, 0xE5, -0x75, 0x90, 0x96, 0x19, 0x12, 0x4A, 0x88, 0xE0, 0x54, 0x03, 0xFF, 0xBF, 0x02, 0x0B, 0xE5, 0x76, -0x70, 0x07, 0x90, 0xA5, 0x88, 0xE0, 0x54, 0xF0, 0xF0, 0x90, 0xA5, 0x88, 0xE0, 0xFF, 0x75, 0xF0, -0x08, 0xE5, 0x75, 0x90, 0x89, 0x00, 0x12, 0x4A, 0x88, 0xE5, 0x82, 0x25, 0x76, 0xF5, 0x82, 0xE4, -0x35, 0x83, 0xF5, 0x83, 0xEF, 0xF0, 0x05, 0x76, 0xE5, 0x76, 0x64, 0x07, 0x70, 0x81, 0x75, 0xF0, -0x04, 0xE5, 0x75, 0x90, 0x96, 0x19, 0x12, 0x4A, 0x88, 0xE0, 0xFF, 0xC4, 0x54, 0x03, 0xFD, 0xE4, -0x90, 0xA5, 0x84, 0xF0, 0x7C, 0x06, 0x75, 0xF0, 0x08, 0xE5, 0x75, 0x90, 0x89, 0x00, 0xBC, 0x06, -0x12, 0x12, 0x4A, 0x88, 0xE5, 0x82, 0x2C, 0xF5, 0x82, 0xE4, 0x35, 0x83, 0xF5, 0x83, 0xE0, 0x54, -0x0F, 0x80, 0x0E, 0x12, 0x4A, 0x88, 0xE5, 0x82, 0x2C, 0xF5, 0x82, 0xE4, 0x35, 0x83, 0xF5, 0x83, -0xE0, 0x90, 0xA5, 0x87, 0xF0, 0x90, 0xA5, 0x87, 0xE0, 0x60, 0x40, 0x75, 0x76, 0x07, 0x74, 0x01, -0x7E, 0x00, 0xA8, 0x76, 0x08, 0x80, 0x05, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, 0xF9, 0xFF, 0x90, -0xA5, 0x87, 0xE0, 0xFB, 0xEF, 0x5B, 0x60, 0x1A, 0xEC, 0x75, 0xF0, 0x08, 0xA4, 0x25, 0x76, 0x90, -0xA5, 0x84, 0xF0, 0xED, 0x60, 0x1F, 0xE0, 0xD3, 0x94, 0x0B, 0x40, 0x19, 0xE0, 0x24, 0x20, 0xF0, -0x80, 0x13, 0x15, 0x76, 0xE5, 0x76, 0xC3, 0x94, 0x00, 0x50, 0xC3, 0xEC, 0x60, 0x07, 0x1C, 0xEC, -0xC3, 0x94, 0x00, 0x50, 0x81, 0xE4, 0x90, 0xA5, 0x85, 0xF0, 0xFC, 0x75, 0xF0, 0x08, 0xE5, 0x75, -0x90, 0x89, 0x00, 0xBC, 0x06, 0x12, 0x12, 0x4A, 0x88, 0xE5, 0x82, 0x2C, 0xF5, 0x82, 0xE4, 0x35, -0x83, 0xF5, 0x83, 0xE0, 0x54, 0x0F, 0x80, 0x0E, 0x12, 0x4A, 0x88, 0xE5, 0x82, 0x2C, 0xF5, 0x82, -0xE4, 0x35, 0x83, 0xF5, 0x83, 0xE0, 0x90, 0xA5, 0x87, 0xF0, 0x90, 0xA5, 0x87, 0xE0, 0x60, 0x3E, -0xE4, 0xF5, 0x76, 0x74, 0x01, 0x7E, 0x00, 0xA8, 0x76, 0x08, 0x80, 0x05, 0xC3, 0x33, 0xCE, 0x33, -0xCE, 0xD8, 0xF9, 0xFF, 0x90, 0xA5, 0x87, 0xE0, 0xFB, 0xEF, 0x5B, 0x60, 0x1A, 0xEC, 0x75, 0xF0, -0x08, 0xA4, 0x25, 0x76, 0x90, 0xA5, 0x85, 0xF0, 0xED, 0x60, 0x19, 0xE0, 0xD3, 0x94, 0x0B, 0x40, -0x13, 0xE0, 0x24, 0x20, 0xF0, 0x80, 0x0D, 0x05, 0x76, 0xE5, 0x76, 0xB4, 0x08, 0xC5, 0x0C, 0xEC, -0x64, 0x07, 0x70, 0x87, 0x90, 0xA5, 0x84, 0xE0, 0xFF, 0x75, 0xF0, 0x04, 0xE5, 0x75, 0x90, 0x96, -0x16, 0x12, 0x4A, 0x88, 0xEF, 0xF0, 0x90, 0xA5, 0x85, 0xE0, 0xFE, 0x75, 0xF0, 0x04, 0xE5, 0x75, -0x90, 0x96, 0x17, 0x12, 0x4A, 0x88, 0xEE, 0xF0, 0x75, 0xF0, 0x10, 0xE5, 0x75, 0x90, 0x81, 0x00, -0x12, 0x4A, 0x88, 0xE0, 0xFC, 0x54, 0x7F, 0xFD, 0xEC, 0x54, 0x80, 0xFC, 0xED, 0xD3, 0x9F, 0x40, -0x05, 0x90, 0xA5, 0x84, 0x80, 0x08, 0xED, 0xC3, 0x9E, 0x50, 0x06, 0x90, 0xA5, 0x85, 0xE0, 0x4C, -0xFD, 0x74, 0x26, 0x25, 0x75, 0xF5, 0x82, 0xE4, 0x34, 0xA0, 0xF5, 0x83, 0xED, 0xF0, 0x75, 0xF0, -0x04, 0xE5, 0x75, 0x90, 0x96, 0x19, 0x12, 0x4A, 0x88, 0xE0, 0x13, 0x13, 0x54, 0x03, 0x90, 0xA5, -0x5D, 0xF0, 0xE4, 0xFB, 0xAF, 0x75, 0x12, 0x8C, 0xAC, 0x75, 0xF0, 0x10, 0xE5, 0x75, 0x90, 0x81, -0x03, 0x12, 0x4A, 0x88, 0xE4, 0xF0, 0x90, 0xA5, 0x84, 0xE0, 0xFF, 0xC3, 0x94, 0x36, 0x40, 0x10, -0x74, 0x96, 0x25, 0x75, 0xF5, 0x82, 0xE4, 0x34, 0x95, 0xF5, 0x83, 0x74, 0x05, 0xF0, 0x80, 0x6A, -0xEF, 0xC3, 0x94, 0x2C, 0x40, 0x10, 0x74, 0x96, 0x25, 0x75, 0xF5, 0x82, 0xE4, 0x34, 0x95, 0xF5, -0x83, 0x74, 0x04, 0xF0, 0x80, 0x54, 0x90, 0xA5, 0x84, 0xE0, 0xFF, 0xC3, 0x94, 0x14, 0x40, 0x10, -0x74, 0x96, 0x25, 0x75, 0xF5, 0x82, 0xE4, 0x34, 0x95, 0xF5, 0x83, 0x74, 0x03, 0xF0, 0x80, 0x3A, -0xEF, 0xC3, 0x94, 0x0C, 0x40, 0x10, 0x74, 0x96, 0x25, 0x75, 0xF5, 0x82, 0xE4, 0x34, 0x95, 0xF5, -0x83, 0x74, 0x02, 0xF0, 0x80, 0x24, 0x90, 0xA5, 0x84, 0xE0, 0xC3, 0x94, 0x04, 0x74, 0x96, 0x40, -0x0E, 0x25, 0x75, 0xF5, 0x82, 0xE4, 0x34, 0x95, 0xF5, 0x83, 0x74, 0x01, 0xF0, 0x80, 0x0B, 0x25, -0x75, 0xF5, 0x82, 0xE4, 0x34, 0x95, 0xF5, 0x83, 0xE4, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, -0xA4, 0xCC, 0x12, 0x4A, 0x9D, 0x12, 0x26, 0x1E, 0x54, 0x7F, 0x90, 0xA4, 0xCF, 0xF0, 0x90, 0x00, -0x01, 0x12, 0x26, 0x37, 0xFF, 0x54, 0x1F, 0x90, 0xA4, 0xD1, 0xF0, 0xEF, 0x54, 0x80, 0xC4, 0x13, -0x13, 0x13, 0x54, 0x01, 0x90, 0xA4, 0xD0, 0xF0, 0x90, 0x00, 0x02, 0x12, 0x26, 0x37, 0xFF, 0x54, -0x03, 0x90, 0xA4, 0xD2, 0xF0, 0xEF, 0x54, 0x30, 0xC4, 0x54, 0x0F, 0x90, 0xA4, 0xD5, 0xF0, 0x90, -0x00, 0x02, 0x12, 0x26, 0x37, 0xFF, 0x54, 0x40, 0xC4, 0x13, 0x13, 0x54, 0x03, 0x90, 0xA4, 0xD3, -0xF0, 0xEF, 0x54, 0x80, 0xC4, 0x13, 0x13, 0x13, 0x54, 0x01, 0xA3, 0xF0, 0x90, 0x00, 0x02, 0x12, -0x26, 0x37, 0xFF, 0x54, 0x08, 0xFE, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x90, 0xA4, 0xD6, 0xF0, 0xEF, -0x54, 0x04, 0x13, 0x13, 0x54, 0x3F, 0xA3, 0xF0, 0x90, 0xA4, 0x37, 0xE0, 0xB4, 0x02, 0x0B, 0x90, -0xA4, 0xD5, 0xE0, 0x60, 0x05, 0xE4, 0xFF, 0x12, 0x4F, 0xF3, 0x90, 0xA4, 0x38, 0xE0, 0xB4, 0x01, -0x1D, 0x90, 0xA4, 0xCC, 0x12, 0x4A, 0x94, 0x90, 0x00, 0x05, 0x12, 0x26, 0x37, 0x54, 0xF0, 0x70, -0x08, 0x90, 0x00, 0x06, 0x12, 0x26, 0x37, 0x60, 0x05, 0x7F, 0x01, 0x12, 0x4F, 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-0x16, 0x25, 0x0F, 0xF5, 0x82, 0xE4, 0x34, 0x99, 0xF5, 0x83, 0xC0, 0x83, 0xC0, 0x82, 0xE0, 0xFF, -0x90, 0xA4, 0xCC, 0x12, 0x4A, 0x94, 0x90, 0x00, 0x03, 0x12, 0x26, 0x37, 0x54, 0x02, 0xFE, 0xEF, -0x4E, 0xD0, 0x82, 0xD0, 0x83, 0xF0, 0x74, 0x16, 0x25, 0x0F, 0xF5, 0x82, 0xE4, 0x34, 0x99, 0xF5, -0x83, 0xC0, 0x83, 0xC0, 0x82, 0xE0, 0xFF, 0x90, 0xA4, 0xCC, 0x12, 0x4A, 0x94, 0x90, 0x00, 0x03, -0x12, 0x26, 0x37, 0x54, 0x40, 0xFE, 0xEF, 0x4E, 0xD0, 0x82, 0xD0, 0x83, 0xF0, 0xE5, 0x0F, 0xC3, -0x94, 0x80, 0x50, 0x15, 0x90, 0x00, 0x02, 0x12, 0x26, 0x37, 0xFF, 0x74, 0x96, 0x25, 0x0F, 0xF5, -0x82, 0xE4, 0x34, 0x99, 0xF5, 0x83, 0xEF, 0xF0, 0x22, 0xE5, 0x0F, 0xB4, 0x80, 0x0A, 0x90, 0x00, -0x02, 0x12, 0x26, 0x37, 0x90, 0x95, 0x95, 0xF0, 0x22, 0x12, 0x26, 0x1E, 0x90, 0xA4, 0xCC, 0xF0, -0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0x90, 0xA4, 0xCD, 0xF0, 0x90, 0x00, 0x02, 0x12, 0x26, 0x37, -0x54, 0x01, 0xFF, 0x60, 0x68, 0x90, 0xA4, 0xCC, 0xE0, 0xD3, 0x94, 0x80, 0x40, 0x5F, 0xA3, 0xE0, -0xD3, 0x94, 0x80, 0x40, 0x58, 0x90, 0xA4, 0xD0, 0xEF, 0xF0, 0x90, 0x94, 0x91, 0x12, 0x4A, 0x50, -0x90, 0xA4, 0xD1, 0xEF, 0xF0, 0x90, 0x94, 0x91, 0x12, 0x4A, 0x50, 0x78, 0x08, 0x12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, 0x0E, 0xB4, 0x03, 0x1E, -0xFF, 0xE5, 0x0D, 0xC4, 0x54, 0xF0, 0x24, 0x80, 0xF5, 0x82, 0xE4, 0x34, 0x80, 0xF5, 0x83, 0xE5, -0x82, 0x2F, 0xF5, 0x82, 0xE4, 0x35, 0x83, 0xF5, 0x83, 0x74, 0x40, 0xF0, 0x80, 0x1B, 0xE5, 0x0D, -0xC4, 0x54, 0xF0, 0x24, 0x80, 0xF5, 0x82, 0xE4, 0x34, 0x80, 0xF5, 0x83, 0xE5, 0x82, 0x25, 0x0E, -0xF5, 0x82, 0xE4, 0x35, 0x83, 0xF5, 0x83, 0xE4, 0xF0, 0x05, 0x0E, 0xE5, 0x0E, 0xB4, 0x10, 0xBB, -0x05, 0x0D, 0xE5, 0x0D, 0xB4, 0x08, 0xB1, 0x22, 0x7F, 0xB4, 0x7E, 0x0C, 0x90, 0xA5, 0x39, 0xEE, -0xF0, 0xA3, 0xEF, 0xF0, 0x12, 0x36, 0xCE, 0x90, 0xA5, 0x43, 0x12, 0x27, 0x48, 0x90, 0xA5, 0x3B, -0x12, 0x4A, 0x50, 0x12, 0x27, 0x15, 0x90, 0xA5, 0x43, 0x12, 0x4A, 0x6C, 0x12, 0x4A, 0x25, 0xC0, -0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xA5, 0x3B, 0x12, 0x4A, 0x50, 0x90, 0xA5, 0x3F, -0x12, 0x4A, 0x6C, 0x12, 0x4A, 0x25, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0x12, 0x4A, -0x32, 0x90, 0xA5, 0x47, 0x12, 0x27, 0x48, 0x90, 0xA5, 0x47, 0x12, 0x4A, 0x50, 0x90, 0xAC, 0xB9, -0x12, 0x27, 0x48, 0x90, 0xA5, 0x39, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x02, 0x37, 0x5D, 0x90, 0xA5, -0xAA, 0xED, 0xF0, 0x90, 0xA5, 0xA9, 0xEF, 0xF0, 0x70, 0x75, 0x90, 0xA5, 0x3B, 0x12, 0x27, 0x54, -0x30, 0x00, 0x00, 0x00, 0x90, 0xA5, 0x3F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x74, 0x08, -0xFF, 0xFE, 0xD1, 0x3C, 0x90, 0xA5, 0x3B, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x0E, 0x90, 0xA5, -0x3F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x08, 0x7F, 0x30, 0x7E, 0x08, 0xD1, 0x3C, 0x90, 0xA5, -0x3B, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x03, 0x90, 0xA5, 0x3F, 0x12, 0x27, 0x54, 0x00, 0x00, -0x00, 0x01, 0x12, 0xAB, 0xBC, 0x90, 0xA5, 0x3B, 0x12, 0x27, 0x54, 0x30, 0x00, 0x00, 0x00, 0x90, -0xA5, 0x3F, 0x12, 0x27, 0x54, 0x30, 0x00, 0x00, 0x00, 0x74, 0x08, 0xFF, 0xFE, 0xD1, 0x3C, 0x90, -0x04, 0x54, 0xE0, 0x54, 0x7F, 0x90, 0xA5, 0xAB, 0xF0, 0xE0, 0x90, 0x04, 0x54, 0xF0, 0x22, 0x90, -0xA5, 0xA9, 0xE0, 0x64, 0x01, 0x70, 0x74, 0x90, 0x04, 0x54, 0xE0, 0x44, 0x80, 0x90, 0xA5, 0xAB, -0xF0, 0xE0, 0x90, 0x04, 0x54, 0xF0, 0x90, 0xA5, 0x3B, 0x12, 0x27, 0x54, 0x30, 0x00, 0x00, 0x00, -0x90, 0xA5, 0x3F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x74, 0x08, 0xFF, 0xFE, 0xD1, 0x3C, -0x90, 0xA5, 0x3B, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x0E, 0x90, 0xA5, 0x3F, 0x12, 0x27, 0x54, -0x00, 0x00, 0x00, 0x06, 0x7F, 0x30, 0x7E, 0x08, 0xD1, 0x3C, 0x90, 0xA5, 0x3B, 0x12, 0x27, 0x54, -0x00, 0x00, 0x00, 0x03, 0x90, 0xA5, 0x3F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x02, 0x12, 0xAB, -0xBC, 0x90, 0xA5, 0x3B, 0x12, 0x27, 0x54, 0x30, 0x00, 0x00, 0x00, 0x90, 0xA5, 0x3F, 0x12, 0x27, -0x54, 0x20, 0x00, 0x00, 0x00, 0x74, 0x08, 0xFF, 0xFE, 0xD1, 0x3C, 0x22, 0x90, 0xA5, 0xBF, 0xED, -0xF0, 0x90, 0xA5, 0xBE, 0xEF, 0xF0, 0xD3, 0x94, 0x0E, 0x50, 0x17, 0x12, 0xAB, 0xB0, 0xEF, 0x60, -0x2C, 0x12, 0xAB, 0xB0, 0xEF, 0x64, 0x01, 0x70, 0x24, 0x90, 0xA5, 0xBF, 0xE0, 0xFD, 0xE4, 0xFF, -0x80, 0x16, 0x90, 0xA5, 0xBE, 0xE0, 0xD3, 0x94, 0x0E, 0x40, 0x12, 0x12, 0xAB, 0xB0, 0xEF, 0x70, -0x09, 0x90, 0xA5, 0xBF, 0xE0, 0xFD, 0x7F, 0x01, 0xC1, 0x9E, 0x12, 0xAB, 0xB0, 0x22, 0x90, 0xA5, -0xBC, 0xEF, 0xF0, 0xA3, 0xED, 0xF0, 0x90, 0x00, 0xF1, 0xE0, 0x54, 0xF0, 0x64, 0x20, 0x60, 0x03, -0x02, 0xA8, 0xC3, 0x90, 0xA5, 0xBD, 0xE0, 0xB4, 0x01, 0x1D, 0x90, 0xA5, 0xBC, 0xE0, 0xB4, 0x0B, -0x16, 0x90, 0xA5, 0x3B, 0x12, 0x27, 0x54, 0x00, 0x00, 0x0C, 0x00, 0x90, 0xA5, 0x3F, 0x12, 0x27, -0x54, 0x00, 0x00, 0x0C, 0x00, 0x80, 0x14, 0x90, 0xA5, 0x3B, 0x12, 0x27, 0x54, 0x00, 0x00, 0x0C, -0x00, 0x90, 0xA5, 0x3F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x08, 0x00, 0x7F, 0xAC, 0x7E, 0x08, 0x12, -0xA6, 0x3C, 0x90, 0xA5, 0xBD, 0xE0, 0x70, 0x2A, 0x90, 0xA5, 0xBC, 0xE0, 0xFF, 0x64, 0x0D, 0x60, -0x04, 0xEF, 0xB4, 0x0E, 0x1D, 0x90, 0xA5, 0x3B, 0x12, 0x27, 0x54, 0x00, 0x00, 0x03, 0x00, 0x90, -0xA5, 0x3F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x03, 0x00, 0x7F, 0xAC, 0x7E, 0x08, 0x12, 0xA6, 0x3C, -0x80, 0x0E, 0x90, 0xA5, 0xBD, 0xE0, 0xB4, 0x01, 0x1D, 0x90, 0xA5, 0xBC, 0xE0, 0xB4, 0x0B, 0x16, -0x90, 0xA5, 0x3B, 0x12, 0x27, 0x54, 0x40, 0x00, 0x00, 0x00, 0x90, 0xA5, 0x3F, 0x12, 0x27, 0x54, -0x40, 0x00, 0x00, 0x00, 0x80, 0x39, 0x90, 0xA5, 0xBD, 0xE0, 0x64, 0x02, 0x70, 0x02, 0x21, 0x12, -0x90, 0xA5, 0x3B, 0x12, 0x27, 0x54, 0x00, 0x00, 0x03, 0x00, 0x90, 0xA5, 0x3F, 0x12, 0x27, 0x54, -0x00, 0x00, 0x02, 0x00, 0x7F, 0xAC, 0x7E, 0x08, 0x12, 0xA6, 0x3C, 0x90, 0xA5, 0x3B, 0x12, 0x27, -0x54, 0x40, 0x00, 0x00, 0x00, 0x90, 0xA5, 0x3F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7F, -0xC4, 0x80, 0x4A, 0x90, 0xA5, 0xBD, 0xE0, 0x70, 0x25, 0x90, 0xA5, 0xBC, 0xE0, 0xFF, 0x64, 0x0D, -0x60, 0x04, 0xEF, 0xB4, 0x0E, 0x18, 0x90, 0xA5, 0x3B, 0x12, 0x27, 0x54, 0x00, 0x00, 0x03, 0x00, -0x90, 0xA5, 0x3F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x03, 0x00, 0x7F, 0xAC, 0x80, 0x1F, 0x90, 0xA5, -0xBC, 0xE0, 0xD3, 0x94, 0x0E, 0x50, 0x1B, 0x90, 0xA5, 0x3B, 0x12, 0x27, 0x54, 0x00, 0x00, 0x03, -0x00, 0x90, 0xA5, 0x3F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x02, 0x00, 0x7F, 0xAC, 0x7E, 0x08, 0x12, -0xA6, 0x3C, 0x22, 0x90, 0xA5, 0x8A, 0xED, 0xF0, 0xA3, 0xEB, 0xF0, 0x90, 0xA5, 0x89, 0xEF, 0xF0, -0x90, 0xA5, 0x8C, 0xE0, 0xFD, 0x12, 0xA7, 0x9C, 0x90, 0xA5, 0x89, 0xE0, 0xC3, 0x94, 0x0E, 0x50, -0x48, 0x90, 0xA5, 0x3B, 0x12, 0x27, 0x54, 0x1F, 0xFE, 0x00, 0x00, 0x90, 0xA5, 0x3F, 0x12, 0x27, -0x54, 0x12, 0xD4, 0x00, 0x00, 0x7F, 0x60, 0x7E, 0x08, 0x12, 0xA6, 0x3C, 0x90, 0xA5, 0x29, 0x12, -0x27, 0x54, 0x00, 0x07, 0x03, 0x00, 0x90, 0xA5, 0x2D, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, -0x12, 0x67, 0x1E, 0x90, 0xA5, 0x29, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0x00, 0x90, 0xA5, 0x2D, -0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x41, 0xC1, 0x90, 0xA5, 0x89, 0xE0, 0xFF, 0x74, 0x24, -0xD3, 0x9F, 0x50, 0x1B, 0xEF, 0x94, 0x30, 0x50, 0x16, 0x90, 0xA5, 0x3B, 0x12, 0x27, 0x54, 0x1F, -0xFE, 0x00, 0x00, 0x90, 0xA5, 0x3F, 0x12, 0x27, 0x54, 0x09, 0x28, 0x00, 0x00, 0x80, 0x6B, 0x90, -0xA5, 0x89, 0xE0, 0xFF, 0x74, 0x32, 0xD3, 0x9F, 0x50, 0x1B, 0xEF, 0x94, 0x40, 0x50, 0x16, 0x90, -0xA5, 0x3B, 0x12, 0x27, 0x54, 0x1F, 0xFE, 0x00, 0x00, 0x90, 0xA5, 0x3F, 0x12, 0x27, 0x54, 0x08, -0xA6, 0x00, 0x00, 0x80, 0x45, 0x90, 0xA5, 0x89, 0xE0, 0xFF, 0x74, 0x64, 0xD3, 0x9F, 0x50, 0x1B, -0xEF, 0x94, 0x74, 0x50, 0x16, 0x90, 0xA5, 0x3B, 0x12, 0x27, 0x54, 0x1F, 0xFE, 0x00, 0x00, 0x90, -0xA5, 0x3F, 0x12, 0x27, 0x54, 0x08, 0xA4, 0x00, 0x00, 0x80, 0x1F, 0x90, 0xA5, 0x89, 0xE0, 0xFF, -0x74, 0x76, 0xD3, 0x9F, 0x50, 0x1B, 0x90, 0xA5, 0x3B, 0x12, 0x27, 0x54, 0x1F, 0xFE, 0x00, 0x00, -0x90, 0xA5, 0x3F, 0x12, 0x27, 0x54, 0x08, 0x24, 0x00, 0x00, 0x7F, 0x60, 0x7E, 0x08, 0x12, 0xA6, -0x3C, 0x90, 0xA5, 0x89, 0xE0, 0xFF, 0x74, 0x24, 0xD3, 0x9F, 0x50, 0x32, 0xEF, 0x94, 0x40, 0x50, -0x2D, 0x90, 0xA5, 0x29, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0x00, 0x90, 0xA5, 0x2D, 0x12, 0x27, -0x54, 0x00, 0x01, 0x01, 0x00, 0x12, 0x67, 0x1E, 0x90, 0xA5, 0x29, 0x12, 0x27, 0x54, 0x00, 0x07, -0x03, 0x00, 0x90, 0xA5, 0x2D, 0x12, 0x27, 0x54, 0x00, 0x01, 0x01, 0x00, 0x80, 0x73, 0x90, 0xA5, -0x89, 0xE0, 0xFF, 0x74, 0x64, 0xD3, 0x9F, 0x50, 0x32, 0xEF, 0x94, 0x8C, 0x50, 0x2D, 0x90, 0xA5, -0x29, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0x00, 0x90, 0xA5, 0x2D, 0x12, 0x27, 0x54, 0x00, 0x03, -0x01, 0x00, 0x12, 0x67, 0x1E, 0x90, 0xA5, 0x29, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0x00, 0x90, -0xA5, 0x2D, 0x12, 0x27, 0x54, 0x00, 0x03, 0x01, 0x00, 0x80, 0x36, 0x90, 0xA5, 0x89, 0xE0, 0xFF, -0x74, 0x8C, 0xC3, 0x9F, 0x50, 0x34, 0x90, 0xA5, 0x29, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0x00, -0x90, 0xA5, 0x2D, 0x12, 0x27, 0x54, 0x00, 0x05, 0x01, 0x00, 0x12, 0x67, 0x1E, 0x90, 0xA5, 0x29, -0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0x00, 0x90, 0xA5, 0x2D, 0x12, 0x27, 0x54, 0x00, 0x05, 0x01, -0x00, 0x7D, 0x18, 0x7C, 0x00, 0x7F, 0x01, 0x12, 0x67, 0x24, 0x90, 0xA5, 0x89, 0xE0, 0xFF, 0xA3, -0xE0, 0xFD, 0x12, 0xA7, 0xDE, 0x90, 0xA5, 0x8A, 0xE0, 0x64, 0x02, 0x70, 0x66, 0x90, 0xA5, 0x89, -0xE0, 0xFF, 0xD3, 0x94, 0x30, 0x50, 0x08, 0x90, 0xA5, 0x8D, 0x74, 0x2A, 0xF0, 0x80, 0x70, 0xEF, -0xD3, 0x94, 0x40, 0x50, 0x08, 0x90, 0xA5, 0x8D, 0x74, 0x3A, 0xF0, 0x80, 0x62, 0xEF, 0xD3, 0x94, -0x70, 0x50, 0x08, 0x90, 0xA5, 0x8D, 0x74, 0x6A, 0xF0, 0x80, 0x54, 0xEF, 0xD3, 0x94, 0x80, 0x50, -0x08, 0x90, 0xA5, 0x8D, 0x74, 0x7A, 0xF0, 0x80, 0x46, 0xEF, 0xD3, 0x94, 0x90, 0x50, 0x08, 0x90, -0xA5, 0x8D, 0x74, 0x8A, 0xF0, 0x80, 0x38, 0xEF, 0xD3, 0x94, 0xA1, 0x50, 0x08, 0x90, 0xA5, 0x8D, -0x74, 0x9B, 0xF0, 0x80, 0x2A, 0xEF, 0xD3, 0x94, 0xB1, 0x50, 0x24, 0x90, 0xA5, 0x8D, 0x74, 0xAB, -0xF0, 0x80, 0x1C, 0x90, 0xA5, 0x8A, 0xE0, 0x64, 0x01, 0x70, 0x33, 0xA3, 0xE0, 0x90, 0xA5, 0x89, -0xB4, 0x01, 0x05, 0xE0, 0x24, 0x02, 0x80, 0x03, 0xE0, 0x24, 0xFE, 0x90, 0xA5, 0x8D, 0xF0, 0x90, -0xA5, 0x29, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0xFF, 0x90, 0xA5, 0x8D, 0x12, 0x67, 0x12, 0x90, -0xA5, 0x29, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0xFF, 0x90, 0xA5, 0x8D, 0x80, 0x1D, 0x90, 0xA5, -0x29, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0xFF, 0x90, 0xA5, 0x89, 0x12, 0x67, 0x12, 0x90, 0xA5, -0x29, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0xFF, 0x90, 0xA5, 0x89, 0xE0, 0xFF, 0xE4, 0xFC, 0xFD, -0xFE, 0x90, 0xA5, 0x2D, 0x12, 0x27, 0x48, 0x7D, 0x18, 0x7C, 0x00, 0x7F, 0x01, 0x02, 0x67, 0x24, -0x90, 0x04, 0x54, 0xE0, 0x7F, 0x00, 0x30, 0xE7, 0x02, 0x7F, 0x01, 0x22, 0x7F, 0x34, 0x7E, 0x08, -0x12, 0xA6, 0x3C, 0x90, 0xA5, 0xA9, 0xE0, 0xFF, 0xA3, 0xE0, 0xFD, 0x90, 0xA5, 0xC6, 0xED, 0xF0, -0xEF, 0x60, 0x02, 0x81, 0xC8, 0xE0, 0x24, 0xFD, 0x50, 0x0C, 0x60, 0x27, 0x14, 0x60, 0x41, 0x14, -0x70, 0x02, 0x81, 0x6F, 0xC1, 0xA2, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, 0x77, -0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, -0x77, 0xA1, 0x53, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x54, 0x33, 0x77, 0x70, 0x7F, 0xB0, 0x7E, -0x0C, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x54, 0x33, 0x77, 0x70, 0xA1, 0xF1, -0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, 0x77, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x37, -0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, 0x77, 0x7F, 0xB0, 0x7E, 0x0E, 0x12, -0x37, 0x5D, 0x90, 0xA5, 0x3B, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA5, 0x3F, 0x12, -0x27, 0x54, 0x00, 0x10, 0x00, 0x00, 0x12, 0xA6, 0x38, 0x90, 0xA5, 0x3B, 0x12, 0x27, 0x54, 0x3F, -0xF0, 0x00, 0x00, 0x90, 0xA5, 0x3F, 0x12, 0x27, 0x54, 0x00, 0x10, 0x00, 0x00, 0xC1, 0x9B, 0x90, -0xA5, 0x3B, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0xFF, 0x90, 0xA5, 0x3F, 0x12, 0x27, 0x54, 0x00, -0x00, 0x00, 0x77, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0xA6, 0x3C, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, -0x77, 0x77, 0x77, 0x77, 0x7F, 0xB0, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0xA5, 0x3B, 0x12, 0x27, -0x54, 0x01, 0x00, 0x00, 0x00, 0x90, 0xA5, 0x3F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x12, -0xA6, 0x38, 0x90, 0xA5, 0x3B, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA5, 0x3F, 0x12, -0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0xC1, 0x9B, 0x90, 0xA5, 0xC6, 0xE0, 0x14, 0x60, 0x69, 0x14, -0x70, 0x02, 0xA1, 0x87, 0x14, 0x70, 0x02, 0xA1, 0xD6, 0x14, 0x70, 0x02, 0xA1, 0x87, 0x14, 0x70, -0x02, 0xC1, 0x44, 0x24, 0x05, 0x60, 0x02, 0xC1, 0xA2, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, -0x33, 0x77, 0x17, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, -0x77, 0x33, 0x77, 0x17, 0x7F, 0xB0, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0xA5, 0x3B, 0x12, 0x27, -0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA5, 0x3F, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0x12, -0xA6, 0x38, 0x90, 0xA5, 0x3B, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA5, 0x3F, 0x12, -0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0xC1, 0x9B, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x33, -0x77, 0x17, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, -0x33, 0x77, 0x17, 0x7F, 0xB0, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0xA5, 0x3B, 0x12, 0x27, 0x54, -0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA5, 0x3F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x12, 0xA6, -0x38, 0x90, 0xA5, 0x3B, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA5, 0x3F, 0x12, 0x27, -0x54, 0x00, 0x00, 0x00, 0x00, 0xC1, 0x9B, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x33, 0x77, -0x77, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x33, -0x77, 0x77, 0x7F, 0xB0, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0xA5, 0x3B, 0x12, 0x27, 0x54, 0x3F, -0xF0, 0x00, 0x00, 0x90, 0xA5, 0x3F, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0x12, 0xA6, 0x38, -0x90, 0xA5, 0x3B, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA5, 0x3F, 0x12, 0x27, 0x54, -0x01, 0x00, 0x00, 0x00, 0xC1, 0x9B, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x54, 0x33, 0x77, 0x17, -0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x54, 0x33, 0x77, -0x17, 0x7F, 0xB0, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0xA5, 0x3B, 0x12, 0x27, 0x54, 0x3F, 0xF0, -0x00, 0x00, 0x90, 0xA5, 0x3F, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0x12, 0xA6, 0x38, 0x90, -0xA5, 0x3B, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA5, 0x3F, 0x12, 0x27, 0x54, 0x01, -0x00, 0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0E, 0x12, 0xA6, 0x3C, 0x90, 0xA5, 0x3B, 0x12, 0x27, 0x54, -0x00, 0x00, 0x03, 0x03, 0x90, 0xA5, 0x3F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x01, 0x7F, 0x00, -0x7E, 0x09, 0x80, 0x5B, 0x90, 0xA5, 0x3B, 0x12, 0x27, 0x54, 0x00, 0xFF, 0x00, 0x00, 0x90, 0xA5, -0x3F, 0x12, 0x27, 0x54, 0x00, 0x33, 0x00, 0x00, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0xA6, 0x3C, 0x90, -0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x33, 0x77, 0x77, 0x7F, 0xB0, 0x7E, 0x0E, 0x12, 0x37, 0x5D, -0x90, 0xA5, 0x3B, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0x90, 0xA5, 0x3F, 0x12, 0x27, 0x54, -0x01, 0x00, 0x00, 0x00, 0x12, 0xA6, 0x38, 0x90, 0xA5, 0x3B, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, -0x00, 0x90, 0xA5, 0x3F, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0E, 0x12, -0xA6, 0x3C, 0x22, 0x90, 0xA2, 0x2F, 0xE0, 0xFF, 0x7D, 0x01, 0x12, 0x6D, 0xF2, 0x90, 0xA5, 0x0A, -0xEE, 0xF0, 0xFC, 0xA3, 0xEF, 0xF0, 0xFD, 0x90, 0xA5, 0x07, 0xE0, 0xFF, 0xA3, 0xE0, 0xFB, 0xA3, -0xE0, 0x90, 0xA5, 0x11, 0xF0, 0x90, 0xA5, 0x0E, 0xEC, 0xF0, 0xA3, 0xED, 0xF0, 0xA3, 0xEB, 0xF0, -0x90, 0xA5, 0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xC1, 0xE0, 0xC4, 0x13, 0x13, 0x54, -0x03, 0x20, 0xE0, 0x03, 0x02, 0xB1, 0xB8, 0x90, 0xA3, 0xC5, 0xE0, 0x64, 0x01, 0x70, 0x35, 0x90, -0x06, 0x92, 0xE0, 0x20, 0xE2, 0x06, 0x90, 0x04, 0xE3, 0xE0, 0x60, 0x1D, 0x90, 0x06, 0x92, 0x74, -0x04, 0xF0, 0x90, 0xA3, 0xD1, 0xE0, 0x04, 0xF0, 0x90, 0xA3, 0xC6, 0xE0, 0xFF, 0x90, 0xA3, 0xD1, -0xE0, 0xB5, 0x07, 0x02, 0x80, 0x03, 0x02, 0xB1, 0x9D, 0xE4, 0x90, 0xA3, 0xC5, 0xF0, 0x90, 0xA3, -0xCF, 0x04, 0xF0, 0x22, 0x90, 0xA3, 0xC5, 0xE0, 0x64, 0x04, 0x70, 0x35, 0x90, 0x06, 0x92, 0xE0, -0x20, 0xE2, 0x06, 0x90, 0x04, 0xE3, 0xE0, 0x60, 0x1C, 0x90, 0x06, 0x92, 0x74, 0x04, 0xF0, 0x90, -0xA3, 0xD1, 0xE0, 0x04, 0xF0, 0x90, 0xA3, 0xC8, 0xE0, 0xFF, 0x90, 0xA3, 0xD1, 0xE0, 0xB5, 0x07, -0x02, 0x80, 0x02, 0x21, 0x9D, 0xE4, 0x90, 0xA3, 0xC5, 0xF0, 0x90, 0xA3, 0xCF, 0x74, 0x04, 0xF0, -0x22, 0x90, 0xA3, 0xC5, 0xE0, 0x64, 0x06, 0x60, 0x02, 0x01, 0xFC, 0x90, 0xA3, 0xD2, 0xE0, 0xB4, -0x04, 0x11, 0x90, 0xA3, 0xC0, 0xE0, 0xC4, 0x54, 0x0F, 0x90, 0xA3, 0xCF, 0x20, 0xE0, 0x02, 0x01, -0xB8, 0x21, 0x46, 0x90, 0xA3, 0xC4, 0xE0, 0xFF, 0x13, 0x13, 0x54, 0x3F, 0x30, 0xE0, 0x7D, 0xEF, -0x54, 0xFB, 0xF0, 0xE4, 0x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 0xC4, 0x13, -0x54, 0x07, 0x20, 0xE0, 0x0B, 0xEF, 0x13, 0x13, 0x54, 0x3F, 0x30, 0xE0, 0x03, 0x12, 0x6F, 0x7B, -0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0xA5, 0xC3, 0xED, 0xF0, 0x90, 0xA5, 0xC2, -0xEF, 0xF0, 0xD3, 0x94, 0x07, 0x50, 0x70, 0xE0, 0xFF, 0x74, 0x01, 0xA8, 0x07, 0x08, 0x80, 0x02, -0xC3, 0x33, 0xD8, 0xFC, 0xF4, 0xFF, 0x90, 0x00, 0x47, 0xE0, 0x5F, 0xFD, 0x7F, 0x47, 0x12, 0x3A, -0x96, 0x90, 0xA5, 0xC2, 0xE0, 0xFF, 0x74, 0x01, 0xA8, 0x07, 0x08, 0x80, 0x02, 0xC3, 0x33, 0xD8, -0xFC, 0xFF, 0x90, 0x00, 0x46, 0xE0, 0x4F, 0xFD, 0x7F, 0x46, 0x12, 0x3A, 0x96, 0x90, 0xA5, 0xC3, -0xE0, 0x60, 0x18, 0x90, 0xA5, 0xC2, 0xE0, 0xFF, 0x74, 0x01, 0xA8, 0x07, 0x08, 0x80, 0x02, 0xC3, -0x33, 0xD8, 0xFC, 0xFF, 0x90, 0x00, 0x45, 0xE0, 0x4F, 0x80, 0x17, 0x90, 0xA5, 0xC2, 0xE0, 0xFF, -0x74, 0x01, 0xA8, 0x07, 0x08, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0xF4, 0xFF, 0x90, 0x00, 0x45, -0xE0, 0x5F, 0xFD, 0x7F, 0x45, 0x80, 0x7E, 0x90, 0xA5, 0xC2, 0xE0, 0x24, 0xF8, 0xF0, 0xE0, 0x24, -0x04, 0xFF, 0x74, 0x01, 0xA8, 0x07, 0x08, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0xF4, 0xFF, 0x90, -0x00, 0x43, 0xE0, 0x5F, 0xFD, 0x7F, 0x43, 0x12, 0x3A, 0x96, 0x90, 0xA5, 0xC2, 0xE0, 0xFF, 0x74, -0x01, 0xA8, 0x07, 0x08, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0xFF, 0x90, 0x00, 0x43, 0xE0, 0x4F, -0xFD, 0x7F, 0x43, 0x12, 0x3A, 0x96, 0x90, 0xA5, 0xC3, 0xE0, 0x60, 0x1D, 0x90, 0xA5, 0xC2, 0xE0, -0x24, 0x04, 0xFF, 0x74, 0x01, 0xA8, 0x07, 0x08, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0xFF, 0x90, -0x00, 0x42, 0xE0, 0x4F, 0xFD, 0x7F, 0x42, 0x80, 0x1C, 0x90, 0xA5, 0xC2, 0xE0, 0x24, 0x04, 0xFF, -0x74, 0x01, 0xA8, 0x07, 0x08, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0xF4, 0xFF, 0x90, 0x00, 0x42, -0xE0, 0x5F, 0xFD, 0x7F, 0x42, 0x12, 0x3A, 0x96, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0xA4, 0x31, -0xE0, 0x75, 0xF0, 0x3F, 0x84, 0xAD, 0xF0, 0xED, 0x25, 0xE0, 0x25, 0xE0, 0xFD, 0x74, 0x38, 0x2F, -0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xED, 0xF0, 0x90, 0xA4, 0x31, 0xE0, 0x04, 0xF0, 0x22, -0xE4, 0xF5, 0x72, 0xF5, 0x73, 0x90, 0x05, 0x22, 0xE0, 0xF5, 0x74, 0x90, 0x04, 0x2D, 0xE0, 0x54, -0x01, 0xF0, 0x90, 0x04, 0x1D, 0xE0, 0x60, 0x35, 0xC3, 0xE5, 0x73, 0x94, 0xD0, 0xE5, 0x72, 0x94, -0x07, 0x50, 0x2A, 0x90, 0xA4, 0x2E, 0xE0, 0xB4, 0xFF, 0x0C, 0x90, 0x05, 0x22, 0xE5, 0x74, 0xF0, -0xE4, 0x90, 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xA3, 0xE0, 0x54, 0xFE, 0xF0, 0x54, 0xFD, 0xF0, 0x54, 0xF7, 0xF0, 0x90, 0xA3, 0xAE, -0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x90, 0xA2, 0x2A, 0xE0, 0xB4, 0x01, 0x08, 0x90, 0xA3, -0xAB, 0x74, 0xFF, 0xF0, 0x80, 0x12, 0x90, 0xA2, 0x2A, 0xE0, 0x90, 0xA3, 0xAB, 0xB4, 0x03, 0x05, -0x74, 0xD4, 0xF0, 0x80, 0x03, 0x74, 0x41, 0xF0, 0x90, 0xA3, 0xB2, 0x74, 0x01, 0xF0, 0xA3, 0x74, -0x05, 0xF0, 0xA3, 0xE0, 0x54, 0x01, 0x44, 0x28, 0xF0, 0xA3, 0x74, 0x05, 0xF0, 0xE4, 0xA3, 0xF0, -0xA3, 0xE0, 0x54, 0xFD, 0xF0, 0x54, 0xFB, 0xF0, 0x54, 0xF7, 0xF0, 0x54, 0xEF, 0xF0, 0x54, 0xDF, -0xF0, 0x54, 0xBF, 0xF0, 0xE4, 0xA3, 0xF0, 0x22, 0x90, 0x04, 0x1A, 0xE0, 0xF4, 0x60, 0x03, 0x7F, -0x00, 0x22, 0x90, 0x04, 0x1B, 0xE0, 0x54, 0x07, 0x64, 0x07, 0x7F, 0x01, 0x60, 0x02, 0x7F, 0x00, -0x22, 0x90, 0xA3, 0xBD, 0xE0, 0x30, 0xE0, 0x21, 0x90, 0xA3, 0xCE, 0xE0, 0x60, 0x08, 0x90, 0x01, -0xB8, 0x74, 0x40, 0xF0, 0xC1, 0x6F, 0x90, 0xA3, 0xA3, 0xE0, 0xD3, 0x94, 0x00, 0x40, 0x02, 0x80, -0x32, 0x90, 0xA3, 0xB8, 0xE0, 0x60, 0x70, 0x80, 0x66, 0xB1, 0xB8, 0xEF, 0x64, 0x01, 0x60, 0x08, -0x90, 0x01, 0xB8, 0x74, 0x01, 0xF0, 0x80, 0x67, 0x90, 0xA3, 0xA5, 0xE0, 0xFF, 0x54, 0x03, 0x60, -0x08, 0x90, 0x01, 0xB8, 0x74, 0x02, 0xF0, 0x80, 0x56, 0x90, 0xA3, 0xA3, 0xE0, 0xFE, 0xE4, 0xC3, -0x9E, 0x50, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x04, 0xF0, 0x80, 0x44, 0xEF, 0x30, 0xE2, 0x08, 0x90, -0x01, 0xB8, 0x74, 0x08, 0xF0, 0x80, 0x38, 0x90, 0xA3, 0xA5, 0xE0, 0x30, 0xE4, 0x08, 0x90, 0x01, -0xB8, 0x74, 0x10, 0xF0, 0x80, 0x29, 0x90, 0xA3, 0x9F, 0xE0, 0x13, 0x13, 0x54, 0x3F, 0x20, 0xE0, -0x08, 0x90, 0x01, 0xB8, 0x74, 0x20, 0xF0, 0x80, 0x16, 0x90, 0xA3, 0xB8, 0xE0, 0x60, 0x08, 0x90, -0x01, 0xB8, 0x74, 0x80, 0xF0, 0x80, 0x08, 0x90, 0x01, 0xB8, 0xE4, 0xF0, 0x7F, 0x01, 0x22, 0x90, -0x01, 0xB9, 0x74, 0x04, 0xF0, 0x7F, 0x00, 0x22, 0xEF, 0x60, 0x3E, 0x90, 0xA3, 0x1D, 0xE0, 0x64, -0x01, 0x70, 0x36, 0x90, 0xA3, 0x9F, 0xE0, 0x54, 0xFE, 0xF0, 0x90, 0x05, 0x22, 0x74, 0x0F, 0xF0, -0x90, 0x06, 0x04, 0xE0, 0x54, 0xBF, 0xF0, 0xE4, 0xFF, 0x12, 0x6D, 0xB6, 0xBF, 0x01, 0x0E, 0x90, -0xA3, 0x9E, 0xE0, 0x44, 0x40, 0xF0, 0x90, 0xA3, 0xA4, 0x74, 0x06, 0xF0, 0x22, 0x90, 0x01, 0xB9, -0x74, 0x01, 0xF0, 0x90, 0x01, 0xB8, 0x74, 0x08, 0xF0, 0x22, 0x90, 0x05, 0x22, 0x74, 0x6F, 0xF0, -0x90, 0xA3, 0xA4, 0x74, 0x02, 0xF0, 0x22, 0x90, 0x05, 0x22, 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x04, 0xF0, 0xE4, +0x90, 0xA2, 0xE2, 0xD1, 0xE7, 0xE4, 0x90, 0xA2, 0xE4, 0xF0, 0x80, 0x08, 0x90, 0xA2, 0xD1, 0xD1, +0xDA, 0xE0, 0x04, 0xF0, 0x90, 0xA2, 0xCF, 0x12, 0x4F, 0xF4, 0x30, 0xE0, 0x07, 0xE4, 0x90, 0xA4, +0x64, 0xF0, 0x80, 0x06, 0x90, 0xA4, 0x64, 0x74, 0x01, 0xF0, 0x12, 0x97, 0xD1, 0x20, 0xE0, 0x13, +0x90, 0xA3, 0x10, 0xE0, 0x60, 0x07, 0xE4, 0x90, 0xA4, 0x63, 0xF0, 0x80, 0x06, 0x90, 0xA4, 0x63, +0x74, 0x01, 0xF0, 0x90, 0xA4, 0x63, 0x12, 0x54, 0x26, 0x90, 0xA2, 0xE1, 0x74, 0x01, 0xF0, 0x12, +0x97, 0x95, 0x30, 0xE0, 0x0D, 0x90, 0xA4, 0x62, 0xE0, 0x70, 0x3F, 0xFD, 0xFF, 0x12, 0x5B, 0x63, +0x80, 0x38, 0x90, 0xA2, 0xCF, 0xE0, 0xC4, 0x54, 0x0F, 0x30, 0xE0, 0x1A, 0x90, 0xA2, 0xD5, 0xE0, +0x44, 0x20, 0xF0, 0x90, 0xA2, 0xCE, 0xE0, 0x60, 0x04, 0x7D, 0x01, 0x80, 0x18, 0x12, 0x57, 0xB4, +0x7D, 0x01, 0x7F, 0x0C, 0x80, 0x11, 0x90, 0xA4, 0x62, 0xE0, 0xB4, 0x03, 0x0D, 0x90, 0xA2, 0x87, +0xE0, 0x60, 0x07, 0xE4, 0xFD, 0x7F, 0x04, 0x12, 0x59, 0x80, 0x90, 0xA2, 0xCE, 0xE0, 0x60, 0x18, +0x90, 0xA4, 0x62, 0xE0, 0x70, 0x04, 0x7D, 0x04, 0x80, 0x0A, 0x90, 0xA4, 0x62, 0xE0, 0x64, 0x03, +0x70, 0x31, 0x7D, 0x0B, 0x7F, 0x6F, 0x80, 0x28, 0x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0x12, 0xB3, 0xFD, 0xB5, 0x07, 0x04, 0xEE, 0x54, 0xF1, 0xF0, 0x91, 0xA2, 0xE4, 0x90, 0xA3, +0x33, 0xF0, 0x12, 0x5E, 0x11, 0x12, 0xB3, 0xFD, 0x12, 0x87, 0xEA, 0xE0, 0xFA, 0x75, 0xF0, 0x0E, +0xED, 0x12, 0x82, 0x21, 0xFC, 0x54, 0x03, 0xFD, 0xEC, 0x13, 0x13, 0x54, 0x07, 0xFB, 0xEE, 0x12, +0xB4, 0x91, 0xAF, 0x02, 0x12, 0x82, 0x78, 0x12, 0x5F, 0xDB, 0xFE, 0x75, 0xF0, 0x0E, 0x12, 0x82, +0x21, 0xFD, 0x54, 0x03, 0xFF, 0xED, 0xC4, 0x13, 0x54, 0x07, 0xFD, 0x75, 0xF0, 0x0E, 0xEE, 0x12, +0x82, 0x21, 0x12, 0x86, 0x82, 0x12, 0x5F, 0xDB, 0xFF, 0x75, 0xF0, 0x0E, 0x90, 0xA3, 0x3F, 0x12, +0x4A, 0x2A, 0xE0, 0x04, 0xF0, 0x12, 0xB3, 0x11, 0xE4, 0xFD, 0x12, 0x5C, 0x5D, 0x12, 0x57, 0xB4, +0x12, 0x5F, 0xDB, 0xFD, 0xE4, 0xFF, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0xA4, 0x56, +0xEF, 0xF0, 0xA3, 0xED, 0xF0, 0xE4, 0xA3, 0xF0, 0x90, 0xA4, 0x58, 0xE0, 0xFF, 0xC3, 0x94, 0x02, +0x40, 0x03, 0x02, 0x80, 0x60, 0x90, 0xA4, 0x57, 0xE0, 0xFE, 0x12, 0x86, 0x03, 0x75, 0xF0, 0x03, +0xEF, 0x12, 0xB3, 0xA1, 0xE0, 0x90, 0xA4, 0x59, 0xF0, 0x90, 0xA4, 0x56, 0xE0, 0x60, 0x29, 0x90, +0xA4, 0x59, 0xE0, 0xFF, 0x75, 0xF0, 0x0E, 0xEE, 0x12, 0x80, 0x69, 0xC0, 0x83, 0xC0, 0x82, 0x90, +0xA4, 0x58, 0xE0, 0xD0, 0x82, 0xD0, 0x83, 0x75, 0xF0, 0x03, 0x12, 0x4A, 0x2A, 0xD1, 0x2F, 0x80, +0x02, 0xC3, 0x33, 0xD8, 0xFC, 0x4F, 0x80, 0x23, 0xD1, 0x20, 0x75, 0xF0, 0x0E, 0x11, 0x69, 0xC0, +0x83, 0xC0, 0x82, 0x90, 0xA4, 0x58, 0xE0, 0xD0, 0x82, 0xD0, 0x83, 0x75, 0xF0, 0x03, 0x12, 0x4A, +0x2A, 0xD1, 0x2F, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0xF4, 0x5F, 0x90, 0xA4, 0x59, 0xF0, 0xD1, +0x20, 0xD1, 0x03, 0xC0, 0x83, 0xC0, 0x82, 0x90, 0xA4, 0x58, 0xE0, 0xD0, 0x82, 0xD0, 0x83, 0x75, +0xF0, 0x03, 0x12, 0xB3, 0xA1, 0xEF, 0xF0, 0x90, 0xA4, 0x58, 0xE0, 0x04, 0xF0, 0x02, 0x7F, 0xC8, +0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x75, 0xF0, 0x0E, 0xEB, 0x90, 0xA3, 0x38, 0x02, 0x4A, 0x2A, 0xC3, +0xEF, 0x9D, 0xF5, 0x12, 0xC3, 0x94, 0x08, 0x50, 0x1C, 0xE4, 0xF5, 0x13, 0x11, 0x65, 0xC0, 0x83, +0xC0, 0x82, 0x90, 0xA3, 0x7D, 0xE0, 0xD0, 0x82, 0xD0, 0x83, 0x75, 0xF0, 0x03, 0x12, 0x4A, 0x2A, +0xE5, 0x12, 0xF0, 0x80, 0x3E, 0xE5, 0x12, 0xC3, 0x94, 0x10, 0x50, 0x09, 0x75, 0x13, 0x01, 0xE5, +0x12, 0x24, 0xF8, 0x80, 0x17, 0xE5, 0x12, 0xC3, 0x94, 0x18, 0x50, 0x09, 0x75, 0x13, 0x02, 0xE5, +0x12, 0x24, 0xF0, 0x80, 0x07, 0x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, 0xE0, 0x22, 0x8F, 0x10, 0x7D, 0x17, 0x12, 0x5E, 0x0D, +0x75, 0xF0, 0x0E, 0xE5, 0x10, 0xF1, 0xEE, 0xE0, 0xFC, 0x51, 0x1C, 0xFE, 0x54, 0x03, 0xFD, 0xEE, +0x13, 0x13, 0x54, 0x07, 0xFB, 0x90, 0xA3, 0x31, 0xE0, 0xFE, 0x12, 0xB4, 0x91, 0xAF, 0x04, 0x51, +0x78, 0x51, 0x1C, 0xFE, 0x54, 0x03, 0xFF, 0xEE, 0xC4, 0x13, 0x54, 0x07, 0xFD, 0x51, 0x1C, 0xD1, +0x82, 0x75, 0xF0, 0x0E, 0xE5, 0x10, 0x12, 0xB3, 0x15, 0xE4, 0xFD, 0x12, 0x5C, 0x5D, 0x12, 0x57, +0xB4, 0xAD, 0x10, 0xE4, 0xFF, 0x02, 0x7F, 0xB6, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, +0xA4, 0x5B, 0xED, 0xF0, 0xA3, 0xEB, 0xF0, 0x90, 0xA4, 0x5A, 0xEF, 0xF0, 0x90, 0xA4, 0x5D, 0xE0, +0xFD, 0xD1, 0x37, 0x90, 0xA4, 0x5A, 0xE0, 0xC3, 0x94, 0x0E, 0x50, 0x3F, 0x90, 0xA3, 0xF0, 0x12, +0x27, 0x54, 0x1F, 0xFE, 0x00, 0x00, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x12, 0xD4, 0x00, 0x00, +0xB1, 0xEC, 0x90, 0xA3, 0xDE, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0x00, 0x90, 0xA3, 0xE2, 0x12, +0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0xB1, 0x45, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0x00, 0x90, +0xA3, 0xE2, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x61, 0xF6, 0xD1, 0x16, 0x50, 0x1B, 0xEF, +0x94, 0x30, 0x50, 0x16, 0x90, 0xA3, 0xF0, 0x12, 0x27, 0x54, 0x1F, 0xFE, 0x00, 0x00, 0x90, 0xA3, +0xF4, 0x12, 0x27, 0x54, 0x09, 0x28, 0x00, 0x00, 0x80, 0x64, 0x90, 0xA4, 0x5A, 0xE0, 0xFF, 0x74, +0x32, 0xD3, 0x9F, 0x50, 0x1B, 0xEF, 0x94, 0x40, 0x50, 0x16, 0x90, 0xA3, 0xF0, 0x12, 0x27, 0x54, +0x1F, 0xFE, 0x00, 0x00, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x08, 0xA6, 0x00, 0x00, 0x80, 0x3E, +0xD1, 0x0C, 0x50, 0x1B, 0xEF, 0x94, 0x74, 0x50, 0x16, 0x90, 0xA3, 0xF0, 0x12, 0x27, 0x54, 0x1F, +0xFE, 0x00, 0x00, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x08, 0xA4, 0x00, 0x00, 0x80, 0x1F, 0x90, +0xA4, 0x5A, 0xE0, 0xFF, 0x74, 0x76, 0xD3, 0x9F, 0x50, 0x16, 0x90, 0xA3, 0xF0, 0x12, 0x27, 0x54, +0x1F, 0xFE, 0x00, 0x00, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x08, 0x24, 0x00, 0x00, 0xB1, 0xEC, +0xD1, 0x16, 0x50, 0x2E, 0xEF, 0x94, 0x40, 0x50, 0x29, 0x90, 0xA3, 0xDE, 0x12, 0x27, 0x54, 0x00, +0x07, 0x03, 0x00, 0x90, 0xA3, 0xE2, 0x12, 0x27, 0x54, 0x00, 0x01, 0x01, 0x00, 0xB1, 0x45, 0x12, +0x27, 0x54, 0x00, 0x07, 0x03, 0x00, 0x90, 0xA3, 0xE2, 0x12, 0x27, 0x54, 0x00, 0x01, 0x01, 0x00, +0x80, 0x64, 0xD1, 0x0C, 0x50, 0x2E, 0xEF, 0x94, 0x8C, 0x50, 0x29, 0x90, 0xA3, 0xDE, 0x12, 0x27, +0x54, 0x00, 0x07, 0x03, 0x00, 0x90, 0xA3, 0xE2, 0x12, 0x27, 0x54, 0x00, 0x03, 0x01, 0x00, 0xB1, +0x45, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0x00, 0x90, 0xA3, 0xE2, 0x12, 0x27, 0x54, 0x00, 0x03, +0x01, 0x00, 0x80, 0x32, 0x90, 0xA4, 0x5A, 0xE0, 0xFF, 0x74, 0x8C, 0xC3, 0x9F, 0x50, 0x2B, 0x90, +0xA3, 0xDE, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0x00, 0x90, 0xA3, 0xE2, 0x12, 0x27, 0x54, 0x00, +0x05, 0x01, 0x00, 0xB1, 0x45, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0x00, 0x90, 0xA3, 0xE2, 0x12, +0x27, 0x54, 0x00, 0x05, 0x01, 0x00, 0xB1, 0xE5, 0x91, 0xC3, 0x90, 0xA4, 0x5A, 0xE0, 0xFF, 0xA3, +0xE0, 0xFD, 0x12, 0xAB, 0x77, 0x90, 0xA4, 0x5B, 0xE0, 0x64, 0x02, 0x70, 0x51, 0x90, 0xA4, 0x5A, +0xE0, 0xFF, 0xD3, 0x94, 0x30, 0x50, 0x05, 0x75, 0x77, 0x2A, 0x80, 0x5E, 0xEF, 0xD3, 0x94, 0x40, +0x50, 0x05, 0x75, 0x77, 0x3A, 0x80, 0x53, 0xEF, 0xD3, 0x94, 0x70, 0x50, 0x05, 0x75, 0x77, 0x6A, +0x80, 0x48, 0xEF, 0xD3, 0x94, 0x80, 0x50, 0x05, 0x75, 0x77, 0x7A, 0x80, 0x3D, 0xEF, 0xD3, 0x94, +0x90, 0x50, 0x05, 0x75, 0x77, 0x8A, 0x80, 0x32, 0xEF, 0xD3, 0x94, 0xA1, 0x50, 0x05, 0x75, 0x77, +0x9B, 0x80, 0x27, 0xEF, 0xD3, 0x94, 0xB1, 0x50, 0x21, 0x75, 0x77, 0xAB, 0x80, 0x1C, 0x90, 0xA4, +0x5B, 0xE0, 0x64, 0x01, 0x70, 0x2D, 0xA3, 0xE0, 0x90, 0xA4, 0x5A, 0xB4, 0x01, 0x07, 0xE0, 0x24, +0x02, 0xF5, 0x77, 0x80, 0x05, 0xE0, 0x24, 0xFE, 0xF5, 0x77, 0x90, 0xA3, 0xDE, 0x12, 0x27, 0x54, +0x00, 0x00, 0x00, 0xFF, 0xAF, 0x77, 0xB1, 0x3B, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0xFF, 0xAF, +0x77, 0x80, 0x1D, 0x90, 0xA3, 0xDE, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0xFF, 0x90, 0xA4, 0x5A, +0xE0, 0xFF, 0xB1, 0x3B, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0xFF, 0x90, 0xA4, 0x5A, 0xE0, 0xFF, +0xE4, 0xFC, 0xFD, 0xFE, 0x90, 0xA3, 0xE2, 0x12, 0x27, 0x48, 0xB1, 0xE5, 0x91, 0xC3, 0xD0, 0xD0, +0x92, 0xAF, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0xA3, 0xDC, 0xEC, 0xF0, 0xA3, +0xED, 0xF0, 0x90, 0xA3, 0xDB, 0xEF, 0xF0, 0xA3, 0xA3, 0xE0, 0xFD, 0x12, 0x88, 0x6C, 0x90, 0xA3, +0xE6, 0x12, 0x27, 0x48, 0x90, 0xA3, 0xDE, 0x12, 0x4A, 0x12, 0x12, 0x27, 0x15, 0x90, 0xA3, 0xE6, +0x12, 0x57, 0x3B, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xA3, 0xDE, 0x12, 0x4A, +0x12, 0x90, 0xA3, 0xE2, 0x12, 0x57, 0x3B, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0x12, +0x4A, 0x05, 0x90, 0xA3, 0xEA, 0x12, 0x27, 0x48, 0x90, 0xA3, 0xDC, 0xA3, 0xE0, 0xFD, 0xC0, 0x05, +0x90, 0xA3, 0xEA, 0x12, 0x4A, 0x12, 0x90, 0xAC, 0x96, 0x12, 0x27, 0x48, 0x90, 0xA3, 0xDB, 0xE0, +0xFF, 0xD0, 0x05, 0x12, 0x39, 0xBA, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xE4, 0xFC, 0xFD, 0xFE, 0x90, +0xA3, 0xE2, 0x12, 0x27, 0x48, 0x7D, 0x18, 0x7C, 0x00, 0xE4, 0xFF, 0x91, 0xC3, 0x90, 0xA3, 0xDE, +0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xEF, 0x14, 0x60, 0x30, 0x14, 0x60, 0x56, 0x24, +0x02, 0x70, 0x7D, 0x90, 0xA3, 0xDE, 0x12, 0x27, 0x54, 0x00, 0x00, 0x0C, 0x00, 0x90, 0xA3, 0xE2, +0x12, 0x27, 0x54, 0x00, 0x00, 0x0C, 0x00, 0xB1, 0x45, 0x12, 0x27, 0x54, 0x00, 0x00, 0x0C, 0x00, +0x90, 0xA3, 0xE2, 0x12, 0x27, 0x54, 0x00, 0x00, 0x0C, 0x00, 0x80, 0x50, 0x90, 0xA3, 0xDE, 0x12, +0x27, 0x54, 0x00, 0x00, 0x0C, 0x00, 0x90, 0xA3, 0xE2, 0x12, 0x27, 0x54, 0x00, 0x00, 0x04, 0x00, +0xB1, 0x45, 0x12, 0x27, 0x54, 0x00, 0x00, 0x0C, 0x00, 0x90, 0xA3, 0xE2, 0x12, 0x27, 0x54, 0x00, +0x00, 0x04, 0x00, 0x80, 0x27, 0x90, 0xA3, 0xDE, 0x12, 0x27, 0x54, 0x00, 0x00, 0x0C, 0x00, 0x90, +0xA3, 0xE2, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0xB1, 0x45, 0x12, 0x27, 0x54, 0x00, 0x00, +0x0C, 0x00, 0x90, 0xA3, 0xE2, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0xB1, 0xE5, 0x91, 0xC3, +0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x7D, 0x18, 0x7C, 0x00, 0x7F, 0x01, 0x22, 0x7F, 0x60, 0x7E, 0x08, +0x02, 0x54, 0xD7, 0xFF, 0x12, 0x26, 0x1E, 0x54, 0x0F, 0xFD, 0x22, 0xFF, 0x12, 0x26, 0x1E, 0xFE, +0x54, 0x0F, 0x22, 0x75, 0xF0, 0x0E, 0x90, 0xA3, 0x36, 0x02, 0x4A, 0x2A, 0x90, 0xA4, 0x5A, 0xE0, +0xFF, 0x74, 0x64, 0xD3, 0x9F, 0x22, 0x90, 0xA4, 0x5A, 0xE0, 0xFF, 0x74, 0x24, 0xD3, 0x9F, 0x22, +0x90, 0xA4, 0x59, 0xE0, 0xFF, 0x90, 0xA4, 0x57, 0xE0, 0x22, 0xE0, 0xFF, 0x90, 0xA4, 0x02, 0xE0, +0xFE, 0x74, 0x01, 0xA8, 0x06, 0x08, 0x22, 0x90, 0xA4, 0x87, 0xED, 0xF0, 0x90, 0xA4, 0x86, 0xEF, +0xF0, 0xD3, 0x94, 0x0E, 0x50, 0x15, 0xD1, 0x76, 0xEF, 0x60, 0x2A, 0xD1, 0x76, 0xEF, 0x64, 0x01, +0x70, 0x23, 0x90, 0xA4, 0x87, 0xE0, 0xFD, 0xE4, 0xFF, 0x80, 0x15, 0x90, 0xA4, 0x86, 0xE0, 0xD3, +0x94, 0x0E, 0x40, 0x11, 0xD1, 0x76, 0xEF, 0x70, 0x0A, 0x90, 0xA4, 0x87, 0xE0, 0xFD, 0x7F, 0x01, +0x02, 0xAC, 0xEF, 0xD1, 0x76, 0x22, 0x90, 0x04, 0x54, 0xE0, 0x7F, 0x00, 0x30, 0xE7, 0x02, 0x7F, +0x01, 0x22, 0xFE, 0x13, 0x13, 0x54, 0x07, 0xFB, 0x90, 0xA4, 0x5E, 0x12, 0x5F, 0xE4, 0xE4, 0xFE, +0x7D, 0x18, 0xFF, 0x12, 0x3A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 0x74, 0x9E, +0xF0, 0x74, 0x88, 0xA3, 0xF0, 0x11, 0xED, 0x74, 0x9E, 0x04, 0x90, 0x01, 0xC4, 0xF0, 0x74, 0x88, +0xA3, 0xF0, 0xD0, 0x07, 0xD0, 0x06, 0xD0, 0x05, 0xD0, 0x04, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, +0xD0, 0x00, 0xD0, 0xD0, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xF0, 0xD0, 0xE0, 0x32, 0x7B, 0x00, 0x7A, +0x00, 0x79, 0x53, 0xE4, 0xFD, 0x7F, 0x01, 0x12, 0x39, 0x33, 0xE5, 0x51, 0x52, 0x53, 0x7B, 0x00, +0x7A, 0x00, 0x79, 0x54, 0x7D, 0x01, 0x7F, 0x01, 0x12, 0x39, 0x33, 0xE5, 0x52, 0x52, 0x54, 0xAB, +0x53, 0xE4, 0xFD, 0x7F, 0x01, 0x12, 0x39, 0x04, 0xAB, 0x54, 0x7D, 0x01, 0x7F, 0x01, 0x02, 0x39, +0x04, 0xC0, 0xE0, 0xC0, 0xF0, 0xC0, 0x83, 0xC0, 0x82, 0xC0, 0xD0, 0x75, 0xD0, 0x00, 0xC0, 0x00, +0xC0, 0x01, 0xC0, 0x02, 0xC0, 0x03, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0x01, +0xC4, 0x74, 0x21, 0xF0, 0x74, 0x89, 0xA3, 0xF0, 0x31, 0x92, 0xE5, 0x5C, 0x30, 0xE7, 0x02, 0x31, +0x77, 0x74, 0x21, 0x04, 0x90, 0x01, 0xC4, 0xF0, 0x74, 0x89, 0xA3, 0xF0, 0xD0, 0x07, 0xD0, 0x06, +0xD0, 0x05, 0xD0, 0x04, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0xD0, 0xD0, 0xD0, 0x82, +0xD0, 0x83, 0xD0, 0xF0, 0xD0, 0xE0, 0x32, 0x7F, 0x01, 0x7E, 0x00, 0x12, 0x3A, 0x69, 0x90, 0x00, +0xF2, 0xE0, 0x20, 0xE6, 0x0C, 0x90, 0x00, 0x05, 0xE0, 0x44, 0x80, 0xFD, 0x7F, 0x05, 0x12, 0x3A, +0x96, 0x22, 0x90, 0x00, 0x54, 0xE0, 0x55, 0x55, 0xF5, 0x59, 0xA3, 0xE0, 0x55, 0x56, 0xF5, 0x5A, +0xA3, 0xE0, 0x55, 0x57, 0xF5, 0x5B, 0xA3, 0xE0, 0x55, 0x58, 0xF5, 0x5C, 0xAD, 0x59, 0x7F, 0x54, +0x12, 0x3A, 0x96, 0xAD, 0x5A, 0x7F, 0x55, 0x12, 0x3A, 0x96, 0xAD, 0x5B, 0x7F, 0x56, 0x12, 0x3A, +0x96, 0xAD, 0x5C, 0x7F, 0x57, 0x12, 0x3A, 0x96, 0x53, 0x91, 0xEF, 0x22, 0xC0, 0xE0, 0xC0, 0xF0, +0xC0, 0x83, 0xC0, 0x82, 0xC0, 0xD0, 0x75, 0xD0, 0x00, 0xC0, 0x00, 0xC0, 0x01, 0xC0, 0x02, 0xC0, +0x03, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0x01, 0xC4, 0x74, 0xCC, 0xF0, 0x74, +0x89, 0xA3, 0xF0, 0x12, 0xA1, 0x40, 0xE5, 0x61, 0x30, 0xE1, 0x02, 0x91, 0x35, 0xE5, 0x61, 0x30, +0xE4, 0x02, 0xB1, 0xB7, 0xE5, 0x61, 0x30, 0xE5, 0x03, 0x12, 0xA1, 0x9D, 0xE5, 0x63, 0x30, 0xE0, +0x02, 0xB1, 0xA7, 0xE5, 0x63, 0x30, 0xE1, 0x02, 0xB1, 0xCB, 0xE5, 0x63, 0x30, 0xE2, 0x03, 0x12, +0xA1, 0xD9, 0xE5, 0x63, 0x30, 0xE3, 0x03, 0x12, 0xA1, 0xE5, 0xE5, 0x63, 0x30, 0xE4, 0x03, 0x12, +0xA2, 0x00, 0xE5, 0x63, 0x30, 0xE5, 0x03, 0x12, 0xA5, 0xAD, 0xE5, 0x63, 0x30, 0xE6, 0x03, 0x12, +0xA5, 0x96, 0xE5, 0x64, 0x30, 0xE1, 0x03, 0x12, 0xA7, 0x22, 0xE5, 0x64, 0x30, 0xE4, 0x03, 0x12, +0x6F, 0xF0, 0xE5, 0x64, 0x30, 0xE5, 0x02, 0x51, 0x86, 0xE5, 0x64, 0x30, 0xE6, 0x02, 0x71, 0xD6, +0x74, 0xCC, 0x04, 0x90, 0x01, 0xC4, 0xF0, 0x74, 0x89, 0xA3, 0xF0, 0xD0, 0x07, 0xD0, 0x06, 0xD0, +0x05, 0xD0, 0x04, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0xD0, 0xD0, 0xD0, 0x82, 0xD0, +0x83, 0xD0, 0xF0, 0xD0, 0xE0, 0x32, 0xE4, 0xF5, 0x21, 0x90, 0xA2, 0x81, 0xE0, 0xFF, 0xE5, 0x21, +0xC3, 0x9F, 0x40, 0x02, 0x61, 0xB0, 0x90, 0x04, 0xCF, 0x74, 0x30, 0xF0, 0xAF, 0x21, 0x12, 0x77, +0xC7, 0xEF, 0x70, 0x02, 0x61, 0xAC, 0xE5, 0x21, 0x13, 0x13, 0x13, 0x54, 0x1F, 0xF5, 0x22, 0xE5, +0x21, 0x54, 0x07, 0xF5, 0x23, 0x74, 0x81, 0x25, 0x22, 0x12, 0xB3, 0x56, 0xE0, 0xFD, 0x71, 0xC4, +0x80, 0x05, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, 0xF9, 0xFF, 0xEF, 0x5D, 0x70, 0x02, 0x61, 0xAC, +0x75, 0xF0, 0x10, 0xE5, 0x21, 0x12, 0x76, 0xA9, 0xE0, 0x20, 0xE7, 0x02, 0x80, 0x10, 0x75, 0xF0, +0x10, 0xE5, 0x21, 0x90, 0x81, 0x02, 0x12, 0x4A, 0x2A, 0xE0, 0xFF, 0x20, 0xE7, 0x09, 0x90, 0x01, +0xC1, 0xE0, 0x44, 0x20, 0xF0, 0x61, 0xAC, 0x75, 0xF0, 0x04, 0xE5, 0x21, 0x12, 0x76, 0x92, 0xE0, +0x54, 0x07, 0x44, 0x50, 0xF0, 0xEF, 0x30, 0xE6, 0x37, 0x12, 0x76, 0xD9, 0x71, 0xCC, 0x80, 0x02, +0xC3, 0x33, 0xD8, 0xFC, 0xF4, 0x5F, 0xF0, 0x75, 0xF0, 0x10, 0xE5, 0x21, 0x12, 0x76, 0xD3, 0xE0, +0xFD, 0x75, 0xF0, 0x04, 0xE5, 0x21, 0x12, 0x4F, 0x3D, 0x71, 0xBD, 0xE4, 0xFB, 0xAF, 0x21, 0x12, +0x66, 0xB4, 0x75, 0xF0, 0x04, 0xE5, 0x21, 0x12, 0x76, 0x92, 0xE0, 0x54, 0xF8, 0xF0, 0x80, 0x6C, +0x71, 0xB1, 0xE0, 0x04, 0xF0, 0x71, 0xB1, 0xE0, 0xD3, 0x94, 0x01, 0x40, 0x44, 0xAF, 0x21, 0x12, +0x61, 0x91, 0x71, 0xB1, 0xE4, 0xF0, 0x12, 0x76, 0xD9, 0xE0, 0xFD, 0xFB, 0x7A, 0x00, 0x71, 0xC4, +0x80, 0x05, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, 0xF9, 0xF1, 0xE0, 0x70, 0x14, 0x12, 0x76, 0xD9, +0xAF, 0x23, 0x74, 0x01, 0xA8, 0x07, 0x08, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0x4D, 0xF0, 0x80, +0x2B, 0x12, 0x76, 0xD9, 0x71, 0xCC, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0xF4, 0x5F, 0xF0, 0x80, +0x1B, 0x75, 0xF0, 0x10, 0xE5, 0x21, 0x12, 0x76, 0xD3, 0xE0, 0xFD, 0x75, 0xF0, 0x04, 0xE5, 0x21, +0x12, 0x4F, 0x3D, 0x71, 0xBD, 0x7B, 0x01, 0xAF, 0x21, 0x12, 0x66, 0xB4, 0x05, 0x21, 0x41, 0x89, +0x22, 0x74, 0xA1, 0x25, 0x21, 0xF5, 0x82, 0xE4, 0x34, 0x9F, 0xF5, 0x83, 0x22, 0x13, 0x13, 0x54, +0x03, 0xF5, 0x71, 0x22, 0x74, 0x01, 0x7E, 0x00, 0xA8, 0x23, 0x08, 0x22, 0xE0, 0xFF, 0xAE, 0x23, +0x74, 0x01, 0xA8, 0x06, 0x08, 0x22, 0x90, 0x07, 0x1F, 0xE0, 0x54, 0x7F, 0xF0, 0x90, 0x07, 0x1C, +0xE0, 0x54, 0x01, 0xFF, 0x60, 0x2F, 0x90, 0xA3, 0x65, 0xE0, 0x60, 0x29, 0x90, 0xA3, 0x62, 0xE0, +0x54, 0x03, 0x14, 0x60, 0x10, 0x14, 0x60, 0x16, 0x24, 0x02, 0x70, 0x19, 0x90, 0x04, 0x2D, 0xE0, +0x44, 0x02, 0xF0, 0x80, 0x10, 0x90, 0x04, 0x2D, 0xE0, 0x44, 0x06, 0xF0, 0x80, 0x07, 0x90, 0x04, +0x2D, 0xE0, 0x44, 0x0E, 0xF0, 0xE4, 0x90, 0xA3, 0x65, 0xF0, 0x90, 0xA3, 0x98, 0xEF, 0xF0, 0x90, +0xA3, 0x96, 0x74, 0x02, 0xF0, 0x90, 0xA3, 0xA4, 0x14, 0xF0, 0xFB, 0x7A, 0xA3, 0x79, 0x96, 0x91, +0xD3, 0x7F, 0x04, 0x81, 0xB8, 0xE4, 0xFF, 0x90, 0xA3, 0x96, 0xEF, 0xF0, 0x90, 0x04, 0x7E, 0xE0, +0xF5, 0x22, 0xA3, 0xE0, 0xF5, 0x23, 0x65, 0x22, 0x60, 0x69, 0x90, 0xA3, 0x97, 0x74, 0x03, 0xF0, +0x90, 0xA3, 0xA5, 0x74, 0x08, 0xF0, 0xE5, 0x23, 0x04, 0x54, 0x0F, 0xF5, 0x24, 0xE4, 0xF5, 0x21, +0xE5, 0x24, 0x75, 0xF0, 0x08, 0xA4, 0x24, 0x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0xE0, 0xB4, 0x14, 0x09, 0x90, 0x04, +0x9C, 0xE4, 0xF0, 0x90, 0xA3, 0x19, 0xF0, 0x90, 0xA2, 0x87, 0xE0, 0x60, 0x2B, 0x90, 0xA2, 0x84, +0x12, 0x5F, 0xB0, 0x30, 0xE0, 0x0B, 0x90, 0x01, 0x3B, 0xE0, 0x30, 0xE4, 0x04, 0xD1, 0x22, 0xD1, +0x1C, 0x90, 0xA4, 0x8D, 0xE0, 0x04, 0xF0, 0xE0, 0xC3, 0x94, 0x80, 0x40, 0x0B, 0x90, 0x01, 0x98, +0xE0, 0x54, 0xFE, 0xF0, 0xE0, 0x44, 0x01, 0xF0, 0x7F, 0x01, 0x80, 0xA0, 0x7D, 0x01, 0x7F, 0x02, +0x80, 0x04, 0x7D, 0x02, 0x7F, 0x02, 0x74, 0x5D, 0x12, 0xB4, 0x99, 0xFE, 0xF6, 0x74, 0x30, 0x02, +0x86, 0xE2, 0xEF, 0x70, 0x34, 0x7D, 0x78, 0x7F, 0x02, 0xD1, 0x26, 0x7D, 0x02, 0x7F, 0x03, 0xD1, +0x26, 0x7D, 0xC8, 0x7F, 0x02, 0x12, 0x86, 0xF1, 0x12, 0xA2, 0x1A, 0xE4, 0xFF, 0x12, 0x77, 0xC7, +0xEF, 0x70, 0x0A, 0xD1, 0xA6, 0x54, 0xBF, 0xF0, 0x54, 0x7F, 0xF0, 0x80, 0x07, 0x7D, 0x01, 0x7F, +0x0C, 0x12, 0x59, 0x80, 0xD1, 0xAA, 0x02, 0xB4, 0x69, 0x90, 0x01, 0x36, 0x74, 0x78, 0xF0, 0xA3, +0x74, 0x02, 0xF0, 0x7D, 0x78, 0xFF, 0x12, 0x87, 0xCE, 0x7D, 0x02, 0x7F, 0x03, 0x12, 0x87, 0xCE, +0x90, 0x06, 0x0A, 0xE0, 0x44, 0x07, 0x12, 0xB3, 0x7C, 0xE4, 0xFF, 0x12, 0x77, 0xC7, 0xBF, 0x01, +0x11, 0x12, 0xA4, 0xE5, 0x90, 0xA2, 0x8A, 0xE0, 0x20, 0xE2, 0x0A, 0x7D, 0x01, 0x7F, 0x04, 0x02, +0x59, 0x80, 0x12, 0xB4, 0x89, 0x22, 0xD1, 0xB2, 0xF1, 0x8C, 0x90, 0xA2, 0x83, 0xE0, 0x54, 0xF7, +0xF0, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0xA2, 0x95, 0x12, 0x54, 0xCA, 0x7F, +0xB0, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0xA2, 0x95, 0x12, 0x54, 0xCA, 0xF1, 0xD9, 0x90, 0x00, +0x10, 0xE0, 0x44, 0x0C, 0xFD, 0x7F, 0x10, 0x12, 0x3A, 0x96, 0x90, 0x00, 0x72, 0xE0, 0x54, 0xF3, +0xFD, 0x7F, 0x72, 0x12, 0x3A, 0x96, 0x90, 0x01, 0x01, 0xE0, 0x44, 0x02, 0xF0, 0x90, 0x01, 0x00, +0x74, 0xFF, 0xF0, 0x90, 0xA2, 0xCD, 0x12, 0x5F, 0xB0, 0x30, 0xE0, 0x05, 0x7F, 0x03, 0x12, 0x95, +0x54, 0x90, 0xA2, 0xEA, 0xE0, 0x20, 0xE0, 0x32, 0xF1, 0xBD, 0x13, 0x30, 0xE0, 0x2C, 0x90, 0xA3, +0x10, 0xE0, 0x60, 0x07, 0xE4, 0x90, 0xA4, 0x1B, 0xF0, 0x80, 0x06, 0x90, 0xA4, 0x1B, 0x74, 0x01, +0xF0, 0xEF, 0xC4, 0x13, 0x54, 0x07, 0x90, 0xA4, 0x1C, 0x30, 0xE0, 0x05, 0x74, 0x01, 0xF0, 0x80, +0x03, 0x74, 0x02, 0xF0, 0x90, 0xA4, 0x1B, 0x12, 0x54, 0x26, 0x90, 0x06, 0xB7, 0x74, 0x09, 0xF0, +0x90, 0x06, 0xB4, 0x74, 0x86, 0xF0, 0x12, 0xB4, 0x57, 0x54, 0xBF, 0xF1, 0x9F, 0x12, 0x54, 0xCA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 0xE0, 0xFF, 0xB4, 0x04, 0x02, 0x41, 0xBB, 0x90, 0xA2, 0xE2, 0xE0, 0xFF, 0xB4, 0x05, 0x02, +0x91, 0x00, 0x22, 0x12, 0x5F, 0xED, 0x20, 0xE0, 0x02, 0x41, 0x81, 0x90, 0xA2, 0xD7, 0xE0, 0x64, +0x01, 0x70, 0x2F, 0x90, 0x06, 0x92, 0xE0, 0x20, 0xE2, 0x06, 0x90, 0x04, 0xE3, 0xE0, 0x60, 0x1D, +0x12, 0x7E, 0xE8, 0x90, 0xA2, 0xE4, 0xE0, 0x04, 0xF0, 0x90, 0xA2, 0xDB, 0xE0, 0x75, 0xF0, 0x03, +0x84, 0xFF, 0x90, 0xA2, 0xE4, 0xE0, 0xB5, 0x07, 0x02, 0x80, 0x02, 0x41, 0x6B, 0x71, 0xEB, 0x04, +0xF0, 0x22, 0x90, 0xA2, 0xD7, 0xE0, 0x64, 0x04, 0x70, 0x2C, 0x90, 0x06, 0x92, 0xE0, 0x20, 0xE2, +0x06, 0x90, 0x04, 0xE3, 0xE0, 0x60, 0x19, 0x12, 0x7E, 0xE8, 0x90, 0xA2, 0xE4, 0xE0, 0x04, 0xF0, +0x90, 0xA2, 0xDA, 0xE0, 0xFF, 0x90, 0xA2, 0xE4, 0xE0, 0xB5, 0x07, 0x02, 0x80, 0x02, 0x41, 0x6B, +0x71, 0xEB, 0x74, 0x04, 0xF0, 0x22, 0x90, 0xA2, 0xD7, 0xE0, 0x64, 0x06, 0x60, 0x02, 0x21, 0xEB, +0x51, 0x82, 0x50, 0x08, 0x90, 0xA2, 0xE5, 0xE0, 0x94, 0x03, 0x40, 0x1A, 0x51, 0xB3, 0x90, 0xA2, +0xE2, 0x30, 0xE0, 0x05, 0x74, 0x05, 0xF0, 0x80, 0x03, 0x74, 0x02, 0xF0, 0xE4, 0x90, 0xA2, 0xD7, +0xF0, 0x90, 0xA2, 0xE5, 0xF0, 0x22, 0x90, 0xA2, 0xD6, 0x71, 0xF9, 0x30, 0xE0, 0x3A, 0xEF, 0x54, +0xFB, 0xF0, 0xE4, 0xA3, 0x51, 0xB2, 0x30, 0xE0, 0x0B, 0x90, 0xA2, 0xF4, 0xE0, 0x20, 0xE0, 0x02, +0x41, 0x1D, 0x41, 0x15, 0x51, 0x82, 0x40, 0x0B, 0x90, 0xA2, 0xF4, 0xE0, 0x30, 0xE0, 0x02, 0x80, +0x74, 0x80, 0x7A, 0x90, 0xA2, 0xF4, 0xE0, 0x30, 0xE0, 0x07, 0x12, 0x7E, 0xE2, 0x71, 0xE2, 0x80, +0x77, 0x90, 0xA2, 0xE2, 0x74, 0x02, 0xF0, 0x22, 0x12, 0x5B, 0x6E, 0x90, 0xA2, 0xE5, 0xE0, 0x04, +0xF0, 0x7F, 0x03, 0x12, 0x7C, 0xFE, 0x51, 0x82, 0x50, 0x0A, 0x90, 0xA2, 0xE5, 0xE0, 0x94, 0x03, +0x50, 0x02, 0x41, 0x81, 0x7F, 0x03, 0xB1, 0x54, 0x90, 0x05, 0x22, 0xE0, 0x44, 0x10, 0xFF, 0x7D, +0x03, 0x12, 0x5B, 0x63, 0x90, 0x04, 0x9C, 0xE0, 0x04, 0xF0, 0x22, 0x90, 0xA2, 0xD7, 0xE0, 0x64, +0x07, 0x70, 0x38, 0x90, 0xA2, 0xE5, 0xE0, 0xB4, 0x04, 0x05, 0x12, 0x57, 0xED, 0x80, 0x66, 0x90, +0xA2, 0xD6, 0x71, 0xF9, 0x30, 0xE0, 0x19, 0xEF, 0x54, 0xFB, 0xF0, 0xE4, 0xA3, 0xF0, 0x90, 0xA2, +0xF4, 0xE0, 0x30, 0xE0, 0x08, 0x12, 0x7E, 0xE2, 0x71, 0xE2, 0x04, 0x80, 0x0B, 0x02, 0x57, 0xED, +0x12, 0x5B, 0x6E, 0x90, 0xA2, 0xE5, 0xE0, 0x04, 0xF0, 0x80, 0x40, 0x90, 0xA2, 0xD7, 0xE0, 0x64, +0x09, 0x70, 0x4E, 0x90, 0xA2, 0xD6, 0xE0,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, 0x7F, 0x6F, 0x12, 0x5B, 0x63, 0x90, 0xA2, 0xD2, +0xE0, 0x30, 0xE0, 0x03, 0x12, 0x57, 0xB4, 0x12, 0x4F, 0xF1, 0x30, 0xE0, 0x05, 0xE4, 0xFF, 0x12, +0x57, 0x0D, 0x90, 0xA2, 0xD3, 0xE0, 0xC3, 0x13, 0x30, 0xE0, 0x0E, 0x90, 0x06, 0xCD, 0xE0, 0x54, +0xEF, 0xF0, 0x90, 0x06, 0xCF, 0xE0, 0x54, 0xEF, 0xF0, 0x22, 0x90, 0xA2, 0x89, 0xE0, 0xFF, 0xE4, +0xFD, 0x02, 0x59, 0x80, 0x90, 0xA2, 0xF4, 0x12, 0x5F, 0xB0, 0x30, 0xE0, 0x07, 0x90, 0x07, 0x78, +0x74, 0x09, 0xF0, 0x22, 0x90, 0xA3, 0x2F, 0xE0, 0x30, 0xE0, 0x1D, 0xEF, 0x24, 0xFD, 0x60, 0x0E, +0x24, 0xFA, 0x60, 0x0E, 0x24, 0xFC, 0x60, 0x0E, 0x24, 0x0C, 0x7F, 0x02, 0x80, 0x0A, 0x7F, 0x03, +0x80, 0x06, 0x7F, 0x0B, 0x80, 0x02, 0x7F, 0x0E, 0x90, 0x07, 0x78, 0xEF, 0xF0, 0x22, 0xD3, 0x10, +0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x12, 0x5E, 0x11, 0x7F, 0x00, 0x7E, 0x0C, 0x12, 0x54, 0xB9, 0x12, +0xB3, 0x95, 0x12, 0x54, 0xB9, 0x12, 0x8F, 0xD2, 0xD1, 0x6D, 0xD1, 0x61, 0xD1, 0x61, 0x12, 0xB4, +0x57, 0x44, 0x40, 0x12, 0x54, 0xBF, 0x12, 0x8F, 0xCB, 0x90, 0x01, 0x00, 0x74, 0x3F, 0xF0, 0xA3, +0xE0, 0x54, 0xFD, 0xF0, 0x90, 0x05, 0x53, 0xE0, 0x44, 0x20, 0x12, 0x77, 0xB7, 0x90, 0xA2, 0x95, +0x12, 0x27, 0x48, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, 0x77, 0xD1, 0x56, 0x12, +0x27, 0x54, 0x77, 0x77, 0x77, 0x77, 0x12, 0x8F, 0xD9, 0x90, 0xA2, 0xCD, 0x12, 0x5F, 0xB0, 0x30, +0xE0, 0x04, 0x7F, 0x01, 0xB1, 0x54, 0x12, 0x8F, 0xBD, 0x13, 0x30, 0xE0, 0x32, 0x90, 0xA3, 0x10, +0xE0, 0x60, 0x08, 0x90, 0xA4, 0x23, 0x74, 0x01, 0xF0, 0x80, 0x05, 0xE4, 0x90, 0xA4, 0x23, 0xF0, +0xEF, 0xC4, 0x13, 0x54, 0x07, 0x30, 0xE0, 0x07, 0xE4, 0x90, 0xA4, 0x24, 0xF0, 0x80, 0x06, 0x90, +0xA4, 0x24, 0x74, 0x02, 0xF0, 0x90, 0xA4, 0x23, 0x12, 0x54, 0x26, 0x7F, 0x01, 0xB1, 0x54, 0x90, +0xA2, 0xCC, 0xE0, 0x60, 0x02, 0xE4, 0xF0, 0x90, 0x00, 0xFF, 0xE0, 0x70, 0x14, 0x7B, 0x01, 0x7A, +0xA4, 0x79, 0x1E, 0x7D, 0x08, 0x7F, 0x01, 0xD1, 0xA1, 0x90, 0xA4, 0x1E, 0xE0, 0x44, 0x18, 0xD1, +0xE5, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, +0x22, 0x90, 0x00, 0x02, 0xE0, 0x44, 0x01, 0xFD, 0x7F, 0x02, 0x12, 0x3A, 0x96, 0x90, 0x00, 0x02, +0xE0, 0x54, 0xFE, 0xFD, 0x7F, 0x02, 0x02, 0x3A, 0x96, 0x12, 0x8F, 0xBD, 0x13, 0x30, 0xE0, 0x20, +0xEF, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x20, 0xE0, 0x17, 0x51, 0xB3, 0x30, 0xE0, 0x04, 0x7F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34, 0x90, 0xA2, 0xD3, 0xE0, 0xC4, 0x54, 0x0F, +0x30, 0xE0, 0x0C, 0xEF, 0x90, 0x06, 0xCC, 0x70, 0x03, 0xF0, 0x80, 0x03, 0x74, 0x03, 0xF0, 0x90, +0xA3, 0x1D, 0xE0, 0x30, 0xE0, 0x17, 0xC4, 0x54, 0x0F, 0x30, 0xE0, 0x0B, 0xEF, 0x90, 0x06, 0xCC, +0x70, 0x03, 0xF0, 0x80, 0x08, 0x80, 0x03, 0x90, 0x06, 0xCC, 0x74, 0x03, 0xF0, 0xD0, 0xD0, 0x92, +0xAF, 0x22, 0x90, 0xA3, 0x31, 0xE0, 0x30, 0xE0, 0x0B, 0x12, 0x86, 0xED, 0xE4, 0x90, 0xA3, 0x33, +0xF0, 0x12, 0x7C, 0xA2, 0x22, 0x90, 0xA2, 0xCF, 0xE0, 0xC4, 0x13, 0x54, 0x07, 0x22, 0x90, 0xA2, +0xCF, 0xE0, 0x20, 0xE0, 0x21, 0x90, 0xA2, 0x87, 0xE0, 0x64, 0x01, 0x70, 0x19, 0xD1, 0x79, 0x90, +0xA2, 0x85, 0xE0, 0x54, 0x0F, 0x60, 0x06, 0x12, 0x5B, 0x5A, 0x02, 0xA6, 0x24, 0x90, 0xA2, 0x8A, +0xE0, 0x70, 0x03, 0x12, 0x59, 0x7C, 0x22, 0x02, 0x7A, 0xE7, 0xE0, 0xFF, 0xC4, 0x13, 0x54, 0x07, +0x22, 0x90, 0xA2, 0xD2, 0xE0, 0xC4, 0x13, 0x54, 0x07, 0x22, 0x90, 0xA2, 0xD5, 0xE0, 0x54, 0xDF, +0xF0, 0xE4, 0x22, 0xC0, 0xE0, 0xC0, 0x83, 0xC0, 0x82, 0xC0, 0xD0, 0x75, 0xD0, 0x00, 0xC0, 0x05, +0xC0, 0x07, 0x7D, 0xE3, 0x90, 0x01, 0xC4, 0xED, 0xF0, 0x74, 0x97, 0xFF, 0xA3, 0xF0, 0xED, 0x04, +0x90, 0x01, 0xC4, 0xF0, 0xA3, 0xEF, 0xF0, 0xD0, 0x07, 0xD0, 0x05, 0xD0, 0xD0, 0xD0, 0x82, 0xD0, +0x83, 0xD0, 0xE0, 0x32, 0x90, 0x02, 0x09, 0x11, 0x4F, 0x90, 0xA1, 0x7D, 0x12, 0x51, 0x7B, 0x25, +0x0D, 0x90, 0xA1, 0x7E, 0x12, 0x4F, 0xD0, 0x25, 0x0D, 0x90, 0xA1, 0x7F, 0xF0, 0x12, 0x4F, 0xDE, +0x25, 0x0D, 0x90, 0xA1, 0x80, 0x12, 0x54, 0x1F, 0x25, 0x0D, 0x90, 0xA1, 0x81, 0x12, 0x76, 0xC6, +0x25, 0x0D, 0x90, 0xA1, 0x82, 0x12, 0x86, 0xD1, 0x25, 0x0D, 0x90, 0xA1, 0x83, 0xF0, 0x22, 0xE0, +0xF5, 0x0D, 0x12, 0x26, 0x1E, 0x25, 0x0D, 0x22, 0x90, 0x04, 0x24, 0x11, 0x4F, 0x90, 0xA3, 0x40, +0x12, 0x51, 0x7B, 0x25, 0x0D, 0x90, 0xA3, 0x4E, 0x12, 0x4F, 0xD0, 0x25, 0x0D, 0x90, 0xA3, 0x5C, +0xF0, 0x22, 0x8B, 0x0D, 0x8A, 0x0E, 0x89, 0x0F, 0x12, 0x51, 0x7C, 0xFF, 0xF5, 0x11, 0x12, 0x26, +0x1E, 0xFE, 0xC3, 0x13, 0x30, 0xE0, 0x07, 0x12, 0x4F, 0xD1, 0xF5, 0x12, 0x80, 0x02, 0x8F, 0x12, +0x85, 0x11, 0x10, 0xE5, 0x10, 0xD3, 0x95, 0x12, 0x50, 0x23, 0x12, 0x82, 0x15, 0x12, 0x26, 0x1E, +0x54, 0x01, 0xFD, 0xAF, 0x10, 0x11, 0xD2, 0xAF, 0x10, 0x12, 0x77, 0xC7, 0xEF, 0xAF, 0x10, 0x70, +0x05, 0x12, 0x77, 0xB0, 0x80, 0x03, 0x12, 0x77, 0x92, 0x05, 0x10, 0x80, 0xD6, 0xE5, 0x11, 0x70, +0x10, 0xFF, 0x12, 0x77, 0xC7, 0xEF, 0x70, 0x09, 0x12, 0x8E, 0xA6, 0x54, 0xBF, 0xF0, 0x54, 0x7F, +0xF0, 0x22, 0x31, 0x70, 0xED, 0x70, 0x12, 0x31, 0x0D, 0xC0, 0x83, 0xC0, 0x82, 0x31, 0x05, 0x80, +0x02, 0xC3, 0x33, 0xD8, 0xFC, 0xF4, 0x5E, 0x80, 0x0F, 0x31, 0x0D, 0xC0, 0x83, 0xC0, 0x82, 0x31, +0x05, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0x4E, 0xD0, 0x82, 0xD0, 0x83, 0xF0, 0x31, 0x18, 0x90, +0xA2, 0x81, 0xEF, 0xF0, 0x22, 0xE0, 0xFE, 0x74, 0x01, 0xA8, 0x07, 0x08, 0x22, 0x74, 0x71, 0x2E, +0xF5, 0x82, 0xE4, 0x34, 0xA2, 0xF5, 0x83, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x7D, +0x10, 0xED, 0x14, 0xF9, 0x24, 0x71, 0x31, 0x10, 0xE0, 0x60, 0x37, 0x7C, 0x08, 0xEC, 0x14, 0x90, +0xA4, 0x8B, 0xF0, 0x74, 0x71, 0x29, 0x31, 0x10, 0xE0, 0xFB, 0x7A, 0x00, 0x90, 0xA4, 0x8B, 0xE0, +0x12, 0x6F, 0x92, 0x80, 0x05, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, 0xF9, 0x12, 0x8F, 0xE0, 0x60, +0x0F, 0xE9, 0x75, 0xF0, 0x08, 0xA4, 0xFF, 0x90, 0xA4, 0x8B, 0xE0, 0x2F, 0x04, 0xFF, 0x80, 0x06, +0xDC, 0xCB, 0xDD, 0xBD, 0x7F, 0x00, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xE4, 0xFD, 0xFF, 0x01, 0xD2, +0xEF, 0x13, 0x13, 0x13, 0x54, 0x1F, 0xFE, 0xEF, 0x54, 0x07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C3, 0x94, 0x04, 0x90, 0xA2, +0x9A, 0x50, 0x04, 0xEF, 0xF0, 0x80, 0x2B, 0x74, 0x03, 0xF0, 0x12, 0x4F, 0xE4, 0xE9, 0x24, 0x06, +0xF9, 0xE4, 0x3A, 0xFA, 0x12, 0x26, 0x1E, 0xFF, 0x74, 0x03, 0x24, 0xFD, 0xFE, 0xEF, 0xC4, 0x54, +0x0F, 0xFD, 0xEF, 0x54, 0x0F, 0xFF, 0xED, 0x2E, 0x54, 0x0F, 0xFE, 0xC4, 0x54, 0xF0, 0x4F, 0x12, +0x26, 0x64, 0x12, 0x4F, 0xE4, 0x12, 0x86, 0xD2, 0xC4, 0x54, 0x0F, 0xFF, 0xC3, 0x94, 0x04, 0x90, +0xA2, 0x8F, 0x50, 0x05, 0x74, 0x04, 0xF0, 0x80, 0x02, 0xEF, 0xF0, 0x12, 0x4F, 0xE4, 0x12, 0x54, +0x20, 0xFD, 0x7F, 0x02, 0x12, 0x58, 0xF6, 0x12, 0x4F, 0xE4, 0x12, 0x76, 0xC7, 0xFF, 0x54, 0x01, +0xFE, 0x90, 0xA2, 0xCD, 0x12, 0x57, 0xC4, 0x12, 0x76, 0xC5, 0x12, 0x57, 0x5E, 0x90, 0xA2, 0xCD, +0x91, 0x00, 0x12, 0x76, 0xC4, 0x91, 0x09, 0x90, 0xA2, 0xCD, 0xF0, 0xEE, 0x54, 0x20, 0xFE, 0xEF, +0x54, 0xDF, 0x12, 0x76, 0xC4, 0x12, 0x57, 0x6A, 0x90, 0xA2, 0xCD, 0xF0, 0xE0, 0x12, 0x57, 0xF4, +0x20, 0xE0, 0x29, 0xEF, 0xC3, 0x13, 0x20, 0xE0, 0x0B, 0x75, 0x0E, 0x01, 0x90, 0xA3, 0x10, 0xE0, +0x60, 0x0B, 0x80, 0x0E, 0xE4, 0xF5, 0x0E, 0x90, 0xA3, 0x10, 0xE0, 0x60, 0x05, 0xE4, 0xF5, 0x0D, +0x80, 0x03, 0x75, 0x0D, 0x01, 0x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x12, 0x4A, 0x05, 0x90, 0xA3, 0x04, 0x02, 0x27, +0x48, 0x7F, 0x58, 0x7E, 0x0C, 0x12, 0x36, 0xCE, 0x90, 0xA3, 0x08, 0x02, 0x27, 0x48, 0x7E, 0x00, +0x7F, 0x19, 0x7D, 0x00, 0x7B, 0x01, 0x7A, 0xA3, 0x79, 0x01, 0x12, 0x4A, 0x6E, 0xB1, 0x21, 0x90, +0xA3, 0x08, 0x12, 0x4A, 0x12, 0x90, 0xA3, 0x04, 0x12, 0x27, 0x48, 0x90, 0xA1, 0x7C, 0xE0, 0xFF, +0x64, 0x02, 0x70, 0x22, 0xD1, 0x48, 0x30, 0xE0, 0x02, 0x7E, 0x01, 0x90, 0xA3, 0x10, 0xEE, 0xF0, +0xD1, 0x48, 0x30, 0xE1, 0x02, 0x7E, 0x01, 0x90, 0xA3, 0x11, 0xEE, 0xF0, 0x90, 0xFD, 0x80, 0xE0, +0x90, 0x02, 0xFB, 0xF0, 0x80, 0x3A, 0xEF, 0x64, 0x01, 0x70, 0x15, 0xB1, 0xE1, 0x30, 0xE0, 0x02, +0x7F, 0x01, 0x90, 0xA3, 0x10, 0xEF, 0xF0, 0xB1, 0xE1, 0x30, 0xE1, 0x02, 0x7F, 0x01, 0x80, 0x1B, +0x90, 0xA1, 0x7C, 0xE0, 0x64, 0x03, 0x70, 0x18, 0xB1, 0xDA, 0x30, 0xE0, 0x02, 0x7F, 0x01, 0x90, +0xA3, 0x10, 0xEF, 0xF0, 0xB1, 0xDA, 0x30, 0xE1, 0x02, 0x7F, 0x01, 0x90, 0xA3, 0x11, 0xEF, 0xF0, +0x90, 0xFD, 0x68, 0xE0, 0x44, 0x02, 0xF0, 0x7F, 0x01, 0x12, 0x95, 0x54, 0xB1, 0xE8, 0xD1, 0x57, +0x90, 0xA2, 0xE8, 0x74, 0x01, 0xF0, 0x90, 0xA3, 0x1D, 0xE0, 0x54, 0xFE, 0xF0, 0x90, 0x04, 0x8F, +0xE4, 0xF0, 0x90, 0x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, 0x01, 0xE6, 0xF0, +0xA3, 0xE0, 0x54, 0xFE, 0xF0, 0xEF, 0x30, 0xE0, 0x40, 0x90, 0x00, 0xA3, 0xE0, 0x54, 0xF8, 0x44, +0x05, 0xFD, 0x7F, 0xA3, 0x12, 0x3A, 0x96, 0x90, 0x00, 0xA0, 0xE0, 0x54, 0x0F, 0x64, 0x04, 0x70, +0x20, 0x90, 0xA3, 0x17, 0xE0, 0x30, 0xE0, 0x02, 0x80, 0x1F, 0x90, 0xFD, 0x62, 0xE0, 0xB4, 0xAD, +0x0E, 0xA3, 0xE0, 0xB4, 0x35, 0x09, 0xD1, 0xD9, 0x90, 0x01, 0xE5, 0x74, 0xDF, 0xF0, 0x22, 0x80, +0x00, 0x90, 0x01, 0xE7, 0xE0, 0x44, 0x01, 0xF0, 0x22, 0x90, 0x01, 0xE7, 0xE0, 0x54, 0xFE, 0xF0, +0x22, 0x25, 0xE0, 0xFF, 0x90, 0xA2, 0xF4, 0xE0, 0x22, 0x12, 0x26, 0x1E, 0x54, 0x01, 0x25, 0xE0, +0xD1, 0xE1, 0x54, 0xFB, 0x4F, 0xF0, 0xE0, 0x13, 0x13, 0x54, 0x3F, 0x30, 0xE0, 0x08, 0x90, 0x07, +0x65, 0xE0, 0x44, 0x18, 0xF0, 0x22, 0x90, 0xA3, 0x17, 0xE0, 0x20, 0xE0, 0x07, 0x90, 0x07, 0x65, +0xE0, 0x54, 0xE7, 0xF0, 0x22, 0x12, 0x26, 0x1E, 0x54, 0x01, 0x33, 0x33, 0x33, 0x54, 0xF8, 0xFF, +0x90, 0xA2, 0xF4, 0xE0, 0x54, 0xF7, 0x4F, 0xF0, 0x12, 0x5F, 0xB0, 0x90, 0x07, 0x65, 0x30, 0xE0, +0x04, 0x74, 0x18, 0xF0, 0x22, 0xE4, 0xF0, 0x22, 0x12, 0x26, 0x1E, 0x54, 0x01, 0xFF, 0x90, 0xA3, +0x2F, 0xE0, 0x54, 0xFE, 0x4F, 0xF0, 0x30, 0xE0, 0x55, 0x90, 0x00, 0x40, 0xE0, 0x54, 0xBF, 0x44, +0xA0, 0xFD, 0x7F, 0x40, 0x12, 0x3A, 0x96, 0x90, 0x00, 0x41, 0xE0, 0x44, 0x04, 0xFD, 0x7F, 0x41, +0x12, 0x3A, 0x96, 0x90, 0x00, 0x6A, 0xE0, 0x54, 0xFB, 0xFD, 0x7F, 0x6A, 0x12, 0x3A, 0x96, 0x90, +0x07, 0x6E, 0x74, 0x55, 0xF0, 0xA3, 0x74, 0x12, 0xF0, 0x90, 0x07, 0x78, 0xE0, 0x54, 0xF2, 0x44, +0x02, 0xF0, 0x90, 0x06, 0xCC, 0xE0, 0x44, 0x03, 0xF0, 0x90, 0x07, 0x65, 0xE0, 0x54, 0xF5, 0xF0, +0x90, 0x05, 0x23, 0xE0, 0x54, 0x7F, 0xF0, 0xE4, 0xFD, 0x7F, 0x66, 0x12, 0x3A, 0x96, 0x22, 0xE4, +0x90, 0xA2, 0x6C, 0xF0, 0xA3, 0xF0, 0x90, 0xA1, 0xD4, 0xF0, 0xA3, 0xF0, 0x22, 0x90, 0xA4, 0x46, +0xEF, 0xF0, 0xA3, 0x12, 0x4A, 0x3F, 0x90, 0xA4, 0x6C, 0xE0, 0xFE, 0x04, 0xF0, 0x90, 0x00, 0x01, +0xEE, 0x12, 0x26, 0x76, 0x74, 0x00, 0x2F, 0xF9, 0xE4, 0x34, 0xFB, 0xFA, 0x7B, 0x01, 0xC0, 0x03, +0xC0, 0x02, 0xC0, 0x01, 0x90, 0xA4, 0x47, 0x12, 0x4A, 0x36, 0x8B, 0x40, 0x8A, 0x41, 0x89, 0x42, +0x75, 0x43, 0x02, 0xD0, 0x01, 0xD0, 0x02, 0xD0, 0x03, 0x12, 0x34, 0x2C, 0x90, 0xA4, 0x46, 0xE0, +0x24, 0x02, 0xF9, 0xE4, 0x34, 0xFB, 0xFA, 0x7B, 0x01, 0xC0, 0x03, 0xC0, 0x02, 0xC0, 0x01, 0xA3, +0x12, 0x4A, 0x36, 0xE9, 0x24, 0x02, 0xF9, 0xE4, 0x3A, 0x8B, 0x40, 0xF5, 0x41, 0x89, 0x42, 0x90, +0xA4, 0x47, 0x11, 0x1F, 0xF5, 0x43, 0xD0, 0x01, 0xD0, 0x02, 0xD0, 0x03, 0x02, 0x34, 0x2C, 0x12, +0x4A, 0x36, 0x90, 0x00, 0x0E, 0x02, 0x26, 0x37, 0x90, 0xA4, 0x6D, 0x12, 0x4A, 0x3F, 0xE4, 0xFF, +0x90, 0xA4, 0x6D, 0x12, 0x4A, 0x36, 0x8F, 0x82, 0x75, 0x83, 0x00, 0x12, 0x26, 0x37, 0xFE, 0x74, +0xF0, 0x2F, 0x11, 0x4C, 0xEE, 0xF0, 0x0F, 0xEF, 0xB4, 0x10, 0xE5, 0x22, 0xF5, 0x82, 0xE4, 0x34, +0x02, 0xF5, 0x83, 0x22, 0xE4, 0xF5, 0x55, 0xF5, 0x56, 0xF5, 0x57, 0x75, 0x58, 0x80, 0xAD, 0x55, +0x7F, 0x50, 0x12, 0x3A, 0x96, 0xAD, 0x56, 0x7F, 0x51, 0x12, 0x3A, 0x96, 0xAD, 0x57, 0x7F, 0x52, +0x12, 0x3A, 0x96, 0xAD, 0x58, 0x7F, 0x53, 0x02, 0x3A, 0x96, 0x75, 0x5D, 0x12, 0xE4, 0xF5, 0x5E, +0x75, 0x5F, 0x07, 0x75, 0x60, 0x72, 0x90, 0x01, 0x30, 0xE5, 0x5D, 0xF0, 0xA3, 0xE5, 0x5E, 0xF0, +0xA3, 0xE5, 0x5F, 0xF0, 0xA3, 0xE5, 0x60, 0xF0, 0x22, 0x75, 0x65, 0x0E, 0x75, 0x66, 0x01, 0x75, +0x67, 0x03, 0x75, 0x68, 0x62, 0x43, 0x65, 0x01, 0x90, 0x01, 0x38, 0xE5, 0x65, 0xF0, 0xA3, 0xE5, +0x66, 0xF0, 0xA3, 0xE5, 0x67, 0xF0, 0xA3, 0xE5, 0x68, 0xF0, 0x22, 0x90, 0x01, 0x94, 0xE0, 0x44, +0x01, 0xF0, 0x90, 0x01, 0xC7, 0xE4, 0xF0, 0x22, 0x90, 0x01, 0x01, 0xE0, 0x44, 0x04, 0xF0, 0x90, +0x01, 0x9C, 0x74, 0x7E, 0xF0, 0xA3, 0x74, 0x92, 0xF0, 0xA3, 0x74, 0xA0, 0xF0, 0xA3, 0x74, 0x24, +0xF0, 0x90, 0x01, 0x9B, 0x74, 0x49, 0xF0, 0x90, 0x01, 0x9A, 0x74, 0xE0, 0xF0, 0x90, 0x01, 0x99, +0xE4, 0xF0, 0x90, 0x01, 0x98, 0x04, 0xF0, 0x22, 0x7D, 0x02, 0x90, 0x01, 0xC4, 0x74, 0xF8, 0xF0, +0x74, 0xA0, 0xA3, 0xF0, 0x90, 0xA3, 0x30, 0xE0, 0xFF, 0xED, 0xC3, 0x9F, 0x50, 0x10, 0xED, 0x25, +0xE0, 0x24, 0x81, 0xF8, 0xE6, 0x30, 0xE4, 0x03, 0x7F, 0x00, 0x22, 0x0D, 0x80, 0xE6, 0x74, 0xF8, +0x04, 0x90, 0x01, 0xC4, 0xF0, 0x74, 0xA0, 0xA3, 0xF0, 0x7F, 0x01, 0x22, 0xE4, 0x90, 0xA1, 0x76, +0x12, 0x50, 0x66, 0xA3, 0xF0, 0x22, 0x90, 0x01, 0xE4, 0x74, 0x26, 0xF0, 0xA3, 0xE4, 0xF0, 0x22, +0x90, 0x01, 0x34, 0xE0, 0x55, 0x5D, 0xF5, 0x61, 0xA3, 0xE0, 0x55, 0x5E, 0xF5, 0x62, 0xA3, 0xE0, +0x55, 0x5F, 0xF5, 0x63, 0xA3, 0xE0, 0x55, 0x60, 0xF5, 0x64, 0x90, 0x01, 0x34, 0xE5, 0x61, 0xF0, +0xA3, 0xE5, 0x62, 0xF0, 0xA3, 0xE5, 0x63, 0xF0, 0xA3, 0xE5, 0x64, 0xF0, 0x22, 0x90, 0x01, 0x3C, +0xE0, 0x55, 0x65, 0xF5, 0x69, 0xA3, 0xE0, 0x55, 0x66, 0xF5, 0x6A, 0xA3, 0xE0, 0x55, 0x67, 0xF5, +0x6B, 0xA3, 0xE0, 0x55, 0x68, 0xF5, 0x6C, 0x90, 0x01, 0x3C, 0xE5, 0x69, 0xF0, 0xA3, 0xE5, 0x6A, +0xF0, 0xA3, 0xE5, 0x6B, 0xF0, 0xA3, 0xE5, 0x6C, 0xF0, 0x53, 0x91, 0xDF, 0x22, 0x90, 0x01, 0xCF, +0xE0, 0x90, 0xA3, 0x96, 0xF0, 0xE0, 0xFF, 0x30, 0xE0, 0x07, 0x90, 0x01, 0xCF, 0xE0, 0x54, 0xFE, +0xF0, 0xEF, 0x30, 0xE5, 0x23, 0x90, 0x01, 0xCF, 0xE0, 0x54, 0xDF, 0xF0, 0x90, 0x01, 0x34, 0x74, +0x20, 0xF0, 0xE4, 0xF5, 0xA8, 0xF5, 0xE8, 0x12, 0x50, 0x40, 0x90, 0x00, 0x03, 0xE0, 0x54, 0xFB, +0xFD, 0x7F, 0x03, 0x12, 0x3A, 0x96, 0x80, 0xFE, 0x22, 0x90, 0xA2, 0x8A, 0xE0, 0x64, 0x02, 0x60, +0x03, 0x12, 0x86, 0xF8, 0x22, 0x31, 0xF7, 0x70, 0x0D, 0x90, 0xA2, 0x87, 0xE0, 0x60, 0x07, 0x51, +0x1A, 0xB1, 0x74, 0x12, 0x7C, 0xC9, 0x22, 0xE4, 0xFF, 0x12, 0x77, 0xC7, 0xEF, 0x64, 0x01, 0x22, +0x31, 0xF7, 0x70, 0x15, 0x90, 0xA2, 0x87, 0xE0, 0x60, 0x0F, 0x51, 0x1A, 0x90, 0xA2, 0x83, 0xE0, +0x91, 0xF7, 0xF0, 0x54, 0x07, 0x70, 0x02, 0x91, 0xED, 0x22, 0x90, 0x01, 0x57, 0xE4, 0xF0, 0x90, +0x01, 0x3C, 0x74, 0x02, 0xF0, 0x22, 0xEF, 0x60, 0x2C, 0x31, 0xF7, 0x70, 0x28, 0x90, 0xA2, 0x84, +0xE0, 0x54, 0xFE, 0xF0, 0x7D, 0x2B, 0x7F, 0x0F, 0x12, 0x5B, 0x63, 0x90, 0x06, 0x04, 0xE0, 0x54, +0xBF, 0xF0, 0xB1, 0x6D, 0xBF, 0x01, 0x0E, 0x90, 0xA2, 0x83, 0xE0, 0x44, 0x40, 0xF0, 0x7D, 0x06, +0x7F, 0x01, 0x12, 0x58, 0xF6, 0x22, 0xE4, 0x90, 0xA3, 0xA6, 0xF0, 0x90, 0xA2, 0x87, 0xE0, 0x60, +0x2F, 0x31, 0xF7, 0x70, 0x2B, 0xD1, 0xF8, 0xF0, 0x51, 0x91, 0xE4, 0x90, 0xA2, 0x8E, 0xF0, 0x04, +0x60, 0x1E, 0x91, 0x71, 0xE4, 0x90, 0xA4, 0x29, 0xF0, 0x90, 0xA2, 0x8F, 0xE0, 0x90, 0xA4, 0x2A, +0x12, 0x7C, 0xC9, 0x90, 0xA2, 0x8A, 0xE0, 0x20, 0xE2, 0x03, 0x12, 0x59, 0x7C, 0x12, 0x96, 0x79, +0x22, 0x90, 0xA3, 0xA6, 0x74, 0x01, 0xF0, 0x22, 0xAD, 0x07, 0xED, 0x70, 0x19, 0x71, 0x1C, 0x70, +0x02, 0x80, 0x17, 0xBC, 0x01, 0x02, 0x80, 0x19, 0x71, 0x1C, 0xBC, 0x02, 0x02, 0x80, 0x1B, 0xEC, +0x64, 0x03, 0x70, 0x22, 0x80, 0x1B, 0x71, 0x24, 0x70, 0x04, 0x7F, 0x01, 0x80, 0x15, 0xBC, 0x01, +0x04, 0x7F, 0x03, 0x80, 0x0E, 0x71, 0x24, 0xBC, 0x02, 0x04, 0x7F, 0x09, 0x80, 0x05, 0xBC, 0x03, +0x05, 0x7F, 0x0D, 0x12, 0x95, 0x54, 0x90, 0xA3, 0x1D, 0xE0, 0xC4, 0x13, 0x54, 0x07, 0x30, 0xE0, +0x3A, 0xED, 0x70, 0x1B, 0xA3, 0xE0, 0x13, 0x13, 0x54, 0x3F, 0x30, 0xE0, 0x07, 0xE4, 0x90, 0xA3, +0xA6, 0xF0, 0x80, 0x02, 0x51, 0x91, 0x90, 0xA3, 0xA6, 0xE0, 0xFD, 0xE4, 0xFF, 0x80, 0x19, 0x90, +0xA3, 0x1E, 0x12, 0x5F, 0xF0, 0x30, 0xE0, 0x07, 0xE4, 0x90, 0xA3, 0xA6, 0xF0, 0x80, 0x02, 0x51, +0x91, 0x90, 0xA3, 0xA6, 0xE0, 0xFD, 0x7F, 0x01, 0x12, 0x54, 0x2B, 0x22, 0x90, 0xA3, 0x1E, 0xE0, +0x54, 0x03, 0xFC, 0x22, 0x90, 0xA3, 0x1E, 0xE0, 0xC4, 0x54, 0x03, 0xFC, 0x22, 0xD3, 0x10, 0xAF, +0x01, 0xC3, 0xC0, 0xD0, 0x90, 0xA3, 0x24, 0xE0, 0xB4, 0x01, 0x02, 0x80, 0x43, 0x90, 0xA3, 0x24, +0xE0, 0xB4, 0x02, 0x11, 0x71, 0xA2, 0x7F, 0x01, 0x12, 0x97, 0x2E, 0x51, 0x98, 0x90, 0xA3, 0x24, +0x74, 0x03, 0xF0, 0x80, 0x3E, 0x90, 0xA3, 0x24, 0xE0, 0x64, 0x03, 0x70, 0x1C, 0x90, 0xA3, 0x27, +0x71, 0xA5, 0xE4, 0xFF, 0x12, 0x97, 0x2E, 0x51, 0x98, 0x71, 0x98, 0xE4, 0xFB, 0xFD, 0x12, 0x5E, +0x6F, 0x90, 0xA3, 0x24, 0x74, 0x04, 0xF0, 0x80, 0x1A, 0x90, 0xA3, 0x24, 0xE0, 0xB4, 0x04, 0x13, +0x71, 0x98, 0x7B, 0x01, 0x7D, 0x01, 0x12, 0x5E, 0x6F, 0x90, 0xA3, 0x24, 0x74, 0x02, 0xF0, 0x90, +0xA3, 0x22, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0xA3, 0x1D, 0xE0, 0xC3, 0x13, 0x54, 0x03, +0xFF, 0x22, 0x90, 0xA3, 0x29, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0xAD, 0x07, 0xEE, 0xFF, 0x90, 0x01, +0x53, 0xE4, 0xF0, 0x8F, 0x35, 0xAF, 0x05, 0x8F, 0x36, 0xFB, 0xFD, 0x7F, 0x50, 0x7E, 0x01, 0x12, +0x39, 0x62, 0x90, 0x01, 0x53, 0x74, 0x05, 0xF0, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, +0x90, 0xA3, 0x1D, 0xE0, 0x30, 0xE0, 0x1F, 0x90, 0xA3, 0x22, 0xE0, 0xB4, 0x01, 0x0C, 0xA3, 0xE0, +0xB4, 0x01, 0x13, 0x74, 0x02, 0xF0, 0x71, 0xA2, 0x80, 0x0C, 0x90, 0xA3, 0x22, 0xE0, 0xB4, 0x02, +0x05, 0x74, 0x03, 0xF0, 0x71, 0x2D, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xE4, 0xF5, 0x21, 0x90, 0xA2, +0x87, 0xE0, 0x60, 0x62, 0x31, 0xF7, 0x70, 0x5E, 0x12, 0x87, 0xDA, 0x60, 0x22, 0x24, 0xFE, 0x60, +0x03, 0x04, 0x70, 0x1E, 0x90, 0xA2, 0x8E, 0xE0, 0x14, 0xF0, 0xE0, 0xFF, 0x60, 0x06, 0x90, 0xA2, +0x90, 0xE0, 0x60, 0x0E, 0xEF, 0x70, 0x08, 0x90, 0xA2, 0x8D, 0xE0, 0xA3, 0xF0, 0x80, 0x00, 0x75, +0x21, 0x01, 0xE5, 0x21, 0x60, 0x30, 0x91, 0x71, 0x90, 0xA2, 0x90, 0xE0, 0x60, 0x03, 0xB4, 0x01, +0x04, 0x91, 0x67, 0x80, 0x08, 0x91, 0x67, 0x75, 0xF0, 0x03, 0xA4, 0x24, 0xFE, 0xFF, 0x90, 0xA2, +0x8F, 0xE0, 0x2F, 0x90, 0xA4, 0x2A, 0x12, 0x7C, 0xC9, 0x90, 0xA2, 0x8A, 0xE0, 0x20, 0xE2, 0x03, +0x12, 0x59, 0x7C, 0x12, 0x96, 0x79, 0x22, 0xE4, 0x90, 0xA4, 0x29, 0xF0, 0x90, 0xA2, 0x90, 0xE0, +0x22, 0x90, 0xA2, 0x8B, 0xE0, 0x44, 0x10, 0xF0, 0x22, 0xF1, 0x00, 0x30, 0xE0, 0x0C, 0xEF, 0xC4, +0x13, 0x13, 0x54, 0x03, 0x30, 0xE0, 0x03, 0x12, 0x8E, 0x22, 0x90, 0xA2, 0x83, 0x12, 0x93, 0xF9, +0x30, 0xE0, 0x0A, 0xEF, 0x91, 0xF7, 0xF0, 0x54, 0x07, 0x70, 0x49, 0x80, 0x45, 0x90, 0xA2, 0x90, +0xE0, 0x04, 0xF0, 0x90, 0xA2, 0x8B, 0xE0, 0x54, 0xEF, 0xF0, 0x90, 0xA2, 0xC8, 0xE0, 0xFF, 0x90, +0xA2, 0x90, 0xE0, 0xD3, 0x9F, 0x40, 0x2B, 0x31, 0xF7, 0x70, 0x29, 0x90, 0xA2, 0x85, 0xE0, 0x54, +0x0F, 0x70, 0x02, 0x80, 0x20, 0x90, 0xA2, 0x91, 0xE0, 0x04, 0xF0, 0xE0, 0xD3, 0x94, 0x02, 0x40, +0x09, 0x91, 0xE5, 0xE4, 0x90, 0xA2, 0x91, 0xF0, 0x80, 0x02, 0xB1, 0x01, 0xE4, 0x90, 0xA2, 0x90, +0xF0, 0x22, 0x91, 0xED, 0x22, 0x90, 0xA2, 0x84, 0xE0, 0x54, 0xFB, 0xF0, 0x22, 0x90, 0xA2, 0x89, +0xE0, 0xFF, 0x7D, 0x01, 0x02, 0x59, 0x80, 0x54, 0xFB, 0xF0, 0x90, 0xA2, 0x8B, 0xE0, 0x54, 0xFD, +0x22, 0xD1, 0x24, 0x90, 0xA2, 0x8A, 0xE0, 0x64, 0x0C, 0x60, 0x05, 0x12, 0x5B, 0x5A, 0xB1, 0x6D, +0x22, 0xE4, 0xF5, 0x21, 0x90, 0x06, 0xA9, 0xE0, 0xF5, 0x21, 0x54, 0xC0, 0x70, 0x07, 0xB1, 0x65, +0x54, 0xFD, 0xF0, 0x80, 0xC8, 0xE5, 0x21, 0x30, 0xE6, 0x1B, 0x90, 0xA2, 0x87, 0xE0, 0x64, 0x01, +0x70, 0x15, 0x90, 0xA2, 0x8B, 0xE0, 0x44, 0x01, 0xF0, 0xB1, 0xC4, 0x60, 0x04, 0xB1, 0xCD, 0x80, +0x06, 0xB1, 0x01, 0x80, 0x02, 0xB1, 0x65, 0xE5, 0x21, 0x90, 0xA2, 0x8B, 0x30, 0xE7, 0x11, 0xE0, +0x44, 0x02, 0xF0, 0xB1, 0x74, 0x12, 0x7C, 0xC9, 0x90, 0xA2, 0x83, 0xE0, 0x44, 0x04, 0xF0, 0x22, +0xE0, 0x54, 0xFD, 0xF0, 0x22, 0x90, 0xA2, 0x8B, 0xE0, 0x54, 0xFE, 0xF0, 0x22, 0x7D, 0x08, 0xE4, +0xFF, 0x02, 0x5B, 0x79, 0xE4, 0x90, 0xA4, 0x29, 0xF0, 0x90, 0xA2, 0xC9, 0xE0, 0x90, 0xA4, 0x2A, +0x22, 0x90, 0xA2, 0x87, 0xE0, 0x60, 0x0E, 0x90, 0x06, 0x92, 0xE0, 0x30, 0xE1, 0x02, 0xC1, 0x24, +0x12, 0x8E, 0xAA, 0x91, 0xED, 0x22, 0xE4, 0xFF, 0x12, 0x77, 0xC7, 0xBF, 0x01, 0x0E, 0x90, 0xA2, +0x87, 0xE0, 0x60, 0x08, 0xB1, 0x65, 0x54, 0x07, 0x70, 0x02, 0x91, 0xED, 0x22, 0xE4, 0xFF, 0x12, +0x77, 0xC7, 0xBF, 0x01, 0x0E, 0x90, 0xA2, 0x87, 0xE0, 0x60, 0x08, 0xB1, 0xC4, 0x60, 0x02, 0x80, +0x0C, 0xB1, 0x01, 0x22, 0x90, 0xA2, 0x85, 0xE0, 0x54, 0x0F, 0x64, 0x02, 0x22, 0x90, 0xA2, 0xCD, +0xE0, 0xC4, 0x54, 0x0F, 0x20, 0xE0, 0x1D, 0x90, 0x04, 0x1D, 0xE0, 0x70, 0x17,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0x18, 0xEF, 0x54, 0xFD, 0xF0, 0x90, 0x04, 0xE0, 0xE0, 0x90, +0xA2, 0xD6, 0x30, 0xE1, 0x06, 0xE0, 0x44, 0x04, 0xF0, 0x80, 0x04, 0xE0, 0x54, 0xFB, 0xF0, 0x90, +0x04, 0xE0, 0xE0, 0x30, 0xE1, 0x02, 0xD1, 0xC2, 0x22, 0xF0, 0x90, 0x04, 0xE0, 0xE0, 0x90, 0xA2, +0x84, 0x22, 0x90, 0xA3, 0x31, 0xE0, 0x30, 0xE0, 0x24, 0xC3, 0x13, 0x54, 0x07, 0xD1, 0xEE, 0xE0, +0xFE, 0x30, 0xE0, 0x19, 0x75, 0xF0, 0x0E, 0xEF, 0xD1, 0xF2, 0xEE, 0x54, 0xFE, 0xF0, 0x90, 0xA3, +0x33, 0x74, 0x05, 0xF0, 0x12, 0x5F, 0xDB, 0xFD, 0x7F, 0x01, 0x12, 0x7F, 0xB6, 0x22, 0xFF, 0x75, +0xF0, 0x0E, 0x90, 0xA3, 0x3C, 0x02, 0x4A, 0x2A, 0x90, 0xA2, 0x8D, 0xE0, 0x90, 0x05, 0x73, 0x22, +0x90, 0xA2, 0x84, 0xE0, 0xFF, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x22, 0x90, 0xA2, 0x87, 0xE0, 0x60, +0x02, 0x91, 0x79, 0x02, 0x5E, 0xDC, 0x51, 0x56, 0x7D, 0x02, 0x7F, 0x02, 0x12, 0x87, 0xCE, 0x02, +0x8D, 0xAA, 0x90, 0xA2, 0x87, 0xE0, 0x60, 0x03, 0x12, 0x97, 0x9E, 0x22, 0xF1, 0xEA, 0x90, 0xA3, +0xA6, 0xEF, 0xF0, 0x30, 0xE0, 0x05, 0x7D, 0x01, 0xE4, 0x80, 0x02, 0xE4, 0xFD, 0xFF, 0x12, 0x58, +0xF6, 0x90, 0xA3, 0xA6, 0xE0, 0x30, 0xE6, 0x11, 0x90, 0x01, 0x2F, 0xE0, 0x30, 0xE7, 0x04, 0xE4, +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, 0x22, 0xC3, 0x90, 0xA3, 0xA9, 0xE0, 0x94, 0x64, +0x90, 0xA3, 0xA8, 0xE0, 0x94, 0x00, 0x40, 0x0D, 0x90, 0x01, 0xC0, 0xE0, 0x44, 0x40, 0xF0, 0x90, +0xA3, 0xA7, 0xE0, 0xFF, 0x22, 0x90, 0xA3, 0xA8, 0x12, 0x79, 0xC5, 0x80, 0xC6, 0x90, 0x01, 0xC4, +0x74, 0x2D, 0xF0, 0x74, 0xA8, 0xA3, 0xF0, 0x90, 0x00, 0x90, 0xE0, 0x20, 0xE0, 0xF9, 0x74, 0x2D, +0x04, 0x90, 0x01, 0xC4, 0xF0, 0x74, 0xA8, 0xA3, 0xF0, 0x22, 0x90, 0xA2, 0x84, 0xE0, 0x44, 0x10, +0xF0, 0x90, 0xA1, 0x7C, 0xE0, 0xB4, 0x03, 0x0C, 0x90, 0x00, 0x70, 0xE0, 0x44, 0x80, 0xFD, 0x7F, +0x70, 0x12, 0x3A, 0x96, 0x90, 0xA2, 0x92, 0xE0, 0xFD, 0x7F, 0x93, 0x12, 0x3A, 0x96, 0x90, 0xA2, +0x88, 0xE0, 0x60, 0x12, 0x90, 0x01, 0x2F, 0xE0, 0x30, 0xE7, 0x05, 0x74, 0x10, 0xF0, 0x80, 0x06, +0x90, 0x01, 0x2F, 0x74, 0x90, 0xF0, 0x90, 0x00, 0x08, 0xE0, 0x44, 0x10, 0xFD, 0x7F, 0x08, 0x12, +0x3A, 0x96, 0x7F, 0x01, 0x12, 0x7B, 0x4B, 0x90, 0x00, 0x90, 0xE0, 0x44, 0x01, 0xFD, 0x7F, 0x90, +0x12, 0x3A, 0x96, 0x7F, 0x14, 0x7E, 0x00, 0x02, 0x3A, 0xF7, 0x7E, 0xFF, 0x74, 0xA1, 0x2F, 0x12, +0x62, 0x4C, 0x74, 0xFF, 0xF0, 0xED, 0xB4, 0x3E, 0x0D, 0x7E, 0xBD, 0x74, 0xA1, 0x2F, 0x12, 0x62, +0x4C, 0x74, 0x3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, 0xEF, 0xF0, 0x22, 0x24, 0x11, +0xF5, 0x82, 0xE4, 0x34, 0x99, 0xF5, 0x83, 0x22, 0xEF, 0x60, 0x0A, 0xED, 0xC3, 0x94, 0x2C, 0x40, +0x04, 0x7E, 0x20, 0x80, 0x02, 0xE4, 0xFE, 0xC3, 0xED, 0x9E, 0xFF, 0x22, 0xEF, 0x60, 0x0A, 0xED, +0xD3, 0x94, 0x0B, 0x40, 0x04, 0x7E, 0x20, 0x80, 0x02, 0xE4, 0xFE, 0xED, 0x2E, 0xFF, 0x22, 0xE4, +0xF5, 0x1A, 0x74, 0x91, 0x2F, 0x12, 0x6A, 0xA9, 0xE0, 0xFE, 0xB4, 0x05, 0x08, 0xED, 0xC3, 0x94, +0x3B, 0x40, 0x51, 0x80, 0x47, 0xEE, 0xB4, 0x04, 0x08, 0xED, 0xC3, 0x94, 0x31, 0x40, 0x45, 0x80, +0x3B, 0x74, 0x91, 0x2F, 0x12, 0x6A, 0xA9, 0xE0, 0xFE, 0xB4, 0x03, 0x08, 0xED, 0xC3, 0x94, 0x19, +0x40, 0x32, 0x80, 0x28, 0xEE, 0xB4, 0x02, 0x08, 0xED, 0xC3, 0x94, 0x11, 0x40, 0x26, 0x80, 0x1C, +0x74, 0x91, 0x2F, 0x12, 0x6A, 0xA9, 0xE0, 0xFE, 0xB4, 0x01, 0x08, 0xED, 0xC3, 0x94, 0x0A, 0x40, +0x13, 0x80, 0x09, 0xEE, 0x70, 0x0B, 0xED, 0xC3, 0x94, 0x03, 0x40, 0x08, 0x75, 0x1A, 0x01, 0x80, +0x03, 0xE4, 0xF5, 0x1A, 0xAF, 0x1A, 0x22, 0x8F, 0x0E, 0x8D, 0x0F, 0x8B, 0x10, 0x75, 0xF0, 0x04, +0xEF, 0x12, 0x4F, 0x3D, 0xC4, 0x54, 0x03, 0x90, 0xA3, 0x7E, 0xF0, 0x90, 0xA3, 0x7C, 0x60, 0x09, +0x74, 0x32, 0xF0, 0xA3, 0x74, 0x2F, 0x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0x00, 0x00, 0x0C, 0x00, 0x80, 0x14, 0x90, +0xA3, 0xF0, 0x12, 0x27, 0x54, 0x00, 0x00, 0x0C, 0x00, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x00, +0x00, 0x08, 0x00, 0x12, 0x54, 0xD3, 0x90, 0xA4, 0x85, 0xE0, 0x70, 0x21, 0x91, 0x90, 0x60, 0x04, +0xEF, 0xB4, 0x0E, 0x19, 0x90, 0xA3, 0xF0, 0x12, 0x27, 0x54, 0x00, 0x00, 0x03, 0x00, 0x90, 0xA3, +0xF4, 0x12, 0x27, 0x54, 0x00, 0x00, 0x03, 0x00, 0x12, 0x54, 0xD3, 0x80, 0x0E, 0x90, 0xA4, 0x85, +0xE0, 0xB4, 0x01, 0x1D, 0x90, 0xA4, 0x84, 0xE0, 0xB4, 0x0B, 0x16, 0x90, 0xA3, 0xF0, 0x12, 0x27, +0x54, 0x40, 0x00, 0x00, 0x00, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x40, 0x00, 0x00, 0x00, 0x80, +0x30, 0x90, 0xA4, 0x85, 0xE0, 0x64, 0x02, 0x60, 0x76, 0x90, 0xA3, 0xF0, 0x12, 0x27, 0x54, 0x00, +0x00, 0x03, 0x00, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x00, 0x00, 0x02, 0x00, 0x12, 0x57, 0x03, +0x12, 0x27, 0x54, 0x40, 0x00, 0x00, 0x00, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, +0x00, 0x7F, 0xC4, 0x80, 0x45, 0x90, 0xA4, 0x85, 0xE0, 0x70, 0x20, 0x91, 0x90, 0x60, 0x04, 0xEF, +0xB4, 0x0E, 0x18, 0x90, 0xA3, 0xF0, 0x12, 0x27, 0x54, 0x00, 0x00, 0x03, 0x00, 0x90, 0xA3, 0xF4, +0x12, 0x27, 0x54, 0x00, 0x00, 0x03, 0x00, 0x7F, 0xAC, 0x80, 0x1F, 0x90, 0xA4, 0x84, 0xE0, 0xD3, +0x94, 0x0E, 0x50, 0x1B, 0x90, 0xA3, 0xF0, 0x12, 0x27, 0x54, 0x00, 0x00, 0x03, 0x00, 0x90, 0xA3, +0xF4, 0x12, 0x27, 0x54, 0x00, 0x00, 0x02, 0x00, 0x7F, 0xAC, 0x7E, 0x08, 0x12, 0x54, 0xD7, 0x22, +0x90, 0xA4, 0x84, 0xE0, 0xFF, 0x64, 0x0D, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xA9, +0x07, 0x90, 0x06, 0x69, 0xE0, 0xFE, 0x90, 0x06, 0x68, 0xE0, 0x7A, 0x00, 0x24, 0x00, 0xFF, 0xEA, +0x3E, 0xFE, 0xE9, 0x14, 0x60, 0x0F, 0x14, 0x60, 0x1E, 0x24, 0x02, 0x70, 0x25, 0xEE, 0x54, 0xFE, +0xFE, 0x91, 0xE7, 0x80, 0x1A, 0xEF, 0x44, 0x80, 0xFF, 0xEE, 0x54, 0xFE, 0xFC, 0x90, 0x06, 0x68, +0xEF, 0xF0, 0xEC, 0xA3, 0xF0, 0x80, 0x0B, 0xEE, 0x44, 0x01, 0xFC, 0x91, 0xE7, 0xAE, 0x04, 0xEE, +0xA3, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xEF, 0x54, 0x7F, 0x90, 0x06, 0x68, 0xF0, 0x22, 0x90, +0xA4, 0x77, 0xED, 0xF0, 0x90, 0xA4, 0x76, 0xEF, 0xF0, 0x70, 0x64, 0x90, 0xA3, 0xF0, 0x12, 0x27, +0x54, 0x30, 0x00, 0x00, 0x00, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x74, +0x08, 0xFF, 0xFE, 0x12, 0x57, 0x07, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x0E, 0x90, 0xA3, 0xF4, +0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x08, 0x7F, 0x30, 0x12, 0x57, 0x05, 0x12, 0x27, 0x54, 0x00, +0x00, 0x00, 0x03, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x01, 0xB1, 0xD6, 0x12, +0x27, 0x54, 0x30, 0x00, 0x00, 0x00, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x30, 0x00, 0x00, 0x00, +0x74, 0x08, 0xFF, 0xFE, 0x12, 0x54, 0xD7, 0x90, 0x04, 0x54, 0xE0, 0x54, 0x7F, 0x80, 0x6D, 0x90, +0xA4, 0x76, 0xE0, 0x64, 0x01, 0x70, 0x64, 0x90, 0x04, 0x54, 0xE0, 0x44, 0x80, 0xB1, 0xCC, 0x90, +0xA3, 0xF0, 0x12, 0x27, 0x54, 0x30, 0x00, 0x00, 0x00, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x00, +0x00, 0x00, 0x00, 0x74, 0x08, 0xFF, 0xFE, 0x12, 0x57, 0x07, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, +0x0E, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x06, 0x7F, 0x30, 0x12, 0x57, 0x05, +0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x03, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, +0x02, 0xB1, 0xD6, 0x12, 0x27, 0x54, 0x30, 0x00, 0x00, 0x00, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, +0x20, 0x00, 0x00, 0x00, 0x74, 0x08, 0xFF, 0xFE, 0x12, 0x54, 0xD7, 0x22, 0x90, 0xA4, 0x78, 0xF0, +0xE0, 0x90, 0x04, 0x54, 0xF0, 0x22, 0x7F, 0x34, 0x7E, 0x08, 0x12, 0x54, 0xD7, 0x90, 0xA4, 0x76, +0xE0, 0xFF, 0xA3, 0xE0, 0xFD, 0xD1, 0x4E, 0x90, 0xA3, 0xF0, 0x22, 0xE4, 0xFE, 0xFC, 0xEF, 0x64, +0x02, 0x70, 0x40, 0xED, 0xB4, 0x01, 0x04, 0x7E, 0x0A, 0x80, 0x06, 0xED, 0xB4, 0x02, 0x02, 0x7E, +0x09, 0xEB, 0xB4, 0x01, 0x08, 0xED, 0xB4, 0x01, 0x04, 0x7C, 0x04, 0x80, 0x38, 0xEB, 0xB4, 0x02, +0x08, 0xED, 0xB4, 0x01, 0x04, 0x7C, 0x02, 0x80, 0x2C, 0xEB, 0xB4, 0x01, 0x08, 0xED, 0xB4, 0x02, +0x04, 0x7C, 0x01, 0x80, 0x20, 0xEB, 0x64, 0x02, 0x70, 0x1B, 0xED, 0x64, 0x02, 0x70, 0x16, 0x7C, +0x03, 0x80, 0x12, 0xEF, 0xB4, 0x01, 0x0E, 0xEB, 0xB4, 0x02, 0x04, 0x7C, 0x01, 0x80, 0x06, 0xEB, +0xB4, 0x01, 0x02, 0x7C, 0x02, 0xAF, 0x06, 0xEF, 0xC4, 0x54, 0xF0, 0x4C, 0xFF, 0x22, 0x90, 0xA4, +0x8E, 0xED, 0xF0, 0xEF, 0x60, 0x02, 0xE1, 0x25, 0xE0, 0x24, 0xFD, 0x50, 0x0B, 0x60, 0x1F, 0x14, +0x60, 0x33, 0x14, 0x60, 0x73, 0x02, 0xB0, 0xBD, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x77, +0x77, 0x77, 0x12, 0x96, 0x56, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, 0x77, 0xE1, 0xA0, 0x90, 0xAC, +0xB9, 0x12, 0x27, 0x54, 0x54, 0x33, 0x77, 0x70, 0x12, 0x96, 0x56, 0x12, 0x27, 0x54, 0x54, 0x33, +0x77, 0x70, 0x02, 0xB0, 0x25, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, 0x77, 0x12, +0x96, 0x56, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, 0x77, 0x12, 0xB0, 0xBE, 0x12, 0x27, 0x54, 0x3F, +0xF0, 0x00, 0x00, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x00, 0x10, 0x00, 0x00, 0x7F, 0xB4, 0x7E, +0x0C, 0x12, 0x57, 0x07, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA3, 0xF4, 0x12, 0x27, +0x54, 0x00, 0x10, 0x00, 0x00, 0x02, 0xB0, 0xB6, 0x90, 0xA3, 0xF0, 0x12, 0x27, 0x54, 0x00, 0x00, +0x00, 0xFF, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x77, 0x12, 0xB0, 0xC9, 0x12, +0x27, 0x54, 0x77, 0x77, 0x77, 0x77, 0x12, 0xB0, 0xBE, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, +0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0C, 0x12, 0x57, +0x07, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x00, 0x00, +0x00, 0x00, 0x02, 0xB0, 0xB6, 0x90, 0xA4, 0x8E, 0xE0, 0x14, 0x60, 0x60, 0x14, 0x70, 0x02, 0xE1, +0xCF, 0x14, 0x70, 0x03, 0x02, 0xB0, 0x11, 0x14, 0x70, 0x02, 0xE1, 0xCF, 0x14, 0x70, 0x03, 0x02, +0xB0, 0x6E, 0x24, 0x05, 0x60, 0x03, 0x02, 0xB0, 0xBD, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, +0x33, 0x77, 0x17, 0x12, 0x96, 0x56, 0x12, 0x27, 0x54, 0x77, 0x33, 0x77, 0x17, 0x12, 0xB0, 0xBE, +0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, +0x00, 0x7F, 0xB4, 0x7E, 0x0C, 0x12, 0x57, 0x07, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, +0xA3, 0xF4, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0x02, 0xB0, 0xB6, 0x90, 0xAC, 0xB9, 0x12, +0x27, 0x54, 0x77, 0x33, 0x77, 0x17, 0x12, 0x96, 0x56, 0x12, 0x27, 0x54, 0x77, 0x33, 0x77, 0x17, +0x12, 0xB0, 0xBE, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, +0x00, 0x00, 0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0C, 0x12, 0x57, 0x07, 0x12, 0x27, 0x54, 0x3F, 0xF0, +0x00, 0x00, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x02, 0xB0, 0xB6, 0x90, +0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x33, 0x77, 0x77, 0x12, 0x96, 0x56, 0x12, 0x27, 0x54, 0x77, +0x33, 0x77, 0x77, 0x12, 0xB0, 0xBE, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA3, 0xF4, +0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0C, 0x12, 0x57, 0x07, 0x12, 0x27, +0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0x01, +0xB6, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x54, 0x33, 0x77, 0x17, 0x12, 0x96, 0x56, 0x12, 0x27, +0x54, 0x54, 0x33, 0x77, 0x17, 0x11, 0xBE, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA3, +0xF4, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0C, 0x12, 0x57, 0x07, 0x12, +0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, +0x7F, 0xB4, 0x7E, 0x0E, 0x12, 0x57, 0x07, 0x12, 0x27, 0x54, 0x00, 0x00, 0x03, 0x03, 0x90, 0xA3, +0xF4, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x01, 0x7F, 0x00, 0x7E, 0x09, 0x80, 0x4C, 0x90, 0xA3, +0xF0, 0x12, 0x27, 0x54, 0x00, 0xFF, 0x00, 0x00, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x00, 0x33, +0x00, 0x00, 0x11, 0xC9, 0x12, 0x27, 0x54, 0x77, 0x33, 0x77, 0x77, 0x11, 0xBE, 0x12, 0x27, 0x54, +0x01, 0x00, 0x00, 0x00, 0x90, 0xA3, 0xF4, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0x7F, 0xB4, +0x7E, 0x0C, 0x12, 0x57, 0x07, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA3, 0xF4, 0x12, +0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0E, 0x12, 0x54, 0xD7, 0x22, 0x7F, 0xB0, +0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0xA3, 0xF0, 0x22, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x54, 0xD7, +0x90, 0xAC, 0xB9, 0x22, 0xE4, 0xFE, 0xEF, 0x54, 0xE0, 0xC4, 0x13, 0x54, 0x07, 0xFD, 0xEF, 0x54, +0x1F, 0xFF, 0xED, 0x60, 0x2C, 0x14, 0x60, 0x1E, 0x24, 0xFD, 0x60, 0x0F, 0x24, 0xFE, 0x70, 0x2A, +0xEF, 0x25, 0xE0, 0xFF, 0xC3, 0x74, 0xDE, 0x9F, 0xFE, 0x80, 0x1F, 0xEF, 0x25, 0xE0, 0xFF, 0xC3, +0x74, 0xF2, 0x9F, 0xFE, 0x80, 0x14, 0xEF, 0x25, 0xE0, 0xFF, 0xC3, 0x74, 0x06, 0x9F, 0xFE, 0x80, +0x09, 0xEF, 0x25, 0xE0, 0xFF, 0xC3, 0x74, 0x10, 0x9F, 0xFE, 0xAF, 0x06, 0x22, 0xD3, 0xEF, 0x64, +0x80, 0x94, 0x1C, 0x40, 0x07, 0xEF, 0x64, 0x80, 0x94, 0x94, 0x40, 0x03, 0x7F, 0x00, 0x22, 0xC3, +0xEF, 0x64, 0x80, 0x94, 0x80, 0x40, 0x03, 0x7F, 0x64, 0x22, 0xEF, 0x24, 0x64, 0xFF, 0x22, 0x90, +0xA3, 0x61, 0xE0, 0x75, 0xF0, 0x3F, 0x84, 0xAD, 0xF0, 0xED, 0x25, 0xE0, 0x25, 0xE0, 0xFD, 0x74, +0x38, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xED, 0xF0, 0x90, 0xA3, 0x61, 0xE0, 0x04, +0xF0, 0x22, 0x90, 0x04, 0x1A, 0xE0, 0xF4, 0x60, 0x03, 0x7F, 0x00, 0x22, 0x90, 0x04, 0x1B, 0xE0, +0x54, 0x07, 0x64, 0x07, 0x7F, 0x01, 0x60, 0x02, 0x7F, 0x00, 0x22, 0x90, 0xA2, 0xCF, 0xE0, 0x30, +0xE0, 0x17, 0x90, 0xA2, 0xE1, 0xE0, 0x70, 0x4A, 0x90, 0xA2, 0x89, 0xE0, 0xD3, 0x94, 0x00, 0x50, +0x41, 0x90, 0xA2, 0xCE, 0xE0, 0x60, 0x38, 0x80, 0x39, 0x31, 0x62, 0xEF, 0x64, 0x01, 0x70, 0x32, +0x90, 0xA2, 0x8B, 0xE0, 0xFF, 0x54, 0x03, 0x70, 0x29, 0x90, 0xA2, 0x89, 0xE0, 0xFE, 0xE4, 0xC3, +0x9E, 0x40, 0x1F, 0xEF, 0x20, 0xE2, 0x1B, 0x90, 0xA2, 0x8B, 0xE0, 0x20, 0xE4, 0x14, 0x90, 0xA2, +0x84, 0xE0, 0x13, 0x13, 0x54, 0x3F, 0x30, 0xE0, 0x09, 0x90, 0xA2, 0xCE, 0xE0, 0x70, 0x03, 0x7F, +0x01, 0x22, 0x7F, 0x00, 0x22, 0x90, 0x02, 0x87, 0xE0, 0x70, 0x1F, 0x90, 0x01, 0x00, 0xE0, 0x64, +0x3F, 0x70, 0x17, 0x90, 0x02, 0x96, 0xE0, 0x70, 0x11, 0x90, 0x02, 0x86, 0xE0, 0x30, 0xE1, 0x0A, +0x90, 0x02, 0x86, 0xE0, 0x20, 0xE3, 0x03, 0x7F, 0x01, 0x22, 0x7F, 0x00, 0x22, 0x7D, 0x2E, 0x7F, +0x6F, 0x12, 0x5B, 0x63, 0x7D, 0x02, 0x7F, 0x01, 0x02, 0x58, 0xF6, 0x90, 0xA2, 0x83, 0xE0, 0x30, +0xE0, 0x03, 0x12, 0x7B, 0xD6, 0x22, 0x7D, 0x2F, 0x7F, 0xFF, 0x12, 0x5B, 0x63, 0x12, 0x95, 0x8E, +0x7D, 0x08, 0x7F, 0x01, 0x02, 0x58, 0xF6, 0x12, 0x57, 0xB1, 0x7D, 0x0C, 0x7F, 0x01, 0x02, 0x58, +0xF6, 0x90, 0xA4, 0x3D, 0xE0, 0xFF, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0xA4, 0x92, +0xEF, 0xF0, 0x90, 0xA1, 0x7F, 0xE0, 0xFF, 0x90, 0x04, 0x1C, 0xE0, 0x6F, 0x70, 0x3C, 0x90, 0xA2, +0x8A, 0xE0, 0x64, 0x0E, 0x70, 0x14, 0x90, 0xA4, 0x92, 0xE0, 0x70, 0x2E, 0x90, 0xA2, 0x83, 0xE0, +0x54, 0x7F, 0xF0, 0x51, 0x8F,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35, 0xF0, 0x22, 0xF0, 0x90, 0x01, 0x3F, 0x74, 0x10, 0xF0, +0xFD, 0x7F, 0x03, 0x22, 0xEC, 0x13, 0x13, 0x13, 0x54, 0x1F, 0xFF, 0x22, 0xF5, 0x82, 0xE4, 0x34, +0xFC, 0xF5, 0x83, 0xEF, 0xF0, 0x22, 0xE4, 0x90, 0xA4, 0x29, 0xF0, 0xA3, 0x22, 0x90, 0xA3, 0x31, +0xE0, 0xFE, 0xC3, 0x13, 0x54, 0x07, 0x22, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x90, 0xA3, 0xC4, 0xF0, +0x22, 0x54, 0x03, 0x25, 0xE0, 0x25, 0xE0, 0x22, 0x12, 0x4A, 0x2A, 0xE0, 0xFB, 0xE4, 0xFD, 0x0F, +0x22, 0x54, 0x01, 0xC4, 0x33, 0x33, 0x33, 0x54, 0x80, 0x22, 0xE5, 0x26, 0x75, 0xF0, 0x08, 0xA4, +0x25, 0x25, 0x22, 0xFF, 0x90, 0xA4, 0x54, 0xE0, 0xFB, 0xEF, 0x5B, 0x22, 0x90, 0xA3, 0x8B, 0xE0, +0xFE, 0x75, 0xF0, 0x04, 0x22, 0x75, 0x1C, 0x3E, 0x75, 0xF0, 0x04, 0xE5, 0x1A, 0x22, 0xE5, 0x6F, +0x54, 0x7F, 0x90, 0xA4, 0x01, 0xF0, 0x22, 0x7F, 0xB4, 0x7E, 0x08, 0x12, 0x36, 0xCE, 0xEF, 0x22, +0xE0, 0xFE, 0xA3, 0xE0, 0xF5, 0x82, 0x8E, 0x83, 0x22, 0x90, 0x06, 0x0A, 0xE0, 0x54, 0xF8, 0xF0, +0x22, 0xE4, 0x93, 0xFC, 0x74, 0x01, 0x93, 0xFD, 0x22, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, +0x22, 0xF0, 0x90, 0xA2, 0x9C, 0xE0, 0xC3, 0x9D, 0x22, 0x90, 0xA2, 0x84, 0xE0, 0x44, 0x04, 0xF0, +0x22, 0xC4, 0x54, 0x0F, 0x90, 0xA4, 0x5D, 0xF0, 0x22, 0x2F, 0xF8, 0xE6, 0xFE, 0xED, 0xF4, 0x5E, +0x22, 0x00, 0xCB, 0x74, }; -u4Byte ArrayLength_MP_8812A_FW_NIC_BT = 30950; +u4Byte ArrayLength_MP_8812A_FW_NIC_BT = 29892; void @@ -4003,17 +3931,15 @@ ODM_ReadFirmware_MP_8812A_FW_NIC_BT( u1Byte Array_MP_8812A_FW_WoWLAN[] = { -0x01, 0x95, 0x30, 0x00, 0x19, 0x00, 0x00, 0x00, 0x07, 0x23, 0x13, 0x25, 0xB4, 0x52, 0x00, 0x00, -0xFE, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x02, 0x4B, 0xD5, 0x02, 0x68, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x69, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x72, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x68, 0x9B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x6F, 0xDB, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x95, 0x30, 0x00, 0x26, 0x00, 0x00, 0x00, 0x11, 0x04, 0x19, 0x54, 0x4A, 0x5E, 0x00, 0x00, +0x81, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x02, 0x4C, 0x0D, 0x02, 0x78, 0xF3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x02, 0x7A, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x02, 0x7F, 0xDE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x02, 0x79, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x7E, 0x71, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, +0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -4116,1221 +4042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7F, 0x08, 0x08, 0xEF, 0x44, 0x83, 0xF4, 0xC2, 0xAF, 0x56, 0xC6, 0xD2, 0xAF, -0x54, 0x80, 0x4F, 0xFF, 0x22, 0x02, 0x4C, 0x13, 0x02, 0x4A, 0x09, 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, 0x4C, 0x58, 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, 0x00, 0x41, 0x90, 0xEC, 0x00, 0x41, 0x90, 0xED, -0x00, 0x41, 0x90, 0xEE, 0x00, 0x41, 0x91, 0x10, 0x00, 0x41, 0x91, 0x13, 0x00, 0x4D, 0xB3, 0x4F, -0xEF, 0x58, 0x36, 0x90, 0x00, 0xF0, 0xE0, 0x7F, 0x01, 0x20, 0xE2, 0x02, 0x7F, 0x03, 0x22, 0x91, -0x73, 0x90, 0x8D, 0x05, 0xEF, 0xF0, 0x91, 0x91, 0x90, 0x01, 0x64, 0x74, 0x01, 0xF0, 0x02, 0x35, -0x95, 0xB1, 0x17, 0xB1, 0x47, 0x91, 0xB3, 0x91, 0xD2, 0x91, 0xF1, 0xE4, 0xF5, 0x51, 0x75, 0x52, -0x58, 0xAB, 0x51, 0x7D, 0x02, 0x7F, 0x01, 0x12, 0x39, 0x04, 0xAB, 0x52, 0x7D, 0x03, 0x7F, 0x01, -0x02, 0x39, 0x04, 0x75, 0x5D, 0x10, 0xE4, 0xF5, 0x5E, 0x75, 0x5F, 0x07, 0x75, 0x60, 0x42, 0x90, -0x01, 0x30, 0xE5, 0x5D, 0xF0, 0xA3, 0xE5, 0x5E, 0xF0, 0xA3, 0xE5, 0x5F, 0xF0, 0xA3, 0xE5, 0x60, -0xF0, 0x22, 0x75, 0x65, 0x06, 0x75, 0x66, 0x01, 0x75, 0x67, 0x03, 0x75, 0x68, 0x62, 0x90, 0x01, -0x38, 0xE5, 0x65, 0xF0, 0xA3, 0xE5, 0x66, 0xF0, 0xA3, 0xE5, 0x67, 0xF0, 0xA3, 0xE5, 0x68, 0xF0, -0x22, 0xE4, 0xF5, 0x55, 0xF5, 0x56, 0xF5, 0x57, 0x75, 0x58, 0x80, 0xAD, 0x55, 0x7F, 0x50, 0x12, -0x3A, 0x96, 0xAD, 0x56, 0x7F, 0x51, 0x12, 0x3A, 0x96, 0xAD, 0x57, 0x7F, 0x52, 0x12, 0x3A, 0x96, -0xAD, 0x58, 0x7F, 0x53, 0x02, 0x3A, 0x96, 0x90, 0x01, 0x30, 0xE4, 0xF0, 0xA3, 0xF0, 0xA3, 0xF0, -0xA3, 0xF0, 0x90, 0x01, 0x38, 0xF0, 0xA3, 0xF0, 0xA3, 0xF0, 0xA3, 0xF0, 0xFD, 0x7F, 0x50, 0x12, -0x3A, 0x96, 0xE4, 0xFD, 0x7F, 0x51, 0x12, 0x3A, 0x96, 0xE4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, 0xF0, 0x90, 0x06, 0x09, 0xE0, 0x54, 0xFE, 0xF0, -0x12, 0x56, 0x22, 0x90, 0x02, 0x86, 0xE0, 0x44, 0x04, 0xF0, 0x12, 0x5F, 0x31, 0xD1, 0xF1, 0x12, -0x54, 0xCC, 0x90, 0x05, 0x22, 0xE4, 0xF0, 0x12, 0x88, 0x19, 0x90, 0x01, 0x34, 0x74, 0x08, 0xF0, -0xFD, 0xE4, 0xFF, 0x80, 0x31, 0x7D, 0x08, 0xE4, 0xFF, 0x12, 0x6B, 0x66, 0x90, 0x06, 0x90, 0xE0, -0x54, 0xF0, 0xF0, 0x90, 0x02, 0x86, 0xE0, 0x54, 0xFB, 0xF0, 0x12, 0x84, 0xBC, 0xD1, 0xF2, 0xC1, -0x22, 0x22, 0x90, 0x8E, 0x98, 0xE0, 0xFF, 0xC4, 0x13, 0x13, 0x54, 0x03, 0x30, 0xE0, 0x02, 0xD1, -0x4B, 0x22, 0x7D, 0x02, 0x7F, 0x02, 0x74, 0x5D, 0x2F, 0xF8, 0xE6, 0x4D, 0xFE, 0xF6, 0x74, 0x30, -0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x01, 0xF5, 0x83, 0xEE, 0xF0, 0x22, 0x90, 0x8E, 0x94, 0xE0, 0x30, -0xE0, 0x2F, 0x90, 0x8E, 0x96, 0xE0, 0x90, 0x05, 0x73, 0xF0, 0x90, 0x8E, 0x97, 0xE0, 0x60, 0x05, -0x14, 0xF0, 0x02, 0x54, 0xAB, 0x90, 0x8E, 0x95, 0xE0, 0x14, 0x90, 0x8E, 0x97, 0xF0, 0x90, 0x05, -0x73, 0x74, 0x01, 0xF0, 0xE4, 0xFF, 0x12, 0x6D, 0x65, 0xF1, 0x02, 0x7D, 0x01, 0x7F, 0x02, 0xF1, -0x06, 0x22, 0xF1, 0xAA, 0x90, 0x8E, 0x82, 0xE0, 0x14, 0x90, 0x05, 0x73, 0xF0, 0xF1, 0x02, 0x80, -0xBA, 0x90, 0x01, 0x36, 0x74, 0x78, 0xF0, 0xA3, 0x74, 0x02, 0xF0, 0x7D, 0x78, 0xFF, 0xF1, 0x06, -0x7D, 0x02, 0x7F, 0x03, 0xF1, 0x06, 0x90, 0x06, 0x0A, 0xE0, 0x44, 0x07, 0xF0, 0x90, 0x8E, 0x87, -0xA3, 0xE0, 0x90, 0x05, 0x58, 0xF0, 0x90, 0x8D, 0xF8, 0xE0, 0xB4, 0x01, 0x15, 0x90, 0x8E, 0x7A, -0xE0, 0x54, 0xFB, 0xF0, 0x90, 0x8E, 0x7F, 0xE0, 0x20, 0xE2, 0x0E, 0x7D, 0x01, 0x7F, 0x04, 0x02, -0x52, 0x57, 0x90, 0x8E, 0x7A, 0xE0, 0x44, 0x04, 0xF0, 0x22, 0x90, 0x8E, 0x7C, 0xE0, 0x60, 0x29, -0x90, 0x8D, 0xF8, 0xE0, 0x64, 0x01, 0x70, 0x21, 0x90, 0x8E, 0x83, 0xF0, 0x04, 0x60, 0x1A, 0x90, -0x8E, 0x80, 0xE0, 0x44, 0x10, 0xF0, 0xE4, 0xF5, 0x11, 0x90, 0x8E, 0x84, 0x12, 0x5F, 0xEE, 0x90, -0x8E, 0x7F, 0xE0, 0x20, 0xE2, 0x03, 0x12, 0x52, 0x53, 0x22, 0x22, 0xE4, 0x90, 0x8D, 0xF8, 0xF0, -0x22, 0x75, 0xE8, 0x03, 0x75, 0xA8, 0x85, 0x22, 0x90, 0x01, 0xC7, 0x74, 0x05, 0xF0, 0x22, 0xE4, -0x90, 0x90, 0x0D, 0xF0, 0x90, 0x90, 0x0D, 0xE0, 0x64, 0x01, 0xF0, 0x24, 0xEF, 0x90, 0x01, 0xC4, -0xF0, 0x74, 0x4F, 0xA3, 0xF0, 0x12, 0x3A, 0xEB, 0xBF, 0x01, 0x03, 0x12, 0x31, 0x69, 0x90, 0x8E, -0x7C, 0xE0, 0x60, 0x0E, 0x90, 0x8E, 0x7F, 0xE0, 0xFF, 0x90, 0x8E, 0x7E, 0xE0, 0x6F, 0x60, 0x02, -0x51, 0x4A, 0xC2, 0xAF, 0x12, 0x7D, 0x1C, 0xBF, 0x01, 0x02, 0x91, 0xB4, 0xD2, 0xAF, 0x11, 0x35, -0x12, 0x49, 0x79, 0x80, 0xBF, 0x11, 0x88, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xE4, 0xFF, -0x90, 0x90, 0x92, 0xF0, 0x90, 0x01, 0xC7, 0xE0, 0x64, 0xAD, 0x70, 0x37, 0xF0, 0x90, 0x90, 0x9F, -0x74, 0x0F, 0xF0, 0x90, 0x90, 0x91, 0x74, 0x0A, 0xF0, 0xA3, 0xE0, 0x04, 0xF0, 0x90, 0x90, 0x92, -0xE0, 0x2F, 0xFE, 0x74, 0x93, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x90, 0xF5, 0x83, 0xEE, 0xF0, 0x0F, -0xEF, 0xB4, 0x0F, 0xE9, 0x90, 0x01, 0x3F, 0x74, 0x04, 0xF0, 0x7B, 0x01, 0x7A, 0x90, 0x79, 0x91, -0x12, 0x7A, 0xAA, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, -0x00, 0x8F, 0xE0, 0x20, 0xE6, 0x02, 0x41, 0x1A, 0x90, 0x00, 0x8C, 0xE0, 0x90, 0x90, 0xF5, 0xF0, -0x90, 0x00, 0x8D, 0xE0, 0x90, 0x90, 0xF6, 0xF0, 0x90, 0x00, 0x8E, 0xE0, 0x90, 0x90, 0xF7, 0xF0, -0x90, 0x90, 0xF6, 0xE0, 0x24, 0xF1, 0x70, 0x02, 0x21, 0x79, 0x24, 0x07, 0x60, 0x02, 0x41, 0x0C, -0x90, 0x8E, 0x7C, 0xE0, 0xFB, 0xE4, 0xFD, 0xFF, 0x51, 0x22, 0x90, 0x8E, 0x7B, 0xE0, 0x54, 0x0F, -0xFB, 0x0D, 0x51, 0x22, 0x90, 0x8E, 0x7E, 0x51, 0x1F, 0x90, 0x8E, 0x7F, 0xE0, 0xFB, 0x0D, 0x51, -0x22, 0x90, 0x90, 0xF5, 0xE0, 0x24, 0xF8, 0xF5, 0x82, 0xE4, 0x34, 0x8D, 0xF5, 0x83, 0xE0, 0xFB, -0xE4, 0xFD, 0x0F, 0x51, 0x22, 0x90, 0x8E, 0x79, 0xE0, 0x54, 0x01, 0xFB, 0x0D, 0x51, 0x22, 0x90, -0x8E, 0x79, 0xE0, 0xC4, 0x13, 0x13, 0x54, 0x01, 0xFB, 0x0D, 0x7F, 0x01, 0x51, 0x22, 0x90, 0x8E, -0x79, 0xE0, 0xC4, 0x13, 0x13, 0x13, 0x54, 0x01, 0xFB, 0x0D, 0x7F, 0x01, 0x51, 0x22, 0x90, 0x8D, -0x03, 0xE0, 0xFB, 0xE4, 0xFD, 0x0F, 0x51, 0x22, 0x90, 0x8D, 0x04, 0xE0, 0xFB, 0x0D, 0x51, 0x22, -0x90, 0x8E, 0x83, 0xE0, 0xFB, 0x0D, 0x51, 0x22, 0x90, 0x8E, 0x82, 0xE0, 0xFB, 0x0D, 0x51, 0x22, -0x90, 0x8E, 0x7B, 0xE0, 0xC4, 0x54, 0x0F, 0xFB, 0xE4, 0xFD, 0x7F, 0x03, 0x51, 0x22, 0x90, 0x8E, -0x7A, 0xE0, 0x13, 0x13, 0x54, 0x01, 0xFB, 0x0D, 0x7F, 0x03, 0x51, 0x22, 0x90, 0x8E, 0x7A, 0xE0, -0x13, 0x13, 0x13, 0x54, 0x01, 0xFB, 0x0D, 0x7F, 0x03, 0x51, 0x22, 0x90, 0x8E, 0x79, 0xE0, 0x13, -0x13, 0x54, 0x01, 0xFB, 0x0D, 0x7F, 0x03, 0x41, 0x0A, 0x90, 0x8E, 0x98, 0xE0, 0x54, 0x01, 0xFB, -0xE4, 0xFD, 0xFF, 0x51, 0x22, 0x90, 0x8E, 0x99, 0xE0, 0xC4, 0x13, 0x13, 0x13, 0x54, 0x01, 0xFB, -0x0D, 0xE4, 0xFF, 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 0x8E, 0x7E, 0xE0, 0xFF, 0x7D, -0x01, 0x80, 0x04, 0x7D, 0x01, 0x7F, 0x04, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x91, -0x12, 0xED, 0xF0, 0x90, 0x8E, 0x79, 0xE0, 0xFE, 0xC4, 0x13, 0x13, 0x54, 0x03, 0x30, 0xE0, 0x02, -0x61, 0xA2, 0xEE, 0xC4, 0x13, 0x13, 0x13, 0x54, 0x01, 0x30, 0xE0, 0x02, 0x61, 0xA2, 0x90, 0x8E, -0x7F, 0xE0, 0xFE, 0x6F, 0x70, 0x02, 0x61, 0xA2, 0xEF, 0x70, 0x02, 0x61, 0x18, 0x24, 0xFE, 0x70, -0x02, 0x61, 0x52, 0x24, 0xFE, 0x60, 0x49, 0x24, 0xFC, 0x70, 0x02, 0x61, 0x8D, 0x24, 0xFC, 0x60, -0x02, 0x61, 0xA2, 0xEE, 0xB4, 0x0E, 0x02, 0x91, 0x13, 0x90, 0x8E, 0x7F, 0xE0, 0x70, 0x04, 0x7F, -0x01, 0x91, 0x3B, 0x90, 0x8E, 0x7F, 0xE0, 0xB4, 0x06, 0x02, 0x71, 0xED, 0x90, 0x8E, 0x7F, 0xE0, -0xB4, 0x04, 0x0F, 0x90, 0x91, 0x12, 0xE0, 0xFF, 0x60, 0x05, 0x12, 0x8A, 0x7C, 0x80, 0x03, 0x12, -0x77, 0xA2, 0x90, 0x8E, 0x7F, 0xE0, 0x64, 0x08, 0x60, 0x02, 0x61, 0xA2, 0x91, 0xBE, 0x61, 0xA2, -0x90, 0x8E, 0x7F, 0xE0, 0x70, 0x04, 0x7F, 0x01, 0x91, 0x3B, 0x90, 0x8E, 0x7F, 0xE0, 0xB4, 0x06, -0x02, 0x71, 0xED, 0x90, 0x8E, 0x7F, 0xE0, 0xB4, 0x0E, 0x07, 0x71, 0xA7, 0xBF, 0x01, 0x02, 0x91, -0x13, 0x90, 0x8E, 0x7F, 0xE0, 0x64, 0x0C, 0x60, 0x02, 0x61, 0xA2, 0x71, 0xA7, 0xEF, 0x64, 0x01, -0x60, 0x02, 0x61, 0xA2, 0x91, 0x54, 0x61, 0xA2, 0x90, 0x8E, 0x7F, 0xE0, 0xB4, 0x0E, 0x07, 0x71, -0xA7, 0xBF, 0x01, 0x02, 0x91, 0x13, 0x90, 0x8E, 0x7F, 0xE0, 0xB4, 0x06, 0x02, 0x71, 0xED, 0x90, -0x8E, 0x7F, 0xE0, 0xB4, 0x0C, 0x07, 0x71, 0xA7, 0xBF, 0x01, 0x02, 0x91, 0x54, 0x90, 0x8E, 0x7F, -0xE0, 0x64, 0x04, 0x70, 0x5D, 0x12, 0x89, 0x7A, 0xEF, 0x64, 0x01, 0x70, 0x55, 0x12, 0x8A, 0xBE, -0x80, 0x50, 0x90, 0x8E, 0x7F, 0xE0, 0xB4, 0x0E, 0x07, 0x71, 0xA7, 0xBF, 0x01, 0x02, 0x91, 0x13, -0x90, 0x8E, 0x7F, 0xE0, 0xB4, 0x06, 0x02, 0x71, 0xED, 0x90, 0x8E, 0x7F, 0xE0, 0xB4, 0x0C, 0x07, -0x71, 0xA7, 0xBF, 0x01, 0x02, 0x91, 0x54, 0x90, 0x8E, 0x7F, 0xE0, 0x70, 0x04, 0x7F, 0x01, 0x91, -0x3B, 0x90, 0x8E, 0x7F, 0xE0, 0xB4, 0x04, 0x1A, 0x12, 0x8A, 0xDC, 0x80, 0x15, 0x90, 0x8E, 0x7F, -0xE0, 0xB4, 0x0C, 0x0E, 0x90, 0x8E, 0x7A, 0xE0, 0xFF, 0x13, 0x13, 0x54, 0x3F, 0x30, 0xE0, 0x02, -0x91, 0xAB, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x12, 0x89, 0x61, 0xEF, 0x64, 0x01, 0x60, 0x08, 0x90, -0x01, 0xB8, 0x74, 0x01, 0xF0, 0x80, 0x2D, 0x90, 0x8E, 0x79, 0xE0, 0x13, 0x13, 0x13, 0x54, 0x1F, -0x30, 0xE0, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x02, 0xF0, 0x80, 0x19, 0x90, 0x8E, 0x7E, 0xE0, 0xD3, -0x94, 0x04, 0x40, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x08, 0xF0, 0x80, 0x08, 0x90, 0x01, 0xB8, 0xE4, -0xF0, 0x7F, 0x01, 0x22, 0x90, 0x01, 0xB9, 0x74, 0x02, 0xF0, 0x7F, 0x00, 0x22, 0x90, 0x8E, 0x7A, -0xE0, 0x90, 0x06, 0x04, 0x20, 0xE0, 0x0C, 0xE0, 0x44, 0x40, 0xF0, 0x90, 0x8E, 0x7F, 0x74, 0x04, -0xF0, 0x80, 0x0A, 0xE0, 0x54, 0x7F, 0xF0, 0x90, 0x8E, 0x7F, 0x74, 0x0C, 0xF0, 0x90, 0x05, 0x22, -0xE4, 0xF0, 0x22, 0x90, 0x8E, 0x7A, 0xE0, 0xC3, 0x13, 0x20, 0xE0, 0x08, 0x90, 0x8E, 0x7F, 0x74, -0x0C, 0xF0, 0x80, 0x11, 0x90, 0x06, 0x04, 0xE0, 0x44, 0x40, 0xF0, 0xE0, 0x44, 0x80, 0xF0, 0x90, -0x8E, 0x7F, 0x74, 0x04, 0xF0, 0x90, 0x05, 0x22, 0xE4, 0xF0, 0x22, 0x90, 0x91, 0x11, 0xEF, 0xF0, -0x91, 0xCC, 0x90, 0x91, 0x11, 0xE0, 0x60, 0x05, 0x90, 0x05, 0x22, 0xE4, 0xF0, 0x90, 0x8E, 0x7F, -0x74, 0x04, 0xF0, 0x22, 0x90, 0x8D, 0xF8, 0xE0, 0x64, 0x01, 0x70, 0x2D, 0x90, 0x8E, 0x7A, 0xE0, -0x54, 0xFD, 0xF0, 0x90, 0x05, 0x22, 0x74, 0x6F, 0xF0, 0x7F, 0x01, 0xF1, 0x8A, 0xBF, 0x01, 0x0E, -0x90, 0x8E, 0x79, 0xE0, 0x44, 0x80, 0xF0, 0x90, 0x8E, 0x7F, 0x74, 0x0E, 0xF0, 0x22, 0x90, 0x01, -0xB9, 0x74, 0x01, 0xF0, 0x90, 0x01, 0xB8, 0x04, 0xF0, 0x22, 0x90, 0x8E, 0x7C, 0xE0, 0x64, 0x01, -0x70, 0x18, 0x90, 0x8E, 0x7B, 0xE0, 0x54, 0x0F, 0x60, 0x08, 0xE4, 0xFD, 0x7F, 0x0C, 0x51, 0x57, -0xE1, 0x4E, 0x90, 0x8E, 0x7F, 0xE0, 0x70, 0x02, 0x51, 0x53, 0x22, 0xD1, 0x22, 0x90, 0x8E, 0x7F, -0x74, 0x08, 0xF0, 0x22, 0x90, 0x8E, 0x79, 0xE0, 0x30, 0xE0, 0x02, 0xF1, 0xC7, 0x22, 0x91, 0xCC, -0x90, 0x05, 0x22, 0xE4, 0xF0, 0x90, 0x8E, 0x7F, 0x74, 0x0C, 0xF0, 0x22, 0xD3, 0x10, 0xAF, 0x01, -0xC3, 0xC0, 0xD0, 0x90, 0x8E, 0x89, 0x12, 0x47, 0x26, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0x7F, -0xB0, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0x8E, 0x89, 0x12, 0x47, 0x26, 0x90, 0xAC, 0xB9, 0x12, -0x27, 0x48, 0x7F, 0xB0, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0x00, 0x10, 0xE0, 0x44, 0x0C, 0xFD, -0x7F, 0x10, 0x12, 0x3A, 0x96, 0x90, 0x00, 0x72, 0xE0, 0x54, 0xF3, 0xFD, 0x7F, 0x72, 0x12, 0x3A, -0x96, 0x90, 0x01, 0x01, 0xE0, 0x44, 0x02, 0xF0, 0x90, 0x01, 0x00, 0x74, 0xFF, 0xF0, 0x90, 0x06, -0xB7, 0x74, 0x09, 0xF0, 0x90, 0x06, 0xB4, 0x74, 0x86, 0xF0, 0x7F, 0xB4, 0x7E, 0x08, 0x12, 0x36, -0xCE, 0xEF, 0x54, 0xBF, 0xFF, 0xEC, 0x90, 0x90, 0xC9, 0x12, 0x27, 0x48, 0x90, 0x90, 0xC9, 0x12, -0x47, 0x26, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0x7F, 0xB4, 0x7E, 0x08, 0x12, 0x37, 0x5D, 0x90, -0x00, 0x02, 0xE0, 0x44, 0x01, 0xFD, 0x7F, 0x02, 0x12, 0x3A, 0x96, 0x7F, 0x00, 0x7E, 0x0C, 0x12, -0x36, 0xCE, 0xEF, 0x44, 0x03, 0xFF, 0xEC, 0x90, 0x90, 0xC9, 0x12, 0x27, 0x48, 0x90, 0x90, 0xC9, -0x12, 0x47, 0x26, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0x7F, 0x00, 0x7E, 0x0C, 0x12, 0x37, 0x5D, -0x7F, 0x00, 0x7E, 0x0E, 0x12, 0x36, 0xCE, 0xEF, 0x44, 0x03, 0xFF, 0xEC, 0x90, 0x90, 0xC9, 0x12, -0x27, 0x48, 0x90, 0x90, 0xC9, 0x12, 0x47, 0x26, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0x7F, 0x00, -0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0x00, 0xFF, 0xE0, 0x70, 0x1B, 0xB1, 0xCB, 0x90, 0x90, 0xCD, -0xE0, 0x54, 0xE7, 0x12, 0x80, 0x06, 0xB1, 0xCB, 0x90, 0x90, 0xCD, 0xE0, 0x54, 0x18, 0x70, 0x06, -0x90, 0x01, 0xBF, 0xE0, 0x04, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x7B, 0x01, 0x7A, 0x90, 0x79, -0xCD, 0x7D, 0x08, 0x7F, 0x01, 0x90, 0x90, 0xE4, 0x12, 0x47, 0x53, 0xEF, 0x70, 0x07, 0x90, 0x90, -0xE7, 0x04, 0xF0, 0x80, 0x0B, 0xEF, 0x64, 0x01, 0x70, 0x2E, 0x90, 0x90, 0xE7, 0x74, 0x40, 0xF0, -0x7F, 0xE2, 0x12, 0x3A, 0x96, 0x90, 0x90, 0xE7, 0xE0, 0xFD, 0x7F, 0xE3, 0x12, 0x3A, 0x96, 0x90, -0x00, 0xE1, 0xE0, 0xFF, 0x90, 0x90, 0xE4, 0x12, 0x47, 0x4A, 0xEF, 0x12, 0x26, 0x64, 0xE4, 0xFD, -0x7F, 0xE3, 0x12, 0x3A, 0x96, 0x7F, 0x01, 0x22, 0x90, 0x01, 0xC2, 0xE0, 0x44, 0x01, 0xF0, 0x7F, -0x00, 0x22, 0x90, 0x05, 0x22, 0x74, 0xFF, 0xF0, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xF1, -0xEE, 0x7F, 0x00, 0x7E, 0x0C, 0x12, 0x36, 0xCE, 0xEF, 0x54, 0xFC, 0xFF, 0xEC, 0x90, 0x90, 0xCF, -0x12, 0x27, 0x48, 0x90, 0x90, 0xCF, 0x12, 0x47, 0x26, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0x7F, -0x00, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x7F, 0x00, 0x7E, 0x0E, 0x12, 0x36, 0xCE, 0xEF, 0x54, 0xFC, -0xFF, 0xEC, 0x90, 0x90, 0xCF, 0x12, 0x27, 0x48, 0x90, 0x90, 0xCF, 0x12, 0x47, 0x26, 0x90, 0xAC, -0xB9, 0x12, 0x27, 0x48, 0x7F, 0x00, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0x00, 0x02, 0xE0, 0x54, -0xFE, 0xFD, 0x7F, 0x02, 0x12, 0x3A, 0x96, 0x90, 0x00, 0x02, 0xE0, 0x44, 0x01, 0xFD, 0x7F, 0x02, -0x12, 0x3A, 0x96, 0x90, 0x00, 0x02, 0xE0, 0x54, 0xFE, 0xFD, 0x7F, 0x02, 0x12, 0x3A, 0x96, 0x90, -0x00, 0x02, 0xE0, 0x44, 0x01, 0xFD, 0x7F, 0x02, 0x12, 0x3A, 0x96, 0x90, 0x00, 0x02, 0xE0, 0x54, -0xFE, 0xFD, 0x7F, 0x02, 0x12, 0x3A, 0x96, 0x7F, 0xB4, 0x7E, 0x08, 0x12, 0x36, 0xCE, 0xEF, 0x44, -0x40, 0xFF, 0xEC, 0x90, 0x90, 0xCF, 0x12, 0x27, 0x48, 0x90, 0x90, 0xCF, 0x12, 0x47, 0x26, 0x90, -0xAC, 0xB9, 0x12, 0x27, 0x48, 0x7F, 0xB4, 0x7E, 0x08, 0x12, 0x37, 0x5D, 0x90, 0x01, 0x00, 0x74, -0x3F, 0xF0, 0xA3, 0xE0, 0x54, 0xFD, 0xF0, 0x90, 0x05, 0x53, 0xE0, 0x44, 0x20, 0xF0, 0x7F, 0xB0, -0x7E, 0x0C, 0x12, 0x36, 0xCE, 0x90, 0x8E, 0x89, 0x12, 0x27, 0x48, 0x90, 0xAC, 0xB9, 0x12, 0x27, -0x54, 0x77, 0x77, 0x77, 0x77, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, -0x27, 0x54, 0x77, 0x77, 0x77, 0x77, 0x7F, 0xB0, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0x00, 0xFF, -0xE0, 0x70, 0x11, 0x7B, 0x01, 0x7A, 0x90, 0x79, 0xCE, 0xB1, 0xD1, 0x90, 0x90, 0xCE, 0xE0, 0x44, -0x18, 0x12, 0x80, 0x06, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xF1, 0x4E, 0x90, 0x8E, 0x7F, 0xE0, 0x64, -0x0C, 0x60, 0x0A, 0xE4, 0xFD, 0x7F, 0x0C, 0x51, 0x57, 0xE4, 0xFF, 0xF1, 0x8A, 0x22, 0x90, 0x8E, -0x79, 0xE0, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x30, 0xE0, 0x05, 0x90, 0x01, 0x5B, 0xE4, 0xF0, 0x90, -0x06, 0x92, 0x74, 0x02, 0xF0, 0x90, 0x01, 0x3C, 0x74, 0x04, 0xF0, 0xE4, 0xF5, 0x11, 0x90, 0x8E, -0x8F, 0xE0, 0xC3, 0x13, 0x54, 0x7F, 0xF5, 0x12, 0xE4, 0xFB, 0xFD, 0x7F, 0x58, 0x7E, 0x01, 0x12, -0x5F, 0xF8, 0x90, 0x8E, 0x79, 0xE0, 0x44, 0x08, 0xF0, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, -0xD0, 0x8F, 0x17, 0x90, 0x04, 0x1D, 0xE0, 0x60, 0x1E, 0x90, 0x05, 0x22, 0xE0, 0xF5, 0x1A, 0x74, -0xFF, 0xF0, 0xF1, 0xEE, 0xBF, 0x01, 0x08, 0xAF, 0x17, 0x12, 0x8B, 0xED, 0x12, 0x8B, 0x04, 0x90, -0x05, 0x22, 0xE5, 0x1A, 0xF0, 0x80, 0x03, 0x12, 0x8B, 0x04, 0x90, 0x04, 0x1F, 0x74, 0x20, 0xF0, -0x7F, 0x01, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0x8E, 0x7F, 0xE0, 0xFF, 0x60, 0x03, 0xB4, 0x08, -0x0F, 0x12, 0x8A, 0x2A, 0xBF, 0x01, 0x09, 0x12, 0x80, 0xDB, 0x90, 0x01, 0xE5, 0xE0, 0x04, 0xF0, -0x22, 0xE4, 0xFF, 0x80, 0xA5, 0x90, 0x8E, 0x7C, 0xE0, 0x60, 0x02, 0x91, 0x8A, 0x22, 0xE4, 0x90, -0x91, 0x03, 0xF0, 0xA3, 0xF0, 0x90, 0x05, 0xF8, 0xE0, 0x70, 0x0F, 0xA3, 0xE0, 0x70, 0x0B, 0xA3, -0xE0, 0x70, 0x07, 0xA3, 0xE0, 0x70, 0x03, 0x7F, 0x01, 0x22, 0xD3, 0x90, 0x91, 0x04, 0xE0, 0x94, -0xE8, 0x90, 0x91, 0x03, 0xE0, 0x94, 0x03, 0x40, 0x0A, 0x90, 0x01, 0xC0, 0xE0, 0x44, 0x20, 0xF0, -0x7F, 0x00, 0x22, 0x7F, 0x32, 0x7E, 0x00, 0x12, 0x3A, 0xF7, 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90, 0x90, 0x18, 0xEF, 0xF0, 0x90, -0x90, 0x13, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0xE4, 0xFD, 0x71, 0xA6, 0xEF, 0x54, 0xFC, 0x90, 0x90, -0x15, 0xF0, 0x90, 0x90, 0x21, 0xE0, 0xFF, 0x90, 0x90, 0x11, 0xE4, 0x8F, 0xF0, 0x12, 0x46, 0xF6, -0x90, 0x90, 0x11, 0x12, 0x83, 0x6F, 0x90, 0x90, 0x11, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0x90, 0x90, -0x0F, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x7D, 0x0F, 0x71, 0xA6, 0x90, 0x90, 0x11, 0xE0, 0xFC, 0xA3, -0xE0, 0xFD, 0x90, 0x90, 0x0F, 0xEC, 0x8D, 0xF0, 0x12, 0x46, 0xF6, 0x90, 0x8D, 0xF5, 0xE0, 0xFC, -0xA3, 0xE0, 0xFD, 0xD3, 0x90, 0x90, 0x10, 0xE0, 0x9D, 0x90, 0x90, 0x0F, 0xE0, 0x9C, 0x40, 0x1B, -0x90, 0x8D, 0xF6, 0xE0, 0x24, 0x01, 0xFD, 0x90, 0x8D, 0xF5, 0xE0, 0x34, 0x00, 0xFC, 0xC3, 0x90, -0x90, 0x10, 0xE0, 0x9D, 0xF0, 0x90, 0x90, 0x0F, 0xE0, 0x9C, 0xF0, 0xEF, 0x30, 0xE7, 0x06, 0x90, -0x01, 0xC7, 0x74, 0x21, 0xF0, 0xEF, 0x30, 0xE6, 0x06, 0x90, 0x01, 0xC7, 0x74, 0x22, 0xF0, 0xEF, -0x30, 0xE5, 0x06, 0x90, 0x01, 0xC7, 0x74, 0x23, 0xF0, 0x90, 0x90, 0x15, 0xE0, 0x24, 0x40, 0x60, -0x04, 0x24, 0x20, 0x70, 0x35, 0x90, 0x8E, 0x99, 0xE0, 0xFF, 0xC4, 0x13, 0x13, 0x13, 0x54, 0x01, -0x20, 0xE0, 0x02, 0x61, 0x2C, 0x90, 0x8E, 0xAA, 0xE0, 0x04, 0xF0, 0x90, 0x90, 0x13, 0xE0, 0xFE, -0xA3, 0xE0, 0xFF, 0x12, 0x85, 0x05, 0xEF, 0x70, 0x02, 0x61, 0x2C, 0x90, 0x90, 0x15, 0xE0, 0xFF, -0xF1, 0xD0, 0x90, 0x8E, 0xAB, 0xE0, 0x04, 0xF0, 0x61, 0x2C, 0x90, 0x8E, 0x98, 0xE0, 0xC4, 0x13, -0x13, 0x54, 0x03, 0x30, 0xE0, 0x71, 0x90, 0x90, 0x18, 0xE0, 0xFF, 0x90, 0x90, 0x14, 0xE0, 0x2F, -0xFF, 0x90, 0x90, 0x13, 0xE0, 0x34, 0x00, 0xCF, 0x24, 0x08, 0xCF, 0x34, 0x00, 0x90, 0x90, 0x1E, -0xF0, 0xA3, 0xEF, 0xF0, 0x24, 0x00, 0xF5, 0x82, 0xE4, 0x34, 0xFB, 0xF5, 0x83, 0xE0, 0x64, 0x45, -0x70, 0x45, 0x90, 0x90, 0x1E, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x12, 0x90, 0xA9, 0xEF, 0x64, 0x01, -0x70, 0x35, 0x90, 0x90, 0x1E, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x12, 0x90, 0xCA, 0xBF, 0x01, 0x27, -0x90, 0x90, 0x1E, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x12, 0x8F, 0x81, 0x90, 0x90, 0x20, 0xE0, 0xFD, -0x90, 0xFD, 0x11, 0xF0, 0x90, 0x90, 0x1E, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x12, 0x90, 0x02, 0x90, -0x90, 0x20, 0xE0, 0x90, 0xFD, 0x11, 0xF0, 0x90, 0x90, 0x13, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x90, -0x90, 0x18, 0xE0, 0xFD, 0x90, 0x90, 0x1B, 0xE0, 0xFB, 0x90, 0x90, 0x20, 0xE0, 0x90, 0x90, 0x28, -0xF0, 0xB1, 0xB9, 0x90, 0x8E, 0x98, 0xE0, 0xFF, 0xC3, 0x13, 0x30, 0xE0, 0x0F, 0x90, 0x90, 0x13, -0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x90, 0x90, 0x18, 0xE0, 0xFD, 0x71, 0xE4, 0x12, 0x86, 0x53, 0xEF, -0x64, 0x01, 0x60, 0x07, 0x90, 0x01, 0x3F, 0xE0, 0x30, 0xE2, 0x02, 0xD1, 0x52, 0x12, 0x84, 0xDF, -0xEF, 0x64, 0x01, 0x70, 0x3D, 0x90, 0x8E, 0xAC, 0xE0, 0x04, 0xF0, 0xF1, 0x1B, 0x90, 0x90, 0x22, -0xEF, 0xF0, 0x64, 0x01, 0x60, 0x25, 0x90, 0x8E, 0x9D, 0xE0, 0x44, 0x01, 0xF0, 0x90, 0x90, 0x22, -0xE0, 0xFF, 0xB4, 0x02, 0x08, 0x90, 0x01, 0xC7, 0x74, 0x42, 0xF0, 0x80, 0x0A, 0xEF, 0xB4, 0x04, -0x06, 0x90, 0x01, 0xC7, 0x74, 0x43, 0xF0, 0xD1, 0x52, 0x80, 0x18, 0x90, 0x90, 0x0F, 0xF1, 0xBD, -0x80, 0x09, 0x90, 0x8E, 0x98, 0xE0, 0x54, 0xFE, 0xF0, 0x80, 0x08, 0x90, 0x90, 0x16, 0xE0, 0x04, -0xF0, 0x01, 0xF1, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xCD, 0x34, 0x00, 0xFC, 0x7E, 0x00, 0xED, 0x2F, -0xFF, 0xEE, 0x3C, 0xFE, 0xE4, 0xFD, 0xAB, 0x07, 0xAA, 0x06, 0xED, 0x2B, 0xFB, 0xE4, 0x3A, 0xFA, -0xC3, 0x90, 0x8D, 0xF6, 0xE0, 0x9B, 0x90, 0x8D, 0xF5, 0xE0, 0x9A, 0x50, 0x13, 0xA3, 0xE0, 0x24, -0x01, 0xFF, 0x90, 0x8D, 0xF5, 0xE0, 0x34, 0x00, 0xFE, 0xC3, 0xEB, 0x9F, 0xFB, 0xEA, 0x9E, 0xFA, -0xEA, 0x90, 0xFD, 0x11, 0xF0, 0xAF, 0x03, 0x74, 0x00, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0xFB, 0xF5, -0x83, 0xE0, 0xFF, 0x22, 0x90, 0x90, 0x24, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0xA3, 0xED, 0xF0, 0x78, -0x2D, 0x7C, 0x90, 0x7D, 0x01, 0x7B, 0xFF, 0x7A, 0x40, 0x79, 0x50, 0x7E, 0x00, 0x7F, 0x06, 0x12, -0x46, 0xD0, 0x78, 0x33, 0x7C, 0x90, 0x7D, 0x01, 0x7B, 0xFF, 0x7A, 0x40, 0x79, 0x56, 0x7E, 0x00, -0x7F, 0x04, 0x12, 0x46, 0xD0, 0x78, 0x37, 0x7C, 0x90, 0x7D, 0x01, 0x7B, 0xFF, 0x7A, 0x40, 0x79, -0x5A, 0x7E, 0x00, 0x7F, 0x04, 0x12, 0x46, 0xD0, 0xE4, 0x90, 0x90, 0x3C, 0xF0, 0x90, 0x90, 0x26, -0xE0, 0xFF, 0x90, 0x90, 0x25, 0xE0, 0x2F, 0xFF, 0x90, 0x90, 0x24, 0xE0, 0x34, 0x00, 0xCF, 0x24, -0x06, 0xCF, 0x34, 0x00, 0xFE, 0xE4, 0xFD, 0x71, 0xA6, 0xEF, 0x64, 0x08, 0x60, 0x02, 0xA1, 0xB3, -0x90, 0x90, 0x26, 0xE0, 0xFF, 0x90, 0x90, 0x25, 0xE0, 0x2F, 0xFF, 0x90, 0x90, 0x24, 0xE0, 0x34, -0x00, 0xCF, 0x24, 0x07, 0xCF, 0x34, 0x00, 0xFE, 0xE4, 0xFD, 0x71, 0xA6, 0xEF, 0x64, 0x06, 0x60, -0x02, 0xA1, 0xB3, 0x90, 0x90, 0x3C, 0x04, 0xF0, 0xE4, 0x90, 0x90, 0x3B, 0xF0, 0x90, 0x90, 0x3B, -0xE0, 0xFF, 0xC3, 0x94, 0x06, 0x50, 0x24, 0x90, 0x90, 0x25, 0xE0, 0x24, 0x0A, 0xFD, 0x90, 0x90, -0x24, 0xE0, 0x71, 0x99, 0x90, 0x90, 0x3B, 0xE0, 0x24, 0x27, 0xF5, 0x82, 0xE4, 0x34, 0x90, 0xF5, -0x83, 0xEF, 0xF0, 0x90, 0x90, 0x3B, 0xE0, 0x04, 0xF0, 0x80, 0xD2, 0xE4, 0x90, 0x90, 0x3B, 0xF0, -0x90, 0x90, 0x3B, 0xE0, 0xFF, 0xC3, 0x94, 0x06, 0x50, 0x2D, 0x90, 0x90, 0x26, 0xE0, 0xFD, 0x90, -0x90, 0x25, 0xE0, 0x2D, 0xFD, 0x90, 0x90, 0x24, 0xE0, 0x34, 0x00, 0xCD, 0x24, 0x10, 0x71, 0x98, -0x90, 0x90, 0x3B, 0xE0, 0x24, 0x2D, 0xF5, 0x82, 0xE4, 0x34, 0x90, 0xF5, 0x83, 0xEF, 0xF0, 0x90, -0x90, 0x3B, 0xE0, 0x04, 0xF0, 0x80, 0xC9, 0xE4, 0x90, 0x90, 0x3B, 0xF0, 0x90, 0x90, 0x3B, 0xE0, -0xFF, 0xC3, 0x94, 0x04, 0x50, 0x2D, 0x90, 0x90, 0x26, 0xE0, 0xFD, 0x90, 0x90, 0x25, 0xE0, 0x2D, -0xFD, 0x90, 0x90, 0x24, 0xE0, 0x34, 0x00, 0xCD, 0x24, 0x16, 0x71, 0x98, 0x90, 0x90, 0x3B, 0xE0, -0x24, 0x33, 0xF5, 0x82, 0xE4, 0x34, 0x90, 0xF5, 0x83, 0xEF, 0xF0, 0x90, 0x90, 0x3B, 0xE0, 0x04, -0xF0, 0x80, 0xC9, 0x78, 0x27, 0x7C, 0x90, 0x7D, 0x01, 0x7B, 0x01, 0x7A, 0x8E, 0x79, 0xA4, 0x7E, -0x00, 0x7F, 0x06, 0x12, 0x49, 0x08, 0xEF, 0x70, 0x7A, 0x90, 0x90, 0x3B, 0xF0, 0x90, 0x90, 0x3B, -0xE0, 0xFF, 0xC3, 0x94, 0x04, 0x50, 0x2D, 0x90, 0x90, 0x26, 0xE0, 0xFD, 0x90, 0x90, 0x25, 0xE0, -0x2D, 0xFD, 0x90, 0x90, 0x24, 0xE0, 0x34, 0x00, 0xCD, 0x24, 0x20, 0x71, 0x98, 0x90, 0x90, 0x3B, -0xE0, 0x24, 0x37, 0xF5, 0x82, 0xE4, 0x34, 0x90, 0xF5, 0x83, 0xEF, 0xF0, 0x90, 0x90, 0x3B, 0xE0, -0x04, 0xF0, 0x80, 0xC9, 0x78, 0x37, 0x7C, 0x90, 0x7D, 0x01, 0x7B, 0x01, 0x7A, 0x8E, 0x79, 0xB1, -0x7E, 0x00, 0x7F, 0x04, 0x12, 0x49, 0x08, 0xEF, 0x90, 0x06, 0x30, 0x70, 0x20, 0xE0, 0x44, 0x01, -0x54, 0xDF, 0xF0, 0x7B, 0x01, 0x7A, 0x90, 0x79, 0x2D, 0x90, 0x90, 0x40, 0x12, 0x47, 0x53, 0xE4, -0x90, 0x90, 0x43, 0xF0, 0x7A, 0x90, 0x79, 0x33, 0x12, 0x85, 0x7E, 0x80, 0x06, 0xE0, 0x44, 0x21, -0x54, 0xEF, 0xF0, 0x90, 0x90, 0x3C, 0xE0, 0xFF, 0x22, 0x90, 0x90, 0x26, 0xED, 0xF0, 0xA3, 0xEB, -0xF0, 0x90, 0x90, 0x24, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0xE4, 0x90, 0x90, 0x29, 0xF0, 0xFD, 0x71, -0xA6, 0xEF, 0x54, 0x0C, 0x64, 0x08, 0x70, 0x74, 0x90, 0x90, 0x24, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, -0xA3, 0xE0, 0x24, 0x06, 0xFD, 0x71, 0xA6, 0xEF, 0x64, 0x88, 0x70, 0x60, 0x90, 0x90, 0x24, 0xE0, -0xFE, 0xA3, 0xE0, 0xFF, 0xA3, 0xE0, 0x24, 0x07, 0xFD, 0x71, 0xA6, 0xEF, 0x64, 0x8E, 0x70, 0x4C, -0x90, 0x90, 0x29, 0x04, 0xF0, 0x90, 0x90, 0x24, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x90, 0x90, 0x27, -0xE0, 0xFD, 0x90, 0x90, 0x26, 0xE0, 0x2D, 0x04, 0xFD, 0x71, 0xA6, 0xEF, 0x64, 0x03, 0x70, 0x2C, -0x90, 0x90, 0x24, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x90, 0x90, 0x27, 0xE0, 0xFD, 0x90, 0x90, 0x26, -0xE0, 0x2D, 0x24, 0x06, 0xFD, 0x71, 0xA6, 0xEF, 0x90, 0x01, 0xC7, 0x30, 0xE3, 0x04, 0x74, 0x01, -0x80, 0x02, 0x74, 0x02, 0xF0, 0x90, 0x8E, 0x9D, 0xE0, 0x44, 0x01, 0xF0, 0x90, 0x90, 0x29, 0xE0, -0xFF, 0x22, 0x90, 0x8D, 0x05, 0xE0, 0xB4, 0x02, 0x16, 0x90, 0x8E, 0x9A, 0xE0, 0xFF, 0xC4, 0x13, -0x13, 0x13, 0x54, 0x01, 0x30, 0xE0, 0x0F, 0x90, 0x01, 0x4D, 0xE0, 0x64, 0x80, 0xF0, 0x22, 0x90, -0x06, 0x90, 0xE0, 0x44, 0x01, 0xF0, 0x90, 0x90, 0x0A, 0xE0, 0x75, 0xF0, 0x20, 0xA4, 0xFF, 0x90, -0x90, 0xE8, 0xE5, 0xF0, 0xF0, 0xA3, 0xEF, 0xF0, 0x90, 0x90, 0x0B, 0xE0, 0x75, 0xF0, 0x08, 0xA4, -0xAE, 0xF0, 0x90, 0x90, 0xEA, 0xF0, 0xEE, 0xA3, 0xF0, 0x90, 0x90, 0x09, 0xE0, 0xFE, 0xC4, 0x13, -0x13, 0x13, 0x54, 0x01, 0x30, 0xE0, 0x73, 0xEE, 0x54, 0x0F, 0xFF, 0xEE, 0xC4, 0x13, 0x13, 0x54, -0x03, 0x7D, 0x00, 0x20, 0xE0, 0x02, 0x7D, 0x01, 0x12, 0x74, 0xED, 0x90, 0x90, 0x09, 0xE0, 0xFE, -0x54, 0x0F, 0xFF, 0xEE, 0xC4, 0x13, 0x13, 0x54, 0x01, 0xFD, 0x12, 0x74, 0xED, 0x90, 0x90, 0x09, -0xE0, 0xC4, 0x13, 0x54, 0x07, 0x30, 0xE0, 0x23, 0x90, 0x90, 0xE8, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, -0x12, 0x3A, 0xF7, 0x90, 0x90, 0x09, 0xE0, 0xFE, 0x54, 0x0F, 0xFF, 0xEE, 0xC4, 0x13, 0x13, 0x54, -0x03, 0x7D, 0x00, 0x20, 0xE0, 0x02, 0x7D, 0x01, 0x12, 0x74, 0xED, 0x90, 0x90, 0x09, 0xE0, 0xC4, -0x54, 0x0F, 0x30, 0xE0, 0x15, 0x90, 0x90, 0xEB, 0xE0, 0xF5, 0x11, 0x90, 0x90, 0xEA, 0xE0, 0xF5, -0x12, 0xE4, 0xFB, 0xFD, 0x7F, 0x58, 0x7E, 0x01, 0xF1, 0xF8, 0x22, 0x90, 0x02, 0x86, 0xE0, 0x20, -0xE2, 0x03, 0x7F, 0x04, 0x22, 0x90, 0x02, 0x86, 0xE0, 0x7F, 0x01, 0x20, 0xE1, 0x02, 0x7F, 0x02, -0x22, 0xF1, 0x1B, 0xAD, 0x07, 0xEF, 0x64, 0x01, 0x60, 0x1F, 0x90, 0x8E, 0x9D, 0xE0, 0x44, 0x01, -0xF0, 0xED, 0xB4, 0x02, 0x08, 0x90, 0x01, 0xC7, 0x74, 0x40, 0xF0, 0x80, 0x0A, 0xED, 0xB4, 0x04, -0x06, 0x90, 0x01, 0xC7, 0x74, 0x41, 0xF0, 0xC1, 0x52, 0x12, 0x83, 0x9D, 0x90, 0x02, 0x87, 0xE0, -0x70, 0xF7, 0x90, 0x06, 0x90, 0xE0, 0x44, 0x02, 0xF0, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, -0xD0, 0xE4, 0xFF, 0x90, 0x8D,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90, 0xBC, 0xF0, 0xEB, -0x90, 0x90, 0xB7, 0xF0, 0x7F, 0xB0, 0x7E, 0x08, 0x12, 0x36, 0xCE, 0xE4, 0xFF, 0xEC, 0x90, 0x90, -0xB8, 0x12, 0x27, 0x48, 0x90, 0x90, 0xB8, 0x12, 0x47, 0x32, 0x90, 0x90, 0xB7, 0xE0, 0xFF, 0xE4, -0xFC, 0xFD, 0xFE, 0x12, 0x47, 0x19, 0xA3, 0x12, 0x27, 0x48, 0x90, 0x90, 0xB8, 0x12, 0x47, 0x26, -0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0x7F, 0xB0, 0x7E, 0x08, 0x12, 0x37, 0x5D, 0x7F, 0x14, 0x7E, -0x00, 0x12, 0x3A, 0xF7, 0x90, 0x90, 0xB6, 0xE0, 0x75, 0xF0, 0x08, 0xA4, 0x24, 0x73, 0xF5, 0x82, -0xE4, 0x34, 0xAF, 0xF5, 0x83, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x12, 0x36, 0xCE, 0xED, 0x54, 0x0F, -0xFD, 0xE4, 0xFC, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x11, 0x1D, 0xD0, 0xD0, 0x92, -0xAF, 0x22, 0xE0, 0xFF, 0xE4, 0xFC, 0xFD, 0xFE, 0x90, 0x90, 0x63, 0x12, 0x27, 0x48, 0x7D, 0x18, -0x7C, 0x00, 0xE4, 0xFF, 0x90, 0x90, 0x5D, 0xEC, 0xF0, 0xA3, 0xED, 0xF0, 0x90, 0x90, 0x5C, 0xEF, -0xF0, 0xA3, 0xA3, 0xE0, 0xFD, 0x11, 0x94, 0x90, 0x90, 0x67, 0x12, 0x27, 0x48, 0x90, 0x90, 0x5F, -0x12, 0x47, 0x26, 0x12, 0x27, 0x15, 0x90, 0x90, 0x67, 0x12, 0x47, 0x32, 0x12, 0x47, 0x0C, 0xC0, -0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0x90, 0x5F, 0x12, 0x47, 0x26, 0x90, 0x90, 0x63, -0x12, 0x47, 0x32, 0x12, 0x47, 0x0C, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0x12, 0x47, -0x19, 0x90, 0x90, 0x6B, 0x12, 0x27, 0x48, 0x90, 0x90, 0x5D, 0xA3, 0xE0, 0xFD, 0xC0, 0x05, 0x90, -0x90, 0x6B, 0x12, 0x47, 0x26, 0x90, 0xAC, 0x96, 0x12, 0x27, 0x48, 0x90, 0x90, 0x5C, 0xE0, 0xFF, -0xD0, 0x05, 0x02, 0x39, 0xBA, 0x90, 0x90, 0xD4, 0xED, 0xF0, 0xA3, 0xEB, 0xF0, 0x90, 0x90, 0xD3, -0xEF, 0xF0, 0x90, 0x90, 0xD6, 0xE0, 0xFD, 0x12, 0x82, 0x8B, 0x90, 0x90, 0xD3, 0xE0, 0xC3, 0x94, -0x0E, 0x50, 0x46, 0x90, 0x90, 0x71, 0x12, 0x27, 0x54, 0x1F, 0xFE, 0x00, 0x00, 0x90, 0x90, 0x75, -0x12, 0x27, 0x54, 0x12, 0xD4, 0x00, 0x00, 0x7F, 0x60, 0x7E, 0x08, 0x71, 0xBC, 0x90, 0x90, 0x5F, -0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0x00, 0x90, 0x90, 0x63, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, -0x00, 0x11, 0xAE, 0x90, 0x90, 0x5F, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0x00, 0x90, 0x90, 0x63, -0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x41, 0xCD, 0x90, 0x90, 0xD3, 0xE0, 0xFF, 0x74, 0x24, -0xD3, 0x9F, 0x50, 0x1B, 0xEF, 0x94, 0x30, 0x50, 0x16, 0x90, 0x90, 0x71, 0x12, 0x27, 0x54, 0x1F, -0xFE, 0x00, 0x00, 0x90, 0x90, 0x75, 0x12, 0x27, 0x54, 0x09, 0x28, 0x00, 0x00, 0x80, 0x6B, 0x90, -0x90, 0xD3, 0xE0, 0xFF, 0x74, 0x32, 0xD3, 0x9F, 0x50, 0x1B, 0xEF, 0x94, 0x40, 0x50, 0x16, 0x90, -0x90, 0x71, 0x12, 0x27, 0x54, 0x1F, 0xFE, 0x00, 0x00, 0x90, 0x90, 0x75, 0x12, 0x27, 0x54, 0x08, -0xA6, 0x00, 0x00, 0x80, 0x45, 0x90, 0x90, 0xD3, 0xE0, 0xFF, 0x74, 0x64, 0xD3, 0x9F, 0x50, 0x1B, -0xEF, 0x94, 0x74, 0x50, 0x16, 0x90, 0x90, 0x71, 0x12, 0x27, 0x54, 0x1F, 0xFE, 0x00, 0x00, 0x90, -0x90, 0x75, 0x12, 0x27, 0x54, 0x08, 0xA4, 0x00, 0x00, 0x80, 0x1F, 0x90, 0x90, 0xD3, 0xE0, 0xFF, -0x74, 0x76, 0xD3, 0x9F, 0x50, 0x1A, 0x90, 0x90, 0x71, 0x12, 0x27, 0x54, 0x1F, 0xFE, 0x00, 0x00, -0x90, 0x90, 0x75, 0x12, 0x27, 0x54, 0x08, 0x24, 0x00, 0x00, 0x7F, 0x60, 0x7E, 0x08, 0x71, 0xBC, -0x90, 0x90, 0xD3, 0xE0, 0xFF, 0x74, 0x24, 0xD3, 0x9F, 0x50, 0x31, 0xEF, 0x94, 0x40, 0x50, 0x2C, -0x90, 0x90, 0x5F, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0x00, 0x90, 0x90, 0x63, 0x12, 0x27, 0x54, -0x00, 0x01, 0x01, 0x00, 0x11, 0xAE, 0x90, 0x90, 0x5F, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0x00, -0x90, 0x90, 0x63, 0x12, 0x27, 0x54, 0x00, 0x01, 0x01, 0x00, 0x80, 0x71, 0x90, 0x90, 0xD3, 0xE0, -0xFF, 0x74, 0x64, 0xD3, 0x9F, 0x50, 0x31, 0xEF, 0x94, 0x8C, 0x50, 0x2C, 0x90, 0x90, 0x5F, 0x12, -0x27, 0x54, 0x00, 0x07, 0x03, 0x00, 0x90, 0x90, 0x63, 0x12, 0x27, 0x54, 0x00, 0x03, 0x01, 0x00, -0x11, 0xAE, 0x90, 0x90, 0x5F, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0x00, 0x90, 0x90, 0x63, 0x12, -0x27, 0x54, 0x00, 0x03, 0x01, 0x00, 0x80, 0x35, 0x90, 0x90, 0xD3, 0xE0, 0xFF, 0x74, 0x8C, 0xC3, -0x9F, 0x50, 0x32, 0x90, 0x90, 0x5F, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0x00, 0x90, 0x90, 0x63, -0x12, 0x27, 0x54, 0x00, 0x05, 0x01, 0x00, 0x11, 0xAE, 0x90, 0x90, 0x5F, 0x12, 0x27, 0x54, 0x00, -0x07, 0x03, 0x00, 0x90, 0x90, 0x63, 0x12, 0x27, 0x54, 0x00, 0x05, 0x01, 0x00, 0x7D, 0x18, 0x7C, -0x00, 0x7F, 0x01, 0x11, 0xB4, 0x90, 0x90, 0xD3, 0xE0, 0xFF, 0xA3, 0xE0, 0xFD, 0x12, 0x81, 0x4B, -0x90, 0x90, 0xD4, 0xE0, 0x64, 0x02, 0x70, 0x66, 0x90, 0x90, 0xD3, 0xE0, 0xFF, 0xD3, 0x94, 0x30, -0x50, 0x08, 0x90, 0x90, 0xD7, 0x74, 0x2A, 0xF0, 0x80, 0x70, 0xEF, 0xD3, 0x94, 0x40, 0x50, 0x08, -0x90, 0x90, 0xD7, 0x74, 0x3A, 0xF0, 0x80, 0x62, 0xEF, 0xD3, 0x94, 0x70, 0x50, 0x08, 0x90, 0x90, -0xD7, 0x74, 0x6A, 0xF0, 0x80, 0x54, 0xEF, 0xD3, 0x94, 0x80, 0x50, 0x08, 0x90, 0x90, 0xD7, 0x74, -0x7A, 0xF0, 0x80, 0x46, 0xEF, 0xD3, 0x94, 0x90, 0x50, 0x08, 0x90, 0x90, 0xD7, 0x74, 0x8A, 0xF0, -0x80, 0x38, 0xEF, 0xD3, 0x94, 0xA1, 0x50, 0x08, 0x90, 0x90, 0xD7, 0x74, 0x9B, 0xF0, 0x80, 0x2A, -0xEF, 0xD3, 0x94, 0xB1, 0x50, 0x24, 0x90, 0x90, 0xD7, 0x74, 0xAB, 0xF0, 0x80, 0x1C, 0x90, 0x90, -0xD4, 0xE0, 0x64, 0x01, 0x70, 0x32, 0xA3, 0xE0, 0x90, 0x90, 0xD3, 0xB4, 0x01, 0x05, 0xE0, 0x24, -0x02, 0x80, 0x03, 0xE0, 0x24, 0xFE, 0x90, 0x90, 0xD7, 0xF0, 0x90, 0x90, 0x5F, 0x12, 0x27, 0x54, -0x00, 0x00, 0x00, 0xFF, 0x90, 0x90, 0xD7, 0x11, 0xA2, 0x90, 0x90, 0x5F, 0x12, 0x27, 0x54, 0x00, -0x00, 0x00, 0xFF, 0x90, 0x90, 0xD7, 0x80, 0x1C, 0x90, 0x90, 0x5F, 0x12, 0x27, 0x54, 0x00, 0x00, -0x00, 0xFF, 0x90, 0x90, 0xD3, 0x11, 0xA2, 0x90, 0x90, 0x5F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, -0xFF, 0x90, 0x90, 0xD3, 0xE0, 0xFF, 0xE4, 0xFC, 0xFD, 0xFE, 0x90, 0x90, 0x63, 0x12, 0x27, 0x48, -0x7D, 0x18, 0x7C, 0x00, 0x7F, 0x01, 0x01, 0xB4, 0x7F, 0xB4, 0x7E, 0x0C, 0x90, 0x90, 0x6F, 0xEE, -0xF0, 0xA3, 0xEF, 0xF0, 0x12, 0x36, 0xCE, 0x90, 0x90, 0x79, 0x12, 0x27, 0x48, 0x90, 0x90, 0x71, -0x12, 0x47, 0x26, 0x12, 0x27, 0x15, 0x90, 0x90, 0x79, 0x12, 0x47, 0x32, 0x12, 0x47, 0x0C, 0xC0, -0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0x90, 0x71, 0x12, 0x47, 0x26, 0x90, 0x90, 0x75, -0x12, 0x47, 0x32, 0x12, 0x47, 0x0C, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0x12, 0x47, -0x19, 0x90, 0x90, 0x7D, 0x12, 0x27, 0x48, 0x90, 0x90, 0x7D, 0x12, 0x47, 0x26, 0x90, 0xAC, 0xB9, -0x12, 0x27, 0x48, 0x90, 0x90, 0x6F, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x02, 0x37, 0x5D, 0x7F, 0x34, -0x7E, 0x08, 0x71, 0xBC, 0x90, 0x90, 0xF8, 0xE0, 0xFF, 0xA3, 0xE0, 0xFD, 0x90, 0x91, 0x0F, 0xED, -0xF0, 0xEF, 0x60, 0x02, 0xA1, 0x26, 0xE0, 0x24, 0xFD, 0x50, 0x0C, 0x60, 0x27, 0x14, 0x60, 0x41, -0x14, 0x70, 0x02, 0x81, 0xCF, 0xC1, 0xF8, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, -0x77, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x77, -0x77, 0x77, 0xA1, 0xB0, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x54, 0x33, 0x77, 0x70, 0x7F, 0xB0, -0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x54, 0x33, 0x77, 0x70, 0xC1, -0x4C, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, 0x77, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, -0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, 0x77, 0x7F, 0xB0, 0x7E, 0x0E, -0x12, 0x37, 0x5D, 0x90, 0x90, 0x71, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0x90, 0x75, -0x12, 0x27, 0x54, 0x00, 0x10, 0x00, 0x00, 0x71, 0xB8, 0x90, 0x90, 0x71, 0x12, 0x27, 0x54, 0x3F, -0xF0, 0x00, 0x00, 0x90, 0x90, 0x75, 0x12, 0x27, 0x54, 0x00, 0x10, 0x00, 0x00, 0xC1, 0xF2, 0x90, -0x90, 0x71, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0xFF, 0x90, 0x90, 0x75, 0x12, 0x27, 0x54, 0x00, -0x00, 0x00, 0x77, 0x7F, 0xB0, 0x7E, 0x0C, 0x71, 0xBC, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, -0x77, 0x77, 0x77, 0x7F, 0xB0, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0x90, 0x71, 0x12, 0x27, 0x54, -0x01, 0x00, 0x00, 0x00, 0x90, 0x90, 0x75, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x71, 0xB8, -0x90, 0x90, 0x71, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0x90, 0x75, 0x12, 0x27, 0x54, -0x00, 0x00, 0x00, 0x00, 0xC1, 0xF2, 0x90, 0x91, 0x0F, 0xE0, 0x14, 0x60, 0x68, 0x14, 0x70, 0x02, -0xA1, 0xE3, 0x14, 0x70, 0x02, 0xC1, 0x31, 0x14, 0x70, 0x02, 0xA1, 0xE3, 0x14, 0x70, 0x02, 0xC1, -0x9D, 0x24, 0x05, 0x60, 0x02, 0xC1, 0xF8, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x33, 0x77, -0x17, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x33, -0x77, 0x17, 0x7F, 0xB0, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0x90, 0x71, 0x12, 0x27, 0x54, 0x3F, -0xF0, 0x00, 0x00, 0x90, 0x90, 0x75, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0x71, 0xB8, 0x90, -0x90, 0x71, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0x90, 0x75, 0x12, 0x27, 0x54, 0x01, -0x00, 0x00, 0x00, 0xC1, 0xF2, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x33, 0x77, 0x17, 0x7F, -0xB0, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x33, 0x77, 0x17, -0x7F, 0xB0, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0x90, 0x71, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, -0x00, 0x90, 0x90, 0x75, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x71, 0xB8, 0x90, 0x90, 0x71, -0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0x90, 0x75, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, -0x00, 0xC1, 0xF2, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x33, 0x77, 0x77, 0x7F, 0xB0, 0x7E, -0x0C, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x33, 0x77, 0x77, 0x7F, 0xB0, -0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0x90, 0x71, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, -0x90, 0x75, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0x71, 0xB8, 0x90, 0x90, 0x71, 0x12, 0x27, -0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0x90, 0x75, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0xC1, -0xF2, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x54, 0x33, 0x77, 0x17, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, -0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x54, 0x33, 0x77, 0x17, 0x7F, 0xB0, 0x7E, 0x0E, -0x12, 0x37, 0x5D, 0x90, 0x90, 0x71, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0x90, 0x75, -0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0x71, 0xB8, 0x90, 0x90, 0x71, 0x12, 0x27, 0x54, 0x3F, -0xF0, 0x00, 0x00, 0x90, 0x90, 0x75, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0x7F, 0xB4, 0x7E, -0x0E, 0x71, 0xBC, 0x90, 0x90, 0x71, 0x12, 0x27, 0x54, 0x00, 0x00, 0x03, 0x03, 0x90, 0x90, 0x75, -0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x01, 0x7F, 0x00, 0x7E, 0x09, 0x80, 0x59, 0x90, 0x90, 0x71, -0x12, 0x27, 0x54, 0x00, 0xFF, 0x00, 0x00, 0x90, 0x90, 0x75, 0x12, 0x27, 0x54, 0x00, 0x33, 0x00, -0x00, 0x7F, 0xB0, 0x7E, 0x0C, 0x71, 0xBC, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x33, 0x77, -0x77, 0x7F, 0xB0, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0x90, 0x71, 0x12, 0x27, 0x54, 0x01, 0x00, -0x00, 0x00, 0x90, 0x90, 0x75, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0x71, 0xB8, 0x90, 0x90, -0x71, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0x90, 0x75, 0x12, 0x27, 0x54, 0x01, 0x00, -0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0E, 0x71, 0xBC, 0x22, 0x90, 0x90, 0xF9, 0xED, 0xF0, 0x90, 0x90, -0xF8, 0xEF, 0xF0, 0x70, 0x74, 0x90, 0x90, 0x71, 0x12, 0x27, 0x54, 0x30, 0x00, 0x00, 0x00, 0x90, -0x90, 0x75, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x74, 0x08, 0xFF, 0xFE, 0x71, 0xBC, 0x90, -0x90, 0x71, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x0E, 0x90, 0x90, 0x75, 0x12, 0x27, 0x54, 0x00, -0x00, 0x00, 0x08, 0x7F, 0x30, 0x7E, 0x08, 0x71, 0xBC, 0x90, 0x90, 0x71, 0x12, 0x27, 0x54, 0x00, -0x00, 0x00, 0x03, 0x90, 0x90, 0x75, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x01, 0x91, 0x1E, 0x90, -0x90, 0x71, 0x12, 0x27, 0x54, 0x30, 0x00, 0x00, 0x00, 0x90, 0x90, 0x75, 0x12, 0x27, 0x54, 0x30, -0x00, 0x00, 0x00, 0x74, 0x08, 0xFF, 0xFE, 0x71, 0xBC, 0x90, 0x04, 0x54, 0xE0, 0x54, 0x7F, 0x90, -0x90, 0xFA, 0xF0, 0xE0, 0x90, 0x04, 0x54, 0xF0, 0x22, 0x90, 0x90, 0xF8, 0xE0, 0x64, 0x01, 0x70, -0x73, 0x90, 0x04, 0x54, 0xE0, 0x44, 0x80, 0x90, 0x90, 0xFA, 0xF0, 0xE0, 0x90, 0x04, 0x54, 0xF0, -0x90, 0x90, 0x71, 0x12, 0x27, 0x54, 0x30, 0x00, 0x00, 0x00, 0x90, 0x90, 0x75, 0x12, 0x27, 0x54, -0x00, 0x00, 0x00, 0x00, 0x74, 0x08, 0xFF, 0xFE, 0x71, 0xBC, 0x90, 0x90, 0x71, 0x12, 0x27, 0x54, -0x00, 0x00, 0x00, 0x0E, 0x90, 0x90, 0x75, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x06, 0x7F, 0x30, -0x7E, 0x08, 0x71, 0xBC, 0x90, 0x90, 0x71, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x03, 0x90, 0x90, -0x75, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x02, 0x91, 0x1E, 0x90, 0x90, 0x71, 0x12, 0x27, 0x54, -0x30, 0x00, 0x00, 0x00, 0x90, 0x90, 0x75, 0x12, 0x27, 0x54, 0x20, 0x00, 0x00, 0x00, 0x74, 0x08, -0xFF, 0xFE, 0x71, 0xBC, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xC0, 0x07, 0xC0, 0x05, -0x90, 0x90, 0xBF, 0x12, 0x47, 0x26, 0x90, 0xAC, 0x9C, 0x12, 0x27, 0x48, 0xD0, 0x05, 0xD0, 0x07, -0x12, 0x32, 0x65, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xC0, 0xE0, 0xC0, 0xF0, 0xC0, 0x83, 0xC0, 0x82, -0xC0, 0xD0, 0x75, 0xD0, 0x00, 0xC0, 0x00, 0xC0, 0x01, 0xC0, 0x02, 0xC0, 0x03, 0xC0, 0x04, 0xC0, -0x05, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0x01, 0xC4, 0x74, 0x18, 0xF0, 0x74, 0x68, 0xA3, 0xF0, 0x11, -0x67, 0x74, 0x18, 0x04, 0x90, 0x01, 0xC4, 0xF0, 0x74, 0x68, 0xA3, 0xF0, 0xD0, 0x07, 0xD0, 0x06, -0xD0, 0x05, 0xD0, 0x04, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0xD0, 0xD0, 0xD0, 0x82, -0xD0, 0x83, 0xD0, 0xF0, 0xD0, 0xE0, 0x32, 0x7B, 0x00, 0x7A, 0x00, 0x79, 0x53, 0xE4, 0xFD, 0x7F, -0x01, 0x12, 0x39, 0x33, 0xE5, 0x51, 0x52, 0x53, 0x7B, 0x00, 0x7A, 0x00, 0x79, 0x54, 0x7D, 0x01, -0x7F, 0x01, 0x12, 0x39, 0x33, 0xE5, 0x52, 0x52, 0x54, 0xAB, 0x53, 0xE4, 0xFD, 0x7F, 0x01, 0x12, -0x39, 0x04, 0xAB, 0x54, 0x7D, 0x01, 0x7F, 0x01, 0x02, 0x39, 0x04, 0xC0, 0xE0, 0xC0, 0xF0, 0xC0, -0x83, 0xC0, 0x82, 0xC0, 0xD0, 0x75, 0xD0, 0x00, 0xC0, 0x00, 0xC0, 0x01, 0xC0, 0x02, 0xC0, 0x03, -0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0x01, 0xC4, 0x74, 0x9B, 0xF0, 0x74, 0x68, -0xA3, 0xF0, 0x11, 0xFD, 0xE5, 0x5C, 0x30, 0xE7, 0x02, 0x11, 0xF1, 0x74, 0x9B, 0x04, 0x90, 0x01, -0xC4, 0xF0, 0x74, 0x68, 0xA3, 0xF0, 0xD0, 0x07, 0xD0, 0x06, 0xD0, 0x05, 0xD0, 0x04, 0xD0, 0x03, -0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0xD0, 0xD0, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xF0, 0xD0, 0xE0, -0x32, 0x90, 0x00, 0x05, 0xE0, 0x44, 0x80, 0xFD, 0x7F, 0x05, 0x02, 0x3A, 0x96, 0x90, 0x00, 0x54, -0xE0, 0x55, 0x55, 0xF5, 0x59, 0xA3, 0xE0, 0x55, 0x56, 0xF5, 0x5A, 0xA3, 0xE0, 0x55, 0x57, 0xF5, -0x5B, 0xA3, 0xE0, 0x55, 0x58, 0xF5, 0x5C, 0xAD, 0x59, 0x7F, 0x54, 0x12, 0x3A, 0x96, 0xAD, 0x5A, -0x7F, 0x55, 0x12, 0x3A, 0x96, 0xAD, 0x5B, 0x7F, 0x56, 0x12, 0x3A, 0x96, 0xAD, 0x5C, 0x7F, 0x57, -0x12, 0x3A, 0x96, 0x53, 0x91, 0xEF, 0x22, 0xC0, 0xE0, 0xC0, 0xF0, 0xC0, 0x83, 0xC0, 0x82, 0xC0, -0xD0, 0x75, 0xD0, 0x00, 0xC0, 0x00, 0xC0, 0x01, 0xC0, 0x02, 0xC0, 0x03, 0xC0, 0x04, 0xC0, 0x05, -0xC0, 0x06, 0xC0, 0x07, 0x90, 0x01, 0xC4, 0x74, 0x37, 0xF0, 0x74, 0x69, 0xA3, 0xF0, 0x12, 0x7D, -0x59, 0xE5, 0x61, 0x30, 0xE3, 0x02, 0x51, 0xAF, 0xE5, 0x61, 0x30, 0xE4, 0x02, 0x51, 0x9B, 0xE5, -0x61, 0x30, 0xE5, 0x03, 0x12, 0x4D, 0x78, 0xE5, 0x63, 0x30, 0xE0, 0x02, 0x31, 0xDE, 0xE5, 0x63, -0x30, 0xE1, 0x02, 0x71, 0x7E, 0xE5, 0x63, 0x30, 0xE2, 0x02, 0x71, 0x25, 0xE5, 0x63, 0x30, 0xE3, -0x02, 0xF1, 0x85, 0xE5, 0x63, 0x30, 0xE4, 0x03, 0x12, 0x7D, 0x95, 0xE5, 0x63, 0x30, 0xE5, 0x02, -0x51, 0xBB, 0xE5, 0x63, 0x30, 0xE6, 0x02, 0xF1, 0xA1, 0xE5, 0x64, 0x30, 0xE1, 0x03, 0x12, 0x57, -0xE5, 0xE5, 0x64, 0x30, 0xE6, 0x02, 0x51, 0x5A, 0x74, 0x37, 0x04, 0x90, 0x01, 0xC4, 0xF0, 0x74, -0x69, 0xA3, 0xF0, 0xD0, 0x07, 0xD0, 0x06, 0xD0, 0x05, 0xD0, 0x04, 0xD0, 0x03, 0xD0, 0x02, 0xD0, -0x01, 0xD0, 0x00, 0xD0, 0xD0, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xF0, 0xD0, 0xE0, 0x32, 0xE4, 0xFF, -0x90, 0x8E, 0x7C, 0xE0, 0x60, 0x73, 0x90, 0x8D, 0xF8, 0xE0, 0x64, 0x01, 0x70, 0x6B, 0x90, 0x8E, -0x7B, 0xE0, 0xC4, 0x54, 0x0F, 0x60, 0x24, 0x24, 0xFE, 0x60, 0x03, 0x04, 0x70, 0x1F, 0x90, 0x8E, -0x83, 0xE0, 0x14, 0xF0, 0xE0, 0xFE, 0x60, 0x06, 0x90, 0x8E, 0x85, 0xE0, 0x60, 0x0F, 0xEE, 0x70, -0x06, 0x90, 0x8E, 0x82, 0xE0, 0xA3, 0xF0, 0x7F, 0x01, 0x80, 0x02, 0x7F, 0x01, 0xEF, 0x60, 0x39, -0x90, 0x8E, 0x80, 0xE0, 0x44, 0x10, 0xF0, 0x90, 0x8E, 0x85, 0xE0, 0x60, 0x03, 0xB4, 0x01, 0x09, -0xE4, 0xF5, 0x11, 0x90, 0x8E, 0x85, 0xE0, 0x80, 0x0D, 0xE4, 0xF5, 0x11, 0x90, 0x8E, 0x85, 0xE0, -0x75, 0xF0, 0x03, 0xA4, 0x24, 0xFE, 0xFF, 0x90, 0x8E, 0x84, 0xE0, 0x2F, 0x12, 0x5F, 0xEF, 0x90, -0x8E, 0x7F, 0xE0, 0x20, 0xE2, 0x03, 0x12, 0x52, 0x53, 0x22, 0x90, 0x07, 0x1F, 0xE0, 0x54, 0x7F, -0xF0, 0x90, 0x07, 0x1C, 0xE0, 0x54, 0x01, 0xFF, 0x90, 0x90, 0x49, 0xF0, 0x90, 0x90, 0x47, 0x74, -0x02, 0xF0, 0x90, 0x90, 0x55, 0x14, 0xF0, 0xFB, 0x7A, 0x90, 0x79, 0x47, 0xB1, 0xAE, 0x7F, 0x04, -0x90, 0x91, 0x0D, 0xEF, 0xF0, 0x7F, 0x02, 0x12, 0x4B, 0x53, 0x90, 0x8D, 0x01, 0xE0, 0xFF, 0x90, -0x91, 0x0D, 0xE0, 0xFE, 0xEF, 0x4E, 0x90, 0x8D, 0x01, 0xF0, 0x22, 0x12, 0x79, 0x08, 0x7F, 0x02, -0x8F, 0x1D, 0x7F, 0x02, 0x12, 0x4B, 0x53, 0x90, 0x8D, 0x01, 0xE0, 0x45, 0x1D, 0xF0, 0x22, 0x90, -0x8E, 0x98, 0xE0, 0x30, 0xE0, 0x04, 0x7F, 0x10, 0x51, 0xA0, 0x22, 0x90, 0x8D, 0xF8, 0xE0, 0xB4, -0x01, 0x15, 0x90, 0x8E, 0x7C, 0xE0, 0x60, 0x0F, 0x90, 0x8E, 0x7B, 0xE0, 0x54, 0x0F, 0x64, 0x02, -0x60, 0x02, 0x80, 0x04, 0x12, 0x57, 0x39, 0x22, 0x90, 0x04, 0x1D, 0xE0, 0x70, 0x13, 0x90, 0x8D, -0x07, 0xE0, 0xFF, 0xE4, 0xFD, 0xF1, 0x09, 0x8E, 0x1B, 0x8F, 0x1C, 0x90, 0x04, 0x1F, 0x74, 0x20, -0xF0, 0x22, 0x90, 0x90, 0x1D, 0x74, 0x12, 0xF0, 0x90, 0x90, 0x2B, 0x74, 0x05, 0xF0, 0x90, 0x90, -0x1F, 0xEF, 0xF0, 0xA3, 0xED, 0xF0, 0xA3, 0xEB, 0xF0, 0x90, 0x90, 0x1B, 0xE0, 0x90, 0x90, 0x22, -0xF0, 0x90, 0x90, 0x1C, 0xE0, 0x90, 0x90, 0x23, 0xF0, 0x7B, 0x01, 0x7A, 0x90, 0x79, 0x1D, 0xB1, -0xAE, 0x7F, 0x04, 0x41, 0x80, 0x90, 0x90, 0x08, 0xE0, 0x04, 0xF0, 0x90, 0x8E, 0x7F, 0xE0, 0x64, -0x02, 0x60, 0x28, 0x91, 0x7E, 0x90, 0x8E, 0x7A, 0xE0, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x30, 0xE0, -0x14, 0x90, 0x8E, 0x82, 0xE0, 0xFF, 0xA3, 0xE0, 0x6F, 0x70, 0x0A, 0xB1, 0x12, 0x71, 0x5C, 0x90, -0x8E, 0x83, 0xE0, 0x14, 0xF0, 0x90, 0x01, 0xE6, 0xE0, 0x04, 0xF0, 0x22, 0x7D, 0x02, 0x7F, 0x02, -0x71, 0x66, 0x7D, 0x01, 0x7F, 0x02, 0x74, 0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, 0x12, 0x7D, 0xF2, 0xE4, 0x90, 0x8F, 0xEE, 0xF0, 0xA3, 0xF0, 0x22, 0x90, 0x8E, 0x94, 0xE0, -0x30, 0xE0, 0x11, 0x90, 0x01, 0x3B, 0xE0, 0x30, 0xE4, 0x0A, 0x71, 0x5C, 0x90, 0x8E, 0x96, 0xE0, -0x90, 0x05, 0x73, 0xF0, 0x22, 0xEF, 0x70, 0x33, 0x7D, 0x78, 0x7F, 0x02, 0x71, 0x66, 0x7D, 0x02, -0x7F, 0x03, 0x71, 0x66, 0x7D, 0xC8, 0x7F, 0x02, 0xB1, 0x96, 0x90, 0x01, 0x57, 0xE4, 0xF0, 0x90, -0x01, 0x3C, 0x74, 0x02, 0xF0, 0x7D, 0x01, 0x7F, 0x0C, 0x12, 0x52, 0x57, 0x90, 0x8E, 0x79, 0xE0, -0x54, 0xF7, 0xF0, 0x90, 0x06, 0x0A, 0xE0, 0x54, 0xF8, 0xF0, 0x22, 0x02, 0x4F, 0x61, 0x90, 0x8D, -0xF8, 0xE0, 0x64, 0x01, 0x60, 0x02, 0xA1, 0x11, 0x90, 0x8E, 0x7C, 0xE0, 0x70, 0x02, 0xA1, 0x11, -0x90, 0x8E, 0x7B, 0xE0, 0xC4, 0x54, 0x0F, 0x64, 0x01, 0x70, 0x22, 0x90, 0x06, 0xAB, 0xE0, 0x90, -0x8E, 0x83, 0xF0, 0x90, 0x06, 0xAA, 0xE0, 0x90, 0x8E, 0x82, 0xF0, 0xA3, 0xE0, 0xFF, 0x70, 0x08, -0x90, 0x8E, 0x82, 0xE0, 0xFE, 0xFF, 0x80, 0x00, 0x90, 0x8E, 0x83, 0xEF, 0xF0, 0x90, 0x8E, 0x7A, -0xE0, 0x44, 0x04, 0xF0, 0xE4, 0x90, 0x8E, 0x85, 0xF0, 0x90, 0x8E, 0x87, 0xA3, 0xE0, 0x90, 0x05, -0x58, 0xF0, 0x90, 0x01, 0x57, 0xE4, 0xF0, 0x90, 0x01, 0x3C, 0x74, 0x02, 0xF0, 0x90, 0x8E, 0x80, -0xE0, 0x54, 0xFD, 0xF0, 0x54, 0xEF, 0xF0, 0x90, 0x8E, 0x7B, 0xE0, 0xFF, 0xC4, 0x54, 0x0F, 0x24, -0xFD, 0x50, 0x02, 0x80, 0x02, 0xD1, 0x99, 0x90, 0x8E, 0x7A, 0xE0, 0x13, 0x13, 0x13, 0x54, 0x1F, -0x30, 0xE0, 0x0E, 0x90, 0x8E, 0x82, 0xE0, 0xFF, 0xA3, 0xE0, 0xB5, 0x07, 0x04, 0xB1, 0x12, 0x71, -0x62, 0x22, 0xEF, 0x14, 0x90, 0x05, 0x73, 0xF0, 0x90, 0x01, 0x3F, 0x74, 0x10, 0xF0, 0xFD, 0x7F, -0x03, 0x74, 0x65, 0x2F, 0xF8, 0xE6, 0x4D, 0xFE, 0xF6, 0x74, 0x38, 0x2F, 0xF5, 0x82, 0xE4, 0x34, -0x01, 0xF5, 0x83, 0xEE, 0xF0, 0x22, 0x90, 0x90, 0x12, 0x12, 0x47, 0x53, 0xF1, 0x74, 0x90, 0x8E, -0x7C, 0xE0, 0xFF, 0x91, 0x45, 0x90, 0x8E, 0x7C, 0xE0, 0x60, 0x19, 0x90, 0x90, 0x12, 0x12, 0x47, -0x4A, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0x54, 0x0F, 0xFF, 0x90, 0x00, 0x02, 0x12, 0x26, 0x37, -0xFD, 0x12, 0x89, 0xF9, 0x22, 0xAC, 0x07, 0xEF, 0x54, 0x01, 0xFE, 0x90, 0x8E, 0x94, 0xE0, 0x54, -0xFE, 0x4E, 0xF0, 0xEF, 0x90, 0x01, 0x53, 0xB4, 0x01, 0x11, 0xE4, 0xF0, 0x7D, 0x10, 0x7F, 0x03, -0xB1, 0x21, 0x90, 0x8E, 0x96, 0xE0, 0x90, 0x05, 0x73, 0xF0, 0x22, 0x74, 0x03, 0xF0, 0x7D, 0x10, -0xFF, 0xB1, 0x96, 0x02, 0x54, 0xBE, 0x74, 0x65, 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82, 0x25, 0x13, 0xF5, 0x82, 0xE4, 0x35, 0x83, 0xF5, 0x83, 0xE0, 0xFF, 0x74, 0x84, 0x25, -0x13, 0xF5, 0x82, 0xE4, 0x34, 0x90, 0xF5, 0x83, 0xEF, 0xF0, 0x05, 0x13, 0xE5, 0x13, 0xB4, 0x08, -0xD0, 0x7B, 0x01, 0x7A, 0x90, 0x79, 0x82, 0xB1, 0xAE, 0xE5, 0x15, 0x04, 0x54, 0x0F, 0xF5, 0x15, -0xB4, 0x0F, 0x03, 0xE4, 0xF5, 0x15, 0x90, 0x04, 0x7F, 0xE5, 0x15, 0xF0, 0x90, 0x90, 0x81, 0xE0, -0x7F, 0x04, 0x70, 0x02, 0x41, 0xA0, 0x51, 0x80, 0x22, 0xE4, 0x90, 0x90, 0x47, 0xF0, 0x90, 0x06, -0xA9, 0xE0, 0x90, 0x90, 0x47, 0xF0, 0xE0, 0x54, 0xC0, 0x70, 0x0D, 0x90, 0x8E, 0x80, 0xE0, 0x54, -0xFE, 0xF0, 0x54, 0xFD, 0xF0, 0x02, 0x52, 0x4A, 0x90, 0x90, 0x47, 0xE0, 0x30, 0xE6, 0x22, 0x90, -0x8E, 0x7C, 0xE0, 0x64, 0x01, 0x70, 0x21, 0x90, 0x8E, 0x80, 0xE0, 0x44, 0x01, 0xF0, 0x90, 0x8E, -0x7B, 0xE0, 0x54, 0x0F, 0x64, 0x02, 0x60, 0x04, 0x51, 0xD8, 0x80, 0x0C, 0x12, 0x57, 0x39, 0x80, -0x07, 0x90, 0x8E, 0x80, 0xE0, 0x54, 0xFE, 0xF0, 0x90, 0x90, 0x47, 0xE0, 0x90, 0x8E, 0x80, 0x30, -0xE7, 0x0E, 0xE0, 0x44, 0x02, 0x12, 0x5F, 0xE7, 0x90, 0x8E, 0x79, 0xE0, 0x44, 0x04, 0xF0, 0x22, -0xE0, 0x54, 0xFD, 0xF0, 0x22, 0xE0, 0xFF, 0x7D, 0x01, 0xD3, 0x10, 0xAF, 0x01, 0xC3,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90, 0xFD, 0x12, 0x50, 0x04, 0xE4, 0xF0, 0x80, 0x03, -0x74, 0x01, 0xF0, 0x90, 0xFD, 0x10, 0xED, 0xF0, 0xAF, 0x06, 0x22, 0xC0, 0xE0, 0xC0, 0xF0, 0xC0, -0x83, 0xC0, 0x82, 0xC0, 0xD0, 0x75, 0xD0, 0x00, 0xC0, 0x00, 0xC0, 0x01, 0xC0, 0x02, 0xC0, 0x03, -0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0x01, 0xC4, 0x74, 0xDB, 0xF0, 0x74, 0x6F, -0xA3, 0xF0, 0x31, 0x91, 0xE5, 0x69, 0x30, 0xE1, 0x02, 0x11, 0x5F, 0xE5, 0x69, 0x30, 0xE2, 0x02, -0x31, 0x76, 0xE5, 0x6A, 0x30, 0xE0, 0x02, 0x31, 0x2D, 0xE5, 0x6C, 0x30, 0xE1, 0x05, 0x7F, 0x04, -0x12, 0x6A, 0xA0, 0xE5, 0x6C, 0x30, 0xE4, 0x03, 0x12, 0x4F, 0x52, 0xE5, 0x6C, 0x30, 0xE5, 0x02, -0x11, 0x68, 0xE5, 0x6C, 0x30, 0xE6, 0x02, 0x11, 0xEF, 0x74, 0xDB, 0x04, 0x90, 0x01, 0xC4, 0xF0, -0x74, 0x6F, 0xA3, 0xF0, 0xD0, 0x07, 0xD0, 0x06, 0xD0, 0x05, 0xD0, 0x04, 0xD0, 0x03, 0xD0, 0x02, -0xD0, 0x01, 0xD0, 0x00, 0xD0, 0xD0, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xF0, 0xD0, 0xE0, 0x32, 0x90, -0x8E, 0x7C, 0xE0, 0x60, 0x02, 0x51, 0x08, 0x22, 0x90, 0x8E, 0x79, 0xE0, 0xFF, 0xC4, 0x13, 0x13, -0x54, 0x03, 0x30, 0xE0, 0x27, 0xEF, 0x54, 0xBF, 0xF0, 0x90, 0x04, 0xE0, 0xE0, 0x90, 0x8E, 0x7A, -0x30, 0xE0, 0x06, 0xE0, 0x44, 0x01, 0xF0, 0x80, 0x10, 0xE0, 0x54, 0xFE, 0xF0, 0x90, 0x01, 0xB9, -0x74, 0x01, 0xF0, 0x90, 0x01, 0xB8, 0x74, 0x04, 0xF0, 0x12, 0x52, 0x4A, 0xE4, 0xFF, 0x90, 0x90, -0x03, 0xE0, 0x30, 0xE0, 0x49, 0x90, 0x90, 0x07, 0xE0, 0xFD, 0x60, 0x42, 0x74, 0x01, 0x7E, 0x00, -0xA8, 0x07, 0x08, 0x80, 0x05, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, 0xF9, 0xFF, 0x90, 0x04, 0xE0, -0xE0, 0xFB, 0xEF, 0x5B, 0x60, 0x06, 0xE4, 0x90, 0x90, 0x07, 0xF0, 0x22, 0x90, 0x90, 0x05, 0xE0, -0xD3, 0x9D, 0x50, 0x11, 0x90, 0x01, 0xC7, 0x74, 0x10, 0xF0, 0x12, 0x5E, 0x52, 0x90, 0x90, 0x03, -0xE0, 0x54, 0xFE, 0xF0, 0x22, 0x12, 0x57, 0xE1, 0x90, 0x90, 0x07, 0xE0, 0x04, 0xF0, 0x22, 0x90, -0x8E, 0x79, 0xE0, 0xFF, 0xC4, 0x13, 0x13, 0x13, 0x54, 0x01, 0x30, 0xE0, 0x2C, 0xEF, 0x54, 0x7F, -0xF0, 0x90, 0x04, 0xE0, 0xE0, 0x90, 0x8E, 0x7A, 0x30, 0xE1, 0x06, 0xE0, 0x44, 0x02, 0xF0, 0x80, -0x0F, 0xE0, 0x54, 0xFD, 0xF0, 0x90, 0x01, 0xB9, 0x74, 0x01, 0xF0, 0x90, 0x01, 0xB8, 0x04, 0xF0, -0x90, 0x8E, 0x7C, 0xE0, 0x60, 0x03, 0x12, 0x52, 0x4A, 0x7F, 0x01, 0x01, 0x9E, 0x31, 0xC1, 0x90, -0x90, 0x58, 0xEF, 0xF0, 0x90, 0x8E, 0x79, 0x30, 0xE0, 0x06, 0xE0, 0x44, 0x01, 0xF0, 0x80, 0x04, -0xE0, 0x54, 0xFE, 0xF0, 0x90, 0x90, 0x58, 0xE0, 0x30, 0xE6, 0x11, 0x90, 0x01, 0x2F, 0xE0, 0x30, -0xE7, 0x04, 0xE4, 0xF0, 0x80, 0x06, 0x90, 0x01, 0x2F, 0x74, 0x80, 0xF0, 0x90, 0x8E, 0x79, 0xE0, -0x30, 0xE0, 0x12, 0x90, 0x8E, 0x87, 0xE4, 0xF0, 0xA3, 0x74, 0x04, 0xF0, 0x90, 0x8E, 0x87, 0xA3, -0xE0, 0x90, 0x05, 0x58, 0xF0, 0x22, 0x90, 0x8E, 0x7C, 0xE0, 0x60, 0x14, 0x90, 0x06, 0x92, 0xE0, -0x30, 0xE1, 0x03, 0x02, 0x57, 0x4E, 0x90, 0x8E, 0x79, 0xE0, 0x54, 0xF7, 0xF0, 0x12, 0x52, 0x4A, -0x22, 0x90, 0x01, 0x3C, 0xE0, 0x55, 0x65, 0xF5, 0x69, 0xA3, 0xE0, 0x55, 0x66, 0xF5, 0x6A, 0xA3, -0xE0, 0x55, 0x67, 0xF5, 0x6B, 0xA3, 0xE0, 0x55, 0x68, 0xF5, 0x6C, 0x90, 0x01, 0x3C, 0xE5, 0x69, -0xF0, 0xA3, 0xE5, 0x6A, 0xF0, 0xA3, 0xE5, 0x6B, 0xF0, 0xA3, 0xE5, 0x6C, 0xF0, 0x53, 0x91, 0xDF, -0x22, 0xE4, 0x90, 0x90, 0x59, 0xF0, 0xA3, 0xF0, 0xA3, 0xF0, 0x90, 0x00, 0x83, 0xE0, 0x90, 0x90, -0x59, 0xF0, 0x90, 0x00, 0x83, 0xE0, 0xFE, 0x90, 0x90, 0x59, 0xE0, 0xFF, 0xB5, 0x06, 0x01, 0x22, -0xC3, 0x90, 0x90, 0x5B, 0xE0, 0x94, 0x64, 0x90, 0x90, 0x5A, 0xE0, 0x94, 0x00, 0x40, 0x0D, 0x90, -0x01, 0xC0, 0xE0, 0x44, 0x40, 0xF0, 0x90, 0x90, 0x59, 0x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, 0x02, 0x09, 0xE0, 0xFD, 0x12, 0x26, 0x1E, 0xFE, 0xAF, 0x05, 0xED, 0x2E, 0x90, -0x8D, 0x06, 0xF0, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0xFF, 0xED, 0x2F, 0x90, 0x8D, 0x07, 0xF0, -0x90, 0x00, 0x02, 0x12, 0x26, 0x37, 0xFF, 0xED, 0x2F, 0x90, 0x8D, 0x08, 0xF0, 0x90, 0x00, 0x03, -0x12, 0x26, 0x37, 0xFF, 0xED, 0x2F, 0x90, 0x8D, 0x09, 0xF0, 0x90, 0x00, 0x04, 0x12, 0x26, 0x37, -0xFF, 0xAE, 0x05, 0xED, 0x2F, 0x90, 0x8D, 0x0A, 0xF0, 0x22, 0x90, 0x90, 0x0F, 0x12, 0x47, 0x53, -0xEF, 0x12, 0x47, 0x5C, 0x73, 0x3E, 0x00, 0x73, 0x46, 0x01, 0x73, 0x4E, 0x02, 0x73, 0x56, 0x03, -0x73, 0x5F, 0x04, 0x73, 0x67, 0x12, 0x73, 0x6F, 0x13, 0x73, 0x77, 0x14, 0x73, 0x7F, 0x20, 0x73, -0x88, 0x21, 0x73, 0x91, 0x23, 0x73, 0x99, 0x25, 0x73, 0xA1, 0x27, 0x73, 0xB3, 0x80, 0x73, 0xAA, -0x81, 0x73, 0xBB, 0x82, 0x73, 0xC4, 0x83, 0x73, 0xCD, 0x84, 0x00, 0x00, 0x73, 0xD6, 0x90, 0x90, -0x0F, 0x12, 0x47, 0x4A, 0x41, 0xB2, 0x90, 0x90, 0x0F, 0x12, 0x47, 0x4A, 0xA1, 0xF9, 0x90, 0x90, -0x0F, 0x12, 0x47, 0x4A, 0xE1, 0xCA, 0x90, 0x90, 0x0F, 0x12, 0x47, 0x4A, 0x02, 0x83, 0x12, 0x90, -0x90, 0x0F, 0x12, 0x47, 0x4A, 0x61, 0xF2, 0x90, 0x90, 0x0F, 0x12, 0x47, 0x4A, 0x80, 0x6F, 0x90, -0x90, 0x0F, 0x12, 0x47, 0x4A, 0x81, 0x82, 0x90, 0x90, 0x0F, 0x12, 0x47, 0x4A, 0xE1, 0x61, 0x90, -0x90, 0x0F, 0x12, 0x47, 0x4A, 0x02, 0x78, 0x02, 0x90, 0x90, 0x0F, 0x12, 0x47, 0x4A, 0x02, 0x78, -0x8E, 0x90, 0x90, 0x0F, 0x12, 0x47, 0x4A, 0xE1, 0x59, 0x90, 0x90, 0x0F, 0x12, 0x47, 0x4A, 0xE1, -0x70, 0x90, 0x90, 0x0F, 0x12, 0x47, 0x4A, 0x02, 0x78, 0xD4, 0x90, 0x90, 0x0F, 0x12, 0x47, 0x4A, -0x02, 0x86, 0x71, 0x90, 0x90, 0x0F, 0x12, 0x47, 0x4A, 0xC1, 0x9A, 0x90, 0x90, 0x0F, 0x12, 0x47, -0x4A, 0x02, 0x87, 0x48, 0x90, 0x90, 0x0F, 0x12, 0x47, 0x4A, 0x02, 0x87, 0x62, 0x90, 0x90, 0x0F, -0x12, 0x47, 0x4A, 0x02, 0x87, 0xB7, 0x90, 0x01, 0xC0, 0xE0, 0x44, 0x01, 0xF0, 0x22, 0x12, 0x26, -0x1E, 0xFF, 0x90, 0x8D, 0xF7, 0xF0, 0xBF, 0x01, 0x08, 0x12, 0x7C, 0x54, 0xE4, 0x90, 0x8D, 0xF7, -0xF0, 0x22, 0xF1, 0xB5, 0x12, 0x26, 0x1E, 0xFF, 0x54, 0x01, 0xFE, 0x90, 0x90, 0x03, 0xE0, 0x54, -0xFE, 0x4E, 0xF0, 0xEF, 0xC3, 0x13, 0x30, 0xE0, 0x14, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0x90, -0x90, 0x04, 0xF0, 0x90, 0x00, 0x02, 0x12, 0x26, 0x37, 0x90, 0x90, 0x05, 0xF0, 0x22, 0xD3, 0x10, -0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x8D, 0x5C, 0xE0, 0xFF, 0x90, 0x8D, 0x5B, 0xE0, 0xB5, 0x07, -0x04, 0x7F, 0x01, 0x80, 0x02, 0x7F, 0x00, 0xEF, 0x70, 0x43, 0x90, 0x8D, 0x5B, 0xE0, 0xFE, 0x75, -0xF0, 0x08, 0x90, 0x8D, 0x0B, 0x12, 0x47, 0x3E, 0xE0, 0xFD, 0xEE, 0x75, 0xF0, 0x08, 0xA4, 0x24, -0x0C, 0xF9, 0x74, 0x8D, 0x35, 0xF0, 0xFA, 0x7B, 0x01, 0xAF, 0x05, 0x51, 0xFA, 0x90, 0x8D, 0x5B, -0xE0, 0x04, 0xF0, 0xE0, 0x7F, 0x00, 0xB4, 0x0A, 0x02, 0x7F, 0x01, 0xEF, 0x60, 0x05, 0xE4, 0x90, -0x8D, 0x5B, 0xF0, 0x12, 0x79, 0x08, 0x90, 0x8D, 0x01, 0xE0, 0x44, 0x02, 0xF0, 0xD0, 0xD0, 0x92, -0xAF, 0x22, 0x12, 0x26, 0x1E, 0xFF, 0x54, 0x80, 0xFE, 0x90, 0x90, 0x09, 0xE0, 0x54, 0x7F, 0x4E, -0xFE, 0xF0, 0xEF, 0x54, 0x40, 0xFF, 0xEE, 0x54, 0xBF, 0x4F, 0xFF, 0xF0, 0x12, 0x26, 0x1E, 0xFE, -0x54, 0x20, 0xFD, 0xEF, 0x54, 0xDF, 0x4D, 0xFF, 0x90, 0x90, 0x09, 0xF0, 0xEE, 0x54, 0x10, 0xFE, -0xEF, 0x54, 0xEF, 0x4E, 0xFF, 0xF0, 0x12, 0x26, 0x1E, 0x54, 0x0F, 0xFE, 0xEF, 0x54, 0xF0, 0x4E, -0x90, 0x90, 0x09, 0xF0, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0x90, 0x90, 0x0A, 0xF0, 0x90, 0x00, -0x02, 0x12, 0x26, 0x37, 0x90, 0x90, 0x0B, 0xF0, 0x90, 0x90, 0x09, 0xE0, 0xFE, 0x54, 0x0F, 0xFF, -0xEE, 0xC4, 0x13, 0x13, 0x54, 0x03, 0x7D, 0x00, 0x20, 0xE0, 0x02, 0x7D, 0x01, 0xD3, 0x10, 0xAF, -0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x91, 0x0C, 0xED, 0xF0, 0x90, 0x91, 0x0B, 0xEF, 0xF0, 0xD3, 0x94, -0x07, 0x50, 0x70, 0xE0, 0xFF, 0x74, 0x01, 0xA8, 0x07, 0x08, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, -0xF4, 0xFF, 0x90, 0x00, 0x47, 0xE0, 0x5F, 0xFD, 0x7F, 0x47, 0x12, 0x3A, 0x96, 0x90, 0x91, 0x0B, -0xE0, 0xFF, 0x74, 0x01, 0xA8, 0x07, 0x08, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0xFF, 0x90, 0x00, -0x46, 0xE0, 0x4F, 0xFD, 0x7F, 0x46, 0x12, 0x3A, 0x96, 0x90, 0x91, 0x0C, 0xE0, 0x60, 0x18, 0x90, -0x91, 0x0B, 0xE0, 0xFF, 0x74, 0x01, 0xA8, 0x07, 0x08, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0xFF, -0x90, 0x00, 0x45, 0xE0, 0x4F, 0x80, 0x17, 0x90, 0x91, 0x0B, 0xE0, 0xFF, 0x74, 0x01, 0xA8, 0x07, -0x08, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0xF4, 0xFF, 0x90, 0x00, 0x45, 0xE0, 0x5F, 0xFD, 0x7F, -0x45, 0x80, 0x7E, 0x90, 0x91, 0x0B, 0xE0, 0x24, 0xF8, 0xF0, 0xE0, 0x24, 0x04, 0xFF, 0x74, 0x01, -0xA8, 0x07, 0x08, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0xF4, 0xFF, 0x90, 0x00, 0x43, 0xE0, 0x5F, -0xFD, 0x7F, 0x43, 0x12, 0x3A, 0x96, 0x90, 0x91, 0x0B, 0xE0, 0xFF, 0x74, 0x01, 0xA8, 0x07, 0x08, -0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0xFF, 0x90, 0x00, 0x43, 0xE0, 0x4F, 0xFD, 0x7F, 0x43, 0x12, -0x3A, 0x96, 0x90, 0x91, 0x0C, 0xE0, 0x60, 0x1D, 0x90, 0x91, 0x0B, 0xE0, 0x24, 0x04, 0xFF, 0x74, -0x01, 0xA8, 0x07, 0x08, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0xFF, 0x90, 0x00, 0x42, 0xE0, 0x4F, -0xFD, 0x7F, 0x42, 0x80, 0x1C, 0x90, 0x91, 0x0B, 0xE0, 0x24, 0x04, 0xFF, 0x74, 0x01, 0xA8, 0x07, -0x08, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0xF4, 0xFF, 0x90, 0x00, 0x42, 0xE0, 0x5F, 0xFD, 0x7F, -0x42, 0x12, 0x3A, 0x96, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0x90, 0x12, 0x12, 0x47, 0x53, 0x90, -0x00, 0x01, 0x12, 0x26, 0x37, 0xFF, 0xFE, 0x12, 0x26, 0x1E, 0xFD, 0xC3, 0x13, 0x30, 0xE0, 0x12, -0x90, 0x90, 0x12, 0x12, 0x47, 0x4A, 0x90, 0x00, 0x02, 0x12, 0x26, 0x37, 0x90, 0x90, 0x16, 0xF0, -0x80, 0x05, 0x90, 0x90, 0x16, 0xEF, 0xF0, 0x90, 0x90, 0x15, 0xEE, 0xF0, 0x90, 0x90, 0x16, 0xE0, -0xFE, 0x90, 0x90, 0x15, 0xE0, 0xFF, 0xD3, 0x9E, 0x50, 0x38, 0x90, 0x90, 0x12, 0x12, 0x47, 0x4A, -0x12, 0x26, 0x1E, 0x54, 0x01, 0xFE, 0x74, 0xF8, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x8D, 0xF5, 0x83, -0xEE, 0xF0, 0x74, 0xF8, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x8D, 0xF5, 0x83, 0xE0, 0x70, 0x04, 0xF1, -0x91, 0x80, 0x07, 0x90, 0x90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 0x8E, 0x9A, -0xE0, 0x54, 0x7F, 0x4F, 0xF0, 0xEE, 0x13, 0x13, 0x54, 0x3F, 0x30, 0xE0, 0x07, 0x90, 0x06, 0x90, -0xE0, 0x44, 0x04, 0xF0, 0x12, 0x26, 0x1E, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x30, 0xE0, 0x07, 0x90, -0x06, 0x90, 0xE0, 0x44, 0x08, 0xF0, 0x90, 0x8D, 0x05, 0xE0, 0xB4, 0x01, 0x07, 0x90, 0xFE, 0x10, -0xE0, 0x44, 0x04, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x12, 0x26, 0x1E, 0x90, 0x8E, 0x86, 0xF0, -0x22, 0x12, 0x26, 0x1E, 0x54, 0x01, 0xFF, 0x90, 0x90, 0x0C, 0xE0, 0x54, 0xFE, 0x4F, 0xF0, 0x22, -0x12, 0x26, 0x1E, 0x90, 0x8E, 0x93, 0xF0, 0x90, 0x8E, 0x93, 0xE0, 0x90, 0x01, 0xE7, 0xF0, 0x22, -0x8F, 0x20, 0x75, 0xF0, 0x10, 0xEF, 0x90, 0x81, 0x05, 0x12, 0x47, 0x3E, 0xE0, 0x54, 0xFB, 0xF0, -0x22, 0x8F, 0x20, 0x75, 0xF0, 0x10, 0xEF, 0x90, 0x81, 0x05, 0x12, 0x47, 0x3E, 0xE0, 0x44, 0x04, -0xF0, 0x22, 0x90, 0x06, 0x04, 0xE0, 0x54, 0x7F, 0xF0, 0x90, 0x05, 0x22, 0xE4, 0xF0, 0x90, 0x8E, -0x7F, 0x74, 0x0C, 0xF0, 0x22, 0x90, 0x90, 0x03, 0xE0, 0x54, 0xFE, 0xF0, 0xA3, 0x74, 0x03, 0xF0, -0xA3, 0xF0, 0xE4, 0xA3, 0xF0, 0xA3, 0xF0, 0xA3, 0xF0, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, -0xD0, 0x12, 0x26, 0x1E, 0xFF, 0x90, 0x8E, 0x78, 0xF0, 0xBF, 0x01, 0x12, 0x90, 0x00, 0x01, 0x12, -0x26, 0x37, 0x64, 0x01, 0x60, 0x17, 0x90, 0x05, 0x22, 0x74, 0x6F, 0xF0, 0x80, 0x0F, 0x90, 0x00, -0x01, 0x12, 0x26, 0x37, 0x64, 0x01, 0x60, 0x05, 0x90, 0x05, 0x22, 0xE4, 0xF0, 0xD0, 0xD0, 0x92, -0xAF, 0x22, 0x12, 0x26, 0x1E, 0xFF, 0x54, 0x7F, 0x90, 0x8E, 0x7C, 0xF0, 0xEF, 0xC4, 0x13, 0x13, -0x13, 0x54, 0x01, 0xA3, 0xF0, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0xFF, 0x54, 0xF0, 0xC4, 0x54, -0x0F, 0xFE, 0x90, 0x8E, 0x7B, 0xE0, 0x54, 0xF0, 0x4E, 0xF0, 0x90, 0x00, 0x03, 0x12, 0x26, 0x37, -0x54, 0x01, 0x25, 0xE0, 0xFE, 0x90, 0x8E, 0x79, 0xE0, 0x54, 0xFD, 0x4E, 0xF0, 0x90, 0x8E, 0x98, -0xE0, 0x30, 0xE0, 0x09, 0x90, 0x8E, 0x7B, 0xE0, 0x54, 0x0F, 0xF0, 0x80, 0x0F, 0xEF, 0x54, 0x0F, -0xC4, 0x54, 0xF0, 0xFF, 0x90, 0x8E, 0x7B, 0xE0, 0x54, 0x0F, 0x4F, 0xF0, 0x90, 0x00, 0x04, 0x12, -0x26, 0x37, 0x90, 0x8E, 0x7E, 0xF0, 0x12, 0x6D, 0x36, 0x90, 0x01, 0xB9, 0x74, 0x01, 0xF0, 0x90, -0x01, 0xB8, 0xF0, 0x90, 0x8E, 0x7C, 0xE0, 0x90, 0x01, 0xBA, 0xF0, 0x90, 0x8E, 0x7E, 0xE0, 0x90, -0x01, 0xBB, 0xF0, 0x90, 0x8E, 0x7B, 0xE0, 0x54, 0x0F, 0x90, 0x01, 0xBE, 0xF0, 0x22, 0x90, 0x00, -0x02, 0x12, 0x26, 0x37, 0xFF, 0x30, 0xE0, 0x26, 0x12, 0x26, 0x1E, 0x90, 0x8E, 0x8D, 0xF0, 0x90, -0x00, 0x01, 0x12, 0x26, 0x37, 0x90, 0x8E, 0x8E, 0xF0, 0xEF, 0x54, 0xFE, 0xFF, 0xA3, 0xE0, 0x54, -0x01, 0x4F, 0xF0, 0x90, 0x00, 0x03, 0x12, 0x26, 0x37, 0x90, 0x8E, 0x90, 0xF0, 0x22, 0x90, 0x8E, -0x8D, 0x74, 0x01, 0xF0, 0xA3, 0x74, 0x05, 0xF0, 0xA3, 0xE0, 0x54, 0x01, 0x44, 0x28, 0xF0, 0xA3, -0x74, 0x05, 0xF0, 0x22, 0x12, 0x26, 0x1E, 0x54, 0x01, 0xFF, 0x90, 0x8E, 0x94, 0xE0, 0x54, 0xFE, -0x4F, 0xF0, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0x90, 0x8E, 0x95, 0xF0, 0x90, 0x00, 0x02, 0x12, -0x26, 0x37, 0x90, 0x8E, 0x96, 0xF0, 0x90, 0x8E, 0x95, 0xE0, 0x90, 0x8E, 0x97, 0xF0, 0x90, 0x8E, -0x94, 0xE0, 0x54, 0x01, 0xFF, 0x02, 0x6D, 0x65, 0x90, 0x01, 0xCC, 0xE0, 0x54, 0x0F, 0x90, 0x90, -0xFB, 0xF0, 0x90, 0x90, 0xFB, 0xE0, 0xFD, 0x70, 0x02, 0x41, 0x45, 0x90, 0x8D, 0x5B, 0xE0, 0xFF, -0x70, 0x06, 0xA3, 0xE0, 0x64, 0x09, 0x60, 0x0A, 0xEF, 0x14, 0xFF, 0x90, 0x8D, 0x5C, 0xE0, 0xB5, -0x07, 0x04, 0x7F, 0x01, 0x80, 0x02, 0x7F, 0x00, 0xEF, 0x60, 0x08, 0x90, 0x01, 0xC1, 0xE0, 0x44, -0x01, 0xF0, 0x22, 0x90, 0x90, 0xEC, 0xE0, 0xFF, 0x74, 0x01, 0x7E, 0x00, 0xA8, 0x07, 0x08, 0x80, -0x05, 0xC3, 0x33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C0, 0xD0, 0x90, -0x90, 0xEF, 0x12, 0x47, 0x53, 0x90, 0x90, 0xEE, 0xE0, 0xFF, 0x04, 0xF0, 0x90, 0x00, 0x01, 0xEF, -0x12, 0x26, 0x76, 0x7F, 0xAF, 0x7E, 0x01, 0x51, 0x54, 0xEF, 0x60, 0x3A, 0x90, 0x90, 0xEF, 0x12, -0x47, 0x4A, 0x8B, 0x40, 0x8A, 0x41, 0x89, 0x42, 0x90, 0x00, 0x0E, 0x12, 0x26, 0x37, 0x24, 0x02, -0xF5, 0x43, 0x7B, 0x01, 0x7A, 0x01, 0x79, 0xA0, 0x12, 0x34, 0x2C, 0x90, 0x90, 0xEF, 0x12, 0x47, -0x4A, 0x90, 0x00, 0x0E, 0x12, 0x26, 0x37, 0x90, 0x01, 0xAE, 0xF0, 0xA3, 0x74, 0xFF, 0xF0, 0x90, -0x01, 0xCB, 0xE0, 0x64, 0x80, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0x90, 0xDC, 0xEF, 0xF0, -0xA3, 0x12, 0x47, 0x53, 0x90, 0x90, 0xED, 0xE0, 0xFE, 0x04, 0xF0, 0x90, 0x00, 0x01, 0xEE, 0x12, -0x26, 0x76, 0x74, 0x00, 0x2F, 0xF9, 0xE4, 0x34, 0xFB, 0xFA, 0x7B, 0x01, 0xC0, 0x03, 0xC0, 0x02, -0xC0, 0x01, 0x90, 0x90, 0xDD, 0x12, 0x47, 0x4A, 0x8B, 0x40, 0x8A, 0x41, 0x89, 0x42, 0x75, 0x43, -0x02, 0xD0, 0x01, 0xD0, 0x02, 0xD0, 0x03, 0x12, 0x34, 0x2C, 0x90, 0x90, 0xDC, 0xE0, 0x24, 0x02, -0xF9, 0xE4, 0x34, 0xFB, 0xFA, 0x7B, 0x01, 0xC0, 0x03, 0xC0, 0x02, 0xC0, 0x01, 0xA3, 0x12, 0x47, -0x4A, 0xE9, 0x24, 0x02, 0xF9, 0xE4, 0x3A, 0x8B, 0x40, 0xF5, 0x41, 0x89, 0x42, 0x90, 0x90, 0xDD, -0x12, 0x47, 0x4A, 0x90, 0x00, 0x0E, 0x12, 0x26, 0x37, 0xF5, 0x43, 0xD0, 0x01, 0xD0, 0x02, 0xD0, -0x03, 0x02, 0x34, 0x2C, 0x7B, 0x01, 0x7A, 0x90, 0x79, 0x12, 0x7F, 0xF5, 0x7E, 0x03, 0x12, 0x33, -0xC7, 0xBF, 0x01, 0x06, 0x90, 0x90, 0x12, 0xE0, 0xA3, 0xF0, 0x7B, 0x01, 0x7A, 0x90, 0x79, 0x12, -0x7F, 0xF6, 0x7E, 0x03, 0x12, 0x33, 0xC7, 0xBF, 0x01, 0x08, 0x90, 0x90, 0x12, 0xE0, 0x90, 0x90, -0x14, 0xF0, 0x7B, 0x01, 0x7A, 0x90, 0x79, 0x12, 0x7F, 0xF4, 0x7E, 0x03, 0x12, 0x33, 0xC7, 0xBF, -0x01, 0x08, 0x90, 0x90, 0x12, 0xE0, 0x90, 0x90, 0x15, 0xF0, 0x7B, 0x01, 0x7A, 0x90, 0x79, 0x12, -0x7F, 0xF3, 0x7E, 0x03, 0x12, 0x33, 0xC7, 0xBF, 0x01, 0x08, 0x90, 0x90, 0x12, 0xE0, 0x90, 0x90, -0x16, 0xF0, 0x7B, 0x01, 0x7A, 0x90, 0x79, 0x12, 0x7F, 0xF2, 0x7E, 0x03, 0x12, 0x33, 0xC7, 0xBF, -0x01, 0x08, 0x90, 0x90, 0x12, 0xE0, 0x90, 0x90, 0x17, 0xF0, 0x90, 0x90, 0x13, 0xE0, 0xFF, 0xA3, -0xE0, 0xFD, 0xA3, 0xE0, 0xFB, 0xA3, 0xE0, 0x90, 0x90, 0x1B, 0xF0, 0x90, 0x90, 0x17, 0xE0, 0x90, -0x90, 0x1C, 0xF0, 0x02, 0x6A, 0xF2, 0x90, 0x90, 0xF2, 0x12, 0x47, 0x53, 0xE4, 0xFF, 0x90, 0x90, -0xF2, 0x12, 0x47, 0x4A, 0x8F, 0x82, 0x75, 0x83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BE, 0x02, 0x02, 0x74, 0xFF, +0xFD, 0x18, 0xE6, 0xCD, 0xF8, 0xE5, 0x81, 0x6D, 0x60, 0x06, 0xD0, 0xE0, 0xF6, 0x18, 0x80, 0xF5, +0xE5, 0x0C, 0x24, 0x86, 0xC8, 0xF6, 0x15, 0x0C, 0x80, 0xD3, 0xE5, 0x0C, 0x23, 0x24, 0x81, 0xF8, +0x7F, 0x04, 0xC2, 0xAF, 0xE6, 0x30, 0xE0, 0x03, 0x10, 0xE2, 0x0C, 0x7F, 0x00, 0x30, 0xE1, 0x07, +0x30, 0xE3, 0x04, 0x7F, 0x08, 0x54, 0xF4, 0x54, 0x7C, 0xC6, 0xD2, 0xAF, 0x54, 0x80, 0x42, 0x07, +0x22, 0x78, 0x86, 0xA6, 0x81, 0x74, 0x02, 0x60, 0x06, 0xFF, 0x08, 0x76, 0xFF, 0xDF, 0xFB, 0x7F, +0x03, 0xE4, 0x78, 0x80, 0xF6, 0x08, 0xF6, 0x08, 0xDF, 0xFA, 0x78, 0x81, 0x76, 0x30, 0x90, 0x4C, +0xA1, 0x74, 0x01, 0x93, 0xC0, 0xE0, 0xE4, 0x93, 0xC0, 0xE0, 0x43, 0x89, 0x01, 0x75, 0x8A, 0x60, +0x75, 0x8C, 0x79, 0xD2, 0x8C, 0xD2, 0xAF, 0x22, 0x02, 0xEF, 0xD3, 0x94, 0x02, 0x40, 0x03, 0x7F, +0xFF, 0x22, 0x74, 0x81, 0x2F, 0x2F, 0xF8, 0xE6, 0x20, 0xE5, 0xF4, 0xC2, 0xAF, 0xE6, 0x44, 0x30, +0xF6, 0xD2, 0xAF, 0xAE, 0x0C, 0xEE, 0xC3, 0x9F, 0x50, 0x21, 0x0E, 0x74, 0x86, 0x2E, 0xF8, 0xE6, +0xF9, 0x08, 0xE6, 0x18, 0xBE, 0x02, 0x02, 0x74, 0xFF, 0xFD, 0xED, 0x69, 0x60, 0x09, 0x09, 0xE7, +0x19, 0x19, 0xF7, 0x09, 0x09, 0x80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xA3, 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, 0x4C, 0x90, 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, +0x41, 0x92, 0xBF, 0x00, 0x41, 0x92, 0xC0, 0x00, 0x41, 0x92, 0xD4, 0x00, 0x41, 0x92, 0xD8, 0x00, +0x00, 0x50, 0x00, 0x57, 0xFD, 0x5F, 0xF6, 0x90, 0x00, 0xF0, 0xE0, 0x7F, 0x01, 0x20, 0xE2, 0x02, +0x7F, 0x03, 0x22, 0x91, 0xA7, 0x90, 0x8D, 0x07, 0xEF, 0xF0, 0x91, 0xC5, 0x90, 0x01, 0x64, 0x74, +0x01, 0xF0, 0x02, 0x35, 0x95, 0x91, 0xEA, 0xB1, 0xF3, 0x12, 0x8F, 0x69, 0x12, 0x8F, 0x88, 0x12, +0x8F, 0x43, 0xE4, 0xF5, 0x51, 0x75, 0x52, 0x58, 0xAB, 0x51, 0x7D, 0x02, 0x7F, 0x01, 0x12, 0x39, +0x04, 0xAB, 0x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 0xFF, 0x7B, 0x01, 0x7A, +0x91, 0x79, 0x54, 0x12, 0x26, 0x1E, 0x90, 0x06, 0x74, 0xD1, 0xCD, 0x90, 0x06, 0x75, 0xF1, 0xF0, +0x90, 0x06, 0x76, 0xF1, 0xAD, 0x90, 0x06, 0x77, 0xF0, 0x90, 0x06, 0x70, 0xEF, 0xF0, 0xA3, 0xE4, +0xF0, 0xA3, 0x04, 0xF0, 0xA3, 0x74, 0x80, 0xF0, 0x7F, 0x01, 0x7E, 0x00, 0x02, 0x3A, 0xF7, 0xF9, +0xE4, 0x3A, 0x8B, 0x40, 0xF5, 0x41, 0x89, 0x42, 0x75, 0x43, 0x04, 0x7B, 0x01, 0x7A, 0x91, 0x79, +0x54, 0x12, 0x34, 0x2C, 0x90, 0x91, 0x50, 0xE0, 0x75, 0xF0, 0x08, 0xA4, 0x22, 0x90, 0x91, 0x51, +0x02, 0x47, 0x56, 0x90, 0x01, 0x34, 0x74, 0xFF, 0xB1, 0x12, 0x90, 0x01, 0x3C, 0xB1, 0x12, 0xFD, +0x7F, 0x54, 0x12, 0x3A, 0x96, 0x7D, 0xFF, 0x7F, 0x55, 0x12, 0x3A, 0x96, 0x7D, 0xFF, 0x7F, 0x56, +0x12, 0x3A, 0x96, 0x7D, 0xFF, 0x7F, 0x57, 0x02, 0x3A, 0x96, 0x7E, 0x00, 0x7F, 0x25, 0x7D, 0x00, +0x7B, 0x01, 0x7A, 0x8E, 0x79, 0xC5, 0x31, 0x38, 0x90, 0x06, 0x90, 0xE0, 0x44, 0x20, 0xF0, 0x12, +0x8F, 0x30, 0xB1, 0x1A, 0x90, 0x8D, 0x07, 0xE0, 0xFF, 0x64, 0x02, 0x70, 0x29, 0xD1, 0xC5, 0x30, +0xE0, 0x02, 0x7E, 0x01, 0x90, 0x8E, 0xE4, 0xD1, 0xC3, 0x30, 0xE1, 0x02, 0x7E, 0x01, 0x90, 0x8E, +0xE2, 0xD1, 0xC3, 0x30, 0xE2, 0x02, 0x7E, 0x01, 0x90, 0x8E, 0xE3, 0xEE, 0xF0, 0x90, 0xFD, 0x80, +0xE0, 0x90, 0x02, 0xFB, 0xF0, 0x22, 0xEF, 0x64, 0x01, 0x70, 0x1D, 0xD1, 0xBC, 0x30, 0xE0, 0x02, +0x7F, 0x01, 0x90, 0x8E, 0xE4, 0xD1, 0xBA, 0x30, 0xE1, 0x02, 0x7F, 0x01, 0x90, 0x8E, 0xE2, 0xD1, +0xBA, 0x30, 0xE2, 0x02, 0x7F, 0x01, 0x80, 0x23, 0x90, 0x8D, 0x07, 0xE0, 0x64, 0x03, 0x70, 0x20, +0xD1, 0xB3, 0x30, 0xE0, 0x02, 0x7F, 0x01, 0x90, 0x8E, 0xE4, 0xD1, 0xB1, 0x30, 0xE1, 0x02, 0x7F, +0x01, 0x90, 0x8E, 0xE2, 0xD1, 0xB1, 0x30, 0xE2, 0x02, 0x7F, 0x01, 0x90, 0x8E, 0xE3, 0xEF, 0xF0, +0x22, 0xEF, 0xF0, 0x90, 0xFD, 0x78, 0xE0, 0x7F, 0x00, 0x22, 0xEF, 0xF0, 0x90, 0xFD, 0x70, 0xE0, +0x7F, 0x00, 0x22, 0xEE, 0xF0, 0x90, 0xFD, 0x80, 0xE0, 0x7E, 0x00, 0x22, 0x4E, 0xF0, 0x90, 0x00, +0x01, 0x02, 0x26, 0x37, 0x90, 0x92, 0x5D, 0x12, 0x47, 0x5F, 0x12, 0x26, 0x1E, 0x90, 0x92, 0x62, +0xD1, 0xCD, 0x90, 0x92, 0x63, 0x12, 0x80, 0x4C, 0x90, 0x92, 0x64, 0x12, 0x81, 0xD0, 0x90, 0x92, +0x65, 0x12, 0x81, 0x4F, 0x90, 0x92, 0x66, 0xF0, 0x90, 0x00, 0x07, 0x12, 0x26, 0x37, 0x90, 0x92, +0x67, 0xF1, 0xAD, 0x90, 0x92, 0x6A, 0xF0, 0xED, 0x70, 0x19, 0xFF, 0xF1, 0xA2, 0xE0, 0xB4, 0xFF, +0x06, 0xF1, 0xA2, 0xE4, 0xF0, 0x80, 0x07, 0xF1, 0xA2, 0xE0, 0x04, 0xF0, 0x80, 0x05, 0x0F, 0xEF, +0xB4, 0x06, 0xE8, 0x90, 0x92, 0x61, 0xE0, 0xFF, 0xB4, 0x04, 0x14, 0xA3, 0xE0, 0xFE, 0xF1, 0x9C, +0xEE, 0xF1, 0xB4, 0xFE, 0xF1, 0x9C, 0x12, 0x8D, 0xEF, 0x90, 0x00, 0x02, 0xE4, 0x80, 0x21, 0xEF, +0xB4, 0x02, 0x20, 0x90, 0x92, 0x63, 0xE0, 0xF1, 0x9B, 0xEF, 0xF1, 0xB4, 0x44, 0x20, 0x54, 0x7F, +0xF1, 0x9B, 0x90, 0x00, 0x01, 0xEF, 0x12, 0x26, 0x76, 0x90, 0x92, 0x62, 0xE0, 0x90, 0x00, 0x02, +0x12, 0x26, 0x76, 0xF1, 0x9C, 0xE9, 0x24, 0x03, 0x12, 0x9D, 0xF8, 0x44, 0x20, 0x12, 0x26, 0x64, +0x90, 0x92, 0x64, 0xE0, 0xF1, 0x9B, 0x90, 0x00, 0x04, 0xEF, 0x12, 0x26, 0x76, 0x90, 0x92, 0x65, +0xE0, 0x90, 0x00, 0x05, 0x12, 0x26, 0x76, 0x90, 0x92, 0x66, 0xE0, 0x90, 0x00, 0x06, 0x12, 0x26, +0x76, 0x90, 0x92, 0x67, 0xE0, 0x90, 0x00, 0x07, 0x02, 0x26, 0x76, 0xFF, 0x90, 0x92, 0x5D, 0x02, +0x47, 0x56, 0x74, 0x62, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x92, 0xF5, 0x83, 0x22, 0xF0, 0x90, 0x00, +0x03, 0x02, 0x26, 0x37, 0x12, 0x26, 0x64, 0x90, 0x92, 0x63, 0xE0, 0x22, 0x90, 0x8E, 0xC5, 0x12, +0x7F, 0xC1, 0x30, 0xE0, 0x02, 0xB1, 0x1A, 0x22, 0xF1, 0xF1, 0xFF, 0x30, 0xE0, 0x1C, 0x12, 0x26, +0x1E, 0x90, 0x8E, 0xBA, 0xD1, 0xCD, 0x90, 0x8E, 0xBB, 0xF0, 0xEF, 0x54, 0xFE, 0xFF, 0xA3, 0xE0, +0x54, 0x01, 0x4F, 0xF1, 0xAD, 0x90, 0x8E, 0xBD, 0xF0, 0x22, 0x12, 0x9C, 0xF9, 0xF0, 0x22, 0x4F, +0xF0, 0x90, 0x00, 0x02, 0x02, 0x26, 0x37, 0x80, 0xC3, 0x75, 0xE8, 0x03, 0x75, 0xA8, 0x85, 0x22, +0x90, 0x00, 0x80, 0xE0, 0x44, 0x80, 0xFD, 0x7F, 0x80, 0x12, 0x3A, 0x96, 0x12, 0x8F, 0xA7, 0x12, +0x3A, 0xB8, 0x12, 0x8F, 0xB4, 0x12, 0x90, 0x18, 0x7F, 0x01, 0x12, 0x4A, 0x79, 0x90, 0x90, 0xE3, +0x74, 0x02, 0xF0, 0xFF, 0x12, 0x4A, 0x79, 0x90, 0x90, 0xE3, 0xE0, 0x04, 0xF0, 0x12, 0x4C, 0xB3, +0x11, 0x4F, 0x90, 0x00, 0x80, 0xE0, 0x44, 0x40, 0xFD, 0x7F, 0x80, 0x12, 0x3A, 0x96, 0x75, 0x28, +0xFF, 0x12, 0x4F, 0xF9, 0x12, 0x78, 0x67, 0x12, 0x90, 0x1F, 0xE4, 0xFF, 0x02, 0x4B, 0x02, 0x12, +0x88, 0xF2, 0x12, 0x8A, 0x80, 0x11, 0x80, 0x12, 0x99, 0x4C, 0x12, 0x4E, 0x1A, 0x12, 0x97, 0x39, +0x12, 0x8A, 0x40, 0x90, 0x90, 0xF0, 0xE0, 0x54, 0x7F, 0xF0, 0x54, 0xBF, 0xF0, 0x54, 0xDF, 0xF0, +0x54, 0xF0, 0xF0, 0xE4, 0x90, 0x90, 0xF2, 0xF0, 0x90, 0x90, 0xF0, 0xE0, 0x54, 0xEF, 0xF0, 0x22, +0x7E, 0x00, 0x7F, 0xAC, 0x7D, 0x00, 0x7B, 0x01, 0x7A, 0x8E, 0x79, 0x0E, 0x12, 0x49, 0x38, 0x12, +0x99, 0x51, 0x12, 0x49, 0x38, 0x90, 0x8E, 0x11, 0x74, 0x02, 0xF0, 0x90, 0x8E, 0x18, 0x14, 0x12, +0x9E, 0x37, 0x90, 0x8E, 0x1E, 0xE4, 0xF0, 0xA3, 0x74, 0x02, 0x31, 0x78, 0xE4, 0xFD, 0xFF, 0x31, +0x10, 0x7D, 0x0C, 0x7F, 0x02, 0x31, 0x10, 0x31, 0x0C, 0x90, 0x8D, 0x07, 0xE0, 0xFF, 0xB4, 0x01, +0x08, 0x90, 0x8E, 0x1D, 0x74, 0xFF, 0xF0, 0x80, 0x0F, 0xEF, 0x90, 0x8E, 0x1D, 0xB4, 0x03, 0x05, +0x74, 0xD4, 0xF0, 0x80, 0x03, 0x74, 0x41, 0xF0, 0x12, 0x9C, 0xF9, 0x31, 0x78, 0x7F, 0x01, 0x12, +0x99, 0x1B, 0x90, 0x8E, 0x20, 0x12, 0x27, 0x54, 0x54, 0x33, 0x77, 0x70, 0x7E, 0x00, 0x7F, 0x02, +0x7D, 0x00, 0x7B, 0x01, 0x7A, 0x8E, 0x79, 0xBE, 0x12, 0x49, 0x38, 0xF1, 0xF6, 0xF0, 0x90, 0x06, +0x0A, 0xE0, 0x54, 0xF8, 0xF1, 0xDC, 0xE4, 0x90, 0x8E, 0xC0, 0xF0, 0x22, 0x7D, 0x0C, 0x7F, 0x01, +0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xAC, 0x07, 0xEF, 0x14, 0x60, 0x15, 0x14, 0x60, 0x19, +0x24, 0x02, 0x70, 0x1A, 0xED, 0x54, 0x01, 0xFE, 0x90, 0x8E, 0x0E, 0xE0, 0x54, 0xFE, 0x4E, 0xF0, +0x80, 0x0C, 0x90, 0x8E, 0x15, 0xED, 0xF0, 0x80, 0x05, 0x90, 0x8E, 0x14, 0xED, 0xF0, 0x90, 0x00, +0x8F, 0xE0, 0x30, 0xE4, 0x2E, 0xEC, 0x14, 0x60, 0x07, 0x14, 0x60, 0x1D, 0x24, 0x02, 0x70, 0x23, +0x90, 0x8E, 0x0E, 0xE0, 0x54, 0x01, 0xC4, 0x33, 0x33, 0x33, 0x54, 0x80, 0xFF, 0x90, 0x8E, 0x15, +0xE0, 0x54, 0x7F, 0x4F, 0xFD, 0x7F, 0x88, 0x80, 0x07, 0x90, 0x8E, 0x14, 0xE0, 0xFD, 0x7F, 0x89, +0x12, 0x3A, 0x96, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xF0, 0x90, 0x8E, 0x48, 0xE0, 0x24, 0x04, 0x90, +0x8E, 0x2A, 0xF0, 0xA3, 0x74, 0x08, 0xF0, 0x22, 0x90, 0x92, 0xD5, 0xEF, 0xF0, 0xD1, 0xCF, 0x90, +0x92, 0xD5, 0xE0, 0x60, 0x02, 0xF1, 0xDD, 0x7D, 0x04, 0x7F, 0x01, 0x21, 0x10, 0x7D, 0x01, 0x7F, +0x04, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x92, 0xD6, 0xED, 0xF0, 0x90, 0x8E, 0x0E, +0xE0, 0xFE, 0xC4, 0x13, 0x13, 0x54, 0x03, 0x30, 0xE0, 0x02, 0x41, 0xE3, 0xEE, 0x12, 0x63, 0x02, +0x30, 0xE0, 0x02, 0x41, 0xE3, 0x90, 0x8E, 0x15, 0xE0, 0xFE, 0x6F, 0x70, 0x02, 0x41, 0xE3, 0xEF, +0x70, 0x02, 0x41, 0x5E, 0x24, 0xFE, 0x70, 0x02, 0x41, 0x97, 0x24, 0xFE, 0x60, 0x48, 0x24, 0xFC, +0x70, 0x02, 0x41, 0xD2, 0x24, 0xFC, 0x60, 0x02, 0x41, 0xE3, 0xEE, 0xB4, 0x0E, 0x02, 0x71, 0x03, +0x90, 0x8E, 0x15, 0xE0, 0x70, 0x04, 0x7F, 0x01, 0x31, 0x88, 0x90, 0x8E, 0x15, 0xE0, 0xB4, 0x06, +0x02, 0x71, 0x1E, 0x90, 0x8E, 0x15, 0xE0, 0xB4, 0x04, 0x0E, 0x90, 0x92, 0xD6, 0xE0, 0xFF, 0x60, +0x05, 0x12, 0x98, 0xD9, 0x80, 0x02, 0xF1, 0xEC, 0x90, 0x8E, 0x15, 0xE0, 0x64, 0x08, 0x60, 0x02, +0x41, 0xE3, 0xF1, 0xE2, 0x41, 0xE3, 0x90, 0x8E, 0x15, 0xE0, 0x70, 0x04, 0x7F, 0x01, 0x31, 0x88, +0x90, 0x8E, 0x15, 0xE0, 0xB4, 0x06, 0x02, 0x71, 0x1E, 0x90, 0x8E, 0x15, 0xE0, 0xB4, 0x0E, 0x07, +0x51, 0xE8, 0xBF, 0x01, 0x02, 0x71, 0x03, 0x90, 0x8E, 0x15, 0xE0, 0x64, 0x0C, 0x60, 0x02, 0x41, +0xE3, 0x51, 0xE8, 0xEF, 0x64, 0x01, 0x60, 0x02, 0x41, 0xE3, 0x71, 0x3F, 0x41, 0xE3, 0x90, 0x8E, +0x15, 0xE0, 0xB4, 0x0E, 0x07, 0x51, 0xE8, 0xBF, 0x01, 0x02, 0x71, 0x03, 0x90, 0x8E, 0x15, 0xE0, +0xB4, 0x06, 0x02, 0x71, 0x1E, 0x90, 0x8E, 0x15, 0xE0, 0xB4, 0x0C, 0x07, 0x51, 0xE8, 0xBF, 0x01, +0x02, 0x71, 0x3F, 0x90, 0x8E, 0x15, 0xE0, 0x64, 0x04, 0x70, 0x58, 0x12, 0x98, 0x58, 0xEF, 0x64, +0x01, 0x70, 0x50, 0xD1, 0x15, 0x80, 0x4C, 0x90, 0x8E, 0x15, 0xE0, 0xB4, 0x0E, 0x07, 0x51, 0xE8, +0xBF, 0x01, 0x02, 0x71, 0x03, 0x90, 0x8E, 0x15, 0xE0, 0xB4, 0x06, 0x02, 0x71, 0x1E, 0x90, 0x8E, +0x15, 0xE0, 0xB4, 0x0C, 0x07, 0x51, 0xE8, 0xBF, 0x01, 0x02, 0x71, 0x3F, 0x90, 0x8E, 0x15, 0xE0, +0x70, 0x04, 0x7F, 0x01, 0x31, 0x88, 0x90, 0x8E, 0x15, 0xE0, 0xB4, 0x04, 0x16, 0x12, 0x99, 0x0D, +0x80, 0x11, 0x90, 0x8E, 0x15, 0xE0, 0xB4, 0x0C, 0x0A, 0x12, 0x70, 0xAA, 0x54, 0x3F, 0x30, 0xE0, +0x02, 0xB1, 0xF7, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x12, 0x98, 0x3F, 0xBF, 0x01, 0x12, 0x12, 0x98, +0x35, 0x20, 0xE0, 0x0C, 0x90, 0x8E, 0x14, 0xE0, 0xD3, 0x94, 0x04, 0x50, 0x03, 0x7F, 0x01, 0x22, +0x7F, 0x00, 0x22, 0x90, 0x8E, 0x0F, 0xE0, 0xC3, 0x13, 0x20, 0xE0, 0x04, 0x7D, 0x0C, 0x80, 0x05, +0x12, 0x9D, 0x50, 0x7D, 0x04, 0x7F, 0x01, 0x31, 0x10, 0xE4, 0xFD, 0xFF, 0x80, 0x56, 0x90, 0x8E, +0x0F, 0xE0, 0x90, 0x06, 0x04, 0x20, 0xE0, 0x08, 0xE0, 0x44, 0x40, 0xF0, 0x7D, 0x04, 0x80, 0x06, +0xE0, 0x54, 0x7F, 0xF0, 0x7D, 0x0C, 0x7F, 0x01, 0x31, 0x10, 0xE4, 0xFD, 0xFF, 0x80, 0x35, 0x12, +0x6F, 0x25, 0x64, 0x01, 0x70, 0x24, 0x90, 0x8E, 0x0F, 0xE0, 0x54, 0xFD, 0xF0, 0x7D, 0x2C, 0x7F, +0x6F, 0x71, 0x74, 0x7D, 0x08, 0x7F, 0x01, 0x12, 0x74, 0xE6, 0xBF, 0x01, 0x0D, 0x90, 0x8E, 0x0E, +0xE0, 0x44, 0x80, 0xF0, 0x7D, 0x0E, 0x7F, 0x01, 0x31, 0x10, 0x22, 0xE4, 0xFD, 0x7F, 0x0C, 0x31, +0xA1, 0xE4, 0xFD, 0xFF, 0x90, 0x05, 0x22, 0xEF, 0xF0, 0x90, 0x8D, 0x05, 0xED, 0xF0, 0x22, 0xD3, +0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x91, 0x1C, 0x12, 0x8B, 0xF6, 0x90, 0x91, 0x34, 0x74, +0x18, 0xF0, 0x7E, 0x00, 0x7F, 0x80, 0x7D, 0x00, 0x7B, 0x01, 0x7A, 0x91, 0x79, 0x3C, 0x12, 0x49, +0x38, 0x90, 0x01, 0xC4, 0x74, 0x7F, 0xF0, 0x74, 0x53, 0xA3, 0xF0, 0x90, 0x90, 0xD7, 0xE0, 0xFF, +0x12, 0x77, 0xB7, 0x90, 0x91, 0x33, 0xEF, 0xF0, 0xF9, 0xE0, 0xFE, 0x24, 0x29, 0x12, 0x75, 0xD6, +0x74, 0x41, 0xF0, 0xEE, 0x24, 0x28, 0xFD, 0xE4, 0x33, 0xFC, 0x90, 0x91, 0x34, 0xE0, 0x7A, 0x00, +0x2D, 0xFE, 0xEA, 0x3C, 0x90, 0x91, 0x38, 0xF0, 0xA3, 0xCE, 0xF0, 0x74, 0x28, 0x29, 0x12, 0x9D, +0x25, 0x90, 0x91, 0x1E, 0xE0, 0xFD, 0x12, 0x80, 0x53, 0xD1, 0x01, 0x90, 0x91, 0x38, 0xE0, 0xFF, +0xA3, 0xE0, 0x90, 0x91, 0x36, 0xCF, 0xF0, 0xA3, 0xEF, 0xF0, 0x90, 0x91, 0x3C, 0x74, 0x01, 0xF0, +0xA3, 0x74, 0x03, 0xF0, 0xE4, 0xA3, 0xF0, 0xA3, 0x74, 0x5F, 0xF0, 0x90, 0x91, 0x38, 0xE4, 0x75, +0xF0, 0x04, 0x12, 0x46, 0xD6, 0x90, 0x8F, 0xE6, 0xE0, 0xFF, 0x7E, 0x02, 0xB4, 0xFE, 0x02, 0x7E, +0xFE, 0x90, 0x91, 0x38, 0xA3, 0xE0, 0xFD, 0xB1, 0xED, 0xEE, 0xF0, 0x74, 0x00, 0x2D, 0xB1, 0xEF, +0xE0, 0x90, 0x91, 0x40, 0xF0, 0x90, 0x91, 0x38, 0x12, 0x59, 0x26, 0x90, 0x90, 0x7B, 0xE0, 0x90, +0x91, 0x1C, 0xB4, 0x01, 0x0B, 0xE0, 0x44, 0x03, 0xFC, 0xA3, 0xE0, 0x44, 0x10, 0xFD, 0x80, 0x09, +0xE0, 0x44, 0x03, 0xFC, 0xA3, 0xE0, 0x44, 0x20, 0xFD, 0x90, 0x91, 0x3A, 0xEC, 0xF0, 0xA3, 0xED, +0xF0, 0x90, 0x91, 0x41, 0x74, 0x03, 0xF0, 0xA3, 0x74, 0x12, 0xF0, 0x12, 0x9E, 0x07, 0x12, 0x46, +0xD6, 0xEF, 0x64, 0xFE, 0x70, 0x27, 0x90, 0x91, 0x38, 0xA3, 0xE0, 0x24, 0x00, 0x12, 0x87, 0xBC, +0xC0, 0x03, 0x8B, 0x40, 0x12, 0x9D, 0x70, 0xD0, 0x03, 0x12, 0x34, 0x2C, 0x75, 0x40, 0x01, 0x12, +0x9D, 0x70, 0x7B, 0x01, 0x7A, 0x91, 0x79, 0x43, 0x12, 0x34, 0x2C, 0x80, 0x58, 0x90, 0x90, 0xD2, +0xE0, 0xFF, 0xB4, 0x02, 0x27, 0x90, 0x91, 0x38, 0xE0, 0xFC, 0xA3, 0xE0, 0xFD, 0x24, 0x00, 0xF5, +0x82, 0x74, 0xFC, 0x3C, 0xF5, 0x83, 0xE4, 0xF0, 0x74, 0x01, 0x2D, 0xF5, 0x82, 0x74, 0xFC, 0x3C, +0xF5, 0x83, 0x74, 0x20, 0x12, 0x9E, 0x0F, 0x74, 0x20, 0xF0, 0x80, 0x29, 0xEF, 0xB4, 0x04, 0x25, +0x90, 0x91, 0x38, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x24, 0x00, 0xF5, 0x82, 0x74, 0xFC, 0x3E, 0xF5, +0x83, 0xE4, 0xF0, 0x74, 0x01, 0x2F, 0xF5, 0x82, 0x74, 0xFC, 0x3E, 0xF5, 0x83, 0x74, 0x10, 0x12, +0x9E, 0x0F, 0x74, 0x10, 0xF0, 0x12, 0x9E, 0x07, 0x12, 0x46, 0xD6, 0xE4, 0x90, 0x91, 0x35, 0xF0, +0x12, 0x9A, 0x90, 0xE0, 0xFE, 0x90, 0x91, 0x38, 0xA3, 0xE0, 0xFD, 0xEF, 0x2D, 0xB1, 0xED, 0xEE, +0xF0, 0x12, 0x9A, 0x90, 0xE0, 0xFE, 0x74, 0x45, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x91, 0xF5, 0x83, +0xEE, 0x12, 0x9D, 0xFF, 0xE0, 0xB4, 0x08, 0xD8, 0xD1, 0x0B, 0x90, 0x91, 0x38, 0xE4, 0x75, 0xF0, +0x20, 0x12, 0x46, 0xD6, 0x90, 0x91, 0x38, 0x12, 0x5B, 0xBD, 0xD1, 0x01, 0x7B, 0x01, 0x7A, 0x91, +0x79, 0x3C, 0x90, 0x91, 0xC3, 0x12, 0x47, 0x5F, 0x90, 0x91, 0xC6, 0x74, 0x63, 0xF0, 0x7A, 0x91, +0x79, 0x1F, 0xA3, 0x12, 0x47, 0x5F, 0x7A, 0x8F, 0x79, 0xA2, 0x7D, 0x10, 0x12, 0x59, 0x2D, 0xE4, +0x90, 0x91, 0x35, 0xF0, 0x90, 0x91, 0x35, 0xE0, 0xFF, 0xC3, 0x94, 0x10, 0x50, 0x3C, 0x90, 0x91, +0x39, 0xE0, 0x2F, 0xFF, 0x90, 0x91, 0x38, 0xE0, 0x34, 0x00, 0xFE, 0x90, 0x91, 0xBC, 0xF0, 0xA3, +0xEF, 0xF0, 0x90, 0x90, 0xD7, 0xE0, 0xFD, 0x12, 0x91, 0x02, 0x90, 0x91, 0x33, 0xEF, 0xF0, 0x90, +0x91, 0x35, 0xE0, 0x24, 0x1F, 0xF5, 0x82, 0xE4, 0x34, 0x91, 0xF5, 0x83, 0xE0, 0xFF, 0x90, 0x91, +0x33, 0xE0, 0xB1, 0xED, 0xEF, 0x12, 0x9D, 0xFF, 0x80, 0xBA, 0x90, 0x04, 0x1D, 0xE0, 0x60, 0x1D, +0x90, 0x05, 0x22, 0xE0, 0x90, 0x91, 0xBE, 0xF0, 0x7D, 0x1D, 0xF1, 0x94, 0xBF, 0x01, 0x03, 0x12, +0x9C, 0x91, 0x90, 0x91, 0xBE, 0xE0, 0xFF, 0x7D, 0x1E, 0x71, 0x74, 0x80, 0x03, 0x12, 0x9C, 0x91, +0x12, 0x77, 0x70, 0x90, 0x8E, 0x15, 0xE0, 0x70, 0x04, 0x7F, 0x01, 0x31, 0x88, 0x74, 0x7F, 0x04, +0x90, 0x01, 0xC4, 0xF0, 0x74, 0x53, 0xA3, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x24, 0x00, 0xF5, +0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0x22, 0x7D, 0x2F, 0xD1, 0x2D, 0x7D, 0x08, 0x7F, 0x01, 0x21, +0x10, 0x90, 0x91, 0x38, 0xE4, 0x75, 0xF0, 0x08, 0x12, 0x46, 0xD6, 0x90, 0x91, 0x38, 0xE4, 0x75, +0xF0, 0x08, 0x02, 0x46, 0xD6, 0x7D, 0x2D, 0xF1, 0x94, 0x90, 0x01, 0x37, 0x74, 0x02, 0xF0, 0xFD, +0x7F, 0x03, 0x12, 0x72, 0x6E, 0xD1, 0x31, 0xE4, 0xFD, 0x7F, 0x01, 0x21, 0x10, 0x7F, 0xFF, 0x71, +0x74, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xF1, 0x98, 0x7F, 0x00, 0x7E, 0x0C, 0xD1, 0xB5, +0x12, 0x9D, 0x44, 0xD1, 0xB5, 0x7F, 0x00, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0x00, 0x02, 0xE0, +0x12, 0x9C, 0x78, 0x12, 0x9C, 0x78, 0x54, 0xFE, 0xFD, 0x7F, 0x02, 0x12, 0x3A, 0x96, 0x12, 0x9D, +0xD0, 0x44, 0x40, 0xD1, 0xBB, 0x12, 0x9D, 0xE9, 0x90, 0x01, 0x00, 0x74, 0x3F, 0xF0, 0xA3, 0xE0, +0x54, 0xFD, 0xF0, 0x90, 0x05, 0x53, 0xE0, 0x44, 0x20, 0x12, 0x88, 0xF7, 0x12, 0x27, 0x48, 0x90, +0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, 0x77, 0x12, 0x96, 0x4A, 0x12, 0x27, 0x54, 0x77, +0x77, 0x77, 0x77, 0x7F, 0xB0, 0x12, 0x9D, 0xAA, 0x70, 0x16, 0x7B, 0x01, 0x7A, 0x92, 0x79, 0x91, +0x7D, 0x08, 0x7F, 0x01, 0x12, 0x91, 0x64, 0x90, 0x92, 0x91, 0xE0, 0x44, 0x18, 0x12, 0x91, 0x13, +0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x12, 0x36, 0xCE, 0xEF, 0x54, 0xFC, 0xFF, 0xEC, 0x90, 0x92, 0x92, +0x12, 0x27, 0x48, 0x90, 0x92, 0x92, 0x12, 0x47, 0x32, 0x90, 0xAC, 0xB9, 0x02, 0x27, 0x48, 0xD3, +0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x8E, 0x20, 0xD1, 0xC6, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, +0x37, 0x5D, 0x90, 0x8E, 0x20, 0xD1, 0xC6, 0x7F, 0xB0, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0x00, +0x10, 0xE0, 0x44, 0x0C, 0xFD, 0x7F, 0x10, 0x12, 0x3A, 0x96, 0x90, 0x00, 0x72, 0xE0, 0x54, 0xF3, +0xFD, 0x7F, 0x72, 0x12, 0x3A, 0x96, 0x90, 0x01, 0x01, 0xE0, 0x44, 0x02, 0xF0, 0x90, 0x01, 0x00, +0x74, 0xFF, 0xF0, 0x90, 0x06, 0xB7, 0x74, 0x09, 0xF0, 0x90, 0x06, 0xB4, 0x74, 0x86, 0xF0, 0x12, +0x9D, 0xD0, 0x54, 0xBF, 0xF1, 0x6D, 0xD1, 0xC6, 0x12, 0x9D, 0xE9, 0x90, 0x00, 0x02, 0xE0, 0x44, +0x01, 0xFD, 0x7F, 0x02, 0x12, 0x3A, 0x96, 0x7F, 0x00, 0x7E, 0x0C, 0xF1, 0x67, 0xD1, 0xC6, 0x12, +0x9D, 0x44, 0xF1, 0x67, 0xD1, 0xC6, 0x7F, 0x00, 0x12, 0x9D, 0xAA, 0x70, 0x15, 0x12, 0x91, 0xA0, +0x54, 0xE7, 0x12, 0x91, 0x13, 0x12, 0x91, 0xA0, 0x54, 0x18, 0x70, 0x06, 0x90, 0x01, 0xBF, 0xE0, +0x04, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x12, 0x36, 0xCE, 0xEF, 0x44, 0x03, 0xFF, 0xEC, 0x90, +0x92, 0x8C, 0x12, 0x27, 0x48, 0x90, 0x92, 0x8C, 0x22, 0x90, 0x8E, 0x12, 0xE0, 0x64, 0x01, 0x70, +0x12, 0x12, 0x74, 0x1B, 0x60, 0x05, 0x71, 0x6B, 0x02, 0x97, 0xFB, 0x90, 0x8E, 0x15, 0xE0, 0x70, +0x02, 0x31, 0x9D, 0x22, 0x7F, 0xFF, 0x71, 0x74, 0xE4, 0x90, 0x92, 0xC5, 0xF0, 0xA3, 0xF0, 0x90, +0x05, 0xF8, 0xE0, 0x70, 0x0F, 0xA3, 0xE0, 0x70, 0x0B, 0xA3, 0xE0, 0x70, 0x07, 0xA3, 0xE0, 0x70, +0x03, 0x7F, 0x01, 0x22, 0xD3, 0x90, 0x92, 0xC6, 0xE0, 0x94, 0xE8, 0x90, 0x92, 0xC5, 0xE0, 0x94, +0x03, 0x40, 0x0A, 0x90, 0x01, 0xC0, 0xE0, 0x44, 0x20, 0xF0, 0x7F, 0x00, 0x22, 0x7F, 0x32, 0x7E, +0x00, 0x12, 0x3A, 0xF7, 0x90, 0x92, 0xC5, 0x12, 0x59, 0x26, 0x80, 0xC3, 0xF0, 0xE4, 0xFD, 0xFF, +0x61, 0x74, 0xD1, 0xCF, 0xF1, 0xDD, 0x7D, 0x0C, 0x7F, 0x01, 0x21, 0x10, 0xF1, 0xF6, 0xF1, 0xDC, +0x7D, 0x0C, 0x7F, 0x01, 0x21, 0x10, 0x90, 0x06, 0x04, 0xE0, 0x54, 0x7F, 0x22, 0xE4, 0x90, 0x90, +0xF8, 0xF0, 0x90, 0x90, 0xF8, 0xE0, 0x64, 0x01, 0xF0, 0x24, 0xFD, 0x90, 0x01, 0xC4, 0xF0, 0x74, +0x57, 0xA3, 0xF0, 0x12, 0x3A, 0xEB, 0xBF, 0x01, 0x03, 0x12, 0x31, 0x69, 0x90, 0x8E, 0x12, 0xE0, +0x60, 0x0F, 0x90, 0x8E, 0x15, 0xE0, 0xFF, 0x90, 0x8E, 0x14, 0xE0, 0x6F, 0x60, 0x03, 0x12, 0x77, +0x97, 0xC2, 0xAF, 0x12, 0x8F, 0xE4, 0xBF, 0x01, 0x02, 0x11, 0x71, 0xD2, 0xAF, 0x11, 0x44, 0x12, +0x49, 0xB1, 0x80, 0xBE, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x00, 0x8F, 0xE0, 0x30, +0xE6, 0x1A, 0x90, 0x00, 0x8C, 0xE0, 0xF5, 0x15, 0xA3, 0xE0, 0xA3, 0xE0, 0xF5, 0x16, 0x90, 0x00, +0x8F, 0xE0, 0x30, 0xE0, 0x07, 0xE4, 0xFD, 0x7F, 0x8D, 0x12, 0x3A, 0x96, 0xD0, 0xD0, 0x92, 0xAF, +0x22, 0x90, 0x8E, 0x0E, 0xE0, 0x30, 0xE0, 0x02, 0x11, 0x7B, 0x22, 0x90, 0x8E, 0x15, 0xE0, 0xFF, +0x60, 0x03, 0xB4, 0x08, 0x08, 0x12, 0x98, 0x94, 0xBF, 0x01, 0x02, 0x11, 0x8E, 0x22, 0xD3, 0x10, +0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x12, 0x92, 0x27, 0x11, 0x9F, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x12, +0x92, 0x0A, 0x90, 0x00, 0x08, 0xE0, 0x54, 0xEF, 0xFD, 0x7F, 0x08, 0x12, 0x3A, 0x96, 0xE4, 0xFF, +0x11, 0xCD, 0x90, 0x8D, 0x07, 0xE0, 0xB4, 0x03, 0x0C, 0x90, 0x00, 0x70, 0xE0, 0x54, 0x7F, 0xFD, +0x7F, 0x70, 0x12, 0x3A, 0x96, 0x90, 0x8E, 0x0F, 0xE0, 0x54, 0xEF, 0xF0, 0x22, 0x90, 0x92, 0xB9, +0xEF, 0x12, 0x97, 0x49, 0x90, 0x01, 0x09, 0xE0, 0x7F, 0x00, 0x30, 0xE7, 0x02, 0x7F, 0x01, 0x90, +0x92, 0xB9, 0xE0, 0x6F, 0x60, 0x35, 0xC3, 0x90, 0x92, 0xBB, 0xE0, 0x94, 0x88, 0x90, 0x92, 0xBA, +0xE0, 0x94, 0x13, 0x40, 0x08, 0x90, 0x01, 0xC0, 0xE0, 0x44, 0x10, 0xF0, 0x22, 0x90, 0x92, 0xBA, +0x31, 0x26, 0x12, 0x78, 0x60, 0xD3, 0x90, 0x92, 0xBB, 0xE0, 0x94, 0x32, 0x90, 0x92, 0xBA, 0xE0, +0x94, 0x00, 0x40, 0xC0, 0x90, 0x01, 0xC6, 0xE0, 0x30, 0xE0, 0xB9, 0x22, 0x7F, 0x01, 0x7E, 0x00, +0x12, 0x3A, 0xF7, 0x90, 0x92, 0x0F, 0xE4, 0x75, 0xF0, 0x01, 0x02, 0x46, 0xD6, 0xD3, 0x10, 0xAF, +0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x91, 0xBF, 0x12, 0x47, 0x5F, 0x90, 0x91, 0xC2, 0xED, 0xF0, 0xE4, +0x90, 0x92, 0x0E, 0xF0, 0x71, 0xB1, 0x50, 0x06, 0x51, 0xFA, 0x71, 0x96, 0x80, 0xF6, 0x90, 0x91, +0xBF, 0x71, 0xDD, 0x12, 0x9C, 0xCF, 0x71, 0x21, 0x94, 0x40, 0x50, 0x0A, 0x51, 0xFA, 0xE0, 0x64, +0x36, 0xF0, 0x51, 0xE8, 0x80, 0xF0, 0x90, 0x91, 0xC3, 0x12, 0x47, 0x56, 0x90, 0x91, 0xC6, 0x71, +0x8E, 0x74, 0x80, 0x12, 0x26, 0x76, 0xEF, 0x75, 0xF0, 0x08, 0xA4, 0x24, 0x00, 0xFF, 0xE5, 0xF0, +0x34, 0x02, 0xFC, 0x90, 0x00, 0x7E, 0x12, 0x26, 0x76, 0xEF, 0x90, 0x00, 0x7F, 0x71, 0xC4, 0xF0, +0x71, 0xA8, 0xC3, 0x94, 0xC0, 0xEE, 0x94, 0x00, 0x50, 0x58, 0x71, 0x86, 0x50, 0x09, 0x12, 0x9C, +0x30, 0x71, 0x76, 0x7B, 0x01, 0x80, 0x05, 0x12, 0x9B, 0xB3, 0x71, 0x7E, 0x12, 0x9D, 0x0E, 0xE4, +0x51, 0xDE, 0x90, 0x01, 0x8C, 0xE0, 0x30, 0xE4, 0x0B, 0x51, 0xEF, 0xE0, 0x94, 0x03, 0x50, 0x04, +0x31, 0x1C, 0x80, 0xEE, 0x71, 0x12, 0x40, 0x08, 0x90, 0x06, 0x31, 0xE0, 0x44, 0x01, 0x71, 0x0B, +0x71, 0x9F, 0x70, 0x1A, 0x51, 0xDE, 0x90, 0x01, 0x8C, 0xE0, 0x20, 0xE5, 0x0B, 0x51, 0xEF, 0xE0, +0x94, 0x03, 0x50, 0x04, 0x31, 0x1C, 0x80, 0xEE, 0x71, 0x12, 0x40, 0x02, 0x71, 0x05, 0x71, 0xBA, +0x80, 0x9E, 0x71, 0x28, 0x7D, 0x84, 0x12, 0x33, 0x2F, 0xE4, 0x90, 0x92, 0x0E, 0xF0, 0x71, 0xB1, +0x50, 0x06, 0x51, 0xFA, 0x71, 0x96, 0x80, 0xF6, 0x90, 0x91, 0xBF, 0x71, 0xDD, 0x12, 0x9C, 0xCF, +0x71, 0x21, 0x94, 0x40, 0x50, 0x0A, 0x51, 0xFA, 0xE0, 0x64, 0x5C, 0xF0, 0x51, 0xE8, 0x80, 0xF0, +0xE4, 0x90, 0x91, 0xCA, 0xF0, 0x71, 0x70, 0x90, 0x91, 0xCA, 0x71, 0x8E, 0x12, 0x26, 0x37, 0xFE, +0x71, 0xCE, 0xEE, 0x51, 0xE5, 0xE0, 0xB4, 0x14, 0xEC, 0x90, 0x91, 0xC3, 0x12, 0x47, 0x56, 0x90, +0x00, 0x14, 0x74, 0x80, 0x12, 0x26, 0x76, 0x90, 0x91, 0xCA, 0x74, 0x15, 0xF0, 0x71, 0x21, 0x94, +0x3E, 0x50, 0x07, 0x71, 0xCE, 0xE4, 0x51, 0xE5, 0x80, 0xF3, 0x90, 0x91, 0xC3, 0x12, 0x47, 0x56, +0x90, 0x00, 0x3E, 0x74, 0x02, 0x12, 0x26, 0x76, 0x90, 0x00, 0x3F, 0x74, 0xA0, 0x71, 0xC4, 0xF0, +0x71, 0xA8, 0xC3, 0x94, 0x80, 0xEE, 0x94, 0x00, 0x50, 0x58, 0x71, 0x86, 0x50, 0x09, 0x12, 0x9C, +0x30, 0x71, 0x76, 0x7B, 0x01, 0x80, 0x05, 0x12, 0x9B, 0xB3, 0x71, 0x7E, 0x12, 0x9D, 0x0E, 0xE4, +0x51, 0xDE, 0x90, 0x01, 0x8C, 0xE0, 0x30, 0xE4, 0x0B, 0x51, 0xEF, 0xE0, 0x94, 0x03, 0x50, 0x04, +0x31, 0x1C, 0x80, 0xEE, 0x71, 0x12, 0x40, 0x08, 0x90, 0x06, 0x31, 0xE0, 0x44, 0x01, 0x71, 0x0B, +0x71, 0x9F, 0x70, 0x1A, 0x51, 0xDE, 0x90, 0x01, 0x8C, 0xE0, 0x20, 0xE5, 0x0B, 0x51, 0xEF, 0xE0, +0x94, 0x03, 0x50, 0x04, 0x31, 0x1C, 0x80, 0xEE, 0x71, 0x12, 0x40, 0x02, 0x71, 0x05, 0x71, 0xBA, +0x80, 0x9E, 0x71, 0x28, 0x7D, 0x84, 0x12, 0x33, 0x2F, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0x92, +0x0F, 0xF0, 0xA3, 0xF0, 0x22, 0x12, 0x26, 0x76, 0x90, 0x91, 0xCA, 0xE0, 0x04, 0xF0, 0x22, 0xC3, +0x90, 0x92, 0x10, 0xE0, 0x94, 0xE8, 0x90, 0x92, 0x0F, 0x22, 0x74, 0xCB, 0x2F, 0xF5, 0x82, 0xE4, +0x34, 0x91, 0xF5, 0x83, 0x22, 0x90, 0x06, 0x31, 0xE0, 0x44, 0x02, 0xF0, 0xEE, 0x90, 0x06, 0x36, +0xF0, 0x22, 0x90, 0x92, 0x0F, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0xC3, 0x94, 0xE8, 0xEE, 0x94, 0x03, +0x22, 0x90, 0x91, 0xCA, 0xE0, 0xFF, 0xC3, 0x22, 0x90, 0x91, 0xC7, 0x12, 0x47, 0x56, 0xE9, 0x24, +0x10, 0xF9, 0xE4, 0x3A, 0xFA, 0x7D, 0x80, 0x12, 0x33, 0x2F, 0x90, 0x91, 0xC7, 0x12, 0x47, 0x56, +0xE9, 0x24, 0x0C, 0xF9, 0xE4, 0x3A, 0xFA, 0x7D, 0x81, 0x12, 0x33, 0x2F, 0x90, 0x91, 0xC7, 0x12, +0x47, 0x56, 0xE9, 0x24, 0x08, 0xF9, 0xE4, 0x3A, 0xFA, 0x7D, 0x82, 0x12, 0x33, 0x2F, 0x90, 0x91, +0xC7, 0x12, 0x47, 0x56, 0xE9, 0x24, 0x04, 0xF9, 0xE4, 0x3A, 0xFA, 0x7D, 0x83, 0x12, 0x33, 0x2F, +0x90, 0x91, 0xC7, 0x02, 0x47, 0x56, 0x24, 0xD7, 0xF9, 0xE4, 0x34, 0x91, 0xFA, 0x22, 0x24, 0xCC, +0xF9, 0xEA, 0x34, 0xFF, 0xFA, 0x22, 0xC3, 0xEF, 0x94, 0x40, 0xEE, 0x94, 0x00, 0x22, 0xE0, 0xFF, +0xF5, 0x82, 0x75, 0x83, 0x00, 0x22, 0xE4, 0xF0, 0x90, 0x92, 0x0E, 0xE0, 0x04, 0xF0, 0x22, 0x90, +0x92, 0x0C, 0xE0, 0x54, 0x3F, 0x64, 0x30, 0x22, 0x90, 0x92, 0x0B, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, +0x22, 0x90, 0x92, 0x0E, 0xE0, 0xFF, 0xC3, 0x94, 0x40, 0x22, 0x90, 0x92, 0x0B, 0xE4, 0x75, 0xF0, +0x10, 0x02, 0x46, 0xD6, 0x12, 0x26, 0x76, 0xE4, 0x90, 0x92, 0x0B, 0xF0, 0xA3, 0x22, 0x90, 0x91, +0xC3, 0x12, 0x47, 0x56, 0x8F, 0x82, 0x75, 0x83, 0x00, 0x22, 0x90, 0x92, 0x4E, 0x12, 0x47, 0x56, +0x8B, 0x40, 0x8A, 0x41, 0x89, 0x42, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x92, +0x4B, 0x12, 0x47, 0x5F, 0x78, 0x57, 0x7C, 0x92, 0x7D, 0x01, 0x7B, 0xFF, 0x7A, 0x40, 0x79, 0x5E, +0xF1, 0xD3, 0x90, 0x05, 0x22, 0xE0, 0x90, 0x92, 0x56, 0xF0, 0x90, 0x04, 0x1D, 0xE0, 0x60, 0x0A, +0x7D, 0x33, 0x12, 0x57, 0x94, 0xBF, 0x01, 0x16, 0x80, 0x00, 0x90, 0x90, 0xD5, 0xE0, 0xFF, 0x7B, +0x18, 0x7D, 0x01, 0x12, 0x74, 0x57, 0x90, 0x92, 0x53, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0x90, 0x92, +0x53, 0x12, 0x81, 0xE4, 0x90, 0x92, 0x55, 0xEF, 0xF0, 0x90, 0x92, 0x53, 0x12, 0x9D, 0x21, 0x90, +0x92, 0x51, 0xE0, 0xFD, 0x12, 0x80, 0x53, 0x90, 0x92, 0x52, 0xE0, 0x70, 0x49, 0xF1, 0xE2, 0xFA, +0x7B, 0x01, 0xC0, 0x03, 0xC0, 0x02, 0xC0, 0x01, 0x71, 0xDA, 0x75, 0x43, 0x06, 0xD0, 0x01, 0xD0, +0x02, 0xD0, 0x03, 0x91, 0xFA, 0x12, 0x9D, 0x5C, 0x7B, 0x01, 0xC0, 0x03, 0xC0, 0x02, 0xC0, 0x01, +0x71, 0xDA, 0x75, 0x43, 0x06, 0xD0, 0x01, 0xD0, 0x02, 0xD0, 0x03, 0x91, 0xFA, 0x12, 0x9D, 0x66, +0x7B, 0x01, 0xC0, 0x03, 0xC0, 0x02, 0xC0, 0x01, 0x90, 0x92, 0x4B, 0x71, 0xDD, 0x75, 0x43, 0x04, +0xD0, 0x01, 0xD0, 0x02, 0x80, 0x46, 0x90, 0x92, 0x52, 0xE0, 0x64, 0x01, 0x70, 0x43, 0xF1, 0xE2, +0xFA, 0x7B, 0x01, 0xC0, 0x03, 0x8B, 0x40, 0x75, 0x41, 0x8E, 0x75, 0x42, 0xEA, 0x75, 0x43, 0x06, +0xD0, 0x03, 0x91, 0xFA, 0x12, 0x9D, 0x5C, 0x7B, 0x01, 0xC0, 0x03, 0x8B, 0x40, 0x75, 0x41, 0x8E, +0x75, 0x42, 0xF4, 0x75, 0x43, 0x06, 0xD0, 0x03, 0x91, 0xFA, 0x12, 0x9D, 0x66, 0x7B, 0x01, 0xC0, +0x03, 0x8B, 0x40, 0x75, 0x41, 0x8E, 0x75, 0x42, 0xFA, 0x75, 0x43, 0x04, 0xD0, 0x03, 0x12, 0x34, +0x2C, 0x90, 0x06, 0x30, 0xE0, 0x44, 0x10, 0xF0, 0x90, 0x92, 0x56, 0xE0, 0xFF, 0x7D, 0x34, 0x12, +0x53, 0x74, 0x12, 0x77, 0x70, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x12, 0x34, 0x2C, 0x90, 0x92, 0x53, +0xA3, 0xE0, 0xFF, 0xA3, 0x22, 0x12, 0x8B, 0xF3, 0x78, 0x17, 0x7C, 0x91, 0x7D, 0x01, 0x7B, 0xFF, +0x7A, 0x40, 0x79, 0x50, 0xF1, 0xD3, 0x78, 0x1D, 0x7C, 0x91, 0x7D, 0x01, 0x7B, 0xFF, 0x7A, 0x40, +0x79, 0x56, 0xF1, 0xCC, 0x78, 0x21, 0x7C, 0x91, 0x7D, 0x01, 0x7B, 0xFF, 0x7A, 0x40, 0x79, 0x5A, +0xF1, 0xCC, 0xE4, 0x90, 0x91, 0x26, 0xF0, 0xD1, 0xF8, 0xCF, 0x24, 0x06, 0xCF, 0xF1, 0x2A, 0xEF, +0x64, 0x08, 0x60, 0x02, 0xC1, 0x3C, 0xD1, 0xF8, 0xCF, 0x24, 0x07, 0xCF, 0xF1, 0x2A, 0xEF, 0x64, +0x06, 0x60, 0x02, 0xC1, 0x3C, 0x90, 0x91, 0x26, 0x04, 0xF0, 0xE4, 0x90, 0x91, 0x25, 0xF0, 0xF1, +0x0A, 0x94, 0x06, 0x50, 0x1B, 0x90, 0x91, 0x0F, 0xE0, 0x24, 0x0A, 0xFD, 0x90, 0x91, 0x0E, 0xD1, +0x46, 0x90, 0x91, 0x25, 0xE0, 0x24, 0x11, 0xF5, 0x82, 0xE4, 0x34, 0x91, 0xF1, 0x1A, 0x80, 0xDF, +0x78, 0x11, 0x7C, 0x91, 0x7D, 0x01, 0x7B, 0x01, 0x7A, 0x8E, 0x79, 0xD5, 0x12, 0x8B, 0xEA, 0x60, +0x02, 0xC1, 0x3C, 0x90, 0x91, 0x25, 0xF0, 0xF1, 0x0A, 0x94, 0x04, 0x50, 0x19, 0xF1, 0xC0, 0xF1, +0x03, 0xCD, 0x24, 0x20, 0xCD, 0xD1, 0x47, 0x90, 0x91, 0x25, 0xE0, 0x24, 0x21, 0xF5, 0x82, 0xE4, +0x34, 0x91, 0xF1, 0x1A, 0x80, 0xE1, 0x78, 0x21, 0x7C, 0x91, 0x12, 0x8C, 0x95, 0x70, 0x74, 0x90, +0x06, 0x30, 0xE0, 0x44, 0x01, 0x54, 0xDF, 0xF0, 0x90, 0x8E, 0xC7, 0x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0xF0, 0xA3, 0xEF, 0xF0, 0x7D, 0x09, 0xD1, 0x54, 0xEF, 0x64, 0x06, +0x70, 0x24, 0xF1, 0x11, 0x7D, 0x14, 0xD1, 0x54, 0xEF, 0x70, 0x1B, 0xF1, 0x11, 0x7D, 0x15, 0xD1, +0x54, 0xEF, 0x64, 0x50, 0x70, 0x10, 0xF1, 0x11, 0x7D, 0x21, 0xD1, 0x54, 0xEF, 0x20, 0xE0, 0x03, +0x30, 0xE2, 0x03, 0x7F, 0x01, 0x22, 0x90, 0x8E, 0xC6, 0xE0, 0x13, 0x13, 0x54, 0x3F, 0x30, 0xE0, +0x34, 0xF1, 0x11, 0x7D, 0x09, 0xD1, 0x54, 0xEF, 0x64, 0x11, 0x70, 0x29, 0x90, 0x91, 0x1F, 0xE0, +0x24, 0x14, 0x12, 0x8B, 0xE1, 0x90, 0x91, 0x20, 0xF0, 0xA3, 0xEF, 0xF0, 0x7D, 0x02, 0xD1, 0x54, +0xEF, 0x70, 0x12, 0x90, 0x91, 0x20, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x7D, 0x03, 0xD1, 0x54, 0xBF, +0x89, 0x03, 0x7F, 0x01, 0x22, 0x7F, 0x00, 0x22, 0x90, 0x91, 0x10, 0xE0, 0xFF, 0x90, 0x91, 0x0F, +0xE0, 0x2F, 0xFF, 0x90, 0x91, 0x0E, 0xE0, 0x34, 0x00, 0x22, 0x90, 0x91, 0x25, 0xE0, 0xFF, 0xC3, +0x22, 0x90, 0x91, 0x1E, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x22, 0xF5, 0x83, 0xEF, 0xF0, 0x90, 0x91, +0x25, 0xE0, 0x04, 0xF0, 0x22, 0xFF, 0x90, 0x91, 0x17, 0xE0, 0x34, 0x00, 0xFE, 0xE4, 0xFD, 0xC1, +0x54, 0x90, 0x91, 0x10, 0xED, 0xF0, 0xA3, 0xEB, 0xF0, 0x12, 0x8A, 0xE1, 0x90, 0x91, 0x13, 0xF0, +0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, 0x90, 0x01, 0xC7, +0x74, 0x22, 0xF0, 0xEF, 0x30, 0xE7, 0x06, 0x90, 0x01, 0xC7, 0x74, 0x21, 0xF0, 0xEF, 0x30, 0xE5, +0x06, 0x90, 0x01, 0xC7, 0x74, 0x23, 0xF0, 0x90, 0x91, 0x00, 0xE0, 0x24, 0x40, 0x60, 0x04, 0x24, +0x20, 0x70, 0x29, 0x90, 0x8E, 0xC8, 0x71, 0x00, 0x20, 0xE0, 0x02, 0x41, 0x79, 0x90, 0x8E, 0xDB, +0xE0, 0x04, 0x51, 0xEC, 0x12, 0x8A, 0xEB, 0xEF, 0x70, 0x02, 0x41, 0x79, 0x90, 0x91, 0x00, 0xE0, +0xFF, 0x12, 0x97, 0x9F, 0x90, 0x8E, 0xDC, 0xE0, 0x04, 0xF0, 0x41, 0x79, 0x12, 0x9D, 0x3A, 0x30, +0xE0, 0x5B, 0x90, 0x91, 0x03, 0xE0, 0xFF, 0x90, 0x90, 0xFF, 0xE0, 0x2F, 0xFF, 0x90, 0x90, 0xFE, +0xE0, 0x34, 0x00, 0xCF, 0x24, 0x08, 0xCF, 0x34, 0x00, 0xFE, 0x90, 0x91, 0x09, 0x12, 0x9D, 0x8D, +0xEF, 0x64, 0x45, 0x70, 0x38, 0x51, 0xF7, 0x12, 0x8C, 0xDA, 0xEF, 0x64, 0x01, 0x70, 0x2E, 0x51, +0xF7, 0x12, 0x9B, 0x7A, 0xEF, 0x64, 0x01, 0x70, 0x24, 0x90, 0x91, 0x0D, 0x04, 0x51, 0xF6, 0xA3, +0xE0, 0xFD, 0x12, 0x8C, 0x3A, 0xEF, 0x70, 0x0D, 0x90, 0x91, 0x0B, 0xE0, 0xFD, 0x90, 0xFD, 0x11, +0x51, 0xF6, 0x12, 0x8B, 0xFF, 0x90, 0x91, 0x0B, 0xE0, 0x90, 0xFD, 0x11, 0xF0, 0x51, 0xED, 0x12, +0x8A, 0xEB, 0xEF, 0x60, 0x20, 0x51, 0xED, 0x90, 0x91, 0x03, 0xE0, 0xFD, 0x90, 0x91, 0x06, 0xE0, +0xFB, 0x90, 0x91, 0x0B, 0xE0, 0x90, 0x91, 0x12, 0xF0, 0x12, 0x5F, 0x31, 0xEF, 0x60, 0x06, 0x90, +0x91, 0x0D, 0x74, 0x01, 0xF0, 0x90, 0x8E, 0xC5, 0xE0, 0xC3, 0x13, 0x30, 0xE0, 0x13, 0x51, 0xED, +0x90, 0x91, 0x03, 0xE0, 0xFD, 0x12, 0x5D, 0x05, 0xEF, 0x60, 0x06, 0x90, 0x91, 0x0D, 0x74, 0x01, +0xF0, 0x90, 0x8E, 0xC5, 0x71, 0x00, 0x30, 0xE0, 0x10, 0x90, 0x91, 0x0D, 0xE0, 0x70, 0x0A, 0x51, +0xED, 0x90, 0x91, 0x03, 0xE0, 0xFD, 0x12, 0x8B, 0x35, 0x12, 0x97, 0xB1, 0xEF, 0x64, 0x01, 0x60, +0x07, 0x90, 0x01, 0x3F, 0xE0, 0x30, 0xE2, 0x04, 0x7F, 0x01, 0x71, 0x09, 0x12, 0x97, 0x74, 0xEF, +0x64, 0x01, 0x70, 0x37, 0x90, 0x8E, 0xDD, 0xE0, 0x04, 0xF0, 0x12, 0x97, 0x5E, 0xAD, 0x07, 0xEF, +0x64, 0x01, 0x60, 0x1F, 0x12, 0x5F, 0xDA, 0xED, 0xB4, 0x02, 0x08, 0x90, 0x01, 0xC7, 0x74, 0x42, +0xF0, 0x80, 0x0A, 0xED, 0xB4, 0x04, 0x06, 0x90, 0x01, 0xC7, 0x74, 0x43, 0xF0, 0x7F, 0x01, 0x71, +0x09, 0x80, 0x19, 0x12, 0x9D, 0xC7, 0x12, 0x97, 0x50, 0x80, 0x09, 0x90, 0x8E, 0xC5, 0xE0, 0x54, +0xFE, 0xF0, 0x80, 0x08, 0x90, 0x91, 0x01, 0xE0, 0x04, 0xF0, 0x01, 0x89, 0x74, 0x42, 0x04, 0x90, +0x01, 0xC4, 0xF0, 0x74, 0x60, 0xA3, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xF0, 0x90, 0x90, 0xFE, +0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x22, 0xF0, 0x90, 0x91, 0x09, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x22, +0xE0, 0xFF, 0xC4, 0x13, 0x13, 0x13, 0x54, 0x01, 0x22, 0x90, 0x92, 0xD3, 0xEF, 0xF0, 0x90, 0x8D, +0x07, 0xE0, 0x64, 0x02, 0x70, 0x22, 0x90, 0x92, 0xD3, 0xE0, 0xFD, 0x64, 0x01, 0x70, 0x34, 0x12, +0x5F, 0xDA, 0x90, 0x8E, 0xC9, 0xE0, 0x71, 0x02, 0x30, 0xE0, 0x09, 0x90, 0x01, 0x4D, 0xE0, 0x64, +0x80, 0xF0, 0x80, 0x1F, 0xAF, 0x05, 0x80, 0x19, 0x90, 0x01, 0x00, 0x74, 0xFF, 0xF0, 0x7F, 0x64, +0x7E, 0x00, 0x12, 0x3A, 0xF7, 0x90, 0x06, 0x90, 0xE0, 0x44, 0x01, 0xF0, 0x90, 0x92, 0xD3, 0xE0, +0xFF, 0x71, 0x5F, 0x12, 0x8A, 0x39, 0xF0, 0x90, 0x8E, 0xC5, 0xE0, 0x54, 0xBF, 0xF0, 0x22, 0xAD, +0x07, 0x90, 0x8E, 0xCA, 0xE0, 0x75, 0xF0, 0x40, 0xA4, 0xFF, 0x90, 0x92, 0xAF, 0xE5, 0xF0, 0xF0, +0xA3, 0xEF, 0xF0, 0xE4, 0xA3, 0xF0, 0x90, 0x8E, 0xCB, 0xE0, 0xC3, 0x13, 0x54, 0x7F, 0x90, 0x92, +0xB2, 0xF0, 0xED, 0x64, 0x01, 0x70, 0x68, 0x90, 0x92, 0xAF, 0xE0, 0x70, 0x02, 0xA3, 0xE0, 0x60, +0x0B, 0x90, 0x92, 0xAF, 0x74, 0xFF, 0x75, 0xF0, 0xD0, 0x12, 0x46, 0xD6, 0x91, 0xDA, 0x13, 0x54, +0x07, 0x7D, 0x00, 0x20, 0xE0, 0x02, 0x7D, 0x01, 0x71, 0xF4, 0x91, 0xDA, 0x71, 0xF0, 0x90, 0x8E, +0xCB, 0xE0, 0x30, 0xE0, 0x3A, 0x91, 0xCF, 0x13, 0x54, 0x07, 0x7D, 0x00, 0x20, 0xE0, 0x02, 0x7D, +0x01, 0x71, 0xF4, 0xE4, 0x90, 0x92, 0xB1, 0xF0, 0x90, 0x92, 0xB2, 0xE0, 0xFF, 0x90, 0x92, 0xB1, +0xE0, 0xC3, 0x9F, 0x50, 0x1A, 0x91, 0xCF, 0x71, 0xF0, 0x91, 0xCF, 0x13, 0x54, 0x07, 0x7D, 0x00, +0x20, 0xE0, 0x02, 0x7D, 0x01, 0x71, 0xF4, 0x90, 0x92, 0xB1, 0xE0, 0x04, 0xF0, 0x80, 0xD9, 0x22, +0x13, 0x54, 0x01, 0xFD, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x92, 0xCC, 0xED, 0xF0, +0x90, 0x92, 0xCB, 0xEF, 0xF0, 0xD3, 0x94, 0x07, 0x50, 0x4C, 0x91, 0xC7, 0x80, 0x02, 0xC3, 0x33, +0xD8, 0xFC, 0xF4, 0xFF, 0x90, 0x00, 0x47, 0xE0, 0x5F, 0xFD, 0x7F, 0x47, 0x91, 0xC1, 0x80, 0x02, +0xC3, 0x33, 0xD8, 0xFC, 0xFF, 0x90, 0x00, 0x46, 0xE0, 0x4F, 0xFD, 0x7F, 0x46, 0x12, 0x9E, 0x3F, +0x60, 0x10, 0x91, 0xC4, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0xFF, 0x90, 0x00, 0x45, 0xE0, 0x4F, +0x80, 0x0F, 0x91, 0xC4, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0xF4, 0xFF, 0x90, 0x00, 0x45, 0xE0, +0x5F, 0xFD, 0x7F, 0x45, 0x80, 0x63, 0x90, 0x92, 0xCB, 0xE0, 0x24, 0xF8, 0xF0, 0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xD1, 0x89, 0x54, 0x10, 0xFD, 0xEF, 0x54, 0xEF, 0xD1, 0x73, +0x12, 0x9D, 0xE1, 0xD1, 0x89, 0x54, 0x40, 0xFD, 0xEF, 0x54, 0xBF, 0xD1, 0x73, 0x54, 0x80, 0xFE, +0xEF, 0x54, 0x7F, 0x12, 0x4E, 0xCC, 0x54, 0x80, 0xFF, 0x90, 0x8E, 0xC9, 0xE0, 0x54, 0x7F, 0x4F, +0xF0, 0x12, 0x26, 0x1E, 0x13, 0x13, 0x54, 0x3F, 0x30, 0xE0, 0x07, 0x90, 0x06, 0x90, 0xE0, 0x44, +0x04, 0xF0, 0xF1, 0x3A, 0x12, 0x26, 0x1E, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x30, 0xE0, 0x07, 0x90, +0x06, 0x90, 0xE0, 0x44, 0x08, 0xF0, 0x90, 0x8D, 0x07, 0xE0, 0xB4, 0x02, 0x09, 0x90, 0x8E, 0xC9, +0xE0, 0x71, 0x02, 0x20, 0xE0, 0x35, 0x12, 0x4E, 0xCE, 0x54, 0x7F, 0xFF, 0x90, 0x8E, 0xC9, 0xE0, +0x54, 0x80, 0x12, 0x4F, 0xEF, 0x90, 0x8E, 0xCA, 0x12, 0x4F, 0xAD, 0xFF, 0x54, 0x01, 0xFE, 0x90, +0x8E, 0xCB, 0x12, 0x89, 0xB7, 0x54, 0xFE, 0xFF, 0xEE, 0x54, 0x01, 0x4F, 0xF0, 0x91, 0xDA, 0x13, +0x54, 0x07, 0x7D, 0x00, 0x20, 0xE0, 0x02, 0x7D, 0x01, 0x71, 0xF4, 0x90, 0x8D, 0x07, 0xE0, 0xB4, +0x01, 0x07, 0x90, 0xFE, 0x10, 0xE0, 0x44, 0x04, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0x90, +0xFB, 0x12, 0x47, 0x5F, 0x90, 0x90, 0xFA, 0xEF, 0xF0, 0x12, 0x47, 0x68, 0x66, 0x06, 0x00, 0x66, +0x0B, 0x01, 0x66, 0x10, 0x02, 0x66, 0x15, 0x03, 0x66, 0x1A, 0x04, 0x66, 0x1F, 0x12, 0x66, 0x24, +0x14, 0x66, 0x29, 0x20, 0x66, 0x2D, 0x21, 0x66, 0x32, 0x23, 0x66, 0x37, 0x25, 0x66, 0x3C, 0x27, +0x66, 0x45, 0x80, 0x66, 0x41, 0x81, 0x66, 0x49, 0x82, 0x66, 0x4E, 0x83, 0x66, 0x53, 0x84, 0x66, +0x58, 0x88, 0x00, 0x00, 0x66, 0x5D, 0xD1, 0x6D, 0x02, 0x80, 0x0F, 0xD1, 0x6D, 0x02, 0x87, 0xDC, +0xD1, 0x6D, 0x02, 0x89, 0x20, 0xD1, 0x6D, 0x02, 0x89, 0xBF, 0xD1, 0x6D, 0x02, 0x89, 0xEC, 0xD1, +0x6D, 0x02, 0x89, 0x5D, 0xD1, 0x6D, 0x02, 0x89, 0x71, 0xD1, 0x6D, 0xE1, 0x40, 0xD1, 0x6D, 0x02, +0x4F, 0xC8, 0xD1, 0x6D, 0x02, 0x89, 0x80, 0xD1, 0x6D, 0x02, 0x89, 0x88, 0xD1, 0x6D, 0x02, 0x89, +0x90, 0xD1, 0x6D, 0x80, 0x4B, 0xD1, 0x6D, 0x81, 0xE8, 0xD1, 0x6D, 0x02, 0x97, 0xD5, 0xD1, 0x6D, +0x02, 0x81, 0x56, 0xD1, 0x6D, 0x02, 0x81, 0x93, 0xD1, 0x6D, 0x02, 0x97, 0xEB, 0x90, 0x01, 0xC0, +0xE0, 0x44, 0x01, 0xF0, 0x90, 0x90, 0xFA, 0xE0, 0x90, 0x01, 0xC2, 0xF0, 0x22, 0x90, 0x90, 0xFB, +0x02, 0x47, 0x56, 0x4D, 0xFF, 0x90, 0x8E, 0xC8, 0xF0, 0xEE, 0x22, 0xE0, 0x54, 0xFE, 0x4E, 0xFE, +0xF0, 0xEF, 0x54, 0x02, 0xFF, 0xEE, 0x54, 0xFD, 0x4F, 0xFF, 0xF0, 0x12, 0x26, 0x1E, 0x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, 0x54, 0x7F, 0x90, 0x8E, 0x12, 0xF0, 0xEF, 0x71, 0x02, +0xA3, 0x12, 0x4E, 0xCD, 0xFF, 0x54, 0xF0, 0xC4, 0x54, 0x0F, 0xFE, 0x90, 0x8E, 0x10, 0xE0, 0x54, +0xF0, 0x4E, 0x12, 0x4F, 0xAD, 0x54, 0x01, 0x25, 0xE0, 0xFE, 0x90, 0x8E, 0x0E, 0xE0, 0x54, 0xFD, +0x4E, 0xF0, 0xEF, 0x54, 0x0F, 0xC4, 0x54, 0xF0, 0xFF, 0x12, 0x74, 0x1B, 0x12, 0x4F, 0xEF, 0x90, +0x8E, 0x11, 0x12, 0x81, 0x4F, 0x30, 0xE0, 0x4F, 0xC3, 0x13, 0x54, 0x07, 0xFF, 0xC3, 0x94, 0x04, +0x90, 0x8E, 0x25, 0x50, 0x04, 0xEF, 0xF0, 0x80, 0x26, 0x74, 0x03, 0xF0, 0xF1, 0x3A, 0xE9, 0x24, +0x06, 0x12, 0x9D, 0xF8, 0xFF, 0x74, 0x03, 0x24, 0xFD, 0xFE, 0xEF, 0xC4, 0x54, 0x0F, 0xFD, 0xEF, +0x54, 0x0F, 0xFF, 0xED, 0x2E, 0x54, 0x0F, 0xFE, 0xC4, 0x54, 0xF0, 0x4F, 0x12, 0x26, 0x64, 0xF1, +0x3A, 0x12, 0x81, 0x50, 0xC4, 0x54, 0x0F, 0xFF, 0xC3, 0x94, 0x04, 0x90, 0x8E, 0x1A, 0x50, 0x05, +0x74, 0x04, 0xF0, 0x80, 0x02, 0xEF, 0xF0, 0xF1, 0x3A, 0x12, 0x80, 0x4D, 0xFD, 0x7F, 0x02, 0x12, +0x51, 0x10, 0xF1, 0x3A, 0x90, 0x91, 0x01, 0x12, 0x47, 0x5F, 0x12, 0x72, 0xD2, 0x90, 0x8E, 0x12, +0xE0, 0xFF, 0x12, 0x6F, 0x94, 0x90, 0x8E, 0x12, 0xE0, 0x60, 0x12, 0x90, 0x91, 0x01, 0x12, 0x47, +0x56, 0x12, 0x4E, 0xCE, 0x54, 0x0F, 0xFF, 0x12, 0x4F, 0xF1, 0xFD, 0x11, 0x0E, 0x22, 0xEF, 0x24, +0xFE, 0x60, 0x0B, 0x04, 0x70, 0x24, 0x90, 0x8E, 0x18, 0x74, 0x02, 0xF0, 0x80, 0x13, 0xED, 0x70, +0x06, 0x90, 0x8E, 0xBD, 0xE0, 0x80, 0x02, 0xED, 0x14, 0x90, 0x8E, 0x18, 0xF0, 0x90, 0x8E, 0x18, +0xE0, 0xA3, 0xF0, 0x90, 0x8E, 0x0F, 0xE0, 0x44, 0x08, 0xF0, 0x22, 0xF0, 0xE4, 0x90, 0x92, 0x7E, +0xF0, 0x90, 0x8E, 0xBB, 0xE0, 0x90, 0x92, 0x7F, 0xF0, 0xE4, 0xFB, 0xFD, 0x7F, 0x54, 0x7E, 0x01, +0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x92, 0x7A, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0x90, +0x92, 0x7E, 0xE0, 0xF5, 0x3B, 0xA3, 0xE0, 0xF5, 0x3C, 0x12, 0x34, 0x8C, 0x90, 0x92, 0x7A, 0x12, +0x8A, 0xD8, 0xA3, 0xA3, 0xA3, 0x74, 0x05, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xE4, 0x90, 0x92, +0x22, 0xF0, 0x90, 0x8E, 0x12, 0xE0, 0x60, 0x6B, 0xF1, 0x25, 0x64, 0x01, 0x70, 0x65, 0x12, 0x9E, +0x27, 0x11, 0xF4, 0x12, 0x47, 0x14, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0x05, +0x62, 0x31, 0x0E, 0x78, 0x10, 0x12, 0x27, 0x35, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, +0x12, 0x47, 0x14, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0xA3, 0x31, 0x0E, 0x78, 0x18, +0x12, 0x27, 0x35, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0x12, 0x9D, 0x84, 0x90, 0x92, +0x22, 0x74, 0x01, 0xF0, 0xE4, 0x90, 0x8E, 0x19, 0xF0, 0x04, 0x60, 0x17, 0x12, 0x9E, 0x2F, 0xE4, +0x90, 0x92, 0x7E, 0xF0, 0x90, 0x8E, 0x1A, 0x11, 0x44, 0x90, 0x8E, 0x15, 0xE0, 0x20, 0xE2, 0x03, +0x12, 0x51, 0x9D, 0x22, 0xF0, 0x90, 0x05, 0x61, 0xE0, 0xFF, 0xE4, 0xFC, 0xFD, 0xFE, 0x78, 0x08, +0x12, 0x27, 0x35, 0xA8, 0x04, 0xA9, 0x05, 0xAA, 0x06, 0xAB, 0x07, 0x90, 0x05, 0x60, 0xE0, 0xFF, +0xE4, 0xFC, 0xFD, 0xFE, 0x22, 0xE4, 0xF5, 0x14, 0x90, 0x8E, 0x12, 0xE0, 0x70, 0x02, 0x21, 0xBD, +0xF1, 0x25, 0x64, 0x01, 0x60, 0x02, 0x21, 0xBD, 0x11, 0xF5, 0x12, 0x47, 0x14, 0xC0, 0x04, 0xC0, +0x05, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0x05, 0x62, 0x31, 0x0E, 0x78, 0x10, 0x12, 0x27, 0x35, 0xD0, +0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0x12, 0x47, 0x14, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, +0xC0, 0x07, 0xA3, 0x31, 0x0E, 0x78, 0x18, 0x12, 0x27, 0x35, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, +0xD0, 0x00, 0x12, 0x9D, 0x84, 0x12, 0x9E, 0x1F, 0x60, 0x22, 0x24, 0xFE, 0x60, 0x03, 0x04, 0x70, +0x1E, 0x90, 0x8E, 0x19, 0xE0, 0x14, 0xF0, 0xE0, 0xFF, 0x60, 0x06, 0x90, 0x8E, 0x1B, 0xE0, 0x60, +0x0E, 0xEF, 0x70, 0x08, 0x90, 0x8E, 0x18, 0xE0, 0xA3, 0xF0, 0x80, 0x00, 0x75, 0x14, 0x01, 0xE5, +0x14, 0x60, 0x2A, 0x12, 0x9E, 0x2F, 0x90, 0x8E, 0x1B, 0xE0, 0x60, 0x03, 0xB4, 0x01, 0x04, 0xF1, +0x61, 0x80, 0x08, 0xF1, 0x61, 0x75, 0xF0, 0x03, 0xA4, 0x24, 0xFE, 0xFF, 0x90, 0x8E, 0x1A, 0xE0, +0x2F, 0x11, 0x45, 0x90, 0x8E, 0x15, 0xE0, 0x20, 0xE2, 0x03, 0x12, 0x51, 0x9D, 0x22, 0xD3, 0x10, +0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x92, 0xAC, 0xED, 0xF0, 0xA3, 0xEB, 0xF0, 0x90, 0x92, 0xAB, +0xEF, 0xF0, 0x90, 0x92, 0xAE, 0xE0, 0xFD, 0x12, 0x93, 0xB8, 0x90, 0x92, 0xAB, 0xE0, 0xC3, 0x94, +0x0E, 0x50, 0x3F, 0x90, 0x92, 0x3B, 0x12, 0x27, 0x54, 0x1F, 0xFE, 0x00, 0x00, 0x90, 0x92, 0x3F, +0x12, 0x27, 0x54, 0x12, 0xD4, 0x00, 0x00, 0xF1, 0x1E, 0x90, 0x92, 0x29, 0x12, 0x27, 0x54, 0x00, +0x07, 0x03, 0x00, 0x90, 0x92, 0x2D, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x91, 0x8D, 0x12, +0x27, 0x54, 0x00, 0x07, 0x03, 0x00, 0x90, 0x92, 0x2D, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, +0x61, 0x41, 0x12, 0x9D, 0xA0, 0x50, 0x1B, 0xEF, 0x94, 0x30, 0x50, 0x16, 0x90, 0x92, 0x3B, 0x12, +0x27, 0x54, 0x1F, 0xFE, 0x00, 0x00, 0x90, 0x92, 0x3F, 0x12, 0x27, 0x54, 0x09, 0x28, 0x00, 0x00, +0x80, 0x65, 0x90, 0x92, 0xAB, 0xE0, 0xFF, 0x74, 0x32, 0xD3, 0x9F, 0x50, 0x1B, 0xEF, 0x94, 0x40, +0x50, 0x16, 0x90, 0x92, 0x3B, 0x12, 0x27, 0x54, 0x1F, 0xFE, 0x00, 0x00, 0x90, 0x92, 0x3F, 0x12, +0x27, 0x54, 0x08, 0xA6, 0x00, 0x00, 0x80, 0x3F, 0x12, 0x9D, 0x96, 0x50, 0x1B, 0xEF, 0x94, 0x74, +0x50, 0x16, 0x90, 0x92, 0x3B, 0x12, 0x27, 0x54, 0x1F, 0xFE, 0x00, 0x00, 0x90, 0x92, 0x3F, 0x12, +0x27, 0x54, 0x08, 0xA4, 0x00, 0x00, 0x80, 0x1F, 0x90, 0x92, 0xAB, 0xE0, 0xFF, 0x74, 0x76, 0xD3, +0x9F, 0x50, 0x16, 0x90, 0x92, 0x3B, 0x12, 0x27, 0x54, 0x1F, 0xFE, 0x00, 0x00, 0x90, 0x92, 0x3F, +0x12, 0x27, 0x54, 0x08, 0x24, 0x00, 0x00, 0xF1, 0x1E, 0x12, 0x9D, 0xA0, 0x50, 0x2E, 0xEF, 0x94, +0x40, 0x50, 0x29, 0x90, 0x92, 0x29, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0x00, 0x90, 0x92, 0x2D, +0x12, 0x27, 0x54, 0x00, 0x01, 0x01, 0x00, 0x91, 0x8D, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0x00, +0x90, 0x92, 0x2D, 0x12, 0x27, 0x54, 0x00, 0x01, 0x01, 0x00, 0x80, 0x65, 0x12, 0x9D, 0x96, 0x50, +0x2E, 0xEF, 0x94, 0x8C, 0x50, 0x29, 0x90, 0x92, 0x29, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0x00, +0x90, 0x92, 0x2D, 0x12, 0x27, 0x54, 0x00, 0x03, 0x01, 0x00, 0x91, 0x8D, 0x12, 0x27, 0x54, 0x00, +0x07, 0x03, 0x00, 0x90, 0x92, 0x2D, 0x12, 0x27, 0x54, 0x00, 0x03, 0x01, 0x00, 0x80, 0x32, 0x90, +0x92, 0xAB, 0xE0, 0xFF, 0x74, 0x8C, 0xC3, 0x9F, 0x50, 0x29, 0x90, 0x92, 0x29, 0x12, 0x27, 0x54, +0x00, 0x07, 0x03, 0x00, 0x90, 0x92, 0x2D, 0x12, 0x27, 0x54, 0x00, 0x05, 0x01, 0x00, 0x91, 0x8D, +0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0x00, 0x90, 0x92, 0x2D, 0x12, 0x27, 0x54, 0x00, 0x05, 0x01, +0x00, 0x91, 0x0E, 0x90, 0x92, 0xAB, 0xE0, 0xFF, 0xA3, 0xE0, 0xFD, 0x12, 0x92, 0x87, 0x90, 0x92, +0xAC, 0xE0, 0x64, 0x02, 0x70, 0x51, 0x90, 0x92, 0xAB, 0xE0, 0xFF, 0xD3, 0x94, 0x30, 0x50, 0x05, +0x75, 0x18, 0x2A, 0x80, 0x5E, 0xEF, 0xD3, 0x94, 0x40, 0x50, 0x05, 0x75, 0x18, 0x3A, 0x80, 0x53, +0xEF, 0xD3, 0x94, 0x70, 0x50, 0x05, 0x75, 0x18, 0x6A, 0x80, 0x48, 0xEF, 0xD3, 0x94, 0x80, 0x50, +0x05, 0x75, 0x18, 0x7A, 0x80, 0x3D, 0xEF, 0xD3, 0x94, 0x90, 0x50, 0x05, 0x75, 0x18, 0x8A, 0x80, +0x32, 0xEF, 0xD3, 0x94, 0xA1, 0x50, 0x05, 0x75, 0x18, 0x9B, 0x80, 0x27, 0xEF, 0xD3, 0x94, 0xB1, +0x50, 0x21, 0x75, 0x18, 0xAB, 0x80, 0x1C, 0x90, 0x92, 0xAC, 0xE0, 0x64, 0x01, 0x70, 0x31, 0xA3, +0xE0, 0x90, 0x92, 0xAB, 0xB4, 0x01, 0x07, 0xE0, 0x24, 0x02, 0xF5, 0x18, 0x80, 0x05, 0xE0, 0x24, +0xFE, 0xF5, 0x18, 0x90, 0x92, 0x29, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0xFF, 0xAF, 0x18, 0xE4, +0xFC, 0xFD, 0xFE, 0x91, 0x87, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0xFF, 0xAF, 0x18, 0x80, 0x1D, +0x90, 0x92, 0x29, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0xFF, 0x90, 0x92, 0xAB, 0x31, 0x0E, 0x91, +0x87, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0xFF, 0x90, 0x92, 0xAB, 0xE0, 0xFF, 0xE4, 0xFC, 0xFD, +0xFE, 0x90, 0x92, 0x2D, 0x12, 0x27, 0x48, 0x91, 0x0E, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x7D, 0x18, +0x7C, 0x00, 0x7F, 0x01, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x92, 0x27, 0xEC, 0xF0, +0xA3, 0xED, 0xF0, 0x90, 0x92, 0x26, 0xEF, 0xF0, 0xA3, 0xA3, 0xE0, 0xFD, 0x12, 0x78, 0xC1, 0x90, +0x92, 0x31, 0x12, 0x27, 0x48, 0x90, 0x92, 0x29, 0x12, 0x87, 0x89, 0x90, 0x92, 0x31, 0xB1, 0xCC, +0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0x92, 0x29, 0x12, 0x47, 0x32, 0x90, 0x92, +0x2D, 0xB1, 0xCC, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0x12, 0x47, 0x14, 0x90, 0x92, +0x35, 0x12, 0x27, 0x48, 0x90, 0x92, 0x27, 0xA3, 0xE0, 0xFD, 0xC0, 0x05, 0x90, 0x92, 0x35, 0x12, +0x47, 0x32, 0x90, 0xAC, 0x96, 0x12, 0x27, 0x48, 0x90, 0x92, 0x26, 0xE0, 0xFF, 0xD0, 0x05, 0x12, +0x39, 0xBA, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0x92, 0x2D, 0x12, 0x27, 0x48, 0x7D, 0x18, 0x7C, +0x00, 0xE4, 0xFF, 0x91, 0x14, 0x90, 0x92, 0x29, 0x22, 0xE4, 0x90, 0x92, 0x13, 0xF0, 0xA3, 0xF0, +0xA3, 0x11, 0xF4, 0x12, 0x47, 0x14, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0x05, +0x62, 0x31, 0x0E, 0x78, 0x10, 0x12, 0x27, 0x35, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, +0x12, 0x47, 0x14, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0xA3, 0x31, 0x0E, 0x78, 0x18, +0x12, 0x27, 0x35, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0x12, 0x47, 0x14, 0x90, 0x8E, +0x4B, 0x12, 0x27, 0x48, 0x90, 0x8E, 0x4F, 0x12, 0x47, 0x32, 0x90, 0x8E, 0x4B, 0x12, 0x47, 0x3E, +0xC3, 0x12, 0x47, 0x21, 0x40, 0x39, 0x90, 0x8E, 0x0E, 0xE0, 0x90, 0x8E, 0x4F, 0x30, 0xE0, 0x0D, +0x12, 0x9C, 0xAB, 0xFF, 0x90, 0x8E, 0x48, 0xE0, 0x2F, 0x24, 0x0C, 0x80, 0x05, 0x12, 0x9C, 0xAB, +0x24, 0x08, 0x90, 0x92, 0x14, 0xF0, 0x90, 0x92, 0x14, 0xE0, 0xFF, 0xC3, 0x94, 0x19, 0x50, 0x0F, +0x74, 0x2F, 0x2F, 0x12, 0x99, 0x44, 0xE0, 0x04, 0xF0, 0x90, 0x8E, 0x28, 0xE0, 0x04, 0xF0, 0x90, +0x8E, 0x28, 0xE0, 0xC3, 0x94, 0x64, 0x50, 0x02, 0xA1, 0xCB, 0x12, 0x9D, 0x7A, 0x12, 0x9D, 0xBE, +0x50, 0x19, 0x12, 0x9C, 0xE4, 0x94, 0x05, 0x40, 0x0A, 0x90, 0x92, 0x13, 0xE0, 0x90, 0x92, 0x16, +0xF0, 0x80, 0x08, 0x90, 0x92, 0x13, 0xE0, 0x04, 0xF0, 0x80, 0xE2, 0x12, 0x9D, 0x7A, 0x12, 0x9D, +0xBE, 0x50, 0x19, 0x12, 0x9C, 0xE4, 0x94, 0x5F, 0x40, 0x0A, 0x90, 0x92, 0x13, 0xE0, 0x90, 0x92, +0x17, 0xF0, 0x80, 0x08, 0x90, 0x92, 0x13, 0xE0, 0x04, 0xF0, 0x80, 0xE2, 0x90, 0x92, 0x16, 0xE0, +0x90, 0x8E, 0x2D, 0xF0, 0x90, 0x92, 0x17, 0xE0, 0x90, 0x8E, 0x2E, 0x12, 0x9E, 0x17, 0x94, 0x0A, +0x40, 0x0A, 0xEF, 0x24, 0xF6, 0x90, 0x8E, 0x25, 0xF0, 0xE4, 0x80, 0x0A, 0xE4, 0x90, 0x8E, 0x25, +0x12, 0x9E, 0x17, 0x74, 0x0A, 0x9F, 0x90, 0x8E, 0x24, 0xF0, 0x90, 0x8E, 0x2D, 0xE0, 0xFF, 0xA3, +0xE0, 0xC3, 0x9F, 0x90, 0x8E, 0x2B, 0xF0, 0xC3, 0x94, 0x08, 0x50, 0x03, 0x74, 0x08, 0xF0, 0x12, +0x9D, 0x2D, 0xFB, 0x12, 0x7F, 0x46, 0xE4, 0xFF, 0x12, 0x99, 0x1B, 0x22, 0x12, 0x47, 0x3E, 0x02, +0x47, 0x07, 0x7F, 0xAC, 0x7E, 0x08, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x92, 0x39, +0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0x12, 0x36, 0xCE, 0x90, 0x92, 0x43, 0x12, 0x27, 0x48, 0x90, 0x92, +0x3B, 0x12, 0x87, 0x89, 0x90, 0x92, 0x43, 0xB1, 0xCC, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, +0x07, 0x90, 0x92, 0x3B, 0x12, 0x47, 0x32, 0x90, 0x92, 0x3F, 0xB1, 0xCC, 0xD0, 0x03, 0xD0, 0x02, +0xD0, 0x01, 0xD0, 0x00, 0x12, 0x47, 0x14, 0x90, 0x92, 0x47, 0x12, 0x27, 0x48, 0x90, 0x92, 0x47, +0x12, 0x56, 0xC6, 0x90, 0x92, 0x39, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x12, 0x37, 0x5D, 0xD0, 0xD0, +0x92, 0xAF, 0x22, 0x90, 0x92, 0xBD, 0xED, 0xF0, 0x90, 0x92, 0xBC, 0xEF, 0xF0, 0x70, 0x63, 0x90, +0x92, 0x3B, 0x12, 0x27, 0x54, 0x30, 0x00, 0x00, 0x00, 0x90, 0x92, 0x3F, 0x12, 0x27, 0x54, 0x00, +0x00, 0x00, 0x00, 0x74, 0x08, 0xFF, 0xFE, 0xF1, 0x12, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x0E, +0x90, 0x92, 0x3F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x08, 0x7F, 0x30, 0x7E, 0x08, 0xF1, 0x12, +0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x03, 0x90, 0x92, 0x3F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, +0x01, 0x12, 0x93, 0xF7, 0x90, 0x92, 0x3B, 0x12, 0x27, 0x54, 0x30, 0x00, 0x00, 0x00, 0x90, 0x92, +0x3F, 0x12, 0x27, 0x54, 0x30, 0x00, 0x00, 0x00, 0xF1, 0x18, 0x90, 0x04, 0x54, 0xE0, 0x54, 0x7F, +0xE1, 0x6B, 0x90, 0x92, 0xBC, 0xE0, 0x64, 0x01, 0x70, 0x63, 0x90, 0x04, 0x54, 0xE0, 0x44, 0x80, +0xF1, 0x6B, 0x90, 0x92, 0x3B, 0x12, 0x27, 0x54, 0x30, 0x00, 0x00, 0x00, 0x90, 0x92, 0x3F, 0x12, +0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x74, 0x08, 0xFF, 0xFE, 0xF1, 0x12, 0x12, 0x27, 0x54, 0x00, +0x00, 0x00, 0x0E, 0x90, 0x92, 0x3F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x06, 0x7F, 0x30, 0x7E, +0x08, 0xF1, 0x12, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x03, 0x90, 0x92, 0x3F, 0x12, 0x27, 0x54, +0x00, 0x00, 0x00, 0x02, 0x12, 0x93, 0xF7, 0x90, 0x92, 0x3B, 0x12, 0x27, 0x54, 0x30, 0x00, 0x00, +0x00, 0x90, 0x92, 0x3F, 0x12, 0x27, 0x54, 0x20, 0x00, 0x00, 0x00, 0xF1, 0x18, 0x22, 0x7F, 0xB4, +0x7E, 0x0C, 0xB1, 0xD6, 0x90, 0x92, 0x3B, 0x22, 0x74, 0x08, 0xFF, 0xFE, 0xA1, 0xD6, 0x7F, 0x60, +0x7E, 0x08, 0xA1, 0xD6, 0xF0, 0xE4, 0xFF, 0xF1, 0x2B, 0xEF, 0x22, 0x12, 0x89, 0x03, 0x12, 0x88, +0x91, 0xE0, 0xFD, 0x7C, 0x00, 0x12, 0x7D, 0xDB, 0x80, 0x05, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, +0xF9, 0xFF, 0xEE, 0x5C, 0xFE, 0xEF, 0x5D, 0x4E, 0x7F, 0x00, 0x60, 0x02, 0x7F, 0x01, 0x22, 0xF1, +0x25, 0x64, 0x01, 0x70, 0x0B, 0x90, 0x8E, 0x12, 0xE0, 0x60, 0x05, 0x12, 0x9C, 0xC4, 0x11, 0x3B, +0x22, 0xE4, 0x90, 0x92, 0x7E, 0xF0, 0x90, 0x8E, 0x1B, 0xE0, 0x22, 0x90, 0x92, 0xBE, 0xF0, 0xE0, +0x90, 0x04, 0x54, 0xF0, 0x22, 0xF1, 0x25, 0x64, 0x01, 0x70, 0x18, 0x90, 0x8E, 0x12, 0xE0, 0x60, +0x12, 0x12, 0x9C, 0xC4, 0xF0, 0x90, 0x8E, 0x0E, 0xE0, 0x12, 0x73, 0x8C, 0x54, 0x07, 0x70, 0x03, +0x12, 0x77, 0x97, 0x22, 0xEF, 0x70, 0x36, 0x7D, 0x78, 0x7F, 0x02, 0x12, 0x71, 0x96, 0x7D, 0x02, +0x7F, 0x03, 0x12, 0x71, 0x96, 0x7D, 0xC8, 0x7F, 0x02, 0x12, 0x72, 0xB3, 0x12, 0x9C, 0xC4, 0xF1, +0x24, 0x70, 0x08, 0x12, 0x89, 0x0F, 0x54, 0x7F, 0xF0, 0x80, 0x07, 0x7D, 0x01, 0x7F, 0x0C, 0x12, +0x51, 0xA1, 0x12, 0x7F, 0xB9, 0x90, 0x06, 0x0A, 0xE0, 0x54, 0xF8, 0xF0, 0x22, 0x90, 0x01, 0x36, +0x74, 0x78, 0xF0, 0xA3, 0x74, 0x02, 0xF0, 0x7D, 0x78, 0xFF, 0x12, 0x72, 0x6E, 0x7D, 0x02, 0x7F, +0x03, 0x12, 0x72, 0x6E, 0x90, 0x06, 0x0A, 0xE0, 0x44, 0x07, 0x12, 0x7F, 0xD3, 0xE4, 0xFF, 0xF1, +0x2B, 0xBF, 0x01, 0x11, 0x12, 0x70, 0x08, 0x90, 0x8E, 0x15, 0xE0, 0x20, 0xE2, 0x09, 0x7D, 0x01, +0x7F, 0x04, 0x02, 0x51, 0xA1, 0x71, 0x52, 0x22, 0x90, 0x8E, 0x0F, 0xE0, 0x54, 0xFB, 0xF0, 0x22, +0x11, 0xAA, 0x13, 0x54, 0x1F, 0x30, 0xE0, 0x0B, 0xEF, 0xC4, 0x13, 0x13, 0x54, 0x03, 0x30, 0xE0, +0x02, 0x11, 0xA4, 0x90, 0x8E, 0x0E, 0xE0, 0xFF, 0x13, 0x13, 0x54, 0x3F, 0x30, 0xE0, 0x09, 0xEF, +0x71, 0x8C, 0x54, 0x07, 0x70, 0x43, 0x80, 0x3F, 0x90, 0x8E, 0x1B, 0xE0, 0x04, 0xF0, 0x90, 0x8E, +0x16, 0xE0, 0x54, 0xEF, 0xF0, 0x71, 0x97, 0x40, 0x2E, 0x12, 0x6F, 0x25, 0x64, 0x01, 0x70, 0x29, +0x91, 0x1B, 0x70, 0x04, 0x11, 0x7A, 0x80, 0xB0, 0x11, 0x7A, 0x90, 0x8E, 0x1C, 0xE0, 0x04, 0xF0, +0xE0, 0xD3, 0x94, 0x02, 0x40, 0x09, 0x11, 0x08, 0xE4, 0x90, 0x8E, 0x1C, 0xF0, 0x80, 0x02, 0x71, +0xAF, 0xE4, 0x90, 0x8E, 0x1B, 0xF0, 0x22, 0xF1, 0x97, 0x22, 0x71, 0x97, 0x40, 0x25, 0x90, 0x8E, +0x2C, 0xE0, 0x04, 0xF0, 0xE0, 0xFF, 0x94, 0x04, 0x50, 0x19, 0x90, 0x8E, 0x24, 0xEF, 0xF0, 0x25, +0xE0, 0x24, 0x08, 0x90, 0x8E, 0x2B, 0xF0, 0xFB, 0x90, 0x8E, 0x24, 0xE0, 0xFF, 0xA3, 0xE0, 0xFD, +0x12, 0x7F, 0x46, 0x22, 0x7D, 0x02, 0x7F, 0x02, 0x21, 0x96, 0x90, 0x8E, 0x0F, 0xE0, 0xFF, 0x13, +0x13, 0x22, 0x71, 0xA3, 0x78, 0x02, 0xCE, 0xC3, 0x13, 0xCE, 0x13, 0xD8, 0xF9, 0xFF, 0xF1, 0x87, +0x12, 0x6F, 0x24, 0x64, 0x01, 0x60, 0x02, 0x21, 0x71, 0x90, 0x8E, 0x12, 0xE0, 0x70, 0x02, 0x21, +0x71, 0x31, 0x83, 0x64, 0x01, 0x70, 0x22, 0x90, 0x06, 0xAB, 0xE0, 0x90, 0x8E, 0x19, 0xF0, 0x90, +0x06, 0xAA, 0xE0, 0x90, 0x8E, 0x18, 0xF0, 0xA3, 0xE0, 0xFF, 0x70, 0x08, 0x90, 0x8E, 0x18, 0xE0, +0xFE, 0xFF, 0x80, 0x00, 0x90, 0x8E, 0x19, 0xEF, 0xF0, 0x12, 0x6C, 0x99, 0xE4, 0x90, 0x8E, 0x1B, +0x12, 0x7F, 0xD3, 0x12, 0x9C, 0xC4, 0x71, 0x8E, 0x54, 0xEF, 0xF0, 0x31, 0x83, 0x24, 0xFD, 0x50, +0x02, 0x80, 0x02, 0x71, 0xC0, 0x11, 0xAA, 0x13, 0x54, 0x1F, 0x30, 0xE0, 0x52, 0xEF, 0xC4, 0x13, +0x13, 0x54, 0x03, 0x20, 0xE0, 0x21, 0x31, 0x72, 0x6F, 0x70, 0x44, 0x90, 0x8E, 0x0F, 0xE0, 0x44, +0x40, 0xF0, 0x12, 0x9E, 0x27, 0x31, 0x7A, 0x7F, 0x03, 0x51, 0xCA, 0x31, 0x92, 0x11, 0xA4, 0x90, +0x8E, 0x19, 0xE0, 0x14, 0xF0, 0x80, 0x28, 0x12, 0x9E, 0x1F, 0x64, 0x01, 0x70, 0x21, 0x31, 0x72, +0xFE, 0x6F, 0x60, 0x1B, 0x90, 0x05, 0x73, 0xE0, 0xFF, 0xEE, 0x6F, 0x60, 0x12, 0x11, 0xAA, 0x54, +0x3F, 0x30, 0xE0, 0x0B, 0xEF, 0x54, 0xBF, 0x31, 0x7A, 0x7F, 0x03, 0x51, 0xB3, 0x51, 0x64, 0x71, +0x52, 0x22, 0x90, 0x8E, 0x18, 0xE0, 0xFF, 0xA3, 0xE0, 0x22, 0xF0, 0x90, 0x01, 0x3F, 0x74, 0x10, +0xF0, 0xFD, 0x22, 0x90, 0x8E, 0x10, 0xE0, 0xFF, 0xC4, 0x54, 0x0F, 0x22, 0x7D, 0x02, 0x7F, 0x02, +0x31, 0x96, 0x7D, 0x01, 0x7F, 0x02, 0x74, 0x5D, 0x71, 0x5A, 0xFE, 0xF6, 0x74, 0x30, 0x41, 0xBB, +0x90, 0x8E, 0x12, 0xE0, 0x60, 0x49, 0x90, 0x8E, 0x0E, 0xE0, 0x30, 0xE0, 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01, 0x7F, 0x02, 0x51, 0x6E, 0x7D, 0x02, 0x7F, 0x02, 0x74, 0x5D, +0x2F, 0xF8, 0xE6, 0x4D, 0xFE, 0xF6, 0x74, 0x30, 0x80, 0x41, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, +0xD0, 0xEF, 0x64, 0x01, 0x70, 0x1B, 0x90, 0x8E, 0xC3, 0xE0, 0x7D, 0x10, 0x7F, 0x03, 0x60, 0x08, +0x51, 0xB3, 0x51, 0xC6, 0x71, 0x83, 0x80, 0x04, 0x51, 0xB3, 0x31, 0x8C, 0x12, 0x55, 0xF7, 0x80, +0x0D, 0x51, 0xC6, 0x51, 0x6A, 0x7D, 0x01, 0x7F, 0x02, 0x51, 0x6E, 0x12, 0x57, 0xE2, 0xD0, 0xD0, +0x92, 0xAF, 0x22, 0x74, 0x65, 0x71, 0x5A, 0xFE, 0xF6, 0x74, 0x38, 0x2F, 0xF5, 0x82, 0xE4, 0x34, +0x01, 0xF5, 0x83, 0xEE, 0xF0, 0x22, 0x7D, 0x10, 0x7F, 0x03, 0x74, 0x65, 0x2F, 0xF8, 0xE6, 0x4D, +0x80, 0xE5, 0x90, 0x8E, 0x0E, 0xE0, 0x54, 0xFB, 0xF0, 0xE4, 0x90, 0x8E, 0x1B, 0xF0, 0xA3, 0xF0, +0x90, 0x8E, 0x16, 0xF0, 0x90, 0x8E, 0x0F, 0x12, 0x89, 0x18, 0x51, 0x64, 0x7D, 0x10, 0x7F, 0x03, +0x80, 0xC1, 0xEF, 0x60, 0x3F, 0x90, 0x90, 0xD4, 0xE0, 0xFF, 0x60, 0x02, 0xF1, 0xA1, 0x90, 0x01, +0xC7, 0xE4, 0x12, 0x83, 0x5E, 0x12, 0x9D, 0xF0, 0x90, 0x06, 0x09, 0xE0, 0x54, 0xFE, 0xF0, 0x7D, +0x35, 0x12, 0x56, 0x2D, 0x90, 0x02, 0x86, 0xE0, 0x44, 0x04, 0xF0, 0x12, 0x86, 0xDB, 0x71, 0x51, +0x12, 0x56, 0xCF, 0x12, 0x57, 0xDD, 0x12, 0x8E, 0xB7, 0x90, 0x01, 0x34, 0x74, 0x08, 0xF0, 0xFD, +0xE4, 0xFF, 0x41, 0x6E, 0x7D, 0x08, 0xE4, 0xFF, 0x31, 0x96, 0x90, 0x06, 0x90, 0xE0, 0x54, 0xF0, +0xF0, 0x90, 0x02, 0x86, 0xE0, 0x54, 0xFB, 0xF0, 0x12, 0x8F, 0x0B, 0x12, 0x4F, 0xF7, 0x02, 0x4E, +0x1A, 0x22, 0x90, 0x8E, 0x0F, 0xE0, 0x44, 0x04, 0xF0, 0x22, 0x2F, 0xF8, 0xE6, 0xFE, 0xED, 0xF4, +0x5E, 0x22, 0x12, 0x68, 0x7D, 0x51, 0x6A, 0x90, 0x8E, 0xC1, 0xE0, 0x30, 0xE0, 0x14, 0x71, 0x83, +0x90, 0x8E, 0xC4, 0xE0, 0x60, 0x05, 0x14, 0xF0, 0x02, 0x55, 0xF7, 0x12, 0x8A, 0x24, 0xE4, 0xFF, +0x51, 0x7A, 0x22, 0x90, 0x8E, 0xC3, 0xE0, 0x90, 0x05, 0x73, 0xF0, 0x22, 0x54, 0xFB, 0xF0, 0x90, +0x8E, 0x16, 0xE0, 0x54, 0xFD, 0xF0, 0x22, 0x90, 0x8E, 0xBA, 0xE0, 0xFF, 0x90, 0x8E, 0x1B, 0xE0, +0xD3, 0x9F, 0x22, 0x90, 0x05, 0x62, 0xE0, 0xFE, 0x90, 0x05, 0x61, 0xE0, 0xFD, 0xED, 0x22, 0x12, +0x97, 0xFB, 0x90, 0x8E, 0x15, 0xE0, 0x64, 0x0C, 0x60, 0x05, 0x12, 0x53, 0x6B, 0x91, 0xE2, 0x22, +0xE4, 0xF5, 0x14, 0x90, 0x06, 0xA9, 0xE0, 0xF5, 0x14, 0x54, 0xC0, 0x70, 0x07, 0x91, 0x13, 0x54, +0xFD, 0xF0, 0xE1, 0x97, 0xE5, 0x14, 0x30, 0xE6, 0x1D, 0x90, 0x8E, 0x12, 0xE0, 0x64, 0x01, 0x70, +0x17, 0x90, 0x8E, 0x16, 0xE0, 0x44, 0x01, 0xF0, 0x91, 0x1B, 0x64, 0x02, 0x60, 0x04, 0x91, 0x3B, +0x80, 0x06, 0x71, 0xAF, 0x80, 0x02, 0x91, 0x13, 0xE5, 0x14, 0x90, 0x8E, 0x16, 0x30, 0xE7, 0x0E, +0xE0, 0x44, 0x02, 0x12, 0x68, 0x3B, 0x90, 0x8E, 0x0E, 0xE0, 0x44, 0x04, 0xF0, 0x22, 0xE0, 0x54, +0xFD, 0xF0, 0x22, 0x90, 0x8E, 0x16, 0xE0, 0x54, 0xFE, 0xF0, 0x22, 0x90, 0x8E, 0x10, 0xE0, 0x54, +0x0F, 0x22, 0xE4, 0xFF, 0x12, 0x6F, 0x2B, 0xBF, 0x01, 0x10, 0x90, 0x8E, 0x12, 0xE0, 0x60, 0x0A, +0x91, 0x1B, 0x64, 0x02, 0x60, 0x02, 0x80, 0x03, 0x71, 0xAF, 0x22, 0x90, 0x04, 0x1D, 0xE0, 0x70, +0x15, 0x90, 0x8D, 0x09, 0xE0, 0xFF, 0x7B, 0x18, 0xE4, 0xFD, 0x91, 0x57, 0x90, 0x92, 0xCD, 0xEE, +0xF0, 0xA3, 0xEF, 0xF0, 0xF1, 0x70, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x92, +0xB7, 0xED, 0xF0, 0xA3, 0xEB, 0xF0, 0x90, 0x92, 0xB6, 0xEF, 0xF0, 0xE4, 0xFD, 0xFC, 0xF1, 0x80, +0x90, 0x92, 0xB6, 0xE0, 0x90, 0x04, 0x25, 0xF0, 0x90, 0x92, 0xB7, 0xE0, 0x60, 0x05, 0xD1, 0x13, +0x44, 0x80, 0xF0, 0xAF, 0x05, 0x74, 0x20, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xE0, +0x54, 0xC0, 0xF0, 0xD1, 0x13, 0x54, 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0x74, 0x0D, 0x2C, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, +0x83, 0xE0, 0x22, 0x74, 0x21, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xE0, 0x22, 0x90, +0x92, 0x96, 0xE0, 0xFF, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x92, 0xD7, 0xEF, 0xF0, +0x90, 0x8D, 0x0A, 0xE0, 0xFF, 0x90, 0x04, 0x1C, 0xE0, 0x6F, 0x70, 0x3F, 0x90, 0x8E, 0x15, 0xE0, +0x64, 0x0E, 0x70, 0x16, 0x90, 0x92, 0xD7, 0xE0, 0x70, 0x31, 0x90, 0x8E, 0x0E, 0xE0, 0x54, 0x7F, +0xF0, 0x12, 0x57, 0xF6, 0xF0, 0x12, 0x51, 0x0C, 0x80, 0x1E, 0x90, 0x8E, 0x15, 0xE0, 0x64, 0x06, +0x70, 0x19, 0x90, 0x92, 0xD7, 0xE0, 0x60, 0x13, 0x90, 0x8E, 0x0E, 0xE0, 0x54, 0xBF, 0xF0, 0x12, +0x9D, 0x50, 0x90, 0x8E, 0x15, 0x74, 0x04, 0xF0, 0x12, 0x57, 0xDD, 0xD0, 0xD0, 0x92, 0xAF, 0x22, +0x90, 0x90, 0xE8, 0xE0, 0x30, 0xE0, 0x6B, 0x90, 0x90, 0xEC, 0xE0, 0x04, 0xF0, 0x90, 0x90, 0xEF, +0xE0, 0x64, 0x01, 0x70, 0x21, 0x90, 0x90, 0xE8, 0xE0, 0x13, 0x13, 0x54, 0x3F, 0x30, 0xE0, 0x16, +0x90, 0x90, 0xEE, 0xE0, 0x70, 0x10, 0x90, 0x90, 0xEB, 0xE0, 0xFF, 0xA3, 0xE0, 0xC3, 0x9F, 0x40, +0x05, 0x12, 0x8A, 0x2E, 0xF0, 0x22, 0x90, 0x90, 0xEC, 0xE0, 0xFF, 0x90, 0x90, 0xE9, 0xE0, 0xD3, +0x9F, 0x50, 0x2F, 0x90, 0x06, 0x92, 0xE0, 0x20, 0xE2, 0x19, 0x90, 0x90, 0xEE, 0xE0, 0x70, 0x13, +0x7D, 0x08, 0xFF, 0x91, 0xE6, 0x90, 0x90, 0xED, 0xE0, 0x04, 0xF0, 0x90, 0x90, 0xE7, 0xE0, 0x04, +0xF0, 0x80, 0x06, 0x90, 0x06, 0x92, 0x74, 0x04, 0xF0, 0xE4, 0x90, 0x90, 0xEC, 0xF0, 0x90, 0x90, +0xEE, 0xF0, 0x22, 0xE4, 0x90, 0x92, 0x14, 0xF0, 0xA3, 0xF0, 0x90, 0x06, 0x32, 0xE0, 0x44, 0x20, +0xF0, 0x12, 0x90, 0xD4, 0xEF, 0x64, 0x01, 0x70, 0x66, 0x90, 0x90, 0xDF, 0xE0, 0xFF, 0x7B, 0x08, +0x7D, 0x01, 0x91, 0x57, 0xF1, 0x87, 0xF0, 0x90, 0x92, 0x11, 0x12, 0x81, 0xE4, 0x90, 0x92, 0x13, +0xEF, 0xF0, 0x90, 0x92, 0x11, 0x12, 0x9D, 0x21, 0xE4, 0xFD, 0x12, 0x80, 0x53, 0x90, 0x92, 0x13, +0xE0, 0xFF, 0x90, 0x92, 0x12, 0xE0, 0x2F, 0xFF, 0x90, 0x92, 0x11, 0xE0, 0x34, 0x00, 0xCF, 0x24, +0x30, 0xCF, 0x34, 0x00, 0xFE, 0x90, 0x92, 0x14, 0xF0, 0xA3, 0xEF, 0xF0, 0x12, 0x86, 0x78, 0xF1, +0x77, 0x90, 0x90, 0xDF, 0xE0, 0xFB, 0xE4, 0xFF, 0x12, 0x83, 0x91, 0xF1, 0x77, 0x90, 0x90, 0xDB, +0xE0, 0xFB, 0x7F, 0x11, 0x12, 0x83, 0x91, 0xF1, 0x70, 0x90, 0x90, 0x8E, 0x12, 0x59, 0x26, 0x22, +0x90, 0x04, 0x1F, 0x74, 0x20, 0xF0, 0x22, 0x90, 0x92, 0x14, 0xE0, 0xFC, 0xA3, 0xE0, 0xFD, 0x22, +0xF1, 0xB7, 0x7C, 0x00, 0xAD, 0x07, 0x22, 0x90, 0x92, 0x11, 0xEE, 0xF0, 0xA3, 0xEF, 0x22, 0xF5, +0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0x22, 0x90, 0x8E, 0x14, 0xE0, 0xFF, 0x7D, 0x01, 0x02, 0x51, +0xA1, 0xF1, 0xB7, 0x7E, 0x00, 0x74, 0x00, 0x2F, 0x12, 0x82, 0x8C, 0x75, 0x43, 0x08, 0x7B, 0x01, +0x7A, 0x8F, 0x79, 0x96, 0x02, 0x34, 0x2C, 0xE4, 0xFE, 0xEF, 0x25, 0xE0, 0xFD, 0xEF, 0xC3, 0x94, +0x80, 0x90, 0xFD, 0x12, 0x50, 0x04, 0xE4, 0xF0, 0x80, 0x03, 0x74, 0x01, 0xF0, 0x90, 0xFD, 0x10, +0xED, 0xF0, 0xAF, 0x06, 0x22, 0xE4, 0xFF, 0x12, 0x6F, 0x2B, 0xBF, 0x01, 0x0E, 0x90, 0x8E, 0x12, +0xE0, 0x60, 0x08, 0x91, 0x13, 0x54, 0x07, 0x70, 0x02, 0xF1, 0x97, 0x22, 0xD3, 0x10, 0xAF, 0x01, +0xC3, 0xC0, 0xD0, 0x90, 0x92, 0x73, 0xEF, 0xF0, 0xA3, 0xED, 0xF0, 0xFB, 0x7D, 0x00, 0x7C, 0x00, +0xE4, 0x90, 0x92, 0x79, 0xF0, 0xEB, 0x90, 0x92, 0x74, 0xF0, 0x7F, 0xB0, 0x7E, 0x08, 0x12, 0x36, +0xCE, 0xE4, 0xFF, 0xEC, 0x90, 0x92, 0x75, 0x12, 0x27, 0x48, 0x90, 0x92, 0x75, 0x12, 0x47, 0x3E, +0x90, 0x92, 0x74, 0x12, 0x69, 0x0E, 0x12, 0x47, 0x14, 0xA3, 0x12, 0x27, 0x48, 0x90, 0x92, 0x75, +0x12, 0x56, 0xC6, 0x7F, 0xB0, 0x7E, 0x08, 0x12, 0x37, 0x5D, 0x11, 0x60, 0x90, 0x92, 0x73, 0xE0, +0x75, 0xF0, 0x08, 0xA4, 0x24, 0x73, 0xF5, 0x82, 0xE4, 0x34, 0xAF, 0xF5, 0x83, 0xE0, 0xFE, 0xA3, +0xE0, 0xFF, 0x12, 0x36, 0xCE, 0xED, 0x54, 0x0F, 0xFD, 0xE4, 0xFC, 0xD0, 0xD0, 0x92, 0xAF, 0x22, +0x7F, 0x14, 0x7E, 0x00, 0x02, 0x3A, 0xF7, 0xE4, 0x90, 0x90, 0xF6, 0xF0, 0xA3, 0xF0, 0x90, 0x01, +0x98, 0xE0, 0x7F, 0x00, 0x30, 0xE4, 0x02, 0x7F, 0x01, 0xEF, 0x64, 0x01, 0x60, 0x3C, 0xC3, 0x90, +0x90, 0xF7, 0xE0, 0x94, 0x88, 0x90, 0x90, 0xF6, 0xE0, 0x94, 0x13, 0x40, 0x0F, 0x90, 0x01, 0xC1, +0xE0, 0x44, 0x10, 0xF0, 0x90, 0x01, 0xC7, 0x74, 0xFD, 0xF0, 0x80, 0x1E, 0x90, 0x90, 0xF6, 0x12, +0x59, 0x26, 0x11, 0x60, 0xD3, 0x90, 0x90, 0xF7, 0xE0, 0x94, 0x32, 0x90, 0x90, 0xF6, 0xE0, 0x94, +0x00, 0x40, 0xBB, 0x90, 0x01, 0xC6, 0xE0, 0x30, 0xE3, 0xB4, 0x90, 0x01, 0xC7, 0x74, 0xFE, 0xF0, +0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x12, 0x77, 0xEC, 0xD0, 0xD0, 0x92, 0xAF, 0x22, +0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xC0, 0x07, 0xC0, 0x05, 0x90, 0x92, 0x82, 0x12, 0x47, +0x32, 0x90, 0xAC, 0x9C, 0x12, 0x27, 0x48, 0xD0, 0x05, 0xD0, 0x07, 0x12, 0x32, 0x65, 0xD0, 0xD0, +0x92, 0xAF, 0x22, 0xC0, 0xE0, 0xC0, 0xF0, 0xC0, 0x83, 0xC0, 0x82, 0xC0, 0xD0, 0x75, 0xD0, 0x00, +0xC0, 0x00, 0xC0, 0x01, 0xC0, 0x02, 0xC0, 0x03, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, +0x90, 0x01, 0xC4, 0x74, 0xF3, 0xF0, 0x74, 0x78, 0xA3, 0xF0, 0x31, 0x42, 0x74, 0xF3, 0x04, 0x90, +0x01, 0xC4, 0xF0, 0x74, 0x78, 0xA3, 0xF0, 0xD0, 0x07, 0xD0, 0x06, 0xD0, 0x05, 0xD0, 0x04, 0xD0, +0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0xD0, 0xD0, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xF0, 0xD0, +0xE0, 0x32, 0x7B, 0x00, 0x7A, 0x00, 0x79, 0x53, 0xE4, 0xFD, 0x7F, 0x01, 0x12, 0x39, 0x33, 0xE5, +0x51, 0x52, 0x53, 0x7B, 0x00, 0x7A, 0x00, 0x79, 0x54, 0x7D, 0x01, 0x7F, 0x01, 0x12, 0x39, 0x33, +0xE5, 0x52, 0x52, 0x54, 0xAB, 0x53, 0xE4, 0xFD, 0x7F, 0x01, 0x12, 0x39, 0x04, 0xAB, 0x54, 0x7D, +0x01, 0x7F, 0x01, 0x02, 0x39, 0x04, 0xC0, 0xE0, 0xC0, 0xF0, 0xC0, 0x83, 0xC0, 0x82, 0xC0, 0xD0, +0x75, 0xD0, 0x00, 0xC0, 0x00, 0xC0, 0x01, 0xC0, 0x02, 0xC0, 0x03, 0xC0, 0x04, 0xC0, 0x05, 0xC0, +0x06, 0xC0, 0x07, 0x90, 0x01, 0xC4, 0x74, 0x76, 0xF0, 0x74, 0x79, 0xA3, 0xF0, 0x31, 0xE7, 0xE5, +0x5C, 0x30, 0xE7, 0x02, 0x31, 0xCC, 0x74, 0x76, 0x04, 0x90, 0x01, 0xC4, 0xF0, 0x74, 0x79, 0xA3, +0xF0, 0xD0, 0x07, 0xD0, 0x06, 0xD0, 0x05, 0xD0, 0x04, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, +0x00, 0xD0, 0xD0, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xF0, 0xD0, 0xE0, 0x32, 0x7F, 0x01, 0x7E, 0x00, +0x12, 0x3A, 0x69, 0x90, 0x00, 0xF2, 0xE0, 0x20, 0xE6, 0x0C, 0x90, 0x00, 0x05, 0xE0, 0x44, 0x80, +0xFD, 0x7F, 0x05, 0x12, 0x3A, 0x96, 0x22, 0x90, 0x00, 0x54, 0xE0, 0x55, 0x55, 0xF5, 0x59, 0xA3, +0xE0, 0x55, 0x56, 0xF5, 0x5A, 0xA3, 0xE0, 0x55, 0x57, 0xF5, 0x5B, 0xA3, 0xE0, 0x55, 0x58, 0xF5, +0x5C, 0xAD, 0x59, 0x7F, 0x54, 0x12, 0x3A, 0x96, 0xAD, 0x5A, 0x7F, 0x55, 0x12, 0x3A, 0x96, 0xAD, +0x5B, 0x7F, 0x56, 0x12, 0x3A, 0x96, 0xAD, 0x5C, 0x7F, 0x57, 0x12, 0x3A, 0x96, 0x53, 0x91, 0xEF, +0x22, 0xC0, 0xE0, 0xC0, 0xF0, 0xC0, 0x83, 0xC0, 0x82, 0xC0, 0xD0, 0x75, 0xD0, 0x00, 0xC0, 0x00, +0xC0, 0x01, 0xC0, 0x02, 0xC0, 0x03, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0x01, +0xC4, 0x74, 0x21, 0xF0, 0x74, 0x7A, 0xA3, 0xF0, 0x12, 0x90, 0x29, 0xE5, 0x61, 0x30, 0xE3, 0x02, +0x91, 0x44, 0xE5, 0x61, 0x30, 0xE4, 0x02, 0x71, 0x0D, 0xE5, 0x61, 0x30, 0xE5, 0x03, 0x12, 0x90, +0x86, 0xE5, 0x63, 0x30, 0xE0, 0x02, 0xB1, 0xCC, 0xE5, 0x63, 0x30, 0xE1, 0x03, 0x12, 0x71, 0xA0, +0xE5, 0x63, 0x30, 0xE2, 0x03, 0x12, 0x90, 0xC2, 0xE5, 0x63, 0x30, 0xE3, 0x03, 0x12, 0x6F, 0x4F, +0xE5, 0x63, 0x30, 0xE4, 0x03, 0x12, 0x6F, 0x75, 0xE5, 0x63, 0x30, 0xE5, 0x03, 0x12, 0x74, 0x22, +0xE5, 0x63, 0x30, 0xE6, 0x03, 0x12, 0x77, 0xD5, 0xE5, 0x64, 0x30, 0xE1, 0x02, 0xB1, 0xCF, 0xE5, +0x64, 0x30, 0xE6, 0x02, 0x51, 0xCC, 0x74, 0x21, 0x04, 0x90, 0x01, 0xC4, 0xF0, 0x74, 0x7A, 0xA3, +0xF0, 0xD0, 0x07, 0xD0, 0x06, 0xD0, 0x05, 0xD0, 0x04, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, +0x00, 0xD0, 0xD0, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xF0, 0xD0, 0xE0, 0x32, 0x90, 0x07, 0x1F, 0xE0, +0x54, 0x7F, 0xF0, 0x90, 0x07, 0x1C, 0xE0, 0x54, 0x01, 0xFF, 0x90, 0x92, 0x13, 0xF0, 0x90, 0x92, +0x11, 0x74, 0x02, 0xF0, 0x90, 0x92, 0x1F, 0x14, 0xF0, 0xFB, 0x7A, 0x92, 0x79, 0x11, 0xB1, 0x07, +0x7F, 0x04, 0x90, 0x92, 0xCF, 0xEF, 0xF0, 0x7F, 0x02, 0x12, 0x4B, 0x8B, 0x90, 0x8D, 0x01, 0xE0, +0xFF, 0x90, 0x92, 0xCF, 0xE0, 0xFE, 0xEF, 0x4E, 0x90, 0x8D, 0x01, 0xF0, 0x22, 0x71, 0x20, 0x7F, +0x02, 0x8F, 0x17, 0x7F, 0x02, 0x12, 0x4B, 0x8B, 0x90, 0x8D, 0x01, 0xE0, 0x45, 0x17, 0xF0, 0x22, +0x90, 0x01, 0xCC, 0xE0, 0x54, 0x0F, 0x90, 0x92, 0xC1, 0xF0, 0x90, 0x92, 0xC1, 0xE0, 0xFD, 0x70, +0x02, 0x81, 0x19, 0x90, 0x8D, 0x5F, 0xE0, 0xFF, 0x70, 0x06, 0xA3, 0xE0, 0x64, 0x09, 0x60, 0x0A, +0xEF, 0x14, 0xFF, 0x90, 0x8D, 0x60, 0xE0, 0xB5, 0x07, 0x04, 0x7F, 0x01, 0x80, 0x02, 0x7F, 0x00, +0xEF, 0x60, 0x08, 0x90, 0x01, 0xC1, 0xE0, 0x44, 0x01, 0xF0, 0x22, 0x90, 0x92, 0xBF, 0xB1, 0xD9, +0x80, 0x05, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, 0xF9, 0xFF, 0xEF, 0x5D, 0x70, 0x02, 0x61, 0xFB, +0xE4, 0x90, 0x92, 0xC2, 0xF0, 0x90, 0x92, 0xC2, 0xE0, 0xF9, 0xC3, 0x94, 0x04, 0x50, 0x31, 0x91, +0x1A, 0xA4, 0xFF, 0xE9, 0xFD, 0x7C, 0x00, 0x2F, 0xFF, 0xEC, 0x35, 0xF0, 0xFE, 0x74, 0xD0, 0x91, +0x32, 0x90, 0x8D, 0x0F, 0x91, 0x22, 0x91, 0x1A, 0xA4, 0x2D, 0xFF, 0xEC, 0x35, 0xF0, 0xFE, 0x74, +0xF0, 0x91, 0x32, 0x90, 0x8D, 0x13, 0x91, 0x22, 0x90, 0x92, 0xC2, 0xE0, 0x04, 0xF0, 0x80, 0xC5, +0x90, 0x92, 0xC1, 0xE0, 0xFF, 0x90, 0x92, 0xBF, 0xE0, 0xFE, 0x74, 0x01, 0xA8, 0x06, 0x08, 0x80, +0x02, 0xC3, 0x33, 0xD8, 0xFC, 0xF4, 0x5F, 0x90, 0x92, 0xC1, 0xF0, 0x90, 0x92, 0xBF, 0x12, 0x64, +0xC7, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0x90, 0x01, 0xCC, 0xF0, 0x90, 0x92, 0xBF, 0xE0, 0x04, +0xF0, 0xE0, 0x54, 0x03, 0xF0, 0x90, 0x8D, 0x60, 0xB1, 0x65, 0xB4, 0x0A, 0x02, 0x7F, 0x01, 0xEF, +0x70, 0x02, 0x61, 0x2A, 0xE4, 0x90, 0x8D, 0x60, 0xF0, 0x61, 0x2A, 0x90, 0x01, 0xC0, 0xE0, 0x44, +0x02, 0xF0, 0x90, 0x92, 0xBF, 0xE0, 0x44, 0x80, 0x90, 0x00, 0x8A, 0xF0, 0x91, 0x1A, 0x90, 0x01, +0xD0, 0x12, 0x47, 0x4A, 0xE0, 0x90, 0x01, 0xC3, 0xF0, 0x22, 0x90, 0x92, 0xBF, 0xE0, 0x75, 0xF0, +0x04, 0x22, 0x12, 0x47, 0x4A, 0xE5, 0x82, 0x29, 0xF5, 0x82, 0xE4, 0x35, 0x83, 0xF5, 0x83, 0xEF, +0xF0, 0x22, 0x2F, 0xF5, 0x82, 0x74, 0x01, 0x3E, 0xF5, 0x83, 0xE0, 0xFF, 0x90, 0x8D, 0x60, 0xE0, +0x75, 0xF0, 0x08, 0x22, 0x90, 0x8E, 0xC5, 0xE0, 0x30, 0xE0, 0x04, 0x7F, 0x10, 0x71, 0x11, 0x22, +0x90, 0x91, 0x09, 0x74, 0x12, 0xF0, 0x90, 0x91, 0x17, 0x74, 0x05, 0xF0, 0x90, 0x91, 0x0B, 0xEF, +0xF0, 0xA3, 0xED, 0xF0, 0xA3, 0xEB, 0xF0, 0x90, 0x91, 0x07, 0xE0, 0x90, 0x91, 0x0E, 0xF0, 0x90, +0x91, 0x08, 0xE0, 0x90, 0x91, 0x0F, 0xF0, 0x7B, 0x01, 0x7A, 0x91, 0x79, 0x09, 0xB1, 0x07, 0x7F, +0x04, 0x41, 0xF2, 0xB1, 0x00, 0x7F, 0xF5, 0x7E, 0x03, 0x12, 0x33, 0xC7, 0xBF, 0x01, 0x06, 0x90, +0x90, 0xFE, 0xE0, 0xA3, 0xF0, 0xB1, 0x00, 0x7F, 0xF6, 0x7E, 0x03, 0x12, 0x33, 0xC7, 0xBF, 0x01, +0x08, 0x90, 0x90, 0xFE, 0xE0, 0x90, 0x91, 0x00, 0xF0, 0xB1, 0x00, 0x7F, 0xF4, 0x7E, 0x03, 0x12, +0x33, 0xC7, 0xBF, 0x01, 0x08, 0x90, 0x90, 0xFE, 0xE0, 0x90, 0x91, 0x01, 0xF0, 0xB1, 0x00, 0x7F, +0xF3, 0x7E, 0x03, 0x12, 0x33, 0xC7, 0xBF, 0x01, 0x08, 0x90, 0x90, 0xFE, 0xE0, 0x90, 0x91, 0x02, +0xF0, 0xB1, 0x00, 0x7F, 0xF2, 0x7E, 0x03, 0x12, 0x33, 0xC7, 0xBF, 0x01, 0x08, 0x90, 0x90, 0xFE, +0xE0, 0x90, 0x91, 0x03, 0xF0, 0x90, 0x90, 0xFF, 0xE0, 0xFF, 0xA3, 0xE0, 0xFD, 0xA3, 0xE0, 0xFB, +0xA3, 0xE0, 0x90, 0x91, 0x07, 0xF0, 0x90, 0x91, 0x03, 0xE0, 0x90, 0x91, 0x08, 0xF0, 0x81, 0x50, +0x7B, 0x01, 0x7A, 0x90, 0x79, 0xFE, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x8D, +0xF7, 0xE0, 0xFF, 0x70, 0x06, 0xA3, 0xE0, 0x64, 0x09, 0x60, 0x0A, 0xEF, 0x14, 0xFF, 0x90, 0x8D, +0xF8, 0xE0, 0xB5, 0x07, 0x04, 0x7F, 0x01, 0x80, 0x02, 0x7F, 0x00, 0xEF, 0x60, 0x09, 0x90, 0x01, +0xC1, 0xE0, 0x44, 0x02, 0xF0, 0x80, 0x29, 0xC0, 0x01, 0x90, 0x8D, 0xF8, 0xE0, 0x12, 0x8E, 0x5C, +0xA8, 0x01, 0xFC, 0x7D, 0x01, 0xD0, 0x01, 0x7E, 0x00, 0x7F, 0x0F, 0x12, 0x46, 0xB0, 0x90, 0x8D, +0xF8, 0xB1, 0x65, 0xB4, 0x0A, 0x02, 0x7F, 0x01, 0xEF, 0x60, 0x05, 0xE4, 0x90, 0x8D, 0xF8, 0xF0, +0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xE0, 0x04, 0xF0, 0xE0, 0x7F, 0x00, 0x22, 0xD3, 0x10, 0xAF, 0x01, +0xC3, 0xC0, 0xD0, 0x90, 0x8D, 0x60, 0xE0, 0xFF, 0x90, 0x8D, 0x5F, 0xE0, 0xB5, 0x07, 0x04, 0x7F, +0x01, 0x80, 0x02, 0x7F, 0x00, 0xEF, 0x70, 0x3F, 0x90, 0x8D, 0x5F, 0xE0, 0xFE, 0x75, 0xF0, 0x08, +0x90, 0x8D, 0x0F, 0x12, 0x47, 0x4A, 0xE0, 0xFD, 0xEE, 0x75, 0xF0, 0x08, 0xA4, 0x24, 0x10, 0xF9, +0x74, 0x8D, 0x35, 0xF0, 0xFA, 0x7B, 0x01, 0xAF, 0x05, 0x12, 0x65, 0xBE, 0x90, 0x8D, 0x5F, 0xB1, +0x65, 0xB4, 0x0A, 0x02, 0x7F, 0x01, 0xEF, 0x60, 0x05, 0xE4, 0x90, 0x8D, 0x5F, 0xF0, 0x71, 0x20, +0x90, 0x8D, 0x01, 0xE0, 0x44, 0x02, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x02, 0x69, 0x15, 0x90, +0x8E, 0x12, 0xE0, 0x60, 0x03, 0x12, 0x57, 0x79, 0x22, 0xE0, 0xFF, 0x74, 0x01, 0x7E, 0x00, 0xA8, +0x07, 0x08, 0x22, 0x90, 0x90, 0xE8, 0xE0, 0x30, 0xE0, 0x3D, 0x90, 0x90, 0xED, 0xE0, 0xFD, 0x60, +0x36, 0xB1, 0xDB, 0x80, 0x05, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, 0xF9, 0xFF, 0x90, 0x04, 0xE0, +0xE0, 0xFB, 0xEF, 0x5B, 0x60, 0x0B, 0xE4, 0x90, 0x90, 0xED, 0xF0, 0x90, 0x90, 0xEF, 0x04, 0xF0, +0x22, 0x90, 0x90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02, 0xD1, 0x49, 0x74, +0x71, 0x04, 0x90, 0x01, 0xC4, 0xF0, 0x74, 0x7E, 0xA3, 0xF0, 0xD0, 0x07, 0xD0, 0x06, 0xD0, 0x05, +0xD0, 0x04, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0xD0, 0xD0, 0xD0, 0x82, 0xD0, 0x83, +0xD0, 0xF0, 0xD0, 0xE0, 0x32, 0xF0, 0x90, 0x04, 0xE0, 0xE0, 0x90, 0x8E, 0x0F, 0x22, 0x90, 0x8E, +0x12, 0xE0, 0x60, 0x0F, 0x90, 0x06, 0x92, 0xE0, 0x30, 0xE1, 0x03, 0x02, 0x97, 0xFB, 0xF1, 0xB9, +0x12, 0x77, 0x97, 0x22, 0x12, 0x91, 0xC7, 0x90, 0x92, 0x22, 0xEF, 0xF0, 0x30, 0xE0, 0x05, 0x7D, +0x01, 0xE4, 0x80, 0x02, 0xE4, 0xFD, 0xFF, 0x12, 0x51, 0x10, 0x90, 0x92, 0x22, 0xE0, 0x30, 0xE6, +0x11, 0x90, 0x01, 0x2F, 0xE0, 0x30, 0xE7, 0x04, 0xE4, 0xF0, 0x80, 0x06, 0x90, 0x01, 0x2F, 0x74, +0x80, 0xF0, 0x12, 0x9D, 0x2D, 0xFB, 0xAC, 0x07, 0x90, 0x8E, 0x0E, 0xE0, 0x30, 0xE0, 0x16, 0x90, +0x8E, 0x48, 0xE0, 0x24, 0x04, 0x90, 0x8E, 0x27, 0xF0, 0x90, 0x8E, 0x48, 0xE0, 0x24, 0x03, 0x90, +0x8E, 0x26, 0xF0, 0x80, 0x0B, 0x90, 0x8E, 0x27, 0x74, 0x02, 0xF0, 0x90, 0x8E, 0x26, 0x14, 0xF0, +0x90, 0x8E, 0x26, 0xE0, 0xFA, 0x90, 0x8E, 0x25, 0xE0, 0xD3, 0x9A, 0x50, 0x09, 0x90, 0x8E, 0x1A, +0xEB, 0xF1, 0xB1, 0x2C, 0x80, 0x0B, 0xAD, 0x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D, +0x90, 0x8D, 0x0D, 0x31, 0x4F, 0x25, 0x0D, 0x90, 0x8D, 0x0E, 0xF0, 0x22, 0xF0, 0x90, 0x00, 0x04, +0x02, 0x26, 0x37, 0x90, 0x92, 0x89, 0xED, 0xF0, 0x90, 0x92, 0x86, 0x12, 0x47, 0x5F, 0xE4, 0x90, +0x92, 0x8A, 0xF0, 0xA3, 0xF0, 0x12, 0x26, 0x1E, 0xFF, 0x12, 0x4E, 0xCE, 0xFD, 0x11, 0x4D, 0xFB, +0x51, 0x0A, 0x90, 0x92, 0x8A, 0xEF, 0xF0, 0x90, 0x92, 0x86, 0x12, 0x47, 0x56, 0x11, 0x4D, 0xFF, +0xD1, 0x9C, 0x90, 0x92, 0x8B, 0xEF, 0xF0, 0x90, 0x8F, 0x9F, 0xE0, 0x24, 0xFE, 0x60, 0x14, 0x24, +0xFE, 0x60, 0x10, 0x14, 0x60, 0x07, 0x14, 0x60, 0x04, 0x24, 0x05, 0x70, 0x41, 0x11, 0xDF, 0x11, +0xEB, 0x80, 0x0D, 0x11, 0xDF, 0x90, 0x8F, 0x9F, 0xE0, 0x90, 0x92, 0x61, 0xF0, 0x12, 0x4E, 0xD4, +0x90, 0x92, 0x8B, 0xE0, 0xFF, 0x90, 0x92, 0x86, 0x12, 0x47, 0x56, 0x90, 0x92, 0x8A, 0xE0, 0x7C, +0x00, 0x29, 0xF9, 0xEC, 0x3A, 0xFA, 0xC3, 0xE9, 0x9F, 0xF9, 0xEA, 0x94, 0x00, 0xFA, 0x75, 0x40, +0x01, 0x75, 0x41, 0x8F, 0x75, 0x42, 0x96, 0xA3, 0xE0, 0xF5, 0x43, 0x12, 0x34, 0x2C, 0x22, 0x7B, +0x01, 0x7A, 0x8F, 0x79, 0x96, 0x90, 0x92, 0x89, 0xE0, 0xFD, 0x22, 0x90, 0x92, 0x6E, 0xED, 0xF0, +0x90, 0x92, 0x6B, 0x12, 0x47, 0x5F, 0x12, 0x4F, 0xAE, 0x90, 0x92, 0x72, 0xF0, 0x90, 0x92, 0x6B, +0x12, 0x5B, 0xDD, 0x75, 0x43, 0x03, 0x7B, 0x01, 0x7A, 0x92, 0x79, 0x6F, 0x12, 0x34, 0x2C, 0x90, +0x92, 0x6E, 0xE0, 0x70, 0x2E, 0xFF, 0x31, 0x44, 0xE0, 0xB4, 0xFF, 0x06, 0x31, 0x44, 0xE4, 0xF0, +0x80, 0x07, 0x31, 0x44, 0xE0, 0x04, 0xF0, 0x80, 0x05, 0x0F, 0xEF, 0xB4, 0x03, 0xE8, 0x75, 0x40, +0x01, 0x75, 0x41, 0x92, 0x75, 0x42, 0x6F, 0x75, 0x43, 0x03, 0x90, 0x92, 0x6B, 0x12, 0x47, 0x56, +0x12, 0x34, 0x2C, 0x22, 0x74, 0x6F, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x92, 0xF5, 0x83, 0x22, 0xF0, +0x90, 0x00, 0x06, 0x02, 0x26, 0x37, 0x31, 0xD7, 0x2E, 0x90, 0x90, 0xD4, 0x12, 0x4E, 0xCD, 0xFF, +0xED, 0x2F, 0x90, 0x90, 0xD5, 0x12, 0x4F, 0xF0, 0xFF, 0xED, 0x2F, 0x90, 0x90, 0xD6, 0x12, 0x4F, +0xAD, 0xFF, 0xED, 0x2F, 0x90, 0x90, 0xD7, 0x11, 0x4C, 0xFF, 0xED, 0x2F, 0x90, 0x90, 0xD8, 0x31, +0xD0, 0xFF, 0xED, 0x2F, 0x90, 0x90, 0xD9, 0x31, 0x4F, 0xFF, 0xAE, 0x05, 0xED, 0x2F, 0x90, 0x90, +0xDA, 0xF0, 0x22, 0x31, 0xD7, 0x2E, 0x90, 0x90, 0xDB, 0x12, 0x4E, 0xCD, 0xFF, 0xED, 0x2F, 0x90, +0x90, 0xDC, 0x12, 0x4F, 0xF0, 0xFF, 0xED, 0x2F, 0x90, 0x90, 0xDD, 0x12, 0x4F, 0xAD, 0xFF, 0xED, +0x2F, 0x90, 0x90, 0xDE, 0x11, 0x4C, 0xFF, 0xED, 0x2F, 0x90, 0x90, 0xDF, 0x31, 0xD0, 0xFF, 0xED, +0x2F, 0x90, 0x90, 0xE0, 0x31, 0x4F, 0xFF, 0xAE, 0x05, 0xED, 0x2F, 0x90, 0x90, 0xE1, 0xF0, 0x22, +0xF0, 0x90, 0x00, 0x05, 0x02, 0x26, 0x37, 0x90, 0x02, 0x09, 0xE0, 0xFD, 0x12, 0x26, 0x1E, 0xFE, +0xAF, 0x05, 0xED, 0x22, 0xA3, 0xE0, 0xFE, 0x24, 0x28, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, +0xE0, 0xFF, 0x74, 0x29, 0x2E, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xE0, 0xFD, 0x74, 0x2C, +0x2E, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xE0, 0xFB, 0xE4, 0xFE, 0xEF, 0x30, 0xE7, 0x04, +0x7C, 0x02, 0x80, 0x02, 0xE4, 0xFC, 0xED, 0x30, 0xE6, 0x08, 0xAF, 0x03, 0xD1, 0x9C, 0xAE, 0x07, +0x80, 0x02, 0xE4, 0xFE, 0xEC, 0x24, 0x18, 0x2E, 0xFF, 0x22, 0x12, 0x77, 0xB7, 0x90, 0x90, 0xFE, +0xE4, 0xD1, 0x49, 0x31, 0xE4, 0x90, 0x91, 0x00, 0xEF, 0xF0, 0x90, 0x90, 0xFE, 0x12, 0x5F, 0xE3, +0x51, 0x90, 0x75, 0x43, 0x06, 0x7B, 0x01, 0x7A, 0x8E, 0x79, 0xEA, 0x71, 0x52, 0x2F, 0x24, 0x3E, +0xF9, 0xE4, 0x34, 0xFC, 0x51, 0x90, 0x75, 0x43, 0x04, 0x7B, 0x01, 0x7A, 0x8E, 0x79, 0xF0, 0x71, +0x52, 0x2F, 0x24, 0x42, 0xF9, 0xE4, 0x34, 0xFC, 0x51, 0x90, 0x75, 0x43, 0x06, 0x7B, 0x01, 0x7A, +0x8E, 0x79, 0xF4, 0x71, 0x52, 0x2F, 0x24, 0x48, 0xF9, 0xE4, 0x34, 0xFC, 0x51, 0x90, 0x75, 0x43, +0x04, 0x7B, 0x01, 0x7A, 0x8E, 0x79, 0xFA, 0x02, 0x34, 0x2C, 0x24, 0x00, 0xF9, 0xE4, 0x34, 0xFC, +0x75, 0x40, 0x01, 0xF5, 0x41, 0x89, 0x42, 0x22, 0x90, 0x90, 0xDF, 0x71, 0x47, 0xE0, 0xFE, 0x24, +0x28, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xE0, 0xFF, 0x74, 0x29, 0x2E, 0x12, 0x75, 0xD6, +0xE0, 0xFD, 0x90, 0x90, 0xFE, 0xE0, 0x24, 0x2C, 0x51, 0x01, 0x90, 0x90, 0xFE, 0xE0, 0x2F, 0x24, +0x30, 0xA3, 0xF0, 0xE0, 0xFD, 0x24, 0x04, 0xB1, 0x8E, 0xE0, 0xFE, 0x74, 0x05, 0x2D, 0xB1, 0x96, +0x71, 0x67, 0x90, 0x90, 0x86, 0xF0, 0xA3, 0xEF, 0xF0, 0x90, 0x90, 0xFF, 0xE0, 0x24, 0x0C, 0xF9, +0xE4, 0x34, 0xFC, 0x51, 0x90, 0x75, 0x43, 0x04, 0x7B, 0x01, 0x7A, 0x90, 0x79, 0x88, 0x12, 0x34, +0x2C, 0x90, 0x90, 0xFF, 0xE0, 0x24, 0x14, 0xF0, 0xE0, 0xFD, 0x24, 0x01, 0x71, 0x89, 0xE0, 0xFE, +0x74, 0x00, 0x2D, 0x12, 0x55, 0xEF, 0x71, 0x67, 0x90, 0x90, 0x8C, 0xF0, 0xA3, 0xEF, 0xF0, 0x90, +0x90, 0xE0, 0x71, 0x47, 0x90, 0x90, 0x82, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x4E, 0x60, 0x11, 0x90, +0x90, 0xFE, 0xE0, 0x51, 0x8A, 0x8F, 0x43, 0x7B, 0x01, 0x7A, 0x90, 0x79, 0x90, 0x12, 0x34, 0x2C, +0x90, 0x90, 0xE1, 0x71, 0x47, 0x51, 0x8A, 0x90, 0x90, 0x84, 0xA3, 0xE0, 0xF5, 0x43, 0x7B, 0x01, +0x7A, 0x90, 0x79, 0xB0, 0x02, 0x34, 0x2C, 0xE0, 0xFF, 0x12, 0x77, 0xB7, 0x90, 0x90, 0xFE, 0xEF, +0xF0, 0x22, 0x12, 0x34, 0x2C, 0x90, 0x90, 0xFE, 0xA3, 0xE0, 0xFF, 0xA3, 0xE0, 0x22, 0xF0, 0x90, +0x01, 0x17, 0xE0, 0xFE, 0x90, 0x01, 0x16, 0xE0, 0x7C, 0x00, 0x24, 0x00, 0xFF, 0xEC, 0x3E, 0x22, +0xFD, 0xE4, 0x33, 0x90, 0x92, 0x20, 0xF0, 0xA3, 0xED, 0xF0, 0xFE, 0x24, 0x00, 0xF5, 0x82, 0xE4, +0x34, 0xFC, 0xF5, 0x83, 0xE4, 0xF0, 0x74, 0x01, 0x2E, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, +0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x92, 0x16, 0xEC, 0xF0, 0xA3, 0xED, 0xF0, +0xAA, 0x07, 0x90, 0x92, 0x1C, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x90, 0xFD, 0x10, 0xEB, +0xF0, 0xEA, 0x24, 0xEF, 0x60, 0x30, 0x24, 0xD7, 0x70, 0x02, 0x81, 0x64, 0x24, 0x3A, 0x60, 0x02, +0x81, 0x8B, 0x91, 0xA3, 0x24, 0x0A, 0x71, 0x70, 0xE4, 0xF0, 0xFE, 0x74, 0x00, 0x2F, 0x91, 0xB3, +0x7D, 0x14, 0x7C, 0x00, 0x91, 0xAA, 0x7B, 0x00, 0x7A, 0x00, 0x79, 0x00, 0x91, 0xC4, 0x7D, 0x14, +0x7C, 0x00, 0xE4, 0xFF, 0x80, 0x79, 0x90, 0x92, 0x16, 0xE4, 0x75, 0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 0x16, 0xA3, 0xE0, 0xFF, 0x22, 0x12, 0x28, 0xE6, 0x90, 0x92, 0x1C, +0x02, 0x27, 0x48, 0xF9, 0xEE, 0x34, 0xFC, 0xFA, 0x7B, 0x01, 0x22, 0x90, 0x92, 0x1A, 0xE0, 0xFC, +0xA3, 0xE0, 0xFD, 0x22, 0x90, 0xAE, 0x61, 0x12, 0x47, 0x5F, 0x90, 0x92, 0x1C, 0x12, 0x47, 0x32, +0x90, 0xAE, 0x64, 0x02, 0x27, 0x48, 0x90, 0x92, 0x1C, 0x12, 0x27, 0x48, 0x90, 0x92, 0x1C, 0x12, +0x47, 0x32, 0x78, 0x10, 0x12, 0x27, 0x22, 0x90, 0x92, 0x1C, 0x12, 0x47, 0x3E, 0x02, 0x46, 0xEC, +0xE4, 0xFD, 0xFC, 0x90, 0x90, 0xDE, 0xE0, 0xFF, 0x12, 0x77, 0x80, 0xAB, 0x05, 0x74, 0x01, 0x2B, +0x71, 0x89, 0xE0, 0xFE, 0x74, 0x00, 0x2B, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xB1, 0xBA, 0x90, 0x90, +0x7C, 0xF0, 0xA3, 0xEF, 0xF0, 0x74, 0x03, 0x2B, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xE0, +0xFE, 0x74, 0x02, 0x2B, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xB1, 0x87, 0xEA, 0x3E, 0x90, 0x90, 0x7E, +0xF0, 0xA3, 0xEF, 0xF0, 0x74, 0x05, 0x2B, 0xB1, 0x96, 0xE0, 0xFE, 0x74, 0x04, 0x2B, 0xB1, 0x8E, +0xE0, 0x24, 0x00, 0xFF, 0xEA, 0x3E, 0x90, 0x90, 0x80, 0xF0, 0xA3, 0xEF, 0xF0, 0x74, 0x07, 0x2B, +0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xE0, 0xFE, 0x74, 0x06, 0x2B, 0xF5, 0x82, 0xE4, 0x34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x8F, 0xF0, 0xF1, 0x97, 0xFE, 0xA3, 0xE0, +0xFF, 0xD3, 0x90, 0x90, 0xFF, 0xE0, 0x9F, 0x90, 0x90, 0xFE, 0xE0, 0x9E, 0x40, 0x11, 0x90, 0x8D, +0xFA, 0xF1, 0xCF, 0x90, 0x90, 0xFF, 0xE0, 0x9F, 0xF0, 0x90, 0x90, 0xFE, 0xE0, 0x9E, 0xF0, 0x12, +0x62, 0xED, 0x12, 0x97, 0x50, 0x0C, 0x80, 0x94, 0x22, 0xF0, 0xA3, 0xEF, 0xF0, 0x90, 0x90, 0xFE, +0x22, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x7D, 0x07, 0xEF, 0x5D, 0xC3, 0x60, 0x0A, 0xD1, 0x6B, 0x24, +0x08, 0xFF, 0xE4, 0x3E, 0xFE, 0x80, 0x03, 0xD1, 0x6B, 0xFF, 0x22, 0x74, 0xFF, 0x9D, 0xFD, 0x74, +0xFF, 0x94, 0x00, 0x5E, 0xFE, 0xED, 0x5F, 0x22, 0xAD, 0x07, 0x90, 0x90, 0x86, 0x12, 0x59, 0x26, +0x90, 0x90, 0x86, 0xE0, 0xFF, 0xAE, 0x05, 0x74, 0x04, 0x2E, 0xB1, 0x8E, 0xEF, 0xF0, 0x90, 0x90, +0x86, 0xA3, 0xE0, 0xFF, 0x74, 0x05, 0x2E, 0xB1, 0x96, 0xEF, 0xF0, 0x22, 0xD3, 0x10, 0xAF, 0x01, +0xC3, 0xC0, 0xD0, 0xEF, 0x20, 0xE0, 0x05, 0x90, 0x90, 0xD2, 0x80, 0x03, 0x90, 0x90, 0xD3, 0xE0, +0x90, 0x8F, 0x9F, 0xF0, 0x90, 0x8F, 0x9F, 0xE0, 0x14, 0x60, 0x13, 0x14, 0x60, 0x14, 0x24, 0xFE, +0x60, 0x10, 0x14, 0x60, 0x09, 0x14, 0x60, 0x06, 0x24, 0x06, 0xE4, 0xFE, 0x80, 0x06, 0x7E, 0x04, +0x80, 0x02, 0x7E, 0x08, 0xAF, 0x06, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x12, 0x97, 0x5E, 0xAD, 0x07, +0x90, 0x01, 0xC4, 0x74, 0xDB, 0xF0, 0x74, 0x86, 0xA3, 0xF0, 0xED, 0x64, 0x01, 0x60, 0x1E, 0x12, +0x5F, 0xDA, 0xED, 0xB4, 0x02, 0x08, 0x90, 0x01, 0xC7, 0x74, 0x40, 0xF0, 0x80, 0x0A, 0xED, 0xB4, +0x04, 0x06, 0x90, 0x01, 0xC7, 0x74, 0x41, 0xF0, 0x7F, 0x01, 0x02, 0x63, 0x09, 0xB1, 0xC5, 0x90, +0x02, 0x87, 0xE0, 0x70, 0xF8, 0x90, 0x06, 0x90, 0xE0, 0x44, 0x02, 0xF0, 0x74, 0xDB, 0x04, 0x90, +0x01, 0xC4, 0xF0, 0x74, 0x86, 0xA3, 0xF0, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, +0x92, 0xA3, 0x12, 0x47, 0x5F, 0x7F, 0x96, 0x7E, 0x02, 0x12, 0x8A, 0x8E, 0xEF, 0x60, 0x45, 0x71, +0x5F, 0xFE, 0xEF, 0x24, 0x01, 0xFF, 0xE4, 0x3E, 0xFE, 0x90, 0x92, 0xA6, 0xEF, 0xF0, 0xEE, 0xFF, +0x90, 0xFD, 0x11, 0xF0, 0x90, 0x92, 0xA6, 0xE0, 0xFD, 0x90, 0x02, 0x94, 0xF0, 0xA3, 0xEF, 0xF0, +0x90, 0x92, 0xA3, 0xF1, 0xA7, 0x24, 0x02, 0xFF, 0xE4, 0x33, 0xFE, 0x12, 0x8D, 0x14, 0x90, 0x92, +0xA6, 0xE0, 0x24, 0x18, 0xFF, 0x90, 0x92, 0xA3, 0x12, 0x47, 0x56, 0x12, 0x8D, 0x87, 0x90, 0x02, +0x96, 0x74, 0x01, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x12, 0x47, 0x32, 0x02, 0x27, 0x15, 0xEA, +0x90, 0xFD, 0x11, 0xF0, 0xAF, 0x03, 0x22, 0x12, 0x46, 0xD6, 0x90, 0x8D, 0xF9, 0xE0, 0x22, 0xE0, +0xFC, 0xA3, 0xE0, 0xFD, 0xEC, 0xFF, 0x22, 0x12, 0x47, 0x56, 0x90, 0x00, 0x0E, 0x02, 0x26, 0x37, +0x90, 0x01, 0x1F, 0xE0, 0xFE, 0x90, 0x01, 0x1E, 0x22, 0x74, 0x00, 0x2F, 0xF9, 0xE4, 0x34, 0xFC, +0xFA, 0x7B, 0x01, 0x22, 0xEF, 0x60, 0x07, 0x90, 0x90, 0xD5, 0xE0, 0xFF, 0x51, 0x2A, 0x22, 0xE0, +0x24, 0x01, 0xFF, 0x90, 0x8D, 0xF9, 0xE0, 0x34, 0x00, 0xFE, 0xC3, 0x22, 0x8B, 0x0D, 0x8A, 0x0E, +0x89, 0x0F, 0x12, 0x4E, 0xCE, 0xFF, 0xF5, 0x11, 0x12, 0x26, 0x1E, 0xFE, 0xC3, 0x13, 0x30, 0xE0, +0x07, 0x12, 0x4F, 0xF1, 0xF5, 0x12, 0x80, 0x02, 0x8F, 0x12, 0x85, 0x11, 0x10, 0xE5, 0x10, 0xD3, +0x95, 0x12, 0x50, 0x24, 0xAB, 0x0D, 0xAA, 0x0E, 0xA9, 0x0F, 0x12, 0x26, 0x1E, 0x54, 0x01, 0xFD, +0xAF, 0x10, 0x11, 0x56, 0xAF, 0x10, 0x12, 0x6F, 0x2B, 0xEF, 0xAF, 0x10, 0x70, 0x04, 0x11, 0x39, +0x80, 0x02, 0x11, 0x40, 0x05, 0x10, 0x80, 0xD5, 0xE5, 0x11, 0x70, 0x0C, 0xFF, 0x12, 0x6F, 0x2B, +0xEF, 0x70, 0x05, 0x31, 0x0F, 0x54, 0x7F, 0xF0, 0x22, 0x11, 0x4A, 0xE0, 0x44, 0x04, 0xF0, 0x22, +0x11, 0x4A, 0xE0, 0x54, 0xFB, 0x11, 0xF7, 0x02, 0x27, 0x48, 0x8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, 0xEF, 0x22, 0x31, +0xE4, 0x90, 0x90, 0xE4, 0x31, 0xB7, 0x54, 0x04, 0xFF, 0xEE, 0x54, 0xFB, 0x4F, 0xF0, 0x12, 0x26, +0x1E, 0xC3, 0x13, 0x30, 0xE0, 0x07, 0x12, 0x4E, 0xCE, 0x90, 0x90, 0xE5, 0xF0, 0x22, 0x90, 0x90, +0xFE, 0x12, 0x47, 0x56, 0x12, 0x26, 0x1E, 0xFF, 0x54, 0x01, 0xFE, 0x22, 0x51, 0x1E, 0x51, 0x40, +0x31, 0xDE, 0x51, 0x39, 0x4E, 0xF0, 0xEF, 0xC3, 0x13, 0x30, 0xE0, 0x21, 0x12, 0x4E, 0xCE, 0x90, +0x90, 0xE9, 0x12, 0x4F, 0xF0, 0x90, 0x90, 0xEA, 0xF0, 0x12, 0x26, 0x1E, 0x54, 0x04, 0xFF, 0x90, +0x90, 0xE8, 0xE0, 0x54, 0xFB, 0x4F, 0x12, 0x4F, 0xAD, 0x90, 0x90, 0xEB, 0xF0, 0x22, 0x90, 0x90, +0xFE, 0x02, 0x47, 0x5F, 0x90, 0x8E, 0xC2, 0xE0, 0x14, 0x90, 0x8E, 0xC4, 0xF0, 0x22, 0x90, 0x01, +0xC7, 0x74, 0x10, 0xF0, 0x7F, 0x01, 0x12, 0x63, 0x09, 0x90, 0x90, 0xE8, 0xE0, 0x54, 0xFE, 0x22, +0x7E, 0x00, 0x7F, 0x08, 0x7D, 0x00, 0x7B, 0x01, 0x7A, 0x90, 0x79, 0xE8, 0x12, 0x49, 0x38, 0x90, +0x90, 0xE9, 0x74, 0x08, 0xF0, 0xA3, 0x74, 0x03, 0xF0, 0x22, 0xE4, 0xFD, 0xFC, 0xEF, 0x60, 0x1F, +0x90, 0x90, 0xD8, 0xE0, 0xFF, 0x12, 0x77, 0x80, 0x12, 0x87, 0xB9, 0x51, 0x1E, 0x90, 0x90, 0xFE, +0x12, 0x5B, 0xDD, 0x75, 0x43, 0x42, 0x7B, 0x01, 0x7A, 0x8F, 0x79, 0xA0, 0x12, 0x34, 0x2C, 0x22, +0xE4, 0x90, 0x8D, 0xF7, 0xF0, 0xA3, 0xF0, 0x90, 0x8D, 0x5F, 0xF0, 0xA3, 0xF0, 0x22, 0xD3, 0x10, +0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x92, 0x9B, 0x51, 0xE4, 0xA3, 0xF0, 0xA3, 0xF0, 0x90, 0x92, +0x9B, 0x51, 0xD8, 0xE0, 0x60, 0x24, 0xC3, 0x90, 0x92, 0x9E, 0xE0, 0x94, 0xE8, 0x90, 0x92, 0x9D, +0xE0, 0x94, 0x03, 0x40, 0x0B, 0x90, 0x01, 0xC0, 0xE0, 0x44, 0x80, 0xF0, 0x7F, 0x00, 0x80, 0x0C, +0x90, 0x92, 0x9D, 0x12, 0x59, 0x26, 0x51, 0xD1, 0x80, 0xD4, 0x7F, 0x01, 0xD0, 0xD0, 0x92, 0xAF, +0x22, 0x7F, 0x0A, 0x7E, 0x00, 0x02, 0x3A, 0xF7, 0xE0, 0xFE, 0xA3, 0xE0, 0xF5, 0x82, 0x8E, 0x83, +0x22, 0x90, 0x91, 0x0E, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0xE4, 0x22, 0x90, 0x91, 0x1E, 0x51, 0xE4, +0x90, 0x91, 0x26, 0xF0, 0x90, 0x91, 0x26, 0xE0, 0xFD, 0xC3, 0x94, 0x06, 0x50, 0x22, 0x90, 0x91, +0x1F, 0xE0, 0x24, 0x04, 0x71, 0xE1, 0x12, 0x5E, 0x54, 0x90, 0x91, 0x26, 0xE0, 0x24, 0x20, 0xF5, +0x82, 0xE4, 0x34, 0x91, 0xF5, 0x83, 0xEF, 0xF0, 0x90, 0x91, 0x26, 0xE0, 0x04, 0xF0, 0x80, 0xD4, +0x78, 0xCF, 0x7C, 0x8E, 0x7D, 0x01, 0x7B, 0x01, 0x7A, 0x91, 0x79, 0x20, 0x71, 0xEA, 0x7F, 0x00, +0x70, 0x02, 0x7F, 0x01, 0x22, 0x71, 0xF3, 0x78, 0x11, 0x7C, 0x91, 0x7D, 0x01, 0x7B, 0xFF, 0x7A, +0x40, 0x79, 0x64, 0x12, 0x5F, 0xD3, 0x78, 0x18, 0x7C, 0x91, 0x7D, 0x01, 0x7B, 0xFF, 0x7A, 0x40, +0x79, 0x6A, 0x12, 0x5F, 0xCC, 0x12, 0x5F, 0xB0, 0x51, 0xEB, 0xEF, 0x70, 0x02, 0x61, 0xE0, 0x12, +0x5E, 0xF8, 0xFE, 0x90, 0x91, 0x1C, 0xF0, 0xA3, 0xEF, 0xF0, 0x24, 0x06, 0xFF, 0xE4, 0x3E, 0x12, +0x5F, 0x2C, 0xEF, 0x64, 0x08, 0x70, 0x69, 0x90, 0x91, 0x1D, 0xE0, 0x24, 0x07, 0xFF, 0x90, 0x91, +0x1C, 0x12, 0x5F, 0x29, 0xEF, 0x70, 0x59, 0x90, 0x91, 0x17, 0xF0, 0x90, 0x91, 0x17, 0xE0, 0xFF, +0xC3, 0x94, 0x04, 0x50, 0x24, 0x90, 0x91, 0x1D, 0xE0, 0x24, 0x18, 0xFD, 0x90, 0x91, 0x1C, 0x12, +0x5E, 0x46, 0x90, 0x91, 0x17, 0xE0, 0x24, 0x18, 0xF5, 0x82, 0xE4, 0x34, 0x91, 0xF5, 0x83, 0xEF, +0xF0, 0x90, 0x91, 0x17, 0xE0, 0x04, 0xF0, 0x80, 0xD2, 0x78, 0x18, 0x7C, 0x91, 0x91, 0x95, 0x70, +0x1F, 0x90, 0x91, 0x1D, 0xE0, 0x24, 0x08, 0xFF, 0x90, 0x91, 0x1C, 0xE0, 0x34, 0x00, 0xFE, 0x12, +0x5E, 0x81, 0xEF, 0x64, 0x01, 0x60, 0x09, 0x90, 0x01, 0xC7, 0x74, 0x22, 0xF0, 0x12, 0x5F, 0xDA, +0x22, 0xFF, 0x90, 0x91, 0x1E, 0xE0, 0x34, 0x00, 0xFE, 0x22, 0x7E, 0x00, 0x7F, 0x06, 0x12, 0x49, +0x14, 0xEF, 0x22, 0x90, 0x91, 0x0E, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0xA3, 0xED, 0xF0, 0x22, 0x71, +0xF3, 0xE4, 0xA3, 0xF0, 0x91, 0x80, 0x50, 0x1A, 0x12, 0x5F, 0xB0, 0x91, 0x89, 0x24, 0xB0, 0xF5, +0x82, 0xE4, 0x34, 0x90, 0xF5, 0x83, 0xE0, 0xB5, 0x07, 0x1D, 0x90, 0x91, 0x11, 0xE0, 0x04, 0xF0, +0x80, 0xE2, 0x90, 0x06, 0x32, 0xE0, 0x44, 0x80, 0xF0, 0x90, 0x01, 0xC7, 0x74, 0x30, 0xF0, 0x7F, +0x01, 0x12, 0x63, 0x09, 0x7F, 0x01, 0x22, 0x7F, 0x00, 0x22, 0x71, 0xF3, 0x90, 0x90, 0x82, 0xE0, +0x70, 0x02, 0xA3, 0xE0, 0x60, 0x26, 0xE4, 0x90, 0x91, 0x11, 0xF0, 0x91, 0x80, 0x50, 0x20, 0x12, +0x5F, 0xB0, 0x91, 0x89, 0x24, 0x90, 0xF5, 0x82, 0xE4, 0x34, 0x90, 0xF5, 0x83, 0xE0, 0x6F, 0x60, +0x03, 0x7F, 0x00, 0x22, 0x90, 0x91, 0x11, 0xE0, 0x04, 0xF0, 0x80, 0xDF, 0x7F, 0x00, 0x22, 0x90, +0x06, 0x32, 0xE0, 0x44, 0x40, 0xF0, 0xE4, 0x90, 0x90, 0x8E, 0xF0, 0xA3, 0xF0, 0x7F, 0x01, 0x22, +0x90, 0x91, 0x11, 0xE0, 0xFD, 0xC3, 0x94, 0x02, 0x22, 0xED, 0x24, 0x1C, 0xFD, 0x12, 0x5E, 0x54, +0x90, 0x91, 0x11, 0xE0, 0x22, 0x7D, 0x01, 0x7B, 0x01, 0x7A, 0x8E, 0x79, 0xF0, 0x7E, 0x00, 0x7F, +0x04, 0x12, 0x49, 0x14, 0xEF, 0x22, 0xE4, 0x90, 0x90, 0xFA, 0xF0, 0xA3, 0xF0, 0x90, 0x02, 0x86, +0xE0, 0x20, 0xE1, 0x23, 0xC3, 0x90, 0x90, 0xFB, 0xE0, 0x94, 0xD0, 0x90, 0x90, 0xFA, 0xE0, 0x94, +0x07, 0x40, 0x0A, 0x90, 0x01, 0xC1, 0xE0, 0x44, 0x04, 0xF0, 0x7F, 0x00, 0x22, 0x90, 0x90, 0xFA, +0x12, 0x59, 0x26, 0x51, 0xD1, 0x80, 0xD6, 0x7F, 0x01, 0x22, 0x51, 0xE1, 0xA3, 0xF0, 0x90, 0x91, +0x10, 0xE0, 0xFD, 0xC3, 0x94, 0x04, 0x50, 0x29, 0x90, 0x91, 0x0F, 0xE0, 0x24, 0x10, 0x12, 0x5F, +0x02, 0xFE, 0x12, 0x5E, 0x54, 0x90, 0x91, 0x10, 0xE0, 0x24, 0x88, 0xF5, 0x82, 0xE4, 0x34, 0x90, +0xF5, 0x83, 0xE0, 0x6F, 0x60, 0x03, 0x7F, 0x00, 0x22, 0x90, 0x91, 0x10, 0xE0, 0x04, 0xF0, 0x80, +0xCD, 0x7F, 0x01, 0x22, 0xE4, 0xFC, 0xED, 0x2C, 0x24, 0x00, 0xB1, 0x5D, 0xE4, 0xF0, 0x0C, 0xEC, +0xB4, 0x18, 0xF3, 0x74, 0x00, 0x2D, 0xB1, 0x5D, 0xEF, 0xF0, 0xEE, 0x54, 0x3F, 0xFF, 0x74, 0x01, +0x2D, 0xF5, 0x82, 0xE4, 0x34, 0xFB, 0xF5, 0x83, 0xEF, 0xF0, 0x74, 0x02, 0x2D, 0xF5, 0x82, 0xE4, +0x34, 0xFB, 0xF5, 0x83, 0xE0, 0x54, 0xF0, 0xF0, 0xB1, 0x7C, 0xE0, 0x44, 0x80, 0xF0, 0x74, 0x0B, +0x2D, 0xF5, 0x82, 0xE4, 0x34, 0xFB, 0xF5, 0x83, 0xE0, 0x44, 0x10, 0xF0, 0x22, 0xF5, 0x82, 0xE4, +0x34, 0xFB, 0xF5, 0x83, 0x22, 0xF0, 0xA3, 0xEF, 0xF0, 0x74, 0x02, 0x2D, 0xF5, 0x82, 0xE4, 0x34, +0xFB, 0xF5, 0x83, 0xE0, 0x54, 0x0F, 0x33, 0x33, 0x33, 0x54, 0xF8, 0xFF, 0x74, 0x03, 0x2D, 0xF5, +0x82, 0xE4, 0x34, 0xFB, 0xF5, 0x83, 0x22, 0x90, 0x92, 0x9F, 0xEF, 0xF0, 0xA3, 0x12, 0x47, 0x5F, +0x90, 0x92, 0xC0, 0xE0, 0xFE, 0x04, 0xF0, 0xB1, 0xEF, 0x74, 0x00, 0x2F, 0xF9, 0xE4, 0x34, 0xFB, +0xFA, 0x7B, 0x01, 0xC0, 0x03, 0xC0, 0x02, 0xC0, 0x01, 0x90, 0x92, 0xA0, 0x12, 0x5B, 0xDD, 0x75, +0x43, 0x02, 0xD0, 0x01, 0xD0, 0x02, 0xD0, 0x03, 0x12, 0x34, 0x2C, 0x90, 0x92, 0x9F, 0xE0, 0x24, +0x02, 0xF9, 0xE4, 0x34, 0xFB, 0xFA, 0x7B, 0x01, 0xC0, 0x03, 0xC0, 0x02, 0xC0, 0x01, 0xA3, 0x12, +0x47, 0x56, 0xE9, 0x24, 0x02, 0xF9, 0xE4, 0x3A, 0x8B, 0x40, 0xF5, 0x41, 0x89, 0x42, 0x90, 0x92, +0xA0, 0x12, 0x87, 0xA7, 0xF5, 0x43, 0xD0, 0x01, 0xD0, 0x02, 0xD0, 0x03, 0x02, 0x34, 0x2C, 0x90, +0x00, 0x01, 0xEE, 0x02, 0x26, 0x76, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xE4, 0xFF, 0x90, +0x8D, 0xF8, 0xE0, 0xFE, 0x90, 0x8D, 0xF7, 0xE0, 0xFD, 0xB5, 0x06, 0x04, 0x7E, 0x01, 0x80, 0x02, +0x7E, 0x00, 0xEE, 0x64, 0x01, 0x60, 0x40, 0xED, 0xD1, 0x5C, 0xFA, 0x7B, 0x01, 0x12, 0x87, 0x28, +0x7F, 0x01, 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, 0xDD, 0x22, 0x2F, 0xF5, 0x82, +0xE4, 0x34, 0x06, 0xF5, 0x83, 0xE0, 0x22, 0xE4, 0xFF, 0x74, 0x96, 0x2F, 0xF5, 0x82, 0xE4, 0x34, +0x8F, 0xF5, 0x83, 0xE0, 0xFE, 0x74, 0x84, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x04, 0xD1, 0xB0, 0xB4, +0x08, 0xE7, 0x90, 0x8F, 0x9E, 0xE0, 0x90, 0x04, 0x8C, 0xF0, 0x22, 0xF1, 0x30, 0xD1, 0xE7, 0x90, +0x01, 0x3F, 0x74, 0x04, 0xF0, 0x90, 0x8D, 0x07, 0xE0, 0xFF, 0xB4, 0x01, 0x07, 0x90, 0xFD, 0x00, +0xE0, 0x54, 0xEF, 0xF0, 0xEF, 0xB4, 0x01, 0x07, 0x90, 0xFE, 0x10, 0xE0, 0x54, 0xFB, 0xF0, 0x22, +0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xE4, 0xFD, 0x7F, 0x8F, 0x12, 0x3A, 0x96, 0xD0, 0xD0, +0x92, 0xAF, 0x22, 0xE4, 0xF5, 0x55, 0xF5, 0x56, 0xF5, 0x57, 0x75, 0x58, 0x80, 0xAD, 0x55, 0x7F, +0x50, 0x12, 0x3A, 0x96, 0xAD, 0x56, 0x7F, 0x51, 0x12, 0x3A, 0x96, 0xAD, 0x57, 0x7F, 0x52, 0x12, +0x3A, 0x96, 0xAD, 0x58, 0x7F, 0x53, 0x02, 0x3A, 0x96, 0x75, 0x5D, 0x10, 0xE4, 0xF5, 0x5E, 0x75, +0x5F, 0x07, 0x75, 0x60, 0x42, 0x90, 0x01, 0x30, 0xE5, 0x5D, 0xF0, 0xA3, 0xE5, 0x5E, 0xF0, 0xA3, +0xE5, 0x5F, 0xF0, 0xA3, 0xE5, 0x60, 0xF0, 0x22, 0x75, 0x65, 0x06, 0x75, 0x66, 0x01, 0x75, 0x67, +0x03, 0x75, 0x68, 0x62, 0x90, 0x01, 0x38, 0xE5, 0x65, 0xF0, 0xA3, 0xE5, 0x66, 0xF0, 0xA3, 0xE5, +0x67, 0xF0, 0xA3, 0xE5, 0x68, 0xF0, 0x22, 0x90, 0x01, 0x94, 0xE0, 0x44, 0x01, 0xF0, 0x90, 0x01, +0xC7, 0xE4, 0xF0, 0x22, 0x90, 0x01, 0x01, 0xE0, 0x44, 0x04, 0xF0, 0x90, 0x01, 0x9C, 0x74, 0x7E, +0xF0, 0xA3, 0x74, 0x92, 0xF0, 0xA3, 0x74, 0xA0, 0xF0, 0xA3, 0x74, 0x24, 0xF0, 0x90, 0x01, 0x9B, +0x74, 0x49, 0xF0, 0x90, 0x01, 0x9A, 0x74, 0xE0, 0xF0, 0x90, 0x01, 0x99, 0xE4, 0xF0, 0x90, 0x01, +0x98, 0x04, 0xF0, 0x22, 0x7D, 0x02, 0x90, 0x01, 0xC4, 0x74, 0xE4, 0xF0, 0x74, 0x8F, 0xA3, 0xF0, +0x90, 0x90, 0xE3, 0xE0, 0xFF, 0xED, 0xC3, 0x9F, 0x50, 0x10, 0xED, 0x25, 0xE0, 0x24, 0x81, 0xF8, +0xE6, 0x30, 0xE4, 0x03, 0x7F, 0x00, 0x22, 0x0D, 0x80, 0xE6, 0x74, 0xE4, 0x04, 0x90, 0x01, 0xC4, +0xF0, 0x74, 0x8F, 0xA3, 0xF0, 0x7F, 0x01, 0x22, 0xE4, 0x90, 0x8D, 0x01, 0x02, 0x4D, 0x10, 0x90, +0x01, 0xE4, 0x74, 0x26, 0xF0, 0xA3, 0xE4, 0xF0, 0x22, 0x90, 0x01, 0x34, 0xE0, 0x55, 0x5D, 0xF5, 0x61, 0xA3, 0xE0, 0x55, 0x5E, 0xF5, 0x62, 0xA3, 0xE0, 0x55, 0x5F, 0xF5, 0x63, 0xA3, 0xE0, 0x55, 0x60, 0xF5, 0x64, 0x90, 0x01, 0x34, 0xE5, 0x61, 0xF0, 0xA3, 0xE5, 0x62, 0xF0, 0xA3, 0xE5, 0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FB, 0xFD, 0x7F, 0x03, 0x12, 0x3A, 0x96, 0x80, +0xFE, 0x22, 0x90, 0x90, 0xEE, 0xE0, 0x04, 0xF0, 0x90, 0x8E, 0x15, 0xE0, 0x64, 0x02, 0x60, 0x03, +0x12, 0x70, 0xB2, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x04, 0x1D, 0xE0, 0x60, 0x1A, 0x90, 0x05, 0x22, 0xE0, 0x54, 0x90, 0x60, 0x07, 0x90, 0x01, 0xC0, 0xE0, 0x44, 0x08, 0xF0, 0x90, 0x01, 0xC6, 0xE0, 0x30, 0xE1, 0xE4, 0x7F, 0x00, 0x80, 0x02, 0x7F, 0x01, 0xD0, 0xD0, 0x92, -0xAF, 0x22, 0x90, 0x90, 0x47, 0xEF, 0xF0, 0xE4, 0x90, 0x90, 0x4B, 0xF0, 0xA3, 0xF0, 0x90, 0x06, -0x32, 0xE0, 0x44, 0x20, 0xF0, 0xB1, 0xC4, 0xEF, 0x64, 0x01, 0x70, 0x78, 0x90, 0x8F, 0xFC, 0x12, -0x6F, 0x05, 0x90, 0x90, 0x48, 0xD1, 0x85, 0x90, 0x90, 0x4A, 0xEF, 0xF0, 0x90, 0x90, 0x48, 0xA3, -0xE0, 0x24, 0x28, 0xF9, 0xE4, 0x34, 0xFC, 0xFA, 0x7B, 0x01, 0xE4, 0xFD, 0xD1, 0xBA, 0x90, 0x90, -0x4A, 0xE0, 0xFF, 0x90, 0x90, 0x49, 0xE0, 0x2F, 0xFF, 0x90, 0x90, 0x48, 0xE0, 0x34, 0x00, 0xCF, -0x24, 0x30, 0xCF, 0x34, 0x00, 0xFE, 0x90, 0x90, 0x4B, 0xF0, 0xA3, 0xEF, 0xF0, 0x12, 0x90, 0x77, -0x90, 0x90, 0x4B, 0xE0, 0xFC, 0xA3, 0xE0, 0xFD, 0x90, 0x8F, 0xFC, 0xE0, 0xFB, 0xE4, 0xFF, 0x12, -0x90, 0xFE, 0x90, 0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 0xB6, 0x90, 0x90, -0xC6, 0xE0, 0xFD, 0x90, 0x8E, 0xB5, 0xE0, 0x90, 0x90, 0xA4, 0xF0, 0x12, 0x8C, 0x3A, 0x90, 0x90, -0xC8, 0xE0, 0xFF, 0x90, 0x90, 0xC3, 0x12, 0x47, 0x4A, 0x90, 0x90, 0xC7, 0xE0, 0x7C, 0x00, 0x29, -0xF9, 0xEC, 0x3A, 0xFA, 0xC3, 0xE9, 0x9F, 0xF9, 0xEA, 0x94, 0x00, 0xFA, 0x75, 0x40, 0x01, 0x75, -0x41, 0x8E, 0x75, 0x42, 0xB6, 0xA3, 0xE0, 0xF5, 0x43, 0x12, 0x34, 0x2C, 0x22, 0xD3, 0x10, 0xAF, -0x01, 0xC3, 0xC0, 0xD0, 0xEF, 0x20, 0xE0, 0x05, 0x90, 0x8F, 0xF0, 0x80, 0x03, 0x90, 0x8F, 0xF1, -0xE0, 0x90, 0x8E, 0xB5, 0xF0, 0x90, 0x8E, 0xB5, 0xE0, 0x14, 0x60, 0x13, 0x14, 0x60, 0x14, 0x24, -0xFE, 0x60, 0x10, 0x14, 0x60, 0x09, 0x14, 0x60, 0x06, 0x24, 0x06, 0xE4, 0xFE, 0x80, 0x06, 0x7E, -0x04, 0x80, 0x02, 0x7E, 0x08, 0xAF, 0x06, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x12, 0x6F, 0xBD, 0x7E, -0x00, 0x90, 0x90, 0x12, 0xD1, 0x85, 0x90, 0x90, 0x12, 0xA3, 0xE0, 0x2F, 0x24, 0x3E, 0xF9, 0xE4, -0x34, 0xFC, 0x75, 0x40, 0x01, 0xF5, 0x41, 0x89, 0x42, 0x75, 0x43, 0x04, 0x7B, 0x01, 0x7A, 0x8E, -0x79, 0xB1, 0x02, 0x34, 0x2C, 0xEF, 0x60, 0x07, 0x90, 0x8F, 0xF3, 0xE0, 0xFF, 0xF1, 0x9C, 0x22, -0xC3, 0xEE, 0x94, 0x01, 0x40, 0x0A, 0x0D, 0xED, 0x13, 0x90, 0xFD, 0x10, 0xF0, 0xE4, 0x2F, 0xFF, -0x22, 0xC3, 0xEE, 0x94, 0x01, 0x40, 0x1E, 0x90, 0xFD, 0x11, 0xE0, 0xB5, 0x05, 0x14, 0x90, 0x01, -0x17, 0xE0, 0xB5, 0x05, 0x07, 0x90, 0xFD, 0x11, 0xE4, 0xF0, 0x80, 0x06, 0xED, 0x04, 0x90, 0xFD, -0x11, 0xF0, 0xE4, 0x2F, 0xFF, 0x22, 0xFB, 0x7D, 0x08, 0x7F, 0x01, 0x90, 0x91, 0x01, 0xEB, 0xF0, -0xEF, 0x70, 0x06, 0xA3, 0x74, 0x03, 0xF0, 0x80, 0x0B, 0xEF, 0x64, 0x01, 0x70, 0x35, 0x90, 0x91, -0x02, 0x74, 0x42, 0xF0, 0x7F, 0xE2, 0x12, 0x3A, 0x96, 0x90, 0x91, 0x01, 0xE0, 0xFD, 0x7F, 0xE0, -0x12, 0x3A, 0x96, 0x90, 0x91, 0x02, 0xE0, 0xFD, 0x7F, 0xE3, 0x12, 0x3A, 0x96, 0x90, 0x91, 0x02, -0xE0, 0x54, 0xFD, 0xFD, 0x7F, 0xE3, 0x12, 0x3A, 0x96, 0xE4, 0xFD, 0x7F, 0xE3, 0x12, 0x3A, 0x96, -0x7F, 0x01, 0x22, 0x90, 0x01, 0xC2, 0xE0, 0x44, 0x01, 0xF0, 0x7F, 0x00, 0x22, 0x8F, 0x1F, 0xE4, -0x90, 0x91, 0x05, 0xF0, 0xA3, 0xF0, 0x90, 0x01, 0x09, 0xE0, 0x7F, 0x00, 0x30, 0xE7, 0x02, 0x7F, -0x01, 0xEF, 0x65, 0x1F, 0x60, 0x3E, 0xC3, 0x90, 0x91, 0x06, 0xE0, 0x94, 0x88, 0x90, 0x91, 0x05, -0xE0, 0x94, 0x13, 0x40, 0x08, 0x90, 0x01, 0xC0, 0xE0, 0x44, 0x10, 0xF0, 0x22, 0x90, 0x91, 0x05, -0xE4, 0x75, 0xF0, 0x01, 0x12, 0x46, 0xF6, 0x7F, 0x14, 0x7E, 0x00, 0x12, 0x3A, 0xF7, 0xD3, 0x90, -0x91, 0x06, 0xE0, 0x94, 0x32, 0x90, 0x91, 0x05, 0xE0, 0x94, 0x00, 0x40, 0xB9, 0x90, 0x01, 0xC6, -0xE0, 0x30, 0xE0, 0xB2, 0x22, 0x31, 0x43, 0x90, 0x00, 0x08, 0xE0, 0x54, 0xEF, 0xFD, 0x7F, 0x08, -0x12, 0x3A, 0x96, 0xE4, 0xFF, 0x11, 0x5D, 0x90, 0x8D, 0x05, 0xE0, 0xB4, 0x03, 0x0C, 0x90, 0x00, -0x70, 0xE0, 0x54, 0x7F, 0xFD, 0x7F, 0x70, 0x12, 0x3A, 0x96, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, -0xC0, 0xD0, 0x11, 0xEB, 0x11, 0xB5, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0x8D, 0x05, 0xE0, 0xB4, -0x03, 0x0C, 0x90, 0x00, 0x70, 0xE0, 0x44, 0x80, 0xFD, 0x7F, 0x70, 0x12, 0x3A, 0x96, 0x90, 0x8E, -0x86, 0xE0, 0xFD, 0x7F, 0x93, 0x12, 0x3A, 0x96, 0x90, 0x8E, 0x7D, 0xE0, 0x60, 0x12, 0x90, 0x01, -0x2F, 0xE0, 0x30, 0xE7, 0x05, 0x74, 0x10, 0xF0, 0x80, 0x06, 0x90, 0x01, 0x2F, 0x74, 0x90, 0xF0, -0x90, 0x00, 0x08, 0xE0, 0x44, 0x10, 0xFD, 0x7F, 0x08, 0x12, 0x3A, 0x96, 0x7F, 0x01, 0x11, 0x5D, -0x90, 0x00, 0x90, 0xE0, 0x44, 0x01, 0xFD, 0x7F, 0x90, 0x12, 0x3A, 0x96, 0x7F, 0x14, 0x7E, 0x00, -0x02, 0x3A, 0xF7, 0x90, 0x00, 0x90, 0xE0, 0x20, 0xE0, 0xF9, 0x22, 0x90, 0x91, 0x07, 0xEF, 0xF0, -0xA3, 0xED, 0xF0, 0x90, 0x00, 0xF1, 0xE0, 0x54, 0xF0, 0x64, 0x20, 0x60, 0x02, 0x41, 0x2F, 0x90, -0x91, 0x08, 0xE0, 0xB4, 0x01, 0x1D, 0x90, 0x91, 0x07, 0xE0, 0xB4, 0x0B, 0x16, 0x90, 0x90, 0x71, -0x12, 0x27, 0x54, 0x00, 0x00, 0x0C, 0x00, 0x90, 0x90, 0x75, 0x12, 0x27, 0x54, 0x00, 0x00, 0x0C, -0x00, 0x80, 0x14, 0x90, 0x90, 0x71, 0x12, 0x27, 0x54, 0x00, 0x00, 0x0C, 0x00, 0x90, 0x90, 0x75, -0x12, 0x27, 0x54, 0x00, 0x00, 0x08, 0x00, 0x7F, 0xAC, 0x7E, 0x08, 0x12, 0x63, 0xBC, 0x90, 0x91, -0x08, 0xE0, 0x70, 0x2A, 0x90, 0x91, 0x07, 0xE0, 0xFF, 0x64, 0x0D, 0x60, 0x04, 0xEF, 0xB4, 0x0E, -0x1D, 0x90, 0x90, 0x71, 0x12, 0x27, 0x54, 0x00, 0x00, 0x03, 0x00, 0x90, 0x90, 0x75, 0x12, 0x27, -0x54, 0x00, 0x00, 0x03, 0x00, 0x7F, 0xAC, 0x7E, 0x08, 0x12, 0x63, 0xBC, 0x80, 0x0E, 0x90, 0x91, -0x08, 0xE0, 0xB4, 0x01, 0x1D, 0x90, 0x91, 0x07, 0xE0, 0xB4, 0x0B, 0x16, 0x90, 0x90, 0x71, 0x12, -0x27, 0x54, 0x40, 0x00, 0x00, 0x00, 0x90, 0x90, 0x75, 0x12, 0x27, 0x54, 0x40, 0x00, 0x00, 0x00, -0x80, 0x39, 0x90, 0x91, 0x08, 0xE0, 0x64, 0x02, 0x70, 0x02, 0x41, 0x7E, 0x90, 0x90, 0x71, 0x12, -0x27, 0x54, 0x00, 0x00, 0x03, 0x00, 0x90, 0x90, 0x75, 0x12, 0x27, 0x54, 0x00, 0x00, 0x02, 0x00, -0x7F, 0xAC, 0x7E, 0x08, 0x12, 0x63, 0xBC, 0x90, 0x90, 0x71, 0x12, 0x27, 0x54, 0x40, 0x00, 0x00, -0x00, 0x90, 0x90, 0x75, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xC4, 0x80, 0x4A, 0x90, -0x91, 0x08, 0xE0, 0x70, 0x25, 0x90, 0x91, 0x07, 0xE0, 0xFF, 0x64, 0x0D, 0x60, 0x04, 0xEF, 0xB4, -0x0E, 0x18, 0x90, 0x90, 0x71, 0x12, 0x27, 0x54, 0x00, 0x00, 0x03, 0x00, 0x90, 0x90, 0x75, 0x12, -0x27, 0x54, 0x00, 0x00, 0x03, 0x00, 0x7F, 0xAC, 0x80, 0x1F, 0x90, 0x91, 0x07, 0xE0, 0xD3, 0x94, -0x0E, 0x50, 0x1B, 0x90, 0x90, 0x71, 0x12, 0x27, 0x54, 0x00, 0x00, 0x03, 0x00, 0x90, 0x90, 0x75, -0x12, 0x27, 0x54, 0x00, 0x00, 0x02, 0x00, 0x7F, 0xAC, 0x7E, 0x08, 0x12, 0x63, 0xBC, 0x22, 0x90, -0x04, 0x54, 0xE0, 0x7F, 0x00, 0x30, 0xE7, 0x02, 0x7F, 0x01, 0x22, 0x90, 0x91, 0x0A, 0xED, 0xF0, -0x90, 0x91, 0x09, 0xEF, 0xF0, 0xD3, 0x94, 0x0E, 0x50, 0x15, 0x51, 0x7F, 0xEF, 0x60, 0x2A, 0x51, -0x7F, 0xEF, 0x64, 0x01, 0x70, 0x23, 0x90, 0x91, 0x0A, 0xE0, 0xFD, 0xE4, 0xFF, 0x80, 0x15, 0x90, -0x91, 0x09, 0xE0, 0xD3, 0x94, 0x0E, 0x40, 0x11, 0x51, 0x7F, 0xEF, 0x70, 0x0A, 0x90, 0x91, 0x0A, -0xE0, 0xFD, 0x7F, 0x01, 0x02, 0x66, 0xF9, 0x51, 0x7F, 0x22, 0x90, 0x90, 0x00, 0xE0, 0x54, 0xFE, -0xF0, 0x54, 0x7F, 0xF0, 0xA3, 0x74, 0x0A, 0xF0, 0xE4, 0xA3, 0xF0, 0x22, 0x90, 0x90, 0x00, 0xE0, -0x30, 0xE0, 0x2E, 0x90, 0x8D, 0xF8, 0xE0, 0xB4, 0x01, 0x27, 0x90, 0x91, 0x10, 0xE0, 0x04, 0xF0, -0xE0, 0xB4, 0x0A, 0x0B, 0x90, 0x90, 0x02, 0xE0, 0x04, 0xF0, 0xE4, 0x90, 0x91, 0x10, 0xF0, 0x90, -0x90, 0x02, 0xE0, 0xFF, 0x90, 0x90, 0x01, 0xE0, 0xB5, 0x07, 0x06, 0xE4, 0xA3, 0xF0, 0x12, 0x57, -0xE1, 0x22, 0x12, 0x26, 0x1E, 0xFF, 0x54, 0x01, 0xFE, 0x90, 0x90, 0x00, 0xE0, 0x54, 0xFE, 0x4E, -0xF0, 0xEF, 0xC3, 0x13, 0x30, 0xE0, 0x0A, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0x90, 0x90, 0x01, -0xF0, 0x22, 0xE4, 0x90, 0x90, 0x0F, 0xF0, 0xA3, 0xF0, 0x90, 0x02, 0x86, 0xE0, 0x20, 0xE1, 0x2C, -0xC3, 0x90, 0x90, 0x10, 0xE0, 0x94, 0xD0, 0x90, 0x90, 0x0F, 0xE0, 0x94, 0x07, 0x40, 0x0A, 0x90, -0x01, 0xC1, 0xE0, 0x44, 0x04, 0xF0, 0x7F, 0x00, 0x22, 0x90, 0x90, 0x0F, 0xE4, 0x75, 0xF0, 0x01, -0x12, 0x46, 0xF6, 0x7F, 0x0A, 0x7E, 0x00, 0x12, 0x3A, 0xF7, 0x80, 0xCD, 0x7F, 0x01, 0x22, 0xE0, -0xFE, 0xA3, 0xE0, 0xFF, 0x7D, 0x07, 0xEF, 0x5D, 0xC3, 0x60, 0x14, 0x74, 0xFF, 0x9D, 0xFD, 0x74, -0xFF, 0x94, 0x00, 0x5E, 0xFE, 0xED, 0x5F, 0x24, 0x08, 0xFF, 0xE4, 0x3E, 0xFE, 0x80, 0x0D, 0x74,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22, 0x7F, 0x01, 0x22, 0x90, 0x90, 0x24, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0xE4, 0x90, 0x90, -0x2C, 0xF0, 0x90, 0x90, 0x2C, 0xE0, 0xFD, 0xC3, 0x94, 0x06, 0x50, 0x28, 0x90, 0x90, 0x25, 0xE0, -0x24, 0x04, 0xFF, 0x90, 0x90, 0x24, 0xE0, 0x34, 0x00, 0xFE, 0x12, 0x5B, 0xA6, 0x90, 0x90, 0x2C, -0xE0, 0x24, 0x26, 0xF5, 0x82, 0xE4, 0x34, 0x90, 0xF5, 0x83, 0xEF, 0xF0, 0x90, 0x90, 0x2C, 0xE0, -0x04, 0xF0, 0x80, 0xCE, 0x78, 0x9E, 0x7C, 0x8E, 0x7D, 0x01, 0x7B, 0x01, 0x7A, 0x90, 0x79, 0x26, -0x7E, 0x00, 0x7F, 0x06, 0x12, 0x49, 0x08, 0xEF, 0x7F, 0x00, 0x70, 0x02, 0x7F, 0x01, 0x22, 0x12, -0x6F, 0xBD, 0x7E, 0x00, 0x74, 0x00, 0x2F, 0xF9, 0xE4, 0x34, 0xFC, 0x75, 0x40, 0x01, 0xF5, 0x41, -0x89, 0x42, 0x75, 0x43, 0x08, 0x7B, 0x01, 0x7A, 0x8E, 0x79, 0xB6, 0x02, 0x34, 0x2C, 0x90, 0x90, -0x3D, 0x12, 0x47, 0x53, 0x90, 0x8F, 0xF3, 0x12, 0x6F, 0x05, 0x90, 0x90, 0x44, 0x12, 0x7E, 0x85, -0x90, 0x90, 0x46, 0xEF, 0xF0, 0x90, 0x90, 0x44, 0xA3, 0xE0, 0x24, 0x28, 0xF9, 0xE4, 0x34, 0xFC, -0xFA, 0x7B, 0x01, 0x90, 0x90, 0x43, 0xE0, 0xFD, 0x12, 0x7E, 0xBA, 0x90, 0x90, 0x44, 0xA3, 0xE0, -0x24, 0x38, 0xF9, 0xE4, 0x34, 0xFC, 0xFA, 0x7B, 0x01, 0xC0, 0x03, 0xC0, 0x02, 0xC0, 0x01, 0x90, -0x90, 0x40, 0x12, 0x47, 0x4A, 0x8B, 0x40, 0x8A, 0x41, 0x89, 0x42, 0x75, 0x43, 0x06, 0xD0, 0x01, -0xD0, 0x02, 0xD0, 0x03, 0x12, 0x34, 0x2C, 0x90, 0x90, 0x44, 0xA3, 0xE0, 0xFF, 0xA3, 0xE0, 0x2F, -0x24, 0x42, 0xF9, 0xE4, 0x34, 0xFC, 0xFA, 0x7B, 0x01, 0xC0, 0x03, 0xC0, 0x02, 0xC0, 0x01, 0x90, -0x90, 0x40, 0x12, 0x47, 0x4A, 0x8B, 0x40, 0x8A, 0x41, 0x89, 0x42, 0x75, 0x43, 0x06, 0xD0, 0x01, -0xD0, 0x02, 0xD0, 0x03, 0x12, 0x34, 0x2C, 0x90, 0x90, 0x44, 0xA3, 0xE0, 0xFF, 0xA3, 0xE0, 0x2F, -0x24, 0x48, 0xF9, 0xE4, 0x34, 0xFC, 0xFA, 0x7B, 0x01, 0xC0, 0x03, 0xC0, 0x02, 0xC0, 0x01, 0x90, -0x90, 0x3D, 0x12, 0x47, 0x4A, 0x8B, 0x40, 0x8A, 0x41, 0x89, 0x42, 0x75, 0x43, 0x04, 0xD0, 0x01, -0xD0, 0x02, 0xD0, 0x03, 0x12, 0x34, 0x2C, 0x90, 0x06, 0x30, 0xE0, 0x44, 0x10, 0xF0, 0x12, 0x7D, -0xC4, 0xBF, 0x01, 0x0E, 0x90, 0x8F, 0xF3, 0xE0, 0x90, 0x04, 0x25, 0xF0, 0x90, 0x04, 0x1F, 0x74, -0x20, 0xF0, 0x22, 0x90, 0x8E, 0x9D, 0xE0, 0x30, 0xE0, 0x03, 0x7F, 0x01, 0x22, 0x90, 0x06, 0x90, -0xE0, 0x20, 0xE5, 0x0A, 0x90, 0x01, 0x3F, 0xE0, 0x30, 0xE2, 0x03, 0x7F, 0x01, 0x22, 0x7F, 0x00, -0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x12, 0x26, 0x1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F, 0x60, 0x06, 0x12, 0x8D, 0xD6, 0x12, 0x8E, 0x99, 0x22, 0x90, 0x90, 0x12, 0xEF, -0xF0, 0x22, 0x90, 0x90, 0x12, 0xEF, 0xF0, 0x22, 0x90, 0x02, 0x09, 0xE0, 0x90, 0x90, 0x12, 0xF0, -0x12, 0x26, 0x1E, 0x90, 0x8F, 0xF0, 0xF0, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0x90, 0x8F, 0xF1, -0xF0, 0x22, 0x90, 0x02, 0x09, 0xE0, 0xFD, 0x12, 0x26, 0x1E, 0xFE, 0xAF, 0x05, 0xED, 0x2E, 0x90, -0x8F, 0xF2, 0xF0, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0xFF, 0xED, 0x2F, 0x90, 0x8F, 0xF3, 0xF0, -0x90, 0x00, 0x02, 0x12, 0x26, 0x37, 0xFF, 0xED, 0x2F, 0x90, 0x8F, 0xF4, 0xF0, 0x90, 0x00, 0x03, -0x12, 0x26, 0x37, 0xFF, 0xED, 0x2F, 0x90, 0x8F, 0xF5, 0xF0, 0x90, 0x00, 0x04, 0x12, 0x26, 0x37, -0xFF, 0xED, 0x2F, 0x90, 0x8F, 0xF6, 0xF0, 0x90, 0x00, 0x05, 0x12, 0x26, 0x37, 0xFF, 0xAE, 0x05, -0xED, 0x2F, 0x90, 0x8F, 0xF7, 0xF0, 0x22, 0x90, 0x02, 0x09, 0xE0, 0xFD, 0x12, 0x26, 0x1E, 0xFE, -0xAF, 0x05, 0xED, 0x2E, 0x90, 0x8F, 0xF8, 0xF0, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0xFF, 0xED, -0x2F, 0x90, 0x8F, 0xF9, 0xF0, 0x90, 0x00, 0x02, 0x12, 0x26, 0x37, 0xFF, 0xED, 0x2F, 0x90, 0x8F, -0xFA, 0xF0, 0x90, 0x00, 0x03, 0x12, 0x26, 0x37, 0xFF, 0xED, 0x2F, 0x90, 0x8F, 0xFB, 0xF0, 0x90, -0x00, 0x04, 0x12, 0x26, 0x37, 0xFF, 0xED, 0x2F, 0x90, 0x8F, 0xFC, 0xF0, 0x90, 0x00, 0x05, 0x12, -0x26, 0x37, 0xFF, 0xED, 0x2F, 0x90, 0x8F, 0xFD, 0xF0, 0x90, 0x00, 0x06, 0x12, 0x26, 0x37, 0xFF, -0xAE, 0x05, 0xED, 0x2F, 0x90, 0x8F, 0xFE, 0xF0, 0x22, 0xE4, 0xFF, 0x74, 0x18, 0x2F, 0xF5, 0x82, -0xE4, 0x34, 0x06, 0xF5, 0x83, 0xE0, 0xFE, 0x74, 0xA4, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x8E, 0xF5, -0x83, 0xEE, 0xF0, 0x74, 0x10, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x06, 0xF5, 0x83, 0xE0, 0xFE, 0x74, -0x9E, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x8E, 0xF5, 0x83, 0xEE, 0xF0, 0x0F, 0xEF, 0xB4, 0x06, 0xCB, -0x22, 0x90, 0x90, 0x03, 0xE0, 0x30, 0xE0, 0x36, 0x90, 0x90, 0x06, 0xE0, 0x04, 0xF0, 0xE0, 0xFF, -0x90, 0x90, 0x04, 0xE0, 0x6F, 0x70, 0x27, 0x90, 0x06, 0x92, 0xE0, 0x20, 0xE2, 0x11, 0x90, 0x90, -0x08, 0xE0, 0x70, 0x0B, 0x12, 0x57, 0xE1, 0x90, 0x90, 0x07, 0xE0, 0x04, 0xF0, 0x80, 0x06, 0x90, -0x06, 0x92, 0x74, 0x04, 0xF0, 0xE4, 0x90, 0x90, 0x06, 0xF0, 0x90, 0x90, 0x08, 0xF0, 0x22, 0xE4, -0x90, 0x8E, 0x7C, 0xF0, 0xA3, 0xF0, 0x90, 0x8E, 0x7B, 0xE0, 0x54, 0x0F, 0xF0, 0x54, 0xF0, 0xF0, -0x90, 0x8E, 0x79, 0xE0, 0x54, 0xFD, 0xF0, 0x54, 0xF7, 0xF0, 0x90, 0x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xE0, 0xF4, 0x60, 0x03, 0x7F, 0x00, 0x22, 0x90, 0x04, 0x1B, 0xE0, 0x54, -0x07, 0x64, 0x07, 0x7F, 0x01, 0x60, 0x02, 0x7F, 0x00, 0x22, 0x31, 0x61, 0xEF, 0x64, 0x01, 0x60, -0x08, 0x90, 0x01, 0xB8, 0x74, 0x01, 0xF0, 0x80, 0x67, 0x90, 0x8E, 0x80, 0xE0, 0xFF, 0x54, 0x03, -0x60, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x02, 0xF0, 0x80, 0x56, 0x90, 0x8E, 0x7E, 0xE0, 0xFE, 0xE4, -0xC3, 0x9E, 0x50, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x04, 0xF0, 0x80, 0x44, 0xEF, 0x30, 0xE2, 0x08, -0x90, 0x01, 0xB8, 0x74, 0x08, 0xF0, 0x80, 0x38, 0x90, 0x8E, 0x80, 0xE0, 0x30, 0xE4, 0x08, 0x90, -0x01, 0xB8, 0x74, 0x10, 0xF0, 0x80, 0x29, 0x90, 0x8E, 0x7A, 0xE0, 0x13, 0x13, 0x54, 0x3F, 0x20, -0xE0, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x20, 0xF0, 0x80, 0x16, 0x90, 0x8E, 0x93, 0xE0, 0x60, 0x08, -0x90, 0x01, 0xB8, 0x74, 0x80, 0xF0, 0x80, 0x08, 0x90, 0x01, 0xB8, 0xE4, 0xF0, 0x7F, 0x01, 0x22, -0x90, 0x01, 0xB9, 0x74, 0x04, 0xF0, 0x7F, 0x00, 0x22, 0xEF, 0x24, 0xFE, 0x60, 0x0C, 0x04, 0x70, -0x28, 0x90, 0x8E, 0x82, 0x74, 0x01, 0xF0, 0xA3, 0xF0, 0x22, 0xED, 0x70, 0x0A, 0x90, 0x8E, 0x90, -0xE0, 0x90, 0x8E, 0x82, 0xF0, 0x80, 0x05, 0x90, 0x8E, 0x82, 0xED, 0xF0, 0x90, 0x8E, 0x82, 0xE0, -0xA3, 0xF0, 0x90, 0x8E, 0x7A, 0xE0, 0x44, 0x08, 0xF0, 0x22, 0x90, 0x02, 0x87, 0xE0, 0x60, 0x08, -0x90, 0x01, 0xB8, 0x74, 0x01, 0xF0, 0x80, 0x3B, 0x90, 0x8E, 0x98, 0xE0, 0x30, 0xE0, 0x0E, 0x90, -0x02, 0x82, 0xE0, 0x60, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x02, 0xF0, 0x80, 0x26, 0x90, 0x8E, 0x9D, -0xE0, 0x30, 0xE0, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x08, 0xF0, 0x80, 0x17, 0x90, 0x02, 0x86, 0xE0, -0x20, 0xE1, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x04, 0xF0, 0x80, 0x08, 0x90, 0x01, 0xB8, 0xE4, 0xF0, -0x7F, 0x01, 0x22, 0x90, 0x01, 0xB9, 0x74, 0x08, 0xF0, 0x7F, 0x00, 0x22, 0xEF, 0x60, 0x3E, 0x90, -0x8D, 0xF8, 0xE0, 0x64, 0x01, 0x70, 0x36, 0x90, 0x8E, 0x7A, 0xE0, 0x54, 0xFE, 0xF0, 0x90, 0x05, -0x22, 0x74, 0x0F, 0xF0, 0x90, 0x06, 0x04, 0xE0, 0x54, 0xBF, 0xF0, 0xE4, 0xFF, 0x12, 0x57, 0x8A, -0xBF, 0x01, 0x0E, 0x90, 0x8E, 0x79, 0xE0, 0x44, 0x40, 0xF0, 0x90, 0x8E, 0x7F, 0x74, 0x06, 0xF0, -0x22, 0x90, 0x01, 0xB9, 0x74, 0x01, 0xF0, 0x90, 0x01, 0xB8, 0x74, 0x08, 0xF0, 0x22, 0x90, 0x05, -0x22, 0x74, 0xFF, 0xF0, 0x12, 0x57, 0xEE, 0x90, 0x01, 0x37, 0x74, 0x02, 0xF0, 0xFD, 0x7F, 0x03, -0x12, 0x4F, 0x06, 0x12, 0x56, 0x28, 0xE4, 0x90, 0x8E, 0x7F, 0xF0, 0x22, 0x90, 0x05, 0x22, 0x74, -0x6F, 0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, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xED, -0xF0, 0x22, 0x74, 0x09, 0x2D, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xE0, 0x54, 0x3F, 0xF0, -0xEF, 0x60, 0x1D, 0x74, 0x29, 0x2D, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xE0, 0x44, 0x10, -0xF0, 0x74, 0x09, 0x2D, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xE0, 0x44, 0x80, 0xF0, 0x22, -0x74, 0x29, 0x2D, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xE0, 0x54, 0xEF, 0xF0, 0x74, 0x09, -0x2D, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xE0, 0x44, 0x40, 0xF0, 0x22, 0x90, 0x8D, 0x08, -0xE0, 0xFE, 0x90, 0x04, 0x1C, 0xE0, 0x6E, 0x70, 0x40, 0x90, 0x8E, 0x7F, 0xE0, 0xFE, 0xB4, 0x0E, -0x18, 0xEF, 0x70, 0x35, 0x90, 0x8E, 0x79, 0xE0, 0x54, 0x7F, 0xF0, 0x90, 0x06, 0x04, 0xE0, 0x54, -0x7F, 0xF0, 0x90, 0x8E, 0x7F, 0x74, 0x0C, 0xF0, 0x22, 0xEE, 0x64, 0x06, 0x70, 0x1B, 0xEF, 0x60, -0x18, 0x90, 0x8E, 0x79, 0xE0, 0x54, 0xBF, 0xF0, 0x90, 0x06, 0x04, 0xE0, 0x44, 0x40, 0xF0, 0xE0, -0x44, 0x80, 0xF0, 0x90, 0x8E, 0x7F, 0x74, 0x04, 0xF0, 0x22, 0x90, 0x90, 0xA0, 0x12, 0x47, 0x53, -0x12, 0x26, 0x1E, 0x90, 0x90, 0xA5, 0xF0, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0x90, 0x90, 0xA6, -0xF0, 0x90, 0x00, 0x04, 0x12, 0x26, 0x37, 0x90, 0x90, 0xA7, 0xF0, 0x90, 0x00, 0x05, 0x12, 0x26, -0x37, 0x90, 0x90, 0xA8, 0xF0, 0x90, 0x00, 0x06, 0x12, 0x26, 0x37, 0x90, 0x90, 0xA9, 0xF0, 0x90, -0x00, 0x07, 0x12, 0x26, 0x37, 0x90, 0x90, 0xAA, 0xF0, 0x90, 0x00, 0x03, 0x12, 0x26, 0x37, 0x90, -0x90, 0xAD, 0xF0, 0xED, 0x70, 0x31, 0xFF, 0x74, 0xA5, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x90, 0xF5, -0x83, 0xE0, 0xB4, 0xFF, 0x0E, 0x74, 0xA5, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x90, 0xF5, 0x83, 0xE4, -0xF0, 0x80, 0x0F, 0x74, 0xA5, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x90, 0xF5, 0x83, 0xE0, 0x04, 0xF0, -0x80, 0x05, 0x0F, 0xEF, 0xB4, 0x06, 0xD0, 0x90, 0x90, 0xA4, 0xE0, 0xFF, 0xB4, 0x04, 0x25, 0xA3, -0xE0, 0xFE, 0x90, 0x90, 0xA0, 0x12, 0x47, 0x4A, 0xEE, 0x12, 0x26, 0x64, 0x90, 0x90, 0xA6, 0xE0, -0xFE, 0x90, 0x90, 0xA0, 0x12, 0x47, 0x4A, 0x90, 0x00, 0x01, 0xEE, 0x12, 0x26, 0x76, 0x90, 0x00, -0x02, 0xE4, 0x80, 0x30, 0xEF, 0xB4, 0x02, 0x2F, 0x90, 0x90, 0xA6, 0xE0, 0xFF, 0x90, 0x90, 0xA0, -0x12, 0x47, 0x4A, 0xEF, 0x12, 0x26, 0x64, 0x90, 0x90, 0xA6, 0xE0, 0x44, 0x20, 0x54, 0x7F, 0xFF, -0x90, 0x90, 0xA0, 0x12, 0x47, 0x4A, 0x90, 0x00, 0x01, 0xEF, 0x12, 0x26, 0x76, 0x90, 0x90, 0xA5, -0xE0, 0x90, 0x00, 0x02, 0x12, 0x26, 0x76, 0x90, 0x90, 0xA0, 0x12, 0x47, 0x4A, 0xE9, 0x24, 0x03, -0xF9, 0xE4, 0x3A, 0xFA, 0x12, 0x26, 0x1E, 0x44, 0x20, 0x12, 0x26, 0x64, 0x90, 0x90, 0xA7, 0xE0, -0xFF, 0x90, 0x90, 0xA0, 0x12, 0x47, 0x4A, 0x90, 0x00, 0x04, 0xEF, 0x12, 0x26, 0x76, 0x90, 0x90, -0xA8, 0xE0, 0x90, 0x00, 0x05, 0x12, 0x26, 0x76, 0x90, 0x90, 0xA9, 0xE0, 0x90, 0x00, 0x06, 0x12, -0x26, 0x76, 0x90, 0x90, 0xAA, 0xE0, 0x90, 0x00, 0x07, 0x02, 0x26, 0x76, 0x90, 0x90, 0xB1, 0xED, -0xF0, 0x90, 0x90, 0xAE, 0x12, 0x47, 0x53, 0x90, 0x00, 0x03, 0x12, 0x26, 0x37, 0x90, 0x90, 0xB5, -0xF0, 0x90, 0x90, 0xAE, 0x12, 0x47, 0x4A, 0x8B, 0x40, 0x8A, 0x41, 0x89, 0x42, 0x75, 0x43, 0x03, -0x7B, 0x01, 0x7A, 0x90, 0x79, 0xB2, 0x12, 0x34, 0x2C, 0x90, 0x90, 0xB1, 0xE0, 0x70, 0x46, 0xFF, -0x74, 0xB2, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x90, 0xF5, 0x83, 0xE0, 0xB4, 0xFF, 0x0E, 0x74, 0xB2, -0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x90, 0xF5, 0x83, 0xE4, 0xF0, 0x80, 0x0F, 0x74, 0xB2, 0x2F, 0xF5, -0x82, 0xE4, 0x34, 0x90, 0xF5, 0x83, 0xE0, 0x04, 0xF0, 0x80, 0x05, 0x0F, 0xEF, 0xB4, 0x03, 0xD0, -0x75, 0x40, 0x01, 0x75, 0x41, 0x90, 0x75, 0x42, 0xB2, 0x75, 0x43, 0x03, 0x90, 0x90, 0xAE, 0x12, -0x47, 0x4A, 0x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00, 0xF9, 0xE4, 0x34, 0xFC, 0x75, 0x40, 0x01, 0xF5, 0x41, 0x89, 0x42, 0x8F, 0x43, 0x7B, 0x01, -0x7A, 0x8F, 0x79, 0xAE, 0x12, 0x34, 0x2C, 0x90, 0x8F, 0xFE, 0xE0, 0xFF, 0x12, 0x6F, 0xBD, 0x90, -0x90, 0x12, 0xEF, 0xF0, 0x24, 0x00, 0xF9, 0xE4, 0x34, 0xFC, 0x75, 0x40, 0x01, 0xF5, 0x41, 0x89, -0x42, 0x90, 0x8F, 0xA2, 0xA3, 0xE0, 0xF5, 0x43, 0x7B, 0x01, 0x7A, 0x8F, 0x79, 0xCE, 0x02, 0x34, -0x2C, 0x90, 0x90, 0x24, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0xE4, 0xFF, 0x90, 0x90, 0x24, 0x75, 0xF0, -0x14, 0x12, 0x46, 0xF6, 0x90, 0x90, 0x24, 0xE4, 0x75, 0xF0, 0x08, 0x12, 0x46, 0xF6, 0x90, 0x8F, -0xA0, 0xE0, 0x70, 0x02, 0xA3, 0xE0, 0x60, 0x4B, 0xE4, 0x90, 0x90, 0x26, 0xF0, 0x90, 0x90, 0x26, -0xE0, 0xFE, 0xC3, 0x94, 0x02, 0x50, 0x3C, 0xEE, 0xFF, 0x7E, 0x00, 0x90, 0x90, 0x24, 0xE0, 0xFC, -0xA3, 0xE0, 0xFD, 0x2F, 0xFF, 0xEE, 0x3C, 0xFE, 0x12, 0x7F, 0xE1, 0x90, 0x90, 0x26, 0xE0, 0x24, -0xAE, 0xF5, 0x82, 0xE4, 0x34, 0x8F, 0xF5, 0x83, 0xE0, 0xFE, 0x74, 0x00, 0x2F, 0xF5, 0x82, 0xE4, -0x34, 0xFB, 0xF5, 0x83, 0xE0, 0x6E, 0x60, 0x03, 0x7F, 0x00, 0x22, 0x90, 0x90, 0x26, 0xE0, 0x04, -0xF0, 0x80, 0xBA, 0x90, 0x06, 0x32, 0xE0, 0x44, 0x40, 0xF0, 0xE4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01, 0x7B, 0x01, 0x7A, 0x8F, 0x79, 0xA6, 0x7E, 0x00, 0x7F, 0x04, 0x12, -0x49, 0x08, 0xEF, 0x7F, 0x01, 0x60, 0x02, 0x7F, 0x00, 0x22, 0xAD, 0x07, 0xAB, 0x05, 0x74, 0x17, -0x2B, 0xF5, 0x82, 0xE4, 0x34, 0xFB, 0xF5, 0x83, 0xE0, 0xFE, 0x74, 0x16, 0x2B, 0xF5, 0x82, 0xE4, -0x34, 0xFB, 0xF5, 0x83, 0xE0, 0x7C, 0x00, 0x24, 0x00, 0xFF, 0xEC, 0x3E, 0xFE, 0x90, 0x8F, 0xAA, -0xE0, 0x6E, 0x70, 0x03, 0xA3, 0xE0, 0x6F, 0x7F, 0x01, 0x60, 0x02, 0x7F, 0x00, 0x22, 0x90, 0x90, -0x4D, 0xEC, 0xF0, 0xA3, 0xED, 0xF0, 0xA3, 0xEB, 0xF0, 0xAA, 0x07, 0x90, 0x90, 0x54, 0x12, 0x27, -0x54, 0x00, 0x00, 0x00, 0x00, 0xEA, 0x24, 0xEF, 0x70, 0x02, 0x21, 0xB9, 0x24, 0x11, 0x60, 0x02, -0x41, 0xB1, 0x90, 0x90, 0x4F, 0xE0, 0xC3, 0x13, 0x90, 0xFD, 0x10, 0xF0, 0x90, 0x90, 0x4D, 0xA3, -0xE0, 0xFF, 0x24, 0x0A, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xE4, 0xF0, 0x74, 0x0B, 0x2F, -0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xE4, 0xF0, 0xFE, 0x74, 0x00, 0x2F, 0xF9, 0xEE, 0x34, -0xFC, 0xFA, 0x7B, 0x01, 0x7D, 0x14, 0x7C, 0x00, 0x12, 0x28, 0xE6, 0x90, 0x90, 0x54, 0x12, 0x27, -0x48, 0x7B, 0x00, 0x7A, 0x00, 0x79, 0x00, 0x90, 0xAE, 0x61, 0x12, 0x47, 0x53, 0x90, 0x90, 0x54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90, 0x54, 0x12, 0x27, 0x48, 0x90, 0x90, 0x4D, -0x74, 0xFF, 0x75, 0xF0, 0xEC, 0x12, 0x46, 0xF6, 0x90, 0x90, 0x4D, 0xA3, 0xE0, 0xFF, 0x7E, 0x00, -0x24, 0x0C, 0xF9, 0xEE, 0x34, 0xFC, 0xFA, 0x7B, 0x01, 0xC0, 0x02, 0xC0, 0x01, 0x74, 0x10, 0x2F, -0xF9, 0xEE, 0x34, 0xFC, 0xFA, 0x90, 0xAE, 0x61, 0x12, 0x47, 0x53, 0x90, 0x90, 0x54, 0x12, 0x47, -0x26, 0x90, 0xAE, 0x64, 0x12, 0x27, 0x48, 0x90, 0x90, 0x52, 0xE0, 0xFC, 0xA3, 0xE0, 0xFD, 0xD0, -0x01, 0xD0, 0x02, 0x7F, 0x11, 0x12, 0x1F, 0x66, 0x90, 0x90, 0x50, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, -0x90, 0x90, 0x4D, 0xE4, 0x75, 0xF0, 0x14, 0x12, 0x46, 0xF6, 0x90, 0x90, 0x50, 0xE0, 0xFC, 0xA3, -0xE0, 0xFD, 0xEC, 0xFF, 0x90, 0x90, 0x4D, 0xA3, 0xE0, 0xFE, 0x24, 0x06, 0xF5, 0x82, 0xE4, 0x34, -0xFC, 0xF5, 0x83, 0xEF, 0xF0, 0x74, 0x07, 0x2E, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xED, -0xF0, 0x22, 0x02, 0x52, +0xAF, 0x22, 0xC3, 0xEE, 0x94, 0x01, 0x40, 0x0A, 0x0D, 0xED, 0x13, 0x90, 0xFD, 0x10, 0xF0, 0xE4, +0x2F, 0xFF, 0x22, 0xFB, 0x7D, 0x08, 0x7F, 0x01, 0x90, 0x92, 0xC3, 0xEB, 0xF0, 0xEF, 0x70, 0x06, +0xA3, 0x74, 0x03, 0xF0, 0x80, 0x0B, 0xEF, 0x64, 0x01, 0x70, 0x28, 0x90, 0x92, 0xC4, 0x74, 0x42, +0xF0, 0x7F, 0xE2, 0x12, 0x3A, 0x96, 0x90, 0x92, 0xC3, 0xE0, 0xFD, 0x7F, 0xE0, 0x12, 0x3A, 0x96, +0x90, 0x92, 0xC4, 0xE0, 0x31, 0x5E, 0x90, 0x92, 0xC4, 0xE0, 0x54, 0xFD, 0x31, 0x5E, 0x31, 0x5D, +0x7F, 0x01, 0x22, 0x90, 0x01, 0xC2, 0xE0, 0x44, 0x01, 0xF0, 0x7F, 0x00, 0x22, 0xE4, 0xFD, 0x7F, +0xE3, 0x02, 0x3A, 0x96, 0x90, 0x92, 0xA7, 0x12, 0x47, 0x5F, 0xEF, 0x70, 0x07, 0x90, 0x92, 0xAA, +0x04, 0xF0, 0x80, 0x0B, 0xEF, 0x64, 0x01, 0x70, 0x25, 0x90, 0x92, 0xAA, 0x74, 0x40, 0xF0, 0x7F, +0xE2, 0x12, 0x3A, 0x96, 0x90, 0x92, 0xAA, 0xE0, 0x31, 0x5E, 0x90, 0x00, 0xE1, 0xE0, 0xFF, 0x90, +0x92, 0xA7, 0x12, 0x47, 0x56, 0xEF, 0x12, 0x26, 0x64, 0x31, 0x5D, 0x7F, 0x01, 0x22, 0x80, 0xB3, +0x7B, 0x01, 0x7A, 0x92, 0x79, 0x90, 0x7D, 0x08, 0x7F, 0x01, 0x31, 0x64, 0x90, 0x92, 0x90, 0xE0, +0x22, 0xEF, 0x90, 0x02, 0x86, 0x60, 0x06, 0xE0, 0x44, 0x04, 0xF0, 0x80, 0x04, 0xE0, 0x54, 0xFB, +0xF0, 0x90, 0x8D, 0x06, 0xED, 0xF0, 0x22, 0xE4, 0x90, 0x92, 0x23, 0xF0, 0xA3, 0xF0, 0xA3, 0xF0, +0x90, 0x00, 0x83, 0xE0, 0x90, 0x92, 0x23, 0xF0, 0x90, 0x00, 0x83, 0xE0, 0xFE, 0x90, 0x92, 0x23, +0xE0, 0xFF, 0xB5, 0x06, 0x01, 0x22, 0xC3, 0x90, 0x92, 0x25, 0xE0, 0x94, 0x64, 0x90, 0x92, 0x24, +0xE0, 0x94, 0x00, 0x40, 0x0D, 0x90, 0x01, 0xC0, 0xE0, 0x44, 0x40, 0xF0, 0x90, 0x92, 0x23, 0xE0, +0xFF, 0x22, 0x90, 0x92, 0x24, 0x12, 0x59, 0x26, 0x80, 0xC6, 0x90, 0x01, 0xC4, 0x74, 0x0A, 0xF0, +0x74, 0x92, 0xA3, 0xF0, 0x90, 0x00, 0x90, 0xE0, 0x20, 0xE0, 0xF9, 0x74, 0x0A, 0x04, 0x90, 0x01, +0xC4, 0xF0, 0x74, 0x92, 0xA3, 0xF0, 0x22, 0x90, 0x8E, 0x0F, 0xE0, 0x44, 0x10, 0xF0, 0x90, 0x8D, +0x07, 0xE0, 0xB4, 0x03, 0x0C, 0x90, 0x00, 0x70, 0xE0, 0x44, 0x80, 0xFD, 0x7F, 0x70, 0x12, 0x3A, +0x96, 0x90, 0x8E, 0x1D, 0xE0, 0xFD, 0x7F, 0x93, 0x12, 0x3A, 0x96, 0x90, 0x8E, 0x13, 0xE0, 0x60, +0x12, 0x90, 0x01, 0x2F, 0xE0, 0x30, 0xE7, 0x05, 0x74, 0x10, 0xF0, 0x80, 0x06, 0x90, 0x01, 0x2F, +0x74, 0x90, 0xF0, 0x90, 0x00, 0x08, 0xE0, 0x44, 0x10, 0xFD, 0x7F, 0x08, 0x12, 0x3A, 0x96, 0x7F, +0x01, 0x12, 0x58, 0xCD, 0x90, 0x00, 0x90, 0xE0, 0x44, 0x01, 0xFD, 0x7F, 0x90, 0x12, 0x3A, 0x96, +0x7F, 0x14, 0x7E, 0x00, 0x02, 0x3A, 0xF7, 0x90, 0x92, 0xC7, 0xEF, 0xF0, 0xA3, 0xED, 0xF0, 0x90, +0x00, 0xF1, 0xE0, 0x54, 0xF0, 0x64, 0x20, 0x60, 0x02, 0x61, 0x59, 0x90, 0x92, 0xC8, 0xE0, 0xB4, +0x01, 0x1D, 0x90, 0x92, 0xC7, 0xE0, 0xB4, 0x0B, 0x16, 0x90, 0x92, 0x3B, 0x12, 0x27, 0x54, 0x00, +0x00, 0x0C, 0x00, 0x90, 0x92, 0x3F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x0C, 0x00, 0x80, 0x14, 0x90, +0x92, 0x3B, 0x12, 0x27, 0x54, 0x00, 0x00, 0x0C, 0x00, 0x90, 0x92, 0x3F, 0x12, 0x27, 0x54, 0x00, +0x00, 0x08, 0x00, 0x12, 0x6D, 0xD2, 0x90, 0x92, 0xC8, 0xE0, 0x70, 0x21, 0x71, 0xA4, 0x60, 0x04, +0xEF, 0xB4, 0x0E, 0x19, 0x90, 0x92, 0x3B, 0x12, 0x27, 0x54, 0x00, 0x00, 0x03, 0x00, 0x90, 0x92, +0x3F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x03, 0x00, 0x12, 0x6D, 0xD2, 0x80, 0x0E, 0x90, 0x92, 0xC8, +0xE0, 0xB4, 0x01, 0x1D, 0x90, 0x92, 0xC7, 0xE0, 0xB4, 0x0B, 0x16, 0x90, 0x92, 0x3B, 0x12, 0x27, +0x54, 0x40, 0x00, 0x00, 0x00, 0x90, 0x92, 0x3F, 0x12, 0x27, 0x54, 0x40, 0x00, 0x00, 0x00, 0x80, +0x34, 0x90, 0x92, 0xC8, 0xE0, 0x64, 0x02, 0x60, 0x7A, 0x90, 0x92, 0x3B, 0x12, 0x27, 0x54, 0x00, +0x00, 0x03, 0x00, 0x90, 0x92, 0x3F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x02, 0x00, 0x7F, 0xAC, 0x7E, +0x08, 0x12, 0x6F, 0x12, 0x12, 0x27, 0x54, 0x40, 0x00, 0x00, 0x00, 0x90, 0x92, 0x3F, 0x12, 0x27, +0x54, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xC4, 0x80, 0x45, 0x90, 0x92, 0xC8, 0xE0, 0x70, 0x20, 0x71, +0xA4, 0x60, 0x04, 0xEF, 0xB4, 0x0E, 0x18, 0x90, 0x92, 0x3B, 0x12, 0x27, 0x54, 0x00, 0x00, 0x03, +0x00, 0x90, 0x92, 0x3F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x03, 0x00, 0x7F, 0xAC, 0x80, 0x1F, 0x90, +0x92, 0xC7, 0xE0, 0xD3, 0x94, 0x0E, 0x50, 0x1B, 0x90, 0x92, 0x3B, 0x12, 0x27, 0x54, 0x00, 0x00, +0x03, 0x00, 0x90, 0x92, 0x3F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x02, 0x00, 0x7F, 0xAC, 0x7E, 0x08, +0x12, 0x6D, 0xD6, 0x22, 0x90, 0x92, 0xC7, 0xE0, 0xFF, 0x64, 0x0D, 0x22, 0x90, 0x04, 0x54, 0xE0, +0x7F, 0x00, 0x30, 0xE7, 0x02, 0x7F, 0x01, 0x22, 0x90, 0x92, 0xCA, 0xED, 0xF0, 0x90, 0x92, 0xC9, +0xEF, 0xF0, 0xD3, 0x94, 0x0E, 0x50, 0x15, 0x71, 0xAC, 0xEF, 0x60, 0x2A, 0x71, 0xAC, 0xEF, 0x64, +0x01, 0x70, 0x23, 0x90, 0x92, 0xCA, 0xE0, 0xFD, 0xE4, 0xFF, 0x80, 0x15, 0x90, 0x92, 0xC9, 0xE0, +0xD3, 0x94, 0x0E, 0x40, 0x11, 0x71, 0xAC, 0xEF, 0x70, 0x0A, 0x90, 0x92, 0xCA, 0xE0, 0xFD, 0x7F, +0x01, 0x02, 0x6E, 0x33, 0x71, 0xAC, 0x22, 0x7F, 0x34, 0x7E, 0x08, 0x12, 0x6D, 0xD6, 0x90, 0x92, +0xBC, 0xE0, 0xFF, 0xA3, 0xE0, 0xFD, 0x90, 0x92, 0xD2, 0xED, 0xF0, 0xEF, 0x60, 0x02, 0x81, 0xCE, +0xE0, 0x24, 0xFD, 0x50, 0x0A, 0x60, 0x1D, 0x14, 0x60, 0x2F, 0x14, 0x60, 0x68, 0xC1, 0x49, 0x90, +0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, 0x77, 0xD1, 0x4A, 0x12, 0x27, 0x54, 0x77, 0x77, +0x77, 0x77, 0xA1, 0x3E, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x54, 0x33, 0x77, 0x70, 0xD1, 0x4A, +0x12, 0x27, 0x54, 0x54, 0x33, 0x77, 0x70, 0xA1, 0xB6, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, +0x77, 0x77, 0x77, 0xD1, 0x4A, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, 0x77, 0xD1, 0x55, 0x12, 0x27, +0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0x92, 0x3F, 0x12, 0x27, 0x54, 0x00, 0x10, 0x00, 0x00, 0x12, +0x6F, 0x0E, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0x92, 0x3F, 0x12, 0x27, 0x54, 0x00, +0x10, 0x00, 0x00, 0xC1, 0x42, 0x90, 0x92, 0x3B, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0xFF, 0x90, +0x92, 0x3F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x77, 0xD1, 0x60, 0x90, 0xAC, 0xB9, 0x12, 0x27, +0x54, 0x77, 0x77, 0x77, 0x77, 0xD1, 0x55, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0x90, 0x92, +0x3F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x12, 0x6F, 0x0E, 0x12, 0x27, 0x54, 0x3F, 0xF0, +0x00, 0x00, 0x90, 0x92, 0x3F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0xC1, 0x42, 0x90, 0x92, +0xD2, 0xE0, 0x14, 0x60, 0x56, 0x14, 0x70, 0x02, 0xA1, 0x67, 0x14, 0x70, 0x02, 0xA1, 0xA3, 0x14, +0x70, 0x02, 0xA1, 0x67, 0x14, 0x70, 0x02, 0xA1, 0xFB, 0x24, 0x05, 0x60, 0x02, 0xC1, 0x49, 0x90, +0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x33, 0x77, 0x17, 0xD1, 0x4A, 0x12, 0x27, 0x54, 0x77, 0x33, +0x77, 0x17, 0xD1, 0x55, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0x92, 0x3F, 0x12, 0x27, +0x54, 0x01, 0x00, 0x00, 0x00, 0x12, 0x6F, 0x0E, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, +0x92, 0x3F, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0xC1, 0x42, 0x90, 0xAC, 0xB9, 0x12, 0x27, +0x54, 0x77, 0x33, 0x77, 0x17, 0xD1, 0x4A, 0x12, 0x27, 0x54, 0x77, 0x33, 0x77, 0x17, 0xD1, 0x55, +0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0x92, 0x3F, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, +0x00, 0x12, 0x6F, 0x0E, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0x92, 0x3F, 0x12, 0x27, +0x54, 0x00, 0x00, 0x00, 0x00, 0xC1, 0x42, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x33, 0x77, +0x77, 0xD1, 0x4A, 0x12, 0x27, 0x54, 0x77, 0x33, 0x77, 0x77, 0xD1, 0x55, 0x12, 0x27, 0x54, 0x3F, +0xF0, 0x00, 0x00, 0x90, 0x92, 0x3F, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0x12, 0x6F, 0x0E, +0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0x92, 0x3F, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, +0x00, 0xC1, 0x42, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x54, 0x33, 0x77, 0x17, 0xD1, 0x4A, 0x12, +0x27, 0x54, 0x54, 0x33, 0x77, 0x17, 0xD1, 0x55, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, +0x92, 0x3F, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0x12, 0x6F, 0x0E, 0x12, 0x27, 0x54, 0x3F, +0xF0, 0x00, 0x00, 0x90, 0x92, 0x3F, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0x7F, 0xB4, 0x7E, +0x0E, 0x12, 0x6F, 0x12, 0x12, 0x27, 0x54, 0x00, 0x00, 0x03, 0x03, 0x90, 0x92, 0x3F, 0x12, 0x27, +0x54, 0x00, 0x00, 0x00, 0x01, 0x7F, 0x00, 0x7E, 0x09, 0x80, 0x4B, 0x90, 0x92, 0x3B, 0x12, 0x27, +0x54, 0x00, 0xFF, 0x00, 0x00, 0x90, 0x92, 0x3F, 0x12, 0x27, 0x54, 0x00, 0x33, 0x00, 0x00, 0xD1, +0x60, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x33, 0x77, 0x77, 0xD1, 0x55, 0x12, 0x27, 0x54, +0x01, 0x00, 0x00, 0x00, 0x90, 0x92, 0x3F, 0x12, 0x27, 0x54, 0x01, 0x00, 0x00, 0x00, 0x12, 0x6F, +0x0E, 0x12, 0x27, 0x54, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0x92, 0x3F, 0x12, 0x27, 0x54, 0x01, 0x00, +0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0E, 0x12, 0x6D, 0xD6, 0x22, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x37, +0x5D, 0x90, 0xAC, 0xB9, 0x22, 0x7F, 0xB0, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0x92, 0x3B, 0x22, +0x7F, 0xB0, 0x7E, 0x0C, 0x02, 0x6D, 0xD6, 0xE4, 0xFE, 0xEF, 0x54, 0xE0, 0xC4, 0x13, 0x54, 0x07, +0xFD, 0xEF, 0x54, 0x1F, 0xFF, 0xED, 0x60, 0x2C, 0x14, 0x60, 0x1E, 0x24, 0xFD, 0x60, 0x0F, 0x24, +0xFE, 0x70, 0x2A, 0xEF, 0x25, 0xE0, 0xFF, 0xC3, 0x74, 0xDE, 0x9F, 0xFE, 0x80, 0x1F, 0xEF, 0x25, +0xE0, 0xFF, 0xC3, 0x74, 0xF2, 0x9F, 0xFE, 0x80, 0x14, 0xEF, 0x25, 0xE0, 0xFF, 0xC3, 0x74, 0x06, +0x9F, 0xFE, 0x80, 0x09, 0xEF, 0x25, 0xE0, 0xFF, 0xC3, 0x74, 0x10, 0x9F, 0xFE, 0xAF, 0x06, 0x22, +0xD3, 0xEF, 0x64, 0x80, 0x94, 0x1C, 0x40, 0x07, 0xEF, 0x64, 0x80, 0x94, 0x94, 0x40, 0x03, 0x7F, +0x00, 0x22, 0xC3, 0xEF, 0x64, 0x80, 0x94, 0x80, 0x40, 0x03, 0x7F, 0x64, 0x22, 0xEF, 0x24, 0x64, +0xFF, 0x22, 0x90, 0x90, 0xE4, 0xE0, 0xFF, 0x13, 0x13, 0x54, 0x3F, 0x30, 0xE0, 0x0D, 0x7B, 0x00, +0x7A, 0x00, 0x79, 0x00, 0xD1, 0xEE, 0x04, 0xF0, 0x02, 0x5B, 0xE7, 0x02, 0x74, 0xE2, 0x90, 0x92, +0x4E, 0x12, 0x47, 0x5F, 0xE4, 0x90, 0x92, 0x51, 0xF0, 0xA3, 0x22, 0x90, 0x90, 0xE4, 0xE0, 0x30, +0xE0, 0x36, 0x12, 0x6F, 0x25, 0x64, 0x01, 0x70, 0x2F, 0x90, 0x92, 0xD4, 0xE0, 0x04, 0xF0, 0xE0, +0xB4, 0x0A, 0x0B, 0x90, 0x90, 0xE6, 0xE0, 0x04, 0xF0, 0xE4, 0x90, 0x92, 0xD4, 0xF0, 0x90, 0x90, +0xE6, 0xE0, 0xFF, 0x90, 0x90, 0xE5, 0xE0, 0xD3, 0x9F, 0x50, 0x0D, 0x90, 0x90, 0xE7, 0xE0, 0x70, +0x07, 0xE4, 0x90, 0x90, 0xE6, 0xF0, 0xD1, 0xD2, 0x22, 0x90, 0x90, 0xE4, 0xE0, 0x54, 0xFE, 0xF0, +0x54, 0x7F, 0xF0, 0x54, 0xFB, 0xF0, 0xA3, 0x74, 0x0A, 0xF0, 0xE4, 0xA3, 0xF0, 0xA3, 0xF0, 0x22, +0x90, 0x02, 0x84, 0xEF, 0xF0, 0xEE, 0xA3, 0xF0, 0xA3, 0xE0, 0x44, 0x01, 0xF0, 0x22, 0x90, 0x02, +0x86, 0xE0, 0x20, 0xE2, 0x03, 0x7F, 0x04, 0x22, 0x90, 0x02, 0x86, 0xE0, 0x7F, 0x01, 0x20, 0xE1, +0x02, 0x7F, 0x02, 0x22, 0x90, 0x8E, 0xC7, 0xE0, 0xC4, 0x54, 0x0F, 0x20, 0xE0, 0x0A, 0x90, 0x01, +0x3F, 0xE0, 0x30, 0xE2, 0x03, 0x12, 0x5F, 0xDA, 0x90, 0x8E, 0xCE, 0xE0, 0x30, 0xE0, 0x0D, 0x90, +0x8E, 0xC8, 0xE0, 0xC4, 0x54, 0x0F, 0x20, 0xE0, 0x03, 0x7F, 0x00, 0x22, 0x7F, 0x01, 0x22, 0xEF, +0x90, 0x01, 0xC7, 0xB4, 0xA0, 0x05, 0x74, 0x04, 0xF0, 0x80, 0x03, 0x74, 0x08, 0xF0, 0x02, 0x5F, +0xDA, 0x90, 0x8E, 0xCE, 0xE0, 0x30, 0xE0, 0x03, 0x7F, 0x01, 0x22, 0x90, 0x06, 0x90, 0xE0, 0x20, +0xE5, 0x10, 0x90, 0x01, 0x3F, 0xE0, 0x30, 0xE2, 0x09, 0x90, 0x01, 0xC7, 0x74, 0x25, 0xF0, 0x7F, +0x01, 0x22, 0x7F, 0x00, 0x22, 0x90, 0x02, 0x09, 0xE0, 0x90, 0x90, 0xFE, 0xF0, 0x12, 0x26, 0x1E, +0x90, 0x90, 0xD2, 0x12, 0x4E, 0xCD, 0x90, 0x90, 0xD3, 0xF0, 0x22, 0x90, 0x02, 0x09, 0xE0, 0xFF, +0x12, 0x26, 0x1E, 0xFE, 0xEF, 0x2E, 0x90, 0x90, 0xE2, 0xF0, 0x22, 0x12, 0x98, 0x35, 0x30, 0xE0, +0x05, 0x90, 0x01, 0x5B, 0xE4, 0xF0, 0x90, 0x06, 0x92, 0x74, 0x02, 0xF0, 0x90, 0x01, 0x3C, 0x74, +0x04, 0xF0, 0xE4, 0x90, 0x92, 0x7E, 0xF0, 0x90, 0x8E, 0xBC, 0xE0, 0xC3, 0x13, 0x54, 0x7F, 0x90, +0x92, 0x7F, 0xF0, 0xE4, 0xFB, 0xFD, 0x7F, 0x58, 0x7E, 0x01, 0x12, 0x68, 0x50, 0x90, 0x8E, 0x0E, +0xE0, 0x44, 0x08, 0xF0, 0x22, 0x90, 0x8E, 0x0E, 0xE0, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x22, 0x90, +0x04, 0x1A, 0xE0, 0xF4, 0x60, 0x03, 0x7F, 0x00, 0x22, 0x90, 0x04, 0x1B, 0xE0, 0x54, 0x07, 0x64, +0x07, 0x7F, 0x01, 0x60, 0x02, 0x7F, 0x00, 0x22, 0x11, 0x3F, 0xEF, 0x64, 0x01, 0x70, 0x32, 0x90, +0x8E, 0x16, 0xE0, 0xFF, 0x54, 0x03, 0x70, 0x29, 0x90, 0x8E, 0x14, 0xE0, 0xFE, 0xE4, 0xC3, 0x9E, +0x40, 0x1F, 0xEF, 0x20, 0xE2, 0x1B, 0x90, 0x8E, 0x16, 0xE0, 0x20, 0xE4, 0x14, 0x90, 0x8E, 0x0F, +0xE0, 0x13, 0x13, 0x54, 0x3F, 0x30, 0xE0, 0x09, 0x90, 0x8E, 0xC0, 0xE0, 0x70, 0x03, 0x7F, 0x01, +0x22, 0x7F, 0x00, 0x22, 0x90, 0x8E, 0xC1, 0xE0, 0xC3, 0x13, 0x20, 0xE0, 0x30, 0x90, 0x02, 0x87, +0xE0, 0x70, 0x33, 0x90, 0x01, 0x00, 0xE0, 0x64, 0x3F, 0x70, 0x2B, 0x90, 0x8E, 0xC5, 0xE0, 0x30, +0xE0, 0x06, 0x90, 0x02, 0x82, 0xE0, 0x70, 0x1E, 0x90, 0x8E, 0xCE, 0xE0, 0x20, 0xE0, 0x17, 0x90, +0x02, 0x86, 0xE0, 0x30, 0xE1, 0x10, 0x90, 0x02, 0x86, 0xE0, 0x20, 0xE3, 0x09, 0x90, 0x04, 0x1D, +0xE0, 0x70, 0x03, 0x7F, 0x01, 0x22, 0x7F, 0x00, 0x22, 0xEF, 0x60, 0x30, 0x12, 0x6F, 0x25, 0x64, +0x01, 0x70, 0x29, 0x90, 0x8E, 0x0F, 0xE0, 0x54, 0xFE, 0xF0, 0x7D, 0x2B, 0x7F, 0x0F, 0x12, 0x53, +0x74, 0x90, 0x06, 0x04, 0xE0, 0x54, 0xBF, 0xF0, 0x12, 0x74, 0xE2, 0xBF, 0x01, 0x0E, 0x90, 0x8E, +0x0E, 0xE0, 0x44, 0x40, 0xF0, 0x7D, 0x06, 0x7F, 0x01, 0x12, 0x51, 0x10, 0x22, 0x7D, 0x2E, 0x7F, +0x6F, 0x12, 0x53, 0x74, 0x7D, 0x02, 0x7F, 0x01, 0x02, 0x51, 0x10, 0xE4, 0xFE, 0x74, 0x2F, 0x2E, +0x31, 0x44, 0xE4, 0xF0, 0x0E, 0xEE, 0xB4, 0x19, 0xF4, 0xE4, 0x90, 0x8E, 0x28, 0xF0, 0x90, 0x8E, +0x2C, 0xF0, 0x90, 0x8E, 0x24, 0xF0, 0xEF, 0xB4, 0x01, 0x09, 0x90, 0x8E, 0x2D, 0x74, 0x19, 0xF0, +0xE4, 0xA3, 0xF0, 0x22, 0xF5, 0x82, 0xE4, 0x34, 0x8E, 0xF5, 0x83, 0x22, 0x31, 0x51, 0x02, 0x49, +0x38, 0x7E, 0x00, 0x7F, 0x04, 0x7D, 0x00, 0x7B, 0x01, 0x7A, 0x8E, 0x79, 0xC1, 0x22, 0xD3, 0x10, +0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x06, 0x31, 0xE0, 0x54, 0xEF, 0x44, 0x08, 0xF0, 0xED, 0x2F, +0xFF, 0xE4, 0x3E, 0xFE, 0x7C, 0x00, 0xEF, 0x24, 0x08, 0xFF, 0xEC, 0x3E, 0x90, 0x91, 0x17, 0xF0, +0xA3, 0xEF, 0xF0, 0x7E, 0x00, 0x7F, 0x83, 0x7D, 0x00, 0x7B, 0x01, 0x7A, 0x8F, 0x79, 0xE2, 0x12, +0x49, 0x38, 0x90, 0x91, 0x18, 0xE0, 0x24, 0x01, 0x12, 0x5F, 0x25, 0x90, 0x8F, 0xE3, 0x51, 0x81, +0x24, 0x04, 0x12, 0x5F, 0x25, 0x90, 0x8F, 0xE6, 0x51, 0x81, 0x24, 0x05, 0x12, 0x5F, 0x25, 0x90, +0x8F, 0xE7, 0x51, 0x81, 0x24, 0x06, 0x12, 0x5F, 0x25, 0x90, 0x8F, 0xE8, 0x51, 0x81, 0x24, 0x07, +0x12, 0x5F, 0x25, 0x90, 0x8F, 0xE9, 0x51, 0x81, 0x24, 0x08, 0x12, 0x5F, 0x25, 0x90, 0x8F, 0xEA, +0xEF, 0xF0, 0xE4, 0x90, 0x91, 0x16, 0xF0, 0x90, 0x91, 0x16, 0xE0, 0xFF, 0xC3, 0x94, 0x08, 0x50, +0x14, 0x90, 0x91, 0x18, 0xE0, 0x24, 0x09, 0x12, 0x5E, 0x42, 0x90, 0x91, 0x16, 0xE0, 0x51, 0x95, +0x51, 0x88, 0xF0, 0x80, 0xE2, 0xE4, 0x90, 0x91, 0x16, 0xF0, 0x90, 0x91, 0x16, 0xE0, 0xFF, 0xC3, +0x94, 0x20, 0x50, 0x1B, 0x90, 0x91, 0x18, 0xE0, 0x24, 0x63, 0x12, 0x5E, 0x42, 0x90, 0x91, 0x16, +0xE0, 0x24, 0x45, 0xF5, 0x82, 0xE4, 0x34, 0x90, 0xF5, 0x83, 0x51, 0x88, 0xF0, 0x80, 0xDB, 0x90, +0x8F, 0xE7, 0x71, 0x72, 0x90, 0x91, 0x14, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0x30, 0xE3, 0x0D, 0x7F, +0x01, 0x12, 0x63, 0x09, 0x90, 0x01, 0xC7, 0x74, 0x03, 0xF0, 0x80, 0x3E, 0x90, 0x91, 0x14, 0xA3, +0xE0, 0xFF, 0x7C, 0x00, 0x54, 0x07, 0xFD, 0x64, 0x01, 0x60, 0x05, 0xED, 0x64, 0x02, 0x70, 0x2A, +0xED, 0x64, 0x02, 0x4C, 0x70, 0x24, 0xEF, 0x54, 0x30, 0xFF, 0xE4, 0xC4, 0xF8, 0x54, 0xF0, 0xC8, +0xEF, 0xC4, 0x54, 0x0F, 0x48, 0x90, 0x90, 0x7B, 0xF0, 0xAE, 0x04, 0xAF, 0x05, 0xE4, 0xFD, 0x51, +0x9F, 0x90, 0x06, 0x31, 0xE0, 0x54, 0xF7, 0x44, 0x10, 0xF0, 0x7F, 0x00, 0xD0, 0xD0, 0x92, 0xAF, +0x22, 0xEF, 0xF0, 0x90, 0x91, 0x18, 0xE0, 0x22, 0xEF, 0xF0, 0x90, 0x91, 0x16, 0xE0, 0x04, 0x22, +0x90, 0x91, 0x35, 0xE0, 0xFF, 0x24, 0xEB, 0xF5, 0x82, 0xE4, 0x34, 0x8F, 0xF5, 0x83, 0x22, 0x90, +0x91, 0x1B, 0xED, 0xF0, 0x90, 0x91, 0x19, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0x51, 0xBC, 0x90, 0x91, +0x19, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0xA3, 0xE0, 0xFD, 0x02, 0x53, 0x7F, 0xD3, 0x10, 0xAF, 0x01, +0xC3, 0xC0, 0xD0, 0x90, 0x90, 0xD3, 0xE0, 0xFD, 0xB4, 0x02, 0x07, 0x71, 0x6A, 0x74, 0x08, 0xF0, +0x80, 0x09, 0xED, 0xB4, 0x04, 0x05, 0x71, 0x6A, 0x74, 0x10, 0xF0, 0xEF, 0x64, 0x02, 0x4E, 0x60, +0x02, 0x61, 0x65, 0x90, 0x8F, 0xE3, 0xE0, 0xFF, 0x64, 0xFE, 0x60, 0x79, 0xEF, 0x64, 0x02, 0x60, +0x05, 0xEF, 0x64, 0x03, 0x70, 0x6F, 0x90, 0x90, 0x43, 0x71, 0x72, 0x90, 0x91, 0x4E, 0xEE, 0xF0, +0xA3, 0xEF, 0xF0, 0x7E, 0x00, 0x7F, 0x20, 0x7D, 0x00, 0x7B, 0x01, 0x7A, 0x91, 0x79, 0x2C, 0x12, +0x49, 0x38, 0x7B, 0x01, 0x7A, 0x90, 0x79, 0x45, 0x90, 0xAE, 0x73, 0x12, 0x47, 0x5F, 0x7A, 0x91, +0x79, 0x2C, 0x90, 0xAE, 0x76, 0x12, 0x47, 0x5F, 0x7A, 0x8F, 0x79, 0xB2, 0x7D, 0x03, 0x12, 0x02, +0x00, 0x75, 0x40, 0x01, 0x75, 0x41, 0x91, 0x75, 0x42, 0x34, 0x75, 0x43, 0x10, 0x7B, 0x01, 0x7A, +0x91, 0x79, 0x1C, 0x12, 0x34, 0x2C, 0x90, 0x91, 0x32, 0xE0, 0x54, 0x03, 0xFF, 0xC3, 0x94, 0x04, +0x90, 0x8F, 0x9E, 0x50, 0x04, 0xEF, 0xF0, 0x80, 0x03, 0x74, 0x05, 0xF0, 0x7B, 0x01, 0x7A, 0x91, +0x79, 0x1C, 0x12, 0x4D, 0x38, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0x91, 0x4C, 0x74, 0x80, 0xF0, +0xA3, 0x22, 0xE0, 0xFE, 0xA3, 0xE0, 0xFD, 0xED, 0xFF, 0x22, 0x90, 0x91, 0x0E, 0xEE, 0xF0, 0xA3, +0xEF, 0xF0, 0x24, 0x16, 0xFF, 0xE4, 0x3E, 0x12, 0x5F, 0x2C, 0x90, 0x90, 0x8C, 0xA3, 0xE0, 0xB5, +0x07, 0x1B, 0x90, 0x91, 0x0F,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9, 0xE4, 0x34, +0x91, 0xFA, 0x7B, 0x01, 0xA3, 0xE0, 0x44, 0x89, 0xFD, 0x12, 0x30, 0xA4, 0x90, 0x92, 0x0B, 0xA3, +0xE0, 0x24, 0xD3, 0xF9, 0xE4, 0x34, 0x91, 0xFA, 0x7B, 0x01, 0xA3, 0xE0, 0x44, 0x8A, 0xFD, 0x12, +0x30, 0xA4, 0x90, 0x92, 0x0B, 0xA3, 0xE0, 0x22, 0x54, 0xFE, 0xFD, 0x7F, 0x02, 0x12, 0x3A, 0x96, +0x90, 0x00, 0x02, 0xE0, 0x44, 0x01, 0xFD, 0x7F, 0x02, 0x12, 0x3A, 0x96, 0x90, 0x00, 0x02, 0xE0, +0x22, 0x90, 0x90, 0xD7, 0xE0, 0xFF, 0x7B, 0x18, 0x7D, 0x01, 0x12, 0x74, 0x57, 0x90, 0x91, 0x33, +0xEF, 0xF0, 0x90, 0x90, 0xD7, 0xE0, 0x90, 0x04, 0x25, 0xF0, 0x22, 0x12, 0x47, 0x3E, 0x90, 0x8E, +0x4B, 0x12, 0x47, 0x32, 0x12, 0x46, 0xF9, 0x78, 0x0A, 0x12, 0x27, 0x22, 0x90, 0x8E, 0x2A, 0xE0, +0xF4, 0x04, 0x2F, 0x22, 0x90, 0x01, 0x57, 0xE4, 0xF0, 0x90, 0x01, 0x3C, 0x74, 0x02, 0x22, 0x90, +0x91, 0xC2, 0xE0, 0xF5, 0x43, 0x7B, 0x01, 0x7A, 0x91, 0x79, 0xCB, 0x12, 0x34, 0x2C, 0xE4, 0x90, +0x91, 0xCA, 0xF0, 0x22, 0x74, 0x2F, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x8E, 0xF5, 0x83, 0xE0, 0xFF, +0x90, 0x92, 0x15, 0xE0, 0x2F, 0xF0, 0xE0, 0xD3, 0x22, 0x90, 0x8E, 0xBA, 0x74, 0x05, 0xF0, 0xA3, +0x74, 0x0F, 0xF0, 0xA3, 0xE0, 0x54, 0x01, 0x44, 0x1E, 0xF0, 0xA3, 0x74, 0x07, 0x22, 0xA3, 0xE0, +0x44, 0x8B, 0xFD, 0x12, 0x30, 0xA4, 0x90, 0x92, 0x0D, 0xE0, 0x44, 0x90, 0x90, 0x01, 0x8C, 0xF0, +0x22, 0xA3, 0xE0, 0x24, 0x28, 0xF9, 0xE4, 0x34, 0xFC, 0xFA, 0x7B, 0x01, 0x22, 0x90, 0x8E, 0x24, +0xE0, 0xFF, 0xA3, 0xE0, 0xFD, 0x90, 0x8E, 0x2B, 0xE0, 0x22, 0x90, 0x8E, 0xC5, 0xE0, 0xC4, 0x13, +0x13, 0x54, 0x03, 0x22, 0x7F, 0x00, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x7F, 0x00, 0x7E, 0x0E, 0x22, +0x90, 0x06, 0x04, 0xE0, 0x44, 0x40, 0xF0, 0xE0, 0x44, 0x80, 0xF0, 0x22, 0xE0, 0x2F, 0x24, 0x42, +0xF9, 0xE4, 0x34, 0xFC, 0xFA, 0x22, 0xE0, 0x2F, 0x24, 0x48, 0xF9, 0xE4, 0x34, 0xFC, 0xFA, 0x22, +0x75, 0x41, 0x8F, 0x75, 0x42, 0xE9, 0x75, 0x43, 0x02, 0x22, 0xE4, 0x90, 0x92, 0x15, 0xF0, 0x90, +0x92, 0x13, 0xF0, 0x22, 0x12, 0x47, 0x14, 0x90, 0x8E, 0x4F, 0x02, 0x27, 0x48, 0xF0, 0xA3, 0xEF, +0xF0, 0xE4, 0xFD, 0x02, 0x5E, 0x54, 0x90, 0x92, 0xAB, 0xE0, 0xFF, 0x74, 0x64, 0xD3, 0x9F, 0x22, +0x90, 0x92, 0xAB, 0xE0, 0xFF, 0x74, 0x24, 0xD3, 0x9F, 0x22, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, +0x00, 0xFF, 0xE0, 0x22, 0xD2, 0xAF, 0xC2, 0xAF, 0x90, 0x8D, 0x01, 0xE0, 0xFF, 0x22, 0x90, 0x92, +0x13, 0xE0, 0xFF, 0xC3, 0x94, 0x19, 0x22, 0x90, 0x90, 0xFA, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x22, +0x7F, 0xB4, 0x7E, 0x08, 0x12, 0x36, 0xCE, 0xEF, 0x22, 0x54, 0x08, 0xFE, 0xEF, 0x54, 0xF7, 0x4E, +0x22, 0x54, 0x20, 0xFE, 0xEF, 0x54, 0xDF, 0x4E, 0x22, 0x7F, 0xB4, 0x7E, 0x08, 0x02, 0x37, 0x5D, +0x90, 0x8D, 0xF9, 0xF0, 0xA3, 0xEF, 0xF0, 0x22, 0xF9, 0xE4, 0x3A, 0xFA, 0x02, 0x26, 0x1E, 0xF0, +0x90, 0x91, 0x35, 0xE0, 0x04, 0xF0, 0x22, 0x90, 0x91, 0x38, 0xE4, 0x75, 0xF0, 0x02, 0x22, 0xF0, +0xE4, 0x90, 0x91, 0x43, 0xF0, 0xA3, 0x22, 0xF0, 0x90, 0x8E, 0x2D, 0xE0, 0xFF, 0xC3, 0x22, 0x90, +0x8E, 0x10, 0xE0, 0xC4, 0x54, 0x0F, 0x22, 0x90, 0x8E, 0x18, 0xE0, 0x90, 0x05, 0x73, 0x22, 0x90, +0x8E, 0x16, 0xE0, 0x44, 0x10, 0xF0, 0x22, 0xF0, 0xA3, 0xF0, 0xA3, 0x74, 0x08, 0xF0, 0x22, 0x12, +0x3A, 0x96, 0x90, 0x92, 0xCC, 0xE0, 0x22, 0x00, 0xDE, 0x37, }; -u4Byte ArrayLength_MP_8812A_FW_WoWLAN = 21204; +u4Byte ArrayLength_MP_8812A_FW_WoWLAN = 24170; void diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_MAC.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_MAC.c index 880e260dd5a240..aa66b22516e485 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_MAC.c +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_MAC.c @@ -18,7 +18,8 @@ * ******************************************************************************/ -#include "../odm_precomp.h" +#include "Mp_Precomp.h" +#include "../phydm_precomp.h" #if (RTL8812A_SUPPORT == 1) static BOOLEAN @@ -28,49 +29,74 @@ CheckPositive( IN const u4Byte Condition2 ) { - u1Byte _GLNA = (pDM_Odm->BoardType & BIT4) >> 4; - u1Byte _GPA = (pDM_Odm->BoardType & BIT3) >> 3; - u1Byte _ALNA = (pDM_Odm->BoardType & BIT7) >> 7; - u1Byte _APA = (pDM_Odm->BoardType & BIT6) >> 6; - - u1Byte cBoard = (u1Byte)((Condition1 & bMaskByte0) >> 0); - u1Byte cInterface = (u1Byte)((Condition1 & (BIT11|BIT10|BIT9|BIT8)) >> 8); - u1Byte cPackage = (u1Byte)((Condition1 & (BIT15|BIT14|BIT13|BIT12)) >> 12); - u1Byte cPlatform = (u1Byte)((Condition1 & (BIT19|BIT18|BIT17|BIT16)) >> 16); - u1Byte cCut = (u1Byte)((Condition1 & (BIT27|BIT26|BIT25|BIT24)) >> 24); - u1Byte cGLNA = (cBoard & BIT0) >> 0; - u1Byte cGPA = (cBoard & BIT1) >> 1; - u1Byte cALNA = (cBoard & BIT2) >> 2; - u1Byte cAPA = (cBoard & BIT3) >> 3; - u1Byte cTypeGLNA = (u1Byte)((Condition2 & bMaskByte0) >> 0); - u1Byte cTypeGPA = (u1Byte)((Condition2 & bMaskByte1) >> 8); - u1Byte cTypeALNA = (u1Byte)((Condition2 & bMaskByte2) >> 16); - u1Byte cTypeAPA = (u1Byte)((Condition2 & bMaskByte3) >> 24); - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, - ("===> [8812A] CheckPositive(0x%X 0x%X)\n", Condition1, Condition2)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, - (" (Platform, Interface) = (0x%X, 0x%X)", pDM_Odm->SupportPlatform, pDM_Odm->SupportInterface)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, - (" (Board, Package) = (0x%X, 0x%X\n", pDM_Odm->BoardType, pDM_Odm->PackageType)); - - if ((cPlatform != pDM_Odm->SupportPlatform && cPlatform != 0) || - (cInterface != pDM_Odm->SupportInterface && cInterface != 0) || - (cCut != pDM_Odm->CutVersion && cCut != 0)) - return FALSE; - - if (cPackage != pDM_Odm->PackageType && cPackage != 0) - return FALSE; - - if (((_GLNA != 0) && (_GLNA == cGLNA) && (cTypeGLNA == pDM_Odm->TypeGLNA)) || - ((_GPA != 0) && (_GPA == cGPA ) && (cTypeGPA == pDM_Odm->TypeGPA )) || - ((_ALNA != 0) && (_ALNA == cALNA) && (cTypeALNA == pDM_Odm->TypeALNA)) || - ((_APA != 0) && (_APA == cAPA ) && (cTypeAPA == pDM_Odm->TypeAPA ))) - return TRUE; - else - return FALSE; -} + u1Byte _BoardType = ((pDM_Odm->BoardType & BIT4) >> 4) << 0 | // _GLNA + ((pDM_Odm->BoardType & BIT3) >> 3) << 1 | // _GPA + ((pDM_Odm->BoardType & BIT7) >> 7) << 2 | // _ALNA + ((pDM_Odm->BoardType & BIT6) >> 6) << 3 | // _APA + ((pDM_Odm->BoardType & BIT2) >> 2) << 4; // _BT + + u4Byte cond1 = Condition1, cond2 = Condition2; + u4Byte driver1 = pDM_Odm->CutVersion << 24 | + pDM_Odm->SupportPlatform << 16 | + pDM_Odm->PackageType << 12 | + pDM_Odm->SupportInterface << 8 | + _BoardType; + + u4Byte driver2 = pDM_Odm->TypeGLNA << 0 | + pDM_Odm->TypeGPA << 8 | + pDM_Odm->TypeALNA << 16 | + pDM_Odm->TypeAPA << 24; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, + ("===> [8812A] CheckPositive (cond1, cond2) = (0x%X 0x%X)\n", cond1, cond2)); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, + ("===> [8812A] CheckPositive (driver1, driver2) = (0x%X 0x%X)\n", driver1, driver2)); + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, + (" (Platform, Interface) = (0x%X, 0x%X)\n", pDM_Odm->SupportPlatform, pDM_Odm->SupportInterface)); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, + (" (Board, Package) = (0x%X, 0x%X)\n", pDM_Odm->BoardType, pDM_Odm->PackageType)); + + + //============== Value Defined Check ===============// + //QFN Type [15:12] and Cut Version [27:24] need to do value check + + if(((cond1 & 0x0000F000) != 0) &&((cond1 & 0x0000F000) != (driver1 & 0x0000F000))) + return FALSE; + if(((cond1 & 0x0F000000) != 0) &&((cond1 & 0x0F000000) != (driver1 & 0x0F000000))) + return FALSE; + + //=============== Bit Defined Check ================// + // We don't care [31:28] and [23:20] + // + cond1 &= 0x000F0FFF; + driver1 &= 0x000F0FFF; + + if ((cond1 & driver1) == cond1) + { + u4Byte bitMask = 0; + if ((cond1 & 0x0F) == 0) // BoardType is DONTCARE + return TRUE; + + if ((cond1 & BIT0) != 0) //GLNA + bitMask |= 0x000000FF; + if ((cond1 & BIT1) != 0) //GPA + bitMask |= 0x0000FF00; + if ((cond1 & BIT2) != 0) //ALNA + bitMask |= 0x00FF0000; + if ((cond1 & BIT3) != 0) //APA + bitMask |= 0xFF000000; + if ((cond2 & bitMask) == (driver2 & bitMask)) // BoardType of each RF path is matched + return TRUE; + else + return FALSE; + } + else + { + return FALSE; + } +} static BOOLEAN CheckNegative( IN PDM_ODM_T pDM_Odm, @@ -195,77 +221,70 @@ ODM_ReadAndConfig_MP_8812A_MAC_REG( IN PDM_ODM_T pDM_Odm ) { - #define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0) - #define COND_ELSE 2 - #define COND_ENDIF 3 u4Byte i = 0; + u1Byte cCond; + BOOLEAN bMatched = TRUE, bSkipped = FALSE; +//ask by Luke.Lee u4Byte ArrayLen = sizeof(Array_MP_8812A_MAC_REG)/sizeof(u4Byte); pu4Byte Array = Array_MP_8812A_MAC_REG; ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ReadAndConfig_MP_8812A_MAC_REG\n")); - for (i = 0; i < ArrayLen; i += 2 ) - { - u4Byte v1 = Array[i]; - u4Byte v2 = Array[i+1]; - - // This (offset, data) pair doesn't care the condition. - if ( v1 < 0x40000000 ) - { - odm_ConfigMAC_8812A(pDM_Odm, v1, (u1Byte)v2); - continue; - } - else - { // This line is the beginning of branch. - BOOLEAN bMatched = TRUE; - u1Byte cCond = (u1Byte)((v1 & (BIT29|BIT28)) >> 28); - - if (cCond == COND_ELSE) { // ELSE, ENDIF - bMatched = TRUE; - READ_NEXT_PAIR(v1, v2, i); - } else if ( ! CheckPositive(pDM_Odm, v1, v2) ) { - bMatched = FALSE; - READ_NEXT_PAIR(v1, v2, i); - READ_NEXT_PAIR(v1, v2, i); - } else { - READ_NEXT_PAIR(v1, v2, i); - if ( ! CheckNegative(pDM_Odm, v1, v2) ) - bMatched = FALSE; - else - bMatched = TRUE; - READ_NEXT_PAIR(v1, v2, i); - } - - if ( bMatched == FALSE ) - { // Condition isn't matched. Discard the following (offset, data) pairs. - while (v1 < 0x40000000 && i < ArrayLen -2) - READ_NEXT_PAIR(v1, v2, i); + while(( i+1) < ArrayLen) + { + u4Byte v1 = Array[i]; + u4Byte v2 = Array[i+1]; - i -= 2; // prevent from for-loop += 2 - } - else // Configure matched pairs and skip to end of if-else. - { - while (v1 < 0x40000000 && i < ArrayLen-2) { - odm_ConfigMAC_8812A(pDM_Odm, v1, (u1Byte)v2); - READ_NEXT_PAIR(v1, v2, i); - } - - // Keeps reading until ENDIF. - cCond = (u1Byte)((v1 & (BIT29|BIT28)) >> 28); - while (cCond != COND_ENDIF && i < ArrayLen-2) { - READ_NEXT_PAIR(v1, v2, i); - cCond = (u1Byte)((v1 & (BIT29|BIT28)) >> 28); - } - } - } - } + if(v1 & (BIT31|BIT30)) //positive & negative condition + { + if(v1 & BIT31) // positive condition + { + cCond = (u1Byte)((v1 & (BIT29|BIT28)) >> 28); + if(cCond == COND_ENDIF) //end + { + bMatched = TRUE; + bSkipped = FALSE; + } + else if(cCond == COND_ELSE) //else + { + bMatched = bSkipped?FALSE:TRUE; + } + else //if , else if + { + if(bSkipped) + bMatched = FALSE; + else + { + if(CheckPositive(pDM_Odm, v1, v2)) + { + bMatched = TRUE; + bSkipped = TRUE; + } + else + { + bMatched = FALSE; + bSkipped = FALSE; + } + } + } + } + else if(v1 & BIT30){ //negative condition + //do nothing + } + } + else + { + if(bMatched) + odm_ConfigMAC_8812A(pDM_Odm, v1, (u1Byte)v2); + } + i = i + 2; + } } u4Byte -ODM_GetVersion_MP_8812A_MAC_REG( -) +ODM_GetVersion_MP_8812A_MAC_REG(void) { - return 40; + return 49; } #endif // end of HWIMG_SUPPORT diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_MAC.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_MAC.h index bea6320967e385..abab331345c047 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_MAC.h +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_MAC.h @@ -22,8 +22,6 @@ #ifndef __INC_MP_MAC_HW_IMG_8812A_H #define __INC_MP_MAC_HW_IMG_8812A_H -//static BOOLEAN CheckPositive(PDM_ODM_T pDM_Odm, const u4Byte Condition1, const u4Byte Condition2); -//static BOOLEAN CheckNegative(PDM_ODM_T pDM_Odm, const u4Byte Condition1, const u4Byte Condition2); /****************************************************************************** * MAC_REG.TXT @@ -33,8 +31,7 @@ void ODM_ReadAndConfig_MP_8812A_MAC_REG( // TC: Test Chip, MP: MP Chip IN PDM_ODM_T pDM_Odm ); -u4Byte -ODM_GetVersion_MP_8812A_MAC_REG(VOID); +u4Byte ODM_GetVersion_MP_8812A_MAC_REG(void); #endif #endif // end of HWIMG_SUPPORT diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_RF.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_RF.c index 058793941ad7fe..009c7338b08fbb 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_RF.c +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_RF.c @@ -18,8 +18,8 @@ * ******************************************************************************/ - -#include "../odm_precomp.h" +#include "Mp_Precomp.h" +#include "../phydm_precomp.h" #if (RTL8812A_SUPPORT == 1) static BOOLEAN @@ -29,49 +29,74 @@ CheckPositive( IN const u4Byte Condition2 ) { - u1Byte _GLNA = (pDM_Odm->BoardType & BIT4) >> 4; - u1Byte _GPA = (pDM_Odm->BoardType & BIT3) >> 3; - u1Byte _ALNA = (pDM_Odm->BoardType & BIT7) >> 7; - u1Byte _APA = (pDM_Odm->BoardType & BIT6) >> 6; - - u1Byte cBoard = (u1Byte)((Condition1 & bMaskByte0) >> 0); - u1Byte cInterface = (u1Byte)((Condition1 & (BIT11|BIT10|BIT9|BIT8)) >> 8); - u1Byte cPackage = (u1Byte)((Condition1 & (BIT15|BIT14|BIT13|BIT12)) >> 12); - u1Byte cPlatform = (u1Byte)((Condition1 & (BIT19|BIT18|BIT17|BIT16)) >> 16); - u1Byte cCut = (u1Byte)((Condition1 & (BIT27|BIT26|BIT25|BIT24)) >> 24); - u1Byte cGLNA = (cBoard & BIT0) >> 0; - u1Byte cGPA = (cBoard & BIT1) >> 1; - u1Byte cALNA = (cBoard & BIT2) >> 2; - u1Byte cAPA = (cBoard & BIT3) >> 3; - u1Byte cTypeGLNA = (u1Byte)((Condition2 & bMaskByte0) >> 0); - u1Byte cTypeGPA = (u1Byte)((Condition2 & bMaskByte1) >> 8); - u1Byte cTypeALNA = (u1Byte)((Condition2 & bMaskByte2) >> 16); - u1Byte cTypeAPA = (u1Byte)((Condition2 & bMaskByte3) >> 24); - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, - ("===> [8812A] CheckPositive(0x%X 0x%X)\n", Condition1, Condition2)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, - (" (Platform, Interface) = (0x%X, 0x%X)", pDM_Odm->SupportPlatform, pDM_Odm->SupportInterface)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, - (" (Board, Package) = (0x%X, 0x%X\n", pDM_Odm->BoardType, pDM_Odm->PackageType)); - - if ((cPlatform != pDM_Odm->SupportPlatform && cPlatform != 0) || - (cInterface != pDM_Odm->SupportInterface && cInterface != 0) || - (cCut != pDM_Odm->CutVersion && cCut != 0)) - return FALSE; - - if (cPackage != pDM_Odm->PackageType && cPackage != 0) - return FALSE; - - if (((_GLNA != 0) && (_GLNA == cGLNA) && (cTypeGLNA == pDM_Odm->TypeGLNA)) || - ((_GPA != 0) && (_GPA == cGPA ) && (cTypeGPA == pDM_Odm->TypeGPA )) || - ((_ALNA != 0) && (_ALNA == cALNA) && (cTypeALNA == pDM_Odm->TypeALNA)) || - ((_APA != 0) && (_APA == cAPA ) && (cTypeAPA == pDM_Odm->TypeAPA ))) - return TRUE; - else - return FALSE; + u1Byte _BoardType = ((pDM_Odm->BoardType & BIT4) >> 4) << 0 | // _GLNA + ((pDM_Odm->BoardType & BIT3) >> 3) << 1 | // _GPA + ((pDM_Odm->BoardType & BIT7) >> 7) << 2 | // _ALNA + ((pDM_Odm->BoardType & BIT6) >> 6) << 3 | // _APA + ((pDM_Odm->BoardType & BIT2) >> 2) << 4; // _BT + + u4Byte cond1 = Condition1, cond2 = Condition2; + u4Byte driver1 = pDM_Odm->CutVersion << 24 | + pDM_Odm->SupportPlatform << 16 | + pDM_Odm->PackageType << 12 | + pDM_Odm->SupportInterface << 8 | + _BoardType; + + u4Byte driver2 = pDM_Odm->TypeGLNA << 0 | + pDM_Odm->TypeGPA << 8 | + pDM_Odm->TypeALNA << 16 | + pDM_Odm->TypeAPA << 24; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, + ("===> [8812A] CheckPositive (cond1, cond2) = (0x%X 0x%X)\n", cond1, cond2)); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, + ("===> [8812A] CheckPositive (driver1, driver2) = (0x%X 0x%X)\n", driver1, driver2)); + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, + (" (Platform, Interface) = (0x%X, 0x%X)\n", pDM_Odm->SupportPlatform, pDM_Odm->SupportInterface)); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, + (" (Board, Package) = (0x%X, 0x%X)\n", pDM_Odm->BoardType, pDM_Odm->PackageType)); + + + //============== Value Defined Check ===============// + //QFN Type [15:12] and Cut Version [27:24] need to do value check + + if(((cond1 & 0x0000F000) != 0) &&((cond1 & 0x0000F000) != (driver1 & 0x0000F000))) + return FALSE; + if(((cond1 & 0x0F000000) != 0) &&((cond1 & 0x0F000000) != (driver1 & 0x0F000000))) + return FALSE; + + //=============== Bit Defined Check ================// + // We don't care [31:28] and [23:20] + // + cond1 &= 0x000F0FFF; + driver1 &= 0x000F0FFF; + + if ((cond1 & driver1) == cond1) + { + u4Byte bitMask = 0; + if ((cond1 & 0x0F) == 0) // BoardType is DONTCARE + return TRUE; + + if ((cond1 & BIT0) != 0) //GLNA + bitMask |= 0x000000FF; + if ((cond1 & BIT1) != 0) //GPA + bitMask |= 0x0000FF00; + if ((cond1 & BIT2) != 0) //ALNA + bitMask |= 0x00FF0000; + if ((cond1 & BIT3) != 0) //APA + bitMask |= 0xFF000000; + + if ((cond2 & bitMask) == (driver2 & bitMask)) // BoardType of each RF path is matched + return TRUE; + else + return FALSE; + } + else + { + return FALSE; + } } - static BOOLEAN CheckNegative( IN PDM_ODM_T pDM_Odm, @@ -215,7 +240,7 @@ u4Byte Array_MP_8812A_RadioA[] = { 0x03B, 0x0006B064, 0x03C, 0x00004000, 0x03A, 0x000000D8, - 0x03B, 0x00023070, + 0x03B, 0x00063070, 0x03C, 0x00004000, 0x03A, 0x00000468, 0x03B, 0x0005B870, @@ -469,7 +494,7 @@ u4Byte Array_MP_8812A_RadioA[] = { 0x018, 0x0001712A, 0x0EF, 0x00000002, 0x0DF, 0x00000080, - 0x01F, 0x00040064, + 0x01F, 0x00000064, 0x80000008,0x00000000,0x40000000,0x00000000, 0x061, 0x000FDD43, 0x062, 0x00038F4B, @@ -507,77 +532,70 @@ ODM_ReadAndConfig_MP_8812A_RadioA( IN PDM_ODM_T pDM_Odm ) { - #define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0) - #define COND_ELSE 2 - #define COND_ENDIF 3 u4Byte i = 0; + u1Byte cCond; + BOOLEAN bMatched = TRUE, bSkipped = FALSE; +//ask by Luke.Lee u4Byte ArrayLen = sizeof(Array_MP_8812A_RadioA)/sizeof(u4Byte); pu4Byte Array = Array_MP_8812A_RadioA; ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ReadAndConfig_MP_8812A_RadioA\n")); - for (i = 0; i < ArrayLen; i += 2 ) - { - u4Byte v1 = Array[i]; - u4Byte v2 = Array[i+1]; - - // This (offset, data) pair doesn't care the condition. - if ( v1 < 0x40000000 ) - { - odm_ConfigRF_RadioA_8812A(pDM_Odm, v1, v2); - continue; - } - else - { // This line is the beginning of branch. - BOOLEAN bMatched = TRUE; - u1Byte cCond = (u1Byte)((v1 & (BIT29|BIT28)) >> 28); - - if (cCond == COND_ELSE) { // ELSE, ENDIF - bMatched = TRUE; - READ_NEXT_PAIR(v1, v2, i); - } else if ( ! CheckPositive(pDM_Odm, v1, v2) ) { - bMatched = FALSE; - READ_NEXT_PAIR(v1, v2, i); - READ_NEXT_PAIR(v1, v2, i); - } else { - READ_NEXT_PAIR(v1, v2, i); - if ( ! CheckNegative(pDM_Odm, v1, v2) ) - bMatched = FALSE; - else - bMatched = TRUE; - READ_NEXT_PAIR(v1, v2, i); - } - - if ( bMatched == FALSE ) - { // Condition isn't matched. Discard the following (offset, data) pairs. - while (v1 < 0x40000000 && i < ArrayLen -2) - READ_NEXT_PAIR(v1, v2, i); - - i -= 2; // prevent from for-loop += 2 - } - else // Configure matched pairs and skip to end of if-else. - { - while (v1 < 0x40000000 && i < ArrayLen-2) { - odm_ConfigRF_RadioA_8812A(pDM_Odm, v1, v2); - READ_NEXT_PAIR(v1, v2, i); - } - - // Keeps reading until ENDIF. - cCond = (u1Byte)((v1 & (BIT29|BIT28)) >> 28); - while (cCond != COND_ENDIF && i < ArrayLen-2) { - READ_NEXT_PAIR(v1, v2, i); - cCond = (u1Byte)((v1 & (BIT29|BIT28)) >> 28); - } - } - } - } + while(( i+1) < ArrayLen) + { + u4Byte v1 = Array[i]; + u4Byte v2 = Array[i+1]; + + if(v1 & (BIT31|BIT30)) //positive & negative condition + { + if(v1 & BIT31) // positive condition + { + cCond = (u1Byte)((v1 & (BIT29|BIT28)) >> 28); + if(cCond == COND_ENDIF) //end + { + bMatched = TRUE; + bSkipped = FALSE; + } + else if(cCond == COND_ELSE) //else + { + bMatched = bSkipped?FALSE:TRUE; + } + else //if , else if + { + if(bSkipped) + bMatched = FALSE; + else + { + if(CheckPositive(pDM_Odm, v1, v2)) + { + bMatched = TRUE; + bSkipped = TRUE; + } + else + { + bMatched = FALSE; + bSkipped = FALSE; + } + } + } + } + else if(v1 & BIT30){ //negative condition + //do nothing + } + } + else + { + if(bMatched) + odm_ConfigRF_RadioA_8812A(pDM_Odm, v1, v2); + } + i = i + 2; + } } u4Byte -ODM_GetVersion_MP_8812A_RadioA( -) +ODM_GetVersion_MP_8812A_RadioA(void) { - return 40; + return 49; } /****************************************************************************** @@ -996,83 +1014,77 @@ ODM_ReadAndConfig_MP_8812A_RadioB( IN PDM_ODM_T pDM_Odm ) { - #define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0) - #define COND_ELSE 2 - #define COND_ENDIF 3 u4Byte i = 0; + u1Byte cCond; + BOOLEAN bMatched = TRUE, bSkipped = FALSE; +//ask by Luke.Lee u4Byte ArrayLen = sizeof(Array_MP_8812A_RadioB)/sizeof(u4Byte); pu4Byte Array = Array_MP_8812A_RadioB; ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ReadAndConfig_MP_8812A_RadioB\n")); - for (i = 0; i < ArrayLen; i += 2 ) - { - u4Byte v1 = Array[i]; - u4Byte v2 = Array[i+1]; - - // This (offset, data) pair doesn't care the condition. - if ( v1 < 0x40000000 ) - { - odm_ConfigRF_RadioB_8812A(pDM_Odm, v1, v2); - continue; - } - else - { // This line is the beginning of branch. - BOOLEAN bMatched = TRUE; - u1Byte cCond = (u1Byte)((v1 & (BIT29|BIT28)) >> 28); - - if (cCond == COND_ELSE) { // ELSE, ENDIF - bMatched = TRUE; - READ_NEXT_PAIR(v1, v2, i); - } else if ( ! CheckPositive(pDM_Odm, v1, v2) ) { - bMatched = FALSE; - READ_NEXT_PAIR(v1, v2, i); - READ_NEXT_PAIR(v1, v2, i); - } else { - READ_NEXT_PAIR(v1, v2, i); - if ( ! CheckNegative(pDM_Odm, v1, v2) ) - bMatched = FALSE; - else - bMatched = TRUE; - READ_NEXT_PAIR(v1, v2, i); - } - - if ( bMatched == FALSE ) - { // Condition isn't matched. Discard the following (offset, data) pairs. - while (v1 < 0x40000000 && i < ArrayLen -2) - READ_NEXT_PAIR(v1, v2, i); - - i -= 2; // prevent from for-loop += 2 - } - else // Configure matched pairs and skip to end of if-else. - { - while (v1 < 0x40000000 && i < ArrayLen-2) { - odm_ConfigRF_RadioB_8812A(pDM_Odm, v1, v2); - READ_NEXT_PAIR(v1, v2, i); - } - - // Keeps reading until ENDIF. - cCond = (u1Byte)((v1 & (BIT29|BIT28)) >> 28); - while (cCond != COND_ENDIF && i < ArrayLen-2) { - READ_NEXT_PAIR(v1, v2, i); - cCond = (u1Byte)((v1 & (BIT29|BIT28)) >> 28); - } - } - } - } + while(( i+1) < ArrayLen) + { + u4Byte v1 = Array[i]; + u4Byte v2 = Array[i+1]; + + if(v1 & (BIT31|BIT30)) //positive & negative condition + { + if(v1 & BIT31) // positive condition + { + cCond = (u1Byte)((v1 & (BIT29|BIT28)) >> 28); + if(cCond == COND_ENDIF) //end + { + bMatched = TRUE; + bSkipped = FALSE; + } + else if(cCond == COND_ELSE) //else + { + bMatched = bSkipped?FALSE:TRUE; + } + else //if , else if + { + if(bSkipped) + bMatched = FALSE; + else + { + if(CheckPositive(pDM_Odm, v1, v2)) + { + bMatched = TRUE; + bSkipped = TRUE; + } + else + { + bMatched = FALSE; + bSkipped = FALSE; + } + } + } + } + else if(v1 & BIT30){ //negative condition + //do nothing + } + } + else + { + if(bMatched) + odm_ConfigRF_RadioB_8812A(pDM_Odm, v1, v2); + } + i = i + 2; + } } u4Byte -ODM_GetVersion_MP_8812A_RadioB( -) +ODM_GetVersion_MP_8812A_RadioB(void) { - return 40; + return 49; } /****************************************************************************** * TxPowerTrack_AP.TXT ******************************************************************************/ +#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) u1Byte gDeltaSwingTableIdx_MP_5GB_N_TxPowerTrack_AP_8812A[][DELTA_SWINGIDX_SIZE] = { {0, 1, 1, 2, 2, 3, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 11, 12, 12, 13, 13, 14, 14, 14, 14, 14, 14, 14}, {0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 14, 14, 14, 14, 14}, @@ -1101,12 +1113,14 @@ u1Byte gDeltaSwingTableIdx_MP_2GCCKB_N_TxPowerTrack_AP_8812A[] = {0, 1, 1, 1, 2, u1Byte gDeltaSwingTableIdx_MP_2GCCKB_P_TxPowerTrack_AP_8812A[] = {0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9}; u1Byte gDeltaSwingTableIdx_MP_2GCCKA_N_TxPowerTrack_AP_8812A[] = {0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 7, 8, 8, 9, 9, 9, 10, 10, 10, 10, 11, 11}; u1Byte gDeltaSwingTableIdx_MP_2GCCKA_P_TxPowerTrack_AP_8812A[] = {0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9}; +#endif void ODM_ReadAndConfig_MP_8812A_TxPowerTrack_AP( IN PDM_ODM_T pDM_Odm ) { +#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) PODM_RF_CAL_T pRFCalibrateInfo = &(pDM_Odm->RFCalibrateInfo); ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ReadAndConfig_MP_MP_8812A\n")); @@ -1126,12 +1140,14 @@ ODM_ReadAndConfig_MP_8812A_TxPowerTrack_AP( ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GA_N, gDeltaSwingTableIdx_MP_5GA_N_TxPowerTrack_AP_8812A, DELTA_SWINGIDX_SIZE*3); ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GB_P, gDeltaSwingTableIdx_MP_5GB_P_TxPowerTrack_AP_8812A, DELTA_SWINGIDX_SIZE*3); ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GB_N, gDeltaSwingTableIdx_MP_5GB_N_TxPowerTrack_AP_8812A, DELTA_SWINGIDX_SIZE*3); +#endif } /****************************************************************************** * TxPowerTrack_PCIE.TXT ******************************************************************************/ +#if DEV_BUS_TYPE == RT_PCI_INTERFACE u1Byte gDeltaSwingTableIdx_MP_5GB_N_TxPowerTrack_PCIE_8812A[][DELTA_SWINGIDX_SIZE] = { {0, 1, 1, 2, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 9, 9, 9, 10, 10, 11, 11, 12, 12, 13}, {0, 1, 1, 2, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 13, 13}, @@ -1160,12 +1176,14 @@ u1Byte gDeltaSwingTableIdx_MP_2GCCKB_N_TxPowerTrack_PCIE_8812A[] = {0, 1, 1, 1, u1Byte gDeltaSwingTableIdx_MP_2GCCKB_P_TxPowerTrack_PCIE_8812A[] = {0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9}; u1Byte gDeltaSwingTableIdx_MP_2GCCKA_N_TxPowerTrack_PCIE_8812A[] = {0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 7, 8, 8, 9, 9, 9, 10, 10, 10, 10, 11, 11}; u1Byte gDeltaSwingTableIdx_MP_2GCCKA_P_TxPowerTrack_PCIE_8812A[] = {0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9}; +#endif void ODM_ReadAndConfig_MP_8812A_TxPowerTrack_PCIE( IN PDM_ODM_T pDM_Odm ) { +#if DEV_BUS_TYPE == RT_PCI_INTERFACE PODM_RF_CAL_T pRFCalibrateInfo = &(pDM_Odm->RFCalibrateInfo); ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ReadAndConfig_MP_MP_8812A\n")); @@ -1185,6 +1203,7 @@ ODM_ReadAndConfig_MP_8812A_TxPowerTrack_PCIE( ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GA_N, gDeltaSwingTableIdx_MP_5GA_N_TxPowerTrack_PCIE_8812A, DELTA_SWINGIDX_SIZE*3); ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GB_P, gDeltaSwingTableIdx_MP_5GB_P_TxPowerTrack_PCIE_8812A, DELTA_SWINGIDX_SIZE*3); ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GB_N, gDeltaSwingTableIdx_MP_5GB_N_TxPowerTrack_PCIE_8812A, DELTA_SWINGIDX_SIZE*3); +#endif } /****************************************************************************** @@ -1309,6 +1328,7 @@ ODM_ReadAndConfig_MP_8812A_TxPowerTrack_RFE4( * TxPowerTrack_USB.TXT ******************************************************************************/ +#if DEV_BUS_TYPE == RT_USB_INTERFACE u1Byte gDeltaSwingTableIdx_MP_5GB_N_TxPowerTrack_USB_8812A[][DELTA_SWINGIDX_SIZE] = { {0, 1, 1, 2, 2, 3, 4, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 14, 14, 14, 14}, {0, 1, 1, 2, 2, 3, 4, 4, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 14, 14, 14, 14}, @@ -1337,12 +1357,14 @@ u1Byte gDeltaSwingTableIdx_MP_2GCCKB_N_TxPowerTrack_USB_8812A[] = {0, 1, 1, 2, 2 u1Byte gDeltaSwingTableIdx_MP_2GCCKB_P_TxPowerTrack_USB_8812A[] = {0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7}; u1Byte gDeltaSwingTableIdx_MP_2GCCKA_N_TxPowerTrack_USB_8812A[] = {0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 9, 10, 10, 10, 10, 10, 10}; u1Byte gDeltaSwingTableIdx_MP_2GCCKA_P_TxPowerTrack_USB_8812A[] = {0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7}; +#endif void ODM_ReadAndConfig_MP_8812A_TxPowerTrack_USB( IN PDM_ODM_T pDM_Odm ) { +#if DEV_BUS_TYPE == RT_USB_INTERFACE PODM_RF_CAL_T pRFCalibrateInfo = &(pDM_Odm->RFCalibrateInfo); ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ReadAndConfig_MP_MP_8812A\n")); @@ -1362,6 +1384,7 @@ ODM_ReadAndConfig_MP_8812A_TxPowerTrack_USB( ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GA_N, gDeltaSwingTableIdx_MP_5GA_N_TxPowerTrack_USB_8812A, DELTA_SWINGIDX_SIZE*3); ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GB_P, gDeltaSwingTableIdx_MP_5GB_P_TxPowerTrack_USB_8812A, DELTA_SWINGIDX_SIZE*3); ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GB_N, gDeltaSwingTableIdx_MP_5GB_N_TxPowerTrack_USB_8812A, DELTA_SWINGIDX_SIZE*3); +#endif } /****************************************************************************** @@ -1369,171 +1392,171 @@ ODM_ReadAndConfig_MP_8812A_TxPowerTrack_USB( ******************************************************************************/ pu1Byte Array_MP_8812A_TXPWR_LMT[] = { - "FCC", "2.4G", "20M", "CCK", "1T", "01", "30", - "ETSI", "2.4G", "20M", "CCK", "1T", "01", "36", - "MKK", "2.4G", "20M", "CCK", "1T", "01", "36", - "FCC", "2.4G", "20M", "CCK", "1T", "02", "30", - "ETSI", "2.4G", "20M", "CCK", "1T", "02", "36", - "MKK", "2.4G", "20M", "CCK", "1T", "02", "36", - "FCC", "2.4G", "20M", "CCK", "1T", "03", "30", - "ETSI", "2.4G", "20M", "CCK", "1T", "03", "36", - "MKK", "2.4G", "20M", "CCK", "1T", "03", "36", - "FCC", "2.4G", "20M", "CCK", "1T", "04", "30", - "ETSI", "2.4G", "20M", "CCK", "1T", "04", "36", - "MKK", "2.4G", "20M", "CCK", "1T", "04", "36", - "FCC", "2.4G", "20M", "CCK", "1T", "05", "30", - "ETSI", "2.4G", "20M", "CCK", "1T", "05", "36", - "MKK", "2.4G", "20M", "CCK", "1T", "05", "36", - "FCC", "2.4G", "20M", "CCK", "1T", "06", "30", - "ETSI", "2.4G", "20M", "CCK", "1T", "06", "36", - "MKK", "2.4G", "20M", "CCK", "1T", "06", "36", - "FCC", "2.4G", "20M", "CCK", "1T", "07", "30", - "ETSI", "2.4G", "20M", "CCK", "1T", "07", "36", - "MKK", "2.4G", "20M", "CCK", "1T", "07", "36", - "FCC", "2.4G", "20M", "CCK", "1T", "08", "30", - "ETSI", "2.4G", "20M", "CCK", "1T", "08", "36", - "MKK", "2.4G", "20M", "CCK", "1T", "08", "36", - "FCC", "2.4G", "20M", "CCK", "1T", "09", "30", - "ETSI", "2.4G", "20M", "CCK", "1T", "09", "36", - "MKK", "2.4G", "20M", "CCK", "1T", "09", "36", - "FCC", "2.4G", "20M", "CCK", "1T", "10", "30", - "ETSI", "2.4G", "20M", "CCK", "1T", "10", "36", - "MKK", "2.4G", "20M", "CCK", "1T", "10", "36", - "FCC", "2.4G", "20M", "CCK", "1T", "11", "30", - "ETSI", "2.4G", "20M", "CCK", "1T", "11", "36", - "MKK", "2.4G", "20M", "CCK", "1T", "11", "36", - "FCC", "2.4G", "20M", "CCK", "1T", "12", "30", - "ETSI", "2.4G", "20M", "CCK", "1T", "12", "36", - "MKK", "2.4G", "20M", "CCK", "1T", "12", "36", - "FCC", "2.4G", "20M", "CCK", "1T", "13", "30", - "ETSI", "2.4G", "20M", "CCK", "1T", "13", "36", - "MKK", "2.4G", "20M", "CCK", "1T", "13", "36", + "FCC", "2.4G", "20M", "CCK", "1T", "01", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "01", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "01", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "02", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "02", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "02", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "03", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "03", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "03", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "04", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "04", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "04", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "05", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "05", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "05", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "06", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "06", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "06", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "07", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "07", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "07", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "08", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "08", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "08", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "09", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "09", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "09", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "10", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "10", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "10", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "11", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "11", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "11", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "12", "63", + "ETSI", "2.4G", "20M", "CCK", "1T", "12", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "12", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "13", "63", + "ETSI", "2.4G", "20M", "CCK", "1T", "13", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "13", "32", "FCC", "2.4G", "20M", "CCK", "1T", "14", "63", "ETSI", "2.4G", "20M", "CCK", "1T", "14", "63", - "MKK", "2.4G", "20M", "CCK", "1T", "14", "63", - "FCC", "2.4G", "20M", "OFDM", "1T", "01", "30", - "ETSI", "2.4G", "20M", "OFDM", "1T", "01", "36", - "MKK", "2.4G", "20M", "OFDM", "1T", "01", "34", - "FCC", "2.4G", "20M", "OFDM", "1T", "02", "30", - "ETSI", "2.4G", "20M", "OFDM", "1T", "02", "36", - "MKK", "2.4G", "20M", "OFDM", "1T", "02", "42", - "FCC", "2.4G", "20M", "OFDM", "1T", "03", "30", - "ETSI", "2.4G", "20M", "OFDM", "1T", "03", "36", - "MKK", "2.4G", "20M", "OFDM", "1T", "03", "42", - "FCC", "2.4G", "20M", "OFDM", "1T", "04", "30", - "ETSI", "2.4G", "20M", "OFDM", "1T", "04", "36", - "MKK", "2.4G", "20M", "OFDM", "1T", "04", "42", - "FCC", "2.4G", "20M", "OFDM", "1T", "05", "30", - "ETSI", "2.4G", "20M", "OFDM", "1T", "05", "36", - "MKK", "2.4G", "20M", "OFDM", "1T", "05", "42", - "FCC", "2.4G", "20M", "OFDM", "1T", "06", "30", - "ETSI", "2.4G", "20M", "OFDM", "1T", "06", "36", - "MKK", "2.4G", "20M", "OFDM", "1T", "06", "42", - "FCC", "2.4G", "20M", "OFDM", "1T", "07", "30", - "ETSI", "2.4G", "20M", "OFDM", "1T", "07", "36", - "MKK", "2.4G", "20M", "OFDM", "1T", "07", "42", - "FCC", "2.4G", "20M", "OFDM", "1T", "08", "30", - "ETSI", "2.4G", "20M", "OFDM", "1T", "08", "36", - "MKK", "2.4G", "20M", "OFDM", "1T", "08", "42", - "FCC", "2.4G", "20M", "OFDM", "1T", "09", "30", - "ETSI", "2.4G", "20M", "OFDM", "1T", "09", "36", - "MKK", "2.4G", "20M", "OFDM", "1T", "09", "42", - "FCC", "2.4G", "20M", "OFDM", "1T", "10", "30", - "ETSI", "2.4G", "20M", "OFDM", "1T", "10", "36", - "MKK", "2.4G", "20M", "OFDM", "1T", "10", "42", - "FCC", "2.4G", "20M", "OFDM", "1T", "11", "30", - "ETSI", "2.4G", "20M", "OFDM", "1T", "11", "36", - "MKK", "2.4G", "20M", "OFDM", "1T", "11", "42", - "FCC", "2.4G", "20M", "OFDM", "1T", "12", "30", - "ETSI", "2.4G", "20M", "OFDM", "1T", "12", "36", - "MKK", "2.4G", "20M", "OFDM", "1T", "12", "42", - "FCC", "2.4G", "20M", "OFDM", "1T", "13", "30", - "ETSI", "2.4G", "20M", "OFDM", "1T", "13", "36", - "MKK", "2.4G", "20M", "OFDM", "1T", "13", "34", + "MKK", "2.4G", "20M", "CCK", "1T", "14", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "01", "34", + "ETSI", "2.4G", "20M", "OFDM", "1T", "01", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "01", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "02", "36", + "ETSI", "2.4G", "20M", "OFDM", "1T", "02", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "02", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "03", "36", + "ETSI", "2.4G", "20M", "OFDM", "1T", "03", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "03", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "04", "36", + "ETSI", "2.4G", "20M", "OFDM", "1T", "04", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "04", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "05", "36", + "ETSI", "2.4G", "20M", "OFDM", "1T", "05", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "05", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "06", "36", + "ETSI", "2.4G", "20M", "OFDM", "1T", "06", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "06", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "07", "36", + "ETSI", "2.4G", "20M", "OFDM", "1T", "07", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "07", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "08", "36", + "ETSI", "2.4G", "20M", "OFDM", "1T", "08", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "08", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "09", "36", + "ETSI", "2.4G", "20M", "OFDM", "1T", "09", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "09", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "10", "36", + "ETSI", "2.4G", "20M", "OFDM", "1T", "10", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "10", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "11", "32", + "ETSI", "2.4G", "20M", "OFDM", "1T", "11", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "11", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "12", "63", + "ETSI", "2.4G", "20M", "OFDM", "1T", "12", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "12", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "13", "63", + "ETSI", "2.4G", "20M", "OFDM", "1T", "13", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "13", "32", "FCC", "2.4G", "20M", "OFDM", "1T", "14", "63", "ETSI", "2.4G", "20M", "OFDM", "1T", "14", "63", "MKK", "2.4G", "20M", "OFDM", "1T", "14", "63", - "FCC", "2.4G", "20M", "HT", "1T", "01", "28", - "ETSI", "2.4G", "20M", "HT", "1T", "01", "30", - "MKK", "2.4G", "20M", "HT", "1T", "01", "31", - "FCC", "2.4G", "20M", "HT", "1T", "02", "28", - "ETSI", "2.4G", "20M", "HT", "1T", "02", "30", - "MKK", "2.4G", "20M", "HT", "1T", "02", "35", - "FCC", "2.4G", "20M", "HT", "1T", "03", "28", - "ETSI", "2.4G", "20M", "HT", "1T", "03", "30", - "MKK", "2.4G", "20M", "HT", "1T", "03", "35", - "FCC", "2.4G", "20M", "HT", "1T", "04", "28", - "ETSI", "2.4G", "20M", "HT", "1T", "04", "30", - "MKK", "2.4G", "20M", "HT", "1T", "04", "35", - "FCC", "2.4G", "20M", "HT", "1T", "05", "28", - "ETSI", "2.4G", "20M", "HT", "1T", "05", "30", - "MKK", "2.4G", "20M", "HT", "1T", "05", "35", - "FCC", "2.4G", "20M", "HT", "1T", "06", "28", - "ETSI", "2.4G", "20M", "HT", "1T", "06", "30", - "MKK", "2.4G", "20M", "HT", "1T", "06", "35", - "FCC", "2.4G", "20M", "HT", "1T", "07", "28", - "ETSI", "2.4G", "20M", "HT", "1T", "07", "30", - "MKK", "2.4G", "20M", "HT", "1T", "07", "35", - "FCC", "2.4G", "20M", "HT", "1T", "08", "28", - "ETSI", "2.4G", "20M", "HT", "1T", "08", "30", - "MKK", "2.4G", "20M", "HT", "1T", "08", "35", - "FCC", "2.4G", "20M", "HT", "1T", "09", "28", - "ETSI", "2.4G", "20M", "HT", "1T", "09", "30", - "MKK", "2.4G", "20M", "HT", "1T", "09", "35", - "FCC", "2.4G", "20M", "HT", "1T", "10", "28", - "ETSI", "2.4G", "20M", "HT", "1T", "10", "30", - "MKK", "2.4G", "20M", "HT", "1T", "10", "35", - "FCC", "2.4G", "20M", "HT", "1T", "11", "28", - "ETSI", "2.4G", "20M", "HT", "1T", "11", "30", - "MKK", "2.4G", "20M", "HT", "1T", "11", "35", - "FCC", "2.4G", "20M", "HT", "1T", "12", "28", - "ETSI", "2.4G", "20M", "HT", "1T", "12", "30", - "MKK", "2.4G", "20M", "HT", "1T", "12", "35", - "FCC", "2.4G", "20M", "HT", "1T", "13", "28", - "ETSI", "2.4G", "20M", "HT", "1T", "13", "30", - "MKK", "2.4G", "20M", "HT", "1T", "13", "29", + "FCC", "2.4G", "20M", "HT", "1T", "01", "34", + "ETSI", "2.4G", "20M", "HT", "1T", "01", "32", + "MKK", "2.4G", "20M", "HT", "1T", "01", "32", + "FCC", "2.4G", "20M", "HT", "1T", "02", "36", + "ETSI", "2.4G", "20M", "HT", "1T", "02", "32", + "MKK", "2.4G", "20M", "HT", "1T", "02", "32", + "FCC", "2.4G", "20M", "HT", "1T", "03", "36", + "ETSI", "2.4G", "20M", "HT", "1T", "03", "32", + "MKK", "2.4G", "20M", "HT", "1T", "03", "32", + "FCC", "2.4G", "20M", "HT", "1T", "04", "36", + "ETSI", "2.4G", "20M", "HT", "1T", "04", "32", + "MKK", "2.4G", "20M", "HT", "1T", "04", "32", + "FCC", "2.4G", "20M", "HT", "1T", "05", "36", + "ETSI", "2.4G", "20M", "HT", "1T", "05", "32", + "MKK", "2.4G", "20M", "HT", "1T", "05", "32", + "FCC", "2.4G", "20M", "HT", "1T", "06", "36", + "ETSI", "2.4G", "20M", "HT", "1T", "06", "32", + "MKK", "2.4G", "20M", "HT", "1T", "06", "32", + "FCC", "2.4G", "20M", "HT", "1T", "07", "36", + "ETSI", "2.4G", "20M", "HT", "1T", "07", "32", + "MKK", "2.4G", "20M", "HT", "1T", "07", "32", + "FCC", "2.4G", "20M", "HT", "1T", "08", "36", + "ETSI", "2.4G", "20M", "HT", "1T", "08", "32", + "MKK", "2.4G", "20M", "HT", "1T", "08", "32", + "FCC", "2.4G", "20M", "HT", "1T", "09", "36", + "ETSI", "2.4G", "20M", "HT", "1T", "09", "32", + "MKK", "2.4G", "20M", "HT", "1T", "09", "32", + "FCC", "2.4G", "20M", "HT", "1T", "10", "36", + "ETSI", "2.4G", "20M", "HT", "1T", "10", "32", + "MKK", "2.4G", "20M", "HT", "1T", "10", "32", + "FCC", "2.4G", "20M", "HT", "1T", "11", "32", + "ETSI", "2.4G", "20M", "HT", "1T", "11", "32", + "MKK", "2.4G", "20M", "HT", "1T", "11", "32", + "FCC", "2.4G", "20M", "HT", "1T", "12", "63", + "ETSI", "2.4G", "20M", "HT", "1T", "12", "32", + "MKK", "2.4G", "20M", "HT", "1T", "12", "32", + "FCC", "2.4G", "20M", "HT", "1T", "13", "63", + "ETSI", "2.4G", "20M", "HT", "1T", "13", "32", + "MKK", "2.4G", "20M", "HT", "1T", "13", "32", "FCC", "2.4G", "20M", "HT", "1T", "14", "63", "ETSI", "2.4G", "20M", "HT", "1T", "14", "63", "MKK", "2.4G", "20M", "HT", "1T", "14", "63", - "FCC", "2.4G", "20M", "HT", "2T", "01", "28", - "ETSI", "2.4G", "20M", "HT", "2T", "01", "30", - "MKK", "2.4G", "20M", "HT", "2T", "01", "31", - "FCC", "2.4G", "20M", "HT", "2T", "02", "28", - "ETSI", "2.4G", "20M", "HT", "2T", "02", "30", - "MKK", "2.4G", "20M", "HT", "2T", "02", "35", - "FCC", "2.4G", "20M", "HT", "2T", "03", "28", - "ETSI", "2.4G", "20M", "HT", "2T", "03", "30", - "MKK", "2.4G", "20M", "HT", "2T", "03", "35", - "FCC", "2.4G", "20M", "HT", "2T", "04", "28", - "ETSI", "2.4G", "20M", "HT", "2T", "04", "30", - "MKK", "2.4G", "20M", "HT", "2T", "04", "35", - "FCC", "2.4G", "20M", "HT", "2T", "05", "28", - "ETSI", "2.4G", "20M", "HT", "2T", "05", "30", - "MKK", "2.4G", "20M", "HT", "2T", "05", "35", - "FCC", "2.4G", "20M", "HT", "2T", "06", "28", - "ETSI", "2.4G", "20M", "HT", "2T", "06", "30", - "MKK", "2.4G", "20M", "HT", "2T", "06", "35", - "FCC", "2.4G", "20M", "HT", "2T", "07", "28", - "ETSI", "2.4G", "20M", "HT", "2T", "07", "30", - "MKK", "2.4G", "20M", "HT", "2T", "07", "35", - "FCC", "2.4G", "20M", "HT", "2T", "08", "28", - "ETSI", "2.4G", "20M", "HT", "2T", "08", "30", - "MKK", "2.4G", "20M", "HT", "2T", "08", "35", - "FCC", "2.4G", "20M", "HT", "2T", "09", "28", - "ETSI", "2.4G", "20M", "HT", "2T", "09", "30", - "MKK", "2.4G", "20M", "HT", "2T", "09", "35", - "FCC", "2.4G", "20M", "HT", "2T", "10", "28", - "ETSI", "2.4G", "20M", "HT", "2T", "10", "30", - "MKK", "2.4G", "20M", "HT", "2T", "10", "35", - "FCC", "2.4G", "20M", "HT", "2T", "11", "28", - "ETSI", "2.4G", "20M", "HT", "2T", "11", "30", - "MKK", "2.4G", "20M", "HT", "2T", "11", "35", - "FCC", "2.4G", "20M", "HT", "2T", "12", "28", - "ETSI", "2.4G", "20M", "HT", "2T", "12", "30", - "MKK", "2.4G", "20M", "HT", "2T", "12", "35", - "FCC", "2.4G", "20M", "HT", "2T", "13", "28", - "ETSI", "2.4G", "20M", "HT", "2T", "13", "30", - "MKK", "2.4G", "20M", "HT", "2T", "13", "29", + "FCC", "2.4G", "20M", "HT", "2T", "01", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "01", "32", + "MKK", "2.4G", "20M", "HT", "2T", "01", "32", + "FCC", "2.4G", "20M", "HT", "2T", "02", "34", + "ETSI", "2.4G", "20M", "HT", "2T", "02", "32", + "MKK", "2.4G", "20M", "HT", "2T", "02", "32", + "FCC", "2.4G", "20M", "HT", "2T", "03", "34", + "ETSI", "2.4G", "20M", "HT", "2T", "03", "32", + "MKK", "2.4G", "20M", "HT", "2T", "03", "32", + "FCC", "2.4G", "20M", "HT", "2T", "04", "34", + "ETSI", "2.4G", "20M", "HT", "2T", "04", "32", + "MKK", "2.4G", "20M", "HT", "2T", "04", "32", + "FCC", "2.4G", "20M", "HT", "2T", "05", "34", + "ETSI", "2.4G", "20M", "HT", "2T", "05", "32", + "MKK", "2.4G", "20M", "HT", "2T", "05", "32", + "FCC", "2.4G", "20M", "HT", "2T", "06", "34", + "ETSI", "2.4G", "20M", "HT", "2T", "06", "32", + "MKK", "2.4G", "20M", "HT", "2T", "06", "32", + "FCC", "2.4G", "20M", "HT", "2T", "07", "34", + "ETSI", "2.4G", "20M", "HT", "2T", "07", "32", + "MKK", "2.4G", "20M", "HT", "2T", "07", "32", + "FCC", "2.4G", "20M", "HT", "2T", "08", "34", + "ETSI", "2.4G", "20M", "HT", "2T", "08", "32", + "MKK", "2.4G", "20M", "HT", "2T", "08", "32", + "FCC", "2.4G", "20M", "HT", "2T", "09", "34", + "ETSI", "2.4G", "20M", "HT", "2T", "09", "32", + "MKK", "2.4G", "20M", "HT", "2T", "09", "32", + "FCC", "2.4G", "20M", "HT", "2T", "10", "34", + "ETSI", "2.4G", "20M", "HT", "2T", "10", "32", + "MKK", "2.4G", "20M", "HT", "2T", "10", "32", + "FCC", "2.4G", "20M", "HT", "2T", "11", "30", + "ETSI", "2.4G", "20M", "HT", "2T", "11", "32", + "MKK", "2.4G", "20M", "HT", "2T", "11", "32", + "FCC", "2.4G", "20M", "HT", "2T", "12", "63", + "ETSI", "2.4G", "20M", "HT", "2T", "12", "32", + "MKK", "2.4G", "20M", "HT", "2T", "12", "32", + "FCC", "2.4G", "20M", "HT", "2T", "13", "63", + "ETSI", "2.4G", "20M", "HT", "2T", "13", "32", + "MKK", "2.4G", "20M", "HT", "2T", "13", "32", "FCC", "2.4G", "20M", "HT", "2T", "14", "63", "ETSI", "2.4G", "20M", "HT", "2T", "14", "63", "MKK", "2.4G", "20M", "HT", "2T", "14", "63", @@ -1543,39 +1566,39 @@ pu1Byte Array_MP_8812A_TXPWR_LMT[] = { "FCC", "2.4G", "40M", "HT", "1T", "02", "63", "ETSI", "2.4G", "40M", "HT", "1T", "02", "63", "MKK", "2.4G", "40M", "HT", "1T", "02", "63", - "FCC", "2.4G", "40M", "HT", "1T", "03", "28", - "ETSI", "2.4G", "40M", "HT", "1T", "03", "34", - "MKK", "2.4G", "40M", "HT", "1T", "03", "28", - "FCC", "2.4G", "40M", "HT", "1T", "04", "28", - "ETSI", "2.4G", "40M", "HT", "1T", "04", "34", - "MKK", "2.4G", "40M", "HT", "1T", "04", "36", - "FCC", "2.4G", "40M", "HT", "1T", "05", "28", - "ETSI", "2.4G", "40M", "HT", "1T", "05", "34", - "MKK", "2.4G", "40M", "HT", "1T", "05", "36", - "FCC", "2.4G", "40M", "HT", "1T", "06", "28", - "ETSI", "2.4G", "40M", "HT", "1T", "06", "34", - "MKK", "2.4G", "40M", "HT", "1T", "06", "36", - "FCC", "2.4G", "40M", "HT", "1T", "07", "28", - "ETSI", "2.4G", "40M", "HT", "1T", "07", "34", - "MKK", "2.4G", "40M", "HT", "1T", "07", "36", - "FCC", "2.4G", "40M", "HT", "1T", "08", "28", - "ETSI", "2.4G", "40M", "HT", "1T", "08", "34", - "MKK", "2.4G", "40M", "HT", "1T", "08", "36", - "FCC", "2.4G", "40M", "HT", "1T", "09", "28", - "ETSI", "2.4G", "40M", "HT", "1T", "09", "34", - "MKK", "2.4G", "40M", "HT", "1T", "09", "36", - "FCC", "2.4G", "40M", "HT", "1T", "10", "28", - "ETSI", "2.4G", "40M", "HT", "1T", "10", "34", - "MKK", "2.4G", "40M", "HT", "1T", "10", "36", - "FCC", "2.4G", "40M", "HT", "1T", "11", "28", - "ETSI", "2.4G", "40M", "HT", "1T", "11", "34", - "MKK", "2.4G", "40M", "HT", "1T", "11", "27", - "FCC", "2.4G", "40M", "HT", "1T", "12", "28", - "ETSI", "2.4G", "40M", "HT", "1T", "12", "34", - "MKK", "2.4G", "40M", "HT", "1T", "12", "27", - "FCC", "2.4G", "40M", "HT", "1T", "13", "28", - "ETSI", "2.4G", "40M", "HT", "1T", "13", "34", - "MKK", "2.4G", "40M", "HT", "1T", "13", "27", + "FCC", "2.4G", "40M", "HT", "1T", "03", "32", + "ETSI", "2.4G", "40M", "HT", "1T", "03", "32", + "MKK", "2.4G", "40M", "HT", "1T", "03", "32", + "FCC", "2.4G", "40M", "HT", "1T", "04", "36", + "ETSI", "2.4G", "40M", "HT", "1T", "04", "32", + "MKK", "2.4G", "40M", "HT", "1T", "04", "32", + "FCC", "2.4G", "40M", "HT", "1T", "05", "36", + "ETSI", "2.4G", "40M", "HT", "1T", "05", "32", + "MKK", "2.4G", "40M", "HT", "1T", "05", "32", + "FCC", "2.4G", "40M", "HT", "1T", "06", "36", + "ETSI", "2.4G", "40M", "HT", "1T", "06", "32", + "MKK", "2.4G", "40M", "HT", "1T", "06", "32", + "FCC", "2.4G", "40M", "HT", "1T", "07", "36", + "ETSI", "2.4G", "40M", "HT", "1T", "07", "32", + "MKK", "2.4G", "40M", "HT", "1T", "07", "32", + "FCC", "2.4G", "40M", "HT", "1T", "08", "36", + "ETSI", "2.4G", "40M", "HT", "1T", "08", "32", + "MKK", "2.4G", "40M", "HT", "1T", "08", "32", + "FCC", "2.4G", "40M", "HT", "1T", "09", "36", + "ETSI", "2.4G", "40M", "HT", "1T", "09", "32", + "MKK", "2.4G", "40M", "HT", "1T", "09", "32", + "FCC", "2.4G", "40M", "HT", "1T", "10", "36", + "ETSI", "2.4G", "40M", "HT", "1T", "10", "32", + "MKK", "2.4G", "40M", "HT", "1T", "10", "32", + "FCC", "2.4G", "40M", "HT", "1T", "11", "32", + "ETSI", "2.4G", "40M", "HT", "1T", "11", "32", + "MKK", "2.4G", "40M", "HT", "1T", "11", "32", + "FCC", "2.4G", "40M", "HT", "1T", "12", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "12", "32", + "MKK", "2.4G", "40M", "HT", "1T", "12", "32", + "FCC", "2.4G", "40M", "HT", "1T", "13", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "13", "32", + "MKK", "2.4G", "40M", "HT", "1T", "13", "32", "FCC", "2.4G", "40M", "HT", "1T", "14", "63", "ETSI", "2.4G", "40M", "HT", "1T", "14", "63", "MKK", "2.4G", "40M", "HT", "1T", "14", "63", @@ -1585,352 +1608,352 @@ pu1Byte Array_MP_8812A_TXPWR_LMT[] = { "FCC", "2.4G", "40M", "HT", "2T", "02", "63", "ETSI", "2.4G", "40M", "HT", "2T", "02", "63", "MKK", "2.4G", "40M", "HT", "2T", "02", "63", - "FCC", "2.4G", "40M", "HT", "2T", "03", "28", + "FCC", "2.4G", "40M", "HT", "2T", "03", "30", "ETSI", "2.4G", "40M", "HT", "2T", "03", "30", - "MKK", "2.4G", "40M", "HT", "2T", "03", "27", - "FCC", "2.4G", "40M", "HT", "2T", "04", "28", + "MKK", "2.4G", "40M", "HT", "2T", "03", "30", + "FCC", "2.4G", "40M", "HT", "2T", "04", "34", "ETSI", "2.4G", "40M", "HT", "2T", "04", "30", - "MKK", "2.4G", "40M", "HT", "2T", "04", "36", - "FCC", "2.4G", "40M", "HT", "2T", "05", "28", + "MKK", "2.4G", "40M", "HT", "2T", "04", "30", + "FCC", "2.4G", "40M", "HT", "2T", "05", "34", "ETSI", "2.4G", "40M", "HT", "2T", "05", "30", - "MKK", "2.4G", "40M", "HT", "2T", "05", "36", - "FCC", "2.4G", "40M", "HT", "2T", "06", "28", + "MKK", "2.4G", "40M", "HT", "2T", "05", "30", + "FCC", "2.4G", "40M", "HT", "2T", "06", "34", "ETSI", "2.4G", "40M", "HT", "2T", "06", "30", - "MKK", "2.4G", "40M", "HT", "2T", "06", "36", - "FCC", "2.4G", "40M", "HT", "2T", "07", "28", + "MKK", "2.4G", "40M", "HT", "2T", "06", "30", + "FCC", "2.4G", "40M", "HT", "2T", "07", "34", "ETSI", "2.4G", "40M", "HT", "2T", "07", "30", - "MKK", "2.4G", "40M", "HT", "2T", "07", "36", - "FCC", "2.4G", "40M", "HT", "2T", "08", "28", + "MKK", "2.4G", "40M", "HT", "2T", "07", "30", + "FCC", "2.4G", "40M", "HT", "2T", "08", "34", "ETSI", "2.4G", "40M", "HT", "2T", "08", "30", - "MKK", "2.4G", "40M", "HT", "2T", "08", "36", - "FCC", "2.4G", "40M", "HT", "2T", "09", "28", + "MKK", "2.4G", "40M", "HT", "2T", "08", "30", + "FCC", "2.4G", "40M", "HT", "2T", "09", "34", "ETSI", "2.4G", "40M", "HT", "2T", "09", "30", - "MKK", "2.4G", "40M", "HT", "2T", "09", "36", - "FCC", "2.4G", "40M", "HT", "2T", "10", "28", + "MKK", "2.4G", "40M", "HT", "2T", "09", "30", + "FCC", "2.4G", "40M", "HT", "2T", "10", "34", "ETSI", "2.4G", "40M", "HT", "2T", "10", "30", - "MKK", "2.4G", "40M", "HT", "2T", "10", "36", - "FCC", "2.4G", "40M", "HT", "2T", "11", "28", + "MKK", "2.4G", "40M", "HT", "2T", "10", "30", + "FCC", "2.4G", "40M", "HT", "2T", "11", "30", "ETSI", "2.4G", "40M", "HT", "2T", "11", "30", - "MKK", "2.4G", "40M", "HT", "2T", "11", "27", - "FCC", "2.4G", "40M", "HT", "2T", "12", "28", - "ETSI", "2.4G", "40M", "HT", "2T", "12", "30", - "MKK", "2.4G", "40M", "HT", "2T", "12", "27", - "FCC", "2.4G", "40M", "HT", "2T", "13", "28", - "ETSI", "2.4G", "40M", "HT", "2T", "13", "30", - "MKK", "2.4G", "40M", "HT", "2T", "13", "27", + "MKK", "2.4G", "40M", "HT", "2T", "11", "30", + "FCC", "2.4G", "40M", "HT", "2T", "12", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "12", "32", + "MKK", "2.4G", "40M", "HT", "2T", "12", "32", + "FCC", "2.4G", "40M", "HT", "2T", "13", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "13", "32", + "MKK", "2.4G", "40M", "HT", "2T", "13", "32", "FCC", "2.4G", "40M", "HT", "2T", "14", "63", "ETSI", "2.4G", "40M", "HT", "2T", "14", "63", "MKK", "2.4G", "40M", "HT", "2T", "14", "63", - "FCC", "5G", "20M", "OFDM", "1T", "36", "28", - "ETSI", "5G", "20M", "OFDM", "1T", "36", "36", - "MKK", "5G", "20M", "OFDM", "1T", "36", "38", - "FCC", "5G", "20M", "OFDM", "1T", "40", "28", - "ETSI", "5G", "20M", "OFDM", "1T", "40", "36", - "MKK", "5G", "20M", "OFDM", "1T", "40", "38", - "FCC", "5G", "20M", "OFDM", "1T", "44", "28", - "ETSI", "5G", "20M", "OFDM", "1T", "44", "36", - "MKK", "5G", "20M", "OFDM", "1T", "44", "38", - "FCC", "5G", "20M", "OFDM", "1T", "48", "28", - "ETSI", "5G", "20M", "OFDM", "1T", "48", "36", - "MKK", "5G", "20M", "OFDM", "1T", "48", "33", - "FCC", "5G", "20M", "OFDM", "1T", "52", "32", - "ETSI", "5G", "20M", "OFDM", "1T", "52", "36", - "MKK", "5G", "20M", "OFDM", "1T", "52", "36", - "FCC", "5G", "20M", "OFDM", "1T", "56", "32", - "ETSI", "5G", "20M", "OFDM", "1T", "56", "36", - "MKK", "5G", "20M", "OFDM", "1T", "56", "36", + "FCC", "5G", "20M", "OFDM", "1T", "36", "30", + "ETSI", "5G", "20M", "OFDM", "1T", "36", "32", + "MKK", "5G", "20M", "OFDM", "1T", "36", "32", + "FCC", "5G", "20M", "OFDM", "1T", "40", "30", + "ETSI", "5G", "20M", "OFDM", "1T", "40", "32", + "MKK", "5G", "20M", "OFDM", "1T", "40", "32", + "FCC", "5G", "20M", "OFDM", "1T", "44", "30", + "ETSI", "5G", "20M", "OFDM", "1T", "44", "32", + "MKK", "5G", "20M", "OFDM", "1T", "44", "32", + "FCC", "5G", "20M", "OFDM", "1T", "48", "30", + "ETSI", "5G", "20M", "OFDM", "1T", "48", "32", + "MKK", "5G", "20M", "OFDM", "1T", "48", "32", + "FCC", "5G", "20M", "OFDM", "1T", "52", "36", + "ETSI", "5G", "20M", "OFDM", "1T", "52", "32", + "MKK", "5G", "20M", "OFDM", "1T", "52", "32", + "FCC", "5G", "20M", "OFDM", "1T", "56", "34", + "ETSI", "5G", "20M", "OFDM", "1T", "56", "32", + "MKK", "5G", "20M", "OFDM", "1T", "56", "32", "FCC", "5G", "20M", "OFDM", "1T", "60", "32", - "ETSI", "5G", "20M", "OFDM", "1T", "60", "36", - "MKK", "5G", "20M", "OFDM", "1T", "60", "36", - "FCC", "5G", "20M", "OFDM", "1T", "64", "32", - "ETSI", "5G", "20M", "OFDM", "1T", "64", "36", - "MKK", "5G", "20M", "OFDM", "1T", "64", "36", + "ETSI", "5G", "20M", "OFDM", "1T", "60", "32", + "MKK", "5G", "20M", "OFDM", "1T", "60", "32", + "FCC", "5G", "20M", "OFDM", "1T", "64", "28", + "ETSI", "5G", "20M", "OFDM", "1T", "64", "32", + "MKK", "5G", "20M", "OFDM", "1T", "64", "32", "FCC", "5G", "20M", "OFDM", "1T", "100", "30", - "ETSI", "5G", "20M", "OFDM", "1T", "100", "36", - "MKK", "5G", "20M", "OFDM", "1T", "100", "36", - "FCC", "5G", "20M", "OFDM", "1T", "114", "30", - "ETSI", "5G", "20M", "OFDM", "1T", "114", "36", - "MKK", "5G", "20M", "OFDM", "1T", "114", "36", - "FCC", "5G", "20M", "OFDM", "1T", "108", "30", - "ETSI", "5G", "20M", "OFDM", "1T", "108", "36", - "MKK", "5G", "20M", "OFDM", "1T", "108", "36", - "FCC", "5G", "20M", "OFDM", "1T", "112", "30", - "ETSI", "5G", "20M", "OFDM", "1T", "112", "36", - "MKK", "5G", "20M", "OFDM", "1T", "112", "36", - "FCC", "5G", "20M", "OFDM", "1T", "116", "30", - "ETSI", "5G", "20M", "OFDM", "1T", "116", "36", - "MKK", "5G", "20M", "OFDM", "1T", "116", "36", - "FCC", "5G", "20M", "OFDM", "1T", "120", "30", - "ETSI", "5G", "20M", "OFDM", "1T", "120", "36", - "MKK", "5G", "20M", "OFDM", "1T", "120", "36", - "FCC", "5G", "20M", "OFDM", "1T", "124", "30", - "ETSI", "5G", "20M", "OFDM", "1T", "124", "36", - "MKK", "5G", "20M", "OFDM", "1T", "124", "36", - "FCC", "5G", "20M", "OFDM", "1T", "128", "30", - "ETSI", "5G", "20M", "OFDM", "1T", "128", "36", - "MKK", "5G", "20M", "OFDM", "1T", "128", "36", + "ETSI", "5G", "20M", "OFDM", "1T", "100", "32", + "MKK", "5G", "20M", "OFDM", "1T", "100", "32", + "FCC", "5G", "20M", "OFDM", "1T", "104", "30", + "ETSI", "5G", "20M", "OFDM", "1T", "104", "32", + "MKK", "5G", "20M", "OFDM", "1T", "104", "32", + "FCC", "5G", "20M", "OFDM", "1T", "108", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "108", "32", + "MKK", "5G", "20M", "OFDM", "1T", "108", "32", + "FCC", "5G", "20M", "OFDM", "1T", "112", "34", + "ETSI", "5G", "20M", "OFDM", "1T", "112", "32", + "MKK", "5G", "20M", "OFDM", "1T", "112", "32", + "FCC", "5G", "20M", "OFDM", "1T", "116", "34", + "ETSI", "5G", "20M", "OFDM", "1T", "116", "32", + "MKK", "5G", "20M", "OFDM", "1T", "116", "32", + "FCC", "5G", "20M", "OFDM", "1T", "120", "36", + "ETSI", "5G", "20M", "OFDM", "1T", "120", "32", + "MKK", "5G", "20M", "OFDM", "1T", "120", "32", + "FCC", "5G", "20M", "OFDM", "1T", "124", "34", + "ETSI", "5G", "20M", "OFDM", "1T", "124", "32", + "MKK", "5G", "20M", "OFDM", "1T", "124", "32", + "FCC", "5G", "20M", "OFDM", "1T", "128", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "128", "32", + "MKK", "5G", "20M", "OFDM", "1T", "128", "32", "FCC", "5G", "20M", "OFDM", "1T", "132", "30", - "ETSI", "5G", "20M", "OFDM", "1T", "132", "36", - "MKK", "5G", "20M", "OFDM", "1T", "132", "36", + "ETSI", "5G", "20M", "OFDM", "1T", "132", "32", + "MKK", "5G", "20M", "OFDM", "1T", "132", "32", "FCC", "5G", "20M", "OFDM", "1T", "136", "30", - "ETSI", "5G", "20M", "OFDM", "1T", "136", "36", - "MKK", "5G", "20M", "OFDM", "1T", "136", "36", - "FCC", "5G", "20M", "OFDM", "1T", "140", "30", - "ETSI", "5G", "20M", "OFDM", "1T", "140", "36", - "MKK", "5G", "20M", "OFDM", "1T", "140", "36", - "FCC", "5G", "20M", "OFDM", "1T", "149", "30", - "ETSI", "5G", "20M", "OFDM", "1T", "149", "36", + "ETSI", "5G", "20M", "OFDM", "1T", "136", "32", + "MKK", "5G", "20M", "OFDM", "1T", "136", "32", + "FCC", "5G", "20M", "OFDM", "1T", "140", "28", + "ETSI", "5G", "20M", "OFDM", "1T", "140", "32", + "MKK", "5G", "20M", "OFDM", "1T", "140", "32", + "FCC", "5G", "20M", "OFDM", "1T", "149", "36", + "ETSI", "5G", "20M", "OFDM", "1T", "149", "32", "MKK", "5G", "20M", "OFDM", "1T", "149", "63", - "FCC", "5G", "20M", "OFDM", "1T", "153", "30", - "ETSI", "5G", "20M", "OFDM", "1T", "153", "36", + "FCC", "5G", "20M", "OFDM", "1T", "153", "36", + "ETSI", "5G", "20M", "OFDM", "1T", "153", "32", "MKK", "5G", "20M", "OFDM", "1T", "153", "63", - "FCC", "5G", "20M", "OFDM", "1T", "157", "30", - "ETSI", "5G", "20M", "OFDM", "1T", "157", "36", + "FCC", "5G", "20M", "OFDM", "1T", "157", "36", + "ETSI", "5G", "20M", "OFDM", "1T", "157", "32", "MKK", "5G", "20M", "OFDM", "1T", "157", "63", - "FCC", "5G", "20M", "OFDM", "1T", "161", "30", - "ETSI", "5G", "20M", "OFDM", "1T", "161", "36", + "FCC", "5G", "20M", "OFDM", "1T", "161", "36", + "ETSI", "5G", "20M", "OFDM", "1T", "161", "32", "MKK", "5G", "20M", "OFDM", "1T", "161", "63", - "FCC", "5G", "20M", "OFDM", "1T", "165", "30", - "ETSI", "5G", "20M", "OFDM", "1T", "165", "36", + "FCC", "5G", "20M", "OFDM", "1T", "165", "36", + "ETSI", "5G", "20M", "OFDM", "1T", "165", "32", "MKK", "5G", "20M", "OFDM", "1T", "165", "63", - "FCC", "5G", "20M", "HT", "1T", "36", "28", - "ETSI", "5G", "20M", "HT", "1T", "36", "36", + "FCC", "5G", "20M", "HT", "1T", "36", "30", + "ETSI", "5G", "20M", "HT", "1T", "36", "32", "MKK", "5G", "20M", "HT", "1T", "36", "32", - "FCC", "5G", "20M", "HT", "1T", "40", "28", - "ETSI", "5G", "20M", "HT", "1T", "40", "36", + "FCC", "5G", "20M", "HT", "1T", "40", "30", + "ETSI", "5G", "20M", "HT", "1T", "40", "32", "MKK", "5G", "20M", "HT", "1T", "40", "32", - "FCC", "5G", "20M", "HT", "1T", "44", "28", - "ETSI", "5G", "20M", "HT", "1T", "44", "36", + "FCC", "5G", "20M", "HT", "1T", "44", "30", + "ETSI", "5G", "20M", "HT", "1T", "44", "32", "MKK", "5G", "20M", "HT", "1T", "44", "32", - "FCC", "5G", "20M", "HT", "1T", "48", "28", - "ETSI", "5G", "20M", "HT", "1T", "48", "36", - "MKK", "5G", "20M", "HT", "1T", "48", "25", - "FCC", "5G", "20M", "HT", "1T", "52", "28", - "ETSI", "5G", "20M", "HT", "1T", "52", "36", - "MKK", "5G", "20M", "HT", "1T", "52", "36", - "FCC", "5G", "20M", "HT", "1T", "56", "28", - "ETSI", "5G", "20M", "HT", "1T", "56", "36", - "MKK", "5G", "20M", "HT", "1T", "56", "36", - "FCC", "5G", "20M", "HT", "1T", "60", "28", - "ETSI", "5G", "20M", "HT", "1T", "60", "36", - "MKK", "5G", "20M", "HT", "1T", "60", "36", + "FCC", "5G", "20M", "HT", "1T", "48", "30", + "ETSI", "5G", "20M", "HT", "1T", "48", "32", + "MKK", "5G", "20M", "HT", "1T", "48", "32", + "FCC", "5G", "20M", "HT", "1T", "52", "36", + "ETSI", "5G", "20M", "HT", "1T", "52", "32", + "MKK", "5G", "20M", "HT", "1T", "52", "32", + "FCC", "5G", "20M", "HT", "1T", "56", "34", + "ETSI", "5G", "20M", "HT", "1T", "56", "32", + "MKK", "5G", "20M", "HT", "1T", "56", "32", + "FCC", "5G", "20M", "HT", "1T", "60", "32", + "ETSI", "5G", "20M", "HT", "1T", "60", "32", + "MKK", "5G", "20M", "HT", "1T", "60", "32", "FCC", "5G", "20M", "HT", "1T", "64", "28", - "ETSI", "5G", "20M", "HT", "1T", "64", "36", - "MKK", "5G", "20M", "HT", "1T", "64", "36", + "ETSI", "5G", "20M", "HT", "1T", "64", "32", + "MKK", "5G", "20M", "HT", "1T", "64", "32", "FCC", "5G", "20M", "HT", "1T", "100", "30", - "ETSI", "5G", "20M", "HT", "1T", "100", "36", - "MKK", "5G", "20M", "HT", "1T", "100", "36", - "FCC", "5G", "20M", "HT", "1T", "114", "30", - "ETSI", "5G", "20M", "HT", "1T", "114", "36", - "MKK", "5G", "20M", "HT", "1T", "114", "36", - "FCC", "5G", "20M", "HT", "1T", "108", "30", - "ETSI", "5G", "20M", "HT", "1T", "108", "36", - "MKK", "5G", "20M", "HT", "1T", "108", "36", - "FCC", "5G", "20M", "HT", "1T", "112", "30", - "ETSI", "5G", "20M", "HT", "1T", "112", "36", - "MKK", "5G", "20M", "HT", "1T", "112", "36", - "FCC", "5G", "20M", "HT", "1T", "116", "30", - "ETSI", "5G", "20M", "HT", "1T", "116", "36", - "MKK", "5G", "20M", "HT", "1T", "116", "36", - "FCC", "5G", "20M", "HT", "1T", "120", "30", - "ETSI", "5G", "20M", "HT", "1T", "120", "36", - "MKK", "5G", "20M", "HT", "1T", "120", "36", - "FCC", "5G", "20M", "HT", "1T", "124", "30", - "ETSI", "5G", "20M", "HT", "1T", "124", "36", - "MKK", "5G", "20M", "HT", "1T", "124", "36", - "FCC", "5G", "20M", "HT", "1T", "128", "30", - "ETSI", "5G", "20M", "HT", "1T", "128", "36", - "MKK", "5G", "20M", "HT", "1T", "128", "36", + "ETSI", "5G", "20M", "HT", "1T", "100", "32", + "MKK", "5G", "20M", "HT", "1T", "100", "32", + "FCC", "5G", "20M", "HT", "1T", "104", "30", + "ETSI", "5G", "20M", "HT", "1T", "104", "32", + "MKK", "5G", "20M", "HT", "1T", "104", "32", + "FCC", "5G", "20M", "HT", "1T", "108", "32", + "ETSI", "5G", "20M", "HT", "1T", "108", "32", + "MKK", "5G", "20M", "HT", "1T", "108", "32", + "FCC", "5G", "20M", "HT", "1T", "112", "34", + "ETSI", "5G", "20M", "HT", "1T", "112", "32", + "MKK", "5G", "20M", "HT", "1T", "112", "32", + "FCC", "5G", "20M", "HT", "1T", "116", "34", + "ETSI", "5G", "20M", "HT", "1T", "116", "32", + "MKK", "5G", "20M", "HT", "1T", "116", "32", + "FCC", "5G", "20M", "HT", "1T", "120", "36", + "ETSI", "5G", "20M", "HT", "1T", "120", "32", + "MKK", "5G", "20M", "HT", "1T", "120", "32", + "FCC", "5G", "20M", "HT", "1T", "124", "34", + "ETSI", "5G", "20M", "HT", "1T", "124", "32", + "MKK", "5G", "20M", "HT", "1T", "124", "32", + "FCC", "5G", "20M", "HT", "1T", "128", "32", + "ETSI", "5G", "20M", "HT", "1T", "128", "32", + "MKK", "5G", "20M", "HT", "1T", "128", "32", "FCC", "5G", "20M", "HT", "1T", "132", "30", - "ETSI", "5G", "20M", "HT", "1T", "132", "36", - "MKK", "5G", "20M", "HT", "1T", "132", "36", + "ETSI", "5G", "20M", "HT", "1T", "132", "32", + "MKK", "5G", "20M", "HT", "1T", "132", "32", "FCC", "5G", "20M", "HT", "1T", "136", "30", - "ETSI", "5G", "20M", "HT", "1T", "136", "36", - "MKK", "5G", "20M", "HT", "1T", "136", "36", - "FCC", "5G", "20M", "HT", "1T", "140", "30", - "ETSI", "5G", "20M", "HT", "1T", "140", "36", - "MKK", "5G", "20M", "HT", "1T", "140", "36", - "FCC", "5G", "20M", "HT", "1T", "149", "30", - "ETSI", "5G", "20M", "HT", "1T", "149", "36", + "ETSI", "5G", "20M", "HT", "1T", "136", "32", + "MKK", "5G", "20M", "HT", "1T", "136", "32", + "FCC", "5G", "20M", "HT", "1T", "140", "28", + "ETSI", "5G", "20M", "HT", "1T", "140", "32", + "MKK", "5G", "20M", "HT", "1T", "140", "32", + "FCC", "5G", "20M", "HT", "1T", "149", "36", + "ETSI", "5G", "20M", "HT", "1T", "149", "32", "MKK", "5G", "20M", "HT", "1T", "149", "63", - "FCC", "5G", "20M", "HT", "1T", "153", "30", - "ETSI", "5G", "20M", "HT", "1T", "153", "36", + "FCC", "5G", "20M", "HT", "1T", "153", "36", + "ETSI", "5G", "20M", "HT", "1T", "153", "32", "MKK", "5G", "20M", "HT", "1T", "153", "63", - "FCC", "5G", "20M", "HT", "1T", "157", "30", - "ETSI", "5G", "20M", "HT", "1T", "157", "36", + "FCC", "5G", "20M", "HT", "1T", "157", "36", + "ETSI", "5G", "20M", "HT", "1T", "157", "32", "MKK", "5G", "20M", "HT", "1T", "157", "63", - "FCC", "5G", "20M", "HT", "1T", "161", "30", - "ETSI", "5G", "20M", "HT", "1T", "161", "36", + "FCC", "5G", "20M", "HT", "1T", "161", "36", + "ETSI", "5G", "20M", "HT", "1T", "161", "32", "MKK", "5G", "20M", "HT", "1T", "161", "63", - "FCC", "5G", "20M", "HT", "1T", "165", "30", - "ETSI", "5G", "20M", "HT", "1T", "165", "36", + "FCC", "5G", "20M", "HT", "1T", "165", "36", + "ETSI", "5G", "20M", "HT", "1T", "165", "32", "MKK", "5G", "20M", "HT", "1T", "165", "63", "FCC", "5G", "20M", "HT", "2T", "36", "28", "ETSI", "5G", "20M", "HT", "2T", "36", "30", - "MKK", "5G", "20M", "HT", "2T", "36", "32", + "MKK", "5G", "20M", "HT", "2T", "36", "30", "FCC", "5G", "20M", "HT", "2T", "40", "28", "ETSI", "5G", "20M", "HT", "2T", "40", "30", - "MKK", "5G", "20M", "HT", "2T", "40", "32", + "MKK", "5G", "20M", "HT", "2T", "40", "30", "FCC", "5G", "20M", "HT", "2T", "44", "28", "ETSI", "5G", "20M", "HT", "2T", "44", "30", - "MKK", "5G", "20M", "HT", "2T", "44", "32", + "MKK", "5G", "20M", "HT", "2T", "44", "30", "FCC", "5G", "20M", "HT", "2T", "48", "28", "ETSI", "5G", "20M", "HT", "2T", "48", "30", - "MKK", "5G", "20M", "HT", "2T", "48", "25", - "FCC", "5G", "20M", "HT", "2T", "52", "28", + "MKK", "5G", "20M", "HT", "2T", "48", "30", + "FCC", "5G", "20M", "HT", "2T", "52", "34", "ETSI", "5G", "20M", "HT", "2T", "52", "30", "MKK", "5G", "20M", "HT", "2T", "52", "30", - "FCC", "5G", "20M", "HT", "2T", "56", "28", + "FCC", "5G", "20M", "HT", "2T", "56", "32", "ETSI", "5G", "20M", "HT", "2T", "56", "30", "MKK", "5G", "20M", "HT", "2T", "56", "30", - "FCC", "5G", "20M", "HT", "2T", "60", "28", + "FCC", "5G", "20M", "HT", "2T", "60", "30", "ETSI", "5G", "20M", "HT", "2T", "60", "30", "MKK", "5G", "20M", "HT", "2T", "60", "30", - "FCC", "5G", "20M", "HT", "2T", "64", "28", + "FCC", "5G", "20M", "HT", "2T", "64", "26", "ETSI", "5G", "20M", "HT", "2T", "64", "30", "MKK", "5G", "20M", "HT", "2T", "64", "30", - "FCC", "5G", "20M", "HT", "2T", "100", "30", + "FCC", "5G", "20M", "HT", "2T", "100", "28", "ETSI", "5G", "20M", "HT", "2T", "100", "30", "MKK", "5G", "20M", "HT", "2T", "100", "30", - "FCC", "5G", "20M", "HT", "2T", "114", "30", - "ETSI", "5G", "20M", "HT", "2T", "114", "30", - "MKK", "5G", "20M", "HT", "2T", "114", "30", + "FCC", "5G", "20M", "HT", "2T", "104", "28", + "ETSI", "5G", "20M", "HT", "2T", "104", "30", + "MKK", "5G", "20M", "HT", "2T", "104", "30", "FCC", "5G", "20M", "HT", "2T", "108", "30", "ETSI", "5G", "20M", "HT", "2T", "108", "30", "MKK", "5G", "20M", "HT", "2T", "108", "30", - "FCC", "5G", "20M", "HT", "2T", "112", "30", + "FCC", "5G", "20M", "HT", "2T", "112", "32", "ETSI", "5G", "20M", "HT", "2T", "112", "30", "MKK", "5G", "20M", "HT", "2T", "112", "30", - "FCC", "5G", "20M", "HT", "2T", "116", "30", + "FCC", "5G", "20M", "HT", "2T", "116", "32", "ETSI", "5G", "20M", "HT", "2T", "116", "30", "MKK", "5G", "20M", "HT", "2T", "116", "30", - "FCC", "5G", "20M", "HT", "2T", "120", "30", + "FCC", "5G", "20M", "HT", "2T", "120", "34", "ETSI", "5G", "20M", "HT", "2T", "120", "30", "MKK", "5G", "20M", "HT", "2T", "120", "30", - "FCC", "5G", "20M", "HT", "2T", "124", "30", + "FCC", "5G", "20M", "HT", "2T", "124", "32", "ETSI", "5G", "20M", "HT", "2T", "124", "30", "MKK", "5G", "20M", "HT", "2T", "124", "30", "FCC", "5G", "20M", "HT", "2T", "128", "30", "ETSI", "5G", "20M", "HT", "2T", "128", "30", "MKK", "5G", "20M", "HT", "2T", "128", "30", - "FCC", "5G", "20M", "HT", "2T", "132", "30", + "FCC", "5G", "20M", "HT", "2T", "132", "28", "ETSI", "5G", "20M", "HT", "2T", "132", "30", "MKK", "5G", "20M", "HT", "2T", "132", "30", - "FCC", "5G", "20M", "HT", "2T", "136", "30", + "FCC", "5G", "20M", "HT", "2T", "136", "28", "ETSI", "5G", "20M", "HT", "2T", "136", "30", "MKK", "5G", "20M", "HT", "2T", "136", "30", - "FCC", "5G", "20M", "HT", "2T", "140", "30", + "FCC", "5G", "20M", "HT", "2T", "140", "26", "ETSI", "5G", "20M", "HT", "2T", "140", "30", "MKK", "5G", "20M", "HT", "2T", "140", "30", - "FCC", "5G", "20M", "HT", "2T", "149", "30", + "FCC", "5G", "20M", "HT", "2T", "149", "34", "ETSI", "5G", "20M", "HT", "2T", "149", "30", "MKK", "5G", "20M", "HT", "2T", "149", "63", - "FCC", "5G", "20M", "HT", "2T", "153", "30", + "FCC", "5G", "20M", "HT", "2T", "153", "34", "ETSI", "5G", "20M", "HT", "2T", "153", "30", "MKK", "5G", "20M", "HT", "2T", "153", "63", - "FCC", "5G", "20M", "HT", "2T", "157", "30", + "FCC", "5G", "20M", "HT", "2T", "157", "34", "ETSI", "5G", "20M", "HT", "2T", "157", "30", "MKK", "5G", "20M", "HT", "2T", "157", "63", - "FCC", "5G", "20M", "HT", "2T", "161", "30", + "FCC", "5G", "20M", "HT", "2T", "161", "34", "ETSI", "5G", "20M", "HT", "2T", "161", "30", "MKK", "5G", "20M", "HT", "2T", "161", "63", - "FCC", "5G", "20M", "HT", "2T", "165", "30", + "FCC", "5G", "20M", "HT", "2T", "165", "34", "ETSI", "5G", "20M", "HT", "2T", "165", "30", "MKK", "5G", "20M", "HT", "2T", "165", "63", - "FCC", "5G", "40M", "HT", "1T", "38", "28", - "ETSI", "5G", "40M", "HT", "1T", "38", "34", + "FCC", "5G", "40M", "HT", "1T", "38", "30", + "ETSI", "5G", "40M", "HT", "1T", "38", "32", "MKK", "5G", "40M", "HT", "1T", "38", "32", - "FCC", "5G", "40M", "HT", "1T", "46", "28", - "ETSI", "5G", "40M", "HT", "1T", "46", "34", - "MKK", "5G", "40M", "HT", "1T", "46", "25", - "FCC", "5G", "40M", "HT", "1T", "54", "28", - "ETSI", "5G", "40M", "HT", "1T", "54", "34", - "MKK", "5G", "40M", "HT", "1T", "54", "34", - "FCC", "5G", "40M", "HT", "1T", "62", "28", - "ETSI", "5G", "40M", "HT", "1T", "62", "34", - "MKK", "5G", "40M", "HT", "1T", "62", "34", - "FCC", "5G", "40M", "HT", "1T", "102", "30", - "ETSI", "5G", "40M", "HT", "1T", "102", "34", - "MKK", "5G", "40M", "HT", "1T", "102", "34", - "FCC", "5G", "40M", "HT", "1T", "110", "30", - "ETSI", "5G", "40M", "HT", "1T", "110", "34", - "MKK", "5G", "40M", "HT", "1T", "110", "34", - "FCC", "5G", "40M", "HT", "1T", "118", "30", - "ETSI", "5G", "40M", "HT", "1T", "118", "34", - "MKK", "5G", "40M", "HT", "1T", "118", "34", - "FCC", "5G", "40M", "HT", "1T", "126", "30", - "ETSI", "5G", "40M", "HT", "1T", "126", "34", - "MKK", "5G", "40M", "HT", "1T", "126", "34", - "FCC", "5G", "40M", "HT", "1T", "134", "30", - "ETSI", "5G", "40M", "HT", "1T", "134", "34", - "MKK", "5G", "40M", "HT", "1T", "134", "34", - "FCC", "5G", "40M", "HT", "1T", "151", "30", - "ETSI", "5G", "40M", "HT", "1T", "151", "34", + "FCC", "5G", "40M", "HT", "1T", "46", "30", + "ETSI", "5G", "40M", "HT", "1T", "46", "32", + "MKK", "5G", "40M", "HT", "1T", "46", "32", + "FCC", "5G", "40M", "HT", "1T", "54", "32", + "ETSI", "5G", "40M", "HT", "1T", "54", "32", + "MKK", "5G", "40M", "HT", "1T", "54", "32", + "FCC", "5G", "40M", "HT", "1T", "62", "32", + "ETSI", "5G", "40M", "HT", "1T", "62", "32", + "MKK", "5G", "40M", "HT", "1T", "62", "32", + "FCC", "5G", "40M", "HT", "1T", "102", "28", + "ETSI", "5G", "40M", "HT", "1T", "102", "32", + "MKK", "5G", "40M", "HT", "1T", "102", "32", + "FCC", "5G", "40M", "HT", "1T", "110", "32", + "ETSI", "5G", "40M", "HT", "1T", "110", "32", + "MKK", "5G", "40M", "HT", "1T", "110", "32", + "FCC", "5G", "40M", "HT", "1T", "118", "36", + "ETSI", "5G", "40M", "HT", "1T", "118", "32", + "MKK", "5G", "40M", "HT", "1T", "118", "32", + "FCC", "5G", "40M", "HT", "1T", "126", "34", + "ETSI", "5G", "40M", "HT", "1T", "126", "32", + "MKK", "5G", "40M", "HT", "1T", "126", "32", + "FCC", "5G", "40M", "HT", "1T", "134", "32", + "ETSI", "5G", "40M", "HT", "1T", "134", "32", + "MKK", "5G", "40M", "HT", "1T", "134", "32", + "FCC", "5G", "40M", "HT", "1T", "151", "36", + "ETSI", "5G", "40M", "HT", "1T", "151", "32", "MKK", "5G", "40M", "HT", "1T", "151", "63", - "FCC", "5G", "40M", "HT", "1T", "159", "30", - "ETSI", "5G", "40M", "HT", "1T", "159", "34", + "FCC", "5G", "40M", "HT", "1T", "159", "36", + "ETSI", "5G", "40M", "HT", "1T", "159", "32", "MKK", "5G", "40M", "HT", "1T", "159", "63", "FCC", "5G", "40M", "HT", "2T", "38", "28", "ETSI", "5G", "40M", "HT", "2T", "38", "30", - "MKK", "5G", "40M", "HT", "2T", "38", "32", + "MKK", "5G", "40M", "HT", "2T", "38", "30", "FCC", "5G", "40M", "HT", "2T", "46", "28", "ETSI", "5G", "40M", "HT", "2T", "46", "30", - "MKK", "5G", "40M", "HT", "2T", "46", "24", - "FCC", "5G", "40M", "HT", "2T", "54", "28", + "MKK", "5G", "40M", "HT", "2T", "46", "30", + "FCC", "5G", "40M", "HT", "2T", "54", "30", "ETSI", "5G", "40M", "HT", "2T", "54", "30", "MKK", "5G", "40M", "HT", "2T", "54", "30", - "FCC", "5G", "40M", "HT", "2T", "62", "28", + "FCC", "5G", "40M", "HT", "2T", "62", "30", "ETSI", "5G", "40M", "HT", "2T", "62", "30", "MKK", "5G", "40M", "HT", "2T", "62", "30", - "FCC", "5G", "40M", "HT", "2T", "102", "30", + "FCC", "5G", "40M", "HT", "2T", "102", "26", "ETSI", "5G", "40M", "HT", "2T", "102", "30", "MKK", "5G", "40M", "HT", "2T", "102", "30", "FCC", "5G", "40M", "HT", "2T", "110", "30", "ETSI", "5G", "40M", "HT", "2T", "110", "30", "MKK", "5G", "40M", "HT", "2T", "110", "30", - "FCC", "5G", "40M", "HT", "2T", "118", "30", + "FCC", "5G", "40M", "HT", "2T", "118", "34", "ETSI", "5G", "40M", "HT", "2T", "118", "30", "MKK", "5G", "40M", "HT", "2T", "118", "30", - "FCC", "5G", "40M", "HT", "2T", "126", "30", + "FCC", "5G", "40M", "HT", "2T", "126", "32", "ETSI", "5G", "40M", "HT", "2T", "126", "30", "MKK", "5G", "40M", "HT", "2T", "126", "30", "FCC", "5G", "40M", "HT", "2T", "134", "30", "ETSI", "5G", "40M", "HT", "2T", "134", "30", "MKK", "5G", "40M", "HT", "2T", "134", "30", - "FCC", "5G", "40M", "HT", "2T", "151", "30", + "FCC", "5G", "40M", "HT", "2T", "151", "34", "ETSI", "5G", "40M", "HT", "2T", "151", "30", "MKK", "5G", "40M", "HT", "2T", "151", "63", - "FCC", "5G", "40M", "HT", "2T", "159", "30", + "FCC", "5G", "40M", "HT", "2T", "159", "34", "ETSI", "5G", "40M", "HT", "2T", "159", "30", "MKK", "5G", "40M", "HT", "2T", "159", "63", - "FCC", "5G", "80M", "VHT", "1T", "42", "28", - "ETSI", "5G", "80M", "VHT", "1T", "42", "34", - "MKK", "5G", "80M", "VHT", "1T", "42", "25", + "FCC", "5G", "80M", "VHT", "1T", "42", "30", + "ETSI", "5G", "80M", "VHT", "1T", "42", "32", + "MKK", "5G", "80M", "VHT", "1T", "42", "32", "FCC", "5G", "80M", "VHT", "1T", "58", "28", - "ETSI", "5G", "80M", "VHT", "1T", "58", "34", - "MKK", "5G", "80M", "VHT", "1T", "58", "34", + "ETSI", "5G", "80M", "VHT", "1T", "58", "32", + "MKK", "5G", "80M", "VHT", "1T", "58", "32", "FCC", "5G", "80M", "VHT", "1T", "106", "30", - "ETSI", "5G", "80M", "VHT", "1T", "106", "34", - "MKK", "5G", "80M", "VHT", "1T", "106", "34", - "FCC", "5G", "80M", "VHT", "1T", "122", "30", - "ETSI", "5G", "80M", "VHT", "1T", "122", "34", - "MKK", "5G", "80M", "VHT", "1T", "122", "34", - "FCC", "5G", "80M", "VHT", "1T", "155", "30", - "ETSI", "5G", "80M", "VHT", "1T", "155", "34", + "ETSI", "5G", "80M", "VHT", "1T", "106", "32", + "MKK", "5G", "80M", "VHT", "1T", "106", "32", + "FCC", "5G", "80M", "VHT", "1T", "122", "34", + "ETSI", "5G", "80M", "VHT", "1T", "122", "32", + "MKK", "5G", "80M", "VHT", "1T", "122", "32", + "FCC", "5G", "80M", "VHT", "1T", "155", "36", + "ETSI", "5G", "80M", "VHT", "1T", "155", "32", "MKK", "5G", "80M", "VHT", "1T", "155", "63", "FCC", "5G", "80M", "VHT", "2T", "42", "28", "ETSI", "5G", "80M", "VHT", "2T", "42", "30", - "MKK", "5G", "80M", "VHT", "2T", "42", "25", - "FCC", "5G", "80M", "VHT", "2T", "58", "28", + "MKK", "5G", "80M", "VHT", "2T", "42", "30", + "FCC", "5G", "80M", "VHT", "2T", "58", "26", "ETSI", "5G", "80M", "VHT", "2T", "58", "30", "MKK", "5G", "80M", "VHT", "2T", "58", "30", - "FCC", "5G", "80M", "VHT", "2T", "106", "30", + "FCC", "5G", "80M", "VHT", "2T", "106", "28", "ETSI", "5G", "80M", "VHT", "2T", "106", "30", "MKK", "5G", "80M", "VHT", "2T", "106", "30", - "FCC", "5G", "80M", "VHT", "2T", "122", "30", + "FCC", "5G", "80M", "VHT", "2T", "122", "32", "ETSI", "5G", "80M", "VHT", "2T", "122", "30", "MKK", "5G", "80M", "VHT", "2T", "122", "30", - "FCC", "5G", "80M", "VHT", "2T", "155", "30", + "FCC", "5G", "80M", "VHT", "2T", "155", "34", "ETSI", "5G", "80M", "VHT", "2T", "155", "30", "MKK", "5G", "80M", "VHT", "2T", "155", "63" }; @@ -1961,5 +1984,602 @@ ODM_ReadAndConfig_MP_8812A_TXPWR_LMT( } +/****************************************************************************** +* TXPWR_LMT_HM812A03.TXT +******************************************************************************/ + +pu1Byte Array_MP_8812A_TXPWR_LMT_HM812A03[] = { + "FCC", "2.4G", "20M", "CCK", "1T", "01", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "01", "30", + "MKK", "2.4G", "20M", "CCK", "1T", "01", "36", + "FCC", "2.4G", "20M", "CCK", "1T", "02", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "02", "30", + "MKK", "2.4G", "20M", "CCK", "1T", "02", "36", + "FCC", "2.4G", "20M", "CCK", "1T", "03", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "03", "30", + "MKK", "2.4G", "20M", "CCK", "1T", "03", "36", + "FCC", "2.4G", "20M", "CCK", "1T", "04", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "04", "30", + "MKK", "2.4G", "20M", "CCK", "1T", "04", "36", + "FCC", "2.4G", "20M", "CCK", "1T", "05", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "05", "30", + "MKK", "2.4G", "20M", "CCK", "1T", "05", "36", + "FCC", "2.4G", "20M", "CCK", "1T", "06", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "06", "30", + "MKK", "2.4G", "20M", "CCK", "1T", "06", "36", + "FCC", "2.4G", "20M", "CCK", "1T", "07", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "07", "30", + "MKK", "2.4G", "20M", "CCK", "1T", "07", "36", + "FCC", "2.4G", "20M", "CCK", "1T", "08", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "08", "30", + "MKK", "2.4G", "20M", "CCK", "1T", "08", "36", + "FCC", "2.4G", "20M", "CCK", "1T", "09", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "09", "30", + "MKK", "2.4G", "20M", "CCK", "1T", "09", "36", + "FCC", "2.4G", "20M", "CCK", "1T", "10", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "10", "30", + "MKK", "2.4G", "20M", "CCK", "1T", "10", "36", + "FCC", "2.4G", "20M", "CCK", "1T", "11", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "11", "30", + "MKK", "2.4G", "20M", "CCK", "1T", "11", "36", + "FCC", "2.4G", "20M", "CCK", "1T", "12", "63", + "ETSI", "2.4G", "20M", "CCK", "1T", "12", "30", + "MKK", "2.4G", "20M", "CCK", "1T", "12", "36", + "FCC", "2.4G", "20M", "CCK", "1T", "13", "63", + "ETSI", "2.4G", "20M", "CCK", "1T", "13", "30", + "MKK", "2.4G", "20M", "CCK", "1T", "13", "36", + "FCC", "2.4G", "20M", "CCK", "1T", "14", "63", + "ETSI", "2.4G", "20M", "CCK", "1T", "14", "63", + "MKK", "2.4G", "20M", "CCK", "1T", "14", "36", + "FCC", "2.4G", "20M", "OFDM", "1T", "01", "30", + "ETSI", "2.4G", "20M", "OFDM", "1T", "01", "30", + "MKK", "2.4G", "20M", "OFDM", "1T", "01", "36", + "FCC", "2.4G", "20M", "OFDM", "1T", "02", "36", + "ETSI", "2.4G", "20M", "OFDM", "1T", "02", "30", + "MKK", "2.4G", "20M", "OFDM", "1T", "02", "36", + "FCC", "2.4G", "20M", "OFDM", "1T", "03", "36", + "ETSI", "2.4G", "20M", "OFDM", "1T", "03", "30", + "MKK", "2.4G", "20M", "OFDM", "1T", "03", "36", + "FCC", "2.4G", "20M", "OFDM", "1T", "04", "36", + "ETSI", "2.4G", "20M", "OFDM", "1T", "04", "30", + "MKK", "2.4G", "20M", "OFDM", "1T", "04", "36", + "FCC", "2.4G", "20M", "OFDM", "1T", "05", "36", + "ETSI", "2.4G", "20M", "OFDM", "1T", "05", "30", + "MKK", "2.4G", "20M", "OFDM", "1T", "05", "36", + "FCC", "2.4G", "20M", "OFDM", "1T", "06", "36", + "ETSI", "2.4G", "20M", "OFDM", "1T", "06", "30", + "MKK", "2.4G", "20M", "OFDM", "1T", "06", "36", + "FCC", "2.4G", "20M", "OFDM", "1T", "07", "36", + "ETSI", "2.4G", "20M", "OFDM", "1T", "07", "30", + "MKK", "2.4G", "20M", "OFDM", "1T", "07", "36", + "FCC", "2.4G", "20M", "OFDM", "1T", "08", "36", + "ETSI", "2.4G", "20M", "OFDM", "1T", "08", "30", + "MKK", "2.4G", "20M", "OFDM", "1T", "08", "36", + "FCC", "2.4G", "20M", "OFDM", "1T", "09", "36", + "ETSI", "2.4G", "20M", "OFDM", "1T", "09", "30", + "MKK", "2.4G", "20M", "OFDM", "1T", "09", "36", + "FCC", "2.4G", "20M", "OFDM", "1T", "10", "36", + "ETSI", "2.4G", "20M", "OFDM", "1T", "10", "30", + "MKK", "2.4G", "20M", "OFDM", "1T", "10", "36", + "FCC", "2.4G", "20M", "OFDM", "1T", "11", "30", + "ETSI", "2.4G", "20M", "OFDM", "1T", "11", "30", + "MKK", "2.4G", "20M", "OFDM", "1T", "11", "36", + "FCC", "2.4G", "20M", "OFDM", "1T", "12", "63", + "ETSI", "2.4G", "20M", "OFDM", "1T", "12", "30", + "MKK", "2.4G", "20M", "OFDM", "1T", "12", "36", + "FCC", "2.4G", "20M", "OFDM", "1T", "13", "63", + "ETSI", "2.4G", "20M", "OFDM", "1T", "13", "30", + "MKK", "2.4G", "20M", "OFDM", "1T", "13", "36", + "FCC", "2.4G", "20M", "OFDM", "1T", "14", "63", + "ETSI", "2.4G", "20M", "OFDM", "1T", "14", "63", + "MKK", "2.4G", "20M", "OFDM", "1T", "14", "63", + "FCC", "2.4G", "20M", "HT", "1T", "01", "30", + "ETSI", "2.4G", "20M", "HT", "1T", "01", "30", + "MKK", "2.4G", "20M", "HT", "1T", "01", "36", + "FCC", "2.4G", "20M", "HT", "1T", "02", "36", + "ETSI", "2.4G", "20M", "HT", "1T", "02", "30", + "MKK", "2.4G", "20M", "HT", "1T", "02", "36", + "FCC", "2.4G", "20M", "HT", "1T", "03", "36", + "ETSI", "2.4G", "20M", "HT", "1T", "03", "30", + "MKK", "2.4G", "20M", "HT", "1T", "03", "36", + "FCC", "2.4G", "20M", "HT", "1T", "04", "36", + "ETSI", "2.4G", "20M", "HT", "1T", "04", "30", + "MKK", "2.4G", "20M", "HT", "1T", "04", "36", + "FCC", "2.4G", "20M", "HT", "1T", "05", "36", + "ETSI", "2.4G", "20M", "HT", "1T", "05", "30", + "MKK", "2.4G", "20M", "HT", "1T", "05", "36", + "FCC", "2.4G", "20M", "HT", "1T", "06", "36", + "ETSI", "2.4G", "20M", "HT", "1T", "06", "30", + "MKK", "2.4G", "20M", "HT", "1T", "06", "36", + "FCC", "2.4G", "20M", "HT", "1T", "07", "36", + "ETSI", "2.4G", "20M", "HT", "1T", "07", "30", + "MKK", "2.4G", "20M", "HT", "1T", "07", "36", + "FCC", "2.4G", "20M", "HT", "1T", "08", "36", + "ETSI", "2.4G", "20M", "HT", "1T", "08", "30", + "MKK", "2.4G", "20M", "HT", "1T", "08", "36", + "FCC", "2.4G", "20M", "HT", "1T", "09", "36", + "ETSI", "2.4G", "20M", "HT", "1T", "09", "30", + "MKK", "2.4G", "20M", "HT", "1T", "09", "36", + "FCC", "2.4G", "20M", "HT", "1T", "10", "36", + "ETSI", "2.4G", "20M", "HT", "1T", "10", "30", + "MKK", "2.4G", "20M", "HT", "1T", "10", "36", + "FCC", "2.4G", "20M", "HT", "1T", "11", "30", + "ETSI", "2.4G", "20M", "HT", "1T", "11", "30", + "MKK", "2.4G", "20M", "HT", "1T", "11", "36", + "FCC", "2.4G", "20M", "HT", "1T", "12", "63", + "ETSI", "2.4G", "20M", "HT", "1T", "12", "30", + "MKK", "2.4G", "20M", "HT", "1T", "12", "36", + "FCC", "2.4G", "20M", "HT", "1T", "13", "63", + "ETSI", "2.4G", "20M", "HT", "1T", "13", "30", + "MKK", "2.4G", "20M", "HT", "1T", "13", "36", + "FCC", "2.4G", "20M", "HT", "1T", "14", "63", + "ETSI", "2.4G", "20M", "HT", "1T", "14", "63", + "MKK", "2.4G", "20M", "HT", "1T", "14", "63", + "FCC", "2.4G", "20M", "HT", "2T", "01", "28", + "ETSI", "2.4G", "20M", "HT", "2T", "01", "24", + "MKK", "2.4G", "20M", "HT", "2T", "01", "34", + "FCC", "2.4G", "20M", "HT", "2T", "02", "36", + "ETSI", "2.4G", "20M", "HT", "2T", "02", "24", + "MKK", "2.4G", "20M", "HT", "2T", "02", "34", + "FCC", "2.4G", "20M", "HT", "2T", "03", "36", + "ETSI", "2.4G", "20M", "HT", "2T", "03", "24", + "MKK", "2.4G", "20M", "HT", "2T", "03", "34", + "FCC", "2.4G", "20M", "HT", "2T", "04", "36", + "ETSI", "2.4G", "20M", "HT", "2T", "04", "24", + "MKK", "2.4G", "20M", "HT", "2T", "04", "34", + "FCC", "2.4G", "20M", "HT", "2T", "05", "36", + "ETSI", "2.4G", "20M", "HT", "2T", "05", "24", + "MKK", "2.4G", "20M", "HT", "2T", "05", "34", + "FCC", "2.4G", "20M", "HT", "2T", "06", "36", + "ETSI", "2.4G", "20M", "HT", "2T", "06", "24", + "MKK", "2.4G", "20M", "HT", "2T", "06", "34", + "FCC", "2.4G", "20M", "HT", "2T", "07", "36", + "ETSI", "2.4G", "20M", "HT", "2T", "07", "24", + "MKK", "2.4G", "20M", "HT", "2T", "07", "34", + "FCC", "2.4G", "20M", "HT", "2T", "08", "36", + "ETSI", "2.4G", "20M", "HT", "2T", "08", "24", + "MKK", "2.4G", "20M", "HT", "2T", "08", "34", + "FCC", "2.4G", "20M", "HT", "2T", "09", "36", + "ETSI", "2.4G", "20M", "HT", "2T", "09", "24", + "MKK", "2.4G", "20M", "HT", "2T", "09", "34", + "FCC", "2.4G", "20M", "HT", "2T", "10", "36", + "ETSI", "2.4G", "20M", "HT", "2T", "10", "24", + "MKK", "2.4G", "20M", "HT", "2T", "10", "34", + "FCC", "2.4G", "20M", "HT", "2T", "11", "28", + "ETSI", "2.4G", "20M", "HT", "2T", "11", "24", + "MKK", "2.4G", "20M", "HT", "2T", "11", "34", + "FCC", "2.4G", "20M", "HT", "2T", "12", "63", + "ETSI", "2.4G", "20M", "HT", "2T", "12", "24", + "MKK", "2.4G", "20M", "HT", "2T", "12", "34", + "FCC", "2.4G", "20M", "HT", "2T", "13", "63", + "ETSI", "2.4G", "20M", "HT", "2T", "13", "24", + "MKK", "2.4G", "20M", "HT", "2T", "13", "34", + "FCC", "2.4G", "20M", "HT", "2T", "14", "63", + "ETSI", "2.4G", "20M", "HT", "2T", "14", "63", + "MKK", "2.4G", "20M", "HT", "2T", "14", "63", + "FCC", "2.4G", "40M", "HT", "1T", "01", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "01", "63", + "MKK", "2.4G", "40M", "HT", "1T", "01", "63", + "FCC", "2.4G", "40M", "HT", "1T", "02", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "02", "63", + "MKK", "2.4G", "40M", "HT", "1T", "02", "63", + "FCC", "2.4G", "40M", "HT", "1T", "03", "24", + "ETSI", "2.4G", "40M", "HT", "1T", "03", "30", + "MKK", "2.4G", "40M", "HT", "1T", "03", "34", + "FCC", "2.4G", "40M", "HT", "1T", "04", "30", + "ETSI", "2.4G", "40M", "HT", "1T", "04", "30", + "MKK", "2.4G", "40M", "HT", "1T", "04", "34", + "FCC", "2.4G", "40M", "HT", "1T", "05", "30", + "ETSI", "2.4G", "40M", "HT", "1T", "05", "30", + "MKK", "2.4G", "40M", "HT", "1T", "05", "34", + "FCC", "2.4G", "40M", "HT", "1T", "06", "30", + "ETSI", "2.4G", "40M", "HT", "1T", "06", "30", + "MKK", "2.4G", "40M", "HT", "1T", "06", "34", + "FCC", "2.4G", "40M", "HT", "1T", "07", "30", + "ETSI", "2.4G", "40M", "HT", "1T", "07", "30", + "MKK", "2.4G", "40M", "HT", "1T", "07", "34", + "FCC", "2.4G", "40M", "HT", "1T", "08", "30", + "ETSI", "2.4G", "40M", "HT", "1T", "08", "30", + "MKK", "2.4G", "40M", "HT", "1T", "08", "34", + "FCC", "2.4G", "40M", "HT", "1T", "09", "26", + "ETSI", "2.4G", "40M", "HT", "1T", "09", "30", + "MKK", "2.4G", "40M", "HT", "1T", "09", "34", + "FCC", "2.4G", "40M", "HT", "1T", "10", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "10", "30", + "MKK", "2.4G", "40M", "HT", "1T", "10", "34", + "FCC", "2.4G", "40M", "HT", "1T", "11", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "11", "30", + "MKK", "2.4G", "40M", "HT", "1T", "11", "34", + "FCC", "2.4G", "40M", "HT", "1T", "12", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "12", "63", + "MKK", "2.4G", "40M", "HT", "1T", "12", "63", + "FCC", "2.4G", "40M", "HT", "1T", "13", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "13", "63", + "MKK", "2.4G", "40M", "HT", "1T", "13", "63", + "FCC", "2.4G", "40M", "HT", "1T", "14", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "14", "63", + "MKK", "2.4G", "40M", "HT", "1T", "14", "63", + "FCC", "2.4G", "40M", "HT", "2T", "01", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "01", "63", + "MKK", "2.4G", "40M", "HT", "2T", "01", "63", + "FCC", "2.4G", "40M", "HT", "2T", "02", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "02", "63", + "MKK", "2.4G", "40M", "HT", "2T", "02", "63", + "FCC", "2.4G", "40M", "HT", "2T", "03", "24", + "ETSI", "2.4G", "40M", "HT", "2T", "03", "24", + "MKK", "2.4G", "40M", "HT", "2T", "03", "34", + "FCC", "2.4G", "40M", "HT", "2T", "04", "30", + "ETSI", "2.4G", "40M", "HT", "2T", "04", "24", + "MKK", "2.4G", "40M", "HT", "2T", "04", "34", + "FCC", "2.4G", "40M", "HT", "2T", "05", "30", + "ETSI", "2.4G", "40M", "HT", "2T", "05", "24", + "MKK", "2.4G", "40M", "HT", "2T", "05", "34", + "FCC", "2.4G", "40M", "HT", "2T", "06", "30", + "ETSI", "2.4G", "40M", "HT", "2T", "06", "24", + "MKK", "2.4G", "40M", "HT", "2T", "06", "34", + "FCC", "2.4G", "40M", "HT", "2T", "07", "30", + "ETSI", "2.4G", "40M", "HT", "2T", "07", "24", + "MKK", "2.4G", "40M", "HT", "2T", "07", "34", + "FCC", "2.4G", "40M", "HT", "2T", "08", "30", + "ETSI", "2.4G", "40M", "HT", "2T", "08", "24", + "MKK", "2.4G", "40M", "HT", "2T", "08", "34", + "FCC", "2.4G", "40M", "HT", "2T", "09", "26", + "ETSI", "2.4G", "40M", "HT", "2T", "09", "24", + "MKK", "2.4G", "40M", "HT", "2T", "09", "34", + "FCC", "2.4G", "40M", "HT", "2T", "10", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "10", "24", + "MKK", "2.4G", "40M", "HT", "2T", "10", "34", + "FCC", "2.4G", "40M", "HT", "2T", "11", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "11", "24", + "MKK", "2.4G", "40M", "HT", "2T", "11", "34", + "FCC", "2.4G", "40M", "HT", "2T", "12", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "12", "63", + "MKK", "2.4G", "40M", "HT", "2T", "12", "63", + "FCC", "2.4G", "40M", "HT", "2T", "13", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "13", "63", + "MKK", "2.4G", "40M", "HT", "2T", "13", "63", + "FCC", "2.4G", "40M", "HT", "2T", "14", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "14", "63", + "MKK", "2.4G", "40M", "HT", "2T", "14", "63", + "FCC", "5G", "20M", "OFDM", "1T", "36", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "36", "32", + "MKK", "5G", "20M", "OFDM", "1T", "36", "32", + "FCC", "5G", "20M", "OFDM", "1T", "40", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "40", "32", + "MKK", "5G", "20M", "OFDM", "1T", "40", "32", + "FCC", "5G", "20M", "OFDM", "1T", "44", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "44", "32", + "MKK", "5G", "20M", "OFDM", "1T", "44", "32", + "FCC", "5G", "20M", "OFDM", "1T", "48", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "48", "32", + "MKK", "5G", "20M", "OFDM", "1T", "48", "32", + "FCC", "5G", "20M", "OFDM", "1T", "52", "36", + "ETSI", "5G", "20M", "OFDM", "1T", "52", "32", + "MKK", "5G", "20M", "OFDM", "1T", "52", "32", + "FCC", "5G", "20M", "OFDM", "1T", "56", "36", + "ETSI", "5G", "20M", "OFDM", "1T", "56", "32", + "MKK", "5G", "20M", "OFDM", "1T", "56", "32", + "FCC", "5G", "20M", "OFDM", "1T", "60", "36", + "ETSI", "5G", "20M", "OFDM", "1T", "60", "32", + "MKK", "5G", "20M", "OFDM", "1T", "60", "32", + "FCC", "5G", "20M", "OFDM", "1T", "64", "30", + "ETSI", "5G", "20M", "OFDM", "1T", "64", "32", + "MKK", "5G", "20M", "OFDM", "1T", "64", "32", + "FCC", "5G", "20M", "OFDM", "1T", "100", "36", + "ETSI", "5G", "20M", "OFDM", "1T", "100", "32", + "MKK", "5G", "20M", "OFDM", "1T", "100", "36", + "FCC", "5G", "20M", "OFDM", "1T", "104", "36", + "ETSI", "5G", "20M", "OFDM", "1T", "104", "32", + "MKK", "5G", "20M", "OFDM", "1T", "104", "36", + "FCC", "5G", "20M", "OFDM", "1T", "108", "36", + "ETSI", "5G", "20M", "OFDM", "1T", "108", "32", + "MKK", "5G", "20M", "OFDM", "1T", "108", "36", + "FCC", "5G", "20M", "OFDM", "1T", "112", "36", + "ETSI", "5G", "20M", "OFDM", "1T", "112", "32", + "MKK", "5G", "20M", "OFDM", "1T", "112", "36", + "FCC", "5G", "20M", "OFDM", "1T", "116", "36", + "ETSI", "5G", "20M", "OFDM", "1T", "116", "32", + "MKK", "5G", "20M", "OFDM", "1T", "116", "36", + "FCC", "5G", "20M", "OFDM", "1T", "120", "63", + "ETSI", "5G", "20M", "OFDM", "1T", "120", "32", + "MKK", "5G", "20M", "OFDM", "1T", "120", "36", + "FCC", "5G", "20M", "OFDM", "1T", "124", "63", + "ETSI", "5G", "20M", "OFDM", "1T", "124", "32", + "MKK", "5G", "20M", "OFDM", "1T", "124", "36", + "FCC", "5G", "20M", "OFDM", "1T", "128", "63", + "ETSI", "5G", "20M", "OFDM", "1T", "128", "32", + "MKK", "5G", "20M", "OFDM", "1T", "128", "36", + "FCC", "5G", "20M", "OFDM", "1T", "132", "36", + "ETSI", "5G", "20M", "OFDM", "1T", "132", "32", + "MKK", "5G", "20M", "OFDM", "1T", "132", "36", + "FCC", "5G", "20M", "OFDM", "1T", "136", "36", + "ETSI", "5G", "20M", "OFDM", "1T", "136", "32", + "MKK", "5G", "20M", "OFDM", "1T", "136", "36", + "FCC", "5G", "20M", "OFDM", "1T", "140", "30", + "ETSI", "5G", "20M", "OFDM", "1T", "140", "32", + "MKK", "5G", "20M", "OFDM", "1T", "140", "32", + "FCC", "5G", "20M", "OFDM", "1T", "149", "36", + "ETSI", "5G", "20M", "OFDM", "1T", "149", "63", + "MKK", "5G", "20M", "OFDM", "1T", "149", "63", + "FCC", "5G", "20M", "OFDM", "1T", "153", "36", + "ETSI", "5G", "20M", "OFDM", "1T", "153", "63", + "MKK", "5G", "20M", "OFDM", "1T", "153", "63", + "FCC", "5G", "20M", "OFDM", "1T", "157", "36", + "ETSI", "5G", "20M", "OFDM", "1T", "157", "63", + "MKK", "5G", "20M", "OFDM", "1T", "157", "63", + "FCC", "5G", "20M", "OFDM", "1T", "161", "36", + "ETSI", "5G", "20M", "OFDM", "1T", "161", "63", + "MKK", "5G", "20M", "OFDM", "1T", "161", "63", + "FCC", "5G", "20M", "OFDM", "1T", "165", "36", + "ETSI", "5G", "20M", "OFDM", "1T", "165", "63", + "MKK", "5G", "20M", "OFDM", "1T", "165", "63", + "FCC", "5G", "20M", "HT", "1T", "36", "32", + "ETSI", "5G", "20M", "HT", "1T", "36", "32", + "MKK", "5G", "20M", "HT", "1T", "36", "32", + "FCC", "5G", "20M", "HT", "1T", "40", "32", + "ETSI", "5G", "20M", "HT", "1T", "40", "32", + "MKK", "5G", "20M", "HT", "1T", "40", "32", + "FCC", "5G", "20M", "HT", "1T", "44", "32", + "ETSI", "5G", "20M", "HT", "1T", "44", "32", + "MKK", "5G", "20M", "HT", "1T", "44", "32", + "FCC", "5G", "20M", "HT", "1T", "48", "32", + "ETSI", "5G", "20M", "HT", "1T", "48", "32", + "MKK", "5G", "20M", "HT", "1T", "48", "32", + "FCC", "5G", "20M", "HT", "1T", "52", "36", + "ETSI", "5G", "20M", "HT", "1T", "52", "32", + "MKK", "5G", "20M", "HT", "1T", "52", "32", + "FCC", "5G", "20M", "HT", "1T", "56", "36", + "ETSI", "5G", "20M", "HT", "1T", "56", "32", + "MKK", "5G", "20M", "HT", "1T", "56", "32", + "FCC", "5G", "20M", "HT", "1T", "60", "36", + "ETSI", "5G", "20M", "HT", "1T", "60", "32", + "MKK", "5G", "20M", "HT", "1T", "60", "32", + "FCC", "5G", "20M", "HT", "1T", "64", "30", + "ETSI", "5G", "20M", "HT", "1T", "64", "32", + "MKK", "5G", "20M", "HT", "1T", "64", "32", + "FCC", "5G", "20M", "HT", "1T", "100", "36", + "ETSI", "5G", "20M", "HT", "1T", "100", "32", + "MKK", "5G", "20M", "HT", "1T", "100", "36", + "FCC", "5G", "20M", "HT", "1T", "104", "36", + "ETSI", "5G", "20M", "HT", "1T", "104", "32", + "MKK", "5G", "20M", "HT", "1T", "104", "36", + "FCC", "5G", "20M", "HT", "1T", "108", "36", + "ETSI", "5G", "20M", "HT", "1T", "108", "32", + "MKK", "5G", "20M", "HT", "1T", "108", "36", + "FCC", "5G", "20M", "HT", "1T", "112", "36", + "ETSI", "5G", "20M", "HT", "1T", "112", "32", + "MKK", "5G", "20M", "HT", "1T", "112", "36", + "FCC", "5G", "20M", "HT", "1T", "116", "36", + "ETSI", "5G", "20M", "HT", "1T", "116", "32", + "MKK", "5G", "20M", "HT", "1T", "116", "36", + "FCC", "5G", "20M", "HT", "1T", "120", "63", + "ETSI", "5G", "20M", "HT", "1T", "120", "32", + "MKK", "5G", "20M", "HT", "1T", "120", "36", + "FCC", "5G", "20M", "HT", "1T", "124", "63", + "ETSI", "5G", "20M", "HT", "1T", "124", "32", + "MKK", "5G", "20M", "HT", "1T", "124", "36", + "FCC", "5G", "20M", "HT", "1T", "128", "63", + "ETSI", "5G", "20M", "HT", "1T", "128", "32", + "MKK", "5G", "20M", "HT", "1T", "128", "36", + "FCC", "5G", "20M", "HT", "1T", "132", "36", + "ETSI", "5G", "20M", "HT", "1T", "132", "32", + "MKK", "5G", "20M", "HT", "1T", "132", "36", + "FCC", "5G", "20M", "HT", "1T", "136", "36", + "ETSI", "5G", "20M", "HT", "1T", "136", "32", + "MKK", "5G", "20M", "HT", "1T", "136", "36", + "FCC", "5G", "20M", "HT", "1T", "140", "30", + "ETSI", "5G", "20M", "HT", "1T", "140", "32", + "MKK", "5G", "20M", "HT", "1T", "140", "32", + "FCC", "5G", "20M", "HT", "1T", "149", "36", + "ETSI", "5G", "20M", "HT", "1T", "149", "63", + "MKK", "5G", "20M", "HT", "1T", "149", "63", + "FCC", "5G", "20M", "HT", "1T", "153", "36", + "ETSI", "5G", "20M", "HT", "1T", "153", "63", + "MKK", "5G", "20M", "HT", "1T", "153", "63", + "FCC", "5G", "20M", "HT", "1T", "157", "36", + "ETSI", "5G", "20M", "HT", "1T", "157", "63", + "MKK", "5G", "20M", "HT", "1T", "157", "63", + "FCC", "5G", "20M", "HT", "1T", "161", "36", + "ETSI", "5G", "20M", "HT", "1T", "161", "63", + "MKK", "5G", "20M", "HT", "1T", "161", "63", + "FCC", "5G", "20M", "HT", "1T", "165", "36", + "ETSI", "5G", "20M", "HT", "1T", "165", "63", + "MKK", "5G", "20M", "HT", "1T", "165", "63", + "FCC", "5G", "20M", "HT", "2T", "36", "22", + "ETSI", "5G", "20M", "HT", "2T", "36", "26", + "MKK", "5G", "20M", "HT", "2T", "36", "26", + "FCC", "5G", "20M", "HT", "2T", "40", "22", + "ETSI", "5G", "20M", "HT", "2T", "40", "26", + "MKK", "5G", "20M", "HT", "2T", "40", "26", + "FCC", "5G", "20M", "HT", "2T", "44", "22", + "ETSI", "5G", "20M", "HT", "2T", "44", "26", + "MKK", "5G", "20M", "HT", "2T", "44", "26", + "FCC", "5G", "20M", "HT", "2T", "48", "22", + "ETSI", "5G", "20M", "HT", "2T", "48", "26", + "MKK", "5G", "20M", "HT", "2T", "48", "26", + "FCC", "5G", "20M", "HT", "2T", "52", "36", + "ETSI", "5G", "20M", "HT", "2T", "52", "26", + "MKK", "5G", "20M", "HT", "2T", "52", "26", + "FCC", "5G", "20M", "HT", "2T", "56", "36", + "ETSI", "5G", "20M", "HT", "2T", "56", "26", + "MKK", "5G", "20M", "HT", "2T", "56", "26", + "FCC", "5G", "20M", "HT", "2T", "60", "36", + "ETSI", "5G", "20M", "HT", "2T", "60", "26", + "MKK", "5G", "20M", "HT", "2T", "60", "26", + "FCC", "5G", "20M", "HT", "2T", "64", "30", + "ETSI", "5G", "20M", "HT", "2T", "64", "26", + "MKK", "5G", "20M", "HT", "2T", "64", "26", + "FCC", "5G", "20M", "HT", "2T", "100", "32", + "ETSI", "5G", "20M", "HT", "2T", "100", "26", + "MKK", "5G", "20M", "HT", "2T", "100", "34", + "FCC", "5G", "20M", "HT", "2T", "104", "36", + "ETSI", "5G", "20M", "HT", "2T", "104", "26", + "MKK", "5G", "20M", "HT", "2T", "104", "34", + "FCC", "5G", "20M", "HT", "2T", "108", "36", + "ETSI", "5G", "20M", "HT", "2T", "108", "26", + "MKK", "5G", "20M", "HT", "2T", "108", "34", + "FCC", "5G", "20M", "HT", "2T", "112", "36", + "ETSI", "5G", "20M", "HT", "2T", "112", "26", + "MKK", "5G", "20M", "HT", "2T", "112", "34", + "FCC", "5G", "20M", "HT", "2T", "116", "36", + "ETSI", "5G", "20M", "HT", "2T", "116", "26", + "MKK", "5G", "20M", "HT", "2T", "116", "34", + "FCC", "5G", "20M", "HT", "2T", "120", "63", + "ETSI", "5G", "20M", "HT", "2T", "120", "26", + "MKK", "5G", "20M", "HT", "2T", "120", "34", + "FCC", "5G", "20M", "HT", "2T", "124", "63", + "ETSI", "5G", "20M", "HT", "2T", "124", "26", + "MKK", "5G", "20M", "HT", "2T", "124", "34", + "FCC", "5G", "20M", "HT", "2T", "128", "63", + "ETSI", "5G", "20M", "HT", "2T", "128", "26", + "MKK", "5G", "20M", "HT", "2T", "128", "34", + "FCC", "5G", "20M", "HT", "2T", "132", "36", + "ETSI", "5G", "20M", "HT", "2T", "132", "26", + "MKK", "5G", "20M", "HT", "2T", "132", "34", + "FCC", "5G", "20M", "HT", "2T", "136", "36", + "ETSI", "5G", "20M", "HT", "2T", "136", "26", + "MKK", "5G", "20M", "HT", "2T", "136", "34", + "FCC", "5G", "20M", "HT", "2T", "140", "30", + "ETSI", "5G", "20M", "HT", "2T", "140", "26", + "MKK", "5G", "20M", "HT", "2T", "140", "34", + "FCC", "5G", "20M", "HT", "2T", "149", "36", + "ETSI", "5G", "20M", "HT", "2T", "149", "63", + "MKK", "5G", "20M", "HT", "2T", "149", "63", + "FCC", "5G", "20M", "HT", "2T", "153", "36", + "ETSI", "5G", "20M", "HT", "2T", "153", "63", + "MKK", "5G", "20M", "HT", "2T", "153", "63", + "FCC", "5G", "20M", "HT", "2T", "157", "36", + "ETSI", "5G", "20M", "HT", "2T", "157", "63", + "MKK", "5G", "20M", "HT", "2T", "157", "63", + "FCC", "5G", "20M", "HT", "2T", "161", "36", + "ETSI", "5G", "20M", "HT", "2T", "161", "63", + "MKK", "5G", "20M", "HT", "2T", "161", "63", + "FCC", "5G", "20M", "HT", "2T", "165", "36", + "ETSI", "5G", "20M", "HT", "2T", "165", "63", + "MKK", "5G", "20M", "HT", "2T", "165", "63", + "FCC", "5G", "40M", "HT", "1T", "38", "20", + "ETSI", "5G", "40M", "HT", "1T", "38", "32", + "MKK", "5G", "40M", "HT", "1T", "38", "34", + "FCC", "5G", "40M", "HT", "1T", "46", "32", + "ETSI", "5G", "40M", "HT", "1T", "46", "32", + "MKK", "5G", "40M", "HT", "1T", "46", "34", + "FCC", "5G", "40M", "HT", "1T", "54", "34", + "ETSI", "5G", "40M", "HT", "1T", "54", "32", + "MKK", "5G", "40M", "HT", "1T", "54", "34", + "FCC", "5G", "40M", "HT", "1T", "62", "20", + "ETSI", "5G", "40M", "HT", "1T", "62", "32", + "MKK", "5G", "40M", "HT", "1T", "62", "34", + "FCC", "5G", "40M", "HT", "1T", "102", "22", + "ETSI", "5G", "40M", "HT", "1T", "102", "32", + "MKK", "5G", "40M", "HT", "1T", "102", "36", + "FCC", "5G", "40M", "HT", "1T", "110", "36", + "ETSI", "5G", "40M", "HT", "1T", "110", "32", + "MKK", "5G", "40M", "HT", "1T", "110", "34", + "FCC", "5G", "40M", "HT", "1T", "118", "36", + "ETSI", "5G", "40M", "HT", "1T", "118", "32", + "MKK", "5G", "40M", "HT", "1T", "118", "34", + "FCC", "5G", "40M", "HT", "1T", "126", "63", + "ETSI", "5G", "40M", "HT", "1T", "126", "32", + "MKK", "5G", "40M", "HT", "1T", "126", "34", + "FCC", "5G", "40M", "HT", "1T", "134", "30", + "ETSI", "5G", "40M", "HT", "1T", "134", "32", + "MKK", "5G", "40M", "HT", "1T", "134", "34", + "FCC", "5G", "40M", "HT", "1T", "151", "36", + "ETSI", "5G", "40M", "HT", "1T", "151", "63", + "MKK", "5G", "40M", "HT", "1T", "151", "63", + "FCC", "5G", "40M", "HT", "1T", "159", "36", + "ETSI", "5G", "40M", "HT", "1T", "159", "63", + "MKK", "5G", "40M", "HT", "1T", "159", "63", + "FCC", "5G", "40M", "HT", "2T", "38", "20", + "ETSI", "5G", "40M", "HT", "2T", "38", "26", + "MKK", "5G", "40M", "HT", "2T", "38", "26", + "FCC", "5G", "40M", "HT", "2T", "46", "22", + "ETSI", "5G", "40M", "HT", "2T", "46", "26", + "MKK", "5G", "40M", "HT", "2T", "46", "26", + "FCC", "5G", "40M", "HT", "2T", "54", "34", + "ETSI", "5G", "40M", "HT", "2T", "54", "26", + "MKK", "5G", "40M", "HT", "2T", "54", "26", + "FCC", "5G", "40M", "HT", "2T", "62", "20", + "ETSI", "5G", "40M", "HT", "2T", "62", "26", + "MKK", "5G", "40M", "HT", "2T", "62", "26", + "FCC", "5G", "40M", "HT", "2T", "102", "22", + "ETSI", "5G", "40M", "HT", "2T", "102", "26", + "MKK", "5G", "40M", "HT", "2T", "102", "36", + "FCC", "5G", "40M", "HT", "2T", "110", "36", + "ETSI", "5G", "40M", "HT", "2T", "110", "26", + "MKK", "5G", "40M", "HT", "2T", "110", "34", + "FCC", "5G", "40M", "HT", "2T", "118", "36", + "ETSI", "5G", "40M", "HT", "2T", "118", "26", + "MKK", "5G", "40M", "HT", "2T", "118", "34", + "FCC", "5G", "40M", "HT", "2T", "126", "63", + "ETSI", "5G", "40M", "HT", "2T", "126", "26", + "MKK", "5G", "40M", "HT", "2T", "126", "34", + "FCC", "5G", "40M", "HT", "2T", "134", "30", + "ETSI", "5G", "40M", "HT", "2T", "134", "26", + "MKK", "5G", "40M", "HT", "2T", "134", "34", + "FCC", "5G", "40M", "HT", "2T", "151", "36", + "ETSI", "5G", "40M", "HT", "2T", "151", "63", + "MKK", "5G", "40M", "HT", "2T", "151", "63", + "FCC", "5G", "40M", "HT", "2T", "159", "36", + "ETSI", "5G", "40M", "HT", "2T", "159", "63", + "MKK", "5G", "40M", "HT", "2T", "159", "63", + "FCC", "5G", "80M", "VHT", "1T", "42", "20", + "ETSI", "5G", "80M", "VHT", "1T", "42", "32", + "MKK", "5G", "80M", "VHT", "1T", "42", "32", + "FCC", "5G", "80M", "VHT", "1T", "58", "16", + "ETSI", "5G", "80M", "VHT", "1T", "58", "32", + "MKK", "5G", "80M", "VHT", "1T", "58", "32", + "FCC", "5G", "80M", "VHT", "1T", "106", "22", + "ETSI", "5G", "80M", "VHT", "1T", "106", "32", + "MKK", "5G", "80M", "VHT", "1T", "106", "32", + "FCC", "5G", "80M", "VHT", "1T", "122", "63", + "ETSI", "5G", "80M", "VHT", "1T", "122", "32", + "MKK", "5G", "80M", "VHT", "1T", "122", "32", + "FCC", "5G", "80M", "VHT", "1T", "155", "36", + "ETSI", "5G", "80M", "VHT", "1T", "155", "63", + "MKK", "5G", "80M", "VHT", "1T", "155", "63", + "FCC", "5G", "80M", "VHT", "2T", "42", "18", + "ETSI", "5G", "80M", "VHT", "2T", "42", "26", + "MKK", "5G", "80M", "VHT", "2T", "42", "28", + "FCC", "5G", "80M", "VHT", "2T", "58", "16", + "ETSI", "5G", "80M", "VHT", "2T", "58", "26", + "MKK", "5G", "80M", "VHT", "2T", "58", "28", + "FCC", "5G", "80M", "VHT", "2T", "106", "22", + "ETSI", "5G", "80M", "VHT", "2T", "106", "26", + "MKK", "5G", "80M", "VHT", "2T", "106", "32", + "FCC", "5G", "80M", "VHT", "2T", "122", "63", + "ETSI", "5G", "80M", "VHT", "2T", "122", "26", + "MKK", "5G", "80M", "VHT", "2T", "122", "32", + "FCC", "5G", "80M", "VHT", "2T", "155", "36", + "ETSI", "5G", "80M", "VHT", "2T", "155", "63", + "MKK", "5G", "80M", "VHT", "2T", "155", "63" +}; + +void +ODM_ReadAndConfig_MP_8812A_TXPWR_LMT_HM812A03( + IN PDM_ODM_T pDM_Odm + ) +{ + u4Byte i = 0; + u4Byte ArrayLen = sizeof(Array_MP_8812A_TXPWR_LMT_HM812A03)/sizeof(pu1Byte); + pu1Byte *Array = Array_MP_8812A_TXPWR_LMT_HM812A03; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ReadAndConfig_MP_8812A_TXPWR_LMT_HM812A03\n")); + + for (i = 0; i < ArrayLen; i += 7 ) + { + pu1Byte regulation = Array[i]; + pu1Byte band = Array[i+1]; + pu1Byte bandwidth = Array[i+2]; + pu1Byte rate = Array[i+3]; + pu1Byte rfPath = Array[i+4]; + pu1Byte chnl = Array[i+5]; + pu1Byte val = Array[i+6]; + + odm_ConfigBB_TXPWR_LMT_8812A(pDM_Odm, regulation, band, bandwidth, rate, rfPath, chnl, val); + } + +} + #endif // end of HWIMG_SUPPORT diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_RF.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_RF.h index 6bac7c93b69a90..23b94ab32343aa 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_RF.h +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_RF.h @@ -22,8 +22,6 @@ #ifndef __INC_MP_RF_HW_IMG_8812A_H #define __INC_MP_RF_HW_IMG_8812A_H -//static BOOLEAN CheckPositive(PDM_ODM_T pDM_Odm, const u4Byte Condition1, const u4Byte Condition2); -//static BOOLEAN CheckNegative(PDM_ODM_T pDM_Odm, const u4Byte Condition1, const u4Byte Condition2); /****************************************************************************** * RadioA.TXT @@ -33,8 +31,7 @@ void ODM_ReadAndConfig_MP_8812A_RadioA( // TC: Test Chip, MP: MP Chip IN PDM_ODM_T pDM_Odm ); -u4Byte -ODM_GetVersion_MP_8812A_RadioA(VOID); +u4Byte ODM_GetVersion_MP_8812A_RadioA(void); /****************************************************************************** * RadioB.TXT @@ -44,8 +41,7 @@ void ODM_ReadAndConfig_MP_8812A_RadioB( // TC: Test Chip, MP: MP Chip IN PDM_ODM_T pDM_Odm ); -u4Byte -ODM_GetVersion_MP_8812A_RadioB(VOID); +u4Byte ODM_GetVersion_MP_8812A_RadioB(void); /****************************************************************************** * TxPowerTrack_AP.TXT @@ -55,8 +51,7 @@ void ODM_ReadAndConfig_MP_8812A_TxPowerTrack_AP( // TC: Test Chip, MP: MP Chip IN PDM_ODM_T pDM_Odm ); -u4Byte -ODM_GetVersion_MP_8812A_TxPowerTrack_AP(VOID); +u4Byte ODM_GetVersion_MP_8812A_TxPowerTrack_AP(void); /****************************************************************************** * TxPowerTrack_PCIE.TXT @@ -66,8 +61,7 @@ void ODM_ReadAndConfig_MP_8812A_TxPowerTrack_PCIE( // TC: Test Chip, MP: MP Chip IN PDM_ODM_T pDM_Odm ); -u4Byte -ODM_GetVersion_MP_8812A_TxPowerTrack_PCIE(VOID); +u4Byte ODM_GetVersion_MP_8812A_TxPowerTrack_PCIE(void); /****************************************************************************** * TxPowerTrack_RFE3.TXT @@ -77,8 +71,7 @@ void ODM_ReadAndConfig_MP_8812A_TxPowerTrack_RFE3( // TC: Test Chip, MP: MP Chip IN PDM_ODM_T pDM_Odm ); -u4Byte -ODM_GetVersion_MP_8812A_TxPowerTrack_RFE3(VOID); +u4Byte ODM_GetVersion_MP_8812A_TxPowerTrack_RFE3(void); /****************************************************************************** * TxPowerTrack_RFE4.TXT @@ -88,8 +81,7 @@ void ODM_ReadAndConfig_MP_8812A_TxPowerTrack_RFE4( // TC: Test Chip, MP: MP Chip IN PDM_ODM_T pDM_Odm ); -u4Byte -ODM_GetVersion_MP_8812A_TxPowerTrack_RFE4(VOID); +u4Byte ODM_GetVersion_MP_8812A_TxPowerTrack_RFE4(void); /****************************************************************************** * TxPowerTrack_USB.TXT @@ -99,8 +91,7 @@ void ODM_ReadAndConfig_MP_8812A_TxPowerTrack_USB( // TC: Test Chip, MP: MP Chip IN PDM_ODM_T pDM_Odm ); -u4Byte -ODM_GetVersion_MP_8812A_TxPowerTrack_USB(VOID); +u4Byte ODM_GetVersion_MP_8812A_TxPowerTrack_USB(void); /****************************************************************************** * TXPWR_LMT.TXT @@ -110,8 +101,17 @@ void ODM_ReadAndConfig_MP_8812A_TXPWR_LMT( // TC: Test Chip, MP: MP Chip IN PDM_ODM_T pDM_Odm ); -u4Byte -ODM_GetVersion_MP_8812A_TXPWR_LMT(VOID); +u4Byte ODM_GetVersion_MP_8812A_TXPWR_LMT(void); + +/****************************************************************************** +* TXPWR_LMT_HM812A03.TXT +******************************************************************************/ + +void +ODM_ReadAndConfig_MP_8812A_TXPWR_LMT_HM812A03( // TC: Test Chip, MP: MP Chip + IN PDM_ODM_T pDM_Odm +); +u4Byte ODM_GetVersion_MP_8812A_TXPWR_LMT_HM812A03(void); #endif #endif // end of HWIMG_SUPPORT diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_BB.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_BB.c deleted file mode 100755 index 8690a42f0792d1..00000000000000 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_BB.c +++ /dev/null @@ -1,1229 +0,0 @@ -/****************************************************************************** -* -* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of version 2 of the GNU General Public License as -* published by the Free Software Foundation. -* -* This program is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along with -* this program; if not, write to the Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA -* -* -******************************************************************************/ - -#include "../odm_precomp.h" - -#if (RTL8812A_SUPPORT == 1) -static BOOLEAN -CheckCondition( - const u4Byte Condition, - const u4Byte Hex - ) -{ - u4Byte _board = (Hex & 0x000000FF); - u4Byte _interface = (Hex & 0x0000FF00) >> 8; - u4Byte _platform = (Hex & 0x00FF0000) >> 16; - u4Byte cond = Condition; - - if ( Condition == 0xCDCDCDCD ) - return TRUE; - - cond = Condition & 0x000000FF; - if ( (_board != cond) && (cond != 0xFF) ) - return FALSE; - - cond = Condition & 0x0000FF00; - cond = cond >> 8; - if ( ((_interface & cond) == 0) && (cond != 0x07) ) - return FALSE; - - cond = Condition & 0x00FF0000; - cond = cond >> 16; - if ( ((_platform & cond) == 0) && (cond != 0x0F) ) - return FALSE; - return TRUE; -} - - -/****************************************************************************** -* AGC_TAB.TXT -******************************************************************************/ -#if TESTCHIP_SUPPORT == 1 -u4Byte Array_TC_8812A_AGC_TAB[] = { - 0xFF0F07D8, 0xABCD, - 0x81C, 0xFF000001, - 0x81C, 0xFF020001, - 0x81C, 0xFF040001, - 0x81C, 0xFE060001, - 0x81C, 0xFD080001, - 0x81C, 0xFC0A0001, - 0x81C, 0xFB0C0001, - 0x81C, 0xFA0E0001, - 0x81C, 0xF9100001, - 0x81C, 0xF8120001, - 0x81C, 0xF7140001, - 0x81C, 0xF6160001, - 0x81C, 0xF5180001, - 0x81C, 0xF41A0001, - 0x81C, 0xF31C0001, - 0x81C, 0xF21E0001, - 0x81C, 0xF1200001, - 0x81C, 0xF0220001, - 0x81C, 0xEF240001, - 0x81C, 0xEE260001, - 0x81C, 0xED280001, - 0x81C, 0xEC2A0001, - 0x81C, 0xEB2C0001, - 0x81C, 0xEA2E0001, - 0x81C, 0xE9300001, - 0x81C, 0xE8320001, - 0x81C, 0xC7340001, - 0x81C, 0xC6360001, - 0x81C, 0xC5380001, - 0x81C, 0xC43A0001, - 0x81C, 0xC33C0001, - 0x81C, 0xC23E0001, - 0x81C, 0xC1400001, - 0x81C, 0xA6420001, - 0x81C, 0xA5440001, - 0x81C, 0xA4460001, - 0x81C, 0x69480001, - 0x81C, 0x684A0001, - 0x81C, 0x674C0001, - 0x81C, 0x664E0001, - 0x81C, 0x65500001, - 0x81C, 0x64520001, - 0x81C, 0x63540001, - 0x81C, 0x62560001, - 0x81C, 0x48580001, - 0x81C, 0x475A0001, - 0x81C, 0x465C0001, - 0x81C, 0x455E0001, - 0x81C, 0x44600001, - 0x81C, 0x43620001, - 0x81C, 0x42640001, - 0x81C, 0x41660001, - 0x81C, 0x41680001, - 0x81C, 0x416A0001, - 0x81C, 0x416C0001, - 0x81C, 0x416E0001, - 0x81C, 0x41700001, - 0x81C, 0x41720001, - 0x81C, 0x41740001, - 0x81C, 0x41760001, - 0x81C, 0x41780001, - 0x81C, 0x417A0001, - 0x81C, 0x417C0001, - 0x81C, 0x417E0001, - 0xCDCDCDCD, 0xCDCD, - 0x81C, 0xFF000001, - 0x81C, 0xFF020001, - 0x81C, 0xFF040001, - 0x81C, 0xFF060001, - 0x81C, 0xFF080001, - 0x81C, 0xFE0A0001, - 0x81C, 0xFD0C0001, - 0x81C, 0xFC0E0001, - 0x81C, 0xFB100001, - 0x81C, 0xFA120001, - 0x81C, 0xF9140001, - 0x81C, 0xF8160001, - 0x81C, 0xF7180001, - 0x81C, 0xF61A0001, - 0x81C, 0xF51C0001, - 0x81C, 0xF41E0001, - 0x81C, 0xF3200001, - 0x81C, 0xF2220001, - 0x81C, 0xF1240001, - 0x81C, 0xF0260001, - 0x81C, 0xEF280001, - 0x81C, 0xEE2A0001, - 0x81C, 0xED2C0001, - 0x81C, 0xEC2E0001, - 0x81C, 0xEB300001, - 0x81C, 0xEA320001, - 0x81C, 0xE9340001, - 0x81C, 0xE8360001, - 0x81C, 0xE7380001, - 0x81C, 0xE63A0001, - 0x81C, 0xE53C0001, - 0x81C, 0xC73E0001, - 0x81C, 0xC6400001, - 0x81C, 0xC5420001, - 0x81C, 0xC4440001, - 0x81C, 0xC3460001, - 0x81C, 0xC2480001, - 0x81C, 0xC14A0001, - 0x81C, 0xA74C0001, - 0x81C, 0xA64E0001, - 0x81C, 0xA5500001, - 0x81C, 0xA4520001, - 0x81C, 0xA3540001, - 0x81C, 0xA2560001, - 0x81C, 0xA1580001, - 0x81C, 0x675A0001, - 0x81C, 0x665C0001, - 0x81C, 0x655E0001, - 0x81C, 0x64600001, - 0x81C, 0x63620001, - 0x81C, 0x48640001, - 0x81C, 0x47660001, - 0x81C, 0x46680001, - 0x81C, 0x456A0001, - 0x81C, 0x446C0001, - 0x81C, 0x436E0001, - 0x81C, 0x42700001, - 0x81C, 0x41720001, - 0x81C, 0x41740001, - 0x81C, 0x41760001, - 0x81C, 0x41780001, - 0x81C, 0x417A0001, - 0x81C, 0x417C0001, - 0x81C, 0x417E0001, - 0xFF0F07D8, 0xDEAD, - 0xFF0F0780, 0xABCD, - 0x81C, 0xFC800001, - 0x81C, 0xFB820001, - 0x81C, 0xFA840001, - 0x81C, 0xF9860001, - 0x81C, 0xF8880001, - 0x81C, 0xF78A0001, - 0x81C, 0xF68C0001, - 0x81C, 0xF58E0001, - 0x81C, 0xF4900001, - 0x81C, 0xF3920001, - 0x81C, 0xF2940001, - 0x81C, 0xF1960001, - 0x81C, 0xF0980001, - 0x81C, 0xEF9A0001, - 0x81C, 0xEE9C0001, - 0x81C, 0xED9E0001, - 0x81C, 0xECA00001, - 0x81C, 0xEBA20001, - 0x81C, 0xEAA40001, - 0x81C, 0xE9A60001, - 0x81C, 0xE8A80001, - 0x81C, 0xE7AA0001, - 0x81C, 0xE6AC0001, - 0x81C, 0xE5AE0001, - 0x81C, 0xE4B00001, - 0x81C, 0xE3B20001, - 0x81C, 0xA8B40001, - 0x81C, 0xA7B60001, - 0x81C, 0xA6B80001, - 0x81C, 0xA5BA0001, - 0x81C, 0xA4BC0001, - 0x81C, 0xA3BE0001, - 0x81C, 0xA2C00001, - 0x81C, 0xA1C20001, - 0x81C, 0x68C40001, - 0x81C, 0x67C60001, - 0x81C, 0x66C80001, - 0x81C, 0x65CA0001, - 0x81C, 0x64CC0001, - 0x81C, 0x47CE0001, - 0x81C, 0x46D00001, - 0x81C, 0x45D20001, - 0x81C, 0x44D40001, - 0x81C, 0x43D60001, - 0x81C, 0x42D80001, - 0x81C, 0x08DA0001, - 0x81C, 0x07DC0001, - 0x81C, 0x06DE0001, - 0x81C, 0x05E00001, - 0x81C, 0x04E20001, - 0x81C, 0x03E40001, - 0x81C, 0x02E60001, - 0x81C, 0x01E80001, - 0x81C, 0x01EA0001, - 0x81C, 0x01EC0001, - 0x81C, 0x01EE0001, - 0x81C, 0x01F00001, - 0x81C, 0x01F20001, - 0x81C, 0x01F40001, - 0x81C, 0x01F60001, - 0x81C, 0x01F80001, - 0x81C, 0x01FA0001, - 0x81C, 0x01FC0001, - 0x81C, 0x01FE0001, - 0xFF0F07C0, 0xCDEF, - 0x81C, 0xFC800001, - 0x81C, 0xFB820001, - 0x81C, 0xFA840001, - 0x81C, 0xF9860001, - 0x81C, 0xF8880001, - 0x81C, 0xF78A0001, - 0x81C, 0xF68C0001, - 0x81C, 0xF58E0001, - 0x81C, 0xF4900001, - 0x81C, 0xF3920001, - 0x81C, 0xF2940001, - 0x81C, 0xF1960001, - 0x81C, 0xF0980001, - 0x81C, 0xEF9A0001, - 0x81C, 0xEE9C0001, - 0x81C, 0xED9E0001, - 0x81C, 0xECA00001, - 0x81C, 0xEBA20001, - 0x81C, 0xEAA40001, - 0x81C, 0xE9A60001, - 0x81C, 0xE8A80001, - 0x81C, 0xE7AA0001, - 0x81C, 0xE6AC0001, - 0x81C, 0xE5AE0001, - 0x81C, 0xE4B00001, - 0x81C, 0xE3B20001, - 0x81C, 0xA8B40001, - 0x81C, 0xA7B60001, - 0x81C, 0xA6B80001, - 0x81C, 0xA5BA0001, - 0x81C, 0xA4BC0001, - 0x81C, 0xA3BE0001, - 0x81C, 0xA2C00001, - 0x81C, 0xA1C20001, - 0x81C, 0x68C40001, - 0x81C, 0x67C60001, - 0x81C, 0x66C80001, - 0x81C, 0x65CA0001, - 0x81C, 0x64CC0001, - 0x81C, 0x47CE0001, - 0x81C, 0x46D00001, - 0x81C, 0x45D20001, - 0x81C, 0x44D40001, - 0x81C, 0x43D60001, - 0x81C, 0x42D80001, - 0x81C, 0x08DA0001, - 0x81C, 0x07DC0001, - 0x81C, 0x06DE0001, - 0x81C, 0x05E00001, - 0x81C, 0x04E20001, - 0x81C, 0x03E40001, - 0x81C, 0x02E60001, - 0x81C, 0x01E80001, - 0x81C, 0x01EA0001, - 0x81C, 0x01EC0001, - 0x81C, 0x01EE0001, - 0x81C, 0x01F00001, - 0x81C, 0x01F20001, - 0x81C, 0x01F40001, - 0x81C, 0x01F60001, - 0x81C, 0x01F80001, - 0x81C, 0x01FA0001, - 0x81C, 0x01FC0001, - 0x81C, 0x01FE0001, - 0xFF0F07D8, 0xCDEF, - 0x81C, 0xFC800001, - 0x81C, 0xFB820001, - 0x81C, 0xFA840001, - 0x81C, 0xF9860001, - 0x81C, 0xF8880001, - 0x81C, 0xF78A0001, - 0x81C, 0xF68C0001, - 0x81C, 0xF58E0001, - 0x81C, 0xF4900001, - 0x81C, 0xF3920001, - 0x81C, 0xF2940001, - 0x81C, 0xF1960001, - 0x81C, 0xF0980001, - 0x81C, 0xEF9A0001, - 0x81C, 0xEE9C0001, - 0x81C, 0xED9E0001, - 0x81C, 0xECA00001, - 0x81C, 0xEBA20001, - 0x81C, 0xEAA40001, - 0x81C, 0xE9A60001, - 0x81C, 0xE8A80001, - 0x81C, 0xE7AA0001, - 0x81C, 0xE6AC0001, - 0x81C, 0xE5AE0001, - 0x81C, 0xE4B00001, - 0x81C, 0xE3B20001, - 0x81C, 0xA8B40001, - 0x81C, 0xA7B60001, - 0x81C, 0xA6B80001, - 0x81C, 0xA5BA0001, - 0x81C, 0xA4BC0001, - 0x81C, 0xA3BE0001, - 0x81C, 0xA2C00001, - 0x81C, 0xA1C20001, - 0x81C, 0x68C40001, - 0x81C, 0x67C60001, - 0x81C, 0x66C80001, - 0x81C, 0x65CA0001, - 0x81C, 0x64CC0001, - 0x81C, 0x47CE0001, - 0x81C, 0x46D00001, - 0x81C, 0x45D20001, - 0x81C, 0x44D40001, - 0x81C, 0x43D60001, - 0x81C, 0x42D80001, - 0x81C, 0x08DA0001, - 0x81C, 0x07DC0001, - 0x81C, 0x06DE0001, - 0x81C, 0x05E00001, - 0x81C, 0x04E20001, - 0x81C, 0x03E40001, - 0x81C, 0x02E60001, - 0x81C, 0x01E80001, - 0x81C, 0x01EA0001, - 0x81C, 0x01EC0001, - 0x81C, 0x01EE0001, - 0x81C, 0x01F00001, - 0x81C, 0x01F20001, - 0x81C, 0x01F40001, - 0x81C, 0x01F60001, - 0x81C, 0x01F80001, - 0x81C, 0x01FA0001, - 0x81C, 0x01FC0001, - 0x81C, 0x01FE0001, - 0xCDCDCDCD, 0xCDCD, - 0x81C, 0xFF800001, - 0x81C, 0xFF820001, - 0x81C, 0xFF840001, - 0x81C, 0xFE860001, - 0x81C, 0xFD880001, - 0x81C, 0xFC8A0001, - 0x81C, 0xFB8C0001, - 0x81C, 0xFA8E0001, - 0x81C, 0xF9900001, - 0x81C, 0xF8920001, - 0x81C, 0xF7940001, - 0x81C, 0xF6960001, - 0x81C, 0xF5980001, - 0x81C, 0xF49A0001, - 0x81C, 0xF39C0001, - 0x81C, 0xF29E0001, - 0x81C, 0xF1A00001, - 0x81C, 0xF0A20001, - 0x81C, 0xEFA40001, - 0x81C, 0xEEA60001, - 0x81C, 0xEDA80001, - 0x81C, 0xECAA0001, - 0x81C, 0xEBAC0001, - 0x81C, 0xEAAE0001, - 0x81C, 0xE9B00001, - 0x81C, 0xE8B20001, - 0x81C, 0xE7B40001, - 0x81C, 0xE6B60001, - 0x81C, 0xE5B80001, - 0x81C, 0xE4BA0001, - 0x81C, 0xE3BC0001, - 0x81C, 0xA8BE0001, - 0x81C, 0xA7C00001, - 0x81C, 0xA6C20001, - 0x81C, 0xA5C40001, - 0x81C, 0xA4C60001, - 0x81C, 0xA3C80001, - 0x81C, 0xA2CA0001, - 0x81C, 0xA1CC0001, - 0x81C, 0x68CE0001, - 0x81C, 0x67D00001, - 0x81C, 0x66D20001, - 0x81C, 0x65D40001, - 0x81C, 0x64D60001, - 0x81C, 0x47D80001, - 0x81C, 0x46DA0001, - 0x81C, 0x45DC0001, - 0x81C, 0x44DE0001, - 0x81C, 0x43E00001, - 0x81C, 0x42E20001, - 0x81C, 0x08E40001, - 0x81C, 0x07E60001, - 0x81C, 0x06E80001, - 0x81C, 0x05EA0001, - 0x81C, 0x04EC0001, - 0x81C, 0x03EE0001, - 0x81C, 0x02F00001, - 0x81C, 0x01F20001, - 0x81C, 0x01F40001, - 0x81C, 0x01F60001, - 0x81C, 0x01F80001, - 0x81C, 0x01FA0001, - 0x81C, 0x01FC0001, - 0x81C, 0x01FE0001, - 0xFF0F0780, 0xDEAD, - 0xC50, 0x00000022, - 0xC50, 0x00000020, - 0xE50, 0x00000022, - 0xE50, 0x00000020, - -}; -#else -u4Byte Array_TC_8812A_AGC_TAB[] = { - 0x0, }; - -#endif - -void -ODM_ReadAndConfig_TC_8812A_AGC_TAB( - IN PDM_ODM_T pDM_Odm - ) -{ - #define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0) - - u4Byte hex = 0; - u4Byte i = 0; - u2Byte count = 0; - pu4Byte ptr_array = NULL; - u1Byte platform = pDM_Odm->SupportPlatform; - u1Byte _interface = pDM_Odm->SupportInterface; - u1Byte board = pDM_Odm->BoardType; - u4Byte ArrayLen = sizeof(Array_TC_8812A_AGC_TAB)/sizeof(u4Byte); - pu4Byte Array = Array_TC_8812A_AGC_TAB; - - - hex += board; - hex += _interface << 8; - hex += platform << 16; - hex += 0xFF000000; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_TC_8812A_AGC_TAB, hex = 0x%X\n", hex)); - - for (i = 0; i < ArrayLen; i += 2 ) - { - u4Byte v1 = Array[i]; - u4Byte v2 = Array[i+1]; - - // This (offset, data) pair meets the condition. - if ( v1 < 0xCDCDCDCD ) - { - odm_ConfigBB_AGC_8812A(pDM_Odm, v1, bMaskDWord, v2); - continue; - } - else - { // This line is the start line of branch. - if ( !CheckCondition(Array[i], hex) ) - { // Discard the following (offset, data) pairs. - READ_NEXT_PAIR(v1, v2, i); - while (v2 != 0xDEAD && - v2 != 0xCDEF && - v2 != 0xCDCD && i < ArrayLen -2) - { - READ_NEXT_PAIR(v1, v2, i); - } - i -= 2; // prevent from for-loop += 2 - } - else // Configure matched pairs and skip to end of if-else. - { - READ_NEXT_PAIR(v1, v2, i); - while (v2 != 0xDEAD && - v2 != 0xCDEF && - v2 != 0xCDCD && i < ArrayLen -2) - { - odm_ConfigBB_AGC_8812A(pDM_Odm, v1, bMaskDWord, v2); - READ_NEXT_PAIR(v1, v2, i); - } - - while (v2 != 0xDEAD && i < ArrayLen -2) - { - READ_NEXT_PAIR(v1, v2, i); - } - - } - } - } - -} - -/****************************************************************************** -* AGC_TAB_DIFF.TXT -******************************************************************************/ - -u4Byte Array_TC_8812A_AGC_TAB_DIFF_LB[] = { - 0xFF0F0780, 0xABCD, - 0x81C, 0x47CE0001, - 0x81C, 0x46D00001, - 0x81C, 0x45D20001, - 0x81C, 0x44D40001, - 0x81C, 0x43D60001, - 0x81C, 0x42D80001, - 0x81C, 0x08DA0001, - 0x81C, 0x07DC0001, - 0x81C, 0x06DE0001, - 0x81C, 0x05E00001, - 0x81C, 0x04E20001, - 0x81C, 0x03E40001, - 0x81C, 0x02E60001, - 0xFF0F07C0, 0xCDEF, - 0x81C, 0x47CE0001, - 0x81C, 0x46D00001, - 0x81C, 0x45D20001, - 0x81C, 0x44D40001, - 0x81C, 0x43D60001, - 0x81C, 0x42D80001, - 0x81C, 0x08DA0001, - 0x81C, 0x07DC0001, - 0x81C, 0x06DE0001, - 0x81C, 0x05E00001, - 0x81C, 0x04E20001, - 0x81C, 0x03E40001, - 0x81C, 0x02E60001, - 0xFF0F07D8, 0xCDEF, - 0x81C, 0x47CE0001, - 0x81C, 0x46D00001, - 0x81C, 0x45D20001, - 0x81C, 0x44D40001, - 0x81C, 0x43D60001, - 0x81C, 0x42D80001, - 0x81C, 0x08DA0001, - 0x81C, 0x07DC0001, - 0x81C, 0x06DE0001, - 0x81C, 0x05E00001, - 0x81C, 0x04E20001, - 0x81C, 0x03E40001, - 0x81C, 0x02E60001, - 0xCDCDCDCD, 0xCDCD, - 0x81C, 0x47D80001, - 0x81C, 0x46DA0001, - 0x81C, 0x45DC0001, - 0x81C, 0x44DE0001, - 0x81C, 0x43E00001, - 0x81C, 0x42E20001, - 0x81C, 0x08E40001, - 0x81C, 0x07E60001, - 0x81C, 0x06E80001, - 0x81C, 0x05EA0001, - 0x81C, 0x04EC0001, - 0x81C, 0x03EE0001, - 0x81C, 0x02F00001, - 0xFF0F0780, 0xDEAD, -}; - -u4Byte Array_TC_8812A_AGC_TAB_DIFF_HB[] = { - 0xFF0F0780, 0xABCD, - 0x81C, 0x45CE0001, - 0x81C, 0x44D00001, - 0x81C, 0x43D20001, - 0x81C, 0x42D40001, - 0x81C, 0x08D60001, - 0x81C, 0x07D80001, - 0x81C, 0x06DA0001, - 0x81C, 0x05DC0001, - 0x81C, 0x04DE0001, - 0x81C, 0x03E00001, - 0x81C, 0x02E20001, - 0x81C, 0x01E40001, - 0x81C, 0x01E60001, - 0xFF0F07C0, 0xCDEF, - 0x81C, 0x45CE0001, - 0x81C, 0x44D00001, - 0x81C, 0x43D20001, - 0x81C, 0x42D40001, - 0x81C, 0x08D60001, - 0x81C, 0x07D80001, - 0x81C, 0x06DA0001, - 0x81C, 0x05DC0001, - 0x81C, 0x04DE0001, - 0x81C, 0x03E00001, - 0x81C, 0x02E20001, - 0x81C, 0x01E40001, - 0x81C, 0x01E60001, - 0xFF0F07D8, 0xCDEF, - 0x81C, 0x45CE0001, - 0x81C, 0x44D00001, - 0x81C, 0x43D20001, - 0x81C, 0x42D40001, - 0x81C, 0x08D60001, - 0x81C, 0x07D80001, - 0x81C, 0x06DA0001, - 0x81C, 0x05DC0001, - 0x81C, 0x04DE0001, - 0x81C, 0x03E00001, - 0x81C, 0x02E20001, - 0x81C, 0x01E40001, - 0x81C, 0x01E60001, - 0xCDCDCDCD, 0xCDCD, - 0x81C, 0x45D80001, - 0x81C, 0x44DA0001, - 0x81C, 0x43DC0001, - 0x81C, 0x42DE0001, - 0x81C, 0x08E00001, - 0x81C, 0x07E20001, - 0x81C, 0x06E40001, - 0x81C, 0x05E60001, - 0x81C, 0x04E80001, - 0x81C, 0x03EA0001, - 0x81C, 0x02EC0001, - 0x81C, 0x01EE0001, - 0x81C, 0x01F00001, - 0xFF0F0780, 0xDEAD, -}; - -void -ODM_ReadAndConfig_TC_8812A_AGC_TAB_DIFF( - IN PDM_ODM_T pDM_Odm, - IN u4Byte Array[], - IN u4Byte ArrayLen - ) -{ - #define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0) - - u4Byte hex = 0; - u4Byte i = 0; - u2Byte count = 0; - pu4Byte ptr_array = NULL; - u1Byte platform = pDM_Odm->SupportPlatform; - u1Byte _interface = pDM_Odm->SupportInterface; - u1Byte board = pDM_Odm->BoardType; - - hex += board; - hex += _interface << 8; - hex += platform << 16; - hex += 0xFF000000; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_TC_8812A_AGC_TAB_DIFF, hex = 0x%X\n", hex)); - - for (i = 0; i < ArrayLen; i += 2 ) - { - u4Byte v1 = Array[i]; - u4Byte v2 = Array[i+1]; - - // This (offset, data) pair meets the condition. - if ( v1 < 0xCDCDCDCD ) - { - odm_ConfigBB_AGC_8812A(pDM_Odm, v1, bMaskDWord, v2); - continue; - } - else - { // This line is the start line of branch. - if ( !CheckCondition(Array[i], hex) ) - { // Discard the following (offset, data) pairs. - READ_NEXT_PAIR(v1, v2, i); - while (v2 != 0xDEAD && - v2 != 0xCDEF && - v2 != 0xCDCD && i < ArrayLen -2) - { - READ_NEXT_PAIR(v1, v2, i); - } - i -= 2; // prevent from for-loop += 2 - } - else // Configure matched pairs and skip to end of if-else. - { - READ_NEXT_PAIR(v1, v2, i); - while (v2 != 0xDEAD && - v2 != 0xCDEF && - v2 != 0xCDCD && i < ArrayLen -2) - { - odm_ConfigBB_AGC_8812A(pDM_Odm, v1, bMaskDWord, v2); - READ_NEXT_PAIR(v1, v2, i); - } - - while (v2 != 0xDEAD && i < ArrayLen -2) - { - READ_NEXT_PAIR(v1, v2, i); - } - - } - } - } - -} - -/****************************************************************************** -* PHY_REG.TXT -******************************************************************************/ -#if TESTCHIP_SUPPORT == 1 - -u4Byte Array_TC_8812A_PHY_REG[] = { - 0x800, 0x8020D010, - 0x804, 0x080112E0, - 0x808, 0x0E028233, - 0x80C, 0x12131113, - 0x810, 0x20101263, - 0x814, 0x020C3D10, - 0x818, 0x03A00385, - 0x820, 0x00000000, - 0x824, 0x00030FE0, - 0x828, 0x00000000, - 0x82C, 0x002083DD, - 0x830, 0x2AAA6C86, - 0x834, 0x0037A706, - 0x838, 0x06C89B44, - 0x83C, 0x0000095B, - 0x840, 0xC0000001, - 0x844, 0x40003CDE, - 0x848, 0x6210FF8B, - 0x84C, 0x6CFDFFB8, - 0x850, 0x28874706, - 0x854, 0x0001520C, - 0x858, 0x8060E000, - 0x85C, 0x74210168, - 0x860, 0x6929C321, - 0x864, 0x796A7432, - 0x868, 0x8CA7A314, - 0x86C, 0x338C2878, - 0x870, 0x03333333, - 0x874, 0x31602C2E, - 0x878, 0x00003152, - 0x87C, 0x000FC000, - 0x8A0, 0x00000013, - 0x8A4, 0x7F7F7F7F, - 0x8A8, 0xA202033E, - 0x8AC, 0x0FF0FA0A, - 0x8B0, 0x00000600, - 0x8B4, 0x000FC080, - 0x8B8, 0x6C0057FF, - 0x8BC, 0x4CA520A3, - 0x8C0, 0x27F00020, - 0x8C4, 0x00000000, - 0x8C8, 0x00013169, - 0x8CC, 0x08248492, - 0x8D0, 0x0000B800, - 0x8DC, 0x00000000, - 0x8D4, 0x940008A0, - 0x8D8, 0x290B1612, - 0x8F8, 0x400002C0, - 0x8FC, 0x00000000, - 0xFF0F07D8, 0xABCD, - 0x900, 0x00000701, - 0xCDCDCDCD, 0xCDCD, - 0x900, 0x00000700, - 0xFF0F07D8, 0xDEAD, - 0x90C, 0x00000000, - 0x910, 0x0000FC00, - 0x914, 0x00000404, - 0x918, 0x1C1028C0, - 0x91C, 0x64B11A1C, - 0x920, 0xE0767233, - 0x924, 0x055AA500, - 0x928, 0x00000004, - 0x92C, 0xFFFE0000, - 0x930, 0xFFFFFFFE, - 0x934, 0x001FFFFF, - 0x960, 0x00000000, - 0x964, 0x00000000, - 0x968, 0x00000000, - 0x96C, 0x00000000, - 0x970, 0x801FFFFF, - 0x978, 0x00000000, - 0x97C, 0x00000000, - 0x980, 0x00000000, - 0x984, 0x00000000, - 0x988, 0x00000000, - 0x9A4, 0x00080080, - 0x9A8, 0x00000000, - 0x9AC, 0x00000000, - 0x9B0, 0x01081008, - 0x9B4, 0x00000000, - 0x9B8, 0x01081008, - 0x9BC, 0x01081008, - 0x9D0, 0x00000000, - 0x9D4, 0x00000000, - 0x9D8, 0x00000000, - 0x9DC, 0x00000000, - 0x9E4, 0x00000002, - 0x9E8, 0x000002D4, - 0xA00, 0x00D047C8, - 0xA04, 0x01FF000C, - 0xA08, 0x8C8A8300, - 0xA0C, 0x2E7F000F, - 0xA10, 0x9500BB78, - 0xA14, 0x11144028, - 0xA18, 0x00881117, - 0xA1C, 0x89140F00, - 0xA20, 0x1A1B0000, - 0xA24, 0x090E1317, - 0xA28, 0x00000204, - 0xA2C, 0x00900000, - 0xA70, 0x101FFF00, - 0xA74, 0x00000008, - 0xA78, 0x00000900, - 0xA7C, 0x225B0606, - 0xA80, 0x218075B2, - 0xA84, 0x001F8C80, - 0xB00, 0x03100000, - 0xB04, 0x0000B000, - 0xB08, 0xAE0201EB, - 0xB0C, 0x01003207, - 0xB10, 0x00009807, - 0xB14, 0x01000000, - 0xB18, 0x00000002, - 0xB1C, 0x00000002, - 0xB20, 0x0000001F, - 0xB24, 0x03020100, - 0xB28, 0x07060504, - 0xB2C, 0x0B0A0908, - 0xB30, 0x0F0E0D0C, - 0xB34, 0x13121110, - 0xB38, 0x17161514, - 0xB3C, 0x0000003A, - 0xB40, 0x00000000, - 0xB44, 0x00000000, - 0xB48, 0x13000032, - 0xB4C, 0x48080000, - 0xB50, 0x00000000, - 0xB54, 0x00000000, - 0xB58, 0x00000000, - 0xB5C, 0x00000000, - 0xC00, 0x00000007, - 0xC04, 0x00042020, - 0xC08, 0x80410231, - 0xC0C, 0x00000000, - 0xC10, 0x00000100, - 0xC14, 0x01000000, - 0xC1C, 0x40000003, - 0xC20, 0x12121212, - 0xC24, 0x12121212, - 0xC28, 0x12121212, - 0xC2C, 0x12121212, - 0xC30, 0x12121212, - 0xC34, 0x12121212, - 0xC38, 0x12121212, - 0xC3C, 0x12121212, - 0xC40, 0x12121212, - 0xC44, 0x12121212, - 0xC48, 0x12121212, - 0xC4C, 0x12121212, - 0xC50, 0x00000020, - 0xC54, 0x0008121C, - 0xC58, 0x30000C1C, - 0xC5C, 0x00000058, - 0xC60, 0x34344443, - 0xC64, 0x07003333, - 0xC68, 0x59791979, - 0xC6C, 0x59795979, - 0xC70, 0x19795979, - 0xC74, 0x19795979, - 0xC78, 0x19791979, - 0xC7C, 0x19791979, - 0xC80, 0x19791979, - 0xC84, 0x19791979, - 0xC94, 0x0100005C, - 0xC98, 0x00000000, - 0xC9C, 0x00000000, - 0xCA0, 0x00000029, - 0xCA4, 0x08040201, - 0xCA8, 0x80402010, - 0xFF0F0740, 0xABCD, - 0xCB0, 0x77547717, - 0xFF0F07C0, 0xCDEF, - 0xCB0, 0x77547717, - 0xFF0F07D8, 0xCDEF, - 0xCB0, 0x54547710, - 0xCDCDCDCD, 0xCDCD, - 0xCB0, 0x77547777, - 0xFF0F0740, 0xDEAD, - 0xCB4, 0x00000077, - 0xCB8, 0x00508242, - 0xE00, 0x00000007, - 0xE04, 0x00042020, - 0xE08, 0x80410231, - 0xE0C, 0x00000000, - 0xE10, 0x00000100, - 0xE14, 0x01000000, - 0xE1C, 0x40000003, - 0xE20, 0x12121212, - 0xE24, 0x12121212, - 0xE28, 0x12121212, - 0xE2C, 0x12121212, - 0xE30, 0x12121212, - 0xE34, 0x12121212, - 0xE38, 0x12121212, - 0xE3C, 0x12121212, - 0xE40, 0x12121212, - 0xE44, 0x12121212, - 0xE48, 0x12121212, - 0xE4C, 0x12121212, - 0xE50, 0x00000020, - 0xE54, 0x0008121C, - 0xE58, 0x30000C1C, - 0xE5C, 0x00000058, - 0xE60, 0x34344443, - 0xE64, 0x07003333, - 0xE68, 0x59791979, - 0xE6C, 0x59795979, - 0xE70, 0x19795979, - 0xE74, 0x19795979, - 0xE78, 0x19791979, - 0xE7C, 0x19791979, - 0xE80, 0x19791979, - 0xE84, 0x19791979, - 0xE94, 0x0100005C, - 0xE98, 0x00000000, - 0xE9C, 0x00000000, - 0xEA0, 0x00000029, - 0xEA4, 0x08040201, - 0xEA8, 0x80402010, - 0xFF0F0740, 0xABCD, - 0xEB0, 0x77547717, - 0xFF0F07C0, 0xCDEF, - 0xEB0, 0x77547717, - 0xFF0F07D8, 0xCDEF, - 0xEB0, 0x54547710, - 0xCDCDCDCD, 0xCDCD, - 0xEB0, 0x77547777, - 0xFF0F0740, 0xDEAD, - 0xEB4, 0x00000077, - 0xEB8, 0x00508242, - -}; -#else -u4Byte Array_TC_8812A_PHY_REG[] = { - 0x0, }; - -#endif - -void -ODM_ReadAndConfig_TC_8812A_PHY_REG( - IN PDM_ODM_T pDM_Odm - ) -{ - #define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0) - - u4Byte hex = 0; - u4Byte i = 0; - u2Byte count = 0; - pu4Byte ptr_array = NULL; - u1Byte platform = pDM_Odm->SupportPlatform; - u1Byte _interface = pDM_Odm->SupportInterface; - u1Byte board = pDM_Odm->BoardType; - u4Byte ArrayLen = sizeof(Array_TC_8812A_PHY_REG)/sizeof(u4Byte); - pu4Byte Array = Array_TC_8812A_PHY_REG; - - - hex += board; - hex += _interface << 8; - hex += platform << 16; - hex += 0xFF000000; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_TC_8812A_PHY_REG, hex = 0x%X\n", hex)); - - for (i = 0; i < ArrayLen; i += 2 ) - { - u4Byte v1 = Array[i]; - u4Byte v2 = Array[i+1]; - - // This (offset, data) pair meets the condition. - if ( v1 < 0xCDCDCDCD ) - { - odm_ConfigBB_PHY_8812A(pDM_Odm, v1, bMaskDWord, v2); - continue; - } - else - { // This line is the start line of branch. - if ( !CheckCondition(Array[i], hex) ) - { // Discard the following (offset, data) pairs. - READ_NEXT_PAIR(v1, v2, i); - while (v2 != 0xDEAD && - v2 != 0xCDEF && - v2 != 0xCDCD && i < ArrayLen -2) - { - READ_NEXT_PAIR(v1, v2, i); - } - i -= 2; // prevent from for-loop += 2 - } - else // Configure matched pairs and skip to end of if-else. - { - READ_NEXT_PAIR(v1, v2, i); - while (v2 != 0xDEAD && - v2 != 0xCDEF && - v2 != 0xCDCD && i < ArrayLen -2) - { - odm_ConfigBB_PHY_8812A(pDM_Odm, v1, bMaskDWord, v2); - READ_NEXT_PAIR(v1, v2, i); - } - - while (v2 != 0xDEAD && i < ArrayLen -2) - { - READ_NEXT_PAIR(v1, v2, i); - } - - } - } - } - -} - -/****************************************************************************** -* PHY_REG_MP.TXT -******************************************************************************/ - -u4Byte Array_TC_8812A_PHY_REG_MP[] = { - 0x800, 0x8020D410, - 0x830, 0x2EAA8EB6, - 0xC90, 0x01E00000, - -}; - -void -ODM_ReadAndConfig_TC_8812A_PHY_REG_MP( - IN PDM_ODM_T pDM_Odm - ) -{ - #define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0) - - u4Byte hex = 0; - u4Byte i = 0; - u2Byte count = 0; - pu4Byte ptr_array = NULL; - u1Byte platform = pDM_Odm->SupportPlatform; - u1Byte _interface = pDM_Odm->SupportInterface; - u1Byte board = pDM_Odm->BoardType; - u4Byte ArrayLen = sizeof(Array_TC_8812A_PHY_REG_MP)/sizeof(u4Byte); - pu4Byte Array = Array_TC_8812A_PHY_REG_MP; - - - hex += board; - hex += _interface << 8; - hex += platform << 16; - hex += 0xFF000000; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_TC_8812A_PHY_REG_MP, hex = 0x%X\n", hex)); - - for (i = 0; i < ArrayLen; i += 2 ) - { - u4Byte v1 = Array[i]; - u4Byte v2 = Array[i+1]; - - // This (offset, data) pair meets the condition. - if ( v1 < 0xCDCDCDCD ) - { - odm_ConfigBB_PHY_8812A(pDM_Odm, v1, bMaskDWord, v2); - continue; - } - else - { // This line is the start line of branch. - if ( !CheckCondition(Array[i], hex) ) - { // Discard the following (offset, data) pairs. - READ_NEXT_PAIR(v1, v2, i); - while (v2 != 0xDEAD && - v2 != 0xCDEF && - v2 != 0xCDCD && i < ArrayLen -2) - { - READ_NEXT_PAIR(v1, v2, i); - } - i -= 2; // prevent from for-loop += 2 - } - else // Configure matched pairs and skip to end of if-else. - { - READ_NEXT_PAIR(v1, v2, i); - while (v2 != 0xDEAD && - v2 != 0xCDEF && - v2 != 0xCDCD && i < ArrayLen -2) - { - odm_ConfigBB_PHY_8812A(pDM_Odm, v1, bMaskDWord, v2); - READ_NEXT_PAIR(v1, v2, i); - } - - while (v2 != 0xDEAD && i < ArrayLen -2) - { - READ_NEXT_PAIR(v1, v2, i); - } - - } - } - } - -} - -/****************************************************************************** -* PHY_REG_PG.TXT -******************************************************************************/ -#if TESTCHIP_SUPPORT == 1 -u4Byte Array_TC_8812A_PHY_REG_PG[] = { - 0, 0, 0, 0x00000c20, 0xffffffff, 0x34363840, - 0, 0, 0, 0x00000c24, 0xffffffff, 0x42424444, - 0, 0, 0, 0x00000c28, 0xffffffff, 0x30323638, - 0, 0, 0, 0x00000c2c, 0xffffffff, 0x40424444, - 0, 0, 0, 0x00000c30, 0xffffffff, 0x28303236, - 0, 0, 1, 0x00000c34, 0xffffffff, 0x38404242, - 0, 0, 1, 0x00000c38, 0xffffffff, 0x26283034, - 0, 1, 0, 0x00000e20, 0xffffffff, 0x34363840, - 0, 1, 0, 0x00000e24, 0xffffffff, 0x42424444, - 0, 1, 0, 0x00000e28, 0xffffffff, 0x30323638, - 0, 1, 0, 0x00000e2c, 0xffffffff, 0x40424444, - 0, 1, 0, 0x00000e30, 0xffffffff, 0x28303236, - 0, 1, 1, 0x00000e34, 0xffffffff, 0x38404242, - 0, 1, 1, 0x00000e38, 0xffffffff, 0x26283034, - 1, 0, 0, 0x00000c24, 0xffffffff, 0x42424444, - 1, 0, 0, 0x00000c28, 0xffffffff, 0x30323640, - 1, 0, 0, 0x00000c2c, 0xffffffff, 0x40424444, - 1, 0, 0, 0x00000c30, 0xffffffff, 0x28303236, - 1, 0, 1, 0x00000c34, 0xffffffff, 0x38404242, - 1, 0, 1, 0x00000c38, 0xffffffff, 0x26283034, - 1, 0, 0, 0x00000c3c, 0xffffffff, 0x40424444, - 1, 0, 0, 0x00000c40, 0xffffffff, 0x28303236, - 1, 0, 0, 0x00000c44, 0xffffffff, 0x42422426, - 1, 0, 1, 0x00000c48, 0xffffffff, 0x30343840, - 1, 0, 1, 0x00000c4c, 0xffffffff, 0x22242628, - 1, 1, 0, 0x00000e24, 0xffffffff, 0x42424444, - 1, 1, 0, 0x00000e28, 0xffffffff, 0x30323640, - 1, 1, 0, 0x00000e2c, 0xffffffff, 0x40424444, - 1, 1, 0, 0x00000e30, 0xffffffff, 0x28303236, - 1, 1, 1, 0x00000e34, 0xffffffff, 0x38404242, - 1, 1, 1, 0x00000e38, 0xffffffff, 0x26283034, - 1, 1, 0, 0x00000e3c, 0xffffffff, 0x40424444, - 1, 1, 0, 0x00000e40, 0xffffffff, 0x28303236, - 1, 1, 0, 0x00000e44, 0xffffffff, 0x42422426, - 1, 1, 1, 0x00000e48, 0xffffffff, 0x30343840, - 1, 1, 1, 0x00000e4c, 0xffffffff, 0x22242628 -}; -#else -u4Byte Array_TC_8812A_PHY_REG_PG[] = { - 0x0, }; - -#endif - -void -ODM_ReadAndConfig_TC_8812A_PHY_REG_PG( - IN PDM_ODM_T pDM_Odm - ) -{ - u4Byte hex = 0; - u4Byte i = 0; - u2Byte count = 0; - pu4Byte ptr_array = NULL; - u1Byte platform = pDM_Odm->SupportPlatform; - u1Byte _interface = pDM_Odm->SupportInterface; - u1Byte board = pDM_Odm->BoardType; - u4Byte ArrayLen = sizeof(Array_TC_8812A_PHY_REG_PG)/sizeof(u4Byte); - pu4Byte Array = Array_TC_8812A_PHY_REG_PG; - - pDM_Odm->PhyRegPgVersion = 1; - pDM_Odm->PhyRegPgValueType = PHY_REG_PG_EXACT_VALUE; - hex += board; - hex += _interface << 8; - hex += platform << 16; - hex += 0xFF000000; - for (i = 0; i < ArrayLen; i += 6 ) - { - u4Byte v1 = Array[i]; - u4Byte v2 = Array[i+1]; - u4Byte v3 = Array[i+2]; - u4Byte v4 = Array[i+3]; - u4Byte v5 = Array[i+4]; - u4Byte v6 = Array[i+5]; - - // this line is a line of pure_body - if ( v1 < 0xCDCDCDCD ) - { - odm_ConfigBB_PHY_REG_PG_8812A(pDM_Odm, v1, v2, v3, v4, v5, v6); - continue; - } - else - { // this line is the start of branch - if ( !CheckCondition(Array[i], hex) ) - { // don't need the hw_body - i += 2; // skip the pair of expression - v1 = Array[i]; - v2 = Array[i+1]; - v3 = Array[i+2]; - while (v2 != 0xDEAD) - { - i += 3; - v1 = Array[i]; - v2 = Array[i+1]; - v3 = Array[i+1]; - } - } - } - } -} - - - -#endif // end of HWIMG_SUPPORT - diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_FW.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_FW.c deleted file mode 100755 index 087a6aa7a5672d..00000000000000 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_FW.c +++ /dev/null @@ -1,2575 +0,0 @@ -/****************************************************************************** -* -* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of version 2 of the GNU General Public License as -* published by the Free Software Foundation. -* -* This program is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along with -* this program; if not, write to the Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA -* -* -******************************************************************************/ - -#include "../odm_precomp.h" - -#if (RTL8812A_SUPPORT == 1) -#if TESTCHIP_SUPPORT == 1 -u1Byte Array_TC_8812A_FW_NIC[] = { -0x01, 0x95, 0x10, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x12, 0x11, 0x21, 0x12, 0x22, 0x54, 0x00, 0x00, -0x39, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x02, 0x49, 0xCC, 0x02, 0x5C, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x5D, 0x75, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x67, 0xEF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x5C, 0xEC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x67, 0x0C, 0x00, 0x00, -0x15, 0xF0, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x15, 0xF0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x05, 0xF0, -0xFF, 0x0F, 0x00, 0x00, 0x00, 0x05, 0xF0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x10, 0xF0, 0xFF, 0x0F, -0x00, 0x00, 0x00, 0x10, 0xF0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x0F, 0x00, 0x00, 0x00, 0x00, -0x00, 0xF0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, -0x08, 0x03, 0x03, 0x00, 0x04, 0x09, 0x07, 0x03, 0x03, 0x00, 0x04, 0x08, 0x06, 0x03, 0x02, 0x00, -0x04, 0x08, 0x05, 0x03, 0x01, 0x00, 0x04, 0x0D, 0x0A, 0x07, 0x05, 0x00, 0x08, 0x0C, 0x0A, 0x07, -0x04, 0x00, 0x08, 0x0B, 0x0A, 0x06, 0x05, 0x00, 0x08, 0x0B, 0x0A, 0x05, 0x03, 0x00, 0x08, 0x0B, -0x0A, 0x03, 0x02, 0x00, 0x08, 0x14, 0x12, 0x0C, 0x04, 0x00, 0x10, 0x14, 0x12, 0x09, 0x04, 0x00, -0x10, 0x24, 0x22, 0x1C, 0x12, 0x00, 0x20, 0x24, 0x22, 0x18, 0x0C, 0x00, 0x20, 0x24, 0x22, 0x14, -0x06, 0x00, 0x20, 0x24, 0x22, 0x0F, 0x04, 0x00, 0x20, 0x24, 0x21, 0x0A, 0x04, 0x00, 0x20, 0x23, -0x21, 0x0C, 0x04, 0x00, 0x20, 0x23, 0x1F, 0x0A, 0x04, 0x00, 0x20, 0x22, 0x1F, 0x0F, 0x04, 0x00, -0x20, 0x21, 0x1F, 0x16, 0x0C, 0x00, 0x20, 0x31, 0x2F, 0x20, 0x14, 0x00, 0x30, 0x31, 0x2F, 0x18, -0x10, 0x00, 0x30, 0x31, 0x2C, 0x18, 0x0C, 0x00, 0x30, 0x31, 0x2A, 0x14, 0x0C, 0x00, 0x30, 0x31, -0x28, 0x14, 0x00, 0x00, 0x30, 0x31, 0x24, 0x14, 0x00, 0x00, 0x30, 0x31, 0x1E, 0x14, 0x00, 0x00, -0x30, 0x04, 0x04, 0x04, 0x05, 0x04, 0x04, 0x05, 0x07, 0x07, 0x07, 0x08, 0x0A, 0x02, 0x03, 0x04, -0x04, 0x06, 0x0A, 0x0B, 0x0D, 0x03, 0x04, 0x07, 0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x05, 0x05, 0x07, -0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x05, 0x05, 0x07, 0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x01, 0x02, 0x03, -0x06, 0x07, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x02, 0x03, 0x04, 0x07, 0x08, 0x0B, 0x0C, 0x0D, 0x0E, -0x10, 0x05, 0x05, 0x07, 0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x0F, 0x0F, 0x05, 0x05, 0x07, 0x07, 0x08, -0x0B, 0x0D, 0x0F, 0x0F, 0x0F, 0x04, 0x04, 0x04, 0x05, 0x07, 0x07, 0x09, 0x09, 0x0C, 0x0E, 0x10, -0x12, 0x04, 0x04, 0x05, 0x05, 0x06, 0x0A, 0x11, 0x13, 0x07, 0x08, 0x09, 0x09, 0x0C, 0x0E, 0x11, -0x13, 0x09, 0x09, 0x09, 0x09, 0x0C, 0x0E, 0x11, 0x13, 0x09, 0x09, 0x09, 0x09, 0x0C, 0x0E, 0x11, -0x13, 0x04, 0x08, 0x09, 0x0A, 0x0C, 0x0E, 0x10, 0x12, 0x13, 0x14, 0x04, 0x08, 0x0A, 0x0C, 0x0E, -0x10, 0x11, 0x13, 0x14, 0x16, 0x09, 0x09, 0x09, 0x09, 0x0C, 0x0E, 0x11, 0x13, 0x13, 0x13, 0x09, -0x09, 0x09, 0x09, 0x0C, 0x0E, 0x11, 0x13, 0x13, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x24, 0x26, 0x2A, 0x00, 0x00, 0x00, 0x1F, 0x21, 0x25, 0x27, 0x28, 0x00, 0x00, 0x00, -0x00, 0x23, 0x26, 0x28, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x23, 0x26, 0x28, 0x2A, 0x00, 0x00, 0x00, -0x00, 0x23, 0x26, 0x28, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x20, 0x25, 0x27, 0x29, 0x29, 0x2A, 0x00, -0x00, 0x00, 0x00, 0x20, 0x25, 0x27, 0x29, 0x29, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x23, 0x26, 0x28, -0x2A, 0x2A, 0x2A, 0x00, 0x00, 0x00, 0x1F, 0x23, 0x26, 0x28, 0x2A, 0x2A, 0x2A, 0x00, 0x00, 0x00, -0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, -0x18, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, -0x60, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0xD8, 0x00, 0x00, 0x00, -0x50, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xA0, 0x00, 0x00, 0x00, 0xC8, 0x00, 0x00, 0x01, -0x40, 0x00, 0x00, 0x01, 0x90, 0x00, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x02, 0x30, 0x00, 0x00, 0x00, -0xC8, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x02, 0xD0, 0x00, 0x00, 0x03, -0xE8, 0x00, 0x00, 0x04, 0xB0, 0x00, 0x00, 0x06, 0x40, 0x00, 0x00, 0x07, 0xD0, 0x00, 0x00, 0x00, -0xC8, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x02, 0xD0, 0x00, 0x00, 0x03, -0xE8, 0x00, 0x00, 0x04, 0xB0, 0x00, 0x00, 0x06, 0x40, 0x00, 0x00, 0x07, 0xD0, 0x00, 0x00, 0x00, -0xC8, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x02, 0xD0, 0x00, 0x00, 0x03, -0xE8, 0x00, 0x00, 0x04, 0xB0, 0x00, 0x00, 0x06, 0x40, 0x00, 0x00, 0x07, 0xD0, 0x00, 0x00, 0x00, -0xC8, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x02, 0xD0, 0x00, 0x00, 0x03, -0xE8, 0x00, 0x00, 0x04, 0xB0, 0x00, 0x00, 0x06, 0x40, 0x00, 0x00, 0x07, 0xD0, 0x00, 0x00, 0x0C, -0x80, 0x00, 0x00, 0x0F, 0xA0, 0x00, 0x00, 0x00, 0xC8, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x01, -0xE0, 0x00, 0x00, 0x02, 0xD0, 0x00, 0x00, 0x03, 0xE8, 0x00, 0x00, 0x04, 0xB0, 0x00, 0x00, 0x07, -0xD0, 0x00, 0x00, 0x0B, 0xB8, 0x00, 0x00, 0x0F, 0xA0, 0x00, 0x00, 0x17, 0x70, 0x00, 0x00, 0x00, -0xC8, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x02, 0xD0, 0x00, 0x00, 0x03, -0xE8, 0x00, 0x00, 0x04, 0xB0, 0x00, 0x00, 0x06, 0x40, 0x00, 0x00, 0x07, 0xD0, 0x00, 0x00, 0x07, -0xD0, 0x00, 0x00, 0x07, 0xD0, 0x00, 0x00, 0x00, 0xC8, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x01, -0xE0, 0x00, 0x00, 0x02, 0xD0, 0x00, 0x00, 0x03, 0xE8, 0x00, 0x00, 0x04, 0xB0, 0x00, 0x00, 0x06, -0x40, 0x00, 0x00, 0x07, 0xD0, 0x00, 0x00, 0x07, 0xD0, 0x00, 0x00, 0x07, 0xD0, 0x00, 0x02, 0x00, -0x02, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x12, 0x00, 0x18, 0x00, 0x24, 0x00, 0x30, 0x00, -0x48, 0x00, 0x60, 0x00, 0x6C, 0x00, 0x28, 0x00, 0x3C, 0x00, 0x50, 0x00, 0x64, 0x00, 0xA0, 0x00, -0xC8, 0x00, 0xF0, 0x01, 0x18, 0x00, 0x64, 0x00, 0x8C, 0x00, 0xF0, 0x01, 0x68, 0x01, 0xF4, 0x02, -0x58, 0x03, 0x20, 0x03, 0xE8, 0x00, 0x64, 0x00, 0x8C, 0x00, 0xF0, 0x01, 0x68, 0x01, 0xF4, 0x02, -0x58, 0x03, 0x20, 0x03, 0xE8, 0x00, 0x64, 0x00, 0x8C, 0x00, 0xF0, 0x01, 0x68, 0x01, 0xF4, 0x02, -0x58, 0x03, 0x20, 0x03, 0xE8, 0x00, 0x64, 0x00, 0x8C, 0x00, 0xF0, 0x01, 0x68, 0x01, 0xF4, 0x02, -0x58, 0x03, 0x20, 0x03, 0xE8, 0x06, 0x40, 0x07, 0xD0, 0x00, 0x64, 0x00, 0x8C, 0x00, 0xF0, 0x01, -0x68, 0x01, 0xF4, 0x02, 0x58, 0x03, 0xE8, 0x05, 0xDC, 0x07, 0xD0, 0x0B, 0xB8, 0x00, 0x64, 0x00, -0x8C, 0x00, 0xF0, 0x01, 0x68, 0x01, 0xF4, 0x02, 0x58, 0x03, 0x20, 0x03, 0xE8, 0x03, 0xE8, 0x03, -0xE8, 0x00, 0x64, 0x00, 0x8C, 0x00, 0xF0, 0x01, 0x68, 0x01, 0xF4, 0x02, 0x58, 0x03, 0x20, 0x03, -0xE8, 0x03, 0xE8, 0x03, 0xE8, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x10, 0x18, 0x20, 0x30, 0x40, -0x50, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x04, 0x05, 0x05, 0x02, 0x03, 0x03, -0x04, 0x04, 0x05, 0x05, 0x06, 0x03, 0x03, 0x04, 0x04, 0x05, 0x06, 0x06, 0x07, 0x05, 0x06, 0x06, -0x07, 0x07, 0x08, 0x09, 0x0A, 0x05, 0x06, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0A, 0x01, 0x01, 0x02, -0x02, 0x04, 0x04, 0x05, 0x05, 0x06, 0x07, 0x02, 0x02, 0x03, 0x03, 0x05, 0x05, 0x06, 0x06, 0x08, -0x09, 0x05, 0x06, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0A, 0x0A, 0x0B, 0x05, 0x06, 0x06, 0x07, 0x07, -0x08, 0x09, 0x0A, 0x0A, 0x0B, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, -0x08, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x05, 0x06, 0x06, 0x07, 0x08, 0x0A, 0x0B, -0x0C, 0x05, 0x06, 0x06, 0x07, 0x08, 0x0A, 0x0B, 0x0C, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, -0x0C, 0x05, 0x06, 0x06, 0x07, 0x08, 0x09, 0x0B, 0x0C, 0x0C, 0x0C, 0x05, 0x06, 0x06, 0x07, 0x08, -0x09, 0x0B, 0x0C, 0x0C, 0x0C, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0C, 0x0C, 0x05, -0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0C, 0x0C, 0x20, 0x1E, 0x1C, 0x18, 0x10, 0x18, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0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x88, -0xC8, 0xF6, 0x15, 0x0C, 0x80, 0xD3, 0xE5, 0x0C, 0x23, 0x24, 0x81, 0xF8, 0x7F, 0x04, 0xC2, 0xAF, -0xE6, 0x30, 0xE0, 0x03, 0x10, 0xE2, 0x0C, 0x7F, 0x00, 0x30, 0xE1, 0x07, 0x30, 0xE3, 0x04, 0x7F, -0x08, 0x54, 0xF4, 0x54, 0x7C, 0xC6, 0xD2, 0xAF, 0x54, 0x80, 0x42, 0x07, 0x22, 0x78, 0x88, 0xA6, -0x81, 0x74, 0x03, 0x60, 0x06, 0xFF, 0x08, 0x76, 0xFF, 0xDF, 0xFB, 0x7F, 0x04, 0xE4, 0x78, 0x80, -0xF6, 0x08, 0xF6, 0x08, 0xDF, 0xFA, 0x78, 0x81, 0x76, 0x30, 0x90, 0x4A, 0x65, 0x74, 0x01, 0x93, -0xC0, 0xE0, 0xE4, 0x93, 0xC0, 0xE0, 0x43, 0x89, 0x01, 0x75, 0x8A, 0x60, 0x75, 0x8C, 0x79, 0xD2, -0x8C, 0xD2, 0xAF, 0x22, 0x03, 0xEF, 0xD3, 0x94, 0x03, 0x40, 0x03, 0x7F, 0xFF, 0x22, 0x74, 0x81, -0x2F, 0x2F, 0xF8, 0xE6, 0x20, 0xE5, 0xF4, 0xC2, 0xAF, 0xE6, 0x44, 0x30, 0xF6, 0xD2, 0xAF, 0xAE, -0x0C, 0xEE, 0xC3, 0x9F, 0x50, 0x21, 0x0E, 0x74, 0x88, 0x2E, 0xF8, 0xE6, 0xF9, 0x08, 0xE6, 0x18, -0xBE, 0x03, 0x02, 0x74, 0xFF, 0xFD, 0xED, 0x69, 0x60, 0x09, 0x09, 0xE7, 0x19, 0x19, 0xF7, 0x09, -0x09, 0x80, 0xF3, 0x16, 0x16, 0x80, 0xDA, 0xEE, 0xD3, 0x9F, 0x40, 0x04, 0x05, 0x81, 0x05, 0x81, -0xEE, 0xD3, 0x9F, 0x40, 0x22, 0x74, 0x88, 0x2E, 0xF8, 0x08, 0x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0x08, 0x10, 0x20, 0x40, 0x80, 0x90, 0x4A, 0x4F, 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, 0x00, -0x41, 0xA5, 0x86, 0x00, 0x41, 0xA5, 0x87, 0x00, 0x41, 0xA5, 0x88, 0x00, 0x42, 0xA5, 0x97, 0x00, -0x00, 0x41, 0xA5, 0x9C, 0x00, 0x4B, 0x71, 0x4F, 0xF7, 0x58, 0x17, 0x59, 0x61, 0x90, 0x00, 0xF0, -0xE0, 0x7F, 0x01, 0x20, 0xE2, 0x02, 0x7F, 0x03, 0x22, 0x51, 0x6D, 0x90, 0xA3, 0x14, 0xEF, 0xF0, -0x51, 0x8B, 0x90, 0x01, 0x64, 0x74, 0x01, 0xF0, 0x02, 0x35, 0x95, 0x71, 0x10, 0x71, 0x40, 0x51, -0xAD, 0x51, 0xCC, 0x51, 0xEB, 0xE4, 0xF5, 0x51, 0x75, 0x52, 0x58, 0xAB, 0x51, 0x7D, 0x02, 0x7F, -0x01, 0x12, 0x39, 0x04, 0xAB, 0x52, 0x7D, 0x03, 0x7F, 0x01, 0x02, 0x39, 0x04, 0x75, 0x5D, 0x12, -0xE4, 0xF5, 0x5E, 0x75, 0x5F, 0x07, 0x75, 0x60, 0x72, 0x90, 0x01, 0x30, 0xE5, 0x5D, 0xF0, 0xA3, -0xE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 0x80, 0x12, 0x3A, 0x96, 0x71, 0xFA, 0x12, -0x3A, 0xB8, 0xF1, 0xC7, 0x7F, 0x01, 0x12, 0x46, 0x15, 0x90, 0xA4, 0x52, 0x74, 0x02, 0xF0, 0xFF, -0x12, 0x46, 0x15, 0x90, 0xA4, 0x52, 0xE0, 0x04, 0xF0, 0x7F, 0x03, 0x12, 0x46, 0x15, 0x90, 0xA4, -0x52, 0xE0, 0x04, 0xF0, 0x51, 0x79, 0x71, 0xC3, 0x90, 0x00, 0x80, 0xE0, 0x44, 0x40, 0xFD, 0x7F, -0x80, 0x12, 0x3A, 0x96, 0x75, 0x28, 0xFF, 0x71, 0xEB, 0x12, 0x6F, 0xE9, 0x91, 0x02, 0xE4, 0xFF, -0x02, 0x46, 0x9E, 0x71, 0xE5, 0x71, 0xF2, 0x12, 0x7A, 0x9E, 0x12, 0x8D, 0xAD, 0x12, 0x91, 0xEC, -0x91, 0x0C, 0x90, 0xA4, 0x56, 0xE0, 0x54, 0xFE, 0xF0, 0xA3, 0x74, 0x03, 0xF0, 0xA3, 0xF0, 0xE4, -0xA3, 0xF0, 0xA3, 0xF0, 0x22, 0xE4, 0x90, 0xA3, 0xB6, 0xF0, 0x22, 0x75, 0xE8, 0x03, 0x75, 0xA8, -0x85, 0x22, 0xE4, 0x90, 0xA3, 0xB0, 0xF0, 0xA3, 0xF0, 0x22, 0x90, 0x01, 0x94, 0xE0, 0x44, 0x01, -0xF0, 0x22, 0x90, 0x01, 0xE4, 0x74, 0x0A, 0xF0, 0xA3, 0xE4, 0xF0, 0x22, 0x90, 0xA4, 0x53, 0xE0, -0x54, 0xFE, 0xF0, 0x54, 0x7F, 0xF0, 0xA3, 0x74, 0x0A, 0xF0, 0xE4, 0xA3, 0xF0, 0x22, 0x71, 0xD2, -0x12, 0x26, 0x1E, 0xFF, 0x54, 0x01, 0xFE, 0x90, 0xA4, 0x56, 0xE0, 0x54, 0xFE, 0x4E, 0xF0, 0xEF, -0xC3, 0x13, 0x30, 0xE0, 0x14, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0x90, 0xA4, 0x57, 0xF0, 0x90, -0x00, 0x02, 0x12, 0x26, 0x37, 0x90, 0xA4, 0x58, 0xF0, 0x22, 0x90, 0xA4, 0x8D, 0x31, 0x9D, 0xEF, -0x31, 0xA6, 0x4C, 0x7A, 0x00, 0x4C, 0x82, 0x01, 0x4C, 0x8A, 0x03, 0x4C, 0x91, 0x04, 0x4C, 0x98, -0x20, 0x4C, 0xA0, 0x21, 0x4C, 0xA8, 0x23, 0x4C, 0xAF, 0x25, 0x4C, 0xB6, 0x40, 0x4C, 0xC4, 0x42, -0x4C, 0xCC, 0x43, 0x4C, 0xD4, 0x87, 0x00, 0x00, 0x4C, 0xDB, 0x90, 0xA4, 0x8D, 0x31, 0x94, 0x02, -0x68, 0x20, 0x90, 0xA4, 0x8D, 0x31, 0x94, 0x02, 0x55, 0xAC, 0x90, 0xA4, 0x8D, 0x31, 0x94, 0xE1, -0xA7, 0x90, 0xA4, 0x8D, 0x31, 0x94, 0x80, 0x86, 0x90, 0xA4, 0x8D, 0x31, 0x94, 0x02, 0x68, 0x68, -0x90, 0xA4, 0x8D, 0x31, 0x94, 0x02, 0x69, 0x54, 0x90, 0xA4, 0x8D, 0x31, 0x94, 0xE1, 0x8F, 0x90, -0xA4, 0x8D, 0x31, 0x94, 0xE1, 0x97, 0x90, 0xA4, 0x74, 0xE0, 0x04, 0xF0, 0x90, 0xA4, 0x8D, 0x31, -0x94, 0x02, 0x8B, 0x5E, 0x90, 0xA4, 0x8D, 0x31, 0x94, 0x02, 0x8C, 0x5D, 0x90, 0xA4, 0x8D, 0x31, -0x94, 0x12, 0x6A, 0x04, 0x90, 0xA4, 0x8D, 0x31, 0x94, 0x80, 0x08, 0x90, 0x01, 0xC0, 0xE0, 0x44, -0x01, 0xF0, 0x22, 0x90, 0xA4, 0x90, 0x31, 0x9D, 0x12, 0x26, 0x1E, 0xFF, 0xB1, 0x14, 0x90, 0xA4, -0x93, 0x74, 0x10, 0xF0, 0x90, 0xA4, 0xA1, 0x74, 0x07, 0xF0, 0x90, 0xA4, 0x90, 0x31, 0x94, 0x12, -0x26, 0x1E, 0x90, 0xA4, 0x95, 0xF0, 0x7B, 0x01, 0x7A, 0xA4, 0x79, 0x93, 0x12, 0x69, 0x9A, 0x7F, -0x03, 0x02, 0x47, 0x27, 0x90, 0xA4, 0xA2, 0xEF, 0xF0, 0x12, 0x8F, 0xAE, 0x90, 0xA4, 0xA2, 0xE0, -0xC3, 0x94, 0x0E, 0x50, 0x44, 0x90, 0xA4, 0xA8, 0x12, 0x27, 0x54, 0x1F, 0xFE, 0x00, 0x00, 0x90, -0xA4, 0xAC, 0x12, 0x27, 0x54, 0x12, 0xD4, 0x00, 0x00, 0x7F, 0x60, 0x7E, 0x08, 0xF1, 0x4C, 0x90, -0xA4, 0xA6, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0xFF, 0x90, 0xA4, 0xA2, 0xE0, 0xFF, 0xE4, 0xFC, -0xFD, 0xFE, 0xD1, 0xD2, 0x90, 0xA4, 0xA6, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0xFF, 0x90, 0xA4, -0xA2, 0xE0, 0xFF, 0xE4, 0xFC, 0xFD, 0xFE, 0xC1, 0xC1, 0x90, 0xA4, 0xA2, 0xE0, 0xFF, 0x74, 0x24, -0xD3, 0x9F, 0x50, 0x1B, 0xEF, 0x94, 0x30, 0x50, 0x16, 0x90, 0xA4, 0xA8, 0x12, 0x27, 0x54, 0x1F, -0xFE, 0x00, 0x00, 0x90, 0xA4, 0xAC, 0x12, 0x27, 0x54, 0x09, 0x28, 0x00, 0x00, 0x80, 0x70, 0x90, -0xA4, 0xA2, 0xE0, 0xFF, 0x74, 0x32, 0xD3, 0x9F, 0x50, 0x1B, 0xEF, 0x94, 0x40, 0x50, 0x16, 0x90, -0xA4, 0xA8, 0x12, 0x27, 0x54, 0x1F, 0xFE, 0x00, 0x00, 0x90, 0xA4, 0xAC, 0x12, 0x27, 0x54, 0x08, -0xA6, 0x00, 0x00, 0x80, 0x4A, 0x90, 0xA4, 0xA2, 0xE0, 0xFF, 0x74, 0x64, 0xD3, 0x9F, 0x50, 0x1B, -0xEF, 0x94, 0x74, 0x50, 0x16, 0x90, 0xA4, 0xA8, 0x12, 0x27, 0x54, 0x1F, 0xFE, 0x00, 0x00, 0x90, -0xA4, 0xAC, 0x12, 0x27, 0x54, 0x08, 0xA4, 0x00, 0x00, 0x80, 0x24, 0x90, 0xA4, 0xA2, 0xE0, 0xFF, -0x74, 0x76, 0xD3, 0x9F, 0x50, 0x1F, 0xEF, 0x94, 0xA5, 0x50, 0x1A, 0x90, 0xA4, 0xA8, 0x12, 0x27, -0x54, 0x1F, 0xFE, 0x00, 0x00, 0x90, 0xA4, 0xAC, 0x12, 0x27, 0x54, 0x08, 0x24, 0x00, 0x00, 0x7F, -0x60, 0x7E, 0x08, 0xF1, 0x4C, 0x90, 0xA4, 0xA2, 0xE0, 0xFF, 0x74, 0x24, 0xD3, 0x9F, 0x50, 0x37, -0xEF, 0x94, 0x40, 0x50, 0x32, 0x90, 0xA4, 0xA6, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0xFF, 0x90, -0xA4, 0xA2, 0xE0, 0xFF, 0xE4, 0xFC, 0xFD, 0x74, 0x01, 0xFE, 0x0D, 0x14, 0xD1, 0xD2, 0x90, 0xA4, -0xA6, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0xFF, 0x90, 0xA4, 0xA2, 0xE0, 0xFF, 0xE4, 0xFC, 0xFD, -0x74, 0x01, 0xFE, 0x0D, 0x14, 0x80, 0x7A, 0x90, 0xA4, 0xA2, 0xE0, 0xFF, 0x74, 0x64, 0xD3, 0x9F, -0x50, 0x37, 0xEF, 0x94, 0x8C, 0x50, 0x32, 0x90, 0xA4, 0xA6, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, -0xFF, 0x90, 0xA4, 0xA2, 0xE0, 0xFF, 0x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-0x50, 0x90, 0xAC, 0x96, 0x12, 0x27, 0x48, 0x90, 0xA4, 0xA3, 0xE0, 0xFF, 0xD0, 0x05, 0x02, 0x39, -0xBA, 0x90, 0xA5, 0x9B, 0xE0, 0x75, 0xF0, 0x04, 0xA4, 0xFF, 0xAE, 0xF0, 0xEE, 0x33, 0x95, 0xE0, -0xFD, 0xFC, 0x90, 0xA4, 0xAC, 0x12, 0x27, 0x48, 0x7F, 0xAC, 0x7E, 0x08, 0x90, 0xA4, 0xA6, 0xEE, -0xF0, 0xA3, 0xEF, 0xF0, 0x12, 0x36, 0xCE, 0x90, 0xA4, 0xB0, 0x12, 0x27, 0x48, 0x90, 0xA4, 0xA8, -0x31, 0x50, 0x12, 0x27, 0x15, 0x90, 0xA4, 0xB0, 0x31, 0x6C, 0x31, 0x25, 0x90, 0xA4, 0xAC, 0x31, -0x6C, 0x31, 0x32, 0x90, 0xA4, 0xB4, 0x12, 0x27, 0x48, 0x90, 0xA4, 0xB4, 0x31, 0x50, 0x90, 0xAC, -0xB9, 0x12, 0x27, 0x48, 0x90, 0xA4, 0xA6, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x02, 0x37, 0x5D, 0x12, -0x26, 0x1E, 0x90, 0xA4, 0x43, 0xF0, 0x22, 0x12, 0x26, 0x1E, 0x90, 0xA4, 0x51, 0xF0, 0x90, 0xA4, -0x51, 0xE0, 0x90, 0x01, 0xE7, 0xF0, 0x22, 0x12, 0x26, 0x1E, 0xFF, 0x54, 0x01, 0xFE, 0x90, 0xA4, -0x53, 0xE0, 0x54, 0xFE, 0x4E, 0xF0, 0xEF, 0xC3, 0x13, 0x30, 0xE0, 0x0A, 0x90, 0x00, 0x01, 0x12, -0x26, 0x37, 0x90, 0xA4, 0x54, 0xF0, 0x22, 0x90, 0x01, 0x01, 0xE0, 0x44, 0x04, 0xF0, 0x90, 0x01, -0x9C, 0x74, 0x7E, 0xF0, 0xA3, 0x74, 0x92, 0xF0, 0xA3, 0x74, 0xA0, 0xF0, 0xA3, 0x74, 0x24, 0xF0, -0x90, 0x01, 0x9B, 0x74, 0x49, 0xF0, 0x90, 0x01, 0x9A, 0x74, 0xE0, 0xF0, 0x90, 0x01, 0x99, 0xE4, -0xF0, 0x90, 0x01, 0x98, 0x04, 0xF0, 0x22, 0xE4, 0x90, 0xA4, 0x7E, 0xF0, 0x90, 0xA4, 0x7E, 0xE0, -0x64, 0x01, 0xF0, 0x24, 0xF7, 0x90, 0x01, 0xC4, 0xF0, 0x74, 0x4F, 0xA3, 0xF0, 0x12, 0x3A, 0xEB, -0xBF, 0x01, 0x03, 0x12, 0x31, 0x69, 0x90, 0xA4, 0x3C, 0xE0, 0xFF, 0x90, 0xA4, 0x3B, 0xE0, 0x6F, -0x60, 0x02, 0x11, 0x44, 0x12, 0x70, 0x3F, 0xBF, 0x01, 0x03, 0x12, 0x7A, 0x5B, 0x90, 0xA4, 0x3C, -0xE0, 0x90, 0x01, 0xBC, 0xF0, 0x90, 0xA3, 0xB6, 0xE0, 0x90, 0x01, 0xBD, 0xF0, 0xB1, 0x3F, 0x12, -0x45, 0x4D, 0x80, 0xB8, 0x90, 0xA4, 0x3B, 0xE0, 0xFF, 0x7D, 0x01, 0x80, 0x04, 0x7D, 0x01, 0x7F, -0x04, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0xA5, 0x99, 0xED, 0xF0, 0x90, 0xA4, 0x3C, -0xE0, 0x90, 0xA5, 0x9A, 0xF0, 0x90, 0xA4, 0x36, 0xE0, 0xFE, 0xC4, 0x13, 0x13, 0x54, 0x03, 0x30, -0xE0, 0x02, 0x21, 0xA2, 0xEE, 0xC4, 0x13, 0x13, 0x13, 0x54, 0x01, 0x30, 0xE0, 0x02, 0x21, 0xA2, -0x90, 0xA5, 0x9A, 0xE0, 0xFE, 0x6F, 0x70, 0x02, 0x21, 0xA2, 0xEF, 0x70, 0x02, 0x21, 0x19, 0x24, -0xFE, 0x70, 0x02, 0x21, 0x52, 0x24, 0xFE, 0x60, 0x48, 0x24, 0xFC, 0x70, 0x02, 0x21, 0x8D, 0x24, -0xFC, 0x60, 0x02, 0x21, 0xA2, 0xEE, 0xB4, 0x0E, 0x02, 0x51, 0x22, 0x90, 0xA5, 0x9A, 0xE0, 0x70, -0x04, 0x7F, 0x01, 0x51, 0x4A, 0x90, 0xA5, 0x9A, 0xE0, 0xB4, 0x06, 0x02, 0x31, 0xFC, 0x90, 0xA5, -0x9A, 0xE0, 0xB4, 0x04, 0x0E, 0x90, 0xA5, 0x99, 0xE0, 0xFF, 0x60, 0x05, 0x12, 0x76, 0xB1, 0x80, -0x02, 0xB1, 0x99, 0x90, 0xA5, 0x9A, 0xE0, 0x64, 0x08, 0x60, 0x02, 0x21, 0xA2, 0x71, 0x0B, 0x21, -0xA2, 0x90, 0xA5, 0x9A, 0xE0, 0x70, 0x04, 0x7F, 0x01, 0x51, 0x4A, 0x90, 0xA5, 0x9A, 0xE0, 0xB4, -0x06, 0x02, 0x31, 0xFC, 0x90, 0xA5, 0x9A, 0xE0, 0xB4, 0x0E, 0x07, 0x31, 0xA7, 0xBF, 0x01, 0x02, -0x51, 0x22, 0x90, 0xA5, 0x9A, 0xE0, 0x64, 0x0C, 0x60, 0x02, 0x21, 0xA2, 0x31, 0xA7, 0xEF, 0x64, -0x01, 0x60, 0x02, 0x21, 0xA2, 0x51, 0x63, 0x21, 0xA2, 0x90, 0xA5, 0x9A, 0xE0, 0xB4, 0x0E, 0x07, -0x31, 0xA7, 0xBF, 0x01, 0x02, 0x51, 0x22, 0x90, 0xA5, 0x9A, 0xE0, 0xB4, 0x06, 0x02, 0x31, 0xFC, -0x90, 0xA5, 0x9A, 0xE0, 0xB4, 0x0C, 0x07, 0x31, 0xA7, 0xBF, 0x01, 0x02, 0x51, 0x63, 0x90, 0xA5, -0x9A, 0xE0, 0x64, 0x04, 0x70, 0x5C, 0x12, 0x92, 0xB0, 0xEF, 0x64, 0x01, 0x70, 0x54, 0xB1, 0x23, -0x80, 0x50, 0x90, 0xA5, 0x9A, 0xE0, 0xB4, 0x0E, 0x07, 0x31, 0xA7, 0xBF, 0x01, 0x02, 0x51, 0x22, -0x90, 0xA5, 0x9A, 0xE0, 0xB4, 0x06, 0x02, 0x31, 0xFC, 0x90, 0xA5, 0x9A, 0xE0, 0xB4, 0x0C, 0x07, -0x31, 0xA7, 0xBF, 0x01, 0x02, 0x51, 0x63, 0x90, 0xA5, 0x9A, 0xE0, 0x70, 0x04, 0x7F, 0x01, 0x51, -0x4A, 0x90, 0xA5, 0x9A, 0xE0, 0xB4, 0x04, 0x1A, 0x12, 0x93, 0x30, 0x80, 0x15, 0x90, 0xA5, 0x9A, -0xE0, 0xB4, 0x0C, 0x0E, 0x90, 0xA4, 0x37, 0xE0, 0xFF, 0x13, 0x13, 0x54, 0x3F, 0x30, 0xE0, 0x02, -0x71, 0x02, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xF1, 0xD1, 0xEF, 0x64, 0x01, 0x60, 0x08, 0x90, 0x01, -0xB8, 0x74, 0x01, 0xF0, 0x80, 0x3D, 0x90, 0xA4, 0x36, 0xE0, 0xFF, 0x13, 0x13, 0x13, 0x54, 0x1F, -0x30, 0xE0, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x02, 0xF0, 0x80, 0x28, 0xEF, 0xC4, 0x54, 0x0F, 0x30, -0xE0, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x04, 0xF0, 0x80, 0x19, 0x90, 0xA4, 0x3B, 0xE0, 0xD3, 0x94, -0x04, 0x40, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x08, 0xF0, 0x80, 0x08, 0x90, 0x01, 0xB8, 0xE4, 0xF0, -0x7F, 0x01, 0x22, 0x90, 0x01, 0xB9, 0x74, 0x02, 0xF0, 0x7F, 0x00, 0x22, 0x90, 0xA4, 0x37, 0xE0, -0x90, 0x06, 0x04, 0x20, 0xE0, 0x0C, 0xE0, 0x44, 0x40, 0xF0, 0x90, 0xA4, 0x3C, 0x74, 0x04, 0xF0, -0x80, 0x0A, 0xE0, 0x54, 0x7F, 0xF0, 0x90, 0xA4, 0x3C, 0x74, 0x0C, 0xF0, 0x90, 0x05, 0x22, 0xE4, -0xF0, 0x22, 0x90, 0xA4, 0x37, 0xE0, 0xC3, 0x13, 0x20, 0xE0, 0x08, 0x90, 0xA4, 0x3C, 0x74, 0x0C, -0xF0, 0x80, 0x11, 0x90, 0x06, 0x04, 0xE0, 0x44, 0x40, 0xF0, 0xE0, 0x44, 0x80, 0xF0, 0x90, 0xA4, -0x3C, 0x74, 0x04, 0xF0, 0x90, 0x05, 0x22, 0xE4, 0xF0, 0x22, 0x90, 0xA5, 0x9D, 0xEF, 0xF0, 0x71, -0x14, 0x90, 0xA5, 0x9D, 0xE0, 0x60, 0x05, 0x90, 0x05, 0x22, 0xE4, 0xF0, 0x90, 0xA4, 0x3C, 0x74, -0x04, 0xF0, 0x22, 0x90, 0xA3, 0xB6, 0xE0, 0x64, 0x01, 0x70, 0x2E, 0x90, 0xA4, 0x37, 0xE0, 0x54, -0xFD, 0xF0, 0x90, 0x05, 0x22, 0x74, 0x6F, 0xF0, 0x7F, 0x01, 0x12, 0x71, 0x5C, 0xBF, 0x01, 0x0E, -0x90, 0xA4, 0x36, 0xE0, 0x44, 0x80, 0xF0, 0x90, 0xA4, 0x3C, 0x74, 0x0E, 0xF0, 0x22, 0x90, 0x01, -0xB9, 0x74, 0x01, 0xF0, 0x90, 0x01, 0xB8, 0x04, 0xF0, 0x22, 0x90, 0xA4, 0x39, 0xE0, 0x64, 0x01, -0x70, 0x5F, 0x90, 0xA4, 0x38, 0xE0, 0x54, 0x0F, 0x60, 0x4F, 0x90, 0xA4, 0x3C, 0xE0, 0x70, 0x03, -0xFF, 0x51, 0x4A, 0x90, 0xA4, 0x3C, 0xE0, 0x64, 0x0C, 0x60, 0x02, 0xB1, 0x99, 0x90, 0x01, 0x5B, -0xE4, 0xF0, 0x90, 0x01, 0x3C, 0x74, 0x04, 0xF0, 0xF1, 0xD1, 0xEF, 0x64, 0x01, 0x70, 0x32, 0xF5, -0x3B, 0x90, 0xA4, 0x4C, 0xE0, 0xC3, 0x13, 0x54, 0x7F, 0xF5, 0x3C, 0xE4, 0xFB, 0xFD, 0x7F, 0x58, -0x7E, 0x01, 0x12, 0x34, 0x8C, 0x90, 0x01, 0x5B, 0x74, 0x05, 0xF0, 0x90, 0x06, 0x92, 0x74, 0x01, -0xF0, 0x90, 0xA4, 0x36, 0xE0, 0x44, 0x08, 0xF0, 0x22, 0x90, 0xA4, 0x3C, 0xE0, 0x70, 0x02, 0x11, -0x4D, 0x22, 0x91, 0x4E, 0x90, 0xA4, 0x3C, 0x74, 0x08, 0xF0, 0x22, 0x71, 0x14, 0x90, 0xA4, 0x3C, -0x74, 0x0C, 0xF0, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0xA4, 0x46, 0x12, 0x49, -0x50, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0xA4, -0x46, 0x12, 0x49, 0x50, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0x7F, 0xB0, 0x7E, 0x0E, 0x12, 0x37, -0x5D, 0x90, 0x00, 0x10, 0xE0, 0x44, 0x0C, 0xFD, 0x7F, 0x10, 0x12, 0x3A, 0x96, 0x90, 0x00, 0x72, -0xE0, 0x54, 0xF3, 0xFD, 0x7F, 0x72, 0x12, 0x3A, 0x96, 0x90, 0x01, 0x01, 0xE0, 0x44, 0x02, 0xF0, -0x90, 0x01, 0x00, 0x74, 0xFF, 0xF0, 0x90, 0x06, 0xB7, 0x74, 0x09, 0xF0, 0x90, 0x06, 0xB4, 0x74, -0x86, 0xF0, 0x7F, 0xB4, 0x7E, 0x08, 0x12, 0x36, 0xCE, 0xEF, 0x54, 0xBF, 0xFF, 0xEC, 0x90, 0xA5, -0x67, 0x12, 0x27, 0x48, 0x90, 0xA5, 0x67, 0x12, 0x49, 0x50, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, -0x7F, 0xB4, 0x7E, 0x08, 0x12, 0x37, 0x5D, 0x90, 0x00, 0x02, 0xE0, 0x44, 0x01, 0xF0, 0x7F, 0x00, -0x7E, 0x0C, 0x12, 0x36, 0xCE, 0xEF, 0x44, 0x03, 0xFF, 0xEC, 0x90, 0xA5, 0x67, 0x12, 0x27, 0x48, -0x90, 0xA5, 0x67, 0x12, 0x49, 0x50, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0x7F, 0x00, 0x7E, 0x0C, -0x12, 0x37, 0x5D, 0x7F, 0x00, 0x7E, 0x0E, 0x12, 0x36, 0xCE, 0xEF, 0x44, 0x03, 0xFF, 0xEC, 0x90, -0xA5, 0x67, 0x12, 0x27, 0x48, 0x90, 0xA5, 0x67, 0x12, 0x49, 0x50, 0x90, 0xAC, 0xB9, 0x12, 0x27, -0x48, 0x7F, 0x00, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0x00, 0xFF, 0xE0, 0x70, 0x28, 0x7B, 0x01, -0x7A, 0xA5, 0x79, 0x6B, 0x91, 0x1B, 0x90, 0xA5, 0x6B, 0xE0, 0x54, 0xE7, 0xFB, 0x7F, 0x01, 0x12, -0x79, 0x2A, 0x7B, 0x01, 0x7F, 0x01, 0x91, 0x1F, 0x90, 0xA5, 0x6B, 0xE0, 0x54, 0x18, 0x70, 0x06, -0x90, 0x01, 0xBF, 0xE0, 0x04, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x7D, 0x08, 0x7F, 0x01, 0xEF, -0x70, 0x04, 0x7E, 0x01, 0x80, 0x07, 0xEF, 0x64, 0x01, 0x70, 0x19, 0x7E, 0x40, 0x90, 0x00, 0xE2, -0xED, 0xF0, 0xA3, 0xEE, 0xF0, 0x90, 0x00, 0xE1, 0xE0, 0x12, 0x26, 0x64, 0x90, 0x00, 0xE3, 0xE4, -0xF0, 0x7F, 0x01, 0x22, 0x90, 0x01, 0xC2, 0xE0, 0x44, 0x01, 0xF0, 0x7F, 0x00, 0x22, 0x12, 0x76, -0xF2, 0x7F, 0x00, 0x7E, 0x0C, 0x12, 0x36, 0xCE, 0xEF, 0x54, 0xFC, 0xFF, 0xEC, 0x90, 0xA5, 0x6D, -0x12, 0x27, 0x48, 0x90, 0xA5, 0x6D, 0x12, 0x49, 0x50, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0x7F, -0x00, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x7F, 0x00, 0x7E, 0x0E, 0x12, 0x36, 0xCE, 0xEF, 0x54, 0xFC, -0xFF, 0xEC, 0x90, 0xA5, 0x6D, 0x12, 0x27, 0x48, 0x90, 0xA5, 0x6D, 0x12, 0x49, 0x50, 0x90, 0xAC, -0xB9, 0x12, 0x27, 0x48, 0x7F, 0x00, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0x00, 0x02, 0xE0, 0x54, -0xFE, 0xF0, 0x7F, 0xB4, 0x7E, 0x08, 0x12, 0x36, 0xCE, 0xEF, 0x44, 0x40, 0xFF, 0xEC, 0x90, 0xA5, -0x6D, 0x12, 0x27, 0x48, 0x90, 0xA5, 0x6D, 0x12, 0x49, 0x50, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, -0x7F, 0xB4, 0x7E, 0x08, 0x12, 0x37, 0x5D, 0x90, 0x01, 0x00, 0x74, 0x3F, 0xF0, 0xA3, 0xE0, 0x54, -0xFD, 0xF0, 0x90, 0x05, 0x53, 0xE0, 0x44, 0x20, 0xF0, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x36, 0xCE, -0x90, 0xA4, 0x46, 0x12, 0x27, 0x48, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, 0x77, -0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, -0x77, 0x7F, 0xB0, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0x00, 0xFF, 0xE0, 0x70, 0x14, 0x7B, 0x01, -0x7A, 0xA5, 0x79, 0x6C, 0x91, 0x1B, 0x90, 0xA5, 0x6C, 0xE0, 0x44, 0x18, 0xFB, 0x7F, 0x01, 0x12, -0x79, 0x2A, 0x22, 0x90, 0x05, 0x22, 0x74, 0xFF, 0xF0, 0x12, 0x76, 0xF2, 0x90, 0x01, 0x37, 0x74, -0x02, 0xF0, 0xFD, 0x7F, 0x03, 0xD1, 0x51, 0x91, 0x4E, 0xE4, 0x90, 0xA4, 0x3C, 0xF0, 0x22, 0x12, -0x8D, 0x7B, 0x12, 0x8C, 0xBA, 0x12, 0x6B, 0x4C, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xE4, -0xFF, 0x90, 0xA5, 0x42, 0xF0, 0x90, 0x01, 0xC7, 0xE0, 0x64, 0xAD, 0x70, 0x37, 0xF0, 0x90, 0xA5, -0x4F, 0x74, 0x0F, 0xF0, 0x90, 0xA5, 0x41, 0x74, 0x0A, 0xF0, 0xA3, 0xE0, 0x04, 0xF0, 0x90, 0xA5, -0x42, 0xE0, 0x2F, 0xFE, 0x74, 0x43, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0xA5, 0xF5, 0x83, 0xEE, 0xF0, -0x0F, 0xEF, 0xB4, 0x0F, 0xE9, 0x90, 0x01, 0x3F, 0x74, 0x04, 0xF0, 0x7B, 0x01, 0x7A, 0xA5, 0x79, -0x41, 0x12, 0x5A, 0x46, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0x06, 0x04, 0xE0, 0x54, 0x7F, 0xF0, -0x90, 0x05, 0x22, 0xE4, 0xF0, 0x90, 0xA4, 0x3C, 0x74, 0x0C, 0xF0, 0x22, 0x90, 0xA4, 0x90, 0x12, -0x49, 0x9D, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0xFF, 0xFE, 0x12, 0x26, 0x1E, 0xFD, 0xC3, 0x13, -0x30, 0xE0, 0x12, 0x90, 0xA4, 0x90, 0x12, 0x49, 0x94, 0x90, 0x00, 0x02, 0x12, 0x26, 0x37, 0x90, -0xA4, 0x94, 0xF0, 0x80, 0x05, 0x90, 0xA4, 0x94, 0xEF, 0xF0, 0x90, 0xA4, 0x93, 0xEE, 0xF0, 0x90, -0xA4, 0x94, 0xE0, 0xFE, 0x90, 0xA4, 0x93, 0xE0, 0xFF, 0xD3, 0x9E, 0x50, 0x3A, 0x90, 0xA4, 0x90, -0x12, 0x49, 0x94, 0x12, 0x26, 0x1E, 0x54, 0x01, 0xFE, 0x74, 0xB6, 0x2F, 0xF5, 0x82, 0xE4, 0x34, -0xA3, 0xF5, 0x83, 0xEE, 0xF0, 0x74, 0xB6, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0xA3, 0xF5, 0x83, 0xE0, -0x70, 0x05, 0x12, 0x6B, 0x0D, 0x80, 0x08, 0x90, 0xA4, 0x93, 0xE0, 0xFF, 0x12, 0x6A, 0xFC, 0x90, -0xA4, 0x93, 0xE0, 0x04, 0xF0, 0x80, 0xB8, 0x90, 0xA3, 0xB6, 0xE0, 0x70, 0x23, 0x90, 0xA4, 0x3C, -0xE0, 0x70, 0x03, 0xFF, 0x51, 0x4A, 0x90, 0xA4, 0x3C, 0xE0, 0x64, 0x0C, 0x60, 0x02, 0xB1, 0x99, -0x90, 0xA4, 0x36, 0xE0, 0x54, 0xF7, 0xF0, 0x54, 0xEF, 0xF0, 0x54, 0xBF, 0xF0, 0x54, 0x7F, 0xF0, -0x22, 0x74, 0x5D, 0x2F, 0xF8, 0xE6, 0x4D, 0xFE, 0xF6, 0x74, 0x30, 0x2F, 0xF5, 0x82, 0xE4, 0x34, -0x01, 0xF5, 0x83, 0xEE, 0xF0, 0x22, 0x90, 0x01, 0x36, 0x74, 0x78, 0xF0, 0xA3, 0x74, 0x02, 0xF0, -0x7D,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 0x0A, 0xF1, 0xF3, 0xD1, 0xE9, 0x90, -0xA4, 0x40, 0xE0, 0x14, 0xF0, 0x90, 0x01, 0xE6, 0xE0, 0x04, 0xF0, 0x22, 0x90, 0xA3, 0xB6, 0xE0, -0x64, 0x01, 0x60, 0x02, 0xE1, 0xD0, 0x90, 0xA4, 0x39, 0xE0, 0x70, 0x02, 0xE1, 0xD0, 0x90, 0xA4, -0x38, 0xE0, 0xC4, 0x54, 0x0F, 0x64, 0x01, 0x70, 0x22, 0x90, 0x06, 0xAB, 0xE0, 0x90, 0xA4, 0x40, -0xF0, 0x90, 0x06, 0xAA, 0xE0, 0x90, 0xA4, 0x3F, 0xF0, 0xA3, 0xE0, 0xFF, 0x70, 0x08, 0x90, 0xA4, -0x3F, 0xE0, 0xFE, 0xFF, 0x80, 0x00, 0x90, 0xA4, 0x40, 0xEF, 0xF0, 0x90, 0xA4, 0x37, 0xE0, 0x44, -0x04, 0xF0, 0xE4, 0x90, 0xA4, 0x42, 0xF0, 0x90, 0xA4, 0x44, 0xA3, 0xE0, 0x90, 0x05, 0x58, 0xF0, -0x90, 0x01, 0x57, 0xE4, 0xF0, 0x90, 0x01, 0x3C, 0x74, 0x02, 0xF0, 0x90, 0xA4, 0x3D, 0xE0, 0x54, -0xFD, 0xF0, 0x54, 0xEF, 0xF0, 0x90, 0xA4, 0x38, 0xE0, 0xFF, 0xC4, 0x54, 0x0F, 0x24, 0xFD, 0x50, -0x02, 0x80, 0x03, 0x12, 0x75, 0x9B, 0x90, 0xA4, 0x37, 0xE0, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x30, -0xE0, 0x0E, 0x90, 0xA4, 0x3F, 0xE0, 0xFF, 0xA3, 0xE0, 0xB5, 0x07, 0x04, 0xF1, 0xF3, 0xD1, 0xEF, -0x22, 0x90, 0x04, 0x1A, 0xE0, 0xF4, 0x60, 0x03, 0x7F, 0x00, 0x22, 0x90, 0x04, 0x1B, 0xE0, 0x54, -0x07, 0x64, 0x07, 0x7F, 0x01, 0x60, 0x02, 0x7F, 0x00, 0x22, 0x90, 0xA4, 0x39, 0xE0, 0x60, 0x02, -0x51, 0x9A, 0x22, 0xEF, 0x14, 0x90, 0x05, 0x73, 0xF0, 0x90, 0x01, 0x3F, 0x74, 0x10, 0xF0, 0xFD, -0x7F, 0x03, 0x74, 0x65, 0x2F, 0xF8, 0xE6, 0x4D, 0xFE, 0xF6, 0x74, 0x38, 0x2F, 0xF5, 0x82, 0xE4, -0x34, 0x01, 0xF5, 0x83, 0xEE, 0xF0, 0x22, 0xE4, 0xFB, 0xFA, 0xFD, 0x7F, 0x01, 0x12, 0x47, 0x4E, -0x90, 0xA4, 0x82, 0xEF, 0xF0, 0x60, 0xF0, 0x90, 0xA4, 0x73, 0xE0, 0x04, 0xF0, 0x11, 0x31, 0x80, -0xE6, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x01, 0xCC, 0xE0, 0x54, 0x0F, 0x90, 0xA4, -0x83, 0xF0, 0x90, 0xA4, 0x83, 0xE0, 0xFD, 0x70, 0x02, 0x21, 0x5C, 0x90, 0xA5, 0x86, 0xE0, 0xFF, -0x74, 0x01, 0x7E, 0x00, 0xA8, 0x07, 0x08, 0x80, 0x05, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, 0xF9, -0xFF, 0xEF, 0x5D, 0x70, 0x02, 0x21, 0x55, 0x90, 0xA5, 0x86, 0xE0, 0x75, 0xF0, 0x04, 0x90, 0x01, -0xD0, 0x12, 0x49, 0x88, 0xE0, 0x90, 0xA4, 0x84, 0xF0, 0x75, 0x40, 0x01, 0x75, 0x41, 0xA4, 0x75, -0x42, 0x84, 0x75, 0x43, 0x01, 0x7B, 0x01, 0x7A, 0xA4, 0x79, 0x85, 0x12, 0x34, 0x2C, 0x90, 0xA5, -0x86, 0xE0, 0x75, 0xF0, 0x04, 0x90, 0x01, 0xD1, 0x12, 0x49, 0x88, 0xE0, 0x90, 0xA4, 0x86, 0xF0, -0x90, 0xA5, 0x86, 0xE0, 0x75, 0xF0, 0x04, 0x90, 0x01, 0xD2, 0x12, 0x49, 0x88, 0xE0, 0x90, 0xA4, -0x87, 0xF0, 0x90, 0xA5, 0x86, 0xE0, 0x75, 0xF0, 0x04, 0x90, 0x01, 0xD3, 0x12, 0x49, 0x88, 0xE0, -0x90, 0xA4, 0x88, 0xF0, 0x90, 0xA5, 0x86, 0xE0, 0x75, 0xF0, 0x04, 0x90, 0x01, 0xF0, 0x12, 0x49, -0x88, 0xE0, 0x90, 0xA4, 0x89, 0xF0, 0x90, 0xA5, 0x86, 0xE0, 0x75, 0xF0, 0x04, 0x90, 0x01, 0xF1, -0x12, 0x49, 0x88, 0xE0, 0x90, 0xA4, 0x8A, 0xF0, 0x90, 0xA5, 0x86, 0xE0, 0x75, 0xF0, 0x04, 0x90, -0x01, 0xF2, 0x12, 0x49, 0x88, 0xE0, 0x90, 0xA4, 0x8B, 0xF0, 0x90, 0xA5, 0x86, 0xE0, 0x75, 0xF0, -0x04, 0x90, 0x01, 0xF3, 0x12, 0x49, 0x88, 0xE0, 0x90, 0xA4, 0x8C, 0xF0, 0x90, 0xA4, 0x83, 0xE0, -0xFF, 0x90, 0xA5, 0x86, 0xE0, 0xFE, 0x74, 0x01, 0xA8, 0x06, 0x08, 0x80, 0x02, 0xC3, 0x33, 0xD8, -0xFC, 0xF4, 0x5F, 0x90, 0xA4, 0x83, 0xF0, 0x90, 0xA5, 0x86, 0xE0, 0xFF, 0x74, 0x01, 0xA8, 0x07, -0x08, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0x90, 0x01, 0xCC, 0xF0, 0x90, 0xA4, 0x85, 0xE0, 0xFF, -0x7B, 0x01, 0x7A, 0xA4, 0x79, 0x86, 0x12, 0x4C, 0x4A, 0x90, 0xA5, 0x86, 0xE0, 0x04, 0xF0, 0xE0, -0x54, 0x03, 0xF0, 0x01, 0x42, 0x90, 0x01, 0xC0, 0xE0, 0x44, 0x02, 0xF0, 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 0x0E, 0x12, 0x26, 0x37, 0x24, 0x02, 0xF5, 0x43, 0x7B, 0x01, 0x7A, -0x01, 0x79, 0xA0, 0x12, 0x34, 0x2C, 0x90, 0xA4, 0xB9, 0x12, 0x49, 0x94, 0x90, 0x00, 0x0E, 0x12, -0x26, 0x37, 0x90, 0x01, 0xAE, 0xF0, 0xA3, 0x74, 0xFF, 0xF0, 0x90, 0x01, 0xCB, 0xE0, 0x64, 0x80, -0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0xA5, 0x7E, -0x12, 0x49, 0x9D, 0x7F, 0x96, 0x7E, 0x02, 0x51, 0xB9, 0xEF, 0x60, 0x58, 0x90, 0x01, 0x17, 0xE0, -0xFE, 0x90, 0x01, 0x16, 0xE0, 0x7C, 0x00, 0x24, 0x00, 0xFF, 0xEC, 0x3E, 0xFE, 0xEF, 0x24, 0x01, -0xFF, 0xE4, 0x3E, 0xFE, 0x90, 0xA5, 0x81, 0xEF, 0xF0, 0xEE, 0xFF, 0x90, 0xFD, 0x11, 0xF0, 0x90, -0xA5, 0x81, 0xE0, 0xFD, 0x90, 0x02, 0x94, 0xF0, 0xA3, 0xEF, 0xF0, 0x90, 0xA5, 0x7E, 0x12, 0x49, -0x94, 0x90, 0x00, 0x0E, 0x12, 0x26, 0x37, 0x24, 0x02, 0xFF, 0xE4, 0x33, 0xFE, 0x71, 0x0F, 0x90, -0xA5, 0x81, 0xE0, 0x24, 0x18, 0xFF, 0x90, 0xA5, 0x7E, 0x12, 0x49, 0x94, 0x71, 0x6A, 0x90, 0x02, -0x96, 0x74, 0x01, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, -0x90, 0xA5, 0x76, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0xE4, 0xA3, 0xF0, 0xA3, 0xF0, 0x90, 0xA5, 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, 0xFA, 0x7B, 0x01, 0xC0, 0x03, 0xC0, 0x02, 0xC0, -0x01, 0x90, 0xA5, 0x7B, 0x12, 0x49, 0x94, 0x8B, 0x40, 0x8A, 0x41, 0x89, 0x42, 0x75, 0x43, 0x02, -0xD0, 0x01, 0xD0, 0x02, 0xD0, 0x03, 0x12, 0x34, 0x2C, 0x90, 0xA5, 0x7A, 0xE0, 0x24, 0x02, 0xF9, -0xE4, 0x34, 0xFB, 0xFA, 0x7B, 0x01, 0xC0, 0x03, 0xC0, 0x02, 0xC0, 0x01, 0xA3, 0x12, 0x49, 0x94, -0xE9, 0x24, 0x02, 0xF9, 0xE4, 0x3A, 0x8B, 0x40, 0xF5, 0x41, 0x89, 0x42, 0x90, 0xA5, 0x7B, 0x12, -0x49, 0x94, 0x90, 0x00, 0x0E, 0x12, 0x26, 0x37, 0xF5, 0x43, 0xD0, 0x01, 0xD0, 0x02, 0xD0, 0x03, -0x02, 0x34, 0x2C, 0x90, 0xA5, 0x5B, 0xEF, 0xF0, 0xAB, 0x05, 0x7E, 0x00, 0x7D, 0x00, 0x7C, 0x00, -0xE4, 0x90, 0xA5, 0x60, 0xF0, 0xEB, 0xFF, 0xE4, 0x90, 0xA5, 0x5C, 0x12, 0x27, 0x48, 0x90, 0xA5, -0x5C, 0x12, 0x49, 0x50, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0x7F, 0xB0, 0x7E, 0x08, 0x12, 0x37, -0x5D, 0x7F, 0x14, 0x7E, 0x00, 0x12, 0x3A, 0xF7, 0x90, 0xA5, 0x5B, 0xE0, 0x75, 0xF0, 0x08, 0xA4, -0x24, 0x73, 0xF5, 0x82, 0xE4, 0x34, 0xAF, 0xF5, 0x83, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x12, 0x36, -0xCE, 0xED, 0x54, 0x0F, 0xFD, 0xE4, 0xFC, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x71, -0xE3, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xC0, 0x07, 0xC0, -0x05, 0x90, 0xA5, 0x63, 0x12, 0x49, 0x50, 0x90, 0xAC, 0x9C, 0x12, 0x27, 0x48, 0xD0, 0x05, 0xD0, -0x07, 0x12, 0x32, 0x65, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xC0, 0xE0, 0xC0, 0xF0, 0xC0, 0x83, 0xC0, -0x82, 0xC0, 0xD0, 0x75, 0xD0, 0x00, 0xC0, 0x00, 0xC0, 0x01, 0xC0, 0x02, 0xC0, 0x03, 0xC0, 0x04, -0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0x01, 0xC4, 0x74, 0x69, 0xF0, 0x74, 0x5C, 0xA3, 0xF0, -0x91, 0xB8, 0x74, 0x69, 0x04, 0x90, 0x01, 0xC4, 0xF0, 0x74, 0x5C, 0xA3, 0xF0, 0xD0, 0x07, 0xD0, -0x06, 0xD0, 0x05, 0xD0, 0x04, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0xD0, 0xD0, 0xD0, -0x82, 0xD0, 0x83, 0xD0, 0xF0, 0xD0, 0xE0, 0x32, 0x7B, 0x00, 0x7A, 0x00, 0x79, 0x53, 0xE4, 0xFD, -0x7F, 0x01, 0x12, 0x39, 0x33, 0xE5, 0x51, 0x52, 0x53, 0x7B, 0x00, 0x7A, 0x00, 0x79, 0x54, 0x7D, -0x01, 0x7F, 0x01, 0x12, 0x39, 0x33, 0xE5, 0x52, 0x52, 0x54, 0xAB, 0x53, 0xE4, 0xFD, 0x7F, 0x01, -0x12, 0x39, 0x04, 0xAB, 0x54, 0x7D, 0x01, 0x7F, 0x01, 0x02, 0x39, 0x04, 0xC0, 0xE0, 0xC0, 0xF0, -0xC0, 0x83, 0xC0, 0x82, 0xC0, 0xD0, 0x75, 0xD0, 0x00, 0xC0, 0x00, 0xC0, 0x01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, 0x2B, 0xE5, 0x63, 0x30, 0xE1, 0x03, 0x12, 0x70, 0xC7, 0xE5, -0x63, 0x30, 0xE2, 0x03, 0x12, 0x57, 0x0B, 0xE5, 0x63, 0x30, 0xE3, 0x03, 0x12, 0x77, 0x3A, 0xE5, -0x63, 0x30, 0xE4, 0x03, 0x12, 0x77, 0x6D, 0xE5, 0x63, 0x30, 0xE5, 0x03, 0x12, 0x75, 0x36, 0xE5, -0x63, 0x30, 0xE6, 0x03, 0x12, 0x77, 0x9C, 0xE5, 0x64, 0x30, 0xE1, 0x03, 0x12, 0x57, 0xEA, 0xE5, -0x64, 0x30, 0xE4, 0x03, 0x12, 0x74, 0xF3, 0xE5, 0x64, 0x30, 0xE5, 0x02, 0xF1, 0x67, 0xE5, 0x64, -0x30, 0xE6, 0x02, 0xD1, 0xB8, 0x74, 0x75, 0x04, 0x90, 0x01, 0xC4, 0xF0, 0x74, 0x5D, 0xA3, 0xF0, -0xD0, 0x07, 0xD0, 0x06, 0xD0, 0x05, 0xD0, 0x04, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, -0xD0, 0xD0, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xF0, 0xD0, 0xE0, 0x32, 0xE4, 0xFF, 0x90, 0xA4, 0x39, -0xE0, 0x70, 0x02, 0xC1, 0xB7, 0x90, 0xA3, 0xB6, 0xE0, 0x64, 0x01, 0x70, 0x7A, 0x90, 0xA4, 0x38, -0xE0, 0xC4, 0x54, 0x0F, 0x60, 0x24, 0x24, 0xFE, 0x60, 0x03, 0x04, 0x70, 0x1F, 0x90, 0xA4, 0x40, -0xE0, 0x14, 0xF0, 0xE0, 0xFE, 0x60, 0x06, 0x90, 0xA4, 0x42, 0xE0, 0x60, 0x0F, 0xEE, 0x70, 0x06, -0x90, 0xA4, 0x3F, 0xE0, 0xA3, 0xF0, 0x7F, 0x01, 0x80, 0x02, 0x7F, 0x01, 0xEF, 0x60, 0x48, 0x90, -0xA4, 0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0x10, 0xF5, 0x82, 0xE4, 0x34, -0xA4, 0xF5, 0x83, 0xEF, 0xF0, 0x05, 0x10, 0xE5, 0x10, 0xB4, 0x08, 0xD0, 0x7B, 0x01, 0x7A, 0xA4, -0x79, 0xBD, 0x12, 0x69, 0x9A, 0xE5, 0x12, 0x04, 0x54, 0x0F, 0xF5, 0x12, 0xB4, 0x0F, 0x03, 0xE4, -0xF5, 0x12, 0x90, 0x04, 0x7F, 0xE5, 0x12, 0xF0, 0x90, 0xA4, 0xBC, 0xE0, 0x7F, 0x03, 0x70, 0x03, -0x02, 0x47, 0x27, 0x12, 0x47, 0x27, 0x22, 0x90, 0xA4, 0x70, 0xE0, 0x04, 0xF0, 0xE4, 0xF5, 0x10, -0x90, 0x04, 0x30, 0xE0, 0xB4, 0x01, 0x06, 0x90, 0x04, 0xCF, 0x74, 0x30, 0xF0, 0x74, 0xB6, 0x25, -0x10, 0xF5, 0x82, 0xE4, 0x34, 0xA3, 0xF5, 0x83, 0xE0, 0x70, 0x03, 0x02, 0x60, 0x6E, 0xE5, 0x10, -0x13, 0x13, 0x13, 0x54, 0x1F, 0xFF, 0xE5, 0x10, 0x54, 0x07, 0xFE, 0x74, 0x81, 0x2F, 0xF5, 0x82, -0xE4, 0x34, 0x93, 0xF5, 0x83, 0xE0, 0xFD, 0xAF, 0x06, 0x74, 0x01, 0x7E, 0x00, 0xA8, 0x07, 0x08, -0x80, 0x05, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, 0xF9, 0xFF, 0xEF, 0x5D, 0x70, 0x03, 0x02, 0x60, -0x6E, 0x75, 0xF0, 0x10, 0xE5, 0x10, 0x90, 0x81, 0x01, 0x12, 0x49, 0x88, 0xE0, 0x20, 0xE7, 0x02, -0x80, 0x10, 0x75, 0xF0, 0x10, 0xE5, 0x10, 0x90, 0x81, 0x02, 0x12, 0x49, 0x88, 0xE0, 0xFF, 0x20, -0xE7, 0x0A, 0x90, 0x01, 0xC1, 0xE0, 0x44, 0x20, 0xF0, 0x02, 0x60, 0x6E, 0xEF, 0x30, 0xE6, 0x25, -0x90, 0xA4, 0x6D, 0xE0, 0x04, 0xF0, 0x75, 0xF0, 0x10, 0xE5, 0x10, 0x90, 0x81, 0x00, 0x12, 0x49, -0x88, 0xE0, 0xFD, 0x75, 0xF0, 0x09, 0xE5, 0x10, 0x90, 0x95, 0x96, 0x12, 0x49, 0x88, 0xE0, 0xF5, -0x23, 0xE4, 0xFB, 0x80, 0x55, 0x90, 0xA4, 0x6E, 0xE0, 0x04, 0xF0, 0x74, 0x94, 0x25, 0x10, 0xF5, -0x82, 0xE4, 0x34, 0xA1, 0xF5, 0x83, 0xE0, 0x04, 0xF0, 0x74, 0x94, 0x25, 0x10, 0xF5, 0x82, 0xE4, -0x34, 0xA1, 0xF5, 0x83, 0xE0, 0xD3, 0x94, 0x03, 0x40, 0x13, 0xAF, 0x10, 0x11, 0x7B, 0x74, 0x94, -0x25, 0x10, 0xF5, 0x82, 0xE4, 0x34, 0xA1, 0xF5, 0x83, 0xE4, 0xF0, 0x80, 0x21, 0x75, 0xF0, 0x10, -0xE5, 0x10, 0x90, 0x81, 0x00, 0x12, 0x49, 0x88, 0xE0, 0xFD, 0x75, 0xF0, 0x09, 0xE5, 0x10, 0x90, -0x95, 0x96, 0x12, 0x49, 0x88, 0xE0, 0xF5, 0x23, 0x7B, 0x01, 0xAF, 0x10, 0x31, 0x84, 0x05, 0x10, -0xE5, 0x10, 0xC3, 0x94, 0x80, 0x50, 0x03, 0x02, 0x5F, 0x70, 0x22, 0xAD, 0x07, 0x90, 0x01, 0xC4, -0x74, 0x7B, 0xF0, 0x74, 0x60, 0xA3, 0xF0, 0x74, 0x94, 0x2D, 0xF5, 0x82, 0xE4, 0x34, 0xA2, 0xF5, -0x83, 0xE0, 0x64, 0x13, 0x70, 0x6E, 0x74, 0x14, 0x2D, 0xF5, 0x82, 0xE4, 0x34, 0xA2, 0xF5, 0x83, -0xE0, 0x04, 0xF0, 0x74, 0x14, 0x2D, 0xF5, 0x82, 0xE4, 0x34, 0xA2, 0xF5, 0x83, 0xE0, 0xC3, 0x94, -0x03, 0x40, 0x51, 0x74, 0x14, 0x2D, 0xF5, 0x82, 0xE4, 0x34, 0xA2, 0xF5, 0x83, 0xE4, 0xF0, 0x74, -0x93, 0x2D, 0xF5, 0x82, 0xE4, 0x34, 0x9C, 0xF5, 0x83, 0xE0, 0xFF, 0x74, 0x91, 0x2D, 0xF5, 0x82, -0xE4, 0x34, 0x93, 0xF5, 0x83, 0xEF, 0xF0, 0x74, 0x93, 0x2D, 0xF5, 0x82, 0xE4, 0x34, 0x9C, 0xF5, -0x83, 0xE0, 0x24, 0x1E, 0xFF, 0xE4, 0x33, 0xFE, 0xEF, 0x78, 0x02, 0xC3, 0x33, 0xCE, 0x33, 0xCE, -0xD8, 0xF9, 0xFF, 0xED, 0x25, 0xE0, 0x24, 0x14, 0xF5, 0x82, 0xE4, 0x34, 0x9D, 0xF5, 0x83, 0xEE, -0xF0, 0xA3, 0xEF, 0xF0, 0x75, 0xF0, 0x10, 0xED, 0x90, 0x81, 0x05, 0x12, 0x49, 0x88, 0xE0, 0x54, -0x03, 0xFE, 0x75, 0xF0, 0x09, 0xED, 0x90, 0x95, 0x93, 0x12, 0x49, 0x88, 0xE0, 0xFF, 0x74, 0x94, -0x2D, 0xF5, 0x82, 0xE4, 0x34, 0xA2, 0xF5, 0x83, 0xE0, 0x54, 0x7F, 0xF5, 0x11, 0xB4, 0x2C, 0x1B, -0x75, 0xF0, 0x09, 0xED, 0x90, 0x95, 0x97, 0x12, 0x49, 0x88, 0xE0, 0x6E, 0x60, 0x0D, 0x1E, 0x75, -0xF0, 0x09, 0xED, 0x90, 0x95, 0x96, 0x12, 0x49, 0x88, 0xEE, 0xF0, 0xE5, 0x11, 0xD3, 0x9F, 0x40, -0x02, 0x8F, 0x11, 0xAF, 0x05, 0x8E, 0x23, 0xE4, 0xFB, 0xAD, 0x11, 0x31, 0x84, 0xAF, 0x11, 0x22, -0xF5, 0x26, 0x74, 0x14, 0x25, 0x24, 0xF5, 0x82, 0xE4, 0x34, 0xA1, 0xF5, 0x83, 0xE5, 0x26, 0xF0, -0x75, 0xF0, 0x09, 0xE5, 0x24, 0x90, 0x95, 0x96, 0x12, 0x49, 0x88, 0xE0, 0xF5, 0x23, 0xE4, 0xFB, -0xAD, 0x26, 0xAF, 0x24, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x8F, 0x20, 0x8D, 0x21, 0xE5, -0x20, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x90, 0xA5, 0x82, 0xF0, 0xE5, 0x20, 0x54, 0x07, 0x90, 0xA5, -0x84, 0xF0, 0x75, 0xF0, 0x10, 0xEF, 0x90, 0x81, 0x01, 0x12, 0x49, 0x88, 0xE0, 0x90, 0xA5, 0x85, -0xF0, 0xE5, 0x21, 0xB4, 0x3F, 0x11, 0x75, 0xF0, 0x09, 0xEF, 0x90, 0x95, 0x98, 0x12, 0x49, 0x88, -0xE0, 0xB4, 0x01, 0x03, 0x75, 0x21, 0xBE, 0xE5, 0x21, 0x54, 0x7F, 0x90, 0xA5, 0x83, 0xF0, 0x75, -0xF0, 0x09, 0xE5, 0x20, 0x90, 0x95, 0x99, 0x12, 0x49, 0x88, 0xE0, 0x70, 0x40, 0x90, 0xA5, 0x83, -0xE0, 0xFF, 0xC3, 0x94, 0x14, 0x40, 0x0D, 0xEF, 0xD3, 0x94, 0x16, 0x50, 0x07, 0x90, 0x04, 0x33, -0x74, 0x08, 0x80, 0x36, 0xEF, 0xC3, 0x94, 0x17, 0x40, 0x15, 0xEF, 0xD3, 0x94, 0x18, 0x50, 0x0F, -0x90, 0x04, 0x33, 0x74, 0x01, 0xF0, 0xA3, 0x74, 0x03, 0xF0, 0xA3, 0x74, 0x0A, 0x41, 0x98, 0x90, -0x04, 0x33, 0x74, 0x01, 0xF0, 0xA3, 0x74, 0x04, 0xF0, 0xA3, 0x04, 0x80, 0x7B, 0x90, 0xA5, 0x83, -0xE0, 0xFF, 0xB4, 0x36, 0x0D, 0x90, 0x04, 0x33, 0x74, 0x09, 0xF0, 0xA3, 0x04, 0xF0, 0xA3, 0x04, -0x80, 0x66, 0xEF, 0xC3, 0x94, 0x37, 0x40, 0x14, 0xEF, 0xD3, 0x94, 0x38, 0x50, 0x0E, 0x90, 0x04, -0x33, 0x74, 0x01, 0xF0, 0xA3, 0x74, 0x0A, 0xF0, 0xA3, 0x04, 0x80, 0x4C, 0xEF, 0xB4, 0x39, 0x0F, -0x90, 0x04, 0x33, 0x74, 0x01, 0xF0, 0xA3, 0x74, 0x03, 0xF0, 0xA3, 0x74, 0x0B, 0x80, 0x39, 0xEF, -0xB4, 0x3A, 0x12, 0x90, 0x04, 0x33, 0x74, 0x01, 0xF0, 0xA3, 0x74, 0x03, 0xF0, 0xA3, 0x04, 0xF0, -0xA3, 0x74, 0x0C, 0x80, 0x26, 0xEF, 0x90, 0x04, 0x33, 0xB4, 0x3B, 0x13, 0x74, 0x01, 0xF0, 0xA3, -0x74, 0x03, 0xF0, 0xA3, 0x04, 0xF0, 0xA3, 0x04, 0xF0, 0xA3, 0x74, 0x0D, 0xF0, 0x80, 0x10, 0x74, -0x01, 0xF0, 0xA3, 0x74, 0x03, 0xF0, 0xA3, 0x04, 0xF0, 0xA3, 0x04, 0xF0, 0xA3, 0x04, 0xF0, 0xEB, -0x70, 0x3F, 0x90, 0x04, 0x30, 0xE0, 0x70, 0x06, 0x90, 0x04, 0xCF, 0x74, 0x30, 0xF0, 0x90, 0xA5, -0x82, 0xE0, 0x24, 0x81, 0xF5, 0x82, 0xE4, 0x34, 0x93, 0xF5, 0x83, 0xC0, 0x83, 0xC0, 0x82, 0xE0, -0xFF, 0x90, 0xA5, 0x84, 0xE0, 0xFE, 0x74, 0x01, 0xA8, 0x06, 0x08, 0x80, 0x02, 0xC3, 0x33, 0xD8, -0xFC, 0xF4, 0x5F, 0xD0, 0x82, 0xD0, 0x83, 0xF0, 0x90, 0xA5, 0x85, 0xE0, 0x54, 0x7F, 0xF0, 0x80, -0x70, 0x90, 0x04, 0x30, 0xE0, 0x70, 0x19, 0x74, 0x13, 0x25, 0x20, 0xF5, 0x82, 0xE4, 0x34, 0x9B, -0xF5, 0x83, 0xE0, 0x90, 0x04, 0xCF, 0xB4, 0x01, 0x05, 0x74, 0x20, 0xF0, 0x80, 0x02, 0xE4, 0xF0, -0x90, 0xA5, 0x82, 0xE0, 0x24, 0x81, 0xF5, 0x82, 0xE4, 0x34, 0x93, 0xF5, 0x83, 0xC0, 0x83, 0xC0, -0x82, 0xE0, 0xFF, 0x90, 0xA5, 0x84, 0xE0, 0xFE, 0x74, 0x01, 0xA8, 0x06, 0x08, 0x80, 0x02, 0xC3, -0x33, 0xD8, 0xFC, 0x4F, 0xD0, 0x82, 0xD0, 0x83, 0xF0, 0x75, 0xF0, 0x10, 0xE5, 0x20, 0x90, 0x81, -0x01, 0x12, 0x49, 0x88, 0xE0, 0x54, 0x07, 0xFF, 0x90, 0xA5, 0x85, 0xF0, 0x90, 0xA5, 0x83, 0xE0, -0x90, 0x44, 0x31, 0x93, 0x33, 0x33, 0x33, 0x54, 0xF8, 0x4F, 0x90, 0xA5, 0x85, 0xF0, 0x44, 0x80, -0xF0, 0x90, 0xA5, 0x83, 0xE0, 0xFB, 0x25, 0xE0, 0x24, 0x7D, 0xF5, 0x82, 0xE4, 0x34, 0x43, 0xF5, -0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0xE4, 0xFC, 0xFD, 0x75, 0xF0, 0x04, 0xEB, 0x90, -0x42, 0x2D, 0x12, 0x49, 0x88, 0x12, 0x49, 0x78, 0x12, 0x49, 0x18, 0x78, 0x01, 0x12, 0x27, 0x22, -0xE5, 0x20, 0x25, 0xE0, 0x24, 0x11, 0xF5, 0x82, 0xE4, 0x34, 0x94, 0xF5, 0x83, 0xEE, 0xF0, 0xA3, -0xEF, 0xF0, 0x75, 0xF0, 0x10, 0xE5, 0x20, 0x90, 0x81, 0x00, 0x12, 0x49, 0x88, 0xE5, 0x21, 0xF0, -0x90, 0xA5, 0x85, 0xE0, 0xFF, 0x75, 0xF0, 0x10, 0xE5, 0x20, 0x90, 0x81, 0x01, 0x12, 0x49, 0x88, -0xEF, 0xF0, 0x75, 0xF0, 0x10, 0xE5, 0x20, 0x90, 0x81, 0x05, 0x12, 0x49, 0x88, 0xE0, 0x54, 0xFC, -0x45, 0x23, 0xFF, 0x75, 0xF0, 0x10, 0xE5, 0x20, 0x90, 0x81, 0x05, 0x12, 0x49, 0x88, 0xEF, 0xF0, -0x7D, 0x01, 0xAF, 0x20, 0xD1, 0x7F, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, -0xC0, 0xD0, 0x8F, 0x24, 0x90, 0xA4, 0x72, 0xE0, 0x04, 0xF0, 0x75, 0xF0, 0x09, 0xEF, 0x90, 0x95, -0x95, 0x12, 0x49, 0x88, 0xE0, 0x90, 0xA5, 0x73, 0xF0, 0x12, 0x49, 0xA6, 0x64, 0x2D, 0x00, 0x64, -0x2D, 0x01, 0x64, 0x2D, 0x02, 0x64, 0x2D, 0x03, 0x64, 0x2D, 0x04, 0x64, 0x2D, 0x05, 0x64, 0x2D, -0x06, 0x64, 0x2D, 0x07, 0x64, 0x2D, 0x08, 0x64, 0x8F, 0x09, 0x64, 0x95, 0x0A, 0x64, 0x9B, 0x0B, -0x64, 0xA1, 0x0C, 0x64, 0xA7, 0x0D, 0x64, 0xAD, 0x0E, 0x00, 0x00, 0x64, 0xB6, 0xE4, 0xF5, 0x25, -0x75, 0xF0, 0x08, 0xE5, 0x24, 0x90, 0x89, 0x00, 0x12, 0x49, 0x88, 0xE5, 0x82, 0x25, 0x25, 0xF5, -0x82, 0xE4, 0x35, 0x83, 0xF5, 0x83, 0xE0, 0xFF, 0x90, 0xA5, 0x73, 0xE0, 0x75, 0xF0, 0x07, 0xA4, -0x24, 0x50, 0xF5, 0x82, 0xE4, 0x34, 0x40, 0xF5, 0x83, 0xE5, 0x82, 0x25, 0x25, 0xF5, 0x82, 0xE4, -0x35, 0x83, 0xF5, 0x83, 0xE4, 0x93, 0xFE, 0xEF, 0x5E, 0xFF, 0x90, 0xA5, 0x75, 0xF0, 0x75, 0xF0, -0x08, 0xE5, 0x24, 0x90, 0x89, 0x00, 0x12, 0x49, 0x88, 0xE5, 0x82, 0x25, 0x25, 0xF5, 0x82, 0xE4, -0x35, 0x83, 0xF5, 0x83, 0xEF, 0xF0, 0x05, 0x25, 0xE5, 0x25, 0xB4, 0x07, 0xA3, 0x80, 0x27, 0xAD, -0x24, 0x7F, 0x44, 0x80, 0x1C, 0xAD, 0x24, 0x7F, 0x4C, 0x80, 0x16, 0xAD, 0x24, 0x7F, 0x8C, 0x80, -0x10, 0xAD, 0x24, 0x7F, 0x94, 0x80, 0x0A, 0xAD, 0x24, 0x7F, 0x9C, 0x80, 0x04, 0xAD, 0x24, 0x7F, -0xA4, 0x7E, 0x04, 0x12, 0x7C, 0xA7, 0x75, 0xF0, 0x09, 0xE5, 0x24, 0x90, 0x95, 0x99, 0x12, 0x49, -0x88, 0xE0, 0xFD, 0xE4, 0x90, 0xA5, 0x71, 0xF0, 0x7C, 0x06, 0x75, 0xF0, 0x08, 0xE5, 0x24, 0x90, -0x89, 0x00, 0xBC, 0x06, 0x12, 0x12, 0x49, 0x88, 0xE5, 0x82, 0x2C, 0xF5, 0x82, 0xE4, 0x35, 0x83, -0xF5, 0x83, 0xE0, 0x54, 0x0F, 0x80, 0x0E, 0x12, 0x49, 0x88, 0xE5, 0x82, 0x2C, 0xF5, 0x82, 0xE4, -0x35, 0x83, 0xF5, 0x83, 0xE0, 0x90, 0xA5, 0x74, 0xF0, 0x90, 0xA5, 0x74, 0xE0, 0x60, 0x64, 0x75, -0x25, 0x07, 0x74, 0x01, 0x7E, 0x00, 0xA8, 0x25, 0x08, 0x80, 0x05, 0xC3, 0x33, 0xCE, 0x33, 0xCE, -0xD8, 0xF9, 0xFF, 0x90, 0xA5, 0x74, 0xE0, 0xFB, 0xEF, 0x5B, 0x60, 0x3E, 0xEC, 0x75, 0xF0, 0x08, -0xA4, 0x25, 0x25, 0x90, 0xA5, 0x71, 0xF0, 0xBD, 0x01, 0x0C, 0xE0, 0xD3, 0x94, 0x0B, 0x40, 0x06, -0xE0, 0x24, 0x20, 0xF0, 0x80, 0x39, 0xBD, 0x02, 0x0F, 0x90, 0xA5, 0x71, 0xE0, 0xD3, 0x94, 0x1B, -0x40, 0x06, 0xE0, 0x24, 0x18, 0xF0, 0x80, 0x27, 0xBD, 0x03, 0x24, 0x90, 0xA5, 0x71, 0xE0, 0xD3, -0x94, 0x1B, 0x40, 0x1B, 0xE0, 0x24, 0x22, 0xF0, 0x80, 0x15, 0x15, 0x25, 0xE5, 0x25, 0xC3, 0x94, -0x00, 0x50, 0x9F, 0xEC, 0x60, 0x09, 0x1C, 0xEC, 0xC3, 0x94, 0x00, 0x40, 0x02, 0x81, 0xCA, 0xE4, -0x90, 0xA5, 0x72, 0xF0, 0xFC, 0x75, 0xF0, 0x08, 0xE5, 0x24, 0x90, 0x89, 0x00, 0xBC, 0x06, 0x12, -0x12, 0x49, 0x88, 0xE5, 0x82, 0x2C, 0xF5, 0x82, 0xE4, 0x35, 0x83, 0xF5, 0x83, 0xE0, 0x54, 0x0F, -0x80, 0x0E, 0x12, 0x49, 0x88, 0xE5, 0x82, 0x2C, 0xF5, 0x82, 0xE4, 0x35, 0x83, 0xF5, 0x83, 0xE0, -0x90, 0xA5, 0x74, 0xF0, 0x90, 0xA5, 0x74, 0xE0, 0x60, 0x63, 0xE4, 0xF5, 0x25, 0x74, 0x01, 0x7E, -0x00, 0xA8, 0x25, 0x08, 0x80, 0x05, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, 0xF9, 0xFF, 0x90, 0xA5, -0x74, 0xE0, 0xFB, 0xEF, 0x5B, 0x60, 0x3E, 0xEC, 0x75, 0xF0, 0x08, 0xA4, 0x25, 0x25, 0x90, 0xA5, -0x72, 0xF0, 0xBD, 0x01, 0x0C, 0xE0, 0xD3, 0x94, 0x0B, 0x40, 0x06, 0xE0, 0x24, 0x20, 0xF0, 0x80, -0x34, 0xBD, 0x02, 0x0F, 0x90, 0xA5, 0x72, 0xE0, 0xD3, 0x94, 0x1B, 0x40, 0x06, 0xE0, 0x24, 0x18, -0xF0, 0x80, 0x22, 0xBD, 0x03, 0x1F, 0x90, 0xA5, 0x72, 0xE0, 0xD3, 0x94, 0x1B, 0x40, 0x16, 0xE0, -0x24, 0x22, 0xF0, 0x80, 0x10, 0x05, 0x25, 0xE5, 0x25, 0x64, 0x08, 0x70, 0xA0, 0x0C, 0xEC, 0x64, -0x07, 0x60, 0x02, 0xA1, 0x75, 0x90, 0xA5, 0x71, 0xE0, 0xFF, 0x75, 0xF0, 0x09, 0xE5, 0x24, 0x90, -0x95, 0x93, 0x12, 0x49, 0x88, 0xEF, 0xF0, 0x90, 0xA5, 0x72, 0xE0, 0xFE, 0x75, 0xF0, 0x09, 0xE5, -0x24, 0x90, 0x95, 0x94, 0x12, 0x49, 0x88, 0xEE, 0xF0, 0x75, 0xF0, 0x10, 0xE5, 0x24, 0x90, 0x81, -0x00, 0x12, 0x49, 0x88, 0xE0, 0xFE, 0x54, 0x7F, 0xF5, 0x26, 0xEE, 0x54, 0x80, 0xF5, 0x27, 0xE5, -0x26, 0xD3, 0x9F, 0x40, 0x08, 0x90, 0xA5, 0x71, 0xE0, 0x45, 0x27, 0x31, 0x60, 0x90, 0xA5, 0x72, -0xE0, 0xFF, 0xE5, 0x26, 0xC3, 0x9F, 0x50, 0x05, 0xE5, 0x27, 0x4F, 0x31, 0x60, 0x75, 0xF0, 0x10, -0xE5, 0x24, 0x90, 0x81, 0x03, 0x12, 0x49, 0x88, 0xE4, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xD3, -0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xED, 0x60, 0x62, 0x75, 0xF0, 0x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0xE5, 0x69, 0x30, 0xE3, 0x03, 0x12, 0x77, 0xF4, 0xE5, 0x6A, 0x30, -0xE0, 0x03, 0x12, 0x78, 0x30, 0xE5, 0x6C, 0x30, 0xE1, 0x05, 0x7F, 0x03, 0x12, 0x47, 0x27, 0xE5, -0x6C, 0x30, 0xE4, 0x02, 0xF1, 0xA6, 0xE5, 0x6C, 0x30, 0xE5, 0x03, 0x12, 0x76, 0x3B, 0xE5, 0x6C, -0x30, 0xE6, 0x03, 0x12, 0x76, 0x73, 0x74, 0x0C, 0x04, 0x90, 0x01, 0xC4, 0xF0, 0x74, 0x67, 0xA3, -0xF0, 0xD0, 0x07, 0xD0, 0x06, 0xD0, 0x05, 0xD0, 0x04, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, -0x00, 0xD0, 0xD0, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xF0, 0xD0, 0xE0, 0x32, 0x90, 0xA4, 0x39, 0xE0, -0x60, 0x03, 0x12, 0x93, 0x84, 0x22, 0x12, 0x93, 0x44, 0x90, 0xA4, 0x3F, 0xE0, 0x14, 0x90, 0x05, -0x73, 0xF0, 0x7D, 0x02, 0x7F, 0x02, 0x12, 0x56, 0x51, 0x90, 0xA4, 0x53, 0xE0, 0x30, 0xE0, 0x2E, -0x90, 0xA3, 0xB6, 0xE0, 0xB4, 0x01, 0x27, 0x90, 0xA5, 0x9C, 0xE0, 0x04, 0xF0, 0xE0, 0xB4, 0x0A, -0x0B, 0x90, 0xA4, 0x55, 0xE0, 0x04, 0xF0, 0xE4, 0x90, 0xA5, 0x9C, 0xF0, 0x90, 0xA4, 0x55, 0xE0, -0xFF, 0x90, 0xA4, 0x54, 0xE0, 0xB5, 0x07, 0x06, 0xE4, 0xA3, 0xF0, 0x12, 0x71, 0x5A, 0x22, 0xC0, -0xE0, 0xC0, 0x83, 0xC0, 0x82, 0xC0, 0xD0, 0x75, 0xD0, 0x00, 0xC0, 0x05, 0xC0, 0x07, 0x7D, 0xEF, -0x90, 0x01, 0xC4, 0xED, 0xF0, 0x74, 0x67, 0xFF, 0xA3, 0xF0, 0xED, 0x04, 0x90, 0x01, 0xC4, 0xF0, -0xA3, 0xEF, 0xF0, 0xD0, 0x07, 0xD0, 0x05, 0xD0, 0xD0, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xE0, 0x32, -0x90, 0x02, 0x09, 0xE0, 0xFD, 0x12, 0x26, 0x1E, 0xFE, 0xAF, 0x05, 0xED, 0x2E, 0x90, 0xA3, 0x15, -0xF0, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0xFF, 0xED, 0x2F, 0x90, 0xA3, 0x16, 0xF0, 0x90, 0x00, -0x02, 0x12, 0x26, 0x37, 0xFF, 0xED, 0x2F, 0x90, 0xA3, 0x17, 0xF0, 0x90, 0x00, 0x03, 0x12, 0x26, -0x37, 0xFF, 0xED, 0x2F, 0x90, 0xA3, 0x18, 0xF0, 0x90, 0x00, 0x04, 0x12, 0x26, 0x37, 0xFF, 0xAE, -0x05, 0xED, 0x2F, 0x90, 0xA3, 0x19, 0xF0, 0x22, 0x12, 0x26, 0x1E, 0xFF, 0x54, 0x7F, 0x90, 0xA4, -0x39, 0xF0, 0xEF, 0xC4, 0x13, 0x13, 0x13, 0x54, 0x01, 0xA3, 0xF0, 0x90, 0x00, 0x01, 0x12, 0x26, -0x37, 0xFF, 0x54, 0xF0, 0xC4, 0x54, 0x0F, 0xFE, 0x90, 0xA4, 0x38, 0xE0, 0x54, 0xF0, 0x4E, 0xF0, -0x90, 0x00, 0x03, 0x12, 0x26, 0x37, 0x54, 0x01, 0x25, 0xE0, 0xFE, 0x90, 0xA4, 0x36, 0xE0, 0x54, -0xFD, 0x4E, 0xF0, 0xEF, 0x54, 0x0F, 0xC4, 0x54, 0xF0, 0xFF, 0x90, 0xA4, 0x38, 0xE0, 0x54, 0x0F, -0x4F, 0xF0, 0x90, 0x00, 0x04, 0x12, 0x26, 0x37, 0x90, 0xA4, 0x3B, 0xF0, 0x11, 0xE3, 0x90, 0x01, -0xB9, 0x74, 0x01, 0xF0, 0x90, 0x01, 0xB8, 0xF0, 0x90, 0xA4, 0x39, 0xE0, 0x90, 0x01, 0xBA, 0xF0, -0x90, 0xA4, 0x3B, 0xE0, 0x90, 0x01, 0xBB, 0xF0, 0x90, 0xA4, 0x38, 0xE0, 0x54, 0x0F, 0x90, 0x01, -0xBE, 0xF0, 0x22, 0x90, 0xA4, 0x90, 0x12, 0x49, 0x9D, 0x31, 0x12, 0x90, 0xA4, 0x39, 0xE0, 0xFF, -0x12, 0x56, 0xAE, 0x90, 0xA4, 0x39, 0xE0, 0x60, 0x18, 0x90, 0xA4, 0x90, 0x12, 0x49, 0x94, 0x90, -0x00, 0x01, 0x12, 0x26, 0x37, 0x54, 0x0F, 0xFF, 0x90, 0x00, 0x02, 0x12, 0x26, 0x37, 0xFD, 0x31, -0x23, 0x22, 0x90, 0xA4, 0x36, 0xE0, 0x54, 0xFB, 0xF0, 0xE4, 0x90, 0xA4, 0x42, 0xF0, 0x90, 0xA4, -0x3D, 0xF0, 0x22, 0xEF, 0x24, 0xFE, 0x60, 0x0C, 0x04, 0x70, 0x28, 0x90, 0xA4, 0x3F, 0x74, 0x01, -0xF0, 0xA3, 0xF0, 0x22, 0xED, 0x70, 0x0A, 0x90, 0xA4, 0x4D, 0xE0, 0x90, 0xA4, 0x3F, 0xF0, 0x80, -0x05, 0x90, 0xA4, 0x3F, 0xED, 0xF0, 0x90, 0xA4, 0x3F, 0xE0, 0xA3, 0xF0, 0x90, 0xA4, 0x37, 0xE0, -0x44, 0x08, 0xF0, 0x22, 0x90, 0x00, 0x02, 0x12, 0x26, 0x37, 0xFF, 0x30, 0xE0, 0x26, 0x12, 0x26, -0x1E, 0x90, 0xA4, 0x4A, 0xF0, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0x90, 0xA4, 0x4B, 0xF0, 0xEF, -0x54, 0xFE, 0xFF, 0xA3, 0xE0, 0x54, 0x01, 0x4F, 0xF0, 0x90, 0x00, 0x03, 0x12, 0x26, 0x37, 0x90, -0xA4, 0x4D, 0xF0, 0x22, 0x90, 0xA4, 0x4A, 0x74, 0x01, 0xF0, 0xA3, 0x74, 0x07, 0xF0, 0xA3, 0xE0, -0x54, 0x01, 0x44, 0x28, 0xF0, 0xA3, 0x74, 0x05, 0xF0, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, -0xD0, 0x90, 0xA3, 0xB0, 0xE0, 0xFF, 0x70, 0x06, 0xA3, 0xE0, 0x64, 0x09, 0x60, 0x0A, 0xEF, 0x14, -0xFF, 0x90, 0xA3, 0xB1, 0xE0, 0xB5, 0x07, 0x04, 0x7F, 0x01, 0x80, 0x02, 0x7F, 0x00, 0xEF, 0x60, -0x09, 0x90, 0x01, 0xC1, 0xE0, 0x44, 0x02, 0xF0, 0x80, 0x35, 0xC0, 0x01, 0x90, 0xA3, 0xB1, 0xE0, -0x75, 0xF0, 0x0F, 0xA4, 0x24, 0x1A, 0xF9, 0x74, 0xA3, 0x35, 0xF0, 0xA8, 0x01, 0xFC, 0x7D, 0x01, -0xD0, 0x01, 0x7E, 0x00, 0x7F, 0x0F, 0x12, 0x48, 0x79, 0x90, 0xA3, 0xB1, 0xE0, 0x04, 0xF0, 0xE0, -0x7F, 0x00, 0xB4, 0x0A, 0x02, 0x7F, 0x01, 0xEF, 0x60, 0x05, 0xE4, 0x90, 0xA3, 0xB1, 0xF0, 0xD0, -0xD0, 0x92, 0xAF, 0x22, 0x12, 0x26, 0x1E, 0xFD, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0xFC, 0xED, -0xC3, 0x94, 0x80, 0x90, 0xA4, 0x92, 0xED, 0x50, 0x3F, 0xF0, 0x25, 0xE0, 0x24, 0x94, 0xF5, 0x82, -0xE4, 0x34, 0x9F, 0xF5, 0x83, 0xE0, 0xFE, 0xA3, 0xE0, 0x90, 0xA4, 0x93, 0xF0, 0xEE, 0xA3, 0xF0, -0xED, 0x25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1, 0x21, 0xE1, 0x0E, 0x90, 0xA5, 0x8A, 0xE0, 0xFF, 0xF1, 0x91, 0xE1, 0x0E, -0x90, 0xA5, 0x8A, 0xE0, 0x24, 0x93, 0xF5, 0x82, 0xE4, 0x34, 0x9C, 0xF5, 0x83, 0xE0, 0xFB, 0xE4, -0xFD, 0xFF, 0x71, 0x24, 0x90, 0xA5, 0x8A, 0xE0, 0x75, 0xF0, 0x09, 0x90, 0x95, 0x96, 0x71, 0x1E, -0x90, 0xA5, 0x8A, 0xE0, 0x75, 0xF0, 0x09, 0x90, 0x95, 0x9B, 0x71, 0x1E, 0x90, 0xA5, 0x8A, 0xE0, -0x75, 0xF0, 0x09, 0x90, 0x95, 0x99, 0x71, 0x1E, 0x90, 0xA5, 0x8A, 0xE0, 0x75, 0xF0, 0x09, 0x90, -0x95, 0x93, 0x12, 0x49, 0x88, 0xE0, 0xFB, 0xE4, 0xFD, 0x0F, 0x71, 0x24, 0x90, 0xA5, 0x8A, 0xE0, -0x75, 0xF0, 0x09, 0x90, 0x95, 0x94, 0x71, 0x1E, 0x90, 0xA5, 0x8A, 0xE0, 0x75, 0xF0, 0x09, 0x90, -0x95, 0x98, 0x71, 0x1E, 0x90, 0xA5, 0x8A, 0xE0, 0x75, 0xF0, 0x09, 0x90, 0x95, 0x95, 0x71, 0x1E, -0x90, 0xA5, 0x8A, 0xE0, 0x75, 0xF0, 0x08, 0x90, 0x89, 0x00, 0x12, 0x49, 0x88, 0xE0, 0xFB, 0xE4, -0xFD, 0x0F, 0x71, 0x24, 0x90, 0xA5, 0x8A, 0xE0, 0x75, 0xF0, 0x08, 0x90, 0x89, 0x01, 0x71, 0x1E, -0x90, 0xA5, 0x8A, 0xE0, 0x75, 0xF0, 0x08, 0x90, 0x89, 0x02, 0x71, 0x1E, 0x90, 0xA5, 0x8A, 0xE0, -0x75, 0xF0, 0x08, 0x90, 0x89, 0x03, 0x71, 0x1E, 0x90, 0xA5, 0x8A, 0xE0, 0x75, 0xF0, 0x08, 0x90, -0x89, 0x04, 0x12, 0x49, 0x88, 0xE0, 0xFB, 0xE4, 0xFD, 0x0F, 0x71, 0x24, 0x90, 0xA5, 0x8A, 0xE0, -0x75, 0xF0, 0x08, 0x90, 0x89, 0x05, 0x71, 0x1E, 0x90, 0xA5, 0x8A, 0xE0, 0x75, 0xF0, 0x08, 0x90, -0x89, 0x06, 0x71, 0x1E, 0x90, 0xA5, 0x8A, 0xE0, 0x75, 0xF0, 0x08, 0x90, 0x89, 0x07, 0x12, 0x49, -0x88, 0xC1, 0x50, 0x90, 0xA5, 0x8A, 0xE0, 0x25, 0xE0, 0x24, 0x01, 0xF5, 0x82, 0xE4, 0x34, 0x92, -0xF5, 0x83, 0xA3, 0xE0, 0xFB, 0xE4, 0xFD, 0xFF, 0x71, 0x24, 0x90, 0xA5, 0x8A, 0xE0, 0x25, 0xE0, -0x24, 0x01, 0xF5, 0x82, 0xE4, 0x34, 0x92, 0xF5, 0x83, 0xE0, 0xFB, 0x0D, 0x71, 0x24, 0x90, 0xA5, -0x8A, 0xE0, 0x75, 0xF0, 0x0A, 0x90, 0x8D, 0x01, 0x12, 0x49, 0x88, 0xA3, 0xE0, 0xFB, 0x0D, 0x71, -0x24, 0x90, 0xA5, 0x8A, 0xE0, 0x75, 0xF0, 0x0A, 0x90, 0x8D, 0x01, 0x71, 0x1E, 0x90, 0xA5, 0x8A, -0xE0, 0x75, 0xF0, 0x0A, 0x90, 0x8D, 0x03, 0x12, 0x49, 0x88, 0xA3, 0xE0, 0xFB, 0xE4, 0xFD, 0x0F, -0x71, 0x24, 0x90, 0xA5, 0x8A, 0xE0, 0x75, 0xF0, 0x0A, 0x90, 0x8D, 0x05, 0x12, 0x49, 0x88, 0xA3, -0xE0, 0xFB, 0x0D, 0x71, 0x24, 0x90, 0xA5, 0x8A, 0xE0, 0x75, 0xF0, 0x0A, 0x90, 0x8D, 0x07, 0x12, -0x49, 0x88, 0xA3, 0xE0, 0xFB, 0x0D, 0x71, 0x24, 0x90,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xE4, 0xFD, 0x0F, 0x71, 0x24, 0x90, 0xA4, 0x36, -0xE0, 0x54, 0x01, 0xFB, 0x0D, 0x71, 0x24, 0x90, 0xA4, 0x36, 0xE0, 0x13, 0x13, 0x13, 0x54, 0x01, -0xFB, 0x0D, 0x7F, 0x01, 0x71, 0x24, 0x90, 0xA4, 0x36, 0xE0, 0xC4, 0x54, 0x01, 0xFB, 0x0D, 0x7F, -0x01, 0x71, 0x24, 0x90, 0xA4, 0x42, 0xE0, 0xFB, 0xE4, 0xFD, 0x0F, 0x71, 0x24, 0x90, 0xA4, 0x41, -0xE0, 0xFB, 0x0D, 0x71, 0x24, 0x90, 0xA4, 0x40, 0xE0, 0xFB, 0x0D, 0x71, 0x24, 0x90, 0xA4, 0x3F, -0xE0, 0xFB, 0x0D, 0x71, 0x24, 0x90, 0xA4, 0x38, 0xE0, 0xC4, 0x54, 0x0F, 0xFB, 0xE4, 0xFD, 0x7F, -0x03, 0x71, 0x24, 0x90, 0xA4, 0x37, 0xE0, 0x13, 0x13, 0x54, 0x01, 0xFB, 0x0D, 0x7F, 0x03, 0x71, -0x24, 0x90, 0xA4, 0x37, 0xE0, 0x13, 0x13, 0x13, 0x54, 0x01, 0xFB, 0x0D, 0x7F, 0x03, 0x71, 0x24, -0x90, 0xA4, 0x36, 0xE0, 0x13, 0x13, 0x54, 0x01, 0xFB, 0x0D, 0x7F, 0x03, 0x71, 0x24, 0x90, 0x00, -0x8F, 0xE0, 0x30, 0xE0, 0x07, 0xE4, 0xFD, 0x7F, 0x8D, 0x12, 0x3A, 0x96, 0xD0, 0xD0, 0x92, 0xAF, -0x22, 0x90, 0xA5, 0x95, 0xEF, 0xF0, 0x90, 0x00, 0x8F, 0xE0, 0x30, 0xE6, 0x63, 0x90, 0x00, 0x8D, -0xE0, 0x64, 0x02, 0x70, 0x5B, 0x90, 0xA5, 0x96, 0xF0, 0x90, 0xA5, 0x96, 0xE0, 0xFD, 0x90, 0xA5, -0x95, 0xE0, 0x75, 0xF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xF0, 0xA3, 0xE5, 0x6A, 0xF0, 0xA3, 0xE5, 0x6B, 0xF0, 0xA3, -0xE5, 0x6C, 0xF0, 0x53, 0x91, 0xDF, 0x22, 0x90, 0xA4, 0x39, 0xE0, 0x60, 0x46, 0x90, 0xA4, 0x37, -0xE0, 0xFF, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x30, 0xE0, 0x13, 0x90, 0x01, 0x3B, 0xE0, 0x30, 0xE4, -0x0C, 0x12, 0x56, 0xE9, 0x90, 0xA4, 0x3F, 0xE0, 0x14, 0x90, 0x05, 0x73, 0xF0, 0x90, 0xA5, 0x8B, -0xE4, 0x75, 0xF0, 0x01, 0x12, 0x48, 0x9F, 0xC3, 0x90, 0xA5, 0x8C, 0xE0, 0x94, 0x80, 0x90, 0xA5, -0x8B, 0xE0, 0x64, 0x80, 0x94, 0x80, 0x40, 0x0B, 0x90, 0x01, 0x98, 0xE0, 0x54, 0xFE, 0xF0, 0xE0, -0x44, 0x01, 0xF0, 0x31, 0x26, 0x12, 0x67, 0xB9, 0xE4, 0xFF, 0x71, 0x29, 0x12, 0x85, 0xCF, 0x90, -0xA4, 0x71, 0xE0, 0x04, 0xF0, 0x22, 0x90, 0xA4, 0x56, 0xE0, 0x30, 0xE0, 0x2C, 0x90, 0xA4, 0x59, -0xE0, 0x04, 0xF0, 0xE0, 0xFF, 0x90, 0xA4, 0x57, 0xE0, 0xB5, 0x07, 0x1D, 0x90, 0x06, 0x92, 0xE0, -0x54, 0x1C, 0x70, 0x0A, 0x31, 0x5A, 0x90, 0xA4, 0x5A, 0xE0, 0x04, 0xF0, 0x80, 0x06, 0x90, 0x06, -0x92, 0x74, 0x1C, 0xF0, 0xE4, 0x90, 0xA4, 0x59, 0xF0, 0x22, 0xE4, 0xFF, 0x8F, 0x6E, 0x90, 0x04, -0x1D, 0xE0, 0x60, 0x18, 0x90, 0x05, 0x22, 0xE0, 0xF5, 0x71, 0x74, 0xFF, 0xF0, 0xD1, 0xF2, 0xBF, -0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90, 0xA4, 0x5A, 0xE0, 0xFD, 0x60, 0x40, 0x74, 0x01, 0x7E, 0x00, 0xA8, 0x07, 0x08, 0x80, -0x05, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, 0xF9, 0xFF, 0x90, 0x04, 0xE0, 0xE0, 0xFB, 0xEF, 0x5B, -0x60, 0x06, 0xE4, 0x90, 0xA4, 0x5A, 0xF0, 0x22, 0x90, 0xA4, 0x58, 0xE0, 0xD3, 0x9D, 0x50, 0x10, -0x90, 0x01, 0xC7, 0x74, 0x10, 0xF0, 0xB1, 0x0C, 0x90, 0xA4, 0x56, 0xE0, 0x54, 0xFE, 0xF0, 0x22, -0x31, 0x5A, 0x90, 0xA4, 0x5A, 0xE0, 0x04, 0xF0, 0x22, 0x90, 0xA4, 0xBC, 0xEF, 0xF0, 0xE4, 0xF5, -0x12, 0x74, 0xBD, 0x25, 0x12, 0xF5, 0x82, 0xE4, 0x34, 0xA4, 0xF5, 0x83, 0xE4, 0xF0, 0x75, 0xF0, -0x10, 0xE5, 0x12, 0x90, 0x81, 0x03, 0x12, 0x49, 0x88, 0xE0, 0xFF, 0x30, 0xE7, 0x10, 0xE5, 0x12, -0x70, 0x1E, 0xEF, 0x30, 0xE6, 0x1A, 0x90, 0xA4, 0x6C, 0xE0, 0x04, 0xF0, 0x80, 0x12, 0xAF, 0x12, -0x91, 0xFD, 0x74, 0xBD, 0x25, 0x12, 0xF5, 0x82, 0xE4, 0x34, 0xA4, 0xF5, 0x83, 0x74, 0x01, 0xF0, -0x05, 0x12, 0xE5, 0x12, 0xC3, 0x94, 0x80, 0x40, 0xB8, 0x7F, 0x0C, 0x7E, 0x00, 0x12, 0x3A, 0xF7, -0xE4, 0xF5, 0x12, 0x74, 0xBD, 0x25, 0x12, 0xF5, 0x82, 0xE4, 0x34, 0xA4, 0xF5, 0x83, 0xE0, 0x70, -0x02, 0x81, 0xE7, 0x75, 0xF0, 0x10, 0xE5, 0x12, 0x90, 0x81, 0x06, 0x12, 0x49, 0x88, 0xE0, 0xF5, -0x10, 0x75, 0xF0, 0x10, 0xE5, 0x12, 0x90, 0x81, 0x07, 0x12, 0x49, 0x88, 0xE0, 0xF5, 0x11, 0xFE, -0xE5, 0x10, 0xFF, 0xE5, 0x12, 0x25, 0xE0, 0x24, 0x01, 0xF5, 0x82, 0xE4, 0x34, 0x92, 0xF5, 0x83, -0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0x75, 0xF0, 0x10, 0xE5, 0x12, 0x90, 0x81, 0x0A, 0x12, 0x49, 0x88, -0xE0, 0xF5, 0x10, 0x75, 0xF0, 0x10, 0xE5, 0x12, 0x90, 0x81, 0x0B, 0x12, 0x49, 0x88, 0xE0, 0xF5, -0x11, 0xFE, 0xE5, 0x10, 0xFF, 0x75, 0xF0, 0x0A, 0xE5, 0x12, 0x90, 0x8D, 0x01, 0x12, 0x49, 0x88, -0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0x75, 0xF0, 0x10, 0xE5, 0x12, 0x90, 0x81, 0x0C, 0x12, 0x49, 0x88, -0xE0, 0xFF, 0x75, 0xF0, 0x0A, 0xE5, 0x12, 0x90, 0x8D, 0x03, 0x12, 0x49, 0x88, 0xE4, 0xF0, 0xA3, -0xEF, 0xF0, 0x75, 0xF0, 0x10, 0xE5, 0x12, 0x90, 0x81, 0x0D, 0x12, 0x49, 0x88, 0xE0, 0xFF, 0x75, -0xF0, 0x0A, 0xE5, 0x12, 0x90, 0x8D, 0x05, 0x12, 0x49, 0x88, 0xE4, 0xF0, 0xA3, 0xEF, 0xF0, 0x75, -0xF0, 0x10, 0xE5, 0x12, 0x90, 0x81, 0x0E, 0x12, 0x49, 0x88, 0xE0, 0xFF, 0x75, 0xF0, 0x0A, 0xE5, -0x12, 0x90, 0x8D, 0x07, 0x12, 0x49, 0x88, 0xE4, 0xF0, 0xA3, 0xEF, 0xF0, 0x75, 0xF0, 0x10, 0xE5, -0x12, 0x90, 0x81, 0x0F, 0x12, 0x49, 0x88, 0xE0, 0xFF, 0x75, 0xF0, 0x0A, 0xE5, 0x12, 0x90, 0x8D, -0x09, 0x12, 0x49, 0x88, 0xE4, 0xF0, 0xA3, 0xEF, 0xF0, 0x75, 0xF0, 0x10, 0xE5, 0x12, 0x90, 0x81, -0x09, 0x12, 0x49, 0x88, 0xE0, 0xFF, 0x74, 0x93, 0x25, 0x12, 0xF5, 0x82, 0xE4, 0x34, 0x9A, 0xF5, -0x83, 0xEF, 0xF0, 0xE5, 0x12, 0x70, 0x56, 0xE5, 0x11, 0x30, 0xE7, 0x05, 0x90, 0xA4, 0x6B, 0x80, -0x49, 0xE5, 0x11, 0x30, 0xE6, 0x05, 0x90, 0xA4, 0x6A, 0x80, 0x3F, 0xE5, 0x11, 0x30, 0xE5, 0x05, -0x90, 0xA4, 0x69, 0x80, 0x35, 0xE5, 0x11, 0x30, 0xE4, 0x05, 0x90, 0xA4, 0x68, 0x80, 0x2B, 0xE5, -0x11, 0x30, 0xE3, 0x05, 0x90, 0xA4, 0x67, 0x80, 0x21, 0xE5, 0x11, 0x30, 0xE2, 0x05, 0x90, 0xA4, -0x66, 0x80, 0x17, 0xE5, 0x11, 0x30, 0xE1, 0x05, 0x90, 0xA4, 0x65, 0x80, 0x0D, 0xE5, 0x11, 0x30, -0xE0, 0x05, 0x90, 0xA4, 0x64, 0x80, 0x03, 0x90, 0xA4, 0x63, 0xE0, 0x04, 0xF0, 0x90, 0xA4, 0xBC, -0xE0, 0xFD, 0xAF, 0x12, 0x12, 0x66, 0x7F, 0x05, 0x12, 0xE5, 0x12, 0xC3, 0x94, 0x80, 0x50, 0x02, -0x61, 0x83, 0x22, 0x90, 0xA4, 0x6F, 0xE0, 0x04, 0xF0, 0xE4, 0xFF, 0x61, 0x29, 0x75, 0xF0, 0x10, -0xEF, 0x90, 0x81, 0x03, 0x12, 0x49, 0x88, 0xE0, 0x44, 0x40, 0xF0, 0x22, 0x90, 0xA3, 0x14, 0xE0, -0x64, 0x02, 0x60, 0x07, 0x90, 0x06, 0x90, 0xE0, 0x44, 0x01, 0xF0, 0x22, 0x90, 0x04, 0x1D, 0xE0, -0x70, 0x13, 0x90, 0xA3, 0x16, 0xE0, 0xFF, 0xE4, 0xFD, 0x51, 0x6F, 0x8E, 0x10, 0x8F, 0x11, 0x90, -0x04, 0x1F, 0x74, 0x20, 0xF0, 0x22, 0x90, 0xA3, 0xB6, 0xE0, 0xB4, 0x01, 0x14, 0x90, 0xA4, 0x39, -0xE0, 0x60, 0x0E, 0x90, 0xA4, 0x38, 0xE0, 0x54, 0x0F, 0x64, 0x02, 0x60, 0x02, 0x80, 0xCD, 0xB1, -0x52, 0x22, 0x90, 0x01, 0x5F, 0xE4, 0xF0, 0x90, 0x01, 0x3C, 0x74, 0x08, 0xF0, 0xE4, 0xF5, 0x3B, -0x90, 0xA4, 0x4C, 0xE0, 0xC3, 0x13, 0x54, 0x7F, 0xF5, 0x3C, 0xE4, 0xFB, 0xFD, 0x7F, 0x5C, 0x7E, -0x01, 0x12, 0x34, 0x8C, 0x90, 0x01, 0x5F, 0x74, 0x05, 0xF0, 0x90, 0x06, 0x92, 0x74, 0x02, 0xF0, -0x90, 0xA4, 0x36, 0xE0, 0x44, 0x10, 0xF0, 0x90, 0xA4, 0x3C, 0xE0, 0x64, 0x0C, 0x60, 0x0B, 0xE4, -0xFD, 0x7F, 0x0C, 0x12, 0x50, 0x51, 0xE4, 0xFF, 0x31, 0x5C, 0x22, 0xE4, 0x90, 0xA4, 0xBC, 0xF0, -0x90, 0x06, 0xA9, 0xE0, 0x90, 0xA4, 0xBC, 0xF0, 0xE0, 0x54, 0xC0, 0x70, 0x0D, 0x90, 0xA4, 0x3D, -0xE0, 0x54, 0xFE, 0xF0, 0x54, 0xFD, 0xF0, 0x02, 0x50, 0x44, 0x90, 0xA4, 0xBC, 0xE0, 0x30, 0xE6, -0x21, 0x90, 0xA4, 0x39, 0xE0, 0x64, 0x01, 0x70, 0x20, 0x90, 0xA4, 0x3D, 0xE0, 0x44, 0x01, 0xF0, -0x90, 0xA4, 0x38, 0xE0, 0x54, 0x0F, 0x64, 0x02, 0x60, 0x04, 0xB1, 0x1C, 0x80, 0x0B, 0xB1, 0x52, -0x80, 0x07, 0x90, 0xA4, 0x3D, 0xE0, 0x54, 0xFE, 0xF0, 0x90, 0xA4, 0xBC, 0xE0, 0x90, 0xA4, 0x3D, -0x30, 0xE7, 0x25, 0xE0, 0x44, 0x02, 0xF0, 0xE4, 0xF5, 0x3B, 0x90, 0xA4, 0x4B, 0xE0, 0xF5, 0x3C, -0xE4, 0xFB, 0xFD, 0x7F, 0x54, 0x7E, 0x01, 0x12, 0x34, 0x8C, 0x90, 0x01, 0x57, 0x74, 0x05, 0xF0, -0x90, 0xA4, 0x36, 0xE0, 0x44, 0x04, 0xF0, 0x22, 0xE0, 0x54, 0xFD, 0xF0, 0x22, 0xE4, 0xFE, 0xEF, -0x25, 0xE0, 0xFD, 0xEF, 0xC3, 0x94, 0x80, 0x90, 0xFD, 0x12, 0x50, 0x04, 0xE4, 0xF0, 0x80, 0x03, -0x74, 0x01, 0xF0, 0x90, 0xFD, 0x10, 0xED, 0xF0, 0xAF, 0x06, 0x22, 0x90, 0xA4, 0x36, 0xE0, 0xFF, -0xC4, 0x13, 0x13, 0x54, 0x03, 0x30, 0xE0, 0x27, 0xEF, 0x54, 0xBF, 0xF0, 0x90, 0x04, 0xE0, 0xE0, -0x90, 0xA4, 0x37, 0x30, 0xE0, 0x06, 0xE0, 0x44, 0x01, 0xF0, 0x80, 0x10, 0xE0, 0x54, 0xFE, 0xF0, -0x90, 0x01, 0xB9, 0x74, 0x01, 0xF0, 0x90, 0x01, 0xB8, 0x74, 0x04, 0xF0, 0x12, 0x50, 0x44, 0xE4, -0xFF, 0x41, 0xDA, 0x90, 0xA4, 0x36, 0xE0, 0xFF, 0xC4, 0x13, 0x13, 0x13, 0x54, 0x01, 0x30, 0xE0, -0x2C, 0xEF, 0x54, 0x7F, 0xF0, 0x90, 0x04, 0xE0, 0xE0, 0x90, 0xA4, 0x37, 0x30, 0xE1, 0x06, 0xE0, -0x44, 0x02, 0xF0, 0x80, 0x0F, 0xE0, 0x54, 0xFD, 0xF0, 0x90, 0x01, 0xB9, 0x74, 0x01, 0xF0, 0x90, -0x01, 0xB8, 0x04, 0xF0, 0x90, 0xA4, 0x39, 0xE0, 0x60, 0x03, 0x12, 0x50, 0x44, 0x7F, 0x01, 0x41, -0xDA, 0xEF, 0x60, 0x3D, 0x90, 0xA3, 0xB6, 0xE0, 0x64, 0x01, 0x70, 0x35, 0x90, 0xA4, 0x37, 0xE0, -0x54, 0xFE, 0xF0, 0x90, 0x05, 0x22, 0x74, 0x0F, 0xF0, 0x90, 0x06, 0x04, 0xE0, 0x54, 0xBF, 0xF0, -0xE4, 0xFF, 0x31, 0x5C, 0xBF, 0x01, 0x0E, 0x90, 0xA4, 0x36, 0xE0, 0x44, 0x40, 0xF0, 0x90, 0xA4, -0x3C, 0x74, 0x06, 0xF0, 0x22, 0x90, 0x01, 0xB9, 0x74, 0x01, 0xF0, 0x90, 0x01, 0xB8, 0x74, 0x08, -0xF0, 0x22, 0xE4, 0x90, 0xA5, 0x8F, 0xF0, 0xA3, 0xF0, 0x90, 0x05, 0xF8, 0xE0, 0x70, 0x0F, 0xA3, -0xE0, 0x70, 0x0B, 0xA3, 0xE0, 0x70, 0x07, 0xA3, 0xE0, 0x70, 0x03, 0x7F, 0x01, 0x22, 0xD3, 0x90, -0xA5, 0x90, 0xE0, 0x94, 0xE8, 0x90, 0xA5, 0x8F, 0xE0, 0x94, 0x03, 0x40, 0x0A, 0x90, 0x01, 0xC0, -0xE0, 0x44, 0x20, 0xF0, 0x7F, 0x00, 0x22, 0x7F, 0x32, 0x7E, 0x00, 0x12, 0x3A, 0xF7, 0x90, 0xA5, -0x8F, 0xE4, 0x75, 0xF0, 0x01, 0x12, 0x48, 0x9F, 0x80, 0xBF, 0x90, 0xA3, 0xB6, 0xE0, 0x64, 0x01, -0x70, 0x2A, 0x90, 0xA4, 0x39, 0xE0, 0x60, 0x24, 0x90, 0x01, 0x57, 0xE4, 0xF0, 0x90, 0x01, 0x3C, -0x74, 0x02, 0xF0, 0xE4, 0xF5, 0x3B, 0x90, 0xA4, 0x4B, 0xE0, 0xF5, 0x3C, 0xE4, 0xFB, 0xFD, 0x7F, -0x54, 0x7E, 0x01, 0x12, 0x34, 0x8C, 0x90, 0x01, 0x57, 0x74, 0x05, 0xF0, 0x22, 0x90, 0xA3, 0xB6, -0xE0, 0x64, 0x01, 0x70, 0x26, 0x90, 0xA4, 0x39, 0xE0, 0x60, 0x20, 0x90, 0x01, 0x57, 0xE4, 0xF0, -0x90, 0x01, 0x3C, 0x74, 0x02, 0xF0, 0x90, 0xA4, 0x36, 0xE0, 0x54, 0xFB, 0xF0, 0x90, 0xA4, 0x3D, -0xE0, 0x54, 0xFD, 0xF0, 0x54, 0x07, 0x70, 0x03, 0x12, 0x50, 0x44, 0x22, 0x90, 0xA3, 0xB6, 0xE0, -0xB4, 0x01, 0x14, 0x90, 0xA4, 0x39, 0xE0, 0x60, 0x0E, 0x90, 0xA4, 0x3D, 0xE0, 0x54, 0xFE, 0xF0, -0x54, 0x07, 0x70, 0x03, 0x12, 0x50, 0x44, 0x22, 0x90, 0xA4, 0x39, 0xE0, 0x60, 0x35, 0x90, 0x06, -0x92, 0xE0, 0x30, 0xE0, 0x24, 0xE4, 0xF5, 0x3B, 0x90, 0xA4, 0x4C, 0xE0, 0xC3, 0x13, 0x54, 0x7F, -0xF5, 0x3C, 0xE4, 0xFB, 0xFD, 0x7F, 0x58, 0x7E, 0x01, 0x12, 0x34, 0x8C, 0x90, 0x01, 0x5B, 0x74, -0x05, 0xF0, 0x90, 0x06, 0x92, 0x74, 0x01, 0xF0, 0x22, 0x90, 0xA4, 0x36, 0xE0, 0x54, 0xF7, 0xF0, -0x12, 0x50, 0x44, 0x22, 0x90, 0xA4, 0x39, 0xE0, 0x60, 0x35, 0x90, 0x06, 0x92, 0xE0, 0x30, 0xE1, -0x24, 0xE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12, 0x48, 0x9F, 0x80, 0xC2, -0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x04, 0x1D, 0xE0, 0x60, 0x1A, 0x90, 0x05, 0x22, -0xE0, 0x54, 0x90, 0x60, 0x07, 0x90, 0x01, 0xC0, 0xE0, 0x44, 0x08, 0xF0, 0x90, 0x01, 0xC6, 0xE0, -0x30, 0xE1, 0xE4, 0x7F, 0x00, 0x80, 0x02, 0x7F, 0x01, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xC3, 0xEE, -0x94, 0x01, 0x40, 0x0A, 0x0D, 0xED, 0x13, 0x90, 0xFD, 0x10, 0xF0, 0xE4, 0x2F, 0xFF, 0x22, 0xC3, -0xEE, 0x94, 0x01, 0x40, 0x24, 0x90, 0xFD, 0x11, 0xE0, 0x6D, 0x70, 0x1A, 0x90, 0x01, 0x17, 0xE0, -0xB5, 0x05, 0x0D, 0x90, 0x01, 0xE4, 0x74, 0x77, 0xF0, 0x90, 0xFD, 0x11, 0xE4, 0xF0, 0x80, 0x06, -0xED, 0x04, 0x90, 0xFD, 0x11, 0xF0, 0xE4, 0x2F, 0xFF, 0x22, 0xEF, 0x70, 0x04, 0x7E, 0x03, 0x80, -0x07, 0xEF, 0x64, 0x01, 0x70, 0x19, 0x7E, 0x42, 0x90, 0x00, 0xE2, 0xED, 0xF0, 0x90, 0x00, 0xE0, -0xEB, 0xF0, 0x90, 0x00, 0xE3, 0xEE, 0xF0, 0x54, 0xFD, 0xF0, 0xE4, 0xF0, 0x7F, 0x01, 0x22, 0x90, -0x01, 0xC2, 0xE0, 0x44, 0x01, 0xF0, 0x7F, 0x00, 0x22, 0x8F, 0x75, 0xE4, 0x90, 0xA5, 0x91, 0xF0, -0xA3, 0xF0, 0x90, 0x01, 0x09, 0xE0, 0x7F, 0x00, 0x30, 0xE7, 0x02, 0x7F, 0x01, 0xEF, 0x65, 0x75, -0x60, 0x3E, 0xC3, 0x90, 0xA5, 0x92, 0xE0, 0x94, 0x88, 0x90, 0xA5, 0x91, 0xE0, 0x94, 0x13, 0x40, -0x08, 0x90, 0x01, 0xC0, 0xE0, 0x44, 0x10, 0xF0, 0x22, 0x90, 0xA5, 0x91, 0xE4, 0x75, 0xF0, 0x01, -0x12, 0x48, 0x9F, 0x7F, 0x14, 0x7E, 0x00, 0x12, 0x3A, 0xF7, 0xD3, 0x90, 0xA5, 0x92, 0xE0, 0x94, -0x32, 0x90, 0xA5, 0x91, 0xE0, 0x94, 0x00, 0x40, 0xB9, 0x90, 0x01, 0xC6, 0xE0, 0x30, 0xE0, 0xB2, -0x22, 0x51, 0x53, 0x90, 0x00, 0x08, 0xE0, 0x54, 0xEF, 0xFD, 0x7F, 0x08, 0x12, 0x3A, 0x96, 0xE4, -0xFF, 0x31, 0x59, 0x90, 0xA3, 0x14, 0xE0, 0xB4, 0x03, 0x0C, 0x90, 0x00, 0x70, 0xE0, 0x54, 0x7F, -0xFD, 0x7F, 0x70, 0x12, 0x3A, 0x96, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x31, 0xFB, -0x31, 0xB1, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0xA4, 0x3C, 0xE0, 0x70, 0x0D, 0x51, 0x70, 0xBF, -0x01, 0x08, 0x31, 0xD7, 0x90, 0x01, 0xE5, 0xE0, 0x04, 0xF0, 0x22, 0x90, 0xA3, 0x14, 0xE0, 0xB4, -0x03, 0x0C, 0x90, 0x00, 0x70, 0xE0, 0x44, 0x80, 0xFD, 0x7F, 0x70, 0x12, 0x3A, 0x96, 0x90, 0xA4, -0x43, 0xE0, 0xFD, 0x7F, 0x93, 0x12, 0x3A, 0x96, 0x90, 0xA4, 0x3A, 0xE0, 0x60, 0x12, 0x90, 0x01, -0x2F, 0xE0, 0x30, 0xE7, 0x05, 0x74, 0x10, 0xF0, 0x80, 0x06, 0x90, 0x01, 0x2F, 0x74, 0x90, 0xF0, -0x90, 0x00, 0x08, 0xE0, 0x44, 0x10, 0xFD, 0x7F, 0x08, 0x12, 0x3A, 0x96, 0x7F, 0x01, 0x31, 0x59, -0x90, 0x00, 0x90, 0xE0, 0x44, 0x01, 0xFD, 0x7F, 0x90, 0x12, 0x3A, 0x96, 0x7F, 0x14, 0x7E, 0x00, -0x02, 0x3A, 0xF7, 0x90, 0x00, 0x90, 0xE0, 0x20, 0xE0, 0xF9, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, -0xC0, 0xD0, 0x90, 0xA4, 0x36, 0xE0, 0x30, 0xE0, 0x02, 0x31, 0xE7, 0xD0, 0xD0, 0x92, 0xAF, 0x22, -0x90, 0x02, 0x87, 0xE0, 0x60, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x01, 0xF0, 0x80, 0x17, 0x90, 0x02, -0x86, 0xE0, 0x20, 0xE1, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x04, 0xF0, 0x80, 0x08, 0x90, 0x01, 0xB8, -0xE4, 0xF0, 0x7F, 0x01, 0x22, 0x90, 0x01, 0xB9, 0x74, 0x08, 0xF0, 0x7F, 0x00, 0x22, 0xE4, 0x90, -0xA4, 0x7B, 0xF0, 0xE4, 0x90, 0xA4, 0x7C, 0xF0, 0x90, 0xA4, 0x7C, 0xE0, 0xFF, 0xC3, 0x94, 0x10, -0x50, 0x74, 0x90, 0xA4, 0x7B, 0xE0, 0xFE, 0x24, 0x13, 0xF5, 0x82, 0xE4, 0x34, 0x9B, 0xF5, 0x83, -0x74, 0x03, 0xF0, 0xEF, 0x90, 0xA4, 0x7C, 0xB4, 0x03, 0x1B, 0xE0, 0xFF, 0x75, 0xF0, 0x10, 0xEE, -0x90, 0x81, 0x00, 0x12, 0x49, 0x88, 0xE5, 0x82, 0x2F, 0xF5, 0x82, 0xE4, 0x35, 0x83, 0xF5, 0x83, -0x74, 0x80, 0xF0, 0x80, 0x1B, 0xE0, 0xFF, 0x90, 0xA4, 0x7B, 0xE0, 0x75, 0xF0, 0x10, 0x90, 0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E4, 0xF0, 0xEF, 0x25, 0xE0, 0x24, 0x94, 0xF5, -0x82, 0xE4, 0x34, 0x9E, 0xF5, 0x83, 0xE4, 0xF0, 0xA3, 0xF0, 0xEF, 0x25, 0xE0, 0x24, 0x94, 0xF5, -0x82, 0xE4, 0x34, 0x9F, 0xF5, 0x83, 0xE4, 0xF0, 0xA3, 0xF0, 0x75, 0xF0, 0x09, 0xEF, 0x90, 0x95, -0x93, 0x12, 0x49, 0x88, 0x74, 0x3F, 0xF0, 0x75, 0xF0, 0x09, 0xEF, 0x90, 0x95, 0x94, 0x12, 0x49, -0x88, 0x74, 0x03, 0xF0, 0x75, 0xF0, 0x09, 0xEF, 0x90, 0x95, 0x95, 0x12, 0x49, 0x88, 0x74, 0x09, -0xF0, 0xF5, 0xF0, 0xEF, 0x90, 0x95, 0x96, 0x12, 0x49, 0x88, 0xE4, 0xF0, 0x75, 0xF0, 0x09, 0xEF, -0x90, 0x95, 0x97, 0x12, 0x49, 0x88, 0xE4, 0xF0, 0x75, 0xF0, 0x09, 0xEF, 0x90, 0x95, 0x98, 0x12, -0x49, 0x88, 0x74, 0x01, 0xF0, 0x75, 0xF0, 0x09, 0xEF, 0x90, 0x95, 0x99, 0x12, 0x49, 0x88, 0xE4, -0xF0, 0x75, 0xF0, 0x09, 0xEF, 0x90, 0x95, 0x9A, 0x12, 0x49, 0x88, 0x74, 0x01, 0xF0, 0x75, 0xF0, -0x09, 0xEF, 0x90, 0x95, 0x9B, 0x12, 0x49, 0x88, 0xE4, 0xF0, 0x75, 0xF0, 0x09, 0xEF, 0x90, 0x95, -0x93, 0x12, 0x49, 0x88, 0xE0, 0xFF, 0x90, 0xA4, 0x7B, 0xE0, 0xFE, 0x75, 0xF0, 0x10, 0x90, 0x81, -0x00, 0x12, 0x49, 0x88, 0xEF, 0xF0, 0x74, 0x11, 0x2E, 0xF5, 0x82, 0xE4, 0x34, 0x95, 0xF5, 0x83, -0xE4, 0xF0, 0x74, 0x13, 0x2E, 0xF5, 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, -0x89, 0x02, 0x12, 0x49, 0x88, 0xE0, 0x90, 0xA5, 0x58, 0xF0, 0x75, 0xF0, 0x08, 0xE5, 0x74, 0x90, -0x89, 0x03, 0x12, 0x49, 0x88, 0xE0, 0x90, 0xA5, 0x59, 0xF0, 0x90, 0xA5, 0x5A, 0xE0, 0xFD, 0xC3, -0x94, 0x02, 0x40, 0x61, 0x75, 0xF0, 0x08, 0xE5, 0x74, 0x90, 0x89, 0x00, 0x12, 0x49, 0x88, 0xE0, -0x90, 0xA5, 0x52, 0xF0, 0x75, 0xF0, 0x08, 0xE5, 0x74, 0x90, 0x89, 0x01, 0x12, 0x49, 0x88, 0xE0, -0x90, 0xA5, 0x53, 0xF0, 0x75, 0xF0, 0x08, 0xE5, 0x74, 0x90, 0x89, 0x02, 0x12, 0x49, 0x88, 0xE0, -0x90, 0xA5, 0x54, 0xF0, 0x75, 0xF0, 0x08, 0xE5, 0x74, 0x90, 0x89, 0x03, 0x12, 0x49, 0x88, 0xE0, -0xFE, 0x54, 0x0F, 0x90, 0xA5, 0x55, 0xF0, 0xEE, 0x54, 0xF0, 0x90, 0xA5, 0x51, 0xF0, 0xED, 0xB4, -0x03, 0x0B, 0xE0, 0x25, 0xE0, 0x25, 0xE0, 0x90, 0xA5, 0x59, 0xF0, 0x80, 0x08, 0x90, 0xA5, 0x51, -0xE0, 0x90, 0xA5, 0x58, 0xF0, 0xE4, 0x90, 0xA5, 0x50, 0xF0, 0x90, 0xA5, 0x50, 0xE0, 0xFF, 0x24, -0x52, 0xF5, 0x82, 0xE4, 0x34, 0xA5, 0xF5, 0x83, 0xC0, 0x83, 0xC0, 0x82, 0xE0, 0xFE, 0xEF, 0x7C, -0x00, 0x25, 0x73, 0xFD, 0xEC, 0x35, 0x72, 0x8D, 0x82, 0xF5, 0x83, 0xE0, 0xFF, 0xEE, 0x5F, 0xD0, -0x82, 0xD0, 0x83, 0xF0, 0x90, 0xA5, 0x50, 0xE0, 0x04, 0xF0, 0xE0, 0xB4, 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 0x01, 0xC4, 0x74, 0x92, 0xF0, 0x74, 0x7E, 0xA3, 0xF0, 0x75, 0xF0, -0x10, 0xE5, 0x1B, 0x90, 0x81, 0x00, 0x12, 0x49, 0x88, 0xE0, 0xFF, 0xBF, 0xBE, 0x02, 0x7F, 0x3F, -0x8F, 0x1C, 0xE4, 0xF5, 0x1F, 0xE5, 0x1C, 0x54, 0x7F, 0xF5, 0x1D, 0x75, 0xF0, 0x09, 0xE5, 0x1B, -0x90, 0x95, 0x93, 0x12, 0x49, 0x88, 0xE0, 0x90, 0xA4, 0xC7, 0xF0, 0x75, 0xF0, 0x09, 0xE5, 0x1B, -0x90, 0x95, 0x99, 0x12, 0x49, 0x88, 0xE0, 0x90, 0xA4, 0xC8, 0xF0, 0x75, 0xF0, 0x04, 0xE5, 0x1D, -0x90, 0x42, 0x2D, 0x12, 0x49, 0x88, 0x12, 0x49, 0x5C, 0xE5, 0x1B, 0x25, 0xE0, 0x24, 0x11, 0xF5, -0x82, 0xE4, 0x34, 0x94, 0xF5, 0x83, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0x75, 0xF0, 0x09, 0xE5, 0x1B, -0x90, 0x95, 0x96, 0x12, 0x49, 0x88, 0xE0, 0xF5, 0x1E, 0x74, 0x13, 0x25, 0x1B, 0xF5, 0x82, 0xE4, -0x34, 0x9B, 0xF5, 0x83, 0xE0, 0x64, 0x01, 0x70, 0x28, 0xE5, 0x1D, 0x64, 0x3F, 0x70, 0x22, 0x75, -0x1D, 0x3E, 0x75, 0xF0, 0x09, 0xE5, 0x1B, 0x90, 0x95, 0x98, 0x12, 0x49, 0x88, 0xE0, 0xB4, 0x01, -0x05, 0x75, 0x1C, 0xBE, 0x80, 0x03, 0x85, 0x1D, 0x1C, 0x85, 0x1E, 0x23, 0xE4, 0xFB, 0x02, 0x83, -0x38, 0x90, 0xA4, 0xC7, 0xE0, 0xFF, 0xE5, 0x1D, 0xC3, 0x9F, 0x40, 0x03, 0x02, 0x82, 0xC5, 0x74, -0x94, 0x25, 0x1B, 0xF5, 0x82, 0xE4, 0x34, 0xA2, 0xF5, 0x83, 0xE5, 0x1D, 0xF0, 0xB4, 0x2C, 0x23, -0x75, 0xF0, 0x09, 0xE5, 0x1B, 0x90, 0x95, 0x97, 0x12, 0x49, 0x88, 0xE0, 0x65, 0x1E, 0x60, 0x13, -0x05, 0x1E, 0x75, 0xF0, 0x09, 0xE5, 0x1B, 0x90, 0x95, 0x96, 0x12, 0x49, 0x88, 0xE5, 0x1E, 0xF0, -0x02, 0x82, 0xC0, 0xE5, 0x1D, 0xC3, 0x94, 0x0C, 0x40, 0x19, 0xE5, 0x1D, 0x94, 0x13, 0x50, 0x13, -0x74, 0x11, 0x25, 0x1B, 0xF5, 0x82, 0xE4, 0x34, 0x95, 0xF5, 0x83, 0xE0, 0x70, 0x05, 0x75, 0x1F, -0x01, 0x80, 0x1E, 0xE5, 0x1D, 0xC3, 0x94, 0x2C, 0x40, 0x27, 0xE5, 0x1D, 0x94, 0x35, 0x50, 0x21, -0x74, 0x11, 0x25, 0x1B, 0xF5, 0x82, 0xE4, 0x34, 0x95, 0xF5, 0x83, 0xE0, 0x70, 0x13, 0x75, 0x1F, -0x02, 0x74, 0x11, 0x25, 0x1B, 0xF5, 0x82, 0xE4, 0x34, 0x95, 0xF5, 0x83, 0x74, 0x01, 0xF0, 0x80, -0x10, 0xE4, 0xF5, 0x1F, 0x74, 0x11, 0x25, 0x1B, 0xF5, 0x82, 0xE4, 0x34, 0x95, 0xF5, 0x83, 0xE4, -0xF0, 0xE5, 0x1F, 0x64, 0x01, 0x60, 0x03, 0x02, 0x80, 0xA8, 0x75, 0xF0, 0x08, 0xE5, 0x1B, 0x90, -0x89, 0x02, 0x12, 0x49, 0x88, 0xE0, 0x20, 0xE7, 0x1A, 0x20, 0xE6, 0x17, 0x20, 0xE5, 0x14, 0x20, -0xE4, 0x11, 0x75, 0xF0, 0x08, 0xE5, 0x1B, 0x90, 0x89, 0x03, 0x12, 0x49, 0x88, 0xE0, 0x20, 0xE0, -0x02, 0x01, 0xA8, 0x74, 0x13, 0x25, 0x1B, 0xF5, 0x82, 0xE4, 0x34, 0x9C, 0xF5, 0x83, 0x74, 0x01, -0xF0, 0xE5, 0x1D, 0xB4, 0x0C, 0x08, 0x75, 0x1D, 0x14, 0x75, 0x1C, 0x14, 0x80, 0x0B, 0xE5, 0x1D, -0xB4, 0x0D, 0x16, 0x75, 0x1D, 0x15, 0x75, 0x1C, 0x15, 0x74, 0x93, 0x25, 0x1B, 0xF5, 0x82, 0xE4, -0x34, 0x9B, 0xF5, 0x83, 0x74, 0x05, 0xF0, 0x80, 0x58, 0xE5, 0x1D, 0xB4, 0x0E, 0x08, 0x75, 0x1D, -0x15, 0x75, 0x1C, 0x15, 0x80, 0x0B, 0xE5, 0x1D, 0xB4, 0x0F, 0x16, 0x75, 0x1D, 0x16, 0x75, 0x1C, -0x16, 0x74, 0x93, 0x25, 0x1B, 0xF5, 0x82, 0xE4, 0x34, 0x9B, 0xF5, 0x83, 0x74, 0x03, 0xF0, 0x80, -0x30, 0xE5, 0x1D, 0xC3, 0x94, 0x10, 0x40, 0x08, 0x75, 0x1D, 0x17, 0x75, 0x1C, 0x17, 0x80, 0x13, -0xE5, 0x1D, 0xC3, 0x94, 0x11, 0x40, 0x1A, 0xE5, 0x1D, 0x94, 0x13, 0x50, 0x14, 0x75, 0x1D, 0x18, -0x75, 0x1C, 0x18, 0x74, 0x93, 0x25, 0x1B, 0xF5, 0x82, 0xE4, 0x34, 0x9B, 0xF5, 0x83, 0x74, 0x02, -0xF0, 0x85, 0x1E, 0x23, 0x7B, 0x01, 0x61, 0x38, 0xE5, 0x1F, 0x64, 0x02, 0x60, 0x02, 0x21, 0x3F, -0x75, 0xF0, 0x08, 0xE5, 0x1B, 0x90, 0x89, 0x02, 0x12, 0x49, 0x88, 0xE0, 0x20, 0xE6, 0x18, 0x20, -0xE7, 0x15, 0x75, 0xF0, 0x08, 0xE5, 0x1B, 0x90, 0x89, 0x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, 0x85, 0x1D, 0x1C, 0x80, -0x03, 0x0D, 0x21, 0xC0, 0x90, 0xA4, 0xC8, 0xE0, 0xFF, 0xB4, 0x01, 0x17, 0xE5, 0x1C, 0xD3, 0x94, -0x0B, 0x40, 0x10, 0xE5, 0x1C, 0x94, 0x34, 0x50, 0x0A, 0x74, 0x20, 0x25, 0x1C, 0xF5, 0x1C, 0x74, -0x20, 0x80, 0x28, 0xEF, 0xB4, 0x02, 0x11, 0xE5, 0x1C, 0xD3, 0x94, 0x1B, 0x40, 0x0A, 0x74, 0x18, -0x25, 0x1C, 0xF5, 0x1C, 0x74, 0x18, 0x80, 0x13, 0xEF, 0xB4, 0x03, 0x13, 0xE5, 0x1C, 0xD3, 0x94, -0x1B, 0x40, 0x0C, 0x74, 0x22, 0x25, 0x1C, 0xF5, 0x1C, 0x74, 0x22, 0x25, 0x1D, 0xF5, 0x1D, 0x74, -0x13, 0x25, 0x1B, 0xF5, 0x82, 0xE4, 0x34, 0x9B, 0xF5, 0x83, 0xE0, 0x64, 0x01, 0x60, 0x02, 0x61, -0x33, 0xE5, 0x1D, 0x64, 0x3F, 0x60, 0x02, 0x61, 0x33, 0x75, 0x1D, 0x3E, 0x75, 0xF0, 0x09, 0xE5, -0x1B, 0x90, 0x95, 0x98, 0x12, 0x49, 0x88, 0xE0, 0xB4, 0x01, 0x05, 0x75, 0x1C, 0xBE, 0x80, 0x73, -0x85, 0x1D, 0x1C, 0x80, 0x6E, 0x90, 0xA4, 0xC7, 0xE0, 0x65, 0x1D, 0x70, 0x4D, 0x74, 0x94, 0x25, -0x1B, 0xF5, 0x82, 0xE4, 0x34, 0xA2, 0xF5, 0x83, 0xE5, 0x1C, 0xF0, 0x75, 0xF0, 0x09, 0xE5, 0x1B, -0x90, 0x95, 0x98, 0x12, 0x49, 0x88, 0xE0, 0xB4, 0x01, 0x0D, 0xE5, 0x1C, 0x20, 0xE7, 0x08, 0xE5, -0x1D, 0x44, 0x80, 0xF5, 0x1C, 0x80, 0x3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3, 0xF0, 0xE4, 0xF5, 0x10, 0x74, 0xB6, 0x25, 0x10, -0xF5, 0x82, 0xE4, 0x34, 0xA3, 0xF5, 0x83, 0xE0, 0x70, 0x03, 0x02, 0x8B, 0x51, 0x75, 0xF0, 0x09, -0xE5, 0x10, 0x90, 0x95, 0x9B, 0x12, 0x49, 0x88, 0xE0, 0x64, 0x01, 0x70, 0x03, 0x02, 0x8B, 0x51, -0xE5, 0x10, 0x25, 0xE0, 0x24, 0x01, 0xF5, 0x82, 0xE4, 0x34, 0x92, 0xF5, 0x83, 0xE0, 0xFE, 0xA3, -0xE0, 0xD3, 0x94, 0x00, 0xEE, 0x94, 0x00, 0x50, 0x03, 0x02, 0x8B, 0x51, 0xE5, 0x10, 0x75, 0xF0, -0x0A, 0xA4, 0x24, 0x01, 0xF9, 0x74, 0x8D, 0x35, 0xF0, 0xFA, 0x7B, 0x01, 0x8B, 0x14, 0xF5, 0x15, -0x89, 0x16, 0xE5, 0x10, 0x25, 0xE0, 0x24, 0x01, 0xF5, 0x82, 0xE4, 0x34, 0x92, 0xF5, 0x83, 0xE0, -0xFF, 0xA3, 0xE0, 0x90, 0xA4, 0xBF, 0xCF, 0xF0, 0xA3, 0xEF, 0xF0, 0x74, 0x93, 0x25, 0x10, 0xF5, -0x82, 0xE4, 0x34, 0x9A, 0xF5, 0x83, 0xE0, 0xFF, 0x90, 0xA4, 0xC1, 0xE4, 0xF0, 0xA3, 0xEF, 0xF0, -0x90, 0x00, 0x02, 0x12, 0x48, 0xE0, 0xFF, 0xAE, 0xF0, 0x12, 0x48, 0xB5, 0x2F, 0xFF, 0xE5, 0xF0, -0x3E, 0xFE, 0x90, 0x00, 0x04, 0x12, 0x48, 0xE0, 0x2F, 0xFF, 0xEE, 0x35, 0xF0, 0xFE, 0x90, 0x00, -0x06, 0x12, 0x48, 0xE0, 0x2F, 0xFF, 0xEE, 0x35, 0xF0, 0xFE, 0x90, 0x00, 0x08, 0x12, 0x48, 0xE0, -0x2F, 0xFF, 0xEE, 0x35, 0xF0, 0x90, 0xA4, 0xC3, 0xF0, 0xA3, 0xEF, 0xF0, 0x75, 0xF0, 0x10, 0xE5, -0x10, 0x90, 0x81, 0x00, 0x12, 0x49, 0x88, 0xE0, 0xFF, 0x90, 0xA4, 0xBE, 0xF0, 0xBF, 0xBE, 0x03, -0x74, 0x3F, 0xF0, 0x90, 0xA4, 0xBE, 0xE0, 0x90, 0xA4, 0xBC, 0xF0, 0x54, 0x7F, 0xA3, 0xF0, 0x75, -0xF0, 0x09, 0xE5, 0x10, 0x90, 0x95, 0x93, 0x12, 0x49, 0x88, 0xE0, 0x90, 0xA4, 0xC6, 0xF0, 0x74, -0x13, 0x25, 0x10, 0xF5, 0x82, 0xE4, 0x34, 0x9C, 0xF5, 0x83, 0xE0, 0x64, 0x01, 0x60, 0x02, 0xE1, -0x5F, 0x74, 0x93, 0x25, 0x10, 0xF5, 0x82, 0xE4, 0x34, 0x9B, 0xF5, 0x83, 0xE0, 0x60, 0x70, 0x90, -0xA4, 0xBD, 0xE0, 0xFF, 0xC3, 0x94, 0x0C, 0x40, 0x66, 0xEF, 0xD3, 0x94, 0x13, 0x50, 0x60, 0x74, -0x93, 0x25, 0x10, 0xF5, 0x82, 0xE4, 0x34, 0x9B, 0xF5, 0x83, 0xE0, 0x14, 0xF0, 0x74, 0x93, 0x25, -0x10, 0xF5, 0x82, 0xE4, 0x34, 0x9B, 0xF5, 0x83, 0xE0, 0x60, 0x03, 0x02, 0x8B, 0x5D, 0x90, 0xA4, -0xBD, 0xE0, 0xFB, 0x25, 0xE0, 0x24, 0x7D, 0xF5, 0x82, 0xE4, 0x34, 0x43, 0xF5, 0x83, 0xE4, 0x93, -0xFE, 0x74, 0x01, 0x93, 0xFF, 0xE4, 0xFC, 0xFD, 0x75, 0xF0, 0x04, 0xEB, 0x90, 0x42, 0x2D, 0x12, -0x49, 0x88, 0x12, 0x49, 0x78, 0x12, 0x49, 0x18, 0x78, 0x01, 0x12, 0x27, 0x22, 0x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0x18, 0x90, 0xA4, 0xBF, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, -0xD3, 0x94, 0xFA, 0xEE, 0x94, 0x00, 0x40, 0x05, 0x75, 0x1A, 0x02, 0x80, 0x11, 0xD3, 0xEF, 0x94, -0xE8, 0xEE, 0x94, 0x03, 0x40, 0x05, 0x75, 0x1A, 0x05, 0x80, 0x03, 0xE4, 0xF5, 0x1A, 0xAB, 0x14, -0xAA, 0x15, 0xA9, 0x16, 0x12, 0x48, 0xB5, 0xAE, 0xF0, 0xA8, 0x1A, 0x08, 0x80, 0x05, 0xCE, 0xC3, -0x13, 0xCE, 0x13, 0xD8, 0xF9, 0xFF, 0xAB, 0x11, 0xAA, 0x12, 0xA9, 0x13, 0x12, 0x26, 0x1E, 0xFD, -0x7C, 0x00, 0x12, 0x26, 0x98, 0xEF, 0x25, 0x18, 0xF5, 0x18, 0xEE, 0x35, 0x17, 0xF5, 0x17, 0xAB, -0x14, 0xAA, 0x15, 0xA9, 0x16, 0x90, 0x00, 0x02, 0x12, 0x48, 0xE0, 0xAE, 0xF0, 0xA8, 0x1A, 0x08, -0x80, 0x05, 0xCE, 0xC3, 0x13, 0xCE, 0x13, 0xD8, 0xF9, 0xFF, 0xAB, 0x11, 0xAA, 0x12, 0xA9, 0x13, -0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0xFD, 0x7C, 0x00, 0x12, 0x26, 0x98, 0xEF, 0x25, 0x18, 0xF5, -0x18, 0xEE, 0x35, 0x17, 0xF5, 0x17, 0xAB, 0x14, 0xAA, 0x15, 0xA9, 0x16, 0x90, 0x00, 0x04, 0x12, -0x48, 0xE0, 0xAE, 0xF0, 0xA8, 0x1A, 0x08, 0x80, 0x05, 0xCE, 0xC3, 0x13, 0xCE, 0x13, 0xD8, 0xF9, -0xFF, 0xAB, 0x11, 0xAA, 0x12, 0xA9, 0x13, 0x90, 0x00, 0x02, 0x12, 0x26, 0x37, 0xFD, 0x7C, 0x00, -0x12, 0x26, 0x98, 0xEF, 0x25, 0x18, 0xF5, 0x18, 0xEE, 0x35, 0x17, 0xF5, 0x17, 0xAB, 0x14, 0xAA, -0x15, 0xA9, 0x16, 0x90, 0x00, 0x06, 0x12, 0x48, 0xE0, 0xAE, 0xF0, 0xA8, 0x1A, 0x08, 0x80, 0x05, -0xCE, 0xC3, 0x13, 0xCE, 0x13, 0xD8, 0xF9, 0xFF, 0xAB, 0x11, 0xAA, 0x12, 0xA9, 0x13, 0x90, 0x00, -0x03, 0x12, 0x26, 0x37, 0xFD, 0x7C, 0x00, 0x12, 0x26, 0x98, 0xEF, 0x25, 0x18, 0xF5, 0x18, 0xEE, -0x35, 0x17, 0xF5, 0x17, 0xAB, 0x14, 0xAA, 0x15, 0xA9, 0x16, 0x90, 0x00, 0x08, 0x12, 0x48, 0xE0, -0xAE, 0xF0, 0xA8, 0x1A, 0x08, 0x80, 0x05, 0xCE, 0xC3, 0x13, 0xCE, 0x13, 0xD8, 0xF9, 0xFF, 0xAB, -0x11, 0xAA, 0x12, 0xA9, 0x13, 0x90, 0x00, 0x04, 0x12, 0x26, 0x37, 0xFD, 0x7C, 0x00, 0x12, 0x26, -0x98, 0xEF, 0x25, 0x18, 0xF5, 0x18, 0xEE, 0x35, 0x17, 0xF5, 0x17, 0x90, 0x00, 0x05, 0x12, 0x26, -0x37, 0xFD, 0x90, 0xA4, 0xBF, 0xE0, 0xFE, 0xA3, 0xE0, 0xA8, 0x1A, 0x08, 0x80, 0x05, 0xCE, 0xC3, -0x13, 0xCE, 0x13, 0xD8, 0xF9, 0xFF, 0x12, 0x26, 0x98, 0xD3, 0xE5, 0x18, 0x9F, 0xE5, 0x17, 0x9E, -0x40, 0x0C, 0xE5, 0x18, 0x9F, 0xF5, 0x18, 0xE5, 0x17, 0x9E, 0xF5, 0x17, 0x80, 0x05, 0xE4, 0xF5, -0x17, 0xF5, 0x18, 0xE5, 0x10, 0x25, 0xE0, 0x24, 0x11, 0xF5, 0x82, 0xE4, 0x34, 0x94, 0xF5, 0x83, -0xE5, 0x17, 0xF0, 0xA3, 0xE5, 0x18, 0xF0, 0xAE, 0x17, 0xFF, 0xE4, 0xFC, 0xFD, 0x90, 0xA4, 0xBD, -0xE0, 0x75, 0xF0, 0x04, 0x90, 0x42, 0x2D, 0x12, 0x49, 0x88, 0x12, 0x49, 0x78, 0xC3, 0x12, 0x49, -0x3F, 0x40, 0x02, 0x41, 0x69, 0x74, 0x91, 0x25, 0x10, 0xF5, 0x82, 0xE4, 0x34, 0x93, 0xF5, 0x83, -0xE0, 0xFF, 0x74, 0x93, 0x25, 0x10, 0xF5, 0x82, 0xE4, 0x34, 0x9C, 0xF5, 0x83, 0xE0, 0xFE, 0xD3, -0x9F, 0x40, 0x03, 0xEE, 0x80, 0x1A, 0x74, 0x93, 0x25, 0x10, 0xF5, 0x82, 0xE4, 0x34, 0x9C, 0xF5, -0x83, 0xE0, 0xFF, 0x74, 0x91, 0x25, 0x10, 0xF5, 0x82, 0xE4, 0x34, 0x93, 0xF5, 0x83, 0xE0, 0xC3, -0x9F, 0xF5, 0x19, 0xE5, 0x19, 0xD3, 0x94, 0x04, 0x40, 0x04, 0xE5, 0x10, 0x80, 0x2F, 0xE5, 0x10, -0x25, 0xE0, 0x24, 0x14, 0xF5, 0x82, 0xE4, 0x34, 0x9D, 0xF5, 0x83, 0xE0, 0xFE, 0xA3, 0xE0, 0xD3, -0x94, 0x01, 0xEE, 0x94, 0x00, 0xE5, 0x10, 0x40, 0x14, 0x25, 0xE0, 0x24, 0x14, 0xF5, 0x82, 0xE4, -0x34, 0x9D, 0xF5, 0x83, 0x74, 0xFF, 0xF5, 0xF0, 0x12, 0x48, 0x9F, 0x80, 0x0F, 0x25, 0xE0, 0x24, -0x14, 0xF5, 0x82, 0xE4, 0x34, 0x9D, 0xF5, 0x83, 0xE4, 0xF0, 0xA3, 0xF0, 0x90, 0xA4, 0xBD, 0xE0, -0x75, 0xF0, 0x04, 0x90, 0x42, 0x2D, 0x12, 0x49, 0x88, 0x12, 0x49, 0x5C, 0xE5, 0x10, 0x25, 0xE0, -0x24, 0x11, 0xF5, 0x82, 0xE4, 0x34, 0x94, 0xF5, 0x83, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0xE5, 0x10, -0x25, 0xE0, 0x24, 0x14, 0xF5, 0x82, 0xE4, 0x34, 0x9D, 0xF5, 0x83, 0xE0, 0xFE, 0xA3, 0xE0, 0x4E, -0x70, 0x33, 0xAF, 0x10, 0x12, 0x7E, 0x92, 0x80, 0x2C, 0x90, 0xA4, 0xBD, 0xE0, 0xFF, 0x25, 0xE0, -0x24, 0x7D, 0xF5, 0x82, 0xE4, 0x34, 0x43, 0xF5, 0x83, 0xD3, 0x74, 0x01, 0x93, 0x95, 0x18, 0xE4, -0x93, 0x95, 0x17, 0x40, 0x10, 0xEF, 0x64, 0x36, 0x60, 0x04, 0x7D, 0x01, 0x80, 0x02, 0x7D, 0x09, -0xAF, 0x10, 0x12, 0x83, 0x42, 0x74, 0x13, 0x25, 0x10, 0xF5, 0x82, 0xE4, 0x34, 0x9B, 0xF5, 0x83, -0xE0, 0xB4, 0x01, 0x0C, 0x90, 0xA4, 0xBD, 0xE0, 0xB4, 0x3F, 0x05, 0xAF, 0x10, 0x12, 0x7E, 0x92, -0x90, 0xA4, 0xC1, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0xC3, 0x74, 0xFF, 0x9F, 0xFD, 0x74, 0xFF, 0x9E, -0xFC, 0xE5, 0x10, 0x25, 0xE0, 0x24, 0x94, 0xF5, 0x82, 0xE4, 0x34, 0x9E, 0xF5, 0x83, 0xE0, 0xFA, -0xA3, 0xE0, 0xD3, 0x9D, 0xEA, 0x9C, 0xE5, 0x10, 0x50, 0x13, 0x25, 0xE0, 0x24, 0x94, 0xF5, 0x82, -0xE4, 0x34, 0x9E, 0xF5, 0x83, 0xEE, 0x8F, 0xF0, 0x12, 0x48, 0x9F, 0x80, 0x10, 0x25, 0xE0, 0x24, -0x94, 0xF5, 0x82, 0xE4, 0x34, 0x9E, 0xF5, 0x83, 0x74, 0xFF, 0xF0, 0xA3, 0xF0, 0x90, 0xA4, 0xC3, -0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0xC3, 0x74, 0xFF, 0x9F, 0xFD, 0x74, 0xFF, 0x9E, 0xFC, 0xE5, 0x10, -0x25, 0xE0, 0x24, 0x94, 0xF5, 0x82, 0xE4, 0x34, 0x9F, 0xF5, 0x83, 0xE0, 0xFA, 0xA3, 0xE0, 0xD3, -0x9D, 0xEA, 0x9C, 0xE5, 0x10, 0x50, 0x13, 0x25, 0xE0, 0x24, 0x94, 0xF5, 0x82, 0xE4, 0x34, 0x9F, -0xF5, 0x83, 0xEE, 0x8F, 0xF0, 0x12, 0x48, 0x9F, 0x80, 0x10, 0x25, 0xE0, 0x24, 0x94, 0xF5, 0x82, -0xE4, 0x34, 0x9F, 0xF5, 0x83, 0x74, 0xFF, 0xF0, 0xA3, 0xF0, 0xE4, 0xFD, 0xAF, 0x10, 0x12, 0x66, -0x7F, 0x05, 0x10, 0xE5, 0x10, 0xC3, 0x94, 0x80, 0x50, 0x03, 0x02, 0x85, 0xDC, 0x22, 0x12, 0x26, -0x1E, 0x54, 0x7F, 0xFF, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0xFE, 0x54, 0x1F, 0x90, 0xA4, 0x91, -0xF0, 0xEE, 0x54, 0x80, 0xC4, 0x13, 0x13, 0x13, 0x54, 0x01, 0x90, 0xA4, 0x90, 0xF0, 0x90, 0x00, -0x02, 0x12, 0x26, 0x37, 0xFE, 0x54, 0x03, 0xFD, 0xEE, 0x54, 0x30, 0xC4, 0x54, 0x0F, 0x90, 0xA4, -0x93, 0xF0, 0x90, 0x00, 0x02, 0x12, 0x26, 0x37, 0xFE, 0x54, 0x40, 0xC4, 0x13, 0x13, 0x54, 0x03, -0x90, 0xA4, 0x92, 0xF0, 0xEE, 0x54, 0x80, 0xC4, 0x13, 0x13, 0x13, 0x54, 0x01, 0xFE, 0x90, 0x00, -0x02, 0x12, 0x26, 0x37, 0x54, 0x08, 0xFC, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x90, 0xA4, 0x94, 0xF0, -0x75, 0xF0, 0x09, 0xEF, 0x90, 0x95, 0x9B, 0x12, 0x49, 0x88, 0xEE, 0xF0, 0x90, 0xA4, 0x92, 0xE0, -0xFE, 0x75, 0xF0, 0x09, 0xEF, 0x90, 0x95, 0x9A, 0x12, 0x49, 0x88, 0xEE, 0xF0, 0x90, 0xA4, 0x94, -0xE0, 0x70, 0x79, 0x90, 0xA4, 0x91, 0xE0, 0xFE, 0x75, 0xF0, 0x09, 0xEF, 0x90, 0x95, 0x95, 0x12, -0x49, 0x88, 0xEE, 0xF0, 0x75, 0xF0, 0x09, 0xEF, 0x90, 0x95, 0x97, 0x12, 0x49, 0x88, 0xED, 0xF0, -0xFE, 0x75, 0xF0, 0x09, 0xEF, 0x90, 0x95, 0x96, 0x12, 0x49, 0x88, 0xEE, 0xF0, 0x90, 0xA4, 0x90, -0xE0, 0xFE, 0x75, 0xF0, 0x09, 0xEF, 0x90, 0x95, 0x98, 0x12, 0x49, 0x88, 0xEE, 0xF0, 0x90, 0xA4, -0x93, 0xE0, 0xFE, 0x75, 0xF0, 0x09, 0xEF, 0x90, 0x95, 0x99, 0x12, 0x49, 0x88, 0xEE, 0xF0, 0xE4, -0xFE, 0xEE, 0xF5, 0x82, 0x75, 0x83, 0x00, 0xA3, 0xA3, 0xA3, 0x12, 0x26, 0x37, 0xFD, 0x75, 0xF0, -0x08, 0xEF, 0x90, 0x89, 0x00, 0x12, 0x49, 0x88, 0xE5, 0x82, 0x2E, 0xF5, 0x82, 0xE4, 0x35, 0x83, -0xF5, 0x83, 0xED, 0xF0, 0x0E, 0xEE, 0xB4, 0x04, 0xD8, 0x12, 0x63, 0xDB, 0x22, 0x12, 0x26, 0x1E, -0xF5, 0x0F, 0x90, 0x00, 0x03, 0x12, 0x26, 0x37, 0xFF, 0x74, 0x13, 0x25, 0x0F, 0xF5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x34, 0x80, 0xF5, 0x83, 0xE5, 0x82, 0x25, 0x0E, 0xF5, 0x82, 0xE4, 0x35, 0x83, 0xF5, 0x83, 0xE4, -0xF0, 0x05, 0x0E, 0xE5, 0x0E, 0xB4, 0x10, 0xBB, 0x05, 0x0D, 0xE5, 0x0D, 0xB4, 0x08, 0xB1, 0x22, -0xA9, 0x07, 0x90, 0x06, 0x69, 0xE0, 0xFE, 0x90, 0x06, 0x68, 0xE0, 0x7A, 0x00, 0x24, 0x00, 0xFF, -0xEA, 0x3E, 0xFE, 0xE9, 0x14, 0x60, 0x13, 0x14, 0x60, 0x10, 0x24, 0x02, 0x70, 0x14, 0xEE, 0x54, -0xFE, 0xFE, 0xEF, 0x54, 0x7F, 0x90, 0x06, 0x68, 0x80, 0x04, 0x90, 0x06, 0x68, 0xEF, 0xF0, 0xEE, -0xA3, 0xF0, 0x22, 0x90, 0xA5, 0x9B, 0xED, 0xF0, 0xEF, 0x14, 0x60, 0x23, 0x14, 0x70, 0x02, 0xC1, -0xE4, 0x24, 0x02, 0x60, 0x02, 0xE1, 0x35, 0x90, 0xA4, 0xA8, 0x12, 0x27, 0x54, 0x00, 0x30, 0x03, -0xC3, 0x90, 0xA4, 0xAC, 0x12, 0x27, 0x54, 0x00, 0x30, 0x02, 0x00, 0x7F, 0xAC, 0xE1, 0x30, 0x90, -0xA4, 0xA8, 0x12, 0x27, 0x54, 0x00, 0x30, 0x03, 0xC3, 0x90, 0xA4, 0xAC, 0x12, 0x27, 0x54, 0x00, -0x30, 0x02, 0x01, 0x12, 0x4F, 0x48, 0x90, 0xA4, 0xA8, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x3C, -0x12, 0x4F, 0x31, 0x90, 0xA4, 0xA8, 0x12, 0x27, 0x54, 0xF0, 0x00, 0x00, 0x00, 0x90, 0xA5, 0x9B, -0xE0, 0x7E, 0x00, 0x78, 0x1C, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, 0xF9, 0xFF, 0xEE, 0x33, 0x95, -0xE0, 0xFD, 0xFC, 0x90, 0xA4, 0xAC, 0x12, 0x27, 0x48, 0x7F, 0x38, 0x7E, 0x08, 0x12, 0x4F, 0x4C, -0x90, 0xA5, 0x9B, 0xE0, 0x90, 0xA4, 0xA8, 0xB4, 0x01, 0x13, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, -0x10, 0x90, 0xA4, 0xAC, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x10, 0x80, 0x11, 0x12, 0x27, 0x54, -0x00, 0x00, 0x00, 0x10, 0x90, 0xA4, 0xAC, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x00, -0x7E, 0x0A, 0x80, 0x4E, 0x90, 0xA4, 0xA8, 0x12, 0x27, 0x54, 0x00, 0x30, 0x03, 0xC3, 0x90, 0xA4, -0xAC, 0x12, 0x27, 0x54, 0x00, 0x30, 0x02, 0x02, 0x12, 0x4F, 0x48, 0x90, 0xA4, 0xA8, 0x12, 0x27, -0x54, 0x00, 0x00, 0x00, 0x3C, 0x12, 0x4F, 0x31, 0x90, 0xA4, 0xA8, 0x12, 0x27, 0x54, 0xF0, 0x00, -0x00, 0x00, 0x90, 0xA5, 0x9B, 0xE0, 0x7E, 0x00, 0x78, 0x1C, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, -0xF9, 0xFF, 0xEE, 0x33, 0x95, 0xE0, 0xFD, 0xFC, 0x90, 0xA4, 0xAC, 0x12, 0x27, 0x48, 0x7F, 0x38, -0x7E, 0x08, 0x12, 0x4F, 0x4C, 0x22, 0xEF, 0x14, 0x60, 0x3A, 0x14, 0x60, 0x53, 0x24, 0x02, 0x70, -0x6C, 0x90, 0xA4, 0xA6, 0x12, 0x27, 0x54, 0x00, 0x00, 0x0C, 0x00, 0x90, 0xA4, 0xAA, 0x12, 0x27, -0x54, 0x00, 0x00, 0x0C, 0x00, 0x12, 0x4E, 0xD8, 0x90, 0xA4, 0xA6, 0x12, 0x27, 0x54, 0x00, 0x00, -0x0C, 0x00, 0x90, 0xA4, 0xAA, 0x12, 0x27, 0x54, 0x00, 0x00, 0x0C, 0x00, 0x7D, 0x18, 0x7C, 0x00, -0x7F, 0x01, 0x80, 0x36, 0x90, 0xA4, 0xA6, 0x12, 0x27, 0x54, 0x00, 0x00, 0x0C, 0x00, 0x90, 0xA4, -0xAA, 0x12, 0x27, 0x54, 0x00, 0x00, 0x04, 0x00, 0x7D, 0x18, 0x7C, 0x00, 0xE4, 0xFF, 0x80, 0x1A, -0x90, 0xA4, 0xA6, 0x12, 0x27, 0x54, 0x00, 0x00, 0x0C, 0x00, 0x90, 0xA4, 0xAA, 0x12, 0x27, 0x54, -0x00, 0x00, 0x00, 0x00, 0x7D, 0x18, 0x7C, 0x00, 0xE4, 0xFF, 0x12, 0x4E, 0xDE, 0x22, 0x90, 0xA4, -0xA3, 0xEF, 0xF0, 0xD3, 0x94, 0x0E, 0x50, 0x14, 0x90, 0xA5, 0x97, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, -0x4E, 0x60, 0x20, 0xEF, 0x64, 0x01, 0x4E, 0x70, 0x1A, 0xFF, 0x80, 0x18, 0x90, 0xA4, 0xA3, 0xE0, -0xD3, 0x94, 0x0E, 0x40, 0x0E, 0x90, 0xA5, 0x97, 0xE0, 0x70, 0x02, 0xA3, 0xE0, 0x70, 0x04, 0x7F, -0x01, 0xF1, 0xE4, 0x22, 0x90, 0xA4, 0xA4, 0xEF, 0xF0, 0x90, 0xA4, 0xA8, 0x12, 0x27, 0x54, 0x30, -0x00, 0x00, 0x00, 0x90, 0xA4, 0xAC, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x74, 0x08, 0xFF, -0xFE, 0x12, 0x4F, 0x4C, 0x90, 0xA4, 0xA4, 0xE0, 0x60, 0x02, 0x01, 0xC5, 0x90, 0xA4, 0xA8, 0x12, -0x27, 0x54, 0x00, 0x00, 0x00, 0x03, 0x90, 0xA4, 0xAC, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, -0x7F, 0x2C, 0x7E, 0x08, 0x12, 0x4F, 0x4C, 0x90, 0xA4, 0xA8, 0x12, 0x27, 0x54, 0x30, 0x00, 0x00, -0x00, 0x90, 0xA4, 0xAC, 0x12, 0x27, 0x54, 0x30, 0x00, 0x00, 0x00, 0x74, 0x08, 0xFF, 0xFE, 0x12, -0x4F, 0x4C, 0x90, 0xA4, 0xA8, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0xF0, 0x90, 0xA4, 0xAC, 0x12, -0x27, 0x54, 0x00, 0x00, 0x00, 0x70, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x4F, 0x4C, 0x90, 0xA4, 0xA8, -0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0xF0, 0x90, 0xA4, 0xAC, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, -0x70, 0x7F, 0xB0, 0x7E, 0x0E, 0x12, 0x4F, 0x4C, 0x90, 0xA4, 0xA8, 0x12, 0x27, 0x54, 0x00, 0xFF, -0x00, 0x00, 0x90, 0xA4, 0xAC, 0x12, 0x27, 0x54, 0x00, 0x77, 0x00, 0x00, 0x7F, 0xB0, 0x7E, 0x0C, -0x12, 0x4F, 0x4C, 0x90, 0xA4, 0xA8, 0x12, 0x27, 0x54, 0x00, 0xFF, 0x00, 0x00, 0x90, 0xA4, 0xAC, -0x12, 0x27, 0x54, 0x00, 0x77, 0x00, 0x00, 0x7F, 0xB0, 0x7E, 0x0E, 0x12, 0x4F, 0x4C, 0x90, 0x04, -0x54, 0xE0, 0x54, 0x7F, 0x90, 0xA4, 0xA5, 0xF0, 0xE0, 0x90, 0x04, 0x54, 0xF0, 0xE4, 0x90, 0xA5, -0x97, 0xF0, 0xA3, 0xF0, 0x22, 0x90, 0xA4, 0xA4, 0xE0, 0x64, 0x01, 0x60, 0x02, 0x21, 0x88, 0x90, -0x04, 0x54, 0xE0, 0x44, 0x80, 0x90, 0xA4, 0xA5, 0xF0, 0xE0, 0x90, 0x04, 0x54, 0xF0, 0x90, 0xA4, -0xA8, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x03, 0x90, 0xA4, 0xAC, 0x12, 0x27, 0x54, 0x00, 0x00, -0x00, 0x01, 0x7F, 0x2C, 0x7E, 0x08, 0x12, 0x4F, 0x4C, 0x90, 0xA4, 0xA8, 0x12, 0x27, 0x54, 0x00, -0x00, 0x00, 0xF0, 0x90, 0xA4, 0xAC, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x10, 0x7F, 0xB0, 0x7E, -0x0C, 0x12, 0x4F, 0x4C, 0x90, 0xA4, 0xA8, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0xF0, 0x90, 0xA4, -0xAC, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x10, 0x7F, 0xB0, 0x7E, 0x0E, 0x12, 0x4F, 0x4C, 0x90, -0xA4, 0xA8, 0x12, 0x27, 0x54, 0x00, 0xFF, 0x00, 0x00, 0x90, 0xA4, 0xAC, 0x12, 0x27, 0x54, 0x00, -0x54, 0x00, 0x00, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x4F, 0x4C, 0x90, 0xA4, 0xA8, 0x12, 0x27, 0x54, -0x00, 0xFF, 0x00, 0x00, 0x90, 0xA4, 0xAC, 0x12, 0x27, 0x54, 0x00, 0x54, 0x00, 0x00, 0x7F, 0xB0, -0x7E, 0x0E, 0x12, 0x4F, 0x4C, 0x90, 0xA4, 0xA8, 0x12, 0x27, 0x54, 0x30, 0x00, 0x00, 0x00, 0x90, -0xA4, 0xAC, 0x12, 0x27, 0x54, 0x20, 0x00, 0x00, 0x00, 0x74, 0x08, 0xFF, 0xFE, 0x12, 0x4F, 0x4C, -0x90, 0xA5, 0x97, 0xE4, 0xF0, 0xA3, 0x04, 0xF0, 0x22, 0xE4, 0xFE, 0xFC, 0xEF, 0x64, 0x02, 0x70, -0x40, 0xED, 0xB4, 0x01, 0x04, 0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0x0C, -0xF0, 0x90, 0xA4, 0x36, 0xE0, 0x54, 0xBF, 0xF0, 0x54, 0x7F, 0xF0, 0xA3, 0xE0, 0x54, 0xFE, 0xF0, -0x54, 0xFD, 0xF0, 0x54, 0xF7, 0xF0, 0x90, 0xA4, 0x46, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, -0x90, 0xA3, 0x14, 0xE0, 0xB4, 0x01, 0x08, 0x90, 0xA4, 0x43, 0x74, 0xFF, 0xF0, 0x80, 0x12, 0x90, -0xA3, 0x14, 0xE0, 0x90, 0xA4, 0x43, 0xB4, 0x03, 0x05, 0x74, 0xD4, 0xF0, 0x80, 0x03, 0x74, 0x41, -0xF0, 0x90, 0xA4, 0x4A, 0x74, 0x01, 0xF0, 0xA3, 0x74, 0x07, 0xF0, 0xA3, 0xE0, 0x54, 0x01, 0x44, -0x28, 0xF0, 0xA3, 0x74, 0x05, 0xF0, 0xE4, 0xA3, 0xF0, 0xA3, 0xF0, 0xA3, 0xF0, 0xA3, 0xF0, 0x22, -0x12, 0x57, 0xD1, 0xEF, 0x64, 0x01, 0x60, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x01, 0xF0, 0x80, 0x67, -0x90, 0xA4, 0x3D, 0xE0, 0xFF, 0x54, 0x03, 0x60, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x02, 0xF0, 0x80, -0x56, 0x90, 0xA4, 0x3B, 0xE0, 0xFE, 0xE4, 0xC3, 0x9E, 0x50, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x04, -0xF0, 0x80, 0x44, 0xEF, 0x30, 0xE2, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x08, 0xF0, 0x80, 0x38, 0x90, -0xA4, 0x3D, 0xE0, 0x30, 0xE4, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x10, 0xF0, 0x80, 0x29, 0x90, 0xA4, -0x37, 0xE0, 0x13, 0x13, 0x54, 0x3F, 0x20, 0xE0, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x20, 0xF0, 0x80, -0x16, 0x90, 0xA4, 0x51, 0xE0, 0x60, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x80, 0xF0, 0x80, 0x08, 0x90, -0x01, 0xB8, 0xE4, 0xF0, 0x7F, 0x01, 0x22, 0x90, 0x01, 0xB9, 0x74, 0x04, 0xF0, 0x7F, 0x00, 0x22, -0x90, 0x05, 0x22, 0x74, 0x6F, 0xF0, 0x90, 0x05, 0x27, 0xE0, 0x54, 0xBF, 0xF0, 0x90, 0xA4, 0x3C, -0x74, 0x02, 0xF0, 0x22, 0x90, 0xA4, 0x39, 0xE0, 0x60, 0x39, 0x90, 0xA3, 0xB6, 0xE0, 0x64, 0x01, -0x70, 0x31, 0x90, 0xA4, 0x40, 0xF0, 0x04, 0x60, 0x2A, 0x90, 0xA4, 0x3D, 0xE0, 0x44, 0x10, 0xF0, -0xE4, 0xF5, 0x3B, 0x90, 0xA4, 0x41, 0xE0, 0xF5, 0x3C, 0xE4, 0xFB, 0xFD, 0x7F, 0x54, 0x7E, 0x01, -0x12, 0x34, 0x8C, 0x90, 0x01, 0x57, 0x74, 0x05, 0xF0, 0x90, 0xA4, 0x3C, 0xE0, 0x20, 0xE2, 0x03, -0x12, 0x50, 0x4D, 0x22, 0x90, 0xA4, 0x36, 0xE0, 0xFF, 0x13, 0x13, 0x54, 0x3F, 0x30, 0xE0, 0x11, -0xEF, 0x54, 0xFB, 0xF0, 0x90, 0xA4, 0x3D, 0xE0, 0x54, 0xFD, 0xF0, 0x54, 0x07, 0x70, 0x42, 0x80, -0x3D, 0x90, 0xA4, 0x42, 0xE0, 0x04, 0xF0, 0x90, 0xA4, 0x3D, 0xE0, 0x54, 0xEF, 0xF0, 0x90, 0xA4, -0x42, 0xE0, 0xFF, 0xB4, 0x01, 0x02, 0x80, 0x04, 0xEF, 0xB4, 0x02, 0x06, 0x90, 0x05, 0x58, 0xE0, -0x04, 0xF0, 0x90, 0xA4, 0x4A, 0xE0, 0xFF, 0x90, 0xA4, 0x42, 0xE0, 0xD3, 0x9F, 0x40, 0x0F, 0x90, -0xA3, 0xB6, 0xE0, 0xB4, 0x01, 0x0B, 0x90, 0xA4, 0x37, 0xE0, 0x54, 0xFB, 0xF0, 0x22, 0x12, 0x50, -0x44, 0x22, 0xAB, 0x07, 0xAA, 0x06, 0xED, 0x2B, 0xFB, 0xE4, 0x3A, 0xFA, 0xC3, 0x90, 0xA3, 0xB3, -0xE0, 0x9B, 0x90, 0xA3, 0xB2, 0xE0, 0x9A, 0x50, 0x13, 0xA3, 0xE0, 0x24, 0x01, 0xFF, 0x90, 0xA3, -0xB2, 0xE0, 0x34, 0x00, 0xFE, 0xC3, 0xEB, 0x9F, 0xFB, 0xEA, 0x9E, 0xFA, 0xEA, 0x90, 0xFD, 0x11, -0xF0, 0xAF, 0x03, 0x74, 0x00, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0xFB, 0xF5, 0x83, 0xE0, 0xFF, 0x22, -0x4D, 0xC2, -}; -u4Byte ArrayLength_TC_8812A_FW_NIC = 21570; -#else -u4Byte Array_TC_8812A_FW_NIC[] = { -0x0, }; -u4Byte ArrayLength_TC_8812A_FW_NIC = 1; -#endif - - -void -ODM_ReadFirmware_TC_8812A_FW_NIC( - IN PDM_ODM_T pDM_Odm, - OUT u1Byte *pFirmware, - OUT u4Byte *pFirmwareSize -) -{ - ODM_MoveMemory(pDM_Odm, pFirmware, Array_TC_8812A_FW_NIC, ArrayLength_TC_8812A_FW_NIC); - *pFirmwareSize = ArrayLength_TC_8812A_FW_NIC; -} - - -#if TESTCHIP_SUPPORT == 1 -u1Byte Array_TC_8812A_FW_WoWLAN[] = { -0x01, 0x95, 0xFF, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x12, 0x11, 0x21, 0x11, 0xF6, 0x47, 0x00, 0x00, -0x39, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x02, 0x4B, 0x2A, 0x02, 0x68, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x5C, 0xD8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x6C, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x68, 0xAF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x69, 0x38, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -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, 0x78, 0xE3, 0x09, 0xF2, 0x08, 0xDF, 0xFA, 0x80, 0x70, 0x88, 0x82, 0x8C, 0x83, -0xE3, 0x09, 0xF0, 0xA3, 0xDF, 0xFA, 0x80, 0x64, 0x89, 0x82, 0x8A, 0x83, 0xE0, 0xA3, 0xF6, 0x08, -0xDF, 0xFA, 0x80, 0x58, 0x89, 0x82, 0x8A, 0x83, 0xE0, 0xA3, 0xF2, 0x08, 0xDF, 0xFA, 0x80, 0x4C, -0x80, 0xD2, 0x80, 0xFA, 0x80, 0xC6, 0x80, 0xD4, 0x80, 0x69, 0x80, 0xF2, 0x80, 0x33, 0x80, 0x10, -0x80, 0xA6, 0x80, 0xEA, 0x80, 0x9A, 0x80, 0xA8, 0x80, 0xDA, 0x80, 0xE2, 0x80, 0xCA, 0x80, 0x33, -0x89, 0x82, 0x8A, 0x83, 0xEC, 0xFA, 0xE4, 0x93, 0xA3, 0xC8, 0xC5, 0x82, 0xC8, 0xCC, 0xC5, 0x83, -0xCC, 0xF0, 0xA3, 0xC8, 0xC5, 0x82, 0xC8, 0xCC, 0xC5, 0x83, 0xCC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 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, 0x4B, 0xAD, 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, 0x00, 0x41, 0x90, -0x93, 0x00, 0x41, 0x90, 0x94, 0x00, 0x41, 0x90, 0x95, 0x00, 0x42, 0x90, 0xA2, 0x00, 0x00, 0x41, -0x90, 0xA4, 0x00, 0x41, 0x90, 0xA5, 0x00, 0x4C, 0xD5, 0x4F, 0xF3, 0x58, 0x15, 0x5F, 0xED, 0x62, -0x70, 0x90, 0x00, 0xF0, 0xE0, 0x7F, 0x01, 0x20, 0xE2, 0x02, 0x7F, 0x03, 0x22, 0x71, 0xD1, 0x90, -0x8D, 0x01, 0xEF, 0xF0, 0x71, 0xEF, 0x90, 0x01, 0x64, 0x74, 0x01, 0xF0, 0x02, 0x35, 0x95, 0x91, -0x74, 0x91, 0xA4, 0x91, 0x11, 0x91, 0x30, 0x91, 0x4F, 0xE4, 0xF5, 0x51, 0x75, 0x52, 0x58, 0xAB, -0x51, 0x7D, 0x02, 0x7F, 0x01, 0x12, 0x39, 0x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 0xAF, 0x22, 0xB1, 0x62, 0x90, 0x01, 0x3F, 0x74, 0x04, 0xF0, 0x90, -0x8D, 0x01, 0xE0, 0xFF, 0xB4, 0x01, 0x07, 0x90, 0xFD, 0x00, 0xE0, 0x54, 0xEF, 0xF0, 0xEF, 0xB4, -0x01, 0x07, 0x90, 0xFE, 0x10, 0xE0, 0x54, 0xFB, 0xF0, 0x22, 0x22, 0x22, 0xE4, 0x90, 0x8D, 0xA3, -0xF0, 0x22, 0x75, 0xE8, 0x03, 0x75, 0xA8, 0x85, 0x22, 0xE4, 0x90, 0x8D, 0x9D, 0xF0, 0xA3, 0xF0, -0x22, 0x90, 0x01, 0x94, 0xE0, 0x44, 0x01, 0xF0, 0x22, 0x90, 0x01, 0xE4, 0x74, 0x0A, 0xF0, 0xA3, -0xE4, 0xF0, 0x22, 0xE4, 0x90, 0x8F, 0x62, 0xF0, 0x90, 0x8F, 0x62, 0xE0, 0x64, 0x01, 0xF0, 0x24, -0xF3, 0x90, 0x01, 0xC4, 0xF0, 0x74, 0x4F, 0xA3, 0xF0, 0x12, 0x3A, 0xEB, 0xBF, 0x01, 0x03, 0x12, -0x31, 0x69, 0x90, 0x8E, 0x2A, 0xE0, 0xFF, 0x90, 0x8E, 0x29, 0xE0, 0x6F, 0x60, 0x02, 0x31, 0xA4, -0x12, 0x6E, 0x0E, 0xBF, 0x01, 0x02, 0xF1, 0x54, 0x90, 0x8E, 0x2A, 0xE0, 0x90, 0x01, 0xBC, 0xF0, -0x90, 0x8D, 0xA3, 0xE0, 0x90, 0x01, 0xBD, 0xF0, 0x11, 0x3F, 0x12, 0x48, 0xCE, 0x80, 0xB9, 0x11, -0x92, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xE4, 0xFF, 0x90, 0x90, 0x43, 0xF0, 0x90, 0x01, -0xC7, 0xE0, 0x64, 0xAD, 0x70, 0x37, 0xF0, 0x90, 0x90, 0x50, 0x74, 0x0F, 0xF0, 0x90, 0x90, 0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 0x61, 0x02, 0xEE, 0xC4, 0x13, 0x13, 0x13, 0x54, 0x01, 0x30, 0xE0, 0x02, 0x61, 0x02, -0x90, 0x90, 0xA7, 0xE0, 0xFE, 0x6F, 0x70, 0x02, 0x61, 0x02, 0xEF, 0x70, 0x02, 0x41, 0x79, 0x24, -0xFE, 0x70, 0x02, 0x41, 0xB2, 0x24, 0xFE, 0x60, 0x48, 0x24, 0xFC, 0x70, 0x02, 0x41, 0xED, 0x24, -0xFC, 0x60, 0x02, 0x61, 0x02, 0xEE, 0xB4, 0x0E, 0x02, 0x71, 0x82, 0x90, 0x90, 0xA7, 0xE0, 0x70, -0x04, 0x7F, 0x01, 0x71, 0xAA, 0x90, 0x90, 0xA7, 0xE0, 0xB4, 0x06, 0x02, 0x71, 0x5C, 0x90, 0x90, -0xA7, 0xE0, 0xB4, 0x04, 0x0E, 0x90, 0x90, 0xA6, 0xE0, 0xFF, 0x60, 0x05, 0x12, 0x81, 0x23, 0x80, -0x02, 0xD1, 0x9E, 0x90, 0x90, 0xA7, 0xE0, 0x64, 0x08, 0x60, 0x02, 0x61, 0x02, 0x91, 0x6B, 0x61, -0x02, 0x90, 0x90, 0xA7, 0xE0, 0x70, 0x04, 0x7F, 0x01, 0x71, 0xAA, 0x90, 0x90, 0xA7, 0xE0, 0xB4, -0x06, 0x02, 0x71, 0x5C, 0x90, 0x90, 0xA7, 0xE0, 0xB4, 0x0E, 0x07, 0x71, 0x07, 0xBF, 0x01, 0x02, -0x71, 0x82, 0x90, 0x90, 0xA7, 0xE0, 0x64, 0x0C, 0x60, 0x02, 0x61, 0x02, 0x71, 0x07, 0xEF, 0x64, -0x01, 0x60, 0x02, 0x61, 0x02, 0x71, 0xC3, 0x61, 0x02, 0x90, 0x90, 0xA7, 0xE0, 0xB4, 0x0E, 0x07, -0x71, 0x07, 0xBF, 0x01, 0x02, 0x71, 0x82, 0x90, 0x90, 0xA7, 0xE0, 0xB4, 0x06, 0x02, 0x71, 0x5C, -0x90, 0x90, 0xA7, 0xE0, 0xB4, 0x0C, 0x07, 0x71, 0x07, 0xBF, 0x01, 0x02, 0x71, 0xC3, 0x90, 0x90, -0xA7, 0xE0, 0x64, 0x04, 0x70, 0x5C, 0x12, 0x80, 0x60, 0xEF, 0x64, 0x01, 0x70, 0x54, 0xD1, 0x81, -0x80, 0x50, 0x90, 0x90, 0xA7, 0xE0, 0xB4, 0x0E, 0x07, 0x71, 0x07, 0xBF, 0x01, 0x02, 0x71, 0x82, -0x90, 0x90, 0xA7, 0xE0, 0xB4, 0x06, 0x02, 0x71, 0x5C, 0x90, 0x90, 0xA7, 0xE0, 0xB4, 0x0C, 0x07, -0x71, 0x07, 0xBF, 0x01, 0x02, 0x71, 0xC3, 0x90, 0x90, 0xA7, 0xE0, 0x70, 0x04, 0x7F, 0x01, 0x71, -0xAA, 0x90, 0x90, 0xA7, 0xE0, 0xB4, 0x04, 0x1A, 0x12, 0x81, 0x65, 0x80, 0x15, 0x90, 0x90, 0xA7, -0xE0, 0xB4, 0x0C, 0x0E, 0x90, 0x8E, 0x25, 0xE0, 0xFF, 0x13, 0x13, 0x54, 0x3F, 0x30, 0xE0, 0x02, -0x91, 0x62, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xF1, 0x8F, 0xEF, 0x64, 0x01, 0x60, 0x08, 0x90, 0x01, -0xB8, 0x74, 0x01, 0xF0, 0x80, 0x3D, 0x90, 0x8E, 0x24, 0xE0, 0xFF, 0x13, 0x13, 0x13, 0x54, 0x1F, -0x30, 0xE0, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x02, 0xF0, 0x80, 0x28, 0xEF, 0xC4, 0x54, 0x0F, 0x30, -0xE0, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x04, 0xF0, 0x80, 0x19, 0x90, 0x8E, 0x29, 0xE0, 0xD3, 0x94, -0x04, 0x40, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x08, 0xF0, 0x80, 0x08, 0x90, 0x01, 0xB8, 0xE4, 0xF0, -0x7F, 0x01, 0x22, 0x90, 0x01, 0xB9, 0x74, 0x02, 0xF0, 0x7F, 0x00, 0x22, 0x90, 0x8E, 0x25, 0xE0, -0x90, 0x06, 0x04, 0x20, 0xE0, 0x0C, 0xE0, 0x44, 0x40, 0xF0, 0x90, 0x8E, 0x2A, 0x74, 0x04, 0xF0, -0x80, 0x0A, 0xE0, 0x54, 0x7F, 0xF0, 0x90, 0x8E, 0x2A, 0x74, 0x0C, 0xF0, 0x90, 0x05, 0x22, 0xE4, -0xF0, 0x22, 0x90, 0x8E, 0x25, 0xE0, 0xC3, 0x13, 0x20, 0xE0, 0x08, 0x90, 0x8E, 0x2A, 0x74, 0x0C, -0xF0, 0x80, 0x11, 0x90, 0x06, 0x04, 0xE0, 0x44, 0x40, 0xF0, 0xE0, 0x44, 0x80, 0xF0, 0x90, 0x8E, -0x2A, 0x74, 0x04, 0xF0, 0x90, 0x05, 0x22, 0xE4, 0xF0, 0x22, 0x90, 0x90, 0xAB, 0xEF, 0xF0, 0x91, -0x74, 0x90, 0x90, 0xAB, 0xE0, 0x60, 0x05, 0x90, 0x05, 0x22, 0xE4, 0xF0, 0x90, 0x8E, 0x2A, 0x74, -0x04, 0xF0, 0x22, 0x90, 0x8D, 0xA3, 0xE0, 0x64, 0x01, 0x70, 0x2E, 0x90, 0x8E, 0x25, 0xE0, 0x54, -0xFD, 0xF0, 0x90, 0x05, 0x22, 0x74, 0x6F, 0xF0, 0x7F, 0x01, 0x12, 0x4E, 0xC2, 0xBF, 0x01, 0x0E, -0x90, 0x8E, 0x24, 0xE0, 0x44, 0x80, 0xF0, 0x90, 0x8E, 0x2A, 0x74, 0x0E, 0xF0, 0x22, 0x90, 0x01, -0xB9, 0x74, 0x01, 0xF0, 0x90, 0x01, 0xB8, 0x04, 0xF0, 0x22, 0x90, 0x8E, 0x27, 0xE0, 0x64, 0x01, -0x70, 0x5F, 0x90, 0x8E, 0x26, 0xE0, 0x54, 0x0F, 0x60, 0x4F, 0x90, 0x8E, 0x2A, 0xE0, 0x70, 0x03, -0xFF, 0x71, 0xAA, 0x90, 0x8E, 0x2A, 0xE0, 0x64, 0x0C, 0x60, 0x02, 0xD1, 0x9E, 0x90, 0x01, 0x5B, -0xE4, 0xF0, 0x90, 0x01, 0x3C, 0x74, 0x04, 0xF0, 0xF1, 0x8F, 0xEF, 0x64, 0x01, 0x70, 0x32, 0xF5, -0x3B, 0x90, 0x8E, 0x3A, 0xE0, 0xC3, 0x13, 0x54, 0x7F, 0xF5, 0x3C, 0xE4, 0xFB, 0xFD, 0x7F, 0x58, -0x7E, 0x01, 0x12, 0x34, 0x8C, 0x90, 0x01, 0x5B, 0x74, 0x05, 0xF0, 0x90, 0x06, 0x92, 0x74, 0x01, -0xF0, 0x90, 0x8E, 0x24, 0xE0, 0x44, 0x08, 0xF0, 0x22, 0x90, 0x8E, 0x2A, 0xE0, 0x70, 0x02, 0x31, -0xAD, 0x22, 0xB1, 0xAD, 0x90, 0x8E, 0x2A, 0x74, 0x08, 0xF0, 0x22, 0x91, 0x74, 0x90, 0x8E, 0x2A, -0x74, 0x0C, 0xF0, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x8E, 0x34, 0x12, 0x46, -0x7B, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0x8E, -0x34, 0x12, 0x46, 0x7B, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0x7F, 0xB0, 0x7E, 0x0E, 0x12, 0x37, -0x5D, 0x90, 0x00, 0x10, 0xE0, 0x44, 0x0C, 0xFD, 0x7F, 0x10, 0x12, 0x3A, 0x96, 0x90, 0x00, 0x72, -0xE0, 0x54, 0xF3, 0xFD, 0x7F, 0x72, 0x12, 0x3A, 0x96, 0x90, 0x01, 0x01, 0xE0, 0x44, 0x02, 0xF0, -0x90, 0x01, 0x00, 0x74, 0xFF, 0xF0, 0x90, 0x06, 0xB7, 0x74, 0x09, 0xF0, 0x90, 0x06, 0xB4, 0x74, -0x86, 0xF0, 0x7F, 0xB4, 0x7E, 0x08, 0x12, 0x36, 0xCE, 0xEF, 0x54, 0xBF, 0xFF, 0xEC, 0x90, 0x90, -0x7D, 0x12, 0x27, 0x48, 0x90, 0x90, 0x7D, 0x12, 0x46, 0x7B, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, -0x7F, 0xB4, 0x7E, 0x08, 0x12, 0x37, 0x5D, 0x90, 0x00, 0x02, 0xE0, 0x44, 0x01, 0xF0, 0x7F, 0x00, -0x7E, 0x0C, 0x12, 0x36, 0xCE, 0xEF, 0x44, 0x03, 0xFF, 0xEC, 0x90, 0x90, 0x7D, 0x12, 0x27, 0x48, -0x90, 0x90, 0x7D, 0x12, 0x46, 0x7B, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0x7F, 0x00, 0x7E, 0x0C, -0x12, 0x37, 0x5D, 0x7F, 0x00, 0x7E, 0x0E, 0x12, 0x36, 0xCE, 0xEF, 0x44, 0x03, 0xFF, 0xEC, 0x90, -0x90, 0x7D, 0x12, 0x27, 0x48, 0x90, 0x90, 0x7D, 0x12, 0x46, 0x7B, 0x90, 0xAC, 0xB9, 0x12, 0x27, -0x48, 0x7F, 0x00, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0x00, 0xFF, 0xE0, 0x70, 0x27, 0x7B, 0x01, -0x7A, 0x90, 0x79, 0x81, 0xB1, 0x7A, 0x90, 0x90, 0x81, 0xE0, 0x54, 0xE7, 0xFB, 0x7F, 0x01, 0xF1, -0xE6, 0x7B, 0x01, 0x7F, 0x01, 0xB1, 0x7E, 0x90, 0x90, 0x81, 0xE0, 0x54, 0x18, 0x70, 0x06, 0x90, -0x01, 0xBF, 0xE0, 0x04, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x7D, 0x08, 0x7F, 0x01, 0xEF, 0x70, -0x04, 0x7E, 0x01, 0x80, 0x07, 0xEF, 0x64, 0x01, 0x70, 0x19, 0x7E, 0x40, 0x90, 0x00, 0xE2, 0xED, -0xF0, 0xA3, 0xEE, 0xF0, 0x90, 0x00, 0xE1, 0xE0, 0x12, 0x26, 0x64, 0x90, 0x00, 0xE3, 0xE4, 0xF0, -0x7F, 0x01, 0x22, 0x90, 0x01, 0xC2, 0xE0, 0x44, 0x01, 0xF0, 0x7F, 0x00, 0x22, 0x12, 0x70, 0x22, -0x7F, 0x00, 0x7E, 0x0C, 0x12, 0x36, 0xCE, 0xEF, 0x54, 0xFC, 0xFF, 0xEC, 0x90, 0x90, 0x83, 0x12, -0x27, 0x48, 0x90, 0x90, 0x83, 0x12, 0x46, 0x7B, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0x7F, 0x00, -0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x7F, 0x00, 0x7E, 0x0E, 0x12, 0x36, 0xCE, 0xEF, 0x54, 0xFC, 0xFF, -0xEC, 0x90, 0x90, 0x83, 0x12, 0x27, 0x48, 0x90, 0x90, 0x83, 0x12, 0x46, 0x7B, 0x90, 0xAC, 0xB9, -0x12, 0x27, 0x48, 0x7F, 0x00, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0x00, 0x02, 0xE0, 0x54, 0xFE, -0xF0, 0x7F, 0xB4, 0x7E, 0x08, 0x12, 0x36, 0xCE, 0xEF, 0x44, 0x40, 0xFF, 0xEC, 0x90, 0x90, 0x83, -0x12, 0x27, 0x48, 0x90, 0x90, 0x83, 0x12, 0x46, 0x7B, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0x7F, -0xB4, 0x7E, 0x08, 0x12, 0x37, 0x5D, 0x90, 0x01, 0x00, 0x74, 0x3F, 0xF0, 0xA3, 0xE0, 0x54, 0xFD, -0xF0, 0x90, 0x05, 0x53, 0xE0, 0x44, 0x20, 0xF0, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x36, 0xCE, 0x90, -0x8E, 0x34, 0x12, 0x27, 0x48, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, 0x77, 0x7F, -0xB0, 0x7E, 0x0C, 0x12, 0x37, 0x5D, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x54, 0x77, 0x77, 0x77, 0x77, -0x7F, 0xB0, 0x7E, 0x0E, 0x12, 0x37, 0x5D, 0x90, 0x00, 0xFF, 0xE0, 0x70, 0x13, 0x7B, 0x01, 0x7A, -0x90, 0x79, 0x82, 0xB1, 0x7A, 0x90, 0x90, 0x82, 0xE0, 0x44, 0x18, 0xFB, 0x7F, 0x01, 0xF1, 0xE6, -0x22, 0x90, 0x05, 0x22, 0x74, 0xFF, 0xF0, 0x12, 0x70, 0x22, 0x90, 0x01, 0x37, 0x74, 0x02, 0xF0, -0xFD, 0x7F, 0x03, 0x12, 0x4E, 0x1B, 0xB1, 0xAD, 0xE4, 0x90, 0x8E, 0x2A, 0xF0, 0x22, 0x90, 0x06, -0x04, 0xE0, 0x54, 0x7F, 0xF0, 0x90, 0x05, 0x22, 0xE4, 0xF0, 0x90, 0x8E, 0x2A, 0x74, 0x0C, 0xF0, -0x22, 0x90, 0x8F, 0x71, 0x12, 0x46, 0xA8, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0xFF, 0xFE, 0x12, -0x26, 0x1E, 0xFD, 0xC3, 0x13, 0x30, 0xE0, 0x12, 0x90, 0x8F, 0x71, 0x12, 0x46, 0x9F, 0x90, 0x00, -0x02, 0x12, 0x26, 0x37, 0x90, 0x8F, 0x75, 0xF0, 0x80, 0x05, 0x90, 0x8F, 0x75, 0xEF, 0xF0, 0x90, -0x8F, 0x74, 0xEE, 0xF0, 0x90, 0x8F, 0x75, 0xE0, 0xFE, 0x90, 0x8F, 0x74, 0xE0, 0xFF, 0xD3, 0x9E, -0x50, 0x38, 0x90, 0x8F, 0x71, 0x12, 0x46, 0x9F, 0x12, 0x26, 0x1E, 0x54, 0x01, 0xFE, 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 0xFF, 0x12, 0x70, 0x6A, 0x90, 0x8D, 0x01, 0xE0, 0xB4, -0x03, 0x0C, 0x90, 0x00, 0x70, 0xE0, 0x54, 0x7F, 0xFD, 0x7F, 0x70, 0x12, 0x3A, 0x96, 0x22, 0x8F, -0x11, 0x22, 0x8F, 0x11, 0x22, 0x90, 0x00, 0x90, 0xE0, 0x20, 0xE0, 0xF9, 0x22, 0x90, 0x8E, 0x27, -0xE0, 0x60, 0x02, 0x71, 0xFA, 0x22, 0xEF, 0x70, 0x04, 0x7E, 0x03, 0x80, 0x07, 0xEF, 0x64, 0x01, -0x70, 0x19, 0x7E, 0x42, 0x90, 0x00, 0xE2, 0xED, 0xF0, 0x90, 0x00, 0xE0, 0xEB, 0xF0, 0x90, 0x00, -0xE3, 0xEE, 0xF0, 0x54, 0xFD, 0xF0, 0xE4, 0xF0, 0x7F, 0x01, 0x22, 0x90, 0x01, 0xC2, 0xE0, 0x44, -0x01, 0xF0, 0x7F, 0x00, 0x22, 0xE4, 0xFB, 0xFA, 0xFD, 0x7F, 0x01, 0x12, 0x4A, 0xCF, 0x90, 0x8F, -0x63, 0xEF, 0xF0, 0x60, 0xF0, 0x11, 0x29, 0x80, 0xEC, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, -0x90, 0x01, 0xCC, 0xE0, 0x54, 0x0F, 0x90, 0x8F, 0x64, 0xF0, 0x90, 0x8F, 0x64, 0xE0, 0xFD, 0x70, -0x02, 0x21, 0x53, 0x90, 0x90, 0x93, 0xE0, 0xFF, 0x74, 0x01, 0x7E, 0x00, 0xA8, 0x07, 0x08, 0x80, -0x05, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, 0xF9, 0xFF, 0xEF, 0x5D, 0x70, 0x02, 0x21, 0x4C, 0x90, -0x90, 0x93, 0xE0, 0x75, 0xF0, 0x04, 0x90, 0x01, 0xD0, 0x12, 0x46, 0x93, 0xE0, 0x90, 0x8F, 0x65, -0xF0, 0x75, 0x40, 0x01, 0x75, 0x41, 0x8F, 0x75, 0x42, 0x65, 0x75, 0x43, 0x01, 0x7B, 0x01, 0x7A, -0x8F, 0x79, 0x66, 0x12, 0x34, 0x2C, 0x90, 0x90, 0x93, 0xE0, 0x75, 0xF0, 0x04, 0x90, 0x01, 0xD1, -0x12, 0x46, 0x93, 0xE0, 0x90, 0x8F, 0x67, 0xF0, 0x90, 0x90, 0x93, 0xE0, 0x75, 0xF0, 0x04, 0x90, -0x01, 0xD2, 0x12, 0x46, 0x93, 0xE0, 0x90, 0x8F, 0x68, 0xF0, 0x90, 0x90, 0x93, 0xE0, 0x75, 0xF0, -0x04, 0x90, 0x01, 0xD3, 0x12, 0x46, 0x93, 0xE0, 0x90, 0x8F, 0x69, 0xF0, 0x90, 0x90, 0x93, 0xE0, -0x75, 0xF0, 0x04, 0x90, 0x01, 0xF0, 0x12, 0x46, 0x93, 0xE0, 0x90, 0x8F, 0x6A, 0xF0, 0x90, 0x90, -0x93, 0xE0, 0x75, 0xF0, 0x04, 0x90, 0x01, 0xF1, 0x12, 0x46, 0x93, 0xE0, 0x90, 0x8F, 0x6B, 0xF0, -0x90, 0x90, 0x93, 0xE0, 0x75, 0xF0, 0x04, 0x90, 0x01, 0xF2, 0x12, 0x46, 0x93, 0xE0, 0x90, 0x8F, -0x6C, 0xF0, 0x90, 0x90, 0x93, 0xE0, 0x75, 0xF0, 0x04, 0x90, 0x01, 0xF3, 0x12, 0x46, 0x93, 0xE0, -0x90, 0x8F, 0x6D, 0xF0, 0x90, 0x8F, 0x64, 0xE0, 0xFF, 0x90, 0x90, 0x93, 0xE0, 0xFE, 0x74, 0x01, -0xA8, 0x06, 0x08, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0xF4, 0x5F, 0x90, 0x8F, 0x64, 0xF0, 0x90, -0x90, 0x93, 0xE0, 0xFF, 0x74, 0x01, 0xA8, 0x07, 0x08, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0x90, -0x01, 0xCC, 0xF0, 0x90, 0x8F, 0x66, 0xE0, 0xFF, 0x7B, 0x01, 0x7A, 0x8F, 0x79, 0x67, 0x31, 0x58, -0x90, 0x90, 0x93, 0xE0, 0x04, 0xF0, 0xE0, 0x54, 0x03, 0xF0, 0x01, 0x3A, 0x90, 0x01, 0xC0, 0xE0, -0x44, 0x02, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0x8F, 0x6E, 0x12, 0x46, 0xA8, 0xEF, 0x12, -0x46, 0xB1, 0x59, 0x90, 0x00, 0x59, 0x99, 0x01, 0x59, 0xA2, 0x02, 0x59, 0xAB, 0x03, 0x59, 0xB4, -0x04, 0x59, 0xBD, 0x20, 0x59, 0xC5, 0x21, 0x59, 0xCE, 0x23, 0x59, 0xD6, 0x25, 0x59, 0xE6, 0x80, -0x59, 0xDE, 0x81, 0x59, 0xEF, 0x82, 0x59, 0xF8, 0x83, 0x5A, 0x01, 0x84, 0x00, 0x00, 0x5A, 0x0A, -0x90, 0x8F, 0x6E, 0x12, 0x46, 0x9F, 0x02, 0x6C, 0x58, 0x90, 0x8F, 0x6E, 0x12, 0x46, 0x9F, 0x02, -0x56, 0xB1, 0x90, 0x8F, 0x6E, 0x12, 0x46, 0x9F, 0x02, 0x6C, 0xA0, 0x90, 0x8F, 0x6E, 0x12, 0x46, -0x9F, 0x02, 0x77, 0xA1, 0x90, 0x8F, 0x6E, 0x12, 0x46, 0x9F, 0x02, 0x7F, 0x2D, 0x90, 0x8F, 0x6E, -0x12, 0x46, 0x9F, 0x80, 0x4D, 0x90, 0x8F, 0x6E, 0x12, 0x46, 0x9F, 0x02, 0x6C, 0xD8, 0x90, 0x8F, -0x6E, 0x12, 0x46, 0x9F, 0xE1, 0xC8, 0x90, 0x8F, 0x6E, 0x12, 0x46, 0x9F, 0xE1, 0xDD, 0x90, 0x8F, -0x6E, 0x12, 0x46, 0x9F, 0xC1, 0xB3, 0x90, 0x8F, 0x6E, 0x12, 0x46, 0x9F, 0x02, 0x77, 0xC1, 0x90, -0x8F, 0x6E, 0x12, 0x46, 0x9F, 0x02, 0x7E, 0x4E, 0x90, 0x8F, 0x6E, 0x12, 0x46, 0x9F, 0x02, 0x7E, -0x68, 0x90, 0x8F, 0x6E, 0x12, 0x46, 0x9F, 0x02, 0x7E, 0xCA, 0x90, 0x01, 0xC0, 0xE0, 0x44, 0x01, -0xF0, 0x22, 0x12, 0x26, 0x1E, 0xFF, 0x54, 0x7F, 0x90, 0x8E, 0x27, 0xF0, 0xEF, 0xC4, 0x13, 0x13, -0x13, 0x54, 0x01, 0xA3, 0xF0, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0xFF, 0x54, 0xF0, 0xC4, 0x54, -0x0F, 0xFE, 0x90, 0x8E, 0x26, 0xE0, 0x54, 0xF0, 0x4E, 0xF0, 0x90, 0x00, 0x03, 0x12, 0x26, 0x37, -0x54, 0x01, 0x25, 0xE0, 0xFE, 0x90, 0x8E, 0x24, 0xE0, 0x54, 0xFD, 0x4E, 0xF0, 0xEF, 0x54, 0x0F, -0xC4, 0x54, 0xF0, 0xFF, 0x90, 0x8E, 0x26, 0xE0, 0x54, 0x0F, 0x4F, 0xF0, 0x90, 0x00, 0x04, 0x12, -0x26, 0x37, 0x90, 0x8E, 0x29, 0xF0, 0x51, 0x8D, 0x90, 0x01, 0xB9, 0x74, 0x01, 0xF0, 0x90, 0x01, -0xB8, 0xF0, 0x90, 0x8E, 0x27, 0xE0, 0x90, 0x01, 0xBA, 0xF0, 0x90, 0x8E, 0x29, 0xE0, 0x90, 0x01, -0xBB, 0xF0, 0x90, 0x8E, 0x26, 0xE0, 0x54, 0x0F, 0x90, 0x01, 0xBE, 0xF0, 0x22, 0x90, 0x8F, 0x71, -0x12, 0x46, 0xA8, 0x12, 0x80, 0x1E, 0x90, 0x8E, 0x27, 0xE0, 0xFF, 0x51, 0xBD, 0x90, 0x8E, 0x27, -0xE0, 0x60, 0x19, 0x90, 0x8F, 0x71, 0x12, 0x46, 0x9F, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0x54, -0x0F, 0xFF, 0x90, 0x00, 0x02, 0x12, 0x26, 0x37, 0xFD, 0x12, 0x80, 0x2F, 0x22, 0xEF, 0x70, 0x37, -0x7D, 0x78, 0x7F, 0x02, 0x71, 0x04, 0x7D, 0x02, 0x7F, 0x03, 0x71, 0x04, 0x7D, 0xC8, 0x7F, 0x02, -0x12, 0x71, 0x1A, 0x90, 0x01, 0x57, 0xE4, 0xF0, 0x90, 0x01, 0x3C, 0x74, 0x02, 0xF0, 0x7D, 0x01, -0x7F, 0x0C, 0x12, 0x51, 0xB1, 0x90, 0x8E, 0x24, 0xE0, 0x54, 0xF7, 0xF0, 0x54, 0xEF, 0xF0, 0x90, -0x06, 0x0A, 0xE0, 0x54, 0xF8, 0xF0, 0x22, 0x02, 0x4E, 0x30, 0x7D, 0x02, 0x7F, 0x02, 0x71, 0x04, -0x7D, 0x01, 0x7F, 0x02, 0x74, 0x5D, 0x2F, 0xF8, 0xE6, 0xFE, 0xED, 0xF4, 0x5E, 0xFE, 0xF6, 0x74, -0x30, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x01, 0xF5, 0x83, 0xEE, 0xF0, 0x22, 0x90, 0x8E, 0x2A, 0xE0, -0x64, 0x02, 0x60, 0x28, 0x71, 0x9E, 0x90, 0x8E, 0x25, 0xE0, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x30, -0xE0, 0x14, 0x90, 0x8E, 0x2D, 0xE0, 0xFF, 0xA3, 0xE0, 0x6F, 0x70, 0x0A, 0x91, 0x32, 0x51, 0xFA, -0x90, 0x8E, 0x2E, 0xE0, 0x14, 0xF0, 0x90, 0x01, 0xE6, 0xE0, 0x04, 0xF0, 0x22, 0x90, 0x8E, 0x27, -0xE0, 0x60, 0x45, 0x90, 0x8E, 0x25, 0xE0, 0xFF, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x30, 0xE0, 0x12, -0x90, 0x01, 0x3B, 0xE0, 0x30, 0xE4, 0x0B, 0x51, 0xFA, 0x90, 0x8E, 0x2D, 0xE0, 0x14, 0x90, 0x05, -0x73, 0xF0, 0x90, 0x90, 0x98, 0xE4, 0x75, 0xF0, 0x01, 0x12, 0x46, 0x4B, 0xC3, 0x90, 0x90, 0x99, -0xE0, 0x94, 0x80, 0x90, 0x90, 0x98, 0xE0, 0x64, 0x80, 0x94, 0x80, 0x40, 0x0B, 0x90, 0x01, 0x98, -0xE0, 0x54, 0xFE, 0xF0, 0xE0, 0x44, 0x01, 0xF0, 0x12, 0x7E, 0xF8, 0x02, 0x4E, 0x8B, 0x90, 0x8D, -0xA3, 0xE0, 0x64, 0x01, 0x60, 0x02, 0x81, 0x31, 0x90, 0x8E, 0x27, 0xE0, 0x70, 0x02, 0x81, 0x31, -0x90, 0x8E, 0x26, 0xE0, 0xC4, 0x54, 0x0F, 0x64, 0x01, 0x70, 0x22, 0x90, 0x06, 0xAB, 0xE0, 0x90, -0x8E, 0x2E, 0xF0, 0x90, 0x06, 0xAA, 0xE0, 0x90, 0x8E, 0x2D, 0xF0, 0xA3, 0xE0, 0xFF, 0x70, 0x08, -0x90, 0x8E, 0x2D, 0xE0, 0xFE, 0xFF, 0x80, 0x00, 0x90, 0x8E, 0x2E, 0xEF, 0xF0, 0x90, 0x8E, 0x25, -0xE0, 0x44, 0x04, 0xF0, 0xE4, 0x90, 0x8E, 0x30, 0xF0, 0x90, 0x8E, 0x32, 0xA3, 0xE0, 0x90, 0x05, -0x58, 0xF0, 0x90, 0x01, 0x57, 0xE4, 0xF0, 0x90, 0x01, 0x3C, 0x74, 0x02, 0xF0, 0x90, 0x8E, 0x2B, -0xE0, 0x54, 0xFD, 0xF0, 0x54, 0xEF, 0xF0, 0x90, 0x8E, 0x26, 0xE0, 0xFF, 0xC4, 0x54, 0x0F, 0x24, -0xFD, 0x50, 0x02, 0x80, 0x02, 0x91, 0x56, 0x90, 0x8E, 0x25, 0xE0, 0x13, 0x13, 0x13, 0x54, 0x1F, -0x30,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 0xC0, 0xF0, 0xC0, 0x83, 0xC0, 0x82, -0xC0, 0xD0, 0x75, 0xD0, 0x00, 0xC0, 0x00, 0xC0, 0x01, 0xC0, 0x02, 0xC0, 0x03, 0xC0, 0x04, 0xC0, -0x05, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0x01, 0xC4, 0x74, 0xD8, 0xF0, 0x74, 0x5C, 0xA3, 0xF0, 0x12, -0x6E, 0x39, 0xE5, 0x61, 0x30, 0xE3, 0x02, 0xF1, 0xD0, 0xE5, 0x61, 0x30, 0xE4, 0x05, 0x7F, 0x02, -0x12, 0x4A, 0xA8, 0xE5, 0x63, 0x30, 0xE0, 0x02, 0xB1, 0x7C, 0xE5, 0x63, 0x30, 0xE1, 0x02, 0x71, -0x4D, 0xE5, 0x63, 0x30, 0xE2, 0x02, 0x71, 0x1C, 0xE5, 0x63, 0x30, 0xE3, 0x03, 0x12, 0x6E, 0x66, -0xE5, 0x63, 0x30, 0xE4, 0x03, 0x12, 0x6E, 0x99, 0xE5, 0x63, 0x30, 0xE5, 0x02, 0xD1, 0x32, 0xE5, -0x63, 0x30, 0xE6, 0x03, 0x12, 0x6E, 0xC8, 0xE5, 0x64, 0x30, 0xE1, 0x03, 0x12, 0x57, 0xDD, 0xE5, -0x64, 0x30, 0xE6, 0x02, 0xD1, 0x09, 0x74, 0xD8, 0x04, 0x90, 0x01, 0xC4, 0xF0, 0x74, 0x5C, 0xA3, -0xF0, 0xD0, 0x07, 0xD0, 0x06, 0xD0, 0x05, 0xD0, 0x04, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, -0x00, 0xD0, 0xD0, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xF0, 0xD0, 0xE0, 0x32, 0xE4, 0xFF, 0x90, 0x8E, -0x27, 0xE0, 0x70, 0x02, 0xC1, 0x08, 0x90, 0x8D, 0xA3, 0xE0, 0x64, 0x01, 0x70, 0x7A, 0x90, 0x8E, -0x26, 0xE0, 0xC4, 0x54,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x4E, 0xF0, 0x90, 0x01, 0x17, 0xE0, 0xFE, 0x90, 0x01, 0x16, 0xE0, -0x7C, 0x00, 0x24, 0x00, 0xFF, 0xEC, 0x3E, 0x90, 0x8D, 0x9F, 0xF0, 0xA3, 0xEF, 0xF0, 0x90, 0x01, -0xC2, 0x74, 0x01, 0xF0, 0x90, 0x8E, 0x40, 0xE0, 0xC3, 0x13, 0x54, 0x01, 0xFF, 0xF1, 0x67, 0x90, -0x8E, 0x40, 0xE0, 0x13, 0x13, 0x54, 0x01, 0xFF, 0xF1, 0xBC, 0x90, 0x01, 0xC2, 0x74, 0x02, 0xF0, -0x90, 0x8E, 0x40, 0xE0, 0xC4, 0x54, 0x01, 0xFF, 0xF1, 0xC2, 0x90, 0x01, 0xC2, 0x74, 0x03, 0xF0, -0x04, 0xF0, 0x90, 0x8E, 0x40, 0xE0, 0x54, 0x01, 0xFF, 0x12, 0x4D, 0x9A, 0x90, 0x01, 0xC2, 0x74, -0x05, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xEF, 0x60, 0x07, 0x90, 0x8F, 0x4E, 0xE0, 0xFF, 0xF1, -0x72, 0x22, 0x12, 0x7C, 0xEA, 0x7E, 0x00, 0x90, 0x8F, 0x71, 0x12, 0x79, 0x98, 0x90, 0x8F, 0x71, -0xA3, 0xE0, 0x2F, 0x24, 0x3E, 0xF9, 0xE4, 0x34, 0xFC, 0x75, 0x40, 0x01, 0xF5, 0x41, 0x89, 0x42, -0x75, 0x43, 0x04, 0x7B, 0x01, 0x7A, 0x8E, 0x79, 0x52, 0x12, 0x34, 0x2C, 0xE4, 0xFF, 0x74, 0x18, -0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x06, 0xF5, 0x83, 0xE0, 0xFE, 0x74, 0x46, 0x2F, 0xF5, 0x82, 0xE4, -0x34, 0x8E, 0xF5, 0x83, 0xEE, 0xF0, 0x0F, 0xEF, 0xB4, 0x06, 0xE3, 0x22, 0x90, 0x8F, 0x71, 0xEF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8F, 0x7F, 0x12, 0x46, 0xA8, 0x90, 0x90, 0x95, -0xE0, 0xFF, 0x04, 0xF0, 0x90, 0x00, 0x01, 0xEF, 0x12, 0x26, 0x76, 0x7F, 0xAF, 0x7E, 0x01, 0x31, -0x46, 0xEF, 0x60, 0x3A, 0x90, 0x8F, 0x7F, 0x12, 0x46, 0x9F, 0x8B, 0x40, 0x8A, 0x41, 0x89, 0x42, -0x90, 0x00, 0x0E, 0x12, 0x26, 0x37, 0x24, 0x02, 0xF5, 0x43, 0x7B, 0x01, 0x7A, 0x01, 0x79, 0xA0, -0x12, 0x34, 0x2C, 0x90, 0x8F, 0x7F, 0x12, 0x46, 0x9F, 0x90, 0x00, 0x0E, 0x12, 0x26, 0x37, 0x90, -0x01, 0xAE, 0xF0, 0xA3, 0x74, 0xFF, 0xF0, 0x90, 0x01, 0xCB, 0xE0, 0x64, 0x80, 0xF0, 0xD0, 0xD0, -0x92, 0xAF, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x90, 0x8F, 0x12, 0x46, 0xA8, -0x7F, 0x96, 0x7E, 0x02, 0x31, 0x46, 0xEF, 0x60, 0x58, 0x90, 0x01, 0x17, 0xE0, 0xFE, 0x90, 0x01, -0x16, 0xE0, 0x7C, 0x00, 0x24, 0x00, 0xFF, 0xEC, 0x3E, 0xFE, 0xEF, 0x24, 0x01, 0xFF, 0xE4, 0x3E, -0xFE, 0x90, 0x90, 0x92, 0xEF, 0xF0, 0xEE, 0xFF, 0x90, 0xFD, 0x11, 0xF0, 0x90, 0x90, 0x92, 0xE0, -0xFD, 0x90, 0x02, 0x94, 0xF0, 0xA3, 0xEF, 0xF0, 0x90, 0x90, 0x8F, 0x12, 0x46, 0x9F, 0x90, 0x00, -0x0E, 0x12, 0x26, 0x37, 0x24, 0x02, 0xFF, 0xE4, 0x33, 0xFE, 0x31, 0x9C, 0x90, 0x90, 0x92, 0xE0, -0x24, 0x18, 0xFF, 0x90, 0x90,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E4, 0x34, 0xFB, -0xF5, 0x83, 0xE0, 0x44, 0x10, 0xF0, 0x22, 0x90, 0x90, 0x8B, 0xEF, 0xF0, 0xA3, 0x12, 0x46, 0xA8, -0x90, 0x90, 0x94, 0xE0, 0xFE, 0x04, 0xF0, 0x90, 0x00, 0x01, 0xEE, 0x12, 0x26, 0x76, 0x74, 0x00, -0x2F, 0xF9, 0xE4, 0x34, 0xFB, 0xFA, 0x7B, 0x01, 0xC0, 0x03, 0xC0, 0x02, 0xC0, 0x01, 0x90, 0x90, -0x8C, 0x12, 0x46, 0x9F, 0x8B, 0x40, 0x8A, 0x41, 0x89, 0x42, 0x75, 0x43, 0x02, 0xD0, 0x01, 0xD0, -0x02, 0xD0, 0x03, 0x12, 0x34, 0x2C, 0x90, 0x90, 0x8B, 0xE0, 0x24, 0x02, 0xF9, 0xE4, 0x34, 0xFB, -0xFA, 0x7B, 0x01, 0xC0, 0x03, 0xC0, 0x02, 0xC0, 0x01, 0xA3, 0x12, 0x46, 0x9F, 0xE9, 0x24, 0x02, -0xF9, 0xE4, 0x3A, 0x8B, 0x40, 0xF5, 0x41, 0x89, 0x42, 0x90, 0x90, 0x8C, 0x12, 0x46, 0x9F, 0x90, -0x00, 0x0E, 0x12, 0x26, 0x37, 0xF5, 0x43, 0xD0, 0x01, 0xD0, 0x02, 0xD0, 0x03, 0x02, 0x34, 0x2C, -0xE4, 0xFB, 0xFA, 0xFD, 0x7F, 0x01, 0x12, 0x4A, 0xCF, 0x90, 0x8F, 0x82, 0xEF, 0xF0, 0x60, 0xF0, -0xF1, 0x68, 0xBF, 0x01, 0xEB, 0x51, 0x89, 0x80, 0xE7, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, -0xE4, 0x90, 0x8F, 0x8D, 0xF0, 0xA3, 0x74, 0x08, 0xF0, 0xA3, 0xF0, 0xE4, 0xFF, 0x74, 0x10, 0x2F, -0xF5, 0x82, 0xE4, 0x34, 0x06, 0xF5, 0x83, 0xE0,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E0, 0x0F, 0x90, 0x01, 0x4D, 0xE0, 0x64, 0x80, 0xF0, -0x22, 0x90, 0x06, 0x90, 0xE0, 0x44, 0x01, 0xF0, 0x22, 0x90, 0x8F, 0x96, 0xEE, 0xF0, 0xA3, 0xEF, -0xF0, 0xA3, 0x12, 0x46, 0xA8, 0xE4, 0x90, 0x8F, 0xA1, 0xF0, 0x90, 0x8F, 0xA1, 0xE0, 0xFD, 0xC3, -0x94, 0x06, 0x50, 0x27, 0x90, 0x8F, 0x97, 0xE0, 0x24, 0x04, 0xFF, 0x90, 0x8F, 0x96, 0xE0, 0x34, -0x00, 0xFE, 0x91, 0x92, 0x90, 0x8F, 0xA1, 0xE0, 0x24, 0x9B, 0xF5, 0x82, 0xE4, 0x34, 0x8F, 0xF5, -0x83, 0xEF, 0xF0, 0x90, 0x8F, 0xA1, 0xE0, 0x04, 0xF0, 0x80, 0xCF, 0x78, 0x98, 0x7C, 0x8F, 0x7D, -0x01, 0x7B, 0x01, 0x7A, 0x8F, 0x79, 0x9B, 0x7E, 0x00, 0x7F, 0x06, 0x12, 0x48, 0x5D, 0xEF, 0x7F, -0x00, 0x70, 0x02, 0x7F, 0x01, 0x22, 0xEF, 0x90, 0x01, 0xC7, 0xB4, 0xA0, 0x05, 0x74, 0x04, 0xF0, -0x80, 0x03, 0x74, 0x08, 0xF0, 0x90, 0x8E, 0x45, 0xE0, 0x44, 0x01, 0xF0, 0x22, 0x90, 0x8E, 0x45, -0xE0, 0x30, 0xE0, 0x03, 0x7F, 0x01, 0x22, 0x90, 0x06, 0x90, 0xE0, 0x20, 0xE5, 0x0A, 0x90, 0x01, -0x3F, 0xE0, 0x30, 0xE2, 0x03, 0x7F, 0x01, 0x22, 0x7F, 0x00, 0x22, 0x90, 0x8E, 0x45, 0xE0, 0xFF, -0x20, 0xE0, 0x07, 0x90, 0x01, 0x3F, 0xE0, 0x30, 0xE2, 0x14, 0xEF, 0x44, 0x01, 0x90, 0x8E, 0x45, -0xF0, 0x90, 0x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E4, 0x90, 0x90, 0x70, 0xF0, 0xEB, 0xFF, 0xE4, 0x90, 0x90, 0x6C, 0x12, 0x27, 0x48, -0x90, 0x90, 0x6C, 0x12, 0x46, 0x7B, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0x7F, 0xB0, 0x7E, 0x08, -0x12, 0x37, 0x5D, 0x7F, 0x14, 0x7E, 0x00, 0x12, 0x3A, 0xF7, 0x90, 0x90, 0x6B, 0xE0, 0x75, 0xF0, -0x08, 0xA4, 0x24, 0x73, 0xF5, 0x82, 0xE4, 0x34, 0xAF, 0xF5, 0x83, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, -0x12, 0x36, 0xCE, 0xED, 0x54, 0x0F, 0xFD, 0xE4, 0xFC, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, -0xD0, 0x12, 0x67, 0xA5, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, -0xC0, 0x07, 0xC0, 0x05, 0x90, 0x90, 0x73, 0x12, 0x46, 0x7B, 0x90, 0xAC, 0x9C, 0x12, 0x27, 0x48, -0xD0, 0x05, 0xD0, 0x07, 0x12, 0x32, 0x65, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xC0, 0xE0, 0xC0, 0xF0, -0xC0, 0x83, 0xC0, 0x82, 0xC0, 0xD0, 0x75, 0xD0, 0x00, 0xC0, 0x00, 0xC0, 0x01, 0xC0, 0x02, 0xC0, -0x03, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0x01, 0xC4, 0x74, 0x2C, 0xF0, 0x74, -0x68, 0xA3, 0xF0, 0x11, 0x7B, 0x74, 0x2C, 0x04, 0x90, 0x01, 0xC4, 0xF0, 0x74, 0x68, 0xA3, 0xF0, -0xD0, 0x07, 0xD0, 0x06, 0xD0, 0x05, 0xD0, 0x04, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, -0xD0, 0xD0, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xF0, 0xD0, 0xE0, 0x32, 0x7B, 0x00, 0x7A, 0x00, 0x79, -0x53, 0xE4, 0xFD, 0x7F, 0x01, 0x12, 0x39, 0x33, 0xE5, 0x51, 0x52, 0x53, 0x7B, 0x00, 0x7A, 0x00, -0x79, 0x54, 0x7D, 0x01, 0x7F, 0x01, 0x12, 0x39, 0x33, 0xE5, 0x52, 0x52, 0x54, 0xAB, 0x53, 0xE4, -0xFD, 0x7F, 0x01, 0x12, 0x39, 0x04, 0xAB, 0x54, 0x7D, 0x01, 0x7F, 0x01, 0x02, 0x39, 0x04, 0xC0, -0xE0, 0xC0, 0xF0, 0xC0, 0x83, 0xC0, 0x82, 0xC0, 0xD0, 0x75, 0xD0, 0x00, 0xC0, 0x00, 0xC0, 0x01, -0xC0, 0x02, 0xC0, 0x03, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0x01, 0xC4, 0x74, -0xAF, 0xF0, 0x74, 0x68, 0xA3, 0xF0, 0x11, 0xFE, 0x74, 0xAF, 0x04, 0x90, 0x01, 0xC4, 0xF0, 0x74, -0x68, 0xA3, 0xF0, 0xD0, 0x07, 0xD0, 0x06, 0xD0, 0x05, 0xD0, 0x04, 0xD0, 0x03, 0xD0, 0x02, 0xD0, -0x01, 0xD0, 0x00, 0xD0, 0xD0, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xF0, 0xD0, 0xE0, 0x32, 0x90, 0x00, -0x54, 0xE0, 0x55, 0x55, 0xF5, 0x59, 0xA3, 0xE0, 0x55, 0x56, 0xF5, 0x5A, 0xA3, 0xE0, 0x55, 0x57, -0xF5, 0x5B, 0xA3, 0xE0, 0x55, 0x58, 0xF5, 0x5C, 0xAD, 0x59, 0x7F, 0x54, 0x12, 0x3A, 0x96, 0xAD, -0x5A, 0x7F, 0x55, 0x12, 0x3A, 0x96, 0xAD, 0x5B, 0x7F, 0x56, 0x12, 0x3A, 0x96, 0xAD, 0x5C, 0x7F, -0x57, 0x12, 0x3A, 0x96, 0x53, 0x91, 0xEF, 0x22, 0xC0, 0xE0, 0xC0, 0xF0, 0xC0, 0x83, 0xC0, 0x82, -0xC0, 0xD0, 0x75, 0xD0, 0x00, 0xC0, 0x00, 0xC0, 0x01, 0xC0, 0x02, 0xC0, 0x03, 0xC0, 0x04, 0xC0, -0x05, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0x01, 0xC4, 0x74, 0x38, 0xF0, 0x74, 0x69, 0xA3, 0xF0, 0x51, -0xDA, 0xE5, 0x69, 0x30, 0xE1, 0x02, 0x31, 0xC3, 0xE5, 0x69, 0x30, 0xE2, 0x02, 0x71, 0x0A, 0xE5, -0x69, 0x30, 0xE3, 0x02, 0x71, 0x46, 0xE5, 0x6A, 0x30, 0xE0, 0x02, 0x51, 0x91, 0xE5, 0x6C, 0x30, -0xE1, 0x05, 0x7F, 0x03, 0x12, 0x4A, 0xA8, 0xE5, 0x6C, 0x30, 0xE4, 0x03, 0x12, 0x4E, 0x79, 0xE5, -0x6C, 0x30, 0xE5, 0x02, 0x31, 0xCC, 0xE5, 0x6C, 0x30, 0xE6, 0x02, 0x51, 0x53, 0x74, 0x38, 0x04, -0x90, 0x01, 0xC4, 0xF0, 0x74, 0x69, 0xA3, 0xF0, 0xD0, 0x07, 0xD0, 0x06, 0xD0, 0x05, 0xD0, 0x04, -0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0xD0, 0xD0, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xF0, -0xD0, 0xE0, 0x32, 0x90, 0x8E, 0x27, 0xE0, 0x60, 0x02, 0x71, 0xC9, 0x22, 0x90, 0x8E, 0x24, 0xE0, -0xFF, 0xC4, 0x13, 0x13, 0x54, 0x03, 0x30, 0xE0, 0x27, 0xEF, 0x54, 0xBF, 0xF0, 0x90, 0x04, 0xE0, -0xE0, 0x90, 0x8E, 0x25, 0x30, 0xE0, 0x06, 0xE0, 0x44, 0x01, 0xF0, 0x80, 0x10, 0xE0, 0x54, 0xFE, -0xF0, 0x90, 0x01, 0xB9, 0x74, 0x01, 0xF0, 0x90, 0x01, 0xB8, 0x74, 0x04, 0xF0, 0x12, 0x51, 0xA4, -0xE4, 0xFF, 0x90, 0x8F, 0x5B, 0xE0, 0x30, 0xE0, 0x49, 0x90, 0x8F, 0x5F, 0xE0, 0xFD, 0x60, 0x42, -0x74, 0x01, 0x7E, 0x00, 0xA8, 0x07, 0x08, 0x80, 0x05, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, 0xF9, -0xFF, 0x90, 0x04, 0xE0, 0xE0, 0xFB, 0xEF, 0x5B, 0x60, 0x06, 0xE4, 0x90, 0x8F, 0x5F, 0xF0, 0x22, -0x90, 0x8F, 0x5D, 0xE0, 0xD3, 0x9D, 0x50, 0x11, 0x90, 0x01, 0xC7, 0x74, 0x10, 0xF0, 0x12, 0x65, -0x75, 0x90, 0x8F, 0x5B, 0xE0, 0x54, 0xFE, 0xF0, 0x22, 0x12, 0x4E, 0xC0, 0x90, 0x8F, 0x5F, 0xE0, -0x04, 0xF0, 0x22, 0x90, 0x8E, 0x24, 0xE0, 0xFF, 0xC4, 0x13, 0x13, 0x13, 0x54, 0x01, 0x30, 0xE0, -0x2C, 0xEF, 0x54, 0x7F, 0xF0, 0x90, 0x04, 0xE0, 0xE0, 0x90, 0x8E, 0x25, 0x30, 0xE1, 0x06, 0xE0, -0x44, 0x02, 0xF0, 0x80, 0x0F, 0xE0, 0x54, 0xFD, 0xF0, 0x90, 0x01, 0xB9, 0x74, 0x01, 0xF0, 0x90, -0x01, 0xB8, 0x04, 0xF0, 0x90, 0x8E, 0x27, 0xE0, 0x60, 0x03, 0x12, 0x51, 0xA4, 0x7F, 0x01, 0x41, -0x02, 0x71, 0x82, 0x90, 0x8F, 0xB1, 0xEF, 0xF0, 0x90, 0x8E, 0x24, 0x30, 0xE0, 0x06, 0xE0, 0x44, -0x01, 0xF0, 0x80, 0x04, 0xE0, 0x54, 0xFE, 0xF0, 0x90, 0x8F, 0xB1, 0xE0, 0x30, 0xE6, 0x11, 0x90, -0x01, 0x2F, 0xE0, 0x30, 0xE7, 0x04, 0xE4, 0xF0, 0x80, 0x06, 0x90, 0x01, 0x2F, 0x74, 0x80, 0xF0, -0x90, 0x8E, 0x24, 0xE0, 0x30, 0xE0, 0x12, 0x90, 0x8E, 0x32, 0xE4, 0xF0, 0xA3, 0x74, 0x05, 0xF0, -0x90, 0x8E, 0x32, 0xA3, 0xE0, 0x90, 0x05, 0x58, 0xF0, 0x22, 0x90, 0x01, 0x3C, 0xE0, 0x55, 0x65, -0xF5, 0x69, 0xA3, 0xE0, 0x55, 0x66, 0xF5, 0x6A, 0xA3, 0xE0, 0x55, 0x67, 0xF5, 0x6B, 0xA3, 0xE0, -0x55, 0x68, 0xF5, 0x6C, 0x90, 0x01, 0x3C, 0xE5, 0x69, 0xF0, 0xA3, 0xE5, 0x6A, 0xF0, 0xA3, 0xE5, -0x6B, 0xF0, 0xA3, 0xE5, 0x6C, 0xF0, 0x53, 0x91, 0xDF, 0x22, 0x90, 0x8E, 0x27, 0xE0, 0x60, 0x35, -0x90, 0x06, 0x92, 0xE0, 0x30, 0xE0, 0x24, 0xE4, 0xF5, 0x3B, 0x90, 0x8E, 0x3A, 0xE0, 0xC3, 0x13, -0x54, 0x7F, 0xF5, 0x3C, 0xE4, 0xFB, 0xFD, 0x7F, 0x58, 0x7E, 0x01, 0x12, 0x34, 0x8C, 0x90, 0x01, -0x5B, 0x74, 0x05, 0xF0, 0x90, 0x06, 0x92, 0x74, 0x01, 0xF0, 0x22, 0x90, 0x8E, 0x24, 0xE0, 0x54, -0xF7, 0xF0, 0x12, 0x51, 0xA4, 0x22, 0x90, 0x8E, 0x27, 0xE0, 0x60, 0x35, 0x90, 0x06, 0x92, 0xE0, -0x30, 0xE1, 0x24, 0xE4, 0xF5, 0x3B,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E0, -0xD3, 0x9F, 0x40, 0x0F, 0x90, 0x8D, 0xA3, 0xE0, 0xB4, 0x01, 0x0B, 0x90, 0x8E, 0x25, 0xE0, 0x54, -0xFB, 0xF0, 0x22, 0x12, 0x51, 0xA4, 0x22, 0xC0, 0xE0, 0xC0, 0x83, 0xC0, 0x82, 0xC0, 0xD0, 0x75, -0xD0, 0x00, 0xC0, 0x05, 0xC0, 0x07, 0x7D, 0x27, 0x90, 0x01, 0xC4, 0xED, 0xF0, 0x74, 0x6C, 0xFF, -0xA3, 0xF0, 0xED, 0x04, 0x90, 0x01, 0xC4, 0xF0, 0xA3, 0xEF, 0xF0, 0xD0, 0x07, 0xD0, 0x05, 0xD0, -0xD0, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xE0, 0x32, 0x90, 0x02, 0x09, 0xE0, 0xFD, 0x12, 0x26, 0x1E, -0xFE, 0xAF, 0x05, 0xED, 0x2E, 0x90, 0x8D, 0x02, 0xF0, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0xFF, -0xED, 0x2F, 0x90, 0x8D, 0x03, 0xF0, 0x90, 0x00, 0x02, 0x12, 0x26, 0x37, 0xFF, 0xED, 0x2F, 0x90, -0x8D, 0x04, 0xF0, 0x90, 0x00, 0x03, 0x12, 0x26, 0x37, 0xFF, 0xED, 0x2F, 0x90, 0x8D, 0x05, 0xF0, -0x90, 0x00, 0x04, 0x12, 0x26, 0x37, 0xFF, 0xAE, 0x05, 0xED, 0x2F, 0x90, 0x8D, 0x06, 0xF0, 0x22, -0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x12, 0x26, 0x1E, 0xFF, 0x90, 0x8E, 0x23, 0xF0, 0xBF, -0x01, 0x12, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0x64, 0x01, 0x60, 0x17, 0x90, 0x05, 0x22, 0x74, -0x6F, 0xF0, 0x80, 0x0F, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0x64, 0x01, 0x60, 0x05, 0x90, 0x05, -0x22, 0xE4, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0x00, 0x02, 0x12, 0x26, 0x37, 0xFF, 0x30, -0xE0, 0x26, 0x12, 0x26, 0x1E, 0x90, 0x8E, 0x38, 0xF0, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0x90, -0x8E, 0x39, 0xF0, 0xEF, 0x54, 0xFE, 0xFF, 0xA3, 0xE0, 0x54, 0x01, 0x4F, 0xF0, 0x90, 0x00, 0x03, -0x12, 0x26, 0x37, 0x90, 0x8E, 0x3B, 0xF0, 0x22, 0x90, 0x8E, 0x38, 0x74, 0x01, 0xF0, 0xA3, 0x74, -0x07, 0xF0, 0xA3, 0xE0, 0x54, 0x01, 0x44, 0x28, 0xF0, 0xA3, 0x74, 0x05, 0xF0, 0x22, 0xD3, 0x10, -0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x8D, 0x9D, 0xE0, 0xFF, 0x70, 0x06, 0xA3, 0xE0, 0x64, 0x09, -0x60, 0x0A, 0xEF, 0x14, 0xFF, 0x90, 0x8D, 0x9E, 0xE0, 0xB5, 0x07, 0x04, 0x7F, 0x01, 0x80, 0x02, -0x7F, 0x00, 0xEF, 0x60, 0x09, 0x90, 0x01, 0xC1, 0xE0, 0x44, 0x02, 0xF0, 0x80, 0x35, 0xC0, 0x01, -0x90, 0x8D, 0x9E, 0xE0, 0x75, 0xF0, 0x0F, 0xA4, 0x24, 0x07, 0xF9, 0x74, 0x8D, 0x35, 0xF0, 0xA8, -0x01, 0xFC, 0x7D, 0x01, 0xD0, 0x01, 0x7E, 0x00, 0x7F, 0x0F, 0x12, 0x45, 0xD0, 0x90, 0x8D, 0x9E, -0xE0, 0x04, 0xF0, 0xE0, 0x7F, 0x00, 0xB4, 0x0A, 0x02, 0x7F, 0x01, 0xEF, 0x60, 0x05, 0xE4, 0x90, -0x8D, 0x9E, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0x01, 0x01, 0xE0, 0x44, 0x04, 0xF0, 0x90, -0x01, 0x9C, 0x74, 0x7E, 0xF0, 0xA3, 0x74, 0x92, 0xF0, 0xA3, 0x74, 0xA0, 0xF0, 0xA3, 0x74, 0x24, -0xF0, 0x90, 0x01, 0x9B, 0x74, 0x49, 0xF0, 0x90, 0x01, 0x9A, 0x74, 0xE0, 0xF0, 0x90, 0x01, 0x99, -0xE4, 0xF0, 0x90, 0x01, 0x98, 0x04, 0xF0, 0x22, 0xE4, 0x90, 0x8F, 0x60, 0xF0, 0xA3, 0xF0, 0x90, -0x01, 0x98, 0xE0, 0x7F, 0x00, 0x30, 0xE4, 0x02, 0x7F, 0x01, 0xEF, 0x64, 0x01, 0x60, 0x3E, 0xC3, -0x90, 0x8F, 0x61, 0xE0, 0x94, 0x88, 0x90, 0x8F, 0x60, 0xE0, 0x94, 0x13, 0x40, 0x08, 0x90, 0x01, -0xC1, 0xE0, 0x44, 0x10, 0xF0, 0x22, 0x90, 0x8F, 0x60, 0xE4, 0x75, 0xF0, 0x01, 0x12, 0x46, 0x4B, -0x7F, 0x14, 0x7E, 0x00, 0x12, 0x3A, 0xF7, 0xD3, 0x90, 0x8F, 0x61, 0xE0, 0x94, 0x32, 0x90, 0x8F, -0x60, 0xE0, 0x94, 0x00, 0x40, 0xB9, 0x90, 0x01, 0xC6, 0xE0, 0x30, 0xE3, 0xB2, 0x22, 0x7F, 0x02, -0x90, 0x8F, 0x57, 0xE0, 0xFE, 0xEF, 0xC3, 0x9E, 0x50, 0x18, 0xEF, 0x25, 0xE0, 0x24, 0x81, 0xF8, -0xE6, 0x30, 0xE4, 0x0B, 0x90, 0x01, 0xB8, 0x74, 0x08, 0xF0, 0xA3, 0xF0, 0x7F, 0x00, 0x22, 0x0F, -0x80, 0xDE, 0x7F, 0x01, 0x22, 0xE4, 0xF5, 0x6D, 0x22, 0x90, 0x01, 0x34, 0xE0, 0x55, 0x5D, 0xF5, -0x61, 0xA3, 0xE0, 0x55, 0x5E, 0xF5, 0x62, 0xA3, 0xE0, 0x55, 0x5F, 0xF5, 0x63, 0xA3, 0xE0, 0x55, -0x60, 0xF5, 0x64, 0x90, 0x01, 0x34, 0xE5, 0x61, 0xF0, 0xA3, 0xE5, 0x62, 0xF0, 0xA3, 0xE5, 0x63, -0xF0, 0xA3, 0xE5, 0x64, 0xF0, 0x22, 0x90, 0x8D, 0xA3, 0xE0, 0x64, 0x01, 0x70, 0x2A, 0x90, 0x8E, -0x27, 0xE0, 0x60, 0x24, 0x90, 0x01, 0x57, 0xE4, 0xF0, 0x90, 0x01, 0x3C, 0x74, 0x02, 0xF0, 0xE4, -0xF5, 0x3B, 0x90, 0x8E, 0x39, 0xE0, 0xF5, 0x3C, 0xE4, 0xFB, 0xFD, 0x7F, 0x54, 0x7E, 0x01, 0x12, -0x34, 0x8C, 0x90, 0x01, 0x57, 0x74, 0x05, 0xF0, 0x22, 0x90, 0x8D, 0xA3, 0xE0, 0x64, 0x01, 0x70, -0x26, 0x90, 0x8E, 0x27, 0xE0, 0x60, 0x20, 0x90, 0x01, 0x57, 0xE4, 0xF0, 0x90, 0x01, 0x3C, 0x74, -0x02, 0xF0, 0x90, 0x8E, 0x24, 0xE0, 0x54, 0xFB, 0xF0, 0x90, 0x8E, 0x2B, 0xE0, 0x54, 0xFD, 0xF0, -0x54, 0x07, 0x70, 0x03, 0x12, 0x51, 0xA4, 0x22, 0x90, 0x8D, 0xA3, 0xE0, 0xB4, 0x01, 0x14, 0x90, -0x8E, 0x27, 0xE0, 0x60, 0x0E, 0x90, 0x8E, 0x2B, 0xE0, 0x54, 0xFE, 0xF0, 0x54, 0x07, 0x70, 0x03, -0x12, 0x51, 0xA4, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x04, 0x1D, 0xE0, 0x60, -0x1A, 0x90, 0x05, 0x22, 0xE0, 0x54, 0x90, 0x60, 0x07, 0x90, 0x01, 0xC0, 0xE0, 0x44, 0x08, 0xF0, -0x90, 0x01, 0xC6, 0xE0, 0x30, 0xE1, 0xE4, 0x7F, 0x00, 0x80, 0x02, 0x7F, 0x01, 0xD0, 0xD0, 0x92, -0xAF, 0x22, 0x90, 0x90, 0x51, 0x12, 0x46, 0xA8, 0xD1, 0xE4, 0xEF, 0x64, 0x01, 0x60, 0x02, 0xE1, -0xE5, 0x90, 0x8F, 0x4E, 0xE0, 0xFF, 0x7D, 0x01, 0x12, 0x4F, 0x3B, 0x90, 0x90, 0x58, 0x12, 0x79, -0x98, 0x90, 0x90, 0x5A, 0xEF, 0xF0, 0x90, 0x90, 0x58, 0xA3, 0xE0, 0x24, 0x28, 0xF9, 0xE4, 0x34, -0xFC, 0xFA, 0x7B, 0x01, 0x90, 0x90, 0x57, 0xE0, 0xFD, 0x12, 0x78, 0xFC, 0x90, 0x90, 0x58, 0xA3, -0xE0, 0x24, 0x38, 0xF9, 0xE4, 0x34, 0xFC, 0xFA, 0x7B, 0x01, 0xC0, 0x03, 0xC0, 0x02, 0xC0, 0x01, -0x90, 0x90, 0x54, 0x12, 0x46, 0x9F, 0x8B, 0x40, 0x8A, 0x41, 0x89, 0x42, 0x75, 0x43, 0x06, 0xD0, -0x01, 0xD0, 0x02, 0xD0, 0x03, 0x12, 0x34, 0x2C, 0x90, 0x90, 0x58, 0xA3, 0xE0, 0xFF, 0xA3, 0xE0, -0x2F, 0x24, 0x42, 0xF9, 0xE4, 0x34, 0xFC, 0xFA, 0x7B, 0x01, 0xC0, 0x03, 0xC0, 0x02, 0xC0, 0x01, -0x90, 0x90, 0x54, 0x12, 0x46, 0x9F, 0x8B, 0x40, 0x8A, 0x41, 0x89, 0x42, 0x75, 0x43, 0x06, 0xD0, -0x01, 0xD0, 0x02, 0xD0, 0x03, 0x12, 0x34, 0x2C, 0x90, 0x90, 0x58, 0xA3, 0xE0, 0xFF, 0xA3, 0xE0, -0x2F, 0x24, 0x48, 0xF9, 0xE4, 0x34, 0xFC, 0xFA, 0x7B, 0x01, 0xC0, 0x03, 0xC0, 0x02, 0xC0, 0x01, -0x90, 0x90, 0x51, 0x12, 0x46, 0x9F, 0x8B, 0x40, 0x8A, 0x41, 0x89, 0x42, 0x75, 0x43, 0x04, 0xD0, -0x01, 0xD0, 0x02, 0xD0, 0x03, 0x12, 0x34, 0x2C, 0x90, 0x06, 0x30, 0xE0, 0x44, 0x10, 0xF0, 0x90, -0x04, 0x1F, 0x74, 0x20, 0xF0, 0x22, 0xC3, 0xEE, 0x94, 0x01, 0x40, 0x0A, 0x0D, 0xED, 0x13, 0x90, -0xFD, 0x10, 0xF0, 0xE4, 0x2F, 0xFF, 0x22, 0xC3, 0xEE, 0x94, 0x01, 0x40, 0x24, 0x90, 0xFD, 0x11, -0xE0, 0x6D, 0x70, 0x1A, 0x90, 0x01, 0x17, 0xE0, 0xB5, 0x05, 0x0D, 0x90, 0x01, 0xE4, 0x74, 0x77, -0xF0, 0x90, 0xFD, 0x11, 0xE4, 0xF0, 0x80, 0x06, 0xED, 0x04, 0x90, 0xFD, 0x11, 0xF0, 0xE4, 0x2F, -0xFF, 0x22, 0xE4, 0x90, 0x90, 0x9C, 0xF0, 0xA3, 0xF0, 0x90, 0x05, 0xF8, 0xE0, 0x70, 0x0F, 0xA3, -0xE0, 0x70, 0x0B, 0xA3, 0xE0, 0x70, 0x07, 0xA3, 0xE0, 0x70, 0x03, 0x7F, 0x01, 0x22, 0xD3, 0x90, -0x90, 0x9D, 0xE0, 0x94, 0xE8, 0x90, 0x90, 0x9C, 0xE0, 0x94, 0x03, 0x40, 0x0A, 0x90, 0x01, 0xC0, -0xE0, 0x44, 0x20, 0xF0, 0x7F, 0x00, 0x22, 0x7F, 0x32, 0x7E, 0x00, 0x12, 0x3A, 0xF7, 0x90, 0x90, -0x9C, 0xE4, 0x75, 0xF0, 0x01, 0x12, 0x46, 0x4B, 0x80, 0xBF, 0x8F, 0x14, 0xE4, 0x90, 0x90, 0x9E, -0xF0, 0xA3, 0xF0, 0x90, 0x01, 0x09, 0xE0, 0x7F, 0x00, 0x30, 0xE7, 0x02, 0x7F, 0x01, 0xEF, 0x65, -0x14, 0x60, 0x3E, 0xC3, 0x90, 0x90, 0x9F, 0xE0, 0x94, 0x88, 0x90, 0x90, 0x9E, 0xE0, 0x94, 0x13, -0x40, 0x08, 0x90, 0x01, 0xC0, 0xE0, 0x44, 0x10, 0xF0, 0x22, 0x90, 0x90, 0x9E, 0xE4, 0x75, 0xF0, -0x01, 0x12, 0x46, 0x4B, 0x7F, 0x14, 0x7E, 0x00, 0x12, 0x3A, 0xF7, 0xD3, 0x90, 0x90, 0x9F, 0xE0, -0x94, 0x32, 0x90, 0x90, 0x9E, 0xE0, 0x94, 0x00, 0x40, 0xB9, 0x90, 0x01, 0xC6, 0xE0, 0x30, 0xE0, -0xB2, 0x22, 0x90, 0x8D, 0x01, 0xE0, 0xB4, 0x03, 0x0C, 0x90, 0x00, 0x70, 0xE0, 0x44, 0x80, 0xFD, -0x7F, 0x70, 0x12, 0x3A, 0x96, 0x90, 0x8E, 0x31, 0xE0, 0xFD, 0x7F, 0x93, 0x12, 0x3A, 0x96, 0x90, -0x8E, 0x28, 0xE0, 0x60, 0x12, 0x90, 0x01, 0x2F, 0xE0, 0x30, 0xE7, 0x05, 0x74, 0x10, 0xF0, 0x80, -0x06, 0x90, 0x01, 0x2F, 0x74, 0x90, 0xF0, 0x90, 0x00, 0x08, 0xE0, 0x44, 0x10, 0xFD, 0x7F, 0x08, -0x12, 0x3A, 0x96, 0x7F, 0x01, 0x11, 0x6A, 0x90, 0x00, 0x90, 0xE0, 0x44, 0x01, 0xFD, 0x7F, 0x90, -0x12, 0x3A, 0x96, 0x7F, 0x14, 0x7E, 0x00, 0x02, 0x3A, 0xF7, 0x74, 0x65, 0x2F, 0xF8, 0xE6, 0xFE, -0xED, 0xF4, 0x5E, 0xFE, 0xF6, 0x74, 0x38, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x01, 0xF5, 0x83, 0xEE, -0xF0, 0x22, 0xA9, 0x07, 0x90, 0x06, 0x69, 0xE0, 0xFE, 0x90, 0x06, 0x68, 0xE0, 0x7A, 0x00, 0x24, -0x00, 0xFF, 0xEA, 0x3E, 0xFE, 0xE9, 0x14, 0x60, 0x13, 0x14, 0x60, 0x10, 0x24, 0x02, 0x70, 0x14, -0xEE, 0x54, 0xFE, 0xFE, 0xEF, 0x54, 0x7F, 0x90, 0x06, 0x68, 0x80, 0x04, 0x90, 0x06, 0x68, 0xEF, -0xF0, 0xEE, 0xA3, 0xF0, 0x22, 0x90, 0x90, 0xA8, 0xED, 0xF0, 0xEF, 0x14, 0x60, 0x23, 0x14, 0x70, -0x02, 0x41, 0x13, 0x24, 0x02, 0x60, 0x02, 0x41, 0x61, 0x90, 0x90, 0x32, 0x12, 0x27, 0x54, 0x00, -0x30, 0x03, 0xC3, 0x90, 0x90, 0x36, 0x12, 0x27, 0x54, 0x00, 0x30, 0x02, 0x00, 0x7F, 0xAC, 0x41, -0x5D, 0x90, 0x90, 0x32, 0x12, 0x27, 0x54, 0x00, 0x30, 0x03, 0xC3, 0x90, 0x90, 0x36, 0x12, 0x27, -0x54, 0x00, 0x30, 0x02, 0x01, 0x51, 0x79, 0x90, 0x90, 0x32, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, -0x3C, 0x51, 0x62, 0x90, 0x90, 0x32, 0x12, 0x27, 0x54, 0xF0, 0x00, 0x00, 0x00, 0x90, 0x90, 0xA8, -0xE0, 0x7E, 0x00, 0x78, 0x1C, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, 0xF9, 0xFF, 0xEE, 0x33, 0x95, -0xE0, 0xFD, 0xFC, 0x90, 0x90, 0x36, 0x12, 0x27, 0x48, 0x7F, 0x38, 0x7E, 0x08, 0x51, 0x7D, 0x90, -0x90, 0xA8, 0xE0, 0x90, 0x90, 0x32, 0xB4, 0x01, 0x13, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x10, -0x90, 0x90, 0x36, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x10, 0x80, 0x11, 0x12, 0x27, 0x54, 0x00, -0x00, 0x00, 0x10, 0x90, 0x90, 0x36, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x00, 0x7E, -0x0A, 0x80, 0x4C, 0x90, 0x90, 0x32, 0x12, 0x27, 0x54, 0x00, 0x30, 0x03, 0xC3, 0x90, 0x90, 0x36, -0x12, 0x27, 0x54, 0x00, 0x30, 0x02, 0x02, 0x51, 0x79, 0x90, 0x90, 0x32, 0x12, 0x27, 0x54, 0x00, -0x00, 0x00, 0x3C, 0x51, 0x62, 0x90, 0x90, 0x32, 0x12, 0x27, 0x54, 0xF0, 0x00, 0x00, 0x00, 0x90, -0x90, 0xA8, 0xE0, 0x7E, 0x00, 0x78, 0x1C, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, 0xF9, 0xFF, 0xEE, -0x33, 0x95, 0xE0, 0xFD, 0xFC, 0x90, 0x90, 0x36, 0x12, 0x27, 0x48, 0x7F, 0x38, 0x7E, 0x08, 0x51, -0x7D, 0x22, 0x90, 0x90, 0xA8, 0xE0, 0x75, 0xF0, 0x04, 0xA4, 0xFF, 0xAE, 0xF0, 0xEE, 0x33, 0x95, -0xE0, 0xFD, 0xFC, 0x90, 0x90, 0x36, 0x12, 0x27, 0x48, 0x7F, 0xAC, 0x7E, 0x08, 0x90, 0x90, 0x30, -0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0x12, 0x36, 0xCE, 0x90, 0x90, 0x3A, 0x12, 0x27, 0x48, 0x90, 0x90, -0x32, 0x12, 0x46, 0x7B, 0x12, 0x27, 0x15, 0x90, 0x90, 0x3A, 0x12, 0x46, 0x87, 0x12, 0x46, 0x61, -0x90, 0x90, 0x36, 0x12, 0x46, 0x87, 0x12, 0x46, 0x6E, 0x90, 0x90, 0x3E, 0x12, 0x27, 0x48, 0x90, -0x90, 0x3E, 0x12, 0x46, 0x7B, 0x90, 0xAC, 0xB9, 0x12, 0x27, 0x48, 0x90, 0x90, 0x30, 0xE0, 0xFE, -0xA3, 0xE0, 0xFF, 0x02, 0x37, 0x5D, 0x90, 0x90, 0xA0, 0xEF, 0xF0, 0x90, 0x90, 0x32, 0x12, 0x27, -0x54, 0x30, 0x00, 0x00, 0x00, 0x90, 0x90, 0x36, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x00, 0x74, -0x08, 0xFF, 0xFE, 0x51, 0x7D, 0x90, 0x90, 0xA0, 0xE0, 0x60, 0x02, 0x61, 0xA0, 0x90, 0x90, 0x32, -0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x03, 0x90, 0x90, 0x36, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, -0x00, 0x7F, 0x2C, 0x7E, 0x08, 0x51, 0x7D, 0x90, 0x90, 0x32, 0x12, 0x27, 0x54, 0x30, 0x00, 0x00, -0x00, 0x90, 0x90, 0x36, 0x12, 0x27, 0x54, 0x30, 0x00, 0x00, 0x00, 0x74, 0x08, 0xFF, 0xFE, 0x51, -0x7D, 0x90, 0x90, 0x32, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0xF0, 0x90, 0x90, 0x36, 0x12, 0x27, -0x54, 0x00, 0x00, 0x00, 0x70, 0x7F, 0xB0, 0x7E, 0x0C, 0x51, 0x7D, 0x90, 0x90, 0x32, 0x12, 0x27, -0x54, 0x00, 0x00, 0x00, 0xF0, 0x90, 0x90, 0x36, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x70, 0x7F, -0xB0, 0x7E, 0x0E, 0x51, 0x7D, 0x90, 0x90, 0x32, 0x12, 0x27, 0x54, 0x00, 0xFF, 0x00, 0x00, 0x90, -0x90, 0x36, 0x12, 0x27, 0x54, 0x00, 0x77, 0x00, 0x00, 0x7F, 0xB0, 0x7E, 0x0C, 0x51, 0x7D, 0x90, -0x90, 0x32, 0x12, 0x27, 0x54, 0x00, 0xFF, 0x00, 0x00, 0x90, 0x90, 0x36, 0x12, 0x27, 0x54, 0x00, -0x77, 0x00, 0x00, 0x7F, 0xB0, 0x7E, 0x0E, 0x51, 0x7D, 0x90, 0x04, 0x54, 0xE0, 0x54, 0x7F, 0x90, -0x90, 0xA1, 0xF0, 0xE0, 0x90, 0x04, 0x54, 0xF0, 0xE4, 0x90, 0x90, 0xA2, 0xF0, 0xA3, 0xF0, 0x22, -0x90, 0x90, 0xA0, 0xE0, 0x64, 0x01, 0x60, 0x02, 0x81, 0x5D, 0x90, 0x04, 0x54, 0xE0, 0x44, 0x80, -0x90, 0x90, 0xA1, 0xF0, 0xE0, 0x90, 0x04, 0x54, 0xF0, 0x90, 0x90, 0x32, 0x12, 0x27, 0x54, 0x00, -0x00, 0x00, 0x03, 0x90, 0x90, 0x36, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x01, 0x7F, 0x2C, 0x7E, -0x08, 0x51, 0x7D, 0x90, 0x90, 0x32, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0xF0, 0x90, 0x90, 0x36, -0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0x10, 0x7F, 0xB0, 0x7E, 0x0C, 0x51, 0x7D, 0x90, 0x90, 0x32, -0x12, 0x27, 0x54, 0x00, 0x00, 0x00, 0xF0, 0x90, 0x90, 0x36, 0x12, 0x27, 0x54, 0x00, 0x00, 0x00, -0x10, 0x7F, 0xB0, 0x7E, 0x0E, 0x51, 0x7D, 0x90, 0x90, 0x32, 0x12, 0x27, 0x54, 0x00, 0xFF, 0x00, -0x00, 0x90, 0x90, 0x36, 0x12, 0x27, 0x54, 0x00, 0x54, 0x00, 0x00, 0x7F, 0xB0, 0x7E, 0x0C, 0x51, -0x7D, 0x90, 0x90, 0x32, 0x12, 0x27, 0x54, 0x00, 0xFF, 0x00, 0x00, 0x90, 0x90, 0x36, 0x12, 0x27, -0x54, 0x00, 0x54, 0x00, 0x00, 0x7F, 0xB0, 0x7E, 0x0E, 0x51, 0x7D, 0x90, 0x90, 0x32, 0x12, 0x27, -0x54, 0x30, 0x00, 0x00, 0x00, 0x90, 0x90, 0x36, 0x12, 0x27, 0x54, 0x20, 0x00, 0x00, 0x00, 0x74, -0x08, 0xFF, 0xFE, 0x51, 0x7D, 0x90, 0x90, 0xA2, 0xE4, 0xF0, 0xA3, 0x04, 0xF0, 0x22, 0x90, 0x90, -0xA9, 0xEF, 0xF0, 0xD1, 0x80, 0x90, 0x90, 0xA9, 0xE0, 0xC3, 0x94, 0x0E, 0x50, 0x44, 0x90, 0x90, -0x32, 0x12, 0x27, 0x54, 0x1F, 0xFE, 0x00, 0x00, 0x90, 0x90, 0x36, 0x12, 0x27, 0x54, 0x12, 0xD4, -0x00, 0x00, 0x7F, 0x60, 0x7E, 0x08, 0x51, 0x7D, 0x90, 0x90, 0x20, 0x12, 0x27, 0x54, 0x00, 0x07, -0x03, 0xFF, 0x90, 0x90, 0xA9, 0xE0, 0xFF, 0xE4, 0xFC, 0xFD, 0xFE, 0xD1, 0x1B, 0x90, 0x90, 0x20, -0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0xFF, 0x90, 0x90, 0xA9, 0xE0, 0xFF, 0xE4, 0xFC, 0xFD, 0xFE, -0xC1, 0x0A, 0x90, 0x90, 0xA9, 0xE0, 0xFF, 0x74, 0x24, 0xD3, 0x9F, 0x50, 0x1B, 0xEF, 0x94, 0x30, -0x50, 0x16, 0x90, 0x90, 0x32, 0x12, 0x27, 0x54, 0x1F, 0xFE, 0x00, 0x00, 0x90, 0x90, 0x36, 0x12, -0x27, 0x54, 0x09, 0x28, 0x00, 0x00, 0x80, 0x70, 0x90, 0x90, 0xA9, 0xE0, 0xFF, 0x74, 0x32, 0xD3, -0x9F, 0x50, 0x1B, 0xEF, 0x94, 0x40, 0x50, 0x16, 0x90, 0x90, 0x32, 0x12, 0x27, 0x54, 0x1F, 0xFE, -0x00, 0x00, 0x90, 0x90, 0x36, 0x12, 0x27, 0x54, 0x08, 0xA6, 0x00, 0x00, 0x80, 0x4A, 0x90, 0x90, -0xA9, 0xE0, 0xFF, 0x74, 0x64, 0xD3, 0x9F, 0x50, 0x1B, 0xEF, 0x94, 0x74, 0x50, 0x16, 0x90, 0x90, -0x32, 0x12, 0x27, 0x54, 0x1F, 0xFE, 0x00, 0x00, 0x90, 0x90, 0x36, 0x12, 0x27, 0x54, 0x08, 0xA4, -0x00, 0x00, 0x80, 0x24, 0x90, 0x90, 0xA9, 0xE0, 0xFF, 0x74, 0x76, 0xD3, 0x9F, 0x50, 0x1F, 0xEF, -0x94, 0xA5, 0x50, 0x1A, 0x90, 0x90, 0x32, 0x12, 0x27, 0x54, 0x1F, 0xFE, 0x00, 0x00, 0x90, 0x90, -0x36, 0x12, 0x27, 0x54, 0x08, 0x24, 0x00, 0x00, 0x7F, 0x60, 0x7E, 0x08, 0x51, 0x7D, 0x90, 0x90, -0xA9, 0xE0, 0xFF, 0x74, 0x24, 0xD3, 0x9F, 0x50, 0x37, 0xEF, 0x94, 0x40, 0x50, 0x32, 0x90, 0x90, -0x20, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0xFF, 0x90, 0x90, 0xA9, 0xE0, 0xFF, 0xE4, 0xFC, 0xFD, -0x74, 0x01, 0xFE, 0x0D, 0x14, 0xD1, 0x1B, 0x90, 0x90, 0x20, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, -0xFF, 0x90, 0x90, 0xA9, 0xE0, 0xFF, 0xE4, 0xFC, 0xFD, 0x74, 0x01, 0xFE, 0x0D, 0x14, 0x80, 0x7A, -0x90, 0x90, 0xA9, 0xE0, 0xFF, 0x74, 0x64, 0xD3, 0x9F, 0x50, 0x37, 0xEF, 0x94, 0x8C, 0x50, 0x32, -0x90, 0x90, 0x20, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0xFF, 0x90, 0x90, 0xA9, 0xE0, 0xFF, 0xE4, -0xFC, 0x74, 0x01, 0xFE, 0x74, 0x03, 0xD1, 0x19, 0x90, 0x90, 0x20, 0x12, 0x27, 0x54, 0x00, 0x07, -0x03, 0xFF, 0x90, 0x90, 0xA9, 0xE0, 0xFF, 0xE4, 0xFC, 0x74, 0x01, 0xFE, 0x74, 0x03, 0xFD, 0xE4, -0x80, 0x38, 0x90, 0x90, 0xA9, 0xE0, 0xFB, 0x74, 0x8C, 0xC3, 0x9B, 0x50, 0x3B, 0x90, 0x90, 0x20, -0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0xFF, 0xAF, 0x03, 0xE4, 0xFC, 0x74, 0x01, 0xFE, 0x74, 0x05, -0xD1, 0x19, 0x90, 0x90, 0x20, 0x12, 0x27, 0x54, 0x00, 0x07, 0x03, 0xFF, 0x90, 0x90, 0xA9, 0xE0, -0xFF, 0xE4, 0xFC, 0x74, 0x01, 0xFE, 0x74, 0x05, 0xFD, 0xE4, 0x90, 0x90, 0x24, 0x12, 0x27, 0x48, -0x7D, 0x18, 0x7C, 0x00, 0x7F, 0x01, 0xD1, 0x27, 0x22, 0xFD, 0xE4, 0x90, 0x90, 0x24, 0x12, 0x27, -0x48, 0x7D, 0x18, 0x7C, 0x00, 0xE4, 0xFF, 0x90, 0x90, 0x1E, 0xEC, 0xF0, 0xA3, 0xED, 0xF0, 0x90, -0x90, 0x1D, 0xEF, 0xF0, 0xA3, 0xA3, 0xE0, 0xFD, 0x12, 0x3A, 0xA9, 0x90, 0x90, 0x28, 0x12, 0x27, -0x48, 0x90, 0x90, 0x20, 0x12, 0x46, 0x7B, 0x12, 0x27, 0x15, 0x90, 0x90, 0x28, 0x12, 0x46, 0x87, -0x12, 0x46, 0x61, 0x90, 0x90, 0x24, 0x12, 0x46, 0x87, 0x12, 0x46, 0x6E, 0x90, 0x90, 0x2C, 0x12, -0x27, 0x48, 0x90, 0x90, 0x1E, 0xA3, 0xE0, 0xFD, 0xC0, 0x05, 0x90, 0x90, 0x2C, 0x12, 0x46, 0x7B, -0x90, 0xAC, 0x96, 0x12, 0x27, 0x48, 0x90, 0x90, 0x1D, 0xE0, 0xFF, 0xD0, 0x05, 0x02, 0x39, 0xBA, -0x90, 0x90, 0xAA, 0xEF, 0xF0, 0xD3, 0x94, 0x0E, 0x50, 0x14, 0x90, 0x90, 0xA2, 0xE0, 0xFE, 0xA3, -0xE0, 0xFF, 0x4E, 0x60, 0x20, 0xEF, 0x64, 0x01, 0x4E, 0x70, 0x1A, 0xFF, 0x41, 0xC6, 0x90, 0x90, -0xAA, 0xE0, 0xD3, 0x94, 0x0E, 0x40, 0x0E, 0x90, 0x90, 0xA2, 0xE0, 0x70, 0x02, 0xA3, 0xE0, 0x70, -0x04, 0x7F, 0x01, 0x51, 0xC6, 0x22, 0xEF, 0x14, 0x60, 0x39, 0x14, 0x60, 0x52, 0x24, 0x02, 0x70, -0x6A, 0x90, 0x90, 0x20, 0x12, 0x27, 0x54, 0x00, 0x00, 0x0C, 0x00, 0x90, 0x90, 0x24, 0x12, 0x27, -0x54, 0x00, 0x00, 0x0C, 0x00, 0xD1, 0x21, 0x90, 0x90, 0x20, 0x12, 0x27, 0x54, 0x00, 0x00, 0x0C, -0x00, 0x90, 0x90, 0x24, 0x12, 0x27, 0x54, 0x00, 0x00, 0x0C, 0x00, 0x7D, 0x18, 0x7C, 0x00, 0x7F, -0x01, 0x80, 0x36, 0x90, 0x90, 0x20, 0x12, 0x27, 0x54, 0x00, 0x00, 0x0C, 0x00, 0x90, 0x90, 0x24, -0x12, 0x27, 0x54, 0x00, 0x00, 0x04, 0x00, 0x7D, 0x18, 0x7C, 0x00, 0xE4, 0xFF, 0x80, 0x1A, 0x90, -0x90, 0x20, 0x12, 0x27, 0x54, 0x00, 0x00, 0x0C, 0x00, 0x90, 0x90, 0x24, 0x12, 0x27, 0x54, 0x00, -0x00, 0x00, 0x00, 0x7D, 0x18, 0x7C, 0x00, 0xE4, 0xFF, 0xD1, 0x27, 0x22, 0xE4, 0xFE, 0xFC, 0xEF, -0x64, 0x02, 0x70, 0x40, 0xED, 0xB4, 0x01, 0x04, 0x7E, 0x0A, 0x80, 0x06, 0xED, 0xB4, 0x02, 0x02, -0x7E, 0x09, 0xEB, 0xB4, 0x01, 0x08, 0xED, 0xB4, 0x01, 0x04, 0x7C, 0x04, 0x80, 0x38, 0xEB, 0xB4, -0x02, 0x08, 0xED, 0xB4, 0x01, 0x04, 0x7C, 0x02, 0x80, 0x2C, 0xEB, 0xB4, 0x01, 0x08, 0xED, 0xB4, -0x02, 0x04, 0x7C, 0x01, 0x80, 0x20, 0xEB, 0x64, 0x02, 0x70, 0x1B, 0xED, 0x64, 0x02, 0x70, 0x16, -0x7C, 0x03, 0x80, 0x12, 0xEF, 0xB4, 0x01, 0x0E, 0xEB, 0xB4, 0x02, 0x04, 0x7C, 0x01, 0x80, 0x06, -0xEB, 0xB4, 0x01, 0x02, 0x7C, 0x02, 0xAF, 0x06, 0xEF, 0xC4, 0x54, 0xF0, 0x4C, 0xFF, 0x22, 0x90, -0x8F, 0x58, 0xE0, 0x54, 0xFE, 0xF0, 0x54, 0x7F, 0xF0, 0xA3, 0x74, 0x0A, 0xF0, 0xE4, 0xA3, 0xF0, -0x22, 0x12, 0x26, 0x1E, 0xFF, 0x54, 0x01, 0xFE, 0x90, 0x8F, 0x58, 0xE0, 0x54, 0xFE, 0x4E, 0xF0, -0xEF, 0xC3, 0x13, 0x30, 0xE0, 0x0A, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0x90, 0x8F, 0x59, 0xF0, -0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x12, 0x26, 0x1E, 0xFE, 0x20, 0xE0, 0x06, 0x12, -0x4F, 0xA7, 0x02, 0x78, 0x7C, 0x12, 0x26, 0x1E, 0xFF, 0x54, 0x01, 0xFD, 0x90, 0x8E, 0x41, 0xE0, -0x54, 0xFE, 0x4D, 0xFD, 0xF0, 0xEF, 0x54, 0x02, 0xFF, 0xED, 0x54, 0xFD, 0x4F, 0xFF, 0xF0, 0x12, -0x26, 0x1E, 0xFD, 0x54, 0x04, 0xFC, 0xEF, 0x54, 0xFB, 0x4C, 0xFF, 0x90, 0x8E, 0x41, 0xF0, 0xED, -0x54, 0x08, 0xFD, 0xEF, 0x54, 0xF7, 0x4D, 0xFF, 0xF0, 0x12, 0x26, 0x1E, 0xFD, 0x54, 0x10, 0xFC, -0xEF, 0x54, 0xEF, 0x4C, 0xFF, 0x90, 0x8E, 0x41, 0xF0, 0xED, 0x54, 0x20, 0xFD, 0xEF, 0x54, 0xDF, -0x4D, 0xFF, 0xF0, 0x12, 0x26, 0x1E, 0xFD, 0x54, 0x40, 0xFC, 0xEF, 0x54, 0xBF, 0x4C, 0xFF, 0x90, -0x8E, 0x41, 0xF0, 0xED, 0x54, 0x80, 0xFD, 0xEF, 0x54, 0x7F, 0x4D, 0xF0, 0x90, 0x00, 0x01, 0x12, -0x26, 0x37, 0x54, 0x80, 0xFF, 0x90, 0x8E, 0x42, 0xE0, 0x54, 0x7F, 0x4F, 0xF0, 0xEE, 0x13, 0x13, -0x54, 0x3F, 0x30, 0xE0, 0x07, 0x90, 0x06, 0x90, 0xE0, 0x44, 0x04, 0xF0, 0x12, 0x26, 0x1E, 0x13, -0x13, 0x13, 0x54, 0x1F, 0x30, 0xE0, 0x07, 0x90, 0x06, 0x90, 0xE0, 0x44, 0x08, 0xF0, 0x90, 0x8D, -0x01, 0xE0, 0xB4, 0x01, 0x07, 0x90, 0xFE, 0x10, 0xE0, 0x44, 0x04, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, -0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x8F, 0x74, 0x12, 0x46, 0xA8, 0xE4, 0x90, -0x8F, 0x77, 0xF0, 0x90, 0x8F, 0x74, 0x12, 0x46, 0x9F, 0xE9, 0x24, 0x04, 0xF9, 0xE4, 0x3A, 0x8B, -0x40, 0xF5, 0x41, 0x89, 0x42, 0x75, 0x43, 0x06, 0x7B, 0x01, 0x7A, 0x8F, 0x79, 0x78, 0x12, 0x34, -0x2C, 0x90, 0x8F, 0x78, 0xE0, 0x20, 0xE0, 0x05, 0x90, 0x8F, 0x4B, 0x80, 0x03, 0x90, 0x8F, 0x4C, -0xE0, 0x90, 0x8E, 0x56, 0xF0, 0x90, 0x8E, 0x56, 0xE0, 0x14, 0x60, 0x11, 0x14, 0x60, 0x16, 0x24, -0xFE, 0x60, 0x12, 0x14, 0x60, 0x07, 0x14, 0x60, 0x04, 0x24, 0x06, 0x80, 0x10, 0x90, 0x8F, 0x77, -0x74, 0x04, 0xF0, 0x80, 0x0D, 0x90, 0x8F, 0x77, 0x74, 0x08, 0xF0, 0x80, 0x05, 0xE4, 0x90, 0x8F, -0x77, 0xF0, 0x90, 0x8F, 0x77, 0xE0, 0xFF, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0x90, 0x7A, 0xED, -0xF0, 0x90, 0x90, 0x77, 0x12, 0x46, 0xA8, 0xE4, 0x90, 0x90, 0x7B, 0xF0, 0xA3, 0xF0, 0x31, 0xA6, -0x90, 0x90, 0x7B, 0xEF, 0xF0, 0x90, 0x90, 0x77, 0x12, 0x46, 0x9F, 0x11, 0x81, 0x90, 0x90, 0x7C, -0xEF, 0xF0, 0x90, 0x8E, 0x56, 0xE0, 0x24, 0xFE, 0x60, 0x1D, 0x24, 0xFE, 0x60, 0x19, 0x14, 0x60, -0x07, 0x14, 0x60, 0x04, 0x24, 0x05, 0x70, 0x5F, 0x7B, 0x01, 0x7A, 0x8E, 0x79, 0x57, 0x90, 0x90, -0x7A, 0xE0, 0xFD, 0x31, 0xCA, 0x80, 0x22, 0x7B, 0x01, 0x7A, 0x8E, 0x79, 0x5F, 0x90, 0x90, 0x5E, -0x12, 0x46, 0xA8, 0x90, 0x90, 0x7A, 0xE0, 0x90, 0x90, 0x61, 0xF0, 0x90, 0x8E, 0x56, 0xE0, 0x90, -0x90, 0x62, 0xF0, 0x7A, 0x8E, 0x79, 0x57, 0x51, 0x44, 0x90, 0x90, 0x7C, 0xE0, 0xFF, 0x90, 0x90, -0x77, 0x12, 0x46, 0x9F, 0x90, 0x90, 0x7B, 0xE0, 0x7C, 0x00, 0x29, 0xF9, 0xEC, 0x3A, 0xFA, 0xC3, -0xE9, 0x9F, 0xF9, 0xEA, 0x94, 0x00, 0xFA, 0x75, 0x40, 0x01, 0x75, 0x41, 0x8E, 0x75, 0x42, 0x57, -0xA3, 0xE0, 0xF5, 0x43, 0x12, 0x34, 0x2C, 0x22, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0x24, 0x28, 0xF9, -0xE4, 0x34, 0xFC, 0xFA, 0x7B, 0x01, 0xE4, 0x90, 0x8F, 0x73, 0xF0, 0xFF, 0x12, 0x26, 0x1E, 0x30, -0xE7, 0x08, 0x90, 0x8F, 0x73, 0x74, 0x02, 0xF0, 0x80, 0x05, 0xE4, 0x90, 0x8F, 0x73, 0xF0, 0x11, -0x81, 0x90, 0x8F, 0x73, 0xE0, 0x24, 0x18, 0x2F, 0xFF, 0x22, 0x90, 0x90, 0x66, 0xED, 0xF0, 0x90, -0x90, 0x63, 0x12, 0x46, 0xA8, 0x90, 0x00, 0x03, 0x12, 0x26, 0x37, 0x90, 0x90, 0x6A, 0xF0, 0x90, -0x90, 0x63, 0x12, 0x46, 0x9F, 0x8B, 0x40, 0x8A, 0x41, 0x89, 0x42, 0x75, 0x43, 0x03, 0x7B, 0x01, -0x7A, 0x90, 0x79, 0x67, 0x12, 0x34, 0x2C, 0x90, 0x90, 0x66, 0xE0, 0x70, 0x46, 0xFF, 0x74, 0x67, -0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x90, 0xF5, 0x83, 0xE0, 0xB4, 0xFF, 0x0E, 0x74, 0x67, 0x2F, 0xF5, -0x82, 0xE4, 0x34, 0x90, 0xF5, 0x83, 0xE4, 0xF0, 0x80, 0x0F, 0x74, 0x67, 0x2F, 0xF5, 0x82, 0xE4, -0x34, 0x90, 0xF5, 0x83, 0xE0, 0x04, 0xF0, 0x80, 0x05, 0x0F, 0xEF, 0xB4, 0x03, 0xD0, 0x75, 0x40, -0x01, 0x75, 0x41, 0x90, 0x75, 0x42, 0x67, 0x75, 0x43, 0x03, 0x90, 0x90, 0x63, 0x12, 0x46, 0x9F, -0x12, 0x34, 0x2C, 0x22, 0x90, 0x90, 0x5B, 0x12, 0x46, 0xA8, 0x90, 0x90, 0x61, 0xE0, 0x60, 0x02, -0x61, 0x18, 0x90, 0x90, 0x5E, 0x12, 0x46, 0x9F, 0x12, 0x26, 0x1E, 0xF4, 0x60, 0x02, 0x61, 0x0D, -0x12, 0x26, 0x64, 0x90, 0x90, 0x5E, 0x12, 0x46, 0x9F, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0xF4, -0x60, 0x02, 0x41, 0xFD, 0x90, 0x00, 0x01, 0x12, 0x26, 0x76, 0x90, 0x00, 0x02, 0x12, 0x26, 0x37, -0xF4, 0x70, 0x6F, 0x90, 0x90, 0x5E, 0x12, 0x46, 0x9F, 0x90, 0x00, 0x02, 0xE4, 0x12, 0x26, 0x76, -0x90, 0x00, 0x03, 0x12, 0x26, 0x37, 0xF4, 0x70, 0x4E, 0x90, 0x90, 0x5E, 0x12, 0x46, 0x9F, 0x90, -0x00, 0x03, 0xE4, 0x12, 0x26, 0x76, 0x90, 0x00, 0x04, 0x12, 0x26, 0x37, 0xF4, 0x70, 0x2D, 0x90, -0x90, 0x5E, 0x12, 0x46, 0x9F, 0x90, 0x00, 0x04, 0xE4, 0x12, 0x26, 0x76, 0x90, 0x00, 0x05, 0x12, -0x26, 0x37, 0x90, 0x90, 0x5E, 0xB4, 0xFF, 0x0C, 0x12, 0x46, 0x9F, 0x90, 0x00, 0x05, 0xE4, 0x12, -0x26, 0x76, 0x80, 0x44, 0x12, 0x46, 0x9F, 0x90, 0x00, 0x05, 0x80, 0x2A, 0x90, 0x90, 0x5E, 0x12, -0x46, 0x9F, 0x90, 0x00, 0x04, 0x80, 0x1F, 0x90, 0x90, 0x5E, 0x12, 0x46, 0x9F, 0x90, 0x00, 0x03, -0x80, 0x14, 0x90, 0x90, 0x5E, 0x12, 0x46, 0x9F, 0x90, 0x00, 0x02, 0x80, 0x09, 0x90, 0x90, 0x5E, -0x12, 0x46, 0x9F, 0x90, 0x00, 0x01, 0x74, 0x01, 0x12, 0x46, 0x18, 0x80, 0x0B, 0x90, 0x90, 0x5E, -0x12, 0x46, 0x9F, 0x74, 0x01, 0x12, 0x45, 0xF6, 0x90, 0x90, 0x62, 0xE0, 0xFF, 0x64, 0x04, 0x60, -0x02, 0x61, 0xC7, 0x90, 0x90, 0x5E, 0x12, 0x46, 0x9F, 0x12, 0x26, 0x1E, 0xFE, 0x90, 0x90, 0x5B, -0x12, 0x46, 0x9F, 0xEE, 0x12, 0x26, 0x64, 0x90, 0x90, 0x5E, 0x12, 0x46, 0x9F, 0x90, 0x00, 0x01, -0x12, 0x26, 0x37, 0xFE, 0x90, 0x90, 0x5B, 0x12, 0x46, 0x9F, 0x90, 0x00, 0x01, 0xEE, 0x12, 0x26, -0x76, 0x90, 0x00, 0x02, 0xE4, 0x12, 0x26, 0x76, 0x90, 0x00, 0x03, 0x74, 0x20, 0x12, 0x26, 0x76, -0x90, 0x90, 0x5E, 0x12, 0x46, 0x9F, 0x90, 0x00, 0x02, 0x12, 0x26, 0x37, 0xFE, 0x90, 0x90, 0x5B, -0x12, 0x46, 0x9F, 0x90, 0x00, 0x04, 0xEE, 0x12, 0x26, 0x76, 0x90, 0x90, 0x5E, 0x12, 0x46, 0x9F, -0x90, 0x00, 0x03, 0x12, 0x26, 0x37, 0xFE, 0x90, 0x90, 0x5B, 0x12, 0x46, 0x9F, 0x90, 0x00, 0x05, -0xEE, 0x12, 0x26, 0x76, 0x90, 0x90, 0x5E, 0x12, 0x46, 0x9F, 0x90, 0x00, 0x04, 0x12, 0x26, 0x37, -0xFE, 0x90, 0x90, 0x5B, 0x12, 0x46, 0x9F, 0x90, 0x00, 0x06, 0xEE, 0x12, 0x26, 0x76, 0x90, 0x90, -0x5E, 0x12, 0x46, 0x9F, 0x90, 0x00, 0x05, 0x12, 0x26, 0x37, 0xFE, 0x90, 0x90, 0x5B, 0x12, 0x46, -0x9F, 0x90, 0x00, 0x07, 0xEE, 0x81, 0x87, 0xEF, 0x64, 0x02, 0x60, 0x02, 0x81, 0x8A, 0x90, 0x90, -0x5E, 0x12, 0x46, 0x9F, 0x12, 0x26, 0x1E, 0xFF, 0x90, 0x90, 0x5B, 0x12, 0x46, 0x9F, 0xEF, 0x12, -0x26, 0x64, 0x90, 0x90, 0x5E, 0x12, 0x46, 0x9F, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0x44, 0x20, -0x54, 0x7F, 0xFF, 0x90, 0x90, 0x5B, 0x12, 0x46, 0x9F, 0x90, 0x00, 0x01, 0xEF, 0x12, 0x26, 0x76, -0x90, 0x90, 0x5E, 0x12, 0x46, 0x9F, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0xFF, 0x90, 0x90, 0x5B, -0x12, 0x46, 0x9F, 0x90, 0x00, 0x02, 0xEF, 0x12, 0x26, 0x76, 0x90, 0x00, 0x03, 0x74, 0x20, 0x12, -0x26, 0x76, 0x90, 0x90, 0x5E, 0x12, 0x46, 0x9F, 0x90, 0x00, 0x02, 0x12, 0x26, 0x37, 0xFF, 0x90, -0x90, 0x5B, 0x12, 0x46, 0x9F, 0x90, 0x00, 0x04, 0xEF, 0x12, 0x26, 0x76, 0x90, 0x90, 0x5E, 0x12, -0x46, 0x9F, 0x90, 0x00, 0x03, 0x12, 0x26, 0x37, 0xFF, 0x90, 0x90, 0x5B, 0x12, 0x46, 0x9F, 0x90, -0x00, 0x05, 0xEF, 0x12, 0x26, 0x76, 0x90, 0x90, 0x5E, 0x12, 0x46, 0x9F, 0x90, 0x00, 0x04, 0x12, -0x26, 0x37, 0xFF, 0x90, 0x90, 0x5B, 0x12, 0x46, 0x9F, 0x90, 0x00, 0x06, 0xEF, 0x12, 0x26, 0x76, -0x90, 0x90, 0x5E, 0x12, 0x46, 0x9F, 0x90, 0x00, 0x05, 0x12, 0x26, 0x37, 0xFF, 0x90, 0x90, 0x5B, -0x12, 0x46, 0x9F, 0x90, 0x00, 0x07, 0xEF, 0x12, 0x26, 0x76, 0x22, 0x91, 0xEA, 0x7E, 0x00, 0x74, -0x00, 0x2F, 0xF9, 0xE4, 0x34, 0xFC, 0x75, 0x40, 0x01, 0xF5, 0x41, 0x89, 0x42, 0x75, 0x43, 0x08, -0x7B, 0x01, 0x7A, 0x8E, 0x79, 0x57, 0x12, 0x34, 0x2C, 0x90, 0x8E, 0x57, 0xE0, 0x90, 0x8E, 0x5F, -0xF0, 0x90, 0x8E, 0x58, 0xE0, 0x90, 0x8E, 0x60, 0xF0, 0x90, 0x8E, 0x59, 0xE0, 0x90, 0x8E, 0x61, -0xF0, 0x90, 0x8E, 0x5A, 0xE0, 0x90, 0x8E, 0x62, 0xF0, 0x90, 0x8E, 0x5B, 0xE0, 0x90, 0x8E, 0x63, -0xF0, 0x90, 0x8E, 0x5C, 0xE0, 0x90, 0x8E, 0x64, 0xF0, 0x90, 0x8E, 0x5D, 0xE0, 0x90, 0x8E, 0x65, -0xF0, 0x90, 0x8E, 0x5E, 0xE0, 0x90, 0x8E, 0x66, 0xF0, 0x22, 0xE4, 0xFE, 0xEF, 0x25, 0xE0, 0xFD, -0xEF, 0xC3, 0x94, 0x80, 0x90, 0xFD, 0x12, 0x50, 0x04, 0xE4, 0xF0, 0x80, 0x03, 0x74, 0x01, 0xF0, -0x90, 0xFD, 0x10, 0xED, 0xF0, 0xAF, 0x06, 0x22, 0x90, 0x90, 0x07, 0xEF, 0xF0, 0xA3, 0xED, 0xF0, -0x78, 0x0F, 0x7C, 0x90, 0x7D, 0x01, 0x7B, 0xFF, 0x7A, 0x40, 0x79, 0x50, 0x7E, 0x00, 0x7F, 0x06, -0x12, 0x45, 0xD0, 0x78, 0x15, 0x7C, 0x90, 0x7D, 0x01, 0x7B, 0xFF, 0x7A, 0x40, 0x79, 0x56, 0x7E, -0x00, 0x7F, 0x04, 0x12, 0x45, 0xD0, 0x78, 0x19, 0x7C, 0x90, 0x7D, 0x01, 0x7B, 0xFF, 0x7A, 0x40, -0x79, 0x5A, 0x7E, 0x00, 0x7F, 0x04, 0x12, 0x45, 0xD0, 0x90, 0x90, 0x08, 0xE0, 0xFF, 0x90, 0x90, -0x07, 0xE0, 0x2F, 0xFF, 0x24, 0x06, 0xF5, 0x82, 0xE4, 0x34, 0xFB, 0xF5, 0x83, 0xE0, 0x64, 0x08, -0x60, 0x02, 0xC1, 0x4D, 0x74, 0x07, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0xFB, 0xF5, 0x83, 0xE0, 0x64, -0x06, 0x60, 0x02, 0xC1, 0x4D, 0x90, 0x06, 0x30, 0xE0, 0x44, 0x01, 0xF0, 0x90, 0x90, 0x07, 0xE0, -0x24, 0x0A, 0xF9, 0xE4, 0x34, 0xFB, 0x75, 0x40, 0x01, 0xF5, 0x41, 0x89, 0x42, 0x75, 0x43, 0x06, -0x7B, 0x01, 0x7A, 0x90, 0x79, 0x09, 0x12, 0x34, 0x2C, 0x90, 0x90, 0x08, 0xE0, 0xFF, 0x90, 0x90, -0x07, 0xE0, 0x2F, 0x24, 0x10, 0xF9, 0xE4, 0x34, 0xFB, 0x75, 0x40, 0x01, 0xF5, 0x41, 0x89, 0x42, -0x75, 0x43, 0x06, 0x7B, 0x01, 0x7A, 0x90, 0x79, 0x0F, 0x12, 0x34, 0x2C, 0x90, 0x90, 0x08, 0xE0, -0xFF, 0x90, 0x90, 0x07, 0xE0, 0x2F, 0x24, 0x16, 0xF9, 0xE4, 0x34, 0xFB, 0x75, 0x40, 0x01, 0xF5, -0x41, 0x89, 0x42, 0x75, 0x43, 0x04, 0x7B, 0x01, 0x7A, 0x90, 0x79, 0x15, 0x12, 0x34, 0x2C, 0x78, -0x09, 0x7C, 0x90, 0x7D, 0x01, 0x7B, 0x01, 0x7A, 0x8E, 0x79, 0x46, 0x7E, 0x00, 0x7F, 0x06, 0x12, -0x48, 0x5D, 0xEF, 0x70, 0x58, 0x90, 0x90, 0x08, 0xE0, 0xFF, 0x90, 0x90, 0x07, 0xE0, 0x2F, 0x24, -0x20, 0xF9, 0xE4, 0x34, 0xFB, 0x75, 0x40, 0x01, 0xF5, 0x41, 0x89, 0x42, 0x75, 0x43, 0x04, 0x7B, -0x01, 0x7A, 0x90, 0x79, 0x19, 0x12, 0x34, 0x2C, 0x78, 0x19, 0x7C, 0x90, 0x7D, 0x01, 0x7B, 0x01, -0x7A, 0x8E, 0x79, 0x52, 0x7E, 0x00, 0x7F, 0x04, 0x12, 0x48, 0x5D, 0xEF, 0x70, 0x18, 0x7B, 0x01, -0x7A, 0x90, 0x79, 0x0F, 0x90, 0x90, 0x54, 0x12, 0x46, 0xA8, 0xE4, 0x90, 0x90, 0x57, 0xF0, 0x7A, -0x90, 0x79, 0x15, 0x02, 0x6F, 0x12, 0x90, 0x06, 0x30, 0xE0, 0x44, 0x20, 0xF0, 0x22, 0x90, 0x02, -0x09, 0xE0, 0x90, 0x8F, 0x71, 0xF0, 0x12, 0x26, 0x1E, 0x90, 0x8F, 0x4B, 0xF0, 0x90, 0x00, 0x01, -0x12, 0x26, 0x37, 0x90, 0x8F, 0x4C, 0xF0, 0x22, 0x90, 0x02, 0x09, 0xE0, 0xFD, 0x12, 0x26, 0x1E, -0xFE, 0xAF, 0x05, 0xED, 0x2E, 0x90, 0x8F, 0x4D, 0xF0, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0xFF, -0xED, 0x2F, 0x90, 0x8F, 0x4E, 0xF0, 0x90, 0x00, 0x02, 0x12, 0x26, 0x37, 0xFF, 0xED, 0x2F, 0x90, -0x8F, 0x4F, 0xF0, 0x90, 0x00, 0x03, 0x12, 0x26, 0x37, 0xFF, 0xED, 0x2F, 0x90, 0x8F, 0x50, 0xF0, -0x90, 0x00, 0x04, 0x12, 0x26, 0x37, 0xFF, 0xED, 0x2F, 0x90, 0x8F, 0x51, 0xF0, 0x90, 0x00, 0x05, -0x12, 0x26, 0x37, 0xFF, 0xED, 0x2F, 0x90, 0x8F, 0x52, 0xF0, 0x90, 0x00, 0x06, 0x12, 0x26, 0x37, -0xFF, 0xAE, 0x05, 0xED, 0x2F, 0x90, 0x8F, 0x53, 0xF0, 0x22, 0x90, 0x02, 0x09, 0xE0, 0xFD, 0x12, -0x26, 0x1E, 0xFE, 0xAF, 0x05, 0xED, 0x2E, 0x90, 0x8F, 0x54, 0xF0, 0x90, 0x00, 0x01, 0x12, 0x26, -0x37, 0xFF, 0xED, 0x2F, 0x90, 0x8F, 0x55, 0xF0, 0x90, 0x00, 0x02, 0x12, 0x26, 0x37, 0xFF, 0xAE, -0x05, 0xED, 0x2F, 0x90, 0x8F, 0x56, 0xF0, 0x22, 0x90, 0x8F, 0x5B, 0xE0, 0x30, 0xE0, 0x2D, 0x90, -0x8F, 0x5E, 0xE0, 0x04, 0xF0, 0xE0, 0xFF, 0x90, 0x8F, 0x5C, 0xE0, 0xB5, 0x07, 0x1E, 0x90, 0x06, -0x92, 0xE0, 0x54, 0x1C, 0x70, 0x0B, 0x12, 0x4E, 0xC0, 0x90, 0x8F, 0x5F, 0xE0, 0x04, 0xF0, 0x80, -0x06, 0x90, 0x06, 0x92, 0x74, 0x1C, 0xF0, 0xE4, 0x90, 0x8F, 0x5E, 0xF0, 0x22, 0x12, 0x4D, 0x3A, -0x12, 0x26, 0x1E, 0xFF, 0x54, 0x01, 0xFE, 0x90, 0x8F, 0x5B, 0xE0, 0x54, 0xFE, 0x4E, 0xF0, 0xEF, -0xC3, 0x13, 0x30, 0xE0, 0x14, 0x90, 0x00, 0x01, 0x12, 0x26, 0x37, 0x90, 0x8F, 0x5C, 0xF0, 0x90, -0x00, 0x02, 0x12, 0x26, 0x37, 0x90, 0x8F, 0x5D, 0xF0, 0x22, 0xE4, 0x90, 0x8E, 0x27, 0xF0, 0xA3, -0xF0, 0x90, 0x8E, 0x26, 0xE0, 0x54, 0x0F, 0xF0, 0x54, 0xF0, 0xF0, 0x90, 0x8E, 0x24, 0xE0, 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, 0x30, 0xF0, 0x90, 0x8E, 0x2B, 0xF0, 0x22, 0xEF, -0x24, 0xFE, 0x60, 0x0C, 0x04, 0x70, 0x28, 0x90, 0x8E, 0x2D, 0x74, 0x01, 0xF0, 0xA3, 0xF0, 0x22, -0xED, 0x70, 0x0A, 0x90, 0x8E, 0x3B, 0xE0, 0x90, 0x8E, 0x2D, 0xF0, 0x80, 0x05, 0x90, 0x8E, 0x2D, -0xED, 0xF0, 0x90, 0x8E, 0x2D, 0xE0, 0xA3, 0xF0, 0x90, 0x8E, 0x25, 0xE0, 0x44, 0x08, 0xF0, 0x22, -0x12, 0x57, 0x8F, 0xEF, 0x64, 0x01, 0x60, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x01, 0xF0, 0x80, 0x67, -0x90, 0x8E, 0x2B, 0xE0, 0xFF, 0x54, 0x03, 0x60, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x02, 0xF0, 0x80, -0x56, 0x90, 0x8E, 0x29, 0xE0, 0xFE, 0xE4, 0xC3, 0x9E, 0x50, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x04, -0xF0, 0x80, 0x44, 0xEF, 0x30, 0xE2, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x08, 0xF0, 0x80, 0x38, 0x90, -0x8E, 0x2B, 0xE0, 0x30, 0xE4, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x10, 0xF0, 0x80, 0x29, 0x90, 0x8E, -0x25, 0xE0, 0x13, 0x13, 0x54, 0x3F, 0x20, 0xE0, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x20, 0xF0, 0x80, -0x16, 0x90, 0x8E, 0x3F, 0xE0, 0x60, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x80, 0xF0, 0x80, 0x08, 0x90, -0x01, 0xB8, 0xE4, 0xF0, 0x7F, 0x01, 0x22, 0x90, 0x01, 0xB9, 0x74, 0x04, 0xF0, 0x7F, 0x00, 0x22, -0x90, 0x02, 0x87, 0xE0, 0x60, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x01, 0xF0, 0x80, 0x2C, 0x90, 0x8E, -0x40, 0xE0, 0x30, 0xE0, 0x0E, 0x90, 0x02, 0x82, 0xE0, 0x60, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x02, -0xF0, 0x80, 0x17, 0x90, 0x02, 0x86, 0xE0, 0x20, 0xE1, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x04, 0xF0, -0x80, 0x08, 0x90, 0x01, 0xB8, 0xE4, 0xF0, 0x7F, 0x01, 0x22, 0x90, 0x01, 0xB9, 0x74, 0x08, 0xF0, -0x7F, 0x00, 0x22, 0xEF, 0x60, 0x3E, 0x90, 0x8D, 0xA3, 0xE0, 0x64, 0x01, 0x70, 0x36, 0x90, 0x8E, -0x25, 0xE0, 0x54, 0xFE, 0xF0, 0x90, 0x05, 0x22, 0x74, 0x0F, 0xF0, 0x90, 0x06, 0x04, 0xE0, 0x54, -0xBF, 0xF0, 0xE4, 0xFF, 0x12, 0x4E, 0xC2, 0xBF, 0x01, 0x0E, 0x90, 0x8E, 0x24, 0xE0, 0x44, 0x40, -0xF0, 0x90, 0x8E, 0x2A, 0x74, 0x06, 0xF0, 0x22, 0x90, 0x01, 0xB9, 0x74, 0x01, 0xF0, 0x90, 0x01, -0xB8, 0x74, 0x08, 0xF0, 0x22, 0x90, 0x05, 0x22, 0x74, 0x6F, 0xF0, 0x90, 0x05, 0x27, 0xE0, 0x54, -0xBF, 0xF0, 0x90, 0x8E, 0x2A, 0x74, 0x02, 0xF0, 0x22, 0x90, 0x8E, 0x27, 0xE0, 0x60, 0x39, 0x90, -0x8D, 0xA3, 0xE0, 0x64, 0x01, 0x70, 0x31, 0x90, 0x8E, 0x2E, 0xF0, 0x04, 0x60, 0x2A, 0x90, 0x8E, -0x2B, 0xE0, 0x44, 0x10, 0xF0, 0xE4, 0xF5, 0x3B, 0x90, 0x8E, 0x2F, 0xE0, 0xF5, 0x3C, 0xE4, 0xFB, -0xFD, 0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0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, -0x8F, 0xB5, 0x12, 0x46, 0xA8, 0x90, 0x8F, 0xB8, 0xED, 0xF0, 0xE4, 0x90, 0x90, 0x04, 0xF0, 0x90, -0x90, 0x04, 0xE0, 0xFF, 0xC3, 0x94, 0x40, 0x50, 0x14, 0x74, 0xC1, 0x2F, 0xF5, 0x82, 0xE4, 0x34, -0x8F, 0xF5, 0x83, 0xE4, 0xF0, 0x90, 0x90, 0x04, 0xE0, 0x04, 0xF0, 0x80, 0xE2, 0x90, 0x8F, 0xB5, -0x12, 0x46, 0x9F, 0x8B, 0x40, 0x8A, 0x41, 0x89, 0x42, 0x90, 0x8F, 0xB8, 0xE0, 0xF5, 0x43, 0x7B, -0x01, 0x7A, 0x8F, 0x79, 0xC1, 0x12, 0x34, 0x2C, 0xE4, 0x90, 0x8F, 0xC0, 0xF0, 0x90, 0x8F, 0xC0, -0xE0, 0xFF, 0xC3, 0x94, 0x40, 0x50, 0x16, 0x74, 0xC1, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x8F, 0xF5, -0x83, 0xE0, 0x64, 0x36, 0xF0, 0x90, 0x8F, 0xC0, 0xE0, 0x04, 0xF0, 0x80, 0xE0, 0x90, 0x8F, 0xB9, -0x12, 0x46, 0x9F, 0x90, 0x8F, 0xBC, 0xE0, 0xFF, 0xF5, 0x82, 0x75, 0x83, 0x00, 0x74, 0x80, 0x12, -0x26, 0x76, 0xEF, 0x75, 0xF0, 0x08, 0xA4, 0x24, 0x00, 0xFF, 0xE5, 0xF0, 0x34, 0x02, 0xFC, 0x90, -0x00, 0x7E, 0x12, 0x26, 0x76, 0xEF, 0x90, 0x00, 0x7F, 0x12, 0x26, 0x76, 0xE4, 0x90, 0x90, 0x01, -0xF0, 0xA3, 0xF0, 0x90, 0x90, 0x01, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0xC3, 0x94, 0xC0, 0xEE, 0x94, -0x00, 0x40, 0x02, 0x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8, 0xF9, 0xEA, 0x34, 0xFF, -0xFA, 0xA3, 0xE0, 0x44, 0x8A, 0xFD, 0x12, 0x30, 0xA4, 0x90, 0x8F, 0xB9, 0x12, 0x46, 0x9F, 0x90, -0x90, 0x01, 0xE0, 0xFE, 0xA3, 0xE0, 0x29, 0xF9, 0xEA, 0x3E, 0xFA, 0xE9, 0x24, 0xCC, 0xF9, 0xEA, -0x34, 0xFF, 0xFA, 0xA3, 0xE0, 0x44, 0x8B, 0xFD, 0x12, 0x30, 0xA4, 0x90, 0x90, 0x03, 0xE0, 0x44, -0x90, 0x90, 0x01, 0x8C, 0xF0, 0xE4, 0x90, 0x90, 0x05, 0xF0, 0xA3, 0xF0, 0x90, 0x01, 0x8C, 0xE0, -0x30, 0xE4, 0x22, 0xC3, 0x90, 0x90, 0x06, 0xE0, 0x94, 0xE8, 0x90, 0x90, 0x05, 0xE0, 0x94, 0x03, -0x50, 0x13, 0x7F, 0x01, 0x7E, 0x00, 0x12, 0x3A, 0xF7, 0x90, 0x90, 0x05, 0xE4, 0x75, 0xF0, 0x01, -0x12, 0x46, 0x4B, 0x80, 0xD7, 0x90, 0x90, 0x05, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0xC3, 0x94, 0xE8, -0xEE, 0x94, 0x03, 0x40, 0x0C, 0x90, 0x06, 0x31, 0xE0, 0x44, 0x01, 0xF0, 0xEE, 0x90, 0x06, 0x36, -0xF0, 0x90, 0x90, 0x02, 0xE0, 0x54, 0x3F, 0x64, 0x30, 0x70, 0x4B, 0x90, 0x90, 0x05, 0xF0, 0xA3, -0xF0, 0x90, 0x01, 0x8C, 0xE0, 0x20, 0xE5, 0x22, 0xC3, 0x90, 0x90, 0x06, 0xE0, 0x94, 0xE8, 0x90, -0x90, 0x05, 0xE0, 0x94, 0x03, 0x50, 0x13, 0x7F, 0x01, 0x7E, 0x00, 0x12, 0x3A, 0xF7, 0x90, 0x90, -0x05, 0xE4, 0x75, 0xF0, 0x01, 0x12, 0x46, 0x4B, 0x80, 0xD7, 0x90, 0x90, 0x05, 0xE0, 0xFE, 0xA3, -0xE0, 0xFF, 0xC3, 0x94, 0xE8, 0xEE, 0x94, 0x03, 0x40, 0x0C, 0x90, 0x06, 0x31, 0xE0, 0x44, 0x02, -0xF0, 0xEE, 0x90, 0x06, 0x36, 0xF0, 0x90, 0x90, 0x01, 0xE4, 0x75, 0xF0, 0x10, 0x12, 0x46, 0x4B, -0x61, 0x03, 0x90, 0x8F, 0xBD, 0x12, 0x46, 0x9F, 0xE9, 0x24, 0x10, 0xF9, 0xE4, 0x3A, 0xFA, 0x7D, -0x80, 0x12, 0x33, 0x2F, 0x90, 0x8F, 0xBD, 0x12, 0x46, 0x9F, 0xE9, 0x24, 0x0C, 0xF9, 0xE4, 0x3A, -0xFA, 0x7D, 0x81, 0x12, 0x33, 0x2F, 0x90, 0x8F, 0xBD, 0x12, 0x46, 0x9F, 0xE9, 0x24, 0x08, 0xF9, -0xE4, 0x3A, 0xFA, 0x7D, 0x82, 0x12, 0x33, 0x2F, 0x90, 0x8F, 0xBD, 0x12, 0x46, 0x9F, 0xE9, 0x24, -0x04, 0xF9, 0xE4, 0x3A, 0xFA, 0x7D, 0x83, 0x12, 0x33, 0x2F, 0x90, 0x8F, 0xBD, 0x12, 0x46, 0x9F, -0x7D, 0x84, 0x12, 0x33, 0x2F, 0xE4, 0x90, 0x90, 0x04, 0xF0, 0x90, 0x90, 0x04, 0xE0, 0xFF, 0xC3, -0x94, 0x40, 0x50, 0x14, 0x74, 0xC1, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x8F, 0xF5, 0x83, 0xE4, 0xF0, -0x90, 0x90, 0x04, 0xE0, 0x04, 0xF0, 0x80, 0xE2, 0x90, 0x8F, 0xB5, 0x12, 0x46, 0x9F, 0x8B, 0x40, -0x8A, 0x41, 0x89, 0x42, 0x90, 0x8F, 0xB8, 0xE0, 0xF5, 0x43, 0x7B, 0x01, 0x7A, 0x8F, 0x79, 0xC1, -0x12, 0x34, 0x2C, 0xE4, 0x90, 0x8F, 0xC0, 0xF0, 0x90, 0x8F, 0xC0, 0xE0, 0xFF, 0xC3, 0x94, 0x40, -0x50, 0x16, 0x74, 0xC1, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x8F, 0xF5, 0x83, 0xE0, 0x64, 0x5C, 0xF0, -0x90, 0x8F, 0xC0, 0xE0, 0x04, 0xF0, 0x80, 0xE0, 0xE4, 0x90, 0x8F, 0xC0, 0xF0, 0x90, 0x8F, 0xBD, -0x12, 0x46, 0x9F, 0x90, 0x8F, 0xC0, 0xE0, 0xFF, 0xF5, 0x82, 0x75, 0x83, 0x00, 0x12, 0x26, 0x37, -0xFE, 0x90, 0x8F, 0xB9, 0x12, 0x46, 0x9F, 0x8F, 0x82, 0x75, 0x83, 0x00, 0xEE, 0x12, 0x26, 0x76, -0x90, 0x8F, 0xC0, 0xE0, 0x04, 0xF0, 0xE0, 0xB4, 0x14, 0xD3, 0x90, 0x8F, 0xB9, 0x12, 0x46, 0x9F, -0x90, 0x00, 0x14, 0x74, 0x80, 0x12, 0x26, 0x76, 0x90, 0x8F, 0xC0, 0x74, 0x15, 0xF0, 0x90, 0x8F, -0xC0, 0xE0, 0xFF, 0xC3, 0x94, 0x3E, 0x50, 0x17, 0x90, 0x8F, 0xB9, 0x12, 0x46, 0x9F, 0x8F, 0x82, -0x75, 0x83, 0x00, 0xE4, 0x12, 0x26, 0x76, 0x90, 0x8F, 0xC0, 0xE0, 0x04, 0xF0, 0x80, 0xDF, 0x90, -0x8F, 0xB9, 0x12, 0x46, 0x9F, 0x90, 0x00, 0x3E, 0x74, 0x02, 0x12, 0x26, 0x76, 0x90, 0x00, 0x3F, -0x74, 0xA0, 0x12, 0x26, 0x76, 0xE4, 0x90, 0x90, 0x01, 0xF0, 0xA3, 0xF0, 0x90, 0x90, 0x01, 0xE0, -0xFE, 0xA3, 0xE0, 0xFF, 0xC3, 0x94, 0x80, 0xEE, 0x94, 0x00, 0x40, 0x02, 0xE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C8, 0xF9, 0xEA, 0x34, 0xFF, 0xFA, 0xA3, 0xE0, 0x44, 0x8A, 0xFD, 0x12, -0x30, 0xA4, 0x90, 0x8F, 0xB9, 0x12, 0x46, 0x9F, 0x90, 0x90, 0x01, 0xE0, 0xFE, 0xA3, 0xE0, 0x29, -0xF9, 0xEA, 0x3E, 0xFA, 0xE9, 0x24, 0xCC, 0xF9, 0xEA, 0x34, 0xFF, 0xFA, 0xA3, 0xE0, 0x44, 0x8B, -0xFD, 0x12, 0x30, 0xA4, 0x90, 0x90, 0x03, 0xE0, 0x44, 0x90, 0x90, 0x01, 0x8C, 0xF0, 0xE4, 0x90, -0x90, 0x05, 0xF0, 0xA3, 0xF0, 0x90, 0x01, 0x8C, 0xE0, 0x30, 0xE4, 0x22, 0xC3, 0x90, 0x90, 0x06, -0xE0, 0x94, 0xE8, 0x90, 0x90, 0x05, 0xE0, 0x94, 0x03, 0x50, 0x13, 0x7F, 0x01, 0x7E, 0x00, 0x12, -0x3A, 0xF7, 0x90, 0x90, 0x05, 0xE4, 0x75, 0xF0, 0x01, 0x12, 0x46, 0x4B, 0x80, 0xD7, 0x90, 0x90, -0x05, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0xC3, 0x94, 0xE8, 0xEE, 0x94, 0x03, 0x40, 0x0C, 0x90, 0x06, -0x31, 0xE0, 0x44, 0x01, 0xF0, 0xEE, 0x90, 0x06, 0x36, 0xF0, 0x90, 0x90, 0x02, 0xE0, 0x54, 0x3F, -0x64, 0x30, 0x70, 0x4B, 0x90, 0x90, 0x05, 0xF0, 0xA3, 0xF0, 0x90, 0x01, 0x8C, 0xE0, 0x20, 0xE5, -0x22, 0xC3, 0x90, 0x90, 0x06, 0xE0, 0x94, 0xE8, 0x90, 0x90, 0x05, 0xE0, 0x94, 0x03, 0x50, 0x13, -0x7F, 0x01, 0x7E, 0x00, 0x12, 0x3A, 0xF7, 0x90, 0x90, 0x05, 0xE4, 0x75, 0xF0, 0x01, 0x12, 0x46, -0x4B, 0x80, 0xD7, 0x90, 0x90, 0x05, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0xC3, 0x94, 0xE8, 0xEE, 0x94, -0x03, 0x40, 0x0C, 0x90, 0x06, 0x31, 0xE0, 0x44, 0x02, 0xF0, 0xEE, 0x90, 0x06, 0x36, 0xF0, 0x90, -0x90, 0x01, 0xE4, 0x75, 0xF0, 0x10, 0x12, 0x46, 0x4B, 0xA1, 0xEC, 0x90, 0x8F, 0xBD, 0x12, 0x46, -0x9F, 0xE9, 0x24, 0x10, 0xF9, 0xE4, 0x3A, 0xFA, 0x7D, 0x80, 0x12, 0x33, 0x2F, 0x90, 0x8F, 0xBD, -0x12, 0x46, 0x9F, 0xE9, 0x24, 0x0C, 0xF9, 0xE4, 0x3A, 0xFA, 0x7D, 0x81, 0x12, 0x33, 0x2F, 0x90, -0x8F, 0xBD, 0x12, 0x46, 0x9F, 0xE9, 0x24, 0x08, 0xF9, 0xE4, 0x3A, 0xFA, 0x7D, 0x82, 0x12, 0x33, -0x2F, 0x90, 0x8F, 0xBD, 0x12, 0x46, 0x9F, 0xE9, 0x24, 0x04, 0xF9, 0xE4, 0x3A, 0xFA, 0x7D, 0x83, -0x12, 0x33, 0x2F, 0x90, 0x8F, 0xBD, 0x12, 0x46, 0x9F, 0x7D, 0x84, 0x12, 0x33, 0x2F, 0xD0, 0xD0, -0x92, 0xAF, 0x22, 0x00, 0xFD, 0x15, -}; -u4Byte ArrayLength_TC_8812A_FW_WoWLAN = 18454; -#else -u4Byte Array_TC_8812A_FW_WoWLAN[] = { -0x0, }; -u4Byte ArrayLength_TC_8812A_FW_WoWLAN = 1; -#endif - - -void -ODM_ReadFirmware_TC_8812A_FW_WoWLAN( - IN PDM_ODM_T pDM_Odm, - OUT u1Byte *pFirmware, - OUT u4Byte *pFirmwareSize -) -{ - ODM_MoveMemory(pDM_Odm, pFirmware, Array_TC_8812A_FW_WoWLAN, ArrayLength_TC_8812A_FW_WoWLAN); - *pFirmwareSize = ArrayLength_TC_8812A_FW_WoWLAN; -} - - - -#endif // end of HWIMG_SUPPORT - diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_MAC.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_MAC.c deleted file mode 100755 index 41b32eb324ece2..00000000000000 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_MAC.c +++ /dev/null @@ -1,239 +0,0 @@ -/****************************************************************************** -* -* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of version 2 of the GNU General Public License as -* published by the Free Software Foundation. -* -* This program is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along with -* this program; if not, write to the Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA -* -* -******************************************************************************/ - -#include "../odm_precomp.h" - -#if (RTL8812A_SUPPORT == 1) -static BOOLEAN -CheckCondition( - const u4Byte Condition, - const u4Byte Hex - ) -{ - u4Byte _board = (Hex & 0x000000FF); - u4Byte _interface = (Hex & 0x0000FF00) >> 8; - u4Byte _platform = (Hex & 0x00FF0000) >> 16; - u4Byte cond = Condition; - - if ( Condition == 0xCDCDCDCD ) - return TRUE; - - cond = Condition & 0x000000FF; - if ( (_board != cond) && (cond != 0xFF) ) - return FALSE; - - cond = Condition & 0x0000FF00; - cond = cond >> 8; - if ( ((_interface & cond) == 0) && (cond != 0x07) ) - return FALSE; - - cond = Condition & 0x00FF0000; - cond = cond >> 16; - if ( ((_platform & cond) == 0) && (cond != 0x0F) ) - return FALSE; - return TRUE; -} - - -/****************************************************************************** -* MAC_REG.TXT -******************************************************************************/ -#if TESTCHIP_SUPPORT == 1 - -u4Byte Array_TC_8812A_MAC_REG[] = { - 0x010, 0x0000000C, - 0x072, 0x00000000, - 0x428, 0x0000000A, - 0x429, 0x00000010, - 0x430, 0x00000000, - 0x431, 0x00000000, - 0x432, 0x00000000, - 0x433, 0x00000001, - 0x434, 0x00000004, - 0x435, 0x00000005, - 0x436, 0x00000007, - 0x437, 0x00000008, - 0x43C, 0x00000004, - 0x43D, 0x00000005, - 0x43E, 0x00000007, - 0x43F, 0x00000008, - 0x440, 0x0000005D, - 0x441, 0x00000001, - 0x442, 0x00000000, - 0x444, 0x00000010, - 0x445, 0x00000000, - 0x446, 0x00000000, - 0x447, 0x00000000, - 0x448, 0x00000000, - 0x449, 0x000000F0, - 0x44A, 0x0000000F, - 0x44B, 0x0000003E, - 0x44C, 0x00000010, - 0x44D, 0x00000000, - 0x44E, 0x00000000, - 0x44F, 0x00000000, - 0x450, 0x00000000, - 0x451, 0x000000F0, - 0x452, 0x0000000F, - 0x453, 0x00000000, - 0x45B, 0x00000080, - 0x460, 0x00000066, - 0x461, 0x00000066, - 0x4C8, 0x000000FF, - 0x4C9, 0x00000008, - 0x4CC, 0x000000FF, - 0x4CD, 0x000000FF, - 0x4CE, 0x00000001, - 0x500, 0x00000026, - 0x501, 0x000000A2, - 0x502, 0x0000002F, - 0x503, 0x00000000, - 0x504, 0x00000028, - 0x505, 0x000000A3, - 0x506, 0x0000005E, - 0x507, 0x00000000, - 0x508, 0x0000002B, - 0x509, 0x000000A4, - 0x50A, 0x0000005E, - 0x50B, 0x00000000, - 0x50C, 0x0000004F, - 0x50D, 0x000000A4, - 0x50E, 0x00000000, - 0x50F, 0x00000000, - 0x512, 0x0000001C, - 0x514, 0x0000000A, - 0x516, 0x0000000A, - 0x525, 0x0000004F, - 0x550, 0x00000010, - 0x551, 0x00000010, - 0x559, 0x00000002, - 0x55C, 0x00000050, - 0x55D, 0x000000FF, - 0x604, 0x00000001, - 0x605, 0x00000030, - 0x607, 0x00000003, - 0x608, 0x0000000E, - 0x609, 0x0000002A, - 0x620, 0x000000FF, - 0x621, 0x000000FF, - 0x622, 0x000000FF, - 0x623, 0x000000FF, - 0x624, 0x000000FF, - 0x625, 0x000000FF, - 0x626, 0x000000FF, - 0x627, 0x000000FF, - 0x638, 0x00000050, - 0x63C, 0x0000000A, - 0x63D, 0x0000000A, - 0x63E, 0x0000000E, - 0x63F, 0x0000000E, - 0x640, 0x00000080, - 0x642, 0x00000040, - 0x643, 0x00000000, - 0x652, 0x000000C8, - 0x66E, 0x00000005, - 0x700, 0x00000021, - 0x701, 0x00000043, - 0x702, 0x00000065, - 0x703, 0x00000087, - 0x708, 0x00000021, - 0x709, 0x00000043, - 0x70A, 0x00000065, - 0x70B, 0x00000087, - 0x718, 0x00000040, - -}; -#else -u4Byte Array_TC_8812A_MAC_REG[] = { - 0x0, }; - -#endif -void -ODM_ReadAndConfig_TC_8812A_MAC_REG( - IN PDM_ODM_T pDM_Odm - ) -{ - #define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0) - - u4Byte hex = 0; - u4Byte i = 0; - u2Byte count = 0; - pu4Byte ptr_array = NULL; - u1Byte platform = pDM_Odm->SupportPlatform; - u1Byte _interface = pDM_Odm->SupportInterface; - u1Byte board = pDM_Odm->BoardType; - u4Byte ArrayLen = sizeof(Array_TC_8812A_MAC_REG)/sizeof(u4Byte); - pu4Byte Array = Array_TC_8812A_MAC_REG; - - - hex += board; - hex += _interface << 8; - hex += platform << 16; - hex += 0xFF000000; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_TC_8812A_MAC_REG, hex = 0x%X\n", hex)); - - for (i = 0; i < ArrayLen; i += 2 ) - { - u4Byte v1 = Array[i]; - u4Byte v2 = Array[i+1]; - - // This (offset, data) pair meets the condition. - if ( v1 < 0xCDCDCDCD ) - { - odm_ConfigMAC_8812A(pDM_Odm, v1, (u1Byte)v2); - continue; - } - else - { // This line is the start line of branch. - if ( !CheckCondition(Array[i], hex) ) - { // Discard the following (offset, data) pairs. - READ_NEXT_PAIR(v1, v2, i); - while (v2 != 0xDEAD && - v2 != 0xCDEF && - v2 != 0xCDCD && i < ArrayLen -2) - { - READ_NEXT_PAIR(v1, v2, i); - } - i -= 2; // prevent from for-loop += 2 - } - else // Configure matched pairs and skip to end of if-else. - { - READ_NEXT_PAIR(v1, v2, i); - while (v2 != 0xDEAD && - v2 != 0xCDEF && - v2 != 0xCDCD && i < ArrayLen -2) - { - odm_ConfigMAC_8812A(pDM_Odm, v1, (u1Byte)v2); - READ_NEXT_PAIR(v1, v2, i); - } - - while (v2 != 0xDEAD && i < ArrayLen -2) - { - READ_NEXT_PAIR(v1, v2, i); - } - - } - } - } - -} - -#endif // end of HWIMG_SUPPORT - diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_RF.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_RF.c deleted file mode 100755 index d54977c180e0a8..00000000000000 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_RF.c +++ /dev/null @@ -1,1920 +0,0 @@ -/****************************************************************************** -* -* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of version 2 of the GNU General Public License as -* published by the Free Software Foundation. -* -* This program is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along with -* this program; if not, write to the Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA -* -* -******************************************************************************/ - -#include "../odm_precomp.h" - -#if (RTL8812A_SUPPORT == 1) -static BOOLEAN -CheckCondition( - const u4Byte Condition, - const u4Byte Hex - ) -{ - u4Byte _board = (Hex & 0x000000FF); - u4Byte _interface = (Hex & 0x0000FF00) >> 8; - u4Byte _platform = (Hex & 0x00FF0000) >> 16; - u4Byte cond = Condition; - - if ( Condition == 0xCDCDCDCD ) - return TRUE; - - cond = Condition & 0x000000FF; - if ( (_board != cond) && (cond != 0xFF) ) - return FALSE; - - cond = Condition & 0x0000FF00; - cond = cond >> 8; - if ( ((_interface & cond) == 0) && (cond != 0x07) ) - return FALSE; - - cond = Condition & 0x00FF0000; - cond = cond >> 16; - if ( ((_platform & cond) == 0) && (cond != 0x0F) ) - return FALSE; - return TRUE; -} - - -/****************************************************************************** -* RadioA.TXT -******************************************************************************/ -#if TESTCHIP_SUPPORT == 1 - -u4Byte Array_TC_8812A_RadioA[] = { - 0x000, 0x00010000, - 0x018, 0x0001712A, - 0x056, 0x00051CF2, - 0x066, 0x00040000, - 0x01E, 0x00080000, - 0x089, 0x00000080, - 0xFF0F0740, 0xABCD, - 0x086, 0x00014B38, - 0xFF0F07C0, 0xCDEF, - 0x086, 0x00014B38, - 0xFF0F07D8, 0xCDEF, - 0x086, 0x00014B3C, - 0xCDCDCDCD, 0xCDCD, - 0x086, 0x00014B38, - 0xFF0F0740, 0xDEAD, - 0x0B1, 0x0001FC1A, - 0x0B3, 0x000F0810, - 0x0B4, 0x0001A78D, - 0x0BA, 0x00086180, - 0x018, 0x00000006, - 0x0EF, 0x00002000, - 0x03B, 0x00038A58, - 0x03B, 0x00037A58, - 0x03B, 0x0002A590, - 0x03B, 0x00027A50, - 0x03B, 0x00018248, - 0x03B, 0x00010240, - 0x03B, 0x00008240, - 0x03B, 0x00000240, - 0x0EF, 0x00000100, - 0xFF0F07D8, 0xABCD, - 0x034, 0x0000A4EE, - 0x034, 0x00009076, - 0x034, 0x00008073, - 0x034, 0x00007070, - 0x034, 0x0000606D, - 0x034, 0x0000506A, - 0x034, 0x00004049, - 0x034, 0x00003046, - 0x034, 0x00002028, - 0x034, 0x00001025, - 0x034, 0x00000022, - 0xCDCDCDCD, 0xCDCD, - 0x034, 0x0000ADF4, - 0x034, 0x00009DF1, - 0x034, 0x00008DEE, - 0x034, 0x00007DEB, - 0x034, 0x00006DE8, - 0x034, 0x00005CEC, - 0x034, 0x00004CE9, - 0x034, 0x000034EA, - 0x034, 0x000024E7, - 0x034, 0x0000146B, - 0x034, 0x0000006D, - 0xFF0F07D8, 0xDEAD, - 0x0EF, 0x00000000, - 0x0EF, 0x000020A2, - 0x0DF, 0x00000080, - 0x035, 0x00000192, - 0x035, 0x00008192, - 0x035, 0x00010192, - 0x036, 0x00000024, - 0x036, 0x00008024, - 0x036, 0x00010024, - 0x036, 0x00018024, - 0x0EF, 0x00000000, - 0x051, 0x00000C21, - 0x052, 0x000006D9, - 0x053, 0x000FC649, - 0x054, 0x0000017E, - 0x0EF, 0x00000002, - 0x008, 0x00008400, - 0x018, 0x0001712A, - 0x0EF, 0x00001000, - 0x03A, 0x00000080, - 0x03B, 0x0003A02C, - 0x03C, 0x00004000, - 0x03A, 0x00000400, - 0x03B, 0x0003202C, - 0x03C, 0x00010000, - 0x03A, 0x000000A0, - 0x03B, 0x0002B064, - 0x03C, 0x00004000, - 0x03A, 0x000000D8, - 0x03B, 0x00023070, - 0x03C, 0x00004000, - 0x03A, 0x00000468, - 0x03B, 0x0001B870, - 0x03C, 0x00010000, - 0x03A, 0x00000098, - 0x03B, 0x00012085, - 0x03C, 0x000E4000, - 0x03A, 0x00000418, - 0x03B, 0x0000A080, - 0x03C, 0x000F0000, - 0x03A, 0x00000418, - 0x03B, 0x00002080, - 0x03C, 0x00010000, - 0x03A, 0x00000080, - 0x03B, 0x0007A02C, - 0x03C, 0x00004000, - 0x03A, 0x00000400, - 0x03B, 0x0007202C, - 0x03C, 0x00010000, - 0x03A, 0x000000A0, - 0x03B, 0x0006B064, - 0x03C, 0x00004000, - 0x03A, 0x000000D8, - 0x03B, 0x00023070, - 0x03C, 0x00004000, - 0x03A, 0x00000468, - 0x03B, 0x0005B870, - 0x03C, 0x00010000, - 0x03A, 0x00000098, - 0x03B, 0x00052085, - 0x03C, 0x000E4000, - 0x03A, 0x00000418, - 0x03B, 0x0004A080, - 0x03C, 0x000F0000, - 0x03A, 0x00000418, - 0x03B, 0x00042080, - 0x03C, 0x00010000, - 0x03A, 0x00000080, - 0x03B, 0x000BA02C, - 0x03C, 0x00004000, - 0x03A, 0x00000400, - 0x03B, 0x000B202C, - 0x03C, 0x00010000, - 0x03A, 0x000000A0, - 0x03B, 0x000AB064, - 0x03C, 0x00004000, - 0x03A, 0x000000D8, - 0x03B, 0x000A3070, - 0x03C, 0x00004000, - 0x03A, 0x00000468, - 0x03B, 0x0009B870, - 0x03C, 0x00010000, - 0x03A, 0x00000098, - 0x03B, 0x00092085, - 0x03C, 0x000E4000, - 0x03A, 0x00000418, - 0x03B, 0x0008A080, - 0x03C, 0x000F0000, - 0x03A, 0x00000418, - 0x03B, 0x00082080, - 0x03C, 0x00010000, - 0x0EF, 0x00001100, - 0xFF0F0740, 0xABCD, - 0x034, 0x0004A0B2, - 0x034, 0x000490AF, - 0x034, 0x00048070, - 0x034, 0x0004706D, - 0x034, 0x00046050, - 0x034, 0x0004504D, - 0x034, 0x0004404A, - 0x034, 0x00043047, - 0x034, 0x0004200A, - 0x034, 0x00041007, - 0x034, 0x00040004, - 0xFF0F07C0, 0xCDEF, - 0x034, 0x0004A0B2, - 0x034, 0x000490AF, - 0x034, 0x00048070, - 0x034, 0x0004706D, - 0x034, 0x00046050, - 0x034, 0x0004504D, - 0x034, 0x0004404A, - 0x034, 0x00043047, - 0x034, 0x0004200A, - 0x034, 0x00041007, - 0x034, 0x00040004, - 0xFF0F07D8, 0xCDEF, - 0x034, 0x0004A0B2, - 0x034, 0x000490AF, - 0x034, 0x00048070, - 0x034, 0x0004706D, - 0x034, 0x00046050, - 0x034, 0x0004504D, - 0x034, 0x0004404A, - 0x034, 0x00043047, - 0x034, 0x0004200A, - 0x034, 0x00041007, - 0x034, 0x00040004, - 0xCDCDCDCD, 0xCDCD, - 0x034, 0x0004ADF5, - 0x034, 0x00049DF2, - 0x034, 0x00048DEF, - 0x034, 0x00047DEC, - 0x034, 0x00046DE9, - 0x034, 0x00045DC9, - 0x034, 0x00044CE8, - 0x034, 0x000438CA, - 0x034, 0x00042889, - 0x034, 0x0004184A, - 0x034, 0x0004044A, - 0xFF0F0740, 0xDEAD, - 0xFF0F0740, 0xABCD, - 0x034, 0x0002A0B2, - 0x034, 0x000290AF, - 0x034, 0x00028070, - 0x034, 0x0002706D, - 0x034, 0x00026050, - 0x034, 0x0002504D, - 0x034, 0x0002404A, - 0x034, 0x00023047, - 0x034, 0x0002200A, - 0x034, 0x00021007, - 0x034, 0x00020004, - 0xFF0F07C0, 0xCDEF, - 0x034, 0x0002A0B2, - 0x034, 0x000290AF, - 0x034, 0x00028070, - 0x034, 0x0002706D, - 0x034, 0x00026050, - 0x034, 0x0002504D, - 0x034, 0x0002404A, - 0x034, 0x00023047, - 0x034, 0x0002200A, - 0x034, 0x00021007, - 0x034, 0x00020004, - 0xFF0F07D8, 0xCDEF, - 0x034, 0x0002A0B2, - 0x034, 0x000290AF, - 0x034, 0x00028070, - 0x034, 0x0002706D, - 0x034, 0x00026050, - 0x034, 0x0002504D, - 0x034, 0x0002404A, - 0x034, 0x00023047, - 0x034, 0x0002200A, - 0x034, 0x00021007, - 0x034, 0x00020004, - 0xCDCDCDCD, 0xCDCD, - 0x034, 0x0002ADF5, - 0x034, 0x00029DF2, - 0x034, 0x00028DEF, - 0x034, 0x00027DEC, - 0x034, 0x00026DE9, - 0x034, 0x00025DC9, - 0x034, 0x00024CE8, - 0x034, 0x000238CA, - 0x034, 0x00022889, - 0x034, 0x0002184A, - 0x034, 0x0002044A, - 0xFF0F0740, 0xDEAD, - 0xFF0F0740, 0xABCD, - 0x034, 0x0000A0B2, - 0x034, 0x000090AF, - 0x034, 0x00008070, - 0x034, 0x0000706D, - 0x034, 0x00006050, - 0x034, 0x0000504D, - 0x034, 0x0000404A, - 0x034, 0x00003047, - 0x034, 0x0000200A, - 0x034, 0x00001007, - 0x034, 0x00000004, - 0xFF0F07C0, 0xCDEF, - 0x034, 0x0000A0B2, - 0x034, 0x000090AF, - 0x034, 0x00008070, - 0x034, 0x0000706D, - 0x034, 0x00006050, - 0x034, 0x0000504D, - 0x034, 0x0000404A, - 0x034, 0x00003047, - 0x034, 0x0000200A, - 0x034, 0x00001007, - 0x034, 0x00000004, - 0xFF0F07D8, 0xCDEF, - 0x034, 0x0000A0B2, - 0x034, 0x000090AF, - 0x034, 0x00008070, - 0x034, 0x0000706D, - 0x034, 0x00006050, - 0x034, 0x0000504D, - 0x034, 0x0000404A, - 0x034, 0x00003047, - 0x034, 0x0000200A, - 0x034, 0x00001007, - 0x034, 0x00000004, - 0xCDCDCDCD, 0xCDCD, - 0x034, 0x0000AFF7, - 0x034, 0x00009DF7, - 0x034, 0x00008DF4, - 0x034, 0x00007DF1, - 0x034, 0x00006DEE, - 0x034, 0x00005DCD, - 0x034, 0x00004CEB, - 0x034, 0x000038CC, - 0x034, 0x0000288B, - 0x034, 0x0000184C, - 0x034, 0x0000044C, - 0xFF0F0740, 0xDEAD, - 0x0EF, 0x00000000, - 0xFF0F0740, 0xABCD, - 0x018, 0x0001712A, - 0x0EF, 0x00000040, - 0x035, 0x000001D4, - 0x035, 0x000081D4, - 0x035, 0x000101D4, - 0x035, 0x000201B4, - 0x035, 0x000281B4, - 0x035, 0x000301B4, - 0x035, 0x000401B4, - 0x035, 0x000481B4, - 0x035, 0x000501B4, - 0xFF0F07C0, 0xCDEF, - 0x018, 0x0001712A, - 0x0EF, 0x00000040, - 0x035, 0x000001D4, - 0x035, 0x000081D4, - 0x035, 0x000101D4, - 0x035, 0x000201B4, - 0x035, 0x000281B4, - 0x035, 0x000301B4, - 0x035, 0x000401B4, - 0x035, 0x000481B4, - 0x035, 0x000501B4, - 0xFF0F07D8, 0xCDEF, - 0x018, 0x0001712A, - 0x0EF, 0x00000040, - 0x035, 0x000001D4, - 0x035, 0x000081D4, - 0x035, 0x000101D4, - 0x035, 0x000201B4, - 0x035, 0x000281B4, - 0x035, 0x000301B4, - 0x035, 0x000401B4, - 0x035, 0x000481B4, - 0x035, 0x000501B4, - 0xCDCDCDCD, 0xCDCD, - 0x018, 0x0001712A, - 0x0EF, 0x00000040, - 0x035, 0x00000188, - 0x035, 0x00008188, - 0x035, 0x00010185, - 0x035, 0x000201D7, - 0x035, 0x000281D7, - 0x035, 0x000301D5, - 0x035, 0x000401D8, - 0x035, 0x000481D8, - 0x035, 0x000501D5, - 0xFF0F0740, 0xDEAD, - 0x0EF, 0x00000000, - 0xFF0F0740, 0xABCD, - 0x018, 0x0001712A, - 0x0EF, 0x00000010, - 0x036, 0x00004BFB, - 0x036, 0x0000CBFB, - 0x036, 0x00014BFB, - 0x036, 0x0001CBFB, - 0x036, 0x00024F4B, - 0x036, 0x0002CF4B, - 0x036, 0x00034F4B, - 0x036, 0x0003CF4B, - 0x036, 0x00044F4B, - 0x036, 0x0004CF4B, - 0x036, 0x00054F4B, - 0x036, 0x0005CF4B, - 0xFF0F07C0, 0xCDEF, - 0x018, 0x0001712A, - 0x0EF, 0x00000010, - 0x036, 0x00004BFB, - 0x036, 0x0000CBFB, - 0x036, 0x00014BFB, - 0x036, 0x0001CBFB, - 0x036, 0x00024F4B, - 0x036, 0x0002CF4B, - 0x036, 0x00034F4B, - 0x036, 0x0003CF4B, - 0x036, 0x00044F4B, - 0x036, 0x0004CF4B, - 0x036, 0x00054F4B, - 0x036, 0x0005CF4B, - 0xFF0F07D8, 0xCDEF, - 0x018, 0x0001712A, - 0x0EF, 0x00000010, - 0x036, 0x00004BFB, - 0x036, 0x0000CBFB, - 0x036, 0x00014BFB, - 0x036, 0x0001CBFB, - 0x036, 0x00024F4B, - 0x036, 0x0002CF4B, - 0x036, 0x00034F4B, - 0x036, 0x0003CF4B, - 0x036, 0x00044F4B, - 0x036, 0x0004CF4B, - 0x036, 0x00054F4B, - 0x036, 0x0005CF4B, - 0xCDCDCDCD, 0xCDCD, - 0x018, 0x0001712A, - 0x0EF, 0x00000010, - 0x036, 0x00084EB4, - 0x036, 0x0008C9B4, - 0x036, 0x000949B4, - 0x036, 0x0009C9B4, - 0x036, 0x000A4935, - 0x036, 0x000AC935, - 0x036, 0x000B4935, - 0x036, 0x000BC935, - 0x036, 0x000C4EB4, - 0x036, 0x000CCEB4, - 0x036, 0x000D4EB4, - 0x036, 0x000DCEB4, - 0xFF0F0740, 0xDEAD, - 0x0EF, 0x00000000, - 0x0EF, 0x00000008, - 0xFF0F0740, 0xABCD, - 0x03C, 0x000002CC, - 0x03C, 0x00000522, - 0x03C, 0x00000902, - 0xFF0F07C0, 0xCDEF, - 0x03C, 0x000002CC, - 0x03C, 0x00000522, - 0x03C, 0x00000902, - 0xFF0F07D8, 0xCDEF, - 0x03C, 0x000002CC, - 0x03C, 0x00000522, - 0x03C, 0x00000902, - 0xCDCDCDCD, 0xCDCD, - 0x03C, 0x000002AA, - 0x03C, 0x000005A2, - 0x03C, 0x00000880, - 0xFF0F0740, 0xDEAD, - 0x0EF, 0x00000000, - 0x018, 0x0001712A, - 0x0EF, 0x00000002, - 0x0DF, 0x00000080, - 0x01F, 0x00040064, - 0xFF0F0740, 0xABCD, - 0x061, 0x000FDD43, - 0x062, 0x00038F4B, - 0x063, 0x00032117, - 0x064, 0x000194AC, - 0x065, 0x000931D1, - 0xFF0F07C0, 0xCDEF, - 0x061, 0x000FDD43, - 0x062, 0x00038F4B, - 0x063, 0x00032117, - 0x064, 0x000194AC, - 0x065, 0x000931D1, - 0xFF0F07D8, 0xCDEF, - 0x061, 0x000FDD43, - 0x062, 0x00038F4B, - 0x063, 0x00032117, - 0x064, 0x000194AC, - 0x065, 0x000931D1, - 0xCDCDCDCD, 0xCDCD, - 0x061, 0x000E5D53, - 0x062, 0x00038FCD, - 0x063, 0x000314EB, - 0x064, 0x000196AC, - 0x065, 0x000931D7, - 0xFF0F0740, 0xDEAD, - 0x008, 0x00008400, - 0x01C, 0x000739D2, - 0x0B4, 0x0001E78D, - 0x018, 0x0001F12A, - 0x0FE, 0x00000000, - 0x0FE, 0x00000000, - 0x0FE, 0x00000000, - 0x0FE, 0x00000000, - 0x0B4, 0x0001A78D, - 0x018, 0x0001712A, - -}; -#else -u4Byte Array_TC_8812A_RadioA[] = { - 0x0, }; - -#endif -void -ODM_ReadAndConfig_TC_8812A_RadioA( - IN PDM_ODM_T pDM_Odm - ) -{ - #define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0) - - u4Byte hex = 0; - u4Byte i = 0; - u2Byte count = 0; - pu4Byte ptr_array = NULL; - u1Byte platform = pDM_Odm->SupportPlatform; - u1Byte _interface = pDM_Odm->SupportInterface; - u1Byte board = pDM_Odm->BoardType; - u4Byte ArrayLen = sizeof(Array_TC_8812A_RadioA)/sizeof(u4Byte); - pu4Byte Array = Array_TC_8812A_RadioA; - - - hex += board; - hex += _interface << 8; - hex += platform << 16; - hex += 0xFF000000; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_TC_8812A_RadioA, hex = 0x%X\n", hex)); - - for (i = 0; i < ArrayLen; i += 2 ) - { - u4Byte v1 = Array[i]; - u4Byte v2 = Array[i+1]; - - // This (offset, data) pair meets the condition. - if ( v1 < 0xCDCDCDCD ) - { - odm_ConfigRF_RadioA_8812A(pDM_Odm, v1, v2); - continue; - } - else - { // This line is the start line of branch. - if ( !CheckCondition(Array[i], hex) ) - { // Discard the following (offset, data) pairs. - READ_NEXT_PAIR(v1, v2, i); - while (v2 != 0xDEAD && - v2 != 0xCDEF && - v2 != 0xCDCD && i < ArrayLen -2) - { - READ_NEXT_PAIR(v1, v2, i); - } - i -= 2; // prevent from for-loop += 2 - } - else // Configure matched pairs and skip to end of if-else. - { - READ_NEXT_PAIR(v1, v2, i); - while (v2 != 0xDEAD && - v2 != 0xCDEF && - v2 != 0xCDCD && i < ArrayLen -2) - { - odm_ConfigRF_RadioA_8812A(pDM_Odm, v1, v2); - READ_NEXT_PAIR(v1, v2, i); - } - - while (v2 != 0xDEAD && i < ArrayLen -2) - { - READ_NEXT_PAIR(v1, v2, i); - } - - } - } - } - -} - -/****************************************************************************** -* RadioB.TXT -******************************************************************************/ -#if TESTCHIP_SUPPORT == 1 - -u4Byte Array_TC_8812A_RadioB[] = { - 0x056, 0x00051CF2, - 0x066, 0x00040000, - 0x089, 0x00000080, - 0xFF0F0740, 0xABCD, - 0x086, 0x00014B38, - 0xFF0F07C0, 0xCDEF, - 0x086, 0x00014B38, - 0xFF0F07D8, 0xCDEF, - 0x086, 0x00014B3C, - 0xCDCDCDCD, 0xCDCD, - 0x086, 0x00014B38, - 0xFF0F0740, 0xDEAD, - 0x018, 0x00000006, - 0x0EF, 0x00002000, - 0x03B, 0x00038A58, - 0x03B, 0x00037A58, - 0x03B, 0x0002A590, - 0x03B, 0x00027A50, - 0x03B, 0x00018248, - 0x03B, 0x00010240, - 0x03B, 0x00008240, - 0x03B, 0x00000240, - 0x0EF, 0x00000100, - 0xFF0F07D8, 0xABCD, - 0x034, 0x0000A4EE, - 0x034, 0x00009076, - 0x034, 0x00008073, - 0x034, 0x00007070, - 0x034, 0x0000606D, - 0x034, 0x0000506A, - 0x034, 0x00004049, - 0x034, 0x00003046, - 0x034, 0x00002028, - 0x034, 0x00001025, - 0x034, 0x00000022, - 0xCDCDCDCD, 0xCDCD, - 0x034, 0x0000ADF4, - 0x034, 0x00009DF1, - 0x034, 0x00008DEE, - 0x034, 0x00007DEB, - 0x034, 0x00006DE8, - 0x034, 0x00005CEC, - 0x034, 0x00004CE9, - 0x034, 0x000034EA, - 0x034, 0x000024E7, - 0x034, 0x0000146B, - 0x034, 0x0000006D, - 0xFF0F07D8, 0xDEAD, - 0x0EF, 0x00000000, - 0x0EF, 0x000020A2, - 0x0DF, 0x00000080, - 0x035, 0x00000192, - 0x035, 0x00008192, - 0x035, 0x00010192, - 0x036, 0x00000024, - 0x036, 0x00008024, - 0x036, 0x00010024, - 0x036, 0x00018024, - 0x0EF, 0x00000000, - 0x051, 0x00000C21, - 0x052, 0x000006D9, - 0x053, 0x000FC649, - 0x054, 0x0000017E, - 0x0EF, 0x00000002, - 0x008, 0x00008400, - 0x018, 0x0001712A, - 0x0EF, 0x00001000, - 0x03A, 0x00000080, - 0x03B, 0x0003A02C, - 0x03C, 0x00004000, - 0x03A, 0x00000400, - 0x03B, 0x0003202C, - 0x03C, 0x00010000, - 0x03A, 0x000000A0, - 0x03B, 0x0002B064, - 0x03C, 0x00004000, - 0x03A, 0x000000D8, - 0x03B, 0x00023070, - 0x03C, 0x00004000, - 0x03A, 0x00000468, - 0x03B, 0x0001B870, - 0x03C, 0x00010000, - 0x03A, 0x00000098, - 0x03B, 0x00012085, - 0x03C, 0x000E4000, - 0x03A, 0x00000418, - 0x03B, 0x0000A080, - 0x03C, 0x000F0000, - 0x03A, 0x00000418, - 0x03B, 0x00002080, - 0x03C, 0x00010000, - 0x03A, 0x00000080, - 0x03B, 0x0007A02C, - 0x03C, 0x00004000, - 0x03A, 0x00000400, - 0x03B, 0x0007202C, - 0x03C, 0x00010000, - 0x03A, 0x000000A0, - 0x03B, 0x0006B064, - 0x03C, 0x00004000, - 0x03A, 0x000000D8, - 0x03B, 0x00063070, - 0x03C, 0x00004000, - 0x03A, 0x00000468, - 0x03B, 0x0005B870, - 0x03C, 0x00010000, - 0x03A, 0x00000098, - 0x03B, 0x00052085, - 0x03C, 0x000E4000, - 0x03A, 0x00000418, - 0x03B, 0x0004A080, - 0x03C, 0x000F0000, - 0x03A, 0x00000418, - 0x03B, 0x00042080, - 0x03C, 0x00010000, - 0x03A, 0x00000080, - 0x03B, 0x000BA02C, - 0x03C, 0x00004000, - 0x03A, 0x00000400, - 0x03B, 0x000B202C, - 0x03C, 0x00010000, - 0x03A, 0x000000A0, - 0x03B, 0x000AB064, - 0x03C, 0x00004000, - 0x03A, 0x000000D8, - 0x03B, 0x000A3070, - 0x03C, 0x00004000, - 0x03A, 0x00000468, - 0x03B, 0x0009B870, - 0x03C, 0x00010000, - 0x03A, 0x00000098, - 0x03B, 0x00092085, - 0x03C, 0x000E4000, - 0x03A, 0x00000418, - 0x03B, 0x0008A080, - 0x03C, 0x000F0000, - 0x03A, 0x00000418, - 0x03B, 0x00082080, - 0x03C, 0x00010000, - 0x0EF, 0x00001100, - 0xFF0F0740, 0xABCD, - 0x034, 0x0004A0B2, - 0x034, 0x000490AF, - 0x034, 0x00048070, - 0x034, 0x0004706D, - 0x034, 0x00046050, - 0x034, 0x0004504D, - 0x034, 0x0004404A, - 0x034, 0x00043047, - 0x034, 0x0004200A, - 0x034, 0x00041007, - 0x034, 0x00040004, - 0xFF0F07C0, 0xCDEF, - 0x034, 0x0004A0B2, - 0x034, 0x000490AF, - 0x034, 0x00048070, - 0x034, 0x0004706D, - 0x034, 0x00046050, - 0x034, 0x0004504D, - 0x034, 0x0004404A, - 0x034, 0x00043047, - 0x034, 0x0004200A, - 0x034, 0x00041007, - 0x034, 0x00040004, - 0xFF0F07D8, 0xCDEF, - 0x034, 0x0004A0B2, - 0x034, 0x000490AF, - 0x034, 0x00048070, - 0x034, 0x0004706D, - 0x034, 0x00046050, - 0x034, 0x0004504D, - 0x034, 0x0004404A, - 0x034, 0x00043047, - 0x034, 0x0004200A, - 0x034, 0x00041007, - 0x034, 0x00040004, - 0xCDCDCDCD, 0xCDCD, - 0x034, 0x0004ADF5, - 0x034, 0x00049DF2, - 0x034, 0x00048DEF, - 0x034, 0x00047DEC, - 0x034, 0x00046DE9, - 0x034, 0x00045DC9, - 0x034, 0x00044CE8, - 0x034, 0x000438CA, - 0x034, 0x00042889, - 0x034, 0x0004184A, - 0x034, 0x0004044A, - 0xFF0F0740, 0xDEAD, - 0xFF0F0740, 0xABCD, - 0x034, 0x0002A0B2, - 0x034, 0x000290AF, - 0x034, 0x00028070, - 0x034, 0x0002706D, - 0x034, 0x00026050, - 0x034, 0x0002504D, - 0x034, 0x0002404A, - 0x034, 0x00023047, - 0x034, 0x0002200A, - 0x034, 0x00021007, - 0x034, 0x00020004, - 0xFF0F07C0, 0xCDEF, - 0x034, 0x0002A0B2, - 0x034, 0x000290AF, - 0x034, 0x00028070, - 0x034, 0x0002706D, - 0x034, 0x00026050, - 0x034, 0x0002504D, - 0x034, 0x0002404A, - 0x034, 0x00023047, - 0x034, 0x0002200A, - 0x034, 0x00021007, - 0x034, 0x00020004, - 0xFF0F07D8, 0xCDEF, - 0x034, 0x0002A0B2, - 0x034, 0x000290AF, - 0x034, 0x00028070, - 0x034, 0x0002706D, - 0x034, 0x00026050, - 0x034, 0x0002504D, - 0x034, 0x0002404A, - 0x034, 0x00023047, - 0x034, 0x0002200A, - 0x034, 0x00021007, - 0x034, 0x00020004, - 0xCDCDCDCD, 0xCDCD, - 0x034, 0x0002ADF5, - 0x034, 0x00029DF2, - 0x034, 0x00028DEF, - 0x034, 0x00027DEC, - 0x034, 0x00026DE9, - 0x034, 0x00025DC9, - 0x034, 0x00024CE8, - 0x034, 0x000238CA, - 0x034, 0x00022889, - 0x034, 0x0002184A, - 0x034, 0x0002044A, - 0xFF0F0740, 0xDEAD, - 0xFF0F0740, 0xABCD, - 0x034, 0x0000A0B2, - 0x034, 0x000090AF, - 0x034, 0x00008070, - 0x034, 0x0000706D, - 0x034, 0x00006050, - 0x034, 0x0000504D, - 0x034, 0x0000404A, - 0x034, 0x00003047, - 0x034, 0x0000200A, - 0x034, 0x00001007, - 0x034, 0x00000004, - 0xFF0F07C0, 0xCDEF, - 0x034, 0x0000A0B2, - 0x034, 0x000090AF, - 0x034, 0x00008070, - 0x034, 0x0000706D, - 0x034, 0x00006050, - 0x034, 0x0000504D, - 0x034, 0x0000404A, - 0x034, 0x00003047, - 0x034, 0x0000200A, - 0x034, 0x00001007, - 0x034, 0x00000004, - 0xFF0F07D8, 0xCDEF, - 0x034, 0x0000A0B2, - 0x034, 0x000090AF, - 0x034, 0x00008070, - 0x034, 0x0000706D, - 0x034, 0x00006050, - 0x034, 0x0000504D, - 0x034, 0x0000404A, - 0x034, 0x00003047, - 0x034, 0x0000200A, - 0x034, 0x00001007, - 0x034, 0x00000004, - 0xCDCDCDCD, 0xCDCD, - 0x034, 0x0000AFF7, - 0x034, 0x00009DF7, - 0x034, 0x00008DF4, - 0x034, 0x00007DF1, - 0x034, 0x00006DEE, - 0x034, 0x00005DCD, - 0x034, 0x00004CEB, - 0x034, 0x000038CC, - 0x034, 0x0000288B, - 0x034, 0x0000184C, - 0x034, 0x0000044C, - 0xFF0F0740, 0xDEAD, - 0x0EF, 0x00000000, - 0xFF0F0740, 0xABCD, - 0x018, 0x0001712A, - 0x0EF, 0x00000040, - 0x035, 0x000001C5, - 0x035, 0x000081C5, - 0x035, 0x000101C5, - 0x035, 0x00020174, - 0x035, 0x00028174, - 0x035, 0x00030174, - 0x035, 0x00040185, - 0x035, 0x00048185, - 0x035, 0x00050185, - 0x0EF, 0x00000000, - 0xFF0F07C0, 0xCDEF, - 0x018, 0x0001712A, - 0x0EF, 0x00000040, - 0x035, 0x000001C5, - 0x035, 0x000081C5, - 0x035, 0x000101C5, - 0x035, 0x00020174, - 0x035, 0x00028174, - 0x035, 0x00030174, - 0x035, 0x00040185, - 0x035, 0x00048185, - 0x035, 0x00050185, - 0x0EF, 0x00000000, - 0xFF0F07D8, 0xCDEF, - 0x018, 0x0001712A, - 0x0EF, 0x00000040, - 0x035, 0x000001C5, - 0x035, 0x000081C5, - 0x035, 0x000101C5, - 0x035, 0x00020174, - 0x035, 0x00028174, - 0x035, 0x00030174, - 0x035, 0x00040185, - 0x035, 0x00048185, - 0x035, 0x00050185, - 0x0EF, 0x00000000, - 0xCDCDCDCD, 0xCDCD, - 0x018, 0x0001712A, - 0x0EF, 0x00000040, - 0x035, 0x00000186, - 0x035, 0x00008186, - 0x035, 0x00010185, - 0x035, 0x000201D5, - 0x035, 0x000281D5, - 0x035, 0x000301D5, - 0x035, 0x000401D5, - 0x035, 0x000481D5, - 0x035, 0x000501D5, - 0x0EF, 0x00000000, - 0xFF0F0740, 0xDEAD, - 0xFF0F0740, 0xABCD, - 0x018, 0x0001712A, - 0x0EF, 0x00000010, - 0x036, 0x00005B8B, - 0x036, 0x0000DB8B, - 0x036, 0x00015B8B, - 0x036, 0x0001DB8B, - 0x036, 0x000262DB, - 0x036, 0x0002E2DB, - 0x036, 0x000362DB, - 0x036, 0x0003E2DB, - 0x036, 0x0004553B, - 0x036, 0x0004D53B, - 0x036, 0x0005553B, - 0x036, 0x0005D53B, - 0xFF0F07C0, 0xCDEF, - 0x018, 0x0001712A, - 0x0EF, 0x00000010, - 0x036, 0x00005B8B, - 0x036, 0x0000DB8B, - 0x036, 0x00015B8B, - 0x036, 0x0001DB8B, - 0x036, 0x000262DB, - 0x036, 0x0002E2DB, - 0x036, 0x000362DB, - 0x036, 0x0003E2DB, - 0x036, 0x0004553B, - 0x036, 0x0004D53B, - 0x036, 0x0005553B, - 0x036, 0x0005D53B, - 0xFF0F07D8, 0xCDEF, - 0x018, 0x0001712A, - 0x0EF, 0x00000010, - 0x036, 0x00005B8B, - 0x036, 0x0000DB8B, - 0x036, 0x00015B8B, - 0x036, 0x0001DB8B, - 0x036, 0x000262DB, - 0x036, 0x0002E2DB, - 0x036, 0x000362DB, - 0x036, 0x0003E2DB, - 0x036, 0x0004553B, - 0x036, 0x0004D53B, - 0x036, 0x0005553B, - 0x036, 0x0005D53B, - 0xCDCDCDCD, 0xCDCD, - 0x018, 0x0001712A, - 0x0EF, 0x00000010, - 0x036, 0x00084EB4, - 0x036, 0x0008C9B4, - 0x036, 0x000949B4, - 0x036, 0x0009C9B4, - 0x036, 0x000A4935, - 0x036, 0x000AC935, - 0x036, 0x000B4935, - 0x036, 0x000BC935, - 0x036, 0x000C4EB4, - 0x036, 0x000CCEB4, - 0x036, 0x000D4EB4, - 0x036, 0x000DCEB4, - 0xFF0F0740, 0xDEAD, - 0x0EF, 0x00000000, - 0x0EF, 0x00000008, - 0xFF0F0740, 0xABCD, - 0x03C, 0x000002DC, - 0x03C, 0x00000524, - 0x03C, 0x00000902, - 0xFF0F07C0, 0xCDEF, - 0x03C, 0x000002DC, - 0x03C, 0x00000524, - 0x03C, 0x00000902, - 0xFF0F07D8, 0xCDEF, - 0x03C, 0x000002DC, - 0x03C, 0x00000524, - 0x03C, 0x00000902, - 0xCDCDCDCD, 0xCDCD, - 0x03C, 0x000002AA, - 0x03C, 0x000005A2, - 0x03C, 0x00000880, - 0xFF0F0740, 0xDEAD, - 0x0EF, 0x00000000, - 0x018, 0x0001712A, - 0x0EF, 0x00000002, - 0x0DF, 0x00000080, - 0xFF0F0740, 0xABCD, - 0x061, 0x000EAC43, - 0x062, 0x00038F47, - 0x063, 0x00031157, - 0x064, 0x0001C4AC, - 0x065, 0x000931D1, - 0xFF0F07C0, 0xCDEF, - 0x061, 0x000EAC43, - 0x062, 0x00038F47, - 0x063, 0x00031157, - 0x064, 0x0001C4AC, - 0x065, 0x000931D1, - 0xFF0F07D8, 0xCDEF, - 0x061, 0x000EAC43, - 0x062, 0x00038F47, - 0x063, 0x00031157, - 0x064, 0x0001C4AC, - 0x065, 0x000931D1, - 0xCDCDCDCD, 0xCDCD, - 0x061, 0x000E5D53, - 0x062, 0x00038FCD, - 0x063, 0x000314EB, - 0x064, 0x000196AC, - 0x065, 0x000931D7, - 0xFF0F0740, 0xDEAD, - 0x008, 0x00008400, - -}; -#else -u4Byte Array_TC_8812A_RadioB[] = { - 0x0, }; - -#endif - -void -ODM_ReadAndConfig_TC_8812A_RadioB( - IN PDM_ODM_T pDM_Odm - ) -{ - #define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0) - - u4Byte hex = 0; - u4Byte i = 0; - u2Byte count = 0; - pu4Byte ptr_array = NULL; - u1Byte platform = pDM_Odm->SupportPlatform; - u1Byte _interface = pDM_Odm->SupportInterface; - u1Byte board = pDM_Odm->BoardType; - u4Byte ArrayLen = sizeof(Array_TC_8812A_RadioB)/sizeof(u4Byte); - pu4Byte Array = Array_TC_8812A_RadioB; - - - hex += board; - hex += _interface << 8; - hex += platform << 16; - hex += 0xFF000000; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_TC_8812A_RadioB, hex = 0x%X\n", hex)); - - for (i = 0; i < ArrayLen; i += 2 ) - { - u4Byte v1 = Array[i]; - u4Byte v2 = Array[i+1]; - - // This (offset, data) pair meets the condition. - if ( v1 < 0xCDCDCDCD ) - { - odm_ConfigRF_RadioB_8812A(pDM_Odm, v1, v2); - continue; - } - else - { // This line is the start line of branch. - if ( !CheckCondition(Array[i], hex) ) - { // Discard the following (offset, data) pairs. - READ_NEXT_PAIR(v1, v2, i); - while (v2 != 0xDEAD && - v2 != 0xCDEF && - v2 != 0xCDCD && i < ArrayLen -2) - { - READ_NEXT_PAIR(v1, v2, i); - } - i -= 2; // prevent from for-loop += 2 - } - else // Configure matched pairs and skip to end of if-else. - { - READ_NEXT_PAIR(v1, v2, i); - while (v2 != 0xDEAD && - v2 != 0xCDEF && - v2 != 0xCDCD && i < ArrayLen -2) - { - odm_ConfigRF_RadioB_8812A(pDM_Odm, v1, v2); - READ_NEXT_PAIR(v1, v2, i); - } - - while (v2 != 0xDEAD && i < ArrayLen -2) - { - READ_NEXT_PAIR(v1, v2, i); - } - - } - } - } - -} - -/****************************************************************************** -* TxPowerTrack_AP.TXT -******************************************************************************/ - -u1Byte gDeltaSwingTableIdx_TC_5GB_N_TxPowerTrack_AP_8812A[][DELTA_SWINGIDX_SIZE] = { - {0, 1, 1, 2, 2, 3, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 11, 12, 12, 13, 13, 14, 14, 14, 14, 14, 14, 14}, - {0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 14, 14, 14, 14, 14}, - {0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 14, 14, 14, 14, 14}, -}; -u1Byte gDeltaSwingTableIdx_TC_5GB_P_TxPowerTrack_AP_8812A[][DELTA_SWINGIDX_SIZE] = { - {0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 17, 17, 18, 19, 20, 20, 20}, - {0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 19, 20, 20, 20}, - {0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 20, 21, 21, 21}, -}; -u1Byte gDeltaSwingTableIdx_TC_5GA_N_TxPowerTrack_AP_8812A[][DELTA_SWINGIDX_SIZE] = { - {0, 1, 2, 3, 3, 4, 4, 5, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 14, 14, 14, 14, 14}, - {0, 1, 2, 3, 3, 4, 5, 6, 6, 6, 7, 7, 8, 8, 9, 10, 11, 11, 12, 13, 13, 14, 15, 16, 16, 16, 16, 16, 16, 16}, - {0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 10, 11, 11, 12, 13, 14, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16}, -}; -u1Byte gDeltaSwingTableIdx_TC_5GA_P_TxPowerTrack_AP_8812A[][DELTA_SWINGIDX_SIZE] = { - {0, 1, 1, 2, 2, 3, 4, 5, 5, 6, 7, 8, 8, 9, 10, 11, 11, 12, 13, 14, 14, 15, 15, 16, 16, 17, 18, 19, 19, 19}, - {0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 20, 21, 21, 21}, - {0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 20, 21, 21, 21}, -}; -u1Byte gDeltaSwingTableIdx_TC_2GB_N_TxPowerTrack_AP_8812A[] = {0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 7, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11}; -u1Byte gDeltaSwingTableIdx_TC_2GB_P_TxPowerTrack_AP_8812A[] = {0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9}; -u1Byte gDeltaSwingTableIdx_TC_2GA_N_TxPowerTrack_AP_8812A[] = {0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 7, 8, 8, 9, 9, 9, 10, 10, 10, 10, 11, 11}; -u1Byte gDeltaSwingTableIdx_TC_2GA_P_TxPowerTrack_AP_8812A[] = {0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9}; -u1Byte gDeltaSwingTableIdx_TC_2GCCKB_N_TxPowerTrack_AP_8812A[] = {0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 7, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11}; -u1Byte gDeltaSwingTableIdx_TC_2GCCKB_P_TxPowerTrack_AP_8812A[] = {0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9}; -u1Byte gDeltaSwingTableIdx_TC_2GCCKA_N_TxPowerTrack_AP_8812A[] = {0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 7, 8, 8, 9, 9, 9, 10, 10, 10, 10, 11, 11}; -u1Byte gDeltaSwingTableIdx_TC_2GCCKA_P_TxPowerTrack_AP_8812A[] = {0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9}; - -void -ODM_ReadAndConfig_TC_8812A_TxPowerTrack_AP( - IN PDM_ODM_T pDM_Odm - ) -{ - PODM_RF_CAL_T pRFCalibrateInfo = &(pDM_Odm->RFCalibrateInfo); - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_MP_TC_8812A\n")); - - - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GA_P, gDeltaSwingTableIdx_TC_2GA_P_TxPowerTrack_AP_8812A, DELTA_SWINGIDX_SIZE); - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GA_N, gDeltaSwingTableIdx_TC_2GA_N_TxPowerTrack_AP_8812A, DELTA_SWINGIDX_SIZE); - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GB_P, gDeltaSwingTableIdx_TC_2GB_P_TxPowerTrack_AP_8812A, DELTA_SWINGIDX_SIZE); - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GB_N, gDeltaSwingTableIdx_TC_2GB_N_TxPowerTrack_AP_8812A, DELTA_SWINGIDX_SIZE); - - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKA_P, gDeltaSwingTableIdx_TC_2GCCKA_P_TxPowerTrack_AP_8812A, DELTA_SWINGIDX_SIZE); - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKA_N, gDeltaSwingTableIdx_TC_2GCCKA_N_TxPowerTrack_AP_8812A, DELTA_SWINGIDX_SIZE); - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKB_P, gDeltaSwingTableIdx_TC_2GCCKB_P_TxPowerTrack_AP_8812A, DELTA_SWINGIDX_SIZE); - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKB_N, gDeltaSwingTableIdx_TC_2GCCKB_N_TxPowerTrack_AP_8812A, DELTA_SWINGIDX_SIZE); - - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GA_P, gDeltaSwingTableIdx_TC_5GA_P_TxPowerTrack_AP_8812A, DELTA_SWINGIDX_SIZE*3); - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GA_N, gDeltaSwingTableIdx_TC_5GA_N_TxPowerTrack_AP_8812A, DELTA_SWINGIDX_SIZE*3); - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GB_P, gDeltaSwingTableIdx_TC_5GB_P_TxPowerTrack_AP_8812A, DELTA_SWINGIDX_SIZE*3); - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GB_N, gDeltaSwingTableIdx_TC_5GB_N_TxPowerTrack_AP_8812A, DELTA_SWINGIDX_SIZE*3); -} - -/****************************************************************************** -* TxPowerTrack_PCIE.TXT -******************************************************************************/ - -u1Byte gDeltaSwingTableIdx_TC_5GB_N_TxPowerTrack_PCIE_8812A[][DELTA_SWINGIDX_SIZE] = { - {0, 1, 1, 2, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 9, 9, 9, 10, 10, 11, 11, 12, 12, 13}, - {0, 1, 1, 2, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 13, 13}, - {0, 1, 1, 2, 3, 3, 4, 4, 5, 6, 6, 7, 8, 9, 10, 11, 12, 12, 13, 14, 14, 14, 15, 16, 17, 17, 17, 18, 18, 18}, -}; -u1Byte gDeltaSwingTableIdx_TC_5GB_P_TxPowerTrack_PCIE_8812A[][DELTA_SWINGIDX_SIZE] = { - {0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11}, - {0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11}, - {0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11}, -}; -u1Byte gDeltaSwingTableIdx_TC_5GA_N_TxPowerTrack_PCIE_8812A[][DELTA_SWINGIDX_SIZE] = { - {0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 13, 13, 13}, - {0, 1, 1, 2, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 8, 9, 9, 10, 10, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13}, - {0, 1, 1, 2, 2, 3, 3, 4, 5, 6, 7, 8, 8, 9, 10, 11, 12, 13, 14, 14, 15, 15, 15, 16, 16, 16, 17, 17, 18, 18}, -}; -u1Byte gDeltaSwingTableIdx_TC_5GA_P_TxPowerTrack_PCIE_8812A[][DELTA_SWINGIDX_SIZE] = { - {0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11}, - {0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 7, 8, 9, 9, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11}, - {0, 1, 1, 2, 3, 3, 4, 4, 5, 6, 6, 7, 7, 8, 9, 9, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11}, -}; -u1Byte gDeltaSwingTableIdx_TC_2GB_N_TxPowerTrack_PCIE_8812A[] = {0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 7, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11}; -u1Byte gDeltaSwingTableIdx_TC_2GB_P_TxPowerTrack_PCIE_8812A[] = {0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9}; -u1Byte gDeltaSwingTableIdx_TC_2GA_N_TxPowerTrack_PCIE_8812A[] = {0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 7, 8, 8, 9, 9, 9, 10, 10, 10, 10, 11, 11}; -u1Byte gDeltaSwingTableIdx_TC_2GA_P_TxPowerTrack_PCIE_8812A[] = {0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9}; -u1Byte gDeltaSwingTableIdx_TC_2GCCKB_N_TxPowerTrack_PCIE_8812A[] = {0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 7, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11}; -u1Byte gDeltaSwingTableIdx_TC_2GCCKB_P_TxPowerTrack_PCIE_8812A[] = {0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9}; -u1Byte gDeltaSwingTableIdx_TC_2GCCKA_N_TxPowerTrack_PCIE_8812A[] = {0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 7, 8, 8, 9, 9, 9, 10, 10, 10, 10, 11, 11}; -u1Byte gDeltaSwingTableIdx_TC_2GCCKA_P_TxPowerTrack_PCIE_8812A[] = {0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9}; - -void -ODM_ReadAndConfig_TC_8812A_TxPowerTrack_PCIE( - IN PDM_ODM_T pDM_Odm - ) -{ - PODM_RF_CAL_T pRFCalibrateInfo = &(pDM_Odm->RFCalibrateInfo); - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_MP_TC_8812A\n")); - - - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GA_P, gDeltaSwingTableIdx_TC_2GA_P_TxPowerTrack_PCIE_8812A, DELTA_SWINGIDX_SIZE); - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GA_N, gDeltaSwingTableIdx_TC_2GA_N_TxPowerTrack_PCIE_8812A, DELTA_SWINGIDX_SIZE); - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GB_P, gDeltaSwingTableIdx_TC_2GB_P_TxPowerTrack_PCIE_8812A, DELTA_SWINGIDX_SIZE); - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GB_N, gDeltaSwingTableIdx_TC_2GB_N_TxPowerTrack_PCIE_8812A, DELTA_SWINGIDX_SIZE); - - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKA_P, gDeltaSwingTableIdx_TC_2GCCKA_P_TxPowerTrack_PCIE_8812A, DELTA_SWINGIDX_SIZE); - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKA_N, gDeltaSwingTableIdx_TC_2GCCKA_N_TxPowerTrack_PCIE_8812A, DELTA_SWINGIDX_SIZE); - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKB_P, gDeltaSwingTableIdx_TC_2GCCKB_P_TxPowerTrack_PCIE_8812A, DELTA_SWINGIDX_SIZE); - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKB_N, gDeltaSwingTableIdx_TC_2GCCKB_N_TxPowerTrack_PCIE_8812A, DELTA_SWINGIDX_SIZE); - - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GA_P, gDeltaSwingTableIdx_TC_5GA_P_TxPowerTrack_PCIE_8812A, DELTA_SWINGIDX_SIZE*3); - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GA_N, gDeltaSwingTableIdx_TC_5GA_N_TxPowerTrack_PCIE_8812A, DELTA_SWINGIDX_SIZE*3); - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GB_P, gDeltaSwingTableIdx_TC_5GB_P_TxPowerTrack_PCIE_8812A, DELTA_SWINGIDX_SIZE*3); - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GB_N, gDeltaSwingTableIdx_TC_5GB_N_TxPowerTrack_PCIE_8812A, DELTA_SWINGIDX_SIZE*3); -} - -/****************************************************************************** -* TxPowerTrack_USB.TXT -******************************************************************************/ - -u1Byte gDeltaSwingTableIdx_TC_5GB_N_TxPowerTrack_USB_8812A[][DELTA_SWINGIDX_SIZE] = { - {0, 1, 1, 2, 2, 3, 4, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 14, 14, 14, 14}, - {0, 1, 1, 2, 2, 3, 4, 4, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 14, 14, 14, 14}, - {0, 1, 1, 2, 2, 3, 4, 5, 6, 6, 7, 8, 8, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 16, 16, 16, 16, 16}, -}; -u1Byte gDeltaSwingTableIdx_TC_5GB_P_TxPowerTrack_USB_8812A[][DELTA_SWINGIDX_SIZE] = { - {0, 1, 1, 2, 2, 3, 3, 4, 5, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11}, - {0, 1, 1, 2, 3, 3, 4, 5, 5, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11}, - {0, 1, 1, 2, 3, 3, 4, 5, 6, 7, 7, 8, 8, 9, 9, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11}, -}; -u1Byte gDeltaSwingTableIdx_TC_5GA_N_TxPowerTrack_USB_8812A[][DELTA_SWINGIDX_SIZE] = { - {0, 1, 1, 2, 2, 3, 4, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 15, 15, 15, 15, 15}, - {0, 1, 1, 2, 2, 3, 4, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 15, 15, 15, 15, 15}, - {0, 1, 1, 2, 2, 3, 4, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 15, 15, 15, 15, 15}, -}; -u1Byte gDeltaSwingTableIdx_TC_5GA_P_TxPowerTrack_USB_8812A[][DELTA_SWINGIDX_SIZE] = { - {0, 1, 1, 2, 2, 3, 4, 5, 6, 7, 7, 8, 8, 9, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11}, - {0, 1, 1, 2, 3, 3, 4, 5, 6, 7, 7, 8, 8, 9, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11}, - {0, 1, 1, 2, 3, 3, 4, 5, 6, 7, 7, 8, 8, 9, 10, 11, 11, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11}, -}; -u1Byte gDeltaSwingTableIdx_TC_2GB_N_TxPowerTrack_USB_8812A[] = {0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 11, 11, 11, 11}; -u1Byte gDeltaSwingTableIdx_TC_2GB_P_TxPowerTrack_USB_8812A[] = {0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7}; -u1Byte gDeltaSwingTableIdx_TC_2GA_N_TxPowerTrack_USB_8812A[] = {0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 9, 10, 10, 10, 10, 10, 10}; -u1Byte gDeltaSwingTableIdx_TC_2GA_P_TxPowerTrack_USB_8812A[] = {0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7}; -u1Byte gDeltaSwingTableIdx_TC_2GCCKB_N_TxPowerTrack_USB_8812A[] = {0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 11, 11, 11, 11}; -u1Byte gDeltaSwingTableIdx_TC_2GCCKB_P_TxPowerTrack_USB_8812A[] = {0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7}; -u1Byte gDeltaSwingTableIdx_TC_2GCCKA_N_TxPowerTrack_USB_8812A[] = {0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 9, 10, 10, 10, 10, 10, 10}; -u1Byte gDeltaSwingTableIdx_TC_2GCCKA_P_TxPowerTrack_USB_8812A[] = {0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7}; - -void -ODM_ReadAndConfig_TC_8812A_TxPowerTrack_USB( - IN PDM_ODM_T pDM_Odm - ) -{ - PODM_RF_CAL_T pRFCalibrateInfo = &(pDM_Odm->RFCalibrateInfo); - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_MP_TC_8812A\n")); - - - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GA_P, gDeltaSwingTableIdx_TC_2GA_P_TxPowerTrack_USB_8812A, DELTA_SWINGIDX_SIZE); - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GA_N, gDeltaSwingTableIdx_TC_2GA_N_TxPowerTrack_USB_8812A, DELTA_SWINGIDX_SIZE); - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GB_P, gDeltaSwingTableIdx_TC_2GB_P_TxPowerTrack_USB_8812A, DELTA_SWINGIDX_SIZE); - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GB_N, gDeltaSwingTableIdx_TC_2GB_N_TxPowerTrack_USB_8812A, DELTA_SWINGIDX_SIZE); - - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKA_P, gDeltaSwingTableIdx_TC_2GCCKA_P_TxPowerTrack_USB_8812A, DELTA_SWINGIDX_SIZE); - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKA_N, gDeltaSwingTableIdx_TC_2GCCKA_N_TxPowerTrack_USB_8812A, DELTA_SWINGIDX_SIZE); - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKB_P, gDeltaSwingTableIdx_TC_2GCCKB_P_TxPowerTrack_USB_8812A, DELTA_SWINGIDX_SIZE); - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKB_N, gDeltaSwingTableIdx_TC_2GCCKB_N_TxPowerTrack_USB_8812A, DELTA_SWINGIDX_SIZE); - - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GA_P, gDeltaSwingTableIdx_TC_5GA_P_TxPowerTrack_USB_8812A, DELTA_SWINGIDX_SIZE*3); - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GA_N, gDeltaSwingTableIdx_TC_5GA_N_TxPowerTrack_USB_8812A, DELTA_SWINGIDX_SIZE*3); - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GB_P, gDeltaSwingTableIdx_TC_5GB_P_TxPowerTrack_USB_8812A, DELTA_SWINGIDX_SIZE*3); - ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GB_N, gDeltaSwingTableIdx_TC_5GB_N_TxPowerTrack_USB_8812A, DELTA_SWINGIDX_SIZE*3); -} - -/****************************************************************************** -* TXPWR_LMT.TXT -******************************************************************************/ -#if TESTCHIP_SUPPORT == 1 - -pu1Byte Array_TC_8812A_TXPWR_LMT[] = { - "FCC", "2.4G", "20M", "CCK", "1T", "01", "36", - "ETSI", "2.4G", "20M", "CCK", "1T", "01", "32", - "MKK", "2.4G", "20M", "CCK", "1T", "01", "32", - "FCC", "2.4G", "20M", "CCK", "1T", "02", "36", - "ETSI", "2.4G", "20M", "CCK", "1T", "02", "32", - "MKK", "2.4G", "20M", "CCK", "1T", "02", "32", - "FCC", "2.4G", "20M", "CCK", "1T", "03", "36", - "ETSI", "2.4G", "20M", "CCK", "1T", "03", "32", - "MKK", "2.4G", "20M", "CCK", "1T", "03", "32", - "FCC", "2.4G", "20M", "CCK", "1T", "04", "36", - "ETSI", "2.4G", "20M", "CCK", "1T", "04", "32", - "MKK", "2.4G", "20M", "CCK", "1T", "04", "32", - "FCC", "2.4G", "20M", "CCK", "1T", "05", "36", - "ETSI", "2.4G", "20M", "CCK", "1T", "05", "32", - "MKK", "2.4G", "20M", "CCK", "1T", "05", "32", - "FCC", "2.4G", "20M", "CCK", "1T", "06", "36", - "ETSI", "2.4G", "20M", "CCK", "1T", "06", "32", - "MKK", "2.4G", "20M", "CCK", "1T", "06", "32", - "FCC", "2.4G", "20M", "CCK", "1T", "07", "36", - "ETSI", "2.4G", "20M", "CCK", "1T", "07", "32", - "MKK", "2.4G", "20M", "CCK", "1T", "07", "32", - "FCC", "2.4G", "20M", "CCK", "1T", "08", "36", - "ETSI", "2.4G", "20M", "CCK", "1T", "08", "32", - "MKK", "2.4G", "20M", "CCK", "1T", "08", "32", - "FCC", "2.4G", "20M", "CCK", "1T", "09", "36", - "ETSI", "2.4G", "20M", "CCK", "1T", "09", "32", - "MKK", "2.4G", "20M", "CCK", "1T", "09", "32", - "FCC", "2.4G", "20M", "CCK", "1T", "10", "36", - "ETSI", "2.4G", "20M", "CCK", "1T", "10", "32", - "MKK", "2.4G", "20M", "CCK", "1T", "10", "32", - "FCC", "2.4G", "20M", "CCK", "1T", "11", "36", - "ETSI", "2.4G", "20M", "CCK", "1T", "11", "32", - "MKK", "2.4G", "20M", "CCK", "1T", "11", "32", - "FCC", "2.4G", "20M", "CCK", "1T", "12", "63", - "ETSI", "2.4G", "20M", "CCK", "1T", "12", "32", - "MKK", "2.4G", "20M", "CCK", "1T", "12", "32", - "FCC", "2.4G", "20M", "CCK", "1T", "13", "63", - "ETSI", "2.4G", "20M", "CCK", "1T", "13", "32", - "MKK", "2.4G", "20M", "CCK", "1T", "13", "32", - "FCC", "2.4G", "20M", "CCK", "1T", "14", "63", - "ETSI", "2.4G", "20M", "CCK", "1T", "14", "63", - "MKK", "2.4G", "20M", "CCK", "1T", "14", "32", - "FCC", "2.4G", "20M", "OFDM", "1T", "01", "34", - "ETSI", "2.4G", "20M", "OFDM", "1T", "01", "32", - "MKK", "2.4G", "20M", "OFDM", "1T", "01", "32", - "FCC", "2.4G", "20M", "OFDM", "1T", "02", "36", - "ETSI", "2.4G", "20M", "OFDM", "1T", "02", "32", - "MKK", "2.4G", "20M", "OFDM", "1T", "02", "32", - "FCC", "2.4G", "20M", "OFDM", "1T", "03", "36", - "ETSI", "2.4G", "20M", "OFDM", "1T", "03", "32", - "MKK", "2.4G", "20M", "OFDM", "1T", "03", "32", - "FCC", "2.4G", "20M", "OFDM", "1T", "04", "36", - "ETSI", "2.4G", "20M", "OFDM", "1T", "04", "32", - "MKK", "2.4G", "20M", "OFDM", "1T", "04", "32", - "FCC", "2.4G", "20M", "OFDM", "1T", "05", "36", - "ETSI", "2.4G", "20M", "OFDM", "1T", "05", "32", - "MKK", "2.4G", "20M", "OFDM", "1T", "05", "32", - "FCC", "2.4G", "20M", "OFDM", "1T", "06", "36", - "ETSI", "2.4G", "20M", "OFDM", "1T", "06", "32", - "MKK", "2.4G", "20M", "OFDM", "1T", "06", "32", - "FCC", "2.4G", "20M", "OFDM", "1T", "07", "36", - "ETSI", "2.4G", "20M", "OFDM", "1T", "07", "32", - "MKK", "2.4G", "20M", "OFDM", "1T", "07", "32", - "FCC", "2.4G", "20M", "OFDM", "1T", "08", "36", - "ETSI", "2.4G", "20M", "OFDM", "1T", "08", "32", - "MKK", "2.4G", "20M", "OFDM", "1T", "08", "32", - "FCC", "2.4G", "20M", "OFDM", "1T", "09", "36", - "ETSI", "2.4G", "20M", "OFDM", "1T", "09", "32", - "MKK", "2.4G", "20M", "OFDM", "1T", "09", "32", - "FCC", "2.4G", "20M", "OFDM", "1T", "10", "36", - "ETSI", "2.4G", "20M", "OFDM", "1T", "10", "32", - "MKK", "2.4G", "20M", "OFDM", "1T", "10", "32", - "FCC", "2.4G", "20M", "OFDM", "1T", "11", "32", - "ETSI", "2.4G", "20M", "OFDM", "1T", "11", "32", - "MKK", "2.4G", "20M", "OFDM", "1T", "11", "32", - "FCC", "2.4G", "20M", "OFDM", "1T", "12", "63", - "ETSI", "2.4G", "20M", "OFDM", "1T", "12", "32", - "MKK", "2.4G", "20M", "OFDM", "1T", "12", "32", - "FCC", "2.4G", "20M", "OFDM", "1T", "13", "63", - "ETSI", "2.4G", "20M", "OFDM", "1T", "13", "32", - "MKK", "2.4G", "20M", "OFDM", "1T", "13", "32", - "FCC", "2.4G", "20M", "OFDM", "1T", "14", "63", - "ETSI", "2.4G", "20M", "OFDM", "1T", "14", "63", - "MKK", "2.4G", "20M", "OFDM", "1T", "14", "63", - "FCC", "2.4G", "20M", "HT", "1T", "01", "34", - "ETSI", "2.4G", "20M", "HT", "1T", "01", "32", - "MKK", "2.4G", "20M", "HT", "1T", "01", "32", - "FCC", "2.4G", "20M", "HT", "1T", "02", "36", - "ETSI", "2.4G", "20M", "HT", "1T", "02", "32", - "MKK", "2.4G", "20M", "HT", "1T", "02", "32", - "FCC", "2.4G", "20M", "HT", "1T", "03", "36", - "ETSI", "2.4G", "20M", "HT", "1T", "03", "32", - "MKK", "2.4G", "20M", "HT", "1T", "03", "32", - "FCC", "2.4G", "20M", "HT", "1T", "04", "36", - "ETSI", "2.4G", "20M", "HT", "1T", "04", "32", - "MKK", "2.4G", "20M", "HT", "1T", "04", "32", - "FCC", "2.4G", "20M", "HT", "1T", "05", "36", - "ETSI", "2.4G", "20M", "HT", "1T", "05", "32", - "MKK", "2.4G", "20M", "HT", "1T", "05", "32", - "FCC", "2.4G", "20M", "HT", "1T", "06", "36", - "ETSI", "2.4G", "20M", "HT", "1T", "06", "32", - "MKK", "2.4G", "20M", "HT", "1T", "06", "32", - "FCC", "2.4G", "20M", "HT", "1T", "07", "36", - "ETSI", "2.4G", "20M", "HT", "1T", "07", "32", - "MKK", "2.4G", "20M", "HT", "1T", "07", "32", - "FCC", "2.4G", "20M", "HT", "1T", "08", "36", - "ETSI", "2.4G", "20M", "HT", "1T", "08", "32", - "MKK", "2.4G", "20M", "HT", "1T", "08", "32", - "FCC", "2.4G", "20M", "HT", "1T", "09", "36", - "ETSI", "2.4G", "20M", "HT", "1T", "09", "32", - "MKK", "2.4G", "20M", "HT", "1T", "09", "32", - "FCC", "2.4G", "20M", "HT", "1T", "10", "36", - "ETSI", "2.4G", "20M", "HT", "1T", "10", "32", - "MKK", "2.4G", "20M", "HT", "1T", "10", "32", - "FCC", "2.4G", "20M", "HT", "1T", "11", "32", - "ETSI", "2.4G", "20M", "HT", "1T", "11", "32", - "MKK", "2.4G", "20M", "HT", "1T", "11", "32", - "FCC", "2.4G", "20M", "HT", "1T", "12", "63", - "ETSI", "2.4G", "20M", "HT", "1T", "12", "32", - "MKK", "2.4G", "20M", "HT", "1T", "12", "32", - "FCC", "2.4G", "20M", "HT", "1T", "13", "63", - "ETSI", "2.4G", "20M", "HT", "1T", "13", "32", - "MKK", "2.4G", "20M", "HT", "1T", "13", "32", - "FCC", "2.4G", "20M", "HT", "1T", "14", "63", - "ETSI", "2.4G", "20M", "HT", "1T", "14", "63", - "MKK", "2.4G", "20M", "HT", "1T", "14", "63", - "FCC", "2.4G", "20M", "HT", "2T", "01", "32", - "ETSI", "2.4G", "20M", "HT", "2T", "01", "32", - "MKK", "2.4G", "20M", "HT", "2T", "01", "32", - "FCC", "2.4G", "20M", "HT", "2T", "02", "34", - "ETSI", "2.4G", "20M", "HT", "2T", "02", "32", - "MKK", "2.4G", "20M", "HT", "2T", "02", "32", - "FCC", "2.4G", "20M", "HT", "2T", "03", "34", - "ETSI", "2.4G", "20M", "HT", "2T", "03", "32", - "MKK", "2.4G", "20M", "HT", "2T", "03", "32", - "FCC", "2.4G", "20M", "HT", "2T", "04", "34", - "ETSI", "2.4G", "20M", "HT", "2T", "04", "32", - "MKK", "2.4G", "20M", "HT", "2T", "04", "32", - "FCC", "2.4G", "20M", "HT", "2T", "05", "34", - "ETSI", "2.4G", "20M", "HT", "2T", "05", "32", - "MKK", "2.4G", "20M", "HT", "2T", "05", "32", - "FCC", "2.4G", "20M", "HT", "2T", "06", "34", - "ETSI", "2.4G", "20M", "HT", "2T", "06", "32", - "MKK", "2.4G", "20M", "HT", "2T", "06", "32", - "FCC", "2.4G", "20M", "HT", "2T", "07", "34", - "ETSI", "2.4G", "20M", "HT", "2T", "07", "32", - "MKK", "2.4G", "20M", "HT", "2T", "07", "32", - "FCC", "2.4G", "20M", "HT", "2T", "08", "34", - "ETSI", "2.4G", "20M", "HT", "2T", "08", "32", - "MKK", "2.4G", "20M", "HT", "2T", "08", "32", - "FCC", "2.4G", "20M", "HT", "2T", "09", "34", - "ETSI", "2.4G", "20M", "HT", "2T", "09", "32", - "MKK", "2.4G", "20M", "HT", "2T", "09", "32", - "FCC", "2.4G", "20M", "HT", "2T", "10", "34", - "ETSI", "2.4G", "20M", "HT", "2T", "10", "32", - "MKK", "2.4G", "20M", "HT", "2T", "10", "32", - "FCC", "2.4G", "20M", "HT", "2T", "11", "30", - "ETSI", "2.4G", "20M", "HT", "2T", "11", "32", - "MKK", "2.4G", "20M", "HT", "2T", "11", "32", - "FCC", "2.4G", "20M", "HT", "2T", "12", "63", - "ETSI", "2.4G", "20M", "HT", "2T", "12", "32", - "MKK", "2.4G", "20M", "HT", "2T", "12", "32", - "FCC", "2.4G", "20M", "HT", "2T", "13", "63", - "ETSI", "2.4G", "20M", "HT", "2T", "13", "32", - "MKK", "2.4G", "20M", "HT", "2T", "13", "32", - "FCC", "2.4G", "20M", "HT", "2T", "14", "63", - "ETSI", "2.4G", "20M", "HT", "2T", "14", "63", - "MKK", "2.4G", "20M", "HT", "2T", "14", "63", - "FCC", "2.4G", "40M", "HT", "1T", "01", "63", - "ETSI", "2.4G", "40M", "HT", "1T", "01", "63", - "MKK", "2.4G", "40M", "HT", "1T", "01", "63", - "FCC", "2.4G", "40M", "HT", "1T", "02", "63", - "ETSI", "2.4G", "40M", "HT", "1T", "02", "63", - "MKK", "2.4G", "40M", "HT", "1T", "02", "63", - "FCC", "2.4G", "40M", "HT", "1T", "03", "32", - "ETSI", "2.4G", "40M", "HT", "1T", "03", "32", - "MKK", "2.4G", "40M", "HT", "1T", "03", "32", - "FCC", "2.4G", "40M", "HT", "1T", "04", "36", - "ETSI", "2.4G", "40M", "HT", "1T", "04", "32", - "MKK", "2.4G", "40M", "HT", "1T", "04", "32", - "FCC", "2.4G", "40M", "HT", "1T", "05", "36", - "ETSI", "2.4G", "40M", "HT", "1T", "05", "32", - "MKK", "2.4G", "40M", "HT", "1T", "05", "32", - "FCC", "2.4G", "40M", "HT", "1T", "06", "36", - "ETSI", "2.4G", "40M", "HT", "1T", "06", "32", - "MKK", "2.4G", "40M", "HT", "1T", "06", "32", - "FCC", "2.4G", "40M", "HT", "1T", "07", "36", - "ETSI", "2.4G", "40M", "HT", "1T", "07", "32", - "MKK", "2.4G", "40M", "HT", "1T", "07", "32", - "FCC", "2.4G", "40M", "HT", "1T", "08", "36", - "ETSI", "2.4G", "40M", "HT", "1T", "08", "32", - "MKK", "2.4G", "40M", "HT", "1T", "08", "32", - "FCC", "2.4G", "40M", "HT", "1T", "09", "36", - "ETSI", "2.4G", "40M", "HT", "1T", "09", "32", - "MKK", "2.4G", "40M", "HT", "1T", "09", "32", - "FCC", "2.4G", "40M", "HT", "1T", "10", "36", - "ETSI", "2.4G", "40M", "HT", "1T", "10", "32", - "MKK", "2.4G", "40M", "HT", "1T", "10", "32", - "FCC", "2.4G", "40M", "HT", "1T", "11", "32", - "ETSI", "2.4G", "40M", "HT", "1T", "11", "32", - "MKK", "2.4G", "40M", "HT", "1T", "11", "32", - "FCC", "2.4G", "40M", "HT", "1T", "12", "63", - "ETSI", "2.4G", "40M", "HT", "1T", "12", "32", - "MKK", "2.4G", "40M", "HT", "1T", "12", "32", - "FCC", "2.4G", "40M", "HT", "1T", "13", "63", - "ETSI", "2.4G", "40M", "HT", "1T", "13", "32", - "MKK", "2.4G", "40M", "HT", "1T", "13", "32", - "FCC", "2.4G", "40M", "HT", "1T", "14", "63", - "ETSI", "2.4G", "40M", "HT", "1T", "14", "63", - "MKK", "2.4G", "40M", "HT", "1T", "14", "63", - "FCC", "2.4G", "40M", "HT", "2T", "01", "63", - "ETSI", "2.4G", "40M", "HT", "2T", "01", "63", - "MKK", "2.4G", "40M", "HT", "2T", "01", "63", - "FCC", "2.4G", "40M", "HT", "2T", "02", "63", - "ETSI", "2.4G", "40M", "HT", "2T", "02", "63", - "MKK", "2.4G", "40M", "HT", "2T", "02", "63", - "FCC", "2.4G", "40M", "HT", "2T", "03", "30", - "ETSI", "2.4G", "40M", "HT", "2T", "03", "30", - "MKK", "2.4G", "40M", "HT", "2T", "03", "30", - "FCC", "2.4G", "40M", "HT", "2T", "04", "34", - "ETSI", "2.4G", "40M", "HT", "2T", "04", "30", - "MKK", "2.4G", "40M", "HT", "2T", "04", "30", - "FCC", "2.4G", "40M", "HT", "2T", "05", "34", - "ETSI", "2.4G", "40M", "HT", "2T", "05", "30", - "MKK", "2.4G", "40M", "HT", "2T", "05", "30", - "FCC", "2.4G", "40M", "HT", "2T", "06", "34", - "ETSI", "2.4G", "40M", "HT", "2T", "06", "30", - "MKK", "2.4G", "40M", "HT", "2T", "06", "30", - "FCC", "2.4G", "40M", "HT", "2T", "07", "34", - "ETSI", "2.4G", "40M", "HT", "2T", "07", "30", - "MKK", "2.4G", "40M", "HT", "2T", "07", "30", - "FCC", "2.4G", "40M", "HT", "2T", "08", "34", - "ETSI", "2.4G", "40M", "HT", "2T", "08", "30", - "MKK", "2.4G", "40M", "HT", "2T", "08", "30", - "FCC", "2.4G", "40M", "HT", "2T", "09", "34", - "ETSI", "2.4G", "40M", "HT", "2T", "09", "30", - "MKK", "2.4G", "40M", "HT", "2T", "09", "30", - "FCC", "2.4G", "40M", "HT", "2T", "10", "34", - "ETSI", "2.4G", "40M", "HT", "2T", "10", "30", - "MKK", "2.4G", "40M", "HT", "2T", "10", "30", - "FCC", "2.4G", "40M", "HT", "2T", "11", "30", - "ETSI", "2.4G", "40M", "HT", "2T", "11", "30", - "MKK", "2.4G", "40M", "HT", "2T", "11", "30", - "FCC", "2.4G", "40M", "HT", "2T", "12", "63", - "ETSI", "2.4G", "40M", "HT", "2T", "12", "32", - "MKK", "2.4G", "40M", "HT", "2T", "12", "32", - "FCC", "2.4G", "40M", "HT", "2T", "13", "63", - "ETSI", "2.4G", "40M", "HT", "2T", "13", "32", - "MKK", "2.4G", "40M", "HT", "2T", "13", "32", - "FCC", "2.4G", "40M", "HT", "2T", "14", "63", - "ETSI", "2.4G", "40M", "HT", "2T", "14", "63", - "MKK", "2.4G", "40M", "HT", "2T", "14", "63", - "FCC", "5G", "20M", "OFDM", "1T", "36", "30", - "ETSI", "5G", "20M", "OFDM", "1T", "36", "32", - "MKK", "5G", "20M", "OFDM", "1T", "36", "32", - "FCC", "5G", "20M", "OFDM", "1T", "40", "30", - "ETSI", "5G", "20M", "OFDM", "1T", "40", "32", - "MKK", "5G", "20M", "OFDM", "1T", "40", "32", - "FCC", "5G", "20M", "OFDM", "1T", "44", "30", - "ETSI", "5G", "20M", "OFDM", "1T", "44", "32", - "MKK", "5G", "20M", "OFDM", "1T", "44", "32", - "FCC", "5G", "20M", "OFDM", "1T", "48", "30", - "ETSI", "5G", "20M", "OFDM", "1T", "48", "32", - "MKK", "5G", "20M", "OFDM", "1T", "48", "32", - "FCC", "5G", "20M", "OFDM", "1T", "52", "36", - "ETSI", "5G", "20M", "OFDM", "1T", "52", "32", - "MKK", "5G", "20M", "OFDM", "1T", "52", "32", - "FCC", "5G", "20M", "OFDM", "1T", "56", "34", - "ETSI", "5G", "20M", "OFDM", "1T", "56", "32", - "MKK", "5G", "20M", "OFDM", "1T", "56", "32", - "FCC", "5G", "20M", "OFDM", "1T", "60", "32", - "ETSI", "5G", "20M", "OFDM", "1T", "60", "32", - "MKK", "5G", "20M", "OFDM", "1T", "60", "32", - "FCC", "5G", "20M", "OFDM", "1T", "64", "28", - "ETSI", "5G", "20M", "OFDM", "1T", "64", "32", - "MKK", "5G", "20M", "OFDM", "1T", "64", "32", - "FCC", "5G", "20M", "OFDM", "1T", "100", "30", - "ETSI", "5G", "20M", "OFDM", "1T", "100", "32", - "MKK", "5G", "20M", "OFDM", "1T", "100", "32", - "FCC", "5G", "20M", "OFDM", "1T", "114", "30", - "ETSI", "5G", "20M", "OFDM", "1T", "114", "32", - "MKK", "5G", "20M", "OFDM", "1T", "114", "32", - "FCC", "5G", "20M", "OFDM", "1T", "108", "32", - "ETSI", "5G", "20M", "OFDM", "1T", "108", "32", - "MKK", "5G", "20M", "OFDM", "1T", "108", "32", - "FCC", "5G", "20M", "OFDM", "1T", "112", "34", - "ETSI", "5G", "20M", "OFDM", "1T", "112", "32", - "MKK", "5G", "20M", "OFDM", "1T", "112", "32", - "FCC", "5G", "20M", "OFDM", "1T", "116", "34", - "ETSI", "5G", "20M", "OFDM", "1T", "116", "32", - "MKK", "5G", "20M", "OFDM", "1T", "116", "32", - "FCC", "5G", "20M", "OFDM", "1T", "120", "36", - "ETSI", "5G", "20M", "OFDM", "1T", "120", "32", - "MKK", "5G", "20M", "OFDM", "1T", "120", "32", - "FCC", "5G", "20M", "OFDM", "1T", "124", "34", - "ETSI", "5G", "20M", "OFDM", "1T", "124", "32", - "MKK", "5G", "20M", "OFDM", "1T", "124", "32", - "FCC", "5G", "20M", "OFDM", "1T", "128", "32", - "ETSI", "5G", "20M", "OFDM", "1T", "128", "32", - "MKK", "5G", "20M", "OFDM", "1T", "128", "32", - "FCC", "5G", "20M", "OFDM", "1T", "132", "30", - "ETSI", "5G", "20M", "OFDM", "1T", "132", "32", - "MKK", "5G", "20M", "OFDM", "1T", "132", "32", - "FCC", "5G", "20M", "OFDM", "1T", "136", "30", - "ETSI", "5G", "20M", "OFDM", "1T", "136", "32", - "MKK", "5G", "20M", "OFDM", "1T", "136", "32", - "FCC", "5G", "20M", "OFDM", "1T", "140", "28", - "ETSI", "5G", "20M", "OFDM", "1T", "140", "32", - "MKK", "5G", "20M", "OFDM", "1T", "140", "32", - "FCC", "5G", "20M", "OFDM", "1T", "149", "36", - "ETSI", "5G", "20M", "OFDM", "1T", "149", "32", - "MKK", "5G", "20M", "OFDM", "1T", "149", "63", - "FCC", "5G", "20M", "OFDM", "1T", "153", "36", - "ETSI", "5G", "20M", "OFDM", "1T", "153", "32", - "MKK", "5G", "20M", "OFDM", "1T", "153", "63", - "FCC", "5G", "20M", "OFDM", "1T", "157", "36", - "ETSI", "5G", "20M", "OFDM", "1T", "157", "32", - "MKK", "5G", "20M", "OFDM", "1T", "157", "63", - "FCC", "5G", "20M", "OFDM", "1T", "161", "36", - "ETSI", "5G", "20M", "OFDM", "1T", "161", "32", - "MKK", "5G", "20M", "OFDM", "1T", "161", "63", - "FCC", "5G", "20M", "OFDM", "1T", "165", "36", - "ETSI", "5G", "20M", "OFDM", "1T", "165", "32", - "MKK", "5G", "20M", "OFDM", "1T", "165", "63", - "FCC", "5G", "20M", "HT", "1T", "36", "30", - "ETSI", "5G", "20M", "HT", "1T", "36", "32", - "MKK", "5G", "20M", "HT", "1T", "36", "32", - "FCC", "5G", "20M", "HT", "1T", "40", "30", - "ETSI", "5G", "20M", "HT", "1T", "40", "32", - "MKK", "5G", "20M", "HT", "1T", "40", "32", - "FCC", "5G", "20M", "HT", "1T", "44", "30", - "ETSI", "5G", "20M", "HT", "1T", "44", "32", - "MKK", "5G", "20M", "HT", "1T", "44", "32", - "FCC", "5G", "20M", "HT", "1T", "48", "30", - "ETSI", "5G", "20M", "HT", "1T", "48", "32", - "MKK", "5G", "20M", "HT", "1T", "48", "32", - "FCC", "5G", "20M", "HT", "1T", "52", "36", - "ETSI", "5G", "20M", "HT", "1T", "52", "32", - "MKK", "5G", "20M", "HT", "1T", "52", "32", - "FCC", "5G", "20M", "HT", "1T", "56", "34", - "ETSI", "5G", "20M", "HT", "1T", "56", "32", - "MKK", "5G", "20M", "HT", "1T", "56", "32", - "FCC", "5G", "20M", "HT", "1T", "60", "32", - "ETSI", "5G", "20M", "HT", "1T", "60", "32", - "MKK", "5G", "20M", "HT", "1T", "60", "32", - "FCC", "5G", "20M", "HT", "1T", "64", "28", - "ETSI", "5G", "20M", "HT", "1T", "64", "32", - "MKK", "5G", "20M", "HT", "1T", "64", "32", - "FCC", "5G", "20M", "HT", "1T", "100", "30", - "ETSI", "5G", "20M", "HT", "1T", "100", "32", - "MKK", "5G", "20M", "HT", "1T", "100", "32", - "FCC", "5G", "20M", "HT", "1T", "114", "30", - "ETSI", "5G", "20M", "HT", "1T", "114", "32", - "MKK", "5G", "20M", "HT", "1T", "114", "32", - "FCC", "5G", "20M", "HT", "1T", "108", "32", - "ETSI", "5G", "20M", "HT", "1T", "108", "32", - "MKK", "5G", "20M", "HT", "1T", "108", "32", - "FCC", "5G", "20M", "HT", "1T", "112", "34", - "ETSI", "5G", "20M", "HT", "1T", "112", "32", - "MKK", "5G", "20M", "HT", "1T", "112", "32", - "FCC", "5G", "20M", "HT", "1T", "116", "34", - "ETSI", "5G", "20M", "HT", "1T", "116", "32", - "MKK", "5G", "20M", "HT", "1T", "116", "32", - "FCC", "5G", "20M", "HT", "1T", "120", "36", - "ETSI", "5G", "20M", "HT", "1T", "120", "32", - "MKK", "5G", "20M", "HT", "1T", "120", "32", - "FCC", "5G", "20M", "HT", "1T", "124", "34", - "ETSI", "5G", "20M", "HT", "1T", "124", "32", - "MKK", "5G", "20M", "HT", "1T", "124", "32", - "FCC", "5G", "20M", "HT", "1T", "128", "32", - "ETSI", "5G", "20M", "HT", "1T", "128", "32", - "MKK", "5G", "20M", "HT", "1T", "128", "32", - "FCC", "5G", "20M", "HT", "1T", "132", "30", - "ETSI", "5G", "20M", "HT", "1T", "132", "32", - "MKK", "5G", "20M", "HT", "1T", "132", "32", - "FCC", "5G", "20M", "HT", "1T", "136", "30", - "ETSI", "5G", "20M", "HT", "1T", "136", "32", - "MKK", "5G", "20M", "HT", "1T", "136", "32", - "FCC", "5G", "20M", "HT", "1T", "140", "28", - "ETSI", "5G", "20M", "HT", "1T", "140", "32", - "MKK", "5G", "20M", "HT", "1T", "140", "32", - "FCC", "5G", "20M", "HT", "1T", "149", "36", - "ETSI", "5G", "20M", "HT", "1T", "149", "32", - "MKK", "5G", "20M", "HT", "1T", "149", "63", - "FCC", "5G", "20M", "HT", "1T", "153", "36", - "ETSI", "5G", "20M", "HT", "1T", "153", "32", - "MKK", "5G", "20M", "HT", "1T", "153", "63", - "FCC", "5G", "20M", "HT", "1T", "157", "36", - "ETSI", "5G", "20M", "HT", "1T", "157", "32", - "MKK", "5G", "20M", "HT", "1T", "157", "63", - "FCC", "5G", "20M", "HT", "1T", "161", "36", - "ETSI", "5G", "20M", "HT", "1T", "161", "32", - "MKK", "5G", "20M", "HT", "1T", "161", "63", - "FCC", "5G", "20M", "HT", "1T", "165", "36", - "ETSI", "5G", "20M", "HT", "1T", "165", "32", - "MKK", "5G", "20M", "HT", "1T", "165", "63", - "FCC", "5G", "20M", "HT", "2T", "36", "28", - "ETSI", "5G", "20M", "HT", "2T", "36", "30", - "MKK", "5G", "20M", "HT", "2T", "36", "30", - "FCC", "5G", "20M", "HT", "2T", "40", "28", - "ETSI", "5G", "20M", "HT", "2T", "40", "30", - "MKK", "5G", "20M", "HT", "2T", "40", "30", - "FCC", "5G", "20M", "HT", "2T", "44", "28", - "ETSI", "5G", "20M", "HT", "2T", "44", "30", - "MKK", "5G", "20M", "HT", "2T", "44", "30", - "FCC", "5G", "20M", "HT", "2T", "48", "28", - "ETSI", "5G", "20M", "HT", "2T", "48", "30", - "MKK", "5G", "20M", "HT", "2T", "48", "30", - "FCC", "5G", "20M", "HT", "2T", "52", "34", - "ETSI", "5G", "20M", "HT", "2T", "52", "30", - "MKK", "5G", "20M", "HT", "2T", "52", "30", - "FCC", "5G", "20M", "HT", "2T", "56", "32", - "ETSI", "5G", "20M", "HT", "2T", "56", "30", - "MKK", "5G", "20M", "HT", "2T", "56", "30", - "FCC", "5G", "20M", "HT", "2T", "60", "30", - "ETSI", "5G", "20M", "HT", "2T", "60", "30", - "MKK", "5G", "20M", "HT", "2T", "60", "30", - "FCC", "5G", "20M", "HT", "2T", "64", "26", - "ETSI", "5G", "20M", "HT", "2T", "64", "30", - "MKK", "5G", "20M", "HT", "2T", "64", "30", - "FCC", "5G", "20M", "HT", "2T", "100", "28", - "ETSI", "5G", "20M", "HT", "2T", "100", "30", - "MKK", "5G", "20M", "HT", "2T", "100", "30", - "FCC", "5G", "20M", "HT", "2T", "114", "28", - "ETSI", "5G", "20M", "HT", "2T", "114", "30", - "MKK", "5G", "20M", "HT", "2T", "114", "30", - "FCC", "5G", "20M", "HT", "2T", "108", "30", - "ETSI", "5G", "20M", "HT", "2T", "108", "30", - "MKK", "5G", "20M", "HT", "2T", "108", "30", - "FCC", "5G", "20M", "HT", "2T", "112", "32", - "ETSI", "5G", "20M", "HT", "2T", "112", "30", - "MKK", "5G", "20M", "HT", "2T", "112", "30", - "FCC", "5G", "20M", "HT", "2T", "116", "32", - "ETSI", "5G", "20M", "HT", "2T", "116", "30", - "MKK", "5G", "20M", "HT", "2T", "116", "30", - "FCC", "5G", "20M", "HT", "2T", "120", "34", - "ETSI", "5G", "20M", "HT", "2T", "120", "30", - "MKK", "5G", "20M", "HT", "2T", "120", "30", - "FCC", "5G", "20M", "HT", "2T", "124", "32", - "ETSI", "5G", "20M", "HT", "2T", "124", "30", - "MKK", "5G", "20M", "HT", "2T", "124", "30", - "FCC", "5G", "20M", "HT", "2T", "128", "30", - "ETSI", "5G", "20M", "HT", "2T", "128", "30", - "MKK", "5G", "20M", "HT", "2T", "128", "30", - "FCC", "5G", "20M", "HT", "2T", "132", "28", - "ETSI", "5G", "20M", "HT", "2T", "132", "30", - "MKK", "5G", "20M", "HT", "2T", "132", "30", - "FCC", "5G", "20M", "HT", "2T", "136", "28", - "ETSI", "5G", "20M", "HT", "2T", "136", "30", - "MKK", "5G", "20M", "HT", "2T", "136", "30", - "FCC", "5G", "20M", "HT", "2T", "140", "26", - "ETSI", "5G", "20M", "HT", "2T", "140", "30", - "MKK", "5G", "20M", "HT", "2T", "140", "30", - "FCC", "5G", "20M", "HT", "2T", "149", "34", - "ETSI", "5G", "20M", "HT", "2T", "149", "30", - "MKK", "5G", "20M", "HT", "2T", "149", "63", - "FCC", "5G", "20M", "HT", "2T", "153", "34", - "ETSI", "5G", "20M", "HT", "2T", "153", "30", - "MKK", "5G", "20M", "HT", "2T", "153", "63", - "FCC", "5G", "20M", "HT", "2T", "157", "34", - "ETSI", "5G", "20M", "HT", "2T", "157", "30", - "MKK", "5G", "20M", "HT", "2T", "157", "63", - "FCC", "5G", "20M", "HT", "2T", "161", "34", - "ETSI", "5G", "20M", "HT", "2T", "161", "30", - "MKK", "5G", "20M", "HT", "2T", "161", "63", - "FCC", "5G", "20M", "HT", "2T", "165", "34", - "ETSI", "5G", "20M", "HT", "2T", "165", "30", - "MKK", "5G", "20M", "HT", "2T", "165", "63", - "FCC", "5G", "40M", "HT", "1T", "38", "30", - "ETSI", "5G", "40M", "HT", "1T", "38", "32", - "MKK", "5G", "40M", "HT", "1T", "38", "32", - "FCC", "5G", "40M", "HT", "1T", "46", "30", - "ETSI", "5G", "40M", "HT", "1T", "46", "32", - "MKK", "5G", "40M", "HT", "1T", "46", "32", - "FCC", "5G", "40M", "HT", "1T", "54", "32", - "ETSI", "5G", "40M", "HT", "1T", "54", "32", - "MKK", "5G", "40M", "HT", "1T", "54", "32", - "FCC", "5G", "40M", "HT", "1T", "62", "32", - "ETSI", "5G", "40M", "HT", "1T", "62", "32", - "MKK", "5G", "40M", "HT", "1T", "62", "32", - "FCC", "5G", "40M", "HT", "1T", "102", "28", - "ETSI", "5G", "40M", "HT", "1T", "102", "32", - "MKK", "5G", "40M", "HT", "1T", "102", "32", - "FCC", "5G", "40M", "HT", "1T", "110", "32", - "ETSI", "5G", "40M", "HT", "1T", "110", "32", - "MKK", "5G", "40M", "HT", "1T", "110", "32", - "FCC", "5G", "40M", "HT", "1T", "118", "36", - "ETSI", "5G", "40M", "HT", "1T", "118", "32", - "MKK", "5G", "40M", "HT", "1T", "118", "32", - "FCC", "5G", "40M", "HT", "1T", "126", "34", - "ETSI", "5G", "40M", "HT", "1T", "126", "32", - "MKK", "5G", "40M", "HT", "1T", "126", "32", - "FCC", "5G", "40M", "HT", "1T", "134", "32", - "ETSI", "5G", "40M", "HT", "1T", "134", "32", - "MKK", "5G", "40M", "HT", "1T", "134", "32", - "FCC", "5G", "40M", "HT", "1T", "151", "36", - "ETSI", "5G", "40M", "HT", "1T", "151", "32", - "MKK", "5G", "40M", "HT", "1T", "151", "63", - "FCC", "5G", "40M", "HT", "1T", "159", "36", - "ETSI", "5G", "40M", "HT", "1T", "159", "32", - "MKK", "5G", "40M", "HT", "1T", "159", "63", - "FCC", "5G", "40M", "HT", "2T", "38", "28", - "ETSI", "5G", "40M", "HT", "2T", "38", "30", - "MKK", "5G", "40M", "HT", "2T", "38", "30", - "FCC", "5G", "40M", "HT", "2T", "46", "28", - "ETSI", "5G", "40M", "HT", "2T", "46", "30", - "MKK", "5G", "40M", "HT", "2T", "46", "30", - "FCC", "5G", "40M", "HT", "2T", "54", "30", - "ETSI", "5G", "40M", "HT", "2T", "54", "30", - "MKK", "5G", "40M", "HT", "2T", "54", "30", - "FCC", "5G", "40M", "HT", "2T", "62", "30", - "ETSI", "5G", "40M", "HT", "2T", "62", "30", - "MKK", "5G", "40M", "HT", "2T", "62", "30", - "FCC", "5G", "40M", "HT", "2T", "102", "26", - "ETSI", "5G", "40M", "HT", "2T", "102", "30", - "MKK", "5G", "40M", "HT", "2T", "102", "30", - "FCC", "5G", "40M", "HT", "2T", "110", "30", - "ETSI", "5G", "40M", "HT", "2T", "110", "30", - "MKK", "5G", "40M", "HT", "2T", "110", "30", - "FCC", "5G", "40M", "HT", "2T", "118", "34", - "ETSI", "5G", "40M", "HT", "2T", "118", "30", - "MKK", "5G", "40M", "HT", "2T", "118", "30", - "FCC", "5G", "40M", "HT", "2T", "126", "32", - "ETSI", "5G", "40M", "HT", "2T", "126", "30", - "MKK", "5G", "40M", "HT", "2T", "126", "30", - "FCC", "5G", "40M", "HT", "2T", "134", "30", - "ETSI", "5G", "40M", "HT", "2T", "134", "30", - "MKK", "5G", "40M", "HT", "2T", "134", "30", - "FCC", "5G", "40M", "HT", "2T", "151", "34", - "ETSI", "5G", "40M", "HT", "2T", "151", "30", - "MKK", "5G", "40M", "HT", "2T", "151", "63", - "FCC", "5G", "40M", "HT", "2T", "159", "34", - "ETSI", "5G", "40M", "HT", "2T", "159", "30", - "MKK", "5G", "40M", "HT", "2T", "159", "63", - "FCC", "5G", "80M", "VHT", "1T", "42", "30", - "ETSI", "5G", "80M", "VHT", "1T", "42", "32", - "MKK", "5G", "80M", "VHT", "1T", "42", "32", - "FCC", "5G", "80M", "VHT", "1T", "58", "28", - "ETSI", "5G", "80M", "VHT", "1T", "58", "32", - "MKK", "5G", "80M", "VHT", "1T", "58", "32", - "FCC", "5G", "80M", "VHT", "1T", "106", "30", - "ETSI", "5G", "80M", "VHT", "1T", "106", "32", - "MKK", "5G", "80M", "VHT", "1T", "106", "32", - "FCC", "5G", "80M", "VHT", "1T", "122", "34", - "ETSI", "5G", "80M", "VHT", "1T", "122", "32", - "MKK", "5G", "80M", "VHT", "1T", "122", "32", - "FCC", "5G", "80M", "VHT", "1T", "155", "36", - "ETSI", "5G", "80M", "VHT", "1T", "155", "32", - "MKK", "5G", "80M", "VHT", "1T", "155", "63", - "FCC", "5G", "80M", "VHT", "2T", "42", "28", - "ETSI", "5G", "80M", "VHT", "2T", "42", "30", - "MKK", "5G", "80M", "VHT", "2T", "42", "30", - "FCC", "5G", "80M", "VHT", "2T", "58", "26", - "ETSI", "5G", "80M", "VHT", "2T", "58", "30", - "MKK", "5G", "80M", "VHT", "2T", "58", "30", - "FCC", "5G", "80M", "VHT", "2T", "106", "28", - "ETSI", "5G", "80M", "VHT", "2T", "106", "30", - "MKK", "5G", "80M", "VHT", "2T", "106", "30", - "FCC", "5G", "80M", "VHT", "2T", "122", "32", - "ETSI", "5G", "80M", "VHT", "2T", "122", "30", - "MKK", "5G", "80M", "VHT", "2T", "122", "30", - "FCC", "5G", "80M", "VHT", "2T", "155", "34", - "ETSI", "5G", "80M", "VHT", "2T", "155", "30", - "MKK", "5G", "80M", "VHT", "2T", "155", "63" -}; -#else -pu1Byte Array_TC_8812A_TXPWR_LMT[] = { - 0x0, }; - -#endif - -void -ODM_ReadAndConfig_TC_8812A_TXPWR_LMT( - IN PDM_ODM_T pDM_Odm - ) -{ - u4Byte i = 0; - u4Byte ArrayLen = sizeof(Array_TC_8812A_TXPWR_LMT)/sizeof(pu1Byte); - pu1Byte *Array = Array_TC_8812A_TXPWR_LMT; - - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_TC_8812A_TXPWR_LMT\n")); - - for (i = 0; i < ArrayLen; i += 7 ) - { - pu1Byte regulation = Array[i]; - pu1Byte band = Array[i+1]; - pu1Byte bandwidth = Array[i+2]; - pu1Byte rate = Array[i+3]; - pu1Byte rfPath = Array[i+4]; - pu1Byte chnl = Array[i+5]; - pu1Byte val = Array[i+6]; - - odm_ConfigBB_TXPWR_LMT_8812A(pDM_Odm, regulation, band, bandwidth, rate, rfPath, chnl, val); - } - -} - -#endif // end of HWIMG_SUPPORT - diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalPhyRf_8812A.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalPhyRf_8812A.c index 52f48086819a16..666a04845e6aa6 100755 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalPhyRf_8812A.c +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalPhyRf_8812A.c @@ -18,7 +18,8 @@ * ******************************************************************************/ -#include "../odm_precomp.h" +#include "Mp_Precomp.h" +#include "../phydm_precomp.h" @@ -48,34 +49,8 @@ void DoIQK_8812A( ODM_ResetIQKResult(pDM_Odm); -#if(DM_ODM_SUPPORT_TYPE & ODM_WIN) -#if (DEV_BUS_TYPE == RT_PCI_INTERFACE) -#if USE_WORKITEM - PlatformAcquireMutex(&pHalData->mxChnlBwControl); -#else - PlatformAcquireSpinLock(Adapter, RT_CHANNEL_AND_BANDWIDTH_SPINLOCK); -#endif -#elif((DEV_BUS_TYPE == RT_USB_INTERFACE) || (DEV_BUS_TYPE == RT_SDIO_INTERFACE)) - PlatformAcquireMutex(&pHalData->mxChnlBwControl); -#endif -#endif - - pDM_Odm->RFCalibrateInfo.ThermalValue_IQK= ThermalValue; PHY_IQCalibrate_8812A(Adapter, FALSE); - - -#if(DM_ODM_SUPPORT_TYPE & ODM_WIN) -#if (DEV_BUS_TYPE == RT_PCI_INTERFACE) -#if USE_WORKITEM - PlatformReleaseMutex(&pHalData->mxChnlBwControl); -#else - PlatformReleaseSpinLock(Adapter, RT_CHANNEL_AND_BANDWIDTH_SPINLOCK); -#endif -#elif((DEV_BUS_TYPE == RT_USB_INTERFACE) || (DEV_BUS_TYPE == RT_SDIO_INTERFACE)) - PlatformReleaseMutex(&pHalData->mxChnlBwControl); -#endif -#endif } /*----------------------------------------------------------------------------- @@ -114,8 +89,7 @@ ODM_TxPwrTrackSetPwr8812A( u1Byte Final_CCK_Swing_Index = 0; u1Byte i = 0; -#if (MP_DRIVER==1) - if ( *(pDM_Odm->mp_mode) == 1) + if (pDM_Odm->mp_mode == TRUE) { #if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE )) #if (DM_ODM_SUPPORT_TYPE & (ODM_WIN)) @@ -127,7 +101,6 @@ ODM_TxPwrTrackSetPwr8812A( #endif } else -#endif { u2Byte rate = *(pDM_Odm->pForcedDataRate); @@ -251,7 +224,7 @@ ODM_TxPwrTrackSetPwr8812A( ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,("******Path_A Over BBSwing Limit , PwrTrackingLimit = %d , Remnant TxAGC Value = %d \n", PwrTrackingLimit, pDM_Odm->Remnant_OFDMSwingIdx[RFPath])); } - else if (Final_OFDM_Swing_Index < 0) + else if (Final_OFDM_Swing_Index <= 0) { pDM_Odm->Remnant_CCKSwingIdx= Final_CCK_Swing_Index; // CCK Follow the same compensate value as Path A pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = Final_OFDM_Swing_Index; @@ -298,7 +271,7 @@ ODM_TxPwrTrackSetPwr8812A( ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,("******Path_B Over BBSwing Limit , PwrTrackingLimit = %d , Remnant TxAGC Value = %d \n", PwrTrackingLimit, pDM_Odm->Remnant_OFDMSwingIdx[RFPath])); } - else if (Final_OFDM_Swing_Index < 0) + else if (Final_OFDM_Swing_Index <= 0) { pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = Final_OFDM_Swing_Index; @@ -406,43 +379,6 @@ void ConfigureTxpowerTrack_8812A( } -// -// 2011/07/26 MH Add an API for testing IQK fail case. -// -// MP Already declare in odm.c -#if !(DM_ODM_SUPPORT_TYPE & ODM_WIN) -BOOLEAN -ODM_CheckPowerStatus( - IN PADAPTER Adapter) -{ -/* - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc; - RT_RF_POWER_STATE rtState; - PMGNT_INFO pMgntInfo = &(Adapter->MgntInfo); - - // 2011/07/27 MH We are not testing ready~~!! We may fail to get correct value when init sequence. - if (pMgntInfo->init_adpt_in_progress == TRUE) - { - ODM_RT_TRACE(pDM_Odm,COMP_INIT, DBG_LOUD, ("ODM_CheckPowerStatus Return TRUE, due to initadapter")); - return TRUE; - } - - // - // 2011/07/19 MH We can not execute tx pwoer tracking/ LLC calibrate or IQK. - // - Adapter->HalFunc.GetHwRegHandler(Adapter, HW_VAR_RF_STATE, (pu1Byte)(&rtState)); - if(Adapter->bDriverStopped || Adapter->bDriverIsGoingToPnpSetPowerSleep || rtState == eRfOff) - { - ODM_RT_TRACE(pDM_Odm,COMP_INIT, DBG_LOUD, ("ODM_CheckPowerStatus Return FALSE, due to %d/%d/%d\n", - Adapter->bDriverStopped, Adapter->bDriverIsGoingToPnpSetPowerSleep, rtState)); - return FALSE; - } -*/ - return TRUE; -} -#endif - #define BW_20M 0 #define BW_40M 1 #define BW_80M 2 @@ -458,7 +394,7 @@ void _IQK_RX_FillIQC_8812A( case ODM_RF_PATH_A: { ODM_SetBBReg(pDM_Odm, 0x82c, BIT(31), 0x0); // [31] = 0 --> Page C - if (RX_X>>1 ==0x112 || RX_Y>>1 == 0x3ee){ + if (RX_X>>1 >=0x112 || (RX_Y>>1 >= 0x12 && RX_Y>>1 <= 0x3ee)){ ODM_SetBBReg(pDM_Odm, 0xc10, 0x000003ff, 0x100); ODM_SetBBReg(pDM_Odm, 0xc10, 0x03ff0000, 0); ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("RX_X = %x;;RX_Y = %x ====>fill to IQC\n", RX_X>>1&0x000003ff, RX_Y>>1&0x000003ff)); @@ -474,7 +410,7 @@ void _IQK_RX_FillIQC_8812A( case ODM_RF_PATH_B: { ODM_SetBBReg(pDM_Odm, 0x82c, BIT(31), 0x0); // [31] = 0 --> Page C - if (RX_X>>1 ==0x112 || RX_Y>>1 == 0x3ee){ + if (RX_X>>1 >=0x112 || (RX_Y>>1 >= 0x12 && RX_Y>>1 <= 0x3ee)){ ODM_SetBBReg(pDM_Odm, 0xe10, 0x000003ff, 0x100); ODM_SetBBReg(pDM_Odm, 0xe10, 0x03ff0000, 0); ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("RX_X = %x;;RX_Y = %x ====>fill to IQC\n", RX_X>>1&0x000003ff, RX_Y>>1&0x000003ff)); @@ -549,7 +485,6 @@ void _IQK_BackupMacBB_8812A( ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("BackupMacBB Success!!!!\n")); } - void _IQK_BackupRF_8812A( IN PDM_ODM_T pDM_Odm, IN pu4Byte RFA_backup, @@ -568,7 +503,6 @@ void _IQK_BackupRF_8812A( } ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("BackupRF Success!!!!\n")); } - void _IQK_BackupAFE_8812A( IN PDM_ODM_T pDM_Odm, IN pu4Byte AFE_backup, @@ -584,7 +518,6 @@ void _IQK_BackupAFE_8812A( } ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("BackupAFE Success!!!!\n")); } - void _IQK_RestoreMacBB_8812A( IN PDM_ODM_T pDM_Odm, IN pu4Byte MACBB_backup, @@ -600,7 +533,6 @@ void _IQK_RestoreMacBB_8812A( } ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("RestoreMacBB Success!!!!\n")); } - void _IQK_RestoreRF_8812A( IN PDM_ODM_T pDM_Odm, IN ODM_RF_RADIO_PATH_E Path, @@ -632,7 +564,6 @@ void _IQK_RestoreRF_8812A( break; } } - void _IQK_RestoreAFE_8812A( IN PDM_ODM_T pDM_Odm, IN pu4Byte AFE_backup, @@ -670,6 +601,7 @@ void _IQK_RestoreAFE_8812A( ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("RestoreAFE Success!!!!\n")); } + void _IQK_ConfigureMAC_8812A( IN PDM_ODM_T pDM_Odm ) @@ -680,6 +612,7 @@ void _IQK_ConfigureMAC_8812A( ODM_SetBBReg(pDM_Odm, 0x550, BIT(11)|BIT(3), 0x0); ODM_Write1Byte(pDM_Odm, 0x808, 0x00); // RX ante off ODM_SetBBReg(pDM_Odm, 0x838, 0xf, 0xc); // CCA off + ODM_Write1Byte(pDM_Odm, 0xa07, 0xf); // CCK RX Path off } #define cal_num 10 @@ -740,7 +673,6 @@ void _IQK_Tx_8812A( ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x65, bRFRegOffsetMask, 0x931d5); ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_B, 0x8f, bRFRegOffsetMask, 0x8a001); ODM_Write4Byte(pDM_Odm, 0x90c, 0x00008000); - ODM_Write4Byte(pDM_Odm, 0xb00, 0x03000100); ODM_SetBBReg(pDM_Odm, 0xc94, BIT(0), 0x1); ODM_SetBBReg(pDM_Odm, 0xe94, BIT(0), 0x1); ODM_Write4Byte(pDM_Odm, 0x978, 0x29002000);// TX (X,Y) @@ -749,7 +681,7 @@ void _IQK_Tx_8812A( ODM_SetBBReg(pDM_Odm, 0x82c, BIT(31), 0x1); // [31] = 1 --> Page C1 if (pDM_Odm->ExtPA5G){ - if (pDM_Odm->SupportInterface == 1 && pDM_Odm->RFEType == 1){ + if (pDM_Odm->RFEType == 1){ ODM_Write4Byte(pDM_Odm, 0xc88, 0x821403e3); ODM_Write4Byte(pDM_Odm, 0xe88, 0x821403e3); } @@ -795,7 +727,7 @@ void _IQK_Tx_8812A( ODM_Write4Byte(pDM_Odm, 0x980, 0xfa000000); ODM_Write4Byte(pDM_Odm, 0x980, 0xf8000000); - ODM_delay_ms(10); //Delay 25ms + ODM_delay_ms(10); //Delay 10ms ODM_Write4Byte(pDM_Odm, 0xcb8, 0x00000000); ODM_Write4Byte(pDM_Odm, 0xeb8, 0x00000000); delay_count = 0; @@ -955,15 +887,24 @@ void _IQK_Tx_8812A( ODM_SetBBReg(pDM_Odm, 0x978, BIT(31), 0x1); ODM_SetBBReg(pDM_Odm, 0x97c, BIT(31), 0x0); ODM_Write4Byte(pDM_Odm, 0x90c, 0x00008000); - if (pDM_Odm->SupportInterface == 1 && pDM_Odm->RFEType == 1) + if (pDM_Odm->SupportInterface == ODM_ITRF_PCIE) ODM_Write4Byte(pDM_Odm, 0x984, 0x0046a911); else ODM_Write4Byte(pDM_Odm, 0x984, 0x0046a890); //ODM_Write4Byte(pDM_Odm, 0x984, 0x0046a890); + if (pDM_Odm->RFEType == 1){ ODM_Write4Byte(pDM_Odm, 0xcb0, 0x77777717); ODM_Write4Byte(pDM_Odm, 0xcb4, 0x00000077); ODM_Write4Byte(pDM_Odm, 0xeb0, 0x77777717); ODM_Write4Byte(pDM_Odm, 0xeb4, 0x00000077); + } + else{ + ODM_Write4Byte(pDM_Odm, 0xcb0, 0x77777717); + ODM_Write4Byte(pDM_Odm, 0xcb4, 0x02000077); + ODM_Write4Byte(pDM_Odm, 0xeb0, 0x77777717); + ODM_Write4Byte(pDM_Odm, 0xeb4, 0x02000077); + } + ODM_SetBBReg(pDM_Odm, 0x82c, BIT(31), 0x1); // [31] = 1 --> Page C1 if (TX0_finish){ @@ -985,7 +926,7 @@ void _IQK_Tx_8812A( ODM_SetBBReg(pDM_Odm, 0x978, 0x03FF8000, (TX_IQC[0])&0x000007ff); ODM_SetBBReg(pDM_Odm, 0x978, 0x000007FF, (TX_IQC[1])&0x000007ff); ODM_SetBBReg(pDM_Odm, 0x82c, BIT(31), 0x1); // [31] = 1 --> Page C1 - if (pDM_Odm->SupportInterface == 1 && pDM_Odm->RFEType == 1){ + if (pDM_Odm->RFEType == 1){ ODM_Write4Byte(pDM_Odm, 0xc8c, 0x28161500); } else{ @@ -1002,8 +943,8 @@ void _IQK_Tx_8812A( ODM_SetBBReg(pDM_Odm, 0x978, 0x03FF8000, (TX_IQC[2])&0x000007ff); ODM_SetBBReg(pDM_Odm, 0x978, 0x000007FF, (TX_IQC[3])&0x000007ff); ODM_SetBBReg(pDM_Odm, 0x82c, BIT(31), 0x1); // [31] = 1 --> Page C1 - if (pDM_Odm->SupportInterface == 1 && pDM_Odm->RFEType == 1){ - ODM_Write4Byte(pDM_Odm, 0xe8c, 0x28161900); + if (pDM_Odm->RFEType == 1){ + ODM_Write4Byte(pDM_Odm, 0xe8c, 0x28161500); } else{ ODM_Write4Byte(pDM_Odm, 0xe8c, 0x28160ca0); @@ -1155,7 +1096,7 @@ void _IQK_Tx_8812A( - if (RX0_finish == 1){ + if (RX0_finish){ _IQK_RX_FillIQC_8812A(pDM_Odm, ODM_RF_PATH_A, RX_IQC[0], RX_IQC[1]); } else{ @@ -1173,7 +1114,7 @@ void _IQK_Tx_8812A( - if (RX1_finish == 1){ + if (RX1_finish){ _IQK_RX_FillIQC_8812A(pDM_Odm, ODM_RF_PATH_B, RX_IQC[2], RX_IQC[3]); } else{ @@ -1184,7 +1125,7 @@ void _IQK_Tx_8812A( } -#define MACBB_REG_NUM 10 +#define MACBB_REG_NUM 9 #define AFE_REG_NUM 12 #define RF_REG_NUM 3 @@ -1195,8 +1136,8 @@ phy_IQCalibrate_8812A( IN u1Byte Channel ) { - u4Byte MACBB_backup[MACBB_REG_NUM], AFE_backup[AFE_REG_NUM], RFA_backup[RF_REG_NUM], RFB_backup[RF_REG_NUM]; - u4Byte Backup_MACBB_REG[MACBB_REG_NUM] = {0xb00, 0x520, 0x550, 0x808, 0x90c, 0xc00, 0xe00, 0x838, 0x82c}; + u4Byte MACBB_backup[MACBB_REG_NUM], AFE_backup[AFE_REG_NUM] = {0}, RFA_backup[RF_REG_NUM] = {0}, RFB_backup[RF_REG_NUM] = {0}; + u4Byte Backup_MACBB_REG[MACBB_REG_NUM] = {0x520, 0x550, 0x808, 0xa04, 0x90c, 0xc00, 0xe00, 0x838, 0x82c}; u4Byte Backup_AFE_REG[AFE_REG_NUM] = {0xc5c, 0xc60, 0xc64, 0xc68, 0xcb0, 0xcb4, 0xe5c, 0xe60, 0xe64, 0xe68, 0xeb0, 0xeb4}; u4Byte Reg_C1B8, Reg_E1B8; @@ -1271,11 +1212,13 @@ phy_LCCalibrate_8812A( //3 4. Set LC calibration begin bit15 ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_CHNLBW, bRFRegOffsetMask, LC_Cal|0x08000); + ODM_delay_ms(150); // suggest by RFSI Binson + // Leave LCK mode tmp = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_LCK, bRFRegOffsetMask); ODM_SetRFReg(pDM_Odm, ODM_RF_PATH_A, RF_LCK, bRFRegOffsetMask, tmp & ~BIT14); - ODM_delay_ms(100); + //3 Restore original situation if((reg0x914 & 70000) != 0) //Deal with contisuous TX case, 0x914[18:16] @@ -1403,6 +1346,8 @@ PHY_IQCalibrate_8812A( ) { u4Byte counter = 0; + u4Byte StartTime; + s4Byte ProgressingTime; #if !(DM_ODM_SUPPORT_TYPE & ODM_AP) HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); @@ -1423,17 +1368,19 @@ PHY_IQCalibrate_8812A( #endif #endif//(MP_DRIVER == 1) -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE) ) - if (ODM_CheckPowerStatus(pAdapter) == FALSE) - return; -#endif +//#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE) ) + //if (ODM_CheckPowerStatus(pAdapter) == FALSE) + //return; +//#endif + pDM_Odm->IQKFWOffload = 0; + StartTime = ODM_GetCurrentTime( pDM_Odm); #if MP_DRIVER == 1 if( ! (pMptCtx->bSingleTone || pMptCtx->bCarrierSuppression) ) #endif { - if(pHalData->RegIQKFWOffload) + if(pDM_Odm->IQKFWOffload) { phy_IQCalibrate_By_FW_8812A(pAdapter); } @@ -1442,6 +1389,8 @@ PHY_IQCalibrate_8812A( phy_IQCalibrate_8812A(pDM_Odm, pHalData->CurrentChannel); } } + ProgressingTime = ODM_GetProgressingTime( pDM_Odm, StartTime); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK ProgressingTime = %d\n", ProgressingTime)); } @@ -1451,6 +1400,9 @@ PHY_LCCalibrate_8812A( ) { BOOLEAN bStartContTx = FALSE, bSingleTone = FALSE, bCarrierSuppression = FALSE; + u4Byte StartTime; + s4Byte ProgressingTime; + #if !(DM_ODM_SUPPORT_TYPE & ODM_AP) PADAPTER pAdapter = pDM_Odm->Adapter; @@ -1468,6 +1420,7 @@ PHY_LCCalibrate_8812A( #endif//(MP_DRIVER == 1) #endif + StartTime = ODM_GetCurrentTime( pDM_Odm); ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("===> PHY_LCCalibrate_8812A\n")); #if (MP_DRIVER == 1) @@ -1475,6 +1428,8 @@ PHY_LCCalibrate_8812A( #endif ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("<=== PHY_LCCalibrate_8812A\n")); + ProgressingTime = ODM_GetProgressingTime( pDM_Odm, StartTime); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("LCK ProgressingTime = %d\n", ProgressingTime)); } @@ -1873,15 +1828,13 @@ _DPK_EnableDP( for(i=0;i<16;i++) { - if(((6-zeropoint)+i*2) > 24) + pwsf1 = (6-zeropoint)+i*2; + if(pwsf1 > 24) pwsf1 = 24; - else - pwsf1 = (6-zeropoint)+i*2; - if(((6-zeropoint-1)+i*2) > 24) + pwsf2 = (6-zeropoint-1)+i*2; + if(pwsf2 > 24) pwsf2 = 24; - else - pwsf2 = (6-zeropoint-1)+i*2; ODM_Write4Byte(pDM_Odm, 0xce4+pagesel, 0x00000001 | i<<1 | (PWSF[pwsf1]<<8) | (PWSF[pwsf2]<<16)); ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0x%x\n", ODM_Read4Byte(pDM_Odm, 0xce4+pagesel))); diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/Mp_Precomp.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/Mp_Precomp.h new file mode 100644 index 00000000000000..43ea006e752ba5 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/Mp_Precomp.h @@ -0,0 +1,24 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +//#include +//#include "phydm_precomp.h" +//#include "../phydm_precomp.h" + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/odm_RTL8812A.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/phydm_RTL8812A.c old mode 100755 new mode 100644 similarity index 89% rename from backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/odm_RTL8812A.c rename to backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/phydm_RTL8812A.c index 61a683d61b16f6..cdb6d7f768f053 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/odm_RTL8812A.c +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/phydm_RTL8812A.c @@ -22,12 +22,13 @@ // include files //============================================================ -//#include "Mp_Precomp.h" +#include "Mp_Precomp.h" -#include "../odm_precomp.h" +#include "../phydm_precomp.h" #if (RTL8812A_SUPPORT == 1) +#if(defined(CONFIG_PATH_DIVERSITY)) VOID odm_UpdateTxPath_8812A(IN PDM_ODM_T pDM_Odm, IN u1Byte Path) { @@ -52,22 +53,6 @@ odm_UpdateTxPath_8812A(IN PDM_ODM_T pDM_Odm, IN u1Byte Path) ODM_RT_TRACE(pDM_Odm,ODM_COMP_PATH_DIV, ODM_DBG_LOUD, ("Path=%s\n",(Path==ODM_RF_PATH_A)?"ODM_RF_PATH_A":"ODM_RF_PATH_B")); } -VOID -ODM_PathStatistics_8812A( - IN PDM_ODM_T pDM_Odm, - IN u4Byte MacId, - IN u4Byte RSSI_A, - IN u4Byte RSSI_B -) -{ - pPATHDIV_T pDM_PathDiv = &pDM_Odm->DM_PathDiv; - - pDM_PathDiv->PathA_Sum[MacId]+=RSSI_A; - pDM_PathDiv->PathA_Cnt[MacId]++; - - pDM_PathDiv->PathB_Sum[MacId]+=RSSI_B; - pDM_PathDiv->PathB_Cnt[MacId]++; -} VOID ODM_PathDiversityInit_8812A( @@ -172,5 +157,5 @@ ODM_SetTxPathByTxInfo_8812A( } #endif - +#endif // CONFIG_PATH_DIVERSITY #endif //#if (RTL8812A_SUPPORT == 1) \ No newline at end of file diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/odm_RTL8812A.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/phydm_RTL8812A.h old mode 100755 new mode 100644 similarity index 87% rename from backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/odm_RTL8812A.h rename to backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/phydm_RTL8812A.h index 9d2325a4e45ade..1963c923116368 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/odm_RTL8812A.h +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/phydm_RTL8812A.h @@ -20,16 +20,8 @@ #ifndef __ODM_RTL8812A_H__ #define __ODM_RTL8812A_H__ - +#if(defined(CONFIG_PATH_DIVERSITY)) VOID -ODM_PathStatistics_8812A( - IN PDM_ODM_T pDM_Odm, - IN u4Byte MacId, - IN u4Byte RSSI_A, - IN u4Byte RSSI_B -); - -VOID ODM_PathDiversityInit_8812A( IN PDM_ODM_T pDM_Odm); VOID @@ -41,5 +33,5 @@ ODM_SetTxPathByTxInfo_8812A( IN pu1Byte pDesc, IN u1Byte macId ); - + #endif #endif \ No newline at end of file diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/odm_RegConfig8812A.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/phydm_RegConfig8812A.c old mode 100755 new mode 100644 similarity index 98% rename from backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/odm_RegConfig8812A.c rename to backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/phydm_RegConfig8812A.c index 4b4e9099197601..0c82645408ce2d --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/odm_RegConfig8812A.c +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/phydm_RegConfig8812A.c @@ -18,7 +18,8 @@ * ******************************************************************************/ -#include "../odm_precomp.h" +#include "Mp_Precomp.h" +#include "../phydm_precomp.h" #if (RTL8812A_SUPPORT == 1) diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/odm_RegConfig8812A.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/phydm_RegConfig8812A.h old mode 100755 new mode 100644 similarity index 100% rename from backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/odm_RegConfig8812A.h rename to backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/phydm_RegConfig8812A.h diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalHWImg8821A_BB.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalHWImg8821A_BB.c new file mode 100644 index 00000000000000..7062df47be6fd4 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalHWImg8821A_BB.c @@ -0,0 +1,742 @@ +/****************************************************************************** +* +* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of version 2 of the GNU General Public License as +* published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +* +* You should have received a copy of the GNU General Public License along with +* this program; if not, write to the Free Software Foundation, Inc., +* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA +* +* +******************************************************************************/ + +#include "Mp_Precomp.h" +#include "../phydm_precomp.h" + +#if (RTL8821A_SUPPORT == 1) +static BOOLEAN +CheckPositive( + IN PDM_ODM_T pDM_Odm, + IN const u4Byte Condition1, + IN const u4Byte Condition2 + ) +{ + u1Byte _BoardType = ((pDM_Odm->BoardType & BIT4) >> 4) << 0 | // _GLNA + ((pDM_Odm->BoardType & BIT3) >> 3) << 1 | // _GPA + ((pDM_Odm->BoardType & BIT7) >> 7) << 2 | // _ALNA + ((pDM_Odm->BoardType & BIT6) >> 6) << 3 | // _APA + ((pDM_Odm->BoardType & BIT2) >> 2) << 4; // _BT + + u4Byte cond1 = Condition1, cond2 = Condition2; + u4Byte driver1 = pDM_Odm->CutVersion << 24 | + pDM_Odm->SupportPlatform << 16 | + pDM_Odm->PackageType << 12 | + pDM_Odm->SupportInterface << 8 | + _BoardType; + + u4Byte driver2 = pDM_Odm->TypeGLNA << 0 | + pDM_Odm->TypeGPA << 8 | + pDM_Odm->TypeALNA << 16 | + pDM_Odm->TypeAPA << 24; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, + ("===> [8812A] CheckPositive (cond1, cond2) = (0x%X 0x%X)\n", cond1, cond2)); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, + ("===> [8812A] CheckPositive (driver1, driver2) = (0x%X 0x%X)\n", driver1, driver2)); + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, + (" (Platform, Interface) = (0x%X, 0x%X)\n", pDM_Odm->SupportPlatform, pDM_Odm->SupportInterface)); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, + (" (Board, Package) = (0x%X, 0x%X)\n", pDM_Odm->BoardType, pDM_Odm->PackageType)); + + + //============== Value Defined Check ===============// + //QFN Type [15:12] and Cut Version [27:24] need to do value check + + if(((cond1 & 0x0000F000) != 0) &&((cond1 & 0x0000F000) != (driver1 & 0x0000F000))) + return FALSE; + if(((cond1 & 0x0F000000) != 0) &&((cond1 & 0x0F000000) != (driver1 & 0x0F000000))) + return FALSE; + + //=============== Bit Defined Check ================// + // We don't care [31:28] and [23:20] + // + cond1 &= 0x000F0FFF; + driver1 &= 0x000F0FFF; + + if ((cond1 & driver1) == cond1) + { + u4Byte bitMask = 0; + if ((cond1 & 0x0F) == 0) // BoardType is DONTCARE + return TRUE; + + if ((cond1 & BIT0) != 0) //GLNA + bitMask |= 0x000000FF; + if ((cond1 & BIT1) != 0) //GPA + bitMask |= 0x0000FF00; + if ((cond1 & BIT2) != 0) //ALNA + bitMask |= 0x00FF0000; + if ((cond1 & BIT3) != 0) //APA + bitMask |= 0xFF000000; + + if ((cond2 & bitMask) == (driver2 & bitMask)) // BoardType of each RF path is matched + return TRUE; + else + return FALSE; + } + else + { + return FALSE; + } +} +static BOOLEAN +CheckNegative( + IN PDM_ODM_T pDM_Odm, + IN const u4Byte Condition1, + IN const u4Byte Condition2 + ) +{ + return TRUE; +} + +/****************************************************************************** +* AGC_TAB.TXT +******************************************************************************/ + +u4Byte Array_MP_8821A_AGC_TAB[] = { + 0x81C, 0xBF000001, + 0x81C, 0xBF020001, + 0x81C, 0xBF040001, + 0x81C, 0xBF060001, + 0x81C, 0xBE080001, + 0x81C, 0xBD0A0001, + 0x81C, 0xBC0C0001, + 0x81C, 0xBA0E0001, + 0x81C, 0xB9100001, + 0x81C, 0xB8120001, + 0x81C, 0xB7140001, + 0x81C, 0xB6160001, + 0x81C, 0xB5180001, + 0x81C, 0xB41A0001, + 0x81C, 0xB31C0001, + 0x81C, 0xB21E0001, + 0x81C, 0xB1200001, + 0x81C, 0xB0220001, + 0x81C, 0xAF240001, + 0x81C, 0xAE260001, + 0x81C, 0xAD280001, + 0x81C, 0xAC2A0001, + 0x81C, 0xAB2C0001, + 0x81C, 0xAA2E0001, + 0x81C, 0xA9300001, + 0x81C, 0xA8320001, + 0x81C, 0xA7340001, + 0x81C, 0xA6360001, + 0x81C, 0xA5380001, + 0x81C, 0xA43A0001, + 0x81C, 0x683C0001, + 0x81C, 0x673E0001, + 0x81C, 0x66400001, + 0x81C, 0x65420001, + 0x81C, 0x64440001, + 0x81C, 0x63460001, + 0x81C, 0x62480001, + 0x81C, 0x614A0001, + 0x81C, 0x474C0001, + 0x81C, 0x464E0001, + 0x81C, 0x45500001, + 0x81C, 0x44520001, + 0x81C, 0x43540001, + 0x81C, 0x42560001, + 0x81C, 0x41580001, + 0x81C, 0x285A0001, + 0x81C, 0x275C0001, + 0x81C, 0x265E0001, + 0x81C, 0x25600001, + 0x81C, 0x24620001, + 0x81C, 0x0A640001, + 0x81C, 0x09660001, + 0x81C, 0x08680001, + 0x81C, 0x076A0001, + 0x81C, 0x066C0001, + 0x81C, 0x056E0001, + 0x81C, 0x04700001, + 0x81C, 0x03720001, + 0x81C, 0x02740001, + 0x81C, 0x01760001, + 0x81C, 0x01780001, + 0x81C, 0x017A0001, + 0x81C, 0x017C0001, + 0x81C, 0x017E0001, + 0x8000020c,0x00000000,0x40000000,0x00000000, + 0x81C, 0xFB000101, + 0x81C, 0xFA020101, + 0x81C, 0xF9040101, + 0x81C, 0xF8060101, + 0x81C, 0xF7080101, + 0x81C, 0xF60A0101, + 0x81C, 0xF50C0101, + 0x81C, 0xF40E0101, + 0x81C, 0xF3100101, + 0x81C, 0xF2120101, + 0x81C, 0xF1140101, + 0x81C, 0xF0160101, + 0x81C, 0xEF180101, + 0x81C, 0xEE1A0101, + 0x81C, 0xED1C0101, + 0x81C, 0xEC1E0101, + 0x81C, 0xEB200101, + 0x81C, 0xEA220101, + 0x81C, 0xE9240101, + 0x81C, 0xE8260101, + 0x81C, 0xE7280101, + 0x81C, 0xE62A0101, + 0x81C, 0xE52C0101, + 0x81C, 0xE42E0101, + 0x81C, 0xE3300101, + 0x81C, 0xA5320101, + 0x81C, 0xA4340101, + 0x81C, 0xA3360101, + 0x81C, 0x87380101, + 0x81C, 0x863A0101, + 0x81C, 0x853C0101, + 0x81C, 0x843E0101, + 0x81C, 0x69400101, + 0x81C, 0x68420101, + 0x81C, 0x67440101, + 0x81C, 0x66460101, + 0x81C, 0x49480101, + 0x81C, 0x484A0101, + 0x81C, 0x474C0101, + 0x81C, 0x2A4E0101, + 0x81C, 0x29500101, + 0x81C, 0x28520101, + 0x81C, 0x27540101, + 0x81C, 0x26560101, + 0x81C, 0x25580101, + 0x81C, 0x245A0101, + 0x81C, 0x235C0101, + 0x81C, 0x055E0101, + 0x81C, 0x04600101, + 0x81C, 0x03620101, + 0x81C, 0x02640101, + 0x81C, 0x01660101, + 0x81C, 0x01680101, + 0x81C, 0x016A0101, + 0x81C, 0x016C0101, + 0x81C, 0x016E0101, + 0x81C, 0x01700101, + 0x81C, 0x01720101, + 0x9000040c,0x00000000,0x40000000,0x00000000, + 0x81C, 0xFB000101, + 0x81C, 0xFA020101, + 0x81C, 0xF9040101, + 0x81C, 0xF8060101, + 0x81C, 0xF7080101, + 0x81C, 0xF60A0101, + 0x81C, 0xF50C0101, + 0x81C, 0xF40E0101, + 0x81C, 0xF3100101, + 0x81C, 0xF2120101, + 0x81C, 0xF1140101, + 0x81C, 0xF0160101, + 0x81C, 0xEF180101, + 0x81C, 0xEE1A0101, + 0x81C, 0xED1C0101, + 0x81C, 0xEC1E0101, + 0x81C, 0xEB200101, + 0x81C, 0xEA220101, + 0x81C, 0xE9240101, + 0x81C, 0xE8260101, + 0x81C, 0xE7280101, + 0x81C, 0xE62A0101, + 0x81C, 0xE52C0101, + 0x81C, 0xE42E0101, + 0x81C, 0xE3300101, + 0x81C, 0xA5320101, + 0x81C, 0xA4340101, + 0x81C, 0xA3360101, + 0x81C, 0x87380101, + 0x81C, 0x863A0101, + 0x81C, 0x853C0101, + 0x81C, 0x843E0101, + 0x81C, 0x69400101, + 0x81C, 0x68420101, + 0x81C, 0x67440101, + 0x81C, 0x66460101, + 0x81C, 0x49480101, + 0x81C, 0x484A0101, + 0x81C, 0x474C0101, + 0x81C, 0x2A4E0101, + 0x81C, 0x29500101, + 0x81C, 0x28520101, + 0x81C, 0x27540101, + 0x81C, 0x26560101, + 0x81C, 0x25580101, + 0x81C, 0x245A0101, + 0x81C, 0x235C0101, + 0x81C, 0x055E0101, + 0x81C, 0x04600101, + 0x81C, 0x03620101, + 0x81C, 0x02640101, + 0x81C, 0x01660101, + 0x81C, 0x01680101, + 0x81C, 0x016A0101, + 0x81C, 0x016C0101, + 0x81C, 0x016E0101, + 0x81C, 0x01700101, + 0x81C, 0x01720101, + 0xA0000000,0x00000000, + 0x81C, 0xFF000101, + 0x81C, 0xFF020101, + 0x81C, 0xFE040101, + 0x81C, 0xFD060101, + 0x81C, 0xFC080101, + 0x81C, 0xFD0A0101, + 0x81C, 0xFC0C0101, + 0x81C, 0xFB0E0101, + 0x81C, 0xFA100101, + 0x81C, 0xF9120101, + 0x81C, 0xF8140101, + 0x81C, 0xF7160101, + 0x81C, 0xF6180101, + 0x81C, 0xF51A0101, + 0x81C, 0xF41C0101, + 0x81C, 0xF31E0101, + 0x81C, 0xF2200101, + 0x81C, 0xF1220101, + 0x81C, 0xF0240101, + 0x81C, 0xEF260101, + 0x81C, 0xEE280101, + 0x81C, 0xED2A0101, + 0x81C, 0xEC2C0101, + 0x81C, 0xEB2E0101, + 0x81C, 0xEA300101, + 0x81C, 0xE9320101, + 0x81C, 0xE8340101, + 0x81C, 0xE7360101, + 0x81C, 0xE6380101, + 0x81C, 0xE53A0101, + 0x81C, 0xE43C0101, + 0x81C, 0xE33E0101, + 0x81C, 0xA5400101, + 0x81C, 0xA4420101, + 0x81C, 0xA3440101, + 0x81C, 0x87460101, + 0x81C, 0x86480101, + 0x81C, 0x854A0101, + 0x81C, 0x844C0101, + 0x81C, 0x694E0101, + 0x81C, 0x68500101, + 0x81C, 0x67520101, + 0x81C, 0x66540101, + 0x81C, 0x49560101, + 0x81C, 0x48580101, + 0x81C, 0x475A0101, + 0x81C, 0x2A5C0101, + 0x81C, 0x295E0101, + 0x81C, 0x28600101, + 0x81C, 0x27620101, + 0x81C, 0x26640101, + 0x81C, 0x25660101, + 0x81C, 0x24680101, + 0x81C, 0x236A0101, + 0x81C, 0x056C0101, + 0x81C, 0x046E0101, + 0x81C, 0x03700101, + 0x81C, 0x02720101, + 0xB0000000,0x00000000, + 0x81C, 0x01740101, + 0x81C, 0x01760101, + 0x81C, 0x01780101, + 0x81C, 0x017A0101, + 0x81C, 0x017C0101, + 0x81C, 0x017E0101, + 0xC50, 0x00000022, + 0xC50, 0x00000020, + +}; + +void +ODM_ReadAndConfig_MP_8821A_AGC_TAB( + IN PDM_ODM_T pDM_Odm + ) +{ + u4Byte i = 0; + u1Byte cCond; + BOOLEAN bMatched = TRUE, bSkipped = FALSE; +//ask by Luke.Lee + u4Byte ArrayLen = sizeof(Array_MP_8821A_AGC_TAB)/sizeof(u4Byte); + pu4Byte Array = Array_MP_8821A_AGC_TAB; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ReadAndConfig_MP_8821A_AGC_TAB\n")); + + while(( i+1) < ArrayLen) + { + u4Byte v1 = Array[i]; + u4Byte v2 = Array[i+1]; + + if(v1 & (BIT31|BIT30)) //positive & negative condition + { + if(v1 & BIT31) // positive condition + { + cCond = (u1Byte)((v1 & (BIT29|BIT28)) >> 28); + if(cCond == COND_ENDIF) //end + { + bMatched = TRUE; + bSkipped = FALSE; + } + else if(cCond == COND_ELSE) //else + { + bMatched = bSkipped?FALSE:TRUE; + } + else //if , else if + { + if(bSkipped) + bMatched = FALSE; + else + { + if(CheckPositive(pDM_Odm, v1, v2)) + { + bMatched = TRUE; + bSkipped = TRUE; + } + else + { + bMatched = FALSE; + bSkipped = FALSE; + } + } + } + } + else if(v1 & BIT30){ //negative condition + //do nothing + } + } + else + { + if(bMatched) + odm_ConfigBB_AGC_8821A(pDM_Odm, v1, bMaskDWord, v2); + } + i = i + 2; + } +} + +u4Byte +ODM_GetVersion_MP_8821A_AGC_TAB(void) +{ + return 44; +} + +/****************************************************************************** +* PHY_REG.TXT +******************************************************************************/ + +u4Byte Array_MP_8821A_PHY_REG[] = { + 0x800, 0x0020D090, + 0x804, 0x080112E0, + 0x808, 0x0E028211, + 0x80C, 0x92131111, + 0x810, 0x20101261, + 0x814, 0x020C3D10, + 0x818, 0x03A00385, + 0x820, 0x00000000, + 0x824, 0x00030FE0, + 0x828, 0x00000000, + 0x82C, 0x002081DD, + 0x830, 0x2AAAEEC8, + 0x834, 0x0037A706, + 0x838, 0x06489B44, + 0x83C, 0x0000095B, + 0x840, 0xC0000001, + 0x844, 0x40003CDE, + 0x848, 0x62103F8B, + 0x84C, 0x6CFDFFB8, + 0x850, 0x28874706, + 0x854, 0x0001520C, + 0x858, 0x8060E000, + 0x85C, 0x74210168, + 0x860, 0x6929C321, + 0x864, 0x79727432, + 0x868, 0x8CA7A314, + 0x86C, 0x888C2878, + 0x870, 0x08888888, + 0x874, 0x31612C2E, + 0x878, 0x00000152, + 0x87C, 0x000FD000, + 0x8A0, 0x00000013, + 0x8A4, 0x7F7F7F7F, + 0x8A8, 0xA2000338, + 0x8AC, 0x0FF0FA0A, + 0x8B4, 0x000FC080, + 0x8B8, 0x6C10D7FF, + 0x8BC, 0x0CA52090, + 0x8C0, 0x1BF00020, + 0x8C4, 0x00000000, + 0x8C8, 0x00013169, + 0x8CC, 0x08248492, + 0x8D4, 0x940008A0, + 0x8D8, 0x290B5612, + 0x8F8, 0x400002C0, + 0x8FC, 0x00000000, + 0x900, 0x00000700, + 0x90C, 0x00000000, + 0x910, 0x0000FC00, + 0x914, 0x00000404, + 0x918, 0x1C1028C0, + 0x91C, 0x64B11A1C, + 0x920, 0xE0767233, + 0x924, 0x055AA500, + 0x928, 0x00000004, + 0x92C, 0xFFFE0000, + 0x930, 0xFFFFFFFE, + 0x934, 0x001FFFFF, + 0x960, 0x00000000, + 0x964, 0x00000000, + 0x968, 0x00000000, + 0x96C, 0x00000000, + 0x970, 0x801FFFFF, + 0x974, 0x000003FF, + 0x978, 0x00000000, + 0x97C, 0x00000000, + 0x980, 0x00000000, + 0x984, 0x00000000, + 0x988, 0x00000000, + 0x990, 0x27100000, + 0x994, 0xFFFF0100, + 0x998, 0xFFFFFF5C, + 0x99C, 0xFFFFFFFF, + 0x9A0, 0x000000FF, + 0x9A4, 0x00480080, + 0x9A8, 0x00000000, + 0x9AC, 0x00000000, + 0x9B0, 0x81081008, + 0x9B4, 0x01081008, + 0x9B8, 0x01081008, + 0x9BC, 0x01081008, + 0x9D0, 0x00000000, + 0x9D4, 0x00000000, + 0x9D8, 0x00000000, + 0x9DC, 0x00000000, + 0x9E0, 0x00005D00, + 0x9E4, 0x00000003, + 0x9E8, 0x00000001, + 0xA00, 0x00D047C8, + 0xA04, 0x01FF800C, + 0xA08, 0x8C8A8300, + 0xA0C, 0x2E68000F, + 0xA10, 0x9500BB78, + 0xA14, 0x11144028, + 0xA18, 0x00881117, + 0xA1C, 0x89140F00, + 0xA20, 0x1A1B0000, + 0xA24, 0x090E1317, + 0xA28, 0x00000204, + 0xA2C, 0x00900000, + 0xA70, 0x101FFF00, + 0xA74, 0x00000008, + 0xA78, 0x00000900, + 0xA7C, 0x225B0606, + 0xA80, 0x21805490, + 0xA84, 0x001F0000, + 0xB00, 0x03100040, + 0xB04, 0x0000B000, + 0xB08, 0xAE0201EB, + 0xB0C, 0x01003207, + 0xB10, 0x00009807, + 0xB14, 0x01000000, + 0xB18, 0x00000002, + 0xB1C, 0x00000002, + 0xB20, 0x0000001F, + 0xB24, 0x03020100, + 0xB28, 0x07060504, + 0xB2C, 0x0B0A0908, + 0xB30, 0x0F0E0D0C, + 0xB34, 0x13121110, + 0xB38, 0x17161514, + 0xB3C, 0x0000003A, + 0xB40, 0x00000000, + 0xB44, 0x00000000, + 0xB48, 0x13000032, + 0xB4C, 0x48080000, + 0xB50, 0x00000000, + 0xB54, 0x00000000, + 0xB58, 0x00000000, + 0xB5C, 0x00000000, + 0xC00, 0x00000007, + 0xC04, 0x00042020, + 0xC08, 0x80410231, + 0xC0C, 0x00000000, + 0xC10, 0x00000100, + 0xC14, 0x01000000, + 0xC1C, 0x40000003, + 0xC20, 0x2C2C2C2C, + 0xC24, 0x30303030, + 0xC28, 0x30303030, + 0xC2C, 0x2C2C2C2C, + 0xC30, 0x2C2C2C2C, + 0xC34, 0x2C2C2C2C, + 0xC38, 0x2C2C2C2C, + 0xC3C, 0x2A2A2A2A, + 0xC40, 0x2A2A2A2A, + 0xC44, 0x2A2A2A2A, + 0xC48, 0x2A2A2A2A, + 0xC4C, 0x2A2A2A2A, + 0xC50, 0x00000020, + 0xC54, 0x001C1208, + 0xC58, 0x30000C1C, + 0xC5C, 0x00000058, + 0xC60, 0x34344443, + 0xC64, 0x07003333, + 0xC68, 0x19791979, + 0xC6C, 0x19791979, + 0xC70, 0x19791979, + 0xC74, 0x19791979, + 0xC78, 0x19791979, + 0xC7C, 0x19791979, + 0xC80, 0x19791979, + 0xC84, 0x19791979, + 0xC94, 0x0100005C, + 0xC98, 0x00000000, + 0xC9C, 0x00000000, + 0xCA0, 0x00000029, + 0xCA4, 0x08040201, + 0xCA8, 0x80402010, + 0xCB0, 0x77775747, + 0xCB4, 0x10000077, + 0xCB8, 0x00508240, + +}; + +void +ODM_ReadAndConfig_MP_8821A_PHY_REG( + IN PDM_ODM_T pDM_Odm + ) +{ + u4Byte i = 0; + u1Byte cCond; + BOOLEAN bMatched = TRUE, bSkipped = FALSE; +//ask by Luke.Lee + u4Byte ArrayLen = sizeof(Array_MP_8821A_PHY_REG)/sizeof(u4Byte); + pu4Byte Array = Array_MP_8821A_PHY_REG; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ReadAndConfig_MP_8821A_PHY_REG\n")); + + while(( i+1) < ArrayLen) + { + u4Byte v1 = Array[i]; + u4Byte v2 = Array[i+1]; + + if(v1 & (BIT31|BIT30)) //positive & negative condition + { + if(v1 & BIT31) // positive condition + { + cCond = (u1Byte)((v1 & (BIT29|BIT28)) >> 28); + if(cCond == COND_ENDIF) //end + { + bMatched = TRUE; + bSkipped = FALSE; + } + else if(cCond == COND_ELSE) //else + { + bMatched = bSkipped?FALSE:TRUE; + } + else //if , else if + { + if(bSkipped) + bMatched = FALSE; + else + { + if(CheckPositive(pDM_Odm, v1, v2)) + { + bMatched = TRUE; + bSkipped = TRUE; + } + else + { + bMatched = FALSE; + bSkipped = FALSE; + } + } + } + } + else if(v1 & BIT30){ //negative condition + //do nothing + } + } + else + { + if(bMatched) + odm_ConfigBB_PHY_8821A(pDM_Odm, v1, bMaskDWord, v2); + } + i = i + 2; + } +} + +u4Byte +ODM_GetVersion_MP_8821A_PHY_REG(void) +{ + return 44; +} + +/****************************************************************************** +* PHY_REG_PG.TXT +******************************************************************************/ + +u4Byte Array_MP_8821A_PHY_REG_PG[] = { + 0, 0, 0, 0x00000c20, 0xffffffff, 0x32343638, + 0, 0, 0, 0x00000c24, 0xffffffff, 0x36363838, + 0, 0, 0, 0x00000c28, 0xffffffff, 0x28303234, + 0, 0, 0, 0x00000c2c, 0xffffffff, 0x34363838, + 0, 0, 0, 0x00000c30, 0xffffffff, 0x26283032, + 0, 0, 0, 0x00000c3c, 0xffffffff, 0x32343636, + 0, 0, 0, 0x00000c40, 0xffffffff, 0x24262830, + 0, 0, 0, 0x00000c44, 0x0000ffff, 0x00002022, + 1, 0, 0, 0x00000c24, 0xffffffff, 0x34343636, + 1, 0, 0, 0x00000c28, 0xffffffff, 0x26283032, + 1, 0, 0, 0x00000c2c, 0xffffffff, 0x32343636, + 1, 0, 0, 0x00000c30, 0xffffffff, 0x24262830, + 1, 0, 0, 0x00000c3c, 0xffffffff, 0x32343636, + 1, 0, 0, 0x00000c40, 0xffffffff, 0x24262830, + 1, 0, 0, 0x00000c44, 0x0000ffff, 0x00002022 +}; + +void +ODM_ReadAndConfig_MP_8821A_PHY_REG_PG( + IN PDM_ODM_T pDM_Odm + ) +{ + u4Byte i = 0; + u4Byte ArrayLen = sizeof(Array_MP_8821A_PHY_REG_PG)/sizeof(u4Byte); + pu4Byte Array = Array_MP_8821A_PHY_REG_PG; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ReadAndConfig_MP_8821A_PHY_REG_PG\n")); + + pDM_Odm->PhyRegPgVersion = 1; + pDM_Odm->PhyRegPgValueType = PHY_REG_PG_EXACT_VALUE; + + for (i = 0; i < ArrayLen; i += 6 ) + { + u4Byte v1 = Array[i]; + u4Byte v2 = Array[i+1]; + u4Byte v3 = Array[i+2]; + u4Byte v4 = Array[i+3]; + u4Byte v5 = Array[i+4]; + u4Byte v6 = Array[i+5]; + + odm_ConfigBB_PHY_REG_PG_8821A(pDM_Odm, v1, v2, v3, v4, v5, v6); + } +} + + + +#endif // end of HWIMG_SUPPORT + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_BB.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalHWImg8821A_BB.h old mode 100755 new mode 100644 similarity index 57% rename from backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_BB.h rename to backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalHWImg8821A_BB.h index c2cf2800db538c..7c5f19474e3d1c --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_BB.h +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalHWImg8821A_BB.h @@ -18,60 +18,40 @@ * ******************************************************************************/ -#if (RTL8812A_SUPPORT == 1) -#ifndef __INC_TC_BB_HW_IMG_8812A_H -#define __INC_TC_BB_HW_IMG_8812A_H +#if (RTL8821A_SUPPORT == 1) +#ifndef __INC_MP_BB_HW_IMG_8821A_H +#define __INC_MP_BB_HW_IMG_8821A_H -//static BOOLEAN CheckCondition(const u4Byte Condition, const u4Byte Hex); /****************************************************************************** * AGC_TAB.TXT ******************************************************************************/ void -ODM_ReadAndConfig_TC_8812A_AGC_TAB( // TC: Test Chip, MP: MP Chip +ODM_ReadAndConfig_MP_8821A_AGC_TAB( // TC: Test Chip, MP: MP Chip IN PDM_ODM_T pDM_Odm ); - -/****************************************************************************** -* AGC_TAB_DIFF.TXT -******************************************************************************/ - -extern u4Byte Array_TC_8812A_AGC_TAB_DIFF_LB[116]; -extern u4Byte Array_TC_8812A_AGC_TAB_DIFF_HB[116]; -void -ODM_ReadAndConfig_TC_8812A_AGC_TAB_DIFF( - IN PDM_ODM_T pDM_Odm, - IN u4Byte Array[], - IN u4Byte ArrayLen -); +u4Byte ODM_GetVersion_MP_8821A_AGC_TAB(void); /****************************************************************************** * PHY_REG.TXT ******************************************************************************/ void -ODM_ReadAndConfig_TC_8812A_PHY_REG( // TC: Test Chip, MP: MP Chip - IN PDM_ODM_T pDM_Odm -); - -/****************************************************************************** -* PHY_REG_MP.TXT -******************************************************************************/ - -void -ODM_ReadAndConfig_TC_8812A_PHY_REG_MP( // TC: Test Chip, MP: MP Chip +ODM_ReadAndConfig_MP_8821A_PHY_REG( // TC: Test Chip, MP: MP Chip IN PDM_ODM_T pDM_Odm ); +u4Byte ODM_GetVersion_MP_8821A_PHY_REG(void); /****************************************************************************** * PHY_REG_PG.TXT ******************************************************************************/ void -ODM_ReadAndConfig_TC_8812A_PHY_REG_PG( // TC: Test Chip, MP: MP Chip +ODM_ReadAndConfig_MP_8821A_PHY_REG_PG( // TC: Test Chip, MP: MP Chip IN PDM_ODM_T pDM_Odm ); +u4Byte ODM_GetVersion_MP_8821A_PHY_REG_PG(void); #endif #endif // end of HWIMG_SUPPORT diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalHWImg8821A_FW.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalHWImg8821A_FW.c new file mode 100644 index 00000000000000..5259c5a0c08683 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalHWImg8821A_FW.c @@ -0,0 +1,6371 @@ +/****************************************************************************** +* +* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of version 2 of the GNU General Public License as +* published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +* +* You should have received a copy of the GNU General Public License along with +* this program; if not, write to the Free Software Foundation, Inc., +* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA +* +* +******************************************************************************/ + +#include "Mp_Precomp.h" +#include "../phydm_precomp.h" + +#if (RTL8821A_SUPPORT == 1) +#if(DM_ODM_SUPPORT_TYPE & (ODM_AP)) + + +u1Byte Array_MP_8821A_FW_AP[] = { +0x01, 0x21, 0x20, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x09, 0x05, 0x15, 0x19, 0x36, 0x3C, 0x00, 0x00, +0xD0, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x02, 0x49, 0x01, 0x02, 0x5F, 0xED, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x02, 0x60, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x02, 0x68, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x02, 0x5F, 0xEE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x67, 0xED, 0x00, 0x00, +0x00, 0x00, 0x00, 0x02, 0x68, 0x61, 0x15, 0xF0, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x15, 0xF0, 0x0F, +0x00, 0x00, 0x00, 0x00, 0x05, 0xF0, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x05, 0xF0, 0x0F, 0x00, 0x00, +0x00, 0x00, 0x10, 0xF0, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x10, 0xF0, 0x0F, 0x00, 0x00, 0x00, 0x00, +0xF5, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xF0, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x10, 0xF0, 0x3F, 0x00, +0x00, 0x00, 0x00, 0x15, 0xF0, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x15, 0xF0, 0xCF, 0xFF, 0x00, 0x00, +0x00, 0x0A, 0x08, 0x03, 0x03, 0x00, 0x04, 0x09, 0x07, 0x03, 0x03, 0x00, 0x04, 0x08, 0x06, 0x03, +0x02, 0x00, 0x04, 0x08, 0x05, 0x03, 0x01, 0x00, 0x04, 0x0D, 0x0A, 0x07, 0x05, 0x00, 0x08, 0x0C, +0x0A, 0x07, 0x04, 0x00, 0x08, 0x0B, 0x0A, 0x06, 0x05, 0x00, 0x08, 0x0B, 0x0A, 0x05, 0x03, 0x00, +0x08, 0x0B, 0x0A, 0x03, 0x02, 0x00, 0x08, 0x14, 0x12, 0x0C, 0x04, 0x00, 0x10, 0x14, 0x12, 0x09, +0x04, 0x00, 0x10, 0x24, 0x22, 0x1C, 0x12, 0x00, 0x20, 0x24, 0x22, 0x18, 0x0C, 0x00, 0x20, 0x24, +0x22, 0x14, 0x06, 0x00, 0x20, 0x24, 0x22, 0x0F, 0x04, 0x00, 0x20, 0x24, 0x21, 0x0A, 0x04, 0x00, +0x20, 0x23, 0x21, 0x0C, 0x04, 0x00, 0x20, 0x23, 0x1F, 0x0A, 0x04, 0x00, 0x20, 0x22, 0x1F, 0x0F, +0x04, 0x00, 0x20, 0x21, 0x1F, 0x16, 0x0C, 0x00, 0x20, 0x31, 0x2F, 0x20, 0x14, 0x00, 0x30, 0x31, +0x2F, 0x18, 0x10, 0x00, 0x30, 0x31, 0x2C, 0x18, 0x0C, 0x00, 0x30, 0x31, 0x2A, 0x14, 0x0C, 0x00, +0x30, 0x31, 0x28, 0x14, 0x00, 0x00, 0x30, 0x31, 0x24, 0x14, 0x00, 0x00, 0x30, 0x31, 0x1E, 0x14, +0x00, 0x00, 0x30, 0x04, 0x04, 0x04, 0x05, 0x04, 0x04, 0x05, 0x07, 0x07, 0x07, 0x08, 0x0A, 0x04, +0x07, 0x0A, 0x0E, 0x11, 0x13, 0x14, 0x15, 0x03, 0x04, 0x07, 0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x05, +0x05, 0x07, 0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x05, 0x05, 0x07, 0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x07, +0x08, 0x08, 0x0A, 0x0A, 0x0C, 0x0E, 0x10, 0x11, 0x11, 0x07, 0x09, 0x09, 0x0B, 0x0B, 0x0D, 0x0F, +0x13, 0x13, 0x14, 0x05, 0x05, 0x07, 0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x0F, 0x0F, 0x05, 0x05, 0x07, +0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x0F, 0x0F, 0x04, 0x04, 0x04, 0x05, 0x07, 0x07, 0x09, 0x09, 0x0C, +0x0E, 0x10, 0x12, 0x05, 0x06, 0x07, 0x0D, 0x10, 0x11, 0x12, 0x12, 0x07, 0x08, 0x09, 0x09, 0x0C, +0x0E, 0x11, 0x13, 0x09, 0x09, 0x09, 0x09, 0x0C, 0x0E, 0x11, 0x13, 0x09, 0x09, 0x09, 0x09, 0x0C, +0x0E, 0x11, 0x13, 0x05, 0x06, 0x08, 0x09, 0x0C, 0x0E, 0x12, 0x12, 0x13, 0x14, 0x07, 0x08, 0x09, +0x0A, 0x0C, 0x0F, 0x12, 0x12, 0x14, 0x16, 0x09, 0x09, 0x09, 0x09, 0x0C, 0x0E, 0x11, 0x13, 0x13, +0x13, 0x09, 0x09, 0x09, 0x09, 0x0C, 0x0E, 0x11, 0x13, 0x13, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x24, 0x26, 0x2A, 0x00, 0x00, 0x00, 0x1F, 0x21, 0x25, 0x27, 0x28, 0x00, +0x00, 0x00, 0x00, 0x23, 0x26, 0x28, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x23, 0x26, 0x28, 0x2A, 0x00, +0x00, 0x00, 0x00, 0x23, 0x26, 0x28, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x20, 0x25, 0x27, 0x29, 0x29, +0x2A, 0x00, 0x00, 0x00, 0x00, 0x20, 0x25, 0x27, 0x29, 0x29, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x23, +0x26, 0x28, 0x2A, 0x2A, 0x2A, 0x00, 0x00, 0x00, 0x1F, 0x23, 0x26, 0x28, 0x2A, 0x2A, 0x2A, 0x00, +0x04, 0x00, 0x04, 0x00, 0x08, 0x00, 0x10, 0x00, 0x18, 0x00, 0x24, 0x00, 0x30, 0x00, 0x48, 0x00, +0x60, 0x00, 0x90, 0x00, 0xC0, 0x00, 0xD8, 0x00, 0x3C, 0x00, 0x64, 0x00, 0x78, 0x00, 0xA0, 0x00, +0xF0, 0x01, 0x40, 0x01, 0x90, 0x01, 0xE0, 0x00, 0xA0, 0x00, 0xF0, 0x01, 0x40, 0x01, 0x90, 0x02, +0x58, 0x03, 0x20, 0x04, 0xB0, 0x06, 0x40, 0x00, 0xC8, 0x01, 0x18, 0x01, 0xE0, 0x02, 0xD0, 0x03, +0xE8, 0x04, 0xB0, 0x06, 0x40, 0x07, 0xD0, 0x00, 0xC8, 0x01, 0x18, 0x01, 0xE0, 0x02, 0xD0, 0x03, +0xE8, 0x04, 0xB0, 0x06, 0x40, 0x07, 0xD0, 0x00, 0x3C, 0x00, 0x50, 0x00, 0x64, 0x00, 0xA0, 0x00, +0xF0, 0x01, 0x40, 0x01, 0x90, 0x01, 0xE0, 0x02, 0x58, 0x03, 0x20, 0x00, 0x78, 0x00, 0xF0, 0x01, +0x90, 0x02, 0x58, 0x03, 0xE8, 0x07, 0xD0, 0x09, 0x60, 0x0F, 0xA0, 0x12, 0xC0, 0x15, 0x18, 0x00, +0xC8, 0x01, 0x18, 0x01, 0xE0, 0x02, 0xD0, 0x03, 0xE8, 0x04, 0xB0, 0x06, 0x40, 0x07, 0xD0, 0x07, +0xD0, 0x07, 0xD0, 0x00, 0xC8, 0x01, 0x18, 0x01, 0xE0, 0x02, 0xD0, 0x03, 0xE8, 0x04, 0xB0, 0x06, +0x40, 0x07, 0xD0, 0x07, 0xD0, 0x07, 0xD0, 0x00, 0x02, 0x00, 0x02, 0x00, 0x04, 0x00, 0x08, 0x00, +0x0C, 0x00, 0x12, 0x00, 0x18, 0x00, 0x24, 0x00, 0x30, 0x00, 0x48, 0x00, 0x60, 0x00, 0x6C, 0x00, +0x14, 0x00, 0x32, 0x00, 0x3C, 0x00, 0x50, 0x00, 0x78, 0x00, 0xA0, 0x00, 0xC8, 0x00, 0xF0, 0x00, +0x50, 0x00, 0x78, 0x00, 0xA0, 0x00, 0xC8, 0x01, 0x2C, 0x01, 0x90, 0x02, 0x58, 0x03, 0x20, 0x00, +0x64, 0x00, 0x8C, 0x00, 0xF0, 0x01, 0x68, 0x01, 0xF4, 0x02, 0x58, 0x03, 0x20, 0x03, 0xE8, 0x00, +0x64, 0x00, 0x8C, 0x00, 0xF0, 0x01, 0x68, 0x01, 0xF4, 0x02, 0x58, 0x03, 0x20, 0x03, 0xE8, 0x00, +0x1E, 0x00, 0x28, 0x00, 0x32, 0x00, 0x50, 0x00, 0x78, 0x00, 0xA0, 0x00, 0xC8, 0x00, 0xF0, 0x01, +0x2C, 0x01, 0x90, 0x00, 0x3C, 0x00, 0x78, 0x00, 0xC8, 0x01, 0x2C, 0x01, 0xF4, 0x03, 0xE8, 0x04, +0xB0, 0x07, 0xD0, 0x09, 0x60, 0x0A, 0xF0, 0x00, 0x64, 0x00, 0x8C, 0x00, 0xF0, 0x01, 0x68, 0x01, +0xF4, 0x02, 0x58, 0x03, 0x20, 0x03, 0xE8, 0x03, 0xE8, 0x03, 0xE8, 0x00, 0x64, 0x00, 0x8C, 0x00, +0xF0, 0x01, 0x68, 0x01, 0xF4, 0x02, 0x58, 0x03, 0x20, 0x03, 0xE8, 0x03, 0xE8, 0x03, 0xE8, 0x02, +0x04, 0x06, 0x08, 0x0A, 0x0C, 0x10, 0x18, 0x20, 0x30, 0x40, 0x50, 0x01, 0x01, 0x01, 0x02, 0x01, +0x02, 0x03, 0x03, 0x04, 0x04, 0x05, 0x05, 0x02, 0x04, 0x06, 0x07, 0x07, 0x08, 0x08, 0x08, 0x02, +0x02, 0x03, 0x03, 0x05, 0x05, 0x06, 0x06, 0x05, 0x06, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0A, 0x05, +0x06, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0A, 0x05, 0x06, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0A, 0x0A, +0x0B, 0x05, 0x06, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0B, 0x05, 0x06, 0x06, 0x07, 0x07, +0x08, 0x09, 0x0A, 0x0A, 0x0B, 0x05, 0x06, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0A, 0x0A, 0x0B, 0x01, +0x01, 0x01, 0x01, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x01, 0x02, 0x03, 0x04, 0x05, +0x06, 0x07, 0x08, 0x02, 0x04, 0x06, 0x07, 0x08, 0x0A, 0x0B, 0x0C, 0x03, 0x05, 0x06, 0x07, 0x08, +0x0A, 0x0B, 0x0C, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x02, 0x04, 0x06, 0x07, 0x08, +0x09, 0x0B, 0x0C, 0x0C, 0x0C, 0x03, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0B, 0x0C, 0x0C, 0x0C, 0x05, +0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0C, 0x0C, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, +0x0C, 0x0C, 0x0C, 0x19, 0x06, 0x04, 0x02, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0xC2, 0xAF, 0x80, 0xFE, 0x32, 0x12, 0x45, 0xC4, 0x85, 0xD0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x30, 0xE0, 0x03, 0x10, 0xE2, 0x0C, 0x7F, 0x00, 0x30, 0xE1, 0x07, 0x30, 0xE3, 0x04, 0x7F, +0x08, 0x54, 0xF4, 0x54, 0x7C, 0xC6, 0xD2, 0xAF, 0x54, 0x80, 0x42, 0x07, 0x22, 0x78, 0x86, 0xA6, +0x81, 0x74, 0x02, 0x60, 0x06, 0xFF, 0x08, 0x76, 0xFF, 0xDF, 0xFB, 0x7F, 0x03, 0xE4, 0x78, 0x80, +0xF6, 0x08, 0xF6, 0x08, 0xDF, 0xFA, 0x78, 0x81, 0x76, 0x30, 0x90, 0x49, 0x9F, 0x74, 0x01, 0x93, +0xC0, 0xE0, 0xE4, 0x93, 0xC0, 0xE0, 0x43, 0x89, 0x01, 0x75, 0x8A, 0x60, 0x75, 0x8C, 0x79, 0xD2, +0x8C, 0xD2, 0xAF, 0x22, 0x02, 0xEF, 0xD3, 0x94, 0x02, 0x40, 0x03, 0x7F, 0xFF, 0x22, 0x74, 0x81, +0x2F, 0x2F, 0xF8, 0xE6, 0x20, 0xE5, 0xF4, 0xC2, 0xAF, 0xE6, 0x44, 0x30, 0xF6, 0xD2, 0xAF, 0xAE, +0x0C, 0xEE, 0xC3, 0x9F, 0x50, 0x21, 0x0E, 0x74, 0x86, 0x2E, 0xF8, 0xE6, 0xF9, 0x08, 0xE6, 0x18, +0xBE, 0x02, 0x02, 0x74, 0xFF, 0xFD, 0xED, 0x69, 0x60, 0x09, 0x09, 0xE7, 0x19, 0x19, 0xF7, 0x09, +0x09, 0x80, 0xF3, 0x16, 0x16, 0x80, 0xDA, 0xEE, 0xD3, 0x9F, 0x40, 0x04, 0x05, 0x81, 0x05, 0x81, +0xEE, 0xD3, 0x9F, 0x40, 0x22, 0x74, 0x86, 0x2E, 0xF8, 0x08, 0xE6, 0xF9, 0xEE, 0xB5, 0x0C, 0x02, +0xA9, 0x81, 0x18, 0x06, 0x06, 0xE6, 0xFD, 0xED, 0x69, 0x60, 0x09, 0x19, 0x19, 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 0x78, 0x12, 0x75, 0x14, 0xE0, 0xFB, 0xE4, 0xFD, 0x0F, 0x71, +0x7E, 0xF1, 0xE8, 0xE0, 0xFB, 0x0D, 0x71, 0x7E, 0xF1, 0x55, 0xC4, 0x13, 0x54, 0x01, 0xFB, 0x0D, +0x7F, 0x01, 0x71, 0x7E, 0xF1, 0x55, 0x54, 0x1F, 0x71, 0x70, 0xE5, 0x26, 0x90, 0x89, 0x00, 0x12, +0x7C, 0x1A, 0x71, 0x72, 0xE5, 0x26, 0x90, 0x89, 0x01, 0x71, 0x6D, 0xE5, 0x26, 0x90, 0x89, 0x02, +0x71, 0x6D, 0xE5, 0x26, 0x90, 0x89, 0x03, 0x71, 0x6D, 0xE5, 0x26, 0x90, 0x89, 0x04, 0x12, 0x7C, +0x1A, 0x71, 0x72, 0xE5, 0x26, 0x90, 0x89, 0x05, 0x71, 0x6D, 0xE5, 0x26, 0x90, 0x89, 0x06, 0x71, +0x6D, 0xE5, 0x26, 0x90, 0x89, 0x07, 0x11, 0xBD, 0xE0, 0xFB, 0x0D, 0x71, 0x49, 0x91, 0x70, 0x30, +0xE0, 0x02, 0x31, 0xA5, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xEF, 0x70, 0x04, 0x74, 0xF0, 0x80, 0x16, +0xEF, 0xB4, 0x01, 0x04, 0x74, 0xF4, 0x80, 0x0E, 0xEF, 0xB4, 0x02, 0x04, 0x74, 0xF8, 0x80, 0x06, +0xEF, 0xB4, 0x03, 0x08, 0x74, 0xFC, 0x2D, 0x12, 0x6E, 0x34, 0xEB, 0xF0, 0x22, 0x11, 0xBD, 0xE0, +0xFB, 0x0D, 0x71, 0x49, 0x75, 0xF0, 0x08, 0x22, 0x54, 0x03, 0xFB, 0x0D, 0xE4, 0xFF, 0x71, 0x49, +0x75, 0xF0, 0x04, 0xE5, 0x26, 0x22, 0x7F, 0x54, 0x51, 0x6F, 0xE5, 0x0D, 0x5F, 0xF5, 0x11, 0x7F, +0x55, 0x51, 0x6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0xA8, 0xE5, 0x82, 0x2D, +0xF1, 0x73, 0xE0, 0xFB, 0xE4, 0xFF, 0x71, 0x49, 0x90, 0xA4, 0xF4, 0xE0, 0x04, 0xF0, 0xE0, 0xC3, +0x94, 0x10, 0x40, 0xDA, 0x91, 0x70, 0x30, 0xE0, 0x02, 0x31, 0xA5, 0xD0, 0xD0, 0x92, 0xAF, 0x22, +0x7F, 0x8F, 0x51, 0x6F, 0xEF, 0x22, 0xFF, 0x75, 0xF0, 0x04, 0xE5, 0x51, 0x90, 0x96, 0x18, 0x11, +0xBD, 0xE0, 0x22, 0x12, 0x06, 0x89, 0x54, 0x7F, 0xF5, 0x51, 0x12, 0x57, 0xA2, 0xFF, 0x54, 0x1F, +0xF5, 0x53, 0xF1, 0xD9, 0xF5, 0x52, 0xF1, 0x5D, 0xFF, 0x54, 0x03, 0xF5, 0x54, 0xEF, 0x54, 0x30, +0xC4, 0x54, 0x0F, 0xF5, 0x57, 0xF1, 0x5D, 0xFF, 0x54, 0x40, 0xC4, 0x13, 0x13, 0x54, 0x03, 0xF5, +0x55, 0xF1, 0xD9, 0xF5, 0x56, 0xF1, 0x5D, 0xFF, 0x54, 0x08, 0x13, 0x13, 0x13, 0x54, 0x1F, 0xF5, +0x59, 0xEF, 0x54, 0x04, 0x13, 0x13, 0x54, 0x3F, 0xF5, 0x5A, 0xE5, 0x56, 0x54, 0x01, 0xC4, 0x33, +0x33, 0x33, 0x54, 0x80, 0x91, 0x76, 0x54, 0x7F, 0x4F, 0xF0, 0xE5, 0x55, 0x54, 0x01, 0xC4, 0x33, +0x33, 0x54, 0xC0, 0x91, 0x76, 0x54, 0xBF, 0x4F, 0xF0, 0xE5, 0x59, 0x60, 0x02, 0xA1, 0x7B, 0xE5, +0x53, 0x54, 0x1F, 0xFF, 0x75, 0xF0, 0x04, 0xE5, 0x51, 0xF1, 0x55, 0x54, 0xE0, 0x4F, 0xF0, 0xE5, +0x54, 0x54, 0x03, 0x91, 0x76, 0x54, 0xFC, 0x4F, 0xF0, 0xEF, 0x25, 0xE0, 0x25, 0xE0, 0x91, 0x76, +0x54, 0xF3, 0x4F, 0xF0, 0xE5, 0x52, 0x54, 0x01, 0xC4, 0x33, 0x54, 0xE0, 0xFF, 0x75, 0xF0, 0x04, +0xE5, 0x51, 0xF1, 0x55, 0x54, 0xDF, 0x4F, 0xF0, 0xE5, 0x57, 0x54, 0x03, 0xC4, 0x54, 0xF0, 0x91, +0x76, 0x54, 0xCF, 0x4F, 0xF0, 0x74, 0x95, 0x25, 0x51, 0xB1, 0x83, 0xE0, 0x54, 0xFB, 0xF0, 0x74, +0x95, 0x25, 0x51, 0xB1, 0x83, 0xE0, 0xFF, 0xE5, 0x5A, 0x25, 0xE0, 0x25, 0xE0, 0xFE, 0xEF, 0x4E, +0xF0, 0xE4, 0xF5, 0x58, 0x85, 0x58, 0x82, 0x75, 0x83, 0x00, 0xA3, 0xA3, 0xA3, 0x12, 0x06, 0xA2, +0xFF, 0x75, 0xF0, 0x08, 0xE5, 0x51, 0x12, 0x56, 0xFE, 0x25, 0x58, 0xF1, 0x73, 0xEF, 0xF0, 0x05, +0x58, 0xE5, 0x58, 0xB4, 0x04, 0xDE, 0xAF, 0x51, 0x12, 0x55, 0x38, 0x22, 0xE4, 0xF5, 0x61, 0x74, +0x95, 0x25, 0x5B, 0xF5, 0x82, 0xE4, 0x34, 0x99, 0xF5, 0x83, 0x22, 0x12, 0x57, 0xDE, 0x12, 0x06, +0x89, 0xF5, 0x51, 0x24, 0x95, 0xB1, 0x83, 0xE0, 0x54, 0x9C, 0xF0, 0x74, 0x95, 0x25, 0x51, 0xB1, +0x83, 0xC0, 0x83, 0xC0, 0x82, 0xE0, 0xFF, 0xF1, 0x4C, 0x12, 0x7C, 0x23, 0xFE, 0xEF, 0x4E, 0xD0, +0x82, 0xD0, 0x83, 0xF0, 0x74, 0x95, 0x25, 0x51, 0xB1, 0x83, 0xC0, 0x83, 0xC0, 0x82, 0xE0, 0xFF, +0xF1, 0x4C, 0x90, 0x00, 0x03, 0x12, 0x06, 0xA2, 0x54, 0x02, 0xFE, 0xEF, 0x4E, 0xD0, 0x82, 0xD0, +0x83, 0xF0, 0x74, 0x95, 0x25, 0x51, 0xB1, 0x83, 0xC0, 0x83, 0xC0, 0x82, 0xE0, 0xFF, 0xF1, 0x4C, +0x90, 0x00, 0x03, 0x12, 0x06, 0xA2, 0x54, 0x40, 0xFE, 0xEF, 0x4E, 0xD0, 0x82, 0xD0, 0x83, 0xF0, +0x74, 0x95, 0x25, 0x51, 0xB1, 0x83, 0xC0, 0x83, 0xC0, 0x82, 0xE0, 0xFF, 0xF1, 0x4C, 0x90, 0x00, +0x03, 0x12, 0x06, 0xA2, 0x54, 0x20, 0xFE, 0xEF, 0x4E, 0xD0, 0x82, 0xD0, 0x83, 0xF0, 0xE5, 0x51, +0xC3, 0x94, 0x80, 0x50, 0x06, 0xF1, 0x5D, 0xF1, 0xED, 0xEF, 0xF0, 0x74, 0x95, 0x25, 0x51, 0xB1, +0x83, 0xE0, 0x30, 0xE5, 0x10, 0x91, 0x77, 0x13, 0x13, 0x54, 0x03, 0xFB, 0xF1, 0xEE, 0xE0, 0xFD, +0xAF, 0x51, 0x12, 0x75, 0x61, 0x22, 0xE4, 0xFF, 0xE4, 0xFE, 0x74, 0x95, 0x2F, 0xB1, 0x83, 0xE0, +0x54, 0xFE, 0xF0, 0x75, 0xF0, 0x10, 0xEF, 0x90, 0x81, 0x00, 0xBE, 0x03, 0x0C, 0x11, 0xBD, 0xE5, +0x82, 0x2E, 0xF1, 0x73, 0x74, 0x80, 0xF0, 0x80, 0x09, 0x11, 0xBD, 0xE5, 0x82, 0x2E, 0xF1, 0x73, +0xE4, 0xF0, 0x75, 0xF0, 0x08, 0xEF, 0x12, 0x56, 0xFE, 0x2E, 0xF1, 0x73, 0xE4, 0xF0, 0x0E, 0xBE, +0x10, 0xC8, 0x0F, 0xBF, 0x80, 0xC2, 0xE4, 0x90, 0xAD, 0xE2, 0xF0, 0x90, 0x94, 0x91, 0x12, 0x08, +0x79, 0x00, 0x00, 0x00, 0x00, 0xE4, 0xFF, 0xE4, 0xFE, 0x75, 0xF0, 0x0A, 0xEF, 0x12, 0x62, 0xB8, +0x75, 0xF0, 0x02, 0xEE, 0x12, 0x64, 0xE0, 0xF0, 0x0E, 0xBE, 0x05, 0xED, 0x74, 0x15, 0x2F, 0x12, +0x57, 0xD2, 0xE4, 0x12, 0x63, 0x50, 0x34, 0x92, 0x12, 0x52, 0xDB, 0x12, 0x66, 0x62, 0xE4, 0xF0, +0xEF, 0x12, 0x53, 0x78, 0x12, 0x52, 0xDB, 0xEF, 0x12, 0x53, 0x69, 0x12, 0x52, 0xCB, 0xEF, 0x12, +0x53, 0x96, 0x12, 0x52, 0xDB, 0x12, 0x75, 0x10, 0x74, 0x3F, 0xF1, 0xE3, 0xE4, 0xF0, 0xF1, 0x51, +0x54, 0xE0, 0x44, 0x09, 0xF0, 0x75, 0xF0, 0x04, 0xEF, 0x91, 0x7C, 0x54, 0xF3, 0xF0, 0x75, 0xF0, +0x04, 0xEF, 0x91, 0x7C, 0x54, 0xFC, 0xF0, 0xF1, 0x51, 0x44, 0x20, 0xF0, 0x75, 0xF0, 0x04, 0xEF, +0x91, 0x7C, 0x54, 0xCF, 0xF0, 0x75, 0xF0, 0x04, 0xEF, 0x91, 0x7C, 0x44, 0x40, 0xF0, 0x75, 0xF0, +0x04, 0xEF, 0x91, 0x7C, 0x54, 0x7F, 0xF1, 0xE3, 0xE0, 0xFE, 0x75, 0xF0, 0x10, 0xEF, 0x12, 0x53, +0xA8, 0xEE, 0xF0, 0x74, 0x95, 0x2F, 0xB1, 0x83, 0xE4, 0xF0, 0x0F, 0xEF, 0x64, 0x80, 0x60, 0x02, +0xC1, 0x87, 0x90, 0x04, 0x49, 0x74, 0xF0, 0xF0, 0xA3, 0xE4, 0xF0, 0xA3, 0x74, 0xFF, 0xF0, 0x90, +0x04, 0x33, 0x74, 0x02, 0xF0, 0xA3, 0x74, 0x04, 0x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 0xFD, +0xE4, 0xFF, 0x74, 0xD5, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0xA3, 0xF5, 0x83, 0xE4, 0xF0, 0x0F, 0xEF, +0xB4, 0x0C, 0xEF, 0xED, 0x30, 0xE0, 0x46, 0x71, 0x82, 0x40, 0x42, 0xA3, 0xE0, 0xD3, 0x94, 0x80, +0x40, 0x3B, 0x90, 0xA3, 0xD5, 0x74, 0x01, 0x71, 0x60, 0x90, 0xA3, 0xD6, 0x71, 0x5F, 0x78, 0x08, +0x12, 0x08, 0x47, 0x90, 0xA3, 0xD7, 0x71, 0x5F, 0x78, 0x10, 0x12, 0x08, 0x47, 0x90, 0xA3, 0xD8, +0x71, 0x5F, 0x78, 0x18, 0x12, 0x08, 0x47, 0x90, 0xA3, 0xD9, 0xEF, 0xF0, 0x71, 0x8A, 0x74, 0x05, +0xF0, 0x90, 0x94, 0x91, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0x41, 0x9F, 0xED, 0x30, 0xE1, +0x54, 0x90, 0xA3, 0xD5, 0x74, 0x02, 0xF0, 0x71, 0x82, 0x50, 0x17, 0x71, 0x94, 0x51, 0xB9, 0x90, +0xA3, 0xD6, 0x51, 0xAB, 0x90, 0xA3, 0xD8, 0xF0, 0xEE, 0xA3, 0xF0, 0x90, 0xA3, 0xD1, 0x51, 0xC0, +0x80, 0x06, 0x90, 0xA3, 0xD6, 0x74, 0xEA, 0xF0, 0x90, 0xA3, 0xD2, 0xE0, 0xD3, 0x94, 0x80, 0x50, +0x17, 0x71, 0x94, 0x51, 0xB9, 0x90, 0xA3, 0xDA, 0x51, 0xAB, 0x90, 0xA3, 0xDC, 0xF0, 0xEE, 0xA3, +0xF0, 0x90, 0xA3, 0xD2, 0x51, 0xC0, 0x80, 0x06, 0x90, 0xA3, 0xDA, 0x74, 0xEA, 0xF0, 0x71, 0x8A, +0x74, 0x09, 0xF0, 0x41, 0x9F, 0xED, 0x70, 0x7C, 0x90, 0xA3, 0x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, 0xE0, 0x24, 0x15, 0xF5, 0x82, 0xE4, 0x34, 0x9E, 0xF5, 0x83, 0xE4, 0xF0, 0xA3, +0xF0, 0x22, 0x90, 0xA3, 0xCE, 0x12, 0x48, 0xD2, 0x90, 0xA3, 0xCD, 0xEF, 0xF0, 0x12, 0x48, 0xDB, +0x53, 0x15, 0x00, 0x53, 0x1A, 0x01, 0x53, 0x1F, 0x08, 0x53, 0x24, 0x09, 0x53, 0x29, 0x0A, 0x53, +0x2E, 0x12, 0x53, 0x33, 0x13, 0x53, 0x37, 0x40, 0x53, 0x3C, 0x42, 0x53, 0x41, 0x43, 0x53, 0x45, +0x44, 0x00, 0x00, 0x53, 0x49, 0x71, 0x59, 0x02, 0x69, 0xE6, 0x71, 0x59, 0x02, 0x67, 0x3E, 0x71, +0x59, 0x02, 0x6A, 0x7E, 0x71, 0x59, 0x02, 0x6A, 0x38, 0x71, 0x59, 0x02, 0x6A, 0x5B, 0x71, 0x59, +0x02, 0x6B, 0x45, 0x71, 0x59, 0xE1, 0x2D, 0x71, 0x59, 0x02, 0x4C, 0x83, 0x71, 0x59, 0x02, 0x4D, +0x8B, 0x71, 0x59, 0x21, 0x51, 0x71, 0x59, 0x80, 0x65, 0x90, 0x01, 0xC0, 0xE0, 0x44, 0x01, 0xF0, +0x90, 0xA3, 0xCD, 0xE0, 0x90, 0x01, 0xC2, 0xF0, 0x22, 0x90, 0xA3, 0xCE, 0x02, 0x48, 0xC9, 0xEF, +0xF0, 0x90, 0x94, 0x91, 0x02, 0x48, 0xA5, 0xE0, 0xFF, 0x25, 0xE0, 0x24, 0x95, 0xF5, 0x82, 0xE4, +0x34, 0x9C, 0x22, 0xF0, 0xEE, 0xA3, 0xF0, 0xED, 0x25, 0xE0, 0x24, 0x95, 0xF5, 0x82, 0xE4, 0x34, +0x9B, 0x22, 0x90, 0xA3, 0xD1, 0xE0, 0xD3, 0x94, 0x80, 0x22, 0x90, 0xA3, 0xD3, 0x74, 0x0D, 0xF0, +0x90, 0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0, 0x12, 0x6E, 0x0C, 0xA8, 0x01, 0xFC, +0x7D, 0x01, 0xD0, 0x01, 0x7E, 0x00, 0x7F, 0x0F, 0x12, 0x06, 0x63, 0x90, 0xA3, 0x8C, 0xF1, 0xE4, +0xB4, 0x0A, 0x02, 0x7F, 0x01, 0xEF, 0x60, 0x05, 0xE4, 0x90, 0xA3, 0x8C, 0xF0, 0xD0, 0xD0, 0x92, +0xAF, 0x22, 0xE4, 0xF5, 0x62, 0x90, 0xA3, 0xC2, 0xE0, 0xFF, 0xE5, 0x62, 0xC3, 0x9F, 0x40, 0x02, +0xA1, 0x26, 0xAF, 0x62, 0x12, 0x66, 0x85, 0xEF, 0x70, 0x02, 0xA1, 0x22, 0xE5, 0x62, 0x13, 0x13, +0x13, 0x54, 0x1F, 0xFF, 0xE5, 0x62, 0x54, 0x07, 0xFE, 0x74, 0x81, 0x2F, 0x12, 0x64, 0xD8, 0xE0, +0xFD, 0xAF, 0x06, 0x12, 0x66, 0x71, 0x80, 0x05, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, 0xF9, 0xFF, +0xEF, 0x5D, 0x60, 0x6E, 0x75, 0xF0, 0x10, 0xE5, 0x62, 0xF1, 0x07, 0x20, 0xE7, 0x02, 0x80, 0x10, +0x75, 0xF0, 0x10, 0xE5, 0x62, 0x90, 0x81, 0x02, 0x12, 0x48, 0xBD, 0xE0, 0xFF, 0x20, 0xE7, 0x09, +0x90, 0x01, 0xC1, 0xE0, 0x44, 0x20, 0xF0, 0x80, 0x49, 0xEF, 0x30, 0xE6, 0x12, 0x75, 0xF0, 0x10, +0xE5, 0x62, 0x71, 0xA8, 0xF1, 0x0F, 0x12, 0x4C, 0x7C, 0xB1, 0x31, 0xE4, 0xFB, 0x80, 0x2E, 0xB1, +0x27, 0xF5, 0x83, 0xE0, 0x04, 0xF0, 0xB1, 0x27, 0xF5, 0x83, 0xE0, 0xD3, 0x94, 0x01, 0x40, 0x0D, +0xAF, 0x62, 0x12, 0x74, 0xC2, 0xB1, 0x27, 0xF5, 0x83, 0xE4, 0xF0, 0x80, 0x15, 0x75, 0xF0, 0x10, +0xE5, 0x62, 0x71, 0xA8, 0xF1, 0x0F, 0x12, 0x4C, 0x7C, 0xB1, 0x31, 0x7B, 0x01, 0xAF, 0x62, 0x12, +0x63, 0x63, 0x05, 0x62, 0x81, 0x75, 0x22, 0x74, 0x15, 0x25, 0x62, 0xF5, 0x82, 0xE4, 0x34, 0xA1, +0x22, 0x13, 0x13, 0x54, 0x03, 0xF5, 0x69, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, +0xA4, 0xEA, 0xEF, 0xF0, 0x75, 0xF0, 0x04, 0x12, 0x4F, 0x55, 0x54, 0x1F, 0xFB, 0x60, 0x12, 0x64, +0x02, 0x60, 0x0E, 0xEB, 0x64, 0x04, 0x60, 0x09, 0xEB, 0x64, 0x09, 0x60, 0x04, 0xEB, 0xB4, 0x0C, +0x07, 0xF1, 0xCC, 0x74, 0x02, 0xF0, 0x80, 0x05, 0xF1, 0xCC, 0x74, 0x01, 0xF0, 0xE4, 0xF5, 0x6A, +0x90, 0xA4, 0xEA, 0xE0, 0xFD, 0xD1, 0xFB, 0x25, 0x6A, 0x12, 0x4F, 0x73, 0xE0, 0xFE, 0xEB, 0x75, +0xF0, 0x07, 0xA4, 0x24, 0x56, 0xF5, 0x82, 0xE4, 0x34, 0x40, 0xF5, 0x83, 0xE5, 0x82, 0x25, 0x6A, +0x12, 0x4F, 0x73, 0xE4, 0x93, 0xFC, 0xEE, 0x5C, 0x90, 0xA4, 0xEC, 0xF0, 0x75, 0xF0, 0x04, 0xED, +0x12, 0x4C, 0x7C, 0x54, 0x03, 0xFF, 0xBF, 0x02, 0x0B, 0xE5, 0x6A, 0x70, 0x07, 0x90, 0xA4, 0xEC, +0xE0, 0x54, 0xF0, 0xF0, 0x90, 0xA4, 0xEC, 0xE0, 0xFF, 0xD1, 0xF7, 0x25, 0x6A, 0x12, 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 0xF0, 0xE0, 0x7F, 0x00, 0x22, 0xF1, 0xC2, 0xE0, 0x44, 0x40, +0xF0, 0x22, 0x90, 0xA3, 0xD1, 0xE0, 0x90, 0xA3, 0xD5, 0xF0, 0x22, 0x7F, 0xF4, 0x12, 0x4A, 0x6F, +0xEF, 0x20, 0xE5, 0x0E, 0x7F, 0xF4, 0x12, 0x4A, 0x6F, 0xEF, 0x7F, 0x01, 0x20, 0xE4, 0x05, 0x7F, +0x02, 0x22, 0x7F, 0x03, 0x22, 0x12, 0x57, 0xFB, 0x90, 0xA2, 0x9B, 0xEF, 0xF0, 0x11, 0x2F, 0x90, +0x01, 0x64, 0x74, 0x01, 0xF0, 0x90, 0x04, 0x23, 0xE0, 0x44, 0x80, 0xF0, 0x02, 0x36, 0x83, 0x12, +0x4F, 0x7B, 0x12, 0x4F, 0x9D, 0x11, 0x62, 0x11, 0x81, 0xE4, 0xF5, 0x0D, 0xF5, 0x0E, 0xF5, 0x0F, +0x75, 0x10, 0x80, 0x43, 0x10, 0x02, 0xAD, 0x0D, 0x7F, 0x50, 0x12, 0x49, 0xA9, 0xAD, 0x0E, 0x7F, +0x51, 0x12, 0x49, 0xA9, 0xAD, 0x0F, 0x7F, 0x52, 0x12, 0x49, 0xA9, 0xAD, 0x10, 0x7F, 0x53, 0x02, +0x49, 0xA9, 0x75, 0x15, 0x12, 0xE4, 0xF5, 0x16, 0x75, 0x17, 0x87, 0x75, 0x18, 0x73, 0x90, 0x01, +0x30, 0xE5, 0x15, 0xF0, 0xA3, 0xE5, 0x16, 0xF0, 0xA3, 0xE5, 0x17, 0xF0, 0xA3, 0xE5, 0x18, 0xF0, +0x22, 0x75, 0x1D, 0x06, 0x75, 0x1E, 0x01, 0x75, 0x1F, 0x03, 0x75, 0x20, 0x62, 0x90, 0x01, 0x38, +0xE5, 0x1D, 0xF0, 0xA3, 0xE5, 0x1E, 0xF0, 0xA3, 0xE5, 0x1F, 0xF0, 0xA3, 0xE5, 0x20, 0xF0, 0x22,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3, 0x02, 0xD1, 0x79, +0xE5, 0x19, 0x30, 0xE4, 0x02, 0x91, 0xE7, 0xE5, 0x19, 0x30, 0xE5, 0x03, 0x12, 0x6E, 0xA5, 0xE5, +0x1B, 0x30, 0xE0, 0x02, 0xD1, 0x57, 0xE5, 0x1B, 0x30, 0xE1, 0x02, 0x91, 0xFA, 0xE5, 0x1B, 0x30, +0xE7, 0x02, 0xD1, 0x37, 0xE5, 0x1C, 0x30, 0xE0, 0x02, 0xD1, 0x47, 0xE5, 0x1C, 0x30, 0xE4, 0x02, +0x31, 0x87, 0xE5, 0x1C, 0x30, 0xE5, 0x03, 0x12, 0x57, 0xDA, 0xE5, 0x1C, 0x30, 0xE6, 0x02, 0x11, +0xDC, 0xD0, 0x07, 0xD0, 0x06, 0xD0, 0x05, 0xD0, 0x04, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, +0x00, 0xD0, 0xD0, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xF0, 0xD0, 0xE0, 0x32, 0x90, 0x07, 0x1F, 0xE0, +0x54, 0x7F, 0xF0, 0x90, 0x07, 0x1C, 0xE0, 0x54, 0x01, 0xFF, 0x90, 0xA4, 0x57, 0xF0, 0x90, 0xA4, +0x55, 0x74, 0x02, 0xF0, 0x90, 0xA4, 0x63, 0x14, 0xF0, 0xFB, 0x7A, 0xA4, 0x79, 0x55, 0x12, 0x54, +0x14, 0x7F, 0x04, 0x02, 0x51, 0x36, 0xE4, 0xFF, 0x90, 0xA4, 0x55, 0xEF, 0xF0, 0x90, 0x04, 0x7E, +0xE0, 0xF5, 0x63, 0xA3, 0xE0, 0xF5, 0x64, 0x65, 0x63, 0x60, 0x6B, 0x90, 0xA4, 0x56, 0x74, 0x03, +0xF0, 0x90, 0xA4, 0x64, 0x74, 0x08, 0xF0, 0xE5, 0x64, 0x04, 0x54, 0x0F, 0xF5, 0x65, 0xE4, 0xF5, +0x62, 0xE5, 0x65, 0x75, 0xF0, 0x08, 0xA4, 0x24, 0x00, 0xF5, 0x82, 0xE4, 0x34, 0x80, 0xF5, 0x83, +0xE5, 0x82, 0x25, 0x62, 0x12, 0x4F, 0x73, 0xE0, 0xFF, 0x74, 0x58, 0x25, 0x62, 0xF5, 0x82, 0xE4, +0x34, 0xA4, 0xF5, 0x83, 0xEF, 0xF0, 0x05, 0x62, 0xE5, 0x62, 0xB4, 0x08, 0xD4, 0x7B, 0x01, 0x7A, +0xA4, 0x79, 0x56, 0x12, 0x54, 0x14, 0xE5, 0x64, 0x04, 0x54, 0x0F, 0xF5, 0x64, 0xB4, 0x0F, 0x03, +0xE4, 0xF5, 0x64, 0x90, 0x04, 0x7F, 0xE5, 0x64, 0xF0, 0x90, 0xA4, 0x55, 0xE0, 0x7F, 0x04, 0x70, +0x02, 0x81, 0xEB, 0x12, 0x51, 0x36, 0x22, 0xE4, 0xFF, 0x90, 0xA4, 0x65, 0xEF, 0xF0, 0x7E, 0x00, +0x7F, 0x10, 0x7D, 0x00, 0x7B, 0x01, 0x7A, 0xA4, 0x79, 0x67, 0x12, 0x08, 0xAA, 0x90, 0xA3, 0xC2, +0xE0, 0x90, 0xA4, 0x79, 0xF0, 0xE4, 0x90, 0xA4, 0x66, 0xF0, 0x90, 0xA4, 0x79, 0xE0, 0xFE, 0x90, +0xA4, 0x66, 0xE0, 0xFD, 0xC3, 0x9E, 0x50, 0x43, 0xED, 0x51, 0xD8, 0xED, 0x54, 0x07, 0xA3, 0xF0, +0x75, 0xF0, 0x10, 0xED, 0x12, 0x57, 0xC6, 0xE0, 0x30, 0xE7, 0x09, 0x74, 0x81, 0x2D, 0x51, 0xBE, +0xE4, 0xF0, 0x80, 0x1F, 0xAF, 0x05, 0x12, 0x57, 0xEB, 0x51, 0xEE, 0xC0, 0x83, 0xC0, 0x82, 0xE0, +0xFF, 0x90, 0xA4, 0x78, 0x12, 0x4A, 0x67, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0x4F, 0xD0, 0x82, +0xD0, 0x83, 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, 0xBE, 0x74, 0x01, 0xF0, 0x90, +0xA4, 0x66, 0xE0, 0x04, 0xF0, 0x41, 0x07, 0x22, 0x90, 0x8D, 0x01, 0x02, 0x48, 0xBD, 0xF5, 0x82, +0xE4, 0x34, 0x93, 0xF5, 0x83, 0x22, 0x90, 0xA4, 0x66, 0xE0, 0xFF, 0x75, 0xF0, 0x10, 0x22, 0x12, +0x48, 0xBD, 0xE0, 0xFD, 0x75, 0xF0, 0x10, 0x22, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x90, 0xA4, 0x77, +0xF0, 0x22, 0x12, 0x48, 0xBD, 0xE0, 0xFE, 0xED, 0xFF, 0x90, 0xA4, 0x66, 0xE0, 0x22, 0x90, 0xA4, +0x77, 0xE0, 0x24, 0x67, 0xF5, 0x82, 0xE4, 0x34, 0xA4, 0xF5, 0x83, 0x22, 0xD3, 0x10, 0xAF, 0x01, +0xC3, 0xC0, 0xD0, 0xED, 0x60, 0x2C, 0x75, 0xF0, 0x0A, 0xEF, 0x90, 0x8D, 0x01, 0x71, 0x45, 0xEF, +0x90, 0x8D, 0x03, 0x71, 0x45, 0xEF, 0x90, 0x8D, 0x05, 0x71, 0x45, 0xEF, 0x90, 0x8D, 0x07, 0x71, +0x45, 0xEF, 0x90, 0x8D, 0x09, 0x91, 0xE0, 0x71, 0x50, 0x34, 0x92, 0x12, 0x52, 0xDB, 0xD1, 0x62, +0xE4, 0xF0, 0x12, 0x57, 0xC2, 0xE0, 0x54, 0xBF, 0x44, 0x80, 0xFE, 0x12, 0x57, 0xC2, 0xEE, 0xF0, +0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x12, 0x48, 0xBD, 0xE4, 0xF0, 0xA3, 0xF0, 0x75, 0xF0, 0x0A, 0x22, +0xF0, 0xEF, 0x25, 0xE0, 0x24, 0x01, 0xF5, 0x82, 0xE4, 0x22, 0x85, 0x5E, 0x69, 0x7B, 0x01, 0xAD, +0x5C, 0xAF, 0x5B, 0xD3, 0x10, 0xAF, 0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0xF0, 0x90, +0xA4, 0xB2, 0xE0, 0x54, 0x7F, 0xF0, 0x80, 0x3F, 0x91, 0xD2, 0xC0, 0x83, 0xC0, 0x82, 0xE0, 0xFF, +0x90, 0xA4, 0xB1, 0x12, 0x4A, 0x67, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0x4F, 0xD0, 0x82, 0xD0, +0x83, 0xF0, 0x75, 0xF0, 0x10, 0xE5, 0x66, 0x12, 0x57, 0x07, 0x54, 0x07, 0xFF, 0x90, 0xA4, 0xB2, +0xF0, 0x90, 0xA4, 0xB0, 0xE0, 0x90, 0x43, 0xAB, 0x93, 0xFE, 0x33, 0x33, 0x33, 0x54, 0xF8, 0x4F, +0x90, 0xA4, 0xB2, 0xF0, 0x44, 0x80, 0xF0, 0x75, 0xF0, 0x10, 0xE5, 0x66, 0x12, 0x53, 0xA8, 0xE5, +0x67, 0xF0, 0xE5, 0x66, 0x70, 0x06, 0x90, 0x01, 0xC8, 0xE5, 0x67, 0xF0, 0x90, 0xA4, 0xB2, 0xE0, +0xFF, 0x75, 0xF0, 0x10, 0xE5, 0x66, 0x90, 0x81, 0x01, 0x12, 0x48, 0xBD, 0xEF, 0xF0, 0x75, 0xF0, +0x10, 0xE5, 0x66, 0x91, 0xBE, 0xE0, 0x54, 0xFC, 0xFF, 0xE5, 0x69, 0x12, 0x7C, 0x2C, 0xE5, 0x66, +0x91, 0xBE, 0xEF, 0xF0, 0x7D, 0x01, 0xAF, 0x66, 0x51, 0xFC, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xE5, +0x67, 0x54, 0x7F, 0x90, 0xA4, 0xB0, 0xF0, 0x22, 0x8F, 0x57, 0x75, 0xF0, 0x10, 0xEF, 0x90, 0x81, +0x05, 0x02, 0x48, 0xBD, 0xE5, 0x5B, 0x25, 0xE0, 0x24, 0x95, 0xF5, 0x82, 0xE4, 0x34, 0x94, 0xF5, +0x83, 0x22, 0x90, 0xA4, 0xAF, 0xE0, 0x24, 0x81, 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, 0x22, 0xF1, 0x98, 0xED, 0x70, 0x12, 0xD1, 0xA6, 0xC0, 0x83, 0xC0, 0x82, 0xF1, 0x36, +0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0xF4, 0x5E, 0x80, 0x0F, 0xD1, 0xA6, 0xC0, 0x83, 0xC0, 0x82, +0xF1, 0x36, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0x4E, 0xD0, 0x82, 0xD0, 0x83, 0xF0, 0xD1, 0xB1, +0x90, 0xA3, 0xC2, 0xEF, 0xF0, 0x22, 0xE0, 0xFE, 0x74, 0x01, 0xA8, 0x07, 0x08, 0x22, 0x8B, 0x51, +0x8A, 0x52, 0x89, 0x53, 0x12, 0x57, 0xA2, 0xFF, 0xF5, 0x55, 0x12, 0x06, 0x89, 0xFE, 0xC3, 0x13, +0x30, 0xE0, 0x07, 0x12, 0x4F, 0x5D, 0xF5, 0x56, 0x80, 0x02, 0x8F, 0x56, 0x85, 0x55, 0x54, 0xE5, +0x54, 0xD3, 0x95, 0x56, 0x50, 0x23, 0xAB, 0x51, 0xAA, 0x52, 0xA9, 0x53, 0x12, 0x06, 0x89, 0x54, +0x01, 0xFD, 0xAF, 0x54, 0xF1, 0x03, 0xAF, 0x54, 0xD1, 0x85, 0xEF, 0xAF, 0x54, 0x70, 0x04, 0xF1, +0x91, 0x80, 0x02, 0xF1, 0x8A, 0x05, 0x54, 0x80, 0xD6, 0x22, 0x91, 0xB8, 0xE0, 0x54, 0xFB, 0xF0, +0x22, 0x91, 0xB8, 0xE0, 0x44, 0x04, 0xF0, 0x22, 0xEF, 0x13, 0x13, 0x13, 0x54, 0x1F, 0xFE, 0xEF, +0x54, 0x07, 0xFF, 0x22, 0xE4, 0xFD, 0xFF, 0xE1, 0x03, 0xF1, 0xA4, 0x12, 0x6C, 0x6C, 0x12, 0x4E, +0x36, 0xF1, 0xD0, 0x90, 0xA3, 0xC3, 0xE0, 0x54, 0x7F, 0xF0, 0x54, 0xBF, 0x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 0x12, 0x48, 0xA5, 0x90, +0xAA, 0xB9, 0x02, 0x08, 0x6D, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x11, 0x63, 0xD0, 0xD0, +0x92, 0xAF, 0x22, 0x90, 0x01, 0x9A, 0xE0, 0x54, 0xC0, 0x44, 0x0B, 0x12, 0x5F, 0xA5, 0x90, 0x01, +0x98, 0xE0, 0x54, 0xC0, 0x7F, 0x00, 0xB4, 0x40, 0x02, 0x7F, 0x01, 0x22, 0xD3, 0x10, 0xAF, 0x01, +0xC3, 0xC0, 0xD0, 0x90, 0xA4, 0x8E, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0x12, 0x37, 0xBC, 0x90, 0xA4, +0x98, 0x12, 0x08, 0x6D, 0x90, 0xA4, 0x90, 0x12, 0x48, 0xA5, 0x12, 0x08, 0x3A, 0x90, 0xA4, 0x98, +0x12, 0x48, 0xB1, 0x12, 0x48, 0x7A, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xA4, +0x90, 0x12, 0x48, 0xA5, 0x90, 0xA4, 0x94, 0x12, 0x48, 0xB1, 0x12, 0x48, 0x7A, 0xD0, 0x03, 0xD0, +0x02, 0xD0, 0x01, 0xD0, 0x00, 0x12, 0x48, 0x87, 0x90, 0xA4, 0x9C, 0x12, 0x08, 0x6D, 0x90, 0xA4, +0x9C, 0x31, 0x2C, 0x90, 0xA4, 0x8E, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x12, 0x38, 0x07, 0xD0, 0xD0, +0x92, 0xAF, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xC0, 0x07, 0xC0, 0x05, 0x90, 0xA4, +0xCE, 0x12, 0x48, 0xA5, 0x90, 0xAA, 0x9C, 0x12, 0x08, 0x6D, 0xD0, 0x05, 0xD0, 0x07, 0x12, 0x32, +0x34, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0x02, 0x09, 0xE0, 0xF5, 0x51, 0x12, 0x06, 0x89, 0x25, +0x51, 0x90, 0xA2, 0x9C, 0x12, 0x57, 0xA1, 0x25, 0x51, 0x90, 0xA2, 0x9D, 0x12, 0x4F, 0x5C, 0x25, +0x51, 0x90, 0xA2, 0x9E, 0xF0, 0x90, 0x00, 0x03, 0x12, 0x06, 0xA2, 0x25, 0x51, 0x90, 0xA2, 0x9F, +0x51, 0x31, 0x25, 0x51, 0x90, 0xA2, 0xA0, 0xF0, 0x90, 0x00, 0x05, 0x12, 0x06, 0xA2, 0x25, 0x51, +0x90, 0xA2, 0xA1, 0xF0, 0x90, 0x00, 0x06, 0x12, 0x06, 0xA2, 0x25, 0x51, 0x90, 0xA2, 0xA2, 0xF0, +0x22, 0xF0, 0x90, 0x00, 0x04, 0x02, 0x06, 0xA2, 0x12, 0x06, 0x89, 0x90, 0xA3, 0xA7, 0x12, 0x57, +0xA1, 0x90, 0xA3, 0xA8, 0x12, 0x4F, 0x5C, 0x90, 0xA3, 0xA9, 0xF0, 0x90, 0x00, 0x03, 0x12, 0x06, +0xA2, 0x90, 0xA3, 0xAA, 0x51, 0x31, 0x90, 0xA3, 0xAB, 0xF0, 0x22, 0x12, 0x06, 0x89, 0x90, 0xA3, +0xAC, 0x12, 0x57, 0xA1, 0x90, 0xA3, 0xAD, 0x12, 0x4F, 0x5C, 0x90, 0xA3, 0xAE, 0xF0, 0x90, 0x00, +0x03, 0x12, 0x06, 0xA2, 0x90, 0xA3, 0xAF, 0x51, 0x31, 0x90, 0xA3, 0xB0, 0xF0, 0x22, 0x12, 0x57, +0xDE, 0x12, 0x06, 0x89, 0x30, 0xE0, 0x12, 0x71, 0x11, 0x90, 0xA2, 0x9B, 0xE0, 0xB4, 0x01, 0x0C, +0x90, 0xFE, 0x10, 0xE0, 0x44, 0x04, 0xF0, 0x80, 0x03, 0x12, 0x5F, 0x32, 0x12, 0x4F, 0x4C, 0x12, +0x57, 0xA2, 0x90, 0xA3, 0x90, 0x12, 0x4F, 0x5C, 0x90, 0xA3, 0x91, 0xF0, 0x90, 0xA3, 0x90, 0xE0, +0x54, 0x01, 0x90, 0xA3, 0x9D, 0xF0, 0x90, 0xA3, 0x90, 0xE0, 0x54, 0x02, 0x90, 0xA3, 0x9E, 0xF0, +0x90, 0xA3, 0x90, 0xE0, 0x54, 0x04, 0x90, 0xA3, 0x9F, 0xF0, 0x90, 0xA3, 0x90, 0xE0, 0x54, 0x08, +0x90, 0xA3, 0xA0, 0xF0, 0x90, 0xA3, 0x90, 0xE0, 0x54, 0x10, 0x90, 0xA3, 0xA1, 0xF0, 0x90, 0xA3, +0x91, 0xE0, 0x54, 0x01, 0x90, 0xA3, 0xA2, 0xF0, 0x90, 0xA3, 0x91, 0xE0, 0x54, 0x02, 0x90, 0xA3, +0xA3, 0xF0, 0x90, 0xA3, 0x91, 0xE0, 0x54, 0x04, 0x90, 0xA3, 0xA4, 0xF0, 0x90, 0xA3, 0x91, 0xE0, +0x54, 0x08, 0x90, 0xA3, 0xA5, 0xF0, 0x90, 0xA3, 0x91, 0xE0, 0x54, 0x10, 0x90, 0xA3, 0xA6, 0xF0, +0x22, 0x12, 0x5F, 0xDC, 0x90, 0xA3, 0x8D, 0xF0, 0xA3, 0xEF, 0xF0, 0x90, 0x02, 0x86, 0xE0, 0x44, +0x04, 0xF0, 0x90, 0xA3, 0x8F, 0xE0, 0x44, 0x01, 0xF0, 0x7D, 0x08, 0xE4, 0xFF, 0x12, 0x5F, 0xD0, +0x90, 0x05, 0x52, 0xE0, 0x54, 0x07, 0x04, 0x90, 0xA3, 0x9A, 0x12, 0x67, 0xDE, 0x90, 0x04, 0x22, +0xE0, 0x54, 0xEF, 0xF0, 0x22, 0x12, 0x06, 0x89, 0xFF, 0x90, 0xA3, 0xB1, 0xF0, 0xBF, 0x01, 0x07, +0x71, 0x58, 0xE4, 0x90, 0xA3, 0xB1, 0xF0, 0x22, 0x91, 0x03, 0x7F, 0xF5, 0x7E, 0x01, 0x12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, 0x92, 0xAF, 0x22, 0x90, 0xA4, 0xDC, 0xEF, 0xF0, 0xA3, 0x12, 0x48, +0xD2, 0x90, 0xA4, 0xEE, 0xE0, 0xFE, 0x04, 0xF0, 0x90, 0x00, 0x01, 0xEE, 0x12, 0x06, 0xE1, 0x74, +0x00, 0x2F, 0xF9, 0xE4, 0x34, 0xFB, 0xFA, 0x7B, 0x01, 0xC0, 0x03, 0xC0, 0x02, 0xC0, 0x01, 0x90, +0xA4, 0xDD, 0x12, 0x48, 0xC9, 0x8B, 0x40, 0x8A, 0x41, 0x89, 0x42, 0x75, 0x43, 0x02, 0xD0, 0x01, +0xD0, 0x02, 0xD0, 0x03, 0x12, 0x34, 0x62, 0x90, 0xA4, 0xDC, 0xE0, 0x24, 0x02, 0xF9, 0xE4, 0x34, +0xFB, 0xFA, 0x7B, 0x01, 0xC0, 0x03, 0xC0, 0x02, 0xC0, 0x01, 0xA3, 0x12, 0x48, 0xC9, 0xE9, 0x24, +0x02, 0xF9, 0xE4, 0x3A, 0x8B, 0x40, 0xF5, 0x41, 0x89, 0x42, 0x90, 0xA4, 0xDD, 0xB1, 0xFA, 0xF5, +0x43, 0xD0, 0x01, 0xD0, 0x02, 0xD0, 0x03, 0x02, 0x34, 0x62, 0x12, 0x48, 0xC9, 0x90, 0x00, 0x0E, +0x02, 0x06, 0xA2, 0xE0, 0xFE, 0xA3, 0xE0, 0xF5, 0x82, 0x8E, 0x83, 0x22, 0x75, 0xF0, 0x0F, 0xA4, +0x24, 0xF5, 0xF9, 0x74, 0xA2, 0x35, 0xF0, 0x22, 0x90, 0xA4, 0xE4, 0x12, 0x48, 0xD2, 0xE4, 0xFF, +0x90, 0xA4, 0xE4, 0x12, 0x57, 0x17, 0xFE, 0x74, 0xF0, 0x2F, 0xD1, 0x34, 0xEE, 0xF0, 0x0F, 0xEF, +0xB4, 0x10, 0xED, 0x22, 0xF5, 0x82, 0xE4, 0x34, 0x02, 0xF5, 0x83, 0x22, 0x90, 0x01, 0x94,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00, +0x22, 0x7F, 0x32, 0x7E, 0x00, 0x12, 0x3D, 0x7A, 0x90, 0xA4, 0xF1, 0xE4, 0x75, 0xF0, 0x01, 0x12, +0x08, 0xD6, 0x80, 0xBF, 0x7E, 0xFF, 0xED, 0xC3, 0x94, 0x33, 0x40, 0x15, 0xED, 0xD3, 0x94, 0x35, +0x50, 0x0F, 0x12, 0x4F, 0x51, 0xC4, 0x13, 0x54, 0x07, 0x30, 0xE0, 0x05, 0xED, 0x14, 0x44, 0x80, +0xFE, 0xED, 0x14, 0xFD, 0x74, 0x95, 0x2F, 0x12, 0x73, 0x0E, 0xED, 0xF0, 0xAF, 0x06, 0x22, 0xED, +0x54, 0x7F, 0xFC, 0xED, 0x54, 0x80, 0x60, 0x03, 0xAF, 0x04, 0x22, 0xEC, 0xC3, 0x94, 0x33, 0x40, +0x1A, 0xEC, 0xD3, 0x94, 0x35, 0x50, 0x14, 0x12, 0x4F, 0x51, 0xC4, 0x13, 0x54, 0x07, 0x30, 0xE0, +0x06, 0xEC, 0x44, 0x80, 0xFE, 0x80, 0x06, 0x7E, 0xFF, 0x80, 0x02, 0x7E, 0xFF, 0xAF, 0x06, 0x22, +0x8F, 0x5B, 0x75, 0xF0, 0x10, 0xEF, 0x12, 0x53, 0xA8, 0xE0, 0xF5, 0x5C, 0xE4, 0xF5, 0x61, 0xE5, +0x5C, 0x54, 0x7F, 0xF5, 0x5D, 0xE5, 0x5C, 0x54, 0x80, 0xFF, 0x75, 0xF0, 0x04, 0xE5, 0x5B, 0xB1, +0x14, 0xE0, 0xF5, 0x5F, 0x75, 0xF0, 0x04, 0xE5, 0x5B, 0x12, 0x4C, 0x7C, 0xFE, 0xC4, 0x54, 0x03, +0xF5, 0x60, 0xE5, 0x5D, 0x71, 0x3B, 0xE4, 0x93, 0xFC, 0x74, 0x01, 0x93, 0xFD, 0x12, 0x64, 0xC4, +0xEC, 0xF0, 0xA3, 0xED, 0xF0, 0xE5, 0x5C, 0x4F, 0xFF, 0x74, 0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50, 0x14, 0x12, 0x4D, 0x7F, 0xE0, 0xFF, 0x20, 0xE3, 0x0C, 0x75, 0x61, 0x02, 0x12, +0x4D, 0x7F, 0xEF, 0x44, 0x08, 0xF0, 0x80, 0x07, 0x12, 0x4D, 0x7C, 0xE0, 0x54, 0xF7, 0xF0, 0x12, +0x4D, 0x7F, 0xE0, 0x20, 0xE6, 0x03, 0x30, 0xE1, 0x07, 0x12, 0x4D, 0x7C, 0xE0, 0x54, 0xF7, 0xF0, +0xE5, 0x61, 0x64, 0x01, 0x70, 0x70, 0x71, 0x1F, 0x20, 0xE7, 0x0E, 0x20, 0xE6, 0x0B, 0x20, 0xE5, +0x08, 0x20, 0xE4, 0x05, 0x71, 0x2C, 0x30, 0xE0, 0x5D, 0x12, 0x4D, 0x7F, 0xE0, 0x44, 0x04, 0xF0, +0xE5, 0x5D, 0xB4, 0x0C, 0x08, 0x75, 0x5D, 0x14, 0x75, 0x5C, 0x14, 0x41, 0x40, 0xE5, 0x5D, 0xB4, +0x0D, 0x02, 0x80, 0x05, 0xE5, 0x5D, 0xB4, 0x0E, 0x08, 0x75, 0x5D, 0x15, 0x75, 0x5C, 0x15, 0x41, +0x40, 0xE5, 0x5D, 0xB4, 0x0F, 0x08, 0x75, 0x5D, 0x16, 0x75, 0x5C, 0x16, 0x41, 0x40, 0xE5, 0x5D, +0xC3, 0x94, 0x10, 0x40, 0x08, 0x75, 0x5D, 0x17, 0x75, 0x5C, 0x17, 0x41, 0x40, 0xE5, 0x5D, 0xC3, +0x94, 0x11, 0x50, 0x02, 0x41, 0x40, 0xE5, 0x5D, 0x94, 0x13, 0x40, 0x02, 0x41, 0x40, 0x75, 0x5D, +0x18, 0x75, 0x5C, 0x18, 0x80, 0x7A, 0xE5, 0x61, 0x64, 0x02, 0x70, 0x79, 0x71, 0x1F, 0x20, 0xE6, +0x0E, 0x20, 0xE7, 0x0B, 0x71, 0x2C, 0x20, 0xE0, 0x06, 0x20, 0xE1, 0x03, 0x30, 0xE2, 0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, 0x85, 0x5D, 0x5C, 0x80, 0x03, 0x0D, 0x80, 0xC1, 0xAD, +0x5C, 0xAF, 0x60, 0xB1, 0x38, 0x8F, 0x5C, 0x12, 0x4D, 0x7F, 0xE0, 0x30, 0xE0, 0x5D, 0xE5, 0x5D, +0x64, 0x3F, 0x70, 0x57, 0x71, 0x16, 0x12, 0x4F, 0x55, 0xC4, 0x13, 0x54, 0x07, 0x30, 0xE0, 0x05, +0x75, 0x5C, 0xBE, 0x80, 0x46, 0x85, 0x5D, 0x5C, 0x80, 0x41, 0xE5, 0x5D, 0x65, 0x5F, 0x70, 0x30, +0x75, 0xF0, 0x04, 0xE5, 0x5B, 0x12, 0x4F, 0x55, 0xC4, 0x13, 0x54, 0x07, 0x30, 0xE0, 0x0D, 0xE5, +0x5C, 0x20, 0xE7, 0x08, 0xE5, 0x5D, 0x44, 0x80, 0xF5, 0x5C, 0x80, 0x1F, 0xE5, 0x5D, 0x71, 0x3B, +0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0x12, 0x64, 0xC4, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0x22, +0x74, 0x95, 0x25, 0x5B, 0x71, 0x0E, 0xE5, 0x5F, 0xF0, 0xF5, 0x5C, 0x02, 0x63, 0x5A, 0xF5, 0x82, +0xE4, 0x34, 0xA1, 0xF5, 0x83, 0x22, 0x75, 0x5D, 0x3E, 0x75, 0xF0, 0x04, 0xE5, 0x5B, 0x22, 0x75, +0xF0, 0x08, 0xE5, 0x5B, 0x90, 0x89, 0x02, 0x12, 0x48, 0xBD, 0xE0, 0x22, 0x75, 0xF0, 0x08, 0xE5, +0x5B, 0x90, 0x89, 0x03, 0x12, 0x48, 0xBD, 0xE0, 0x22, 0xE5, 0x53, 0x25, 0xE0, 0x24, 0x4F, 0xF5, +0x82, 0xE4, 0x34, 0x42, 0xF5, 0x83, 0x22, 0xEF, 0x60, 0x0A, 0xED, 0xC3, 0x94, 0x2C, 0x40, 0x04, +0x7E,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 0x02, +0x63, 0x63, 0x75, 0xF0, 0x04, 0xEF, 0x12, 0x4C, 0x7C, 0xFE, 0x13, 0x13, 0x54, 0x03, 0xFC, 0xB1, +0x10, 0xE0, 0xFB, 0x74, 0x95, 0x2F, 0x71, 0x0E, 0xE0, 0x54, 0x7F, 0xFD, 0x64, 0x2C, 0x70, 0x18, +0xEE, 0x54, 0x03, 0xFE, 0xEC, 0xD3, 0x9E, 0x50, 0x0F, 0xEC, 0x60, 0x0C, 0x1C, 0xEC, 0xB1, 0x2D, +0xEF, 0x12, 0x4C, 0x7C, 0x54, 0xF3, 0x4E, 0xF0, 0xED, 0xD3, 0x9B, 0x40, 0x02, 0xAD, 0x03, 0x74, +0x95, 0x2F, 0x71, 0x0E, 0xE0, 0x54, 0x80, 0x42, 0x05, 0x8C, 0x69, 0xE4, 0xFB, 0x02, 0x63, 0x63, +0x75, 0xF0, 0x04, 0xEF, 0x90, 0x96, 0x15, 0x02, 0x48, 0xBD, 0xF5, 0x82, 0xE4, 0x34, 0x9D, 0xF5, +0x83, 0x22, 0xED, 0x13, 0x13, 0x13, 0x54, 0x1F, 0xFF, 0x75, 0xF0, 0x08, 0x22, 0x54, 0x03, 0x25, +0xE0, 0x25, 0xE0, 0xFE, 0x75, 0xF0, 0x04, 0x22, 0xEF, 0x60, 0x0A, 0xED, 0xD3, 0x94, 0x0B, 0x40, +0x04, 0x7E, 0x20, 0x80, 0x02, 0xE4, 0xFE, 0xED, 0x2E, 0xFF, 0x22, 0xFF, 0xEE, 0x5A, 0xFE, 0xEF, +0x5B, 0x4E, 0x22, 0x25, 0xE0, 0x24, 0xF7, 0xF5, 0x82, 0xE4, 0x34, 0x42, 0xF5, 0x83, 0xE4, 0x93, +0x22, 0x8F, 0x52, 0x8D, 0x53, 0x8B, 0x54, 0x75, 0xF0, 0x04, 0xEF, 0x12, 0x4C, 0x7C, 0xC4, 0x54, +0x03, 0x90, 0xA3, 0xD6, 0xF0, 0x90, 0xA3, 0xD4, 0x60, 0x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0x99, 0xF5, 0x83, 0x22, 0xE4, 0xF5, 0x51, 0x90, 0xA3, 0xC2, 0xE0, 0xFF, 0xE5, 0x51, +0xC3, 0x9F, 0x40, 0x03, 0x02, 0x7A, 0xF7, 0xAF, 0x51, 0x12, 0x66, 0x85, 0xEF, 0x70, 0x03, 0x02, +0x7A, 0xF2, 0x12, 0x4C, 0x77, 0x12, 0x4F, 0xDC, 0x30, 0xE0, 0x03, 0x02, 0x7A, 0xF2, 0x12, 0x7C, +0x0E, 0x70, 0x07, 0xE5, 0x51, 0x6E, 0x70, 0x02, 0x80, 0x0A, 0x12, 0x7C, 0x0E, 0x70, 0x33, 0xE5, +0x51, 0x6E, 0x70, 0x2E, 0xA3, 0xE0, 0xF5, 0x52, 0xA3, 0xE0, 0x90, 0xA3, 0xDC, 0xF0, 0x75, 0xF0, +0x10, 0xE5, 0x51, 0x12, 0x53, 0xA8, 0xE5, 0x52, 0xF0, 0x75, 0xF0, 0x10, 0x12, 0x64, 0xBE, 0xE0, +0x54, 0xFC, 0xFF, 0x90, 0xA3, 0xDC, 0xE0, 0x12, 0x7C, 0x2C, 0xE5, 0x51, 0x12, 0x64, 0xBE, 0xEF, +0xF0, 0x22, 0xE5, 0x51, 0x12, 0x63, 0x52, 0x34, 0x92, 0x12, 0x52, 0xB9, 0xD3, 0x94, 0x00, 0xEE, +0x94, 0x00, 0x50, 0x03, 0x02, 0x7A, 0xF2, 0xE5, 0x51, 0x75, 0xF0, 0x0A, 0xA4, 0x24, 0x01, 0xF9, +0x74, 0x8D, 0x35, 0xF0, 0xFA, 0x7B, 0x01, 0x90, 0xA3, 0xD0, 0x12, 0x48, 0xD2, 0xE5, 0x51, 0x12, +0x63, 0x52, 0x34, 0x92, 0xF5, 0x83, 0xE0, 0xF5, 0x56, 0xA3, 0xE0, 0xF5, 0x57, 0x74, 0x95, 0x25, +0x51, 0x12, 0x66, 0x65, 0xE0, 0xFF, 0x90, 0xA3, 0xD3, 0xE4, 0xF0, 0xA3, 0xE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4, 0x34, 0x9F, 0xF5, 0x83, 0xE0, 0xC3, 0x94, 0x05, 0x40, 0x03, 0x02, +0x7A, 0x1D, 0x90, 0xA3, 0xDB, 0xE0, 0xFF, 0xE5, 0x53, 0x9F, 0x40, 0x08, 0x8F, 0x53, 0x53, 0x52, +0x80, 0xEF, 0x42, 0x52, 0xE5, 0x53, 0x90, 0x41, 0xFB, 0x93, 0x12, 0x4F, 0xED, 0xE0, 0xC3, 0x9F, +0xE5, 0x53, 0x40, 0x05, 0x90, 0x41, 0x53, 0x80, 0x03, 0x90, 0x41, 0xA7, 0x93, 0xF5, 0x58, 0xE5, +0x58, 0x75, 0xF0, 0x06, 0xA4, 0x24, 0xB1, 0xF9, 0x74, 0x40, 0x35, 0xF0, 0xFA, 0x7B, 0xFF, 0x90, +0xA3, 0xCD, 0x12, 0x48, 0xD2, 0xC3, 0xE5, 0x57, 0x94, 0x0F, 0xE5, 0x56, 0x94, 0x00, 0x50, 0x52, +0x71, 0x13, 0x90, 0x00, 0x06, 0x12, 0x07, 0xAB, 0xFF, 0xAE, 0xF0, 0x71, 0x29, 0x2F, 0xFD, 0xE5, +0xF0, 0x3E, 0xFC, 0x71, 0x00, 0xFF, 0xD3, 0xED, 0x9F, 0xEC, 0x9E, 0x40, 0x09, 0x7D, 0x01, 0xAF, +0x51, 0x12, 0x73, 0x5B, 0x21, 0xFF, 0xE5, 0x57, 0xAE, 0x56, 0x78, 0x02, 0xCE, 0xC3, 0x13, 0xCE, +0x13, 0xD8, 0xF9, 0xFD, 0xAC, 0x06, 0x71, 0x00, 0x2D, 0xFF, 0xEE, 0x3C, 0xFE, 0x71, 0x13, 0x12, +0x07, 0x80, 0xD3, 0x9F, 0xE5, 0xF0, 0x9E, 0x50, 0x02, 0x21, 0xFF, 0xAF, 0x51, 0x12, 0x70, 0x20, +0x21, 0xFF, 0xE5, 0x51, 0x64, 0x01, 0x70, 0x3A, 0x71, 0x23, 0xFD, 0xAC, 0xF0, 0x71, 0x00, 0xFF, +0xC3, 0xED, 0x9F, 0xEC, 0x9E, 0x50, 0x08, 0x90, 0xA2, 0x95, 0x74, 0x01, 0xF0, 0x80, 0x23, 0xE5, +0x57, 0xAE, 0x56, 0x78, 0x03, 0xCE, 0xC3, 0x13, 0xCE, 0x13, 0xD8, 0xF9, 0xFB, 0xAA, 0x06, 0x71, +0x00, 0x2B, 0xFF, 0xEE, 0x3A, 0xFE, 0xD3, 0xED, 0x9F, 0xEC, 0x9E, 0x40, 0x05, 0xE4, 0x90, 0xA2, +0x95, 0xF0, 0xD3, 0xE5, 0x57, 0x94, 0xE8, 0xE5, 0x56, 0x94, 0x03, 0x40, 0x05, 0x75, 0x59, 0x05, +0x80, 0x13, 0xD3, 0xE5, 0x57, 0x94, 0xC8, 0xE5, 0x56, 0x94, 0x00, 0x40, 0x05, 0x75, 0x59, 0x02, +0x80, 0x03, 0xE4, 0xF5, 0x59, 0xE5, 0x51, 0x12, 0x64, 0xC6, 0xE0, 0xF5, 0x54, 0xA3, 0xE0, 0xF5, +0x55, 0xE4, 0xF5, 0x5A, 0x71, 0x13, 0x75, 0xF0, 0x02, 0xE5, 0x5A, 0xA4, 0xF5, 0x82, 0x85, 0xF0, +0x83, 0x12, 0x07, 0xAB, 0xAE, 0xF0, 0xA8, 0x59, 0x08, 0x80, 0x05, 0xCE, 0xC3, 0x13, 0xCE, 0x13, +0xD8, 0xF9, 0xFF, 0x90, 0xA3, 0xCD, 0x12, 0x48, 0xC9, 0x85, 0x5A, 0x82, 0x12, 0x57, 0x1C, 0xFD, +0x7C, 0x00, 0x12, 0x07, 0x03, 0xEF, 0x25, 0x55, 0xF5, 0x55, 0xEE, 0x35, 0x54, 0xF5, 0x54, 0x05, +0x5A, 0xE5, 0x5A, 0xB4, 0x05, 0xBE, 0x90, 0xA3, 0xCD, 0x12, 0x48, 0xC9, 0x90, 0x00, 0x05, 0x12, +0x06, 0xA2, 0xFD, 0x7C, 0x00, 0xE5, 0x57, 0xAE, 0x56, 0xA8, 0x59, 0x08, 0x80, 0x05, 0xCE, 0xC3, +0x13, 0xCE, 0x13, 0xD8, 0xF9, 0xFF, 0x12, 0x07, 0x03, 0xD3, 0xE5, 0x55, 0x9F, 0xE5, 0x54, 0x9E, +0x40, 0x0C, 0xE5, 0x55, 0x9F, 0xF5, 0x55, 0xE5, 0x54, 0x9E, 0xF5, 0x54, 0x80, 0x05, 0xE4, 0xF5, +0x54, 0xF5, 0x55, 0xE5, 0x51, 0x12, 0x64, 0xC6, 0xE5, 0x54, 0xF0, 0xA3, 0xE5, 0x55, 0xF0, 0x12, +0x73, 0x39, 0xC3, 0x71, 0x53, 0x50, 0x07, 0xAF, 0x51, 0x12, 0x70, 0x20, 0x80, 0x5D, 0xE5, 0x53, +0x25, 0xE0, 0x24, 0xF7, 0xF5, 0x82, 0xE4, 0x34, 0x42, 0xF5, 0x83, 0xD3, 0x71, 0x53, 0x40, 0x53, +0x74, 0x95, 0x25, 0x51, 0x12, 0x4D, 0x83, 0xE0, 0x20, 0xE6, 0x03, 0x30, 0xE1, 0x07, 0xE4, 0x90, +0xA3, 0xDD, 0xF0, 0x80, 0x06, 0x90, 0xA3, 0xDD, 0x74, 0x01, 0xF0, 0xE5, 0x53, 0xB4, 0x3A, 0x0B, +0x90, 0xA3, 0xDD, 0xE0, 0xB4, 0x01, 0x04, 0x7D, 0x08, 0x80, 0x1B, 0xE5, 0x53, 0xB4, 0x18, 0x0B, +0x90, 0xA3, 0xDD, 0xE0, 0xB4, 0x01, 0x04, 0x7D, 0x07, 0x80, 0x0B, 0xE5, 0x53, 0xB4, 0x36, 0x04, +0x7D, 0x09, 0x80, 0x02, 0x7D, 0x01, 0xAF, 0x51, 0x12, 0x73, 0x5B, 0x71, 0x09, 0xF5, 0x83, 0xE4, +0xF0, 0x80, 0x3C, 0x71, 0x09, 0xF5, 0x83, 0xE0, 0x04, 0xF0, 0x71, 0x09, 0xF5, 0x83, 0xE0, 0xC3, +0x94, 0x05, 0x40, 0x2B, 0x71, 0x09, 0xF5, 0x83, 0xE4, 0xF0, 0xE5, 0x53, 0x12, 0x75, 0x53, 0xFE, +0x74, 0x01, 0x93, 0xFF, 0x12, 0x73, 0x39, 0x74, 0x01, 0x93, 0x2F, 0xFF, 0xE4, 0x93, 0x3E, 0xC3, +0x13, 0xFE, 0xEF, 0x13, 0xFF, 0xE5, 0x51, 0x12, 0x64, 0xC6, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0xE5, +0x51, 0x12, 0x64, 0xC6, 0xA3, 0xE0, 0x90, 0xA4, 0x7E, 0xF0, 0x90, 0xA4, 0x7D, 0xE5, 0x52, 0xF0, +0xAB, 0x51, 0xE4, 0xFD, 0xFF, 0x12, 0x75, 0xC6, 0xE4, 0xF5, 0x54, 0xF5, 0x55, 0x74, 0x81, 0x25, +0x51, 0x12, 0x62, 0xBE, 0xE0, 0x64, 0x01, 0x60, 0x02, 0x41, 0xEB, 0x90, 0xA3, 0xD3, 0x71, 0x3C, +0xE5, 0x51, 0x12, 0x53, 0x78, 0x71, 0x2F, 0x50, 0x08, 0x12, 0x53, 0x78, 0x12, 0x5F, 0x9D, 0x80, +0x05, 0x12, 0x53, 0x78, 0x51, 0xF8, 0x90, 0xA3, 0xD5, 0x71, 0x3C, 0xE5, 0x51, 0x12, 0x53, 0x69, +0x71, 0x2F, 0x50, 0x08, 0x12, 0x53, 0x69, 0x12, 0x5F, 0x9D, 0x80, 0x05, 0x12, 0x53, 0x69, 0x51, +0xF8, 0x71, 0x4B, 0xFB, 0xC3, 0x74, 0xFF, 0x9B, 0xFF, 0x74, 0xFF, 0x9E, 0xFE, 0x74, 0xFF, 0x94, +0x00, 0xFD, 0x74, 0xFF, 0x94, 0x00, 0xFC, 0x90, 0x94, 0x91, 0x12, 0x48, 0xB1, 0xD3, 0x12, 0x48, +0x94, 0x90, 0x94, 0x91, 0x50, 0x14, 0x12, 0x48, 0xB1, 0x71, 0x4B, 0xFF, 0xE4, 0xFC, 0xFD, 0x12, +0x48, 0x6D, 0x90, 0x94, 0x91, 0x12, 0x08, 0x6D, 0x80, 0x07, 0x12, 0x08, 0x79, 0xFF, 0xFF, 0xFF, +0xFF, 0x90, 0xA3, 0xD9, 0x71, 0x3C, 0xE5, 0x51, 0x71, 0x19, 0x71, 0x2F, 0x50, 0x07, 0x71, 0x19, +0x12, 0x5F, 0x9D, 0x80, 0x04, 0x71, 0x19, 0x51, 0xF8, 0xC3, 0x74, 0xFF, 0x95, 0x57, 0xFF, 0x74, +0xFF, 0x95, 0x56, 0xFE, 0xE5, 0x51, 0x12, 0x53, 0x96, 0xF5, 0x83, 0xE0, 0xFC, 0xA3, 0xE0, 0xD3, +0x9F, 0xEC, 0x9E, 0xE5, 0x51, 0x50, 0x0F, 0x12, 0x53, 0x96, 0xF5, 0x83, 0xE5, 0x56, 0x85, 0x57, +0xF0, 0x12, 0x08, 0xD6, 0x80, 0x05, 0x12, 0x53, 0x96, 0x51, 0xF8, 0xE4, 0xFD, 0xAF, 0x51, 0x12, +0x62, 0xFC, 0x05, 0x51, 0x02, 0x76, 0x39, 0x22, 0xF5, 0x83, 0x74, 0xFF, 0xF0, 0xA3, 0xF0, 0x22, +0xE5, 0x56, 0xC3, 0x13, 0xFE, 0xE5, 0x57, 0x13, 0x22, 0x74, 0x15, 0x25, 0x51, 0xF5, 0x82, 0xE4, +0x34, 0x98, 0x22, 0x90, 0xA3, 0xD0, 0x02, 0x48, 0xC9, 0x25, 0xE0, 0x24, 0x15, 0xF5, 0x82, 0xE4, +0x34, 0x9E, 0x22, 0x90, 0xA3, 0xD0, 0x12, 0x48, 0xC9, 0x90, 0x00, 0x08, 0x02, 0x07, 0xAB, 0xF5, +0x83, 0xE0, 0xFA, 0xA3, 0xE0, 0xD3, 0x9D, 0xEA, 0x9C, 0xE5, 0x51, 0x22, 0xE0, 0xFE, 0xA3, 0xE0, +0xFF, 0xC3, 0x74, 0xFF, 0x9F, 0xFD, 0x74, 0xFF, 0x9E, 0xFC, 0x22, 0x90, 0xA3, 0xD7, 0xE0, 0xFE, +0xA3, 0xE0, 0x22, 0x74, 0x01, 0x93, 0x95, 0x55, 0xE4, 0x93, 0x95, 0x54, 0x22, 0x90, 0xA4, 0xFA, +0xEF, 0xF0, 0x90, 0xA2, 0x9B, 0xE0, 0xB4, 0x02, 0x12, 0x90, 0xA4, 0xFA, 0xE0, 0xFF, 0x64, 0x01, +0x60, 0x18, 0x90, 0x01, 0x4D, 0xE0, 0x64, 0x80, 0xF0, 0x80, 0x0C, 0x90, 0x06, 0x90, 0xE0, 0x44, +0x01, 0xF0, 0x90, 0xA4, 0xFA, 0xE0, 0xFF, 0x12, 0x50, 0x3D, 0x22, 0x7D, 0x07, 0xEF, 0x5D, 0xC3, +0x60, 0x0A, 0x71, 0xA0, 0x24, 0x08, 0xFF, 0xE4, 0x3E, 0xFE, 0x80, 0x03, 0x71, 0xA0, 0xFF, 0x22, +0x74, 0xFF, 0x9D, 0xFD, 0x74, 0xFF, 0x94, 0x00, 0x5E, 0xFE, 0xED, 0x5F, 0x22, 0x90, 0x04, 0x24, +0xEF, 0xF0, 0x22, 0x90, 0xA3, 0x9A, 0xE0, 0xFD, 0x7C, 0x00, 0xA3, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, +0x12, 0x07, 0x15, 0xED, 0x4C, 0x70, 0x05, 0x90, 0xA3, 0xA7, 0x80, 0x2A, 0xED, 0x64, 0x01, 0x4C, +0x70, 0x05, 0x90, 0xA3, 0xA8, 0x80, 0x1F, 0xED, 0x64, 0x02, 0x4C, 0x70, 0x05, 0x90, 0xA3, 0xA9, +0x80, 0x14, 0xED, 0x64, 0x03, 0x4C, 0x70, 0x05, 0x90, 0xA3, 0xAA, 0x80, 0x09, 0xED, 0x64, 0x04, +0x4C, 0x70, 0x11, 0x90, 0xA3, 0xAB, 0xE0, 0xFF, 0x71, 0xAD, 0x90, 0xA3, 0x9B, 0xE4, 0x75, 0xF0, +0x01, 0x12, 0x08, 0xD6, 0x22, 0x12, 0x07, 0xAB, 0x2F, 0xFF, 0xEE, 0x35, 0xF0, 0x22, 0x90, 0x04, +0xA0, 0xE0, 0xFF, 0xA3, 0xE0, 0xFE, 0xEF, 0x64, 0x01, 0x22, 0x12, 0x48, 0xBD, 0xE0, 0xFB, 0xE4, +0xFD, 0x0F, 0x22, 0x90, 0x00, 0x03, 0x12, 0x06, 0xA2, 0x54, 0x01, 0x22, 0x54, 0x03, 0x4F, 0xFF, +0x75, 0xF0, 0x10, 0x22, 0xB7, 0x17, +}; +u4Byte ArrayLength_MP_8821A_FW_AP = 15446; + + +void +ODM_ReadFirmware_MP_8821A_FW_AP( + IN PDM_ODM_T pDM_Odm, + OUT u1Byte *pFirmware, + OUT u4Byte *pFirmwareSize +) +{ + ODM_MoveMemory(pDM_Odm, pFirmware, Array_MP_8821A_FW_AP, ArrayLength_MP_8821A_FW_AP); + *pFirmwareSize = ArrayLength_MP_8821A_FW_AP; +} + + +#else + + +u1Byte Array_MP_8821A_FW_NIC[] = { +0x01, 0x21, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x09, 0x05, 0x15, 0x19, 0xD6, 0x6F, 0x00, 0x00, +0xD0, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x02, 0x49, 0xD8, 0x02, 0x67, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x02, 0x68, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x02, 0x77, 0xE3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x02, 0x67, 0xF5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x6F, 0xF7, 0x00, 0x00, +0x00, 0x00, 0x00, 0x02, 0x77, 0xE2, 0x15, 0xF0, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x15, 0xF0, 0x0F, +0x00, 0x00, 0x00, 0x00, 0x05, 0xF0, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x05, 0xF0, 0x0F, 0x00, 0x00, +0x00, 0x00, 0x10, 0xF0, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x10, 0xF0, 0x0F, 0x00, 0x00, 0x00, 0x00, +0xF5, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xF0, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x10, 0xF0, 0x3F, 0x00, +0x00, 0x00, 0x00, 0x15, 0xF0, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x15, 0xF0, 0xCF, 0xFF, 0x00, 0x00, +0x00, 0x0A, 0x08, 0x03, 0x03, 0x00, 0x04, 0x09, 0x07, 0x03, 0x03, 0x00, 0x04, 0x08, 0x06, 0x03, +0x02, 0x00, 0x04, 0x08, 0x05, 0x03, 0x01, 0x00, 0x04, 0x0D, 0x0A, 0x07, 0x05, 0x00, 0x08, 0x0C, +0x0A, 0x07, 0x04, 0x00, 0x08, 0x0B, 0x0A, 0x06, 0x05, 0x00, 0x08, 0x0B, 0x0A, 0x05, 0x03, 0x00, +0x08, 0x0B, 0x0A, 0x03, 0x02, 0x00, 0x08, 0x14, 0x12, 0x0C, 0x04, 0x00, 0x10, 0x14, 0x12, 0x09, +0x04, 0x00, 0x10, 0x24, 0x22, 0x1C, 0x12, 0x00, 0x20, 0x24, 0x22, 0x18, 0x0C, 0x00, 0x20, 0x24, +0x22, 0x14, 0x06, 0x00, 0x20, 0x24, 0x22, 0x0F, 0x04, 0x00, 0x20, 0x24, 0x21, 0x0A, 0x04, 0x00, +0x20, 0x23, 0x21, 0x0C, 0x04, 0x00, 0x20, 0x23, 0x1F, 0x0A, 0x04, 0x00, 0x20, 0x22, 0x1F, 0x0F, +0x04, 0x00, 0x20, 0x21, 0x1F, 0x16, 0x0C, 0x00, 0x20, 0x31, 0x2F, 0x20, 0x14, 0x00, 0x30, 0x31, +0x2F, 0x18, 0x10, 0x00, 0x30, 0x31, 0x2C, 0x18, 0x0C, 0x00, 0x30, 0x31, 0x2A, 0x14, 0x0C, 0x00, +0x30, 0x31, 0x28, 0x14, 0x00, 0x00, 0x30, 0x31, 0x24, 0x14, 0x00, 0x00, 0x30, 0x31, 0x1E, 0x14, +0x00, 0x00, 0x30, 0x04, 0x04, 0x04, 0x05, 0x04, 0x04, 0x05, 0x07, 0x07, 0x07, 0x08, 0x0A, 0x04, +0x07, 0x0A, 0x0E, 0x11, 0x13, 0x14, 0x15, 0x03, 0x04, 0x07, 0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x05, +0x05, 0x07, 0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x05, 0x05, 0x07, 0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x07, +0x08, 0x08, 0x0A, 0x0A, 0x0C, 0x0E, 0x10, 0x11, 0x11, 0x07, 0x09, 0x09, 0x0B, 0x0B, 0x0D, 0x0F, +0x13, 0x13, 0x14, 0x05, 0x05, 0x07, 0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x0F, 0x0F, 0x05, 0x05, 0x07, +0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x0F, 0x0F, 0x04, 0x04, 0x04, 0x05, 0x07, 0x07, 0x09, 0x09, 0x0C, +0x0E, 0x10, 0x12, 0x05, 0x06, 0x07, 0x0D, 0x10, 0x11, 0x12, 0x12, 0x07, 0x08, 0x09, 0x09, 0x0C, +0x0E, 0x11, 0x13, 0x09, 0x09, 0x09, 0x09, 0x0C, 0x0E, 0x11, 0x13, 0x09, 0x09, 0x09, 0x09, 0x0C, +0x0E, 0x11, 0x13, 0x05, 0x06, 0x08, 0x09, 0x0C, 0x0E, 0x12, 0x12, 0x13, 0x14, 0x07, 0x08, 0x09, +0x0A, 0x0C, 0x0F, 0x12, 0x12, 0x14, 0x16, 0x09, 0x09, 0x09, 0x09, 0x0C, 0x0E, 0x11, 0x13, 0x13, +0x13, 0x09, 0x09, 0x09, 0x09, 0x0C, 0x0E, 0x11, 0x13, 0x13, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x24, 0x26, 0x2A, 0x00, 0x00, 0x00, 0x1F, 0x21, 0x25, 0x27, 0x28, 0x00, +0x00, 0x00, 0x00, 0x23, 0x26, 0x28, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x23, 0x26, 0x28, 0x2A, 0x00, +0x00, 0x00, 0x00, 0x23, 0x26, 0x28, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x20, 0x25, 0x27, 0x29, 0x29, +0x2A, 0x00, 0x00, 0x00, 0x00, 0x20, 0x25, 0x27, 0x29, 0x29, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x23, +0x26, 0x28, 0x2A, 0x2A, 0x2A, 0x00, 0x00, 0x00, 0x1F, 0x23, 0x26, 0x28, 0x2A, 0x2A, 0x2A, 0x00, +0x04, 0x00, 0x04, 0x00, 0x08, 0x00, 0x10, 0x00, 0x18, 0x00, 0x24, 0x00, 0x30, 0x00, 0x48, 0x00, +0x60, 0x00, 0x90, 0x00, 0xC0, 0x00, 0xD8, 0x00, 0x3C, 0x00, 0x64, 0x00, 0x78, 0x00, 0xA0, 0x00, +0xF0, 0x01, 0x40, 0x01, 0x90, 0x01, 0xE0, 0x00, 0xA0, 0x00, 0xF0, 0x01, 0x40, 0x01, 0x90, 0x02, +0x58, 0x03, 0x20, 0x04, 0xB0, 0x06, 0x40, 0x00, 0xC8, 0x01, 0x18, 0x01, 0xE0, 0x02, 0xD0, 0x03, +0xE8, 0x04, 0xB0, 0x06, 0x40, 0x07, 0xD0, 0x00, 0xC8, 0x01, 0x18, 0x01, 0xE0, 0x02, 0xD0, 0x03, +0xE8, 0x04, 0xB0, 0x06, 0x40, 0x07, 0xD0, 0x00, 0x3C, 0x00, 0x50, 0x00, 0x64, 0x00, 0xA0, 0x00, +0xF0, 0x01, 0x40, 0x01, 0x90, 0x01, 0xE0, 0x02, 0x58, 0x03, 0x20, 0x00, 0x78, 0x00, 0xF0, 0x01, +0x90, 0x02, 0x58, 0x03, 0xE8, 0x07, 0xD0, 0x09, 0x60, 0x0F, 0xA0, 0x12, 0xC0, 0x15, 0x18, 0x00, +0xC8, 0x01, 0x18, 0x01, 0xE0, 0x02, 0xD0, 0x03, 0xE8, 0x04, 0xB0, 0x06, 0x40, 0x07, 0xD0, 0x07, +0xD0, 0x07, 0xD0, 0x00, 0xC8, 0x01, 0x18, 0x01, 0xE0, 0x02, 0xD0, 0x03, 0xE8, 0x04, 0xB0, 0x06, +0x40, 0x07, 0xD0, 0x07, 0xD0, 0x07, 0xD0, 0x00, 0x02, 0x00, 0x02, 0x00, 0x04, 0x00, 0x08, 0x00, +0x0C, 0x00, 0x12, 0x00, 0x18, 0x00, 0x24, 0x00, 0x30, 0x00, 0x48, 0x00, 0x60, 0x00, 0x6C, 0x00, +0x14, 0x00, 0x32, 0x00, 0x3C, 0x00, 0x50, 0x00, 0x78, 0x00, 0xA0, 0x00, 0xC8, 0x00, 0xF0, 0x00, +0x50, 0x00, 0x78, 0x00, 0xA0, 0x00, 0xC8, 0x01, 0x2C, 0x01, 0x90, 0x02, 0x58, 0x03, 0x20, 0x00, +0x64, 0x00, 0x8C, 0x00, 0xF0, 0x01, 0x68, 0x01, 0xF4, 0x02, 0x58, 0x03, 0x20, 0x03, 0xE8, 0x00, +0x64, 0x00, 0x8C, 0x00, 0xF0, 0x01, 0x68, 0x01, 0xF4, 0x02, 0x58, 0x03, 0x20, 0x03, 0xE8, 0x00, +0x1E, 0x00, 0x28, 0x00, 0x32, 0x00, 0x50, 0x00, 0x78, 0x00, 0xA0, 0x00, 0xC8, 0x00, 0xF0, 0x01, +0x2C, 0x01, 0x90, 0x00, 0x3C, 0x00, 0x78, 0x00, 0xC8, 0x01, 0x2C, 0x01, 0xF4, 0x03, 0xE8, 0x04, +0xB0, 0x07, 0xD0, 0x09, 0x60, 0x0A, 0xF0, 0x00, 0x64, 0x00, 0x8C, 0x00, 0xF0, 0x01, 0x68, 0x01, +0xF4, 0x02, 0x58, 0x03, 0x20, 0x03, 0xE8, 0x03, 0xE8, 0x03, 0xE8, 0x00, 0x64, 0x00, 0x8C, 0x00, +0xF0, 0x01, 0x68, 0x01, 0xF4, 0x02, 0x58, 0x03, 0x20, 0x03, 0xE8, 0x03, 0xE8, 0x03, 0xE8, 0x02, +0x04, 0x06, 0x08, 0x0A, 0x0C, 0x10, 0x18, 0x20, 0x30, 0x40, 0x50, 0x01, 0x01, 0x01, 0x02, 0x01, +0x02, 0x03, 0x03, 0x04, 0x04, 0x05, 0x05, 0x02, 0x04, 0x06, 0x07, 0x07, 0x08, 0x08, 0x08, 0x02, +0x02, 0x03, 0x03, 0x05, 0x05, 0x06, 0x06, 0x05, 0x06, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0A, 0x05, +0x06, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0A, 0x05, 0x06, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0A, 0x0A, +0x0B, 0x05, 0x06, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0B, 0x05, 0x06, 0x06, 0x07, 0x07, +0x08, 0x09, 0x0A, 0x0A, 0x0B, 0x05, 0x06, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0A, 0x0A, 0x0B, 0x01, +0x01, 0x01, 0x01, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x01, 0x02, 0x03, 0x04, 0x05, +0x06, 0x07, 0x08, 0x02, 0x04, 0x06, 0x07, 0x08, 0x0A, 0x0B, 0x0C, 0x03, 0x05, 0x06, 0x07, 0x08, +0x0A, 0x0B, 0x0C, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x02, 0x04, 0x06, 0x07, 0x08, +0x09, 0x0B, 0x0C, 0x0C, 0x0C, 0x03, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0B, 0x0C, 0x0C, 0x0C, 0x05, +0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0C, 0x0C, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, +0x0C, 0x0C, 0x0C, 0x19, 0x06, 0x04, 0x02, 0x00, 0x18, 0x05, 0x22, 0x05, 0x50, 0x05, 0x51, 0x0B, +0x00, 0x08, 0x08, 0x09, 0x0C, 0x0C, 0x00, 0x0E, 0x00, 0x08, 0xC4, 0x08, 0x38, 0x08, 0x2C, 0x0C, +0x5C, 0x0C, 0x60, 0x0C, 0x64, 0x0C, 0x68, 0x0C, 0xB8, 0x0C, 0xB0, 0x0C, 0xB4, 0x0E, 0x5C, 0x0E, +0x60, 0x0E, 0x64, 0x0E, 0x68, 0x0E, 0xB8, 0x0E, 0xB0, 0x0E, 0xB4, 0x0C, 0x00, 0x0C, 0x94, 0x0C, +0x88, 0x0C, 0x8C, 0x0C, 0xE8, 0x0C, 0x10, 0x0D, 0x00, 0x0C, 0x90, 0x0C, 0xC4, 0x0C, 0xC8, 0x0C, +0xCC, 0x0C, 0xD4, 0x0C, 0x80, 0x0C, 0x84, 0x0E, 0x00, 0x0E, 0x94, 0x0E, 0x88, 0x0E, 0x8C, 0x0E, +0xE8, 0x0E, 0x10, 0x0D, 0x40, 0x0E, 0x90, 0x0E, 0xC4, 0x0E, 0xC8, 0x0E, 0xCC, 0x0E, 0xD4, 0x0E, +0x80, 0x0E, 0x84, 0x00, 0x01, 0x04, 0x02, 0x03, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0xC2, 0xAF, 0x80, 0xFE, 0x32, 0x12, 0x45, 0xC4, 0x85, 0xD0, 0x0B, 0x75, 0xD0, 0x08, 0xAA, 0xE0, +0xC2, 0x8C, 0xE5, 0x8A, 0x24, 0x67, 0xF5, 0x8A, 0xE5, 0x8C, 0x34, 0x79, 0xF5, 0x8C, 0xD2, 0x8C, +0xEC, 0x24, 0x87, 0xF8, 0xE6, 0xBC, 0x02, 0x02, 0x74, 0xFF, 0xC3, 0x95, 0x81, 0xB4, 0x40, 0x00, +0x40, 0xCE, 0x79, 0x03, 0x78, 0x80, 0x16, 0xE6, 0x08, 0x70, 0x0B, 0xC2, 0xAF, 0xE6, 0x30, 0xE1, +0x03, 0x44, 0x18, 0xF6, 0xD2, 0xAF, 0x08, 0xD9, 0xED, 0xEA, 0x8B, 0xD0, 0x22, 0xE5, 0x0C, 0xFF, +0x23, 0x24, 0x81, 0xF8, 0x0F, 0x08, 0x08, 0xBF, 0x03, 0x04, 0x7F, 0x00, 0x78, 0x81, 0xE6, 0x30, +0xE4, 0xF2, 0x00, 0xE5, 0x0C, 0xC3, 0x9F, 0x50, 0x20, 0x05, 0x0C, 0x74, 0x86, 0x25, 0x0C, 0xF8, +0xE6, 0xFD, 0xA6, 0x81, 0x08, 0xE6, 0xAE, 0x0C, 0xBE, 0x02, 0x02, 0x74, 0xFF, 0xCD, 0xF8, 0xE8, +0x6D, 0x60, 0xE0, 0x08, 0xE6, 0xC0, 0xE0, 0x80, 0xF6, 0xE5, 0x0C, 0xD3, 0x9F, 0x40, 0x27, 0xE5, +0x0C, 0x24, 0x87, 0xF8, 0xE6, 0xAE, 0x0C, 0xBE, 0x02, 0x02, 0x74, 0xFF, 0xFD, 0x18, 0xE6, 0xCD, +0xF8, 0xE5, 0x81, 0x6D, 0x60, 0x06, 0xD0, 0xE0, 0xF6, 0x18, 0x80, 0xF5, 0xE5, 0x0C, 0x24, 0x86, +0xC8, 0xF6, 0x15, 0x0C, 0x80, 0xD3, 0xE5, 0x0C, 0x23, 0x24, 0x81, 0xF8, 0x7F, 0x04, 0xC2, 0xAF, +0xE6, 0x30, 0xE0, 0x03, 0x10, 0xE2, 0x0C, 0x7F, 0x00, 0x30, 0xE1, 0x07, 0x30, 0xE3, 0x04, 0x7F, +0x08, 0x54, 0xF4, 0x54, 0x7C, 0xC6, 0xD2, 0xAF, 0x54, 0x80, 0x42, 0x07, 0x22, 0x78, 0x86, 0xA6, +0x81, 0x74, 0x02, 0x60, 0x06, 0xFF, 0x08, 0x76, 0xFF, 0xDF, 0xFB, 0x7F, 0x03, 0xE4, 0x78, 0x80, +0xF6, 0x08, 0xF6, 0x08, 0xDF, 0xFA, 0x78, 0x81, 0x76, 0x30, 0x90, 0x4A, 0x92, 0x74, 0x01, 0x93, +0xC0, 0xE0, 0xE4, 0x93, 0xC0, 0xE0, 0x43, 0x89, 0x01, 0x75, 0x8A, 0x60, 0x75, 0x8C, 0x79, 0xD2, +0x8C, 0xD2, 0xAF, 0x22, 0x02, 0xEF, 0xD3, 0x94, 0x02, 0x40, 0x03, 0x7F, 0xFF, 0x22, 0x74, 0x81, +0x2F, 0x2F, 0xF8, 0xE6, 0x20, 0xE5, 0xF4, 0xC2, 0xAF, 0xE6, 0x44, 0x30, 0xF6, 0xD2, 0xAF, 0xAE, +0x0C, 0xEE, 0xC3, 0x9F, 0x50, 0x21, 0x0E, 0x74, 0x86, 0x2E, 0xF8, 0xE6, 0xF9, 0x08, 0xE6, 0x18, +0xBE, 0x02, 0x02, 0x74, 0xFF, 0xFD, 0xED, 0x69, 0x60, 0x09, 0x09, 0xE7, 0x19, 0x19, 0xF7, 0x09, +0x09, 0x80, 0xF3, 0x16, 0x16, 0x80, 0xDA, 0xEE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x9F, 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, 0xBB, 0x01, +0x07, 0x89, 0x82, 0x8A, 0x83, 0x02, 0x49, 0x3C, 0x50, 0x05, 0xE9, 0xF8, 0x02, 0x49, 0x98, 0xBB, +0xFE, 0x05, 0xE9, 0xF8, 0x02, 0x49, 0xA4, 0x89, 0x82, 0x8A, 0x83, 0x02, 0x49, 0xB0, 0xBB, 0x01, +0x0D, 0xE5, 0x82, 0x29, 0xF5, 0x82, 0xE5, 0x83, 0x3A, 0xF5, 0x83, 0x02, 0x49, 0x3C, 0x50, 0x07, +0xE9, 0x25, 0x82, 0xF8, 0x02, 0x49, 0x98, 0xBB, 0xFE, 0x07, 0xE9, 0x25, 0x82, 0xF8, 0x02, 0x49, +0xA4, 0xE5, 0x82, 0x29, 0xF5, 0x82, 0xE5, 0x83, 0x3A, 0xF5, 0x83, 0x02, 0x49, 0xB0, 0xBB, 0x01, +0x07, 0x89, 0x82, 0x8A, 0x83, 0x02, 0x08, 0x6D, 0x50, 0x05, 0xE9, 0xF8, 0x02, 0x49, 0xC0, 0xBB, +0xFE, 0x05, 0xE9, 0xF8, 0x02, 0x49, 0xCC, 0x22, 0xBB, 0x01, 0x0D, 0xE5, 0x82, 0x29, 0xF5, 0x82, +0xE5, 0x83, 0x3A, 0xF5, 0x83, 0x02, 0x08, 0x6D, 0x50, 0x07, 0xE9, 0x25, 0x82, 0xF8, 0x02, 0x49, +0xC0, 0xBB, 0xFE, 0x07, 0xE9, 0x25, 0x82, 0xF8, 0x02, 0x49, 0xCC, 0x22, 0xE0, 0xFC, 0xA3, 0xE0, +0xFD, 0xA3, 0xE0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 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, 0x4A, 0x5B, 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, 0x41, 0xA3, 0x1B, 0x00, 0x41, +0xA3, 0x1C, 0x00, 0x60, 0x26, 0xA2, 0x4D, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, +0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x24, 0x28, 0x2C, 0x30, 0x34, 0x38, 0x3C, 0x40, 0x64, 0x68, 0x6C, +0x70, 0x74, 0x78, 0x7C, 0x80, 0x84, 0x88, 0x8C, 0x95, 0x99, 0x9D, 0xA1, 0xA5, 0x41, 0xA3, 0x31, +0x00, 0x00, 0x4C, 0xD6, 0x58, 0x08, 0x60, 0x2D, 0xE4, 0xFD, 0x7F, 0x8D, 0xD3, 0x10, 0xAF, 0x01, +0xC3, 0xC0, 0xD0, 0x8F, 0x82, 0x75, 0x83, 0x00, 0xED, 0x12, 0xAF, 0x50, 0xD0, 0xD0, 0x92, 0xAF, +0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x7F, 0x8F, 0x71, 0xFC, 0xEF, 0x20, 0xE6, 0x02, +0x61, 0x76, 0x90, 0x00, 0x8C, 0xE0, 0xF5, 0x26, 0x7F, 0x8D, 0x71, 0xFC, 0x90, 0x00, 0x8E, 0xE0, +0xF5, 0x27, 0xEF, 0x24, 0xFC, 0x60, 0x0C, 0x24, 0x03, 0x60, 0x02, 0x61, 0x6C, 0xAF, 0x26, 0xB1, +0x53, 0x61, 0x6C, 0x74, 0x11, 0x25, 0x26, 0x12, 0x66, 0x3C, 0xE0, 0xFB, 0xE4, 0xFD, 0x71, 0xAD, +0xB1, 0xFC, 0x13, 0x13, 0x54, 0x03, 0x71, 0xAA, 0xB1, 0xFC, 0xF1, 0x52, 0x71, 0xAA, 0xB1, 0xFC, +0xC4, 0x54, 0x03, 0x71, 0xAA, 0x12, 0x6F, 0xD0, 0xE0, 0xFB, 0xE4, 0xFD, 0x0F, 0x71, 0xAE, 0x12, +0x6D, 0x4E, 0xE0, 0xFB, 0x0D, 0x71, 0xAE, 0xF1, 0x61, 0xC4, 0x13, 0x54, 0x01, 0xFB, 0x0D, 0x7F, +0x01, 0x71, 0xAE, 0xF1, 0x61, 0x54, 0x1F, 0x71, 0xA2, 0xE5, 0x26, 0x90, 0x89, 0x00, 0x12, 0xAE, +0xF6, 0x71, 0xA4, 0xE5, 0x26, 0x90, 0x89, 0x01, 0x71, 0x9F, 0xE5, 0x26, 0x90, 0x89, 0x02, 0x71, +0x9F, 0xE5, 0x26, 0x90, 0x89, 0x03, 0x71, 0x9F, 0xE5, 0x26, 0x90, 0x89, 0x04, 0x12, 0xAE, 0xF6, +0x71, 0xA4, 0xE5, 0x26, 0x90, 0x89, 0x05, 0x71, 0x9F, 0xE5, 0x26, 0x90, 0x89, 0x06, 0x71, 0x9F, +0xE5, 0x26, 0x90, 0x89, 0x07, 0x31, 0x54, 0xE0, 0xFB, 0x0D, 0x71, 0x7B, 0x7F, 0x8F, 0x71, 0xFC, +0xEF, 0x30, 0xE0, 0x02, 0x51, 0x98, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xEF, 0x70, 0x04, 0x74, 0xF0, +0x80, 0x16, 0xEF, 0xB4, 0x01, 0x04, 0x74, 0xF4, 0x80, 0x0E, 0xEF, 0xB4, 0x02, 0x04, 0x74, 0xF8, +0x80, 0x06, 0xEF, 0xB4, 0x03, 0x08, 0x74, 0xFC, 0x2D, 0x12, 0x88, 0x82, 0xEB, 0xF0, 0x22, 0x31, +0x54, 0xE0, 0xFB, 0x0D, 0x71, 0x7B, 0x75, 0xF0, 0x08, 0x22, 0xFB, 0x0D, 0xE4, 0xFF, 0x71, 0x7B, +0x75, 0xF0, 0x04, 0xE5, 0x26, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x12, 0x52, 0xA5, +0x7F, 0x00, 0x7E, 0x0C, 0xB1, 0x3A, 0x12, 0xAD, 0xF8, 0xB1, 0x3A, 0x12, 0xAF, 0x7F, 0x91, 0x2C, +0x91, 0x19, 0x91, 0x19, 0x54, 0xFE, 0xFD, 0x7F, 0x02, 0x51, 0x9C, 0x12, 0xAF, 0x47, 0x44, 0x40, +0xB1, 0x40, 0x12, 0xAF, 0x78, 0x90, 0x01, 0x00, 0x74, 0x3F, 0xF0, 0xA3, 0xE0, 0x54, 0xFD, 0xF0, +0x90, 0x05, 0x53, 0xE0, 0x44, 0x20, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xD3, 0x10, 0xAF, 0x01, +0xC3, 0xC0, 0xD0, 0x8F, 0x82, 0x75, 0x83, 0x00, 0xE0, 0x90, 0xA3, 0x27, 0x12, 0xAF, 0x50, 0x90, +0xA3, 0x27, 0xE0, 0xFF, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x54, 0xFE, 0xFD, 0x7F, 0x02, 0x51, 0x9C, +0x7F, 0x02, 0x71, 0xFC, 0xEF, 0x44, 0x01, 0xFD, 0x7F, 0x02, 0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x8F, 0x71, 0xFC, 0xEF, +0x30, 0xE0, 0x02, 0x51, 0x98, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0x9F, 0xA4, 0xE0, 0x44, 0x10, +0xF0, 0x90, 0x9F, 0xB2, 0xE0, 0xFD, 0x7F, 0x93, 0x51, 0x9C, 0x90, 0x9F, 0xA8, 0xE0, 0x60, 0x12, +0x90, 0x01, 0x2F, 0xE0, 0x30, 0xE7, 0x05, 0x74, 0x10, 0xF0, 0x80, 0x06, 0x90, 0x01, 0x2F, 0x74, +0x90, 0xF0, 0x7F, 0x08, 0x71, 0xFC, 0xEF, 0x44, 0x10, 0xFD, 0x7F, 0x08, 0x51, 0x9C, 0x7F, 0x01, +0x12, 0x78, 0x5F, 0x7F, 0x90, 0x71, 0xFC, 0xEF, 0x44, 0x01, 0xFD, 0x7F, 0x90, 0x51, 0x9C, 0x7F, +0x14, 0x7E, 0x00, 0x02, 0x3D, 0x7A, 0xFF, 0x75, 0xF0, 0x04, 0xE5, 0x51, 0x90, 0x96, 0x14, 0x31, +0x54, 0xE0, 0x22, 0x12, 0x06, 0x89, 0x54, 0x7F, 0xF5, 0x51, 0x12, 0x74, 0x1C, 0xFF, 0x54, 0x1F, +0xF5, 0x53, 0xF1, 0x4F, 0xF5, 0x52, 0xF1, 0x49, 0xFF, 0x54, 0x03, 0xF5, 0x54, 0xEF, 0x54, 0x30, +0xC4, 0x54, 0x0F, 0xF5, 0x57, 0xF1, 0x49, 0xFF, 0x54, 0x40, 0xC4, 0x13, 0x13, 0x54, 0x03, 0xF5, +0x55, 0xF1, 0x4F, 0xF5, 0x56, 0xF1, 0x49, 0xFF, 0x54, 0x08, 0x13, 0x13, 0x13, 0x54, 0x1F, 0xF5, +0x59, 0xEF, 0x54, 0x04, 0x13, 0x13, 0x54, 0x3F, 0xF5, 0x5A, 0xE5, 0x56, 0x12, 0xAF, 0x08, 0xB1, +0xF6, 0x54, 0x7F, 0x4F, 0xF0, 0xE5, 0x55, 0x54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 0x01, 0xF0, 0x12, 0xAF, 0x11, 0x11, 0x26, 0x90, 0xA0, 0x62, 0x74, 0x01, 0xF0, 0x22, 0x90, +0xA0, 0x62, 0xE0, 0x64, 0x01, 0x70, 0x1F, 0x11, 0xB9, 0x12, 0x8F, 0x6C, 0xE0, 0x30, 0xE0, 0x16, +0x75, 0xF0, 0x0E, 0xEF, 0x12, 0xAD, 0xD9, 0x31, 0xE2, 0x12, 0xAF, 0x11, 0xF0, 0xE4, 0xFB, 0xFD, +0x7F, 0x54, 0x7E, 0x01, 0x01, 0x2E, 0x11, 0xC2, 0x22, 0x90, 0xA0, 0x60, 0xE0, 0xC3, 0x13, 0x54, +0x07, 0x22, 0x90, 0xA0, 0x60, 0xE0, 0xFF, 0xC3, 0x13, 0xFE, 0xEF, 0x54, 0xF1, 0xFF, 0xEE, 0x04, +0x54, 0x07, 0x25, 0xE0, 0x4F, 0xF0, 0xA3, 0xE0, 0xFF, 0x12, 0xAE, 0x80, 0xB5, 0x07, 0x04, 0xEE, +0x54, 0xF1, 0xF0, 0x12, 0x4F, 0xFF, 0xE4, 0x90, 0xA0, 0x62, 0xF0, 0x51, 0xA5, 0x12, 0xAE, 0x80, +0xF1, 0xE7, 0xE0, 0xFA, 0x75, 0xF0, 0x0E, 0xED, 0x51, 0x99, 0xFC, 0x54, 0x03, 0xFD, 0xEC, 0x13, +0x13, 0x54, 0x07, 0xFB, 0xEE, 0x12, 0xAF, 0x86, 0xAF, 0x02, 0x51, 0xE9, 0x11, 0xB9, 0xFE, 0x75, +0xF0, 0x0E, 0x51, 0x99, 0xFD, 0x54, 0x03, 0xFF, 0xED, 0xC4, 0x13, 0x54, 0x07, 0xFD, 0x75, 0xF0, +0x0E, 0xEE, 0x51, 0x99, 0xF1, 0x21, 0x11, 0xB9, 0xFF, 0x75, 0xF0, 0x0E, 0x90, 0xA0, 0x6E, 0x12, +0x49, 0x54, 0xE0, 0x04, 0xF0, 0x75, 0xF0, 0x0E, 0xEF, 0x51, 0x34,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ED, 0xF0, 0x90, 0x04, 0x1D, 0xE0, 0x60, 0x25, 0x90, 0x05, 0x22, 0xE0, 0x90, 0xA2, +0xE1, 0xF0, 0x7D, 0x13, 0x51, 0xA1, 0xBF, 0x01, 0x0B, 0x12, 0x90, 0xD5, 0x90, 0xA2, 0xDF, 0xF1, +0xD8, 0x12, 0x92, 0x78, 0x90, 0xA2, 0xE1, 0xE0, 0xFF, 0x7D, 0x15, 0x51, 0x45, 0x80, 0x0B, 0x12, +0x90, 0xD5, 0x90, 0xA2, 0xDF, 0xF1, 0xD8, 0x12, 0x92, 0x78, 0x12, 0x92, 0x71, 0x7F, 0x01, 0xD0, +0xD0, 0x92, 0xAF, 0x22, 0x90, 0xA0, 0x6F, 0x12, 0x49, 0x54, 0xE0, 0xFF, 0x7E, 0x00, 0xE4, 0xFD, +0x31, 0xE2, 0xE4, 0xFD, 0xFF, 0x90, 0x05, 0x22, 0xEF, 0xF0, 0x90, 0x9E, 0x96, 0xED, 0xF0, 0x22, +0x8F, 0x54, 0x7D, 0x17, 0x51, 0xA1, 0x75, 0xF0, 0x0E, 0xE5, 0x54, 0xF1, 0xEB, 0xE0, 0xFC, 0x51, +0x94, 0xFE, 0x54, 0x03, 0xFD, 0xEE, 0x13, 0x13, 0x54, 0x07, 0xFB, 0x90, 0xA0, 0x60, 0xE0, 0xFE, +0x12, 0xAF, 0x86, 0xAF, 0x04, 0x51, 0xE9, 0x51, 0x94, 0xFE, 0x54, 0x03, 0xFF, 0xEE, 0xC4, 0x13, +0x54, 0x07, 0xFD, 0x51, 0x94, 0xF1, 0x21, 0x75, 0xF0, 0x0E, 0xE5, 0x54, 0x51, 0x34, 0xAD, 0x54, +0xE4, 0xFF, 0x21, 0x40, 0x75, 0xF0, 0x0E, 0xE5, 0x54, 0x90, 0xA0, 0x64, 0x12, 0x49, 0x54, 0xE0, +0x22, 0x7F, 0xFF, 0x51, 0x45, 0xE4, 0x90, 0xA3, 0x1F, 0xF0, 0xA3, 0xF0, 0x90, 0x05, 0xF8, 0xE0, +0x70, 0x0F, 0xA3, 0xE0, 0x70, 0x0B, 0xA3, 0xE0, 0x70, 0x07, 0xA3, 0xE0, 0x70, 0x03, 0x7F, 0x01, +0x22, 0xD3, 0x90, 0xA3, 0x20, 0xE0, 0x94, 0xE8, 0x90, 0xA3, 0x1F, 0xE0, 0x94, 0x03, 0x40, 0x0A, +0x90, 0x01, 0xC0, 0xE0, 0x44, 0x20, 0xF0, 0x7F, 0x00, 0x22, 0x7F, 0x32, 0x7E, 0x00, 0x12, 0x3D, +0x7A, 0x90, 0xA3, 0x1F, 0x12, 0x78, 0xFB, 0x80, 0xC3, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, +0x90, 0xA3, 0x00, 0xED, 0xF0, 0xA3, 0xEB, 0xF0, 0x90, 0xA2, 0xFF, 0xEF, 0xF0, 0x90, 0xA3, 0x02, +0xE0, 0xFD, 0x12, 0x9D, 0x4E, 0x90, 0xA2, 0xFF, 0xE0, 0xC3, 0x94, 0x0E, 0x50, 0x40, 0x90, 0xA2, +0xB1, 0x12, 0x08, 0x79, 0x1F, 0xFE, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x12, 0xD4, +0x00, 0x00, 0x12, 0xAF, 0xB5, 0x90, 0xA2, 0x9F, 0x12, 0x08, 0x79, 0x00, 0x07, 0x03, 0x00, 0x90, +0xA2, 0xA3, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0xB1, 0xB2, 0x12, 0x08, 0x79, 0x00, 0x07, +0x03, 0x00, 0x90, 0xA2, 0xA3, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0x81, 0x6E, 0x12, 0xAE, +0xA7, 0x50, 0x1B, 0xEF, 0x94, 0x30, 0x50, 0x16, 0x90, 0xA2, 0xB1, 0x12, 0x08, 0x79, 0x1F, 0xFE, +0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x09, 0x28, 0x00, 0x00, 0x80, 0x65, 0x90, 0xA2, +0xFF, 0xE0, 0xFF, 0x74, 0x32, 0xD3, 0x9F, 0x50, 0x1B, 0xEF, 0x94, 0x40, 0x50, 0x16, 0x90, 0xA2, +0xB1, 0x12, 0x08, 0x79, 0x1F, 0xFE, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x08, 0xA6, +0x00, 0x00, 0x80, 0x3F, 0x12, 0xAE, 0x9D, 0x50, 0x1B, 0xEF, 0x94, 0x74, 0x50, 0x16, 0x90, 0xA2, +0xB1, 0x12, 0x08, 0x79, 0x1F, 0xFE, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x08, 0xA4, +0x00, 0x00, 0x80, 0x1F, 0x90, 0xA2, 0xFF, 0xE0, 0xFF, 0x74, 0x76, 0xD3, 0x9F, 0x50, 0x17, 0x90, +0xA2, 0xB1, 0x12, 0x08, 0x79, 0x1F, 0xFE, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x08, +0x24, 0x00, 0x00, 0x12, 0xAF, 0xB5, 0x12, 0xAE, 0xA7, 0x50, 0x2E, 0xEF, 0x94, 0x40, 0x50, 0x29, +0x90, 0xA2, 0x9F, 0x12, 0x08, 0x79, 0x00, 0x07, 0x03, 0x00, 0x90, 0xA2, 0xA3, 0x12, 0x08, 0x79, +0x00, 0x01, 0x01, 0x00, 0xB1, 0xB2, 0x12, 0x08, 0x79, 0x00, 0x07, 0x03, 0x00, 0x90, 0xA2, 0xA3, +0x12, 0x08, 0x79, 0x00, 0x01, 0x01, 0x00, 0x80, 0x65, 0x12, 0xAE, 0x9D, 0x50, 0x2E, 0xEF, 0x94, +0x8C, 0x50, 0x29, 0x90, 0xA2, 0x9F, 0x12, 0x08, 0x79, 0x00, 0x07, 0x03, 0x00, 0x90, 0xA2, 0xA3, +0x12, 0x08, 0x79, 0x00, 0x03, 0x01, 0x00, 0xB1, 0xB2, 0x12, 0x08, 0x79, 0x00, 0x07, 0x03, 0x00, +0x90, 0xA2, 0xA3, 0x12, 0x08, 0x79, 0x00, 0x03, 0x01, 0x00, 0x80, 0x32, 0x90, 0xA2, 0xFF, 0xE0, +0xFF, 0x74, 0x8C, 0xC3, 0x9F, 0x50, 0x2B, 0x90, 0xA2, 0x9F, 0x12, 0x08, 0x79, 0x00, 0x07, 0x03, +0x00, 0x90, 0xA2, 0xA3, 0x12, 0x08, 0x79, 0x00, 0x05, 0x01, 0x00, 0xB1, 0xB2, 0x12, 0x08, 0x79, +0x00, 0x07, 0x03, 0x00, 0x90, 0xA2, 0xA3, 0x12, 0x08, 0x79, 0x00, 0x05, 0x01, 0x00, 0xF1, 0xE0, +0xB1, 0x30, 0x90, 0xA3, 0x00, 0xE0, 0x64, 0x02, 0x70, 0x51, 0x90, 0xA2, 0xFF, 0xE0, 0xFF, 0xD3, +0x94, 0x30, 0x50, 0x05, 0x75, 0x70, 0x2A, 0x80, 0x5E, 0xEF, 0xD3, 0x94, 0x40, 0x50, 0x05, 0x75, +0x70, 0x3A, 0x80, 0x53, 0xEF, 0xD3, 0x94, 0x70, 0x50, 0x05, 0x75, 0x70, 0x6A, 0x80, 0x48, 0xEF, +0xD3, 0x94, 0x80, 0x50, 0x05, 0x75, 0x70, 0x7A, 0x80, 0x3D, 0xEF, 0xD3, 0x94, 0x90, 0x50, 0x05, +0x75, 0x70, 0x8A, 0x80, 0x32, 0xEF, 0xD3, 0x94, 0xA1, 0x50, 0x05, 0x75, 0x70, 0x9B, 0x80, 0x27, +0xEF, 0xD3, 0x94, 0xB1, 0x50, 0x21, 0x75, 0x70, 0xAB, 0x80, 0x1C, 0x90, 0xA3, 0x00, 0xE0, 0x64, +0x01, 0x70, 0x2D, 0xA3, 0xE0, 0x90, 0xA2, 0xFF, 0xB4, 0x01, 0x07, 0xE0, 0x24, 0x02, 0xF5, 0x70, +0x80, 0x05, 0xE0, 0x24, 0xFE, 0xF5, 0x70, 0x90, 0xA2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3C, 0x33, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xE4, 0xFC, 0xFD, 0xFE, 0x90, 0xA2, 0xA3, 0x12, +0x08, 0x6D, 0x7D, 0x18, 0x7C, 0x00, 0xE4, 0xFF, 0xB1, 0x30, 0x90, 0xA2, 0x9F, 0x22, 0xD3, 0x10, +0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xEF, 0x14, 0x60, 0x30, 0x14, 0x60, 0x56, 0x24, 0x02, 0x70, 0x7D, +0x90, 0xA2, 0x9F, 0x12, 0x08, 0x79, 0x00, 0x00, 0x0C, 0x00, 0x90, 0xA2, 0xA3, 0x12, 0x08, 0x79, +0x00, 0x00, 0x0C, 0x00, 0xB1, 0xB2, 0x12, 0x08, 0x79, 0x00, 0x00, 0x0C, 0x00, 0x90, 0xA2, 0xA3, +0x12, 0x08, 0x79, 0x00, 0x00, 0x0C, 0x00, 0x80, 0x50, 0x90, 0xA2, 0x9F, 0x12, 0x08, 0x79, 0x00, +0x00, 0x0C, 0x00, 0x90, 0xA2, 0xA3, 0x12, 0x08, 0x79, 0x00, 0x00, 0x04, 0x00, 0xB1, 0xB2, 0x12, +0x08, 0x79, 0x00, 0x00, 0x0C, 0x00, 0x90, 0xA2, 0xA3, 0x12, 0x08, 0x79, 0x00, 0x00, 0x04, 0x00, +0x80, 0x27, 0x90, 0xA2, 0x9F, 0x12, 0x08, 0x79, 0x00, 0x00, 0x0C, 0x00, 0x90, 0xA2, 0xA3, 0x12, +0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0xB1, 0xB2, 0x12, 0x08, 0x79, 0x00, 0x00, 0x0C, 0x00, 0x90, +0xA2, 0xA3, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0xF1, 0xE0, 0xB1, 0x30, 0xD0, 0xD0, 0x92, +0xAF, 0x22, 0x12, 0x77, 0xCC, 0x12, 0x06, 0x89, 0xC4, 0x54, 0x0F, 0xFF, 0xBF, 0x0F, 0x15, 0x90, +0xA0, 0x60, 0xE0, 0x54, 0xFE, 0xF0, 0x12, 0x71, 0x05, 0x12, 0xAE, 0xE3, 0x54, 0x0F, 0xFF, 0x51, +0x50, 0x02, 0x85, 0x11, 0x12, 0x74, 0x16, 0x12, 0xAF, 0xCC, 0xF1, 0xE7, 0xEF, 0x12, 0x4F, 0x48, +0x54, 0x03, 0xFF, 0x75, 0xF0, 0x0E, 0xED, 0x51, 0x99, 0x54, 0xFC, 0x12, 0x4F, 0x47, 0x54, 0x1C, +0xFF, 0xEE, 0x54, 0x0F, 0xFE, 0x75, 0xF0, 0x0E, 0x51, 0x99, 0x54, 0xE3, 0x12, 0x4F, 0x47, 0x54, +0xE0, 0xFF, 0x75, 0xF0, 0x0E, 0xEE, 0x51, 0x99, 0x54, 0x1F, 0x4F, 0xF0, 0x90, 0x00, 0x04, 0x12, +0xAE, 0x75, 0xE4, 0xFB, 0x12, 0xAA, 0x2F, 0xA9, 0x53, 0x90, 0x00, 0x05, 0x12, 0xAE, 0x75, 0x7B, +0x01, 0x12, 0xAA, 0x2F, 0xA9, 0x53, 0xF1, 0x1B, 0x33, 0x33, 0x33, 0x54, 0xF8, 0x12, 0xAF, 0xCC, +0xFD, 0x75, 0xF0, 0x0E, 0x90, 0xA0, 0x6C, 0x12, 0x49, 0x54, 0xEF, 0xF1, 0x1A, 0xC4, 0x13, 0x54, +0x07, 0xFF, 0x75, 0xF0, 0x0E, 0xED, 0x90, 0xA0, 0x6D, 0x12, 0x49, 0x54, 0xEF, 0xF0, 0xEE, 0xC4, +0x54, 0x0F, 0xFF, 0x14, 0x6D, 0x70, 0x22, 0x90, 0xA0, 0x61, 0xEF, 0x12, 0x67, 0xCE, 0x54, 0x0F, +0xC4, 0x54, 0xF0, 0xFF, 0x90, 0xA0, 0x60, 0xE0, 0x54, 0x0F, 0x4F, 0xF0, 0x54, 0xF1, 0xF0, 0x44, +0x01, 0xF0, 0x7D, 0x20, 0xE4, 0xFF, 0x12, 0x71, 0x69, 0x22, 0xF0,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9F, 0xAA, 0xE0, 0xFE, +0x6F, 0x70, 0x02, 0x21, 0xB3, 0xEF, 0x70, 0x02, 0x21, 0x24, 0x24, 0xFE, 0x70, 0x02, 0x21, 0x5E, +0x24, 0xFE, 0x60, 0x48, 0x24, 0xFC, 0x70, 0x02, 0x21, 0x99, 0x24, 0xFC, 0x60, 0x02, 0x21, 0xAC, +0xEE, 0xB4, 0x0E, 0x02, 0x31, 0xEC, 0x90, 0x9F, 0xAA, 0xE0, 0x70, 0x04, 0x7F, 0x01, 0x51, 0x33, +0x90, 0x9F, 0xAA, 0xE0, 0xB4, 0x06, 0x02, 0x51, 0x0D, 0x90, 0x9F, 0xAA, 0xE0, 0xB4, 0x04, 0x0E, +0x90, 0xA3, 0x2F, 0xE0, 0xFF, 0x60, 0x05, 0x12, 0x8D, 0x70, 0x80, 0x02, 0xD1, 0x7A, 0x90, 0x9F, +0xAA, 0xE0, 0x64, 0x08, 0x60, 0x02, 0x21, 0xAC, 0xF1, 0x43, 0x21, 0xAC, 0x90, 0x9F, 0xAA, 0xE0, +0x70, 0x04, 0x7F, 0x01, 0x51, 0x33, 0x90, 0x9F, 0xAA, 0xE0, 0xB4, 0x06, 0x02, 0x51, 0x0D, 0x90, +0x9F, 0xAA, 0xE0, 0xB4, 0x0E, 0x07, 0x31, 0xB8, 0xBF, 0x01, 0x02, 0x31, 0xEC, 0x90, 0x9F, 0xAA, +0xE0, 0x64, 0x0C, 0x60, 0x02, 0x21, 0xAC, 0x31, 0xB8, 0xEF, 0x64, 0x01, 0x60, 0x02, 0x21, 0xAC, +0x51, 0x4C, 0x21, 0xAC, 0x90, 0x9F, 0xAA, 0xE0, 0xB4, 0x0E, 0x07, 0x31, 0xB8, 0xBF, 0x01, 0x02, +0x31, 0xEC, 0x90, 0x9F, 0xAA, 0xE0, 0xB4, 0x06, 0x02, 0x51, 0x0D, 0x90, 0x9F, 0xAA, 0xE0, 0xB4, +0x0C, 0x07, 0x31, 0xB8, 0xBF, 0x01, 0x02, 0x51, 0x4C, 0x90, 0x9F, 0xAA, 0xE0, 0x64, 0x04, 0x70, +0x5B, 0x12, 0x89, 0x32, 0xEF, 0x64, 0x01, 0x70, 0x53, 0x12, 0x84, 0x69, 0x80, 0x4E, 0x90, 0x9F, +0xAA, 0xE0, 0xB4, 0x0E, 0x07, 0x31, 0xB8, 0xBF, 0x01, 0x02, 0x31, 0xEC, 0x90, 0x9F, 0xAA, 0xE0, +0xB4, 0x06, 0x02, 0x51, 0x0D, 0x90, 0x9F, 0xAA, 0xE0, 0xB4, 0x0C, 0x07, 0x31, 0xB8, 0xBF, 0x01, +0x02, 0x51, 0x4C, 0x90, 0x9F, 0xAA, 0xE0, 0x70, 0x04, 0x7F, 0x01, 0x51, 0x33, 0x90, 0x9F, 0xAA, +0xE0, 0xB4, 0x04, 0x18, 0x12, 0xAA, 0xE3, 0x80, 0x13, 0x90, 0x9F, 0xAA, 0xE0, 0xB4, 0x0C, 0x0C, +0x90, 0x9F, 0xA4, 0x12, 0x8D, 0x69, 0x30, 0xE0, 0x03, 0x12, 0xAC, 0x2B, 0x90, 0x9F, 0xAA, 0x12, +0xAD, 0xCC, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xF1, 0x97, 0xEF, 0x64, 0x01, 0x60, 0x05, 0x12, +0x89, 0xC9, 0x80, 0x1F, 0x12, 0xAA, 0xAC, 0x30, 0xE0, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x02, 0xF0, +0x80, 0x11, 0x90, 0x9F, 0xA9, 0xE0, 0xD3, 0x94, 0x04, 0x40, 0x05, 0x12, 0x89, 0x2B, 0x80, 0x03, +0x02, 0x8A, 0x0B, 0x90, 0x01, 0xB9, 0x74, 0x02, 0xF0, 0x7F, 0x00, 0x22, 0x90, 0x9F, 0xA4, 0xE0, +0xC3, 0x13, 0x20, 0xE0, 0x04, 0x51, 0x87, 0x80, 0x0E, 0x12, 0xAC, 0xA3, 0xB1, 0x88, 0x90, 0x05, +0x27, 0xE0, 0x44, 0x80, 0xF0, 0x51, 0x45, 0xE4, 0xFD, 0xFF, 0x02, 0x52, 0x45, 0x90, 0x9F, 0xA4, +0xE0, 0x90, 0x06, 0x04, 0x20, 0xE0, 0x07, 0xE0, 0x44, 0x40, 0xB1, 0x88, 0x80, 0x0F, 0x51, 0x83, +0x90, 0x05, 0x27, 0xE0, 0x54, 0x7F, 0xF0, 0x90, 0x9F, 0xA2, 0x74, 0x0C, 0xF0, 0xE4, 0xFD, 0xFF, +0x02, 0x52, 0x45, 0x90, 0xA3, 0x2E, 0xEF, 0xF0, 0x12, 0x4C, 0x32, 0x90, 0xA3, 0x2E, 0xE0, 0x60, +0x02, 0xD1, 0x74, 0xB1, 0x89, 0x90, 0x9F, 0xA2, 0x74, 0x04, 0xF0, 0x22, 0x12, 0x8C, 0x45, 0x70, +0x31, 0x90, 0x9F, 0xA4, 0xE0, 0x54, 0xFD, 0xF0, 0x7D, 0x2C, 0x7F, 0x6F, 0x12, 0x52, 0x45, 0x7D, +0x08, 0x7F, 0x01, 0x12, 0x57, 0x69, 0xBF, 0x01, 0x14, 0x90, 0x9F, 0xA3, 0xE0, 0x44, 0x80, 0xF0, +0x7D, 0x0E, 0x7F, 0x01, 0x51, 0x8B, 0x90, 0x9F, 0xA2, 0x74, 0x0E, 0xF0, 0x22, 0x12, 0x8E, 0xD7, +0x04, 0xF0, 0x22, 0xE0, 0x54, 0x7F, 0xF0, 0x7D, 0x0C, 0x7F, 0x01, 0xD3, 0x10, 0xAF, 0x01, 0xC3, +0xC0, 0xD0, 0x90, 0xA3, 0x2D, 0xEF, 0xF0, 0x14, 0x60, 0x15, 0x14, 0x60, 0x19, 0x24, 0x02, 0x70, +0x1A, 0xED, 0x54, 0x01, 0xFF, 0x90, 0x9F, 0xA3, 0xE0, 0x54, 0xFE, 0x4F, 0xF0, 0x80, 0x0C, 0x90, +0x9F, 0xAA, 0xED, 0xF0, 0x80, 0x05, 0x90, 0x9F, 0xA9, 0xED, 0xF0, 0x7F, 0x8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30, 0xE0, 0x03, 0x43, 0x54, 0x14, 0x90, 0x9F, 0x9E, 0xE0, 0xC4, +0x13, 0x54, 0x07, 0x30, 0xE0, 0x03, 0x43, 0x54, 0x80, 0x90, 0x9F, 0x9E, 0xF1, 0xEA, 0x20, 0xE0, +0x03, 0x43, 0x54, 0x40, 0x91, 0x70, 0x90, 0x9F, 0xA1, 0xE0, 0x70, 0x04, 0x7F, 0x01, 0x91, 0x77, +0xD1, 0xF3, 0x30, 0xE0, 0x04, 0x7F, 0x04, 0x80, 0x0B, 0xD1, 0xFE, 0xEF, 0x60, 0x04, 0x7F, 0x01, +0x80, 0x02, 0x7F, 0x02, 0x91, 0x77, 0x81, 0x3A, 0x75, 0x54, 0x01, 0x91, 0x70, 0x90, 0x9F, 0xA1, +0xE0, 0x64, 0x04, 0x60, 0x02, 0x81, 0x6B, 0xFF, 0x91, 0x77, 0x81, 0x6B, 0x90, 0x9F, 0x9E, 0xE0, +0x30, 0xE0, 0x6F, 0x12, 0x71, 0x65, 0x43, 0x54, 0x31, 0xD1, 0xE2, 0x30, 0xE0, 0x08, 0x12, 0xAD, +0xEC, 0x43, 0x54, 0x08, 0x80, 0x07, 0x7D, 0x40, 0xE4, 0xFF, 0x12, 0x71, 0x7B, 0xD1, 0xD9, 0x54, +0x1F, 0x30, 0xE0, 0x03, 0x43, 0x54, 0x02, 0xEF, 0xC4, 0x54, 0x0F, 0x30, 0xE0, 0x03, 0x43, 0x54, +0x04, 0x91, 0x70, 0xD1, 0xF3, 0x30, 0xE0, 0x0A, 0xF1, 0x78, 0x60, 0x2E, 0xE4, 0xFD, 0x7F, 0x02, +0x80, 0x1C, 0xD1, 0xC9, 0x90, 0x9F, 0xA2, 0xE0, 0xB4, 0x02, 0x17, 0xB1, 0x97, 0xD1, 0xFE, 0xBF, +0x01, 0x09, 0x90, 0x9F, 0xA9, 0xE0, 0xFF, 0x7D, 0x01, 0x80, 0x03, 0xE4, 0xFD, 0xFF, 0x11, 0x67, +0x80, 0x08,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, 0x08, 0xAA, +0x12, 0xAF, 0x70, 0x12, 0xAF, 0x58, 0xD1, 0x74, 0xE4, 0x90, 0xA0, 0x51, 0xF0, 0x22, 0xE4, 0xFD, +0x7F, 0x0C, 0x11, 0x67, 0xE4, 0xFD, 0xFF, 0x02, 0x52, 0x45, 0x12, 0xAF, 0x70, 0xD1, 0x74, 0x7D, +0x0C, 0x7F, 0x01, 0x41, 0x8B, 0x90, 0x9F, 0xA7, 0xE0, 0x64, 0x01, 0x70, 0x12, 0x12, 0x67, 0xD6, +0x60, 0x05, 0xD1, 0x6E, 0x02, 0xAA, 0x73, 0x90, 0x9F, 0xAA, 0xE0, 0x70, 0x02, 0x11, 0x63, 0x22, +0xD1, 0x74, 0x90, 0x9F, 0xA1, 0x74, 0x01, 0xF0, 0x22, 0xD1, 0x74, 0xD1, 0xC9, 0x80, 0xF3, 0xD1, +0xA9, 0x12, 0xAA, 0xFA, 0xE4, 0x90, 0x9F, 0xA1, 0xF0, 0x22, 0xD1, 0xBE, 0x80, 0xF3, 0x12, 0x4C, +0x32, 0xD1, 0x74, 0x80, 0xDD, 0xD1, 0xA0, 0x80, 0xE8, 0x90, 0x05, 0x27, 0xE0, 0x44, 0x40, 0xF0, +0x22, 0x4D, 0xFF, 0x90, 0x9F, 0x9E, 0xF0, 0xEE, 0x22, 0x90, 0x9F, 0x9E, 0xE0, 0xFF, 0x13, 0x13, +0x13, 0x22, 0x90, 0x9F, 0x9E, 0xE0, 0x13, 0x13, 0x54, 0x3F, 0x22, 0xF1, 0x97, 0xEF, 0x70, 0x02, +0xD1, 0x85, 0x22, 0x90, 0x9F, 0x9E, 0xE0, 0xFF, 0xC4, 0x13, 0x13, 0x54, 0x03, 0x22, 0x90, 0x05, +0x43, 0xE0, 0x7F, 0x00, 0x30, 0xE7, 0x02, 0x7F, 0x01, 0x22, 0xAE, 0x07, 0xD1, 0xFE, 0xBF, 0x01, +0x11, 0x90, 0x9F, 0x9E, 0xF1, 0xEA, 0x20, 0xE0, 0x09, 0xAF, 0x06, 0x7D, 0x01, 0x11, 0x67, 0x7F, +0x01, 0x22, 0x7F, 0x00, 0x22, 0x7D, 0x22, 0x7F, 0xFF, 0x12, 0x52, 0x45, 0xD1, 0xC9, 0x90, 0x9F, +0xA1, 0x74, 0x03, 0xF0, 0x22, 0x90, 0x9F, 0xDD, 0xE0, 0x24, 0x04, 0x90, 0x9F, 0xBF, 0xF0, 0xA3, +0x74, 0x08, 0x22, 0x12, 0x4C, 0x32, 0xD1, 0x74, 0x51, 0x87, 0x90, 0x9F, 0xA2, 0x74, 0x0C, 0xF0, +0x22, 0x12, 0xAA, 0x73, 0x90, 0x9F, 0xAA, 0xE0, 0x64, 0x0C, 0x60, 0x05, 0xD1, 0x6E, 0x12, 0x57, +0x65, 0x22, 0xD1, 0xF3, 0x30, 0xE0, 0x0A, 0xF1, 0x78, 0x60, 0x06, 0x7D, 0x01, 0x7F, 0x02, 0x11, +0x67, 0xF1, 0x78, 0x60, 0x02, 0xF1, 0x7F, 0x22, 0x90, 0x9F, 0xA2, 0xE0, 0x64, 0x02, 0x22, 0x90, +0x9F, 0xA7, 0xE0, 0x64, 0x02, 0x60, 0x0F, 0x12, 0x67, 0xD6, 0x60, 0x0A, 0xF1, 0x97, 0xEF, 0x70, +0x05, 0xFD, 0x7F, 0x0C, 0x11, 0x67, 0x22, 0x90, 0x04, 0x1A, 0xE0, 0xF4, 0x60, 0x03, 0x7F, 0x00, +0x22, 0x90, 0x04, 0x1B, 0xE0, 0x54, 0x07, 0x64, 0x07, 0x7F, 0x01, 0x60, 0x02, 0x7F, 0x00, 0x22, +0x90, 0x9F, 0xA7, 0xE0, 0x70, 0x07, 0x90, 0x9F, 0x9E, 0xE0, 0x30, 0xE0, 0x10, 0x90, 0x9F, 0x9E, +0xE0, 0x30, 0xE0, 0x07, 0xD1, 0xFE, 0xBF, 0x01, 0x04, 0x80, 0xB4, 0xD1, 0x85, 0x22, 0xC1, 0xA2, +0xF1, 0xCE, 0x02, 0x57, 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0x41, 0x53, +0x80, 0x03, 0x90, 0x41, 0xA7, 0x93, 0xF5, 0x58, 0xE5, 0x58, 0x75, 0xF0, 0x06, 0xA4, 0x24, 0xB1, +0xF9, 0x74, 0x40, 0x35, 0xF0, 0xFA, 0x7B, 0xFF, 0x90, 0xA1, 0x3F, 0x12, 0x49, 0x69, 0xC3, 0xE5, +0x57, 0x94, 0x0F, 0xE5, 0x56, 0x94, 0x00, 0x50, 0x60, 0x90, 0xA1, 0x42, 0x12, 0x49, 0x60, 0x90, +0x00, 0x06, 0x12, 0x07, 0xAB, 0xFF, 0xAE, 0xF0, 0xD1, 0x19, 0x2F, 0xFD, 0xE5, 0xF0, 0x3E, 0xFC, +0x12, 0xAE, 0xD9, 0xD3, 0xED, 0x9F, 0xEC, 0x9E, 0x40, 0x09, 0x7D, 0x01, 0xAF, 0x51, 0x12, 0x93, +0xF2, 0x81, 0x03, 0xE5, 0x57, 0xAE, 0x56, 0x78, 0x02, 0xCE, 0xC3, 0x13, 0xCE, 0x13, 0xD8, 0xF9, +0xFD, 0xAC, 0x06, 0xE5, 0x56, 0xC3, 0x13, 0xFE, 0xE5, 0x57, 0x13, 0x2D, 0xFF, 0xEE, 0x3C, 0xFE, +0x90, 0xA1, 0x42, 0x12, 0x49, 0x60, 0x12, 0x07, 0x80, 0xD3, 0x9F, 0xE5, 0xF0, 0x9E, 0x50, 0x02, +0x81, 0x03, 0xAF, 0x51, 0x12, 0x98, 0xD6, 0x81, 0x03, 0xE5, 0x51, 0x70, 0x46, 0x90, 0xA1, 0x42, +0x12, 0x49, 0x60, 0xD1, 0x19, 0xFD, 0xAC, 0xF0, 0x12, 0xAE, 0xD9, 0xC3, 0xED, 0x9F, 0xEC, 0x9E, +0x50, 0x08, 0x90, 0x9E, 0x91, 0x74, 0x01, 0xF0, 0x80, 0x29, 0xE5, 0x57, 0xAE, 0x56, 0x78, 0x03, +0xCE, 0xC3, 0x13, 0xCE, 0x13, 0xD8, 0xF9, 0xFB, 0xAA, 0x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1, 0x0D, 0xE0, +0xC3, 0x94, 0xC0, 0x40, 0x05, 0xD1, 0x0D, 0x74, 0xC0, 0xF0, 0xD1, 0x0D, 0x12, 0x5F, 0xEA, 0x25, +0xE0, 0xFF, 0x70, 0x04, 0xF5, 0x5B, 0x80, 0x04, 0xEF, 0x14, 0xF5, 0x5B, 0xD3, 0x90, 0xA1, 0x46, +0xE0, 0x94, 0x03, 0x90, 0xA1, 0x45, 0xE0, 0x94, 0x00, 0x40, 0x03, 0xE4, 0xF5, 0x5B, 0xD1, 0x20, +0xE0, 0x54, 0xF8, 0x90, 0xA1, 0x52, 0xF0, 0x45, 0x5B, 0xFF, 0xD1, 0x1F, 0xEF, 0xF0, 0xD1, 0x01, +0xE0, 0xD3, 0x94, 0x05, 0x74, 0x11, 0x50, 0x07, 0xD1, 0x03, 0xE0, 0x04, 0xF0, 0x80, 0x04, 0xD1, +0x03, 0xE4, 0xF0, 0xE4, 0xFD, 0xAF, 0x51, 0x12, 0x87, 0x32, 0x05, 0x51, 0x01, 0x7B, 0x22, 0xF5, +0x5B, 0x74, 0x11, 0x25, 0x51, 0xF5, 0x82, 0xE4, 0x34, 0x9C, 0xF5, 0x83, 0x22, 0x74, 0x01, 0x25, +0x51, 0xF5, 0x82, 0xE4, 0x34, 0x93, 0xF5, 0x83, 0x22, 0x90, 0x00, 0x08, 0x02, 0x07, 0xAB, 0xF0, +0x75, 0xF0, 0x10, 0xE5, 0x51, 0x90, 0x81, 0x01, 0x02, 0x49, 0x54, 0x74, 0x11, 0x25, 0x51, 0xF5, +0x82, 0xE4, 0x34, 0x98, 0xF5, 0x83, 0x22, 0xFF, 0x74, 0x11, 0x25, 0x51, 0xF5, 0x82, 0xE4, 0x34, +0x9A, 0xF5, 0x83, 0x22, 0xF1, 0xEB, 0xF5, 0x51, 0x24, 0x91, 0xD1, 0xE5, 0xE0, 0x54, 0x9C, 0xF0, +0x74, 0x91, 0x25, 0x51, 0xD1, 0xE5, 0xC0, 0x83, 0xC0, 0x82, 0xD1, 0xED, 0x12, 0x57, 0x1B, 0x54, +0x01, 0xFE, 0xEF, 0x4E, 0xD0, 0x82, 0xD0, 0x83, 0xF0, 0x74, 0x91, 0x25, 0x51, 0xD1, 0xE5, 0xC0, +0x83, 0xC0, 0x82, 0xD1, 0xED, 0x12, 0x57, 0x1B, 0x54, 0x02, 0xFE, 0xEF, 0x4E, 0xD0, 0x82, 0xD0, +0x83, 0xF0, 0x74, 0x91, 0x25, 0x51, 0xD1, 0xE5, 0xC0, 0x83, 0xC0, 0x82, 0xD1, 0xED, 0x12, 0x57, +0x1B, 0x54, 0x40, 0xFE, 0xEF, 0x4E, 0xD0, 0x82, 0xD0, 0x83, 0xF0, 0x74, 0x91, 0x25, 0x51, 0xD1, +0xE5, 0xC0, 0x83, 0xC0, 0x82, 0xD1, 0xED, 0x12, 0x57, 0x1B, 0x54, 0x20, 0xFE, 0xEF, 0x4E, 0xD0, +0x82, 0xD0, 0x83, 0xF0, 0xE5, 0x51, 0xC3, 0x94, 0x80, 0x50, 0x07, 0x12, 0x4F, 0x49, 0xD1, 0x37, +0xEF, 0xF0, 0x74, 0x91, 0x25, 0x51, 0xD1, 0xE5, 0xE0, 0x30, 0xE5, 0x11, 0x12, 0x4D, 0xF7, 0x13, +0x13, 0x54, 0x03, 0xFB, 0xD1, 0x38, 0xE0, 0xFD, 0xAF, 0x51, 0x12, 0x98, 0x70, 0x22, 0xE4, 0xF5, +0x63, 0x74, 0x91, 0x25, 0x5D, 0xF5, 0x82, 0xE4, 0x34, 0x99, 0xF5, 0x83, 0x22, 0xE0, 0xFF, 0x90, +0xA1, 0x43, 0x02, 0x49, 0x60, 0xF1, 0xEB, 0xFF, 0x54, 0x7F, 0x90, 0x9F, 0xA7, 0xF0, 0xEF, 0x12, +0x4F, 0x52, 0xA3, 0xF0, 0x12, 0x74, 0x1C, 0xFF, 0x54, 0xF0, 0xC4, 0x54, 0x0F, 0xFE, 0x90, 0x9F, +0xA5, 0xE0, 0x54, 0xF0, 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83, 0x22, 0xF0, 0x90, +0x00, 0x06, 0x02, 0x06, 0xA2, 0xF0, 0x90, 0x9F, 0xA5, 0xE0, 0x54, 0x0F, 0x22, 0xE5, 0x57, 0xAE, +0x56, 0xA8, 0x59, 0x08, 0x22, 0x75, 0x83, 0x00, 0x02, 0x06, 0xA2, 0x90, 0xA1, 0x43, 0x12, 0x49, +0x69, 0x02, 0x06, 0x89, 0x32, 0xC0, 0xE0, 0xC0, 0xF0, 0xC0, 0x83, 0xC0, 0x82, 0xC0, 0xD0, 0x75, +0xD0, 0x00, 0xC0, 0x00, 0xC0, 0x01, 0xC0, 0x02, 0xC0, 0x03, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, +0xC0, 0x07, 0x12, 0x4C, 0x96, 0xE5, 0x14, 0x30, 0xE7, 0x03, 0x12, 0x4F, 0x7A, 0xD0, 0x07, 0xD0, +0x06, 0xD0, 0x05, 0xD0, 0x04, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0xD0, 0xD0, 0xD0, +0x82, 0xD0, 0x83, 0xD0, 0xF0, 0xD0, 0xE0, 0x32, 0xC0, 0xE0, 0xC0, 0xF0, 0xC0, 0x83, 0xC0, 0x82, +0xC0, 0xD0, 0x75, 0xD0, 0x00, 0xC0, 0x00, 0xC0, 0x01, 0xC0, 0x02, 0xC0, 0x03, 0xC0, 0x04, 0xC0, +0x05, 0xC0, 0x06, 0xC0, 0x07, 0x12, 0x8A, 0x7E, 0xE5, 0x19, 0x30, 0xE1, 0x03, 0x12, 0x88, 0x5C, +0xE5, 0x19, 0x30, 0xE4, 0x02, 0xF1, 0xE4, 0xE5, 0x19, 0x30, 0xE5, 0x03, 0x12, 0x8A, 0xDB, 0xE5, +0x19, 0x30, 0xE6, 0x03, 0x12, 0x8B, 0x17, 0xE5, 0x1B, 0x30, 0xE0, 0x03, 0x12, 0x8B, 0x24, 0xE5, +0x1B, 0x30, 0xE1, 0x03, 0x12, 0x72, 0x25, 0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 0x49, 0x54, 0xE0, 0xFF, 0x20, 0xE7, 0x09, 0x90, 0x01, 0xC1, 0xE0, 0x44, 0x20, 0xF0, 0x80, +0x4C, 0xEF, 0x30, 0xE6, 0x17, 0x75, 0xF0, 0x10, 0xE5, 0x64, 0xB1, 0x43, 0xE0, 0xFD, 0x75, 0xF0, +0x04, 0xE5, 0x64, 0x12, 0x4D, 0xFC, 0x31, 0xAE, 0xE4, 0xFB, 0x80, 0x2D, 0x31, 0xA2, 0xE0, 0x04, +0xF0, 0x31, 0xA2, 0xE0, 0xD3, 0x94, 0x01, 0x40, 0x0B, 0xAF, 0x64, 0x12, 0x93, 0xB1, 0x31, 0xA2, +0xE4, 0xF0, 0x80, 0x19, 0x75, 0xF0, 0x10, 0xE5, 0x64, 0xB1, 0x43, 0xE0, 0xFD, 0x75, 0xF0, 0x04, +0xE5, 0x64, 0x12, 0x4D, 0xFC, 0x31, 0xAE, 0x7B, 0x01, 0xAF, 0x64, 0xD1, 0x72, 0x05, 0x64, 0x01, +0xEC, 0x22, 0x74, 0x11, 0x25, 0x64, 0xF5, 0x82, 0xE4, 0x34, 0x9D, 0xF5, 0x83, 0x22, 0x13, 0x13, +0x54, 0x03, 0xF5, 0x6B, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0xA2, 0xFB, 0xEF, +0xF0, 0x75, 0xF0, 0x04, 0x12, 0x4F, 0x61, 0x54, 0x1F, 0xFB, 0x60, 0x12, 0x64, 0x02, 0x60, 0x0E, +0xEB, 0x64, 0x04, 0x60, 0x09, 0xEB, 0x64, 0x09, 0x60, 0x04, 0xEB, 0xB4, 0x0C, 0x0A, 0x12, 0xAE, +0x24, 0xF5, 0x83, 0x74, 0x02, 0xF0, 0x80, 0x08, 0x12, 0xAE, 0x24, 0xF5, 0x83, 0x74, 0x01, 0xF0, +0xE4, 0xF5, 0x6C, 0x90, 0xA2, 0xFB, 0xE0, 0xFD, 0x91, 0x16, 0x25, 0x6C, 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D, 0xFC, 0x31, 0xAE, 0x90, +0xA2, 0xFB, 0xE0, 0xFF, 0xE4, 0xFB, 0xAD, 0x6E, 0xD1, 0x72, 0x90, 0xA2, 0xFB, 0xE0, 0xFF, 0x75, +0xF0, 0x10, 0x12, 0x87, 0x2C, 0xE4, 0xF0, 0x90, 0xA2, 0xFC, 0xE0, 0xFE, 0xC3, 0x94, 0x36, 0x40, +0x0A, 0x74, 0x91, 0x2F, 0x91, 0x0A, 0x74, 0x05, 0xF0, 0x80, 0x4F, 0xEE, 0xC3, 0x94, 0x2C, 0x40, +0x0B, 0x90, 0xA2, 0xFB, 0xE0, 0x91, 0x08, 0x74, 0x04, 0xF0, 0x80, 0x3E, 0x90, 0xA2, 0xFC, 0xE0, +0xFF, 0xC3, 0x94, 0x14, 0x40, 0x0B, 0x90, 0xA2, 0xFB, 0xE0, 0x91, 0x08, 0x74, 0x03, 0xF0, 0x80, +0x29, 0xEF, 0xC3, 0x94, 0x0C, 0x40, 0x0B, 0x90, 0xA2, 0xFB, 0xE0, 0x91, 0x08, 0x74, 0x02, 0xF0, +0x80, 0x18, 0x90, 0xA2, 0xFC, 0xE0, 0xC3, 0x94, 0x04, 0x90, 0xA2, 0xFB, 0xE0, 0x40, 0x07, 0x91, +0x08, 0x74, 0x01, 0xF0, 0x80, 0x04, 0x91, 0x08, 0xE4, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xFF, +0x90, 0xA2, 0xFB, 0xE0, 0x75, 0xF0, 0x08, 0x90, 0x89, 0x00, 0x12, 0x49, 0x54, 0xE5, 0x82, 0x2F, +0xF5, 0x82, 0xE4, 0x35, 0x83, 0xF5, 0x83, 0x22, 0x24, 0x91, 0xF5, 0x82, 0xE4, 0x34, 0x95, 0xF5, +0x83, 0x22, 0x90, 0xA2, 0xFB, 0xE0, 0x75, 0xF0, 0x08, 0x90, 0x89, 0x00, 0x12, 0x49, 0x54, 0xE5, +0x82, 0x22, 0xE4, 0xFF, 0xE4, 0xFE, 0x74, 0x91, 0x2F, 0x12, 0x66, 0xE5, 0xE0, 0x54, 0xFE, 0xF0, +0x75, 0xF0, 0x10, 0xEF, 0x90, 0x81, 0x00, 0xBE, 0x03, 0x0D, 0x12, 0x49, 0x54, 0xE5, 0x82, 0x2E, +0x91, 0x00, 0x74, 0x80, 0xF0, 0x80, 0x0A, 0x12, 0x49, 0x54, 0xE5, 0x82, 0x2E, 0x91, 0x00, 0xE4, +0xF0, 0x75, 0xF0, 0x08, 0xEF, 0x91, 0x19, 0x2E, 0x91, 0x00, 0xE4, 0xF0, 0x0E, 0xBE, 0x10, 0xC6, +0x0F, 0xBF, 0x80, 0xC0, 0xE4, 0x90, 0xAD, 0xE2, 0xF0, 0xFF, 0xE4, 0xFE, 0x75, 0xF0, 0x0A, 0xEF, +0x12, 0x87, 0x08, 0x75, 0xF0, 0x02, 0xEE, 0x12, 0x87, 0x7A, 0xF0, 0x0E, 0xBE, 0x05, 0xED, 0x74, +0x91, 0x2F, 0x12, 0xAD, 0x5B, 0x74, 0x3F, 0xF0, 0x74, 0x11, 0x2F, 0x12, 0x67, 0xC6, 0xE4, 0xF0, +0x74, 0x01, 0x2F, 0x12, 0x66, 0x11, 0x74, 0xC0, 0xF0, 0x74, 0x11, 0x2F, 0xF5, 0x82, 0xE4, 0x34, +0x9E, 0xF5, 0x83, 0xE4, 0x12, 0x87, 0xAC, 0xE4, 0xF1, 0xCB, 0x74, 0x3F, 0xB1, 0x49, 0xE4, 0xF0, +0x75, 0xF0, 0x04, 0xEF, 0x12, 0x4F, 0x61, 0x54, 0xE0, 0x44, 0x09, 0xF0, 0x75, 0xF0, 0x04, 0xEF, +0x12, 0x4D, 0xFC, 0x54, 0xF3, 0xF0, 0x75, 0xF0, 0x04, 0xEF, 0x12, 0x4D, 0xFC, 0x54, 0xFC, 0xF0, +0x75, 0xF0, 0x04, 0xEF, 0x12, 0x4F, 0x61, 0x44, 0x20, 0xF0, 0x75, 0xF0, 0x04, 0xEF, 0x12, 0x4D, +0xFC, 0x54, 0xCF, 0xF0, 0x75, 0xF0, 0x04, 0xEF, 0x12, 0x4D, 0xFC, 0x44, 0x40, 0xF0, 0x75, 0xF0, +0x04, 0xEF, 0x12, 0x4D, 0xFC, 0x54, 0x7F, 0xB1, 0x49, 0xE0, 0xFE, 0x75, 0xF0, 0x10, 0xEF, 0xB1, +0x43, 0xEE, 0xF0, 0x74, 0x91, 0x2F, 0x12, 0x66, 0xE5, 0xE4, 0xF0, 0x0F, 0xEF, 0x64, 0x80, 0x60, +0x02, 0x81, 0x6A, 0x90, 0x04, 0x49, 0x74, 0xF0, 0xF0, 0xA3, 0xE4, 0xF0, 0xA3, 0x74, 0xFF, 0xF0, +0x90, 0x04, 0x33, 0x74, 0x02, 0xF0, 0xA3, 0x74, 0x04, 0xF0, 0xA3, 0x04, 0xF0, 0xA3, 0x04, 0xF0, +0xA3, 0x04, 0xF0, 0x74, 0x11, 0x2F, 0x12, 0x7C, 0x1A, 0x74, 0xFF, 0xF0, 0x22, 0xF0, 0x75, 0xF0, +0x10, 0xE5, 0x51, 0x90, 0x81, 0x00, 0x02, 0x49, 0x54, 0xF0, 0x75, 0xF0, 0x04, 0xEF, 0x90, 0x96, +0x12, 0x02, 0x49, 0x54, 0x90, 0x01, 0xCC, 0xE0, 0x54, 0x0F, 0x90, 0xA3, 0x1D, 0xF0, 0x90, 0xA3, +0x1D, 0xE0, 0xFD, 0x70, 0x02, 0xC1, 0x5F, 0x90, 0x9E, 0xEF, 0xE0, 0xFF, 0x70, 0x06, 0xA3, 0xE0, +0x64, 0x09, 0x60, 0x0A, 0xEF, 0x14, 0xFF, 0x90, 0x9E, 0xF0, 0xE0, 0xB5, 0x07, 0x04, 0x7F, 0x01, +0x80, 0x02, 0x7F, 0x00, 0xEF, 0x60, 0x08, 0x90, 0x01, 0xC1, 0xE0, 0x44, 0x01, 0xF0, 0x22, 0x90, +0xA3, 0x1B, 0xE0, 0x12, 0x85, 0xCC, 0x80, 0x05, 0xC3, 0x33, 0x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AF, 0x22, 0xF5, 0x82, 0xE4, 0x34, 0x94, 0xF5, 0x83, 0x22, 0xF0, 0x75, 0xF0, 0x04, 0xEF, +0x90, 0x96, 0x11, 0x02, 0x49, 0x54, 0x75, 0xF0, 0x03, 0x12, 0x49, 0x54, 0xE0, 0xFE, 0x74, 0x01, +0xA8, 0x06, 0x08, 0x22, 0xB1, 0x54, 0x7F, 0x02, 0x8F, 0x6F, 0x7F, 0x02, 0x12, 0x47, 0xE7, 0x90, +0x9E, 0x92, 0xE0, 0x45, 0x6F, 0xF0, 0x22, 0xC0, 0xE0, 0xC0, 0xF0, 0xC0, 0x83, 0xC0, 0x82, 0xC0, +0xD0, 0x75, 0xD0, 0x00, 0xC0, 0x00, 0xC0, 0x01, 0xC0, 0x02, 0xC0, 0x03, 0xC0, 0x04, 0xC0, 0x05, +0xC0, 0x06, 0xC0, 0x07, 0x12, 0x8A, 0xAB, 0xE5, 0x21, 0x30, 0xE1, 0x03, 0x12, 0x8F, 0x76, 0xE5, +0x21, 0x30, 0xE2, 0x02, 0x51, 0x90, 0xE5, 0x21, 0x30, 0xE5, 0x02, 0x11, 0x88, 0xE5, 0x22, 0x30, +0xE0, 0x03, 0x12, 0x8E, 0x85, 0xE5, 0x23, 0x30, 0xE1, 0x03, 0x12, 0x8D, 0xAD, 0xE5, 0x23, 0x30, +0xE0, 0x03, 0x12, 0x92, 0xCD, 0xE5, 0x23, 0x30, 0xE3, 0x02, 0xF1, 0xD3, 0xE5, 0x24, 0x30, 0xE1, +0x05, 0x7F, 0x04, 0x12, 0x6F, 0xE8, 0xE5, 0x24, 0x30, 0xE4, 0x02, 0x11, 0x9A, 0xE5, 0x24, 0x30, +0xE5, 0x03, 0x12, 0x8E, 0xE1, 0xE5, 0x24, 0x30, 0xE6, 0x03, 0x12, 0x8F, 0x04, 0xD0, 0x07, 0xD0, +0x06, 0xD0, 0x05, 0xD0, 0x04, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0x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, 0x90, 0x01, 0x53, 0xF0, 0x90, 0xA0, 0x54, 0xE0, 0x60, 0x0A, +0x7D, 0x10, 0x7F, 0x03, 0x31, 0x69, 0x51, 0x87, 0x80, 0x16, 0x31, 0xFA, 0x31, 0x09, 0x31, 0x71, +0x12, 0xAC, 0x2B, 0x80, 0x0B, 0x31, 0xFA, 0x31, 0x69, 0x11, 0xD2, 0x31, 0xF4, 0x12, 0x5F, 0x43, +0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x7D, 0x03, 0x7F, 0x02, 0x74, 0x1D, 0x2F, 0xF8, 0xE6, 0x4D, 0x80, +0x9C, 0x7D, 0x02, 0x7F, 0x02, 0x31, 0x7B, 0x7D, 0x01, 0x7F, 0x02, 0x74, 0x15, 0xF1, 0xDA, 0xFE, +0xF6, 0x74, 0x30, 0x80, 0x8C, 0xEF, 0x70, 0x32, 0x7D, 0x78, 0x7F, 0x02, 0x31, 0x7B, 0x7D, 0x02, +0x7F, 0x03, 0x31, 0x7B, 0x7D, 0xC8, 0x7F, 0x02, 0x31, 0x09, 0x12, 0x8C, 0x94, 0xE4, 0xFF, 0x51, +0xA6, 0xEF, 0x70, 0x0A, 0x51, 0x04, 0x54, 0xBF, 0xF0, 0x54, 0x7F, 0xF0, 0x80, 0x07, 0x7D, 0x01, +0x7F, 0x0C, 0x12, 0x58, 0x67, 0x51, 0x0A, 0x02, 0xAF, 0x58, 0x90, 0x01, 0x36, 0x74, 0x78, 0xF0, +0xA3, 0x74, 0x02, 0xF0, 0x7D, 0x78, 0xFF, 0x11, 0xD6, 0x7D, 0x02, 0x7F, 0x03, 0x11, 0xD6, 0x90, +0x06, 0x0A, 0xE0, 0x44, 0x07, 0x12, 0xAE, 0x60, 0xE4, 0xFF, 0x51, 0xA6, 0xBF, 0x01, 0x12, 0x12, +0x8C, 0xBF, 0xF0, 0x90, 0x9F, 0xAA, 0xE0, 0x20, 0xE2, 0x09, 0x7D, 0x01, 0x7F, 0x04, 0x02, 0x58, +0x67, 0x71, 0xDC, 0x22, 0x7D, 0x01, 0x7F, 0x02, 0x01, 0xD6, 0x90, 0x01, 0x53, 0x74, 0x03, 0xF0, +0x7D, 0x10, 0xFF, 0x22, 0x12, 0x4C, 0x32, 0x12, 0x5E, 0x7A, 0x90, 0x9F, 0xA3, 0xE0, 0x54, 0xF7, +0xF0, 0x22, 0x90, 0xA0, 0x52, 0xE0, 0x30, 0xE0, 0x0B, 0x90, 0x01, 0x3B, 0xE0, 0x30, 0xE4, 0x04, +0x31, 0x71, 0x51, 0x87, 0x22, 0x90, 0x9F, 0x9E, 0xE0, 0x30, 0xE0, 0x06, 0x90, 0x9F, 0xA0, 0x74, +0x01, 0xF0, 0x90, 0x9F, 0xA7, 0xE0, 0x60, 0x48, 0x90, 0x9F, 0xA3, 0xE0, 0x30, 0xE0, 0x18, 0x90, +0x9F, 0xBE, 0xE0, 0x04, 0x12, 0x8C, 0x59, 0xCE, 0xC3, 0x13, 0xCE, 0x13, 0xD8, 0xF9, 0xFF, 0x90, +0x9F, 0xDE, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0x90, 0x9F, 0xA4, 0x12, 0xAA, 0xAF, 0x30, 0xE0, 0x09, +0x90, 0x01, 0x3B, 0xE0, 0x30, 0xE4, 0x02, 0x31, 0x71, 0x90, 0xA3, 0x2A, 0xE0, 0x04, 0xF0, 0xE0, +0xC3, 0x94, 0x80, 0x40, 0x0B, 0x90, 0x01, 0x98, 0xE0, 0x54, 0xFE, 0xF0, 0xE0, 0x44, 0x01, 0xF0, +0x7F, 0x01, 0x12, 0x6F, 0xE8, 0x80, 0x8B, 0x90, 0xA0, 0x54, 0xE0, 0x90, 0x05, 0x73, 0xF0, 0x22, +0x90, 0x9F, 0xA7, 0xE0, 0x60, 0x0F, 0x90, 0x06, 0x92, 0xE0, 0x30, 0xE1, 0x03, 0x02, 0xAA, 0x73, +0x51, 0x0A, 0x12, 0x58, 0x4F, 0x22, 0x12, 0xAE, 0x54, 0x12, 0x85, 0x5F, 0xE0, 0xFD, 0x7C, 0x00, +0x12, 0x85, 0xCD, 0x80, 0x05, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, 0xF9, 0xFF, 0xEE, 0x5C, 0xFE, +0xEF, 0x5D, 0x4E, 0x7F, 0x00, 0x60, 0x02, 0x7F, 0x01, 0x22, 0xF1, 0xCC, 0x91, 0x1C, 0xFF, 0xF5, +0x55, 0x12, 0x06, 0x89, 0xFE, 0xC3, 0x13, 0x30, 0xE0, 0x07, 0x12, 0x4F, 0x49, 0xF5, 0x56, 0x80, +0x02, 0x8F, 0x56, 0x85, 0x55, 0x54, 0xE5, 0x54, 0xD3, 0x95, 0x56, 0x50, 0x20, 0x12, 0xAE, 0xE3, +0x54, 0x01, 0xFD, 0xAF, 0x54, 0x12, 0x85, 0x23, 0xAF, 0x54, 0x51, 0xA6, 0xEF, 0xAF, 0x54, 0x70, +0x05, 0x12, 0x87, 0xD4, 0x80, 0x03, 0x12, 0x87, 0xCC, 0x05, 0x54, 0x80, 0xD9, 0xE5, 0x55, 0x70, +0x0E, 0xFF, 0x51, 0xA6, 0xEF, 0x70, 0x08, 0x51, 0x04, 0x54, 0xBF, 0xF0, 0x54, 0x7F, 0xF0, 0x22, +0x12, 0x8C, 0x5A, 0xCE, 0xC3, 0x13, 0xCE, 0x13, 0xD8, 0xF9, 0xFF, 0x90, 0xA2, 0x01, 0xEE, 0xF0, +0xA3, 0xEF, 0xF0, 0x12, 0x8C, 0x45, 0x60, 0x02, 0x61, 0xD0, 0x90, 0x9F, 0xA7, 0xE0, 0x70, 0x02, +0x61, 0xD0, 0x71, 0xE5, 0x64, 0x01, 0x70, 0x22, 0x90, 0x06, 0xAB, 0xE0, 0x90, 0x9F, 0xAE, 0xF0, +0x90, 0x06, 0xAA, 0xE0, 0x90, 0x9F, 0xAD, 0xF0, 0xA3, 0xE0, 0xFF, 0x70, 0x08, 0x90, 0x9F, 0xAD, +0xE0, 0xFE, 0xFF, 0x80, 0x00, 0x90, 0x9F, 0xAE, 0xEF, 0xF0, 0x12, 0xAB, 0x02, 0x71, 0xDC, 0xE4, +0x90, 0x9F, 0xB0, 0x12, 0xAE, 0x60, 0x12, 0x8C, 0x94, 0x12, 0x8D, 0x22, 0x54, 0xEF, 0x71, 0xE4, +0x24, 0xFD, 0x50, 0x02, 0x80, 0x0F, 0x90, 0x9F, 0x9E, 0xE0, 0x30, 0xE0, 0x05, 0x12, 0x90, 0x44, +0x80, 0x03, 0x12, 0x8F, 0xF7, 0x12, 0x8E, 0xCD, 0x54, 0x1F, 0x30, 0xE0, 0x33, 0xEF, 0xC4, 0x13, +0x13, 0x54, 0x03, 0x20, 0xE0, 0x2A, 0x90, 0x9F, 0xAD, 0xE0, 0xFF, 0xA3, 0xE0, 0x6F, 0x70, 0x20, +0x90, 0x9F, 0xA4, 0xE0, 0x44, 0x40, 0xF0, 0x12, 0x8E, 0xC5, 0xF0, 0x90, 0x01, 0x3F, 0x74, 0x10, +0xF0, 0xFD, 0x7F, 0x03, 0x31, 0x69, 0x31, 0x77, 0xF1, 0xD4, 0x90, 0x9F, 0xAE, 0xE0, 0x14, 0xF0, +0x90, 0x9F, 0x9E, 0xE0, 0xC3, 0x13, 0x20, 0xE0, 0x02, 0x71, 0xDC, 0x22, 0x90, 0x9F, 0xA4, 0xE0, +0x44, 0x04, 0xF0, 0x22, 0xF0, 0x90, 0x9F, 0xA5, 0xE0, 0xFF, 0xC4, 0x54, 0x0F, 0x22, 0x90, 0xA1, +0x46, 0x12, 0x49, 0x69, 0x11, 0xE2, 0x90, 0x9F, 0xA7, 0xE0, 0xFF, 0x31, 0x85, 0x90, 0x9F, 0xA7, +0xE0, 0x60, 0x12, 0x90, 0xA1, 0x46, 0x12, 0x49, 0x60, 0x91, 0x1C, 0x54, 0x0F, 0xFF, 0x12, 0x4F, +0x49, 0xFD, 0x12, 0xAA, 0xB6, 0x22, 0xAB, 0x51, 0xAA, 0x52, 0xA9, 0x53, 0x90, 0x00, 0x01, 0x02, +0x06, 0xA2, 0x12, 0x84, 0x48, 0x90, 0xA0, 0x52, 0x12, 0xAD, 0xB0, 0xF0, 0x91, 0x1C, 0x90, 0xA0, +0x53, 0x12, 0x4F, 0x48, 0x90, 0xA0, 0x54, 0xF0, 0x90, 0xA0, 0x53, 0xE0, 0x90, 0xA0, 0x55, 0xF0, +0x90, 0xA0, 0x52, 0xE0, 0x54, 0x01, 0xFF, 0x21, 0x1C, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, +0xF1, 0xCC, 0x12, 0x06, 0x89, 0xFF, 0x90, 0x9F, 0x9D, 0xF0, 0xBF, 0x01, 0x08, 0x91, 0x1C, 0x64, +0x01, 0x60, 0x19, 0x80, 0x14, 0x91, 0x16, 0x64, 0x01, 0x60, 0x11, 0x90, 0x9F, 0x9E, 0xE0, 0x20, +0xE0, 0x07, 0xE4, 0xFF, 0x12, 0x5C, 0x77, 0x80, 0x03, 0x12, 0x8D, 0xF4, 0xD0, 0xD0, 0x92, 0xAF, +0x22, 0x90, 0xA1, 0x40, 0x12, 0x49, 0x69, 0x90, 0xA1, 0x3F, 0xEF, 0xF0, 0x12, 0x49, 0x72, 0x74, +0xC6, 0x00, 0x74, 0xCF, 0x01, 0x74, 0xD7, 0x02, 0x74, 0xDF, 0x10, 0x74, 0xE7, 0x11, 0x74, 0xF0, +0x12, 0x74, 0xF9, 0x14, 0x75, 0x02, 0x20, 0x75, 0x0B, 0x21, 0x75, 0x14, 0x23, 0x75, 0x1D, 0x24, +0x75, 0x26, 0x25, 0x75, 0x2F, 0x27, 0x75, 0x37, 0x28, 0x75, 0x40, 0x40, 0x75, 0x49, 0x42, 0x75, +0x52, 0x45, 0x00, 0x00, 0x75, 0x5A, 0x90, 0xA1, 0x40, 0x12, 0x49, 0x60, 0x02, 0x83, 0x11, 0x90, +0xA1, 0x40, 0x12, 0x49, 0x60, 0x41, 0xCA, 0x90, 0xA1, 0x40, 0x12, 0x49, 0x60, 0x81, 0x49, 0x90, +0xA1, 0x40, 0x12, 0x49, 0x60, 0xE1, 0x31, 0x90, 0xA1, 0x40, 0x12, 0x49, 0x60, 0x02, 0x56, 0x52, +0x90, 0xA1, 0x40, 0x12, 0x49, 0x60, 0x02, 0x83, 0x5D, 0x90, 0xA1, 0x40, 0x12, 0x49, 0x60, 0x02, +0x83, 0x71, 0x90, 0xA1, 0x40, 0x12, 0x49, 0x60, 0x02, 0x66, 0xF5, 0x90, 0xA1, 0x40, 0x12, 0x49, +0x60, 0x02, 0x83, 0x80, 0x90, 0xA1, 0x40, 0x12, 0x49, 0x60, 0x02, 0x83, 0xBC, 0x90, 0xA1, 0x40, +0x12, 0x49, 0x60, 0x02, 0x5A, 0xF5, 0x90, 0xA1, 0x40, 0x12, 0x49, 0x60, 0x02, 0x83, 0xC4, 0x90, +0xA1, 0x40, 0x12, 0x49, 0x60, 0x81, 0x22, 0x90, 0xA1, 0x40, 0x12, 0x49, 0x60, 0x02, 0x83, 0xCC, +0x90, 0xA1, 0x40, 0x12, 0x49, 0x60, 0x02, 0x4E, 0x03, 0x90, 0xA1, 0x40, 0x12, 0x49, 0x60, 0x02, +0x66, 0x44, 0x90, 0xA1, 0x40, 0x12, 0x49, 0x60, 0x80, 0x10, 0x90, 0x01, 0xC0, 0xE0, 0x44, 0x01, +0xF0, 0x90, 0xA1, 0x3F, 0xE0, 0x90, 0x01, 0xC2, 0xF0, 0x22, 0x91, 0x1C, 0x90, 0xA0, 0x8D, 0x12, +0x4F, 0x48, 0x90, 0xA0, 0x8E, 0xF0, 0xB1, 0xB1, 0x7F, 0x01, 0x90, 0xA1, 0x43, 0x74, 0x11, 0xF0, +0x90, 0xA1, 0x51, 0x74, 0x01, 0xF0, 0x90, 0xA1, 0x45, 0xEF, 0xF0, 0x7B, 0x01, 0x7A, 0xA1, 0x79, +0x43, 0x12, 0x7B, 0x25, 0x7F, 0x04, 0x90, 0xA3, 0x28, 0xEF, 0xF0, 0x7F, 0x02, 0x12, 0x47, 0xE7, +0x90, 0x9E, 0x92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, 0xD6, 0x90, 0xA2, 0xB1, +0x12, 0x08, 0x79, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x80, 0x00, 0x00, +0x00, 0x12, 0x7E, 0x8E, 0x90, 0xAA, 0xB9, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x80, +0xD1, 0xDF, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x84, 0xD1, 0xDF, 0x12, 0x08, 0x79, +0x00, 0x00, 0x00, 0x00, 0x7F, 0x88, 0xD1, 0xDF, 0x12, 0x08, 0x79, 0x3C, 0x00, 0x00, 0x00, 0x7F, +0x8C, 0xD1, 0xDF, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xB8, 0xD1, 0xDF, 0x12, 0x08, +0x79, 0x00, 0x00, 0x00, 0x80, 0x7F, 0x90, 0xD1, 0xDF, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, +0x7F, 0x94, 0xD1, 0xDF, 0x12, 0x08, 0x79, 0x20, 0x04, 0x00, 0x00, 0x7F, 0xC4, 0xD1, 0xDF, 0x12, +0x08, 0x79, 0x20, 0x00, 0x00, 0x00, 0x7F, 0xC8, 0x7E, 0x0C, 0x02, 0x38, 0x07, 0x7F, 0xB0, 0x7E, +0x0C, 0x12, 0x38, 0x07, 0x90, 0xAA, 0xB9, 0x22, 0xE4, 0xFF, 0xF1, 0x23, 0x90, 0xA1, 0xB6, 0x02, +0x49, 0x60, 0xF1, 0xC2, 0x12, 0x08, 0x79, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, +0x79, 0x00, 0x00, 0x00, 0x00, 0x12, 0x7E, 0x8E, 0x7D, 0x65, 0xD1, 0xE8, 0x12, 0x48, 0xFE, 0x7D, +0x8F, 0xD1, 0xE8, 0x90, 0x00, 0x04, 0x12, 0x49, 0x18, 0xE4, 0xFD, 0xD1, 0xE9, 0x90, 0x00, 0x08, +0x02, 0x49, 0x18, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xF1, 0xE4, 0xD0, 0xD0, 0x92, 0xAF, +0x22, 0x90, 0x04, 0x24, 0x12, 0x83, 0x54, 0x90, 0xA0, 0x6F, 0xF0, 0x91, 0x1C, 0x25, 0x51, 0x90, +0xA0, 0x7D, 0x12, 0x4F, 0x48, 0x25, 0x51, 0x90, 0xA0, 0x8B, 0xF0, 0x22, 0x90, 0xA1, 0xB6, 0xEF, +0xF0, 0xA3, 0xF1, 0xC5, 0x12, 0x08, 0x79, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, +0x79, 0x00, 0x00, 0x00, 0x00, 0x12, 0x7E, 0x8E, 0xF1, 0xBC, 0x12, 0x48, 0xAE, 0x12, 0xAD, 0x3F, +0x7D, 0x65, 0xF1, 0xBA, 0x90, 0x00, 0x04, 0x12, 0xAD, 0x3C, 0x7D, 0x8F, 0xF1, 0xBA, 0x90, 0x00, +0x08, 0x12, 0xAD, 0x3C, 0xE4, 0xFD, 0x12, 0xAC, 0xC1, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, +0x90, 0xA1, 0xB6, 0xE0, 0xFF, 0x7D, 0xEF, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xC0, 0x07, +0xC0, 0x05, 0x90, 0xA1, 0xFA, 0x12, 0x49, 0x3C, 0x90, 0xAA, 0x9C, 0x12, 0x08, 0x6D, 0xD0, 0x05, +0xD0, 0x07, 0x12, 0x32, 0x34, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xF1, 0x97, 0x90, 0xA1, 0xB7, 0x02, +0x49, 0x60, 0x90, 0xA1, 0xB6, 0x12, 0x49, 0x69, 0x90, 0xA2, 0xB1, 0x22, 0x8B, 0x51, 0x8A, 0x52, +0x89, 0x53, 0x22, 0x22, 0x7D, 0x02, 0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x16, +0x11, 0xFB, 0x11, 0x58, 0xD3, 0x90, 0xA3, 0x17, 0xE0, 0x94, 0x32, 0x90, 0xA3, 0x16, 0xE0, 0x94, +0x00, 0x40, 0xC1, 0x90, 0x01, 0xC6, 0xE0, 0x30, 0xE0, 0xBA, 0x22, 0xE4, 0x90, 0xA1, 0x3B, 0xF0, +0xA3, 0xF0, 0x31, 0x02, 0xEF, 0x64, 0x01, 0x60, 0x3B, 0xC3, 0x90, 0xA1, 0x3C, 0xE0, 0x94, 0x88, +0x90, 0xA1, 0x3B, 0xE0, 0x94, 0x13, 0x40, 0x0F, 0x90, 0x01, 0xC1, 0xE0, 0x44, 0x10, 0xF0, 0x90, +0x01, 0xC7, 0x74, 0xFD, 0xF0, 0x80, 0x1D, 0x90, 0xA1, 0x3B, 0x11, 0xFB, 0x11, 0x58, 0xD3, 0x90, +0xA1, 0x3C, 0xE0, 0x94, 0x32, 0x90, 0xA1, 0x3B, 0xE0, 0x94, 0x00, 0x40, 0xC5, 0x90, 0x01, 0xC6, +0xE0, 0x30, 0xE3, 0xBE, 0x90, 0x01, 0xC7, 0x74, 0xFE, 0xF0, 0x22, 0xE4, 0x75, 0xF0, 0x01, 0x02, +0x08, 0xD6, 0x90, 0x01, 0x9A, 0xE0, 0x54, 0xC0, 0x44, 0x0B, 0x31, 0x5B, 0x90, 0x01, 0x98, 0xE0, +0x54, 0xC0, 0x7F, 0x00, 0xB4, 0x40, 0x02, 0x7F, 0x01, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, +0xD0, 0x90, 0xA2, 0xE7, 0xEE, 0xF0, 0xA3, 0x31, 0x63, 0x90, 0xA2, 0xE7, 0x71, 0x10, 0xE0, 0x60, +0x23, 0xC3, 0x90, 0xA2, 0xEA, 0xE0, 0x94, 0xE8, 0x90, 0xA2, 0xE9, 0xE0, 0x94, 0x03, 0x40, 0x0B, +0x90, 0x01, 0xC0, 0xE0, 0x44, 0x80, 0xF0, 0x7F, 0x00, 0x80,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 0x90, 0xA2, 0xEC, 0x12, +0x49, 0x60, 0x8B, 0x40, 0x8A, 0x41, 0x89, 0x42, 0x75, 0x43, 0x02, 0xD0, 0x01, 0xD0, 0x02, 0xD0, +0x03, 0x12, 0x34, 0x62, 0x90, 0xA2, 0xEB, 0xE0, 0x24, 0x02, 0xF9, 0xE4, 0x34, 0xFB, 0xFA, 0x7B, +0x01, 0xC0, 0x03, 0xC0, 0x02, 0xC0, 0x01, 0xA3, 0x12, 0x49, 0x60, 0xE9, 0x24, 0x02, 0xF9, 0xE4, +0x3A, 0x8B, 0x40, 0xF5, 0x41, 0x89, 0x42, 0x90, 0xA2, 0xEC, 0x71, 0x07, 0xF5, 0x43, 0xD0, 0x01, +0xD0, 0x02, 0xD0, 0x03, 0x02, 0x34, 0x62, 0x12, 0x49, 0x60, 0x90, 0x00, 0x0E, 0x02, 0x06, 0xA2, +0xE0, 0xFE, 0xA3, 0xE0, 0xF5, 0x82, 0x8E, 0x83, 0x22, 0x75, 0xF0, 0x0F, 0xA4, 0x24, 0xF1, 0xF9, +0x74, 0x9E, 0x35, 0xF0, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x9F, 0x87, 0xE0, +0xFF, 0x70, 0x06, 0xA3, 0xE0, 0x64, 0x09, 0x60, 0x0A, 0xEF, 0x14, 0xFF, 0x90, 0x9F, 0x88, 0xE0, +0xB5, 0x07, 0x04, 0x7F, 0x01, 0x80, 0x02, 0x7F, 0x00, 0xEF, 0x60, 0x09, 0x90, 0x01, 0xC1, 0xE0, +0x44, 0x02, 0xF0, 0x80, 0x29, 0xC0, 0x01, 0x90, 0x9F, 0x88, 0xE0, 0x71, 0x19, 0xA8, 0x01, 0xFC, +0x7D, 0x01, 0xD0, 0x01, 0x7E, 0x00, 0x7F, 0x0F, 0x12, 0x06, 0x63, 0x90, 0x9F, 0x88, 0x12, 0x84, +0xE4, 0xB4, 0x0A, 0x02, 0x7F, 0x01, 0xEF, 0x60,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F, +0x01, 0x06, 0x90, 0xA1, 0x43, 0xE0, 0xA3, 0xF0, 0x7B, 0x01, 0x7A, 0xA1, 0x79, 0x43, 0x7F, 0xF6, +0x7E, 0x01, 0x12, 0x33, 0xFD, 0xBF, 0x01, 0x08, 0x90, 0xA1, 0x43, 0xE0, 0x90, 0xA1, 0x45, 0xF0, +0x7B, 0x01, 0x7A, 0xA1, 0x79, 0x43, 0x7F, 0xF4, 0x7E, 0x01, 0x12, 0x33, 0xFD, 0xBF, 0x01, 0x08, +0x90, 0xA1, 0x43, 0xE0, 0x90, 0xA1, 0x46, 0xF0, 0x7B, 0x01, 0x7A, 0xA1, 0x79, 0x43, 0x7F, 0xF3, +0x7E, 0x01, 0x12, 0x33, 0xFD, 0xBF, 0x01, 0x08, 0x90, 0xA1, 0x43, 0xE0, 0x90, 0xA1, 0x47, 0xF0, +0x7B, 0x01, 0x7A, 0xA1, 0x79, 0x43, 0x7F, 0xF2, 0x7E, 0x01, 0x12, 0x33, 0xFD, 0xBF, 0x01, 0x08, +0x90, 0xA1, 0x43, 0xE0, 0x90, 0xA1, 0x48, 0xF0, 0x90, 0xA1, 0x44, 0x12, 0xAF, 0x23, 0xA3, 0xE0, +0x90, 0xA1, 0x4C, 0xF0, 0x90, 0xA1, 0x48, 0xE0, 0x90, 0xA1, 0x4D, 0xF0, 0x61, 0x83, 0xEF, 0xF0, +0xA3, 0xED, 0xF0, 0xA3, 0x22, 0x90, 0xA2, 0xD6, 0x91, 0xAE, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, +0x00, 0x7F, 0x34, 0x7E, 0x08, 0x12, 0x37, 0xBC, 0x90, 0xA2, 0xD8, 0x12, 0x08, 0x6D, 0x90, 0xA2, +0xD6, 0xE0, 0x14, 0x60, 0x5E, 0x14, 0x70, 0x02, 0xA1, 0xE9, 0x24, 0x02, 0x60, 0x02, 0xC1, 0x6F, +0x90, 0xA2, 0xB1, 0x12, 0x08, 0x79, 0x00, 0x30, 0x03, 0xC3, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, +0x00, 0x30, 0x02, 0x00, 0xD1, 0x84, 0x12, 0x08, 0x79, 0x40, 0x00, 0x00, 0x00, 0x90, 0xA2, 0xB5, +0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xC4, 0xD1, 0x86, 0x12, 0x08, 0x79, 0x00, 0x1C, +0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x00, 0x10, 0x00, 0x00, 0x7F, 0x64, 0xD1, 0x86, +0x12, 0x08, 0x79, 0x03, 0xC0, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x02, 0x00, 0x00, +0x00, 0xC1, 0x52, 0x90, 0xA2, 0xB1, 0x12, 0x08, 0x79, 0x00, 0x30, 0x03, 0xC3, 0x90, 0xA2, 0xB5, +0x12, 0x08, 0x79, 0x00, 0x30, 0x02, 0x01, 0xD1, 0x84, 0x12, 0x08, 0x79, 0x40, 0x00, 0x00, 0x00, +0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xC4, 0xD1, 0x86, 0x12, 0x08, +0x79, 0x00, 0x00, 0x00, 0x3C, 0xD1, 0x70, 0x12, 0x08, 0x79, 0xF0, 0x00, 0x00, 0x00, 0x12, 0x9F, +0x77, 0x7F, 0x38, 0xD1, 0x86, 0x12, 0x08, 0x79, 0x00, 0x1C, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, +0x08, 0x79, 0x00, 0x08, 0x00, 0x00, 0x12, 0xAD, 0x17, 0x60, 0x13, 0x12, 0x08, 0x79, 0x03, 0xC0, +0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x01, 0x80, 0x00, 0x00, 0x80, 0x11, 0x12, 0x08, +0x79, 0x03, 0xC0, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x02, 0x00, 0x00, 0x00, 0x7F, +0x48, 0x7E, 0x08, 0xD1, 0x92, 0x90, 0xA2, 0xD7, 0xE0, 0x90, 0xA2, 0xB1, 0xB4, 0x01, 0x13, 0x12, +0x08, 0x79, 0x00, 0x00, 0x00, 0x10, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x10, +0x80, 0x11, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x10, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x00, +0x00, 0x00, 0x00, 0x7F, 0x00, 0x7E, 0x0A, 0xC1, 0x6D, 0x90, 0xA2, 0xB1, 0x12, 0x08, 0x79, 0x00, +0x30, 0x03, 0xC3, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x00, 0x30, 0x02, 0x02, 0xD1, 0x84, 0x12, +0x08, 0x79, 0x40, 0x00, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x40, 0x00, 0x00, 0x00, +0x7F, 0xC4, 0xD1, 0x86, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x3C, 0xD1, 0x70, 0x12, 0x08, 0x79, +0xF0, 0x00, 0x00, 0x00, 0x12, 0x9F, 0x77, 0x7F, 0x38, 0xD1, 0x86, 0x12, 0x08, 0x79, 0x00, 0x1C, +0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x00, 0x08, 0x00, 0x00, 0x12, 0xAD, 0x17, 0x60, +0x17, 0x12, 0x08, 0x79, 0x03, 0xC0, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x01, 0x40, +0x00, 0x00, 0x7F, 0x48, 0x7E, 0x08, 0x80, 0x15, 0x12, 0x08, 0x79, 0x03, 0xC0, 0x00, 0x00, 0x90, +0xA2, 0xB5, 0x12, 0x08, 0x79, 0x01, 0xC0, 0x00, 0x00, 0x7F, 0x48, 0x7E, 0x08, 0xD1, 0x92, 0x22, +0x90, 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 0x70, 0x00, 0x7F, 0xB0, 0x7E, +0x0C, 0xD1, 0x88, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0xF0, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, +0x00, 0x00, 0x00, 0x70, 0x7F, 0xB0, 0x7E, 0x0C, 0xD1, 0x88, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, +0x0E, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x08, 0x7F, 0x30, 0xD1, 0x86, 0x12, +0x08, 0x79, 0x00, 0x00, 0x00, 0x03, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x01, +0x7F, 0x34, 0xD1, 0x86, 0x12, 0x08, 0x79, 0x00, 0x00, 0x0F, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, +0x79, 0x00, 0x00, 0x00, 0x00, 0x12, 0x82, 0xEB, 0x12, 0x08, 0x79, 0x30, 0x00, 0x00, 0x00, 0x90, +0xA2, 0xB5, 0x12, 0x08, 0x79, 0x30, 0x00, 0x00, 0x00, 0x12, 0x83, 0x00, 0x90, 0x04, 0x54, 0xE0, +0x54, 0x7F, 0x02, 0x83, 0x07, 0x90, 0xA3, 0x18, 0xE0, 0x64, 0x01, 0x60, 0x03, 0x02, 0x80, 0x57, +0x90, 0xA2, 0xB1, 0x12, 0x08, 0x79, 0x00, 0x00, 0xF0, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, +0x00, 0x00, 0x50, 0x00, 0x7F, 0xB0, 0x7E, 0x0C, 0xD1, 0x88, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, +0xF0, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x40, 0x7F, 0xB0, 0x7E, 0x0C, 0xD1, +0x92, 0x90, 0x04, 0x54, 0xE0, 0x44, 0x80, 0x12, 0x83, 0x07, 0x90, 0xA2, 0xB1, 0x12, 0x08, 0x79, +0x30, 0x00, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0x74, 0x08, +0xFF, 0xFE, 0x12, 0x7E, 0x88, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x0E, 0x90, 0xA2, 0xB5, 0x12, +0x08, 0x79, 0x00, 0x00, 0x00, 0x06, 0x7F, 0x30, 0x12, 0x7E, 0x86, 0x12, 0x08, 0x79, 0x00, 0x00, +0x00, 0x03, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x02, 0x7F, 0x34, 0x12, 0x7E, +0x86, 0x12, 0x08, 0x79, 0x00, 0x00, 0x0F, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x00, 0x00, +0x01, 0x00, 0x51, 0xEB, 0x12, 0x08, 0x79, 0x30, 0x00, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, +0x79, 0x20, 0x00, 0x00, 0x00, 0x71, 0x00, 0x22, 0x90, 0xA3, 0x2B, 0xED, 0xF0, 0xEF, 0x60, 0x02, +0x21, 0x30, 0xE0, 0x24, 0xFD, 0x50, 0x0A, 0x60, 0x1E, 0x14, 0x60, 0x31, 0x14, 0x60, 0x73, 0x41, +0xD4, 0x90, 0xAA, 0xB9, 0x12, 0x08, 0x79, 0x77, 0x77, 0x77, 0x77, 0x12, 0x76, 0xDD, 0x12, 0x08, +0x79, 0x77, 0x77, 0x77, 0x77, 0x21, 0xAA, 0x90, 0xAA, 0xB9, 0x12, 0x08, 0x79, 0x54, 0x33, 0x77, +0x70, 0x12, 0x76, 0xDD, 0x12, 0x08, 0x79, 0x54, 0x33, 0x77, 0x70, 0x41, 0x34, 0x90, 0xAA, 0xB9, +0x12, 0x08, 0x79, 0x77, 0x77, 0x77, 0x77, 0x12, 0x76, 0xDD, 0x12, 0x08, 0x79, 0x77, 0x77, 0x77, +0x77, 0x7F, 0xB0, 0x7E, 0x0E, 0x51, 0xD9, 0x12, 0x08, 0x79, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA2, +0xB5, 0x12, 0x08, 0x79, 0x00, 0x10, 0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0C, 0x12, 0x7E, 0x88, 0x12, +0x08, 0x79, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x00, 0x10, 0x00, 0x00, +0x41, 0xCD, 0x90, 0xA2, 0xB1, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0xFF, 0x90, 0xA2, 0xB5, 0x12, +0x08, 0x79, 0x00, 0x00, 0x00, 0x77, 0x51, 0xE0, 0x12, 0x08, 0x79, 0x77, 0x77, 0x77, 0x77, 0x7F, +0xB0, 0x7E, 0x0E, 0x51, 0xD9, 0x12, 0x08, 0x79, 0x01, 0x00, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, +0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0C, 0x12, 0x7E, 0x88, 0x12, 0x08, 0x79, +0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0x41, 0xCD, +0x90, 0xA3, 0x2B, 0xE0, 0x14, 0x60, 0x5F, 0x14, 0x70, 0x02, 0x21, 0xDB, 0x14, 0x70, 0x02, 0x41, +0x20, 0x14, 0x70, 0x02, 0x21, 0xDB, 0x14, 0x70, 0x02, 0x41, 0x81, 0x24, 0x05, 0x60, 0x02, 0x41, +0xD4, 0x90, 0xAA, 0xB9, 0x12, 0x08, 0x79, 0x77, 0x33, 0x77, 0x17, 0x12, 0x76, 0xDD, 0x12, 0x08, +0x79, 0x77, 0x33, 0x77, 0x17, 0x7F, 0xB0, 0x7E, 0x0E, 0x51, 0xD9, 0x12, 0x08, 0x79, 0x3F, 0xF0, +0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x01, 0x00, 0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0C, +0x12, 0x7E, 0x88, 0x12, 0x08, 0x79, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, +0x01, 0x00, 0x00, 0x00, 0x41, 0xCD, 0x90, 0xAA, 0xB9, 0x12, 0x08, 0x79, 0x77, 0x33, 0x77, 0x17, +0x12, 0x76, 0xDD, 0x12, 0x08, 0x79, 0x77, 0x33, 0x77, 0x17, 0x7F, 0xB0, 0x7E, 0x0E, 0x51, 0xD9, +0x12, 0x08, 0x79, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, +0x00, 0x7F, 0xB4, 0x7E, 0x0C, 0x12, 0x7E, 0x88, 0x12, 0x08, 0x79, 0x3F, 0xF0, 0x00, 0x00, 0x90, +0xA2, 0xB5, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0x41, 0xCD, 0x90, 0xAA, 0xB9, 0x12, 0x08, +0x79, 0x77, 0x33, 0x77, 0x77, 0x12, 0x76, 0xDD, 0x12, 0x08, 0x79, 0x77, 0x33, 0x77, 0x77, 0x7F, +0xB0, 0x7E, 0x0E, 0x51, 0xD9, 0x12, 0x08, 0x79, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, +0x08, 0x79, 0x01, 0x00, 0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0C, 0x12, 0x7E, 0x88, 0x12, 0x08, 0x79, +0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x01, 0x00, 0x00, 0x00, 0x41, 0xCD, +0x90, 0xAA, 0xB9, 0x12, 0x08, 0x79, 0x54, 0x33, 0x77, 0x17, 0x12, 0x76, 0xDD, 0x12, 0x08, 0x79, +0x54, 0x33, 0x77, 0x17, 0x7F, 0xB0, 0x7E, 0x0E, 0x51, 0xD9, 0x12, 0x08, 0x79, 0x3F, 0xF0, 0x00, +0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x01, 0x00, 0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0C, 0x12, +0x7E, 0x88, 0x12, 0x08, 0x79, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x01, +0x00, 0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0E, 0x12, 0x7E, 0x88, 0x12, 0x08, 0x79, 0x00, 0x00, 0x03, +0x03, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x01, 0x7F, 0x00, 0x7E, 0x09, 0x80, +0x50, 0x90, 0xA2, 0xB1, 0x12, 0x08, 0x79, 0x00, 0xFF, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, +0x79, 0x00, 0x33, 0x00, 0x00, 0x51, 0xE0, 0x12, 0x08, 0x79, 0x77, 0x33, 0x77, 0x77, 0x7F, 0xB0, +0x7E, 0x0E, 0x51, 0xD9, 0x12, 0x08, 0x79, 0x01, 0x00, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, +0x79, 0x01, 0x00, 0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0C, 0x12, 0x7E, 0x88, 0x12, 0x08, 0x79, 0x3F, +0xF0, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x01, 0x00, 0x00, 0x00, 0x7F, 0xB4, 0x7E, +0x0E, 0x12, 0x7E, 0x92, 0x22, 0x7F, 0x84, 0x7E, 0x09, 0x12, 0x38, 0x07, 0x90, 0xA2, 0xB1, 0x22, +0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x7E, 0x92, 0x90, 0xAA, 0xB9, 0x22, 0x7F, 0x1C, 0x7E, 0x0C, 0x12, +0x7E, 0x92, 0x90, 0xA3, 0x18, 0xE0, 0xFF, 0xA3, 0xE0, 0xFD, 0x11, 0x58, 0x90, 0xA2, 0xB1, 0x22, +0x74, 0x08, 0xFF, 0xFE, 0x02, 0x7E, 0x92, 0x90, 0xA3, 0x1A, 0xF0, 0xE0, 0x90, 0x04, 0x54, 0xF0, +0x22, 0x90, 0x02, 0x09, 0x71, 0x54, 0x90, 0x9E, 0x98, 0xF0, 0x12, 0x74, 0x1C, 0x25, 0x51, 0x90, +0x9E, 0x99, 0x12, 0x4F, 0x48, 0x25, 0x51, 0x90, 0x9E, 0x9A, 0x12, 0x57, 0x1A, 0x25, 0x51, 0x90, +0x9E, 0x9B, 0xF0, 0x90, 0x00, 0x04, 0x12, 0x06, 0xA2, 0x25, 0x51, 0x90, 0x9E, 0x9C, 0xF0, 0x90, +0x00, 0x05, 0x12, 0x06, 0xA2, 0x25, 0x51, 0x90, 0x9E, 0x9D, 0x12, 0x67, 0xCE, 0x25, 0x51, 0x90, +0x9E, 0x9E, 0xF0, 0x22, 0xE0, 0xF5, 0x51, 0x12, 0x06, 0x89, 0x25, 0x51, 0x22, 0x12, 0x06, 0x89, +0xFF, 0x90, 0x9F, 0x8B, 0xF0, 0xBF, 0x01, 0x08, 0x12, 0x7C, 0x22, 0xE4, 0x90, 0x9F, 0x8B, 0xF0, +0x22, 0x12, 0x06, 0x89, 0x54, 0x01, 0xFF, 0x90, 0xA1, 0x3A, 0xE0, 0x54, 0xFE, 0x4F, 0xF0, 0x22, +0x12, 0x4F, 0x49, 0xFF, 0x30, 0xE0, 0x1F, 0x12, 0x06, 0x89, 0x90, 0xA0, 0x4B, 0xF0, 0x12, 0x74, +0x1C, 0x90, 0xA0, 0x4C, 0xF0, 0xEF, 0x54, 0xFE, 0xFF, 0xA3, 0xE0, 0x54, 0x01, 0x4F, 0x12, 0x57, +0x1A, 0x90, 0xA0, 0x4E, 0xF0, 0x22, 0x90, 0xA0, 0x4B, 0x74, 0x02, 0xF0, 0xA3, 0x74, 0x0A, 0xF0, +0xA3, 0xE0, 0x54, 0x01, 0x44, 0x1E, 0xF0, 0xA3, 0x74, 0x05, 0xF0, 0x22, 0x12, 0x06, 0x89, 0x90, +0x9F, 0xB2, 0xF0, 0x22, 0x12, 0x06, 0x89, 0x90, 0xA0, 0x51, 0xF0, 0x22, 0x91, 0x48, 0x90, 0xA0, +0x56, 0xE0, 0x54, 0xFE, 0x4E, 0xF0, 0xEF, 0x54, 0x02, 0x33, 0x33, 0x33, 0x54, 0xF8, 0xFF, 0x90, +0x9F, 0xA3, 0xE0, 0x54, 0xEF, 0x4F, 0xF0, 0x90, 0xA0, 0x56, 0xE0, 0x54, 0x01, 0xFF, 0xEF, 0x64, +0x01, 0x70, 0x21, 0x91, 0x69, 0x90, 0x01, 0x38, 0x12, 0x4F, 0x3E, 0x90, 0x01, 0x30, 0x12, 0x4F, +0x3F, 0x90, 0x01, 0x30, 0x74, 0x10, 0xF0, 0x90, 0x01, 0x39, 0x74, 0x01, 0xF0, 0x90, 0x00, 0x53, +0x74, 0x80, 0xF0, 0x22, 0x91, 0x50, 0x90, 0xA0, 0x5C, 0xE0, 0x90, 0x01, 0x31, 0xF0, 0x90, 0xA0, +0x5D, 0xE0, 0x90, 0x01, 0x32, 0xF0, 0x90, 0xA0, 0x5E, 0xE0, 0x90, 0x01, 0x33, 0xF0, 0x90, 0xA0, +0x57, 0xE0, 0x90, 0x01, 0x38, 0xF0, 0x90, 0xA0, 0x5A, 0xE0, 0x90, 0x01, 0x3B, 0x12, 0x70, 0xCB, +0x7F, 0x01, 0x12, 0x5A, 0x33, 0x02, 0x5D, 0x9F, 0x12, 0x06, 0x89, 0xFF, 0x54, 0x01, 0xFE, 0x22, +0x90, 0xA0, 0x5B, 0xE0, 0x90, 0x01, 0x30, 0xF0, 0x90, 0xA0, 0x58, 0xE0, 0x90, 0x01, 0x39, 0xF0, +0x90, 0xA0, 0x59, 0xE0, 0x90, 0x01, 0x3A, 0xF0, 0x22, 0x7D, 0x2D, 0x12, 0x52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 0x82, 0xE4, 0x34, 0x92, 0x12, 0x95, 0xAF, 0x75, 0xF0, 0x10, 0xEC, +0x90, 0x81, 0x0A, 0xF1, 0x1F, 0xEC, 0x90, 0x81, 0x0B, 0xF1, 0x92, 0x75, 0xF0, 0x0A, 0xF1, 0x08, +0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0x7F, 0x01, 0x90, 0xA2, 0x74, 0xE0, 0xFE, 0x75, 0xF0, 0x10, 0x90, +0x81, 0x0B, 0x12, 0x6B, 0xFA, 0xE0, 0xFD, 0x75, 0xF0, 0x0A, 0xEE, 0xF1, 0x08, 0x75, 0xF0, 0x02, +0xEF, 0xF1, 0x7A, 0xED, 0xF0, 0x0F, 0xEF, 0xB4, 0x05, 0xDD, 0xF1, 0x16, 0x90, 0x81, 0x09, 0x12, +0x49, 0x54, 0xE0, 0xFE, 0xF1, 0xBD, 0xEE, 0xF0, 0x90, 0xA2, 0x74, 0xE0, 0xFF, 0x90, 0xA2, 0x73, +0xE0, 0xFD, 0xF1, 0x32, 0x90, 0xA2, 0x74, 0xE0, 0x24, 0x81, 0xF1, 0x0E, 0x74, 0x01, 0xF0, 0x90, +0xA2, 0x74, 0xE0, 0x04, 0xF0, 0xC1, 0x51, 0x22, 0x90, 0x8D, 0x01, 0x02, 0x49, 0x54, 0xF5, 0x82, +0xE4, 0x34, 0x93, 0xF5, 0x83, 0x22, 0x90, 0xA2, 0x74, 0xE0, 0xFF, 0x75, 0xF0, 0x10, 0x22, 0x12, +0x49, 0x54, 0xE0, 0xFD, 0x75, 0xF0, 0x10, 0x22, 0x75, 0xF0, 0x10, 0xEF, 0x90, 0x81, 0x03, 0x02, +0x49, 0x54, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xED, 0x60, 0x21, 0x75, 0xF0, 0x0A, 0xEF, +0x90, 0x8D, 0x01, 0xF1, 0x6E, 0x90, 0x8D, 0x03, 0xF1, 0x6E, 0x90, 0x8D, 0x05, 0xF1, 0x6E, 0x90, +0x8D, 0x07, 0xF1, 0x6E, 0x90, 0x8D, 0x09, 0xF1, 0x7A, 0xF1, 0xAC, 0xE4, 0xF0, 0xF1, 0x28, 0xE0, +0x54, 0xBF, 0x44, 0x80, 0xFE, 0xF1, 0x28, 0xEE, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x12, 0x49, +0x54, 0xE4, 0xF0, 0xA3, 0xF0, 0x75, 0xF0, 0x0A, 0xEF, 0x22, 0x12, 0x49, 0x54, 0xE4, 0xF0, 0xA3, +0x22, 0xF1, 0x28, 0xE0, 0x44, 0x40, 0xF0, 0x22, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x90, 0xA2, 0x85, +0xF0, 0x22, 0x12, 0x49, 0x54, 0xE0, 0xFE, 0xED, 0xFF, 0x90, 0xA2, 0x74, 0xE0, 0x22, 0x90, 0xA2, +0x85, 0xE0, 0x24, 0x75, 0xF5, 0x82, 0xE4, 0x34, 0xA2, 0xF5, 0x83, 0x22, 0xF0, 0xEF, 0x25, 0xE0, +0x24, 0x01, 0xF5, 0x82, 0xE4, 0x34, 0x92, 0xF5, 0x83, 0xE4, 0xF0, 0xA3, 0xF0, 0x74, 0x91, 0x2F, +0xF5, 0x82, 0xE4, 0x34, 0x98, 0xF5, 0x83, 0x22, 0xE4, 0xFF, 0xA1, 0xD5, 0x12, 0xAD, 0x30, 0xE0, +0x54, 0xFB, 0xF0, 0x22, 0x12, 0xAD, 0x30, 0xE0, 0x44, 0x04, 0xF0, 0x22, 0x90, 0xA2, 0x01, 0xEF, +0xF0, 0x90, 0x04, 0x7E, 0xE0, 0xF5, 0x65, 0xA3, 0xE0, 0xF5, 0x66, 0x65, 0x65, 0x60, 0x6C, 0x90, +0xA2, 0x02, 0x74, 0x03, 0xF0, 0x90, 0xA2, 0x10, 0x74, 0x08, 0xF0, 0xE5, 0x66, 0x04, 0x54, 0x0F, +0xF5, 0x67, 0xE4, 0xF5, 0x64, 0xE5, 0x67, 0x75, 0xF0, 0x08, 0xA4, 0x24, 0x00, 0xF5, 0x82, 0xE4, +0x34, 0x80, 0xF5, 0x83, 0xE5, 0x82, 0x25, 0x64, 0x12, 0x6C, 0x00, 0xE0, 0xFF, 0x74, 0x04, 0x25, +0x64, 0xF5, 0x82, 0xE4, 0x34, 0xA2, 0xF5, 0x83, 0xEF, 0xF0, 0x05, 0x64, 0xE5, 0x64, 0xB4, 0x08, +0xD4, 0x7B, 0x01, 0x7A, 0xA2, 0x79, 0x02, 0x12, 0x7B, 0x25, 0xE5, 0x66, 0x04, 0x54, 0x0F, 0xF5, +0x66, 0xB4, 0x0F, 0x03, 0xE4, 0xF5, 0x66, 0x90, 0x04, 0x7F, 0xE5, 0x66, 0xF0, 0x90, 0xA2, 0x01, +0xE0, 0x7F, 0x04, 0x70, 0x03, 0x02, 0x6F, 0xE8, 0x12, 0x75, 0x96, 0x22, 0xE4, 0xFF, 0x02, 0x87, +0xDC, 0x90, 0xA3, 0x0F, 0x12, 0x49, 0x69, 0xE4, 0xFF, 0x90, 0xA3, 0x0F, 0x12, 0x49, 0x60, 0x8F, +0x82, 0x12, 0x67, 0xE5, 0xFE, 0x74, 0xF0, 0x2F, 0x11, 0x82, 0xEE, 0xF0, 0x0F, 0xEF, 0xB4, 0x10, +0xE8, 0x22, 0xF5, 0x82, 0xE4, 0x34, 0x02, 0xF5, 0x83, 0x22, 0x75, 0x15, 0x12, 0xE4, 0xF5, 0x16, +0x75, 0x17, 0x07, 0x75, 0x18, 0x72, 0x90, 0x01, 0x30, 0xE5, 0x15, 0xF0, 0xA3, 0xE5, 0x16, 0xF0, +0xA3, 0xE5, 0x17, 0xF0, 0xA3, 0xE5, 0x18, 0xF0, 0x22, 0x75, 0x1D, 0x06, 0x75, 0x1E, 0x01, 0x75, +0x1F, 0x03, 0x75, 0x20, 0x62, 0x90, 0x01, 0x38, 0xE5, 0x1D, 0xF0, 0xA3, 0xE5, 0x1E, 0xF0, 0xA3, +0xE5, 0x1F, 0xF0, 0xA3, 0xE5, 0x20, 0xF0, 0x22, 0x90, 0x01, 0x94, 0xE0, 0x44, 0x01, 0xF0, 0x90, +0x01, 0xC7, 0xE4, 0xF0, 0x22, 0x90, 0x01, 0x01, 0xE0, 0x44, 0x04, 0xF0, 0x90, 0x01, 0x9A, 0xE0, +0x54, 0xC0, 0x12, 0x79, 0x5B, 0x90, 0x01, 0x99, 0xE0, 0x44, 0xC0, 0xF0, 0x90, 0x01, 0x9B, 0x74, +0x80, 0xF0, 0x22, 0x7D, 0x02, 0x90, 0x01, 0xC4, 0x74, 0xF3, 0xF0, 0x74, 0x88, 0xA3, 0xF0, 0x90, +0xA0, 0x5F, 0xE0, 0xFF, 0xED, 0xC3, 0x9F, 0x50, 0x14, 0xED, 0x25, 0xE0, 0x24, 0x81, 0xF8, 0xE6, +0x30, 0xE4, 0x07, 0x31, 0x2B, 0xA3, 0xF0, 0x7F, 0x00, 0x22, 0x0D, 0x80, 0xE2, 0x74, 0xF3, 0x04, +0x90, 0x01, 0xC4, 0xF0, 0x74, 0x88, 0xA3, 0xF0, 0x7F, 0x01, 0x22, 0x90, 0x01, 0xB8, 0x74, 0x08, +0xF0, 0x22, 0x12, 0x5F, 0x97, 0xEF, 0x64, 0x01, 0x60, 0x04, 0x31, 0xC9, 0x21, 0xC0, 0x90, 0x9F, +0xAB, 0xE0, 0xFF, 0x54, 0x03, 0x60, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x02, 0xF0, 0x80, 0x71, 0x90, +0x9F, 0xA9, 0xE0, 0xFE, 0xE4, 0xC3, 0x9E, 0x50, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x04, 0xF0, 0x80, +0x5F, 0xEF, 0x30, 0xE2, 0x04, 0x31, 0x2B, 0x80, 0x57, 0x90, 0x9F, 0xAB, 0xE0, 0x30, 0xE4, 0x08, +0x90, 0x01, 0xB8, 0x74, 0x10, 0xF0, 0x80, 0x48, 0x90, 0x9F, 0xA4, 0xE0, 0x13, 0x13, 0x54, 0x3F, +0x20, 0xE0, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x20, 0xF0, 0x80, 0x35, 0x90, 0xA0, 0x51, 0xE0, 0x60, +0x08, 0x90, 0x01, 0xB8, 0x74, 0x80, 0xF0, 0x80, 0x27, 0x90, 0x06, 0x62, 0xE0, 0x30, 0xE1, 0x08, +0x90, 0x01, 0xB8, 0x74, 0x11, 0xF0, 0x80, 0x18, 0x90, 0x06, 0x62, 0xE0, 0x30, 0xE0, 0x0F, 0xE0, +0x54, 0xFC, 0xFF, 0xBF, 0x80, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x12, 0xF0, 0x80, 0x02, 0x80, 0x4B, +0x90, 0x01, 0xB9, 0x74, 0x04, 0xF0, 0x7F, 0x00, 0x22, 0x90, 0x01, 0xB8, 0x74, 0x01, 0xF0, 0x22, +0x90, 0xA0, 0x52, 0xE0, 0xC3, 0x13, 0x20, 0xE0, 0x27, 0x90, 0x02, 0x87, 0xE0, 0x60, 0x04, 0x31, +0xC9, 0x80, 0x1F, 0x90, 0x02, 0x96, 0xE0, 0x60, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x10, 0xF0, 0x80, +0x11, 0x90, 0x02, 0x86, 0xE0, 0x20, 0xE1, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x04, 0xF0, 0x80, 0x02, +0x80, 0x09, 0x90, 0x01, 0xB9, 0x74, 0x08, 0xF0, 0x7F, 0x00, 0x22, 0x90, 0x01, 0xB8, 0xE4, 0xF0, +0x7F, 0x01, 0x22, 0x90, 0x9F, 0xAA, 0xE0, 0xFF, 0x60, 0x03, 0xB4, 0x08, 0x0D, 0x31, 0xD0, 0xBF, +0x01, 0x08, 0x51, 0x58, 0x90, 0x01, 0xE5, 0xE0, 0x04, 0xF0, 0x22, 0x90, 0x9F, 0xA3, 0xE0, 0x30, +0xE0, 0x18, 0x90, 0x9F, 0x9E, 0xE0, 0xFF, 0x30, 0xE0, 0x0E, 0xC3, 0x13, 0x30, 0xE0, 0x07, 0x51,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x0D, 0x90, 0x9F, 0xA7, 0xE0, +0x60, 0x07, 0x91, 0x94, 0xF1, 0x85, 0x12, 0x50, 0x26, 0x22, 0x91, 0x45, 0x70, 0x15, 0x90, 0x9F, +0xA7, 0xE0, 0x60, 0x0F, 0x91, 0x94, 0x90, 0x9F, 0xA3, 0xE0, 0xB1, 0x1F, 0x54, 0x07, 0x70, 0x03, +0x12, 0x58, 0x4F, 0x22, 0x90, 0x01, 0x57, 0xE4, 0xF0, 0x90, 0x01, 0x3C, 0x74, 0x02, 0xF0, 0x22, +0x90, 0x01, 0x57, 0xE0, 0x60, 0x18, 0x91, 0x97, 0xB1, 0x66, 0x30, 0xE0, 0x02, 0x80, 0x6F, 0xB1, +0x4D, 0x40, 0x0B, 0xE4, 0xFF, 0x12, 0x72, 0xA6, 0xBF, 0x01, 0x03, 0x91, 0xBF, 0xF0, 0x22, 0x90, +0x9F, 0xA4, 0xE0, 0x54, 0xFB, 0x22, 0xD1, 0xCD, 0x54, 0x1F, 0x30, 0xE0, 0x0C, 0xEF, 0xC4, 0x13, +0x13, 0x54, 0x03, 0x30, 0xE0, 0x03, 0x12, 0x77, 0xD4, 0xB1, 0x66, 0x30, 0xE0, 0x08, 0xB1, 0x1E, +0x54, 0x07, 0x70, 0x39, 0x80, 0x34, 0xB1, 0x4D, 0x40, 0x30, 0x91, 0x45, 0x70, 0x2F, 0x12, 0x67, +0xD6, 0x70, 0x06, 0xB1, 0x2A, 0x91, 0xBF, 0xF0, 0x22, 0xB1, 0x2A, 0x90, 0x9F, 0xB1, 0xE0, 0x04, +0xF0, 0xE0, 0xD3, 0x94, 0x02, 0x40, 0x0A, 0x91, 0xBF, 0xF0, 0xE4, 0x90, 0x9F, 0xB1, 0xF0, 0x80, +0x03, 0x12, 0x5F, 0x51, 0xE4, 0x90, 0x9F, 0xB0, 0xF0, 0x22, 0x12, 0x58, 0x4F, 0x22, 0xEF, 0x54, +0xFB, 0xF0, 0x90, 0x9F, 0xAB, 0xE0, 0x54, 0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0xE0, 0x19, 0x75, 0xF0, 0x0E, 0xEF, 0xF1, 0x70, 0xEE, 0x54, 0xFE, 0xF0, 0x90, 0xA0, 0x62, 0x74, +0x05, 0xF0, 0x12, 0x50, 0xB9, 0xFD, 0x7F, 0x01, 0x12, 0x51, 0x40, 0x22, 0xFF, 0x75, 0xF0, 0x0E, +0x90, 0xA0, 0x6B, 0x02, 0x49, 0x54, 0x90, 0x9F, 0xA7, 0xE0, 0x60, 0x02, 0x91, 0xC6, 0x02, 0x50, +0x5B, 0xE0, 0x44, 0x02, 0xF0, 0xE4, 0x90, 0xA2, 0xD4, 0xF0, 0x90, 0xA0, 0x4C, 0xE0, 0x90, 0xA2, +0xD5, 0x22, 0x90, 0x9F, 0x9E, 0xE0, 0xFF, 0x30, 0xE0, 0x05, 0x12, 0x5F, 0x78, 0x60, 0x1B, 0x90, +0x9F, 0xA7, 0xE0, 0x70, 0x04, 0xEF, 0x30, 0xE0, 0x0B, 0x90, 0x9F, 0xAA, 0xE0, 0x64, 0x02, 0x60, +0x09, 0x12, 0x73, 0x20, 0x90, 0x01, 0xE6, 0xE0, 0x04, 0xF0, 0x22, 0xE4, 0xFF, 0x12, 0x72, 0xA6, +0xBF, 0x01, 0x13, 0x90, 0x9F, 0xA7, 0xE0, 0x60, 0x0D, 0x12, 0x67, 0xD6, 0x64, 0x02, 0x60, 0x03, +0x02, 0x90, 0xB9, 0x12, 0x5F, 0x51, 0x22, 0xE4, 0xFF, 0x12, 0x72, 0xA6, 0xBF, 0x01, 0x0F, 0x90, +0x9F, 0xA7, 0xE0, 0x60, 0x09, 0xF1, 0xEF, 0x54, 0x07, 0x70, 0x03, 0x12, 0x58, 0x4F, 0x22, 0x90, +0x9F, 0xAB, 0xE0, 0x54, 0xFE, 0xF0, 0x22, 0xE4, 0xF5, 0x64, 0x90, 0x06, 0xA9, 0xE0, 0xF5, 0x64, +0x54, 0xC0, 0x70, 0x09, 0x12, 0x8F, 0xEF, 0x54, 0xFD, 0xF0, 0x02, 0x58, 0x4F, 0xE5, 0x64, 0x30, +0xE6, 0x1A, 0x90, 0x9F, 0xA7, 0xE0, 0x64, 0x01, 0x70, 0x15, 0x11, 0xB2, 0x12, 0x67, 0xD5, 0x64, +0x02, 0x60, 0x04, 0x11, 0xB9, 0x80, 0x08, 0x12, 0x5F, 0x51, 0x80, 0x03, 0x12, 0x8F, 0xEF, 0xE5, +0x64, 0x90, 0x9F, 0xAB, 0x30, 0xE7, 0x08, 0x12, 0x8F, 0x81, 0x12, 0x50, 0x26, 0x41, 0x7F, 0xE0, +0x54, 0xFD, 0xF0, 0x22, 0x90, 0x06, 0xA9, 0xE0, 0x90, 0xA2, 0x03, 0xF0, 0xE0, 0xFD, 0x54, 0xC0, +0x70, 0x05, 0x12, 0x8F, 0xEF, 0x80, 0x57, 0xED, 0x30, 0xE6, 0x3D, 0x90, 0x9F, 0xA7, 0xE0, 0x64, +0x02, 0x70, 0x23, 0x90, 0x9F, 0xA3, 0xE0, 0xFF, 0xC3, 0x13, 0x20, 0xE0, 0x05, 0x11, 0xB2, 0xF0, +0x80, 0x1D, 0x12, 0x67, 0xD6, 0x64, 0x01, 0x70, 0x22, 0x90, 0x9F, 0xAB, 0xE0, 0x44, 0x04, 0xF0, +0x7F, 0x01, 0x31, 0x57, 0x80, 0x15, 0x11, 0xB2, 0x12, 0x67, 0xD5, 0x64, 0x02, 0x60, 0x04, 0x11, +0xB9, 0x80, 0x08, 0x12, 0x5F, 0x51, 0x80, 0x03, 0x12, 0x8F, 0xEF, 0x90, 0xA2, 0x03, 0xE0, 0x90, +0x9F, 0xAB, 0x30, 0xE7, 0x08, 0x12, 0x8F, 0x81, 0x12, 0x50, 0x26, 0x41, 0x7F, 0xE0, 0x54, 0xFD, +0xF0, 0x22, 0x90, 0x9F, 0xAB, 0xE0, 0x44, 0x01, 0x22, 0x90, 0x04, 0x1D, 0xE0, 0x70, 0x15, 0x90, +0x9E, 0x99, 0xE0, 0xFF, 0x7B, 0x18, 0xE4, 0xFD, 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 0x03, 0x02, 0x8D, 0xF4, 0x12, 0x5F, 0x62, 0x90, 0x9F, 0xA2, 0xE0, 0xB4, +0x08, 0x06, 0xE4, 0xFD, 0x7F, 0x0C, 0x80, 0x09, 0x90, 0x9F, 0xA2, 0xE0, 0x70, 0x06, 0xFD, 0x7F, +0x04, 0x12, 0x58, 0x67, 0x22, 0xE4, 0x90, 0xA2, 0x12, 0xF0, 0xA3, 0xF0, 0xA3, 0xF0, 0x7F, 0x83, +0x12, 0x4B, 0xFC, 0x90, 0xA2, 0x12, 0xEF, 0xF0, 0x7F, 0x83, 0x12, 0x4B, 0xFC, 0xAE, 0x07, 0x90, +0xA2, 0x12, 0xE0, 0xFF, 0xB5, 0x06, 0x01, 0x22, 0xC3, 0x90, 0xA2, 0x14, 0xE0, 0x94, 0x64, 0x90, +0xA2, 0x13, 0xE0, 0x94, 0x00, 0x40, 0x0D, 0x90, 0x01, 0xC0, 0xE0, 0x44, 0x40, 0xF0, 0x90, 0xA2, +0x12, 0xE0, 0xFF, 0x22, 0x90, 0xA2, 0x13, 0x12, 0x78, 0xFB, 0x80, 0xC2, 0x90, 0x01, 0xC4, 0x74, +0x5C, 0xF0, 0x74, 0x93, 0xA3, 0xF0, 0x7F, 0x90, 0x12, 0x4B, 0xFC, 0xEF, 0x20, 0xE0, 0xF7, 0x74, +0x5C, 0x04, 0x90, 0x01, 0xC4, 0xF0, 0x74, 0x93, 0xA3, 0xF0, 0x22, 0x7E, 0xFF, 0xED, 0xC3, 0x94, +0x33, 0x40, 0x19, 0xED, 0xD3, 0x94, 0x35, 0x50, 0x13, 0x75, 0xF0, 0x04, 0xEF, 0x12, 0x4F, 0x61, +0xC4, 0x13, 0x54, 0x07, 0x30, 0xE0, 0x05, 0xED, 0x14, 0x44, 0x80, 0xFE, 0xED, 0x14, 0xFD, 0x71, +0xA6, 0xED, 0xF0, 0xAF, 0x06, 0x22, 0x74, 0x91, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x9D, 0xF5, 0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0xFE, +0xEF, 0x55, 0x82, 0x4E, 0x60, 0x20, 0xE5, 0x5F, 0x90, 0xA1, 0x55, 0xB4, 0x14, 0x05, 0x74, 0x0C, +0xF0, 0x80, 0x02, 0xED, 0xF0, 0x90, 0xA1, 0x54, 0xE0, 0x04, 0xF0, 0xE0, 0x65, 0x60, 0x60, 0x09, +0xA3, 0xE0, 0xD3, 0x99, 0x40, 0x03, 0x1D, 0x80, 0xB5, 0x90, 0xA1, 0x55, 0xE0, 0xF5, 0x5D, 0x90, +0xA1, 0x53, 0xE0, 0xFF, 0xAD, 0x5D, 0xB1, 0xB7, 0x8F, 0x5D, 0x80, 0x04, 0xAF, 0x01, 0x8F, 0x5D, +0xAF, 0x02, 0x85, 0x5E, 0x6B, 0xE4, 0xFB, 0xAD, 0x5D, 0x02, 0x6E, 0x72, 0xEF, 0x60, 0x0A, 0xED, +0xC3, 0x94, 0x2C, 0x40, 0x04, 0x7E, 0x20, 0x80, 0x02, 0xE4, 0xFE, 0xC3, 0xED, 0x9E, 0xFF, 0x22, +0x54, 0x03, 0x25, 0xE0, 0x25, 0xE0, 0x22, 0xF5, 0x82, 0xE4, 0x34, 0x9B, 0xF5, 0x83, 0x22, 0xED, +0x13, 0x13, 0x13, 0x54, 0x1F, 0xFF, 0x75, 0xF0, 0x08, 0x22, 0xE5, 0x53, 0x25, 0xE0, 0x24, 0xF7, +0xF5, 0x82, 0xE4, 0x34, 0x42, 0x22, 0x25, 0xE0, 0x24, 0x91, 0xF5, 0x82, 0xE4, 0x34, 0x94, 0xF5, +0x83, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0x22, 0xEF, 0x60, 0x0A, 0xED, 0xD3, 0x94, 0x0B, 0x40, 0x04, +0x7E, 0x20, 0x80, 0x02, 0xE4, 0xFE, 0xED, 0x2E, 0xFF, 0x22, 0x12, 0x38, 0x07, 0x90, 0xA1, 0xF8, +0xE0, 0x75, 0xF0, 0x1C, 0xA4, 0x24, 0x97, 0xF5, 0x82, 0xE4, 0x34, 0x44, 0xF5, 0x83, 0xE4, 0x93, +0xFE, 0x74, 0x01, 0x93, 0xFF, 0x12, 0x37, 0xBC, 0xE4, 0xFF, 0xFE, 0xEC, 0x54, 0x07, 0xFC, 0x90, +0xA2, 0x45, 0x12, 0x08, 0x6D, 0x90, 0xA1, 0xF8, 0xE0, 0x75, 0xF0, 0x0E, 0xA4, 0x24, 0x77, 0xF5, +0x82, 0xE4, 0x34, 0x44, 0xF5, 0x83, 0xE4, 0x93, 0xFE, 0x74, 0x01, 0x93, 0xFF, 0x22, 0x90, 0xA1, +0xF8, 0x12, 0xAF, 0x1A, 0xB1, 0xF5, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAA, 0xB9, 0x12, 0x08, 0x79, +0x00, 0x10, 0x00, 0x00, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x76, 0xE1, 0x12, 0x08, 0x79, 0xFA, 0x00, +0x00, 0x00, 0x7F, 0x80, 0x7E, 0x09, 0x12, 0x76, 0xE1, 0x12, 0x08, 0x79, 0xF8, 0x00, 0x00, 0x00, +0x7F, 0x80, 0x7E, 0x09, 0x12, 0x38, 0x07, 0x7F, 0x03, 0x7E, 0x00, 0x12, 0x3C, 0xEC, 0xB1, 0xF5, +0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAA, 0xB9, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0xD0, 0x07, +0xD0, 0x06, 0x12, 0x38, 0x07, 0xE4, 0x90, 0xA1, 0xFB, 0xF0, 0xF1, 0xAC, 0x24, 0x97, 0xF5, 0x82, +0xE4, 0x34, 0x44, 0xD1, 0x04, 0xF1, 0xB5, 0x54, 0x04, 0xFE, 0xE4, 0xFD, 0xFC, 0x78, 0x0A, 0x12, +0x08, 0x47, 0xEF, 0x70, 0x14, 0x90, 0xA1, 0xFB, 0xE0, 0xD3, 0x94, 0x14, 0x50, 0x0B, 0x12, 0xAF, +0xAE, 0x90, 0xA1, 0xFB, 0xE0, 0x04, 0xF0, 0x80, 0xD1, 0x90, 0xA1, 0xFB, 0xE0, 0xC3, 0x94, 0x14, +0x40, 0x02, 0xE1, 0x9D, 0x90, 0xA1, 0xF9, 0xE0, 0x70, 0x42, 0xF1, 0xAC, 0x24, 0x97, 0xF5, 0x82, +0xE4, 0x34, 0x44, 0xD1, 0x04, 0xF1, 0xB5, 0x54, 0x10, 0x12, 0xAC, 0xFE, 0x70, 0x26, 0xB1, 0xF5, +0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAA, 0xB9, 0x12, 0x08, 0x79, 0x02, 0x00, 0x00, 0x00, 0xD0, 0x07, +0xD0, 0x06, 0xB1, 0xCA, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAA, 0xB9, 0x12, 0x08, 0x79, 0x04, 0x00, +0x00, 0x00, 0x80, 0x40, 0xF1, 0xBC, 0x60, 0x02, 0xC1, 0x14, 0xE1, 0xA3, 0xF1, 0xAC, 0x24, 0x97, +0xF5, 0x82, 0xE4, 0x34, 0x44, 0xD1, 0x04, 0xF1, 0xB5, 0x54, 0x08, 0x12, 0xAC, 0xFE, 0x70, 0x4E, +0xB1, 0xF5, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAA, 0xB9, 0x12, 0x08, 0x79, 0x06, 0x00, 0x00, 0x00, +0xD0, 0x07, 0xD0, 0x06, 0xB1, 0xCA, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAA, 0xB9, 0x12, 0x08, 0x79, +0x08, 0x00, 0x00, 0x00, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x38, 0x07, 0xF1, 0xAC, 0x24, 0x97, 0xF5, +0x82, 0xE4, 0x34, 0x44, 0xD1, 0x04, 0x12, 0x37, 0xBC, 0xE4, 0xFF, 0xFE, 0xEC, 0x54, 0x07, 0xFC, +0x90, 0xA2, 0x49, 0x12, 0x08, 0x6D, 0x90, 0xA2, 0x00, 0x74, 0x01, 0xF0, 0x80, 0x55, 0xF1, 0xAC, +0xF1, 0xCB, 0xD1, 0x04, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xA2, 0xB1, 0x12, 0x08, 0x79, 0x00, 0x00, +0x03, 0xFF, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x00, 0x00, 0x01, 0x00, 0xD0, 0x07, 0xD0, 0x06, +0xF1, 0xA9, 0xF1, 0xCB, 0xD1, 0x04, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xA2, 0xB1, 0x12, 0x08, 0x79, +0x03, 0xFF, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0xD0, 0x07, +0xD0, 0x06, 0x12, 0x7E, 0x92, 0xF1, 0xBC, 0x60, 0x02, 0xC1, 0x14, 0x80, 0x06, 0xF1, 0xBC, 0x60, +0x02, 0xC1, 0x14, 0x90, 0xA2, 0x00, 0xE0, 0xFF, 0x22, 0x12, 0x7E, 0x92, 0x90, 0xA1, 0xF8, 0xE0, +0x75, 0xF0, 0x1C, 0xA4, 0x22, 0x12, 0x37, 0xBC, 0xE4, 0xFF, 0xEE, 0x22, 0xE4, 0x90, 0xA2, 0x00, +0xF0, 0x90, 0xA1, 0xFA, 0xE0, 0x04, 0xF0, 0xE0, 0x64, 0x0A, 0x22, 0x24, 0x95, 0xF5, 0x82, 0xE4, +0x34, 0x44, 0x22, 0xED, 0x54, 0x7F, 0xFC, 0xED, 0x54, 0x80, 0x60, 0x03, 0xAF, 0x04, 0x22, 0xEC, +0xC3, 0x94, 0x33, 0x40, 0x1E, 0xEC, 0xD3, 0x94, 0x35, 0x50, 0x18, 0x75, 0xF0, 0x04, 0xEF, 0x12, +0x4F, 0x61, 0xC4, 0x13, 0x54, 0x07, 0x30, 0xE0, 0x06, 0xEC, 0x44, 0x80, 0xFE, 0x80, 0x06, 0x7E, +0xFF, 0x80, 0x02, 0x7E, 0xFF, 0xAF, 0x06, 0x22, 0xE4, 0xF5, 0x5D, 0x74, 0x91, 0x2F, 0x12, 0x6C, +0x0A, 0xE0, 0xFE, 0xB4, 0x05, 0x08, 0xED, 0xC3, 0x94, 0x3B, 0x40, 0x51, 0x80, 0x47, 0xEE, 0xB4, +0x04, 0x08, 0xED, 0xC3, 0x94, 0x31, 0x40, 0x45, 0x80, 0x3B, 0x74, 0x91, 0x2F, 0x12, 0x6C, 0x0A, +0xE0, 0xFE, 0xB4, 0x03, 0x08, 0xED, 0xC3, 0x94, 0x19, 0x40, 0x32, 0x80, 0x28, 0xEE, 0xB4, 0x02, +0x08, 0xED, 0xC3, 0x94, 0x11, 0x40, 0x26, 0x80, 0x1C, 0x74, 0x91, 0x2F, 0x12, 0x6C, 0x0A, 0xE0, +0xFE, 0xB4, 0x01, 0x08, 0xED, 0xC3, 0x94, 0x0A, 0x40, 0x13, 0x80, 0x09, 0xEE, 0x70, 0x0B, 0xED, +0xC3, 0x94, 0x03, 0x40, 0x08, 0x75, 0x5D, 0x01, 0x80, 0x03, 0xE4, 0xF5, 0x5D, 0xAF, 0x5D, 0x22, +0x8F, 0x52, 0x8D, 0x53, 0x8B, 0x54, 0x75, 0xF0, 0x04, 0xEF, 0x12, 0x4D, 0xFC, 0xC4, 0x54, 0x03, +0x90, 0xA1, 0x48, 0xF0, 0x90, 0xA1, 0x46, 0x60, 0x09, 0x74, 0x32, 0xF0, 0xA3, 0x74, 0x2F, 0xF0, +0x80, 0x07, 0x74, 0x11, 0xF0, 0xA3, 0x74, 0x0F, 0xF0, 0xE5, 0x53, 0xD3, 0x94, 0x2D, 0x40, 0x0A, +0x75, 0xF0, 0x04, 0xE5, 0x52, 0x12, 0x6F, 0xD0, 0x80, 0x20, 0xE5, 0x53, 0xD3, 0x94, 0x1E, 0x40, +0x05, 0x90, 0xA1, 0x46, 0x80, 0x14, 0xE5, 0x53, 0xD3, 0x94, 0x14, 0x40, 0x05, 0x90, 0xA1, 0x47, +0x80, 0x08, 0x75, 0xF0, 0x04, 0xE5, 0x52, 0x12, 0x6D, 0x4E, 0xE0, 0x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xF0, 0x04, 0xE5, 0x5D, 0x12, 0x4D, 0xFC, 0xFF, 0x54, 0x03, 0xFE, 0xE5, 0x60, +0xC3, 0x9E, 0x50, 0x1D, 0x75, 0x5E, 0x2C, 0x05, 0x60, 0xE5, 0x60, 0x12, 0x95, 0x80, 0xFE, 0x75, +0xF0, 0x04, 0xE5, 0x5D, 0x90, 0x96, 0x14, 0x12, 0x49, 0x54, 0xEF, 0x54, 0xF3, 0x4E, 0xF0, 0x61, +0xD0, 0xE5, 0x5F, 0xB4, 0x2C, 0x05, 0x75, 0x5E, 0x2D, 0x61, 0xD0, 0xE5, 0x5F, 0xC3, 0x95, 0x61, +0x40, 0x02, 0x61, 0x94, 0xE5, 0x5F, 0xC3, 0x94, 0x0C, 0x40, 0x13, 0xE5, 0x5F, 0x94, 0x13, 0x50, +0x0D, 0x12, 0x66, 0xE1, 0xE0, 0xFF, 0x20, 0xE3, 0x05, 0x75, 0x63, 0x01, 0x80, 0x18, 0xE5, 0x5F, +0xC3, 0x94, 0x2C, 0x40, 0x1A, 0xE5, 0x5F, 0x94, 0x35, 0x50, 0x14, 0x12, 0x66, 0xE1, 0xE0, 0xFF, +0x20, 0xE3, 0x0C, 0x75, 0x63, 0x02, 0x12, 0x66, 0xE1, 0xEF, 0x44, 0x08, 0xF0, 0x80, 0x07, 0x12, +0x66, 0xDE, 0xE0, 0x54, 0xF7, 0xF0, 0x12, 0x66, 0xE1, 0xE0, 0x20, 0xE6, 0x03, 0x30, 0xE1, 0x07, +0x12, 0x66, 0xDE, 0xE0, 0x54, 0xF7, 0xF0, 0xE5, 0x63, 0x64, 0x01, 0x70, 0x70, 0x71, 0xD3, 0x20, +0xE7, 0x0E, 0x20, 0xE6, 0x0B, 0x20, 0xE5, 0x08, 0x20, 0xE4, 0x05, 0x71, 0xE0, 0x30, 0xE0, 0x5D, +0x12, 0x66, 0xE1, 0xE0, 0x44, 0x04, 0xF0, 0xE5, 0x5F, 0xB4, 0x0C, 0x08, 0x75, 0x5F, 0x14, 0x75, +0x5E, 0x14, 0x61, 0x07, 0xE5, 0x5F, 0xB4, 0x0D, 0x02, 0x80, 0x05, 0xE5, 0x5F, 0xB4, 0x0E, 0x08, +0x75, 0x5F, 0x15, 0x75, 0x5E, 0x15, 0x61, 0x07, 0xE5, 0x5F, 0xB4, 0x0F, 0x08, 0x75, 0x5F, 0x16, +0x75, 0x5E, 0x16, 0x61, 0x07, 0xE5, 0x5F, 0xC3, 0x94, 0x10, 0x40, 0x08, 0x75, 0x5F, 0x17, 0x75, +0x5E, 0x17, 0x61, 0x07, 0xE5, 0x5F, 0xC3, 0x94, 0x11, 0x50, 0x02, 0x61, 0x07, 0xE5, 0x5F, 0x94, +0x13, 0x40, 0x02, 0x61, 0x07, 0x75, 0x5F, 0x18, 0x75, 0x5E, 0x18, 0x80, 0x7A, 0xE5, 0x63, 0x64, +0x02, 0x70, 0x79, 0x71, 0xD3, 0x20, 0xE6, 0x0E, 0x20, 0xE7, 0x0B, 0x71, 0xE0, 0x20, 0xE0, 0x06, +0x20, 0xE1, 0x03, 0x30, 0xE2, 0x66, 0xE5, 0x5F, 0x64, 0x2C, 0x60, 0x05, 0xE5, 0x5F, 0xB4, 0x2D, +0x08, 0x75, 0x5F, 0x36, 0x75, 0x5E, 0x36, 0x80, 0x4E, 0xE5, 0x5F, 0x64, 0x2E, 0x60, 0x05, 0xE5, +0x5F, 0xB4, 0x2F, 0x08, 0x75, 0x5F, 0x37, 0x75, 0x5E, 0x37, 0x80, 0x3B, 0xE5, 0x5F, 0xB4, 0x30, +0x08, 0x75, 0x5F, 0x38, 0x75, 0x5E, 0x38, 0x80, 0x2E, 0xE5, 0x5F, 0xB4, 0x31, 0x08, 0x75, 0x5F, +0x39, 0x75, 0x5E, 0x39, 0x80, 0x21, 0xE5, 0x5F, 0xC3, 0x94, 0x32, 0x40, 0x0F, 0xE5, 0x5F, 0xD3, +0x94, 0x34, 0x50, 0x08, 0x75, 0x5F, 0x3A, 0x75, 0x5E, 0x3A, 0x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25, 0xE0, 0x24, 0x4F, 0xF5, 0x82, 0xE4, 0x34, 0x42, 0x12, 0x96, 0x04, 0xE5, +0x5D, 0x02, 0x95, 0xA6, 0x74, 0x91, 0x25, 0x5D, 0x12, 0x93, 0xA9, 0xE5, 0x61, 0xF0, 0xF5, 0x5E, +0x02, 0x6E, 0x69, 0x75, 0xF0, 0x08, 0xE5, 0x5D, 0x90, 0x89, 0x02, 0x12, 0x49, 0x54, 0xE0, 0x22, +0x75, 0xF0, 0x08, 0xE5, 0x5D, 0x90, 0x89, 0x03, 0x12, 0x49, 0x54, 0xE0, 0x22, 0xE5, 0x53, 0x25, +0xE0, 0x24, 0x4F, 0xF5, 0x82, 0xE4, 0x34, 0x42, 0xF5, 0x83, 0x22, 0x25, 0xE0, 0x24, 0x59, 0xF5, +0x82, 0xE4, 0x34, 0x44, 0xF5, 0x83, 0xE4, 0x93, 0xFC, 0x74, 0x01, 0x93, 0x22, 0x12, 0x77, 0xC2, +0x12, 0x08, 0x79, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, +0x00, 0x12, 0x7E, 0x8E, 0xE4, 0x90, 0xA1, 0xBC, 0xF0, 0x90, 0xA1, 0xBC, 0xE0, 0xFF, 0x71, 0xFB, +0xF5, 0x82, 0x8C, 0x83, 0xE0, 0xFE, 0x12, 0x76, 0xEC, 0x8F, 0x82, 0x75, 0x83, 0x00, 0xEE, 0x12, +0x06, 0xE1, 0x91, 0x7B, 0xE0, 0xB4, 0x03, 0xE1, 0xE4, 0x90, 0xA1, 0xBC, 0xF0, 0x90, 0xA1, 0xBC, +0xE0, 0xFF, 0xC3, 0x94, 0x08, 0x50, 0x10, 0xEF, 0x91, 0xEC, 0x12, 0x96, 0x04, 0x12, 0x37, 0xBC, +0x90, 0xA1, 0xB9, 0x91, 0x68, 0x80, 0xE6, 0x22, 0x12, 0x49, 0x60, 0x90, 0xA1, 0xBC, 0xE0, 0x75, +0xF0, 0x04, 0xA4, 0xF5, 0x82, 0x85, 0xF0, 0x83, 0x12, 0x49, 0x18, 0x90, 0xA1, 0xBC, 0xE0, 0x04, +0xF0, 0x22, 0x12, 0x77, 0xC2, 0x12, 0x08, 0x79, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, +0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0x12, 0x7E, 0x8E, 0xE4, 0x90, 0xA1, 0xBC, 0xF0, 0x12, 0x76, +0xEC, 0x90, 0xA1, 0xBC, 0xE0, 0xFF, 0xF5, 0x82, 0x12, 0x67, 0xE5, 0xFE, 0xEF, 0x71, 0xFB, 0xF5, +0x82, 0x8C, 0x83, 0xEE, 0xF0, 0x91, 0x7B, 0xE0, 0xB4, 0x03, 0xE3, 0xE4, 0x90, 0xA1, 0xBC, 0xF0, +0x90, 0xA1, 0xBC, 0xE0, 0xFD, 0x91, 0xEC, 0x12, 0x96, 0x04, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xA1, +0xB9, 0x12, 0x49, 0x60, 0x91, 0xF6, 0x12, 0x48, 0xCE, 0x12, 0x4D, 0x4D, 0xD0, 0x07, 0xD0, 0x06, +0x12, 0x38, 0x07, 0x91, 0x7B, 0xE0, 0xC3, 0x94, 0x08, 0x40, 0xD5, 0x22, 0x25, 0xE0, 0x24, 0x5F, +0xF5, 0x82, 0xE4, 0x34, 0x44, 0x22, 0x75, 0xF0, 0x04, 0xED, 0xA4, 0xF5, 0x82, 0x85, 0xF0, 0x83, +0x22, 0x12, 0x77, 0xC2, 0x12, 0x08, 0x79, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, +0x79, 0x00, 0x00, 0x00, 0x00, 0x12, 0x7E, 0x8E, 0xE4, 0x90, 0xA1, 0xBC, 0xF0, 0x90, 0xA1, 0xBC, +0xE0, 0xFF, 0xC3, 0x94, 0x07, 0x50, 0x10, 0xEF, 0xB1, 0x38, 0x12, 0x96, 0x04, 0x12, 0x37, 0xBC, +0x90, 0xA1, 0xB6, 0x91, 0x68, 0x80, 0xE6, 0x22, 0x25, 0xE0, 0x24, 0x6F, 0xF5, 0x82, 0xE4, 0x34, +0x44, 0x22, 0x90, 0x04, 0x54, 0xE0, 0x7F, 0x00, 0x30, 0xE7, 0x02, 0x7F, 0x01, 0x22, 0x90, 0xA3, +0x24, 0xED, 0xF0, 0x90, 0xA3, 0x23, 0xEF, 0xF0, 0xD3, 0x94, 0x0E, 0x50, 0x15, 0xB1, 0x42, 0xEF, +0x60, 0x2A, 0xB1, 0x42, 0xEF, 0x64, 0x01, 0x70, 0x23, 0x90, 0xA3, 0x24, 0xE0, 0xFD, 0xE4, 0xFF, +0x80, 0x15, 0x90, 0xA3, 0x23, 0xE0, 0xD3, 0x94, 0x0E, 0x40, 0x11, 0xB1, 0x42, 0xEF, 0x70, 0x0A, +0x90, 0xA3, 0x24, 0xE0, 0xFD, 0x7F, 0x01, 0x02, 0x7E, 0xF4, 0xB1, 0x42, 0x22, 0xD3, 0x10, 0xAF, +0x01, 0xC3, 0xC0, 0xD0, 0xA9, 0x07, 0x90, 0x06, 0x69, 0xE0, 0xFE, 0x90, 0x06, 0x68, 0xE0, 0x7A, +0x00, 0x24, 0x00, 0xFF, 0xEA, 0x3E, 0xFE, 0xE9, 0x14, 0x60, 0x0F, 0x14, 0x60, 0x1E, 0x24, 0x02, +0x70, 0x25, 0xEE, 0x54, 0xFE, 0xFE, 0xB1, 0xDC, 0x80, 0x1A, 0xEF, 0x44, 0x80, 0xFF, 0xEE, 0x54, +0xFE, 0xFC, 0x90, 0x06, 0x68, 0xEF, 0xF0, 0xEC, 0xA3, 0xF0, 0x80, 0x0B, 0xEE, 0x44, 0x01, 0xFC, +0xB1, 0xDC, 0xAE, 0x04, 0xEE, 0xA3, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xEF, 0x54, 0x7F, 0x90, +0x06, 0x68, 0xF0, 0x22, 0xE4, 0xFE, 0xFC, 0xEF, 0x64, 0x02, 0x70, 0x40, 0xED, 0xB4, 0x01, 0x04, +0x7E, 0x0A, 0x80, 0x06, 0xED, 0xB4, 0x02, 0x02, 0x7E, 0x09, 0xEB, 0xB4, 0x01, 0x08, 0xED, 0xB4, +0x01, 0x04, 0x7C, 0x04, 0x80, 0x38, 0xEB, 0xB4, 0x02, 0x08, 0xED, 0xB4, 0x01, 0x04, 0x7C, 0x02, +0x80, 0x2C, 0xEB, 0xB4, 0x01, 0x08, 0xED, 0xB4, 0x02, 0x04, 0x7C, 0x01, 0x80, 0x20, 0xEB, 0x64, +0x02, 0x70, 0x1B, 0xED, 0x64, 0x02, 0x70, 0x16, 0x7C, 0x03, 0x80, 0x12, 0xEF, 0xB4, 0x01, 0x0E, +0xEB, 0xB4, 0x02, 0x04, 0x7C, 0x01, 0x80, 0x06, 0xEB, 0xB4, 0x01, 0x02, 0x7C, 0x02, 0xAF, 0x06, +0xEF, 0xC4, 0x54, 0xF0, 0x4C, 0xFF, 0x22, 0x90, 0xA2, 0xB1, 0x12, 0x08, 0x79, 0x80, 0x00, 0x00, +0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0x12, 0x7E, 0x8E, 0x90, 0x05, +0x22, 0x74, 0x3F, 0xF0, 0x90, 0x05, 0x50, 0xE0, 0x54, 0xF7, 0xF0, 0xA3, 0xE0, 0x54, 0xF7, 0xF0, +0x90, 0xA2, 0xB1, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0xFF, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, +0x00, 0x00, 0x00, 0x00, 0x74, 0x08, 0xFF, 0xFE, 0x12, 0x7E, 0x88, 0x12, 0x08, 0x79, 0x00, 0x00, +0x00, 0x0F, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x0C, 0x7F, 0x38, 0x7E, 0x08, +0x02, 0x7E, 0x92, 0xF1, 0x8B, 0x12, 0x08, 0x79, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, +0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0x12, 0x7E, 0x8E, 0x90, 0xA1, 0xF9, 0xF1, 0x6F, 0xE4, 0x7B, +0x12, 0x7A, 0x01, 0xF9, 0xF8, 0xC3, 0x12, 0x48, 0x9D, 0x60, 0x11, 0x90, 0xA1, 0xFD, 0xF1, 0x6F, +0xE4, 0x7B, 0xEE, 0x7A, 0x03, 0xF8, 0xC3, 0x12, 0x48, 0x9D, 0x70, 0x48, 0x12, 0x97, 0xAC, 0x12, +0x97, 0xCB, 0x12, 0x96, 0x04, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xA2, 0xB1, 0x12, 0x08, 0x79, 0x00, +0x00, 0x03, 0xFF, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x00, 0x00, 0x01, 0x00, 0xD0, 0x07, 0xD0, +0x06, 0x12, 0x97, 0xA9, 0x12, 0x97, 0xCB, 0x12, 0x96, 0x04, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xA2, +0xB1, 0x12, 0x08, 0x79, 0x03, 0xFF, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x00, 0x00, +0x00, 0x00, 0x80, 0x44, 0x12, 0x97, 0xAC, 0x12, 0x97, 0xCB, 0x12, 0x96, 0x04, 0xC0, 0x06, 0xC0, +0x07, 0x90, 0xA2, 0xB1, 0x12, 0x08, 0x79, 0x00, 0x00, 0x03, 0xFF, 0x90, 0xA1, 0xF9, 0x12, 0x49, +0x3C, 0xF1, 0x85, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x97, 0xA9, 0x12, 0x97, 0xCB, 0x12, 0x96, 0x04, +0xC0, 0x06, 0xC0, 0x07, 0x90, 0xA2, 0xB1, 0x12, 0x08, 0x79, 0x03, 0xFF, 0x00, 0x00, 0x90, 0xA1, +0xFD, 0x12, 0x49, 0x3C, 0x78, 0x10, 0xF1, 0x82, 0xD0, 0x07, 0xD0, 0x06, 0x02, 0x7E, 0x92, 0x12, +0x49, 0x3C, 0x78, 0x01, 0x02, 0x08, 0x47, 0x90, 0xA2, 0xD7, 0xE0, 0xFF, 0xE4, 0xFC, 0xFD, 0xFE, +0x78, 0x1C, 0x12, 0x08, 0x5A, 0x90, 0xA2, 0xB5, 0x02, 0x08, 0x6D, 0x90, 0xA1, 0xF8, 0xEF, 0xF0, +0x90, 0xA2, 0xB1, 0x22, 0xF1, 0x8B, 0x12, 0x08, 0x79, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA2, 0xB5, +0x12, 0x08, 0x79, 0x80, 0x00, 0x00, 0x00, 0x7F, 0x2C, 0x7E, 0x08, 0x12, 0x97, 0xA9, 0x24, 0x99, +0xF5, 0x82, 0xE4, 0x34, 0x44, 0x12, 0x96, 0x04, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAA, 0xB9, 0x12, +0x08, 0x79, 0x00, 0x00, 0x00, 0x80, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x38, 0x07, 0x12, 0x97, 0xAC, +0x24, 0x9B, 0xF5, 0x82, 0xE4, 0x34, 0x44, 0x12, 0x96, 0x04, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAA, +0xB9, 0x12, 0x08, 0x79, 0x20, 0x04, 0x00, 0x00, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x38, 0x07, 0x12, +0x97, 0xAC, 0x24, 0x9D, 0xF5, 0x82, 0xE4, 0x34, 0x44, 0x12, 0x96, 0x04, 0xC0, 0x06, 0xC0, 0x07, +0x90, 0xAA, 0xB9, 0x12, 0x08, 0x79, 0x20, 0x00, 0x00, 0x00, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x38, +0x07, 0x12, 0x97, 0xAC, 0x24, 0x9F, 0xF5, 0x82, 0xE4, 0x34, 0x44, 0x12, 0x96, 0x04, 0xC0, 0x06, +0xC0, 0x07, 0x90, 0xA2, 0xB1, 0x12, 0x08, 0x79, 0x00, 0x00, 0x07, 0xFF, 0x90, 0xA1, 0xFD, 0x12, +0x49, 0x3C, 0x12, 0x9F, 0x85, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x97, 0xA9, 0x24, 0xA1, 0xF5, 0x82, +0xE4, 0x34, 0x44, 0x12, 0x96, 0x04, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xA2, 0xB1, 0x12, 0x08, 0x79, +0x00, 0x00, 0x07, 0xFF, 0x90, 0xA1, 0xF9, 0x12, 0x49, 0x3C, 0x12, 0x9F, 0x85, 0xD0, 0x07, 0xD0, +0x06, 0x02, 0x7E, 0x92, 0x90, 0xA1, 0xB6, 0xEF, 0xF0, 0xE4, 0xA3, 0xF0, 0x90, 0xA1, 0xD3, 0x12, +0x4F, 0x3F, 0x78, 0xDA, 0x7C, 0xA1, 0x7D, 0x01, 0x7B, 0xFF, 0x7A, 0x44, 0x79, 0xC3, 0xFE, 0x7F, +0x06, 0x12, 0x06, 0x63, 0xE4, 0x90, 0xA1, 0xD7, 0xF0, 0xA3, 0xF0, 0x90, 0xA0, 0x8D, 0xE0, 0x90, +0xA1, 0xD9, 0xF0, 0x90, 0xA2, 0xB1, 0x12, 0x08, 0x79, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA2, 0xB5, +0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0x12, 0x7E, 0x8E, 0x12, 0xAC, 0xCB, 0x24, 0x71, 0xF5, +0x82, 0xE4, 0x34, 0x44, 0x12, 0x96, 0x04, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAA, 0xB9, 0x12, 0x08, +0x79, 0x77, 0x77, 0x77, 0x77, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x38, 0x07, 0x12, 0xAC, 0xCB, 0x24, +0x73, 0xF5, 0x82, 0xE4, 0x34, 0x44, 0x12, 0x96, 0x04, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAA, 0xB9, +0x12, 0x08, 0x79, 0x77, 0x77, 0x77, 0x77, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x38, 0x07, 0x12, 0xAC, +0xCB, 0x24, 0x75, 0xF5, 0x82, 0xE4, 0x34, 0x44, 0x12, 0x96, 0x04, 0xC0, 0x06, 0xC0, 0x07, 0x90, +0xAA, 0xB9, 0x12, 0x08, 0x79, 0x19, 0x79, 0x19, 0x79, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0xAC, 0xAE, +0x24, 0x8B, 0xF5, 0x82, 0xE4, 0x34, 0x44, 0x12, 0x96, 0x04, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xA2, +0xB1, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x0F, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x00, 0x00, +0x00, 0x04, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0xAC, 0xC8, 0x12, 0x9D, 0x3A, 0x12, 0x96, 0x04, 0xC0, +0x06, 0xC0, 0x07, 0x90, 0xA2, 0xB1, 0x12, 0x08, 0x79, 0x07, 0x00, 0x00, 0x00, 0x90, 0xA2, 0xB5, +0x12, 0x08, 0x79, 0x07, 0x00, 0x00, 0x00, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x7E, 0x88, 0x12, 0x08, +0x79, 0x40, 0x00, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x40, 0x00, 0x00, 0x00, 0x7F, +0xC4, 0x7E, 0x08, 0x12, 0xAC, 0xC8, 0x24, 0x79, 0xF5, 0x82, 0xE4, 0x34, 0x44, 0x12, 0x96, 0x04, +0xC0, 0x06, 0xC0, 0x07, 0x90, 0xA2, 0xB1, 0x12, 0x08, 0x79, 0x00, 0xFF, 0x00, 0x00, 0x90, 0xA2, +0xB5, 0x12, 0x08, 0x79, 0x00, 0x77, 0x00, 0x00, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0xAC, 0xC8, 0x24, +0x7B, 0xF5, 0x82, 0xE4, 0x34, 0x44, 0x12, 0x96, 0x04, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xA2, 0xB1, +0x12, 0x08, 0x79, 0x03, 0x00, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, +0x00, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0xAC, 0xC8, 0x24, 0x7D, 0xF5, 0x82, 0xE4, 0x34, 0x44, 0x12, +0x96, 0x04, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xA2, 0xB1, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0xFF, +0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x04, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x7E, +0x88, 0x12, 0x08, 0x79, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x00, 0x00, +0x00, 0x00, 0x12, 0x7E, 0x8E, 0x90, 0xA1, 0xFA, 0x12, 0x08, 0x79, 0x00, 0x08, 0x00, 0x02, 0x90, +0xA1, 0xB6, 0xE0, 0xFF, 0x7D, 0xEF, 0x12, 0xAC, 0xC1, 0x12, 0x08, 0x79, 0x00, 0x02, 0x00, 0x00, +0x12, 0xAF, 0xA6, 0x12, 0xAC, 0xC1, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x3F, 0x12, 0xAF, 0x9E, +0x12, 0xAC, 0xC1, 0x12, 0x08, 0x79, 0x00, 0x0F, 0x3F, 0xC3, 0x12, 0xAF, 0x96, 0x12, 0xAC, 0xC1, +0x12, 0x08, 0x79, 0x00, 0x09, 0x31, 0xD5, 0x12, 0xAC, 0xBA, 0x12, 0x08, 0x79, 0x00, 0x08, 0xA0, +0x01, 0x12, 0xAF, 0x60, 0x12, 0x77, 0x97, 0x90, 0xAA, 0xB9, 0x12, 0x08, 0x79, 0x00, 0x00, 0x80, +0x00, 0x7F, 0x0C, 0x7E, 0x09, 0x12, 0x76, 0xE1, 0x12, 0x08, 0x79, 0x03, 0x00, 0x01, 0x00, 0x7F, +0x00, 0x7E, 0x0B, 0x12, 0xAC, 0xAE, 0x24, 0x8D, 0xF5, 0x82, 0xE4, 0x34, 0x44, 0x12, 0x96, 0x04, +0xC0, 0x06, 0xC0, 0x07, 0x90, 0xA2, 0xB1, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x01, 0x90, 0xA2, +0xB5, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x01, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x82, 0xE4, 0x12, +0x08, 0x79, 0x29, 0x00, 0x20, 0x00, 0x7F, 0x78, 0x7E, 0x09, 0x12, 0x76, 0xE1, 0x12, 0x08, 0x79, +0xA9, 0x00, 0x20, 0x00, 0x7F, 0x7C, 0x7E, 0x09, 0x12, 0x76, 0xE1, 0x12, 0x08, 0x79, 0x00, 0x46, +0x29, 0x10, 0x12, 0x82, 0xD5, 0x12, 0x08, 0x79, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, +0x08, 0x79, 0x80, 0x00, 0x00, 0x00, 0x12, 0x7E, 0x8E, 0x90, 0xA0, 0x8E, 0xE0, 0x90, 0xA1, 0xB6, +0x30, 0xE0, 0x16, 0x12, 0xAD, 0x63, 0x12, 0x96, 0x04, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAA, 0xB9, +0x12, 0x08, 0x79, 0x82, 0x14, 0x03, 0xF7, 0x80, 0x14, 0x12, 0xAD, 0x63, 0x12, 0x96, 0x04, 0xC0, +0x06, 0xC0, 0x07, 0x90, 0xAA, 0xB9, 0x12, 0x08, 0x79, 0x82, 0x14, 0x03, 0xF1, 0xD0, 0x07, 0xD0, +0x06, 0x12, 0x38, 0x07, 0x90, 0xA0, 0x8D, 0xE0, 0x30, 0xE5, 0x19, 0x12, 0xAC, 0xB1, 0x12, 0xAE, +0x04, 0x12, 0x96, 0x04, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAA, 0xB9, 0x12, 0x08, 0x79, 0x40, 0x16, +0x3E, 0x96, 0x80, 0x1E, 0x90, 0xA0, 0x8D, 0xE0, 0x30, 0xE4, 0x1E, 0x12, 0xAC, 0xB1, 0x12, 0xAE, +0x04, 0x12, 0x96, 0x04, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAA, 0xB9, 0x12, 0x08, 0x79, 0x00, 0x16, +0x3E, 0x96, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x38, 0x07, 0x12, 0xAC, 0xB1, 0x24, 0xA3, 0xF5, 0x82, +0xE4, 0x34, 0x44, 0x12, 0x96, 0x04, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAA, 0xB9, 0x12, 0x08, 0x79, +0x18, 0x00, 0x8C, 0x10, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0xAC, 0xAE, 0x24, 0xA5, 0xF5, 0x82, 0xE4, +0x34, 0x44, 0x12, 0x96, 0x04, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAA, 0xB9, 0x12, 0x08, 0x79, 0x38, +0x00, 0x8C, 0x10, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0xAC, 0xAE, 0x24, 0x93, 0xF5, 0x82, 0xE4, 0x34, +0x44, 0x12, 0x96, 0x04, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAA, 0xB9, 0x12, 0x08, 0x79, 0x00, 0x00, +0x00, 0x00, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x38, 0x07, 0xE4, 0x90, 0xA1, 0xB7, 0xF0, 0x90, 0xA1, +0xB6, 0xE0, 0xFF, 0xE4, 0xFD, 0x12, 0x96, 0x0E, 0x90, 0xA1, 0xD7, 0x12, 0xAE, 0x94, 0x90, 0xA1, +0xB7, 0xE0, 0xFA, 0x12, 0xAD, 0x4B, 0x12, 0xAD, 0x70, 0x24, 0x21, 0xF5, 0x82, 0xE4, 0x34, 0xA2, +0xF5, 0x83, 0x12, 0x08, 0x6D, 0xEB, 0x60, 0x06, 0x90, 0xA1, 0xD3, 0xE0, 0x04, 0xF0, 0x90, 0xA1, +0xB7, 0xE0, 0x04, 0xF0, 0xE0, 0xC3, 0x94, 0x03, 0x40, 0xC4, 0x90, 0xA2, 0xB1, 0x12, 0x08, 0x79, +0x80, 0x00, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0x12, 0x7E, +0x8E, 0x90, 0xA1, 0xB6, 0xE0, 0xFF, 0x7D, 0x08, 0x12, 0x77, 0x23, 0xE4, 0xFF, 0xEE, 0x54, 0xFC, +0xFE, 0xED, 0x54, 0x0F, 0xFD, 0xE4, 0xFC, 0x90, 0xA2, 0xA3, 0x12, 0x08, 0x6D, 0x90, 0xA2, 0x9F, +0x12, 0x08, 0x79, 0x00, 0x07, 0xFE, 0x00, 0x90, 0xA1, 0xB6, 0xE0, 0xFF, 0x7D, 0x58, 0x7C, 0x00, +0x12, 0x55, 0x30, 0x90, 0xA2, 0xB1, 0x12, 0x08, 0x79, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA2, 0xB5, +0x12, 0x08, 0x79, 0x80, 0x00, 0x00, 0x00, 0x12, 0x7E, 0x8E, 0x90, 0xA1, 0xD7, 0xE0, 0x70, 0x02, +0xC1, 0x60, 0x90, 0xA2, 0xB1, 0x12, 0x08, 0x79, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, +0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0x12, 0x7E, 0x8E, 0x90, 0xA1, 0xFA, 0x12, 0x08, 0x79, 0x00, +0x08, 0x00, 0x00, 0x90, 0xA1, 0xB6, 0xE0, 0xFF, 0x7D, 0xEF, 0x12, 0xAC, 0xC1, 0x12, 0x08, 0x79, +0x00, 0x03, 0x00, 0x00, 0x12, 0xAF, 0xA6, 0x12, 0xAC, 0xC1, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, +0x2F, 0x12, 0xAF, 0x9E, 0x12, 0xAC, 0xC1, 0x12, 0x08, 0x79, 0x00, 0x0F, 0xFF, 0xBB, 0x12, 0xAF, +0x96, 0x12, 0xAC, 0xC1, 0x12, 0x08, 0x79, 0x00, 0x08, 0x80, 0x01, 0x12, 0xAF, 0x60, 0x12, 0xAC, +0xC1, 0x12, 0x08, 0x79, 0x00, 0x09, 0x31, 0xD8, 0x12, 0xAC, 0xBA, 0x12, 0x08, 0x79, 0x00, 0x00, +0x00, 0x00, 0x90, 0xA1, 0xB6, 0xE0, 0xFF, 0x7D, 0xEF, 0x12, 0x77, 0x97, 0x90, 0xA2, 0xB1, 0x12, +0x08, 0x79, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x80, 0x00, 0x00, 0x00, +0x7F, 0x78, 0x7E, 0x09, 0x12, 0x7E, 0x88, 0x12, 0x08, 0x79, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA2, +0xB5, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x7C, 0x7E, 0x09, 0x12, 0x82, 0xE4, 0x12, +0x08, 0x79, 0x00, 0x00, 0x80, 0x00, 0x7F, 0x0C, 0x7E, 0x09, 0x12, 0x76, 0xE1, 0x12, 0x08, 0x79, +0x00, 0x46, 0xA9, 0x11, 0x12, 0x82, 0xD5, 0x12, 0x08, 0x79, 0x80, 0x00, 0x00, 0x00, 0x90, 0xA2, +0xB5, 0x12, 0x08, 0x79, 0x80, 0x00, 0x00, 0x00, 0x12, 0x7E, 0x8E, 0x12, 0xAC, 0xB1, 0x24, 0xA3, +0xF5, 0x82, 0xE4, 0x34, 0x44, 0x12, 0x96, 0x04, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAA, 0xB9, 0x12, +0x08, 0x79, 0x38, 0x00, 0x8C, 0x10, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0xAC, 0xAE, 0x24, 0xA5, 0xF5, +0x82, 0xE4, 0x34, 0x44, 0x12, 0x96, 0x04, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAA, 0xB9, 0x12, 0x08, +0x79, 0x18, 0x00, 0x8C, 0x10, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0xAC, 0xAE, 0x12, 0xAD, 0x68, 0x12, +0x96, 0x04, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0xAA, 0xB9, 0x12, 0x08, 0x79, 0x02, 0x14, 0x01, 0x19, +0xD0, 0x07, 0xD0, 0x06, 0x12, 0xAC, 0xAE, 0x12, 0xAE, 0x04, 0x12, 0x96, 0x04, 0xC0, 0x06, 0xC0, +0x07, 0x90, 0xAA, 0xB9, 0x12, 0x08, 0x79, 0x28, 0x16, 0x14, 0x40, 0xD0, 0x07, 0xD0, 0x06, 0x12, +0x38, 0x07, 0xE4, 0x90, 0xA1, 0xB9, 0xF0, 0x90, 0xA2, 0xB1, 0x12, 0x08, 0x79, 0x80, 0x00, 0x00, +0x00, 0x90, 0xA2, 0xB5, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x2C, 0x12, 0x7E, 0x86, +0x12, 0x08, 0x79, 0x03, 0xFF, 0x80, 0x00, 0x90, 0xA1, 0xB9, 0xE0, 0x12, 0xAD, 0x4B, 0xF5, 0x83, +0x12, 0x9F, 0x6F, 0xE4, 0xFF, 0xEE, 0x54, 0x80, 0xFE, 0xEC, 0x54, 0x03, 0xFC, 0x12, 0x9F, 0x85, +0x7F, 0x78, 0x7E, 0x09, 0x12, 0x7E, 0x88, 0x12, 0x08, 0x79, 0x00, 0x00, 0x07, 0xFF, 0x90, 0xA1, +0xB9, 0xE0, 0x12, 0xAC, 0xDF, 0xEE, 0x54, 0x07, 0xFE, 0xE4, 0xFD, 0xFC, 0x12, 0x9F, 0x85, 0x7F, +0x78, 0x7E, 0x09, 0x12, 0x7E, 0x88, 0x12, 0x08, 0x79, 0x80, 0x00, 0x00, 0x00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, 0xF9, +0x12, 0x08, 0x79, 0x00, 0x00, 0x02, 0x00, 0x90, 0xA1, 0xFD, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, +0x00, 0x90, 0xA1, 0xB6, 0xE0, 0xFF, 0x12, 0x9F, 0x94, 0x90, 0xA1, 0xD4, 0xE0, 0x70, 0x17, 0x90, +0xA1, 0xF9, 0x12, 0x08, 0x79, 0x00, 0x00, 0x01, 0x00, 0x90, 0xA1, 0xFD, 0x12, 0x08, 0x79, 0x00, +0x00, 0x00, 0x00, 0x02, 0xA8, 0x82, 0xE4, 0x90, 0xA1, 0xB8, 0xF0, 0x90, 0xA1, 0xD4, 0x12, 0xA8, +0x98, 0xFE, 0xC3, 0x9F, 0x40, 0x03, 0x02, 0xA8, 0x5B, 0xEE, 0x04, 0x90, 0xA1, 0xBA, 0xF0, 0x90, +0xA1, 0xD4, 0x12, 0xA9, 0x35, 0x50, 0x63, 0xEE, 0x12, 0xA8, 0x8A, 0x12, 0xA9, 0x1B, 0x34, 0xA1, +0x12, 0xA8, 0xD3, 0x12, 0xA9, 0x14, 0x50, 0x4A, 0x74, 0xFF, 0x7F, 0xFC, 0x12, 0xA8, 0xED, 0x11, +0xB4, 0x40, 0x3F, 0x90, 0xA1, 0xBA, 0xE0, 0x11, 0xA0, 0x11, 0x93, 0x11, 0xA0, 0x11, 0xF4, 0x50, +0x31, 0x11, 0xAA, 0x40, 0x2D, 0x90, 0xA1, 0xBA, 0xE0, 0xFB, 0x11, 0x8A, 0xFA, 0x31, 0x1B, 0x34, +0xA1, 0x11, 0xBB, 0x90, 0xA1, 0xC3, 0x12, 0x08, 0x6D, 0x11, 0x9F, 0x12, 0x78, 0x51, 0xFF, 0xEA, +0x11, 0xA0, 0x11, 0xBB, 0x90, 0xA1, 0xC7, 0x12, 0x08, 0x6D, 0x90, 0xA1, 0xD6, 0x74, 0x01, 0xF0, +0x80, 0x08, 0x90, 0xA1, 0xBA, 0xE0, 0x04, 0xF0, 0x80, 0x95, 0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 0x95, 0xE0, 0xFD, 0xFC, 0x90, 0xA1, 0xCF, 0x12, 0x08, 0x6D, 0xE4, 0x7F, 0x04, 0xFE, 0xFD, +0xFC, 0x90, 0xA1, 0xCF, 0x12, 0x49, 0x48, 0xC3, 0x02, 0x48, 0x87, 0x25, 0xE0, 0x24, 0xEC, 0xF5, +0x82, 0xE4, 0x22, 0x12, 0x49, 0x3C, 0x90, 0xA1, 0xFD, 0x02, 0x08, 0x6D, 0x12, 0x49, 0x3C, 0x90, +0xA1, 0xF9, 0x02, 0x08, 0x6D, 0xE0, 0xFF, 0x90, 0xA1, 0xBA, 0xE0, 0xFE, 0xC3, 0x9F, 0x22, 0xC3, +0xEF, 0x9D, 0xF5, 0x56, 0xC3, 0x94, 0x08, 0x50, 0x1C, 0xE4, 0xF5, 0x57, 0x51, 0x25, 0xC0, 0x83, +0xC0, 0x82, 0x90, 0xA1, 0x47, 0xE0, 0xD0, 0x82, 0xD0, 0x83, 0x75, 0xF0, 0x03, 0x12, 0x49, 0x54, +0xE5, 0x56, 0xF0, 0x80, 0x3E, 0xE5, 0x56, 0xC3, 0x94, 0x10, 0x50, 0x09, 0x75, 0x57, 0x01, 0xE5, +0x56, 0x24, 0xF8, 0x80, 0x17, 0xE5, 0x56, 0xC3, 0x94, 0x18, 0x50, 0x09, 0x75, 0x57, 0x02, 0xE5, +0x56, 0x24, 0xF0, 0x80, 0x07, 0x75, 0x57, 0x03, 0xE5, 0x56, 0x24, 0xE8, 0xFF, 0x51, 0x25, 0xC0, +0x83, 0xC0, 0x82, 0x90, 0xA1, 0x47, 0xE0, 0xD0, 0x82, 0xD0, 0x83, 0x75, 0xF0, 0x03, 0x12, 0x49, +0x54, 0xEF, 0xF0, 0xAF, 0x57, 0x22, 0x8F, 0x54, 0x8D, 0x55, 0xAE, 0x03, 0x74, 0x1F, 0xC3, 0x95, +0x54, 0x40, 0x0F, 0x90, 0xA1, 0x47, 0xEE, 0xF0, 0xAB, 0x55, 0xE4, 0xFD, 0x51, 0x1D, 0x24, 0xD4, +0x80, 0x40, 0x74, 0x3F, 0xC3, 0x95, 0x54, 0x40, 0x0F, 0x90, 0xA1, 0x47, 0xEE, 0xF0, 0xAB, 0x55, +0x7D, 0x20, 0x51, 0x1B, 0x24, 0x88, 0x80, 0x2A, 0x74, 0x5F, 0xC3, 0x95, 0x54, 0x40, 0x0F, 0x90, +0xA1, 0x47, 0xEE, 0xF0, 0xAB, 0x55, 0x7D, 0x40, 0x51, 0x1B, 0x24, 0xD0, 0x80, 0x14, 0x74, 0x7F, +0xC3, 0x95, 0x54, 0x40, 0x25, 0x90, 0xA1, 0x47, 0xEE, 0xF0, 0xAB, 0x55, 0x7D, 0x60, 0x51, 0x1B, +0x24, 0x84, 0xFD, 0xE4, 0x34, 0x04, 0xFC, 0x75, 0xF0, 0x0E, 0xE5, 0x55, 0x51, 0x39, 0x75, 0xF0, +0x03, 0xEE, 0x12, 0x49, 0x54, 0xEC, 0xF0, 0xA3, 0xED, 0xF0, 0x22, 0xAF, 0x54, 0x31, 0x3F, 0x90, +0xA1, 0x43, 0xEF, 0xF0, 0x22, 0x75, 0xF0, 0x0E, 0xEB, 0x90, 0xA0, 0x67, 0x02, 0x49, 0x54, 0x31, +0xA6, 0xAB, 0x51, 0xAA, 0x52, 0x22, 0x75, 0xF0, 0x0E, 0x90, 0xA0, 0x65, 0x02, 0x49, 0x54, 0x7E, +0x00, 0x7F, 0x01, 0x7D, 0x00, 0x7B, 0x01, 0x7A, 0x9F, 0x79, 0x9E, 0x12, 0x08, 0xAA, 0x90, 0x9F, +0x9E, 0xE0, 0x54, 0xFD, 0xF0, 0xE4, 0x12, 0x4F, 0x40, 0xA3, 0x74, 0x0C, 0xF0, 0x22, 0x12, 0x5E, +0xC9, 0x7D, 0x23, 0x02, 0x4F, 0xEF, 0x12, 0x4C, 0x32, 0x7D, 0x24, 0x02, 0x57, 0xF3, 0x7D, 0x25, +0x02, 0x57, 0xF3, 0x51, 0xAC, 0x30, 0xE0, 0x05, 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xD0, 0xD0, +0x92, 0xAF, 0x22, 0x90, 0x06, 0x04, 0xE0, 0x44, 0x40, 0xF0, 0xE0, 0x44, 0x80, 0x22, 0x12, 0x38, +0x07, 0x90, 0xA1, 0xB6, 0xE0, 0x75, 0xF0, 0x1C, 0xA4, 0x22, 0x90, 0xA1, 0xB6, 0xE0, 0xFF, 0x7D, +0x65, 0x12, 0x77, 0x97, 0x90, 0xA1, 0xFA, 0x22, 0x12, 0x7E, 0x92, 0x90, 0xA1, 0xB6, 0xE0, 0x75, +0xF0, 0x0E, 0xA4, 0x22, 0xEB, 0x25, 0xE0, 0x24, 0xE6, 0xF5, 0x82, 0xE4, 0x34, 0xA1, 0x22, 0x25, +0xE0, 0x25, 0xE0, 0x24, 0x21, 0xF5, 0x82, 0xE4, 0x34, 0xA2, 0xF5, 0x83, 0x12, 0x49, 0x3C, 0x78, +0x10, 0x02, 0x08, 0x47, 0x25, 0xE0, 0x24, 0xE0, 0xF5, 0x82, 0xE4, 0x34, 0xA1, 0x22, 0xFE, 0xE4, +0xFD, 0xFC, 0x90, 0xA1, 0xFC, 0x12, 0x08, 0x6D, 0xE4, 0xFF, 0xFE, 0xFD, 0xFC, 0x90, 0xA1, 0xFC, +0x12, 0x49, 0x48, 0xC3, 0x02, 0x48, 0x9D, 0x7F, 0x64, 0x7E, 0x08, 0x12, 0x7E, 0x92, 0x90, 0xA2, +0xD8, 0x12, 0x49, 0x3C, 0xE4, 0xFF, 0xFE, 0xFD, 0xEC, 0x54, 0x04, 0xFC, 0x90, 0xA2, 0xB1, 0x22, +0x8F, 0x57, 0x75, 0xF0, 0x10, 0xEF, 0x90, 0x81, 0x05, 0x02, 0x49, 0x54, 0x12, 0x48, 0xCE, 0x90, +0xA1, 0xFA, 0x12, 0x08, 0x6D, 0x90, 0xA1, 0xB6, 0xE0, 0xFF, 0x22, 0x25, 0xE0, 0x25, 0xE0, 0x24, +0x15, 0xF5, 0x82, 0xE4, 0x34, 0xA2, 0x22, 0x74, 0x91, 0x25, 0x51, 0xF5, 0x82, 0xE4, 0x34, 0x9C, +0xF5, 0x83, 0x22, 0xE0, 0x75, 0xF0, 0x1C, 0xA4, 0x24, 0x8F, 0xF5, 0x82, 0xE4, 0x34, 0x44, 0x22, +0xF5, 0x83, 0x12, 0x08, 0x6D, 0x90, 0xA2, 0x49, 0x12, 0x49, 0x3C, 0xEA, 0x25, 0xE0, 0x25, 0xE0, +0x22, 0xFD, 0x7C, 0x00, 0x12, 0x07, 0x03, 0xEF, 0x25, 0x55, 0xF5, 0x55, 0xEE, 0x35, 0x54, 0xF5, +0x54, 0x22, 0xE5, 0x51, 0x25, 0xE0, 0x24, 0x01, 0xF5, 0x82, 0xE4, 0x34, 0x92, 0xF5, 0x83, 0xE0, +0x22, 0x2F, 0xF5, 0x82, 0x74, 0x01, 0x3E, 0xF5, 0x83, 0xE0, 0xFF, 0x90, 0x9E, 0xF0, 0xE0, 0x22, +0xE0, 0x54, 0xFE, 0x4E, 0xFE, 0xF0, 0xEF, 0x54, 0x02, 0xFF, 0xEE, 0x54, 0xFD, 0x4F, 0x22, 0x7E, +0x00, 0x7F, 0x04, 0x7D, 0x00, 0x7B, 0x01, 0x7A, 0xA0, 0x79, 0x52, 0x22, 0xE0, 0x90, 0x01, 0xBA, +0xF0, 0x90, 0x9F, 0xA9, 0xE0, 0x90, 0x01, 0xBB, 0x22, 0x90, 0xA0, 0x6F, 0x12, 0x49, 0x54, 0xE0, +0xFF, 0x7E, 0x00, 0x7D, 0x01, 0x22, 0x12, 0x49, 0x48, 0x02, 0x48, 0x6D, 0x90, 0x01, 0x34, 0x74, +0x40, 0xF0, 0xFD, 0xE4, 0xFF, 0x02, 0x70, 0xD6, 0x7F, 0x00, 0x7E, 0x0C, 0x12, 0x38, 0x07, 0x7F, +0x00, 0x7E, 0x0E, 0x22, 0x24, 0x91, 0xF5, 0x82, 0xE4, 0x34, 0x44, 0x22, 0x12, 0x49, 0x54, 0xE0, +0xFC, 0xA3, 0xE0, 0xF5, 0x82, 0x8C, 0x83, 0x22, 0x25, 0xE0, 0x25, 0xE0, 0x24, 0x2D, 0xF5, 0x82, +0xE4, 0x34, 0xA2, 0x22, 0x90, 0xA2, 0xFB, 0xE0, 0x24, 0x11, 0xF5, 0x82, 0xE4, 0x34, 0x9E, 0x22, +0x74, 0x01, 0x25, 0x51, 0xF5, 0x82, 0xE4, 0x34, 0x94, 0xF5, 0x83, 0x22, 0x74, 0x91, 0x25, 0x51, +0xF5, 0x82, 0xE4, 0x34, 0x9A, 0xF5, 0x83, 0x22, 0x90, 0x04, 0xA0, 0xE0, 0xFF, 0xA3, 0xE0, 0xFE, +0xEF, 0x64, 0x01, 0x22, 0xEF, 0x13, 0x13, 0x13, 0x54, 0x1F, 0xFE, 0xEF, 0x54, 0x07, 0xFF, 0x22, +0xF0, 0x90, 0x9F, 0xB3, 0xA3, 0xE0, 0x90, 0x05, 0x58, 0xF0, 0x22, 0xF5, 0x83, 0x12, 0x49, 0x3C, +0x78, 0x11, 0x02, 0x08, 0x47, 0x12, 0x06, 0xA2, 0xFF, 0x12, 0x06, 0x89, 0x54, 0x0F, 0xFD, 0x22, +0x90, 0xA0, 0x60, 0xE0, 0xFE, 0xC3, 0x13, 0x54, 0x07, 0x22, 0x90, 0xA3, 0x0A, 0xE0, 0xFF, 0x90, +0xA3, 0x08, 0xE0, 0x22, 0xEF, 0xF0, 0xFB, 0x90, 0xA2, 0x45, 0x02, 0x49, 0x3C, 0x90, 0xA2, 0xFF, +0xE0, 0xFF, 0x74, 0x64, 0xD3, 0x9F, 0x22, 0x90, 0xA2, 0xFF, 0xE0, 0xFF, 0x74, 0x24, 0xD3, 0x9F, +0x22, 0x90, 0xA1, 0x42, 0x12, 0x49, 0x60, 0x75, 0xF0, 0x02, 0x22, 0xD3, 0xE5, 0x57, 0x94, 0xE8, +0xE5, 0x56, 0x94, 0x03, 0x22, 0xD3, 0x9F, 0xEE, 0x64, 0x80, 0xF8, 0x74, 0x80, 0x98, 0x22, 0x74, +0x01, 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A3, 0x02, 0xF0, 0x22, 0x90, 0xA1, +0xB9, 0xE0, 0x04, 0xF0, 0xE0, 0x22, 0x90, 0xA1, 0xB6, 0xE0, 0xFF, 0x7D, 0x32, 0x22, 0x90, 0xA1, +0xB6, 0xE0, 0xFF, 0x7D, 0x31, 0x22, 0x90, 0xA1, 0xB6, 0xE0, 0xFF, 0x7D, 0x30, 0x22, 0x7F, 0x01, +0x7E, 0x00, 0x02, 0x3C, 0xEC, 0x7F, 0x60, 0x7E, 0x08, 0x02, 0x7E, 0x92, 0x74, 0x01, 0x7E, 0x00, +0xA8, 0x6C, 0x08, 0x22, 0x54, 0x03, 0x4F, 0xFF, 0x75, 0xF0, 0x10, 0x22, 0xFF, 0x12, 0x06, 0x89, +0xFE, 0x54, 0x0F, 0x22, 0x92, 0x4A, +}; +u4Byte ArrayLength_MP_8821A_FW_NIC = 28662; + + +void +ODM_ReadFirmware_MP_8821A_FW_NIC( + IN PDM_ODM_T pDM_Odm, + OUT u1Byte *pFirmware, + OUT u4Byte *pFirmwareSize +) +{ +#if (DM_ODM_SUPPORT_TYPE & (ODM_CE)) + *((SIZE_PTR *)pFirmware) = (SIZE_PTR)Array_MP_8821A_FW_NIC; +#else + ODM_MoveMemory(pDM_Odm, pFirmware, Array_MP_8821A_FW_NIC, ArrayLength_MP_8821A_FW_NIC); +#endif + *pFirmwareSize = ArrayLength_MP_8821A_FW_NIC; +} + + +u1Byte Array_MP_8821A_FW_NIC_BT[] = { +0x01, 0x21, 0x13, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x09, 0x05, 0x15, 0x19, 0x8A, 0x69, 0x00, 0x00, +0xD0, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x02, 0x48, 0x6D, 0x02, 0x67, 0xEF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x02, 0x68, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x02, 0x78, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x02, 0x67, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x70, 0x0D, 0x00, 0x00, +0x00, 0x00, 0x00, 0x02, 0x78, 0x06, 0x15, 0xF0, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x15, 0xF0, 0x0F, +0x00, 0x00, 0x00, 0x00, 0x05, 0xF0, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x05, 0xF0, 0x0F, 0x00, 0x00, +0x00, 0x00, 0x10, 0xF0, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x10, 0xF0, 0x0F, 0x00, 0x00, 0x00, 0x00, +0xF5, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xF0, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x10, 0xF0, 0x3F, 0x00, +0x00, 0x00, 0x00, 0x15, 0xF0, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x15, 0xF0, 0xCF, 0xFF, 0x00, 0x00, +0x00, 0x0A, 0x08, 0x03, 0x03, 0x00, 0x04, 0x09, 0x07, 0x03, 0x03, 0x00, 0x04, 0x08, 0x06, 0x03, +0x02, 0x00, 0x04, 0x08, 0x05, 0x03, 0x01, 0x00, 0x04, 0x0D, 0x0A, 0x07, 0x05, 0x00, 0x08, 0x0C, +0x0A, 0x07, 0x04, 0x00, 0x08, 0x0B, 0x0A, 0x06, 0x05, 0x00, 0x08, 0x0B, 0x0A, 0x05, 0x03, 0x00, +0x08, 0x0B, 0x0A, 0x03, 0x02, 0x00, 0x08, 0x14, 0x12, 0x0C, 0x04, 0x00, 0x10, 0x14, 0x12, 0x09, +0x04, 0x00, 0x10, 0x24, 0x22, 0x1C, 0x12, 0x00, 0x20, 0x24, 0x22, 0x18, 0x0C, 0x00, 0x20, 0x24, +0x22, 0x14, 0x06, 0x00, 0x20, 0x24, 0x22, 0x0F, 0x04, 0x00, 0x20, 0x24, 0x21, 0x0A, 0x04, 0x00, +0x20, 0x23, 0x21, 0x0C, 0x04, 0x00, 0x20, 0x23, 0x1F, 0x0A, 0x04, 0x00, 0x20, 0x22, 0x1F, 0x0F, +0x04, 0x00, 0x20, 0x21, 0x1F, 0x16, 0x0C, 0x00, 0x20, 0x31, 0x2F, 0x20, 0x14, 0x00, 0x30, 0x31, +0x2F, 0x18, 0x10, 0x00, 0x30, 0x31, 0x2C, 0x18, 0x0C, 0x00, 0x30, 0x31, 0x2A, 0x14, 0x0C, 0x00, +0x30, 0x31, 0x28, 0x14, 0x00, 0x00, 0x30, 0x31, 0x24, 0x14, 0x00, 0x00, 0x30, 0x31, 0x1E, 0x14, +0x00, 0x00, 0x30, 0x04, 0x04, 0x04, 0x05, 0x04, 0x04, 0x05, 0x07, 0x07, 0x07, 0x08, 0x0A, 0x04, +0x07, 0x0A, 0x0E, 0x11, 0x13, 0x14, 0x15, 0x03, 0x04, 0x07, 0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x05, +0x05, 0x07, 0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x05, 0x05, 0x07, 0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x07, +0x08, 0x08, 0x0A, 0x0A, 0x0C, 0x0E, 0x10, 0x11, 0x11, 0x07, 0x09, 0x09, 0x0B, 0x0B, 0x0D, 0x0F, +0x13, 0x13, 0x14, 0x05, 0x05, 0x07, 0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x0F, 0x0F, 0x05, 0x05, 0x07, +0x07, 0x08, 0x0B, 0x0D, 0x0F, 0x0F, 0x0F, 0x04, 0x04, 0x04, 0x05, 0x07, 0x07, 0x09, 0x09, 0x0C, +0x0E, 0x10, 0x12, 0x05, 0x06, 0x07, 0x0D, 0x10, 0x11, 0x12, 0x12, 0x07, 0x08, 0x09, 0x09, 0x0C, +0x0E, 0x11, 0x13, 0x09, 0x09, 0x09, 0x09, 0x0C, 0x0E, 0x11, 0x13, 0x09, 0x09, 0x09, 0x09, 0x0C, +0x0E, 0x11, 0x13, 0x05, 0x06, 0x08, 0x09, 0x0C, 0x0E, 0x12, 0x12, 0x13, 0x14, 0x07, 0x08, 0x09, +0x0A, 0x0C, 0x0F, 0x12, 0x12, 0x14, 0x16, 0x09, 0x09, 0x09, 0x09, 0x0C, 0x0E, 0x11, 0x13, 0x13, +0x13, 0x09, 0x09, 0x09, 0x09, 0x0C, 0x0E, 0x11, 0x13, 0x13, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x24, 0x26, 0x2A, 0x00, 0x00, 0x00, 0x1F, 0x21, 0x25, 0x27, 0x28, 0x00, +0x00, 0x00, 0x00, 0x23, 0x26, 0x28, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x23, 0x26, 0x28, 0x2A, 0x00, +0x00, 0x00, 0x00, 0x23, 0x26, 0x28, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x20, 0x25, 0x27, 0x29, 0x29, +0x2A, 0x00, 0x00, 0x00, 0x00, 0x20, 0x25, 0x27, 0x29, 0x29, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x23, +0x26, 0x28, 0x2A, 0x2A, 0x2A, 0x00, 0x00, 0x00, 0x1F, 0x23, 0x26, 0x28, 0x2A, 0x2A, 0x2A, 0x00, +0x04, 0x00, 0x04, 0x00, 0x08, 0x00, 0x10, 0x00, 0x18, 0x00, 0x24, 0x00, 0x30, 0x00, 0x48, 0x00, +0x60, 0x00, 0x90, 0x00, 0xC0, 0x00, 0xD8, 0x00, 0x3C, 0x00, 0x64, 0x00, 0x78, 0x00, 0xA0, 0x00, +0xF0, 0x01, 0x40, 0x01, 0x90, 0x01, 0xE0, 0x00, 0xA0, 0x00, 0xF0, 0x01, 0x40, 0x01, 0x90, 0x02, +0x58, 0x03, 0x20, 0x04, 0xB0, 0x06, 0x40, 0x00, 0xC8, 0x01, 0x18, 0x01, 0xE0, 0x02, 0xD0, 0x03, +0xE8, 0x04, 0xB0, 0x06, 0x40, 0x07, 0xD0, 0x00, 0xC8, 0x01, 0x18, 0x01, 0xE0, 0x02, 0xD0, 0x03, +0xE8, 0x04, 0xB0, 0x06, 0x40, 0x07, 0xD0, 0x00, 0x3C, 0x00, 0x50, 0x00, 0x64, 0x00, 0xA0, 0x00, +0xF0, 0x01, 0x40, 0x01, 0x90, 0x01, 0xE0, 0x02, 0x58, 0x03, 0x20, 0x00, 0x78, 0x00, 0xF0, 0x01, +0x90, 0x02, 0x58, 0x03, 0xE8, 0x07, 0xD0, 0x09, 0x60, 0x0F, 0xA0, 0x12, 0xC0, 0x15, 0x18, 0x00, +0xC8, 0x01, 0x18, 0x01, 0xE0, 0x02, 0xD0, 0x03, 0xE8, 0x04, 0xB0, 0x06, 0x40, 0x07, 0xD0, 0x07, +0xD0, 0x07, 0xD0, 0x00, 0xC8, 0x01, 0x18, 0x01, 0xE0, 0x02, 0xD0, 0x03, 0xE8, 0x04, 0xB0, 0x06, +0x40, 0x07, 0xD0, 0x07, 0xD0, 0x07, 0xD0, 0x00, 0x02, 0x00, 0x02, 0x00, 0x04, 0x00, 0x08, 0x00, +0x0C, 0x00, 0x12, 0x00, 0x18, 0x00, 0x24, 0x00, 0x30, 0x00, 0x48, 0x00, 0x60, 0x00, 0x6C, 0x00, +0x14, 0x00, 0x32, 0x00, 0x3C, 0x00, 0x50, 0x00, 0x78, 0x00, 0xA0, 0x00, 0xC8, 0x00, 0xF0, 0x00, +0x50, 0x00, 0x78, 0x00, 0xA0, 0x00, 0xC8, 0x01, 0x2C, 0x01, 0x90, 0x02, 0x58, 0x03, 0x20, 0x00, +0x64, 0x00, 0x8C, 0x00, 0xF0, 0x01, 0x68, 0x01, 0xF4, 0x02, 0x58, 0x03, 0x20, 0x03, 0xE8, 0x00, +0x64, 0x00, 0x8C, 0x00, 0xF0, 0x01, 0x68, 0x01, 0xF4, 0x02, 0x58, 0x03, 0x20, 0x03, 0xE8, 0x00, +0x1E, 0x00, 0x28, 0x00, 0x32, 0x00, 0x50, 0x00, 0x78, 0x00, 0xA0, 0x00, 0xC8, 0x00, 0xF0, 0x01, +0x2C, 0x01, 0x90, 0x00, 0x3C, 0x00, 0x78, 0x00, 0xC8, 0x01, 0x2C, 0x01, 0xF4, 0x03, 0xE8, 0x04, +0xB0, 0x07, 0xD0, 0x09, 0x60, 0x0A, 0xF0, 0x00, 0x64, 0x00, 0x8C, 0x00, 0xF0, 0x01, 0x68, 0x01, +0xF4, 0x02, 0x58, 0x03, 0x20, 0x03, 0xE8, 0x03, 0xE8, 0x03, 0xE8, 0x00, 0x64, 0x00, 0x8C, 0x00, +0xF0, 0x01, 0x68, 0x01, 0xF4, 0x02, 0x58, 0x03, 0x20, 0x03, 0xE8, 0x03, 0xE8, 0x03, 0xE8, 0x02, +0x04, 0x06, 0x08, 0x0A, 0x0C, 0x10, 0x18, 0x20, 0x30, 0x40, 0x50, 0x01, 0x01, 0x01, 0x02, 0x01, +0x02, 0x03, 0x03, 0x04, 0x04, 0x05, 0x05, 0x02, 0x04, 0x06, 0x07, 0x07, 0x08, 0x08, 0x08, 0x02, +0x02, 0x03, 0x03, 0x05, 0x05, 0x06, 0x06, 0x05, 0x06, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0A, 0x05, +0x06, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0A, 0x05, 0x06, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0A, 0x0A, +0x0B, 0x05, 0x06, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0B, 0x05, 0x06, 0x06, 0x07, 0x07, +0x08, 0x09, 0x0A, 0x0A, 0x0B, 0x05, 0x06, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0A, 0x0A, 0x0B, 0x01, +0x01, 0x01, 0x01, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x01, 0x02, 0x03, 0x04, 0x05, +0x06, 0x07, 0x08, 0x02, 0x04, 0x06, 0x07, 0x08, 0x0A, 0x0B, 0x0C, 0x03, 0x05, 0x06, 0x07, 0x08, +0x0A, 0x0B, 0x0C, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x02, 0x04, 0x06, 0x07, 0x08, +0x09, 0x0B, 0x0C, 0x0C, 0x0C, 0x03, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0B, 0x0C, 0x0C, 0x0C, 0x05, +0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0C, 0x0C, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, +0x0C, 0x0C, 0x0C, 0x19, 0x06, 0x04, 0x02, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0xC2, 0xAF, 0x80, 0xFE, 0x32, 0x12, 0x45, 0xC4, 0x85, 0xD0, 0x0B, 0x75, 0xD0, 0x08, 0xAA, 0xE0, +0xC2, 0x8C, 0xE5, 0x8A, 0x24, 0x67, 0xF5, 0x8A, 0xE5, 0x8C, 0x34, 0x79, 0xF5, 0x8C, 0xD2, 0x8C, +0xEC, 0x24, 0x87, 0xF8, 0xE6, 0xBC, 0x02, 0x02, 0x74, 0xFF, 0xC3, 0x95, 0x81, 0xB4, 0x40, 0x00, +0x40, 0xCE, 0x79, 0x03, 0x78, 0x80, 0x16, 0xE6, 0x08, 0x70, 0x0B, 0xC2, 0xAF, 0xE6, 0x30, 0xE1, +0x03, 0x44, 0x18, 0xF6, 0xD2, 0xAF, 0x08, 0xD9, 0xED, 0xEA, 0x8B, 0xD0, 0x22, 0xE5, 0x0C, 0xFF, +0x23, 0x24, 0x81, 0xF8, 0x0F, 0x08, 0x08, 0xBF, 0x03, 0x04, 0x7F, 0x00, 0x78, 0x81, 0xE6, 0x30, +0xE4, 0xF2, 0x00, 0xE5, 0x0C, 0xC3, 0x9F, 0x50, 0x20, 0x05, 0x0C, 0x74, 0x86, 0x25, 0x0C, 0xF8, +0xE6, 0xFD, 0xA6, 0x81, 0x08, 0xE6, 0xAE, 0x0C, 0xBE, 0x02, 0x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9F, 0x50, 0x21, 0x0E, 0x74, 0x86, 0x2E, 0xF8, 0xE6, 0xF9, 0x08, 0xE6, 0x18, +0xBE, 0x02, 0x02, 0x74, 0xFF, 0xFD, 0xED, 0x69, 0x60, 0x09, 0x09, 0xE7, 0x19, 0x19, 0xF7, 0x09, +0x09, 0x80, 0xF3, 0x16, 0x16, 0x80, 0xDA, 0xEE, 0xD3, 0x9F, 0x40, 0x04, 0x05, 0x81, 0x05, 0x81, +0xEE, 0xD3, 0x9F, 0x40, 0x22, 0x74, 0x86, 0x2E, 0xF8, 0x08, 0xE6, 0xF9, 0xEE, 0xB5, 0x0C, 0x02, +0xA9, 0x81, 0x18, 0x06, 0x06, 0xE6, 0xFD, 0xED, 0x69, 0x60, 0x09, 0x19, 0x19, 0xE7, 0x09, 0x09, +0xF7, 0x19, 0x80, 0xF3, 0x1E, 0x80, 0xD9, 0xEF, 0x24, 0x86, 0xF8, 0xE6, 0x04, 0xF8, 0xEF, 0x2F, +0x04, 0x90, 0x49, 0x86, 0x93, 0xF6, 0x08, 0xEF, 0x2F, 0x93, 0xF6, 0x7F, 0x00, 0x22, 0xEF, 0xD3, +0x94, 0x02, 0x40, 0x03, 0x7F, 0xFF, 0x22, 0xEF, 0x23, 0x24, 0x81, 0xF8, 0xE6, 0x30, 0xE5, 0xF4, +0xC2, 0xAF, 0xE6, 0x54, 0x8C, 0xF6, 0xD2, 0xAF, 0xE5, 0x0C, 0xB5, 0x07, 0x0A, 0x74, 0x86, 0x2F, +0xF8, 0xE6, 0xF5, 0x81, 0x02, 0x46, 0x0D, 0x50, 0x2E, 0x74, 0x87, 0x2F, 0xF8, 0xE6, 0xBF, 0x02, +0x02, 0x74, 0xFF, 0xFD, 0x18, 0xE6, 0xF9, 0x74, 0x86, 0x2F, 0xF8, 0xFB, 0xE6, 0xFC, 0xE9, 0x6C, +0x60, 0x08, 0xA8, 0x05, 0xE7, 0xF6, 0x1D, 0x19, 0x80, 0xF4, 0xA8, 0x03, 0xA6, 0x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 0xFA, 0xA3, 0xE0, +0xFB, 0x22, 0xA4, 0x25, 0x82, 0xF5, 0x82, 0xE5, 0xF0, 0x35, 0x83, 0xF5, 0x83, 0x22, 0xE0, 0xFB, +0xA3, 0xE0, 0xFA, 0xA3, 0xE0, 0xF9, 0x22, 0xEB, 0xF0, 0xA3, 0xEA, 0xF0, 0xA3, 0xE9, 0xF0, 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, 0x41, 0xA1, 0xCC, 0x00, 0x41, 0xA1, 0xCD, 0x00, 0x41, 0xA1, +0xCE, 0x00, 0x41, 0xA1, 0xD2, 0x00, 0x01, 0x72, 0x00, 0x41, 0xA1, 0xD3, 0x00, 0x41, 0xA1, 0xD4, +0x00, 0x41, 0xA1, 0xF0, 0x00, 0x00, 0x4B, 0xBC, 0x58, 0x06, 0x60, 0x80, 0xE4, 0xFD, 0x7F, 0x8D, +0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x8F, 0x82, 0x75, 0x83, 0x00, 0xED, 0x12, 0xA9, 0x57, +0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xB1, 0xD3, 0x20, 0xE6, +0x02, 0x41, 0x60, 0x90, 0x00, 0x8C, 0xE0, 0xF5, 0x70, 0x7F, 0x8D, 0x51, 0xB8, 0x90, 0x00, 0x8E, +0xE0, 0xF5, 0x71, 0xEF, 0x24, 0xFC, 0x60, 0x0C, 0x24, 0x03, 0x60, 0x02, 0x41, 0x59, 0xAF, 0x70, +0x91, 0x21, 0x41, 0x59, 0x74, 0x11, 0x25, 0x70, 0x12, 0x56, 0xA8, 0xE0, 0xFB, 0xE4, 0xFD, 0x51, +0x99, 0xD1, 0x2B, 0x13, 0x13, 0x51, 0x94, 0xD1, 0x2B, 0x12, 0x76, 0xBF, 0x51, 0x96, 0xD1, 0x2B, +0xC4, 0x51, 0x94, 0x12, 0x6F, 0x7E, 0xE0, 0xFB, 0xE4, 0xFD, 0x0F, 0x51, 0x9A, 0xF1, 0xEE, 0xE0, +0xFB, 0x0D, 0x51, 0x9A, 0xF1, 0xA1, 0xC4, 0x13, 0x54, 0x01, 0xFB, 0x0D, 0x7F, 0x01, 0x51, 0x9A, +0xF1, 0xA1, 0x54, 0x1F, 0x51, 0x8C, 0xE5, 0x70, 0x90, 0x89, 0x00, 0x12, 0xA9, 0x3C, 0x51, 0x8E, +0xE5, 0x70, 0x90, 0x89, 0x01, 0x51, 0x89, 0xE5, 0x70, 0x90, 0x89, 0x02, 0x51, 0x89, 0xE5, 0x70, +0x90, 0x89, 0x03, 0x51, 0x89, 0xE5, 0x70, 0x90, 0x89, 0x04, 0x12, 0xA9, 0x3C, 0x51, 0x8E, 0xE5, +0x70, 0x90, 0x89, 0x05, 0x51, 0x89, 0xE5, 0x70, 0x90, 0x89, 0x06, 0x51, 0x89, 0xE5, 0x70, 0x90, +0x89, 0x07, 0x31, 0x22, 0xE0, 0xFB, 0x0D, 0x51, 0x65, 0xB1, 0xD3, 0x30, 0xE0, 0x02, 0x31, 0x8C, +0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xEF, 0x70, 0x04, 0x74, 0xF0, 0x80, 0x16, 0xEF, 0xB4, 0x01, 0x04, +0x74, 0xF4, 0x80, 0x0E, 0xEF, 0xB4, 0x02, 0x04, 0x74, 0xF8, 0x80, 0x06, 0xEF, 0xB4, 0x03, 0x08, +0x74, 0xFC, 0x2D, 0x12, 0x94, 0xD4, 0xEB, 0xF0, 0x22, 0x31, 0x22, 0xE0, 0xFB, 0x0D, 0x51, 0x65, +0x75, 0xF0, 0x08, 0x22, 0x54, 0x03, 0xFB, 0x0D, 0xE4, 0xFF, 0x51, 0x65, 0x75, 0xF0, 0x04, 0xE5, +0x70, 0x22, 0xEF, 0x54, 0xFE, 0xFD, 0x7F, 0x02, 0x31, 0x90, 0x7F, 0x02, 0x51, 0xB8, 0xEF, 0x44, +0x01, 0xFD, 0x7F, 0x02, 0x31, 0x90, 0x7F, 0x02, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x8F, +0x82, 0x75, 0x83, 0x00, 0xE0, 0x90, 0xA1, 0xE6, 0x12, 0xA9, 0x57, 0x90, 0xA1, 0xE6, 0xE0, 0xFF, +0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x7F, 0xFF, 0x12, 0x57, 0x8F, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, +0xD0, 0x12, 0x77, 0x42, 0x7F, 0x00, 0x7E, 0x0C, 0x12, 0x37, 0xBC, 0xEF, 0x54, 0xFC, 0xB1, 0x20, +0x12, 0xA8, 0xE5, 0x12, 0x37, 0xBC, 0xEF, 0x54, 0xFC, 0xB1, 0x20, 0x7F, 0x00, 0x7E, 0x0E, 0xF1, +0xE2, 0x51, 0xA2, 0x51, 0xA2, 0xEF, 0x54, 0xFE, 0xFD, 0x7F, 0x02, 0x31, 0x90, 0x12, 0xA9, 0x45, +0x44, 0x40, 0xB1, 0x20, 0x7F, 0xB4, 0x7E, 0x08, 0x12, 0x38, 0x07, 0x90, 0x01, 0x00, 0x74, 0x3F, +0xF0, 0xA3, 0xE0, 0x54, 0xFD, 0xF0, 0x90, 0x05, 0x53, 0xE0, 0x44, 0x20, 0x12, 0x80, 0xD6, 0x30, +0xE0, 0x05, 0x7F, 0x01, 0x12, 0x76, 0xC6, 0x12, 0x8F, 0x7F, 0x30, 0xE0, 0x32, 0x90, 0xA0, 0xA0, +0xE0, 0x60, 0x08, 0x90, 0xA1, 0xA0, 0x74, 0x01, 0xF0, 0x80, 0x05, 0xE4, 0x90, 0xA1, 0xA0, 0xF0, +0xEF, 0xC4, 0x13, 0x54, 0x07, 0x30, 0xE0, 0x07, 0xE4, 0x90, 0xA1, 0xA1, 0xF0, 0x80, 0x06, 0x90, +0xA1, 0xA1, 0x74, 0x02, 0xF0, 0x90, 0xA1, 0xA0, 0xB1, 0x33, 0x7F, 0x01, 0x12, 0x76, 0xC6, 0x90, +0xA0, 0x4F, 0xE0, 0x60, 0x02, 0xE4, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x7F, 0x54, 0x51, 0xB8, +0xE5, 0x0D, 0x5F, 0xF5, 0x11, 0x7F, 0x55, 0x51, 0xB8, 0xE5, 0x0E, 0x5F, 0xF5, 0x12, 0x7F, 0x56, +0x51, 0xB8, 0xE5, 0x0F, 0x5F, 0xF5, 0x13, 0x7F, 0x57, 0x51, 0xB8, 0xE5, 0x10, 0x5F, 0xF5, 0x14, +0xAD, 0x11, 0x7F, 0x54, 0x31, 0x90, 0xAD, 0x12, 0x7F, 0x55, 0x31, 0x90, 0xAD, 0x13, 0x7F, 0x56, +0x31, 0x90, 0xAD, 0x14, 0x7F, 0x57, 0x31, 0x90, 0x53, 0x91, 0xEF, 0x22, 0x7F, 0x81, 0x51, 0xB8, +0xEF, 0x54, 0xFE, 0xFD, 0x7F, 0x81, 0x31, 0x90, 0x7F, 0x80, 0x12, 0x68, 0x4C, 0x7F, 0x80, 0x31, +0x90, 0x12, 0x94, 0xDC, 0x12, 0x3D, 0x3B, 0x12, 0x94, 0xE9, 0x12, 0x98, 0x13, 0x7F, 0x01, 0x12, +0x46, 0xD5, 0x90, 0xA0, 0xC0, 0x74, 0x02, 0xF0, 0xFF, 0x12, 0x46, 0xD5, 0x90, 0xA0, 0xC0, 0xE0, +0x04, 0xF0, 0x12, 0x60, 0x0E, 0x12, 0x89, 0x39, 0x7F, 0x80, 0x51, 0xB8, 0xEF, 0x44, 0x40, 0xFD, +0x7F, 0x80, 0x31, 0x90, 0x75, 0x28, 0xFF, 0x12, 0x60, 0x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xE5, 0x27, 0x70, 0x09, +0xF1, 0x94, 0xEF, 0x44, 0x77, 0xFF, 0xEC, 0x80, 0x21, 0xF1, 0x94, 0xEF, 0x44, 0x66, 0xFF, 0xEC, +0xB1, 0xCD, 0xB1, 0xC4, 0x90, 0xA0, 0xA0, 0xE0, 0x90, 0xA1, 0xB4, 0x60, 0x07, 0x31, 0x0A, 0xEC, +0x44, 0x10, 0x80, 0x05, 0x31, 0x0A, 0xEC, 0x44, 0x20, 0xFC, 0xB1, 0xCD, 0xE5, 0x26, 0xB4, 0x02, +0x06, 0xE5, 0x27, 0x64, 0x02, 0x60, 0x08, 0x90, 0xA1, 0xB4, 0xB1, 0x2B, 0x12, 0x90, 0xA8, 0xD0, +0xD0, 0x92, 0xAF, 0x22, 0x90, 0xA1, 0xB4, 0x31, 0x0A, 0xEC, 0x54, 0xCF, 0xFC, 0x90, 0xA1, 0xB4, +0x02, 0x08, 0x6D, 0x7F, 0x8F, 0x51, 0xB8, 0xEF, 0x22, 0x90, 0x9F, 0xA4, 0xE0, 0x44, 0x10, 0xF0, +0x90, 0x9F, 0xB2, 0xE0, 0xFD, 0x7F, 0x93, 0x31, 0x90, 0x90, 0x9F, 0xA8, 0xE0, 0x60, 0x12, 0x90, +0x01, 0x2F, 0xE0, 0x30, 0xE7, 0x05, 0x74, 0x10, 0xF0, 0x80, 0x06, 0x90, 0x01, 0x2F, 0x74, 0x90, +0xF0, 0x7F, 0x08, 0x51, 0xB8, 0xEF, 0x44, 0x10, 0xFD, 0x7F, 0x08, 0x31, 0x90, 0x7F, 0x01, 0x12, +0x78, 0xBD, 0x7F, 0x90, 0x51, 0xB8, 0xEF, 0x44, 0x01, 0xFD, 0x7F, 0x90, 0x31, 0x90, 0x7F, 0x14, +0x7E, 0x00, 0x02, 0x3D, 0x7A, 0xFF, 0x75, 0xF0, 0x04, 0xE5, 0x51, 0x90, 0x96, 0x14, 0x31, 0x22, +0xE0, 0x22, 0xE4, 0xFF, 0xE4, 0xFE, 0x74,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xF0, 0x75, +0xF0, 0x04, 0xEF, 0xD1, 0x2B, 0x44, 0x40, 0xF0, 0x75, 0xF0, 0x04, 0xEF, 0xD1, 0x2B, 0x54, 0x7F, +0xF1, 0xE9, 0xE0, 0xFE, 0x75, 0xF0, 0x10, 0xEF, 0x12, 0x57, 0x73, 0xEE, 0xF0, 0x74, 0x91, 0x2F, +0x12, 0x7E, 0x03, 0xE4, 0xF0, 0x0F, 0xEF, 0x64, 0x80, 0x60, 0x02, 0xC1, 0x79, 0x90, 0x04, 0x49, +0x74, 0xF0, 0xF0, 0xA3, 0xE4, 0xF0, 0xA3, 0x74, 0xFF, 0xF0, 0x90, 0x04, 0x33, 0x74, 0x02, 0xF0, +0xA3, 0x74, 0x04, 0xF0, 0xA3, 0x04, 0xF0, 0xA3, 0x04, 0xF0, 0xA3, 0x04, 0xF0, 0x74, 0x11, 0x2F, +0x12, 0xA0, 0x54, 0x74, 0xFF, 0xF0, 0x22, 0x90, 0x01, 0x30, 0xF1, 0x8B, 0x90, 0x01, 0x38, 0xF1, +0x8C, 0xFD, 0x7F, 0x50, 0x31, 0x90, 0xE4, 0xFD, 0x7F, 0x51, 0x31, 0x90, 0xE4, 0xFD, 0x7F, 0x52, +0x31, 0x90, 0xE4, 0xFD, 0x7F, 0x53, 0x21, 0x90, 0x90, 0x01, 0x34, 0x74, 0xFF, 0xF1, 0x8C, 0x90, +0x01, 0x3C, 0xF1, 0x8C, 0xFD, 0x7F, 0x54, 0x31, 0x90, 0x7D, 0xFF, 0x7F, 0x55, 0x31, 0x90, 0x7D, +0xFF, 0x7F, 0x56, 0x31, 0x90, 0x7D, 0xFF, 0x7F, 0x57, 0x21, 0x90, 0xE4, 0xF0, 0xA3, 0xF0, 0xA3, +0xF0, 0xA3, 0xF0, 0x22, 0x90, 0xA1, 0xB4, 0x21, 0x0A, 0x75, 0x60, 0x3E, 0x75, 0xF0, 0x04, 0xE5, +0x5E, 0x90, 0x96, 0x13, 0x31, 0x22, 0xE0, 0x22, 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, +0x26, 0xFF, 0x13, 0x13, 0x54, 0x03, 0x90, 0xA0, 0xD5, 0xF0, 0xD1, 0x74, 0xE0, 0xC3, 0x94, 0x05, +0x40, 0x02, 0x81, 0x93, 0x90, 0xA0, 0xD4, 0xE0, 0xFF, 0xE5, 0x53, 0x9F, 0x40, 0x08, 0x8F, 0x53, +0x53, 0x52, 0x80, 0xEF, 0x42, 0x52, 0xE5, 0x53, 0x90, 0x41, 0xFB, 0x93, 0xFF, 0xD1, 0xA4, 0xE0, +0xC3, 0x9F, 0xE5, 0x53, 0x40, 0x05, 0x90, 0x41, 0x53, 0x80, 0x03, 0x90, 0x41, 0xA7, 0x93, 0xF5, +0x58, 0x90, 0xA0, 0xA2, 0xE0, 0x60, 0x7D, 0xE5, 0x53, 0x64, 0x13, 0x60, 0x05, 0xE5, 0x53, 0xB4, +0x0B, 0x05, 0x90, 0xA0, 0xA4, 0x80, 0x23, 0xE5, 0x53, 0x64, 0x12, 0x60, 0x05, 0xE5, 0x53, 0xB4, +0x0A, 0x05, 0x90, 0xA0, 0xA5, 0x80, 0x13, 0xE5, 0x53, 0x64, 0x11, 0x60, 0x05, 0xE5, 0x53, 0xB4, +0x09, 0x05, 0x90, 0xA0, 0xA6, 0x80, 0x03, 0x90, 0xA0, 0xA3, 0xE0, 0xF5, 0x5C, 0xE5, 0x5C, 0xC3, +0x94, 0x80, 0x50, 0x28, 0xE5, 0x5C, 0x94, 0x1B, 0x40, 0x02, 0x80, 0x13, 0xE5, 0x58, 0x25, 0x5C, +0xFF, 0xE4, 0x33, 0xFE, 0xD3, 0xEF, 0x94, 0x1B, 0xEE, 0x64, 0x80, 0x94, 0x80, 0x40, 0x05, 0x75, +0x58, 0x1B, 0x80, 0x20, 0xE5, 0x5C, 0x25, 0x58, 0xF5, 0x58, 0x80, 0x18, 0xC3, 0xE4, 0x95, 0x5C, +0xF5, 0x5C, 0xE5, 0x58, 0xD3, 0x95, 0x5C, 0x40, 0x08, 0xE5, 0x58, 0x95, 0x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91, 0xF0, 0x12, 0xA9, 0x28, 0x40, 0x05, 0x75, 0x59, 0x05, 0x80, +0x13, 0xD3, 0xE5, 0x57, 0x94, 0xC8, 0xE5, 0x56, 0x94, 0x00, 0x40, 0x05, 0x75, 0x59, 0x02, 0x80, +0x03, 0xE4, 0xF5, 0x59, 0xE5, 0x51, 0xD1, 0xCA, 0xE0, 0xF5, 0x54, 0xA3, 0xE0, 0xF5, 0x55, 0xE4, +0xF5, 0x5D, 0xD1, 0x80, 0x75, 0xF0, 0x02, 0xE5, 0x5D, 0x12, 0xA8, 0x9B, 0x80, 0x05, 0xCE, 0xC3, +0x13, 0xCE, 0x13, 0xD8, 0xF9, 0xFF, 0x90, 0xA0, 0xC6, 0x12, 0x49, 0x2E, 0x85, 0x5D, 0x82, 0x12, +0x64, 0x72, 0x12, 0xA8, 0x71, 0x05, 0x5D, 0xE5, 0x5D, 0xB4, 0x05, 0xD6, 0x90, 0xA0, 0xC6, 0x12, +0x49, 0x2E, 0x12, 0x66, 0xDF, 0xFD, 0x7C, 0x00, 0x12, 0xA9, 0x77, 0x80, 0x05, 0xCE, 0xC3, 0x13, +0xCE, 0x13, 0xD8, 0xF9, 0xFF, 0x12, 0x07, 0x03, 0xD3, 0xE5, 0x55, 0x9F, 0xE5, 0x54, 0x9E, 0x40, +0x0C, 0xE5, 0x55, 0x9F, 0xF5, 0x55, 0xE5, 0x54, 0x9E, 0xF5, 0x54, 0x80, 0x05, 0xE4, 0xF5, 0x54, +0xF5, 0x55, 0xE5, 0x51, 0xD1, 0xCA, 0x12, 0xA9, 0x7F, 0x12, 0xA3, 0x7A, 0xC3, 0x12, 0xA9, 0x32, +0x50, 0x07, 0xAF, 0x51, 0x12, 0xA0, 0x70, 0x80, 0x54, 0x12, 0xA5, 0x47, 0xD3, 0x12, 0xA9, 0x32, +0x40, 0x51, 0x74, 0x91, 0x25, 0x51, 0x12, 0x7E, 0x03, 0xE0, 0x20, 0xE6, 0x03, 0x30, 0xE1, 0x07, +0xE4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08, 0xE4, 0xF5, 0x5B, 0xD1, 0x74, 0xE4, 0x80, 0x55, +0x12, 0xA8, 0xFD, 0xE0, 0x64, 0x01, 0x70, 0x64, 0xF1, 0x79, 0xE0, 0x64, 0x0A, 0x60, 0x28, 0xEF, +0x24, 0x05, 0xFF, 0xE4, 0x33, 0xFE, 0x12, 0xA8, 0xF1, 0xE0, 0xFD, 0x12, 0xA8, 0xDB, 0x50, 0x17, +0xED, 0x24, 0x05, 0xFF, 0xE4, 0x33, 0xFE, 0xD1, 0xA4, 0xE0, 0x12, 0xA8, 0xDB, 0x50, 0x08, 0x12, +0xA8, 0x65, 0xE0, 0x65, 0x53, 0x60, 0x2A, 0xE5, 0x5B, 0x70, 0x05, 0x75, 0x5B, 0x01, 0x80, 0x0D, +0xE5, 0x5B, 0xB4, 0x01, 0x05, 0x75, 0x5B, 0x03, 0x80, 0x03, 0x75, 0x5B, 0x05, 0xD1, 0xA4, 0xE0, +0xFF, 0x12, 0xA8, 0xF1, 0xEF, 0xF0, 0x74, 0x11, 0x25, 0x51, 0xF5, 0x82, 0xE4, 0x34, 0x9B, 0x80, +0x17, 0xD1, 0x74, 0xE4, 0xF0, 0xF1, 0x79, 0xE0, 0x04, 0xF0, 0x80, 0x10, 0xE4, 0xF5, 0x5B, 0x74, +0x11, 0x25, 0x51, 0xF5, 0x82, 0xE4, 0x34, 0x9C, 0xF5, 0x83, 0xE4, 0xF0, 0x12, 0xA8, 0x65, 0xE5, +0x53, 0xF0, 0x12, 0x4E, 0x26, 0xC4, 0x13, 0x13, 0x54, 0x03, 0x20, 0xE0, 0x02, 0xC1, 0x43, 0xF1, +0x79, 0xE4, 0xF0, 0xF5, 0x5B, 0xD1, 0x74, 0xE4, 0xF0, 0xC1, 0x43, 0xEC, 0x64, 0x06, 0x60, 0x02, +0xC1, 0x53, 0xF5, 0x54, 0xF5, 0x55, 0xD1, 0xB1, 0xE0, 0x54, 0x07, 0xF5, 0x5B, 0x12, 0xA9, 0x28, +0x40, 0x05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0x80, 0x04, 0xEF, 0x14, 0xF5, +0x5B, 0xD3, 0x90, 0xA0, 0xCD, 0xE0, 0x94, 0x03, 0x90, 0xA0, 0xCC, 0xE0, 0x94, 0x00, 0x40, 0x03, +0xE4, 0xF5, 0x5B, 0xD1, 0xB1, 0xE0, 0x54, 0xF8, 0x90, 0xA0, 0xD9, 0xF0, 0x45, 0x5B, 0xFF, 0xD1, +0xB0, 0xEF, 0xF0, 0xD1, 0x74, 0xE0, 0xD3, 0x94, 0x05, 0x74, 0x11, 0x50, 0x07, 0xD1, 0x76, 0xE0, +0x04, 0xF0, 0x80, 0x04, 0xD1, 0x76, 0xE4, 0xF0, 0xE4, 0xFD, 0xAF, 0x51, 0x12, 0x6D, 0xB4, 0x05, +0x51, 0x01, 0x8C, 0x22, 0x74, 0x11, 0x25, 0x51, 0xF5, 0x82, 0xE4, 0x34, 0x9C, 0xF5, 0x83, 0x22, +0x90, 0xA0, 0xC9, 0x02, 0x49, 0x2E, 0x74, 0x01, 0x25, 0x51, 0xF5, 0x82, 0xE4, 0x34, 0x93, 0xF5, +0x83, 0x22, 0xE5, 0x56, 0xC3, 0x13, 0xFE, 0xE5, 0x57, 0x13, 0x22, 0x12, 0x07, 0xAB, 0x2F, 0xFF, +0xEE, 0x35, 0xF0, 0x22, 0x74, 0x11, 0x25, 0x51, 0xF5, 0x82, 0xE4, 0x34, 0x9A, 0xF5, 0x83, 0x22, +0xF0, 0x75, 0xF0, 0x10, 0xE5, 0x51, 0x90, 0x81, 0x01, 0x02, 0x49, 0x22, 0x74, 0x11, 0x25, 0x51, +0xF5, 0x82, 0xE4, 0x34, 0x98, 0xF5, 0x83, 0x22, 0xE5, 0x5E, 0x25, 0xE0, 0x24, 0x91, 0xF5, 0x82, +0xE4, 0x34, 0x94, 0xF5, 0x83, 0x22, 0x11, 0x58, 0x70, 0x26, 0x90, 0x9F, 0xA4, 0xE0, 0x54, 0xFD, +0xF0, 0x7D, 0x2C, 0x7F, 0x6F, 0xF1, 0x8F, 0x12, 0x74, 0x87, 0xBF, 0x01, 0x0F, 0x90, 0x9F, 0xA3, +0xE0, 0x44, 0x80, 0xF0, 0x7D, 0x0E, 0xF1, 0xD0, 0x74, 0x0E, 0xF0, 0x22, 0xF1, 0xF9, 0x04, 0xF0, +0x22, 0xE4, 0x90, 0xA0, 0xF4, 0xF0, 0x90, 0x9F, 0xA7, 0xE0, 0x60, 0x5A, 0x11, 0x58, 0x70, 0x56, +0x12, 0x9D, 0x11, 0x12, 0x9B, 0x48, 0xCE, 0xC3, 0x13, 0xCE, 0x13, 0xD8, 0xF9, 0x12, 0x9D, 0xE2, +0xF0, 0x12, 0x82, 0x36, 0xE4, 0x90, 0x9F, 0xAE, 0xF0, 0x90, 0x9F, 0x9E, 0xE0, 0x30, 0xE0, 0x16, +0x90, 0x9F, 0xA2, 0xE0, 0xB4, 0x02, 0x05, 0xE4, 0x90, 0xA0, 0xF4, 0xF0, 0x12, 0x5E, 0xD3, 0xEF, +0x70, 0x04, 0x90, 0xA0, 0xF4, 0xF0, 0x90, 0xA0, 0xF4, 0xE0, 0x60, 0x1A, 0x12, 0x9D, 0x19, 0xE4, +0x90, 0xA1, 0x8E, 0xF0, 0x90, 0x9F, 0xAF, 0x11, 0x0F, 0x90, 0x9F, 0xAA, 0xE0, 0x20, 0xE2, 0x03, +0x12, 0x58, 0x61, 0x12, 0x8F, 0xB2, 0x22, 0x90, 0x00, 0x08, 0x02, 0x07, 0xAB, 0xF0, 0x75, 0xF0, +0x10, 0xE5, 0x51, 0x90, 0x81, 0x00, 0x02, 0x49, 0x22, 0x74, 0x11, 0x25, 0x51, 0xF5, 0x82, 0xE4, +0x34, 0x9B, 0xF5, 0x83, 0x22, 0xE4, 0xFD, 0x7F, 0x0C, 0x12, 0x58, 0x65, 0xE4, 0xFD, 0xFF, 0x90, +0x05, 0x22, 0xEF, 0xF0, 0x90, 0x9E, 0x96, 0xED, 0xF0, 0x22, 0xEF, 0x60, 0x32, 0x11, 0x58, 0x70, +0x2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, 0xDF, 0xE0, 0xFF, 0x7D, 0x01, 0x80, +0x04, 0x7D, 0x01, 0x7F, 0x04, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0xA1, 0xEE, 0xED, +0xF0, 0x90, 0x9F, 0xA3, 0xE0, 0xFE, 0xC4, 0x13, 0x13, 0x54, 0x03, 0x30, 0xE0, 0x02, 0x21, 0xB4, +0xEE, 0x12, 0x76, 0xBF, 0x30, 0xE0, 0x02, 0x21, 0xB4, 0x90, 0x9F, 0xAA, 0xE0, 0xFE, 0x6F, 0x70, +0x02, 0x21, 0xB4, 0xEF, 0x70, 0x02, 0x21, 0x23, 0x24, 0xFE, 0x70, 0x02, 0x21, 0x5E, 0x24, 0xFE, +0x60, 0x48, 0x24, 0xFC, 0x70, 0x02, 0x21, 0x9A, 0x24, 0xFC, 0x60, 0x02, 0x21, 0xAD, 0xEE, 0xB4, +0x0E, 0x02, 0x51, 0x08, 0x90, 0x9F, 0xAA, 0xE0, 0x70, 0x04, 0x7F, 0x01, 0x51, 0x53, 0x90, 0x9F, +0xAA, 0xE0, 0xB4, 0x06, 0x02, 0x51, 0x2D, 0x90, 0x9F, 0xAA, 0xE0, 0xB4, 0x04, 0x0E, 0x90, 0xA1, +0xEE, 0xE0, 0xFF, 0x60, 0x05, 0x12, 0x57, 0x9A, 0x80, 0x02, 0xD1, 0x3C, 0x90, 0x9F, 0xAA, 0xE0, +0x64, 0x08, 0x60, 0x02, 0x21, 0xAD, 0xF1, 0xC4, 0x21, 0xAD, 0x90, 0x9F, 0xAA, 0xE0, 0x70, 0x04, +0x7F, 0x01, 0x51, 0x53, 0x90, 0x9F, 0xAA, 0xE0, 0xB4, 0x06, 0x02, 0x51, 0x2D, 0x90, 0x9F, 0xAA, +0xE0, 0xB4, 0x0E, 0x07, 0x31, 0xB9, 0xBF, 0x01, 0x02, 0x51, 0x08, 0x90, 0x9F, 0xAA, 0xE0, 0x64, +0x0C, 0x60, 0x02, 0x21, 0xAD, 0x31, 0xB9, 0xEF, 0x64, 0x01, 0x60, 0x02, 0x21, 0xAD, 0x12, 0x56, +0xD6, 0x21, 0xAD, 0x90, 0x9F, 0xAA, 0xE0, 0xB4, 0x0E, 0x07, 0x31, 0xB9, 0xBF, 0x01, 0x02, 0x51, +0x08, 0x90, 0x9F, 0xAA, 0xE0, 0xB4, 0x06, 0x02, 0x51, 0x2D, 0x90, 0x9F, 0xAA, 0xE0, 0xB4, 0x0C, +0x08, 0x31, 0xB9, 0xBF, 0x01, 0x03, 0x12, 0x56, 0xD6, 0x90, 0x9F, 0xAA, 0xE0, 0x64, 0x04, 0x70, +0x5C, 0x12, 0x95, 0x46, 0xEF, 0x64, 0x01, 0x70, 0x54, 0x12, 0xA7, 0x49, 0x80, 0x4F, 0x90, 0x9F, +0xAA, 0xE0, 0xB4, 0x0E, 0x07, 0x31, 0xB9, 0xBF, 0x01, 0x02, 0x51, 0x08, 0x90, 0x9F, 0xAA, 0xE0, +0xB4, 0x06, 0x02, 0x51, 0x2D, 0x90, 0x9F, 0xAA, 0xE0, 0xB4, 0x0C, 0x08, 0x31, 0xB9, 0xBF, 0x01, +0x03, 0x12, 0x56, 0xD6, 0x90, 0x9F, 0xAA, 0xE0, 0x70, 0x04, 0x7F, 0x01, 0x51, 0x53, 0x90, 0x9F, +0xAA, 0xE0, 0xB4, 0x04, 0x18, 0x12, 0xA7, 0x6A, 0x80, 0x13, 0x90, 0x9F, 0xAA, 0xE0, 0xB4, 0x0C, +0x0C, 0x90, 0x9F, 0xA4, 0x12, 0x75, 0x00, 0x30, 0xE0, 0x03, 0x12, 0x80, 0x29, 0x90, 0x9F, 0xAA, +0x12, 0xA8, 0xCE, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0xA0, 0x5F, 0xE0, 0x30, 0xE0, 0x10, +0x90, 0xA0, 0x65, 0xE0, 0xC4, 0x13, 0x54, 0x07, 0x30, 0xE0, 0x12, 0x12, 0x96, 0x02, 0x80, 0x2F, +0x12, 0x96, 0xA6, 0xEF, 0x64, 0x01, 0x60, 0x05, 0x12, 0x96, 0x40, 0x80, 0x22, 0x90, 0x9F, 0xA3, +0x12, 0x80, 0xDA, 0x30, 0xE0, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x02, 0xF0, 0x80, 0x11, 0x90, 0x9F, +0xA9, 0xE0, 0xD3, 0x94, 0x04, 0x40, 0x05, 0x12, 0x95, 0x3F, 0x80, 0x03, 0x02, 0x96, 0x47, 0x90, +0x01, 0xB9, 0x74, 0x02, 0xF0, 0x7F, 0x00, 0x22, 0x90, 0x9F, 0xA4, 0xE0, 0xC3, 0x13, 0x20, 0xE0, +0x04, 0x51, 0x70, 0x80, 0x12, 0x12, 0xA8, 0x03, 0xD1, 0x2C, 0x90, 0x05, 0x27, 0xE0, 0x44, 0x80, +0xF0, 0x90, 0x9F, 0xA2, 0x74, 0x04, 0xF0, 0xE4, 0xFD, 0xFF, 0x02, 0x57, 0x8F, 0x90, 0x9F, 0xA4, +0xE0, 0x90, 0x06, 0x04, 0x20, 0xE0, 0x07, 0xE0, 0x44, 0x40, 0xD1, 0x2C, 0x80, 0x0F, 0x51, 0x6C, +0x90, 0x05, 0x27, 0xE0, 0x54, 0x7F, 0xF0, 0x90, 0x9F, 0xA2, 0x74, 0x0C, 0xF0, 0xE4, 0xFD, 0xFF, +0x02, 0x57, 0x8F, 0x90, 0xA1, 0xED, 0xEF, 0xF0, 0x12, 0x4C, 0x71, 0x90, 0xA1, 0xED, 0xE0, 0x60, +0x02, 0xD1, 0x36, 0x7D, 0x04, 0x12, 0x57, 0xD0, 0x74, 0x04, 0xF0, 0x22, 0xE0, 0x54, 0x7F, 0xF0, +0x7D, 0x0C, 0x7F, 0x01, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0xA1, 0xEC, 0xEF, 0xF0, +0x14, 0x60, 0x15, 0x14, 0x60, 0x19, 0x24, 0x02, 0x70, 0x1A, 0xED, 0x54, 0x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0xE0, 0x03, 0x43, 0x54, 0x12, 0xEF, 0xC4, 0x54, 0x0F, 0x30, 0xE0, 0x03, +0x43, 0x54, 0x14, 0x90, 0x9F, 0x9E, 0xE0, 0xC4, 0x13, 0x54, 0x07, 0x30, 0xE0, 0x03, 0x43, 0x54, +0x80, 0x90, 0x9F, 0x9E, 0x12, 0x74, 0x80, 0x20, 0xE0, 0x03, 0x43, 0x54, 0x40, 0x91, 0x43, 0x90, +0x9F, 0xA1, 0xE0, 0x70, 0x04, 0x7F, 0x01, 0x91, 0x4A, 0xD1, 0x8B, 0x30, 0xE0, 0x04, 0x7F, 0x04, +0x80, 0x0B, 0xD1, 0xD3, 0xEF, 0x60, 0x04, 0x7F, 0x01, 0x80, 0x02, 0x7F, 0x02, 0x91, 0x4A, 0x80, +0x7B, 0x91, 0x40, 0x90, 0x9F, 0xA1, 0xE0, 0x64, 0x04, 0x60, 0x02, 0x81, 0x3B, 0xFF, 0x91, 0x4A, +0x81, 0x3B, 0x90, 0x9F, 0x9E, 0xE0, 0x30, 0xE0, 0x6B, 0xD1, 0xFB, 0x43, 0x54, 0x31, 0xD1, 0x82, +0x30, 0xE0, 0x04, 0xF1, 0xCF, 0x80, 0x06, 0x7D, 0x40, 0xE4, 0xFF, 0xF1, 0x1E, 0x90, 0x9F, 0x9E, +0xD1, 0xCB, 0x30, 0xE0, 0x03, 0x43, 0x54, 0x02, 0xEF, 0xC4, 0x54, 0x0F, 0x30, 0xE0, 0x03, 0x43, +0x54, 0x04, 0x91, 0x43, 0xD1, 0x8B, 0x30, 0xE0, 0x0B, 0x12, 0x97, 0x2A, 0x60, 0x2E, 0xE4, 0xFD, +0x7F, 0x02, 0x80, 0x1C, 0xD1, 0x7A, 0x90, 0x9F, 0xA2, 0xE0, 0xB4, 0x02, 0x17, 0xD1, 0x47, 0xD1, +0xD3, 0xBF, 0x01, 0x09, 0x90, 0x9F, 0xA9, 0xE0, 0xFF, 0x7D, 0x01, 0x80, 0x03, 0xE4, 0xFD, 0xFF, +0x11, 0x65, 0x80, 0x08, 0x90, 0x9F, 0xAA, 0xE0, 0x90, 0x9F, 0xA2, 0xF0, 0x90, 0x05, 0x40, 0x74, +0x22, 0xF0, 0x80, 0x27, 0x91, 0x40, 0x90, 0x9F, 0xA2, 0xE0, 0xB4, 0x02, 0x06, 0x7D, 0x01, 0x7F, +0x04, 0x80, 0x0B, 0x90, 0x9F, 0xA2, 0xE0, 0xB4, 0x08, 0x06, 0x7D, 0x01, 0x7F, 0x0C, 0x11, 0x65, +0x12, 0x96, 0xBF, 0x90, 0x9F, 0xA9, 0x11, 0x5B, 0x12, 0xA6, 0x8B, 0xD0, 0xD0, 0x92, 0xAF, 0x22, +0x75, 0x54, 0x01, 0x90, 0x05, 0x27, 0xE5, 0x54, 0xF0, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, +0xD0, 0x90, 0x9F, 0xA1, 0xE0, 0x90, 0xA1, 0xEB, 0xF0, 0x6F, 0x70, 0x02, 0xA1, 0x58, 0xEF, 0x14, +0x60, 0x42, 0x14, 0x60, 0x6C, 0x14, 0x70, 0x02, 0x81, 0xFD, 0x14, 0x70, 0x02, 0xA1, 0x2C, 0x24, +0x04, 0x60, 0x02, 0xA1, 0x58, 0x90, 0xA1, 0xEB, 0xE0, 0xB4, 0x04, 0x04, 0xD1, 0x63, 0xA1, 0x58, +0x90, 0xA1, 0xEB, 0xE0, 0xB4, 0x02, 0x04, 0xD1, 0x6E, 0xA1, 0x58, 0x90, 0xA1, 0xEB, 0xE0, 0xB4, +0x03, 0x04, 0xD1, 0x76, 0xA1, 0x58, 0x90, 0xA1, 0xEB, 0xE0, 0x64, 0x01, 0x60, 0x02, 0xA1, 0x58, +0xD1, 0x65, 0xA1, 0x58, 0x90, 0xA1, 0xEB, 0xE0, 0xB4, 0x04, 0x04, 0xD1, 0x5D, 0xA1, 0x58, 0x90, +0xA1, 0xEB, 0xE0, 0xB4, 0x02, 0x04, 0xD1, 0x54, 0xA1, 0x58,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 0x7D, 0x04, 0x7F, +0x01, 0x41, 0x74, 0x12, 0x4C, 0x71, 0xE4, 0xFD, 0xFF, 0x02, 0x57, 0x8F, 0x12, 0xA9, 0x67, 0xD1, +0x36, 0x7D, 0x0C, 0x7F, 0x01, 0x41, 0x74, 0xD1, 0x36, 0xD1, 0x2D, 0xD1, 0x7A, 0x90, 0x9F, 0xA2, +0x74, 0x04, 0xF0, 0x22, 0xD1, 0x33, 0x90, 0x9F, 0xA1, 0x74, 0x01, 0xF0, 0x22, 0xD1, 0x36, 0xD1, +0x7A, 0x80, 0xF3, 0xD1, 0x5D, 0x12, 0xA7, 0x81, 0xE4, 0x90, 0x9F, 0xA1, 0xF0, 0x22, 0xD1, 0x54, +0x80, 0xF3, 0xD1, 0x36, 0x80, 0xE0, 0xD1, 0x72, 0x80, 0xEB, 0x90, 0x05, 0x27, 0xE0, 0x44, 0x40, +0xF0, 0x22, 0x90, 0x9F, 0x9E, 0xE0, 0x13, 0x13, 0x54, 0x3F, 0x22, 0x90, 0x9F, 0x9E, 0xE0, 0xFF, +0xC4, 0x13, 0x13, 0x54, 0x03, 0x22, 0x90, 0x9F, 0xA3, 0xD1, 0x8E, 0x30, 0xE0, 0x29, 0xEF, 0x54, +0xBF, 0x12, 0x9F, 0x62, 0x30, 0xE0, 0x06, 0xE0, 0x44, 0x01, 0xF0, 0x80, 0x09, 0xE0, 0x54, 0xFE, +0x12, 0x57, 0xF8, 0x74, 0x04, 0xF0, 0x90, 0xA0, 0x65, 0x12, 0x83, 0x3F, 0x30, 0xE0, 0x06, 0x7D, +0x01, 0x7F, 0x0C, 0x01, 0x65, 0x11, 0x4D, 0x22, 0x90, 0x9F, 0xA4, 0xE0, 0xFF, 0x13, 0x13, 0x13, +0x54, 0x1F, 0x22, 0x90, 0x05, 0x43, 0xE0, 0x7F, 0x00, 0x30, 0xE7, 0x02, 0x7F, 0x01, 0x22, 0xAE, +0x07, 0xD1, 0xD3, 0xBF, 0x01, 0x12, 0x90, 0x9F, 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02, 0x7F, 0x02, 0x74, 0x15, 0x2F, 0xF8, 0xE6, 0x4D, 0xFE, 0xF6, 0x74, 0x30, 0xE1, 0x09, +0x12, 0x4C, 0x71, 0xD1, 0x3C, 0x90, 0x9F, 0xA3, 0xE0, 0x54, 0xF7, 0xF0, 0x22, 0x74, 0x1D, 0x12, +0xA9, 0x6F, 0xE1, 0x05, 0xD1, 0x33, 0x51, 0x70, 0x90, 0x9F, 0xA2, 0x74, 0x0C, 0xF0, 0x22, 0x90, +0x01, 0x34, 0x74, 0x40, 0xF0, 0xFD, 0xE4, 0xFF, 0xF1, 0xA4, 0x43, 0x54, 0x08, 0x22, 0xC1, 0x56, +0xF1, 0xDE, 0x02, 0x57, 0xD9, 0xF1, 0xDE, 0x02, 0x4F, 0xF3, 0x02, 0x4F, 0xFA, 0xD1, 0x7A, 0x7D, +0x23, 0x02, 0x4F, 0xF5, 0x7F, 0xF4, 0x12, 0x4A, 0xB8, 0xEF, 0x20, 0xE5, 0x0E, 0x7F, 0xF4, 0x12, +0x4A, 0xB8, 0xEF, 0x7F, 0x01, 0x20, 0xE4, 0x05, 0x7F, 0x02, 0x22, 0x7F, 0x03, 0x22, 0x12, 0x5F, +0xF4, 0x90, 0x9E, 0x97, 0xEF, 0xF0, 0x11, 0x28, 0x90, 0x01, 0x64, 0x74, 0x01, 0xF0, 0x90, 0x04, +0x23, 0xE0, 0x44, 0x80, 0xF0, 0x02, 0x36, 0x83, 0x12, 0x4F, 0x47, 0x12, 0x4F, 0x68, 0x11, 0x35, +0x11, 0x54, 0x02, 0x4F, 0xC0, 0x75, 0x15, 0x12, 0xE4, 0xF5, 0x16, 0x75, 0x17, 0x07, 0x75, 0x18, +0x72, 0x90, 0x01, 0x30, 0xE5, 0x15, 0xF0, 0xA3, 0xE5, 0x16, 0xF0, 0xA3, 0xE5, 0x17, 0xF0, 0xA3, +0xE5, 0x18, 0xF0, 0x22, 0x75, 0x1D, 0x06, 0x75, 0x1E, 0x01, 0x75, 0x1F, 0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x90, 0xA1, 0x00, +0xF0, 0xE0, 0xFD, 0x7F, 0x2E, 0x12, 0x49, 0x90, 0x90, 0xA1, 0x02, 0xE0, 0xC4, 0x54, 0xF0, 0xFF, +0x90, 0xA0, 0x9D, 0xE0, 0x54, 0x0F, 0x4F, 0xFD, 0x7F, 0x2D, 0x12, 0x49, 0x90, 0x90, 0xA1, 0x03, +0xE0, 0xB4, 0x21, 0x0C, 0x90, 0xFD, 0x62, 0xE0, 0xFF, 0x12, 0x8F, 0xD6, 0x7F, 0x04, 0x31, 0x4B, +0x90, 0xA1, 0x03, 0xE0, 0xB4, 0x23, 0x04, 0x7F, 0x01, 0x51, 0xD8, 0x90, 0xA1, 0x03, 0xE0, 0xB4, +0x27, 0x04, 0x7F, 0x02, 0x51, 0xD8, 0x90, 0xA1, 0x03, 0xE0, 0xB4, 0x30, 0x0C, 0xE4, 0xFB, 0xFD, +0x7F, 0x01, 0x12, 0x8F, 0xF0, 0x7F, 0x04, 0x31, 0x4B, 0x90, 0xA1, 0x03, 0xE0, 0x64, 0x34, 0x70, +0x46, 0x90, 0xFD, 0x62, 0xE0, 0x30, 0xE0, 0x32, 0x90, 0xA0, 0x84, 0xE0, 0xFF, 0xC3, 0x13, 0x20, +0xE0, 0x35, 0x90, 0xA1, 0x00, 0x74, 0x01, 0xF0, 0xFB, 0x7A, 0xA1, 0x79, 0x00, 0xFD, 0x7F, 0x34, +0x31, 0x03, 0x90, 0xA1, 0x00, 0x74, 0x03, 0xF0, 0xE0, 0xFF, 0x91, 0x78, 0x90, 0x04, 0x9D, 0xE4, +0xF0, 0xE0, 0x44, 0x01, 0xF0, 0x12, 0x8E, 0xA2, 0x80, 0x0D, 0x12, 0x90, 0x61, 0x90, 0x04, 0x9D, +0xE0, 0x54, 0xFE, 0xF0, 0x12, 0x8F, 0x8F, 0x90, 0xA1, 0x03, 0xE0, 0xFD, 0xB4, 0x35, 0x07, 0x90, +0xA0, 0x66, 0xE0, 0x44, 0x01, 0xF0, 0xED, 0xB4, 0x36, 0x22, 0x90, 0xFD, 0x61, 0xE0, 0x90, 0xA1, +0x00, 0xF0, 0x90, 0xFD, 0x62, 0xE0, 0x90, 0xA1, 0x01, 0xF0, 0x90, 0xA1, 0x03, 0xE0, 0xFF, 0x90, +0xA1, 0x00, 0xE0, 0xFD, 0x7B, 0x01, 0x7A, 0xA1, 0x79, 0x01, 0x31, 0x03, 0x90, 0xA1, 0x03, 0xE0, +0xB4, 0x37, 0x02, 0x91, 0xD4, 0x90, 0xA1, 0x03, 0xE0, 0xB4, 0x40, 0x14, 0x90, 0xFD, 0x62, 0xE0, +0x30, 0xE0, 0x08, 0x90, 0xA0, 0x82, 0x74, 0x01, 0xF0, 0x80, 0x05, 0xE4, 0x90, 0xA0, 0x82, 0xF0, +0x90, 0xFD, 0x68, 0xE0, 0x44, 0x01, 0xF0, 0x22, 0x71, 0x03, 0x7F, 0x04, 0x21, 0x4B, 0xD3, 0x10, +0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0xA1, 0x6C, 0x74, 0x15, 0xF0, 0x90, 0xA1, 0x7A, 0x74, 0x01, +0xF0, 0x90, 0xA1, 0x6E, 0xEF, 0xF0, 0x7B, 0x01, 0x7A, 0xA1, 0x79, 0x6C, 0x71, 0x89, 0xD0, 0xD0, +0x92, 0xAF, 0x22, 0x90, 0xA1, 0x4E, 0x74, 0x09, 0xF0, 0x90, 0xA1, 0x5C, 0x74, 0x07, 0xF0, 0x90, +0xA1, 0x50, 0xEF, 0xF0, 0x70, 0x31, 0x90, 0xA0, 0x78, 0xE0, 0x60, 0x1A, 0xA3, 0xE0, 0x60, 0x02, +0x80, 0x0C, 0x90, 0x07, 0x70, 0xE0, 0x70, 0x06, 0x90, 0x07, 0x74, 0xE0, 0x60, 0x08, 0x90, 0xA1, +0x51, 0x74, 0x01, 0xF0, 0x80, 0x05, 0xE4, 0x90, 0xA1, 0x51, 0xF0, 0xE4, 0x90, 0xA1, 0x52, 0xF0, +0xA3, 0xF0, 0xA3, 0xF0, 0xA3, 0x80, 0x39, 0x90, 0xFD, 0x62, 0xE0, 0x90, 0xA1, 0x51, 0xF0, 0x90, +0xFD, 0x63, 0xE0, 0x90, 0xA1, 0x52, 0xF0, 0x90, 0xFD, 0x64, 0xE0, 0x90, 0xA1, 0x53, 0xF0, 0x90, +0xFD, 0x65, 0xE0, 0x90, 0xA1, 0x54, 0xF0, 0x90, 0xFD, 0x66, 0xE0, 0x90, 0xA1, 0x55, 0xF0, 0x90, +0xFD, 0x67, 0xE0, 0x90, 0xA1, 0x56, 0xF0, 0x90, 0xA1, 0x51, 0xE0, 0x54, 0x01, 0x90, 0xA0, 0x78, +0xF0, 0xA3, 0xF0, 0x7B, 0x01, 0x7A, 0xA1, 0x79, 0x4E, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, +0x90, 0x9F, 0x87, 0xE0, 0xFF, 0x70, 0x06, 0xA3, 0xE0, 0x64, 0x09, 0x60, 0x0A, 0xEF, 0x14, 0xFF, +0x90, 0x9F, 0x88, 0xE0, 0xB5, 0x07, 0x04, 0x7F, 0x01, 0x80, 0x02, 0x7F, 0x00, 0xEF, 0x60, 0x09, +0x90, 0x01, 0xC1, 0xE0, 0x44, 0x02, 0xF0, 0x80, 0x2A, 0xC0, 0x01, 0x90, 0x9F, 0x88, 0xE0, 0x12, +0x94, 0x8B, 0xA8, 0x01, 0xFC, 0x7D, 0x01, 0xD0, 0x01, 0x7E, 0x00, 0x7F, 0x0F, 0x12, 0x06, 0x63, +0x90, 0x9F, 0x88, 0x12, 0x8F, 0x70, 0xB4, 0x0A, 0x02, 0x7F, 0x01, 0xEF, 0x60, 0x05, 0xE4, 0x90, +0x9F, 0x88, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0xA1, 0x02, 0xF0, 0xD3, 0x94, 0x3F, 0x22, +0x90, 0xA0, 0x9C, 0xE0, 0x13, 0x13, 0x54, 0x3F, 0x22, 0x90, 0xA0, 0x87, 0xE0, 0x44, 0x04, 0xF0, +0x7D, 0x01, 0x7F, 0x23, 0x31, 0x03, 0x8F, 0x51, 0xE5, 0x51, 0xB4, 0x03, 0x08, 0xE4, 0xFF, 0x71, +0x03, 0x7F, 0x04, 0xB1, 0x78, 0x22, 0x90, 0xA1, 0xCF, 0x12, 0x49, 0x37, 0xE4, 0xFE, 0x90, 0xFD, +0x50, 0xEF, 0xF0, 0x64, 0x30, 0x60, 0x1F, 0xA3, 0xED, 0xF0, 0xEE, 0xC3, 0x9D, 0x50, 0x0A, 0x91, +0x6A, 0xFF, 0x91, 0x5F, 0xEF, 0xF0, 0x0E, 0x80, 0xF1, 0xEE, 0xC3, 0x94, 0x06, 0x50, 0x19, 0x91, +0x5F, 0xE4, 0xF0, 0x0E, 0x80, 0xF3, 0xEE, 0xC3, 0x94, 0x07, 0x50, 0x0C, 0x91, 0x6A, 0xFF, 0x74, +0x51, 0x91, 0x61, 0xEF, 0xF0, 0x0E, 0x80, 0xEE, 0x90, 0xFD, 0x58, 0x74, 0x01, 0xF0, 0x22, 0x74, +0x52, 0x2E, 0xF5, 0x82, 0xE4, 0x34, 0xFD, 0xF5, 0x83, 0x22, 0x90, 0xA1, 0xCF, 0x12, 0x49, 0x2E, +0x8E, 0x82, 0x75, 0x83, 0x00, 0x02, 0x06, 0xA2, 0x90, 0xA1, 0x05, 0xEF, 0xF0, 0x12, 0x90, 0xA1, +0xE4, 0xFE, 0xFD, 0xEC, 0x90, 0xA0, 0x7B, 0x12, 0x08, 0x6D, 0x90, 0xA0, 0x7A, 0xE0, 0x44, 0x01, +0xF0, 0x7D, 0x11, 0x12, 0x4A, 0xD5, 0x90, 0x07, 0x78, 0xE0, 0x90, 0xA0, 0x7F, 0xF0, 0x12, 0x87, +0xCC, 0x12, 0x4D, 0x38, 0x90, 0xA1, 0x05, 0xE0, 0xFD, 0x70, 0x02, 0x80, 0x1C, 0xED, 0xB4, 0x01, +0x06, 0x91, 0xCD, 0x44, 0x20, 0xF0, 0x22, 0x90, 0xA1, 0x05, 0xE0, 0xFD, 0xB4, 0x02, 0x06, 0x91, +0xCD, 0x44, 0x60, 0xF0, 0x22, 0xED, 0xB4, 0x03, 0x03, 0x91, 0xCD, 0xF0, 0x22, 0x90, 0xA0, 0x7A, +0xE0, 0x54, 0x1F, 0x22, 0x90, 0xA0, 0x62, 0x12, 0x74, 0x80, 0x20, 0xE0, 0x1D, 0x90, 0xFD, 0x62, +0xE0, 0x30, 0xE0, 0x16, 0xE0, 0x90, 0xA1, 0x04, 0x30, 0xE1, 0x05, 0x74, 0x01, 0xF0, 0x80, 0x03, +0x74, 0x02, 0xF0, 0x90, 0xA1, 0x04, 0xE0, 0xFF, 0x91, 0x78, 0x22, 0x90, 0xA0, 0xE4, 0xEF, 0xF0, +0x90, 0x04, 0x7E, 0xE0, 0xF5, 0x66, 0xA3, 0xE0, 0xF5, 0x67, 0x65, 0x66, 0x60, 0x69, 0x90, 0xA0, +0xE5, 0x74, 0x03, 0xF0, 0x90, 0xA0, 0xF3, 0x74, 0x08, 0xF0, 0xE5, 0x67, 0x04, 0x54, 0x0F, 0xF5, +0x68, 0xE4, 0xF5, 0x65, 0xE5, 0x68, 0x75, 0xF0, 0x08, 0xA4, 0x24, 0x00, 0xF5, 0x82, 0xE4, 0x34, +0x80, 0xF5, 0x83, 0xE5, 0x82, 0x25, 0x65, 0x12, 0x4F, 0xB8, 0xE0, 0xFF, 0x74, 0xE7, 0x25, 0x65, +0xF5, 0x82, 0xE4, 0x34, 0xA0, 0xF5, 0x83, 0xEF, 0xF0, 0x05, 0x65, 0xE5, 0x65, 0xB4, 0x08, 0xD4, +0x7B, 0x01, 0x7A, 0xA0, 0x79, 0xE5, 0x71, 0x89, 0xE5, 0x67, 0x04, 0x54, 0x0F, 0xF5, 0x67, 0xB4, +0x0F, 0x03, 0xE4, 0xF5, 0x67, 0x90, 0x04, 0x7F, 0xE5, 0x67, 0xF0, 0x90, 0xA0, 0xE4, 0xE0, 0x7F, +0x04, 0x70, 0x02, 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, 0x06, 0xA2, 0xB1, 0xB9, 0x12, 0x06, 0x89, 0x90, 0xA0, 0xBD, 0xD1, 0xFB, 0x90, +0xA0, 0xBE, 0xF0, 0xB1, 0xBF, 0x7D, 0x02, 0x7F, 0x38, 0x21, 0x03, 0xF0, 0x90, 0x00, 0x01, 0x02, +0x06, 0xA2, 0x90, 0xA0, 0xCA, 0x74, 0x0A, 0xF0, 0x90, 0xA0, 0xD8, 0x74, 0x06, 0xF0, 0x12, 0x06, +0x89, 0x90, 0xA0, 0xCC, 0xD1, 0xFB, 0x90, 0xA0, 0xCD, 0xF1, 0x35, 0x90, 0xA0, 0xCE, 0xF0, 0x12, +0x7A, 0xD3, 0x90, 0xA0, 0xCF, 0xF1, 0xD6, 0x90, 0xA0, 0xD0, 0xD1, 0xDE, 0x90, 0xA0, 0xD1, 0xF0, +0x12, 0x7E, 0xD8, 0x61, 0x89, 0xF0, 0x90, 0x00, 0x02, 0x02, 0x06, 0xA2, 0x12, 0x06, 0x89, 0xF5, +0x51, 0xD1, 0xFC, 0xF5, 0x54, 0xF1, 0x36, 0xF5, 0x55, 0x12, 0x7A, 0xD3, 0xF5, 0x56, 0xF1, 0xD7, +0xF5, 0x57, 0xD1, 0xDF, 0xF5, 0x58, 0xF1, 0xCE, 0xF5, 0x59, 0xE5, 0x51, 0x12, 0x49, 0x40, 0x67, +0x78, 0x00, 0x67, 0x80, 0x01, 0x67, 0x88, 0x02, 0x67, 0x90, 0x03, 0x67, 0x98, 0x04, 0x67, 0xA0, +0x05, 0x67, 0xA8, 0x06, 0x00, 0x00, 0x67, 0xBB, 0x75, 0x52, 0x02, 0x75, 0x53, 0x29, 0x80, 0x41, +0x75, 0x52, 0x06, 0x75, 0x53, 0x2A, 0x80, 0x39, 0x75, 0x52, 0x01, 0x75, 0x53, 0x31, 0x80, 0x31, +0x75, 0x52, 0x01, 0x75, 0x53, 0x32, 0x80, 0x29, 0x75, 0x52, 0x06, 0x75, 0x53, 0x33, 0x80, 0x21, +0x7B, 0x00, 0x7A, 0x00, 0x79, 0x54, 0xE1, 0x02, 0x90, 0xA0, 0xA2, 0x12, 0xA9, 0x7F, 0xA3, 0xE5, +0x56, 0xF0, 0xA3, 0xE5, 0x57, 0xF0, 0xA3, 0xE5, 0x58, 0xF0, 0x22, 0x75, 0x52, 0x01, 0x75, 0x53, +0xFF, 0x7B, 0x00, 0x7A, 0x00, 0x79, 0x54, 0xAD, 0x52, 0xAF, 0x53, 0x21, 0x03, 0xF0, 0x90, 0x00, +0x06, 0x02, 0x06, 0xA2, 0x4E, 0xFF, 0xF0, 0x90, 0x00, 0x04, 0x02, 0x06, 0xA2, 0x7D, 0x03, 0x7F, +0x11, 0x31, 0x03, 0xEF, 0x22, 0xE4, 0xFF, 0x81, 0xFB, 0x90, 0xA0, 0xCA, 0x02, 0x49, 0x37, 0x32, +0xC0, 0xE0, 0xC0, 0xF0, 0xC0, 0x83, 0xC0, 0x82, 0xC0, 0xD0, 0x75, 0xD0, 0x00, 0xC0, 0x00, 0xC0, +0x01, 0xC0, 0x02, 0xC0, 0x03, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x12, 0x4B, 0x7C, +0xE5, 0x14, 0x30, 0xE7, 0x02, 0x11, 0x32, 0xD0, 0x07, 0xD0, 0x06, 0xD0, 0x05, 0xD0, 0x04, 0xD0, +0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0xD0, 0xD0, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xF0, 0xD0, +0xE0, 0x32, 0x7F, 0x01, 0x7E, 0x00, 0x12, 0x3C, 0xEC, 0x7F, 0xF2, 0x12, 0x4A, 0xB8, 0xEF, 0x20, +0xE6, 0x09, 0x7F, 0x05, 0x11, 0x4C, 0x7F, 0x05, 0x12, 0x49, 0x90, 0x22, 0x12, 0x4A, 0xB8, 0xEF, +0x44, 0x80, 0xFD, 0x22, 0xC0, 0xE0, 0xC0, 0xF0, 0xC0, 0x83, 0xC0, 0x82, 0xC0, 0xD0, 0x75, 0xD0, +0x00, 0xC0, 0x00, 0xC0, 0x01, 0xC0, 0x02, 0xC0, 0x03, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, +0x07, 0x12, 0x98, 0x27, 0xE5, 0x19, 0x30, 0xE1, 0x03, 0x12, 0x67, 0xE5, 0xE5, 0x19, 0x30, 0xE4, +0x03, 0x12, 0x92, 0xD0, 0xE5, 0x19, 0x30, 0xE5, 0x03, 0x12, 0x98, 0x84, 0xE5, 0x19, 0x30, 0xE6, +0x03, 0x12, 0x98, 0xC0, 0xE5, 0x1B, 0x30, 0xE0, 0x03, 0x12, 0x98, 0xCD, 0xE5, 0x1B, 0x30, 0xE1, +0x03, 0x12, 0x80, 0x4B, 0xE5, 0x1B, 0x30, 0xE2, 0x03, 0x12, 0x9E, 0x22, 0xE5, 0x1B, 0x30, 0xE3, +0x03, 0x12, 0x50, 0x48, 0xE5, 0x1B, 0x30, 0xE4, 0x03, 0x12, 0x9E, 0x05, 0xE5, 0x1B, 0x30, 0xE5, +0x03, 0x12, 0x97, 0x31, 0xE5, 0x1B, 0x30, 0xE6, 0x03, 0x12, 0x9D, 0xED, 0xE5, 0x1C, 0x30, 0xE1, +0x03, 0x12, 0x9E, 0xD8, 0xE5, 0x1C, 0x30, 0xE4, 0x02, 0xF1, 0x84, 0xE5, 0x1C, 0x30, 0xE5, 0x02, +0x31, 0x04, 0xE5, 0x1C, 0x30, 0xE6, 0x02, 0xF1, 0xE3, 0xD0, 0x07, 0xD0, 0x06, 0xD0, 0x05, 0xD0, +0x04, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0xD0, 0xD0, 0xD0, 0x82, 0xD0, 0x83, 0xD0, +0xF0, 0xD0, 0xE0, 0x32, 0xE4, 0xF5, 0x65, 0x90, 0x9F, 0x9C, 0xE0, 0xFF, 0xE5, 0x65, 0xC3, 0x9F, +0x40, 0x02, 0x21, 0xB2, 0xAF, 0x65, 0x12, 0x50, 0x60, 0xEF, 0x70, 0x02, 0x21, 0xAE, 0xE5, 0x65, +0x13, 0x13, 0x13, 0x54, 0x1F, 0xFF, 0xE5, 0x65, 0x54, 0x07, 0xFE, 0x74, 0x81, 0x2F, 0xB1, 0x5D, +0xE0, 0xFD, 0xAF, 0x06, 0xF1, 0xCF, 0x80, 0x05, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, 0xF9, 0xFF, +0xEF, 0x5D, 0x60, 0x6A, 0x75, 0xF0, 0x10, 0xE5, 0x65, 0x12, 0x56, 0xB6, 0xE0, 0x20, 0xE7, 0x02, +0x80, 0x10, 0x75, 0xF0, 0x10, 0xE5, 0x65, 0x90, 0x81, 0x02, 0x12, 0x49, 0x22, 0xE0, 0xFF, 0x20, +0xE7, 0x09, 0x90, 0x01, 0xC1, 0xE0, 0x44, 0x20, 0xF0, 0x80, 0x43, 0xEF, 0x30, 0xE6, 0x13, 0x75, +0xF0, 0x10, 0xE5, 0x65, 0x12, 0x57, 0x73, 0xB1, 0x65, 0x12, 0x4E, 0x2B, 0x31, 0xBF, 0xE4, 0xFB, +0x80, 0x28, 0x31, 0xB3, 0xE0, 0x04, 0xF0, 0x31, 0xB3, 0xE0, 0xD3, 0x94, 0x01, 0x40, 0x0A, 0xAF, +0x65, 0xF1, 0x38, 0x31, 0xB3, 0xE4, 0xF0, 0x80, 0x15, 0x75, 0xF0, 0x10, 0xE5, 0x65, 0x12, 0x57, +0x73, 0xB1, 0x65, 0x12, 0x4E, 0x2B, 0x31, 0xBF, 0x7B, 0x01, 0xAF, 0x65, 0x91, 0x1B, 0x05, 0x65, +0x21, 0x07, 0x22, 0x74, 0x11, 0x25, 0x65, 0xF5, 0x82, 0xE4, 0x34, 0x9D, 0xF5, 0x83, 0x22, 0x13, +0x13, 0x54, 0x03, 0xF5, 0x6C, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0xA1, 0xC4, +0xEF, 0x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E4, 0xF0, 0xA3, 0x22, 0xB1, 0xFD, 0xE0, 0x44, 0x40, 0xF0, 0x22, 0xF5, 0x82, 0xE4, 0x34, +0x93, 0xF5, 0x83, 0x22, 0x90, 0xA1, 0x14, 0xE0, 0xFF, 0x75, 0xF0, 0x10, 0x22, 0x12, 0x49, 0x22, +0xE0, 0xFD, 0x75, 0xF0, 0x10, 0x22, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x90, 0xA1, 0x25, 0xF0, 0x22, +0x74, 0x91, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x9D, 0xF5, 0x83, 0x22, 0xED, 0x54, 0x07, 0xFF, 0x74, +0x01, 0x7E, 0x00, 0xA8, 0x07, 0x08, 0x22, 0x12, 0x49, 0x22, 0xE0, 0xFE, 0xED, 0xFF, 0x90, 0xA1, +0x14, 0xE0, 0x22, 0x90, 0x07, 0x1F, 0xE0, 0x54, 0x7F, 0xF0, 0x90, 0x07, 0x1C, 0xE0, 0x54, 0x01, +0xFF, 0x90, 0xA0, 0xE6, 0xF0, 0x90, 0xA0, 0xE4, 0x74, 0x02, 0xF0, 0x90, 0xA0, 0xF2, 0x14, 0xF0, +0xFB, 0x7A, 0xA0, 0x79, 0xE4, 0x12, 0x63, 0x89, 0x7F, 0x04, 0x02, 0x65, 0x78, 0xC0, 0xE0, 0xC0, +0xF0, 0xC0, 0x83, 0xC0, 0x82, 0xC0, 0xD0, 0x75, 0xD0, 0x00, 0xC0, 0x00, 0xC0, 0x01, 0xC0, 0x02, +0xC0, 0x03, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x12, 0x98, 0x54, 0xE5, 0x21, 0x30, +0xE1, 0x02, 0x11, 0xAE, 0xE5, 0x21, 0x30, 0xE2, 0x03, 0x12, 0x9E, 0xF9, 0xE5, 0x22, 0x30, 0xE0, +0x03, 0x12, 0x9C, 0xD2, 0xE5, 0x23, 0x30, 0xE1, 0x03, 0x12, 0x9D, 0x6A, 0xE5, 0x23, 0x30, 0xE0, +0x03, 0x12, 0x9E, 0x91, 0xE5, 0x23, 0x30, 0xE2, 0x0A, 0x12, 0x82, 0xD3, 0x90, 0x07, 0x8F, 0xE0, +0x44, 0x10, 0xF0, 0xE5, 0x23, 0x30, 0xE3, 0x02, 0xF1, 0xE4, 0xE5, 0x24, 0x30, 0xE1, 0x05, 0x7F, +0x04, 0x12, 0x61, 0x4B, 0xE5, 0x24, 0x30, 0xE4, 0x02, 0x11, 0xB8, 0xE5, 0x24, 0x30, 0xE5, 0x03, +0x12, 0x5E, 0x96, 0xE5, 0x24, 0x30, 0xE6, 0x03, 0x12, 0x9F, 0x10, 0xE5, 0x24, 0x30, 0xE7, 0x03, +0x12, 0x82, 0x7F, 0xD0, 0x07, 0xD0, 0x06, 0xD0, 0x05, 0xD0, 0x04, 0xD0, 0x03, 0xD0, 0x02, 0xD0, +0x01, 0xD0, 0x00, 0xD0, 0xD0, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xF0, 0xD0, 0xE0, 0x32, 0x90, 0x9F, +0xA7, 0xE0, 0x60, 0x03, 0x12, 0x97, 0x5B, 0x22, 0x12, 0x57, 0x01, 0x12, 0x5F, 0xA0, 0x11, 0xF0, +0x90, 0xA0, 0x52, 0xE0, 0x30, 0xE0, 0x28, 0x12, 0x80, 0x20, 0x90, 0xA0, 0x55, 0xE0, 0x60, 0x05, +0x14, 0xF0, 0x02, 0x80, 0x29, 0x90, 0xA0, 0x53, 0xE0, 0x14, 0x90, 0xA0, 0x55, 0xF0, 0x90, 0x05, +0x73, 0x74, 0x01, 0xF0, 0xE4, 0xFF, 0x12, 0x7F, 0xBE, 0x12, 0x5F, 0xA0, 0x12, 0x80, 0x19, 0x22, +0x90, 0xA0, 0x5F, 0xE0, 0x30, 0xE0, 0x04, 0xE4, 0xFF, 0x11, 0xFC, 0x22, 0xD3, 0x10, 0xAF, 0x01, +0xC3, 0xC0, 0xD0, 0x90, 0xA1, 0xAC, 0xEF, 0xF0, 0xA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 0x0B, 0xEF, 0x13, 0x13, +0x54, 0x3F, 0x30, 0xE0, 0x03, 0x12, 0x87, 0x74, 0xE4, 0xFD, 0xFF, 0x12, 0x57, 0x8F, 0xD1, 0xBB, +0x30, 0xE0, 0x04, 0x7F, 0x01, 0xF1, 0xE5, 0x90, 0xA0, 0x63, 0xE0, 0xC3, 0x13, 0x30, 0xE0, 0x0E, +0x90, 0x06, 0xCD, 0xE0, 0x44, 0x10, 0xF0, 0x90, 0x06, 0xCF, 0xE0, 0x44, 0x10, 0xF0, 0xD0, 0xD0, +0x92, 0xAF, 0x22, 0xE0, 0xC3, 0x9F, 0xFF, 0xE4, 0x90, 0xA1, 0x8E, 0xF0, 0xA3, 0xEF, 0xF0, 0xE4, +0xFB, 0xFD, 0x7F, 0x6C, 0x7E, 0x01, 0x02, 0x50, 0x1B, 0xE0, 0xFF, 0x51, 0xB7, 0x90, 0xA0, 0x72, +0xE0, 0x04, 0xF0, 0x22, 0x91, 0x7D, 0x20, 0xE0, 0x02, 0x81, 0x61, 0x90, 0xA0, 0x67, 0xE0, 0x64, +0x01, 0x70, 0x2A, 0x90, 0x06, 0x92, 0xE0, 0x20, 0xE2, 0x06, 0x90, 0x04, 0xE3, 0xE0, 0x60, 0x18, +0x91, 0x68, 0x91, 0x76, 0x90, 0xA0, 0x6B, 0xE0, 0x75, 0xF0, 0x03, 0x84, 0xFF, 0x90, 0xA0, 0x74, +0xE0, 0xB5, 0x07, 0x02, 0x80, 0x02, 0x81, 0x4C, 0xF1, 0xDB, 0x04, 0xF0, 0x22, 0x90, 0xA0, 0x67, +0xE0, 0x64, 0x04, 0x70, 0x27, 0x90, 0x06, 0x92, 0xE0, 0x20, 0xE2, 0x06, 0x90, 0x04, 0xE3, 0xE0, +0x60, 0x14, 0x91, 0x68, 0x91, 0x76, 0x90, 0xA0, 0x6A, 0xE0, 0xFF, 0x90, 0xA0, 0x74, 0xE0, 0xB5, +0x07, 0x02, 0x80, 0x02, 0x81, 0x4C, 0xF1, 0xDB, 0x74, 0x04, 0xF0, 0x22, 0x90, 0xA0, 0x67, 0xE0, +0x64, 0x06, 0x60, 0x02, 0x61, 0xDA, 0xB1, 0x07, 0x50, 0x08, 0x90, 0xA0, 0x75, 0xE0, 0x94, 0x03, +0x40, 0x1A, 0xF1, 0xA0, 0x90, 0xA0, 0x72, 0x30, 0xE0, 0x05, 0x74, 0x05, 0xF0, 0x80, 0x03, 0x74, +0x02, 0xF0, 0xE4, 0x90, 0xA0, 0x67, 0xF0, 0x90, 0xA0, 0x75, 0xF0, 0x22, 0x90, 0xA0, 0x66, 0xB1, +0x00, 0x30, 0xE0, 0x35, 0xF1, 0xB8, 0xF1, 0xA0, 0x30, 0xE0, 0x0B, 0x90, 0xA0, 0x84, 0xE0, 0x20, +0xE0, 0x02, 0x81, 0x05, 0x80, 0x78, 0xB1, 0x07, 0x40, 0x0B, 0x90, 0xA0, 0x84, 0xE0, 0x30, 0xE0, +0x02, 0x80, 0x6B, 0x80, 0x70, 0x90, 0xA0, 0x84, 0xE0, 0x30, 0xE0, 0x06, 0x91, 0x62, 0xF1, 0xC9, +0x80, 0x6C, 0x90, 0xA0, 0x72, 0x74, 0x02, 0xF0, 0x22, 0x91, 0x87, 0x90, 0xA0, 0x75, 0xE0, 0x04, +0xF0, 0x7F, 0x03, 0x51, 0xB7, 0xB1, 0x07, 0x50, 0x0A, 0x90, 0xA0, 0x75, 0xE0, 0x94, 0x03, 0x50, +0x02, 0x81, 0x61, 0x7F, 0x03, 0xD1, 0xC6, 0x90, 0x05, 0x22, 0xE0, 0x44, 0x10, 0xFF, 0x7D, 0x03, +0x12, 0x57, 0x8F, 0x90, 0x04, 0x9C, 0xE0, 0x04, 0xF0, 0x22, 0x90, 0xA0, 0x67, 0xE0, 0x64, 0x07, +0x70, 0x2F, 0x90, 0xA0, 0x75, 0xE0, 0xB4, 0x04, 0x04, 0x91, 0x6F, 0x80, 0x59, 0x90, 0xA0, 0x66, +0xB1, 0x00, 0x30, 0xE0, 0x12, 0xF1, 0xB8, 0x90, 0xA0, 0x84, 0xE0, 0x30, 0xE0, 0x07, 0x91, 0x62, +0xF1, 0xC9, 0x04, 0x80, 0x09, 0x80, 0x68, 0x91, 0x87, 0x90, 0xA0, 0x75, 0xE0, 0x04, 0xF0, 0x80, +0x3B, 0x90, 0xA0, 0x67, 0xE0, 0x64, 0x09, 0x70, 0x48, 0x90, 0xA0, 0x66, 0xE0, 0x30, 0xE0, 0x0A, +0x91, 0x6F, 0x90, 0xA0, 0x66, 0xE0, 0x54, 0xFE, 0xF0, 0x22, 0x90, 0x06, 0x92, 0xE0, 0x30, 0xE2, +0x1F, 0x74, 0x04, 0xF0, 0x91, 0x76, 0xE0, 0xB4, 0x02, 0x12, 0xF1, 0xB0, 0x60, 0x05, 0x74, 0x05, +0xF0, 0x80, 0x03, 0x74, 0x02, 0xF0, 0xE4, 0x90, 0xA0, 0x67, 0xF0, 0x22, 0x7F, 0x03, 0x41, 0xB7, +0xF1, 0xB0, 0x60, 0x05, 0x74, 0x05, 0xF0, 0x80, 0x03, 0x74, 0x02, 0xF0, 0xE4, 0x90, 0xA0, 0x67, +0xF0, 0x22, 0x90, 0xA0, 0x67, 0x74, 0x09, 0xF0, 0x90, 0x06, 0x92, 0x74, 0x04, 0xF0, 0x22, 0x90, +0xA0, 0x72, 0x74, 0x05, 0xF0, 0x22, 0x90, 0xA0, 0x74, 0xE0, 0x04, 0xF0, 0x22, 0x90, 0xA0, 0x63, +0xE0, 0xC4, 0x13, 0x13, 0x54, 0x03, 0x22, 0x90, 0xA0, 0x66, 0xE0, 0x44, 0x02, 0xF0, 0x7D, 0x08, +0x7F, 0x01, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0xA1, 0xA7, 0xEF, 0xF0, 0xA3, 0xED, +0xF0, 0x90, 0x9E, 0x94, 0xE0, 0x04, 0xF0, 0x90, 0x04, 0x1D, 0xE0, 0x60, 0x2A, 0x90, 0x05, 0x22, +0xE0, 0x90, 0xA1, 0xAB, 0xF0, 0x7D, 0x26, 0xF1, 0x3D, 0xEF, 0x64, 0x01, 0x70, 0x02, 0x80, 0x05, +0x91, 0x7D, 0x30, 0xE0, 0x03, 0x12, 0x86, 0x66, 0x90, 0xA1, 0xAB, 0xE0, 0xFF, 0x7D, 0x27, 0x12, +0x57, 0x8F, 0x12, 0xA7, 0xA2, 0x80, 0x06, 0x12, 0xA7, 0xA2, 0x12, 0x86, 0x66, 0x90, 0xA0, 0x5F, +0xE0, 0x30, 0xE0, 0x0D, 0x91, 0x7D, 0x30, 0xE0, 0x08, 0x12, 0x87, 0xC4, 0x7D, 0x28, 0x12, 0x57, +0x8F, 0x12, 0x85, 0x4B, 0x7F, 0x01, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xB1, 0x2F, 0x90, 0xA0, 0x63, +0xE0, 0xFF, 0x13, 0x13, 0x54, 0x3F, 0x22, 0x90, 0xA0, 0x75, 0xE0, 0xFF, 0x90, 0xA0, 0x74, 0xE0, +0x2F, 0xFF, 0xE4, 0x33, 0xFE, 0x7C, 0x00, 0x7D, 0x03, 0x12, 0x07, 0x03, 0x90, 0xA0, 0x6B, 0xE0, +0x2F, 0xFF, 0xEC, 0x3E, 0xFE, 0xC3, 0xEF, 0x94, 0x41, 0xEE, 0x64, 0x80, 0x94, 0x80, 0x22, 0xD3, +0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xEF, 0xB4, 0x03, 0x0F, 0x90, 0xA0, 0x62, 0x91, 0x80, 0x90, +0x06, 0xCC, 0x30, 0xE0, 0x35, 0xE4, 0xF0, 0x80, 0x34, 0x90, 0xA0, 0x63, 0xE0, 0xC4, 0x54, 0x0F, +0x30, 0xE0, 0x0C, 0xEF, 0x90, 0x06, 0xCC, 0x70, 0x03, 0xF0, 0x80, 0x03, 0x74, 0x03, 0xF0, 0x90, +0xA0, 0xAD, 0xE0, 0x30, 0xE0, 0x17, 0xC4, 0x54, 0x0F, 0x30, 0xE0, 0x0B, 0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xB4, 0x05, 0x05, 0xE4, 0x90, 0xA0, 0x72, 0xF0, 0xF1, 0xC0, 0x30, +0xE0, 0x17, 0x90, 0xA0, 0xF4, 0xE0, 0xB4, 0x02, 0x04, 0x7D, 0x08, 0x80, 0x4E, 0x90, 0xA0, 0xF4, +0xE0, 0x64, 0x05, 0x70, 0x4B, 0x7D, 0x0E, 0x80, 0x42, 0xF1, 0xA8, 0x30, 0xE0, 0x20, 0x12, 0x87, +0xA2, 0x20, 0xE0, 0x03, 0x12, 0xA9, 0x1E, 0x90, 0xA0, 0xF4, 0xE0, 0xB4, 0x02, 0x04, 0x7D, 0x09, +0x80, 0x29, 0x90, 0xA0, 0xF4, 0xE0, 0x64, 0x05, 0x70, 0x26, 0x7D, 0x0F, 0x80, 0x1D, 0x90, 0x9F, +0xA7, 0xE0, 0x60, 0x1C, 0x12, 0xA9, 0x1E, 0x90, 0xA0, 0xF4, 0xE0, 0xB4, 0x02, 0x04, 0x7D, 0x0A, +0x80, 0x09, 0x90, 0xA0, 0xF4, 0xE0, 0xB4, 0x05, 0x07, 0x7D, 0x10, 0x7F, 0x6F, 0x12, 0x57, 0x8F, +0x90, 0xA0, 0x62, 0xE0, 0x30, 0xE0, 0x03, 0x12, 0x5E, 0x36, 0xD1, 0xBB, 0x30, 0xE0, 0x04, 0xE4, +0xFF, 0xF1, 0xE5, 0x90, 0xA0, 0x63, 0xE0, 0xC3, 0x13, 0x30, 0xE0, 0x0E, 0x90, 0x06, 0xCD, 0xE0, +0x54, 0xEF, 0xF0, 0x90, 0x06, 0xCF, 0xE0, 0x54, 0xEF, 0xF0, 0x22, 0x90, 0xA0, 0x62, 0xE0, 0xC4, +0x13, 0x13, 0x13, 0x54, 0x01, 0x22, 0x90, 0xA0, 0x84, 0x12, 0x80, 0xDA, 0x30, 0xE0, 0x07, 0x90, +0x07, 0x78, 0x74, 0x09, 0xF0, 0x22, 0x90, 0xA0, 0xBF, 0xE0, 0x30, 0xE0, 0x1D, 0xEF, 0x24, 0xFD, +0x60, 0x0E, 0x24, 0xFA, 0x60, 0x0E, 0x24, 0xFC, 0x60, 0x0E, 0x24, 0x0C, 0x7F, 0x02, 0x80, 0x0A, +0x7F, 0x03, 0x80, 0x06, 0x7F, 0x0B, 0x80, 0x02, 0x7F, 0x0E, 0x90, 0x07, 0x78, 0xEF, 0xF0, 0x22, +0x90, 0xA0, 0x5F, 0xE0, 0x30, 0xE0, 0x35, 0x51, 0xD4, 0x90, 0xA0, 0x72, 0xE0, 0xFF, 0xB4, 0x01, +0x02, 0x80, 0x1C, 0x90, 0xA0, 0x72, 0xE0, 0xFF, 0xB4, 0x02, 0x02, 0x80, 0x1D, 0x90, 0xA0, 0x72, +0xE0, 0xFF, 0xB4, 0x03, 0x02, 0x01, 0xFC, 0x90, 0xA0, 0x72, 0xE0, 0xFF, 0xB4, 0x04, 0x03, 0x02, +0x83, 0x46, 0x90, 0xA0, 0x72, 0xE0, 0xFF, 0xB4, 0x05, 0x02, 0xB1, 0x82, 0x22, 0x7F, 0xFF, 0x12, +0x57, 0x8F, 0xE4, 0x90, 0xA1, 0xE0, 0xF0, 0xA3, 0xF0, 0x90, 0x05, 0xF8, 0xE0, 0x70, 0x0F, 0xA3, +0xE0, 0x70, 0x0B, 0xA3, 0xE0, 0x70, 0x07, 0xA3, 0xE0, 0x70, 0x03, 0x7F, 0x01, 0x22, 0x91, 0x7D, +0x30, 0xE0, 0x15, 0xD3, 0x90, 0xA1, 0xE1, 0xE0, 0x94, 0x03, 0x90, 0xA1, 0xE0, 0xE0, 0x94, 0x00, +0x40, 0x02, 0x80, 0x13, 0x7F, 0x01, 0x80, 0x1B, 0xD3, 0x90, 0xA1, 0xE1, 0xE0, 0x94, 0xE8, 0x90, +0xA1, 0xE0, 0xE0, 0x94, 0x03, 0x40, 0x0A, 0x90, 0x01, 0xC0, 0xE0, 0x44, 0x20, 0xF0, 0x7F, 0x00, +0x22, 0x7F, 0x32, 0x7E, 0x00, 0x12, 0x3D, 0x7A, 0x90, 0x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 0x12, 0x67, 0xD6, 0xFF, 0x54, 0x20, 0xFE, 0x90, 0xA0, 0x63, 0xE0, 0x54, 0xDF, 0x4E, +0xFE, 0xF0, 0xEF, 0x54, 0x40, 0xFF, 0xEE, 0x54, 0xBF, 0x4F, 0x12, 0x67, 0xD5, 0xFE, 0x54, 0x80, +0xFD, 0xEF, 0x54, 0x7F, 0x4D, 0xFF, 0x90, 0xA0, 0x63, 0xF0, 0xEE, 0x54, 0x01, 0xFE, 0xEF, 0x54, +0xFE, 0x12, 0x67, 0xD4, 0xD1, 0x27, 0x90, 0xA0, 0x63, 0xF0, 0xEE, 0x54, 0x02, 0xFE, 0xEF, 0x54, +0xFD, 0x12, 0x67, 0xD4, 0x12, 0xA8, 0x82, 0x90, 0xA0, 0x63, 0x12, 0xA8, 0xB8, 0x4E, 0xF0, 0x12, +0x75, 0x00, 0x20, 0xE0, 0x03, 0x12, 0x5E, 0x33, 0x12, 0x65, 0xBF, 0x12, 0x06, 0x89, 0x20, 0xE0, +0x02, 0x81, 0xD8, 0x90, 0x05, 0x54, 0xE0, 0x90, 0xA0, 0x70, 0xF0, 0xE0, 0xC3, 0x13, 0x90, 0xA0, +0x6F, 0xF0, 0x12, 0x77, 0xA0, 0x30, 0xE0, 0x0F, 0x12, 0x66, 0xFC, 0x90, 0xA0, 0x60, 0x12, 0x67, +0x35, 0x90, 0xA0, 0x61, 0xF0, 0x80, 0x42, 0x12, 0x66, 0xFC, 0xFF, 0xC3, 0x94, 0x2A, 0x50, 0x12, +0xEF, 0xC3, 0x94, 0x03, 0x90, 0xA0, 0x60, 0x50, 0x05, 0x74, 0x03, 0xF0, 0x80, 0x0A, 0xEF, 0xF0, +0x80, 0x06, 0x90, 0xA0, 0x60, 0x74, 0x2A, 0xF0, 0x12, 0x67, 0x36, 0xFF, 0xC3, 0x94, 0x2A, 0x50, +0x12, 0xEF, 0xC3, 0x94, 0x03, 0x90, 0xA0, 0x61, 0x50, 0x05, 0x74, 0x03, 0xF0, 0x80, 0x0A, 0xEF, +0xF0, 0x80, 0x06, 0x90, 0xA0, 0x61, 0x74, 0x2A, 0xF0, 0x12, 0x74, 0x7D, 0x30, 0xE0, 0x3D, 0x90, +0xA0, 0x60, 0xE0, 0x75, 0xF0, 0x03, 0x84, 0x90, 0xA0, 0x68, 0xF0, 0xE0, 0xC3, 0x13, 0xA3, 0xF0, +0x90, 0xA0, 0x61, 0xE0, 0x75, 0xF0, 0x03, 0x84, 0x90, 0xA0, 0x6A, 0xF0, 0x90, 0xA0, 0x60, 0xE0, +0xC3, 0x13, 0x90, 0xA0, 0x6B, 0xF0, 0x90, 0xA0, 0x61, 0xE0, 0xC3, 0x13, 0x90, 0xA0, 0x6C, 0xF0, +0x90, 0x01, 0x3E, 0x74, 0x08, 0xF0, 0xFD, 0x7F, 0x02, 0x12, 0x5E, 0xFF, 0xE4, 0x90, 0xA0, 0x9E, +0xF0, 0x51, 0xCD, 0xC4, 0x13, 0x13, 0x54, 0x03, 0x20, 0xE0, 0x39, 0x90, 0xA0, 0x5F, 0xE0, 0xFF, +0xC3, 0x13, 0x20, 0xE0, 0x07, 0xEF, 0x12, 0x76, 0xBF, 0x30, 0xE0, 0x28, 0x12, 0x06, 0x89, 0x13, +0x13, 0x13, 0x54, 0x1F, 0x30, 0xE0, 0x08, 0x90, 0xA0, 0xA0, 0xE0, 0x60, 0x08, 0x80, 0x0B, 0x90, +0xA0, 0xA0, 0xE0, 0x60, 0x05, 0x75, 0x51, 0x01, 0x80, 0x03, 0xE4, 0xF5, 0x51, 0x7D, 0x02, 0xAF, +0x51, 0x12, 0x4D, 0x38, 0x12, 0x77, 0xA8, 0x30, 0xE0, 0x12, 0x12, 0x87, 0xA2, 0x30, 0xE0, 0x07, +0x7D, 0x04, 0x7F, 0x02, 0x12, 0x5A, 0x74, 0xD1, 0x31, 0x74, 0x11, 0xF0, 0x90, 0x05, 0x58, 0x74, +0x02, 0xF0, 0x90, 0xA0, 0x67, 0xE0, 0xFF, 0xB4, 0x01, 0x08, 0x90, 0xA0, 0x72, 0x74, 0x01, 0xF0, +0x80, 0x1F, 0xEF, 0xB4, 0x04, 0x08, 0x90, 0xA0, 0x72, 0x74, 0x04, 0xF0, 0x80, 0x13, 0xEF, 0xB4, +0x06, 0x08, 0x90, 0xA0, 0x72, 0x74, 0x02, 0xF0, 0x80, 0x07, 0xEF, 0xB4, 0x07, 0x03, 0x12, 0x74, +0x6F, 0xE4, 0x90, 0xA0, 0x67, 0xF0, 0x80, 0x55, 0x51, 0xCD, 0x12, 0x5E, 0x8F, 0x30, 0xE0, 0x05, +0x75, 0x52, 0x02, 0x80, 0x11, 0x12, 0x06, 0x89, 0x12, 0x5E, 0xCC, 0x30, 0xE0, 0x05, 0x75, 0x52, +0x01, 0x80, 0x03, 0xE4, 0xF5, 0x52, 0x12, 0x90, 0x4B, 0x90, 0xA0, 0xBF, 0xE0, 0x30, 0xE0, 0x04, +0x7D, 0xA0, 0x80, 0x02, 0x7D, 0x20, 0x7F, 0x40, 0x12, 0x49, 0x90, 0x51, 0xCD, 0x13, 0x13, 0x13, +0x54, 0x1F, 0x30, 0xE0, 0x04, 0x7F, 0x03, 0x80, 0x02, 0x7F, 0x01, 0x12, 0x76, 0xC6, 0xAD, 0x52, +0x7F, 0x02, 0x12, 0x4D, 0x38, 0x12, 0x5E, 0x36, 0xD1, 0x31, 0x74, 0x43, 0xF0, 0x12, 0x87, 0xD4, +0x90, 0xA0, 0x71, 0xF0, 0x12, 0x76, 0xBB, 0x30, 0xE0, 0x09, 0x90, 0xA0, 0x91, 0xE0, 0x44, 0x02, +0xF0, 0x80, 0x0C, 0x7F, 0x01, 0x12, 0x77, 0xE5, 0x90, 0xA0, 0x91, 0xE0, 0x54, 0xFD, 0xF0, 0x7F, +0x03, 0x12, 0x75, 0x2F, 0x90, 0xA0, 0x5F, 0xE0, 0x20, 0xE0, 0x07, 0x90, 0xA0, 0x63, 0xE0, 0x54, +0xBF, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x12, 0x67, 0xE9, 0x12, 0x06, 0x89, 0xF5, 0x51, 0x24, +0x91, 0xD1, 0x03, 0xE0, 0x54, 0x9C, 0xF0, 0x74, 0x91, 0x25, 0x51, 0xD1, 0x03, 0xC0, 0x83, 0xC0, +0x82, 0x51, 0xCB, 0x54, 0x01, 0xFE, 0xEF, 0x4E, 0xD0, 0x82, 0xD0, 0x83, 0xF0, 0x74, 0x91, 0x25, +0x51, 0xD1, 0x03, 0xC0, 0x83, 0xC0, 0x82, 0x51, 0xCB, 0x54, 0x02, 0xFE, 0xEF, 0x4E, 0xD0, 0x82, +0xD0, 0x83, 0xF0, 0x74, 0x91, 0x25, 0x51, 0xD1, 0x03, 0xC0, 0x83, 0xC0, 0x82, 0x51, 0xCB, 0x54, +0x40, 0xFE, 0xEF, 0x4E, 0xD0, 0x82, 0xD0, 0x83, 0xF0, 0x74, 0x91, 0x25, 0x51, 0xD1, 0x03, 0xC0, +0x83, 0xC0, 0x82, 0x51, 0xCB, 0x54, 0x20, 0xFE, 0xEF, 0x4E, 0xD0, 0x82, 0xD0, 0x83, 0xF0, 0xE5, +0x51, 0xC3, 0x94, 0x80, 0x50, 0x09, 0x12, 0x67, 0x36, 0xFF, 0x12, 0x56, 0xA4, 0xEF, 0xF0, 0x74, +0x91, 0x25, 0x51, 0xD1, 0x03, 0xE0, 0x30, 0xE5, 0x12, 0x12, 0x4E, 0x26, 0x13, 0x13, 0x54, 0x03, +0xFB, 0x12, 0x56, 0xA4, 0xE0, 0xFD, 0xAF, 0x51, 0x12, 0xA5, 0xBD, 0x22, 0xE4, 0xF5, 0x64, 0x74, +0x91, 0x25, 0x5E, 0xF5, 0x82, 0xE4, 0x34, 0x99, 0xF5, 0x83, 0x22, 0xF0, 0xEE, 0x54, 0x40, 0xFE, +0xEF, 0x54, 0xBF, 0x22, 0xF0, 0xEE, 0x54, 0x10, 0xFE, 0xEF, 0x54, 0xEF, 0x4E, 0xFF, 0xF0, 0x02, +0x06, 0x89, 0xFF, 0xF0, 0x12, 0x06, 0x89, 0xFE, 0x54, 0x04, 0xFD, 0xEF, 0x54, 0xFB, 0x4D, 0xFF, +0x22, 0x90, 0x05, 0x00, 0x74, 0x1C, 0xF0, 0xA3, 0x22, 0x54, 0x80, 0xFE, 0xEF, 0x54, 0x7F, 0x4E, +0x22, 0xFE, 0x54, 0x20, 0xFD, 0xEF, 0x54, 0xDF, 0x4D, 0xFF, 0x22, 0xE0, 0x54, 0xFE, 0x4E, 0xFE, +0xF0, 0xEF, 0x54, 0x02, 0xFF, 0xEE, 0x54, 0xFD, 0x4F, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, +0xD0, 0x12, 0x06, 0x89, 0x90, 0xA0, 0xCA, 0x12, 0x66, 0xFB, 0x90, 0xA0, 0xCB, 0x12, 0x67, 0x35, +0x90, 0xA0, 0xCC, 0xF0, 0x51, 0xD3, 0x90, 0xA0, 0xCD, 0x12, 0x67, 0xD6, 0x90, 0xA0, 0xCE, 0x31, +0xE6, 0x90, 0xA0, 0x87, 0xE0, 0x44, 0x40, 0xF0, 0x90, 0xA0, 0xCB, 0xE0, 0xB4, 0x0C, 0x06, 0xE5, +0x72, 0x70, 0x0D, 0x80, 0x00, 0xD1, 0xD8, 0x7D, 0x07, 0x7F, 0x30, 0x12, 0x61, 0x03, 0x8F, 0x51, +0x90, 0xA0, 0xCB, 0xE0, 0xB4, 0x0D, 0x0E, 0xE5, 0x51, 0x64, 0x01, 0x60, 0x05, 0x75, 0x72, 0x01, +0x80, 0x03, 0xE4, 0xF5, 0x72, 0xE5, 0x51, 0xB4, 0x01, 0x05, 0x75, 0x52, 0x01, 0x80, 0x03, 0xE4, +0xF5, 0x52, 0x90, 0xA0, 0xCA, 0xE0, 0xFB, 0xAD, 0x52, 0xE4, 0xFF, 0x12, 0x8F, 0xF0, 0x7F, 0x04, +0x12, 0x65, 0x78, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x7B, 0x01, 0x7A, 0xA0, 0x79, 0xC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0, 0x7F, 0x0A, 0x7E, 0x00, 0x02, 0x3D, 0x7A, 0xF1, 0x8B, 0x90, 0xA0, 0x52, +0xD1, 0x4B, 0x12, 0x66, 0xFB, 0x90, 0xA0, 0x53, 0x12, 0x67, 0x35, 0x90, 0xA0, 0x54, 0xF0, 0x90, +0xA0, 0x53, 0xE0, 0x90, 0xA0, 0x55, 0xF0, 0x90, 0xA0, 0x52, 0xE0, 0x54, 0x01, 0xFF, 0xD3, 0x10, +0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xAC, 0x07, 0xEF, 0x54, 0x01, 0xFE, 0x90, 0xA0, 0x52, 0xE0, 0x54, +0xFE, 0x4E, 0xF0, 0xEF, 0x64, 0x01, 0x70, 0x24, 0x90, 0x01, 0x53, 0xF0, 0x90, 0xA0, 0x54, 0xE0, +0x60, 0x0C, 0x7D, 0x10, 0x7F, 0x03, 0x12, 0x5E, 0xFF, 0x12, 0x80, 0x20, 0x80, 0x1C, 0x12, 0x80, +0x0F, 0x12, 0x5F, 0xBD, 0x12, 0x5F, 0x14, 0x12, 0x80, 0x29, 0x80, 0x0E, 0x12, 0x80, 0x0F, 0x12, +0x5E, 0xFF, 0x12, 0x5F, 0xA0, 0x11, 0x19, 0x12, 0x5F, 0xC4, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, +0x01, 0x53, 0x74, 0x03, 0xF0, 0x7D, 0x10, 0xFF, 0x22, 0x7D, 0x01, 0x7F, 0x02, 0x02, 0x5F, 0xA4, +0x90, 0xA0, 0x54, 0xE0, 0x90, 0x05, 0x73, 0xF0, 0x22, 0x7D, 0x2F, 0x12, 0x4A, 0xD5, 0x7D, 0x08, +0x12, 0x57, 0xD0, 0x74, 0x08, 0xF0, 0x22, 0x90, 0xA0, 0x52, 0xE0, 0x30, 0xE0, 0x0C, 0x90, 0x01, +0x3B, 0xE0, 0x30, 0xE4, 0x05, 0x12, 0x5F, 0x14, 0x11, 0x20, 0x22, 0x90, 0xA0, 0x7A, 0xE0,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0x19, 0x51, 0x3D, 0xBC, 0x02, 0x02, 0x80, 0x1B, 0xEC, 0x64, 0x03, 0x70, 0x22, 0x80, 0x1B, +0x51, 0x45, 0x70, 0x04, 0x7F, 0x01, 0x80, 0x15, 0xBC, 0x01, 0x04, 0x7F, 0x03, 0x80, 0x0E, 0x51, +0x45, 0xBC, 0x02, 0x04, 0x7F, 0x09, 0x80, 0x05, 0xBC, 0x03, 0x05, 0x7F, 0x0D, 0x12, 0x76, 0xC6, +0x90, 0xA0, 0xAD, 0xE0, 0xC4, 0x13, 0x54, 0x07, 0x30, 0xE0, 0x3A, 0xED, 0x70, 0x1B, 0xA3, 0xE0, +0x13, 0x13, 0x54, 0x3F, 0x30, 0xE0, 0x07, 0xE4, 0x90, 0xA0, 0xF4, 0xF0, 0x80, 0x02, 0x51, 0x36, +0x90, 0xA0, 0xF4, 0xE0, 0xFD, 0xE4, 0xFF, 0x80, 0x19, 0x90, 0xA0, 0xAE, 0x12, 0x74, 0x80, 0x30, +0xE0, 0x07, 0xE4, 0x90, 0xA0, 0xF4, 0xF0, 0x80, 0x02, 0x51, 0x36, 0x90, 0xA0, 0xF4, 0xE0, 0xFD, +0x7F, 0x01, 0x12, 0x4D, 0x38, 0x22, 0x90, 0xA0, 0xF4, 0x74, 0x01, 0xF0, 0x22, 0x90, 0xA0, 0xAE, +0xE0, 0x54, 0x03, 0xFC, 0x22, 0x90, 0xA0, 0xAE, 0xE0, 0xC4, 0x54, 0x03, 0xFC, 0x22, 0x90, 0xA0, +0xAD, 0xE0, 0xC3, 0x13, 0x54, 0x03, 0xFF, 0x22, 0x90, 0xA0, 0xB9, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, +0xAD, 0x07, 0xEE, 0xFF, 0x90, 0x01, 0x6F, 0xE4, 0xF0, 0x8F, 0x35, 0xAF, 0x05, 0x8F, 0x36, 0xFB, +0xFD, 0x7F, 0x6C, 0x7E, 0x01, 0x12, 0x3B, 0xDB, 0x90, 0x01, 0x6F, 0x74, 0x05, 0xF0, 0x22, 0x90, +0xA0, 0x7A, 0xE0, 0x30, 0xE0, 0x04, 0x51, 0x97, 0x80, 0x03, 0x12, 0x77, 0x00, 0x90, 0xA0, 0xAD, +0xE0, 0x30, 0xE0, 0x02, 0x31, 0x49, 0x22, 0x7D, 0x12, 0x7F, 0xFF, 0x12, 0x57, 0x8F, 0x7F, 0x01, +0x12, 0x76, 0xC6, 0xF1, 0xCC, 0x02, 0x4D, 0x38, 0x51, 0x97, 0x90, 0xA0, 0x7A, 0x71, 0x3F, 0xFE, +0xEF, 0xC3, 0x13, 0x54, 0x0F, 0xC3, 0x9E, 0x40, 0x03, 0x02, 0x90, 0x61, 0x90, 0xA0, 0x7A, 0xE0, +0xFF, 0xC3, 0x13, 0x54, 0x0F, 0xFE, 0xEF, 0x54, 0xE1, 0xFF, 0xEE, 0x04, 0x54, 0x0F, 0x25, 0xE0, +0x4F, 0xF0, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0xA0, 0xAD, 0xE0, 0x30, 0xE0, +0x1F, 0x90, 0xA0, 0xB2, 0xE0, 0xB4, 0x01, 0x0C, 0xA3, 0xE0, 0xB4, 0x01, 0x13, 0x74, 0x02, 0xF0, +0x51, 0x58, 0x80, 0x0C, 0x90, 0xA0, 0xB2, 0xE0, 0xB4, 0x02, 0x05, 0x74, 0x03, 0xF0, 0x31, 0x49, +0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xE4, 0xFF, 0x90, 0xA0, 0x5F, 0xE0, 0x30, 0xE0, 0x2D, 0xA3, 0x12, +0x72, 0xB3, 0x90, 0xA0, 0x72, 0x74, 0x01, 0xF0, 0x90, 0xA0, 0x71, 0xF0, 0x90, 0xA0, 0x51, 0xE0, +0x60, 0x07, 0x7D, 0x05, 0x7F, 0x6F, 0x02, 0x57, 0x8F, 0x12, 0x5E, 0x36, 0x71, 0x3C, 0x20, 0xE0, +0x0A, 0xEF, 0x13, 0x13, 0x54, 0x3F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 0xA0, +0x72, 0xF0, 0x90, 0xA0, 0xF4, 0xE0, 0xFF, 0xB4, 0x01, 0x08, 0x90, 0xA0, 0x67, 0x74, 0x06, 0xF0, +0x80, 0x0A, 0xEF, 0xB4, 0x04, 0x06, 0x90, 0xA0, 0x67, 0x74, 0x07, 0xF0, 0x90, 0xA0, 0x51, 0xE0, +0x60, 0x07, 0x90, 0xA0, 0x66, 0xE0, 0x44, 0x04, 0xF0, 0x90, 0xA0, 0xF4, 0xE0, 0xB4, 0x01, 0x04, +0x7D, 0x06, 0x80, 0x09, 0x90, 0xA0, 0xF4, 0xE0, 0xB4, 0x04, 0x07, 0x7D, 0x0C, 0x7F, 0x6F, 0x12, +0x57, 0x8F, 0x90, 0xA0, 0x63, 0x11, 0xDA, 0x30, 0xE0, 0x14, 0x91, 0x59, 0x50, 0x0A, 0xEF, 0x7F, +0x00, 0x25, 0xE0, 0x25, 0xE0, 0xFE, 0x80, 0x04, 0x7F, 0xFF, 0x7E, 0x7F, 0x91, 0x62, 0x90, 0xA0, +0x62, 0xE0, 0x30, 0xE0, 0x03, 0x12, 0x5E, 0x36, 0x22, 0x90, 0xA0, 0x76, 0xE0, 0xFF, 0xC3, 0x94, +0x20, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0xA0, 0xF7, 0xEE, 0xF0, 0xA3, 0xEF, +0xF0, 0x90, 0x04, 0x1D, 0xE0, 0x60, 0x1E, 0x90, 0x05, 0x22, 0xE0, 0x90, 0xA0, 0xFB, 0xF0, 0x7D, +0x36, 0x12, 0x77, 0x3D, 0xBF, 0x01, 0x02, 0xF1, 0x02, 0x90, 0xA0, 0xFB, 0xE0, 0xFF, 0x7D, 0x37, +0x12, 0x57, 0x8F, 0x80, 0x02, 0xF1, 0x02, 0xF1, 0xC4, 0x7D, 0x38, 0x12, 0x57, 0x8F, 0xB1, 0x4B, +0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xD3, 0x10, 0xAF, 0x01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, 0x04, +0x1D, 0xE0, 0x70, 0x15, 0x90, 0x9E, 0x99, 0xE0, 0xFF, 0x7B, 0x18, 0xE4, 0xFD, 0x91, 0xA5, 0x90, +0xA1, 0xE4, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0xB1, 0x4B, 0x22, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, +0x83, 0x22, 0x90, 0xA0, 0x63, 0xE0, 0xC4, 0x13, 0x54, 0x07, 0x22, 0xF5, 0x82, 0xE4, 0x34, 0xFC, +0xF5, 0x83, 0xEF, 0xF0, 0x22, 0xEF, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x22, 0x90, 0xFD, 0x10, 0xEF, +0xF0, 0x7F, 0x00, 0x22, 0x90, 0x05, 0x22, 0xE0, 0x54, 0x6F, 0xFF, 0x22, 0x90, 0xA0, 0xA0, 0xE0, +0xFF, 0xE4, 0xFD, 0x22, 0x90, 0xA0, 0x65, 0xE0, 0x54, 0xDF, 0xF0, 0xE4, 0x22, 0xD3, 0x10, 0xAF, +0x01, 0xC3, 0xC0, 0xD0, 0x12, 0x78, 0x45, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xD3, 0x10, 0xAF, 0x01, +0xC3, 0xC0, 0xD0, 0xC0, 0x07, 0xC0, 0x05, 0x90, 0xA1, 0x92, 0x12, 0x49, 0x0A, 0x90, 0xAA, 0x9C, +0x12, 0x08, 0x6D, 0xD0, 0x05, 0xD0, 0x07, 0x12, 0x32, 0x34, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x7E, +0x00, 0x7F, 0x19, 0x7D, 0x00, 0x7B, 0x01, 0x7A, 0xA0, 0x79, 0x91, 0x12, 0x08, 0xAA, 0xF1, 0x03, +0x90, 0xA0, 0x98, 0x12, 0x49, 0x0A, 0x90, 0xA0, 0x94, 0x12, 0x08, 0x6D, 0x90, 0x9E, 0x97, 0xE0, +0xFF, 0x64, 0x02, 0x70, 0x22, 0x31, 0x2A, 0x30, 0xE0, 0x02, 0x7E, 0x01, 0x90, 0xA0, 0xA0, 0xEE, +0xF0, 0x31, 0x2A, 0x30, 0xE1, 0x02, 0x7E, 0x01, 0x90, 0xA0, 0xA1, 0xEE, 0xF0, 0x90, 0xFD, 0x80, +0xE0, 0x90, 0x02, 0xFB, 0xF0, 0x80, 0x3A, 0xEF, 0x64, 0x01, 0x70, 0x15, 0x11, 0xC3, 0x30, 0xE0, +0x02, 0x7F, 0x01, 0x90, 0xA0, 0xA0, 0xEF, 0xF0, 0x11, 0xC3, 0x30, 0xE1, 0x02, 0x7F, 0x01, 0x80, +0x1B, 0x90, 0x9E, 0x97, 0xE0, 0x64, 0x03, 0x70, 0x18, 0x11, 0xBC, 0x30, 0xE0, 0x02, 0x7F, 0x01, +0x90, 0xA0, 0xA0, 0xEF, 0xF0, 0x11, 0xBC, 0x30, 0xE1, 0x02, 0x7F, 0x01, 0x90, 0xA0, 0xA1, 0xEF, +0xF0, 0x90, 0xFD, 0x68, 0xE0, 0x44, 0x02, 0xF0, 0x7F, 0x01, 0x12, 0x76, 0xC6, 0x11, 0xCA, 0x12, +0x90, 0x4B, 0x90, 0xA0, 0x78, 0x74, 0x01, 0xF0, 0x90, 0xA0, 0xAD, 0xE0, 0x54, 0xFE, 0xF0, 0x90, +0x04, 0x8F, 0xE4, 0xF0, 0x90, 0xA0, 0xBF, 0xE0, 0x54, 0xFE, 0xF0, 0x22, 0x90, 0xFD, 0x78, 0xE0, +0x7F, 0x00, 0x22, 0x90, 0xFD, 0x70, 0xE0, 0x7F, 0x00, 0x22, 0x7E, 0x00, 0x7F, 0x32, 0x7D, 0x00, +0x7B, 0x01, 0x7A, 0xA0, 0x79, 0x5F, 0x12, 0x08, 0xAA, 0x90, 0xA0, 0x60, 0x74, 0x0B, 0xF0, 0xA3, +0x74, 0x08, 0xF0, 0x90, 0x9E, 0x97, 0xE0, 0xFC, 0x64, 0x02, 0x70, 0x14, 0x31, 0x2A, 0x30, 0xE2, +0x02, 0x7E, 0x01, 0xEE, 0x31, 0x31, 0xFE, 0x90, 0xA0, 0x62, 0xE0, 0x54, 0xBF, 0x4E, 0xF0, 0x22, +0xEC, 0x64, 0x01, 0x70, 0x09, 0x11, 0xC3, 0x30, 0xE2, 0x02, 0x7F, 0x01, 0x80, 0x0F, 0x90, 0x9E, +0x97, 0xE0, 0x64, 0x03, 0x70, 0x13, 0x11, 0xBC, 0x30, 0xE2, 0x02, 0x7F, 0x01, 0xEF, 0x31, 0x31, +0xFF, 0x90, 0xA0, 0x62, 0xE0, 0x54, 0xBF, 0x4F, 0xF0, 0x22, 0x90, 0xFD, 0x80, 0xE0, 0x7E, 0x00, +0x22, 0x54, 0x01, 0xC4, 0x33, 0x33, 0x54, 0xC0, 0x22, 0x31, 0x4B, 0x12, 0x92, 0xD7, 0x12, 0x4E, +0x32, 0x12, 0xA6, 0x8B, 0x12, 0x5D, 0x5D, 0x31, 0xEC, 0x01, 0x0F, 0xE4, 0xFD, 0xFF, 0x12, 0x87, +0xB5, 0xFE, 0xEF, 0x54, 0x07, 0xFF, 0xED, 0x70, 0x12, 0x31, 0x8F, 0xC0, 0x83, 0xC0, 0x82, 0x31, +0x87, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0xF4, 0x5E, 0x80, 0x0F, 0x31, 0x8F, 0xC0, 0x83, 0xC0, +0x82, 0x31, 0x87, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0x4E, 0xD0, 0x82, 0xD0, 0x83, 0xF0, 0x31, +0x9A, 0x90, 0x9F, 0x9C, 0xEF, 0xF0, 0x22, 0xE0, 0xFE, 0x74, 0x01, 0xA8, 0x07, 0x08, 0x22, 0x74, +0x8C, 0x2E, 0xF5, 0x82, 0xE4, 0x34, 0x9F, 0xF5, 0x83, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, +0xD0, 0x7D, 0x10, 0xED, 0x14, 0xF9, 0x24, 0x8C, 0x31, 0x92, 0xE0, 0x60, 0x36, 0x7C, 0x08, 0xEC, +0x14, 0x90, 0xA1, 0xE8, 0xF0, 0x74, 0x8C, 0x29, 0x31, 0x92, 0xE0, 0xFB, 0x7A, 0x00, 0x90, 0xA1, +0xE8, 0xE0, 0x12, 0x6F, 0xCE, 0x80, 0x05, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, 0xF9, 0xF1, 0x87, +0x60, 0x0F, 0xE9, 0x75, 0xF0, 0x08, 0xA4, 0xFF, 0x90, 0xA1, 0xE8, 0xE0, 0x2F, 0x04, 0xFF, 0x80, +0x06, 0xDC, 0xCC, 0xDD, 0xBE, 0x7F, 0x00, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x12, 0xA8, 0xC1, 0x02, +0x08, 0xAA, 0xD1, 0x56, 0x12, 0x66, 0xFC, 0xFF, 0xF5, 0x55, 0x12, 0x06, 0x89, 0xFE, 0xC3, 0x13, +0x30, 0xE0, 0x07, 0x12, 0x67, 0x36, 0xF5, 0x56, 0x80, 0x02, 0x8F, 0x56, 0x85, 0x55, 0x54, 0xE5, +0x54, 0xD3, 0x95, 0x56, 0x50, 0x26, 0xAB, 0x51, 0xAA, 0x52, 0xA9, 0x53, 0x12, 0x06, 0x89, 0x54, +0x01, 0xFD, 0xAF, 0x54, 0x31, 0x4E, 0xAF, 0x54, 0x12, 0x50, 0x60, 0xEF, 0xAF, 0x54, 0x70, 0x05, +0x12, 0x94, 0xA5, 0x80, 0x03, 0x12, 0x94, 0x97, 0x05, 0x54, 0x80, 0xD3, 0xE5, 0x55, 0x70, 0x10, +0xFF, 0x12, 0x50, 0x60, 0xEF, 0x70, 0x09, 0x12, 0x5F, 0xB0, 0x54, 0xBF, 0xF0, 0x54, 0x7F, 0xF0, +0x22, 0x12, 0x06, 0x89, 0x54, 0x7F, 0xF5, 0x51, 0x12, 0x66, 0xFC, 0xFF, 0x54, 0x1F, 0xF5, 0x53, +0xEF, 0x54, 0x80, 0x12, 0x76, 0xBF, 0xF5, 0x52, 0x12, 0x67, 0x36, 0xFF, 0x54, 0x03, 0xF5, 0x54, +0xEF, 0x54, 0x30, 0xC4, 0x54, 0x0F, 0xF5, 0x57, 0x12, 0x67, 0x36, 0xFF, 0x54, 0x40, 0xC4, 0x13, +0x13, 0x54, 0x03, 0xF5, 0x55, 0xEF, 0x54, 0x80, 0x12, 0x76, 0xBF, 0xF5, 0x56, 0x12, 0x67, 0x36, +0xFF, 0x54, 0x08, 0x13, 0x13, 0x13, 0x54, 0x1F, 0xF5, 0x59, 0xEF, 0x54, 0x04, 0x13, 0x13, 0x54, +0x3F, 0xF5, 0x5A, 0xE5, 0x56, 0xF1, 0xA0, 0x12, 0x4E, 0x25, 0x54, 0x7F, 0x4F, 0xF0, 0xE5, 0x55, +0x31, 0x31, 0x12, 0x4E, 0x25, 0x54, 0xBF, 0x4F, 0xF0, 0xE5, 0x59, 0x60, 0x02, 0x61, 0x53, 0xE5, +0x53, 0x54, 0x1F, 0xFF, 0x75, 0xF0, 0x04, 0xE5, 0x51, 0x12, 0x4F, 0xA1, 0x54, 0xE0, 0x4F, 0xF0, +0xE5, 0x54, 0x54, 0x03, 0x12, 0x4E, 0x25, 0x54, 0xFC, 0x4F, 0xF0, 0xEF, 0x25, 0xE0, 0x25, 0xE0, +0x12, 0x4E, 0x25, 0x54, 0xF3, 0x4F, 0xF0, 0xE5, 0x52, 0x54, 0x01, 0xC4, 0x33, 0x54, 0xE0, 0xFF, +0x75, 0xF0, 0x04, 0xE5, 0x51, 0x12, 0x4F, 0xA1, 0x54, 0xDF, 0x4F, 0xF0, 0xE5, 0x57, 0x54, 0x03, +0xC4, 0x54, 0xF0, 0x12, 0x4E, 0x25, 0x54, 0xCF, 0x4F, 0xF0, 0x74, 0x91, 0x25, 0x51, 0x12, 0x7E, +0x03, 0xE0, 0x54, 0xFB, 0xF0, 0x74, 0x91, 0x25, 0x51, 0x12, 0x7E, 0x03, 0xE0, 0xFF, 0xE5, 0x5A, +0x25, 0xE0, 0x25, 0xE0, 0xFE, 0xEF, 0x4E,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90, 0xF0, 0x90, 0xA0, 0xC7, 0x12, 0x49, 0x2E, 0x02, 0x91, 0x04, 0x90, 0xA0, 0xC7, 0x12, 0x49, +0x2E, 0x02, 0x65, 0xC5, 0x90, 0xA0, 0xC7, 0x12, 0x49, 0x2E, 0xA1, 0x7D, 0x90, 0xA0, 0xC7, 0x12, +0x49, 0x2E, 0xE1, 0x77, 0x90, 0xA0, 0xC7, 0x12, 0x49, 0x2E, 0x02, 0x5A, 0xDB, 0x90, 0xA0, 0xC7, +0x12, 0x49, 0x2E, 0xA1, 0xE5, 0x90, 0xA0, 0xC7, 0x12, 0x49, 0x2E, 0x02, 0x7F, 0x9B, 0x90, 0xA0, +0xC7, 0x12, 0x49, 0x2E, 0x81, 0xFE, 0x90, 0xA0, 0xC7, 0x12, 0x49, 0x2E, 0x41, 0x51, 0x90, 0xA0, +0xC7, 0x12, 0x49, 0x2E, 0x02, 0x7D, 0x67, 0x90, 0xA0, 0xC7, 0x12, 0x49, 0x2E, 0x02, 0x7A, 0xD9, +0x90, 0xA0, 0xC7, 0x12, 0x49, 0x2E, 0x02, 0x63, 0xF9, 0x90, 0xA0, 0xC7, 0x12, 0x49, 0x2E, 0xE1, +0x69, 0x90, 0xA0, 0xC7, 0x12, 0x49, 0x2E, 0x80, 0x78, 0x90, 0xA0, 0xC7, 0x12, 0x49, 0x2E, 0xC1, +0xB2, 0x90, 0xA0, 0xC7, 0x12, 0x49, 0x2E, 0x02, 0x91, 0x13, 0x90, 0xA0, 0xC7, 0x12, 0x49, 0x2E, +0x02, 0x65, 0x93, 0x90, 0xA0, 0xC7, 0x12, 0x49, 0x2E, 0x02, 0x7E, 0x5A, 0x90, 0xA0, 0xC7, 0x12, +0x49, 0x2E, 0x80, 0x61, 0x90, 0xA0, 0xC7, 0x12, 0x49, 0x2E, 0x02, 0x67, 0x3C, 0x90, 0xA0, 0xC7, +0x12, 0x49, 0x2E, 0x02, 0x79, 0xED, 0x90, 0xA0, 0xC7, 0x12, 0x49, 0x2E, 0x02, 0x66, 0xE5, 0x90, +0xA0, 0xC7, 0x12, 0x49, 0x2E, 0xC1, 0x5D, 0x90, 0xA0, 0xC7, 0x12, 0x49, 0x2E, 0xA1, 0xB9, 0x90, +0xA0, 0xC7, 0x12, 0x49, 0x2E, 0x02, 0x91, 0x21, 0x90, 0xA0, 0xC7, 0x12, 0x49, 0x2E, 0x02, 0x91, +0x44, 0x90, 0x01, 0xC0, 0xE0, 0x44, 0x01, 0xF0, 0x90, 0xA0, 0xC6, 0xE0, 0x90, 0x01, 0xC2, 0xF0, +0x22, 0x90, 0xA0, 0x87, 0xE0, 0x44, 0x10, 0xF0, 0x7D, 0x01, 0x7F, 0x1B, 0x12, 0x61, 0x03, 0x90, +0xA0, 0xCA, 0xEF, 0xF0, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0xA0, 0x88, 0xE0, +0x44, 0x01, 0xF0, 0x7D, 0x01, 0x7F, 0x28, 0x91, 0xDC, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x12, 0x7F, +0x8B, 0x90, 0xA0, 0x56, 0xE0, 0x54, 0xFE, 0x4E, 0xF0, 0xEF, 0x54, 0x02, 0x33, 0x33, 0x33, 0x54, +0xF8, 0xFF, 0x90, 0x9F, 0xA3, 0xE0, 0x54, 0xEF, 0x4F, 0xF0, 0x90, 0xA0, 0x56, 0xE0, 0x54, 0x01, +0xFF, 0xEF, 0x64, 0x01, 0x70, 0x22, 0x12, 0xA7, 0x49, 0x90, 0x01, 0x38, 0x12, 0x4F, 0x8B, 0x90, +0x01, 0x30, 0x12, 0x4F, 0x8C, 0x90, 0x01, 0x30, 0x74, 0x10, 0xF0, 0x90, 0x01, 0x39, 0x74, 0x01, +0xF0, 0x90, 0x00, 0x53, 0x74, 0x80, 0xF0, 0x22, 0x12, 0xA7, 0x89, 0x90, 0xA0, 0x5C, 0xE0, 0x90, +0x01, 0x31, 0xF0, 0x90, 0xA0, 0x5D, 0xE0, 0x90, 0x01, 0x32, 0xF0, 0x90, 0xA0, 0x5E, 0xE0, 0x90, +0x01, 0x33, 0xF0, 0x90, 0xA0, 0x57, 0xE0, 0x90, 0x01, 0x38, 0xF0, 0x90, 0xA0, 0x5A, 0xE0, 0x90, +0x01, 0x3B, 0x12, 0x5F, 0x99, 0x7F, 0x01, 0x12, 0x5A, 0x53, 0x02, 0x5D, 0x5D, 0x12, 0x67, 0x36, +0xFF, 0x30, 0xE0, 0x1F, 0x12, 0x06, 0x89, 0x90, 0xA0, 0x4B, 0x12, 0x66, 0xFB, 0x90, 0xA0, 0x4C, +0xF0, 0xEF, 0x54, 0xFE, 0xFF, 0xA3, 0xE0, 0x54, 0x01, 0x4F, 0xF0, 0x12, 0x7A, 0xD3, 0x90, 0xA0, +0x4E, 0xF0, 0x22, 0x90, 0xA0, 0x4B, 0x74, 0x02, 0xF0, 0xA3, 0x74, 0x0A, 0xF0, 0xA3, 0xE0, 0x54, +0x01, 0x44, 0x1E, 0xF0, 0xA3, 0x74, 0x05, 0xF0, 0x22, 0x12, 0x06, 0x89, 0x54, 0x01, 0x25, 0xE0, +0xD1, 0xAA, 0x54, 0xFB, 0x4F, 0xF0, 0xE0, 0x13, 0x13, 0x54, 0x3F, 0x30, 0xE0, 0x08, 0x90, 0x07, +0x65, 0xE0, 0x44, 0x18, 0xF0, 0x22, 0x90, 0xA0, 0xA7, 0xE0, 0x20, 0xE0, 0x07, 0x90, 0x07, 0x65, +0xE0, 0x54, 0xE7, 0xF0, 0x22, 0x12, 0x06, 0x89, 0x90, 0xA0, 0x51, 0xF0, 0x60, 0x27, 0x90, 0xA0, +0x5F, 0xE0, 0x20, 0xE0, 0x20, 0xE4, 0xFD, 0x7F, 0x04, 0x12, 0x58, 0x65, 0xF1, 0x7F, 0x30, 0xE0, +0x14, 0x12, 0x87, 0xB5, 0x20, 0xE0, 0x0E, 0xF1, 0xA9, 0x30, 0xE0, 0x04, 0x7F, 0x0D, 0x80, 0x02, +0x7F, 0x09, 0x12, 0x76, 0xC6, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xD1, 0x56, 0x12, +0x06, 0x89, 0xFF, 0x90, 0x9F, 0x9D, 0xF0, 0xBF, 0x01, 0x09, 0x12, 0x66, 0xFC, 0x64, 0x01, 0x60, +0x20, 0x80, 0x1B, 0xAB, 0x51, 0xAA, 0x52, 0xA9, 0x53, 0x12, 0x66, 0xFC, 0x64, 0x01, 0x60, 0x11, +0x90, 0x9F, 0x9E, 0xE0, 0x20, 0xE0, 0x07, 0xE4, 0xFF, 0x12, 0x5C, 0x4A, 0x80, 0x03, 0x12, 0x9D, +0xB1, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x8B, 0x51, 0x8A, 0x52, 0x89, 0x53, 0x22, 0x12, 0x06, 0x89, +0x54, 0x01, 0xD1, 0xAA, 0x54, 0xFD, 0x4F, 0xF0, 0xE0, 0xC3, 0x13, 0xFF, 0x54, 0x01, 0x90, 0x01, +0xE6, 0xF0, 0xA3, 0xE0, 0x54, 0xFE, 0xF0, 0xEF, 0x30, 0xE0, 0x27, 0x12, 0xA8, 0x2A, 0x70, 0x20, +0x90, 0xA0, 0xA7, 0xE0, 0x30, 0xE0, 0x02, 0x80, 0x19, 0x90, 0xFD, 0x62, 0xE0, 0xB4, 0xAD, 0x0E, +0xA3, 0xE0, 0xB4, 0x35, 0x09, 0xD1, 0xA2, 0x90, 0x01, 0xE5, 0x74, 0xDF, 0xF0, 0x22, 0x80, 0x00, +0xE1, 0x8F, 0x90, 0x01, 0xE7, 0xE0, 0x54, 0xFE, 0xF0, 0x22, 0x25, 0xE0, 0xFF, 0x90, 0xA0, 0x84, +0xE0, 0x22, 0x12, 0x67, 0xE9, 0x90, 0xA1, 0xD2, 0xE0, 0x70, 0x08, 0xF1, 0x03, 0x90, 0xA1, 0xD2, +0x74, 0x01, 0xF0, 0x12, 0x65, 0xBF, 0x12, 0x06, 0x89, 0xFF, 0xE4, 0x8F, 0x54, 0xF5, 0x53, 0xF5, +0x52, 0xF5, 0x51, 0x90, 0xA0, 0x98, 0x12, 0x49, 0x0A, 0xEC, 0x54, 0xC1, 0xFC, 0xC0, 0x04, 0xC0, +0x05, 0xC0, 0x06, 0xC0, 0x07, 0xAF, 0x54, 0xAE, 0x53, 0xAD, 0x52, 0xAC, 0x51, 0x78, 0x19, 0x12, +0x08, 0x5A, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0x12, 0x48, 0xFD, 0x90, 0xA0, 0x94, +0x02, 0x08, 0x6D, 0x7F, 0x58, 0x7E, 0x0C, 0x12, 0x37, 0xBC, 0x90, 0xA0, 0x98, 0x02, 0x08, 0x6D, +0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x9E, 0xF0, 0xE0, 0xFF, 0x90, 0x9E, 0xEF, 0xE0, +0xB5, 0x07, 0x04, 0x7F, 0x01, 0x80, 0x02, 0x7F, 0x00, 0xEF, 0x70, 0x38, 0x90, 0x9E, 0xEF, 0xE0, +0xFE, 0xF1, 0x97, 0xE0, 0xFD, 0xEE, 0x75, 0xF0, 0x08, 0xA4, 0x24, 0xA0, 0xF9, 0x74, 0x9E, 0x35, +0xF0, 0xFA, 0x7B, 0x01, 0xAF, 0x05, 0x71, 0x54, 0x90, 0x9E, 0xEF, 0xF1, 0x70, 0xB4, 0x0A, 0x02, +0x7F, 0x01, 0xEF, 0x60, 0x05, 0xE4, 0x90, 0x9E, 0xEF, 0xF0, 0x12, 0x91, 0xAB, 0x90, 0x9E, 0x92, +0xE0, 0x44, 0x02, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x7D, 0x01, 0x7F, 0x17, 0x02, 0x61, 0x03, +0xE0, 0x04, 0xF0, 0xE0, 0x7F, 0x00, 0x22, 0x12, 0x06, 0x89, 0x90, 0x9F, 0xB2, 0xF0, 0x22, 0x90, +0xA0, 0x50, 0xE0, 0xFF, 0xC3, 0x13, 0x22, 0xFF, 0xEE, 0x5A, 0xFE, 0xEF, 0x5B, 0x4E, 0x22, 0x90, +0x01, 0xE7, 0xE0, 0x44, 0x01, 0xF0, 0x22, 0x75, 0xF0, 0x08, 0x90, 0x9E, 0x9F, 0x02, 0x49, 0x22, +0x54, 0x01, 0xC4, 0x33, 0x33, 0x33, 0x54, 0x80, 0x22, 0x90, 0xA0, 0x50, 0xE0, 0x13, 0x13, 0x54, +0x3F, 0x22, 0xF1, 0x7F, 0x30, 0xE0, 0x1E, 0x12, 0x87, 0xB5, 0x20, 0xE0, 0x18, 0x12, 0x77, 0xA0, +0x30, 0xE0, 0x04, 0x7F, 0x03, 0x80, 0x0B, 0xF1, 0xA9, 0x30, 0xE0, 0x04, 0x7F, 0x0D, 0x80, 0x02, +0x7F, 0x09, 0x12, 0x76, 0xC6, 0x22, 0x90, 0xA1, 0x04, 0x74, 0x08, 0xF0, 0x90, 0xA1, 0x12, 0x74, +0x01, 0xF0, 0x90, 0xA1, 0x06, 0xEF, 0xF0, 0x7B, 0x01, 0x7A, 0xA1, 0x79, 0x04, 0x02, 0x63, 0x89, +0x90, 0xA1, 0x5D, 0x74, 0x0B, 0xF0, 0x90, 0xA1, 0x6B, 0x74, 0x07, 0xF0, 0x90, 0xA1, 0x5F, 0xEF, +0xF0, 0x60, 0x32, 0x90, 0xFD, 0x63, 0xE0, 0x90, 0xA1, 0x60, 0xF0, 0x90, 0xFD, 0x61, 0xE0, 0x90, +0xA1, 0x61, 0xF0, 0x90, 0xFD, 0x64, 0xE0, 0x90, 0xA1, 0x62, 0xF0, 0x90, 0xFD, 0x65, 0xE0, 0x90, +0xA1, 0x63, 0xF0, 0x90, 0xFD, 0x66, 0xE0, 0x90, 0xA1, 0x64, 0xF0, 0x90, 0xFD, 0x67, 0xE0, 0x90, +0xA1, 0x65, 0xF0, 0x80, 0x0D, 0x90, 0xA1, 0x60, 0xED, 0xF0, 0xA3, 0xEB, 0xF0, 0xE4, 0xA3, 0x12, +0x4F, 0x8C, 0x7B, 0x01, 0x7A, 0xA1, 0x79, 0x5D, 0x02, 0x63, 0x89, 0x7E, 0x00, 0x7F, 0x0A, 0x7D, +0x00, 0x7B, 0x01, 0x7A, 0xA0, 0x79, 0x87, 0x12, 0x08, 0xAA, 0x90, 0xA0, 0x73, 0x74, 0x02, 0xF0, +0x22, 0x90, 0xA0, 0x7A, 0xE0, 0x54, 0xFE, 0xF0, 0x54, 0xE1, 0xF0, 0x90, 0xA0, 0x7F, 0xE0, 0xFF, +0x12, 0x76, 0xC6, 0x11, 0xA1, 0xE4, 0xFF, 0xE4, 0xFC, 0x11, 0x97, 0x12, 0x49, 0x0A, 0x90, 0xA0, +0x7B, 0x12, 0x49, 0x16, 0x12, 0x48, 0xFD, 0x11, 0x97, 0x12, 0x4D, 0x2B, 0x11, 0xA8, 0x12, 0x4C, +0x71, 0xE4, 0xFD, 0xFF, 0x02, 0x57, 0x8F, 0x90, 0xA1, 0xB0, 0x12, 0x08, 0x6D, 0x90, 0xA1, 0xB0, +0x22, 0x7F, 0xB4, 0x7E, 0x0C, 0x02, 0x37, 0xBC, 0x7F, 0xB4, 0x7E, 0x0C, 0x02, 0x38, 0x07, 0x90, +0x02, 0x09, 0xE0, 0xF5, 0x51, 0x12, 0x06, 0x89, 0x25, 0x51, 0x90, 0x9E, 0x98, 0x12, 0x66, 0xFB, +0x25, 0x51, 0x90, 0x9E, 0x99, 0x12, 0x67, 0x35, 0x25, 0x51, 0x90, 0x9E, 0x9A, 0xF0, 0x12, 0x7A, +0xD3, 0x25, 0x51, 0x90, 0x9E, 0x9B, 0x12, 0x67, 0xD6, 0x25, 0x51, 0x90, 0x9E, 0x9C, 0x12, 0x66, +0xDE, 0x25, 0x51, 0x90, 0x9E, 0x9D, 0x12, 0x67, 0xCD, 0x25, 0x51, 0x90, 0x9E, 0x9E, 0xF0, 0x22, +0x12, 0x06, 0x89, 0xFF, 0x90, 0x9F, 0x8B, 0xF0, 0xBF, 0x01, 0x08, 0x12, 0x7E, 0xDF, 0xE4, 0x90, +0x9F, 0x8B, 0xF0, 0x22, 0x12, 0x06, 0x89, 0x54, 0x01, 0xFF, 0x90, 0xA0, 0xC1, 0xE0, 0x54, 0xFE, +0x4F, 0xF0, 0x22, 0x12, 0x06, 0x89, 0x90, 0xA0, 0xA0, 0x12, 0x66, 0xFB, 0x90, 0xA0, 0xA1, 0xF0, +0x22, 0x12, 0x06, 0x89, 0x54, 0x01, 0x33, 0x33, 0x33, 0x54, 0xF8, 0xFF, 0x90, 0xA0, 0x84, 0xE0, +0x54, 0xF7, 0x4F, 0xF0, 0x12, 0x80, 0xDA, 0x90, 0x07, 0x65, 0x30, 0xE0, 0x04, 0x74, 0x18, 0xF0, +0x22, 0xE4, 0xF0, 0x22, 0x12, 0x06, 0x89, 0x54, 0x01, 0xFF, 0x90, 0xA0, 0xBF, 0xE0, 0x54, 0xFE, +0x4F, 0xF0, 0x30, 0xE0, 0x55, 0x90, 0x00, 0x40, 0xE0, 0x54, 0xBF, 0x44, 0xA0, 0xFD, 0x7F, 0x40, +0x12, 0x49, 0x90, 0x90, 0x00, 0x41, 0xE0, 0x44, 0x04, 0xFD, 0x7F, 0x41, 0x12, 0x49, 0x90, 0x90, +0x00, 0x6A, 0xE0, 0x54, 0xFB, 0xFD, 0x7F, 0x6A, 0x12, 0x49, 0x90, 0x90, 0x07, 0x6E, 0x74, 0x55, +0xF0, 0xA3, 0x74, 0x12, 0xF0, 0x90, 0x07, 0x78, 0xE0, 0x54, 0xF2, 0x44, 0x02, 0xF0, 0x90, 0x06, +0xCC, 0xE0, 0x44, 0x03, 0xF0, 0x90, 0x07, 0x65, 0xE0, 0x54, 0xF5, 0xF0, 0x90, 0x05, 0x23, 0xE0, +0x54, 0x7F, 0xF0, 0xE4, 0xFD, 0x7F, 0x66, 0x12, 0x49, 0x90, 0x22, 0x90, 0x01, 0xCC, 0xE0, 0x54, +0x0F, 0x90, 0xA1, 0xDE, 0xF0, 0x90, 0xA1, 0xDE, 0xE0, 0xFD, 0x70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02, 0x7F, 0x00, 0xEF, 0x60, 0x05, 0xE4, 0x90, 0x9F, 0x87, 0xF0, 0x90, +0x9F, 0x88, 0xE0, 0xFF, 0x90, 0x9F, 0x87, 0xE0, 0xB5, 0x07, 0x04, 0x7F, 0x01, 0x80, 0x02, 0x7F, +0x00, 0xEF, 0x70, 0x07, 0x90, 0x9E, 0x92, 0xE0, 0x44, 0x04, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, +0x90, 0xA1, 0xBC, 0xEF, 0xF0, 0xA3, 0x12, 0x49, 0x37, 0x90, 0xA1, 0xD4, 0xE0, 0xFE, 0x04, 0xF0, +0x90, 0x00, 0x01, 0xEE, 0x12, 0x06, 0xE1, 0x74, 0x00, 0x2F, 0xF9, 0xE4, 0x34, 0xFB, 0xFA, 0x7B, +0x01, 0xC0, 0x03, 0xC0, 0x02, 0xC0, 0x01, 0x90, 0xA1, 0xBD, 0x12, 0x49, 0x2E, 0x8B, 0x40, 0x8A, +0x41, 0x89, 0x42, 0x75, 0x43, 0x02, 0xD0, 0x01, 0xD0, 0x02, 0xD0, 0x03, 0x12, 0x34, 0x62, 0x90, +0xA1, 0xBC, 0xE0, 0x24, 0x02, 0xF9, 0xE4, 0x34, 0xFB, 0xFA, 0x7B, 0x01, 0xC0, 0x03, 0xC0, 0x02, +0xC0, 0x01, 0xA3, 0x12, 0x49, 0x2E, 0xE9, 0x24, 0x02, 0xF9, 0xE4, 0x3A, 0x8B, 0x40, 0xF5, 0x41, +0x89, 0x42, 0x90, 0xA1, 0xBD, 0x91, 0x82, 0xF5, 0x43, 0xD0, 0x01, 0xD0, 0x02, 0xD0, 0x03, 0x02, +0x34, 0x62, 0x12, 0x49, 0x2E, 0x90, 0x00, 0x0E, 0x02, 0x06, 0xA2, 0x75, 0xF0, 0x0F, 0xA4, 0x24, +0xF1, 0xF9, 0x74, 0x9E, 0x35, 0xF0, 0x22, 0x8F, 0x57, 0x75, 0xF0, 0x10, 0xEF, 0x12, 0x6D, 0x95, +0xE0, 0x54, 0xFB, 0xF0, 0x22, 0x8F, 0x57, 0x75, 0xF0, 0x10, 0xEF, 0x12, 0x6D, 0x95, 0xE0, 0x44, +0x04, 0xF0, 0x22, 0x90, 0xA1, 0xD5, 0x12, 0x49, 0x37, 0xE4, 0xFF, 0x90, 0xA1, 0xD5, 0x12, 0x49, +0x2E, 0x8F, 0x82, 0x12, 0x64, 0x72, 0xFE, 0x74, 0xF0, 0x2F, 0x91, 0xD4, 0xEE, 0xF0, 0x0F, 0xEF, +0xB4, 0x10, 0xE8, 0x22, 0xF5, 0x82, 0xE4, 0x34, 0x02, 0xF5, 0x83, 0x22, 0x90, 0x01, 0x94, 0xE0, +0x44, 0x01, 0xF0, 0x90, 0x01, 0xC7, 0xE4, 0xF0, 0x22, 0x90, 0x01, 0x01, 0xE0, 0x44, 0x04, 0xF0, +0x90, 0x01, 0x9A, 0xE0, 0x54, 0xC0, 0x12, 0x7F, 0x93, 0x90, 0x01, 0x99, 0xE0, 0x44, 0xC0, 0xF0, +0x90, 0x01, 0x9B, 0x74, 0x80, 0xF0, 0x22, 0x7D, 0x02, 0x90, 0x01, 0xC4, 0x74, 0x07, 0xF0, 0x74, +0x95, 0xA3, 0xF0, 0x90, 0xA0, 0xC0, 0xE0, 0xFF, 0xED, 0xC3, 0x9F, 0x50, 0x14, 0xED, 0x25, 0xE0, +0x24, 0x81, 0xF8, 0xE6, 0x30, 0xE4, 0x07, 0xB1, 0x3F, 0xA3, 0xF0, 0x7F, 0x00, 0x22, 0x0D, 0x80, +0xE2, 0x74, 0x07, 0x04, 0x90, 0x01, 0xC4, 0xF0, 0x74, 0x95, 0xA3, 0xF0, 0x7F, 0x01, 0x22, 0x90, +0x01, 0xB8, 0x74, 0x08, 0xF0, 0x22, 0x90, 0xA0, 0x5F, 0xE0, 0x30, 0xE0, 0x23, 0x90, 0xA0, 0x71, +0xE0, 0x60, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x40, 0xF0, 0xA1, 0xF9, 0x90, 0x9F, 0xA9, 0xE0, 0xD3, +0x94, 0x00, 0x40, 0x02, 0x80, 0x30, 0x90, 0xA0, 0x51, 0xE0, 0x70, 0x02, 0xA1, 0xF7, 0x80, 0x5A, +0xD1, 0xA6, 0xEF, 0x64, 0x01, 0x60, 0x04, 0xD1, 0x40, 0x80, 0x7E, 0x90, 0x9F, 0xAB, 0xE0, 0xFF, +0x54, 0x03, 0x60, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x02, 0xF0, 0x80, 0x6D, 0x90, 0x9F, 0xA9, 0xE0, +0xFE, 0xE4, 0xC3, 0x9E, 0x50, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x04, 0xF0, 0x80, 0x5B, 0xEF, 0x30, +0xE2, 0x04, 0xB1, 0x3F, 0x80, 0x53, 0x90, 0x9F, 0xAB, 0xE0, 0x30, 0xE4, 0x04, 0xD1, 0x02, 0x80, +0x48, 0x90, 0x9F, 0xA4, 0xE0, 0x13, 0x13, 0x54, 0x3F, 0x20, 0xE0, 0x08, 0x90, 0x01, 0xB8, 0x74, +0x20, 0xF0, 0x80, 0x35, 0x90, 0xA0, 0x51, 0xE0, 0x60, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x80, 0xF0, +0x80, 0x27, 0x90, 0x06, 0x62, 0xE0, 0x30, 0xE1, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x11, 0xF0, 0x80, +0x18, 0x90, 0x06, 0x62, 0xE0, 0x30, 0xE0, 0x0F, 0xE0, 0x54, 0xFC, 0xFF, 0xBF, 0x80, 0x08, 0x90, +0x01, 0xB8, 0x74, 0x12, 0xF0, 0x80, 0x02, 0x80, 0x4E, 0x90, 0x01, 0xB9, 0x74, 0x04, 0xF0, 0x7F, +0x00, 0x22, 0x90, 0x01, 0xB8, 0x74, 0x10, 0xF0, 0x22, 0x90, 0xA0, 0x52, 0xE0, 0xC3, 0x13, 0x20, +0xE0, 0x23, 0x90, 0x02, 0x87, 0xE0, 0x60, 0x04, 0xD1, 0x40, 0x80, 0x1B, 0x90, 0x02, 0x96, 0xE0, +0x60, 0x04, 0xD1, 0x02, 0x80, 0x11, 0x90, 0x02, 0x86, 0xE0, 0x20, 0xE1, 0x08, 0x90, 0x01, 0xB8, +0x74, 0x04, 0xF0, 0x80, 0x02, 0x80, 0x10, 0x90, 0x01, 0xB9, 0x74, 0x08, 0xF0, 0x7F, 0x00, 0x22, +0x90, 0x01, 0xB8, 0x74, 0x01, 0xF0, 0x22, 0x90, 0x01, 0xB8, 0xE4, 0xF0, 0x7F, 0x01, 0x22, 0x90, +0x9F, 0xAA, 0xE0, 0xFF, 0x60, 0x03, 0xB4, 0x08, 0x0D, 0xD1, 0x09, 0xBF, 0x01, 0x08, 0xD1, 0x94, +0x90, 0x01, 0xE5, 0xE0, 0x04, 0xF0, 0x22, 0x90, 0x9F, 0xA3, 0xE0, 0x30, 0xE0, 0x18, 0x90, 0x9F, +0x9E, 0xE0, 0xFF, 0x30, 0xE0, 0x0E, 0xC3, 0x13, 0x30, 0xE0, 0x07, 0xD1, 0x87, 0xBF, 0x01, 0x06, +0x80, 0x02, 0x80, 0x00, 0xD1, 0x4F, 0x22, 0x90, 0x9F, 0xA1, 0xE0, 0x64, 0x02, 0x7F, 0x01, 0x60, +0x02, 0x7F, 0x00, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x12, 0x4D, 0xD9, 0x12, 0x79, +0x09, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0x04, 0x1A, 0xE0, 0xF4, 0x60, 0x03, 0x7F, 0x00, 0x22, +0x90, 0x04, 0x1B, 0xE0, 0x54, 0x07, 0x64, 0x07, 0x7F, 0x01, 0x60, 0x02, 0x7F, 0x00, 0x22, 0xD1, +0xA6, 0xEF, 0x70, 0x02, 0xD1, 0xED, 0x22, 0x90, 0x9F, 0xA7, 0xE0, 0x64, 0x02, 0x60, 0x0F, 0xD1, +0xE6, 0x60, 0x0B, 0xD1, 0xA6, 0xEF, 0x70, 0x06, 0xFD, 0x7F, 0x0C, 0x12, 0x58, 0x65, 0x22, 0x90, +0x9F, 0xAB, 0xE0, 0x44, 0x01, 0xF0, 0x90, 0x9F, 0xA5, 0xE0, 0x54, 0x0F, 0x22, 0x90, 0xA0, 0x5F, +0xE0, 0x20, 0xE0, 0x1D, 0x90, 0x9F, 0xA7, 0xE0, 0x64, 0x01, 0x70, 0x15, 0x12, 0x8F, 0xB2, 0xD1, +0xE6, 0x60, 0x05, 0x12, 0x57, 0x85, 0xE1, 0xD6, 0x90, 0x9F, 0xAA, 0xE0, 0x70, 0x03, 0x12, 0x58, +0x61, 0x22, 0x12, 0x5E, 0x8B, 0x30, 0xE0, 0x0B, 0xF1, 0x2A, 0x60, 0x07, 0x7D, 0x01, 0x7F, 0x02, +0x12, 0x58, 0x65, 0xF1, 0x2A, 0x60, 0x02, 0xD1, 0xC7, 0x22, 0x90, 0x9F, 0xA2, 0xE0, 0x64, 0x02, +0x22, 0xE4, 0xFF, 0x12, 0x50, 0x60, 0xBF, 0x01, 0x11, 0x90, 0x9F, 0xA7, 0xE0, 0x60, 0x0B, 0xD1, +0xE6, 0x64, 0x02, 0x60, 0x03, 0x02, 0x87, 0x74, 0xF1, 0x4B, 0x22, 0xF1, 0xD6, 0x90, 0x9F, 0xAA, +0xE0, 0x64, 0x0C, 0x60, 0x05, 0x12, 0x57, 0x85, 0xF1, 0xC3, 0x22, 0x12, 0x5E, 0xC8, 0x30, 0xE0, +0x0B, 0xEF, 0xC4, 0x13, 0x13, 0x54, 0x03, 0x30, 0xE0, 0x02, 0xF1, 0xBC, 0x90, 0x9F, 0xA3, 0x12, +0x75, 0x00, 0x30, 0xE0, 0x08, 0xF1, 0xCA, 0x54, 0x07, 0x70, 0x38, 0x80, 0x33, 0x12, 0x9D, 0x51, +0x40, 0x2E, 0x12, 0x50, 0x58, 0x70, 0x2C, 0xD1, 0xE6, 0x70, 0x05, 0x12, 0x9C, 0xAF, 0x80, 0x24, +0x12, 0x9C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8, 0xF9, 0xB1, 0xE2, 0x31, 0x84, 0x60, 0x22, 0x24, 0xFE, 0x60, 0x03, 0x04, 0x70, +0x1E, 0x90, 0x9F, 0xAE, 0xE0, 0x14, 0xF0, 0xE0, 0xFF, 0x60, 0x06, 0x90, 0x9F, 0xB0, 0xE0, 0x60, +0x0E, 0xEF, 0x70, 0x08, 0x90, 0x9F, 0xAD, 0xE0, 0xA3, 0xF0, 0x80, 0x00, 0x75, 0x65, 0x01, 0x90, +0x9F, 0x9E, 0xE0, 0x30, 0xE0, 0x12, 0x90, 0x9F, 0xA2, 0xE0, 0xB4, 0x02, 0x03, 0xE4, 0xF5, 0x65, +0x12, 0x5E, 0xD3, 0xEF, 0x70, 0x02, 0xF5, 0x65, 0xE5, 0x65, 0x60, 0x2D, 0xB1, 0x19, 0x90, 0x9F, +0xB0, 0xE0, 0x60, 0x03, 0xB4, 0x01, 0x04, 0x31, 0x7A, 0x80, 0x08, 0x31, 0x7A, 0x75, 0xF0, 0x03, +0xA4, 0x24, 0xFE, 0xFF, 0x90, 0x9F, 0xAF, 0xE0, 0x2F, 0x12, 0x50, 0x10, 0x90, 0x9F, 0xAA, 0xE0, +0x20, 0xE2, 0x03, 0x12, 0x58, 0x61, 0x12, 0x8F, 0xB2, 0x22, 0xE4, 0x90, 0xA1, 0x8E, 0xF0, 0x90, +0x9F, 0xB0, 0xE0, 0x22, 0xF0, 0x90, 0x9F, 0xA5, 0xE0, 0xFF, 0xC4, 0x54, 0x0F, 0x22, 0x71, 0x49, +0xCE, 0xC3, 0x13, 0xCE, 0x13, 0xD8, 0xF9, 0xFF, 0x90, 0xA0, 0xE4, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, +0x12, 0x50, 0x58, 0x60, 0x02, 0x41, 0x38, 0x90, 0x9F, 0xA7, 0xE0, 0x70, 0x02, 0x41, 0x38, 0x31, +0x85, 0x64, 0x01, 0x70, 0x22, 0x90, 0x06, 0xAB, 0xE0, 0x90, 0x9F, 0xAE, 0xF0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FB, 0xE4, 0xFF, 0x91, 0x44, +0xE4, 0xFF, 0x71, 0x57, 0x22, 0x74, 0xC4, 0x2D, 0xF5, 0x82, 0xE4, 0x34, 0x9F, 0xF5, 0x83, 0x22, +0xF0, 0x90, 0x9F, 0xC2, 0xE0, 0xFF, 0xC3, 0x22, 0xF0, 0x90, 0x05, 0x62, 0xE0, 0xFE, 0x90, 0x05, +0x61, 0xE0, 0xFD, 0xED, 0x78, 0x02, 0x22, 0xE4, 0xFE, 0x74, 0xC4, 0x2E, 0x71, 0x38, 0xE4, 0xF0, +0x0E, 0xEE, 0xB4, 0x19, 0xF4, 0xE4, 0x90, 0x9F, 0xBD, 0xF0, 0x90, 0x9F, 0xC1, 0xF0, 0x90, 0x9F, +0xB9, 0xF0, 0xEF, 0xB4, 0x01, 0x09, 0x90, 0x9F, 0xC2, 0x74, 0x19, 0xF0, 0xE4, 0xA3, 0xF0, 0x22, +0xE4, 0xF5, 0x65, 0x90, 0x06, 0xA9, 0xE0, 0xF5, 0x65, 0x54, 0xC0, 0x70, 0x08, 0x71, 0xC7, 0x54, +0xFD, 0xF0, 0x02, 0x58, 0x4D, 0xE5, 0x65, 0x30, 0xE6, 0x19, 0x90, 0x9F, 0xA7, 0xE0, 0x64, 0x01, +0x70, 0x13, 0x12, 0x96, 0xDF, 0x64, 0x02, 0x60, 0x05, 0x12, 0x87, 0x74, 0x80, 0x07, 0x12, 0x97, +0x4B, 0x80, 0x02, 0x71, 0xC7, 0xE5, 0x65, 0x90, 0x9F, 0xAB, 0x30, 0xE7, 0x05, 0x12, 0x50, 0x03, +0x80, 0x7A, 0xE0, 0x54, 0xFD, 0xF0, 0x22, 0x90, 0x9F, 0xAB, 0xE0, 0x54, 0xFE, 0xF0, 0x22, 0x90, +0x06, 0xA9, 0xE0, 0x90, 0xA0, 0xE6, 0xF0, 0xE0, 0xFD, 0x54, 0xC0, 0x70, 0x04, 0x71, 0xC7, 0x80, +0x57, 0xED, 0x30, 0xE6, 0x41, 0x90, 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+0xEF, 0xF0, 0x90, 0x05, 0x58, 0xF0, 0x22, 0xF0, 0x90, 0x9F, 0xBC, 0xE0, 0xC3, 0x9D, 0x22, 0xB1, +0x5E, 0x40, 0x1E, 0x90, 0x9F, 0xC1, 0xE0, 0x04, 0xF0, 0xE0, 0xFF, 0x94, 0x04, 0x50, 0x12, 0x90, +0x9F, 0xB9, 0xEF, 0xF0, 0x25, 0xE0, 0x24, 0x08, 0x90, 0x9F, 0xC0, 0xF0, 0xFB, 0xB1, 0x08, 0x91, +0x44, 0x22, 0xD1, 0x4A, 0x90, 0xA0, 0xF4, 0xEF, 0xF0, 0x30, 0xE0, 0x05, 0x7D, 0x01, 0xE4, 0x80, +0x02, 0xE4, 0xFD, 0xFF, 0x12, 0x5A, 0x74, 0x90, 0xA0, 0xF4, 0xE0, 0x30, 0xE6, 0x11, 0x90, 0x01, +0x2F, 0xE0, 0x30, 0xE7, 0x04, 0xE4, 0xF0, 0x80, 0x06, 0x90, 0x01, 0x2F, 0x74, 0x80, 0xF0, 0xB1, +0x08, 0x90, 0x9F, 0xC0, 0xE0, 0xFB, 0x81, 0x44, 0x90, 0x9F, 0xB9, 0xE0, 0xFF, 0xA3, 0xE0, 0xFD, +0x22, 0x90, 0x9F, 0xAD, 0xE0, 0x90, 0x05, 0x73, 0x22, 0x90, 0x9F, 0xAB, 0xE0, 0x44, 0x10, 0xF0, +0x22, 0x90, 0x01, 0x57, 0xE4, 0xF0, 0x90, 0x01, 0x3C, 0x74, 0x02, 0x22, 0x90, 0x01, 0x57, 0xE0, +0x60, 0x1E, 0xB1, 0x24, 0xF0, 0x90, 0x9F, 0xA3, 0x12, 0x75, 0x00, 0x30, 0xE0, 0x03, 0x02, 0x97, +0xCA, 0xB1, 0x51, 0x40, 0x0B, 0xE4, 0xFF, 0x12, 0x50, 0x60, 0xBF, 0x01, 0x03, 0x12, 0x97, 0xB4, +0x22, 0x90, 0x9F, 0xB0, 0xE0, 0x04, 0xF0, 0x90, 0x9F, 0xAB,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x90, 0x9F, 0xA2, 0xE0, 0x70, +0x06, 0xFD, 0x7F, 0x04, 0x12, 0x58, 0x65, 0x22, 0x90, 0x9F, 0xA7, 0xE0, 0x70, 0x07, 0x90, 0x9F, +0x9E, 0xE0, 0x30, 0xE0, 0x13, 0x90, 0x9F, 0x9E, 0xE0, 0x30, 0xE0, 0x09, 0x12, 0x5E, 0xD3, 0xBF, +0x01, 0x06, 0x02, 0x96, 0xC7, 0x12, 0x96, 0xED, 0x22, 0x90, 0x9F, 0xA7, 0xE0, 0x60, 0x10, 0x90, +0x06, 0x92, 0xE0, 0x30, 0xE1, 0x03, 0x02, 0x97, 0xD6, 0x12, 0x5F, 0xB5, 0x12, 0x58, 0x4D, 0x22, +0x90, 0x9F, 0xA3, 0xE0, 0xFF, 0x12, 0x76, 0xBF, 0x30, 0xE0, 0x1F, 0xEF, 0x54, 0x7F, 0xF1, 0x62, +0x30, 0xE1, 0x06, 0xE0, 0x44, 0x02, 0xF0, 0x80, 0x08, 0xE0, 0x54, 0xFD, 0x12, 0x57, 0xF8, 0x04, +0xF0, 0x90, 0x9F, 0xA7, 0xE0, 0x60, 0x03, 0x12, 0x58, 0x4D, 0x12, 0x74, 0x7D, 0x30, 0xE0, 0x21, +0x90, 0xA0, 0x66, 0xE0, 0xFF, 0xC3, 0x13, 0x30, 0xE0, 0x17, 0xEF, 0x54, 0xFD, 0xF0, 0x90, 0x04, +0xE0, 0xE0, 0x90, 0xA0, 0x66, 0x30, 0xE1, 0x05, 0xE0, 0x44, 0x04, 0xF0, 0x22, 0xE0, 0x54, 0xFB, +0xF0, 0x22, 0xF0, 0x90, 0x04, 0xE0, 0xE0, 0x90, 0x9F, 0xA4, 0x22, 0x90, 0x01, 0xC4, 0x74, 0x6B, +0xF0, 0x74, 0x9F, 0xA3, 0xF0, 0x7F, 0x90, 0x12, 0x4A, 0xB8, 0xEF, 0x20, 0xE0, 0xF7, 0x74, 0x6B, +0x04, 0x90, 0x01, 0xC4, 0xF0, 0x74, 0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x12, 0x6C, 0x17, 0xAD, 0x5F, 0xAF, 0x5E, +0x12, 0x9F, 0xB6, 0xEF, 0xF4, 0x60, 0x0B, 0x8F, 0x5F, 0xEF, 0x30, 0xE7, 0x02, 0x61, 0x5D, 0x85, +0x5F, 0x60, 0xE5, 0x60, 0x64, 0x2D, 0x70, 0x2E, 0x75, 0xF0, 0x04, 0xE5, 0x5E, 0x12, 0x4E, 0x2B, +0xFF, 0x54, 0x03, 0xFE, 0xE5, 0x61, 0xC3, 0x9E, 0x50, 0x1C, 0x75, 0x5F, 0x2C, 0x05, 0x61, 0xE5, +0x61, 0xB1, 0x0A, 0xFE, 0x75, 0xF0, 0x04, 0xE5, 0x5E, 0x90, 0x96, 0x14, 0x12, 0x49, 0x22, 0xEF, +0x54, 0xF3, 0x4E, 0xF0, 0x61, 0x5D, 0xE5, 0x60, 0xB4, 0x2C, 0x05, 0x75, 0x5F, 0x2D, 0x61, 0x5D, +0xE5, 0x60, 0xC3, 0x95, 0x62, 0x40, 0x02, 0x61, 0x25, 0xE5, 0x60, 0xC3, 0x94, 0x0C, 0x40, 0x13, +0xE5, 0x60, 0x94, 0x13, 0x50, 0x0D, 0x12, 0x7D, 0xFF, 0xE0, 0xFF, 0x20, 0xE3, 0x05, 0x75, 0x64, +0x01, 0x80, 0x18, 0xE5, 0x60, 0xC3, 0x94, 0x2C, 0x40, 0x1A, 0xE5, 0x60, 0x94, 0x35, 0x50, 0x14, +0x12, 0x7D, 0xFF, 0xE0, 0xFF, 0x20, 0xE3, 0x0C, 0x75, 0x64, 0x02, 0x12, 0x7D, 0xFF, 0xEF, 0x44, +0x08, 0xF0, 0x80, 0x07, 0x12, 0x7D, 0xFC, 0xE0, 0x54, 0xF7, 0xF0, 0x12, 0x7D, 0xFF, 0xE0, 0x20, +0xE6, 0x03, 0x30, 0xE1, 0x07, 0x12, 0x7D, 0xFC, 0xE0, 0x54, 0xF7, 0xF0, 0xE5, 0x64, 0x64, 0x01, +0x70, 0x70, 0x71, 0x60, 0x20, 0xE7, 0x0E, 0x20, 0xE6, 0x0B, 0x20, 0xE5, 0x08, 0x20, 0xE4, 0x05, +0x71, 0x6D, 0x30, 0xE0, 0x5D, 0x12, 0x7D, 0xFF, 0xE0, 0x44, 0x04, 0xF0, 0xE5, 0x60, 0xB4, 0x0C, +0x08, 0x75, 0x60, 0x14, 0x75, 0x5F, 0x14, 0x41, 0x9C, 0xE5, 0x60, 0xB4, 0x0D, 0x02, 0x80, 0x05, +0xE5, 0x60, 0xB4, 0x0E, 0x08, 0x75, 0x60, 0x15, 0x75, 0x5F, 0x15, 0x41, 0x9C, 0xE5, 0x60, 0xB4, +0x0F, 0x08, 0x75, 0x60, 0x16, 0x75, 0x5F, 0x16, 0x41, 0x9C, 0xE5, 0x60, 0xC3, 0x94, 0x10, 0x40, +0x08, 0x75, 0x60, 0x17, 0x75, 0x5F, 0x17, 0x41, 0x9C, 0xE5, 0x60, 0xC3, 0x94, 0x11, 0x50, 0x02, +0x41, 0x9C, 0xE5, 0x60, 0x94, 0x13, 0x40, 0x02, 0x41, 0x9C, 0x75, 0x60, 0x18, 0x75, 0x5F, 0x18, +0x80, 0x7A, 0xE5, 0x64, 0x64, 0x02, 0x70, 0x79, 0x71, 0x60, 0x20, 0xE6, 0x0E, 0x20, 0xE7, 0x0B, +0x71, 0x6D, 0x20, 0xE0, 0x06, 0x20, 0xE1, 0x03, 0x30, 0xE2, 0x66, 0xE5, 0x60, 0x64, 0x2C, 0x60, +0x05, 0xE5, 0x60, 0xB4, 0x2D, 0x08, 0x75, 0x60, 0x36, 0x75, 0x5F, 0x36, 0x80, 0x4E, 0xE5, 0x60, +0x64, 0x2E, 0x60, 0x05, 0xE5, 0x60, 0xB4, 0x2F, 0x08, 0x75, 0x60, 0x37, 0x75, 0x5F, 0x37, 0x80, +0x3B, 0xE5, 0x60, 0xB4, 0x30, 0x08, 0x75, 0x60, 0x38, 0x75, 0x5F, 0x38, 0x80, 0x2E, 0xE5, 0x60, +0xB4, 0x31, 0x08, 0x75, 0x60, 0x39, 0x75, 0x5F, 0x39, 0x80, 0x21, 0xE5, 0x60, 0xC3, 0x94, 0x32, +0x40, 0x0F, 0xE5, 0x60, 0xD3, 0x94, 0x34, 0x50, 0x08, 0x75, 0x60, 0x3A, 0x75, 0x5F, 0x3A, 0x80, +0x0B, 0xE5, 0x60, 0xB4, 0x35, 0x06, 0x75, 0x60, 0x3B, 0x75, 0x5F, 0x3B, 0x12, 0x6C, 0x12, 0x80, +0x07, 0x12, 0x7D, 0xFF, 0xE0, 0x54, 0xFB, 0xF0, 0xAD, 0x60, 0xAF, 0x63, 0x11, 0x5C, 0x8F, 0x60, +0xAD, 0x62, 0xAF, 0x63, 0x11, 0x5C, 0x8F, 0x62, 0xE5, 0x60, 0x04, 0xFD, 0xED, 0xD3, 0x95, 0x62, +0x50, 0x3A, 0xB1, 0x21, 0xE5, 0x5E, 0x12, 0x4F, 0xB0, 0xE0, 0xFB, 0x7A, 0x00, 0x12, 0x6F, 0xCB, +0x80, 0x05, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, 0xF9, 0x12, 0x8F, 0x87, 0x60, 0x1B, 0xE5, 0x60, +0xB4, 0x13, 0x0F, 0x75, 0x60, 0x18, 0x85, 0x60, 0x5F, 0x12, 0x7D, 0xFF, 0xE0, 0x44, 0x04, 0xF0, +0x80, 0x0A, 0x8D, 0x60, 0x85, 0x60, 0x5F, 0x80, 0x03, 0x0D, 0x80, 0xC0, 0xAD, 0x5F, 0xAF, 0x63, +0xB1, 0x2C, 0x8F, 0x5F, 0x12, 0x7D, 0xFF, 0xE0, 0x30, 0xE0, 0x52, 0xE5, 0x60, 0x64, 0x3F, 0x70, +0x4C, 0x12, 0x4F, 0x99, 0xC4, 0x13, 0x54, 0x07, 0x30, 0xE0, 0x05, 0x75, 0x5F, 0xBE, 0x80, 0x3D, +0x85, 0x60, 0x5F, 0x80, 0x38, 0xE5, 0x60, 0x65, 0x62, 0x70, 0x26, 0x12, 0x4F, 0x9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 0x2F, 0x12, 0x6B, 0xFA, 0xE0, 0xFE, +0xB4, 0x05, 0x08, 0xED, 0xC3, 0x94, 0x3B, 0x40, 0x51, 0x80, 0x47, 0xEE, 0xB4, 0x04, 0x08, 0xED, +0xC3, 0x94, 0x31, 0x40, 0x45, 0x80, 0x3B, 0x74, 0x91, 0x2F, 0x12, 0x6B, 0xFA, 0xE0, 0xFE, 0xB4, +0x03, 0x08, 0xED, 0xC3, 0x94, 0x19, 0x40, 0x32, 0x80, 0x28, 0xEE, 0xB4, 0x02, 0x08, 0xED, 0xC3, +0x94, 0x11, 0x40, 0x26, 0x80, 0x1C, 0x74, 0x91, 0x2F, 0x12, 0x6B, 0xFA, 0xE0, 0xFE, 0xB4, 0x01, +0x08, 0xED, 0xC3, 0x94, 0x0A, 0x40, 0x13, 0x80, 0x09, 0xEE, 0x70, 0x0B, 0xED, 0xC3, 0x94, 0x03, +0x40, 0x08, 0x75, 0x5E, 0x01, 0x80, 0x03, 0xE4, 0xF5, 0x5E, 0xAF, 0x5E, 0x22, 0x8F, 0x52, 0x8D, +0x53, 0x8B, 0x54, 0x75, 0xF0, 0x04, 0xEF, 0x12, 0x4E, 0x2B, 0xC4, 0x54, 0x03, 0x90, 0xA0, 0xCF, +0xF0, 0x90, 0xA0, 0xCD, 0x60, 0x09, 0x74, 0x32, 0xF0, 0xA3, 0x74, 0x2F, 0xF0, 0x80, 0x07, 0x74, +0x11, 0xF0, 0xA3, 0x74, 0x0F, 0xF0, 0xE5, 0x53, 0xD3, 0x94, 0x2D, 0x40, 0x0A, 0x75, 0xF0, 0x04, +0xE5, 0x52, 0x12, 0x6F, 0x7E, 0x80, 0x20, 0xE5, 0x53, 0xD3, 0x94, 0x1E, 0x40, 0x05, 0x90, 0xA0, +0xCD, 0x80, 0x14, 0xE5, 0x53, 0xD3, 0x94, 0x14, 0x40, 0x05, 0x90, 0xA0, 0xCE, 0x80, 0x08, 0x75, +0xF0, 0x04, 0xE5, 0x52, 0x12, 0x4F, 0x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0F, 0x64, 0x04, 0x22, 0x12, 0x37, 0xBC, 0xEF, 0x44, 0x03, 0xFF, 0xEC, 0x90, 0xA1, 0x96, +0x12, 0x08, 0x6D, 0x90, 0xA1, 0x96, 0x22, 0xE5, 0x51, 0x25, 0xE0, 0x24, 0x01, 0xF5, 0x82, 0xE4, +0x34, 0x92, 0xF5, 0x83, 0x22, 0x74, 0x91, 0x25, 0x51, 0xF5, 0x82, 0xE4, 0x34, 0x9C, 0xF5, 0x83, +0x22, 0xFD, 0x7C, 0x00, 0x12, 0x07, 0x03, 0xEF, 0x25, 0x55, 0xF5, 0x55, 0xEE, 0x35, 0x54, 0xF5, +0x54, 0x22, 0xFE, 0x54, 0x10, 0xFD, 0xEF, 0x54, 0xEF, 0x4D, 0xFF, 0x22, 0x90, 0x9F, 0xDD, 0xE0, +0x24, 0x04, 0x90, 0x9F, 0xBF, 0xF0, 0xA3, 0x74, 0x08, 0xF0, 0x22, 0xA4, 0xF5, 0x82, 0x85, 0xF0, +0x83, 0x12, 0x07, 0xAB, 0xAE, 0xF0, 0xA8, 0x59, 0x08, 0x22, 0x90, 0xA1, 0x25, 0xE0, 0x24, 0x15, +0xF5, 0x82, 0xE4, 0x34, 0xA1, 0xF5, 0x83, 0x22, 0xF0, 0xEE, 0x54, 0x08, 0xFE, 0xEF, 0x54, 0xF7, +0x22, 0x7E, 0x00, 0x7F, 0x04, 0x7D, 0x00, 0x7B, 0x01, 0x7A, 0xA0, 0x79, 0x52, 0x22, 0xE0, 0x90, +0x01, 0xBA, 0xF0, 0x90, 0x9F, 0xA9, 0xE0, 0x90, 0x01, 0xBB, 0x22, 0xD3, 0x9F, 0xEE, 0x64, 0x80, +0xF8, 0x74, 0x80, 0x98, 0x22, 0x7F, 0x00, 0x7E, 0x0C, 0x12, 0x38, 0x07, 0x7F, 0x00, 0x7E, 0x0E, +0x22, 0x74, 0x01, 0x25, 0x51, 0xF5, 0x82, 0xE4, 0x34, 0x94, 0xF5, 0x83, 0x22, 0x74, 0x91, 0x25, +0x51, 0xF5, 0x82, 0xE4, 0x34, 0x9A, 0xF5, 0x83, 0x22, 0x90, 0x04, 0xA0, 0xE0, 0xFF, 0xA3, 0xE0, +0xFE, 0xEF, 0x64, 0x01, 0x22, 0xF0, 0xEE, 0x54, 0x20, 0xFE, 0xEF, 0x54, 0xDF, 0x22, 0x90, 0x9F, +0xA9, 0xE0, 0xFF, 0xE4, 0xFD, 0x02, 0x58, 0x65, 0xD3, 0xE5, 0x57, 0x94, 0xE8, 0xE5, 0x56, 0x94, +0x03, 0x22, 0x74, 0x01, 0x93, 0x95, 0x55, 0xE4, 0x93, 0x95, 0x54, 0x22, 0x12, 0x49, 0x22, 0xE0, +0xFB, 0xE4, 0xFD, 0x0F, 0x22, 0x7F, 0xB4, 0x7E, 0x08, 0x12, 0x37, 0xBC, 0xEF, 0x22, 0xE0, 0xFE, +0xA3, 0xE0, 0xF5, 0x82, 0x8E, 0x83, 0x22, 0xF0, 0x7F, 0x10, 0x7E, 0x00, 0x02, 0x3D, 0x7A, 0x90, +0x06, 0x0A, 0xE0, 0x54, 0xF8, 0xF0, 0x22, 0x90, 0x06, 0x04, 0xE0, 0x54, 0x7F, 0xF0, 0x22, 0x2F, +0xF8, 0xE6, 0xFE, 0xED, 0xF4, 0x5E, 0x22, 0xE5, 0x57, 0xAE, 0x56, 0xA8, 0x59, 0x08, 0x22, 0xE5, +0x54, 0xF0, 0xA3, 0xE5, 0x55, 0xF0, 0x22, 0x00, 0x1D, 0x83, +}; +u4Byte ArrayLength_MP_8821A_FW_NIC_BT = 27050; + + +void +ODM_ReadFirmware_MP_8821A_FW_NIC_BT( + IN PDM_ODM_T pDM_Odm, + OUT u1Byte *pFirmware, + OUT u4Byte *pFirmwareSize +) +{ +#if (DM_ODM_SUPPORT_TYPE & (ODM_CE)) + *((SIZE_PTR *)pFirmware) = (SIZE_PTR)Array_MP_8821A_FW_NIC_BT; +#else + ODM_MoveMemory(pDM_Odm, pFirmware, Array_MP_8821A_FW_NIC_BT, ArrayLength_MP_8821A_FW_NIC_BT); +#endif + *pFirmwareSize = ArrayLength_MP_8821A_FW_NIC_BT; +} + + +u1Byte Array_MP_8821A_FW_WoWLAN[] = { +0x01, 0x21, 0x30, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x09, 0x05, 0x15, 0x19, 0x6A, 0x6A, 0x00, 0x00, +0xD0, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x02, 0x4A, 0xFA, 0x02, 0x6F, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x02, 0x70, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x02, 0x7F, 0xEE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x02, 0x6F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x77, 0xF8, 0x00, 0x00, +0x00, 0x00, 0x00, 0x02, 0x7F, 0xED, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0xC2, 0xAF, 0x80, 0xFE, 0x32, 0x12, 0x45, 0xC4, 0x85, 0xD0, 0x0B, 0x75, 0xD0, 0x08, 0xAA, 0xE0, +0xC2, 0x8C, 0xE5, 0x8A, 0x24, 0x67, 0xF5, 0x8A, 0xE5, 0x8C, 0x34, 0x79, 0xF5, 0x8C, 0xD2, 0x8C, +0xEC, 0x24, 0x87, 0xF8, 0xE6, 0xBC, 0x02, 0x02, 0x74, 0xFF, 0xC3, 0x95, 0x81, 0xB4, 0x40, 0x00, +0x40, 0xCE, 0x79, 0x03, 0x78, 0x80, 0x16, 0xE6, 0x08, 0x70, 0x0B, 0xC2, 0xAF, 0xE6, 0x30, 0xE1, +0x03, 0x44, 0x18, 0xF6, 0xD2, 0xAF, 0x08, 0xD9, 0xED, 0xEA, 0x8B, 0xD0, 0x22, 0xE5, 0x0C, 0xFF, +0x23, 0x24, 0x81, 0xF8, 0x0F, 0x08, 0x08, 0xBF, 0x03, 0x04, 0x7F, 0x00, 0x78, 0x81, 0xE6, 0x30, +0xE4, 0xF2, 0x00, 0x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 0x04, 0xF4, 0x56, 0x80, 0x01, 0x46, 0xF6, 0xDF, 0xE4, 0x80, 0x0B, +0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x90, 0x4B, 0x7D, 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, 0x41, 0x95, 0x36, +0x00, 0x41, 0x95, 0x37, 0x00, 0x41, 0x95, 0x48, 0x00, 0x41, 0x94, 0x65, 0x00, 0x41, 0x94, 0x47, +0x00, 0x44, 0x95, 0x26, 0x00, 0x50, 0xF2, 0x01, 0x00, 0x4D, 0xB2, 0x58, 0x8A, 0x67, 0xFE, 0xD3, +0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x8F, 0x82, 0x75, 0x83, 0x00, 0xED, 0xF1, 0xFC, 0xD0, 0xD0, +0x92, 0xAF, 0x22, 0x13, 0x54, 0x01, 0xFD, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x95, +0x3D, 0xED, 0xF0, 0x90, 0x95, 0x3C, 0xEF, 0xF0, 0xD3, 0x94, 0x07, 0x50, 0x41, 0x7F, 0x47, 0x91, +0x5C, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0xF4, 0x5F, 0xFD, 0x7F, 0x47, 0x71, 0x9F, 0x7F, 0x46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xD1, 0xC1, 0x12, 0xA9, 0xC1, 0xD1, 0xC1, 0x7F, +0x00, 0x7E, 0x0E, 0x12, 0x38, 0x07, 0x91, 0xEB, 0x91, 0xD8, 0x91, 0xD8, 0x54, 0xFE, 0xFD, 0x7F, +0x02, 0x71, 0x9F, 0x12, 0xAA, 0x39, 0x44, 0x40, 0xD1, 0xC7, 0x7F, 0xB4, 0x7E, 0x08, 0x12, 0x38, +0x07, 0x90, 0x01, 0x00, 0x74, 0x3F, 0xF0, 0xA3, 0xE0, 0x54, 0xFD, 0xF0, 0x90, 0x05, 0x53, 0xE0, +0x44, 0x20, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x54, 0xFE, 0xFD, 0x7F, 0x02, 0x71, 0x9F, 0x7F, +0x02, 0x91, 0x69, 0xEF, 0x44, 0x01, 0xFD, 0x7F, 0x02, 0x71, 0x9F, 0x7F, 0x02, 0x91, 0x69, 0xEF, +0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x7F, 0x10, 0x91, 0x69, 0xEF, 0x44, 0x0C, 0xFD, +0x7F, 0x10, 0x71, 0x9F, 0x7F, 0x72, 0x91, 0x69, 0xEF, 0x54, 0xF3, 0xFD, 0x7F, 0x72, 0x71, 0x9F, +0x90, 0x01, 0x01, 0xE0, 0x44, 0x02, 0xF0, 0x90, 0x01, 0x00, 0x74, 0xFF, 0xF0, 0x90, 0x06, 0xB7, +0x74, 0x09, 0xF0, 0x90, 0x06, 0xB4, 0x74, 0x86, 0xF0, 0x12, 0xAA, 0x39, 0x54, 0xBF, 0xF1, 0xA7, +0x90, 0x95, 0x12, 0xD1, 0xD2, 0x7F, 0xB4, 0x7E, 0x08, 0x12, 0x38, 0x07, 0x91, 0xEB, 0x44, 0x01, +0xFD, 0x7F, 0x02, 0x71, 0x9F, 0x7F, 0x00, 0x7E, 0x0C, 0x12, 0x37, 0xBC, 0xEF, 0x44, 0x03, 0xF1, +0xA7, 0x90, 0x95, 0x12, 0xD1, 0xD2, 0x12, 0xA9, 0xC1, 0x12, 0x37, 0xBC, 0xEF, 0x44, 0x03, 0xF1, +0xA7, 0x90, 0x95, 0x12, 0xD1, 0xD2, 0x7F, 0x00, 0x7E, 0x0E, 0x12, 0x38, 0x07, 0xD0, 0xD0, 0x92, +0xAF, 0x22, 0x7F, 0x54, 0x91, 0x69, 0xE5, 0x0D, 0x5F, 0xF5, 0x11, 0x7F, 0x55, 0x91, 0x69, 0xE5, +0x0E, 0x5F, 0xF5, 0x12, 0x7F, 0x56, 0x91, 0x69, 0xE5, 0x0F, 0x5F, 0xF5, 0x13, 0x7F, 0x57, 0x91, +0x69, 0xE5, 0x10, 0x5F, 0xF5, 0x14, 0xAD, 0x11, 0x7F, 0x54, 0x71, 0x9F, 0xAD, 0x12, 0x7F, 0x55, +0x71, 0x9F, 0xAD, 0x13, 0x7F, 0x56, 0x71, 0x9F, 0xAD, 0x14, 0x7F, 0x57, 0x71, 0x9F, 0x53, 0x91, +0xEF, 0x22, 0x7F, 0x81, 0x91, 0x69, 0xEF, 0x54, 0xFE, 0xFD, 0x7F, 0x81, 0x71, 0x9F, 0x7F, 0x80, +0xF1, 0xEC, 0x7F, 0x80, 0x71, 0x9F, 0x12, 0x9A, 0x2B, 0x12, 0x3D, 0x3B, 0xF1, 0xF9, 0xF1, 0xF3, +0x7F, 0x01, 0x12, 0x46, 0xD5, 0x90, 0x93, 0x23, 0x74, 0x02, 0xF0, 0xFF, 0x12, 0x46, 0xD5, 0x90, +0x93, 0x23, 0xE0, 0x04, 0xF0, 0x12, 0x58, 0x1F, 0x12, 0x95, 0xA1, 0x7F, 0x80, 0x91, 0x69, 0xEF, +0x44, 0x40, 0xFD, 0x7F, 0x80, 0x71, 0x9F, 0x75, 0x28, 0xFF, 0x12, 0x58, 0x83, 0x12, 0x9A, 0x52, +0x12, 0x88, 0x16, 0x7F, 0x81, 0x91, 0x69, 0xEF, 0x44, 0x04, 0xFD, 0x7F, 0x81, 0x71, 0x9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 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, +0x93, 0x4A, 0xEF, 0xF0, 0x12, 0x88, 0x2F, 0x90, 0x93, 0x4A, 0xE0, 0xFF, 0x31, 0x47, 0x74, 0x01, +0xF0, 0x90, 0x93, 0x4F, 0xE0, 0xFE, 0xEF, 0x31, 0x55, 0xEE, 0xF0, 0x90, 0x93, 0x4A, 0xE0, 0x11, +0x9C, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x01, 0x11, 0x91, 0x78, 0x10, 0x12, 0x08, 0x47, 0xAB, +0x07, 0x11, 0x91, 0x78, 0x08, 0x12, 0x08, 0x47, 0x90, 0x94, 0xE7, 0xEF, 0xF0, 0x11, 0x91, 0x90, +0x94, 0xE8, 0xEF, 0xF0, 0x7D, 0x01, 0x7F, 0x50, 0x7E, 0x01, 0x11, 0x04, 0xD0, 0xD0, 0x92, 0xAF, +0x22, 0x90, 0x93, 0x4B, 0x02, 0x48, 0xF4, 0x90, 0x93, 0x38, 0xE0, 0xFB, 0x75, 0xF0, 0x0A, 0xA4, +0x24, 0xF7, 0xF5, 0x82, 0xE4, 0x34, 0x93, 0xF5, 0x83, 0x22, 0xE4, 0x90, 0x93, 0x38, 0xF0, 0x90, +0x93, 0x38, 0xE0, 0xFF, 0xC3, 0x94, 0x08, 0x40, 0x02, 0x21, 0x3F, 0xEF, 0x31, 0x47, 0xE0, 0x64, +0x01, 0x70, 0x74, 0x90, 0x93, 0x38, 0xE0, 0x11, 0x9C, 0x12, 0x48, 0xF4, 0xE4, 0x7B, 0x01, 0x31, +0x40, 0x70, 0x3A, 0x90, 0x93, 0x38, 0xE0, 0xFB, 0x31, 0x55, 0xE0, 0x60, 0x21, 0x14, 0x70, 0x57, +0xEB, 0x75, 0xF0, 0x0A, 0xA4, 0x24, 0xFB, 0xF5, 0x82, 0xE4, 0x34, 0x93, 0xF5, 0x83, 0x12, 0x48, +0xF4, 0xEB, 0x11, 0x9C, 0x12, 0x08, 0x6D, 0x90, 0x93, 0x38, 0xE0, 0xFF, 0x80, 0x0B, 0x11, 0x97, +0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0xAF, 0x03, 0x31, 0x63, 0x80, 0x2A, 0x90, 0x93, 0x38, +0xE0, 0x11, 0x9C, 0x12, 0x48, 0xF4, 0xE4, 0xFB, 0x31, 0x40, 0x50, 0x1B, 0x11, 0x97, 0x12, 0x48, +0xF4, 0xEF, 0x24, 0xFF, 0xFF, 0xEE, 0x34, 0xFF, 0xFE, 0xED, 0x34, 0xFF, 0xFD, 0xEC, 0x34, 0xFF, +0xFC, 0xEB, 0x11, 0x9C, 0x12, 0x08, 0x6D, 0x90, 0x93, 0x38, 0xE0, 0x04, 0xF0, 0x01, 0xAF, 0x22, +0xFA, 0xF9, 0xF8, 0xC3, 0x02, 0x48, 0xE3, 0x75, 0xF0, 0x0A, 0xA4, 0x24, 0x00, 0xF5, 0x82, 0xE4, +0x34, 0x94, 0xF5, 0x83, 0x22, 0x75, 0xF0, 0x0A, 0xA4, 0x24, 0xFF, 0xF5, 0x82, 0xE4, 0x34, 0x93, +0xF5, 0x83, 0x22, 0xEF, 0x24, 0xFC, 0x60, 0x05, 0x04, 0x70, 0x05, 0x80, 0x04, 0x12, 0x80, 0xEF, +0x22, 0xE4, 0x90, 0x93, 0x39, 0xF0, 0x90, 0x94, 0x65, 0x04, 0xF0, 0x90, 0x06, 0x32, 0xE0, 0x44, +0x04, 0xF0, 0x90, 0x93, 0x0E, 0x12, 0x48, 0xF4, 0x12, 0x95, 0x6A, 0xE4, 0x3D, 0xFD, 0xE4, 0x3C, +0xFC, 0x90, 0x93, 0x0E, 0x12, 0x08, 0x6D, 0x12, 0xA7, 0xD8, 0xE4, 0x90, 0x94, 0x49, 0xF0, 0xFF, +0x12, 0x83, 0xB6, 0x12, 0x72, 0xD5, 0x70, 0x27, 0x31, 0xDE, 0x7F, 0x05, 0x7E, 0x00, 0x12, 0x3C, +0xEC, 0x71, 0xEB, 0x90, 0x8E, 0x18, 0xE0, 0x64, 0x02, 0x60, 0x14, 0x90, 0x93, 0x39, 0xE0, 0x04, +0xF0, 0x12, 0xAA, 0x51, 0x31, 0xDE, 0x90, 0x93, 0x39, 0xE0, 0xD3, 0x94, 0x0A, 0x40, 0xE4, 0x90, +0x93, 0x4B, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x0A, 0x12, 0x87, 0xB1, 0x01, 0x38, 0x7D, 0x01, +0x7F, 0x02, 0x80, 0x04, 0x7D, 0x01, 0x7F, 0x04, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, +0x95, 0x4B, 0xED, 0xF0, 0x90, 0x8E, 0x11, 0xE0, 0xFE, 0xC4, 0x13, 0x13, 0x54, 0x03, 0x30, 0xE0, +0x02, 0x61, 0x33, 0xEE, 0x12, 0x6F, 0xF0, 0x30, 0xE0, 0x02, 0x61, 0x33, 0x90, 0x8E, 0x18, 0xE0, +0xFE, 0x6F, 0x70, 0x02, 0x61, 0x33, 0xEF, 0x70, 0x02, 0x41, 0xA7, 0x24, 0xFE, 0x70, 0x02, 0x41, +0xE0, 0x24, 0xFE, 0x60, 0x4A, 0x24, 0xFC, 0x70, 0x02, 0x61, 0x1B, 0x24, 0xFC, 0x60, 0x02, 0x61, +0x2D, 0xEE, 0xB4, 0x0E, 0x02, 0x71, 0x6A, 0x90, 0x8E, 0x18, 0xE0, 0x70, 0x04, 0x7F, 0x01, 0x71, +0xA6, 0x90, 0x8E, 0x18, 0xE0, 0xB4, 0x06, 0x02, 0x71, 0x85, 0x90, 0x8E, 0x18, 0xE0, 0xB4, 0x04, +0x0F, 0x90, 0x95, 0x4B, 0xE0, 0xFF, 0x60, 0x05, 0x12, 0x73, 0x6A, 0x80, 0x03, 0x12, 0x79, 0x4E, +0x90, 0x8E, 0x18, 0xE0, 0x64, 0x08, 0x60, 0x02, 0x61, 0x2D, 0x12, 0xA7, 0x8A, 0x61, 0x2D, 0x90, +0x8E, 0x18, 0xE0, 0x70, 0x04, 0x7F, 0x01, 0x71, 0xA6, 0x90, 0x8E, 0x18, 0xE0, 0xB4, 0x06, 0x02, +0x71, 0x85, 0x90, 0x8E, 0x18, 0xE0, 0xB4, 0x0E, 0x07, 0x71, 0x38, 0xBF, 0x01, 0x02, 0x71, 0x6A, +0x90, 0x8E, 0x18, 0xE0, 0x64, 0x0C, 0x60, 0x02, 0x61, 0x2D, 0x71, 0x38, 0xEF, 0x64, 0x01, 0x60, +0x02, 0x61, 0x2D, 0x71, 0xBD, 0x61, 0x2D, 0x90, 0x8E, 0x18, 0xE0, 0xB4, 0x0E, 0x07, 0x71, 0x38, +0xBF, 0x01, 0x02, 0x71, 0x6A, 0x90, 0x8E, 0x18, 0xE0, 0xB4, 0x06, 0x02, 0x71, 0x85, 0x90, 0x8E, +0x18, 0xE0, 0xB4, 0x0C, 0x07, 0x71, 0x38, 0xBF, 0x01, 0x02, 0x71, 0xBD, 0x90, 0x8E, 0x18, 0xE0, +0x64, 0x04, 0x70, 0x59, 0x12, 0x59, 0xFD, 0xEF, 0x64, 0x01, 0x70, 0x51, 0xF1, 0xCB, 0x80, 0x4D, +0x90, 0x8E, 0x18, 0xE0, 0xB4, 0x0E, 0x07, 0x71, 0x38, 0xBF, 0x01, 0x02, 0x71, 0x6A, 0x90, 0x8E, +0x18, 0xE0, 0xB4, 0x06, 0x02, 0x71, 0x85, 0x90, 0x8E, 0x18, 0xE0, 0xB4, 0x0C, 0x07, 0x71, 0x38, +0xBF, 0x01, 0x02, 0x71, 0xBD, 0x90, 0x8E, 0x18, 0xE0, 0x70, 0x04, 0x7F, 0x01, 0x71, 0xA6, 0x90, +0x8E, 0x18, 0xE0, 0xB4, 0x04, 0x17, 0x12, 0xA7, 0x7C, 0x80, 0x12, 0x90, 0x8E, 0x18, 0xE0, 0xB4, +0x0C, 0x0B, 0x90, 0x8E, 0x12, 0x12, 0x87, 0x6B, 0x30, 0xE0, 0x02, 0xF1, 0xEE, 0x90, 0x8E, 0x18, +0x12, 0xA9, 0x99, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x12, 0xA7, 0x36, 0xEF, 0x64, 0x01, 0x60, 0x05, +0x12, 0x5A, 0x97, 0x80, 0x1C, 0x12, 0x9E, 0x34, 0x30, 0xE0, 0x05, 0x12, 0x5A, 0x90, 0x80, 0x11, +0x90, 0x8E, 0x17, 0xE0, 0xD3, 0x94, 0x04, 0x40, 0x05, 0x12, 0x59, 0xF6, 0x80, 0x03, 0x02, 0x5A, +0x9E, 0x90, 0x01, 0xB9, 0x74, 0x02, 0xF0, 0x7F, 0x00, 0x22, 0x90, 0x8E, 0x12, 0xE0, 0xC3, 0x13, +0x20, 0xE0, 0x04, 0x7D, 0x0C, 0x80, 0x05, 0x12, 0x97, 0xB8, 0x7D, 0x04, 0x7F, 0x01, 0x71, 0xF7, +0xE4, 0xFD, 0xFF, 0x81, 0x6C, 0x90, 0x8E, 0x12, 0xE0, 0x90, 0x06, 0x04, 0x20, 0xE0, 0x08, 0xE0, +0x44, 0x40, 0xF0, 0x7D, 0x04, 0x80, 0x06, 0xE0, 0x54, 0x7F, 0xF0, 0x7D, 0x0C, 0x7F, 0x01, 0x71, +0xF7, 0xE4, 0xFD, 0xFF, 0x81, 0x6C, 0x90, 0x95, 0x4A, 0xEF, 0xF0, 0x12, 0x4C, 0xF1, 0x90, 0x95, +0x4A, 0xE0, 0x60, 0x03, 0x12, 0x87, 0xCC, 0x7D, 0x04, 0x7F, 0x01, 0x80, 0x3A, 0x12, 0x72, 0xD5, +0x70, 0x28, 0x90, 0x8E, 0x12, 0xE0, 0x54, 0xFD, 0xF0, 0x7D, 0x2C, 0x7F, 0x6F, 0x91, 0x6C, 0x7D, +0x08, 0x7F, 0x01, 0xF1, 0x27, 0xBF, 0x01, 0x0D, 0x90, 0x8E, 0x11, 0xE0, 0x44, 0x80, 0xF0, 0x7D, +0x0E, 0x7F, 0x01, 0x80, 0x12, 0x12, 0x77, 0xEE, 0x04, 0xF0, 0x22, 0x90, 0x8E, 0x17, 0xE0, 0x90, +0x94, 0x61, 0xF0, 0x7D, 0x02, 0x7F, 0x02, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x95, +0x49, 0xEF, 0xF0, 0x14, 0x60, 0x15, 0x14, 0x60, 0x19, 0x24, 0x02, 0x70, 0x1A, 0xED, 0x54, 0x01, +0xFF, 0x90, 0x8E, 0x11, 0xE0, 0x54, 0xFE, 0x4F, 0xF0, 0x80, 0x0C, 0x90, 0x8E, 0x18, 0xED, 0xF0, +0x80, 0x05, 0x90, 0x8E, 0x17, 0xED, 0xF0, 0x12, 0x4F, 0xA1, 0x30, 0xE4, 0x31, 0x90, 0x95, 0x49, +0xE0, 0x14, 0x60, 0x07, 0x14, 0x60, 0x1D, 0x24, 0x02, 0x70, 0x23, 0x90, 0x8E, 0x11, 0xE0, 0x54, +0x01, 0xC4, 0x33, 0x33, 0x33, 0x54, 0x80, 0xFF, 0x90, 0x8E, 0x18, 0xE0, 0x54, 0x7F, 0x4F, 0xFD, +0x7F, 0x88, 0x80, 0x07, 0x90, 0x8E, 0x17, 0xE0, 0xFD, 0x7F, 0x89, 0x12, 0x4B, 0x9F, 0xD0, 0xD0, +0x92, 0xAF, 0x22, 0xE4, 0xFD, 0x7F, 0x0C, 0x31, 0xE8, 0xE4, 0xFD, 0xFF, 0x90, 0x05, 0x22, 0xEF, +0xF0, 0x90, 0x8D, 0x05, 0xED, 0xF0, 0x22, 0x90, 0x93, 0x65, 0x12, 0x49, 0x21, 0x90, 0x05, 0x22, +0xE0, 0x90, 0x93, 0x76, 0xF0, 0x90, 0x04, 0x1D, 0xE0, 0x60, 0x09, 0x7D, 0x39, 0xF1, 0x73, 0xBF, +0x01, 0x10, 0x80, 0x00, 0x90, 0x93, 0x16, 0x12, 0x82, 0x17, 0x90, 0x93, 0x73, 0xEE, 0xF0, 0xA3, +0xEF, 0xF0, 0x90, 0x93, 0x73, 0x12, 0xA8, 0xD4, 0x12, 0x84, 0x71, 0x90, 0x93, 0x75, 0xEF, 0xF0, +0x90, 0x93, 0x73, 0xF1, 0xF9, 0x90, 0x93, 0x71, 0xE0, 0xFD, 0x12, 0x91, 0x03, 0x90, 0x93, 0x72, +0xE0, 0x60, 0x02, 0xA1, 0x46, 0xF1, 0x16, 0xC0, 0x03, 0xC0, 0x02, 0xC0, 0x01, 0x90, 0x93, 0x68, +0xF1, 0x05, 0x75, 0x43, 0x06, 0xD0, 0x01, 0xD0, 0x02, 0xD0, 0x03, 0xB1, 0xE6, 0xF1, 0xE4, 0xC0, +0x03, 0xC0, 0x02, 0xC0, 0x01, 0x90, 0x93, 0x65, 0xF1, 0x05, 0x75, 0x43, 0x10, 0xD0, 0x01, 0xD0, +0x02, 0xD0, 0x03, 0xB1, 0xE6, 0xF1, 0x19, 0xC0, 0x03, 0xC0, 0x02, 0xC0, 0x01, 0xF1, 0x02, 0x75, +0x43, 0x10, 0xD0, 0x01, 0xD0, 0x02, 0xD0, 0x03, 0xB1, 0xE6, 0x24, 0x60, 0xF9, 0xE4, 0x34, 0xFC, +0xFA, 0x7B, 0x01, 0xC0, 0x03, 0xC0, 0x02, 0xC0, 0x01, 0xF1, 0x02, 0x75, 0x43, 0x10, 0xD0, 0x01, +0xD0, 0x02, 0xD0, 0x03, 0xB1, 0xE6, 0x24, 0x72, 0xF9, 0xE4, 0x34, 0xFC, 0xFA, 0x7B, 0x01, 0xC0, +0x03, 0xC0, 0x02, 0xC0, 0x01, 0x90, 0x93, 0x6E, 0xF1, 0x05, 0x75, 0x43, 0x06, 0xD0, 0x01, 0xD0, +0x02, 0xD0, 0x03, 0x12, 0x34, 0x62, 0x90, 0x93, 0x6B, 0x12, 0x49, 0x18, 0x90, 0x93, 0xA2, 0x12, +0x49, 0x21, 0x90, 0x93, 0xA5, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x20, 0x90, 0x93, 0xA9, 0x74, +0x3A, 0xF0, 0x90, 0x93, 0x65, 0x12, 0x49, 0x18, 0x12, 0xA6, 0x4D, 0xB1, 0xE9, 0x24, 0x30, 0xF9, +0xE4, 0x34, 0xFC, 0x12, 0x83, 0xF4, 0x75, 0x43, 0x28, 0x7B, 0x01, 0x7A, 0x93, 0x79, 0x77, 0xB1, +0xE6, 0x12, 0xA9, 0xD9, 0xC0, 0x03, 0x8B, 0x40, 0x75, 0x41, 0x8F, 0x75, 0x42, 0x64, 0x75, 0x43, +0x28, 0xD0, 0x03, 0x12, 0x34, 0x62, 0x90, 0x93, 0x75, 0xE0, 0xFF, 0x90, 0x93, 0x74, 0xE0, 0x2F, +0xFF, 0x90, 0x93, 0x73, 0xE0, 0x34, 0x00, 0xCF, 0x24, 0x30, 0xFD, 0xE4, 0x3F, 0xFC, 0x90, 0x93, +0x16, 0xE0, 0xFB, 0x7F, 0x3A, 0x12, 0x5D, 0x99, 0xB1, 0xE9, 0x12, 0xA9, 0xD9, 0xC0, 0x03, 0x8B, +0x40, 0x75, 0x41, 0x93, 0x75, 0x42, 0x77, 0x75, 0x43, 0x28, 0xD0, 0x03, 0x12, 0x34, 0x62, 0x90, +0x06, 0x33, 0xE0, 0x44, 0x02, 0xF0, 0x90, 0x93, 0x76, 0xE0, 0xFF, 0x7D, 0x3A, 0x91, 0x6C, 0x90, +0x04, 0x1F, 0x74, 0x20, 0xF0, 0x22, 0x12, 0x34, 0x62, 0x90, 0x93, 0x73, 0xA3, 0xE0, 0xFF, 0xA3, +0xE0, 0x2F, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x94, 0x9F, 0x12, 0x49, 0x21, +0x78, 0xAB, 0x7C, 0x94, 0x7D, 0x01, 0x7B, 0xFF, 0x7A, 0x40, 0x79, 0x64, 0x12, 0x6F, 0xF7, 0x90, +0x05, 0x22, 0xE0, 0x90, 0x94, 0xAA, 0xF0, 0x90, 0x04, 0x1D, 0xE0, 0x60, 0x09, 0x7D, 0x33, 0xF1, +0x73, 0xBF, 0x01, 0x10, 0x80, 0x00, 0x90, 0x93, 0x15, 0x12, 0x82, 0x17, 0x90, 0x94, 0xA7, 0xEE, +0xF0, 0xA3, 0xEF, 0xF0, 0x90, 0x94, 0xA7, 0x12, 0xA8, 0xD4, 0x12, 0x84, 0x71, 0x90, 0x94, 0xA9, +0xEF, 0xF0, 0x90, 0x94, 0xA7, 0xF1, 0xF9, 0x90, 0x94, 0xA5, 0xE0, 0xFD, 0x12, 0x91, 0x03, 0x90, +0x94, 0xA6, 0xE0, 0x70, 0x4E, 0xF1, 0x16, 0xC0, 0x03, 0xC0, 0x02, 0xC0, 0x01, 0x90, 0x94, 0xA2, +0xF1, 0x05, 0x75, 0x43, 0x06, 0xD0, 0x01, 0xD0, 0x02, 0xD0, 0x03, 0xF1, 0x0F, 0xB1, 0xEC, 0x12, +0x84, 0x6A, 0xFA, 0x7B, 0x01, 0xC0, 0x03, 0xC0, 0x02, 0xC0, 0x01, 0x90, 0x94, 0xA2, 0xF1, 0x05, +0x75, 0x43, 0x06, 0xD0, 0x01, 0xD0, 0x02, 0xD0, 0x03, 0xF1, 0x0F, 0xB1, 0xEC, 0xF1, 0xE4, 0xC0, +0x03, 0xC0, 0x02, 0xC0, 0x01, 0x90, 0x94, 0x9F, 0xF1, 0x05, 0x75, 0x43, 0x04, 0xD0, 0x01, 0xD0, +0x02, 0x80, 0x45, 0x90, 0x94, 0xA6, 0xE0, 0x64, 0x01, 0x70, 0x42, 0xF1, 0x16, 0xC0, 0x03, 0x8B, +0x40, 0x75, 0x41, 0x8E, 0x75, 0x42, 0xE0, 0x75, 0x43, 0x06, 0xD0, 0x03, 0xF1, 0x0F, 0xB1, 0xEC, +0x12, 0x84, 0x6A, 0xFA, 0x7B, 0x01, 0xC0, 0x03, 0x8B, 0x40, 0x75, 0x41, 0x8E, 0x75, 0x42, 0xEA, +0x75, 0x43, 0x06, 0xD0, 0x03, 0xF1, 0x0F, 0xB1, 0xEC, 0xF1, 0xE4, 0xC0, 0x03, 0x8B, 0x40, 0x75, +0x41, 0x8E, 0x75, 0x42, 0xF0, 0x75, 0x43, 0x04, 0xD0, 0x03, 0x12, 0x34, 0x62, 0x90, 0x06, 0x30, +0xE0, 0x44, 0x10, 0xF0, 0x90, 0x94, 0xAA, 0xE0, 0xFF, 0x7D, 0x34, 0xB1, 0xDD, 0xD0, 0xD0, 0x92, +0xAF, 0x22, 0x90, 0x93, 0x6B, 0x12, 0x49, 0x18, 0x8B, 0x40, 0x8A, 0x41, 0x89, 0x42, 0x22, 0x12, +0x34, 0x62, 0x90, 0x94, 0xA7, 0x22, 0xA3, 0xA3, 0xE0, 0x24, 0x38, 0xF9, 0xE4, 0x34, 0xFC, 0xFA, +0x7B, 0x01, 0x22, 0x7D, 0x08, 0xE4, 0xFF, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x95, +0x01, 0xEF, 0xF0, 0xA3, 0xED, 0xF0, 0x90, 0x8D, 0x03, 0xE0, 0x04, 0xF0, 0x90, 0x04, 0x1D, 0xE0, +0x60, 0x22, 0x90, 0x05, 0x22, 0xE0, 0x90, 0x95, 0x05, 0xF0, 0x7D, 0x26, 0xF1, 0x73, 0xEF, 0x64, +0x01, 0x70, 0x03, 0x12, 0x82, 0xBB, 0x90, 0x95, 0x05, 0xE0, 0xFF, 0x7D, 0x27, 0x91, 0x6C, 0x12, +0x97, 0x43, 0x80, 0x06, 0x12, 0x97, 0x43, 0x12, 0x82, 0xBB, 0xB1, 0xDF, 0x7F, 0x01, 0xD0, 0xD0, +0x92, 0xAF, 0x22, 0x7F, 0xFF, 0x91, 0x6C, 0xE4, 0x90, 0x95, 0x3A, 0xF0, 0xA3, 0xF0, 0x90, 0x05, +0xF8, 0xE0, 0x70, 0x0F, 0xA3, 0xE0, 0x70, 0x0B, 0xA3, 0xE0, 0x70, 0x07, 0xA3, 0xE0, 0x70, 0x03, +0x7F, 0x01, 0x22, 0xD3, 0x90, 0x95, 0x3B, 0xE0, 0x94, 0xE8, 0x90, 0x95, 0x3A, 0xE0, 0x94, 0x03, +0x40, 0x0A, 0x90, 0x01, 0xC0, 0xE0, 0x44, 0x20, 0xF0, 0x7F, 0x00, 0x22, 0x7F, 0x32, 0x7E, 0x00, +0x12, 0x3D, 0x7A, 0x90, 0x95, 0x3A, 0x12, 0x5A, 0xA6, 0x80, 0xC3, 0x12, 0x9E, 0x02, 0x90, 0x8E, +0x18, 0xE0, 0x64, 0x0C, 0x60, 0x04, 0x91, 0x63, 0xF1, 0x23, 0x22, 0x7D, 0x2D, 0xF1, 0x73, 0x90, +0x01, 0x37, 0x74, 0x02, 0xF0, 0xFD, 0x7F, 0x03, 0x12, 0x78, 0x7A, 0x12, 0x4C, 0x8A, 0xE4, 0xFD, +0x7F, 0x01, 0x61, 0xF7, 0x24, 0x48, 0xF9, 0xE4, 0x34, 0xFC, 0xFA, 0x7B, 0x01, 0x22, 0x7D, 0x2F, +0x12, 0x4C, 0x85, 0x7D, 0x08, 0x7F, 0x01, 0x61, 0xF7, 0xA3, 0xE0, 0x24, 0x28, 0xF9, 0xE4, 0x34, +0xFC, 0xFA, 0x7B, 0x01, 0x22, 0x7F, 0xF4, 0x12, 0x4C, 0x69, 0xEF, 0x20, 0xE5, 0x0E, 0x7F, 0xF4, +0x12, 0x4C, 0x69, 0xEF, 0x7F, 0x01, 0x20, 0xE4, 0x05, 0x7F, 0x02, 0x22, 0x7F, 0x03, 0x22, 0x11, +0x05, 0x90, 0x8D, 0x06, 0xEF, 0xF0, 0x11, 0x38, 0x90, 0x01, 0x64, 0x74, 0x01, 0xF0, 0x90, 0x04, +0x23, 0xE0, 0x44, 0x80, 0xF0, 0x02, 0x36, 0x83, 0x12, 0x4F, 0x26, 0x12, 0x4F, 0x48, 0x11, 0x45, +0x11, 0x64, 0x02, 0x4F, 0xC3, 0x75, 0x15, 0x10, 0xE4, 0xF5, 0x16, 0x75, 0x17, 0x07, 0x75, 0x18, +0x42, 0x90, 0x01, 0x30, 0xE5, 0x15, 0xF0, 0xA3, 0xE5, 0x16, 0xF0, 0xA3, 0xE5, 0x17, 0xF0, 0xA3, +0xE5, 0x18, 0xF0, 0x22, 0x75, 0x1D, 0x07, 0x75, 0x1E, 0x01, 0x75, 0x1F, 0x03, 0x75, 0x20, 0x62, +0x90, 0x01, 0x38, 0xE5, 0x1D, 0xF0, 0xA3, 0xE5, 0x1E, 0xF0, 0xA3, 0xE5, 0x1F, 0xF0, 0xA3, 0xE5, +0x20, 0xF0, 0x22, 0x75, 0xE8, 0x03, 0x75, 0xA8, 0x85, 0x22, 0xE4, 0x90, 0x93, 0x36, 0xF0, 0x90, +0x93, 0x36, 0xE0, 0x64, 0x01, 0xF0, 0x24, 0x8A, 0x90, 0x01, 0xC4, 0xF0, 0x74, 0x58, 0xA3, 0xF0, +0x12, 0x3D, 0x6E, 0xBF, 0x01, 0x03, 0x12, 0x31, 0x38, 0x90, 0x8E, 0x15, 0xE0, 0x60, 0x0F, 0x90, +0x8E, 0x18, 0xE0, 0xFF, 0x90, 0x8E, 0x17, 0xE0, 0x6F, 0x60, 0x03, 0x12, 0x77, 0xC1, 0xC2, 0xAF, +0x31, 0x21, 0xBF, 0x01, 0x02, 0x11, 0xD1, 0xD2, 0xAF, 0x12, 0x4F, 0xFA, 0x12, 0x46, 0x0D, 0x80, +0xBE, 0x90, 0x8E, 0x11, 0xE0, 0x30, 0xE0, 0x02, 0x11, 0xDB, 0x22, 0x90, 0x8E, 0x18, 0xE0, 0xFF, +0x60, 0x03, 0xB4, 0x08, 0x0D, 0x31, 0xA8, 0xBF, 0x01, 0x08, 0x11, 0xF3, 0x90, 0x01, 0xE5, 0xE0, +0x04, 0xF0, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x12, 0x4E, 0xDA, 0x31, 0x04, 0xD0, +0xD0, 0x92, 0xAF, 0x22, 0x12, 0x9F, 0x74, 0x7F, 0x08, 0x12, 0x4C, 0x69, 0xEF, 0x54, 0xEF, 0xFD, +0x7F, 0x08, 0x12, 0x4B, 0x9F, 0xE4, 0xFF, 0x31, 0x59, 0x90, 0x8E, 0x12, 0xE0, 0x54, 0xEF, 0xF0, +0x22, 0x7D, 0x02, 0x90, 0x01, 0xC4, 0x74, 0x21, 0xF0, 0x74, 0x59, 0xA3, 0xF0, 0x90, 0x93, 0x23, +0xE0, 0xFF, 0xED, 0xC3, 0x9F, 0x50, 0x14, 0xED, 0x25, 0xE0, 0x24, 0x81, 0xF8, 0xE6, 0x30, 0xE4, +0x07, 0x31, 0xF6, 0xA3, 0xF0, 0x7F, 0x00, 0x22, 0x0D, 0x80, 0xE2, 0x74, 0x21, 0x04, 0x90, 0x01, +0xC4, 0xF0, 0x74, 0x59, 0xA3, 0xF0, 0x7F, 0x01, 0x22, 0x90, 0x95, 0x30, 0xEF, 0x12, 0x94, 0x6D, +0x90, 0x01, 0x09, 0xE0, 0x7F, 0x00, 0x30, 0xE7, 0x02, 0x7F, 0x01, 0x90, 0x95, 0x30, 0xE0, 0x6F, +0x60, 0x35, 0xC3, 0x90, 0x95, 0x32, 0xE0, 0x94, 0x88, 0x90, 0x95, 0x31, 0xE0, 0x94, 0x13, 0x40, +0x08, 0x90, 0x01, 0xC0, 0xE0, 0x44, 0x10, 0xF0, 0x22, 0x90, 0x95, 0x31, 0x51, 0xA6, 0x12, 0x87, +0x92, 0xD3, 0x90, 0x95, 0x32, 0xE0, 0x94, 0x32, 0x90, 0x95, 0x31, 0xE0, 0x94, 0x00, 0x40, 0xC0, +0x90, 0x01, 0xC6, 0xE0, 0x30, 0xE0, 0xB9, 0x22, 0x90, 0x02, 0x87, 0xE0, 0x60, 0x04, 0x51, 0x97, +0x80, 0x3B, 0x90, 0x8E, 0xC0, 0xE0, 0x30, 0xE0, 0x0A, 0x90, 0x02, 0x82, 0xE0, 0x60, 0x04, 0x51, +0x90, 0x80, 0x2A, 0x90, 0x8E, 0xC9, 0xE0, 0x30, 0xE0, 0x04, 0x31, 0xF6, 0x80, 0x1F, 0x90, 0x02, +0x86, 0xE0, 0x20, 0xE1, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x04, 0xF0, 0x80, 0x10, 0x90, 0x04, 0x1D, +0xE0, 0x60, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x40, 0xF0, 0x80, 0x02, 0x41, 0x9E, 0x90, 0x01, 0xB9, +0x74, 0x08, 0xF0, 0x7F, 0x00, 0x22, 0x90, 0x01, 0xB8, 0x74, 0x08, 0xF0, 0x22, 0x12, 0xA7, 0x36, +0xEF, 0x64, 0x01, 0x60, 0x04, 0x51, 0x97, 0x80, 0x7E, 0x90, 0x8E, 0x19, 0xE0, 0xFF, 0x54, 0x03, +0x60, 0x04, 0x51, 0x90, 0x80, 0x71, 0x90, 0x8E, 0x17, 0xE0, 0xFE, 0xE4, 0xC3, 0x9E, 0x50, 0x08, +0x90, 0x01, 0xB8, 0x74, 0x04, 0xF0, 0x80, 0x5F, 0xEF, 0x30, 0xE2, 0x04, 0x31, 0xF6, 0x80, 0x57, +0x90, 0x8E, 0x19, 0xE0, 0x30, 0xE4, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x10, 0xF0, 0x80, 0x48, 0x90, +0x8E, 0x12, 0xE0, 0x13, 0x13, 0x54, 0x3F, 0x20, 0xE0, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x20, 0xF0, +0x80, 0x35, 0x90, 0x8E, 0xBF, 0xE0, 0x60, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x80, 0xF0, 0x80, 0x27, +0x90, 0x06, 0x62, 0xE0, 0x30, 0xE1, 0x08, 0x90, 0x01, 0xB8, 0x74, 0x11, 0xF0, 0x80, 0x18, 0x90, +0x06, 0x62, 0xE0, 0x30, 0xE0, 0x0F, 0xE0, 0x54, 0xFC, 0xFF, 0xBF, 0x80, 0x08, 0x90, 0x01, 0xB8, +0x74, 0x12, 0xF0, 0x80, 0x02, 0x80, 0x17, 0x90, 0x01, 0xB9, 0x74, 0x04, 0xF0, 0x7F, 0x00, 0x22, +0x90, 0x01, 0xB8, 0x74, 0x02, 0xF0, 0x22, 0x90, 0x01, 0xB8, 0x74, 0x01, 0xF0, 0x22, 0x90, 0x01, +0xB8, 0xE4, 0xF0, 0x7F, 0x01, 0x22, 0xE4, 0x75, 0xF0, 0x01, 0x02, 0x08, 0xD6, 0xD3, 0x10, 0xAF, +0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x93, 0x40, 0x12, 0x8C, 0xBA, 0x90, 0x93, 0x58, 0x74, 0x18, 0xF0, +0x7E, 0x00, 0x7F, 0x80, 0x7D, 0x00, 0x7B, 0x01, 0x7A, 0x93, 0x79, 0x60, 0x12, 0x08, 0xAA, 0x90, +0x01, 0xC4, 0x74, 0xAD, 0xF0, 0x74, 0x5A, 0xA3, 0xF0, 0x90, 0x93, 0x17, 0xE0, 0xFF, 0x12, 0x7F, +0xD6, 0x90, 0x93, 0x57, 0xEF, 0xF0, 0xF9, 0xE0, 0xFE, 0x24, 0x29, 0xF5, 0x82, 0xE4, 0x34, 0xFC, +0xF5, 0x83, 0x74, 0x41, 0xF0, 0xEE, 0x24, 0x28, 0xFD, 0xE4, 0x33, 0xFC, 0x90, 0x93, 0x58, 0xE0, +0x7A, 0x00, 0x2D, 0xFE, 0xEA, 0x3C, 0x90, 0x93, 0x5C, 0xF0, 0xA3, 0xCE, 0xF0, 0x74, 0x28, 0x29, +0x12, 0x57, 0xFD, 0x90, 0x93, 0x42, 0xE0, 0xFD, 0x12, 0x91, 0x03, 0xF1, 0x89, 0x90, 0x93, 0x5C, +0xE0, 0xFF, 0xA3, 0xE0, 0x90, 0x93, 0x5A, 0xCF, 0xF0, 0xA3, 0xEF, 0xF0, 0x90, 0x93, 0x60, 0x74, +0x01, 0xF0, 0xA3, 0x74, 0x03, 0xF0, 0xE4, 0xA3, 0xF0, 0xA3, 0x74, 0x5F, 0xF0, 0x90, 0x93, 0x5C, +0x12, 0x8A, 0xE7, 0x90, 0x8F, 0xDA, 0xE0, 0xFF, 0x7E, 0x02, 0xB4, 0xFE, 0x02, 0x7E, 0xFE, 0x90, +0x93, 0x5C, 0xA3, 0xE0, 0xFD, 0xB1, 0x8F, 0xEE, 0xF0, 0x74, 0x00, 0x2D, 0xB1, 0x91, 0xE0, 0x90, +0x93, 0x64, 0xF0, 0x90, 0x93, 0x5C, 0x51, 0xA6, 0x90, 0x90, 0x6F, 0xE0, 0x90, 0x93, 0x40, 0xB4, +0x01, 0x0B, 0xE0, 0x44, 0x03, 0xFC, 0xA3, 0xE0, 0x44, 0x10, 0xFD, 0x80, 0x09, 0xE0, 0x44, 0x03, +0xFC, 0xA3, 0xE0, 0x44, 0x20, 0xFD, 0x90, 0x93, 0x5E, 0xEC, 0xF0, 0xA3, 0xED, 0xF0, 0x90, 0x93, +0x65, 0x74, 0x03, 0xF0, 0xA3, 0x74, 0x12, 0xF0, 0xF1, 0xD0, 0xEF, 0x64, 0xFE, 0x70, 0x24, 0x90, +0x93, 0x5C, 0xA3, 0xE0, 0x24, 0x00, 0xF1, 0xE7, 0xC0, 0x03, 0x8B, 0x40, 0xF1, 0xDA, 0xD0, 0x03, +0x12, 0x34, 0x62, 0x75, 0x40, 0x01, 0xF1, 0xDA, 0x7B, 0x01, 0x7A, 0x93, 0x79, 0x67, 0x12, 0x34, +0x62, 0x80, 0x56, 0x90, 0x93, 0x12, 0xE0, 0xFF, 0xB4, 0x02, 0x26, 0x90, 0x93, 0x5C, 0xE0, 0xFC, +0xA3, 0xE0, 0xFD, 0x24, 0x00, 0xF5, 0x82, 0x74, 0xFC, 0x3C, 0xF5, 0x83, 0xE4, 0xF0, 0x74, 0x01, +0x2D, 0xF5, 0x82, 0x74, 0xFC, 0x3C, 0xF5, 0x83, 0x74, 0x20, 0xF1, 0xA5, 0x74, 0x20, 0xF0, 0x80, +0x28, 0xEF, 0xB4, 0x04, 0x24, 0x90, 0x93, 0x5C, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x24, 0x00, 0xF5, +0x82, 0x74, 0xFC, 0x3E, 0xF5, 0x83, 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0xD0, 0x06, +0x7B, 0x63, 0xE4, 0xFD, 0xFC, 0x12, 0x38, 0xC6, 0x7B, 0x01, 0x7A, 0x93, 0x79, 0x60, 0x90, 0xAC, +0xA0, 0x12, 0x49, 0x21, 0x7A, 0x93, 0x79, 0x43, 0x90, 0xAC, 0xA3, 0x12, 0x49, 0x21, 0x90, 0xAC, +0xA6, 0x74, 0x10, 0xF0, 0x7A, 0x8F, 0x79, 0x96, 0x12, 0x34, 0xC2, 0x90, 0x93, 0xE3, 0xE0, 0x04, +0xF0, 0x90, 0x06, 0x31, 0xE0, 0x30, 0xE2, 0x06, 0xF1, 0x9D, 0x50, 0x02, 0x81, 0x60, 0xF1, 0x9D, +0x40, 0x0A, 0x90, 0x06, 0x35, 0xE0, 0x44, 0x20, 0x90, 0x06, 0x34, 0xF0, 0xE4, 0x90, 0x93, 0x59, +0xF0, 0xF1, 0xBE, 0x50, 0x1C, 0x12, 0x9F, 0x53, 0x90, 0x93, 0x59, 0xE0, 0x24, 0x43, 0xF5, 0x82, +0xE4, 0x34, 0x93, 0xF5, 0x83, 0xE0, 0xFF, 0x90, 0x93, 0x57, 0xB1, 0x8E, 0xEF, 0xF1, 0x78, 0x80, +0xE0, 0x90, 0x04, 0x1D, 0xE0, 0x60, 0x23, 0x90, 0x05, 0x22, 0xE0, 0x90, 0x93, 0xE2, 0xF0, 0x7D, +0x1D, 0x12, 0x57, 0x73, 0xBF, 0x01, 0x07, 0x12, 0x82, 0x14, 0x12, 0xA9, 0xA7, 0xF0, 0x90, 0x93, +0xE2, 0xE0, 0xFF, 0x7D, 0x1E, 0x12, 0x54, 0x6C, 0x80, 0x07, 0x12, 0x82, 0x14, 0x12, 0xA9, 0xA7, +0xF0, 0x12, 0x55, 0xDF, 0x90, 0x8E, 0x18, 0xE0, 0x70, 0x05, 0x7F, 0x01, 0x12, 0x53, 0xA6, 0x74, +0xAD, 0x04, 0x90, 0x01, 0xC4, 0xF0, 0x74, 0x5A, 0xA3, 0xF0, 0xD0,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0x94, 0xBF, 0xA3, 0xE0, 0xFF, 0x22, +0xFD, 0xE4, 0x33, 0x90, 0x94, 0xC9, 0xF0, 0xA3, 0x22, 0xE4, 0x90, 0x93, 0xE7, 0xF0, 0xA3, 0xF0, +0x90, 0x06, 0x32, 0xE0, 0x44, 0x20, 0xF0, 0x12, 0x9F, 0x14, 0xEF, 0x64, 0x01, 0x70, 0x68, 0x90, +0x93, 0x1F, 0xE0, 0xFF, 0x7B, 0x08, 0x7D, 0x01, 0x12, 0x82, 0x1D, 0x12, 0x9D, 0xEF, 0x90, 0x93, +0xE4, 0x12, 0xA8, 0xD4, 0x12, 0x84, 0x71, 0x90, 0x93, 0xE6, 0xEF, 0xF0, 0x90, 0x93, 0xE4, 0x12, +0x57, 0xF9, 0xE4, 0xFD, 0x12, 0x91, 0x03, 0x90, 0x93, 0xE6, 0xE0, 0xFF, 0x90, 0x93, 0xE5, 0xE0, +0x2F, 0xFF, 0x90, 0x93, 0xE4, 0xE0, 0x34, 0x00, 0xCF, 0x24, 0x30, 0xCF, 0x34, 0x00, 0xFE, 0x90, +0x93, 0xE7, 0xF0, 0xA3, 0xEF, 0xF0, 0x12, 0xA7, 0xAE, 0xF1, 0x80, 0x90, 0x93, 0x1F, 0xE0, 0xFB, +0xE4, 0xFF, 0xB1, 0x99, 0xF1, 0x80, 0x90, 0x93, 0x1B, 0xE0, 0xFB, 0x7F, 0x11, 0xB1, 0x99, 0x12, +0x55, 0xDF, 0x90, 0x90, 0x82, 0x51, 0xA6, 0x22, 0xF0, 0x90, 0x93, 0x59, 0xE0, 0x04, 0xF0, 0x22, +0x90, 0x93, 0xE7, 0xE0, 0xFC, 0xA3, 0xE0, 0xFD, 0x22, 0x90, 0x93, 0x5C, 0xE4, 0x75, 0xF0, 0x08, +0x12, 0x08, 0xD6, 0x90, 0x93, 0x5C, 0xE4, 0x75, 0xF0, 0x08, 0x02, 0x08, 0xD6, 0x90, 0x93, 0xE3, +0xE0, 0xC3, 0x94, 0x0A, 0x22, 0xF0, 0xE4, 0x90, 0x93, 0x67, 0xF0, 0xA3, 0x22, 0xF9, 0xEE, 0x34, +0xFC, 0xFA, 0x7B, 0x01, 0x22, 0x12, 0x24, 0xE6, 0x90, 0x94, 0xC5, 0x02, 0x08, 0x6D, 0x90, 0x93, +0x59, 0xE0, 0xFF, 0xC3, 0x94, 0x10, 0x22, 0x90, 0x94, 0xC3, 0xE0, 0xFC, 0xA3, 0xE0, 0xFD, 0x22, +0x90, 0x93, 0x5C, 0xE4, 0x75, 0xF0, 0x02, 0x02, 0x08, 0xD6, 0x75, 0x41, 0x8F, 0x75, 0x42, 0xDD, +0x75, 0x43, 0x02, 0x22, 0x74, 0x00, 0x2F, 0xF9, 0xE4, 0x34, 0xFC, 0xFA, 0x7B, 0x01, 0x22, 0x78, +0x10, 0x12, 0x08, 0x47, 0x90, 0x94, 0xC5, 0x02, 0x49, 0x00, 0x74, 0x01, 0x2D, 0xF5, 0x82, 0xE4, +0x34, 0xFB, 0xF5, 0x83, 0xE0, 0xFE, 0x74, 0x00, 0x2D, 0xF5, 0x82, 0xE4, 0x34, 0xFB, 0xF5, 0x83, +0xE0, 0x7A, 0x00, 0x24, 0x00, 0xFF, 0xEA, 0x3E, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, +0xA9, 0x07, 0x90, 0x06, 0x69, 0xE0, 0xFE, 0x90, 0x06, 0x68, 0x11, 0x10, 0xFE, 0xE9, 0x14, 0x60, +0x0F, 0x14, 0x60, 0x1E, 0x24, 0x02, 0x70, 0x25, 0xEE, 0x54, 0xFE, 0xFE, 0x11, 0x62, 0x80, 0x1A, +0xEF, 0x44, 0x80, 0xFF, 0xEE, 0x54, 0xFE, 0xFC, 0x90, 0x06, 0x68, 0xEF, 0xF0, 0xEC, 0xA3, 0xF0, +0x80, 0x0B, 0xEE, 0x44, 0x01, 0xFC, 0x11, 0x62, 0xAE, 0x04, 0xEE, 0xA3, 0xF0, 0xD0, 0xD0, 0x92, +0xAF, 0x22, 0xEF, 0x54, 0x7F, 0x90, 0x06, 0x68, 0xF0, 0x22, 0x90, 0x95, 0x22, 0xF1, 0xF7, 0xEB, +0xF0, 0xE4, 0xFE, 0x7D, 0x18, 0xFF, 0x12, 0x3D, 0x2C, 0x90, 0x95, 0x25, 0xEF, 0xF0, 0x90, 0x95, +0x22, 0xE0, 0xFF, 0x11, 0x19, 0x90, 0x95, 0x22, 0x12, 0x98, 0xD0, 0x12, 0x9F, 0xF7, 0xAE, 0x07, +0x90, 0x04, 0x83, 0xEE, 0xF0, 0x90, 0x95, 0x22, 0xE0, 0xFF, 0xAD, 0x06, 0x91, 0x09, 0x90, 0x95, +0x22, 0xE0, 0xFF, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xEF, 0x14, 0x60, 0x30, 0x14, 0x60, +0x56, 0x24, 0x02, 0x70, 0x7B, 0x90, 0x94, 0x7D, 0x12, 0x08, 0x79, 0x00, 0x00, 0x0C, 0x00, 0x90, +0x94, 0x81, 0x12, 0x08, 0x79, 0x00, 0x00, 0x0C, 0x00, 0x71, 0xFD, 0x12, 0x08, 0x79, 0x00, 0x00, +0x0C, 0x00, 0x90, 0x94, 0x81, 0x12, 0x08, 0x79, 0x00, 0x00, 0x0C, 0x00, 0x80, 0x50, 0x90, 0x94, +0x7D, 0x12, 0x08, 0x79, 0x00, 0x00, 0x0C, 0x00, 0x90, 0x94, 0x81, 0x12, 0x08, 0x79, 0x00, 0x00, +0x04, 0x00, 0x71, 0xFD, 0x12, 0x08, 0x79, 0x00, 0x00, 0x0C, 0x00, 0x90, 0x94, 0x81, 0x12, 0x08, +0x79, 0x00, 0x00, 0x04, 0x00, 0x80, 0x27, 0x90, 0x94, 0x7D, 0x12, 0x08, 0x79, 0x00, 0x00, 0x0C, +0x00, 0x90, 0x94, 0x81, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0x71, 0xFD, 0x12, 0x08, 0x79, +0x00, 0x00, 0x0C, 0x00, 0x90, 0x94, 0x81, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0x31, 0x35, +0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x7D, 0x18, 0x7C, 0x00, 0x7F, 0x01, 0xD3, 0x10, 0xAF, 0x01, 0xC3, +0xC0, 0xD0, 0x90, 0x94, 0x7B, 0xEC, 0xF0, 0xA3, 0xED, 0xF0, 0x90, 0x94, 0x7A, 0xEF, 0xF0, 0xA3, +0xA3, 0xE0, 0xFD, 0x12, 0x87, 0xE4, 0x90, 0x94, 0x85, 0x12, 0x08, 0x6D, 0x90, 0x94, 0x7D, 0x12, +0x48, 0xF4, 0x12, 0x08, 0x3A, 0x90, 0x94, 0x85, 0xF1, 0xB2, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, +0xC0, 0x07, 0x90, 0x94, 0x7D, 0x12, 0x48, 0xF4, 0x90, 0x94, 0x81, 0xF1, 0xB2, 0xD0, 0x03, 0xD0, +0x02, 0xD0, 0x01, 0xD0, 0x00, 0x12, 0x48, 0xD6, 0x90, 0x94, 0x89, 0x12, 0x08, 0x6D, 0x90, 0x94, +0x7B, 0xA3, 0xE0, 0xFD, 0xC0, 0x05, 0x90, 0x94, 0x89, 0x12, 0x48, 0xF4, 0x90, 0xAA, 0x96, 0x12, +0x08, 0x6D, 0x90, 0x94, 0x7A, 0xE0, 0xFF, 0xD0, 0x05, 0x12, 0x3C, 0x33, 0xD0, 0xD0, 0x92, 0xAF, +0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x95, 0x1F, 0xED, 0xF0, 0xA3, 0xEB, 0xF0, +0x90, 0x95, 0x1E, 0xEF, 0xF0, 0x90, 0x95, 0x21, 0xE0, 0xFD, 0x12, 0x9F, 0x9F, 0x90, 0x95, 0x1E, +0xE0, 0xC3, 0x94, 0x0E, 0x50, 0x3F, 0x90, 0x94, 0x8F, 0x12, 0x08, 0x79, 0x1F, 0xFE, 0x00, 0x00, +0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x12, 0xD4, 0x00, 0x00, 0xF1, 0xBE, 0x90, 0x94, 0x7D, 0x12, +0x08, 0x79, 0x00, 0x07, 0x03, 0x00, 0x90, 0x94, 0x81, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, +0x71, 0xFD, 0x12, 0x08, 0x79, 0x00, 0x07, 0x03, 0x00, 0x90, 0x94, 0x81, 0x12, 0x08, 0x79, 0x00, +0x00, 0x00, 0x00, 0x61, 0x34, 0x12, 0xAA, 0x01, 0x50, 0x1B, 0xEF, 0x94, 0x30, 0x50, 0x16, 0x90, +0x94, 0x8F, 0x12, 0x08, 0x79, 0x1F, 0xFE, 0x00, 0x00, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x09, +0x28, 0x00, 0x00, 0x80, 0x65, 0x90, 0x95, 0x1E, 0xE0, 0xFF, 0x74, 0x32, 0xD3, 0x9F, 0x50, 0x1B, +0xEF, 0x94, 0x40, 0x50, 0x16, 0x90, 0x94, 0x8F, 0x12, 0x08, 0x79, 0x1F, 0xFE, 0x00, 0x00, 0x90, +0x94, 0x93, 0x12, 0x08, 0x79, 0x08, 0xA6, 0x00, 0x00, 0x80, 0x3F, 0x12, 0xA9, 0xF7, 0x50, 0x1B, +0xEF, 0x94, 0x74, 0x50, 0x16, 0x90, 0x94, 0x8F, 0x12, 0x08, 0x79, 0x1F, 0xFE, 0x00, 0x00, 0x90, +0x94, 0x93, 0x12, 0x08, 0x79, 0x08, 0xA4, 0x00, 0x00, 0x80, 0x1F, 0x90, 0x95, 0x1E, 0xE0, 0xFF, +0x74, 0x76, 0xD3, 0x9F, 0x50, 0x16, 0x90, 0x94, 0x8F, 0x12, 0x08, 0x79, 0x1F, 0xFE, 0x00, 0x00, +0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x08, 0x24, 0x00, 0x00, 0xF1, 0xBE, 0x12, 0xAA, 0x01, 0x50, +0x2E, 0xEF, 0x94, 0x40, 0x50, 0x29, 0x90, 0x94, 0x7D, 0x12, 0x08, 0x79, 0x00, 0x07, 0x03, 0x00, +0x90, 0x94, 0x81, 0x12, 0x08, 0x79, 0x00, 0x01, 0x01, 0x00, 0x71, 0xFD, 0x12, 0x08, 0x79, 0x00, +0x07, 0x03, 0x00, 0x90, 0x94, 0x81, 0x12, 0x08, 0x79, 0x00, 0x01, 0x01, 0x00, 0x80, 0x65, 0x12, +0xA9, 0xF7, 0x50, 0x2E, 0xEF, 0x94, 0x8C, 0x50, 0x29, 0x90, 0x94, 0x7D, 0x12, 0x08, 0x79, 0x00, +0x07, 0x03, 0x00, 0x90, 0x94, 0x81, 0x12, 0x08, 0x79, 0x00, 0x03, 0x01, 0x00, 0x71, 0xFD, 0x12, +0x08, 0x79, 0x00, 0x07, 0x03, 0x00, 0x90, 0x94, 0x81, 0x12, 0x08, 0x79, 0x00, 0x03, 0x01, 0x00, +0x80, 0x32, 0x90, 0x95, 0x1E, 0xE0, 0xFF, 0x74, 0x8C, 0xC3, 0x9F, 0x50, 0x29, 0x90, 0x94, 0x7D, +0x12, 0x08, 0x79, 0x00, 0x07, 0x03, 0x00, 0x90, 0x94, 0x81, 0x12, 0x08, 0x79, 0x00, 0x05, 0x01, +0x00, 0x71, 0xFD, 0x12, 0x08, 0x79, 0x00, 0x07, 0x03, 0x00, 0x90, 0x94, 0x81, 0x12, 0x08, 0x79, +0x00, 0x05, 0x01, 0x00, 0x31, 0x35, 0x90, 0x95, 0x1F, 0xE0, 0x64, 0x02, 0x70, 0x51, 0x90, 0x95, +0x1E, 0xE0, 0xFF, 0xD3, 0x94, 0x30, 0x50, 0x05, 0x75, 0x5A, 0x2A, 0x80, 0x5E, 0xEF, 0xD3, 0x94, +0x40, 0x50, 0x05, 0x75, 0x5A, 0x3A, 0x80, 0x53, 0xEF, 0xD3, 0x94, 0x70, 0x50, 0x05, 0x75, 0x5A, +0x6A, 0x80, 0x48, 0xEF, 0xD3, 0x94, 0x80, 0x50, 0x05, 0x75, 0x5A, 0x7A, 0x80, 0x3D, 0xEF, 0xD3, +0x94, 0x90, 0x50, 0x05, 0x75, 0x5A, 0x8A, 0x80, 0x32, 0xEF, 0xD3, 0x94, 0xA1, 0x50, 0x05, 0x75, +0x5A, 0x9B, 0x80, 0x27, 0xEF, 0xD3, 0x94, 0xB1, 0x50, 0x21, 0x75, 0x5A, 0xAB, 0x80, 0x1C, 0x90, +0x95, 0x1F, 0xE0, 0x64, 0x01, 0x70, 0x31, 0xA3, 0xE0, 0x90, 0x95, 0x1E, 0xB4, 0x01, 0x07, 0xE0, +0x24, 0x02, 0xF5, 0x5A, 0x80, 0x05, 0xE0, 0x24, 0xFE, 0xF5, 0x5A, 0x90, 0x94, 0x7D, 0x12, 0x08, +0x79, 0x00, 0x00, 0x00, 0xFF, 0xAF, 0x5A, 0xE4, 0xFC, 0xFD, 0xFE, 0x71, 0xF7, 0x12, 0x08, 0x79, +0x00, 0x00, 0x00, 0xFF, 0xAF, 0x5A, 0x80, 0x1E, 0x90, 0x94, 0x7D, 0x12, 0x08, 0x79, 0x00, 0x00, +0x00, 0xFF, 0x90, 0x95, 0x1E, 0x12, 0x80, 0x77, 0x71, 0xF7, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, +0xFF, 0x90, 0x95, 0x1E, 0xE0, 0xFF, 0xE4, 0xFC, 0xFD, 0xFE, 0x90, 0x94, 0x81, 0x12, 0x08, 0x6D, +0x31, 0x35, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0x94, 0x81, 0x12, 0x08, 0x6D, 0x7D, 0x18, 0x7C, +0x00, 0xE4, 0xFF, 0x31, 0x3B, 0x90, 0x94, 0x7D, 0x22, 0x90, 0x94, 0xEF, 0xF1, 0xF7, 0x12, 0x08, +0x79, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x34, 0x7E, 0x08, 0x12, 0x37, 0xBC, 0x90, 0x94, 0xF1, 0x12, +0x08, 0x6D, 0x90, 0x94, 0xEF, 0xE0, 0x14, 0x60, 0x5E, 0x14, 0x70, 0x02, 0xA1, 0x46, 0x24, 0x02, +0x60, 0x02, 0xA1, 0xD5, 0x90, 0x94, 0x8F, 0x12, 0x08, 0x79, 0x00, 0x30, 0x03, 0xC3, 0x90, 0x94, +0x93, 0x12, 0x08, 0x79, 0x00, 0x30, 0x02, 0x00, 0xD1, 0x4E, 0x12, 0x08, 0x79, 0x40, 0x00, 0x00, +0x00, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xC4, 0xD1, 0x50, 0x12, +0x08, 0x79, 0x00, 0x1C, 0x00, 0x00, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x00, 0x10, 0x00, 0x00, +0x7F, 0x64, 0xD1, 0x50, 0x12, 0x08, 0x79, 0x03, 0xC0, 0x00, 0x00, 0x90, 0x94, 0x93, 0x12, 0x08, +0x79, 0x02, 0x00, 0x00, 0x00, 0xA1, 0xB8, 0x90, 0x94, 0x8F, 0x12, 0x08, 0x79, 0x00, 0x30, 0x03, +0xC3, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x00, 0x30, 0x02, 0x01, 0xD1, 0x4E, 0x12, 0x08, 0x79, +0x40, 0x00, 0x00, 0x00, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xC4, +0xD1, 0x50, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x3C, 0xD1, 0x3A, 0x12, 0x08, 0x79, 0xF0, 0x00, +0x00, 0x00, 0x90, 0x94, 0xF0, 0x12, 0x80, 0x77, 0x78, 0x1C, 0x12, 0x08, 0x5A, 0xF1, 0xF1, 0x7F, +0x38, 0xD1, 0x50, 0x12, 0x08, 0x79, 0x00, 0x1C, 0x00, 0x00, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, +0x00, 0x08, 0x00, 0x00, 0xF1, 0xD9, 0x60, 0x13, 0x12, 0x08, 0x79, 0x03, 0xC0, 0x00, 0x00, 0x90, +0x94, 0x93, 0x12, 0x08, 0x79, 0x01, 0x80, 0x00, 0x00, 0x80, 0x11, 0x12, 0x08, 0x79, 0x03, 0xC0, +0x00, 0x00, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x02, 0x00, 0x00, 0x00, 0x7F, 0x48, 0x7E, 0x08, +0xB1, 0xDA, 0x90, 0x94, 0xF0, 0xE0, 0x90, 0x94, 0x8F, 0xB4, 0x01, 0x13, 0x12, 0x08, 0x79, 0x00, +0x00, 0x00, 0x10, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x10, 0x80, 0x11, 0x12, +0x08, 0x79, 0x00, 0x00, 0x00, 0x10, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, +0x7F, 0x00, 0x7E, 0x0A, 0xA1, 0xD3, 0x90, 0x94, 0x8F, 0x12, 0x08, 0x79, 0x00, 0x30, 0x03, 0xC3, +0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x00, 0x30, 0x02, 0x02, 0xD1, 0x4E, 0x12, 0x08, 0x79, 0x40, +0x00, 0x00, 0x00, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x40, 0x00, 0x00, 0x00, 0x7F, 0xC4, 0xD1, +0x50, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x3C, 0xD1, 0x3A, 0x12, 0x08, 0x79, 0xF0, 0x00, 0x00, +0x00, 0x90, 0x94, 0xF0, 0x12, 0x80, 0x77, 0x78, 0x1C, 0x12, 0x08, 0x5A, 0xF1, 0xF1, 0x7F, 0x38, +0xD1, 0x50, 0x12, 0x08, 0x79, 0x00, 0x1C, 0x00, 0x00, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x00, +0x08, 0x00, 0x00, 0xF1, 0xD9, 0x60, 0x17, 0x12, 0x08, 0x79, 0x03, 0xC0, 0x00, 0x00, 0x90, 0x94, +0x93, 0x12, 0x08, 0x79, 0x01, 0x40, 0x00, 0x00, 0x7F, 0x48, 0x7E, 0x08, 0x80, 0x15, 0x12, 0x08, +0x79, 0x03, 0xC0, 0x00, 0x00, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x01, 0xC0, 0x00, 0x00, 0x7F, +0x48, 0x7E, 0x08, 0xB1, 0xDA, 0x22, 0x7F, 0xB0, 0x7E, 0x0C, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, +0xD0, 0x90, 0x94, 0x8D, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0x12, 0x37, 0xBC, 0x90, 0x94, 0x97, 0x12, +0x08, 0x6D, 0x90, 0x94, 0x8F, 0x12, 0x48, 0xF4, 0x12, 0x08, 0x3A, 0x90, 0x94, 0x97, 0xF1, 0xB2, +0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0x94, 0x8F, 0x12, 0x48, 0xF4, 0x90, 0x94, +0x93, 0xF1, 0xB2, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0x12, 0x48, 0xD6, 0x90, 0x94, +0x9B, 0x12, 0x08, 0x6D, 0x90, 0x94, 0x9B, 0x12, 0x4E, 0xD2, 0x90, 0x94, 0x8D, 0xE0, 0xFE, 0xA3, +0xE0, 0xFF, 0x12, 0x38, 0x07, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0x94, 0xF0, 0xE0, 0xFF, 0xE4, +0xFC, 0xFD, 0xFE, 0x78, 0x02, 0x12, 0x08, 0x5A, 0x90, 0x94, 0x93, 0x12, 0x08, 0x6D, 0x7F, 0xAC, +0x7E, 0x08, 0xB1, 0xDA, 0x90, 0x94, 0x8F, 0x22, 0x90, 0x95, 0x34, 0xED, 0xF0, 0x90, 0x95, 0x33, +0xEF, 0xF0, 0x60, 0x02, 0xE1, 0x07, 0x90, 0x94, 0x8F, 0x12, 0x08, 0x79, 0x30, 0x00, 0x00, 0x00, +0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0x74, 0x08, 0xFF, 0xFE, 0xD1, 0x52, +0x12, 0x08, 0x79, 0x00, 0x00, 0xF0, 0x00, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x00, 0x00, 0x70, +0x00, 0x7F, 0xB0, 0x7E, 0x0C, 0xD1, 0x52, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0xF0, 0x90, 0x94, +0x93, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x70, 0x7F, 0xB0, 0x7E, 0x0C, 0xD1, 0x52, 0x12, 0x08, +0x79, 0x00, 0x00, 0x00, 0x0E, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x08, 0x7F, +0x30, 0xD1, 0x50, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x03, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, +0x00, 0x00, 0x00, 0x01, 0x7F, 0x34, 0xD1, 0x50, 0x12, 0x08, 0x79, 0x00, 0x00, 0x0F, 0x00, 0x90, +0x94, 0x93, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0xF1, 0xC4, 0x12, 0x08, 0x79, 0x30, 0x00, +0x00, 0x00, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x30, 0x00, 0x00, 0x00, 0xF1, 0xB8, 0x90, 0x04, +0x54, 0xE0, 0x54, 0x7F, 0x02, 0xA9, 0xED, 0x90, 0x95, 0x33, 0xE0, 0x64, 0x01, 0x60, 0x02, 0xE1, +0xB1, 0x90, 0x94, 0x8F, 0x12, 0x08, 0x79, 0x00, 0x00, 0xF0, 0x00, 0x90, 0x94, 0x93, 0x12, 0x08, +0x79, 0x00, 0x00, 0x50, 0x00, 0x7F, 0xB0, 0x7E, 0x0C, 0xD1, 0x52, 0x12, 0x08, 0x79, 0x00, 0x00, +0x00, 0xF0, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x40, 0xB1, 0xD6, 0x90, 0x04, +0x54, 0xE0, 0x44, 0x80, 0x12, 0xA9, 0xED, 0x90, 0x94, 0x8F, 0x12, 0x08, 0x79, 0x30, 0x00, 0x00, +0x00, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0x74, 0x08, 0xFF, 0xFE, 0xD1, +0x52, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x0E, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x00, 0x00, +0x00, 0x06, 0x7F, 0x30, 0xD1, 0x50, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x03, 0x90, 0x94, 0x93, +0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x02, 0x7F, 0x34, 0xD1, 0x50, 0x12, 0x08, 0x79, 0x00, 0x00, +0x0F, 0x00, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x00, 0x00, 0x01, 0x00, 0xF1, 0xC4, 0x12, 0x08, +0x79, 0x30, 0x00, 0x00, 0x00, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x20, 0x00, 0x00, 0x00, 0xF1, +0xB8, 0x22, 0x12, 0x49, 0x00, 0x02, 0x48, 0xC9, 0x74, 0x08, 0xFF, 0xFE, 0xA1, 0xDA, 0x7F, 0x60, +0x7E, 0x08, 0xA1, 0xDA, 0x7F, 0x1C, 0x7E, 0x0C, 0xB1, 0xDA, 0x90, 0x95, 0x33, 0xE0, 0xFF, 0xA3, +0xE0, 0xFD, 0x12, 0xA0, 0x5A, 0x90, 0x94, 0x8F, 0x22, 0x7F, 0x64, 0x7E, 0x08, 0xB1, 0xDA, 0x90, +0x94, 0xF1, 0x12, 0x48, 0xF4, 0xE4, 0xFF, 0xFE, 0xFD, 0xEC, 0x54, 0x04, 0xFC, 0x90, 0x94, 0x8F, +0x22, 0x90, 0x94, 0x93, 0x02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 0x60, 0x90, +0xFD, 0x11, 0xF0, 0x90, 0x94, 0x77, 0xEF, 0xF0, 0x12, 0x5F, 0xFA, 0x54, 0x3F, 0xFE, 0x90, 0x94, +0x68, 0xF0, 0xA3, 0xEF, 0xF0, 0x90, 0x94, 0x73, 0xEE, 0x12, 0xA8, 0xFB, 0xE0, 0x54, 0x03, 0xFE, +0xEF, 0x24, 0x18, 0x2E, 0xFF, 0x90, 0x94, 0x78, 0xF0, 0x90, 0x94, 0x67, 0xE0, 0x2F, 0xFF, 0x90, +0x94, 0x66, 0xE0, 0x34, 0x00, 0xFE, 0x90, 0x94, 0x6A, 0xF1, 0xE8, 0xC0, 0x07, 0x71, 0x54, 0x7D, +0x01, 0x71, 0x7F, 0xC0, 0x07, 0x71, 0x54, 0x7D, 0x04, 0x71, 0x7F, 0xAB, 0x07, 0xD0, 0x05, 0xD0, +0x07, 0x12, 0x84, 0x71, 0x90, 0x94, 0x6F, 0xEF, 0x71, 0x53, 0xE4, 0xFD, 0x71, 0x7F, 0xEF, 0x54, +0xFC, 0x90, 0x94, 0x6C, 0xF0, 0x90, 0x94, 0x78, 0xE0, 0xFF, 0x90, 0x94, 0x68, 0xE4, 0x8F, 0xF0, +0x12, 0x08, 0xD6, 0x90, 0x94, 0x68, 0x12, 0x8F, 0x49, 0x90, 0x94, 0x68, 0xEE, 0xF0, 0xA3, 0xEF, +0xF0, 0x90, 0x94, 0x66, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x7D, 0x0F, 0x71, 0x7F, 0x90, 0x94, 0x68, +0xE0, 0xFC, 0xA3, 0xE0, 0xFD, 0x90, 0x94, 0x66, 0xEC, 0x8D, 0xF0, 0x12, 0x8F, 0x86, 0xFC, 0xA3, +0xE0, 0xFD, 0xD3, 0x90, 0x94, 0x67, 0xE0, 0x9D, 0x90, 0x94, 0x66, 0xE0, 0x9C, 0x40, 0x18, 0x90, +0x8D, 0xF9, 0xE0, 0x24, 0x01, 0xFD, 0x12, 0x8F, 0xC3, 0xFC, 0xC3, 0x90, 0x94, 0x67, 0xE0, 0x9D, +0xF0, 0x90, 0x94, 0x66, 0xE0, 0x9C, 0xF0, 0xEF, 0x30, 0xE6, 0x06, 0x90, 0x01, 0xC7, 0x74, 0x22, +0xF0, 0xEF, 0x30, 0xE7, 0x06, 0x90, 0x01, 0xC7, 0x74, 0x21, 0xF0, 0xEF, 0x30, 0xE5, 0x06, 0x90, +0x01, 0xC7, 0x74, 0x23, 0xF0, 0x90, 0x94, 0x65, 0xE0, 0x60, 0x3B, 0x90, 0x94, 0x6C, 0xE0, 0x24, +0xB0, 0x60, 0x16, 0x24, 0xD0, 0x60, 0x02, 0x41, 0xDF, 0x12, 0xAA, 0x58, 0x20, 0xE0, 0x18, 0x12, +0x96, 0x1C, 0x20, 0xE0, 0x02, 0x41, 0xDF, 0x80, 0x0E, 0x12, 0xAA, 0x58, 0x20, 0xE0, 0x08, 0x12, +0x96, 0x1C, 0x20, 0xE0, 0x02, 0x41, 0xDF, 0x71, 0x54, 0x90, 0x94, 0x73, 0xE0, 0xFC, 0xA3, 0xE0, +0xFD, 0x12, 0x8A, 0xFD, 0x41, 0xDF, 0x90, 0x94, 0x6C, 0xE0, 0x24, 0x40, 0x60, 0x04, 0x24, 0x20, +0x70, 0x2B, 0x90, 0x8E, 0xC3, 0xE0, 0xFF, 0xF1, 0xF0, 0x20, 0xE0, 0x02, 0x41, 0xDF, 0x90, 0x8E, +0xD6, 0xE0, 0x04, 0x71, 0x53, 0x12, 0xA3, 0x8E, 0xEF, 0x70, 0x02, 0x41, 0xDF, 0x90, 0x94, 0x6C, +0xE0, 0xFF, 0x12, 0xA3, 0x7C, 0x90, 0x8E, 0xD7, 0xE0, 0x04, 0xF0, 0x41, 0xDF, 0x12, 0x8F, 0xAA, +0x30, 0xE0, 0x5F, 0x90, 0x94, 0x6F, 0xE0, 0xFF, 0x90, 0x94, 0x6B, 0xE0, 0x2F, 0xFF, 0x90, 0x94, +0x6A, 0xE0, 0x34, 0x00, 0xCF, 0x24, 0x08, 0xCF, 0x34, 0x00, 0xFE, 0x90, 0x94, 0x75, 0xF1, 0xE8, +0xEF, 0x64, 0x45, 0x70, 0x3D, 0x12, 0xA9, 0x90, 0x12, 0x84, 0x92, 0xEF, 0x64, 0x01, 0x70, 0x32, +0x12, 0xA9, 0x90, 0xF1, 0xB0, 0xEF, 0x64, 0x01, 0x70, 0x28, 0x90, 0x94, 0x79, 0x04, 0xF0, 0x90, +0x94, 0x75, 0xF1, 0x85, 0xFD, 0x12, 0x8C, 0xC3, 0xEF, 0x70, 0x0F, 0x90, 0x94, 0x77, 0xE0, 0xFD, +0x90, 0xFD, 0x11, 0xF0, 0x12, 0xA9, 0x90, 0x12, 0x8C, 0x74, 0x90, 0x94, 0x77, 0xE0, 0x90, 0xFD, +0x11, 0xF0, 0x71, 0x54, 0x12, 0xA3, 0x8E, 0xEF, 0x60, 0x1F, 0x71, 0x54, 0x90, 0x94, 0x6F, 0xE0, +0xFD, 0x90, 0x94, 0x72, 0xE0, 0xFB, 0x90, 0x94, 0x77, 0xE0, 0x90, 0x94, 0xFF, 0xF0, 0x71, 0xB2, +0xEF, 0x60, 0x06, 0x90, 0x94, 0x79, 0x74, 0x01, 0xF0, 0x90, 0x8E, 0xC0, 0xE0, 0xC3, 0x13, 0x30, +0xE0, 0x12, 0x71, 0x54, 0x90, 0x94, 0x6F, 0xE0, 0xFD, 0x91, 0x28, 0xEF, 0x60, 0x06, 0x90, 0x94, +0x79, 0x74, 0x01, 0xF0, 0x12, 0x7C, 0x8B, 0x54, 0x3F, 0x30, 0xE0, 0x0A, 0x71, 0x54, 0x90, 0x94, +0x6F, 0xE0, 0xFD, 0x12, 0xA4, 0x50, 0x90, 0x8E, 0xC0, 0xE0, 0xFF, 0xF1, 0xF0, 0x30, 0xE0, 0x0F, +0x90, 0x94, 0x79, 0xE0, 0x70, 0x09, 0x71, 0x54, 0x90, 0x94, 0x6F, 0xE0, 0xFD, 0xD1, 0xDF, 0x12, +0xA6, 0x8C, 0xEF, 0x64, 0x01, 0x60, 0x07, 0x90, 0x01, 0x3F, 0xE0, 0x30, 0xE2, 0x05, 0x7F, 0x01, +0x12, 0x8B, 0x36, 0x12, 0xA3, 0x56, 0xEF, 0x64, 0x01, 0x70, 0x37, 0x90, 0x8E, 0xD8, 0xE0, 0x04, +0xF0, 0x12, 0xA3, 0x40, 0xAD, 0x07, 0xEF, 0x64, 0x01, 0x60, 0x1F, 0xF1, 0x95, 0xED, 0xB4, 0x02, +0x08, 0x90, 0x01, 0xC7, 0x74, 0x42, 0xF0, 0x80, 0x0A, 0xED, 0xB4, 0x04, 0x06, 0x90, 0x01, 0xC7, +0x74, 0x43, 0xF0, 0x7F, 0x01, 0x12, 0x8B, 0x36, 0x80, 0x19, 0x90, 0x94, 0x66, 0x12, 0xA2, 0xF8, +0x80, 0x09, 0x90, 0x8E, 0xC0, 0xE0, 0x54, 0xFE, 0xF0, 0x80, 0x08, 0x90, 0x94, 0x6D, 0xE0, 0x04, +0xF0, 0x01, 0x9A, 0x74, 0x53, 0x04, 0x90, 0x01, 0xC4, 0xF0, 0x74, 0x68, 0xA3, 0xF0, 0xD0, 0xD0, +0x92, 0xAF, 0x22, 0xF0, 0x90, 0x94, 0x6A, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x22, 0x90, 0x93, 0x3A, +0xE0, 0xFD, 0x90, 0x93, 0x39, 0xE0, 0x2D, 0xFD, 0x90, 0x93, 0x38, 0xE0, 0x34, 0x00, 0xCD, 0x24, +0x10, 0xCD, 0x34, 0x00, 0xFC, 0x7E, 0x00, 0xED, 0x2F, 0xFF, 0xEE, 0x3C, 0xFE, 0xE4, 0xFD, 0xAB, +0x07, 0xAA, 0x06, 0xED, 0x2B, 0xFB, 0xE4, 0x3A, 0xFA, 0xC3, 0x90, 0x8D, 0xF9, 0xE0, 0x9B, 0x90, +0x8D, 0xF8, 0xE0, 0x9A, 0x50, 0x0C, 0xA3, 0x12, 0x8F, 0xBF, 0xFE, 0xC3, 0xEB, 0x9F, 0xFB, 0xEA, +0x9E, 0xFA, 0x12, 0x8F, 0x7E, 0x74, 0x00, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0xFB, 0xF5, 0x83, 0xE0, +0xFF, 0x22, 0x90, 0x94, 0xFD, 0xED, 0xF0, 0xA3, 0xEB, 0xF0, 0x90, 0x94, 0xFB, 0x12, 0x8F, 0x70, +0x90, 0x95, 0x00, 0xF0, 0xFD, 0x71, 0x7F, 0xEF, 0x54, 0x0C, 0x64, 0x08, 0x70, 0x54, 0xF1, 0x82, +0xF1, 0x8D, 0x64, 0x88, 0x70, 0x4C, 0xF1, 0x82, 0x24, 0x07, 0xFD, 0x71, 0x7F, 0xEF, 0x64, 0x8E, +0x70, 0x40, 0x90, 0x95, 0x00, 0x04, 0xF0, 0x12, 0xA9, 0x49, 0x04, 0xFD, 0x71, 0x7F, 0xEF, 0x64, +0x03, 0x70, 0x2F, 0x12, 0xA9, 0x49, 0xF1, 0x8D, 0x30, 0xE3, 0x07, 0x90, 0x01, 0xC7, 0x74, 0x01, +0x80, 0x1E, 0x90, 0x8E, 0xC0, 0x12, 0x9E, 0x37, 0x30, 0xE0, 0x07, 0xF1, 0x82, 0xFD, 0xB1, 0x6B, +0x80, 0x10, 0x90, 0x8E, 0xC3, 0x12, 0x8F, 0xAD, 0x30, 0xE0, 0x07, 0x90, 0x01, 0xC7, 0x74, 0x02, +0xF1, 0x94, 0x90, 0x95, 0x00, 0xE0, 0xFF, 0x22, 0x12, 0x8C, 0xB7, 0x12, 0xA6, 0x44, 0x7A, 0x40, +0x79, 0x56, 0xF1, 0xF7, 0x78, 0x47, 0x7C, 0x93, 0x7D, 0x01, 0x7B, 0xFF, 0x7A, 0x40, 0x79, 0x5C, +0xF1, 0xE1, 0x78, 0x4B, 0x7C, 0x93, 0x7D, 0x01, 0x7B, 0xFF, 0x7A, 0x40, 0x79, 0x60, 0xF1, 0xE1, +0xE4, 0x90, 0x93, 0x50, 0xF0, 0xD1, 0x95, 0xCF, 0x24, 0x06, 0xCF, 0xB1, 0x64, 0xEF, 0x64, 0x08, +0x60, 0x02, 0xA1, 0x47, 0xD1, 0x95, 0xCF, 0x24, 0x07, 0xCF, 0xB1, 0x64, 0xEF, 0x64, 0x06, 0x60, +0x02, 0xA1, 0x47, 0x90, 0x93, 0x50, 0x04, 0xF0, 0xE4, 0x90, 0x93, 0x4F, 0xF0, 0xB1, 0x4D, 0x94, +0x06, 0x50, 0x17, 0x90, 0x93, 0x39, 0xE0, 0x24, 0x0A, 0xFD, 0x90, 0x93, 0x38, 0xE0, 0x71, 0x72, +0x90, 0x93, 0x4F, 0x12, 0xA6, 0x3B, 0xB1, 0x54, 0x80, 0xE3, 0x12, 0xA6, 0x2B, 0x7B, 0x01, 0x7A, +0x8E, 0x79, 0xD0, 0x12, 0xA3, 0xDF, 0x60, 0x02, 0xA1, 0x47, 0x90, 0x93, 0x4F, 0xF0, 0xB1, 0x4D, +0x94, 0x04, 0x50, 0x19, 0x12, 0xA6, 0x1F, 0xD1, 0xA0, 0xCD, 0x24, 0x20, 0x71, 0x71, 0x90, 0x93, +0x4F, 0xE0, 0x24, 0x4B, 0xF5, 0x82, 0xE4, 0x34, 0x93, 0xB1, 0x54, 0x80, 0xE1, 0x78, 0x4B, 0x7C, +0x93, 0x12, 0xA9, 0x72, 0xEF, 0x70, 0x67, 0x90, 0x06, 0x30, 0xE0, 0x44, 0x01, 0x54, 0xDF, 0xF0, +0x90, 0x8E, 0xC2, 0xE0, 0x30, 0xE0, 0x09, 0x90, 0x01, 0xC7, 0x74, 0x09, 0xF1, 0x94, 0x80, 0x57, +0xE4, 0x90, 0x93, 0x4F, 0xF0, 0xB1, 0x4D, 0x94, 0x06, 0x50, 0x0C, 0x71, 0x5D, 0x90, 0x93, 0x4F, +0x12, 0xA6, 0x32, 0xB1, 0x54, 0x80, 0xEE, 0xE4, 0x90, 0x93, 0x4F, 0xF0, 0xB1, 0x4D, 0x94, 0x04, +0x50, 0x19, 0x12, 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0x8F, 0xDD, 0xD1, 0x8E, +0x24, 0x08, 0xB1, 0x5F, 0x90, 0x8F, 0xDE, 0xEF, 0xF0, 0xE4, 0x90, 0x93, 0x3A, 0xF0, 0x90, 0x93, +0x3A, 0xE0, 0xFF, 0xC3, 0x94, 0x08, 0x50, 0x19, 0x90, 0x93, 0x3C, 0xE0, 0x24, 0x09, 0xFD, 0x90, +0x93, 0x3B, 0xE0, 0x71, 0x72, 0x90, 0x93, 0x3A, 0xE0, 0x12, 0xA9, 0x3F, 0x12, 0x83, 0x9B, 0x80, +0xDD, 0xE4, 0x90, 0x93, 0x3A, 0xF0, 0x90, 0x93, 0x3A, 0xE0, 0xFF, 0xC3, 0x94, 0x20, 0x50, 0x1F, +0x90, 0x93, 0x3C, 0xE0, 0x24, 0x63, 0xFD, 0x90, 0x93, 0x3B, 0xE0, 0x71, 0x72, 0x90, 0x93, 0x3A, +0xE0, 0x24, 0x39, 0xF5, 0x82, 0xE4, 0x34, 0x90, 0xF5, 0x83, 0x12, 0x83, 0x9B, 0x80, 0xD7, 0x90, +0x8F, 0xDB, 0x12, 0x95, 0x72, 0x12, 0x87, 0xD2, 0x30, 0xE3, 0x0D, 0x7F, 0x01, 0x12, 0x8B, 0x36, +0x90, 0x01, 0xC7, 0x74, 0x03, 0xF0, 0x80, 0x3F, 0x90, 0x93, 0x38, 0xA3, 0xE0, 0xFF, 0x7C, 0x00, +0x54, 0x07, 0xFD, 0x64, 0x01, 0x60, 0x05, 0xED, 0x64, 0x02, 0x70, 0x2B, 0xED, 0x64, 0x02, 0x4C, +0x70, 0x25, 0xEF, 0x54, 0x30, 0xFF, 0xE4, 0xC4, 0xF8, 0x54, 0xF0, 0xC8, 0xEF, 0xC4, 0x54, 0x0F, +0x48, 0x90, 0x90, 0x6F, 0xF0, 0xAE, 0x04, 0xAF, 0x05, 0xE4, 0xFD, 0x12, 0xA7, 0x94, 0x90, 0x06, +0x31, 0xE0, 0x54, 0xF7, 0x44, 0x10, 0xF0, 0x7F, 0x00, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xEF, 0xF0, +0x90, 0x93, 0x3C, 0xE0, 0x22, 0x90, 0x93, 0x3A, 0xE0, 0xFF, 0x90, 0x93, 0x39, 0xE0, 0x2F, 0xFF, +0x90, 0x93, 0x38, 0xE0, 0x34, 0x00, 0x22, 0x90, 0x93, 0x48, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0x7D, +0x09, 0x71, 0x7F, 0xEF, 0x64, 0x06, 0x70, 0x24, 0xF1, 0x9D, 0x7D, 0x14, 0x71, 0x7F, 0xEF, 0x70, +0x1B, 0xF1, 0x9D, 0x7D, 0x15, 0x71, 0x7F, 0xEF, 0x64, 0x50, 0x70, 0x10, 0xF1, 0x9D, 0x7D, 0x21, +0x71, 0x7F, 0xEF, 0x20, 0xE0, 0x03, 0x30, 0xE2, 0x03, 0x7F, 0x01, 0x22, 0x7F, 0x00, 0x22, 0x12, +0x8C, 0xB7, 0x12, 0xA6, 0x2B, 0x7B, 0xFF, 0x7A, 0x40, 0x79, 0x90, 0xF1, 0xF7, 0x78, 0x42, 0x7C, +0x93, 0x7D, 0x01, 0x7B, 0xFF, 0x7A, 0x40, 0x79, 0x96, 0xF1, 0xE1, 0x12, 0x8C, 0xAE, 0x12, 0xA3, +0x8E, 0xEF, 0x60, 0x7D, 0xD1, 0x95, 0xFE, 0x90, 0x93, 0x46, 0xF0, 0xA3, 0xEF, 0xF0, 0x24, 0x06, +0xFF, 0xE4, 0x3E, 0xB1, 0x66, 0xEF, 0x64, 0x08, 0x70, 0x67, 0x90, 0x93, 0x47, 0xE0, 0x24, 0x07, +0xFF, 0x90, 0x93, 0x46, 0xB1, 0x63, 0xEF, 0x70, 0x58, 0x90, 0x93, 0x41, 0xF0, 0x90, 0x93, 0x41, +0xE0, 0xFF, 0xC3, 0x94, 0x04, 0x50, 0x24, 0x90, 0x93, 0x47, 0xE0, 0x24, 0x18, 0xFD, 0x90, 0x93, +0x46, 0xE0, 0x71, 0x72, 0x90, 0x93, 0x41, 0xE0, 0x24, 0x42, 0xF5, 0x82, 0xE4, 0x34, 0x93, 0xF5, +0x83, 0xEF, 0xF0, 0x90, 0x93, 0x41, 0xE0, 0x04, 0xF0, 0x80, 0xD2, 0x78, 0x42, 0x7C, 0x93, 0x12, +0xA9, 0x72, 0xEF, 0x70, 0x1C, 0x90, 0x93, 0x47, 0xE0, 0x24, 0x08, 0xFF, 0x90, 0x93, 0x46, 0xE0, +0x34, 0x00, 0xFE, 0xD1, 0xA7, 0xEF, 0x64, 0x01, 0x60, 0x07, 0x90, 0x01, 0xC7, 0x74, 0x22, 0xF1, +0x94, 0x22, 0x90, 0x94, 0xFB, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0xA3, 0xE0, 0x22, 0x24, 0x06, 0xFD, +0x71, 0x7F, 0xEF, 0x22, 0xF0, 0x90, 0x8E, 0xC9, 0xE0, 0x44, 0x01, 0xF0, 0x22, 0x90, 0x93, 0x48, +0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x22, 0xD2, 0xAF, 0xC2, 0xAF, 0x90, 0x8D, 0x01, 0xE0, 0xFF, 0x22, +0x12, 0x87, 0xD2, 0x24, 0x16, 0xFF, 0xE4, 0x3E, 0xB1, 0x66, 0x90, 0x90, 0x80, 0xA3, 0xE0, 0xB5, +0x07, 0x19, 0x90, 0x93, 0x39, 0xE0, 0x24, 0x16, 0xD1, 0x9F, 0xFE, 0x7D, 0x01, 0x71, 0x7F, 0xEF, +0xFD, 0x90, 0x90, 0x80, 0xE0, 0x6D, 0x70, 0x01, 0xE4, 0x60, 0x03, 0x7F, 0x00, 0x22, 0x7F, 0x01, +0x22, 0x7E, 0x00, 0x7F, 0x04, 0x02, 0x06, 0x63, 0xF0, 0xA3, 0xEF, 0xF0, 0xE4, 0xFD, 0x61, 0x7F, +0xC4, 0x13, 0x13, 0x13, 0x54, 0x01, 0x22, 0x7E, 0x00, 0x7F, 0x06, 0x02, 0x06, 0x63, 0x32, 0x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0x02, 0x31, 0x5B, 0xD0, 0x07, 0xD0, 0x06, 0xD0, +0x05, 0xD0, 0x04, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0xD0, 0xD0, 0xD0, 0x82, 0xD0, +0x83, 0xD0, 0xF0, 0xD0, 0xE0, 0x32, 0xE4, 0xF5, 0x58, 0x90, 0x8E, 0x15, 0xE0, 0x60, 0x71, 0x51, +0xD5, 0x70, 0x6D, 0x12, 0x8F, 0xD8, 0xCE, 0xC3, 0x13, 0xCE, 0x13, 0xD8, 0xF9, 0x12, 0xA9, 0xCD, +0x90, 0x8E, 0x13, 0xE0, 0xC4, 0x54, 0x0F, 0x60, 0x22, 0x24, 0xFE, 0x60, 0x03, 0x04, 0x70, 0x1E, +0x90, 0x8E, 0x1C, 0xE0, 0x14, 0xF0, 0xE0, 0xFF, 0x60, 0x06, 0x90, 0x8E, 0x1E, 0xE0, 0x60, 0x0E, +0xEF, 0x70, 0x08, 0x90, 0x8E, 0x1B, 0xE0, 0xA3, 0xF0, 0x80, 0x00, 0x75, 0x58, 0x01, 0xE5, 0x58, +0x60, 0x2E, 0xF1, 0xE2, 0x90, 0x8E, 0x1E, 0xE0, 0x60, 0x03, 0xB4, 0x01, 0x04, 0x31, 0x51, 0x80, +0x08, 0x31, 0x51, 0x75, 0xF0, 0x03, 0xA4, 0x24, 0xFE, 0xFF, 0x90, 0x8E, 0x1D, 0xE0, 0x2F, 0x91, +0x2F, 0x7E, 0x01, 0x12, 0x50, 0x04, 0x90, 0x8E, 0x18, 0xE0, 0x20, 0xE2, 0x03, 0x12, 0x51, 0xE4, +0x22, 0xE4, 0x90, 0x94, 0xE7, 0xF0, 0x90, 0x8E, 0x1E, 0xE0, 0x22, 0x90, 0x07, 0x1F, 0xE0, 0x54, +0x7F, 0xF0, 0x90, 0x07, 0x1C, 0xE0, 0x54, 0x01, 0xFF, 0x90, 0x93, 0xE6, 0xF0, 0x90, 0x93, 0xE4, +0x74, 0x02, 0xF0, 0x90, 0x93, 0xF2, 0x14, 0xF0, 0xFB, 0x7A, 0x93, 0x79, 0xE4, 0x12, 0x85, 0x0E, +0x7F, 0x04, 0x90, 0x95, 0x43, 0xEF, 0xF0, 0x7F, 0x02, 0x12, 0x47, 0xE7, 0x90, 0x8D, 0x01, 0xE0, +0xFF, 0x90, 0x95, 0x43, 0xE0, 0xFE, 0xEF, 0x4E, 0x90, 0x8D, 0x01, 0xF0, 0x22, 0x31, 0xB0, 0x7F, +0x02, 0x8F, 0x59, 0x7F, 0x02, 0x12, 0x47, 0xE7, 0x90, 0x8D, 0x01, 0xE0, 0x45, 0x59, 0xF0, 0x22, +0x90, 0x01, 0xCC, 0xE0, 0x54, 0x0F, 0x90, 0x95, 0x38, 0xF0, 0x90, 0x95, 0x38, 0xE0, 0xFD, 0x70, +0x02, 0x41, 0xAA, 0x90, 0x8D, 0x5E, 0xE0, 0xFF, 0x70, 0x06, 0xA3, 0xE0, 0x64, 0x09, 0x60, 0x0A, +0xEF, 0x14, 0xFF, 0x90, 0x8D, 0x5F, 0xE0, 0xB5, 0x07, 0x04, 0x7F, 0x01, 0x80, 0x02, 0x7F, 0x00, +0xEF, 0x60, 0x08, 0x90, 0x01, 0xC1, 0xE0, 0x44, 0x01, 0xF0, 0x22, 0x90, 0x95, 0x36, 0x12, 0x8F, +0xA0, 0x80, 0x05, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, 0xF9, 0xFF, 0xEF, 0x5D, 0x70, 0x02, 0x41, +0x8C, 0xE4, 0x90, 0x95, 0x39, 0xF0, 0x90, 0x95, 0x39, 0xE0, 0xF9, 0xC3, 0x94, 0x04, 0x50, 0x31, +0x51, 0xAB, 0xA4, 0xFF, 0xE9, 0xFD, 0x7C, 0x00, 0x2F, 0xFF, 0xEC, 0x35, 0xF0, 0xFE, 0x74, 0xD0, +0x51, 0xC3, 0x90, 0x8D, 0x0E, 0x51, 0xB3, 0x51, 0xAB, 0xA4, 0x2D, 0xFF, 0xEC, 0x35, 0xF0, 0xFE, +0x74, 0xF0, 0x51, 0xC3, 0x90, 0x8D, 0x12, 0x51, 0xB3, 0x90, 0x95, 0x39, 0xE0, 0x04, 0xF0, 0x80, +0xC5, 0x90, 0x95, 0x38, 0xE0, 0xFF, 0x90, 0x95, 0x36, 0x12, 0x4C, 0x61, 0x80, 0x02, 0xC3, 0x33, +0xD8, 0xFC, 0xF4, 0x5F, 0x90, 0x95, 0x38, 0xF0, 0x90, 0x95, 0x36, 0xE0, 0xFF, 0x74, 0x01, 0xA8, +0x07, 0x08, 0x80, 0x02, 0xC3, 0x33, 0xD8, 0xFC, 0x90, 0x01, 0xCC, 0xF0, 0x90, 0x95, 0x36, 0xE0, +0x04, 0xF0, 0xE0, 0x54, 0x03, 0xF0, 0x90, 0x8D, 0x5F, 0xF1, 0xCB, 0xB4, 0x0A, 0x02, 0x7F, 0x01, +0xEF, 0x70, 0x02, 0x21, 0xBA, 0xE4, 0x90, 0x8D, 0x5F, 0xF0, 0x21, 0xBA, 0x90, 0x01, 0xC0, 0xE0, +0x44, 0x02, 0xF0, 0x90, 0x95, 0x36, 0xE0, 0x44, 0x80, 0x90, 0x00, 0x8A, 0xF0, 0x51, 0xAB, 0x90, +0x01, 0xD0, 0x12, 0x49, 0x0C, 0xE0, 0x90, 0x01, 0xC3, 0xF0, 0x22, 0x90, 0x95, 0x36, 0xE0, 0x75, +0xF0, 0x04, 0x22, 0x12, 0x49, 0x0C, 0xE5, 0x82, 0x29, 0xF5, 0x82, 0xE4, 0x35, 0x83, 0xF5, 0x83, +0xEF, 0xF0, 0x22, 0x2F, 0xF5, 0x82, 0x74, 0x01, 0x3E, 0xF5, 0x83, 0xE0, 0xFF, 0x90, 0x8D, 0x5F, +0xE0, 0x75, 0xF0, 0x08, 0x22, 0xE4, 0xFF, 0x51, 0xF2, 0xEF, 0x64, 0x01, 0x22, 0x51, 0xD5, 0x70, +0x10, 0x90, 0x8E, 0x15, 0xE0, 0x60, 0x0A, 0x12, 0x9E, 0x3E, 0x91, 0x25, 0x7E, 0x01, 0x12, 0x50, +0x04, 0x22, 0x12, 0x96, 0x1C, 0xFE, 0xEF, 0x54, 0x07, 0xFF, 0x74, 0xFF, 0x2E, 0x12, 0x96, 0x77, +0xFD, 0x7C, 0x00, 0x12, 0x8F, 0xA2, 0x80, 0x05, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, 0xF9, 0xFF, +0xEE, 0x5C, 0xFE, 0xEF, 0x5D, 0x4E, 0x7F, 0x00, 0x60, 0x02, 0x7F, 0x01, 0x22, 0x51, 0xD5, 0x70, +0x17, 0x90, 0x8E, 0x15, 0xE0, 0x60, 0x11, 0x12, 0x9E, 0x3E, 0xF0, 0x90, 0x8E, 0x11, 0xE0, 0x12, +0x9E, 0x49, 0x54, 0x07, 0x70, 0x02, 0xF1, 0xC1, 0x22, 0xE4, 0xFF, 0x51, 0xF2, 0xBF, 0x01, 0x0F, +0x90, 0x8E, 0x15, 0xE0, 0x60, 0x09, 0x12, 0x9C, 0x15, 0x54, 0x07, 0x70, 0x02, 0xF1, 0xC1, 0x22, +0xE4, 0xFF, 0x51, 0xF2, 0xBF, 0x01, 0x12, 0x90, 0x8E, 0x15, 0xE0, 0x60, 0x0C, 0xD1, 0x16, 0x64, +0x02, 0x60, 0x03, 0x02, 0x9E, 0xA5, 0x12, 0x57, 0xBB, 0x22, 0xEF, 0x60, 0x32, 0x51, 0xD5, 0x70, +0x2E, 0x90, 0x8E, 0x12, 0xE0, 0x54, 0xFE, 0xF0, 0x7D, 0x2B, 0x7F, 0x0F, 0x12, 0x54, 0x6C, 0x90, +0x06, 0x04, 0xE0, 0x54, 0xBF, 0xF0, 0x12, 0x57, 0x23, 0xBF, 0x01, 0x0E, 0x90, 0x8E, 0x11, 0xE0, +0x44, 0x40, 0xF0, 0x7D, 0x06, 0x7F, 0x01, 0x02, 0x53, 0xF7, 0xF1, 0xEE, 0x74, 0x08, 0xF0, 0x22, +0x90, 0x93, 0x24, 0xE0, 0x30, 0xE0, 0x34, 0x51, 0xD5, 0x70, 0x30, 0x90, 0x95, 0x48, 0xE0, 0x04, +0xF0, 0xE0, 0xB4, 0x0A, 0x0B, 0x90, 0x93, 0x26, 0xE0, 0x04, 0xF0, 0xE4, 0x90, 0x95, 0x48, 0xF0, +0x90, 0x93, 0x26, 0xE0, 0xFF, 0x90, 0x93, 0x25, 0xE0, 0xD3, 0x9F, 0x50, 0x0E, 0x90, 0x93, 0x27, +0xE0, 0x70, 0x08, 0xE4, 0x90, 0x93, 0x26, 0xF0, 0x12, 0x87, 0x72, 0x22, 0xE4, 0x90, 0x93, 0xF3, +0xF0, 0x90, 0x8E, 0x15, 0xE0, 0x60, 0x3D, 0x51, 0xD5, 0x70, 0x39, 0x12, 0x9D, 0xDF, 0x12, 0x8F, +0xD7, 0xCE, 0xC3, 0x13, 0xCE, 0x13, 0xD8, 0xF9, 0x12, 0xA9, 0xCD, 0x90, 0x93, 0xF3, 0x74, 0x01, +0xF0, 0xE4, 0x90, 0x8E, 0x1C, 0xF0, 0x04, 0x60, 0x1B, 0xF1, 0xE2, 0xE4, 0x90, 0x94, 0xE7, 0xF0, +0x90, 0x8E, 0x1D, 0x91, 0x2E, 0x7E, 0x01, 0x12, 0x50, 0x04, 0x90, 0x8E, 0x18, 0xE0, 0x20, 0xE2, +0x03, 0x12, 0x51, 0xE4, 0x22, 0xF0, 0xE4, 0x90, 0x94, 0xE7, 0xF0, 0x90, 0x8E, 0xBA, 0xE0, 0x90, +0x94, 0xE8, 0xF0, 0xE4, 0xFB, 0xFD, 0x7F, 0x54, 0x22, 0x8B, 0x51, 0x8A, 0x52, 0x89, 0x53, 0xD1, +0xE7, 0xFF, 0xF5, 0x55, 0x12, 0x06, 0x89, 0xFE, 0xC3, 0x13, 0x30, 0xE0, 0x06, 0xF1, 0xBB, 0xF5, +0x56, 0x80, 0x02, 0x8F, 0x56, 0x85, 0x55, 0x54, 0xE5, 0x54, 0xD3, 0x95, 0x56, 0x50, 0x26, 0xAB, +0x51, 0xAA, 0x52, 0xA9, 0x53, 0x12, 0x06, 0x89, 0x54, 0x01, 0xFD, 0xAF, 0x54, 0x12, 0x95, 0xCF, +0xAF, 0x54, 0x51, 0xF2, 0xEF, 0xAF, 0x54, 0x70, 0x05, 0x12, 0x99, 0x46, 0x80, 0x03, 0x12, 0x99, +0x32, 0x05, 0x54, 0x80, 0xD3, 0xE5, 0x55, 0x70, 0x0F, 0xFF, 0x51, 0xF2, 0xEF, 0x70, 0x09, 0x12, +0x79, 0x41, 0x54, 0xBF, 0xF0, 0x54, 0x7F, 0xF0, 0x22, 0x90, 0x93, 0x39, 0x12, 0x49, 0x21, 0x90, +0x93, 0x38, 0xEF, 0xF0, 0x12, 0x49, 0x2A, 0x74, 0xE1, 0x00, 0x74, 0xE6, 0x01, 0x74, 0xEA, 0x02, +0x74, 0xEF, 0x03, 0x74, 0xF4, 0x04, 0x74, 0xF9, 0x12, 0x74, 0xFE, 0x14, 0x75, 0x03, 0x20, 0x75, +0x07, 0x21, 0x75, 0x0C, 0x23, 0x75, 0x11, 0x25, 0x75, 0x1B, 0x80, 0x75, 0x16, 0x81, 0x75, 0x20, +0x82, 0x75, 0x25, 0x83, 0x75, 0x2A, 0x84, 0x75, 0x34, 0x86, 0x75, 0x2F, 0x88, 0x00, 0x00, 0x75, +0x39, 0xB1, 0x49, 0x02, 0x8F, 0xE6, 0xB1, 0x49, 0x81, 0x39, 0xB1, 0x49, 0x02, 0x97, 0xD2, 0xB1, +0x49, 0x02, 0xA2, 0xD2, 0xB1, 0x49, 0x02, 0x8C, 0x3C, 0xB1, 0x49, 0x02, 0x98, 0x0F, 0xB1, 0x49, +0x02, 0x98, 0xD9, 0xB1, 0x49, 0xC1, 0x1D, 0xB1, 0x49, 0x02, 0x98, 0xE8, 0xB1, 0x49, 0x02, 0x99, +0x22, 0xB1, 0x49, 0x02, 0x99, 0x2A, 0xB1, 0x49, 0x02, 0x7A, 0xE7, 0xB1, 0x49, 0x02, 0x7B, 0x8E, +0xB1, 0x49, 0x02, 0xA6, 0xB0, 0xB1, 0x49, 0x02, 0x92, 0x0F, 0xB1, 0x49, 0x02, 0x92, 0x4D, 0xB1, +0x49, 0x02, 0xA6, 0xC6, 0xB1, 0x49, 0x02, 0x86, 0xD3, 0x90, 0x01, 0xC0, 0xE0, 0x44, 0x01, 0xF0, +0x90, 0x93, 0x38, 0xE0, 0x90, 0x01, 0xC2, 0xF0, 0x22, 0x90, 0x93, 0x39, 0x02, 0x49, 0x18, 0xD3, +0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x8D, 0x5F, 0xE0, 0xFF, 0x90, 0x8D, 0x5E, 0xE0, 0xB5, +0x07, 0x04, 0x7F, 0x01, 0x80, 0x02, 0x7F, 0x00, 0xEF, 0x70, 0x3E, 0x90, 0x8D, 0x5E, 0xE0, 0xFE, +0x75, 0xF0, 0x08, 0x90, 0x8D, 0x0E, 0x12, 0x49, 0x0C, 0xE0, 0xFD, 0xEE, 0x75, 0xF0, 0x08, 0xA4, +0x24, 0x0F, 0xF9, 0x74, 0x8D, 0x35, 0xF0, 0xFA, 0x7B, 0x01, 0xAF, 0x05, 0x91, 0x99, 0x90, 0x8D, +0x5E, 0xF1, 0xCB, 0xB4, 0x0A, 0x02, 0x7F, 0x01, 0xEF, 0x60, 0x05, 0xE4, 0x90, 0x8D, 0x5E, 0xF0, +0x31, 0xB0, 0x90, 0x8D, 0x01, 0xE0, 0x44, 0x02, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x12, 0x8F, +0xB4, 0x30, 0xE0, 0x0C, 0xEF, 0xC4, 0x13, 0x13, 0x54, 0x03, 0x30, 0xE0, 0x03, 0x12, 0x79, 0x5B, +0x90, 0x8E, 0x11, 0x12, 0x87, 0x6B, 0x30, 0xE0, 0x0A, 0xEF, 0x12, 0x9E, 0x49, 0x54, 0x07, 0x70, +0x44, 0x80, 0x40, 0x90, 0x8E, 0x1E, 0xE0, 0x04, 0xF0, 0x90, 0x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4, 0x54, 0xF0, 0x4F, 0x12, 0x06, 0xCF, 0xD1, 0xD9, 0xD1, 0xDF, 0xC4, 0x54, 0x0F, +0xFF, 0xC3, 0x94, 0x04, 0x90, 0x8E, 0x1D, 0x50, 0x05, 0x74, 0x04, 0xF0, 0x80, 0x02, 0xEF, 0xF0, +0xD1, 0xD9, 0x12, 0x90, 0x26, 0xFD, 0x7F, 0x02, 0x12, 0x53, 0xF7, 0x90, 0x94, 0x65, 0xE0, 0x60, +0x03, 0x12, 0x53, 0xEB, 0xD1, 0xD9, 0x12, 0x79, 0x87, 0xF1, 0xEE, 0xF0, 0x90, 0x8E, 0x15, 0x12, +0xA9, 0x99, 0xD1, 0x16, 0x90, 0x01, 0xBE, 0xF0, 0x22, 0x90, 0x93, 0x3C, 0x02, 0x49, 0x18, 0x90, +0x00, 0x06, 0x02, 0x06, 0xA2, 0x4E, 0xF0, 0x90, 0x00, 0x01, 0x02, 0x06, 0xA2, 0x12, 0x06, 0x89, +0x90, 0x06, 0x74, 0xD1, 0xE6, 0x90, 0x06, 0x75, 0xF1, 0xBA, 0x90, 0x06, 0x76, 0xF1, 0xD3, 0x90, +0x06, 0x77, 0xF0, 0x90, 0x06, 0x70, 0xEF, 0xF0, 0xA3, 0xE4, 0xF0, 0xA3, 0x04, 0xF0, 0xA3, 0x74, +0x80, 0xF0, 0x7F, 0x01, 0x7E, 0x00, 0x02, 0x3D, 0x7A, 0x90, 0x93, 0x94, 0xEF, 0xF0, 0xA3, 0x12, +0x49, 0x21, 0x90, 0x93, 0x95, 0x12, 0x57, 0x05, 0xF1, 0xA4, 0x24, 0x02, 0xF1, 0x8A, 0x24, 0x04, +0xF1, 0x9B, 0x24, 0x03, 0xF1, 0x8A, 0x24, 0x08, 0xF1, 0x9B, 0x24, 0x04, 0xF1, 0x8A, 0x24, 0x0C, +0xF1, 0x9B, 0x24, 0x05, 0xFF, 0x7B, 0x01, 0x7A, 0x93, 0x79, 0x98, 0xD1, 0xED, 0x90, 0x93, 0x94, +0xE0, 0xFE, 0x44, 0x10, 0x90, 0x93, 0x98, 0xF0, 0xA3, 0x74, 0x80, 0xF0, 0xA3, 0x74, 0xFF, 0xF0, +0xA3, 0xF0, 0xEE, 0x75, 0xF0, 0x08, 0xA4, 0xFF, 0x7B, 0x01, 0x7A, 0x93, 0x79, 0x98, 0xD1, 0xED, +0x90, 0x93, 0x98, 0x74, 0xFF, 0x12, 0x4F, 0x6D, 0xF1, 0xB0, 0x04, 0xFF, 0x7B, 0x01, 0x7A, 0x93, +0x79, 0x98, 0xD1, 0xED, 0x90, 0x06, 0x72, 0xE4, 0xF0, 0x22, 0xFF, 0x7B, 0x01, 0x7A, 0x93, 0x79, +0x98, 0xD1, 0xED, 0x90, 0x93, 0x95, 0x12, 0x49, 0x18, 0xE9, 0x22, 0xF9, 0xE4, 0x3A, 0x8B, 0x40, +0xF5, 0x41, 0x89, 0x42, 0x75, 0x43, 0x04, 0x7B, 0x01, 0x7A, 0x93, 0x79, 0x98, 0x12, 0x34, 0x62, +0x90, 0x93, 0x94, 0xE0, 0x75, 0xF0, 0x08, 0xA4, 0x22, 0x4F, 0xF0, 0x90, 0x00, 0x02, 0x02, 0x06, +0xA2, 0x90, 0x8E, 0x17, 0xE0, 0xFF, 0x7D, 0x01, 0x02, 0x51, 0xE8, 0xE0, 0x04, 0xF0, 0xE0, 0x7F, +0x00, 0x22, 0x4F, 0xF0, 0x90, 0x00, 0x03, 0x02, 0x06, 0xA2, 0x90, 0x8E, 0x12, 0xE0, 0x54, 0xFB, +0xF0, 0x22, 0x90, 0x8E, 0x19, 0xE0, 0x44, 0x10, 0xF0, 0x22, 0x7F, 0x80, 0x21, 0xA1, 0x90, 0x01, +0xB9, 0x74, 0x01, 0xF0, 0x90, 0x01, 0xB8, 0x22, 0xC0, 0xE0, 0xC0, 0xF0, 0xC0, 0x83, 0xC0, 0x82, +0xC0, 0xD0, 0x75, 0xD0, 0x00, 0xC0, 0x00, 0xC0, 0x01, 0xC0, 0x02, 0xC0, 0x03, 0xC0, 0x04, 0xC0, +0x05, 0xC0, 0x06, 0xC0, 0x07, 0x12, 0x9A, 0x90, 0xE5, 0x21, 0x30, 0xE0, 0x03, 0x12, 0x77, 0xEA, +0xE5, 0x21, 0x30, 0xE1, 0x03, 0x12, 0x9F, 0x0A, 0xE5, 0x21, 0x30, 0xE2, 0x02, 0x31, 0x71, 0xE5, +0x22, 0x30, 0xE0, 0x03, 0x12, 0x9D, 0xA0, 0xE5, 0x24, 0x30, 0xE1, 0x05, 0x7F, 0x04, 0x12, 0x71, +0xA1, 0xE5, 0x24, 0x30, 0xE4, 0x02, 0x11, 0x73, 0xE5, 0x24, 0x30, 0xE5, 0x03, 0x12, 0x8B, 0xD5, +0xE5, 0x24, 0x30, 0xE6, 0x03, 0x12, 0x8C, 0x04, 0xD0, 0x07, 0xD0, 0x06, 0xD0, 0x05, 0xD0, 0x04, +0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0xD0, 0xD0, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xF0, +0xD0, 0xE0, 0x32, 0x12, 0x73, 0xDC, 0x7D, 0x02, 0x7F, 0x02, 0x74, 0x15, 0x2F, 0xF8, 0xE6, 0x4D, +0xFE, 0xF6, 0x74, 0x30, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x01, 0xF5, 0x83, 0xEE, 0xF0, 0x22, 0x90, +0x8E, 0x11, 0xE0, 0x54, 0xFB, 0xF0, 0xE4, 0x90, 0x8E, 0x1E, 0xF0, 0xA3, 0xF0, 0x90, 0x8E, 0x19, +0xF0, 0x90, 0x8E, 0x12, 0xE0, 0x54, 0xF7, 0xF0, 0x54, 0xBF, 0xF0, 0x7D, 0x01, 0x7F, 0x02, 0x11, +0x7A, 0x7D, 0x02, 0x7F, 0x02, 0x11, 0x7A, 0x7D, 0x10, 0x7F, 0x03, 0x74, 0x1D, 0x12, 0xAA, 0x0B, +0x74, 0x38, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x01, 0xF5, 0x83, 0xEE, 0xF0, 0x22, 0x90, 0x01, 0x36, +0x74, 0x78, 0xF0, 0xA3, 0x74, 0x02, 0xF0, 0x7D, 0x78, 0xFF, 0x11, 0x7A, 0x7D, 0x02, 0x7F, 0x03, +0x11, 0x7A, 0x90, 0x06, 0x0A, 0xE0, 0x44, 0x07, 0x12, 0x9E, 0x54, 0xE4, 0xFF, 0x12, 0x72, 0xF2, +0xBF, 0x01, 0x11, 0x12, 0x77, 0xDA, 0x90, 0x8E, 0x18, 0xE0, 0x20, 0xE2, 0x0A, 0x7D, 0x01, 0x7F, +0x04, 0x02, 0x51, 0xE8, 0x12, 0x9D, 0xE7, 0x22, 0xEF, 0x70, 0x34, 0x7D, 0x78, 0x7F, 0x02, 0x31, +0x5F, 0x7D, 0x02, 0x7F, 0x03, 0x31, 0x5F, 0x7D, 0xC8, 0x7F, 0x02, 0x11, 0xBB, 0x12, 0x9E, 0x3E, +0xF0, 0xE4, 0xFF, 0x12, 0x72, 0xF2, 0xEF, 0x70, 0x0A, 0x31, 0x41, 0x54, 0xBF, 0xF0, 0x54, 0x7F, +0xF0, 0x80, 0x07, 0x7D, 0x01, 0x7F, 0x0C, 0x12, 0x51, 0xE8, 0x31, 0x46, 0x02, 0x97, 0xA8, 0x80, +0x8C, 0x12, 0x4C, 0xF1, 0x31, 0x4E, 0x90, 0x8E, 0x11, 0xE0, 0x54, 0xF7, 0xF0, 0x22, 0x12, 0x97, +0xA0, 0x12, 0x87, 0xCC, 0x7D, 0x0C, 0x7F, 0x01, 0x02, 0x53, 0xF7, 0x7D, 0x02, 0x7F, 0x02, 0x74, +0x15, 0x12, 0xAA, 0x0B, 0x74, 0x30, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x01, 0xF5, 0x83, 0xEE, 0xF0, +0x22, 0x90, 0x8E, 0x15, 0xE0, 0x60, 0x0F, 0x90, 0x06, 0x92, 0xE0, 0x30, 0xE1, 0x03, 0x02, 0x9E, +0x02, 0x31, 0x46, 0x12, 0x77, 0xC1, 0x22, 0x90, 0x93, 0x3F, 0x12, 0x49, 0x21, 0x11, 0x8F, 0x90, +0x8E, 0x15, 0xE0, 0xFF, 0x31, 0x08, 0x90, 0x8E, 0x15, 0xE0, 0x60, 0x13, 0x90, 0x93, 0x3F, 0x12, +0x49, 0x18, 0x12, 0x76, 0xE7, 0x54, 0x0F, 0xFF, 0x12, 0x77, 0xBB, 0xFD, 0x12, 0xA7, 0x4F, 0x22, +0xEF, 0x60, 0x38, 0x90, 0x93, 0x14, 0xE0, 0xFF, 0x60, 0x03, 0x12, 0xA4, 0x27, 0x90, 0x01, 0xC7, +0xE4, 0x91, 0x92, 0xF1, 0xE5, 0x90, 0x06, 0x09, 0xE0, 0x54, 0xFE, 0xF0, 0x7D, 0x35, 0x12, 0x4C, +0x85, 0x12, 0x87, 0xB9, 0x12, 0x8D, 0x54, 0x12, 0xA6, 0xFA, 0x12, 0x87, 0xC9, 0x12, 0x99, 0xA0, +0x90, 0x01, 0x34, 0x74, 0x08, 0xF0, 0xFD, 0xE4, 0xFF, 0x01, 0x7A, 0x7D, 0x08, 0xE4, 0xFF, 0x31, +0x5F, 0x90, 0x06, 0x90, 0xE0, 0x54, 0xF0, 0xF0, 0x12, 0x87, 0x99, 0x12, 0x99, 0xF3, 0x12, 0x8A, +0xEE, 0x12, 0x95, 0x5A, 0x7A, 0x8E, 0x79, 0xC0, 0x12, 0x08, 0xAA, 0x90, 0x06, 0x90, 0xE0, 0x44, +0x20, 0xF0, 0x12, 0x9A, 0x18, 0x12, 0x8B, 0x16, 0x90, 0x8D, 0x06, 0xE0, 0xFF, 0x64, 0x02, 0x70, +0x2A, 0x51, 0xE0, 0x30, 0xE0, 0x02, 0x7E, 0x01, 0x90, 0x8E, 0xDF, 0x51, 0xDE, 0x30, 0xE1, 0x02, +0x7E, 0x01, 0x90, 0x8E, 0xDD, 0x51, 0xDE, 0x30, 0xE2, 0x02, 0x7E, 0x01, 0x90, 0x8E, 0xDE, 0xEE, +0xF0, 0x90, 0xFD, 0x80, 0xE0, 0x90, 0x02, 0xFB, 0xF0, 0x80, 0x4A, 0xEF, 0x64, 0x01, 0x70, 0x1D, +0x51, 0xD7, 0x30, 0xE0, 0x02, 0x7F, 0x01, 0x90, 0x8E, 0xDF, 0x51, 0xD5, 0x30, 0xE1, 0x02, 0x7F, +0x01, 0x90, 0x8E, 0xDD, 0x51, 0xD5, 0x30, 0xE2, 0x02, 0x7F, 0x01, 0x80, 0x23, 0x90, 0x8D, 0x06, +0xE0, 0x64, 0x03, 0x70, 0x20, 0x51, 0xCE, 0x30, 0xE0, 0x02, 0x7F, 0x01, 0x90, 0x8E, 0xDF, 0x51, +0xCC, 0x30, 0xE1, 0x02, 0x7F, 0x01, 0x90, 0x8E, 0xDD, 0x51, 0xCC, 0x30, 0xE2, 0x02, 0x7F, 0x01, +0x90, 0x8E, 0xDE, 0xEF, 0xF0, 0x90, 0x8E, 0xC0, 0xE0, 0x54, 0xEF, 0xF0, 0xE4, 0x90, 0x90, 0xC6, +0xF0, 0xA3, 0xF0, 0x90, 0x90, 0xCE, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0x90, 0x90, 0xD2, +0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0x90, 0x90, 0xCA, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, +0x00, 0x90, 0x93, 0x0E, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0x22, 0xEF, 0xF0, 0x90, 0xFD, +0x78, 0xE0, 0x7F, 0x00, 0x22, 0xEF, 0xF0, 0x90, 0xFD, 0x70, 0xE0, 0x7F, 0x00, 0x22, 0xEE, 0xF0, +0x90, 0xFD, 0x80, 0xE0, 0x7E, 0x00, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xF1, 0xDE, +0xFE, 0x90, 0x8E, 0xC0, 0x71, 0x79, 0x12, 0xAA, 0x42, 0xFF, 0x90, 0x8E, 0xC0, 0x12, 0x87, 0xDB, +0x4E, 0x71, 0x87, 0x12, 0xAA, 0x15, 0x90, 0x8E, 0xC0, 0x12, 0xA9, 0xE3, 0x71, 0x87, 0x12, 0xAA, +0x1E, 0x90, 0x8E, 0xC0, 0x12, 0xAA, 0x30, 0x4E, 0x12, 0x77, 0xBA, 0x54, 0x01, 0xFF, 0x90, 0x8E, +0xC2, 0xE0, 0x54, 0xFE, 0x4F, 0x12, 0x76, 0xE6, 0x54, 0x01, 0xFF, 0x90, 0x8E, 0xC1, 0xE0, 0x54, +0xFE, 0x4F, 0x91, 0x92, 0xF1, 0xE5, 0x90, 0x8E, 0xC0, 0xE0, 0xC3, 0x13, 0x54, 0x01, 0xFF, 0x12, +0xA6, 0xD6, 0x91, 0x8B, 0x54, 0x01, 0xFF, 0x12, 0xA4, 0x45, 0x91, 0x8B, 0x13, 0x54, 0x01, 0xFF, +0x12, 0x86, 0x00, 0x90, 0x8E, 0xC0, 0xE0, 0xC4, 0x54, 0x01, 0xFF, 0x12, 0xA6, 0xE2, 0x90, 0x8E, +0xC0, 0xE0, 0xC4, 0x13, 0x13, 0x54, 0x01, 0xFF, 0x12, 0xA6, 0xF0, 0x90, 0x8E, 0xC0, 0xE0, 0x54, +0x01, 0xFF, 0x31, 0xB0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xE0, 0x54, 0xFE, 0x4E, 0xFE, 0xF0, 0xEF, +0x54, 0x02, 0xFF, 0xEE, 0x54, 0xFD, 0x4F, 0xFF, 0xF0, 0x12, 0x06, 0x89, 0xFE, 0x22, 0xD3, 0x10, +0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x12, 0x87, 0x65, 0x12, 0x06, 0x89, 0x20, 0xE0, 0x05, 0x12, 0x99, +0xF3, 0x81, 0x86, 0x90, 0x8F, 0x94, 0x74, 0x05, 0xF0, 0x12, 0x76, 0xD9, 0xF1, 0xDE, 0xFE, 0x90, +0x8E, 0xC3, 0x71, 0x79, 0x12, 0xAA, 0x42, 0xFF, 0x90, 0x8E, 0xC3, 0x12, 0x87, 0xDB, 0x4E, 0x71, +0x87, 0x12, 0xAA, 0x15, 0x90, 0x8E, 0xC3, 0x12, 0xA9, 0xE3, 0x71, 0x87, 0x12, 0xAA, 0x1E, 0x90, +0x8E, 0xC3, 0x12, 0xAA, 0x30, 0x12, 0x76, 0xE5, 0x54, 0x80, 0xFF, 0x90, 0x8E, 0xC4, 0xE0, 0x54, +0x7F, 0x4F, 0xF0, 0x12, 0x06, 0x89, 0x13, 0x13, 0x54, 0x3F, 0x30, 0xE0, 0x07, 0x90, 0x06, 0x90, +0xE0, 0x44, 0x04, 0xF0, 0x12, 0x76, 0xD9, 0x12, 0x06, 0x89, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x30, +0xE0, 0x07, 0x90, 0x06, 0x90, 0xE0, 0x44, 0x08, 0xF0, 0x90, 0x8D, 0x06, 0xE0, 0xB4, 0x02, 0x0A, +0x90, 0x8E, 0xC4, 0xE0, 0x12, 0x6F, 0xF0, 0x20, 0xE0, 0x5E, 0x12, 0x76, 0xE7, 0x54, 0x7F, 0xFF, +0x90, 0x8E, 0xC4, 0xE0, 0x54, 0x80, 0x12, 0x77, 0xB9, 0x90, 0x8E, 0xC5, 0x12, 0x77, 0xD3, 0xFF, +0x54, 0x01, 0xFE, 0x90, 0x8E, 0xC6, 0xE0, 0x54, 0xFE, 0x4E, 0xFE, 0xF0, 0xEF, 0x54, 0xFE, 0xFF, +0xEE, 0x54, 0x01, 0x4F, 0xF0, 0x12, 0x4E, 0xB3, 0x13, 0x54, 0x07, 0x7D, 0x00, 0x20, 0xE0, 0x02, +0x7D, 0x01, 0x12, 0x4B, 0xB7, 0x90, 0x8D, 0x06, 0xE0, 0xB4, 0x01, 0x1C, 0x7F, 0x4E, 0x12, 0x4C, +0x69, 0xEF, 0x54, 0xBF, 0xFD, 0x7F, 0x4E, 0x12, 0x4B, 0x9F, 0x7F, 0x4A, 0x12, 0x4C, 0x69, 0xEF, +0x54, 0xFB, 0xFD, 0x7F, 0x4A, 0x12, 0x4B, 0x9F, 0x90, 0x8D, 0x06, 0xE0, 0xB4, 0x01, 0x07, 0x90, +0xFE, 0x10, 0xE0, 0x44, 0x04, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0x8E, 0xC0, 0xE0, 0x13, +0x13, 0x22, 0xF0, 0x90, 0x01, 0x17, 0xE0, 0xFE, 0x90, 0x01, 0x16, 0xE0, 0x7C, 0x00, 0x24, 0x00, +0xFF, 0xEC, 0x3E, 0x22, 0x90, 0x93, 0x1F, 0xB1, 0x65, 0xEF, 0xF0, 0xE0, 0xFE, 0x24, 0x28, 0xF5, +0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xE0, 0xFF, 0x74, 0x29, 0x2E, 0x12, 0x83, 0x7E, 0xFD, 0x90, +0x93, 0x3C, 0xE0, 0x24, 0x2C, 0x12, 0xA8, 0xF1, 0x12, 0x84, 0x71, 0x90, 0x93, 0x3C, 0xE0, 0x2F, +0x24, 0x30, 0xA3, 0xF0, 0xE0, 0xFD, 0x24, 0x04, 0x12, 0x86, 0xCB, 0xE0, 0xFE, 0x12, 0xAA, 0x27, +0xF5, 0x83, 0x91, 0x9B, 0x90, 0x90, 0x7A, 0xF0, 0xA3, 0xEF, 0xF0, 0x90, 0x93, 0x3D, 0xE0, 0x24, +0x0C, 0xF9, 0xE4, 0x34, 0xFC, 0x12, 0x83, 0xF4, 0x75, 0x43, 0x04, 0x7B, 0x01, 0x7A, 0x90, 0x79, +0x7C, 0x12, 0x34, 0x62, 0x90, 0x93, 0x3D, 0xE0, 0x24, 0x14, 0xF0, 0xE0, 0xFD, 0x24, 0x01, 0x12, +0x5E, 0xE1, 0xE0, 0xFE, 0x74, 0x00, 0x2D, 0x12, 0x5D, 0x91, 0x91, 0x9B, 0x90, 0x90, 0x80, 0xF0, +0xA3, 0xEF, 0xF0, 0x90, 0x93, 0x20, 0xB1, 0x65, 0xEF, 0xF0, 0x90, 0x90, 0x76, 0xE0, 0xFE, 0xA3, +0xE0, 0xFF, 0x4E, 0x60, 0x14, 0x90, 0x93, 0x3C, 0xE0, 0x24, 0x00, 0x12, 0x83, 0xF0, 0x8F, 0x43, +0x7B, 0x01, 0x7A, 0x90, 0x79, 0x84, 0x12, 0x34, 0x62, 0x90, 0x93, 0x21, 0xB1, 0x65, 0xEF, 0xF0, +0x24, 0x00, 0x12, 0x83, 0xF0, 0x90, 0x90, 0x78, 0xA3, 0xE0, 0xF5, 0x43, 0x7B, 0x01, 0x7A, 0x90, +0x79, 0xA4, 0x02, 0x34, 0x62, 0xE0, 0xFF, 0xF1, 0xD6, 0x90, 0x93, 0x3C, 0x22, 0xD3, 0x10, 0xAF, +0x01, 0xC3, 0xC0, 0xD0, 0xE4, 0x90, 0x93, 0x3C, 0xF0, 0xA3, 0xF0, 0x90, 0x02, 0x09, 0xE0, 0x90, +0x93, 0x41, 0xF0, 0x90, 0x93, 0x22, 0xE0, 0xFF, 0xF1, 0xD6, 0x7E, 0x00, 0x90, 0x93, 0x3C, 0xEE, +0xF0, 0xA3, 0xEF, 0xF0, 0x12, 0x5D, 0x8F, 0xE0, 0x90, 0x90, 0xC6, 0xF0, 0x74, 0x01, 0x2F, 0x12, +0x5E, 0xE1, 0xE0, 0x90, 0x90, 0xC7, 0xF0, 0x90, 0x01, 0xA0, 0xF0, 0x90, 0x93, 0x3C, 0x12, 0x8A, +0xE7, 0x90, 0x93, 0x3C, 0xA3, 0xE0, 0x24, 0x02, 0x12, 0x86, 0x9A, 0xFF, 0xE4, 0xFC, 0xFD, 0x78, +0x10, 0x12, 0x08, 0x5A, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x12, 0xA9, 0x2D, 0x12, +0x80, 0x75, 0x78, 0x18, 0x12, 0x08, 0x5A, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0x12, +0x48, 0x6D, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x12, 0xA9, 0x67, 0x34, 0xFC, 0x12, +0x80, 0x75, 0x78, 0x08, 0x12, 0x08, 0x5A, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0x12, +0x5D, 0x7F, 0x12, 0x80, 0x77, 0x12, 0x48, 0x6D, 0x90, 0x90, 0xCA, 0x12, 0x80, 0x5C, 0x78, 0x10, +0x12, 0x08, 0x5A, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x12, 0xA9, 0x2D, 0x12, 0x80, +0x75, 0x78, 0x18, 0x12, 0x08, 0x5A, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0x12, 0x48, +0x6D, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x12, 0xA9, 0x67, 0x34, 0xFC, 0x12, 0x80, +0x75, 0x78, 0x08, 0x12, 0x08, 0x5A, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0x12, 0x5D, +0x7F, 0x12, 0x80, 0x77, 0x12, 0x48, 0x6D, 0x90, 0x90, 0xCE, 0x12, 0x80, 0x5C, 0x78, 0x10, 0x12, +0x08, 0x5A, 0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x12, 0xA9, 0x2D, 0x12, 0x80, 0x75, +0x78, 0x18, 0x12, 0x08, 0x5A, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0x12, 0x48, 0x6D, +0xC0, 0x04, 0xC0, 0x05, 0xC0, 0x06, 0xC0, 0x07, 0x12, 0xA9, 0x67, 0x34, 0xFC, 0x12, 0x80, 0x75, +0x78, 0x08, 0x12, 0x08, 0x5A, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0x12, 0x5D, 0x7F, +0x12, 0x80, 0x77,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DE, 0x12, 0x08, 0x6D, 0x90, 0x94, 0xDE, 0x12, 0x49, 0x00, 0x90, 0x94, 0xDD, +0x11, 0x77, 0x12, 0x48, 0xD6, 0xA3, 0x12, 0x08, 0x6D, 0x90, 0x94, 0xDE, 0x12, 0x4E, 0xD2, 0x7F, +0xB0, 0x7E, 0x08, 0x12, 0x38, 0x07, 0xF1, 0x92, 0x90, 0x94, 0xDC, 0xE0, 0x75, 0xF0, 0x08, 0xA4, +0x24, 0xB5, 0xF5, 0x82, 0xE4, 0x34, 0xAD, 0xF5, 0x83, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x12, 0x37, +0xBC, 0xED, 0x54, 0x0F, 0xFD, 0xE4, 0xFC, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x12, 0x08, 0x6D, 0x90, +0x93, 0x3C, 0xE4, 0x75, 0xF0, 0x04, 0x12, 0x08, 0xD6, 0x90, 0x93, 0x3C, 0xA3, 0xE0, 0x24, 0x02, +0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xE0, 0xFF, 0xE4, 0xFC, 0xFD, 0xFE, 0x22, 0x90, 0x8D, +0xFB, 0xF1, 0x6B, 0x30, 0xE0, 0x07, 0xF1, 0x99, 0xE4, 0x90, 0x94, 0x64, 0xF0, 0x90, 0x94, 0x8F, +0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x7F, 0x90, 0x94, 0x4A, 0x11, 0x77, 0x12, 0x67, 0xF1, 0x7F, +0x50, 0x7E, 0x0C, 0x12, 0x66, 0x52, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x7F, 0x90, 0x94, 0x4B, +0x11, 0x77, 0x12, 0x67, 0xF1, 0xF1, 0x8B, 0x90, 0x94, 0x60, 0xE0, 0x90, 0x06, 0x08, 0xF0, 0x90, +0x94, 0x62, 0xA3, 0xE0, 0x90, 0x06, 0xA0, 0xF0, 0xA3, 0xE4, 0xF0, 0x90, 0x94, 0x4E, 0xE0, 0xFF, +0x60, 0x0D, 0x90, 0x94, 0x50, 0xE0, 0xFD, 0x90, 0x94, 0x4F, 0xE0, 0xFB, 0x12, 0x60, 0x6A, 0x90, +0x94, 0x4D, 0xE0, 0xFF, 0x60, 0x08, 0x12, 0x98, 0xD2, 0x71, 0xA4, 0x12, 0x61, 0xB1, 0x22, 0xD3, +0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x94, 0x5C, 0xE0, 0xFF, 0x12, 0xA8, 0x54, 0xEF, 0x70, +0x02, 0x21, 0xA2, 0x90, 0x94, 0x5D, 0xE0, 0xFB, 0xD3, 0x94, 0x00, 0x40, 0x1A, 0x90, 0x94, 0x8F, +0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x0F, 0xAF, 0x03, 0xE4, 0xFC, 0xFD, 0xFE, 0x12, 0x67, 0xF1, +0x7F, 0x20, 0x7E, 0x0C, 0x12, 0x65, 0xDA, 0x90, 0x94, 0x5C, 0xE0, 0xFF, 0x90, 0x06, 0x33, 0xF0, +0x71, 0xA4, 0xE4, 0xFB, 0xFD, 0x12, 0x61, 0xB1, 0x90, 0x94, 0x5F, 0xE0, 0x60, 0x07, 0x90, 0x8D, +0xFC, 0xE0, 0xFF, 0x31, 0xE6, 0xF1, 0xA1, 0x30, 0xE0, 0x34, 0x90, 0x90, 0xC7, 0xE0, 0x60, 0x2E, +0xE4, 0x90, 0x93, 0x3A, 0xF0, 0x90, 0x90, 0xC7, 0xE0, 0xFF, 0x90, 0x93, 0x3A, 0xE0, 0xC3, 0x9F, +0x50, 0x1C, 0x7F, 0x03, 0x7E, 0x00, 0x12, 0x3C, 0xEC, 0x90, 0x93, 0x3A, 0xE0, 0x24, 0x06, 0xF1, +0xA9, 0xE0, 0xFF, 0x31, 0xE6, 0x90, 0x01, 0xA6, 0xE0, 0x04, 0x71, 0x9C, 0x80, 0xD7, 0x90, 0x94, +0x5E, 0xE0, 0x90, 0x93, 0x39, 0xF0, 0x90, 0x94, 0x49, 0xE0, 0x04, 0xF0, 0xE0, 0xFF, 0x71, 0xB6, +0x90, 0x93, 0x39, 0x11, 0x77, 0x90, 0x93, 0x4B, 0x12, 0x08, 0x6D, 0xF1, 0xB1, 0x12, 0x50, 0x38, +0x80, 0x3F, 0xE4, 0x90, 0x94, 0x49, 0xF0, 0x90, 0x94, 0x65, 0xF0, 0x90, 0x06, 0x32, 0xE0, 0x54, +0xFB, 0xF0, 0x11, 0x7E, 0xE4, 0xFF, 0x12, 0x72, 0xF2, 0xBF, 0x01, 0x0C, 0x90, 0x94, 0x61, 0xE0, +0xFD, 0x7F, 0x02, 0x12, 0x53, 0xF7, 0x71, 0xAD, 0x90, 0x93, 0x3B, 0x74, 0x07, 0xF0, 0x90, 0x93, +0x49, 0xF0, 0x7B, 0x01, 0x7A, 0x93, 0x79, 0x3B, 0xB1, 0x0E, 0x7F, 0x04, 0x12, 0x71, 0x82, 0x91, +0xC9, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x93, 0x4A, +0xEF, 0xF0, 0x12, 0x9F, 0x14, 0xBF, 0x01, 0x17, 0x90, 0x06, 0x32, 0xE0, 0x44, 0x08, 0xF0, 0x90, +0x93, 0x4A, 0x51, 0x17, 0x90, 0x93, 0x4B, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0x12, 0x55, 0xDF, 0xD0, +0xD0, 0x92, 0xAF, 0x22, 0x90, 0x93, 0x17, 0xE0, 0xFF, 0x7B, 0x18, 0x7D, 0x01, 0xD3, 0x10, 0xAF, +0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x95, 0x2E, 0xED, 0xF0, 0xA3, 0xEB, 0xF0, 0x90, 0x95, 0x2D, 0xEF, +0xF0, 0xE4, 0xFD, 0xFC, 0xB1, 0xF8, 0x90, 0x95, 0x2D, 0xE0, 0x90, 0x04, 0x25, 0xF0, 0x90, 0x95, +0x2E, 0xE0, 0x60, 0x05, 0x71, 0x4E, 0x44, 0x80, 0xF0, 0xAF, 0x05, 0x74, 0x20, 0x2F, 0xF5, 0x82, +0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xE0, 0x54, 0xC0, 0xF0, 0x71, 0x4E, 0x54, 0xC0, 0xF0, 0x90, 0x00, +0x8B, 0xE0, 0xD3, 0x94, 0x03, 0x74, 0x10, 0x40, 0x07, 0x51, 0xA7, 0x74, 0x04, 0xF0, 0x80, 0x04, +0x51, 0xA7, 0xE4, 0xF0, 0xAF, 0x05, 0x51, 0xB0, 0xE0, 0x54, 0x01, 0xFE, 0x90, 0x95, 0x2F, 0xE0, +0x25, 0xE0, 0x25, 0xE0, 0xFB, 0xEE, 0x44, 0x02, 0x4B, 0xFE, 0x51, 0xB0, 0xEE, 0xF0, 0x74, 0x11, +0x2F, 0x71, 0x93, 0x74, 0xFF, 0xF0, 0x74, 0x29, 0x2F, 0x71, 0x7E, 0x54, 0xF7, 0xF0, 0xAE, 0x04, +0xAF, 0x05, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x2D, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0x22, +0x74, 0x12, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0x22, 0x90, 0x8D, 0x09, 0xE0, 0xFF, +0x90, 0x95, 0x02, 0xE0, 0xFB, 0x7D, 0x01, 0x51, 0x1D, 0x90, 0x95, 0x03, 0xEE, 0xF0, 0xFC, 0xA3, +0xEF, 0xF0, 0xFD, 0x90, 0x95, 0x01, 0xE0, 0xFF, 0x71, 0x5A, 0x90, 0x95, 0x03, 0xE0, 0xFE, 0xA3, +0xE0, 0xFF, 0x90, 0x81, 0x00, 0xE0, 0x54, 0x0F, 0xFD, 0xAC, 0x07, 0x71, 0x42, 0x44, 0x01, 0xF0, +0x71, 0x42, 0x54, 0xFB, 0xF0, 0xAC, 0x07, 0x74, 0x12, 0x2C, 0x51, 0xB3, 0xE0, 0x44, 0xFA, 0xF0, +0x74, 0x11, 0x2C, 0x71, 0x93, 0xE0, 0x44, 0x1F, 0xF0, 0xAC, 0x07, 0x74, 0x06, 0x2C, 0xB1, 0xED, +0x44, 0x0E, 0xF0, 0x90, 0x04, 0xA7, 0xE4, 0xF0, 0x90, 0x04, 0xA6, 0xF0, 0x90, 0x04, 0xA5, 0x74, +0xFF, 0xF0, 0x90, 0x04, 0xA4, 0x74, 0xFD, 0xF0, 0x74, 0x14, 0x2C, 0x71, 0x3A, 0xE0, 0x54, 0xC0, +0x4D, 0xFD, 0x74, 0x14, 0x2F, 0x71, 0x3A, 0xED, 0xF0, 0x22, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, +0x83, 0x22, 0x74, 0x0D, 0x2C, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xE0, 0x22, 0x74, 0x21, +0x2F, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xE0, 0x22, 0x71, 0x87, 0x54, 0x3F, 0xF0, 0xEF, +0x60, 0x0E, 0x74, 0x29, 0x2D, 0x71, 0x7E, 0x44, 0x10, 0xF0, 0x71, 0x87, 0x44, 0x80, 0xF0, 0x22, +0x74, 0x29, 0x2D, 0x71, 0x7E, 0x54, 0xEF, 0xF0, 0x71, 0x87, 0x44, 0x40, 0xF0, 0x22, 0xF5, 0x82, +0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xE0, 0x22, 0x74, 0x09, 0x2D, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, +0x83, 0xE0, 0x22, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0x22, 0xEF, 0xF0, 0x90, 0x93, 0x3A, +0xE0, 0x04, 0xF0, 0x22, 0x90, 0x94, 0x54, 0xE0, 0x90, 0x95, 0x21, 0xF0, 0x22, 0xF1, 0xCC, 0x7D, +0x04, 0x7F, 0x01, 0x02, 0x53, 0xF7, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x93, 0x4A, +0xEF, 0xF0, 0x12, 0x7F, 0xD1, 0x74, 0x10, 0x2F, 0xFF, 0x90, 0x93, 0x4A, 0xE0, 0x25, 0xE0, 0x25, +0xE0, 0x2F, 0xFF, 0x24, 0x00, 0x71, 0xF0, 0x75, 0x43, 0x04, 0x7B, 0x01, 0x7A, 0x94, 0x79, 0x5C, +0x12, 0x34, 0x62, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x12, 0x7F, 0xD6, 0x7E, 0x00, 0x74, 0x00, 0x2F, +0xF9, 0xE4, 0x34, 0xFC, 0x75, 0x40, 0x01, 0xF5, 0x41, 0x89, 0x42, 0x22, 0x12, 0x7D, 0x67, 0xE4, +0xF1, 0xC1, 0x12, 0xA8, 0xD4, 0x91, 0x71, 0x90, 0x93, 0x3E, 0xEF, 0xF0, 0x90, 0x93, 0x3C, 0xA3, +0xE0, 0x24, 0x38, 0xF9, 0xE4, 0x34, 0xFC, 0x71, 0xF4, 0x75, 0x43, 0x06, 0x7B, 0x01, 0x7A, 0x8E, +0x79, 0xE0, 0x91, 0x63, 0x12, 0x55, 0xEC, 0x24, 0x3E, 0xF9, 0xE4, 0x34, 0xFC, 0x71, 0xF4, 0x75, +0x43, 0x04, 0x7B, 0x01, 0x7A, 0x8E, 0x79, 0xE6, 0x91, 0x63, 0x12, 0x55, 0xEC, 0x91, 0x6A, 0x71, +0xF4, 0x75, 0x43, 0x06, 0x7B, 0x01, 0x7A, 0x8E, 0x79, 0xEA, 0x91, 0x63, 0x12, 0x55, 0xEC, 0x24, +0x48, 0xF9, 0xE4, 0x34, 0xFC, 0x71, 0xF4, 0x75, 0x43, 0x04, 0x7B, 0x01, 0x7A, 0x8E, 0x79, 0xF0, +0x02, 0x34, 0x62, 0x12, 0x34, 0x62, 0x90, 0x93, 0x3C, 0x22, 0x24, 0x42, 0xF9, 0xE4, 0x34, 0xFC, +0x22, 0xE4, 0xFE, 0xEF, 0x30, 0xE7, 0x04, 0x7C, 0x02, 0x80, 0x02, 0xE4, 0xFC, 0xED, 0x30, 0xE6, +0x09, 0xAF, 0x03, 0x12, 0xA3, 0xE8, 0xAE, 0x07, 0x80, 0x02, 0xE4, 0xFE, 0xEC, 0x24, 0x18, 0x2E, +0xFF, 0x22, 0xF1, 0xD2, 0xE4, 0xA3, 0xF0, 0x90, 0x93, 0x3A, 0xE0, 0xFD, 0xC3, 0x94, 0x04, 0x50, +0x25, 0x90, 0x93, 0x39, 0xE0, 0x24, 0x10, 0x12, 0x6E, 0x9F, 0xFE, 0x12, 0x6B, 0x7F, 0x90, 0x93, +0x3A, 0xE0, 0x24, 0x7C, 0xF5, 0x82, 0xE4, 0x34, 0x90, 0xF5, 0x83, 0xE0, 0x6F, 0x60, 0x03, 0x7F, +0x00, 0x22, 0x71, 0x9D, 0x80, 0xD1, 0x7F, 0x01, 0x22, 0x90, 0x8D, 0xFB, 0x12, 0x8F, 0xB7, 0x30, +0xE0, 0x33, 0x90, 0x90, 0xCE, 0x12, 0x48, 0xF4, 0xEC, 0x4D, 0x4E, 0x4F, 0x60, 0x13, 0x90, 0x93, +0x0E, 0x12, 0x49, 0x00, 0xD3, 0x12, 0x48, 0xE3, 0x40, 0x07, 0xB1, 0x06, 0x90, 0x90, 0xD2, 0x80, +0x05, 0xB1, 0x06, 0x90, 0x90, 0xCA, 0x12, 0x49, 0x00, 0x12, 0x48, 0x7A, 0x90, 0x93, 0x4B, 0x12, +0x08, 0x6D, 0x12, 0x50, 0x31, 0x22, 0xE4, 0x7F, 0xE8, 0x7E, 0x03, 0xFD, 0xFC, 0x22, 0xD3, 0x10, +0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x8D, 0xF6, 0xE0, 0xFF, 0x70, 0x06, 0xA3, 0xE0, 0x64, 0x09, +0x60, 0x0A, 0xEF, 0x14, 0xFF, 0x90, 0x8D, 0xF7, 0xE0, 0xB5, 0x07, 0x04, 0x7F, 0x01, 0x80, 0x02, +0x7F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A3, 0xEF, 0xF0, 0x22, 0xF5, 0x82, 0xE4, +0x34, 0xFC, 0xF5, 0x83, 0xE0, 0x22, 0xE0, 0xFF, 0x12, 0x7F, 0xD6, 0x7C, 0x00, 0xAD, 0x07, 0x22, +0xE4, 0xFD, 0xFC, 0xEF, 0x60, 0x3D, 0x90, 0x93, 0x18, 0xB1, 0xF6, 0x12, 0x5F, 0xE4, 0xF1, 0x65, +0x90, 0x93, 0x3C, 0x12, 0x57, 0x05, 0x75, 0x43, 0x40, 0x7B, 0x01, 0x7A, 0x8F, 0x79, 0x96, 0x12, +0x34, 0x62, 0xE4, 0xFD, 0x7F, 0x03, 0x12, 0x30, 0x0A, 0x90, 0x93, 0x19, 0xE0, 0xFE, 0xE4, 0x78, +0x03, 0xCE, 0xC3, 0x13, 0xCE, 0x13, 0xD8, 0xF9, 0xFF, 0x12, 0x39, 0x00, 0x7D, 0x01, 0x7F, 0x03, +0x12, 0x30, 0x0A, 0x22, 0x12, 0x7F, 0xD1, 0x74, 0x00, 0x2F, 0x12, 0x5D, 0x91, 0xE0, 0x90, 0x94, +0x4C, 0xF0, 0x74, 0x01, 0x2F, 0x12, 0x5E, 0xE1, 0xE0, 0x90, 0x94, 0x4D, 0xF0, 0x74, 0x02, 0x2F, +0xD1, 0x9A, 0x90, 0x94, 0x4E, 0xF0, 0x74, 0x03, 0x2F, 0xD1, 0xAC, 0x90, 0x94, 0x4F, 0xD1, 0xC7, +0xE0, 0x90, 0x94, 0x50, 0xF0, 0x74, 0x05, 0x2F, 0xD1, 0xA3, 0x90, 0x94, 0x51, 0xF0, 0x74, 0x06, +0x2F, 0xB1, 0xED, 0x90, 0x94, 0x52, 0xF0, 0x74, 0x07, 0x2F, 0xD1, 0xBE, 0x90, 0x94, 0x53, 0xF0, +0x74, 0x08, 0x2F, 0xD1, 0xB5, 0x90, 0x94, 0x54, 0xF0, 0x22, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, +0x83, 0xE0, 0x22, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xE0, 0x22, 0xF5, 0x82, 0xE4, 0x34, +0xFC, 0xF5, 0x83, 0xE0, 0x22, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xE0, 0x22, 0xF5, 0x82, +0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xE0, 0x22, 0xF0, 0x74, 0x04, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0xFC, +0xF5, 0x83, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x02, 0x09, 0xE0, 0xFD, 0x12, +0x7F, 0xDE, 0xFE, 0x90, 0x8D, 0xFB, 0x12, 0x7B, 0x79, 0x54, 0x04, 0xFC, 0xEF, 0x54, 0xFB, 0x4C, +0xFF, 0x90, 0x8D, 0xFB, 0xF1, 0xDB, 0x12, 0x76, 0xE5, 0xFF, 0xED, 0x2F, 0x90, 0x8D, 0xFC, 0x12, +0x77, 0xBA, 0xFF, 0xAE, 0x05, 0xED, 0x2F, 0x90, 0x8D, 0xFD, 0xF0, 0x90, 0x8D, 0xFB, 0xE0, 0xFF, +0x20, 0xE0, 0x08, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x30, 0xE0, 0x09, 0x90, 0x06, 0x31, 0xE0, 0x44, +0x40, 0xF0, 0xD1, 0x44, 0x90, 0x8D, 0xFB, 0xE0, 0xFF, 0x30, 0xE0, 0x34, 0x90, 0x06, 0x32, 0xE0, +0x44, 0x01, 0xF0, 0x90, 0x06, 0x09, 0xE0, 0x54, 0xFE, 0x12, 0xA8, 0x4B, 0xEF, 0x13, 0x13, 0x54, +0x3F, 0x30, 0xE0, 0x08, 0xF1, 0xB9, 0x90, 0x94, 0x64, 0x74, 0x01, 0xF0, 0x7D, 0x08, 0xE4, 0xFF, +0x12, 0x78, 0x7A, 0x90, 0x93, 0x4B, 0x12, 0x08, 0x79, 0x00, 0x00, 0x27, 0x10, 0x12, 0x50, 0x31, +0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0x93, 0x3C, 0x02, 0x49, 0x21, 0xE0, 0xFF, 0x13, 0x13, 0x54, +0x3F, 0x22, 0x90, 0x93, 0x24, 0xF1, 0x6B, 0x30, 0xE0, 0x0E, 0x7B, 0x00, 0x7A, 0x00, 0x79, 0x00, +0x12, 0xA9, 0xB4, 0x04, 0xF0, 0x02, 0x55, 0xF3, 0x02, 0x57, 0x23, 0x7F, 0x58, 0x7E, 0x0C, 0x02, +0x65, 0xDA, 0x7F, 0x14, 0x7E, 0x00, 0x02, 0x3D, 0x7A, 0x90, 0x02, 0x86, 0xE0, 0x54, 0xFB, 0xF0, +0x22, 0x90, 0x8E, 0xC0, 0xE0, 0xC4, 0x54, 0x0F, 0x22, 0xF5, 0x82, 0xE4, 0x34, 0x91, 0xF5, 0x83, +0x22, 0xE4, 0x90, 0x93, 0x4F, 0xF0, 0x7F, 0x04, 0x22, 0x90, 0x02, 0x86, 0xE0, 0x44, 0x04, 0xF0, +0x22, 0xF0, 0xA3, 0xEF, 0xF0, 0x90, 0x93, 0x3C, 0x22, 0x12, 0x4C, 0xF1, 0xE4, 0xFD, 0xFF, 0x02, +0x54, 0x6C, 0x90, 0x93, 0x38, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0x22, 0xF0, 0xEE, 0x54, 0x08, 0xFE, +0xEF, 0x54, 0xF7, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x12, 0x7F, 0xEF, 0xD0, 0xD0, +0x92, 0xAF, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xC0, 0x07, 0xC0, 0x05, 0x90, 0x94, +0xEB, 0x12, 0x48, 0xF4, 0x90, 0xAA, 0x9C, 0x12, 0x08, 0x6D, 0xD0, 0x05, 0xD0, 0x07, 0x12, 0x32, +0x34, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xE4, 0xFF, 0xEF, +0x12, 0x51, 0x47, 0xE4, 0xF0, 0x0F, 0xEF, 0xB4, 0x08, 0xF5, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, +0x01, 0x53, 0xE4, 0xF0, 0xFF, 0xEF, 0x12, 0x51, 0x47, 0xE4, 0xF0, 0x0F, 0xEF, 0xB4, 0x08, 0xF5, +0x22, 0x90, 0x8E, 0xC0, 0xE0, 0xFF, 0xC4, 0x54, 0x0F, 0x30, 0xE0, 0x05, 0x11, 0x2F, 0x12, 0x7A, +0x95, 0x22, 0x90, 0x93, 0x3C, 0xEC, 0xF0, 0xA3, 0xED, 0xF0, 0x90, 0x93, 0x3A, 0xF1, 0x70, 0x90, +0x93, 0x60, 0xF0, 0xEF, 0x24, 0x24, 0xFF, 0xE4, 0x3E, 0xFE, 0xC0, 0x06, 0x51, 0xC6, 0xD0, 0x06, +0xE4, 0xFB, 0xFA, 0x51, 0x96, 0x4E, 0x60, 0x3E, 0xE0, 0x24, 0x01, 0xFF, 0x90, 0x93, 0x61, 0x12, +0x6D, 0x63, 0x90, 0x93, 0x3F, 0x51, 0xAF, 0x90, 0x93, 0x3F, 0x51, 0xA5, 0xFE, 0xC3, 0x9F, 0x50, +0x25, 0x90, 0x93, 0x62, 0xE0, 0x24, 0x02, 0xFD, 0x90, 0x93, 0x61, 0xE0, 0x34, 0x00, 0xFC, 0xEE, +0x7E, 0x00, 0x2D, 0x12, 0x6B, 0x79, 0x90, 0x93, 0x3E, 0xE0, 0x24, 0x40, 0xF5, 0x82, 0xE4, 0x34, +0x93, 0x12, 0x7F, 0xC6, 0x80, 0xD1, 0x51, 0xB7, 0xC0, 0x06, 0x51, 0xC6, 0xD0, 0x06, 0x7B, 0x03, +0x51, 0x93, 0x90, 0x93, 0x3B, 0xE0, 0x24, 0x22, 0x51, 0xBD, 0x90, 0x93, 0x61, 0x12, 0x6F, 0xE8, +0xEF, 0x20, 0xE4, 0x02, 0x21, 0x88, 0x90, 0x93, 0x60, 0xE0, 0x04, 0xF0, 0x51, 0xB7, 0xC0, 0x06, +0x51, 0xC6, 0xD0, 0x06, 0x7B, 0x30, 0x51, 0x93, 0x4E, 0x60, 0x45, 0xE0, 0x24, 0x08, 0xFF, 0x90, +0x93, 0x61, 0x12, 0x6D, 0x63, 0x51, 0xAC, 0x51, 0xA2, 0xC3, 0x9F, 0x50, 0x33, 0x90, 0x93, 0x62, +0xE0, 0x24, 0x0D, 0xFF, 0x90, 0x93, 0x61, 0x12, 0x6D, 0x63, 0x90, 0x93, 0x63, 0xEF, 0xF0, 0xBF, +0x02, 0x09, 0x90, 0x93, 0x60, 0xE0, 0x24, 0x20, 0xF0, 0x80, 0x0E, 0x90, 0x93, 0x63, 0xE0, 0xB4, +0x04, 0x07, 0x90, 0x93, 0x60, 0xE0, 0x24, 0x40, 0xF0, 0x51, 0xE4, 0x12, 0x7F, 0xCA, 0x80, 0xC7, +0x51, 0xB7, 0xC0, 0x06, 0x51, 0xC6, 0xD0, 0x06, 0x7B, 0xDD, 0x7A, 0x00, 0x7D, 0x01, 0x51, 0x97, +0x4E, 0x60, 0x4A, 0xE0, 0x24, 0x0C, 0xFF, 0x90, 0x93, 0x61, 0x12, 0x6D, 0x63, 0x51, 0xAC, 0x51, +0xA2, 0xC3, 0x9F, 0x50, 0x38, 0x90, 0x93, 0x62, 0xE0, 0x24, 0x11, 0xFF, 0x90, 0x93, 0x61, 0x12, +0x6D, 0x63, 0x90, 0x93, 0x63, 0xEF, 0xF0, 0xBF, 0x02, 0x09, 0x90, 0x93, 0x60, 0xE0, 0x24, 0x02, +0xF0, 0x80, 0x0E, 0x90, 0x93, 0x63, 0xE0, 0xB4, 0x04, 0x07, 0x90, 0x93, 0x60, 0xE0, 0x24, 0x04, +0xF0, 0x51, 0xE4, 0x12, 0x7F, 0xCA, 0x80, 0xC7, 0xE4, 0x90, 0x93, 0x60, 0xF0, 0x90, 0x90, 0xC6, +0xE0, 0x90, 0x04, 0xFD, 0x51, 0xB0, 0x90, 0x90, 0xC6, 0x51, 0xA5, 0xFE, 0xC3, 0x9F, 0x50, 0x5F, +0xF1, 0x8E, 0xF5, 0x83, 0xE0, 0xFF, 0x90, 0x93, 0x3F, 0xE0, 0xFE, 0x6F, 0x70, 0x4C, 0x90, 0x04, +0xFC, 0xE0, 0x04, 0xF0, 0x90, 0x93, 0x3E, 0xE0, 0x24, 0xE6, 0xF5, 0x82, 0xE4, 0x34, 0x90, 0xF5, +0x83, 0xE0, 0xFF, 0x90, 0x93, 0x60, 0xE0, 0xFD, 0x4F, 0x60, 0x04, 0xED, 0x5F, 0x60, 0x2B, 0xEE, +0xFF, 0x7E, 0x00, 0xC0, 0x06, 0xC0, 0x07, 0x90, 0x93, 0x3E, 0xE0, 0x12, 0xA9, 0x81, 0x78, 0x40, +0x7C, 0x93, 0x7D, 0x01, 0xD0, 0x07, 0xD0, 0x06, 0x12, 0x4A, 0xD6, 0xEF, 0x70, 0x0C, 0x90, 0x01, +0xC7, 0x74, 0x55, 0xF0, 0x7F, 0x01, 0x71, 0x36, 0x11, 0x41, 0x12, 0x7F, 0xCA, 0x80, 0x97, 0x22, +0x90, 0x93, 0x65, 0x91, 0xBA, 0xA3, 0xEA, 0xF0, 0xA3, 0xEB, 0xF0, 0xC3, 0x90, 0x93, 0x6B, 0xE0, +0x94, 0x01, 0x90, 0x93, 0x6A, 0xE0, 0x94, 0x00, 0x50, 0x02, 0x80, 0x73, 0xE4, 0x90, 0x93, 0x6E, +0xF0, 0xA3, 0xF0, 0x51, 0xDB, 0xE4, 0xFD, 0x12, 0x6B, 0x7F, 0x90, 0x93, 0x68, 0xE0, 0x70, 0x03, +0xA3, 0xE0, 0x6F, 0x70, 0x17, 0x90, 0x93, 0x66, 0xE0, 0x24, 0x02, 0xB1, 0x4C, 0xFE, 0x90, 0x93, +0x67, 0xE0, 0xFD, 0xF1, 0xCA, 0xBF, 0x01, 0x02, 0x41, 0xDB, 0x80, 0x00, 0x90, 0x93, 0x66, 0xE0, +0x24, 0x01, 0xFF, 0x90, 0x93, 0x65, 0x12, 0x6D, 0x63, 0x7E, 0x00, 0x90, 0x93, 0x6C, 0xEE, 0xF0, +0xA3, 0xEF, 0xF0, 0x24, 0x02, 0xFF, 0xEE, 0x33, 0xFE, 0x90, 0x93, 0x65, 0x8F, 0xF0, 0x12, 0x08, +0xD6, 0x90, 0x93, 0x6E, 0xEE, 0x8F, 0xF0, 0x12, 0x08, 0xD6, 0x90, 0x93, 0x6A, 0xE0, 0xFE, 0xA3, +0xE0, 0xFF, 0xC3, 0x90, 0x93, 0x6F, 0xE0, 0x9F, 0x90, 0x93, 0x6E, 0xE0, 0x9E, 0x40, 0x94, 0xE4, +0xFE, 0xFF, 0x22, 0x7A, 0x00, 0xE4, 0xFD, 0x51, 0x00, 0x90, 0x93, 0x61, 0xEE, 0xF0, 0xA3, 0xEF, +0xF0, 0x22, 0x90, 0x93, 0x64, 0xE0, 0xFF, 0x90, 0x93, 0x3E, 0xE0, 0x22, 0x90, 0x93, 0x64, 0xEF, +0xF0, 0xE4, 0x90, 0x93, 0x3E, 0xF0, 0x22, 0x90, 0x93, 0x3B, 0xE0, 0x24, 0x24, 0xFF, 0x90, 0x93, +0x3A, 0xE0, 0x34, 0x00, 0xFE, 0x22, 0x90, 0x93, 0x3D, 0xE0, 0x24, 0xDC, 0xFE, 0x90, 0x93, 0x3C, +0xE0, 0x34, 0xFF, 0x90, 0x93, 0x6A, 0xF0, 0xA3, 0xCE, 0xF0, 0x22, 0x90, 0x93, 0x65, 0xE0, 0xFE, +0xA3, 0xE0, 0xFF, 0x22, 0x90, 0x93, 0x61, 0xE4, 0x75, 0xF0, 0x04, 0x02, 0x08, 0xD6, 0x51, 0xF2, +0x01, 0x41, 0x90, 0x8E, 0xC0, 0x71, 0xFC, 0x30, 0xE0, 0x02, 0x71, 0x16, 0x22, 0x12, 0x87, 0xD2, +0x90, 0x94, 0x47, 0xE0, 0x64, 0x01, 0xF0, 0xE0, 0x24, 0xFD, 0x90, 0x01, 0xC4, 0xF0, 0x74, 0x8A, +0xA3, 0xF0, 0x91, 0xAE, 0x01, 0x52, 0x71, 0x78, 0xE4, 0x90, 0x93, 0x1E, 0x12, 0x4F, 0x6D, 0x90, +0x90, 0x70, 0x12, 0x4F, 0x6B, 0xA3, 0x12, 0x4F, 0x6B, 0x90, 0x90, 0x82, 0xF0, 0xA3, 0xF0, 0x90, +0x90, 0xC4, 0xF0, 0xA3, 0xF0, 0x22, 0x90, 0x95, 0x47, 0xEF, 0xF0, 0x90, 0x8D, 0x06, 0xE0, 0x64, +0x02, 0x70, 0x23, 0x90, 0x95, 0x47, 0xE0, 0xFD, 0x64, 0x01, 0x70, 0x29, 0x12, 0x6F, 0x95, 0x90, +0x8E, 0xC4, 0xE0, 0x12, 0x6F, 0xF0, 0x30, 0xE0, 0x09, 0x90, 0x01, 0x4D, 0xE0, 0x64, 0x80, 0xF0, +0x80, 0x13, 0xAF, 0x05, 0x80, 0x0C, 0x90, 0x06, 0x90, 0xE0, 0x44, 0x01, 0xF0, 0x90, 0x95, 0x47, +0xE0, 0xFF, 0x12, 0x4E, 0x17, 0x71, 0x8A, 0xF0, 0x90, 0x8E, 0xC0, 0xE0, 0x54, 0xBF, 0xF0, 0x22, +0x90, 0x01, 0xC7, 0x74, 0x10, 0xF0, 0x7F, 0x01, 0x71, 0x36, 0x90, 0x93, 0x28, 0xE0, 0x54, 0xFE, +0x22, 0x90, 0x93, 0x28, 0xE0, 0x30, 0xE0, 0x3C, 0x90, 0x93, 0x2D, 0xE0, 0xFD, 0x60, 0x35, 0xF1, +0xA2, 0x80, 0x05, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, 0xF9, 0xFF, 0x90, 0x04, 0xE0, 0xE0, 0xFB, +0xEF, 0x5B, 0x60, 0x0B, 0xE4, 0x90, 0x93, 0x2D, 0xF0, 0x90, 0x93, 0x2F, 0x04, 0xF0, 0x22, 0x90, +0x93, 0x2A, 0xE0, 0xD3, 0x9D, 0x50, 0x04, 0x71, 0x80, 0xF0, 0x22, 0x12, 0x57, 0x23, 0x90, 0x93, +0x2D, 0xE0, 0x04, 0xF0, 0x22, 0x90, 0x8E, 0x11, 0x71, 0xFC, 0x30, 0xE0, 0x1B, 0xEF, 0x54, 0xBF, +0x91, 0x33, 0x30, 0xE0, 0x06, 0xE0, 0x44, 0x01, 0xF0, 0x80, 0x0A, 0xE0, 0x54, 0xFE, 0xF0, 0x12, +0x77, 0xEE, 0x74, 0x04, 0xF0, 0x12, 0x77, 0xC1, 0xE4, 0xFF, 0x80, 0x95, 0xE0, 0xFF, 0xC4, 0x13, +0x13, 0x54, 0x03, 0x22, 0x90, 0x8E, 0x11, 0xE0, 0xFF, 0x12, 0x6F, 0xF0, 0x30, 0xE0, 0x20, 0xEF, +0x54, 0x7F, 0x91, 0x33, 0x30, 0xE1, 0x06, 0xE0, 0x44, 0x02, 0xF0, 0x80, 0x09, 0xE0, 0x54, 0xFD, +0xF0, 0x12, 0x77, 0xEE, 0x04, 0xF0, 0x90, 0x8E, 0x15, 0xE0, 0x60, 0x03, 0x12, 0x77, 0xC1, 0x7F, +0x01, 0x61, 0x91, 0xF0, 0x90, 0x04, 0xE0, 0xE0, 0x90, 0x8E, 0x12, 0x22, 0x12, 0x87, 0x65, 0x12, +0xA7, 0x1C, 0x12, 0x76, 0xD9, 0x12, 0x7F, 0xDE, 0xFE, 0x71, 0x8A, 0x4E, 0xF0, 0xEF, 0xC3, 0x13, +0x30, 0xE0, 0x20, 0x12, 0x76, 0xE7, 0x90, 0x93, 0x29, 0x12, 0x77, 0xBA, 0x90, 0x93, 0x2A, 0xF0, +0x12, 0x06, 0x89, 0x54, 0x04, 0xFF, 0x90, 0x93, 0x28, 0xE0, 0x54, 0xFB, 0x12, 0x77, 0xD2, 0x90, +0x93, 0x2B, 0xF0, 0x22, 0x91, 0xB7, 0xE4, 0xA3, 0xF0, 0xB1, 0x09, 0x50, 0x1A, 0x91, 0xAE, 0xB1, +0x12, 0xE0, 0x24, 0xA4, 0xF5, 0x82, 0xE4, 0x34, 0x90, 0xF5, 0x83, 0xE0, 0xB5, 0x07, 0x1C, 0x90, +0x93, 0x3B, 0xE0, 0x04, 0xF0, 0x80, 0xE2, 0x90, 0x06, 0x32, 0xE0, 0x44, 0x80, 0xF0, 0x90, 0x01, +0xC7, 0x74, 0x30, 0xF0, 0x7F, 0x01, 0x71, 0x36, 0x7F, 0x01, 0x22, 0x7F, 0x00, 0x22, 0x90, 0x93, +0x38, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x22, 0x90, 0x93, 0x38, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0xA3, +0xED, 0xF0, 0x22, 0x91, 0xB7, 0x90, 0x90, 0x76, 0xE0, 0x70, 0x02, 0xA3, 0xE0, 0x60, 0x26, 0xE4, +0x90, 0x93, 0x3B, 0xF0, 0xB1, 0x09, 0x50, 0x20, 0x91, 0xAE, 0xB1, 0x12, 0xE0, 0x24, 0x84, 0xF5, +0x82, 0xE4, 0x34, 0x90, 0xF5, 0x83, 0xE0, 0x6F, 0x60, 0x03, 0x7F, 0x00, 0x22, 0x90, 0x93, 0x3B, +0xE0, 0x04, 0xF0, 0x80, 0xDF, 0x7F, 0x00, 0x22, 0x90, 0x06, 0x32, 0xE0, 0x44, 0x40, 0xF0, 0xE4, +0x90, 0x90, 0x82, 0xF0, 0xA3, 0xF0, 0x7F, 0x01, 0x22, 0x90, 0x93, 0x3B, 0xE0, 0xFD, 0xC3, 0x94, +0x02, 0x22, 0xED, 0x24, 0x1C, 0xFD, 0x12, 0x6B, 0x7F, 0x90, 0x93, 0x3B, 0x22, 0x90, 0x93, 0x65, +0x91, 0xBA, 0x2F, 0xFF, 0xE4, 0x3E, 0xCF, 0x24, 0x06, 0xCF, 0x12, 0x6D, 0x64, 0xBF, 0x86, 0x19, +0x90, 0x93, 0x67, 0xE0, 0xFF, 0x90, 0x93, 0x66, 0xE0, 0x2F, 0xB1, 0x4C, 0xCF, 0x24, 0x07, 0xCF, +0x12, 0x6D, 0x64, 0xBF, 0xDD, 0x03, 0x7F, 0x01, 0x22, 0x7F, 0x00, 0x22, 0xFF, 0x90, 0x93, 0x65, +0xE0, 0x34, 0x00, 0x22, 0x12, 0xA3, 0x40, 0xAD, 0x07, 0x90, 0x01, 0xC4, 0x74, 0x54, 0xF0, 0x74, +0x8D, 0xA3, 0xF0, 0xED, 0x64, 0x01, 0x60, 0x1D, 0x12, 0x6F, 0x95, 0xED, 0xB4, 0x02, 0x08, 0x90, +0x01, 0xC7, 0x74, 0x40, 0xF0, 0x80, 0x0A, 0xED, 0xB4, 0x04, 0x06, 0x90, 0x01, 0xC7, 0x74, 0x41, +0xF0, 0x7F, 0x01, 0x61, 0x36, 0xD1, 0xC0, 0x90, 0x02, 0x87, 0xE0, 0x70, 0xF8, 0x90, 0x06, 0x90, +0xE0, 0x44, 0x02, 0xF0, 0x74, 0x54, 0x04, 0x90, 0x01, 0xC4, 0xF0, 0x74, 0x8D, 0xA3, 0xF0, 0x22, +0x90, 0x93, 0x28, 0xE0, 0x30, 0xE0, 0x6B, 0x90, 0x93, 0x2C, 0xE0, 0x04, 0xF0, 0x90, 0x93, 0x2F, +0xE0, 0x64, 0x01, 0x70, 0x20, 0x90, 0x93, 0x28, 0xE0, 0x13, 0x13, 0x54, 0x3F, 0x30, 0xE0, 0x15, +0x90, 0x93, 0x2E, 0xE0, 0x70, 0x0F, 0x90, 0x93, 0x2B, 0xE0, 0xFF, 0xA3, 0xE0, 0xC3, 0x9F, 0x40, +0x04, 0x71, 0x80, 0xF0, 0x22, 0x90, 0x93, 0x2C, 0xE0, 0xFF, 0x90, 0x93, 0x29, 0xE0, 0xD3, 0x9F, +0x50, 0x30, 0x90, 0x06, 0x92, 0xE0, 0x20, 0xE2, 0x1A, 0x90, 0x93, 0x2E, 0xE0, 0x70, 0x14, 0x7D, +0x08, 0xFF, 0x12, 0x57, 0x27, 0x90, 0x93, 0x2D, 0xE0, 0x04, 0xF0, 0x90, 0x93, 0x27, 0xE0, 0x04, +0xF0, 0x80, 0x06, 0x90, 0x06, 0x92, 0x74, 0x04, 0xF0, 0xE4, 0x90, 0x93, 0x2C, 0xF0, 0x90, 0x93, +0x2E, 0xF0, 0x22, 0x90, 0x8E, 0x15, 0xE0, 0x60, 0x46, 0x90, 0x8E, 0x11, 0xE0, 0x30, 0xE0, 0x17, +0x90, 0x8E, 0x2C, 0xE0, 0x04, 0xF1, 0xD7, 0xCE, 0xC3, 0x13, 0xCE, 0x13, 0xD8, 0xF9, 0xFF, 0x90, +0x8E, 0x4C, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0xF1, 0xB4, 0x30, 0xE0, 0x0C, 0x90, 0x01, 0x3B, 0xE0, +0x30, 0xE4, 0x05, 0x12, 0x79, 0x5B, 0xF1, 0x77, 0x90, 0x95, 0x45, 0xE0, 0x04, 0xF0, 0xE0, 0xC3, +0x94, 0x80, 0x40, 0x0B, 0x90, 0x01, 0x98, 0xE0, 0x54, 0xFE, 0xF0, 0xE0, 0x44, 0x01, 0xF0, 0xB1, +0xA0, 0x12, 0x73, 0xA0, 0xE4, 0x90, 0x93, 0x27, 0xF0, 0xF1, 0xAA, 0x30, 0xE0, 0x51, 0x90, 0x90, +0x70, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x7C, 0x00, 0x7D, 0x64, 0x12, 0x07, 0x15, 0x90, 0x90, 0xC4, +0xE0, 0x6E, 0x70, 0x03, 0xA3, 0xE0, 0x6F, 0x60, 0x0A, 0x90, 0x90, 0xC4, 0xE4, 0x75, 0xF0, 0x01, +0x02, 0x08, 0xD6, 0x90, 0x90, 0x74, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x90, 0x90, 0x82, 0xE0, 0xB5, +0x06, 0x13, 0xA3, 0xE0, 0xB5, 0x07, 0x0E, 0xEF, 0x4E, 0x60, 0x0A, 0x90, 0x01, 0xC7, 0x74, 0x31, +0xF0, 0x7F, 0x01, 0x61,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00, 0x5E, 0xFE, 0xED, 0x5F, 0x22, +0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0xE4, 0x22, 0x7D, 0x01, 0x7F, 0x02, 0x02, 0x79, 0x5F, 0xEA, 0x90, +0xFD, 0x11, 0xF0, 0xAF, 0x03, 0x22, 0x12, 0x08, 0xD6, 0x90, 0x8D, 0xF8, 0xE0, 0x22, 0x74, 0xD6, +0x2E, 0xF5, 0x82, 0xE4, 0x34, 0x90, 0x22, 0x90, 0x01, 0x1F, 0xE0, 0xFE, 0x90, 0x01, 0x1E, 0x22, +0xE0, 0xFF, 0x74, 0x01, 0x7E, 0x00, 0xA8, 0x07, 0x08, 0x22, 0x90, 0x8E, 0xC0, 0xE0, 0xC4, 0x13, +0x13, 0x54, 0x03, 0x22, 0x90, 0x8E, 0x12, 0xE0, 0xFF, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x22, 0xE0, +0x24, 0x01, 0xFF, 0x90, 0x8D, 0xF8, 0xE0, 0x34, 0x00, 0x22, 0xED, 0x14, 0x60, 0x06, 0x04, 0x70, +0x03, 0x7F, 0x01, 0x22, 0x7F, 0x01, 0x22, 0xF0, 0x90, 0x05, 0x62, 0xE0, 0xFE, 0x90, 0x05, 0x61, +0xE0, 0xFD, 0xED, 0x78, 0x02, 0x22, 0x90, 0x02, 0x09, 0xE0, 0xF5, 0x51, 0x12, 0x06, 0x89, 0x25, +0x51, 0x90, 0x8D, 0x07, 0x12, 0x76, 0xE6, 0x25, 0x51, 0x90, 0x8D, 0x08, 0x12, 0x77, 0xBA, 0x25, +0x51, 0x90, 0x8D, 0x09, 0x12, 0x77, 0xD3, 0x25, 0x51, 0x90, 0x8D, 0x0A, 0x11, 0x25, 0x25, 0x51, +0x90, 0x8D, 0x0B, 0x51, 0x08, 0x25, 0x51, 0x90, 0x8D, 0x0C, 0xF0, 0x12, 0x76, 0xDF, 0x25, 0x51, +0x90, 0x8D, 0x0D, 0xF0, 0x22, 0xF0, 0x90, 0x00, 0x04, 0x02, 0x06, 0xA2, 0x90, 0x94, 0xB1, 0x12, +0x49, 0x21, 0x12, 0x06, 0x89, 0x90, 0x94, 0xB6, 0x12, 0x76, 0xE6, 0x90, 0x94, 0xB7, 0x11, 0x25, +0x90, 0x94, 0xB8, 0x51, 0x08, 0x90, 0x94, 0xB9, 0xF0, 0x12, 0x76, 0xDF, 0x90, 0x94, 0xBA, 0xF0, +0x90, 0x00, 0x07, 0x12, 0x06, 0xA2, 0x90, 0x94, 0xBB, 0x12, 0x77, 0xD3, 0x90, 0x94, 0xBE, 0xF0, +0xED, 0x70, 0x19, 0xFF, 0x11, 0xF8, 0xE0, 0xB4, 0xFF, 0x06, 0x11, 0xF8, 0xE4, 0xF0, 0x80, 0x07, +0x11, 0xF8, 0xE0, 0x04, 0xF0, 0x80, 0x05, 0x0F, 0xEF, 0xB4, 0x06, 0xE8, 0x90, 0x94, 0xB5, 0xE0, +0xFF, 0xB4, 0x04, 0x13, 0xA3, 0xE0, 0xFE, 0x11, 0xF2, 0xEE, 0x31, 0x90, 0xFE, 0x11, 0xF2, 0x51, +0xA0, 0x90, 0x00, 0x02, 0xE4, 0x80, 0x20, 0xEF, 0xB4, 0x02, 0x1F, 0x90, 0x94, 0xB7, 0x11, 0xF0, +0xEF, 0x31, 0x90, 0x44, 0x20, 0x54, 0x7F, 0x11, 0xF1, 0x90, 0x00, 0x01, 0xEF, 0x12, 0x06, 0xE1, +0x90, 0x94, 0xB6, 0xE0, 0x90, 0x00, 0x02, 0x12, 0x06, 0xE1, 0x11, 0xF2, 0xE9, 0x24, 0x03, 0x51, +0x99, 0x44, 0x20, 0x12, 0x06, 0xCF, 0x90, 0x94, 0xB8, 0x11, 0xF0, 0x90, 0x00, 0x04, 0xEF, 0x12, +0x06, 0xE1, 0x90, 0x94, 0xB9, 0xE0, 0x90, 0x00, 0x05, 0x12, 0x06, 0xE1, 0x90, 0x94, 0xBA, 0xE0, +0x90, 0x00, 0x06, 0x12, 0x06, 0xE1, 0x90, 0x94, 0xBB, 0xE0, 0x90, 0x00, 0x07, 0x02, 0x06, 0xE1, +0xE0, 0xFF, 0x90, 0x94, 0xB1, 0x02, 0x49, 0x18, 0x74, 0xB6, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x94, +0xF5, 0x83, 0x22, 0x90, 0x94, 0xF8, 0xED, 0xF0, 0x90, 0x94, 0xF5, 0x12, 0x49, 0x21, 0xE4, 0x90, +0x94, 0xF9, 0xF0, 0xA3, 0xF0, 0x12, 0x06, 0x89, 0xFF, 0x12, 0x76, 0xE7, 0xFD, 0x11, 0x26, 0xFB, +0x12, 0x84, 0x71, 0x90, 0x94, 0xF9, 0xEF, 0xF0, 0x90, 0x94, 0xF5, 0x12, 0x49, 0x18, 0x11, 0x26, +0xFF, 0x12, 0xA3, 0xE8, 0x90, 0x94, 0xFA, 0xEF, 0xF0, 0x90, 0x8F, 0x95, 0xE0, 0x24, 0xFE, 0x60, +0x14, 0x24, 0xFE, 0x60, 0x10, 0x14, 0x60, 0x07, 0x14, 0x60, 0x04, 0x24, 0x05, 0x70, 0x40, 0x31, +0x98, 0x31, 0xA4, 0x80, 0x0C, 0x31, 0x98, 0x90, 0x8F, 0x95, 0xE0, 0x90, 0x94, 0xB5, 0xF0, 0x11, +0x2C, 0x90, 0x94, 0xFA, 0xE0, 0xFF, 0x90, 0x94, 0xF5, 0x12, 0x49, 0x18, 0x90, 0x94, 0xF9, 0xE0, +0x7C, 0x00, 0x29, 0xF9, 0xEC, 0x3A, 0xFA, 0xC3, 0xE9, 0x9F, 0xF9, 0xEA, 0x94, 0x00, 0xFA, 0x75, +0x40, 0x01, 0x75, 0x41, 0x8F, 0x75, 0x42, 0x8C, 0xA3, 0xE0, 0xF5, 0x43, 0x12, 0x34, 0x62, 0x22, +0x12, 0x06, 0xCF, 0x90, 0x94, 0xB7, 0xE0, 0x22, 0x7B, 0x01, 0x7A, 0x8F, 0x79, 0x8C, 0x90, 0x94, +0xF8, 0xE0, 0xFD, 0x22, 0x90, 0x94, 0xD7, 0xED, 0xF0, 0x90, 0x94, 0xD4, 0x12, 0x49, 0x21, 0x12, +0x77, 0xD4, 0x90, 0x94, 0xDB, 0xF0, 0x90, 0x94, 0xD4, 0x12, 0x57, 0x05, 0x75, 0x43, 0x03, 0x7B, +0x01, 0x7A, 0x94, 0x79, 0xD8, 0x12, 0x34, 0x62, 0x90, 0x94, 0xD7, 0xE0, 0x70, 0x2E, 0xFF, 0x31, +0xFD, 0xE0, 0xB4, 0xFF, 0x06, 0x31, 0xFD, 0xE4, 0xF0, 0x80, 0x07, 0x31, 0xFD, 0xE0, 0x04, 0xF0, +0x80, 0x05, 0x0F, 0xEF, 0xB4, 0x03, 0xE8, 0x75, 0x40, 0x01, 0x75, 0x41, 0x94, 0x75, 0x42, 0xD8, +0x75, 0x43, 0x03, 0x90, 0x94, 0xD4, 0x12, 0x49, 0x18, 0x12, 0x34, 0x62, 0x22, 0x74, 0xD8, 0x2F, +0xF5, 0x82, 0xE4, 0x34, 0x94, 0xF5, 0x83, 0x22, 0xF0, 0x90, 0x00, 0x05, 0x02, 0x06, 0xA2, 0x51, +0x8B, 0x90, 0x93, 0x14, 0x12, 0x76, 0xE6, 0xFF, 0xED, 0x2F, 0x90, 0x93, 0x15, 0x12, 0x77, 0xBA, +0xFF, 0xED, 0x2F, 0x90, 0x93, 0x16, 0x12, 0x77, 0xD3, 0xFF, 0xED, 0x2F, 0x90, 0x93, 0x17, 0x11, +0x25, 0xFF, 0xED, 0x2F, 0x90, 0x93, 0x18, 0x51, 0x08, 0xFF, 0xED, 0x2F, 0x90, 0x93, 0x19, 0xF0, +0x12, 0x76, 0xDF, 0xFF, 0xAE, 0x05, 0xED, 0x2F, 0x90, 0x93, 0x1A, 0xF0, 0x22, 0x51, 0x8B, 0x90, +0x93, 0x1B, 0x12, 0x76, 0xE6, 0xFF, 0xED, 0x2F, 0x90, 0x93, 0x1C, 0x12, 0x77, 0xBA, 0xFF, 0xED, +0x2F, 0x90, 0x93, 0x1D, 0x12, 0x77, 0xD3, 0xFF, 0xED, 0x2F, 0x90, 0x93, 0x1E, 0x11, 0x25, 0xFF, +0xED, 0x2F, 0x90, 0x93, 0x1F, 0x51, 0x08, 0xFF, 0xED, 0x2F, 0x90, 0x93, 0x20, 0xF0, 0x12, 0x76, +0xDF, 0xFF, 0xAE, 0x05, 0xED, 0x2F, 0x90, 0x93, 0x21, 0xF0, 0x22, 0x90, 0x02, 0x09, 0xE0, 0xFD, +0x12, 0x06, 0x89, 0xFE, 0xAF, 0x05, 0xED, 0x2E, 0x22, 0xF9, 0xE4, 0x3A, 0xFA, 0x02, 0x06, 0x89, +0x90, 0x00, 0x01, 0xEE, 0x02, 0x06, 0xE1, 0x90, 0x95, 0x0A, 0xEF, 0xF0, 0xA3, 0x12, 0x49, 0x21, +0x90, 0x95, 0x37, 0xE0, 0xFE, 0x04, 0xF0, 0x51, 0xA0, 0x74, 0x00, 0x2F, 0xF9, 0xE4, 0x34, 0xFB, +0xFA, 0x7B, 0x01, 0xC0, 0x03, 0xC0, 0x02, 0xC0, 0x01, 0x90, 0x95, 0x0B, 0x12, 0x57, 0x05, 0x75, +0x43, 0x02, 0xD0, 0x01, 0xD0, 0x02, 0xD0, 0x03, 0x12, 0x34, 0x62, 0x90, 0x95, 0x0A, 0xE0, 0x24, +0x02, 0xF9, 0xE4, 0x34, 0xFB, 0xFA, 0x7B, 0x01, 0xC0, 0x03, 0xC0, 0x02, 0xC0, 0x01, 0xA3, 0x12, +0x49, 0x18, 0xE9, 0x24, 0x02, 0xF9, 0xE4, 0x3A, 0x8B, 0x40, 0xF5, 0x41, 0x89, 0x42, 0x90, 0x95, +0x0B, 0x71, 0x68, 0xF5, 0x43, 0xD0, 0x01, 0xD0, 0x02, 0xD0, 0x03, 0x02, 0x34, 0x62, 0xD3, 0x10, +0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x95, 0x0E, 0x12, 0x49, 0x21, 0x7F, 0x96, 0x7E, 0x02, 0x71, +0x71, 0xEF, 0x60, 0x3F, 0x12, 0x7C, 0x93, 0xFE, 0xB1, 0x6A, 0x90, 0x95, 0x11, 0xEF, 0xF0, 0xEE, +0xFF, 0x90, 0xFD, 0x11, 0xF0, 0x90, 0x95, 0x11, 0xE0, 0xFD, 0x90, 0x02, 0x94, 0xF0, 0xA3, 0xEF, +0xF0, 0x90, 0x95, 0x0E, 0x71, 0x68, 0x24, 0x02, 0xFF, 0xE4, 0x33, 0xFE, 0x71, 0xB4, 0x90, 0x95, +0x11, 0xE0, 0x24, 0x18, 0xFF, 0x90, 0x95, 0x0E, 0x12, 0x49, 0x18, 0x51, 0xA7, 0x90, 0x02, 0x96, +0x74, 0x01, 0xF0, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x12, 0x49, 0x18, 0x90, 0x00, 0x0E, 0x02, 0x06, +0xA2, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x95, 0x06, 0xEE, 0xF0, 0xA3, 0xEF, 0x91, +0x6D, 0x90, 0x95, 0x06, 0xB1, 0x7A, 0xE0, 0x60, 0x24, 0xC3, 0x90, 0x95, 0x09, 0xE0, 0x94, 0xE8, +0x90, 0x95, 0x08, 0xE0, 0x94, 0x03, 0x40, 0x0B, 0x90, 0x01, 0xC0, 0xE0, 0x44, 0x80, 0xF0, 0x7F, +0x00, 0x80, 0x0C, 0x90, 0x95, 0x08, 0x12, 0x5A, 0xA6, 0xB1, 0x63, 0x80, 0xD4, 0x7F, 0x01, 0xD0, +0xD0, 0x92, 0xAF, 0x22, 0xE4, 0xFC, 0xED, 0x2C, 0x24, 0x00, 0xF5, 0x82, 0xE4, 0x34, 0xFB, 0xF5, +0x83, 0xE4, 0xF0, 0x0C, 0xEC, 0xB4, 0x18, 0xEE, 0x74, 0x00, 0x2D, 0xF5, 0x82, 0xE4, 0x34, 0xFB, +0xF5, 0x83, 0xEF, 0xF0, 0xEE, 0x54, 0x3F, 0xFF, 0x74, 0x01, 0x2D, 0xF5, 0x82,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, 0x4E, 0x60, 0x02, 0xA1, 0x4D, 0x90, 0x8F, 0xD7, 0xE0, 0xFF, +0x64, 0xFE, 0x70, 0x02, 0xA1, 0x4D, 0xEF, 0x64, 0x02, 0x60, 0x07, 0xEF, 0x64, 0x03, 0x60, 0x02, +0xA1, 0x4D, 0x90, 0x90, 0x37, 0xB1, 0x72, 0x90, 0x93, 0x92, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0xB1, +0x5A, 0x7A, 0x93, 0x79, 0x50, 0x12, 0x08, 0xAA, 0xB1, 0x5A, 0x7A, 0x93, 0x79, 0x70, 0x12, 0x08, +0xAA, 0x90, 0xAC, 0x7A, 0x74, 0x10, 0x91, 0x6D, 0x7B, 0x20, 0xFD, 0xFC, 0xFF, 0xFE, 0x12, 0x38, +0xC6, 0x7B, 0x01, 0x7A, 0x90, 0x79, 0x39, 0x90, 0xAC, 0x89, 0x12, 0x49, 0x21, 0x7A, 0x93, 0x79, +0x70, 0x90, 0xAC, 0x8C, 0x12, 0x49, 0x21, 0x90, 0xAC, 0x8F, 0x74, 0x20, 0xF0, 0x7A, 0x8F, 0x79, +0xA6, 0x12, 0x33, 0x97, 0x75, 0x40, 0x01, 0x75, 0x41, 0x93, 0x75, 0x42, 0x78, 0x75, 0x43, 0x18, +0x7B, 0x01, 0x7A, 0x93, 0x79, 0x50, 0x12, 0x34, 0x62, 0x75, 0x40, 0x01, 0x75, 0x41, 0x93, 0x75, +0x42, 0x58, 0x75, 0x43, 0x10, 0x7B, 0x01, 0x7A, 0x93, 0x79, 0x40, 0x12, 0x34, 0x62, 0x90, 0x93, +0x56, 0xE0, 0x54, 0x03, 0xFF, 0xC3, 0x94, 0x04, 0x90, 0x8F, 0x94, 0x50, 0x04, 0xEF, 0xF0, 0x80, +0x03, 0x74, 0x05, 0xF0, 0x7B, 0x01, 0x7A, 0x93, 0x79, 0x40, 0x12, 0x77, 0x19, 0xD0, 0xD0, 0x92, +0xAF, 0x22, 0x90, 0x93, 0x90, 0x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0xE0, 0x64, +0x06, 0x70, 0x18, 0x90, 0x95, 0x4C, 0xE0, 0x60, 0x12, 0x90, 0x8E, 0x11, 0xE0, 0x54, 0xBF, 0xF0, +0xF1, 0xB8, 0x90, 0x8E, 0x18, 0x74, 0x04, 0xF0, 0x12, 0x87, 0xCC, 0xD0, 0xD0, 0x92, 0xAF, 0x22, +0x90, 0x06, 0x04, 0xE0, 0x54, 0x7F, 0xF0, 0x22, 0x90, 0x06, 0x0A, 0xE0, 0x54, 0xF8, 0xF0, 0x22, +0xF0, 0xA3, 0xF0, 0xA3, 0x74, 0x08, 0xF0, 0x22, 0x90, 0x06, 0x04, 0xE0, 0x44, 0x40, 0xF0, 0xE0, +0x44, 0x80, 0xF0, 0x22, 0xE4, 0x90, 0x8D, 0xF6, 0xF0, 0xA3, 0xF0, 0x90, 0x8D, 0x5E, 0xF0, 0xA3, +0xF0, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x8B, 0x51, 0x8A, 0x52, 0x89, 0x53, 0x12, +0x06, 0x89, 0xFF, 0x90, 0x8E, 0x10, 0xF0, 0xBF, 0x01, 0x0D, 0x12, 0x76, 0xE7, 0x64, 0x01, 0x60, +0x19, 0x7D, 0x13, 0x7F, 0x6F, 0x80, 0x10, 0xAB, 0x51, 0xAA, 0x52, 0xA9, 0x53, 0x12, 0x76, 0xE7, +0x64, 0x01, 0x60, 0x06, 0xE4, 0xFD, 0xFF, 0x12, 0x54, 0x6C, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x12, +0x06, 0x89, 0xFF, 0x90, 0x8D, 0xFA, 0xF0, 0xBF, 0x01, 0x07, 0x11, 0x22, 0xE4, 0x90, 0x8D, 0xFA, +0xF0, 0x22, 0x11, 0xC9, 0x7F, 0xF5, 0x7E, 0x01, 0x12, 0x33, 0xFD, 0xBF, 0x01, 0x06, 0x90, 0x93, +0x3C, 0xE0, 0xA3, 0xF0, 0x11, 0xC9, 0x7F, 0xF6, 0x7E, 0x01, 0x12, 0x33, 0xFD, 0xBF, 0x01, 0x08, +0x90, 0x93, 0x3C, 0xE0, 0x90, 0x93, 0x3E, 0xF0, 0x11, 0xC9, 0x7F, 0xF4, 0x7E, 0x01, 0x12, 0x33, +0xFD, 0xBF, 0x01, 0x08, 0x90, 0x93, 0x3C, 0xE0, 0x90, 0x93, 0x3F, 0xF0, 0x11, 0xC9, 0x7F, 0xF3, +0x7E, 0x01, 0x12, 0x33, 0xFD, 0xBF, 0x01, 0x08, 0x90, 0x93, 0x3C, 0xE0, 0x90, 0x93, 0x40, 0xF0, +0x11, 0xC9, 0x7F, 0xF2, 0x7E, 0x01, 0x12, 0x33, 0xFD, 0xBF, 0x01, 0x08, 0x90, 0x93, 0x3C, 0xE0, +0x90, 0x93, 0x41, 0xF0, 0x90, 0x93, 0x3D, 0x11, 0xD0, 0xA3, 0xE0, 0x90, 0x93, 0x45, 0xF0, 0x90, +0x93, 0x41, 0xE0, 0x90, 0x93, 0x46, 0xF0, 0x90, 0x93, 0x47, 0x74, 0x12, 0xF0, 0x90, 0x93, 0x55, +0x74, 0x05, 0xF0, 0x90, 0x93, 0x49, 0x12, 0x67, 0xF7, 0xEB, 0xF0, 0x90, 0x93, 0x45, 0xE0, 0x90, +0x93, 0x4C, 0xF0, 0x90, 0x93, 0x46, 0xE0, 0x90, 0x93, 0x4D, 0xF0, 0x7B, 0x01, 0x7A, 0x93, 0x79, +0x47, 0x12, 0x85, 0x0E, 0x7F, 0x04, 0x02, 0x71, 0x82, 0x7B, 0x01, 0x7A, 0x93, 0x79, 0x3C, 0x22, +0xE0, 0xFF, 0xA3, 0xE0, 0xFD, 0xA3, 0xE0, 0xFB, 0x22, 0x12, 0x06, 0x89, 0x54, 0x01, 0xFF, 0x90, +0x93, 0x35, 0xE0, 0x54, 0xFE, 0x4F, 0xF0, 0x22, 0x12, 0x77, 0xBB, 0xFF, 0x30, 0xE0, 0x1D, 0x12, +0x06, 0x89, 0x90, 0x8E, 0xB9, 0x12, 0x76, 0xE6, 0x90, 0x8E, 0xBA, 0xF0, 0xEF, 0x54, 0xFE, 0xFF, +0xA3, 0xE0, 0x54, 0x01, 0x12, 0x77, 0xD2, 0x90, 0x8E, 0xBC, 0xF0, 0x22, 0x90, 0x8E, 0xB9, 0x74, +0x05, 0xF0, 0xA3, 0x74, 0x0A, 0xF0, 0xA3, 0xE0, 0x54, 0x01, 0x44, 0x1E, 0xF0, 0xA3, 0x74, 0x05, +0xF0, 0x22, 0x12, 0x06, 0x89, 0x90, 0x8E, 0x20, 0xF0, 0x22, 0x12, 0x06, 0x89, 0x90, 0x8E, 0xBF, +0xF0, 0x22, 0x31, 0x38, 0x54, 0xFB, 0xF0, 0x22, 0x8F, 0x57, 0x75, 0xF0, 0x10, 0xEF, 0x90, 0x81, +0x05, 0x12, 0x49, 0x0C, 0xE0, 0x22, 0x31, 0x38, 0x44, 0x04, 0xF0, 0x22, 0xEF, 0x70, 0x04, 0x74, +0xF0, 0x80, 0x16, 0xEF, 0xB4, 0x01, 0x04, 0x74, 0xF4, 0x80, 0x0E, 0xEF, 0xB4, 0x02, 0x04, 0x74, +0xF8, 0x80, 0x06, 0xEF, 0xB4, 0x03, 0x0C, 0x74, 0xFC, 0x2D, 0xF5, 0x82, 0xE4, 0x34, 0x02, 0xF5, +0x83, 0xEB, 0xF0, 0x22, 0x90, 0x95, 0x2A, 0x12, 0x49, 0x21, 0xE4, 0xFF, 0x90, 0x95, 0x2A, 0x12, +0x49, 0x18, 0x8F, 0x82, 0x75, 0x83, 0x00, 0x12, 0x06, 0xA2, 0xFE, 0x74, 0xF0, 0x2F, 0xF5, 0x82, +0xE4, 0x34, 0x02, 0x31, 0x99, 0xB4, 0x10, 0xE4, 0x22, 0xF5, 0x83, 0xEE, 0xF0, 0x0F, 0xEF, 0x22, +0xE4, 0xFF, 0x74, 0x18, 0x31, 0xC4, 0x74, 0xD0, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x8E, 0xF5, 0x83, +0xEE, 0xF0, 0x74, 0x10, 0x31, 0xC4, 0x74, 0xCA, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x8E, 0x31, 0x99, +0xB4, 0x06, 0xDF, 0x22, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x06, 0xF5, 0x83, 0xE0, 0xFE, 0x22, 0xE4, +0xFF, 0x74, 0x8C, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x8F, 0xF5, 0x83, 0xE0, 0xFE, 0x74, 0x84, 0x2F, +0xF5, 0x82, 0xE4, 0x34, 0x04, 0x31, 0x99, 0xB4, 0x08, 0xE7, 0x90, 0x8F, 0x94, 0xE0, 0x90, 0x04, +0x8C, 0xF0, 0x22, 0x51, 0x18, 0x31, 0xCF, 0x90, 0x01, 0x3F, 0x74, 0x04, 0xF0, 0x90, 0x8D, 0x06, +0xE0, 0xFF, 0xB4, 0x01, 0x07, 0x90, 0xFD, 0x00, 0xE0, 0x54, 0xEF, 0xF0, 0xEF, 0xB4, 0x01, 0x07, +0x90, 0xFE, 0x10, 0xE0, 0x54, 0xFB, 0xF0, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xE4, +0xFD, 0x7F, 0x8F, 0x12, 0x4B, 0x9F, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x90, 0x01, 0x94, 0xE0, 0x44, +0x01, 0xF0, 0x90, 0x01, 0xC7, 0xE4, 0xF0, 0x22, 0x90, 0x01, 0x9A, 0xE0, 0x54, 0xC0, 0x44, 0x0B, +0xF0, 0x12, 0x95, 0x63, 0x90, 0x01, 0x98, 0xE0, 0x54, 0xC0, 0x7F, 0x00, 0xB4, 0x40, 0x02, 0x7F, +0x01, 0x22, 0x90, 0x01, 0xC7, 0x74, 0xFE, 0xF0, 0x22, 0x90, 0x01, 0xE4, 0x74, 0x1C, 0xF0, 0xA3, +0xE4, 0xF0, 0x22, 0x90, 0x01, 0x34, 0xE0, 0x55, 0x15, 0xF5, 0x19, 0xA3,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, 0x01, 0x5B, 0xE4, 0xF0, 0x90, 0x06, 0x92, 0x74, +0x02, 0xF0, 0x90, 0x01, 0x3C, 0x74, 0x04, 0xF0, 0xE4, 0x90, 0x94, 0xE7, 0xF0, 0x90, 0x8E, 0xBB, +0xE0, 0xC3, 0x13, 0x54, 0x7F, 0x90, 0x94, 0xE8, 0xF0, 0xE4, 0xFB, 0xFD, 0x7F, 0x58, 0xB1, 0xF8, +0x44, 0x08, 0xF0, 0x22, 0x90, 0x8E, 0x11, 0xE0, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x22, 0x90, 0x01, +0x57, 0xE4, 0xF0, 0x90, 0x01, 0x3C, 0x74, 0x02, 0x22, 0x54, 0xFB, 0xF0, 0x90, 0x8E, 0x19, 0xE0, +0x54, 0xFD, 0xF0, 0x22, 0xF0, 0x90, 0x8E, 0x21, 0xA3, 0xE0, 0x90, 0x05, 0x58, 0xF0, 0x22, 0x90, +0x8E, 0xB9, 0xE0, 0xFF, 0x90, 0x8E, 0x1E, 0xE0, 0xD3, 0x9F, 0x22, 0x74, 0x1D, 0x2F, 0xF8, 0xE6, +0x4D, 0xFE, 0xF6, 0x74, 0x38, 0x2F, 0xF5, 0x82, 0xE4, 0x34, 0x01, 0xF5, 0x83, 0xEE, 0xF0, 0x22, +0x90, 0x8E, 0x15, 0xE0, 0x64, 0x01, 0x70, 0x13, 0x12, 0x76, 0x16, 0x60, 0x05, 0x12, 0x54, 0x63, +0xC1, 0x02, 0x90, 0x8E, 0x18, 0xE0, 0x70, 0x03, 0x12, 0x51, 0xE4, 0x22, 0x90, 0x8E, 0x15, 0xE0, +0x60, 0x02, 0xD1, 0x80, 0x22, 0x90, 0x04, 0x1D, 0xE0, 0x70, 0x17, 0x90, 0x8D, 0x08, 0xE0, 0xFF, +0x7B, 0x18, 0xE4, 0xFD, 0x12, 0x82, 0x1D, 0x90, 0x95, 0x40, 0xEE, 0xF0, 0xA3, 0xEF, 0xF0, 0x12, +0x55, 0xDF, 0x22, 0xE4, 0x90, 0x93, 0xF4, 0xF0, 0xA3, 0xF0, 0xA3, 0xF0, 0x7F, 0x83, 0x12, 0x4C, +0x69, 0x90, 0x93, 0xF4, 0xEF, 0xF0, 0x7F, 0x83, 0x12, 0x4C, 0x69, 0xAE, 0x07, 0x90, 0x93, 0xF4, +0xE0, 0xFF, 0xB5, 0x06, 0x01, 0x22, 0xC3, 0x90, 0x93, 0xF6, 0xE0, 0x94, 0x64, 0x90, 0x93, 0xF5, +0xE0, 0x94, 0x00, 0x40, 0x0D, 0x90, 0x01, 0xC0, 0xE0, 0x44, 0x40, 0xF0, 0x90, 0x93, 0xF4, 0xE0, +0xFF, 0x22, 0x90, 0x93, 0xF5, 0x12, 0x5A, 0xA6, 0x80, 0xC2, 0x90, 0x8E, 0x15, 0xE0, 0x60, 0x03, +0x12, 0x75, 0xAE, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x04, 0x1D, 0xE0, 0x60, +0x1A, 0x90, 0x05, 0x22, 0xE0, 0x54, 0x90, 0x60, 0x07, 0x90, 0x01, 0xC0, 0xE0, 0x44, 0x08, 0xF0, +0x90, 0x01, 0xC6, 0xE0, 0x30, 0xE1, 0xE4, 0x7F, 0x00, 0x80, 0x02, 0x7F, 0x01, 0xD0, 0xD0, 0x92, +0xAF, 0x22, 0xC3, 0xEE, 0x94, 0x01, 0x40, 0x0A, 0x0D, 0xED, 0x13, 0x90, 0xFD, 0x10, 0xF0, 0xE4, +0x2F, 0xFF, 0x22, 0x90, 0x93, 0x5D, 0xE0, 0x2F, 0xFF, 0x90, 0x93, 0x5C, 0xE0, 0x34, 0x00, 0xFE, +0x90, 0x93, 0xE0, 0xF0, 0xA3, 0xEF, 0xF0, 0x90, 0x93, 0x17, 0xE0, 0xFD, 0xF1, 0x42, 0x90, 0x93, +0x57, 0xEF, 0xF0, 0x22, 0x90, 0x01, 0xC4, 0x74, 0x74, 0xF0, 0x74, 0x9F, 0xA3, 0xF0, 0x7F, 0x90, +0x12, 0x4C, 0x69, 0xEF, 0x20, 0xE0, 0xF7, 0x74, 0x74, 0x04, 0x90, 0x01, 0xC4, 0xF0, 0x74, 0x9F, +0xA3, 0xF0, 0x22, 0x90, 0x04, 0x54, 0xE0, 0x7F, 0x00, 0x30, 0xE7, 0x02, 0x7F, 0x01, 0x22, 0x90, +0x95, 0x3F, 0xED, 0xF0, 0x90, 0x95, 0x3E, 0xEF, 0xF0, 0xD3, 0x94, 0x0E, 0x50, 0x16, 0xF1, 0x93, +0xEF, 0x60, 0x43, 0xF1, 0x93, 0xEF, 0x64, 0x01, 0x70, 0x3C, 0x90, 0x95, 0x3F, 0xE0, 0xFD, 0xE4, +0xFF, 0x02, 0x66, 0x58, 0x90, 0x95, 0x3E, 0xE0, 0xD3, 0x94, 0x0E, 0x40, 0x29, 0xF1, 0x93, 0xEF, +0x70, 0x22, 0x90, 0x8D, 0xFB, 0xE0, 0x30, 0xE0, 0x03, 0x12, 0xA8, 0x77, 0x90, 0x95, 0x3F, 0xE0, +0xFD, 0x7F, 0x01, 0x12, 0x66, 0x58, 0x90, 0x8D, 0xFB, 0xE0, 0x13, 0x13, 0x54, 0x3F, 0x30, 0xE0, +0x05, 0x02, 0x87, 0x99, 0xF1, 0x93, 0x22, 0xE4, 0xFE, 0xFC, 0xEF, 0x64, 0x02, 0x70, 0x40, 0xED, +0xB4, 0x01, 0x04, 0x7E, 0x0A, 0x80, 0x06, 0xED, 0xB4, 0x02, 0x02, 0x7E, 0x09, 0xEB, 0xB4, 0x01, +0x08, 0xED, 0xB4, 0x01, 0x04, 0x7C, 0x04, 0x80, 0x38, 0xEB, 0xB4, 0x02, 0x08, 0xED, 0xB4, 0x01, +0x04, 0x7C, 0x02, 0x80, 0x2C, 0xEB, 0xB4, 0x01, 0x08, 0xED, 0xB4, 0x02, 0x04, 0x7C, 0x01, 0x80, +0x20, 0xEB, 0x64, 0x02, 0x70, 0x1B, 0xED, 0x64, 0x02, 0x70, 0x16, 0x7C, 0x03, 0x80, 0x12, 0xEF, +0xB4, 0x01, 0x0E, 0xEB, 0xB4, 0x02, 0x04, 0x7C, 0x01, 0x80, 0x06, 0xEB, 0xB4, 0x01, 0x02, 0x7C, +0x02, 0xAF, 0x06, 0xEF, 0xC4, 0x54, 0xF0, 0x4C, 0xFF, 0x22, 0x90, 0x95, 0x46, 0xED, 0xF0, 0xEF, +0x60, 0x02, 0x21, 0x2B, 0xE0, 0x24, 0xFD, 0x50, 0x0A, 0x60, 0x1D, 0x14, 0x60, 0x2F, 0x14, 0x60, +0x6C, 0x41, 0xBB, 0x90, 0xAA, 0xB9, 0x12, 0x08, 0x79, 0x77, 0x77, 0x77, 0x77, 0x51, 0xC7, 0x12, +0x08, 0x79, 0x77, 0x77, 0x77, 0x77, 0x21, 0x9F, 0x90, 0xAA, 0xB9, 0x12, 0x08, 0x79, 0x54, 0x33, +0x77, 0x70, 0x51, 0xC7, 0x12, 0x08, 0x79, 0x54, 0x33, 0x77, 0x70, 0x41, 0x1F, 0x90, 0xAA, 0xB9, +0x12, 0x08, 0x79, 0x77, 0x77, 0x77, 0x77, 0x51, 0xC7, 0x12, 0x08, 0x79, 0x77, 0x77, 0x77, 0x77, +0x51, 0xBC, 0x12, 0x08, 0x79, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x00, +0x10, 0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0C, 0x12, 0x66, 0x52, 0x12, 0x08, 0x79, 0x3F, 0xF0, 0x00, +0x00, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x00, 0x10, 0x00, 0x00, 0x41, 0xB4, 0x90, 0x94, 0x8F, +0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0xFF, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, +0x77, 0x12, 0x65, 0xD6, 0x90, 0xAA, 0xB9, 0x12, 0x08, 0x79, 0x77, 0x77, 0x77, 0x77, 0x51, 0xBC, +0x12, 0x08, 0x79, 0x01, 0x00, 0x00, 0x00, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, +0x00, 0x7F, 0xB4, 0x7E, 0x0C, 0x12, 0x66, 0x52, 0x12, 0x08, 0x79, 0x3F, 0xF0, 0x00, 0x00, 0x90, +0x94, 0x93, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0x41, 0xB4, 0x90, 0x95, 0x46, 0xE0, 0x14, +0x60, 0x5A, 0x14, 0x70, 0x02, 0x21, 0xCC, 0x14, 0x70, 0x02, 0x41, 0x0C, 0x14, 0x70, 0x02, 0x21, +0xCC, 0x14, 0x70, 0x02, 0x41, 0x68, 0x24, 0x05, 0x60, 0x02, 0x41, 0xBB, 0x90, 0xAA, 0xB9, 0x12, +0x08, 0x79, 0x77, 0x33, 0x77, 0x17, 0x51, 0xC7, 0x12, 0x08, 0x79, 0x77, 0x33, 0x77, 0x17, 0x51, +0xBC, 0x12, 0x08, 0x79, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x01, 0x00, +0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0C, 0x12, 0x66, 0x52, 0x12, 0x08, 0x79, 0x3F, 0xF0, 0x00, 0x00, +0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x01, 0x00, 0x00, 0x00, 0x41, 0xB4, 0x90, 0xAA, 0xB9, 0x12, +0x08, 0x79, 0x77, 0x33, 0x77, 0x17, 0x51, 0xC7, 0x12, 0x08, 0x79, 0x77, 0x33, 0x77, 0x17, 0x51, +0xBC, 0x12, 0x08, 0x79, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x00, 0x00, +0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0C, 0x12, 0x66, 0x52, 0x12, 0x08, 0x79, 0x3F, 0xF0, 0x00, 0x00, +0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x00, 0x41, 0xB4, 0x90, 0xAA, 0xB9, 0x12, +0x08, 0x79, 0x77, 0x33, 0x77, 0x77, 0x51, 0xC7, 0x12, 0x08, 0x79, 0x77, 0x33, 0x77, 0x77, 0x51, +0xBC, 0x12, 0x08, 0x79, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x01, 0x00, +0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0C, 0x12, 0x66, 0x52, 0x12, 0x08, 0x79, 0x3F, 0xF0, 0x00, 0x00, +0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x01, 0x00, 0x00, 0x00, 0x41, 0xB4, 0x90, 0xAA, 0xB9, 0x12, +0x08, 0x79, 0x54, 0x33, 0x77, 0x17, 0x51, 0xC7, 0x12, 0x08, 0x79, 0x54, 0x33, 0x77, 0x17, 0x51, +0xBC, 0x12, 0x08, 0x79, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x01, 0x00, +0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0C, 0x12, 0x66, 0x52, 0x12, 0x08, 0x79, 0x3F, 0xF0, 0x00, 0x00, +0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x01, 0x00, 0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0E, 0x12, 0x66, +0x52, 0x12, 0x08, 0x79, 0x00, 0x00, 0x03, 0x03, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x00, 0x00, +0x00, 0x01, 0x7F, 0x00, 0x7E, 0x09, 0x80, 0x50, 0x90, 0x94, 0x8F, 0x12, 0x08, 0x79, 0x00, 0xFF, +0x00, 0x00, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x00, 0x33, 0x00, 0x00, 0x12, 0x65, 0xD6, 0x90, +0xAA, 0xB9, 0x12, 0x08, 0x79, 0x77, 0x33, 0x77, 0x77, 0x51, 0xBC, 0x12, 0x08, 0x79, 0x01, 0x00, +0x00, 0x00, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x01, 0x00, 0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0C, +0x12, 0x66, 0x52, 0x12, 0x08, 0x79, 0x3F, 0xF0, 0x00, 0x00, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, +0x01, 0x00, 0x00, 0x00, 0x7F, 0xB4, 0x7E, 0x0E, 0x12, 0x65, 0xDA, 0x22, 0x7F, 0xB0, 0x7E, 0x0E, +0x12, 0x38, 0x07, 0x90, 0x94, 0x8F, 0x22, 0x7F, 0xB0, 0x7E, 0x0C, 0x12, 0x38, 0x07, 0x90, 0xAA, +0xB9, 0x22, 0x12, 0x7F, 0xDE, 0xFE, 0x90, 0x93, 0x24, 0xE0, 0x54, 0xFE, 0x4E, 0xFE, 0xF0, 0xEF, +0x54, 0x04, 0xFF, 0xEE, 0x54, 0xFB, 0x4F, 0xF0, 0x12, 0x06, 0x89, 0xC3, 0x13, 0x30, 0xE0, 0x07, +0x12, 0x76, 0xE7, 0x90, 0x93, 0x25, 0xF0, 0x22, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x90, 0x02, 0x84, +0xEF, 0xF0, 0xEE, 0xA3, 0xF0, 0xA3, 0xE0, 0x44, 0x01, 0xF0, 0x22, 0xE4, 0x90, 0x93, 0x38, 0xF0, +0xA3, 0xF0, 0x90, 0x02, 0x86, 0xE0, 0x20, 0xE1, 0x24, 0xC3, 0x90, 0x93, 0x39, 0xE0, 0x94, 0xD0, +0x90, 0x93, 0x38, 0xE0, 0x94, 0x07, 0x40, 0x0A, 0x90, 0x01, 0xC1, 0xE0, 0x44, 0x04, 0xF0, 0x7F, +0x00, 0x22, 0x90, 0x93, 0x38, 0x12, 0x5A, 0xA6, 0x12, 0x95, 0x63, 0x80, 0xD5, 0x7F, 0x01, 0x22, +0x90, 0x02, 0x86, 0xE0, 0x20, 0xE2, 0x03, 0x7F, 0x04, 0x22, 0x90, 0x02, 0x86, 0xE0, 0x7F, 0x01, +0x20, 0xE1, 0x02, 0x7F, 0x02, 0x22, 0x90, 0x8E, 0xC9, 0xE0, 0xFF, 0x20, 0xE0, 0x07, 0x90, 0x01, +0x3F, 0xE0, 0x30, 0xE2, 0x14, 0xEF, 0x44, 0x01, 0x90, 0x8E, 0xC9, 0xF0, 0x90, 0x8E, 0xC3, 0xE0, +0xC4, 0x54, 0x0F, 0x20, 0xE0, 0x03, 0x7F, 0x00, 0x22, 0x7F, 0x01, 0x22, 0xEF, 0x90, 0x01, 0xC7, +0xB4, 0xA0, 0x05, 0x74, 0x04, 0xF0, 0x80, 0x03, 0x74, 0x08, 0xF0, 0x02, 0x6F, 0x95, 0x90, 0x94, +0xCB, 0x12, 0x8F, 0x70, 0x90, 0x94, 0xD3, 0xF0, 0x90, 0x94, 0xD3, 0xE0, 0xFD, 0xC3, 0x94, 0x06, +0x50, 0x28, 0x90, 0x94, 0xCC, 0xE0, 0x24, 0x04, 0xFF, 0x90, 0x94, 0xCB, 0xE0, 0x34, 0x00, 0xFE, +0x12, 0x6B, 0x7F, 0x90, 0x94, 0xD3, 0xE0, 0x24, 0xCD, 0xF5, 0x82, 0xE4, 0x34, 0x94, 0xF5, 0x83, +0xEF, 0xF0, 0x90, 0x94, 0xD3, 0xE0, 0x04, 0xF0, 0x80, 0xCE, 0x78, 0xCA, 0x7C, 0x8E, 0x7D, 0x01, +0x7B, 0x01, 0x7A, 0x94, 0x79, 0xCD, 0x71, 0xDF, 0x7F, 0x00, 0x70, 0x02, 0x7F, 0x01, 0x22, 0x7E, +0x00, 0x7F, 0x06, 0x12, 0x4A, 0xD6, 0xEF, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0xEF, +0x20, 0xE0, 0x05, 0x90, 0x93, 0x12, 0x80, 0x03, 0x90, 0x93, 0x13, 0xE0, 0x90, 0x8F, 0x95, 0xF0, +0x90, 0x8F, 0x95, 0xE0, 0x14, 0x60, 0x13, 0x14, 0x60, 0x14, 0x24, 0xFE, 0x60, 0x10, 0x14, 0x60, +0x09, 0x14, 0x60, 0x06, 0x24, 0x06, 0xE4, 0xFE, 0x80, 0x06, 0x7E, 0x04, 0x80, 0x02, 0x7E, 0x08, +0xAF, 0x06, 0xD0, 0xD0, 0x92, 0xAF, 0x22, 0x12, 0x83, 0xE8, 0x75, 0x43, 0x08, 0x7B, 0x01, 0x7A, +0x8F, 0x79, 0x8C, 0x02, 0x34, 0x62, 0x12, 0x83, 0xE8, 0x75, 0x43, 0x70, 0x7B, 0x01, 0x7A, 0x8E, +0x79, 0xF4, 0x02, 0x34, 0x62, 0xEF, 0x60, 0x07, 0x90, 0x93, 0x1A, 0xE0, 0xFF, 0x91, 0x36, 0x22, +0x12, 0x8C, 0xB7, 0xD1, 0x2B, 0x7B, 0xFF, 0x7A, 0x40, 0x79, 0x6A, 0x12, 0x6F, 0xF7, 0xD1, 0x44, +0x7A, 0x40, 0x79, 0x70, 0xB1, 0xFC, 0x78, 0x51, 0x7C, 0x93, 0x7D, 0x01, 0x7B, 0xFF, 0x7A, 0x40, +0x79, 0x80, 0xB1, 0xFC, 0xE4, 0x90, 0x93, 0x64, 0xF0, 0x90, 0x93, 0x38, 0x12, 0x6F, 0x85, 0xFD, +0x12, 0x8D, 0x1D, 0xEF, 0x64, 0x01, 0x60, 0x02, 0xA1, 0xE4, 0x12, 0x6E, 0x95, 0xCF, 0x24, 0x0E, +0xCF, 0x12, 0x6D, 0x64, 0xEF, 0x64, 0x3A, 0x60, 0x02, 0xA1, 0xE4, 0x12, 0x6E, 0x95, 0xCF, 0x24, +0x30, 0xCF, 0x12, 0x6D, 0x64, 0xEF, 0x64, 0x87, 0x60, 0x02, 0xA1, 0xE4, 0x90, 0x93, 0x64, 0x04, +0xF0, 0xE4, 0x90, 0x93, 0x61, 0xF0, 0xB1, 0xEA, 0x94, 0x10, 0x50, 0x1A, 0xD1, 0x1F, 0x12, 0x6E, +0xA0, 0xCD, 0x24, 0x38, 0x12, 0x6B, 0x71, 0x90, 0x93, 0x61, 0xE0, 0x24, 0x51, 0xF5, 0x82, 0xE4, +0x34, 0x93, 0xB1, 0xF1, 0x80, 0xE0, 0xE4, 0x90, 0x93, 0x62, 0xF0, 0x90, 0x93, 0x62, 0xE0, 0xFF, +0xC3, 0x94, 0x02, 0x40, 0x02, 0xA1, 0xE4, 0x75, 0xF0, 0x38, 0xEF, 0xD1, 0x03, 0x20, 0xE0, 0x02, +0xA1, 0xE4, 0xE4, 0x90, 0x93, 0x63, 0xF0, 0xD1, 0x0B, 0x90, 0x8E, 0xF5, 0x12, 0x49, 0x0C, 0xE0, +0xFE, 0x90, 0x93, 0x63, 0xE0, 0xC3, 0x9E, 0x40, 0x02, 0xA1, 0xDC, 0xEF, 0x75, 0xF0, 0x38, 0xA4, +0x24, 0x0C, 0xF9, 0x74, 0x8F, 0x35, 0xF0, 0xFA, 0x7B, 0x01, 0xE0, 0x75, 0xF0, 0x10, 0xA4, 0x29, +0xF9, 0xEA, 0x35, 0xF0, 0xFA, 0x78, 0x51, 0x7C, 0x93, 0xD1, 0x14, 0x60, 0x02, 0xA1, 0xCD, 0x90, +0x06, 0x33, 0xE0, 0x44, 0x01, 0x54, 0xFB, 0xF0, 0xE4, 0x90, 0x93, 0x61, 0xF0, 0xB1, 0xEA, 0x94, +0x06, 0x50, 0x14, 0xD1, 0x1F, 0x12, 0x6E, 0xA0, 0xCD, 0x24, 0x4A, 0x12, 0x6B, 0x71, 0x90, 0x93, +0x61, 0xD1, 0x3B, 0xB1, 0xF1, 0x80, 0xE6, 0xE4, 0x90, 0x93, 0x61, 0xF0, 0xB1, 0xEA, 0x94, 0x10, +0x50, 0x0C, 0x12, 0x6B, 0x5D, 0x90, 0x93, 0x61, 0xD1, 0x32, 0xB1, 0xF1, 0x80, 0xEE, 0xD1, 0x0B, +0xD1, 0x03, 0xFE, 0xC3, 0x13, 0x30, 0xE0, 0x19, 0xEF, 0x75, 0xF0, 0x38, 0xA4, 0x24, 0xFC, 0xF9, +0x74, 0x8E, 0x35, 0xF0, 0xFA, 0x7B, 0x01, 0x78, 0x41, 0x7C, 0x93, 0xD1, 0x14, 0x70, 0x45, 0x80, +0x00, 0x7B, 0x01, 0x7A, 0x93, 0x79, 0x3B, 0x90, 0x93, 0x68, 0x12, 0x49, 0x21, 0x7A, 0x93, 0x79, +0x51, 0x90, 0x93, 0x6B, 0x12, 0x49, 0x21, 0x90, 0x93, 0x62, 0xE0, 0x75, 0xF0, 0x38, 0xA4, 0x24, +0xF6, 0xF9, 0x74, 0x8E, 0x35, 0xF0, 0xFA, 0x90, 0x93, 0x6E, 0x12, 0x49, 0x21, 0xE4, 0x90, 0x93, +0x71, 0xF0, 0xA3, 0xF0, 0x7A, 0x93, 0x79, 0x41, 0x12, 0x54, 0x77, 0x80, 0x07, 0x90, 0x06, 0x33, +0xE0, 0x44, 0x05, 0xF0, 0x90, 0x93, 0x63, 0xE0, 0x04, 0xF0, 0x81, 0xF7, 0x90, 0x93, 0x62, 0xE0, +0x04, 0xF0, 0x81, 0xDB, 0x90, 0x93, 0x64, 0xE0, 0xFF, 0x22, 0x90, 0x93, 0x61, 0xE0, 0xFF, 0xC3, +0x22, 0xF5, 0x83, 0xEF, 0xF0, 0x90, 0x93, 0x61, 0xE0, 0x04, 0xF0, 0x22, 0x7E, 0x00, 0x7F, 0x10, +0x02, 0x06, 0x63, 0x90, 0x8E, 0xF4, 0x12, 0x49, 0x0C, 0xE0, 0x22, 0x90, 0x93, 0x62, 0xE0, 0xFF, +0x75, 0xF0, 0x38, 0x22, 0x7D, 0x01, 0x7E, 0x00, 0x7F, 0x10, 0x12, 0x4A, 0xD6, 0xEF, 0x22, 0x90, +0x93, 0x3A, 0xE0, 0xFD, 0x90, 0x93, 0x39, 0xE0, 0x2D, 0xFD, 0x22, 0x78, 0x3B, 0x7C, 0x93, 0x7D, +0x01, 0x22, 0xE0, 0x24, 0x41, 0xF5, 0x82, 0xE4, 0x34, 0x93, 0x22, 0xE0, 0x24, 0x3B, 0xF5, 0x82, +0xE4, 0x34, 0x93, 0x22, 0x78, 0x41, 0x7C, 0x93, 0x7D, 0x01, 0x7B, 0xFF, 0x22, 0x90, 0x93, 0x9F, +0x12, 0x49, 0x21, 0x90, 0x93, 0xA2, 0x12, 0x57, 0x05, 0x75, 0x43, 0x10, 0x7B, 0x01, 0x7A, 0x8F, +0x79, 0x64, 0x12, 0x34, 0x62, 0x90, 0x93, 0x9F, 0x12, 0x57, 0x05, 0x75, 0x43, 0x10, 0x7B, 0x01, +0x7A, 0x8F, 0x79, 0x74, 0x12, 0x34, 0x62, 0x90, 0x93, 0xA5, 0x12, 0x48, 0xF4, 0x90, 0x8F, 0x84, +0x12, 0x08, 0x6D, 0x90, 0x93, 0xA9, 0xE0, 0x90, 0x8F, 0x8B, 0xF0, 0x22, 0x90, 0x8E, 0xC9, 0xE0, +0x30, 0xE0, 0x03, 0x7F, 0x01, 0x22, 0x90, 0x06, 0x90, 0xE0, 0x20, 0xE5, 0x10, 0x90, 0x01, 0x3F, +0xE0, 0x30, 0xE2, 0x09, 0x90, 0x01, 0xC7, 0x74, 0x25, 0xF0, 0x7F, 0x01, 0x22, 0x7F, 0x00, 0x22, +0x90, 0x02, 0x09, 0xE0, 0x90, 0x93, 0x3C, 0xF0, 0x12, 0x06, 0x89, 0x90, 0x93, 0x12, 0x12, 0x76, +0xE6, 0x90, 0x93, 0x13, 0xF0, 0x22, 0x90, 0x02, 0x09, 0xE0, 0xFF, 0x12, 0x06, 0x89, 0xFE, 0xEF, +0x2E, 0x90, 0x93, 0x22, 0xF0, 0x22, 0xEF, 0x60, 0x08, 0x90, 0x93, 0x15, 0xE0, 0xFF, 0x12, 0x83, +0xFC, 0x22, 0xEF, 0x60, 0x0A, 0x90, 0x06, 0x31, 0xE0, 0x44, 0x80, 0xF0, 0x12, 0x7D, 0x6D, 0x22, +0xEF, 0x60, 0x06, 0x12, 0x85, 0x6D, 0x12, 0x7C, 0xA4, 0x22, 0xF1, 0x1B, 0x12, 0x87, 0xA1, 0x30, +0xE0, 0x18, 0x90, 0x8D, 0xFB, 0xE0, 0xFF, 0xC4, 0x54, 0x0F, 0x20, 0xE0, 0x0D, 0x90, 0x93, 0x4B, +0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x14, 0x12, 0x50, 0x31, 0x22, 0x22, 0x7E, 0x00, 0x7F, 0x08, +0x7D, 0x00, 0x7B, 0x01, 0x7A, 0x93, 0x79, 0x28, 0x12, 0x08, 0xAA, 0x90, 0x93, 0x29, 0x74, 0x08, +0xF0, 0xA3, 0x74, 0x03, 0xF0, 0x22, 0x90, 0x04, 0x1A, 0xE0, 0xF4, 0x60, 0x03, 0x7F, 0x00, 0x22, +0x90, 0x04, 0x1B, 0xE0, 0x54, 0x07, 0x64, 0x07, 0x7F, 0x01, 0x60, 0x02, 0x7F, 0x00, 0x22, 0xEF, +0x24, 0xFE, 0x60, 0x0B, 0x04, 0x70, 0x24, 0x90, 0x8E, 0x1B, 0x74, 0x02, 0xF0, 0x80, 0x13, 0xED, +0x70, 0x06, 0x90, 0x8E, 0xBC, 0xE0, 0x80, 0x02, 0xED, 0x14, 0x90, 0x8E, 0x1B, 0xF0, 0x90, 0x8E, +0x1B, 0xE0, 0xA3, 0xF0, 0x90, 0x8E, 0x12, 0xE0, 0x44, 0x08, 0xF0, 0x22, 0x7D, 0x2E, 0x7F, 0x6F, +0x12, 0x54, 0x6C, 0x7D, 0x02, 0x7F, 0x01, 0x02, 0x53, 0xF7, 0x12, 0x87, 0xC9, 0x7D, 0x0C, 0x7F, +0x01, 0x02, 0x53, 0xF7, 0x90, 0x93, 0x3F, 0xED, 0xF0, 0x90, 0x93, 0x3D, 0xEE, 0xF0, 0xA3, 0xEF, +0xF0, 0x12, 0x94, 0x74, 0x90, 0x93, 0x3D, 0x12, 0x6F, 0x85, 0xFD, 0x02, 0x5A, 0xAD, 0xAD, 0x07, +0x90, 0x90, 0x7A, 0x12, 0x5A, 0xA6, 0x90, 0x90, 0x7A, 0xE0, 0xFF, 0xAE, 0x05, 0x74, 0x04, 0x2E, +0x12, 0x86, 0xCB, 0xEF, 0xF0, 0x90, 0x90, 0x7A, 0xA3, 0xE0, 0xFF, 0x74, 0x05, 0x2E, 0xF5, 0x82, +0xE4, 0x34, 0xFC, 0xF5, 0x83, 0xEF, 0xF0, 0x22, 0x7F, 0x50, 0x7E, 0x0C, 0x12, 0x37, 0xBC, 0x90, +0x94, 0x4A, 0xEF, 0xF0, 0x7F, 0x58, 0x7E, 0x0C, 0x12, 0x37, 0xBC, 0x90, 0x94, 0x4B, 0xEF, 0xF0, +0x90, 0x94, 0x8F, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x7F, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, +0x00, 0x00, 0x00, 0x17, 0x7F, 0x50, 0x7E, 0x0C, 0x12, 0x66, 0x52, 0x12, 0x08, 0x79, 0x00, 0x00, +0x00, 0x7F, 0x90, 0x94, 0x93, 0x12, 0x08, 0x79, 0x00, 0x00, 0x00, 0x17, 0x12, 0x87, 0x8B, 0x90, +0x06, 0x08, 0xE0, 0x90, 0x94, 0x60, 0xF0, 0x90, 0x06, 0xA1, 0xE0, 0xFE, 0x90, 0x06, 0xA0, 0x12, +0x7C, 0x9B, 0x90, 0x94, 0x62, 0xF0, 0xA3, 0xEF, 0x11, 0x4B, 0x90, 0x06, 0xA0, 0x74, 0x20, 0xF0, +0xA3, 0x74, 0x01, 0xF0, 0xE4, 0xFB, 0xFD, 0xFF, 0x02, 0x60, 0x6A, 0xF0, 0x90, 0x06, 0x08, 0xE0, +0x54, 0x7F, 0xF0, 0x22, 0xD3, 0x10, 0xAF, 0x01, 0xC3, 0xC0, 0xD0, 0x90, 0x94, 0x4C, 0xE0, 0xFE, +0x90, 0x94, 0x49, 0xE0, 0xC3, 0x9E, 0x40, 0x04, 0x7F, 0x00, 0x80, 0x06, 0xEF, 0x7F, 0x01, 0x70, +0x01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 0x90, 0x93, 0x3E, 0xF0, 0x22, 0x90, 0x93, 0x3C, +0xA3, 0xE0, 0x24, 0x03, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0x22, 0x90, 0x93, 0x59, 0xE0, 0xFF, 0x24, +0xDF, 0xF5, 0x82, 0xE4, 0x34, 0x8F, 0xF5, 0x83, 0x22, 0x90, 0x94, 0xFB, 0xE0, 0xFE, 0xA3, 0xE0, +0xFF, 0x90, 0x94, 0xFE, 0xE0, 0xFD, 0x90, 0x94, 0xFD, 0xE0, 0x2D, 0x22, 0x90, 0x93, 0x3C, 0xA3, +0xE0, 0xFF, 0xA3, 0xE0, 0xFE, 0x2F, 0x22, 0x90, 0x93, 0x3C, 0xA3, 0xE0, 0x24, 0x01, 0xF5, 0x82, +0xE4, 0x22, 0x7D, 0x01, 0x7B, 0x01, 0x7A, 0x8E, 0x79, 0xE6, 0x7E, 0x00, 0x7F, 0x04, 0x02, 0x4A, +0xD6, 0x75, 0xF0, 0x20, 0xA4, 0x24, 0x0E, 0xF9, 0x74, 0x91, 0x35, 0xF0, 0xFA, 0x7B, 0x01, 0x22, +0x90, 0x94, 0x75, 0xE0, 0xFE, 0xA3, 0xE0, 0xFF, 0x22, 0xE0, 0x90, 0x01, 0xBA, 0xF0, 0x90, 0x8E, +0x17, 0xE0, 0x90, 0x01, 0xBB, 0xF0, 0x22, 0x90, 0x93, 0x57, 0xEF, 0xF0, 0x90, 0x93, 0x17, 0xE0, +0x90, 0x04, 0x25, 0x22, 0x90, 0x94, 0xA2, 0x12, 0x49, 0x21, 0xE4, 0x90, 0x94, 0xA5, 0xF0, 0xA3, +0x22, 0x7F, 0x00, 0x7E, 0x0C, 0x12, 0x38, 0x07, 0x7F, 0x00, 0x7E, 0x0E, 0x22, 0xFF, 0xEE, 0x54, +0x3F, 0x90, 0x8E, 0x50, 0xF0, 0xA3, 0xEF, 0xF0, 0x22, 0x24, 0x30, 0xF9, 0xE4, 0x34, 0xFC, 0xFA, +0x7B, 0x01, 0x22, 0xF0, 0xEE, 0x54, 0x20, 0xFE, 0xEF, 0x54, 0xDF, 0x4E, 0x22, 0x90, 0x95, 0x35, +0xF0, 0xE0, 0x90, 0x04, 0x54, 0xF0, 0x22, 0x90, 0x95, 0x1E, 0xE0, 0xFF, 0x74, 0x64, 0xD3, 0x9F, +0x22, 0x90, 0x95, 0x1E, 0xE0, 0xFF, 0x74, 0x24, 0xD3, 0x9F, 0x22, 0x2F, 0xF8, 0xE6, 0xFE, 0xED, +0xF4, 0x5E, 0xFE, 0xF6, 0x22, 0x54, 0x10, 0xFD, 0xEF, 0x54, 0xEF, 0x4D, 0xFF, 0x22, 0x54, 0x40, +0xFD, 0xEF, 0x54, 0xBF, 0x4D, 0xFF, 0x22, 0x74, 0x05, 0x2D, 0xF5, 0x82, 0xE4, 0x34, 0xFC, 0x22, +0xF0, 0xEE, 0x54, 0x80, 0xFE, 0xEF, 0x54, 0x7F, 0x22, 0x7F, 0xB4, 0x7E, 0x08, 0x12, 0x37, 0xBC, +0xEF, 0x22, 0x54, 0x04, 0xFD, 0xEF, 0x54, 0xFB, 0x4D, 0x22, 0xE4, 0x75, 0xF0, 0x20, 0x02, 0x08, +0xD6, 0x7F, 0x01, 0x7E, 0x00, 0x02, 0x3C, 0xEC, 0x90, 0x8D, 0xFB, 0xE0, 0xFF, 0xC3, 0x13, 0x22, +0xE0, 0xFC, 0xA3, 0xE0, 0xFD, 0xEC, 0xFF, 0x22, 0xE3, 0x90, +}; +u4Byte ArrayLength_MP_8821A_FW_WoWLAN = 27274; + + +void +ODM_ReadFirmware_MP_8821A_FW_WoWLAN( + IN PDM_ODM_T pDM_Odm, + OUT u1Byte *pFirmware, + OUT u4Byte *pFirmwareSize +) +{ +#if (DM_ODM_SUPPORT_TYPE & (ODM_CE)) + *((SIZE_PTR *)pFirmware) = (SIZE_PTR)Array_MP_8821A_FW_WoWLAN; +#else + ODM_MoveMemory(pDM_Odm, pFirmware, Array_MP_8821A_FW_WoWLAN, ArrayLength_MP_8821A_FW_WoWLAN); +#endif + *pFirmwareSize = ArrayLength_MP_8821A_FW_WoWLAN; +} + +#ifdef CONFIG_MP_INCLUDED +u8 Rtl8821A_BT_MP_Patch_FW [Rtl8812BFwBTImgArrayLength] = { +0x52, 0x65, 0x61, 0x6c, 0x74, 0x65, 0x63, 0x68, 0x8e, 0x50, 0x2f, 0x80, 0x02, 0x00, 0x01, 0x00, 0x02, 0x00, 0x1c, 0x3e, 0x98, 0x3e, 0x30, 0x00, 0x00, 0x00, 0xc0, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x63, 0x09, 0x62, 0x08, 0xd1, 0x07, 0xd0, 0x00, 0x6a, 0x5f, 0xb3, 0x40, 0xdb, 0x5f, 0xb4, 0x5f, 0xb3, 0xa0, 0x9c, 0x40, 0xc3, 0x5f, 0xb2, 0xac, 0xea, 0x5f, 0xb5, 0xae, 0xea, 0x03, 0x2a, 0x40, 0xdc, 0x01, 0x6a, 0x40, 0xc3, 0x5d, 0xb2, 0x40, 0x9a, 0x5d, 0xb3, 0x5d, 0xb0, 0x42, 0x34, 0x82, 0x34, 0x80, 0xcb, 0x5c, 0xb3, 0x40, 0xcb, 0x5c, 0xb3, 0x5d, 0xb2, 0x80, 0x18, 0x90, 0x2d, 0x60, 0xda, 0x5c, 0xb3, 0x5c, 0xb2, 0x60, 0xda, 0x5c, 0xb3, 0x5d, 0xb2, 0x60, 0xda, 0x5d, 0xb3, 0x5d, 0xb2, 0x60, 0xda, 0x5d, 0xb3, 0x5e, 0xb2, 0x60, 0xda, 0x5e, 0xb3, 0x5e, 0xb2, 0x60, 0xda, 0x5e, 0xb3, 0x5f, 0xb2, 0x60, 0xda, 0x5f, 0xb3, 0x5f, 0xb2, 0x60, 0xda, 0x45, 0xf1, 0x09, 0x6a, 0x00, 0xf1, 0x50, 0xc8,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, 0xa0, 0xff, 0x73, 0x4d, 0xb3, 0x0d, 0x61, 0x80, 0xa3, 0x08, 0x6b, 0x8c, 0xeb, 0x05, 0x23, 0x80, 0xa2, 0x01, 0x6b, 0x8d, 0xeb, 0x60, 0xc2, 0x1a, 0x10, 0x60, 0xa2, 0x6c, 0xe9, 0x20, 0xc2, 0x16, 0x10, 0x40, 0xa2, 0xa0, 0xa3, 0x01, 0x6c, 0x4c, 0xec, 0x0f, 0x6a, 0xac, 0xea, 0x8c, 0x34, 0x4d, 0xec, 0x10, 0x6a, 0x4b, 0xea, 0xac, 0xea, 0x8d, 0xea, 0x08, 0x10, 0x60, 0xa2, 0x6c, 0xe9, 0x20, 0xc2, 0x3d, 0xb3, 0x80, 0xa3, 0x09, 0x6a, 0x4b, 0xea, 0x8c, 0xea, 0x40, 0xc3, 0x09, 0x97, 0x08, 0x91, 0x07, 0x90, 0x00, 0xef, 0x05, 0x63, 0x00, 0x65, 0x4c, 0x8b, 0x10, 0x80, 0x54, 0x8b, 0x10, 0x80, 0x08, 0x94, 0x10, 0x80, 0xff, 0xff, 0xff, 0x00, 0xee, 0xff, 0xc0, 0x00, 0x18, 0xde, 0x10, 0x80, 0x42, 0x00, 0x11, 0x80, 0x48, 0x00, 0x11, 0x80, 0x40, 0x00, 0x11, 0x80, 0xb5, 0xc4, 0x10, 0x80, 0xc0, 0x07, 0x11, 0x80, 0x39, 0xcd, 0x10, 0x80, 0xfc, 0x06, 0x11, 0x80, 0x71, 0xc1, 0x10, 0x80, 0xf4, 0x18, 0x11, 0x80, 0xe9, 0xc0, 0x10, 0x80, 0x50, 0x19, 0x11, 0x80, 0x59, 0xcc, 0x10, 0x80, 0x8c, 0x07, 0x11, 0x80, 0x59, 0xb8, 0x10, 0x80, 0xe0, 0x06, 0x11, 0x80, 0x89, 0xb8, 0x10, 0x80, 0xc0, 0x06, 0x11, 0x80, 0x19, 0xb9, 0x10, 0x80, 0x04, 0x08, 0x11, 0x80, 0x14, 0xc0, 0x52, 0x02, 0x58, 0xd5, 0xc8, 0x19, 0x0d, 0xb6, 0x10, 0x80, 0x38, 0x1b, 0x11, 0x80, 0xb9, 0xd5, 0x10, 0x80, 0xc8, 0x1a, 0x11, 0x80, 0x99, 0xcd, 0x10, 0x80, 0x6c, 0x07, 0x11, 0x80, 0x6d, 0xce, 0x10, 0x80, 0x18, 0x19, 0x11, 0x80, 0xb1, 0xb8, 0x10, 0x80, 0x90, 0x07, 0x11, 0x80, 0xe5, 0xb8, 0x10, 0x80, 0x24, 0x08, 0x11, 0x80, 0xbd, 0xc6, 0x10, 0x80, 0x5c, 0x07, 0x11, 0x80, 0x45, 0xd6, 0x10, 0x80, 0xd0, 0x1a, 0x11, 0x80, 0x69, 0xca, 0x10, 0x80, 0xec, 0x18, 0x11, 0x80, 0xe9, 0xb8, 0x10, 0x80, 0xf0, 0x18, 0x11, 0x80, 0x3d, 0xc9, 0x10, 0x80, 0x5c, 0x1b, 0x11, 0x80, 0x21, 0xb9, 0x10, 0x80, 0xe8, 0x19, 0x11, 0x80, 0xa1, 0xcb, 0x10, 0x80, 0xd0, 0x06, 0x11, 0x80, 0x2c, 0x3a, 0x11, 0x80, 0x2b, 0x02, 0x11, 0x80, 0xe8, 0x3a, 0x11, 0x80, 0xfd, 0x63, 0x05, 0x62, 0x04, 0xd0, 0x0a, 0xb0, 0x90, 0x67, 0x00, 0x6d, +0x00, 0x18, 0x29, 0x34, 0x38, 0x6e, 0x01, 0x6a, 0x4b, 0xea, 0x47, 0xd8, 0x70, 0x6a, 0x43, 0xc0, 0x0a, 0x6a, 0x4c, 0xc0, 0x08, 0x6a, 0x4d, 0xc0, 0x05, 0x97, 0x04, 0x90, 0x00, 0xef, 0x03, 0x63, 0xe8, 0x93, 0x11, 0x80, 0xd6, 0x63, 0x53, 0x62, 0x52, 0xd1, 0x51, 0xd0, 0x00, 0xf4, 0x05, 0x6a, 0x7d, 0x67, 0x52, 0xcb, 0x0d, 0x6a, 0x20, 0xf0, 0x46, 0xc3, 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x20, 0x18, 0xc5, 0x30, 0x06, 0xd2, 0x06, 0x10, 0x5d, 0x67, 0x20, 0xf1, 0x68, 0x42, 0x40, 0xab, 0x80, 0xf0, 0x44, 0xc9, 0x00, 0x18, 0xe6, 0xa0, 0x09, 0x04, 0x02, 0x67, 0x0e, 0x22, 0x7d, 0x67, 0x20, 0xf0, 0x80, 0xa3, 0xe0, 0xf0, 0xa3, 0xa1, 0x00, 0x18, 0xa8, 0xe1, 0x00, 0x65, 0x0a, 0xb4, 0x00, 0x18, 0xa4, 0xe1, 0x00, 0x65, 0x4a, 0xd0, 0x08, 0x10, 0x5d, 0x67, 0x91, 0xaa, 0x20, 0x18, 0x21, 0x26, 0x01, 0x6d, 0x02, 0x10, 0x0c, 0x6b, 0x4a, 0xd3, 0x4a, 0x92, 0x53, 0x97, 0x52, 0x91, 0x51, 0x90, 0x00, 0xef, 0x2a, 0x63, 0xfc, 0x93, 0x11, 0x80, 0x80, 0x50, 0x11, 0x80, 0x09, 0x50, 0x11, 0x80, 0xb0, 0x51, 0x11, 0x80, 0x74, 0x54, 0x11, 0x80, 0xb0, 0xe7, 0x04, 0x80, 0xfd, 0x63, 0x05, 0x62, 0x10, 0xb3, 0x00, 0x6d, 0xc0, 0xf1, 0xaa, 0xc3, 0xc0, 0xf1, 0xbe, 0xc3, 0xff, 0x6a, 0x03, 0x6d, 0x8c, 0xea, 0xc0, 0xf1, 0xbc, 0xc3, 0x02, 0x6c, 0x0b, 0xb5, 0xc0, 0xf1, 0x89, 0xc3, 0xc0, 0xf1, 0x88, 0xc3, 0xc0, 0xf1, 0x9d, 0xc3, 0x60, 0xf1, 0x40, 0xc3, 0x80, 0xc5, 0x00, 0x18, 0x82, 0xa9, 0x82, 0x67, 0x06, 0xb2, 0x00, 0x6b, 0x60, 0xda, 0x61, 0xda, 0x05, 0x97, 0x00, 0xef, 0x03, 0x63, 0x80, 0x50, 0x11, 0x80, 0x09, 0x50, 0x11, 0x80, 0xb0, 0x51, 0x11, 0x80, 0xdc, 0x63, 0x47, 0x62, 0x00, 0xf4, 0x06, 0x6a, 0x7d, 0x67, 0x4a, 0xcb, 0x03, 0x6a, 0x56, 0xc3, 0x13, 0x6a, 0x59, 0xc3, 0x1d, 0xb2, 0x6d, 0xa2, 0x08, 0x73, 0x1a, 0x60, 0xff, 0x6c, 0x09, 0x4c, 0x98, 0xeb, 0x1b, 0xb2, 0x01, 0x6d, 0x12, 0xec, 0x91, 0xe2, 0x20, 0xf1, 0xcf, 0xa4, 0xac, 0xee, 0x0f, 0x26, 0x00, 0xf1, 0x52, 0xaa, 0x47, 0xeb, 0xac, 0xea, 0x0a, 0x22, 0x20, 0xf1, 0x4c, +0xac, 0x7d, 0x67, 0x05, 0x04, 0x57, 0xc3, 0x42, 0x32, 0x58, 0xc3, 0x00, 0x18, 0x47, 0x4f, 0x04, 0x05, 0x0e, 0xb2, 0x4c, 0xa2, 0x0a, 0x72, 0x14, 0x60, 0xc0, 0xf2, 0x0c, 0x6b, 0x78, 0xea, 0x0d, 0xb3, 0x12, 0xea, 0x49, 0xe3, 0xe0, 0xf0, 0x66, 0xa2, 0x01, 0x73, 0x0a, 0x61, 0x60, 0xf2, 0x56, 0xaa, 0x7d, 0x67, 0x05, 0x04, 0x57, 0xc3, 0x42, 0x32, 0x58, 0xc3, 0x00, 0x18, 0x47, 0x4f, 0x04, 0x05, 0x47, 0x97, 0x00, 0xef, 0x24, 0x63, 0x00, 0x65, 0xe8, 0x93, 0x11, 0x80, 0x00, 0x3b, 0x11, 0x80, 0x74, 0x54, 0x11, 0x80, 0xdc, 0x63, 0x47, 0x62, 0x46, 0xd0, 0x00, 0x6a, 0x18, 0xb3, 0x9d, 0x67, 0x40, 0xdb, 0x41, 0xdb, 0x04, 0xf0, 0x06, 0x6b, 0x68, 0xcc, 0x54, 0xc4, 0x56, 0xc4, 0x57, 0xc4, 0x58, 0xc4, 0x59, 0xc4, 0x5a, 0xc4, 0x5b, 0xc4, 0x5c, 0xc4, 0x5d, 0xc4, 0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 0x6a, 0xc5, 0x20, 0xf0, 0x4b, 0xc5, 0x00, 0x18, 0xee, 0xc7, 0x04, 0x04, 0x47, 0x97, 0x00, 0xef, 0x24, 0x63, 0xb0, 0x51, 0x11, 0x80, 0xe8, 0x93, 0x11, 0x80, 0xdc, 0x63, 0x47 +, 0x62, 0x0c, 0xb2, 0x00, 0x6b, 0x60, 0xda, 0x61, 0xda, 0x7d, 0x67, 0x04, 0xf0, 0x1d, 0x6a, 0x48, 0xcb, 0x01, 0x6a, 0x52, 0xc3, 0x08, 0xb2, 0x41, 0xaa, 0x7f, 0x6b, 0x04, 0x04, 0x4a, 0x32, 0x6c, 0xea, 0x7d, 0x67, 0x00, 0x18, 0x51, 0xc5, 0x53, 0xc3, 0x47, 0x97, 0x00, 0xef, 0x24, 0x63, 0x00, 0x65, 0xb0, 0x51, 0x11, 0x80, 0xe8, 0x93, 0x11, 0x80, 0xdb, 0x63, 0x49, 0x62, 0x48, 0xd1, 0x47, 0xd0, 0x00, 0x69, 0x0e, 0xb2, 0x7d, 0x67, 0x20, 0xda, 0x21, 0xda, 0x04, 0xf0, 0x1f, 0x6a, 0x48, 0xcb, 0x0b, 0xb2, 0x81, 0xf1, 0x48, 0xaa, 0x0b, 0xb0, 0x32, 0xc3, 0x04, 0x04, 0x00, 0x18, 0xcb, 0xc4, 0x4b, 0xd8, 0x64, 0xa0, 0x41, 0x6a, 0x4b, 0xea, 0x6c, 0xea, 0x29, 0xc0, 0x44, 0xc0, 0x49, 0x97, 0x48, 0x91, 0x47, 0x90, 0x00, 0xef, 0x25, 0x63, 0xb0, 0x51, 0x11, 0x80, 0x00, 0x3b, 0x11, 0x80, 0xe8, 0x93, 0x11, 0x80, 0xdc, 0x63, 0x47, 0x62, 0x46, 0xd0, 0x00, 0x68, 0x0b, 0xb2, 0x7d, 0x67, 0x00, 0xda, 0x01, 0xda, 0x04, 0xf0, 0x1f, 0x6a, 0x12, 0xc3, 0x04, 0x04, 0x00, 0x18, 0xcb, 0xc4, 0x48, 0xcb, 0x07, 0xb2, 0x84, 0xa2, 0x41, 0x6b, 0x6b, 0xeb, 0x8c, 0xeb, 0x64, 0xc2, 0x09, 0xc2, 0x47, 0x97, 0x46, 0x90, 0x00, 0xef, 0x24, 0x63, 0xb0, 0x51, 0x11, 0x80, 0xe8, 0x93, 0x11, 0x80, 0xdc, 0x63, 0x47, 0x62, 0x1c, 0xb2, 0x00, 0x6b, 0x60, 0xda, 0x61, 0xda, 0x1b, 0xb2, 0x64, 0xa2, 0x07, 0x6d, 0x6e, 0x34, 0xac, 0xec, 0x05, 0x54, 0x06, 0x61, 0x39, 0x6c, 0x8b, 0xec, 0x6c, 0xec, 0x20, 0x6b, 0x6d, 0xec, 0x84, 0xc2, 0x15, 0xb2, 0x64, 0xa2, 0x07, 0x6c, 0x14, 0xb5, 0x6e, 0x33, 0x8c, 0xeb, 0x6d, 0xe5, 0x60, 0xa3, 0xc3, 0xa2, 0x6c, 0xec, 0x0f, 0x6b, 0x6b, 0xeb, 0x84, 0x35, 0xcc, 0xeb, 0xad, 0xeb, 0x63, 0xc2, 0xbd, 0x67, 0x04, 0xf0, 0x1e, 0x6b, 0x68, 0xcd, 0x03, 0x6b, 0x72, 0xc5, 0x61, 0xaa, 0x7f, 0x6d, 0x6a, 0x33, 0xac, 0xeb, 0xbd, 0x67, 0x73, 0xc5, 0x40, 0x9a, 0x95, 0xc5, 0x04, 0x04, 0x42, 0x32, 0x00, 0x18, 0x07, 0xc5, 0x54, 0xc5, 0x47, 0x97, 0x00, 0xef, 0x24, 0x63, 0x00, 0x65, 0xb0, 0x51, 0x11, 0x80, 0xe8, 0x93, 0x11, 0x80, 0x04, 0xdc, 0x10, 0x80, 0xfd, 0x63, 0x05, 0x62, 0x57, 0x6c, 0x00, 0x18, 0xa1, 0xa5, 0x01, 0x6d, 0xff, 0xf7, 0x1f, 0x6b, 0x02, 0xf1, +0x01, 0x6e, 0x4c, 0xeb, 0xcb, 0xee, 0x6c, 0xee, 0x57, 0x6c, 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x63, 0xe8, 0x93, 0x11, 0x80, 0xfb, 0x63, 0x09, 0x62, 0x08, 0xd1, 0x07, 0xd0, 0x11, 0xb2, 0x47, 0x9a, 0xff, 0x68, 0x8c, 0xe8, 0x01, 0x4a, 0x04, 0x22, 0x0f, 0xb4, 0x00, 0x18, 0x4d, 0x1d, 0x00, 0x65, 0x11, 0x20, 0x00, 0x69, 0x0b, 0xb0, 0x01, 0x6c, 0x0b, 0xb5, 0x0c, 0xb6, 0xf1, 0x67, 0x00, 0x18, 0x5b, 0x1d, 0x04, 0xd1, 0x87, 0x98, 0x00, 0x18, 0x40, 0x1d, 0x14, 0x6d, 0x00, 0x6a, 0x30, 0xc8, 0x20, 0xf0, 0x49, 0xc0, 0x09, 0x97, 0x08, 0x91, 0x07, 0x90, 0x00, 0xef, 0x05, 0x63, 0x00, 0x65, 0xe8, 0x93, 0x11, 0x80, 0x04, 0x94, 0x11, 0x80, 0x59, 0xa9, 0x10, 0x80, 0xfd, 0x63, 0x05, 0x62, 0x04, 0xd0, 0x57, 0x6c, 0x00, 0x18, 0xa1, 0xa5, 0x01, 0x6d, 0xff, 0xf7, 0x1f, 0x68, 0xff, 0x6b, 0x0c, 0xea, 0x02, 0x4b, 0x6b, 0xeb, 0xc2, 0x67, 0x6c, 0xee, 0x57, 0x6c, 0x00, 0x18, 0x01, 0xa6, 0x01, 0x6d, 0x59, 0x6c, 0x00, 0x18, 0xa1, 0xa5, 0x01, 0x6d, 0x0c, 0xea, 0x00, 0xf2 +, 0x01, 0x6b, 0x6b, 0xeb, 0xc2, 0x67, 0x6c, 0xee, 0x59, 0x6c, 0x00, 0x18, 0x01, 0xa6, 0x01, 0x6d, 0x00, 0x6c, 0x0c, 0xb0, 0xa4, 0x67, 0x00, 0x18, 0x01, 0xa6, 0xc4, 0x67, 0xd1, 0xa8, 0x01, 0x6d, 0x00, 0x18, 0x01, 0xa6, 0x42, 0x6c, 0x80, 0x18, 0x22, 0x2a, 0x00, 0x6c, 0x64, 0xa0, 0x41, 0x6a, 0x4b, 0xea, 0x6c, 0xea, 0x44, 0xc0, 0x00, 0x6a, 0x49, 0xc0, 0x05, 0x97, 0x04, 0x90, 0x00, 0xef, 0x03, 0x63, 0xe8, 0x93, 0x11, 0x80, 0xfc, 0x63, 0x07, 0x62, 0x06, 0xd1, 0x05, 0xd0, 0x20, 0xb2, 0x47, 0x9a, 0x08, 0xd4, 0x8e, 0xea, 0x05, 0x22, 0x01, 0x4c, 0x03, 0x24, 0x00, 0x18, 0x4d, 0x1d, 0x08, 0x04, 0x1b, 0xb0, 0x64, 0xa0, 0x40, 0x6a, 0x6c, 0xea, 0x08, 0x2a, 0x47, 0x98, 0x01, 0x4a, 0x29, 0x22, 0x18, 0xb4, 0x00, 0x18, 0x4d, 0x1d, 0x00, 0x65, 0x24, 0x10, 0x02, 0x69, 0x6c, 0xe9, 0xff, 0x6a, 0x4c, 0xe9, 0x07, 0x21, 0x80, 0x18, 0xfd, 0x29, 0x00, 0x65, 0x50, 0xa8, 0x01, 0x4a, 0x50, 0xc8, 0x18, 0x10, 0x7d, 0x6c, 0x00, 0x18, 0xa1, 0xa5, 0x01, 0x6d, 0x04, 0x6b, 0x4c, 0xeb, 0x06, 0x23, 0x50, 0xa8, 0x20, 0xf0, 0x29, 0xc0, 0x01, 0x4a, 0x50, 0xc8, 0x0b, 0x10, 0x20, 0xf0, 0x49, 0xa0, 0x19, 0x5a, 0x04, 0x60, 0x01, 0x4a, 0x20, 0xf0, 0x49, 0xc0, 0x03, 0x10, 0x80, 0x18, 0x38, 0x2a, 0x00, 0x65, 0x07, 0x97, 0x06, 0x91, 0x05, 0x90, 0x00, 0xef, 0x04, 0x63, 0xe8, 0x93, 0x11, 0x80, 0x04, 0x94, 0x11, 0x80, 0xfc, 0x63, 0x07, 0x62, 0x06, 0xd1, 0x05, 0xd0, 0x00, 0x6c, 0x02, 0xf0, 0x00, 0x6e, 0x00, 0x18, 0x01, 0xa6, 0xa4, 0x67, 0x2b, 0xb2, 0xc1, 0xaa, 0x7f, 0x6a, 0x3c, 0x6c, 0xca, 0x36, 0x4c, 0xee, 0x29, 0xb2, 0x00, 0xf6, 0xc0, 0x36, 0x00, 0x6d, 0x00, 0x18, 0x01, 0xa6, 0x4d, 0xee, 0x57, 0x6c, 0x00, 0x18, 0xa1, 0xa5, 0x01, 0x6d, 0xff, 0xf7, 0x1f, 0x68, 0x0c, 0xea, 0x01, 0xf6, 0x01, 0x6b, 0x6b, 0xeb, 0xc2, 0x67, 0x6c, 0xee, 0x57, 0x6c, 0x00, 0x18, 0x01, 0xa6, 0x01, 0x6d, 0x57, 0x6c, 0x00, 0x18, 0xa1, 0xa5, 0x01, 0x6d, 0x0c, 0xea, 0x01, 0xf6, 0x00, 0x6b, 0xc2, 0x67, 0x6d, 0xee, 0x57, 0x6c, 0x00, 0x18, 0x01, 0xa6, 0x01, 0x6d, 0x57, 0x6c, 0x00, 0x18, 0xa1, 0xa5, 0x01, 0x6d, 0x0c, 0xea, 0x03, 0x69, 0x2b, 0xe9, 0xc2, 0x67, 0x2c, 0xee, 0x57, 0x6c, 0x00, +0x18, 0x01, 0xa6, 0x01, 0x6d, 0x57, 0x6c, 0x00, 0x18, 0xa1, 0xa5, 0x01, 0x6d, 0x0c, 0xea, 0x02, 0x6b, 0xc2, 0x67, 0x6d, 0xee, 0x57, 0x6c, 0x00, 0x18, 0x01, 0xa6, 0x01, 0x6d, 0x57, 0x6c, 0x00, 0x18, 0xa1, 0xa5, 0x01, 0x6d, 0x0c, 0xea, 0xc2, 0x67, 0x2c, 0xee, 0x01, 0x6d, 0x00, 0x18, 0x01, 0xa6, 0x57, 0x6c, 0x80, 0x18, 0x22, 0x2a, 0x01, 0x6c, 0x07, 0x97, 0x06, 0x91, 0x05, 0x90, 0x00, 0xef, 0x04, 0x63, 0xe8, 0x93, 0x11, 0x80, 0x00, 0x00, 0x00, 0x80, 0xfd, 0x63, 0x05, 0x62, 0x04, 0xd0, 0x00, 0x6c, 0xc4, 0x67, 0x00, 0x18, 0x01, 0xa6, 0xa4, 0x67, 0x57, 0x6c, 0x00, 0x18, 0xa1, 0xa5, 0x01, 0x6d, 0xff, 0x6e, 0xff, 0xf7, 0x1f, 0x6b, 0x04, 0x4e, 0x4c, 0xeb, 0xcb, 0xee, 0x6c, 0xee, 0x01, 0x6d, 0x0b, 0xb0, 0x00, 0x18, 0x01, 0xa6, 0x57, 0x6c, 0x64, 0xa0, 0x41, 0x6a, 0x4b, 0xea, 0x6c, 0xea, 0x00, 0x6c, 0x80, 0x18, 0x22, 0x2a, 0x44, 0xc0, 0x80, 0x18, 0xfd, 0x29, 0x00, 0x65, 0x00, 0x6a, 0x49, 0xc0, 0x05, 0x97, 0x04, 0x90, 0x00, 0xef, 0x03, 0x63, 0x00, 0x65, 0xe8, 0x93, 0x11, 0x80, 0xfb, 0x63, 0x09, 0x62, 0x08, 0xd0, 0x38, 0xb0, 0x90, 0xa0, 0x4f, 0xa0, 0x04, 0x05, 0x80, 0x34, 0x4d, 0xec, 0x4e, 0xa0, 0x80, 0x34, 0x00, 0x18, 0x15, 0xbc, 0x4d, 0xec, 0x7d, 0x67, 0x48, 0xab, 0x8f, 0xa0, 0xdd, 0x67, 0x4c, 0xcb, 0x49, 0xab, 0xaa, 0xae, 0x4d, 0xcb, 0x4e, 0xa0, 0x80, 0x33, 0x68, 0x33, 0x48, 0x32, 0x6d, 0xea, 0x03, 0x6b, 0xac, 0xeb, 0x6d, 0xea, 0x70, 0xa0, 0x4e, 0xce, 0x9a, 0x34, 0x68, 0x32, 0x7e, 0x33, 0x8d, 0xea, 0x05, 0x23, 0x09, 0xf4, 0x00, 0x6b, 0x4d, 0xeb, 0x6f, 0xce, 0x06, 0x10, 0x0a, 0xf0, 0x00, 0x6b, 0x6b, 0xeb, 0x4d, 0xeb, 0x5d, 0x67, 0x6f, 0xca, 0x00, 0x6a, 0x21, 0x10, 0xdd, 0x67, 0x44, 0x35, 0xb5, 0xe6, 0xac, 0xad, 0x01, 0x6e, 0xa7, 0xeb, 0xcc, 0xed, 0x0c, 0x25, 0x0f, 0x6d, 0x77, 0xe5, 0xc4, 0xed, 0xa6, 0x67, 0x8d, 0xed, 0xa0, 0x34, 0x80, 0x34, 0x83, 0x34, 0x83, 0x34, 0xff, 0xf7, 0x1f, 0x6d, 0xac, 0xec, 0x01, 0x4b, 0xff, 0x6d, 0xac, 0xeb, 0x10, 0x5b, 0xe7, 0x61, 0x44, 0x33, 0x01, 0x4a, 0xdd, 0x67, 0xac, 0xea, 0x6d, 0xe6, 0x04, 0x5a, 0x8c, 0xcb, 0x03, 0x60, 0x00, 0x6c, 0x64, 0x67, 0xdc, 0x17, 0x5d, 0x67, 0xcc, 0xaa, 0x51 +, 0x6c, 0x00, 0x18, 0x01, 0xa6, 0x01, 0x6d, 0x7d, 0x67, 0xcd, 0xab, 0x50, 0x6c, 0x00, 0x18, 0x01, 0xa6, 0x01, 0x6d, 0x5d, 0x67, 0xce, 0xaa, 0x4f, 0x6c, 0x00, 0x18, 0x01, 0xa6, 0x01, 0x6d, 0x7d, 0x67, 0xcf, 0xab, 0x4e, 0x6c, 0x00, 0x18, 0x01, 0xa6, 0x01, 0x6d, 0x09, 0x97, 0x08, 0x90, 0x00, 0xef, 0x05, 0x63, 0xe8, 0x93, 0x11, 0x80, 0xfb, 0x63, 0x09, 0x62, 0x08, 0xd1, 0x07, 0xd0, 0x5e, 0x6c, 0x00, 0x18, 0xa1, 0xa5, 0x01, 0x6d, 0xff, 0xf7, 0x1f, 0x68, 0x0c, 0xea, 0x02, 0xf0, 0x01, 0x6b, 0x6b, 0xeb, 0xc2, 0x67, 0x6c, 0xee, 0x5e, 0x6c, 0x00, 0x18, 0x01, 0xa6, 0x01, 0x6d, 0x57, 0x6c, 0x00, 0x18, 0xa1, 0xa5, 0x01, 0x6d, 0x0c, 0xea, 0xff, 0x6b, 0x01, 0x4b, 0xc2, 0x67, 0x53, 0xb1, 0x6d, 0xee, 0x57, 0x6c, 0x00, 0x18, 0x01, 0xa6, 0x01, 0x6d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x6c, 0x57, 0x6c, 0x00, 0x18, 0xa1, 0xa5, 0x01, 0x6d, 0x2c, 0xea, 0x02, 0x6b, 0x6b, 0xeb, 0xc2, 0x67, 0x01, 0x6d, 0x6c, 0xee, 0x00, 0x18, 0x01, 0xa6, 0x57, 0x6c, 0x80, 0x18, 0x22, 0x2a, 0x01, 0x6c, 0x09, 0x97, 0x08, 0x91, 0x07, 0x90, 0x00, 0xef, 0x05, 0x63, 0x00, 0x65, 0xe8, 0x93, 0x11, 0x80, 0x48, 0x00, 0x11, 0x80, 0xfb, 0x63, 0x09, 0x62, 0x08, 0xd1, 0x07, 0xd0, 0x80, 0x18, 0xfc, 0x2a, 0x00, 0x65, 0x57, 0x6c, 0x00, 0x18, 0xa1, 0xa5, 0x01, 0x6d, 0xff, 0xf7, 0x1f, 0x68, 0x0c, 0xea, 0x02, 0xf0, 0x00, 0x69, 0xc2, 0x67, 0x2d, 0xee, 0x57, 0x6c, 0x00, 0x18, 0x01, 0xa6, 0x01, 0x6d, 0x59, 0x6c, 0x00, 0x18, 0xa1, 0xa5, 0x01, 0x6d, 0x0c, 0xea, 0x00, 0xf2, 0x01, 0x6b, 0x6b, 0xeb, 0xc2, 0x67, 0x6c, 0xee, 0x59, 0x6c, 0x00, 0x18, 0x01, 0xa6, 0x01, 0x6d, 0x00, 0x6c, 0xd1, 0x67, 0x23, 0xb1, 0x00, 0x18, 0x01, 0xa6, 0xa4, 0x67, 0x63, 0xa1, 0x07, 0x6a, 0x02, 0x6c, 0x72, 0x33, 0x4c, 0xeb, 0x05, 0x4b, 0x00, 0x6d, 0x00, 0x18, 0xa1, 0xa5, 0x04, 0xd3, 0x04, 0x93, 0x1f, 0xf7, 0x01, 0x6c, 0x0c, 0xea, 0x8b, 0xec, 0x8c, 0xea, 0x1a, 0xb4, 0x6d, 0xe4, 0x20, 0xf1, 0xda, 0xa3, 0x02, 0x6c, 0x00, 0x6d, 0xc0, 0x36, 0x00, 0x18, 0x01, 0xa6, 0x4d, 0xee, 0xc1, 0xa9, 0x7f, 0x6a, 0x3c, 0x6c, 0xca, 0x36, 0x4c, 0xee, 0x00, 0xf6, 0xc0, 0x36, 0x00, 0x18, 0x01, 0xa6, 0x00, 0x6d, 0x57, 0x6c, 0x00, 0x18, 0xa1, 0xa5, 0x01, 0x6d, 0x0c, 0xea, 0x01, 0x6d, 0xc2, 0x67, 0xad, 0xee, 0x00, 0x18, 0x01, 0xa6, 0x57, 0x6c, 0x57, 0x6c, 0x00, 0x18, 0xa1, 0xa5, 0x01, 0x6d, 0x0c, 0xea, 0x02, 0x6b, 0x6b, 0xeb, 0xc2, 0x67, 0x57, 0x6c, 0x01, 0x6d, 0x00, 0x18, 0x01, 0xa6, 0x6c, 0xee, 0x09, 0x97, 0x08, 0x91, 0x07, 0x90, 0x00, 0xef, 0x05, 0x63, 0x00, 0x65, 0xe8, 0x93, 0x11, 0x80, 0x48, 0x00, 0x11, 0x80, 0xfd, 0x63, 0x05, 0x62, 0x80, 0x18, 0xfc, 0x2a, 0x00, 0x65, 0x00, 0x6b, 0x0c, 0xb2, 0x6d, 0xda, 0x6b, 0xda, 0x59, 0x6c, 0x00, 0x18, 0xa1, 0xa5, 0x01, 0x6d, 0xff, 0xf7, 0x1f, 0x6b, 0x00, 0xf2, 0x01, 0x6e, 0x4c, 0xeb, 0xcb, 0xee, 0x59, 0x6c, 0x01, 0x6d, 0x00, 0x18, 0x01, 0xa6, 0x6c, 0xee, 0x80, 0x18, 0x7a, 0x2a, 0x00, 0x65, 0x05, 0x97, 0x00, 0xef, 0x03, +0x63, 0xe8, 0x93, 0x11, 0x80, 0xfa, 0x63, 0x0b, 0x62, 0x0a, 0xd1, 0x09, 0xd0, 0x42, 0xa4, 0x04, 0x67, 0x23, 0xa4, 0x1e, 0x5a, 0xe0, 0xf2, 0x0f, 0x60, 0x04, 0x0b, 0x44, 0x32, 0x49, 0xe3, 0x40, 0x8a, 0x4d, 0xe3, 0x00, 0xeb, 0x00, 0x65, 0x00, 0x65, 0x3d, 0x00, 0x45, 0x00, 0x99, 0x00, 0x25, 0x02, 0xb3, 0x02, 0xed, 0x02, 0x63, 0x03, 0x8b, 0x03, 0x9d, 0x03, 0xab, 0x03, 0xc1, 0x03, 0xcf, 0x03, 0xcf, 0x05, 0xcf, 0x05, 0xdd, 0x03, 0xd5, 0x04, 0xed, 0x04, 0xcf, 0x05, 0x05, 0x05, 0x13, 0x05, 0x21, 0x05, 0x51, 0x05, 0x5f, 0x05, 0x71, 0x05, 0x7f, 0x05, 0x91, 0x05, 0x95, 0x05, 0x99, 0x05, 0xa5, 0x05, 0xb7, 0x05, 0xc0, 0xf5, 0x10, 0xb2, 0x40, 0xaa, 0xc2, 0x12, 0x57, 0x6c, 0x00, 0x18, 0xa1, 0xa5, 0x01, 0x6d, 0xff, 0xf7, 0x1f, 0x6b, 0x02, 0xf1, 0x03, 0x6e, 0x4c, 0xeb, 0xcb, 0xee, 0x6c, 0xee, 0x57, 0x6c, 0x00, 0x18, 0x01, 0xa6, 0x01, 0x6d, 0x00, 0x6c, 0xa4, 0x67, 0x00, 0x18, 0x01, 0xa6, 0xc4, 0x67, 0x80, 0x18, 0x22, 0x2a, 0x00, 0x6c, 0x00, 0x18, 0xaf, 0x58, 0x00, 0x65, 0x00, 0x6d, 0x01, 0xf4, 0x03, 0x6c, 0x00, 0x18, 0xea, 0x53, 0xc5, 0x67, 0x80, 0xf5, 0x0c, 0xb2, 0x0a, 0x6b, 0x6c, 0xc2, 0x08, 0x6b, 0x6d, 0xc2, 0x00, 0x6b, 0x69, 0xc2, 0x6a, 0xc2, 0xa3, 0x12, 0x0b, 0x59, 0x80, 0xf2, 0x1c, 0x60, 0x60, 0xf5, 0x14, 0xb2, 0x06, 0x21, 0x64, 0xa2, 0x40, 0x6a, 0x6c, 0xea, 0x80, 0xf2, 0x14, 0x2a, 0x06, 0x10, 0x84, 0xa2, 0x40, 0x6b, 0x8c, 0xeb, 0x02, 0x2b, 0x29, 0xc2, 0x91, 0x12, 0x40, 0xf5, 0x14, 0xb2, 0x69, 0xa2, 0x0b, 0x59, 0x29, 0xc2, 0x04, 0xd3, 0xa0, 0xf0, 0x01, 0x60, 0x04, 0x0a, 0x24, 0x31, 0x25, 0xe2, 0x60, 0x89, 0x69, 0xe2, 0x00, 0xea, 0x00, 0x65, 0x00, 0x65, 0x17, 0x00, 0x9f, 0x00, 0xb5, 0x00, 0xe9, 0x00, 0x09, 0x01, 0x0d, 0x01, 0x17, 0x01, 0x33, 0x01, 0x1b, 0x01, 0x23, 0x01, 0x2b, 0x01, 0x20, 0xf5, 0x00, 0xb2, 0x44, 0xa2, 0x01, 0x6b, 0x4c, 0xeb, 0x12, 0x23, 0x02, 0x6b, 0x4c, 0xeb, 0x04, 0x23, 0x80, 0x18, 0xac, 0x2a, 0x00, 0x65, 0x18, 0x10, 0x04, 0x92, 0x02, 0x72, 0x04, 0x61, 0x80, 0x18, 0x38, 0x2a, 0x00, 0x65, 0x11, 0x10, 0x80, 0x18, 0xeb, 0x29, 0x00, 0x65, 0x0d, 0x10, 0x04, 0x6b, 0x4c, 0xeb, 0x0a, 0x23, 0x02, 0x6b, 0x4c +, 0xeb, 0x04, 0x23, 0x80, 0x18, 0xa9, 0x29, 0x00, 0x65, 0x03, 0x10, 0x80, 0x18, 0xbc, 0x29, 0x00, 0x65, 0xc0, 0xf4, 0x14, 0xb1, 0x6b, 0x99, 0xec, 0x99, 0x4d, 0x99, 0x07, 0xd3, 0x06, 0xd7, 0x00, 0x18, 0xaf, 0x58, 0x05, 0xd2, 0x00, 0x6d, 0x01, 0xf4, 0x03, 0x6c, 0x00, 0x18, 0xea, 0x53, 0xc5, 0x67, 0x0a, 0x6a, 0x4c, 0xc1, 0x08, 0x6a, 0x4d, 0xc1, 0x04, 0x92, 0x07, 0x93, 0x06, 0x97, 0x02, 0x5a, 0x20, 0xf2, 0x17, 0x60, 0x6b, 0xd9, 0x05, 0x93, 0xec, 0xd9, 0x6d, 0xd9, 0x32, 0x12, 0x80, 0xf4, 0x18, 0xb1, 0x64, 0xa1, 0x02, 0x6a, 0x6d, 0xea, 0x01, 0x6b, 0x6d, 0xea, 0x80, 0x18, 0xde, 0x2b, 0x44, 0xc1, 0x25, 0x10, 0x80, 0xf4, 0x00, 0xb3, 0x84, 0xa3, 0x03, 0x6a, 0x4b, 0xea, 0x8c, 0xea, 0x04, 0x6c, 0x4c, 0xec, 0x07, 0x24, 0x02, 0x6c, 0x8b, 0xec, 0x4c, 0xec, 0x80, 0x18, 0xcb, 0x29, 0x84, 0xc3, 0x05, 0x10, 0x01, 0x6c, 0x4d, 0xec, 0x80, 0x18, 0x5e, 0x2b, 0x84, 0xc3, 0x40, 0xf4, 0x18, 0xb3, 0x84, 0xa3, 0x40, 0x6a, 0xe0, 0x10, 0x40, 0xf4, 0x0c, 0xb1, 0x64, 0xa1, 0x03, 0x6a, 0x4b, 0xea, 0x6c, 0xea, 0x01, 0x6b, 0x6d, 0xea, 0x80, 0x18, 0xa6, 0x2b, 0x44, 0xc1, 0x64, 0xa1, 0x40, 0x6a, 0x6d, 0xea, 0x44, 0xc1, 0xfd, 0x11, 0x01, 0x6c, 0x01, 0x10, 0x02, 0x6c, 0x80, 0x18, 0x22, 0x29, 0x00, 0x65, 0xf6, 0x11, 0x03, 0x6c, 0xfa, 0x17, 0x80, 0x18, 0x76, 0x29, 0x00, 0x65, 0xf0, 0x11, 0x80, 0x18, 0x5b, 0x29, 0x00, 0x65, 0xec, 0x11, 0x80, 0x18, 0x36, 0x29, 0x00, 0x65, 0xe8, 0x11, 0x80, 0x18, 0xa5, 0x28, 0x00, 0x65, 0xe0, 0xf1, 0x03, 0x22, 0x12, 0x72, 0xc0, 0xf1, 0x1c, 0x60, 0x00, 0x6c, 0x04, 0x6b, 0xdb, 0x11, 0x04, 0x59, 0xc0, 0xf1, 0x16, 0x60, 0x80, 0x18, 0x22, 0x2a, 0x00, 0x6c, 0x57, 0x6c, 0x00, 0x18, 0xa1, 0xa5, 0x01, 0x6d, 0xff, 0xf7, 0x1f, 0x6b, 0x02, 0xf1, 0x03, 0x6e, 0x4c, 0xeb, 0xcb, 0xee, 0x6c, 0xee, 0x57, 0x6c, 0x00, 0x18, 0x01, 0xa6, 0x01, 0x6d, 0x00, 0x6c, 0xa4, 0x67, 0x00, 0x18, 0x01, 0xa6, 0xc4, 0x67, 0x00, 0x18, 0xaf, 0x58, 0x00, 0x65, 0x00, 0x6d, 0x01, 0xf4, 0x03, 0x6c, 0x00, 0x18, 0xea, 0x53, 0xc5, 0x67, 0xea, 0xb3, 0x0a, 0x6a, 0x4c, 0xc3, 0x08, 0x6a, 0x2a, 0xc3, 0x4d, 0xc3, 0x00, 0x1c, 0xf6, 0x1b, 0x07, 0xd3, 0x07, 0x93, +0xa2, 0x67, 0x05, 0x6a, 0x84, 0xa3, 0x4b, 0xea, 0x01, 0x71, 0x8c, 0xea, 0x44, 0xc3, 0x09, 0x61, 0x03, 0x6c, 0x80, 0x18, 0x22, 0x29, 0x06, 0xd5, 0x00, 0x18, 0x4a, 0x56, 0x00, 0x6c, 0x06, 0x95, 0x05, 0x10, 0x02, 0x71, 0x03, 0x61, 0x04, 0x6c, 0x4d, 0xec, 0x84, 0xc3, 0x00, 0x1c, 0xfd, 0x1b, 0x85, 0x67, 0x96, 0x11, 0x4f, 0x59, 0x80, 0xf1, 0x0f, 0x60, 0x44, 0xa4, 0x08, 0x5a, 0x80, 0xf1, 0x0b, 0x60, 0xd4, 0xb3, 0x7f, 0x6a, 0xa1, 0xab, 0x2c, 0xea, 0x48, 0x34, 0xe0, 0xf1, 0x1d, 0x6a, 0x4b, 0xea, 0xac, 0xea, 0x8d, 0xea, 0x41, 0xcb, 0x84, 0xa0, 0x07, 0x6a, 0xa3, 0xa3, 0x8c, 0xea, 0x50, 0x34, 0x71, 0x6a, 0x4b, 0xea, 0xac, 0xea, 0x8d, 0xea, 0x43, 0xc3, 0x79, 0x11, 0x0a, 0x59, 0x44, 0xa4, 0x65, 0xa4, 0x60, 0xf1, 0x10, 0x60, 0x60, 0x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 0xc3, 0x8c, 0xcb, 0x26, 0x10, 0x01, 0x4a, 0xff, 0x6b, 0x6c, 0xea, 0x0a, 0x5a, 0xe8, 0x61, 0x27, 0x10, 0x88, 0x42, 0x6c, 0xec, 0x02, 0x5c, 0x24, 0x60, 0x00, 0x6a, 0xff, 0x6c, 0x09, 0x4c, 0x98, 0xea, 0x67, 0xb3, 0x01, 0x6d, 0x12, 0xec, 0x91, 0xe3, 0x20, 0xf1, 0xcf, 0xa4, 0xac, 0xee, 0x12, 0x26, 0x00, 0xf1, 0x72, 0xab, 0x67, 0xea, 0xac, 0xeb, 0x0d, 0x23, 0x60, 0xf1, 0xbe, 0xac, 0x5a, 0xb3, 0xaa, 0xcb, 0x80, 0xf1, 0xa0, 0xac, 0xab, 0xcb, 0x80, 0xf1, 0x82, 0xac, 0x4d, 0xc3, 0x8c, 0xcb, 0x05, 0x6a, 0x06, 0x10, 0x01, 0x4a, 0xff, 0x6b, 0x6c, 0xea, 0x08, 0x5a, 0xde, 0x61, 0x04, 0x6a, 0x52, 0xb3, 0x6a, 0xa3, 0x40, 0x32, 0x6d, 0xea, 0x66, 0x10, 0x55, 0xb3, 0x20, 0xf0, 0x9e, 0xa3, 0x20, 0xf0, 0x5d, 0xa3, 0x20, 0xf0, 0x7c, 0xa3, 0x80, 0x34, 0x40, 0x32, 0x80, 0x34, 0x8d, 0xea, 0x6d, 0x10, 0x4f, 0xb3, 0x40, 0xf0, 0x81, 0xa3, 0x40, 0xf0, 0x40, 0xa3, 0x20, 0xf0, 0x7f, 0xa3, 0x80, 0x34, 0x40, 0x32, 0x80, 0x34, 0x8d, 0xea, 0x61, 0x10, 0x43, 0xb2, 0x34, 0xc2, 0x64, 0xa4, 0x75, 0xc2, 0x65, 0xa4, 0x76, 0xc2, 0x66, 0x10, 0x40, 0xb2, 0x37, 0xc2, 0x64, 0xa4, 0x78, 0xc2, 0x65, 0xa4, 0x79, 0xc2, 0x5f, 0x10, 0x4f, 0x41, 0xff, 0x6b, 0x6c, +0xea, 0x09, 0x5a, 0x56, 0x60, 0x5c, 0x6c, 0x00, 0x18, 0xa1, 0xa5, 0x01, 0x6d, 0xff, 0xf7, 0x1f, 0x6b, 0x4c, 0xeb, 0x79, 0x6a, 0x4b, 0xea, 0x4c, 0xeb, 0x2c, 0x36, 0x78, 0x6a, 0x4c, 0xee, 0x5c, 0x6c, 0x01, 0x6d, 0x00, 0x18, 0x01, 0xa6, 0x6d, 0xee, 0x47, 0x10, 0x30, 0xb3, 0x8b, 0x9b, 0x36, 0xb5, 0x56, 0xab, 0xac, 0xec, 0x8b, 0xdb, 0x21, 0x10, 0x2d, 0xb4, 0xab, 0x9c, 0xff, 0xf7, 0x1f, 0x6b, 0xa2, 0x32, 0xac, 0xeb, 0x42, 0x32, 0x6b, 0xdc, 0x18, 0x10, 0x28, 0xb3, 0x8d, 0x9b, 0x2e, 0xb5, 0x5a, 0xab, 0xac, 0xec, 0x8d, 0xdb, 0x11, 0x10, 0x25, 0xb4, 0xad, 0x9c, 0xff, 0xf7, 0x1f, 0x6b, 0xa2, 0x32, 0xac, 0xeb, 0x42, 0x32, 0x6d, 0xdc, 0x08, 0x10, 0x78, 0x6c, 0x03, 0x10, 0x76, 0x6c, 0x01, 0x10, 0x77, 0x6c, 0x00, 0x18, 0xa1, 0xa5, 0x01, 0x6d, 0x02, 0x6c, 0x13, 0x10, 0x1b, 0xb3, 0x96, 0xa3, 0x55, 0xa3, 0x74, 0xa3, 0x80, 0x34, 0x40, 0x32, 0x80, 0x34, 0x8d, 0xea, 0x08, 0x10, 0x17, 0xb3, 0x99, 0xa3, 0x58, 0xa3, 0x77, 0xa3, 0x80, 0x34, 0x40, 0x32, 0x80, 0x34, 0x8d, 0xea, 0x6d, 0xea, 0x03, 0x6c, 0x00, 0x6b, 0x0b, 0x10, 0x00, 0x18, 0x00, 0x30, 0x90, 0x67, 0x14, 0x10, 0x00, 0x6c, 0x03, 0x6b, 0x44, 0x67, 0x03, 0x10, 0x00, 0x6c, 0x64, 0x67, 0x44, 0x67, 0x90, 0x34, 0x6d, 0xec, 0x83, 0xc0, 0x81, 0xa0, 0x10, 0x6b, 0x6b, 0xeb, 0x8c, 0xeb, 0x61, 0xc0, 0xa0, 0x98, 0x02, 0x6c, 0x00, 0x18, 0x55, 0x2f, 0xc2, 0x67, 0x0b, 0x97, 0x0a, 0x91, 0x09, 0x90, 0x01, 0x6a, 0x00, 0xef, 0x06, 0x63, 0x00, 0x65, 0x40, 0x00, 0x11, 0x80, 0xe8, 0x93, 0x11, 0x80, 0x1f, 0x00, 0xfc, 0xff, 0xf0, 0xdb, 0x10, 0x80, 0xe4, 0xdb, 0x10, 0x80, 0x74, 0x54, 0x11, 0x80, 0x00, 0x3b, 0x11, 0x80, 0x48, 0x00, 0x11, 0x80, 0x00, 0x00, 0xff, 0xff, 0x0b, 0xb3, 0x7c, 0x4b, 0x77, 0x9b, 0x0c, 0x6e, 0x0a, 0xb2, 0x40, 0xf7, 0x62, 0x33, 0xd8, 0xeb, 0xe0, 0xf0, 0x86, 0xaa, 0xe0, 0xf0, 0xa8, 0xaa, 0xb7, 0xe4, 0x12, 0xeb, 0x63, 0xed, 0x03, 0x60, 0x6d, 0xe4, 0xe0, 0xf0, 0x66, 0xca, 0x20, 0xe8, 0x00, 0x65, 0x00, 0x65, 0x48, 0x00, 0x11, 0x80, 0x00, 0x3b, 0x11, 0x80, 0x00, 0x6a, 0x71, 0xb5, 0x55, 0xe5, 0xa0, 0xa5, 0x70, 0xb3, 0x51, 0xe3, 0x20, 0xf1, 0xba, 0xc4, 0x01, 0x4a, 0xff, 0x6c, 0x8c +, 0xea, 0x10, 0x5a, 0xf4, 0x61, 0x60, 0xf1, 0xa1, 0xa3, 0x0d, 0x75, 0x05, 0x61, 0x15, 0x6a, 0x60, 0xf1, 0x41, 0xc3, 0x00, 0x6c, 0x0f, 0x10, 0x0f, 0x6a, 0xac, 0xea, 0xaf, 0x42, 0x8c, 0xed, 0x05, 0x5d, 0x05, 0x60, 0x10, 0x6c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, 0xb3, 0x4d, 0xe3, 0xc0, 0xf1, 0x86, 0xc3, 0x01, 0x4a, 0xff, 0x6b, 0x6c, 0xea, 0x02, 0x5a, 0xc5, 0x61, 0x20, 0xe8, 0x00, 0x65, 0x00, 0x65, 0x18, 0xdd, 0x10, 0x80, 0x48, 0x00, 0x11, 0x80, 0x28, 0xdd, 0x10, 0x80, 0x40, 0xdd, 0x10, 0x80, 0x38, 0xdd, 0x10, 0x80, 0x3c, 0xdd, 0x10, 0x80, 0x50, 0xdd, 0x10, 0x80, 0x54, 0xdd, 0x10, 0x80, 0xff, 0x6a, 0x4c, 0xee, 0x4c, 0xec, 0x4c, 0xed, 0xec, 0xea, 0x57, 0xe5, 0x00, 0xf6, 0xa0, 0x35, 0x00, 0xf6, 0xa3, 0x35, 0xb8, 0xed, 0xd3, 0xe4, 0x00, 0xf6, 0x80, 0x34, 0x00, 0xf6, 0x83, 0x34, 0xff, 0xf7, 0x1f, 0x6b, 0x12, 0xed, 0x98, 0xec, 0x12, 0xec, 0x89, 0xe5, 0x20, 0xe8, 0x6c, 0xea, 0x20, 0xe8, 0x00, 0x65, 0x0b, 0xb2, 0x20, 0xf0, 0x70, 0xa2, 0x16, 0x6a, 0x6c, 0xea, 0x12, 0x72, 0x04, 0x61, 0x40, 0xa4, 0x01, 0x5a, 0x58, 0x67, 0x40, 0xc4, 0x06, 0xb2, 0xc0, 0xf1, 0x7f, 0xa2, 0x07, 0x6a, 0x6c, 0xea, 0x04, 0x52, 0x58, 0x67, 0x01, 0x6b, 0x20, 0xe8, 0x6e, 0xea, 0x00, 0x65, 0x48, 0x00, 0x11, 0x80, 0x08, 0xb2, 0x60, 0xa2, 0x1e, 0x6a, 0x80, 0x9c, 0x6c, 0xea, 0x06, 0x6b, 0x4e, 0xeb, 0x05, 0x2b, 0x47, 0x6a, 0x8c, 0xea, 0x02, 0x22, 0x04, 0xb2, 0x60, 0xc2, 0x20, 0xe8, 0x00, 0x6a, 0x00, 0x65, 0xc0, 0x1e, 0x11, 0x80, 0xb2, 0x06, 0x11, 0x80, 0x62, 0xa4, 0x80, 0x6a, 0x4b, 0xea, 0x6c, 0xea, 0xff, 0x6d, 0xac, 0xea, 0x0b, 0x22, 0x09, 0xb2, 0xa1, 0xa2, 0x0c, 0x6a, 0xac, 0xea, 0x0c, 0x72, 0x09, 0x60, 0x7f, 0x6a, 0x6c, 0xea, 0x21, 0x6b, 0x6b, 0xeb, 0x02, 0x10, 0x21, 0x6a, 0x4b, 0xea, 0x6c, 0xea, 0x42, 0xc4, 0x20, 0xe8, 0x00, 0x6a, 0xc0, 0x1e, 0x11, 0x80, 0x20, 0xe8, 0x01, 0x6a, 0x64, 0xa4, 0x43, 0xa4, 0xc0, 0xa5, 0x60, 0x33, 0x4d, 0xe3, 0xff, 0xf7, 0x1f, 0x6a, 0x4c, 0xeb, 0x7f, 0xf4, 0x0f, 0x73 +, 0x00, 0x6a, 0x09, 0x61, 0xc9, 0xe4, 0x02, 0x6b, 0x62, 0xc2, 0x41, 0x46, 0xff, 0x6b, 0x6c, 0xea, 0x41, 0xc4, 0x40, 0xc5, 0x01, 0x6a, 0x20, 0xe8, 0x00, 0x65, 0x00, 0x65, 0x20, 0xe8, 0x00, 0x6a, 0x20, 0xe8, 0x00, 0x65, 0x0b, 0xb2, 0x60, 0xf1, 0x50, 0xa2, 0xff, 0x6b, 0xfd, 0x4a, 0x6c, 0xea, 0x02, 0x5a, 0x0b, 0x60, 0x08, 0xb2, 0x40, 0xa2, 0x08, 0x2a, 0x63, 0xa4, 0x02, 0x6a, 0x6c, 0xea, 0x04, 0x22, 0x03, 0x6a, 0x4b, 0xea, 0x6c, 0xea, 0x43, 0xc4, 0x20, 0xe8, 0x00, 0x6a, 0x00, 0x65, 0x80, 0x50, 0x11, 0x80, 0x7d, 0x04, 0x11, 0x80, 0x07, 0xb2, 0x40, 0x9a, 0x61, 0x42, 0x07, 0x23, 0x24, 0x6b, 0x78, 0xea, 0x05, 0xb3, 0x12, 0xea, 0x49, 0xe3, 0x05, 0xb3, 0x63, 0xda, 0x20, 0xe8, 0x00, 0x65, 0x00, 0x65, 0x80, 0x04, 0x11, 0x80, 0x0c, 0x8a, 0x11, 0x80, 0x45, 0xd0, 0x10, 0x80, 0xf9, 0x63, 0x0d, 0x62, 0x0c, 0xd1, 0x0b, 0xd0, 0x01, 0x6b, 0x6b, 0xeb, 0x20, 0xb2, 0x60, 0xda, 0x00, 0x68, 0x0e, 0x10, 0x0c, 0x6b, 0x78, 0xe8, 0x12, 0xeb, 0x49, 0xe3, 0x62, 0x9a, 0x07, 0x23, 0x20, 0x18, 0xc1, 0x32, 0x81, 0x9a, 0x03, 0x22, 0x19, 0xb2, 0x00, 0xda, 0x06, 0x10, 0x01, 0x48, 0x18, 0xb2, 0x80, 0xf0, 0x64, 0xa2, 0x02, 0xeb, 0xed, 0x60, 0x17, 0xb2, 0x17, 0xb3, 0x60, 0xda, 0x17, 0xb2, 0x40, 0xa2, 0xff, 0x72, 0x07, 0x61, 0x16, 0xb2, 0x40, 0xaa, 0x04, 0x2a, 0x00, 0x18, 0xba, 0x39, 0x00, 0x65, 0x01, 0x10, 0x00, 0x6a, 0x0d, 0xb3, 0x60, 0x9b, 0x81, 0x43, 0x07, 0x2c, 0x11, 0xb3, 0x60, 0x9b, 0xd1, 0x23, 0xd0, 0x2a, 0x40, 0xeb, 0x00, 0x65, 0xcd, 0x17, 0x0c, 0x68, 0x18, 0xeb, 0x08, 0xb2, 0x04, 0x01, 0xb1, 0x67, 0x12, 0xe8, 0x41, 0xe0, 0x20, 0x18, 0xc8, 0x32, 0x81, 0x98, 0xc2, 0x2a, 0x40, 0x98, 0x40, 0xea, 0x91, 0x67, 0xbe, 0x17, 0x80, 0x88, 0x11, 0x80, 0x84, 0x88, 0x11, 0x80, 0x78, 0xa0, 0x00, 0xb0, 0x20, 0x4e, 0xa5, 0x01, 0x62, 0x04, 0x11, 0x80, 0xde, 0x18, 0x11, 0x80, 0xf0, 0x84, 0x11, 0x80, 0xf6, 0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5f, 0x2e, 0x00, 0x65, 0x13, 0x97, 0x12, 0x91, 0x11, 0x90, 0x00, 0xef, 0x0a, 0x63, 0x00, 0x65, 0xb0, 0xe7, 0x04, 0x80, 0x40, 0x00, 0x11, 0x80, 0x42, 0x00, 0x11, 0x80, 0xe8, 0x1f, 0x11, 0x80, 0x48, 0x00, 0x11, 0x80, 0x50, 0x8b, 0x10, 0x80, 0xef, 0xbe, 0x23, 0x87, 0x08, 0x94, 0x10, 0x80, 0x54, 0x8b, 0x10, 0x80, 0x60, 0x07, 0x11, 0x80, 0x58, 0x8b, 0x10, 0x80, 0x32, 0x97, 0x79, 0x23, 0x60, 0x8b, 0x10, 0x80, 0x58, 0x3b, 0x7a, 0x93, 0x24, 0x73, 0x11, 0x80, 0xf2, 0x63, 0x1b, 0x62, 0x1a, 0xd1, 0x19, 0xd0, 0x20, 0xf5, 0x1c, 0xb2, 0x7d, 0x67, 0x40, 0xaa, 0x51, 0xcb, 0x20, 0xf0, 0x82, 0xa3, 0x20, 0xf5, 0x14, 0xb2, 0x92, 0x35, 0xa0, 0xc2, 0x13, 0xd5, 0x20, 0xf0, 0x63, 0xa3, 0x01, 0x6a, 0x86, 0x34, 0x6e, 0x31, 0x4c, 0xe9, 0x66, 0x33, 0x4c, 0xeb, 0x24, 0x31, 0x6d, 0xe9, 0x07, 0x6b, 0x6c, 0xec, 0x10, 0xd4, 0x7c, 0x6c, 0x98, 0xe9, 0x00, 0xf5, 0x10, 0xb3, 0xb1, 0x67, 0x12, 0xec, 0x6d, 0xe4, 0x12, 0xd3, 0x60, 0xa3, 0x10, 0x94, 0x6c, 0xea, 0x00, 0x18, 0xf5, 0xbc, 0x14, 0xd2, 0x11, 0xd2, 0x11, 0x93, 0x0a, 0x6a, 0x58, 0xeb, 0xe0, 0xf4, 0x14, 0xb3, 0x12, 0xea, 0x49, 0xe3, 0x61, 0xaa, 0xe0, 0xf4, 0x0c, 0xb2, 0x60, 0xc2, 0xe0, 0xf4, 0x0c, 0xb2, 0x40, 0x9a, 0x04, 0x22, 0x20, 0xf0, 0x02, 0x04, 0x40 +, 0xea, 0x00, 0x65, 0x13, 0x94, 0x09, 0x74, 0x07, 0x61, 0x10, 0x95, 0x00, 0x6c, 0x01, 0x25, 0x82, 0x41, 0x00, 0x18, 0x31, 0x83, 0x00, 0x65, 0x7d, 0x67, 0x20, 0xf0, 0x43, 0xa3, 0x01, 0x68, 0x0c, 0xea, 0x2d, 0x22, 0xc0, 0xf4, 0x00, 0xb2, 0x40, 0xa2, 0x03, 0x6b, 0x6c, 0xea, 0x14, 0x22, 0xa0, 0xf4, 0x18, 0xb3, 0x46, 0xab, 0x9d, 0x67, 0x50, 0xcc, 0xc0, 0xf2, 0x0c, 0x6c, 0x98, 0xea, 0xa0, 0xf4, 0x0c, 0xb4, 0x12, 0xea, 0x49, 0xe4, 0x00, 0x6c, 0x20, 0xf2, 0x9d, 0xc2, 0xe0, 0xf0, 0xa3, 0xa2, 0x00, 0x18, 0x79, 0x3d, 0x8e, 0xa3, 0x80, 0xf4, 0x18, 0xb2, 0x60, 0xf1, 0x4b, 0xa2, 0x20, 0xf2, 0x0d, 0x22, 0x00, 0x6a, 0x80, 0xf4, 0x0c, 0xb3, 0x04, 0xd2, 0x05, 0xd3, 0x06, 0xd2, 0x06, 0x6c, 0xfa, 0x6d, 0xe4, 0xf0, 0x04, 0x6e, 0xc0, 0xf5, 0x19, 0x6f, 0x32, 0x10, 0x10, 0x94, 0xb1, 0x67, 0x20, 0x18, 0xd9, 0x0e, 0x09, 0x06, 0x0d, 0x2a, 0x10, 0x93, 0x60, 0xf4, 0x0c, 0xb2, 0x69, 0xe2, 0x40, 0xa2, 0x01, 0x72, 0x00, 0xf2, 0x12, 0x61, 0x60, 0xf4, 0x00, 0xb2, 0x69, 0xe2, 0x00, 0xc2, 0x0d, 0x12, 0x13, 0x94, 0x02, 0x74, 0x20, 0x61, 0x20, 0xf4, 0x18, 0xb2, 0x40, 0xa2, 0x00, 0xf2, 0x05, 0x2a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x07, 0x6c, 0x7a, 0x33, 0x8c, 0xeb, 0x64, 0x33, 0x01, 0x4b, 0x7b, 0xea, 0x01, 0x2b, 0xe5, 0xe8, 0x10, 0xea, 0x09, 0x2a, 0x00, 0x18, 0x13, 0xd0, 0x01, 0x6c, 0x88, 0xb3, 0x80, 0xa3, 0x01, 0x6a, 0x44, 0xe9, 0x8d, 0xea, 0x40, 0xc3, 0xe0, 0xf0, 0x67, 0xa0, 0x15, 0x94, 0xff, 0x6a, 0x01, 0x5b, 0x78, 0x67, 0x6b, 0xeb, 0x6c, 0xea, 0x19, 0xf5, 0x18, 0x6b, 0x8c, 0xeb, 0x04, 0x23, 0x10, 0x95, 0x02, 0x25, 0x01, 0x6a, 0x02, 0x10, 0xff, 0x72, 0x03, 0x60, 0x7d, 0xb4, 0x31, 0xe4, 0x40, 0xc4, 0x6f, 0xb2, 0x60, 0xf1, 0x50, 0xa2, 0xff, 0x6c, 0xfd, 0x4a, 0x8c, 0xea, 0x02, 0x5a, 0x10, 0x60, 0x80, 0xf2, 0x5c, 0xa0, 0x03, 0x72, 0x0c, 0x61, 0x11, 0x94, 0x0a, 0x6a, 0xbd, 0x67, 0x58, 0xec, 0x91, 0xad, 0x60, 0xb5, 0x17, 0xd3, 0x12, 0xea, 0x00, 0x18, 0xa5, 0x07, 0x55, 0xe5, 0x17, 0x93, 0x06, 0x23, 0x5d, 0x67, 0x90, 0xaa, 0x00, 0x18, 0xc1, 0xa3, 0x17, 0xd3, 0x17, 0x93, 0x5f, 0xb2, 0x60, 0xf1, 0x50, 0xa2, 0xff, 0x6c, 0xfd, 0x4a, 0x8c, 0xea, 0x02, 0x5a, 0x04, 0x60, 0x80, 0xf2, 0x5c, 0xa0, 0x03, 0x72, 0x0c, 0x60, 0x59, 0xb2, 0x29, 0xe2, 0x80, 0xf1, 0x40, 0xa2, 0x07, 0x22, 0x91, 0x67, 0x00, 0x18, 0xe9, 0x06, 0x17, 0xd3, 0x10, 0xd2, 0x17, 0x93, 0x02, 0x10, 0x00, 0x6c, 0x10, 0xd4, 0x11, 0x95, 0x2a, 0x25, 0x5f, 0xb2, 0x29, 0xe2, 0x44, 0xa2, 0x01, 0x6c, 0x46, 0x32, 0x8c, 0xea, 0x23, 0x22, 0x22, 0x2b, 0x5c, 0xb2, 0xa9, 0xe2, 0x60, 0xa2, 0x6a, 0x33, 0x60, 0xc2, 0xe0, 0xf0, 0x47, 0xa0, 0x01, 0x72, 0x19, 0x61, 0x59, 0xb2, 0xa9, 0xe2, 0x40, 0xa2, 0x15, 0x2a, 0x60, 0xf0, 0x56, 0xa8, 0x7d, 0x67, 0x01, 0x4a, 0x60, 0xf0, 0x56, 0xc8, 0x20, 0xf3, 0x0b, 0x6a, 0x58, 0xcb, 0x53, 0xb2, 0x80, 0x9a, 0x0d, 0x92, 0xb0, 0xab, 0x0b, 0x96, 0x04, 0xd2, 0x0c, 0x97, 0x0e, 0x92, 0x0a, 0xd5, 0x00, 0x18, 0x10, +0x1d, 0x05, 0xd2, 0x4e, 0xb2, 0x40, 0x9a, 0x06, 0x22, 0x7d, 0x67, 0xb1, 0xab, 0x10, 0x96, 0x40, 0xea, 0x08, 0x04, 0x57, 0x2a, 0x44, 0xb2, 0x40, 0xa2, 0x19, 0x2a, 0x40, 0xb2, 0x40, 0xa2, 0x16, 0x2a, 0xc0, 0xf0, 0x6d, 0xa0, 0x02, 0x6c, 0x46, 0xb2, 0x8e, 0xeb, 0x0a, 0x23, 0x01, 0x6b, 0x60, 0xc2, 0x37, 0xb2, 0x7c, 0x4a, 0x58, 0x9a, 0x03, 0x6c, 0x42, 0x32, 0x46, 0x32, 0x4c, 0xec, 0x03, 0x10, 0x60, 0xc2, 0x40, 0xb2, 0x80, 0xa2, 0x00, 0x18, 0x13, 0xd0, 0x00, 0x65, 0x10, 0x95, 0x02, 0x2d, 0x13, 0x92, 0x08, 0x22, 0x13, 0x93, 0x01, 0x73, 0x27, 0x61, 0x10, 0x94, 0x25, 0x2c, 0x25, 0xb2, 0x44, 0x9a, 0x22, 0x22, 0xe0, 0xf0, 0x47, 0xa0, 0x01, 0x6d, 0xae, 0xea, 0x1d, 0x2a, 0x36, 0xb3, 0x02, 0x49, 0x28, 0x31, 0x27, 0xe3, 0x60, 0x99, 0x00, 0x53, 0x16, 0x61, 0x11, 0x93, 0x14, 0x23, 0x11, 0x94, 0x0a, 0x6b, 0x18, 0xf0, 0x00, 0x6d, 0x78, 0xec, 0x14, 0xb4, 0x12, 0xeb, 0x6d, 0xe4, 0x83, 0xab, 0x00, 0x18, 0xc3, 0x3b, 0x16, 0xd2, 0x11, 0x95, 0x16, 0x92, 0x26, 0xb3, 0xad, 0xe3, 0x40, 0xc3, 0x23, 0xb3, 0xad, 0xe3, 0x40, 0xc3, 0x13, 0xb2, 0x60, 0xf1, 0x49, 0xa2, 0x01, 0x72, 0x08, 0x61, 0x00, 0xf2, 0x52, 0xa0, 0x05, 0x22, 0xa0, 0xf0, 0x44, 0xa8, 0x01, 0x4a, 0xa0, 0xf0, 0x44, 0xc8, 0x1b, 0x97, 0x1a, 0x91, 0x19, 0x90, 0x00, 0xef, 0x0e, 0x63, 0x00, 0x65, 0x08, 0x00, 0x00, 0xb6, 0x7d, 0x04, 0x11, 0x80, 0x54, 0x36, 0x11, 0x80, 0x9c, 0x39, 0x11, 0x80, 0xa8, 0x1a, 0x11, 0x80, 0xac, 0x1a, 0x11, 0x80, 0x60, 0x50, 0x11, 0x80, 0x6c, 0x50, 0x11, 0x80, 0x74, 0x54, 0x11, 0x80, 0x80, 0x50, 0x11, 0x80, 0xb0, 0xe7, 0x04, 0x80, 0xa4, 0x19, 0x11, 0x80, 0xac, 0x19, 0x11, 0x80, 0xf4, 0x19, 0x11, 0x80, 0x02, 0x1a, 0x11, 0x80, 0x48, 0x00, 0x11, 0x80, 0x20, 0x01, 0x00, 0xb6, 0x03, 0x1a, 0x11, 0x80, 0x00, 0x3b, 0x11, 0x80, 0x4a, 0x1b, 0x11, 0x80, 0x01, 0x1a, 0x11, 0x80, 0x00, 0x1a, 0x11, 0x80, 0x98, 0x19, 0x11, 0x80, 0x30, 0x3a, 0x11, 0x80, 0x60, 0x19, 0x11, 0x80, 0x54, 0x19, 0x11, 0x80, 0x40, 0x36, 0x11, 0x80, 0xf0, 0x19, 0x11, 0x80, 0xc9, 0x19, 0x11, 0x80, 0x45, 0x00, 0x11, 0x80, 0x0c, 0xa3, 0x00, 0xb0, 0xfc, 0x63, 0x07, 0x62, 0x0f, 0xb3, 0x60, 0xf1, 0x64 +, 0x9b, 0x0f, 0xb2, 0x6c, 0xea, 0x0f, 0xb3, 0x6e, 0xea, 0x13, 0x2a, 0x0e, 0xb2, 0xff, 0xf7, 0x1f, 0x6b, 0xff, 0x6c, 0x40, 0xaa, 0x1f, 0x4c, 0x4c, 0xeb, 0x5d, 0x67, 0x68, 0xca, 0x08, 0x6a, 0x4b, 0xea, 0x6c, 0xea, 0x01, 0x6b, 0x6d, 0xea, 0x7d, 0x67, 0x50, 0xc3, 0x00, 0x18, 0xc3, 0x3b, 0xa8, 0xab, 0x07, 0x97, 0x00, 0xef, 0x04, 0x63, 0x80, 0x50, 0x11, 0x80, 0xff, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0x01, 0x1e, 0x01, 0x00, 0xb6, 0xfd, 0x63, 0x05, 0x62, 0x00, 0x1c, 0xf6, 0x1b, 0x00, 0x65, 0x09, 0xb3, 0x60, 0x9b, 0x81, 0x43, 0x07, 0x24, 0x24, 0x6c, 0x98, 0xeb, 0x07, 0xb4, 0x12, 0xeb, 0x6d, 0xe4, 0x06, 0xb4, 0x83, 0xdb, 0x00, 0x1c, 0xfd, 0x1b, 0x82, 0x67, 0x05, 0x97, 0x00, 0xef, 0x03, 0x63, 0xfc, 0x05, 0x11, 0x80, 0x0c, 0x8a, 0x11, 0x80, 0x6d, 0xd6, 0x10, 0x80, 0xf0, 0x63, 0x1f, 0x62, 0x1e, 0xd1, 0x1d, 0xd0, 0x80, 0xac, 0xc0, 0xf2, 0x0c, 0x68,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 0x4c, 0x6c, 0x17, 0x95, 0x00, 0x18, 0xc3, 0x3b, 0x4a, 0x6c, 0x65, 0xb3, 0x1b, 0x92, 0x00, 0xf2, 0x1c, 0x6c, 0xa0, 0xab, 0x40, 0x6b, 0x4c, 0xed, 0x6d, 0xed, 0x4c, 0xed, 0x16, 0x10, 0x61, 0xb3, 0x7c, 0x4b, 0x78, 0x9b, 0x10, 0xf0, 0x00, 0x6a, 0x6c, 0xea, 0x08, 0x22, 0x16, 0x94, 0x03, 0x24, 0x4c, 0x6c, 0x01, 0x6d, 0x05, 0x10, 0x4c, 0x6c, 0x00, 0x6d, 0x02, 0x10, 0x16, 0x95, 0x4c, 0x6c, 0x00, 0x18, 0xc3, 0x3b, 0x00, 0x65, 0x17, 0x95, 0x4a, 0x6c, 0x00, 0x18, 0xc3, 0x3b, 0x00, 0x65, 0x07, 0x6d, 0x00, 0x18, 0xc3, 0x3b, 0x00, 0x6c, 0x12, 0x95, 0x0e, 0x2d, 0x13, 0x92, 0x01, 0x72, 0x0b, 0x61, 0x14, 0x93, 0x51, 0xb2, 0x69, 0xe2, 0xa0, 0xc2, 0x50, 0xb2, 0x69, 0xe2, 0x7d, 0x67, 0x87, 0x43, 0x41, 0x4c, 0x60, 0xa4, 0x60, 0xc2, 0x1a, 0x94, 0x00, 0x1c, 0xfd, 0x1b, 0x02, 0x49, 0x00, 0x18, 0x3a, 0x04, 0x00, 0x65, 0x01, 0xf0, 0x00, 0x6d, 0x00, 0x18, 0x3d, 0xbe, 0x5e, 0x6c, 0x11, 0x95, 0x18, 0x94, 0x03, 0x6a, 0x04, 0xd2, 0x46, 0xb2, 0x05, 0xd2, 0x06, 0xd4, 0xa4, 0x32, 0x07, 0xd5, 0x00, 0x6c, 0xfa, 0x6d +, 0xa3, 0xf6, 0x16, 0x6e, 0x40, 0x6f, 0x20, 0x18, 0xc5, 0x30, 0x08, 0xd2, 0x12, 0x92, 0x1f, 0x2a, 0x13, 0x93, 0x01, 0x73, 0x0c, 0x61, 0x15, 0x92, 0x18, 0xf0, 0x00, 0x6c, 0x03, 0xf4, 0x00, 0x6d, 0x00, 0x18, 0x0b, 0x98, 0xc3, 0xaa, 0x20, 0x6a, 0x00, 0xf2, 0x50, 0xc0, 0x24, 0x10, 0x51, 0x59, 0x06, 0x61, 0x19, 0x95, 0xff, 0xf7, 0x1f, 0x6c, 0x00, 0x18, 0x1c, 0x9d, 0x2c, 0xec, 0x15, 0x93, 0x18, 0xf0, 0x00, 0x6c, 0x01, 0xf4, 0x00, 0x6d, 0x00, 0x18, 0x0b, 0x98, 0xc3, 0xab, 0x13, 0x94, 0x12, 0x2c, 0x12, 0x95, 0x10, 0x25, 0x51, 0x59, 0x0e, 0x61, 0x19, 0x95, 0xff, 0xf7, 0x1f, 0x6c, 0x00, 0x18, 0x1c, 0x9d, 0x2c, 0xec, 0x15, 0x92, 0x01, 0xf4, 0x00, 0x6c, 0x18, 0xf0, 0x00, 0x6d, 0x00, 0x18, 0x0b, 0x98, 0xc3, 0xaa, 0x10, 0x94, 0x7d, 0x67, 0x60, 0xf2, 0x0b, 0x6a, 0x5a, 0xcb, 0x23, 0xb2, 0x0b, 0xd4, 0x80, 0x9a, 0x0e, 0x92, 0x10, 0x95, 0x0c, 0x96, 0x04, 0xd2, 0x0d, 0x97, 0x0f, 0x92, 0x00, 0x18, 0x10, 0x1d, 0x05, 0xd2, 0x03, 0x6a, 0x10, 0x95, 0x04, 0xd2, 0x1b, 0xb2, 0x05, 0xd2, 0x16, 0x93, 0x17, 0x92, 0x06, 0xd5, 0x05, 0x6c, 0xfa, 0x6d, 0x03, 0xf7, 0x0c, 0x6e, 0x82, 0xf7, 0x1e, 0x6f, 0x07, 0xd2, 0x20, 0x18, 0xc5, 0x30, 0x08, 0xd3, 0x14, 0x94, 0x0d, 0x24, 0x64, 0x67, 0xff, 0x4b, 0x68, 0x33, 0x13, 0xb4, 0x71, 0xe4, 0x00, 0x6a, 0x40, 0xdc, 0x12, 0xb4, 0x71, 0xe4, 0x40, 0xdc, 0x11, 0xb4, 0x6d, 0xe4, 0x40, 0xdb, 0x1f, 0x97, 0x1e, 0x91, 0x1d, 0x90, 0x01, 0x6a, 0x00, 0xef, 0x10, 0x63, 0x00, 0x65, 0x74, 0x54, 0x11, 0x80, 0x9c, 0x39, 0x11, 0x80, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x08, 0x1c, 0x02, 0x00, 0xb6, 0x48, 0x00, 0x11, 0x80, 0x54, 0x19, 0x11, 0x80, 0x60, 0x19, 0x11, 0x80, 0xb0, 0xe7, 0x04, 0x80, 0xfc, 0x46, 0x11, 0x80, 0x14, 0x1a, 0x11, 0x80, 0x44, 0x1a, 0x11, 0x80, 0x74, 0x1a, 0x11, 0x80, 0xfb, 0x63, 0x09, 0x62, 0x08, 0xd1, 0x07, 0xd0, 0x59, 0xb2, 0xff, 0xf7, 0x1f, 0x6b, 0x01, 0x6c, 0x40, 0xaa, 0x4c, 0xeb, 0x57, 0xb2, 0x40, 0xaa, 0x04, 0xd2, 0x57, 0xb2, 0x40, 0xa2, 0x8e, 0xea, 0x06, 0x2a, 0x56, 0xb4, 0x40, 0xc4, 0x56, 0xb4, 0x40, 0xc4, 0x56, 0xb4, 0x40, 0xc4, 0x00, 0x69, 0x92, 0x10, 0x55, 0xb2, 0x40, 0x9a, 0x05, +0x22, 0x08, 0xf0, 0x00, 0x6a, 0x6c, 0xea, 0x80, 0xf0, 0x0f, 0x22, 0x04, 0x92, 0x08, 0xf0, 0x00, 0x6c, 0x6c, 0xec, 0x4f, 0xe8, 0x6c, 0xe8, 0x00, 0x32, 0x40, 0x32, 0x43, 0x32, 0x43, 0x32, 0x04, 0x24, 0x00, 0x18, 0x5b, 0x9c, 0x05, 0xd2, 0x05, 0x92, 0x4a, 0xb3, 0x7c, 0x4b, 0x75, 0x9b, 0x02, 0x6c, 0x8c, 0xeb, 0x0f, 0x23, 0x00, 0x52, 0x0d, 0x60, 0x00, 0x18, 0x61, 0x1b, 0x00, 0x65, 0x46, 0xb2, 0x40, 0xf0, 0x63, 0xa2, 0x06, 0x23, 0xff, 0xf7, 0x1e, 0x6b, 0x6c, 0xe8, 0x00, 0x6b, 0x40, 0xf0, 0x63, 0xc2, 0x08, 0x6a, 0x0c, 0xea, 0x03, 0x22, 0x00, 0x18, 0x36, 0x0a, 0x00, 0x65, 0x02, 0x6a, 0x0c, 0xea, 0x03, 0x22, 0x80, 0x18, 0xca, 0x2e, 0x00, 0x65, 0x01, 0x6a, 0x0c, 0xea, 0x03, 0x22, 0x00, 0x18, 0xe6, 0x13, 0x00, 0x6c, 0x20, 0x6a, 0x0c, 0xea, 0x03, 0x22, 0x00, 0x18, 0x0f, 0x06, 0x00, 0x65, 0x04, 0x6a, 0x0c, 0xea, 0x03, 0x22, 0x00, 0x18, 0xed, 0x11, 0x00, 0x65, 0x02, 0xf0, 0x00, 0x6a, 0x0c, 0xea, 0x09, 0x22, 0x00, 0x18, 0x06, 0x12, 0x00, 0x65, 0x2f, 0xb2, 0x40, 0xa2, 0x03, 0x22, 0x00, 0x18, 0x26, 0xa4, 0x00, 0x65, 0x00, 0xf6, 0x00, 0x6a, 0x0c, 0xea, 0x05, 0x22, 0x2b, 0xb2, 0xff, 0xf7, 0x1f, 0x69, 0x40, 0xaa, 0x4c, 0xe9, 0x00, 0xf2, 0x00, 0x6a, 0x0c, 0xea, 0x03, 0x22, 0x00, 0x18, 0x9a, 0x13, 0x91, 0x67, 0x00, 0xf4, 0x00, 0x6a, 0x0c, 0xea, 0x0f, 0x22, 0x00, 0x18, 0xd3, 0x13, 0x91, 0x67, 0xfe, 0xf7, 0x1f, 0x6d, 0x00, 0x18, 0x58, 0xbe, 0x5e, 0x6c, 0x1c, 0xb2, 0xe0, 0xf0, 0x54, 0xa2, 0x03, 0x22, 0x00, 0x18, 0x0d, 0xab, 0x00, 0x65, 0x01, 0xf0, 0x00, 0x6d, 0x50, 0x67, 0xac, 0xea, 0x07, 0x22, 0x00, 0x18, 0xbb, 0x13, 0x05, 0xd5, 0x05, 0x95, 0x00, 0x18, 0x3d, 0xbe, 0x5e, 0x6c, 0xff, 0x6a, 0x01, 0x4a, 0x0c, 0xea, 0x03, 0x22, 0x00, 0x18, 0x61, 0x05, 0x00, 0x65, 0x08, 0xb2, 0xff, 0xf7, 0x1f, 0x6b, 0x40, 0xaa, 0x4c, 0xeb, 0x04, 0x94, 0x8f, 0xea, 0x6c, 0xea, 0x7f, 0xf7, 0x09, 0x2a, 0x09, 0x97, 0x08, 0x91, 0x07, 0x90, 0x00, 0xef, 0x05, 0x63, 0x00, 0x65, 0xbe, 0x00, 0x00, 0xb6, 0x72, 0x04, 0x11, 0x80, 0x28, 0x3a, 0x11, 0x80, 0x08, 0x1a, 0x11, 0x80, 0x09, 0x1a, 0x11, 0x80, 0x68, 0x39, 0x11, 0x80, 0x44, 0x3a, 0x11, 0x80, 0x48, 0x00, 0x11 +, 0x80, 0xac, 0x44, 0x11, 0x80, 0xc0, 0x1a, 0x11, 0x80, 0x5c, 0x00, 0x00, 0xb6, 0xfd, 0x63, 0x05, 0x62, 0x04, 0xd0, 0x00, 0x68, 0x18, 0xb4, 0x04, 0x32, 0x49, 0xe4, 0x60, 0xaa, 0xff, 0xf7, 0x1f, 0x73, 0x0e, 0x60, 0x41, 0x40, 0x44, 0x32, 0x49, 0xe4, 0xc0, 0xaa, 0x3f, 0x6c, 0x6c, 0xec, 0x00, 0x18, 0x01, 0xa6, 0x00, 0x6d, 0x02, 0x48, 0xff, 0x6a, 0x4c, 0xe8, 0x10, 0x58, 0xeb, 0x61, 0x00, 0x68, 0x0e, 0xb4, 0x04, 0x32, 0x49, 0xe4, 0x60, 0xaa, 0xff, 0xf7, 0x1f, 0x73, 0x0e, 0x60, 0x41, 0x40, 0x44, 0x32, 0x49, 0xe4, 0xc0, 0xaa, 0x3f, 0x6c, 0x6c, 0xec, 0x00, 0x18, 0x01, 0xa6, 0x00, 0x6d, 0x02, 0x48, 0xff, 0x6a, 0x4c, 0xe8, 0x1a, 0x58, 0xeb, 0x61, 0x05, 0x97, 0x04, 0x90, 0x00, 0xef, 0x03, 0x63, 0x00, 0x65, 0xc4, 0xdc, 0x10, 0x80, 0xe4, 0xdc, 0x10, 0x80, 0xfb, 0x63, 0x09, 0x62, 0x08, 0xd0, 0x44, 0x67, 0x80, 0x9c, 0x3f, 0x6b, 0xff, 0x6e, 0x8c, 0xeb, 0x30, 0x73, 0x7d, 0x61, 0x62, 0xa2, 0x83, 0xa2, 0xa4, 0xa2, 0x06, 0x23, 0xe8, 0x43, 0xea, 0x4f, 0x02, 0x6e, 0xe3, 0xee, 0x62, 0x61, 0x04, 0x10, 0x66, 0xb3, 0xc0, 0xab, 0x03, 0x6b, 0x63, 0x10, 0x05, 0x5d, 0x5f, 0x60, 0x04, 0x0e, 0xa4, 0x35, 0xb5, 0xe6, 0xa0, 0x8d, 0xb9, 0xe6, 0x00, 0xee, 0x00, 0x65, 0x00, 0x65, 0x0f, 0x00, 0x79, 0x01, 0x0b, 0x00, 0x4f, 0x00, 0x5b, 0x00, 0x5e, 0xb4, 0x29, 0x10, 0x1e, 0x73, 0x18, 0x61, 0x00, 0x6b, 0xc0, 0xf2, 0x0c, 0x6d, 0xb8, 0xeb, 0x5b, 0xb6, 0x12, 0xed, 0xd5, 0xe5, 0xe0, 0xf0, 0xe3, 0xa5, 0x59, 0xb6, 0x8e, 0xef, 0x04, 0x2f, 0x40, 0xf2, 0x88, 0x45, 0xa0, 0xde, 0x16, 0x10, 0x00, 0x6d, 0xa0, 0xde, 0x01, 0x4b, 0xff, 0x6d, 0xac, 0xeb, 0x0a, 0x5b, 0xea, 0x61, 0x36, 0x10, 0x52, 0xb3, 0x80, 0x9b, 0x33, 0x24, 0x40, 0xf2, 0x08, 0x4c, 0x08, 0x10, 0x0a, 0x6b, 0x78, 0xec, 0x4f, 0xb3, 0x12, 0xec, 0x71, 0xe4, 0x02, 0x10, 0x4e, 0xb4, 0x01, 0x10, 0x27, 0x24, 0x62, 0xa2, 0x1e, 0x73, 0x0a, 0x61, 0x62, 0xa4, 0xc1, 0xa4, 0x60, 0x33, 0x60, 0x33, 0xc0, 0x36, 0x6d, 0xee, 0x60, 0xa4, 0x6d, 0xee, 0x63, 0xa4, 0x0b, 0x10, 0x1f, 0x73, 0x0e, 0x61, 0x66, 0xa4, 0xc5, 0xa4, 0x60, 0x33, 0x60, 0x33, 0xc0, 0x36, 0x6d, 0xee, 0x64, 0xa4, 0x6d, 0xee, 0x67, 0xa4, 0x00, 0xf6, +0x60, 0x33, 0x6d, 0xee, 0x04, 0x6b, 0x0c, 0x10, 0xc9, 0xa4, 0x68, 0xa4, 0xc0, 0x36, 0x6d, 0xee, 0x02, 0x6b, 0x06, 0x10, 0x80, 0x18, 0xee, 0x2b, 0x82, 0x67, 0x60, 0x10, 0x00, 0x6b, 0xc3, 0x67, 0x81, 0xa2, 0x70, 0x33, 0x63, 0xc2, 0x10, 0x6b, 0x6b, 0xeb, 0x8c, 0xeb, 0x61, 0xc2, 0xa0, 0x9a, 0x00, 0x18, 0x55, 0x2f, 0x02, 0x6c, 0x52, 0x10, 0x23, 0x73, 0x50, 0x60, 0x11, 0x73, 0x30, 0x61, 0xa1, 0x9a, 0x82, 0x32, 0x42, 0x32, 0xcc, 0xea, 0x1c, 0x22, 0xa2, 0x32, 0xcc, 0xea, 0x34, 0x5a, 0x07, 0x61, 0x1f, 0xf7, 0x01, 0x6a, 0x4b, 0xea, 0x4c, 0xed, 0x06, 0xf2, 0x00, 0x6a, 0x4d, 0xed, 0xa2, 0x32, 0xff, 0x6b, 0x6c, 0xea, 0x14, 0x5a, 0x07, 0x60, 0x1f, 0xf7, 0x01, 0x6a, 0x4b, 0xea, 0x4c, 0xed, 0x02, 0xf4, 0x00, 0x6a, 0x4d, 0xed, 0x00, 0xf6, 0x82, 0x33, 0x22, 0xb2, 0x60, 0xc2, 0x02, 0x10, 0x20, 0xb3, 0x40, 0xc3, 0x1f, 0xb2, 0x40, 0xa2, 0xff, 0x6b, 0xff, 0x4a, 0x6c, 0xea, 0x0e, 0x5a, 0x24, 0x60, 0x01, 0x6b, 0x1c, 0xb2, 0x00, 0x18, 0x99, 0xf4, 0x60, 0xc2, 0x1e, 0x10, 0x1b, 0x73, 0x00, 0x6a, 0x1c, 0x61, 0x82, 0x34, 0x82, 0x34, 0xcc, 0xec, 0x03, 0x2c, 0x00, 0xf2, 0x00, 0x68, 0x02, 0x10, 0x20, 0xf2, 0x00, 0x68, 0xa0, 0xf1, 0x06, 0x6c, 0x00, 0x18, 0xc3, 0x3b, 0xb0, 0x67, 0x01, 0x6a, 0x04, 0xd2, 0x04, 0x6c, 0x11, 0xb2, 0xfa, 0x6d, 0xe3, 0xf0, 0x17, 0x6e, 0xa1, 0xf1, 0x14, 0x6f, 0x05, 0xd2, 0x20, 0x18, 0xc5, 0x30, 0x06, 0xd0, 0x01, 0x6a, 0x09, 0x97, 0x08, 0x90, 0x00, 0xef, 0x05, 0x63, 0x0a, 0xb4, 0x72, 0x17, 0x40, 0x00, 0x11, 0x80, 0x7c, 0x4f, 0x11, 0x80, 0x74, 0x54, 0x11, 0x80, 0x54, 0x07, 0x11, 0x80, 0xcc, 0x4f, 0x11, 0x80, 0xb0, 0x4b, 0x11, 0x80, 0x4e, 0x07, 0x11, 0x80, 0xb8, 0x94, 0x11, 0x80, 0xb0, 0xe7, 0x04, 0x80, 0xd0, 0x4b, 0x11, 0x80, 0xfd, 0x63, 0x05, 0x62, 0xff, 0x6d, 0x00, 0x18, 0x26, 0x8d, 0xcc, 0xed, 0x05, 0x97, 0x00, 0xef, 0x03, 0x63, 0x00, 0x65, 0xfb, 0x63, 0x09, 0x62, 0x08, 0xd1, 0x07, 0xd0, 0x18, 0xb2, 0x19, 0xb3, 0x63, 0xea, 0x26, 0x61, 0x18, 0xb2, 0x80, 0x9a, 0x18, 0xb3, 0x8e, 0xeb, 0x21, 0x2b, 0x02, 0xaa, 0x17, 0xb5, 0x1d, 0x10, 0x17, 0xb4, 0x42, 0x45, 0x43, 0xec, 0x1a, 0x61, 0xc0, 0xa2, 0xff, 0xf7, 0x1f, 0x6f +, 0x43, 0x46, 0x43, 0xe8, 0x14, 0x61, 0x45, 0xe5, 0x23, 0xec, 0x11, 0x61, 0x81, 0xa5, 0x60, 0xa5, 0x80, 0x34, 0x6d, 0xec, 0xec, 0xec, 0xe0, 0xf3, 0x14, 0x5c, 0x09, 0x60, 0x43, 0xe0, 0x0d, 0xb2, 0x03, 0x4d, 0x91, 0xe2, 0x00, 0x18, 0xf6, 0x33, 0xec, 0xe8, 0xb1, 0x67, 0xe2, 0x28, 0x09, 0x97, 0x08, 0x91, 0x07, 0x90, 0x00, 0xef, 0x05, 0x63, 0x00, 0x65, 0xf0, 0xff, 0x10, 0x80, 0x18, 0xde, 0x10, 0x80, 0x1c, 0xde, 0x10, 0x80, 0x55, 0xab, 0x23, 0x87, 0x22, 0xde, 0x10, 0x80, 0xff, 0xff, 0x10, 0x80, 0x48, 0x00, 0x11, 0x80, 0xfc, 0x63, 0x07, 0x62, 0x0b, 0xb2, 0x42, 0xaa, 0x60, 0xac, 0x9d, 0x67, 0x4f, 0xea, 0x6c, 0xea, 0xff, 0xf7, 0x1f, 0x6b, 0x4c, 0xeb, 0x48, 0xcc, 0x62, 0x33, 0x20, 0x6a, 0x6c, 0xea, 0x03, 0x22, 0x00, 0x18, 0x0c, 0xd6, 0x00, 0x65, 0x07, 0x97, 0x00, 0x6a, 0x00, 0xef, 0x04, 0x63, 0x00, 0x65, 0x00, 0x3b, 0x11, 0x80, 0xfa, 0x63, 0x0b, 0x62, 0x0a, 0xd1, 0x09, 0xd0, 0xff, 0x69, 0x36, 0xb0, 0x8c, 0xe9, 0x61, 0xf3, 0x06, 0x6d, 0x00, 0x18, 0xc3, 0x3b, 0x22, 0x6c, 0x20, 0xf0, 0xbf, 0xa0, 0xf3, 0x6a, 0x24, 0x6c, 0xa0, 0x35, 0x00, 0x18, 0xc3, 0x3b, 0x4d, 0xed, 0x40, 0xf0, 0xa1, 0xa0, 0x40, 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 0x2e, 0xeb, 0x03, 0x2b, 0x19, 0xb2, 0x20, 0xf0, 0x2b, 0xc2, 0x85, 0xa0, 0x17, 0xb3, 0x07, 0x6a, 0x8c, 0xea, 0xa3, 0xa3, 0x50, 0x34, 0x71, 0x6a, 0x4b, 0xea, 0xac, 0xea, 0x8d, 0xea, 0x43, 0xc3, 0x1c, 0x10, 0x00, 0x6b, 0x01, 0x6a, 0x08, 0xd3, 0x09, 0xd2, 0x80, 0xa8, 0x00, 0x18, 0x57, 0x90, 0x08, 0x95, 0x7d, 0x67, 0x47, 0x43, 0x1d, 0x4a, 0x40, 0xa2, 0x0f, 0x93, 0x40, 0xc3, 0x7d, 0x67, 0x47, 0x43, 0x19, 0x4a, 0x40, 0xa2, 0x10, 0x93, 0x40, 0xc3, 0x01, 0x6a, 0x01, 0x10, 0x00, 0x6a, 0x0d, 0x97, 0x0c, 0x91, 0x0b, 0x90, 0x00, 0xef, 0x07, 0x63, 0x09, 0x93, 0x01, 0x73, 0xe9, 0x61, 0xe4, 0x17, 0x48, 0x00, 0x11, 0x80, 0xe8, 0x93, 0x11, 0x80, 0xb0, 0xe7, 0x04, 0x80, 0xfd, 0x63, 0x05, 0x62, 0x06, 0xb2, 0xc0, 0xf1, 0x7f, 0xa2, 0x07, 0x6a, 0x6c +, 0xea, 0x03, 0x22, 0x00, 0x18, 0x04, 0x25, 0x00, 0x6c, 0x05, 0x97, 0x00, 0xef, 0x03, 0x63, 0x48, 0x00, 0x11, 0x80, 0xf8, 0x63, 0x0f, 0x62, 0x0e, 0xd0, 0x68, 0xa4, 0x01, 0x6a, 0x04, 0x67, 0x6c, 0xea, 0x04, 0x22, 0x00, 0x18, 0x19, 0x02, 0x00, 0x65, 0x31, 0x2a, 0x68, 0xa0, 0x04, 0x6a, 0x6c, 0xea, 0x04, 0x22, 0x00, 0x18, 0xb0, 0x01, 0x90, 0x67, 0x29, 0x2a, 0x68, 0xa0, 0x08, 0x6a, 0x6c, 0xea, 0x04, 0x22, 0x00,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0d, 0xb3, 0xfa, 0x6d, 0x41, 0xf6, 0x03, 0x6e, 0x01, 0xf0, 0x0c, 0x6f, 0x12, 0xea, 0x49, 0xe3, 0x0a, 0xb3, 0x63, 0xda, 0x00, 0x6a, 0x0a, 0xb3, 0x04, 0xd2, 0x05, 0xd3, 0x20, 0x18, 0xc5, 0x30, 0x06, 0xd2, 0x09, 0x97, 0x08, 0x90, 0x00, 0xef, 0x05, 0x63, 0x00, 0x65, 0x48, 0x00, 0x11, 0x80, 0x30, 0x00, 0x11, 0x80, 0x0c, 0x8a, 0x11, 0x80, 0x81, 0xcb, 0x10, 0x80, 0xb0, 0xe7, 0x04, 0x80, 0xfb, 0x63, 0x09, 0x62, 0x08, 0xd1, 0x07, 0xd0, 0x16, 0xb2, 0xc0, 0xf1, 0x7f, 0xa2, 0x07, 0x6a, 0xff, 0xf7, 0x1f, 0x68, +0x6c, 0xea, 0x0a, 0xd4, 0x0b, 0xd5, 0x0d, 0xd7, 0xcc, 0xe8, 0x15, 0x22, 0x11, 0xb1, 0x00, 0x1c, 0xf6, 0x1b, 0x00, 0x65, 0x60, 0xa1, 0x0c, 0x23, 0x00, 0x18, 0x08, 0x36, 0x04, 0xd2, 0x0e, 0xb3, 0x80, 0xa3, 0x1e, 0x6b, 0x04, 0x92, 0x8c, 0xeb, 0x06, 0x6c, 0x8e, 0xeb, 0x01, 0x2b, 0x60, 0xc1, 0x00, 0x1c, 0xfd, 0x1b, 0x82, 0x67, 0x0d, 0x97, 0x0a, 0x94, 0x0b, 0x95, 0x00, 0x18, 0x8e, 0x20, 0xd0, 0x67, 0x09, 0x97, 0x08, 0x91, 0x07, 0x90, 0x00, 0xef, 0x05, 0x63, 0x48, 0x00, 0x11, 0x80, 0xb2, 0x06, 0x11, 0x80, 0xc0, 0x1e, 0x11, 0x80, 0xfd, 0x63, 0x05, 0x62, 0x04, 0xd0, 0x00, 0x1c, 0xf6, 0x1b, 0x00, 0x65, 0x02, 0x67, 0x11, 0xb2, 0x60, 0x9a, 0x11, 0xb2, 0x00, 0x6c, 0x6e, 0xea, 0x02, 0x2a, 0x10, 0xb2, 0x80, 0x9a, 0x00, 0x6b, 0x0e, 0xb2, 0x60, 0xda, 0x0e, 0xb3, 0x82, 0x34, 0x82, 0x34, 0x40, 0x9b, 0xff, 0xf7, 0x1f, 0x6d, 0x80, 0x34, 0xac, 0xea, 0x80, 0x34, 0x8d, 0xea, 0x40, 0xdb, 0x00, 0x18, 0xb5, 0x26, 0x00, 0x6c, 0x00, 0x1c, 0xfd, 0x1b, 0x90, 0x67, 0x05, 0x97, 0x04, 0x90, 0x00, 0xef, 0x03, 0x63, 0x00, 0x65, 0x58, 0x8b, 0x10, 0x80, 0x32, 0x97, 0x79, 0x23, 0x5c, 0x8b, 0x10, 0x80, 0x30, 0x00, 0x00, 0xb5, 0xfd, 0x63, 0x05, 0x62, 0x1e, 0xb2, 0x1f, 0xb3, 0x63, 0xa3, 0x1f, 0xb4, 0x40, 0x9a, 0x7e, 0x33, 0x60, 0x33, 0x60, 0x33, 0x8c, 0xea, 0x6d, 0xea, 0x1c, 0xb3, 0xe0, 0xf1, 0x63, 0xa3, 0x01, 0x6c, 0x8c, 0xeb, 0x05, 0x23, 0x1a, 0xb3, 0x6c, 0xea, 0x1a, 0xb3, 0x6d, 0xea, 0x04, 0x10, 0x1a, 0xb3, 0x6d, 0xea, 0x1a, 0xb3, 0x6c, 0xea, 0x12, 0xb3, 0x40, 0xdb, 0x19, 0xb2, 0x19, 0xb3, 0x72, 0xda, 0x19, 0xb3, 0x75, 0xda, 0x19, 0xb3, 0x69, 0xda, 0x19, 0xb3, 0x6c, 0xda, 0x19, 0xb3, 0x6f, 0xda, 0x19, 0xb3, 0x66, 0xda, 0x19, 0xb3, 0x7b, 0xda, 0x19, 0xb3, 0x60, 0xda, 0x19, 0xb3, 0x80, 0x18, 0x99, 0x28, 0x78, 0xda, 0x18, 0xb3, 0x19, 0xb2, 0x60, 0xda, 0x19, 0xb3, 0x19, 0xb2, 0x80, 0x18, 0x89, 0x2e, 0x60, 0xda, 0x05, 0x97, 0x00, 0xef, 0x03, 0x63, 0x00, 0x65, 0x74, 0xa0, 0x00, 0xb0, 0x2c, 0x3a, 0x11, 0x80, 0xff, 0xff, 0xfe, 0xff, 0x48, 0x00, 0x11, 0x80, 0xff, 0xff, 0xfb, 0xff, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x04, 0x00, 0xff, 0xff, 0xef, 0xff +, 0x84, 0x88, 0x11, 0x80, 0x21, 0xd9, 0x10, 0x80, 0x11, 0xd9, 0x10, 0x80, 0x01, 0xd9, 0x10, 0x80, 0xf1, 0xd8, 0x10, 0x80, 0x1d, 0xd8, 0x10, 0x80, 0x0d, 0xd8, 0x10, 0x80, 0x39, 0xd7, 0x10, 0x80, 0x01, 0xd7, 0x10, 0x80, 0xe1, 0xd6, 0x10, 0x80, 0xcd, 0xcc, 0x10, 0x80, 0xc0, 0x2d, 0x11, 0x80, 0xa5, 0xc8, 0x10, 0x80, 0x94, 0x1d, 0x11, 0x80, 0xfd, 0x63, 0x05, 0x62, 0x04, 0xd0, 0x00, 0x6b, 0x27, 0xb2, 0x80, 0x18, 0x99, 0x28, 0x60, 0xc2, 0x26, 0xb2, 0xc0, 0xf1, 0x1f, 0xa2, 0xff, 0x6c, 0x78, 0xaa, 0xd0, 0x67, 0x8c, 0xee, 0x01, 0x6d, 0xce, 0x32, 0xac, 0xea, 0x50, 0x37, 0x11, 0x6a, 0x4b, 0xea, 0x6c, 0xea, 0xd2, 0x33, 0xac, 0xeb, 0xed, 0xea, 0x60, 0x33, 0xff, 0xf5, 0x1e, 0x4d, 0x64, 0x33, 0xac, 0xea, 0x6d, 0xea, 0x07, 0x6b, 0x0c, 0xeb, 0x8c, 0xeb, 0x04, 0x53, 0x04, 0x61, 0x07, 0x6b, 0x6b, 0xeb, 0x4c, 0xeb, 0x07, 0x10, 0x03, 0x6c, 0x6c, 0xec, 0x84, 0x33, 0x07, 0x6c, 0x8b, 0xec, 0x4c, 0xec, 0x8d, 0xeb, 0x13, 0xb2, 0x78, 0xca, 0xff, 0x6b, 0x6c, 0xe8, 0x07, 0x6a, 0x0c, 0xea, 0x6c, 0xea, 0x03, 0x22, 0x00, 0x18, 0x04, 0x25, 0x00, 0x6c, 0x1e, 0x30, 0x12, 0x20, 0x00, 0x68, 0x00, 0x18, 0xc6, 0x1c, 0x01, 0x6c, 0x00, 0x18, 0x04, 0x25, 0x01, 0x6c, 0x00, 0x18, 0xc6, 0x1c, 0x01, 0x6c, 0x00, 0x18, 0x04, 0x25, 0x00, 0x6c, 0x01, 0x48, 0xff, 0x6a, 0x4c, 0xe8, 0x04, 0x58, 0xef, 0x61, 0x05, 0x97, 0x04, 0x90, 0x00, 0xef, 0x03, 0x63, 0x24, 0x94, 0x11, 0x80, 0x48, 0x00, 0x11, 0x80, 0xfa, 0x63, 0x0b, 0x62, 0x0a, 0xd1, 0x09, 0xd0, 0xff, 0xf7, 0x1f, 0x6a, 0x4c, 0xee, 0x4c, 0xed, 0xff, 0x6a, 0x0c, 0xd4, 0x06, 0xd6, 0x04, 0xd5, 0x05, 0xd2, 0x5c, 0x10, 0x04, 0x93, 0x0c, 0x94, 0x64, 0x32, 0x49, 0xe4, 0x40, 0xaa, 0xff, 0xf7, 0x1f, 0x72, 0x58, 0x60, 0xe0, 0xf3, 0x1f, 0x68, 0x01, 0x4b, 0x4c, 0xe8, 0x64, 0x33, 0x42, 0x32, 0x6d, 0xe4, 0x56, 0x32, 0x20, 0xab, 0x44, 0x32, 0x03, 0x0b, 0x49, 0xe3, 0x40, 0x8a, 0x4d, 0xe3, 0x00, 0xeb, 0x00, 0x65, 0x11, 0x00, 0x19, 0x00, 0x6f, 0x00, 0x45, 0x00, 0x4d, 0x00, 0x6f, 0x00, 0x57, 0x00, 0x61, 0x00, 0x3f, 0x6c, 0x0c, 0xec, 0x00, 0x6d, 0x12, 0x10, 0x05, 0x93, 0x02, 0x32, 0x4a, 0xeb, 0x08, 0x60, 0xc2, 0x67, 0x40, +0x6c, 0x01, 0x6d, 0x00, 0x18, 0x01, 0xa6, 0x07, 0xd2, 0x07, 0x92, 0x05, 0xd2, 0x7f, 0x6c, 0x0c, 0xec, 0x87, 0x34, 0x40, 0x6a, 0x4d, 0xec, 0x01, 0x6d, 0x00, 0x18, 0x01, 0xa6, 0xd1, 0x67, 0x1c, 0x10, 0x00, 0x18, 0xc6, 0x1c, 0x91, 0x67, 0x18, 0x10, 0x01, 0x6a, 0x0c, 0xea, 0x15, 0x2a, 0x13, 0xb2, 0x09, 0x10, 0x01, 0x6a, 0x0c, 0xea, 0x10, 0x2a, 0x11, 0xb2, 0x04, 0x10, 0x01, 0x6a, 0x0c, 0xea, 0x0b, 0x2a, 0x10, 0xb2, 0x41, 0xe0, 0x20, 0xc8, 0x07, 0x10, 0x01, 0x6a, 0x0c, 0xea, 0x04, 0x2a, 0x90, 0x67, 0x00, 0x18, 0xc3, 0x3b, 0xb1, 0x67, 0x04, 0x94, 0xff, 0xf7, 0x1f, 0x6a, 0x02, 0x4c, 0x4c, 0xec, 0x04, 0xd4, 0x04, 0x92, 0x06, 0x93, 0x63, 0xea, 0xa0, 0x61, 0x0b, 0x97, 0x0a, 0x91, 0x09, 0x90, 0x00, 0xef, 0x06, 0x63, 0x00, 0x65, 0x00, 0xa0, 0x00, 0xb0, 0x00, 0x00, 0x00, 0xb5, 0x00, 0x10, 0x00, 0xb6, 0xfd, 0x63, 0x05, 0x62, 0x04, 0x6c, 0x00, 0x18, 0xa1, 0xa5, 0x00, 0x6d, 0x20, 0x6b, 0x4d, 0xeb, 0xff, 0xf7, 0x1f, 0x6e, 0x6c, 0xee, 0x00, 0x6d, 0x00, 0x18, 0x01, 0xa6, 0x04, 0x6c, 0x00, 0x18, 0xc1, 0x1c, 0x50, 0x6c, 0x04, 0x6c, 0x00, 0x18, 0xa1, 0xa5, 0x00, 0x6d, 0x05, 0x97, 0x1f, 0x6b, 0x6c, 0xea, 0x00, 0xef, 0x03, 0x63, 0x00,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82, 0x4e, 0xe8, 0x3c, 0x20, 0x26, 0xb2, 0x60, 0xa2, 0x07, 0x5b, 0x02, 0x61, 0x06, 0x6b, 0x60, 0xc2, 0x23, 0xb2, 0xa0, 0xa2, 0x1d, 0xb2, 0x63, 0xa2, 0x07, 0x6c, 0x72, 0x36, 0x8c, 0xee, 0xc2, 0xed, 0x06, 0x60, 0x8c, 0xed, 0x88, 0x4c, 0xb0, 0x35, 0x6c, 0xec, 0xad, 0xec, 0x83, 0xc2, 0x16, 0xb2, 0x43, 0xa2, 0x07, 0x6b, 0x02, 0x6c, 0x52, 0x32, 0x6c, 0xea, 0x61, 0x42, 0x8b, 0xec, 0x8c, 0xeb, 0x18, 0xb4, 0x20, 0xf1, 0x16, 0x4b, 0xff, 0xf7, 0x1f, 0x68, 0x8d, 0xe3, 0x20, 0xab, 0x01, 0x6b, 0x4c, 0xeb, 0x6c, 0x33, 0x02, 0x6c, 0x00, 0x6d, 0x0c, 0xe9, 0x00, 0x18, 0xa1, 0xa5, 0x27, 0xeb, 0x1f, 0xf7, 0x01, 0x6b, 0x0c, 0xea, 0x6b, 0xeb, 0x0c, 0xe9, 0x6c, 0xea, 0x20, 0x31, 0x0c, 0xe9, 0xc2, 0x67, 0x02, 0x6c, 0x00, 0x6d, 0x00, 0x18, 0x01, 0xa6, 0x2d, 0xee, 0x07, 0x97, 0x06, 0x91, 0x05, 0x90, 0x00, 0xef, 0x04, 0x63, 0xe8, 0x93, 0x11, 0x80, 0xba, 0x01, 0x00, 0xb6, 0x48, 0x00, 0x11, 0x80, 0x80, 0x50, 0x11, 0x80, 0xe4, 0x1a, 0x11, 0x80, 0x6c, 0x04, 0x11, 0x80, 0x00, 0x00, 0x00, 0xb6, 0xfc, 0x63, 0x07, 0x62, 0x06, 0xd1, 0x05, 0xd0, 0x00, 0x68, 0x24, 0x67, 0x04, 0x32, 0x49, 0xe1, 0x60, 0xaa, 0xff, 0xf7, 0x1f, 0x73, 0x29, 0x60, 0x1e, 0xf0, 0x00, 0x6a, 0x6c, 0xea, 0x0c, 0xf0, 0x00, 0x72, 0x07, 0x61, 0x41, 0x40, 0x44, 0x32, 0x49, 0xe1, 0x00, 0x18, 0xc1, 0x1c, 0x80, 0xaa, 0x18, 0x10, 0x04, 0xf0, 0x00, 0x72, 0x0b, 0x61, 0xff, 0x6c, 0x8c, 0xeb, 0x40, 0x6a, 0x67, 0x33, 0x4d, 0xeb, 0x41, 0x40, 0x44, 0x32, 0x49, 0xe1, 0x6c, 0xec, 0x01, 0x6d, 0x07, 0x10, 0x0d, 0x2a, 0x41, 0x40, 0x44, 0x32, 0xff, 0x6c, 0x49, 0xe1, 0x6c, 0xec, 0x00, 0x6d, 0x00, 0x18, 0x01, 0xa6, 0xc0, 0xaa, 0x02, 0x48, 0xff, 0x6a, 0x4c, 0xe8, 0xd1, 0x17, 0x07, 0x97, 0x06, 0x91, 0x05, 0x90, 0x00, 0xef, 0x04, 0x63, 0xf9, 0x63, 0x0d, 0x62, 0x0c, 0xd1, 0x0b, 0xd0, 0xff, 0x68, 0x00, 0x6e, 0x8c, 0xe8, 0x01, 0x6d, 0x00, 0x18, 0x01, 0xa6, 0x40, 0x6c, 0x5a, 0x6c, 0x00, 0x18, +0xa1, 0xa5, 0x01, 0x6d, 0x5c, 0x6c, 0x01, 0x6d, 0x00, 0x18, 0xa1, 0xa5, 0x22, 0x67, 0xff, 0xf7, 0x1f, 0x6b, 0x6c, 0xe9, 0xff, 0xf7, 0x1e, 0x6e, 0x6c, 0xea, 0x5a, 0x6c, 0x01, 0x6d, 0x2c, 0xee, 0x08, 0xd2, 0x00, 0x18, 0x01, 0xa6, 0x09, 0xd3, 0x08, 0x92, 0x09, 0x93, 0x03, 0x6e, 0x4d, 0xee, 0x5c, 0x6c, 0x01, 0x6d, 0x00, 0x18, 0x01, 0xa6, 0x6c, 0xee, 0x42, 0xb4, 0x80, 0x18, 0x68, 0x34, 0x00, 0x65, 0x06, 0x20, 0x90, 0x67, 0x00, 0x18, 0xc6, 0x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 0x6f, 0x05, 0xd3, 0x06, 0xd0, 0x09, 0xd3, 0x20, 0x18, 0xc5, 0x30, 0x04, 0xd2, 0x09, 0x93, 0x02, 0x6a, 0x04, 0xd2, 0x05, 0xd3, 0x08, 0x93, 0xff, 0xf7, 0x1f, 0x6a, 0x05, 0x6c, 0x6c, 0xea, 0xfa, 0x6d, 0x61, 0xf3, 0x13, 0x6e, 0x44, 0xf5, 0x18, 0x6f, 0x06, 0xd1, 0x20, 0x18, 0xc5, 0x30, 0x07, 0xd2, 0x51, 0x67, 0x0d, 0x97, 0x0c, 0x91, 0x0b, 0x90, 0x00, 0xef, 0x07, 0x63, 0x58, 0xdd, 0x10, 0x80, 0xec, 0xdd, 0x10, 0x80, 0xb0, 0xe7, 0x04, 0x80, 0xf5, 0x63, 0x15, 0x62, 0x14, 0xd1 +, 0x13, 0xd0, 0x02, 0x6c, 0x00, 0x18, 0xa1, 0xa5, 0x00, 0x6d, 0x3f, 0x6c, 0x00, 0x6d, 0x00, 0x18, 0xa1, 0xa5, 0x11, 0xd2, 0x11, 0x93, 0xff, 0x69, 0x2c, 0xea, 0xff, 0xf7, 0x1f, 0x68, 0x0c, 0xd2, 0x0c, 0xeb, 0x0c, 0x95, 0x62, 0x33, 0x2c, 0xeb, 0x01, 0x6a, 0xc3, 0x67, 0x82, 0x67, 0xe2, 0x67, 0x11, 0xd3, 0x80, 0x18, 0x85, 0x34, 0x04, 0xd2, 0x11, 0x93, 0x0c, 0x95, 0x03, 0x6a, 0xc3, 0x67, 0x00, 0x6c, 0x0f, 0x6f, 0x80, 0x18, 0x85, 0x34, 0x04, 0xd2, 0x42, 0x34, 0x1f, 0x6d, 0x11, 0x93, 0x8a, 0x34, 0x56, 0x32, 0xac, 0xec, 0xac, 0xea, 0x0c, 0x95, 0x03, 0x6e, 0x0b, 0xd4, 0x04, 0xd6, 0x00, 0x6c, 0xc3, 0x67, 0x0f, 0x6f, 0x80, 0x18, 0x85, 0x34, 0x0a, 0xd2, 0x42, 0x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 0xe5, 0x00, 0xf6, 0x20, 0x35, 0x00, 0xf6, 0xa3, 0x35, 0xb8, 0xed, 0x12, 0xed, 0xf8, 0xef, 0x12, 0xef, 0xf5, 0xe5, 0x0c, 0xed, 0x10, 0x60, 0xc3, 0xed, 0x07, 0x60, 0x09, 0x95, 0x08, 0x96, 0xad, 0xe3, 0x67, 0x33, 0x0c, 0xeb, 0xd1, 0xe4, 0x13, 0x10, 0x0b, +0x97, 0x0a, 0x95, 0xed, 0xe3, 0x67, 0x33, 0x0c, 0xeb, 0xb1, 0xe4, 0x0c, 0x10, 0x11, 0x5d, 0x04, 0x61, 0x00, 0x6c, 0x11, 0x69, 0x10, 0x6b, 0x1b, 0x10, 0x09, 0x96, 0x08, 0x97, 0xcd, 0xe3, 0x67, 0x33, 0x0c, 0xeb, 0xf1, 0xe4, 0xa4, 0x43, 0x87, 0x34, 0x20, 0x5d, 0x0c, 0xec, 0x65, 0x67, 0x01, 0x61, 0x1f, 0x6b, 0xff, 0xf7, 0x1f, 0x6e, 0x04, 0x4c, 0xcc, 0xec, 0xa4, 0x67, 0xcc, 0xec, 0x20, 0x5c, 0xcc, 0xeb, 0x01, 0x61, 0x1f, 0x6d, 0xff, 0xf7, 0x1f, 0x69, 0xac, 0xe9, 0x01, 0x6c, 0x1f, 0x68, 0x4c, 0xe8, 0x08, 0x24, 0x10, 0xf0, 0x00, 0x6a, 0x4b, 0xea, 0x4d, 0xe8, 0xff, 0xf7, 0x1f, 0x6a, 0x4c, 0xe8, 0x11, 0x10, 0x01, 0x6d, 0xc5, 0x67, 0x00, 0x6c, 0x00, 0x18, 0x01, 0xa6, 0x11, 0xd3, 0x46, 0x6c, 0x01, 0x6d, 0x00, 0x18, 0x01, 0xa6, 0x00, 0x6e, 0x00, 0x6c, 0x01, 0x6d, 0x00, 0x18, 0x01, 0xa6, 0xc4, 0x67, 0x11, 0x93, 0x60, 0x33, 0x68, 0x33, 0x34, 0x31, 0x6d, 0xe9, 0x0d, 0xe9, 0x20, 0x36, 0xc0, 0x36, 0xc3, 0x36, 0xff, 0xf7, 0x1f, 0x6a, 0xc3, 0x36, 0x4c, 0xee, 0x21, 0x6c, 0x00, 0x18, 0x01, 0xa6, 0x00, 0x6d, 0x0e, 0x6c, 0x00, 0x18, 0xa1, 0xa5, 0x00, 0x6d, 0x21, 0x6c, 0x00, 0x6d, 0x00, 0x18, 0xa1, 0xa5, 0x02, 0x67, 0x02, 0x6b, 0x04, 0xd3, 0x01, 0x6c, 0x08, 0xb3, 0xfa, 0x6d, 0xc1, 0xf3, 0x1f, 0x6e, 0xa4, 0xf3, 0x0d, 0x6f, 0x06, 0xd0, 0x05, 0xd3, 0x20, 0x18, 0xc5, 0x30, 0x07, 0xd2, 0x15, 0x97, 0x14, 0x91, 0x13, 0x90, 0x00, 0xef, 0x0b, 0x63, 0xb0, 0xe7, 0x04, 0x80, 0xfd, 0x63, 0x05, 0x62, 0x1d, 0xb4, 0x00, 0x6d, 0x80, 0x18, 0xc6, 0x33, 0x5c, 0x6e, 0x1c, 0xb4, 0x00, 0x6d, 0x80, 0x18, 0xc6, 0x33, 0x5c, 0x6e, 0x80, 0x18, 0x93, 0x31, 0x00, 0x65, 0x00, 0x18, 0x62, 0xa6, 0x00, 0x65, 0x00, 0x18, 0x47, 0xa6, 0x00, 0x65, 0x00, 0x18, 0x87, 0xa4, 0x00, 0x65, 0x00, 0x18, 0x91, 0xa4, 0x00, 0x65, 0x13, 0xb2, 0x40, 0x9a, 0x61, 0x42, 0x07, 0x23, 0x24, 0x6b, 0x78, 0xea, 0x11, 0xb3, 0x12, 0xea, 0x49, 0xe3, 0x10, 0xb3, 0x63, 0xda, 0x80, 0x18, 0xdf, 0x34, 0x00, 0x65, 0x00, 0x6c, 0x01, 0x6d, 0x00, 0x18, 0x01, 0xa6, 0x02, 0x6e, 0x57, 0x6c, 0x01, 0x6d, 0x00, 0x18, 0x01, 0xa6, 0x10, 0x6e, 0x00, 0x6c, 0x01, 0x6d, 0x00, 0x18, 0x01, 0xa6, 0xc4, 0x67, 0x05 +, 0x97, 0x00, 0xef, 0x03, 0x63, 0x00, 0x65, 0x3c, 0x02, 0x11, 0x80, 0x0c, 0xdc, 0x10, 0x80, 0x80, 0x04, 0x11, 0x80, 0x0c, 0x8a, 0x11, 0x80, 0x45, 0xd0, 0x10, 0x80, 0xfd, 0x63, 0x05, 0x62, 0xff, 0x6a, 0x4c, 0xee, 0x85, 0x67, 0x01, 0x76, 0x4c, 0xec, 0x05, 0x61, 0x40, 0x6b, 0x8d, 0xeb, 0x83, 0x67, 0x4c, 0xec, 0x01, 0x10, 0x03, 0x2e, 0x00, 0x18, 0xbc, 0xa5, 0xa7, 0x67, 0x05, 0x97, 0x00, 0xef, 0x03, 0x63, 0xfb, 0x63, 0x09, 0x62, 0x08, 0xd1, 0x07, 0xd0, 0x04, 0x67, 0x00, 0x1c, 0xf6, 0x1b, 0x04, 0xd5, 0x14, 0xb4, 0x22, 0x67, 0x40, 0x9c, 0x04, 0x95, 0x01, 0x4a, 0x19, 0x22, 0xff, 0x6a, 0xac, 0xea, 0x01, 0x72, 0x04, 0x60, 0x20, 0x18, 0x64, 0x2f, 0x90, 0x67, 0x11, 0x10, 0x00, 0x18, 0x4d, 0x1d, 0x00, 0x65, 0x01, 0x6b, 0x6b, 0xeb, 0x0c, 0xb2, 0x60, 0xc2, 0x0c, 0xb2, 0x01, 0x6b, 0x40, 0x9a, 0x6c, 0xea, 0x05, 0x2a, 0x0a, 0xb3, 0x0b, 0xb4, 0x40, 0x9b, 0x8d, 0xea, 0x40, 0xdb, 0x00, 0x1c, 0xfd, 0x1b, 0x91, 0x67, 0x09, 0x97, 0x08, 0x91, 0x07, 0x90, 0x00, 0xef, 0x05, 0x63, 0x00, 0x65, 0xfc, 0x05, 0x11, 0x80, 0x00, 0x06, 0x11, 0x80, 0x50, 0x60, 0x00, 0xb0, 0x40, 0xa0, 0x00, 0xb0, 0x00, 0x00, 0x80, 0x00, 0xfd, 0x63, 0x05, 0x62, 0x44, 0xac, 0xe0, 0xf3, 0x0a, 0x72, 0x04, 0x61, 0x00, 0x18, 0xa7, 0xee, 0x00, 0x65, 0x03, 0x10, 0x00, 0x18, 0x6d, 0xf5, 0x00, 0x65, 0x05, 0x97, 0x00, 0xef, 0x03, 0x63, 0xfd, 0x63, 0x05, 0x62, 0x00, 0x18, 0x5b, 0x3a, 0x00, 0x65, 0x09, 0xb2, 0x40, 0x9a, 0x61, 0x42, 0x07, 0x23, 0x24, 0x6b, 0x78, 0xea, 0x07, 0xb3, 0x12, 0xea, 0x49, 0xe3, 0x06, 0xb3, 0x63, 0xda, 0x80, 0x18, 0x4e, 0x30, 0x00, 0x65, 0x05, 0x97, 0x00, 0xef, 0x03, 0x63, 0x80, 0x04, 0x11, 0x80, 0x0c, 0x8a, 0x11, 0x80, 0x45, 0xd0, 0x10, 0x80, 0xfa, 0x63, 0x0b, 0x62, 0x0a, 0xd1, 0x09, 0xd0, 0x44, 0xac, 0x04, 0x67, 0x60, 0x9c, 0x01, 0x72, 0x2a, 0x61, 0x3f, 0x69, 0x6c, 0xe9, 0x20, 0x71, 0x0b, 0x61, 0x25, 0xb2, 0x6c, 0xea, 0x08, 0x2a, 0x24, 0xb3, 0x40, 0xdb, 0x24, 0xb3, 0x40, 0xdb, 0x40, 0x9c, 0x24, 0xb3, 0x6d, 0xea, 0x40, 0xdc, 0x02, 0x6a, 0x04, 0xd2, 0x22, 0xb2, 0x05, 0xd2, 0x40, 0x98, 0x04, 0x6c, 0xfa, 0x6d, 0x06, 0xd2, 0x41, 0x98, 0x80, 0xf6, +0x17, 0x6e, 0x41, 0xf5, 0x0d, 0x6f, 0x20, 0x18, 0xc5, 0x30, 0x07, 0xd2, 0x30, 0x71, 0x24, 0x61, 0x42, 0xa0, 0x22, 0x2a, 0x17, 0xb3, 0x40, 0xdb, 0x19, 0xb3, 0x40, 0xdb, 0x19, 0xb3, 0x40, 0xdb, 0x1b, 0x10, 0x19, 0xb2, 0x20, 0xa2, 0x18, 0x29, 0x02, 0x6a, 0x04, 0xd2, 0x13, 0xb2, 0x05, 0xd2, 0x06, 0xd3, 0x41, 0x9c, 0xfa, 0x6d, 0x05, 0x6c, 0xc0, 0xf6, 0x02, 0x6e, 0x41, 0xf5, 0x0e, 0x6f, 0x20, 0x18, 0xc5, 0x30, 0x07, 0xd2, 0x11, 0xb2, 0x40, 0xa2, 0x06, 0x22, 0x40, 0xa0, 0x30, 0x72, 0x03, 0x60, 0x0f, 0xb2, 0x20, 0xda, 0x03, 0x10, 0x00, 0x18, 0xce, 0x31, 0x90, 0x67, 0x0b, 0x97, 0x0a, 0x91, 0x09, 0x90, 0x00, 0xef, 0x06, 0x63, 0x00, 0x00, 0xff, 0x00, 0x1c, 0xde, 0x10, 0x80, 0x4c, 0x8b, 0x10, 0x80, 0x00, 0x00, 0x01, 0x00, 0xb0, 0xe7, 0x04, 0x80, 0x54, 0x8b, 0x10, 0x80, 0x60, 0x8b, 0x10, 0x80, 0x4f, 0x07, 0x11, 0x80, 0x20, 0x94, 0x11, 0x80, 0x50, 0x07, 0x11, 0x80, 0xfd, 0x63, 0x05, 0x62, 0x00, 0x18, 0xa8, 0xba, 0x00, 0x65, 0x05, 0x97, 0x00, 0xef, 0x03, 0x63, 0xf7, 0x63, 0x11, 0x62, 0x10, 0xd0, 0x00, 0x18, 0x25, 0xbb, 0x04, 0x67, 0x44, 0xa8, 0x20, 0xf3, 0x01, 0x72, 0x4b, 0x61, 0x28, 0xb2, 0x60, 0xf1, 0x50, 0xa2, 0x03, 0x72, 0x46, 0x61, 0x27, 0xb2, 0x40, 0xaa, 0x01, 0x72, 0x13, 0x61, 0x26, 0xb2, 0x40, 0xa2, 0x01, 0x72, 0x0f, 0x61, 0x25, 0xb2, 0x60, 0xaa, 0xff, 0xf7, 0x1f, 0x6a, 0x6c, 0xea, 0xff, 0x6b, 0x01, 0x4b, 0x4c, 0xeb, 0x06, 0x23, 0xff, 0xf6, 0x1f, 0x6d, 0xac, 0x6c, 0x00, 0x18, 0xc3, 0x3b, 0x4c, 0xed, 0x1e, 0xb2, 0x40, 0xa2, 0x01, 0x72, 0x2b, 0x61, 0x1d, 0xb2, 0x40, 0xa2, 0x28, 0x2a, 0x09, 0x6a, 0x04, 0xd2, 0x1c, 0xb2, 0x05, 0xd2, 0x1c, 0xb2, 0x80, 0xf2, 0x7e, 0xa2, 0x01, 0x6c, 0xfa, 0x6d, 0x06, 0xd3, 0x80, 0xf2, 0x7f, 0xa2, 0x40, 0xf6, 0x03, 0x6e, 0xc1, 0xf3, 0x19, 0x6f, 0x07, 0xd3, 0xa0, 0xf2, 0x60, 0xa2, 0x08, 0xd3, 0xa0, 0xf2, 0x61, 0xa2, 0x09, 0xd3, 0xa0, 0xf2, 0x62, 0xa2, 0x0a, 0xd3, 0xa0, 0xf2, 0x63, 0xa2, 0x0b, 0xd3, 0xa0, 0xf2, 0x68, 0xa2, 0x0c, 0xd3, 0xa0, 0xf2, 0x66, 0xaa, 0x0d, 0xd3, 0xa0, 0xf2, 0x44, 0xaa, 0x20, 0x18, 0xc5, 0x30, 0x0e, 0xd2, 0x11, 0x97, 0x10, 0x90, 0x00, 0xef, 0x09, 0x63, 0x00, 0x65 +, 0x80, 0x50, 0x11, 0x80, 0x10, 0x1a, 0x11, 0x80, 0x08, 0x1a, 0x11, 0x80, 0xac, 0x00, 0x00, 0xb6, 0x44, 0x38, 0x11, 0x80, 0x28, 0x3a, 0x11, 0x80, 0xb0, 0xe7, 0x04, 0x80, 0x74, 0x54, 0x11, 0x80, 0xfd, 0x63, 0x05, 0x62, 0x00, 0x18, 0xc7, 0x5c, 0x00, 0x65, 0x05, 0x97, 0x00, 0xef, 0x03, 0x63, 0xfd, 0x63, 0x05, 0x62, 0x00, 0x18, 0x8c, 0x8e, 0x00, 0x65, 0x05, 0x97, 0x00, 0xef, 0x03, 0x63, 0xfd, 0x63, 0x05, 0x62, 0x00, 0x18, 0x50, 0x5d, 0x00, 0x65, 0x05, 0x97, 0x00, 0xef, 0x03, 0x63, 0xef,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, 0x11, 0x61, 0x24, 0xb2, 0x80, 0x9a, 0x00, 0x18, 0x6a, 0x1d, 0xb0, 0x67, 0x00, 0xf2, 0x0f, 0xa1, 0x01, 0x6a, 0x4e, 0xe8, 0x26, 0x28, 0x8b, 0x99, 0x00, 0x18, 0x3a, 0x1d, 0x00, 0x6d, 0x00, 0xf2, 0x0f, 0xc1, 0x1f, 0x10, 0x1a, 0x94, 0x00 +, 0x18, 0xfb, 0xe1, 0xb0, 0x67, 0x1b, 0x93, 0x13, 0x73, 0x05, 0x61, 0x1a, 0x95, 0x20, 0x18, 0x1e, 0x04, 0x90, 0x67, 0x0a, 0x10, 0x1b, 0x94, 0x18, 0x74, 0x07, 0x61, 0x12, 0x6a, 0xc0, 0xf0, 0x48, 0xc1, 0x1a, 0x95, 0x20, 0x18, 0x71, 0x01, 0x90, 0x67, 0x10, 0xb2, 0x80, 0x9a, 0x00, 0x18, 0x6a, 0x1d, 0xb0, 0x67, 0x03, 0x10, 0x20, 0x18, 0x6a, 0x24, 0x91, 0x67, 0x21, 0x97, 0x20, 0x91, 0x1f, 0x90, 0x00, 0xef, 0x11, 0x63, 0x80, 0x50, 0x11, 0x80, 0x18, 0x73, 0x11, 0x80, 0x19, 0x73, 0x11, 0x80, 0x24, 0x94, 0x11, 0x80, 0x28, 0x94, 0x11, 0x80, 0x00, 0x47, 0x11, 0x80, 0xb0, 0xe7, 0x04, 0x80, 0x30, 0x3a, 0x11, 0x80, 0x74, 0x54, 0x11, 0x80, 0xf8, 0x46, 0x11, 0x80, 0x04, 0x0b, 0x0f, 0x04, 0x0a, 0x0e, 0x08, 0x0b, 0x0f, 0x00, 0x00, 0x00, 0x1b, 0x00, 0xb7, 0x00, 0x53, 0x01, 0x36, 0x00, 0x6f, 0x01, 0xa7, 0x02, 0x53, 0x00, 0x28, 0x02, 0xfd, 0x03, 0x25, 0x00, 0x07, 0x04, 0x05, 0x01, 0x00, 0x00, 0x00, 0x00, 0x74, 0x41, 0x01, 0x10, 0xac, 0x80, 0x02, 0xf0, 0x78, 0x41, 0x07, 0x20, 0x7a, 0x41, 0xb1, 0x01, 0x7c, 0x41, 0x07, 0x00, 0x7e, 0x41, 0xb1, 0x01, 0x0a, 0x22, 0x62, 0x02, 0x4e, 0x22, 0x9a, 0x06, 0x50, 0x22, 0x9a, 0x06, 0x18, 0x20, 0x0f, 0x69, 0x34, 0x20, 0x55, 0x22, 0x38, 0x20, 0xa8, 0xc0, 0x00, 0x00, 0x06, 0x10, 0x0e, 0x00, 0x22, 0x10, 0x16, 0x00, 0x00, 0x24, 0x16, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x20, 0x81, 0x25, 0x00, 0x93, 0x23, 0x2b, 0x00, 0x80, 0x48, 0x21, 0x00, 0x00, 0x42, 0x24, 0x00, 0x00, 0xfe, 0x26, 0x00, 0x2a, 0x08, 0x26, 0x00, 0x2a, 0x08, 0x27, 0x00, 0x60, 0x04, 0x28, 0x00, 0x42, 0xc0, 0x29, 0x00, 0x18, 0xc4, 0x2a, 0x00, 0xc0, 0x40, 0x2d, 0x00, 0x08, 0x00, 0x37, 0x00, 0x04, 0xc0, 0x0e, 0x00, 0x22, 0x90, 0x31, 0x00, 0x01, 0x50, 0x32, 0x00, 0x71, 0x00, 0x33, 0x00, 0x70, 0x6f, 0x0e, 0x00, 0xa2, 0x11, 0x2a, 0x00, 0xc0, 0x46, 0x24, 0x00, 0x01, 0xfe, 0x00, 0x60, 0x00, 0x01, 0x2a, 0x00, 0xd0, 0x40, 0x1c, 0x00, 0x21, 0x81, 0x00, 0x60, 0x01, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x60, 0x01, 0x00, 0x3f, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x20, 0xff, 0xff, 0xff, 0xff, 0x13, 0x00, 0x9b, 0x7d, 0x13, 0x00, +0x0e, 0x60, 0x13, 0x00, 0x9e, 0x5c, 0x13, 0x00, 0x0a, 0x30, 0x13, 0x00, 0xf8, 0x2f, 0x13, 0x00, 0xc5, 0x1f, 0x13, 0x00, 0x90, 0x00, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0xcb, 0x70, 0x20, 0x00, 0xc4, 0xff, 0x22, 0x00, 0x00, 0x00, 0x23, 0x00, 0x15, 0xe0, 0x15, 0x00, 0x40, 0x00, 0x15, 0x00, 0xc0, 0x20, 0x15, 0x00, 0xc0, 0x48, 0x15, 0x00, 0xc0, 0x69, 0x15, 0x00, 0xc0, 0x90, 0x15, 0x00, 0xc0, 0xb1, 0x15, 0x00, 0xc0, 0xd8, 0x15, 0x00, 0xc0, 0xf9, 0xff, 0xff, 0xff, 0xff, 0x08, 0x08, 0x08, 0x08, 0x08, 0x0b, 0x28, 0x2b, 0x48, 0x4b, 0xc8, 0xcc, 0xe9, 0xec, 0xee, 0xff, 0xf7, 0xf7, 0xf8, 0xf9, 0x07, 0x08, 0x0a, 0x0c, 0x0e, 0x1c, 0x1e, 0x1f, 0x1f, 0x00, 0x00, 0x00, 0xf7, 0xf7, 0x00, 0x00, 0x1f, 0x1f, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x50, 0x01, 0x00, 0x00, 0x17, 0x02, 0x00, 0x00, 0xcc, 0x3f, 0x00, 0x01, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x60, 0xf4, 0x01, 0x00, 0x20, 0x01, 0x00, 0x02, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x40, 0x20, 0x00, 0x48, 0x42, 0x20, 0x00, 0x01, 0x44, 0x20, 0x00, 0x48, 0x46, 0x20, 0x00, 0x81, 0x48, 0x20, 0x00, 0x00, 0x4a, 0x20, 0x00, 0xf8, 0x4c, 0x20, 0x00, 0x00, 0x4e, 0x20, 0xd0, 0x00, 0x50, 0x20, 0x30, 0xcc, 0x52, 0x20, 0x00, 0x18, 0x54, 0x20, 0x10, 0x8c, 0x56, 0x20, 0x00, 0xe0, 0x58, 0x20, 0x00, 0x50, 0x5a, 0x20, 0x00, 0x80, 0x5c, 0x20, 0x00, 0x20, 0x5e, 0x20, 0x00, 0x00, 0x00, 0x20, 0x01, 0x00, 0x08, 0x20, 0x14, 0x14, 0x0e, 0x20, 0x01, 0x00, 0x02, 0x20, 0x60, 0xc0, 0x00, 0x60, 0x0a, 0x00, 0x02, 0x20, 0x20, 0xc0, 0x00, 0x60, 0x0a, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x20, 0x01, 0x00, 0x02, 0x20, 0x20, 0x00, 0x0c, 0x20, 0x10, 0x00, 0x0e, 0x20, 0x00, 0x80, 0x00, 0x20, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, 0x50, 0x6a, 0x6a, 0x94, 0x2a, 0x00, 0x00, 0xd3, 0x4d, 0x2f, 0x80, 0x00, 0x00 +, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfd, 0x63, 0x05, 0x62, 0x00, 0x6a, 0x42, 0xb3, 0x40, 0xdb, 0x42, 0xb4, 0x42, 0xb3, 0xa0, 0x9c, 0x40, 0xc3, 0x42, 0xb2, 0xac, 0xea, 0x42, 0xb5, 0xae, 0xea, 0x03, 0x2a, 0x40, 0xdc, 0x01, 0x6a, 0x40, 0xc3, 0x40, 0xb2, 0x40, 0x9a, 0x40, 0xb3, 0x42, 0x34, 0x82, 0x34, 0x80, 0xcb, 0x3f, 0xb3, 0x40, 0xcb, 0x3f, 0xb3, 0x3f, 0xb2, 0x80, 0x18, 0x65, 0x2d, 0x60, 0xda, 0x3e, 0xb3, 0x3f, 0xb2, 0x60, 0xda, 0x3f, 0xb3, 0x3f, 0xb2, 0x60, 0xda, 0x3f, 0xb3, 0x40, 0xb2, 0x60, 0xda, 0x40, 0xb3, 0x40, 0xb2, 0x60, 0xda, 0x40, 0xb3, 0x41, 0xb2, 0x60, 0xda, 0x41, 0xb3, 0x41, 0xb2, 0x60, 0xda, 0x41, 0xb3, 0x42, 0xb2, 0x60, 0xda, 0x42, 0xb3, 0x42, 0xb2, 0x60, 0xda, 0x42, 0xb2, 0x45, 0xf1, 0x09, 0x6b, 0x00, 0xf1, 0x70, 0xca, 0x41, 0xb3, 0x00, 0xf4, 0x00, 0x6c, 0xa0, 0xf0, 0x96, 0xca, 0x63, 0xda, 0x3f, 0xb3, 0x64, 0xda, 0x00, 0x6b, 0x65, 0xda, 0x66, 0xda, 0x67, 0xda, 0x68, 0xda, 0x69, 0xda, 0x02, 0x6b, 0x80, 0xf1, 0x62, 0xc2, 0x00, 0xf2, 0x00, 0x6b, 0xa0, 0xf0, 0x72, 0xca, 0x90, 0x6b, 0xa0, 0xf0, 0x74, 0xca, 0xa0, 0xf0, 0x78, 0xca, 0x36, 0xb3, 0x36, 0xb2, 0x60, 0xda, 0x36, 0xb3, 0x37, 0xb2, 0x60, 0xda, 0x37, 0xb3, 0x37, 0xb2, 0x60, 0xda, 0x37, 0xb3, 0x38, 0xb2, 0x60, 0xda, 0x38, 0xb3, 0x38, 0xb2, 0x60, 0xda, 0x38, 0xb3, 0x39, 0xb2, 0x60, 0xda, 0x39, 0xb3, 0x39, 0xb2, 0x60, 0xda, 0x39, 0xb3, 0x3a, 0xb2, 0x60, 0xda, 0x3a, 0xb3, 0x3a, 0xb2, 0x60, 0xda, 0x3a, +0xb3, 0x3b, 0xb2, 0x80, 0x18, 0x19, 0x34, 0x60, 0xda, 0x3a, 0xb2, 0x63, 0xa2, 0x80, 0x6a, 0x4b, 0xea, 0x6c, 0xea, 0xff, 0x6b, 0x6c, 0xea, 0x05, 0x2a, 0x37, 0xb3, 0x80, 0xa3, 0xfe, 0x4a, 0x8c, 0xea, 0x40, 0xc3, 0x05, 0x97, 0x00, 0xef, 0x03, 0x63, 0x00, 0x65, 0x4c, 0x8b, 0x10, 0x80, 0x54, 0x8b, 0x10, 0x80, 0x08, 0x94, 0x10, 0x80, 0xff, 0xff, 0xff, 0x00, 0xee, 0xff, 0xc0, 0x00, 0x94, 0xde, 0x10, 0x80, 0x52, 0x00, 0x11, 0x80, 0x50, 0x00, 0x11, 0x80, 0xcd, 0xc5, 0x10, 0x80, 0xd4, 0x07, 0x11, 0x80, 0xc9, 0xb7, 0x10, 0x80, 0x20, 0x08, 0x11, 0x80, 0x7d, 0xd6, 0x10, 0x80, 0xe0, 0x1a, 0x11, 0x80, 0x0d, 0xd0, 0x10, 0x80, 0x04, 0x07, 0x11, 0x80, 0x29, 0xb8, 0x10, 0x80, 0xd0, 0x06, 0x11, 0x80, 0x2d, 0xcf, 0x10, 0x80, 0xa0, 0x07, 0x11, 0x80, 0x95, 0xb7, 0x10, 0x80, 0xe8, 0x06, 0x11, 0x80, 0x79, 0xce, 0x10, 0x80, 0x30, 0x19, 0x11, 0x80, 0x9d, 0xcd, 0x10, 0x80, 0x80, 0x07, 0x11, 0x80, 0x58, 0x00, 0x11, 0x80, 0x14, 0xc0, 0x52, 0x02, 0x58, 0xd5, 0xc8, 0x19, 0x39, 0xaf, 0x10, 0x80, 0x6c, 0x07, 0x11, 0x80, 0xd1, 0xb8, 0x10, 0x80, 0x04, 0x1a, 0x11, 0x80, 0x85, 0xc6, 0x10, 0x80, 0xd8, 0x06, 0x11, 0x80, 0xc5, 0xb7, 0x10, 0x80, 0x44, 0x08, 0x11, 0x80, 0xe1, 0xc8, 0x10, 0x80, 0x04, 0x19, 0x11, 0x80, 0xd1, 0xb7, 0x10, 0x80, 0x08, 0x19, 0x11, 0x80, 0x85, 0xb8, 0x10, 0x80, 0xc8, 0x07, 0x11, 0x80, 0xf9, 0xc0, 0x10, 0x80, 0x0c, 0x19, 0x11, 0x80, 0x71, 0xc0, 0x10, 0x80, 0x68, 0x19, 0x11, 0x80, 0xb1, 0xcb, 0x10, 0x80, 0x64, 0x07, 0x11, 0x80, 0x6c, 0x3a, 0x11, 0x80, 0x3b, 0x02, 0x11, 0x80, 0xfd, 0x63, 0x05, 0x62, 0x04, 0xd0, 0x0c, 0xb0, 0x90, 0x67, 0x00, 0x6d, 0x00, 0x18, 0x5a, 0x33, 0x38, 0x6e, 0x01, 0x6a, 0x4b, 0xea, 0x47, 0xd8, 0x70, 0x6a, 0x43, 0xc0, 0x0a, 0x6a, 0x4c, 0xc0, 0x08, 0x6a, 0x4d, 0xc0, 0x00, 0x6b, 0x05, 0xb2, 0x60, 0xc2, 0x05, 0x97, 0x04, 0x90, 0x00, 0xef, 0x03, 0x63, 0x00, 0x65, 0x28, 0x94, 0x11, 0x80, 0x60, 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x06, 0xb2, 0x00, 0x6b, 0x60, 0xda, 0x61, 0xda, 0x05, 0x97, 0x00, 0xef, 0x03, 0x63, 0xc0, 0x50, 0x11, 0x80, 0x49, 0x50, 0x11, 0x80, 0xf0, 0x51, 0x11, 0x80, 0xdc, 0x63, 0x47, 0x62, 0x00, 0xf4, 0x06, 0x6a, 0x7d, 0x67, 0x4a, 0xcb, 0x03, 0x6a, 0x56, 0xc3, 0x13, 0x6a, 0x59, 0xc3, 0x1d, 0xb2, 0x6d, 0xa2, 0x08, 0x73, 0x1a, 0x60, 0xff, 0x6c, 0x09, 0x4c, 0x98, 0xeb, 0x1b, 0xb2, 0x01, 0x6d, 0x12, 0xec, 0x91, 0xe2, 0x20, 0xf1, 0xcf, 0xa4, 0xac, 0xee, 0x0f, 0x26, 0x00, 0xf1, 0x52, 0xaa, 0x47, 0xeb, 0xac, 0xea, 0x0a, 0x22, 0x20, 0xf1, 0x4c, 0xac, 0x7d, 0x67, 0x05, 0x04, 0x57, 0xc3, 0x42, 0x32, 0x58, 0xc3, 0x00, 0x18, 0x18, 0x4f, 0x04, 0x05, 0x0e, 0xb2, 0x4c, 0xa2, 0x0a, 0x72, 0x14, 0x60, 0xc0, 0xf2, 0x0c, 0x6b, 0x78, 0xea, 0x0d, 0xb3, 0x12, 0xea, 0x49, 0xe3, 0xe0, 0xf0, 0x66, 0xa2, 0x01, 0x73, 0x0a, 0x61, 0x60, 0xf2, 0x56, 0xaa, 0x7d, 0x67, 0x05, 0x04, 0x57, 0xc3, 0x42, 0x32, 0x58, 0xc3, 0x00, 0x18, 0x18, 0x4f, 0x04, 0x05, 0x47, 0x97, 0x00, 0xef +, 0x24, 0x63, 0x00, 0x65, 0x28, 0x94, 0x11, 0x80, 0x40, 0x3b, 0x11, 0x80, 0xb4, 0x54, 0x11, 0x80, 0xdc, 0x63, 0x47, 0x62, 0x46, 0xd0, 0x00, 0x6a, 0x18, 0xb3, 0x9d, 0x67, 0x40, 0xdb, 0x41, 0xdb, 0x04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5, 0x02, 0x6b, 0x20, 0xf0, 0x61, 0xc5, 0x20, 0xf0, 0x63, 0xc5, 0x1e, 0x6b, 0x20, 0xf0, 0x66, 0xc5, 0x12, 0x6b, 0x20, 0xf0, 0x68, 0xc5, 0x20, 0xf0, 0x6a, 0xc5, 0x20, 0xf0, 0x4b, 0xc5, 0x00, 0x18, 0x8a, 0xc5, 0x04, 0x04, 0x47, 0x97, 0x00, 0xef, 0x24, 0x63, 0xf0, 0x51, 0x11, 0x80, 0x28, 0x94, 0x11, 0x80, 0xdc, 0x63, 0x47, 0x62, 0x0c, 0xb2, 0x00, 0x6b, 0x60, 0xda, 0x61, 0xda, 0x7d, 0x67, 0x04, 0xf0, 0x1d, 0x6a, 0x48, 0xcb, 0x01, 0x6a, 0x52, 0xc3, 0x08, 0xb2, 0x41, 0xaa, 0x7f, 0x6b, 0x04, 0x04, 0x4a, 0x32, 0x6c, 0xea, 0x7d, 0x67, 0x00, 0x18, 0xeb, 0xc2, 0x53, 0xc3, 0x47, 0x97, 0x00, 0xef, 0x24, 0x63, 0x00, 0x65, 0xf0, 0x51, 0x11, 0x80, 0x28, 0x94, 0x11, 0x80, 0xdb, 0x63, 0x49, 0x62, 0x48, 0xd1, 0x47, 0xd0, 0x00, 0x69, 0x0e, +0xb2, 0x7d, 0x67, 0x20, 0xda, 0x21, 0xda, 0x04, 0xf0, 0x1f, 0x6a, 0x48, 0xcb, 0x0b, 0xb2, 0x81, 0xf1, 0x48, 0xaa, 0x0b, 0xb0, 0x32, 0xc3, 0x04, 0x04, 0x00, 0x18, 0x65, 0xc2, 0x4b, 0xd8, 0x64, 0xa0, 0x41, 0x6a, 0x4b, 0xea, 0x6c, 0xea, 0x29, 0xc0, 0x44, 0xc0, 0x49, 0x97, 0x48, 0x91, 0x47, 0x90, 0x00, 0xef, 0x25, 0x63, 0xf0, 0x51, 0x11, 0x80, 0x40, 0x3b, 0x11, 0x80, 0x28, 0x94, 0x11, 0x80, 0xdc, 0x63, 0x47, 0x62, 0x46, 0xd0, 0x00, 0x68, 0x0b, 0xb2, 0x7d, 0x67, 0x00, 0xda, 0x01, 0xda, 0x04, 0xf0, 0x1f, 0x6a, 0x12, 0xc3, 0x04, 0x04, 0x00, 0x18, 0x65, 0xc2, 0x48, 0xcb, 0x07, 0xb2, 0x84, 0xa2, 0x41, 0x6b, 0x6b, 0xeb, 0x8c, 0xeb, 0x64, 0xc2, 0x09, 0xc2, 0x47, 0x97, 0x46, 0x90, 0x00, 0xef, 0x24, 0x63, 0xf0, 0x51, 0x11, 0x80, 0x28, 0x94, 0x11, 0x80, 0xdc, 0x63, 0x47, 0x62, 0x1c, 0xb2, 0x00, 0x6b, 0x60, 0xda, 0x61, 0xda, 0x1b, 0xb2, 0x64, 0xa2, 0x07, 0x6d, 0x6e, 0x34, 0xac, 0xec, 0x05, 0x54, 0x06, 0x61, 0x39, 0x6c, 0x8b, 0xec, 0x6c, 0xec, 0x20, 0x6b, 0x6d, 0xec, 0x84, 0xc2, 0x15, 0xb2, 0x64, 0xa2, 0x07, 0x6c, 0x14, 0xb5, 0x6e, 0x33, 0x8c, 0xeb, 0x6d, 0xe5, 0x60, 0xa3, 0xc3, 0xa2, 0x6c, 0xec, 0x0f, 0x6b, 0x6b, 0xeb, 0x84, 0x35, 0xcc, 0xeb, 0xad, 0xeb, 0x63, 0xc2, 0xbd, 0x67, 0x04, 0xf0, 0x1e, 0x6b, 0x68, 0xcd, 0x03, 0x6b, 0x72, 0xc5, 0x61, 0xaa, 0x7f, 0x6d, 0x6a, 0x33, 0xac, 0xeb, 0xbd, 0x67, 0x73, 0xc5, 0x40, 0x9a, 0x95, 0xc5, 0x04, 0x04, 0x42, 0x32, 0x00, 0x18, 0xa1, 0xc2, 0x54, 0xc5, 0x47, 0x97, 0x00, 0xef, 0x24, 0x63, 0x00, 0x65, 0xf0, 0x51, 0x11, 0x80, 0x28, 0x94, 0x11, 0x80, 0x80, 0xdc, 0x10, 0x80, 0xfd, 0x63, 0x05, 0x62, 0x57, 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0xf6, 0x00, 0x6b, 0xc2, 0x67, 0x57, 0x6c, 0x01, 0x6d, 0x00, 0x18, 0xa4, 0xa4, 0x6d, 0xee, 0x07, 0x97, 0x06, 0x91, 0x05, 0x90, 0x00, 0xef, 0x04, 0x63, 0x28, 0x94, 0x11, 0x80, 0xfb, 0x63, 0x09, 0x62, 0x08, 0xd1, 0x07, 0xd0, 0x11, 0xb2, 0x47, 0x9a, 0xff, 0x68, 0x8c, 0xe8, 0x01, 0x4a, 0x04, 0x22, 0x0f, 0xb4, 0x00, 0x18, 0xb6, 0x1c, 0x00, 0x65, 0x11, 0x20, 0x00, 0x69, 0x0b, 0xb0, 0x01, 0x6c, 0x0b, 0xb5, 0x0c, 0xb6, 0xf1, 0x67, 0x00, 0x18, 0xc4, 0x1c, 0x04, 0xd1, 0x87, 0x98, 0x00, 0x18, 0xa9, 0x1c, 0x14, 0x6d, 0x00, 0x6a, 0x30, 0xc8, 0x20, 0xf0, 0x49, 0xc0, 0x09, 0x97, 0x08, 0x91, 0x07, 0x90, 0x00, 0xef, 0x05, 0x63, 0x00, 0x65, 0x28, 0x94, 0x11, 0x80, 0x44, 0x94, 0x11, 0x80, 0xd9, 0xa8, 0x10, 0x80, 0xfd, 0x63, 0x05, 0x62, 0x04, 0xd0, 0x57, 0x6c, 0x00, 0x18, 0x46, 0xa4, 0x01, 0x6d, 0xff, 0xf7, 0x1f, 0x68, 0xff, 0x6b, 0x0c, 0xea, 0x02, 0x4b, 0x6b, 0xeb, 0xc2, 0x67, 0x6c, 0xee, 0x57, 0x6c, 0x00, 0x18, 0xa4, 0xa4, 0x01, 0x6d, 0x59, 0x6c, 0x00, 0x18, 0x46, 0xa4, 0x01, 0x6d, 0x0c, 0xea, 0x00, 0xf2, 0x01, 0x6b, 0x6b, 0xeb, 0xc2, 0x67, 0x6c, 0xee, 0x59, 0x6c, 0x00, 0x18, 0xa4, 0xa4, 0x01, 0x6d, 0x00, 0x6c, 0x0c, 0xb0, 0xa4, 0x67, 0x00, 0x18, 0xa4, 0xa4, 0xc4, 0x67, 0xd1, 0xa8, 0x01, 0x6d, 0x00, 0x18, 0xa4, 0xa4, 0x42, 0x6c, 0x80, 0x18, 0x02, 0x2a, 0x00, 0x6c, 0x64, 0xa0, 0x41, 0x6a, 0x4b, 0xea, 0x6c, 0xea, 0x44, 0xc0, 0x00, 0x6a, 0x49, 0xc0, 0x05, 0x97, 0x04, 0x90, 0x00, 0xef, 0x03, 0x63, 0x28, 0x94, +0x11, 0x80, 0xfc, 0x63, 0x07, 0x62, 0x06, 0xd1, 0x05, 0xd0, 0x20, 0xb2, 0x47, 0x9a, 0x08, 0xd4, 0x8e, 0xea, 0x05, 0x22, 0x01, 0x4c, 0x03, 0x24, 0x00, 0x18, 0xb6, 0x1c, 0x08, 0x04, 0x1b, 0xb0, 0x64, 0xa0, 0x40, 0x6a, 0x6c, 0xea, 0x08, 0x2a, 0x47, 0x98, 0x01, 0x4a, 0x29, 0x22, 0x18, 0xb4, 0x00, 0x18, 0xb6, 0x1c, 0x00, 0x65, 0x24, 0x10, 0x02, 0x69, 0x6c, 0xe9, 0xff, 0x6a, 0x4c, 0xe9, 0x07, 0x21, 0x80, 0x18, 0xdd, 0x29, 0x00, 0x65, 0x50, 0xa8, 0x01, 0x4a, 0x50, 0xc8, 0x18, 0x10, 0x7d, 0x6c, 0x00, 0x18, 0x46, 0xa4, 0x01, 0x6d, 0x04, 0x6b, 0x4c, 0xeb, 0x06, 0x23, 0x50, 0xa8, 0x20, 0xf0, 0x29, 0xc0, 0x01, 0x4a, 0x50, 0xc8, 0x0b, 0x10, 0x20, 0xf0, 0x49, 0xa0, 0x19, 0x5a, 0x04, 0x60, 0x01, 0x4a, 0x20, 0xf0, 0x49, 0xc0, 0x03, 0x10, 0x80, 0x18, 0x18, 0x2a, 0x00, 0x65, 0x07, 0x97, 0x06, 0x91, 0x05, 0x90, 0x00, 0xef, 0x04, 0x63, 0x28, 0x94, 0x11, 0x80, 0x44, 0x94, 0x11, 0x80, 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x90, 0x00, 0xef, 0x04, 0x63, 0x28, 0x94 +, 0x11, 0x80, 0x00, 0x00, 0x00, 0x80, 0xfd, 0x63, 0x05, 0x62, 0x04, 0xd0, 0x00, 0x6c, 0xc4, 0x67, 0x00, 0x18, 0xa4, 0xa4, 0xa4, 0x67, 0x57, 0x6c, 0x00, 0x18, 0x46, 0xa4, 0x01, 0x6d, 0xff, 0x6e, 0xff, 0xf7, 0x1f, 0x6b, 0x04, 0x4e, 0x4c, 0xeb, 0xcb, 0xee, 0x6c, 0xee, 0x01, 0x6d, 0x0b, 0xb0, 0x00, 0x18, 0xa4, 0xa4, 0x57, 0x6c, 0x64, 0xa0, 0x41, 0x6a, 0x4b, 0xea, 0x6c, 0xea, 0x00, 0x6c, 0x80, 0x18, 0x02, 0x2a, 0x44, 0xc0, 0x80, 0x18, 0xdd, 0x29, 0x00, 0x65, 0x00, 0x6a, 0x49, 0xc0, 0x05, 0x97, 0x04, 0x90, 0x00, 0xef, 0x03, 0x63, 0x00, 0x65, 0x28, 0x94, 0x11, 0x80, 0xfb, 0x63, 0x09, 0x62, 0x08, 0xd0, 0x38, 0xb0, 0x90, 0xa0, 0x4f, 0xa0, 0x04, 0x05, 0x80, 0x34, 0x4d, 0xec, 0x4e, 0xa0, 0x80, 0x34, 0x00, 0x18, 0xb1, 0xb9, 0x4d, 0xec, 0x7d, 0x67, 0x48, 0xab, 0x8f, 0xa0, 0xdd, 0x67, 0x4c, 0xcb, 0x49, 0xab, 0xaa, 0xae, 0x4d, 0xcb, 0x4e, 0xa0, 0x80, 0x33, 0x68, 0x33, 0x48, 0x32, 0x6d, 0xea, 0x03, 0x6b, 0xac, 0xeb, 0x6d, 0xea, 0x70, 0xa0, 0x4e, 0xce, 0x9a, 0x34, 0x68, 0x32, 0x7e, 0x33, 0x8d, 0xea, 0x05, 0x23, 0x09, 0xf4, 0x00, 0x6b, 0x4d, 0xeb, 0x6f, 0xce, 0x06, 0x10, 0x0a, 0xf0, 0x00, 0x6b, 0x6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 0xa4, 0x00, 0x6d, 0x57, 0x6c, 0x00, 0x18, 0x46, 0xa4, 0x01, 0x6d, 0x2c, 0xea, 0x01, 0x6d, 0xc2, 0x67, 0xad, 0xee, 0x00, 0x18, 0xa4, 0xa4, 0x57, 0x6c, 0x57, 0x6c, 0x00, 0x18, 0x46, 0xa4, 0x01, 0x6d, 0x2c, 0xea, 0x02, 0x6b, 0x6b, 0xeb, 0xc2, 0x67, 0x01, 0x6d, 0x6c, 0xee, 0x00, 0x18, 0xa4, 0xa4, 0x57, 0x6c, 0x80, 0x18, 0x02, 0x2a, 0x01, 0x6c, 0x09, 0x97, 0x08, 0x91, 0x07, 0x90, 0x00, 0xef, 0x05, 0x63, 0x00, 0x65, 0x28, 0x94, 0x11, 0x80, 0x58, 0x00, 0x11, 0x80, 0xfb, 0x63, 0x09, 0x62, 0x08, 0xd1, 0x07, 0xd0, 0x80, 0x18, 0xdc, 0x2a, +0x00, 0x65, 0x57, 0x6c, 0x00, 0x18, 0x46, 0xa4, 0x01, 0x6d, 0xff, 0xf7, 0x1f, 0x68, 0x0c, 0xea, 0x02, 0xf0, 0x00, 0x69, 0xc2, 0x67, 0x2d, 0xee, 0x57, 0x6c, 0x00, 0x18, 0xa4, 0xa4, 0x01, 0x6d, 0x59, 0x6c, 0x00, 0x18, 0x46, 0xa4, 0x01, 0x6d, 0x0c, 0xea, 0x00, 0xf2, 0x01, 0x6b, 0x6b, 0xeb, 0xc2, 0x67, 0x6c, 0xee, 0x59, 0x6c, 0x00, 0x18, 0xa4, 0xa4, 0x01, 0x6d, 0x00, 0x6c, 0xd1, 0x67, 0x23, 0xb1, 0x00, 0x18, 0xa4, 0xa4, 0xa4, 0x67, 0x63, 0xa1, 0x07, 0x6a, 0x02, 0x6c, 0x72, 0x33, 0x4c, 0xeb, 0x05, 0x4b, 0x00, 0x6d, 0x00, 0x18, 0x46, 0xa4, 0x04, 0xd3, 0x04, 0x93, 0x1f, 0xf7, 0x01, 0x6c, 0x0c, 0xea, 0x8b, 0xec, 0x8c, 0xea, 0x1a, 0xb4, 0x6d, 0xe4, 0x20, 0xf1, 0xda, 0xa3, 0x02, 0x6c, 0x00, 0x6d, 0xc0, 0x36, 0x00, 0x18, 0xa4, 0xa4, 0x4d, 0xee, 0xc1, 0xa9, 0x7f, 0x6a, 0x3c, 0x6c, 0xca, 0x36, 0x4c, 0xee, 0x00, 0xf6, 0xc0, 0x36, 0x00, 0x18, 0xa4, 0xa4, 0x00, 0x6d, 0x57, 0x6c, 0x00, 0x18, 0x46, 0xa4, 0x01, 0x6d, 0x0c, 0xea, 0x01, 0x6d, 0xc2, 0x67, 0xad, 0xee, 0x00, 0x18, 0xa4, 0xa4, 0x57, 0x6c, 0x57, 0x6c, 0x00, 0x18, 0x46, 0xa4, 0x01, 0x6d, 0x0c, 0xea, 0x02, 0x6b, 0x6b, 0xeb, 0xc2, 0x67, 0x57, 0x6c, 0x01, 0x6d, 0x00, 0x18, 0xa4, 0xa4, 0x6c, 0xee, 0x09, 0x97, 0x08, 0x91, 0x07, 0x90, 0x00, 0xef, 0x05, 0x63, 0x00, 0x65, 0x28, 0x94, 0x11, 0x80, 0x58, 0x00, 0x11, 0x80, 0xfd, 0x63, 0x05, 0x62, 0x80, 0x18, 0xdc, 0x2a, 0x00, 0x65, 0x00, 0x6b, 0x0c, 0xb2, 0x6d, 0xda, 0x6b, 0xda, 0x59, 0x6c, 0x00, 0x18, 0x46, 0xa4, 0x01, 0x6d, 0xff, 0xf7, 0x1f, 0x6b, 0x00, 0xf2, 0x01, 0x6e, 0x4c, 0xeb, 0xcb, 0xee, 0x59, 0x6c, 0x01, 0x6d, 0x00, 0x18, 0xa4, 0xa4, 0x6c, 0xee, 0x80, 0x18, 0x5a, 0x2a, 0x00, 0x65, 0x05, 0x97, 0x00, 0xef, 0x03, 0x63, 0x28, 0x94, 0x11, 0x80, 0xfa, 0x63, 0x0b, 0x62, 0x0a, 0xd1, 0x09, 0xd0, 0x42, 0xa4, 0xff, 0x6b, 0x04, 0x67, 0xff, 0x4a, 0x6c, 0xea, 0x22, 0x5a, 0x23, 0xa4, 0x2a, 0x60, 0x04, 0x0b, 0x44, 0x32, 0x49, 0xe3, 0x40, 0x8a, 0x4d, 0xe3, 0x00, 0xeb, 0x00, 0x65, 0x00, 0x65, 0x49, 0x00, 0x9d, 0x00, 0x29, 0x02, 0xb7, 0x02, 0xf1, 0x02, 0x65, 0x03, 0x8d, 0x03, 0x9f, 0x03, 0xad, 0x03, 0xc3, 0x03, 0xd1, 0x03, 0x45, 0x00 +, 0x45, 0x00, 0xdf, 0x03, 0xd7, 0x04, 0xef, 0x04, 0x45, 0x00, 0x07, 0x05, 0x15, 0x05, 0x23, 0x05, 0x53, 0x05, 0x61, 0x05, 0x73, 0x05, 0x81, 0x05, 0x93, 0x05, 0x97, 0x05, 0x9b, 0x05, 0xa7, 0x05, 0xb9, 0x05, 0x45, 0x00, 0x45, 0x00, 0x45, 0x00, 0x45, 0x00, 0xd1, 0x05, 0x00, 0x6a, 0xde, 0x12, 0x57, 0x6c, 0x00, 0x18, 0x46, 0xa4, 0x01, 0x6d, 0xff, 0xf7, 0x1f, 0x6b, 0x02, 0xf1, 0x03, 0x6e, 0x4c, 0xeb, 0xcb, 0xee, 0x6c, 0xee, 0x57, 0x6c, 0x00, 0x18, 0xa4, 0xa4, 0x01, 0x6d, 0x00, 0x6c, 0xa4, 0x67, 0x00, 0x18, 0xa4, 0xa4, 0xc4, 0x67, 0x80, 0x18, 0x02, 0x2a, 0x00, 0x6c, 0x00, 0x18, 0x78, 0x58, 0x00, 0x65, 0x00, 0x6d, 0x01, 0xf4, 0x03, 0x6c, 0x00, 0x18, 0xbb, 0x53, 0xc5, 0x67, 0x80, 0xf5, 0x08, 0xb2, 0x0a, 0x6b, 0x6c, 0xc2, 0x08, 0x6b, 0x6d, 0xc2, 0x00, 0x6b, 0x69, 0xc2, 0x6a, 0xc2, 0xa3, 0x12, 0x0b, 0x59, 0x80, 0xf2, 0x1c, 0x60, 0x60, 0xf5, 0x10, 0xb2, 0x06, 0x21, 0x64, 0xa2, 0x40, 0x6a, 0x6c, 0xea, 0x80, 0xf2, 0x14, 0x2a, 0x06, 0x10, 0x84, 0xa2, 0x40, 0x6b, 0x8c, 0xeb, 0x02, 0x2b, 0x29, 0xc2, 0x91, 0x12, 0x40, 0xf5, 0x10, 0xb2, 0x69, 0xa2, 0x0b, 0x59, 0x29, 0xc2, 0x04, 0xd3, 0xa0, 0xf0, 0x01, 0x60, 0x04, 0x0a, 0x24, 0x31, 0x25, 0xe2, 0x60, 0x89, 0x69, 0xe2, 0x00, 0xea, 0x00, 0x65, 0x00, 0x65, 0x17, 0x00, 0x9f, 0x00, 0xb5, 0x00, 0xe9, 0x00, 0x09, 0x01, 0x0d, 0x01, 0x17, 0x01, 0x33, 0x01, 0x1b, 0x01, 0x23, 0x01, 0x2b, 0x01, 0x00, 0xf5, 0x1c, 0xb2, 0x44, 0xa2, 0x01, 0x6b, 0x4c, 0xeb, 0x12, 0x23, 0x02, 0x6b, 0x4c, 0xeb, 0x04, 0x23, 0x80, 0x18, 0x8c, 0x2a, 0x00, 0x65, 0x18, 0x10, 0x04, 0x92, 0x02, 0x72, 0x04, 0x61, 0x80, 0x18, 0x18, 0x2a, 0x00, 0x65, 0x11, 0x10, 0x80, 0x18, 0xcb, 0x29, 0x00, 0x65, 0x0d, 0x10, 0x04, 0x6b, 0x4c, 0xeb, 0x0a, 0x23, 0x02, 0x6b, 0x4c, 0xeb, 0x04, 0x23, 0x80, 0x18, 0x89, 0x29, 0x00, 0x65, 0x03, 0x10, 0x80, 0x18, 0x9c, 0x29, 0x00, 0x65, 0xc0, 0xf4, 0x10, 0xb1, 0x6b, 0x99, 0xec, 0x99, 0x4d, 0x99, 0x07, 0xd3, 0x06, 0xd7, 0x00, 0x18, 0x78, 0x58, 0x05, 0xd2, 0x00, 0x6d, 0x01, 0xf4, 0x03, 0x6c, 0x00, 0x18, 0xbb, 0x53, 0xc5, 0x67, 0x0a, 0x6a, 0x4c, 0xc1, 0x08, 0x6a, 0x4d, 0xc1, 0x04, 0x92, 0x07, +0x93, 0x06, 0x97, 0x02, 0x5a, 0x20, 0xf2, 0x17, 0x60, 0x6b, 0xd9, 0x05, 0x93, 0xec, 0xd9, 0x6d, 0xd9, 0x32, 0x12, 0x80, 0xf4, 0x14, 0xb1, 0x64, 0xa1, 0x02, 0x6a, 0x6d, 0xea, 0x01, 0x6b, 0x6d, 0xea, 0x80, 0x18, 0xbe, 0x2b, 0x44, 0xc1, 0x25, 0x10, 0x60, 0xf4, 0x1c, 0xb3, 0x84, 0xa3, 0x03, 0x6a, 0x4b, 0xea, 0x8c, 0xea, 0x04, 0x6c, 0x4c, 0xec, 0x07, 0x24, 0x02, 0x6c, 0x8b, 0xec, 0x4c, 0xec, 0x80, 0x18, 0xab, 0x29, 0x84, 0xc3, 0x05, 0x10, 0x01, 0x6c, 0x4d, 0xec, 0x80, 0x18, 0x3e, 0x2b, 0x84, 0xc3, 0x40, 0xf4, 0x14, 0xb3, 0x84, 0xa3, 0x40, 0x6a, 0xdf, 0x10, 0x40, 0xf4, 0x08, 0xb1, 0x64, 0xa1, 0x03, 0x6a, 0x4b, 0xea, 0x6c, 0xea, 0x01, 0x6b, 0x6d, 0xea, 0x80, 0x18, 0x86, 0x2b, 0x44, 0xc1, 0x64, 0xa1, 0x40, 0x6a, 0x6d, 0xea, 0x44, 0xc1, 0xfd, 0x11, 0x01, 0x6c, 0x01, 0x10, 0x02, 0x6c, 0x80, 0x18, 0x02, 0x29, 0x00, 0x65, 0xf6, 0x11, 0x03, 0x6c, 0xfa, 0x17, 0x80, 0x18, 0x56, 0x29, 0x00, 0x65, 0xf0, 0x11, 0x80, 0x18, 0x3b, 0x29, 0x00, 0x65, 0xec, 0x11, 0x80, 0x18, 0x16, 0x29, 0x00, 0x65, 0xe8, 0x11, 0x80, 0x18, 0x85, 0x28, 0x00, 0x65, 0xe0, 0xf1, 0x03, 0x22, 0x12, 0x72, 0xc0, 0xf1, 0x1c, 0x60, 0x00, 0x6c, 0x04, 0x6b, 0xdb, 0x11, 0x04, 0x59, 0xc0, 0xf1, 0x16, 0x60, 0x80, 0x18, 0x02, 0x2a, 0x00, 0x6c, 0x57, 0x6c, 0x00, 0x18, 0x46, 0xa4, 0x01, 0x6d, 0xff, 0xf7, 0x1f, 0x6b, 0x02, 0xf1, 0x03, 0x6e, 0x4c, 0xeb, 0xcb, 0xee, 0x6c, 0xee, 0x57, 0x6c, 0x00, 0x18, 0xa4, 0xa4, 0x01, 0x6d, 0x00, 0x6c, 0xa4, 0x67, 0x00, 0x18, 0xa4, 0xa4, 0xc4, 0x67, 0x00, 0x18, 0x78, 0x58, 0x00, 0x65, 0x00, 0x6d, 0x01, 0xf4, 0x03, 0x6c, 0x00, 0x18, 0xbb, 0x53, 0xc5, 0x67, 0xe9, 0xb3, 0x0a, 0x6a, 0x4c, 0xc3, 0x08, 0x6a, 0x2a, 0xc3, 0x4d, 0xc3, 0x00, 0x1c, 0x5e, 0x1b, 0x07, 0xd3, 0x07, 0x93, 0xa2, 0x67, 0x05, 0x6a, 0x84, 0xa3, 0x4b, 0xea, 0x01, 0x71, 0x8c, 0xea, 0x44, 0xc3, 0x09, 0x61, 0x03, 0x6c, 0x80, 0x18, 0x02, 0x29, 0x06, 0xd5, 0x00, 0x18, 0x11, 0x56, 0x00, 0x6c, 0x06, 0x95, 0x05, 0x10, 0x02, 0x71, 0x03, 0x61, 0x04, 0x6c, 0x4d, 0xec, 0x84, 0xc3, 0x00, 0x1c, 0x65, 0x1b, 0x85, 0x67, 0x96, 0x11, 0x4f, 0x59, 0x80, 0xf1, 0x0f, 0x60, 0x44, 0xa4, 0x08 +, 0x5a, 0x80, 0xf1, 0x0b, 0x60, 0xd3, 0xb3, 0x7f, 0x6a, 0xa1, 0xab, 0x2c, 0xea, 0x48, 0x34, 0xe0, 0xf1, 0x1d, 0x6a, 0x4b, 0xea, 0xac, 0xea, 0x8d, 0xea, 0x41, 0xcb, 0x84, 0xa0, 0x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8d, 0xea, 0x6d, 0xea, 0x03, 0x6c, 0x00, 0x6b, 0x0c, 0x10, 0x01, 0x6a, 0x2c, 0xea, 0x17, 0xb3, 0x40, 0xc3, 0x04, 0x10, 0x00, 0x6c, 0x03, 0x6b, 0x44, 0x67, 0x03, 0x10, 0x00, 0x6c, 0x64, 0x67, 0x44, 0x67, 0x90, 0x34, 0x6d, 0xec, 0x83, 0xc0, 0x81, 0xa0, 0x10, 0x6b, 0x6b, 0xeb, 0x8c, 0xeb, 0x61, 0xc0, 0xa0, 0x98, 0x02, 0x6c, 0x00, 0x18, 0xca, 0x2e, 0xc2, 0x67, 0x01, 0x6a, 0x0b, 0x97, 0x0a, 0x91, 0x09, 0x90, 0x00, 0xef, 0x06, 0x63, 0x00, 0x65, 0x28, 0x94, 0x11, 0x80, 0x1f, 0x00, 0xfc, 0xff, 0x6c, 0xdc, 0x10, 0x80, 0x60, 0xdc, 0x10, 0x80, 0xb4, 0x54, 0x11, 0x80, 0x40, 0x3b, 0x11, 0x80, 0x58, 0x00, 0x11, 0x80, 0x00, 0x00, 0xff, 0xff, 0x60, 0x94, 0x11, 0x80, 0x00, 0x6a, 0x6f, 0xb5, 0x55, 0xe5, 0xa0, 0xa5, 0x6e, 0xb3, 0x51, 0xe3, 0x20, 0xf1, 0xba, 0xc4, 0x01, 0x4a, 0xff, 0x6c, 0x8c, 0xea, 0x10, 0x5a, 0xf4, 0x61, 0x60, 0xf1, 0xa1, 0xa3, 0xfe, 0x75, 0x0b, 0x60, 0x0f, 0x6a, 0xac, 0xea, 0xaf, 0x42, 0x8c, 0xed, 0x05, 0x5d, 0x05, 0x60, 0x10, 0x6c, 0x4d, 0xec, 0x60, 0xf1, 0x81, 0xc3, 0x03, 0x10, 0x15, 0x6a, 0x60, 0xf1, 0x41, 0xc3, 0x61, 0xb2, 0x0b, 0x6b, 0x40, 0xf1, 0x7b, 0xc2, 0x40, 0xf1, 0x7c, 0xc2, 0x40, 0xf1, 0x7d, 0xc2, 0x40, 0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, 0x80, 0xa4, 0xdd, 0x10, 0x80, 0xbc, 0xdd, 0x10, 0x80, 0xb4, 0xdd, 0x10, 0x80, 0xb8, 0xdd, 0x10, 0x80, 0xcc, 0xdd, 0x10, 0x80, 0xd0 +, 0xdd, 0x10, 0x80, 0xff, 0x6b, 0x6c, 0xee, 0x6c, 0xec, 0x6c, 0xed, 0xec, 0xeb, 0x77, 0xe5, 0xb8, 0xed, 0xd3, 0xe4, 0xff, 0xf7, 0x1f, 0x6f, 0x12, 0xed, 0x98, 0xec, 0x12, 0xec, 0x89, 0xe5, 0x20, 0xe8, 0xec, 0xea, 0x20, 0xe8, 0x00, 0x65, 0x0b, 0xb2, 0x20, 0xf0, 0x70, 0xa2, 0x16, 0x6a, 0x6c, 0xea, 0x12, 0x72, 0x04, 0x61, 0x40, 0xa4, 0x01, 0x5a, 0x58, 0x67, 0x40, 0xc4, 0x06, 0xb2, 0xc0, 0xf1, 0x7f, 0xa2, 0x07, 0x6a, 0x6c, 0xea, 0x04, 0x52, 0x58, 0x67, 0x01, 0x6b, 0x20, 0xe8, 0x6e, 0xea, 0x00, 0x65, 0x58, 0x00, 0x11, 0x80, 0x20, 0xe8, 0x00, 0x6a, 0x20, 0xe8, 0x00, 0x6a, 0x20, 0xe8, 0x00, 0x65, 0x64, 0xa4, 0x43, 0xa4, 0xc0, 0xa5, 0x60, 0x33, 0x4d, 0xe3, 0xff, 0xf7, 0x1f, 0x6a, 0x4c, 0xeb, 0x7f, 0xf4, 0x0f, 0x73, 0x00, 0x6a, 0x09, 0x61, 0xc9, 0xe4, 0x02, 0x6b, 0x62, 0xc2, 0x41, 0x46, 0xff, 0x6b, 0x6c, 0xea, 0x41, 0xc4, 0x40, 0xc5, 0x01, 0x6a, 0x20, 0xe8, 0x00, 0x65, 0x00, 0x65, 0x07, 0xb2, 0x40, 0x9a, 0x61, 0x42, 0x07, 0x23, 0x24, 0x6b, 0x78, 0xea, 0x05, 0xb3, 0x12, 0xea, 0x49, 0xe3, 0x05, 0xb3, 0x63, 0xda, 0x20, 0xe8, 0x00, 0x65, 0x00, 0x65, 0x90, 0x04, 0x11, 0x80, 0x4c, 0x8a, 0x11, 0x80, 0x21, 0xd1, 0x10, 0x80, 0x08, 0xb2, 0x60, 0xa2, 0x1e, 0x6a, 0x80, 0x9c, 0x6c, 0xea, 0x06, 0x6b, 0x4e, 0xeb, 0x05, 0x2b, 0x47, 0x6a, 0x8c, 0xea, 0x02, 0x22, 0x04, 0xb2, 0x60, 0xc2, 0x20, 0xe8, 0x00, 0x6a, 0x00, 0x65, 0xe0, 0x1e, 0x11, 0x80, 0xc2, 0x06, 0x11, 0x80, 0x62, 0xa4, 0x80, 0x6a, 0x4b, 0xea, 0x6c, 0xea, 0xff, 0x6d, 0xac, 0xea, 0x0b, 0x22, 0x09, 0xb2, 0xa1, 0xa2, 0x0c, 0x6a, 0xac, 0xea, 0x0c, 0x72, 0x09, 0x60, 0x7f, 0x6a, 0x6c, 0xea, 0x21, 0x6b, 0x6b, 0xeb, 0x02, 0x10, 0x21, 0x6a, 0x4b, 0xea, 0x6c, 0xea, 0x42, 0xc4, 0x20, 0xe8, 0x00, 0x6a, 0xe0, 0x1e, 0x11, 0x80, 0x0f, 0xb2, 0x10, 0xb3, 0x10, 0xb5, 0x40, 0x9a, 0x10, 0xb2, 0x03, 0x6e, 0x40, 0x9a, 0x60, 0x9b, 0xa0, 0x9d, 0x80, 0xf5, 0xa2, 0x35, 0xcc, 0xed, 0x0e, 0x25, 0x03, 0x75, 0x0c, 0x60, 0x62, 0x33, 0x42, 0x32, 0x62, 0x33, 0x42, 0x32, 0xa6, 0x43, 0x42, 0xed, 0x04, 0x61, 0xfa, 0x4b, 0x62, 0xea, 0x01, 0x6d, 0x01, 0x60, 0x02, 0x6d, 0x20, 0xe8, 0xa0, 0xc4, 0x00, 0x65, +0xa0, 0xa0, 0x00, 0xb0, 0x54, 0xa0, 0x00, 0xb0, 0x5c, 0xa0, 0x00, 0xb0, 0xa4, 0xa0, 0x00, 0xb0, 0x0b, 0xb2, 0x60, 0xf1, 0x50, 0xa2, 0xff, 0x6b, 0xfd, 0x4a, 0x6c, 0xea, 0x02, 0x5a, 0x0b, 0x60, 0x08, 0xb2, 0x40, 0xa2, 0x08, 0x2a, 0x63, 0xa4, 0x02, 0x6a, 0x6c, 0xea, 0x04, 0x22, 0x03, 0x6a, 0x4b, 0xea, 0x6c, 0xea, 0x43, 0xc4, 0x20, 0xe8, 0x00, 0x6a, 0x00, 0x65, 0xc0, 0x50, 0x11, 0x80, 0x8d, 0x04, 0x11, 0x80, 0xf9, 0x63, 0x0d, 0x62, 0x0c, 0xd1, 0x0b, 0xd0, 0x01, 0x6b, 0x6b, 0xeb, 0x20, 0xb2, 0x60, 0xda, 0x00, 0x68, 0x0e, 0x10, 0x0c, 0x6b, 0x78, 0xe8, 0x12, 0xeb, 0x49, 0xe3, 0x62, 0x9a, 0x07, 0x23, 0x20, 0x18, 0xf1, 0x2e, 0x81, 0x9a, 0x03, 0x22, 0x19, 0xb2, 0x00, 0xda, 0x06, 0x10, 0x01, 0x48, 0x18, 0xb2, 0x80, 0xf0, 0x64, 0xa2, 0x02, 0xeb, 0xed, 0x60, 0x17, 0xb2, 0x17, 0xb3, 0x60, 0xda, 0x17, 0xb2, 0x40, 0xa2, 0xff, 0x72, 0x07, 0x61, 0x16, 0xb2, 0x40, 0xaa, 0x04, 0x2a, 0x00, 0x18, 0x04, 0x39, 0x00, 0x65, 0x01, 0x10, 0x00, 0x6a, 0x0d, 0xb3, 0x60, 0x9b, 0x81, 0x43, 0x07, 0x2c, 0x11, 0xb3, 0x60, 0x9b, 0xd1, 0x23, 0xd0, 0x2a, 0x40, 0xeb, 0x00, 0x65, 0xcd, 0x17, 0x0c, 0x68, 0x18, 0xeb, 0x08, 0xb2, 0x04, 0x01, 0xb1, 0x67, 0x12, 0xe8, 0x41, 0xe0, 0x20, 0x18, 0xf8, 0x2e, 0x81, 0x98, 0xc2, 0x2a, 0x40, 0x98, 0x40, 0xea,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 0xb3, 0x8e, 0xeb, 0x01, 0x2b, 0x60, 0xda, 0x11, 0xb3, 0x0f, 0xb2, 0x60, 0xda, 0x17, 0xb2, 0x00, 0x6b, 0x60, 0xda, 0x61, 0xda, 0x62, 0xda, 0x63, 0xda, 0x00, 0x1c, 0x2e, 0x1b, 0x64, 0xda, 0x80, 0x18, 0x41, 0x2e, 0x00, 0x65, 0x13, 0x97, 0x12, 0x91, 0x11, 0x90, 0x00, 0xef, 0x0a, 0x63, 0x00, 0x65, 0x00, 0xd9, 0x04, 0x80, 0x50, 0x00, 0x11, 0x80, 0x52, 0x00, 0x11, 0x80, 0x04, 0x20, 0x11, 0x80, 0x58, 0x00, 0x11, 0x80, 0x50, 0x8b, 0x10, 0x80, 0xef, 0xbe, 0x23, 0x87, 0x08, 0x94, 0x10, 0x80, 0x54, 0x8b, 0x10, 0x80, 0x70, 0x07, 0x11, 0x80, 0x58, 0x8b, 0x10, 0x80, 0x32, 0x97, 0x79, 0x23, 0x60, 0x8b, 0x10, 0x80, 0x58, 0x3b, 0x7a, 0x93, 0x64, 0x73, 0x11, 0x80, 0xf2, 0x63, 0x1b, 0x62, 0x1a, 0xd1, 0x19, 0xd0, 0x20, 0xf5, 0x1c, 0xb2, 0x7d, 0x67, 0x40, 0xaa, 0x51, 0xcb, 0x20, 0xf0, 0x82, 0xa3, 0x20, 0xf5, 0x14, 0xb2, 0x92, 0x35, 0xa0, 0xc2, 0x13, 0xd5, 0x20, 0xf0, 0x63, 0xa3, 0x01, 0x6a, 0x86, 0x34, 0x6e, 0x31, 0x4c, 0xe9, 0x66, 0x33, 0x4c, 0xeb, 0x24, 0x31, 0x6d, 0xe9, 0x07, 0x6b, 0x6c, 0xec, 0x10, 0xd4, 0x7c, 0x6c, 0x98, 0xe9, 0x00, 0xf5, 0x10, 0xb3, 0xb1, 0x67, 0x12, 0xec, 0x6d, 0xe4, 0x12, 0xd3, 0x60, 0xa3, 0x10, 0x94, 0x6c, 0xea, 0x00, 0x18, 0x91,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a2, 0x01, 0x72, 0x00, 0xf2, 0x12, 0x61, 0x60, 0xf4, 0x00, 0xb2, 0x69, 0xe2, 0x00, 0xc2, 0x0d, 0x12, 0x13, 0x94, 0x02, 0x74, 0x20, 0x61, 0x20, 0xf4, 0x18, 0xb2, 0x40, 0xa2, 0x00, 0xf2, 0x05, 0x2a, 0x20, 0xf4, 0x1c, 0xb2, 0x44, 0x9a, 0x02, 0x72, 0xe0, 0xf1, 0x1f, 0x60, 0x00, 0x18, 0x63, 0xa7, 0x00, 0x65, 0x00, 0x18, 0x35, 0x3a, 0x00, 0x65, 0x20, 0xf4, 0x08, 0xb3, 0x04, 0xd0, 0x05, 0xd3, 0x06, 0xd2, 0x06, 0x6c, 0xfa, 0x6d, 0xc3, 0xf5, 0x0a, 0x6e, 0xc0, 0xf5, 0x1a, 0x6f, 0x20, 0x18, 0x00, 0x2d, 0x00, 0x65, 0xea, 0x11, 0x10, 0x94, 0xb1, 0x67, 0x00, 0x18, 0x31, 0xdd, 0x08, 0x06, 0xff, 0x72, 0xe0, 0xf1, 0x02, 0x60, 0x00, 0xf4, 0x04, 0xb2, 0x40, 0x9a, 0xbd, 0x67, 0x10, 0xad, 0x0d, 0x22, 0x14, 0x93, 0x3c, 0x6c, 0x12, 0x95, 0x98, 0xeb, 0x7d, 0x67, 0xd1, 0xab, 0x12, 0xec, 0x91, 0xe5, 0x04, 0x4c, 0x40, 0xea, 0xb0, 0x67, 0xc0, 0xf1, 0x0f, 0x2a, 0xc0, 0xf2, 0x0c, 0x6a, 0x58, 0xe8, 0x13, 0x93, 0xf1, 0xb2, 0x12, 0x94, 0x12, 0xe8, 0x41, 0xe0, 0x01, 0x6a, 0x44, 0xeb, 0x14, 0x93, 0x15, 0xd2, 0x3c, 0x6a, 0x58, 0xeb, 0x12, 0xea, 0x49, 0xe4, 0x20, 0xf0, 0x72, 0xa2, 0x02, 0x73, 0xe0, 0xf0, 0x00, 0x61, 0x20, 0xf0, 0x70, 0xa2, 0xff, 0x73, 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, 0x60, 0xc2, 0x40, 0xb2, 0x80, 0xa2, 0x00, 0x18, 0xb5, 0xcd, 0x00, 0x65, 0x10, 0x95, 0x02, 0x2d, 0x13, 0x92, 0x08, 0x22, 0x13, 0x93, 0x01, 0x73, 0x27, 0x61, 0x10, 0x94, 0x25, 0x2c, 0x25, 0xb2, 0x44, 0x9a, 0x22, 0x22, 0xe0, 0xf0, 0x47, 0xa0, 0x01, 0x6d, 0xae, 0xea, 0x1d, 0x2a, 0x36, 0xb3, 0x02, 0x49, 0x28, 0x31, 0x27, 0xe3, 0x60, 0x99, 0x00, 0x53, 0x16, 0x61, 0x11, 0x93, 0x14, 0x23, 0x11, 0x94, 0x0a, 0x6b, 0x18, 0xf0, 0x00, 0x6d, 0x78, 0xec, 0x14, 0xb4, 0x12, 0xeb, 0x6d, 0xe4, 0x83, 0xab, 0x00, 0x18, 0xec, 0x3a, 0x16, 0xd2, 0x11, 0x95, 0x16, 0x92, 0x26, 0xb3, 0xad, 0xe3, 0x40, 0xc3, 0x23, 0xb3, 0xad, 0xe3, 0x40, 0xc3, 0x13, 0xb2, 0x60, 0xf1, 0x49, 0xa2, 0x01, 0x72, 0x08, 0x61, 0x00, 0xf2, 0x52, 0xa0, 0x05, 0x22, 0xa0, 0xf0, 0x44, 0xa8, 0x01, 0x4a, 0xa0, 0xf0, 0x44, 0xc8, 0x1b, 0x97, 0x1a, 0x91, 0x19, 0x90, 0x00, 0xef, 0x0e, 0x63, 0x00, 0x65, 0x08, 0x00, 0x00, 0xb6, 0x8d, 0x04, 0x11, 0x80, 0x94, 0x36, 0x11, 0x80, 0xdc, 0x39, 0x11, 0x80, 0xc0, 0x1a, 0x11, 0x80, 0xc4, 0x1a, 0x11, 0x80, 0xa0, 0x50, 0x11, 0x80, 0xac, 0x50, 0x11, 0x80, 0xb4, 0x54, 0x11, 0x80, 0xc0, 0x50, 0x11, 0x80, 0x00, 0xd9, 0x04, 0x80, 0xbc, 0x19, 0x11, 0x80, 0xc4, 0x19, 0x11, 0x80, 0x10, 0x1a, 0x11, 0x80, 0x1f, 0x1a, 0x11, 0x80, 0x58, 0x00, 0x11, 0x80, 0x20, 0x01, 0x00, 0xb6, 0x20, 0x1a, 0x11, 0x80, 0x40, 0x3b, 0x11, 0x80, 0x66, 0x1b, 0x11, 0x80, 0x1e, 0x1a, 0x11, 0x80, 0x1c, 0x1a, 0x11, 0x80, 0xb0, 0x19, 0x11, 0x80, 0x70, 0x3a, 0x11, 0x80, 0x78, 0x19, 0x11, 0x80, 0x6c, 0x19, 0x11, 0x80, 0x80, 0x36, 0x11, 0x80, 0x0c, 0x1a, 0x11, 0x80, 0xe1, 0x19, 0x11, 0x80, 0x55, 0x00, 0x11, 0x80, 0x0c, 0xa3, 0x00, 0xb0, 0xfc, 0x63, 0x07, 0x62, 0x0f, 0xb3, 0x60, 0xf1, 0x64, 0x9b, 0x0f, 0xb2, 0x6c, 0xea, 0x0f, 0xb3, 0x6e, 0xea, 0x13, 0x2a, 0x0e, 0xb2, 0xff, 0xf7, 0x1f, 0x6b, 0xff, 0x6c, 0x40, 0xaa, 0x1f, 0x4c, 0x4c, 0xeb, 0x5d, 0x67, 0x68, 0xca, 0x08, 0x6a, 0x4b, 0xea, 0x6c, 0xea, 0x01, 0x6b, 0x6d, 0xea, 0x7d, 0x67, 0x50, 0xc3, 0x00, 0x18, 0xec, 0x3a, 0xa8, 0xab, 0x07, 0x97, 0x00, 0xef, 0x04, 0x63, 0xc0, 0x50, 0x11, 0x80, 0xff, +0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0x01, 0x1e, 0x01, 0x00, 0xb6, 0xfd, 0x63, 0x05, 0x62, 0x00, 0x1c, 0x5e, 0x1b, 0x00, 0x65, 0x09, 0xb3, 0x60, 0x9b, 0x81, 0x43, 0x07, 0x24, 0x24, 0x6c, 0x98, 0xeb, 0x07, 0xb4, 0x12, 0xeb, 0x6d, 0xe4, 0x06, 0xb4, 0x83, 0xdb, 0x00, 0x1c, 0x65, 0x1b, 0x82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8c, 0xea, 0x0a, 0xd2, 0xa0, 0xf2, 0x9e, 0xa8, 0x10, 0xd4, 0x07, 0x2c, 0x12, 0x95, 0x01, 0x75, 0x04, 0x61, 0x00, 0x1c, 0x65, 0x1b, 0x1a, 0x94, 0x21, 0x11, 0x06, 0x22, 0x05, 0x23, 0x7b, 0xea, 0x01, 0x2b, 0xe5, 0xe8, 0x10, 0xe9, 0x01, 0x10, 0x00, 0x69, 0xff, 0xf7, 0x1f, 0x6c, 0x27, 0xe3, 0x8c, 0xe9, 0x18, 0x94, 0x85, 0xe1, 0x23, 0xeb, 0x01, 0x60, 0x67, 0xe1, 0x12, 0x95, 0x01, 0x75, 0x02, 0x60, 0x10, 0xd3, 0x16, 0x10, 0x8b, 0xb3, 0xa0, 0xf2, 0x8c, 0x98, 0x8c, 0xeb, 0x43, 0xeb, 0x67, 0xe2, 0x03, 0x61, 0x89, 0xb1, 0x67, 0xe1, 0x45, 0xe1, 0x10, 0x95, 0x4b, 0xe3, 0xba, 0xe9, 0x01, 0x2d, 0xe5, 0xe8, 0x12, 0xe9, 0x01, 0x49, 0xb8, 0xe9, 0x12 +, 0xe9, 0x25, 0xe2, 0x81, 0xb2, 0x4c, 0xe9, 0x11, 0x93, 0xe0, 0xf0, 0xa3, 0xa0, 0x02, 0x6c, 0x74, 0x32, 0xa0, 0x35, 0xff, 0x6b, 0x6c, 0xea, 0xac, 0x35, 0x4d, 0xed, 0xff, 0xf7, 0x1f, 0x6a, 0x00, 0x18, 0xec, 0x3a, 0x4c, 0xed, 0x0a, 0x93, 0x71, 0xe1, 0x11, 0xd4, 0x05, 0x10, 0x11, 0x95, 0x10, 0x92, 0x55, 0xe5, 0x11, 0xd5, 0x45, 0xe1, 0x08, 0x59, 0xf9, 0x61, 0x00, 0x18, 0x35, 0x3a, 0x1b, 0xd3, 0x11, 0x94, 0x1b, 0x93, 0x6f, 0xe4, 0x64, 0x33, 0x6d, 0xe2, 0x70, 0xd8, 0x10, 0x95, 0x00, 0x18, 0xec, 0x3a, 0x4e, 0x6c, 0x11, 0x95, 0xff, 0xf7, 0x1f, 0x6a, 0x48, 0x6c, 0x4c, 0xed, 0x18, 0xd5, 0x00, 0x18, 0xec, 0x3a, 0x1b, 0xd2, 0x13, 0x93, 0x12, 0x2b, 0x16, 0x95, 0x00, 0x18, 0xec, 0x3a, 0x4c, 0x6c, 0x17, 0x95, 0x00, 0x18, 0xec, 0x3a, 0x4a, 0x6c, 0x65, 0xb3, 0x1b, 0x92, 0x00, 0xf2, 0x1c, 0x6c, 0xa0, 0xab, 0x40, 0x6b, 0x4c, 0xed, 0x6d, 0xed, 0x4c, 0xed, 0x16, 0x10, 0x61, 0xb3, 0x7c, 0x4b, 0x78, 0x9b, 0x10, 0xf0, 0x00, 0x6a, 0x6c, 0xea, 0x08, 0x22, 0x16, 0x94, 0x03, 0x24, 0x4c, 0x6c, 0x01, 0x6d, 0x05, 0x10, 0x4c, 0x6c, 0x00, 0x6d, 0x02, 0x10, 0x16, 0x95, 0x4c, 0x6c, 0x00, 0x18, 0xec, 0x3a, 0x00, 0x65, 0x17, 0x95, 0x4a, 0x6c, 0x00, 0x18, 0xec, 0x3a, 0x00, 0x65, 0x07, 0x6d, 0x00, 0x18, 0xec, 0x3a, 0x00, 0x6c, 0x12, 0x95, 0x0e, 0x2d, 0x13, 0x92, 0x01, 0x72, 0x0b, 0x61, 0x14, 0x93, 0x51, 0xb2, 0x69, 0xe2, 0xa0, 0xc2, 0x50, 0xb2, 0x69, 0xe2, 0x7d, 0x67, 0x87, 0x43, 0x41, 0x4c, 0x60, 0xa4, 0x60, 0xc2, 0x1a, 0x94, 0x00, 0x1c, 0x65, 0x1b, 0x02, 0x49, 0x00, 0x18, 0x1c, 0x04, 0x00, 0x65, 0x01, 0xf0, 0x00, 0x6d, 0x00, 0x18, 0xd9, 0xbb, 0x5e, 0x6c, 0x11, 0x95, 0x18, 0x94, 0x03, 0x6a, 0x04, 0xd2, 0x46, 0xb2, 0x05, 0xd2, 0x06, 0xd4, 0xa4, 0x32, 0x07, 0xd5, 0x00, 0x6c, 0xfa, 0x6d, 0x63, 0xf3, 0x17, 0x6e, 0x40, 0x6f, 0x20, 0x18, 0x00, 0x2d, 0x08, 0xd2, 0x12, 0x92, 0x1f, 0x2a, 0x13, 0x93, 0x01, 0x73, 0x0c, 0x61, 0x15, 0x92, 0x18, 0xf0, 0x00, 0x6c, 0x03, 0xf4, 0x00, 0x6d, 0x00, 0x18, 0xc8, 0x96, 0xc3, 0xaa, 0x20, 0x6a, 0x00, 0xf2, 0x50, 0xc0, 0x24, 0x10, 0x51, 0x59, 0x06, 0x61, 0x19, 0x95, 0xff, 0xf7, 0x1f, 0x6c, 0x00, 0x18, 0xdf, 0x9b, +0x2c, 0xec, 0x15, 0x93, 0x18, 0xf0, 0x00, 0x6c, 0x01, 0xf4, 0x00, 0x6d, 0x00, 0x18, 0xc8, 0x96, 0xc3, 0xab, 0x13, 0x94, 0x12, 0x2c, 0x12, 0x95, 0x10, 0x25, 0x51, 0x59, 0x0e, 0x61, 0x19, 0x95, 0xff, 0xf7, 0x1f, 0x6c, 0x00, 0x18, 0xdf, 0x9b, 0x2c, 0xec, 0x15, 0x92, 0x01, 0xf4, 0x00, 0x6c, 0x18, 0xf0, 0x00, 0x6d, 0x00, 0x18, 0xc8, 0x96, 0xc3, 0xaa, 0x10, 0x94, 0x7d, 0x67, 0x60, 0xf2, 0x0b, 0x6a, 0x5a, 0xcb, 0x23, 0xb2, 0x0b, 0xd4, 0x80, 0x9a, 0x0e, 0x92, 0x10, 0x95, 0x0c, 0x96, 0x04, 0xd2, 0x0d, 0x97, 0x0f, 0x92, 0x00, 0x18, 0x79, 0x1c, 0x05, 0xd2, 0x03, 0x6a, 0x10, 0x95, 0x04, 0xd2, 0x1b, 0xb2, 0x05, 0xd2, 0x16, 0x93, 0x17, 0x92, 0x06, 0xd5, 0x05, 0x6c, 0xfa, 0x6d, 0xc3, 0xf3, 0x0d, 0x6e, 0x82, 0xf7, 0x1e, 0x6f, 0x07, 0xd2, 0x20, 0x18, 0x00, 0x2d, 0x08, 0xd3, 0x14, 0x94, 0x0d, 0x24, 0x64, 0x67, 0xff, 0x4b, 0x68, 0x33, 0x13, 0xb4, 0x71, 0xe4, 0x00, 0x6a, 0x40, 0xdc, 0x12, 0xb4, 0x71, 0xe4, 0x40, 0xdc, 0x11, 0xb4, 0x6d, 0xe4, 0x40, 0xdb, 0x1f, 0x97, 0x1e, 0x91, 0x1d, 0x90, 0x01, 0x6a, 0x00, 0xef, 0x10, 0x63, 0x00, 0x65, 0xb4, 0x54, 0x11, 0x80, 0xdc, 0x39, 0x11, 0x80, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x08, 0x1c, 0x02, 0x00, 0xb6, 0x58, 0x00, 0x11, 0x80, 0x6c, 0x19, 0x11, 0x80, 0x78, 0x19, 0x11, 0x80, 0x00, 0xd9, 0x04, 0x80, 0x3c, 0x47, 0x11, 0x80, 0x2c, 0x1a, 0x11, 0x80, 0x5c, 0x1a, 0x11, 0x80, 0x8c, 0x1a, 0x11, 0x80, 0xfb, 0x63, 0x09, 0x62, 0x08, 0xd1, 0x07, 0xd0, 0x58, 0xb2, 0xff, 0xf7, 0x1f, 0x6b, 0x01, 0x6c, 0x40, 0xaa, 0x4c, 0xeb, 0x56, 0xb2, 0x40, 0xaa, 0x04, 0xd2, 0x56, 0xb2, 0x40, 0xa2, 0x8e, 0xea, 0x04, 0x2a, 0x55, 0xb4, 0x40, 0xc4, 0x55, 0xb4, 0x40, 0xc4, 0x00, 0x69, 0x92, 0x10, 0x54, 0xb2, 0x40, 0x9a, 0x05, 0x22, 0x08, 0xf0, 0x00, 0x6a, 0x6c, 0xea, 0x80, 0xf0, 0x0f, 0x22, 0x04, 0x92, 0x08, 0xf0, 0x00, 0x6c, 0x6c, 0xec, 0x4f, 0xe8, 0x6c, 0xe8, 0x00, 0x32, 0x40, 0x32, 0x43, 0x32, 0x43, 0x32, 0x04, 0x24, 0x00, 0x18, 0x1e, 0x9b, 0x05, 0xd2, 0x05, 0x92, 0x49, 0xb3, 0x7c, 0x4b, 0x75, 0x9b, 0x02, 0x6c, 0x8c, 0xeb, 0x0f, 0x23, 0x00, 0x52, 0x0d, 0x60, 0x00, 0x18, 0xc9, 0x1a, 0x00, 0x65, 0x45, 0xb2 +, 0x40, 0xf0, 0x63, 0xa2, 0x06, 0x23, 0xff, 0xf7, 0x1e, 0x6b, 0x6c, 0xe8, 0x00, 0x6b, 0x40, 0xf0, 0x63, 0xc2, 0x08, 0x6a, 0x0c, 0xea, 0x03, 0x22, 0x00, 0x18, 0xcd, 0x09, 0x00, 0x65, 0x02, 0x6a, 0x0c, 0xea, 0x03, 0x22, 0x80, 0x18, 0xac, 0x2e, 0x00, 0x65, 0x01, 0x6a, 0x0c, 0xea, 0x03, 0x22, 0x00, 0x18, 0x3c, 0x13, 0x00, 0x6c, 0x20, 0x6a, 0x0c, 0xea, 0x03, 0x22, 0x00, 0x18, 0xf4, 0x05, 0x00, 0x65, 0x04, 0x6a, 0x0c, 0xea, 0x03, 0x22, 0x00, 0x18, 0x43, 0x11, 0x00, 0x65, 0x02, 0xf0, 0x00, 0x6a, 0x0c, 0xea, 0x09, 0x22, 0x00, 0x18, 0x5c, 0x11, 0x00, 0x65, 0x2e, 0xb2, 0x40, 0xa2, 0x03, 0x22, 0x00, 0x18, 0xc6, 0xa2, 0x00, 0x65, 0x00, 0xf6, 0x00, 0x6a, 0x0c, 0xea, 0x05, 0x22, 0x2a, 0xb2, 0xff, 0xf7, 0x1f, 0x69, 0x40, 0xaa, 0x4c, 0xe9, 0x00, 0xf2, 0x00, 0x6a, 0x0c, 0xea, 0x03, 0x22, 0x00, 0x18, 0xf0, 0x12, 0x91, 0x67, 0x00, 0xf4, 0x00, 0x6a, 0x0c, 0xea, 0x0f, 0x22, 0x00, 0x18, 0x29, 0x13, 0x91, 0x67, 0xfe, 0xf7, 0x1f, 0x6d, 0x00, 0x18, 0xf4, 0xbb, 0x5e, 0x6c, 0x1b, 0xb2, 0xe0, 0xf0, 0x54, 0xa2, 0x03, 0x22, 0x00, 0x18, 0x01, 0xa9, 0x00, 0x65, 0x01, 0xf0, 0x00, 0x6d, 0x50, 0x67, 0xac, 0xea, 0x07, 0x22, 0x00, 0x18, 0x11, 0x13, 0x05, 0xd5, 0x05, 0x95, 0x00, 0x18, 0xd9, 0xbb, 0x5e, 0x6c, 0xff, 0x6a, 0x01, 0x4a, 0x0c, 0xea, 0x03, 0x22, 0x00, 0x18, 0x46, 0x05, 0x00, 0x65, 0x08, 0xb2, 0xff, 0xf7, 0x1f, 0x6b, 0x40, 0xaa, 0x4c, 0xeb, 0x04, 0x94, 0x8f, 0xea, 0x6c, 0xea, 0x7f, 0xf7, 0x09, 0x2a, 0x09, 0x97, 0x08, 0x91, 0x07, 0x90, 0x00, 0xef, 0x05, 0x63, 0x00, 0x65, 0xbe, 0x00, 0x00, 0xb6, 0x82, 0x04, 0x11, 0x80, 0x68, 0x3a, 0x11, 0x80, 0x23, 0x1a, 0x11, 0x80, 0xa8, 0x39, 0x11, 0x80, 0x84, 0x3a, 0x11, 0x80, 0x58, 0x00, 0x11, 0x80, 0xec, 0x44, 0x11, 0x80, 0xd8, 0x1a, 0x11, 0x80, 0x5c, 0x00, 0x00, 0xb6, 0xfd, 0x63, 0x05, 0x62, 0x04, 0xd0, 0x2a, 0xb2, 0x40, 0x9a, 0x1e, 0xf4, 0x01, 0x6b, 0x6b, 0xeb, 0x4d, 0xeb, 0x40, 0x9c, 0x04, 0x67, 0x6c, 0xea, 0x7c, 0x6b, 0x4c, 0xeb, 0x40, 0xdc, 0x03, 0x23, 0x00, 0x18, 0x75, 0x39, 0x00, 0x65, 0x61, 0xa0, 0x40, 0x6a, 0x6c, 0xea, 0x03, 0x22, 0x00, 0x18, 0x99, 0x02, 0x00, 0x65, 0x61, 0xa0, 0x04, +0x6a, 0x6c, 0xea, 0x03, 0x22, 0x80, 0x18, 0x0f, 0x31, 0x00, 0x65, 0x61, 0xa0, 0x10, 0x6a, 0x6c, 0xea, 0x03, 0x22, 0x00, 0x18, 0xe0, 0x03, 0x00, 0x65, 0x61, 0xa0, 0x08, 0x6a, 0x4c, 0xeb, 0x0a, 0x23, 0x15, 0xb3, 0x61, 0xa3, 0x6c, 0xea, 0x03, 0x22, 0x00, 0x18, 0xc0, 0x00, 0x00, 0x65, 0x00, 0x18, 0x76, 0x37, 0x00, 0x65, 0x61, 0xa0, 0x80, 0x6a, 0x4b, 0xea, 0x6c, 0xea, 0xff, 0x6b, 0x6c, 0xea, 0x03, 0x22, 0x00, 0x18, 0xad, 0x02, 0x00, 0x65, 0x61, 0xa0, 0x20, 0x6a, 0x6c, 0xea, 0x03, 0x22, 0x00, 0x18, 0x2d, 0x02, 0x00, 0x65, 0x09, 0xb2, 0x60, 0xa2, 0x04, 0x23, 0x00, 0x6b, 0x00, 0x18, 0x74, 0x33, 0x60, 0xc2, 0x00, 0x6b, 0x06, 0xb2, 0x60, 0xc2, 0x05, 0x97, 0x04, 0x90, 0x01, 0x6a, 0x00, 0xef, 0x03, 0x63, 0x90, 0x20, 0x11, 0x80, 0x88, 0x07, 0x11, 0x80, 0xd0, 0x07, 0x11, 0x80, 0xf8, 0x63, 0x0f, 0x62, 0x0e, 0xd0, 0x68, 0xa4, 0x01, 0x6a, 0x04, 0x67, 0x6c, 0xea, 0x04, 0x22, 0x00, 0x18, 0x0a, 0x02, 0x00, 0x65, 0x4f, 0x2a, 0x68, 0xa0, 0x04, 0x6a, 0x6c, 0xea, 0x04, 0x22, 0x00, 0x18, 0x97, 0x01, 0x90, 0x67, 0x47, 0x2a, 0x68, 0xa0, 0x08, 0x6a, 0x6c, 0xea, 0x04, 0x22, 0x00, 0x18, 0x72, 0x01, 0x90, 0x67, 0x3f, 0x2a, 0x2d, 0xb2, 0x7c, 0x4a, 0x58, 0x9a, 0x02, 0x6b, 0x6c, 0xea, 0x18, 0x22, 0x68, 0xa0, 0x80, 0x6a, 0x4b, 0xea, 0x6c, 0xea, 0xff, 0x6b, 0x6c, 0xea, 0x04, 0x22, 0x00, 0x18, 0xf0, 0x01, 0x90, 0x67, 0x2e, 0x2a, 0x68, 0xa0, 0x40, 0x6a, 0x6c, 0xea, 0x04, 0x22, 0x00, 0x18, 0xdc, 0x01, 0x90, 0x67, 0x26, 0x2a, 0x62, 0x98, 0xc1, 0x6a, 0x4b, 0xea, 0x6c, 0xea, 0x37, 0x22, 0x1e, 0xb2, 0x80, 0xf0, 0x7c, 0xa2, 0x5d, 0x67, 0x20, 0xf0, 0x70, 0xc2, 0x04, 0x6a, 0x6c, 0xea, 0x07, 0x22, 0x66, 0xa0, 0x7f, 0x6a, 0x6c, 0xea, 0x21, 0x6b, 0x6b, 0xeb, 0x6c, 0xea, 0x46, 0xc0, 0x16, 0xb2, 0x20, 0xf0, 0x7b, 0xa2, 0x5d, 0x67, 0x20, 0xf0, 0x74, 0xc2, 0x40, 0x6a, 0x6c, 0xea, 0x05, 0x22, 0x66, 0xa0, 0x21, 0x6a, 0x4b, 0xea, 0x6c, 0xea, 0x46, 0xc0, 0x00, 0x18, 0xf9, 0x36, 0x84, 0x40, 0x05, 0x6a, 0x04, 0xd2, 0x0e, 0xb2, 0x05, 0xd2, 0x40, 0x98, 0x04, 0x6c, 0xfa, 0x6d, 0x06, 0xd2, 0x43, 0x98, 0x82, 0xf6, 0x0b, 0x6e, 0xa1, 0xf1, 0x1a, 0x6f, 0x07, 0xd2, 0x42 +, 0x98, 0x08, 0xd2, 0x41, 0x98, 0x09, 0xd2, 0x44, 0x98, 0x20, 0x18, 0x00, 0x2d, 0x0a, 0xd2, 0x0f, 0x97, 0x0e, 0x90, 0x01, 0x6a, 0x00, 0xef, 0x08, 0x63, 0x58, 0x00, 0x11, 0x80, 0x00, 0xd9, 0x04, 0x80, 0xfd, 0x63, 0x05, 0x62, 0x04, 0xd0, 0x00, 0x68, 0x18, 0xb4, 0x04, 0x32, 0x49, 0xe4, 0x60, 0xaa, 0xff, 0xf7, 0x1f, 0x73, 0x0e, 0x60, 0x41, 0x40, 0x44, 0x32, 0x49, 0xe4, 0xc0, 0xaa, 0x3f, 0x6c, 0x6c, 0xec, 0x00, 0x18, 0xa4, 0xa4, 0x00, 0x6d, 0x02, 0x48, 0xff, 0x6a, 0x4c, 0xe8, 0x10, 0x58, 0xeb, 0x61, 0x00, 0x68, 0x0e, 0xb4, 0x04, 0x32, 0x49, 0xe4, 0x60, 0xaa, 0xff, 0xf7, 0x1f, 0x73, 0x0e, 0x60, 0x41, 0x40, 0x44, 0x32, 0x49, 0xe4, 0xc0, 0xaa, 0x3f, 0x6c, 0x6c, 0xec, 0x00, 0x18, 0xa4, 0xa4, 0x00, 0x6d, 0x02, 0x48, 0xff, 0x6a, 0x4c, 0xe8, 0x1a, 0x58, 0xeb, 0x61, 0x05, 0x97, 0x04, 0x90, 0x00, 0xef, 0x03, 0x63, 0x00, 0x65, 0x40, 0xdd, 0x10, 0x80, 0x60, 0xdd, 0x10, 0x80, 0xfa, 0x63, 0x0b, 0x62, 0x0a, 0xd1, 0x09, 0xd0, 0xff, 0x69, 0x36, 0xb0, 0x8c, 0xe9, 0x61, 0xf3, 0x06, 0x6d, 0x00, 0x18, 0xec, 0x3a, 0x22, 0x6c, 0x20, 0xf0, 0xbf, 0xa0, 0xf3, 0x6a, 0x24, 0x6c, 0xa0, 0x35, 0x00, 0x18, 0xec, 0x3a, 0x4d, 0xed, 0x40, 0xf0, 0xa1, 0xa0, 0x40, 0xf0, 0x40, 0xa0, 0x26, 0x6c, 0xa0, 0x35, 0x00, 0x18, 0xec, 0x3a, 0x4d, 0xed, 0xeb, 0xf0, 0x12, 0x6d, 0x00, 0x18, 0xec, 0x3a, 0x28, 0x6c, 0x93, 0xf7, 0x1a, 0x6d, 0x00, 0x18, 0xec, 0x3a, 0x2a, 0x6c, 0x00, 0x18, 0xee, 0x39, 0x01, 0x6c, 0x02, 0x6c, 0x00, 0x18, 0xec, 0x3a, 0x20, 0x6d, 0x22, 0xb2, 0x03, 0xf4, 0x00, 0x6d, 0x00, 0x18, 0xec, 0x3a, 0x81, 0xa2, 0x20, 0xb2, 0x20, 0x6d, 0x5e, 0x6c, 0x60, 0xaa, 0x9f, 0xf7, 0x1f, 0x6a, 0x6c, 0xea, 0x00, 0x18, 0xec, 0x3a, 0x4d, 0xed, 0xff, 0x6c, 0x09, 0x4c, 0x00, 0x18, 0xec, 0x3a, 0x03, 0x6d, 0x1a, 0xb2, 0x81, 0xa2, 0x1a, 0xb2, 0x49, 0xe4, 0x60, 0xaa, 0xee, 0xf1, 0x09, 0x6a, 0x6c, 0xea, 0xff, 0x6b, 0x21, 0x4b, 0x6d, 0xea, 0x16, 0xb3, 0xa0, 0xa3, 0x07, 0x6b, 0x6c, 0xed, 0xa0, 0x35, 0xa4, 0x35, 0x00, 0x18, 0xec, 0x3a, 0x4d, 0xed, 0x02, 0x6c, 0x00, 0x18, 0xec, 0x3a, 0x20, 0x6d, 0x00, 0x6c, 0x00, 0x18, 0xec, 0x3a, 0x0d, 0x6d, 0x0b, 0x21, 0x04, 0x00, +0x90, 0x67, 0x55, 0x6d, 0x00, 0x18, 0x5a, 0x33, 0x0a, 0x6e, 0x01, 0x6c, 0x00, 0x6d, 0x00, 0x18, 0xb9, 0x3c, 0xd0, 0x67, 0x0b, 0x97, 0x0a, 0x91, 0x09, 0x90, 0x00, 0xef, 0x06, 0x63, 0x58, 0x00, 0x11, 0x80, 0x6c, 0xe3, 0x04, 0x80, 0x5e, 0x00, 0x00, 0xb6, 0x74, 0xe3, 0x04, 0x80, 0x00, 0x00, 0x00, 0xb6, 0x28, 0x05, 0x11, 0x80, 0xf9, 0x63, 0x0d, 0x62, 0x0c, 0xd1, 0x0b, 0xd0, 0x0f, 0xd5, 0x10, 0xd6, 0x40, 0xa5, 0x04, 0x67, 0x09, 0xd2, 0x60, 0xa6, 0x08, 0xd3, 0x40, 0xac, 0x7f, 0xf4, 0x10, 0x72, 0x1c, 0x60, 0x7f, 0xf4, 0x11, 0x6b, 0x63, 0xea, 0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0x43, 0x1d, 0x4a, 0x40, 0xa2, 0x0f, 0x93, 0x40, 0xc3, 0x7d, 0x67, 0x47, 0x43, 0x19, 0x4a, 0x40, 0xa2, 0x10, 0x93, 0x40, 0xc3, 0x01, 0x6a, 0x01, 0x10, 0x00, 0x6a, 0x0d, 0x97, 0x0c, 0x91, 0x0b, 0x90, 0x00, 0xef, 0x07, 0x63, 0x09, 0x93, 0x01, 0x73, 0xe9, 0x61, 0xe4, 0x17, 0x58, 0x00, 0x11, 0x80, 0x28, 0x94, 0x11, 0x80, 0x00, 0xd9, 0x04, 0x80, 0xfd, 0x63, 0x05, 0x62, 0x06, 0xb2 +, 0xc0, 0xf1, 0x7f, 0xa2, 0x07, 0x6a, 0x6c, 0xea, 0x03, 0x22, 0x00, 0x18, 0x79, 0x24, 0x00, 0x6c, 0x05, 0x97, 0x00, 0xef, 0x03, 0x63, 0x58, 0x00, 0x11, 0x80, 0xf1, 0x63, 0x1d, 0x62, 0x1c, 0xd1, 0x1b, 0xd0, 0xff, 0xf7, 0x1f, 0x6a, 0x8c, 0xea, 0x57, 0xb3, 0x16, 0xd2, 0x48, 0x32, 0x49, 0xe3, 0x00, 0x6b, 0x00, 0x9a, 0x15, 0xd3, 0x17, 0xd3, 0x9d, 0x10, 0x43, 0xa8, 0x43, 0x2a, 0x15, 0x93, 0x01, 0x4b, 0x15, 0xd3, 0x15, 0x94, 0xff, 0x6b, 0x6c, 0xec, 0x0b, 0x5c, 0x15, 0xd4, 0x02, 0x61, 0x46, 0xd8, 0x92, 0x10, 0x00, 0x1c, 0x5e, 0x1b, 0x00, 0x65, 0x82, 0x67, 0x47, 0x98, 0x02, 0x72, 0x2b, 0x61, 0x17, 0x92, 0x0e, 0x2a, 0x16, 0x93, 0x68, 0x32, 0x46, 0xb3, 0x49, 0xe3, 0x60, 0x9a, 0x04, 0x2b, 0x00, 0x1c, 0x65, 0x1b, 0x00, 0x65, 0x7f, 0x10, 0x66, 0x98, 0x14, 0xd3, 0x60, 0xda, 0x05, 0x10, 0x46, 0x98, 0x17, 0x93, 0x46, 0xdb, 0x46, 0x98, 0x14, 0xd2, 0x01, 0x6a, 0x47, 0xd8, 0x00, 0x6a, 0x00, 0x1c, 0x65, 0x1b, 0x46, 0xd8, 0x43, 0x98, 0x03, 0x22, 0x80, 0x98, 0x40, 0xea, 0xa5, 0x98, 0x44, 0x98, 0x01, 0x72, 0x65, 0x61, 0x47, 0x98, 0x01, 0x72, 0x62, 0x61, 0x80, 0x98, 0x20, 0x18, 0xc7, 0x30, 0xa2, 0x98, 0x5d, 0x10, 0x00, 0x1c, 0x65, 0x1b, 0x00, 0x65, 0x06, 0x98, 0x14, 0xd0, 0x57, 0x10, 0x00, 0x1c, 0x5e, 0x1b, 0x00, 0x65, 0x82, 0x67, 0x47, 0x98, 0x02, 0x72, 0x09, 0x61, 0x43, 0xa8, 0x66, 0x98, 0xff, 0x4a, 0x43, 0xc8, 0x00, 0x1c, 0x65, 0x1b, 0x14, 0xd3, 0x17, 0xd0, 0x04, 0x10, 0x00, 0x1c, 0x65, 0x1b, 0x00, 0x65, 0x14, 0xd0, 0x47, 0x98, 0x02, 0x72, 0x40, 0x61, 0x63, 0x98, 0x25, 0xb2, 0x4b, 0xe3, 0x3c, 0x2a, 0xc0, 0xf2, 0x0c, 0x69, 0x38, 0xea, 0x23, 0xb3, 0x12, 0xe9, 0x65, 0xe1, 0x8b, 0x99, 0x60, 0x98, 0x8e, 0xeb, 0x2d, 0x2b, 0xe0, 0xf0, 0xa3, 0xa1, 0x12, 0x04, 0x00, 0x18, 0x66, 0x96, 0x18, 0xd2, 0x0b, 0x6b, 0x04, 0xd3, 0x1c, 0xb3, 0x05, 0xd3, 0x18, 0x92, 0x12, 0x93, 0x02, 0x6c, 0x07, 0xd2, 0x06, 0xd3, 0xe0, 0xf0, 0x43, 0xa1, 0xfa, 0x6d, 0x82, 0xf3, 0x1f, 0x6e, 0x08, 0xd2, 0xe0, 0xf0, 0x4e, 0xa1, 0x64, 0xf4, 0x14, 0x6f, 0x09, 0xd2, 0x4d, 0x99, 0x0a, 0xd2, 0x60, 0xf2, 0x52, 0xa1, 0x0b, 0xd2, 0x60, 0xf2, 0x53, 0xa1, 0x0c, 0xd2, 0x4c, +0x99, 0x0d, 0xd2, 0x40, 0x98, 0x0e, 0xd2, 0x43, 0xa8, 0x0f, 0xd2, 0x48, 0x98, 0x20, 0x18, 0x00, 0x2d, 0x10, 0xd2, 0x05, 0x10, 0x01, 0x4a, 0xff, 0x6b, 0x6c, 0xea, 0x0a, 0x5a, 0xc4, 0x61, 0x14, 0x90, 0x7f, 0xf7, 0x01, 0x28, 0x1d, 0x97, 0x1c, 0x91, 0x1b, 0x90, 0x00, 0xef, 0x0f, 0x63, 0x4c, 0x89, 0x11, 0x80, 0x59, 0xab, 0x04, 0x80, 0xb4, 0x54, 0x11, 0x80, 0x00, 0xd9, 0x04, 0x80, 0xfd, 0x63, 0x05, 0x62, 0x44, 0xac, 0xc8, 0x72, 0x04, 0x61, 0x80, 0x18, 0x86, 0x32, 0x80, 0xac, 0x03, 0x10, 0x20, 0x18, 0xd6, 0x31, 0x00, 0x65, 0x05, 0x97, 0x00, 0xef, 0x03, 0x63, 0x00, 0x65, 0xfb, 0x63, 0x09, 0x62, 0x08, 0xd0, 0x44, 0x67, 0x80, 0x9c, 0x3f, 0x6b, 0xff, 0x6e, 0x8c, 0xeb, 0x30, 0x73, 0x77, 0x61, 0x62, 0xa2, 0x02, 0x6e, 0x83, 0xa2, 0xe8, 0x43, 0xea, 0x4f, 0xe3, 0xee, 0xa4, 0xa2, 0x5d, 0x61, 0x05, 0x5d, 0x5f, 0x60, 0x04, 0x0e, 0xa4, 0x35, 0xb5, 0xe6, 0xa0, 0x8d, 0xb9, 0xe6, 0x00, 0xee, 0x00, 0x65, 0x00, 0x65, 0x0f, 0x00, 0x79, 0x01, 0x0b, 0x00, 0x4f, 0x00, 0x5b, 0x00, 0x5d, 0xb4, 0x29, 0x10, 0x1e, 0x73, 0x18, 0x61, 0x00, 0x6b, 0xc0, 0xf2, 0x0c, 0x6d, 0xb8, 0xeb, 0x5a, 0xb6, 0x12, 0xed, 0xd5, 0xe5, 0xe0, 0xf0, 0xe3, 0xa5, 0x58, 0xb6, 0x8e, 0xef, 0x04, 0x2f, 0x40, 0xf2, 0x88, 0x45, 0xa0, 0xde, 0x16, 0x10, 0x00, 0x6d, 0xa0, 0xde, 0x01, 0x4b, 0xff, 0x6d, 0xac, 0xeb, 0x0a, 0x5b, 0xea, 0x61, 0x36, 0x10, 0x51, 0xb3, 0x80, 0x9b, 0x33, 0x24, 0x40, 0xf2, 0x08, 0x4c, 0x08, 0x10, 0x0a, 0x6b, 0x78, 0xec, 0x4e, 0xb3, 0x12, 0xec, 0x71, 0xe4, 0x02, 0x10, 0x4d, 0xb4, 0x01, 0x10, 0x27, 0x24, 0x62, 0xa2, 0x1e, 0x73, 0x0a, 0x61, 0x62, 0xa4, 0xc1, 0xa4, 0x60, 0x33, 0x60, 0x33, 0xc0, 0x36, 0x6d, 0xee, 0x60, 0xa4, 0x6d, 0xee, 0x63, 0xa4, 0x0b, 0x10, 0x1f, 0x73, 0x0e, 0x61, 0x66, 0xa4, 0xc5, 0xa4, 0x60, 0x33, 0x60, 0x33, 0xc0, 0x36, 0x6d, 0xee, 0x64, 0xa4, 0x6d, 0xee, 0x67, 0xa4, 0x00, 0xf6, 0x60, 0x33, 0x6d, 0xee, 0x04, 0x6b, 0x0c, 0x10, 0xc9, 0xa4, 0x68, 0xa4, 0xc0, 0x36, 0x6d, 0xee, 0x02, 0x6b, 0x06, 0x10, 0x00, 0x18, 0x67, 0x2f, 0x82, 0x67, 0x60, 0x10, 0x00, 0x6b, 0xc3, 0x67, 0x81, 0xa2, 0x70, 0x33, 0x63, 0xc2, 0x10, 0x6b, 0x6b, 0xeb, 0x8c +, 0xeb, 0x61, 0xc2, 0xa0, 0x9a, 0x00, 0x18, 0xca, 0x2e, 0x02, 0x6c, 0x52, 0x10, 0x23, 0x73, 0x50, 0x60, 0x11, 0x73, 0x30, 0x61, 0xa1, 0x9a, 0x82, 0x32, 0x42, 0x32, 0xcc, 0xea, 0x1c, 0x22, 0xa2, 0x32, 0xcc, 0xea, 0x34, 0x5a, 0x07, 0x61, 0x1f, 0xf7, 0x01, 0x6a, 0x4b, 0xea, 0x4c, 0xed, 0x06, 0xf2, 0x00, 0x6a, 0x4d, 0xed, 0xa2, 0x32, 0xff, 0x6b, 0x6c, 0xea, 0x14, 0x5a, 0x07, 0x60, 0x1f, 0xf7, 0x01, 0x6a, 0x4b, 0xea, 0x4c, 0xed, 0x02, 0xf4, 0x00, 0x6a, 0x4d, 0xed, 0x00, 0xf6, 0x82, 0x33, 0x21, 0xb2, 0x60, 0xc2, 0x02, 0x10, 0x1f, 0xb3, 0x40, 0xc3, 0x1e, 0xb2, 0x40, 0xa2, 0xff, 0x6b, 0xff, 0x4a, 0x6c, 0xea, 0x0e, 0x5a, 0x24, 0x60, 0x01, 0x6b, 0x1b, 0xb2, 0x00, 0x18, 0xed, 0xf0, 0x60, 0xc2, 0x1e, 0x10, 0x1b, 0x73, 0x00, 0x6a, 0x1c, 0x61, 0x82, 0x34, 0x82, 0x34, 0xcc, 0xec, 0x03, 0x2c, 0x00, 0xf2, 0x00, 0x68, 0x02, 0x10, 0x20, 0xf2, 0x00, 0x68, 0xa0, 0xf1, 0x06, 0x6c, 0x00, 0x18, 0xec, 0x3a, 0xb0, 0x67, 0x01, 0x6a, 0x04, 0xd2, 0x04, 0x6c, 0x10, 0xb2, 0xfa, 0x6d, 0x02, 0xf3, 0x08, 0x6e, 0xa1, 0xf1, 0x14, 0x6f, 0x05, 0xd2, 0x20, 0x18, 0x00, 0x2d, 0x06, 0xd0, 0x01, 0x6a, 0x09, 0x97, 0x08, 0x90, 0x00, 0xef, 0x05, 0x63, 0x09, 0xb4, 0x72, 0x17, 0xbc, 0x4f, 0x11, 0x80, 0xb4, 0x54, 0x11, 0x80, 0x5c, 0x07, 0x11, 0x80, 0x0c, 0x50, 0x11, 0x80, 0xf0, 0x4b, 0x11, 0x80, 0x56, 0x07, 0x11, 0x80, 0xf8, 0x94, 0x11, 0x80, 0x00, 0xd9, 0x04, 0x80, 0x10, 0x4c, 0x11, 0x80, 0xfd, 0x63, 0x05, 0x62, 0xff, 0x6d, 0x00, 0x18, 0x23, 0x8c, 0xcc, 0xed, 0x05, 0x97, 0x00, 0xef, 0x03, 0x63, 0x00, 0x65, 0xfd, 0x63, 0x05, 0x62, 0x1f, 0xb2, 0x20, 0xb3, 0x63, 0xa3, 0x20, 0xb4, 0x40, 0x9a, 0x7e, 0x33, 0x60, 0x33, 0x60, 0x33, 0x8c, 0xea, 0x6d, 0xea, 0x1d, 0xb3, 0xe0, 0xf1, 0x63, 0xa3, 0x01, 0x6c, 0x8c, 0xeb, 0x05, 0x23, 0x1b, 0xb3, 0x6c, 0xea, 0x1b, 0xb3, 0x6d, 0xea, 0x04, 0x10, 0x1b, 0xb3, 0x6d, 0xea, 0x1b, 0xb3, 0x6c, 0xea, 0x13, 0xb3, 0x40, 0xdb, 0x1a, 0xb2, 0x1a, 0xb3, 0x63, 0xda, 0x1a, 0xb3, 0x72, 0xda, 0x1a, 0xb3, 0x75, 0xda, 0x1a, 0xb3, 0x69, 0xda, 0x1a, 0xb3, 0x6c, 0xda, 0x1a, 0xb3, 0x6f, 0xda, 0x1a, 0xb3, 0x66, 0xda, 0x1a, 0xb3, 0x7b, 0xda, +0x1a, 0xb3, 0x60, 0xda, 0x1a, 0xb3, 0x80, 0x18, 0x76, 0x28, 0x78, 0xda, 0x19, 0xb3, 0x1a, 0xb2, 0x60, 0xda, 0x1a, 0xb3, 0x1a, 0xb2, 0x80, 0x18, 0x6b, 0x2e, 0x60, 0xda, 0x05, 0x97, 0x00, 0xef, 0x03, 0x63, 0x00, 0x65, 0x74, 0xa0, 0x00, 0xb0, 0x6c, 0x3a, 0x11, 0x80, 0xff, 0xff, 0xfe, 0xff, 0x58, 0x00, 0x11, 0x80, 0xff, 0xff, 0xfb, 0xff, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x04, 0x00, 0xff, 0xff, 0xef, 0xff, 0xc4, 0x88, 0x11, 0x80, 0x91, 0xcb, 0x10, 0x80, 0x9d, 0xd9, 0x10, 0x80, 0x8d, 0xd9, 0x10, 0x80, 0x7d, 0xd9, 0x10, 0x80, 0x6d, 0xd9, 0x10, 0x80, 0x99, 0xd8, 0x10, 0x80, 0x89, 0xd8, 0x10, 0x80, 0xd5, 0xd7, 0x10, 0x80, 0x9d, 0xd7, 0x10, 0x80, 0x7d, 0xd7, 0x10, 0x80, 0xa1, 0xcf, 0x10, 0x80, 0x00, 0x2e, 0x11, 0x80, 0x89, 0xcd, 0x10, 0x80, 0xb4, 0x1d, 0x11, 0x80, 0xfd, 0x63, 0x05, 0x62, 0x04, 0xd0, 0x00, 0x6b, 0x29, 0xb2, 0x80, 0x18, 0x76, 0x28, 0x60, 0xc2, 0x28, 0xb2, 0xc0, 0xf1, 0x1f, 0xa2, 0xff, 0x6c, 0x12, 0x6b, 0xd0, 0x67, 0x8c, 0xee, 0x01, 0x6d, 0xe0, 0xf0, 0x62, 0xc2, 0x78, 0xaa, 0xce, 0x32, 0xac, 0xea, 0x50, 0x37, 0x11, 0x6a, 0x4b, 0xea, 0x6c, 0xea, 0xd2, 0x33, 0xac, 0xeb, 0xed, 0xea, 0x60, 0x33, 0xff, 0xf5, 0x1e, 0x4d, 0x64, 0x33, 0xac, 0xea, 0x6d, 0xea, 0x07, 0x6b, 0x0c, 0xeb, 0x8c, 0xeb, 0x04, 0x53, 0x04, 0x61, 0x07, 0x6b, 0x6b, 0xeb, 0x4c, 0xeb, 0x07, 0x10, 0x03, 0x6c, 0x6c, 0xec, 0x84, 0x33, 0x07, 0x6c, 0x8b, 0xec, 0x4c, 0xec, 0x8d, 0xeb, 0x13, 0xb2, 0x78, 0xca, 0xff, 0x6b, 0x6c, 0xe8, 0x07, 0x6a, 0x0c, 0xea, 0x6c, 0xea, 0x03, 0x22, 0x00, 0x18, 0x79, 0x24, 0x00, 0x6c, 0x1e, 0x30, 0x12, 0x20, 0x00, 0x68, 0x00, 0x18, 0x2f, 0x1c, 0x01, 0x6c, 0x00, 0x18, 0x79, 0x24, 0x01, 0x6c, 0x00, 0x18, 0x2f, 0x1c, 0x01, 0x6c, 0x00, 0x18, 0x79, 0x24, 0x00, 0x6c, 0x01, 0x48, 0xff, 0x6a, 0x4c, 0xe8, 0x04, 0x58, 0xef, 0x61, 0x05, 0x97, 0x04, 0x90, 0x00, 0xef, 0x03, 0x63, 0x00, 0x65, 0x64, 0x94, 0x11, 0x80, 0x58, 0x00, 0x11, 0x80, 0xfb, 0x63, 0x09, 0x62, 0x08, 0xd0, 0x17, 0xb2, 0xc0, 0xf1, 0x1f, 0xa2, 0x07, 0x6a, 0x0c, 0xea, 0x22, 0x22, 0x00, 0x18, 0x79, 0x24, 0x01, 0x6c, 0xff, 0x6a, 0x4c, 0xe8, 0x16, 0x30, 0x03, 0x6a +, 0x4c, 0xe8, 0x14, 0x6c, 0x00, 0x18, 0x20, 0x25, 0x84, 0xe8, 0x0f, 0xb2, 0x60, 0x9a, 0x24, 0x6a, 0x05, 0x6c, 0x58, 0xeb, 0x0d, 0xb3, 0xfa, 0x6d, 0xa1, 0xf3, 0x16, 0x6e, 0x01, 0xf0, 0x0c, 0x6f, 0x12, 0xea, 0x49, 0xe3, 0x0a, 0xb3, 0x63, 0xda, 0x00, 0x6a, 0x0a, 0xb3, 0x04, 0xd2, 0x05, 0xd3, 0x20, 0x18, 0x00, 0x2d, 0x06, 0xd2, 0x09, 0x97, 0x08, 0x90, 0x00, 0xef, 0x05, 0x63, 0x00, 0x65, 0x58, 0x00, 0x11, 0x80, 0x34, 0x00, 0x11, 0x80, 0x4c, 0x8a, 0x11, 0x80, 0xf9, 0xc9, 0x10, 0x80, 0x00, 0xd9, 0x04, 0x80, 0xfb, 0x63, 0x09, 0x62, 0x08, 0xd1, 0x07, 0xd0, 0x16, 0xb2, 0xc0, 0xf1, 0x7f, 0xa2, 0x07, 0x6a, 0xff, 0xf7, 0x1f, 0x68, 0x6c, 0xea, 0x0a, 0xd4, 0x0b, 0xd5, 0x0d, 0xd7, 0xcc, 0xe8, 0x15, 0x22, 0x11, 0xb1, 0x00, 0x1c, 0x5e, 0x1b, 0x00, 0x65, 0x60, 0xa1, 0x0c, 0x23, 0x00, 0x18, 0x43, 0x35, 0x04, 0xd2, 0x0e, 0xb3, 0x80, 0xa3, 0x1e, 0x6b, 0x04, 0x92, 0x8c, 0xeb, 0x06, 0x6c, 0x8e, 0xeb, 0x01, 0x2b, 0x60, 0xc1, 0x00, 0x1c, 0x65, 0x1b, 0x82, 0x67, 0x0d, 0x97, 0x0a, 0x94, 0x0b, 0x95, 0x00, 0x18, 0x42, 0x20, 0xd0, 0x67, 0x09, 0x97, 0x08, 0x91, 0x07, 0x90, 0x00, 0xef, 0x05, 0x63, 0x58, 0x00, 0x11, 0x80, 0xc2, 0x06, 0x11, 0x80, 0xe0, 0x1e, 0x11, 0x80, 0xfd, 0x63, 0x05, 0x62, 0x04, 0xd0, 0x00, 0x1c, 0x5e, 0x1b, 0x00, 0x65, 0x02, 0x67, 0x0f, 0xb2, 0x60, 0x9a, 0x0f, 0xb2, 0x00, 0x6c, 0x6e, 0xea, 0x02, 0x2a, 0x0e, 0xb2, 0x80, 0x9a, 0x0e, 0xb3, 0x82, 0x34, 0x82, 0x34, 0x40, 0x9b, 0xff, 0xf7, 0x1f, 0x6d, 0x80, 0x34, 0xac, 0xea, 0x80, 0x34, 0x8d, 0xea, 0x40, 0xdb, 0x00, 0x18, 0x2c, 0x26, 0x00, 0x6c, 0x00, 0x1c, 0x65, 0x1b, 0x90, 0x67, 0x05, 0x97, 0x04, 0x90, 0x00, 0xef, 0x03, 0x63, 0x58, 0x8b, 0x10, 0x80, 0x32, 0x97, 0x79, 0x23, 0x5c, 0x8b, 0x10, 0x80, 0x30, 0x00, 0x00, 0xb5, 0xfb, 0x63, 0x09, 0x62, 0x08, 0xd1, 0x07, 0xd0, 0x18, 0xb2, 0x19, 0xb3, 0x63, 0xea, 0x26, 0x61, 0x18, 0xb2, 0x80, 0x9a, 0x18, 0xb3, 0x8e, 0xeb, 0x21, 0x2b, 0x02, 0xaa, 0x17, 0xb5, 0x1d, 0x10, 0x17, 0xb4, 0x42, 0x45, 0x43, 0xec, 0x1a, 0x61, 0xc0, 0xa2, 0xff, 0xf7, 0x1f, 0x6f, 0x43, 0x46, 0x43, 0xe8, 0x14, 0x61, 0x45, 0xe5, 0x23, 0xec, 0x11, 0x61, 0x81, +0xa5, 0x60, 0xa5, 0x80, 0x34, 0x6d, 0xec, 0xec, 0xec, 0xe0, 0xf3, 0x14, 0x5c, 0x09, 0x60, 0x43, 0xe0, 0x0d, 0xb2, 0x03, 0x4d, 0x91, 0xe2, 0x00, 0x18, 0x27, 0x33, 0xec, 0xe8, 0xb1, 0x67, 0xe2, 0x28, 0x09, 0x97, 0x08, 0x91, 0x07, 0x90, 0x00, 0xef, 0x05, 0x63, 0x00, 0x65, 0xf0, 0xff, 0x10, 0x80, 0x94, 0xde, 0x10, 0x80, 0x98, 0xde, 0x10, 0x80, 0x55, 0xab, 0x23, 0x87, 0x9e, 0xde, 0x10, 0x80, 0xff, 0xff, 0x10, 0x80, 0x58, 0x00, 0x11, 0x80, 0xfd, 0x63, 0x05, 0x62, 0x04, 0x6c, 0x00, 0x18, 0x46, 0xa4, 0x00, 0x6d, 0x20, 0x6b, 0x4d, 0xeb, 0xff, 0xf7, 0x1f, 0x6e, 0x6c, 0xee, 0x00, 0x6d, 0x00, 0x18, 0xa4, 0xa4, 0x04, 0x6c, 0x00, 0x18, 0x2a, 0x1c, 0x50, 0x6c, 0x04, 0x6c, 0x00, 0x18, 0x46, 0xa4, 0x00, 0x6d, 0x05, 0x97, 0x1f, 0x6b, 0x6c, 0xea, 0x00, 0xef, 0x03, 0x63, 0x00, 0x65, 0xfc, 0x63, 0x07, 0x62, 0x06, 0xd1, 0x05, 0xd0, 0x4e, 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, 0x02, 0x61, 0x06, 0x6b, 0x60, 0xc2, 0x23, 0xb2, 0xa0, 0xa2, 0x1d, 0xb2, 0x63, 0xa2, 0x07 +, 0x6c, 0x72, 0x36, 0x8c, 0xee, 0xc2, 0xed, 0x06, 0x60, 0x8c, 0xed, 0x88, 0x4c, 0xb0, 0x35, 0x6c, 0xec, 0xad, 0xec, 0x83, 0xc2, 0x16, 0xb2, 0x43, 0xa2, 0x07, 0x6b, 0x02, 0x6c, 0x52, 0x32, 0x6c, 0xea, 0x61, 0x42, 0x8b, 0xec, 0x8c, 0xeb, 0x18, 0xb4, 0x20, 0xf1, 0x16, 0x4b, 0xff, 0xf7, 0x1f, 0x68, 0x8d, 0xe3, 0x20, 0xab, 0x01, 0x6b, 0x4c, 0xeb, 0x6c, 0x33, 0x02, 0x6c, 0x00, 0x6d, 0x0c, 0xe9, 0x00, 0x18, 0x46, 0xa4, 0x27, 0xeb, 0x1f, 0xf7, 0x01, 0x6b, 0x0c, 0xea, 0x6b, 0xeb, 0x0c, 0xe9, 0x6c, 0xea, 0x20, 0x31, 0x0c, 0xe9, 0xc2, 0x67, 0x02, 0x6c, 0x00, 0x6d, 0x00, 0x18, 0xa4, 0xa4, 0x2d, 0xee, 0x07, 0x97, 0x06, 0x91, 0x05, 0x90, 0x00, 0xef, 0x04, 0x63, 0x28, 0x94, 0x11, 0x80, 0xba, 0x01, 0x00, 0xb6, 0x58, 0x00, 0x11, 0x80, 0xc0, 0x50, 0x11, 0x80, 0x00, 0x1b, 0x11, 0x80, 0x7c, 0x04, 0x11, 0x80, 0x00, 0x00, 0x00, 0xb6, 0xfc, 0x63, 0x07, 0x62, 0x06, 0xd1, 0x05, 0xd0, 0x00, 0x68, 0x24, 0x67, 0x04, 0x32, 0x49, 0xe1, 0x60, 0xaa, 0xff, 0xf7, 0x1f, 0x73, 0x29, 0x60, 0x1e, 0xf0, 0x00, 0x6a, 0x6c, 0xea, 0x0c, 0xf0, 0x00, 0x72, 0x07, 0x61, 0x41, 0x40, 0x44, 0x32, 0x49, 0xe1, 0x00, 0x18, 0x2a, 0x1c, 0x80, 0xaa, 0x18, 0x10, 0x04, 0xf0, 0x00, 0x72, 0x0b, 0x61, 0xff, 0x6c, 0x8c, 0xeb, 0x40, 0x6a, 0x67, 0x33, 0x4d, 0xeb, 0x41, 0x40, 0x44, 0x32, 0x49, 0xe1, 0x6c, 0xec, 0x01, 0x6d, 0x07, 0x10, 0x0d, 0x2a, 0x41, 0x40, 0x44, 0x32, 0xff, 0x6c, 0x49, 0xe1, 0x6c, 0xec, 0x00, 0x6d, 0x00, 0x18, 0xa4, 0xa4, 0xc0, 0xaa, 0x02, 0x48, 0xff, 0x6a, 0x4c, 0xe8, 0xd1, 0x17, 0x07, 0x97, 0x06, 0x91, 0x05, 0x90, 0x00, 0xef, 0x04, 0x63, 0xf9, 0x63, 0x0d, 0x62, 0x0c, 0xd1, 0x0b, 0xd0, 0xff, 0x68, 0x00, 0x6e, 0x8c, 0xe8, 0x01, 0x6d, 0x00, 0x18, 0xa4, 0xa4, 0x40, 0x6c, 0x5a, 0x6c, 0x00, 0x18, 0x46, 0xa4, 0x01, 0x6d, 0x5c, 0x6c, 0x01, 0x6d, 0x00, 0x18, 0x46, 0xa4, 0x22, 0x67, 0xff, 0xf7, 0x1f, 0x6b, 0x6c, 0xe9, 0xff, 0xf7, 0x1e, 0x6e, 0x6c, 0xea, 0x5a, 0x6c, 0x01, 0x6d, 0x2c, 0xee, 0x08, 0xd2, 0x00, 0x18, 0xa4, 0xa4, 0x09, 0xd3, 0x08, 0x92, 0x09, 0x93, 0x03, 0x6e, 0x4d, 0xee, 0x5c, 0x6c, 0x01, 0x6d, 0x00, 0x18, 0xa4, 0xa4, 0x6c, 0xee, 0x42, 0xb4, +0x80, 0x18, 0x9f, 0x34, 0x00, 0x65, 0x06, 0x20, 0x90, 0x67, 0x00, 0x18, 0x2f, 0x1c, 0x00, 0x68, 0x70, 0x67, 0x24, 0x10, 0x01, 0x6d, 0xc5, 0x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18, 0x00, 0x2d, 0x04, 0xd2, 0x09, 0x93, 0x02, 0x6a, 0x04, 0xd2, 0x05, 0xd3, 0x08, 0x93, 0xff, 0xf7, 0x1f, 0x6a, 0x05, 0x6c, 0x6c, 0xea, 0xfa, 0x6d, 0xa1, 0xf1, 0x17, 0x6e, 0x44, 0xf5, 0x18, 0x6f, 0x06, 0xd1, 0x20, 0x18, 0x00, 0x2d, 0x07, 0xd2, 0x51, 0x67, 0x0d, 0x97, 0x0c, 0x91, 0x0b, 0x90, 0x00, 0xef, 0x07, 0x63, 0xd4, 0xdd, 0x10, 0x80, 0x68, 0xde, 0x10, 0x80, 0x00, 0xd9, 0x04, 0x80, 0xf5, 0x63, 0x15, 0x62, 0x14, 0xd1, 0x13, 0xd0, 0x02, 0x6c, 0x00, 0x18, 0x46, 0xa4, 0x00, 0x6d, 0x3f, 0x6c, 0x00, 0x6d, 0x00, 0x18, 0x46, 0xa4, 0x11, 0xd2, 0x11, 0x93, 0xff, 0x69, 0x2c, 0xea, 0xff, 0xf7, 0x1f, 0x68, 0x0c, 0xd2, 0x0c, 0xeb, 0x0c, 0x95, 0x62, 0x33, 0x2c, 0xeb, 0x01, 0x6a, 0xc3, 0x67, 0x82, 0x67, 0xe2, 0x67, 0x11, 0xd3, 0x80, 0x18, 0xbc, 0x34, 0x04, 0xd2, 0x11, 0x93, 0x0c, 0x95 +, 0x03, 0x6a, 0xc3, 0x67, 0x00, 0x6c, 0x0f, 0x6f, 0x80, 0x18, 0xbc, 0x34, 0x04, 0xd2, 0x42, 0x34, 0x1f, 0x6d, 0x11, 0x93, 0x8a, 0x34, 0x56, 0x32, 0xac, 0xec, 0xac, 0xea, 0x0c, 0x95, 0x03, 0x6e, 0x0b, 0xd4, 0x04, 0xd6, 0x00, 0x6c, 0xc3, 0x67, 0x0f, 0x6f, 0x80, 0x18, 0xbc, 0x34, 0x0a, 0xd2, 0x42, 0x37, 0x0b, 0x96, 0x1f, 0x6c, 0xea, 0x37, 0x56, 0x35, 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x37, 0xe3, 0x37, 0x12, 0xed, 0xf8, 0xef, 0x12, 0xef, 0xf5, 0xe5, 0x0c, 0xed, 0x10, 0x60, 0xc3, 0xed, 0x07, 0x60, 0x09, 0x95, 0x08, 0x96, 0xb1, 0xe4, 0x87, 0x34, 0x0c, 0xec, 0xcd, 0xe3, 0x13, 0x10, 0x0b, 0x97, 0x0a, 0x95, 0xf1, 0xe4, 0x87, 0x34, 0x0c, 0xec, 0xad, 0xe3, 0x0c, 0x10, 0x11, 0x5d, 0x04, 0x61, 0x00, 0x6c, 0x11, 0x69, 0x10, 0x6b, 0x0f, 0x10, 0x09, 0x96, 0x08, 0x97, 0xd1, 0xe4, 0x87, 0x34, 0x0c, 0xec, 0xed, 0xe3, 0x67, 0x35, 0x0c, 0xed, 0xff, 0xf7, 0x1f, 0x6b, 0xff, 0xf7, 0x1f, 0x69, 0x8c, 0xeb, 0xac, 0xe9, 0x01, 0x6c, 0x1f, 0x68, 0x4c, 0xe8, 0x08, +0x24, 0x10, 0xf0, 0x00, 0x6a, 0x4b, 0xea, 0x4d, 0xe8, 0xff, 0xf7, 0x1f, 0x6a, 0x4c, 0xe8, 0x11, 0x10, 0x01, 0x6d, 0xc5, 0x67, 0x00, 0x6c, 0x00, 0x18, 0xa4, 0xa4, 0x11, 0xd3, 0x46, 0x6c, 0x01, 0x6d, 0x00, 0x18, 0xa4, 0xa4, 0x00, 0x6e, 0x00, 0x6c, 0x01, 0x6d, 0x00, 0x18, 0xa4, 0xa4, 0xc4, 0x67, 0x11, 0x93, 0x60, 0x33, 0x68, 0x33, 0x34, 0x31, 0x6d, 0xe9, 0x0d, 0xe9, 0x20, 0x36, 0xc0, 0x36, 0xc3, 0x36, 0xff, 0xf7, 0x1f, 0x6a, 0xc3, 0x36, 0x4c, 0xee, 0x21, 0x6c, 0x00, 0x18, 0xa4, 0xa4, 0x00, 0x6d, 0x0e, 0x6c, 0x00, 0x18, 0x46, 0xa4, 0x00, 0x6d, 0x21, 0x6c, 0x00, 0x6d, 0x00, 0x18, 0x46, 0xa4, 0x02, 0x67, 0x02, 0x6b, 0x04, 0xd3, 0x01, 0x6c, 0x08, 0xb3, 0xfa, 0x6d, 0x01, 0xf2, 0x16, 0x6e, 0xa4, 0xf3, 0x0d, 0x6f, 0x06, 0xd0, 0x05, 0xd3, 0x20, 0x18, 0x00, 0x2d, 0x07, 0xd2, 0x15, 0x97, 0x14, 0x91, 0x13, 0x90, 0x00, 0xef, 0x0b, 0x63, 0x00, 0xd9, 0x04, 0x80, 0xfd, 0x63, 0x05, 0x62, 0x1d, 0xb4, 0x00, 0x6d, 0x00, 0x18, 0x37, 0xa6, 0x5e, 0x6e, 0x1c, 0xb4, 0x00, 0x6d, 0x00, 0x18, 0x37, 0xa6, 0x5c, 0x6e, 0x80, 0x18, 0xde, 0x31, 0x00, 0x65, 0x00, 0x18, 0x0c, 0xa5, 0x00, 0x65, 0x00, 0x18, 0xed, 0xa4, 0x00, 0x65, 0x00, 0x18, 0x27, 0xa3, 0x00, 0x65, 0x00, 0x18, 0x31, 0xa3, 0x00, 0x65, 0x13, 0xb2, 0x40, 0x9a, 0x61, 0x42, 0x07, 0x23, 0x24, 0x6b, 0x78, 0xea, 0x11, 0xb3, 0x12, 0xea, 0x49, 0xe3, 0x10, 0xb3, 0x63, 0xda, 0x80, 0x18, 0x16, 0x35, 0x00, 0x65, 0x00, 0x6c, 0x01, 0x6d, 0x00, 0x18, 0xa4, 0xa4, 0x02, 0x6e, 0x57, 0x6c, 0x01, 0x6d, 0x00, 0x18, 0xa4, 0xa4, 0x10, 0x6e, 0x00, 0x6c, 0x01, 0x6d, 0x00, 0x18, 0xa4, 0xa4, 0xc4, 0x67, 0x05, 0x97, 0x00, 0xef, 0x03, 0x63, 0x00, 0x65, 0x4c, 0x02, 0x11, 0x80, 0x88, 0xdc, 0x10, 0x80, 0x90, 0x04, 0x11, 0x80, 0x4c, 0x8a, 0x11, 0x80, 0x21, 0xd1, 0x10, 0x80, 0xfb, 0x63, 0x09, 0x62, 0x08, 0xd1, 0x07, 0xd0, 0x04, 0x67, 0x00, 0x1c, 0x5e, 0x1b, 0x04, 0xd5, 0x14, 0xb4, 0x22, 0x67, 0x40, 0x9c, 0x04, 0x95, 0x01, 0x4a, 0x19, 0x22, 0xff, 0x6a, 0xac, 0xea, 0x01, 0x72, 0x04, 0x60, 0x20, 0x18, 0x9f, 0x2b, 0x90, 0x67, 0x11, 0x10, 0x00, 0x18, 0xb6, 0x1c, 0x00, 0x65, 0x01, 0x6b, 0x6b, 0xeb, 0x0c, 0xb2, 0x60 +, 0xc2, 0x0c, 0xb2, 0x01, 0x6b, 0x40, 0x9a, 0x6c, 0xea, 0x05, 0x2a, 0x0a, 0xb3, 0x0b, 0xb4, 0x40, 0x9b, 0x8d, 0xea, 0x40, 0xdb, 0x00, 0x1c, 0x65, 0x1b, 0x91, 0x67, 0x09, 0x97, 0x08, 0x91, 0x07, 0x90, 0x00, 0xef, 0x05, 0x63, 0x00, 0x65, 0x0c, 0x06, 0x11, 0x80, 0x10, 0x06, 0x11, 0x80, 0x50, 0x60, 0x00, 0xb0, 0x40, 0xa0, 0x00, 0xb0, 0x00, 0x00, 0x80, 0x00, 0xfd, 0x63, 0x05, 0x62, 0x44, 0xac, 0xe0, 0xf3, 0x0a, 0x72, 0x04, 0x61, 0x00, 0x18, 0x31, 0xeb, 0x00, 0x65, 0x03, 0x10, 0x00, 0x18, 0xc4, 0xf1, 0x00, 0x65, 0x05, 0x97, 0x00, 0xef, 0x03, 0x63, 0xfd, 0x63, 0x05, 0x62, 0x00, 0x18, 0xa5, 0x39, 0x00, 0x65, 0x09, 0xb2, 0x40, 0x9a, 0x61, 0x42, 0x07, 0x23, 0x24, 0x6b, 0x78, 0xea, 0x07, 0xb3, 0x12, 0xea, 0x49, 0xe3, 0x06, 0xb3, 0x63, 0xda, 0x80, 0x18, 0x30, 0x30, 0x00, 0x65, 0x05, 0x97, 0x00, 0xef, 0x03, 0x63, 0x90, 0x04, 0x11, 0x80, 0x4c, 0x8a, 0x11, 0x80, 0x21, 0xd1, 0x10, 0x80, 0xf9, 0x63, 0x0d, 0x62, 0x0c, 0xd1, 0x0b, 0xd0, 0x44, 0xac, 0x04, 0x67, 0x20, 0x9c, 0x01, 0x72, 0x1e, 0x61, 0x02, 0x6a, 0x04, 0xd2, 0x21, 0xb2, 0x05, 0xd2, 0x06, 0xd1, 0x41, 0x9c, 0xfa, 0x6d, 0x04, 0x6c, 0xc0, 0xf5, 0x03, 0x6e, 0x41, 0xf5, 0x0e, 0x6f, 0x20, 0x18, 0x00, 0x2d, 0x07, 0xd2, 0x3f, 0x6a, 0x2c, 0xea, 0x30, 0x72, 0x28, 0x61, 0x41, 0xa8, 0xff, 0x6b, 0x6c, 0xea, 0x24, 0x2a, 0x17, 0xb3, 0x40, 0xdb, 0x17, 0xb3, 0x40, 0xdb, 0x17, 0xb3, 0x40, 0xdb, 0x1d, 0x10, 0x17, 0xb2, 0x60, 0xa2, 0x1a, 0x2b, 0x02, 0x6a, 0x04, 0xd2, 0x10, 0xb2, 0x05, 0xd2, 0x06, 0xd1, 0x41, 0x9c, 0xfa, 0x6d, 0x05, 0x6c, 0xe0, 0xf5, 0x0d, 0x6e, 0x41, 0xf5, 0x0f, 0x6f, 0x08, 0xd3, 0x20, 0x18, 0x00, 0x2d, 0x07, 0xd2, 0x0e, 0xb2, 0x40, 0xa2, 0x08, 0x93, 0x06, 0x22, 0x40, 0xa0, 0x30, 0x72, 0x03, 0x60, 0x0c, 0xb2, 0x60, 0xda, 0x03, 0x10, 0x00, 0x18, 0x2f, 0x31, 0x90, 0x67, 0x0d, 0x97, 0x0c, 0x91, 0x0b, 0x90, 0x00, 0xef, 0x07, 0x63, 0x00, 0xd9, 0x04, 0x80, 0x4c, 0x8b, 0x10, 0x80, 0x54, 0x8b, 0x10, 0x80, 0x60, 0x8b, 0x10, 0x80, 0x57, 0x07, 0x11, 0x80, 0x60, 0x94, 0x11, 0x80, 0x58, 0x07, 0x11, 0x80, 0xfd, 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x11, 0x97, 0x10, 0x90, 0x00, 0xef, 0x09, 0x63, 0x00, 0x65, 0xc0, 0x50, 0x11, 0x80, 0x28, 0x1a, 0x11, 0x80, 0x23, 0x1a, 0x11, 0x80, 0xac, 0x00, 0x00, 0xb6, 0x84, 0x38, 0x11, 0x80, 0x68, 0x3a, 0x11, 0x80, 0x00, 0xd9, 0x04, 0x80, 0xb4, 0x54, 0x11, 0x80, 0xfd, 0x63, 0x05, 0x62, 0x00, 0x18, 0x6e, 0x5c, 0x00, 0x65, 0x05, 0x97, 0x00, 0xef, 0x03, 0x63, 0xfd, 0x63, 0x05, 0x62, 0x00, 0x18, 0x7b, 0x8d, 0x00, 0x65, 0x05, 0x97, 0x00, 0xef, 0x03, 0x63, 0xfd, 0x63, 0x05, 0x62, 0x00, 0x18, 0xef, 0x5c, 0x00, 0x65, 0x05, 0x97, 0x00, 0xef, 0x03, 0x63, 0xef, 0x63, 0x21, 0x62, 0x20, 0xd1, 0x1f, 0xd0, 0x44, 0xac, 0x24, 0x67, 0x60, 0xf2, 0x04, 0x72, 0x18, 0x61, 0xa3, 0xb2, 0x60, 0xf1, 0x52, 0xa2, 0xa0, 0xf0, 0x0b, 0x22, 0x00, 0x1c, 0x5e, 0x1b, 0x00, 0x65, 0x00, 0x18, 0x78, 0x58, 0x02, 0x67, 0x80, 0x18, 0x02, 0x29, 0x03, 0x6c, 0x00, 0x18, 0x11, 0x56, 0x00, 0x6c, 0x20, 0x18, 0x5d, 0x22, 0x00, 0x65, 0x00, 0x1c, 0x65, 0x1b, 0x90, 0x67, 0x28, 0x11, 0x60, 0xf4, 0x1f, 0x72, 0x80, 0xf0, 0x14, 0x61, 0x95, 0xb2 +, 0x41, 0x9a, 0xfe, 0x4a, 0x02, 0x5a, 0x80, 0xf0, 0x0e, 0x60, 0x40, 0x9c, 0x17, 0x05, 0x84, 0x42, 0x20, 0x18, 0x48, 0x21, 0x1c, 0xd2, 0x90, 0xb3, 0x80, 0xa3, 0x1c, 0x92, 0x8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1f, 0x90, 0x00, 0xef, 0x11, 0x63, 0xc0, 0x50, 0x11, 0x80, 0x58, 0x73, 0x11, 0x80, 0x59, 0x73, 0x11, 0x80, 0x64, 0x94, 0x11, 0x80, 0x68, 0x94, 0x11, 0x80, 0x40, 0x47, 0x11, 0x80, 0x00, 0xd9, 0x04, 0x80, 0x70, 0x3a, 0x11, 0x80, 0xb4, 0x54, 0x11, 0x80, 0x38, 0x47, 0x11, 0x80, 0x04, 0x0b, 0x0f, 0x04, 0x0a, 0x0e, 0x08, 0x0b, 0x0f, 0x00, 0x00, 0x00, 0x1b, 0x00, 0xb7, 0x00, 0x53, 0x01, 0x36, 0x00, 0x6f, 0x01, 0xa7, 0x02, 0x53, 0x00, 0x28, 0x02, 0xfd, 0x03, 0x25, 0x00, 0x07, 0x04, 0x05, 0x01, 0x00, 0x00, 0x00, 0x00, 0x74, 0x41, 0x01, 0x10, 0xac, 0x80, 0x02 +, 0xf0, 0x78, 0x41, 0x07, 0x20, 0x7a, 0x41, 0xb1, 0x01, 0x7c, 0x41, 0x07, 0x00, 0x7e, 0x41, 0xb1, 0x01, 0x0a, 0x22, 0x62, 0x02, 0x4e, 0x22, 0x9a, 0x06, 0x50, 0x22, 0x9a, 0x06, 0x18, 0x20, 0x0f, 0x69, 0x34, 0x20, 0x55, 0x22, 0x38, 0x20, 0xa8, 0xc0, 0x00, 0x00, 0x06, 0x10, 0x0e, 0x00, 0x22, 0x10, 0x16, 0x00, 0x00, 0x24, 0x16, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x20, 0x81, 0x25, 0x00, 0x93, 0x23, 0x2b, 0x00, 0x80, 0x48, 0x21, 0x00, 0x00, 0x42, 0x24, 0x00, 0x00, 0xfe, 0x26, 0x00, 0x2a, 0x08, 0x26, 0x00, 0x2a, 0x08, 0x27, 0x00, 0x60, 0x04, 0x28, 0x00, 0x42, 0xc0, 0x29, 0x00, 0x18, 0xc4, 0x2a, 0x00, 0xc0, 0x40, 0x2d, 0x00, 0x08, 0x00, 0x37, 0x00, 0x04, 0xc0, 0x0e, 0x00, 0x22, 0x90, 0x31, 0x00, 0x01, 0x50, 0x32, 0x00, 0x71, 0x00, 0x33, 0x00, 0x70, 0x6f, 0x0e, 0x00, 0xa2, 0x11, 0x2a, 0x00, 0xc0, 0x46, 0x24, 0x00, 0x01, 0xfe, 0x00, 0x60, 0x00, 0x01, 0x2a, 0x00, 0xd0, 0x40, 0x1c, 0x00, 0x21, 0x81, 0x00, 0x60, 0x01, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x60, 0x01, 0x00, 0x3f, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x20, 0xff, 0xff, 0xff, 0xff, 0x13, 0x00, 0x9b, 0x7d, 0x13, 0x00, 0x0e, 0x60, 0x13, 0x00, 0x9e, 0x5c, 0x13, 0x00, 0x0a, 0x30, 0x13, 0x00, 0xf8, 0x2f, 0x13, 0x00, 0xc5, 0x1f, 0x13, 0x00, 0x90, 0x00, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0xcb, 0x70, 0x20, 0x00, 0xc4, 0xff, 0x22, 0x00, 0x00, 0x00, 0x23, 0x00, 0x15, 0xe0, 0x15, 0x00, 0x40, 0x00, 0x15, 0x00, 0xc0, 0x20, 0x15, 0x00, 0xc0, 0x48, 0x15, 0x00, 0xc0, 0x69, 0x15, 0x00, 0xc0, 0x90, 0x15, 0x00, 0xc0, 0xb1, 0x15, 0x00, 0xc0, 0xd8, 0x15, 0x00, 0xc0, 0xf9, 0xff, 0xff, 0xff, 0xff, 0x08, 0x08, 0x08, 0x08, 0x08, 0x0b, 0x28, 0x2b, 0x48, 0x4b, 0xc8, 0xcc, 0xe9, 0xec, 0xee, 0xff, 0xf7, 0xf7, 0xf8, 0xf9, 0x07, 0x08, 0x0a, 0x0c, 0x0e, 0x1c, 0x1e, 0x1f, 0x1f, 0x00, 0x00, 0x00, 0xf7, 0xf7, 0x00, 0x00, 0x1f, 0x1f, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x50, 0x01, 0x00, 0x00, 0x17, 0x02, 0x00, +0x00, 0xe9, 0x3f, 0x00, 0x01, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x60, 0xf4, 0x01, 0x00, 0x20, 0x01, 0x00, 0x02, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x40, 0x20, 0x00, 0x48, 0x42, 0x20, 0x00, 0x01, 0x44, 0x20, 0x00, 0x48, 0x46, 0x20, 0x00, 0x81, 0x48, 0x20, 0x00, 0x00, 0x4a, 0x20, 0x00, 0xf8, 0x4c, 0x20, 0x00, 0x00, 0x4e, 0x20, 0xe8, 0x00, 0x50, 0x20, 0x50, 0xcc, 0x52, 0x20, 0x00, 0xc8, 0x54, 0x20, 0x10, 0x8c, 0x56, 0x20, 0x00, 0xe0, 0x58, 0x20, 0x00, 0x50, 0x5a, 0x20, 0x00, 0x80, 0x5c, 0x20, 0x00, 0x20, 0x5e, 0x20, 0x00, 0x28, 0x00, 0x20, 0x01, 0x00, 0x08, 0x20, 0x00, 0x14, 0x0e, 0x20, 0x01, 0x00, 0x02, 0x20, 0x60, 0xc0, 0x00, 0x60, 0x0a, 0x00, 0x02, 0x20, 0x20, 0xc0, 0x00, 0x60, 0x0a, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x20, 0x01, 0x00, 0x02, 0x20, 0x20, 0x00, 0x0c, 0x20, 0x10, 0x00, 0x0e, 0x20, 0x00, 0x80, 0x00, 0x20, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, 0x50, 0x6a, 0x6a, 0x92, 0x2a, 0x00, 0x00, 0xd1, 0x4d, 0x2f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, 0x01, 0x00, 0x51, 0x04, 0xfd, 0x77 +}; + +u32 CheckSum = 0xb228; +#endif //#ifdef CONFIG_MP_INCLUDED + + +#endif // end of DM_ODM_SUPPORT_TYPE & (ODM_AP) + + +#endif // end of HWIMG_SUPPORT + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_RF.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalHWImg8821A_FW.h old mode 100755 new mode 100644 similarity index 52% rename from backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_RF.h rename to backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalHWImg8821A_FW.h index 0fb74979b9d724..300af061f91fa8 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_RF.h +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalHWImg8821A_FW.h @@ -18,65 +18,59 @@ * ******************************************************************************/ -#if (RTL8812A_SUPPORT == 1) -#ifndef __INC_TC_RF_HW_IMG_8812A_H -#define __INC_TC_RF_HW_IMG_8812A_H +#if (RTL8821A_SUPPORT == 1) +#ifndef __INC_MP_FW_HW_IMG_8821A_H +#define __INC_MP_FW_HW_IMG_8821A_H -//static BOOLEAN CheckCondition(const u4Byte Condition, const u4Byte Hex); /****************************************************************************** -* RadioA.TXT +* FW_AP.TXT ******************************************************************************/ void -ODM_ReadAndConfig_TC_8812A_RadioA( // TC: Test Chip, MP: MP Chip - IN PDM_ODM_T pDM_Odm +ODM_ReadFirmware_MP_8821A_FW_AP( + IN PDM_ODM_T pDM_Odm, + OUT u1Byte *pFirmware, + OUT u4Byte *pFirmwareSize ); /****************************************************************************** -* RadioB.TXT +* FW_NIC.TXT ******************************************************************************/ void -ODM_ReadAndConfig_TC_8812A_RadioB( // TC: Test Chip, MP: MP Chip - IN PDM_ODM_T pDM_Odm +ODM_ReadFirmware_MP_8821A_FW_NIC( + IN PDM_ODM_T pDM_Odm, + OUT u1Byte *pFirmware, + OUT u4Byte *pFirmwareSize ); /****************************************************************************** -* TxPowerTrack_AP.TXT +* FW_NIC_BT.TXT ******************************************************************************/ void -ODM_ReadAndConfig_TC_8812A_TxPowerTrack_AP( // TC: Test Chip, MP: MP Chip - IN PDM_ODM_T pDM_Odm +ODM_ReadFirmware_MP_8821A_FW_NIC_BT( + IN PDM_ODM_T pDM_Odm, + OUT u1Byte *pFirmware, + OUT u4Byte *pFirmwareSize ); /****************************************************************************** -* TxPowerTrack_PCIE.TXT +* FW_WoWLAN.TXT ******************************************************************************/ void -ODM_ReadAndConfig_TC_8812A_TxPowerTrack_PCIE( // TC: Test Chip, MP: MP Chip - IN PDM_ODM_T pDM_Odm +ODM_ReadFirmware_MP_8821A_FW_WoWLAN( + IN PDM_ODM_T pDM_Odm, + OUT u1Byte *pFirmware, + OUT u4Byte *pFirmwareSize ); -/****************************************************************************** -* TxPowerTrack_USB.TXT -******************************************************************************/ - -void -ODM_ReadAndConfig_TC_8812A_TxPowerTrack_USB( // TC: Test Chip, MP: MP Chip - IN PDM_ODM_T pDM_Odm -); - -/****************************************************************************** -* TXPWR_LMT.TXT -******************************************************************************/ - -void -ODM_ReadAndConfig_TC_8812A_TXPWR_LMT( // TC: Test Chip, MP: MP Chip - IN PDM_ODM_T pDM_Odm -); +#ifdef CONFIG_MP_INCLUDED +#define Rtl8812BFwBTImgArrayLength 32112 +extern u8 Rtl8821A_BT_MP_Patch_FW [Rtl8812BFwBTImgArrayLength]; +#endif //CONFIG_MP_INCLUDED #endif #endif // end of HWIMG_SUPPORT diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalHWImg8821A_MAC.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalHWImg8821A_MAC.c new file mode 100644 index 00000000000000..933640bbbf6429 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalHWImg8821A_MAC.c @@ -0,0 +1,287 @@ +/****************************************************************************** +* +* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of version 2 of the GNU General Public License as +* published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +* +* You should have received a copy of the GNU General Public License along with +* this program; if not, write to the Free Software Foundation, Inc., +* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA +* +* +******************************************************************************/ + +#include "Mp_Precomp.h" +#include "../phydm_precomp.h" + +#if (RTL8821A_SUPPORT == 1) +static BOOLEAN +CheckPositive( + IN PDM_ODM_T pDM_Odm, + IN const u4Byte Condition1, + IN const u4Byte Condition2 + ) +{ + u1Byte _BoardType = ((pDM_Odm->BoardType & BIT4) >> 4) << 0 | // _GLNA + ((pDM_Odm->BoardType & BIT3) >> 3) << 1 | // _GPA + ((pDM_Odm->BoardType & BIT7) >> 7) << 2 | // _ALNA + ((pDM_Odm->BoardType & BIT6) >> 6) << 3 | // _APA + ((pDM_Odm->BoardType & BIT2) >> 2) << 4; // _BT + + u4Byte cond1 = Condition1, cond2 = Condition2; + u4Byte driver1 = pDM_Odm->CutVersion << 24 | + pDM_Odm->SupportPlatform << 16 | + pDM_Odm->PackageType << 12 | + pDM_Odm->SupportInterface << 8 | + _BoardType; + + u4Byte driver2 = pDM_Odm->TypeGLNA << 0 | + pDM_Odm->TypeGPA << 8 | + pDM_Odm->TypeALNA << 16 | + pDM_Odm->TypeAPA << 24; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, + ("===> [8812A] CheckPositive (cond1, cond2) = (0x%X 0x%X)\n", cond1, cond2)); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, + ("===> [8812A] CheckPositive (driver1, driver2) = (0x%X 0x%X)\n", driver1, driver2)); + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, + (" (Platform, Interface) = (0x%X, 0x%X)\n", pDM_Odm->SupportPlatform, pDM_Odm->SupportInterface)); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, + (" (Board, Package) = (0x%X, 0x%X)\n", pDM_Odm->BoardType, pDM_Odm->PackageType)); + + + //============== Value Defined Check ===============// + //QFN Type [15:12] and Cut Version [27:24] need to do value check + + if(((cond1 & 0x0000F000) != 0) &&((cond1 & 0x0000F000) != (driver1 & 0x0000F000))) + return FALSE; + if(((cond1 & 0x0F000000) != 0) &&((cond1 & 0x0F000000) != (driver1 & 0x0F000000))) + return FALSE; + + //=============== Bit Defined Check ================// + // We don't care [31:28] and [23:20] + // + cond1 &= 0x000F0FFF; + driver1 &= 0x000F0FFF; + + if ((cond1 & driver1) == cond1) + { + u4Byte bitMask = 0; + if ((cond1 & 0x0F) == 0) // BoardType is DONTCARE + return TRUE; + + if ((cond1 & BIT0) != 0) //GLNA + bitMask |= 0x000000FF; + if ((cond1 & BIT1) != 0) //GPA + bitMask |= 0x0000FF00; + if ((cond1 & BIT2) != 0) //ALNA + bitMask |= 0x00FF0000; + if ((cond1 & BIT3) != 0) //APA + bitMask |= 0xFF000000; + + if ((cond2 & bitMask) == (driver2 & bitMask)) // BoardType of each RF path is matched + return TRUE; + else + return FALSE; + } + else + { + return FALSE; + } +} +static BOOLEAN +CheckNegative( + IN PDM_ODM_T pDM_Odm, + IN const u4Byte Condition1, + IN const u4Byte Condition2 + ) +{ + return TRUE; +} + +/****************************************************************************** +* MAC_REG.TXT +******************************************************************************/ + +u4Byte Array_MP_8821A_MAC_REG[] = { + 0x428, 0x0000000A, + 0x429, 0x00000010, + 0x430, 0x00000000, + 0x431, 0x00000000, + 0x432, 0x00000000, + 0x433, 0x00000001, + 0x434, 0x00000004, + 0x435, 0x00000005, + 0x436, 0x00000007, + 0x437, 0x00000008, + 0x43C, 0x00000004, + 0x43D, 0x00000005, + 0x43E, 0x00000007, + 0x43F, 0x00000008, + 0x440, 0x0000005D, + 0x441, 0x00000001, + 0x442, 0x00000000, + 0x444, 0x00000010, + 0x445, 0x00000000, + 0x446, 0x00000000, + 0x447, 0x00000000, + 0x448, 0x00000000, + 0x449, 0x000000F0, + 0x44A, 0x0000000F, + 0x44B, 0x0000003E, + 0x44C, 0x00000010, + 0x44D, 0x00000000, + 0x44E, 0x00000000, + 0x44F, 0x00000000, + 0x450, 0x00000000, + 0x451, 0x000000F0, + 0x452, 0x0000000F, + 0x453, 0x00000000, + 0x456, 0x0000005E, + 0x460, 0x00000066, + 0x461, 0x00000066, + 0x4C8, 0x0000003F, + 0x4C9, 0x000000FF, + 0x4CC, 0x000000FF, + 0x4CD, 0x000000FF, + 0x4CE, 0x00000001, + 0x500, 0x00000026, + 0x501, 0x000000A2, + 0x502, 0x0000002F, + 0x503, 0x00000000, + 0x504, 0x00000028, + 0x505, 0x000000A3, + 0x506, 0x0000005E, + 0x507, 0x00000000, + 0x508, 0x0000002B, + 0x509, 0x000000A4, + 0x50A, 0x0000005E, + 0x50B, 0x00000000, + 0x50C, 0x0000004F, + 0x50D, 0x000000A4, + 0x50E, 0x00000000, + 0x50F, 0x00000000, + 0x512, 0x0000001C, + 0x514, 0x0000000A, + 0x516, 0x0000000A, + 0x525, 0x0000004F, + 0x550, 0x00000010, + 0x551, 0x00000010, + 0x559, 0x00000002, + 0x55C, 0x00000050, + 0x55D, 0x000000FF, + 0x605, 0x00000030, + 0x607, 0x00000007, + 0x608, 0x0000000E, + 0x609, 0x0000002A, + 0x620, 0x000000FF, + 0x621, 0x000000FF, + 0x622, 0x000000FF, + 0x623, 0x000000FF, + 0x624, 0x000000FF, + 0x625, 0x000000FF, + 0x626, 0x000000FF, + 0x627, 0x000000FF, + 0x638, 0x00000050, + 0x63C, 0x0000000A, + 0x63D, 0x0000000A, + 0x63E, 0x0000000E, + 0x63F, 0x0000000E, + 0x640, 0x00000040, + 0x642, 0x00000040, + 0x643, 0x00000000, + 0x652, 0x000000C8, + 0x66E, 0x00000005, + 0x700, 0x00000021, + 0x701, 0x00000043, + 0x702, 0x00000065, + 0x703, 0x00000087, + 0x708, 0x00000021, + 0x709, 0x00000043, + 0x70A, 0x00000065, + 0x70B, 0x00000087, + 0x718, 0x00000040, + +}; + +void +ODM_ReadAndConfig_MP_8821A_MAC_REG( + IN PDM_ODM_T pDM_Odm + ) +{ + u4Byte i = 0; + u1Byte cCond; + BOOLEAN bMatched = TRUE, bSkipped = FALSE; +//ask by Luke.Lee + u4Byte ArrayLen = sizeof(Array_MP_8821A_MAC_REG)/sizeof(u4Byte); + pu4Byte Array = Array_MP_8821A_MAC_REG; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ReadAndConfig_MP_8821A_MAC_REG\n")); + + while(( i+1) < ArrayLen) + { + u4Byte v1 = Array[i]; + u4Byte v2 = Array[i+1]; + + if(v1 & (BIT31|BIT30)) //positive & negative condition + { + if(v1 & BIT31) // positive condition + { + cCond = (u1Byte)((v1 & (BIT29|BIT28)) >> 28); + if(cCond == COND_ENDIF) //end + { + bMatched = TRUE; + bSkipped = FALSE; + } + else if(cCond == COND_ELSE) //else + { + bMatched = bSkipped?FALSE:TRUE; + } + else //if , else if + { + if(bSkipped) + bMatched = FALSE; + else + { + if(CheckPositive(pDM_Odm, v1, v2)) + { + bMatched = TRUE; + bSkipped = TRUE; + } + else + { + bMatched = FALSE; + bSkipped = FALSE; + } + } + } + } + else if(v1 & BIT30){ //negative condition + //do nothing + } + } + else + { + if(bMatched) + odm_ConfigMAC_8821A(pDM_Odm, v1, (u1Byte)v2); + } + i = i + 2; + } +} + +u4Byte +ODM_GetVersion_MP_8821A_MAC_REG(void) +{ + return 44; +} + +#endif // end of HWIMG_SUPPORT + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_MAC.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalHWImg8821A_MAC.h old mode 100755 new mode 100644 similarity index 80% rename from backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_MAC.h rename to backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalHWImg8821A_MAC.h index 1f3a3f6264c323..2c8196a927f83d --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_MAC.h +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalHWImg8821A_MAC.h @@ -18,20 +18,20 @@ * ******************************************************************************/ -#if (RTL8812A_SUPPORT == 1) -#ifndef __INC_TC_MAC_HW_IMG_8812A_H -#define __INC_TC_MAC_HW_IMG_8812A_H +#if (RTL8821A_SUPPORT == 1) +#ifndef __INC_MP_MAC_HW_IMG_8821A_H +#define __INC_MP_MAC_HW_IMG_8821A_H -//static BOOLEAN CheckCondition(const u4Byte Condition, const u4Byte Hex); /****************************************************************************** * MAC_REG.TXT ******************************************************************************/ void -ODM_ReadAndConfig_TC_8812A_MAC_REG( // TC: Test Chip, MP: MP Chip +ODM_ReadAndConfig_MP_8821A_MAC_REG( // TC: Test Chip, MP: MP Chip IN PDM_ODM_T pDM_Odm ); +u4Byte ODM_GetVersion_MP_8821A_MAC_REG(void); #endif #endif // end of HWIMG_SUPPORT diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalHWImg8821A_RF.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalHWImg8821A_RF.c new file mode 100644 index 00000000000000..fbb45c5cbc260e --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalHWImg8821A_RF.c @@ -0,0 +1,4739 @@ +/****************************************************************************** +* +* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of version 2 of the GNU General Public License as +* published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +* +* You should have received a copy of the GNU General Public License along with +* this program; if not, write to the Free Software Foundation, Inc., +* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA +* +* +******************************************************************************/ + +#include "Mp_Precomp.h" +#include "../phydm_precomp.h" + +#if (RTL8821A_SUPPORT == 1) +static BOOLEAN +CheckPositive( + IN PDM_ODM_T pDM_Odm, + IN const u4Byte Condition1, + IN const u4Byte Condition2 + ) +{ + u1Byte _BoardType = ((pDM_Odm->BoardType & BIT4) >> 4) << 0 | // _GLNA + ((pDM_Odm->BoardType & BIT3) >> 3) << 1 | // _GPA + ((pDM_Odm->BoardType & BIT7) >> 7) << 2 | // _ALNA + ((pDM_Odm->BoardType & BIT6) >> 6) << 3 | // _APA + ((pDM_Odm->BoardType & BIT2) >> 2) << 4; // _BT + + u4Byte cond1 = Condition1, cond2 = Condition2; + u4Byte driver1 = pDM_Odm->CutVersion << 24 | + pDM_Odm->SupportPlatform << 16 | + pDM_Odm->PackageType << 12 | + pDM_Odm->SupportInterface << 8 | + _BoardType; + + u4Byte driver2 = pDM_Odm->TypeGLNA << 0 | + pDM_Odm->TypeGPA << 8 | + pDM_Odm->TypeALNA << 16 | + pDM_Odm->TypeAPA << 24; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, + ("===> [8812A] CheckPositive (cond1, cond2) = (0x%X 0x%X)\n", cond1, cond2)); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, + ("===> [8812A] CheckPositive (driver1, driver2) = (0x%X 0x%X)\n", driver1, driver2)); + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, + (" (Platform, Interface) = (0x%X, 0x%X)\n", pDM_Odm->SupportPlatform, pDM_Odm->SupportInterface)); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, + (" (Board, Package) = (0x%X, 0x%X)\n", pDM_Odm->BoardType, pDM_Odm->PackageType)); + + + //============== Value Defined Check ===============// + //QFN Type [15:12] and Cut Version [27:24] need to do value check + + if(((cond1 & 0x0000F000) != 0) &&((cond1 & 0x0000F000) != (driver1 & 0x0000F000))) + return FALSE; + if(((cond1 & 0x0F000000) != 0) &&((cond1 & 0x0F000000) != (driver1 & 0x0F000000))) + return FALSE; + + //=============== Bit Defined Check ================// + // We don't care [31:28] and [23:20] + // + cond1 &= 0x000F0FFF; + driver1 &= 0x000F0FFF; + + if ((cond1 & driver1) == cond1) + { + u4Byte bitMask = 0; + if ((cond1 & 0x0F) == 0) // BoardType is DONTCARE + return TRUE; + + if ((cond1 & BIT0) != 0) //GLNA + bitMask |= 0x000000FF; + if ((cond1 & BIT1) != 0) //GPA + bitMask |= 0x0000FF00; + if ((cond1 & BIT2) != 0) //ALNA + bitMask |= 0x00FF0000; + if ((cond1 & BIT3) != 0) //APA + bitMask |= 0xFF000000; + + if ((cond2 & bitMask) == (driver2 & bitMask)) // BoardType of each RF path is matched + return TRUE; + else + return FALSE; + } + else + { + return FALSE; + } +} +static BOOLEAN +CheckNegative( + IN PDM_ODM_T pDM_Odm, + IN const u4Byte Condition1, + IN const u4Byte Condition2 + ) +{ + return TRUE; +} + +/****************************************************************************** +* RadioA.TXT +******************************************************************************/ + +u4Byte Array_MP_8821A_RadioA[] = { + 0x018, 0x0001712A, + 0x056, 0x00051CF2, + 0x066, 0x00040000, + 0x000, 0x00010000, + 0x01E, 0x00080000, + 0x082, 0x00000830, + 0x083, 0x00021800, + 0x084, 0x00028000, + 0x085, 0x00048000, + 0x80000111,0x00000000,0x40000000,0x00000000, + 0x086, 0x0009483A, + 0xA0000000,0x00000000, + 0x086, 0x00094838, + 0xB0000000,0x00000000, + 0x087, 0x00044980, + 0x088, 0x00048000, + 0x089, 0x0000D480, + 0x08A, 0x00042240, + 0x08B, 0x000F0380, + 0x08C, 0x00090000, + 0x08D, 0x00022852, + 0x08E, 0x00065540, + 0x08F, 0x00088001, + 0x0EF, 0x00020000, + 0x03E, 0x00000380, + 0x03F, 0x00090018, + 0x03E, 0x00020380, + 0x03F, 0x000A0018, + 0x03E, 0x00040308, + 0x03F, 0x000A0018, + 0x03E, 0x00060018, + 0x03F, 0x000A0018, + 0x0EF, 0x00000000, + 0x018, 0x0001712A, + 0x089, 0x00000080, + 0x08B, 0x00080180, + 0x0EF, 0x00001000, + 0x03A, 0x00000244, + 0x03B, 0x00038027, + 0x03C, 0x00082000, + 0x03A, 0x00000244, + 0x03B, 0x00030113, + 0x03C, 0x00082000, + 0x03A, 0x0000014C, + 0x03B, 0x00028027, + 0x03C, 0x00082000, + 0x03A, 0x000000CC, + 0x03B, 0x00027027, + 0x03C, 0x00042000, + 0x03A, 0x0000014C, + 0x03B, 0x0001F913, + 0x03C, 0x00042000, + 0x03A, 0x0000010C, + 0x03B, 0x00017F10, + 0x03C, 0x00012000, + 0x03A, 0x000000D0, + 0x03B, 0x00008027, + 0x03C, 0x000CA000, + 0x03A, 0x00000244, + 0x03B, 0x00078027, + 0x03C, 0x00082000, + 0x03A, 0x00000244, + 0x03B, 0x00070113, + 0x03C, 0x00082000, + 0x03A, 0x0000014C, + 0x03B, 0x00068027, + 0x03C, 0x00082000, + 0x03A, 0x000000CC, + 0x03B, 0x00067027, + 0x03C, 0x00042000, + 0x03A, 0x0000014C, + 0x03B, 0x0005F913, + 0x03C, 0x00042000, + 0x03A, 0x0000010C, + 0x03B, 0x00057F10, + 0x03C, 0x00012000, + 0x03A, 0x000000D0, + 0x03B, 0x00048027, + 0x03C, 0x000CA000, + 0x03A, 0x00000244, + 0x03B, 0x000B8027, + 0x03C, 0x00082000, + 0x03A, 0x00000244, + 0x03B, 0x000B0113, + 0x03C, 0x00082000, + 0x03A, 0x0000014C, + 0x03B, 0x000A8027, + 0x03C, 0x00082000, + 0x03A, 0x000000CC, + 0x03B, 0x000A7027, + 0x03C, 0x00042000, + 0x03A, 0x0000014C, + 0x03B, 0x0009F913, + 0x03C, 0x00042000, + 0x03A, 0x0000010C, + 0x03B, 0x00097F10, + 0x03C, 0x00012000, + 0x03A, 0x000000D0, + 0x03B, 0x00088027, + 0x03C, 0x000CA000, + 0x0EF, 0x00000000, + 0x0EF, 0x00001100, + 0x80000111,0x00000000,0x40000000,0x00000000, + 0x034, 0x0004ADF3, + 0x034, 0x00049DF0, + 0x90000110,0x00000000,0x40000000,0x00000000, + 0x034, 0x0004ADF3, + 0x034, 0x00049DF0, + 0x90000210,0x00000000,0x40000000,0x00000000, + 0x034, 0x0004ADF5, + 0x034, 0x00049DF2, + 0x9000020c,0x00000000,0x40000000,0x00000000, + 0x034, 0x0004A0F3, + 0x034, 0x000490B1, + 0x9000040c,0x00000000,0x40000000,0x00000000, + 0x034, 0x0004A0F3, + 0x034, 0x000490B1, + 0x90000200,0x00000000,0x40000000,0x00000000, + 0x034, 0x0004ADF5, + 0x034, 0x00049DF2, + 0x90000410,0x00000000,0x40000000,0x00000000, + 0x034, 0x0004ADF3, + 0x034, 0x00049DF0, + 0xA0000000,0x00000000, + 0x034, 0x0004ADF7, + 0x034, 0x00049DF3, + 0xB0000000,0x00000000, + 0x80000111,0x00000000,0x40000000,0x00000000, + 0x034, 0x00048DED, + 0x034, 0x00047DEA, + 0x034, 0x00046DE7, + 0x034, 0x00045CE9, + 0x034, 0x00044CE6, + 0x034, 0x000438C6, + 0x034, 0x00042886, + 0x034, 0x00041486, + 0x034, 0x00040447, + 0x90000110,0x00000000,0x40000000,0x00000000, + 0x034, 0x00048DED, + 0x034, 0x00047DEA, + 0x034, 0x00046DE7, + 0x034, 0x00045CE9, + 0x034, 0x00044CE6, + 0x034, 0x000438C6, + 0x034, 0x00042886, + 0x034, 0x00041486, + 0x034, 0x00040447, + 0x9000020c,0x00000000,0x40000000,0x00000000, + 0x034, 0x000480AE, + 0x034, 0x000470AB, + 0x034, 0x0004608B, + 0x034, 0x00045069, + 0x034, 0x00044048, + 0x034, 0x00043045, + 0x034, 0x00042026, + 0x034, 0x00041023, + 0x034, 0x00040002, + 0x9000040c,0x00000000,0x40000000,0x00000000, + 0x034, 0x000480AE, + 0x034, 0x000470AB, + 0x034, 0x0004608B, + 0x034, 0x00045069, + 0x034, 0x00044048, + 0x034, 0x00043045, + 0x034, 0x00042026, + 0x034, 0x00041023, + 0x034, 0x00040002, + 0x90000410,0x00000000,0x40000000,0x00000000, + 0x034, 0x00048DED, + 0x034, 0x00047DEA, + 0x034, 0x00046DE7, + 0x034, 0x00045CE9, + 0x034, 0x00044CE6, + 0x034, 0x000438C6, + 0x034, 0x00042886, + 0x034, 0x00041486, + 0x034, 0x00040447, + 0xA0000000,0x00000000, + 0x034, 0x00048DEF, + 0x034, 0x00047DEC, + 0x034, 0x00046DE9, + 0x034, 0x00045CCB, + 0x034, 0x0004488D, + 0x034, 0x0004348D, + 0x034, 0x0004248A, + 0x034, 0x0004108D, + 0x034, 0x0004008A, + 0xB0000000,0x00000000, + 0x80000210,0x00000000,0x40000000,0x00000000, + 0x034, 0x0002ADF4, + 0x9000020c,0x00000000,0x40000000,0x00000000, + 0x034, 0x0002A0F3, + 0x9000040c,0x00000000,0x40000000,0x00000000, + 0x034, 0x0002A0F3, + 0x90000200,0x00000000,0x40000000,0x00000000, + 0x034, 0x0002ADF4, + 0xA0000000,0x00000000, + 0x034, 0x0002ADF7, + 0xB0000000,0x00000000, + 0x80000111,0x00000000,0x40000000,0x00000000, + 0x034, 0x00029DF4, + 0x90000110,0x00000000,0x40000000,0x00000000, + 0x034, 0x00029DF4, + 0x90000210,0x00000000,0x40000000,0x00000000, + 0x034, 0x00029DF1, + 0x9000020c,0x00000000,0x40000000,0x00000000, + 0x034, 0x000290F0, + 0x9000040c,0x00000000,0x40000000,0x00000000, + 0x034, 0x000290F0, + 0x90000200,0x00000000,0x40000000,0x00000000, + 0x034, 0x00029DF1, + 0x90000410,0x00000000,0x40000000,0x00000000, + 0x034, 0x00029DF4, + 0xA0000000,0x00000000, + 0x034, 0x00029DF2, + 0xB0000000,0x00000000, + 0x80000111,0x00000000,0x40000000,0x00000000, + 0x034, 0x00028DF1, + 0x034, 0x00027DEE, + 0x034, 0x00026DEB, + 0x034, 0x00025CEC, + 0x034, 0x00024CE9, + 0x034, 0x000238CA, + 0x034, 0x00022889, + 0x034, 0x00021489, + 0x034, 0x0002044A, + 0x90000110,0x00000000,0x40000000,0x00000000, + 0x034, 0x00028DF1, + 0x034, 0x00027DEE, + 0x034, 0x00026DEB, + 0x034, 0x00025CEC, + 0x034, 0x00024CE9, + 0x034, 0x000238CA, + 0x034, 0x00022889, + 0x034, 0x00021489, + 0x034, 0x0002044A, + 0x9000020c,0x00000000,0x40000000,0x00000000, + 0x034, 0x000280AF, + 0x034, 0x000270AC, + 0x034, 0x0002608B, + 0x034, 0x00025069, + 0x034, 0x00024048, + 0x034, 0x00023045, + 0x034, 0x00022026, + 0x034, 0x00021023, + 0x034, 0x00020002, + 0x9000040c,0x00000000,0x40000000,0x00000000, + 0x034, 0x000280AF, + 0x034, 0x000270AC, + 0x034, 0x0002608B, + 0x034, 0x00025069, + 0x034, 0x00024048, + 0x034, 0x00023045, + 0x034, 0x00022026, + 0x034, 0x00021023, + 0x034, 0x00020002, + 0x90000410,0x00000000,0x40000000,0x00000000, + 0x034, 0x00028DF1, + 0x034, 0x00027DEE, + 0x034, 0x00026DEB, + 0x034, 0x00025CEC, + 0x034, 0x00024CE9, + 0x034, 0x000238CA, + 0x034, 0x00022889, + 0x034, 0x00021489, + 0x034, 0x0002044A, + 0xA0000000,0x00000000, + 0x034, 0x00028DEE, + 0x034, 0x00027DEB, + 0x034, 0x00026CCD, + 0x034, 0x00025CCA, + 0x034, 0x0002488C, + 0x034, 0x0002384C, + 0x034, 0x00022849, + 0x034, 0x00021449, + 0x034, 0x0002004D, + 0xB0000000,0x00000000, + 0x8000020c,0x00000000,0x40000000,0x00000000, + 0x034, 0x0000A0D7, + 0x034, 0x000090D3, + 0x034, 0x000080B1, + 0x034, 0x000070AE, + 0x9000040c,0x00000000,0x40000000,0x00000000, + 0x034, 0x0000A0D7, + 0x034, 0x000090D3, + 0x034, 0x000080B1, + 0x034, 0x000070AE, + 0xA0000000,0x00000000, + 0x034, 0x0000ADF7, + 0x034, 0x00009DF4, + 0x034, 0x00008DF1, + 0x034, 0x00007DEE, + 0xB0000000,0x00000000, + 0x80000111,0x00000000,0x40000000,0x00000000, + 0x034, 0x00006DEB, + 0x034, 0x00005CEC, + 0x034, 0x00004CE9, + 0x034, 0x000038CA, + 0x034, 0x00002889, + 0x034, 0x00001489, + 0x034, 0x0000044A, + 0x90000110,0x00000000,0x40000000,0x00000000, + 0x034, 0x00006DEB, + 0x034, 0x00005CEC, + 0x034, 0x00004CE9, + 0x034, 0x000038CA, + 0x034, 0x00002889, + 0x034, 0x00001489, + 0x034, 0x0000044A, + 0x9000020c,0x00000000,0x40000000,0x00000000, + 0x034, 0x0000608D, + 0x034, 0x0000506B, + 0x034, 0x0000404A, + 0x034, 0x00003047, + 0x034, 0x00002044, + 0x034, 0x00001025, + 0x034, 0x00000004, + 0x9000040c,0x00000000,0x40000000,0x00000000, + 0x034, 0x0000608D, + 0x034, 0x0000506B, + 0x034, 0x0000404A, + 0x034, 0x00003047, + 0x034, 0x00002044, + 0x034, 0x00001025, + 0x034, 0x00000004, + 0x90000410,0x00000000,0x40000000,0x00000000, + 0x034, 0x00006DEB, + 0x034, 0x00005CEC, + 0x034, 0x00004CE9, + 0x034, 0x000038CA, + 0x034, 0x00002889, + 0x034, 0x00001489, + 0x034, 0x0000044A, + 0xA0000000,0x00000000, + 0x034, 0x00006DCD, + 0x034, 0x00005CCD, + 0x034, 0x00004CCA, + 0x034, 0x0000388C, + 0x034, 0x00002888, + 0x034, 0x00001488, + 0x034, 0x00000486, + 0xB0000000,0x00000000, + 0x0EF, 0x00000000, + 0x018, 0x0001712A, + 0x0EF, 0x00000040, + 0x80000111,0x00000000,0x40000000,0x00000000, + 0x035, 0x00000187, + 0x035, 0x00008187, + 0x035, 0x00010187, + 0x035, 0x00020188, + 0x035, 0x00028188, + 0x035, 0x00030188, + 0x035, 0x00040188, + 0x035, 0x00048188, + 0x035, 0x00050188, + 0x90000110,0x00000000,0x40000000,0x00000000, + 0x035, 0x00000187, + 0x035, 0x00008187, + 0x035, 0x00010187, + 0x035, 0x00020188, + 0x035, 0x00028188, + 0x035, 0x00030188, + 0x035, 0x00040188, + 0x035, 0x00048188, + 0x035, 0x00050188, + 0x90000210,0x00000000,0x40000000,0x00000000, + 0x035, 0x00000128, + 0x035, 0x00008128, + 0x035, 0x00010128, + 0x035, 0x000201C8, + 0x035, 0x000281C8, + 0x035, 0x000301C8, + 0x035, 0x000401C8, + 0x035, 0x000481C8, + 0x035, 0x000501C8, + 0x90000200,0x00000000,0x40000000,0x00000000, + 0x035, 0x00000128, + 0x035, 0x00008128, + 0x035, 0x00010128, + 0x035, 0x000201C8, + 0x035, 0x000281C8, + 0x035, 0x000301C8, + 0x035, 0x000401C8, + 0x035, 0x000481C8, + 0x035, 0x000501C8, + 0x90000410,0x00000000,0x40000000,0x00000000, + 0x035, 0x00000187, + 0x035, 0x00008187, + 0x035, 0x00010187, + 0x035, 0x00020188, + 0x035, 0x00028188, + 0x035, 0x00030188, + 0x035, 0x00040188, + 0x035, 0x00048188, + 0x035, 0x00050188, + 0xA0000000,0x00000000, + 0x035, 0x00000145, + 0x035, 0x00008145, + 0x035, 0x00010145, + 0x035, 0x00020196, + 0x035, 0x00028196, + 0x035, 0x00030196, + 0x035, 0x000401C7, + 0x035, 0x000481C7, + 0x035, 0x000501C7, + 0xB0000000,0x00000000, + 0x0EF, 0x00000000, + 0x018, 0x0001712A, + 0x0EF, 0x00000010, + 0x80000111,0x00000000,0x40000000,0x00000000, + 0x036, 0x00085733, + 0x036, 0x0008D733, + 0x036, 0x00095733, + 0x036, 0x0009D733, + 0x036, 0x000A64B4, + 0x036, 0x000AE4B4, + 0x036, 0x000B64B4, + 0x036, 0x000BE4B4, + 0x036, 0x000C64B4, + 0x036, 0x000CE4B4, + 0x036, 0x000D64B4, + 0x036, 0x000DE4B4, + 0x90000110,0x00000000,0x40000000,0x00000000, + 0x036, 0x00085733, + 0x036, 0x0008D733, + 0x036, 0x00095733, + 0x036, 0x0009D733, + 0x036, 0x000A64B4, + 0x036, 0x000AE4B4, + 0x036, 0x000B64B4, + 0x036, 0x000BE4B4, + 0x036, 0x000C64B4, + 0x036, 0x000CE4B4, + 0x036, 0x000D64B4, + 0x036, 0x000DE4B4, + 0x90000210,0x00000000,0x40000000,0x00000000, + 0x036, 0x000063B5, + 0x036, 0x0000E3B5, + 0x036, 0x000163B5, + 0x036, 0x0001E3B5, + 0x036, 0x000263B5, + 0x036, 0x0002E3B5, + 0x036, 0x000363B5, + 0x036, 0x0003E3B5, + 0x036, 0x000463B5, + 0x036, 0x0004E3B5, + 0x036, 0x000563B5, + 0x036, 0x0005E3B5, + 0x90000200,0x00000000,0x40000000,0x00000000, + 0x036, 0x000063B5, + 0x036, 0x0000E3B5, + 0x036, 0x000163B5, + 0x036, 0x0001E3B5, + 0x036, 0x000263B5, + 0x036, 0x0002E3B5, + 0x036, 0x000363B5, + 0x036, 0x0003E3B5, + 0x036, 0x000463B5, + 0x036, 0x0004E3B5, + 0x036, 0x000563B5, + 0x036, 0x0005E3B5, + 0x90000410,0x00000000,0x40000000,0x00000000, + 0x036, 0x00085733, + 0x036, 0x0008D733, + 0x036, 0x00095733, + 0x036, 0x0009D733, + 0x036, 0x000A64B4, + 0x036, 0x000AE4B4, + 0x036, 0x000B64B4, + 0x036, 0x000BE4B4, + 0x036, 0x000C64B4, + 0x036, 0x000CE4B4, + 0x036, 0x000D64B4, + 0x036, 0x000DE4B4, + 0xA0000000,0x00000000, + 0x036, 0x000056B3, + 0x036, 0x0000D6B3, + 0x036, 0x000156B3, + 0x036, 0x0001D6B3, + 0x036, 0x00026634, + 0x036, 0x0002E634, + 0x036, 0x00036634, + 0x036, 0x0003E634, + 0x036, 0x000467B4, + 0x036, 0x0004E7B4, + 0x036, 0x000567B4, + 0x036, 0x0005E7B4, + 0xB0000000,0x00000000, + 0x0EF, 0x00000000, + 0x0EF, 0x00000008, + 0x80000111,0x00000000,0x40000000,0x00000000, + 0x03C, 0x000001C8, + 0x03C, 0x00000492, + 0x90000110,0x00000000,0x40000000,0x00000000, + 0x03C, 0x000001C8, + 0x03C, 0x00000492, + 0x90000210,0x00000000,0x40000000,0x00000000, + 0x03C, 0x000001B6, + 0x03C, 0x00000492, + 0x90000200,0x00000000,0x40000000,0x00000000, + 0x03C, 0x000001B6, + 0x03C, 0x00000492, + 0x90000410,0x00000000,0x40000000,0x00000000, + 0x03C, 0x000001C8, + 0x03C, 0x00000492, + 0xA0000000,0x00000000, + 0x03C, 0x0000022A, + 0x03C, 0x00000594, + 0xB0000000,0x00000000, + 0x80000111,0x00000000,0x40000000,0x00000000, + 0x03C, 0x00000800, + 0x90000110,0x00000000,0x40000000,0x00000000, + 0x03C, 0x00000800, + 0x90000210,0x00000000,0x40000000,0x00000000, + 0x03C, 0x00000800, + 0x9000020c,0x00000000,0x40000000,0x00000000, + 0x03C, 0x00000820, + 0x9000040c,0x00000000,0x40000000,0x00000000, + 0x03C, 0x00000820, + 0x90000200,0x00000000,0x40000000,0x00000000, + 0x03C, 0x00000800, + 0x90000410,0x00000000,0x40000000,0x00000000, + 0x03C, 0x00000800, + 0xA0000000,0x00000000, + 0x03C, 0x00000900, + 0xB0000000,0x00000000, + 0x0EF, 0x00000000, + 0x018, 0x0001712A, + 0x0EF, 0x00000002, + 0x80000111,0x00000000,0x40000000,0x00000000, + 0x008, 0x0004E400, + 0x90000110,0x00000000,0x40000000,0x00000000, + 0x008, 0x0004E400, + 0x90000410,0x00000000,0x40000000,0x00000000, + 0x008, 0x0004E400, + 0xA0000000,0x00000000, + 0x008, 0x00002000, + 0xB0000000,0x00000000, + 0x0EF, 0x00000000, + 0x0DF, 0x000000C0, + 0x01F, 0x00000064, + 0x80000111,0x00000000,0x40000000,0x00000000, + 0x058, 0x000A7284, + 0x059, 0x000600EC, + 0x90000110,0x00000000,0x40000000,0x00000000, + 0x058, 0x000A7284, + 0x059, 0x000600EC, + 0x90000410,0x00000000,0x40000000,0x00000000, + 0x058, 0x000A7284, + 0x059, 0x000600EC, + 0xA0000000,0x00000000, + 0x058, 0x00081184, + 0x059, 0x0006016C, + 0xB0000000,0x00000000, + 0x80000111,0x00000000,0x40000000,0x00000000, + 0x061, 0x000E8D73, + 0x062, 0x00093FC5, + 0x90000110,0x00000000,0x40000000,0x00000000, + 0x061, 0x000E8D73, + 0x062, 0x00093FC5, + 0x90000210,0x00000000,0x40000000,0x00000000, + 0x061, 0x000EFD83, + 0x062, 0x00093FCC, + 0x90000200,0x00000000,0x40000000,0x00000000, + 0x061, 0x000EFD83, + 0x062, 0x00093FCC, + 0x90000410,0x00000000,0x40000000,0x00000000, + 0x061, 0x000E8D73, + 0x062, 0x00093FC5, + 0xA0000000,0x00000000, + 0x061, 0x000EAD53, + 0x062, 0x00093BC4, + 0xB0000000,0x00000000, + 0x80000111,0x00000000,0x40000000,0x00000000, + 0x063, 0x000110E9, + 0x90000110,0x00000000,0x40000000,0x00000000, + 0x063, 0x000110E9, + 0x90000210,0x00000000,0x40000000,0x00000000, + 0x063, 0x000110EB, + 0x9000020c,0x00000000,0x40000000,0x00000000, + 0x063, 0x000110E9, + 0x9000040c,0x00000000,0x40000000,0x00000000, + 0x063, 0x000110E9, + 0x90000200,0x00000000,0x40000000,0x00000000, + 0x063, 0x000110EB, + 0x90000410,0x00000000,0x40000000,0x00000000, + 0x063, 0x000110E9, + 0xA0000000,0x00000000, + 0x063, 0x000714E9, + 0xB0000000,0x00000000, + 0x80000111,0x00000000,0x40000000,0x00000000, + 0x064, 0x0001C27C, + 0x90000110,0x00000000,0x40000000,0x00000000, + 0x064, 0x0001C27C, + 0x90000210,0x00000000,0x40000000,0x00000000, + 0x064, 0x0001C27C, + 0x90000200,0x00000000,0x40000000,0x00000000, + 0x064, 0x0001C27C, + 0x90000410,0x00000000,0x40000000,0x00000000, + 0x064, 0x0001C27C, + 0xA0000000,0x00000000, + 0x064, 0x0001C67C, + 0xB0000000,0x00000000, + 0x80000210,0x00000000,0x40000000,0x00000000, + 0x065, 0x00093016, + 0x9000020c,0x00000000,0x40000000,0x00000000, + 0x065, 0x00093015, + 0x9000040c,0x00000000,0x40000000,0x00000000, + 0x065, 0x00093015, + 0x90000200,0x00000000,0x40000000,0x00000000, + 0x065, 0x00093016, + 0xA0000000,0x00000000, + 0x065, 0x00091016, + 0xB0000000,0x00000000, + 0x018, 0x00000006, + 0x0EF, 0x00002000, + 0x03B, 0x0003824B, + 0x03B, 0x0003024B, + 0x03B, 0x0002844B, + 0x03B, 0x00020F4B, + 0x03B, 0x00018F4B, + 0x03B, 0x000104B2, + 0x03B, 0x00008049, + 0x03B, 0x00000148, + 0x03B, 0x0007824B, + 0x03B, 0x0007024B, + 0x03B, 0x0006824B, + 0x03B, 0x00060F4B, + 0x03B, 0x00058F4B, + 0x03B, 0x000504B2, + 0x03B, 0x00048049, + 0x03B, 0x00040148, + 0x0EF, 0x00000000, + 0x0EF, 0x00000100, + 0x034, 0x0000ADF3, + 0x034, 0x00009DEF, + 0x034, 0x00008DEC, + 0x034, 0x00007DE9, + 0x034, 0x00006CED, + 0x034, 0x00005CE9, + 0x034, 0x000044E9, + 0x034, 0x000034E6, + 0x034, 0x0000246A, + 0x034, 0x00001467, + 0x034, 0x00000068, + 0x0EF, 0x00000000, + 0x0ED, 0x00000010, + 0x044, 0x0000ADF2, + 0x044, 0x00009DEF, + 0x044, 0x00008DEC, + 0x044, 0x00007DE9, + 0x044, 0x00006CEC, + 0x044, 0x00005CE9, + 0x044, 0x000044EC, + 0x044, 0x000034E9, + 0x044, 0x0000246C, + 0x044, 0x00001469, + 0x044, 0x0000006C, + 0x0ED, 0x00000000, + 0x0ED, 0x00000001, + 0x040, 0x00038DA7, + 0x040, 0x000300C2, + 0x040, 0x000288E2, + 0x040, 0x000200B8, + 0x040, 0x000188A5, + 0x040, 0x00010FBC, + 0x040, 0x00008F71, + 0x040, 0x00000240, + 0x0ED, 0x00000000, + 0x0EF, 0x000020A2, + 0x0DF, 0x00000080, + 0x035, 0x00000120, + 0x035, 0x00008120, + 0x035, 0x00010120, + 0x036, 0x00000085, + 0x036, 0x00008085, + 0x036, 0x00010085, + 0x036, 0x00018085, + 0x0EF, 0x00000000, + 0x051, 0x00000C31, + 0x052, 0x00000622, + 0x053, 0x000FC70B, + 0x054, 0x0000017E, + 0x056, 0x00051DF3, + 0x051, 0x00000C01, + 0x052, 0x000006D6, + 0x053, 0x000FC649, + 0x070, 0x00049661, + 0x071, 0x0007843E, + 0x072, 0x00000382, + 0x074, 0x00051400, + 0x035, 0x00000160, + 0x035, 0x00008160, + 0x035, 0x00010160, + 0x036, 0x00000124, + 0x036, 0x00008124, + 0x036, 0x00010124, + 0x036, 0x00018124, + 0x0ED, 0x0000000C, + 0x045, 0x00000140, + 0x045, 0x00008140, + 0x045, 0x00010140, + 0x046, 0x00000124, + 0x046, 0x00008124, + 0x046, 0x00010124, + 0x046, 0x00018124, + 0x0DF, 0x00000088, + 0x0B3, 0x000F0E18, + 0x0B4, 0x0001214C, + 0x0B7, 0x0003000C, + 0x01C, 0x000539D2, + 0x018, 0x0001F12A, + 0x0FE, 0x00000000, + 0x0FE, 0x00000000, + 0x018, 0x0001712A, + +}; + +void +ODM_ReadAndConfig_MP_8821A_RadioA( + IN PDM_ODM_T pDM_Odm + ) +{ + u4Byte i = 0; + u1Byte cCond; + BOOLEAN bMatched = TRUE, bSkipped = FALSE; +//ask by Luke.Lee + u4Byte ArrayLen = sizeof(Array_MP_8821A_RadioA)/sizeof(u4Byte); + pu4Byte Array = Array_MP_8821A_RadioA; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ReadAndConfig_MP_8821A_RadioA\n")); + + while(( i+1) < ArrayLen) + { + u4Byte v1 = Array[i]; + u4Byte v2 = Array[i+1]; + + if(v1 & (BIT31|BIT30)) //positive & negative condition + { + if(v1 & BIT31) // positive condition + { + cCond = (u1Byte)((v1 & (BIT29|BIT28)) >> 28); + if(cCond == COND_ENDIF) //end + { + bMatched = TRUE; + bSkipped = FALSE; + } + else if(cCond == COND_ELSE) //else + { + bMatched = bSkipped?FALSE:TRUE; + } + else //if , else if + { + if(bSkipped) + bMatched = FALSE; + else + { + if(CheckPositive(pDM_Odm, v1, v2)) + { + bMatched = TRUE; + bSkipped = TRUE; + } + else + { + bMatched = FALSE; + bSkipped = FALSE; + } + } + } + } + else if(v1 & BIT30){ //negative condition + //do nothing + } + } + else + { + if(bMatched) + odm_ConfigRF_RadioA_8821A(pDM_Odm, v1, v2); + } + i = i + 2; + } +} + +u4Byte +ODM_GetVersion_MP_8821A_RadioA(void) +{ + return 44; +} + +/****************************************************************************** +* TxPowerTrack_AP.TXT +******************************************************************************/ + +#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) +u1Byte gDeltaSwingTableIdx_MP_5GB_N_TxPowerTrack_AP_8821A[][DELTA_SWINGIDX_SIZE] = { + {0, 1, 1, 2, 2, 3, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 11, 12, 12, 13, 13, 14, 14, 14, 14, 14, 14, 14}, + {0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 14, 14, 14, 14, 14}, + {0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 14, 14, 14, 14, 14}, +}; +u1Byte gDeltaSwingTableIdx_MP_5GB_P_TxPowerTrack_AP_8821A[][DELTA_SWINGIDX_SIZE] = { + {0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 17, 17, 18, 19, 20, 20, 20}, + {0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 19, 20, 20, 20}, + {0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 20, 21, 21, 21}, +}; +u1Byte gDeltaSwingTableIdx_MP_5GA_N_TxPowerTrack_AP_8821A[][DELTA_SWINGIDX_SIZE] = { + {0, 1, 2, 3, 3, 4, 4, 5, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 14, 14, 14, 14, 14}, + {0, 1, 2, 3, 3, 4, 5, 6, 6, 6, 7, 7, 8, 8, 9, 10, 11, 11, 12, 13, 13, 14, 15, 16, 16, 16, 16, 16, 16, 16}, + {0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 10, 11, 11, 12, 13, 14, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16}, +}; +u1Byte gDeltaSwingTableIdx_MP_5GA_P_TxPowerTrack_AP_8821A[][DELTA_SWINGIDX_SIZE] = { + {0, 1, 1, 2, 2, 3, 4, 5, 5, 6, 7, 8, 8, 9, 10, 11, 11, 12, 13, 14, 14, 15, 15, 16, 16, 17, 18, 19, 19, 19}, + {0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 20, 21, 21, 21}, + {0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 20, 21, 21, 21}, +}; +u1Byte gDeltaSwingTableIdx_MP_2GB_N_TxPowerTrack_AP_8821A[] = {0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 7, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11}; +u1Byte gDeltaSwingTableIdx_MP_2GB_P_TxPowerTrack_AP_8821A[] = {0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9}; +u1Byte gDeltaSwingTableIdx_MP_2GA_N_TxPowerTrack_AP_8821A[] = {0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 7, 8, 8, 9, 9, 9, 10, 10, 10, 10, 11, 11}; +u1Byte gDeltaSwingTableIdx_MP_2GA_P_TxPowerTrack_AP_8821A[] = {0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9}; +u1Byte gDeltaSwingTableIdx_MP_2GCCKB_N_TxPowerTrack_AP_8821A[] = {0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 7, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11}; +u1Byte gDeltaSwingTableIdx_MP_2GCCKB_P_TxPowerTrack_AP_8821A[] = {0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9}; +u1Byte gDeltaSwingTableIdx_MP_2GCCKA_N_TxPowerTrack_AP_8821A[] = {0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 7, 8, 8, 9, 9, 9, 10, 10, 10, 10, 11, 11}; +u1Byte gDeltaSwingTableIdx_MP_2GCCKA_P_TxPowerTrack_AP_8821A[] = {0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9}; +#endif + +void +ODM_ReadAndConfig_MP_8821A_TxPowerTrack_AP( + IN PDM_ODM_T pDM_Odm + ) +{ +#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) + PODM_RF_CAL_T pRFCalibrateInfo = &(pDM_Odm->RFCalibrateInfo); + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ReadAndConfig_MP_MP_8821A\n")); + + + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GA_P, gDeltaSwingTableIdx_MP_2GA_P_TxPowerTrack_AP_8821A, DELTA_SWINGIDX_SIZE); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GA_N, gDeltaSwingTableIdx_MP_2GA_N_TxPowerTrack_AP_8821A, DELTA_SWINGIDX_SIZE); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GB_P, gDeltaSwingTableIdx_MP_2GB_P_TxPowerTrack_AP_8821A, DELTA_SWINGIDX_SIZE); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GB_N, gDeltaSwingTableIdx_MP_2GB_N_TxPowerTrack_AP_8821A, DELTA_SWINGIDX_SIZE); + + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKA_P, gDeltaSwingTableIdx_MP_2GCCKA_P_TxPowerTrack_AP_8821A, DELTA_SWINGIDX_SIZE); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKA_N, gDeltaSwingTableIdx_MP_2GCCKA_N_TxPowerTrack_AP_8821A, DELTA_SWINGIDX_SIZE); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKB_P, gDeltaSwingTableIdx_MP_2GCCKB_P_TxPowerTrack_AP_8821A, DELTA_SWINGIDX_SIZE); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKB_N, gDeltaSwingTableIdx_MP_2GCCKB_N_TxPowerTrack_AP_8821A, DELTA_SWINGIDX_SIZE); + + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GA_P, gDeltaSwingTableIdx_MP_5GA_P_TxPowerTrack_AP_8821A, DELTA_SWINGIDX_SIZE*3); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GA_N, gDeltaSwingTableIdx_MP_5GA_N_TxPowerTrack_AP_8821A, DELTA_SWINGIDX_SIZE*3); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GB_P, gDeltaSwingTableIdx_MP_5GB_P_TxPowerTrack_AP_8821A, DELTA_SWINGIDX_SIZE*3); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GB_N, gDeltaSwingTableIdx_MP_5GB_N_TxPowerTrack_AP_8821A, DELTA_SWINGIDX_SIZE*3); +#endif +} + +/****************************************************************************** +* TxPowerTrack_PCIE.TXT +******************************************************************************/ + +#if DEV_BUS_TYPE == RT_PCI_INTERFACE +u1Byte gDeltaSwingTableIdx_MP_5GB_N_TxPowerTrack_PCIE_8821A[][DELTA_SWINGIDX_SIZE] = { + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, +}; +u1Byte gDeltaSwingTableIdx_MP_5GB_P_TxPowerTrack_PCIE_8821A[][DELTA_SWINGIDX_SIZE] = { + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, +}; +u1Byte gDeltaSwingTableIdx_MP_5GA_N_TxPowerTrack_PCIE_8821A[][DELTA_SWINGIDX_SIZE] = { + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, +}; +u1Byte gDeltaSwingTableIdx_MP_5GA_P_TxPowerTrack_PCIE_8821A[][DELTA_SWINGIDX_SIZE] = { + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, +}; +u1Byte gDeltaSwingTableIdx_MP_2GB_N_TxPowerTrack_PCIE_8821A[] = {0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10}; +u1Byte gDeltaSwingTableIdx_MP_2GB_P_TxPowerTrack_PCIE_8821A[] = {0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 12, 12}; +u1Byte gDeltaSwingTableIdx_MP_2GA_N_TxPowerTrack_PCIE_8821A[] = {0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10}; +u1Byte gDeltaSwingTableIdx_MP_2GA_P_TxPowerTrack_PCIE_8821A[] = {0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 12, 12}; +u1Byte gDeltaSwingTableIdx_MP_2GCCKB_N_TxPowerTrack_PCIE_8821A[] = {0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10}; +u1Byte gDeltaSwingTableIdx_MP_2GCCKB_P_TxPowerTrack_PCIE_8821A[] = {0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 12, 12}; +u1Byte gDeltaSwingTableIdx_MP_2GCCKA_N_TxPowerTrack_PCIE_8821A[] = {0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10}; +u1Byte gDeltaSwingTableIdx_MP_2GCCKA_P_TxPowerTrack_PCIE_8821A[] = {0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 12, 12}; +#endif + +void +ODM_ReadAndConfig_MP_8821A_TxPowerTrack_PCIE( + IN PDM_ODM_T pDM_Odm + ) +{ +#if DEV_BUS_TYPE == RT_PCI_INTERFACE + PODM_RF_CAL_T pRFCalibrateInfo = &(pDM_Odm->RFCalibrateInfo); + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ReadAndConfig_MP_MP_8821A\n")); + + + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GA_P, gDeltaSwingTableIdx_MP_2GA_P_TxPowerTrack_PCIE_8821A, DELTA_SWINGIDX_SIZE); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GA_N, gDeltaSwingTableIdx_MP_2GA_N_TxPowerTrack_PCIE_8821A, DELTA_SWINGIDX_SIZE); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GB_P, gDeltaSwingTableIdx_MP_2GB_P_TxPowerTrack_PCIE_8821A, DELTA_SWINGIDX_SIZE); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GB_N, gDeltaSwingTableIdx_MP_2GB_N_TxPowerTrack_PCIE_8821A, DELTA_SWINGIDX_SIZE); + + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKA_P, gDeltaSwingTableIdx_MP_2GCCKA_P_TxPowerTrack_PCIE_8821A, DELTA_SWINGIDX_SIZE); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKA_N, gDeltaSwingTableIdx_MP_2GCCKA_N_TxPowerTrack_PCIE_8821A, DELTA_SWINGIDX_SIZE); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKB_P, gDeltaSwingTableIdx_MP_2GCCKB_P_TxPowerTrack_PCIE_8821A, DELTA_SWINGIDX_SIZE); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKB_N, gDeltaSwingTableIdx_MP_2GCCKB_N_TxPowerTrack_PCIE_8821A, DELTA_SWINGIDX_SIZE); + + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GA_P, gDeltaSwingTableIdx_MP_5GA_P_TxPowerTrack_PCIE_8821A, DELTA_SWINGIDX_SIZE*3); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GA_N, gDeltaSwingTableIdx_MP_5GA_N_TxPowerTrack_PCIE_8821A, DELTA_SWINGIDX_SIZE*3); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GB_P, gDeltaSwingTableIdx_MP_5GB_P_TxPowerTrack_PCIE_8821A, DELTA_SWINGIDX_SIZE*3); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GB_N, gDeltaSwingTableIdx_MP_5GB_N_TxPowerTrack_PCIE_8821A, DELTA_SWINGIDX_SIZE*3); +#endif +} + +/****************************************************************************** +* TxPowerTrack_SDIO.TXT +******************************************************************************/ + +#if DEV_BUS_TYPE == RT_SDIO_INTERFACE +u1Byte gDeltaSwingTableIdx_MP_5GB_N_TxPowerTrack_SDIO_8821A[][DELTA_SWINGIDX_SIZE] = { + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, +}; +u1Byte gDeltaSwingTableIdx_MP_5GB_P_TxPowerTrack_SDIO_8821A[][DELTA_SWINGIDX_SIZE] = { + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, +}; +u1Byte gDeltaSwingTableIdx_MP_5GA_N_TxPowerTrack_SDIO_8821A[][DELTA_SWINGIDX_SIZE] = { + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, +}; +u1Byte gDeltaSwingTableIdx_MP_5GA_P_TxPowerTrack_SDIO_8821A[][DELTA_SWINGIDX_SIZE] = { + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, +}; +u1Byte gDeltaSwingTableIdx_MP_2GB_N_TxPowerTrack_SDIO_8821A[] = {0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10}; +u1Byte gDeltaSwingTableIdx_MP_2GB_P_TxPowerTrack_SDIO_8821A[] = {0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 12, 12}; +u1Byte gDeltaSwingTableIdx_MP_2GA_N_TxPowerTrack_SDIO_8821A[] = {0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10}; +u1Byte gDeltaSwingTableIdx_MP_2GA_P_TxPowerTrack_SDIO_8821A[] = {0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 12, 12}; +u1Byte gDeltaSwingTableIdx_MP_2GCCKB_N_TxPowerTrack_SDIO_8821A[] = {0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10}; +u1Byte gDeltaSwingTableIdx_MP_2GCCKB_P_TxPowerTrack_SDIO_8821A[] = {0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 12, 12}; +u1Byte gDeltaSwingTableIdx_MP_2GCCKA_N_TxPowerTrack_SDIO_8821A[] = {0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10}; +u1Byte gDeltaSwingTableIdx_MP_2GCCKA_P_TxPowerTrack_SDIO_8821A[] = {0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 12, 12}; +#endif + +void +ODM_ReadAndConfig_MP_8821A_TxPowerTrack_SDIO( + IN PDM_ODM_T pDM_Odm + ) +{ +#if DEV_BUS_TYPE == RT_SDIO_INTERFACE + PODM_RF_CAL_T pRFCalibrateInfo = &(pDM_Odm->RFCalibrateInfo); + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ReadAndConfig_MP_MP_8821A\n")); + + + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GA_P, gDeltaSwingTableIdx_MP_2GA_P_TxPowerTrack_SDIO_8821A, DELTA_SWINGIDX_SIZE); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GA_N, gDeltaSwingTableIdx_MP_2GA_N_TxPowerTrack_SDIO_8821A, DELTA_SWINGIDX_SIZE); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GB_P, gDeltaSwingTableIdx_MP_2GB_P_TxPowerTrack_SDIO_8821A, DELTA_SWINGIDX_SIZE); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GB_N, gDeltaSwingTableIdx_MP_2GB_N_TxPowerTrack_SDIO_8821A, DELTA_SWINGIDX_SIZE); + + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKA_P, gDeltaSwingTableIdx_MP_2GCCKA_P_TxPowerTrack_SDIO_8821A, DELTA_SWINGIDX_SIZE); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKA_N, gDeltaSwingTableIdx_MP_2GCCKA_N_TxPowerTrack_SDIO_8821A, DELTA_SWINGIDX_SIZE); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKB_P, gDeltaSwingTableIdx_MP_2GCCKB_P_TxPowerTrack_SDIO_8821A, DELTA_SWINGIDX_SIZE); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKB_N, gDeltaSwingTableIdx_MP_2GCCKB_N_TxPowerTrack_SDIO_8821A, DELTA_SWINGIDX_SIZE); + + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GA_P, gDeltaSwingTableIdx_MP_5GA_P_TxPowerTrack_SDIO_8821A, DELTA_SWINGIDX_SIZE*3); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GA_N, gDeltaSwingTableIdx_MP_5GA_N_TxPowerTrack_SDIO_8821A, DELTA_SWINGIDX_SIZE*3); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GB_P, gDeltaSwingTableIdx_MP_5GB_P_TxPowerTrack_SDIO_8821A, DELTA_SWINGIDX_SIZE*3); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GB_N, gDeltaSwingTableIdx_MP_5GB_N_TxPowerTrack_SDIO_8821A, DELTA_SWINGIDX_SIZE*3); +#endif +} + +/****************************************************************************** +* TxPowerTrack_USB.TXT +******************************************************************************/ + +#if DEV_BUS_TYPE == RT_USB_INTERFACE +u1Byte gDeltaSwingTableIdx_MP_5GB_N_TxPowerTrack_USB_8821A[][DELTA_SWINGIDX_SIZE] = { + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, +}; +u1Byte gDeltaSwingTableIdx_MP_5GB_P_TxPowerTrack_USB_8821A[][DELTA_SWINGIDX_SIZE] = { + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, +}; +u1Byte gDeltaSwingTableIdx_MP_5GA_N_TxPowerTrack_USB_8821A[][DELTA_SWINGIDX_SIZE] = { + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, +}; +u1Byte gDeltaSwingTableIdx_MP_5GA_P_TxPowerTrack_USB_8821A[][DELTA_SWINGIDX_SIZE] = { + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, + {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, +}; +u1Byte gDeltaSwingTableIdx_MP_2GB_N_TxPowerTrack_USB_8821A[] = {0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10}; +u1Byte gDeltaSwingTableIdx_MP_2GB_P_TxPowerTrack_USB_8821A[] = {0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 12, 12}; +u1Byte gDeltaSwingTableIdx_MP_2GA_N_TxPowerTrack_USB_8821A[] = {0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10}; +u1Byte gDeltaSwingTableIdx_MP_2GA_P_TxPowerTrack_USB_8821A[] = {0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 12, 12}; +u1Byte gDeltaSwingTableIdx_MP_2GCCKB_N_TxPowerTrack_USB_8821A[] = {0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10}; +u1Byte gDeltaSwingTableIdx_MP_2GCCKB_P_TxPowerTrack_USB_8821A[] = {0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 12, 12}; +u1Byte gDeltaSwingTableIdx_MP_2GCCKA_N_TxPowerTrack_USB_8821A[] = {0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10}; +u1Byte gDeltaSwingTableIdx_MP_2GCCKA_P_TxPowerTrack_USB_8821A[] = {0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 12, 12}; +#endif + +void +ODM_ReadAndConfig_MP_8821A_TxPowerTrack_USB( + IN PDM_ODM_T pDM_Odm + ) +{ +#if DEV_BUS_TYPE == RT_USB_INTERFACE + PODM_RF_CAL_T pRFCalibrateInfo = &(pDM_Odm->RFCalibrateInfo); + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ReadAndConfig_MP_MP_8821A\n")); + + + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GA_P, gDeltaSwingTableIdx_MP_2GA_P_TxPowerTrack_USB_8821A, DELTA_SWINGIDX_SIZE); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GA_N, gDeltaSwingTableIdx_MP_2GA_N_TxPowerTrack_USB_8821A, DELTA_SWINGIDX_SIZE); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GB_P, gDeltaSwingTableIdx_MP_2GB_P_TxPowerTrack_USB_8821A, DELTA_SWINGIDX_SIZE); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GB_N, gDeltaSwingTableIdx_MP_2GB_N_TxPowerTrack_USB_8821A, DELTA_SWINGIDX_SIZE); + + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKA_P, gDeltaSwingTableIdx_MP_2GCCKA_P_TxPowerTrack_USB_8821A, DELTA_SWINGIDX_SIZE); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKA_N, gDeltaSwingTableIdx_MP_2GCCKA_N_TxPowerTrack_USB_8821A, DELTA_SWINGIDX_SIZE); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKB_P, gDeltaSwingTableIdx_MP_2GCCKB_P_TxPowerTrack_USB_8821A, DELTA_SWINGIDX_SIZE); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKB_N, gDeltaSwingTableIdx_MP_2GCCKB_N_TxPowerTrack_USB_8821A, DELTA_SWINGIDX_SIZE); + + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GA_P, gDeltaSwingTableIdx_MP_5GA_P_TxPowerTrack_USB_8821A, DELTA_SWINGIDX_SIZE*3); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GA_N, gDeltaSwingTableIdx_MP_5GA_N_TxPowerTrack_USB_8821A, DELTA_SWINGIDX_SIZE*3); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GB_P, gDeltaSwingTableIdx_MP_5GB_P_TxPowerTrack_USB_8821A, DELTA_SWINGIDX_SIZE*3); + ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GB_N, gDeltaSwingTableIdx_MP_5GB_N_TxPowerTrack_USB_8821A, DELTA_SWINGIDX_SIZE*3); +#endif +} + +/****************************************************************************** +* TXPWR_LMT_8811AU_FEM.TXT +******************************************************************************/ + +pu1Byte Array_MP_8821A_TXPWR_LMT_8811AU_FEM[] = { + "FCC", "2.4G", "20M", "CCK", "1T", "01", "32", + "ETSI", "2.4G", "20M", "CCK", "1T", "01", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "01", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "02", "34", + "ETSI", "2.4G", "20M", "CCK", "1T", "02", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "02", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "03", "34", + "ETSI", "2.4G", "20M", "CCK", "1T", "03", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "03", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "04", "34", + "ETSI", "2.4G", "20M", "CCK", "1T", "04", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "04", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "05", "34", + "ETSI", "2.4G", "20M", "CCK", "1T", "05", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "05", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "06", "34", + "ETSI", "2.4G", "20M", "CCK", "1T", "06", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "06", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "07", "34", + "ETSI", "2.4G", "20M", "CCK", "1T", "07", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "07", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "08", "34", + "ETSI", "2.4G", "20M", "CCK", "1T", "08", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "08", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "09", "34", + "ETSI", "2.4G", "20M", "CCK", "1T", "09", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "09", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "10", "34", + "ETSI", "2.4G", "20M", "CCK", "1T", "10", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "10", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "11", "32", + "ETSI", "2.4G", "20M", "CCK", "1T", "11", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "11", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "12", "63", + "ETSI", "2.4G", "20M", "CCK", "1T", "12", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "12", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "13", "63", + "ETSI", "2.4G", "20M", "CCK", "1T", "13", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "13", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "14", "63", + "ETSI", "2.4G", "20M", "CCK", "1T", "14", "63", + "MKK", "2.4G", "20M", "CCK", "1T", "14", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "01", "32", + "ETSI", "2.4G", "20M", "OFDM", "1T", "01", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "01", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "02", "34", + "ETSI", "2.4G", "20M", "OFDM", "1T", "02", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "02", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "03", "34", + "ETSI", "2.4G", "20M", "OFDM", "1T", "03", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "03", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "04", "34", + "ETSI", "2.4G", "20M", "OFDM", "1T", "04", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "04", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "05", "34", + "ETSI", "2.4G", "20M", "OFDM", "1T", "05", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "05", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "06", "34", + "ETSI", "2.4G", "20M", "OFDM", "1T", "06", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "06", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "07", "34", + "ETSI", "2.4G", "20M", "OFDM", "1T", "07", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "07", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "08", "34", + "ETSI", "2.4G", "20M", "OFDM", "1T", "08", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "08", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "09", "34", + "ETSI", "2.4G", "20M", "OFDM", "1T", "09", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "09", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "10", "34", + "ETSI", "2.4G", "20M", "OFDM", "1T", "10", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "10", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "11", "32", + "ETSI", "2.4G", "20M", "OFDM", "1T", "11", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "11", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "12", "63", + "ETSI", "2.4G", "20M", "OFDM", "1T", "12", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "12", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "13", "63", + "ETSI", "2.4G", "20M", "OFDM", "1T", "13", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "13", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "14", "63", + "ETSI", "2.4G", "20M", "OFDM", "1T", "14", "63", + "MKK", "2.4G", "20M", "OFDM", "1T", "14", "63", + "FCC", "2.4G", "20M", "HT", "1T", "01", "32", + "ETSI", "2.4G", "20M", "HT", "1T", "01", "32", + "MKK", "2.4G", "20M", "HT", "1T", "01", "32", + "FCC", "2.4G", "20M", "HT", "1T", "02", "34", + "ETSI", "2.4G", "20M", "HT", "1T", "02", "32", + "MKK", "2.4G", "20M", "HT", "1T", "02", "32", + "FCC", "2.4G", "20M", "HT", "1T", "03", "34", + "ETSI", "2.4G", "20M", "HT", "1T", "03", "32", + "MKK", "2.4G", "20M", "HT", "1T", "03", "32", + "FCC", "2.4G", "20M", "HT", "1T", "04", "34", + "ETSI", "2.4G", "20M", "HT", "1T", "04", "32", + "MKK", "2.4G", "20M", "HT", "1T", "04", "32", + "FCC", "2.4G", "20M", "HT", "1T", "05", "34", + "ETSI", "2.4G", "20M", "HT", "1T", "05", "32", + "MKK", "2.4G", "20M", "HT", "1T", "05", "32", + "FCC", "2.4G", "20M", "HT", "1T", "06", "34", + "ETSI", "2.4G", "20M", "HT", "1T", "06", "32", + "MKK", "2.4G", "20M", "HT", "1T", "06", "32", + "FCC", "2.4G", "20M", "HT", "1T", "07", "34", + "ETSI", "2.4G", "20M", "HT", "1T", "07", "32", + "MKK", "2.4G", "20M", "HT", "1T", "07", "32", + "FCC", "2.4G", "20M", "HT", "1T", "08", "34", + "ETSI", "2.4G", "20M", "HT", "1T", "08", "32", + "MKK", "2.4G", "20M", "HT", "1T", "08", "32", + "FCC", "2.4G", "20M", "HT", "1T", "09", "34", + "ETSI", "2.4G", "20M", "HT", "1T", "09", "32", + "MKK", "2.4G", "20M", "HT", "1T", "09", "32", + "FCC", "2.4G", "20M", "HT", "1T", "10", "34", + "ETSI", "2.4G", "20M", "HT", "1T", "10", "32", + "MKK", "2.4G", "20M", "HT", "1T", "10", "32", + "FCC", "2.4G", "20M", "HT", "1T", "11", "32", + "ETSI", "2.4G", "20M", "HT", "1T", "11", "32", + "MKK", "2.4G", "20M", "HT", "1T", "11", "32", + "FCC", "2.4G", "20M", "HT", "1T", "12", "63", + "ETSI", "2.4G", "20M", "HT", "1T", "12", "32", + "MKK", "2.4G", "20M", "HT", "1T", "12", "32", + "FCC", "2.4G", "20M", "HT", "1T", "13", "63", + "ETSI", "2.4G", "20M", "HT", "1T", "13", "32", + "MKK", "2.4G", "20M", "HT", "1T", "13", "32", + "FCC", "2.4G", "20M", "HT", "1T", "14", "63", + "ETSI", "2.4G", "20M", "HT", "1T", "14", "63", + "MKK", "2.4G", "20M", "HT", "1T", "14", "63", + "FCC", "2.4G", "20M", "HT", "2T", "01", "30", + "ETSI", "2.4G", "20M", "HT", "2T", "01", "32", + "MKK", "2.4G", "20M", "HT", "2T", "01", "32", + "FCC", "2.4G", "20M", "HT", "2T", "02", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "02", "32", + "MKK", "2.4G", "20M", "HT", "2T", "02", "32", + "FCC", "2.4G", "20M", "HT", "2T", "03", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "03", "32", + "MKK", "2.4G", "20M", "HT", "2T", "03", "32", + "FCC", "2.4G", "20M", "HT", "2T", "04", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "04", "32", + "MKK", "2.4G", "20M", "HT", "2T", "04", "32", + "FCC", "2.4G", "20M", "HT", "2T", "05", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "05", "32", + "MKK", "2.4G", "20M", "HT", "2T", "05", "32", + "FCC", "2.4G", "20M", "HT", "2T", "06", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "06", "32", + "MKK", "2.4G", "20M", "HT", "2T", "06", "32", + "FCC", "2.4G", "20M", "HT", "2T", "07", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "07", "32", + "MKK", "2.4G", "20M", "HT", "2T", "07", "32", + "FCC", "2.4G", "20M", "HT", "2T", "08", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "08", "32", + "MKK", "2.4G", "20M", "HT", "2T", "08", "32", + "FCC", "2.4G", "20M", "HT", "2T", "09", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "09", "32", + "MKK", "2.4G", "20M", "HT", "2T", "09", "32", + "FCC", "2.4G", "20M", "HT", "2T", "10", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "10", "32", + "MKK", "2.4G", "20M", "HT", "2T", "10", "32", + "FCC", "2.4G", "20M", "HT", "2T", "11", "30", + "ETSI", "2.4G", "20M", "HT", "2T", "11", "32", + "MKK", "2.4G", "20M", "HT", "2T", "11", "32", + "FCC", "2.4G", "20M", "HT", "2T", "12", "63", + "ETSI", "2.4G", "20M", "HT", "2T", "12", "32", + "MKK", "2.4G", "20M", "HT", "2T", "12", "32", + "FCC", "2.4G", "20M", "HT", "2T", "13", "63", + "ETSI", "2.4G", "20M", "HT", "2T", "13", "32", + "MKK", "2.4G", "20M", "HT", "2T", "13", "32", + "FCC", "2.4G", "20M", "HT", "2T", "14", "63", + "ETSI", "2.4G", "20M", "HT", "2T", "14", "63", + "MKK", "2.4G", "20M", "HT", "2T", "14", "63", + "FCC", "2.4G", "40M", "HT", "1T", "01", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "01", "63", + "MKK", "2.4G", "40M", "HT", "1T", "01", "63", + "FCC", "2.4G", "40M", "HT", "1T", "02", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "02", "63", + "MKK", "2.4G", "40M", "HT", "1T", "02", "63", + "FCC", "2.4G", "40M", "HT", "1T", "03", "32", + "ETSI", "2.4G", "40M", "HT", "1T", "03", "32", + "MKK", "2.4G", "40M", "HT", "1T", "03", "32", + "FCC", "2.4G", "40M", "HT", "1T", "04", "34", + "ETSI", "2.4G", "40M", "HT", "1T", "04", "32", + "MKK", "2.4G", "40M", "HT", "1T", "04", "32", + "FCC", "2.4G", "40M", "HT", "1T", "05", "34", + "ETSI", "2.4G", "40M", "HT", "1T", "05", "32", + "MKK", "2.4G", "40M", "HT", "1T", "05", "32", + "FCC", "2.4G", "40M", "HT", "1T", "06", "34", + "ETSI", "2.4G", "40M", "HT", "1T", "06", "32", + "MKK", "2.4G", "40M", "HT", "1T", "06", "32", + "FCC", "2.4G", "40M", "HT", "1T", "07", "34", + "ETSI", "2.4G", "40M", "HT", "1T", "07", "32", + "MKK", "2.4G", "40M", "HT", "1T", "07", "32", + "FCC", "2.4G", "40M", "HT", "1T", "08", "34", + "ETSI", "2.4G", "40M", "HT", "1T", "08", "32", + "MKK", "2.4G", "40M", "HT", "1T", "08", "32", + "FCC", "2.4G", "40M", "HT", "1T", "09", "34", + "ETSI", "2.4G", "40M", "HT", "1T", "09", "32", + "MKK", "2.4G", "40M", "HT", "1T", "09", "32", + "FCC", "2.4G", "40M", "HT", "1T", "10", "34", + "ETSI", "2.4G", "40M", "HT", "1T", "10", "32", + "MKK", "2.4G", "40M", "HT", "1T", "10", "32", + "FCC", "2.4G", "40M", "HT", "1T", "11", "32", + "ETSI", "2.4G", "40M", "HT", "1T", "11", "32", + "MKK", "2.4G", "40M", "HT", "1T", "11", "32", + "FCC", "2.4G", "40M", "HT", "1T", "12", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "12", "32", + "MKK", "2.4G", "40M", "HT", "1T", "12", "32", + "FCC", "2.4G", "40M", "HT", "1T", "13", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "13", "32", + "MKK", "2.4G", "40M", "HT", "1T", "13", "32", + "FCC", "2.4G", "40M", "HT", "1T", "14", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "14", "63", + "MKK", "2.4G", "40M", "HT", "1T", "14", "63", + "FCC", "2.4G", "40M", "HT", "2T", "01", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "01", "63", + "MKK", "2.4G", "40M", "HT", "2T", "01", "63", + "FCC", "2.4G", "40M", "HT", "2T", "02", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "02", "63", + "MKK", "2.4G", "40M", "HT", "2T", "02", "63", + "FCC", "2.4G", "40M", "HT", "2T", "03", "30", + "ETSI", "2.4G", "40M", "HT", "2T", "03", "30", + "MKK", "2.4G", "40M", "HT", "2T", "03", "30", + "FCC", "2.4G", "40M", "HT", "2T", "04", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "04", "30", + "MKK", "2.4G", "40M", "HT", "2T", "04", "30", + "FCC", "2.4G", "40M", "HT", "2T", "05", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "05", "30", + "MKK", "2.4G", "40M", "HT", "2T", "05", "30", + "FCC", "2.4G", "40M", "HT", "2T", "06", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "06", "30", + "MKK", "2.4G", "40M", "HT", "2T", "06", "30", + "FCC", "2.4G", "40M", "HT", "2T", "07", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "07", "30", + "MKK", "2.4G", "40M", "HT", "2T", "07", "30", + "FCC", "2.4G", "40M", "HT", "2T", "08", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "08", "30", + "MKK", "2.4G", "40M", "HT", "2T", "08", "30", + "FCC", "2.4G", "40M", "HT", "2T", "09", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "09", "30", + "MKK", "2.4G", "40M", "HT", "2T", "09", "30", + "FCC", "2.4G", "40M", "HT", "2T", "10", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "10", "30", + "MKK", "2.4G", "40M", "HT", "2T", "10", "30", + "FCC", "2.4G", "40M", "HT", "2T", "11", "30", + "ETSI", "2.4G", "40M", "HT", "2T", "11", "30", + "MKK", "2.4G", "40M", "HT", "2T", "11", "30", + "FCC", "2.4G", "40M", "HT", "2T", "12", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "12", "32", + "MKK", "2.4G", "40M", "HT", "2T", "12", "32", + "FCC", "2.4G", "40M", "HT", "2T", "13", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "13", "32", + "MKK", "2.4G", "40M", "HT", "2T", "13", "32", + "FCC", "2.4G", "40M", "HT", "2T", "14", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "14", "63", + "MKK", "2.4G", "40M", "HT", "2T", "14", "63", + "FCC", "5G", "20M", "OFDM", "1T", "36", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "36", "32", + "MKK", "5G", "20M", "OFDM", "1T", "36", "32", + "FCC", "5G", "20M", "OFDM", "1T", "40", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "40", "32", + "MKK", "5G", "20M", "OFDM", "1T", "40", "32", + "FCC", "5G", "20M", "OFDM", "1T", "44", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "44", "32", + "MKK", "5G", "20M", "OFDM", "1T", "44", "32", + "FCC", "5G", "20M", "OFDM", "1T", "48", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "48", "32", + "MKK", "5G", "20M", "OFDM", "1T", "48", "32", + "FCC", "5G", "20M", "OFDM", "1T", "52", "34", + "ETSI", "5G", "20M", "OFDM", "1T", "52", "32", + "MKK", "5G", "20M", "OFDM", "1T", "52", "32", + "FCC", "5G", "20M", "OFDM", "1T", "56", "34", + "ETSI", "5G", "20M", "OFDM", "1T", "56", "32", + "MKK", "5G", "20M", "OFDM", "1T", "56", "32", + "FCC", "5G", "20M", "OFDM", "1T", "60", "34", + "ETSI", "5G", "20M", "OFDM", "1T", "60", "32", + "MKK", "5G", "20M", "OFDM", "1T", "60", "32", + "FCC", "5G", "20M", "OFDM", "1T", "64", "34", + "ETSI", "5G", "20M", "OFDM", "1T", "64", "32", + "MKK", "5G", "20M", "OFDM", "1T", "64", "32", + "FCC", "5G", "20M", "OFDM", "1T", "100", "34", + "ETSI", "5G", "20M", "OFDM", "1T", "100", "32", + "MKK", "5G", "20M", "OFDM", "1T", "100", "32", + "FCC", "5G", "20M", "OFDM", "1T", "114", "34", + "ETSI", "5G", "20M", "OFDM", "1T", "114", "32", + "MKK", "5G", "20M", "OFDM", "1T", "114", "32", + "FCC", "5G", "20M", "OFDM", "1T", "108", "34", + "ETSI", "5G", "20M", "OFDM", "1T", "108", "32", + "MKK", "5G", "20M", "OFDM", "1T", "108", "32", + "FCC", "5G", "20M", "OFDM", "1T", "112", "34", + "ETSI", "5G", "20M", "OFDM", "1T", "112", "32", + "MKK", "5G", "20M", "OFDM", "1T", "112", "32", + "FCC", "5G", "20M", "OFDM", "1T", "116", "34", + "ETSI", "5G", "20M", "OFDM", "1T", "116", "32", + "MKK", "5G", "20M", "OFDM", "1T", "116", "32", + "FCC", "5G", "20M", "OFDM", "1T", "120", "34", + "ETSI", "5G", "20M", "OFDM", "1T", "120", "32", + "MKK", "5G", "20M", "OFDM", "1T", "120", "32", + "FCC", "5G", "20M", "OFDM", "1T", "124", "34", + "ETSI", "5G", "20M", "OFDM", "1T", "124", "32", + "MKK", "5G", "20M", "OFDM", "1T", "124", "32", + "FCC", "5G", "20M", "OFDM", "1T", "128", "34", + "ETSI", "5G", "20M", "OFDM", "1T", "128", "32", + "MKK", "5G", "20M", "OFDM", "1T", "128", "32", + "FCC", "5G", "20M", "OFDM", "1T", "132", "34", + "ETSI", "5G", "20M", "OFDM", "1T", "132", "32", + "MKK", "5G", "20M", "OFDM", "1T", "132", "32", + "FCC", "5G", "20M", "OFDM", "1T", "136", "34", + "ETSI", "5G", "20M", "OFDM", "1T", "136", "32", + "MKK", "5G", "20M", "OFDM", "1T", "136", "32", + "FCC", "5G", "20M", "OFDM", "1T", "140", "34", + "ETSI", "5G", "20M", "OFDM", "1T", "140", "32", + "MKK", "5G", "20M", "OFDM", "1T", "140", "32", + "FCC", "5G", "20M", "OFDM", "1T", "149", "34", + "ETSI", "5G", "20M", "OFDM", "1T", "149", "32", + "MKK", "5G", "20M", "OFDM", "1T", "149", "63", + "FCC", "5G", "20M", "OFDM", "1T", "153", "34", + "ETSI", "5G", "20M", "OFDM", "1T", "153", "32", + "MKK", "5G", "20M", "OFDM", "1T", "153", "63", + "FCC", "5G", "20M", "OFDM", "1T", "157", "34", + "ETSI", "5G", "20M", "OFDM", "1T", "157", "32", + "MKK", "5G", "20M", "OFDM", "1T", "157", "63", + "FCC", "5G", "20M", "OFDM", "1T", "161", "34", + "ETSI", "5G", "20M", "OFDM", "1T", "161", "32", + "MKK", "5G", "20M", "OFDM", "1T", "161", "63", + "FCC", "5G", "20M", "OFDM", "1T", "165", "34", + "ETSI", "5G", "20M", "OFDM", "1T", "165", "32", + "MKK", "5G", "20M", "OFDM", "1T", "165", "63", + "FCC", "5G", "20M", "HT", "1T", "36", "32", + "ETSI", "5G", "20M", "HT", "1T", "36", "32", + "MKK", "5G", "20M", "HT", "1T", "36", "32", + "FCC", "5G", "20M", "HT", "1T", "40", "32", + "ETSI", "5G", "20M", "HT", "1T", "40", "32", + "MKK", "5G", "20M", "HT", "1T", "40", "32", + "FCC", "5G", "20M", "HT", "1T", "44", "32", + "ETSI", "5G", "20M", "HT", "1T", "44", "32", + "MKK", "5G", "20M", "HT", "1T", "44", "32", + "FCC", "5G", "20M", "HT", "1T", "48", "32", + "ETSI", "5G", "20M", "HT", "1T", "48", "32", + "MKK", "5G", "20M", "HT", "1T", "48", "32", + "FCC", "5G", "20M", "HT", "1T", "52", "34", + "ETSI", "5G", "20M", "HT", "1T", "52", "32", + "MKK", "5G", "20M", "HT", "1T", "52", "32", + "FCC", "5G", "20M", "HT", "1T", "56", "34", + "ETSI", "5G", "20M", "HT", "1T", "56", "32", + "MKK", "5G", "20M", "HT", "1T", "56", "32", + "FCC", "5G", "20M", "HT", "1T", "60", "34", + "ETSI", "5G", "20M", "HT", "1T", "60", "32", + "MKK", "5G", "20M", "HT", "1T", "60", "32", + "FCC", "5G", "20M", "HT", "1T", "64", "34", + "ETSI", "5G", "20M", "HT", "1T", "64", "32", + "MKK", "5G", "20M", "HT", "1T", "64", "32", + "FCC", "5G", "20M", "HT", "1T", "100", "34", + "ETSI", "5G", "20M", "HT", "1T", "100", "32", + "MKK", "5G", "20M", "HT", "1T", "100", "32", + "FCC", "5G", "20M", "HT", "1T", "114", "34", + "ETSI", "5G", "20M", "HT", "1T", "114", "32", + "MKK", "5G", "20M", "HT", "1T", "114", "32", + "FCC", "5G", "20M", "HT", "1T", "108", "34", + "ETSI", "5G", "20M", "HT", "1T", "108", "32", + "MKK", "5G", "20M", "HT", "1T", "108", "32", + "FCC", "5G", "20M", "HT", "1T", "112", "34", + "ETSI", "5G", "20M", "HT", "1T", "112", "32", + "MKK", "5G", "20M", "HT", "1T", "112", "32", + "FCC", "5G", "20M", "HT", "1T", "116", "34", + "ETSI", "5G", "20M", "HT", "1T", "116", "32", + "MKK", "5G", "20M", "HT", "1T", "116", "32", + "FCC", "5G", "20M", "HT", "1T", "120", "34", + "ETSI", "5G", "20M", "HT", "1T", "120", "32", + "MKK", "5G", "20M", "HT", "1T", "120", "32", + "FCC", "5G", "20M", "HT", "1T", "124", "34", + "ETSI", "5G", "20M", "HT", "1T", "124", "32", + "MKK", "5G", "20M", "HT", "1T", "124", "32", + "FCC", "5G", "20M", "HT", "1T", "128", "34", + "ETSI", "5G", "20M", "HT", "1T", "128", "32", + "MKK", "5G", "20M", "HT", "1T", "128", "32", + "FCC", "5G", "20M", "HT", "1T", "132", "34", + "ETSI", "5G", "20M", "HT", "1T", "132", "32", + "MKK", "5G", "20M", "HT", "1T", "132", "32", + "FCC", "5G", "20M", "HT", "1T", "136", "34", + "ETSI", "5G", "20M", "HT", "1T", "136", "32", + "MKK", "5G", "20M", "HT", "1T", "136", "32", + "FCC", "5G", "20M", "HT", "1T", "140", "32", + "ETSI", "5G", "20M", "HT", "1T", "140", "32", + "MKK", "5G", "20M", "HT", "1T", "140", "32", + "FCC", "5G", "20M", "HT", "1T", "149", "34", + "ETSI", "5G", "20M", "HT", "1T", "149", "32", + "MKK", "5G", "20M", "HT", "1T", "149", "63", + "FCC", "5G", "20M", "HT", "1T", "153", "34", + "ETSI", "5G", "20M", "HT", "1T", "153", "32", + "MKK", "5G", "20M", "HT", "1T", "153", "63", + "FCC", "5G", "20M", "HT", "1T", "157", "34", + "ETSI", "5G", "20M", "HT", "1T", "157", "32", + "MKK", "5G", "20M", "HT", "1T", "157", "63", + "FCC", "5G", "20M", "HT", "1T", "161", "34", + "ETSI", "5G", "20M", "HT", "1T", "161", "32", + "MKK", "5G", "20M", "HT", "1T", "161", "63", + "FCC", "5G", "20M", "HT", "1T", "165", "34", + "ETSI", "5G", "20M", "HT", "1T", "165", "32", + "MKK", "5G", "20M", "HT", "1T", "165", "63", + "FCC", "5G", "20M", "HT", "2T", "36", "28", + "ETSI", "5G", "20M", "HT", "2T", "36", "30", + "MKK", "5G", "20M", "HT", "2T", "36", "30", + "FCC", "5G", "20M", "HT", "2T", "40", "28", + "ETSI", "5G", "20M", "HT", "2T", "40", "30", + "MKK", "5G", "20M", "HT", "2T", "40", "30", + "FCC", "5G", "20M", "HT", "2T", "44", "28", + "ETSI", "5G", "20M", "HT", "2T", "44", "30", + "MKK", "5G", "20M", "HT", "2T", "44", "30", + "FCC", "5G", "20M", "HT", "2T", "48", "28", + "ETSI", "5G", "20M", "HT", "2T", "48", "30", + "MKK", "5G", "20M", "HT", "2T", "48", "30", + "FCC", "5G", "20M", "HT", "2T", "52", "34", + "ETSI", "5G", "20M", "HT", "2T", "52", "30", + "MKK", "5G", "20M", "HT", "2T", "52", "30", + "FCC", "5G", "20M", "HT", "2T", "56", "32", + "ETSI", "5G", "20M", "HT", "2T", "56", "30", + "MKK", "5G", "20M", "HT", "2T", "56", "30", + "FCC", "5G", "20M", "HT", "2T", "60", "30", + "ETSI", "5G", "20M", "HT", "2T", "60", "30", + "MKK", "5G", "20M", "HT", "2T", "60", "30", + "FCC", "5G", "20M", "HT", "2T", "64", "26", + "ETSI", "5G", "20M", "HT", "2T", "64", "30", + "MKK", "5G", "20M", "HT", "2T", "64", "30", + "FCC", "5G", "20M", "HT", "2T", "100", "28", + "ETSI", "5G", "20M", "HT", "2T", "100", "30", + "MKK", "5G", "20M", "HT", "2T", "100", "30", + "FCC", "5G", "20M", "HT", "2T", "114", "28", + "ETSI", "5G", "20M", "HT", "2T", "114", "30", + "MKK", "5G", "20M", "HT", "2T", "114", "30", + "FCC", "5G", "20M", "HT", "2T", "108", "30", + "ETSI", "5G", "20M", "HT", "2T", "108", "30", + "MKK", "5G", "20M", "HT", "2T", "108", "30", + "FCC", "5G", "20M", "HT", "2T", "112", "32", + "ETSI", "5G", "20M", "HT", "2T", "112", "30", + "MKK", "5G", "20M", "HT", "2T", "112", "30", + "FCC", "5G", "20M", "HT", "2T", "116", "32", + "ETSI", "5G", "20M", "HT", "2T", "116", "30", + "MKK", "5G", "20M", "HT", "2T", "116", "30", + "FCC", "5G", "20M", "HT", "2T", "120", "34", + "ETSI", "5G", "20M", "HT", "2T", "120", "30", + "MKK", "5G", "20M", "HT", "2T", "120", "30", + "FCC", "5G", "20M", "HT", "2T", "124", "32", + "ETSI", "5G", "20M", "HT", "2T", "124", "30", + "MKK", "5G", "20M", "HT", "2T", "124", "30", + "FCC", "5G", "20M", "HT", "2T", "128", "30", + "ETSI", "5G", "20M", "HT", "2T", "128", "30", + "MKK", "5G", "20M", "HT", "2T", "128", "30", + "FCC", "5G", "20M", "HT", "2T", "132", "28", + "ETSI", "5G", "20M", "HT", "2T", "132", "30", + "MKK", "5G", "20M", "HT", "2T", "132", "30", + "FCC", "5G", "20M", "HT", "2T", "136", "28", + "ETSI", "5G", "20M", "HT", "2T", "136", "30", + "MKK", "5G", "20M", "HT", "2T", "136", "30", + "FCC", "5G", "20M", "HT", "2T", "140", "26", + "ETSI", "5G", "20M", "HT", "2T", "140", "30", + "MKK", "5G", "20M", "HT", "2T", "140", "30", + "FCC", "5G", "20M", "HT", "2T", "149", "34", + "ETSI", "5G", "20M", "HT", "2T", "149", "30", + "MKK", "5G", "20M", "HT", "2T", "149", "63", + "FCC", "5G", "20M", "HT", "2T", "153", "34", + "ETSI", "5G", "20M", "HT", "2T", "153", "30", + "MKK", "5G", "20M", "HT", "2T", "153", "63", + "FCC", "5G", "20M", "HT", "2T", "157", "34", + "ETSI", "5G", "20M", "HT", "2T", "157", "30", + "MKK", "5G", "20M", "HT", "2T", "157", "63", + "FCC", "5G", "20M", "HT", "2T", "161", "34", + "ETSI", "5G", "20M", "HT", "2T", "161", "30", + "MKK", "5G", "20M", "HT", "2T", "161", "63", + "FCC", "5G", "20M", "HT", "2T", "165", "34", + "ETSI", "5G", "20M", "HT", "2T", "165", "30", + "MKK", "5G", "20M", "HT", "2T", "165", "63", + "FCC", "5G", "40M", "HT", "1T", "38", "32", + "ETSI", "5G", "40M", "HT", "1T", "38", "32", + "MKK", "5G", "40M", "HT", "1T", "38", "32", + "FCC", "5G", "40M", "HT", "1T", "46", "32", + "ETSI", "5G", "40M", "HT", "1T", "46", "32", + "MKK", "5G", "40M", "HT", "1T", "46", "32", + "FCC", "5G", "40M", "HT", "1T", "54", "34", + "ETSI", "5G", "40M", "HT", "1T", "54", "32", + "MKK", "5G", "40M", "HT", "1T", "54", "32", + "FCC", "5G", "40M", "HT", "1T", "62", "34", + "ETSI", "5G", "40M", "HT", "1T", "62", "32", + "MKK", "5G", "40M", "HT", "1T", "62", "32", + "FCC", "5G", "40M", "HT", "1T", "102", "34", + "ETSI", "5G", "40M", "HT", "1T", "102", "32", + "MKK", "5G", "40M", "HT", "1T", "102", "32", + "FCC", "5G", "40M", "HT", "1T", "110", "34", + "ETSI", "5G", "40M", "HT", "1T", "110", "32", + "MKK", "5G", "40M", "HT", "1T", "110", "32", + "FCC", "5G", "40M", "HT", "1T", "118", "34", + "ETSI", "5G", "40M", "HT", "1T", "118", "32", + "MKK", "5G", "40M", "HT", "1T", "118", "32", + "FCC", "5G", "40M", "HT", "1T", "126", "34", + "ETSI", "5G", "40M", "HT", "1T", "126", "32", + "MKK", "5G", "40M", "HT", "1T", "126", "32", + "FCC", "5G", "40M", "HT", "1T", "134", "34", + "ETSI", "5G", "40M", "HT", "1T", "134", "32", + "MKK", "5G", "40M", "HT", "1T", "134", "32", + "FCC", "5G", "40M", "HT", "1T", "151", "34", + "ETSI", "5G", "40M", "HT", "1T", "151", "32", + "MKK", "5G", "40M", "HT", "1T", "151", "63", + "FCC", "5G", "40M", "HT", "1T", "159", "34", + "ETSI", "5G", "40M", "HT", "1T", "159", "32", + "MKK", "5G", "40M", "HT", "1T", "159", "63", + "FCC", "5G", "40M", "HT", "2T", "38", "28", + "ETSI", "5G", "40M", "HT", "2T", "38", "30", + "MKK", "5G", "40M", "HT", "2T", "38", "30", + "FCC", "5G", "40M", "HT", "2T", "46", "28", + "ETSI", "5G", "40M", "HT", "2T", "46", "30", + "MKK", "5G", "40M", "HT", "2T", "46", "30", + "FCC", "5G", "40M", "HT", "2T", "54", "30", + "ETSI", "5G", "40M", "HT", "2T", "54", "30", + "MKK", "5G", "40M", "HT", "2T", "54", "30", + "FCC", "5G", "40M", "HT", "2T", "62", "30", + "ETSI", "5G", "40M", "HT", "2T", "62", "30", + "MKK", "5G", "40M", "HT", "2T", "62", "30", + "FCC", "5G", "40M", "HT", "2T", "102", "26", + "ETSI", "5G", "40M", "HT", "2T", "102", "30", + "MKK", "5G", "40M", "HT", "2T", "102", "30", + "FCC", "5G", "40M", "HT", "2T", "110", "30", + "ETSI", "5G", "40M", "HT", "2T", "110", "30", + "MKK", "5G", "40M", "HT", "2T", "110", "30", + "FCC", "5G", "40M", "HT", "2T", "118", "34", + "ETSI", "5G", "40M", "HT", "2T", "118", "30", + "MKK", "5G", "40M", "HT", "2T", "118", "30", + "FCC", "5G", "40M", "HT", "2T", "126", "32", + "ETSI", "5G", "40M", "HT", "2T", "126", "30", + "MKK", "5G", "40M", "HT", "2T", "126", "30", + "FCC", "5G", "40M", "HT", "2T", "134", "30", + "ETSI", "5G", "40M", "HT", "2T", "134", "30", + "MKK", "5G", "40M", "HT", "2T", "134", "30", + "FCC", "5G", "40M", "HT", "2T", "151", "34", + "ETSI", "5G", "40M", "HT", "2T", "151", "30", + "MKK", "5G", "40M", "HT", "2T", "151", "63", + "FCC", "5G", "40M", "HT", "2T", "159", "34", + "ETSI", "5G", "40M", "HT", "2T", "159", "30", + "MKK", "5G", "40M", "HT", "2T", "159", "63", + "FCC", "5G", "80M", "VHT", "1T", "42", "32", + "ETSI", "5G", "80M", "VHT", "1T", "42", "32", + "MKK", "5G", "80M", "VHT", "1T", "42", "32", + "FCC", "5G", "80M", "VHT", "1T", "58", "34", + "ETSI", "5G", "80M", "VHT", "1T", "58", "32", + "MKK", "5G", "80M", "VHT", "1T", "58", "32", + "FCC", "5G", "80M", "VHT", "1T", "106", "34", + "ETSI", "5G", "80M", "VHT", "1T", "106", "32", + "MKK", "5G", "80M", "VHT", "1T", "106", "32", + "FCC", "5G", "80M", "VHT", "1T", "122", "34", + "ETSI", "5G", "80M", "VHT", "1T", "122", "32", + "MKK", "5G", "80M", "VHT", "1T", "122", "32", + "FCC", "5G", "80M", "VHT", "1T", "155", "34", + "ETSI", "5G", "80M", "VHT", "1T", "155", "32", + "MKK", "5G", "80M", "VHT", "1T", "155", "63", + "FCC", "5G", "80M", "VHT", "2T", "42", "28", + "ETSI", "5G", "80M", "VHT", "2T", "42", "30", + "MKK", "5G", "80M", "VHT", "2T", "42", "30", + "FCC", "5G", "80M", "VHT", "2T", "58", "26", + "ETSI", "5G", "80M", "VHT", "2T", "58", "30", + "MKK", "5G", "80M", "VHT", "2T", "58", "30", + "FCC", "5G", "80M", "VHT", "2T", "106", "28", + "ETSI", "5G", "80M", "VHT", "2T", "106", "30", + "MKK", "5G", "80M", "VHT", "2T", "106", "30", + "FCC", "5G", "80M", "VHT", "2T", "122", "32", + "ETSI", "5G", "80M", "VHT", "2T", "122", "30", + "MKK", "5G", "80M", "VHT", "2T", "122", "30", + "FCC", "5G", "80M", "VHT", "2T", "155", "34", + "ETSI", "5G", "80M", "VHT", "2T", "155", "30", + "MKK", "5G", "80M", "VHT", "2T", "155", "63" +}; + +void +ODM_ReadAndConfig_MP_8821A_TXPWR_LMT_8811AU_FEM( + IN PDM_ODM_T pDM_Odm + ) +{ + u4Byte i = 0; + u4Byte ArrayLen = sizeof(Array_MP_8821A_TXPWR_LMT_8811AU_FEM)/sizeof(pu1Byte); + pu1Byte *Array = Array_MP_8821A_TXPWR_LMT_8811AU_FEM; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ReadAndConfig_MP_8821A_TXPWR_LMT_8811AU_FEM\n")); + + for (i = 0; i < ArrayLen; i += 7 ) + { + pu1Byte regulation = Array[i]; + pu1Byte band = Array[i+1]; + pu1Byte bandwidth = Array[i+2]; + pu1Byte rate = Array[i+3]; + pu1Byte rfPath = Array[i+4]; + pu1Byte chnl = Array[i+5]; + pu1Byte val = Array[i+6]; + + odm_ConfigBB_TXPWR_LMT_8821A(pDM_Odm, regulation, band, bandwidth, rate, rfPath, chnl, val); + } + +} + +/****************************************************************************** +* TXPWR_LMT_8811AU_IPA.TXT +******************************************************************************/ + +pu1Byte Array_MP_8821A_TXPWR_LMT_8811AU_IPA[] = { + "FCC", "2.4G", "20M", "CCK", "1T", "01", "32", + "ETSI", "2.4G", "20M", "CCK", "1T", "01", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "01", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "02", "34", + "ETSI", "2.4G", "20M", "CCK", "1T", "02", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "02", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "03", "34", + "ETSI", "2.4G", "20M", "CCK", "1T", "03", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "03", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "04", "34", + "ETSI", "2.4G", "20M", "CCK", "1T", "04", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "04", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "05", "34", + "ETSI", "2.4G", "20M", "CCK", "1T", "05", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "05", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "06", "34", + "ETSI", "2.4G", "20M", "CCK", "1T", "06", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "06", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "07", "34", + "ETSI", "2.4G", "20M", "CCK", "1T", "07", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "07", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "08", "34", + "ETSI", "2.4G", "20M", "CCK", "1T", "08", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "08", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "09", "34", + "ETSI", "2.4G", "20M", "CCK", "1T", "09", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "09", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "10", "34", + "ETSI", "2.4G", "20M", "CCK", "1T", "10", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "10", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "11", "32", + "ETSI", "2.4G", "20M", "CCK", "1T", "11", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "11", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "12", "63", + "ETSI", "2.4G", "20M", "CCK", "1T", "12", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "12", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "13", "63", + "ETSI", "2.4G", "20M", "CCK", "1T", "13", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "13", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "14", "63", + "ETSI", "2.4G", "20M", "CCK", "1T", "14", "63", + "MKK", "2.4G", "20M", "CCK", "1T", "14", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "01", "32", + "ETSI", "2.4G", "20M", "OFDM", "1T", "01", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "01", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "02", "34", + "ETSI", "2.4G", "20M", "OFDM", "1T", "02", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "02", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "03", "34", + "ETSI", "2.4G", "20M", "OFDM", "1T", "03", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "03", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "04", "34", + "ETSI", "2.4G", "20M", "OFDM", "1T", "04", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "04", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "05", "34", + "ETSI", "2.4G", "20M", "OFDM", "1T", "05", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "05", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "06", "34", + "ETSI", "2.4G", "20M", "OFDM", "1T", "06", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "06", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "07", "34", + "ETSI", "2.4G", "20M", "OFDM", "1T", "07", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "07", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "08", "34", + "ETSI", "2.4G", "20M", "OFDM", "1T", "08", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "08", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "09", "34", + "ETSI", "2.4G", "20M", "OFDM", "1T", "09", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "09", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "10", "34", + "ETSI", "2.4G", "20M", "OFDM", "1T", "10", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "10", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "11", "32", + "ETSI", "2.4G", "20M", "OFDM", "1T", "11", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "11", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "12", "63", + "ETSI", "2.4G", "20M", "OFDM", "1T", "12", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "12", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "13", "63", + "ETSI", "2.4G", "20M", "OFDM", "1T", "13", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "13", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "14", "63", + "ETSI", "2.4G", "20M", "OFDM", "1T", "14", "63", + "MKK", "2.4G", "20M", "OFDM", "1T", "14", "63", + "FCC", "2.4G", "20M", "HT", "1T", "01", "32", + "ETSI", "2.4G", "20M", "HT", "1T", "01", "32", + "MKK", "2.4G", "20M", "HT", "1T", "01", "32", + "FCC", "2.4G", "20M", "HT", "1T", "02", "34", + "ETSI", "2.4G", "20M", "HT", "1T", "02", "32", + "MKK", "2.4G", "20M", "HT", "1T", "02", "32", + "FCC", "2.4G", "20M", "HT", "1T", "03", "34", + "ETSI", "2.4G", "20M", "HT", "1T", "03", "32", + "MKK", "2.4G", "20M", "HT", "1T", "03", "32", + "FCC", "2.4G", "20M", "HT", "1T", "04", "34", + "ETSI", "2.4G", "20M", "HT", "1T", "04", "32", + "MKK", "2.4G", "20M", "HT", "1T", "04", "32", + "FCC", "2.4G", "20M", "HT", "1T", "05", "34", + "ETSI", "2.4G", "20M", "HT", "1T", "05", "32", + "MKK", "2.4G", "20M", "HT", "1T", "05", "32", + "FCC", "2.4G", "20M", "HT", "1T", "06", "34", + "ETSI", "2.4G", "20M", "HT", "1T", "06", "32", + "MKK", "2.4G", "20M", "HT", "1T", "06", "32", + "FCC", "2.4G", "20M", "HT", "1T", "07", "34", + "ETSI", "2.4G", "20M", "HT", "1T", "07", "32", + "MKK", "2.4G", "20M", "HT", "1T", "07", "32", + "FCC", "2.4G", "20M", "HT", "1T", "08", "34", + "ETSI", "2.4G", "20M", "HT", "1T", "08", "32", + "MKK", "2.4G", "20M", "HT", "1T", "08", "32", + "FCC", "2.4G", "20M", "HT", "1T", "09", "34", + "ETSI", "2.4G", "20M", "HT", "1T", "09", "32", + "MKK", "2.4G", "20M", "HT", "1T", "09", "32", + "FCC", "2.4G", "20M", "HT", "1T", "10", "34", + "ETSI", "2.4G", "20M", "HT", "1T", "10", "32", + "MKK", "2.4G", "20M", "HT", "1T", "10", "32", + "FCC", "2.4G", "20M", "HT", "1T", "11", "32", + "ETSI", "2.4G", "20M", "HT", "1T", "11", "32", + "MKK", "2.4G", "20M", "HT", "1T", "11", "32", + "FCC", "2.4G", "20M", "HT", "1T", "12", "63", + "ETSI", "2.4G", "20M", "HT", "1T", "12", "32", + "MKK", "2.4G", "20M", "HT", "1T", "12", "32", + "FCC", "2.4G", "20M", "HT", "1T", "13", "63", + "ETSI", "2.4G", "20M", "HT", "1T", "13", "32", + "MKK", "2.4G", "20M", "HT", "1T", "13", "32", + "FCC", "2.4G", "20M", "HT", "1T", "14", "63", + "ETSI", "2.4G", "20M", "HT", "1T", "14", "63", + "MKK", "2.4G", "20M", "HT", "1T", "14", "63", + "FCC", "2.4G", "20M", "HT", "2T", "01", "30", + "ETSI", "2.4G", "20M", "HT", "2T", "01", "32", + "MKK", "2.4G", "20M", "HT", "2T", "01", "32", + "FCC", "2.4G", "20M", "HT", "2T", "02", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "02", "32", + "MKK", "2.4G", "20M", "HT", "2T", "02", "32", + "FCC", "2.4G", "20M", "HT", "2T", "03", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "03", "32", + "MKK", "2.4G", "20M", "HT", "2T", "03", "32", + "FCC", "2.4G", "20M", "HT", "2T", "04", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "04", "32", + "MKK", "2.4G", "20M", "HT", "2T", "04", "32", + "FCC", "2.4G", "20M", "HT", "2T", "05", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "05", "32", + "MKK", "2.4G", "20M", "HT", "2T", "05", "32", + "FCC", "2.4G", "20M", "HT", "2T", "06", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "06", "32", + "MKK", "2.4G", "20M", "HT", "2T", "06", "32", + "FCC", "2.4G", "20M", "HT", "2T", "07", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "07", "32", + "MKK", "2.4G", "20M", "HT", "2T", "07", "32", + "FCC", "2.4G", "20M", "HT", "2T", "08", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "08", "32", + "MKK", "2.4G", "20M", "HT", "2T", "08", "32", + "FCC", "2.4G", "20M", "HT", "2T", "09", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "09", "32", + "MKK", "2.4G", "20M", "HT", "2T", "09", "32", + "FCC", "2.4G", "20M", "HT", "2T", "10", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "10", "32", + "MKK", "2.4G", "20M", "HT", "2T", "10", "32", + "FCC", "2.4G", "20M", "HT", "2T", "11", "30", + "ETSI", "2.4G", "20M", "HT", "2T", "11", "32", + "MKK", "2.4G", "20M", "HT", "2T", "11", "32", + "FCC", "2.4G", "20M", "HT", "2T", "12", "63", + "ETSI", "2.4G", "20M", "HT", "2T", "12", "32", + "MKK", "2.4G", "20M", "HT", "2T", "12", "32", + "FCC", "2.4G", "20M", "HT", "2T", "13", "63", + "ETSI", "2.4G", "20M", "HT", "2T", "13", "32", + "MKK", "2.4G", "20M", "HT", "2T", "13", "32", + "FCC", "2.4G", "20M", "HT", "2T", "14", "63", + "ETSI", "2.4G", "20M", "HT", "2T", "14", "63", + "MKK", "2.4G", "20M", "HT", "2T", "14", "63", + "FCC", "2.4G", "40M", "HT", "1T", "01", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "01", "63", + "MKK", "2.4G", "40M", "HT", "1T", "01", "63", + "FCC", "2.4G", "40M", "HT", "1T", "02", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "02", "63", + "MKK", "2.4G", "40M", "HT", "1T", "02", "63", + "FCC", "2.4G", "40M", "HT", "1T", "03", "32", + "ETSI", "2.4G", "40M", "HT", "1T", "03", "32", + "MKK", "2.4G", "40M", "HT", "1T", "03", "32", + "FCC", "2.4G", "40M", "HT", "1T", "04", "34", + "ETSI", "2.4G", "40M", "HT", "1T", "04", "32", + "MKK", "2.4G", "40M", "HT", "1T", "04", "32", + "FCC", "2.4G", "40M", "HT", "1T", "05", "34", + "ETSI", "2.4G", "40M", "HT", "1T", "05", "32", + "MKK", "2.4G", "40M", "HT", "1T", "05", "32", + "FCC", "2.4G", "40M", "HT", "1T", "06", "34", + "ETSI", "2.4G", "40M", "HT", "1T", "06", "32", + "MKK", "2.4G", "40M", "HT", "1T", "06", "32", + "FCC", "2.4G", "40M", "HT", "1T", "07", "34", + "ETSI", "2.4G", "40M", "HT", "1T", "07", "32", + "MKK", "2.4G", "40M", "HT", "1T", "07", "32", + "FCC", "2.4G", "40M", "HT", "1T", "08", "34", + "ETSI", "2.4G", "40M", "HT", "1T", "08", "32", + "MKK", "2.4G", "40M", "HT", "1T", "08", "32", + "FCC", "2.4G", "40M", "HT", "1T", "09", "34", + "ETSI", "2.4G", "40M", "HT", "1T", "09", "32", + "MKK", "2.4G", "40M", "HT", "1T", "09", "32", + "FCC", "2.4G", "40M", "HT", "1T", "10", "34", + "ETSI", "2.4G", "40M", "HT", "1T", "10", "32", + "MKK", "2.4G", "40M", "HT", "1T", "10", "32", + "FCC", "2.4G", "40M", "HT", "1T", "11", "32", + "ETSI", "2.4G", "40M", "HT", "1T", "11", "32", + "MKK", "2.4G", "40M", "HT", "1T", "11", "32", + "FCC", "2.4G", "40M", "HT", "1T", "12", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "12", "32", + "MKK", "2.4G", "40M", "HT", "1T", "12", "32", + "FCC", "2.4G", "40M", "HT", "1T", "13", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "13", "32", + "MKK", "2.4G", "40M", "HT", "1T", "13", "32", + "FCC", "2.4G", "40M", "HT", "1T", "14", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "14", "63", + "MKK", "2.4G", "40M", "HT", "1T", "14", "63", + "FCC", "2.4G", "40M", "HT", "2T", "01", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "01", "63", + "MKK", "2.4G", "40M", "HT", "2T", "01", "63", + "FCC", "2.4G", "40M", "HT", "2T", "02", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "02", "63", + "MKK", "2.4G", "40M", "HT", "2T", "02", "63", + "FCC", "2.4G", "40M", "HT", "2T", "03", "30", + "ETSI", "2.4G", "40M", "HT", "2T", "03", "30", + "MKK", "2.4G", "40M", "HT", "2T", "03", "30", + "FCC", "2.4G", "40M", "HT", "2T", "04", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "04", "30", + "MKK", "2.4G", "40M", "HT", "2T", "04", "30", + "FCC", "2.4G", "40M", "HT", "2T", "05", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "05", "30", + "MKK", "2.4G", "40M", "HT", "2T", "05", "30", + "FCC", "2.4G", "40M", "HT", "2T", "06", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "06", "30", + "MKK", "2.4G", "40M", "HT", "2T", "06", "30", + "FCC", "2.4G", "40M", "HT", "2T", "07", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "07", "30", + "MKK", "2.4G", "40M", "HT", "2T", "07", "30", + "FCC", "2.4G", "40M", "HT", "2T", "08", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "08", "30", + "MKK", "2.4G", "40M", "HT", "2T", "08", "30", + "FCC", "2.4G", "40M", "HT", "2T", "09", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "09", "30", + "MKK", "2.4G", "40M", "HT", "2T", "09", "30", + "FCC", "2.4G", "40M", "HT", "2T", "10", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "10", "30", + "MKK", "2.4G", "40M", "HT", "2T", "10", "30", + "FCC", "2.4G", "40M", "HT", "2T", "11", "30", + "ETSI", "2.4G", "40M", "HT", "2T", "11", "30", + "MKK", "2.4G", "40M", "HT", "2T", "11", "30", + "FCC", "2.4G", "40M", "HT", "2T", "12", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "12", "32", + "MKK", "2.4G", "40M", "HT", "2T", "12", "32", + "FCC", "2.4G", "40M", "HT", "2T", "13", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "13", "32", + "MKK", "2.4G", "40M", "HT", "2T", "13", "32", + "FCC", "2.4G", "40M", "HT", "2T", "14", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "14", "63", + "MKK", "2.4G", "40M", "HT", "2T", "14", "63", + "FCC", "5G", "20M", "OFDM", "1T", "36", "30", + "ETSI", "5G", "20M", "OFDM", "1T", "36", "30", + "MKK", "5G", "20M", "OFDM", "1T", "36", "30", + "FCC", "5G", "20M", "OFDM", "1T", "40", "30", + "ETSI", "5G", "20M", "OFDM", "1T", "40", "30", + "MKK", "5G", "20M", "OFDM", "1T", "40", "30", + "FCC", "5G", "20M", "OFDM", "1T", "44", "30", + "ETSI", "5G", "20M", "OFDM", "1T", "44", "30", + "MKK", "5G", "20M", "OFDM", "1T", "44", "30", + "FCC", "5G", "20M", "OFDM", "1T", "48", "30", + "ETSI", "5G", "20M", "OFDM", "1T", "48", "30", + "MKK", "5G", "20M", "OFDM", "1T", "48", "30", + "FCC", "5G", "20M", "OFDM", "1T", "52", "30", + "ETSI", "5G", "20M", "OFDM", "1T", "52", "30", + "MKK", "5G", "20M", "OFDM", "1T", "52", "30", + "FCC", "5G", "20M", "OFDM", "1T", "56", "30", + "ETSI", "5G", "20M", "OFDM", "1T", "56", "30", + "MKK", "5G", "20M", "OFDM", "1T", "56", "30", + "FCC", "5G", "20M", "OFDM", "1T", "60", "30", + "ETSI", "5G", "20M", "OFDM", "1T", "60", "30", + "MKK", "5G", "20M", "OFDM", "1T", "60", "30", + "FCC", "5G", "20M", "OFDM", "1T", "64", "30", + "ETSI", "5G", "20M", "OFDM", "1T", "64", "30", + "MKK", "5G", "20M", "OFDM", "1T", "64", "30", + "FCC", "5G", "20M", "OFDM", "1T", "100", "30", + "ETSI", "5G", "20M", "OFDM", "1T", "100", "30", + "MKK", "5G", "20M", "OFDM", "1T", "100", "30", + "FCC", "5G", "20M", "OFDM", "1T", "114", "30", + "ETSI", "5G", "20M", "OFDM", "1T", "114", "30", + "MKK", "5G", "20M", "OFDM", "1T", "114", "30", + "FCC", "5G", "20M", "OFDM", "1T", "108", "30", + "ETSI", "5G", "20M", "OFDM", "1T", "108", "30", + "MKK", "5G", "20M", "OFDM", "1T", "108", "30", + "FCC", "5G", "20M", "OFDM", "1T", "112", "30", + "ETSI", "5G", "20M", "OFDM", "1T", "112", "30", + "MKK", "5G", "20M", "OFDM", "1T", "112", "30", + "FCC", "5G", "20M", "OFDM", "1T", "116", "30", + "ETSI", "5G", "20M", "OFDM", "1T", "116", "30", + "MKK", "5G", "20M", "OFDM", "1T", "116", "30", + "FCC", "5G", "20M", "OFDM", "1T", "120", "30", + "ETSI", "5G", "20M", "OFDM", "1T", "120", "30", + "MKK", "5G", "20M", "OFDM", "1T", "120", "30", + "FCC", "5G", "20M", "OFDM", "1T", "124", "30", + "ETSI", "5G", "20M", "OFDM", "1T", "124", "30", + "MKK", "5G", "20M", "OFDM", "1T", "124", "30", + "FCC", "5G", "20M", "OFDM", "1T", "128", "30", + "ETSI", "5G", "20M", "OFDM", "1T", "128", "30", + "MKK", "5G", "20M", "OFDM", "1T", "128", "30", + "FCC", "5G", "20M", "OFDM", "1T", "132", "30", + "ETSI", "5G", "20M", "OFDM", "1T", "132", "30", + "MKK", "5G", "20M", "OFDM", "1T", "132", "30", + "FCC", "5G", "20M", "OFDM", "1T", "136", "30", + "ETSI", "5G", "20M", "OFDM", "1T", "136", "30", + "MKK", "5G", "20M", "OFDM", "1T", "136", "30", + "FCC", "5G", "20M", "OFDM", "1T", "140", "30", + "ETSI", "5G", "20M", "OFDM", "1T", "140", "30", + "MKK", "5G", "20M", "OFDM", "1T", "140", "30", + "FCC", "5G", "20M", "OFDM", "1T", "149", "30", + "ETSI", "5G", "20M", "OFDM", "1T", "149", "30", + "MKK", "5G", "20M", "OFDM", "1T", "149", "63", + "FCC", "5G", "20M", "OFDM", "1T", "153", "30", + "ETSI", "5G", "20M", "OFDM", "1T", "153", "30", + "MKK", "5G", "20M", "OFDM", "1T", "153", "63", + "FCC", "5G", "20M", "OFDM", "1T", "157", "30", + "ETSI", "5G", "20M", "OFDM", "1T", "157", "30", + "MKK", "5G", "20M", "OFDM", "1T", "157", "63", + "FCC", "5G", "20M", "OFDM", "1T", "161", "30", + "ETSI", "5G", "20M", "OFDM", "1T", "161", "30", + "MKK", "5G", "20M", "OFDM", "1T", "161", "63", + "FCC", "5G", "20M", "OFDM", "1T", "165", "30", + "ETSI", "5G", "20M", "OFDM", "1T", "165", "30", + "MKK", "5G", "20M", "OFDM", "1T", "165", "63", + "FCC", "5G", "20M", "HT", "1T", "36", "30", + "ETSI", "5G", "20M", "HT", "1T", "36", "30", + "MKK", "5G", "20M", "HT", "1T", "36", "30", + "FCC", "5G", "20M", "HT", "1T", "40", "30", + "ETSI", "5G", "20M", "HT", "1T", "40", "30", + "MKK", "5G", "20M", "HT", "1T", "40", "30", + "FCC", "5G", "20M", "HT", "1T", "44", "30", + "ETSI", "5G", "20M", "HT", "1T", "44", "30", + "MKK", "5G", "20M", "HT", "1T", "44", "30", + "FCC", "5G", "20M", "HT", "1T", "48", "30", + "ETSI", "5G", "20M", "HT", "1T", "48", "30", + "MKK", "5G", "20M", "HT", "1T", "48", "30", + "FCC", "5G", "20M", "HT", "1T", "52", "30", + "ETSI", "5G", "20M", "HT", "1T", "52", "30", + "MKK", "5G", "20M", "HT", "1T", "52", "30", + "FCC", "5G", "20M", "HT", "1T", "56", "30", + "ETSI", "5G", "20M", "HT", "1T", "56", "30", + "MKK", "5G", "20M", "HT", "1T", "56", "30", + "FCC", "5G", "20M", "HT", "1T", "60", "30", + "ETSI", "5G", "20M", "HT", "1T", "60", "30", + "MKK", "5G", "20M", "HT", "1T", "60", "30", + "FCC", "5G", "20M", "HT", "1T", "64", "30", + "ETSI", "5G", "20M", "HT", "1T", "64", "30", + "MKK", "5G", "20M", "HT", "1T", "64", "30", + "FCC", "5G", "20M", "HT", "1T", "100", "30", + "ETSI", "5G", "20M", "HT", "1T", "100", "30", + "MKK", "5G", "20M", "HT", "1T", "100", "30", + "FCC", "5G", "20M", "HT", "1T", "114", "30", + "ETSI", "5G", "20M", "HT", "1T", "114", "30", + "MKK", "5G", "20M", "HT", "1T", "114", "30", + "FCC", "5G", "20M", "HT", "1T", "108", "30", + "ETSI", "5G", "20M", "HT", "1T", "108", "30", + "MKK", "5G", "20M", "HT", "1T", "108", "30", + "FCC", "5G", "20M", "HT", "1T", "112", "30", + "ETSI", "5G", "20M", "HT", "1T", "112", "30", + "MKK", "5G", "20M", "HT", "1T", "112", "30", + "FCC", "5G", "20M", "HT", "1T", "116", "30", + "ETSI", "5G", "20M", "HT", "1T", "116", "30", + "MKK", "5G", "20M", "HT", "1T", "116", "30", + "FCC", "5G", "20M", "HT", "1T", "120", "30", + "ETSI", "5G", "20M", "HT", "1T", "120", "30", + "MKK", "5G", "20M", "HT", "1T", "120", "30", + "FCC", "5G", "20M", "HT", "1T", "124", "30", + "ETSI", "5G", "20M", "HT", "1T", "124", "30", + "MKK", "5G", "20M", "HT", "1T", "124", "30", + "FCC", "5G", "20M", "HT", "1T", "128", "30", + "ETSI", "5G", "20M", "HT", "1T", "128", "30", + "MKK", "5G", "20M", "HT", "1T", "128", "30", + "FCC", "5G", "20M", "HT", "1T", "132", "30", + "ETSI", "5G", "20M", "HT", "1T", "132", "30", + "MKK", "5G", "20M", "HT", "1T", "132", "30", + "FCC", "5G", "20M", "HT", "1T", "136", "30", + "ETSI", "5G", "20M", "HT", "1T", "136", "30", + "MKK", "5G", "20M", "HT", "1T", "136", "30", + "FCC", "5G", "20M", "HT", "1T", "140", "30", + "ETSI", "5G", "20M", "HT", "1T", "140", "30", + "MKK", "5G", "20M", "HT", "1T", "140", "30", + "FCC", "5G", "20M", "HT", "1T", "149", "30", + "ETSI", "5G", "20M", "HT", "1T", "149", "30", + "MKK", "5G", "20M", "HT", "1T", "149", "63", + "FCC", "5G", "20M", "HT", "1T", "153", "30", + "ETSI", "5G", "20M", "HT", "1T", "153", "30", + "MKK", "5G", "20M", "HT", "1T", "153", "63", + "FCC", "5G", "20M", "HT", "1T", "157", "30", + "ETSI", "5G", "20M", "HT", "1T", "157", "30", + "MKK", "5G", "20M", "HT", "1T", "157", "63", + "FCC", "5G", "20M", "HT", "1T", "161", "30", + "ETSI", "5G", "20M", "HT", "1T", "161", "30", + "MKK", "5G", "20M", "HT", "1T", "161", "63", + "FCC", "5G", "20M", "HT", "1T", "165", "30", + "ETSI", "5G", "20M", "HT", "1T", "165", "30", + "MKK", "5G", "20M", "HT", "1T", "165", "63", + "FCC", "5G", "20M", "HT", "2T", "36", "28", + "ETSI", "5G", "20M", "HT", "2T", "36", "30", + "MKK", "5G", "20M", "HT", "2T", "36", "30", + "FCC", "5G", "20M", "HT", "2T", "40", "28", + "ETSI", "5G", "20M", "HT", "2T", "40", "30", + "MKK", "5G", "20M", "HT", "2T", "40", "30", + "FCC", "5G", "20M", "HT", "2T", "44", "28", + "ETSI", "5G", "20M", "HT", "2T", "44", "30", + "MKK", "5G", "20M", "HT", "2T", "44", "30", + "FCC", "5G", "20M", "HT", "2T", "48", "28", + "ETSI", "5G", "20M", "HT", "2T", "48", "30", + "MKK", "5G", "20M", "HT", "2T", "48", "30", + "FCC", "5G", "20M", "HT", "2T", "52", "34", + "ETSI", "5G", "20M", "HT", "2T", "52", "30", + "MKK", "5G", "20M", "HT", "2T", "52", "30", + "FCC", "5G", "20M", "HT", "2T", "56", "32", + "ETSI", "5G", "20M", "HT", "2T", "56", "30", + "MKK", "5G", "20M", "HT", "2T", "56", "30", + "FCC", "5G", "20M", "HT", "2T", "60", "30", + "ETSI", "5G", "20M", "HT", "2T", "60", "30", + "MKK", "5G", "20M", "HT", "2T", "60", "30", + "FCC", "5G", "20M", "HT", "2T", "64", "26", + "ETSI", "5G", "20M", "HT", "2T", "64", "30", + "MKK", "5G", "20M", "HT", "2T", "64", "30", + "FCC", "5G", "20M", "HT", "2T", "100", "28", + "ETSI", "5G", "20M", "HT", "2T", "100", "30", + "MKK", "5G", "20M", "HT", "2T", "100", "30", + "FCC", "5G", "20M", "HT", "2T", "114", "28", + "ETSI", "5G", "20M", "HT", "2T", "114", "30", + "MKK", "5G", "20M", "HT", "2T", "114", "30", + "FCC", "5G", "20M", "HT", "2T", "108", "30", + "ETSI", "5G", "20M", "HT", "2T", "108", "30", + "MKK", "5G", "20M", "HT", "2T", "108", "30", + "FCC", "5G", "20M", "HT", "2T", "112", "32", + "ETSI", "5G", "20M", "HT", "2T", "112", "30", + "MKK", "5G", "20M", "HT", "2T", "112", "30", + "FCC", "5G", "20M", "HT", "2T", "116", "32", + "ETSI", "5G", "20M", "HT", "2T", "116", "30", + "MKK", "5G", "20M", "HT", "2T", "116", "30", + "FCC", "5G", "20M", "HT", "2T", "120", "34", + "ETSI", "5G", "20M", "HT", "2T", "120", "30", + "MKK", "5G", "20M", "HT", "2T", "120", "30", + "FCC", "5G", "20M", "HT", "2T", "124", "32", + "ETSI", "5G", "20M", "HT", "2T", "124", "30", + "MKK", "5G", "20M", "HT", "2T", "124", "30", + "FCC", "5G", "20M", "HT", "2T", "128", "30", + "ETSI", "5G", "20M", "HT", "2T", "128", "30", + "MKK", "5G", "20M", "HT", "2T", "128", "30", + "FCC", "5G", "20M", "HT", "2T", "132", "28", + "ETSI", "5G", "20M", "HT", "2T", "132", "30", + "MKK", "5G", "20M", "HT", "2T", "132", "30", + "FCC", "5G", "20M", "HT", "2T", "136", "28", + "ETSI", "5G", "20M", "HT", "2T", "136", "30", + "MKK", "5G", "20M", "HT", "2T", "136", "30", + "FCC", "5G", "20M", "HT", "2T", "140", "26", + "ETSI", "5G", "20M", "HT", "2T", "140", "30", + "MKK", "5G", "20M", "HT", "2T", "140", "30", + "FCC", "5G", "20M", "HT", "2T", "149", "34", + "ETSI", "5G", "20M", "HT", "2T", "149", "30", + "MKK", "5G", "20M", "HT", "2T", "149", "63", + "FCC", "5G", "20M", "HT", "2T", "153", "34", + "ETSI", "5G", "20M", "HT", "2T", "153", "30", + "MKK", "5G", "20M", "HT", "2T", "153", "63", + "FCC", "5G", "20M", "HT", "2T", "157", "34", + "ETSI", "5G", "20M", "HT", "2T", "157", "30", + "MKK", "5G", "20M", "HT", "2T", "157", "63", + "FCC", "5G", "20M", "HT", "2T", "161", "34", + "ETSI", "5G", "20M", "HT", "2T", "161", "30", + "MKK", "5G", "20M", "HT", "2T", "161", "63", + "FCC", "5G", "20M", "HT", "2T", "165", "34", + "ETSI", "5G", "20M", "HT", "2T", "165", "30", + "MKK", "5G", "20M", "HT", "2T", "165", "63", + "FCC", "5G", "40M", "HT", "1T", "38", "28", + "ETSI", "5G", "40M", "HT", "1T", "38", "30", + "MKK", "5G", "40M", "HT", "1T", "38", "30", + "FCC", "5G", "40M", "HT", "1T", "46", "28", + "ETSI", "5G", "40M", "HT", "1T", "46", "30", + "MKK", "5G", "40M", "HT", "1T", "46", "30", + "FCC", "5G", "40M", "HT", "1T", "54", "28", + "ETSI", "5G", "40M", "HT", "1T", "54", "30", + "MKK", "5G", "40M", "HT", "1T", "54", "30", + "FCC", "5G", "40M", "HT", "1T", "62", "28", + "ETSI", "5G", "40M", "HT", "1T", "62", "30", + "MKK", "5G", "40M", "HT", "1T", "62", "30", + "FCC", "5G", "40M", "HT", "1T", "102", "28", + "ETSI", "5G", "40M", "HT", "1T", "102", "30", + "MKK", "5G", "40M", "HT", "1T", "102", "30", + "FCC", "5G", "40M", "HT", "1T", "110", "28", + "ETSI", "5G", "40M", "HT", "1T", "110", "30", + "MKK", "5G", "40M", "HT", "1T", "110", "30", + "FCC", "5G", "40M", "HT", "1T", "118", "28", + "ETSI", "5G", "40M", "HT", "1T", "118", "30", + "MKK", "5G", "40M", "HT", "1T", "118", "30", + "FCC", "5G", "40M", "HT", "1T", "126", "28", + "ETSI", "5G", "40M", "HT", "1T", "126", "30", + "MKK", "5G", "40M", "HT", "1T", "126", "30", + "FCC", "5G", "40M", "HT", "1T", "134", "28", + "ETSI", "5G", "40M", "HT", "1T", "134", "30", + "MKK", "5G", "40M", "HT", "1T", "134", "30", + "FCC", "5G", "40M", "HT", "1T", "151", "30", + "ETSI", "5G", "40M", "HT", "1T", "151", "30", + "MKK", "5G", "40M", "HT", "1T", "151", "63", + "FCC", "5G", "40M", "HT", "1T", "159", "30", + "ETSI", "5G", "40M", "HT", "1T", "159", "30", + "MKK", "5G", "40M", "HT", "1T", "159", "63", + "FCC", "5G", "40M", "HT", "2T", "38", "28", + "ETSI", "5G", "40M", "HT", "2T", "38", "30", + "MKK", "5G", "40M", "HT", "2T", "38", "30", + "FCC", "5G", "40M", "HT", "2T", "46", "28", + "ETSI", "5G", "40M", "HT", "2T", "46", "30", + "MKK", "5G", "40M", "HT", "2T", "46", "30", + "FCC", "5G", "40M", "HT", "2T", "54", "30", + "ETSI", "5G", "40M", "HT", "2T", "54", "30", + "MKK", "5G", "40M", "HT", "2T", "54", "30", + "FCC", "5G", "40M", "HT", "2T", "62", "30", + "ETSI", "5G", "40M", "HT", "2T", "62", "30", + "MKK", "5G", "40M", "HT", "2T", "62", "30", + "FCC", "5G", "40M", "HT", "2T", "102", "26", + "ETSI", "5G", "40M", "HT", "2T", "102", "30", + "MKK", "5G", "40M", "HT", "2T", "102", "30", + "FCC", "5G", "40M", "HT", "2T", "110", "30", + "ETSI", "5G", "40M", "HT", "2T", "110", "30", + "MKK", "5G", "40M", "HT", "2T", "110", "30", + "FCC", "5G", "40M", "HT", "2T", "118", "34", + "ETSI", "5G", "40M", "HT", "2T", "118", "30", + "MKK", "5G", "40M", "HT", "2T", "118", "30", + "FCC", "5G", "40M", "HT", "2T", "126", "32", + "ETSI", "5G", "40M", "HT", "2T", "126", "30", + "MKK", "5G", "40M", "HT", "2T", "126", "30", + "FCC", "5G", "40M", "HT", "2T", "134", "30", + "ETSI", "5G", "40M", "HT", "2T", "134", "30", + "MKK", "5G", "40M", "HT", "2T", "134", "30", + "FCC", "5G", "40M", "HT", "2T", "151", "34", + "ETSI", "5G", "40M", "HT", "2T", "151", "30", + "MKK", "5G", "40M", "HT", "2T", "151", "63", + "FCC", "5G", "40M", "HT", "2T", "159", "34", + "ETSI", "5G", "40M", "HT", "2T", "159", "30", + "MKK", "5G", "40M", "HT", "2T", "159", "63", + "FCC", "5G", "80M", "VHT", "1T", "42", "28", + "ETSI", "5G", "80M", "VHT", "1T", "42", "30", + "MKK", "5G", "80M", "VHT", "1T", "42", "30", + "FCC", "5G", "80M", "VHT", "1T", "58", "26", + "ETSI", "5G", "80M", "VHT", "1T", "58", "30", + "MKK", "5G", "80M", "VHT", "1T", "58", "30", + "FCC", "5G", "80M", "VHT", "1T", "106", "30", + "ETSI", "5G", "80M", "VHT", "1T", "106", "30", + "MKK", "5G", "80M", "VHT", "1T", "106", "30", + "FCC", "5G", "80M", "VHT", "1T", "122", "30", + "ETSI", "5G", "80M", "VHT", "1T", "122", "30", + "MKK", "5G", "80M", "VHT", "1T", "122", "30", + "FCC", "5G", "80M", "VHT", "1T", "155", "30", + "ETSI", "5G", "80M", "VHT", "1T", "155", "30", + "MKK", "5G", "80M", "VHT", "1T", "155", "63", + "FCC", "5G", "80M", "VHT", "2T", "42", "28", + "ETSI", "5G", "80M", "VHT", "2T", "42", "30", + "MKK", "5G", "80M", "VHT", "2T", "42", "30", + "FCC", "5G", "80M", "VHT", "2T", "58", "26", + "ETSI", "5G", "80M", "VHT", "2T", "58", "30", + "MKK", "5G", "80M", "VHT", "2T", "58", "30", + "FCC", "5G", "80M", "VHT", "2T", "106", "28", + "ETSI", "5G", "80M", "VHT", "2T", "106", "30", + "MKK", "5G", "80M", "VHT", "2T", "106", "30", + "FCC", "5G", "80M", "VHT", "2T", "122", "32", + "ETSI", "5G", "80M", "VHT", "2T", "122", "30", + "MKK", "5G", "80M", "VHT", "2T", "122", "30", + "FCC", "5G", "80M", "VHT", "2T", "155", "34", + "ETSI", "5G", "80M", "VHT", "2T", "155", "30", + "MKK", "5G", "80M", "VHT", "2T", "155", "63" +}; + +void +ODM_ReadAndConfig_MP_8821A_TXPWR_LMT_8811AU_IPA( + IN PDM_ODM_T pDM_Odm + ) +{ + u4Byte i = 0; + u4Byte ArrayLen = sizeof(Array_MP_8821A_TXPWR_LMT_8811AU_IPA)/sizeof(pu1Byte); + pu1Byte *Array = Array_MP_8821A_TXPWR_LMT_8811AU_IPA; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ReadAndConfig_MP_8821A_TXPWR_LMT_8811AU_IPA\n")); + + for (i = 0; i < ArrayLen; i += 7 ) + { + pu1Byte regulation = Array[i]; + pu1Byte band = Array[i+1]; + pu1Byte bandwidth = Array[i+2]; + pu1Byte rate = Array[i+3]; + pu1Byte rfPath = Array[i+4]; + pu1Byte chnl = Array[i+5]; + pu1Byte val = Array[i+6]; + + odm_ConfigBB_TXPWR_LMT_8821A(pDM_Odm, regulation, band, bandwidth, rate, rfPath, chnl, val); + } + +} + +/****************************************************************************** +* TXPWR_LMT_8821A.TXT +******************************************************************************/ + +pu1Byte Array_MP_8821A_TXPWR_LMT_8821A[] = { + "FCC", "2.4G", "20M", "CCK", "1T", "01", "32", + "ETSI", "2.4G", "20M", "CCK", "1T", "01", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "01", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "02", "32", + "ETSI", "2.4G", "20M", "CCK", "1T", "02", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "02", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "03", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "03", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "03", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "04", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "04", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "04", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "05", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "05", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "05", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "06", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "06", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "06", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "07", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "07", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "07", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "08", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "08", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "08", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "09", "32", + "ETSI", "2.4G", "20M", "CCK", "1T", "09", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "09", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "10", "32", + "ETSI", "2.4G", "20M", "CCK", "1T", "10", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "10", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "11", "32", + "ETSI", "2.4G", "20M", "CCK", "1T", "11", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "11", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "12", "63", + "ETSI", "2.4G", "20M", "CCK", "1T", "12", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "12", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "13", "63", + "ETSI", "2.4G", "20M", "CCK", "1T", "13", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "13", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "14", "63", + "ETSI", "2.4G", "20M", "CCK", "1T", "14", "63", + "MKK", "2.4G", "20M", "CCK", "1T", "14", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "01", "30", + "ETSI", "2.4G", "20M", "OFDM", "1T", "01", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "01", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "02", "30", + "ETSI", "2.4G", "20M", "OFDM", "1T", "02", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "02", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "03", "32", + "ETSI", "2.4G", "20M", "OFDM", "1T", "03", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "03", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "04", "32", + "ETSI", "2.4G", "20M", "OFDM", "1T", "04", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "04", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "05", "32", + "ETSI", "2.4G", "20M", "OFDM", "1T", "05", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "05", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "06", "32", + "ETSI", "2.4G", "20M", "OFDM", "1T", "06", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "06", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "07", "32", + "ETSI", "2.4G", "20M", "OFDM", "1T", "07", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "07", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "08", "32", + "ETSI", "2.4G", "20M", "OFDM", "1T", "08", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "08", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "09", "30", + "ETSI", "2.4G", "20M", "OFDM", "1T", "09", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "09", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "10", "30", + "ETSI", "2.4G", "20M", "OFDM", "1T", "10", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "10", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "11", "30", + "ETSI", "2.4G", "20M", "OFDM", "1T", "11", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "11", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "12", "63", + "ETSI", "2.4G", "20M", "OFDM", "1T", "12", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "12", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "13", "63", + "ETSI", "2.4G", "20M", "OFDM", "1T", "13", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "13", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "14", "63", + "ETSI", "2.4G", "20M", "OFDM", "1T", "14", "63", + "MKK", "2.4G", "20M", "OFDM", "1T", "14", "63", + "FCC", "2.4G", "20M", "HT", "1T", "01", "26", + "ETSI", "2.4G", "20M", "HT", "1T", "01", "32", + "MKK", "2.4G", "20M", "HT", "1T", "01", "32", + "FCC", "2.4G", "20M", "HT", "1T", "02", "26", + "ETSI", "2.4G", "20M", "HT", "1T", "02", "32", + "MKK", "2.4G", "20M", "HT", "1T", "02", "32", + "FCC", "2.4G", "20M", "HT", "1T", "03", "32", + "ETSI", "2.4G", "20M", "HT", "1T", "03", "32", + "MKK", "2.4G", "20M", "HT", "1T", "03", "32", + "FCC", "2.4G", "20M", "HT", "1T", "04", "32", + "ETSI", "2.4G", "20M", "HT", "1T", "04", "32", + "MKK", "2.4G", "20M", "HT", "1T", "04", "32", + "FCC", "2.4G", "20M", "HT", "1T", "05", "32", + "ETSI", "2.4G", "20M", "HT", "1T", "05", "32", + "MKK", "2.4G", "20M", "HT", "1T", "05", "32", + "FCC", "2.4G", "20M", "HT", "1T", "06", "32", + "ETSI", "2.4G", "20M", "HT", "1T", "06", "32", + "MKK", "2.4G", "20M", "HT", "1T", "06", "32", + "FCC", "2.4G", "20M", "HT", "1T", "07", "32", + "ETSI", "2.4G", "20M", "HT", "1T", "07", "32", + "MKK", "2.4G", "20M", "HT", "1T", "07", "32", + "FCC", "2.4G", "20M", "HT", "1T", "08", "32", + "ETSI", "2.4G", "20M", "HT", "1T", "08", "32", + "MKK", "2.4G", "20M", "HT", "1T", "08", "32", + "FCC", "2.4G", "20M", "HT", "1T", "09", "26", + "ETSI", "2.4G", "20M", "HT", "1T", "09", "32", + "MKK", "2.4G", "20M", "HT", "1T", "09", "32", + "FCC", "2.4G", "20M", "HT", "1T", "10", "26", + "ETSI", "2.4G", "20M", "HT", "1T", "10", "32", + "MKK", "2.4G", "20M", "HT", "1T", "10", "32", + "FCC", "2.4G", "20M", "HT", "1T", "11", "26", + "ETSI", "2.4G", "20M", "HT", "1T", "11", "32", + "MKK", "2.4G", "20M", "HT", "1T", "11", "32", + "FCC", "2.4G", "20M", "HT", "1T", "12", "63", + "ETSI", "2.4G", "20M", "HT", "1T", "12", "32", + "MKK", "2.4G", "20M", "HT", "1T", "12", "32", + "FCC", "2.4G", "20M", "HT", "1T", "13", "63", + "ETSI", "2.4G", "20M", "HT", "1T", "13", "32", + "MKK", "2.4G", "20M", "HT", "1T", "13", "32", + "FCC", "2.4G", "20M", "HT", "1T", "14", "63", + "ETSI", "2.4G", "20M", "HT", "1T", "14", "63", + "MKK", "2.4G", "20M", "HT", "1T", "14", "63", + "FCC", "2.4G", "20M", "HT", "2T", "01", "30", + "ETSI", "2.4G", "20M", "HT", "2T", "01", "32", + "MKK", "2.4G", "20M", "HT", "2T", "01", "32", + "FCC", "2.4G", "20M", "HT", "2T", "02", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "02", "32", + "MKK", "2.4G", "20M", "HT", "2T", "02", "32", + "FCC", "2.4G", "20M", "HT", "2T", "03", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "03", "32", + "MKK", "2.4G", "20M", "HT", "2T", "03", "32", + "FCC", "2.4G", "20M", "HT", "2T", "04", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "04", "32", + "MKK", "2.4G", "20M", "HT", "2T", "04", "32", + "FCC", "2.4G", "20M", "HT", "2T", "05", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "05", "32", + "MKK", "2.4G", "20M", "HT", "2T", "05", "32", + "FCC", "2.4G", "20M", "HT", "2T", "06", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "06", "32", + "MKK", "2.4G", "20M", "HT", "2T", "06", "32", + "FCC", "2.4G", "20M", "HT", "2T", "07", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "07", "32", + "MKK", "2.4G", "20M", "HT", "2T", "07", "32", + "FCC", "2.4G", "20M", "HT", "2T", "08", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "08", "32", + "MKK", "2.4G", "20M", "HT", "2T", "08", "32", + "FCC", "2.4G", "20M", "HT", "2T", "09", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "09", "32", + "MKK", "2.4G", "20M", "HT", "2T", "09", "32", + "FCC", "2.4G", "20M", "HT", "2T", "10", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "10", "32", + "MKK", "2.4G", "20M", "HT", "2T", "10", "32", + "FCC", "2.4G", "20M", "HT", "2T", "11", "30", + "ETSI", "2.4G", "20M", "HT", "2T", "11", "32", + "MKK", "2.4G", "20M", "HT", "2T", "11", "32", + "FCC", "2.4G", "20M", "HT", "2T", "12", "63", + "ETSI", "2.4G", "20M", "HT", "2T", "12", "32", + "MKK", "2.4G", "20M", "HT", "2T", "12", "32", + "FCC", "2.4G", "20M", "HT", "2T", "13", "63", + "ETSI", "2.4G", "20M", "HT", "2T", "13", "32", + "MKK", "2.4G", "20M", "HT", "2T", "13", "32", + "FCC", "2.4G", "20M", "HT", "2T", "14", "63", + "ETSI", "2.4G", "20M", "HT", "2T", "14", "63", + "MKK", "2.4G", "20M", "HT", "2T", "14", "63", + "FCC", "2.4G", "40M", "HT", "1T", "01", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "01", "63", + "MKK", "2.4G", "40M", "HT", "1T", "01", "63", + "FCC", "2.4G", "40M", "HT", "1T", "02", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "02", "63", + "MKK", "2.4G", "40M", "HT", "1T", "02", "63", + "FCC", "2.4G", "40M", "HT", "1T", "03", "26", + "ETSI", "2.4G", "40M", "HT", "1T", "03", "32", + "MKK", "2.4G", "40M", "HT", "1T", "03", "32", + "FCC", "2.4G", "40M", "HT", "1T", "04", "26", + "ETSI", "2.4G", "40M", "HT", "1T", "04", "32", + "MKK", "2.4G", "40M", "HT", "1T", "04", "32", + "FCC", "2.4G", "40M", "HT", "1T", "05", "26", + "ETSI", "2.4G", "40M", "HT", "1T", "05", "32", + "MKK", "2.4G", "40M", "HT", "1T", "05", "32", + "FCC", "2.4G", "40M", "HT", "1T", "06", "32", + "ETSI", "2.4G", "40M", "HT", "1T", "06", "32", + "MKK", "2.4G", "40M", "HT", "1T", "06", "32", + "FCC", "2.4G", "40M", "HT", "1T", "07", "32", + "ETSI", "2.4G", "40M", "HT", "1T", "07", "32", + "MKK", "2.4G", "40M", "HT", "1T", "07", "32", + "FCC", "2.4G", "40M", "HT", "1T", "08", "32", + "ETSI", "2.4G", "40M", "HT", "1T", "08", "32", + "MKK", "2.4G", "40M", "HT", "1T", "08", "32", + "FCC", "2.4G", "40M", "HT", "1T", "09", "26", + "ETSI", "2.4G", "40M", "HT", "1T", "09", "32", + "MKK", "2.4G", "40M", "HT", "1T", "09", "32", + "FCC", "2.4G", "40M", "HT", "1T", "10", "26", + "ETSI", "2.4G", "40M", "HT", "1T", "10", "32", + "MKK", "2.4G", "40M", "HT", "1T", "10", "32", + "FCC", "2.4G", "40M", "HT", "1T", "11", "26", + "ETSI", "2.4G", "40M", "HT", "1T", "11", "32", + "MKK", "2.4G", "40M", "HT", "1T", "11", "32", + "FCC", "2.4G", "40M", "HT", "1T", "12", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "12", "32", + "MKK", "2.4G", "40M", "HT", "1T", "12", "32", + "FCC", "2.4G", "40M", "HT", "1T", "13", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "13", "32", + "MKK", "2.4G", "40M", "HT", "1T", "13", "32", + "FCC", "2.4G", "40M", "HT", "1T", "14", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "14", "63", + "MKK", "2.4G", "40M", "HT", "1T", "14", "63", + "FCC", "2.4G", "40M", "HT", "2T", "01", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "01", "63", + "MKK", "2.4G", "40M", "HT", "2T", "01", "63", + "FCC", "2.4G", "40M", "HT", "2T", "02", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "02", "63", + "MKK", "2.4G", "40M", "HT", "2T", "02", "63", + "FCC", "2.4G", "40M", "HT", "2T", "03", "30", + "ETSI", "2.4G", "40M", "HT", "2T", "03", "30", + "MKK", "2.4G", "40M", "HT", "2T", "03", "30", + "FCC", "2.4G", "40M", "HT", "2T", "04", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "04", "30", + "MKK", "2.4G", "40M", "HT", "2T", "04", "30", + "FCC", "2.4G", "40M", "HT", "2T", "05", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "05", "30", + "MKK", "2.4G", "40M", "HT", "2T", "05", "30", + "FCC", "2.4G", "40M", "HT", "2T", "06", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "06", "30", + "MKK", "2.4G", "40M", "HT", "2T", "06", "30", + "FCC", "2.4G", "40M", "HT", "2T", "07", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "07", "30", + "MKK", "2.4G", "40M", "HT", "2T", "07", "30", + "FCC", "2.4G", "40M", "HT", "2T", "08", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "08", "30", + "MKK", "2.4G", "40M", "HT", "2T", "08", "30", + "FCC", "2.4G", "40M", "HT", "2T", "09", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "09", "30", + "MKK", "2.4G", "40M", "HT", "2T", "09", "30", + "FCC", "2.4G", "40M", "HT", "2T", "10", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "10", "30", + "MKK", "2.4G", "40M", "HT", "2T", "10", "30", + "FCC", "2.4G", "40M", "HT", "2T", "11", "30", + "ETSI", "2.4G", "40M", "HT", "2T", "11", "30", + "MKK", "2.4G", "40M", "HT", "2T", "11", "30", + "FCC", "2.4G", "40M", "HT", "2T", "12", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "12", "32", + "MKK", "2.4G", "40M", "HT", "2T", "12", "32", + "FCC", "2.4G", "40M", "HT", "2T", "13", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "13", "32", + "MKK", "2.4G", "40M", "HT", "2T", "13", "32", + "FCC", "2.4G", "40M", "HT", "2T", "14", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "14", "63", + "MKK", "2.4G", "40M", "HT", "2T", "14", "63", + "FCC", "5G", "20M", "OFDM", "1T", "36", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "36", "30", + "MKK", "5G", "20M", "OFDM", "1T", "36", "30", + "FCC", "5G", "20M", "OFDM", "1T", "40", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "40", "30", + "MKK", "5G", "20M", "OFDM", "1T", "40", "30", + "FCC", "5G", "20M", "OFDM", "1T", "44", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "44", "30", + "MKK", "5G", "20M", "OFDM", "1T", "44", "30", + "FCC", "5G", "20M", "OFDM", "1T", "48", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "48", "30", + "MKK", "5G", "20M", "OFDM", "1T", "48", "30", + "FCC", "5G", "20M", "OFDM", "1T", "52", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "52", "30", + "MKK", "5G", "20M", "OFDM", "1T", "52", "30", + "FCC", "5G", "20M", "OFDM", "1T", "56", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "56", "30", + "MKK", "5G", "20M", "OFDM", "1T", "56", "30", + "FCC", "5G", "20M", "OFDM", "1T", "60", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "60", "30", + "MKK", "5G", "20M", "OFDM", "1T", "60", "30", + "FCC", "5G", "20M", "OFDM", "1T", "64", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "64", "30", + "MKK", "5G", "20M", "OFDM", "1T", "64", "30", + "FCC", "5G", "20M", "OFDM", "1T", "100", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "100", "30", + "MKK", "5G", "20M", "OFDM", "1T", "100", "30", + "FCC", "5G", "20M", "OFDM", "1T", "114", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "114", "30", + "MKK", "5G", "20M", "OFDM", "1T", "114", "30", + "FCC", "5G", "20M", "OFDM", "1T", "108", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "108", "30", + "MKK", "5G", "20M", "OFDM", "1T", "108", "30", + "FCC", "5G", "20M", "OFDM", "1T", "112", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "112", "30", + "MKK", "5G", "20M", "OFDM", "1T", "112", "30", + "FCC", "5G", "20M", "OFDM", "1T", "116", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "116", "30", + "MKK", "5G", "20M", "OFDM", "1T", "116", "30", + "FCC", "5G", "20M", "OFDM", "1T", "120", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "120", "30", + "MKK", "5G", "20M", "OFDM", "1T", "120", "30", + "FCC", "5G", "20M", "OFDM", "1T", "124", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "124", "30", + "MKK", "5G", "20M", "OFDM", "1T", "124", "30", + "FCC", "5G", "20M", "OFDM", "1T", "128", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "128", "30", + "MKK", "5G", "20M", "OFDM", "1T", "128", "30", + "FCC", "5G", "20M", "OFDM", "1T", "132", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "132", "30", + "MKK", "5G", "20M", "OFDM", "1T", "132", "30", + "FCC", "5G", "20M", "OFDM", "1T", "136", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "136", "30", + "MKK", "5G", "20M", "OFDM", "1T", "136", "30", + "FCC", "5G", "20M", "OFDM", "1T", "140", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "140", "30", + "MKK", "5G", "20M", "OFDM", "1T", "140", "30", + "FCC", "5G", "20M", "OFDM", "1T", "149", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "149", "30", + "MKK", "5G", "20M", "OFDM", "1T", "149", "63", + "FCC", "5G", "20M", "OFDM", "1T", "153", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "153", "30", + "MKK", "5G", "20M", "OFDM", "1T", "153", "63", + "FCC", "5G", "20M", "OFDM", "1T", "157", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "157", "30", + "MKK", "5G", "20M", "OFDM", "1T", "157", "63", + "FCC", "5G", "20M", "OFDM", "1T", "161", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "161", "30", + "MKK", "5G", "20M", "OFDM", "1T", "161", "63", + "FCC", "5G", "20M", "OFDM", "1T", "165", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "165", "30", + "MKK", "5G", "20M", "OFDM", "1T", "165", "63", + "FCC", "5G", "20M", "HT", "1T", "36", "32", + "ETSI", "5G", "20M", "HT", "1T", "36", "30", + "MKK", "5G", "20M", "HT", "1T", "36", "30", + "FCC", "5G", "20M", "HT", "1T", "40", "32", + "ETSI", "5G", "20M", "HT", "1T", "40", "30", + "MKK", "5G", "20M", "HT", "1T", "40", "30", + "FCC", "5G", "20M", "HT", "1T", "44", "32", + "ETSI", "5G", "20M", "HT", "1T", "44", "30", + "MKK", "5G", "20M", "HT", "1T", "44", "30", + "FCC", "5G", "20M", "HT", "1T", "48", "32", + "ETSI", "5G", "20M", "HT", "1T", "48", "30", + "MKK", "5G", "20M", "HT", "1T", "48", "30", + "FCC", "5G", "20M", "HT", "1T", "52", "32", + "ETSI", "5G", "20M", "HT", "1T", "52", "30", + "MKK", "5G", "20M", "HT", "1T", "52", "30", + "FCC", "5G", "20M", "HT", "1T", "56", "32", + "ETSI", "5G", "20M", "HT", "1T", "56", "30", + "MKK", "5G", "20M", "HT", "1T", "56", "30", + "FCC", "5G", "20M", "HT", "1T", "60", "32", + "ETSI", "5G", "20M", "HT", "1T", "60", "30", + "MKK", "5G", "20M", "HT", "1T", "60", "30", + "FCC", "5G", "20M", "HT", "1T", "64", "32", + "ETSI", "5G", "20M", "HT", "1T", "64", "30", + "MKK", "5G", "20M", "HT", "1T", "64", "30", + "FCC", "5G", "20M", "HT", "1T", "100", "32", + "ETSI", "5G", "20M", "HT", "1T", "100", "30", + "MKK", "5G", "20M", "HT", "1T", "100", "30", + "FCC", "5G", "20M", "HT", "1T", "114", "32", + "ETSI", "5G", "20M", "HT", "1T", "114", "30", + "MKK", "5G", "20M", "HT", "1T", "114", "30", + "FCC", "5G", "20M", "HT", "1T", "108", "32", + "ETSI", "5G", "20M", "HT", "1T", "108", "30", + "MKK", "5G", "20M", "HT", "1T", "108", "30", + "FCC", "5G", "20M", "HT", "1T", "112", "32", + "ETSI", "5G", "20M", "HT", "1T", "112", "30", + "MKK", "5G", "20M", "HT", "1T", "112", "30", + "FCC", "5G", "20M", "HT", "1T", "116", "32", + "ETSI", "5G", "20M", "HT", "1T", "116", "30", + "MKK", "5G", "20M", "HT", "1T", "116", "30", + "FCC", "5G", "20M", "HT", "1T", "120", "32", + "ETSI", "5G", "20M", "HT", "1T", "120", "30", + "MKK", "5G", "20M", "HT", "1T", "120", "30", + "FCC", "5G", "20M", "HT", "1T", "124", "32", + "ETSI", "5G", "20M", "HT", "1T", "124", "30", + "MKK", "5G", "20M", "HT", "1T", "124", "30", + "FCC", "5G", "20M", "HT", "1T", "128", "32", + "ETSI", "5G", "20M", "HT", "1T", "128", "30", + "MKK", "5G", "20M", "HT", "1T", "128", "30", + "FCC", "5G", "20M", "HT", "1T", "132", "32", + "ETSI", "5G", "20M", "HT", "1T", "132", "30", + "MKK", "5G", "20M", "HT", "1T", "132", "30", + "FCC", "5G", "20M", "HT", "1T", "136", "32", + "ETSI", "5G", "20M", "HT", "1T", "136", "30", + "MKK", "5G", "20M", "HT", "1T", "136", "30", + "FCC", "5G", "20M", "HT", "1T", "140", "32", + "ETSI", "5G", "20M", "HT", "1T", "140", "30", + "MKK", "5G", "20M", "HT", "1T", "140", "30", + "FCC", "5G", "20M", "HT", "1T", "149", "32", + "ETSI", "5G", "20M", "HT", "1T", "149", "30", + "MKK", "5G", "20M", "HT", "1T", "149", "63", + "FCC", "5G", "20M", "HT", "1T", "153", "32", + "ETSI", "5G", "20M", "HT", "1T", "153", "30", + "MKK", "5G", "20M", "HT", "1T", "153", "63", + "FCC", "5G", "20M", "HT", "1T", "157", "32", + "ETSI", "5G", "20M", "HT", "1T", "157", "30", + "MKK", "5G", "20M", "HT", "1T", "157", "63", + "FCC", "5G", "20M", "HT", "1T", "161", "32", + "ETSI", "5G", "20M", "HT", "1T", "161", "30", + "MKK", "5G", "20M", "HT", "1T", "161", "63", + "FCC", "5G", "20M", "HT", "1T", "165", "32", + "ETSI", "5G", "20M", "HT", "1T", "165", "30", + "MKK", "5G", "20M", "HT", "1T", "165", "63", + "FCC", "5G", "20M", "HT", "2T", "36", "28", + "ETSI", "5G", "20M", "HT", "2T", "36", "30", + "MKK", "5G", "20M", "HT", "2T", "36", "30", + "FCC", "5G", "20M", "HT", "2T", "40", "28", + "ETSI", "5G", "20M", "HT", "2T", "40", "30", + "MKK", "5G", "20M", "HT", "2T", "40", "30", + "FCC", "5G", "20M", "HT", "2T", "44", "28", + "ETSI", "5G", "20M", "HT", "2T", "44", "30", + "MKK", "5G", "20M", "HT", "2T", "44", "30", + "FCC", "5G", "20M", "HT", "2T", "48", "28", + "ETSI", "5G", "20M", "HT", "2T", "48", "30", + "MKK", "5G", "20M", "HT", "2T", "48", "30", + "FCC", "5G", "20M", "HT", "2T", "52", "34", + "ETSI", "5G", "20M", "HT", "2T", "52", "30", + "MKK", "5G", "20M", "HT", "2T", "52", "30", + "FCC", "5G", "20M", "HT", "2T", "56", "32", + "ETSI", "5G", "20M", "HT", "2T", "56", "30", + "MKK", "5G", "20M", "HT", "2T", "56", "30", + "FCC", "5G", "20M", "HT", "2T", "60", "30", + "ETSI", "5G", "20M", "HT", "2T", "60", "30", + "MKK", "5G", "20M", "HT", "2T", "60", "30", + "FCC", "5G", "20M", "HT", "2T", "64", "26", + "ETSI", "5G", "20M", "HT", "2T", "64", "30", + "MKK", "5G", "20M", "HT", "2T", "64", "30", + "FCC", "5G", "20M", "HT", "2T", "100", "28", + "ETSI", "5G", "20M", "HT", "2T", "100", "30", + "MKK", "5G", "20M", "HT", "2T", "100", "30", + "FCC", "5G", "20M", "HT", "2T", "114", "28", + "ETSI", "5G", "20M", "HT", "2T", "114", "30", + "MKK", "5G", "20M", "HT", "2T", "114", "30", + "FCC", "5G", "20M", "HT", "2T", "108", "30", + "ETSI", "5G", "20M", "HT", "2T", "108", "30", + "MKK", "5G", "20M", "HT", "2T", "108", "30", + "FCC", "5G", "20M", "HT", "2T", "112", "32", + "ETSI", "5G", "20M", "HT", "2T", "112", "30", + "MKK", "5G", "20M", "HT", "2T", "112", "30", + "FCC", "5G", "20M", "HT", "2T", "116", "32", + "ETSI", "5G", "20M", "HT", "2T", "116", "30", + "MKK", "5G", "20M", "HT", "2T", "116", "30", + "FCC", "5G", "20M", "HT", "2T", "120", "34", + "ETSI", "5G", "20M", "HT", "2T", "120", "30", + "MKK", "5G", "20M", "HT", "2T", "120", "30", + "FCC", "5G", "20M", "HT", "2T", "124", "32", + "ETSI", "5G", "20M", "HT", "2T", "124", "30", + "MKK", "5G", "20M", "HT", "2T", "124", "30", + "FCC", "5G", "20M", "HT", "2T", "128", "30", + "ETSI", "5G", "20M", "HT", "2T", "128", "30", + "MKK", "5G", "20M", "HT", "2T", "128", "30", + "FCC", "5G", "20M", "HT", "2T", "132", "28", + "ETSI", "5G", "20M", "HT", "2T", "132", "30", + "MKK", "5G", "20M", "HT", "2T", "132", "30", + "FCC", "5G", "20M", "HT", "2T", "136", "28", + "ETSI", "5G", "20M", "HT", "2T", "136", "30", + "MKK", "5G", "20M", "HT", "2T", "136", "30", + "FCC", "5G", "20M", "HT", "2T", "140", "26", + "ETSI", "5G", "20M", "HT", "2T", "140", "30", + "MKK", "5G", "20M", "HT", "2T", "140", "30", + "FCC", "5G", "20M", "HT", "2T", "149", "34", + "ETSI", "5G", "20M", "HT", "2T", "149", "30", + "MKK", "5G", "20M", "HT", "2T", "149", "63", + "FCC", "5G", "20M", "HT", "2T", "153", "34", + "ETSI", "5G", "20M", "HT", "2T", "153", "30", + "MKK", "5G", "20M", "HT", "2T", "153", "63", + "FCC", "5G", "20M", "HT", "2T", "157", "34", + "ETSI", "5G", "20M", "HT", "2T", "157", "30", + "MKK", "5G", "20M", "HT", "2T", "157", "63", + "FCC", "5G", "20M", "HT", "2T", "161", "34", + "ETSI", "5G", "20M", "HT", "2T", "161", "30", + "MKK", "5G", "20M", "HT", "2T", "161", "63", + "FCC", "5G", "20M", "HT", "2T", "165", "34", + "ETSI", "5G", "20M", "HT", "2T", "165", "30", + "MKK", "5G", "20M", "HT", "2T", "165", "63", + "FCC", "5G", "40M", "HT", "1T", "38", "26", + "ETSI", "5G", "40M", "HT", "1T", "38", "30", + "MKK", "5G", "40M", "HT", "1T", "38", "30", + "FCC", "5G", "40M", "HT", "1T", "46", "32", + "ETSI", "5G", "40M", "HT", "1T", "46", "30", + "MKK", "5G", "40M", "HT", "1T", "46", "30", + "FCC", "5G", "40M", "HT", "1T", "54", "32", + "ETSI", "5G", "40M", "HT", "1T", "54", "30", + "MKK", "5G", "40M", "HT", "1T", "54", "30", + "FCC", "5G", "40M", "HT", "1T", "62", "24", + "ETSI", "5G", "40M", "HT", "1T", "62", "30", + "MKK", "5G", "40M", "HT", "1T", "62", "30", + "FCC", "5G", "40M", "HT", "1T", "102", "24", + "ETSI", "5G", "40M", "HT", "1T", "102", "30", + "MKK", "5G", "40M", "HT", "1T", "102", "30", + "FCC", "5G", "40M", "HT", "1T", "110", "32", + "ETSI", "5G", "40M", "HT", "1T", "110", "30", + "MKK", "5G", "40M", "HT", "1T", "110", "30", + "FCC", "5G", "40M", "HT", "1T", "118", "32", + "ETSI", "5G", "40M", "HT", "1T", "118", "30", + "MKK", "5G", "40M", "HT", "1T", "118", "30", + "FCC", "5G", "40M", "HT", "1T", "126", "32", + "ETSI", "5G", "40M", "HT", "1T", "126", "30", + "MKK", "5G", "40M", "HT", "1T", "126", "30", + "FCC", "5G", "40M", "HT", "1T", "134", "32", + "ETSI", "5G", "40M", "HT", "1T", "134", "30", + "MKK", "5G", "40M", "HT", "1T", "134", "30", + "FCC", "5G", "40M", "HT", "1T", "151", "30", + "ETSI", "5G", "40M", "HT", "1T", "151", "30", + "MKK", "5G", "40M", "HT", "1T", "151", "63", + "FCC", "5G", "40M", "HT", "1T", "159", "32", + "ETSI", "5G", "40M", "HT", "1T", "159", "30", + "MKK", "5G", "40M", "HT", "1T", "159", "63", + "FCC", "5G", "40M", "HT", "2T", "38", "28", + "ETSI", "5G", "40M", "HT", "2T", "38", "30", + "MKK", "5G", "40M", "HT", "2T", "38", "30", + "FCC", "5G", "40M", "HT", "2T", "46", "28", + "ETSI", "5G", "40M", "HT", "2T", "46", "30", + "MKK", "5G", "40M", "HT", "2T", "46", "30", + "FCC", "5G", "40M", "HT", "2T", "54", "30", + "ETSI", "5G", "40M", "HT", "2T", "54", "30", + "MKK", "5G", "40M", "HT", "2T", "54", "30", + "FCC", "5G", "40M", "HT", "2T", "62", "30", + "ETSI", "5G", "40M", "HT", "2T", "62", "30", + "MKK", "5G", "40M", "HT", "2T", "62", "30", + "FCC", "5G", "40M", "HT", "2T", "102", "26", + "ETSI", "5G", "40M", "HT", "2T", "102", "30", + "MKK", "5G", "40M", "HT", "2T", "102", "30", + "FCC", "5G", "40M", "HT", "2T", "110", "30", + "ETSI", "5G", "40M", "HT", "2T", "110", "30", + "MKK", "5G", "40M", "HT", "2T", "110", "30", + "FCC", "5G", "40M", "HT", "2T", "118", "34", + "ETSI", "5G", "40M", "HT", "2T", "118", "30", + "MKK", "5G", "40M", "HT", "2T", "118", "30", + "FCC", "5G", "40M", "HT", "2T", "126", "32", + "ETSI", "5G", "40M", "HT", "2T", "126", "30", + "MKK", "5G", "40M", "HT", "2T", "126", "30", + "FCC", "5G", "40M", "HT", "2T", "134", "30", + "ETSI", "5G", "40M", "HT", "2T", "134", "30", + "MKK", "5G", "40M", "HT", "2T", "134", "30", + "FCC", "5G", "40M", "HT", "2T", "151", "34", + "ETSI", "5G", "40M", "HT", "2T", "151", "30", + "MKK", "5G", "40M", "HT", "2T", "151", "63", + "FCC", "5G", "40M", "HT", "2T", "159", "34", + "ETSI", "5G", "40M", "HT", "2T", "159", "30", + "MKK", "5G", "40M", "HT", "2T", "159", "63", + "FCC", "5G", "80M", "VHT", "1T", "42", "22", + "ETSI", "5G", "80M", "VHT", "1T", "42", "30", + "MKK", "5G", "80M", "VHT", "1T", "42", "30", + "FCC", "5G", "80M", "VHT", "1T", "58", "20", + "ETSI", "5G", "80M", "VHT", "1T", "58", "30", + "MKK", "5G", "80M", "VHT", "1T", "58", "30", + "FCC", "5G", "80M", "VHT", "1T", "106", "20", + "ETSI", "5G", "80M", "VHT", "1T", "106", "30", + "MKK", "5G", "80M", "VHT", "1T", "106", "30", + "FCC", "5G", "80M", "VHT", "1T", "122", "20", + "ETSI", "5G", "80M", "VHT", "1T", "122", "30", + "MKK", "5G", "80M", "VHT", "1T", "122", "30", + "FCC", "5G", "80M", "VHT", "1T", "155", "28", + "ETSI", "5G", "80M", "VHT", "1T", "155", "30", + "MKK", "5G", "80M", "VHT", "1T", "155", "63", + "FCC", "5G", "80M", "VHT", "2T", "42", "28", + "ETSI", "5G", "80M", "VHT", "2T", "42", "30", + "MKK", "5G", "80M", "VHT", "2T", "42", "30", + "FCC", "5G", "80M", "VHT", "2T", "58", "26", + "ETSI", "5G", "80M", "VHT", "2T", "58", "30", + "MKK", "5G", "80M", "VHT", "2T", "58", "30", + "FCC", "5G", "80M", "VHT", "2T", "106", "28", + "ETSI", "5G", "80M", "VHT", "2T", "106", "30", + "MKK", "5G", "80M", "VHT", "2T", "106", "30", + "FCC", "5G", "80M", "VHT", "2T", "122", "32", + "ETSI", "5G", "80M", "VHT", "2T", "122", "30", + "MKK", "5G", "80M", "VHT", "2T", "122", "30", + "FCC", "5G", "80M", "VHT", "2T", "155", "34", + "ETSI", "5G", "80M", "VHT", "2T", "155", "30", + "MKK", "5G", "80M", "VHT", "2T", "155", "63" +}; + +void +ODM_ReadAndConfig_MP_8821A_TXPWR_LMT_8821A( + IN PDM_ODM_T pDM_Odm + ) +{ + u4Byte i = 0; + u4Byte ArrayLen = sizeof(Array_MP_8821A_TXPWR_LMT_8821A)/sizeof(pu1Byte); + pu1Byte *Array = Array_MP_8821A_TXPWR_LMT_8821A; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ReadAndConfig_MP_8821A_TXPWR_LMT_8821A\n")); + + for (i = 0; i < ArrayLen; i += 7 ) + { + pu1Byte regulation = Array[i]; + pu1Byte band = Array[i+1]; + pu1Byte bandwidth = Array[i+2]; + pu1Byte rate = Array[i+3]; + pu1Byte rfPath = Array[i+4]; + pu1Byte chnl = Array[i+5]; + pu1Byte val = Array[i+6]; + + odm_ConfigBB_TXPWR_LMT_8821A(pDM_Odm, regulation, band, bandwidth, rate, rfPath, chnl, val); + } + +} + +/****************************************************************************** +* TXPWR_LMT_8821A_SAR_13dBm.TXT +******************************************************************************/ + +pu1Byte Array_MP_8821A_TXPWR_LMT_8821A_SAR_13dBm[] = { + "FCC", "2.4G", "20M", "CCK", "1T", "01", "32", + "ETSI", "2.4G", "20M", "CCK", "1T", "01", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "01", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "02", "32", + "ETSI", "2.4G", "20M", "CCK", "1T", "02", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "02", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "03", "34", + "ETSI", "2.4G", "20M", "CCK", "1T", "03", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "03", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "04", "34", + "ETSI", "2.4G", "20M", "CCK", "1T", "04", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "04", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "05", "34", + "ETSI", "2.4G", "20M", "CCK", "1T", "05", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "05", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "06", "34", + "ETSI", "2.4G", "20M", "CCK", "1T", "06", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "06", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "07", "34", + "ETSI", "2.4G", "20M", "CCK", "1T", "07", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "07", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "08", "34", + "ETSI", "2.4G", "20M", "CCK", "1T", "08", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "08", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "09", "32", + "ETSI", "2.4G", "20M", "CCK", "1T", "09", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "09", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "10", "32", + "ETSI", "2.4G", "20M", "CCK", "1T", "10", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "10", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "11", "32", + "ETSI", "2.4G", "20M", "CCK", "1T", "11", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "11", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "12", "63", + "ETSI", "2.4G", "20M", "CCK", "1T", "12", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "12", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "13", "63", + "ETSI", "2.4G", "20M", "CCK", "1T", "13", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "13", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "14", "63", + "ETSI", "2.4G", "20M", "CCK", "1T", "14", "63", + "MKK", "2.4G", "20M", "CCK", "1T", "14", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "01", "30", + "ETSI", "2.4G", "20M", "OFDM", "1T", "01", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "01", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "02", "30", + "ETSI", "2.4G", "20M", "OFDM", "1T", "02", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "02", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "03", "32", + "ETSI", "2.4G", "20M", "OFDM", "1T", "03", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "03", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "04", "32", + "ETSI", "2.4G", "20M", "OFDM", "1T", "04", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "04", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "05", "32", + "ETSI", "2.4G", "20M", "OFDM", "1T", "05", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "05", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "06", "32", + "ETSI", "2.4G", "20M", "OFDM", "1T", "06", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "06", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "07", "32", + "ETSI", "2.4G", "20M", "OFDM", "1T", "07", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "07", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "08", "32", + "ETSI", "2.4G", "20M", "OFDM", "1T", "08", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "08", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "09", "30", + "ETSI", "2.4G", "20M", "OFDM", "1T", "09", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "09", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "10", "30", + "ETSI", "2.4G", "20M", "OFDM", "1T", "10", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "10", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "11", "30", + "ETSI", "2.4G", "20M", "OFDM", "1T", "11", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "11", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "12", "63", + "ETSI", "2.4G", "20M", "OFDM", "1T", "12", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "12", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "13", "63", + "ETSI", "2.4G", "20M", "OFDM", "1T", "13", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "13", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "14", "63", + "ETSI", "2.4G", "20M", "OFDM", "1T", "14", "63", + "MKK", "2.4G", "20M", "OFDM", "1T", "14", "63", + "FCC", "2.4G", "20M", "HT", "1T", "01", "26", + "ETSI", "2.4G", "20M", "HT", "1T", "01", "32", + "MKK", "2.4G", "20M", "HT", "1T", "01", "32", + "FCC", "2.4G", "20M", "HT", "1T", "02", "26", + "ETSI", "2.4G", "20M", "HT", "1T", "02", "32", + "MKK", "2.4G", "20M", "HT", "1T", "02", "32", + "FCC", "2.4G", "20M", "HT", "1T", "03", "32", + "ETSI", "2.4G", "20M", "HT", "1T", "03", "32", + "MKK", "2.4G", "20M", "HT", "1T", "03", "32", + "FCC", "2.4G", "20M", "HT", "1T", "04", "32", + "ETSI", "2.4G", "20M", "HT", "1T", "04", "32", + "MKK", "2.4G", "20M", "HT", "1T", "04", "32", + "FCC", "2.4G", "20M", "HT", "1T", "05", "32", + "ETSI", "2.4G", "20M", "HT", "1T", "05", "32", + "MKK", "2.4G", "20M", "HT", "1T", "05", "32", + "FCC", "2.4G", "20M", "HT", "1T", "06", "32", + "ETSI", "2.4G", "20M", "HT", "1T", "06", "32", + "MKK", "2.4G", "20M", "HT", "1T", "06", "32", + "FCC", "2.4G", "20M", "HT", "1T", "07", "32", + "ETSI", "2.4G", "20M", "HT", "1T", "07", "32", + "MKK", "2.4G", "20M", "HT", "1T", "07", "32", + "FCC", "2.4G", "20M", "HT", "1T", "08", "32", + "ETSI", "2.4G", "20M", "HT", "1T", "08", "32", + "MKK", "2.4G", "20M", "HT", "1T", "08", "32", + "FCC", "2.4G", "20M", "HT", "1T", "09", "26", + "ETSI", "2.4G", "20M", "HT", "1T", "09", "32", + "MKK", "2.4G", "20M", "HT", "1T", "09", "32", + "FCC", "2.4G", "20M", "HT", "1T", "10", "26", + "ETSI", "2.4G", "20M", "HT", "1T", "10", "32", + "MKK", "2.4G", "20M", "HT", "1T", "10", "32", + "FCC", "2.4G", "20M", "HT", "1T", "11", "26", + "ETSI", "2.4G", "20M", "HT", "1T", "11", "32", + "MKK", "2.4G", "20M", "HT", "1T", "11", "32", + "FCC", "2.4G", "20M", "HT", "1T", "12", "63", + "ETSI", "2.4G", "20M", "HT", "1T", "12", "32", + "MKK", "2.4G", "20M", "HT", "1T", "12", "32", + "FCC", "2.4G", "20M", "HT", "1T", "13", "63", + "ETSI", "2.4G", "20M", "HT", "1T", "13", "32", + "MKK", "2.4G", "20M", "HT", "1T", "13", "32", + "FCC", "2.4G", "20M", "HT", "1T", "14", "63", + "ETSI", "2.4G", "20M", "HT", "1T", "14", "63", + "MKK", "2.4G", "20M", "HT", "1T", "14", "63", + "FCC", "2.4G", "20M", "HT", "2T", "01", "30", + "ETSI", "2.4G", "20M", "HT", "2T", "01", "32", + "MKK", "2.4G", "20M", "HT", "2T", "01", "32", + "FCC", "2.4G", "20M", "HT", "2T", "02", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "02", "32", + "MKK", "2.4G", "20M", "HT", "2T", "02", "32", + "FCC", "2.4G", "20M", "HT", "2T", "03", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "03", "32", + "MKK", "2.4G", "20M", "HT", "2T", "03", "32", + "FCC", "2.4G", "20M", "HT", "2T", "04", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "04", "32", + "MKK", "2.4G", "20M", "HT", "2T", "04", "32", + "FCC", "2.4G", "20M", "HT", "2T", "05", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "05", "32", + "MKK", "2.4G", "20M", "HT", "2T", "05", "32", + "FCC", "2.4G", "20M", "HT", "2T", "06", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "06", "32", + "MKK", "2.4G", "20M", "HT", "2T", "06", "32", + "FCC", "2.4G", "20M", "HT", "2T", "07", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "07", "32", + "MKK", "2.4G", "20M", "HT", "2T", "07", "32", + "FCC", "2.4G", "20M", "HT", "2T", "08", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "08", "32", + "MKK", "2.4G", "20M", "HT", "2T", "08", "32", + "FCC", "2.4G", "20M", "HT", "2T", "09", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "09", "32", + "MKK", "2.4G", "20M", "HT", "2T", "09", "32", + "FCC", "2.4G", "20M", "HT", "2T", "10", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "10", "32", + "MKK", "2.4G", "20M", "HT", "2T", "10", "32", + "FCC", "2.4G", "20M", "HT", "2T", "11", "30", + "ETSI", "2.4G", "20M", "HT", "2T", "11", "32", + "MKK", "2.4G", "20M", "HT", "2T", "11", "32", + "FCC", "2.4G", "20M", "HT", "2T", "12", "63", + "ETSI", "2.4G", "20M", "HT", "2T", "12", "32", + "MKK", "2.4G", "20M", "HT", "2T", "12", "32", + "FCC", "2.4G", "20M", "HT", "2T", "13", "63", + "ETSI", "2.4G", "20M", "HT", "2T", "13", "32", + "MKK", "2.4G", "20M", "HT", "2T", "13", "32", + "FCC", "2.4G", "20M", "HT", "2T", "14", "63", + "ETSI", "2.4G", "20M", "HT", "2T", "14", "63", + "MKK", "2.4G", "20M", "HT", "2T", "14", "63", + "FCC", "2.4G", "40M", "HT", "1T", "01", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "01", "63", + "MKK", "2.4G", "40M", "HT", "1T", "01", "63", + "FCC", "2.4G", "40M", "HT", "1T", "02", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "02", "63", + "MKK", "2.4G", "40M", "HT", "1T", "02", "63", + "FCC", "2.4G", "40M", "HT", "1T", "03", "26", + "ETSI", "2.4G", "40M", "HT", "1T", "03", "32", + "MKK", "2.4G", "40M", "HT", "1T", "03", "32", + "FCC", "2.4G", "40M", "HT", "1T", "04", "26", + "ETSI", "2.4G", "40M", "HT", "1T", "04", "32", + "MKK", "2.4G", "40M", "HT", "1T", "04", "32", + "FCC", "2.4G", "40M", "HT", "1T", "05", "26", + "ETSI", "2.4G", "40M", "HT", "1T", "05", "32", + "MKK", "2.4G", "40M", "HT", "1T", "05", "32", + "FCC", "2.4G", "40M", "HT", "1T", "06", "32", + "ETSI", "2.4G", "40M", "HT", "1T", "06", "32", + "MKK", "2.4G", "40M", "HT", "1T", "06", "32", + "FCC", "2.4G", "40M", "HT", "1T", "07", "32", + "ETSI", "2.4G", "40M", "HT", "1T", "07", "32", + "MKK", "2.4G", "40M", "HT", "1T", "07", "32", + "FCC", "2.4G", "40M", "HT", "1T", "08", "32", + "ETSI", "2.4G", "40M", "HT", "1T", "08", "32", + "MKK", "2.4G", "40M", "HT", "1T", "08", "32", + "FCC", "2.4G", "40M", "HT", "1T", "09", "26", + "ETSI", "2.4G", "40M", "HT", "1T", "09", "32", + "MKK", "2.4G", "40M", "HT", "1T", "09", "32", + "FCC", "2.4G", "40M", "HT", "1T", "10", "26", + "ETSI", "2.4G", "40M", "HT", "1T", "10", "32", + "MKK", "2.4G", "40M", "HT", "1T", "10", "32", + "FCC", "2.4G", "40M", "HT", "1T", "11", "26", + "ETSI", "2.4G", "40M", "HT", "1T", "11", "32", + "MKK", "2.4G", "40M", "HT", "1T", "11", "32", + "FCC", "2.4G", "40M", "HT", "1T", "12", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "12", "32", + "MKK", "2.4G", "40M", "HT", "1T", "12", "32", + "FCC", "2.4G", "40M", "HT", "1T", "13", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "13", "32", + "MKK", "2.4G", "40M", "HT", "1T", "13", "32", + "FCC", "2.4G", "40M", "HT", "1T", "14", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "14", "63", + "MKK", "2.4G", "40M", "HT", "1T", "14", "63", + "FCC", "2.4G", "40M", "HT", "2T", "01", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "01", "63", + "MKK", "2.4G", "40M", "HT", "2T", "01", "63", + "FCC", "2.4G", "40M", "HT", "2T", "02", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "02", "63", + "MKK", "2.4G", "40M", "HT", "2T", "02", "63", + "FCC", "2.4G", "40M", "HT", "2T", "03", "30", + "ETSI", "2.4G", "40M", "HT", "2T", "03", "30", + "MKK", "2.4G", "40M", "HT", "2T", "03", "30", + "FCC", "2.4G", "40M", "HT", "2T", "04", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "04", "30", + "MKK", "2.4G", "40M", "HT", "2T", "04", "30", + "FCC", "2.4G", "40M", "HT", "2T", "05", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "05", "30", + "MKK", "2.4G", "40M", "HT", "2T", "05", "30", + "FCC", "2.4G", "40M", "HT", "2T", "06", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "06", "30", + "MKK", "2.4G", "40M", "HT", "2T", "06", "30", + "FCC", "2.4G", "40M", "HT", "2T", "07", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "07", "30", + "MKK", "2.4G", "40M", "HT", "2T", "07", "30", + "FCC", "2.4G", "40M", "HT", "2T", "08", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "08", "30", + "MKK", "2.4G", "40M", "HT", "2T", "08", "30", + "FCC", "2.4G", "40M", "HT", "2T", "09", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "09", "30", + "MKK", "2.4G", "40M", "HT", "2T", "09", "30", + "FCC", "2.4G", "40M", "HT", "2T", "10", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "10", "30", + "MKK", "2.4G", "40M", "HT", "2T", "10", "30", + "FCC", "2.4G", "40M", "HT", "2T", "11", "30", + "ETSI", "2.4G", "40M", "HT", "2T", "11", "30", + "MKK", "2.4G", "40M", "HT", "2T", "11", "30", + "FCC", "2.4G", "40M", "HT", "2T", "12", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "12", "32", + "MKK", "2.4G", "40M", "HT", "2T", "12", "32", + "FCC", "2.4G", "40M", "HT", "2T", "13", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "13", "32", + "MKK", "2.4G", "40M", "HT", "2T", "13", "32", + "FCC", "2.4G", "40M", "HT", "2T", "14", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "14", "63", + "MKK", "2.4G", "40M", "HT", "2T", "14", "63", + "FCC", "5G", "20M", "OFDM", "1T", "36", "26", + "ETSI", "5G", "20M", "OFDM", "1T", "36", "26", + "MKK", "5G", "20M", "OFDM", "1T", "36", "26", + "FCC", "5G", "20M", "OFDM", "1T", "40", "26", + "ETSI", "5G", "20M", "OFDM", "1T", "40", "26", + "MKK", "5G", "20M", "OFDM", "1T", "40", "26", + "FCC", "5G", "20M", "OFDM", "1T", "44", "26", + "ETSI", "5G", "20M", "OFDM", "1T", "44", "26", + "MKK", "5G", "20M", "OFDM", "1T", "44", "26", + "FCC", "5G", "20M", "OFDM", "1T", "48", "26", + "ETSI", "5G", "20M", "OFDM", "1T", "48", "26", + "MKK", "5G", "20M", "OFDM", "1T", "48", "26", + "FCC", "5G", "20M", "OFDM", "1T", "52", "26", + "ETSI", "5G", "20M", "OFDM", "1T", "52", "26", + "MKK", "5G", "20M", "OFDM", "1T", "52", "26", + "FCC", "5G", "20M", "OFDM", "1T", "56", "26", + "ETSI", "5G", "20M", "OFDM", "1T", "56", "26", + "MKK", "5G", "20M", "OFDM", "1T", "56", "26", + "FCC", "5G", "20M", "OFDM", "1T", "60", "26", + "ETSI", "5G", "20M", "OFDM", "1T", "60", "26", + "MKK", "5G", "20M", "OFDM", "1T", "60", "26", + "FCC", "5G", "20M", "OFDM", "1T", "64", "26", + "ETSI", "5G", "20M", "OFDM", "1T", "64", "26", + "MKK", "5G", "20M", "OFDM", "1T", "64", "26", + "FCC", "5G", "20M", "OFDM", "1T", "100", "26", + "ETSI", "5G", "20M", "OFDM", "1T", "100", "26", + "MKK", "5G", "20M", "OFDM", "1T", "100", "26", + "FCC", "5G", "20M", "OFDM", "1T", "114", "26", + "ETSI", "5G", "20M", "OFDM", "1T", "114", "26", + "MKK", "5G", "20M", "OFDM", "1T", "114", "26", + "FCC", "5G", "20M", "OFDM", "1T", "108", "26", + "ETSI", "5G", "20M", "OFDM", "1T", "108", "26", + "MKK", "5G", "20M", "OFDM", "1T", "108", "26", + "FCC", "5G", "20M", "OFDM", "1T", "112", "26", + "ETSI", "5G", "20M", "OFDM", "1T", "112", "26", + "MKK", "5G", "20M", "OFDM", "1T", "112", "26", + "FCC", "5G", "20M", "OFDM", "1T", "116", "26", + "ETSI", "5G", "20M", "OFDM", "1T", "116", "26", + "MKK", "5G", "20M", "OFDM", "1T", "116", "26", + "FCC", "5G", "20M", "OFDM", "1T", "120", "26", + "ETSI", "5G", "20M", "OFDM", "1T", "120", "26", + "MKK", "5G", "20M", "OFDM", "1T", "120", "26", + "FCC", "5G", "20M", "OFDM", "1T", "124", "26", + "ETSI", "5G", "20M", "OFDM", "1T", "124", "26", + "MKK", "5G", "20M", "OFDM", "1T", "124", "26", + "FCC", "5G", "20M", "OFDM", "1T", "128", "26", + "ETSI", "5G", "20M", "OFDM", "1T", "128", "26", + "MKK", "5G", "20M", "OFDM", "1T", "128", "26", + "FCC", "5G", "20M", "OFDM", "1T", "132", "26", + "ETSI", "5G", "20M", "OFDM", "1T", "132", "26", + "MKK", "5G", "20M", "OFDM", "1T", "132", "26", + "FCC", "5G", "20M", "OFDM", "1T", "136", "26", + "ETSI", "5G", "20M", "OFDM", "1T", "136", "26", + "MKK", "5G", "20M", "OFDM", "1T", "136", "26", + "FCC", "5G", "20M", "OFDM", "1T", "140", "26", + "ETSI", "5G", "20M", "OFDM", "1T", "140", "26", + "MKK", "5G", "20M", "OFDM", "1T", "140", "26", + "FCC", "5G", "20M", "OFDM", "1T", "149", "26", + "ETSI", "5G", "20M", "OFDM", "1T", "149", "26", + "MKK", "5G", "20M", "OFDM", "1T", "149", "63", + "FCC", "5G", "20M", "OFDM", "1T", "153", "26", + "ETSI", "5G", "20M", "OFDM", "1T", "153", "26", + "MKK", "5G", "20M", "OFDM", "1T", "153", "63", + "FCC", "5G", "20M", "OFDM", "1T", "157", "26", + "ETSI", "5G", "20M", "OFDM", "1T", "157", "26", + "MKK", "5G", "20M", "OFDM", "1T", "157", "63", + "FCC", "5G", "20M", "OFDM", "1T", "161", "26", + "ETSI", "5G", "20M", "OFDM", "1T", "161", "26", + "MKK", "5G", "20M", "OFDM", "1T", "161", "63", + "FCC", "5G", "20M", "OFDM", "1T", "165", "26", + "ETSI", "5G", "20M", "OFDM", "1T", "165", "26", + "MKK", "5G", "20M", "OFDM", "1T", "165", "63", + "FCC", "5G", "20M", "HT", "1T", "36", "26", + "ETSI", "5G", "20M", "HT", "1T", "36", "26", + "MKK", "5G", "20M", "HT", "1T", "36", "26", + "FCC", "5G", "20M", "HT", "1T", "40", "26", + "ETSI", "5G", "20M", "HT", "1T", "40", "26", + "MKK", "5G", "20M", "HT", "1T", "40", "26", + "FCC", "5G", "20M", "HT", "1T", "44", "26", + "ETSI", "5G", "20M", "HT", "1T", "44", "26", + "MKK", "5G", "20M", "HT", "1T", "44", "26", + "FCC", "5G", "20M", "HT", "1T", "48", "26", + "ETSI", "5G", "20M", "HT", "1T", "48", "26", + "MKK", "5G", "20M", "HT", "1T", "48", "26", + "FCC", "5G", "20M", "HT", "1T", "52", "26", + "ETSI", "5G", "20M", "HT", "1T", "52", "26", + "MKK", "5G", "20M", "HT", "1T", "52", "26", + "FCC", "5G", "20M", "HT", "1T", "56", "26", + "ETSI", "5G", "20M", "HT", "1T", "56", "26", + "MKK", "5G", "20M", "HT", "1T", "56", "26", + "FCC", "5G", "20M", "HT", "1T", "60", "26", + "ETSI", "5G", "20M", "HT", "1T", "60", "26", + "MKK", "5G", "20M", "HT", "1T", "60", "26", + "FCC", "5G", "20M", "HT", "1T", "64", "26", + "ETSI", "5G", "20M", "HT", "1T", "64", "26", + "MKK", "5G", "20M", "HT", "1T", "64", "26", + "FCC", "5G", "20M", "HT", "1T", "100", "26", + "ETSI", "5G", "20M", "HT", "1T", "100", "26", + "MKK", "5G", "20M", "HT", "1T", "100", "26", + "FCC", "5G", "20M", "HT", "1T", "114", "26", + "ETSI", "5G", "20M", "HT", "1T", "114", "26", + "MKK", "5G", "20M", "HT", "1T", "114", "26", + "FCC", "5G", "20M", "HT", "1T", "108", "26", + "ETSI", "5G", "20M", "HT", "1T", "108", "26", + "MKK", "5G", "20M", "HT", "1T", "108", "26", + "FCC", "5G", "20M", "HT", "1T", "112", "26", + "ETSI", "5G", "20M", "HT", "1T", "112", "26", + "MKK", "5G", "20M", "HT", "1T", "112", "26", + "FCC", "5G", "20M", "HT", "1T", "116", "26", + "ETSI", "5G", "20M", "HT", "1T", "116", "26", + "MKK", "5G", "20M", "HT", "1T", "116", "26", + "FCC", "5G", "20M", "HT", "1T", "120", "26", + "ETSI", "5G", "20M", "HT", "1T", "120", "26", + "MKK", "5G", "20M", "HT", "1T", "120", "26", + "FCC", "5G", "20M", "HT", "1T", "124", "26", + "ETSI", "5G", "20M", "HT", "1T", "124", "26", + "MKK", "5G", "20M", "HT", "1T", "124", "26", + "FCC", "5G", "20M", "HT", "1T", "128", "26", + "ETSI", "5G", "20M", "HT", "1T", "128", "26", + "MKK", "5G", "20M", "HT", "1T", "128", "26", + "FCC", "5G", "20M", "HT", "1T", "132", "26", + "ETSI", "5G", "20M", "HT", "1T", "132", "26", + "MKK", "5G", "20M", "HT", "1T", "132", "26", + "FCC", "5G", "20M", "HT", "1T", "136", "26", + "ETSI", "5G", "20M", "HT", "1T", "136", "26", + "MKK", "5G", "20M", "HT", "1T", "136", "26", + "FCC", "5G", "20M", "HT", "1T", "140", "26", + "ETSI", "5G", "20M", "HT", "1T", "140", "26", + "MKK", "5G", "20M", "HT", "1T", "140", "26", + "FCC", "5G", "20M", "HT", "1T", "149", "26", + "ETSI", "5G", "20M", "HT", "1T", "149", "26", + "MKK", "5G", "20M", "HT", "1T", "149", "63", + "FCC", "5G", "20M", "HT", "1T", "153", "26", + "ETSI", "5G", "20M", "HT", "1T", "153", "26", + "MKK", "5G", "20M", "HT", "1T", "153", "63", + "FCC", "5G", "20M", "HT", "1T", "157", "26", + "ETSI", "5G", "20M", "HT", "1T", "157", "26", + "MKK", "5G", "20M", "HT", "1T", "157", "63", + "FCC", "5G", "20M", "HT", "1T", "161", "26", + "ETSI", "5G", "20M", "HT", "1T", "161", "26", + "MKK", "5G", "20M", "HT", "1T", "161", "63", + "FCC", "5G", "20M", "HT", "1T", "165", "26", + "ETSI", "5G", "20M", "HT", "1T", "165", "26", + "MKK", "5G", "20M", "HT", "1T", "165", "63", + "FCC", "5G", "20M", "HT", "2T", "36", "26", + "ETSI", "5G", "20M", "HT", "2T", "36", "26", + "MKK", "5G", "20M", "HT", "2T", "36", "26", + "FCC", "5G", "20M", "HT", "2T", "40", "26", + "ETSI", "5G", "20M", "HT", "2T", "40", "26", + "MKK", "5G", "20M", "HT", "2T", "40", "26", + "FCC", "5G", "20M", "HT", "2T", "44", "26", + "ETSI", "5G", "20M", "HT", "2T", "44", "26", + "MKK", "5G", "20M", "HT", "2T", "44", "26", + "FCC", "5G", "20M", "HT", "2T", "48", "26", + "ETSI", "5G", "20M", "HT", "2T", "48", "26", + "MKK", "5G", "20M", "HT", "2T", "48", "26", + "FCC", "5G", "20M", "HT", "2T", "52", "26", + "ETSI", "5G", "20M", "HT", "2T", "52", "26", + "MKK", "5G", "20M", "HT", "2T", "52", "26", + "FCC", "5G", "20M", "HT", "2T", "56", "26", + "ETSI", "5G", "20M", "HT", "2T", "56", "26", + "MKK", "5G", "20M", "HT", "2T", "56", "26", + "FCC", "5G", "20M", "HT", "2T", "60", "26", + "ETSI", "5G", "20M", "HT", "2T", "60", "26", + "MKK", "5G", "20M", "HT", "2T", "60", "26", + "FCC", "5G", "20M", "HT", "2T", "64", "26", + "ETSI", "5G", "20M", "HT", "2T", "64", "26", + "MKK", "5G", "20M", "HT", "2T", "64", "26", + "FCC", "5G", "20M", "HT", "2T", "100", "26", + "ETSI", "5G", "20M", "HT", "2T", "100", "26", + "MKK", "5G", "20M", "HT", "2T", "100", "26", + "FCC", "5G", "20M", "HT", "2T", "114", "26", + "ETSI", "5G", "20M", "HT", "2T", "114", "26", + "MKK", "5G", "20M", "HT", "2T", "114", "26", + "FCC", "5G", "20M", "HT", "2T", "108", "26", + "ETSI", "5G", "20M", "HT", "2T", "108", "26", + "MKK", "5G", "20M", "HT", "2T", "108", "26", + "FCC", "5G", "20M", "HT", "2T", "112", "26", + "ETSI", "5G", "20M", "HT", "2T", "112", "26", + "MKK", "5G", "20M", "HT", "2T", "112", "26", + "FCC", "5G", "20M", "HT", "2T", "116", "26", + "ETSI", "5G", "20M", "HT", "2T", "116", "26", + "MKK", "5G", "20M", "HT", "2T", "116", "26", + "FCC", "5G", "20M", "HT", "2T", "120", "26", + "ETSI", "5G", "20M", "HT", "2T", "120", "26", + "MKK", "5G", "20M", "HT", "2T", "120", "26", + "FCC", "5G", "20M", "HT", "2T", "124", "26", + "ETSI", "5G", "20M", "HT", "2T", "124", "26", + "MKK", "5G", "20M", "HT", "2T", "124", "26", + "FCC", "5G", "20M", "HT", "2T", "128", "26", + "ETSI", "5G", "20M", "HT", "2T", "128", "26", + "MKK", "5G", "20M", "HT", "2T", "128", "26", + "FCC", "5G", "20M", "HT", "2T", "132", "26", + "ETSI", "5G", "20M", "HT", "2T", "132", "26", + "MKK", "5G", "20M", "HT", "2T", "132", "26", + "FCC", "5G", "20M", "HT", "2T", "136", "26", + "ETSI", "5G", "20M", "HT", "2T", "136", "26", + "MKK", "5G", "20M", "HT", "2T", "136", "26", + "FCC", "5G", "20M", "HT", "2T", "140", "26", + "ETSI", "5G", "20M", "HT", "2T", "140", "26", + "MKK", "5G", "20M", "HT", "2T", "140", "26", + "FCC", "5G", "20M", "HT", "2T", "149", "26", + "ETSI", "5G", "20M", "HT", "2T", "149", "26", + "MKK", "5G", "20M", "HT", "2T", "149", "63", + "FCC", "5G", "20M", "HT", "2T", "153", "26", + "ETSI", "5G", "20M", "HT", "2T", "153", "26", + "MKK", "5G", "20M", "HT", "2T", "153", "63", + "FCC", "5G", "20M", "HT", "2T", "157", "26", + "ETSI", "5G", "20M", "HT", "2T", "157", "26", + "MKK", "5G", "20M", "HT", "2T", "157", "63", + "FCC", "5G", "20M", "HT", "2T", "161", "26", + "ETSI", "5G", "20M", "HT", "2T", "161", "26", + "MKK", "5G", "20M", "HT", "2T", "161", "63", + "FCC", "5G", "20M", "HT", "2T", "165", "26", + "ETSI", "5G", "20M", "HT", "2T", "165", "26", + "MKK", "5G", "20M", "HT", "2T", "165", "63", + "FCC", "5G", "40M", "HT", "1T", "38", "26", + "ETSI", "5G", "40M", "HT", "1T", "38", "26", + "MKK", "5G", "40M", "HT", "1T", "38", "26", + "FCC", "5G", "40M", "HT", "1T", "46", "26", + "ETSI", "5G", "40M", "HT", "1T", "46", "26", + "MKK", "5G", "40M", "HT", "1T", "46", "26", + "FCC", "5G", "40M", "HT", "1T", "54", "26", + "ETSI", "5G", "40M", "HT", "1T", "54", "26", + "MKK", "5G", "40M", "HT", "1T", "54", "26", + "FCC", "5G", "40M", "HT", "1T", "62", "24", + "ETSI", "5G", "40M", "HT", "1T", "62", "26", + "MKK", "5G", "40M", "HT", "1T", "62", "26", + "FCC", "5G", "40M", "HT", "1T", "102", "24", + "ETSI", "5G", "40M", "HT", "1T", "102", "26", + "MKK", "5G", "40M", "HT", "1T", "102", "26", + "FCC", "5G", "40M", "HT", "1T", "110", "26", + "ETSI", "5G", "40M", "HT", "1T", "110", "26", + "MKK", "5G", "40M", "HT", "1T", "110", "26", + "FCC", "5G", "40M", "HT", "1T", "118", "26", + "ETSI", "5G", "40M", "HT", "1T", "118", "26", + "MKK", "5G", "40M", "HT", "1T", "118", "26", + "FCC", "5G", "40M", "HT", "1T", "126", "26", + "ETSI", "5G", "40M", "HT", "1T", "126", "26", + "MKK", "5G", "40M", "HT", "1T", "126", "26", + "FCC", "5G", "40M", "HT", "1T", "134", "26", + "ETSI", "5G", "40M", "HT", "1T", "134", "26", + "MKK", "5G", "40M", "HT", "1T", "134", "26", + "FCC", "5G", "40M", "HT", "1T", "151", "26", + "ETSI", "5G", "40M", "HT", "1T", "151", "26", + "MKK", "5G", "40M", "HT", "1T", "151", "63", + "FCC", "5G", "40M", "HT", "1T", "159", "26", + "ETSI", "5G", "40M", "HT", "1T", "159", "26", + "MKK", "5G", "40M", "HT", "1T", "159", "63", + "FCC", "5G", "40M", "HT", "2T", "38", "26", + "ETSI", "5G", "40M", "HT", "2T", "38", "26", + "MKK", "5G", "40M", "HT", "2T", "38", "26", + "FCC", "5G", "40M", "HT", "2T", "46", "26", + "ETSI", "5G", "40M", "HT", "2T", "46", "26", + "MKK", "5G", "40M", "HT", "2T", "46", "26", + "FCC", "5G", "40M", "HT", "2T", "54", "26", + "ETSI", "5G", "40M", "HT", "2T", "54", "26", + "MKK", "5G", "40M", "HT", "2T", "54", "26", + "FCC", "5G", "40M", "HT", "2T", "62", "26", + "ETSI", "5G", "40M", "HT", "2T", "62", "26", + "MKK", "5G", "40M", "HT", "2T", "62", "26", + "FCC", "5G", "40M", "HT", "2T", "102", "26", + "ETSI", "5G", "40M", "HT", "2T", "102", "26", + "MKK", "5G", "40M", "HT", "2T", "102", "26", + "FCC", "5G", "40M", "HT", "2T", "110", "26", + "ETSI", "5G", "40M", "HT", "2T", "110", "26", + "MKK", "5G", "40M", "HT", "2T", "110", "26", + "FCC", "5G", "40M", "HT", "2T", "118", "26", + "ETSI", "5G", "40M", "HT", "2T", "118", "26", + "MKK", "5G", "40M", "HT", "2T", "118", "26", + "FCC", "5G", "40M", "HT", "2T", "126", "26", + "ETSI", "5G", "40M", "HT", "2T", "126", "26", + "MKK", "5G", "40M", "HT", "2T", "126", "26", + "FCC", "5G", "40M", "HT", "2T", "134", "26", + "ETSI", "5G", "40M", "HT", "2T", "134", "26", + "MKK", "5G", "40M", "HT", "2T", "134", "26", + "FCC", "5G", "40M", "HT", "2T", "151", "26", + "ETSI", "5G", "40M", "HT", "2T", "151", "26", + "MKK", "5G", "40M", "HT", "2T", "151", "63", + "FCC", "5G", "40M", "HT", "2T", "159", "26", + "ETSI", "5G", "40M", "HT", "2T", "159", "26", + "MKK", "5G", "40M", "HT", "2T", "159", "63", + "FCC", "5G", "80M", "VHT", "1T", "42", "22", + "ETSI", "5G", "80M", "VHT", "1T", "42", "26", + "MKK", "5G", "80M", "VHT", "1T", "42", "26", + "FCC", "5G", "80M", "VHT", "1T", "58", "20", + "ETSI", "5G", "80M", "VHT", "1T", "58", "26", + "MKK", "5G", "80M", "VHT", "1T", "58", "26", + "FCC", "5G", "80M", "VHT", "1T", "106", "20", + "ETSI", "5G", "80M", "VHT", "1T", "106", "26", + "MKK", "5G", "80M", "VHT", "1T", "106", "26", + "FCC", "5G", "80M", "VHT", "1T", "122", "20", + "ETSI", "5G", "80M", "VHT", "1T", "122", "26", + "MKK", "5G", "80M", "VHT", "1T", "122", "26", + "FCC", "5G", "80M", "VHT", "1T", "155", "26", + "ETSI", "5G", "80M", "VHT", "1T", "155", "26", + "MKK", "5G", "80M", "VHT", "1T", "155", "63", + "FCC", "5G", "80M", "VHT", "2T", "42", "26", + "ETSI", "5G", "80M", "VHT", "2T", "42", "26", + "MKK", "5G", "80M", "VHT", "2T", "42", "26", + "FCC", "5G", "80M", "VHT", "2T", "58", "26", + "ETSI", "5G", "80M", "VHT", "2T", "58", "26", + "MKK", "5G", "80M", "VHT", "2T", "58", "26", + "FCC", "5G", "80M", "VHT", "2T", "106", "26", + "ETSI", "5G", "80M", "VHT", "2T", "106", "26", + "MKK", "5G", "80M", "VHT", "2T", "106", "26", + "FCC", "5G", "80M", "VHT", "2T", "122", "26", + "ETSI", "5G", "80M", "VHT", "2T", "122", "26", + "MKK", "5G", "80M", "VHT", "2T", "122", "26", + "FCC", "5G", "80M", "VHT", "2T", "155", "26", + "ETSI", "5G", "80M", "VHT", "2T", "155", "26", + "MKK", "5G", "80M", "VHT", "2T", "155", "63" +}; + +void +ODM_ReadAndConfig_MP_8821A_TXPWR_LMT_8821A_SAR_13dBm( + IN PDM_ODM_T pDM_Odm + ) +{ + u4Byte i = 0; + u4Byte ArrayLen = sizeof(Array_MP_8821A_TXPWR_LMT_8821A_SAR_13dBm)/sizeof(pu1Byte); + pu1Byte *Array = Array_MP_8821A_TXPWR_LMT_8821A_SAR_13dBm; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ReadAndConfig_MP_8821A_TXPWR_LMT_8821A_SAR_13dBm\n")); + + for (i = 0; i < ArrayLen; i += 7 ) + { + pu1Byte regulation = Array[i]; + pu1Byte band = Array[i+1]; + pu1Byte bandwidth = Array[i+2]; + pu1Byte rate = Array[i+3]; + pu1Byte rfPath = Array[i+4]; + pu1Byte chnl = Array[i+5]; + pu1Byte val = Array[i+6]; + + odm_ConfigBB_TXPWR_LMT_8821A(pDM_Odm, regulation, band, bandwidth, rate, rfPath, chnl, val); + } + +} + +/****************************************************************************** +* TXPWR_LMT_8821A_SAR_5mm.TXT +******************************************************************************/ + +pu1Byte Array_MP_8821A_TXPWR_LMT_8821A_SAR_5mm[] = { + "FCC", "2.4G", "20M", "CCK", "1T", "01", "32", + "ETSI", "2.4G", "20M", "CCK", "1T", "01", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "01", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "02", "32", + "ETSI", "2.4G", "20M", "CCK", "1T", "02", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "02", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "03", "34", + "ETSI", "2.4G", "20M", "CCK", "1T", "03", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "03", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "04", "34", + "ETSI", "2.4G", "20M", "CCK", "1T", "04", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "04", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "05", "34", + "ETSI", "2.4G", "20M", "CCK", "1T", "05", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "05", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "06", "34", + "ETSI", "2.4G", "20M", "CCK", "1T", "06", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "06", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "07", "34", + "ETSI", "2.4G", "20M", "CCK", "1T", "07", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "07", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "08", "34", + "ETSI", "2.4G", "20M", "CCK", "1T", "08", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "08", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "09", "32", + "ETSI", "2.4G", "20M", "CCK", "1T", "09", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "09", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "10", "32", + "ETSI", "2.4G", "20M", "CCK", "1T", "10", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "10", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "11", "32", + "ETSI", "2.4G", "20M", "CCK", "1T", "11", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "11", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "12", "63", + "ETSI", "2.4G", "20M", "CCK", "1T", "12", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "12", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "13", "63", + "ETSI", "2.4G", "20M", "CCK", "1T", "13", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "13", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "14", "63", + "ETSI", "2.4G", "20M", "CCK", "1T", "14", "63", + "MKK", "2.4G", "20M", "CCK", "1T", "14", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "01", "30", + "ETSI", "2.4G", "20M", "OFDM", "1T", "01", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "01", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "02", "30", + "ETSI", "2.4G", "20M", "OFDM", "1T", "02", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "02", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "03", "32", + "ETSI", "2.4G", "20M", "OFDM", "1T", "03", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "03", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "04", "32", + "ETSI", "2.4G", "20M", "OFDM", "1T", "04", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "04", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "05", "32", + "ETSI", "2.4G", "20M", "OFDM", "1T", "05", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "05", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "06", "32", + "ETSI", "2.4G", "20M", "OFDM", "1T", "06", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "06", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "07", "32", + "ETSI", "2.4G", "20M", "OFDM", "1T", "07", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "07", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "08", "32", + "ETSI", "2.4G", "20M", "OFDM", "1T", "08", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "08", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "09", "30", + "ETSI", "2.4G", "20M", "OFDM", "1T", "09", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "09", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "10", "30", + "ETSI", "2.4G", "20M", "OFDM", "1T", "10", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "10", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "11", "30", + "ETSI", "2.4G", "20M", "OFDM", "1T", "11", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "11", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "12", "63", + "ETSI", "2.4G", "20M", "OFDM", "1T", "12", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "12", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "13", "63", + "ETSI", "2.4G", "20M", "OFDM", "1T", "13", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "13", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "14", "63", + "ETSI", "2.4G", "20M", "OFDM", "1T", "14", "63", + "MKK", "2.4G", "20M", "OFDM", "1T", "14", "63", + "FCC", "2.4G", "20M", "HT", "1T", "01", "26", + "ETSI", "2.4G", "20M", "HT", "1T", "01", "32", + "MKK", "2.4G", "20M", "HT", "1T", "01", "32", + "FCC", "2.4G", "20M", "HT", "1T", "02", "26", + "ETSI", "2.4G", "20M", "HT", "1T", "02", "32", + "MKK", "2.4G", "20M", "HT", "1T", "02", "32", + "FCC", "2.4G", "20M", "HT", "1T", "03", "32", + "ETSI", "2.4G", "20M", "HT", "1T", "03", "32", + "MKK", "2.4G", "20M", "HT", "1T", "03", "32", + "FCC", "2.4G", "20M", "HT", "1T", "04", "32", + "ETSI", "2.4G", "20M", "HT", "1T", "04", "32", + "MKK", "2.4G", "20M", "HT", "1T", "04", "32", + "FCC", "2.4G", "20M", "HT", "1T", "05", "32", + "ETSI", "2.4G", "20M", "HT", "1T", "05", "32", + "MKK", "2.4G", "20M", "HT", "1T", "05", "32", + "FCC", "2.4G", "20M", "HT", "1T", "06", "32", + "ETSI", "2.4G", "20M", "HT", "1T", "06", "32", + "MKK", "2.4G", "20M", "HT", "1T", "06", "32", + "FCC", "2.4G", "20M", "HT", "1T", "07", "32", + "ETSI", "2.4G", "20M", "HT", "1T", "07", "32", + "MKK", "2.4G", "20M", "HT", "1T", "07", "32", + "FCC", "2.4G", "20M", "HT", "1T", "08", "32", + "ETSI", "2.4G", "20M", "HT", "1T", "08", "32", + "MKK", "2.4G", "20M", "HT", "1T", "08", "32", + "FCC", "2.4G", "20M", "HT", "1T", "09", "26", + "ETSI", "2.4G", "20M", "HT", "1T", "09", "32", + "MKK", "2.4G", "20M", "HT", "1T", "09", "32", + "FCC", "2.4G", "20M", "HT", "1T", "10", "26", + "ETSI", "2.4G", "20M", "HT", "1T", "10", "32", + "MKK", "2.4G", "20M", "HT", "1T", "10", "32", + "FCC", "2.4G", "20M", "HT", "1T", "11", "26", + "ETSI", "2.4G", "20M", "HT", "1T", "11", "32", + "MKK", "2.4G", "20M", "HT", "1T", "11", "32", + "FCC", "2.4G", "20M", "HT", "1T", "12", "63", + "ETSI", "2.4G", "20M", "HT", "1T", "12", "32", + "MKK", "2.4G", "20M", "HT", "1T", "12", "32", + "FCC", "2.4G", "20M", "HT", "1T", "13", "63", + "ETSI", "2.4G", "20M", "HT", "1T", "13", "32", + "MKK", "2.4G", "20M", "HT", "1T", "13", "32", + "FCC", "2.4G", "20M", "HT", "1T", "14", "63", + "ETSI", "2.4G", "20M", "HT", "1T", "14", "63", + "MKK", "2.4G", "20M", "HT", "1T", "14", "63", + "FCC", "2.4G", "20M", "HT", "2T", "01", "30", + "ETSI", "2.4G", "20M", "HT", "2T", "01", "32", + "MKK", "2.4G", "20M", "HT", "2T", "01", "32", + "FCC", "2.4G", "20M", "HT", "2T", "02", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "02", "32", + "MKK", "2.4G", "20M", "HT", "2T", "02", "32", + "FCC", "2.4G", "20M", "HT", "2T", "03", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "03", "32", + "MKK", "2.4G", "20M", "HT", "2T", "03", "32", + "FCC", "2.4G", "20M", "HT", "2T", "04", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "04", "32", + "MKK", "2.4G", "20M", "HT", "2T", "04", "32", + "FCC", "2.4G", "20M", "HT", "2T", "05", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "05", "32", + "MKK", "2.4G", "20M", "HT", "2T", "05", "32", + "FCC", "2.4G", "20M", "HT", "2T", "06", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "06", "32", + "MKK", "2.4G", "20M", "HT", "2T", "06", "32", + "FCC", "2.4G", "20M", "HT", "2T", "07", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "07", "32", + "MKK", "2.4G", "20M", "HT", "2T", "07", "32", + "FCC", "2.4G", "20M", "HT", "2T", "08", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "08", "32", + "MKK", "2.4G", "20M", "HT", "2T", "08", "32", + "FCC", "2.4G", "20M", "HT", "2T", "09", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "09", "32", + "MKK", "2.4G", "20M", "HT", "2T", "09", "32", + "FCC", "2.4G", "20M", "HT", "2T", "10", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "10", "32", + "MKK", "2.4G", "20M", "HT", "2T", "10", "32", + "FCC", "2.4G", "20M", "HT", "2T", "11", "30", + "ETSI", "2.4G", "20M", "HT", "2T", "11", "32", + "MKK", "2.4G", "20M", "HT", "2T", "11", "32", + "FCC", "2.4G", "20M", "HT", "2T", "12", "63", + "ETSI", "2.4G", "20M", "HT", "2T", "12", "32", + "MKK", "2.4G", "20M", "HT", "2T", "12", "32", + "FCC", "2.4G", "20M", "HT", "2T", "13", "63", + "ETSI", "2.4G", "20M", "HT", "2T", "13", "32", + "MKK", "2.4G", "20M", "HT", "2T", "13", "32", + "FCC", "2.4G", "20M", "HT", "2T", "14", "63", + "ETSI", "2.4G", "20M", "HT", "2T", "14", "63", + "MKK", "2.4G", "20M", "HT", "2T", "14", "63", + "FCC", "2.4G", "40M", "HT", "1T", "01", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "01", "63", + "MKK", "2.4G", "40M", "HT", "1T", "01", "63", + "FCC", "2.4G", "40M", "HT", "1T", "02", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "02", "63", + "MKK", "2.4G", "40M", "HT", "1T", "02", "63", + "FCC", "2.4G", "40M", "HT", "1T", "03", "26", + "ETSI", "2.4G", "40M", "HT", "1T", "03", "32", + "MKK", "2.4G", "40M", "HT", "1T", "03", "32", + "FCC", "2.4G", "40M", "HT", "1T", "04", "26", + "ETSI", "2.4G", "40M", "HT", "1T", "04", "32", + "MKK", "2.4G", "40M", "HT", "1T", "04", "32", + "FCC", "2.4G", "40M", "HT", "1T", "05", "26", + "ETSI", "2.4G", "40M", "HT", "1T", "05", "32", + "MKK", "2.4G", "40M", "HT", "1T", "05", "32", + "FCC", "2.4G", "40M", "HT", "1T", "06", "32", + "ETSI", "2.4G", "40M", "HT", "1T", "06", "32", + "MKK", "2.4G", "40M", "HT", "1T", "06", "32", + "FCC", "2.4G", "40M", "HT", "1T", "07", "32", + "ETSI", "2.4G", "40M", "HT", "1T", "07", "32", + "MKK", "2.4G", "40M", "HT", "1T", "07", "32", + "FCC", "2.4G", "40M", "HT", "1T", "08", "32", + "ETSI", "2.4G", "40M", "HT", "1T", "08", "32", + "MKK", "2.4G", "40M", "HT", "1T", "08", "32", + "FCC", "2.4G", "40M", "HT", "1T", "09", "26", + "ETSI", "2.4G", "40M", "HT", "1T", "09", "32", + "MKK", "2.4G", "40M", "HT", "1T", "09", "32", + "FCC", "2.4G", "40M", "HT", "1T", "10", "26", + "ETSI", "2.4G", "40M", "HT", "1T", "10", "32", + "MKK", "2.4G", "40M", "HT", "1T", "10", "32", + "FCC", "2.4G", "40M", "HT", "1T", "11", "26", + "ETSI", "2.4G", "40M", "HT", "1T", "11", "32", + "MKK", "2.4G", "40M", "HT", "1T", "11", "32", + "FCC", "2.4G", "40M", "HT", "1T", "12", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "12", "32", + "MKK", "2.4G", "40M", "HT", "1T", "12", "32", + "FCC", "2.4G", "40M", "HT", "1T", "13", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "13", "32", + "MKK", "2.4G", "40M", "HT", "1T", "13", "32", + "FCC", "2.4G", "40M", "HT", "1T", "14", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "14", "63", + "MKK", "2.4G", "40M", "HT", "1T", "14", "63", + "FCC", "2.4G", "40M", "HT", "2T", "01", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "01", "63", + "MKK", "2.4G", "40M", "HT", "2T", "01", "63", + "FCC", "2.4G", "40M", "HT", "2T", "02", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "02", "63", + "MKK", "2.4G", "40M", "HT", "2T", "02", "63", + "FCC", "2.4G", "40M", "HT", "2T", "03", "30", + "ETSI", "2.4G", "40M", "HT", "2T", "03", "30", + "MKK", "2.4G", "40M", "HT", "2T", "03", "30", + "FCC", "2.4G", "40M", "HT", "2T", "04", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "04", "30", + "MKK", "2.4G", "40M", "HT", "2T", "04", "30", + "FCC", "2.4G", "40M", "HT", "2T", "05", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "05", "30", + "MKK", "2.4G", "40M", "HT", "2T", "05", "30", + "FCC", "2.4G", "40M", "HT", "2T", "06", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "06", "30", + "MKK", "2.4G", "40M", "HT", "2T", "06", "30", + "FCC", "2.4G", "40M", "HT", "2T", "07", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "07", "30", + "MKK", "2.4G", "40M", "HT", "2T", "07", "30", + "FCC", "2.4G", "40M", "HT", "2T", "08", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "08", "30", + "MKK", "2.4G", "40M", "HT", "2T", "08", "30", + "FCC", "2.4G", "40M", "HT", "2T", "09", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "09", "30", + "MKK", "2.4G", "40M", "HT", "2T", "09", "30", + "FCC", "2.4G", "40M", "HT", "2T", "10", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "10", "30", + "MKK", "2.4G", "40M", "HT", "2T", "10", "30", + "FCC", "2.4G", "40M", "HT", "2T", "11", "30", + "ETSI", "2.4G", "40M", "HT", "2T", "11", "30", + "MKK", "2.4G", "40M", "HT", "2T", "11", "30", + "FCC", "2.4G", "40M", "HT", "2T", "12", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "12", "32", + "MKK", "2.4G", "40M", "HT", "2T", "12", "32", + "FCC", "2.4G", "40M", "HT", "2T", "13", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "13", "32", + "MKK", "2.4G", "40M", "HT", "2T", "13", "32", + "FCC", "2.4G", "40M", "HT", "2T", "14", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "14", "63", + "MKK", "2.4G", "40M", "HT", "2T", "14", "63", + "FCC", "5G", "20M", "OFDM", "1T", "36", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "36", "30", + "MKK", "5G", "20M", "OFDM", "1T", "36", "30", + "FCC", "5G", "20M", "OFDM", "1T", "40", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "40", "30", + "MKK", "5G", "20M", "OFDM", "1T", "40", "30", + "FCC", "5G", "20M", "OFDM", "1T", "44", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "44", "30", + "MKK", "5G", "20M", "OFDM", "1T", "44", "30", + "FCC", "5G", "20M", "OFDM", "1T", "48", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "48", "30", + "MKK", "5G", "20M", "OFDM", "1T", "48", "30", + "FCC", "5G", "20M", "OFDM", "1T", "52", "28", + "ETSI", "5G", "20M", "OFDM", "1T", "52", "30", + "MKK", "5G", "20M", "OFDM", "1T", "52", "30", + "FCC", "5G", "20M", "OFDM", "1T", "56", "28", + "ETSI", "5G", "20M", "OFDM", "1T", "56", "30", + "MKK", "5G", "20M", "OFDM", "1T", "56", "30", + "FCC", "5G", "20M", "OFDM", "1T", "60", "28", + "ETSI", "5G", "20M", "OFDM", "1T", "60", "30", + "MKK", "5G", "20M", "OFDM", "1T", "60", "30", + "FCC", "5G", "20M", "OFDM", "1T", "64", "28", + "ETSI", "5G", "20M", "OFDM", "1T", "64", "30", + "MKK", "5G", "20M", "OFDM", "1T", "64", "30", + "FCC", "5G", "20M", "OFDM", "1T", "100", "28", + "ETSI", "5G", "20M", "OFDM", "1T", "100", "30", + "MKK", "5G", "20M", "OFDM", "1T", "100", "30", + "FCC", "5G", "20M", "OFDM", "1T", "114", "28", + "ETSI", "5G", "20M", "OFDM", "1T", "114", "30", + "MKK", "5G", "20M", "OFDM", "1T", "114", "30", + "FCC", "5G", "20M", "OFDM", "1T", "108", "28", + "ETSI", "5G", "20M", "OFDM", "1T", "108", "30", + "MKK", "5G", "20M", "OFDM", "1T", "108", "30", + "FCC", "5G", "20M", "OFDM", "1T", "112", "28", + "ETSI", "5G", "20M", "OFDM", "1T", "112", "30", + "MKK", "5G", "20M", "OFDM", "1T", "112", "30", + "FCC", "5G", "20M", "OFDM", "1T", "116", "28", + "ETSI", "5G", "20M", "OFDM", "1T", "116", "30", + "MKK", "5G", "20M", "OFDM", "1T", "116", "30", + "FCC", "5G", "20M", "OFDM", "1T", "120", "28", + "ETSI", "5G", "20M", "OFDM", "1T", "120", "30", + "MKK", "5G", "20M", "OFDM", "1T", "120", "30", + "FCC", "5G", "20M", "OFDM", "1T", "124", "28", + "ETSI", "5G", "20M", "OFDM", "1T", "124", "30", + "MKK", "5G", "20M", "OFDM", "1T", "124", "30", + "FCC", "5G", "20M", "OFDM", "1T", "128", "28", + "ETSI", "5G", "20M", "OFDM", "1T", "128", "30", + "MKK", "5G", "20M", "OFDM", "1T", "128", "30", + "FCC", "5G", "20M", "OFDM", "1T", "132", "28", + "ETSI", "5G", "20M", "OFDM", "1T", "132", "30", + "MKK", "5G", "20M", "OFDM", "1T", "132", "30", + "FCC", "5G", "20M", "OFDM", "1T", "136", "28", + "ETSI", "5G", "20M", "OFDM", "1T", "136", "30", + "MKK", "5G", "20M", "OFDM", "1T", "136", "30", + "FCC", "5G", "20M", "OFDM", "1T", "140", "28", + "ETSI", "5G", "20M", "OFDM", "1T", "140", "30", + "MKK", "5G", "20M", "OFDM", "1T", "140", "30", + "FCC", "5G", "20M", "OFDM", "1T", "149", "28", + "ETSI", "5G", "20M", "OFDM", "1T", "149", "30", + "MKK", "5G", "20M", "OFDM", "1T", "149", "63", + "FCC", "5G", "20M", "OFDM", "1T", "153", "28", + "ETSI", "5G", "20M", "OFDM", "1T", "153", "30", + "MKK", "5G", "20M", "OFDM", "1T", "153", "63", + "FCC", "5G", "20M", "OFDM", "1T", "157", "28", + "ETSI", "5G", "20M", "OFDM", "1T", "157", "30", + "MKK", "5G", "20M", "OFDM", "1T", "157", "63", + "FCC", "5G", "20M", "OFDM", "1T", "161", "28", + "ETSI", "5G", "20M", "OFDM", "1T", "161", "30", + "MKK", "5G", "20M", "OFDM", "1T", "161", "63", + "FCC", "5G", "20M", "OFDM", "1T", "165", "28", + "ETSI", "5G", "20M", "OFDM", "1T", "165", "30", + "MKK", "5G", "20M", "OFDM", "1T", "165", "63", + "FCC", "5G", "20M", "HT", "1T", "36", "32", + "ETSI", "5G", "20M", "HT", "1T", "36", "30", + "MKK", "5G", "20M", "HT", "1T", "36", "30", + "FCC", "5G", "20M", "HT", "1T", "40", "32", + "ETSI", "5G", "20M", "HT", "1T", "40", "30", + "MKK", "5G", "20M", "HT", "1T", "40", "30", + "FCC", "5G", "20M", "HT", "1T", "44", "32", + "ETSI", "5G", "20M", "HT", "1T", "44", "30", + "MKK", "5G", "20M", "HT", "1T", "44", "30", + "FCC", "5G", "20M", "HT", "1T", "48", "32", + "ETSI", "5G", "20M", "HT", "1T", "48", "30", + "MKK", "5G", "20M", "HT", "1T", "48", "30", + "FCC", "5G", "20M", "HT", "1T", "52", "28", + "ETSI", "5G", "20M", "HT", "1T", "52", "30", + "MKK", "5G", "20M", "HT", "1T", "52", "30", + "FCC", "5G", "20M", "HT", "1T", "56", "28", + "ETSI", "5G", "20M", "HT", "1T", "56", "30", + "MKK", "5G", "20M", "HT", "1T", "56", "30", + "FCC", "5G", "20M", "HT", "1T", "60", "28", + "ETSI", "5G", "20M", "HT", "1T", "60", "30", + "MKK", "5G", "20M", "HT", "1T", "60", "30", + "FCC", "5G", "20M", "HT", "1T", "64", "28", + "ETSI", "5G", "20M", "HT", "1T", "64", "30", + "MKK", "5G", "20M", "HT", "1T", "64", "30", + "FCC", "5G", "20M", "HT", "1T", "100", "28", + "ETSI", "5G", "20M", "HT", "1T", "100", "30", + "MKK", "5G", "20M", "HT", "1T", "100", "30", + "FCC", "5G", "20M", "HT", "1T", "114", "28", + "ETSI", "5G", "20M", "HT", "1T", "114", "30", + "MKK", "5G", "20M", "HT", "1T", "114", "30", + "FCC", "5G", "20M", "HT", "1T", "108", "28", + "ETSI", "5G", "20M", "HT", "1T", "108", "30", + "MKK", "5G", "20M", "HT", "1T", "108", "30", + "FCC", "5G", "20M", "HT", "1T", "112", "28", + "ETSI", "5G", "20M", "HT", "1T", "112", "30", + "MKK", "5G", "20M", "HT", "1T", "112", "30", + "FCC", "5G", "20M", "HT", "1T", "116", "28", + "ETSI", "5G", "20M", "HT", "1T", "116", "30", + "MKK", "5G", "20M", "HT", "1T", "116", "30", + "FCC", "5G", "20M", "HT", "1T", "120", "28", + "ETSI", "5G", "20M", "HT", "1T", "120", "30", + "MKK", "5G", "20M", "HT", "1T", "120", "30", + "FCC", "5G", "20M", "HT", "1T", "124", "28", + "ETSI", "5G", "20M", "HT", "1T", "124", "30", + "MKK", "5G", "20M", "HT", "1T", "124", "30", + "FCC", "5G", "20M", "HT", "1T", "128", "28", + "ETSI", "5G", "20M", "HT", "1T", "128", "30", + "MKK", "5G", "20M", "HT", "1T", "128", "30", + "FCC", "5G", "20M", "HT", "1T", "132", "28", + "ETSI", "5G", "20M", "HT", "1T", "132", "30", + "MKK", "5G", "20M", "HT", "1T", "132", "30", + "FCC", "5G", "20M", "HT", "1T", "136", "28", + "ETSI", "5G", "20M", "HT", "1T", "136", "30", + "MKK", "5G", "20M", "HT", "1T", "136", "30", + "FCC", "5G", "20M", "HT", "1T", "140", "28", + "ETSI", "5G", "20M", "HT", "1T", "140", "30", + "MKK", "5G", "20M", "HT", "1T", "140", "30", + "FCC", "5G", "20M", "HT", "1T", "149", "28", + "ETSI", "5G", "20M", "HT", "1T", "149", "30", + "MKK", "5G", "20M", "HT", "1T", "149", "63", + "FCC", "5G", "20M", "HT", "1T", "153", "28", + "ETSI", "5G", "20M", "HT", "1T", "153", "30", + "MKK", "5G", "20M", "HT", "1T", "153", "63", + "FCC", "5G", "20M", "HT", "1T", "157", "28", + "ETSI", "5G", "20M", "HT", "1T", "157", "30", + "MKK", "5G", "20M", "HT", "1T", "157", "63", + "FCC", "5G", "20M", "HT", "1T", "161", "28", + "ETSI", "5G", "20M", "HT", "1T", "161", "30", + "MKK", "5G", "20M", "HT", "1T", "161", "63", + "FCC", "5G", "20M", "HT", "1T", "165", "28", + "ETSI", "5G", "20M", "HT", "1T", "165", "30", + "MKK", "5G", "20M", "HT", "1T", "165", "63", + "FCC", "5G", "20M", "HT", "2T", "36", "28", + "ETSI", "5G", "20M", "HT", "2T", "36", "30", + "MKK", "5G", "20M", "HT", "2T", "36", "30", + "FCC", "5G", "20M", "HT", "2T", "40", "28", + "ETSI", "5G", "20M", "HT", "2T", "40", "30", + "MKK", "5G", "20M", "HT", "2T", "40", "30", + "FCC", "5G", "20M", "HT", "2T", "44", "28", + "ETSI", "5G", "20M", "HT", "2T", "44", "30", + "MKK", "5G", "20M", "HT", "2T", "44", "30", + "FCC", "5G", "20M", "HT", "2T", "48", "28", + "ETSI", "5G", "20M", "HT", "2T", "48", "30", + "MKK", "5G", "20M", "HT", "2T", "48", "30", + "FCC", "5G", "20M", "HT", "2T", "52", "34", + "ETSI", "5G", "20M", "HT", "2T", "52", "30", + "MKK", "5G", "20M", "HT", "2T", "52", "30", + "FCC", "5G", "20M", "HT", "2T", "56", "32", + "ETSI", "5G", "20M", "HT", "2T", "56", "30", + "MKK", "5G", "20M", "HT", "2T", "56", "30", + "FCC", "5G", "20M", "HT", "2T", "60", "30", + "ETSI", "5G", "20M", "HT", "2T", "60", "30", + "MKK", "5G", "20M", "HT", "2T", "60", "30", + "FCC", "5G", "20M", "HT", "2T", "64", "26", + "ETSI", "5G", "20M", "HT", "2T", "64", "30", + "MKK", "5G", "20M", "HT", "2T", "64", "30", + "FCC", "5G", "20M", "HT", "2T", "100", "28", + "ETSI", "5G", "20M", "HT", "2T", "100", "30", + "MKK", "5G", "20M", "HT", "2T", "100", "30", + "FCC", "5G", "20M", "HT", "2T", "114", "28", + "ETSI", "5G", "20M", "HT", "2T", "114", "30", + "MKK", "5G", "20M", "HT", "2T", "114", "30", + "FCC", "5G", "20M", "HT", "2T", "108", "30", + "ETSI", "5G", "20M", "HT", "2T", "108", "30", + "MKK", "5G", "20M", "HT", "2T", "108", "30", + "FCC", "5G", "20M", "HT", "2T", "112", "32", + "ETSI", "5G", "20M", "HT", "2T", "112", "30", + "MKK", "5G", "20M", "HT", "2T", "112", "30", + "FCC", "5G", "20M", "HT", "2T", "116", "32", + "ETSI", "5G", "20M", "HT", "2T", "116", "30", + "MKK", "5G", "20M", "HT", "2T", "116", "30", + "FCC", "5G", "20M", "HT", "2T", "120", "34", + "ETSI", "5G", "20M", "HT", "2T", "120", "30", + "MKK", "5G", "20M", "HT", "2T", "120", "30", + "FCC", "5G", "20M", "HT", "2T", "124", "32", + "ETSI", "5G", "20M", "HT", "2T", "124", "30", + "MKK", "5G", "20M", "HT", "2T", "124", "30", + "FCC", "5G", "20M", "HT", "2T", "128", "30", + "ETSI", "5G", "20M", "HT", "2T", "128", "30", + "MKK", "5G", "20M", "HT", "2T", "128", "30", + "FCC", "5G", "20M", "HT", "2T", "132", "28", + "ETSI", "5G", "20M", "HT", "2T", "132", "30", + "MKK", "5G", "20M", "HT", "2T", "132", "30", + "FCC", "5G", "20M", "HT", "2T", "136", "28", + "ETSI", "5G", "20M", "HT", "2T", "136", "30", + "MKK", "5G", "20M", "HT", "2T", "136", "30", + "FCC", "5G", "20M", "HT", "2T", "140", "26", + "ETSI", "5G", "20M", "HT", "2T", "140", "30", + "MKK", "5G", "20M", "HT", "2T", "140", "30", + "FCC", "5G", "20M", "HT", "2T", "149", "34", + "ETSI", "5G", "20M", "HT", "2T", "149", "30", + "MKK", "5G", "20M", "HT", "2T", "149", "63", + "FCC", "5G", "20M", "HT", "2T", "153", "34", + "ETSI", "5G", "20M", "HT", "2T", "153", "30", + "MKK", "5G", "20M", "HT", "2T", "153", "63", + "FCC", "5G", "20M", "HT", "2T", "157", "34", + "ETSI", "5G", "20M", "HT", "2T", "157", "30", + "MKK", "5G", "20M", "HT", "2T", "157", "63", + "FCC", "5G", "20M", "HT", "2T", "161", "34", + "ETSI", "5G", "20M", "HT", "2T", "161", "30", + "MKK", "5G", "20M", "HT", "2T", "161", "63", + "FCC", "5G", "20M", "HT", "2T", "165", "34", + "ETSI", "5G", "20M", "HT", "2T", "165", "30", + "MKK", "5G", "20M", "HT", "2T", "165", "63", + "FCC", "5G", "40M", "HT", "1T", "38", "26", + "ETSI", "5G", "40M", "HT", "1T", "38", "30", + "MKK", "5G", "40M", "HT", "1T", "38", "30", + "FCC", "5G", "40M", "HT", "1T", "46", "32", + "ETSI", "5G", "40M", "HT", "1T", "46", "30", + "MKK", "5G", "40M", "HT", "1T", "46", "30", + "FCC", "5G", "40M", "HT", "1T", "54", "28", + "ETSI", "5G", "40M", "HT", "1T", "54", "30", + "MKK", "5G", "40M", "HT", "1T", "54", "30", + "FCC", "5G", "40M", "HT", "1T", "62", "24", + "ETSI", "5G", "40M", "HT", "1T", "62", "30", + "MKK", "5G", "40M", "HT", "1T", "62", "30", + "FCC", "5G", "40M", "HT", "1T", "102", "24", + "ETSI", "5G", "40M", "HT", "1T", "102", "30", + "MKK", "5G", "40M", "HT", "1T", "102", "30", + "FCC", "5G", "40M", "HT", "1T", "110", "28", + "ETSI", "5G", "40M", "HT", "1T", "110", "30", + "MKK", "5G", "40M", "HT", "1T", "110", "30", + "FCC", "5G", "40M", "HT", "1T", "118", "28", + "ETSI", "5G", "40M", "HT", "1T", "118", "30", + "MKK", "5G", "40M", "HT", "1T", "118", "30", + "FCC", "5G", "40M", "HT", "1T", "126", "28", + "ETSI", "5G", "40M", "HT", "1T", "126", "30", + "MKK", "5G", "40M", "HT", "1T", "126", "30", + "FCC", "5G", "40M", "HT", "1T", "134", "28", + "ETSI", "5G", "40M", "HT", "1T", "134", "30", + "MKK", "5G", "40M", "HT", "1T", "134", "30", + "FCC", "5G", "40M", "HT", "1T", "151", "28", + "ETSI", "5G", "40M", "HT", "1T", "151", "30", + "MKK", "5G", "40M", "HT", "1T", "151", "63", + "FCC", "5G", "40M", "HT", "1T", "159", "28", + "ETSI", "5G", "40M", "HT", "1T", "159", "30", + "MKK", "5G", "40M", "HT", "1T", "159", "63", + "FCC", "5G", "40M", "HT", "2T", "38", "28", + "ETSI", "5G", "40M", "HT", "2T", "38", "30", + "MKK", "5G", "40M", "HT", "2T", "38", "30", + "FCC", "5G", "40M", "HT", "2T", "46", "28", + "ETSI", "5G", "40M", "HT", "2T", "46", "30", + "MKK", "5G", "40M", "HT", "2T", "46", "30", + "FCC", "5G", "40M", "HT", "2T", "54", "30", + "ETSI", "5G", "40M", "HT", "2T", "54", "30", + "MKK", "5G", "40M", "HT", "2T", "54", "30", + "FCC", "5G", "40M", "HT", "2T", "62", "30", + "ETSI", "5G", "40M", "HT", "2T", "62", "30", + "MKK", "5G", "40M", "HT", "2T", "62", "30", + "FCC", "5G", "40M", "HT", "2T", "102", "26", + "ETSI", "5G", "40M", "HT", "2T", "102", "30", + "MKK", "5G", "40M", "HT", "2T", "102", "30", + "FCC", "5G", "40M", "HT", "2T", "110", "30", + "ETSI", "5G", "40M", "HT", "2T", "110", "30", + "MKK", "5G", "40M", "HT", "2T", "110", "30", + "FCC", "5G", "40M", "HT", "2T", "118", "34", + "ETSI", "5G", "40M", "HT", "2T", "118", "30", + "MKK", "5G", "40M", "HT", "2T", "118", "30", + "FCC", "5G", "40M", "HT", "2T", "126", "32", + "ETSI", "5G", "40M", "HT", "2T", "126", "30", + "MKK", "5G", "40M", "HT", "2T", "126", "30", + "FCC", "5G", "40M", "HT", "2T", "134", "30", + "ETSI", "5G", "40M", "HT", "2T", "134", "30", + "MKK", "5G", "40M", "HT", "2T", "134", "30", + "FCC", "5G", "40M", "HT", "2T", "151", "34", + "ETSI", "5G", "40M", "HT", "2T", "151", "30", + "MKK", "5G", "40M", "HT", "2T", "151", "63", + "FCC", "5G", "40M", "HT", "2T", "159", "34", + "ETSI", "5G", "40M", "HT", "2T", "159", "30", + "MKK", "5G", "40M", "HT", "2T", "159", "63", + "FCC", "5G", "80M", "VHT", "1T", "42", "22", + "ETSI", "5G", "80M", "VHT", "1T", "42", "30", + "MKK", "5G", "80M", "VHT", "1T", "42", "30", + "FCC", "5G", "80M", "VHT", "1T", "58", "20", + "ETSI", "5G", "80M", "VHT", "1T", "58", "30", + "MKK", "5G", "80M", "VHT", "1T", "58", "30", + "FCC", "5G", "80M", "VHT", "1T", "106", "20", + "ETSI", "5G", "80M", "VHT", "1T", "106", "30", + "MKK", "5G", "80M", "VHT", "1T", "106", "30", + "FCC", "5G", "80M", "VHT", "1T", "122", "20", + "ETSI", "5G", "80M", "VHT", "1T", "122", "30", + "MKK", "5G", "80M", "VHT", "1T", "122", "30", + "FCC", "5G", "80M", "VHT", "1T", "155", "26", + "ETSI", "5G", "80M", "VHT", "1T", "155", "30", + "MKK", "5G", "80M", "VHT", "1T", "155", "63", + "FCC", "5G", "80M", "VHT", "2T", "42", "28", + "ETSI", "5G", "80M", "VHT", "2T", "42", "30", + "MKK", "5G", "80M", "VHT", "2T", "42", "30", + "FCC", "5G", "80M", "VHT", "2T", "58", "26", + "ETSI", "5G", "80M", "VHT", "2T", "58", "30", + "MKK", "5G", "80M", "VHT", "2T", "58", "30", + "FCC", "5G", "80M", "VHT", "2T", "106", "28", + "ETSI", "5G", "80M", "VHT", "2T", "106", "30", + "MKK", "5G", "80M", "VHT", "2T", "106", "30", + "FCC", "5G", "80M", "VHT", "2T", "122", "32", + "ETSI", "5G", "80M", "VHT", "2T", "122", "30", + "MKK", "5G", "80M", "VHT", "2T", "122", "30", + "FCC", "5G", "80M", "VHT", "2T", "155", "34", + "ETSI", "5G", "80M", "VHT", "2T", "155", "30", + "MKK", "5G", "80M", "VHT", "2T", "155", "63" +}; + +void +ODM_ReadAndConfig_MP_8821A_TXPWR_LMT_8821A_SAR_5mm( + IN PDM_ODM_T pDM_Odm + ) +{ + u4Byte i = 0; + u4Byte ArrayLen = sizeof(Array_MP_8821A_TXPWR_LMT_8821A_SAR_5mm)/sizeof(pu1Byte); + pu1Byte *Array = Array_MP_8821A_TXPWR_LMT_8821A_SAR_5mm; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ReadAndConfig_MP_8821A_TXPWR_LMT_8821A_SAR_5mm\n")); + + for (i = 0; i < ArrayLen; i += 7 ) + { + pu1Byte regulation = Array[i]; + pu1Byte band = Array[i+1]; + pu1Byte bandwidth = Array[i+2]; + pu1Byte rate = Array[i+3]; + pu1Byte rfPath = Array[i+4]; + pu1Byte chnl = Array[i+5]; + pu1Byte val = Array[i+6]; + + odm_ConfigBB_TXPWR_LMT_8821A(pDM_Odm, regulation, band, bandwidth, rate, rfPath, chnl, val); + } + +} + +/****************************************************************************** +* TXPWR_LMT_8821A_SAR_8mm.TXT +******************************************************************************/ + +pu1Byte Array_MP_8821A_TXPWR_LMT_8821A_SAR_8mm[] = { + "FCC", "2.4G", "20M", "CCK", "1T", "01", "32", + "ETSI", "2.4G", "20M", "CCK", "1T", "01", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "01", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "02", "32", + "ETSI", "2.4G", "20M", "CCK", "1T", "02", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "02", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "03", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "03", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "03", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "04", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "04", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "04", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "05", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "05", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "05", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "06", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "06", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "06", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "07", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "07", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "07", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "08", "36", + "ETSI", "2.4G", "20M", "CCK", "1T", "08", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "08", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "09", "32", + "ETSI", "2.4G", "20M", "CCK", "1T", "09", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "09", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "10", "32", + "ETSI", "2.4G", "20M", "CCK", "1T", "10", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "10", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "11", "32", + "ETSI", "2.4G", "20M", "CCK", "1T", "11", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "11", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "12", "63", + "ETSI", "2.4G", "20M", "CCK", "1T", "12", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "12", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "13", "63", + "ETSI", "2.4G", "20M", "CCK", "1T", "13", "32", + "MKK", "2.4G", "20M", "CCK", "1T", "13", "32", + "FCC", "2.4G", "20M", "CCK", "1T", "14", "63", + "ETSI", "2.4G", "20M", "CCK", "1T", "14", "63", + "MKK", "2.4G", "20M", "CCK", "1T", "14", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "01", "30", + "ETSI", "2.4G", "20M", "OFDM", "1T", "01", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "01", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "02", "30", + "ETSI", "2.4G", "20M", "OFDM", "1T", "02", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "02", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "03", "32", + "ETSI", "2.4G", "20M", "OFDM", "1T", "03", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "03", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "04", "32", + "ETSI", "2.4G", "20M", "OFDM", "1T", "04", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "04", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "05", "32", + "ETSI", "2.4G", "20M", "OFDM", "1T", "05", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "05", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "06", "32", + "ETSI", "2.4G", "20M", "OFDM", "1T", "06", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "06", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "07", "32", + "ETSI", "2.4G", "20M", "OFDM", "1T", "07", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "07", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "08", "32", + "ETSI", "2.4G", "20M", "OFDM", "1T", "08", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "08", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "09", "30", + "ETSI", "2.4G", "20M", "OFDM", "1T", "09", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "09", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "10", "30", + "ETSI", "2.4G", "20M", "OFDM", "1T", "10", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "10", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "11", "30", + "ETSI", "2.4G", "20M", "OFDM", "1T", "11", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "11", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "12", "63", + "ETSI", "2.4G", "20M", "OFDM", "1T", "12", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "12", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "13", "63", + "ETSI", "2.4G", "20M", "OFDM", "1T", "13", "32", + "MKK", "2.4G", "20M", "OFDM", "1T", "13", "32", + "FCC", "2.4G", "20M", "OFDM", "1T", "14", "63", + "ETSI", "2.4G", "20M", "OFDM", "1T", "14", "63", + "MKK", "2.4G", "20M", "OFDM", "1T", "14", "63", + "FCC", "2.4G", "20M", "HT", "1T", "01", "26", + "ETSI", "2.4G", "20M", "HT", "1T", "01", "32", + "MKK", "2.4G", "20M", "HT", "1T", "01", "32", + "FCC", "2.4G", "20M", "HT", "1T", "02", "26", + "ETSI", "2.4G", "20M", "HT", "1T", "02", "32", + "MKK", "2.4G", "20M", "HT", "1T", "02", "32", + "FCC", "2.4G", "20M", "HT", "1T", "03", "32", + "ETSI", "2.4G", "20M", "HT", "1T", "03", "32", + "MKK", "2.4G", "20M", "HT", "1T", "03", "32", + "FCC", "2.4G", "20M", "HT", "1T", "04", "32", + "ETSI", "2.4G", "20M", "HT", "1T", "04", "32", + "MKK", "2.4G", "20M", "HT", "1T", "04", "32", + "FCC", "2.4G", "20M", "HT", "1T", "05", "32", + "ETSI", "2.4G", "20M", "HT", "1T", "05", "32", + "MKK", "2.4G", "20M", "HT", "1T", "05", "32", + "FCC", "2.4G", "20M", "HT", "1T", "06", "32", + "ETSI", "2.4G", "20M", "HT", "1T", "06", "32", + "MKK", "2.4G", "20M", "HT", "1T", "06", "32", + "FCC", "2.4G", "20M", "HT", "1T", "07", "32", + "ETSI", "2.4G", "20M", "HT", "1T", "07", "32", + "MKK", "2.4G", "20M", "HT", "1T", "07", "32", + "FCC", "2.4G", "20M", "HT", "1T", "08", "32", + "ETSI", "2.4G", "20M", "HT", "1T", "08", "32", + "MKK", "2.4G", "20M", "HT", "1T", "08", "32", + "FCC", "2.4G", "20M", "HT", "1T", "09", "26", + "ETSI", "2.4G", "20M", "HT", "1T", "09", "32", + "MKK", "2.4G", "20M", "HT", "1T", "09", "32", + "FCC", "2.4G", "20M", "HT", "1T", "10", "26", + "ETSI", "2.4G", "20M", "HT", "1T", "10", "32", + "MKK", "2.4G", "20M", "HT", "1T", "10", "32", + "FCC", "2.4G", "20M", "HT", "1T", "11", "26", + "ETSI", "2.4G", "20M", "HT", "1T", "11", "32", + "MKK", "2.4G", "20M", "HT", "1T", "11", "32", + "FCC", "2.4G", "20M", "HT", "1T", "12", "63", + "ETSI", "2.4G", "20M", "HT", "1T", "12", "32", + "MKK", "2.4G", "20M", "HT", "1T", "12", "32", + "FCC", "2.4G", "20M", "HT", "1T", "13", "63", + "ETSI", "2.4G", "20M", "HT", "1T", "13", "32", + "MKK", "2.4G", "20M", "HT", "1T", "13", "32", + "FCC", "2.4G", "20M", "HT", "1T", "14", "63", + "ETSI", "2.4G", "20M", "HT", "1T", "14", "63", + "MKK", "2.4G", "20M", "HT", "1T", "14", "63", + "FCC", "2.4G", "20M", "HT", "2T", "01", "30", + "ETSI", "2.4G", "20M", "HT", "2T", "01", "32", + "MKK", "2.4G", "20M", "HT", "2T", "01", "32", + "FCC", "2.4G", "20M", "HT", "2T", "02", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "02", "32", + "MKK", "2.4G", "20M", "HT", "2T", "02", "32", + "FCC", "2.4G", "20M", "HT", "2T", "03", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "03", "32", + "MKK", "2.4G", "20M", "HT", "2T", "03", "32", + "FCC", "2.4G", "20M", "HT", "2T", "04", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "04", "32", + "MKK", "2.4G", "20M", "HT", "2T", "04", "32", + "FCC", "2.4G", "20M", "HT", "2T", "05", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "05", "32", + "MKK", "2.4G", "20M", "HT", "2T", "05", "32", + "FCC", "2.4G", "20M", "HT", "2T", "06", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "06", "32", + "MKK", "2.4G", "20M", "HT", "2T", "06", "32", + "FCC", "2.4G", "20M", "HT", "2T", "07", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "07", "32", + "MKK", "2.4G", "20M", "HT", "2T", "07", "32", + "FCC", "2.4G", "20M", "HT", "2T", "08", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "08", "32", + "MKK", "2.4G", "20M", "HT", "2T", "08", "32", + "FCC", "2.4G", "20M", "HT", "2T", "09", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "09", "32", + "MKK", "2.4G", "20M", "HT", "2T", "09", "32", + "FCC", "2.4G", "20M", "HT", "2T", "10", "32", + "ETSI", "2.4G", "20M", "HT", "2T", "10", "32", + "MKK", "2.4G", "20M", "HT", "2T", "10", "32", + "FCC", "2.4G", "20M", "HT", "2T", "11", "30", + "ETSI", "2.4G", "20M", "HT", "2T", "11", "32", + "MKK", "2.4G", "20M", "HT", "2T", "11", "32", + "FCC", "2.4G", "20M", "HT", "2T", "12", "63", + "ETSI", "2.4G", "20M", "HT", "2T", "12", "32", + "MKK", "2.4G", "20M", "HT", "2T", "12", "32", + "FCC", "2.4G", "20M", "HT", "2T", "13", "63", + "ETSI", "2.4G", "20M", "HT", "2T", "13", "32", + "MKK", "2.4G", "20M", "HT", "2T", "13", "32", + "FCC", "2.4G", "20M", "HT", "2T", "14", "63", + "ETSI", "2.4G", "20M", "HT", "2T", "14", "63", + "MKK", "2.4G", "20M", "HT", "2T", "14", "63", + "FCC", "2.4G", "40M", "HT", "1T", "01", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "01", "63", + "MKK", "2.4G", "40M", "HT", "1T", "01", "63", + "FCC", "2.4G", "40M", "HT", "1T", "02", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "02", "63", + "MKK", "2.4G", "40M", "HT", "1T", "02", "63", + "FCC", "2.4G", "40M", "HT", "1T", "03", "26", + "ETSI", "2.4G", "40M", "HT", "1T", "03", "32", + "MKK", "2.4G", "40M", "HT", "1T", "03", "32", + "FCC", "2.4G", "40M", "HT", "1T", "04", "26", + "ETSI", "2.4G", "40M", "HT", "1T", "04", "32", + "MKK", "2.4G", "40M", "HT", "1T", "04", "32", + "FCC", "2.4G", "40M", "HT", "1T", "05", "26", + "ETSI", "2.4G", "40M", "HT", "1T", "05", "32", + "MKK", "2.4G", "40M", "HT", "1T", "05", "32", + "FCC", "2.4G", "40M", "HT", "1T", "06", "32", + "ETSI", "2.4G", "40M", "HT", "1T", "06", "32", + "MKK", "2.4G", "40M", "HT", "1T", "06", "32", + "FCC", "2.4G", "40M", "HT", "1T", "07", "32", + "ETSI", "2.4G", "40M", "HT", "1T", "07", "32", + "MKK", "2.4G", "40M", "HT", "1T", "07", "32", + "FCC", "2.4G", "40M", "HT", "1T", "08", "32", + "ETSI", "2.4G", "40M", "HT", "1T", "08", "32", + "MKK", "2.4G", "40M", "HT", "1T", "08", "32", + "FCC", "2.4G", "40M", "HT", "1T", "09", "26", + "ETSI", "2.4G", "40M", "HT", "1T", "09", "32", + "MKK", "2.4G", "40M", "HT", "1T", "09", "32", + "FCC", "2.4G", "40M", "HT", "1T", "10", "26", + "ETSI", "2.4G", "40M", "HT", "1T", "10", "32", + "MKK", "2.4G", "40M", "HT", "1T", "10", "32", + "FCC", "2.4G", "40M", "HT", "1T", "11", "26", + "ETSI", "2.4G", "40M", "HT", "1T", "11", "32", + "MKK", "2.4G", "40M", "HT", "1T", "11", "32", + "FCC", "2.4G", "40M", "HT", "1T", "12", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "12", "32", + "MKK", "2.4G", "40M", "HT", "1T", "12", "32", + "FCC", "2.4G", "40M", "HT", "1T", "13", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "13", "32", + "MKK", "2.4G", "40M", "HT", "1T", "13", "32", + "FCC", "2.4G", "40M", "HT", "1T", "14", "63", + "ETSI", "2.4G", "40M", "HT", "1T", "14", "63", + "MKK", "2.4G", "40M", "HT", "1T", "14", "63", + "FCC", "2.4G", "40M", "HT", "2T", "01", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "01", "63", + "MKK", "2.4G", "40M", "HT", "2T", "01", "63", + "FCC", "2.4G", "40M", "HT", "2T", "02", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "02", "63", + "MKK", "2.4G", "40M", "HT", "2T", "02", "63", + "FCC", "2.4G", "40M", "HT", "2T", "03", "30", + "ETSI", "2.4G", "40M", "HT", "2T", "03", "30", + "MKK", "2.4G", "40M", "HT", "2T", "03", "30", + "FCC", "2.4G", "40M", "HT", "2T", "04", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "04", "30", + "MKK", "2.4G", "40M", "HT", "2T", "04", "30", + "FCC", "2.4G", "40M", "HT", "2T", "05", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "05", "30", + "MKK", "2.4G", "40M", "HT", "2T", "05", "30", + "FCC", "2.4G", "40M", "HT", "2T", "06", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "06", "30", + "MKK", "2.4G", "40M", "HT", "2T", "06", "30", + "FCC", "2.4G", "40M", "HT", "2T", "07", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "07", "30", + "MKK", "2.4G", "40M", "HT", "2T", "07", "30", + "FCC", "2.4G", "40M", "HT", "2T", "08", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "08", "30", + "MKK", "2.4G", "40M", "HT", "2T", "08", "30", + "FCC", "2.4G", "40M", "HT", "2T", "09", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "09", "30", + "MKK", "2.4G", "40M", "HT", "2T", "09", "30", + "FCC", "2.4G", "40M", "HT", "2T", "10", "32", + "ETSI", "2.4G", "40M", "HT", "2T", "10", "30", + "MKK", "2.4G", "40M", "HT", "2T", "10", "30", + "FCC", "2.4G", "40M", "HT", "2T", "11", "30", + "ETSI", "2.4G", "40M", "HT", "2T", "11", "30", + "MKK", "2.4G", "40M", "HT", "2T", "11", "30", + "FCC", "2.4G", "40M", "HT", "2T", "12", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "12", "32", + "MKK", "2.4G", "40M", "HT", "2T", "12", "32", + "FCC", "2.4G", "40M", "HT", "2T", "13", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "13", "32", + "MKK", "2.4G", "40M", "HT", "2T", "13", "32", + "FCC", "2.4G", "40M", "HT", "2T", "14", "63", + "ETSI", "2.4G", "40M", "HT", "2T", "14", "63", + "MKK", "2.4G", "40M", "HT", "2T", "14", "63", + "FCC", "5G", "20M", "OFDM", "1T", "36", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "36", "30", + "MKK", "5G", "20M", "OFDM", "1T", "36", "30", + "FCC", "5G", "20M", "OFDM", "1T", "40", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "40", "30", + "MKK", "5G", "20M", "OFDM", "1T", "40", "30", + "FCC", "5G", "20M", "OFDM", "1T", "44", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "44", "30", + "MKK", "5G", "20M", "OFDM", "1T", "44", "30", + "FCC", "5G", "20M", "OFDM", "1T", "48", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "48", "30", + "MKK", "5G", "20M", "OFDM", "1T", "48", "30", + "FCC", "5G", "20M", "OFDM", "1T", "52", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "52", "30", + "MKK", "5G", "20M", "OFDM", "1T", "52", "30", + "FCC", "5G", "20M", "OFDM", "1T", "56", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "56", "30", + "MKK", "5G", "20M", "OFDM", "1T", "56", "30", + "FCC", "5G", "20M", "OFDM", "1T", "60", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "60", "30", + "MKK", "5G", "20M", "OFDM", "1T", "60", "30", + "FCC", "5G", "20M", "OFDM", "1T", "64", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "64", "30", + "MKK", "5G", "20M", "OFDM", "1T", "64", "30", + "FCC", "5G", "20M", "OFDM", "1T", "100", "28", + "ETSI", "5G", "20M", "OFDM", "1T", "100", "30", + "MKK", "5G", "20M", "OFDM", "1T", "100", "30", + "FCC", "5G", "20M", "OFDM", "1T", "114", "28", + "ETSI", "5G", "20M", "OFDM", "1T", "114", "30", + "MKK", "5G", "20M", "OFDM", "1T", "114", "30", + "FCC", "5G", "20M", "OFDM", "1T", "108", "28", + "ETSI", "5G", "20M", "OFDM", "1T", "108", "30", + "MKK", "5G", "20M", "OFDM", "1T", "108", "30", + "FCC", "5G", "20M", "OFDM", "1T", "112", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "112", "30", + "MKK", "5G", "20M", "OFDM", "1T", "112", "30", + "FCC", "5G", "20M", "OFDM", "1T", "116", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "116", "30", + "MKK", "5G", "20M", "OFDM", "1T", "116", "30", + "FCC", "5G", "20M", "OFDM", "1T", "120", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "120", "30", + "MKK", "5G", "20M", "OFDM", "1T", "120", "30", + "FCC", "5G", "20M", "OFDM", "1T", "124", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "124", "30", + "MKK", "5G", "20M", "OFDM", "1T", "124", "30", + "FCC", "5G", "20M", "OFDM", "1T", "128", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "128", "30", + "MKK", "5G", "20M", "OFDM", "1T", "128", "30", + "FCC", "5G", "20M", "OFDM", "1T", "132", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "132", "30", + "MKK", "5G", "20M", "OFDM", "1T", "132", "30", + "FCC", "5G", "20M", "OFDM", "1T", "136", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "136", "30", + "MKK", "5G", "20M", "OFDM", "1T", "136", "30", + "FCC", "5G", "20M", "OFDM", "1T", "140", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "140", "30", + "MKK", "5G", "20M", "OFDM", "1T", "140", "30", + "FCC", "5G", "20M", "OFDM", "1T", "149", "28", + "ETSI", "5G", "20M", "OFDM", "1T", "149", "30", + "MKK", "5G", "20M", "OFDM", "1T", "149", "63", + "FCC", "5G", "20M", "OFDM", "1T", "153", "28", + "ETSI", "5G", "20M", "OFDM", "1T", "153", "30", + "MKK", "5G", "20M", "OFDM", "1T", "153", "63", + "FCC", "5G", "20M", "OFDM", "1T", "157", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "157", "30", + "MKK", "5G", "20M", "OFDM", "1T", "157", "63", + "FCC", "5G", "20M", "OFDM", "1T", "161", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "161", "30", + "MKK", "5G", "20M", "OFDM", "1T", "161", "63", + "FCC", "5G", "20M", "OFDM", "1T", "165", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "165", "30", + "MKK", "5G", "20M", "OFDM", "1T", "165", "63", + "FCC", "5G", "20M", "HT", "1T", "36", "32", + "ETSI", "5G", "20M", "HT", "1T", "36", "30", + "MKK", "5G", "20M", "HT", "1T", "36", "30", + "FCC", "5G", "20M", "HT", "1T", "40", "32", + "ETSI", "5G", "20M", "HT", "1T", "40", "30", + "MKK", "5G", "20M", "HT", "1T", "40", "30", + "FCC", "5G", "20M", "HT", "1T", "44", "32", + "ETSI", "5G", "20M", "HT", "1T", "44", "30", + "MKK", "5G", "20M", "HT", "1T", "44", "30", + "FCC", "5G", "20M", "HT", "1T", "48", "32", + "ETSI", "5G", "20M", "HT", "1T", "48", "30", + "MKK", "5G", "20M", "HT", "1T", "48", "30", + "FCC", "5G", "20M", "HT", "1T", "52", "32", + "ETSI", "5G", "20M", "HT", "1T", "52", "30", + "MKK", "5G", "20M", "HT", "1T", "52", "30", + "FCC", "5G", "20M", "HT", "1T", "56", "32", + "ETSI", "5G", "20M", "HT", "1T", "56", "30", + "MKK", "5G", "20M", "HT", "1T", "56", "30", + "FCC", "5G", "20M", "HT", "1T", "60", "32", + "ETSI", "5G", "20M", "HT", "1T", "60", "30", + "MKK", "5G", "20M", "HT", "1T", "60", "30", + "FCC", "5G", "20M", "HT", "1T", "64", "32", + "ETSI", "5G", "20M", "HT", "1T", "64", "30", + "MKK", "5G", "20M", "HT", "1T", "64", "30", + "FCC", "5G", "20M", "HT", "1T", "100", "28", + "ETSI", "5G", "20M", "HT", "1T", "100", "30", + "MKK", "5G", "20M", "HT", "1T", "100", "30", + "FCC", "5G", "20M", "HT", "1T", "114", "28", + "ETSI", "5G", "20M", "HT", "1T", "114", "30", + "MKK", "5G", "20M", "HT", "1T", "114", "30", + "FCC", "5G", "20M", "HT", "1T", "108", "28", + "ETSI", "5G", "20M", "HT", "1T", "108", "30", + "MKK", "5G", "20M", "HT", "1T", "108", "30", + "FCC", "5G", "20M", "HT", "1T", "112", "32", + "ETSI", "5G", "20M", "HT", "1T", "112", "30", + "MKK", "5G", "20M", "HT", "1T", "112", "30", + "FCC", "5G", "20M", "HT", "1T", "116", "32", + "ETSI", "5G", "20M", "HT", "1T", "116", "30", + "MKK", "5G", "20M", "HT", "1T", "116", "30", + "FCC", "5G", "20M", "HT", "1T", "120", "32", + "ETSI", "5G", "20M", "HT", "1T", "120", "30", + "MKK", "5G", "20M", "HT", "1T", "120", "30", + "FCC", "5G", "20M", "HT", "1T", "124", "32", + "ETSI", "5G", "20M", "HT", "1T", "124", "30", + "MKK", "5G", "20M", "HT", "1T", "124", "30", + "FCC", "5G", "20M", "HT", "1T", "128", "32", + "ETSI", "5G", "20M", "HT", "1T", "128", "30", + "MKK", "5G", "20M", "HT", "1T", "128", "30", + "FCC", "5G", "20M", "HT", "1T", "132", "32", + "ETSI", "5G", "20M", "HT", "1T", "132", "30", + "MKK", "5G", "20M", "HT", "1T", "132", "30", + "FCC", "5G", "20M", "HT", "1T", "136", "32", + "ETSI", "5G", "20M", "HT", "1T", "136", "30", + "MKK", "5G", "20M", "HT", "1T", "136", "30", + "FCC", "5G", "20M", "HT", "1T", "140", "32", + "ETSI", "5G", "20M", "HT", "1T", "140", "30", + "MKK", "5G", "20M", "HT", "1T", "140", "30", + "FCC", "5G", "20M", "HT", "1T", "149", "28", + "ETSI", "5G", "20M", "HT", "1T", "149", "30", + "MKK", "5G", "20M", "HT", "1T", "149", "63", + "FCC", "5G", "20M", "HT", "1T", "153", "28", + "ETSI", "5G", "20M", "HT", "1T", "153", "30", + "MKK", "5G", "20M", "HT", "1T", "153", "63", + "FCC", "5G", "20M", "HT", "1T", "157", "32", + "ETSI", "5G", "20M", "HT", "1T", "157", "30", + "MKK", "5G", "20M", "HT", "1T", "157", "63", + "FCC", "5G", "20M", "HT", "1T", "161", "32", + "ETSI", "5G", "20M", "HT", "1T", "161", "30", + "MKK", "5G", "20M", "HT", "1T", "161", "63", + "FCC", "5G", "20M", "HT", "1T", "165", "32", + "ETSI", "5G", "20M", "HT", "1T", "165", "30", + "MKK", "5G", "20M", "HT", "1T", "165", "63", + "FCC", "5G", "20M", "HT", "2T", "36", "28", + "ETSI", "5G", "20M", "HT", "2T", "36", "30", + "MKK", "5G", "20M", "HT", "2T", "36", "30", + "FCC", "5G", "20M", "HT", "2T", "40", "28", + "ETSI", "5G", "20M", "HT", "2T", "40", "30", + "MKK", "5G", "20M", "HT", "2T", "40", "30", + "FCC", "5G", "20M", "HT", "2T", "44", "28", + "ETSI", "5G", "20M", "HT", "2T", "44", "30", + "MKK", "5G", "20M", "HT", "2T", "44", "30", + "FCC", "5G", "20M", "HT", "2T", "48", "28", + "ETSI", "5G", "20M", "HT", "2T", "48", "30", + "MKK", "5G", "20M", "HT", "2T", "48", "30", + "FCC", "5G", "20M", "HT", "2T", "52", "34", + "ETSI", "5G", "20M", "HT", "2T", "52", "30", + "MKK", "5G", "20M", "HT", "2T", "52", "30", + "FCC", "5G", "20M", "HT", "2T", "56", "32", + "ETSI", "5G", "20M", "HT", "2T", "56", "30", + "MKK", "5G", "20M", "HT", "2T", "56", "30", + "FCC", "5G", "20M", "HT", "2T", "60", "30", + "ETSI", "5G", "20M", "HT", "2T", "60", "30", + "MKK", "5G", "20M", "HT", "2T", "60", "30", + "FCC", "5G", "20M", "HT", "2T", "64", "26", + "ETSI", "5G", "20M", "HT", "2T", "64", "30", + "MKK", "5G", "20M", "HT", "2T", "64", "30", + "FCC", "5G", "20M", "HT", "2T", "100", "28", + "ETSI", "5G", "20M", "HT", "2T", "100", "30", + "MKK", "5G", "20M", "HT", "2T", "100", "30", + "FCC", "5G", "20M", "HT", "2T", "114", "28", + "ETSI", "5G", "20M", "HT", "2T", "114", "30", + "MKK", "5G", "20M", "HT", "2T", "114", "30", + "FCC", "5G", "20M", "HT", "2T", "108", "30", + "ETSI", "5G", "20M", "HT", "2T", "108", "30", + "MKK", "5G", "20M", "HT", "2T", "108", "30", + "FCC", "5G", "20M", "HT", "2T", "112", "32", + "ETSI", "5G", "20M", "HT", "2T", "112", "30", + "MKK", "5G", "20M", "HT", "2T", "112", "30", + "FCC", "5G", "20M", "HT", "2T", "116", "32", + "ETSI", "5G", "20M", "HT", "2T", "116", "30", + "MKK", "5G", "20M", "HT", "2T", "116", "30", + "FCC", "5G", "20M", "HT", "2T", "120", "34", + "ETSI", "5G", "20M", "HT", "2T", "120", "30", + "MKK", "5G", "20M", "HT", "2T", "120", "30", + "FCC", "5G", "20M", "HT", "2T", "124", "32", + "ETSI", "5G", "20M", "HT", "2T", "124", "30", + "MKK", "5G", "20M", "HT", "2T", "124", "30", + "FCC", "5G", "20M", "HT", "2T", "128", "30", + "ETSI", "5G", "20M", "HT", "2T", "128", "30", + "MKK", "5G", "20M", "HT", "2T", "128", "30", + "FCC", "5G", "20M", "HT", "2T", "132", "28", + "ETSI", "5G", "20M", "HT", "2T", "132", "30", + "MKK", "5G", "20M", "HT", "2T", "132", "30", + "FCC", "5G", "20M", "HT", "2T", "136", "28", + "ETSI", "5G", "20M", "HT", "2T", "136", "30", + "MKK", "5G", "20M", "HT", "2T", "136", "30", + "FCC", "5G", "20M", "HT", "2T", "140", "26", + "ETSI", "5G", "20M", "HT", "2T", "140", "30", + "MKK", "5G", "20M", "HT", "2T", "140", "30", + "FCC", "5G", "20M", "HT", "2T", "149", "34", + "ETSI", "5G", "20M", "HT", "2T", "149", "30", + "MKK", "5G", "20M", "HT", "2T", "149", "63", + "FCC", "5G", "20M", "HT", "2T", "153", "34", + "ETSI", "5G", "20M", "HT", "2T", "153", "30", + "MKK", "5G", "20M", "HT", "2T", "153", "63", + "FCC", "5G", "20M", "HT", "2T", "157", "34", + "ETSI", "5G", "20M", "HT", "2T", "157", "30", + "MKK", "5G", "20M", "HT", "2T", "157", "63", + "FCC", "5G", "20M", "HT", "2T", "161", "34", + "ETSI", "5G", "20M", "HT", "2T", "161", "30", + "MKK", "5G", "20M", "HT", "2T", "161", "63", + "FCC", "5G", "20M", "HT", "2T", "165", "34", + "ETSI", "5G", "20M", "HT", "2T", "165", "30", + "MKK", "5G", "20M", "HT", "2T", "165", "63", + "FCC", "5G", "40M", "HT", "1T", "38", "26", + "ETSI", "5G", "40M", "HT", "1T", "38", "30", + "MKK", "5G", "40M", "HT", "1T", "38", "30", + "FCC", "5G", "40M", "HT", "1T", "46", "32", + "ETSI", "5G", "40M", "HT", "1T", "46", "30", + "MKK", "5G", "40M", "HT", "1T", "46", "30", + "FCC", "5G", "40M", "HT", "1T", "54", "32", + "ETSI", "5G", "40M", "HT", "1T", "54", "30", + "MKK", "5G", "40M", "HT", "1T", "54", "30", + "FCC", "5G", "40M", "HT", "1T", "62", "24", + "ETSI", "5G", "40M", "HT", "1T", "62", "30", + "MKK", "5G", "40M", "HT", "1T", "62", "30", + "FCC", "5G", "40M", "HT", "1T", "102", "24", + "ETSI", "5G", "40M", "HT", "1T", "102", "30", + "MKK", "5G", "40M", "HT", "1T", "102", "30", + "FCC", "5G", "40M", "HT", "1T", "110", "28", + "ETSI", "5G", "40M", "HT", "1T", "110", "30", + "MKK", "5G", "40M", "HT", "1T", "110", "30", + "FCC", "5G", "40M", "HT", "1T", "118", "28", + "ETSI", "5G", "40M", "HT", "1T", "118", "30", + "MKK", "5G", "40M", "HT", "1T", "118", "30", + "FCC", "5G", "40M", "HT", "1T", "126", "28", + "ETSI", "5G", "40M", "HT", "1T", "126", "30", + "MKK", "5G", "40M", "HT", "1T", "126", "30", + "FCC", "5G", "40M", "HT", "1T", "134", "32", + "ETSI", "5G", "40M", "HT", "1T", "134", "30", + "MKK", "5G", "40M", "HT", "1T", "134", "30", + "FCC", "5G", "40M", "HT", "1T", "151", "28", + "ETSI", "5G", "40M", "HT", "1T", "151", "30", + "MKK", "5G", "40M", "HT", "1T", "151", "63", + "FCC", "5G", "40M", "HT", "1T", "159", "32", + "ETSI", "5G", "40M", "HT", "1T", "159", "30", + "MKK", "5G", "40M", "HT", "1T", "159", "63", + "FCC", "5G", "40M", "HT", "2T", "38", "28", + "ETSI", "5G", "40M", "HT", "2T", "38", "30", + "MKK", "5G", "40M", "HT", "2T", "38", "30", + "FCC", "5G", "40M", "HT", "2T", "46", "28", + "ETSI", "5G", "40M", "HT", "2T", "46", "30", + "MKK", "5G", "40M", "HT", "2T", "46", "30", + "FCC", "5G", "40M", "HT", "2T", "54", "30", + "ETSI", "5G", "40M", "HT", "2T", "54", "30", + "MKK", "5G", "40M", "HT", "2T", "54", "30", + "FCC", "5G", "40M", "HT", "2T", "62", "30", + "ETSI", "5G", "40M", "HT", "2T", "62", "30", + "MKK", "5G", "40M", "HT", "2T", "62", "30", + "FCC", "5G", "40M", "HT", "2T", "102", "26", + "ETSI", "5G", "40M", "HT", "2T", "102", "30", + "MKK", "5G", "40M", "HT", "2T", "102", "30", + "FCC", "5G", "40M", "HT", "2T", "110", "30", + "ETSI", "5G", "40M", "HT", "2T", "110", "30", + "MKK", "5G", "40M", "HT", "2T", "110", "30", + "FCC", "5G", "40M", "HT", "2T", "118", "34", + "ETSI", "5G", "40M", "HT", "2T", "118", "30", + "MKK", "5G", "40M", "HT", "2T", "118", "30", + "FCC", "5G", "40M", "HT", "2T", "126", "32", + "ETSI", "5G", "40M", "HT", "2T", "126", "30", + "MKK", "5G", "40M", "HT", "2T", "126", "30", + "FCC", "5G", "40M", "HT", "2T", "134", "30", + "ETSI", "5G", "40M", "HT", "2T", "134", "30", + "MKK", "5G", "40M", "HT", "2T", "134", "30", + "FCC", "5G", "40M", "HT", "2T", "151", "34", + "ETSI", "5G", "40M", "HT", "2T", "151", "30", + "MKK", "5G", "40M", "HT", "2T", "151", "63", + "FCC", "5G", "40M", "HT", "2T", "159", "34", + "ETSI", "5G", "40M", "HT", "2T", "159", "30", + "MKK", "5G", "40M", "HT", "2T", "159", "63", + "FCC", "5G", "80M", "VHT", "1T", "42", "22", + "ETSI", "5G", "80M", "VHT", "1T", "42", "30", + "MKK", "5G", "80M", "VHT", "1T", "42", "30", + "FCC", "5G", "80M", "VHT", "1T", "58", "20", + "ETSI", "5G", "80M", "VHT", "1T", "58", "30", + "MKK", "5G", "80M", "VHT", "1T", "58", "30", + "FCC", "5G", "80M", "VHT", "1T", "106", "20", + "ETSI", "5G", "80M", "VHT", "1T", "106", "30", + "MKK", "5G", "80M", "VHT", "1T", "106", "30", + "FCC", "5G", "80M", "VHT", "1T", "122", "20", + "ETSI", "5G", "80M", "VHT", "1T", "122", "30", + "MKK", "5G", "80M", "VHT", "1T", "122", "30", + "FCC", "5G", "80M", "VHT", "1T", "155", "28", + "ETSI", "5G", "80M", "VHT", "1T", "155", "30", + "MKK", "5G", "80M", "VHT", "1T", "155", "63", + "FCC", "5G", "80M", "VHT", "2T", "42", "28", + "ETSI", "5G", "80M", "VHT", "2T", "42", "30", + "MKK", "5G", "80M", "VHT", "2T", "42", "30", + "FCC", "5G", "80M", "VHT", "2T", "58", "26", + "ETSI", "5G", "80M", "VHT", "2T", "58", "30", + "MKK", "5G", "80M", "VHT", "2T", "58", "30", + "FCC", "5G", "80M", "VHT", "2T", "106", "28", + "ETSI", "5G", "80M", "VHT", "2T", "106", "30", + "MKK", "5G", "80M", "VHT", "2T", "106", "30", + "FCC", "5G", "80M", "VHT", "2T", "122", "32", + "ETSI", "5G", "80M", "VHT", "2T", "122", "30", + "MKK", "5G", "80M", "VHT", "2T", "122", "30", + "FCC", "5G", "80M", "VHT", "2T", "155", "34", + "ETSI", "5G", "80M", "VHT", "2T", "155", "30", + "MKK", "5G", "80M", "VHT", "2T", "155", "63" +}; + +void +ODM_ReadAndConfig_MP_8821A_TXPWR_LMT_8821A_SAR_8mm( + IN PDM_ODM_T pDM_Odm + ) +{ + u4Byte i = 0; + u4Byte ArrayLen = sizeof(Array_MP_8821A_TXPWR_LMT_8821A_SAR_8mm)/sizeof(pu1Byte); + pu1Byte *Array = Array_MP_8821A_TXPWR_LMT_8821A_SAR_8mm; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ReadAndConfig_MP_8821A_TXPWR_LMT_8821A_SAR_8mm\n")); + + for (i = 0; i < ArrayLen; i += 7 ) + { + pu1Byte regulation = Array[i]; + pu1Byte band = Array[i+1]; + pu1Byte bandwidth = Array[i+2]; + pu1Byte rate = Array[i+3]; + pu1Byte rfPath = Array[i+4]; + pu1Byte chnl = Array[i+5]; + pu1Byte val = Array[i+6]; + + odm_ConfigBB_TXPWR_LMT_8821A(pDM_Odm, regulation, band, bandwidth, rate, rfPath, chnl, val); + } + +} + +#endif // end of HWIMG_SUPPORT + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalHWImg8821A_RF.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalHWImg8821A_RF.h new file mode 100644 index 00000000000000..9d221a4d63c583 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalHWImg8821A_RF.h @@ -0,0 +1,138 @@ +/****************************************************************************** +* +* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of version 2 of the GNU General Public License as +* published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +* +* You should have received a copy of the GNU General Public License along with +* this program; if not, write to the Free Software Foundation, Inc., +* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA +* +* +******************************************************************************/ + +#if (RTL8821A_SUPPORT == 1) +#ifndef __INC_MP_RF_HW_IMG_8821A_H +#define __INC_MP_RF_HW_IMG_8821A_H + + +/****************************************************************************** +* RadioA.TXT +******************************************************************************/ + +void +ODM_ReadAndConfig_MP_8821A_RadioA( // TC: Test Chip, MP: MP Chip + IN PDM_ODM_T pDM_Odm +); +u4Byte ODM_GetVersion_MP_8821A_RadioA(void); + +/****************************************************************************** +* TxPowerTrack_AP.TXT +******************************************************************************/ + +void +ODM_ReadAndConfig_MP_8821A_TxPowerTrack_AP( // TC: Test Chip, MP: MP Chip + IN PDM_ODM_T pDM_Odm +); +u4Byte ODM_GetVersion_MP_8821A_TxPowerTrack_AP(void); + +/****************************************************************************** +* TxPowerTrack_PCIE.TXT +******************************************************************************/ + +void +ODM_ReadAndConfig_MP_8821A_TxPowerTrack_PCIE( // TC: Test Chip, MP: MP Chip + IN PDM_ODM_T pDM_Odm +); +u4Byte ODM_GetVersion_MP_8821A_TxPowerTrack_PCIE(void); + +/****************************************************************************** +* TxPowerTrack_SDIO.TXT +******************************************************************************/ + +void +ODM_ReadAndConfig_MP_8821A_TxPowerTrack_SDIO( // TC: Test Chip, MP: MP Chip + IN PDM_ODM_T pDM_Odm +); +u4Byte ODM_GetVersion_MP_8821A_TxPowerTrack_SDIO(void); + +/****************************************************************************** +* TxPowerTrack_USB.TXT +******************************************************************************/ + +void +ODM_ReadAndConfig_MP_8821A_TxPowerTrack_USB( // TC: Test Chip, MP: MP Chip + IN PDM_ODM_T pDM_Odm +); +u4Byte ODM_GetVersion_MP_8821A_TxPowerTrack_USB(void); + +/****************************************************************************** +* TXPWR_LMT_8811AU_FEM.TXT +******************************************************************************/ + +void +ODM_ReadAndConfig_MP_8821A_TXPWR_LMT_8811AU_FEM( // TC: Test Chip, MP: MP Chip + IN PDM_ODM_T pDM_Odm +); +u4Byte ODM_GetVersion_MP_8821A_TXPWR_LMT_8811AU_FEM(void); + +/****************************************************************************** +* TXPWR_LMT_8811AU_IPA.TXT +******************************************************************************/ + +void +ODM_ReadAndConfig_MP_8821A_TXPWR_LMT_8811AU_IPA( // TC: Test Chip, MP: MP Chip + IN PDM_ODM_T pDM_Odm +); +u4Byte ODM_GetVersion_MP_8821A_TXPWR_LMT_8811AU_IPA(void); + +/****************************************************************************** +* TXPWR_LMT_8821A.TXT +******************************************************************************/ + +void +ODM_ReadAndConfig_MP_8821A_TXPWR_LMT_8821A( // TC: Test Chip, MP: MP Chip + IN PDM_ODM_T pDM_Odm +); +u4Byte ODM_GetVersion_MP_8821A_TXPWR_LMT_8821A(void); + +/****************************************************************************** +* TXPWR_LMT_8821A_SAR_13dBm.TXT +******************************************************************************/ + +void +ODM_ReadAndConfig_MP_8821A_TXPWR_LMT_8821A_SAR_13dBm( // TC: Test Chip, MP: MP Chip + IN PDM_ODM_T pDM_Odm +); +u4Byte ODM_GetVersion_MP_8821A_TXPWR_LMT_8821A_SAR_13dBm(void); + +/****************************************************************************** +* TXPWR_LMT_8821A_SAR_5mm.TXT +******************************************************************************/ + +void +ODM_ReadAndConfig_MP_8821A_TXPWR_LMT_8821A_SAR_5mm( // TC: Test Chip, MP: MP Chip + IN PDM_ODM_T pDM_Odm +); +u4Byte ODM_GetVersion_MP_8821A_TXPWR_LMT_8821A_SAR_5mm(void); + +/****************************************************************************** +* TXPWR_LMT_8821A_SAR_8mm.TXT +******************************************************************************/ + +void +ODM_ReadAndConfig_MP_8821A_TXPWR_LMT_8821A_SAR_8mm( // TC: Test Chip, MP: MP Chip + IN PDM_ODM_T pDM_Odm +); +u4Byte ODM_GetVersion_MP_8821A_TXPWR_LMT_8821A_SAR_8mm(void); + +#endif +#endif // end of HWIMG_SUPPORT + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalPhyRf_8821A.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalPhyRf_8821A.c new file mode 100644 index 00000000000000..0c2abd595cc751 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalPhyRf_8821A.c @@ -0,0 +1,289 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +#include "Mp_Precomp.h" +#include "../phydm_precomp.h" + + + +/*---------------------------Define Local Constant---------------------------*/ +// 2010/04/25 MH Define the max tx power tracking tx agc power. +#define ODM_TXPWRTRACK_MAX_IDX8821A 6 + +/*---------------------------Define Local Constant---------------------------*/ + + +//3 ============================================================ +//3 Tx Power Tracking +//3 ============================================================ + +VOID +ODM_TxPwrTrackSetPwr8821A( + PDM_ODM_T pDM_Odm, + PWRTRACK_METHOD Method, + u1Byte RFPath, + u1Byte ChannelMappedIndex + ) +{ + PADAPTER Adapter = pDM_Odm->Adapter; + PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter); + + u1Byte PwrTrackingLimit = 26; //+1.0dB + u1Byte TxRate = 0xFF; + u1Byte Final_OFDM_Swing_Index = 0; + u1Byte Final_CCK_Swing_Index = 0; + u1Byte i = 0; + u4Byte finalBbSwingIdx[1]; + + + if (pDM_Odm->mp_mode == TRUE) + { +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE )) + #if (DM_ODM_SUPPORT_TYPE & (ODM_WIN)) + PMPT_CONTEXT pMptCtx = &(Adapter->MptCtx); + #elif (DM_ODM_SUPPORT_TYPE & (ODM_CE)) + PMPT_CONTEXT pMptCtx = &(Adapter->mppriv.MptCtx); + #endif + TxRate = MptToMgntRate(pMptCtx->MptRateIndex); +#endif + } + else + { + u2Byte rate = *(pDM_Odm->pForcedDataRate); + + if(!rate) //auto rate + { + if(pDM_Odm->TxRate != 0xFF) + #if (DM_ODM_SUPPORT_TYPE & (ODM_WIN)) + TxRate = Adapter->HalFunc.GetHwRateFromMRateHandler(pDM_Odm->TxRate); + #elif (DM_ODM_SUPPORT_TYPE & (ODM_CE)) + TxRate = HwRateToMRate(pDM_Odm->TxRate); + #endif + } + else //force rate + { + TxRate = (u1Byte)rate; + } + } + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,("===>ODM_TxPwrTrackSetPwr8821A\n")); + + if(TxRate != 0xFF) + { + //2 CCK + if((TxRate >= MGN_1M)&&(TxRate <= MGN_11M)) + PwrTrackingLimit = 32; //+4dB + //2 OFDM + else if((TxRate >= MGN_6M)&&(TxRate <= MGN_48M)) + PwrTrackingLimit = 30; //+3dB + else if(TxRate == MGN_54M) + PwrTrackingLimit = 28; //+2dB + //2 HT + else if((TxRate >= MGN_MCS0)&&(TxRate <= MGN_MCS2)) //QPSK/BPSK + PwrTrackingLimit = 34; //+5dB + else if((TxRate >= MGN_MCS3)&&(TxRate <= MGN_MCS4)) //16QAM + PwrTrackingLimit = 30; //+3dB + else if((TxRate >= MGN_MCS5)&&(TxRate <= MGN_MCS7)) //64QAM + PwrTrackingLimit = 28; //+2dB + + //2 VHT + else if((TxRate >= MGN_VHT1SS_MCS0)&&(TxRate <= MGN_VHT1SS_MCS2)) //QPSK/BPSK + PwrTrackingLimit = 34; //+5dB + else if((TxRate >= MGN_VHT1SS_MCS3)&&(TxRate <= MGN_VHT1SS_MCS4)) //16QAM + PwrTrackingLimit = 30; //+3dB + else if((TxRate >= MGN_VHT1SS_MCS5)&&(TxRate <= MGN_VHT1SS_MCS6)) //64QAM + PwrTrackingLimit = 28; //+2dB + else if(TxRate == MGN_VHT1SS_MCS7) //64QAM + PwrTrackingLimit = 26; //+1dB + else if(TxRate == MGN_VHT1SS_MCS8) //256QAM + PwrTrackingLimit = 24; //+0dB + else if(TxRate == MGN_VHT1SS_MCS9) //256QAM + PwrTrackingLimit = 22; //-1dB + + else + PwrTrackingLimit = 24; + } + ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,("TxRate=0x%x, PwrTrackingLimit=%d\n", TxRate, PwrTrackingLimit)); + + if (Method == BBSWING) + { + if (RFPath == ODM_RF_PATH_A) + { + finalBbSwingIdx[ODM_RF_PATH_A] = (pDM_Odm->RFCalibrateInfo.OFDM_index[ODM_RF_PATH_A] > PwrTrackingLimit) ? PwrTrackingLimit : pDM_Odm->RFCalibrateInfo.OFDM_index[ODM_RF_PATH_A]; + ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,("pDM_Odm->RFCalibrateInfo.OFDM_index[ODM_RF_PATH_A]=%d, pDM_Odm->RealBbSwingIdx[ODM_RF_PATH_A]=%d\n", + pDM_Odm->RFCalibrateInfo.OFDM_index[ODM_RF_PATH_A], finalBbSwingIdx[ODM_RF_PATH_A])); + + ODM_SetBBReg(pDM_Odm, rA_TxScale_Jaguar, 0xFFE00000, TxScalingTable_Jaguar[finalBbSwingIdx[ODM_RF_PATH_A]]); + } + } + else if (Method == MIX_MODE) + { + ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,("pDM_Odm->DefaultOfdmIndex=%d, pDM_Odm->Absolute_OFDMSwingIdx[RFPath]=%d, RF_Path = %d\n", + pDM_Odm->DefaultOfdmIndex, pDM_Odm->Absolute_OFDMSwingIdx[RFPath],RFPath )); + + Final_CCK_Swing_Index = pDM_Odm->DefaultCckIndex + pDM_Odm->Absolute_OFDMSwingIdx[RFPath]; + Final_OFDM_Swing_Index = pDM_Odm->DefaultOfdmIndex + pDM_Odm->Absolute_OFDMSwingIdx[RFPath]; + + if (RFPath == ODM_RF_PATH_A) + { + if(Final_OFDM_Swing_Index > PwrTrackingLimit) //BBSwing higher then Limit + { + pDM_Odm->Remnant_CCKSwingIdx= Final_CCK_Swing_Index - PwrTrackingLimit; + pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = Final_OFDM_Swing_Index - PwrTrackingLimit; + + ODM_SetBBReg(pDM_Odm, rA_TxScale_Jaguar, 0xFFE00000, TxScalingTable_Jaguar[PwrTrackingLimit]); + + pDM_Odm->Modify_TxAGC_Flag_PathA= TRUE; + + PHY_SetTxPowerLevelByPath(Adapter, pHalData->CurrentChannel, ODM_RF_PATH_A); + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,("******Path_A Over BBSwing Limit , PwrTrackingLimit = %d , Remnant TxAGC Value = %d \n", PwrTrackingLimit, pDM_Odm->Remnant_OFDMSwingIdx[RFPath])); + } + else if (Final_OFDM_Swing_Index <= 0) + { + pDM_Odm->Remnant_CCKSwingIdx= Final_CCK_Swing_Index; + pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = Final_OFDM_Swing_Index; + + ODM_SetBBReg(pDM_Odm, rA_TxScale_Jaguar, 0xFFE00000, TxScalingTable_Jaguar[0]); + + pDM_Odm->Modify_TxAGC_Flag_PathA= TRUE; + + PHY_SetTxPowerLevelByPath(Adapter, pHalData->CurrentChannel, ODM_RF_PATH_A); + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,("******Path_A Lower then BBSwing lower bound 0 , Remnant TxAGC Value = %d \n", pDM_Odm->Remnant_OFDMSwingIdx[RFPath])); + } + else + { + ODM_SetBBReg(pDM_Odm, rA_TxScale_Jaguar, 0xFFE00000, TxScalingTable_Jaguar[Final_OFDM_Swing_Index]); + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,("******Path_A Compensate with BBSwing , Final_OFDM_Swing_Index = %d \n", Final_OFDM_Swing_Index)); + + if(pDM_Odm->Modify_TxAGC_Flag_PathA) //If TxAGC has changed, reset TxAGC again + { + pDM_Odm->Remnant_CCKSwingIdx= 0; + pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = 0; + + PHY_SetTxPowerLevelByPath(Adapter, pHalData->CurrentChannel, ODM_RF_PATH_A); + + pDM_Odm->Modify_TxAGC_Flag_PathA= FALSE; + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,("******Path_A pDM_Odm->Modify_TxAGC_Flag = FALSE \n")); + } + } + } + } + else + { + return; + } +} // odm_TxPwrTrackSetPwr88E + +VOID +GetDeltaSwingTable_8821A( + IN PDM_ODM_T pDM_Odm, + OUT pu1Byte *TemperatureUP_A, + OUT pu1Byte *TemperatureDOWN_A, + OUT pu1Byte *TemperatureUP_B, + OUT pu1Byte *TemperatureDOWN_B + ) +{ + PADAPTER Adapter = pDM_Odm->Adapter; + PODM_RF_CAL_T pRFCalibrateInfo = &(pDM_Odm->RFCalibrateInfo); + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + u2Byte rate = *(pDM_Odm->pForcedDataRate); + u1Byte channel = pHalData->CurrentChannel; + + + if ( 1 <= channel && channel <= 14) { + if (IS_CCK_RATE(rate)) { + *TemperatureUP_A = pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKA_P; + *TemperatureDOWN_A = pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKA_N; + *TemperatureUP_B = pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKB_P; + *TemperatureDOWN_B = pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKB_N; + } else { + *TemperatureUP_A = pRFCalibrateInfo->DeltaSwingTableIdx_2GA_P; + *TemperatureDOWN_A = pRFCalibrateInfo->DeltaSwingTableIdx_2GA_N; + *TemperatureUP_B = pRFCalibrateInfo->DeltaSwingTableIdx_2GB_P; + *TemperatureDOWN_B = pRFCalibrateInfo->DeltaSwingTableIdx_2GB_N; + } + } else if ( 36 <= channel && channel <= 64) { + *TemperatureUP_A = pRFCalibrateInfo->DeltaSwingTableIdx_5GA_P[0]; + *TemperatureDOWN_A = pRFCalibrateInfo->DeltaSwingTableIdx_5GA_N[0]; + *TemperatureUP_B = pRFCalibrateInfo->DeltaSwingTableIdx_5GB_P[0]; + *TemperatureDOWN_B = pRFCalibrateInfo->DeltaSwingTableIdx_5GB_N[0]; + } else if ( 100 <= channel && channel <= 140) { + *TemperatureUP_A = pRFCalibrateInfo->DeltaSwingTableIdx_5GA_P[1]; + *TemperatureDOWN_A = pRFCalibrateInfo->DeltaSwingTableIdx_5GA_N[1]; + *TemperatureUP_B = pRFCalibrateInfo->DeltaSwingTableIdx_5GB_P[1]; + *TemperatureDOWN_B = pRFCalibrateInfo->DeltaSwingTableIdx_5GB_N[1]; + } else if ( 149 <= channel && channel <= 173) { + *TemperatureUP_A = pRFCalibrateInfo->DeltaSwingTableIdx_5GA_P[2]; + *TemperatureDOWN_A = pRFCalibrateInfo->DeltaSwingTableIdx_5GA_N[2]; + *TemperatureUP_B = pRFCalibrateInfo->DeltaSwingTableIdx_5GB_P[2]; + *TemperatureDOWN_B = pRFCalibrateInfo->DeltaSwingTableIdx_5GB_N[2]; + } else { + *TemperatureUP_A = (pu1Byte)DeltaSwingTableIdx_2GA_P_8188E; + *TemperatureDOWN_A = (pu1Byte)DeltaSwingTableIdx_2GA_N_8188E; + *TemperatureUP_B = (pu1Byte)DeltaSwingTableIdx_2GA_P_8188E; + *TemperatureDOWN_B = (pu1Byte)DeltaSwingTableIdx_2GA_N_8188E; + } + + return; +} + +void ConfigureTxpowerTrack_8821A( + PTXPWRTRACK_CFG pConfig + ) +{ + pConfig->SwingTableSize_CCK = TXSCALE_TABLE_SIZE; + pConfig->SwingTableSize_OFDM = TXSCALE_TABLE_SIZE; + pConfig->Threshold_IQK = IQK_THRESHOLD; + pConfig->AverageThermalNum = AVG_THERMAL_NUM_8812A; + pConfig->RfPathCount = MAX_PATH_NUM_8821A; + pConfig->ThermalRegAddr = RF_T_METER_8812A; + + pConfig->ODM_TxPwrTrackSetPwr = ODM_TxPwrTrackSetPwr8821A; + pConfig->DoIQK = DoIQK_8821A; + pConfig->PHY_LCCalibrate = PHY_LCCalibrate_8821A; + pConfig->GetDeltaSwingTable = GetDeltaSwingTable_8821A; +} + +#define DP_BB_REG_NUM 7 +#define DP_RF_REG_NUM 1 +#define DP_RETRY_LIMIT 10 +#define DP_PATH_NUM 2 +#define DP_DPK_NUM 3 +#define DP_DPK_VALUE_NUM 2 + +VOID +PHY_LCCalibrate_8821A( + IN PDM_ODM_T pDM_Odm + ) +{ + u8Byte StartTime; + u8Byte ProgressingTime; + + StartTime = ODM_GetCurrentTime( pDM_Odm); + PHY_LCCalibrate_8812A(pDM_Odm); + ProgressingTime = ODM_GetProgressingTime( pDM_Odm, StartTime); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("LCK ProgressingTime = %lld\n", ProgressingTime)); +} + + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalPhyRf_8821A.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalPhyRf_8821A.h new file mode 100644 index 00000000000000..5063c466643630 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/HalPhyRf_8821A.h @@ -0,0 +1,52 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +#ifndef __HAL_PHY_RF_8821A_H__ +#define __HAL_PHY_RF_8821A_H__ + +/*--------------------------Define Parameters-------------------------------*/ + +void ConfigureTxpowerTrack_8821A( + PTXPWRTRACK_CFG pConfig + ); + +VOID +ODM_TxPwrTrackSetPwr8821A( + PDM_ODM_T pDM_Odm, + PWRTRACK_METHOD Method, + u1Byte RFPath, + u1Byte ChannelMappedIndex + ); + +VOID +PHY_LCCalibrate_8821A( + IN PDM_ODM_T pDM_Odm +); + +VOID +GetDeltaSwingTable_8821A( + IN PDM_ODM_T pDM_Odm, + OUT pu1Byte *TemperatureUP_A, + OUT pu1Byte *TemperatureDOWN_A, + OUT pu1Byte *TemperatureUP_B, + OUT pu1Byte *TemperatureDOWN_B +); +#endif // #ifndef __HAL_PHY_RF_8821A_H__ + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/Mp_Precomp.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/Mp_Precomp.h new file mode 100644 index 00000000000000..43ea006e752ba5 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/Mp_Precomp.h @@ -0,0 +1,24 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +//#include +//#include "phydm_precomp.h" +//#include "../phydm_precomp.h" + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/PhyDM_IQK_8821A.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/PhyDM_IQK_8821A.c new file mode 100644 index 00000000000000..f4ceb9a513d18c --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/PhyDM_IQK_8821A.c @@ -0,0 +1,875 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +#include "Mp_Precomp.h" +#include "../phydm_precomp.h" + + + +/*---------------------------Define Local Constant---------------------------*/ +#define cal_num_8821A 3 +#define MACBB_REG_NUM_8821A 8 +#define AFE_REG_NUM_8821A 4 +#define RF_REG_NUM_8821A 3 +/*---------------------------Define Local Constant---------------------------*/ +#if !(DM_ODM_SUPPORT_TYPE & ODM_AP) +void DoIQK_8821A( + PDM_ODM_T pDM_Odm, + u1Byte DeltaThermalIndex, + u1Byte ThermalValue, + u1Byte Threshold + ) +{ + pDM_Odm->RFCalibrateInfo.ThermalValue_IQK= ThermalValue; + PHY_IQCalibrate_8821A(pDM_Odm, FALSE); +} +#endif +void _IQK_RX_FillIQC_8821A( + IN PDM_ODM_T pDM_Odm, + IN ODM_RF_RADIO_PATH_E Path, + IN unsigned int RX_X, + IN unsigned int RX_Y + ) +{ + switch (Path) { + case ODM_RF_PATH_A: + { + ODM_SetBBReg(pDM_Odm, 0x82c, BIT(31), 0x0); // [31] = 0 --> Page C + ODM_SetBBReg(pDM_Odm, 0xc10, 0x000003ff, RX_X>>1); + ODM_SetBBReg(pDM_Odm, 0xc10, 0x03ff0000, (RX_Y>>1) & 0x000003ff); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("RX_X = %x;;RX_Y = %x ====>fill to IQC\n", RX_X>>1, RX_Y>>1)); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xc10 = %x ====>fill to IQC\n", ODM_Read4Byte(pDM_Odm, 0xc10))); + } + break; + default: + break; + }; +} + +void _IQK_TX_FillIQC_8821A( + IN PDM_ODM_T pDM_Odm, + IN ODM_RF_RADIO_PATH_E Path, + IN unsigned int TX_X, + IN unsigned int TX_Y + ) +{ + switch (Path) { + case ODM_RF_PATH_A: + { + ODM_SetBBReg(pDM_Odm, 0x82c, BIT(31), 0x1); // [31] = 1 --> Page C1 + ODM_Write4Byte(pDM_Odm, 0xc90, 0x00000080); + ODM_Write4Byte(pDM_Odm, 0xcc4, 0x20040000); + ODM_Write4Byte(pDM_Odm, 0xcc8, 0x20000000); + ODM_SetBBReg(pDM_Odm, 0xccc, 0x000007ff, TX_Y); + ODM_SetBBReg(pDM_Odm, 0xcd4, 0x000007ff, TX_X); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("TX_X = %x;;TX_Y = %x =====> fill to IQC\n", TX_X, TX_Y)); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xcd4 = %x;;0xccc = %x ====>fill to IQC\n", ODM_GetBBReg(pDM_Odm, 0xcd4, 0x000007ff), ODM_GetBBReg(pDM_Odm, 0xccc, 0x000007ff))); + } + break; + default: + break; + }; +} + +void _IQK_BackupMacBB_8821A( + IN PDM_ODM_T pDM_Odm, + IN pu4Byte MACBB_backup, + IN pu4Byte Backup_MACBB_REG, + IN u4Byte MACBB_NUM + ) +{ + u4Byte i; + ODM_SetBBReg(pDM_Odm, 0x82c, BIT(31), 0x0); // [31] = 0 --> Page C + //save MACBB default value + for (i = 0; i < MACBB_NUM; i++){ + MACBB_backup[i] = ODM_Read4Byte(pDM_Odm, Backup_MACBB_REG[i]); + } + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("BackupMacBB Success!!!!\n")); +} + +void _IQK_BackupRF_8821A( + IN PDM_ODM_T pDM_Odm, + IN pu4Byte RFA_backup, + IN pu4Byte RFB_backup, + IN pu4Byte Backup_RF_REG, + IN u4Byte RF_NUM + ) +{ + + u4Byte i; + ODM_SetBBReg(pDM_Odm, 0x82c, BIT(31), 0x0); // [31] = 0 --> Page C + //Save RF Parameters + for (i = 0; i < RF_NUM; i++){ + RFA_backup[i] = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_A, Backup_RF_REG[i], bMaskDWord); + } + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("BackupRF Success!!!!\n")); +} + +void _IQK_BackupAFE_8821A( + IN PDM_ODM_T pDM_Odm, + IN pu4Byte AFE_backup, + IN pu4Byte Backup_AFE_REG, + IN u4Byte AFE_NUM + ) +{ + u4Byte i; + ODM_SetBBReg(pDM_Odm, 0x82c, BIT(31), 0x0); // [31] = 0 --> Page C + //Save AFE Parameters + for (i = 0; i < AFE_NUM; i++){ + AFE_backup[i] = ODM_Read4Byte(pDM_Odm, Backup_AFE_REG[i]); + } + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("BackupAFE Success!!!!\n")); +} + +void _IQK_RestoreMacBB_8821A( + IN PDM_ODM_T pDM_Odm, + IN pu4Byte MACBB_backup, + IN pu4Byte Backup_MACBB_REG, + IN u4Byte MACBB_NUM + ) +{ + u4Byte i; + ODM_SetBBReg(pDM_Odm, 0x82c, BIT(31), 0x0); // [31] = 0 --> Page C + //Reload MacBB Parameters + for (i = 0; i < MACBB_NUM; i++){ + ODM_Write4Byte(pDM_Odm, Backup_MACBB_REG[i], MACBB_backup[i]); + } + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("RestoreMacBB Success!!!!\n")); +} + +void _IQK_RestoreRF_8821A( + IN PDM_ODM_T pDM_Odm, + IN ODM_RF_RADIO_PATH_E Path, + IN pu4Byte Backup_RF_REG, + IN pu4Byte RF_backup, + IN u4Byte RF_REG_NUM + ) +{ + u4Byte i; + + ODM_SetBBReg(pDM_Odm, 0x82c, BIT(31), 0x0); // [31] = 0 --> Page C + for (i = 0; i < RF_REG_NUM; i++) + ODM_SetRFReg(pDM_Odm, Path, Backup_RF_REG[i], bRFRegOffsetMask, RF_backup[i]); + + switch(Path){ + case ODM_RF_PATH_A: + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("RestoreRF Path A Success!!!!\n")); + } + break; + default: + break; + } +} + +void _IQK_RestoreAFE_8821A( + IN PDM_ODM_T pDM_Odm, + IN pu4Byte AFE_backup, + IN pu4Byte Backup_AFE_REG, + IN u4Byte AFE_NUM + ) +{ + u4Byte i; + ODM_SetBBReg(pDM_Odm, 0x82c, BIT(31), 0x0); // [31] = 0 --> Page C + //Reload AFE Parameters + for (i = 0; i < AFE_NUM; i++){ + ODM_Write4Byte(pDM_Odm, Backup_AFE_REG[i], AFE_backup[i]); + } + ODM_SetBBReg(pDM_Odm, 0x82c, BIT(31), 0x1); // [31] = 1 --> Page C1 + ODM_Write4Byte(pDM_Odm, 0xc80, 0x0); + ODM_Write4Byte(pDM_Odm, 0xc84, 0x0); + ODM_Write4Byte(pDM_Odm, 0xc88, 0x0); + ODM_Write4Byte(pDM_Odm, 0xc8c, 0x3c000000); + ODM_Write4Byte(pDM_Odm, 0xc90, 0x00000080); + ODM_Write4Byte(pDM_Odm, 0xc94, 0x00000000); + ODM_Write4Byte(pDM_Odm, 0xcc4, 0x20040000); + ODM_Write4Byte(pDM_Odm, 0xcc8, 0x20000000); + ODM_Write4Byte(pDM_Odm, 0xcb8, 0x0); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("RestoreAFE Success!!!!\n")); +} + +void _IQK_ConfigureMAC_8821A( + IN PDM_ODM_T pDM_Odm + ) +{ + // ========MAC register setting======== + ODM_SetBBReg(pDM_Odm, 0x82c, BIT(31), 0x0); // [31] = 0 --> Page C + ODM_Write1Byte(pDM_Odm, 0x522, 0x3f); + ODM_SetBBReg(pDM_Odm, 0x550, BIT(11)|BIT(3), 0x0); + ODM_Write1Byte(pDM_Odm, 0x808, 0x00); // RX ante off + ODM_SetBBReg(pDM_Odm, 0x838, 0xf, 0xc); // CCA off + ODM_Write1Byte(pDM_Odm, 0xa07, 0xf); // CCK RX Path off +} + +void _IQK_Tx_8821A( + IN PDM_ODM_T pDM_Odm, + IN ODM_RF_RADIO_PATH_E Path + ) +{ + u4Byte TX_fail, RX_fail, delay_count, IQK_ready, cal_retry, cal = 0; + int TX_X = 0, TX_Y = 0, RX_X = 0, RX_Y = 0, TX_Average = 0, RX_Average = 0, RXIQK_Loop = 0, RX_X_temp = 0, RX_Y_temp = 0; + int TX_X0[cal_num_8821A], TX_Y0[cal_num_8821A], RX_X0[2][cal_num_8821A], RX_Y0[2][cal_num_8821A]; + BOOLEAN TX0IQKOK = FALSE, RX0IQKOK = FALSE; + BOOLEAN VDF_enable = FALSE; + int i, k, VDF_Y[3], VDF_X[3], Tx_dt[3], ii, dx = 0, dy = 0, TX_finish = 0, RX_finish1 = 0, RX_finish2 = 0; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("BandWidth = %d, SupportInterface = %d, ExtPA = %d, ExtPA5G = %d\n", *pDM_Odm->pBandWidth, pDM_Odm->SupportInterface, pDM_Odm->ExtPA, pDM_Odm->ExtPA5G)); + if (*pDM_Odm->pBandWidth == 2){ + VDF_enable = TRUE; + } + + while (cal < cal_num_8821A){ + switch (Path) { + case ODM_RF_PATH_A: + { + //Path-A LOK + ODM_SetBBReg(pDM_Odm, 0x82c, BIT(31), 0x0); // [31] = 0 --> Page C + // ========Path-A AFE all on======== + // Port 0 DAC/ADC on + ODM_Write4Byte(pDM_Odm, 0xc60, 0x77777777); + ODM_Write4Byte(pDM_Odm, 0xc64, 0x77777777); + + ODM_Write4Byte(pDM_Odm, 0xc68, 0x19791979); + + ODM_SetBBReg(pDM_Odm, 0xc00, 0xf, 0x4);// hardware 3-wire off + + // LOK Setting + //====== LOK ====== + // 1. DAC/ADC sampling rate (160 MHz) + ODM_SetBBReg(pDM_Odm, 0xc5c, BIT(26)|BIT(25)|BIT(24), 0x7); + + // 2. LoK RF Setting (at BW = 20M) + ODM_SetRFReg(pDM_Odm, Path, 0xef, bRFRegOffsetMask, 0x80002); + ODM_SetRFReg(pDM_Odm, Path, 0x18, 0x00c00, 0x3); // BW 20M + ODM_SetRFReg(pDM_Odm, Path, 0x30, bRFRegOffsetMask, 0x20000); + ODM_SetRFReg(pDM_Odm, Path, 0x31, bRFRegOffsetMask, 0x0003f); + ODM_SetRFReg(pDM_Odm, Path, 0x32, bRFRegOffsetMask, 0xf3fc3); + ODM_SetRFReg(pDM_Odm, Path, 0x65, bRFRegOffsetMask, 0x931d5); + ODM_SetRFReg(pDM_Odm, Path, 0x8f, bRFRegOffsetMask, 0x8a001); + ODM_Write4Byte(pDM_Odm, 0x90c, 0x00008000); + ODM_SetBBReg(pDM_Odm, 0xc94, BIT(0), 0x1); + ODM_Write4Byte(pDM_Odm, 0x978, 0x29002000);// TX (X,Y) + ODM_Write4Byte(pDM_Odm, 0x97c, 0xa9002000);// RX (X,Y) + ODM_Write4Byte(pDM_Odm, 0x984, 0x00462910);// [0]:AGC_en, [15]:idac_K_Mask + + ODM_SetBBReg(pDM_Odm, 0x82c, BIT(31), 0x1); // [31] = 1 --> Page C1 + + if (pDM_Odm->ExtPA5G) + ODM_Write4Byte(pDM_Odm, 0xc88, 0x821403f7); + else + ODM_Write4Byte(pDM_Odm, 0xc88, 0x821403f4); + + if (*pDM_Odm->pBandType) + ODM_Write4Byte(pDM_Odm, 0xc8c, 0x68163e96); + else + ODM_Write4Byte(pDM_Odm, 0xc8c, 0x28163e96); + + ODM_Write4Byte(pDM_Odm, 0xc80, 0x18008c10);// TX_Tone_idx[9:0], TxK_Mask[29] TX_Tone = 16 + ODM_Write4Byte(pDM_Odm, 0xc84, 0x38008c10);// RX_Tone_idx[9:0], RxK_Mask[29] + ODM_Write4Byte(pDM_Odm, 0xcb8, 0x00100000);// cb8[20] N SI/PI ϥv iqk_dpk module + ODM_Write4Byte(pDM_Odm, 0x980, 0xfa000000); + ODM_Write4Byte(pDM_Odm, 0x980, 0xf8000000); + + ODM_delay_ms(10); //Delay 10ms + ODM_Write4Byte(pDM_Odm, 0xcb8, 0x00000000); + + ODM_SetBBReg(pDM_Odm, 0x82c, BIT(31), 0x0); // [31] = 0 --> Page C + ODM_SetRFReg(pDM_Odm, Path, 0x58, 0x7fe00, ODM_GetRFReg(pDM_Odm, Path, 0x8, 0xffc00)); // Load LOK + switch (*pDM_Odm->pBandWidth) + { + case 1: + { + ODM_SetRFReg(pDM_Odm, Path, 0x18, 0x00c00, 0x1); + } + break; + case 2: + { + ODM_SetRFReg(pDM_Odm, Path, 0x18, 0x00c00, 0x0); + } + break; + default: + break; + } + ODM_SetBBReg(pDM_Odm, 0x82c, BIT(31), 0x1); // [31] = 1 --> Page C1 + + // 3. TX RF Setting + ODM_SetBBReg(pDM_Odm, 0x82c, BIT(31), 0x0); // [31] = 0 --> Page C + ODM_SetRFReg(pDM_Odm, Path, 0xef, bRFRegOffsetMask, 0x80000); + ODM_SetRFReg(pDM_Odm, Path, 0x30, bRFRegOffsetMask, 0x20000); + ODM_SetRFReg(pDM_Odm, Path, 0x31, bRFRegOffsetMask, 0x0003f); + ODM_SetRFReg(pDM_Odm, Path, 0x32, bRFRegOffsetMask, 0xf3fc3); + ODM_SetRFReg(pDM_Odm, Path, 0x65, bRFRegOffsetMask, 0x931d5); + ODM_SetRFReg(pDM_Odm, Path, 0x8f, bRFRegOffsetMask, 0x8a001); + ODM_SetRFReg(pDM_Odm, Path, 0xef, bRFRegOffsetMask, 0x00000); + ODM_Write4Byte(pDM_Odm, 0x90c, 0x00008000); + ODM_SetBBReg(pDM_Odm, 0xc94, BIT(0), 0x1); + ODM_Write4Byte(pDM_Odm, 0x978, 0x29002000);// TX (X,Y) + ODM_Write4Byte(pDM_Odm, 0x97c, 0xa9002000);// RX (X,Y) + ODM_Write4Byte(pDM_Odm, 0x984, 0x0046a910);// [0]:AGC_en, [15]:idac_K_Mask + + ODM_SetBBReg(pDM_Odm, 0x82c, BIT(31), 0x1); // [31] = 1 --> Page C1 + + if (pDM_Odm->ExtPA5G) + ODM_Write4Byte(pDM_Odm, 0xc88, 0x821403f7); + else + ODM_Write4Byte(pDM_Odm, 0xc88, 0x821403e3); + + if (*pDM_Odm->pBandType) + ODM_Write4Byte(pDM_Odm, 0xc8c, 0x40163e96); + else + ODM_Write4Byte(pDM_Odm, 0xc8c, 0x00163e96); + + if (VDF_enable == 1){ + for (k = 0;k <= 2; k++){ + switch (k){ + case 0: + { + ODM_Write4Byte(pDM_Odm, 0xc80, 0x18008c38);// TX_Tone_idx[9:0], TxK_Mask[29] TX_Tone = 16 + ODM_Write4Byte(pDM_Odm, 0xc84, 0x38008c38);// RX_Tone_idx[9:0], RxK_Mask[29] + ODM_SetBBReg(pDM_Odm, 0xce8, BIT(31), 0x0); + } + break; + case 1: + { + ODM_SetBBReg(pDM_Odm, 0xc80, BIT(28), 0x0); + ODM_SetBBReg(pDM_Odm, 0xc84, BIT(28), 0x0); + ODM_SetBBReg(pDM_Odm, 0xce8, BIT(31), 0x0); + } + break; + case 2: + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("VDF_Y[1] = %x;;;VDF_Y[0] = %x\n", VDF_Y[1]>>21 & 0x00007ff, VDF_Y[0]>>21 & 0x00007ff)); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("VDF_X[1] = %x;;;VDF_X[0] = %x\n", VDF_X[1]>>21 & 0x00007ff, VDF_X[0]>>21 & 0x00007ff)); + Tx_dt[cal] = (VDF_Y[1]>>20)-(VDF_Y[0]>>20); + Tx_dt[cal] = ((16*Tx_dt[cal])*10000/15708); + Tx_dt[cal] = (Tx_dt[cal] >> 1 )+(Tx_dt[cal] & BIT(0)); + ODM_Write4Byte(pDM_Odm, 0xc80, 0x18008c20);// TX_Tone_idx[9:0], TxK_Mask[29] TX_Tone = 16 + ODM_Write4Byte(pDM_Odm, 0xc84, 0x38008c20);// RX_Tone_idx[9:0], RxK_Mask[29] + ODM_SetBBReg(pDM_Odm, 0xce8, BIT(31), 0x1); + ODM_SetBBReg(pDM_Odm, 0xce8, 0x3fff0000, Tx_dt[cal] & 0x00003fff); + } + break; + } + ODM_Write4Byte(pDM_Odm, 0xcb8, 0x00100000);// cb8[20] N SI/PI ϥv iqk_dpk module + cal_retry = 0; + while(1){ + // one shot + ODM_Write4Byte(pDM_Odm, 0x980, 0xfa000000); + ODM_Write4Byte(pDM_Odm, 0x980, 0xf8000000); + + ODM_delay_ms(10); //Delay 10ms + ODM_Write4Byte(pDM_Odm, 0xcb8, 0x00000000); + delay_count = 0; + while (1){ + IQK_ready = ODM_GetBBReg(pDM_Odm, 0xd00, BIT(10)); + if ((~IQK_ready) || (delay_count>20)){ + break; + } + else{ + ODM_delay_ms(1); + delay_count++; + } + } + + if (delay_count < 20){ // If 20ms No Result, then cal_retry++ + // ============TXIQK Check============== + TX_fail = ODM_GetBBReg(pDM_Odm, 0xd00, BIT(12)); + + if (~TX_fail){ + ODM_Write4Byte(pDM_Odm, 0xcb8, 0x02000000); + VDF_X[k] = ODM_GetBBReg(pDM_Odm, 0xd00, 0x07ff0000)<<21; + ODM_Write4Byte(pDM_Odm, 0xcb8, 0x04000000); + VDF_Y[k] = ODM_GetBBReg(pDM_Odm, 0xd00, 0x07ff0000)<<21; + TX0IQKOK = TRUE; + break; + } + else{ + ODM_SetBBReg(pDM_Odm, 0xccc, 0x000007ff, 0x0); + ODM_SetBBReg(pDM_Odm, 0xcd4, 0x000007ff, 0x200); + TX0IQKOK = FALSE; + cal_retry++; + if (cal_retry == 10) { + break; + } + } + } + else{ + TX0IQKOK = FALSE; + cal_retry++; + if (cal_retry == 10){ + break; + } + } + } + } + if (k == 3){ + TX_X0[cal] = VDF_X[k-1] ; + TX_Y0[cal] = VDF_Y[k-1]; + } + } + else{ + ODM_Write4Byte(pDM_Odm, 0xc80, 0x18008c10);// TX_Tone_idx[9:0], TxK_Mask[29] TX_Tone = 16 + ODM_Write4Byte(pDM_Odm, 0xc84, 0x38008c10);// RX_Tone_idx[9:0], RxK_Mask[29] + ODM_Write4Byte(pDM_Odm, 0xcb8, 0x00100000);// cb8[20] N SI/PI ϥv iqk_dpk module + cal_retry = 0; + while(1){ + // one shot + ODM_Write4Byte(pDM_Odm, 0x980, 0xfa000000); + ODM_Write4Byte(pDM_Odm, 0x980, 0xf8000000); + + ODM_delay_ms(10); //Delay 10ms + ODM_Write4Byte(pDM_Odm, 0xcb8, 0x00000000); + delay_count = 0; + while (1){ + IQK_ready = ODM_GetBBReg(pDM_Odm, 0xd00, BIT(10)); + if ((~IQK_ready) || (delay_count>20)) { + break; + } + else{ + ODM_delay_ms(1); + delay_count++; + } + } + + if (delay_count < 20){ // If 20ms No Result, then cal_retry++ + // ============TXIQK Check============== + TX_fail = ODM_GetBBReg(pDM_Odm, 0xd00, BIT(12)); + + if (~TX_fail){ + ODM_Write4Byte(pDM_Odm, 0xcb8, 0x02000000); + TX_X0[cal] = ODM_GetBBReg(pDM_Odm, 0xd00, 0x07ff0000)<<21; + ODM_Write4Byte(pDM_Odm, 0xcb8, 0x04000000); + TX_Y0[cal] = ODM_GetBBReg(pDM_Odm, 0xd00, 0x07ff0000)<<21; + TX0IQKOK = TRUE; + break; + } + else{ + ODM_SetBBReg(pDM_Odm, 0xccc, 0x000007ff, 0x0); + ODM_SetBBReg(pDM_Odm, 0xcd4, 0x000007ff, 0x200); + TX0IQKOK = FALSE; + cal_retry++; + if (cal_retry == 10) { + break; + } + } + } + else{ + TX0IQKOK = FALSE; + cal_retry++; + if (cal_retry == 10) + break; + } + } + } + + if (TX0IQKOK == FALSE) + break; // TXK fail, Don't do RXK + + //====== RX IQK ====== + ODM_SetBBReg(pDM_Odm, 0x82c, BIT(31), 0x0); // [31] = 0 --> Page C + // 1. RX RF Setting + ODM_SetRFReg(pDM_Odm, Path, 0xef, bRFRegOffsetMask, 0x80000); + ODM_SetRFReg(pDM_Odm, Path, 0x30, bRFRegOffsetMask, 0x30000); + ODM_SetRFReg(pDM_Odm, Path, 0x31, bRFRegOffsetMask, 0x0002f); + ODM_SetRFReg(pDM_Odm, Path, 0x32, bRFRegOffsetMask, 0xfffbb); + ODM_SetRFReg(pDM_Odm, Path, 0x8f, bRFRegOffsetMask, 0x88001); + ODM_SetRFReg(pDM_Odm, Path, 0x65, bRFRegOffsetMask, 0x931d8); + ODM_SetRFReg(pDM_Odm, Path, 0xef, bRFRegOffsetMask, 0x00000); + + ODM_SetBBReg(pDM_Odm, 0x978, 0x03FF8000, (TX_X0[cal])>>21&0x000007ff); + ODM_SetBBReg(pDM_Odm, 0x978, 0x000007FF, (TX_Y0[cal])>>21&0x000007ff); + ODM_SetBBReg(pDM_Odm, 0x978, BIT(31), 0x1); + ODM_SetBBReg(pDM_Odm, 0x97c, BIT(31), 0x0); + ODM_Write4Byte(pDM_Odm, 0x90c, 0x00008000); + ODM_Write4Byte(pDM_Odm, 0x984, 0x0046a911); + + ODM_SetBBReg(pDM_Odm, 0x82c, BIT(31), 0x1); // [31] = 1 --> Page C1 + ODM_Write4Byte(pDM_Odm, 0xc80, 0x38008c10);// TX_Tone_idx[9:0], TxK_Mask[29] TX_Tone = 16 + ODM_Write4Byte(pDM_Odm, 0xc84, 0x18008c10);// RX_Tone_idx[9:0], RxK_Mask[29] + ODM_Write4Byte(pDM_Odm, 0xc88, 0x02140119); + + if (pDM_Odm->SupportInterface == 1){ + RXIQK_Loop = 2; // for 2% fail; + } + else{ + RXIQK_Loop = 1; + } + for(i = 0; i < RXIQK_Loop; i++){ + if (pDM_Odm->SupportInterface == 1) + if(i == 0) + ODM_Write4Byte(pDM_Odm, 0xc8c, 0x28161100); //Good + else + ODM_Write4Byte(pDM_Odm, 0xc8c, 0x28160d00); + else + ODM_Write4Byte(pDM_Odm, 0xc8c, 0x28160d00); + + ODM_Write4Byte(pDM_Odm, 0xcb8, 0x00100000);// cb8[20] N SI/PI ϥv iqk_dpk module + + cal_retry = 0; + while(1){ + // one shot + ODM_Write4Byte(pDM_Odm, 0x980, 0xfa000000); + ODM_Write4Byte(pDM_Odm, 0x980, 0xf8000000); + + ODM_delay_ms(10); //Delay 10ms + ODM_Write4Byte(pDM_Odm, 0xcb8, 0x00000000); + delay_count = 0; + while (1){ + IQK_ready = ODM_GetBBReg(pDM_Odm, 0xd00, BIT(10)); + if ((~IQK_ready)||(delay_count>20)){ + break; + } + else{ + ODM_delay_ms(1); + delay_count++; + } + } + + if (delay_count < 20){ // If 20ms No Result, then cal_retry++ + // ============RXIQK Check============== + RX_fail = ODM_GetBBReg(pDM_Odm, 0xd00, BIT(11)); + if (RX_fail == 0){ + /* + DbgPrint("====== RXIQK (%d) ======", i); + ODM_Write4Byte(pDM_Odm, 0xcb8, 0x05000000); + reg1 = ODM_GetBBReg(pDM_Odm, 0xd00, 0xffffffff); + ODM_Write4Byte(pDM_Odm, 0xcb8, 0x06000000); + reg2 = ODM_GetBBReg(pDM_Odm, 0xd00, 0x0000001f); + DbgPrint("reg1 = %d, reg2 = %d", reg1, reg2); + Image_Power = (reg2<<32)+reg1; + DbgPrint("Before PW = %d\n", Image_Power); + ODM_Write4Byte(pDM_Odm, 0xcb8, 0x07000000); + reg1 = ODM_GetBBReg(pDM_Odm, 0xd00, 0xffffffff); + ODM_Write4Byte(pDM_Odm, 0xcb8, 0x08000000); + reg2 = ODM_GetBBReg(pDM_Odm, 0xd00, 0x0000001f); + Image_Power = (reg2<<32)+reg1; + DbgPrint("After PW = %d\n", Image_Power); + */ + + ODM_Write4Byte(pDM_Odm, 0xcb8, 0x06000000); + RX_X0[i][cal] = ODM_GetBBReg(pDM_Odm, 0xd00, 0x07ff0000)<<21; + ODM_Write4Byte(pDM_Odm, 0xcb8, 0x08000000); + RX_Y0[i][cal] = ODM_GetBBReg(pDM_Odm, 0xd00, 0x07ff0000)<<21; + RX0IQKOK = TRUE; + break; + } + else{ + ODM_SetBBReg(pDM_Odm, 0xc10, 0x000003ff, 0x200>>1); + ODM_SetBBReg(pDM_Odm, 0xc10, 0x03ff0000, 0x0>>1); + RX0IQKOK = FALSE; + cal_retry++; + if (cal_retry == 10) + break; + + } + } + else{ + RX0IQKOK = FALSE; + cal_retry++; + if (cal_retry == 10) + break; + } + } + } + + if (TX0IQKOK) + TX_Average++; + if (RX0IQKOK) + RX_Average++; + } + break; + default: + break; + } + cal++; + } + // FillIQK Result + switch (Path){ + case ODM_RF_PATH_A: + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("========Path_A =======\n")); + if (TX_Average == 0) + break; + + for (i = 0; i < TX_Average; i++){ + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("TX_X0[%d] = %x ;; TX_Y0[%d] = %x\n", i, (TX_X0[i])>>21&0x000007ff, i, (TX_Y0[i])>>21&0x000007ff)); + } + for (i = 0; i < TX_Average; i++){ + for (ii = i+1; ii >21) - (TX_X0[ii]>>21); + if (dx < 3 && dx > -3){ + dy = (TX_Y0[i]>>21) - (TX_Y0[ii]>>21); + if (dy < 3 && dy > -3){ + TX_X = ((TX_X0[i]>>21) + (TX_X0[ii]>>21))/2; + TX_Y = ((TX_Y0[i]>>21) + (TX_Y0[ii]>>21))/2; + TX_finish = 1; + break; + } + } + } + if (TX_finish == 1) + break; + } + + if (TX_finish == 1){ + _IQK_TX_FillIQC_8821A(pDM_Odm, Path, TX_X, TX_Y); + } + else{ + _IQK_TX_FillIQC_8821A(pDM_Odm, Path, 0x200, 0x0); + } + + if (RX_Average == 0) + break; + + for (i = 0; i < RX_Average; i++){ + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("RX_X0[0][%d] = %x ;; RX_Y0[0][%d] = %x\n", i, (RX_X0[0][i])>>21&0x000007ff, i, (RX_Y0[0][i])>>21&0x000007ff)); + if (RXIQK_Loop == 2) + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("RX_X0[1][%d] = %x ;; RX_Y0[1][%d] = %x\n", i, (RX_X0[1][i])>>21&0x000007ff, i, (RX_Y0[1][i])>>21&0x000007ff)); + } + for (i = 0; i < RX_Average; i++){ + for (ii = i+1; ii >21) - (RX_X0[0][ii]>>21); + if (dx < 4 && dx > -4){ + dy = (RX_Y0[0][i]>>21) - (RX_Y0[0][ii]>>21); + if (dy < 4 && dy > -4){ + RX_X_temp = ((RX_X0[0][i]>>21) + (RX_X0[0][ii]>>21))/2; + RX_Y_temp = ((RX_Y0[0][i]>>21) + (RX_Y0[0][ii]>>21))/2; + RX_finish1 = 1; + break; + } + } + } + if (RX_finish1 == 1){ + RX_X = RX_X_temp; + RX_Y = RX_Y_temp; + break; + } + } + if(RXIQK_Loop == 2){ + for (i = 0; i < RX_Average; i++){ + for (ii = i+1; ii >21) - (RX_X0[1][ii]>>21); + if (dx < 4 && dx > -4){ + dy = (RX_Y0[1][i]>>21) - (RX_Y0[1][ii]>>21); + if (dy < 4 && dy > -4){ + RX_X = ((RX_X0[1][i]>>21) + (RX_X0[1][ii]>>21))/2; + RX_Y = ((RX_Y0[1][i]>>21) + (RX_Y0[1][ii]>>21))/2; + RX_finish2 = 1; + break; + } + } + } + if (RX_finish2 == 1) + break; + } + if(RX_finish1 && RX_finish2){ + RX_X = (RX_X+RX_X_temp)/2; + RX_Y = (RX_Y+RX_Y_temp)/2; + } + } + if (RX_finish1 || RX_finish2){ + _IQK_RX_FillIQC_8821A(pDM_Odm, Path, RX_X, RX_Y); + } + else{ + _IQK_RX_FillIQC_8821A(pDM_Odm, Path, 0x200, 0x0); + } + } + break; + default: + break; + } +} + +#if !(DM_ODM_SUPPORT_TYPE & ODM_AP) +VOID +phy_IQCalibrate_By_FW_8821A( + IN PDM_ODM_T pDM_Odm + ) +{ + + u1Byte IQKcmd[3] = {*pDM_Odm->pChannel, 0x0, 0x0}; + u1Byte Buf1 = 0x0; + u1Byte Buf2 = 0x0; + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("pChannel: %d \n", *pDM_Odm->pChannel)); + + +//Byte 2, Bit 4 ~ Bit 5 : BandType + if(*pDM_Odm->pBandType) + Buf1 = 0x2<<4; + else + Buf1 = 0x1<<4; + +//Byte 2, Bit 0 ~ Bit 3 : Bandwidth + if(*pDM_Odm->pBandWidth == ODM_BW20M) + Buf2 = 0x1; + else if(*pDM_Odm->pBandWidth == ODM_BW40M) + Buf2 = 0x1<<1; + else if(*pDM_Odm->pBandWidth == ODM_BW80M) + Buf2 = 0x1<<2; + else + Buf2 = 0x1<<3; + + IQKcmd[1] = Buf1 | Buf2; + IQKcmd[2] = pDM_Odm->ExtPA5G | pDM_Odm->ExtLNA5G<<1; + + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("== FW IQK Start ==\n")); + pDM_Odm->RFCalibrateInfo.IQK_StartTime = 0; + pDM_Odm->RFCalibrateInfo.IQK_StartTime = ODM_GetCurrentTime( pDM_Odm); + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("== StartTime: %lld\n", pDM_Odm->RFCalibrateInfo.IQK_StartTime)); + ODM_FillH2CCmd(pDM_Odm, ODM_H2C_IQ_CALIBRATION, 3, IQKcmd); + + +} +#endif + +VOID +phy_IQCalibrate_8821A( + IN PDM_ODM_T pDM_Odm + ) +{ + u4Byte MACBB_backup[MACBB_REG_NUM_8821A], AFE_backup[AFE_REG_NUM_8821A], RFA_backup[RF_REG_NUM_8821A], RFB_backup[RF_REG_NUM_8821A]; + u4Byte Backup_MACBB_REG[MACBB_REG_NUM_8821A] = {0x520, 0x550, 0x808, 0xa04, 0x90c, 0xc00, 0x838, 0x82c}; + u4Byte Backup_AFE_REG[AFE_REG_NUM_8821A] = {0xc5c, 0xc60, 0xc64, 0xc68}; + u4Byte Backup_RF_REG[RF_REG_NUM_8821A] = {0x65, 0x8f, 0x0}; + + _IQK_BackupMacBB_8821A(pDM_Odm, MACBB_backup, Backup_MACBB_REG, MACBB_REG_NUM_8821A); + _IQK_BackupAFE_8821A(pDM_Odm, AFE_backup, Backup_AFE_REG, AFE_REG_NUM_8821A); + _IQK_BackupRF_8821A(pDM_Odm, RFA_backup, RFB_backup, Backup_RF_REG, RF_REG_NUM_8821A); + + _IQK_ConfigureMAC_8821A(pDM_Odm); + _IQK_Tx_8821A(pDM_Odm, ODM_RF_PATH_A); + + _IQK_RestoreRF_8821A(pDM_Odm, ODM_RF_PATH_A, Backup_RF_REG, RFA_backup, RF_REG_NUM_8821A); + _IQK_RestoreAFE_8821A(pDM_Odm, AFE_backup, Backup_AFE_REG, AFE_REG_NUM_8821A); + _IQK_RestoreMacBB_8821A(pDM_Odm, MACBB_backup, Backup_MACBB_REG, MACBB_REG_NUM_8821A); +} + +VOID +PHY_ResetIQKResult_8821A( + IN PDM_ODM_T pDM_Odm +) +{ + ODM_SetBBReg(pDM_Odm, 0x82c, BIT(31), 0x1); // [31] = 1 --> Page C1 + ODM_SetBBReg(pDM_Odm, 0xccc, 0x000007ff, 0x0); + ODM_SetBBReg(pDM_Odm, 0xcd4, 0x000007ff, 0x200); + ODM_Write4Byte(pDM_Odm, 0xce8, 0x0); + ODM_SetBBReg(pDM_Odm, 0x82c, BIT(31), 0x0); // [31] = 0 --> Page C + ODM_SetBBReg(pDM_Odm, 0xc10, 0x000003ff, 0x100); +} + + +#if !(DM_ODM_SUPPORT_TYPE & ODM_AP) +VOID +PHY_IQCalibrate_8821A( + IN PDM_ODM_T pDM_Odm, + IN BOOLEAN bReCovery + ) +{ +#if !(DM_ODM_SUPPORT_TYPE & ODM_AP) + PADAPTER pAdapter = pDM_Odm->Adapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); + + #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + u4Byte counter = 0; + #endif +#endif + +#if (DM_ODM_SUPPORT_TYPE & ODM_WIN ) + if (ODM_CheckPowerStatus(pAdapter) == FALSE) + return; +#endif + + if (pDM_Odm->mp_mode){ //(MP_DRIVER == 1) + #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + #if (MP_DRIVER == 1) + PMPT_CONTEXT pMptCtx = &(pAdapter->MptCtx); + if( pMptCtx->bSingleTone || pMptCtx->bCarrierSuppression) + return; + #endif + #else// (DM_ODM_SUPPORT_TYPE == ODM_CE) + PMPT_CONTEXT pMptCtx = &(pAdapter->mppriv.MptCtx); + if( pMptCtx->bSingleTone || pMptCtx->bCarrierSuppression) + return; + #endif + + } + pDM_Odm->IQKFWOffload = 0; + + //3 == FW IQK == + if(pDM_Odm->IQKFWOffload) + { + if ( ! pDM_Odm->RFCalibrateInfo.bIQKInProgress) + { + ODM_AcquireSpinLock( pDM_Odm, RT_IQK_SPINLOCK); + pDM_Odm->RFCalibrateInfo.bIQKInProgress = TRUE; + ODM_ReleaseSpinLock( pDM_Odm, RT_IQK_SPINLOCK); + phy_IQCalibrate_By_FW_8821A(pDM_Odm); + #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) + for(counter = 0; counter < 10; counter++){ + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("== FW IQK IN PROGRESS == #%d\n", counter)); + ODM_delay_ms(50); + if ( ! pDM_Odm->RFCalibrateInfo.bIQKInProgress) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("== FW IQK RETURN FROM WAITING ==\n")); + break; + } + } + #elif (DM_ODM_SUPPORT_TYPE == ODM_CE) + rtl8812_iqk_wait(pAdapter, 500); + #endif + if (pDM_Odm->RFCalibrateInfo.bIQKInProgress) + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("== FW IQK TIMEOUT (Still in progress after 500ms) ==\n")); + ODM_AcquireSpinLock( pDM_Odm, RT_IQK_SPINLOCK); + pDM_Odm->RFCalibrateInfo.bIQKInProgress = FALSE; + ODM_ReleaseSpinLock( pDM_Odm, RT_IQK_SPINLOCK); + } + } + else + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("== Return the IQK CMD, because the IQK in Progress ==\n")); + } + } + //3 == Driver IQK == + else { + if ( ! pDM_Odm->RFCalibrateInfo.bIQKInProgress) { + ODM_AcquireSpinLock(pDM_Odm, RT_IQK_SPINLOCK); + pDM_Odm->RFCalibrateInfo.bIQKInProgress = TRUE; + ODM_ReleaseSpinLock(pDM_Odm, RT_IQK_SPINLOCK); + + pDM_Odm->RFCalibrateInfo.IQK_StartTime = ODM_GetCurrentTime( pDM_Odm); + phy_IQCalibrate_8821A(pDM_Odm); + pDM_Odm->RFCalibrateInfo.IQK_ProgressingTime = ODM_GetProgressingTime( pDM_Odm, pDM_Odm->RFCalibrateInfo.IQK_StartTime); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK ProgressingTime = %lld ms\n", pDM_Odm->RFCalibrateInfo.IQK_ProgressingTime)); + + ODM_AcquireSpinLock(pDM_Odm, RT_IQK_SPINLOCK); + pDM_Odm->RFCalibrateInfo.bIQKInProgress = FALSE; + ODM_ReleaseSpinLock(pDM_Odm, RT_IQK_SPINLOCK); + } + else + { + ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("== Return the IQK CMD, because the IQK in Progress ==\n")); + } + } + +} +#endif + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/PhyDM_IQK_8821A.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/PhyDM_IQK_8821A.h new file mode 100644 index 00000000000000..8c74fece7ced0d --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/PhyDM_IQK_8821A.h @@ -0,0 +1,48 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +#ifndef __PHYDM_IQK_8821A_H__ +#define __PHYDM_IQK_8821A_H__ + +/*--------------------------Define Parameters-------------------------------*/ + + +/*---------------------------End Define Parameters-------------------------------*/ +#if !(DM_ODM_SUPPORT_TYPE & ODM_AP) +void +DoIQK_8821A( + PDM_ODM_T pDM_Odm, + u1Byte DeltaThermalIndex, + u1Byte ThermalValue, + u1Byte Threshold + ); +void +PHY_IQCalibrate_8821A( + IN PDM_ODM_T pDM_Odm, + IN BOOLEAN bReCovery +); +#else +VOID +phy_IQCalibrate_8821A( + IN PDM_ODM_T pDM_Odm + ); +#endif +#endif // #ifndef __PHYDM_IQK_8821A_H__ + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/phydm_RTL8821A.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/phydm_RTL8821A.c new file mode 100644 index 00000000000000..a546f02a71b07e --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/phydm_RTL8821A.c @@ -0,0 +1,54 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +//============================================================ +// include files +//============================================================ + +#include "Mp_Precomp.h" + +#include "../phydm_precomp.h" + +#if (RTL8821A_SUPPORT == 1) + +VOID +odm_DynamicTryStateAgg_8821A( + IN PDM_ODM_T pDM_Odm + ) +{ + if((pDM_Odm->SupportICType == ODM_RTL8821) && (pDM_Odm->SupportInterface == ODM_ITRF_USB)) + { + if(pDM_Odm->RSSI_Min > 25) + ODM_Write1Byte(pDM_Odm, 0x4CF, 0x02); + else if(pDM_Odm->RSSI_Min < 20) + ODM_Write1Byte(pDM_Odm, 0x4CF, 0x00); + } +} + +VOID +odm_HWSetting_8821A( + IN PDM_ODM_T pDM_Odm + ) +{ + odm_DynamicTryStateAgg_8821A(pDM_Odm); +} + +#endif //#if (RTL8821A_SUPPORT == 1) + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/phydm_RTL8821A.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/phydm_RTL8821A.h new file mode 100644 index 00000000000000..0b5edf5a4d6bf7 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/phydm_RTL8821A.h @@ -0,0 +1,29 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ +#ifndef __ODM_RTL8821A_H__ +#define __ODM_RTL8821A_H__ + +VOID +odm_HWSetting_8821A( + IN PDM_ODM_T pDM_Odm +); + +#endif + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/phydm_RegConfig8821A.c b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/phydm_RegConfig8821A.c new file mode 100644 index 00000000000000..69670192480bf5 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/phydm_RegConfig8821A.c @@ -0,0 +1,223 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +#include "Mp_Precomp.h" +#include "../phydm_precomp.h" + +#if (RTL8821A_SUPPORT == 1) + +void +odm_ConfigRFReg_8821A( + IN PDM_ODM_T pDM_Odm, + IN u4Byte Addr, + IN u4Byte Data, + IN ODM_RF_RADIO_PATH_E RF_PATH, + IN u4Byte RegAddr + ) +{ + if(Addr == 0xfe || Addr == 0xffe) + { + #ifdef CONFIG_LONG_DELAY_ISSUE + ODM_sleep_ms(50); + #else + ODM_delay_ms(50); + #endif + } + else if (Addr == 0xfd) + { + ODM_delay_ms(5); + } + else if (Addr == 0xfc) + { + ODM_delay_ms(1); + } + else if (Addr == 0xfb) + { + ODM_delay_us(50); + } + else if (Addr == 0xfa) + { + ODM_delay_us(5); + } + else if (Addr == 0xf9) + { + ODM_delay_us(1); + } + else + { + ODM_SetRFReg(pDM_Odm, RF_PATH, RegAddr, bRFRegOffsetMask, Data); + // Add 1us delay between BB/RF register setting. + ODM_delay_us(1); + } +} + + +void +odm_ConfigRF_RadioA_8821A( + IN PDM_ODM_T pDM_Odm, + IN u4Byte Addr, + IN u4Byte Data + ) +{ + u4Byte content = 0x1000; // RF_Content: radioa_txt + u4Byte maskforPhySet= (u4Byte)(content&0xE000); + + odm_ConfigRFReg_8821A(pDM_Odm, Addr, Data, ODM_RF_PATH_A, Addr|maskforPhySet); + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigRFWithHeaderFile: [RadioA] %08X %08X\n", Addr, Data)); +} + +// 8821 no RF B +/* +void +odm_ConfigRF_RadioB_8821A( + IN PDM_ODM_T pDM_Odm, + IN u4Byte Addr, + IN u4Byte Data + ) +{ + u4Byte content = 0x1001; // RF_Content: radiob_txt + u4Byte maskforPhySet= (u4Byte)(content&0xE000); + + odm_ConfigRFReg_8812A(pDM_Odm, Addr, Data, ODM_RF_PATH_B, Addr|maskforPhySet); + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigRFWithHeaderFile: [RadioB] %08X %08X\n", Addr, Data)); + +} +*/ + +void +odm_ConfigMAC_8821A( + IN PDM_ODM_T pDM_Odm, + IN u4Byte Addr, + IN u1Byte Data + ) +{ + ODM_Write1Byte(pDM_Odm, Addr, Data); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigMACWithHeaderFile: [MAC_REG] %08X %08X\n", Addr, Data)); +} + +void +odm_ConfigBB_AGC_8821A( + IN PDM_ODM_T pDM_Odm, + IN u4Byte Addr, + IN u4Byte Bitmask, + IN u4Byte Data + ) +{ + ODM_SetBBReg(pDM_Odm, Addr, Bitmask, Data); + // Add 1us delay between BB/RF register setting. + ODM_delay_us(1); + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigBBWithHeaderFile: [AGC_TAB] %08X %08X\n", Addr, Data)); +} + +void +odm_ConfigBB_PHY_REG_PG_8821A( + IN PDM_ODM_T pDM_Odm, + IN u4Byte Band, + IN u4Byte RfPath, + IN u4Byte TxNum, + IN u4Byte Addr, + IN u4Byte Bitmask, + IN u4Byte Data + ) +{ + if (Addr == 0xfe) + #ifdef CONFIG_LONG_DELAY_ISSUE + ODM_sleep_ms(50); + #else + ODM_delay_ms(50); + #endif + else if (Addr == 0xfd) + ODM_delay_ms(5); + else if (Addr == 0xfc) + ODM_delay_ms(1); + else if (Addr == 0xfb) + ODM_delay_us(50); + else if (Addr == 0xfa) + ODM_delay_us(5); + else if (Addr == 0xf9) + ODM_delay_us(1); + + ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ConfigBBWithHeaderFile: [PHY_REG] %08X %08X %08X\n", Addr, Bitmask, Data)); + +#if !(DM_ODM_SUPPORT_TYPE&ODM_AP) + PHY_StoreTxPowerByRate(pDM_Odm->Adapter, Band, RfPath, TxNum, Addr, Bitmask, Data); +#endif + +} + +void +odm_ConfigBB_PHY_8821A( + IN PDM_ODM_T pDM_Odm, + IN u4Byte Addr, + IN u4Byte Bitmask, + IN u4Byte Data + ) +{ + if (Addr == 0xfe) + #ifdef CONFIG_LONG_DELAY_ISSUE + ODM_sleep_ms(50); + #else + ODM_delay_ms(50); + #endif + else if (Addr == 0xfd) + ODM_delay_ms(5); + else if (Addr == 0xfc) + ODM_delay_ms(1); + else if (Addr == 0xfb) + ODM_delay_us(50); + else if (Addr == 0xfa) + ODM_delay_us(5); + else if (Addr == 0xf9) + ODM_delay_us(1); + else if (Addr == 0xa24) + pDM_Odm->RFCalibrateInfo.RegA24 = Data; + ODM_SetBBReg(pDM_Odm, Addr, Bitmask, Data); + + // Add 1us delay between BB/RF register setting. + ODM_delay_us(1); + ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigBBWithHeaderFile: [PHY_REG] %08X %08X\n", Addr, Data)); +} + +void +odm_ConfigBB_TXPWR_LMT_8821A( + IN PDM_ODM_T pDM_Odm, + IN pu1Byte Regulation, + IN pu1Byte Band, + IN pu1Byte Bandwidth, + IN pu1Byte RateSection, + IN pu1Byte RfPath, + IN pu1Byte Channel, + IN pu1Byte PowerLimit + ) +{ +#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN)) + PHY_SetTxPowerLimit(pDM_Odm, Regulation, Band, + Bandwidth, RateSection, RfPath, Channel, PowerLimit); +#elif (DM_ODM_SUPPORT_TYPE & (ODM_CE)) + PHY_SetTxPowerLimit(pDM_Odm->Adapter, Regulation, Band, + Bandwidth, RateSection, RfPath, Channel, PowerLimit); +#endif +} + +#endif + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/phydm_RegConfig8821A.h b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/phydm_RegConfig8821A.h new file mode 100644 index 00000000000000..14b9e9970514f1 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8821a/phydm_RegConfig8821A.h @@ -0,0 +1,96 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ +#ifndef __INC_ODM_REGCONFIG_H_8821A +#define __INC_ODM_REGCONFIG_H_8821A + +#if (RTL8821A_SUPPORT == 1) + +void +odm_ConfigRFReg_8821A( + IN PDM_ODM_T pDM_Odm, + IN u4Byte Addr, + IN u4Byte Data, + IN ODM_RF_RADIO_PATH_E RF_PATH, + IN u4Byte RegAddr + ); + +void +odm_ConfigRF_RadioA_8821A( + IN PDM_ODM_T pDM_Odm, + IN u4Byte Addr, + IN u4Byte Data + ); + +void +odm_ConfigRF_RadioB_8821A( + IN PDM_ODM_T pDM_Odm, + IN u4Byte Addr, + IN u4Byte Data + ); + +void +odm_ConfigMAC_8821A( + IN PDM_ODM_T pDM_Odm, + IN u4Byte Addr, + IN u1Byte Data + ); + +void +odm_ConfigBB_AGC_8821A( + IN PDM_ODM_T pDM_Odm, + IN u4Byte Addr, + IN u4Byte Bitmask, + IN u4Byte Data + ); + +void +odm_ConfigBB_PHY_REG_PG_8821A( + IN PDM_ODM_T pDM_Odm, + IN u4Byte Band, + IN u4Byte RfPath, + IN u4Byte TxNum, + IN u4Byte Addr, + IN u4Byte Bitmask, + IN u4Byte Data + ); + +void +odm_ConfigBB_PHY_8821A( + IN PDM_ODM_T pDM_Odm, + IN u4Byte Addr, + IN u4Byte Bitmask, + IN u4Byte Data + ); + +void +odm_ConfigBB_TXPWR_LMT_8821A( + IN PDM_ODM_T pDM_Odm, + IN pu1Byte Regulation, + IN pu1Byte Band, + IN pu1Byte Bandwidth, + IN pu1Byte RateSection, + IN pu1Byte RfPath, + IN pu1Byte Channel, + IN pu1Byte PowerLimit + ); + +#endif +#endif // end of SUPPORT + diff --git a/backports/drivers/realtek/rtl8812au/hal/efuse/efuse_mask.h b/backports/drivers/realtek/rtl8812au/hal/efuse/efuse_mask.h new file mode 100644 index 00000000000000..f38fa88c60e932 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/efuse/efuse_mask.h @@ -0,0 +1,53 @@ + +#if DEV_BUS_TYPE == RT_USB_INTERFACE + + #if defined(CONFIG_RTL8188E) + #include "rtl8188e/HalEfuseMask8188E_USB.h" + #endif + + #if defined(CONFIG_RTL8812A) + #include "rtl8812a/HalEfuseMask8812A_USB.h" + #endif + + #if defined(CONFIG_RTL8821A) + #include "rtl8812a/HalEfuseMask8821A_USB.h" + #endif + + #if defined(CONFIG_RTL8192E) + #include "rtl8192e/HalEfuseMask8192E_USB.h" + #endif + + #if defined(CONFIG_RTL8723B) + #include "rtl8723b/HalEfuseMask8723B_USB.h" + #endif + + +#elif DEV_BUS_TYPE == RT_PCI_INTERFACE + + #if defined(CONFIG_RTL8188E) + #include "rtl8188e/HalEfuseMask8188E_PCIE.h" + #endif + + #if defined(CONFIG_RTL8812A) + #include "rtl8812a/HalEfuseMask8812A_PCIE.h" + #endif + + #if defined(CONFIG_RTL8821A) + #include "rtl8812a/HalEfuseMask8821A_PCIE.h" + #endif + + #if defined(CONFIG_RTL8192E) + #include "rtl8192e/HalEfuseMask8192E_PCIE.h" + #endif + + #if defined(CONFIG_RTL8723B) + #include "rtl8723b/HalEfuseMask8723B_PCIE.h" + #endif + +#elif DEV_BUS_TYPE == RT_SDIO_INTERFACE + + #if defined(CONFIG_RTL8188E) + #include "rtl8188e/HalEfuseMask8188E_SDIO.h" + #endif + +#endif \ No newline at end of file diff --git a/backports/drivers/realtek/rtl8812au/hal/efuse/rtl8812a/HalEfuseMask8812A_PCIE.c b/backports/drivers/realtek/rtl8812au/hal/efuse/rtl8812a/HalEfuseMask8812A_PCIE.c new file mode 100644 index 00000000000000..e1151442e59009 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/efuse/rtl8812a/HalEfuseMask8812A_PCIE.c @@ -0,0 +1,100 @@ +/****************************************************************************** +* +* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of version 2 of the GNU General Public License as +* published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +* +* You should have received a copy of the GNU General Public License along with +* this program; if not, write to the Free Software Foundation, Inc., +* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA +* +* +******************************************************************************/ + +//#include "Mp_Precomp.h" +//#include "../odm_precomp.h" + +#include +#include "../../../hal/OUTSRC/phydm_precomp.h" +#include "HalEfuseMask8812A_PCIE.h" + +/****************************************************************************** +* MPCIE.TXT +******************************************************************************/ + +u1Byte Array_MP_8812A_MPCIE[] = { + 0xFF, + 0xF7, + 0xEF, + 0xDE, + 0xFD, + 0xFB, + 0x10, + 0x00, + 0x00, + 0x00, + 0x00, + 0x0F, + 0xF3, + 0xFF, + 0xFF, + 0x7C, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + +}; + +u2Byte +EFUSE_GetArrayLen_MP_8812A_MPCIE(VOID) +{ + return sizeof(Array_MP_8812A_MPCIE)/sizeof(u1Byte); +} + +VOID +EFUSE_GetMaskArray_MP_8812A_MPCIE( + IN OUT pu1Byte Array + ) +{ + u2Byte len = EFUSE_GetArrayLen_MP_8812A_MPCIE(), i = 0; + + for (i = 0; i < len; ++i) + Array[i] = Array_MP_8812A_MPCIE[i]; +} +BOOLEAN +EFUSE_IsAddressMasked_MP_8812A_MPCIE( + IN u2Byte Offset + ) +{ + int r = Offset/16; + int c = (Offset%16) / 2; + int result = 0; + + if (c < 4) // Upper double word + result = (Array_MP_8812A_MPCIE[r] & (0x10 << c)); + else + result = (Array_MP_8812A_MPCIE[r] & (0x01 << (c-4))); + + return (result > 0) ? 0 : 1; +} + diff --git a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_FW.h b/backports/drivers/realtek/rtl8812au/hal/efuse/rtl8812a/HalEfuseMask8812A_PCIE.h old mode 100755 new mode 100644 similarity index 61% rename from backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_FW.h rename to backports/drivers/realtek/rtl8812au/hal/efuse/rtl8812a/HalEfuseMask8812A_PCIE.h index 9c55d9624c166d..90aba921ae3238 --- a/backports/drivers/realtek/rtl8812au/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_FW.h +++ b/backports/drivers/realtek/rtl8812au/hal/efuse/rtl8812a/HalEfuseMask8812A_PCIE.h @@ -18,33 +18,23 @@ * ******************************************************************************/ -#if (RTL8812A_SUPPORT == 1) -#ifndef __INC_TC_FW_HW_IMG_8812A_H -#define __INC_TC_FW_HW_IMG_8812A_H - /****************************************************************************** -* FW_NIC.TXT +* MPCIE.TXT ******************************************************************************/ -void -ODM_ReadFirmware_TC_8812A_FW_NIC( - IN PDM_ODM_T pDM_Odm, - OUT u1Byte *pFirmware, - OUT u4Byte *pFirmwareSize -); -/****************************************************************************** -* FW_WoWLAN.TXT -******************************************************************************/ +u2Byte +EFUSE_GetArrayLen_MP_8812A_MPCIE(VOID); + +VOID +EFUSE_GetMaskArray_MP_8812A_MPCIE( + IN OUT pu1Byte Array +); -void -ODM_ReadFirmware_TC_8812A_FW_WoWLAN( - IN PDM_ODM_T pDM_Odm, - OUT u1Byte *pFirmware, - OUT u4Byte *pFirmwareSize +BOOLEAN +EFUSE_IsAddressMasked_MP_8812A_MPCIE( // TC: Test Chip, MP: MP Chip + IN u2Byte Offset ); -#endif -#endif // end of HWIMG_SUPPORT diff --git a/backports/drivers/realtek/rtl8812au/hal/efuse/rtl8812a/HalEfuseMask8812A_USB.c b/backports/drivers/realtek/rtl8812au/hal/efuse/rtl8812a/HalEfuseMask8812A_USB.c new file mode 100644 index 00000000000000..1754b05ec6d417 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/efuse/rtl8812a/HalEfuseMask8812A_USB.c @@ -0,0 +1,102 @@ +/****************************************************************************** +* +* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of version 2 of the GNU General Public License as +* published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +* +* You should have received a copy of the GNU General Public License along with +* this program; if not, write to the Free Software Foundation, Inc., +* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA +* +* +******************************************************************************/ + +//#include "Mp_Precomp.h" +//#include "../odm_precomp.h" + +#include +#include "../../../hal/OUTSRC/phydm_precomp.h" +#include "HalEfuseMask8812A_USB.h" + +/****************************************************************************** +* MUSB.TXT +******************************************************************************/ + +u1Byte Array_MP_8812A_MUSB[] = { + 0xFF, + 0xF7, + 0xEF, + 0xDE, + 0xFC, + 0xFB, + 0x10, + 0x00, + 0x00, + 0x00, + 0x00, + 0x0F, + 0xF3, + 0xFF, + 0xFF, + 0xFF, + 0xFF, + 0xF7, + 0x00, + 0xFF, + 0xFF, + 0xF3, + 0x0F, + 0xFF, + 0xF3, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + +}; + +u2Byte +EFUSE_GetArrayLen_MP_8812A_MUSB(VOID) +{ + return sizeof(Array_MP_8812A_MUSB)/sizeof(u1Byte); +} + +VOID +EFUSE_GetMaskArray_MP_8812A_MUSB( + IN OUT pu1Byte Array + ) +{ + u2Byte len = EFUSE_GetArrayLen_MP_8812A_MUSB(), i = 0; + + for (i = 0; i < len; ++i) + Array[i] = Array_MP_8812A_MUSB[i]; +} +BOOLEAN +EFUSE_IsAddressMasked_MP_8812A_MUSB( + IN u2Byte Offset + ) +{ + int r = Offset/16; + int c = (Offset%16) / 2; + int result = 0; + + if (c < 4) // Upper double word + result = (Array_MP_8812A_MUSB[r] & (0x10 << c)); + else + result = (Array_MP_8812A_MUSB[r] & (0x01 << (c-4))); + + return (result > 0) ? 0 : 1; +} + + + diff --git a/backports/drivers/realtek/rtl8812au/hal/efuse/rtl8812a/HalEfuseMask8812A_USB.h b/backports/drivers/realtek/rtl8812au/hal/efuse/rtl8812a/HalEfuseMask8812A_USB.h new file mode 100644 index 00000000000000..2bd0963486fdb0 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/efuse/rtl8812a/HalEfuseMask8812A_USB.h @@ -0,0 +1,40 @@ +/****************************************************************************** +* +* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of version 2 of the GNU General Public License as +* published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +* +* You should have received a copy of the GNU General Public License along with +* this program; if not, write to the Free Software Foundation, Inc., +* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA +* +* +******************************************************************************/ + + + +/****************************************************************************** +* MUSB.TXT +******************************************************************************/ + + +u2Byte +EFUSE_GetArrayLen_MP_8812A_MUSB(VOID); + +VOID +EFUSE_GetMaskArray_MP_8812A_MUSB( + IN OUT pu1Byte Array +); + +BOOLEAN +EFUSE_IsAddressMasked_MP_8812A_MUSB( // TC: Test Chip, MP: MP Chip + IN u2Byte Offset +); + diff --git a/backports/drivers/realtek/rtl8812au/hal/efuse/rtl8812a/HalEfuseMask8821A_PCIE.c b/backports/drivers/realtek/rtl8812au/hal/efuse/rtl8812a/HalEfuseMask8821A_PCIE.c new file mode 100644 index 00000000000000..4af17e5b0b1e28 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/efuse/rtl8812a/HalEfuseMask8821A_PCIE.c @@ -0,0 +1,102 @@ +/****************************************************************************** +* +* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of version 2 of the GNU General Public License as +* published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +* +* You should have received a copy of the GNU General Public License along with +* this program; if not, write to the Free Software Foundation, Inc., +* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA +* +* +******************************************************************************/ + +//#include "Mp_Precomp.h" +//#include "../odm_precomp.h" + +#include +#include "../../../hal/OUTSRC/phydm_precomp.h" +#include "HalEfuseMask8821A_PCIE.h" + +/****************************************************************************** +* MPCIE.TXT +******************************************************************************/ + +u1Byte Array_MP_8821A_MPCIE[] = { + 0xFF, + 0xF3, + 0xEF, + 0x90, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x0F, + 0xF1, + 0xFF, + 0xFF, + 0xFF, + 0xFF, + 0xFF, + 0xF1, + 0x00, + 0x80, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + +}; + +u2Byte +EFUSE_GetArrayLen_MP_8821A_MPCIE(VOID) +{ + return sizeof(Array_MP_8821A_MPCIE)/sizeof(u1Byte); +} + +VOID +EFUSE_GetMaskArray_MP_8821A_MPCIE( + IN OUT pu1Byte Array + ) +{ + u2Byte len = EFUSE_GetArrayLen_MP_8821A_MPCIE(), i = 0; + + for (i = 0; i < len; ++i) + Array[i] = Array_MP_8821A_MPCIE[i]; +} +BOOLEAN +EFUSE_IsAddressMasked_MP_8821A_MPCIE( + IN u2Byte Offset + ) +{ + int r = Offset/16; + int c = (Offset%16) / 2; + int result = 0; + + if (c < 4) // Upper double word + result = (Array_MP_8821A_MPCIE[r] & (0x10 << c)); + else + result = (Array_MP_8821A_MPCIE[r] & (0x01 << (c-4))); + + return (result > 0) ? 0 : 1; +} + + + diff --git a/backports/drivers/realtek/rtl8812au/hal/efuse/rtl8812a/HalEfuseMask8821A_PCIE.h b/backports/drivers/realtek/rtl8812au/hal/efuse/rtl8812a/HalEfuseMask8821A_PCIE.h new file mode 100644 index 00000000000000..d5732f32d33b4b --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/efuse/rtl8812a/HalEfuseMask8821A_PCIE.h @@ -0,0 +1,41 @@ +/****************************************************************************** +* +* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of version 2 of the GNU General Public License as +* published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +* +* You should have received a copy of the GNU General Public License along with +* this program; if not, write to the Free Software Foundation, Inc., +* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA +* +* +******************************************************************************/ + + +/****************************************************************************** +* MPCIE.TXT +******************************************************************************/ + + +u2Byte +EFUSE_GetArrayLen_MP_8821A_MPCIE(VOID); + +VOID +EFUSE_GetMaskArray_MP_8821A_MPCIE( + IN OUT pu1Byte Array +); + +BOOLEAN +EFUSE_IsAddressMasked_MP_8821A_MPCIE( // TC: Test Chip, MP: MP Chip + IN u2Byte Offset +); + + + diff --git a/backports/drivers/realtek/rtl8812au/hal/efuse/rtl8812a/HalEfuseMask8821A_USB.c b/backports/drivers/realtek/rtl8812au/hal/efuse/rtl8812a/HalEfuseMask8821A_USB.c new file mode 100644 index 00000000000000..fd5868bc446085 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/efuse/rtl8812a/HalEfuseMask8821A_USB.c @@ -0,0 +1,102 @@ +/****************************************************************************** +* +* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of version 2 of the GNU General Public License as +* published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +* +* You should have received a copy of the GNU General Public License along with +* this program; if not, write to the Free Software Foundation, Inc., +* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA +* +* +******************************************************************************/ + +//#include "Mp_Precomp.h" +//#include "../odm_precomp.h" + +#include +#include "../../../hal/OUTSRC/phydm_precomp.h" +#include "HalEfuseMask8821A_USB.h" + + +/****************************************************************************** +* MUSB.TXT +******************************************************************************/ + + +u1Byte Array_MP_8821A_MUSB[] = { + 0xFF, + 0xF3, + 0xEF, + 0x90, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x0F, + 0xF1, + 0x00, + 0x00, + 0x00, + 0xBF, + 0xFF, + 0xFF, + 0xFF, + 0xB0, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + +}; + +u2Byte +EFUSE_GetArrayLen_MP_8821A_MUSB(VOID) +{ + return sizeof(Array_MP_8821A_MUSB)/sizeof(u1Byte); +} + +VOID +EFUSE_GetMaskArray_MP_8821A_MUSB( + IN OUT pu1Byte Array + ) +{ + u2Byte len = EFUSE_GetArrayLen_MP_8821A_MUSB(), i = 0; + + for (i = 0; i < len; ++i) + Array[i] = Array_MP_8821A_MUSB[i]; +} +BOOLEAN +EFUSE_IsAddressMasked_MP_8821A_MUSB( + IN u2Byte Offset + ) +{ + int r = Offset/16; + int c = (Offset%16) / 2; + int result = 0; + + if (c < 4) // Upper double word + result = (Array_MP_8821A_MUSB[r] & (0x10 << c)); + else + result = (Array_MP_8821A_MUSB[r] & (0x01 << (c-4))); + + return (result > 0) ? 0 : 1; +} + diff --git a/backports/drivers/realtek/rtl8812au/hal/efuse/rtl8812a/HalEfuseMask8821A_USB.h b/backports/drivers/realtek/rtl8812au/hal/efuse/rtl8812a/HalEfuseMask8821A_USB.h new file mode 100644 index 00000000000000..771a03c62d876f --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/efuse/rtl8812a/HalEfuseMask8821A_USB.h @@ -0,0 +1,39 @@ +/****************************************************************************** +* +* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of version 2 of the GNU General Public License as +* published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +* +* You should have received a copy of the GNU General Public License along with +* this program; if not, write to the Free Software Foundation, Inc., +* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA +* +* +******************************************************************************/ + +/****************************************************************************** +* MUSB.TXT +******************************************************************************/ + +u2Byte +EFUSE_GetArrayLen_MP_8821A_MUSB(VOID); + +VOID +EFUSE_GetMaskArray_MP_8821A_MUSB( + IN OUT pu1Byte Array +); + +BOOLEAN +EFUSE_IsAddressMasked_MP_8821A_MUSB( // TC: Test Chip, MP: MP Chip + IN u2Byte Offset +); + + + diff --git a/backports/drivers/realtek/rtl8812au/hal/hal_btcoex.c b/backports/drivers/realtek/rtl8812au/hal/hal_btcoex.c index 8e627f8bfd65b4..8236c50ffa6e27 100755 --- a/backports/drivers/realtek/rtl8812au/hal/hal_btcoex.c +++ b/backports/drivers/realtek/rtl8812au/hal/hal_btcoex.c @@ -64,22 +64,40 @@ const char *const h2cStaString[] = const char *const ioStaString[] = { - "IO_STATUS_SUCCESS", - "IO_STATUS_FAIL_CANNOT_IO", - "IO_STATUS_FAIL_RF_OFF", - "IO_STATUS_FAIL_FW_READ_CLEAR_TIMEOUT", - "IO_STATUS_FAIL_WAIT_IO_EVENT_TIMEOUT", - "IO_STATUS_INVALID_LEN", - "IO_STATUS_IO_IDLE_QUEUE_EMPTY", - "IO_STATUS_IO_INSERT_WAIT_QUEUE_FAIL", - "IO_STATUS_UNKNOWN_FAIL", - "IO_STATUS_WRONG_LEVEL", - "IO_STATUS_H2C_STOPPED", + "success", + "can not IO", + "rf off", + "fw not read", + "wait io timeout", + "invalid len", + "idle Q empty", + "insert waitQ fail", + "unknown fail", + "wrong level", + "h2c stopped", +}; + +const char *const GLBtcWifiBwString[]={ + "11bg", + "HT20", + "HT40", + "HT80", + "HT160" }; +const char *const GLBtcWifiFreqString[]={ + "2.4G", + "5G" +}; + +#define HALBTCOUTSRC_AGG_CHK_WINDOW_IN_MS 8000 + BTC_COEXIST GLBtCoexist; u8 GLBtcWiFiInScanState; u8 GLBtcWiFiInIQKState; +u8 GLBtcWiFiInIPS; +u8 GLBtcWiFiInLPS; +u8 GLBtcBtCoexAliveRegistered; u32 GLBtcDbgType[BTC_MSG_MAX]; u8 GLBtcDbgBuf[BT_TMP_BUF_SIZE]; @@ -167,9 +185,24 @@ static void halbtcoutsrc_DbgInit(void) 0; } +static u8 halbtcoutsrc_IsCsrBtCoex(PBTC_COEXIST pBtCoexist) +{ + if (pBtCoexist->boardInfo.btChipType == BTC_CHIP_CSR_BC4 + || pBtCoexist->boardInfo.btChipType == BTC_CHIP_CSR_BC8 + ){ + return _TRUE; + } + return _FALSE; +} + static u8 halbtcoutsrc_IsHwMailboxExist(PBTC_COEXIST pBtCoexist) { - if (IS_HARDWARE_TYPE_8812(pBtCoexist->Adapter)) + if (pBtCoexist->boardInfo.btChipType == BTC_CHIP_CSR_BC4 + || pBtCoexist->boardInfo.btChipType == BTC_CHIP_CSR_BC8 + ){ + return _FALSE; + } + else if (IS_HARDWARE_TYPE_8812(pBtCoexist->Adapter)) { return _FALSE; } @@ -254,6 +287,9 @@ void halbtcoutsrc_LeaveLowPower(PBTC_COEXIST pBtCoexist) timeout = 30; #endif // !LPS_RPWM_WAIT_MS + if (GLBtcBtCoexAliveRegistered == _TRUE) + return; + stime = rtw_get_current_time(); do { ready = rtw_register_task_alive(padapter, BTCOEX_ALIVE); @@ -266,6 +302,8 @@ void halbtcoutsrc_LeaveLowPower(PBTC_COEXIST pBtCoexist) rtw_msleep_os(1); } while (1); + + GLBtcBtCoexAliveRegistered = _TRUE; #endif // CONFIG_LPS_LCLK } @@ -278,9 +316,13 @@ void halbtcoutsrc_NormalLowPower(PBTC_COEXIST pBtCoexist) #ifdef CONFIG_LPS_LCLK PADAPTER padapter; + if (GLBtcBtCoexAliveRegistered == _FALSE) + return; padapter = pBtCoexist->Adapter; rtw_unregister_task_alive(padapter, BTCOEX_ALIVE); + + GLBtcBtCoexAliveRegistered = _FALSE; #endif // CONFIG_LPS_LCLK } @@ -296,16 +338,41 @@ void halbtcoutsrc_DisableLowPower(PBTC_COEXIST pBtCoexist, u8 bLowPwrDisable) void halbtcoutsrc_AggregationCheck(PBTC_COEXIST pBtCoexist) { PADAPTER padapter; - BOOLEAN bNeedToAct; - + BOOLEAN bNeedToAct = _FALSE; + static u32 preTime = 0; + u32 curTime = 0; padapter = pBtCoexist->Adapter; - bNeedToAct = _FALSE; + + //===================================== + // To void continuous deleteBA=>addBA=>deleteBA=>addBA + // This function is not allowed to continuous called. + // It can only be called after 8 seconds. + //===================================== + + curTime = rtw_systime_to_ms(rtw_get_current_time()); + if((curTime - preTime) < HALBTCOUTSRC_AGG_CHK_WINDOW_IN_MS) // over 8 seconds you can execute this function again. + { + return; + } + else + { + preTime = curTime; + } if (pBtCoexist->btInfo.bRejectAggPkt) - rtw_btcoex_RejectApAggregatedPacket(padapter, _TRUE); + { + bNeedToAct = _TRUE; + pBtCoexist->btInfo.bPreRejectAggPkt = pBtCoexist->btInfo.bRejectAggPkt; + } else { + if(pBtCoexist->btInfo.bPreRejectAggPkt) + { + bNeedToAct = _TRUE; + pBtCoexist->btInfo.bPreRejectAggPkt = pBtCoexist->btInfo.bRejectAggPkt; + } + if (pBtCoexist->btInfo.bPreBtCtrlAggBufSize != pBtCoexist->btInfo.bBtCtrlAggBufSize) { @@ -322,13 +389,10 @@ void halbtcoutsrc_AggregationCheck(PBTC_COEXIST pBtCoexist) } pBtCoexist->btInfo.preAggBufSize = pBtCoexist->btInfo.aggBufSize; } - - if (bNeedToAct) - { - rtw_btcoex_RejectApAggregatedPacket(padapter, _TRUE); - rtw_btcoex_RejectApAggregatedPacket(padapter, _FALSE); - } } + + if (bNeedToAct) + rtw_btcoex_rx_ampdu_apply(padapter); } u8 halbtcoutsrc_IsWifiBusy(PADAPTER padapter) @@ -446,9 +510,10 @@ u32 halbtcoutsrc_GetBtPatchVer(PBTC_COEXIST pBtCoexist) u8 btFwVer = 0x0; u8 cnt = 0; -#if 0 +#ifdef CONFIG_BT_COEXIST_SOCKET_TRX if (!pBtCoexist->btInfo.btRealFwVer && cnt<=5) { +#if 0 if (halbtcoutsrc_IsHwMailboxExist(pBtCoexist)) { // mailbox exists, through mailbox if (NDBG_GetBtFwVersion(pBtCoexist->Adapter, &btRealFwVer, &btFwVer)) @@ -463,6 +528,8 @@ u32 halbtcoutsrc_GetBtPatchVer(PBTC_COEXIST pBtCoexist) } } else // no mailbox, query bt patch version through stack. +#endif + // query bt patch version through socket. { u1Byte dataLen=2; u1Byte buf[4] = {0}; @@ -472,7 +539,7 @@ u32 halbtcoutsrc_GetBtPatchVer(PBTC_COEXIST pBtCoexist) } cnt++; } -#endif +#endif //CONFIG_BT_COEXIST_SOCKET_TRX return pBtCoexist->btInfo.btRealFwVer; } @@ -499,11 +566,11 @@ static u8 halbtcoutsrc_GetWifiScanAPNum(PADAPTER padapter) pmlmepriv = &padapter->mlmepriv; pmlmeext = &padapter->mlmeextpriv; - if (check_fwstate(pmlmepriv, WIFI_SITE_MONITOR) == _FALSE) { - if (pmlmeext->sitesurvey_res.bss_cnt > 0xFF) + if (GLBtcWiFiInScanState == _FALSE) { + if (pmlmepriv->num_of_scanned > 0xFF) scan_AP_num = 0xFF; else - scan_AP_num = (u8)pmlmeext->sitesurvey_res.bss_cnt; + scan_AP_num = (u8)pmlmepriv->num_of_scanned; } return scan_AP_num; @@ -629,9 +696,24 @@ u8 halbtcoutsrc_Get(void *pBtcContext, u8 getType, void *pOutBuf) *pu8 = _FALSE; break; + case BTC_GET_BL_WIFI_IS_IN_MP_MODE: + if (padapter->registrypriv.mp_mode == 0) + { + *pu8 = _FALSE; + } + else + { + *pu8 = _TRUE; + } + break; + case BTC_GET_BL_EXT_SWITCH: *pu8 = _FALSE; break; + case BTC_GET_BL_IS_ASUS_8723B: + /* Always return FALSE in linux driver since this case is added only for windows driver */ + *pu8 = _FALSE; + break; case BTC_GET_S4_WIFI_RSSI: *pS4Tmp = halbtcoutsrc_GetWifiRssi(padapter); @@ -701,6 +783,26 @@ u8 halbtcoutsrc_Get(void *pBtcContext, u8 getType, void *pOutBuf) case BTC_GET_U1_AP_NUM: *pU1Tmp = halbtcoutsrc_GetWifiScanAPNum(padapter); break; + case BTC_GET_U1_ANT_TYPE: + switch(pHalData->bt_coexist.btAntisolation) + { + case 0: + *pU1Tmp = (u1Byte)BTC_ANT_TYPE_0; + break; + case 1: + *pU1Tmp = (u1Byte)BTC_ANT_TYPE_1; + break; + case 2: + *pU1Tmp = (u1Byte)BTC_ANT_TYPE_2; + break; + case 3: + *pU1Tmp = (u1Byte)BTC_ANT_TYPE_3; + break; + case 4: + *pU1Tmp = (u1Byte)BTC_ANT_TYPE_4; + break; + } + break; //=======1Ant=========== case BTC_GET_U1_LPS_MODE: @@ -766,6 +868,15 @@ u8 halbtcoutsrc_Set(void *pBtcContext, u8 setType, void *pInBuf) case BTC_SET_BL_INC_SCAN_DEV_NUM: pBtCoexist->btInfo.bIncreaseScanDevNum = *pu8; + break; + + case BTC_SET_BL_BT_TX_RX_MASK: + pBtCoexist->btInfo.bBtTxRxMask = *pu8; + break; + + case BTC_SET_BL_MIRACAST_PLUS_BT: + pBtCoexist->btInfo.bMiracastPlusBt = *pu8; + break; // set some u8 type variables. case BTC_SET_U1_RSSI_ADJ_VAL_FOR_AGC_TABLE_ON: @@ -835,19 +946,28 @@ u8 halbtcoutsrc_Set(void *pBtcContext, u8 setType, void *pInBuf) break; case BTC_SET_ACT_SEND_MIMO_PS: -#if 0 // not implement yet { - u8 newMimoPsMode = *pU1Tmp; + u8 newMimoPsMode = 3; + struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + + // *pU1Tmp = 0 use SM_PS static type + // *pU1Tmp = 1 disable SM_PS + if(*pU1Tmp==0) + newMimoPsMode = WLAN_HT_CAP_SM_PS_STATIC; + else if(*pU1Tmp==1) + newMimoPsMode = WLAN_HT_CAP_SM_PS_DISABLED; + if (check_fwstate(&padapter->mlmepriv, WIFI_ASOC_STATE) == _TRUE) - SendMimoPsFrame(padapter, padapter->MgntInfo.Bssid, newMimoPsMode); + { + //issue_action_SM_PS(padapter, get_my_bssid(&(pmlmeinfo->network)), newMimoPsMode); + issue_action_SM_PS_wait_ack(padapter, get_my_bssid(&(pmlmeinfo->network)), newMimoPsMode, 3, 1); + } } -#else - ret = _FALSE; -#endif break; case BTC_SET_ACT_CTRL_BT_INFO: -#if 0 +#ifdef CONFIG_BT_COEXIST_SOCKET_TRX { u8 dataLen = *pU1Tmp; u8 tmpBuf[20]; @@ -855,15 +975,15 @@ u8 halbtcoutsrc_Set(void *pBtcContext, u8 setType, void *pInBuf) { _rtw_memcpy(tmpBuf, pU1Tmp+1, dataLen); } -// BT_SendEventExtBtInfoControl(padapter, dataLen, &tmpBuf[0]); + BT_SendEventExtBtInfoControl(padapter, dataLen, &tmpBuf[0]); } -#else +#else //!CONFIG_BT_COEXIST_SOCKET_TRX ret = _FALSE; -#endif +#endif //CONFIG_BT_COEXIST_SOCKET_TRX break; case BTC_SET_ACT_CTRL_BT_COEX: -#if 0 +#ifdef CONFIG_BT_COEXIST_SOCKET_TRX { u8 dataLen = *pU1Tmp; u8 tmpBuf[20]; @@ -871,13 +991,27 @@ u8 halbtcoutsrc_Set(void *pBtcContext, u8 setType, void *pInBuf) { _rtw_memcpy(tmpBuf, pU1Tmp+1, dataLen); } -// BT_SendEventExtBtCoexControl(padapter, _FALSE, dataLen, &tmpBuf[0]); + BT_SendEventExtBtCoexControl(padapter, _FALSE, dataLen, &tmpBuf[0]); + } +#else //!CONFIG_BT_COEXIST_SOCKET_TRX + ret = _FALSE; +#endif //CONFIG_BT_COEXIST_SOCKET_TRX + break; + case BTC_SET_ACT_CTRL_8723B_ANT: +#if 0 + { + u1Byte dataLen=*pU1Tmp; + u1Byte tmpBuf[20]; + if(dataLen) + { + PlatformMoveMemory(&tmpBuf[0], pU1Tmp+1, dataLen); + } + BT_Set8723bAnt(Adapter, dataLen, &tmpBuf[0]); } #else ret = _FALSE; #endif break; - //===================== default: ret = _FALSE; @@ -887,6 +1021,48 @@ u8 halbtcoutsrc_Set(void *pBtcContext, u8 setType, void *pInBuf) return ret; } +u8 halbtcoutsrc_UnderIps(PBTC_COEXIST pBtCoexist) +{ + PADAPTER padapter; + struct pwrctrl_priv *pwrpriv; + u8 bMacPwrCtrlOn; + + padapter = pBtCoexist->Adapter; + pwrpriv = &padapter->dvobj->pwrctl_priv; + bMacPwrCtrlOn = _FALSE; + + if ((_TRUE == pwrpriv->bips_processing) + && (IPS_NONE != pwrpriv->ips_mode_req) + ) + { + return _TRUE; + } + + if (rf_off == pwrpriv->rf_pwrstate) + { + return _TRUE; + } + + rtw_hal_get_hwreg(padapter, HW_VAR_APFM_ON_MAC, &bMacPwrCtrlOn); + if (_FALSE == bMacPwrCtrlOn) + { + return _TRUE; + } + + return _FALSE; +} + +u8 halbtcoutsrc_UnderLps(PBTC_COEXIST pBtCoexist) +{ + return GLBtcWiFiInLPS; +} + +u8 halbtcoutsrc_Under32K(PBTC_COEXIST pBtCoexist) +{ + /* todo: the method to check whether wifi is under 32K or not */ + return _FALSE; +} + void halbtcoutsrc_DisplayCoexStatistics(PBTC_COEXIST pBtCoexist) { #if 0 @@ -909,14 +1085,24 @@ void halbtcoutsrc_DisplayCoexStatistics(PBTC_COEXIST pBtCoexist) CL_PRINTF(cliBuf); } } - +#else + for(i=0; iioComStr.ioH2cStatistics[i]) + { + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = [%s] = %d", "H2C statistics", \ + ioStaString[i], Adapter->ioComStr.ioH2cStatistics[i]); + CL_PRINTF(cliBuf); + } + } +#endif +#if 0 CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x", "lastHMEBoxNum", \ pHalData->LastHMEBoxNum); CL_PRINTF(cliBuf); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x / 0x%x", "LastSuccessFwEid/FirstfailedFwEid", \ + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x / 0x%x", "LastOkH2c/FirstFailH2c(fwNotRead)", \ pHalData->lastSuccessH2cEid, pHalData->firstFailedH2cEid); CL_PRINTF(cliBuf); -#endif CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d/ %d/ %d", "c2hIsr/c2hIntr/clr1AF/noRdy/noBuf", \ pHalData->InterruptLog.nIMR_C2HCMD, DBG_Var.c2hInterruptCnt, DBG_Var.c2hClrReadC2hCnt, @@ -926,12 +1112,13 @@ void halbtcoutsrc_DisplayCoexStatistics(PBTC_COEXIST pBtCoexist) CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d", "c2hPacket", \ DBG_Var.c2hPacketCnt); CL_PRINTF(cliBuf); - +#endif CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d", "Periodical/ DbgCtrl", \ pBtCoexist->statistics.cntPeriodical, pBtCoexist->statistics.cntDbgCtrl); CL_PRINTF(cliBuf); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d", "InitHw/InitCoexDm/", \ - pBtCoexist->statistics.cntInitHwConfig, pBtCoexist->statistics.cntInitCoexDm); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d/ %d", "PowerOn/InitHw/InitCoexDm/RfStatus", \ + pBtCoexist->statistics.cntPowerOn, pBtCoexist->statistics.cntInitHwConfig, pBtCoexist->statistics.cntInitCoexDm, + pBtCoexist->statistics.cntRfStatusNotify); CL_PRINTF(cliBuf); CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d/ %d/ %d", "Ips/Lps/Scan/Connect/Mstatus", \ pBtCoexist->statistics.cntIpsNotify, pBtCoexist->statistics.cntLpsNotify, @@ -976,17 +1163,95 @@ void halbtcoutsrc_DisplayBtLinkInfo(PBTC_COEXIST pBtCoexist) #endif } -void halbtcoutsrc_DisplayFwPwrModeCmd(PBTC_COEXIST pBtCoexist) +void halbtcoutsrc_DisplayWifiStatus(PBTC_COEXIST pBtCoexist) { - u8 *cliBuf = pBtCoexist->cliBuf; + PADAPTER padapter = pBtCoexist->Adapter; + struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); + u8* cliBuf=pBtCoexist->cliBuf; + s32 wifiRssi=0, btHsRssi=0; + BOOLEAN bScan=_FALSE, bLink=_FALSE, bRoam=_FALSE, bWifiBusy=_FALSE, bWifiUnderBMode=_FALSE; + u32 wifiBw=BTC_WIFI_BW_HT20, wifiTrafficDir=BTC_WIFI_TRAFFIC_TX, wifiFreq=BTC_FREQ_2_4G; + u32 wifiLinkStatus=0x0; + BOOLEAN bBtHsOn=_FALSE, bLowPower=_FALSE; + u8 wifiChnl=0, wifiHsChnl=0, nScanAPNum = 0, FwPSState; + + wifiLinkStatus = halbtcoutsrc_GetWifiLinkStatus(pBtCoexist); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d/ %d/ %d", "STA/vWifi/HS/p2pGo/p2pGc", \ + ((wifiLinkStatus&WIFI_STA_CONNECTED)? 1:0), ((wifiLinkStatus&WIFI_AP_CONNECTED)? 1:0), + ((wifiLinkStatus&WIFI_HS_CONNECTED)? 1:0), ((wifiLinkStatus&WIFI_P2P_GO_CONNECTED)? 1:0), + ((wifiLinkStatus&WIFI_P2P_GC_CONNECTED)? 1:0) ); + CL_PRINTF(cliBuf); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %02x %02x %02x %02x %02x %02x ", "Power mode cmd ", \ + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_DOT11_CHNL, &wifiChnl); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_HS_CHNL, &wifiHsChnl); CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d(%d)", "Dot11 channel / HsChnl(High Speed)", \ + wifiChnl, wifiHsChnl, bBtHsOn); + CL_PRINTF(cliBuf); + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_WIFI_RSSI, &wifiRssi); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_HS_RSSI, &btHsRssi); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d", "Wifi rssi/ HS rssi", \ + wifiRssi-100, btHsRssi-100); + CL_PRINTF(cliBuf); + + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_LINK, &bLink); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_ROAM, &bRoam); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d ", "Wifi bLink/ bRoam/ bScan", \ + bLink, bRoam, bScan); + CL_PRINTF(cliBuf); + + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_UNDER_5G, &wifiFreq); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_TRAFFIC_DIRECTION, &wifiTrafficDir); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &bWifiUnderBMode); + pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_AP_NUM, &nScanAPNum); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s / %s/ %s/ AP=%d ", "Wifi freq/ bw/ traffic", \ + GLBtcWifiFreqString[wifiFreq], ((bWifiUnderBMode)? "11b": GLBtcWifiBwString[wifiBw]), + ((!bWifiBusy)? "idle": ((BTC_WIFI_TRAFFIC_TX==wifiTrafficDir)? "uplink":"downlink")), + nScanAPNum); + CL_PRINTF(cliBuf); + + // power status + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s%s%s", "Power Status", \ + ((halbtcoutsrc_UnderIps(pBtCoexist) == _TRUE)? "IPS ON":"IPS OFF"), + ((halbtcoutsrc_UnderLps(pBtCoexist) == _TRUE)? ", LPS ON":", LPS OFF"), + ((halbtcoutsrc_Under32K(pBtCoexist) == _TRUE)? ", 32k":"")); + CL_PRINTF(cliBuf); + + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %02x %02x %02x %02x %02x %02x (0x%x/0x%x)", "Power mode cmd(lps/rpwm)", \ pBtCoexist->pwrModeVal[0], pBtCoexist->pwrModeVal[1], pBtCoexist->pwrModeVal[2], pBtCoexist->pwrModeVal[3], - pBtCoexist->pwrModeVal[4], pBtCoexist->pwrModeVal[5]); + pBtCoexist->pwrModeVal[4], pBtCoexist->pwrModeVal[5], + pBtCoexist->btInfo.lpsVal, + pBtCoexist->btInfo.rpwmVal); CL_PRINTF(cliBuf); } +void halbtcoutsrc_DisplayDbgMsg(void *pBtcContext, u8 dispType) +{ + PBTC_COEXIST pBtCoexist; + + + pBtCoexist = (PBTC_COEXIST)pBtcContext; + switch(dispType) + { + case BTC_DBG_DISP_COEX_STATISTICS: + halbtcoutsrc_DisplayCoexStatistics(pBtCoexist); + break; + case BTC_DBG_DISP_BT_LINK_INFO: + halbtcoutsrc_DisplayBtLinkInfo(pBtCoexist); + break; + case BTC_DBG_DISP_WIFI_STATUS: + halbtcoutsrc_DisplayWifiStatus(pBtCoexist); + break; + default: + break; + } +} + //==================================== // IO related function //==================================== @@ -1051,7 +1316,7 @@ void halbtcoutsrc_BitMaskWrite1Byte(void *pBtcContext, u32 regAddr, u8 bitMask, originalValue = 0; bitShift = 0; - if (bitMask != 0xFF) + if(bitMask != 0xff) { originalValue = rtw_read8(padapter, regAddr); @@ -1092,6 +1357,21 @@ void halbtcoutsrc_Write4Byte(void *pBtcContext, u32 RegAddr, u32 Data) rtw_write32(padapter, RegAddr, Data); } +void halbtcoutsrc_WriteLocalReg1Byte(void *pBtcContext, u32 RegAddr, u8 Data) +{ + PBTC_COEXIST pBtCoexist=(PBTC_COEXIST)pBtcContext; + PADAPTER Adapter=pBtCoexist->Adapter; + + if(BTC_INTF_SDIO == pBtCoexist->chipInterface) + { + rtw_write8(Adapter, SDIO_LOCAL_BASE | RegAddr, Data); + } + else + { + rtw_write8(Adapter, RegAddr, Data); + } +} + void halbtcoutsrc_SetBbReg(void *pBtcContext, u32 RegAddr, u32 BitMask, u32 Data) { PBTC_COEXIST pBtCoexist; @@ -1174,6 +1454,12 @@ void halbtcoutsrc_SetBtReg(void *pBtcContext, u8 RegType, u32 RegAddr, u32 Data) } } +u32 halbtcoutsrc_GetBtReg(void *pBtcContext, u8 RegType, u32 RegAddr) +{ + /* To be implemented. Always return 0 temporarily */ + return 0; +} + void halbtcoutsrc_FillH2cCmd(void *pBtcContext, u8 elementId, u32 cmdLen, u8 *pCmdBuffer) { PBTC_COEXIST pBtCoexist; @@ -1186,76 +1472,51 @@ void halbtcoutsrc_FillH2cCmd(void *pBtcContext, u8 elementId, u32 cmdLen, u8 *pC rtw_hal_fill_h2c_cmd(padapter, elementId, cmdLen, pCmdBuffer); } -void halbtcoutsrc_DisplayDbgMsg(void *pBtcContext, u8 dispType) -{ - PBTC_COEXIST pBtCoexist; - - - pBtCoexist = (PBTC_COEXIST)pBtcContext; - switch(dispType) - { - case BTC_DBG_DISP_COEX_STATISTICS: - halbtcoutsrc_DisplayCoexStatistics(pBtCoexist); - break; - case BTC_DBG_DISP_BT_LINK_INFO: - halbtcoutsrc_DisplayBtLinkInfo(pBtCoexist); - break; - case BTC_DBG_DISP_FW_PWR_MODE_CMD: - halbtcoutsrc_DisplayFwPwrModeCmd(pBtCoexist); - break; - default: - break; - } -} - -u8 halbtcoutsrc_UnderIps(PBTC_COEXIST pBtCoexist) +//==================================== +// Extern functions called by other module +//==================================== +u8 EXhalbtcoutsrc_BindBtCoexWithAdapter(void *padapter) { - PADAPTER padapter; - struct pwrctrl_priv *pwrpriv; - u8 bMacPwrCtrlOn; - - padapter = pBtCoexist->Adapter; - pwrpriv = &padapter->dvobj->pwrctl_priv; - bMacPwrCtrlOn = _FALSE; + PBTC_COEXIST pBtCoexist=&GLBtCoexist; + u1Byte antNum=2, chipType; + + if(pBtCoexist->bBinded) + return _FALSE; + else + pBtCoexist->bBinded = _TRUE; - if ((_TRUE == pwrpriv->bips_processing) - && (IPS_NONE != pwrpriv->ips_mode_req) - ) - { - return _TRUE; - } + pBtCoexist->statistics.cntBind++; + + pBtCoexist->Adapter = padapter; + + pBtCoexist->stackInfo.bProfileNotified = _FALSE; - if (rf_off == pwrpriv->rf_pwrstate) - { - return _TRUE; - } + pBtCoexist->btInfo.bBtCtrlAggBufSize = _FALSE; + pBtCoexist->btInfo.aggBufSize = 5; - rtw_hal_get_hwreg(padapter, HW_VAR_APFM_ON_MAC, &bMacPwrCtrlOn); - if (_FALSE == bMacPwrCtrlOn) - { - return _TRUE; - } + pBtCoexist->btInfo.bIncreaseScanDevNum = _FALSE; + pBtCoexist->btInfo.bMiracastPlusBt = _FALSE; - return _FALSE; +#if 0 + chipType = HALBT_GetBtChipType(Adapter); + EXhalbtcoutsrc_SetChipType(chipType); + antNum = HALBT_GetPgAntNum(Adapter); + EXhalbtcoutsrc_SetAntNum(BT_COEX_ANT_TYPE_PG, antNum); +#endif + // set default antenna position to main port + pBtCoexist->boardInfo.btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT; + + return _TRUE; } -//==================================== -// Extern functions called by other module -//==================================== u8 EXhalbtcoutsrc_InitlizeVariables(void *padapter) { PBTC_COEXIST pBtCoexist = &GLBtCoexist; - - pBtCoexist->statistics.cntBind++; + //pBtCoexist->statistics.cntBind++; halbtcoutsrc_DbgInit(); - if (pBtCoexist->bBinded) - return _FALSE; - else - pBtCoexist->bBinded = _TRUE; - #ifdef CONFIG_PCI_HCI pBtCoexist->chipInterface = BTC_INTF_PCI; #elif defined(CONFIG_USB_HCI) @@ -1266,12 +1527,7 @@ u8 EXhalbtcoutsrc_InitlizeVariables(void *padapter) pBtCoexist->chipInterface = BTC_INTF_UNKNOWN; #endif - if (NULL == pBtCoexist->Adapter) - { - pBtCoexist->Adapter = padapter; - } - - pBtCoexist->stackInfo.bProfileNotified = _FALSE; + EXhalbtcoutsrc_BindBtCoexWithAdapter(padapter); pBtCoexist->fBtcRead1Byte = halbtcoutsrc_Read1Byte; pBtCoexist->fBtcWrite1Byte = halbtcoutsrc_Write1Byte; @@ -1280,6 +1536,7 @@ u8 EXhalbtcoutsrc_InitlizeVariables(void *padapter) pBtCoexist->fBtcWrite2Byte = halbtcoutsrc_Write2Byte; pBtCoexist->fBtcRead4Byte = halbtcoutsrc_Read4Byte; pBtCoexist->fBtcWrite4Byte = halbtcoutsrc_Write4Byte; + pBtCoexist->fBtcWriteLocalReg1Byte = halbtcoutsrc_WriteLocalReg1Byte; pBtCoexist->fBtcSetBbReg = halbtcoutsrc_SetBbReg; pBtCoexist->fBtcGetBbReg = halbtcoutsrc_GetBbReg; @@ -1287,29 +1544,63 @@ u8 EXhalbtcoutsrc_InitlizeVariables(void *padapter) pBtCoexist->fBtcSetRfReg = halbtcoutsrc_SetRfReg; pBtCoexist->fBtcGetRfReg = halbtcoutsrc_GetRfReg; - pBtCoexist->fBtcSetBtReg = halbtcoutsrc_SetBtReg; - pBtCoexist->fBtcFillH2c = halbtcoutsrc_FillH2cCmd; pBtCoexist->fBtcDispDbgMsg = halbtcoutsrc_DisplayDbgMsg; pBtCoexist->fBtcGet = halbtcoutsrc_Get; pBtCoexist->fBtcSet = halbtcoutsrc_Set; + pBtCoexist->fBtcGetBtReg = halbtcoutsrc_GetBtReg; + pBtCoexist->fBtcSetBtReg = halbtcoutsrc_SetBtReg; - pBtCoexist->cliBuf = GLBtcDbgBuf; - - pBtCoexist->btInfo.bBtCtrlAggBufSize = _FALSE; - pBtCoexist->btInfo.aggBufSize = 5; - - pBtCoexist->btInfo.bIncreaseScanDevNum = _FALSE; + pBtCoexist->cliBuf = &GLBtcDbgBuf[0]; + pBtCoexist->boardInfo.singleAntPath = 0; + GLBtcWiFiInScanState = _FALSE; GLBtcWiFiInIQKState = _FALSE; + GLBtcWiFiInIPS = _FALSE; + + GLBtcWiFiInLPS = _FALSE; + + GLBtcBtCoexAliveRegistered = _FALSE; + return _TRUE; } -void EXhalbtcoutsrc_InitHwConfig(PBTC_COEXIST pBtCoexist) +void EXhalbtcoutsrc_PowerOnSetting(PBTC_COEXIST pBtCoexist) +{ + if (!halbtcoutsrc_IsBtCoexistAvailable(pBtCoexist)) + return; + + /* Power on setting function is only added in 8723B currently */ + if (IS_HARDWARE_TYPE_8723B(pBtCoexist->Adapter)) + { + if (pBtCoexist->boardInfo.btdmAntNum == 2) + EXhalbtc8723b2ant_PowerOnSetting(pBtCoexist); + else if (pBtCoexist->boardInfo.btdmAntNum == 1) + EXhalbtc8723b1ant_PowerOnSetting(pBtCoexist); + } +} + +void EXhalbtcoutsrc_PreLoadFirmware(PBTC_COEXIST pBtCoexist) +{ + if(!halbtcoutsrc_IsBtCoexistAvailable(pBtCoexist)) + return; + + pBtCoexist->statistics.cntPreLoadFirmware++; + + if(IS_HARDWARE_TYPE_8723B(pBtCoexist->Adapter)) + { + if(pBtCoexist->boardInfo.btdmAntNum == 2) + EXhalbtc8723b2ant_PreLoadFirmware(pBtCoexist); + else if(pBtCoexist->boardInfo.btdmAntNum == 1) + EXhalbtc8723b1ant_PreLoadFirmware(pBtCoexist); + } +} + +void EXhalbtcoutsrc_InitHwConfig(PBTC_COEXIST pBtCoexist, u8 bWifiOnly) { if (!halbtcoutsrc_IsBtCoexistAvailable(pBtCoexist)) return; @@ -1318,46 +1609,48 @@ void EXhalbtcoutsrc_InitHwConfig(PBTC_COEXIST pBtCoexist) if (IS_HARDWARE_TYPE_8821(pBtCoexist->Adapter)) { - if (pBtCoexist->boardInfo.btdmAntNum == 2) - EXhalbtc8821a2ant_InitHwConfig(pBtCoexist); + if (halbtcoutsrc_IsCsrBtCoex(pBtCoexist) == _TRUE) + EXhalbtc8821aCsr2ant_InitHwConfig(pBtCoexist, bWifiOnly); + else if (pBtCoexist->boardInfo.btdmAntNum == 2) + EXhalbtc8821a2ant_InitHwConfig(pBtCoexist, bWifiOnly); else if (pBtCoexist->boardInfo.btdmAntNum == 1) - EXhalbtc8821a1ant_InitHwConfig(pBtCoexist); + EXhalbtc8821a1ant_InitHwConfig(pBtCoexist, bWifiOnly); } else if (IS_HARDWARE_TYPE_8723B(pBtCoexist->Adapter)) { if (pBtCoexist->boardInfo.btdmAntNum == 2) - EXhalbtc8723b2ant_InitHwConfig(pBtCoexist); + EXhalbtc8723b2ant_InitHwConfig(pBtCoexist, bWifiOnly); else if (pBtCoexist->boardInfo.btdmAntNum == 1) - EXhalbtc8723b1ant_InitHwConfig(pBtCoexist); + EXhalbtc8723b1ant_InitHwConfig(pBtCoexist, bWifiOnly); } else if (IS_HARDWARE_TYPE_8723A(pBtCoexist->Adapter)) { if (pBtCoexist->boardInfo.btdmAntNum == 2) - EXhalbtc8723a2ant_InitHwConfig(pBtCoexist); + EXhalbtc8723a2ant_InitHwConfig(pBtCoexist, bWifiOnly); } else if (IS_HARDWARE_TYPE_8192C(pBtCoexist->Adapter)) { if (pBtCoexist->boardInfo.btdmAntNum == 2) - EXhalbtc8188c2ant_InitHwConfig(pBtCoexist); + EXhalbtc8188c2ant_InitHwConfig(pBtCoexist, bWifiOnly); } else if (IS_HARDWARE_TYPE_8192D(pBtCoexist->Adapter)) { if (pBtCoexist->boardInfo.btdmAntNum == 2) - EXhalbtc8192d2ant_InitHwConfig(pBtCoexist); + EXhalbtc8192d2ant_InitHwConfig(pBtCoexist, bWifiOnly); } else if (IS_HARDWARE_TYPE_8192E(pBtCoexist->Adapter)) { if (pBtCoexist->boardInfo.btdmAntNum == 2) - EXhalbtc8192e2ant_InitHwConfig(pBtCoexist); + EXhalbtc8192e2ant_InitHwConfig(pBtCoexist, bWifiOnly); else if (pBtCoexist->boardInfo.btdmAntNum == 1) - EXhalbtc8192e1ant_InitHwConfig(pBtCoexist); + EXhalbtc8192e1ant_InitHwConfig(pBtCoexist, bWifiOnly); } else if (IS_HARDWARE_TYPE_8812(pBtCoexist->Adapter)) { if (pBtCoexist->boardInfo.btdmAntNum == 2) - EXhalbtc8812a2ant_InitHwConfig(pBtCoexist); + EXhalbtc8812a2ant_InitHwConfig(pBtCoexist, bWifiOnly); else if (pBtCoexist->boardInfo.btdmAntNum == 1) - EXhalbtc8812a1ant_InitHwConfig(pBtCoexist); + EXhalbtc8812a1ant_InitHwConfig(pBtCoexist, bWifiOnly); } } @@ -1370,7 +1663,9 @@ void EXhalbtcoutsrc_InitCoexDm(PBTC_COEXIST pBtCoexist) if (IS_HARDWARE_TYPE_8821(pBtCoexist->Adapter)) { - if (pBtCoexist->boardInfo.btdmAntNum == 2) + if (halbtcoutsrc_IsCsrBtCoex(pBtCoexist) == _TRUE) + EXhalbtc8821aCsr2ant_InitCoexDm(pBtCoexist); + else if (pBtCoexist->boardInfo.btdmAntNum == 2) EXhalbtc8821a2ant_InitCoexDm(pBtCoexist); else if (pBtCoexist->boardInfo.btdmAntNum == 1) EXhalbtc8821a1ant_InitCoexDm(pBtCoexist); @@ -1427,16 +1722,24 @@ void EXhalbtcoutsrc_IpsNotify(PBTC_COEXIST pBtCoexist, u8 type) return; if (IPS_NONE == type) + { ipsType = BTC_IPS_LEAVE; + GLBtcWiFiInIPS = _FALSE; + } else + { ipsType = BTC_IPS_ENTER; - + GLBtcWiFiInIPS = _TRUE; + } + // All notify is called in cmd thread, don't need to leave low power again // halbtcoutsrc_LeaveLowPower(pBtCoexist); if (IS_HARDWARE_TYPE_8821(pBtCoexist->Adapter)) { - if (pBtCoexist->boardInfo.btdmAntNum == 2) + if (halbtcoutsrc_IsCsrBtCoex(pBtCoexist) == _TRUE) + EXhalbtc8821aCsr2ant_IpsNotify(pBtCoexist, ipsType); + else if (pBtCoexist->boardInfo.btdmAntNum == 2) EXhalbtc8821a2ant_IpsNotify(pBtCoexist, ipsType); else if (pBtCoexist->boardInfo.btdmAntNum == 1) EXhalbtc8821a1ant_IpsNotify(pBtCoexist, ipsType); @@ -1494,13 +1797,21 @@ void EXhalbtcoutsrc_LpsNotify(PBTC_COEXIST pBtCoexist, u8 type) return; if (PS_MODE_ACTIVE == type) + { lpsType = BTC_LPS_DISABLE; + GLBtcWiFiInLPS = _FALSE; + } else + { lpsType = BTC_LPS_ENABLE; - + GLBtcWiFiInLPS = _TRUE; + } + if (IS_HARDWARE_TYPE_8821(pBtCoexist->Adapter)) { - if (pBtCoexist->boardInfo.btdmAntNum == 2) + if (halbtcoutsrc_IsCsrBtCoex(pBtCoexist) == _TRUE) + EXhalbtc8821aCsr2ant_LpsNotify(pBtCoexist, lpsType); + else if (pBtCoexist->boardInfo.btdmAntNum == 2) EXhalbtc8821a2ant_LpsNotify(pBtCoexist, lpsType); else if (pBtCoexist->boardInfo.btdmAntNum == 1) EXhalbtc8821a1ant_LpsNotify(pBtCoexist, lpsType); @@ -1569,7 +1880,9 @@ void EXhalbtcoutsrc_ScanNotify(PBTC_COEXIST pBtCoexist, u8 type) if (IS_HARDWARE_TYPE_8821(pBtCoexist->Adapter)) { - if (pBtCoexist->boardInfo.btdmAntNum == 2) + if (halbtcoutsrc_IsCsrBtCoex(pBtCoexist) == _TRUE) + EXhalbtc8821aCsr2ant_ScanNotify(pBtCoexist, scanType); + else if (pBtCoexist->boardInfo.btdmAntNum == 2) EXhalbtc8821a2ant_ScanNotify(pBtCoexist, scanType); else if (pBtCoexist->boardInfo.btdmAntNum == 1) EXhalbtc8821a1ant_ScanNotify(pBtCoexist, scanType); @@ -1634,7 +1947,9 @@ void EXhalbtcoutsrc_ConnectNotify(PBTC_COEXIST pBtCoexist, u8 action) if (IS_HARDWARE_TYPE_8821(pBtCoexist->Adapter)) { - if (pBtCoexist->boardInfo.btdmAntNum == 2) + if (halbtcoutsrc_IsCsrBtCoex(pBtCoexist) == _TRUE) + EXhalbtc8821aCsr2ant_ConnectNotify(pBtCoexist, assoType); + else if (pBtCoexist->boardInfo.btdmAntNum == 2) EXhalbtc8821a2ant_ConnectNotify(pBtCoexist, assoType); else if (pBtCoexist->boardInfo.btdmAntNum == 1) EXhalbtc8821a1ant_ConnectNotify(pBtCoexist, assoType); @@ -1700,7 +2015,9 @@ void EXhalbtcoutsrc_MediaStatusNotify(PBTC_COEXIST pBtCoexist, RT_MEDIA_STATUS m if (IS_HARDWARE_TYPE_8821(pBtCoexist->Adapter)) { - if (pBtCoexist->boardInfo.btdmAntNum == 2) + if (halbtcoutsrc_IsCsrBtCoex(pBtCoexist) == _TRUE) + EXhalbtc8821aCsr2ant_MediaStatusNotify(pBtCoexist, mStatus); + else if (pBtCoexist->boardInfo.btdmAntNum == 2) EXhalbtc8821a2ant_MediaStatusNotify(pBtCoexist, mStatus); else if (pBtCoexist->boardInfo.btdmAntNum == 1) EXhalbtc8821a1ant_MediaStatusNotify(pBtCoexist, mStatus); @@ -1772,7 +2089,9 @@ void EXhalbtcoutsrc_SpecialPacketNotify(PBTC_COEXIST pBtCoexist, u8 pktType) if (IS_HARDWARE_TYPE_8821(pBtCoexist->Adapter)) { - if (pBtCoexist->boardInfo.btdmAntNum == 2) + if (halbtcoutsrc_IsCsrBtCoex(pBtCoexist) == _TRUE) + EXhalbtc8821aCsr2ant_SpecialPacketNotify(pBtCoexist, packetType); + else if (pBtCoexist->boardInfo.btdmAntNum == 2) EXhalbtc8821a2ant_SpecialPacketNotify(pBtCoexist, packetType); else if (pBtCoexist->boardInfo.btdmAntNum == 1) EXhalbtc8821a1ant_SpecialPacketNotify(pBtCoexist, packetType); @@ -1829,7 +2148,9 @@ void EXhalbtcoutsrc_BtInfoNotify(PBTC_COEXIST pBtCoexist, u8 *tmpBuf, u8 length) if (IS_HARDWARE_TYPE_8821(pBtCoexist->Adapter)) { - if (pBtCoexist->boardInfo.btdmAntNum == 2) + if (halbtcoutsrc_IsCsrBtCoex(pBtCoexist) == _TRUE) + EXhalbtc8821aCsr2ant_BtInfoNotify(pBtCoexist, tmpBuf, length); + else if (pBtCoexist->boardInfo.btdmAntNum == 2) EXhalbtc8821a2ant_BtInfoNotify(pBtCoexist, tmpBuf, length); else if (pBtCoexist->boardInfo.btdmAntNum == 1) EXhalbtc8821a1ant_BtInfoNotify(pBtCoexist, tmpBuf, length); @@ -1874,6 +2195,32 @@ void EXhalbtcoutsrc_BtInfoNotify(PBTC_COEXIST pBtCoexist, u8 *tmpBuf, u8 length) // halbtcoutsrc_NormalLowPower(pBtCoexist); } +VOID +EXhalbtcoutsrc_RfStatusNotify( + IN PBTC_COEXIST pBtCoexist, + IN u1Byte type + ) +{ + if(!halbtcoutsrc_IsBtCoexistAvailable(pBtCoexist)) + return; + pBtCoexist->statistics.cntRfStatusNotify++; + + if(IS_HARDWARE_TYPE_8821(pBtCoexist->Adapter)) + { + } + else if(IS_HARDWARE_TYPE_8723B(pBtCoexist->Adapter)) + { + if(pBtCoexist->boardInfo.btdmAntNum == 1) + EXhalbtc8723b1ant_RfStatusNotify(pBtCoexist, type); + } + else if(IS_HARDWARE_TYPE_8192E(pBtCoexist->Adapter)) + { + } + else if(IS_HARDWARE_TYPE_8812(pBtCoexist->Adapter)) + { + } +} + void EXhalbtcoutsrc_StackOperationNotify(PBTC_COEXIST pBtCoexist, u8 type) { #if 0 @@ -1918,7 +2265,9 @@ void EXhalbtcoutsrc_HaltNotify(PBTC_COEXIST pBtCoexist) if (IS_HARDWARE_TYPE_8821(pBtCoexist->Adapter)) { - if (pBtCoexist->boardInfo.btdmAntNum == 2) + if (halbtcoutsrc_IsCsrBtCoex(pBtCoexist) == _TRUE) + EXhalbtc8821aCsr2ant_HaltNotify(pBtCoexist); + else if (pBtCoexist->boardInfo.btdmAntNum == 2) EXhalbtc8821a2ant_HaltNotify(pBtCoexist); else if (pBtCoexist->boardInfo.btdmAntNum == 1) EXhalbtc8821a1ant_HaltNotify(pBtCoexist); @@ -1961,9 +2310,11 @@ void EXhalbtcoutsrc_HaltNotify(PBTC_COEXIST pBtCoexist) else if (pBtCoexist->boardInfo.btdmAntNum == 1) EXhalbtc8812a1ant_HaltNotify(pBtCoexist); } + + pBtCoexist->bBinded = FALSE; } -void EXhalbtcoutsrc_SwitchGntBt(PBTC_COEXIST pBtCoexist) +void EXhalbtcoutsrc_SwitchBtTRxMask(PBTC_COEXIST pBtCoexist) { if (IS_HARDWARE_TYPE_8723B(pBtCoexist->Adapter)) { @@ -1992,11 +2343,17 @@ void EXhalbtcoutsrc_PnpNotify(PBTC_COEXIST pBtCoexist, u8 pnpState) { if (pBtCoexist->boardInfo.btdmAntNum == 1) EXhalbtc8723b1ant_PnpNotify(pBtCoexist,pnpState); + else if(pBtCoexist->boardInfo.btdmAntNum == 2) + EXhalbtc8723b2ant_PnpNotify(pBtCoexist,pnpState); } else if (IS_HARDWARE_TYPE_8821(pBtCoexist->Adapter)) { - if (pBtCoexist->boardInfo.btdmAntNum == 1) + if (halbtcoutsrc_IsCsrBtCoex(pBtCoexist) == _TRUE) + EXhalbtc8821aCsr2ant_PnpNotify(pBtCoexist, pnpState); + else if (pBtCoexist->boardInfo.btdmAntNum == 1) EXhalbtc8821a1ant_PnpNotify(pBtCoexist,pnpState); + else if(pBtCoexist->boardInfo.btdmAntNum == 2) + EXhalbtc8821a2ant_PnpNotify(pBtCoexist,pnpState); } else if (IS_HARDWARE_TYPE_8192E(pBtCoexist->Adapter)) { @@ -2025,7 +2382,7 @@ void EXhalbtcoutsrc_CoexDmSwitch(PBTC_COEXIST pBtCoexist) pBtCoexist->bStopCoexDm = TRUE; EXhalbtc8723b1ant_CoexDmReset(pBtCoexist); EXhalbtcoutsrc_SetAntNum(BT_COEX_ANT_TYPE_DETECTED, 2); - EXhalbtc8723b2ant_InitHwConfig(pBtCoexist); + EXhalbtc8723b2ant_InitHwConfig(pBtCoexist, FALSE); EXhalbtc8723b2ant_InitCoexDm(pBtCoexist); pBtCoexist->bStopCoexDm = FALSE; } @@ -2046,7 +2403,9 @@ void EXhalbtcoutsrc_Periodical(PBTC_COEXIST pBtCoexist) if (IS_HARDWARE_TYPE_8821(pBtCoexist->Adapter)) { - if (pBtCoexist->boardInfo.btdmAntNum == 2) + if (halbtcoutsrc_IsCsrBtCoex(pBtCoexist) == _TRUE) + EXhalbtc8821aCsr2ant_Periodical(pBtCoexist); + else if (pBtCoexist->boardInfo.btdmAntNum == 2) EXhalbtc8821a2ant_Periodical(pBtCoexist); else if (pBtCoexist->boardInfo.btdmAntNum == 1) { @@ -2128,12 +2487,41 @@ void EXhalbtcoutsrc_DbgControl(PBTC_COEXIST pBtCoexist, u8 opCode, u8 opLen, u8 // halbtcoutsrc_NormalLowPower(pBtCoexist); } +#if 0 +VOID +EXhalbtcoutsrc_AntennaDetection( + IN PBTC_COEXIST pBtCoexist, + IN u4Byte centFreq, + IN u4Byte offset, + IN u4Byte span, + IN u4Byte seconds + ) +{ + if(!halbtcoutsrc_IsBtCoexistAvailable(pBtCoexist)) + return; + + /* Need to refine the following power save operations to enable this function in the future */ +#if 0 + IPSDisable(pBtCoexist->Adapter, FALSE, 0); + LeisurePSLeave(pBtCoexist->Adapter, LPS_DISABLE_BT_COEX); +#endif + + if(IS_HARDWARE_TYPE_8723B(pBtCoexist->Adapter)) + { + if(pBtCoexist->boardInfo.btdmAntNum == 1) + EXhalbtc8723b1ant_AntennaDetection(pBtCoexist, centFreq, offset, span, seconds); + } + + //IPSReturn(pBtCoexist->Adapter, 0xff); +} +#endif + void EXhalbtcoutsrc_StackUpdateProfileInfo(void) { -#if 0 +#ifdef CONFIG_BT_COEXIST_SOCKET_TRX PBTC_COEXIST pBtCoexist = &GLBtCoexist; - PADAPTER padapter = (PADAPTER)GLBtCoexist.padapter; - PBT_MGNT pBtMgnt = &padapter->MgntInfo.BtInfo.BtMgnt; + PADAPTER padapter = (PADAPTER)GLBtCoexist.Adapter; + PBT_MGNT pBtMgnt = &padapter->coex_info.BtMgnt; u8 i; if (!halbtcoutsrc_IsBtCoexistAvailable(pBtCoexist)) @@ -2185,7 +2573,7 @@ void EXhalbtcoutsrc_StackUpdateProfileInfo(void) pBtCoexist->stackInfo.bUnknownAclExist = _TRUE; } } -#endif +#endif //CONFIG_BT_COEXIST_SOCKET_TRX } void EXhalbtcoutsrc_UpdateMinBtRssi(s8 btRssi) @@ -2219,11 +2607,12 @@ void EXhalbtcoutsrc_SetBtPatchVersion(u16 btHciVersion, u16 btPatchVersion) pBtCoexist->btInfo.btHciVer = btHciVersion; } +#if 0 void EXhalbtcoutsrc_SetBtExist(u8 bBtExist) { GLBtCoexist.boardInfo.bBtExist = bBtExist; } - +#endif void EXhalbtcoutsrc_SetChipType(u8 chipType) { switch(chipType) @@ -2259,7 +2648,7 @@ void EXhalbtcoutsrc_SetAntNum(u8 type, u8 antNum) { GLBtCoexist.boardInfo.pgAntNum = antNum; GLBtCoexist.boardInfo.btdmAntNum = antNum; - +#if 0 //The antenna position: Main (default) or Aux for pgAntNum=2 && btdmAntNum =1 //The antenna position should be determined by auto-detect mechanism // The following is assumed to main, and those must be modified if y auto-detect mechanism is ready @@ -2267,19 +2656,28 @@ void EXhalbtcoutsrc_SetAntNum(u8 type, u8 antNum) GLBtCoexist.boardInfo.btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT; else GLBtCoexist.boardInfo.btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT; +#endif } else if (BT_COEX_ANT_TYPE_ANTDIV == type) { GLBtCoexist.boardInfo.btdmAntNum = antNum; - GLBtCoexist.boardInfo.btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT; + //GLBtCoexist.boardInfo.btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT; } else if (BT_COEX_ANT_TYPE_DETECTED == type) { GLBtCoexist.boardInfo.btdmAntNum = antNum; - GLBtCoexist.boardInfo.btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT; + //GLBtCoexist.boardInfo.btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT; } } +// +// Currently used by 8723b only, S0 or S1 +// +void EXhalbtcoutsrc_SetSingleAntPath(u8 singleAntPath) +{ + GLBtCoexist.boardInfo.singleAntPath = singleAntPath; +} + void EXhalbtcoutsrc_DisplayBtCoexInfo(PBTC_COEXIST pBtCoexist) { if (!halbtcoutsrc_IsBtCoexistAvailable(pBtCoexist)) @@ -2289,7 +2687,9 @@ void EXhalbtcoutsrc_DisplayBtCoexInfo(PBTC_COEXIST pBtCoexist) if (IS_HARDWARE_TYPE_8821(pBtCoexist->Adapter)) { - if (pBtCoexist->boardInfo.btdmAntNum == 2) + if (halbtcoutsrc_IsCsrBtCoex(pBtCoexist) == _TRUE) + EXhalbtc8821aCsr2ant_DisplayCoexInfo(pBtCoexist); + else if (pBtCoexist->boardInfo.btdmAntNum == 2) EXhalbtc8821a2ant_DisplayCoexInfo(pBtCoexist); else if (pBtCoexist->boardInfo.btdmAntNum == 1) EXhalbtc8821a1ant_DisplayCoexInfo(pBtCoexist); @@ -2336,6 +2736,25 @@ void EXhalbtcoutsrc_DisplayBtCoexInfo(PBTC_COEXIST pBtCoexist) halbtcoutsrc_NormalLowPower(pBtCoexist); } +VOID +EXhalbtcoutsrc_DisplayAntIsolation( + IN PBTC_COEXIST pBtCoexist + ) +{ + if(!halbtcoutsrc_IsBtCoexistAvailable(pBtCoexist)) + return; + + halbtcoutsrc_LeaveLowPower(pBtCoexist); + + if(IS_HARDWARE_TYPE_8723B(pBtCoexist->Adapter)) + { + if(pBtCoexist->boardInfo.btdmAntNum == 1) + EXhalbtc8723b1ant_DisplayAntIsolation(pBtCoexist); + } + + halbtcoutsrc_NormalLowPower(pBtCoexist); +} + static void halbt_InitHwConfig92C(PADAPTER padapter) { PHAL_DATA_TYPE pHalData; @@ -2400,7 +2819,7 @@ void hal_btcoex_SetBTCoexist(PADAPTER padapter, u8 bBtExist) pHalData = GET_HAL_DATA(padapter); pHalData->bt_coexist.bBtExist = bBtExist; - EXhalbtcoutsrc_SetBtExist(bBtExist); + //EXhalbtcoutsrc_SetBtExist(bBtExist); } /* @@ -2472,6 +2891,11 @@ u8 hal_btcoex_GetPgAntNum(PADAPTER padapter) return pHalData->bt_coexist.btTotalAntNum; } +void hal_btcoex_SetSingleAntPath(PADAPTER padapter, u8 singleAntPath) +{ + EXhalbtcoutsrc_SetSingleAntPath(singleAntPath); +} + u8 hal_btcoex_Initialize(PADAPTER padapter) { u8 ret1; @@ -2485,7 +2909,17 @@ u8 hal_btcoex_Initialize(PADAPTER padapter) return ret2; } -void hal_btcoex_InitHwConfig(PADAPTER padapter) +void hal_btcoex_PowerOnSetting(PADAPTER padapter) +{ + EXhalbtcoutsrc_PowerOnSetting(&GLBtCoexist); +} + +void hal_btcoex_PreLoadFirmware(PADAPTER padapter) +{ + EXhalbtcoutsrc_PreLoadFirmware(&GLBtCoexist); +} + +void hal_btcoex_InitHwConfig(PADAPTER padapter, u8 bWifiOnly) { if (!hal_btcoex_IsBtExist(padapter)) return; @@ -2499,7 +2933,7 @@ void hal_btcoex_InitHwConfig(PADAPTER padapter) halbt_InitHwConfig92D(padapter); } - EXhalbtcoutsrc_InitHwConfig(&GLBtCoexist); + EXhalbtcoutsrc_InitHwConfig(&GLBtCoexist, bWifiOnly); EXhalbtcoutsrc_InitCoexDm(&GLBtCoexist); } @@ -2561,9 +2995,9 @@ void hal_btcoex_HaltNotify(PADAPTER padapter) EXhalbtcoutsrc_HaltNotify(&GLBtCoexist); } -void hal_btcoex_SwitchGntBt(PADAPTER padapter) +void hal_btcoex_SwitchBtTRxMask(PADAPTER padapter) { - EXhalbtcoutsrc_SwitchGntBt(&GLBtCoexist); + EXhalbtcoutsrc_SwitchBtTRxMask(&GLBtCoexist); } void hal_btcoex_Hanlder(PADAPTER padapter) @@ -2571,6 +3005,11 @@ void hal_btcoex_Hanlder(PADAPTER padapter) EXhalbtcoutsrc_Periodical(&GLBtCoexist); } +s32 hal_btcoex_IsBTCoexRejectAMPDU(PADAPTER padapter) +{ + return (s32)GLBtCoexist.btInfo.bRejectAggPkt; +} + s32 hal_btcoex_IsBTCoexCtrlAMPDUSize(PADAPTER padapter) { return (s32)GLBtCoexist.btInfo.bBtCtrlAggBufSize; @@ -2638,13 +3077,15 @@ u8 hal_btcoex_LpsVal(PADAPTER padapter) u32 hal_btcoex_GetRaMask(PADAPTER padapter) { if (!hal_btcoex_IsBtExist(padapter)) - return 0; + return 0; if (GLBtCoexist.btInfo.bBtDisabled) - return 0; + return 0; - if (GLBtCoexist.boardInfo.btdmAntNum != 1) - return 0; + // Modify by YiWei , suggest by Cosa and Jenyu + // Remove the limit antenna number , because 2 antenna case (ex: 8192eu)also want to get BT coex report rate mask. + //if (GLBtCoexist.boardInfo.btdmAntNum != 1) + // return 0; return GLBtCoexist.btInfo.raMask; } @@ -2826,5 +3267,198 @@ u8 hal_btcoex_IsBtLinkExist(PADAPTER padapter) return _FALSE; } + +void hal_btcoex_SetBtPatchVersion(PADAPTER padapter,u16 btHciVer,u16 btPatchVer) +{ + EXhalbtcoutsrc_SetBtPatchVersion(btHciVer,btPatchVer); +} + +void hal_btcoex_SetHciVersion(PADAPTER padapter, u16 hciVersion) +{ + EXhalbtcoutsrc_SetHciVersion(hciVersion); +} + +void hal_btcoex_StackUpdateProfileInfo(void) +{ + EXhalbtcoutsrc_StackUpdateProfileInfo(); +} + +/* + * Description: + * Setting BT coex antenna isolation type . + * coex mechanisn/ spital stream/ best throughput + * anttype = 0 , PSTDMA / 2SS / 0.5T , bad isolation, WiFi/BT ANT Distance<15cm, (<20dB) for 2,3 antenna + * anttype = 1 , PSTDMA / 1SS / 0.5T , normal isolaiton, 50cm>WiFi/BT ANT Distance>15cm, (>20dB) for 2 antenna + * anttype = 2 , TDMA / 2SS / T , normal isolaiton,50cm>WiFi/BT ANT Distance>15cm, (>20dB) for 3 antenna + * anttype = 3 , no TDMA / 1SS / 0.5T , good isolation, WiFi/BT ANT Distance >50cm, (>40dB) for 2 antenna + * anttype = 4 , no TDMA / 2SS / T , good isolation, WiFi/BT ANT Distance >50cm, (>40dB) for 3 antenna + * wifi only throughput ~ T + * wifi/BT share one antenna with SPDT + */ +void hal_btcoex_SetAntIsolationType(PADAPTER padapter, u8 anttype) +{ + PHAL_DATA_TYPE pHalData; + + //DBG_871X("####%s , anttype = %d , %d \n", __FUNCTION__,anttype,__LINE__); + pHalData = GET_HAL_DATA(padapter); + + + pHalData->bt_coexist.btAntisolation= anttype; + +} + +#ifdef CONFIG_LOAD_PHY_PARA_FROM_FILE +int +hal_btcoex_ParseAntIsolationConfigFile( + PADAPTER Adapter, + char* buffer +) +{ + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + u32 i = 0 , j=0; + char *szLine, *ptmp; + int rtStatus = _SUCCESS; + char param_value_string[10]; + u8 param_value; + u8 anttype = 4; + + u8 ant_num=3, ant_distance=50; + + typedef struct ant_isolation + { + char *param_name; // antenna isolation config parameter name + u8 *value; // antenna isolation config parameter value + }ANT_ISOLATION; + + ANT_ISOLATION ant_isolation_param[]= { + {"ANT_NUMBER",&ant_num}, + {"ANT_DISTANCE",&ant_distance}, + {NULL,0} + }; + + + + //DBG_871X("===>Hal_ParseAntIsolationConfigFile()\n" ); + + ptmp = buffer; + for (szLine = GetLineFromBuffer(ptmp); szLine != NULL; szLine = GetLineFromBuffer(ptmp)) + { + // skip comment + if ( IsCommentString( szLine ) ) { + continue; + } + + //DBG_871X("%s : szLine = %s , strlen(szLine) = %d \n", __FUNCTION__,szLine,strlen(szLine)); + for ( j=0 ;ant_isolation_param[j].param_name != NULL ; j++ ) + { + if ( strstr(szLine,ant_isolation_param[j].param_name)!= NULL ) + { + i=0; + while ( i < strlen(szLine) ) + { + if (szLine[i] != '"') + ++i; + else + { + // skip only has one " + if( strpbrk(szLine, "\"") == strrchr(szLine, '"')) + { + DBG_871X("Fail to parse parameters , format error!\n"); + break; + } + _rtw_memset( ( PVOID ) param_value_string, 0, 10 ); + if ( ! ParseQualifiedString( szLine, &i, param_value_string, '"' , '"' ) ) { + DBG_871X("Fail to parse parameters \n"); + return _FAIL; + } + else + { + GetU1ByteIntegerFromStringInDecimal( param_value_string, ant_isolation_param[j].value ); + } + break; + } + } + } + } + } + + // YiWei 20140716 , for BT coex antenna isolation control + if ( ant_num==3 && ant_distance>=50) + { + pHalData->EEPROMBluetoothCoexist = 0; + anttype = 4; + } + else if ( ant_num==2 && ant_distance>=50 ) + { + anttype = 3; + } + else if ( ant_num==3 && ant_distance>=15 && ant_distance<50 ) + { + anttype = 2; + } + else if ( ant_num==2 && ant_distance>=15 && ant_distance<50 ) + { + anttype = 1; + } + else if ( (ant_num==2 && ant_distance<15) || (ant_num==3 && ant_distance<15)) + { + anttype = 0; + } + else + { + pHalData->EEPROMBluetoothCoexist = 1; + anttype = 1; + } + + hal_btcoex_SetAntIsolationType(Adapter, anttype); + + DBG_871X("%s : ant_num = %d \n", __FUNCTION__,ant_num); + DBG_871X("%s : ant_distance = %d \n", __FUNCTION__,ant_distance); + //DBG_871X("<===Hal_ParseAntIsolationConfigFile()\n"); + return rtStatus; +} + + +int +hal_btcoex_AntIsolationConfig_ParaFile( + IN PADAPTER Adapter, + IN char* pFileName +) +{ + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + int rlen = 0, rtStatus = _FAIL; + //char para_file_path[1024]; + + //if(!(Adapter->registrypriv.load_phy_file & LOAD_RF_TXPWR_LMT_PARA_FILE)) + // return rtStatus; + + _rtw_memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN); + + + rtw_merge_string(para_file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); + + if (rtw_is_file_readable(para_file_path) == _TRUE) + { + rlen = rtw_retrive_from_file(para_file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); + if (rlen > 0) + { + rtStatus = _SUCCESS; + } + } + + + if(rtStatus == _SUCCESS) + { + //DBG_871X("%s(): read %s ok\n", __FUNCTION__, pFileName); + rtStatus = hal_btcoex_ParseAntIsolationConfigFile( Adapter, pHalData->para_file_buf ); + } + else + { + DBG_871X("%s(): No File %s, Load from *** Array!\n", __FUNCTION__, pFileName); + } + + return rtStatus; +} +#endif // CONFIG_LOAD_PHY_PARA_FROM_FILE #endif // CONFIG_BT_COEXIST diff --git a/backports/drivers/realtek/rtl8812au/hal/hal_com.c b/backports/drivers/realtek/rtl8812au/hal/hal_com.c index ec2cbac345ed4e..b46aa5878fd3cb 100755 --- a/backports/drivers/realtek/rtl8812au/hal/hal_com.c +++ b/backports/drivers/realtek/rtl8812au/hal/hal_com.c @@ -20,9 +20,45 @@ #define _HAL_COM_C_ #include +#include "hal_com_h2c.h" -#include "../hal/OUTSRC/odm_precomp.h" +#include "hal_data.h" +//#define CONFIG_GTK_OL_DBG + +#ifdef CONFIG_LOAD_PHY_PARA_FROM_FILE +char para_file_path[PATH_LENGTH_MAX]; +#endif + +u8 rtw_hal_data_init(_adapter *padapter) +{ + if(is_primary_adapter(padapter)) + { + padapter->hal_data_sz = sizeof(HAL_DATA_TYPE); + padapter->HalData = rtw_zvmalloc(padapter->hal_data_sz); + if(padapter->HalData == NULL){ + DBG_8192C("cant not alloc memory for HAL DATA \n"); + return _FAIL; + } + } + return _SUCCESS; +} + +void rtw_hal_data_deinit(_adapter *padapter) +{ + if(is_primary_adapter(padapter)) + { + if (padapter->HalData) + { + #ifdef CONFIG_LOAD_PHY_PARA_FROM_FILE + phy_free_filebuf(padapter); + #endif + rtw_vmfree(padapter->HalData, padapter->hal_data_sz); + padapter->HalData = NULL; + padapter->hal_data_sz = 0; + } + } +} void dump_chip_info(HAL_VERSION ChipVersion) { @@ -436,7 +472,7 @@ _TwoOutPipeMapping( // BK, BE, VI, VO, BCN, CMD,MGT,HIGH,HCCA //{ 0, 1, 0, 1, 0, 0, 0, 0, 0 }; - //0:H, 1:N + //0:ep_0 num, 1:ep_1 num pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[1];//VO pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[0];//VI @@ -454,7 +490,7 @@ _TwoOutPipeMapping( //BK, BE, VI, VO, BCN, CMD,MGT,HIGH,HCCA //{ 1, 1, 0, 0, 0, 0, 0, 0, 0 }; - //0:H, 1:N + //0:ep_0 num, 1:ep_1 num pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[0];//VO pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[0];//VI @@ -791,6 +827,7 @@ void rtw_hal_update_sta_rate_mask(PADAPTER padapter, struct sta_info *psta) //n mode ra_bitmap if(psta->htpriv.ht_option) { + rf_type = RF_1T1R; rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type)); if(rf_type == RF_2T2R) limit=16;// 2R @@ -927,6 +964,14 @@ void hw_var_port_switch(_adapter *adapter) rtw_write8(adapter, REG_BSSID1+i, bssid[i]); /* write bcn ctl */ +#ifdef CONFIG_BT_COEXIST +#if defined(CONFIG_RTL8723A) || defined(CONFIG_RTL8723B) + // always enable port0 beacon function for PSTDMA + bcn_ctrl_1 |= EN_BCN_FUNCTION; + // always disable port1 beacon function for PSTDMA + bcn_ctrl &= ~EN_BCN_FUNCTION; +#endif +#endif rtw_write8(adapter, REG_BCN_CTRL, bcn_ctrl_1); rtw_write8(adapter, REG_BCN_CTRL_1, bcn_ctrl); @@ -1000,444 +1045,5774 @@ void hw_var_port_switch(_adapter *adapter) #endif /* CONFIG_CONCURRENT_MODE */ } -void SetHwReg(_adapter *adapter, u8 variable, u8 *val) +void rtw_hal_set_FwRsvdPage_cmd(PADAPTER padapter, PRSVDPAGE_LOC rsvdpageloc) { - HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter); - DM_ODM_T *odm = &(hal_data->odmpriv); + struct hal_ops *pHalFunc = &padapter->HalFunc; + u8 u1H2CRsvdPageParm[H2C_RSVDPAGE_LOC_LEN]={0}; + u8 ret = 0; + + DBG_871X("RsvdPageLoc: ProbeRsp=%d PsPoll=%d Null=%d QoSNull=%d BTNull=%d\n", + rsvdpageloc->LocProbeRsp, rsvdpageloc->LocPsPoll, + rsvdpageloc->LocNullData, rsvdpageloc->LocQosNull, + rsvdpageloc->LocBTQosNull); + + SET_H2CCMD_RSVDPAGE_LOC_PROBE_RSP(u1H2CRsvdPageParm, rsvdpageloc->LocProbeRsp); + SET_H2CCMD_RSVDPAGE_LOC_PSPOLL(u1H2CRsvdPageParm, rsvdpageloc->LocPsPoll); + SET_H2CCMD_RSVDPAGE_LOC_NULL_DATA(u1H2CRsvdPageParm, rsvdpageloc->LocNullData); + SET_H2CCMD_RSVDPAGE_LOC_QOS_NULL_DATA(u1H2CRsvdPageParm, rsvdpageloc->LocQosNull); + SET_H2CCMD_RSVDPAGE_LOC_BT_QOS_NULL_DATA(u1H2CRsvdPageParm, rsvdpageloc->LocBTQosNull); + + if (pHalFunc->fill_h2c_cmd != NULL) { + ret = pHalFunc->fill_h2c_cmd(padapter, + H2C_RSVD_PAGE, + H2C_RSVDPAGE_LOC_LEN, + u1H2CRsvdPageParm); + } else { + DBG_871X("%s: Please hook fill_h2c_cmd first!\n", __func__); + ret = _FAIL; + } +} -_func_enter_; +#ifdef CONFIG_GPIO_WAKEUP +/* + * Switch GPIO_13, GPIO_14 to wlan control, or pull GPIO_13,14 MUST fail. + * It happended at 8723B/8192E/8821A. New IC will check multi function GPIO, + * and implement HAL function. + */ +static void rtw_hal_switch_gpio_wl_ctrl(_adapter* padapter, u8 index, u8 enable) +{ + if (index !=13 && index != 14) return; - switch (variable) { - case HW_VAR_PORT_SWITCH: - hw_var_port_switch(adapter); - break; - case HW_VAR_DM_FLAG: - odm->SupportAbility = *((u32*)val); - break; - case HW_VAR_DM_FUNC_OP: - if (*((u8*)val) == _TRUE) { - /* save dm flag */ - odm->BK_SupportAbility = odm->SupportAbility; + rtw_hal_set_hwreg(padapter, HW_SET_GPIO_WL_CTRL, (u8 *)(&enable)); +} + +static void rtw_hal_set_output_gpio(_adapter* padapter, u8 index, u8 outputval) +{ + if ( index <= 7 ) { + /* config GPIO mode */ + rtw_write8(padapter, REG_GPIO_PIN_CTRL + 3, + rtw_read8(padapter, REG_GPIO_PIN_CTRL + 3) & ~BIT(index) ); + + /* config GPIO Sel */ + /* 0: input */ + /* 1: output */ + rtw_write8(padapter, REG_GPIO_PIN_CTRL + 2, + rtw_read8(padapter, REG_GPIO_PIN_CTRL + 2) | BIT(index)); + + /* set output value */ + if ( outputval ) { + rtw_write8(padapter, REG_GPIO_PIN_CTRL + 1, + rtw_read8(padapter, REG_GPIO_PIN_CTRL + 1) | BIT(index)); } else { - /* restore dm flag */ - odm->SupportAbility = odm->BK_SupportAbility; + rtw_write8(padapter, REG_GPIO_PIN_CTRL + 1, + rtw_read8(padapter, REG_GPIO_PIN_CTRL + 1) & ~BIT(index)); } - break; - case HW_VAR_DM_FUNC_SET: - if(*((u32*)val) == DYNAMIC_ALL_FUNC_ENABLE){ - struct dm_priv *dm = &hal_data->dmpriv; - dm->DMFlag = dm->InitDMFlag; - odm->SupportAbility = dm->InitODMFlag; + } else if (index <= 15){ + /* 88C Series: */ + /* index: 11~8 transform to 3~0 */ + /* 8723 Series: */ + /* index: 12~8 transform to 4~0 */ + + index -= 8; + + /* config GPIO mode */ + rtw_write8(padapter, REG_GPIO_PIN_CTRL_2 + 3, + rtw_read8(padapter, REG_GPIO_PIN_CTRL_2 + 3) & ~BIT(index) ); + + /* config GPIO Sel */ + /* 0: input */ + /* 1: output */ + rtw_write8(padapter, REG_GPIO_PIN_CTRL_2 + 2, + rtw_read8(padapter, REG_GPIO_PIN_CTRL_2 + 2) | BIT(index)); + + /* set output value */ + if ( outputval ) { + rtw_write8(padapter, REG_GPIO_PIN_CTRL_2 + 1, + rtw_read8(padapter, REG_GPIO_PIN_CTRL_2 + 1) | BIT(index)); } else { - odm->SupportAbility |= *((u32 *)val); + rtw_write8(padapter, REG_GPIO_PIN_CTRL_2 + 1, + rtw_read8(padapter, REG_GPIO_PIN_CTRL_2 + 1) & ~BIT(index)); } - break; - case HW_VAR_DM_FUNC_CLR: - /* - * input is already a mask to clear function - * don't invert it again! George,Lucas@20130513 - */ - odm->SupportAbility &= *((u32 *)val); - break; - default: - if (0) - DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" variable(%d) not defined!\n", - FUNC_ADPT_ARG(adapter), variable); - break; + } else { + DBG_871X("%s: invalid GPIO%d=%d\n", + __FUNCTION__, index, outputval); } +} +#endif -_func_exit_; +void rtw_hal_set_FwAoacRsvdPage_cmd(PADAPTER padapter, PRSVDPAGE_LOC rsvdpageloc) +{ + struct hal_ops *pHalFunc = &padapter->HalFunc; + struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + u8 res = 0, count = 0, ret = 0; +#ifdef CONFIG_WOWLAN + u8 u1H2CAoacRsvdPageParm[H2C_AOAC_RSVDPAGE_LOC_LEN]={0}; + + DBG_871X("AOACRsvdPageLoc: RWC=%d ArpRsp=%d NbrAdv=%d GtkRsp=%d GtkInfo=%d ProbeReq=%d NetworkList=%d\n", + rsvdpageloc->LocRemoteCtrlInfo, rsvdpageloc->LocArpRsp, + rsvdpageloc->LocNbrAdv, rsvdpageloc->LocGTKRsp, + rsvdpageloc->LocGTKInfo, rsvdpageloc->LocProbeReq, + rsvdpageloc->LocNetList); + + if (check_fwstate(pmlmepriv, _FW_LINKED)) { + SET_H2CCMD_AOAC_RSVDPAGE_LOC_REMOTE_WAKE_CTRL_INFO(u1H2CAoacRsvdPageParm, rsvdpageloc->LocRemoteCtrlInfo); + SET_H2CCMD_AOAC_RSVDPAGE_LOC_ARP_RSP(u1H2CAoacRsvdPageParm, rsvdpageloc->LocArpRsp); + //SET_H2CCMD_AOAC_RSVDPAGE_LOC_NEIGHBOR_ADV(u1H2CAoacRsvdPageParm, rsvdpageloc->LocNbrAdv); + SET_H2CCMD_AOAC_RSVDPAGE_LOC_GTK_RSP(u1H2CAoacRsvdPageParm, rsvdpageloc->LocGTKRsp); + SET_H2CCMD_AOAC_RSVDPAGE_LOC_GTK_INFO(u1H2CAoacRsvdPageParm, rsvdpageloc->LocGTKInfo); +#ifdef CONFIG_GTK_OL + SET_H2CCMD_AOAC_RSVDPAGE_LOC_GTK_EXT_MEM(u1H2CAoacRsvdPageParm, rsvdpageloc->LocGTKEXTMEM); +#endif // CONFIG_GTK_OL + if (pHalFunc->fill_h2c_cmd != NULL) { + ret = pHalFunc->fill_h2c_cmd(padapter, + H2C_AOAC_RSVD_PAGE, + H2C_AOAC_RSVDPAGE_LOC_LEN, + u1H2CAoacRsvdPageParm); + } else { + DBG_871X("%s: Please hook fill_h2c_cmd first!\n", __func__); + ret = _FAIL; + } + } +#ifdef CONFIG_PNO_SUPPORT + else + { + + if(!pwrpriv->pno_in_resume) { + DBG_871X("NLO_INFO=%d\n", rsvdpageloc->LocPNOInfo); + _rtw_memset(&u1H2CAoacRsvdPageParm, 0, + sizeof(u1H2CAoacRsvdPageParm)); + SET_H2CCMD_AOAC_RSVDPAGE_LOC_NLO_INFO(u1H2CAoacRsvdPageParm, + rsvdpageloc->LocPNOInfo); + if (pHalFunc->fill_h2c_cmd != NULL) { + ret = pHalFunc->fill_h2c_cmd(padapter, + H2C_AOAC_RSVDPAGE3, + H2C_AOAC_RSVDPAGE_LOC_LEN, + u1H2CAoacRsvdPageParm); + } else { + DBG_871X("%s: Please hook fill_h2c_cmd first!\n", __func__); + ret = _FAIL; + } + } + } +#endif //CONFIG_PNO_SUPPORT +#endif // CONFIG_WOWLAN } -void GetHwReg(_adapter *adapter, u8 variable, u8 *val) +#ifdef CONFIG_WOWLAN +// rtw_hal_check_wow_ctrl +// chk_type: _TRUE means to check enable, if 0x690 & bit1, WOW enable successful +// _FALSE means to check disable, if 0x690 & bit1, WOW disable fail +static u8 rtw_hal_check_wow_ctrl(_adapter* adapter, u8 chk_type) { - HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter); - DM_ODM_T *odm = &(hal_data->odmpriv); + u8 mstatus = 0; + u8 trycnt = 25; + u8 res = _FALSE; + + mstatus = rtw_read8(adapter, REG_WOW_CTRL); + DBG_871X_LEVEL(_drv_info_, "%s mstatus:0x%02x\n", __func__, mstatus); + + if (chk_type) { + while(!(mstatus&BIT1) && trycnt>1) { + mstatus = rtw_read8(adapter, REG_WOW_CTRL); + DBG_871X_LEVEL(_drv_always_, + "Loop index: %d :0x%02x\n", + trycnt, mstatus); + trycnt --; + rtw_msleep_os(2); + } + if (mstatus & BIT1) + res = _TRUE; + else + res = _FALSE; + } else { + while (mstatus&BIT1 && trycnt>1) { + mstatus = rtw_read8(adapter, REG_WOW_CTRL); + DBG_871X_LEVEL(_drv_always_, + "Loop index: %d :0x%02x\n", + trycnt, mstatus); + trycnt --; + rtw_msleep_os(2); + } -_func_enter_; + if (mstatus & BIT1) + res = _FALSE; + else + res = _TRUE; + } + DBG_871X_LEVEL(_drv_always_, "%s check_type: %d res: %d trycnt: %d\n", + __func__, chk_type, res, (25 - trycnt)); + return res; +} - switch (variable) { - case HW_VAR_BASIC_RATE: - *((u16*)val) = hal_data->BasicRateSet; - break; - case HW_VAR_DM_FLAG: - *((u32*)val) = odm->SupportAbility; - break; - case HW_VAR_RF_TYPE: - *((u8*)val) = hal_data->rf_type; - break; - default: - if (0) - DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" variable(%d) not defined!\n", - FUNC_ADPT_ARG(adapter), variable); - break; +#ifdef CONFIG_PNO_SUPPORT +static u8 rtw_hal_check_pno_enabled(_adapter* adapter) +{ + struct pwrctrl_priv *ppwrpriv = adapter_to_pwrctl(adapter); + u8 res = 0, count = 0; + u8 ret = _FALSE; + if (ppwrpriv->wowlan_pno_enable && ppwrpriv->pno_in_resume == _FALSE) { + res = rtw_read8(adapter, REG_PNO_STATUS); + while(!(res&BIT(7)) && count < 25) { + DBG_871X("[%d] cmd: 0x81 REG_PNO_STATUS: 0x%02x\n", + count, res); + res = rtw_read8(adapter, REG_PNO_STATUS); + count++; + rtw_msleep_os(2); + } + if (res & BIT(7)) + ret = _TRUE; + else + ret = _FALSE; + DBG_871X("cmd: 0x81 REG_PNO_STATUS: ret(%d)\n", ret); } + return ret; +} +#endif -_func_exit_; +static void rtw_hal_force_enable_rxdma(_adapter* adapter) +{ + DBG_871X("%s: Set 0x690=0x00\n", __func__); + rtw_write8(adapter, REG_WOW_CTRL, + (rtw_read8(adapter, REG_WOW_CTRL)&0xf0)); + DBG_871X_LEVEL(_drv_always_, "%s: Release RXDMA\n", __func__); + rtw_write32(adapter, REG_RXPKT_NUM, + (rtw_read32(adapter,REG_RXPKT_NUM)&(~RW_RELEASE_EN))); } -u8 -SetHalDefVar(_adapter *adapter, HAL_DEF_VARIABLE variable, void *value) +static void rtw_hal_disable_tx_report(_adapter* adapter) { - HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter); - DM_ODM_T *odm = &(hal_data->odmpriv); - u8 bResult = _SUCCESS; + rtw_write8(adapter, REG_TX_RPT_CTRL, + ((rtw_read8(adapter, REG_TX_RPT_CTRL)&~BIT(1)))&~BIT(5)); + DBG_871X("disable TXRPT:0x%02x\n", rtw_read8(adapter, REG_TX_RPT_CTRL)); +} - switch(variable) { - case HW_DEF_FA_CNT_DUMP: - if(*((u8*)value)) - odm->DebugComponents |= (ODM_COMP_DIG |ODM_COMP_FA_CNT); - else - odm->DebugComponents &= ~(ODM_COMP_DIG |ODM_COMP_FA_CNT); - break; - case HW_DEF_ODM_DBG_FLAG: - ODM_CmnInfoUpdate(odm, ODM_CMNINFO_DBG_COMP, *((u8Byte*)value)); - break; - case HW_DEF_ODM_DBG_LEVEL: - ODM_CmnInfoUpdate(odm, ODM_CMNINFO_DBG_LEVEL, *((u4Byte*)value)); - break; - case HAL_DEF_DBG_DM_FUNC: - { - u8 dm_func = *((u8*)value); - struct dm_priv *dm = &hal_data->dmpriv; +static void rtw_hal_enable_tx_report(_adapter* adapter) +{ + rtw_write8(adapter, REG_TX_RPT_CTRL, + ((rtw_read8(adapter, REG_TX_RPT_CTRL)|BIT(1)))|BIT(5)); + DBG_871X("enable TX_RPT:0x%02x\n", rtw_read8(adapter, REG_TX_RPT_CTRL)); +} - if(dm_func == 0){ //disable all dynamic func - odm->SupportAbility = DYNAMIC_FUNC_DISABLE; - DBG_8192C("==> Disable all dynamic function...\n"); - } - else if(dm_func == 1){//disable DIG - odm->SupportAbility &= (~DYNAMIC_BB_DIG); - DBG_8192C("==> Disable DIG...\n"); - } - else if(dm_func == 2){//disable High power - odm->SupportAbility &= (~DYNAMIC_BB_DYNAMIC_TXPWR); - } - else if(dm_func == 3){//disable tx power tracking - odm->SupportAbility &= (~DYNAMIC_RF_CALIBRATION); - DBG_8192C("==> Disable tx power tracking...\n"); - } - else if(dm_func == 4){//disable BT coexistence - dm->DMFlag &= (~DYNAMIC_FUNC_BT); - } - else if(dm_func == 5){//disable antenna diversity - odm->SupportAbility &= (~DYNAMIC_BB_ANT_DIV); +static void rtw_hal_backup_rate(_adapter* adapter) +{ + DBG_871X("%s\n", __func__); + //backup data rate to register 0x8b for wowlan FW + rtw_write8(adapter, 0x8d, 1); + rtw_write8(adapter, 0x8c, 0); + rtw_write8(adapter, 0x8f, 0x40); + rtw_write8(adapter, 0x8b, rtw_read8(adapter, 0x2f0)); +} + +static u8 rtw_hal_pause_rx_dma(_adapter* adapter) +{ + u8 ret = 0; + u8 trycnt = 100; + u16 len = 0; + u32 tmp = 0; + int res = 0; + //RX DMA stop + DBG_871X_LEVEL(_drv_always_, "Pause DMA\n"); + rtw_write32(adapter, REG_RXPKT_NUM, + (rtw_read32(adapter,REG_RXPKT_NUM)|RW_RELEASE_EN)); + do{ + if((rtw_read32(adapter, REG_RXPKT_NUM)&RXDMA_IDLE)) { + DBG_871X_LEVEL(_drv_always_, "RX_DMA_IDLE is true\n"); + ret = _SUCCESS; + break; } - else if(dm_func == 6){//turn on all dynamic func - if(!(odm->SupportAbility & DYNAMIC_BB_DIG)) { - DIG_T *pDigTable = &odm->DM_DigTable; - pDigTable->CurIGValue= rtw_read8(adapter, 0xc50); - } - dm->DMFlag |= DYNAMIC_FUNC_BT; - odm->SupportAbility = DYNAMIC_ALL_FUNC_ENABLE; - DBG_8192C("==> Turn on all dynamic function...\n"); +#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) + else { + // If RX_DMA is not idle, receive one pkt from DMA + res = sdio_local_read(adapter, + SDIO_REG_RX0_REQ_LEN, 4, (u8*)&tmp); + len = le16_to_cpu(tmp); + DBG_871X_LEVEL(_drv_always_, "RX len:%d\n", len); + + if (len > 0) + res = RecvOnePkt(adapter, len); + else + DBG_871X_LEVEL(_drv_always_, "read length fail %d\n", len); + + DBG_871X_LEVEL(_drv_always_, "RecvOnePkt Result: %d\n", res); } - } - break; - case HAL_DEF_ANT_DETECT: - hal_data->AntDetection = *((u8 *)value); - break; - default: - DBG_871X_LEVEL(_drv_always_, "%s: [WARNING] HAL_DEF_VARIABLE(%d) not defined!\n", __FUNCTION__, variable); - bResult = _FAIL; - break; +#endif //CONFIG_SDIO_HCI || CONFIG_GSPI_HCI + }while(trycnt--); + + if(trycnt ==0) { + DBG_871X_LEVEL(_drv_always_, "Stop RX DMA failed...... \n"); + ret = _FAIL; } - return bResult; + return ret; } -u8 -GetHalDefVar(_adapter *adapter, HAL_DEF_VARIABLE variable, void *value) +#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) +static u8 rtw_hal_enable_cpwm2(_adapter* adapter) { - HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter); - DM_ODM_T *odm = &(hal_data->odmpriv); - u8 bResult = _SUCCESS; + u8 ret = 0; + int res = 0; + u32 tmp = 0; - switch(variable) { - case HW_DEF_ODM_DBG_FLAG: - *((u8Byte*)value) = odm->DebugComponents; - break; - case HW_DEF_ODM_DBG_LEVEL: - *((u4Byte*)value) = odm->DebugLevel; - break; - case HAL_DEF_DBG_DM_FUNC: - *(( u32*)value) =hal_data->odmpriv.SupportAbility; - break; - case HAL_DEF_ANT_DETECT: - *((u8 *)value) = hal_data->AntDetection; - break; - case HAL_DEF_MACID_SLEEP: - *(u8*)value = _FALSE; - break; - case HAL_DEF_TX_PAGE_SIZE: - *(( u32*)value) = PAGE_SIZE_128; - break; - default: - DBG_871X_LEVEL(_drv_always_, "%s: [WARNING] HAL_DEF_VARIABLE(%d) not defined!\n", __FUNCTION__, variable); - bResult = _FAIL; - break; + DBG_871X_LEVEL(_drv_always_, "%s\n", __func__); + + res = sdio_local_read(adapter, SDIO_REG_HIMR, 4, (u8*)&tmp); + if (!res) + DBG_871X_LEVEL(_drv_info_, "read SDIO_REG_HIMR: 0x%08x\n", tmp); + else + DBG_871X_LEVEL(_drv_info_, "sdio_local_read fail\n"); + + tmp = SDIO_HIMR_CPWM2_MSK; + + res = sdio_local_write(adapter, SDIO_REG_HIMR, 4, (u8*)&tmp); + + if (!res){ + res = sdio_local_read(adapter, SDIO_REG_HIMR, 4, (u8*)&tmp); + DBG_871X_LEVEL(_drv_info_, "read again SDIO_REG_HIMR: 0x%08x\n", tmp); + ret = _SUCCESS; + }else { + DBG_871X_LEVEL(_drv_info_, "sdio_local_write fail\n"); + ret = _FAIL; } - return bResult; + return ret; } +#endif //CONFIG_SDIO_HCI, CONFIG_GSPI_HCI -BOOLEAN -eqNByte( - u8* str1, - u8* str2, - u32 num - ) +#ifdef CONFIG_GTK_OL +static void rtw_hal_fw_sync_cam_id(_adapter* adapter) { - if(num==0) - return _FALSE; - while(num>0) - { - num--; - if(str1[num]!=str2[num]) - return _FALSE; + struct security_priv *psecuritypriv = &adapter->securitypriv; + u8 null_addr[] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; + int cam_id; + u32 algorithm = 0; + u16 ctrl = 0; + u8 *addr; + u8 index = 0; + u8 get_key[16]; + + addr = get_bssid(&adapter->mlmepriv); + + if (addr == NULL) { + DBG_871X("%s: get bssid MAC addr fail!!\n", __func__); + return; } - return _TRUE; + + do{ + cam_id = rtw_camid_search(adapter, addr, index); + if (cam_id == -1) { + DBG_871X("%s: cam_id: %d, key_id:%d\n", + __func__, cam_id, index); + } else if (rtw_camid_is_gk(adapter, cam_id) != _TRUE) { + DBG_871X("%s: cam_id: %d key_id(%d) is not GK\n", + __func__, cam_id, index); + } else { + read_cam(adapter ,cam_id, get_key); + algorithm = psecuritypriv->dot11PrivacyAlgrthm; + ctrl = BIT(15) | BIT6 |(algorithm << 2) | index; + write_cam(adapter, index, ctrl, addr, get_key); + ctrl = 0; + write_cam(adapter, cam_id, ctrl, null_addr, get_key); + } + index++; + }while(index < 4); + + rtw_write8(adapter, REG_SECCFG, 0xcc); } -// -// Description: -// Return TRUE if chTmp is represent for hex digit and -// FALSE otherwise. -// -// -BOOLEAN -IsHexDigit( - IN char chTmp -) +static void rtw_hal_update_gtk_offload_info(_adapter* adapter) { - if( (chTmp >= '0' && chTmp <= '9') || - (chTmp >= 'a' && chTmp <= 'f') || - (chTmp >= 'A' && chTmp <= 'F') ) - { - return _TRUE; + struct security_priv *psecuritypriv = &adapter->securitypriv; + u8 defualt_cam_id=0; + u8 cam_id=5; + u8 *addr; + u8 null_addr[] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; + u8 gtk_keyindex=0; + u8 get_key[16]; + u8 index = 1; + u16 ctrl = 0; + u32 algorithm = 0; + + addr = get_bssid(&adapter->mlmepriv); + + if (addr == NULL) { + DBG_871X("%s: get bssid MAC addr fail!!\n", __func__); + return; } - else - { - return _FALSE; + + _rtw_memset(get_key, 0, sizeof(get_key)); + + algorithm = psecuritypriv->dot11PrivacyAlgrthm; + + if(psecuritypriv->binstallKCK_KEK == _TRUE) { + + //read gtk key index + gtk_keyindex = rtw_read8(adapter, 0x48c); + do{ + //chech if GK + if(read_phy_cam_is_gtk(adapter, defualt_cam_id) == _TRUE) + { + read_cam(adapter ,defualt_cam_id, get_key); + algorithm = psecuritypriv->dot11PrivacyAlgrthm; + //in defualt cam entry, cam id = key id + ctrl = BIT(15) | BIT6 |(algorithm << 2) | defualt_cam_id; + write_cam(adapter, cam_id, ctrl, addr, get_key); + cam_id++; + ctrl = 0; + write_cam(adapter, defualt_cam_id, ctrl, null_addr, get_key); + } + + if (gtk_keyindex < 4 &&(defualt_cam_id == gtk_keyindex)) { + psecuritypriv->dot118021XGrpKeyid = gtk_keyindex; + _rtw_memcpy(psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey, + get_key, 16); + + DBG_871X_LEVEL(_drv_always_, "GTK (%d) = 0x%08x, 0x%08x, 0x%08x, 0x%08x\n", + gtk_keyindex, + psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].lkey[0], + psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].lkey[1], + psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].lkey[2], + psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].lkey[3]); + } + defualt_cam_id++; + }while(defualt_cam_id < 4); + + rtw_write8(adapter, REG_SECCFG, 0x0c); +#ifdef CONFIG_GTK_OL_DBG + //if (gtk_keyindex != 5) + dump_cam_table(adapter); +#endif } } +#endif - -// -// Description: -// Translate a character to hex digit. -// -u32 -MapCharToHexDigit( - IN char chTmp -) +static void rtw_hal_update_tx_iv(_adapter* adapter) { - if(chTmp >= '0' && chTmp <= '9') - return (chTmp - '0'); - else if(chTmp >= 'a' && chTmp <= 'f') - return (10 + (chTmp - 'a')); - else if(chTmp >= 'A' && chTmp <= 'F') - return (10 + (chTmp - 'A')); - else - return 0; + struct pwrctrl_priv *pwrctl = adapter_to_pwrctl(adapter); + u64 iv_low = 0, iv_high = 0; + + // 3.1 read fw iv + iv_low = rtw_read32(adapter, REG_TXPKTBUF_IV_LOW); + //only low two bytes is PN, check AES_IV macro for detail + iv_low &= 0xffff; + iv_high = rtw_read32(adapter, REG_TXPKTBUF_IV_HIGH); + //get the real packet number + pwrctl->wowlan_fw_iv = iv_high << 16 | iv_low; + DBG_871X_LEVEL(_drv_always_, + "fw_iv: 0x%016llx\n", pwrctl->wowlan_fw_iv); + //Update TX iv data. + rtw_set_sec_pn(adapter); } +static u8 rtw_hal_set_keep_alive_cmd(_adapter *adapter, u8 enable, u8 pkt_type) +{ + struct hal_ops *pHalFunc = &adapter->HalFunc; + + u8 u1H2CKeepAliveParm[H2C_KEEP_ALIVE_CTRL_LEN]={0}; + u8 adopt = 1, check_period = 5; + u8 ret = _FAIL; + + DBG_871X("%s(): enable = %d\n", __func__, enable); + SET_H2CCMD_KEEPALIVE_PARM_ENABLE(u1H2CKeepAliveParm, enable); + SET_H2CCMD_KEEPALIVE_PARM_ADOPT(u1H2CKeepAliveParm, adopt); + SET_H2CCMD_KEEPALIVE_PARM_PKT_TYPE(u1H2CKeepAliveParm, pkt_type); + SET_H2CCMD_KEEPALIVE_PARM_CHECK_PERIOD(u1H2CKeepAliveParm, check_period); + + if (pHalFunc->fill_h2c_cmd != NULL) { + ret = pHalFunc->fill_h2c_cmd(adapter, + H2C_KEEP_ALIVE, + H2C_KEEP_ALIVE_CTRL_LEN, + u1H2CKeepAliveParm); + } else { + DBG_871X("%s: Please hook fill_h2c_cmd first!\n", __func__); + ret = _FAIL; + } + return ret; +} -// -// Description: +static u8 rtw_hal_set_disconnect_decision_cmd(_adapter *adapter, u8 enable) +{ + struct hal_ops *pHalFunc = &adapter->HalFunc; + u8 u1H2CDisconDecisionParm[H2C_DISCON_DECISION_LEN]={0}; + u8 adopt = 1, check_period = 10, trypkt_num = 0; + u8 ret = _FAIL; + + DBG_871X("%s(): enable = %d\n", __func__, enable); + SET_H2CCMD_DISCONDECISION_PARM_ENABLE(u1H2CDisconDecisionParm, enable); + SET_H2CCMD_DISCONDECISION_PARM_ADOPT(u1H2CDisconDecisionParm, adopt); + SET_H2CCMD_DISCONDECISION_PARM_CHECK_PERIOD(u1H2CDisconDecisionParm, check_period); + SET_H2CCMD_DISCONDECISION_PARM_TRY_PKT_NUM(u1H2CDisconDecisionParm, trypkt_num); + + if (pHalFunc->fill_h2c_cmd != NULL) { + ret = pHalFunc->fill_h2c_cmd(adapter, + H2C_DISCON_DECISION, + H2C_DISCON_DECISION_LEN, + u1H2CDisconDecisionParm); + } else { + DBG_871X("%s: Please hook fill_h2c_cmd first!\n", __func__); + ret = _FAIL; + } + + return ret; +} + +static u8 rtw_hal_set_ap_offload_ctrl_cmd(_adapter *adapter, u8 enable) +{ + struct hal_ops *pHalFunc = &adapter->HalFunc; + u8 u1H2CAPOffloadCtrlParm[H2C_WOWLAN_LEN]={0}; + u8 ret = _FAIL; + + DBG_871X("%s(): bFuncEn=%d\n", __func__, enable); + + SET_H2CCMD_AP_WOWLAN_EN(u1H2CAPOffloadCtrlParm, enable); + + if (pHalFunc->fill_h2c_cmd != NULL) { + ret = pHalFunc->fill_h2c_cmd(adapter, + H2C_AP_OFFLOAD, + H2C_AP_OFFLOAD_LEN, + u1H2CAPOffloadCtrlParm); + } else { + DBG_871X("%s: Please hook fill_h2c_cmd first!\n", __func__); + ret = _FAIL; + } + return ret; +} + +static u8 rtw_hal_set_ap_rsvdpage_loc_cmd(_adapter *adapter, + PRSVDPAGE_LOC rsvdpageloc) +{ + struct hal_ops *pHalFunc = &adapter->HalFunc; + u8 rsvdparm[H2C_AOAC_RSVDPAGE_LOC_LEN]={0}; + u8 ret = _FAIL, header = 0; + + if (pHalFunc->fill_h2c_cmd == NULL) { + DBG_871X("%s: Please hook fill_h2c_cmd first!\n", __func__); + return ret; + } + + header = rtw_read8(adapter, REG_BCNQ_BDNY); + + DBG_871X("%s: beacon: %d, probeRsp: %d, header:0x%02x\n", __func__, + rsvdpageloc->LocApOffloadBCN, + rsvdpageloc->LocProbeRsp, + header); + + SET_H2CCMD_AP_WOWLAN_RSVDPAGE_LOC_BCN(rsvdparm, + rsvdpageloc->LocApOffloadBCN + header); + + ret = pHalFunc->fill_h2c_cmd(adapter, H2C_BCN_RSVDPAGE, + H2C_BCN_RSVDPAGE_LEN, rsvdparm); + + if (ret == _FAIL) + DBG_871X("%s: H2C_BCN_RSVDPAGE cmd fail\n", __func__); + + _rtw_memset(&rsvdparm, 0, sizeof(rsvdparm)); + + SET_H2CCMD_AP_WOWLAN_RSVDPAGE_LOC_ProbeRsp(rsvdparm, + rsvdpageloc->LocProbeRsp + header); + + ret = pHalFunc->fill_h2c_cmd(adapter, H2C_PROBERSP_RSVDPAGE, + H2C_PROBERSP_RSVDPAGE_LEN, rsvdparm); + + if (ret == _FAIL) + DBG_871X("%s: H2C_PROBERSP_RSVDPAGE cmd fail\n", __func__); + + return ret; +} + +static u8 rtw_hal_set_wowlan_ctrl_cmd(_adapter *adapter, u8 enable) +{ + struct security_priv *psecpriv = &adapter->securitypriv; + struct pwrctrl_priv *ppwrpriv = adapter_to_pwrctl(adapter); + struct hal_ops *pHalFunc = &adapter->HalFunc; + + u8 u1H2CWoWlanCtrlParm[H2C_WOWLAN_LEN]={0}; + u8 discont_wake = 1, gpionum = 0, gpio_dur = 0; + u8 hw_unicast = 0, gpio_pulse_cnt=0; + u8 sdio_wakeup_enable = 1; + u8 gpio_high_active = 0; //0: low active, 1: high active + u8 magic_pkt = 0; + u8 ret = _FAIL; + +#ifdef CONFIG_GPIO_WAKEUP + gpionum = WAKEUP_GPIO_IDX; + sdio_wakeup_enable = 0; +#endif //CONFIG_GPIO_WAKEUP + + if (!ppwrpriv->wowlan_pno_enable) + magic_pkt = enable; + + if (psecpriv->dot11PrivacyAlgrthm == _WEP40_ || psecpriv->dot11PrivacyAlgrthm == _WEP104_) + hw_unicast = 1; + else + hw_unicast = 0; + + DBG_871X("%s(): enable=%d\n", __func__, enable); + + SET_H2CCMD_WOWLAN_FUNC_ENABLE(u1H2CWoWlanCtrlParm, enable); + SET_H2CCMD_WOWLAN_PATTERN_MATCH_ENABLE(u1H2CWoWlanCtrlParm, 0); + SET_H2CCMD_WOWLAN_MAGIC_PKT_ENABLE(u1H2CWoWlanCtrlParm, magic_pkt); + SET_H2CCMD_WOWLAN_UNICAST_PKT_ENABLE(u1H2CWoWlanCtrlParm, hw_unicast); + SET_H2CCMD_WOWLAN_ALL_PKT_DROP(u1H2CWoWlanCtrlParm, 0); + SET_H2CCMD_WOWLAN_GPIO_ACTIVE(u1H2CWoWlanCtrlParm, gpio_high_active); +#ifndef CONFIG_GTK_OL + SET_H2CCMD_WOWLAN_REKEY_WAKE_UP(u1H2CWoWlanCtrlParm, enable); +#endif + SET_H2CCMD_WOWLAN_DISCONNECT_WAKE_UP(u1H2CWoWlanCtrlParm, discont_wake); + SET_H2CCMD_WOWLAN_GPIONUM(u1H2CWoWlanCtrlParm, gpionum); + SET_H2CCMD_WOWLAN_DATAPIN_WAKE_UP(u1H2CWoWlanCtrlParm, sdio_wakeup_enable); + SET_H2CCMD_WOWLAN_GPIO_DURATION(u1H2CWoWlanCtrlParm, gpio_dur); +#ifdef CONFIG_PLATFORM_ARM_RK3188 + SET_H2CCMD_WOWLAN_GPIO_PULSE_EN(u1H2CWoWlanCtrlParm, 1); + SET_H2CCMD_WOWLAN_GPIO_PULSE_COUNT(u1H2CWoWlanCtrlParm, 0x04); +#else + SET_H2CCMD_WOWLAN_GPIO_PULSE_EN(u1H2CWoWlanCtrlParm, 0); + SET_H2CCMD_WOWLAN_GPIO_PULSE_COUNT(u1H2CWoWlanCtrlParm, gpio_pulse_cnt); +#endif + + if (pHalFunc->fill_h2c_cmd != NULL) { + ret = pHalFunc->fill_h2c_cmd(adapter, + H2C_WOWLAN, + H2C_WOWLAN_LEN, + u1H2CWoWlanCtrlParm); + } else { + DBG_871X("%s: Please hook fill_h2c_cmd first!\n", __func__); + ret = _FAIL; + } + return ret; +} + +static u8 rtw_hal_set_remote_wake_ctrl_cmd(_adapter *adapter, u8 enable) +{ + struct hal_ops *pHalFunc = &adapter->HalFunc; + struct security_priv* psecuritypriv=&(adapter->securitypriv); + struct pwrctrl_priv *ppwrpriv = adapter_to_pwrctl(adapter); + u8 u1H2CRemoteWakeCtrlParm[H2C_REMOTE_WAKE_CTRL_LEN]={0}; + u8 ret = _FAIL, count = 0; + + DBG_871X("%s(): enable=%d\n", __func__, enable); + + if (!ppwrpriv->wowlan_pno_enable) { + SET_H2CCMD_REMOTE_WAKECTRL_ENABLE( + u1H2CRemoteWakeCtrlParm, enable); + SET_H2CCMD_REMOTE_WAKE_CTRL_ARP_OFFLOAD_EN( + u1H2CRemoteWakeCtrlParm, 1); +#ifdef CONFIG_GTK_OL + if (psecuritypriv->binstallKCK_KEK == _TRUE && + psecuritypriv->dot11PrivacyAlgrthm == _AES_) { + SET_H2CCMD_REMOTE_WAKE_CTRL_GTK_OFFLOAD_EN( + u1H2CRemoteWakeCtrlParm, 1); + } else { + DBG_871X("no kck or security is not AES\n"); + SET_H2CCMD_REMOTE_WAKE_CTRL_GTK_OFFLOAD_EN( + u1H2CRemoteWakeCtrlParm, 0); + } +#endif //CONFIG_GTK_OL + + SET_H2CCMD_REMOTE_WAKE_CTRL_FW_UNICAST_EN( + u1H2CRemoteWakeCtrlParm, 1); + + /* + * filter NetBios name service pkt to avoid being waked-up + * by this kind of unicast pkt this exceptional modification + * is used for match competitor's behavior + */ + SET_H2CCMD_REMOTE_WAKE_CTRL_NBNS_FILTER_EN( + u1H2CRemoteWakeCtrlParm, 1); + + if ((psecuritypriv->dot11PrivacyAlgrthm == _AES_) || + (psecuritypriv->dot11PrivacyAlgrthm == _NO_PRIVACY_)) { + SET_H2CCMD_REMOTE_WAKE_CTRL_ARP_ACTION( + u1H2CRemoteWakeCtrlParm, 0); + } else { + SET_H2CCMD_REMOTE_WAKE_CTRL_ARP_ACTION( + u1H2CRemoteWakeCtrlParm, 1); + } + + SET_H2CCMD_REMOTE_WAKE_CTRL_FW_PARSING_UNTIL_WAKEUP( + u1H2CRemoteWakeCtrlParm, 1); + } +#ifdef CONFIG_PNO_SUPPORT + else { + SET_H2CCMD_REMOTE_WAKECTRL_ENABLE( + u1H2CRemoteWakeCtrlParm, enable); + SET_H2CCMD_REMOTE_WAKE_CTRL_NLO_OFFLOAD_EN( + u1H2CRemoteWakeCtrlParm, enable); + } +#endif + +#ifdef CONFIG_P2P_WOWLAN + if (_TRUE == ppwrpriv->wowlan_p2p_mode) + { + DBG_871X("P2P OFFLOAD ENABLE\n"); + SET_H2CCMD_REMOTE_WAKE_CTRL_P2P_OFFLAD_EN(u1H2CRemoteWakeCtrlParm,1); + } + else + { + DBG_871X("P2P OFFLOAD DISABLE\n"); + SET_H2CCMD_REMOTE_WAKE_CTRL_P2P_OFFLAD_EN(u1H2CRemoteWakeCtrlParm,0); + } +#endif //CONFIG_P2P_WOWLAN + + + if (pHalFunc->fill_h2c_cmd != NULL) { + ret = pHalFunc->fill_h2c_cmd(adapter, + H2C_REMOTE_WAKE_CTRL, + H2C_REMOTE_WAKE_CTRL_LEN, + u1H2CRemoteWakeCtrlParm); + } else { + DBG_871X("%s: Please hook fill_h2c_cmd first!\n", __func__); + ret = _FAIL; + } + return ret; +} + +static u8 rtw_hal_set_global_info_cmd(_adapter* adapter, u8 group_alg, u8 pairwise_alg) +{ + struct hal_ops *pHalFunc = &adapter->HalFunc; + u8 ret = _FAIL; + u8 u1H2CAOACGlobalInfoParm[H2C_AOAC_GLOBAL_INFO_LEN]={0}; + + DBG_871X("%s(): group_alg=%d pairwise_alg=%d\n", + __func__, group_alg, pairwise_alg); + SET_H2CCMD_AOAC_GLOBAL_INFO_PAIRWISE_ENC_ALG(u1H2CAOACGlobalInfoParm, + pairwise_alg); + SET_H2CCMD_AOAC_GLOBAL_INFO_GROUP_ENC_ALG(u1H2CAOACGlobalInfoParm, + group_alg); + + if (pHalFunc->fill_h2c_cmd != NULL) { + ret = pHalFunc->fill_h2c_cmd(adapter, + H2C_AOAC_GLOBAL_INFO, + H2C_AOAC_GLOBAL_INFO_LEN, + u1H2CAOACGlobalInfoParm); + } else { + DBG_871X("%s: Please hook fill_h2c_cmd first!\n", __func__); + ret = _FAIL; + } + + return ret; +} + +#ifdef CONFIG_PNO_SUPPORT +static u8 rtw_hal_set_scan_offload_info_cmd(_adapter* adapter, + PRSVDPAGE_LOC rsvdpageloc, u8 enable) +{ + struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(adapter); + struct hal_ops *pHalFunc = &adapter->HalFunc; + + u8 u1H2CScanOffloadInfoParm[H2C_SCAN_OFFLOAD_CTRL_LEN]={0}; + u8 res = 0, count = 0, ret = _FAIL; + + DBG_871X("%s: loc_probe_packet:%d, loc_scan_info: %d loc_ssid_info:%d\n", + __func__, rsvdpageloc->LocProbePacket, + rsvdpageloc->LocScanInfo, rsvdpageloc->LocSSIDInfo); + + SET_H2CCMD_AOAC_NLO_FUN_EN(u1H2CScanOffloadInfoParm, enable); + SET_H2CCMD_AOAC_NLO_IPS_EN(u1H2CScanOffloadInfoParm, enable); + SET_H2CCMD_AOAC_RSVDPAGE_LOC_SCAN_INFO(u1H2CScanOffloadInfoParm, + rsvdpageloc->LocScanInfo); + SET_H2CCMD_AOAC_RSVDPAGE_LOC_PROBE_PACKET(u1H2CScanOffloadInfoParm, + rsvdpageloc->LocProbePacket); + SET_H2CCMD_AOAC_RSVDPAGE_LOC_SSID_INFO(u1H2CScanOffloadInfoParm, + rsvdpageloc->LocSSIDInfo); + + if (pHalFunc->fill_h2c_cmd != NULL) { + ret = pHalFunc->fill_h2c_cmd(adapter, + H2C_D0_SCAN_OFFLOAD_INFO, + H2C_SCAN_OFFLOAD_CTRL_LEN, + u1H2CScanOffloadInfoParm); + } else { + DBG_871X("%s: Please hook fill_h2c_cmd first!\n", __func__); + ret = _FAIL; + } + return ret; +} +#endif //CONFIG_PNO_SUPPORT + +void rtw_hal_set_fw_wow_related_cmd(_adapter* padapter, u8 enable) +{ + struct security_priv *psecpriv = &padapter->securitypriv; + struct pwrctrl_priv *ppwrpriv = adapter_to_pwrctl(padapter); + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + struct sta_info *psta = NULL; + u16 media_status_rpt; + u8 pkt_type = 0; + u8 ret = _SUCCESS; + + DBG_871X_LEVEL(_drv_always_, "+%s()+: enable=%d\n", __func__, enable); +_func_enter_; + + rtw_hal_set_wowlan_ctrl_cmd(padapter, enable); + + if (enable) { + rtw_hal_set_global_info_cmd(padapter, + psecpriv->dot118021XGrpPrivacy, + psecpriv->dot11PrivacyAlgrthm); + + if (!(ppwrpriv->wowlan_pno_enable)) { + rtw_hal_set_disconnect_decision_cmd(padapter, enable); +#ifdef CONFIG_ARP_KEEP_ALIVE + if ((psecpriv->dot11PrivacyAlgrthm == _WEP40_) || + (psecpriv->dot11PrivacyAlgrthm == _WEP104_)) + pkt_type = 0; + else + pkt_type = 1; +#else + pkt_type = 0; +#endif //CONFIG_ARP_KEEP_ALIVE + rtw_hal_set_keep_alive_cmd(padapter, enable, pkt_type); + } + rtw_hal_set_remote_wake_ctrl_cmd(padapter, enable); +#ifdef CONFIG_PNO_SUPPORT + rtw_hal_check_pno_enabled(padapter); +#endif //CONFIG_PNO_SUPPORT + } else { +#if 0 + { + u32 PageSize = 0; + rtw_hal_get_def_var(adapter, HAL_DEF_TX_PAGE_SIZE, (u8 *)&PageSize); + dump_TX_FIFO(padapter, 4, PageSize); + } +#endif + + rtw_hal_set_remote_wake_ctrl_cmd(padapter, enable); + rtw_hal_set_wowlan_ctrl_cmd(padapter, enable); + } +_func_exit_; + DBG_871X_LEVEL(_drv_always_, "-%s()-\n", __func__); +} +#endif //CONFIG_WOWLAN + +#ifdef CONFIG_P2P_WOWLAN +static int update_hidden_ssid(u8 *ies, u32 ies_len, u8 hidden_ssid_mode) +{ + u8 *ssid_ie; + sint ssid_len_ori; + int len_diff = 0; + + ssid_ie = rtw_get_ie(ies, WLAN_EID_SSID, &ssid_len_ori, ies_len); + + //DBG_871X("%s hidden_ssid_mode:%u, ssid_ie:%p, ssid_len_ori:%d\n", __FUNCTION__, hidden_ssid_mode, ssid_ie, ssid_len_ori); + + if(ssid_ie && ssid_len_ori>0) + { + switch(hidden_ssid_mode) + { + case 1: + { + u8 *next_ie = ssid_ie + 2 + ssid_len_ori; + u32 remain_len = 0; + + remain_len = ies_len -(next_ie-ies); + + ssid_ie[1] = 0; + _rtw_memcpy(ssid_ie+2, next_ie, remain_len); + len_diff -= ssid_len_ori; + + break; + } + case 2: + _rtw_memset(&ssid_ie[2], 0, ssid_len_ori); + break; + default: + break; + } + } + + return len_diff; +} + +static void rtw_hal_construct_P2PBeacon(_adapter *padapter, u8 *pframe, u32 *pLength) +{ + //struct xmit_frame *pmgntframe; + //struct pkt_attrib *pattrib; + //unsigned char *pframe; + struct rtw_ieee80211_hdr *pwlanhdr; + unsigned short *fctrl; + unsigned int rate_len; + struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); + u32 pktlen; +//#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) +// _irqL irqL; +// struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); +//#endif //#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) + struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network); + u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; +#ifdef CONFIG_P2P + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); +#endif //CONFIG_P2P + + //for debug + u8 *dbgbuf = pframe; + u8 dbgbufLen = 0, index = 0; + + DBG_871X("%s\n", __FUNCTION__); +//#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) +// _enter_critical_bh(&pmlmepriv->bcn_update_lock, &irqL); +//#endif //#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) + + pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + + + fctrl = &(pwlanhdr->frame_ctl); + *(fctrl) = 0; + + _rtw_memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN); + _rtw_memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); + _rtw_memcpy(pwlanhdr->addr3, get_my_bssid(cur_network), ETH_ALEN); + + SetSeqNum(pwlanhdr, 0/*pmlmeext->mgnt_seq*/); + //pmlmeext->mgnt_seq++; + SetFrameSubType(pframe, WIFI_BEACON); + + pframe += sizeof(struct rtw_ieee80211_hdr_3addr); + pktlen = sizeof (struct rtw_ieee80211_hdr_3addr); + + if( (pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) + { + //DBG_871X("ie len=%d\n", cur_network->IELength); +#ifdef CONFIG_P2P + // for P2P : Primary Device Type & Device Name + u32 wpsielen=0, insert_len=0; + u8 *wpsie=NULL; + wpsie = rtw_get_wps_ie(cur_network->IEs+_FIXED_IE_LENGTH_, cur_network->IELength-_FIXED_IE_LENGTH_, NULL, &wpsielen); + + if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO) && wpsie && wpsielen>0) + { + uint wps_offset, remainder_ielen; + u8 *premainder_ie, *pframe_wscie; + + wps_offset = (uint)(wpsie - cur_network->IEs); + + premainder_ie = wpsie + wpsielen; + + remainder_ielen = cur_network->IELength - wps_offset - wpsielen; + +#ifdef CONFIG_IOCTL_CFG80211 + if(pwdinfo->driver_interface == DRIVER_CFG80211 ) + { + if(pmlmepriv->wps_beacon_ie && pmlmepriv->wps_beacon_ie_len>0) + { + _rtw_memcpy(pframe, cur_network->IEs, wps_offset); + pframe += wps_offset; + pktlen += wps_offset; + + _rtw_memcpy(pframe, pmlmepriv->wps_beacon_ie, pmlmepriv->wps_beacon_ie_len); + pframe += pmlmepriv->wps_beacon_ie_len; + pktlen += pmlmepriv->wps_beacon_ie_len; + + //copy remainder_ie to pframe + _rtw_memcpy(pframe, premainder_ie, remainder_ielen); + pframe += remainder_ielen; + pktlen += remainder_ielen; + } + else + { + _rtw_memcpy(pframe, cur_network->IEs, cur_network->IELength); + pframe += cur_network->IELength; + pktlen += cur_network->IELength; + } + } + else +#endif //CONFIG_IOCTL_CFG80211 + { + pframe_wscie = pframe + wps_offset; + _rtw_memcpy(pframe, cur_network->IEs, wps_offset+wpsielen); + pframe += (wps_offset + wpsielen); + pktlen += (wps_offset + wpsielen); + + //now pframe is end of wsc ie, insert Primary Device Type & Device Name + // Primary Device Type + // Type: + *(u16*) ( pframe + insert_len) = cpu_to_be16( WPS_ATTR_PRIMARY_DEV_TYPE ); + insert_len += 2; + + // Length: + *(u16*) ( pframe + insert_len ) = cpu_to_be16( 0x0008 ); + insert_len += 2; + + // Value: + // Category ID + *(u16*) ( pframe + insert_len ) = cpu_to_be16( WPS_PDT_CID_MULIT_MEDIA ); + insert_len += 2; + + // OUI + *(u32*) ( pframe + insert_len ) = cpu_to_be32( WPSOUI ); + insert_len += 4; + + // Sub Category ID + *(u16*) ( pframe + insert_len ) = cpu_to_be16( WPS_PDT_SCID_MEDIA_SERVER ); + insert_len += 2; + + + // Device Name + // Type: + *(u16*) ( pframe + insert_len ) = cpu_to_be16( WPS_ATTR_DEVICE_NAME ); + insert_len += 2; + + // Length: + *(u16*) ( pframe + insert_len ) = cpu_to_be16( pwdinfo->device_name_len ); + insert_len += 2; + + // Value: + _rtw_memcpy( pframe + insert_len, pwdinfo->device_name, pwdinfo->device_name_len ); + insert_len += pwdinfo->device_name_len; + + + //update wsc ie length + *(pframe_wscie+1) = (wpsielen -2) + insert_len; + + //pframe move to end + pframe+=insert_len; + pktlen += insert_len; + + //copy remainder_ie to pframe + _rtw_memcpy(pframe, premainder_ie, remainder_ielen); + pframe += remainder_ielen; + pktlen += remainder_ielen; + } + } + else +#endif //CONFIG_P2P + { + int len_diff; + _rtw_memcpy(pframe, cur_network->IEs, cur_network->IELength); + len_diff = update_hidden_ssid( + pframe+_BEACON_IE_OFFSET_ + , cur_network->IELength-_BEACON_IE_OFFSET_ + , pmlmeinfo->hidden_ssid_mode + ); + pframe += (cur_network->IELength+len_diff); + pktlen += (cur_network->IELength+len_diff); + } +#if 0 + { + u8 *wps_ie; + uint wps_ielen; + u8 sr = 0; + wps_ie = rtw_get_wps_ie(pmgntframe->buf_addr+TXDESC_OFFSET+sizeof (struct rtw_ieee80211_hdr_3addr)+_BEACON_IE_OFFSET_, + pattrib->pktlen-sizeof (struct rtw_ieee80211_hdr_3addr)-_BEACON_IE_OFFSET_, NULL, &wps_ielen); + if (wps_ie && wps_ielen>0) { + rtw_get_wps_attr_content(wps_ie, wps_ielen, WPS_ATTR_SELECTED_REGISTRAR, (u8*)(&sr), NULL); + } + if (sr != 0) + set_fwstate(pmlmepriv, WIFI_UNDER_WPS); + else + _clr_fwstate_(pmlmepriv, WIFI_UNDER_WPS); + } +#endif +#ifdef CONFIG_P2P + if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO)) + { + u32 len; +#ifdef CONFIG_IOCTL_CFG80211 + if(pwdinfo->driver_interface == DRIVER_CFG80211 ) + { + len = pmlmepriv->p2p_beacon_ie_len; + if(pmlmepriv->p2p_beacon_ie && len>0) + _rtw_memcpy(pframe, pmlmepriv->p2p_beacon_ie, len); + } + else +#endif //CONFIG_IOCTL_CFG80211 + { + len = build_beacon_p2p_ie(pwdinfo, pframe); + } + + pframe += len; + pktlen += len; +#ifdef CONFIG_WFD +#ifdef CONFIG_IOCTL_CFG80211 + if(_TRUE == pwdinfo->wfd_info->wfd_enable) +#endif //CONFIG_IOCTL_CFG80211 + { + len = build_beacon_wfd_ie( pwdinfo, pframe ); + } +#ifdef CONFIG_IOCTL_CFG80211 + else + { + len = 0; + if(pmlmepriv->wfd_beacon_ie && pmlmepriv->wfd_beacon_ie_len>0) + { + len = pmlmepriv->wfd_beacon_ie_len; + _rtw_memcpy(pframe, pmlmepriv->wfd_beacon_ie, len); + } + } +#endif //CONFIG_IOCTL_CFG80211 + pframe += len; + pktlen += len; +#endif //CONFIG_WFD + } +#endif //CONFIG_P2P + + goto _issue_bcn; + + } + + //below for ad-hoc mode + + //timestamp will be inserted by hardware + pframe += 8; + pktlen += 8; + + // beacon interval: 2 bytes + + _rtw_memcpy(pframe, (unsigned char *)(rtw_get_beacon_interval_from_ie(cur_network->IEs)), 2); + + pframe += 2; + pktlen += 2; + + // capability info: 2 bytes + + _rtw_memcpy(pframe, (unsigned char *)(rtw_get_capability_from_ie(cur_network->IEs)), 2); + + pframe += 2; + pktlen += 2; + + // SSID + pframe = rtw_set_ie(pframe, _SSID_IE_, cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &pktlen); + + // supported rates... + rate_len = rtw_get_rateset_len(cur_network->SupportedRates); + pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, ((rate_len > 8)? 8: rate_len), cur_network->SupportedRates, &pktlen); + + // DS parameter set + pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &pktlen); + + //if( (pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) + { + u8 erpinfo=0; + u32 ATIMWindow; + // IBSS Parameter Set... + //ATIMWindow = cur->Configuration.ATIMWindow; + ATIMWindow = 0; + pframe = rtw_set_ie(pframe, _IBSS_PARA_IE_, 2, (unsigned char *)(&ATIMWindow), &pktlen); + + //ERP IE + pframe = rtw_set_ie(pframe, _ERPINFO_IE_, 1, &erpinfo, &pktlen); + } + + + // EXTERNDED SUPPORTED RATE + if (rate_len > 8) + { + pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_, (rate_len - 8), (cur_network->SupportedRates + 8), &pktlen); + } + + + //todo:HT for adhoc + +_issue_bcn: + +//#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) +// pmlmepriv->update_bcn = _FALSE; +// +// _exit_critical_bh(&pmlmepriv->bcn_update_lock, &irqL); +//#endif //#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) + + *pLength = pktlen; +#if 0 + // printf dbg msg + dbgbufLen = pktlen; + DBG_871X("======> DBG MSG FOR CONSTRAUCT P2P BEACON\n"); + + for(index=0;indexxmitpriv); + struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + //WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network); + u16 beacon_interval = 100; + u16 capInfo = 0; + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); + u8 wpsie[255] = { 0x00 }; + u32 wpsielen = 0, p2pielen = 0; + u32 pktlen; +#ifdef CONFIG_WFD + u32 wfdielen = 0; +#endif //CONFIG_WFD +#ifdef CONFIG_INTEL_WIDI + u8 zero_array_check[L2SDTA_SERVICE_VE_LEN] = { 0x00 }; +#endif //CONFIG_INTEL_WIDI + + //for debug + u8 *dbgbuf = pframe; + u8 dbgbufLen = 0, index = 0; + + DBG_871X("%s\n", __FUNCTION__); + pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + + mac = myid(&(padapter->eeprompriv)); + + fctrl = &(pwlanhdr->frame_ctl); + *(fctrl) = 0; + + //DA filled by FW + _rtw_memset(pwlanhdr->addr1, 0, ETH_ALEN); + _rtw_memcpy(pwlanhdr->addr2, mac, ETH_ALEN); + + // Use the device address for BSSID field. + _rtw_memcpy(pwlanhdr->addr3, mac, ETH_ALEN); + + SetSeqNum(pwlanhdr, 0); + SetFrameSubType(fctrl, WIFI_PROBERSP); + + pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += pktlen; + + + //timestamp will be inserted by hardware + pframe += 8; + pktlen += 8; + + // beacon interval: 2 bytes + _rtw_memcpy(pframe, (unsigned char *) &beacon_interval, 2); + pframe += 2; + pktlen += 2; + + // capability info: 2 bytes + // ESS and IBSS bits must be 0 (defined in the 3.1.2.1.1 of WiFi Direct Spec) + capInfo |= cap_ShortPremble; + capInfo |= cap_ShortSlot; + + _rtw_memcpy(pframe, (unsigned char *) &capInfo, 2); + pframe += 2; + pktlen += 2; + + + // SSID + pframe = rtw_set_ie(pframe, _SSID_IE_, 7, pwdinfo->p2p_wildcard_ssid, &pktlen); + + // supported rates... + // Use the OFDM rate in the P2P probe response frame. ( 6(B), 9(B), 12, 18, 24, 36, 48, 54 ) + pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, 8, pwdinfo->support_rate, &pktlen); + + // DS parameter set + pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&pwdinfo->listen_channel, &pktlen); + +#ifdef CONFIG_IOCTL_CFG80211 + if(pwdinfo->driver_interface == DRIVER_CFG80211 ) + { + if( pmlmepriv->wps_probe_resp_ie != NULL && pmlmepriv->p2p_probe_resp_ie != NULL ) + { + //WPS IE + _rtw_memcpy(pframe, pmlmepriv->wps_probe_resp_ie, pmlmepriv->wps_probe_resp_ie_len); + pktlen += pmlmepriv->wps_probe_resp_ie_len; + pframe += pmlmepriv->wps_probe_resp_ie_len; + + //P2P IE + _rtw_memcpy(pframe, pmlmepriv->p2p_probe_resp_ie, pmlmepriv->p2p_probe_resp_ie_len); + pktlen += pmlmepriv->p2p_probe_resp_ie_len; + pframe += pmlmepriv->p2p_probe_resp_ie_len; + } + } + else +#endif //CONFIG_IOCTL_CFG80211 + { + + // Todo: WPS IE + // Noted by Albert 20100907 + // According to the WPS specification, all the WPS attribute is presented by Big Endian. + + wpsielen = 0; + // WPS OUI + *(u32*) ( wpsie ) = cpu_to_be32( WPSOUI ); + wpsielen += 4; + + // WPS version + // Type: + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_VER1 ); + wpsielen += 2; + + // Length: + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( 0x0001 ); + wpsielen += 2; + + // Value: + wpsie[wpsielen++] = WPS_VERSION_1; // Version 1.0 + +#ifdef CONFIG_INTEL_WIDI + // Commented by Kurt + // Appended WiDi info. only if we did issued_probereq_widi(), and then we saved ven. ext. in pmlmepriv->sa_ext. + if( _rtw_memcmp(pmlmepriv->sa_ext, zero_array_check, L2SDTA_SERVICE_VE_LEN) == _FALSE + || pmlmepriv->num_p2p_sdt != 0 ) + { + //Sec dev type + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_SEC_DEV_TYPE_LIST ); + wpsielen += 2; + + // Length: + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( 0x0008 ); + wpsielen += 2; + + // Value: + // Category ID + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( WPS_PDT_CID_DISPLAYS ); + wpsielen += 2; + + // OUI + *(u32*) ( wpsie + wpsielen ) = cpu_to_be32( INTEL_DEV_TYPE_OUI ); + wpsielen += 4; + + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( WPS_PDT_SCID_WIDI_CONSUMER_SINK ); + wpsielen += 2; + + if( _rtw_memcmp(pmlmepriv->sa_ext, zero_array_check, L2SDTA_SERVICE_VE_LEN) == _FALSE ) + { + // Vendor Extension + _rtw_memcpy( wpsie + wpsielen, pmlmepriv->sa_ext, L2SDTA_SERVICE_VE_LEN ); + wpsielen += L2SDTA_SERVICE_VE_LEN; + } + } +#endif //CONFIG_INTEL_WIDI + + // WiFi Simple Config State + // Type: + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_SIMPLE_CONF_STATE ); + wpsielen += 2; + + // Length: + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( 0x0001 ); + wpsielen += 2; + + // Value: + wpsie[wpsielen++] = WPS_WSC_STATE_NOT_CONFIG; // Not Configured. + + // Response Type + // Type: + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_RESP_TYPE ); + wpsielen += 2; + + // Length: + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( 0x0001 ); + wpsielen += 2; + + // Value: + wpsie[wpsielen++] = WPS_RESPONSE_TYPE_8021X; + + // UUID-E + // Type: + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_UUID_E ); + wpsielen += 2; + + // Length: + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( 0x0010 ); + wpsielen += 2; + + // Value: + if (pwdinfo->external_uuid == 0) { + _rtw_memset( wpsie + wpsielen, 0x0, 16 ); + _rtw_memcpy( wpsie + wpsielen, myid( &padapter->eeprompriv ), ETH_ALEN ); + } else { + _rtw_memcpy( wpsie + wpsielen, pwdinfo->uuid, 0x10 ); + } + wpsielen += 0x10; + + // Manufacturer + // Type: + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_MANUFACTURER ); + wpsielen += 2; + + // Length: + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( 0x0007 ); + wpsielen += 2; + + // Value: + _rtw_memcpy( wpsie + wpsielen, "Realtek", 7 ); + wpsielen += 7; + + // Model Name + // Type: + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_MODEL_NAME ); + wpsielen += 2; + + // Length: + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( 0x0006 ); + wpsielen += 2; + + // Value: + _rtw_memcpy( wpsie + wpsielen, "8192CU", 6 ); + wpsielen += 6; + + // Model Number + // Type: + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_MODEL_NUMBER ); + wpsielen += 2; + + // Length: + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( 0x0001 ); + wpsielen += 2; + + // Value: + wpsie[ wpsielen++ ] = 0x31; // character 1 + + // Serial Number + // Type: + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_SERIAL_NUMBER ); + wpsielen += 2; + + // Length: + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( ETH_ALEN ); + wpsielen += 2; + + // Value: + _rtw_memcpy( wpsie + wpsielen, "123456" , ETH_ALEN ); + wpsielen += ETH_ALEN; + + // Primary Device Type + // Type: + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_PRIMARY_DEV_TYPE ); + wpsielen += 2; + + // Length: + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( 0x0008 ); + wpsielen += 2; + + // Value: + // Category ID + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( WPS_PDT_CID_MULIT_MEDIA ); + wpsielen += 2; + + // OUI + *(u32*) ( wpsie + wpsielen ) = cpu_to_be32( WPSOUI ); + wpsielen += 4; + + // Sub Category ID + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( WPS_PDT_SCID_MEDIA_SERVER ); + wpsielen += 2; + + // Device Name + // Type: + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_DEVICE_NAME ); + wpsielen += 2; + + // Length: + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( pwdinfo->device_name_len ); + wpsielen += 2; + + // Value: + _rtw_memcpy( wpsie + wpsielen, pwdinfo->device_name, pwdinfo->device_name_len ); + wpsielen += pwdinfo->device_name_len; + + // Config Method + // Type: + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_CONF_METHOD ); + wpsielen += 2; + + // Length: + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( 0x0002 ); + wpsielen += 2; + + // Value: + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( pwdinfo->supported_wps_cm ); + wpsielen += 2; + + + pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wpsielen, (unsigned char *) wpsie, &pktlen ); + + + p2pielen = build_probe_resp_p2p_ie(pwdinfo, pframe); + pframe += p2pielen; + pktlen += p2pielen; + } + +#ifdef CONFIG_WFD +#ifdef CONFIG_IOCTL_CFG80211 + if ( _TRUE == pwdinfo->wfd_info->wfd_enable ) +#endif //CONFIG_IOCTL_CFG80211 + { + wfdielen = build_probe_resp_wfd_ie(pwdinfo, pframe, 0); + pframe += wfdielen; + pktlen += wfdielen; + } +#ifdef CONFIG_IOCTL_CFG80211 + else if (pmlmepriv->wfd_probe_resp_ie != NULL && pmlmepriv->wfd_probe_resp_ie_len>0) + { + //WFD IE + _rtw_memcpy(pframe, pmlmepriv->wfd_probe_resp_ie, pmlmepriv->wfd_probe_resp_ie_len); + pktlen += pmlmepriv->wfd_probe_resp_ie_len; + pframe += pmlmepriv->wfd_probe_resp_ie_len; + } +#endif //CONFIG_IOCTL_CFG80211 +#endif //CONFIG_WFD + + *pLength = pktlen; + +#if 0 + // printf dbg msg + dbgbufLen = pktlen; + DBG_871X("======> DBG MSG FOR CONSTRAUCT P2P Probe Rsp\n"); + + for(index=0;indexxmitpriv); + struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + struct wifidirect_info *pwdinfo = &( padapter->wdinfo); + //WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network); + +#ifdef CONFIG_WFD + u32 wfdielen = 0; +#endif //CONFIG_WFD + + //for debug + u8 *dbgbuf = pframe; + u8 dbgbufLen = 0, index = 0; + + DBG_871X( "%s\n", __FUNCTION__); + pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + + fctrl = &(pwlanhdr->frame_ctl); + *(fctrl) = 0; + + //RA, filled by FW + _rtw_memset(pwlanhdr->addr1, 0, ETH_ALEN); + _rtw_memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); + _rtw_memcpy(pwlanhdr->addr3, myid(&(padapter->eeprompriv)), ETH_ALEN); + + SetSeqNum(pwlanhdr, 0); + SetFrameSubType(pframe, WIFI_ACTION); + + pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += pktlen; + + pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pktlen)); + pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pktlen)); + pframe = rtw_set_fixed_ie(pframe, 4, (unsigned char *) &(p2poui), &(pktlen)); + pframe = rtw_set_fixed_ie(pframe, 1, &(oui_subtype), &(pktlen)); + + //dialog token, filled by FW + pframe = rtw_set_fixed_ie(pframe, 1, &(dialogToken), &(pktlen)); + + _rtw_memset( wpsie, 0x00, 255 ); + wpsielen = 0; + + // WPS Section + wpsielen = 0; + // WPS OUI + *(u32*) ( wpsie ) = cpu_to_be32( WPSOUI ); + wpsielen += 4; + + // WPS version + // Type: + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_VER1 ); + wpsielen += 2; + + // Length: + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( 0x0001 ); + wpsielen += 2; + + // Value: + wpsie[wpsielen++] = WPS_VERSION_1; // Version 1.0 + + // Device Password ID + // Type: + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_DEVICE_PWID ); + wpsielen += 2; + + // Length: + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( 0x0002 ); + wpsielen += 2; + + // Value: + if ( wps_devicepassword_id == WPS_DPID_USER_SPEC ) + { + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( WPS_DPID_REGISTRAR_SPEC ); + } + else if ( wps_devicepassword_id == WPS_DPID_REGISTRAR_SPEC ) + { + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( WPS_DPID_USER_SPEC ); + } + else + { + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( WPS_DPID_PBC ); + } + wpsielen += 2; + + pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wpsielen, (unsigned char *) wpsie, &pktlen ); + + + // P2P IE Section. + + // P2P OUI + p2pielen = 0; + p2pie[ p2pielen++ ] = 0x50; + p2pie[ p2pielen++ ] = 0x6F; + p2pie[ p2pielen++ ] = 0x9A; + p2pie[ p2pielen++ ] = 0x09; // WFA P2P v1.0 + + // Commented by Albert 20100908 + // According to the P2P Specification, the group negoitation response frame should contain 9 P2P attributes + // 1. Status + // 2. P2P Capability + // 3. Group Owner Intent + // 4. Configuration Timeout + // 5. Operating Channel + // 6. Intended P2P Interface Address + // 7. Channel List + // 8. Device Info + // 9. Group ID ( Only GO ) + + + // ToDo: + + // P2P Status + // Type: + p2pie[ p2pielen++ ] = P2P_ATTR_STATUS; + + // Length: + *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0x0001 ); + p2pielen += 2; + + // Value, filled by FW + p2pie[ p2pielen++ ] = 1; + + // P2P Capability + // Type: + p2pie[ p2pielen++ ] = P2P_ATTR_CAPABILITY; + + // Length: + *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0x0002 ); + p2pielen += 2; + + // Value: + // Device Capability Bitmap, 1 byte + + if ( rtw_p2p_chk_role(pwdinfo, P2P_ROLE_CLIENT) ) + { + // Commented by Albert 2011/03/08 + // According to the P2P specification + // if the sending device will be client, the P2P Capability should be reserved of group negotation response frame + p2pie[ p2pielen++ ] = 0; + } + else + { + // Be group owner or meet the error case + p2pie[ p2pielen++ ] = DMP_P2P_DEVCAP_SUPPORT; + } + + // Group Capability Bitmap, 1 byte + if ( pwdinfo->persistent_supported ) + { + p2pie[ p2pielen++ ] = P2P_GRPCAP_CROSS_CONN | P2P_GRPCAP_PERSISTENT_GROUP; + } + else + { + p2pie[ p2pielen++ ] = P2P_GRPCAP_CROSS_CONN; + } + + // Group Owner Intent + // Type: + p2pie[ p2pielen++ ] = P2P_ATTR_GO_INTENT; + + // Length: + *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0x0001 ); + p2pielen += 2; + + // Value: + if ( pwdinfo->peer_intent & 0x01 ) + { + // Peer's tie breaker bit is 1, our tie breaker bit should be 0 + p2pie[ p2pielen++ ] = ( pwdinfo->intent << 1 ); + } + else + { + // Peer's tie breaker bit is 0, our tie breaker bit should be 1 + p2pie[ p2pielen++ ] = ( ( pwdinfo->intent << 1 ) | BIT(0) ); + } + + + // Configuration Timeout + // Type: + p2pie[ p2pielen++ ] = P2P_ATTR_CONF_TIMEOUT; + + // Length: + *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0x0002 ); + p2pielen += 2; + + // Value: + p2pie[ p2pielen++ ] = 200; // 2 seconds needed to be the P2P GO + p2pie[ p2pielen++ ] = 200; // 2 seconds needed to be the P2P Client + + // Operating Channel + // Type: + p2pie[ p2pielen++ ] = P2P_ATTR_OPERATING_CH; + + // Length: + *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0x0005 ); + p2pielen += 2; + + // Value: + // Country String + p2pie[ p2pielen++ ] = 'X'; + p2pie[ p2pielen++ ] = 'X'; + + // The third byte should be set to 0x04. + // Described in the "Operating Channel Attribute" section. + p2pie[ p2pielen++ ] = 0x04; + + // Operating Class + if ( pwdinfo->operating_channel <= 14 ) + { + // Operating Class + p2pie[ p2pielen++ ] = 0x51; + } + else if ( ( pwdinfo->operating_channel >= 36 ) && ( pwdinfo->operating_channel <= 48 ) ) + { + // Operating Class + p2pie[ p2pielen++ ] = 0x73; + } + else + { + // Operating Class + p2pie[ p2pielen++ ] = 0x7c; + } + + // Channel Number + p2pie[ p2pielen++ ] = pwdinfo->operating_channel; // operating channel number + + // Intended P2P Interface Address + // Type: + p2pie[ p2pielen++ ] = P2P_ATTR_INTENTED_IF_ADDR; + + // Length: + *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( ETH_ALEN ); + p2pielen += 2; + + // Value: + _rtw_memcpy( p2pie + p2pielen, myid( &padapter->eeprompriv ), ETH_ALEN ); + p2pielen += ETH_ALEN; + + // Channel List + // Type: + p2pie[ p2pielen++ ] = P2P_ATTR_CH_LIST; + + // Country String(3) + // + ( Operating Class (1) + Number of Channels(1) ) * Operation Classes (?) + // + number of channels in all classes + len_channellist_attr = 3 + + (1 + 1) * (u16)pmlmeext->channel_list.reg_classes + + get_reg_classes_full_count(pmlmeext->channel_list); + +#ifdef CONFIG_CONCURRENT_MODE + if ( check_buddy_fwstate(padapter, _FW_LINKED ) ) + { + *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 5 + 1 ); + } + else + { + *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( len_channellist_attr ); + } +#else + + *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( len_channellist_attr ); + + #endif + p2pielen += 2; + + // Value: + // Country String + p2pie[ p2pielen++ ] = 'X'; + p2pie[ p2pielen++ ] = 'X'; + + // The third byte should be set to 0x04. + // Described in the "Operating Channel Attribute" section. + p2pie[ p2pielen++ ] = 0x04; + + // Channel Entry List + +#ifdef CONFIG_CONCURRENT_MODE + if ( check_buddy_fwstate(padapter, _FW_LINKED ) ) + { + _adapter *pbuddy_adapter = padapter->pbuddy_adapter; + struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv; + + // Operating Class + if ( pbuddy_mlmeext->cur_channel > 14 ) + { + if ( pbuddy_mlmeext->cur_channel >= 149 ) + { + p2pie[ p2pielen++ ] = 0x7c; + } + else + { + p2pie[ p2pielen++ ] = 0x73; + } + } + else + { + p2pie[ p2pielen++ ] = 0x51; + } + + // Number of Channels + // Just support 1 channel and this channel is AP's channel + p2pie[ p2pielen++ ] = 1; + + // Channel List + p2pie[ p2pielen++ ] = pbuddy_mlmeext->cur_channel; + } + else + { + int i, j; + for (j = 0; j < pmlmeext->channel_list.reg_classes; j++) { + // Operating Class + p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].reg_class; + + // Number of Channels + p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].channels; + + // Channel List + for (i = 0; i < pmlmeext->channel_list.reg_class[j].channels; i++) { + p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].channel[i]; + } + } + } +#else // CONFIG_CONCURRENT_MODE + { + int i, j; + for (j = 0; j < pmlmeext->channel_list.reg_classes; j++) { + // Operating Class + p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].reg_class; + + // Number of Channels + p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].channels; + + // Channel List + for (i = 0; i < pmlmeext->channel_list.reg_class[j].channels; i++) { + p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].channel[i]; + } + } + } +#endif // CONFIG_CONCURRENT_MODE + + + // Device Info + // Type: + p2pie[ p2pielen++ ] = P2P_ATTR_DEVICE_INFO; + + // Length: + // 21 -> P2P Device Address (6bytes) + Config Methods (2bytes) + Primary Device Type (8bytes) + // + NumofSecondDevType (1byte) + WPS Device Name ID field (2bytes) + WPS Device Name Len field (2bytes) + *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 21 + pwdinfo->device_name_len ); + p2pielen += 2; + + // Value: + // P2P Device Address + _rtw_memcpy( p2pie + p2pielen, myid( &padapter->eeprompriv ), ETH_ALEN ); + p2pielen += ETH_ALEN; + + // Config Method + // This field should be big endian. Noted by P2P specification. + + *(u16*) ( p2pie + p2pielen ) = cpu_to_be16( pwdinfo->supported_wps_cm ); + + p2pielen += 2; + + // Primary Device Type + // Category ID + *(u16*) ( p2pie + p2pielen ) = cpu_to_be16( WPS_PDT_CID_MULIT_MEDIA ); + p2pielen += 2; + + // OUI + *(u32*) ( p2pie + p2pielen ) = cpu_to_be32( WPSOUI ); + p2pielen += 4; + + // Sub Category ID + *(u16*) ( p2pie + p2pielen ) = cpu_to_be16( WPS_PDT_SCID_MEDIA_SERVER ); + p2pielen += 2; + + // Number of Secondary Device Types + p2pie[ p2pielen++ ] = 0x00; // No Secondary Device Type List + + // Device Name + // Type: + *(u16*) ( p2pie + p2pielen ) = cpu_to_be16( WPS_ATTR_DEVICE_NAME ); + p2pielen += 2; + + // Length: + *(u16*) ( p2pie + p2pielen ) = cpu_to_be16( pwdinfo->device_name_len ); + p2pielen += 2; + + // Value: + _rtw_memcpy( p2pie + p2pielen, pwdinfo->device_name , pwdinfo->device_name_len ); + p2pielen += pwdinfo->device_name_len; + + if ( rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO) ) + { + // Group ID Attribute + // Type: + p2pie[ p2pielen++ ] = P2P_ATTR_GROUP_ID; + + // Length: + *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( ETH_ALEN + pwdinfo->nego_ssidlen ); + p2pielen += 2; + + // Value: + // p2P Device Address + _rtw_memcpy( p2pie + p2pielen , pwdinfo->device_addr, ETH_ALEN ); + p2pielen += ETH_ALEN; + + // SSID + _rtw_memcpy( p2pie + p2pielen, pwdinfo->nego_ssid, pwdinfo->nego_ssidlen ); + p2pielen += pwdinfo->nego_ssidlen; + + } + + pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pktlen ); + +#ifdef CONFIG_WFD + wfdielen = build_nego_resp_wfd_ie(pwdinfo, pframe); + pframe += wfdielen; + pktlen += wfdielen; +#endif //CONFIG_WFD + + *pLength = pktlen; +#if 0 + // printf dbg msg + dbgbufLen = pktlen; + DBG_871X("======> DBG MSG FOR CONSTRAUCT Nego Rsp\n"); + + for(index=0;indexpbuddy_adapter; + struct wifidirect_info *pbuddy_wdinfo = &pbuddy_adapter->wdinfo; + struct mlme_priv *pbuddy_mlmepriv = &pbuddy_adapter->mlmepriv; + struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv; +#endif +#ifdef CONFIG_WFD + u32 wfdielen = 0; +#endif //CONFIG_WFD + + //struct xmit_frame *pmgntframe; + //struct pkt_attrib *pattrib; + //unsigned char *pframe; + struct rtw_ieee80211_hdr *pwlanhdr; + unsigned short *fctrl; + struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); + struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + struct wifidirect_info *pwdinfo = &( padapter->wdinfo); + + //for debug + u8 *dbgbuf = pframe; + u8 dbgbufLen = 0, index = 0; + + + DBG_871X( "%s\n", __FUNCTION__); + pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + + fctrl = &(pwlanhdr->frame_ctl); + *(fctrl) = 0; + + //RA fill by FW + _rtw_memset(pwlanhdr->addr1, 0, ETH_ALEN); + _rtw_memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); + + //BSSID fill by FW + _rtw_memset(pwlanhdr->addr3, 0, ETH_ALEN); + + SetSeqNum(pwlanhdr, 0); + SetFrameSubType(pframe, WIFI_ACTION); + + pframe += sizeof(struct rtw_ieee80211_hdr_3addr); + pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + + pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pktlen)); + pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pktlen)); + pframe = rtw_set_fixed_ie(pframe, 4, (unsigned char *) &(p2poui), &(pktlen)); + pframe = rtw_set_fixed_ie(pframe, 1, &(oui_subtype), &(pktlen)); + + //dialog token, filled by FW + pframe = rtw_set_fixed_ie(pframe, 1, &(dialogToken), &(pktlen)); + + // P2P IE Section. + + // P2P OUI + p2pielen = 0; + p2pie[ p2pielen++ ] = 0x50; + p2pie[ p2pielen++ ] = 0x6F; + p2pie[ p2pielen++ ] = 0x9A; + p2pie[ p2pielen++ ] = 0x09; // WFA P2P v1.0 + + // Commented by Albert 20101005 + // According to the P2P Specification, the P2P Invitation response frame should contain 5 P2P attributes + // 1. Status + // 2. Configuration Timeout + // 3. Operating Channel ( Only GO ) + // 4. P2P Group BSSID ( Only GO ) + // 5. Channel List + + // P2P Status + // Type: + p2pie[ p2pielen++ ] = P2P_ATTR_STATUS; + + // Length: + *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0x0001 ); + p2pielen += 2; + + // Value: filled by FW, defult value is FAIL INFO UNAVAILABLE + p2pie[ p2pielen++ ] = P2P_STATUS_FAIL_INFO_UNAVAILABLE; + + // Configuration Timeout + // Type: + p2pie[ p2pielen++ ] = P2P_ATTR_CONF_TIMEOUT; + + // Length: + *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0x0002 ); + p2pielen += 2; + + // Value: + p2pie[ p2pielen++ ] = 200; // 2 seconds needed to be the P2P GO + p2pie[ p2pielen++ ] = 200; // 2 seconds needed to be the P2P Client + + // due to defult value is FAIL INFO UNAVAILABLE, so the following IE is not needed +#if 0 + if( status_code == P2P_STATUS_SUCCESS ) + { + if( rtw_p2p_chk_role( pwdinfo, P2P_ROLE_GO ) ) + { + // The P2P Invitation request frame asks this Wi-Fi device to be the P2P GO + // In this case, the P2P Invitation response frame should carry the two more P2P attributes. + // First one is operating channel attribute. + // Second one is P2P Group BSSID attribute. + + // Operating Channel + // Type: + p2pie[ p2pielen++ ] = P2P_ATTR_OPERATING_CH; + + // Length: + *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0x0005 ); + p2pielen += 2; + + // Value: + // Country String + p2pie[ p2pielen++ ] = 'X'; + p2pie[ p2pielen++ ] = 'X'; + + // The third byte should be set to 0x04. + // Described in the "Operating Channel Attribute" section. + p2pie[ p2pielen++ ] = 0x04; + + // Operating Class + p2pie[ p2pielen++ ] = 0x51; // Copy from SD7 + + // Channel Number + p2pie[ p2pielen++ ] = pwdinfo->operating_channel; // operating channel number + + + // P2P Group BSSID + // Type: + p2pie[ p2pielen++ ] = P2P_ATTR_GROUP_BSSID; + + // Length: + *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( ETH_ALEN ); + p2pielen += 2; + + // Value: + // P2P Device Address for GO + _rtw_memcpy( p2pie + p2pielen, myid( &padapter->eeprompriv ), ETH_ALEN ); + p2pielen += ETH_ALEN; + + } + + // Channel List + // Type: + p2pie[ p2pielen++ ] = P2P_ATTR_CH_LIST; + + // Length: + // Country String(3) + // + ( Operating Class (1) + Number of Channels(1) ) * Operation Classes (?) + // + number of channels in all classes + len_channellist_attr = 3 + + (1 + 1) * (u16)pmlmeext->channel_list.reg_classes + + get_reg_classes_full_count(pmlmeext->channel_list); + +#ifdef CONFIG_CONCURRENT_MODE + if ( check_buddy_fwstate(padapter, _FW_LINKED ) ) + { + *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 5 + 1 ); + } + else + { + *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( len_channellist_attr ); + } +#else + + *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( len_channellist_attr ); + +#endif + p2pielen += 2; + + // Value: + // Country String + p2pie[ p2pielen++ ] = 'X'; + p2pie[ p2pielen++ ] = 'X'; + + // The third byte should be set to 0x04. + // Described in the "Operating Channel Attribute" section. + p2pie[ p2pielen++ ] = 0x04; + + // Channel Entry List +#ifdef CONFIG_CONCURRENT_MODE + if ( check_buddy_fwstate(padapter, _FW_LINKED ) ) + { + _adapter *pbuddy_adapter = padapter->pbuddy_adapter; + struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv; + + // Operating Class + if ( pbuddy_mlmeext->cur_channel > 14 ) + { + if ( pbuddy_mlmeext->cur_channel >= 149 ) + { + p2pie[ p2pielen++ ] = 0x7c; + } + else + { + p2pie[ p2pielen++ ] = 0x73; + } + } + else + { + p2pie[ p2pielen++ ] = 0x51; + } + + // Number of Channels + // Just support 1 channel and this channel is AP's channel + p2pie[ p2pielen++ ] = 1; + + // Channel List + p2pie[ p2pielen++ ] = pbuddy_mlmeext->cur_channel; + } + else + { + int i, j; + for (j = 0; j < pmlmeext->channel_list.reg_classes; j++) { + // Operating Class + p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].reg_class; + + // Number of Channels + p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].channels; + + // Channel List + for (i = 0; i < pmlmeext->channel_list.reg_class[j].channels; i++) { + p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].channel[i]; + } + } + } +#else // CONFIG_CONCURRENT_MODE + { + int i, j; + for (j = 0; j < pmlmeext->channel_list.reg_classes; j++) { + // Operating Class + p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].reg_class; + + // Number of Channels + p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].channels; + + // Channel List + for (i = 0; i < pmlmeext->channel_list.reg_class[j].channels; i++) { + p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].channel[i]; + } + } + } +#endif // CONFIG_CONCURRENT_MODE + } +#endif + + pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pktlen ); + +#ifdef CONFIG_WFD + wfdielen = build_invitation_resp_wfd_ie(pwdinfo, pframe); + pframe += wfdielen; + pktlen += wfdielen; +#endif //CONFIG_WFD + + *pLength = pktlen; + +#if 0 + // printf dbg msg + dbgbufLen = pktlen; + DBG_871X("======> DBG MSG FOR CONSTRAUCT Invite Rsp\n"); + + for(index=0;indexxmitpriv); + struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + struct wifidirect_info *pwdinfo = &( padapter->wdinfo); + + //for debug + u8 *dbgbuf = pframe; + u8 dbgbufLen = 0, index = 0; + + DBG_871X( "%s\n", __FUNCTION__); + + pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + + fctrl = &(pwlanhdr->frame_ctl); + *(fctrl) = 0; + + //RA filled by FW + _rtw_memset(pwlanhdr->addr1, 0, ETH_ALEN); + _rtw_memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); + _rtw_memcpy(pwlanhdr->addr3, myid(&(padapter->eeprompriv)), ETH_ALEN); + + SetSeqNum(pwlanhdr,0); + SetFrameSubType(pframe, WIFI_ACTION); + + pframe += sizeof(struct rtw_ieee80211_hdr_3addr); + pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + + pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pktlen)); + pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pktlen)); + pframe = rtw_set_fixed_ie(pframe, 4, (unsigned char *) &(p2poui), &(pktlen)); + pframe = rtw_set_fixed_ie(pframe, 1, &(oui_subtype), &(pktlen)); + //dialog token, filled by FW + pframe = rtw_set_fixed_ie(pframe, 1, &(dialogToken), &(pktlen)); + + wpsielen = 0; + // WPS OUI + //*(u32*) ( wpsie ) = cpu_to_be32( WPSOUI ); + RTW_PUT_BE32(wpsie, WPSOUI); + wpsielen += 4; + +#if 0 + // WPS version + // Type: + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_VER1 ); + wpsielen += 2; + + // Length: + *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( 0x0001 ); + wpsielen += 2; + + // Value: + wpsie[wpsielen++] = WPS_VERSION_1; // Version 1.0 +#endif + + // Config Method + // Type: + //*(u16*) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_CONF_METHOD ); + RTW_PUT_BE16(wpsie + wpsielen, WPS_ATTR_CONF_METHOD); + wpsielen += 2; + + // Length: + //*(u16*) ( wpsie + wpsielen ) = cpu_to_be16( 0x0002 ); + RTW_PUT_BE16(wpsie + wpsielen, 0x0002); + wpsielen += 2; + + // Value: filled by FW, default value is PBC + //*(u16*) ( wpsie + wpsielen ) = cpu_to_be16( config_method ); + RTW_PUT_BE16(wpsie + wpsielen, WPS_CM_PUSH_BUTTON); + wpsielen += 2; + + pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wpsielen, (unsigned char *) wpsie, &pktlen ); + +#ifdef CONFIG_WFD + wfdielen = build_provdisc_resp_wfd_ie(pwdinfo, pframe); + pframe += wfdielen; + pktlen += wfdielen; +#endif //CONFIG_WFD + + *pLength = pktlen; + + // printf dbg msg +#if 0 + dbgbufLen = pktlen; + DBG_871X("======> DBG MSG FOR CONSTRAUCT ProvisionDis Rsp\n"); + + for(index=0;indexHalFunc; + u8 ret = _FAIL; + + DBG_871X("P2PRsvdPageLoc: P2PBeacon=%d P2PProbeRsp=%d NegoRsp=%d InviteRsp=%d PDRsp=%d\n", + rsvdpageloc->LocP2PBeacon, rsvdpageloc->LocP2PProbeRsp, + rsvdpageloc->LocNegoRsp, rsvdpageloc->LocInviteRsp, + rsvdpageloc->LocPDRsp); + + SET_H2CCMD_RSVDPAGE_LOC_P2P_BCN(u1H2CP2PRsvdPageParm, rsvdpageloc->LocProbeRsp); + SET_H2CCMD_RSVDPAGE_LOC_P2P_PROBE_RSP(u1H2CP2PRsvdPageParm, rsvdpageloc->LocPsPoll); + SET_H2CCMD_RSVDPAGE_LOC_P2P_NEGO_RSP(u1H2CP2PRsvdPageParm, rsvdpageloc->LocNullData); + SET_H2CCMD_RSVDPAGE_LOC_P2P_INVITE_RSP(u1H2CP2PRsvdPageParm, rsvdpageloc->LocQosNull); + SET_H2CCMD_RSVDPAGE_LOC_P2P_PD_RSP(u1H2CP2PRsvdPageParm, rsvdpageloc->LocBTQosNull); + + //FillH2CCmd8723B(padapter, H2C_8723B_P2P_OFFLOAD_RSVD_PAGE, H2C_P2PRSVDPAGE_LOC_LEN, u1H2CP2PRsvdPageParm); + if (pHalFunc->fill_h2c_cmd != NULL) { + ret = pHalFunc->fill_h2c_cmd(adapter, + H2C_P2P_OFFLOAD_RSVD_PAGE, + H2C_P2PRSVDPAGE_LOC_LEN, + u1H2CP2PRsvdPageParm); + } else { + DBG_871X("%s: Please hook fill_h2c_cmd first!\n", __func__); + ret = _FAIL; + } + + return ret; +} + +u8 rtw_hal_set_p2p_wowlan_offload_cmd(_adapter* adapter) +{ + + u8 offload_cmd[H2C_P2P_OFFLOAD_LEN] = {0}; + struct wifidirect_info *pwdinfo = &(adapter->wdinfo); + struct P2P_WoWlan_Offload_t *p2p_wowlan_offload = (struct P2P_WoWlan_Offload_t *)offload_cmd; + struct hal_ops *pHalFunc = &adapter->HalFunc; + u8 ret = _FAIL; + + _rtw_memset(p2p_wowlan_offload,0 ,sizeof(struct P2P_WoWlan_Offload_t)); + DBG_871X("%s\n",__func__); + switch(pwdinfo->role) + { + case P2P_ROLE_DEVICE: + DBG_871X("P2P_ROLE_DEVICE\n"); + p2p_wowlan_offload->role = 0; + break; + case P2P_ROLE_CLIENT: + DBG_871X("P2P_ROLE_CLIENT\n"); + p2p_wowlan_offload->role = 1; + break; + case P2P_ROLE_GO: + DBG_871X("P2P_ROLE_GO\n"); + p2p_wowlan_offload->role = 2; + break; + default: + DBG_871X("P2P_ROLE_DISABLE\n"); + break; + } + p2p_wowlan_offload->Wps_Config[0] = pwdinfo->supported_wps_cm>>8; + p2p_wowlan_offload->Wps_Config[1] = pwdinfo->supported_wps_cm; + offload_cmd = (u8*)p2p_wowlan_offload; + DBG_871X("p2p_wowlan_offload: %x:%x:%x\n",offload_cmd[0],offload_cmd[1],offload_cmd[2]); + + if (pHalFunc->fill_h2c_cmd != NULL) { + ret = pHalFunc->fill_h2c_cmd(adapter, + H2C_P2P_OFFLOAD, + H2C_P2P_OFFLOAD_LEN, + offload_cmd); + } else { + DBG_871X("%s: Please hook fill_h2c_cmd first!\n", __func__); + ret = _FAIL; + } + + return ret; + + //FillH2CCmd8723B(adapter, H2C_8723B_P2P_OFFLOAD, sizeof(struct P2P_WoWlan_Offload_t), (u8 *)p2p_wowlan_offload); +} +#endif //CONFIG_P2P_WOWLAN + +static void rtw_hal_construct_beacon(_adapter *padapter, + u8 *pframe, u32 *pLength) +{ + struct rtw_ieee80211_hdr *pwlanhdr; + u16 *fctrl; + u32 rate_len, pktlen; + struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network); + u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; + + + //DBG_871X("%s\n", __FUNCTION__); + + pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + + fctrl = &(pwlanhdr->frame_ctl); + *(fctrl) = 0; + + _rtw_memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN); + _rtw_memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); + _rtw_memcpy(pwlanhdr->addr3, get_my_bssid(cur_network), ETH_ALEN); + + SetSeqNum(pwlanhdr, 0/*pmlmeext->mgnt_seq*/); + //pmlmeext->mgnt_seq++; + SetFrameSubType(pframe, WIFI_BEACON); + + pframe += sizeof(struct rtw_ieee80211_hdr_3addr); + pktlen = sizeof (struct rtw_ieee80211_hdr_3addr); + + //timestamp will be inserted by hardware + pframe += 8; + pktlen += 8; + + // beacon interval: 2 bytes + _rtw_memcpy(pframe, (unsigned char *)(rtw_get_beacon_interval_from_ie(cur_network->IEs)), 2); + + pframe += 2; + pktlen += 2; + + // capability info: 2 bytes + _rtw_memcpy(pframe, (unsigned char *)(rtw_get_capability_from_ie(cur_network->IEs)), 2); + + pframe += 2; + pktlen += 2; + + if( (pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) + { + //DBG_871X("ie len=%d\n", cur_network->IELength); + pktlen += cur_network->IELength - sizeof(NDIS_802_11_FIXED_IEs); + _rtw_memcpy(pframe, cur_network->IEs+sizeof(NDIS_802_11_FIXED_IEs), pktlen); + + goto _ConstructBeacon; + } + + //below for ad-hoc mode + + // SSID + pframe = rtw_set_ie(pframe, _SSID_IE_, cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &pktlen); + + // supported rates... + rate_len = rtw_get_rateset_len(cur_network->SupportedRates); + pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, ((rate_len > 8)? 8: rate_len), cur_network->SupportedRates, &pktlen); + + // DS parameter set + pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &pktlen); + + if( (pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) + { + u32 ATIMWindow; + // IBSS Parameter Set... + //ATIMWindow = cur->Configuration.ATIMWindow; + ATIMWindow = 0; + pframe = rtw_set_ie(pframe, _IBSS_PARA_IE_, 2, (unsigned char *)(&ATIMWindow), &pktlen); + } + + + //todo: ERP IE + + + // EXTERNDED SUPPORTED RATE + if (rate_len > 8) + { + pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_, (rate_len - 8), (cur_network->SupportedRates + 8), &pktlen); + } + + + //todo:HT for adhoc + +_ConstructBeacon: + + if ((pktlen + TXDESC_SIZE) > 512) + { + DBG_871X("beacon frame too large\n"); + return; + } + + *pLength = pktlen; + + //DBG_871X("%s bcn_sz=%d\n", __FUNCTION__, pktlen); + +} + +static void rtw_hal_construct_PSPoll(_adapter *padapter, + u8 *pframe, u32 *pLength) +{ + struct rtw_ieee80211_hdr *pwlanhdr; + u16 *fctrl; + u32 pktlen; + struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + + //DBG_871X("%s\n", __FUNCTION__); + + pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + + // Frame control. + fctrl = &(pwlanhdr->frame_ctl); + *(fctrl) = 0; + SetPwrMgt(fctrl); + SetFrameSubType(pframe, WIFI_PSPOLL); + + // AID. + SetDuration(pframe, (pmlmeinfo->aid | 0xc000)); + + // BSSID. + _rtw_memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); + + // TA. + _rtw_memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); + + *pLength = 16; +} + +static void rtw_hal_construct_NullFunctionData( + PADAPTER padapter, + u8 *pframe, + u32 *pLength, + u8 *StaAddr, + u8 bQoS, + u8 AC, + u8 bEosp, + u8 bForcePowerSave) +{ + struct rtw_ieee80211_hdr *pwlanhdr; + u16 *fctrl; + u32 pktlen; + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + struct wlan_network *cur_network = &pmlmepriv->cur_network; + struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + + + //DBG_871X("%s:%d\n", __FUNCTION__, bForcePowerSave); + + pwlanhdr = (struct rtw_ieee80211_hdr*)pframe; + + fctrl = &pwlanhdr->frame_ctl; + *(fctrl) = 0; + if (bForcePowerSave) + { + SetPwrMgt(fctrl); + } + + switch(cur_network->network.InfrastructureMode) + { + case Ndis802_11Infrastructure: + SetToDs(fctrl); + _rtw_memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); + _rtw_memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); + _rtw_memcpy(pwlanhdr->addr3, StaAddr, ETH_ALEN); + break; + case Ndis802_11APMode: + SetFrDs(fctrl); + _rtw_memcpy(pwlanhdr->addr1, StaAddr, ETH_ALEN); + _rtw_memcpy(pwlanhdr->addr2, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); + _rtw_memcpy(pwlanhdr->addr3, myid(&(padapter->eeprompriv)), ETH_ALEN); + break; + case Ndis802_11IBSS: + default: + _rtw_memcpy(pwlanhdr->addr1, StaAddr, ETH_ALEN); + _rtw_memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); + _rtw_memcpy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); + break; + } + + SetSeqNum(pwlanhdr, 0); + + if (bQoS == _TRUE) { + struct rtw_ieee80211_hdr_3addr_qos *pwlanqoshdr; + + SetFrameSubType(pframe, WIFI_QOS_DATA_NULL); + + pwlanqoshdr = (struct rtw_ieee80211_hdr_3addr_qos*)pframe; + SetPriority(&pwlanqoshdr->qc, AC); + SetEOSP(&pwlanqoshdr->qc, bEosp); + + pktlen = sizeof(struct rtw_ieee80211_hdr_3addr_qos); + } else { + SetFrameSubType(pframe, WIFI_DATA_NULL); + + pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + } + + *pLength = pktlen; +} + +#ifdef CONFIG_WOWLAN +// +// Description: +// Construct the ARP response packet to support ARP offload. +// +static void rtw_hal_construct_ARPRsp( + PADAPTER padapter, + u8 *pframe, + u32 *pLength, + u8 *pIPAddress + ) +{ + struct rtw_ieee80211_hdr *pwlanhdr; + u16 *fctrl; + u32 pktlen; + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + struct wlan_network *cur_network = &pmlmepriv->cur_network; + struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + struct security_priv *psecuritypriv = &padapter->securitypriv; + static u8 ARPLLCHeader[8] = {0xAA, 0xAA, 0x03, 0x00, 0x00, 0x00, 0x08, 0x06}; + u8 *pARPRspPkt = pframe; + //for TKIP Cal MIC + u8 *payload = pframe; + u8 EncryptionHeadOverhead = 0; + //DBG_871X("%s:%d\n", __FUNCTION__, bForcePowerSave); + + pwlanhdr = (struct rtw_ieee80211_hdr*)pframe; + + fctrl = &pwlanhdr->frame_ctl; + *(fctrl) = 0; + + //------------------------------------------------------------------------- + // MAC Header. + //------------------------------------------------------------------------- + SetFrameType(fctrl, WIFI_DATA); + //SetFrameSubType(fctrl, 0); + SetToDs(fctrl); + _rtw_memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); + _rtw_memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); + _rtw_memcpy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); + + SetSeqNum(pwlanhdr, 0); + SetDuration(pwlanhdr, 0); + //SET_80211_HDR_FRAME_CONTROL(pARPRspPkt, 0); + //SET_80211_HDR_TYPE_AND_SUBTYPE(pARPRspPkt, Type_Data); + //SET_80211_HDR_TO_DS(pARPRspPkt, 1); + //SET_80211_HDR_ADDRESS1(pARPRspPkt, pMgntInfo->Bssid); + //SET_80211_HDR_ADDRESS2(pARPRspPkt, Adapter->CurrentAddress); + //SET_80211_HDR_ADDRESS3(pARPRspPkt, pMgntInfo->Bssid); + + //SET_80211_HDR_DURATION(pARPRspPkt, 0); + //SET_80211_HDR_FRAGMENT_SEQUENCE(pARPRspPkt, 0); +#ifdef CONFIG_WAPI_SUPPORT + *pLength = sMacHdrLng; +#else + *pLength = 24; +#endif + switch (psecuritypriv->dot11PrivacyAlgrthm) { + case _WEP40_: + case _WEP104_: + EncryptionHeadOverhead = 4; + break; + case _TKIP_: + EncryptionHeadOverhead = 8; + break; + case _AES_: + EncryptionHeadOverhead = 8; + break; +#ifdef CONFIG_WAPI_SUPPORT + case _SMS4_: + EncryptionHeadOverhead = 18; + break; +#endif + default: + EncryptionHeadOverhead = 0; + } + + if(EncryptionHeadOverhead > 0) { + _rtw_memset(&(pframe[*pLength]), 0,EncryptionHeadOverhead); + *pLength += EncryptionHeadOverhead; + //SET_80211_HDR_WEP(pARPRspPkt, 1); //Suggested by CCW. + SetPrivacy(fctrl); + } + + //------------------------------------------------------------------------- + // Frame Body. + //------------------------------------------------------------------------- + pARPRspPkt = (u8*)(pframe+ *pLength); + payload = pARPRspPkt; //Get Payload pointer + // LLC header + _rtw_memcpy(pARPRspPkt, ARPLLCHeader, 8); + *pLength += 8; + + // ARP element + pARPRspPkt += 8; + SET_ARP_PKT_HW(pARPRspPkt, 0x0100); + SET_ARP_PKT_PROTOCOL(pARPRspPkt, 0x0008); // IP protocol + SET_ARP_PKT_HW_ADDR_LEN(pARPRspPkt, 6); + SET_ARP_PKT_PROTOCOL_ADDR_LEN(pARPRspPkt, 4); + SET_ARP_PKT_OPERATION(pARPRspPkt, 0x0200); // ARP response + SET_ARP_PKT_SENDER_MAC_ADDR(pARPRspPkt, myid(&(padapter->eeprompriv))); + SET_ARP_PKT_SENDER_IP_ADDR(pARPRspPkt, pIPAddress); +#ifdef CONFIG_ARP_KEEP_ALIVE + if (rtw_gw_addr_query(padapter)==0) { + SET_ARP_PKT_TARGET_MAC_ADDR(pARPRspPkt, pmlmepriv->gw_mac_addr); + SET_ARP_PKT_TARGET_IP_ADDR(pARPRspPkt, pmlmepriv->gw_ip); + } + else +#endif + { + SET_ARP_PKT_TARGET_MAC_ADDR(pARPRspPkt, + get_my_bssid(&(pmlmeinfo->network))); + SET_ARP_PKT_TARGET_IP_ADDR(pARPRspPkt, + pIPAddress); + DBG_871X("%s Target Mac Addr:" MAC_FMT "\n", __FUNCTION__, + MAC_ARG(get_my_bssid(&(pmlmeinfo->network)))); + DBG_871X("%s Target IP Addr" IP_FMT "\n", __FUNCTION__, + IP_ARG(pIPAddress)); + } + + *pLength += 28; + + if (psecuritypriv->dot11PrivacyAlgrthm == _TKIP_) { + u8 mic[8]; + struct mic_data micdata; + struct sta_info *psta = NULL; + u8 priority[4]={0x0,0x0,0x0,0x0}; + u8 null_key[16]={0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; + + DBG_871X("%s(): Add MIC\n",__FUNCTION__); + + psta = rtw_get_stainfo(&padapter->stapriv, + get_my_bssid(&(pmlmeinfo->network))); + if (psta != NULL) { + if(_rtw_memcmp(&psta->dot11tkiptxmickey.skey[0], + null_key, 16)==_TRUE) { + DBG_871X("%s(): STA dot11tkiptxmickey==0\n", + __func__); + } + //start to calculate the mic code + rtw_secmicsetkey(&micdata, + &psta->dot11tkiptxmickey.skey[0]); + } + + rtw_secmicappend(&micdata, pwlanhdr->addr3, 6); //DA + + rtw_secmicappend(&micdata, pwlanhdr->addr2, 6); //SA + + priority[0]=0; + + rtw_secmicappend(&micdata, &priority[0], 4); + + rtw_secmicappend(&micdata, payload, 36); //payload length = 8 + 28 + + rtw_secgetmic(&micdata,&(mic[0])); + + pARPRspPkt += 28; + _rtw_memcpy(pARPRspPkt, &(mic[0]),8); + + *pLength += 8; + } +} + +#ifdef CONFIG_PNO_SUPPORT +static void rtw_hal_construct_ProbeReq(_adapter *padapter, u8 *pframe, + u32 *pLength, pno_ssid_t *ssid) +{ + struct rtw_ieee80211_hdr *pwlanhdr; + u16 *fctrl; + u32 pktlen; + unsigned char *mac; + unsigned char bssrate[NumRates]; + struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); + struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + int bssrate_len = 0; + u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; + + pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + mac = myid(&(padapter->eeprompriv)); + + fctrl = &(pwlanhdr->frame_ctl); + *(fctrl) = 0; + + _rtw_memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN); + _rtw_memcpy(pwlanhdr->addr3, bc_addr, ETH_ALEN); + + _rtw_memcpy(pwlanhdr->addr2, mac, ETH_ALEN); + + SetSeqNum(pwlanhdr, 0); + SetFrameSubType(pframe, WIFI_PROBEREQ); + + pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += pktlen; + + if (ssid == NULL) { + pframe = rtw_set_ie(pframe, _SSID_IE_, 0, NULL, &pktlen); + } else { + //DBG_871X("%s len:%d\n", ssid->SSID, ssid->SSID_len); + pframe = rtw_set_ie(pframe, _SSID_IE_, ssid->SSID_len, ssid->SSID, &pktlen); + } + + get_rate_set(padapter, bssrate, &bssrate_len); + + if (bssrate_len > 8) + { + pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , 8, bssrate, &pktlen); + pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_ , (bssrate_len - 8), (bssrate + 8), &pktlen); + } + else + { + pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , bssrate_len , bssrate, &pktlen); + } + + *pLength = pktlen; +} + +static void rtw_hal_construct_PNO_info(_adapter *padapter, + u8 *pframe, u32*pLength) +{ + struct pwrctrl_priv *pwrctl = adapter_to_pwrctl(padapter); + + u8 *pPnoInfoPkt = pframe; + pPnoInfoPkt = (u8*)(pframe+ *pLength); + _rtw_memcpy(pPnoInfoPkt, &pwrctl->pnlo_info->ssid_num, 1); + + *pLength+=1; + pPnoInfoPkt += 1; + _rtw_memcpy(pPnoInfoPkt, &pwrctl->pnlo_info->hidden_ssid_num, 1); + + *pLength+=3; + pPnoInfoPkt += 3; + _rtw_memcpy(pPnoInfoPkt, &pwrctl->pnlo_info->fast_scan_period, 1); + + *pLength+=4; + pPnoInfoPkt += 4; + _rtw_memcpy(pPnoInfoPkt, &pwrctl->pnlo_info->fast_scan_iterations, 4); + + *pLength+=4; + pPnoInfoPkt += 4; + _rtw_memcpy(pPnoInfoPkt, &pwrctl->pnlo_info->slow_scan_period, 4); + + *pLength+=4; + pPnoInfoPkt += 4; + _rtw_memcpy(pPnoInfoPkt, &pwrctl->pnlo_info->ssid_length, + MAX_PNO_LIST_COUNT); + + *pLength+=MAX_PNO_LIST_COUNT; + pPnoInfoPkt += MAX_PNO_LIST_COUNT; + _rtw_memcpy(pPnoInfoPkt, &pwrctl->pnlo_info->ssid_cipher_info, + MAX_PNO_LIST_COUNT); + + *pLength+=MAX_PNO_LIST_COUNT; + pPnoInfoPkt += MAX_PNO_LIST_COUNT; + _rtw_memcpy(pPnoInfoPkt, &pwrctl->pnlo_info->ssid_channel_info, + MAX_PNO_LIST_COUNT); + + *pLength+=MAX_PNO_LIST_COUNT; + pPnoInfoPkt += MAX_PNO_LIST_COUNT; + _rtw_memcpy(pPnoInfoPkt, &pwrctl->pnlo_info->loc_probe_req, + MAX_HIDDEN_AP); + + *pLength+=MAX_HIDDEN_AP; + pPnoInfoPkt += MAX_HIDDEN_AP; +} + +static void rtw_hal_construct_ssid_list(_adapter *padapter, + u8 *pframe, u32 *pLength) +{ + struct pwrctrl_priv *pwrctl = adapter_to_pwrctl(padapter); + u8 *pSSIDListPkt = pframe; + int i; + + pSSIDListPkt = (u8*)(pframe+ *pLength); + + for(i = 0; i < pwrctl->pnlo_info->ssid_num ; i++) { + _rtw_memcpy(pSSIDListPkt, &pwrctl->pno_ssid_list->node[i].SSID, + pwrctl->pnlo_info->ssid_length[i]); + + *pLength += WLAN_SSID_MAXLEN; + pSSIDListPkt += WLAN_SSID_MAXLEN; + } +} + +static void rtw_hal_construct_scan_info(_adapter *padapter, + u8 *pframe, u32 *pLength) +{ + struct pwrctrl_priv *pwrctl = adapter_to_pwrctl(padapter); + u8 *pScanInfoPkt = pframe; + int i; + + pScanInfoPkt = (u8*)(pframe+ *pLength); + + _rtw_memcpy(pScanInfoPkt, &pwrctl->pscan_info->channel_num, 1); + + *pLength+=1; + pScanInfoPkt += 1; + _rtw_memcpy(pScanInfoPkt, &pwrctl->pscan_info->orig_ch, 1); + + + *pLength+=1; + pScanInfoPkt += 1; + _rtw_memcpy(pScanInfoPkt, &pwrctl->pscan_info->orig_bw, 1); + + + *pLength+=1; + pScanInfoPkt += 1; + _rtw_memcpy(pScanInfoPkt, &pwrctl->pscan_info->orig_40_offset, 1); + + *pLength+=1; + pScanInfoPkt += 1; + _rtw_memcpy(pScanInfoPkt, &pwrctl->pscan_info->orig_80_offset, 1); + + *pLength+=1; + pScanInfoPkt += 1; + _rtw_memcpy(pScanInfoPkt, &pwrctl->pscan_info->periodScan, 1); + + *pLength+=1; + pScanInfoPkt += 1; + _rtw_memcpy(pScanInfoPkt, &pwrctl->pscan_info->period_scan_time, 1); + + *pLength+=1; + pScanInfoPkt += 1; + _rtw_memcpy(pScanInfoPkt, &pwrctl->pscan_info->enableRFE, 1); + + *pLength+=1; + pScanInfoPkt += 1; + _rtw_memcpy(pScanInfoPkt, &pwrctl->pscan_info->rfe_type, 8); + + *pLength+=8; + pScanInfoPkt += 8; + + for(i = 0 ; i < MAX_SCAN_LIST_COUNT ; i ++) { + _rtw_memcpy(pScanInfoPkt, + &pwrctl->pscan_info->ssid_channel_info[i], 4); + *pLength+=4; + pScanInfoPkt += 4; + } +} +#endif //CONFIG_PNO_SUPPORT + +#ifdef CONFIG_GTK_OL +static void rtw_hal_construct_GTKRsp( + PADAPTER padapter, + u8 *pframe, + u32 *pLength + ) +{ + struct rtw_ieee80211_hdr *pwlanhdr; + u16 *fctrl; + u32 pktlen; + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + struct wlan_network *cur_network = &pmlmepriv->cur_network; + struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + struct security_priv *psecuritypriv = &padapter->securitypriv; + static u8 LLCHeader[8] = {0xAA, 0xAA, 0x03, 0x00, 0x00, 0x00, 0x88, 0x8E}; + static u8 GTKbody_a[11] ={0x01, 0x03, 0x00, 0x5F, 0x02, 0x03, 0x12, 0x00, 0x10, 0x42, 0x0B}; + u8 *pGTKRspPkt = pframe; + u8 EncryptionHeadOverhead = 0; + //DBG_871X("%s:%d\n", __FUNCTION__, bForcePowerSave); + + pwlanhdr = (struct rtw_ieee80211_hdr*)pframe; + + fctrl = &pwlanhdr->frame_ctl; + *(fctrl) = 0; + + //------------------------------------------------------------------------- + // MAC Header. + //------------------------------------------------------------------------- + SetFrameType(fctrl, WIFI_DATA); + //SetFrameSubType(fctrl, 0); + SetToDs(fctrl); + + _rtw_memcpy(pwlanhdr->addr1, + get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); + + _rtw_memcpy(pwlanhdr->addr2, + myid(&(padapter->eeprompriv)), ETH_ALEN); + + _rtw_memcpy(pwlanhdr->addr3, + get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); + + SetSeqNum(pwlanhdr, 0); + SetDuration(pwlanhdr, 0); + +#ifdef CONFIG_WAPI_SUPPORT + *pLength = sMacHdrLng; +#else + *pLength = 24; +#endif //CONFIG_WAPI_SUPPORT + + //------------------------------------------------------------------------- + // Security Header: leave space for it if necessary. + //------------------------------------------------------------------------- + switch (psecuritypriv->dot11PrivacyAlgrthm) { + case _WEP40_: + case _WEP104_: + EncryptionHeadOverhead = 4; + break; + case _TKIP_: + EncryptionHeadOverhead = 8; + break; + case _AES_: + EncryptionHeadOverhead = 8; + break; +#ifdef CONFIG_WAPI_SUPPORT + case _SMS4_: + EncryptionHeadOverhead = 18; + break; +#endif //CONFIG_WAPI_SUPPORT + default: + EncryptionHeadOverhead = 0; + } + + if (EncryptionHeadOverhead > 0) { + _rtw_memset(&(pframe[*pLength]), 0,EncryptionHeadOverhead); + *pLength += EncryptionHeadOverhead; + //SET_80211_HDR_WEP(pGTKRspPkt, 1); //Suggested by CCW. + //GTK's privacy bit is done by FW + //SetPrivacy(fctrl); + } + //------------------------------------------------------------------------- + // Frame Body. + //------------------------------------------------------------------------- + pGTKRspPkt = (u8*)(pframe+ *pLength); + // LLC header + _rtw_memcpy(pGTKRspPkt, LLCHeader, 8); + *pLength += 8; + + // GTK element + pGTKRspPkt += 8; + + //GTK frame body after LLC, part 1 + _rtw_memcpy(pGTKRspPkt, GTKbody_a, 11); + *pLength += 11; + pGTKRspPkt += 11; + //GTK frame body after LLC, part 2 + _rtw_memset(&(pframe[*pLength]), 0, 88); + *pLength += 88; + pGTKRspPkt += 88; + +} +#endif //CONFIG_GTK_OL +#endif //CONFIG_WOWLAN + +void rtw_hal_fill_fake_txdesc(_adapter* padapter, u8* pDesc, u32 BufferLen, + u8 IsPsPoll, u8 IsBTQosNull, u8 bDataFrame) +{ + struct hal_ops *pHalFunc = &padapter->HalFunc; + if (pHalFunc->fill_fake_txdesc == NULL) { + DBG_871X_LEVEL(_drv_err_, + "%s missing fill_fake_txdesc\n", __func__); + return; + } else { + pHalFunc->fill_fake_txdesc(padapter, pDesc, BufferLen, + IsPsPoll, IsBTQosNull, bDataFrame); + } +} + +// +// Description: Fill the reserved packets that FW will use to RSVD page. +// Now we just send 4 types packet to rsvd page. +// (1)Beacon, (2)Ps-poll, (3)Null data, (4)ProbeRsp. +// Input: +// finished - FALSE:At the first time we will send all the packets as a large packet to Hw, +// so we need to set the packet length to total lengh. +// TRUE: At the second time, we should send the first packet (default:beacon) +// to Hw again and set the lengh in descriptor to the real beacon lengh. +// 2009.10.15 by tynli. +// +//Page Size = 128: 8188e, 8723a/b, 8192c/d, +//Page Size = 256: 8192e, 8821a +//Page Size = 512: 8812a +void rtw_hal_set_fw_rsvd_page(_adapter* adapter, bool finished) +{ + PHAL_DATA_TYPE pHalData; + struct xmit_frame *pcmdframe; + struct pkt_attrib *pattrib; + struct xmit_priv *pxmitpriv; + struct mlme_ext_priv *pmlmeext; + struct mlme_ext_info *pmlmeinfo; + struct pwrctrl_priv *pwrctl; + struct mlme_priv *pmlmepriv = &adapter->mlmepriv; + struct hal_ops *pHalFunc = &adapter->HalFunc; + u32 BeaconLength = 0, ProbeRspLength = 0, PSPollLength = 0; + u32 NullDataLength = 0, QosNullLength = 0, BTQosNullLength = 0; + u32 ProbeReqLength = 0, NullFunctionDataLength = 0; + u8 TxDescLen = TXDESC_SIZE, TxDescOffset = TXDESC_OFFSET; + u8 TotalPageNum=0, CurtPktPageNum=0, RsvdPageNum=0; + u8 *ReservedPagePacket; + u16 BufIndex = 0; + u32 TotalPacketLen = 0, MaxRsvdPageBufSize = 0, PageSize = 0; + RSVDPAGE_LOC RsvdPageLoc; +#ifdef CONFIG_WOWLAN + u32 ARPLegnth = 0, GTKLegnth = 0, PNOLength = 0, ScanInfoLength = 0; + u32 SSIDLegnth = 0; + struct security_priv *psecuritypriv = &adapter->securitypriv; //added by xx + u8 currentip[4]; + u8 cur_dot11txpn[8]; +#ifdef CONFIG_GTK_OL + struct sta_priv *pstapriv = &adapter->stapriv; + struct security_priv *psecpriv = NULL; + struct sta_info * psta; + u8 kek[RTW_KEK_LEN]; + u8 kck[RTW_KCK_LEN]; +#endif //CONFIG_GTK_OL +#ifdef CONFIG_PNO_SUPPORT + int index; + u8 ssid_num; +#endif //CONFIG_PNO_SUPPORT +#endif +#ifdef DBG_CONFIG_ERROR_DETECT + struct sreset_priv *psrtpriv; +#endif // DBG_CONFIG_ERROR_DETECT + +#ifdef CONFIG_P2P_WOWLAN + u32 P2PNegoRspLength = 0, P2PInviteRspLength = 0, P2PPDRspLength = 0, P2PProbeRspLength = 0, P2PBCNLength = 0; +#endif + + pHalData = GET_HAL_DATA(adapter); +#ifdef DBG_CONFIG_ERROR_DETECT + psrtpriv = &pHalData->srestpriv; +#endif + pxmitpriv = &adapter->xmitpriv; + pmlmeext = &adapter->mlmeextpriv; + pmlmeinfo = &pmlmeext->mlmext_info; + pwrctl = adapter_to_pwrctl(adapter); + + rtw_hal_get_def_var(adapter, HAL_DEF_TX_PAGE_SIZE, (u8 *)&PageSize); + + if (PageSize == 0) { + DBG_871X("[Error]: %s, PageSize is zero!!\n", __func__); + return; + } + + if (pHalFunc->hal_get_tx_buff_rsvd_page_num != NULL) { + RsvdPageNum = + pHalFunc->hal_get_tx_buff_rsvd_page_num(adapter, _TRUE); + DBG_871X("%s PageSize: %d, RsvdPageNUm: %d\n", + __func__, PageSize, RsvdPageNum); + } else { + DBG_871X("[Error]: %s, missing tx_buff_rsvd_page_num func!!\n", + __func__); + return; + } + + MaxRsvdPageBufSize = RsvdPageNum*PageSize; + + pcmdframe = rtw_alloc_cmdxmitframe(pxmitpriv); + if (pcmdframe == NULL) { + DBG_871X("%s: alloc ReservedPagePacket fail!\n", __FUNCTION__); + return; + } + + ReservedPagePacket = pcmdframe->buf_addr; + _rtw_memset(&RsvdPageLoc, 0, sizeof(RSVDPAGE_LOC)); + + //beacon * 2 pages + BufIndex = TxDescOffset; + rtw_hal_construct_beacon(adapter, + &ReservedPagePacket[BufIndex], &BeaconLength); + + // When we count the first page size, we need to reserve description size for the RSVD + // packet, it will be filled in front of the packet in TXPKTBUF. + CurtPktPageNum = (u8)PageNum_128(TxDescLen + BeaconLength); + //If we don't add 1 more page, the WOWLAN function has a problem. Baron thinks it's a bug of firmware + if (CurtPktPageNum == 1) + CurtPktPageNum += 1; + + TotalPageNum += CurtPktPageNum; + + BufIndex += (CurtPktPageNum*PageSize); + + //ps-poll * 1 page + RsvdPageLoc.LocPsPoll = TotalPageNum; + DBG_871X("LocPsPoll: %d\n", RsvdPageLoc.LocPsPoll); + rtw_hal_construct_PSPoll(adapter, + &ReservedPagePacket[BufIndex], &PSPollLength); + rtw_hal_fill_fake_txdesc(adapter, + &ReservedPagePacket[BufIndex-TxDescLen], + PSPollLength, _TRUE, _FALSE, _FALSE); + + CurtPktPageNum = (u8)PageNum((TxDescLen + PSPollLength), PageSize); + + TotalPageNum += CurtPktPageNum; + + BufIndex += (CurtPktPageNum*PageSize); + +#ifdef CONFIG_BT_COEXIST + //BT Qos null data * 1 page + RsvdPageLoc.LocBTQosNull = TotalPageNum; + DBG_871X("LocBTQosNull: %d\n", RsvdPageLoc.LocBTQosNull); + rtw_hal_construct_NullFunctionData( + adapter, + &ReservedPagePacket[BufIndex], + &BTQosNullLength, + get_my_bssid(&pmlmeinfo->network), + _TRUE, 0, 0, _FALSE); + rtw_hal_fill_fake_txdesc(adapter, + &ReservedPagePacket[BufIndex-TxDescLen], + BTQosNullLength, _FALSE, _TRUE, _FALSE); + + CurtPktPageNum = (u8)PageNum(TxDescLen + BTQosNullLength, PageSize); + + TotalPageNum += CurtPktPageNum; + + BufIndex += (CurtPktPageNum*PageSize); +#endif //CONFIG_BT_COEXIT + + //null data * 1 page + RsvdPageLoc.LocNullData = TotalPageNum; + DBG_871X("LocNullData: %d\n", RsvdPageLoc.LocNullData); + rtw_hal_construct_NullFunctionData( + adapter, + &ReservedPagePacket[BufIndex], + &NullDataLength, + get_my_bssid(&pmlmeinfo->network), + _FALSE, 0, 0, _FALSE); + rtw_hal_fill_fake_txdesc(adapter, + &ReservedPagePacket[BufIndex-TxDescLen], + NullDataLength, _FALSE, _FALSE, _FALSE); + + CurtPktPageNum = (u8)PageNum(TxDescLen + NullDataLength, PageSize); + + TotalPageNum += CurtPktPageNum; + + BufIndex += (CurtPktPageNum*PageSize); + + //Qos null data * 1 page + RsvdPageLoc.LocQosNull = TotalPageNum; + DBG_871X("LocQosNull: %d\n", RsvdPageLoc.LocQosNull); + rtw_hal_construct_NullFunctionData( + adapter, + &ReservedPagePacket[BufIndex], + &QosNullLength, + get_my_bssid(&pmlmeinfo->network), + _TRUE, 0, 0, _FALSE); + rtw_hal_fill_fake_txdesc(adapter, + &ReservedPagePacket[BufIndex-TxDescLen], + QosNullLength, _FALSE, _FALSE, _FALSE); + + CurtPktPageNum = (u8)PageNum(TxDescLen + QosNullLength, PageSize); + + TotalPageNum += CurtPktPageNum; + + BufIndex += (CurtPktPageNum*PageSize); + +#ifdef CONFIG_WOWLAN + if (pwrctl->wowlan_mode == _TRUE && + check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) { + //ARP RSP * 1 page + rtw_get_current_ip_address(adapter, currentip); + + RsvdPageLoc.LocArpRsp= TotalPageNum; + + rtw_hal_construct_ARPRsp( + adapter, + &ReservedPagePacket[BufIndex], + &ARPLegnth, + currentip); + + rtw_hal_fill_fake_txdesc(adapter, + &ReservedPagePacket[BufIndex-TxDescLen], + ARPLegnth, _FALSE, _FALSE, _TRUE); + + CurtPktPageNum = (u8)PageNum(TxDescLen + ARPLegnth, PageSize); + + TotalPageNum += CurtPktPageNum; + + BufIndex += (CurtPktPageNum*PageSize); + + //3 SEC IV * 1 page + rtw_get_sec_iv(adapter, cur_dot11txpn, + get_my_bssid(&pmlmeinfo->network)); + + RsvdPageLoc.LocRemoteCtrlInfo = TotalPageNum; + + _rtw_memcpy(ReservedPagePacket+BufIndex-TxDescLen, + cur_dot11txpn, _AES_IV_LEN_); + + CurtPktPageNum = (u8)PageNum(_AES_IV_LEN_, PageSize); + + TotalPageNum += CurtPktPageNum; +#ifdef CONFIG_GTK_OL + BufIndex += (CurtPktPageNum*PageSize); + + //if the ap staion info. exists, get the kek, kck from staion info. + psta = rtw_get_stainfo(pstapriv, get_bssid(pmlmepriv)); + if (psta == NULL) { + _rtw_memset(kek, 0, RTW_KEK_LEN); + _rtw_memset(kck, 0, RTW_KCK_LEN); + DBG_8192C("%s, KEK, KCK download rsvd page all zero \n", + __func__); + } else { + _rtw_memcpy(kek, psta->kek, RTW_KEK_LEN); + _rtw_memcpy(kck, psta->kck, RTW_KCK_LEN); + } + + //3 KEK, KCK + RsvdPageLoc.LocGTKInfo = TotalPageNum; + if(IS_HARDWARE_TYPE_8188E(adapter) || IS_HARDWARE_TYPE_8812(adapter)){ + psecpriv = &adapter->securitypriv; + _rtw_memcpy(ReservedPagePacket+BufIndex-TxDescLen, + &psecpriv->dot11PrivacyAlgrthm, 1); + _rtw_memcpy(ReservedPagePacket+BufIndex-TxDescLen+1, + &psecpriv->dot118021XGrpPrivacy, 1); + _rtw_memcpy(ReservedPagePacket+BufIndex-TxDescLen+2, + kck, RTW_KCK_LEN); + _rtw_memcpy(ReservedPagePacket+BufIndex-TxDescLen+2+RTW_KCK_LEN, + kek, RTW_KEK_LEN); + + CurtPktPageNum = (u8)PageNum(TxDescLen + 2 + RTW_KCK_LEN + RTW_KEK_LEN, PageSize); + } + else{ + _rtw_memcpy(ReservedPagePacket+BufIndex-TxDescLen, + kck, RTW_KCK_LEN); + _rtw_memcpy(ReservedPagePacket+BufIndex-TxDescLen+RTW_KCK_LEN, + kek, RTW_KEK_LEN); + + CurtPktPageNum = (u8)PageNum(TxDescLen + RTW_KCK_LEN + RTW_KEK_LEN, PageSize); + } +#if 0 + { + int i; + printk("\ntoFW KCK: "); + for(i=0;i<16; i++) + printk(" %02x ", kck[i]); + printk("\ntoFW KEK: "); + for(i=0;i<16; i++) + printk(" %02x ", kek[i]); + printk("\n"); + } +#endif + + //DBG_871X("%s(): HW_VAR_SET_TX_CMD: KEK KCK %p %d\n", + // __FUNCTION__, &ReservedPagePacket[BufIndex-TxDescLen], + // (TxDescLen + RTW_KCK_LEN + RTW_KEK_LEN)); + + TotalPageNum += CurtPktPageNum; + + BufIndex += (CurtPktPageNum*PageSize); + + //3 GTK Response + RsvdPageLoc.LocGTKRsp= TotalPageNum; + rtw_hal_construct_GTKRsp( + adapter, + &ReservedPagePacket[BufIndex], + >KLegnth); + + rtw_hal_fill_fake_txdesc(adapter, + &ReservedPagePacket[BufIndex-TxDescLen], + GTKLegnth, _FALSE, _FALSE, _TRUE); +#if 0 + { + int gj; + printk("123GTK pkt=> \n"); + for(gj=0; gj < GTKLegnth+TxDescLen; gj++) { + printk(" %02x ", ReservedPagePacket[BufIndex-TxDescLen+gj]); + if ((gj + 1)%16==0) + printk("\n"); + } + printk(" <=end\n"); + } +#endif + + //DBG_871X("%s(): HW_VAR_SET_TX_CMD: GTK RSP %p %d\n", + // __FUNCTION__, &ReservedPagePacket[BufIndex-TxDescLen], + // (TxDescLen + GTKLegnth)); + + CurtPktPageNum = (u8)PageNum(TxDescLen + GTKLegnth, PageSize); + + TotalPageNum += CurtPktPageNum; + + BufIndex += (CurtPktPageNum*PageSize); + + //below page is empty for GTK extension memory + //3(11) GTK EXT MEM + RsvdPageLoc.LocGTKEXTMEM= TotalPageNum; + + CurtPktPageNum = 2; + + TotalPageNum += CurtPktPageNum; + //extension memory for FW + TotalPacketLen = BufIndex-TxDescLen + (PageSize*CurtPktPageNum); +#else //CONFIG_GTK_OL + TotalPacketLen = BufIndex + _AES_IV_LEN_; +#endif //CONFIG_GTK_OL + } else if (pwrctl->wowlan_pno_enable == _TRUE) { +#ifdef CONFIG_PNO_SUPPORT + if (pwrctl->pno_in_resume == _FALSE && + pwrctl->pno_inited == _TRUE) { + + //Broadcast Probe Request + RsvdPageLoc.LocProbePacket = TotalPageNum; + + DBG_871X("loc_probe_req: %d\n", + RsvdPageLoc.LocProbePacket); + + rtw_hal_construct_ProbeReq( + adapter, + &ReservedPagePacket[BufIndex], + &ProbeReqLength, + NULL); + + rtw_hal_fill_fake_txdesc(adapter, + &ReservedPagePacket[BufIndex-TxDescLen], + ProbeReqLength, _FALSE, _FALSE, _FALSE); + + CurtPktPageNum = + (u8)PageNum(TxDescLen + ProbeReqLength, PageSize); + + TotalPageNum += CurtPktPageNum; + + BufIndex += (CurtPktPageNum*PageSize); + + //Hidden SSID Probe Request + ssid_num = pwrctl->pnlo_info->hidden_ssid_num; + + for (index = 0 ; index < ssid_num ; index++) { + pwrctl->pnlo_info->loc_probe_req[index] = + TotalPageNum; + + rtw_hal_construct_ProbeReq( + adapter, + &ReservedPagePacket[BufIndex], + &ProbeReqLength, + &pwrctl->pno_ssid_list->node[index]); + + rtw_hal_fill_fake_txdesc(adapter, + &ReservedPagePacket[BufIndex-TxDescLen], + ProbeReqLength, _FALSE, _FALSE, _FALSE); + + CurtPktPageNum = + (u8)PageNum(TxDescLen + ProbeReqLength, PageSize); + + TotalPageNum += CurtPktPageNum; + + BufIndex += (CurtPktPageNum*PageSize); + } + + //PNO INFO Page + RsvdPageLoc.LocPNOInfo = TotalPageNum; + rtw_hal_construct_PNO_info(adapter, + &ReservedPagePacket[BufIndex -TxDescLen], + &PNOLength); + + CurtPktPageNum = (u8)PageNum_128(PNOLength); + TotalPageNum += CurtPktPageNum; + BufIndex += (CurtPktPageNum*PageSize); + + //SSID List Page + RsvdPageLoc.LocSSIDInfo = TotalPageNum; + rtw_hal_construct_ssid_list(adapter, + &ReservedPagePacket[BufIndex-TxDescLen], + &SSIDLegnth); + + CurtPktPageNum = (u8)PageNum_128(SSIDLegnth); + TotalPageNum += CurtPktPageNum; + BufIndex += (CurtPktPageNum*PageSize); + + //Scan Info Page + RsvdPageLoc.LocScanInfo = TotalPageNum; + rtw_hal_construct_scan_info(adapter, + &ReservedPagePacket[BufIndex-TxDescLen], + &ScanInfoLength); + + CurtPktPageNum = (u8)PageNum(ScanInfoLength, PageSize); + TotalPageNum += CurtPktPageNum; + BufIndex += (CurtPktPageNum*PageSize); + TotalPacketLen = BufIndex + ScanInfoLength; + } else { + TotalPacketLen = BufIndex + QosNullLength; + } +#endif //CONFIG_PNO_SUPPORT + } else { + TotalPacketLen = BufIndex + QosNullLength; + } +#else //CONFIG_WOWLAN + TotalPacketLen = BufIndex + QosNullLength; +#endif //CONFIG_WOWLAN + +#ifdef CONFIG_P2P_WOWLAN + if(_TRUE == pwrctl->wowlan_p2p_mode) + { + + // P2P Beacon + RsvdPageLoc.LocP2PBeacon= TotalPageNum; + rtw_hal_construct_P2PBeacon( + adapter, + &ReservedPagePacket[BufIndex], + &P2PBCNLength); + rtw_hal_fill_fake_txdesc(adapter, + &ReservedPagePacket[BufIndex-TxDescLen], + P2PBCNLength, _FALSE, _FALSE, _FALSE); + + //DBG_871X("%s(): HW_VAR_SET_TX_CMD: PROBE RSP %p %d\n", + // __FUNCTION__, &ReservedPagePacket[BufIndex-TxDescLen], (P2PBCNLength+TxDescLen)); + + CurtPktPageNum = (u8)PageNum(TxDescLen + P2PBCNLength, PageSize); + + TotalPageNum += CurtPktPageNum; + + BufIndex += (CurtPktPageNum*PageSize); + + // P2P Probe rsp + RsvdPageLoc.LocP2PProbeRsp = TotalPageNum; + rtw_hal_construct_P2PProbeRsp( + adapter, + &ReservedPagePacket[BufIndex], + &P2PProbeRspLength); + rtw_hal_fill_fake_txdesc(adapter, + &ReservedPagePacket[BufIndex-TxDescLen], + P2PProbeRspLength, _FALSE, _FALSE, _FALSE); + + //DBG_871X("%s(): HW_VAR_SET_TX_CMD: PROBE RSP %p %d\n", + // __FUNCTION__, &ReservedPagePacket[BufIndex-TxDescLen], (P2PProbeRspLength+TxDescLen)); + + CurtPktPageNum = (u8)PageNum(TxDescLen + P2PProbeRspLength, PageSize); + + TotalPageNum += CurtPktPageNum; + + BufIndex += (CurtPktPageNum*PageSize); + + //P2P nego rsp + RsvdPageLoc.LocNegoRsp = TotalPageNum; + rtw_hal_construct_P2PNegoRsp( + adapter, + &ReservedPagePacket[BufIndex], + &P2PNegoRspLength); + rtw_hal_fill_fake_txdesc(adapter, + &ReservedPagePacket[BufIndex-TxDescLen], + P2PNegoRspLength, _FALSE, _FALSE, _FALSE); + + //DBG_871X("%s(): HW_VAR_SET_TX_CMD: QOS NULL DATA %p %d\n", + // __FUNCTION__, &ReservedPagePacket[BufIndex-TxDescLen], (NegoRspLength+TxDescLen)); + + CurtPktPageNum = (u8)PageNum(TxDescLen + P2PNegoRspLength, PageSize); + + TotalPageNum += CurtPktPageNum; + + BufIndex += (CurtPktPageNum*PageSize); + + //P2P invite rsp + RsvdPageLoc.LocInviteRsp = TotalPageNum; + rtw_hal_construct_P2PInviteRsp( + adapter, + &ReservedPagePacket[BufIndex], + &P2PInviteRspLength); + rtw_hal_fill_fake_txdesc(adapter, + &ReservedPagePacket[BufIndex-TxDescLen], + P2PInviteRspLength, _FALSE, _FALSE, _FALSE); + + //DBG_871X("%s(): HW_VAR_SET_TX_CMD: QOS NULL DATA %p %d\n", + // __FUNCTION__, &ReservedPagePacket[BufIndex-TxDescLen], (InviteRspLength+TxDescLen)); + + CurtPktPageNum = (u8)PageNum(TxDescLen + P2PInviteRspLength, PageSize); + + TotalPageNum += CurtPktPageNum; + + BufIndex += (CurtPktPageNum*PageSize); + + //P2P provision discovery rsp + RsvdPageLoc.LocPDRsp = TotalPageNum; + rtw_hal_construct_P2PProvisionDisRsp( + adapter, + &ReservedPagePacket[BufIndex], + &P2PPDRspLength); + rtw_hal_fill_fake_txdesc(adapter, + &ReservedPagePacket[BufIndex-TxDescLen], + P2PPDRspLength, _FALSE, _FALSE, _FALSE); + + //DBG_871X("%s(): HW_VAR_SET_TX_CMD: QOS NULL DATA %p %d\n", + // __FUNCTION__, &ReservedPagePacket[BufIndex-TxDescLen], (PDRspLength+TxDescLen)); + + CurtPktPageNum = (u8)PageNum(TxDescLen + P2PPDRspLength, PageSize); + + TotalPageNum += CurtPktPageNum; + + BufIndex += (CurtPktPageNum*PageSize); + + TotalPacketLen = BufIndex + P2PPDRspLength; + } +#endif //CONFIG_P2P_WOWLAN + + if(TotalPacketLen > MaxRsvdPageBufSize) { + DBG_871X("%s(ERROR): rsvd page size is not enough!!TotalPacketLen %d, MaxRsvdPageBufSize %d\n", + __FUNCTION__, TotalPacketLen,MaxRsvdPageBufSize); + goto error; + } else { + // update attribute + pattrib = &pcmdframe->attrib; + update_mgntframe_attrib(adapter, pattrib); + pattrib->qsel = 0x10; + pattrib->pktlen = pattrib->last_txcmdsz = TotalPacketLen - TxDescOffset; +#ifdef CONFIG_PCI_HCI + dump_mgntframe(adapter, pcmdframe); +#else + dump_mgntframe_and_wait(adapter, pcmdframe, 100); +#endif + } + + DBG_871X("%s: Set RSVD page location to Fw ,TotalPacketLen(%d), TotalPageNum(%d)\n", + __func__,TotalPacketLen,TotalPageNum); + + if(check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) { + rtw_hal_set_FwRsvdPage_cmd(adapter, &RsvdPageLoc); + if (pwrctl->wowlan_mode == _TRUE) + rtw_hal_set_FwAoacRsvdPage_cmd(adapter, &RsvdPageLoc); + } else if (pwrctl->wowlan_pno_enable) { +#ifdef CONFIG_PNO_SUPPORT + rtw_hal_set_FwAoacRsvdPage_cmd(adapter, &RsvdPageLoc); + if(pwrctl->pno_in_resume) + rtw_hal_set_scan_offload_info_cmd(adapter, + &RsvdPageLoc, 0); + else + rtw_hal_set_scan_offload_info_cmd(adapter, + &RsvdPageLoc, 1); +#endif //CONFIG_PNO_SUPPORT + } +#ifdef CONFIG_P2P_WOWLAN + if(_TRUE == pwrctl->wowlan_p2p_mode) + rtw_hal_set_FwP2PRsvdPage_cmd(adapter, &RsvdPageLoc); + +#endif //CONFIG_P2P_WOWLAN + return; +error: + rtw_free_xmitframe(pxmitpriv, pcmdframe); +} + +void SetHwReg(_adapter *adapter, u8 variable, u8 *val) +{ + HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter); + DM_ODM_T *odm = &(hal_data->odmpriv); + +_func_enter_; + + switch (variable) { + case HW_VAR_INITIAL_GAIN: + { + u8 rx_gain = *((u8 *)(val)); + //printk("rx_gain:%x\n",rx_gain); + if(rx_gain == 0xff){//restore rx gain + //ODM_Write_DIG(podmpriv,pDigTable->BackupIGValue); + odm_PauseDIG(odm, ODM_RESUME_DIG,rx_gain); + } + else{ + //pDigTable->BackupIGValue = pDigTable->CurIGValue; + //ODM_Write_DIG(podmpriv,rx_gain); + odm_PauseDIG(odm, ODM_PAUSE_DIG,rx_gain); + } + } + break; + case HW_VAR_PORT_SWITCH: + hw_var_port_switch(adapter); + break; + case HW_VAR_INIT_RTS_RATE: + { + u16 brate_cfg = *((u16*)val); + u8 rate_index = 0; + HAL_VERSION *hal_ver = &hal_data->VersionID; + + if (IS_81XXC(*hal_ver) ||IS_92D(*hal_ver) || IS_8723_SERIES(*hal_ver) || IS_8188E(*hal_ver)) { + + while (brate_cfg > 0x1) { + brate_cfg = (brate_cfg >> 1); + rate_index++; + } + rtw_write8(adapter, REG_INIRTS_RATE_SEL, rate_index); + } else { + rtw_warn_on(1); + } + } + break; + case HW_VAR_SEC_CFG: + { + #if defined(CONFIG_CONCURRENT_MODE) && !defined(DYNAMIC_CAMID_ALLOC) + // enable tx enc and rx dec engine, and no key search for MC/BC + rtw_write8(adapter, REG_SECCFG, SCR_NoSKMC|SCR_RxDecEnable|SCR_TxEncEnable); + #elif defined(DYNAMIC_CAMID_ALLOC) + u16 reg_scr; + + reg_scr = rtw_read16(adapter, REG_SECCFG); + rtw_write16(adapter, REG_SECCFG, reg_scr|SCR_CHK_KEYID|SCR_RxDecEnable|SCR_TxEncEnable); + #else + rtw_write8(adapter, REG_SECCFG, *((u8*)val)); + #endif + } + break; + case HW_VAR_SEC_DK_CFG: + { + struct security_priv *sec = &adapter->securitypriv; + u8 reg_scr = rtw_read8(adapter, REG_SECCFG); + + if (val) /* Enable default key related setting */ + { + reg_scr |= SCR_TXBCUSEDK; + if (sec->dot11AuthAlgrthm != dot11AuthAlgrthm_8021X) + reg_scr |= (SCR_RxUseDK|SCR_TxUseDK); + } + else /* Disable default key related setting */ + { + reg_scr &= ~(SCR_RXBCUSEDK|SCR_TXBCUSEDK|SCR_RxUseDK|SCR_TxUseDK); + } + + rtw_write8(adapter, REG_SECCFG, reg_scr); + } + break; + case HW_VAR_DM_FLAG: + odm->SupportAbility = *((u32*)val); + break; + case HW_VAR_DM_FUNC_OP: + if (*((u8*)val) == _TRUE) { + /* save dm flag */ + odm->BK_SupportAbility = odm->SupportAbility; + } else { + /* restore dm flag */ + odm->SupportAbility = odm->BK_SupportAbility; + } + break; + case HW_VAR_DM_FUNC_SET: + if(*((u32*)val) == DYNAMIC_ALL_FUNC_ENABLE){ + struct dm_priv *dm = &hal_data->dmpriv; + dm->DMFlag = dm->InitDMFlag; + odm->SupportAbility = dm->InitODMFlag; + } else { + odm->SupportAbility |= *((u32 *)val); + } + break; + case HW_VAR_DM_FUNC_CLR: + /* + * input is already a mask to clear function + * don't invert it again! George,Lucas@20130513 + */ + odm->SupportAbility &= *((u32 *)val); + break; + case HW_VAR_ASIX_IOT: + // enable ASIX IOT function + if (*((u8*)val) == _TRUE) { + // 0xa2e[0]=0 (disable rake receiver) + rtw_write8(adapter, rCCK0_FalseAlarmReport+2, + rtw_read8(adapter, rCCK0_FalseAlarmReport+2) & ~(BIT0)); + // 0xa1c=0xa0 (reset channel estimation if signal quality is bad) + rtw_write8(adapter, rCCK0_DSPParameter2, 0xa0); + } else { + // restore reg:0xa2e, reg:0xa1c + rtw_write8(adapter, rCCK0_FalseAlarmReport+2, + rtw_read8(adapter, rCCK0_FalseAlarmReport+2)|(BIT0)); + rtw_write8(adapter, rCCK0_DSPParameter2, 0x00); + } + break; +#ifdef CONFIG_WOWLAN + case HW_VAR_WOWLAN: + { + struct wowlan_ioctl_param *poidparam; + struct pwrctrl_priv *pwrctl = adapter_to_pwrctl(adapter); + struct security_priv *psecuritypriv = &adapter->securitypriv; + struct mlme_priv *pmlmepriv = &adapter->mlmepriv; + struct hal_ops *pHalFunc = &adapter->HalFunc; + struct sta_info *psta = NULL; + int res; + u16 media_status_rpt; + u8 val8; + + poidparam = (struct wowlan_ioctl_param *)val; + switch (poidparam->subcode) { + case WOWLAN_ENABLE: + DBG_871X_LEVEL(_drv_always_, "WOWLAN_ENABLE\n"); + +#ifdef CONFIG_GTK_OL + if (psecuritypriv->dot11PrivacyAlgrthm == _AES_) + rtw_hal_fw_sync_cam_id(adapter); +#endif + if (IS_HARDWARE_TYPE_8723B(adapter)) + rtw_hal_backup_rate(adapter); + + if (pHalFunc->hal_set_wowlan_fw != NULL) + pHalFunc->hal_set_wowlan_fw(adapter, _TRUE); + else + DBG_871X("hal_set_wowlan_fw is null\n"); + + media_status_rpt = RT_MEDIA_CONNECT; + rtw_hal_set_hwreg(adapter, + HW_VAR_H2C_FW_JOINBSSRPT, + (u8 *)&media_status_rpt); + + if (!pwrctl->wowlan_pno_enable) { + psta = rtw_get_stainfo(&adapter->stapriv, + get_bssid(pmlmepriv)); + media_status_rpt = + (u16)((psta->mac_id<<8)|RT_MEDIA_CONNECT); + if (psta != NULL) { + rtw_hal_set_hwreg(adapter, + HW_VAR_H2C_MEDIA_STATUS_RPT, + (u8 *)&media_status_rpt); + } + } + + rtw_msleep_os(2); + + if (IS_HARDWARE_TYPE_8188E(adapter)) + rtw_hal_disable_tx_report(adapter); + + //RX DMA stop + res = rtw_hal_pause_rx_dma(adapter); + if (res == _FAIL) + DBG_871X_LEVEL(_drv_always_, "[WARNING] pause RX DMA fail\n"); + +#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) + //Enable CPWM2 only. + res = rtw_hal_enable_cpwm2(adapter); + if (res == _FAIL) + DBG_871X_LEVEL(_drv_always_, "[WARNING] enable cpwm2 fail\n"); +#endif +#ifdef CONFIG_GPIO_WAKEUP + rtw_hal_switch_gpio_wl_ctrl(adapter, + WAKEUP_GPIO_IDX, _TRUE); +#endif + //Set WOWLAN H2C command. + DBG_871X_LEVEL(_drv_always_, "Set WOWLan cmd\n"); + rtw_hal_set_fw_wow_related_cmd(adapter, 1); + + res = rtw_hal_check_wow_ctrl(adapter, _TRUE); + if (res == _FALSE) + DBG_871X("[Error]%s: set wowlan CMD fail!!\n", __func__); + + pwrctl->wowlan_wake_reason = + rtw_read8(adapter, REG_WOWLAN_WAKE_REASON); + + DBG_871X_LEVEL(_drv_always_, + "wowlan_wake_reason: 0x%02x\n", + pwrctl->wowlan_wake_reason); +#ifdef CONFIG_GTK_OL_DBG + dump_cam_table(adapter); +#endif +#ifdef CONFIG_USB_HCI + if (adapter->intf_stop) //free adapter's resource + adapter->intf_stop(adapter); + +#ifdef CONFIG_CONCURRENT_MODE + if (rtw_buddy_adapter_up(adapter)) { //free buddy adapter's resource + adapter->pbuddy_adapter->intf_stop(adapter->pbuddy_adapter); + } +#endif //CONFIG_CONCURRENT_MODE + + /* Invoid SE0 reset signal during suspending*/ + rtw_write8(adapter, REG_RSV_CTRL, 0x20); + rtw_write8(adapter, REG_RSV_CTRL, 0x60); +#endif //CONFIG_USB_HCI + break; + case WOWLAN_DISABLE: + DBG_871X_LEVEL(_drv_always_, "WOWLAN_DISABLE\n"); + + if (!pwrctl->wowlan_pno_enable) { + psta = rtw_get_stainfo(&adapter->stapriv, + get_bssid(pmlmepriv)); + + if (psta != NULL) { + media_status_rpt = + (u16)((psta->mac_id<<8)|RT_MEDIA_DISCONNECT); + rtw_hal_set_hwreg(adapter, + HW_VAR_H2C_MEDIA_STATUS_RPT, + (u8 *)&media_status_rpt); + } else { + DBG_871X("%s: psta is null\n", __func__); + } + } + + if (0) { + DBG_871X("0x630:0x%02x\n", + rtw_read8(adapter, 0x630)); + DBG_871X("0x631:0x%02x\n", + rtw_read8(adapter, 0x631)); + } + + pwrctl->wowlan_wake_reason = rtw_read8(adapter, + REG_WOWLAN_WAKE_REASON); + + DBG_871X_LEVEL(_drv_always_, "wakeup_reason: 0x%02x\n", + pwrctl->wowlan_wake_reason); + + rtw_hal_set_fw_wow_related_cmd(adapter, 0); + + res = rtw_hal_check_wow_ctrl(adapter, _FALSE); + if (res == _FALSE) { + DBG_871X("[Error]%s: disable WOW cmd fail\n!!", __func__); + rtw_hal_force_enable_rxdma(adapter); + } + + if (IS_HARDWARE_TYPE_8188E(adapter)) + rtw_hal_enable_tx_report(adapter); + + rtw_hal_update_tx_iv(adapter); + +#ifdef CONFIG_GTK_OL + if (psecuritypriv->dot11PrivacyAlgrthm == _AES_) + rtw_hal_update_gtk_offload_info(adapter); +#endif //CONFIG_GTK_OL + + if (pHalFunc->hal_set_wowlan_fw != NULL) + pHalFunc->hal_set_wowlan_fw(adapter, _FALSE); + else + DBG_871X("hal_set_wowlan_fw is null\n"); +#ifdef CONFIG_GPIO_WAKEUP + DBG_871X_LEVEL(_drv_always_, "Set Wake GPIO to high for default.\n"); + rtw_hal_set_output_gpio(adapter, WAKEUP_GPIO_IDX, 1); + rtw_hal_switch_gpio_wl_ctrl(adapter, + WAKEUP_GPIO_IDX, _FALSE); +#endif + if((pwrctl->wowlan_wake_reason != FWDecisionDisconnect) && + (pwrctl->wowlan_wake_reason != Rx_Pairwisekey) && + (pwrctl->wowlan_wake_reason != Rx_DisAssoc) && + (pwrctl->wowlan_wake_reason != Rx_DeAuth)) { + + //rtw_hal_download_rsvd_page(adapter, RT_MEDIA_CONNECT); + + media_status_rpt = RT_MEDIA_CONNECT; + rtw_hal_set_hwreg(adapter, + HW_VAR_H2C_FW_JOINBSSRPT, + (u8 *)&media_status_rpt); + + if (psta != NULL) { + media_status_rpt = + (u16)((psta->mac_id<<8)|RT_MEDIA_CONNECT); + rtw_hal_set_hwreg(adapter, + HW_VAR_H2C_MEDIA_STATUS_RPT, + (u8 *)&media_status_rpt); + } + } + break; + default: + break; + } + } + break; +#endif //CONFIG_WOWLAN + default: + if (0) + DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" variable(%d) not defined!\n", + FUNC_ADPT_ARG(adapter), variable); + break; + } + +_func_exit_; +} + +void GetHwReg(_adapter *adapter, u8 variable, u8 *val) +{ + HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter); + DM_ODM_T *odm = &(hal_data->odmpriv); + +_func_enter_; + + switch (variable) { + case HW_VAR_BASIC_RATE: + *((u16*)val) = hal_data->BasicRateSet; + break; + case HW_VAR_DM_FLAG: + *((u32*)val) = odm->SupportAbility; + break; + case HW_VAR_RF_TYPE: + *((u8*)val) = hal_data->rf_type; + break; + default: + if (0) + DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" variable(%d) not defined!\n", + FUNC_ADPT_ARG(adapter), variable); + break; + } + +_func_exit_; +} + + + + +u8 +SetHalDefVar(_adapter *adapter, HAL_DEF_VARIABLE variable, void *value) +{ + HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter); + DM_ODM_T *odm = &(hal_data->odmpriv); + u8 bResult = _SUCCESS; + + switch(variable) { + case HW_DEF_FA_CNT_DUMP: + //ODM_COMP_COMMON + if(*((u8*)value)) + odm->DebugComponents |= (ODM_COMP_DIG |ODM_COMP_FA_CNT); + else + odm->DebugComponents &= ~(ODM_COMP_DIG |ODM_COMP_FA_CNT); + break; + case HAL_DEF_DBG_RX_INFO_DUMP: + { + PFALSE_ALARM_STATISTICS FalseAlmCnt = (PFALSE_ALARM_STATISTICS)PhyDM_Get_Structure( odm , PHYDM_FALSEALMCNT); + pDIG_T pDM_DigTable = &odm->DM_DigTable; + + DBG_871X("============ Rx Info dump ===================\n"); + DBG_871X("bLinked = %d, RSSI_Min = %d(%%), CurrentIGI = 0x%x \n", + odm->bLinked, odm->RSSI_Min, pDM_DigTable->CurIGValue); + DBG_871X("Cnt_Cck_fail = %d, Cnt_Ofdm_fail = %d, Total False Alarm = %d\n", + FalseAlmCnt->Cnt_Cck_fail, FalseAlmCnt->Cnt_Ofdm_fail, FalseAlmCnt->Cnt_all); + + if(odm->bLinked){ + DBG_871X("RxRate = %s, RSSI_A = %d(%%), RSSI_B = %d(%%)\n", + HDATA_RATE(odm->RxRate), odm->RSSI_A, odm->RSSI_B); + + #ifdef DBG_RX_SIGNAL_DISPLAY_RAW_DATA + rtw_dump_raw_rssi_info(adapter); + #endif + } + } + break; + case HW_DEF_ODM_DBG_FLAG: + ODM_CmnInfoUpdate(odm, ODM_CMNINFO_DBG_COMP, *((u8Byte*)value)); + break; + case HW_DEF_ODM_DBG_LEVEL: + ODM_CmnInfoUpdate(odm, ODM_CMNINFO_DBG_LEVEL, *((u4Byte*)value)); + break; + case HAL_DEF_DBG_DM_FUNC: + { + u8 dm_func = *((u8*)value); + struct dm_priv *dm = &hal_data->dmpriv; + + if(dm_func == 0){ //disable all dynamic func + pDIG_T pDM_DigTable = &odm->DM_DigTable; + odm->SupportAbility = DYNAMIC_FUNC_DISABLE; + pDM_DigTable->bStopDIG = _TRUE; + DBG_8192C("==> Disable all dynamic function...\n"); + } + else if(dm_func == 1){//disable DIG + pDIG_T pDM_DigTable = &odm->DM_DigTable; + odm->SupportAbility &= (~DYNAMIC_BB_DIG); + pDM_DigTable->bStopDIG = _TRUE; + DBG_8192C("==> Disable DIG...\n"); + } + else if(dm_func == 2){//disable High power + odm->SupportAbility &= (~DYNAMIC_BB_DYNAMIC_TXPWR); + } + else if(dm_func == 3){//disable tx power tracking + odm->SupportAbility &= (~DYNAMIC_RF_CALIBRATION); + DBG_8192C("==> Disable tx power tracking...\n"); + } + else if(dm_func == 4){//disable BT coexistence + dm->DMFlag &= (~DYNAMIC_FUNC_BT); + } + else if(dm_func == 5){//disable antenna diversity + odm->SupportAbility &= (~DYNAMIC_BB_ANT_DIV); + } + else if(dm_func == 6){//turn on all dynamic func + if(!(odm->SupportAbility & DYNAMIC_BB_DIG)) { + DIG_T *pDigTable = &odm->DM_DigTable; + pDigTable->CurIGValue= rtw_read8(adapter, 0xc50); + pDigTable->bStopDIG = _FALSE; + } + dm->DMFlag |= DYNAMIC_FUNC_BT; + odm->SupportAbility = DYNAMIC_ALL_FUNC_ENABLE; + + DBG_8192C("==> Turn on all dynamic function...\n"); + } + } + break; + case HAL_DEF_DBG_DUMP_RXPKT: + hal_data->bDumpRxPkt = *((u8*)value); + break; + case HAL_DEF_DBG_DUMP_TXPKT: + hal_data->bDumpTxPkt = *((u8*)value); + break; + case HAL_DEF_ANT_DETECT: + hal_data->AntDetection = *((u8 *)value); + break; + case HAL_DEF_DBG_DIS_PWT: + hal_data->bDisableTXPowerTraining = *((u8*)value); + break; + default: + DBG_871X_LEVEL(_drv_always_, "%s: [WARNING] HAL_DEF_VARIABLE(%d) not defined!\n", __FUNCTION__, variable); + bResult = _FAIL; + break; + } + + return bResult; +} + +u8 +GetHalDefVar(_adapter *adapter, HAL_DEF_VARIABLE variable, void *value) +{ + HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter); + DM_ODM_T *odm = &(hal_data->odmpriv); + u8 bResult = _SUCCESS; + + switch(variable) { + case HAL_DEF_UNDERCORATEDSMOOTHEDPWDB: + { + struct mlme_priv *pmlmepriv; + struct sta_priv *pstapriv; + struct sta_info *psta; + + pmlmepriv = &adapter->mlmepriv; + pstapriv = &adapter->stapriv; + psta = rtw_get_stainfo(pstapriv, pmlmepriv->cur_network.network.MacAddress); + if (psta) + { + *((int*)value) = psta->rssi_stat.UndecoratedSmoothedPWDB; + } + } + break; + case HW_DEF_ODM_DBG_FLAG: + *((u8Byte*)value) = odm->DebugComponents; + break; + case HW_DEF_ODM_DBG_LEVEL: + *((u4Byte*)value) = odm->DebugLevel; + break; + case HAL_DEF_DBG_DM_FUNC: + *(( u32*)value) =hal_data->odmpriv.SupportAbility; + break; + case HAL_DEF_DBG_DUMP_RXPKT: + *((u8*)value) = hal_data->bDumpRxPkt; + break; + case HAL_DEF_DBG_DUMP_TXPKT: + *((u8*)value) = hal_data->bDumpTxPkt; + break; + case HAL_DEF_ANT_DETECT: + *((u8 *)value) = hal_data->AntDetection; + break; + case HAL_DEF_MACID_SLEEP: + *(u8*)value = _FALSE; + break; + case HAL_DEF_TX_PAGE_SIZE: + *(( u32*)value) = PAGE_SIZE_128; + break; + case HAL_DEF_DBG_DIS_PWT: + *(u8*)value = hal_data->bDisableTXPowerTraining; + break; + default: + DBG_871X_LEVEL(_drv_always_, "%s: [WARNING] HAL_DEF_VARIABLE(%d) not defined!\n", __FUNCTION__, variable); + bResult = _FAIL; + break; + } + + return bResult; +} + +void GetHalODMVar( + PADAPTER Adapter, + HAL_ODM_VARIABLE eVariable, + PVOID pValue1, + PVOID pValue2) +{ + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + PDM_ODM_T podmpriv = &pHalData->odmpriv; + switch(eVariable){ +#if defined(CONFIG_SIGNAL_DISPLAY_DBM) && defined(CONFIG_BACKGROUND_NOISE_MONITOR) + case HAL_ODM_NOISE_MONITOR: + { + u8 chan = *(u8*)pValue1; + *(s16 *)pValue2 = pHalData->noise[chan]; + #ifdef DBG_NOISE_MONITOR + DBG_8192C("### Noise monitor chan(%d)-noise:%d (dBm) ###\n", + chan,pHalData->noise[chan]); + #endif + + } + break; +#endif//#ifdef CONFIG_BACKGROUND_NOISE_MONITOR + default: + break; + } +} + +void SetHalODMVar( + PADAPTER Adapter, + HAL_ODM_VARIABLE eVariable, + PVOID pValue1, + BOOLEAN bSet) +{ + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + PDM_ODM_T podmpriv = &pHalData->odmpriv; + //_irqL irqL; + switch(eVariable){ + case HAL_ODM_STA_INFO: + { + struct sta_info *psta = (struct sta_info *)pValue1; + if(bSet){ + DBG_8192C("### Set STA_(%d) info ###\n",psta->mac_id); + ODM_CmnInfoPtrArrayHook(podmpriv, ODM_CMNINFO_STA_STATUS,psta->mac_id,psta); + } + else{ + DBG_8192C("### Clean STA_(%d) info ###\n",psta->mac_id); + //_enter_critical_bh(&pHalData->odm_stainfo_lock, &irqL); + ODM_CmnInfoPtrArrayHook(podmpriv, ODM_CMNINFO_STA_STATUS,psta->mac_id,NULL); + + //_exit_critical_bh(&pHalData->odm_stainfo_lock, &irqL); + } + } + break; + case HAL_ODM_P2P_STATE: + ODM_CmnInfoUpdate(podmpriv,ODM_CMNINFO_WIFI_DIRECT,bSet); + break; + case HAL_ODM_WIFI_DISPLAY_STATE: + ODM_CmnInfoUpdate(podmpriv,ODM_CMNINFO_WIFI_DISPLAY,bSet); + break; + case HAL_ODM_REGULATION: + ODM_CmnInfoInit(podmpriv, ODM_CMNINFO_DOMAIN_CODE_2G, pHalData->Regulation2_4G); + ODM_CmnInfoInit(podmpriv, ODM_CMNINFO_DOMAIN_CODE_5G, pHalData->Regulation5G); + break; + #if defined(CONFIG_SIGNAL_DISPLAY_DBM) && defined(CONFIG_BACKGROUND_NOISE_MONITOR) + case HAL_ODM_NOISE_MONITOR: + { + struct noise_info *pinfo = (struct noise_info *)pValue1; + + #ifdef DBG_NOISE_MONITOR + DBG_8192C("### Noise monitor chan(%d)-bPauseDIG:%d,IGIValue:0x%02x,max_time:%d (ms) ###\n", + pinfo->chan,pinfo->bPauseDIG,pinfo->IGIValue,pinfo->max_time); + #endif + + pHalData->noise[pinfo->chan] = ODM_InbandNoise_Monitor(podmpriv,pinfo->bPauseDIG,pinfo->IGIValue,pinfo->max_time); + DBG_871X("chan_%d, noise = %d (dBm)\n",pinfo->chan,pHalData->noise[pinfo->chan]); + #ifdef DBG_NOISE_MONITOR + DBG_871X("noise_a = %d, noise_b = %d noise_all:%d \n", + podmpriv->noise_level.noise[ODM_RF_PATH_A], + podmpriv->noise_level.noise[ODM_RF_PATH_B], + podmpriv->noise_level.noise_all); + #endif + } + break; + #endif//#ifdef CONFIG_BACKGROUND_NOISE_MONITOR + + default: + break; + } +} + + +BOOLEAN +eqNByte( + u8* str1, + u8* str2, + u32 num + ) +{ + if(num==0) + return _FALSE; + while(num>0) + { + num--; + if(str1[num]!=str2[num]) + return _FALSE; + } + return _TRUE; +} + +// +// Description: +// Return TRUE if chTmp is represent for hex digit and +// FALSE otherwise. +// +// +BOOLEAN +IsHexDigit( + IN char chTmp +) +{ + if( (chTmp >= '0' && chTmp <= '9') || + (chTmp >= 'a' && chTmp <= 'f') || + (chTmp >= 'A' && chTmp <= 'F') ) + { + return _TRUE; + } + else + { + return _FALSE; + } +} + + +// +// Description: +// Translate a character to hex digit. +// +u32 +MapCharToHexDigit( + IN char chTmp +) +{ + if(chTmp >= '0' && chTmp <= '9') + return (chTmp - '0'); + else if(chTmp >= 'a' && chTmp <= 'f') + return (10 + (chTmp - 'a')); + else if(chTmp >= 'A' && chTmp <= 'F') + return (10 + (chTmp - 'A')); + else + return 0; +} + + + +// +// Description: // Parse hex number from the string pucStr. // BOOLEAN -GetHexValueFromString( - IN char* szStr, - IN OUT u32* pu4bVal, - IN OUT u32* pu4bMove -) +GetHexValueFromString( + IN char* szStr, + IN OUT u32* pu4bVal, + IN OUT u32* pu4bMove +) +{ + char* szScan = szStr; + + // Check input parameter. + if(szStr == NULL || pu4bVal == NULL || pu4bMove == NULL) + { + DBG_871X("GetHexValueFromString(): Invalid inpur argumetns! szStr: %p, pu4bVal: %p, pu4bMove: %p\n", szStr, pu4bVal, pu4bMove); + return _FALSE; + } + + // Initialize output. + *pu4bMove = 0; + *pu4bVal = 0; + + // Skip leading space. + while( *szScan != '\0' && + (*szScan == ' ' || *szScan == '\t') ) + { + szScan++; + (*pu4bMove)++; + } + + // Skip leading '0x' or '0X'. + if(*szScan == '0' && (*(szScan+1) == 'x' || *(szScan+1) == 'X')) + { + szScan += 2; + (*pu4bMove) += 2; + } + + // Check if szScan is now pointer to a character for hex digit, + // if not, it means this is not a valid hex number. + if(!IsHexDigit(*szScan)) + { + return _FALSE; + } + + // Parse each digit. + do + { + (*pu4bVal) <<= 4; + *pu4bVal += MapCharToHexDigit(*szScan); + + szScan++; + (*pu4bMove)++; + } while(IsHexDigit(*szScan)); + + return _TRUE; +} + +BOOLEAN +GetFractionValueFromString( + IN char* szStr, + IN OUT u8* pInteger, + IN OUT u8* pFraction, + IN OUT u32* pu4bMove +) +{ + char *szScan = szStr; + + // Initialize output. + *pu4bMove = 0; + *pInteger = 0; + *pFraction = 0; + + // Skip leading space. + while ( *szScan != '\0' && (*szScan == ' ' || *szScan == '\t') ) { + ++szScan; + ++(*pu4bMove); + } + + // Parse each digit. + do { + (*pInteger) *= 10; + *pInteger += ( *szScan - '0' ); + + ++szScan; + ++(*pu4bMove); + + if ( *szScan == '.' ) + { + ++szScan; + ++(*pu4bMove); + + if ( *szScan < '0' || *szScan > '9' ) + return _FALSE; + else { + *pFraction = *szScan - '0'; + ++szScan; + ++(*pu4bMove); + return _TRUE; + } + } + } while(*szScan >= '0' && *szScan <= '9'); + + return _TRUE; +} + +// +// Description: +// Return TRUE if szStr is comment out with leading "//". +// +BOOLEAN +IsCommentString( + IN char *szStr +) +{ + if(*szStr == '/' && *(szStr+1) == '/') + { + return _TRUE; + } + else + { + return _FALSE; + } +} + +BOOLEAN +GetU1ByteIntegerFromStringInDecimal( + IN char* Str, + IN OUT u8* pInt + ) +{ + u16 i = 0; + *pInt = 0; + + while ( Str[i] != '\0' ) + { + if ( Str[i] >= '0' && Str[i] <= '9' ) + { + *pInt *= 10; + *pInt += ( Str[i] - '0' ); + } + else + { + return _FALSE; + } + ++i; + } + + return _TRUE; +} + +// <20121004, Kordan> For example, +// ParseQualifiedString(inString, 0, outString, '[', ']') gets "Kordan" from a string "Hello [Kordan]". +// If RightQualifier does not exist, it will hang on in the while loop +BOOLEAN +ParseQualifiedString( + IN char* In, + IN OUT u32* Start, + OUT char* Out, + IN char LeftQualifier, + IN char RightQualifier + ) { - char* szScan = szStr; + u32 i = 0, j = 0; + char c = In[(*Start)++]; + + if (c != LeftQualifier) + return _FALSE; + + i = (*Start); + while ((c = In[(*Start)++]) != RightQualifier) + ; // find ']' + j = (*Start) - 2; + strncpy((char *)Out, (const char*)(In+i), j-i+1); + + return _TRUE; +} + +BOOLEAN +isAllSpaceOrTab( + u8* data, + u8 size + ) +{ + u8 cnt = 0, NumOfSpaceAndTab = 0; + + while( size > cnt ) + { + if ( data[cnt] == ' ' || data[cnt] == '\t' || data[cnt] == '\0' ) + ++NumOfSpaceAndTab; + + ++cnt; + } + + return size == NumOfSpaceAndTab; +} + + +void rtw_hal_check_rxfifo_full(_adapter *adapter) +{ + struct dvobj_priv *psdpriv = adapter->dvobj; + struct debug_priv *pdbgpriv = &psdpriv->drv_dbg; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(adapter); + int save_cnt=_FALSE; + + //switch counter to RX fifo + if(IS_81XXC(pHalData->VersionID) || IS_92D(pHalData->VersionID) + || IS_8188E(pHalData->VersionID) || IS_8723_SERIES(pHalData->VersionID) + || IS_8812_SERIES(pHalData->VersionID) || IS_8821_SERIES(pHalData->VersionID) + || IS_8723B_SERIES(pHalData->VersionID) || IS_8192E(pHalData->VersionID)) + { + rtw_write8(adapter, REG_RXERR_RPT+3, rtw_read8(adapter, REG_RXERR_RPT+3)|0xa0); + save_cnt = _TRUE; + } + else + { + //todo: other chips + } + + + if(save_cnt) + { + //rtw_write8(adapter, REG_RXERR_RPT+3, rtw_read8(adapter, REG_RXERR_RPT+3)|0xa0); + pdbgpriv->dbg_rx_fifo_last_overflow = pdbgpriv->dbg_rx_fifo_curr_overflow; + pdbgpriv->dbg_rx_fifo_curr_overflow = rtw_read16(adapter, REG_RXERR_RPT); + pdbgpriv->dbg_rx_fifo_diff_overflow = pdbgpriv->dbg_rx_fifo_curr_overflow-pdbgpriv->dbg_rx_fifo_last_overflow; + } +} + +void linked_info_dump(_adapter *padapter,u8 benable) +{ + struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(padapter); + + if(padapter->bLinkInfoDump == benable) + return; + + DBG_871X("%s %s \n",__FUNCTION__,(benable)?"enable":"disable"); + + if(benable){ + #ifdef CONFIG_LPS + pwrctrlpriv->org_power_mgnt = pwrctrlpriv->power_mgnt;//keep org value + rtw_pm_set_lps(padapter,PS_MODE_ACTIVE); + #endif + + #ifdef CONFIG_IPS + pwrctrlpriv->ips_org_mode = pwrctrlpriv->ips_mode;//keep org value + rtw_pm_set_ips(padapter,IPS_NONE); + #endif + } + else{ + #ifdef CONFIG_IPS + rtw_pm_set_ips(padapter, pwrctrlpriv->ips_org_mode); + #endif // CONFIG_IPS + + #ifdef CONFIG_LPS + rtw_pm_set_lps(padapter, pwrctrlpriv->org_power_mgnt ); + #endif // CONFIG_LPS + } + padapter->bLinkInfoDump = benable ; +} + +#ifdef DBG_RX_SIGNAL_DISPLAY_RAW_DATA +void rtw_get_raw_rssi_info(void *sel, _adapter *padapter) +{ + u8 isCCKrate,rf_path; + PHAL_DATA_TYPE pHalData = GET_HAL_DATA(padapter); + struct rx_raw_rssi *psample_pkt_rssi = &padapter->recvpriv.raw_rssi_info; + + DBG_871X_SEL_NL(sel,"RxRate = %s, PWDBALL = %d(%%), rx_pwr_all = %d(dBm)\n", + HDATA_RATE(psample_pkt_rssi->data_rate), psample_pkt_rssi->pwdball, psample_pkt_rssi->pwr_all); + isCCKrate = (psample_pkt_rssi->data_rate <= DESC_RATE11M)?TRUE :FALSE; + + if(isCCKrate) + psample_pkt_rssi->mimo_singal_strength[0] = psample_pkt_rssi->pwdball; + + for(rf_path = 0;rf_pathNumTotalRFPath;rf_path++) + { + DBG_871X_SEL_NL(sel,"RF_PATH_%d=>singal_strength:%d(%%),singal_quality:%d(%%)\n" + ,rf_path,psample_pkt_rssi->mimo_singal_strength[rf_path],psample_pkt_rssi->mimo_singal_quality[rf_path]); + + if(!isCCKrate){ + DBG_871X_SEL_NL(sel,"\trx_ofdm_pwr:%d(dBm),rx_ofdm_snr:%d(dB)\n", + psample_pkt_rssi->ofdm_pwr[rf_path],psample_pkt_rssi->ofdm_snr[rf_path]); + } + } +} + +void rtw_dump_raw_rssi_info(_adapter *padapter) +{ + u8 isCCKrate,rf_path; + PHAL_DATA_TYPE pHalData = GET_HAL_DATA(padapter); + struct rx_raw_rssi *psample_pkt_rssi = &padapter->recvpriv.raw_rssi_info; + DBG_871X("============ RAW Rx Info dump ===================\n"); + DBG_871X("RxRate = %s, PWDBALL = %d(%%), rx_pwr_all = %d(dBm)\n", + HDATA_RATE(psample_pkt_rssi->data_rate), psample_pkt_rssi->pwdball, psample_pkt_rssi->pwr_all); + + isCCKrate = (psample_pkt_rssi->data_rate <= DESC_RATE11M)?TRUE :FALSE; + + if(isCCKrate) + psample_pkt_rssi->mimo_singal_strength[0] = psample_pkt_rssi->pwdball; + + for(rf_path = 0;rf_pathNumTotalRFPath;rf_path++) + { + DBG_871X("RF_PATH_%d=>singal_strength:%d(%%),singal_quality:%d(%%)" + ,rf_path,psample_pkt_rssi->mimo_singal_strength[rf_path],psample_pkt_rssi->mimo_singal_quality[rf_path]); + + if(!isCCKrate){ + printk(",rx_ofdm_pwr:%d(dBm),rx_ofdm_snr:%d(dB)\n", + psample_pkt_rssi->ofdm_pwr[rf_path],psample_pkt_rssi->ofdm_snr[rf_path]); + }else{ + printk("\n"); + } + } +} + +void rtw_store_phy_info(_adapter *padapter, union recv_frame *prframe) +{ + u8 isCCKrate,rf_path; + PHAL_DATA_TYPE pHalData = GET_HAL_DATA(padapter); + struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib; + + PODM_PHY_INFO_T pPhyInfo = (PODM_PHY_INFO_T)(&pattrib->phy_info); + struct rx_raw_rssi *psample_pkt_rssi = &padapter->recvpriv.raw_rssi_info; + + psample_pkt_rssi->data_rate = pattrib->data_rate; + isCCKrate = (pattrib->data_rate <= DESC_RATE11M)?TRUE :FALSE; + + psample_pkt_rssi->pwdball = pPhyInfo->RxPWDBAll; + psample_pkt_rssi->pwr_all = pPhyInfo->RecvSignalPower; + + for(rf_path = 0;rf_pathNumTotalRFPath;rf_path++) + { + psample_pkt_rssi->mimo_singal_strength[rf_path] = pPhyInfo->RxMIMOSignalStrength[rf_path]; + psample_pkt_rssi->mimo_singal_quality[rf_path] = pPhyInfo->RxMIMOSignalQuality[rf_path]; + if(!isCCKrate){ + psample_pkt_rssi->ofdm_pwr[rf_path] = pPhyInfo->RxPwr[rf_path]; + psample_pkt_rssi->ofdm_snr[rf_path] = pPhyInfo->RxSNR[rf_path]; + } + } +} +#endif + +#ifdef CONFIG_EFUSE_CONFIG_FILE +int check_phy_efuse_tx_power_info_valid(PADAPTER padapter) { + EEPROM_EFUSE_PRIV *pEEPROM = GET_EEPROM_EFUSE_PRIV(padapter); + u8* pContent = pEEPROM->efuse_eeprom_data; + int index = 0; + u16 tx_index_offset = 0x0000; + + switch(padapter->chip_type) { + case RTL8723B: + tx_index_offset = EEPROM_TX_PWR_INX_8723B; + break; + case RTL8188E: + tx_index_offset = EEPROM_TX_PWR_INX_88E; + break; + case RTL8192E: + tx_index_offset = EEPROM_TX_PWR_INX_8192E; + break; + case RTL8821: + tx_index_offset = EEPROM_TX_PWR_INX_8821; + break; + default: + tx_index_offset = 0x0010; + break; + } + for (index = 0 ; index < 12 ; index++) { + if (pContent[tx_index_offset + index] == 0xFF) { + return _FALSE; + } else { + DBG_871X("0x%02x ,", pContent[EEPROM_TX_PWR_INX_88E+index]); + } + } + DBG_871X("\n"); + return _TRUE; +} + +int check_phy_efuse_macaddr_info_valid(PADAPTER padapter) { + + u8 val = 0; + u16 addr_offset = 0x0000; + + switch(padapter->chip_type) { + case RTL8723B: + if (padapter->interface_type == RTW_USB) { + addr_offset = EEPROM_MAC_ADDR_8723BU; + DBG_871X("%s: interface is USB\n", __func__); + } else if (padapter->interface_type == RTW_SDIO) { + addr_offset = EEPROM_MAC_ADDR_8723BS; + DBG_871X("%s: interface is SDIO\n", __func__); + } else if (padapter->interface_type == RTW_PCIE) { + addr_offset = EEPROM_MAC_ADDR_8723BE; + DBG_871X("%s: interface is PCIE\n", __func__); + } else if (padapter->interface_type == RTW_GSPI) { + //addr_offset = EEPROM_MAC_ADDR_8723BS; + DBG_871X("%s: interface is GSPI\n", __func__); + } + break; + case RTL8188E: + if (padapter->interface_type == RTW_USB) { + addr_offset = EEPROM_MAC_ADDR_88EU; + DBG_871X("%s: interface is USB\n", __func__); + } else if (padapter->interface_type == RTW_SDIO) { + addr_offset = EEPROM_MAC_ADDR_88ES; + DBG_871X("%s: interface is SDIO\n", __func__); + } else if (padapter->interface_type == RTW_PCIE) { + addr_offset = EEPROM_MAC_ADDR_88EE; + DBG_871X("%s: interface is PCIE\n", __func__); + } else if (padapter->interface_type == RTW_GSPI) { + //addr_offset = EEPROM_MAC_ADDR_8723BS; + DBG_871X("%s: interface is GSPI\n", __func__); + } + break; + case RTL8821: + if (padapter->interface_type == RTW_USB) { + addr_offset = EEPROM_MAC_ADDR_8821AU; + DBG_871X("%s: interface is USB\n", __func__); + } else if (padapter->interface_type == RTW_SDIO) { + addr_offset = EEPROM_MAC_ADDR_8821AS; + DBG_871X("%s: interface is SDIO\n", __func__); + } else if (padapter->interface_type == RTW_PCIE) { + addr_offset = EEPROM_MAC_ADDR_8821AE; + DBG_871X("%s: interface is PCIE\n", __func__); + } else if (padapter->interface_type == RTW_GSPI) { + //addr_offset = EEPROM_MAC_ADDR_8723BS; + DBG_871X("%s: interface is GSPI\n", __func__); + } + break; + } + + if (addr_offset == 0x0000) { + DBG_871X("phy efuse MAC addr offset is 0!!\n"); + return _FALSE; + } else { + rtw_efuse_map_read(padapter, addr_offset, 1, &val); + } + + if (val == 0xFF) { + return _FALSE; + } else { + DBG_871X("phy efuse with valid MAC addr\n"); + return _TRUE; + } +} + +u32 Hal_readPGDataFromConfigFile( + PADAPTER padapter, + struct file *fp) +{ + u32 i; + mm_segment_t fs; + u8 temp[3]; + loff_t pos = 0; + EEPROM_EFUSE_PRIV *pEEPROM = GET_EEPROM_EFUSE_PRIV(padapter); + u8 *PROMContent = pEEPROM->efuse_eeprom_data; + + temp[2] = 0; // add end of string '\0' + + fs = get_fs(); + set_fs(KERNEL_DS); + + for (i = 0 ; i < HWSET_MAX_SIZE ; i++) { + vfs_read(fp, temp, 2, &pos); + PROMContent[i] = simple_strtoul(temp, NULL, 16); + if ((i % EFUSE_FILE_COLUMN_NUM) == (EFUSE_FILE_COLUMN_NUM - 1)) { + //Filter the lates space char. + vfs_read(fp, temp, 1, &pos); + if (strchr(temp, ' ') == NULL) { + pos--; + vfs_read(fp, temp, 2, &pos); + } + } else { + pos += 1; // Filter the space character + } + } + + set_fs(fs); + pEEPROM->bloadfile_fail_flag = _FALSE; + +#ifdef CONFIG_DEBUG + DBG_871X("Efuse configure file:\n"); + for (i=0; imac_addr, 0, ETH_ALEN); + + fs = get_fs(); + set_fs(KERNEL_DS); + + DBG_871X("wifi mac address:\n"); + vfs_read(fp, source_addr, 18, &pos); + source_addr[17] = ':'; + + head = end = source_addr; + for (i=0; imac_addr[i] = simple_strtoul(head, NULL, 16 ); + + if (end) { + end++; + head = end; + } + } + + set_fs(fs); + pEEPROM->bloadmac_fail_flag = _FALSE; + + if (rtw_check_invalid_mac_address(pEEPROM->mac_addr) == _TRUE) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) + get_random_bytes(pEEPROM->mac_addr, ETH_ALEN); + pEEPROM->mac_addr[0] = 0x00; + pEEPROM->mac_addr[1] = 0xe0; + pEEPROM->mac_addr[2] = 0x4c; +#else + pEEPROM->mac_addr[0] = 0x00; + pEEPROM->mac_addr[1] = 0xe0; + pEEPROM->mac_addr[2] = 0x4c; + pEEPROM->mac_addr[3] = (u8)(curtime & 0xff) ; + pEEPROM->mac_addr[4] = (u8)((curtime>>8) & 0xff) ; + pEEPROM->mac_addr[5] = (u8)((curtime>>16) & 0xff) ; +#endif + DBG_871X("MAC Address from wifimac error is invalid, assign random MAC !!!\n"); + } + + DBG_871X("%s: Permanent Address = %02x-%02x-%02x-%02x-%02x-%02x\n", + __func__, pEEPROM->mac_addr[0], pEEPROM->mac_addr[1], + pEEPROM->mac_addr[2], pEEPROM->mac_addr[3], + pEEPROM->mac_addr[4], pEEPROM->mac_addr[5]); +} + +void Hal_GetPhyEfuseMACAddr(PADAPTER padapter, u8* mac_addr) { + int i = 0; + u16 addr_offset = 0x0000; + + switch(padapter->chip_type) { + case RTL8723B: + if (padapter->interface_type == RTW_USB) { + addr_offset = EEPROM_MAC_ADDR_8723BU; + DBG_871X("%s: interface is USB\n", __func__); + } else if (padapter->interface_type == RTW_SDIO) { + addr_offset = EEPROM_MAC_ADDR_8723BS; + DBG_871X("%s: interface is SDIO\n", __func__); + } else if (padapter->interface_type == RTW_PCIE) { + addr_offset = EEPROM_MAC_ADDR_8723BE; + DBG_871X("%s: interface is PCIE\n", __func__); + } else if (padapter->interface_type == RTW_GSPI){ + //addr_offset = EEPROM_MAC_ADDR_8723BS; + DBG_871X("%s: interface is GSPI\n", __func__); + } + break; + case RTL8188E: + if (padapter->interface_type == RTW_USB) { + addr_offset = EEPROM_MAC_ADDR_88EU; + DBG_871X("%s: interface is USB\n", __func__); + } else if (padapter->interface_type == RTW_SDIO) { + addr_offset = EEPROM_MAC_ADDR_88ES; + DBG_871X("%s: interface is SDIO\n", __func__); + } else if (padapter->interface_type == RTW_PCIE) { + addr_offset = EEPROM_MAC_ADDR_88EE; + DBG_871X("%s: interface is PCIE\n", __func__); + } else if (padapter->interface_type == RTW_GSPI){ + //addr_offset = EEPROM_MAC_ADDR_8723BS; + DBG_871X("%s: interface is GSPI\n", __func__); + } + break; + case RTL8821: + if (padapter->interface_type == RTW_USB) { + addr_offset = EEPROM_MAC_ADDR_8821AU; + DBG_871X("%s: interface is USB\n", __func__); + } else if (padapter->interface_type == RTW_SDIO) { + addr_offset = EEPROM_MAC_ADDR_8821AS; + DBG_871X("%s: interface is SDIO\n", __func__); + } else if (padapter->interface_type == RTW_PCIE) { + addr_offset = EEPROM_MAC_ADDR_8821AE; + DBG_871X("%s: interface is PCIE\n", __func__); + } else if (padapter->interface_type == RTW_GSPI){ + //addr_offset = EEPROM_MAC_ADDR_8723BS; + DBG_871X("%s: interface is GSPI\n", __func__); + } + break; + } + + rtw_efuse_map_read(padapter, addr_offset, ETH_ALEN, mac_addr); + + if (rtw_check_invalid_mac_address(mac_addr) == _TRUE) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) + get_random_bytes(mac_addr, ETH_ALEN); + mac_addr[0] = 0x00; + mac_addr[1] = 0xe0; + mac_addr[2] = 0x4c; +#else + mac_addr[0] = 0x00; + mac_addr[1] = 0xe0; + mac_addr[2] = 0x4c; + mac_addr[3] = (u8)(curtime & 0xff) ; + mac_addr[4] = (u8)((curtime>>8) & 0xff) ; + mac_addr[5] = (u8)((curtime>>16) & 0xff) ; +#endif + DBG_871X("MAC Address from phy efuse error, assign random MAC !!!\n"); + } + + DBG_871X("%s: Permanent Address = %02x-%02x-%02x-%02x-%02x-%02x\n", + __func__, mac_addr[0], mac_addr[1], mac_addr[2], + mac_addr[3], mac_addr[4], mac_addr[5]); +} +#endif //CONFIG_EFUSE_CONFIG_FILE + +#ifdef CONFIG_RF_GAIN_OFFSET +u32 Array_kfreemap[] = { +0x08,0xe, +0x06,0xc, +0x04,0xa, +0x02,0x8, +0x00,0x6, +0x03,0x4, +0x05,0x2, +0x07,0x0, +0x09,0x0, +0x0c,0x0, +}; + +void rtw_bb_rf_gain_offset(_adapter *padapter) +{ + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); + u8 value = padapter->eeprompriv.EEPROMRFGainOffset; + u8 tmp = 0x3e; + u32 res,i=0; + u4Byte ArrayLen = sizeof(Array_kfreemap)/sizeof(u32); + pu4Byte Array = Array_kfreemap; + u4Byte v1=0,v2=0,GainValue,target=0; + //DBG_871X("+%s value: 0x%02x+\n", __func__, value); +#if defined(CONFIG_RTL8723A) + if (value & BIT0) { + DBG_871X("Offset RF Gain.\n"); + DBG_871X("Offset RF Gain. padapter->eeprompriv.EEPROMRFGainVal=0x%x\n",padapter->eeprompriv.EEPROMRFGainVal); + if(padapter->eeprompriv.EEPROMRFGainVal != 0xff){ + res = rtw_hal_read_rfreg(padapter, RF_PATH_A, 0xd, 0xffffffff); + DBG_871X("Offset RF Gain. reg 0xd=0x%x\n",res); + res &= 0xfff87fff; + + res |= (padapter->eeprompriv.EEPROMRFGainVal & 0x0f)<< 15; + DBG_871X("Offset RF Gain. reg 0xd=0x%x\n",res); + + rtw_hal_write_rfreg(padapter, RF_PATH_A, REG_RF_BB_GAIN_OFFSET_CCK, RF_GAIN_OFFSET_MASK, res); + + res = rtw_hal_read_rfreg(padapter, RF_PATH_A, 0xe, 0xffffffff); + DBG_871X("Offset RF Gain. reg 0xe=0x%x\n",res); + res &= 0xfffffff0; + + res |= (padapter->eeprompriv.EEPROMRFGainVal & 0x0f); + DBG_871X("Offset RF Gain. reg 0xe=0x%x\n",res); + + rtw_hal_write_rfreg(padapter, RF_PATH_A, REG_RF_BB_GAIN_OFFSET_OFDM, RF_GAIN_OFFSET_MASK, res); + } + else + { + DBG_871X("Offset RF Gain. padapter->eeprompriv.EEPROMRFGainVal=0x%x != 0xff, didn't run Kfree\n",padapter->eeprompriv.EEPROMRFGainVal); + } + } else { + DBG_871X("Using the default RF gain.\n"); + } +#elif defined(CONFIG_RTL8723B) + if (value & BIT4) { + DBG_871X("Offset RF Gain.\n"); + DBG_871X("Offset RF Gain. padapter->eeprompriv.EEPROMRFGainVal=0x%x\n",padapter->eeprompriv.EEPROMRFGainVal); + + if(padapter->eeprompriv.EEPROMRFGainVal != 0xff){ + + if(pHalData->ant_path == ODM_RF_PATH_A) { + GainValue=(padapter->eeprompriv.EEPROMRFGainVal & 0x0f); + + } else { + GainValue=(padapter->eeprompriv.EEPROMRFGainVal & 0xf0)>>4; + } + DBG_871X("Ant PATH_%d GainValue Offset = 0x%x\n",(pHalData->ant_path == ODM_RF_PATH_A) ? (ODM_RF_PATH_A) : (ODM_RF_PATH_B),GainValue); + + for (i = 0; i < ArrayLen; i += 2 ) + { + //DBG_871X("ArrayLen in =%d ,Array 1 =0x%x ,Array2 =0x%x \n",i,Array[i],Array[i]+1); + v1 = Array[i]; + v2 = Array[i+1]; + if ( v1 == GainValue ) { + DBG_871X("Offset RF Gain. got v1 =0x%x ,v2 =0x%x \n",v1,v2); + target=v2; + break; + } + } + DBG_871X("padapter->eeprompriv.EEPROMRFGainVal=0x%x ,Gain offset Target Value=0x%x\n",padapter->eeprompriv.EEPROMRFGainVal,target); + + res = rtw_hal_read_rfreg(padapter, RF_PATH_A, 0x7f, 0xffffffff); + DBG_871X("Offset RF Gain. before reg 0x7f=0x%08x\n",res); + PHY_SetRFReg(padapter, RF_PATH_A, REG_RF_BB_GAIN_OFFSET, BIT18|BIT17|BIT16|BIT15, target); + res = rtw_hal_read_rfreg(padapter, RF_PATH_A, 0x7f, 0xffffffff); + + DBG_871X("Offset RF Gain. After reg 0x7f=0x%08x\n",res); + + }else { + + DBG_871X("Offset RF Gain. padapter->eeprompriv.EEPROMRFGainVal=0x%x != 0xff, didn't run Kfree\n",padapter->eeprompriv.EEPROMRFGainVal); + } + } else { + DBG_871X("Using the default RF gain.\n"); + } + +#elif defined(CONFIG_RTL8188E) + if (value & BIT4) { + DBG_871X("8188ES Offset RF Gain.\n"); + DBG_871X("8188ES Offset RF Gain. EEPROMRFGainVal=0x%x\n", + padapter->eeprompriv.EEPROMRFGainVal); + + if (padapter->eeprompriv.EEPROMRFGainVal != 0xff) { + res = rtw_hal_read_rfreg(padapter, RF_PATH_A, + REG_RF_BB_GAIN_OFFSET, 0xffffffff); + + DBG_871X("Offset RF Gain. reg 0x55=0x%x\n",res); + res &= 0xfff87fff; + + res |= (padapter->eeprompriv.EEPROMRFGainVal & 0x0f) << 15; + DBG_871X("Offset RF Gain. res=0x%x\n",res); + + rtw_hal_write_rfreg(padapter, RF_PATH_A, + REG_RF_BB_GAIN_OFFSET, + RF_GAIN_OFFSET_MASK, res); + } else { + DBG_871X("Offset RF Gain. EEPROMRFGainVal=0x%x == 0xff, didn't run Kfree\n", + padapter->eeprompriv.EEPROMRFGainVal); + } + } else { + DBG_871X("Using the default RF gain.\n"); + } +#else + if (!(value & 0x01)) { + //DBG_871X("Offset RF Gain.\n"); + res = rtw_hal_read_rfreg(padapter, RF_PATH_A, REG_RF_BB_GAIN_OFFSET, 0xffffffff); + value &= tmp; + res = value << 14; + rtw_hal_write_rfreg(padapter, RF_PATH_A, REG_RF_BB_GAIN_OFFSET, RF_GAIN_OFFSET_MASK, res); + } else { + DBG_871X("Using the default RF gain.\n"); + } +#endif + +} +#endif //CONFIG_RF_GAIN_OFFSET + +#ifdef CONFIG_USB_RX_AGGREGATION +void rtw_set_usb_agg_by_mode(_adapter *padapter, u8 cur_wireless_mode) +{ + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); + if(cur_wireless_mode < WIRELESS_11_24N + && cur_wireless_mode > 0) //ABG mode + { + if(0x6 != pHalData->RegAcUsbDmaSize || 0x10 !=pHalData->RegAcUsbDmaTime) + { + pHalData->RegAcUsbDmaSize = 0x6; + pHalData->RegAcUsbDmaTime = 0x10; + rtw_write16(padapter, REG_RXDMA_AGG_PG_TH, + pHalData->RegAcUsbDmaSize | (pHalData->RegAcUsbDmaTime<<8)); + } + + } + else if(cur_wireless_mode >= WIRELESS_11_24N + && cur_wireless_mode <= WIRELESS_MODE_MAX)//N AC mode + { + if(0x5 != pHalData->RegAcUsbDmaSize || 0x20 !=pHalData->RegAcUsbDmaTime) + { + pHalData->RegAcUsbDmaSize = 0x5; + pHalData->RegAcUsbDmaTime = 0x20; + rtw_write16(padapter, REG_RXDMA_AGG_PG_TH, + pHalData->RegAcUsbDmaSize | (pHalData->RegAcUsbDmaTime<<8)); + } + + } + else + { + DBG_871X("%s: Unknow wireless mode(0x%x)\n",__func__,padapter->mlmeextpriv.cur_wireless_mode); + } +} +#endif //CONFIG_USB_RX_AGGREGATION + +//To avoid RX affect TX throughput +void dm_DynamicUsbTxAgg(_adapter *padapter, u8 from_timer) +{ + struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter); + struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + struct mlme_ext_priv *pmlmeextpriv = &(padapter->mlmeextpriv); + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); + u8 cur_wireless_mode = pmlmeextpriv->cur_wireless_mode; +#ifdef CONFIG_CONCURRENT_MODE + struct mlme_ext_priv *pbuddymlmeextpriv = &(padapter->pbuddy_adapter->mlmeextpriv); +#endif //CONFIG_CONCURRENT_MODE + +#ifdef CONFIG_USB_RX_AGGREGATION + if(IS_HARDWARE_TYPE_8821U(padapter) )//|| IS_HARDWARE_TYPE_8192EU(padapter)) + { + //This AGG_PH_TH only for UsbRxAggMode == USB_RX_AGG_USB + if((pHalData->UsbRxAggMode == USB_RX_AGG_USB) && (check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE)) + { + if(pdvobjpriv->traffic_stat.cur_tx_tp > 2 && pdvobjpriv->traffic_stat.cur_rx_tp < 30) + rtw_write16(padapter, REG_RXDMA_AGG_PG_TH,0x1010); + else if (pdvobjpriv->traffic_stat.last_tx_bytes > 220000 && pdvobjpriv->traffic_stat.cur_rx_tp < 30) + rtw_write16(padapter , REG_RXDMA_AGG_PG_TH , 0x1006); + else + rtw_write16(padapter, REG_RXDMA_AGG_PG_TH,0x2005); //dmc agg th 20K + + //DBG_871X("TX_TP=%u, RX_TP=%u \n", pdvobjpriv->traffic_stat.cur_tx_tp, pdvobjpriv->traffic_stat.cur_rx_tp); + } + } + else if(IS_HARDWARE_TYPE_8812(padapter)) + { +#ifdef CONFIG_CONCURRENT_MODE + if(rtw_linked_check(padapter) == _TRUE && rtw_linked_check(padapter->pbuddy_adapter) == _TRUE) + { + if(pbuddymlmeextpriv->cur_wireless_mode >= pmlmeextpriv->cur_wireless_mode) + cur_wireless_mode = pbuddymlmeextpriv->cur_wireless_mode; + else + cur_wireless_mode = pmlmeextpriv->cur_wireless_mode; + + rtw_set_usb_agg_by_mode(padapter,cur_wireless_mode); + } + else if (rtw_linked_check(padapter) == _TRUE && rtw_linked_check(padapter->pbuddy_adapter) == _FALSE) + { + rtw_set_usb_agg_by_mode(padapter,cur_wireless_mode); + } +#else //!CONFIG_CONCURRENT_MODE + rtw_set_usb_agg_by_mode(padapter,cur_wireless_mode); +#endif //CONFIG_CONCURRENT_MODE + } +#endif +} + +//bus-agg check for SoftAP mode +inline u8 rtw_hal_busagg_qsel_check(_adapter *padapter,u8 pre_qsel,u8 next_qsel) +{ + struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + u8 chk_rst = _SUCCESS; + + if(check_fwstate(pmlmepriv, WIFI_AP_STATE) != _TRUE) + return chk_rst; + + //if((pre_qsel == 0xFF)||(next_qsel== 0xFF)) + // return chk_rst; + + if( ((pre_qsel == QSLT_HIGH)||((next_qsel== QSLT_HIGH))) + && (pre_qsel != next_qsel )){ + //DBG_871X("### bus-agg break cause of qsel misatch, pre_qsel=0x%02x,next_qsel=0x%02x ###\n", + // pre_qsel,next_qsel); + chk_rst = _FAIL; + } + return chk_rst; +} - // Check input parameter. - if(szStr == NULL || pu4bVal == NULL || pu4bMove == NULL) - { - DBG_871X("GetHexValueFromString(): Invalid inpur argumetns! szStr: %p, pu4bVal: %p, pu4bMove: %p\n", szStr, pu4bVal, pu4bMove); - return _FALSE; - } +/* + * Description: + * dump_TX_FIFO: This is only used to dump TX_FIFO for debug WoW mode offload + * contant. + * + * Input: + * adapter: adapter pointer. + * page_num: The max. page number that user want to dump. + * page_size: page size of each page. eg. 128 bytes, 256 bytes, 512byte. + */ +void dump_TX_FIFO(_adapter* padapter, u8 page_num, u16 page_size){ - // Initialize output. - *pu4bMove = 0; - *pu4bVal = 0; + int i; + u8 val = 0; + u8 base = 0; + u32 addr = 0; + u32 count = (page_size / 8); - // Skip leading space. - while( *szScan != '\0' && - (*szScan == ' ' || *szScan == '\t') ) - { - szScan++; - (*pu4bMove)++; + if (page_num <= 0) { + DBG_871X("!!%s: incorrect input page_num paramter!\n", __func__); + return; } - // Skip leading '0x' or '0X'. - if(*szScan == '0' && (*(szScan+1) == 'x' || *(szScan+1) == 'X')) - { - szScan += 2; - (*pu4bMove) += 2; - } + if (page_size < 128 || page_size > 512) { + DBG_871X("!!%s: incorrect input page_size paramter!\n", __func__); + return; + } - // Check if szScan is now pointer to a character for hex digit, - // if not, it means this is not a valid hex number. - if(!IsHexDigit(*szScan)) - { - return _FALSE; + DBG_871X("+%s+\n", __func__); + val = rtw_read8(padapter, 0x106); + rtw_write8(padapter, 0x106, 0x69); + DBG_871X("0x106: 0x%02x\n", val); + base = rtw_read8(padapter, 0x209); + DBG_871X("0x209: 0x%02x\n", base); + + addr = ((base) * page_size)/8; + for (i = 0 ; i < page_num * count ; i+=2) { + rtw_write32(padapter, 0x140, addr + i); + printk(" %08x %08x ", rtw_read32(padapter, 0x144), rtw_read32(padapter, 0x148)); + rtw_write32(padapter, 0x140, addr + i + 1); + printk(" %08x %08x \n", rtw_read32(padapter, 0x144), rtw_read32(padapter, 0x148)); } +} - // Parse each digit. - do - { - (*pu4bVal) <<= 4; - *pu4bVal += MapCharToHexDigit(*szScan); +#ifdef CONFIG_GPIO_API +u8 rtw_hal_get_gpio(_adapter* adapter, u8 gpio_num) +{ + u8 value; + u8 direction; + struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(adapter); - szScan++; - (*pu4bMove)++; - } while(IsHexDigit(*szScan)); + rtw_ps_deny(adapter, PS_DENY_IOCTL); - return _TRUE; + DBG_871X("rf_pwrstate=0x%02x\n", pwrpriv->rf_pwrstate); + LeaveAllPowerSaveModeDirect(adapter); + + /* Read GPIO Direction */ + direction = (rtw_read8(adapter,REG_GPIO_PIN_CTRL + 2) & BIT(gpio_num)) >> gpio_num; + + /* According the direction to read register value */ + if( direction ) + value = (rtw_read8(adapter, REG_GPIO_PIN_CTRL + 1)& BIT(gpio_num)) >> gpio_num; + else + value = (rtw_read8(adapter, REG_GPIO_PIN_CTRL)& BIT(gpio_num)) >> gpio_num; + + rtw_ps_deny_cancel(adapter, PS_DENY_IOCTL); + DBG_871X("%s direction=%d value=%d\n",__FUNCTION__,direction,value); + + return value; } -BOOLEAN -GetFractionValueFromString( - IN char* szStr, - IN OUT u8* pInteger, - IN OUT u8* pFraction, - IN OUT u32* pu4bMove -) +int rtw_hal_set_gpio_output_value(_adapter* adapter, u8 gpio_num, bool isHigh) { - char *szScan = szStr; + u8 direction = 0; + u8 res = -1; + if (IS_HARDWARE_TYPE_8188E(adapter)){ + /* Check GPIO is 4~7 */ + if( gpio_num > 7 || gpio_num < 4) + { + DBG_871X("%s The gpio number does not included 4~7.\n",__FUNCTION__); + return -1; + } + } + + rtw_ps_deny(adapter, PS_DENY_IOCTL); - // Initialize output. - *pu4bMove = 0; - *pInteger = 0; - *pFraction = 0; + LeaveAllPowerSaveModeDirect(adapter); - // Skip leading space. - while ( *szScan != '\0' && (*szScan == ' ' || *szScan == '\t') ) { - ++szScan; - ++(*pu4bMove); - } + /* Read GPIO direction */ + direction = (rtw_read8(adapter,REG_GPIO_PIN_CTRL + 2) & BIT(gpio_num)) >> gpio_num; - // Parse each digit. - do { - (*pInteger) *= 10; - *pInteger += ( *szScan - '0' ); + /* If GPIO is output direction, setting value. */ + if( direction ) + { + if(isHigh) + rtw_write8(adapter, REG_GPIO_PIN_CTRL + 1, rtw_read8(adapter, REG_GPIO_PIN_CTRL + 1) | BIT(gpio_num)); + else + rtw_write8(adapter, REG_GPIO_PIN_CTRL + 1, rtw_read8(adapter, REG_GPIO_PIN_CTRL + 1) & ~BIT(gpio_num)); - ++szScan; - ++(*pu4bMove); + DBG_871X("%s Set gpio %x[%d]=%d\n",__FUNCTION__,REG_GPIO_PIN_CTRL+1,gpio_num,isHigh ); + res = 0; + } + else + { + DBG_871X("%s The gpio is input,not be set!\n",__FUNCTION__); + res = -1; + } - if ( *szScan == '.' ) + rtw_ps_deny_cancel(adapter, PS_DENY_IOCTL); + return res; +} + +int rtw_hal_config_gpio(_adapter* adapter, u8 gpio_num, bool isOutput) +{ + if (IS_HARDWARE_TYPE_8188E(adapter)){ + if( gpio_num > 7 || gpio_num < 4) { - ++szScan; - ++(*pu4bMove); - - if ( *szScan < '0' || *szScan > '9' ) - return _FALSE; - else { - *pFraction = *szScan - '0'; - ++szScan; - ++(*pu4bMove); - return _TRUE; - } + DBG_871X("%s The gpio number does not included 4~7.\n",__FUNCTION__); + return -1; } - } while(*szScan >= '0' && *szScan <= '9'); + } - return _TRUE; -} + DBG_871X("%s gpio_num =%d direction=%d\n",__FUNCTION__,gpio_num,isOutput); -// -// Description: -// Return TRUE if szStr is comment out with leading "//". -// -BOOLEAN -IsCommentString( - IN char *szStr -) -{ - if(*szStr == '/' && *(szStr+1) == '/') + rtw_ps_deny(adapter, PS_DENY_IOCTL); + + LeaveAllPowerSaveModeDirect(adapter); + + if( isOutput ) { - return _TRUE; + rtw_write8(adapter, REG_GPIO_PIN_CTRL + 2, rtw_read8(adapter, REG_GPIO_PIN_CTRL + 2) | BIT(gpio_num)); } else { - return _FALSE; + rtw_write8(adapter, REG_GPIO_PIN_CTRL + 2, rtw_read8(adapter, REG_GPIO_PIN_CTRL + 2) & ~BIT(gpio_num)); } -} -BOOLEAN -GetU1ByteIntegerFromStringInDecimal( - IN char* Str, - IN OUT u8* pInt - ) + rtw_ps_deny_cancel(adapter, PS_DENY_IOCTL); + + return 0; +} +int rtw_hal_register_gpio_interrupt(_adapter* adapter, int gpio_num, void(*callback)(u8 level)) { - u16 i = 0; - *pInt = 0; + u8 value; + u8 direction; + PHAL_DATA_TYPE phal = GET_HAL_DATA(adapter); - while ( Str[i] != '\0' ) - { - if ( Str[i] >= '0' && Str[i] <= '9' ) + if (IS_HARDWARE_TYPE_8188E(adapter)){ + if(gpio_num > 7 || gpio_num < 4) { - *pInt *= 10; - *pInt += ( Str[i] - '0' ); + DBG_871X_LEVEL(_drv_always_, "%s The gpio number does not included 4~7.\n",__FUNCTION__); + return -1; } - else + } + + rtw_ps_deny(adapter, PS_DENY_IOCTL); + + LeaveAllPowerSaveModeDirect(adapter); + + /* Read GPIO direction */ + direction = (rtw_read8(adapter,REG_GPIO_PIN_CTRL + 2) & BIT(gpio_num)) >> gpio_num; + if(direction){ + DBG_871X_LEVEL(_drv_always_, "%s Can't register output gpio as interrupt.\n",__FUNCTION__); + return -1; + } + + /* Config GPIO Mode */ + rtw_write8(adapter, REG_GPIO_PIN_CTRL + 3, rtw_read8(adapter, REG_GPIO_PIN_CTRL + 3) | BIT(gpio_num)); + + /* Register GPIO interrupt handler*/ + adapter->gpiointpriv.callback[gpio_num] = callback; + + /* Set GPIO interrupt mode, 0:positive edge, 1:negative edge */ + value = rtw_read8(adapter, REG_GPIO_PIN_CTRL) & BIT(gpio_num); + adapter->gpiointpriv.interrupt_mode = rtw_read8(adapter, REG_HSIMR + 2)^value; + rtw_write8(adapter, REG_GPIO_INTM, adapter->gpiointpriv.interrupt_mode); + + /* Enable GPIO interrupt */ + adapter->gpiointpriv.interrupt_enable_mask = rtw_read8(adapter, REG_HSIMR + 2) | BIT(gpio_num); + rtw_write8(adapter, REG_HSIMR + 2, adapter->gpiointpriv.interrupt_enable_mask); + + rtw_hal_update_hisr_hsisr_ind(adapter, 1); + + rtw_ps_deny_cancel(adapter, PS_DENY_IOCTL); + + return 0; +} +int rtw_hal_disable_gpio_interrupt(_adapter* adapter, int gpio_num) +{ + u8 value; + u8 direction; + PHAL_DATA_TYPE phal = GET_HAL_DATA(adapter); + + if (IS_HARDWARE_TYPE_8188E(adapter)){ + if(gpio_num > 7 || gpio_num < 4) { - return _FALSE; + DBG_871X("%s The gpio number does not included 4~7.\n",__FUNCTION__); + return -1; } - ++i; } - return _TRUE; + rtw_ps_deny(adapter, PS_DENY_IOCTL); + + LeaveAllPowerSaveModeDirect(adapter); + + /* Config GPIO Mode */ + rtw_write8(adapter, REG_GPIO_PIN_CTRL + 3, rtw_read8(adapter, REG_GPIO_PIN_CTRL + 3) &~ BIT(gpio_num)); + + /* Unregister GPIO interrupt handler*/ + adapter->gpiointpriv.callback[gpio_num] = NULL; + + /* Reset GPIO interrupt mode, 0:positive edge, 1:negative edge */ + adapter->gpiointpriv.interrupt_mode = rtw_read8(adapter, REG_GPIO_INTM) &~ BIT(gpio_num); + rtw_write8(adapter, REG_GPIO_INTM, 0x00); + + /* Disable GPIO interrupt */ + adapter->gpiointpriv.interrupt_enable_mask = rtw_read8(adapter, REG_HSIMR + 2) &~ BIT(gpio_num); + rtw_write8(adapter, REG_HSIMR + 2, adapter->gpiointpriv.interrupt_enable_mask); + + if(!adapter->gpiointpriv.interrupt_enable_mask) + rtw_hal_update_hisr_hsisr_ind(adapter, 0); + + rtw_ps_deny_cancel(adapter, PS_DENY_IOCTL); + + return 0; } +#endif -// <20121004, Kordan> For example, -// ParseQualifiedString(inString, 0, outString, '[', ']') gets "Kordan" from a string "Hello [Kordan]". -// If RightQualifier does not exist, it will hang on in the while loop -BOOLEAN -ParseQualifiedString( - IN char* In, - IN OUT u32* Start, - OUT char* Out, - IN char LeftQualifier, - IN char RightQualifier - ) +void rtw_dump_mac_rx_counters(_adapter* padapter,struct dbg_rx_counter *rx_counter) { - u32 i = 0, j = 0; - char c = In[(*Start)++]; + u32 mac_cck_ok=0, mac_ofdm_ok=0, mac_ht_ok=0, mac_vht_ok=0; + u32 mac_cck_err=0, mac_ofdm_err=0, mac_ht_err=0, mac_vht_err=0; + u32 mac_cck_fa=0, mac_ofdm_fa=0, mac_ht_fa=0; + u32 DropPacket=0; + + if(!rx_counter){ + rtw_warn_on(1); + return; + } - if (c != LeftQualifier) - return _FALSE; + PHY_SetMacReg(padapter, REG_RXERR_RPT, BIT28|BIT29|BIT30|BIT31, 0x3); + mac_cck_ok = PHY_QueryMacReg(padapter, REG_RXERR_RPT, bMaskLWord);// [15:0] + PHY_SetMacReg(padapter, REG_RXERR_RPT, BIT28|BIT29|BIT30|BIT31, 0x0); + mac_ofdm_ok = PHY_QueryMacReg(padapter, REG_RXERR_RPT, bMaskLWord);// [15:0] + PHY_SetMacReg(padapter, REG_RXERR_RPT, BIT28|BIT29|BIT30|BIT31, 0x6); + mac_ht_ok = PHY_QueryMacReg(padapter, REG_RXERR_RPT, bMaskLWord);// [15:0] + mac_vht_ok = 0; + if (IS_HARDWARE_TYPE_JAGUAR(padapter)){ + PHY_SetMacReg(padapter, REG_RXERR_RPT, BIT28|BIT29|BIT30|BIT31, 0x0); + PHY_SetMacReg(padapter, REG_RXERR_RPT, BIT26, 0x1); + mac_vht_ok = PHY_QueryMacReg(padapter, REG_RXERR_RPT, bMaskLWord);// [15:0] + } + + PHY_SetMacReg(padapter, REG_RXERR_RPT, BIT28|BIT29|BIT30|BIT31, 0x4); + mac_cck_err = PHY_QueryMacReg(padapter, REG_RXERR_RPT, bMaskLWord);// [15:0] + PHY_SetMacReg(padapter, REG_RXERR_RPT, BIT28|BIT29|BIT30|BIT31, 0x1); + mac_ofdm_err = PHY_QueryMacReg(padapter, REG_RXERR_RPT, bMaskLWord);// [15:0] + PHY_SetMacReg(padapter, REG_RXERR_RPT, BIT28|BIT29|BIT30|BIT31, 0x7); + mac_ht_err = PHY_QueryMacReg(padapter, REG_RXERR_RPT, bMaskLWord);// [15:0] + mac_vht_err = 0; + if (IS_HARDWARE_TYPE_JAGUAR(padapter)){ + PHY_SetMacReg(padapter, REG_RXERR_RPT, BIT28|BIT29|BIT30|BIT31, 0x1); + PHY_SetMacReg(padapter, REG_RXERR_RPT, BIT26, 0x1); + mac_vht_err = PHY_QueryMacReg(padapter, REG_RXERR_RPT, bMaskLWord);// [15:0] + } - i = (*Start); - while ((c = In[(*Start)++]) != RightQualifier) - ; // find ']' - j = (*Start) - 2; - strncpy((char *)Out, (const char*)(In+i), j-i+1); + PHY_SetMacReg(padapter, REG_RXERR_RPT, BIT28|BIT29|BIT30|BIT31, 0x5); + mac_cck_fa = PHY_QueryMacReg(padapter, REG_RXERR_RPT, bMaskLWord);// [15:0] + PHY_SetMacReg(padapter, REG_RXERR_RPT, BIT28|BIT29|BIT30|BIT31, 0x2); + mac_ofdm_fa = PHY_QueryMacReg(padapter, REG_RXERR_RPT, bMaskLWord);// [15:0] + PHY_SetMacReg(padapter, REG_RXERR_RPT, BIT28|BIT29|BIT30|BIT31, 0x9); + mac_ht_fa = PHY_QueryMacReg(padapter, REG_RXERR_RPT, bMaskLWord);// [15:0] + + //Mac_DropPacket + rtw_write32(padapter, REG_RXERR_RPT, (rtw_read32(padapter, REG_RXERR_RPT)& 0x0FFFFFFF)| Mac_DropPacket); + DropPacket = rtw_read32(padapter, REG_RXERR_RPT)& 0x0000FFFF; + + rx_counter->rx_pkt_ok = mac_cck_ok+mac_ofdm_ok+mac_ht_ok+mac_vht_ok; + rx_counter->rx_pkt_crc_error = mac_cck_err+mac_ofdm_err+mac_ht_err+mac_vht_err; + rx_counter->rx_cck_fa = mac_cck_fa; + rx_counter->rx_ofdm_fa = mac_ofdm_fa; + rx_counter->rx_ht_fa = mac_ht_fa; + rx_counter->rx_pkt_drop = DropPacket; +} +void rtw_reset_mac_rx_counters(_adapter* padapter) +{ + //reset mac counter + PHY_SetMacReg(padapter, REG_RXERR_RPT, BIT27, 0x1); + PHY_SetMacReg(padapter, REG_RXERR_RPT, BIT27, 0x0); +} - return _TRUE; +void rtw_dump_phy_rx_counters(_adapter* padapter,struct dbg_rx_counter *rx_counter) +{ + u32 cckok=0,cckcrc=0,ofdmok=0,ofdmcrc=0,htok=0,htcrc=0,OFDM_FA=0,CCK_FA=0,vht_ok=0,vht_err=0; + if(!rx_counter){ + rtw_warn_on(1); + return; + } + if (IS_HARDWARE_TYPE_JAGUAR(padapter)){ + cckok = PHY_QueryBBReg(padapter, 0xF04, 0x3FFF); // [13:0] + ofdmok = PHY_QueryBBReg(padapter, 0xF14, 0x3FFF); // [13:0] + htok = PHY_QueryBBReg(padapter, 0xF10, 0x3FFF); // [13:0] + vht_ok = PHY_QueryBBReg(padapter, 0xF0C, 0x3FFF); // [13:0] + cckcrc = PHY_QueryBBReg(padapter, 0xF04, 0x3FFF0000); // [29:16] + ofdmcrc = PHY_QueryBBReg(padapter, 0xF14, 0x3FFF0000); // [29:16] + htcrc = PHY_QueryBBReg(padapter, 0xF10, 0x3FFF0000); // [29:16] + vht_err = PHY_QueryBBReg(padapter, 0xF0C, 0x3FFF0000); // [29:16] + CCK_FA = PHY_QueryBBReg(padapter, 0xA5C, bMaskLWord); + OFDM_FA = PHY_QueryBBReg(padapter, 0xF48, bMaskLWord); + } + else + { + cckok = PHY_QueryBBReg(padapter, 0xF88, bMaskDWord); + ofdmok = PHY_QueryBBReg(padapter, 0xF94, bMaskLWord); + htok = PHY_QueryBBReg(padapter, 0xF90, bMaskLWord); + vht_ok = 0; + cckcrc = PHY_QueryBBReg(padapter, 0xF84, bMaskDWord); + ofdmcrc = PHY_QueryBBReg(padapter, 0xF94, bMaskHWord); + htcrc = PHY_QueryBBReg(padapter, 0xF90, bMaskHWord); + vht_err = 0; + OFDM_FA = PHY_QueryBBReg(padapter, 0xCF0, bMaskLWord) + PHY_QueryBBReg(padapter, 0xCF2, bMaskLWord) + + PHY_QueryBBReg(padapter, 0xDA2, bMaskLWord) + PHY_QueryBBReg(padapter, 0xDA4, bMaskLWord) + + PHY_QueryBBReg(padapter, 0xDA6, bMaskLWord) + PHY_QueryBBReg(padapter, 0xDA8, bMaskLWord); + + CCK_FA=(rtw_read8(padapter, 0xA5B )<<8 ) | (rtw_read8(padapter, 0xA5C)); + } + + rx_counter->rx_pkt_ok = cckok+ofdmok+htok+vht_ok; + rx_counter->rx_pkt_crc_error = cckcrc+ofdmcrc+htcrc+vht_err; + rx_counter->rx_ofdm_fa = OFDM_FA; + rx_counter->rx_cck_fa = CCK_FA; + } -BOOLEAN -isAllSpaceOrTab( - u8* data, - u8 size - ) +void rtw_reset_phy_rx_counters(_adapter* padapter) { - u8 cnt = 0, NumOfSpaceAndTab = 0; + //reset phy counter + if (IS_HARDWARE_TYPE_JAGUAR(padapter)) + { + PHY_SetBBReg(padapter, 0xB58, BIT0, 0x1); + PHY_SetBBReg(padapter, 0xB58, BIT0, 0x0); - while( size > cnt ) + PHY_SetBBReg(padapter, 0x9A4, BIT17, 0x1);//reset OFDA FA counter + PHY_SetBBReg(padapter, 0x9A4, BIT17, 0x0); + + PHY_SetBBReg(padapter, 0xA2C, BIT15, 0x0);//reset CCK FA counter + PHY_SetBBReg(padapter, 0xA2C, BIT15, 0x1); + } + else { - if ( data[cnt] == ' ' || data[cnt] == '\t' || data[cnt] == '\0' ) - ++NumOfSpaceAndTab; + PHY_SetBBReg(padapter, 0xF14, BIT16, 0x1); + rtw_msleep_os(10); + PHY_SetBBReg(padapter, 0xF14, BIT16, 0x0); + + PHY_SetBBReg(padapter, 0xD00, BIT27, 0x1);//reset OFDA FA counter + PHY_SetBBReg(padapter, 0xC0C, BIT31, 0x1);//reset OFDA FA counter + PHY_SetBBReg(padapter, 0xD00, BIT27, 0x0); + PHY_SetBBReg(padapter, 0xC0C, BIT31, 0x0); + + PHY_SetBBReg(padapter, 0xA2C, BIT15, 0x0);//reset CCK FA counter + PHY_SetBBReg(padapter, 0xA2C, BIT15, 0x1); + } +} +#ifdef DBG_RX_COUNTER_DUMP +void rtw_dump_drv_rx_counters(_adapter* padapter,struct dbg_rx_counter *rx_counter) +{ + struct recv_priv *precvpriv = &padapter->recvpriv; + if(!rx_counter){ + rtw_warn_on(1); + return; + } + rx_counter->rx_pkt_ok = padapter->drv_rx_cnt_ok; + rx_counter->rx_pkt_crc_error = padapter->drv_rx_cnt_crcerror; + rx_counter->rx_pkt_drop = precvpriv->rx_drop - padapter->drv_rx_cnt_drop; +} +void rtw_reset_drv_rx_counters(_adapter* padapter) +{ + struct recv_priv *precvpriv = &padapter->recvpriv; + padapter->drv_rx_cnt_ok = 0; + padapter->drv_rx_cnt_crcerror = 0; + padapter->drv_rx_cnt_drop = precvpriv->rx_drop; +} +void rtw_dump_phy_rxcnts_preprocess(_adapter* padapter,u8 rx_cnt_mode) +{ + u8 initialgain; + HAL_DATA_TYPE *hal_data = GET_HAL_DATA(padapter); + DM_ODM_T *odm = &(hal_data->odmpriv); + DIG_T *pDigTable = &odm->DM_DigTable; + + if((!(padapter->dump_rx_cnt_mode& DUMP_PHY_RX_COUNTER)) && (rx_cnt_mode & DUMP_PHY_RX_COUNTER)) + { + initialgain = pDigTable->CurIGValue; + DBG_871X("%s CurIGValue:0x%02x\n",__FUNCTION__,initialgain); + rtw_hal_set_hwreg(padapter, HW_VAR_INITIAL_GAIN, (u8 *)(&initialgain)); + //disable dynamic functions, such as high power, DIG + Save_DM_Func_Flag(padapter); + Switch_DM_Func(padapter, ~(DYNAMIC_BB_DIG|DYNAMIC_BB_BB_FA_CNT), _FALSE); + } + else if((padapter->dump_rx_cnt_mode& DUMP_PHY_RX_COUNTER) &&(!(rx_cnt_mode & DUMP_PHY_RX_COUNTER ))) + { + //turn on phy-dynamic functions + Restore_DM_Func_Flag(padapter); + initialgain = 0xff; //restore RX GAIN + rtw_hal_set_hwreg(padapter, HW_VAR_INITIAL_GAIN, (u8 *)(&initialgain)); + + } +} + +void rtw_dump_rx_counters(_adapter* padapter) +{ + struct dbg_rx_counter rx_counter; + + if( padapter->dump_rx_cnt_mode & DUMP_DRV_RX_COUNTER ){ + _rtw_memset(&rx_counter,0,sizeof(struct dbg_rx_counter)); + rtw_dump_drv_rx_counters(padapter,&rx_counter); + DBG_871X( "Drv Received packet OK:%d CRC error:%d Drop Packets: %d\n", + rx_counter.rx_pkt_ok,rx_counter.rx_pkt_crc_error,rx_counter.rx_pkt_drop); + rtw_reset_drv_rx_counters(padapter); + } + + if( padapter->dump_rx_cnt_mode & DUMP_MAC_RX_COUNTER ){ + _rtw_memset(&rx_counter,0,sizeof(struct dbg_rx_counter)); + rtw_dump_mac_rx_counters(padapter,&rx_counter); + DBG_871X( "Mac Received packet OK:%d CRC error:%d FA Counter: %d Drop Packets: %d\n", + rx_counter.rx_pkt_ok,rx_counter.rx_pkt_crc_error, + rx_counter.rx_cck_fa+rx_counter.rx_ofdm_fa+rx_counter.rx_ht_fa, + rx_counter.rx_pkt_drop); + rtw_reset_mac_rx_counters(padapter); + } - ++cnt; + if(padapter->dump_rx_cnt_mode & DUMP_PHY_RX_COUNTER ){ + _rtw_memset(&rx_counter,0,sizeof(struct dbg_rx_counter)); + rtw_dump_phy_rx_counters(padapter,&rx_counter); + //DBG_871X("%s: OFDM_FA =%d\n", __FUNCTION__, rx_counter.rx_ofdm_fa); + //DBG_871X("%s: CCK_FA =%d\n", __FUNCTION__, rx_counter.rx_cck_fa); + DBG_871X("Phy Received packet OK:%d CRC error:%d FA Counter: %d\n",rx_counter.rx_pkt_ok,rx_counter.rx_pkt_crc_error, + rx_counter.rx_ofdm_fa+rx_counter.rx_cck_fa); + rtw_reset_phy_rx_counters(padapter); + } +} +#endif +void rtw_get_noise(_adapter* padapter) +{ +#if defined(CONFIG_SIGNAL_DISPLAY_DBM) && defined(CONFIG_BACKGROUND_NOISE_MONITOR) + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; + struct noise_info info; + if(rtw_linked_check(padapter)){ + info.bPauseDIG = _TRUE; + info.IGIValue = 0x1e; + info.max_time = 100;//ms + info.chan = pmlmeext->cur_channel ;//rtw_get_oper_ch(padapter); + rtw_ps_deny(padapter, PS_DENY_IOCTL); + LeaveAllPowerSaveModeDirect(padapter); + + rtw_hal_set_odm_var(padapter, HAL_ODM_NOISE_MONITOR,&info, _FALSE); + //ODM_InbandNoise_Monitor(podmpriv,_TRUE,0x20,100); + rtw_ps_deny_cancel(padapter, PS_DENY_IOCTL); + rtw_hal_get_odm_var(padapter, HAL_ODM_NOISE_MONITOR,&(info.chan), &(padapter->recvpriv.noise)); + #ifdef DBG_NOISE_MONITOR + DBG_871X("chan:%d,noise_level:%d\n",info.chan,padapter->recvpriv.noise); + #endif } +#endif - return size == NumOfSpaceAndTab; } +#ifdef CONFIG_FW_C2H_DEBUG + +/* C2H RX package original is 128. +if enable CONFIG_FW_C2H_DEBUG, it should increase to 256. + C2H FW debug message: + without aggregate: + {C2H_CmdID,Seq,SubID,Len,Content[0~n]} + Content[0~n]={'a','b','c',...,'z','\n'} + with aggregate: + {C2H_CmdID,Seq,SubID,Len,Content[0~n]} + Content[0~n]={'a','b','c',...,'z','\n',Extend C2H pkt 2...} + Extend C2H pkt 2={C2H CmdID,Seq,SubID,Len,Content = {'a','b','c',...,'z','\n'}} + Author: Isaac */ + +void Debug_FwC2H(PADAPTER padapter, u8 *pdata, u8 len) +{ + int i = 0; + int cnt = 0, total_length = 0; + u8 buf[128] = {0}; + u8 more_data = _FALSE; + u8 *nextdata = NULL; + u8 test = 0; + + u8 data_len; + u8 seq_no; + + nextdata = pdata; + do { + data_len = *(nextdata + 1); + seq_no = *(nextdata + 2); + + for (i = 0 ; i < data_len - 2 ; i++) { + cnt += sprintf((buf+cnt), "%c", nextdata[3 + i]); + + if (nextdata[3 + i] == 0x0a && nextdata[4 + i] == 0xff) + more_data = _TRUE; + else if (nextdata[3 + i] == 0x0a && nextdata[4 + i] != 0xff) + more_data = _FALSE; + } + + DBG_871X("[RTKFW, SEQ=%d]: %s", seq_no, buf); + data_len += 3; + total_length += data_len; + + if (more_data == _TRUE) { + _rtw_memset(buf, '\0', 128); + cnt = 0; + nextdata = (pdata + total_length); + } + } while (more_data == _TRUE); +} +#endif /*CONFIG_FW_C2H_DEBUG*/ + + diff --git a/backports/drivers/realtek/rtl8812au/hal/hal_com_phycfg.c b/backports/drivers/realtek/rtl8812au/hal/hal_com_phycfg.c index c84020e88f85ea..68a5b78780fb32 100755 --- a/backports/drivers/realtek/rtl8812au/hal/hal_com_phycfg.c +++ b/backports/drivers/realtek/rtl8812au/hal/hal_com_phycfg.c @@ -404,7 +404,7 @@ PHY_GetRateSectionIndexOfTxPowerByRate( case rTxAGC_A_Rate54_24: index = 1; break; case rTxAGC_A_CCK1_Mcs32: index = 6; break; case rTxAGC_B_CCK11_A_CCK2_11: - if ( BitMask == 0xffffff00 ) + if ( BitMask == bMaskH3Bytes ) index = 7; else if ( BitMask == 0x000000ff ) index = 15; @@ -2341,7 +2341,7 @@ PHY_GetTxPowerIndex( u8 txPower = 0x3E; if (IS_HARDWARE_TYPE_8813A(pAdapter)) { -//#if (RTL8813A_SUPPORT==1) +//#if (RTL8814A_SUPPORT==1) // txPower = PHY_GetTxPowerIndex_8813A( pAdapter, PowerIndex, RFPath, Rate ); //#endif } @@ -2378,7 +2378,7 @@ PHY_SetTxPowerIndex( ) { if (IS_HARDWARE_TYPE_8813A(pAdapter)) { -//#if (RTL8813A_SUPPORT==1) +//#if (RTL8814A_SUPPORT==1) // PHY_SetTxPowerIndex_8813A( pAdapter, PowerIndex, RFPath, Rate ); //#endif } @@ -2410,7 +2410,9 @@ Hal_ChannelPlanToRegulation( IN u16 ChannelPlan ) { - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + DM_ODM_T *odm = &pHalData->odmpriv; + pHalData->Regulation2_4G = TXPWR_LMT_WW; pHalData->Regulation5G = TXPWR_LMT_WW; @@ -2570,15 +2572,13 @@ Hal_ChannelPlanToRegulation( default: break; } -} - -#ifdef CONFIG_LOAD_PHY_PARA_FROM_FILE -extern char *rtw_phy_file_path; -char file_path[PATH_LENGTH_MAX]; + DBG_871X("%s ChannelPlan:0x%02x,Regulation(2_4G/5G):0x%02x,0x%02x\n", + __FUNCTION__,ChannelPlan,pHalData->Regulation2_4G,pHalData->Regulation5G); -#define GetLineFromBuffer(buffer) strsep(&buffer, "\n") +} +#ifdef CONFIG_LOAD_PHY_PARA_FROM_FILE int phy_ConfigMACWithParaFile( IN PADAPTER Adapter, @@ -2597,15 +2597,15 @@ phy_ConfigMACWithParaFile( if ((pHalData->mac_reg_len == 0) && (pHalData->mac_reg == NULL)) { - rtw_merge_string(file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); + rtw_merge_string(para_file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); - if (rtw_is_file_readable(file_path) == _TRUE) + if (rtw_is_file_readable(para_file_path) == _TRUE) { - rlen = rtw_retrive_from_file(file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); + rlen = rtw_retrive_from_file(para_file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); if (rlen > 0) { rtStatus = _SUCCESS; - pHalData->mac_reg = rtw_zmalloc(rlen); + pHalData->mac_reg = rtw_zvmalloc(rlen); if(pHalData->mac_reg) { _rtw_memcpy(pHalData->mac_reg, pHalData->para_file_buf, rlen); pHalData->mac_reg_len = rlen; @@ -2694,17 +2694,17 @@ phy_ConfigBBWithParaFile( _rtw_memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN); - if ((*pBufLen == 0) && (pBuf == NULL)) + if ((pBufLen != NULL) && (*pBufLen == 0) && (pBuf == NULL)) { - rtw_merge_string(file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); + rtw_merge_string(para_file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); - if (rtw_is_file_readable(file_path) == _TRUE) + if (rtw_is_file_readable(para_file_path) == _TRUE) { - rlen = rtw_retrive_from_file(file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); + rlen = rtw_retrive_from_file(para_file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); if (rlen > 0) { rtStatus = _SUCCESS; - pBuf = rtw_zmalloc(rlen); + pBuf = rtw_zvmalloc(rlen); if(pBuf) { _rtw_memcpy(pBuf, pHalData->para_file_buf, rlen); *pBufLen = rlen; @@ -2717,10 +2717,6 @@ phy_ConfigBBWithParaFile( case CONFIG_BB_AGC_TAB: pHalData->bb_agc_tab = pBuf; break; - default: - DBG_871X("Unknown ConfigType!! %d\r\n", ConfigType); - rtw_mfree(pBuf, rlen); - break; } } else { @@ -2731,7 +2727,7 @@ phy_ConfigBBWithParaFile( } else { - if ((*pBufLen != 0) && (pBuf != NULL)) { + if ((pBufLen != NULL) && (*pBufLen == 0) && (pBuf == NULL)) { _rtw_memcpy(pHalData->para_file_buf, pBuf, *pBufLen); rtStatus = _SUCCESS; } @@ -2873,7 +2869,7 @@ phy_ParseBBPgParaFile( { if(!IsCommentString(szLine)) { - if( isAllSpaceOrTab( szLine, sizeof( szLine ) ) ) + if( isAllSpaceOrTab( szLine, sizeof( *szLine ) ) ) continue; // Get header info (relative value or exact value) @@ -3153,15 +3149,15 @@ phy_ConfigBBWithPgParaFile( if ((pHalData->bb_phy_reg_pg_len == 0) && (pHalData->bb_phy_reg_pg == NULL)) { - rtw_merge_string(file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); + rtw_merge_string(para_file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); - if (rtw_is_file_readable(file_path) == _TRUE) + if (rtw_is_file_readable(para_file_path) == _TRUE) { - rlen = rtw_retrive_from_file(file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); + rlen = rtw_retrive_from_file(para_file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); if (rlen > 0) { rtStatus = _SUCCESS; - pHalData->bb_phy_reg_pg = rtw_zmalloc(rlen); + pHalData->bb_phy_reg_pg = rtw_zvmalloc(rlen); if(pHalData->bb_phy_reg_pg) { _rtw_memcpy(pHalData->bb_phy_reg_pg, pHalData->para_file_buf, rlen); pHalData->bb_phy_reg_pg_len = rlen; @@ -3216,15 +3212,15 @@ phy_ConfigBBWithMpParaFile( if ((pHalData->bb_phy_reg_mp_len == 0) && (pHalData->bb_phy_reg_mp == NULL)) { - rtw_merge_string(file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); + rtw_merge_string(para_file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); - if (rtw_is_file_readable(file_path) == _TRUE) + if (rtw_is_file_readable(para_file_path) == _TRUE) { - rlen = rtw_retrive_from_file(file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); + rlen = rtw_retrive_from_file(para_file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); if (rlen > 0) { rtStatus = _SUCCESS; - pHalData->bb_phy_reg_mp = rtw_zmalloc(rlen); + pHalData->bb_phy_reg_mp = rtw_zvmalloc(rlen); if(pHalData->bb_phy_reg_mp) { _rtw_memcpy(pHalData->bb_phy_reg_mp, pHalData->para_file_buf, rlen); pHalData->bb_phy_reg_mp_len = rlen; @@ -3350,17 +3346,17 @@ PHY_ConfigRFWithParaFile( _rtw_memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN); - if ((*pBufLen == 0) && (pBuf == NULL)) + if ((pBufLen != NULL) && (*pBufLen == 0) && (pBuf == NULL)) { - rtw_merge_string(file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); + rtw_merge_string(para_file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); - if (rtw_is_file_readable(file_path) == _TRUE) + if (rtw_is_file_readable(para_file_path) == _TRUE) { - rlen = rtw_retrive_from_file(file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); + rlen = rtw_retrive_from_file(para_file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); if (rlen > 0) { rtStatus = _SUCCESS; - pBuf = rtw_zmalloc(rlen); + pBuf = rtw_zvmalloc(rlen); if(pBuf) { _rtw_memcpy(pBuf, pHalData->para_file_buf, rlen); *pBufLen = rlen; @@ -3373,10 +3369,6 @@ PHY_ConfigRFWithParaFile( case ODM_RF_PATH_B: pHalData->rf_radio_b = pBuf; break; - default: - DBG_871X("Unknown eRFPath!! %d\r\n", eRFPath); - rtw_mfree(pBuf, rlen); - break; } } else { @@ -3387,7 +3379,7 @@ PHY_ConfigRFWithParaFile( } else { - if ((*pBufLen != 0) && (pBuf != NULL)) { + if ((pBufLen != NULL) && (*pBufLen == 0) && (pBuf == NULL)) { _rtw_memcpy(pHalData->para_file_buf, pBuf, *pBufLen); rtStatus = _SUCCESS; } @@ -3634,15 +3626,15 @@ PHY_ConfigRFWithTxPwrTrackParaFile( if ((pHalData->rf_tx_pwr_track_len == 0) && (pHalData->rf_tx_pwr_track == NULL)) { - rtw_merge_string(file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); + rtw_merge_string(para_file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); - if (rtw_is_file_readable(file_path) == _TRUE) + if (rtw_is_file_readable(para_file_path) == _TRUE) { - rlen = rtw_retrive_from_file(file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); + rlen = rtw_retrive_from_file(para_file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); if (rlen > 0) { rtStatus = _SUCCESS; - pHalData->rf_tx_pwr_track = rtw_zmalloc(rlen); + pHalData->rf_tx_pwr_track = rtw_zvmalloc(rlen); if(pHalData->rf_tx_pwr_track) { _rtw_memcpy(pHalData->rf_tx_pwr_track, pHalData->para_file_buf, rlen); pHalData->rf_tx_pwr_track_len = rlen; @@ -4003,15 +3995,15 @@ PHY_ConfigRFWithPowerLimitTableParaFile( if ((pHalData->rf_tx_pwr_lmt_len == 0) && (pHalData->rf_tx_pwr_lmt == NULL)) { - rtw_merge_string(file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); + rtw_merge_string(para_file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); - if (rtw_is_file_readable(file_path) == _TRUE) + if (rtw_is_file_readable(para_file_path) == _TRUE) { - rlen = rtw_retrive_from_file(file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); + rlen = rtw_retrive_from_file(para_file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); if (rlen > 0) { rtStatus = _SUCCESS; - pHalData->rf_tx_pwr_lmt = rtw_zmalloc(rlen); + pHalData->rf_tx_pwr_lmt = rtw_zvmalloc(rlen); if(pHalData->rf_tx_pwr_lmt) { _rtw_memcpy(pHalData->rf_tx_pwr_lmt, pHalData->para_file_buf, rlen); pHalData->rf_tx_pwr_lmt_len = rlen; @@ -4045,6 +4037,30 @@ PHY_ConfigRFWithPowerLimitTableParaFile( return rtStatus; } -#endif +void phy_free_filebuf(_adapter *padapter) +{ + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); + + if(pHalData->mac_reg) + rtw_vmfree(pHalData->mac_reg, pHalData->mac_reg_len); + if(pHalData->bb_phy_reg) + rtw_vmfree(pHalData->bb_phy_reg, pHalData->bb_phy_reg_len); + if(pHalData->bb_agc_tab) + rtw_vmfree(pHalData->bb_agc_tab, pHalData->bb_agc_tab_len); + if(pHalData->bb_phy_reg_pg) + rtw_vmfree(pHalData->bb_phy_reg_pg, pHalData->bb_phy_reg_pg_len); + if(pHalData->bb_phy_reg_mp) + rtw_vmfree(pHalData->bb_phy_reg_mp, pHalData->bb_phy_reg_mp_len); + if(pHalData->rf_radio_a) + rtw_vmfree(pHalData->rf_radio_a, pHalData->rf_radio_a_len); + if(pHalData->rf_radio_b) + rtw_vmfree(pHalData->rf_radio_b, pHalData->rf_radio_b_len); + if(pHalData->rf_tx_pwr_track) + rtw_vmfree(pHalData->rf_tx_pwr_track, pHalData->rf_tx_pwr_track_len); + if(pHalData->rf_tx_pwr_lmt) + rtw_vmfree(pHalData->rf_tx_pwr_lmt, pHalData->rf_tx_pwr_lmt_len); + +} +#endif diff --git a/backports/drivers/realtek/rtl8812au/hal/hal_dm.c b/backports/drivers/realtek/rtl8812au/hal/hal_dm.c new file mode 100644 index 00000000000000..46dab54b08397a --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/hal/hal_dm.c @@ -0,0 +1,196 @@ +/****************************************************************************** + * + * Copyright(c) 2014 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +#include +#include + +// A mapping from HalData to ODM. +ODM_BOARD_TYPE_E boardType(u8 InterfaceSel) +{ + ODM_BOARD_TYPE_E board = ODM_BOARD_DEFAULT; + +#ifdef CONFIG_PCI_HCI + INTERFACE_SELECT_PCIE pcie = (INTERFACE_SELECT_PCIE)InterfaceSel; + switch (pcie) + { + case INTF_SEL0_SOLO_MINICARD: + board |= ODM_BOARD_MINICARD; + break; + case INTF_SEL1_BT_COMBO_MINICARD: + board |= ODM_BOARD_BT; + board |= ODM_BOARD_MINICARD; + break; + default: + board = ODM_BOARD_DEFAULT; + break; + } + +#elif defined(CONFIG_USB_HCI) + INTERFACE_SELECT_USB usb = (INTERFACE_SELECT_USB)InterfaceSel; + switch (usb) + { + case INTF_SEL1_USB_High_Power: + board |= ODM_BOARD_EXT_LNA; + board |= ODM_BOARD_EXT_PA; + break; + case INTF_SEL2_MINICARD: + board |= ODM_BOARD_MINICARD; + break; + case INTF_SEL4_USB_Combo: + board |= ODM_BOARD_BT; + break; + case INTF_SEL5_USB_Combo_MF: + board |= ODM_BOARD_BT; + break; + case INTF_SEL0_USB: + case INTF_SEL3_USB_Solo: + default: + board = ODM_BOARD_DEFAULT; + break; + } + +#endif + //DBG_871X("===> boardType(): (pHalData->InterfaceSel, pDM_Odm->BoardType) = (%d, %d)\n", InterfaceSel, board); + + return board; +} + +void Init_ODM_ComInfo(_adapter *adapter) +{ + struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); + PHAL_DATA_TYPE pHalData = GET_HAL_DATA(adapter); + EEPROM_EFUSE_PRIV *pEEPROM = GET_EEPROM_EFUSE_PRIV(adapter); + struct dm_priv *pdmpriv = &pHalData->dmpriv; + PDM_ODM_T pDM_Odm = &(pHalData->odmpriv); + struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv; + struct mlme_priv *pmlmepriv = &adapter->mlmepriv; + struct pwrctrl_priv *pwrctl = adapter_to_pwrctl(adapter); + int i; + + _rtw_memset(pDM_Odm,0,sizeof(*pDM_Odm)); + + pDM_Odm->Adapter = adapter; + + ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_PLATFORM, ODM_CE); + + if (adapter->interface_type == RTW_GSPI) + ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_INTERFACE, ODM_ITRF_SDIO); + else + ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_INTERFACE, adapter->interface_type); + + ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_MP_TEST_CHIP, IS_NORMAL_CHIP(pHalData->VersionID)); + + ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_PATCH_ID, pEEPROM->CustomerID); + + ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_BWIFI_TEST, adapter->registrypriv.wifi_spec); + + if (pHalData->rf_type == RF_1T1R) { + ODM_CmnInfoUpdate(pDM_Odm, ODM_CMNINFO_RF_TYPE, ODM_1T1R); + } + else if (pHalData->rf_type == RF_2T2R){ + ODM_CmnInfoUpdate(pDM_Odm, ODM_CMNINFO_RF_TYPE, ODM_2T2R); + } + else if (pHalData->rf_type == RF_1T2R){ + ODM_CmnInfoUpdate(pDM_Odm, ODM_CMNINFO_RF_TYPE, ODM_1T2R); + } + +{ + //1 ======= BoardType: ODM_CMNINFO_BOARD_TYPE ======= + u8 odm_board_type = ODM_BOARD_DEFAULT; + + if (!IS_HARDWARE_TYPE_OLDER_THAN_8723A(adapter)) + { + if (pHalData->ExternalLNA_2G != 0) { + odm_board_type |= ODM_BOARD_EXT_LNA; + ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_EXT_LNA, 1); + } + if (pHalData->ExternalLNA_5G != 0) { + odm_board_type |= ODM_BOARD_EXT_LNA_5G; + ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_5G_EXT_LNA, 1); + } + if (pHalData->ExternalPA_2G != 0) { + odm_board_type |= ODM_BOARD_EXT_PA; + ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_EXT_PA, 1); + } + if (pHalData->ExternalPA_5G != 0) { + odm_board_type |= ODM_BOARD_EXT_PA_5G; + ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_5G_EXT_PA, 1); + } + if (pHalData->EEPROMBluetoothCoexist) + odm_board_type |= ODM_BOARD_BT; + + } else { + #ifdef CONFIG_USB_HCI + if (pHalData->InterfaceSel == INTF_SEL1_USB_High_Power + || pHalData->BoardType == BOARD_USB_High_PA /* This is legacy code for hal_data.BoardType */ + ) { + ODM_CmnInfoInit(pDM_Odm,ODM_CMNINFO_EXT_LNA, 1); + ODM_CmnInfoInit(pDM_Odm,ODM_CMNINFO_EXT_PA, 1); + } else + #endif + { + ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_EXT_PA, pHalData->ExternalPA_2G); + ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_EXT_LNA, pHalData->ExternalLNA_2G); + } + + odm_board_type = boardType(pHalData->InterfaceSel); + } + + ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_BOARD_TYPE, odm_board_type); + //1 ============== End of BoardType ============== +} + + ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_DOMAIN_CODE_2G, pHalData->Regulation2_4G); + ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_DOMAIN_CODE_5G, pHalData->Regulation5G); + + ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_GPA, pHalData->TypeGPA); + ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_APA, pHalData->TypeAPA); + ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_GLNA, pHalData->TypeGLNA); + ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_ALNA, pHalData->TypeALNA); + + ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_RFE_TYPE, pHalData->RFEType); + + ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_EXT_TRSW, 0); + + /* Pointer reference */ + ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_TX_UNI, &(dvobj->traffic_stat.tx_bytes)); + ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_RX_UNI, &(dvobj->traffic_stat.rx_bytes)); + ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_WM_MODE, &(pmlmeext->cur_wireless_mode)); + ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_BAND, &(pHalData->CurrentBandType)); + ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_FORCED_RATE, &(pHalData->ForcedDataRate)); + + ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_SEC_CHNL_OFFSET, &(pHalData->nCur40MhzPrimeSC)); + ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_SEC_MODE, &(adapter->securitypriv.dot11PrivacyAlgrthm)); + ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_BW, &(pHalData->CurrentChannelBW)); + ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_CHNL, &( pHalData->CurrentChannel)); + ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_NET_CLOSED, &(adapter->net_closed)); + ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_FORCED_IGI_LB, &(pHalData->u1ForcedIgiLb)); + + ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_SCAN, &(pmlmepriv->bScanInProcess)); + ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_POWER_SAVING, &(pwrctl->bpower_saving)); + + for(i=0; i #include +int usb_init_recv_priv(_adapter *padapter, u16 ini_in_buf_sz) +{ + struct recv_priv *precvpriv = &padapter->recvpriv; + int i, res = _SUCCESS; + struct recv_buf *precvbuf; +#ifdef CONFIG_RECV_THREAD_MODE + _rtw_init_sema(&precvpriv->recv_sema, 0);//will be removed + _rtw_init_sema(&precvpriv->terminate_recvthread_sema, 0);//will be removed +#endif /* CONFIG_RECV_THREAD_MODE */ + +#ifdef PLATFORM_LINUX + tasklet_init(&precvpriv->recv_tasklet, + (void(*)(unsigned long))usb_recv_tasklet, + (unsigned long)padapter); +#endif /* PLATFORM_LINUX */ + +#ifdef PLATFORM_FREEBSD + TASK_INIT(&precvpriv->recv_tasklet, 0, rtl8192du_recv_tasklet, padapter); + #ifdef CONFIG_RX_INDICATE_QUEUE + TASK_INIT(&precvpriv->rx_indicate_tasklet, 0, rtw_rx_indicate_tasklet, padapter); + #endif /* CONFIG_RX_INDICATE_QUEUE */ +#endif /* PLATFORM_FREEBSD */ + +#ifdef CONFIG_USB_INTERRUPT_IN_PIPE +#ifdef PLATFORM_LINUX + precvpriv->int_in_urb = usb_alloc_urb(0, GFP_KERNEL); + if(precvpriv->int_in_urb == NULL){ + res = _FAIL; + DBG_8192C("alloc_urb for interrupt in endpoint fail !!!!\n"); + goto exit; + } +#endif /* PLATFORM_LINUX */ + precvpriv->int_in_buf = rtw_zmalloc(ini_in_buf_sz); + if(precvpriv->int_in_buf == NULL){ + res = _FAIL; + DBG_8192C("alloc_mem for interrupt in endpoint fail !!!!\n"); + goto exit; + } +#endif /* CONFIG_USB_INTERRUPT_IN_PIPE */ + + /* init recv_buf */ + _rtw_init_queue(&precvpriv->free_recv_buf_queue); + _rtw_init_queue(&precvpriv->recv_buf_pending_queue); + #ifndef CONFIG_USE_USB_BUFFER_ALLOC_RX + /* this is used only when RX_IOBUF is sk_buff */ + skb_queue_head_init(&precvpriv->free_recv_skb_queue); + #endif + + precvpriv->pallocated_recv_buf = rtw_zmalloc(NR_RECVBUFF *sizeof(struct recv_buf) + 4); + if(precvpriv->pallocated_recv_buf==NULL){ + res= _FAIL; + RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("alloc recv_buf fail!\n")); + goto exit; + } + + precvpriv->precv_buf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(precvpriv->pallocated_recv_buf), 4); + + precvbuf = (struct recv_buf*)precvpriv->precv_buf; + + for(i=0; i < NR_RECVBUFF ; i++) + { + _rtw_init_listhead(&precvbuf->list); + + _rtw_spinlock_init(&precvbuf->recvbuf_lock); + + precvbuf->alloc_sz = MAX_RECVBUF_SZ; + + res = rtw_os_recvbuf_resource_alloc(padapter, precvbuf); + if(res==_FAIL) + break; + + precvbuf->ref_cnt = 0; + precvbuf->adapter =padapter; + + //rtw_list_insert_tail(&precvbuf->list, &(precvpriv->free_recv_buf_queue.queue)); + + precvbuf++; + } + + precvpriv->free_recv_buf_queue_cnt = NR_RECVBUFF; + +#if defined(PLATFORM_LINUX) || defined(PLATFORM_FREEBSD) + + skb_queue_head_init(&precvpriv->rx_skb_queue); + +#ifdef CONFIG_RX_INDICATE_QUEUE + memset(&precvpriv->rx_indicate_queue, 0, sizeof(struct ifqueue)); + mtx_init(&precvpriv->rx_indicate_queue.ifq_mtx, "rx_indicate_queue", NULL, MTX_DEF); +#endif /* CONFIG_RX_INDICATE_QUEUE */ + +#ifdef CONFIG_PREALLOC_RECV_SKB + { + int i; + SIZE_PTR tmpaddr=0; + SIZE_PTR alignment=0; + struct sk_buff *pskb=NULL; + + for(i=0; idev = padapter->pifp; + #else + pskb->dev = padapter->pnetdev; + #endif //PLATFORM_FREEBSD + +#ifndef CONFIG_PREALLOC_RX_SKB_BUFFER + tmpaddr = (SIZE_PTR)pskb->data; + alignment = tmpaddr & (RECVBUFF_ALIGN_SZ-1); + skb_reserve(pskb, (RECVBUFF_ALIGN_SZ - alignment)); +#endif + skb_queue_tail(&precvpriv->free_recv_skb_queue, pskb); + } + + pskb=NULL; + } + } +#endif /* CONFIG_PREALLOC_RECV_SKB */ + +#endif /* defined(PLATFORM_LINUX) || defined(PLATFORM_FREEBSD) */ + +exit: + + return res; +} + +void usb_free_recv_priv (_adapter *padapter, u16 ini_in_buf_sz) +{ + int i; + struct recv_buf *precvbuf; + struct recv_priv *precvpriv = &padapter->recvpriv; + + precvbuf = (struct recv_buf *)precvpriv->precv_buf; + + for(i=0; i < NR_RECVBUFF ; i++) + { + rtw_os_recvbuf_resource_free(padapter, precvbuf); + precvbuf++; + } + + if(precvpriv->pallocated_recv_buf) + rtw_mfree(precvpriv->pallocated_recv_buf, NR_RECVBUFF *sizeof(struct recv_buf) + 4); + +#ifdef CONFIG_USB_INTERRUPT_IN_PIPE +#ifdef PLATFORM_LINUX + if(precvpriv->int_in_urb) + { + usb_free_urb(precvpriv->int_in_urb); + } +#endif + if(precvpriv->int_in_buf) + rtw_mfree(precvpriv->int_in_buf, ini_in_buf_sz); +#endif /* CONFIG_USB_INTERRUPT_IN_PIPE */ + +#ifdef PLATFORM_LINUX + + if (skb_queue_len(&precvpriv->rx_skb_queue)) { + DBG_8192C(KERN_WARNING "rx_skb_queue not empty\n"); + } + + rtw_skb_queue_purge(&precvpriv->rx_skb_queue); + + if (skb_queue_len(&precvpriv->free_recv_skb_queue)) { + DBG_8192C(KERN_WARNING "free_recv_skb_queue not empty, %d\n", skb_queue_len(&precvpriv->free_recv_skb_queue)); + } + +#if !defined(CONFIG_USE_USB_BUFFER_ALLOC_RX) + #if defined(CONFIG_PREALLOC_RECV_SKB) && defined(CONFIG_PREALLOC_RX_SKB_BUFFER) + { + struct sk_buff *skb; + + while ((skb = skb_dequeue(&precvpriv->free_recv_skb_queue)) != NULL) + { + if (rtw_free_skb_premem(skb) != 0) + rtw_skb_free(skb); + } + } + #else + rtw_skb_queue_purge(&precvpriv->free_recv_skb_queue); + #endif /* defined(CONFIG_PREALLOC_RX_SKB_BUFFER) && defined(CONFIG_PREALLOC_RECV_SKB) */ +#endif /* !defined(CONFIG_USE_USB_BUFFER_ALLOC_RX) */ + +#endif /* PLATFORM_LINUX */ + +#ifdef PLATFORM_FREEBSD + struct sk_buff *pskb; + while (NULL != (pskb = skb_dequeue(&precvpriv->rx_skb_queue))) + { + rtw_skb_free(pskb); + } + + #if !defined(CONFIG_USE_USB_BUFFER_ALLOC_RX) + rtw_skb_queue_purge(&precvpriv->free_recv_skb_queue); + #endif + +#ifdef CONFIG_RX_INDICATE_QUEUE + struct mbuf *m; + for (;;) { + IF_DEQUEUE(&precvpriv->rx_indicate_queue, m); + if (m == NULL) + break; + m_freem(m); + } + mtx_destroy(&precvpriv->rx_indicate_queue.ifq_mtx); +#endif /* CONFIG_RX_INDICATE_QUEUE */ + +#endif /* PLATFORM_FREEBSD */ +} + +#ifdef CONFIG_USB_SUPPORT_ASYNC_VDN_REQ +int usb_write_async(struct usb_device *udev, u32 addr, void *pdata, u16 len) +{ + u8 request; + u8 requesttype; + u16 wvalue; + u16 index; + int ret; + + requesttype = VENDOR_WRITE;//write_out + request = REALTEK_USB_VENQT_CMD_REQ; + index = REALTEK_USB_VENQT_CMD_IDX;//n/a + + wvalue = (u16)(addr&0x0000ffff); + + ret = _usbctrl_vendorreq_async_write(udev, request, wvalue, index, pdata, len, requesttype); + + return ret; +} + +int usb_async_write8(struct intf_hdl *pintfhdl, u32 addr, u8 val) +{ + u8 data; + int ret; + struct dvobj_priv *pdvobjpriv = (struct dvobj_priv *)pintfhdl->pintf_dev; + struct usb_device *udev=pdvobjpriv->pusbdev; + + _func_enter_; + data = val; + ret = usb_write_async(udev, addr, &data, 1); + _func_exit_; + + return ret; +} + +int usb_async_write16(struct intf_hdl *pintfhdl, u32 addr, u16 val) +{ + u16 data; + int ret; + struct dvobj_priv *pdvobjpriv = (struct dvobj_priv *)pintfhdl->pintf_dev; + struct usb_device *udev=pdvobjpriv->pusbdev; + + _func_enter_; + data = val; + ret = usb_write_async(udev, addr, &data, 2); + _func_exit_; + + return ret; +} + +int usb_async_write32(struct intf_hdl *pintfhdl, u32 addr, u32 val) +{ + u32 data; + int ret; + struct dvobj_priv *pdvobjpriv = (struct dvobj_priv *)pintfhdl->pintf_dev; + struct usb_device *udev=pdvobjpriv->pusbdev; + + _func_enter_; + data = val; + ret = usb_write_async(udev, addr, &data, 4); + _func_exit_; + + return ret; +} +#endif /* CONFIG_USB_SUPPORT_ASYNC_VDN_REQ */ + + + +#ifdef CONFIG_RTL8192D +/* This function only works in 92DU chip. */ +void usb_read_reg_rf_byfw(struct intf_hdl *pintfhdl, + u16 byteCount, + u32 registerIndex, + PVOID buffer) +{ + u16 wPage = 0x0000, offset; + u32 BufferLengthRead; + PADAPTER Adapter = pintfhdl->padapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + u8 RFPath=0,nPHY=0; + + RFPath =(u8) ((registerIndex&0xff0000)>>16); + + if (pHalData->interfaceIndex!=0) + { + nPHY = 1; //MAC1 + if(registerIndex&MAC1_ACCESS_PHY0)// MAC1 need to access PHY0 + nPHY = 0; + } + else + { + if(registerIndex&MAC0_ACCESS_PHY1) + nPHY = 1; + } + registerIndex &= 0xFF; + wPage = ((nPHY<<7)|(RFPath<<5)|8)<<8; + offset = (u16)registerIndex; + + // + // IN a vendor request to read back MAC register. + // + usbctrl_vendorreq(pintfhdl, 0x05, offset, wPage, buffer, byteCount, 0x01); + +} +#endif + +/* + 92DU chip needs to remask "value" parameter, this function only works in 92DU chip. +*/ +static inline void usb_value_remask(struct intf_hdl *pintfhdl, u16 *value) +{ +#ifdef CONFIG_RTL8192D + _adapter *padapter = pintfhdl->padapter; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); + + if ((IS_HARDWARE_TYPE_8192DU(padapter)) && (pHalData->interfaceIndex!=0)) + { + if(*value<0x1000) + *value|=0x4000; + else if ((*value&MAC1_ACCESS_PHY0) && !(*value&0x8000)) // MAC1 need to access PHY0 + *value &= 0xFFF; + } +#endif +} + +u8 usb_read8(struct intf_hdl *pintfhdl, u32 addr) +{ + u8 request; + u8 requesttype; + u16 wvalue; + u16 index; + u16 len; + u8 data=0; + + _func_enter_; + + request = 0x05; + requesttype = 0x01;//read_in + index = 0;//n/a + + wvalue = (u16)(addr&0x0000ffff); + len = 1; + usb_value_remask(pintfhdl, &wvalue); + usbctrl_vendorreq(pintfhdl, request, wvalue, index, + &data, len, requesttype); + + _func_exit_; + + return data; +} + +u16 usb_read16(struct intf_hdl *pintfhdl, u32 addr) +{ + u8 request; + u8 requesttype; + u16 wvalue; + u16 index; + u16 len; + u16 data=0; + + _func_enter_; + + request = 0x05; + requesttype = 0x01;//read_in + index = 0;//n/a + + wvalue = (u16)(addr&0x0000ffff); + len = 2; + usb_value_remask(pintfhdl, &wvalue); + usbctrl_vendorreq(pintfhdl, request, wvalue, index, + &data, len, requesttype); + + _func_exit_; + + return data; + +} + +u32 usb_read32(struct intf_hdl *pintfhdl, u32 addr) +{ + u8 request; + u8 requesttype; + u16 wvalue; + u16 index; + u16 len; + u32 data=0; + + _func_enter_; + + request = 0x05; + requesttype = 0x01;//read_in + index = 0;//n/a + + wvalue = (u16)(addr&0x0000ffff); + len = 4; +#ifdef CONFIG_RTL8192D + if ((IS_HARDWARE_TYPE_8192DU(pintfhdl->padapter)) && ((addr&0xff000000)>>24 == 0x66)) { + usb_read_reg_rf_byfw(pintfhdl, len, addr, &data); + } else +#endif + { + usb_value_remask(pintfhdl, &wvalue); + usbctrl_vendorreq(pintfhdl, request, wvalue, index, + &data, len, requesttype); + } + + _func_exit_; + + return data; +} + +int usb_write8(struct intf_hdl *pintfhdl, u32 addr, u8 val) +{ + u8 request; + u8 requesttype; + u16 wvalue; + u16 index; + u16 len; + u8 data; + int ret; + + _func_enter_; + + request = 0x05; + requesttype = 0x00;//write_out + index = 0;//n/a + + wvalue = (u16)(addr&0x0000ffff); + len = 1; + + data = val; + usb_value_remask(pintfhdl, &wvalue); + ret = usbctrl_vendorreq(pintfhdl, request, wvalue, index, + &data, len, requesttype); + + _func_exit_; + + return ret; +} + +int usb_write16(struct intf_hdl *pintfhdl, u32 addr, u16 val) +{ + u8 request; + u8 requesttype; + u16 wvalue; + u16 index; + u16 len; + u16 data; + int ret; + + _func_enter_; + + request = 0x05; + requesttype = 0x00;//write_out + index = 0;//n/a + + wvalue = (u16)(addr&0x0000ffff); + len = 2; + + data = val; + usb_value_remask(pintfhdl, &wvalue); + ret = usbctrl_vendorreq(pintfhdl, request, wvalue, index, + &data, len, requesttype); + + _func_exit_; + + return ret; + +} + +int usb_write32(struct intf_hdl *pintfhdl, u32 addr, u32 val) +{ + u8 request; + u8 requesttype; + u16 wvalue; + u16 index; + u16 len; + u32 data; + int ret; + + _func_enter_; + + request = 0x05; + requesttype = 0x00;//write_out + index = 0;//n/a + + wvalue = (u16)(addr&0x0000ffff); + len = 4; + data =val; + usb_value_remask(pintfhdl, &wvalue); + ret = usbctrl_vendorreq(pintfhdl, request, wvalue, index, + &data, len, requesttype); + + _func_exit_; + + return ret; + +} + +int usb_writeN(struct intf_hdl *pintfhdl, u32 addr, u32 length, u8 *pdata) +{ + u8 request; + u8 requesttype; + u16 wvalue; + u16 index; + u16 len; + u8 buf[VENDOR_CMD_MAX_DATA_LEN]={0}; + int ret; + + _func_enter_; + + request = 0x05; + requesttype = 0x00;//write_out + index = 0;//n/a + + wvalue = (u16)(addr&0x0000ffff); + len = length; + _rtw_memcpy(buf, pdata, len ); + usb_value_remask(pintfhdl, &wvalue); + ret = usbctrl_vendorreq(pintfhdl, request, wvalue, index, + buf, len, requesttype); + + _func_exit_; + + return ret; + +} diff --git a/backports/drivers/realtek/rtl8812au/hal/hal_intf.c b/backports/drivers/realtek/rtl8812au/hal/hal_intf.c index 6d222a38417baf..9c83490ae03755 100755 --- a/backports/drivers/realtek/rtl8812au/hal/hal_intf.c +++ b/backports/drivers/realtek/rtl8812au/hal/hal_intf.c @@ -43,28 +43,53 @@ void rtw_hal_read_chip_version(_adapter *padapter) void rtw_hal_def_value_init(_adapter *padapter) { - if (is_primary_adapter(padapter)) + if (is_primary_adapter(padapter)) { if(padapter->HalFunc.init_default_value) padapter->HalFunc.init_default_value(padapter); + + rtw_init_hal_com_default_value(padapter); + + { + struct dvobj_priv *dvobj = adapter_to_dvobj(padapter); + HAL_DATA_TYPE *hal_data = GET_HAL_DATA(padapter); + + /* hal_data..macid_num is ready here */ + dvobj->macid_ctl.num = rtw_min(hal_data->macid_num, MACID_NUM_SW_LIMIT); + } + } } void rtw_hal_free_data(_adapter *padapter) { + //free HAL Data + rtw_hal_data_deinit(padapter); + if (is_primary_adapter(padapter)) if(padapter->HalFunc.free_hal_data) padapter->HalFunc.free_hal_data(padapter); } -void rtw_hal_dm_init(_adapter *padapter) +void rtw_hal_dm_init(_adapter *padapter) { - if (is_primary_adapter(padapter)) + if (is_primary_adapter(padapter)) { + PHAL_DATA_TYPE pHalData = GET_HAL_DATA(padapter); + struct dm_priv *pdmpriv = &pHalData->dmpriv; + if(padapter->HalFunc.dm_init) padapter->HalFunc.dm_init(padapter); + + _rtw_spinlock_init(&pdmpriv->IQKSpinLock); + } } void rtw_hal_dm_deinit(_adapter *padapter) { - // cancel dm timer - if (is_primary_adapter(padapter)) + if (is_primary_adapter(padapter)) { + PHAL_DATA_TYPE pHalData = GET_HAL_DATA(padapter); + struct dm_priv *pdmpriv = &pHalData->dmpriv; + if(padapter->HalFunc.dm_deinit) padapter->HalFunc.dm_deinit(padapter); + + _rtw_spinlock_free(&pdmpriv->IQKSpinLock); + } } void rtw_hal_sw_led_init(_adapter *padapter) { @@ -98,11 +123,11 @@ void rtw_hal_init_opmode(_adapter *padapter) fw_state = get_fwstate(pmlmepriv); - if (fw_state | WIFI_ADHOC_STATE) + if (fw_state & WIFI_ADHOC_STATE) networkType = Ndis802_11IBSS; - else if (fw_state | WIFI_STATION_STATE) + else if (fw_state & WIFI_STATION_STATE) networkType = Ndis802_11Infrastructure; - else if (fw_state | WIFI_AP_STATE) + else if (fw_state & WIFI_AP_STATE) networkType = Ndis802_11APMode; else return; @@ -151,28 +176,31 @@ uint rtw_hal_init(_adapter *padapter) if(status == _SUCCESS){ - rtw_hal_init_opmode(padapter); - - for (i = 0; iiface_nums; i++) { - padapter = dvobj->padapters[i]; - padapter->hw_init_completed = _TRUE; - } + for (i = 0; iiface_nums; i++) + dvobj->padapters[i]->hw_init_completed = _TRUE; if (padapter->registrypriv.notch_filter == 1) rtw_hal_notch_filter(padapter, 1); rtw_hal_reset_security_engine(padapter); - rtw_sec_restore_wep_key(padapter); + + for (i = 0; iiface_nums; i++) + rtw_sec_restore_wep_key(dvobj->padapters[i]); rtw_led_control(padapter, LED_CTL_POWER_ON); init_hw_mlme_ext(padapter); + + rtw_hal_init_opmode(padapter); + +#ifdef CONFIG_RF_GAIN_OFFSET + rtw_bb_rf_gain_offset(padapter); +#endif //CONFIG_RF_GAIN_OFFSET + } else{ - for (i = 0; iiface_nums; i++) { - padapter = dvobj->padapters[i]; - padapter->hw_init_completed = _FALSE; - } + for (i = 0; iiface_nums; i++) + dvobj->padapters[i]->hw_init_completed = _FALSE; DBG_871X("rtw_hal_init: hal__init fail\n"); } @@ -246,10 +274,10 @@ void rtw_hal_set_odm_var(_adapter *padapter, HAL_ODM_VARIABLE eVariable, PVOID p if(padapter->HalFunc.SetHalODMVarHandler) padapter->HalFunc.SetHalODMVarHandler(padapter,eVariable,pValue1,bSet); } -void rtw_hal_get_odm_var(_adapter *padapter, HAL_ODM_VARIABLE eVariable, PVOID pValue1,BOOLEAN bSet) +void rtw_hal_get_odm_var(_adapter *padapter, HAL_ODM_VARIABLE eVariable, PVOID pValue1,PVOID pValue2) { if(padapter->HalFunc.GetHalODMVarHandler) - padapter->HalFunc.GetHalODMVarHandler(padapter,eVariable,pValue1,bSet); + padapter->HalFunc.GetHalODMVarHandler(padapter,eVariable,pValue1,pValue2); } void rtw_hal_enable_interrupt(_adapter *padapter) @@ -480,20 +508,47 @@ s32 rtw_hal_interrupt_handler(_adapter *padapter) void rtw_hal_set_bwmode(_adapter *padapter, CHANNEL_WIDTH Bandwidth, u8 Offset) { + PHAL_DATA_TYPE pHalData = GET_HAL_DATA(padapter); + PDM_ODM_T pDM_Odm = &(pHalData->odmpriv); + if(padapter->HalFunc.set_bwmode_handler) + { + ODM_AcquireSpinLock( pDM_Odm, RT_IQK_SPINLOCK); + if(pDM_Odm->RFCalibrateInfo.bIQKInProgress == _TRUE) + DBG_871X_LEVEL(_drv_err_, "%s, %d, IQK may race condition\n", __func__,__LINE__); + ODM_ReleaseSpinLock( pDM_Odm, RT_IQK_SPINLOCK); padapter->HalFunc.set_bwmode_handler(padapter, Bandwidth, Offset); + } } void rtw_hal_set_chan(_adapter *padapter, u8 channel) { + PHAL_DATA_TYPE pHalData = GET_HAL_DATA(padapter); + PDM_ODM_T pDM_Odm = &(pHalData->odmpriv); + if(padapter->HalFunc.set_channel_handler) + { + ODM_AcquireSpinLock( pDM_Odm, RT_IQK_SPINLOCK); + if(pDM_Odm->RFCalibrateInfo.bIQKInProgress == _TRUE) + DBG_871X_LEVEL(_drv_err_, "%s, %d, IQK may race condition\n", __func__,__LINE__); + ODM_ReleaseSpinLock( pDM_Odm, RT_IQK_SPINLOCK); padapter->HalFunc.set_channel_handler(padapter, channel); + } } void rtw_hal_set_chnl_bw(_adapter *padapter, u8 channel, CHANNEL_WIDTH Bandwidth, u8 Offset40, u8 Offset80) { + PHAL_DATA_TYPE pHalData = GET_HAL_DATA(padapter); + PDM_ODM_T pDM_Odm = &(pHalData->odmpriv); + if(padapter->HalFunc.set_chnl_bw_handler) + { + ODM_AcquireSpinLock( pDM_Odm, RT_IQK_SPINLOCK); + if(pDM_Odm->RFCalibrateInfo.bIQKInProgress == _TRUE) + DBG_871X_LEVEL(_drv_err_, "%s, %d, IQK may race condition\n", __func__,__LINE__); + ODM_ReleaseSpinLock( pDM_Odm, RT_IQK_SPINLOCK); padapter->HalFunc.set_chnl_bw_handler(padapter, channel, Bandwidth, Offset40, Offset80); + } } void rtw_hal_set_tx_power_level(_adapter *padapter, u8 channel) @@ -704,37 +759,50 @@ s32 rtw_hal_is_disable_sw_channel_plan(PADAPTER padapter) return GET_HAL_DATA(padapter)->bDisableSWChannelPlan; } -s32 rtw_hal_macid_sleep(PADAPTER padapter, u32 macid) +s32 rtw_hal_macid_sleep(PADAPTER padapter, u8 macid) { + struct dvobj_priv *dvobj = adapter_to_dvobj(padapter); + struct macid_ctl_t *macid_ctl = dvobj_to_macidctl(dvobj); u8 support; - support = _FALSE; rtw_hal_get_def_var(padapter, HAL_DEF_MACID_SLEEP, &support); if (_FALSE == support) return _FAIL; - rtw_hal_set_hwreg(padapter, HW_VAR_MACID_SLEEP, (u8*)&macid); + if (macid >= macid_ctl->num) { + DBG_871X_LEVEL(_drv_err_, FUNC_ADPT_FMT": Invalid macid(%u)\n", + FUNC_ADPT_ARG(padapter), macid); + return _FAIL; + } + + rtw_hal_set_hwreg(padapter, HW_VAR_MACID_SLEEP, &macid); return _SUCCESS; } -s32 rtw_hal_macid_wakeup(PADAPTER padapter, u32 macid) +s32 rtw_hal_macid_wakeup(PADAPTER padapter, u8 macid) { + struct dvobj_priv *dvobj = adapter_to_dvobj(padapter); + struct macid_ctl_t *macid_ctl = dvobj_to_macidctl(dvobj); u8 support; - support = _FALSE; rtw_hal_get_def_var(padapter, HAL_DEF_MACID_SLEEP, &support); if (_FALSE == support) return _FAIL; - rtw_hal_set_hwreg(padapter, HW_VAR_MACID_WAKEUP, (u8*)&macid); + if (macid >= macid_ctl->num) { + DBG_871X_LEVEL(_drv_err_, FUNC_ADPT_FMT": Invalid macid(%u)\n", + FUNC_ADPT_ARG(padapter), macid); + return _FAIL; + } + + rtw_hal_set_hwreg(padapter, HW_VAR_MACID_WAKEUP, &macid); return _SUCCESS; } -#ifdef CONFIG_BT_COEXIST s32 rtw_hal_fill_h2c_cmd(PADAPTER padapter, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer) { s32 ret = _FAIL; @@ -744,10 +812,15 @@ s32 rtw_hal_fill_h2c_cmd(PADAPTER padapter, u8 ElementID, u32 CmdLen, u8 *pCmdBu else { DBG_871X("%s: func[fill_h2c_cmd] not defined!\n", __FUNCTION__); + rtw_warn_on(1); } return ret; } -#endif // CONFIG_BT_COEXIST - - +#ifdef CONFIG_GPIO_API +void rtw_hal_update_hisr_hsisr_ind(_adapter *padapter, u32 flag) +{ + if (padapter->HalFunc.update_hisr_hsisr_ind) + padapter->HalFunc.update_hisr_hsisr_ind(padapter, flag); +} +#endif diff --git a/backports/drivers/realtek/rtl8812au/hal/led/hal_usb_led.c b/backports/drivers/realtek/rtl8812au/hal/led/hal_usb_led.c index b16ee470462bf2..41b0ac0615d9c1 100755 --- a/backports/drivers/realtek/rtl8812au/hal/led/hal_usb_led.c +++ b/backports/drivers/realtek/rtl8812au/hal/led/hal_usb_led.c @@ -1237,6 +1237,7 @@ SwLedBlink9( SwLedOff(Adapter, pLed); RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Blinktimes (%d): turn off\n", pLed->BlinkTimes)); } + //DBG_871X("%s, pLed->CurrLedState=%d, pLed->BlinkingLedState=%d \n", __FUNCTION__, pLed->CurrLedState, pLed->BlinkingLedState); switch(pLed->CurrLedState) @@ -1260,8 +1261,8 @@ SwLedBlink9( case LED_BLINK_StartToBlink: if( pLed->bLedOn ) { - pLed->BlinkingLedState = RTW_LED_OFF; - _set_timer(&(pLed->BlinkTimer), LED_BLINK_SLOWLY_INTERVAL); + pLed->BlinkingLedState = RTW_LED_OFF; + _set_timer(&(pLed->BlinkTimer), LED_BLINK_SLOWLY_INTERVAL); } else { @@ -1286,7 +1287,7 @@ SwLedBlink9( else if(check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) { pLed->bLedLinkBlinkInProgress = _TRUE; - pLed->CurrLedState = LED_BLINK_ALWAYS_ON; + pLed->CurrLedState = LED_BLINK_SLOWLY; _set_timer(&(pLed->BlinkTimer), LED_BLINK_LINK_INTERVAL_ALPHA); RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("CurrLedState %d\n", pLed->CurrLedState)); @@ -1336,8 +1337,7 @@ SwLedBlink9( } else { - pLed->bLedNoLinkBlinkInProgress = _TRUE; - pLed->CurrLedState = LED_BLINK_ALWAYS_ON; + pLed->CurrLedState = LED_BLINK_SLOWLY; if( pLed->bLedOn ) pLed->BlinkingLedState = RTW_LED_OFF; else @@ -2326,7 +2326,7 @@ void BlinkHandler(PLED_USB pLed) //DBG_871X("%s (%s:%d)\n",__FUNCTION__, current->comm, current->pid); - if( (padapter->bSurpriseRemoved == _TRUE) || ( padapter->bDriverStopped == _TRUE)) + if( (padapter->bSurpriseRemoved == _TRUE) || (padapter->hw_init_completed == _FALSE)) { //DBG_871X("%s bSurpriseRemoved:%d, bDriverStopped:%d\n", __FUNCTION__, padapter->bSurpriseRemoved, padapter->bDriverStopped); return; @@ -2417,7 +2417,7 @@ void BlinkTimerCallback(void *data) //DBG_871X("%s\n", __FUNCTION__); - if( (padapter->bSurpriseRemoved == _TRUE) || ( padapter->bDriverStopped == _TRUE)) + if( (padapter->bSurpriseRemoved == _TRUE) || (padapter->hw_init_completed == _FALSE)) { //DBG_871X("%s bSurpriseRemoved:%d, bDriverStopped:%d\n", __FUNCTION__, padapter->bSurpriseRemoved, padapter->bDriverStopped); return; @@ -2426,7 +2426,8 @@ void BlinkTimerCallback(void *data) #ifdef CONFIG_LED_HANDLED_BY_CMD_THREAD rtw_led_blink_cmd(padapter, (PVOID)pLed); #else - _set_workitem(&(pLed->BlinkWorkItem)); + if(ATOMIC_READ(&pLed->bCancelWorkItem) == _FALSE) + _set_workitem(&(pLed->BlinkWorkItem)); #endif } @@ -3879,7 +3880,7 @@ SwLedControlMode9( PLED_USB pLed1 = &(ledpriv->SwLed1); PLED_USB pLed2 = &(ledpriv->SwLed2); BOOLEAN bWPSOverLap = _FALSE; - + //DBG_871X("LedAction=%d \n", LedAction); switch(LedAction) { case LED_CTL_START_TO_LINK: @@ -3980,7 +3981,7 @@ SwLedControlMode9( if(LedAction == LED_CTL_LINK) { pLed->BlinkingLedState = RTW_LED_ON; - pLed->CurrLedState = LED_BLINK_ALWAYS_ON; + pLed->CurrLedState = LED_BLINK_SLOWLY; } else { @@ -4068,7 +4069,7 @@ SwLedControlMode9( pLed2->CurrLedState = LED_BLINK_LINK_IN_PROCESS; pLed2->bLedWPSBlinkInProgress = _TRUE; - _set_timer(&(pLed2->BlinkTimer), 0); + _set_timer(&(pLed2->BlinkTimer), 500); break; @@ -4097,7 +4098,7 @@ SwLedControlMode9( case LED_CTL_STOP_WPS_FAIL: //WPS authentication fail //LED1 settings - if(bWPSOverLap == _FALSE) + //if(bWPSOverLap == _FALSE) { pLed1->CurrLedState = LED_BLINK_AUTH_ERROR; pLed1->BlinkTimes = 50; @@ -4107,13 +4108,13 @@ SwLedControlMode9( pLed1->BlinkingLedState = RTW_LED_ON; _set_timer(&(pLed1->BlinkTimer), 0); } - else - { - bWPSOverLap = _FALSE; - pLed1->CurrLedState = RTW_LED_OFF; - pLed1->BlinkingLedState = RTW_LED_OFF; - _set_timer(&(pLed1->BlinkTimer), 0); - } + //else + //{ + // bWPSOverLap = _FALSE; + // pLed1->CurrLedState = RTW_LED_OFF; + // pLed1->BlinkingLedState = RTW_LED_OFF; + // _set_timer(&(pLed1->BlinkTimer), 0); + //} //LED2 settings pLed2->CurrLedState = RTW_LED_OFF; @@ -5202,9 +5203,8 @@ InitLed( pLed->LedPin = LedPin; ResetLedStatus(pLed); - + ATOMIC_SET(&pLed->bCancelWorkItem, _FALSE); _init_timer(&(pLed->BlinkTimer), padapter->pnetdev, BlinkTimerCallback, pLed); - _init_workitem(&(pLed->BlinkWorkItem), BlinkWorkItemCallback, pLed); } @@ -5218,6 +5218,7 @@ DeInitLed( PLED_USB pLed ) { + ATOMIC_SET(&pLed->bCancelWorkItem, _TRUE); _cancel_workitem_sync(&(pLed->BlinkWorkItem)); _cancel_timer_ex(&(pLed->BlinkTimer)); ResetLedStatus(pLed); diff --git a/backports/drivers/realtek/rtl8812au/hal/rtl8812a/rtl8812a_cmd.c b/backports/drivers/realtek/rtl8812au/hal/rtl8812a/rtl8812a_cmd.c index 4f39b904dd22f2..07c84a680af2da 100755 --- a/backports/drivers/realtek/rtl8812au/hal/rtl8812a/rtl8812a_cmd.c +++ b/backports/drivers/realtek/rtl8812au/hal/rtl8812a/rtl8812a_cmd.c @@ -22,7 +22,7 @@ //#include #include #include "hal_com_h2c.h" - +#include #define CONFIG_H2C_EF #define RTL8812_MAX_H2C_BOX_NUMS 4 @@ -45,9 +45,8 @@ static u8 _is_fw_read_cmd_down(_adapter* padapter, u8 msgbox_num) if(0 == valid ){ read_down = _TRUE; } -#ifdef CONFIG_WOWLAN - rtw_msleep_os(2); -#endif + else + rtw_msleep_os(1); }while( (!read_down) && (retry_cnts--)); return read_down; @@ -67,8 +66,6 @@ static u8 _is_fw_read_cmd_down(_adapter* padapter, u8 msgbox_num) ******************************************/ s32 FillH2CCmd_8812(PADAPTER padapter, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer) { - u8 bcmd_down = _FALSE; - s32 retry_cnts = 100; u8 h2c_box_num; u32 msgbox_addr; u32 msgbox_ex_addr; @@ -144,14 +141,12 @@ _func_enter_; rtw_write32(padapter,msgbox_addr, h2c_cmd); #endif - bcmd_down = _TRUE; - - // DBG_8192C("MSG_BOX:%d,CmdLen(%d), reg:0x%x =>h2c_cmd:0x%x, reg:0x%x =>h2c_cmd_ex:0x%x ..\n" - // ,pHalData->LastHMEBoxNum ,CmdLen,msgbox_addr,h2c_cmd,msgbox_ex_addr,h2c_cmd_ex); + //DBG_871X("MSG_BOX:%d,CmdLen(%d), reg:0x%x =>h2c_cmd:0x%x, reg:0x%x =>h2c_cmd_ex:0x%x ..\n" + // ,pHalData->LastHMEBoxNum ,CmdLen,msgbox_addr,h2c_cmd,msgbox_ex_addr,h2c_cmd_ex); pHalData->LastHMEBoxNum = (h2c_box_num+1) % RTL8812_MAX_H2C_BOX_NUMS; - - }while((!bcmd_down) && (retry_cnts--)); + + }while(0); ret = _SUCCESS; @@ -255,6 +250,8 @@ Set_RA_LDPC_8812( else CLEAR_FLAG(psta->htpriv.ldpc_cap, LDPC_HT_ENABLE_TX); } + + update_ldpc_stbc_cap(psta); #endif //DBG_871X("MacId %d bLDPC %d\n", psta->mac_id, bLDPC); @@ -268,28 +265,29 @@ Get_RA_LDPC_8812( { u8 bLDPC = 0; - if(psta->mac_id == 1) - bLDPC = 0; - else if(psta != NULL) - { + if (psta != NULL) { + if(psta->mac_id == 1) { + bLDPC = 0; + } else { #ifdef CONFIG_80211AC_VHT - if(IsSupportedVHT(psta->wireless_mode)) - { - if(TEST_FLAG(psta->vhtpriv.ldpc_cap, LDPC_VHT_CAP_TX)) - bLDPC = 1; + if(IsSupportedVHT(psta->wireless_mode)) + { + if(TEST_FLAG(psta->vhtpriv.ldpc_cap, LDPC_VHT_CAP_TX)) + bLDPC = 1; + else + bLDPC = 0; + } + else if(IsSupportedHT(psta->wireless_mode)) + { + if(TEST_FLAG(psta->htpriv.ldpc_cap, LDPC_HT_CAP_TX)) + bLDPC =1; + else + bLDPC =0; + } else +#endif bLDPC = 0; - } - else if(IsSupportedHT(psta->wireless_mode)) - { - if(TEST_FLAG(psta->htpriv.ldpc_cap, LDPC_HT_CAP_TX)) - bLDPC =1; - else - bLDPC =0; } - else -#endif - bLDPC = 0; } return (bLDPC << 2); @@ -327,6 +325,20 @@ _func_enter_; H2CCommand[1] = (raid & 0x1F) | (shortGIrate?0x80:0x00) ; H2CCommand[2] = (psta->bw_mode & 0x3) |Get_RA_LDPC_8812(psta) |Get_VHT_ENI(0, psta->wireless_mode, bitmap); + //DisableTXPowerTraining + if(pHalData->bDisableTXPowerTraining){ + H2CCommand[2] |= BIT6; + DBG_871X("%s,Disable PWT by driver\n",__FUNCTION__); + } + else{ + PDM_ODM_T pDM_OutSrc = &pHalData->odmpriv; + + if(pDM_OutSrc->bDisablePowerTraining){ + H2CCommand[2] |= BIT6; + DBG_871X("%s,Disable PWT by DM\n",__FUNCTION__); + } + } + H2CCommand[3] = (u8)(bitmap & 0x000000ff); H2CCommand[4] = (u8)((bitmap & 0x0000ff00) >>8); H2CCommand[5] = (u8)((bitmap & 0x00ff0000) >> 16); @@ -361,9 +373,10 @@ void rtl8812_Add_RateATid(PADAPTER pAdapter, u32 bitmap, u8* arg, u8 rssi_level) void rtl8812_set_FwPwrMode_cmd(PADAPTER padapter, u8 PSMode) { - u8 u1H2CSetPwrMode[6]={0}; + u8 u1H2CSetPwrMode[H2C_PWRMODE_LEN]={0}; struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); - u8 Mode = 0, RLBM = 0, PowerState = 0, LPSAwakeIntvl = 1, pwrModeByte5 = 0; + u8 Mode = 0, RLBM = 0, PowerState = 0, LPSAwakeIntvl = 2, pwrModeByte5 = 0; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); _func_enter_; @@ -397,7 +410,7 @@ _func_enter_; if (Mode > PS_MODE_ACTIVE) { #ifdef CONFIG_BT_COEXIST - if ((rtw_btcoex_IsBtControlLps(padapter) == _TRUE)) + if ((rtw_btcoex_IsBtControlLps(padapter) == _TRUE) && (_TRUE == pHalData->EEPROMBluetoothCoexist)) { PowerState = rtw_btcoex_RpwmVal(padapter); pwrModeByte5 = rtw_btcoex_LpsVal(padapter); @@ -441,9 +454,10 @@ _func_enter_; SET_8812_H2CCMD_PWRMODE_PARM_BYTE5(u1H2CSetPwrMode, pwrModeByte5); #ifdef CONFIG_BT_COEXIST - rtw_btcoex_RecordPwrMode(padapter, u1H2CSetPwrMode, sizeof(u1H2CSetPwrMode)); + if (_TRUE == pHalData->EEPROMBluetoothCoexist) + rtw_btcoex_RecordPwrMode(padapter, u1H2CSetPwrMode, sizeof(u1H2CSetPwrMode)); #endif // CONFIG_BT_COEXIST - + //DBG_871X("u1H2CSetPwrMode="MAC_FMT"\n", MAC_ARG(u1H2CSetPwrMode)); FillH2CCmd_8812(padapter, H2C_8812_SETPWRMODE, sizeof(u1H2CSetPwrMode), u1H2CSetPwrMode); _func_exit_; @@ -713,6 +727,121 @@ void ConstructProbeRsp(_adapter *padapter, u8 *pframe, u32 *pLength, u8 *StaAddr *pLength = pktlen; } +#ifdef CONFIG_GTK_OL +static void ConstructGTKResponse( + PADAPTER padapter, + u8 *pframe, + u32 *pLength + ) +{ + struct rtw_ieee80211_hdr *pwlanhdr; + u16 *fctrl; + u32 pktlen; + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + struct wlan_network *cur_network = &pmlmepriv->cur_network; + struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + struct security_priv *psecuritypriv = &padapter->securitypriv; + static u8 LLCHeader[8] = {0xAA, 0xAA, 0x03, 0x00, 0x00, 0x00, 0x88, 0x8E}; + static u8 GTKbody_a[11] ={0x01, 0x03, 0x00, 0x5F, 0x02, 0x03, 0x12, 0x00, 0x10, 0x42, 0x0B}; + u8 *pGTKRspPkt = pframe; + u8 EncryptionHeadOverhead = 0; + //DBG_871X("%s:%d\n", __FUNCTION__, bForcePowerSave); + + pwlanhdr = (struct rtw_ieee80211_hdr*)pframe; + + fctrl = &pwlanhdr->frame_ctl; + *(fctrl) = 0; + + //------------------------------------------------------------------------- + // MAC Header. + //------------------------------------------------------------------------- + SetFrameType(fctrl, WIFI_DATA); + //SetFrameSubType(fctrl, 0); + SetToDs(fctrl); + _rtw_memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); + _rtw_memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); + _rtw_memcpy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); + + SetSeqNum(pwlanhdr, 0); + SetDuration(pwlanhdr, 0); + +#ifdef CONFIG_WAPI_SUPPORT + *pLength = sMacHdrLng; +#else + *pLength = 24; +#endif //CONFIG_WAPI_SUPPORT + +//YJ,del,120503 +#if 0 + //------------------------------------------------------------------------- + // Qos Header: leave space for it if necessary. + //------------------------------------------------------------------------- + if(pStaQos->CurrentQosMode > QOS_DISABLE) + { + SET_80211_HDR_QOS_EN(pGTKRspPkt, 1); + PlatformZeroMemory(&(Buffer[*pLength]), sQoSCtlLng); + *pLength += sQoSCtlLng; + } +#endif //0 + //------------------------------------------------------------------------- + // Security Header: leave space for it if necessary. + //------------------------------------------------------------------------- + +#if 1 + switch (psecuritypriv->dot11PrivacyAlgrthm) + { + case _WEP40_: + case _WEP104_: + EncryptionHeadOverhead = 4; + break; + case _TKIP_: + EncryptionHeadOverhead = 8; + break; + case _AES_: + EncryptionHeadOverhead = 8; + break; +#ifdef CONFIG_WAPI_SUPPORT + case _SMS4_: + EncryptionHeadOverhead = 18; + break; +#endif //CONFIG_WAPI_SUPPORT + default: + EncryptionHeadOverhead = 0; + } + + if(EncryptionHeadOverhead > 0) + { + _rtw_memset(&(pframe[*pLength]), 0,EncryptionHeadOverhead); + *pLength += EncryptionHeadOverhead; + //SET_80211_HDR_WEP(pGTKRspPkt, 1); //Suggested by CCW. + //GTK's privacy bit is done by FW + //SetPrivacy(fctrl); + } +#endif //1 + //------------------------------------------------------------------------- + // Frame Body. + //------------------------------------------------------------------------- + pGTKRspPkt = (u8*)(pframe+ *pLength); + // LLC header + _rtw_memcpy(pGTKRspPkt, LLCHeader, 8); + *pLength += 8; + + // GTK element + pGTKRspPkt += 8; + + //GTK frame body after LLC, part 1 + _rtw_memcpy(pGTKRspPkt, GTKbody_a, 11); + *pLength += 11; + pGTKRspPkt += 11; + //GTK frame body after LLC, part 2 + _rtw_memset(&(pframe[*pLength]), 0, 88); + *pLength += 88; + pGTKRspPkt += 88; + +} +#endif //CONFIG_GTK_OL + // To check if reserved page content is destroyed by beacon beacuse beacon is too large. // 2010.06.23. Added by tynli. VOID @@ -739,10 +868,7 @@ CheckFwRsvdPageContent( // 2012.08.09, by tynli. // u8 -GetTxBufferRsvdPageNum8812( - IN PADAPTER Adapter, - IN BOOLEAN bWoWLANBoundary -) +GetTxBufferRsvdPageNum8812(_adapter *Adapter, bool bWoWLANBoundary) { HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); u8 RsvdPageNum=0; @@ -846,7 +972,7 @@ static void SetFwRsvdPagePkt_8812(PADAPTER padapter, BOOLEAN bDLFinished) //(2) ps-poll ConstructPSPoll(padapter, &ReservedPagePacket[BufIndex], &PSPollLength); - rtl8812a_fill_fake_txdesc(padapter, &ReservedPagePacket[BufIndex-TxDescLen], PSPollLength, _TRUE, _FALSE); + rtl8812a_fill_fake_txdesc(padapter, &ReservedPagePacket[BufIndex-TxDescLen], PSPollLength, _TRUE, _FALSE, _FALSE); SET_8812_H2CCMD_RSVDPAGE_LOC_PSPOLL(RsvdPageLoc, TotalPageNum); @@ -873,7 +999,7 @@ static void SetFwRsvdPagePkt_8812(PADAPTER padapter, BOOLEAN bDLFinished) &NullFunctionDataLength, get_my_bssid(&pmlmeinfo->network), _FALSE, 0, 0, _FALSE); - rtl8812a_fill_fake_txdesc(padapter, &ReservedPagePacket[BufIndex-TxDescLen], NullFunctionDataLength, _FALSE, _FALSE); + rtl8812a_fill_fake_txdesc(padapter, &ReservedPagePacket[BufIndex-TxDescLen], NullFunctionDataLength, _FALSE, _FALSE, _FALSE); SET_8812_H2CCMD_RSVDPAGE_LOC_NULL_DATA(RsvdPageLoc, TotalPageNum); @@ -900,7 +1026,7 @@ static void SetFwRsvdPagePkt_8812(PADAPTER padapter, BOOLEAN bDLFinished) &QosNullLength, get_my_bssid(&pmlmeinfo->network), _TRUE, 0, 0, _FALSE); - rtl8812a_fill_fake_txdesc(padapter, &ReservedPagePacket[BufIndex-TxDescLen], QosNullLength, _FALSE, _FALSE); + rtl8812a_fill_fake_txdesc(padapter, &ReservedPagePacket[BufIndex-TxDescLen], QosNullLength, _FALSE, _FALSE, _FALSE); SET_8812_H2CCMD_RSVDPAGE_LOC_QOS_NULL_DATA(RsvdPageLoc, TotalPageNum); @@ -928,7 +1054,7 @@ static void SetFwRsvdPagePkt_8812(PADAPTER padapter, BOOLEAN bDLFinished) // update attribute pattrib = &pcmdframe->attrib; update_mgntframe_attrib(padapter, pattrib); - pattrib->qsel = 0x10; + pattrib->qsel = QSLT_BEACON; pattrib->pktlen = pattrib->last_txcmdsz = TotalPacketLen - TxDescLen; #ifdef CONFIG_PCI_HCI dump_mgntframe(padapter, pcmdframe); @@ -1003,7 +1129,7 @@ _func_enter_; do { // download rsvd page. - SetFwRsvdPagePkt_8812(padapter, _FALSE); + rtw_hal_set_fw_rsvd_page(padapter, _FALSE); DLBcnCount++; do { @@ -1045,7 +1171,8 @@ _func_enter_; poll = 0; do { - SetFwRsvdPagePkt_8812(padapter, _TRUE); + //SetFwRsvdPagePkt_8812(padapter, _TRUE); + rtw_hal_set_fw_rsvd_page(padapter, _TRUE); DLBcnCount++; do @@ -1262,231 +1389,1439 @@ int reset_tsf(PADAPTER Adapter, u8 reset_port ) #endif // CONFIG_TSF_RESET_OFFLOAD -#ifdef CONFIG_WOWLAN -void rtl8812_set_wowlan_cmd(_adapter* padapter, u8 enable) +static void rtl8812_set_FwRsvdPage_cmd(PADAPTER padapter, PRSVDPAGE_LOC rsvdpageloc) { - u8 res=_SUCCESS; - u32 test=0; - struct recv_priv *precvpriv = &padapter->recvpriv; - SETWOWLAN_PARM pwowlan_parm; - struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); - -_func_enter_; - DBG_871X_LEVEL(_drv_always_, "+%s+\n", __func__); + u8 u1H2CRsvdPageParm[H2C_RSVDPAGE_LOC_LEN]={0}; + + DBG_871X("8812au/8821/8811 RsvdPageLoc: ProbeRsp=%d PsPoll=%d Null=%d QoSNull=%d BTNull=%d\n", + rsvdpageloc->LocProbeRsp, rsvdpageloc->LocPsPoll, + rsvdpageloc->LocNullData, rsvdpageloc->LocQosNull, + rsvdpageloc->LocBTQosNull); + + SET_H2CCMD_RSVDPAGE_LOC_PROBE_RSP(u1H2CRsvdPageParm, rsvdpageloc->LocProbeRsp); + SET_H2CCMD_RSVDPAGE_LOC_PSPOLL(u1H2CRsvdPageParm, rsvdpageloc->LocPsPoll); + SET_H2CCMD_RSVDPAGE_LOC_NULL_DATA(u1H2CRsvdPageParm, rsvdpageloc->LocNullData); + SET_H2CCMD_RSVDPAGE_LOC_QOS_NULL_DATA(u1H2CRsvdPageParm, rsvdpageloc->LocQosNull); + SET_H2CCMD_RSVDPAGE_LOC_BT_QOS_NULL_DATA(u1H2CRsvdPageParm, rsvdpageloc->LocBTQosNull); + + RT_PRINT_DATA(_module_hal_init_c_, _drv_always_, "u1H2CRsvdPageParm:", u1H2CRsvdPageParm, H2C_RSVDPAGE_LOC_LEN); + FillH2CCmd_8812(padapter, H2C_RSVD_PAGE, H2C_RSVDPAGE_LOC_LEN, u1H2CRsvdPageParm); +} - pwowlan_parm.mode =0; - pwowlan_parm.gpio_index=0; - pwowlan_parm.gpio_duration=0; - pwowlan_parm.second_mode =0; - pwowlan_parm.reserve=0; +#ifdef CONFIG_WOWLAN +#ifdef CONFIG_PNO_SUPPORT +static void rtl8812_set_FwScanOffloadInfo_cmd(PADAPTER padapter, PRSVDPAGE_LOC rsvdpageloc, u8 enable) +{ + u8 u1H2CScanOffloadInfoParm[H2C_SCAN_OFFLOAD_CTRL_LEN]={0}; + u8 res = 0, count = 0; + struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); - if(enable){ + DBG_871X("%s: loc_probe_packet:%d, loc_scan_info: %d loc_ssid_info:%d\n", + __func__, rsvdpageloc->LocProbePacket, rsvdpageloc->LocScanInfo, rsvdpageloc->LocSSIDInfo); - pwowlan_parm.mode |=FW_WOWLAN_FUN_EN; - pwrpriv->wowlan_magic =_TRUE; - pwrpriv->wowlan_unicast =_TRUE; + SET_H2CCMD_AOAC_NLO_FUN_EN(u1H2CScanOffloadInfoParm, enable); + SET_H2CCMD_AOAC_RSVDPAGE_LOC_SCAN_INFO(u1H2CScanOffloadInfoParm, rsvdpageloc->LocScanInfo); + SET_H2CCMD_AOAC_RSVDPAGE_LOC_PROBE_PACKET(u1H2CScanOffloadInfoParm, rsvdpageloc->LocProbePacket); + SET_H2CCMD_AOAC_RSVDPAGE_LOC_SSID_INFO(u1H2CScanOffloadInfoParm, rsvdpageloc->LocSSIDInfo); - if(pwrpriv->wowlan_pattern ==_TRUE){ - pwowlan_parm.mode |= FW_WOWLAN_PATTERN_MATCH; - DBG_871X_LEVEL(_drv_info_, "%s 2.pwowlan_parm.mode=0x%x \n",__FUNCTION__,pwowlan_parm.mode ); - } - if(pwrpriv->wowlan_magic ==_TRUE){ - pwowlan_parm.mode |=FW_WOWLAN_MAGIC_PKT; - DBG_871X_LEVEL(_drv_info_, "%s 3.pwowlan_parm.mode=0x%x \n",__FUNCTION__,pwowlan_parm.mode ); - } - if(pwrpriv->wowlan_unicast ==_TRUE){ - pwowlan_parm.mode |=FW_WOWLAN_UNICAST; - DBG_871X_LEVEL(_drv_info_, "%s 4.pwowlan_parm.mode=0x%x \n",__FUNCTION__,pwowlan_parm.mode ); - } + RT_PRINT_DATA(_module_hal_init_c_, _drv_always_, "u1H2CScanOffloadInfoParm:", u1H2CScanOffloadInfoParm, H2C_SCAN_OFFLOAD_CTRL_LEN); + FillH2CCmd_8812(padapter, H2C_D0_SCAN_OFFLOAD_INFO, H2C_SCAN_OFFLOAD_CTRL_LEN, u1H2CScanOffloadInfoParm); - if(!(pwrpriv->wowlan_wake_reason & FWDecisionDisconnect)) - rtl8812a_set_FwJoinBssReport_cmd(padapter, 1); - else - DBG_871X_LEVEL(_drv_always_, "%s, disconnected, no FwJoinBssReport\n",__FUNCTION__); + if (pwrpriv->pno_in_resume == _FALSE) { + res = rtw_read8(padapter, 0x1b9); + while( res == 0 && count < 25) { + DBG_871X("[%d] 0x1b9 0x%02x\n", count, res); + res = rtw_read8(padapter, 0x1b9); + DBG_871X("[%d] 0x1c4: 0x%08x 0x1cc:0x%08x\n", + count, rtw_read32(padapter, 0x1c4), rtw_read32(padapter, 0x1cc)); + rtw_msleep_os(2); + count++; + } + count = 0; + res = rtw_read8(padapter, 0x1b9); + while( res != 0x77 && count < 50) { + DBG_871X("[%d] 0x1b9 0x%02x\n", count, res); + res = rtw_read8(padapter, 0x1b9); + DBG_871X("[%d] 0x1c4: 0x%08x 0x1cc:0x%08x\n", + count, rtw_read32(padapter, 0x1c4), rtw_read32(padapter, 0x1cc)); rtw_msleep_os(2); + count++; + } + DBG_871X("0x1b9: 0x%02x\n", res); + } +} +#endif //CONFIG_PNO_SUPPORT - //WOWLAN_GPIO_ACTIVE means GPIO high active - //pwowlan_parm.mode |=FW_WOWLAN_GPIO_ACTIVE; - //pwowlan_parm.mode |=FW_WOWLAN_REKEY_WAKEUP; - pwowlan_parm.mode |=FW_WOWLAN_DEAUTH_WAKEUP; - //pwowlan_parm.mode |=FW_WOWLAN_ALL_PKT_DROP; - //DataPinWakeUp - pwowlan_parm.gpio_index=0x80; +#ifdef CONFIG_AP_WOWLAN +static void rtl8812_set_ap_wow_rsvdpage_cmd(PADAPTER padapter, + PRSVDPAGE_LOC rsvdpageloc) +{ + struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + u8 res = 0, count = 0, header = 0; + u8 rsvdparm[H2C_AOAC_RSVDPAGE_LOC_LEN]={0}; - DBG_871X_LEVEL(_drv_info_, "%s 5.pwowlan_parm.mode=0x%x \n",__FUNCTION__,pwowlan_parm.mode); - DBG_871X_LEVEL(_drv_info_, "%s 6.pwowlan_parm.index=0x%x \n",__FUNCTION__,pwowlan_parm.gpio_index); + header = rtw_read8(padapter, REG_BCNQ_BDNY); - res = FillH2CCmd_8812(padapter, H2C_8812_WO_WLAN, 2, (u8 *)&pwowlan_parm); + DBG_871X("%s: beacon: %d, probeRsp: %d, header:0x%02x\n", __func__, + rsvdpageloc->LocApOffloadBCN, + rsvdpageloc->LocProbeRsp, + header); - rtw_msleep_os(2); + SET_H2CCMD_AP_WOWLAN_RSVDPAGE_LOC_BCN(rsvdparm, + rsvdpageloc->LocApOffloadBCN + header); - //disconnect decision - pwowlan_parm.mode =1; - pwowlan_parm.gpio_index=0; - pwowlan_parm.gpio_duration=0; - FillH2CCmd_8812(padapter, H2C_8812_DISCONNECT_DECISION, 3, (u8 *)&pwowlan_parm); + FillH2CCmd_8812(padapter, H2C_BCN_RSVDPAGE, + H2C_BCN_RSVDPAGE_LEN, rsvdparm); - //keep alive period = 10 * 10 BCN interval - pwowlan_parm.mode =1; - pwowlan_parm.gpio_index=10; + rtw_msleep_os(10); - res = FillH2CCmd_8812(padapter, H2C_8812_KEEP_ALIVE_CTRL, 2, (u8 *)&pwowlan_parm); + _rtw_memset(&rsvdparm, 0, sizeof(rsvdparm)); - rtw_msleep_os(2); - //enable Remote wake ctrl - pwowlan_parm.mode = 1; - pwowlan_parm.gpio_index=0; - pwowlan_parm.gpio_duration=0; + SET_H2CCMD_AP_WOWLAN_RSVDPAGE_LOC_ProbeRsp( + rsvdparm, + rsvdpageloc->LocProbeRsp + header); - res = FillH2CCmd_8812(padapter, H2C_8812_REMOTE_WAKE_CTRL, 3, (u8 *)&pwowlan_parm); - } else { - pwrpriv->wowlan_magic =_FALSE; - res = FillH2CCmd_8812(padapter, H2C_8812_WO_WLAN, 2, (u8 *)&pwowlan_parm); - rtw_msleep_os(2); - res = FillH2CCmd_8812(padapter, H2C_8812_REMOTE_WAKE_CTRL, 3, (u8 *)&pwowlan_parm); - } -_func_exit_; - DBG_871X_LEVEL(_drv_always_, "-%s res:%d-\n", __func__, res); - return ; + FillH2CCmd_8812(padapter, H2C_8192E_PROBERSP_RSVDPAGE, + H2C_PROBERSP_RSVDPAGE_LEN, rsvdparm); + + rtw_msleep_os(10); } -#endif //CONFIG_WOWLAN -int rtl8812_iqk_wait(_adapter* padapter, u32 timeout_ms) + +// +//Description: Fill the reserved packets that FW will use to RSVD page. +//Now we just send 2 types packet to rsvd page. (1)Beacon, (2)ProbeRsp. +// +//Input: bDLFinished +// +//FALSE: At the first time we will send all the packets as a large packet to Hw, +// so we need to set the packet length to total lengh. +// +//TRUE: At the second time, we should send the first packet (default:beacon) +// to Hw again and set the lengh in descriptor to the real beacon lengh. +// 2009.10.15 by tynli. +static void rtl8812_set_AP_FwRsvdPagePkt(PADAPTER padapter, + BOOLEAN bDLFinished) { - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); - struct submit_ctx *iqk_sctx = &pHalData->iqk_sctx; + PHAL_DATA_TYPE pHalData; + struct xmit_frame *pcmdframe; + struct pkt_attrib *pattrib; + struct xmit_priv *pxmitpriv; + struct mlme_ext_priv *pmlmeext; + struct mlme_ext_info *pmlmeinfo; + struct pwrctrl_priv *pwrctl; + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + u32 BeaconLength=0, ProbeRspLength=0; + u8 *ReservedPagePacket; + u8 TxDescLen = TXDESC_SIZE, TxDescOffset = TXDESC_OFFSET; + u8 TotalPageNum=0, CurtPktPageNum=0, RsvdPageNum=0; + u8 currentip[4]; + u16 BufIndex, PageSize = 256; + u32 TotalPacketLen = 0, MaxRsvdPageBufSize=0; + RSVDPAGE_LOC RsvdPageLoc; +#ifdef DBG_CONFIG_ERROR_DETECT + struct sreset_priv *psrtpriv; +#endif // DBG_CONFIG_ERROR_DETECT + + DBG_8192C("+" FUNC_ADPT_FMT ": iface_type=%d\n", + FUNC_ADPT_ARG(padapter), get_iface_type(padapter)); - iqk_sctx->submit_time = rtw_get_current_time(); - iqk_sctx->timeout_ms = timeout_ms; - iqk_sctx->status = RTW_SCTX_SUBMITTED; + pHalData = GET_HAL_DATA(padapter); +#ifdef DBG_CONFIG_ERROR_DETECT + psrtpriv = &pHalData->srestpriv; +#endif + pxmitpriv = &padapter->xmitpriv; + pmlmeext = &padapter->mlmeextpriv; + pmlmeinfo = &pmlmeext->mlmext_info; + pwrctl = adapter_to_pwrctl(padapter); + RsvdPageNum = 21; + MaxRsvdPageBufSize = RsvdPageNum*PageSize; - return rtw_sctx_wait(iqk_sctx, __func__); -} + pcmdframe = rtw_alloc_cmdxmitframe(pxmitpriv); + if (pcmdframe == NULL) { + DBG_871X("%s: alloc ReservedPagePacket fail!\n", __FUNCTION__); + return; + } -void rtl8812_iqk_done(_adapter* padapter) -{ - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); - struct submit_ctx *iqk_sctx = &pHalData->iqk_sctx; - - rtw_sctx_done(&iqk_sctx); -} + ReservedPagePacket = pcmdframe->buf_addr; + _rtw_memset(&RsvdPageLoc, 0, sizeof(RSVDPAGE_LOC)); -static VOID -C2HTxFeedbackHandler_8812( - IN PADAPTER Adapter, - IN u8 *CmdBuf, - IN u8 CmdLen -) -{ -#ifdef CONFIG_XMIT_ACK - if (GET_8812_C2H_TX_RPT_RETRY_OVER(CmdBuf) | GET_8812_C2H_TX_RPT_LIFE_TIME_OVER(CmdBuf)) { - rtw_ack_tx_done(&Adapter->xmitpriv, RTW_SCTX_DONE_CCX_PKT_FAIL); - } else { - rtw_ack_tx_done(&Adapter->xmitpriv, RTW_SCTX_DONE_SUCCESS); - } -#endif -} + //3 (1) beacon + BufIndex = TxDescOffset; + ConstructBeacon(padapter, &ReservedPagePacket[BufIndex], &BeaconLength); -static VOID -C2HRaReportHandler_8812( - IN PADAPTER Adapter, - IN u8* CmdBuf, - IN u8 CmdLen -) -{ - u8 Rate = CmdBuf[0] & 0x3F; - u8 MacId = CmdBuf[1]; - BOOLEAN bLDPC = CmdBuf[2] & BIT0; - BOOLEAN bTxBF = (CmdBuf[2] & BIT1) >> 1; - BOOLEAN bNoisyStateFromC2H = (CmdBuf[2] & BIT2) >> 2; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + // When we count the first page size, we need to reserve description size for the RSVD + // packet, it will be filled in front of the packet in TXPKTBUF. + CurtPktPageNum = (u8)PageNum_256(TxDescLen + BeaconLength); + //If we don't add 1 more page, the WOWLAN function has a problem. Baron thinks it's a bug of firmware + if (CurtPktPageNum == 1) + { + CurtPktPageNum += 1; + } + TotalPageNum += CurtPktPageNum; - //pHalData->CurrentRARate = MRateToHwRate(Rate); + BufIndex += (CurtPktPageNum*PageSize); - ODM_UpdateInitRate(&pHalData->odmpriv, Rate); - //ODM_UpdateNoisyState(&pHalData->odmpriv, bNoisyStateFromC2H); -} + //2 (4) probe response + RsvdPageLoc.LocProbeRsp = TotalPageNum; + rtw_get_current_ip_address(padapter, currentip); + ConstructProbeRsp( + padapter, + &ReservedPagePacket[BufIndex], + &ProbeRspLength, + currentip, + _FALSE); + rtl8812a_fill_fake_txdesc(padapter, + &ReservedPagePacket[BufIndex-TxDescLen], + ProbeRspLength, + _FALSE, _FALSE, _FALSE); -s32 -_C2HContentParsing8812( - IN PADAPTER Adapter, - IN u8 c2hCmdId, - IN u8 c2hCmdLen, - IN u8 *tmpBuf -) -{ - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - PDM_ODM_T pDM_Odm = &pHalData->odmpriv; - s32 ret = _SUCCESS; + DBG_871X("%s(): HW_VAR_SET_TX_CMD: PROBE RSP %p %d\n", + __func__, &ReservedPagePacket[BufIndex-TxDescLen], + (ProbeRspLength+TxDescLen)); - switch(c2hCmdId) - { - case C2H_8812_DBG: - DBG_871X("[C2H], C2H_8812_DBG!!\n"); - break; + CurtPktPageNum = (u8)PageNum_256(TxDescLen + ProbeRspLength); - case C2H_8812_TXBF: - DBG_871X("[C2H], C2H_8812_TXBF!!\n"); - //C2HTxBeamformingHandler_8812(Adapter, tmpBuf, c2hCmdLen); - break; + TotalPageNum += CurtPktPageNum; - case C2H_8812_TX_REPORT: - //DBG_871X("[C2H], C2H_8812_TX_REPORT!!\n"); - C2HTxFeedbackHandler_8812(Adapter, tmpBuf, c2hCmdLen); - break; + BufIndex += (CurtPktPageNum*PageSize); -#ifdef CONFIG_BT_COEXIST - case C2H_8812_BT_INFO: - //DBG_871X("[C2H], C2H_8812_BT_INFO!!\n"); - rtw_btcoex_BtInfoNotify(Adapter, c2hCmdLen, tmpBuf); - break; -#endif + TotalPacketLen = BufIndex + ProbeRspLength; - case C2H_8812_BT_MP: - DBG_871X("[C2H], C2H_8812_BT_MP!!\n"); -#ifdef CONFIG_MP_INCLUDED -// MPTBT_FwC2hBtMpCtrl(Adapter, tmpBuf, c2hCmdLen); + if (TotalPacketLen > MaxRsvdPageBufSize) { + DBG_871X("%s(): ERROR: The rsvd page size is not enough \ + !!TotalPacketLen %d, MaxRsvdPageBufSize %d\n", + __func__, TotalPacketLen,MaxRsvdPageBufSize); + goto error; + } else { + // update attribute + pattrib = &pcmdframe->attrib; + update_mgntframe_attrib(padapter, pattrib); + pattrib->qsel = QSLT_BEACON; + pattrib->pktlen = TotalPacketLen - TxDescOffset; + pattrib->last_txcmdsz = TotalPacketLen - TxDescOffset; +#ifdef CONFIG_PCI_HCI + dump_mgntframe(padapter, pcmdframe); #else - //NDBG_FwC2hBtControl(Adapter, tmpBuf, c2hCmdLen); + dump_mgntframe_and_wait(padapter, pcmdframe, 100); #endif - break; - - case C2H_8812_RA_RPT: - C2HRaReportHandler_8812(Adapter, tmpBuf, c2hCmdLen); - break; + } - case C2H_8812_FW_SWCHNL: - //DBG_871X("channel to %d\n", *tmpBuf); - break; + DBG_871X("%s: Set RSVD page location to Fw ,TotalPacketLen(%d), TotalPageNum(%d)\n", __FUNCTION__,TotalPacketLen,TotalPageNum); + rtl8812_set_ap_wow_rsvdpage_cmd(padapter, &RsvdPageLoc); - case C2H_8812_IQK_FINISH: - DBG_871X("== IQK Finish ==\n"); - rtl8812_iqk_done(Adapter); - break; + return; +error: + rtw_free_xmitframe(pxmitpriv, pcmdframe); +} +#endif //CONFIG_AP_WOWLAN - case C2H_8812_MAILBOX_STATUS: - DBG_871X("[C2H], mailbox status:%u\n", *tmpBuf); - break; - default: - DBG_871X("%s: [WARNING] unknown C2H(0x%02x)\n", __FUNCTION__, c2hCmdId); - ret = _FAIL; - break; +static void rtl8812_set_FwAoacRsvdPage_cmd(PADAPTER padapter, PRSVDPAGE_LOC rsvdpageloc) +{ + struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + u8 res = 0, count = 0; +#ifdef CONFIG_WOWLAN + u8 u1H2CAoacRsvdPageParm[H2C_AOAC_RSVDPAGE_LOC_LEN]={0}; + + DBG_871X("8192EAOACRsvdPageLoc: RWC=%d ArpRsp=%d NbrAdv=%d GtkRsp=%d GtkInfo=%d ProbeReq=%d NetworkList=%d\n", + rsvdpageloc->LocRemoteCtrlInfo, rsvdpageloc->LocArpRsp, + rsvdpageloc->LocNbrAdv, rsvdpageloc->LocGTKRsp, + rsvdpageloc->LocGTKInfo, rsvdpageloc->LocProbeReq, + rsvdpageloc->LocNetList); + +#ifdef CONFIG_PNO_SUPPORT + DBG_871X("NLO_INFO=%d\n", rsvdpageloc->LocPNOInfo); +#endif + if (check_fwstate(pmlmepriv, _FW_LINKED)) { + SET_H2CCMD_AOAC_RSVDPAGE_LOC_REMOTE_WAKE_CTRL_INFO(u1H2CAoacRsvdPageParm, rsvdpageloc->LocRemoteCtrlInfo); + SET_H2CCMD_AOAC_RSVDPAGE_LOC_ARP_RSP(u1H2CAoacRsvdPageParm, rsvdpageloc->LocArpRsp); + //SET_H2CCMD_AOAC_RSVDPAGE_LOC_NEIGHBOR_ADV(u1H2CAoacRsvdPageParm, rsvdpageloc->LocNbrAdv); + SET_H2CCMD_AOAC_RSVDPAGE_LOC_GTK_RSP(u1H2CAoacRsvdPageParm, rsvdpageloc->LocGTKRsp); + SET_H2CCMD_AOAC_RSVDPAGE_LOC_GTK_INFO(u1H2CAoacRsvdPageParm, rsvdpageloc->LocGTKInfo); +#ifdef CONFIG_GTK_OL + SET_H2CCMD_AOAC_RSVDPAGE_LOC_GTK_EXT_MEM(u1H2CAoacRsvdPageParm, rsvdpageloc->LocGTKEXTMEM); +#endif // CONFIG_GTK_OL + } else { +#ifdef CONFIG_PNO_SUPPORT + if(!pwrpriv->pno_in_resume) { + SET_H2CCMD_AOAC_RSVDPAGE_LOC_NLO_INFO(u1H2CAoacRsvdPageParm, rsvdpageloc->LocPNOInfo); + } +#endif } - return ret; -} + RT_PRINT_DATA(_module_hal_init_c_, _drv_always_, "u1H2CAoacRsvdPageParm:", u1H2CAoacRsvdPageParm, H2C_AOAC_RSVDPAGE_LOC_LEN); + FillH2CCmd_8812(padapter, H2C_AOAC_RSVD_PAGE, H2C_AOAC_RSVDPAGE_LOC_LEN, u1H2CAoacRsvdPageParm); +#ifdef CONFIG_PNO_SUPPORT + if (!check_fwstate(pmlmepriv, WIFI_AP_STATE) && + !check_fwstate(pmlmepriv, _FW_LINKED) && + pwrpriv->pno_in_resume == _FALSE) { -VOID -C2HPacketHandler_8812( - IN PADAPTER Adapter, - IN u8 *Buffer, - IN u8 Length + res = rtw_read8(padapter, 0x1b8); + while(res == 0 && count < 25) { + DBG_871X("[%d] FW loc_NLOInfo: %d\n", count, res); + res = rtw_read8(padapter, 0x1b8); + count++; + rtw_msleep_os(2); + } + } +#endif // CONFIG_PNO_SUPPORT +#endif // CONFIG_WOWLAN +} + +// +// Description: +// Construct the ARP response packet to support ARP offload. +// +static void ConstructARPResponse( + PADAPTER padapter, + u8 *pframe, + u32 *pLength, + u8 *pIPAddress ) { - struct c2h_evt_hdr_88xx *c2h_evt = (struct c2h_evt_hdr_88xx *)Buffer; + struct rtw_ieee80211_hdr *pwlanhdr; + u16 *fctrl; + u32 pktlen; + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + struct wlan_network *cur_network = &pmlmepriv->cur_network; + struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + struct security_priv *psecuritypriv = &padapter->securitypriv; + static u8 ARPLLCHeader[8] = {0xAA, 0xAA, 0x03, 0x00, 0x00, 0x00, 0x08, 0x06}; + u8 *pARPRspPkt = pframe; + //for TKIP Cal MIC + u8 *payload = pframe; + u8 EncryptionHeadOverhead = 0; + //DBG_871X("%s:%d\n", __FUNCTION__, bForcePowerSave); + + pwlanhdr = (struct rtw_ieee80211_hdr*)pframe; + + fctrl = &pwlanhdr->frame_ctl; + *(fctrl) = 0; + + //------------------------------------------------------------------------- + // MAC Header. + //------------------------------------------------------------------------- + SetFrameType(fctrl, WIFI_DATA); + //SetFrameSubType(fctrl, 0); + SetToDs(fctrl); + _rtw_memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); + _rtw_memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); + _rtw_memcpy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); + + SetSeqNum(pwlanhdr, 0); + SetDuration(pwlanhdr, 0); + //SET_80211_HDR_FRAME_CONTROL(pARPRspPkt, 0); + //SET_80211_HDR_TYPE_AND_SUBTYPE(pARPRspPkt, Type_Data); + //SET_80211_HDR_TO_DS(pARPRspPkt, 1); + //SET_80211_HDR_ADDRESS1(pARPRspPkt, pMgntInfo->Bssid); + //SET_80211_HDR_ADDRESS2(pARPRspPkt, Adapter->CurrentAddress); + //SET_80211_HDR_ADDRESS3(pARPRspPkt, pMgntInfo->Bssid); + + //SET_80211_HDR_DURATION(pARPRspPkt, 0); + //SET_80211_HDR_FRAGMENT_SEQUENCE(pARPRspPkt, 0); +#ifdef CONFIG_WAPI_SUPPORT + *pLength = sMacHdrLng; +#else + *pLength = 24; +#endif + +//YJ,del,120503 +#if 0 + //------------------------------------------------------------------------- + // Qos Header: leave space for it if necessary. + //------------------------------------------------------------------------- + if(pStaQos->CurrentQosMode > QOS_DISABLE) + { + SET_80211_HDR_QOS_EN(pARPRspPkt, 1); + PlatformZeroMemory(&(Buffer[*pLength]), sQoSCtlLng); + *pLength += sQoSCtlLng; + } +#endif + //------------------------------------------------------------------------- + // Security Header: leave space for it if necessary. + //------------------------------------------------------------------------- + +#if 1 + switch (psecuritypriv->dot11PrivacyAlgrthm) + { + case _WEP40_: + case _WEP104_: + EncryptionHeadOverhead = 4; + break; + case _TKIP_: + EncryptionHeadOverhead = 8; + break; + case _AES_: + EncryptionHeadOverhead = 8; + break; +#ifdef CONFIG_WAPI_SUPPORT + case _SMS4_: + EncryptionHeadOverhead = 18; + break; +#endif + default: + EncryptionHeadOverhead = 0; + } + + if(EncryptionHeadOverhead > 0) + { + _rtw_memset(&(pframe[*pLength]), 0,EncryptionHeadOverhead); + *pLength += EncryptionHeadOverhead; + //SET_80211_HDR_WEP(pARPRspPkt, 1); //Suggested by CCW. + SetPrivacy(fctrl); + } +#endif + //------------------------------------------------------------------------- + // Frame Body. + //------------------------------------------------------------------------- + pARPRspPkt = (u8*)(pframe+ *pLength); + payload = pARPRspPkt; //Get Payload pointer + // LLC header + _rtw_memcpy(pARPRspPkt, ARPLLCHeader, 8); + *pLength += 8; + + // ARP element + pARPRspPkt += 8; + SET_ARP_PKT_HW(pARPRspPkt, 0x0100); + SET_ARP_PKT_PROTOCOL(pARPRspPkt, 0x0008); // IP protocol + SET_ARP_PKT_HW_ADDR_LEN(pARPRspPkt, 6); + SET_ARP_PKT_PROTOCOL_ADDR_LEN(pARPRspPkt, 4); + SET_ARP_PKT_OPERATION(pARPRspPkt, 0x0200); // ARP response + SET_ARP_PKT_SENDER_MAC_ADDR(pARPRspPkt, myid(&(padapter->eeprompriv))); + SET_ARP_PKT_SENDER_IP_ADDR(pARPRspPkt, pIPAddress); +#ifdef CONFIG_ARP_KEEP_ALIVE + if (rtw_gw_addr_query(padapter)==0) { + SET_ARP_PKT_TARGET_MAC_ADDR(pARPRspPkt, pmlmepriv->gw_mac_addr); + SET_ARP_PKT_TARGET_IP_ADDR(pARPRspPkt, pmlmepriv->gw_ip); + } + else +#endif + { + SET_ARP_PKT_TARGET_MAC_ADDR(pARPRspPkt, get_my_bssid(&(pmlmeinfo->network))); + SET_ARP_PKT_TARGET_IP_ADDR(pARPRspPkt, pIPAddress); + DBG_871X("%s Target Mac Addr:" MAC_FMT "\n", __FUNCTION__, MAC_ARG(get_my_bssid(&(pmlmeinfo->network)))); + DBG_871X("%s Target IP Addr" IP_FMT "\n", __FUNCTION__, IP_ARG(pIPAddress)); + } + + *pLength += 28; + + if (psecuritypriv->dot11PrivacyAlgrthm == _TKIP_) + { + u8 mic[8]; + struct mic_data micdata; + struct sta_info *psta = NULL; + u8 priority[4]={0x0,0x0,0x0,0x0}; + u8 null_key[16]={0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; + + DBG_871X("%s(): Add MIC\n",__FUNCTION__); + + psta = rtw_get_stainfo(&padapter->stapriv, get_my_bssid(&(pmlmeinfo->network))); + if (psta != NULL) { + if(_rtw_memcmp(&psta->dot11tkiptxmickey.skey[0],null_key, 16)==_TRUE){ + DBG_871X("%s(): STA dot11tkiptxmickey==0\n",__FUNCTION__); + } + //start to calculate the mic code + rtw_secmicsetkey(&micdata, &psta->dot11tkiptxmickey.skey[0]); + } + + rtw_secmicappend(&micdata, pwlanhdr->addr3, 6); //DA + + rtw_secmicappend(&micdata, pwlanhdr->addr2, 6); //SA + + priority[0]=0; + rtw_secmicappend(&micdata, &priority[0], 4); + + rtw_secmicappend(&micdata, payload, 36); //payload length = 8 + 28 + + rtw_secgetmic(&micdata,&(mic[0])); + + pARPRspPkt += 28; + _rtw_memcpy(pARPRspPkt, &(mic[0]),8); + + *pLength += 8; + } +} + +//for wake on wlan +static void rtl8812_set_FwRsvdPagePkt(PADAPTER padapter, BOOLEAN bDLFinished) +{ + PHAL_DATA_TYPE pHalData; + struct xmit_frame *pcmdframe; + struct pkt_attrib *pattrib; + struct xmit_priv *pxmitpriv; + struct mlme_ext_priv *pmlmeext; + struct mlme_ext_info *pmlmeinfo; + struct pwrctrl_priv *pwrctl; + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + u32 BeaconLength=0, ProbeRspLength=0, PSPollLength=0; + u32 NullDataLength=0, QosNullLength=0, BTQosNullLength=0; + u32 ProbeReqLength=0; + u8 *ReservedPagePacket; + u8 TxDescLen = TXDESC_SIZE, TxDescOffset = TXDESC_OFFSET; + u8 TotalPageNum=0, CurtPktPageNum=0, RsvdPageNum=0; + u16 BufIndex, PageSize = 256; + u32 TotalPacketLen, MaxRsvdPageBufSize=0; + RSVDPAGE_LOC RsvdPageLoc; +#ifdef CONFIG_WOWLAN + u32 ARPLegnth = 0, GTKLegnth = 0, PNOLength = 0, ScanInfoLength = 0; + u32 SSIDLegnth = 0; + struct security_priv *psecuritypriv = &padapter->securitypriv; //added by xx + u8 currentip[4]; + u8 cur_dot11txpn[8]; +#ifdef CONFIG_GTK_OL + struct sta_priv *pstapriv = &padapter->stapriv; + struct sta_info * psta; + u8 kek[RTW_KEK_LEN]; + u8 kck[RTW_KCK_LEN]; +#endif +#endif +#ifdef DBG_CONFIG_ERROR_DETECT + struct sreset_priv *psrtpriv; +#endif // DBG_CONFIG_ERROR_DETECT + + + if(IS_HARDWARE_TYPE_8812(padapter)) + PageSize = 512; + else if (IS_HARDWARE_TYPE_8821(padapter)) + PageSize = PAGE_SIZE_TX_8821A; + //DBG_871X("%s---->\n", __FUNCTION__); + + pHalData = GET_HAL_DATA(padapter); +#ifdef DBG_CONFIG_ERROR_DETECT + psrtpriv = &pHalData->srestpriv; +#endif + pxmitpriv = &padapter->xmitpriv; + pmlmeext = &padapter->mlmeextpriv; + pmlmeinfo = &pmlmeext->mlmext_info; + pwrctl = adapter_to_pwrctl(padapter); + + //RsvdPageNum = BCNQ_PAGE_NUM_8723B + WOWLAN_PAGE_NUM_8723B; + RsvdPageNum = 21; + MaxRsvdPageBufSize = RsvdPageNum*PageSize; + + pcmdframe = rtw_alloc_cmdxmitframe(pxmitpriv); + if (pcmdframe == NULL) { + DBG_871X("%s: alloc ReservedPagePacket fail!\n", __FUNCTION__); + return; + } + + ReservedPagePacket = pcmdframe->buf_addr; + _rtw_memset(&RsvdPageLoc, 0, sizeof(RSVDPAGE_LOC)); + + //3 (1) beacon + BufIndex = TxDescOffset; + ConstructBeacon(padapter, &ReservedPagePacket[BufIndex], &BeaconLength); + + // When we count the first page size, we need to reserve description size for the RSVD + // packet, it will be filled in front of the packet in TXPKTBUF. + CurtPktPageNum = (u8)PageNum(TxDescLen + BeaconLength, PageSize); + + //If we don't add 1 more page, the WOWLAN function has a problem. Baron thinks it's a bug of firmware + if (CurtPktPageNum == 1) + { + CurtPktPageNum += 1; + } + TotalPageNum += CurtPktPageNum; + + BufIndex += (CurtPktPageNum*PageSize); + + //3 (2) ps-poll + RsvdPageLoc.LocPsPoll = TotalPageNum; + ConstructPSPoll(padapter, &ReservedPagePacket[BufIndex], &PSPollLength); + rtl8812a_fill_fake_txdesc(padapter, &ReservedPagePacket[BufIndex-TxDescLen], PSPollLength, _TRUE, _FALSE, _FALSE); + + //DBG_871X("%s(): HW_VAR_SET_TX_CMD: PS-POLL %p %d\n", + // __FUNCTION__, &ReservedPagePacket[BufIndex-TxDescLen], (PSPollLength+TxDescLen)); + + CurtPktPageNum = (u8)PageNum(TxDescLen + PSPollLength, PageSize); + + TotalPageNum += CurtPktPageNum; + + BufIndex += (CurtPktPageNum*PageSize); + + //3 (3) null data + RsvdPageLoc.LocNullData = TotalPageNum; + ConstructNullFunctionData( + padapter, + &ReservedPagePacket[BufIndex], + &NullDataLength, + get_my_bssid(&pmlmeinfo->network), + _FALSE, 0, 0, _FALSE); + rtl8812a_fill_fake_txdesc(padapter, &ReservedPagePacket[BufIndex-TxDescLen], NullDataLength, _FALSE, _FALSE, _FALSE); + + //DBG_871X("%s(): HW_VAR_SET_TX_CMD: NULL DATA %p %d\n", + // __FUNCTION__, &ReservedPagePacket[BufIndex-TxDescLen], (NullDataLength+TxDescLen)); + + CurtPktPageNum = (u8)PageNum(TxDescLen + NullDataLength, PageSize); + + TotalPageNum += CurtPktPageNum; + + BufIndex += (CurtPktPageNum*PageSize); + +#if 0 + //3 (4) probe response + RsvdPageLoc.LocProbeRsp = TotalPageNum; + ConstructProbeRsp( + padapter, + &ReservedPagePacket[BufIndex], + &ProbeRspLength, + get_my_bssid(&pmlmeinfo->network), + _FALSE); + rtl8812a_fill_fake_txdesc(padapter, &ReservedPagePacket[BufIndex-TxDescLen], ProbeRspLength, _FALSE, _FALSE); + + //DBG_871X("%s(): HW_VAR_SET_TX_CMD: PROBE RSP %p %d\n", + // __FUNCTION__, &ReservedPagePacket[BufIndex-TxDescLen], (ProbeRspLength+TxDescLen)); + + CurtPktPageNum = (u8)PageNum(TxDescLen + ProbeRspLength, PageSize); + + TotalPageNum += CurtPktPageNum; + + BufIndex += (CurtPktPageNum*PageSize); +#endif + + //3 (5) Qos null data + RsvdPageLoc.LocQosNull = TotalPageNum; + ConstructNullFunctionData( + padapter, + &ReservedPagePacket[BufIndex], + &QosNullLength, + get_my_bssid(&pmlmeinfo->network), + _TRUE, 0, 0, _FALSE); + rtl8812a_fill_fake_txdesc(padapter, &ReservedPagePacket[BufIndex-TxDescLen], QosNullLength, _FALSE, _FALSE, _FALSE); + + //DBG_871X("%s(): HW_VAR_SET_TX_CMD: QOS NULL DATA %p %d\n", + // __FUNCTION__, &ReservedPagePacket[BufIndex-TxDescLen], (QosNullLength+TxDescLen)); + + CurtPktPageNum = (u8)PageNum(TxDescLen + QosNullLength, PageSize); + + TotalPageNum += CurtPktPageNum; + + BufIndex += (CurtPktPageNum*PageSize); + + //3 (6) BT Qos null data + RsvdPageLoc.LocBTQosNull = TotalPageNum; + ConstructNullFunctionData( + padapter, + &ReservedPagePacket[BufIndex], + &BTQosNullLength, + get_my_bssid(&pmlmeinfo->network), + _TRUE, 0, 0, _FALSE); + rtl8812a_fill_fake_txdesc(padapter, &ReservedPagePacket[BufIndex-TxDescLen], BTQosNullLength, _FALSE, _TRUE, _FALSE); + + //DBG_871X("%s(): HW_VAR_SET_TX_CMD: BT QOS NULL DATA %p %d\n", + // __FUNCTION__, &ReservedPagePacket[BufIndex-TxDescLen], (BTQosNullLength+TxDescLen)); + + CurtPktPageNum = (u8)PageNum(TxDescLen + BTQosNullLength, PageSize); + + TotalPageNum += CurtPktPageNum; + + BufIndex += (CurtPktPageNum*PageSize); + +#ifdef CONFIG_WOWLAN_OLD + if (check_fwstate(pmlmepriv, _FW_LINKED)) { + //if (pwrctl->wowlan_mode == _TRUE) { + //BufIndex += (CurtPktPageNum*PageSize); + + //3(7) ARP RSP + rtw_get_current_ip_address(padapter, currentip); + RsvdPageLoc.LocArpRsp= TotalPageNum; +#ifdef DBG_CONFIG_ERROR_DETECT + if(psrtpriv->silent_reset_inprogress == _FALSE) +#endif //DBG_CONFIG_ERROR_DETECT + { + ConstructARPResponse( + padapter, + &ReservedPagePacket[BufIndex], + &ARPLegnth, + currentip + ); + rtl8812a_fill_fake_txdesc(padapter, &ReservedPagePacket[BufIndex-TxDescLen], ARPLegnth, _FALSE, _FALSE, _TRUE); + + //DBG_871X("%s(): HW_VAR_SET_TX_CMD: ARP RSP %p %d\n", + // __FUNCTION__, &ReservedPagePacket[BufIndex-TxDescLen], (ARPLegnth+TxDescLen)); + + CurtPktPageNum = (u8)PageNum(TxDescLen + ARPLegnth, PageSize); + } +#ifdef DBG_CONFIG_ERROR_DETECT + else + CurtPktPageNum = (u8)PageNum(PageSize, PageSize); +#endif //DBG_CONFIG_ERROR_DETECT + TotalPageNum += CurtPktPageNum; + + BufIndex += (CurtPktPageNum*PageSize); + + //3(8) SEC IV + rtw_get_sec_iv(padapter, cur_dot11txpn, get_my_bssid(&pmlmeinfo->network)); + RsvdPageLoc.LocRemoteCtrlInfo = TotalPageNum; + _rtw_memcpy(ReservedPagePacket+BufIndex-TxDescLen, cur_dot11txpn, _AES_IV_LEN_); + + //DBG_871X("%s(): HW_VAR_SET_TX_CMD: SEC IV %p %d\n", + // __FUNCTION__, &ReservedPagePacket[BufIndex-TxDescLen], _AES_IV_LEN_); + + CurtPktPageNum = (u8)PageNum(_AES_IV_LEN_, PageSize); + + TotalPageNum += CurtPktPageNum; + +#ifdef CONFIG_GTK_OL + BufIndex += (CurtPktPageNum*PageSize); + + //if the ap staion info. exists, get the kek, kck from staion info. + psta = rtw_get_stainfo(pstapriv, get_bssid(pmlmepriv)); + if (psta == NULL) + { + _rtw_memset(kek, 0, RTW_KEK_LEN); + _rtw_memset(kck, 0, RTW_KCK_LEN); + DBG_8192C("%s, KEK, KCK download rsvd page all zero \n", __func__); + } + else + { + _rtw_memcpy(kek, psta->kek, RTW_KEK_LEN); + _rtw_memcpy(kck, psta->kck, RTW_KCK_LEN); + } + + //3(9) KEK, KCK + RsvdPageLoc.LocGTKInfo = TotalPageNum; + _rtw_memcpy(ReservedPagePacket+BufIndex-TxDescLen, kck, RTW_KCK_LEN); + _rtw_memcpy(ReservedPagePacket+BufIndex-TxDescLen+RTW_KCK_LEN, kek, RTW_KEK_LEN); + +#if 0 + { + int i; + printk("\ntoFW KCK: "); + for(i=0;i<16; i++) + printk(" %02x ", kck[i]); + printk("\ntoFW KEK: "); + for(i=0;i<16; i++) + printk(" %02x ", kek[i]); + printk("\n"); + } +#endif + + //DBG_871X("%s(): HW_VAR_SET_TX_CMD: KEK KCK %p %d\n", + // __FUNCTION__, &ReservedPagePacket[BufIndex-TxDescLen], (TxDescLen + RTW_KCK_LEN + RTW_KEK_LEN)); + + CurtPktPageNum = (u8)PageNum(TxDescLen + RTW_KCK_LEN + RTW_KEK_LEN, PageSize); + + TotalPageNum += CurtPktPageNum; + + BufIndex += (CurtPktPageNum*PageSize); + + //3(10) GTK Response + RsvdPageLoc.LocGTKRsp= TotalPageNum; + ConstructGTKResponse( + padapter, + &ReservedPagePacket[BufIndex], + >KLegnth + ); + + rtl8812a_fill_fake_txdesc(padapter, &ReservedPagePacket[BufIndex-TxDescLen], GTKLegnth, _FALSE, _FALSE, _TRUE); +#if 0 + { + int gj; + printk("123GTK pkt=> \n"); + for(gj=0; gj < GTKLegnth+TxDescLen; gj++) { + printk(" %02x ", ReservedPagePacket[BufIndex-TxDescLen+gj]); + if ((gj + 1)%16==0) + printk("\n"); + } + printk(" <=end\n"); + } +#endif + + //DBG_871X("%s(): HW_VAR_SET_TX_CMD: GTK RSP %p %d\n", + // __FUNCTION__, &ReservedPagePacket[BufIndex-TxDescLen], (TxDescLen + GTKLegnth)); + + CurtPktPageNum = (u8)PageNum(TxDescLen + GTKLegnth, PageSize); + + TotalPageNum += CurtPktPageNum; + + BufIndex += (CurtPktPageNum*PageSize); + + //below page is empty for GTK extension memory + //3(11) GTK EXT MEM + RsvdPageLoc.LocGTKEXTMEM= TotalPageNum; + + CurtPktPageNum = 1; + + TotalPageNum += CurtPktPageNum; + + TotalPacketLen = BufIndex-TxDescLen + PageSize; //extension memory for FW +#else + TotalPacketLen = BufIndex-TxDescLen + sizeof (union pn48); //IV len +#endif //CONFIG_GTK_OL + } else +#endif //CONFIG_WOWLAN + { +#ifdef CONFIG_PNO_SUPPORT + if (pwrctl->pno_in_resume == _FALSE) { + //Probe Request + RsvdPageLoc.LocProbePacket = TotalPageNum; + ConstructProbeReq( + padapter, + &ReservedPagePacket[BufIndex], + &ProbeReqLength); + + rtl8812a_fill_fake_txdesc(padapter, + &ReservedPagePacket[BufIndex-TxDescLen], + ProbeReqLength, _FALSE, _FALSE, _FALSE); +#ifdef CONFIG_PNO_SET_DEBUG + { + int gj; + printk("probe req pkt=> \n"); + for(gj=0; gj < ProbeReqLength + TxDescLen; gj++) { + printk(" %02x ",ReservedPagePacket[BufIndex- TxDescLen + gj]); + if ((gj + 1)%8==0) + printk("\n"); + } + printk(" <=end\n"); + } +#endif + CurtPktPageNum = + (u8)PageNum(TxDescLen + ProbeReqLength, PageSize); + + TotalPageNum += CurtPktPageNum; + + BufIndex += (CurtPktPageNum*PageSize); + + //PNO INFO Page + RsvdPageLoc.LocPNOInfo = TotalPageNum; + ConstructPnoInfo(padapter, &ReservedPagePacket[BufIndex -TxDescLen], &PNOLength); +#ifdef CONFIG_PNO_SET_DEBUG + { + int gj; + printk("PNO pkt=> \n"); + for(gj=0; gj < PNOLength; gj++) { + printk(" %02x ", ReservedPagePacket[BufIndex-TxDescLen +gj]); + if ((gj + 1)%8==0) + printk("\n"); + } + printk(" <=end\n"); + } +#endif + + CurtPktPageNum = (u8)PageNum(PNOLength, PageSize); + + TotalPageNum += CurtPktPageNum; + BufIndex += (CurtPktPageNum*PageSize); + + //SSID List Page + RsvdPageLoc.LocSSIDInfo = TotalPageNum; + ConstructSSIDList(padapter, &ReservedPagePacket[BufIndex-TxDescLen], &SSIDLegnth); +#ifdef CONFIG_PNO_SET_DEBUG + { + int gj; + printk("SSID list pkt=> \n"); + for(gj=0; gj < SSIDLegnth; gj++) { + printk(" %02x ", ReservedPagePacket[BufIndex-TxDescLen+gj]); + if ((gj + 1)%8==0) + printk("\n"); + } + printk(" <=end\n"); + } +#endif + CurtPktPageNum = (u8)PageNum(SSIDLegnth, PageSize); + + TotalPageNum += CurtPktPageNum; + BufIndex += (CurtPktPageNum*PageSize); + + //Scan Info Page + RsvdPageLoc.LocScanInfo = TotalPageNum; + ConstructScanInfo(padapter, &ReservedPagePacket[BufIndex-TxDescLen], &ScanInfoLength); +#ifdef CONFIG_PNO_SET_DEBUG + { + int gj; + printk("Scan info pkt=> \n"); + for(gj=0; gj < ScanInfoLength; gj++) { + printk(" %02x ", ReservedPagePacket[BufIndex-TxDescLen+gj]); + if ((gj + 1)%8==0) + printk("\n"); + } + printk(" <=end\n"); + } +#endif + CurtPktPageNum = (u8)PageNum(ScanInfoLength, PageSize); + + TotalPageNum += CurtPktPageNum; + BufIndex += (CurtPktPageNum*PageSize); + + TotalPacketLen = BufIndex + ScanInfoLength; + } else { + TotalPacketLen = BufIndex + BTQosNullLength; + } +#else //CONFIG_PNO_SUPPORT + TotalPacketLen = BufIndex + BTQosNullLength; +#endif + } + + if(TotalPacketLen > MaxRsvdPageBufSize) + { + DBG_871X("%s(): ERROR: The rsvd page size is not enough!!TotalPacketLen %d, MaxRsvdPageBufSize %d\n",__FUNCTION__, + TotalPacketLen,MaxRsvdPageBufSize); + goto error; + } + else + { + // update attribute + pattrib = &pcmdframe->attrib; + update_mgntframe_attrib(padapter, pattrib); + pattrib->qsel = QSLT_BEACON; + pattrib->pktlen = pattrib->last_txcmdsz = TotalPacketLen - TxDescOffset; +#ifdef CONFIG_PCI_HCI + dump_mgntframe(padapter, pcmdframe); +#else + dump_mgntframe_and_wait(padapter, pcmdframe, 100); +#endif + } + + DBG_871X("%s: Set RSVD page location to Fw ,TotalPacketLen(%d), TotalPageNum(%d)\n", __FUNCTION__,TotalPacketLen,TotalPageNum); + if(check_fwstate(pmlmepriv, _FW_LINKED)) { + rtl8812_set_FwRsvdPage_cmd(padapter, &RsvdPageLoc); + rtl8812_set_FwAoacRsvdPage_cmd(padapter, &RsvdPageLoc); + } else { +#ifdef CONFIG_PNO_SUPPORT + if(pwrctl->pno_in_resume) + rtl8812_set_FwScanOffloadInfo_cmd(padapter, + &RsvdPageLoc, 0); + else + rtl8812_set_FwScanOffloadInfo_cmd(padapter, + &RsvdPageLoc, 1); +#endif + } + return; + +error: + + rtw_free_xmitframe(pxmitpriv, pcmdframe); +} + +static void rtl8812_set_FwRemoteWakeCtrl_Cmd(PADAPTER padapter, u8 benable) +{ + u8 u1H2CRemoteWakeCtrlParm[H2C_REMOTE_WAKE_CTRL_LEN]={0}; + struct security_priv* psecuritypriv=&(padapter->securitypriv); + struct pwrctrl_priv *ppwrpriv = adapter_to_pwrctl(padapter); + u8 res = 0, count = 0; + + DBG_871X("%s(): Enable=%d\n", __func__, benable); + +#ifdef CONFIG_PNO_SUPPORT + SET_H2CCMD_REMOTE_WAKECTRL_ENABLE(u1H2CRemoteWakeCtrlParm, benable); + SET_H2CCMD_REMOTE_WAKE_CTRL_NLO_OFFLOAD_EN(u1H2CRemoteWakeCtrlParm, benable); +#endif + + if (!ppwrpriv->wowlan_pno_enable) { + SET_H2CCMD_REMOTE_WAKECTRL_ENABLE(u1H2CRemoteWakeCtrlParm, benable); + SET_H2CCMD_REMOTE_WAKE_CTRL_ARP_OFFLOAD_EN(u1H2CRemoteWakeCtrlParm, 1); +#ifdef CONFIG_GTK_OL + if(psecuritypriv->binstallKCK_KEK == _TRUE && psecuritypriv->dot11PrivacyAlgrthm == _AES_) + { + SET_H2CCMD_REMOTE_WAKE_CTRL_GTK_OFFLOAD_EN(u1H2CRemoteWakeCtrlParm, 1); + } + else + { + DBG_871X("no kck or security is not AES\n"); + SET_H2CCMD_REMOTE_WAKE_CTRL_GTK_OFFLOAD_EN(u1H2CRemoteWakeCtrlParm, 0); + } +#endif //CONFIG_GTK_OL + + SET_H2CCMD_REMOTE_WAKE_CTRL_FW_UNICAST_EN(u1H2CRemoteWakeCtrlParm, 1); + + if ((psecuritypriv->dot11PrivacyAlgrthm == _AES_) || (psecuritypriv->dot11PrivacyAlgrthm == _NO_PRIVACY_)) + { + SET_H2CCMD_REMOTE_WAKE_CTRL_ARP_ACTION(u1H2CRemoteWakeCtrlParm, 0); + } + else + { + SET_H2CCMD_REMOTE_WAKE_CTRL_ARP_ACTION(u1H2CRemoteWakeCtrlParm, 1); + } + } +exit: + DBG_871X("H2C 81[0]:%02x , 81[2]:%02x\n", u1H2CRemoteWakeCtrlParm[0], u1H2CRemoteWakeCtrlParm[2]); + RT_PRINT_DATA(_module_hal_init_c_, _drv_always_, "u1H2CRemoteWakeCtrlParm:", u1H2CRemoteWakeCtrlParm, H2C_REMOTE_WAKE_CTRL_LEN); + FillH2CCmd_8812(padapter, H2C_REMOTE_WAKE_CTRL, + H2C_REMOTE_WAKE_CTRL_LEN, u1H2CRemoteWakeCtrlParm); +#ifdef CONFIG_PNO_SUPPORT + if (ppwrpriv->wowlan_pno_enable && ppwrpriv->pno_in_resume == _FALSE) { + res = rtw_read8(padapter, REG_PNO_STATUS); + DBG_871X("cmd: 0x81 REG_PNO_STATUS: 0x%02x\n", res); + while(!(res&BIT(7)) && count < 25) { + DBG_871X("[%d] cmd: 0x81 REG_PNO_STATUS: 0x%02x\n", count, res); + res = rtw_read8(padapter, REG_PNO_STATUS); + count++; + rtw_msleep_os(2); + } + DBG_871X("cmd: 0x81 REG_PNO_STATUS: 0x%02x\n", res); + } +#endif //CONFIG_PNO_SUPPORT +} + + +void rtl8812_set_FwMediaStatusRpt_cmd(PADAPTER padapter, u8 mstatus, u8 macid) +{ + u8 u1H2CMediaStatusRptParm[H2C_MEDIA_STATUS_RPT_LEN]={0}; + u8 macid_end = 0; + + DBG_871X("%s(): mstatus = %d macid=%d\n", __func__, mstatus, macid); + + SET_H2CCMD_MSRRPT_PARM_OPMODE(u1H2CMediaStatusRptParm, mstatus); + SET_H2CCMD_MSRRPT_PARM_MACID_IND(u1H2CMediaStatusRptParm, 0); + SET_H2CCMD_MSRRPT_PARM_MACID(u1H2CMediaStatusRptParm, macid); + SET_H2CCMD_MSRRPT_PARM_MACID_END(u1H2CMediaStatusRptParm, macid_end); + + RT_PRINT_DATA(_module_hal_init_c_, _drv_always_, "u1H2CMediaStatusRptParm:", u1H2CMediaStatusRptParm, H2C_MEDIA_STATUS_RPT_LEN); + FillH2CCmd_8812(padapter, H2C_MEDIA_STATUS_RPT, H2C_MEDIA_STATUS_RPT_LEN, u1H2CMediaStatusRptParm); +} + +static void rtl8812_set_FwDisconDecision_cmd(PADAPTER padapter, u8 benable) +{ + u8 u1H2CDisconDecisionParm[H2C_DISCON_DECISION_LEN]={0}; + u8 adopt = 1, check_period = 10, trypkt_num = 0; + + DBG_871X("%s(): benable = %d\n", __func__, benable); + SET_H2CCMD_DISCONDECISION_PARM_ENABLE(u1H2CDisconDecisionParm, benable); + SET_H2CCMD_DISCONDECISION_PARM_ADOPT(u1H2CDisconDecisionParm, adopt); + SET_H2CCMD_DISCONDECISION_PARM_CHECK_PERIOD(u1H2CDisconDecisionParm, check_period); + SET_H2CCMD_DISCONDECISION_PARM_TRY_PKT_NUM(u1H2CDisconDecisionParm, trypkt_num); + + RT_PRINT_DATA(_module_hal_init_c_, _drv_always_, "u1H2CDisconDecisionParm:", u1H2CDisconDecisionParm, H2C_DISCON_DECISION_LEN); + + FillH2CCmd_8812(padapter, H2C_DISCON_DECISION, H2C_DISCON_DECISION_LEN, u1H2CDisconDecisionParm); +} + +static void rtl8812_set_FwKeepAlive_cmd(PADAPTER padapter, u8 benable, u8 pkt_type) +{ + u8 u1H2CKeepAliveParm[H2C_KEEP_ALIVE_CTRL_LEN]={0}; + u8 adopt = 1, check_period = 5; + + DBG_871X("%s(): benable = %d\n", __func__, benable); + SET_H2CCMD_KEEPALIVE_PARM_ENABLE(u1H2CKeepAliveParm, benable); + SET_H2CCMD_KEEPALIVE_PARM_ADOPT(u1H2CKeepAliveParm, adopt); + SET_H2CCMD_KEEPALIVE_PARM_PKT_TYPE(u1H2CKeepAliveParm, pkt_type); + SET_H2CCMD_KEEPALIVE_PARM_CHECK_PERIOD(u1H2CKeepAliveParm, check_period); + + RT_PRINT_DATA(_module_hal_init_c_, _drv_always_, "u1H2CKeepAliveParm:", u1H2CKeepAliveParm, H2C_KEEP_ALIVE_CTRL_LEN); + + FillH2CCmd_8812(padapter, H2C_KEEP_ALIVE, H2C_KEEP_ALIVE_CTRL_LEN, u1H2CKeepAliveParm); +} + +static void rtl8812_set_FwWoWlanCtrl_Cmd(PADAPTER padapter, u8 bFuncEn) +{ + struct security_priv *psecpriv = &padapter->securitypriv; + struct pwrctrl_priv *ppwrpriv = adapter_to_pwrctl(padapter); + u8 u1H2CWoWlanCtrlParm[H2C_WOWLAN_LEN]={0}; + u8 discont_wake = 1, gpionum = 0, gpio_dur = 0, hw_unicast = 0, gpio_pulse_cnt=100; + u8 sdio_wakeup_enable = 0; + u8 gpio_high_active = 0; //0: low active, 1: high active + u8 magic_pkt = 1; + +#ifdef CONFIG_GPIO_WAKEUP + gpionum = WAKEUP_GPIO_IDX; + sdio_wakeup_enable = 0; +#endif + +#ifdef CONFIG_PNO_SUPPORT + if (!ppwrpriv->wowlan_pno_enable) { + magic_pkt = 1; + } +#endif + + if (psecpriv->dot11PrivacyAlgrthm == _WEP40_ || psecpriv->dot11PrivacyAlgrthm == _WEP104_) + hw_unicast = 1; + + DBG_871X("%s(): bFuncEn=%d\n", __func__, bFuncEn); + + SET_H2CCMD_WOWLAN_FUNC_ENABLE(u1H2CWoWlanCtrlParm, bFuncEn); + SET_H2CCMD_WOWLAN_PATTERN_MATCH_ENABLE(u1H2CWoWlanCtrlParm, 0); + SET_H2CCMD_WOWLAN_MAGIC_PKT_ENABLE(u1H2CWoWlanCtrlParm, magic_pkt); + SET_H2CCMD_WOWLAN_UNICAST_PKT_ENABLE(u1H2CWoWlanCtrlParm, hw_unicast); + SET_H2CCMD_WOWLAN_ALL_PKT_DROP(u1H2CWoWlanCtrlParm, 0); + SET_H2CCMD_WOWLAN_GPIO_ACTIVE(u1H2CWoWlanCtrlParm, gpio_high_active); +#ifndef CONFIG_GTK_OL + SET_H2CCMD_WOWLAN_REKEY_WAKE_UP(u1H2CWoWlanCtrlParm, 1); +#endif //!CONFIG_GTK_OL + SET_H2CCMD_WOWLAN_DISCONNECT_WAKE_UP(u1H2CWoWlanCtrlParm, discont_wake); + SET_H2CCMD_WOWLAN_GPIONUM(u1H2CWoWlanCtrlParm, gpionum); + SET_H2CCMD_WOWLAN_DATAPIN_WAKE_UP(u1H2CWoWlanCtrlParm, sdio_wakeup_enable); + SET_H2CCMD_WOWLAN_GPIO_DURATION(u1H2CWoWlanCtrlParm, gpio_dur); + SET_H2CCMD_WOWLAN_GPIO_PULSE_EN(u1H2CWoWlanCtrlParm, 1); + SET_H2CCMD_WOWLAN_GPIO_PULSE_COUNT(u1H2CWoWlanCtrlParm, 0x09); +#ifdef CONFIG_LOWPR + SET_H2CCMD_WOWLAN_LOWPR_RX(u1H2CWoWlanCtrlParm, bFuncEn); +#endif //CONFIG_LOWPR + + RT_PRINT_DATA(_module_hal_init_c_, _drv_always_, "u1H2CWoWlanCtrlParm:", u1H2CWoWlanCtrlParm, H2C_WOWLAN_LEN); + DBG_871X("u1H2CWoWlanCtrlParm:%08x", (u32) u1H2CWoWlanCtrlParm[0]); + + FillH2CCmd_8812(padapter, H2C_WOWLAN, H2C_WOWLAN_LEN, u1H2CWoWlanCtrlParm); +} + +static void rtl8812_set_FwAOACGlobalInfo_Cmd(PADAPTER padapter, u8 group_alg, u8 pairwise_alg) +{ + u8 u1H2CAOACGlobalInfoParm[H2C_AOAC_GLOBAL_INFO_LEN]={0}; + + DBG_871X("%s(): group_alg=%d pairwise_alg=%d\n", __func__, group_alg, pairwise_alg); + + SET_H2CCMD_AOAC_GLOBAL_INFO_PAIRWISE_ENC_ALG(u1H2CAOACGlobalInfoParm, pairwise_alg); + SET_H2CCMD_AOAC_GLOBAL_INFO_GROUP_ENC_ALG(u1H2CAOACGlobalInfoParm, group_alg); + + RT_PRINT_DATA(_module_hal_init_c_, _drv_always_, "u1H2CAOACGlobalInfoParm:", u1H2CAOACGlobalInfoParm, H2C_AOAC_GLOBAL_INFO_LEN); + + FillH2CCmd_8812(padapter, H2C_AOAC_GLOBAL_INFO, H2C_AOAC_GLOBAL_INFO_LEN, u1H2CAOACGlobalInfoParm); +} + +void rtl8812_download_rsvd_page(PADAPTER padapter, u8 mstatus) +{ + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); + struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); + BOOLEAN bcn_valid = _FALSE; + u8 DLBcnCount=0; + u32 poll = 0; + u8 val8; + +_func_enter_; + + DBG_8192C("+" FUNC_ADPT_FMT ": iface_type=%d mstatus(%x)\n", + FUNC_ADPT_ARG(padapter), get_iface_type(padapter), mstatus); + + if(mstatus == RT_MEDIA_CONNECT) + { + BOOLEAN bRecover = _FALSE; + u8 v8; + + // We should set AID, correct TSF, HW seq enable before set JoinBssReport to Fw in 88/92C. + // Suggested by filen. Added by tynli. + rtw_write16(padapter, REG_BCN_PSR_RPT, (0xC000|pmlmeinfo->aid)); + + // set REG_CR bit 8 + v8 = rtw_read8(padapter, REG_CR+1); + v8 |= BIT(0); // ENSWBCN + rtw_write8(padapter, REG_CR+1, v8); + + // Disable Hw protection for a time which revserd for Hw sending beacon. + // Fix download reserved page packet fail that access collision with the protection time. + // 2010.05.11. Added by tynli. + val8 = rtw_read8(padapter, REG_BCN_CTRL); + val8 &= ~BIT(3); + val8 |= BIT(4); + rtw_write8(padapter, REG_BCN_CTRL, val8); + + // Set FWHW_TXQ_CTRL 0x422[6]=0 to tell Hw the packet is not a real beacon frame. + if (pHalData->RegFwHwTxQCtrl & BIT(6)) + bRecover = _TRUE; + + // To tell Hw the packet is not a real beacon frame. + rtw_write8(padapter, REG_FWHW_TXQ_CTRL+2, pHalData->RegFwHwTxQCtrl & ~BIT(6)); + pHalData->RegFwHwTxQCtrl &= ~BIT(6); + + // Clear beacon valid check bit. + rtw_hal_set_hwreg(padapter, HW_VAR_BCN_VALID, NULL); + rtw_hal_set_hwreg(padapter, HW_VAR_DL_BCN_SEL, NULL); + + DLBcnCount = 0; + poll = 0; + do + { +#ifdef CONFIG_AP_WOWLAN + if (pwrpriv->wowlan_ap_mode) + rtl8192e_set_AP_FwRsvdPagePkt(padapter, 0); + else + rtl8812_set_FwRsvdPagePkt(padapter, 0); +#else + // download rsvd page. + rtl8812_set_FwRsvdPagePkt(padapter, 0); +#endif + DLBcnCount++; + do + { + rtw_yield_os(); + //rtw_mdelay_os(10); + // check rsvd page download OK. + rtw_hal_get_hwreg(padapter, HW_VAR_BCN_VALID, (u8*)(&bcn_valid)); + poll++; + } while(!bcn_valid && (poll%10)!=0 && !padapter->bSurpriseRemoved && !padapter->bDriverStopped); + + }while(!bcn_valid && DLBcnCount<=100 && !padapter->bSurpriseRemoved && !padapter->bDriverStopped); + + if(padapter->bSurpriseRemoved || padapter->bDriverStopped) + { + } + else if(!bcn_valid) + DBG_871X(ADPT_FMT": 1 DL RSVD page failed! DLBcnCount:%u, poll:%u\n", + ADPT_ARG(padapter) ,DLBcnCount, poll); + else { + struct pwrctrl_priv *pwrctl = adapter_to_pwrctl(padapter); + pwrctl->fw_psmode_iface_id = padapter->iface_id; + DBG_871X(ADPT_FMT": 1 DL RSVD page success! DLBcnCount:%u, poll:%u\n", + ADPT_ARG(padapter), DLBcnCount, poll); + } + + // 2010.05.11. Added by tynli. + val8 = rtw_read8(padapter, REG_BCN_CTRL); + val8 |= BIT(3); + val8 &= ~BIT(4); + rtw_write8(padapter, REG_BCN_CTRL, val8); + + // To make sure that if there exists an adapter which would like to send beacon. + // If exists, the origianl value of 0x422[6] will be 1, we should check this to + // prevent from setting 0x422[6] to 0 after download reserved page, or it will cause + // the beacon cannot be sent by HW. + // 2010.06.23. Added by tynli. + if(bRecover) + { + rtw_write8(padapter, REG_FWHW_TXQ_CTRL+2, pHalData->RegFwHwTxQCtrl | BIT(6)); + pHalData->RegFwHwTxQCtrl |= BIT(6); + } + + // Clear CR[8] or beacon packet will not be send to TxBuf anymore. + v8 = rtw_read8(padapter, REG_CR+1); + v8 &= ~BIT(0); // ~ENSWBCN + rtw_write8(padapter, REG_CR+1, v8); + } + +_func_exit_; +} + +static void rtl8812_set_FwWoWlanRelated_cmd(_adapter* padapter, u8 enable) +{ + struct security_priv *psecpriv = &padapter->securitypriv; + struct pwrctrl_priv *ppwrpriv = adapter_to_pwrctl(padapter); + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + struct sta_info *psta = NULL; + u8 pkt_type = 0; + + DBG_871X_LEVEL(_drv_always_, "+%s()+: enable=%d\n", __func__, enable); +_func_enter_; + if(enable) + { + rtl8812_set_FwAOACGlobalInfo_Cmd(padapter, psecpriv->dot118021XGrpPrivacy, psecpriv->dot11PrivacyAlgrthm); + //rtw_hal_set_global_info_cmd(padapter, psecpriv->dot118021XGrpPrivacy, psecpriv->dot11PrivacyAlgrthm); + rtl8812_download_rsvd_page(padapter, RT_MEDIA_CONNECT); //RT_MEDIA_CONNECT will confuse in the future + //rtw_hal_download_rsvd_page(padapter, RT_MEDIA_CONNECT); + + if(!(ppwrpriv->wowlan_pno_enable)) + { + psta = rtw_get_stainfo(&padapter->stapriv, get_bssid(pmlmepriv)); + if (psta != NULL) + rtl8812_set_FwMediaStatusRpt_cmd(padapter, RT_MEDIA_CONNECT, psta->mac_id); + } + else + DBG_871X("%s(): Disconnected, no FwMediaStatusRpt CONNECT\n",__FUNCTION__); + + rtw_msleep_os(2); + + if(!(ppwrpriv->wowlan_pno_enable)) { + rtl8812_set_FwDisconDecision_cmd(padapter, enable); + //rtw_hal_set_disconnect_decision_cmd(padapter, enable); + rtw_msleep_os(2); + + if ((psecpriv->dot11PrivacyAlgrthm != _WEP40_) || (psecpriv->dot11PrivacyAlgrthm != _WEP104_)) + pkt_type = 1; + rtl8812_set_FwKeepAlive_cmd(padapter, enable, pkt_type); + //rtw_hal_set_keep_alive_cmd(padapter, enable, pkt_type); + rtw_msleep_os(2); + } + + rtl8812_set_FwRemoteWakeCtrl_Cmd(padapter, enable); + //rtw_hal_set_wowlan_ctrl_cmd(padapter, enable); + rtw_msleep_os(2); + + rtl8812_set_FwWoWlanCtrl_Cmd(padapter, enable); + //rtw_hal_set_remote_wake_ctrl_cmd(padapter, enable); + } + else + { +#if 0 + { + u32 PageSize = 0; + rtw_hal_get_def_var(adapter, HAL_DEF_TX_PAGE_SIZE, (u8 *)&PageSize); + dump_TX_FIFO(padapter, 4, PageSize); + } +#endif + rtl8812_set_FwRemoteWakeCtrl_Cmd(padapter, enable); + //rtw_hal_set_remote_wake_ctrl_cmd(padapter, enable); + rtw_msleep_os(2); + rtl8812_set_FwWoWlanCtrl_Cmd(padapter, enable); + //rtw_hal_set_wowlan_ctrl_cmd(padapter, enable); + } + +_func_exit_; + DBG_871X_LEVEL(_drv_always_, "-%s()-\n", __func__); + return ; +} + +void rtl8812_set_wowlan_cmd(_adapter* padapter, u8 enable) +{ + rtl8812_set_FwWoWlanRelated_cmd(padapter, enable); +} +#endif //CONFIG_WOWLAN + +int rtl8812_iqk_wait(_adapter* padapter, u32 timeout_ms) +{ + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); + struct submit_ctx *iqk_sctx = &pHalData->iqk_sctx; + + iqk_sctx->submit_time = rtw_get_current_time(); + iqk_sctx->timeout_ms = timeout_ms; + iqk_sctx->status = RTW_SCTX_SUBMITTED; + + return rtw_sctx_wait(iqk_sctx, __func__); +} + +void rtl8812_iqk_done(_adapter* padapter) +{ + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); + struct submit_ctx *iqk_sctx = &pHalData->iqk_sctx; + + rtw_sctx_done(&iqk_sctx); +} + +static VOID +C2HTxBeamformingHandler_8812( + IN PADAPTER Adapter, + IN u8* CmdBuf, + IN u8 CmdLen +) +{ + u8 status = CmdBuf[0] & BIT0; +#ifdef CONFIG_BEAMFORMING + beamforming_check_sounding_success(Adapter, status); +#if (0)//DEV_BUS_TYPE == RT_PCI_INTERFACE) + beamforming_end_fw(Adapter, status); +#endif +#endif +} + +static VOID +C2HTxFeedbackHandler_8812( + IN PADAPTER Adapter, + IN u8 *CmdBuf, + IN u8 CmdLen +) +{ +#ifdef CONFIG_XMIT_ACK + if (GET_8812_C2H_TX_RPT_RETRY_OVER(CmdBuf) | GET_8812_C2H_TX_RPT_LIFE_TIME_OVER(CmdBuf)) { + rtw_ack_tx_done(&Adapter->xmitpriv, RTW_SCTX_DONE_CCX_PKT_FAIL); + } else { + rtw_ack_tx_done(&Adapter->xmitpriv, RTW_SCTX_DONE_SUCCESS); + } +#endif +} + +static VOID +C2HRaReportHandler_8812( + IN PADAPTER Adapter, + IN u8* CmdBuf, + IN u8 CmdLen +) +{ + u8 Rate = CmdBuf[0] & 0x3F; + u8 MacId = CmdBuf[1]; + BOOLEAN bLDPC = CmdBuf[2] & BIT0; + BOOLEAN bTxBF = (CmdBuf[2] & BIT1) >> 1; + BOOLEAN bNoisyStateFromC2H = (CmdBuf[2] & BIT2) >> 2; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + + //pHalData->CurrentRARate = MRateToHwRate(Rate); + + ODM_UpdateInitRate(&pHalData->odmpriv, Rate); + //ODM_UpdateNoisyState(&pHalData->odmpriv, bNoisyStateFromC2H); +} + +s32 +_C2HContentParsing8812( + IN PADAPTER Adapter, + IN u8 c2hCmdId, + IN u8 c2hCmdLen, + IN u8 *tmpBuf +) +{ + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + PDM_ODM_T pDM_Odm = &pHalData->odmpriv; + s32 ret = _SUCCESS; + + switch(c2hCmdId) + { + case C2H_8812_DBG: + DBG_871X("[C2H], C2H_8812_DBG!!\n"); + break; + + case C2H_8812_TXBF: + DBG_871X("[C2H], C2H_8812_TXBF!!\n"); + C2HTxBeamformingHandler_8812(Adapter, tmpBuf, c2hCmdLen); + break; + + case C2H_8812_TX_REPORT: + //DBG_871X("[C2H], C2H_8812_TX_REPORT!!\n"); + C2HTxFeedbackHandler_8812(Adapter, tmpBuf, c2hCmdLen); + break; + +#ifdef CONFIG_BT_COEXIST + case C2H_8812_BT_INFO: + //DBG_871X("[C2H], C2H_8812_BT_INFO!!\n"); + rtw_btcoex_BtInfoNotify(Adapter, c2hCmdLen, tmpBuf); + break; +#endif + + case C2H_8812_BT_MP: + DBG_871X("[C2H], C2H_8812_BT_MP!!\n"); +#ifdef CONFIG_MP_INCLUDED +// MPTBT_FwC2hBtMpCtrl(Adapter, tmpBuf, c2hCmdLen); +#else + //NDBG_FwC2hBtControl(Adapter, tmpBuf, c2hCmdLen); +#endif + break; + + case C2H_8812_RA_RPT: + C2HRaReportHandler_8812(Adapter, tmpBuf, c2hCmdLen); + break; + + case C2H_8812_FW_SWCHNL: + //DBG_871X("channel to %d\n", *tmpBuf); + break; + + case C2H_8812_IQK_FINISH: + DBG_871X("== IQK Finish ==\n"); + rtl8812_iqk_done(Adapter); + //rtw_odm_acquirespinlock(Adapter, RT_IQK_SPINLOCK); + //pDM_Odm->RFCalibrateInfo.bIQKInProgress = FALSE; + //rtw_odm_releasespinlock(Adapter, RT_IQK_SPINLOCK); + break; + + case C2H_8812_MAILBOX_STATUS: + DBG_871X("[C2H], mailbox status:%u\n", *tmpBuf); + break; + +#ifdef CONFIG_FW_C2H_DEBUG + case C2H_8812_FW_DEBUG: + DBG_871X("[C2H], FW_DEBUG.\n"); + Debug_FwC2H(Adapter, tmpBuf, c2hCmdLen); + break; +#endif // CONFIG_FW_C2H_DEBUG + default: + DBG_871X("%s: [WARNING] unknown C2H(0x%02x)\n", __FUNCTION__, c2hCmdId); + ret = _FAIL; + break; + } + + return ret; +} + + +VOID +C2HPacketHandler_8812( + IN PADAPTER Adapter, + IN u8 *Buffer, + IN u8 Length + ) +{ + struct c2h_evt_hdr_88xx *c2h_evt = (struct c2h_evt_hdr_88xx *)Buffer; u8 c2hCmdId=0, c2hCmdSeq=0, c2hCmdLen=0; u8 *tmpBuf=NULL; @@ -1521,4 +2856,309 @@ C2HPacketHandler_8812( } } +#ifdef CONFIG_BT_COEXIST + +void ConstructBtNullFunctionData( + PADAPTER padapter, + u8 *pframe, + u32 *pLength, + u8 *StaAddr, + u8 bQoS, + u8 AC, + u8 bEosp, + u8 bForcePowerSave) +{ + struct rtw_ieee80211_hdr *pwlanhdr; + u16 *fctrl; + u32 pktlen; + struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + u8 bssid[ETH_ALEN]; + + //DBG_871X("%s:%d\n", __FUNCTION__, bForcePowerSave); + + pwlanhdr = (struct rtw_ieee80211_hdr*)pframe; + + if (NULL == StaAddr) + { + _rtw_memcpy(bssid, myid(&padapter->eeprompriv), ETH_ALEN); + StaAddr = bssid; + } + + fctrl = &pwlanhdr->frame_ctl; + *(fctrl) = 0; + if (bForcePowerSave) + { + SetPwrMgt(fctrl); + } + + SetFrDs(fctrl); + _rtw_memcpy(pwlanhdr->addr1, StaAddr, ETH_ALEN); + _rtw_memcpy(pwlanhdr->addr2, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); + _rtw_memcpy(pwlanhdr->addr3, myid(&(padapter->eeprompriv)), ETH_ALEN); + + SetDuration(pwlanhdr, 0); + SetSeqNum(pwlanhdr, 0); + + if (bQoS == _TRUE) { + struct rtw_ieee80211_hdr_3addr_qos *pwlanqoshdr; + + SetFrameSubType(pframe, WIFI_QOS_DATA_NULL); + + pwlanqoshdr = (struct rtw_ieee80211_hdr_3addr_qos*)pframe; + SetPriority(&pwlanqoshdr->qc, AC); + SetEOSP(&pwlanqoshdr->qc, bEosp); + + pktlen = sizeof(struct rtw_ieee80211_hdr_3addr_qos); + } else { + SetFrameSubType(pframe, WIFI_DATA_NULL); + + pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + } + + *pLength = pktlen; +} + + +static void SetFwRsvdPagePkt_BTCoex(PADAPTER padapter) +{ + PHAL_DATA_TYPE pHalData; + struct xmit_frame *pcmdframe; + struct pkt_attrib *pattrib; + struct xmit_priv *pxmitpriv; + struct mlme_ext_priv *pmlmeext; + struct mlme_ext_info *pmlmeinfo; + struct pwrctrl_priv *pwrctl; + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + u32 BeaconLength=0; + u32 NullDataLength=0, QosNullLength=0, BTQosNullLength=0; + u32 ProbeReqLength=0; + u8 *ReservedPagePacket; + u8 TxDescLen = TXDESC_SIZE, TxDescOffset = TXDESC_OFFSET; + u8 TotalPageNum=0, CurtPktPageNum=0, RsvdPageNum=0; + u16 BufIndex, PageSize = 256; + u32 TotalPacketLen, MaxRsvdPageBufSize=0; + RSVDPAGE_LOC RsvdPageLoc; + + + if(IS_HARDWARE_TYPE_8812(padapter)) + PageSize = 512; + else if (IS_HARDWARE_TYPE_8821(padapter)) + PageSize = PAGE_SIZE_TX_8821A; + //DBG_871X("%s---->\n", __FUNCTION__); + + pHalData = GET_HAL_DATA(padapter); + + pxmitpriv = &padapter->xmitpriv; + pmlmeext = &padapter->mlmeextpriv; + pmlmeinfo = &pmlmeext->mlmext_info; + pwrctl = adapter_to_pwrctl(padapter); + + //RsvdPageNum = BCNQ_PAGE_NUM_8723B + WOWLAN_PAGE_NUM_8723B; + + if(IS_HARDWARE_TYPE_8812(padapter)) + RsvdPageNum = BCNQ_PAGE_NUM_8812; + else if (IS_HARDWARE_TYPE_8821(padapter)) + RsvdPageNum = BCNQ_PAGE_NUM_8821; + MaxRsvdPageBufSize = RsvdPageNum*PageSize; + + pcmdframe = rtw_alloc_cmdxmitframe(pxmitpriv); + if (pcmdframe == NULL) { + DBG_871X("%s: alloc ReservedPagePacket fail!\n", __FUNCTION__); + return; + } + + ReservedPagePacket = pcmdframe->buf_addr; + _rtw_memset(&RsvdPageLoc, 0, sizeof(RSVDPAGE_LOC)); + + //3 (1) beacon + BufIndex = TxDescOffset; + ConstructBeacon(padapter, &ReservedPagePacket[BufIndex], &BeaconLength); + + // When we count the first page size, we need to reserve description size for the RSVD + // packet, it will be filled in front of the packet in TXPKTBUF. + CurtPktPageNum = (u8)PageNum(TxDescLen + BeaconLength, PageSize); + + //If we don't add 1 more page, the WOWLAN function has a problem. Baron thinks it's a bug of firmware + if (CurtPktPageNum == 1) + { + CurtPktPageNum += 1; + } + TotalPageNum += CurtPktPageNum; + + BufIndex += (CurtPktPageNum*PageSize); + + // Jump to lastest page + if (BufIndex < (MaxRsvdPageBufSize - PageSize)) + { + BufIndex = TxDescOffset + (MaxRsvdPageBufSize - PageSize); + if(IS_HARDWARE_TYPE_8812(padapter)) + TotalPageNum = BCNQ_PAGE_NUM_8812-1; + else if (IS_HARDWARE_TYPE_8821(padapter)) + TotalPageNum = BCNQ_PAGE_NUM_8821-1; + + } + + //3 (6) BT Qos null data + RsvdPageLoc.LocBTQosNull = TotalPageNum; + ConstructBtNullFunctionData( + padapter, + &ReservedPagePacket[BufIndex], + &BTQosNullLength, + NULL, + _TRUE, 0, 0, _FALSE); + rtl8812a_fill_fake_txdesc(padapter, &ReservedPagePacket[BufIndex-TxDescLen], BTQosNullLength, _FALSE, _TRUE, _FALSE); + + //DBG_871X("%s(): HW_VAR_SET_TX_CMD: BT QOS NULL DATA %p %d\n", + // __FUNCTION__, &ReservedPagePacket[BufIndex-TxDescLen], (BTQosNullLength+TxDescLen)); + + CurtPktPageNum = (u8)PageNum(TxDescLen + BTQosNullLength,PageSize); + + TotalPageNum += CurtPktPageNum; + + TotalPacketLen = BufIndex + BTQosNullLength; + if(TotalPacketLen > MaxRsvdPageBufSize) + { + DBG_871X("%s(): ERROR: The rsvd page size is not enough!!TotalPacketLen %d, MaxRsvdPageBufSize %d\n",__FUNCTION__, + TotalPacketLen,MaxRsvdPageBufSize); + goto error; + } + else + { + // update attribute + pattrib = &pcmdframe->attrib; + update_mgntframe_attrib(padapter, pattrib); + pattrib->qsel = QSLT_BEACON; + pattrib->pktlen = pattrib->last_txcmdsz = TotalPacketLen - TxDescOffset; +#ifdef CONFIG_PCI_HCI + dump_mgntframe(padapter, pcmdframe); +#else + dump_mgntframe_and_wait(padapter, pcmdframe, 100); +#endif + } + + DBG_871X("%s: Set RSVD page location to Fw ,TotalPacketLen(%d), TotalPageNum(%d)\n", __FUNCTION__,TotalPacketLen,TotalPageNum); + if(check_fwstate(pmlmepriv, _FW_LINKED)) { + rtl8812_set_FwRsvdPage_cmd(padapter, &RsvdPageLoc); + #ifdef CONFIG_WOWLAN + rtl8812_set_FwAoacRsvdPage_cmd(padapter, &RsvdPageLoc); + #endif + } + + return; + +error: + + rtw_free_xmitframe(pxmitpriv, pcmdframe); +} + + +void rtl8812a_download_BTCoex_AP_mode_rsvd_page(PADAPTER padapter) +{ + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); + struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); + BOOLEAN bRecover = _FALSE; + BOOLEAN bcn_valid = _FALSE; + u8 DLBcnCount=0; + u32 poll = 0; + u8 val8; + u8 v8; + +_func_enter_; + + DBG_8192C("+" FUNC_ADPT_FMT ": iface_type=%d", + FUNC_ADPT_ARG(padapter), get_iface_type(padapter)); + + + + + + // We should set AID, correct TSF, HW seq enable before set JoinBssReport to Fw in 88/92C. + // Suggested by filen. Added by tynli. + rtw_write16(padapter, REG_BCN_PSR_RPT, (0xC000|pmlmeinfo->aid)); + + // set REG_CR bit 8 + v8 = rtw_read8(padapter, REG_CR+1); + v8 |= BIT(0); // ENSWBCN + rtw_write8(padapter, REG_CR+1, v8); + + // Disable Hw protection for a time which revserd for Hw sending beacon. + // Fix download reserved page packet fail that access collision with the protection time. + // 2010.05.11. Added by tynli. + val8 = rtw_read8(padapter, REG_BCN_CTRL); + val8 &= ~BIT(3); + val8 |= BIT(4); + rtw_write8(padapter, REG_BCN_CTRL, val8); + + // Set FWHW_TXQ_CTRL 0x422[6]=0 to tell Hw the packet is not a real beacon frame. + if (pHalData->RegFwHwTxQCtrl & BIT(6)) + bRecover = _TRUE; + + // To tell Hw the packet is not a real beacon frame. + rtw_write8(padapter, REG_FWHW_TXQ_CTRL+2, pHalData->RegFwHwTxQCtrl & ~BIT(6)); + pHalData->RegFwHwTxQCtrl &= ~BIT(6); + + // Clear beacon valid check bit. + rtw_hal_set_hwreg(padapter, HW_VAR_BCN_VALID, NULL); + rtw_hal_set_hwreg(padapter, HW_VAR_DL_BCN_SEL, NULL); + + DLBcnCount = 0; + poll = 0; + do + { + SetFwRsvdPagePkt_BTCoex(padapter); + DLBcnCount++; + do + { + rtw_yield_os(); + //rtw_mdelay_os(10); + // check rsvd page download OK. + rtw_hal_get_hwreg(padapter, HW_VAR_BCN_VALID, (u8*)(&bcn_valid)); + poll++; + } while(!bcn_valid && (poll%10)!=0 && !padapter->bSurpriseRemoved && !padapter->bDriverStopped); + + }while(!bcn_valid && DLBcnCount<=100 && !padapter->bSurpriseRemoved && !padapter->bDriverStopped); + + if(padapter->bSurpriseRemoved || padapter->bDriverStopped) + { + } + else if(!bcn_valid) + DBG_871X(ADPT_FMT": 1 DL RSVD page failed! DLBcnCount:%u, poll:%u\n", + ADPT_ARG(padapter) ,DLBcnCount, poll); + else { + struct pwrctrl_priv *pwrctl = adapter_to_pwrctl(padapter); + pwrctl->fw_psmode_iface_id = padapter->iface_id; + DBG_871X(ADPT_FMT": 1 DL RSVD page success! DLBcnCount:%u, poll:%u\n", + ADPT_ARG(padapter), DLBcnCount, poll); + } + + // 2010.05.11. Added by tynli. + val8 = rtw_read8(padapter, REG_BCN_CTRL); + val8 |= BIT(3); + val8 &= ~BIT(4); + rtw_write8(padapter, REG_BCN_CTRL, val8); + + // To make sure that if there exists an adapter which would like to send beacon. + // If exists, the origianl value of 0x422[6] will be 1, we should check this to + // prevent from setting 0x422[6] to 0 after download reserved page, or it will cause + // the beacon cannot be sent by HW. + // 2010.06.23. Added by tynli. + if(bRecover) + { + rtw_write8(padapter, REG_FWHW_TXQ_CTRL+2, pHalData->RegFwHwTxQCtrl | BIT(6)); + pHalData->RegFwHwTxQCtrl |= BIT(6); + } + + // Clear CR[8] or beacon packet will not be send to TxBuf anymore. + v8 = rtw_read8(padapter, REG_CR+1); + v8 &= ~BIT(0); // ~ENSWBCN + rtw_write8(padapter, REG_CR+1, v8); + + +_func_exit_; +} + +#endif // CONFIG_BT_COEXIST diff --git a/backports/drivers/realtek/rtl8812au/hal/rtl8812a/rtl8812a_dm.c b/backports/drivers/realtek/rtl8812au/hal/rtl8812a/rtl8812a_dm.c index 40fbf0607380ef..f4c90eb05931c9 100755 --- a/backports/drivers/realtek/rtl8812au/hal/rtl8812a/rtl8812a_dm.c +++ b/backports/drivers/realtek/rtl8812au/hal/rtl8812a/rtl8812a_dm.c @@ -84,7 +84,7 @@ dm_CheckStatistics( rtw_hal_get_hwreg( Adapter, HW_VAR_RETRY_COUNT, (pu1Byte)(&Adapter->TxStats.NumTxRetryCount) ); #endif } - +#ifdef CONFIG_SUPPORT_HW_WPS_PBC static void dm_CheckPbcGPIO(_adapter *padapter) { u8 tmp1byte; @@ -153,6 +153,7 @@ static void dm_CheckPbcGPIO(_adapter *padapter) rtw_request_wps_pbc_event(padapter); } } +#endif //#ifdef CONFIG_SUPPORT_HW_WPS_PBC #ifdef CONFIG_PCI_HCI // @@ -257,90 +258,24 @@ dm_InitGPIOSetting( rtw_write8(Adapter, REG_GPIO_MUXCFG, tmp1byte); } -// A mapping from HalData to ODM. -ODM_BOARD_TYPE_E boardType(u8 InterfaceSel) -{ - ODM_BOARD_TYPE_E board = ODM_BOARD_DEFAULT; - -#ifdef CONFIG_PCI_HCI - INTERFACE_SELECT_PCIE pcie = (INTERFACE_SELECT_PCIE)InterfaceSel; - switch (pcie) - { - case INTF_SEL0_SOLO_MINICARD: - board |= ODM_BOARD_MINICARD; - break; - case INTF_SEL1_BT_COMBO_MINICARD: - board |= ODM_BOARD_BT; - board |= ODM_BOARD_MINICARD; - break; - default: - board = ODM_BOARD_DEFAULT; - break; - } - -#elif defined(CONFIG_USB_HCI) - INTERFACE_SELECT_USB usb = (INTERFACE_SELECT_USB)InterfaceSel; - switch (usb) - { - case INTF_SEL1_USB_High_Power: - board |= ODM_BOARD_EXT_LNA; - board |= ODM_BOARD_EXT_PA; - break; - case INTF_SEL2_MINICARD: - board |= ODM_BOARD_MINICARD; - break; - case INTF_SEL4_USB_Combo: - board |= ODM_BOARD_BT; - break; - case INTF_SEL5_USB_Combo_MF: - board |= ODM_BOARD_BT; - break; - case INTF_SEL0_USB: - case INTF_SEL3_USB_Solo: - default: - board = ODM_BOARD_DEFAULT; - break; - } - -#endif - //DBG_871X("===> boardType(): (pHalData->InterfaceSel, pDM_Odm->BoardType) = (%d, %d)\n", InterfaceSel, board); - - return board; -} - //============================================================ // functions //============================================================ static void Init_ODM_ComInfo_8812(PADAPTER Adapter) { PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter); - EEPROM_EFUSE_PRIV *pEEPROM = GET_EEPROM_EFUSE_PRIV(Adapter); struct dm_priv *pdmpriv = &pHalData->dmpriv; PDM_ODM_T pDM_Odm = &(pHalData->odmpriv); - u8 cut_ver,fab_ver; - u8 BoardType = ODM_BOARD_DEFAULT; - - // - // Init Value - // - _rtw_memset(pDM_Odm,0,sizeof(pDM_Odm)); - - pDM_Odm->Adapter = Adapter; - - ODM_CmnInfoInit(pDM_Odm,ODM_CMNINFO_PLATFORM,ODM_CE); - if (Adapter->interface_type == RTW_GSPI) - ODM_CmnInfoInit(pDM_Odm,ODM_CMNINFO_INTERFACE,ODM_ITRF_SDIO); - else - ODM_CmnInfoInit(pDM_Odm,ODM_CMNINFO_INTERFACE,Adapter->interface_type); + u8 cut_ver,fab_ver; + Init_ODM_ComInfo(Adapter); if (IS_HARDWARE_TYPE_8812(Adapter)) ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_IC_TYPE, ODM_RTL8812); else if (IS_HARDWARE_TYPE_8821(Adapter)) ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_IC_TYPE, ODM_RTL8821); - fab_ver = ODM_TSMC; if(IS_A_CUT(pHalData->VersionID)) cut_ver = ODM_CUT_A; @@ -358,75 +293,10 @@ static void Init_ODM_ComInfo_8812(PADAPTER Adapter) ODM_CmnInfoInit(pDM_Odm,ODM_CMNINFO_FAB_VER,fab_ver); ODM_CmnInfoInit(pDM_Odm,ODM_CMNINFO_CUT_VER,cut_ver); - ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_MP_TEST_CHIP,IS_NORMAL_CHIP(pHalData->VersionID)); - - //1 ======= BoardType: ODM_CMNINFO_BOARD_TYPE ======= -#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) - if(pHalData->InterfaceSel == INTF_SEL1_USB_High_Power) - { - ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_EXT_PA, 1); - ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_EXT_LNA, 1); - } - else - { - ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_EXT_PA, pHalData->ExternalPA_2G); - ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_EXT_LNA, 0); - } -#else - // PCIE no external PA now??? - ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_EXT_PA, 0); - ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_EXT_LNA, 0); -#endif - - if (pHalData->ExternalLNA_2G != 0) { - BoardType |= ODM_BOARD_EXT_LNA; - ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_EXT_LNA, 1); - } - if (pHalData->ExternalLNA_5G != 0) { - BoardType |= ODM_BOARD_EXT_LNA_5G; - ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_5G_EXT_LNA, 1); - } - if (pHalData->ExternalPA_2G != 0) { - BoardType |= ODM_BOARD_EXT_PA; - ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_EXT_PA, 1); - } - if (pHalData->ExternalPA_5G != 0) { - BoardType |= ODM_BOARD_EXT_PA_5G; - ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_5G_EXT_PA, 1); - } - - ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_BOARD_TYPE, BoardType); - - //1 ============== End of BoardType ============== - - ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_GPA, pHalData->TypeGPA); - ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_APA, pHalData->TypeAPA); - ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_GLNA, pHalData->TypeGLNA); - ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_ALNA, pHalData->TypeALNA); - - ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_RFE_TYPE, pHalData->RFEType); - - ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_EXT_TRSW, 0); - - ODM_CmnInfoInit(pDM_Odm,ODM_CMNINFO_PATCH_ID,pEEPROM->CustomerID); - // ODM_CMNINFO_BINHCT_TEST only for MP Team - ODM_CmnInfoInit(pDM_Odm,ODM_CMNINFO_BWIFI_TEST,Adapter->registrypriv.wifi_spec); - - - if(pHalData->rf_type == RF_1T1R){ - ODM_CmnInfoUpdate(pDM_Odm,ODM_CMNINFO_RF_TYPE,ODM_1T1R); - } - else if(pHalData->rf_type == RF_2T2R){ - ODM_CmnInfoUpdate(pDM_Odm,ODM_CMNINFO_RF_TYPE,ODM_2T2R); - } - else if(pHalData->rf_type == RF_1T2R){ - ODM_CmnInfoUpdate(pDM_Odm,ODM_CMNINFO_RF_TYPE,ODM_1T2R); - } + ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_RF_ANTENNA_TYPE, pHalData->TRxAntDivType); - ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_RFE_TYPE, pHalData->RFEType); + ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_IQKFWOFFLOAD, pHalData->RegIQKFWOffload); - ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_RF_ANTENNA_TYPE, pHalData->TRxAntDivType); - #ifdef CONFIG_DISABLE_ODM pdmpriv->InitODMFlag = 0; #else @@ -442,26 +312,25 @@ static void Init_ODM_ComInfo_8812(PADAPTER Adapter) } static void Update_ODM_ComInfo_8812(PADAPTER Adapter) { - struct mlme_ext_priv *pmlmeext = &Adapter->mlmeextpriv; - struct mlme_priv *pmlmepriv = &Adapter->mlmepriv; - struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(Adapter); PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter); PDM_ODM_T pDM_Odm = &(pHalData->odmpriv); - struct dm_priv *pdmpriv = &pHalData->dmpriv; - int i; + struct dm_priv *pdmpriv = &pHalData->dmpriv; pdmpriv->InitODMFlag = 0 | ODM_BB_DIG | ODM_BB_RA_MASK | ODM_BB_FA_CNT | ODM_BB_RSSI_MONITOR + | ODM_BB_CFO_TRACKING | ODM_RF_TX_PWR_TRACK | ODM_MAC_EDCA_TURBO -#ifdef CONFIG_ODM_ADAPTIVITY - | ODM_BB_ADAPTIVITY -#endif + | ODM_BB_NHM_CNT +// | ODM_BB_PWR_TRAIN ; + if (rtw_odm_adaptivity_needed(Adapter) == _TRUE) + pdmpriv->InitODMFlag |= ODM_BB_ADAPTIVITY; + if(pHalData->AntDivCfg) pdmpriv->InitODMFlag |= ODM_BB_ANT_DIV; @@ -479,41 +348,8 @@ static void Update_ODM_ComInfo_8812(PADAPTER Adapter) #endif//CONFIG_DISABLE_ODM ODM_CmnInfoUpdate(pDM_Odm,ODM_CMNINFO_ABILITY,pdmpriv->InitODMFlag); - - ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_TX_UNI,&(Adapter->xmitpriv.tx_bytes)); - ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_RX_UNI,&(Adapter->recvpriv.rx_bytes)); - ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_WM_MODE,&(pmlmeext->cur_wireless_mode)); - ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_BAND,&(pHalData->CurrentBandType)); - ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_FORCED_RATE,&(pHalData->ForcedDataRate)); - - ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_SEC_CHNL_OFFSET,&(pHalData->nCur40MhzPrimeSC)); - ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_SEC_MODE,&(Adapter->securitypriv.dot11PrivacyAlgrthm)); - ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_BW,&(pHalData->CurrentChannelBW )); - ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_CHNL,&( pHalData->CurrentChannel)); - ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_NET_CLOSED,&( Adapter->net_closed)); - ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_MP_MODE,&(Adapter->registrypriv.mp_mode)); - ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_FORCED_IGI_LB,&(pHalData->u1ForcedIgiLb)); - //================= only for 8192D ================= - /* - //pHalData->CurrentBandType92D - ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_DMSP_GET_VALUE,&(pDM_Odm->u1Byte_temp)); - ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_BUDDY_ADAPTOR,&(pDM_Odm->PADAPTER_temp)); - ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_DMSP_IS_MASTER,&(pDM_Odm->u1Byte_temp)); - //================= only for 8192D ================= - // driver havn't those variable now - ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_BT_OPERATION,&(pDM_Odm->u1Byte_temp)); - ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_BT_DISABLE_EDCA,&(pDM_Odm->u1Byte_temp)); - */ - - ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_SCAN,&(pmlmepriv->bScanInProcess)); - ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_POWER_SAVING,&(pwrctrlpriv->bpower_saving)); - ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_RF_ANTENNA_TYPE, pHalData->TRxAntDivType); - for(i=0; i< NUM_STA; i++) - { - //pDM_Odm->pODM_StaInfo[i] = NULL; - ODM_CmnInfoPtrArrayHook(pDM_Odm, ODM_CMNINFO_STA_STATUS,i,NULL); - } + ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_RF_ANTENNA_TYPE, pHalData->TRxAntDivType); } void @@ -582,7 +418,7 @@ rtl8812_HalDmWatchDog( // Calculate Tx/Rx statistics. // dm_CheckStatistics(Adapter); - + rtw_hal_check_rxfifo_full(Adapter); // // Dynamically switch RTS/CTS protection. // @@ -604,43 +440,45 @@ rtl8812_HalDmWatchDog( { u8 bLinked=_FALSE; u8 bsta_state=_FALSE; + u8 bBtDisabled = _TRUE; #ifdef CONFIG_DISABLE_ODM pHalData->odmpriv.SupportAbility = 0; #endif - if(rtw_linked_check(Adapter)) + if(rtw_linked_check(Adapter)){ bLinked = _TRUE; - + if (check_fwstate(&Adapter->mlmepriv, WIFI_STATION_STATE)) + bsta_state = _TRUE; + } + #ifdef CONFIG_CONCURRENT_MODE - if(pbuddy_adapter && rtw_linked_check(pbuddy_adapter)) + if(pbuddy_adapter && rtw_linked_check(pbuddy_adapter)){ bLinked = _TRUE; + if(pbuddy_adapter && check_fwstate(&pbuddy_adapter->mlmepriv, WIFI_STATION_STATE)) + bsta_state = _TRUE; + } #endif //CONFIG_CONCURRENT_MODE - ODM_CmnInfoUpdate(&pHalData->odmpriv ,ODM_CMNINFO_LINK, bLinked); - if (check_fwstate(&Adapter->mlmepriv, WIFI_STATION_STATE)) - bsta_state = _TRUE; -#ifdef CONFIG_CONCURRENT_MODE - if(pbuddy_adapter && check_fwstate(&pbuddy_adapter->mlmepriv, WIFI_STATION_STATE)) - bsta_state = _TRUE; -#endif //CONFIG_CONCURRENT_MODE + ODM_CmnInfoUpdate(&pHalData->odmpriv ,ODM_CMNINFO_LINK, bLinked); ODM_CmnInfoUpdate(&pHalData->odmpriv ,ODM_CMNINFO_STATION_STATE, bsta_state); +#ifdef CONFIG_BT_COEXIST + bBtDisabled = rtw_btcoex_IsBtDisabled(Adapter); +#endif // CONFIG_BT_COEXIST + ODM_CmnInfoUpdate(&pHalData->odmpriv, ODM_CMNINFO_BT_ENABLED, ((bBtDisabled == _TRUE)?_FALSE:_TRUE)); + ODM_DMWatchdog(&pHalData->odmpriv); } skip_dm: - // Check GPIO to determine current RF on/off and Pbc status. - // Check Hardware Radio ON/OFF or not -#ifdef CONFIG_PCI_HCI - if(pHalData->bGpioHwWpsPbc) +#ifdef CONFIG_SUPPORT_HW_WPS_PBC + // Check GPIO to determine current Pbc status. + dm_CheckPbcGPIO(Adapter); #endif - { - //temp removed - dm_CheckPbcGPIO(Adapter); - } + return; } @@ -649,17 +487,10 @@ void rtl8812_init_dm_priv(IN PADAPTER Adapter) PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter); struct dm_priv *pdmpriv = &pHalData->dmpriv; PDM_ODM_T podmpriv = &pHalData->odmpriv; + + _rtw_memset(pdmpriv, 0, sizeof(struct dm_priv)); //_rtw_spinlock_init(&(pHalData->odm_stainfo_lock)); - Init_ODM_ComInfo_8812(Adapter); -#ifdef CONFIG_SW_ANTENNA_DIVERSITY - //_init_timer(&(pdmpriv->SwAntennaSwitchTimer), Adapter->pnetdev , odm_SW_AntennaSwitchCallback, Adapter); - ODM_InitAllTimers(podmpriv ); -#endif - ODM_InitDebugSetting(podmpriv); - - pHalData->RegRFPathS1 = 0; - pHalData->TxPwrInPercentage = TX_PWR_PERCENTAGE_3; #ifdef CONFIG_BT_COEXIST /* firmware size issue, btcoex fw doesn't support IQK offload */ @@ -669,6 +500,13 @@ void rtl8812_init_dm_priv(IN PADAPTER Adapter) pHalData->RegIQKFWOffload = 1; rtw_sctx_init(&pHalData->iqk_sctx, 0); } + + Init_ODM_ComInfo_8812(Adapter); + ODM_InitAllTimers(podmpriv ); + PHYDM_InitDebugSetting(podmpriv); + + pHalData->TxPwrInPercentage = TX_PWR_PERCENTAGE_3; + } void rtl8812_deinit_dm_priv(IN PADAPTER Adapter) @@ -677,10 +515,7 @@ void rtl8812_deinit_dm_priv(IN PADAPTER Adapter) struct dm_priv *pdmpriv = &pHalData->dmpriv; PDM_ODM_T podmpriv = &pHalData->odmpriv; //_rtw_spinlock_free(&pHalData->odm_stainfo_lock); -#ifdef CONFIG_SW_ANTENNA_DIVERSITY - //_cancel_timer_ex(&pdmpriv->SwAntennaSwitchTimer); ODM_CancelAllTimers(podmpriv); -#endif } diff --git a/backports/drivers/realtek/rtl8812au/hal/rtl8812a/rtl8812a_hal_init.c b/backports/drivers/realtek/rtl8812au/hal/rtl8812a/rtl8812a_hal_init.c index 73f5f21b8ac192..dddf610cb056b2 100755 --- a/backports/drivers/realtek/rtl8812au/hal/rtl8812a/rtl8812a_hal_init.c +++ b/backports/drivers/realtek/rtl8812au/hal/rtl8812a/rtl8812a_hal_init.c @@ -22,451 +22,6 @@ //#include #include - -#if defined(CONFIG_IOL) -void iol_mode_enable(PADAPTER padapter, u8 enable) -{ - u8 reg_0xf0 = 0; - - if(enable) - { - //Enable initial offload - reg_0xf0 = rtw_read8(padapter, REG_SYS_CFG); - //DBG_871X("%s reg_0xf0:0x%02x, write 0x%02x\n", __FUNCTION__, reg_0xf0, reg_0xf0|IOL_ENABLE); - rtw_write8(padapter, REG_SYS_CFG, reg_0xf0|SW_OFFLOAD_EN); - - _8051Reset8812(padapter); - } - else - { - //disable initial offload - reg_0xf0 = rtw_read8(padapter, REG_SYS_CFG); - //DBG_871X("%s reg_0xf0:0x%02x, write 0x%02x\n", __FUNCTION__, reg_0xf0, reg_0xf0& ~IOL_ENABLE); - rtw_write8(padapter, REG_SYS_CFG, reg_0xf0 & ~SW_OFFLOAD_EN); - } -} - -s32 iol_execute(PADAPTER padapter, u8 control) -{ - s32 status = _FAIL; - u8 reg_0x88 = 0; - u32 start = 0, passing_time = 0; - control = control&0x0f; - - reg_0x88 = rtw_read8(padapter, 0x88); - //DBG_871X("%s reg_0x88:0x%02x, write 0x%02x\n", __FUNCTION__, reg_0x88, reg_0x88|control); - rtw_write8(padapter, 0x88, reg_0x88|control); - - start = rtw_get_current_time(); - while((reg_0x88=rtw_read8(padapter, 0x88)) & control - && (passing_time=rtw_get_passing_time_ms(start))<1000 - ) { - DBG_871X("%s polling reg_0x88:0x%02x\n", __FUNCTION__, reg_0x88); - rtw_usleep_os(100); - } - - reg_0x88 = rtw_read8(padapter, 0x88); - status = (reg_0x88 & control)?_FAIL:_SUCCESS; - if(reg_0x88 & control<<4) - status = _FAIL; - - DBG_871X("%s in %u ms, reg_0x88:0x%02x\n", __FUNCTION__, passing_time, reg_0x88); - - return status; -} - -s32 iol_InitLLTTable( - PADAPTER padapter, - u8 txpktbuf_bndy - ) -{ - //DBG_871X("%s txpktbuf_bndy:%u\n", __FUNCTION__, txpktbuf_bndy); - rtw_write8(padapter, REG_TDECTRL+1, txpktbuf_bndy); - return iol_execute(padapter, IOL_INIT_LLT); -} - -static VOID -efuse_phymap_to_logical(u8 * phymap, u16 _offset, u16 _size_byte, u8 *pbuf) -{ - u8 *efuseTbl = NULL; - u8 rtemp8; - u16 eFuse_Addr = 0; - u8 offset, wren; - u16 i, j; - u16 **eFuseWord = NULL; - u16 efuse_utilized = 0; - u8 efuse_usage = 0; - u8 u1temp = 0; - - - efuseTbl = (u8*)rtw_zmalloc(EFUSE_MAP_LEN_JAGUAR); - if(efuseTbl == NULL) - { - DBG_871X("%s: alloc efuseTbl fail!\n", __FUNCTION__); - goto exit; - } - - eFuseWord= (u16 **)rtw_malloc2d(EFUSE_MAX_SECTION_JAGUAR, EFUSE_MAX_WORD_UNIT, sizeof(u16)); - if(eFuseWord == NULL) - { - DBG_871X("%s: alloc eFuseWord fail!\n", __FUNCTION__); - goto exit; - } - - // 0. Refresh efuse init map as all oxFF. - for (i = 0; i < EFUSE_MAX_SECTION_JAGUAR; i++) - for (j = 0; j < EFUSE_MAX_WORD_UNIT; j++) - eFuseWord[i][j] = 0xFFFF; - - // - // 1. Read the first byte to check if efuse is empty!!! - // - // - rtemp8 = *(phymap+eFuse_Addr); - if(rtemp8 != 0xFF) - { - efuse_utilized++; - //printk("efuse_Addr-%d efuse_data=%x\n", eFuse_Addr, *rtemp8); - eFuse_Addr++; - } - else - { - DBG_871X("EFUSE is empty efuse_Addr-%d efuse_data=%x\n", eFuse_Addr, rtemp8); - goto exit; - } - - - // - // 2. Read real efuse content. Filter PG header and every section data. - // - while((rtemp8 != 0xFF) && (eFuse_Addr < EFUSE_REAL_CONTENT_LEN_JAGUAR)) - { - //RTPRINT(FEEPROM, EFUSE_READ_ALL, ("efuse_Addr-%d efuse_data=%x\n", eFuse_Addr-1, *rtemp8)); - - // Check PG header for section num. - if((rtemp8 & 0x1F ) == 0x0F) //extended header - { - u1temp =( (rtemp8 & 0xE0) >> 5); - //RTPRINT(FEEPROM, EFUSE_READ_ALL, ("extended header u1temp=%x *rtemp&0xE0 0x%x\n", u1temp, *rtemp8 & 0xE0)); - - //RTPRINT(FEEPROM, EFUSE_READ_ALL, ("extended header u1temp=%x \n", u1temp)); - - rtemp8 = *(phymap+eFuse_Addr); - - //RTPRINT(FEEPROM, EFUSE_READ_ALL, ("extended header efuse_Addr-%d efuse_data=%x\n", eFuse_Addr, *rtemp8)); - - if((rtemp8 & 0x0F) == 0x0F) - { - eFuse_Addr++; - rtemp8 = *(phymap+eFuse_Addr); - - if(rtemp8 != 0xFF && (eFuse_Addr < EFUSE_REAL_CONTENT_LEN_JAGUAR)) - { - eFuse_Addr++; - } - continue; - } - else - { - offset = ((rtemp8 & 0xF0) >> 1) | u1temp; - wren = (rtemp8 & 0x0F); - eFuse_Addr++; - } - } - else - { - offset = ((rtemp8 >> 4) & 0x0f); - wren = (rtemp8 & 0x0f); - } - - if(offset < EFUSE_MAX_SECTION_JAGUAR) - { - // Get word enable value from PG header - //RTPRINT(FEEPROM, EFUSE_READ_ALL, ("Offset-%d Worden=%x\n", offset, wren)); - - for(i=0; i= EFUSE_REAL_CONTENT_LEN_JAGUAR) - break; - - //RTPRINT(FEEPROM, EFUSE_READ_ALL, ("Addr=%d", eFuse_Addr)); - rtemp8 = *(phymap+eFuse_Addr); - eFuse_Addr++; - //RTPRINT(FEEPROM, EFUSE_READ_ALL, ("Data=0x%x\n", *rtemp8)); - - efuse_utilized++; - eFuseWord[offset][i] |= (((u2Byte)rtemp8 << 8) & 0xff00); - - if(eFuse_Addr >= EFUSE_REAL_CONTENT_LEN_JAGUAR) - break; - } - - wren >>= 1; - - } - } - - // Read next PG header - rtemp8 = *(phymap+eFuse_Addr); - //RTPRINT(FEEPROM, EFUSE_READ_ALL, ("Addr=%d rtemp 0x%x\n", eFuse_Addr, *rtemp8)); - - if(rtemp8 != 0xFF && (eFuse_Addr < EFUSE_REAL_CONTENT_LEN_JAGUAR)) - { - efuse_utilized++; - eFuse_Addr++; - } - } - - // - // 3. Collect 16 sections and 4 word unit into Efuse map. - // - for(i=0; i> 8) & 0xff); - } - } - - - // - // 4. Copy from Efuse map to output pointer memory!!! - // - for(i=0; i<_size_byte; i++) - { - pbuf[i] = efuseTbl[_offset+i]; - } - - // - // 5. Calculate Efuse utilization. - // - efuse_usage = (u1Byte)((efuse_utilized*100)/EFUSE_REAL_CONTENT_LEN_JAGUAR); - //Adapter->HalFunc.SetHwRegHandler(Adapter, HW_VAR_EFUSE_BYTES, (u8 *)&efuse_utilized); - -exit: - if(efuseTbl) - rtw_mfree(efuseTbl, EFUSE_MAP_LEN_JAGUAR); - - if(eFuseWord) - rtw_mfree2d((void *)eFuseWord, EFUSE_MAX_SECTION_JAGUAR, EFUSE_MAX_WORD_UNIT, sizeof(u16)); -} - -void efuse_read_phymap_from_txpktbuf( - ADAPTER *adapter, - int bcnhead, //beacon head, where FW store len(2-byte) and efuse physical map. - u8 *content, //buffer to store efuse physical map - u16 *size //for efuse content: the max byte to read. will update to byte read - ) -{ - u16 dbg_addr = 0; - u32 start = 0, passing_time = 0; - u8 reg_0x143 = 0; - u8 reg_0x106 = 0; - u32 lo32 = 0, hi32 = 0; - u16 len = 0, count = 0; - int i = 0; - u16 limit = *size; - - u8 *pos = content; - - if(bcnhead<0) //if not valid - bcnhead = rtw_read8(adapter, REG_TDECTRL+1); - - DBG_871X("%s bcnhead:%d\n", __FUNCTION__, bcnhead); - - //reg_0x106 = rtw_read8(adapter, REG_PKT_BUFF_ACCESS_CTRL); - //DBG_871X("%s reg_0x106:0x%02x, write 0x%02x\n", __FUNCTION__, reg_0x106, 0x69); - rtw_write8(adapter, REG_PKT_BUFF_ACCESS_CTRL, TXPKT_BUF_SELECT); - //DBG_871X("%s reg_0x106:0x%02x\n", __FUNCTION__, rtw_read8(adapter, 0x106)); - - dbg_addr = bcnhead*128/8; //8-bytes addressing - - while(1) - { - //DBG_871X("%s dbg_addr:0x%x\n", __FUNCTION__, dbg_addr+i); - rtw_write16(adapter, REG_PKTBUF_DBG_ADDR, dbg_addr+i); - - //DBG_871X("%s write reg_0x143:0x00\n", __FUNCTION__); - rtw_write8(adapter, REG_TXPKTBUF_DBG, 0); - start = rtw_get_current_time(); - while(!(reg_0x143=rtw_read8(adapter, REG_TXPKTBUF_DBG))//dbg - //while(rtw_read8(adapter, REG_TXPKTBUF_DBG) & BIT0 - && (passing_time=rtw_get_passing_time_ms(start))<1000 - ) { - DBG_871X("%s polling reg_0x143:0x%02x, reg_0x106:0x%02x\n", __FUNCTION__, reg_0x143, rtw_read8(adapter, 0x106)); - rtw_usleep_os(100); - } - - - lo32 = rtw_read32(adapter, REG_PKTBUF_DBG_DATA_L); - hi32 = rtw_read32(adapter, REG_PKTBUF_DBG_DATA_H); - - #if 0 - DBG_871X("%s lo32:0x%08x, %02x %02x %02x %02x\n", __FUNCTION__, lo32 - , rtw_read8(adapter, REG_PKTBUF_DBG_DATA_L) - , rtw_read8(adapter, REG_PKTBUF_DBG_DATA_L+1) - , rtw_read8(adapter, REG_PKTBUF_DBG_DATA_L+2) - , rtw_read8(adapter, REG_PKTBUF_DBG_DATA_L+3) - ); - DBG_871X("%s hi32:0x%08x, %02x %02x %02x %02x\n", __FUNCTION__, hi32 - , rtw_read8(adapter, REG_PKTBUF_DBG_DATA_H) - , rtw_read8(adapter, REG_PKTBUF_DBG_DATA_H+1) - , rtw_read8(adapter, REG_PKTBUF_DBG_DATA_H+2) - , rtw_read8(adapter, REG_PKTBUF_DBG_DATA_H+3) - ); - #endif - - if(i==0) - { - #if 1 //for debug - u8 lenc[2]; - u16 lenbak, aaabak; - u16 aaa; - lenc[0] = rtw_read8(adapter, REG_PKTBUF_DBG_DATA_L); - lenc[1] = rtw_read8(adapter, REG_PKTBUF_DBG_DATA_L+1); - - aaabak = le16_to_cpup((u16*)lenc); - lenbak = le16_to_cpu(*((u16*)lenc)); - aaa = le16_to_cpup((u16*)&lo32); - #endif - len = le16_to_cpu(*((u16*)&lo32)); - - limit = len-2=count+2?2:limit-count); - count+=limit>=count+2?2:limit-count; - pos=content+count; - - } - else - { - _rtw_memcpy(pos, ((u8*)&lo32), limit>=count+4?4:limit-count); - count+=limit>=count+4?4:limit-count; - pos=content+count; - - - } - - if(limit>count && len-2>count) { - _rtw_memcpy(pos, (u8*)&hi32, limit>=count+4?4:limit-count); - count+=limit>=count+4?4:limit-count; - pos=content+count; - } - - if(limit<=count || len-2<=count) - break; - - i++; - } - - rtw_write8(adapter, REG_PKT_BUFF_ACCESS_CTRL, DISABLE_TRXPKT_BUF_ACCESS); - - DBG_871X("%s read count:%u\n", __FUNCTION__, count); - *size = count; - -} - - -static bool efuse_read_phymap( - PADAPTER Adapter, - u8 *pbuf, //buffer to store efuse physical map - u16 *size //the max byte to read. will update to byte read - ) -{ - u8 *pos = pbuf; - u16 limit = *size; - u16 addr = 0; - bool reach_end = _FALSE; - - // - // Refresh efuse init map as all 0xFF. - // - _rtw_memset(pbuf, 0xFF, limit); - - - // - // Read physical efuse content. - // - while(addr < limit) - { - ReadEFuseByte(Adapter, addr, pos, _FALSE); - if(*pos != 0xFF) - { - pos++; - addr++; - } - else - { - reach_end = _TRUE; - break; - } - } - - *size = addr; - - return reach_end; - -} - -s32 iol_read_efuse( - PADAPTER padapter, - u8 txpktbuf_bndy, - u16 offset, - u16 size_byte, - u8 *logical_map - ) -{ - s32 status = _FAIL; - u8 reg_0x106 = 0; - u8 physical_map[512]; - u16 size = 512; - int i; - - - rtw_write8(padapter, REG_TDECTRL+1, txpktbuf_bndy); - _rtw_memset(physical_map, 0xFF, 512); - - ///reg_0x106 = rtw_read8(padapter, REG_PKT_BUFF_ACCESS_CTRL); - //DBG_871X("%s reg_0x106:0x%02x, write 0x%02x\n", __FUNCTION__, reg_0x106, 0x69); - rtw_write8(padapter, REG_PKT_BUFF_ACCESS_CTRL, TXPKT_BUF_SELECT); - //DBG_871X("%s reg_0x106:0x%02x\n", __FUNCTION__, rtw_read8(padapter, 0x106)); - - status = iol_execute(padapter, IOL_READ_EFUSE_MAP); - - if(status == _SUCCESS) - efuse_read_phymap_from_txpktbuf(padapter, txpktbuf_bndy, physical_map, &size); - - #if 0 - DBG_871X("%s physical map\n", __FUNCTION__); - for(i=0;i _8051Reset8812(): 8051 reset success .\n"); } -extern u8 g_fwdl_chksum_fail; static s32 polling_fwdl_chksum(_adapter *adapter, u32 min_cnt, u32 timeout_ms) { s32 ret = _FAIL; @@ -923,11 +474,8 @@ static s32 polling_fwdl_chksum(_adapter *adapter, u32 min_cnt, u32 timeout_ms) goto exit; } - if (g_fwdl_chksum_fail) { - DBG_871X("%s: fwdl test case: fwdl_chksum_fail\n", __FUNCTION__); - g_fwdl_chksum_fail--; + if (rtw_fwdl_test_trigger_chksum_fail()) goto exit; - } ret = _SUCCESS; @@ -938,7 +486,6 @@ static s32 polling_fwdl_chksum(_adapter *adapter, u32 min_cnt, u32 timeout_ms) return ret; } -extern u8 g_fwdl_wintint_rdy_fail; static s32 _FWFreeToGo8812(_adapter *adapter, u32 min_cnt, u32 timeout_ms) { s32 ret = _FAIL; @@ -966,11 +513,8 @@ static s32 _FWFreeToGo8812(_adapter *adapter, u32 min_cnt, u32 timeout_ms) goto exit; } - if (g_fwdl_wintint_rdy_fail) { - DBG_871X("%s: fwdl test case: wintint_rdy_fail\n", __FUNCTION__); - g_fwdl_wintint_rdy_fail--; + if (rtw_fwdl_test_trigger_wintint_rdy_fail()) goto exit; - } ret = _SUCCESS; @@ -1290,6 +834,12 @@ int _WriteBTFWtoTxPktBuf8812( #else TotalPktLen = FwBufLen+pHalData->HWDescHeadLength; #endif + if((TotalPktLen+TXDESC_OFFSET) > MAX_CMDBUF_SZ) + { + DBG_871X(" WARNING %s => Total packet len = %d over MAX_CMDBUF_SZ:%d \n" + ,__FUNCTION__,(TotalPktLen+TXDESC_OFFSET),MAX_CMDBUF_SZ); + return _FAIL; + } pGenBufReservedPagePacket = rtw_zmalloc(TotalPktLen);//GetGenTempBuffer (Adapter, TotalPktLen); if (!pGenBufReservedPagePacket) return _FAIL; @@ -1352,7 +902,7 @@ int _WriteBTFWtoTxPktBuf8812( } // Init Tx boundary. - PlatformEFIOWrite1Byte(Adapter, REG_TDECTRL_8723B+1, (u1Byte)txpktbuf_bndy); + PlatformEFIOWrite1Byte(Adapter, REG_DWBCN0_CTRL_8723B+1, (u1Byte)txpktbuf_bndy); #endif @@ -1391,9 +941,9 @@ int _WriteBTFWtoTxPktBuf8812( /*--------------------------------------------------------- tx reserved_page_packet ----------------------------------------------------------*/ - if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) { - rtStatus = _FAIL; - goto exit; + if ((pmgntframe = rtw_alloc_cmdxmitframe(pxmitpriv)) == NULL) { + rtStatus = _FAIL; + goto exit; } //update attribute pattrib = &pmgntframe->attrib; @@ -1405,10 +955,14 @@ int _WriteBTFWtoTxPktBuf8812( //_rtw_memset(pmgntframe->buf_addr, 0, TotalPktLen+txdesc_size); //pmgntframe->buf_addr = ReservedPagePacket ; - _rtw_memcpy( (u8*) (pmgntframe->buf_addr + txdesc_offset), ReservedPagePacket, FwBufLen); - DBG_871X("[%d]===>TotalPktLen + TXDESC_OFFSET TotalPacketLen:%d \n", DLBcnCount, (FwBufLen + txdesc_offset)); + _rtw_memcpy( (u8*) (pmgntframe->buf_addr + txdesc_offset), ReservedPagePacket, FwBufLen); + DBG_871X("[%d]===>TotalPktLen + TXDESC_OFFSET TotalPacketLen:%d \n", DLBcnCount, (FwBufLen + txdesc_offset)); +#ifdef CONFIG_PCI_HCI dump_mgntframe(Adapter, pmgntframe); +#else + dump_mgntframe_and_wait(Adapter, pmgntframe, 100); +#endif #endif #if 1 @@ -1469,7 +1023,15 @@ int ReservedPage_Compare(PADAPTER Adapter,PRT_MP_FIRMWARE pFirmware,u32 BTPatchS { u8 temp,ret,lastBTsz; u32 u1bTmp=0,address_start=0,count=0,i=0; - u8 myBTFwBuffer[0x8000]; + u8 *myBTFwBuffer = NULL; + + myBTFwBuffer = rtw_zmalloc(BTPatchSize); + if (myBTFwBuffer == NULL) + { + DBG_871X("%s can't be executed due to the failed malloc.\n", __FUNCTION__); + Adapter->mppriv.bTxBufCkFail=_TRUE; + return _FALSE; + } temp=rtw_read8(Adapter,0x209); @@ -1499,14 +1061,14 @@ int ReservedPage_Compare(PADAPTER Adapter,PRT_MP_FIRMWARE pFirmware,u32 BTPatchS rtw_msleep_os(10); // 10ms }while(!(u1bTmp&BIT(23)) && count < 50); - pFirmware->myBTFwBuffer[i*8+0]=rtw_read8(Adapter, 0x144); - pFirmware->myBTFwBuffer[i*8+1]=rtw_read8(Adapter, 0x145); - pFirmware->myBTFwBuffer[i*8+2]=rtw_read8(Adapter, 0x146); - pFirmware->myBTFwBuffer[i*8+3]=rtw_read8(Adapter, 0x147); - pFirmware->myBTFwBuffer[i*8+4]=rtw_read8(Adapter, 0x148); - pFirmware->myBTFwBuffer[i*8+5]=rtw_read8(Adapter, 0x149); - pFirmware->myBTFwBuffer[i*8+6]=rtw_read8(Adapter, 0x14a); - pFirmware->myBTFwBuffer[i*8+7]=rtw_read8(Adapter, 0x14b); + myBTFwBuffer[i*8+0]=rtw_read8(Adapter, 0x144); + myBTFwBuffer[i*8+1]=rtw_read8(Adapter, 0x145); + myBTFwBuffer[i*8+2]=rtw_read8(Adapter, 0x146); + myBTFwBuffer[i*8+3]=rtw_read8(Adapter, 0x147); + myBTFwBuffer[i*8+4]=rtw_read8(Adapter, 0x148); + myBTFwBuffer[i*8+5]=rtw_read8(Adapter, 0x149); + myBTFwBuffer[i*8+6]=rtw_read8(Adapter, 0x14a); + myBTFwBuffer[i*8+7]=rtw_read8(Adapter, 0x14b); } rtw_write32(Adapter,0x140,address_start+5+BTPatchSize/8) ; @@ -1530,20 +1092,25 @@ int ReservedPage_Compare(PADAPTER Adapter,PRT_MP_FIRMWARE pFirmware,u32 BTPatchS for(i=0;imyBTFwBuffer[(BTPatchSize/8)*8+i] = rtw_read8(Adapter, (0x144+i)); + myBTFwBuffer[(BTPatchSize/8)*8+i] = rtw_read8(Adapter, (0x144+i)); } for(i=0;imyBTFwBuffer[i]!= pFirmware->szBTFwBuffer[i]) + if(myBTFwBuffer[i]!= pFirmware->szFwBuffer[i]) { - DBG_871X(" In direct pFirmware->myBTFwBuffer[%d]=%x , pFirmware->szBTFwBuffer=%x\n",i, pFirmware->myBTFwBuffer[i],pFirmware->szBTFwBuffer[i]); + DBG_871X(" In direct myBTFwBuffer[%d]=%x , pFirmware->szFwBuffer=%x\n",i, myBTFwBuffer[i],pFirmware->szFwBuffer[i]); Adapter->mppriv.bTxBufCkFail=_TRUE; break; } } + if (myBTFwBuffer != NULL) + { + rtw_mfree(myBTFwBuffer, BTPatchSize); + } + return _TRUE; } @@ -1587,8 +1154,8 @@ s32 FirmwareDownloadBT(PADAPTER padapter, PRT_MP_FIRMWARE pFirmware) pBTFirmwareBuf = (u8*)Rtl8821A_BT_MP_Patch_FW; BTFirmwareLen = Rtl8812BFwBTImgArrayLength; - pFirmware->szBTFwBuffer = pBTFirmwareBuf; - pFirmware->ulBTFwLength = BTFirmwareLen; + pFirmware->szFwBuffer = pBTFirmwareBuf; + pFirmware->ulFwLength = BTFirmwareLen; #endif // CONFIG_EMBEDDED_FWIMG } @@ -1672,10 +1239,7 @@ SetFwRelatedForWoWLAN8812( static void rtl8812_free_hal_data(PADAPTER padapter) { _func_enter_; - if (padapter->HalData) { - rtw_mfree(padapter->HalData, sizeof(HAL_DATA_TYPE)); - padapter->HalData = NULL; - } + _func_exit_; } @@ -1947,7 +1511,7 @@ hal_ReadPowerValueFromPROM8812A( { pwrInfo5G->BW40_Diff[rfPath][TxCount]= (PROMContent[eeAddr]&0xf0)>>4; if(pwrInfo5G->BW40_Diff[rfPath][TxCount] & BIT3) //4bit sign number to 8 bit sign number - pwrInfo5G->BW40_Diff[rfPath][TxCount] |= 0xF0; + pwrInfo5G->BW40_Diff[rfPath][TxCount] |= 0xF0; } //DBG_871X("8812-5G RF-%d-SS-%d BW40-Addr-%x DIFF=%d\n", //rfPath, TxCount, eeAddr, pwrInfo5G->BW40_Diff[rfPath][TxCount]); @@ -1956,7 +1520,7 @@ hal_ReadPowerValueFromPROM8812A( { pwrInfo5G->BW20_Diff[rfPath][TxCount] = (PROMContent[eeAddr]&0x0f); if(pwrInfo5G->BW20_Diff[rfPath][TxCount] & BIT3) //4bit sign number to 8 bit sign number - pwrInfo5G->BW20_Diff[rfPath][TxCount] |= 0xF0; + pwrInfo5G->BW20_Diff[rfPath][TxCount] |= 0xF0; } //DBG_871X("8812-5G RF-%d-SS-%d BW20-Addr-%x DIFF=%d\n", //rfPath, TxCount, eeAddr, pwrInfo5G->BW20_Diff[rfPath][TxCount]); @@ -2060,14 +1624,33 @@ Hal_EfuseParseBTCoexistInfo8812A( pHalData->EEPROMBluetoothCoexist = _FALSE; pHalData->EEPROMBluetoothAntNum = Ant_x2; } + + #ifdef CONFIG_BTCOEX_FORCE_CSR + pHalData->EEPROMBluetoothType = BT_CSR_BC8; + pHalData->EEPROMBluetoothCoexist = _TRUE; + pHalData->EEPROMBluetoothAntNum = Ant_x2; + #endif } else { rtw_warn_on(1); } #ifdef CONFIG_BT_COEXIST + if(_TRUE == pHalData->EEPROMBluetoothCoexist && IS_HARDWARE_TYPE_8812(Adapter)) + { +#ifdef CONFIG_LOAD_PHY_PARA_FROM_FILE + if ( !hal_btcoex_AntIsolationConfig_ParaFile (Adapter , RTL8812_WIFI_ANT_ISOLATION)) +#endif + { + //DBG_871X("%s : %s file read fail \n", __FUNCTION__,WIFI_ANT_ISOLATION_CONFIG_FILE); + pHalData->EEPROMBluetoothCoexist = _TRUE; + hal_btcoex_SetAntIsolationType(Adapter, 1); + } + } rtw_btcoex_SetBTCoexist(Adapter, pHalData->EEPROMBluetoothCoexist); rtw_btcoex_SetChipType(Adapter, pHalData->EEPROMBluetoothType); rtw_btcoex_SetPGAntNum(Adapter, pHalData->EEPROMBluetoothAntNum==Ant_x2?2:1); + DBG_871X("%s: BTCoexist=%s, AntNum=%d\n, ", __FUNCTION__,pHalData->EEPROMBluetoothCoexist==_TRUE?"Enable":"Disable" + ,pHalData->EEPROMBluetoothAntNum==Ant_x2?2:1); #endif /* CONFIG_BT_COEXIST */ } @@ -2216,16 +1799,13 @@ Hal_ReadTxPowerInfo8812A( if(!AutoLoadFail) { struct registry_priv *registry_par = &Adapter->registrypriv; - if( registry_par->regulatory_tid == 0xff){ + - if(PROMContent[EEPROM_RF_BOARD_OPTION_8812] == 0xFF) - pHalData->EEPROMRegulatory = (EEPROM_DEFAULT_BOARD_OPTION&0x7); //bit0~2 - else - pHalData->EEPROMRegulatory = (PROMContent[EEPROM_RF_BOARD_OPTION_8812]&0x7); //bit0~2 - } - else{ - pHalData->EEPROMRegulatory = registry_par->regulatory_tid; - } + if(PROMContent[EEPROM_RF_BOARD_OPTION_8812] == 0xFF) + pHalData->EEPROMRegulatory = (EEPROM_DEFAULT_BOARD_OPTION&0x7); //bit0~2 + else + pHalData->EEPROMRegulatory = (PROMContent[EEPROM_RF_BOARD_OPTION_8812]&0x7); //bit0~2 + // 2012/09/26 MH Add for TX power calibrate rate. pHalData->TxPwrCalibrateRate = PROMContent[EEPROM_TX_PWR_CALIBRATE_RATE_8812]; @@ -2292,6 +1872,35 @@ Hal_ReadThermalMeter_8812A( DBG_871X("ThermalMeter = 0x%x\n", pHalData->EEPROMThermalMeter); } +void Hal_ReadRemoteWakeup_8812A( + PADAPTER padapter, + IN u8* hwinfo, + IN BOOLEAN AutoLoadFail + ) +{ + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); + struct pwrctrl_priv *pwrctl = adapter_to_pwrctl(padapter); + u8 tmpvalue; + + if(AutoLoadFail){ + pwrctl->bHWPowerdown = _FALSE; + pwrctl->bSupportRemoteWakeup = _FALSE; + } + else + { + // decide hw if support remote wakeup function + // if hw supported, 8051 (SIE) will generate WeakUP signal( D+/D- toggle) when autoresume +#ifdef CONFIG_USB_HCI + if(IS_HARDWARE_TYPE_8821U(padapter)) + pwrctl->bSupportRemoteWakeup = (hwinfo[EEPROM_USB_OPTIONAL_FUNCTION0_8811AU] & BIT1)?_TRUE :_FALSE; + else + pwrctl->bSupportRemoteWakeup = (hwinfo[EEPROM_USB_OPTIONAL_FUNCTION0] & BIT1)?_TRUE :_FALSE; +#endif //CONFIG_USB_HCI + + DBG_871X("%s...bSupportRemoteWakeup(%x)\n",__FUNCTION__, pwrctl->bSupportRemoteWakeup); + } +} + VOID Hal_ReadChannelPlan8812A( IN PADAPTER padapter, @@ -2307,8 +1916,6 @@ Hal_ReadChannelPlan8812A( , AutoLoadFail ); - Hal_ChannelPlanToRegulation(padapter, padapter->mlmepriv.ChannelPlan); - DBG_871X("mlmepriv.ChannelPlan = 0x%02x\n", padapter->mlmepriv.ChannelPlan); } @@ -2370,7 +1977,6 @@ Hal_ReadAntennaDiversity8812A( else { pHalData->AntDivCfg = 0; - //pHalData->TRxAntDivType = pHalData->TRxAntDivType; // ????? } DBG_871X("SWAS: bHwAntDiv = %x, TRxAntDivType = %x\n", pHalData->AntDivCfg, pHalData->TRxAntDivType); @@ -2407,8 +2013,7 @@ Hal_ReadAntennaDiversity8821A( } else { - pHalData->AntDivCfg = 0; - //pHalData->TRxAntDivType = pHalData->TRxAntDivType; // The value in the driver setting of device manager. + pHalData->AntDivCfg = 0; } DBG_871X("SWAS: bHwAntDiv = %x, TRxAntDivType = %x\n", pHalData->AntDivCfg, pHalData->TRxAntDivType); @@ -2429,10 +2034,11 @@ hal_ReadPAType_8812A( { pHalData->PAType_2G = EF1Byte( *(u8 *)&PROMContent[EEPROM_PA_TYPE_8812AU] ); pHalData->LNAType_2G = EF1Byte( *(u8 *)&PROMContent[EEPROM_LNA_TYPE_2G_8812AU] ); - if (pHalData->PAType_2G == 0xFF && pHalData->LNAType_2G == 0xFF) { + if (pHalData->PAType_2G == 0xFF) pHalData->PAType_2G = 0; + if(pHalData->LNAType_2G == 0xFF) pHalData->LNAType_2G = 0; - } + pHalData->ExternalPA_2G = ((pHalData->PAType_2G & BIT5) && (pHalData->PAType_2G & BIT4)) ? 1 : 0; pHalData->ExternalLNA_2G = ((pHalData->LNAType_2G & BIT7) && (pHalData->LNAType_2G & BIT3)) ? 1 : 0; } @@ -2546,10 +2152,11 @@ Hal_ReadPAType_8821A( { pHalData->PAType_2G = EF1Byte( *(u8 *)&PROMContent[EEPROM_PA_TYPE_8812AU] ); pHalData->LNAType_2G = EF1Byte( *(u8 *)&PROMContent[EEPROM_LNA_TYPE_2G_8812AU] ); - if (pHalData->PAType_2G == 0xFF && pHalData->LNAType_2G == 0xFF) { + if(pHalData->PAType_2G == 0xFF ) pHalData->PAType_2G = 0; + if(pHalData->LNAType_2G == 0xFF) pHalData->LNAType_2G = 0; - } + pHalData->ExternalPA_2G = (pHalData->PAType_2G & BIT4) ? 1 : 0; pHalData->ExternalLNA_2G = (pHalData->LNAType_2G & BIT3) ? 1 : 0; } @@ -2621,8 +2228,21 @@ Hal_ReadRFEType_8812A( if(!AutoloadFail) { - if(GetRegRFEType(Adapter) != 64) - pHalData->RFEType = GetRegRFEType(Adapter); + if(( GetRegRFEType(Adapter) != 64)|| 0xFF == PROMContent[EEPROM_RFE_OPTION_8812]) + { + if(GetRegRFEType(Adapter) != 64) + pHalData->RFEType = GetRegRFEType(Adapter); + else + { + if (IS_HARDWARE_TYPE_8812AU(Adapter)) + pHalData->RFEType = 0; + else if (IS_HARDWARE_TYPE_8812E(Adapter)) + pHalData->RFEType = 2; + else + pHalData->RFEType = EEPROM_DEFAULT_RFE_OPTION; + } + + } else if(PROMContent[EEPROM_RFE_OPTION_8812] & BIT7) { if(pHalData->ExternalLNA_5G) @@ -2662,9 +2282,16 @@ Hal_ReadRFEType_8812A( else { if(GetRegRFEType(Adapter) != 64) - pHalData->RFEType = GetRegRFEType(Adapter); + pHalData->RFEType = GetRegRFEType(Adapter); else - pHalData->RFEType = EEPROM_DEFAULT_RFE_OPTION; + { + if (IS_HARDWARE_TYPE_8812AU(Adapter)) + pHalData->RFEType = 0; + else if (IS_HARDWARE_TYPE_8812E(Adapter)) + pHalData->RFEType = 2; + else + pHalData->RFEType = EEPROM_DEFAULT_RFE_OPTION; + } } DBG_871X("RFE Type: 0x%2x\n", pHalData->RFEType); @@ -2881,7 +2508,7 @@ Hal_EfuseReadEFuse8812A( goto exit; } - eFuseWord= (u16 **)rtw_malloc2d(EFUSE_MAX_SECTION_JAGUAR, EFUSE_MAX_WORD_UNIT, sizeof(u16)); + eFuseWord= (u16 **)rtw_malloc2d(EFUSE_MAX_SECTION_JAGUAR, EFUSE_MAX_WORD_UNIT, 2); if(eFuseWord == NULL) { DBG_871X("%s: alloc eFuseWord fail!\n", __FUNCTION__); @@ -2987,7 +2614,22 @@ Hal_EfuseReadEFuse8812A( } } } - + else{//deal with error offset,skip error data + DBG_871X_LEVEL(_drv_always_, "invalid offset:0x%02x \n",offset); + for(i=0; ieeprompriv.efuse_eeprom_data, 0x130) == _FALSE) - { - int i; - DBG_871X("%s compare first 0x130 byte fail\n", __FUNCTION__); - for(i=0;i<512;i++) - { - if(i%16==0) - DBG_871X("0x%03x: ", i); - DBG_871X("%02x ", logical_map[i]); - if(i%16==15) - DBG_871X("\n"); - } - DBG_871X("\n"); - } -#endif } //Do not support BT @@ -3807,7 +3405,7 @@ hal_EfusePgPacketWrite_8812A(IN PADAPTER pAdapter, efuse_addr = efuse_addr + (2*tmp_word_cnts) +1;//next pg packet addr //=========================== target_pkt.offset = offset; - target_pkt.word_en= target_pkt.word_en; + //target_pkt.word_en= target_pkt.word_en; //=========================== #if (EFUSE_ERROE_HANDLE == 1) WriteState=PG_STATE_HEADER; @@ -4040,12 +3638,13 @@ static s32 _halReadPGDataFromFile(PADAPTER padapter, u8 *pbuf) mm_segment_t fs; u8 temp[3]; loff_t pos = 0; + EEPROM_EFUSE_PRIV *pEEPROM = GET_EEPROM_EFUSE_PRIV(padapter); temp[2] = 0; // add end of string '\0' - DBG_8192C("%s: Read Efuse from file [%s]\n", __FUNCTION__, EFUSE_FILE_PATH); - fp = filp_open(EFUSE_FILE_PATH, O_RDONLY, 0); + DBG_8192C("%s: Read Efuse from file [%s]\n", __FUNCTION__, EFUSE_MAP_PATH); + fp = filp_open(EFUSE_MAP_PATH, O_RDONLY, 0); if (IS_ERR(fp)) { DBG_8192C("%s: Error, Read Efuse configure file FAIL!\n", __FUNCTION__); pEEPROM->bloadfile_fail_flag = _TRUE; @@ -4100,7 +3699,7 @@ static s32 _halReadMACAddrFromFile(PADAPTER padapter, u8 *pbuf) _rtw_memset(source_addr, 0, 18); _rtw_memset(pbuf, 0, ETH_ALEN); - fp = filp_open(MAC_ADDRESS_FILE_PATH, O_RDONLY, 0); + fp = filp_open(WIFIMAC_PATH, O_RDONLY, 0); if (IS_ERR(fp)) { ret = _FAIL; @@ -4133,7 +3732,7 @@ static s32 _halReadMACAddrFromFile(PADAPTER padapter, u8 *pbuf) set_fs(fs); filp_close(fp, NULL); - DBG_8192C("%s: Read MAC address from file [%s]\n", __FUNCTION__, MAC_ADDRESS_FILE_PATH); + DBG_8192C("%s: Read MAC address from file [%s]\n", __FUNCTION__, WIFIMAC_PATH); DBG_8192C("WiFi MAC address: " MAC_FMT "\n", MAC_ARG(pbuf)); } @@ -4194,14 +3793,13 @@ void rtl8812_GetHalODMVar( PADAPTER Adapter, HAL_ODM_VARIABLE eVariable, PVOID pValue1, - BOOLEAN bSet) + PVOID pValue2) { HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); PDM_ODM_T podmpriv = &pHalData->odmpriv; switch(eVariable){ - case HAL_ODM_STA_INFO: - break; default: + GetHalODMVar(Adapter,eVariable,pValue1,pValue2); break; } } @@ -4216,32 +3814,8 @@ void rtl8812_SetHalODMVar( PDM_ODM_T podmpriv = &pHalData->odmpriv; //_irqL irqL; switch(eVariable){ - case HAL_ODM_STA_INFO: - { - struct sta_info *psta = (struct sta_info *)pValue1; - if(bSet){ - DBG_8192C("### Set STA_(%d) info\n",psta->mac_id); - ODM_CmnInfoPtrArrayHook(podmpriv, ODM_CMNINFO_STA_STATUS,psta->mac_id,psta); - #if(RATE_ADAPTIVE_SUPPORT==1) - ODM_RAInfo_Init(podmpriv,psta->mac_id); - #endif - } - else{ - DBG_8192C("### Clean STA_(%d) info\n",psta->mac_id); - //_enter_critical_bh(&pHalData->odm_stainfo_lock, &irqL); - ODM_CmnInfoPtrArrayHook(podmpriv, ODM_CMNINFO_STA_STATUS,psta->mac_id,NULL); - - //_exit_critical_bh(&pHalData->odm_stainfo_lock, &irqL); - } - } - break; - case HAL_ODM_P2P_STATE: - ODM_CmnInfoUpdate(podmpriv,ODM_CMNINFO_WIFI_DIRECT,bSet); - break; - case HAL_ODM_WIFI_DISPLAY_STATE: - ODM_CmnInfoUpdate(podmpriv,ODM_CMNINFO_WIFI_DISPLAY,bSet); - break; default: + SetHalODMVar(Adapter,eVariable,pValue1,bSet); break; } } @@ -4392,6 +3966,9 @@ ReadChipVersion8812A( ChipVersion.RFType = RF_TYPE_1T1R;//RF_1T1R; } + if(Adapter->registrypriv.special_rf_path == 1) + ChipVersion.RFType = RF_TYPE_1T1R; //RF_1T1R; + if (IS_HARDWARE_TYPE_8812(Adapter)) ChipVersion.VendorType = ((value32 & VENDOR_ID) ? CHIP_VENDOR_UMC : CHIP_VENDOR_TSMC); else @@ -4519,8 +4096,11 @@ void UpdateHalRAMask8812A(PADAPTER padapter, u32 mac_id, u8 rssi_level) mask &= rate_bitmap; #ifdef CONFIG_BT_COEXIST - rate_bitmap = rtw_btcoex_GetRaMask(padapter); - mask &= ~rate_bitmap; + if (pHalData->EEPROMBluetoothCoexist == 1) + { + rate_bitmap = rtw_btcoex_GetRaMask(padapter); + mask &= ~rate_bitmap; + } #endif // CONFIG_BT_COEXIST arg[0] = mac_id; @@ -4548,6 +4128,18 @@ void InitDefaultValue8821A(PADAPTER padapter) if (!pwrctrlpriv->bkeepfwalive) pHalData->LastHMEBoxNum = 0; + /* hal capability values */ + #ifdef CONFIG_RTL8821A + if(IS_HARDWARE_TYPE_8821(padapter)) { + pHalData->macid_num = MACID_NUM_8821A; + pHalData->cam_entry_num = CAM_ENTRY_NUM_8821A; + } else + #endif + { + pHalData->macid_num = MACID_NUM_8812A; + pHalData->cam_entry_num = CAM_ENTRY_NUM_8812A; + } + // init dm default value pHalData->bChnlBWInitialized = _FALSE; pHalData->odmpriv.RFCalibrateInfo.bIQKInitialized = _FALSE; @@ -4570,8 +4162,20 @@ _InitBeaconParameters_8812A( ) { HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + u16 val16; + u8 val8; - rtw_write16(Adapter, REG_BCN_CTRL, 0x1010); + val8 = DIS_TSF_UDT; + val16 = val8 | (val8 << 8); // port0 and port1 +#ifdef CONFIG_BT_COEXIST + if (pHalData->EEPROMBluetoothCoexist == 1) + { + // Enable prot0 beacon function for PSTDMA + val16 |= EN_BCN_FUNCTION; + } +#endif + rtw_write16(Adapter, REG_BCN_CTRL, val16); + //rtw_write16(Adapter, REG_BCN_CTRL, 0x1010); // TODO: Remove these magic number rtw_write16(Adapter, REG_TBTT_PROHIBIT,0x6404);// ms @@ -4688,6 +4292,102 @@ void SetBeaconRelatedRegisters8812A(PADAPTER padapter) } #ifdef CONFIG_BEAMFORMING +VOID +SetBeamformingCLK_8812( + IN PADAPTER Adapter + ) +{ + struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(Adapter); + u16 u2btmp; + u8 Count = 0, u1btmp; + + DBG_871X(" ==>%s\n", __FUNCTION__); + + if ( (check_fwstate(&Adapter->mlmepriv, _FW_UNDER_SURVEY)==_TRUE) +#ifdef CONFIG_CONCURRENT_MODE + || (check_buddy_fwstate(Adapter, _FW_UNDER_SURVEY) == _TRUE) +#endif + ) + { + DBG_871X(" <==%s return by Scan\n", __FUNCTION__); + return; + } + + // Stop Usb TxDMA + rtw_write_port_cancel(Adapter); + +#ifdef CONFIG_PCI_HCI + // Stop PCIe TxDMA + rtw_write8(Adapter, REG_PCIE_CTRL_REG+1, 0xFE); +#endif + + // Wait TXFF empty + for(Count = 0; Count < 100; Count++) + { + u2btmp = rtw_read16(Adapter, REG_TXPKT_EMPTY); + u2btmp = u2btmp & 0xfff; + if(u2btmp != 0xfff) + { + rtw_mdelay_os(10); + continue; + } + else + break; + } + + DBG_871X(" Tx Empty count %d \n", Count); + + // TX pause + rtw_write8(Adapter, REG_TXPAUSE, 0xFF); + + // Wait TX State Machine OK + for(Count = 0; Count < 100; Count++) + { + if(rtw_read32(Adapter, REG_SCH_TXCMD_8812) != 0) + continue; + else + break; + } + + DBG_871X(" Tx Status count %d \n", Count); + + // Stop RX DMA path + u1btmp = rtw_read8(Adapter, REG_RXDMA_CONTROL_8812); + rtw_write8(Adapter, REG_RXDMA_CONTROL_8812, u1btmp| BIT2); + + for(Count = 0; Count < 100; Count++) + { + u1btmp = rtw_read8(Adapter, REG_RXDMA_CONTROL_8812); + if(u1btmp & BIT1) + break; + else + rtw_mdelay_os(10); + } + + DBG_871X(" Rx Empty count %d \n", Count); + + // Disable clock + rtw_write8(Adapter, REG_SYS_CLKR+1, 0xf0); + // Disable 320M + rtw_write8(Adapter, REG_AFE_PLL_CTRL+3, 0x8); + // Enable 320M + rtw_write8(Adapter, REG_AFE_PLL_CTRL+3, 0xa); + // Enable clock + rtw_write8(Adapter, REG_SYS_CLKR+1, 0xfc); + + // Release Tx pause + rtw_write8(Adapter, REG_TXPAUSE, 0); + + // Enable RX DMA path + u1btmp = rtw_read8(Adapter, REG_RXDMA_CONTROL_8812); + rtw_write8(Adapter, REG_RXDMA_CONTROL_8812, u1btmp & (~ BIT2)); + + // Start Usb TxDMA + RTW_ENABLE_FUNC(Adapter, DF_TX_BIT); + DBG_871X("%s \n", __FUNCTION__); + + DBG_871X("<==%s\n", __FUNCTION__); +} VOID SetBeamformRfMode_8812( @@ -4771,10 +4471,7 @@ SetBeamformEnter_8812( STAid = BeamformEntry.p_aid; // Sounding protocol control - if(IS_NORMAL_CHIP(pHalData->VersionID)) - rtw_write8(Adapter, REG_SND_PTCL_CTRL_8812, 0xCB); - else - rtw_write8(Adapter, REG_SND_PTCL_CTRL_8812, 0x1B); + rtw_write8(Adapter, REG_SND_PTCL_CTRL_8812, 0xCB); // MAC addresss/Partial AID of Beamformer if(Idx == 0) @@ -4841,7 +4538,7 @@ SetBeamformEnter_8812( else { // Set BIT25 - rtw_write16(Adapter, REG_BFMEE_SEL_8812+2, STAid | 0xE2); + rtw_write16(Adapter, REG_BFMEE_SEL_8812+2, STAid | (0xE2 << 8)); } // Timeout value for MAC to leave NDP_RX_standby_state (60 us, Test chip) (80 us, MP chip) @@ -4952,13 +4649,19 @@ SetBeamformFwTxBFCmd_8812( { if(Idx == 0) { - PageNum0 = 0xFD; - Period0 = 6; + if(pBeamInfo->beamforming_entry[Idx].bSound) + PageNum0 = 0xFE; + else + PageNum0 = 0xFF; //stop sounding + Period0 = (u8)(pBeamInfo->beamforming_entry[Idx].sound_period); } else if(Idx == 1) { - PageNum1 = 0xFE; - Period1 = 6; + if(pBeamInfo->beamforming_entry[Idx].bSound) + PageNum1 = 0xFE; + else + PageNum1 = 0xFF; //stop sounding + Period1 = (u8)(pBeamInfo->beamforming_entry[Idx].sound_period); } } } @@ -4968,7 +4671,7 @@ SetBeamformFwTxBFCmd_8812( u1TxBFParm[2] = (Period1 << 4) | Period0; FillH2CCmd_8812(Adapter, H2C_8812_TxBF, 3, u1TxBFParm); - DBG_871X("%s PageNum0 = %d Period0 = %d", __FUNCTION__, PageNum0, Period0); + DBG_871X("%s PageNum0 = %d Period0 = %d\n", __FUNCTION__, PageNum0, Period0); DBG_871X("PageNum1 = %d Period1 %d\n", PageNum1, Period1); } @@ -4985,12 +4688,12 @@ SetBeamformDownloadNDPA_8812( HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); u8 TxPageBndy= LAST_ENTRY_OF_TX_PKT_BUFFER_8812; // default reseved 1 page for the IC type which is undefined. struct beamforming_info *pBeamInfo = GET_BEAMFORM_INFO(&(Adapter->mlmepriv)); - struct beamforming_entry *BeamformEntry = pBeamInfo->beamforming_entry+Idx; + struct beamforming_entry *pBeamEntry = pBeamInfo->beamforming_entry+Idx; //pHalData->bFwDwRsvdPageInProgress = _TRUE; if(Idx == 0) - Head_Page = 0xFD; + Head_Page = 0xFE; else Head_Page = 0xFE; @@ -5000,6 +4703,8 @@ SetBeamformDownloadNDPA_8812( u1bTmp = rtw_read8(Adapter, REG_CR+1); rtw_write8(Adapter, REG_CR+1, (u1bTmp|BIT0)); + pHalData->RegCR_1 |= BIT0; + rtw_write8(Adapter, REG_CR+1, pHalData->RegCR_1); // Set FWHW_TXQ_CTRL 0x422[6]=0 to tell Hw the packet is not a real beacon frame. tmpReg422 = rtw_read8(Adapter, REG_FWHW_TXQ_CTRL+2); @@ -5021,8 +4726,11 @@ SetBeamformDownloadNDPA_8812( rtw_write8(Adapter, REG_TDECTRL+2, (BcnValidReg|BIT0)); // download NDPA rsvd page. - //Beamforming_SendVHTNDPAPacket(Adapter,pBeamEntry->MacAddr,pBeamEntry->AID,pBeamEntry->BW, BEACON_QUEUE); - + if(pBeamEntry->beamforming_entry_cap & BEAMFORMER_CAP_VHT_SU) + beamforming_send_vht_ndpa_packet(Adapter,pBeamEntry->mac_addr,pBeamEntry->aid,pBeamEntry->sound_bw, BCN_QUEUE_INX); + else + beamforming_send_ht_ndpa_packet(Adapter,pBeamEntry->mac_addr,pBeamEntry->sound_bw, BCN_QUEUE_INX); + // check rsvd page download OK. BcnValidReg = rtw_read8(Adapter, REG_TDECTRL+2); count=0; @@ -5056,6 +4764,8 @@ SetBeamformDownloadNDPA_8812( u1bTmp = rtw_read8(Adapter, REG_CR+1); rtw_write8(Adapter, REG_CR+1, (u1bTmp&(~BIT0))); + pBeamEntry->beamforming_entry_state = BEAMFORMING_ENTRY_STATE_PROGRESSED; + //pHalData->bFwDwRsvdPageInProgress = _FALSE; } @@ -5068,7 +4778,7 @@ SetBeamformFwTxBF_8812( struct beamforming_info *pBeamInfo = GET_BEAMFORM_INFO(&(Adapter->mlmepriv)); struct beamforming_entry *pBeamEntry = pBeamInfo->beamforming_entry+Idx; - if(pBeamEntry->beamforming_entry_state == BEAMFORMING_ENTRY_STATE_PROGRESSED) + if(pBeamEntry->beamforming_entry_state == BEAMFORMING_ENTRY_STATE_PROGRESSING) SetBeamformDownloadNDPA_8812(Adapter, Idx); SetBeamformFwTxBFCmd_8812(Adapter); @@ -5100,6 +4810,50 @@ SetBeamformPatch_8812( #endif +static void hw_var_set_monitor(PADAPTER Adapter, u8 variable, u8 *val) +{ + u32 value_rcr, rcr_bits; + u16 value_rxfltmap2; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + struct mlme_priv *pmlmepriv = &(Adapter->mlmepriv); + + if (*((u8 *)val) == _HW_STATE_MONITOR_) { + + /* Leave IPS */ + rtw_pm_set_ips(Adapter, IPS_NONE); + LeaveAllPowerSaveMode(Adapter); + + /* Receive all type */ + rcr_bits = RCR_AAP | RCR_APM | RCR_AM | RCR_AB | RCR_APWRMGT | RCR_ADF | RCR_ACF | RCR_AMF | RCR_APP_PHYST_RXFF; + + /* Append FCS */ + rcr_bits |= RCR_APPFCS; + + #if 0 + /* + CRC and ICV packet will drop in recvbuf2recvframe() + We no turn on it. + */ + rcr_bits |= (RCR_ACRC32 | RCR_AICV); + #endif + + /* Receive all data frames */ + value_rxfltmap2 = 0xFFFF; + + value_rcr = rcr_bits; + rtw_write32(Adapter, REG_RCR, value_rcr); + + rtw_write16(Adapter, REG_RXFLTMAP2, value_rxfltmap2); + + #if 0 + /* tx pause */ + rtw_write8(padapter, REG_TXPAUSE, 0xFF); + #endif + } else { + /* do nothing */ + } + +} static void hw_var_set_opmode(PADAPTER Adapter, u8 variable, u8* val) { @@ -5107,6 +4861,19 @@ static void hw_var_set_opmode(PADAPTER Adapter, u8 variable, u8* val) u8 mode = *((u8 *)val); u32 value_rcr; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + + /* reset RCR */ + rtw_write32(Adapter, REG_RCR, pHalData->ReceiveConfig); + + if (mode == _HW_STATE_MONITOR_) { + /* set net_type */ + Set_MSR(Adapter, _HW_STATE_NOLINK_); + + hw_var_set_monitor(Adapter, variable, val); + return; + } + #ifdef CONFIG_CONCURRENT_MODE if(Adapter->iface_type == IFACE_PORT1) { @@ -5182,8 +4949,6 @@ static void hw_var_set_opmode(PADAPTER Adapter, u8 variable, u8* val) //enable to rx data frame rtw_write16(Adapter, REG_RXFLTMAP2, 0xFFFF); - //enable to rx ps-poll - rtw_write16(Adapter, REG_RXFLTMAP1, 0x0400); //Beacon Control related register for first time rtw_write8(Adapter, REG_BCNDMATIM, 0x02); // 2ms @@ -5305,8 +5070,6 @@ static void hw_var_set_opmode(PADAPTER Adapter, u8 variable, u8* val) //enable to rx data frame rtw_write16(Adapter, REG_RXFLTMAP2, 0xFFFF); - //enable to rx ps-poll - rtw_write16(Adapter, REG_RXFLTMAP1, 0x0400); //Beacon Control related register for first time rtw_write8(Adapter, REG_BCNDMATIM, 0x02); // 2ms @@ -5369,7 +5132,7 @@ static void hw_var_set_macaddr(PADAPTER Adapter, u8 variable, u8* val) for(idx = 0 ; idx < 6; idx++) { - rtw_write8(Adapter, (reg_macid+idx), val[idx]); + rtw_write8(GET_PRIMARY_ADAPTER(Adapter), (reg_macid+idx), val[idx]); } } @@ -5400,7 +5163,7 @@ static void hw_var_set_bssid(PADAPTER Adapter, u8 variable, u8* val) static void hw_var_set_bcn_func(PADAPTER Adapter, u8 variable, u8* val) { u32 bcn_ctrl_reg; - + u8 val8; #ifdef CONFIG_CONCURRENT_MODE if(Adapter->iface_type == IFACE_PORT1) { @@ -5418,7 +5181,22 @@ static void hw_var_set_bcn_func(PADAPTER Adapter, u8 variable, u8* val) } else { - rtw_write8(Adapter, bcn_ctrl_reg, rtw_read8(Adapter, bcn_ctrl_reg)&(~(EN_BCN_FUNCTION | EN_TXBCN_RPT))); + + u8 val8; + val8 = rtw_read8(Adapter, bcn_ctrl_reg); + val8 &= ~(EN_BCN_FUNCTION | EN_TXBCN_RPT); + +#ifdef CONFIG_BT_COEXIST + if (GET_HAL_DATA(Adapter)->EEPROMBluetoothCoexist == 1) + { + // Always enable port0 beacon function for PSTDMA + if (REG_BCN_CTRL == bcn_ctrl_reg) + val8 |= EN_BCN_FUNCTION; + } +#endif + + rtw_write8(Adapter, bcn_ctrl_reg, val8); + //rtw_write8(Adapter, bcn_ctrl_reg, rtw_read8(Adapter, bcn_ctrl_reg)&(~(EN_BCN_FUNCTION | EN_TXBCN_RPT))); } @@ -5567,7 +5345,7 @@ static void hw_var_set_mlme_sitesurvey(PADAPTER Adapter, u8 variable, u8* val) rcr_clear_bit = (RCR_CBSSID_BCN | RCR_CBSSID_DATA); - // Recieve all data frames + /* Receive all data frames */ value_rxfltmap2 = 0xFFFF; #else /* CONFIG_FIND_BEST_CHANNEL */ @@ -5783,37 +5561,46 @@ _func_enter_; break; case HW_VAR_BASIC_RATE: + { + struct mlme_ext_info *mlmext_info = &padapter->mlmeextpriv.mlmext_info; + u16 input_b = 0, masked = 0, ioted = 0, BrateCfg = 0; + u16 rrsr_2g_force_mask = (RRSR_11M|RRSR_5_5M|RRSR_1M); + u16 rrsr_2g_allow_mask = (RRSR_24M|RRSR_12M|RRSR_6M|RRSR_CCK_RATES); + u16 rrsr_5g_force_mask = (RRSR_6M); + u16 rrsr_5g_allow_mask = (RRSR_OFDM_RATES); + + HalSetBrateCfg(padapter, pval, &BrateCfg); + input_b = BrateCfg; + + /* apply force and allow mask */ + if(pHalData->CurrentBandType == BAND_ON_2_4G) { - u16 BrateCfg = 0; - u8 RateIndex = 0; + BrateCfg |= rrsr_2g_force_mask; + BrateCfg &= rrsr_2g_allow_mask; + } + else // 5G + { + BrateCfg |= rrsr_5g_force_mask; + BrateCfg &= rrsr_5g_allow_mask; + } + masked = BrateCfg; - // 2007.01.16, by Emily - // Select RRSR (in Legacy-OFDM and CCK) - // For 8190, we select only 24M, 12M, 6M, 11M, 5.5M, 2M, and 1M from the Basic rate. - // We do not use other rates. - HalSetBrateCfg(padapter, pval, &BrateCfg); + /* IOT consideration */ + if (mlmext_info->assoc_AP_vendor == HT_IOT_PEER_CISCO) { + /* if peer is cisco and didn't use ofdm rate, we enable 6M ack */ + if((BrateCfg & (RRSR_24M|RRSR_12M|RRSR_6M)) == 0) + BrateCfg |= RRSR_6M; + } + ioted = BrateCfg; - if(pHalData->CurrentBandType == BAND_ON_2_4G) - { - //CCK 2M ACK should be disabled for some BCM and Atheros AP IOT - //because CCK 2M has poor TXEVM - //CCK 5.5M & 11M ACK should be enabled for better performance + pHalData->BasicRateSet = BrateCfg; - pHalData->BasicRateSet = BrateCfg = (BrateCfg |0xd) & 0x15d; - BrateCfg |= 0x01; // default enable 1M ACK rate - } - else // 5G - { - pHalData->BasicRateSet &= 0xFF0; - BrateCfg |= 0x10; // default enable 6M ACK rate - } -// DBG_8192C("HW_VAR_BASIC_RATE: BrateCfg(%#x)\n", BrateCfg); + DBG_8192C("HW_VAR_BASIC_RATE: %#x -> %#x -> %#x\n", input_b, masked, ioted); - // Set RRSR rate table. - rtw_write8(padapter, REG_RRSR, BrateCfg&0xff); - rtw_write8(padapter, REG_RRSR+1, (BrateCfg>>8)&0xff); - rtw_write8(padapter, REG_RRSR+2, rtw_read8(padapter, REG_RRSR+2)&0xf0); - } + // Set RRSR rate table. + rtw_write16(padapter, REG_RRSR, BrateCfg); + rtw_write8(padapter, REG_RRSR+2, rtw_read8(padapter, REG_RRSR+2)&0xf0); + } break; case HW_VAR_TXPAUSE: @@ -5901,7 +5688,8 @@ _func_enter_; hw_var_set_mlme_sitesurvey(padapter, variable, pval); #ifdef CONFIG_BT_COEXIST - rtw_btcoex_ScanNotify(padapter, *pval?_TRUE:_FALSE); + if (_TRUE == pHalData->EEPROMBluetoothCoexist) + rtw_btcoex_ScanNotify(padapter, *pval?_TRUE:_FALSE); #endif break; @@ -5960,20 +5748,23 @@ _func_enter_; #endif // !CONFIG_CONCURRENT_MODE #ifdef CONFIG_BT_COEXIST - switch (*pval) + if (_TRUE == pHalData->EEPROMBluetoothCoexist) { - case 0: - // prepare to join - rtw_btcoex_ConnectNotify(padapter, _TRUE); - break; - case 1: - // joinbss_event callback when join res < 0 - rtw_btcoex_ConnectNotify(padapter, _FALSE); - break; - case 2: - // sta add event callback -// rtw_btcoex_MediaStatusNotify(padapter, RT_MEDIA_CONNECT); - break; + switch (*pval) + { + case 0: + // prepare to join + rtw_btcoex_ConnectNotify(padapter, _TRUE); + break; + case 1: + // joinbss_event callback when join res < 0 + rtw_btcoex_ConnectNotify(padapter, _FALSE); + break; + case 2: + // sta add event callback + // rtw_btcoex_MediaStatusNotify(padapter, RT_MEDIA_CONNECT); + break; + } } #endif break; @@ -6039,16 +5830,6 @@ _func_enter_; } break; - case HW_VAR_SEC_CFG: -#ifdef CONFIG_CONCURRENT_MODE - // enable tx enc and rx dec engine, and no key search for MC/BC - val8 = 0x0c | BIT(5); -#else - val8 = *pval; -#endif - rtw_write8(padapter, REG_SECCFG, val8); - break; - case HW_VAR_CAM_EMPTY_ENTRY: { u8 ucIndex = *pval; @@ -6146,11 +5927,6 @@ _func_enter_; rtw_write8(padapter, REG_ACMHWCTRL, AcmCtrl ); } break; - - case HW_VAR_AMPDU_MIN_SPACE: - pHalData->AMPDUDensity = *(u8*)pval; - break; - case HW_VAR_AMPDU_FACTOR: { u32 AMPDULen = *(u8*)pval; @@ -6209,29 +5985,6 @@ _func_enter_; rtw_write32(padapter, REG_RCR, val32); break; - case HW_VAR_TDLS_INIT_CH_SEN: - val32 = rtw_read32(padapter, REG_RCR); - val32 &= (~RCR_CBSSID_DATA) & (~RCR_CBSSID_BCN); - rtw_write32(padapter, REG_RCR, val32); - rtw_write16(padapter, REG_RXFLTMAP2, 0xffff); - - // disable update TSF - val8 = rtw_read8(padapter, REG_BCN_CTRL); - val8 |= BIT(4); - rtw_write8(padapter, REG_BCN_CTRL, val8); - break; - - case HW_VAR_TDLS_DONE_CH_SEN: - // enable update TSF - val8 = rtw_read8(padapter, REG_BCN_CTRL); - val8 &= ~BIT(4); - rtw_write8(padapter, REG_BCN_CTRL, val8); - - val32 = rtw_read32(padapter, REG_RCR); - val32 |= RCR_CBSSID_BCN; - rtw_write32(padapter, REG_RCR, val32); - break; - case HW_VAR_TDLS_RS_RCR: val32 = rtw_read32(padapter, REG_RCR); val32 |= RCR_CBSSID_DATA; @@ -6239,39 +5992,6 @@ _func_enter_; break; #endif // CONFIG_TDLS - case HW_VAR_INITIAL_GAIN: - { - pDIG_T pDigTable = &podmpriv->DM_DigTable; - u32 rx_gain = *(u32*)pval; - - if (rx_gain == 0xff) {//restore rx gain - ODM_Write_DIG(podmpriv, pDigTable->BackupIGValue); - } else { - pDigTable->BackupIGValue = pDigTable->CurIGValue; - ODM_Write_DIG(podmpriv, rx_gain); - } - } - break; - -#if defined(CONFIG_BT_COEXIST) && 0 - case HW_VAR_BT_SET_COEXIST: - rtl8812_set_dm_bt_coexist(padapter, *pval); - break; - - case HW_VAR_BT_ISSUE_DELBA: - rtl8812_issue_delete_ba(padapter, *pval); - break; -#endif - -#if (RATE_ADAPTIVE_SUPPORT==1) - case HW_VAR_RPT_TIMER_SETTING: - { - val16 = *(u16*)pval; - ODM_RA_Set_TxRPT_Time(podmpriv, val16); - } - break; -#endif - #ifdef CONFIG_SW_ANTENNA_DIVERSITY case HW_VAR_ANTENNA_DIVERSITY_LINK: //SwAntDivRestAfterLink8192C(padapter); @@ -6288,7 +6008,7 @@ _func_enter_; if (pHalData->CurAntenna != Optimum_antenna) { Ant = (Optimum_antenna==2) ? MAIN_ANT : AUX_ANT; - ODM_UpdateRxIdleAnt_88E(podmpriv, Ant); + ODM_UpdateRxIdleAnt(podmpriv, Ant); pHalData->CurAntenna = Optimum_antenna; //DBG_8192C("==> HW_VAR_ANTENNA_DIVERSITY_SELECT , Ant_(%s)\n",(Optimum_antenna==2)?"A":"B"); @@ -6371,7 +6091,9 @@ _func_enter_; val16 = retry_limit << RETRY_LIMIT_SHORT_SHIFT | retry_limit << RETRY_LIMIT_LONG_SHIFT; rtw_write16(padapter, REG_RL, val16); - while (rtw_get_passing_time_ms(start) < 2000) { + while (rtw_get_passing_time_ms(start) < 2000 + && !padapter->bDriverStopped && !padapter->bSurpriseRemoved + ) { reg_200 = rtw_read32(padapter, 0x200); reg_204 = rtw_read32(padapter, 0x204); @@ -6391,7 +6113,8 @@ _func_enter_; pass_ms = rtw_get_passing_time_ms(start); - if (pass_ms >= 2000 || (reg_200 & 0x00ffffff) != (reg_204 & 0x00ffffff)) { + if (padapter->bDriverStopped || padapter->bSurpriseRemoved) { + } else if (pass_ms >= 2000 || (reg_200 & 0x00ffffff) != (reg_204 & 0x00ffffff)) { DBG_871X_LEVEL(_drv_always_, "%s:(HW_VAR_CHECK_TXBUF)NOT empty(%d) in %d ms\n", __FUNCTION__, i, pass_ms); DBG_871X_LEVEL(_drv_always_, "%s:(HW_VAR_CHECK_TXBUF)0x200=0x%08x, 0x204=0x%08x (0x%08x, 0x%08x)\n", __FUNCTION__, reg_200, reg_204, init_reg_200, init_reg_204); @@ -6405,17 +6128,6 @@ _func_enter_; rtw_write16(padapter, REG_RL, val16); } break; - -#if (RATE_ADAPTIVE_SUPPORT == 1) - case HW_VAR_TX_RPT_MAX_MACID: - { - u8 maxMacid = *pval; - DBG_8192C("### MacID(%d),Set Max Tx RPT MID(%d)\n", maxMacid, maxMacid+1); - rtw_write8(padapter, REG_TX_RPT_CTRL+1, maxMacid+1); - } - break; -#endif - case HW_VAR_H2C_MEDIA_STATUS_RPT: { struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -6455,9 +6167,9 @@ _func_enter_; #ifdef CONFIG_CONCURRENT_MODE if (IS_HARDWARE_TYPE_8821(padapter) && padapter->iface_type == IFACE_PORT1) { - val8 = rtw_read8(padapter, REG_TDECTRL1_8812+2); + val8 = rtw_read8(padapter, REG_DWBCN1_CTRL_8812+2); val8 |= BIT(0); - rtw_write8(padapter, REG_TDECTRL1_8812+2, val8); + rtw_write8(padapter, REG_DWBCN1_CTRL_8812+2, val8); } else #endif @@ -6474,17 +6186,17 @@ _func_enter_; if (IS_HARDWARE_TYPE_8821(padapter) && padapter->iface_type == IFACE_PORT1) { // SW_BCN_SEL - Port1 - val8 = rtw_read8(padapter, REG_TDECTRL1_8812+2); + val8 = rtw_read8(padapter, REG_DWBCN1_CTRL_8812+2); val8 |= BIT(4); - rtw_write8(padapter, REG_TDECTRL1_8812+2, val8); + rtw_write8(padapter, REG_DWBCN1_CTRL_8812+2, val8); } else #endif { // SW_BCN_SEL - Port0 - val8 = rtw_read8(padapter, REG_TDECTRL1_8812+2); + val8 = rtw_read8(padapter, REG_DWBCN1_CTRL_8812+2); val8 &= ~BIT(4); - rtw_write8(padapter, REG_TDECTRL1_8812+2, val8); + rtw_write8(padapter, REG_DWBCN1_CTRL_8812+2, val8); } break; @@ -6539,14 +6251,26 @@ _func_enter_; case HW_VAR_DO_IQK: pHalData->bNeedIQK = _TRUE; break; - + case HW_VAR_DL_RSVD_PAGE: +#ifdef CONFIG_BT_COEXIST + if (pHalData->EEPROMBluetoothCoexist == 1) + { + if (check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE) == _TRUE) + { + rtl8812a_download_BTCoex_AP_mode_rsvd_page(padapter); + } + } +#endif // CONFIG_BT_COEXIST + break; #ifdef CONFIG_BEAMFORMING case HW_VAR_SOUNDING_ENTER: SetBeamformEnter_8812(padapter, *pval); break; + case HW_VAR_SOUNDING_LEAVE: SetBeamformLeave_8812(padapter, *pval); break; + case HW_VAR_SOUNDING_RATE: rtw_write8(padapter, REG_NDPA_OPT_CTRL_8812, (MRateToHwRate(pval[1]) << 2 | pval[0]) ); break; @@ -6555,8 +6279,101 @@ _func_enter_; SetBeamformStatus_8812(padapter, *pval); break; + case HW_VAR_SOUNDING_FW_NDPA: + SetBeamformFwTxBF_8812(padapter, *pval); + break; + case HW_VAR_SOUNDING_CLK: - //_Beamforming_CLK(padapter); + SetBeamformingCLK_8812(padapter); + break; +#endif + + case HW_VAR_MACID_SLEEP: + { + u32 reg_macid_sleep; + u8 bit_shift; + u8 id = *(u8*)pval; + u32 val32; + + if (id < 32) { + reg_macid_sleep = REG_MACID_SLEEP; + bit_shift = id; + } else if (id < 64) { + reg_macid_sleep = REG_MACID_SLEEP_1; + bit_shift = id-32; + } else if (id < 96) { + reg_macid_sleep = REG_MACID_SLEEP_2; + bit_shift = id-64; + } else if (id < 128) { + reg_macid_sleep = REG_MACID_SLEEP_3; + bit_shift = id-96; + } else { + rtw_warn_on(1); + break; + } + + val32 = rtw_read32(padapter, reg_macid_sleep); + DBG_8192C(FUNC_ADPT_FMT ": [HW_VAR_MACID_SLEEP] macid=%d, org reg_0x%03x=0x%08X\n", + FUNC_ADPT_ARG(padapter), id, reg_macid_sleep, val32); + + if (val32 & BIT(bit_shift)) + break; + + val32 |= BIT(bit_shift); + rtw_write32(padapter, reg_macid_sleep, val32); + } + break; + + case HW_VAR_MACID_WAKEUP: + { + u32 reg_macid_sleep; + u8 bit_shift; + u8 id = *(u8*)pval; + u32 val32; + + if (id < 32) { + reg_macid_sleep = REG_MACID_SLEEP; + bit_shift = id; + } else if (id < 64) { + reg_macid_sleep = REG_MACID_SLEEP_1; + bit_shift = id-32; + } else if (id < 96) { + reg_macid_sleep = REG_MACID_SLEEP_2; + bit_shift = id-64; + } else if (id < 128) { + reg_macid_sleep = REG_MACID_SLEEP_3; + bit_shift = id-96; + } else { + rtw_warn_on(1); + break; + } + + val32 = rtw_read32(padapter, reg_macid_sleep); + DBG_8192C(FUNC_ADPT_FMT ": [HW_VAR_MACID_WAKEUP] macid=%d, org reg_0x%03x=0x%08X\n", + FUNC_ADPT_ARG(padapter), id, reg_macid_sleep, val32); + + if (!(val32 & BIT(bit_shift))) + break; + + val32 &= ~BIT(bit_shift); + rtw_write32(padapter, reg_macid_sleep, val32); + } + break; +#ifdef CONFIG_GPIO_WAKEUP + case HW_SET_GPIO_WL_CTRL: + { + u8 enable = *pval; + u8 value = rtw_read8(padapter, 0x4e); + if (enable && (value & BIT(6))) { + value &= ~BIT(6); + rtw_write8(padapter, 0x4e, value); + } else if (enable == _FALSE){ + value |= BIT(6); + rtw_write8(padapter, 0x4e, value); + } + DBG_871X("%s: set WL control, 0x4E=0x%02X\n", + __func__, rtw_read8(padapter, 0x4e)); + } break; #endif default: @@ -6567,6 +6384,74 @@ _func_enter_; _func_exit_; } +struct qinfo_8812a { + u32 head:8; + u32 pkt_num:7; + u32 tail:8; + u32 ac:2; + u32 macid:7; +}; + +struct bcn_qinfo_8812a { + u16 head:8; + u16 pkt_num:8; +}; + +void dump_qinfo_8812a(void *sel, struct qinfo_8812a *info, const char *tag) +{ + //if (info->pkt_num) + DBG_871X_SEL_NL(sel, "%shead:0x%02x, tail:0x%02x, pkt_num:%u, macid:%u, ac:%u\n" + , tag ? tag : "", info->head, info->tail, info->pkt_num, info->macid, info->ac + ); +} + +void dump_bcn_qinfo_8812a(void *sel, struct bcn_qinfo_8812a *info, const char *tag) +{ + //if (info->pkt_num) + DBG_871X_SEL_NL(sel, "%shead:0x%02x, pkt_num:%u\n" + , tag ? tag : "", info->head, info->pkt_num + ); +} + +void dump_mac_qinfo_8812a(void *sel, _adapter *adapter) +{ + u32 q0_info; + u32 q1_info; + u32 q2_info; + u32 q3_info; + u32 q4_info; + u32 q5_info; + u32 q6_info; + u32 q7_info; + u32 mg_q_info; + u32 hi_q_info; + u16 bcn_q_info; + + q0_info = rtw_read32(adapter, REG_Q0_INFO); + q1_info = rtw_read32(adapter, REG_Q1_INFO); + q2_info = rtw_read32(adapter, REG_Q2_INFO); + q3_info = rtw_read32(adapter, REG_Q3_INFO); + q4_info = rtw_read32(adapter, REG_Q4_INFO); + q5_info = rtw_read32(adapter, REG_Q5_INFO); + q6_info = rtw_read32(adapter, REG_Q6_INFO); + q7_info = rtw_read32(adapter, REG_Q7_INFO); + mg_q_info = rtw_read32(adapter, REG_MGQ_INFO); + hi_q_info = rtw_read32(adapter, REG_HGQ_INFO); + bcn_q_info = rtw_read16(adapter, REG_BCNQ_INFO); + + dump_qinfo_8812a(sel, (struct qinfo_8812a *)&q0_info, "Q0 "); + dump_qinfo_8812a(sel, (struct qinfo_8812a *)&q1_info, "Q1 "); + dump_qinfo_8812a(sel, (struct qinfo_8812a *)&q2_info, "Q2 "); + dump_qinfo_8812a(sel, (struct qinfo_8812a *)&q3_info, "Q3 "); + dump_qinfo_8812a(sel, (struct qinfo_8812a *)&q4_info, "Q4 "); + dump_qinfo_8812a(sel, (struct qinfo_8812a *)&q5_info, "Q5 "); + dump_qinfo_8812a(sel, (struct qinfo_8812a *)&q6_info, "Q6 "); + dump_qinfo_8812a(sel, (struct qinfo_8812a *)&q7_info, "Q7 "); + dump_qinfo_8812a(sel, (struct qinfo_8812a *)&mg_q_info, "MG "); + dump_qinfo_8812a(sel, (struct qinfo_8812a *)&hi_q_info, "HI "); + dump_bcn_qinfo_8812a(sel, (struct bcn_qinfo_8812a *)&bcn_q_info, "BCN "); +} + void GetHwReg8812A(PADAPTER padapter, u8 variable, u8 *pval) { PHAL_DATA_TYPE pHalData; @@ -6590,7 +6475,7 @@ _func_enter_; #ifdef CONFIG_CONCURRENT_MODE if (IS_HARDWARE_TYPE_8821(padapter) && padapter->iface_type == IFACE_PORT1) { - val8 = rtw_read8(padapter, REG_TDECTRL1_8812+2); + val8 = rtw_read8(padapter, REG_DWBCN1_CTRL_8812+2); *pval = (BIT(0) & val8) ? _TRUE:_FALSE; } else @@ -6642,6 +6527,10 @@ _func_enter_; *pval = (val16 & BIT(10)) ? _TRUE:_FALSE; break; + case HW_VAR_DUMP_MAC_QUEUE_INFO: + dump_mac_qinfo_8812a(pval, padapter); + break; + default: GetHwReg(padapter, variable, pval); break; @@ -6665,13 +6554,6 @@ u8 SetHalDefVar8812A(PADAPTER padapter, HAL_DEF_VARIABLE variable, void *pval) switch (variable) { - case HAL_DEF_DBG_DUMP_RXPKT: - pHalData->bDumpRxPkt = *(u8*)pval; - break; - - case HAL_DEF_DBG_DUMP_TXPKT: - pHalData->bDumpTxPkt = *(u8*)pval; - break; default: bResult = SetHalDefVar(padapter, variable, pval); break; @@ -6695,21 +6577,7 @@ u8 GetHalDefVar8812A(PADAPTER padapter, HAL_DEF_VARIABLE variable, void *pval) switch (variable) { - case HAL_DEF_UNDERCORATEDSMOOTHEDPWDB: - { - struct mlme_priv *pmlmepriv; - struct sta_priv *pstapriv; - struct sta_info *psta; - - pmlmepriv = &padapter->mlmepriv; - pstapriv = &padapter->stapriv; - psta = rtw_get_stainfo(pstapriv, pmlmepriv->cur_network.network.MacAddress); - if (psta) - { - *((int*)pval) = psta->rssi_stat.UndecoratedSmoothedPWDB; - } - } - break; + #ifdef CONFIG_ANTENNA_DIVERSITY case HAL_DEF_IS_SUPPORT_ANT_DIV: @@ -6734,30 +6602,6 @@ u8 GetHalDefVar8812A(PADAPTER padapter, HAL_DEF_VARIABLE variable, void *pval) case HAL_DEF_RX_PACKET_OFFSET: *((u32*)pval) = RXDESC_SIZE + DRVINFO_SZ*8; break; -#if (RATE_ADAPTIVE_SUPPORT == 1) - case HAL_DEF_RA_DECISION_RATE: - { - u8 MacID = *(u8*)pval; - *((u8*)pval) = ODM_RA_GetDecisionRate_8812A(&pHalData->odmpriv, MacID); - } - break; - - case HAL_DEF_RA_SGI: - { - u8 MacID = *(u8*)pval; - *((u8*)pval) = ODM_RA_GetShortGI_8812A(&pHalData->odmpriv, MacID); - } - break; -#endif // (RATE_ADAPTIVE_SUPPORT == 1) - -#if (POWER_TRAINING_ACTIVE == 1) - case HAL_DEF_PT_PWR_STATUS: - { - u8 MacID = *(u8*)pval; - *(u8*)pval = ODM_RA_GetHwPwrStatus_8812A(&pHalData->odmpriv, MacID); - } - break; -#endif //(POWER_TRAINING_ACTIVE == 1) case HW_VAR_MAX_RX_AMPDU_FACTOR: *((u32*)pval) = MAX_AMPDU_FACTOR_64K; @@ -6809,56 +6653,48 @@ u8 GetHalDefVar8812A(PADAPTER padapter, HAL_DEF_VARIABLE variable, void *pval) u32 cmd ; u32 ra_info1, ra_info2; u32 rate_mask1, rate_mask2; - - if ((padapter->bLinkInfoDump & BIT(0)) - && (check_fwstate(&padapter->mlmepriv, _FW_LINKED) == _TRUE)) - { - DBG_8192C("============ RA status check Mac_id:%d ===================\n", mac_id); - - cmd = 0x40000100 |mac_id; - rtw_write32(padapter,REG_HMEBOX_E2_E3_8812,cmd); - rtw_msleep_os(10); - ra_info1 = rtw_read32(padapter,REG_RSVD5_8812); - DBG_8192C("[ ra_info1:0x%08x ] =>cur_rate= 0x%02x, PWRSTS = 0x%02x \n", - ra_info1, - ra_info1&0xFF, - (ra_info1>>8) & 0x07); - - cmd = 0x40000400 | mac_id; - rtw_write32(padapter, REG_HMEBOX_E2_E3_8812,cmd); - rtw_msleep_os(10); - ra_info1 = rtw_read32(padapter, REG_RSVD5_8812); - ra_info2 = rtw_read32(padapter, REG_RSVD6_8812); - rate_mask1 = rtw_read32(padapter,REG_RSVD7_8812); - rate_mask2 = rtw_read32(padapter,REG_RSVD8_8812); - - DBG_8192C("[ ra_info1:0x%08x ] =>RSSI=%d, BW_setting=0x%02x, DISRA=0x%02x, VHT_EN=0x%02x\n", - ra_info1, - ra_info1&0xFF, - (ra_info1>>8) & 0xFF, - (ra_info1>>16) & 0xFF, - (ra_info1>>24) & 0xFF); + u8 curr_tx_rate,curr_tx_sgi,hight_rate,lowest_rate; + + DBG_8192C("============ RA status check Mac_id:%d ===================\n", mac_id); + + cmd = 0x40000100 |mac_id; + rtw_write32(padapter,REG_HMEBOX_E2_E3_8812,cmd); + rtw_msleep_os(10); + ra_info1 = rtw_read32(padapter,REG_RSVD5_8812); + curr_tx_rate = ra_info1&0x7F; + curr_tx_sgi = (ra_info1>>7)&0x01; + DBG_8192C("[ ra_info1:0x%08x ] =>cur_tx_rate= %s,cur_sgi:%d, PWRSTS = 0x%02x \n", + ra_info1, + HDATA_RATE(curr_tx_rate), + curr_tx_sgi, + (ra_info1>>8) & 0x07); + + cmd = 0x40000400 | mac_id; + rtw_write32(padapter, REG_HMEBOX_E2_E3_8812,cmd); + rtw_msleep_os(10); + ra_info1 = rtw_read32(padapter, REG_RSVD5_8812); + ra_info2 = rtw_read32(padapter, REG_RSVD6_8812); + rate_mask1 = rtw_read32(padapter,REG_RSVD7_8812); + rate_mask2 = rtw_read32(padapter,REG_RSVD8_8812); + hight_rate = ra_info2&0xFF; + lowest_rate = (ra_info2>>8) & 0xFF; + DBG_8192C("[ ra_info1:0x%08x ] =>RSSI=%d, BW_setting=0x%02x, DISRA=0x%02x, VHT_EN=0x%02x\n", + ra_info1, + ra_info1&0xFF, + (ra_info1>>8) & 0xFF, + (ra_info1>>16) & 0xFF, + (ra_info1>>24) & 0xFF); - DBG_8192C("[ ra_info2:0x%08x ] =>hight_rate=0x%02x, lowest_rate=0x%02x, SGI=0x%02x, RateID=%d\n", - ra_info2, - ra_info2&0xFF, - (ra_info2>>8) & 0xFF, - (ra_info2>>16) & 0xFF, - (ra_info2>>24) & 0xFF); - - DBG_8192C("rate_mask2=0x%08x, rate_mask1=0x%08x\n", rate_mask2, rate_mask1); - } + DBG_8192C("[ ra_info2:0x%08x ] =>hight_rate=%s, lowest_rate=%s, SGI=0x%02x, RateID=%d\n", + ra_info2, + HDATA_RATE(hight_rate), + HDATA_RATE(lowest_rate), + (ra_info2>>16) & 0xFF, + (ra_info2>>24) & 0xFF); + DBG_8192C("rate_mask2=0x%08x, rate_mask1=0x%08x\n", rate_mask2, rate_mask1); } break; - case HAL_DEF_DBG_DUMP_RXPKT: - *(u8*)pval = pHalData->bDumpRxPkt; - break; - - case HAL_DEF_DBG_DUMP_TXPKT: - *(u8*)pval = pHalData->bDumpTxPkt; - break; - case HAL_DEF_TX_PAGE_SIZE: if (IS_HARDWARE_TYPE_8812(padapter)) *(u32*)pval = PAGE_SIZE_512; @@ -6887,6 +6723,10 @@ u8 GetHalDefVar8812A(PADAPTER padapter, HAL_DEF_VARIABLE variable, void *pval) *(u8*)pval = TX_PAGE_BOUNDARY_WOWLAN_8812; break; + case HAL_DEF_MACID_SLEEP: + *(u8*)pval = _TRUE; // support macid sleep + break; + default: bResult = GetHalDefVar(padapter, variable, pval); break; @@ -6894,7 +6734,6 @@ u8 GetHalDefVar8812A(PADAPTER padapter, HAL_DEF_VARIABLE variable, void *pval) return bResult; } - s32 c2h_id_filter_ccx_8812a(u8 *buf) { struct c2h_evt_hdr_88xx *c2h_evt = (struct c2h_evt_hdr_88xx *)buf; @@ -6922,6 +6761,60 @@ static s32 c2h_handler_8812a(PADAPTER padapter, u8 *buf) return ret; } +#ifdef CONFIG_BT_COEXIST +void rtl8812a_combo_card_WifiOnlyHwInit(PADAPTER pdapter) +{ + u8 u1Tmp; + DBG_871X("%s !\n", __FUNCTION__); + if(IS_HARDWARE_TYPE_8812(pdapter)) + { + //0x790[5:0]=0x5 + u1Tmp = rtw_read8(pdapter,0x790); + u1Tmp = (u1Tmp & 0xb0) | 0x05 ; + rtw_write8(pdapter,0x790,u1Tmp); + // PTA parameter + //pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cc, 0x0); + //pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c8, 0xffffff); + //pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c4, 0x55555555); + //pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c0, 0x55555555); + rtw_write8(pdapter,0x6cc,0x0); + rtw_write32(pdapter,0x6c8,0xffffff); + rtw_write32(pdapter,0x6c4,0x55555555); + rtw_write32(pdapter,0x6c0,0x55555555); + + // coex parameters + //pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x778, 0x3); + rtw_write8(pdapter,0x778,0x3); + + // enable counter statistics + //pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0xc); + rtw_write8(pdapter,0x76e,0xc); + + // enable PTA + //pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x40, 0x20); + rtw_write8(pdapter,0x40, 0x20); + + // bt clock related + //u1Tmp = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x4); + //u1Tmp |= BIT7; + //pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x4, u1Tmp); + u1Tmp = rtw_read8(pdapter,0x4); + u1Tmp |= BIT7; + rtw_write8(pdapter,0x4, u1Tmp); + + // bt clock related + //u1Tmp = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x7); + //u1Tmp |= BIT1; + //pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x7, u1Tmp); + u1Tmp = rtw_read8(pdapter,0x7); + u1Tmp |= BIT1; + rtw_write8(pdapter,0x7, u1Tmp); + } + + +} +#endif //CONFIG_BT_COEXIST + void rtl8812_set_hal_ops(struct hal_ops *pHalFunc) { pHalFunc->free_hal_data = &rtl8812_free_hal_data; @@ -6988,9 +6881,12 @@ void rtl8812_set_hal_ops(struct hal_ops *pHalFunc) pHalFunc->c2h_handler = c2h_handler_8812a; pHalFunc->c2h_id_filter_ccx = c2h_id_filter_ccx_8812a; -#ifdef CONFIG_BT_COEXIST pHalFunc->fill_h2c_cmd = &FillH2CCmd_8812; -#endif // CONFIG_BT_COEXIST + pHalFunc->fill_fake_txdesc = &rtl8812a_fill_fake_txdesc; +#ifdef CONFIG_WOWLAN + pHalFunc->hal_set_wowlan_fw = &SetFwRelatedForWoWLAN8812; +#endif + pHalFunc->hal_get_tx_buff_rsvd_page_num = &GetTxBufferRsvdPageNum8812; } diff --git a/backports/drivers/realtek/rtl8812au/hal/rtl8812a/rtl8812a_mp.c b/backports/drivers/realtek/rtl8812au/hal/rtl8812a/rtl8812a_mp.c index a76e62bfd9b544..f7a0944331992a 100755 --- a/backports/drivers/realtek/rtl8812au/hal/rtl8812a/rtl8812a_mp.c +++ b/backports/drivers/realtek/rtl8812au/hal/rtl8812a/rtl8812a_mp.c @@ -261,10 +261,13 @@ void Hal_MPT_CCKTxPowerAdjustbyIndex(PADAPTER pAdapter, BOOLEAN beven) } } - if (Action == 1) + if (Action == 1) { + if (CCK_index_old == 0) + CCK_index_old = 1; CCK_index = CCK_index_old - 1; - else + } else { CCK_index = CCK_index_old + 1; + } if (CCK_index == CCK_TABLE_SIZE) { CCK_index = CCK_TABLE_SIZE -1; @@ -327,21 +330,12 @@ void Hal_SetChannel(PADAPTER pAdapter) u8 channel = pmp->channel; u8 bandwidth = pmp->bandwidth; - u8 rate = pmp->rateidx; - - - // set RF channel register - for (eRFPath = 0; eRFPath < pHalData->NumTotalRFPath; eRFPath++) - { - if(IS_HARDWARE_TYPE_8192D(pAdapter)) - _write_rfreg(pAdapter, eRFPath, ODM_CHANNEL, 0xFF, channel); - else - _write_rfreg(pAdapter, eRFPath, ODM_CHANNEL, 0x3FF, channel); - } - //Hal_mpt_SwitchRfSetting(pAdapter); - - SelectChannel(pAdapter, channel); - + + pHalData->bSwChnl = _TRUE; + //SelectChannel(pAdapter, channel); + PHY_SwChnl8812(pAdapter, channel); + //PHY_HandleSwChnlAndSetBW8812(pAdapter, _TRUE, _FALSE, channel, bandwidth, 0, 0, channel); + //set_channel_bwmode(pAdapter, pAdapter->mppriv.channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, pAdapter->mppriv.bandwidth); if (pHalData->CurrentChannel == 14 && !pDM_Odm->RFCalibrateInfo.bCCKinCH14) { pDM_Odm->RFCalibrateInfo.bCCKinCH14 = _TRUE; Hal_MPT_CCKTxPowerAdjust(pAdapter, pDM_Odm->RFCalibrateInfo.bCCKinCH14); @@ -361,10 +355,15 @@ void Hal_SetChannel(PADAPTER pAdapter) void Hal_SetBandwidth(PADAPTER pAdapter) { struct mp_priv *pmp = &pAdapter->mppriv; + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); + + u8 channel = pmp->channel; + u8 bandwidth = pmp->bandwidth; + pHalData->bSetChnlBW=_TRUE; - SetBWMode(pAdapter, pmp->bandwidth, pmp->prime_channel_offset); - //Hal_mpt_SwitchRfSetting(pAdapter); + PHY_SetSwChnlBWMode8812(pAdapter, channel, bandwidth, 0, 0 ); + //SetBWMode(pAdapter, pmp->bandwidth, pmp->prime_channel_offset); } void Hal_SetCCKTxPower(PADAPTER pAdapter, u8 *TxPower) @@ -375,12 +374,12 @@ void Hal_SetCCKTxPower(PADAPTER pAdapter, u8 *TxPower) // rf-A cck tx power write_bbreg(pAdapter, rTxAGC_A_CCK1_Mcs32, bMaskByte1, TxPower[RF_PATH_A]); tmpval = (TxPower[RF_PATH_A]<<16) | (TxPower[RF_PATH_A]<<8) | TxPower[RF_PATH_A]; - write_bbreg(pAdapter, rTxAGC_B_CCK11_A_CCK2_11, 0xffffff00, tmpval); + write_bbreg(pAdapter, rTxAGC_B_CCK11_A_CCK2_11, bMaskH3Bytes, tmpval); // rf-B cck tx power write_bbreg(pAdapter, rTxAGC_B_CCK11_A_CCK2_11, bMaskByte0, TxPower[RF_PATH_B]); tmpval = (TxPower[RF_PATH_B]<<16) | (TxPower[RF_PATH_B]<<8) | TxPower[RF_PATH_B]; - write_bbreg(pAdapter, rTxAGC_B_CCK1_55_Mcs32, 0xffffff00, tmpval); + write_bbreg(pAdapter, rTxAGC_B_CCK1_55_Mcs32, bMaskH3Bytes, tmpval); RT_TRACE(_module_mp_, _drv_notice_, ("-SetCCKTxPower: A[0x%02x] B[0x%02x]\n", @@ -711,7 +710,7 @@ s32 Hal_SetThermalMeter(PADAPTER pAdapter, u8 target_ther) void Hal_TriggerRFThermalMeter(PADAPTER pAdapter) { - _write_rfreg( pAdapter, RF_PATH_A , RF_T_METER_8812A , BIT17 |BIT16 , 0x03 ); + PHY_SetRFReg(pAdapter, ODM_RF_PATH_A, RF_T_METER_8812A, BIT17 | BIT16, 0x03); // RT_TRACE(_module_mp_,_drv_alert_, ("TriggerRFThermalMeter() finished.\n" )); } @@ -809,13 +808,13 @@ void Hal_SetSingleToneTx(PADAPTER pAdapter, u8 bStart) { case ANTENNA_A: default: - rfPath = RF_PATH_A; + pMptCtx->MptRfPath = rfPath = RF_PATH_A; break; case ANTENNA_B: - rfPath = RF_PATH_B; + pMptCtx->MptRfPath = rfPath = RF_PATH_B; break; case ANTENNA_C: - rfPath = RF_PATH_C; + pMptCtx->MptRfPath = rfPath = RF_PATH_C; break; } @@ -824,7 +823,7 @@ void Hal_SetSingleToneTx(PADAPTER pAdapter, u8 bStart) { if (IS_HARDWARE_TYPE_JAGUAR(pAdapter)) { - u1Byte p = ODM_RF_PATH_A; + u1Byte p = ODM_RF_PATH_A; regRF0x0 = PHY_QueryRFReg(pAdapter, ODM_RF_PATH_A, RF_AC_Jaguar, bRFRegOffsetMask); reg0xCB0 = PHY_QueryBBReg(pAdapter, rA_RFE_Pinmux_Jaguar, bMaskDWord); diff --git a/backports/drivers/realtek/rtl8812au/hal/rtl8812a/rtl8812a_phycfg.c b/backports/drivers/realtek/rtl8812au/hal/rtl8812a/rtl8812a_phycfg.c index 243aaf7d73afbc..811cc642c93900 100755 --- a/backports/drivers/realtek/rtl8812au/hal/rtl8812a/rtl8812a_phycfg.c +++ b/backports/drivers/realtek/rtl8812au/hal/rtl8812a/rtl8812a_phycfg.c @@ -125,9 +125,9 @@ phy_RFSerialRead( Offset &= 0xff; if (eRFPath == RF_PATH_A) - bIsPIMode = (BOOLEAN)PHY_QueryBBReg(Adapter, 0xC00, 0x4); + bIsPIMode = (BOOLEAN)PHY_QueryBBReg(Adapter, 0xC00, 0x4); else if (eRFPath == RF_PATH_B) - bIsPIMode = (BOOLEAN)PHY_QueryBBReg(Adapter, 0xE00, 0x4); + bIsPIMode = (BOOLEAN)PHY_QueryBBReg(Adapter, 0xE00, 0x4); PHY_SetBBReg(Adapter, pPhyReg->rfHSSIPara2, bHSSIRead_addr_Jaguar, Offset); @@ -1282,9 +1282,56 @@ void phy_SetBBSwingByBand_8812A( } } + +VOID +phy_SetRFEReg8821( + IN PADAPTER Adapter, + IN u1Byte Band +) +{ + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); + + if(Band == BAND_ON_2_4G) + { + // Turn off RF PA and LNA + PHY_SetBBReg(Adapter, rA_RFE_Pinmux_Jaguar, 0xF000, 0x7); // 0xCB0[15:12] = 0x7 (LNA_On) + PHY_SetBBReg(Adapter, rA_RFE_Pinmux_Jaguar, 0xF0, 0x7); // 0xCB0[7:4] = 0x7 (PAPE_A) + + if (pHalData->ExternalLNA_2G) { + // <20131223, VincentL> Turn on 2.4G External LNA (Asked by Luke Lee & Alex Wang) + PHY_SetBBReg(Adapter, rA_RFE_Inv_Jaguar, BIT20, 1); // 0xCB4 = 0x10100077; + PHY_SetBBReg(Adapter, rA_RFE_Inv_Jaguar, BIT22, 0); // 0xCB4 = 0x10100077; + PHY_SetBBReg(Adapter, rA_RFE_Pinmux_Jaguar, BIT2|BIT1|BIT0, 0x2); // 0xCB0[2:0] = b'010 + PHY_SetBBReg(Adapter, rA_RFE_Pinmux_Jaguar, BIT10|BIT9|BIT8, 0x2); // 0xCB0[10:8] = b'010 + + }else{ + // <20131223, VincentL> Bypass 2.4G External LNA (Asked by Luke Lee & Alex Wang) + PHY_SetBBReg(Adapter, rA_RFE_Inv_Jaguar, BIT20, 0); // 0xCB4 = 0x10000077; + PHY_SetBBReg(Adapter, rA_RFE_Inv_Jaguar, BIT22, 0); // 0xCB4 = 0x10000077; + PHY_SetBBReg(Adapter, rA_RFE_Pinmux_Jaguar, BIT2|BIT1|BIT0, 0x7); // 0xCB0[2:0] = b'111 + PHY_SetBBReg(Adapter, rA_RFE_Pinmux_Jaguar, BIT10|BIT9|BIT8, 0x7); // 0xCB0[10:8] = b'111 + } + } + else + { + // Turn ON RF PA and LNA + PHY_SetBBReg(Adapter, rA_RFE_Pinmux_Jaguar, 0xF000, 0x5); // 0xCB0[15:12] = 0x5 (LNA_On) + PHY_SetBBReg(Adapter, rA_RFE_Pinmux_Jaguar, 0xF0, 0x4); // 0xCB0[7:4] = 0x4 (PAPE_A) + + // <20131223, VincentL> Bypass 2.4G External LNA (Asked by Luke Lee & Alex Wang) + PHY_SetBBReg(Adapter, rA_RFE_Inv_Jaguar, BIT20, 0); // 0xCB4 = 0x10000077; + PHY_SetBBReg(Adapter, rA_RFE_Inv_Jaguar, BIT22, 0); // 0xCB4 = 0x10000077; + PHY_SetBBReg(Adapter, rA_RFE_Pinmux_Jaguar, BIT2|BIT1|BIT0, 0x7); // 0xCB0[2:0] = b'111 + PHY_SetBBReg(Adapter, rA_RFE_Pinmux_Jaguar, BIT10|BIT9|BIT8, 0x7); // 0xCB0[10:8] = b'111 + + } +} + + + s32 PHY_SwitchWirelessBand8812( - IN PADAPTER Adapter, + IN PADAPTER Adapter, IN u8 Band ) { @@ -1298,28 +1345,17 @@ PHY_SwitchWirelessBand8812( if(Band == BAND_ON_2_4G) {// 2.4G band - // STOP Tx/Rx - PHY_SetBBReg(Adapter, rOFDMCCKEN_Jaguar, bOFDMEN_Jaguar|bCCKEN_Jaguar, 0x00); - + PHY_SetBBReg(Adapter, rOFDMCCKEN_Jaguar, bOFDMEN_Jaguar|bCCKEN_Jaguar, 0x03); + if (IS_HARDWARE_TYPE_8821(Adapter)) - { - // Turn off RF PA and LNA - PHY_SetBBReg(Adapter, rA_RFE_Pinmux_Jaguar, 0xF000, 0x7); // 0xCB0[15:12] = 0x7 (LNA_On) - PHY_SetBBReg(Adapter, rA_RFE_Pinmux_Jaguar, 0xF0, 0x7); // 0xCB0[7:4] = 0x7 (PAPE_A) - - if (pHalData->ExternalLNA_2G) { - // <20130717, Kordan> Turn on 2.4G External LNA. (Asked by Alvin) - PHY_SetBBReg(Adapter, rA_RFE_Inv_Jaguar, BIT20, 1); - PHY_SetBBReg(Adapter, rA_RFE_Inv_Jaguar, BIT22, 0); - PHY_SetBBReg(Adapter, rA_RFE_Pinmux_Jaguar, BIT2|BIT1|BIT0, 0x2); // 0xCB0[2:0] = b'010 - PHY_SetBBReg(Adapter, rA_RFE_Pinmux_Jaguar, BIT10|BIT9|BIT8, 0x2); // 0xCB0[10:8] = b'010 - } - } + phy_SetRFEReg8821(Adapter, Band); if(IS_HARDWARE_TYPE_8812(Adapter)) { - PHY_SetBBReg(Adapter,rPwed_TH_Jaguar, 0xE, 0x4); // 0x830[3:1] = 0x4 - PHY_SetBBReg(Adapter,rBWIndication_Jaguar,0x3,0x1); // 0x834[1:0] = 0x1 + // <20131128, VincentL> Remove 0x830[3:1] setting when switching 2G/5G, requested by Yn. + PHY_SetBBReg(Adapter,rBWIndication_Jaguar,0x3,0x1); // 0x834[1:0] = 0x1 + //BB Yn user guide R27 + PHY_SetBBReg(Adapter,rPwed_TH_Jaguar, BIT13|BIT14|BIT15|BIT16|BIT17, 0x17); //0x830[17:13]=5'b10111 } // AGC table select @@ -1329,60 +1365,27 @@ PHY_SwitchWirelessBand8812( PHY_SetBBReg(Adapter, rAGC_table_Jaguar, 0x3, 0); // 0x82C[1:0] = 2b'00 if(IS_HARDWARE_TYPE_8812(Adapter)) + phy_SetRFEReg8812(Adapter, Band); + + // <20131106, Kordan> Workaround to fix CCK FA for scan issue. + //if( pHalData->bMPMode == FALSE) + if(Adapter->registrypriv.mp_mode==0) { - if(GetRegbENRFEType(Adapter)) - phy_SetRFEReg8812(Adapter, Band); - else - { - // PAPE_A (bypass RFE module in 2G) - PHY_SetBBReg(Adapter, rA_RFE_Pinmux_Jaguar, 0x000000F0, 0x7); - PHY_SetBBReg(Adapter, rB_RFE_Pinmux_Jaguar, 0x000000F0, 0x7); - - // PAPE_G (bypass RFE module in 5G) - if (pHalData->ExternalPA_2G) { - PHY_SetBBReg(Adapter, rA_RFE_Pinmux_Jaguar, 0x0000000F, 0x0); - PHY_SetBBReg(Adapter, rB_RFE_Pinmux_Jaguar, 0x0000000F, 0x0); - } else { - PHY_SetBBReg(Adapter, rA_RFE_Pinmux_Jaguar, 0x0000000F, 0x7); - PHY_SetBBReg(Adapter, rB_RFE_Pinmux_Jaguar, 0x0000000F, 0x7); - } - - // TRSW bypass RFE moudle in 2G - if (pHalData->ExternalLNA_2G) { - PHY_SetBBReg(Adapter, rA_RFE_Pinmux_Jaguar, bMaskByte2, 0x54); - PHY_SetBBReg(Adapter, rB_RFE_Pinmux_Jaguar, bMaskByte2, 0x54); - } else { - PHY_SetBBReg(Adapter, rA_RFE_Pinmux_Jaguar, bMaskByte2, 0x77); - PHY_SetBBReg(Adapter, rB_RFE_Pinmux_Jaguar, bMaskByte2, 0x77); - } - } + PHY_SetBBReg(Adapter, rTxPath_Jaguar, 0xf0, 0x1); + PHY_SetBBReg(Adapter, rCCK_RX_Jaguar, 0x0f000000, 0x1); } update_tx_basic_rate(Adapter, WIRELESS_11BG); - // cck_enable - PHY_SetBBReg(Adapter, rOFDMCCKEN_Jaguar, bOFDMEN_Jaguar|bCCKEN_Jaguar, 0x3); - // CCK_CHECK_en rtw_write8(Adapter, REG_CCK_CHECK_8812, 0x0); } else //5G band { - u16 count = 0, reg41A = 0; + u16 count = 0, reg41A = 0; if (IS_HARDWARE_TYPE_8821(Adapter)) - { - PHY_SetBBReg(Adapter, rA_RFE_Pinmux_Jaguar, 0xF000, 0x5); // 0xCB0[15:12] = 0x5 (LNA_On) - PHY_SetBBReg(Adapter, rA_RFE_Pinmux_Jaguar, 0xF0, 0x4); // 0xCB0[7:4] = 0x4 (PAPE_A) - - if (pHalData->ExternalLNA_2G) { - // <20130717, Kordan> Bypass the 2.4G External LNA. (Asked by Alvin) - PHY_SetBBReg(Adapter, rA_RFE_Inv_Jaguar, BIT20, 0); - PHY_SetBBReg(Adapter, rA_RFE_Inv_Jaguar, BIT22, 0); - PHY_SetBBReg(Adapter, rA_RFE_Pinmux_Jaguar, BIT2|BIT1|BIT0, 0x7); // 0xCB0[2:0] = b'111 - PHY_SetBBReg(Adapter, rA_RFE_Pinmux_Jaguar, BIT10|BIT9|BIT8, 0x7); // 0xCB0[10:8] = b'111 - } - } + phy_SetRFEReg8821(Adapter, Band); // CCK_CHECK_en rtw_write8(Adapter, REG_CCK_CHECK_8812, 0x80); @@ -1404,63 +1407,49 @@ PHY_SwitchWirelessBand8812( if(count != 0) DBG_871X("PHY_SwitchWirelessBand8812(): Switch to 5G Band. Count = %d reg41A=0x%x\n", count, reg41A); - // STOP Tx/Rx - PHY_SetBBReg(Adapter, rOFDMCCKEN_Jaguar, bOFDMEN_Jaguar|bCCKEN_Jaguar, 0x00); - + // 2012/02/01, Sinda add registry to switch workaround without long-run verification for scan issue. + if(Adapter->registrypriv.mp_mode==0) + PHY_SetBBReg(Adapter, rOFDMCCKEN_Jaguar, bOFDMEN_Jaguar|bCCKEN_Jaguar, 0x03); + if(IS_HARDWARE_TYPE_8812(Adapter)) { - PHY_SetBBReg(Adapter,rPwed_TH_Jaguar, 0xE, 0x3); // 0x830[3:1] = 0x3 - PHY_SetBBReg(Adapter,rBWIndication_Jaguar,0x3,0x2); // 0x834[1:0] = 0x2 + // <20131128, VincentL> Remove 0x830[3:1] setting when switching 2G/5G, requested by Yn. + PHY_SetBBReg(Adapter,rBWIndication_Jaguar,0x3,0x2); // 0x834[1:0] = 0x2 + //BB Yn user guide R27 + PHY_SetBBReg(Adapter,rPwed_TH_Jaguar, BIT13|BIT14|BIT15|BIT16|BIT17, 0x15); //0x830[17:13]=5'b10101 } // AGC table select if (IS_VENDOR_8821A_MP_CHIP(Adapter)) - PHY_SetBBReg(Adapter, rA_TxScale_Jaguar, 0xF00, 1); // 0xC1C[11:8] = 1 + PHY_SetBBReg(Adapter, rA_TxScale_Jaguar, 0xF00, 1); // 0xC1C[11:8] = 1 else PHY_SetBBReg(Adapter, rAGC_table_Jaguar, 0x3, 1); // 0x82C[1:0] = 2'b00 if(IS_HARDWARE_TYPE_8812(Adapter)) + phy_SetRFEReg8812(Adapter, Band); + + // <20131106, Kordan> Workaround to fix CCK FA for scan issue. + //if( pHalData->bMPMode == FALSE) + if(Adapter->registrypriv.mp_mode==0) { - if(GetRegbENRFEType(Adapter)) - phy_SetRFEReg8812(Adapter, Band); - else - { - // PAPE_A (bypass RFE module in 2G) - if (pHalData->ExternalPA_5G) { - PHY_SetBBReg(Adapter, rA_RFE_Pinmux_Jaguar, 0x000000F0, 0x1); - PHY_SetBBReg(Adapter, rB_RFE_Pinmux_Jaguar, 0x000000F0, 0x1); - } else { - PHY_SetBBReg(Adapter, rA_RFE_Pinmux_Jaguar, 0x000000F0, 0x0); - PHY_SetBBReg(Adapter, rB_RFE_Pinmux_Jaguar, 0x000000F0, 0x0); - } - - // PAPE_G (bypass RFE module in 5G) - PHY_SetBBReg(Adapter, rA_RFE_Pinmux_Jaguar, 0x0000000F, 0x7); - PHY_SetBBReg(Adapter, rB_RFE_Pinmux_Jaguar, 0x0000000F, 0x7); - - // TRSW bypass RFE moudle in 2G - if (pHalData->ExternalLNA_5G) { - PHY_SetBBReg(Adapter, rA_RFE_Pinmux_Jaguar, bMaskByte2, 0x54); - PHY_SetBBReg(Adapter, rB_RFE_Pinmux_Jaguar, bMaskByte2, 0x54); - } else { - PHY_SetBBReg(Adapter, rA_RFE_Pinmux_Jaguar, bMaskByte2, 0x77); - PHY_SetBBReg(Adapter, rB_RFE_Pinmux_Jaguar, bMaskByte2, 0x77); - } - } + PHY_SetBBReg(Adapter, rTxPath_Jaguar, 0xf0, 0x0); + PHY_SetBBReg(Adapter, rCCK_RX_Jaguar, 0x0f000000, 0xF); } - + else + { + // cck_enable + PHY_SetBBReg(Adapter, rOFDMCCKEN_Jaguar, bOFDMEN_Jaguar|bCCKEN_Jaguar, 0x02); + } + //avoid using cck rate in 5G band // Set RRSR rate table. update_tx_basic_rate(Adapter, WIRELESS_11A); - // cck_enable - PHY_SetBBReg(Adapter, rOFDMCCKEN_Jaguar, bOFDMEN_Jaguar|bCCKEN_Jaguar, 0x2); //DBG_871X("==>PHY_SwitchWirelessBand8812() BAND_ON_5G settings OFDM index 0x%x\n", pHalData->OFDM_index[RF_PATH_A]); - } + } phy_SetBBSwingByBand_8812A(Adapter, Band, currentBand); - //DBG_871X("<==PHY_SwitchWirelessBand8812():Switch Band OK.\n"); return _SUCCESS; } @@ -1923,7 +1912,7 @@ phy_SwChnlAndSetBwMode8812( ) { HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - + PDM_ODM_T pDM_Odm = &pHalData->odmpriv; //DBG_871X("phy_SwChnlAndSetBwMode8812(): bSwChnl %d, bSetChnlBW %d \n", pHalData->bSwChnl, pHalData->bSetChnlBW); if ( Adapter->bNotifyChannelChange ) { @@ -1973,7 +1962,7 @@ phy_SwChnlAndSetBwMode8812( else if(IS_HARDWARE_TYPE_8821(Adapter)) { #if (RTL8821A_SUPPORT == 1) - PHY_IQCalibrate_8821A(Adapter, _FALSE); + PHY_IQCalibrate_8821A(pDM_Odm, _FALSE); #endif } pHalData->bNeedIQK = _FALSE; diff --git a/backports/drivers/realtek/rtl8812au/hal/rtl8812a/rtl8812a_rxdesc.c b/backports/drivers/realtek/rtl8812au/hal/rtl8812a/rtl8812a_rxdesc.c index f40edb0be61cbd..ae31da503aeaa3 100755 --- a/backports/drivers/realtek/rtl8812au/hal/rtl8812a/rtl8812a_rxdesc.c +++ b/backports/drivers/realtek/rtl8812au/hal/rtl8812a/rtl8812a_rxdesc.c @@ -22,159 +22,6 @@ //#include #include -static s32 translate2dbm(u8 signal_strength_idx) -{ - s32 signal_power; // in dBm. - - - // Translate to dBm (x=0.5y-95). - signal_power = (s32)((signal_strength_idx + 1) >> 1); - signal_power -= 95; - - return signal_power; -} - - -static void process_rssi(_adapter *padapter,union recv_frame *prframe) -{ - u32 last_rssi, tmp_val; - struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib; -#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS - struct signal_stat * signal_stat = &padapter->recvpriv.signal_strength_data; -#endif //CONFIG_NEW_SIGNAL_STAT_PROCESS - - //DBG_8192C("process_rssi=> pattrib->rssil(%d) signal_strength(%d)\n ",pattrib->RecvSignalPower,pattrib->signal_strength); - //if(pRfd->Status.bPacketToSelf || pRfd->Status.bPacketBeacon) - { - - #ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS - if(signal_stat->update_req) { - signal_stat->total_num = 0; - signal_stat->total_val = 0; - signal_stat->update_req = 0; - } - - signal_stat->total_num++; - signal_stat->total_val += pattrib->phy_info.SignalStrength; - signal_stat->avg_val = signal_stat->total_val / signal_stat->total_num; - #else //CONFIG_NEW_SIGNAL_STAT_PROCESS - - //Adapter->RxStats.RssiCalculateCnt++; //For antenna Test - if(padapter->recvpriv.signal_strength_data.total_num++ >= PHY_RSSI_SLID_WIN_MAX) - { - padapter->recvpriv.signal_strength_data.total_num = PHY_RSSI_SLID_WIN_MAX; - last_rssi = padapter->recvpriv.signal_strength_data.elements[padapter->recvpriv.signal_strength_data.index]; - padapter->recvpriv.signal_strength_data.total_val -= last_rssi; - } - padapter->recvpriv.signal_strength_data.total_val +=pattrib->phy_info.SignalStrength; - - padapter->recvpriv.signal_strength_data.elements[padapter->recvpriv.signal_strength_data.index++] = pattrib->phy_info.SignalStrength; - if(padapter->recvpriv.signal_strength_data.index >= PHY_RSSI_SLID_WIN_MAX) - padapter->recvpriv.signal_strength_data.index = 0; - - - tmp_val = padapter->recvpriv.signal_strength_data.total_val/padapter->recvpriv.signal_strength_data.total_num; - - if(padapter->recvpriv.is_signal_dbg) { - padapter->recvpriv.signal_strength= padapter->recvpriv.signal_strength_dbg; - padapter->recvpriv.rssi=(s8)translate2dbm((u8)padapter->recvpriv.signal_strength_dbg); - } else { - padapter->recvpriv.signal_strength= tmp_val; - padapter->recvpriv.rssi=(s8)translate2dbm((u8)tmp_val); - } - - RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("UI RSSI = %d, ui_rssi.TotalVal = %d, ui_rssi.TotalNum = %d\n", tmp_val, padapter->recvpriv.signal_strength_data.total_val,padapter->recvpriv.signal_strength_data.total_num)); - #endif //CONFIG_NEW_SIGNAL_STAT_PROCESS - } - -}// Process_UI_RSSI_8192C - - - -static void process_link_qual(_adapter *padapter,union recv_frame *prframe) -{ - u32 last_evm=0, tmpVal; - struct rx_pkt_attrib *pattrib; -#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS - struct signal_stat * signal_stat; -#endif //CONFIG_NEW_SIGNAL_STAT_PROCESS - - if(prframe == NULL || padapter==NULL){ - return; - } - - pattrib = &prframe->u.hdr.attrib; -#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS - signal_stat = &padapter->recvpriv.signal_qual_data; -#endif //CONFIG_NEW_SIGNAL_STAT_PROCESS - - //DBG_8192C("process_link_qual=> pattrib->signal_qual(%d)\n ",pattrib->signal_qual); - -#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS - if(signal_stat->update_req) { - signal_stat->total_num = 0; - signal_stat->total_val = 0; - signal_stat->update_req = 0; - } - - signal_stat->total_num++; - signal_stat->total_val += pattrib->phy_info.SignalQuality; - signal_stat->avg_val = signal_stat->total_val / signal_stat->total_num; - -#else //CONFIG_NEW_SIGNAL_STAT_PROCESS - if(pattrib->phy_info.SignalQuality != 0) - { - // - // 1. Record the general EVM to the sliding window. - // - if(padapter->recvpriv.signal_qual_data.total_num++ >= PHY_LINKQUALITY_SLID_WIN_MAX) - { - padapter->recvpriv.signal_qual_data.total_num = PHY_LINKQUALITY_SLID_WIN_MAX; - last_evm = padapter->recvpriv.signal_qual_data.elements[padapter->recvpriv.signal_qual_data.index]; - padapter->recvpriv.signal_qual_data.total_val -= last_evm; - } - padapter->recvpriv.signal_qual_data.total_val += pattrib->phy_info.SignalQuality; - - padapter->recvpriv.signal_qual_data.elements[padapter->recvpriv.signal_qual_data.index++] = pattrib->phy_info.SignalQuality; - if(padapter->recvpriv.signal_qual_data.index >= PHY_LINKQUALITY_SLID_WIN_MAX) - padapter->recvpriv.signal_qual_data.index = 0; - - RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("Total SQ=%d pattrib->signal_qual= %d\n", padapter->recvpriv.signal_qual_data.total_val, pattrib->phy_info.SignalQuality)); - - // <1> Showed on UI for user, in percentage. - tmpVal = padapter->recvpriv.signal_qual_data.total_val/padapter->recvpriv.signal_qual_data.total_num; - padapter->recvpriv.signal_qual=(u8)tmpVal; - - } - else - { - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,(" pattrib->signal_qual =%d\n", pattrib->phy_info.SignalQuality)); - } -#endif //CONFIG_NEW_SIGNAL_STAT_PROCESS - -} - -static void process_phy_info(_adapter *padapter, void *prframe) -{ - union recv_frame *precvframe = (union recv_frame *)prframe; - - // - // Check RSSI - // - process_rssi(padapter, precvframe); - // - // Check PWDB. - // - //process_PWDB(padapter, precvframe); - - //UpdateRxSignalStatistics8192C(Adapter, pRfd); - // - // Check EVM - // - process_link_qual(padapter, precvframe); - -} - void rtl8812_query_rx_desc_status(union recv_frame *precvframe, u8 *pdesc) { struct rx_pkt_attrib *pattrib = &precvframe->u.hdr.attrib; @@ -209,98 +56,13 @@ void rtl8812_query_rx_desc_status(union recv_frame *precvframe, u8 *pdesc) //Offset 12 pattrib->data_rate=(u8)GET_RX_STATUS_DESC_RX_RATE_8812(pdesc);//((le32_to_cpu(pdesc->rxdw3))&0x7f); - //Offset 16 - //Offset 20 - -} - - -/* - * Notice: - * Before calling this function, - * precvframe->u.hdr.rx_data should be ready! - */ -void rtl8812_query_rx_phy_status( - union recv_frame *precvframe, - u8 *pphy_status) -{ - PADAPTER padapter = precvframe->u.hdr.adapter; - struct rx_pkt_attrib *pattrib = &precvframe->u.hdr.attrib; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); - PODM_PHY_INFO_T pPHYInfo = (PODM_PHY_INFO_T)(&pattrib->phy_info); - u8 *wlanhdr; - ODM_PACKET_INFO_T pkt_info; - u8 *sa = NULL; - struct sta_priv *pstapriv; - struct sta_info *psta; - //_irqL irqL; - - pkt_info.bPacketMatchBSSID =_FALSE; - pkt_info.bPacketToSelf = _FALSE; - pkt_info.bPacketBeacon = _FALSE; - - wlanhdr = get_recvframe_data(precvframe); - - pkt_info.bPacketMatchBSSID = ((!IsFrameTypeCtrl(wlanhdr)) && - !pattrib->icv_err && !pattrib->crc_err && - _rtw_memcmp(get_hdr_bssid(wlanhdr), get_bssid(&padapter->mlmepriv), ETH_ALEN)); - - pkt_info.bPacketToSelf = pkt_info.bPacketMatchBSSID && (_rtw_memcmp(get_ra(wlanhdr), myid(&padapter->eeprompriv), ETH_ALEN)); - - pkt_info.bPacketBeacon = pkt_info.bPacketMatchBSSID && (GetFrameSubType(wlanhdr) == WIFI_BEACON); - - if(pkt_info.bPacketBeacon){ - if(check_fwstate(&padapter->mlmepriv, WIFI_STATION_STATE) == _TRUE){ - sa = padapter->mlmepriv.cur_network.network.MacAddress; - #if 0 - { - DBG_8192C("==> rx beacon from AP[%02x:%02x:%02x:%02x:%02x:%02x]\n", - sa[0],sa[1],sa[2],sa[3],sa[4],sa[5]); - } - #endif - } - //to do Ad-hoc - } - else{ - sa = get_sa(wlanhdr); - } - - pstapriv = &padapter->stapriv; - pkt_info.StationID = 0xFF; - psta = rtw_get_stainfo(pstapriv, sa); - if (psta) - { - pkt_info.StationID = psta->mac_id; - //DBG_8192C("%s ==> StationID(%d)\n",__FUNCTION__,pkt_info.StationID); - } - pkt_info.DataRate = pattrib->data_rate; - //rtl8188e_query_rx_phy_status(precvframe, pphy_status); - - //_enter_critical_bh(&pHalData->odm_stainfo_lock, &irqL); - ODM_PhyStatusQuery(&pHalData->odmpriv,pPHYInfo,pphy_status,&(pkt_info)); - //_exit_critical_bh(&pHalData->odm_stainfo_lock, &irqL); + /* Offset 16 */ + pattrib->sgi = (u8)GET_RX_STATUS_DESC_SPLCP_8812(pdesc); + pattrib->ldpc = (u8)GET_RX_STATUS_DESC_LDPC_8812(pdesc); + pattrib->stbc = (u8)GET_RX_STATUS_DESC_STBC_8812(pdesc); + pattrib->bw = (u8)GET_RX_STATUS_DESC_BW_8812(pdesc); - precvframe->u.hdr.psta = NULL; - if (pkt_info.bPacketMatchBSSID && - (check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE) == _TRUE)) - { - if (psta) - { - precvframe->u.hdr.psta = psta; - process_phy_info(padapter, precvframe); - - } - } - else if (pkt_info.bPacketToSelf || pkt_info.bPacketBeacon) - { - if (check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE|WIFI_ADHOC_MASTER_STATE) == _TRUE) - { - if (psta) - { - precvframe->u.hdr.psta = psta; - } - } - process_phy_info(padapter, precvframe); - } + /* Offset 20 */ + /* pattrib->tsfl=(u8)GET_RX_STATUS_DESC_TSFL_8812(pdesc); */ } diff --git a/backports/drivers/realtek/rtl8812au/hal/rtl8812a/rtl8812a_sreset.c b/backports/drivers/realtek/rtl8812au/hal/rtl8812a/rtl8812a_sreset.c index 0ab5222ac16b55..2acbc15a52af09 100755 --- a/backports/drivers/realtek/rtl8812au/hal/rtl8812a/rtl8812a_sreset.c +++ b/backports/drivers/realtek/rtl8812au/hal/rtl8812a/rtl8812a_sreset.c @@ -54,7 +54,7 @@ void rtl8812_sreset_xmit_status_check(_adapter *padapter) else{ diff_time = rtw_get_passing_time_ms(psrtpriv->last_tx_complete_time); if (diff_time > 4000) { - u32 ability; + u32 ability = 0; //padapter->Wifi_Error_Status = WIFI_TX_HANG; rtw_hal_get_hwreg(padapter, HW_VAR_DM_FLAG, (u8*)&ability); diff --git a/backports/drivers/realtek/rtl8812au/hal/rtl8812a/rtl8812a_xmit.c b/backports/drivers/realtek/rtl8812au/hal/rtl8812a/rtl8812a_xmit.c index 516e23af5fa71b..a8f19fc23c404e 100755 --- a/backports/drivers/realtek/rtl8812au/hal/rtl8812a/rtl8812a_xmit.c +++ b/backports/drivers/realtek/rtl8812au/hal/rtl8812a/rtl8812a_xmit.c @@ -284,7 +284,8 @@ void rtl8812a_fill_fake_txdesc( u8* pDesc, u32 BufferLen, u8 IsPsPoll, - u8 IsBTQosNull) + u8 IsBTQosNull, + u8 bDataFrame) { struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; @@ -324,7 +325,36 @@ void rtl8812a_fill_fake_txdesc( SET_TX_DESC_USE_RATE_8812(pDesc, 1); SET_TX_DESC_OWN_8812(pDesc, 1); - + + // + // Encrypt the data frame if under security mode excepct null data. Suggested by CCW. + // + if (_TRUE ==bDataFrame) + { + u32 EncAlg; + + EncAlg = padapter->securitypriv.dot11PrivacyAlgrthm; + switch (EncAlg) + { + case _NO_PRIVACY_: + SET_TX_DESC_SEC_TYPE_8812(pDesc, 0x0); + break; + case _WEP40_: + case _WEP104_: + case _TKIP_: + SET_TX_DESC_SEC_TYPE_8812(pDesc, 0x1); + break; + case _SMS4_: + SET_TX_DESC_SEC_TYPE_8812(pDesc, 0x2); + break; + case _AES_: + SET_TX_DESC_SEC_TYPE_8812(pDesc, 0x3); + break; + default: + SET_TX_DESC_SEC_TYPE_8812(pDesc, 0x0); + break; + } + } SET_TX_DESC_TX_RATE_8812(pDesc, MRateToHwRate(pmlmeext->tx_rate)); #if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) diff --git a/backports/drivers/realtek/rtl8812au/hal/rtl8812a/usb/rtl8812au_led.c b/backports/drivers/realtek/rtl8812au/hal/rtl8812a/usb/rtl8812au_led.c index fdb31fc33a47c3..b12149f3a3cf7c 100755 --- a/backports/drivers/realtek/rtl8812au/hal/rtl8812a/usb/rtl8812au_led.c +++ b/backports/drivers/realtek/rtl8812au/hal/rtl8812a/usb/rtl8812au_led.c @@ -95,8 +95,8 @@ SwLedOn_8812AU( } else { - LedCfg = rtw_read8(padapter, REG_LEDCFG2); - rtw_write8(padapter, REG_LEDCFG2, (LedCfg&0xe0)|BIT7|BIT6|BIT5); // SW control led0 on. + LedCfg = rtw_read8(padapter, REG_LEDCFG2) & 0xe0; + rtw_write8(padapter, REG_LEDCFG2, LedCfg|BIT7|BIT6|BIT5); // SW control led0 on. RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("SwLedOn LED0 Addr 0x%x, 0x%x\n", REG_LEDCFG2, rtw_read32(padapter, REG_LEDCFG2))); } break; @@ -287,9 +287,10 @@ SwLedOn_8821AU( case LED_PIN_LED2: if(IS_HARDWARE_TYPE_8821U(Adapter)) { - LedCfg = rtw_read8(Adapter, REG_LEDCFG2); - rtw_write8(Adapter, REG_LEDCFG2, ((LedCfg&0x20) & ~(BIT3))|BIT5); // SW control led0 on. + LedCfg = rtw_read8(Adapter, REG_LEDCFG2) & 0x20; + rtw_write8(Adapter, REG_LEDCFG2, (LedCfg & ~(BIT3))|BIT5); // SW control led0 on. RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("8821 SwLedOn LED2 0x%x\n", rtw_read32(Adapter, REG_LEDCFG0))); + //DBG_871X("8821 SwLedOn LED2 0x%x\n", rtw_read32(Adapter, REG_LEDCFG0)); } break; @@ -377,6 +378,7 @@ SwLedOff_8821AU( LedCfg = rtw_read8(Adapter, REG_LEDCFG2); LedCfg &= 0x20; // Set to software control. rtw_write8(Adapter, REG_LEDCFG2, (LedCfg|BIT3|BIT5)); + //DBG_871X("8821 SwLedOn LED2 0x%x\n", rtw_read32(Adapter, REG_LEDCFG0)); RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("8821 SwLedOff LED2 0x%x\n", rtw_read32(Adapter, REG_LEDCFG0))); } diff --git a/backports/drivers/realtek/rtl8812au/hal/rtl8812a/usb/rtl8812au_recv.c b/backports/drivers/realtek/rtl8812au/hal/rtl8812a/usb/rtl8812au_recv.c index 5e727fbf51bc71..1dd0d965105c08 100755 --- a/backports/drivers/realtek/rtl8812au/hal/rtl8812a/usb/rtl8812au_recv.c +++ b/backports/drivers/realtek/rtl8812au/hal/rtl8812a/usb/rtl8812au_recv.c @@ -22,195 +22,13 @@ //#include #include - -void rtl8812au_init_recvbuf(_adapter *padapter, struct recv_buf *precvbuf) -{ - - precvbuf->transfer_len = 0; - - precvbuf->len = 0; - - precvbuf->ref_cnt = 0; - - if(precvbuf->pbuf) - { - precvbuf->pdata = precvbuf->phead = precvbuf->ptail = precvbuf->pbuf; - precvbuf->pend = precvbuf->pdata + MAX_RECVBUF_SZ; - } - -} - int rtl8812au_init_recv_priv(_adapter *padapter) { - struct recv_priv *precvpriv = &padapter->recvpriv; - int i, res = _SUCCESS; - struct recv_buf *precvbuf; - -#ifdef CONFIG_RECV_THREAD_MODE - _rtw_init_sema(&precvpriv->recv_sema, 0);//will be removed - _rtw_init_sema(&precvpriv->terminate_recvthread_sema, 0);//will be removed -#endif - -#ifdef PLATFORM_LINUX - tasklet_init(&precvpriv->recv_tasklet, - (void(*)(unsigned long))rtl8812au_recv_tasklet, - (unsigned long)padapter); -#endif - -#ifdef CONFIG_USB_INTERRUPT_IN_PIPE -#ifdef PLATFORM_LINUX - precvpriv->int_in_urb = usb_alloc_urb(0, GFP_KERNEL); - if(precvpriv->int_in_urb == NULL){ - res= _FAIL; - DBG_8192C("alloc_urb for interrupt in endpoint fail !!!!\n"); - goto exit; - } -#endif - precvpriv->int_in_buf = rtw_zmalloc(INTERRUPT_MSG_FORMAT_LEN); - if(precvpriv->int_in_buf == NULL){ - res= _FAIL; - DBG_8192C("alloc_mem for interrupt in endpoint fail !!!!\n"); - goto exit; - } -#endif - - //init recv_buf - _rtw_init_queue(&precvpriv->free_recv_buf_queue); - -#ifdef CONFIG_USE_USB_BUFFER_ALLOC_RX - _rtw_init_queue(&precvpriv->recv_buf_pending_queue); -#endif // CONFIG_USE_USB_BUFFER_ALLOC_RX - - precvpriv->pallocated_recv_buf = rtw_zmalloc(NR_RECVBUFF *sizeof(struct recv_buf) + 4); - if(precvpriv->pallocated_recv_buf==NULL){ - res= _FAIL; - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("alloc recv_buf fail!\n")); - goto exit; - } - _rtw_memset(precvpriv->pallocated_recv_buf, 0, NR_RECVBUFF *sizeof(struct recv_buf) + 4); - - precvpriv->precv_buf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(precvpriv->pallocated_recv_buf), 4); - //precvpriv->precv_buf = precvpriv->pallocated_recv_buf + 4 - - // ((uint) (precvpriv->pallocated_recv_buf) &(4-1)); - - - precvbuf = (struct recv_buf*)precvpriv->precv_buf; - - for(i=0; i < NR_RECVBUFF ; i++) - { - _rtw_init_listhead(&precvbuf->list); - - _rtw_spinlock_init(&precvbuf->recvbuf_lock); - - precvbuf->alloc_sz = MAX_RECVBUF_SZ; - - res = rtw_os_recvbuf_resource_alloc(padapter, precvbuf); - if(res==_FAIL) - break; - - precvbuf->ref_cnt = 0; - precvbuf->adapter =padapter; - - - //rtw_list_insert_tail(&precvbuf->list, &(precvpriv->free_recv_buf_queue.queue)); - - precvbuf++; - - } - - precvpriv->free_recv_buf_queue_cnt = NR_RECVBUFF; - -#ifdef PLATFORM_LINUX - - skb_queue_head_init(&precvpriv->rx_skb_queue); - -#ifdef CONFIG_PREALLOC_RECV_SKB - { - int i; - SIZE_PTR tmpaddr=0; - SIZE_PTR alignment=0; - struct sk_buff *pskb=NULL; - - skb_queue_head_init(&precvpriv->free_recv_skb_queue); - - for(i=0; idev = padapter->pnetdev; - - tmpaddr = (SIZE_PTR)pskb->data; - alignment = tmpaddr & (RECVBUFF_ALIGN_SZ-1); - skb_reserve(pskb, (RECVBUFF_ALIGN_SZ - alignment)); - - skb_queue_tail(&precvpriv->free_recv_skb_queue, pskb); - } - - pskb=NULL; - - } - } -#endif - -#endif - -exit: - - return res; - + return usb_init_recv_priv(padapter, INTERRUPT_MSG_FORMAT_LEN); } -void rtl8812au_free_recv_priv (_adapter *padapter) +void rtl8812au_free_recv_priv(_adapter *padapter) { - int i; - struct recv_buf *precvbuf; - struct recv_priv *precvpriv = &padapter->recvpriv; - - precvbuf = (struct recv_buf *)precvpriv->precv_buf; - - for(i=0; i < NR_RECVBUFF ; i++) - { - rtw_os_recvbuf_resource_free(padapter, precvbuf); - precvbuf++; - } - - if(precvpriv->pallocated_recv_buf) - rtw_mfree(precvpriv->pallocated_recv_buf, NR_RECVBUFF *sizeof(struct recv_buf) + 4); - -#ifdef CONFIG_USB_INTERRUPT_IN_PIPE -#ifdef PLATFORM_LINUX - if(precvpriv->int_in_urb) - { - usb_free_urb(precvpriv->int_in_urb); - } -#endif//PLATFORM_LINUX - - if(precvpriv->int_in_buf) - rtw_mfree(precvpriv->int_in_buf, INTERRUPT_MSG_FORMAT_LEN); -#endif//CONFIG_USB_INTERRUPT_IN_PIPE - -#ifdef PLATFORM_LINUX - - if (skb_queue_len(&precvpriv->rx_skb_queue)) { - DBG_8192C(KERN_WARNING "rx_skb_queue not empty\n"); - } - - rtw_skb_queue_purge(&precvpriv->rx_skb_queue); - -#ifdef CONFIG_PREALLOC_RECV_SKB - - if (skb_queue_len(&precvpriv->free_recv_skb_queue)) { - DBG_8192C(KERN_WARNING "free_recv_skb_queue not empty, %d\n", skb_queue_len(&precvpriv->free_recv_skb_queue)); - } - - rtw_skb_queue_purge(&precvpriv->free_recv_skb_queue); - -#endif - -#endif - + usb_free_recv_priv(padapter, INTERRUPT_MSG_FORMAT_LEN); } - diff --git a/backports/drivers/realtek/rtl8812au/hal/rtl8812a/usb/rtl8812au_xmit.c b/backports/drivers/realtek/rtl8812au/hal/rtl8812a/usb/rtl8812au_xmit.c index 161a97433bf0a0..315d17e08d428c 100755 --- a/backports/drivers/realtek/rtl8812au/hal/rtl8812a/usb/rtl8812au_xmit.c +++ b/backports/drivers/realtek/rtl8812au/hal/rtl8812a/usb/rtl8812au_xmit.c @@ -156,7 +156,7 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag SET_TX_DESC_AGG_ENABLE_8812(ptxdesc, 1); SET_TX_DESC_MAX_AGG_NUM_8812(ptxdesc, 0x1f); // Set A-MPDU aggregation. - SET_TX_DESC_AMPDU_DENSITY_8812(ptxdesc, pHalData->AMPDUDensity); + SET_TX_DESC_AMPDU_DENSITY_8812(ptxdesc, pattrib->ampdu_spacing); } else { SET_TX_DESC_AGG_BREAK_8812(ptxdesc, 1); } @@ -181,7 +181,8 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag SET_TX_DESC_DATA_SHORT_8812(ptxdesc, 1); SET_TX_DESC_TX_RATE_8812(ptxdesc, (padapter->fix_rate & 0x7F)); - SET_TX_DESC_DISABLE_FB_8812(ptxdesc,1); + if (!padapter->data_fb) + SET_TX_DESC_DISABLE_FB_8812(ptxdesc,1); } if (pattrib->ldpc) @@ -207,6 +208,17 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag SET_TX_DESC_TX_RATE_8812(ptxdesc, MRateToHwRate(pmlmeext->tx_rate)); } +#ifdef CONFIG_TDLS +#ifdef CONFIG_XMIT_ACK + /* CCX-TXRPT ack for xmit mgmt frames. */ + if (pxmitframe->ack_report) { + SET_TX_DESC_SPE_RPT_8812(ptxdesc, 1); + #ifdef DBG_CCX + DBG_871X("%s set tx report\n", __func__); + #endif + } +#endif /* CONFIG_XMIT_ACK */ +#endif } else if((pxmitframe->frame_tag&0x0f)== MGNT_FRAMETAG) { @@ -215,14 +227,6 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag if(IS_HARDWARE_TYPE_8821(padapter)) SET_TX_DESC_MBSSID_8821(ptxdesc, pattrib->mbssid); - //offset 20 - SET_TX_DESC_RETRY_LIMIT_ENABLE_8812(ptxdesc, 1); - if (pattrib->retry_ctrl == _TRUE) { - SET_TX_DESC_DATA_RETRY_LIMIT_8812(ptxdesc, 6); - } else { - SET_TX_DESC_DATA_RETRY_LIMIT_8812(ptxdesc, 12); - } - SET_TX_DESC_USE_RATE_8812(ptxdesc, 1); #ifdef CONFIG_INTEL_PROXIM @@ -233,7 +237,39 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag else #endif { - SET_TX_DESC_TX_RATE_8812(ptxdesc, MRateToHwRate(pmlmeext->tx_rate)); + SET_TX_DESC_TX_RATE_8812(ptxdesc, MRateToHwRate(pattrib->rate)); + } + + // VHT NDPA or HT NDPA Packet for Beamformer. + if((pattrib->subtype == WIFI_NDPA) || + ((pattrib->subtype == WIFI_ACTION_NOACK) && (pattrib->order == 1))) + { + SET_TX_DESC_NAV_USE_HDR_8812(ptxdesc, 1); + + SET_TX_DESC_DATA_BW_8812(ptxdesc, BWMapping_8812(padapter,pattrib)); + SET_TX_DESC_RTS_SC_8812(ptxdesc, SCMapping_8812(padapter,pattrib)); + + SET_TX_DESC_RETRY_LIMIT_ENABLE_8812(ptxdesc, 1); + SET_TX_DESC_DATA_RETRY_LIMIT_8812(ptxdesc, 5); + SET_TX_DESC_DISABLE_FB_8812(ptxdesc, 1); + + //if(pattrib->rts_cca) + //{ + // SET_TX_DESC_NDPA_8812(ptxdesc, 2); + //} + //else + { + SET_TX_DESC_NDPA_8812(ptxdesc, 1); + } + } + else + { + SET_TX_DESC_RETRY_LIMIT_ENABLE_8812(ptxdesc, 1); + if (pattrib->retry_ctrl == _TRUE) { + SET_TX_DESC_DATA_RETRY_LIMIT_8812(ptxdesc, 6); + } else { + SET_TX_DESC_DATA_RETRY_LIMIT_8812(ptxdesc, 12); + } } #ifdef CONFIG_XMIT_ACK @@ -550,6 +586,8 @@ s32 rtl8812au_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv bulkPtr = bulkSize; if (pbuf < bulkPtr) descCount++; + if (descCount == pHalData->UsbTxAggDescNum) + goto agg_end; else { descCount = 0; bulkPtr = ((pbuf / bulkSize) + 1) * bulkSize; // round to next bulkSize @@ -597,6 +635,9 @@ s32 rtl8812au_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list); xmitframe_plist = get_next(xmitframe_plist); + if(_FAIL == rtw_hal_busagg_qsel_check(padapter,pfirstframe->attrib.qsel,pxmitframe->attrib.qsel)) + break; + pxmitframe->agg_num = 0; // not first frame of aggregation #ifdef CONFIG_TX_EARLY_MODE pxmitframe->pkt_offset = 1;// not first frame of aggregation,reserve offset for EM Info @@ -686,6 +727,7 @@ s32 rtl8812au_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv rtw_list_delete(&ptxservq->tx_pending); _exit_critical_bh(&pxmitpriv->lock, &irqL); +agg_end: #ifdef CONFIG_80211N_HT if ((pfirstframe->attrib.ether_type != 0x0806) && (pfirstframe->attrib.ether_type != 0x888e) && diff --git a/backports/drivers/realtek/rtl8812au/hal/rtl8812a/usb/usb_halinit.c b/backports/drivers/realtek/rtl8812au/hal/rtl8812a/usb/usb_halinit.c index 3a3c7e0fe9c83d..25555f57d0cac9 100755 --- a/backports/drivers/realtek/rtl8812au/hal/rtl8812a/usb/usb_halinit.c +++ b/backports/drivers/realtek/rtl8812au/hal/rtl8812a/usb/usb_halinit.c @@ -133,11 +133,14 @@ void rtl8812au_interface_configure(_adapter *padapter) pHalData->UsbTxAggDescNum = 6; // only 4 bits if(IS_HARDWARE_TYPE_8812AU(padapter)) //page added for Jaguar - pHalData->UsbTxAggDescNum = 3; + pHalData->UsbTxAggDescNum = 0x01 ; //adjust value for OQT Overflow issue //0x3; // only 4 bits #endif #ifdef CONFIG_USB_RX_AGGREGATION - pHalData->UsbRxAggMode = USB_RX_AGG_DMA;// USB_RX_AGG_DMA; + if(IS_HARDWARE_TYPE_8812AU(padapter)) + pHalData->UsbRxAggMode = USB_RX_AGG_USB; + else + pHalData->UsbRxAggMode = USB_RX_AGG_USB; //todo: change to USB_RX_AGG_DMA; pHalData->UsbRxAggBlockCount = 8; //unit : 512b pHalData->UsbRxAggBlockTimeout = 0x6; pHalData->UsbRxAggPageCount = 16; //uint :128 b //0x0A; // 10 = MAX_RX_DMA_BUFFER_SIZE/2/pHalData->UsbBulkOutSize @@ -147,8 +150,9 @@ void rtl8812au_interface_configure(_adapter *padapter) pHalData->RegAcUsbDmaSize = 0x7; pHalData->RegAcUsbDmaTime = 0x1a; } else { - pHalData->RegAcUsbDmaSize = 0x6; - pHalData->RegAcUsbDmaTime = 0x10; + //the setting to reduce RX FIFO overflow on USB2.0 and increase rx throughput + pHalData->RegAcUsbDmaSize = 0x5; + pHalData->RegAcUsbDmaTime = 0x20; } #endif @@ -197,17 +201,14 @@ _InitBurstPktLen(IN PADAPTER Adapter) { pHalData->UsbBulkOutSize = USB_HIGH_SPEED_BULK_SIZE; provalue = rtw_read8(Adapter, REG_RXDMA_PRO_8812); - rtw_write8(Adapter, REG_RXDMA_PRO_8812, ((provalue|BIT(4))&(~BIT(5)))); //set burst pkt len=512B - rtw_write16(Adapter, REG_RXDMA_PRO_8812, 0x1e); + rtw_write8(Adapter, REG_RXDMA_PRO_8812, ((provalue|BIT(4)|BIT(3)|BIT(2)|BIT(1))&(~BIT(5)))); //set burst pkt len=512B } else { pHalData->UsbBulkOutSize = 64; provalue = rtw_read8(Adapter, REG_RXDMA_PRO_8812); - rtw_write8(Adapter, REG_RXDMA_PRO_8812, ((provalue|BIT(5))&(~BIT(4)))); //set burst pkt len=64B + rtw_write8(Adapter, REG_RXDMA_PRO_8812, ((provalue|BIT(5)|BIT(3)|BIT(2)|BIT(1))&(~BIT(4)))); //set burst pkt len=64B } - - //rtw_write16(Adapter, REG_RXDMA_AGG_PG_TH,0x2005); //dmc agg th 20K //rtw_write8(Adapter, 0x10c, 0xb4); //hal_UphyUpdate8812AU(Adapter); @@ -218,8 +219,7 @@ _InitBurstPktLen(IN PADAPTER Adapter) { pHalData->UsbBulkOutSize = USB_SUPER_SPEED_BULK_SIZE; provalue = rtw_read8(Adapter, REG_RXDMA_PRO_8812); - rtw_write8(Adapter, REG_RXDMA_PRO_8812, provalue&(~(BIT5|BIT4))); //set burst pkt len=1k - rtw_write16(Adapter, REG_RXDMA_PRO_8812, 0x0e); + rtw_write8(Adapter, REG_RXDMA_PRO_8812, ((provalue|BIT(3)|BIT(2)|BIT(1))&(~(BIT5|BIT4)))); //set burst pkt len=1k //PlatformEFIOWrite2Byte(Adapter, REG_RXDMA_AGG_PG_TH,0x0a05); //dmc agg th 20K pHalData->bSupportUSB3 = _TRUE; @@ -241,16 +241,16 @@ _InitBurstPktLen(IN PADAPTER Adapter) rtw_write8(Adapter, REG_PIFS, 0x00); - //Suggention by SD1 Jong and Pisa, by Maddest 20130107. if(IS_HARDWARE_TYPE_8821U(Adapter) && (Adapter->registrypriv.wifi_spec == _FALSE)) { - rtw_write16(Adapter, REG_MAX_AGGR_NUM, 0x0a0a); + //0x0a0a too small , it can't pass AC logo. change to 0x1f1f + rtw_write16(Adapter, REG_MAX_AGGR_NUM, 0x1f1f); rtw_write8(Adapter, REG_FWHW_TXQ_CTRL, 0x80); rtw_write32(Adapter, REG_FAST_EDCA_CTRL, 0x03087777); } else { - rtw_write8(Adapter, REG_MAX_AGGR_NUM, 0x1f); + rtw_write16(Adapter, REG_MAX_AGGR_NUM, 0x1f1f); rtw_write8(Adapter, REG_FWHW_TXQ_CTRL, rtw_read8(Adapter, REG_FWHW_TXQ_CTRL)&(~BIT(7))); } @@ -508,9 +508,9 @@ _InitTxBufferBoundary_8821AUsb( #ifdef CONFIG_CONCURRENT_MODE rtw_write8(Adapter, REG_BCNQ1_BDNY, txpktbuf_bndy+8); - rtw_write8(Adapter, REG_TDECTRL1_8812+1, txpktbuf_bndy+8);//BCN1_HEAD + rtw_write8(Adapter, REG_DWBCN1_CTRL_8812+1, txpktbuf_bndy+8);//BCN1_HEAD // BIT1- BIT_SW_BCN_SEL_EN - rtw_write8(Adapter, REG_TDECTRL1_8812+2, rtw_read8(Adapter, REG_TDECTRL1_8812+2)|BIT1); + rtw_write8(Adapter, REG_DWBCN1_CTRL_8812+2, rtw_read8(Adapter, REG_DWBCN1_CTRL_8812+2)|BIT1); #endif } @@ -556,9 +556,9 @@ _InitPageBoundary_8812AUsb( // rxff_bndy = (Offset*256)-1; if(IS_HARDWARE_TYPE_8812(Adapter)) - rtw_write16(Adapter, (REG_TRXFF_BNDY + 2), MAX_RX_DMA_BUFFER_SIZE_8812-1); + rtw_write16(Adapter, (REG_TRXFF_BNDY + 2), RX_DMA_BOUNDARY_8812); else - rtw_write16(Adapter, (REG_TRXFF_BNDY + 2), MAX_RX_DMA_BUFFER_SIZE_8821-1); + rtw_write16(Adapter, (REG_TRXFF_BNDY + 2), RX_DMA_BOUNDARY_8821); } @@ -741,7 +741,7 @@ _InitWMACSetting_8812A( ) { //u4Byte value32; - //u16 value16; + u16 value16; HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); //pHalData->ReceiveConfig = AAP | APM | AM | AB | APP_ICV | ADF | AMF | APP_FCS | HTC_LOC_CTRL | APP_MIC | APP_PHYSTS; @@ -774,8 +774,12 @@ _InitWMACSetting_8812A( // 2010.09.08 hpfan // Since ADF is removed from RCR, ps-poll will not be indicate to driver, // RxFilterMap should mask ps-poll to gurantee AP mode can rx ps-poll. - //value16 = 0x400; - //rtw_write16(Adapter, REG_RXFLTMAP1, value16); + value16 = BIT10; +#ifdef CONFIG_BEAMFORMING + // NDPA packet subtype is 0x0101 + value16 |= BIT5; +#endif + rtw_write16(Adapter, REG_RXFLTMAP1, value16); // Accept all management frames //value16 = 0xFFFF; @@ -942,7 +946,9 @@ usb_AggSettingTxUpdate_8812A( value32 = value32 & ~(BLK_DESC_NUM_MASK << BLK_DESC_NUM_SHIFT); value32 |= ((pHalData->UsbTxAggDescNum & BLK_DESC_NUM_MASK) << BLK_DESC_NUM_SHIFT); - rtw_write32(Adapter, REG_TDECTRL, value32); + rtw_write32(Adapter, REG_DWBCN0_CTRL_8812, value32); + if(IS_HARDWARE_TYPE_8821U(Adapter)) //page added for Jaguar + rtw_write8(Adapter, REG_DWBCN1_CTRL_8812, pHalData->UsbTxAggDescNum<<1); } #endif @@ -975,13 +981,10 @@ usb_AggSettingRxUpdate_8812A( u8 valueUSB; valueDMA = rtw_read8(Adapter, REG_TRXDMA_CTRL); - switch(pHalData->UsbRxAggMode) { case USB_RX_AGG_DMA: valueDMA |= RXDMA_AGG_EN; - - //rtw_write8(Adapter, REG_RXDMA_AGG_PG_TH, 0x05); //dma agg mode, 20k // // 2012/10/26 MH For TX throught start rate temp fix. // @@ -991,9 +994,20 @@ usb_AggSettingRxUpdate_8812A( //Adjust DMA page and thresh. temp = pHalData->RegAcUsbDmaSize | (pHalData->RegAcUsbDmaTime<<8); rtw_write16(Adapter, REG_RXDMA_AGG_PG_TH, temp); + rtw_write8(Adapter, REG_RXDMA_AGG_PG_TH+3, BIT(7)); //for dma agg , 0x280[31]GBIT_RXDMA_AGG_OLD_MOD, set 1 } break; case USB_RX_AGG_USB: + valueDMA |= RXDMA_AGG_EN; + { + u16 temp; + + //Adjust DMA page and thresh. + temp = pHalData->RegAcUsbDmaSize | (pHalData->RegAcUsbDmaTime<<8); + rtw_write16(Adapter, REG_RXDMA_AGG_PG_TH, temp); + } + + break; case USB_RX_AGG_MIX: case USB_RX_AGG_DISABLE: default: @@ -1319,63 +1333,7 @@ HalDetectSelectiveSuspendMode( } #endif } // HalDetectSelectiveSuspendMode -/*----------------------------------------------------------------------------- - * Function: HwSuspendModeEnable92Cu() - * - * Overview: HW suspend mode switch. - * - * Input: NONE - * - * Output: NONE - * - * Return: NONE - * - * Revised History: - * When Who Remark - * 08/23/2010 MHC HW suspend mode switch test.. - *---------------------------------------------------------------------------*/ -static VOID -HwSuspendModeEnable_8812AU( - IN PADAPTER pAdapter, - IN u8 Type - ) -{ - //PRT_USB_DEVICE pDevice = GET_RT_USB_DEVICE(pAdapter); - u16 reg = rtw_read16(pAdapter, REG_GPIO_MUXCFG); - - //if (!pDevice->RegUsbSS) - { - return; - } - // - // 2010/08/23 MH According to Alfred's suggestion, we need to to prevent HW - // to enter suspend mode automatically. Otherwise, it will shut down major power - // domain and 8051 will stop. When we try to enter selective suspend mode, we - // need to prevent HW to enter D2 mode aumotmatically. Another way, Host will - // issue a S10 signal to power domain. Then it will cleat SIC setting(from Yngli). - // We need to enable HW suspend mode when enter S3/S4 or disable. We need - // to disable HW suspend mode for IPS/radio_off. - // - //RT_TRACE(COMP_RF, DBG_LOUD, ("HwSuspendModeEnable92Cu = %d\n", Type)); - if (Type == _FALSE) - { - reg |= BIT14; - //RT_TRACE(COMP_RF, DBG_LOUD, ("REG_GPIO_MUXCFG = %x\n", reg)); - rtw_write16(pAdapter, REG_GPIO_MUXCFG, reg); - reg |= BIT12; - //RT_TRACE(COMP_RF, DBG_LOUD, ("REG_GPIO_MUXCFG = %x\n", reg)); - rtw_write16(pAdapter, REG_GPIO_MUXCFG, reg); - } - else - { - reg &= (~BIT12); - rtw_write16(pAdapter, REG_GPIO_MUXCFG, reg); - reg &= (~BIT14); - rtw_write16(pAdapter, REG_GPIO_MUXCFG, reg); - } - -} // HwSuspendModeEnable92Cu rt_rf_power_state RfOnOffDetect(IN PADAPTER pAdapter ) { HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); @@ -1409,6 +1367,50 @@ void _ps_close_RF(_adapter *padapter){ //phy_SsPwrSwitch92CU(padapter, rf_off, 1); } + +/* A lightweight deinit function */ +static void rtl8812au_hw_reset(_adapter *Adapter) +{ + u8 reg_val=0; + if(rtw_read8(Adapter, REG_MCUFWDL)&BIT7) + { + _8051Reset8812(Adapter); + rtw_write8(Adapter, REG_MCUFWDL, 0x00); + //before BB reset should do clock gated + rtw_write32(Adapter, rFPGA0_XCD_RFPara, + rtw_read32(Adapter, rFPGA0_XCD_RFPara)|(BIT6)); + //reset BB + reg_val = rtw_read8(Adapter, REG_SYS_FUNC_EN); + reg_val &= ~(BIT(0) | BIT(1)); + rtw_write8(Adapter, REG_SYS_FUNC_EN, reg_val); + //reset RF + rtw_write8(Adapter, REG_RF_CTRL, 0); + //reset TRX path + rtw_write16(Adapter, REG_CR, 0); + //reset MAC + reg_val = rtw_read8(Adapter, REG_APS_FSMCO+1); + reg_val |= BIT(1); + reg_val = rtw_write8(Adapter, REG_APS_FSMCO+1, reg_val); //reg0x5[1] ,auto FSM off + + reg_val = rtw_read8(Adapter, REG_APS_FSMCO+1); + + //check if reg0x5[1] auto cleared + while(reg_val & BIT(1)){ + rtw_udelay_os(1); + reg_val = rtw_read8(Adapter, REG_APS_FSMCO+1); + } + reg_val |= BIT(0); + reg_val = rtw_write8(Adapter, REG_APS_FSMCO+1, reg_val); //reg0x5[0] ,auto FSM on + + reg_val = rtw_read8(Adapter, REG_SYS_FUNC_EN+1); + reg_val &= ~(BIT(4) | BIT(7)); + rtw_write8(Adapter, REG_SYS_FUNC_EN+1, reg_val); + reg_val = rtw_read8(Adapter, REG_SYS_FUNC_EN+1); + reg_val |= BIT(4) | BIT(7); + rtw_write8(Adapter, REG_SYS_FUNC_EN+1, reg_val); + } +} + u32 rtl8812au_hal_init(PADAPTER Adapter) { u8 value8 = 0, u1bRegCR; @@ -1420,9 +1422,6 @@ u32 rtl8812au_hal_init(PADAPTER Adapter) struct registry_priv *pregistrypriv = &Adapter->registrypriv; rt_rf_power_state eRfPowerStateToSet; -#ifdef CONFIG_BT_COEXIST - struct btcoexist_priv *pbtpriv = &(pHalData->bt_coexist); -#endif u32 init_start_time = rtw_get_current_time(); @@ -1551,6 +1550,15 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_BEGIN); rtw_write8(Adapter, REG_RF_B_CTRL_8812, 7); } +/* + If HW didn't go through a complete de-initial procedure, + it probably occurs some problem for double initial procedure. + Like "CONFIG_DEINIT_BEFORE_INIT" in 92du chip +*/ + rtl8812au_hw_reset(Adapter); + + + HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_INIT_PW_ON); status = _InitPowerOn_8812AU(Adapter); if(status == _FAIL){ @@ -1753,7 +1761,15 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MISC11); if(pregistrypriv->wifi_spec) rtw_write16(Adapter,REG_FAST_EDCA_CTRL ,0); - + //adjust EDCCA to avoid collision + if(pregistrypriv->wifi_spec) + { + if (IS_HARDWARE_TYPE_8821(Adapter)) + if (Adapter->registrypriv.adaptivity_en == 0) { + Adapter->registrypriv.adaptivity_en = 1; + Adapter->registrypriv.adaptivity_mode = 0; + } + } //Nav limit , suggest by scott rtw_write8(Adapter, 0x652, 0x0); @@ -1926,12 +1942,22 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MISC21); #ifdef CONFIG_BT_COEXIST HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_BT_COEXIST); //_InitBTCoexist(Adapter); -#endif - // 2010/08/23 MH According to Alfred's suggestion, we need to to prevent HW enter // suspend mode automatically. //HwSuspendModeEnable92Cu(Adapter, _FALSE); + if ( _TRUE == pHalData->EEPROMBluetoothCoexist) + { + // Init BT hw config. + rtw_btcoex_HAL_Initialize(Adapter, _FALSE); + } + else + { + // In combo card run wifi only , must setting some hardware reg. + rtl8812a_combo_card_WifiOnlyHwInit(Adapter); + } +#endif //CONFIG_BT_COEXIST + HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MISC31); rtw_write8(Adapter, REG_USB_HRPWM, 0); @@ -1989,11 +2015,14 @@ hal_poweroff_8812au( { u8 u1bTmp; u8 bMacPwrCtrlOn = _FALSE; + u16 utemp, ori_fsmc0; rtw_hal_get_hwreg(Adapter, HW_VAR_APFM_ON_MAC, &bMacPwrCtrlOn); if(bMacPwrCtrlOn == _FALSE) return ; - + + ori_fsmc0 = utemp = rtw_read16(Adapter, REG_APS_FSMCO); + rtw_write16(Adapter, REG_APS_FSMCO, utemp & ~0x8000); DBG_871X(" %s\n",__FUNCTION__); //Stop Tx Report Timer. 0x4EC[Bit1]=b'0 @@ -2030,7 +2059,11 @@ hal_poweroff_8812au( bMacPwrCtrlOn = _FALSE; rtw_hal_set_hwreg(Adapter, HW_VAR_APFM_ON_MAC, &bMacPwrCtrlOn); - + + if (ori_fsmc0 & 0x8000) { + utemp = rtw_read16(Adapter, REG_APS_FSMCO); + rtw_write16(Adapter, REG_APS_FSMCO, utemp | 0x8000); + } } static void rtl8812au_hw_power_down(_adapter *padapter) @@ -2050,7 +2083,7 @@ u32 rtl8812au_hal_deinit(PADAPTER Adapter) DBG_8192C("==> %s \n",__FUNCTION__); #ifdef CONFIG_BT_COEXIST - if (BT_IsBtExist(Adapter)) + if (hal_btcoex_IsBtExist(Adapter)) { DBG_871X("BT module enable SIC\n"); // Only under WIN7 we can support selective suspend and enter D3 state when system call halt adapter. @@ -2060,7 +2093,7 @@ u32 rtl8812au_hal_deinit(PADAPTER Adapter) // the system will hang due to 8051 reset fail. } else -#endif +#endif //CONFIG_BT_COEXIST { rtw_write16(Adapter, REG_GPIO_MUXCFG, rtw_read16(Adapter, REG_GPIO_MUXCFG)&(~BIT12)); } @@ -2543,13 +2576,47 @@ InitAdapterVariablesByPROM_8812AU( ) { EEPROM_EFUSE_PRIV *pEEPROM = GET_EEPROM_EFUSE_PRIV(Adapter); - +#ifdef CONFIG_EFUSE_CONFIG_FILE + struct file *fp; +#endif //CONFIG_EFUSE_CONFIG_FILE + +#ifdef CONFIG_EFUSE_CONFIG_FILE + if (check_phy_efuse_tx_power_info_valid(Adapter) == _FALSE) { + fp = filp_open(EFUSE_MAP_PATH, O_RDONLY, 0); + if (fp == NULL || IS_ERR(fp)) { + DBG_871X("[WARNING] invalid phy efuse and no efuse file, use driver default!!\n"); + } else { + Hal_readPGDataFromConfigFile(Adapter, fp); + filp_close(fp, NULL); + } + } +#else hal_InitPGData_8812A(Adapter, pEEPROM->efuse_eeprom_data); +#endif //CONFIG_EFUSE_CONFIG_FILE + Hal_EfuseParseIDCode8812A(Adapter, pEEPROM->efuse_eeprom_data); Hal_ReadPROMVersion8812A(Adapter, pEEPROM->efuse_eeprom_data, pEEPROM->bautoload_fail_flag); hal_ReadIDs_8812AU(Adapter, pEEPROM->efuse_eeprom_data, pEEPROM->bautoload_fail_flag); - hal_ReadMACAddress_8812AU(Adapter, pEEPROM->efuse_eeprom_data, pEEPROM->bautoload_fail_flag); + +#ifdef CONFIG_EFUSE_CONFIG_FILE + if (check_phy_efuse_macaddr_info_valid(Adapter) == _TRUE) { + DBG_871X("using phy efuse mac\n"); + Hal_GetPhyEfuseMACAddr(Adapter, pEEPROM->mac_addr); + } else { + fp = filp_open(WIFIMAC_PATH, O_RDONLY, 0); + if (fp == NULL || IS_ERR(fp)) { + DBG_871X("wifimac does not exist!!\n"); + Hal_GetPhyEfuseMACAddr(Adapter, pEEPROM->mac_addr); + } else { + Hal_ReadMACAddrFromFile(Adapter, fp); + filp_close(fp, NULL); + } + } +#else + hal_ReadMACAddress_8812AU(Adapter, pEEPROM->efuse_eeprom_data, pEEPROM->bautoload_fail_flag); +#endif //CONFIG_EFUSE_CONFIG_FILE + Hal_ReadTxPowerInfo8812A(Adapter, pEEPROM->efuse_eeprom_data, pEEPROM->bautoload_fail_flag); Hal_ReadBoardType8812A(Adapter, pEEPROM->efuse_eeprom_data, pEEPROM->bautoload_fail_flag); @@ -2561,6 +2628,7 @@ InitAdapterVariablesByPROM_8812AU( Hal_ReadChannelPlan8812A(Adapter, pEEPROM->efuse_eeprom_data, pEEPROM->bautoload_fail_flag); Hal_EfuseParseXtal_8812A(Adapter, pEEPROM->efuse_eeprom_data, pEEPROM->bautoload_fail_flag); Hal_ReadThermalMeter_8812A(Adapter, pEEPROM->efuse_eeprom_data, pEEPROM->bautoload_fail_flag); + Hal_ReadRemoteWakeup_8812A(Adapter, pEEPROM->efuse_eeprom_data, pEEPROM->bautoload_fail_flag); Hal_ReadAntennaDiversity8812A(Adapter, pEEPROM->efuse_eeprom_data, pEEPROM->bautoload_fail_flag); if(IS_HARDWARE_TYPE_8821U(Adapter)) @@ -2675,6 +2743,20 @@ void SetHwReg8812AU(PADAPTER Adapter, u8 variable, u8* val) HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); struct dm_priv *pdmpriv = &pHalData->dmpriv; DM_ODM_T *podmpriv = &pHalData->odmpriv; +#if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN) || defined(CONFIG_P2P_WOWLAN) + struct wowlan_ioctl_param *poidparam; + struct recv_buf *precvbuf; + struct pwrctrl_priv *pwrctl = adapter_to_pwrctl(Adapter); + struct mlme_priv *pmlmepriv = &Adapter->mlmepriv; + struct sta_info *psta = NULL; + int res, i; + u32 tmp; + u16 len = 0; + u16 media_status_rpt; + u8 mstatus = (*(u8 *)val); + u8 trycnt = 100; + u8 data[4]; +#endif _func_enter_; switch(variable) @@ -2726,6 +2808,248 @@ _func_enter_; //rtw_write8(Adapter, REG_CAL_TIMER+1, 0x3); rtw_write8(Adapter, REG_APS_FSMCO+1, 0x80); break; +#ifdef CONFIG_AP_WOWLAN + if (pwrctl->wowlan_ap_mode == _TRUE) + { + u8 ps_state = *((u8 *)val); + DBG_871X("%s, RPWM\n", __func__); + //rpwm value only use BIT0(clock bit) ,BIT6(Ack bit), and BIT7(Toggle bit) for 88e. + //BIT0 value - 1: 32k, 0:40MHz. + //BIT6 value - 1: report cpwm value after success set, 0:do not report. + //BIT7 value - Toggle bit change. + //modify by Thomas. 2012/4/2. + ps_state = ps_state & 0xC1; + //DBG_871X("##### Change RPWM value to = %x for switch clk #####\n",ps_state); + rtw_write8(Adapter, REG_USB_HRPWM, ps_state); + } +#endif + break; +#ifdef CONFIG_WOWLAN_OLD + case HW_VAR_WOWLAN: + { + poidparam = (struct wowlan_ioctl_param *)val; + switch (poidparam->subcode){ + case WOWLAN_ENABLE: + DBG_871X_LEVEL(_drv_always_, "WOWLAN_ENABLE\n"); + SetFwRelatedForWoWLAN8812(Adapter, _TRUE); + + //Set Pattern + //if(pwrctl->wowlan_pattern==_TRUE) + // rtw_wowlan_reload_pattern(Adapter); + + //RX DMA stop + DBG_871X_LEVEL(_drv_always_, "Pause DMA\n"); + rtw_write32(Adapter,REG_RXPKT_NUM,(rtw_read32(Adapter,REG_RXPKT_NUM)|RW_RELEASE_EN)); + do{ + if((rtw_read32(Adapter, REG_RXPKT_NUM)&RXDMA_IDLE)) { + DBG_871X_LEVEL(_drv_always_, "RX_DMA_IDLE is true\n"); + break; + } else { + // If RX_DMA is not idle, receive one pkt from DMA + DBG_871X_LEVEL(_drv_always_, "RX_DMA_IDLE is not true\n"); + } + }while(trycnt--); + if(trycnt ==0) + DBG_871X_LEVEL(_drv_always_, "Stop RX DMA failed...... \n"); + + //Set WOWLAN H2C command. + DBG_871X_LEVEL(_drv_always_, "Set WOWLan cmd\n"); + rtl8812_set_wowlan_cmd(Adapter, 1); + + mstatus = rtw_read8(Adapter, REG_WOW_CTRL); + trycnt = 10; + + while(!(mstatus&BIT1) && trycnt>1) { + mstatus = rtw_read8(Adapter, REG_WOW_CTRL); + DBG_871X_LEVEL(_drv_always_, "Loop index: %d :0x%02x\n", trycnt, mstatus); + trycnt --; + rtw_msleep_os(2); + } + + pwrctl->wowlan_wake_reason = rtw_read8(Adapter, REG_MCUTST_WOWLAN); + DBG_871X_LEVEL(_drv_always_, "wowlan_wake_reason: 0x%02x\n", + pwrctl->wowlan_wake_reason); + + if (Adapter->intf_stop) + Adapter->intf_stop(Adapter); + + // Invoid SE0 reset signal during suspending + rtw_write8(Adapter, REG_RSV_CTRL, 0x20); + rtw_write8(Adapter, REG_RSV_CTRL, 0x60); + //rtw_msleep_os(10); + break; + case WOWLAN_DISABLE: + DBG_871X_LEVEL(_drv_always_, "WOWLAN_DISABLE\n"); + trycnt = 10; + psta = rtw_get_stainfo(&Adapter->stapriv, get_bssid(pmlmepriv)); + if (psta != NULL) { + media_status_rpt = (u16)((psta->mac_id<<8)|RT_MEDIA_DISCONNECT); // MACID|OPMODE:0 disconnect + rtw_hal_set_hwreg(Adapter,HW_VAR_H2C_MEDIA_STATUS_RPT,(u8 *)&media_status_rpt); + } + // 1. Read wakeup reason + pwrctl->wowlan_wake_reason = rtw_read8(Adapter, REG_MCUTST_WOWLAN); + DBG_871X_LEVEL(_drv_always_, "wakeup_reason: 0x%02x, mac_630=0x%08x, mac_634=0x%08x, mac_1c0=0x%08x, mac_1c4=0x%08x" + ", mac_494=0x%08x, , mac_498=0x%08x, mac_49c=0x%08x, mac_608=0x%08x, mac_4a0=0x%08x, mac_4a4=0x%08x\n" + ", mac_1cc=0x%08x, mac_2f0=0x%08x, mac_2f4=0x%08x, mac_2f8=0x%08x, mac_2fc=0x%08x, mac_8c=0x%08x, mac_1a8=0x%08x" + , pwrctl->wowlan_wake_reason, rtw_read32(Adapter, 0x630), rtw_read32(Adapter, 0x634) + , rtw_read32(Adapter, 0x1c0), rtw_read32(Adapter, 0x1c4) + , rtw_read32(Adapter, 0x494), rtw_read32(Adapter, 0x498), rtw_read32(Adapter, 0x49c), rtw_read32(Adapter, 0x608) + , rtw_read32(Adapter, 0x4a0), rtw_read32(Adapter, 0x4a4) + , rtw_read32(Adapter, 0x1cc), rtw_read32(Adapter, 0x2f0), rtw_read32(Adapter, 0x2f4), rtw_read32(Adapter, 0x2f8) + , rtw_read32(Adapter, 0x2fc), rtw_read32(Adapter, 0x8c), rtw_read32(Adapter, 0x1a8)); + + rtl8812_set_wowlan_cmd(Adapter, 0); + mstatus = rtw_read8(Adapter, REG_WOW_CTRL); + DBG_871X_LEVEL(_drv_info_, "%s mstatus:0x%02x\n", __func__, mstatus); + + while(mstatus&BIT1 && trycnt>1) { + mstatus = rtw_read8(Adapter, REG_WOW_CTRL); + DBG_871X_LEVEL(_drv_always_, "Loop index: %d :0x%02x\n", trycnt, mstatus); + trycnt --; + rtw_msleep_os(2); + } + + if (mstatus & BIT1) + printk("System did not release RX_DMA\n"); + else + SetFwRelatedForWoWLAN8812(Adapter, _FALSE); + + rtw_msleep_os(2); + if(!(pwrctl->wowlan_wake_reason & FWDecisionDisconnect)) + rtl8812_set_FwJoinBssReport_cmd(Adapter, 1); + //rtw_msleep_os(10); + + break; + default: + break; + } + } + break; +#endif +#ifdef CONFIG_AP_WOWLAN + case HW_VAR_AP_WOWLAN: + { + poidparam = (struct wowlan_ioctl_param *)val; + switch (poidparam->subcode) { + case WOWLAN_AP_ENABLE: + DBG_871X("%s, WOWLAN_AP_ENABLE\n", __func__); + // 1. Download WOWLAN FW + DBG_871X_LEVEL(_drv_always_, "Re-download WoWlan FW!\n"); +#ifdef DBG_CHECK_FW_PS_STATE + if(rtw_fw_ps_state(Adapter) == _FAIL) { + pdbgpriv->dbg_enwow_dload_fw_fail_cnt++; + DBG_871X_LEVEL(_drv_always_, "wowlan enable no leave 32k\n"); + } +#endif //DBG_CHECK_FW_PS_STATE + do { + if (rtw_read8(Adapter, REG_HMETFR) == 0x00) { + DBG_871X_LEVEL(_drv_always_, "Ready to change FW.\n"); + break; + } + rtw_msleep_os(10); + DBG_871X_LEVEL(_drv_always_, "trycnt: %d\n", (100-trycnt)); + } while (trycnt--); + + SetFwRelatedForWoWLAN8192E(Adapter, _TRUE); + + // 2. RX DMA stop + DBG_871X_LEVEL(_drv_always_, "Pause DMA\n"); + trycnt = 100; + rtw_write32(Adapter,REG_RXPKT_NUM, + (rtw_read32(Adapter,REG_RXPKT_NUM)|RW_RELEASE_EN)); + do { + if ((rtw_read32(Adapter, REG_RXPKT_NUM)&RXDMA_IDLE)) { + DBG_871X_LEVEL(_drv_always_, "RX_DMA_IDLE is true\n"); + if (Adapter->intf_stop) + Adapter->intf_stop(Adapter); + break; + } else { + // If RX_DMA is not idle, receive one pkt from DMA + DBG_871X_LEVEL(_drv_always_, "RX_DMA_IDLE is not true\n"); + } + } while (trycnt--); + + if (trycnt == 0) + DBG_871X_LEVEL(_drv_always_, "Stop RX DMA failed...... \n"); + + // 5. Set Enable WOWLAN H2C command. + DBG_871X_LEVEL(_drv_always_, "Set Enable AP WOWLan cmd\n"); + rtl8192e_set_ap_wowlan_cmd(Adapter, 1); + // 6. add some delay for H2C cmd ready + rtw_msleep_os(10); + // 7. enable AP power save + rtl8192e_set_ap_ps_wowlan_cmd(Adapter, 1); + + rtw_write8(Adapter, REG_MCUTST_WOWLAN, 0); + + // Invoid SE0 reset signal during suspending + rtw_write8(Adapter, REG_RSV_CTRL, 0x20); + rtw_write8(Adapter, REG_RSV_CTRL, 0x60); + break; + case WOWLAN_AP_DISABLE: + DBG_871X("%s, WOWLAN_AP_DISABLE\n", __func__); + // 1. Read wakeup reason + pwrctl->wowlan_wake_reason = + rtw_read8(Adapter, REG_MCUTST_WOWLAN); + + DBG_871X_LEVEL(_drv_always_, "wakeup_reason: 0x%02x\n", + pwrctl->wowlan_wake_reason); + + // 2. diable AP power save + rtl8192e_set_ap_ps_wowlan_cmd(Adapter, 0); + // 3. Set Disable WOWLAN H2C command. + DBG_871X_LEVEL(_drv_always_, "Set Disable WOWLan cmd\n"); + rtl8192e_set_ap_wowlan_cmd(Adapter, 0); + // 6. add some delay for H2C cmd ready + rtw_msleep_os(2); +#ifdef DBG_CHECK_FW_PS_STATE + if (rtw_fw_ps_state(Adapter) == _FAIL) { + pdbgpriv->dbg_diswow_dload_fw_fail_cnt++; + DBG_871X_LEVEL(_drv_always_, "wowlan enable no leave 32k\n"); + } +#endif //DBG_CHECK_FW_PS_STATE + + DBG_871X_LEVEL(_drv_always_, "Release RXDMA\n"); + + rtw_write32(Adapter, REG_RXPKT_NUM, + (rtw_read32(Adapter,REG_RXPKT_NUM) & (~RW_RELEASE_EN))); + + do { + if (rtw_read8(Adapter, REG_HMETFR) == 0x00) { + DBG_871X_LEVEL(_drv_always_, "Ready to change FW.\n"); + break; + } + rtw_msleep_os(10); + DBG_871X_LEVEL(_drv_always_, "trycnt: %d\n", (100-trycnt)); + } while (trycnt--); + + SetFwRelatedForWoWLAN8192E(Adapter, _FALSE); +#ifdef CONFIG_GPIO_WAKEUP + DBG_871X_LEVEL(_drv_always_, "Set Wake GPIO to high for default.\n"); + HalSetOutPutGPIO(Adapter, WAKEUP_GPIO_IDX, 1); +#endif + +#ifdef CONFIG_CONCURRENT_MODE + if (rtw_buddy_adapter_up(Adapter) == _TRUE && + check_buddy_fwstate(Adapter, WIFI_AP_STATE) == _TRUE) { + rtl8192e_set_FwJoinBssReport_cmd(Adapter->pbuddy_adapter, RT_MEDIA_CONNECT); + issue_beacon(Adapter->pbuddy_adapter, 0); + } else { + rtl8192e_set_FwJoinBssReport_cmd(Adapter, RT_MEDIA_CONNECT); + issue_beacon(Adapter, 0); + } +#else + rtl8192e_set_FwJoinBssReport_cmd(Adapter, RT_MEDIA_CONNECT); + issue_beacon(Adapter, 0); +#endif + + break; + default: + break; + } + } + break; +#endif //CONFIG_AP_WOWLAN default: SetHwReg8812A(Adapter, variable, val); break; @@ -2897,26 +3221,12 @@ void rtl8812au_set_hal_ops(_adapter * padapter) _func_enter_; -#ifdef CONFIG_CONCURRENT_MODE - if(padapter->isprimary) -#endif //CONFIG_CONCURRENT_MODE - { - padapter->HalData = rtw_zmalloc(sizeof(HAL_DATA_TYPE)); - if(padapter->HalData == NULL){ - DBG_8192C("cant not alloc memory for HAL DATA \n"); - } - } - //_rtw_memset(padapter->HalData, 0, sizeof(HAL_DATA_TYPE)); - padapter->hal_data_sz = sizeof(HAL_DATA_TYPE); - pHalFunc->hal_power_on = _InitPowerOn_8812AU; pHalFunc->hal_power_off = hal_poweroff_8812au; pHalFunc->hal_init = &rtl8812au_hal_init; pHalFunc->hal_deinit = &rtl8812au_hal_deinit; - //pHalFunc->free_hal_data = &rtl8192c_free_hal_data; - pHalFunc->inirp_init = &rtl8812au_inirp_init; pHalFunc->inirp_deinit = &rtl8812au_inirp_deinit; diff --git a/backports/drivers/realtek/rtl8812au/hal/rtl8812a/usb/usb_ops_linux.c b/backports/drivers/realtek/rtl8812au/hal/rtl8812a/usb/usb_ops_linux.c index 63b4175973c2c1..8d5b40a6dd941b 100755 --- a/backports/drivers/realtek/rtl8812au/hal/rtl8812a/usb/usb_ops_linux.c +++ b/backports/drivers/realtek/rtl8812au/hal/rtl8812a/usb/usb_ops_linux.c @@ -22,198 +22,6 @@ //#include #include -static u8 usb_read8(struct intf_hdl *pintfhdl, u32 addr) -{ - u8 request; - u8 requesttype; - u16 wvalue; - u16 index; - u16 len; - u8 data=0; - - _func_enter_; - - request = 0x05; - requesttype = 0x01;//read_in - index = 0;//n/a - - wvalue = (u16)(addr&0x0000ffff); - len = 1; - - usbctrl_vendorreq(pintfhdl, request, wvalue, index, &data, len, requesttype); - - _func_exit_; - - return data; - -} - -static u16 usb_read16(struct intf_hdl *pintfhdl, u32 addr) -{ - u8 request; - u8 requesttype; - u16 wvalue; - u16 index; - u16 len; - u16 data=0; - - _func_enter_; - - request = 0x05; - requesttype = 0x01;//read_in - index = 0;//n/a - - wvalue = (u16)(addr&0x0000ffff); - len = 2; - - usbctrl_vendorreq(pintfhdl, request, wvalue, index, &data, len, requesttype); - - _func_exit_; - - return data; - -} - -static u32 usb_read32(struct intf_hdl *pintfhdl, u32 addr) -{ - u8 request; - u8 requesttype; - u16 wvalue; - u16 index; - u16 len; - u32 data=0; - - _func_enter_; - - request = 0x05; - requesttype = 0x01;//read_in - index = 0;//n/a - - wvalue = (u16)(addr&0x0000ffff); - len = 4; - - usbctrl_vendorreq(pintfhdl, request, wvalue, index, &data, len, requesttype); - - _func_exit_; - - return data; - -} - -static int usb_write8(struct intf_hdl *pintfhdl, u32 addr, u8 val) -{ - u8 request; - u8 requesttype; - u16 wvalue; - u16 index; - u16 len; - u8 data; - int ret; - - _func_enter_; - - request = 0x05; - requesttype = 0x00;//write_out - index = 0;//n/a - - wvalue = (u16)(addr&0x0000ffff); - len = 1; - - data = val; - - ret = usbctrl_vendorreq(pintfhdl, request, wvalue, index, &data, len, requesttype); - - _func_exit_; - - return ret; - -} - -static int usb_write16(struct intf_hdl *pintfhdl, u32 addr, u16 val) -{ - u8 request; - u8 requesttype; - u16 wvalue; - u16 index; - u16 len; - u16 data; - int ret; - - _func_enter_; - - request = 0x05; - requesttype = 0x00;//write_out - index = 0;//n/a - - wvalue = (u16)(addr&0x0000ffff); - len = 2; - - data = val; - - ret = usbctrl_vendorreq(pintfhdl, request, wvalue, index, &data, len, requesttype); - - _func_exit_; - - return ret; - -} - -static int usb_write32(struct intf_hdl *pintfhdl, u32 addr, u32 val) -{ - u8 request; - u8 requesttype; - u16 wvalue; - u16 index; - u16 len; - u32 data; - int ret; - - _func_enter_; - - request = 0x05; - requesttype = 0x00;//write_out - index = 0;//n/a - - wvalue = (u16)(addr&0x0000ffff); - len = 4; - data =val; - - ret =usbctrl_vendorreq(pintfhdl, request, wvalue, index, &data, len, requesttype); - - _func_exit_; - - return ret; - -} - -static int usb_writeN(struct intf_hdl *pintfhdl, u32 addr, u32 length, u8 *pdata) -{ - u8 request; - u8 requesttype; - u16 wvalue; - u16 index; - u16 len; - u8 buf[VENDOR_CMD_MAX_DATA_LEN]={0}; - int ret; - - _func_enter_; - - request = 0x05; - requesttype = 0x00;//write_out - index = 0;//n/a - - wvalue = (u16)(addr&0x0000ffff); - len = length; - _rtw_memcpy(buf, pdata, len ); - - ret = usbctrl_vendorreq(pintfhdl, request, wvalue, index, buf, len, requesttype); - - _func_exit_; - - return ret; - -} - #ifdef CONFIG_SUPPORT_USB_INT void interrupt_handler_8812au(_adapter *padapter,u16 pkt_len,u8 *pbuf) { @@ -331,11 +139,10 @@ static void usb_read_interrupt_complete(struct urb *purb, struct pt_regs *regs) int err; _adapter *padapter = (_adapter *)purb->context; - if(padapter->bSurpriseRemoved || padapter->bDriverStopped||padapter->bReadPortCancel) + if(RTW_CANNOT_RX(padapter)) { - DBG_8192C("%s() RX Warning! bDriverStopped(%d) OR bSurpriseRemoved(%d) bReadPortCancel(%d)\n", - __FUNCTION__,padapter->bDriverStopped, padapter->bSurpriseRemoved,padapter->bReadPortCancel); - + DBG_8192C("%s() RX Warning! bDriverStopped(%d) OR bSurpriseRemoved(%d)\n", + __FUNCTION__,padapter->bDriverStopped, padapter->bSurpriseRemoved,); return; } @@ -364,7 +171,7 @@ static void usb_read_interrupt_complete(struct urb *purb, struct pt_regs *regs) case -ENODEV: case -ESHUTDOWN: //padapter->bSurpriseRemoved=_TRUE; - RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete:bSurpriseRemoved=TRUE\n")); + //RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete:bSurpriseRemoved=TRUE\n")); case -ENOENT: padapter->bDriverStopped=_TRUE; RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete:bDriverStopped=TRUE\n")); @@ -393,6 +200,12 @@ static u32 usb_read_interrupt(struct intf_hdl *pintfhdl, u32 addr) _func_enter_; + if (RTW_CANNOT_RX(adapter)) + { + RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_interrupt:( RTW_CANNOT_RX )!!!\n")); + return _FAIL; + } + //translate DMA FIFO addr to pipehandle pipe = ffaddr2pipehdl(pdvobj, addr); @@ -549,7 +362,7 @@ static s32 pre_recv_entry(union recv_frame *precvframe, u8 *pphy_status) //recvframe_pull(precvframe_if2, drvinfo_sz + RXDESC_SIZE); if (pattrib->physt && pphy_status) - rtl8812_query_rx_phy_status(precvframe_if2, pphy_status); + rx_query_phy_status(precvframe_if2, pphy_status); ret = rtw_recv_entry(precvframe_if2); } @@ -565,7 +378,7 @@ static s32 pre_recv_entry(union recv_frame *precvframe, u8 *pphy_status) } //if (precvframe->u.hdr.attrib.physt) - // rtl8812_query_rx_phy_status(precvframe, pphy_status); + // rx_query_phy_status(precvframe, pphy_status); //ret = rtw_recv_entry(precvframe); @@ -575,13 +388,7 @@ static s32 pre_recv_entry(union recv_frame *precvframe, u8 *pphy_status) } -static int recvbuf2recvframe(_adapter *padapter, -#ifdef CONFIG_USE_USB_BUFFER_ALLOC_RX -struct recv_buf *precvbuf -#else -_pkt *pskb -#endif -) +int recvbuf2recvframe(PADAPTER padapter, void *ptr) { u8 *pbuf; u8 pkt_cnt = 0; @@ -593,12 +400,15 @@ _pkt *pskb HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); struct recv_priv *precvpriv = &padapter->recvpriv; _queue *pfree_recv_queue = &precvpriv->free_recv_queue; + _pkt *pskb; #ifdef CONFIG_USE_USB_BUFFER_ALLOC_RX - transfer_len = (s32)precvbuf->transfer_len; - pbuf = precvbuf->pbuf; + pskb = NULL; + transfer_len = (s32)((struct recv_buf*)ptr)->transfer_len; + pbuf = ((struct recv_buf*)ptr)->pbuf; #else - transfer_len = (s32)pskb->len; + pskb = (_pkt*)ptr; + transfer_len = (s32)pskb->len; pbuf = pskb->data; #endif//CONFIG_USE_USB_BUFFER_ALLOC_RX @@ -647,13 +457,7 @@ _pkt *pskb pattrib->pkt_len -= IEEE80211_FCS_LEN; #endif if(rtw_os_alloc_recvframe(padapter, precvframe, - (pbuf+pattrib->shift_sz + pattrib->drvinfo_sz + RXDESC_SIZE), -#ifdef CONFIG_USE_USB_BUFFER_ALLOC_RX - NULL -#else - pskb -#endif - ) == _FAIL) + (pbuf + pattrib->shift_sz + pattrib->drvinfo_sz + RXDESC_SIZE), pskb) == _FAIL) { rtw_free_recvframe(precvframe, pfree_recv_queue); @@ -680,7 +484,7 @@ _pkt *pskb #endif //CONFIG_CONCURRENT_MODE if(pattrib->physt && pphy_status) - rtl8812_query_rx_phy_status(precvframe, pphy_status); + rx_query_phy_status(precvframe, pphy_status); if(rtw_recv_entry(precvframe) != _SUCCESS) { @@ -714,459 +518,28 @@ _pkt *pskb } -#ifdef CONFIG_USE_USB_BUFFER_ALLOC_RX -void rtl8812au_recv_tasklet(void *priv) -{ - struct recv_buf *precvbuf = NULL; - _adapter *padapter = (_adapter*)priv; - struct recv_priv *precvpriv = &padapter->recvpriv; - - while (NULL != (precvbuf = rtw_dequeue_recvbuf(&precvpriv->recv_buf_pending_queue))) - { - if ((padapter->bDriverStopped == _TRUE)||(padapter->bSurpriseRemoved== _TRUE)) - { - DBG_8192C("recv_tasklet => bDriverStopped or bSurpriseRemoved \n"); - - break; - } - - - recvbuf2recvframe(padapter, precvbuf); - - rtw_read_port(padapter, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf); - } - -} - -static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs) -{ - struct recv_buf *precvbuf = (struct recv_buf *)purb->context; - _adapter *padapter =(_adapter *)precvbuf->adapter; - struct recv_priv *precvpriv = &padapter->recvpriv; - - RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete!!!\n")); - - precvpriv->rx_pending_cnt --; - - if(padapter->bSurpriseRemoved || padapter->bDriverStopped||padapter->bReadPortCancel) - { - RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete:bDriverStopped(%d) OR bSurpriseRemoved(%d)\n", padapter->bDriverStopped, padapter->bSurpriseRemoved)); - - goto exit; - } - - if(purb->status==0)//SUCCESS - { - if ((purb->actual_length > MAX_RECVBUF_SZ) || (purb->actual_length < RXDESC_SIZE)) - { - RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete: (purb->actual_length > MAX_RECVBUF_SZ) || (purb->actual_length < RXDESC_SIZE)\n")); - - rtw_read_port(padapter, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf); - } - else - { - rtw_reset_continual_io_error(adapter_to_dvobj(padapter)); - - precvbuf->transfer_len = purb->actual_length; - - //rtw_enqueue_rx_transfer_buffer(precvpriv, rx_transfer_buf); - rtw_enqueue_recvbuf(precvbuf, &precvpriv->recv_buf_pending_queue); - - tasklet_schedule(&precvpriv->recv_tasklet); - } - } - else - { - RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete : purb->status(%d) != 0 \n", purb->status)); - - DBG_8192C("###=> usb_read_port_complete => urb status(%d)\n", purb->status); - - if(rtw_inc_and_chk_continual_io_error(adapter_to_dvobj(padapter)) == _TRUE ){ - padapter->bSurpriseRemoved = _TRUE; - } - - switch(purb->status) { - case -EINVAL: - case -EPIPE: - case -ENODEV: - case -ESHUTDOWN: - //padapter->bSurpriseRemoved=_TRUE; - RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete:bSurpriseRemoved=TRUE\n")); - case -ENOENT: - padapter->bDriverStopped=_TRUE; - RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete:bDriverStopped=TRUE\n")); - break; - case -EPROTO: - case -EILSEQ: - case -ETIME: - case -ECOMM: - case -EOVERFLOW: - #ifdef DBG_CONFIG_ERROR_DETECT - { - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); - pHalData->srestpriv.Wifi_Error_Status = USB_READ_PORT_FAIL; - } - #endif - rtw_read_port(padapter, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf); - break; - case -EINPROGRESS: - DBG_8192C("ERROR: URB IS IN PROGRESS!/n"); - break; - default: - break; - } - - } - -exit: - -_func_exit_; - -} - -static u32 usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem) -{ - int err; - unsigned int pipe; - u32 ret = _SUCCESS; - PURB purb = NULL; - struct recv_buf *precvbuf = (struct recv_buf *)rmem; - _adapter *adapter = pintfhdl->padapter; - struct dvobj_priv *pdvobj = adapter_to_dvobj(adapter); - struct pwrctrl_priv *pwrctl = dvobj_to_pwrctl(pdvobj); - struct recv_priv *precvpriv = &adapter->recvpriv; - struct usb_device *pusbd = pdvobj->pusbdev; - -_func_enter_; - - if(adapter->bDriverStopped || adapter->bSurpriseRemoved ||pwrctl->pnp_bstop_trx) - { - RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port:( padapter->bDriverStopped ||padapter->bSurpriseRemoved ||pwrctl->pnp_bstop_trx)!!!\n")); - return _FAIL; - } - - if(precvbuf !=NULL) - { - rtl8812au_init_recvbuf(adapter, precvbuf); - - if(precvbuf->pbuf) - { - precvpriv->rx_pending_cnt++; - - purb = precvbuf->purb; - - //translate DMA FIFO addr to pipehandle - pipe = ffaddr2pipehdl(pdvobj, addr); - - usb_fill_bulk_urb(purb, pusbd, pipe, - precvbuf->pbuf, - MAX_RECVBUF_SZ, - usb_read_port_complete, - precvbuf);//context is precvbuf - - purb->transfer_dma = precvbuf->dma_transfer_addr; - purb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; - - err = usb_submit_urb(purb, GFP_ATOMIC); - if((err) && (err != (-EPERM))) - { - RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("cannot submit rx in-token(err=0x%.8x), URB_STATUS =0x%.8x", err, purb->status)); - DBG_8192C("cannot submit rx in-token(err = 0x%08x),urb_status = %d\n",err,purb->status); - ret = _FAIL; - } - - } - - } - else - { - RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port:precvbuf ==NULL\n")); - ret = _FAIL; - } - -_func_exit_; - - return ret; -} -#else // CONFIG_USE_USB_BUFFER_ALLOC_RX - -void rtl8812au_recv_tasklet(void *priv) -{ - _pkt *pskb; - _adapter *padapter = (_adapter*)priv; - struct recv_priv *precvpriv = &padapter->recvpriv; - - while (NULL != (pskb = skb_dequeue(&precvpriv->rx_skb_queue))) - { - if ((padapter->bDriverStopped == _TRUE)||(padapter->bSurpriseRemoved== _TRUE)) - { - DBG_8192C("recv_tasklet => bDriverStopped or bSurpriseRemoved \n"); - rtw_skb_free(pskb); - break; - } - - recvbuf2recvframe(padapter, pskb); - -#ifdef CONFIG_PREALLOC_RECV_SKB - - skb_reset_tail_pointer(pskb); - - pskb->len = 0; - - skb_queue_tail(&precvpriv->free_recv_skb_queue, pskb); - -#else - rtw_skb_free(pskb); -#endif - - } - -} - - -static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs) -{ - _irqL irqL; - uint isevt, *pbuf; - struct recv_buf *precvbuf = (struct recv_buf *)purb->context; - _adapter *padapter =(_adapter *)precvbuf->adapter; - struct recv_priv *precvpriv = &padapter->recvpriv; - - RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete!!!\n")); - - //_enter_critical(&precvpriv->lock, &irqL); - //precvbuf->irp_pending=_FALSE; - //precvpriv->rx_pending_cnt --; - //_exit_critical(&precvpriv->lock, &irqL); - - precvpriv->rx_pending_cnt --; - - //if(precvpriv->rx_pending_cnt== 0) - //{ - // RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete: rx_pending_cnt== 0, set allrxreturnevt!\n")); - // _rtw_up_sema(&precvpriv->allrxreturnevt); - //} - - if(padapter->bSurpriseRemoved || padapter->bDriverStopped||padapter->bReadPortCancel) - { - RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete:bDriverStopped(%d) OR bSurpriseRemoved(%d)\n", padapter->bDriverStopped, padapter->bSurpriseRemoved)); - - #ifdef CONFIG_PREALLOC_RECV_SKB - precvbuf->reuse = _TRUE; - #else - if(precvbuf->pskb){ - DBG_8192C("==> free skb(%p)\n",precvbuf->pskb); - rtw_skb_free(precvbuf->pskb); - } - #endif - DBG_8192C("%s() RX Warning! bDriverStopped(%d) OR bSurpriseRemoved(%d) bReadPortCancel(%d)\n", - __FUNCTION__,padapter->bDriverStopped, padapter->bSurpriseRemoved,padapter->bReadPortCancel); - goto exit; - } - - if(purb->status==0)//SUCCESS - { - if ((purb->actual_length > MAX_RECVBUF_SZ) || (purb->actual_length < RXDESC_SIZE)) - { - RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete: (purb->actual_length > MAX_RECVBUF_SZ) || (purb->actual_length < RXDESC_SIZE)\n")); - precvbuf->reuse = _TRUE; - rtw_read_port(padapter, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf); - DBG_8192C("%s()-%d: RX Warning!\n", __FUNCTION__, __LINE__); - } - else - { - rtw_reset_continual_io_error(adapter_to_dvobj(padapter)); - - precvbuf->transfer_len = purb->actual_length; - skb_put(precvbuf->pskb, purb->actual_length); - skb_queue_tail(&precvpriv->rx_skb_queue, precvbuf->pskb); - - if (skb_queue_len(&precvpriv->rx_skb_queue)<=1) - tasklet_schedule(&precvpriv->recv_tasklet); - - precvbuf->pskb = NULL; - precvbuf->reuse = _FALSE; - rtw_read_port(padapter, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf); - } - } - else - { - RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete : purb->status(%d) != 0 \n", purb->status)); - - DBG_8192C("###=> usb_read_port_complete => urb status(%d)\n", purb->status); - - if(rtw_inc_and_chk_continual_io_error(adapter_to_dvobj(padapter)) == _TRUE ){ - padapter->bSurpriseRemoved = _TRUE; - } - - switch(purb->status) { - case -EINVAL: - case -EPIPE: - case -ENODEV: - case -ESHUTDOWN: - //padapter->bSurpriseRemoved=_TRUE; - RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete:bSurpriseRemoved=TRUE\n")); - case -ENOENT: - padapter->bDriverStopped=_TRUE; - RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete:bDriverStopped=TRUE\n")); - break; - case -EPROTO: - case -EILSEQ: - case -ETIME: - case -ECOMM: - case -EOVERFLOW: - #ifdef DBG_CONFIG_ERROR_DETECT - { - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); - pHalData->srestpriv.Wifi_Error_Status = USB_READ_PORT_FAIL; - } - #endif - precvbuf->reuse = _TRUE; - rtw_read_port(padapter, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf); - break; - case -EINPROGRESS: - DBG_8192C("ERROR: URB IS IN PROGRESS!/n"); - break; - default: - break; - } - - } - -exit: - -_func_exit_; - -} - -static u32 usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem) -{ - _irqL irqL; - int err; - unsigned int pipe; - SIZE_PTR tmpaddr=0; - SIZE_PTR alignment=0; - u32 ret = _SUCCESS; - PURB purb = NULL; - struct recv_buf *precvbuf = (struct recv_buf *)rmem; - _adapter *adapter = pintfhdl->padapter; - struct dvobj_priv *pdvobj = adapter_to_dvobj(adapter); - struct pwrctrl_priv *pwrctl = dvobj_to_pwrctl(pdvobj); - struct recv_priv *precvpriv = &adapter->recvpriv; - struct usb_device *pusbd = pdvobj->pusbdev; - - -_func_enter_; - - if(adapter->bDriverStopped || adapter->bSurpriseRemoved ||pwrctl->pnp_bstop_trx) - { - RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port:( padapter->bDriverStopped ||padapter->bSurpriseRemoved ||pwrctl->pnp_bstop_trx)!!!\n")); - return _FAIL; - } - -#ifdef CONFIG_PREALLOC_RECV_SKB - if((precvbuf->reuse == _FALSE) || (precvbuf->pskb == NULL)) - { - if (NULL != (precvbuf->pskb = skb_dequeue(&precvpriv->free_recv_skb_queue))) - { - precvbuf->reuse = _TRUE; - } - } -#endif - - - if(precvbuf !=NULL) - { - rtl8812au_init_recvbuf(adapter, precvbuf); - - //re-assign for linux based on skb - if((precvbuf->reuse == _FALSE) || (precvbuf->pskb == NULL)) - { - precvbuf->pskb = rtw_skb_alloc(MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ); - - if(precvbuf->pskb == NULL) - { - RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("init_recvbuf(): alloc_skb fail!\n")); - DBG_8192C("#### usb_read_port() alloc_skb fail!#####\n"); - return _FAIL; - } - - tmpaddr = (SIZE_PTR)precvbuf->pskb->data; - alignment = tmpaddr & (RECVBUFF_ALIGN_SZ-1); - skb_reserve(precvbuf->pskb, (RECVBUFF_ALIGN_SZ - alignment)); - - precvbuf->phead = precvbuf->pskb->head; - precvbuf->pdata = precvbuf->pskb->data; - precvbuf->ptail = skb_tail_pointer(precvbuf->pskb); - precvbuf->pend = skb_end_pointer(precvbuf->pskb); - precvbuf->pbuf = precvbuf->pskb->data; - } - else//reuse skb - { - precvbuf->phead = precvbuf->pskb->head; - precvbuf->pdata = precvbuf->pskb->data; - precvbuf->ptail = skb_tail_pointer(precvbuf->pskb); - precvbuf->pend = skb_end_pointer(precvbuf->pskb); - precvbuf->pbuf = precvbuf->pskb->data; - - precvbuf->reuse = _FALSE; - } - - //_enter_critical(&precvpriv->lock, &irqL); - //precvpriv->rx_pending_cnt++; - //precvbuf->irp_pending = _TRUE; - //_exit_critical(&precvpriv->lock, &irqL); - - precvpriv->rx_pending_cnt++; - - purb = precvbuf->purb; - - //translate DMA FIFO addr to pipehandle - pipe = ffaddr2pipehdl(pdvobj, addr); - - usb_fill_bulk_urb(purb, pusbd, pipe, - precvbuf->pbuf, - MAX_RECVBUF_SZ, - usb_read_port_complete, - precvbuf);//context is precvbuf - - err = usb_submit_urb(purb, GFP_ATOMIC); - if((err) && (err != (-EPERM))) - { - RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("cannot submit rx in-token(err=0x%.8x), URB_STATUS =0x%.8x", err, purb->status)); - DBG_8192C("cannot submit rx in-token(err = 0x%08x),urb_status = %d\n",err,purb->status); - ret = _FAIL; - } - } - else - { - RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port:precvbuf ==NULL\n")); - ret = _FAIL; - } - -_func_exit_; - - return ret; -} -#endif // CONFIG_USE_USB_BUFFER_ALLOC_RX - void rtl8812au_xmit_tasklet(void *priv) { int ret = _FALSE; _adapter *padapter = (_adapter*)priv; struct xmit_priv *pxmitpriv = &padapter->xmitpriv; - if(check_fwstate(&padapter->mlmepriv, _FW_UNDER_SURVEY) == _TRUE) - return; - while(1) { - if ((padapter->bDriverStopped == _TRUE)||(padapter->bSurpriseRemoved== _TRUE) || (padapter->bWritePortCancel == _TRUE)) + if (RTW_CANNOT_TX(padapter)) { DBG_8192C("xmit_tasklet => bDriverStopped or bSurpriseRemoved or bWritePortCancel\n"); break; } + if(check_fwstate(&padapter->mlmepriv, _FW_UNDER_SURVEY) == _TRUE + #ifdef CONFIG_CONCURRENT_MODE + || check_buddy_fwstate(padapter, _FW_UNDER_SURVEY) == _TRUE + #endif + ) { + break; + } + ret = rtl8812au_xmitframe_complete(padapter, pxmitpriv, NULL); if(ret==_FALSE) diff --git a/backports/drivers/realtek/rtl8812au/include/Hal8188EPhyReg.h b/backports/drivers/realtek/rtl8812au/include/Hal8188EPhyReg.h index 763cceadf4b60e..2ef34ed802d373 100755 --- a/backports/drivers/realtek/rtl8812au/include/Hal8188EPhyReg.h +++ b/backports/drivers/realtek/rtl8812au/include/Hal8188EPhyReg.h @@ -1059,6 +1059,7 @@ #define bMaskHWord 0xffff0000 #define bMaskLWord 0x0000ffff #define bMaskDWord 0xffffffff +#define bMaskH3Bytes 0xffffff00 #define bMask12Bits 0xfff #define bMaskH4Bits 0xf0000000 #define bMaskOFDM_D 0xffc00000 diff --git a/backports/drivers/realtek/rtl8812au/include/Hal8192CPhyReg.h b/backports/drivers/realtek/rtl8812au/include/Hal8192CPhyReg.h index e4e977c67fbbe9..1c7cd5d1ed1eb0 100755 --- a/backports/drivers/realtek/rtl8812au/include/Hal8192CPhyReg.h +++ b/backports/drivers/realtek/rtl8812au/include/Hal8192CPhyReg.h @@ -1082,6 +1082,7 @@ #define bMaskHWord 0xffff0000 #define bMaskLWord 0x0000ffff #define bMaskDWord 0xffffffff +#define bMaskH3Bytes 0xffffff00 #define bMask12Bits 0xfff #define bMaskH4Bits 0xf0000000 #define bMaskOFDM_D 0xffc00000 diff --git a/backports/drivers/realtek/rtl8812au/include/Hal8192DPhyReg.h b/backports/drivers/realtek/rtl8812au/include/Hal8192DPhyReg.h index fb32eacd90ae30..b5af827275de7a 100755 --- a/backports/drivers/realtek/rtl8812au/include/Hal8192DPhyReg.h +++ b/backports/drivers/realtek/rtl8812au/include/Hal8192DPhyReg.h @@ -482,7 +482,7 @@ #define RF_TX_G3 0x22 // #define RF_TX_BB1 0x23 // - +#define RF_T_METER_92D 0x42 #define RF_T_METER 0x42 // #define RF_SYN_G1 0x25 // RF TX Power control @@ -1112,6 +1112,7 @@ #define bMaskHWord 0xffff0000 #define bMaskLWord 0x0000ffff #define bMaskDWord 0xffffffff +#define bMaskH3Bytes 0xffffff00 #define bMask12Bits 0xfff #define bMaskH4Bits 0xf0000000 #define bMaskOFDM_D 0xffc00000 diff --git a/backports/drivers/realtek/rtl8812au/include/Hal8192EPhyCfg.h b/backports/drivers/realtek/rtl8812au/include/Hal8192EPhyCfg.h index d76863be2fae6f..c532ea6208aa3a 100755 --- a/backports/drivers/realtek/rtl8812au/include/Hal8192EPhyCfg.h +++ b/backports/drivers/realtek/rtl8812au/include/Hal8192EPhyCfg.h @@ -142,6 +142,14 @@ phy_SpurCalibration_8192E( IN PADAPTER Adapter, IN SPUR_CAL_METHOD Method ); +void PHY_SpurCalibration_8192E(IN PADAPTER Adapter); + +#ifdef CONFIG_SPUR_CAL_NBI +void +phy_SpurCalibration_8192E_NBI( + IN PADAPTER Adapter +); +#endif // // BB/MAC/RF other monitor API // diff --git a/backports/drivers/realtek/rtl8812au/include/Hal8192EPhyReg.h b/backports/drivers/realtek/rtl8812au/include/Hal8192EPhyReg.h index 0621fb96fb18e2..02a3f865a96b7c 100755 --- a/backports/drivers/realtek/rtl8812au/include/Hal8192EPhyReg.h +++ b/backports/drivers/realtek/rtl8812au/include/Hal8192EPhyReg.h @@ -425,10 +425,8 @@ #define RF_TX_BB1 0x23 // -//#if HARDWARE_TYPE_IS_RTL8192D == 1 -#define RF_T_METER_92D 0x42 // -//#else -#define RF_T_METER_88E 0x42 // +#define RF_T_METER_8192E 0x42 // +#define RF_T_METER_88E 0x42 // #define RF_T_METER 0x24 // //#endif @@ -1065,6 +1063,7 @@ #define bMaskHWord 0xffff0000 #define bMaskLWord 0x0000ffff #define bMaskDWord 0xffffffff +#define bMaskH3Bytes 0xffffff00 #define bMask12Bits 0xfff #define bMaskH4Bits 0xf0000000 #define bMaskOFDM_D 0xffc00000 diff --git a/backports/drivers/realtek/rtl8812au/include/Hal8723BPhyReg.h b/backports/drivers/realtek/rtl8812au/include/Hal8723BPhyReg.h index a9b006e2dd8157..bb1f95e3306c00 100755 --- a/backports/drivers/realtek/rtl8812au/include/Hal8723BPhyReg.h +++ b/backports/drivers/realtek/rtl8812au/include/Hal8723BPhyReg.h @@ -22,6 +22,7 @@ #include +#define rSYM_WLBT_PAPE_SEL 0x64 // BB Register Definition // // 4. Page9(0x900) @@ -29,7 +30,7 @@ #define rDPDT_control 0x92c #define rfe_ctrl_anta_src 0x930 #define rS0S1_PathSwitch 0x948 -#define AGC_table_select 0xb2c +#define rAGC_table_select 0xb2c // // PageB(0xB00) diff --git a/backports/drivers/realtek/rtl8812au/include/Hal8812PhyReg.h b/backports/drivers/realtek/rtl8812au/include/Hal8812PhyReg.h index 5125e227dc2352..f2e3a8ec36c1d9 100755 --- a/backports/drivers/realtek/rtl8812au/include/Hal8812PhyReg.h +++ b/backports/drivers/realtek/rtl8812au/include/Hal8812PhyReg.h @@ -37,7 +37,8 @@ // BW and sideband setting #define rBWIndication_Jaguar 0x834 -#define rL1PeakTH_Jaguar 0x848 +#define rL1PeakTH_Jaguar 0x848 +#define rFPGA0_XA_LSSIReadBack 0x8a0 /*Tranceiver LSSI Readback*/ #define rRFMOD_Jaguar 0x8ac //RF mode #define rADC_Buf_Clk_Jaguar 0x8c4 #define rRFECTRL_Jaguar 0x900 @@ -420,6 +421,8 @@ #define rFPGA0_AdDaClockEn 0x888 // enable ad/da clock1 for dual-phy #define rFPGA0_AnalogParameter4 0x88c #define rFPGA0_XB_LSSIReadBack 0x8a4 +#define rFPGA0_XCD_RFPara 0x8b4 + // // 4. Page9(0x900) // @@ -434,9 +437,11 @@ // #define rCCK0_System 0xa00 #define rCCK0_AFESetting 0xa04 // Disable init gain now // Select RX path by RSSI +#define rCCK0_DSPParameter2 0xa1c //SQ threshold #define rCCK0_TxFilter1 0xa20 #define rCCK0_TxFilter2 0xa24 #define rCCK0_DebugPort 0xa28 //debug port and Tx filter3 +#define rCCK0_FalseAlarmReport 0xa2c //0xa2d useless now 0xa30-a4f channel report // // PageB(0xB00) @@ -717,6 +722,7 @@ #define bMaskHWord 0xffff0000 #define bMaskLWord 0x0000ffff #define bMaskDWord 0xffffffff +#define bMaskH3Bytes 0xffffff00 #define bMask12Bits 0xfff #define bMaskH4Bits 0xf0000000 #define bMaskOFDM_D 0xffc00000 diff --git a/backports/drivers/realtek/rtl8812au/include/Hal8812PwrSeq.h b/backports/drivers/realtek/rtl8812au/include/Hal8812PwrSeq.h index 0d0c2f76775c83..5d6a7ad22b6f70 100755 --- a/backports/drivers/realtek/rtl8812au/include/Hal8812PwrSeq.h +++ b/backports/drivers/realtek/rtl8812au/include/Hal8812PwrSeq.h @@ -61,7 +61,7 @@ /* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \ {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT2, 0},/* disable SW LPS 0x04[10]=0*/ \ {0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, BIT1, BIT1},/* wait till 0x04[17] = 1 power ready*/ \ - {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT7, 0},/* disable HWPDN 0x04[15]=0*/ \ + /*{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT7, 0}, disable HWPDN 0x04[15]=0*/ \ {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT3, 0},/* disable WL suspend*/ \ {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT0, BIT0},/* polling until return 0*/ \ {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, BIT0, 0},/**/ @@ -76,7 +76,7 @@ {0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT1, 0}, /* Whole BB is reset*/ \ /*{0x001F, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0},//0x1F[7:0] = 0 turn off RF*/ \ /*{0x004E, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT7, 0},//0x4C[23] = 0x4E[7] = 0, switch DPDT_SEL_P output from register 0x65[2] */ \ - {0x0007, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0x28}, /* 0x07[7:0] = 0x28 sps pwm mode */ \ + {0x0007, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0x2A}, /* 0x07[7:0] = 0x28 sps pwm mode 0x2a for BT coex*/ \ {0x0008, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0x02, 0},/*0x8[1] = 0 ANA clk =500k */ \ /*{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT0|BIT1, 0}, // 0x02[1:0] = 0 reset BB */ \ {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT1, BIT1}, /*0x04[9] = 1 turn off MAC by HW state machine*/ \ diff --git a/backports/drivers/realtek/rtl8812au/include/autoconf.h b/backports/drivers/realtek/rtl8812au/include/autoconf.h index f433c6d6b2e18f..e97240a8ec37d7 100755 --- a/backports/drivers/realtek/rtl8812au/include/autoconf.h +++ b/backports/drivers/realtek/rtl8812au/include/autoconf.h @@ -20,16 +20,14 @@ //***** temporarily flag ******* #define CONFIG_SINGLE_IMG //#define CONFIG_DISABLE_ODM -//for FPGA VERIFICATION config -#define RTL8188E_FPGA_TRUE_PHY_VERIFICATION 0 //***** temporarily flag ******* /* * Public General Config */ #define AUTOCONF_INCLUDED -#define RTL871X_MODULE_NAME "8812AU" -#define DRV_NAME "rtl8812au" +#define RTL871X_MODULE_NAME "8821AU" +#define DRV_NAME "rtl8821au" #define CONFIG_USB_HCI 1 @@ -38,20 +36,20 @@ #define PLATFORM_LINUX 1 -//#define CONFIG_IOCTL_CFG80211 1 +#define CONFIG_IOCTL_CFG80211 1 #ifdef CONFIG_IOCTL_CFG80211 - //#define RTW_USE_CFG80211_STA_EVENT /* Indecate new sta asoc through cfg80211_new_sta */ - #define CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER + #define RTW_USE_CFG80211_STA_EVENT /* Indecate new sta asoc through cfg80211_new_sta */ + //#define CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER //#define CONFIG_DEBUG_CFG80211 //#define CONFIG_DRV_ISSUE_PROV_REQ // IOT FOR S2 #define CONFIG_SET_SCAN_DENY_TIMER + #define CONFIG_IEEE80211_BAND_5GHZ #endif /* * Internal General Config */ -//#define CONFIG_PWRCTRL //#define CONFIG_H2CLBK #define CONFIG_EMBEDDED_FWIMG 1 @@ -85,7 +83,7 @@ //#ifndef CONFIG_MP_INCLUDED #define CONFIG_IPS 1 #ifdef CONFIG_IPS - //#define CONFIG_IPS_LEVEL_2 1 //enable this to set default IPS mode to IPS_LEVEL_2 + //#define CONFIG_IPS_LEVEL_2 1 //enable this to set default IPS mode to IPS_LEVEL_2 #define CONFIG_IPS_CHECK_IN_WD // Do IPS Check in WatchDog. #endif //#define SUPPORT_HW_RFOFF_DETECTED 1 @@ -114,12 +112,12 @@ #define CONFIG_RUNTIME_PORT_SWITCH //#define DBG_RUNTIME_PORT_SWITCH #define CONFIG_STA_MODE_SCAN_UNDER_AP_MODE - #ifdef CONFIG_RTL8812A - #define CONFIG_TSF_RESET_OFFLOAD 1 // For 2 PORT TSF SYNC. - #endif + //#ifdef CONFIG_RTL8812A + //#define CONFIG_TSF_RESET_OFFLOAD 1 // For 2 PORT TSF SYNC. + //#endif + //#define CONFIG_MULTI_VIR_IFACES //besides primary&secondary interfaces, extend to support more interfaces #endif - //#define CONFIG_IOL //#else //#ifndef CONFIG_MP_INCLUDED //#endif //#ifndef CONFIG_MP_INCLUDED @@ -141,34 +139,48 @@ #endif #define CONFIG_FIND_BEST_CHANNEL 1 //#define CONFIG_NO_WIRELESS_HANDLERS 1 + + //#define CONFIG_AUTO_AP_MODE + #endif #define CONFIG_P2P 1 #ifdef CONFIG_P2P //The CONFIG_WFD is for supporting the Wi-Fi display #define CONFIG_WFD - - #ifndef CONFIG_WIFI_TEST - #define CONFIG_P2P_REMOVE_GROUP_INFO - #endif + + #define CONFIG_P2P_REMOVE_GROUP_INFO + //#define CONFIG_DBG_P2P #define CONFIG_P2P_PS //#define CONFIG_P2P_IPS #define CONFIG_P2P_OP_CHK_SOCIAL_CH - #define CONFIG_P2P_CHK_INVITE_CH_LIST + #define CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT //replace CONFIG_P2P_CHK_INVITE_CH_LIST flag + #define CONFIG_P2P_INVITE_IOT #endif // Added by Kurt 20110511 -//#define CONFIG_TDLS 1 #ifdef CONFIG_TDLS + #define CONFIG_TDLS_DRIVER_SETUP // #ifndef CONFIG_WFD -// #define CONFIG_WFD 1 +// #define CONFIG_WFD // #endif -// #define CONFIG_TDLS_AUTOSETUP 1 -// #define CONFIG_TDLS_AUTOCHECKALIVE 1 +// #define CONFIG_TDLS_AUTOSETUP + #define CONFIG_TDLS_AUTOCHECKALIVE + #define CONFIG_TDLS_CH_SW #endif +#ifdef CONFIG_BT_COEXIST + // for ODM and outsrc BT-Coex + #define BT_30_SUPPORT 1 + + #ifndef CONFIG_LPS + #define CONFIG_LPS // download reserved page to FW + #endif +#else // !CONFIG_BT_COEXIST + #define BT_30_SUPPORT 0 +#endif // !CONFIG_BT_COEXIST #define CONFIG_SKB_COPY 1//for amsdu @@ -180,13 +192,6 @@ #endif #endif // CONFIG_LED -#ifdef CONFIG_IOL - #define CONFIG_IOL_READ_EFUSE_MAP - //#define DBG_IOL_READ_EFUSE_MAP - #define CONFIG_IOL_LLT -#endif - - #define USB_INTERFERENCE_ISSUE // this should be checked in all usb interface #define CONFIG_GLOBAL_UI_PID @@ -198,17 +203,25 @@ #define CONFIG_LONG_DELAY_ISSUE #define CONFIG_NEW_SIGNAL_STAT_PROCESS //#define CONFIG_SIGNAL_DISPLAY_DBM //display RX signal with dbm +#ifdef CONFIG_SIGNAL_DISPLAY_DBM +//#define CONFIG_BACKGROUND_NOISE_MONITOR +#endif #define RTW_NOTCH_FILTER 0 /* 0:Disable, 1:Enable, */ #define CONFIG_DEAUTH_BEFORE_CONNECT -#define CONFIG_BR_EXT 1 // Enable NAT2.5 support for STA mode interface with a L2 Bridge -#ifdef CONFIG_BR_EXT -#define CONFIG_BR_EXT_BRNAME "br0" -#endif // CONFIG_BR_EXT - #define CONFIG_TX_MCAST2UNI 1 // Support IP multicast->unicast //#define CONFIG_CHECK_AC_LIFETIME 1 // Check packet lifetime of 4 ACs. +#ifdef CONFIG_WOWLAN + //#define CONFIG_GTK_OL + #define CONFIG_ARP_KEEP_ALIVE +#endif // CONFIG_WOWLAN + +#ifdef CONFIG_GPIO_WAKEUP + #ifndef WAKEUP_GPIO_IDX + #define WAKEUP_GPIO_IDX 1 // WIFI Chip Side + #endif // !WAKEUP_GPIO_IDX +#endif // CONFIG_GPIO_WAKEUP /* * Interface Related Config @@ -219,7 +232,6 @@ #define CONFIG_USB_RX_AGGREGATION 1 #endif -#define CONFIG_PREALLOC_RECV_SKB 1 //#define CONFIG_REDUCE_USB_TX_INT 1 // Trade-off: Improve performance, but may cause TX URBs blocked by USB Host/Bus driver on few platforms. //#define CONFIG_EASY_REPLACEMENT 1 @@ -228,11 +240,14 @@ */ //#define CONFIG_USE_USB_BUFFER_ALLOC_TX 1 // Trade-off: For TX path, improve stability on some platforms, but may cause performance degrade on other platforms. //#define CONFIG_USE_USB_BUFFER_ALLOC_RX 1 // For RX path - #ifdef CONFIG_USE_USB_BUFFER_ALLOC_RX -#undef CONFIG_PREALLOC_RECV_SKB -#endif +#else + #define CONFIG_PREALLOC_RECV_SKB + #ifdef CONFIG_PREALLOC_RECV_SKB + //#define CONFIG_FIX_NR_BULKIN_BUFFER /* only use PREALLOC_RECV_SKB buffer, don't alloc skb at runtime */ + #endif +#endif /* * USB VENDOR REQ BUFFER ALLOCATION METHOD @@ -252,8 +267,6 @@ */ #define RTL8812A_RX_PACKET_INCLUDE_CRC 0 -#define CONFIG_RX_PACKET_APPEND_FCS - //#define CONFIG_ONLY_ONE_OUT_EP_TO_LOW 0 #define CONFIG_OUT_EP_WIFI_MODE 0 @@ -294,9 +307,6 @@ #endif//CONFIG_PLATFORM_MN10300 -#ifdef CONFIG_PLATFORM_TI_DM365 -#define CONFIG_USE_USB_BUFFER_ALLOC_RX -#endif #if defined(CONFIG_PLATFORM_ACTIONS_ATM702X) @@ -330,36 +340,25 @@ #define RTL8723AS_SUPPORT 0 #define RTL8723AE_SUPPORT 0 #define RTL8723A_SUPPORT (RTL8723AU_SUPPORT|RTL8723AS_SUPPORT|RTL8723AE_SUPPORT) - #define RTL8723_FPGA_VERIFICATION 0 -#define RTL8188EE_SUPPORT 0 -#define RTL8188EU_SUPPORT 0 -#define RTL8188ES_SUPPORT 0 -#define RTL8188E_SUPPORT (RTL8188EE_SUPPORT|RTL8188EU_SUPPORT|RTL8188ES_SUPPORT) - -#define RTL8812E_SUPPORT 0 +#define RTL8188E_SUPPORT 0 #ifdef CONFIG_RTL8812A -#define RTL8812AU_SUPPORT 1 +#define RTL8812A_SUPPORT 1 #else -#define RTL8812AU_SUPPORT 0 +#define RTL8812A_SUPPORT 0 #endif -#define RTL8812A_SUPPORT (RTL8812E_SUPPORT|RTL8812AU_SUPPORT) - - #ifdef CONFIG_RTL8821A #define RTL8821A_SUPPORT 1 #else #define RTL8821A_SUPPORT 0 #endif - #define RTL8723B_SUPPORT 0 - #define RTL8192E_SUPPORT 0 +#define RTL8814A_SUPPORT 0 +#define RTL8195A_SUPPORT 0 -#define RTL8813A_SUPPORT 0 - -#define RATE_ADAPTIVE_SUPPORT 0 +#define RATE_ADAPTIVE_SUPPORT 0 #define POWER_TRAINING_ACTIVE 0 #ifdef CONFIG_USB_TX_AGGREGATION diff --git a/backports/drivers/realtek/rtl8812au/include/basic_types.h b/backports/drivers/realtek/rtl8812au/include/basic_types.h index 497b328bc1c536..33abdb42a8ebbe 100755 --- a/backports/drivers/realtek/rtl8812au/include/basic_types.h +++ b/backports/drivers/realtek/rtl8812au/include/basic_types.h @@ -76,7 +76,7 @@ #ifdef PLATFORM_LINUX - + #include #include #define IN #define OUT @@ -96,6 +96,10 @@ #define UINT u32 #define ULONG u32 + #if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19)) + typedef _Bool bool; + #endif + typedef void (*proc_t)(void*); typedef __kernel_size_t SIZE_T; @@ -268,7 +272,7 @@ ( \ LE_P2BYTE_TO_HOST_2BYTE(__pStart) \ & \ - ( ~BIT_OFFSET_LEN_MASK_16(__BitOffset, __BitLen) ) \ + (u16)(~BIT_OFFSET_LEN_MASK_16(__BitOffset, __BitLen))\ ) #define SET_BITS_TO_LE_2BYTE(__pStart, __BitOffset, __BitLen, __Value) \ @@ -299,7 +303,7 @@ ( \ LE_P1BYTE_TO_HOST_1BYTE(__pStart) \ & \ - ( ~BIT_OFFSET_LEN_MASK_8(__BitOffset, __BitLen) ) \ + (u8)(~BIT_OFFSET_LEN_MASK_8(__BitOffset, __BitLen))\ ) #define SET_BITS_TO_LE_1BYTE(__pStart, __BitOffset, __BitLen, __Value) \ @@ -310,20 +314,32 @@ ( (((u8)__Value) & BIT_LEN_MASK_8(__BitLen)) << (__BitOffset) ) \ ); -//pclint + +#define LE_BITS_CLEARED_TO_2BYTE_16BIT(__pStart, __BitOffset, __BitLen) \ + ( \ + LE_P2BYTE_TO_HOST_2BYTE(__pStart) \ + ) + +#define SET_BITS_TO_LE_2BYTE_16BIT(__pStart, __BitOffset, __BitLen, __Value) \ + *((u16 *)(__pStart)) = \ + EF2Byte( \ + LE_BITS_CLEARED_TO_2BYTE_16BIT(__pStart, __BitOffset, __BitLen) \ + | \ + ( (u16)__Value) \ + ); + #define LE_BITS_CLEARED_TO_1BYTE_8BIT(__pStart, __BitOffset, __BitLen) \ ( \ LE_P1BYTE_TO_HOST_1BYTE(__pStart) \ ) -//pclint #define SET_BITS_TO_LE_1BYTE_8BIT(__pStart, __BitOffset, __BitLen, __Value) \ { \ - *((pu1Byte)(__pStart)) = \ + *((u8 *)(__pStart)) = \ EF1Byte( \ LE_BITS_CLEARED_TO_1BYTE_8BIT(__pStart, __BitOffset, __BitLen) \ | \ - ((u1Byte)__Value) \ + ((u8)__Value) \ ); \ } diff --git a/backports/drivers/realtek/rtl8812au/include/drv_conf.h b/backports/drivers/realtek/rtl8812au/include/drv_conf.h index 1b1aa722ca71c3..b386de0e5549df 100755 --- a/backports/drivers/realtek/rtl8812au/include/drv_conf.h +++ b/backports/drivers/realtek/rtl8812au/include/drv_conf.h @@ -46,6 +46,7 @@ #define CONFIG_SIGNAL_DISPLAY_DBM #endif +/* #if defined(CONFIG_HAS_EARLYSUSPEND) && defined (CONFIG_RESUME_IN_WORKQUEUE) #warning "You have CONFIG_HAS_EARLYSUSPEND enabled in your system, we disable CONFIG_RESUME_IN_WORKQUEUE automatically" #undef CONFIG_RESUME_IN_WORKQUEUE @@ -55,6 +56,7 @@ #warning "You have CONFIG_ANDROID_POWER enabled in your system, we disable CONFIG_RESUME_IN_WORKQUEUE automatically" #undef CONFIG_RESUME_IN_WORKQUEUE #endif +*/ #ifdef CONFIG_RESUME_IN_WORKQUEUE //this can be removed, because there is no case for this... #if !defined( CONFIG_WAKELOCK) && !defined(CONFIG_ANDROID_POWER) @@ -73,6 +75,34 @@ #define CONFIG_USB_VENDOR_REQ_MUTEX #endif +#define DYNAMIC_CAMID_ALLOC + +#ifndef CONFIG_RTW_HIQ_FILTER + #define CONFIG_RTW_HIQ_FILTER 1 +#endif + +#ifndef CONFIG_RTW_ADAPTIVITY_EN + #define CONFIG_RTW_ADAPTIVITY_EN 0 +#endif + +#ifndef CONFIG_RTW_ADAPTIVITY_MODE + #define CONFIG_RTW_ADAPTIVITY_MODE 0 +#endif + +#ifndef CONFIG_RTW_ADAPTIVITY_DML + #define CONFIG_RTW_ADAPTIVITY_DML 0 +#endif + +#ifndef CONFIG_RTW_AMPLIFIER_TYPE_2G + #define CONFIG_RTW_AMPLIFIER_TYPE_2G 0 +#endif + +#ifndef CONFIG_RTW_AMPLIFIER_TYPE_5G + #define CONFIG_RTW_AMPLIFIER_TYPE_5G 0 +#endif + +#define MACID_NUM_SW_LIMIT 32 +#define CAM_ENTRY_NUM_SW_LIMIT 32 //#include diff --git a/backports/drivers/realtek/rtl8812au/include/drv_types.h b/backports/drivers/realtek/rtl8812au/include/drv_types.h index 60c364648096dc..8f028a80591daa 100755 --- a/backports/drivers/realtek/rtl8812au/include/drv_types.h +++ b/backports/drivers/realtek/rtl8812au/include/drv_types.h @@ -34,7 +34,10 @@ #include #include #include - +#ifdef CONFIG_ARP_KEEP_ALIVE +#include +#include +#endif #ifdef PLATFORM_OS_XP #include @@ -57,8 +60,6 @@ enum _NIC_VERSION { }; -#define CONFIG_SUSPEND_REFINE - typedef struct _ADAPTER _adapter, ADAPTER,*PADAPTER; #include @@ -76,22 +77,24 @@ typedef struct _ADAPTER _adapter, ADAPTER,*PADAPTER; #include #endif -#ifdef CONFIG_BEAMFORMING -#include -#endif - #include #include #include #include #include #include + +#ifdef CONFIG_BEAMFORMING +#include +#endif + #include #include #include #include #include #include +#include "../hal/hal_dm.h" #include #include #include @@ -111,6 +114,10 @@ typedef struct _ADAPTER _adapter, ADAPTER,*PADAPTER; #include #include +#ifdef CONFIG_PREALLOC_RX_SKB_BUFFER +#include +#endif + #ifdef CONFIG_P2P #include #endif // CONFIG_P2P @@ -139,10 +146,6 @@ typedef struct _ADAPTER _adapter, ADAPTER,*PADAPTER; #include #endif // CONFIG_IOL -#ifdef CONFIG_IOCTL_CFG80211 -#include "ioctl_cfg80211.h" -#endif //CONFIG_IOCTL_CFG80211 - #include #include #include @@ -150,6 +153,10 @@ typedef struct _ADAPTER _adapter, ADAPTER,*PADAPTER; #include +#ifdef CONFIG_BT_COEXIST +#include +#endif // CONFIG_BT_COEXIST + #define SPEC_DEV_ID_NONE BIT(0) #define SPEC_DEV_ID_DISABLE_HT BIT(1) #define SPEC_DEV_ID_ENABLE_PS BIT(2) @@ -247,13 +254,14 @@ struct registry_priv u8 low_power ; u8 wifi_spec;// !turbo_mode - + u8 special_rf_path; // 0: 2T2R ,1: only turn on path A 1T1R u8 channel_plan; #ifdef CONFIG_BT_COEXIST u8 btcoex; u8 bt_iso; u8 bt_sco; u8 bt_ampdu; + s8 ant_num; #endif BOOLEAN bAcceptAddbaReq; @@ -295,7 +303,6 @@ struct registry_priv u8 force_ant;//0 normal,1 main,2 aux u8 force_igi;//0 normal #endif - u8 regulatory_tid; //define for tx power adjust u8 RegEnableTxPowerLimit; @@ -318,12 +325,31 @@ struct registry_priv #ifdef CONFIG_MULTI_VIR_IFACES u8 ext_iface_num;//primary/secondary iface is excluded #endif + u8 qos_opt_enable; + + u8 hiq_filter; + u8 adaptivity_en; + u8 adaptivity_mode; + u8 adaptivity_dml; + u8 boffefusemask; + BOOLEAN bFileMaskEfuse; }; //For registry parameters #define RGTRY_OFT(field) ((ULONG)FIELD_OFFSET(struct registry_priv,field)) #define RGTRY_SZ(field) sizeof(((struct registry_priv*) 0)->field) + +#define GetRegAmplifierType2G(_Adapter) (_Adapter->registrypriv.AmplifierType_2G) +#define GetRegAmplifierType5G(_Adapter) (_Adapter->registrypriv.AmplifierType_5G) + +#define GetRegTxBBSwing_2G(_Adapter) (_Adapter->registrypriv.TxBBSwing_2G) +#define GetRegTxBBSwing_5G(_Adapter) (_Adapter->registrypriv.TxBBSwing_5G) + +#define GetRegbENRFEType(_Adapter) (_Adapter->registrypriv.bEn_RFE) +#define GetRegRFEType(_Adapter) (_Adapter->registrypriv.RFE_Type) + + #define BSSID_OFT(field) ((ULONG)FIELD_OFFSET(WLAN_BSSID_EX,field)) #define BSSID_SZ(field) sizeof(((PWLAN_BSSID_EX) 0)->field) @@ -350,6 +376,8 @@ struct registry_priv #define GET_IFACE_NUMS(padapter) (((_adapter *)padapter)->dvobj->iface_nums) #define GET_ADAPTER(padapter, iface_id) (((_adapter *)padapter)->dvobj->padapters[iface_id]) +#define GetDefaultAdapter(padapter) padapter + enum _IFACE_ID { IFACE_ID0, //maping to PRIMARY_ADAPTER IFACE_ID1, //maping to SECONDARY_ADAPTER @@ -358,6 +386,131 @@ enum _IFACE_ID { IFACE_ID_MAX, }; +#ifdef CONFIG_DBG_COUNTER + +struct rx_logs { + u32 intf_rx; + u32 intf_rx_err_recvframe; + u32 intf_rx_err_skb; + u32 intf_rx_report; + u32 core_rx; + u32 core_rx_pre; + u32 core_rx_pre_ver_err; + u32 core_rx_pre_mgmt; + u32 core_rx_pre_mgmt_err_80211w; + u32 core_rx_pre_mgmt_err; + u32 core_rx_pre_ctrl; + u32 core_rx_pre_ctrl_err; + u32 core_rx_pre_data; + u32 core_rx_pre_data_wapi_seq_err; + u32 core_rx_pre_data_wapi_key_err; + u32 core_rx_pre_data_handled; + u32 core_rx_pre_data_err; + u32 core_rx_pre_data_unknown; + u32 core_rx_pre_unknown; + u32 core_rx_enqueue; + u32 core_rx_dequeue; + u32 core_rx_post; + u32 core_rx_post_decrypt; + u32 core_rx_post_decrypt_wep; + u32 core_rx_post_decrypt_tkip; + u32 core_rx_post_decrypt_aes; + u32 core_rx_post_decrypt_wapi; + u32 core_rx_post_decrypt_hw; + u32 core_rx_post_decrypt_unknown; + u32 core_rx_post_decrypt_err; + u32 core_rx_post_defrag_err; + u32 core_rx_post_portctrl_err; + u32 core_rx_post_indicate; + u32 core_rx_post_indicate_in_oder; + u32 core_rx_post_indicate_reoder; + u32 core_rx_post_indicate_err; + u32 os_indicate; + u32 os_indicate_ap_mcast; + u32 os_indicate_ap_forward; + u32 os_indicate_ap_self; + u32 os_indicate_err; + u32 os_netif_ok; + u32 os_netif_err; +}; + +struct tx_logs { + u32 os_tx; + u32 os_tx_err_up; + u32 os_tx_err_xmit; + u32 os_tx_m2u; + u32 os_tx_m2u_ignore_fw_linked; + u32 os_tx_m2u_ignore_self; + u32 os_tx_m2u_entry; + u32 os_tx_m2u_entry_err_xmit; + u32 os_tx_m2u_entry_err_skb; + u32 os_tx_m2u_stop; + u32 core_tx; + u32 core_tx_err_pxmitframe; + u32 core_tx_err_brtx; + u32 core_tx_upd_attrib; + u32 core_tx_upd_attrib_adhoc; + u32 core_tx_upd_attrib_sta; + u32 core_tx_upd_attrib_ap; + u32 core_tx_upd_attrib_unknown; + u32 core_tx_upd_attrib_dhcp; + u32 core_tx_upd_attrib_icmp; + u32 core_tx_upd_attrib_active; + u32 core_tx_upd_attrib_err_ucast_sta; + u32 core_tx_upd_attrib_err_ucast_ap_link; + u32 core_tx_upd_attrib_err_sta; + u32 core_tx_upd_attrib_err_link; + u32 core_tx_upd_attrib_err_sec; + u32 core_tx_ap_enqueue_warn_fwstate; + u32 core_tx_ap_enqueue_warn_sta; + u32 core_tx_ap_enqueue_warn_nosta; + u32 core_tx_ap_enqueue_warn_link; + u32 core_tx_ap_enqueue_warn_trigger; + u32 core_tx_ap_enqueue_mcast; + u32 core_tx_ap_enqueue_ucast; + u32 core_tx_ap_enqueue; + u32 intf_tx; + u32 intf_tx_pending_ac; + u32 intf_tx_pending_fw_under_survey; + u32 intf_tx_pending_fw_under_linking; + u32 intf_tx_pending_xmitbuf; + u32 intf_tx_enqueue; + u32 core_tx_enqueue; + u32 core_tx_enqueue_class; + u32 core_tx_enqueue_class_err_sta; + u32 core_tx_enqueue_class_err_nosta; + u32 core_tx_enqueue_class_err_fwlink; + u32 intf_tx_direct; + u32 intf_tx_direct_err_coalesce; + u32 intf_tx_dequeue; + u32 intf_tx_dequeue_err_coalesce; + u32 intf_tx_dump_xframe; + u32 intf_tx_dump_xframe_err_txdesc; + u32 intf_tx_dump_xframe_err_port; +}; + +struct int_logs { + u32 all; + u32 err; + u32 tbdok; + u32 tbder; + u32 bcnderr; + u32 bcndma; + u32 bcndma_e; + u32 rx; + u32 rx_rdu; + u32 rx_fovw; + u32 txfovw; + u32 mgntok; + u32 highdok; + u32 bkdok; + u32 bedok; + u32 vidok; + u32 vodok; +}; + +#endif // CONFIG_DBG_COUNTER + struct debug_priv { u32 dbg_sdio_free_irq_error_cnt; u32 dbg_sdio_alloc_irq_error_cnt; @@ -388,6 +541,14 @@ struct debug_priv { u32 dbg_rpwm_toogle_cnt; u32 dbg_rpwm_timeout_fail_cnt; u32 dbg_sreset_cnt; + u64 dbg_rx_fifo_last_overflow; + u64 dbg_rx_fifo_curr_overflow; + u64 dbg_rx_fifo_diff_overflow; + u64 dbg_rx_ampdu_drop_count; + u64 dbg_rx_ampdu_forced_indicate_count; + u64 dbg_rx_ampdu_loss_count; + u64 dbg_rx_dup_mgt_frame_drop_count; + u64 dbg_rx_ampdu_window_shift_cnt; }; struct rtw_traffic_statistics { @@ -408,20 +569,53 @@ struct rtw_traffic_statistics { u32 cur_rx_tp; // Rx throughput in MBps. }; +struct cam_ctl_t { + _lock lock; + u64 bitmap; +}; + +struct cam_entry_cache { + u16 ctrl; + u8 mac[ETH_ALEN]; + u8 key[16]; +}; + +#define KEY_FMT "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x" +#define KEY_ARG(x) ((u8*)(x))[0],((u8*)(x))[1],((u8*)(x))[2],((u8*)(x))[3],((u8*)(x))[4],((u8*)(x))[5], \ + ((u8*)(x))[6],((u8*)(x))[7],((u8*)(x))[8],((u8*)(x))[9],((u8*)(x))[10],((u8*)(x))[11], \ + ((u8*)(x))[12],((u8*)(x))[13],((u8*)(x))[14],((u8*)(x))[15] + +struct macid_bmp { + u32 m0; +#if (MACID_NUM_SW_LIMIT > 32) + u32 m1; +#endif +#if (MACID_NUM_SW_LIMIT > 64) + u32 m2; +#endif +#if (MACID_NUM_SW_LIMIT > 96) + u32 m3; +#endif +}; + +struct macid_ctl_t { + _lock lock; + u8 num; + struct macid_bmp used; + struct macid_bmp bmc; + struct macid_bmp if_g[IFACE_ID_MAX]; + struct macid_bmp ch_g[2]; /* 2 ch concurrency */ +}; + struct dvobj_priv { /*-------- below is common data --------*/ - _adapter *if1; //PRIMARY_ADAPTER + _adapter *if1; //PRIMARY_ADAPTER _adapter *if2; //SECONDARY_ADAPTER s32 processing_dev_remove; - struct debug_priv drv_dbg; - - //for local/global synchronization - // - _lock lock; - int macid[NUM_STA]; + struct debug_priv drv_dbg; _mutex hw_init_mutex; _mutex h2c_fwcmd_mutex; @@ -439,6 +633,10 @@ struct dvobj_priv _adapter *padapters[IFACE_ID_MAX]; u8 iface_nums; // total number of ifaces used runtime + struct macid_ctl_t macid_ctl; + + struct cam_ctl_t cam_ctl; + struct cam_entry_cache cam_cache[TOTAL_CAM_ENTRY]; //For 92D, DMDP have 2 interface. u8 InterfaceNumber; @@ -446,12 +644,14 @@ struct dvobj_priv //In /Out Pipe information int RtInPipe[2]; - int RtOutPipe[3]; + int RtOutPipe[4]; u8 Queue2Pipe[HW_QUEUE_ENTRY];//for out pipe mapping u8 irq_alloc; ATOMIC_T continual_io_error; + ATOMIC_T disable_func; + struct pwrctrl_priv pwrctl_priv; struct rtw_traffic_statistics traffic_stat; @@ -563,6 +763,7 @@ struct dvobj_priv #define dvobj_to_pwrctl(dvobj) (&(dvobj->pwrctl_priv)) #define pwrctl_to_dvobj(pwrctl) container_of(pwrctl, struct dvobj_priv, pwrctl_priv) +#define dvobj_to_macidctl(dvobj) (&(dvobj->macid_ctl)) #ifdef PLATFORM_LINUX static struct device *dvobj_to_dev(struct dvobj_priv *dvobj) @@ -695,6 +896,10 @@ struct _ADAPTER{ struct wifi_display_info wfd_info; #endif //CONFIG_WFD +#ifdef CONFIG_BT_COEXIST_SOCKET_TRX + struct bt_coex_info coex_info; +#endif //CONFIG_BT_COEXIST_SOCKET_TRX + PVOID HalData; u32 hal_data_sz; struct hal_ops HalFunc; @@ -711,7 +916,14 @@ struct _ADAPTER{ u8 bDriverIsGoingToUnload; u8 init_adpt_in_progress; u8 bHaltInProgress; - +#ifdef CONFIG_GPIO_API + u8 pre_gpio_pin; + struct gpio_int_priv { + u8 interrupt_mode; + u8 interrupt_enable_mask; + void (*callback[8])(u8 level); + }gpiointpriv; +#endif _thread_hdl_ cmdThread; _thread_hdl_ evtThread; _thread_hdl_ xmitThread; @@ -773,11 +985,11 @@ struct _ADAPTER{ _lock glock; #endif //PLATFORM_FREEBSD int net_closed; + + u8 netif_up; u8 bFWReady; u8 bBTFWReady; - u8 bReadPortCancel; - u8 bWritePortCancel; u8 bLinkInfoDump; u8 bRxRSSIDisplay; // Added by Albert 2012/10/26 @@ -845,15 +1057,74 @@ struct _ADAPTER{ PLOOPBACKDATA ploopback; #endif + //for debug purpose u8 fix_rate; - + u8 data_fb; /* data rate fallback, valid only when fix_rate is not 0xff */ + u8 driver_vcs_en; //Enable=1, Disable=0 driver control vrtl_carrier_sense for tx + u8 driver_vcs_type;//force 0:disable VCS, 1:RTS-CTS, 2:CTS-to-self when vcs_en=1. + u8 driver_ampdu_spacing;//driver control AMPDU Density for peer sta's rx + u8 driver_rx_ampdu_factor;//0xff: disable drv ctrl, 0:8k, 1:16k, 2:32k, 3:64k; + u8 driver_rx_ampdu_spacing; //driver control Rx AMPDU Density + u8 fix_rx_ampdu_accept; + u8 fix_rx_ampdu_size; /* 0~127, TODO:consider each sta and each TID */ unsigned char in_cta_test; +#ifdef DBG_RX_COUNTER_DUMP + u8 dump_rx_cnt_mode;/*BIT0:drv,BIT1:mac,BIT2:phy*/ + u32 drv_rx_cnt_ok; + u32 drv_rx_cnt_crcerror; + u32 drv_rx_cnt_drop; +#endif + +#ifdef CONFIG_DBG_COUNTER + struct rx_logs rx_logs; + struct tx_logs tx_logs; + struct int_logs int_logs; +#endif }; #define adapter_to_dvobj(adapter) (adapter->dvobj) #define adapter_to_pwrctl(adapter) (dvobj_to_pwrctl(adapter->dvobj)) #define adapter_wdev_data(adapter) (&((adapter)->wdev_data)) +// +// Function disabled. +// +#define DF_TX_BIT BIT0 +#define DF_RX_BIT BIT1 +#define DF_IO_BIT BIT2 + +//#define RTW_DISABLE_FUNC(padapter, func) (ATOMIC_ADD(&adapter_to_dvobj(padapter)->disable_func, (func))) +//#define RTW_ENABLE_FUNC(padapter, func) (ATOMIC_SUB(&adapter_to_dvobj(padapter)->disable_func, (func))) +__inline static void RTW_DISABLE_FUNC(_adapter*padapter, int func_bit) +{ + int df = ATOMIC_READ(&adapter_to_dvobj(padapter)->disable_func); + df |= func_bit; + ATOMIC_SET(&adapter_to_dvobj(padapter)->disable_func, df); +} + +__inline static void RTW_ENABLE_FUNC(_adapter*padapter, int func_bit) +{ + int df = ATOMIC_READ(&adapter_to_dvobj(padapter)->disable_func); + df &= ~(func_bit); + ATOMIC_SET(&adapter_to_dvobj(padapter)->disable_func, df); +} + +#define RTW_IS_FUNC_DISABLED(padapter, func_bit) (ATOMIC_READ(&adapter_to_dvobj(padapter)->disable_func) & (func_bit)) + +#define RTW_CANNOT_IO(padapter) \ + ((padapter)->bSurpriseRemoved || \ + RTW_IS_FUNC_DISABLED((padapter), DF_IO_BIT)) + +#define RTW_CANNOT_RX(padapter) \ + ((padapter)->bDriverStopped || \ + (padapter)->bSurpriseRemoved || \ + RTW_IS_FUNC_DISABLED((padapter), DF_RX_BIT)) + +#define RTW_CANNOT_TX(padapter) \ + ((padapter)->bDriverStopped || \ + (padapter)->bSurpriseRemoved || \ + RTW_IS_FUNC_DISABLED((padapter), DF_TX_BIT)) + int rtw_handle_dualmac(_adapter *adapter, bool init); #ifdef CONFIG_PNO_SUPPORT @@ -865,6 +1136,11 @@ void rtw_dev_pno_debug(struct net_device *net); #endif //CONFIG_PNO_SET_DEBUG #endif //CONFIG_PNO_SUPPORT +#ifdef CONFIG_WOWLAN +int rtw_suspend_wow(_adapter *padapter); +int rtw_resume_process_wow(_adapter *padapter); +#endif + __inline static u8 *myid(struct eeprom_priv *peepriv) { return (peepriv->mac_addr); @@ -895,9 +1171,5 @@ __inline static u8 *myid(struct eeprom_priv *peepriv) #include #endif -#ifdef CONFIG_BT_COEXIST -#include -#endif // CONFIG_BT_COEXIST - #endif //__DRV_TYPES_H__ diff --git a/backports/drivers/realtek/rtl8812au/include/gspi_hal.h b/backports/drivers/realtek/rtl8812au/include/gspi_hal.h index efe1afbac8ac42..77a16f5a0d18cc 100755 --- a/backports/drivers/realtek/rtl8812au/include/gspi_hal.h +++ b/backports/drivers/realtek/rtl8812au/include/gspi_hal.h @@ -21,7 +21,7 @@ #define __GSPI_HAL_H__ -void spi_int_dpc(PADAPTER padapter); +void spi_int_dpc(PADAPTER padapter, u32 sdio_hisr); void rtw_set_hal_ops(_adapter *padapter); #ifdef CONFIG_RTL8723A diff --git a/backports/drivers/realtek/rtl8812au/include/gspi_ops.h b/backports/drivers/realtek/rtl8812au/include/gspi_ops.h index 1e77ccc183b71c..c280503029bcb3 100755 --- a/backports/drivers/realtek/rtl8812au/include/gspi_ops.h +++ b/backports/drivers/realtek/rtl8812au/include/gspi_ops.h @@ -156,6 +156,7 @@ void rtl8188es_set_hal_ops(PADAPTER padapter); #define set_hal_ops rtl8188es_set_hal_ops #endif extern void spi_set_chip_endian(PADAPTER padapter); +extern unsigned int spi_write8_endian(ADAPTER *Adapter, unsigned int addr, unsigned int buf, u32 big); extern void spi_set_intf_ops(_adapter *padapter,struct _io_ops *pops); extern void spi_set_chip_endian(PADAPTER padapter); extern void InitInterrupt8723ASdio(PADAPTER padapter); @@ -164,9 +165,6 @@ extern void EnableInterrupt8723ASdio(PADAPTER padapter); extern void DisableInterrupt8723ASdio(PADAPTER padapter); extern void spi_int_hdl(PADAPTER padapter); extern u8 HalQueryTxBufferStatus8723ASdio(PADAPTER padapter); -extern void InitInterrupt8188ESdio(PADAPTER padapter); -extern void EnableInterrupt8188ESdio(PADAPTER padapter); -extern void DisableInterrupt8188ESdio(PADAPTER padapter); #ifdef CONFIG_RTL8723B extern void InitInterrupt8723BSdio(PADAPTER padapter); extern void InitSysInterrupt8723BSdio(PADAPTER padapter); @@ -175,4 +173,18 @@ extern void DisableInterrupt8723BSdio(PADAPTER padapter); extern u8 HalQueryTxBufferStatus8723BSdio(PADAPTER padapter); #endif +#ifdef CONFIG_RTL8188E +extern void InitInterrupt8188EGspi(PADAPTER padapter); +extern void EnableInterrupt8188EGspi(PADAPTER padapter); +extern void DisableInterrupt8188EGspi(PADAPTER padapter); +extern void UpdateInterruptMask8188EGspi(PADAPTER padapter, u32 AddMSR, u32 RemoveMSR); +extern u8 HalQueryTxBufferStatus8189EGspi(PADAPTER padapter); +extern u8 HalQueryTxOQTBufferStatus8189EGspi(PADAPTER padapter); +extern void ClearInterrupt8188EGspi(PADAPTER padapter); +extern u8 CheckIPSStatus(PADAPTER padapter); +#endif // CONFIG_RTL8188E +#if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN) +extern u8 RecvOnePkt(PADAPTER padapter, u32 size); +#endif // CONFIG_WOWLAN + #endif //__GSPI_OPS_H__ diff --git a/backports/drivers/realtek/rtl8812au/include/hal_btcoex.h b/backports/drivers/realtek/rtl8812au/include/hal_btcoex.h index 00100fe5c26b49..0deb3993d818b9 100755 --- a/backports/drivers/realtek/rtl8812au/include/hal_btcoex.h +++ b/backports/drivers/realtek/rtl8812au/include/hal_btcoex.h @@ -30,6 +30,7 @@ typedef struct _BT_COEXIST u8 btTotalAntNum; u8 btChipType; u8 bInitlized; + u8 btAntisolation; } BT_COEXIST, *PBT_COEXIST; void DBG_BT_INFO(u8 *dbgmsg); @@ -41,9 +42,12 @@ void hal_btcoex_SetChipType(PADAPTER padapter, u8 chipType); u8 hal_btcoex_GetChipType(PADAPTER padapter); void hal_btcoex_SetPgAntNum(PADAPTER padapter, u8 antNum); u8 hal_btcoex_GetPgAntNum(PADAPTER padapter); +void hal_btcoex_SetSingleAntPath(PADAPTER padapter, u8 singleAntPath); u8 hal_btcoex_Initialize(PADAPTER padapter); -void hal_btcoex_InitHwConfig(PADAPTER padapter); +void hal_btcoex_PowerOnSetting(PADAPTER padapter); +void hal_btcoex_PreLoadFirmware(PADAPTER padapter); +void hal_btcoex_InitHwConfig(PADAPTER padapter, u8 bWifiOnly); void hal_btcoex_IpsNotify(PADAPTER padapter, u8 type); void hal_btcoex_LpsNotify(PADAPTER padapter, u8 type); @@ -55,10 +59,11 @@ void hal_btcoex_IQKNotify(PADAPTER padapter, u8 state); void hal_btcoex_BtInfoNotify(PADAPTER padapter, u8 length, u8 *tmpBuf); void hal_btcoex_SuspendNotify(PADAPTER padapter, u8 state); void hal_btcoex_HaltNotify(PADAPTER padapter); -void hal_btcoex_SwitchGntBt(PADAPTER padapter); +void hal_btcoex_SwitchBtTRxMask(PADAPTER padapter); void hal_btcoex_Hanlder(PADAPTER padapter); +s32 hal_btcoex_IsBTCoexRejectAMPDU(PADAPTER padapter); s32 hal_btcoex_IsBTCoexCtrlAMPDUSize(PADAPTER padapter); u32 hal_btcoex_GetAMPDUSize(PADAPTER padapter); void hal_btcoex_SetManualControl(PADAPTER padapter, u8 bmanual); @@ -74,6 +79,14 @@ void hal_btcoex_SetDBG(PADAPTER, u32 *pDbgModule); u32 hal_btcoex_GetDBG(PADAPTER, u8 *pStrBuf, u32 bufSize); u8 hal_btcoex_IncreaseScanDeviceNum(PADAPTER); u8 hal_btcoex_IsBtLinkExist(PADAPTER); - +void hal_btcoex_SetBtPatchVersion(PADAPTER,u16 btHciVer,u16 btPatchVer); +void hal_btcoex_SetHciVersion(PADAPTER, u16 hciVersion); +void hal_btcoex_SendScanNotify(PADAPTER, u8 type); +void hal_btcoex_StackUpdateProfileInfo(void); +void hal_btcoex_SetAntIsolationType(PADAPTER padapter, u8 anttype); +#ifdef CONFIG_LOAD_PHY_PARA_FROM_FILE +int hal_btcoex_AntIsolationConfig_ParaFile(IN PADAPTER Adapter,IN char* pFileName); +int hal_btcoex_ParseAntIsolationConfigFile(PADAPTER Adapter, char* buffer); +#endif // CONFIG_LOAD_PHY_PARA_FROM_FILE #endif // !__HAL_BTCOEX_H__ diff --git a/backports/drivers/realtek/rtl8812au/include/hal_com.h b/backports/drivers/realtek/rtl8812au/include/hal_com.h index e3af6691d755b6..a313f9e6945e17 100755 --- a/backports/drivers/realtek/rtl8812au/include/hal_com.h +++ b/backports/drivers/realtek/rtl8812au/include/hal_com.h @@ -34,14 +34,14 @@ // Rate //----------------------------------------------------------- // CCK Rates, TxHT = 0 -#define DESC_RATE1M 0x00 -#define DESC_RATE2M 0x01 +#define DESC_RATE1M 0x00 +#define DESC_RATE2M 0x01 #define DESC_RATE5_5M 0x02 #define DESC_RATE11M 0x03 // OFDM Rates, TxHT = 0 -#define DESC_RATE6M 0x04 -#define DESC_RATE9M 0x05 +#define DESC_RATE6M 0x04 +#define DESC_RATE9M 0x05 #define DESC_RATE12M 0x06 #define DESC_RATE18M 0x07 #define DESC_RATE24M 0x08 @@ -123,6 +123,57 @@ #define DESC_RATEVHTSS4MCS8 0x52 #define DESC_RATEVHTSS4MCS9 0x53 +#define HDATA_RATE(rate)\ +(rate==DESC_RATE1M)?"CCK_1M":\ +(rate==DESC_RATE2M)?"CCK_2M":\ +(rate==DESC_RATE5_5M)?"CCK5_5M":\ +(rate==DESC_RATE11M)?"CCK_11M":\ +(rate==DESC_RATE6M)?"OFDM_6M":\ +(rate==DESC_RATE9M)?"OFDM_9M":\ +(rate==DESC_RATE12M)?"OFDM_12M":\ +(rate==DESC_RATE18M)?"OFDM_18M":\ +(rate==DESC_RATE24M)?"OFDM_24M":\ +(rate==DESC_RATE36M)?"OFDM_36M":\ +(rate==DESC_RATE48M)?"OFDM_48M":\ +(rate==DESC_RATE54M)?"OFDM_54M":\ +(rate==DESC_RATEMCS0)?"MCS0":\ +(rate==DESC_RATEMCS1)?"MCS1":\ +(rate==DESC_RATEMCS2)?"MCS2":\ +(rate==DESC_RATEMCS3)?"MCS3":\ +(rate==DESC_RATEMCS4)?"MCS4":\ +(rate==DESC_RATEMCS5)?"MCS5":\ +(rate==DESC_RATEMCS6)?"MCS6":\ +(rate==DESC_RATEMCS7)?"MCS7":\ +(rate==DESC_RATEMCS8)?"MCS8":\ +(rate==DESC_RATEMCS9)?"MCS9":\ +(rate==DESC_RATEMCS10)?"MCS10":\ +(rate==DESC_RATEMCS11)?"MCS11":\ +(rate==DESC_RATEMCS12)?"MCS12":\ +(rate==DESC_RATEMCS13)?"MCS13":\ +(rate==DESC_RATEMCS14)?"MCS14":\ +(rate==DESC_RATEMCS15)?"MCS15":\ +(rate==DESC_RATEVHTSS1MCS0)?"VHTSS1MCS0":\ +(rate==DESC_RATEVHTSS1MCS1)?"VHTSS1MCS1":\ +(rate==DESC_RATEVHTSS1MCS2)?"VHTSS1MCS2":\ +(rate==DESC_RATEVHTSS1MCS3)?"VHTSS1MCS3":\ +(rate==DESC_RATEVHTSS1MCS4)?"VHTSS1MCS4":\ +(rate==DESC_RATEVHTSS1MCS5)?"VHTSS1MCS5":\ +(rate==DESC_RATEVHTSS1MCS6)?"VHTSS1MCS6":\ +(rate==DESC_RATEVHTSS1MCS7)?"VHTSS1MCS7":\ +(rate==DESC_RATEVHTSS1MCS8)?"VHTSS1MCS8":\ +(rate==DESC_RATEVHTSS1MCS9)?"VHTSS1MCS9":\ +(rate==DESC_RATEVHTSS2MCS0)?"VHTSS2MCS0":\ +(rate==DESC_RATEVHTSS2MCS1)?"VHTSS2MCS1":\ +(rate==DESC_RATEVHTSS2MCS2)?"VHTSS2MCS2":\ +(rate==DESC_RATEVHTSS2MCS3)?"VHTSS2MCS3":\ +(rate==DESC_RATEVHTSS2MCS4)?"VHTSS2MCS4":\ +(rate==DESC_RATEVHTSS2MCS5)?"VHTSS2MCS5":\ +(rate==DESC_RATEVHTSS2MCS6)?"VHTSS2MCS6":\ +(rate==DESC_RATEVHTSS2MCS7)?"VHTSS2MCS7":\ +(rate==DESC_RATEVHTSS2MCS8)?"VHTSS2MCS8":\ +(rate==DESC_RATEVHTSS2MCS9)?"VHTSS2MCS9":"UNKNOW" + + enum{ UP_LINK, DOWN_LINK, @@ -138,6 +189,17 @@ typedef enum _FIRMWARE_SOURCE { FW_SOURCE_HEADER_FILE = 1, //from header file } FIRMWARE_SOURCE, *PFIRMWARE_SOURCE; +// +// Queue Select Value in TxDesc +// +#define QSLT_BK 0x2//0x01 +#define QSLT_BE 0x0 +#define QSLT_VI 0x5//0x4 +#define QSLT_VO 0x7//0x6 +#define QSLT_BEACON 0x10 +#define QSLT_HIGH 0x11 +#define QSLT_MGNT 0x12 +#define QSLT_CMD 0x13 // BK, BE, VI, VO, HCCA, MANAGEMENT, COMMAND, HIGH, BEACON. //#define MAX_TX_QUEUE 9 @@ -152,6 +214,32 @@ typedef enum _FIRMWARE_SOURCE { #define PageNum_512(_Len) (u32)(((_Len)>>9) + ((_Len)&0x1FF ? 1:0)) #define PageNum(_Len, _Size) (u32)(((_Len)/(_Size)) + ((_Len)&((_Size) - 1) ? 1:0)) +struct dbg_rx_counter +{ + u32 rx_pkt_ok; + u32 rx_pkt_crc_error; + u32 rx_pkt_drop; + u32 rx_ofdm_fa; + u32 rx_cck_fa; + u32 rx_ht_fa; +}; +void rtw_dump_mac_rx_counters(_adapter* padapter,struct dbg_rx_counter *rx_counter); +void rtw_dump_phy_rx_counters(_adapter* padapter,struct dbg_rx_counter *rx_counter); +void rtw_reset_mac_rx_counters(_adapter* padapter); +void rtw_reset_phy_rx_counters(_adapter* padapter); + +#ifdef DBG_RX_COUNTER_DUMP +#define DUMP_DRV_RX_COUNTER BIT0 +#define DUMP_MAC_RX_COUNTER BIT1 +#define DUMP_PHY_RX_COUNTER BIT2 +#define DUMP_DRV_TRX_COUNTER_DATA BIT3 + +void rtw_dump_phy_rxcnts_preprocess(_adapter* padapter,u8 rx_cnt_mode); +void rtw_dump_rx_counters(_adapter* padapter); +#endif + +u8 rtw_hal_data_init(_adapter *padapter); +void rtw_hal_data_deinit(_adapter *padapter); void dump_chip_info(HAL_VERSION ChipVersion); @@ -201,6 +289,7 @@ void hw_var_port_switch(_adapter *adapter); void SetHwReg(PADAPTER padapter, u8 variable, u8 *val); void GetHwReg(PADAPTER padapter, u8 variable, u8 *val); +void rtw_hal_check_rxfifo_full(_adapter *adapter); u8 SetHalDefVar(_adapter *adapter, HAL_DEF_VARIABLE variable, void *value); u8 GetHalDefVar(_adapter *adapter, HAL_DEF_VARIABLE variable, void *value); @@ -263,5 +352,75 @@ isAllSpaceOrTab( u8 size ); +void linked_info_dump(_adapter *padapter,u8 benable); +#ifdef DBG_RX_SIGNAL_DISPLAY_RAW_DATA +void rtw_get_raw_rssi_info(void *sel, _adapter *padapter); +void rtw_store_phy_info(_adapter *padapter, union recv_frame *prframe); +void rtw_dump_raw_rssi_info(_adapter *padapter); +#endif + +#define HWSET_MAX_SIZE 512 +#ifdef CONFIG_EFUSE_CONFIG_FILE +#define EFUSE_FILE_COLUMN_NUM 16 +u32 Hal_readPGDataFromConfigFile(PADAPTER padapter, struct file *fp); +void Hal_ReadMACAddrFromFile(PADAPTER padapter, struct file *fp); +void Hal_GetPhyEfuseMACAddr(PADAPTER padapter, u8* mac_addr); +int check_phy_efuse_tx_power_info_valid(PADAPTER padapter); +int check_phy_efuse_macaddr_info_valid(PADAPTER padapter); +#endif //CONFIG_EFUSE_CONFIG_FILE + +#ifdef CONFIG_RF_GAIN_OFFSET +void rtw_bb_rf_gain_offset(_adapter *padapter); +#endif //CONFIG_RF_GAIN_OFFSET + +void dm_DynamicUsbTxAgg(_adapter *padapter, u8 from_timer); +u8 rtw_hal_busagg_qsel_check(_adapter *padapter,u8 pre_qsel,u8 next_qsel); +void GetHalODMVar( + PADAPTER Adapter, + HAL_ODM_VARIABLE eVariable, + PVOID pValue1, + PVOID pValue2); +void SetHalODMVar( + PADAPTER Adapter, + HAL_ODM_VARIABLE eVariable, + PVOID pValue1, + BOOLEAN bSet); + +#ifdef CONFIG_BACKGROUND_NOISE_MONITOR +struct noise_info +{ + u8 bPauseDIG; + u8 IGIValue; + u32 max_time;//ms + u8 chan; +}; +#endif +void rtw_get_noise(_adapter* padapter); + +void rtw_hal_set_fw_rsvd_page(_adapter* adapter, bool finished); + +#ifdef CONFIG_GPIO_API +u8 rtw_hal_get_gpio(_adapter* adapter, u8 gpio_num); +int rtw_hal_set_gpio_output_value(_adapter* adapter, u8 gpio_num, bool isHigh); +int rtw_hal_config_gpio(_adapter* adapter, u8 gpio_num, bool isOutput); +int rtw_hal_register_gpio_interrupt(_adapter* adapter, int gpio_num, void(*callback)(u8 level)); +int rtw_hal_disable_gpio_interrupt(_adapter* adapter, int gpio_num); +#endif + +#ifdef CONFIG_LOAD_PHY_PARA_FROM_FILE +extern char *rtw_phy_file_path; +extern char para_file_path[PATH_LENGTH_MAX]; +#define GetLineFromBuffer(buffer) strsep(&buffer, "\n") +#endif + +#ifdef CONFIG_FW_C2H_DEBUG +void Debug_FwC2H(PADAPTER padapter, u8 *pdata, u8 len); +#endif +/*CONFIG_FW_C2H_DEBUG*/ + + #endif //__HAL_COMMON_H__ + + + diff --git a/backports/drivers/realtek/rtl8812au/include/hal_com_h2c.h b/backports/drivers/realtek/rtl8812au/include/hal_com_h2c.h index 5563990b3fb349..0a47c5c9f415bb 100755 --- a/backports/drivers/realtek/rtl8812au/include/hal_com_h2c.h +++ b/backports/drivers/realtek/rtl8812au/include/hal_com_h2c.h @@ -79,11 +79,15 @@ enum h2c_cmd{ H2C_D0_SCAN_OFFLOAD_CTRL = 0x85, H2C_D0_SCAN_OFFLOAD_INFO = 0x86, H2C_CHNL_SWITCH_OFFLOAD = 0x87, + H2C_AOAC_RSVDPAGE3 = 0x88, + H2C_P2P_OFFLOAD_RSVD_PAGE = 0x8A, + H2C_P2P_OFFLOAD = 0x8B, H2C_RESET_TSF = 0xC0, H2C_MAXID, }; +#define H2C_INACTIVE_PS_LEN 3 #define H2C_RSVDPAGE_LOC_LEN 5 #define H2C_MEDIA_STATUS_RPT_LEN 3 #define H2C_KEEP_ALIVE_CTRL_LEN 2 @@ -95,7 +99,7 @@ enum h2c_cmd{ #define H2C_PSTUNEPARAM_LEN 4 #define H2C_MACID_CFG_LEN 7 #define H2C_BTMP_OPER_LEN 4 -#define H2C_WOWLAN_LEN 4 +#define H2C_WOWLAN_LEN 5 #define H2C_REMOTE_WAKE_CTRL_LEN 3 #define H2C_AOAC_GLOBAL_INFO_LEN 2 #define H2C_AOAC_RSVDPAGE_LOC_LEN 7 @@ -106,6 +110,8 @@ enum h2c_cmd{ #define H2C_FORCE_BT_TXPWR_LEN 3 #define H2C_BCN_RSVDPAGE_LEN 5 #define H2C_PROBERSP_RSVDPAGE_LEN 5 +#define H2C_P2PRSVDPAGE_LOC_LEN 5 +#define H2C_P2P_OFFLOAD_LEN 3 #ifdef CONFIG_WOWLAN #define eqMacAddr(a,b) ( ((a)[0]==(b)[0] && (a)[1]==(b)[1] && (a)[2]==(b)[2] && (a)[3]==(b)[3] && (a)[4]==(b)[4] && (a)[5]==(b)[5]) ? 1:0 ) @@ -162,101 +168,113 @@ enum h2c_cmd{ #endif //CONFIG_WOWLAN //_RSVDPAGE_LOC_CMD_0x00 -#define SET_H2CCMD_RSVDPAGE_LOC_PROBE_RSP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value) -#define SET_H2CCMD_RSVDPAGE_LOC_PSPOLL(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 8, __Value) -#define SET_H2CCMD_RSVDPAGE_LOC_NULL_DATA(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+2, 0, 8, __Value) -#define SET_H2CCMD_RSVDPAGE_LOC_QOS_NULL_DATA(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+3, 0, 8, __Value) -#define SET_H2CCMD_RSVDPAGE_LOC_BT_QOS_NULL_DATA(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+4, 0, 8, __Value) +#define SET_H2CCMD_RSVDPAGE_LOC_PROBE_RSP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd, 0, 8, __Value) +#define SET_H2CCMD_RSVDPAGE_LOC_PSPOLL(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+1, 0, 8, __Value) +#define SET_H2CCMD_RSVDPAGE_LOC_NULL_DATA(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+2, 0, 8, __Value) +#define SET_H2CCMD_RSVDPAGE_LOC_QOS_NULL_DATA(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+3, 0, 8, __Value) +#define SET_H2CCMD_RSVDPAGE_LOC_BT_QOS_NULL_DATA(__pH2CCmd, __Value)SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+4, 0, 8, __Value) //_MEDIA_STATUS_RPT_PARM_CMD_0x01 #define SET_H2CCMD_MSRRPT_PARM_OPMODE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value) -#define SET_H2CCMD_MSRRPT_PARM_MACID_IND(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value) -#define SET_H2CCMD_MSRRPT_PARM_MACID(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+1, 0, 8, __Value) -#define SET_H2CCMD_MSRRPT_PARM_MACID_END(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+2, 0, 8, __Value) +#define SET_H2CCMD_MSRRPT_PARM_MACID_IND(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value) +#define SET_H2CCMD_MSRRPT_PARM_MACID(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd+1, 0, 8, __Value) +#define SET_H2CCMD_MSRRPT_PARM_MACID_END(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd+2, 0, 8, __Value) //_KEEP_ALIVE_CMD_0x03 #define SET_H2CCMD_KEEPALIVE_PARM_ENABLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value) #define SET_H2CCMD_KEEPALIVE_PARM_ADOPT(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value) #define SET_H2CCMD_KEEPALIVE_PARM_PKT_TYPE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 2, 1, __Value) -#define SET_H2CCMD_KEEPALIVE_PARM_CHECK_PERIOD(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+1, 0, 8, __Value) +#define SET_H2CCMD_KEEPALIVE_PARM_CHECK_PERIOD(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd+1, 0, 8, __Value) //_DISCONNECT_DECISION_CMD_0x04 #define SET_H2CCMD_DISCONDECISION_PARM_ENABLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value) #define SET_H2CCMD_DISCONDECISION_PARM_ADOPT(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value) -#define SET_H2CCMD_DISCONDECISION_PARM_CHECK_PERIOD(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+1, 0, 8, __Value) -#define SET_H2CCMD_DISCONDECISION_PARM_TRY_PKT_NUM(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+2, 0, 8, __Value) +#define SET_H2CCMD_DISCONDECISION_PARM_CHECK_PERIOD(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd+1, 0, 8, __Value) +#define SET_H2CCMD_DISCONDECISION_PARM_TRY_PKT_NUM(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd+2, 0, 8, __Value) -#ifdef CONFIG_AP_WOWLAN //_AP_Offload 0x08 -#define SET_H2CCMD_AP_WOWLAN_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value) +#define SET_H2CCMD_AP_WOWLAN_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd, 0, 8, __Value) //_BCN_RsvdPage 0x09 -#define SET_H2CCMD_AP_WOWLAN_RSVDPAGE_LOC_BCN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value) +#define SET_H2CCMD_AP_WOWLAN_RSVDPAGE_LOC_BCN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd, 0, 8, __Value) //_Probersp_RsvdPage 0x0a -#define SET_H2CCMD_AP_WOWLAN_RSVDPAGE_LOC_ProbeRsp(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value) +#define SET_H2CCMD_AP_WOWLAN_RSVDPAGE_LOC_ProbeRsp(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd, 0, 8, __Value) //_Probersp_RsvdPage 0x13 #define SET_H2CCMD_AP_WOW_GPIO_CTRL_INDEX(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 4, __Value) #define SET_H2CCMD_AP_WOW_GPIO_CTRL_C2H_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 4, 1, __Value) #define SET_H2CCMD_AP_WOW_GPIO_CTRL_PLUS(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 5, 1, __Value) #define SET_H2CCMD_AP_WOW_GPIO_CTRL_HIGH_ACTIVE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 6, 1, __Value) #define SET_H2CCMD_AP_WOW_GPIO_CTRL_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 7, 1, __Value) -#define SET_H2CCMD_AP_WOW_GPIO_CTRL_DURATION(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 8, __Value) -#define SET_H2CCMD_AP_WOW_GPIO_CTRL_C2H_DURATION(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+2, 0, 8, __Value) +#define SET_H2CCMD_AP_WOW_GPIO_CTRL_DURATION(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+1, 0, 8, __Value) +#define SET_H2CCMD_AP_WOW_GPIO_CTRL_C2H_DURATION(__pH2CCmd, __Value)SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+2, 0, 8, __Value) //_AP_PS 0x26 #define SET_H2CCMD_AP_WOW_PS_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value) -#define SET_H2CCMD_AP_WOW_PS_32K_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value) +#define SET_H2CCMD_AP_WOW_PS_32K_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value) #define SET_H2CCMD_AP_WOW_PS_RF(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 2, 1, __Value) -#define SET_H2CCMD_AP_WOW_PS_DURATION(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 8, __Value) -#endif +#define SET_H2CCMD_AP_WOW_PS_DURATION(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+1, 0, 8, __Value) // _WoWLAN PARAM_CMD_0x80 -#define SET_H2CCMD_WOWLAN_FUNC_ENABLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value) -#define SET_H2CCMD_WOWLAN_PATTERN_MATCH_ENABLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value) +#define SET_H2CCMD_WOWLAN_FUNC_ENABLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value) +#define SET_H2CCMD_WOWLAN_PATTERN_MATCH_ENABLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value) #define SET_H2CCMD_WOWLAN_MAGIC_PKT_ENABLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 2, 1, __Value) -#define SET_H2CCMD_WOWLAN_UNICAST_PKT_ENABLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 3, 1, __Value) -#define SET_H2CCMD_WOWLAN_ALL_PKT_DROP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 4, 1, __Value) -#define SET_H2CCMD_WOWLAN_GPIO_ACTIVE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 5, 1, __Value) -#define SET_H2CCMD_WOWLAN_REKEY_WAKE_UP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 6, 1, __Value) -#define SET_H2CCMD_WOWLAN_DISCONNECT_WAKE_UP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 7, 1, __Value) -#define SET_H2CCMD_WOWLAN_GPIONUM(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 7, __Value) -#define SET_H2CCMD_WOWLAN_DATAPIN_WAKE_UP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 7, 1, __Value) -#define SET_H2CCMD_WOWLAN_GPIO_DURATION(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+2, 0, 8, __Value) -//#define SET_H2CCMD_WOWLAN_GPIO_PULSE_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+3, 0, 1, __Value) -#define SET_H2CCMD_WOWLAN_GPIO_PULSE_COUNT(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+3, 0, 8, __Value) +#define SET_H2CCMD_WOWLAN_UNICAST_PKT_ENABLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 3, 1, __Value) +#define SET_H2CCMD_WOWLAN_ALL_PKT_DROP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 4, 1, __Value) +#define SET_H2CCMD_WOWLAN_GPIO_ACTIVE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 5, 1, __Value) +#define SET_H2CCMD_WOWLAN_REKEY_WAKE_UP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 6, 1, __Value) +#define SET_H2CCMD_WOWLAN_DISCONNECT_WAKE_UP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 7, 1, __Value) +#define SET_H2CCMD_WOWLAN_GPIONUM(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 7, __Value) +#define SET_H2CCMD_WOWLAN_DATAPIN_WAKE_UP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 7, 1, __Value) +#define SET_H2CCMD_WOWLAN_GPIO_DURATION(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+2, 0, 8, __Value) +#define SET_H2CCMD_WOWLAN_GPIO_PULSE_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+3, 0, 1, __Value) +#define SET_H2CCMD_WOWLAN_GPIO_PULSE_COUNT(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+3, 1, 7, __Value) +#define SET_H2CCMD_WOWLAN_LOWPR_RX(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+4, 0, 1, __Value) // _REMOTE_WAKEUP_CMD_0x81 #define SET_H2CCMD_REMOTE_WAKECTRL_ENABLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value) -#define SET_H2CCMD_REMOTE_WAKE_CTRL_ARP_OFFLOAD_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value) -#define SET_H2CCMD_REMOTE_WAKE_CTRL_NDP_OFFLOAD_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 2, 1, __Value) -#define SET_H2CCMD_REMOTE_WAKE_CTRL_GTK_OFFLOAD_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 3, 1, __Value) +#define SET_H2CCMD_REMOTE_WAKE_CTRL_ARP_OFFLOAD_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value) +#define SET_H2CCMD_REMOTE_WAKE_CTRL_NDP_OFFLOAD_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 2, 1, __Value) +#define SET_H2CCMD_REMOTE_WAKE_CTRL_GTK_OFFLOAD_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 3, 1, __Value) #define SET_H2CCMD_REMOTE_WAKE_CTRL_NLO_OFFLOAD_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 4, 1, __Value) #define SET_H2CCMD_REMOTE_WAKE_CTRL_FW_UNICAST_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 7, 1, __Value) +#define SET_H2CCMD_REMOTE_WAKE_CTRL_P2P_OFFLAD_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 1, __Value) +#define SET_H2CCMD_REMOTE_WAKE_CTRL_NBNS_FILTER_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 2, 1, __Value) #define SET_H2CCMD_REMOTE_WAKE_CTRL_ARP_ACTION(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+2, 0, 1, __Value) +#define SET_H2CCMD_REMOTE_WAKE_CTRL_FW_PARSING_UNTIL_WAKEUP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+2, 4, 1, __Value) // AOAC_GLOBAL_INFO_0x82 -#define SET_H2CCMD_AOAC_GLOBAL_INFO_PAIRWISE_ENC_ALG(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value) -#define SET_H2CCMD_AOAC_GLOBAL_INFO_GROUP_ENC_ALG(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 8, __Value) +#define SET_H2CCMD_AOAC_GLOBAL_INFO_PAIRWISE_ENC_ALG(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd, 0, 8, __Value) +#define SET_H2CCMD_AOAC_GLOBAL_INFO_GROUP_ENC_ALG(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+1, 0, 8, __Value) // AOAC_RSVDPAGE_LOC_0x83 -#define SET_H2CCMD_AOAC_RSVDPAGE_LOC_REMOTE_WAKE_CTRL_INFO(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd), 0, 8, __Value) -#define SET_H2CCMD_AOAC_RSVDPAGE_LOC_ARP_RSP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 8, __Value) -#define SET_H2CCMD_AOAC_RSVDPAGE_LOC_NEIGHBOR_ADV(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+2, 0, 8, __Value) -#define SET_H2CCMD_AOAC_RSVDPAGE_LOC_GTK_RSP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+3, 0, 8, __Value) -#define SET_H2CCMD_AOAC_RSVDPAGE_LOC_GTK_INFO(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+4, 0, 8, __Value) +#define SET_H2CCMD_AOAC_RSVDPAGE_LOC_REMOTE_WAKE_CTRL_INFO(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd), 0, 8, __Value) +#define SET_H2CCMD_AOAC_RSVDPAGE_LOC_ARP_RSP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+1, 0, 8, __Value) +#define SET_H2CCMD_AOAC_RSVDPAGE_LOC_NEIGHBOR_ADV(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+2, 0, 8, __Value) +#define SET_H2CCMD_AOAC_RSVDPAGE_LOC_GTK_RSP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+3, 0, 8, __Value) +#define SET_H2CCMD_AOAC_RSVDPAGE_LOC_GTK_INFO(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+4, 0, 8, __Value) #ifdef CONFIG_GTK_OL -#define SET_H2CCMD_AOAC_RSVDPAGE_LOC_GTK_EXT_MEM(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+5, 0, 8, __Value) +#define SET_H2CCMD_AOAC_RSVDPAGE_LOC_GTK_EXT_MEM(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+5, 0, 8, __Value) #endif //CONFIG_GTK_OL #ifdef CONFIG_PNO_SUPPORT -#define SET_H2CCMD_AOAC_RSVDPAGE_LOC_NLO_INFO(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+6, 0, 8, __Value) +#define SET_H2CCMD_AOAC_RSVDPAGE_LOC_NLO_INFO(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd), 0, 8, __Value) #endif #ifdef CONFIG_PNO_SUPPORT // D0_Scan_Offload_Info_0x86 #define SET_H2CCMD_AOAC_NLO_FUN_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd), 3, 1, __Value) -#define SET_H2CCMD_AOAC_RSVDPAGE_LOC_PROBE_PACKET(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 8, __Value) -#define SET_H2CCMD_AOAC_RSVDPAGE_LOC_SCAN_INFO(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+2, 0, 8, __Value) -#define SET_H2CCMD_AOAC_RSVDPAGE_LOC_SSID_INFO(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+3, 0, 8, __Value) +#define SET_H2CCMD_AOAC_NLO_IPS_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd), 4, 1, __Value) +#define SET_H2CCMD_AOAC_RSVDPAGE_LOC_PROBE_PACKET(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+1, 0, 8, __Value) +#define SET_H2CCMD_AOAC_RSVDPAGE_LOC_SCAN_INFO(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+2, 0, 8, __Value) +#define SET_H2CCMD_AOAC_RSVDPAGE_LOC_SSID_INFO(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+3, 0, 8, __Value) #endif //CONFIG_PNO_SUPPORT +#ifdef CONFIG_P2P_WOWLAN +//P2P_RsvdPage_0x8a +#define SET_H2CCMD_RSVDPAGE_LOC_P2P_BCN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd, 0, 8, __Value) +#define SET_H2CCMD_RSVDPAGE_LOC_P2P_PROBE_RSP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+1, 0, 8, __Value) +#define SET_H2CCMD_RSVDPAGE_LOC_P2P_NEGO_RSP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+2, 0, 8, __Value) +#define SET_H2CCMD_RSVDPAGE_LOC_P2P_INVITE_RSP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+3, 0, 8, __Value) +#define SET_H2CCMD_RSVDPAGE_LOC_P2P_PD_RSP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+4, 0, 8, __Value) +#endif //CONFIG_P2P_WOWLAN + //---------------------------------------------------------------------------------------------------------// //------------------------------------------- Structure --------------------------------------------------// //---------------------------------------------------------------------------------------------------------// @@ -284,15 +302,31 @@ typedef struct _RSVDPAGE_LOC { u8 LocProbePacket; #endif //CONFIG_PNO_SUPPORT #endif //CONFIG_WOWLAN -#ifdef CONFIG_AP_WOWLAN u8 LocApOffloadBCN; -#endif //CONFIG_AP_WOWLAN +#ifdef CONFIG_P2P_WOWLAN + u8 LocP2PBeacon; + u8 LocP2PProbeRsp; + u8 LocNegoRsp; + u8 LocInviteRsp; + u8 LocPDRsp; +#endif //CONFIG_P2P_WOWLAN } RSVDPAGE_LOC, *PRSVDPAGE_LOC; #endif - +void dump_TX_FIFO(PADAPTER padapter, u8 page_num, u16 page_size); +u8 rtw_check_invalid_mac_address (u8 *mac_addr); +u8 rtw_hal_set_fw_media_status_cmd(_adapter* adapter, u8 mstatus, u8 macid); #if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN) void rtw_get_current_ip_address(PADAPTER padapter, u8 *pcurrentip); void rtw_get_sec_iv(PADAPTER padapter, u8*pcur_dot11txpn, u8 *StaAddr); void rtw_set_sec_pn(_adapter *padapter); + +//WOW command function +void rtw_hal_set_fw_wow_related_cmd(_adapter* padapter, u8 enable); +#ifdef CONFIG_P2P_WOWLAN +//H2C 0x8A +u8 rtw_hal_set_FwP2PRsvdPage_cmd(_adapter* adapter, PRSVDPAGE_LOC rsvdpageloc); +//H2C 0x8B +u8 rtw_hal_set_p2p_wowlan_offload_cmd(_adapter* adapter); +#endif //CONFIG_P2P_WOWLAN #endif diff --git a/backports/drivers/realtek/rtl8812au/include/hal_com_led.h b/backports/drivers/realtek/rtl8812au/include/hal_com_led.h index e03c692fd04499..79e62c6e58f1d5 100755 --- a/backports/drivers/realtek/rtl8812au/include/hal_com_led.h +++ b/backports/drivers/realtek/rtl8812au/include/hal_com_led.h @@ -264,7 +264,8 @@ typedef struct _LED_USB{ _timer BlinkTimer; // Timer object for led blinking. - _workitem BlinkWorkItem; // Workitem used by BlinkTimer to manipulate H/W to blink LED. + _workitem BlinkWorkItem; // Workitem used by BlinkTimer to manipulate H/W to blink LED.' + ATOMIC_T bCancelWorkItem; //check if WorkItem is cancelled } LED_USB, *PLED_USB; typedef struct _LED_USB LED_DATA, *PLED_DATA; diff --git a/backports/drivers/realtek/rtl8812au/include/hal_com_phycfg.h b/backports/drivers/realtek/rtl8812au/include/hal_com_phycfg.h index 6aaf8ec3e43757..19276ea53628d8 100755 --- a/backports/drivers/realtek/rtl8812au/include/hal_com_phycfg.h +++ b/backports/drivers/realtek/rtl8812au/include/hal_com_phycfg.h @@ -285,7 +285,9 @@ int PHY_ConfigRFWithParaFile(IN PADAPTER Adapter, IN char* pFileName, IN u8 eRFP int PHY_ConfigRFWithTxPwrTrackParaFile(IN PADAPTER Adapter, IN char* pFileName); int PHY_ConfigRFWithPowerLimitTableParaFile(IN PADAPTER Adapter, IN char* pFileName); -#endif + +void phy_free_filebuf(_adapter *padapter); +#endif //CONFIG_LOAD_PHY_PARA_FROM_FILE #endif //__HAL_COMMON_H__ diff --git a/backports/drivers/realtek/rtl8812au/include/hal_com_reg.h b/backports/drivers/realtek/rtl8812au/include/hal_com_reg.h index 3fd0623477c9e3..0389c9d0d6d66e 100755 --- a/backports/drivers/realtek/rtl8812au/include/hal_com_reg.h +++ b/backports/drivers/realtek/rtl8812au/include/hal_com_reg.h @@ -43,6 +43,7 @@ #define REG_SYS_FUNC_EN 0x0002 #define REG_APS_FSMCO 0x0004 #define REG_SYS_CLKR 0x0008 +#define REG_SYS_CLK_CTRL REG_SYS_CLKR #define REG_9346CR 0x000A #define REG_SYS_EEPROM_CTRL 0x000A #define REG_EE_VPD 0x000C @@ -104,6 +105,11 @@ #define REG_GPIO_OUTSTS 0x00F4 // For RTL8723 only. #define REG_TYPE_ID 0x00FC +// +// 2010/12/29 MH Add for 92D +// +#define REG_MAC_PHY_CTRL_NORMAL 0x00f8 + //----------------------------------------------------- // @@ -221,13 +227,22 @@ // 0x0400h ~ 0x047Fh Protocol Configuration // //----------------------------------------------------- -#define REG_VOQ_INFORMATION 0x0400 -#define REG_VIQ_INFORMATION 0x0404 -#define REG_BEQ_INFORMATION 0x0408 -#define REG_BKQ_INFORMATION 0x040C -#define REG_MGQ_INFORMATION 0x0410 -#define REG_HGQ_INFORMATION 0x0414 -#define REG_BCNQ_INFORMATION 0x0418 + +/* 92C, 92D */ +#define REG_VOQ_INFO 0x0400 +#define REG_VIQ_INFO 0x0404 +#define REG_BEQ_INFO 0x0408 +#define REG_BKQ_INFO 0x040C + +/* 88E, 8723A, 8812A, 8821A, 92E, 8723B */ +#define REG_Q0_INFO 0x400 +#define REG_Q1_INFO 0x404 +#define REG_Q2_INFO 0x408 +#define REG_Q3_INFO 0x40C + +#define REG_MGQ_INFO 0x0410 +#define REG_HGQ_INFO 0x0414 +#define REG_BCNQ_INFO 0x0418 #define REG_TXPKT_EMPTY 0x041A #define REG_CPU_MGQ_INFORMATION 0x041C #define REG_FWHW_TXQ_CTRL 0x0420 @@ -253,22 +268,44 @@ #define REG_FAST_EDCA_CTRL 0x0460 #define REG_RD_RESP_PKT_TH 0x0463 +/* 8723A, 8812A, 8821A, 92E, 8723B */ +#define REG_Q4_INFO 0x468 +#define REG_Q5_INFO 0x46C +#define REG_Q6_INFO 0x470 +#define REG_Q7_INFO 0x474 + #define REG_INIRTS_RATE_SEL 0x0480 #define REG_INIDATA_RATE_SEL 0x0484 +/* 8723B, 92E, 8812A, 8821A*/ +#define REG_MACID_SLEEP_3 0x0484 +#define REG_MACID_SLEEP_1 0x0488 + #define REG_POWER_STAGE1 0x04B4 #define REG_POWER_STAGE2 0x04B8 #define REG_PKT_VO_VI_LIFE_TIME 0x04C0 #define REG_PKT_BE_BK_LIFE_TIME 0x04C2 #define REG_STBC_SETTING 0x04C4 #define REG_QUEUE_CTRL 0x04C6 +#define REG_SINGLE_AMPDU_CTRL 0x04c7 #define REG_PROT_MODE_CTRL 0x04C8 #define REG_MAX_AGGR_NUM 0x04CA #define REG_RTS_MAX_AGGR_NUM 0x04CB #define REG_BAR_MODE_CTRL 0x04CC #define REG_RA_TRY_RATE_AGG_LMT 0x04CF -#define REG_EARLY_MODE_CONTROL 0x04D0 -#define REG_MACID_SLEEP 0x04D4 + +/* 8723A */ +#define REG_MACID_DROP 0x04D0 + +/* 88E */ +#define REG_EARLY_MODE_CONTROL 0x04D0 + +/* 8723B, 92E, 8812A, 8821A */ +#define REG_MACID_SLEEP_2 0x04D0 + +/* 8723A, 8723B, 92E, 8812A, 8821A */ +#define REG_MACID_SLEEP 0x04D4 + #define REG_NQOS_SEQ 0x04DC #define REG_QOS_SEQ 0x04DE #define REG_NEED_CPU_HANDLE 0x04E0 @@ -633,6 +670,9 @@ Default: 00b. #define RRSR_MCS6 BIT18 #define RRSR_MCS7 BIT19 +#define RRSR_CCK_RATES (RRSR_11M|RRSR_5_5M|RRSR_2M|RRSR_1M) +#define RRSR_OFDM_RATES (RRSR_54M|RRSR_48M|RRSR_36M|RRSR_24M|RRSR_18M|RRSR_12M|RRSR_9M|RRSR_6M) + // WOL bit information #define HAL92C_WOL_PTK_UPDATE_EVENT BIT0 #define HAL92C_WOL_GTK_UPDATE_EVENT BIT1 @@ -757,10 +797,6 @@ Default: 00b. #define CAM_READ 0x00000000 #define CAM_POLLINIG BIT31 -#define SCR_UseDK 0x01 -#define SCR_TxSecEnable 0x02 -#define SCR_RxSecEnable 0x04 - // // 10. Power Save Control Registers // @@ -1094,7 +1130,7 @@ Current IOREG MAP #define FEN_CPUEN BIT(10) #define FEN_DCORE BIT(11) #define FEN_ELDR BIT(12) -//#define FEN_DIO_RF BIT(13) +#define FEN_EN_25_1 BIT(13) #define FEN_HWPDN BIT(14) #define FEN_MREGEN BIT(15) @@ -1509,6 +1545,7 @@ Current IOREG MAP #define SCR_NoSKMC BIT(5) //No Key Search Multicast #define SCR_TXBCUSEDK BIT(6) // Force Tx Broadcast packets Use Default Key #define SCR_RXBCUSEDK BIT(7) // Force Rx Broadcast packets Use Default Key +#define SCR_CHK_KEYID BIT(8) //----------------------------------------------------- // @@ -1711,17 +1748,24 @@ Current IOREG MAP // General definitions //======================================================== -#define LAST_ENTRY_OF_TX_PKT_BUFFER_8188E 176 +#define LAST_ENTRY_OF_TX_PKT_BUFFER_8188E(__Adapter) ( IS_VENDOR_8188E_I_CUT_SERIES(__Adapter) ? 255 : 175 ) #define LAST_ENTRY_OF_TX_PKT_BUFFER_8812 255 #define LAST_ENTRY_OF_TX_PKT_BUFFER_8723B 255 #define LAST_ENTRY_OF_TX_PKT_BUFFER_8192C 255 #define LAST_ENTRY_OF_TX_PKT_BUFFER_DUAL_MAC 127 #define POLLING_LLT_THRESHOLD 20 +#if defined(CONFIG_RTL8723B) && defined(CONFIG_PCI_HCI) +#define POLLING_READY_TIMEOUT_COUNT 6000 +#else #define POLLING_READY_TIMEOUT_COUNT 1000 +#endif + // GPIO BIT -#define HAL_8192C_HW_GPIO_WPS_BIT BIT2 +#define HAL_8192C_HW_GPIO_WPS_BIT BIT2 +#define HAL_8192EU_HW_GPIO_WPS_BIT BIT7 +#define HAL_8188E_HW_GPIO_WPS_BIT BIT7 #endif //__HAL_COMMON_H__ diff --git a/backports/drivers/realtek/rtl8812au/include/hal_data.h b/backports/drivers/realtek/rtl8812au/include/hal_data.h index aae3c13c6701db..ac6007e8977e1f 100755 --- a/backports/drivers/realtek/rtl8812au/include/hal_data.h +++ b/backports/drivers/realtek/rtl8812au/include/hal_data.h @@ -22,7 +22,7 @@ #if 1//def CONFIG_SINGLE_IMG -#include "../hal/OUTSRC/odm_precomp.h" +#include "../hal/OUTSRC/phydm_precomp.h" #ifdef CONFIG_BT_COEXIST #include #endif @@ -30,7 +30,9 @@ #ifdef CONFIG_SDIO_HCI #include #endif - +#ifdef CONFIG_GSPI_HCI +#include +#endif // // For RTL8723 WiFi/BT/GPS multi-function configuration. 2010.10.06. // @@ -73,6 +75,22 @@ typedef enum _INTERFACE_SELECT_USB{ INTF_SEL5_USB_Combo_MF = 5, // USB WiFi+BT Multi-Function Combo, i.e., Proprietary layout(AS-VAU) which is the same as SDIO card } INTERFACE_SELECT_USB, *PINTERFACE_SELECT_USB; +#ifdef CONFIG_USB_HCI +//should be sync with INTERFACE_SELECT_USB +typedef enum _BOARD_TYPE_8192CUSB{ + BOARD_USB_DONGLE = 0, // USB dongle + BOARD_USB_High_PA = 1, // USB dongle with high power PA + BOARD_MINICARD = 2, // Minicard + BOARD_USB_SOLO = 3, // USB solo-Slim module + BOARD_USB_COMBO = 4, // USB Combo-Slim module +} BOARD_TYPE_8192CUSB, *PBOARD_TYPE_8192CUSB; + +#define SUPPORT_HW_RADIO_DETECT(pHalData) \ + (pHalData->BoardType == BOARD_MINICARD||\ + pHalData->BoardType == BOARD_USB_SOLO||\ + pHalData->BoardType == BOARD_USB_COMBO) +#endif + typedef enum _RT_AMPDU_BRUST_MODE{ RT_AMPDU_BRUST_NONE = 0, RT_AMPDU_BRUST_92D = 1, @@ -245,6 +263,7 @@ struct dm_priv // Add for Reading Initial Data Rate SEL Register 0x484 during watchdog. Using for fill tx desc. 2011.3.21 by Thomas u8 INIDATA_RATE[32]; + _lock IQKSpinLock; }; @@ -364,18 +383,18 @@ typedef struct hal_com_data u8 TxPwrLevelCck[RF_PATH_MAX_92C_88E][CHANNEL_MAX_NUMBER]; u8 TxPwrLevelHT40_1S[RF_PATH_MAX_92C_88E][CHANNEL_MAX_NUMBER]; // For HT 40MHZ pwr u8 TxPwrLevelHT40_2S[RF_PATH_MAX_92C_88E][CHANNEL_MAX_NUMBER]; // For HT 40MHZ pwr - u8 TxPwrHt20Diff[RF_PATH_MAX_92C_88E][CHANNEL_MAX_NUMBER];// HT 20<->40 Pwr diff + s8 TxPwrHt20Diff[RF_PATH_MAX_92C_88E][CHANNEL_MAX_NUMBER];// HT 20<->40 Pwr diff u8 TxPwrLegacyHtDiff[RF_PATH_MAX_92C_88E][CHANNEL_MAX_NUMBER];// For HT<->legacy pwr diff // Power Limit Table for 2.4G - u8 TxPwrLimit_2_4G[MAX_REGULATION_NUM] + s8 TxPwrLimit_2_4G[MAX_REGULATION_NUM] [MAX_2_4G_BANDWITH_NUM] [MAX_RATE_SECTION_NUM] [CHANNEL_MAX_NUMBER_2G] [MAX_RF_PATH_NUM]; // Power Limit Table for 5G - u8 TxPwrLimit_5G[MAX_REGULATION_NUM] + s8 TxPwrLimit_5G[MAX_REGULATION_NUM] [MAX_5G_BANDWITH_NUM] [MAX_RATE_SECTION_NUM] [CHANNEL_MAX_NUMBER_5G] @@ -461,13 +480,13 @@ typedef struct hal_com_data u8 RegReg542; u8 RegCR_1; u8 Reg837; - u8 RegRFPathS1; u16 RegRRSR; u8 CurAntenna; u8 AntDivCfg; u8 AntDetection; u8 TRxAntDivType; + u8 ant_path; //for 8723B s0/s1 selection u8 u1ForcedIgiLb; // forced IGI lower bound @@ -495,17 +514,17 @@ typedef struct hal_com_data u8 p2p_ps_offload; #endif - u8 AMPDUDensity; + //u8 AMPDUDensity; // Auto FSM to Turn On, include clock, isolation, power control for MAC only u8 bMacPwrCtrlOn; - + u8 bDisableTXPowerTraining; u8 RegIQKFWOffload; struct submit_ctx iqk_sctx; RT_AMPDU_BRUST AMPDUBurstMode; //92C maybe not use, but for compile successfully -#ifdef CONFIG_SDIO_HCI +#if defined (CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) // // For SDIO Interface HAL related // @@ -525,6 +544,9 @@ typedef struct hal_com_data // HIQ, MID, LOW, PUB free pages; padapter->xmitpriv.free_txpg u8 SdioTxFIFOFreePage[SDIO_TX_FREE_PG_QUEUE]; _lock SdioTxFIFOFreePageLock; + u8 SdioTxOQTMaxFreeSpace; + u8 SdioTxOQTFreeSpace; + // // SDIO Rx FIFO related. @@ -590,7 +612,8 @@ typedef struct hal_com_data u8 bInterruptMigration; u8 bDisableTxInt; - u8 bGpioHwWpsPbc; + + u16 RxTag; #endif //CONFIG_PCI_HCI struct dm_priv dmpriv; @@ -608,9 +631,11 @@ typedef struct hal_com_data #endif // CONFIG_BT_COEXIST #if defined(CONFIG_RTL8723A) || defined(CONFIG_RTL8723B) + #ifndef CONFIG_PCI_HCI // mutual exclusive with PCI -- so they're SDIO and GSPI // Interrupt relatd register information. u32 SysIntrStatus; u32 SysIntrMask; + #endif #endif //endif CONFIG_RTL8723A @@ -674,6 +699,14 @@ typedef struct hal_com_data char *rf_tx_pwr_lmt; u32 rf_tx_pwr_lmt_len; #endif + +#ifdef CONFIG_BACKGROUND_NOISE_MONITOR + s16 noise[ODM_MAX_CHANNEL_NUM]; +#endif + + u8 macid_num; + u8 cam_entry_num; + } HAL_DATA_COMMON, *PHAL_DATA_COMMON; diff --git a/backports/drivers/realtek/rtl8812au/include/hal_gspi.h b/backports/drivers/realtek/rtl8812au/include/hal_gspi.h new file mode 100644 index 00000000000000..f5880e274512c7 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/include/hal_gspi.h @@ -0,0 +1,32 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ +#ifndef __HAL_GSPI_H_ +#define __HAL_GSPI_H_ + +#define ffaddr2deviceId(pdvobj, addr) (pdvobj->Queue2Pipe[addr]) + +u8 rtw_hal_gspi_max_txoqt_free_space(_adapter *padapter); +u8 rtw_hal_gspi_query_tx_freepage(_adapter *padapter, u8 PageIdx, u8 RequiredPageNum); +void rtw_hal_gspi_update_tx_freepage(_adapter *padapter, u8 PageIdx, u8 RequiredPageNum); +void rtw_hal_set_gspi_tx_max_length(PADAPTER padapter, u8 numHQ, u8 numNQ, u8 numLQ, u8 numPubQ); +u32 rtw_hal_get_gspi_tx_max_length(PADAPTER padapter, u8 queue_idx); + +#endif + diff --git a/backports/drivers/realtek/rtl8812au/include/hal_intf.h b/backports/drivers/realtek/rtl8812au/include/hal_intf.h index b4d91982bc4319..fa234cc6ae8274 100755 --- a/backports/drivers/realtek/rtl8812au/include/hal_intf.h +++ b/backports/drivers/realtek/rtl8812au/include/hal_intf.h @@ -65,6 +65,7 @@ typedef enum _HW_VARIABLES{ HW_VAR_RESP_SIFS, HW_VAR_ACK_PREAMBLE, HW_VAR_SEC_CFG, + HW_VAR_SEC_DK_CFG, HW_VAR_BCN_VALID, HW_VAR_RF_TYPE, HW_VAR_DM_FLAG, @@ -91,9 +92,7 @@ typedef enum _HW_VARIABLES{ HW_VAR_FWLPS_RF_ON, HW_VAR_H2C_FW_P2P_PS_OFFLOAD, HW_VAR_TDLS_WRCR, - HW_VAR_TDLS_INIT_CH_SEN, HW_VAR_TDLS_RS_RCR, - HW_VAR_TDLS_DONE_CH_SEN, HW_VAR_INITIAL_GAIN, HW_VAR_TRIGGER_GPIO_0, HW_VAR_BT_SET_COEXIST, @@ -119,6 +118,9 @@ typedef enum _HW_VARIABLES{ #endif #ifdef CONFIG_AP_WOWLAN HW_VAR_AP_WOWLAN, +#endif +#ifdef CONFIG_GPIO_WAKEUP + HW_SET_GPIO_WL_CTRL, #endif HW_VAR_SYS_CLKR, HW_VAR_NAV_UPPER, @@ -145,6 +147,8 @@ typedef enum _HW_VARIABLES{ HW_VAR_DL_RSVD_PAGE, HW_VAR_MACID_SLEEP, HW_VAR_MACID_WAKEUP, + HW_VAR_DUMP_MAC_QUEUE_INFO, + HW_VAR_ASIX_IOT, }HW_VARIABLES; typedef enum _HAL_DEF_VARIABLE{ @@ -179,12 +183,16 @@ typedef enum _HAL_DEF_VARIABLE{ HAL_DEF_PCI_AMD_L1_SUPPORT, HAL_DEF_PCI_ASPM_OSC, // Support for ASPM OSC, added by Roger, 2013.03.27. HAL_DEF_MACID_SLEEP, // Support for MACID sleep + HAL_DEF_DBG_RX_INFO_DUMP, + HAL_DEF_DBG_DIS_PWT, //disable Tx power training or not. }HAL_DEF_VARIABLE; typedef enum _HAL_ODM_VARIABLE{ HAL_ODM_STA_INFO, HAL_ODM_P2P_STATE, HAL_ODM_WIFI_DISPLAY_STATE, + HAL_ODM_NOISE_MONITOR, + HAL_ODM_REGULATION, }HAL_ODM_VARIABLE; typedef enum _HAL_INTF_PS_FUNC{ @@ -251,7 +259,7 @@ struct hal_ops { u8 (*GetHalDefVarHandler)(_adapter *padapter, HAL_DEF_VARIABLE eVariable, PVOID pValue); u8 (*SetHalDefVarHandler)(_adapter *padapter, HAL_DEF_VARIABLE eVariable, PVOID pValue); - void (*GetHalODMVarHandler)(_adapter *padapter, HAL_ODM_VARIABLE eVariable, PVOID pValue1,BOOLEAN bSet); + void (*GetHalODMVarHandler)(_adapter *padapter, HAL_ODM_VARIABLE eVariable, PVOID pValue1,PVOID pValue2); void (*SetHalODMVarHandler)(_adapter *padapter, HAL_ODM_VARIABLE eVariable, PVOID pValue1,BOOLEAN bSet); void (*UpdateRAMaskHandler)(_adapter *padapter, u32 mac_id, u8 rssi_level); @@ -315,10 +323,16 @@ struct hal_ops { void (*hal_reset_security_engine)(_adapter * adapter); s32 (*c2h_handler)(_adapter *padapter, u8 *c2h_evt); c2h_id_filter c2h_id_filter_ccx; - -#ifdef CONFIG_BT_COEXIST s32 (*fill_h2c_cmd)(PADAPTER, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer); -#endif // CONFIG_BT_COEXIST + void (*fill_fake_txdesc)(PADAPTER, u8 *pDesc, u32 BufferLen, + u8 IsPsPoll, u8 IsBTQosNull, u8 bDataFrame); +#ifdef CONFIG_WOWLAN + void (*hal_set_wowlan_fw)(_adapter *adapter, u8 sleep); +#endif //CONFIG_WOWLAN + u8 (*hal_get_tx_buff_rsvd_page_num)(_adapter *adapter, bool wowlan); +#ifdef CONFIG_GPIO_API + void (*update_hisr_hsisr_ind)(PADAPTER padapter, u32 flag); +#endif }; typedef enum _RT_EEPROM_TYPE{ @@ -392,6 +406,9 @@ typedef enum _HARDWARE_TYPE{ #define IS_HARDWARE_TYPE_8192D(_Adapter) \ (IS_HARDWARE_TYPE_8192DE(_Adapter) || IS_HARDWARE_TYPE_8192DU(_Adapter)) +#define IS_HARDWARE_TYPE_OLDER_THAN_8723A(_Adapter) \ +(IS_HARDWARE_TYPE_8192D(_Adapter) || IS_HARDWARE_TYPE_8192C(_Adapter)) + // // RTL8723A Series // @@ -410,6 +427,11 @@ typedef enum _HARDWARE_TYPE{ #define IS_HARDWARE_TYPE_8188E(_Adapter) \ (IS_HARDWARE_TYPE_8188EE(_Adapter) || IS_HARDWARE_TYPE_8188EU(_Adapter) || IS_HARDWARE_TYPE_8188ES(_Adapter)) + +#define IS_HARDWARE_TYPE_8188E_before(_Adapter) \ +(IS_HARDWARE_TYPE_8192C(_Adapter) ||IS_HARDWARE_TYPE_8192D(_Adapter) ||IS_HARDWARE_TYPE_8723A(_Adapter)) + + #define IS_HARDWARE_TYPE_OLDER_THAN_8812A(_Adapter) \ (IS_HARDWARE_TYPE_8192D(_Adapter) || IS_HARDWARE_TYPE_8192C(_Adapter) ||\ IS_HARDWARE_TYPE_8723AE(_Adapter) || IS_HARDWARE_TYPE_8723AU(_Adapter) || IS_HARDWARE_TYPE_8723AS(_Adapter) ||\ @@ -528,7 +550,7 @@ u8 rtw_hal_set_def_var(_adapter *padapter, HAL_DEF_VARIABLE eVariable, PVOID pVa u8 rtw_hal_get_def_var(_adapter *padapter, HAL_DEF_VARIABLE eVariable, PVOID pValue); void rtw_hal_set_odm_var(_adapter *padapter, HAL_ODM_VARIABLE eVariable, PVOID pValue1,BOOLEAN bSet); -void rtw_hal_get_odm_var(_adapter *padapter, HAL_ODM_VARIABLE eVariable, PVOID pValue1,BOOLEAN bSet); +void rtw_hal_get_odm_var(_adapter *padapter, HAL_ODM_VARIABLE eVariable, PVOID pValue1,PVOID pValue2); void rtw_hal_enable_interrupt(_adapter *padapter); void rtw_hal_disable_interrupt(_adapter *padapter); @@ -621,12 +643,12 @@ c2h_id_filter rtw_hal_c2h_id_filter_ccx(_adapter *adapter); s32 rtw_hal_is_disable_sw_channel_plan(PADAPTER padapter); -s32 rtw_hal_macid_sleep(PADAPTER padapter, u32 macid); -s32 rtw_hal_macid_wakeup(PADAPTER padapter, u32 macid); +s32 rtw_hal_macid_sleep(PADAPTER padapter, u8 macid); +s32 rtw_hal_macid_wakeup(PADAPTER padapter, u8 macid); -#ifdef CONFIG_BT_COEXIST s32 rtw_hal_fill_h2c_cmd(PADAPTER, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer); -#endif // CONFIG_BT_COEXIST - +#ifdef CONFIG_GPIO_API +void rtw_hal_update_hisr_hsisr_ind(_adapter *padapter, u32 flag); +#endif #endif //__HAL_INTF_H__ diff --git a/backports/drivers/realtek/rtl8812au/include/hal_pg.h b/backports/drivers/realtek/rtl8812au/include/hal_pg.h index 958a75f41bf99d..470ee5299f1e70 100755 --- a/backports/drivers/realtek/rtl8812au/include/hal_pg.h +++ b/backports/drivers/realtek/rtl8812au/include/hal_pg.h @@ -236,7 +236,8 @@ #define EEPROM_MAC_ADDR_88EU 0xD7 #define EEPROM_VID_88EU 0xD0 #define EEPROM_PID_88EU 0xD2 -#define EEPROM_USB_OPTIONAL_FUNCTION0 0xD4 //92EU is the same +#define EEPROM_USB_OPTIONAL_FUNCTION0 0xD4 //8192EU, 8812AU is the same +#define EEPROM_USB_OPTIONAL_FUNCTION0_8811AU 0x104 // RTL88ES #define EEPROM_MAC_ADDR_88ES 0x11A @@ -280,7 +281,7 @@ #define EEPROM_LNA_TYPE_5G_8192EU 0xBF // RTL8192ES -#define EEPROM_MAC_ADDR_8192ES 0x11B +#define EEPROM_MAC_ADDR_8192ES 0x11A //==================================================== // EEPROM/Efuse PG Offset for 8812AE/8812AU/8812AS //==================================================== @@ -423,6 +424,7 @@ //RTL8723BS #define EEPROM_MAC_ADDR_8723BS 0x11A +#define EEPROM_Voltage_ADDR_8723B 0x8 //==================================================== diff --git a/backports/drivers/realtek/rtl8812au/include/hal_sdio.h b/backports/drivers/realtek/rtl8812au/include/hal_sdio.h index 9e76b069e4ebb0..ccb49e780a4cc2 100755 --- a/backports/drivers/realtek/rtl8812au/include/hal_sdio.h +++ b/backports/drivers/realtek/rtl8812au/include/hal_sdio.h @@ -22,6 +22,7 @@ #define ffaddr2deviceId(pdvobj, addr) (pdvobj->Queue2Pipe[addr]) +u8 rtw_hal_sdio_max_txoqt_free_space(_adapter *padapter); u8 rtw_hal_sdio_query_tx_freepage(_adapter *padapter, u8 PageIdx, u8 RequiredPageNum); void rtw_hal_sdio_update_tx_freepage(_adapter *padapter, u8 PageIdx, u8 RequiredPageNum); void rtw_hal_set_sdio_tx_max_length(PADAPTER padapter, u8 numHQ, u8 numNQ, u8 numLQ, u8 numPubQ); diff --git a/backports/drivers/realtek/rtl8812au/include/ieee80211.h b/backports/drivers/realtek/rtl8812au/include/ieee80211.h index bf2b2a1fa8f867..b5ad12fc1a6c73 100755 --- a/backports/drivers/realtek/rtl8812au/include/ieee80211.h +++ b/backports/drivers/realtek/rtl8812au/include/ieee80211.h @@ -207,13 +207,13 @@ enum NETWORK_TYPE //Type for registry default wireless mode WIRELESS_11AGN = (WIRELESS_11A|WIRELESS_11G|WIRELESS_11_24N|WIRELESS_11_5N), // tx: ofdm & MCS, rx: ofdm & MCS, hw: ofdm only WIRELESS_11ABGN = (WIRELESS_11A|WIRELESS_11B|WIRELESS_11G|WIRELESS_11_24N|WIRELESS_11_5N), - WIRELESS_MODE_24G = (WIRELESS_11B|WIRELESS_11G|WIRELESS_11_24N|WIRELESS_11AC), + WIRELESS_MODE_24G = (WIRELESS_11B|WIRELESS_11G|WIRELESS_11_24N), WIRELESS_MODE_5G = (WIRELESS_11A|WIRELESS_11_5N|WIRELESS_11AC), WIRELESS_MODE_MAX = (WIRELESS_11A|WIRELESS_11B|WIRELESS_11G|WIRELESS_11_24N|WIRELESS_11_5N|WIRELESS_11AC), }; -#define SUPPORTED_24G_NETTYPE_MSK (WIRELESS_11B | WIRELESS_11G | WIRELESS_11_24N) -#define SUPPORTED_5G_NETTYPE_MSK (WIRELESS_11A | WIRELESS_11_5N) +#define SUPPORTED_24G_NETTYPE_MSK WIRELESS_MODE_24G +#define SUPPORTED_5G_NETTYPE_MSK WIRELESS_MODE_5G #define IsLegacyOnly(NetType) ((NetType) == ((NetType) & (WIRELESS_11BG|WIRELESS_11A))) @@ -1342,7 +1342,7 @@ typedef struct tx_pending_t{ -#define MAXTID 16 +#define TID_NUM 16 #define IEEE_A (1<<0) #define IEEE_B (1<<1) @@ -1444,15 +1444,14 @@ enum rtw_ieee80211_back_actioncode { /* HT features action code */ enum rtw_ieee80211_ht_actioncode { - RTW_WLAN_ACTION_NOTIFY_CH_WIDTH = 0, - RTW_WLAN_ACTION_SM_PS = 1, - RTW_WLAN_ACTION_PSPM = 2, - RTW_WLAN_ACTION_PCO_PHASE = 3, - RTW_WLAN_ACTION_MIMO_CSI_MX = 4, - RTW_WLAN_ACTION_MIMO_NONCP_BF = 5, - RTW_WLAN_ACTION_MIMP_CP_BF = 6, - RTW_WLAN_ACTION_ASEL_INDICATES_FB = 7, - RTW_WLAN_ACTION_HI_INFO_EXCHG = 8, + RTW_WLAN_ACTION_HT_NOTI_CHNL_WIDTH = 0, + RTW_WLAN_ACTION_HT_SM_PS = 1, + RTW_WLAN_ACTION_HT_PSMP = 2, + RTW_WLAN_ACTION_HT_SET_PCO_PHASE = 3, + RTW_WLAN_ACTION_HT_CSI = 4, + RTW_WLAN_ACTION_HT_NON_COMPRESS_BEAMFORMING = 5, + RTW_WLAN_ACTION_HT_COMPRESS_BEAMFORMING = 6, + RTW_WLAN_ACTION_HT_ASEL_FEEDBACK = 7, }; /* BACK (block-ack) parties */ @@ -1672,13 +1671,18 @@ u8 *rtw_get_wps_attr_content(u8 *wps_ie, uint wps_ielen, u16 target_attr_id ,u8 #define for_each_ie(ie, buf, buf_len) \ for (ie = (void*)buf; (((u8*)ie) - ((u8*)buf) + 1) < buf_len; ie = (void*)(((u8*)ie) + *(((u8*)ie)+1) + 2)) -void dump_ies(u8 *buf, u32 buf_len); -void dump_wps_ie(u8 *ie, u32 ie_len); +void dump_ies(void *sel, u8 *buf, u32 buf_len); + +#ifdef CONFIG_80211N_HT +void dump_ht_cap_ie_content(void *sel, u8 *buf, u32 buf_len); +#endif + +void dump_wps_ie(void *sel, u8 *ie, u32 ie_len); #ifdef CONFIG_P2P u32 rtw_get_p2p_merged_ies_len(u8 *in_ie, u32 in_len); int rtw_p2p_merge_ies(u8 *in_ie, u32 in_len, u8 *merge_ie); -void dump_p2p_ie(u8 *ie, u32 ie_len); +void dump_p2p_ie(void *sel, u8 *ie, u32 ie_len); u8 *rtw_get_p2p_ie(u8 *in_ie, int in_len, u8 *p2p_ie, uint *p2p_ielen); u8 *rtw_get_p2p_ie_from_scan_queue(u8 *in_ie, int in_len, u8 *p2p_ie, uint *p2p_ielen, u8 frame_type); u8 *rtw_get_p2p_attr(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id ,u8 *buf_attr, u32 *len_attr); @@ -1688,7 +1692,7 @@ void rtw_WLAN_BSSID_EX_remove_p2p_attr(WLAN_BSSID_EX *bss_ex, u8 attr_id); #endif #ifdef CONFIG_WFD -void dump_wfd_ie(u8 *ie, u32 ie_len); +void dump_wfd_ie(void *sel, u8 *ie, u32 ie_len); int rtw_get_wfd_ie(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_ielen); int rtw_get_wfd_ie_from_scan_queue(u8 *in_ie, int in_len, u8 *p2p_ie, uint *p2p_ielen, u8 frame_type); int rtw_get_wfd_attr_content(u8 *wfd_ie, uint wfd_ielen, u8 target_attr_id ,u8 *attr_content, uint *attr_contentlen); diff --git a/backports/drivers/realtek/rtl8812au/include/linux/wireless.h b/backports/drivers/realtek/rtl8812au/include/linux/wireless.h index 955ea8d316e28d..d79caeb592bc87 100755 --- a/backports/drivers/realtek/rtl8812au/include/linux/wireless.h +++ b/backports/drivers/realtek/rtl8812au/include/linux/wireless.h @@ -35,7 +35,13 @@ #endif /****************************** TYPES ******************************/ - +#ifdef CONFIG_COMPAT +struct compat_iw_point { + compat_caddr_t pointer; + __u16 length; + __u16 flags; +}; +#endif /* --------------------------- SUBTYPES --------------------------- */ /* * For all data larger than 16 octets, we need to use a diff --git a/backports/drivers/realtek/rtl8812au/include/osdep_intf.h b/backports/drivers/realtek/rtl8812au/include/osdep_intf.h index 7a61a132d5b2b1..5e4a480056657e 100755 --- a/backports/drivers/realtek/rtl8812au/include/osdep_intf.h +++ b/backports/drivers/realtek/rtl8812au/include/osdep_intf.h @@ -110,6 +110,7 @@ int rtw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname); struct net_device *rtw_init_netdev(_adapter *padapter); +void rtw_unregister_netdev(_adapter *adapter); void rtw_unregister_netdevs(struct dvobj_priv *dvobj); #if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35)) @@ -120,6 +121,11 @@ int rtw_ndev_notifier_register(void); void rtw_ndev_notifier_unregister(void); #include "../os_dep/linux/rtw_proc.h" + +#ifdef CONFIG_IOCTL_CFG80211 +#include "../os_dep/linux/ioctl_cfg80211.h" +#endif //CONFIG_IOCTL_CFG80211 + #endif //PLATFORM_LINUX @@ -129,11 +135,6 @@ extern int rtw_ioctl(struct ifnet * ifp, u_long cmd, caddr_t data); void rtw_ips_dev_unload(_adapter *padapter); -#ifdef CONFIG_RF_GAIN_OFFSET -void rtw_bb_rf_gain_offset(_adapter *padapter); -#endif //CONFIG_RF_GAIN_OFFSET - - #ifdef CONFIG_IPS int rtw_ips_pwr_up(_adapter *padapter); void rtw_ips_pwr_down(_adapter *padapter); @@ -155,11 +156,12 @@ void rtw_drv_free_vir_ifaces(struct dvobj_priv *dvobj); int rtw_drv_register_netdev(_adapter *padapter); void rtw_ndev_destructor(_nic_hdl ndev); -#ifdef CONFIG_SUSPEND_REFINE -int rtw_suspend_common(_adapter *padapter); -int rtw_resume_common(_adapter *padapter); +#ifdef CONFIG_ARP_KEEP_ALIVE +int rtw_gw_addr_query(_adapter *padapter); #endif +int rtw_suspend_common(_adapter *padapter); +int rtw_resume_common(_adapter *padapter); #endif //_OSDEP_INTF_H_ diff --git a/backports/drivers/realtek/rtl8812au/include/osdep_service.h b/backports/drivers/realtek/rtl8812au/include/osdep_service.h index 76026b9723efe4..b5901766e26202 100755 --- a/backports/drivers/realtek/rtl8812au/include/osdep_service.h +++ b/backports/drivers/realtek/rtl8812au/include/osdep_service.h @@ -118,7 +118,8 @@ enum mstat_f { MSTAT_FUNC_RX_IO = 0x03<<8, MSTAT_FUNC_TX = 0x04<<8, MSTAT_FUNC_RX = 0x05<<8, - MSTAT_FUNC_MAX = 0x06<<8, + MSTAT_FUNC_CFG_VENDOR = 0x06<<8, + MSTAT_FUNC_MAX = 0x07<<8, }; #define mstat_tf_idx(flags) ((flags)&0xff) @@ -252,7 +253,7 @@ void _rtw_usb_buffer_free(struct usb_device *dev, size_t size, void *addr, dma_a #endif /* CONFIG_USB_HCI */ #endif /* DBG_MEM_ALLOC */ -extern void* rtw_malloc2d(int h, int w, int size); +extern void* rtw_malloc2d(int h, int w, size_t size); extern void rtw_mfree2d(void *pbuf, int h, int w, int size); extern void _rtw_memcpy(void* dec, void* sour, u32 sz); @@ -474,6 +475,8 @@ __inline static u32 bitshift(u32 bitmask) return i; } +#define rtw_min(a, b) ((a>b)?b:a) + #ifndef MAC_FMT #define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x" #endif diff --git a/backports/drivers/realtek/rtl8812au/include/osdep_service_linux.h b/backports/drivers/realtek/rtl8812au/include/osdep_service_linux.h index 894169dd1e58d0..223efc1c580f59 100755 --- a/backports/drivers/realtek/rtl8812au/include/osdep_service_linux.h +++ b/backports/drivers/realtek/rtl8812au/include/osdep_service_linux.h @@ -69,10 +69,16 @@ #include #endif +#ifdef CONFIG_NET_RADIO + #define CONFIG_WIRELESS_EXT +#endif + + /* Monitor mode */ + #include + #ifdef CONFIG_IOCTL_CFG80211 -// #include - #include - #include +/* #include */ + #include #endif //CONFIG_IOCTL_CFG80211 #ifdef CONFIG_TCP_CSUM_OFFLOAD_TX @@ -97,6 +103,14 @@ #endif #endif +#ifdef CONFIG_BT_COEXIST_SOCKET_TRX + #include + #include + #include + #include + #include +#endif //CONFIG_BT_COEXIST_SOCKET_TRX + #ifdef CONFIG_USB_HCI typedef struct urb * PURB; #if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,22)) diff --git a/backports/drivers/realtek/rtl8812au/include/pci_hal.h b/backports/drivers/realtek/rtl8812au/include/pci_hal.h index 21075dd57ed124..a37040b741a592 100755 --- a/backports/drivers/realtek/rtl8812au/include/pci_hal.h +++ b/backports/drivers/realtek/rtl8812au/include/pci_hal.h @@ -36,6 +36,14 @@ void rtl8188ee_set_hal_ops(_adapter * padapter); void rtl8812ae_set_hal_ops(_adapter * padapter); #endif +#if defined(CONFIG_RTL8192E) +void rtl8192ee_set_hal_ops(_adapter * padapter); +#endif + +#ifdef CONFIG_RTL8723B +void rtl8723be_set_hal_ops(_adapter * padapter); +#endif + void rtw_set_hal_ops(_adapter *padapter); #endif //__PCIE_HAL_H__ diff --git a/backports/drivers/realtek/rtl8812au/include/pci_ops.h b/backports/drivers/realtek/rtl8812au/include/pci_ops.h index ea46fab3d8da11..cc2f45dab3b1db 100755 --- a/backports/drivers/realtek/rtl8812au/include/pci_ops.h +++ b/backports/drivers/realtek/rtl8812au/include/pci_ops.h @@ -68,5 +68,25 @@ void rtl8812ae_prepare_bcn_tasklet(void *priv); void rtl8812ae_set_intf_ops(struct _io_ops *pops); #endif +#ifdef CONFIG_RTL8192E +u32 rtl8192ee_init_desc_ring(_adapter * padapter); +u32 rtl8192ee_free_desc_ring(_adapter * padapter); +void rtl8192ee_reset_desc_ring(_adapter * padapter); +void rtl8192ee_recv_tasklet(void *priv); +void rtl8192ee_prepare_bcn_tasklet(void *priv); +int rtl8192ee_interrupt(PADAPTER Adapter); +void rtl8192ee_set_intf_ops(struct _io_ops *pops); +#endif + +#ifdef CONFIG_RTL8723B +u32 rtl8723be_init_desc_ring(_adapter * padapter); +u32 rtl8723be_free_desc_ring(_adapter * padapter); +void rtl8723be_reset_desc_ring(_adapter * padapter); +int rtl8723be_interrupt(PADAPTER Adapter); +void rtl8723be_recv_tasklet(void *priv); +void rtl8723be_prepare_bcn_tasklet(void *priv); +void rtl8723be_set_intf_ops(struct _io_ops *pops); +#endif + #endif diff --git a/backports/drivers/realtek/rtl8812au/include/recv_osdep.h b/backports/drivers/realtek/rtl8812au/include/recv_osdep.h index e1013379f11f04..269ce2460c2c2e 100755 --- a/backports/drivers/realtek/rtl8812au/include/recv_osdep.h +++ b/backports/drivers/realtek/rtl8812au/include/recv_osdep.h @@ -29,6 +29,8 @@ extern s32 rtw_recv_entry(union recv_frame *precv_frame); extern int rtw_recv_indicatepkt(_adapter *adapter, union recv_frame *precv_frame); extern void rtw_recv_returnpacket(IN _nic_hdl cnxt, IN _pkt *preturnedpkt); +extern int rtw_recv_monitor(_adapter *padapter, union recv_frame *precv_frame); + extern void rtw_hostapd_mlme_rx(_adapter *padapter, union recv_frame *precv_frame); extern void rtw_handle_tkip_mic_err(_adapter *padapter,u8 bgroup); diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8188e_cmd.h b/backports/drivers/realtek/rtl8812au/include/rtl8188e_cmd.h index dcde3fa0a8689b..839b1e03bb65ba 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8188e_cmd.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8188e_cmd.h @@ -65,7 +65,7 @@ typedef enum _RTL8188E_H2C_CMD_ID //Class DM H2C_DM_MACID_CFG =0x40, H2C_DM_TXBF =0x41, - + H2C_RSSI_REPORT =0x42, //Class BT H2C_BT_COEX_MASK =0x60, H2C_BT_COEX_GPIO_MODE =0x61, @@ -142,9 +142,11 @@ typedef struct _RSVDPAGE_LOC_88E { void rtl8188e_set_FwPwrMode_cmd(PADAPTER padapter, u8 Mode); void rtl8188e_set_FwJoinBssReport_cmd(PADAPTER padapter, u8 mstatus); u8 rtl8188e_set_rssi_cmd(PADAPTER padapter, u8 *param); -u8 rtl8188e_set_raid_cmd(PADAPTER padapter, u32 mask); +u8 rtl8188e_set_raid_cmd(_adapter*padapter, u32 bitmap, u8* arg); void rtl8188e_Add_RateATid(PADAPTER padapter, u32 bitmap, u8* arg, u8 rssi_level); +s32 FillH2CCmd_88E(PADAPTER padapter, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer); //u8 rtl8192c_set_FwSelectSuspend_cmd(PADAPTER padapter, u8 bfwpoll, u16 period); +u8 GetTxBufferRsvdPageNum8188E(_adapter *padapter, bool wowlan); #ifdef CONFIG_P2P @@ -233,12 +235,13 @@ void SetFwRelatedForWoWLAN8188ES(_adapter* padapter, u8 bHostIsGoingtoSleep); //---------------------------------------------------------------------------------------------------------// //---------------------------------- H2C CMD CONTENT --------------------------------------------------// //---------------------------------------------------------------------------------------------------------// +// +/* move to hal_com_h2c.h //_RSVDPAGE_LOC_CMD_0x00 #define SET_8188E_H2CCMD_RSVDPAGE_LOC_PROBE_RSP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value) #define SET_8188E_H2CCMD_RSVDPAGE_LOC_PSPOLL(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 8, __Value) #define SET_8188E_H2CCMD_RSVDPAGE_LOC_NULL_DATA(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+2, 0, 8, __Value) #define SET_8188E_H2CCMD_RSVDPAGE_LOC_QOS_NULL_DATA(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+3, 0, 8, __Value) -/* move to hal_com_h2c.h // AOAC_RSVDPAGE_LOC_0x83 #define SET_8188E_H2CCMD_AOAC_RSVDPAGE_LOC_REMOTE_WAKE_CTRL_INFO(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd), 0, 8, __Value) #define SET_8188E_H2CCMD_AOAC_RSVDPAGE_LOC_ARP_RSP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 8, __Value) diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8188e_hal.h b/backports/drivers/realtek/rtl8812au/include/rtl8188e_hal.h index a7fed3fbe43574..6581b0a0a033c2 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8188e_hal.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8188e_hal.h @@ -21,11 +21,7 @@ #define __RTL8188E_HAL_H__ //#include "hal_com.h" -#if 1 #include "hal_data.h" -#else -#include "../hal/OUTSRC/odm_precomp.h" -#endif //include HAL Related header after HAL Related compiling flags #include "rtl8188e_spec.h" @@ -53,17 +49,17 @@ #endif - #define RTL8188E_FW_IMG "rtl8188E/FW_NIC.bin" - #define RTL8188E_FW_WW_IMG "rtl8188E/FW_WoWLAN.bin" - #define RTL8188E_PHY_REG "rtl8188E/PHY_REG.txt" - #define RTL8188E_PHY_RADIO_A "rtl8188E/RadioA.txt" - #define RTL8188E_PHY_RADIO_B "rtl8188E/RadioB.txt" - #define RTL8188E_TXPWR_TRACK "rtl8188E/TxPowerTrack.txt" - #define RTL8188E_AGC_TAB "rtl8188E/AGC_TAB.txt" - #define RTL8188E_PHY_MACREG "rtl8188E/MAC_REG.txt" - #define RTL8188E_PHY_REG_PG "rtl8188E/PHY_REG_PG.txt" - #define RTL8188E_PHY_REG_MP "rtl8188E/PHY_REG_MP.txt" - #define RTL8188E_TXPWR_LMT "rtl8188E/TXPWR_LMT.txt" + #define RTL8188E_FW_IMG "rtl8188e/FW_NIC.bin" + #define RTL8188E_FW_WW_IMG "rtl8188e/FW_WoWLAN.bin" + #define RTL8188E_PHY_REG "rtl8188e/PHY_REG.txt" + #define RTL8188E_PHY_RADIO_A "rtl8188e/RadioA.txt" + #define RTL8188E_PHY_RADIO_B "rtl8188e/RadioB.txt" + #define RTL8188E_TXPWR_TRACK "rtl8188e/TxPowerTrack.txt" + #define RTL8188E_AGC_TAB "rtl8188e/AGC_TAB.txt" + #define RTL8188E_PHY_MACREG "rtl8188e/MAC_REG.txt" + #define RTL8188E_PHY_REG_PG "rtl8188e/PHY_REG_PG.txt" + #define RTL8188E_PHY_REG_MP "rtl8188e/PHY_REG_MP.txt" + #define RTL8188E_TXPWR_LMT "rtl8188e/TXPWR_LMT.txt" //--------------------------------------------------------------------- // RTL8188E Power Configuration CMDs for USB/SDIO/PCIE interfaces @@ -80,13 +76,15 @@ #if 1 // download firmware related data structure +#define MAX_FW_8188E_SIZE 0x8000 //32768,32k / 16384,16k + #define FW_8188E_SIZE 0x4000 //16384,16k +#define FW_8188E_SIZE_2 0x8000 //32768,32k + #define FW_8188E_START_ADDRESS 0x1000 #define FW_8188E_END_ADDRESS 0x1FFF //0x5FFF - - #define IS_FW_HEADER_EXIST_88E(_pFwHdr) ((le16_to_cpu(_pFwHdr->Signature)&0xFFF0) == 0x88E0) typedef struct _RT_FIRMWARE_8188E { @@ -94,7 +92,7 @@ typedef struct _RT_FIRMWARE_8188E { #ifdef CONFIG_EMBEDDED_FWIMG u8* szFwBuffer; #else - u8 szFwBuffer[FW_8188E_SIZE]; + u8 szFwBuffer[MAX_FW_8188E_SIZE]; #endif u32 ulFwLength; } RT_FIRMWARE_8188E, *PRT_FIRMWARE_8188E; @@ -140,8 +138,8 @@ typedef struct _RT_8188E_FIRMWARE_HDR #define BCN_DMA_ATIME_INT_TIME_8188E 0x02 -#define MAX_RX_DMA_BUFFER_SIZE_88E 0x2400 //9k for 88E nornal chip , //MaxRxBuff=10k-max(TxReportSize(64*8), WOLPattern(16*24)) -//#define MAX_RX_DMA_BUFFER_SIZE_88E(__Adapter) ((!IS_VENDOR_8188E_I_CUT_SERIES(__Adapter))?0x2400:0x3C00) +//#define MAX_RX_DMA_BUFFER_SIZE_88E 0x2400 //9k for 88E nornal chip , //MaxRxBuff=10k-max(TxReportSize(64*8), WOLPattern(16*24)) +#define MAX_RX_DMA_BUFFER_SIZE_88E(__Adapter) ((!IS_VENDOR_8188E_I_CUT_SERIES(__Adapter))?0x2400:0x3C00) #define MAX_TX_REPORT_BUFFER_SIZE 0x0400 // 1k @@ -152,19 +150,31 @@ typedef struct _RT_8188E_FIRMWARE_HDR // must reserved about 7 pages for LPS => 176-7 = 169 (0xA9) // 2*BCN / 1*ps-poll / 1*null-data /1*prob_rsp /1*QOS null-data /1*BT QOS null-data -#define TX_TOTAL_PAGE_NUMBER_88E 0xA9// 169 (21632=> 21k) +#define BCNQ_PAGE_NUM_88E 0x08 -#ifdef RTL8188ES_MAC_LOOPBACK -#define TX_PAGE_BOUNDARY_88E 0x48 //72 -#else //TX_PAGE_BOUNDARY_LOOPBACK_MODE -#define TX_PAGE_BOUNDARY_88E (TX_TOTAL_PAGE_NUMBER_88E + 1) +//For WoWLan , more reserved page +#ifdef CONFIG_WOWLAN +#define WOWLAN_PAGE_NUM_88E 0x00 +#else +#define WOWLAN_PAGE_NUM_88E 0x00 #endif +#define TX_TOTAL_PAGE_NUMBER_88E(_Adapter) ( (IS_VENDOR_8188E_I_CUT_SERIES(_Adapter)?0x100:0xB0) - BCNQ_PAGE_NUM_88E - WOWLAN_PAGE_NUM_88E) +#define TX_PAGE_BOUNDARY_88E(_Adapter) (TX_TOTAL_PAGE_NUMBER_88E(_Adapter) + 1) + +#define WMM_NORMAL_TX_TOTAL_PAGE_NUMBER_88E(_Adapter) TX_TOTAL_PAGE_NUMBER_88E(_Adapter) +#define WMM_NORMAL_TX_PAGE_BOUNDARY_88E(_Adapter) (WMM_NORMAL_TX_TOTAL_PAGE_NUMBER_88E(_Adapter) + 1) -//Note: For Normal Chip Setting ,modify later -#define WMM_NORMAL_TX_TOTAL_PAGE_NUMBER TX_TOTAL_PAGE_NUMBER_88E //0xA9 , 0xb0=>176=>22k -#define WMM_NORMAL_TX_PAGE_BOUNDARY_88E (WMM_NORMAL_TX_TOTAL_PAGE_NUMBER + 1) //0xA9 +// For Normal Chip Setting +// (HPQ + LPQ + NPQ + PUBQ) shall be TX_TOTAL_PAGE_NUMBER_8723B +#define NORMAL_PAGE_NUM_HPQ_88E 0x10 +#define NORMAL_PAGE_NUM_LPQ_88E 0x10 +#define NORMAL_PAGE_NUM_NPQ_88E 0x10 +// Note: For Normal Chip Setting, modify later +#define WMM_NORMAL_PAGE_NUM_HPQ_88E 0x29 +#define WMM_NORMAL_PAGE_NUM_LPQ_88E 0x1C +#define WMM_NORMAL_PAGE_NUM_NPQ_88E 0x1C //------------------------------------------------------------------------- @@ -196,8 +206,6 @@ typedef struct _RT_8188E_FIRMWARE_HDR // #define EFUSE_OOB_PROTECT_BYTES 15 // PG data exclude header, dummy 6 bytes frome CP test and reserved 1byte. -#define HWSET_MAX_SIZE_88E 512 - #define EFUSE_REAL_CONTENT_LEN_88E 256 #define EFUSE_MAP_LEN_88E 512 #define EFUSE_MAX_SECTION_88E 64 @@ -267,6 +275,12 @@ void Hal_DetectWoWMode(PADAPTER pAdapter); //void rtl8723a_ReadBluetoothCoexistInfo(PADAPTER padapter, u8 *PROMContent, BOOLEAN AutoloadFail); void Hal_InitChannelPlan(PADAPTER padapter); +#ifdef CONFIG_RF_GAIN_OFFSET +void Hal_ReadRFGainOffset(PADAPTER pAdapter,u8* hwinfo,BOOLEAN AutoLoadFail); +#endif //CONFIG_RF_GAIN_OFFSET + +void rtl8188e_init_default_value(_adapter *adapter); + void rtl8188e_set_hal_ops(struct hal_ops *pHalFunc); // register @@ -283,6 +297,13 @@ void _InitTransferPageSize(PADAPTER padapter); void SetHwReg8188E(PADAPTER padapter, u8 variable, u8 *val); void GetHwReg8188E(PADAPTER padapter, u8 variable, u8 *val); - +void ResumeTxBeacon(PADAPTER padapter); +void StopTxBeacon(PADAPTER padapter); +u8 +GetHalDefVar8188E( + IN PADAPTER Adapter, + IN HAL_DEF_VARIABLE eVariable, + IN PVOID pValue + ); #endif //__RTL8188E_HAL_H__ diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8188e_led.h b/backports/drivers/realtek/rtl8812au/include/rtl8188e_led.h index c5e38009a6f46e..4b05994a8ba07a 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8188e_led.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8188e_led.h @@ -32,7 +32,7 @@ void rtl8188eu_DeInitSwLeds(PADAPTER padapter); void rtl8188ee_InitSwLeds(PADAPTER padapter); void rtl8188ee_DeInitSwLeds(PADAPTER padapter); #endif -#ifdef CONFIG_SDIO_HCI +#if defined (CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) void rtl8188es_InitSwLeds(PADAPTER padapter); void rtl8188es_DeInitSwLeds(PADAPTER padapter); #endif diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8188e_recv.h b/backports/drivers/realtek/rtl8812au/include/rtl8188e_recv.h index df6e59ff562fbb..06bf4f36560952 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8188e_recv.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8188e_recv.h @@ -109,7 +109,7 @@ typedef struct rxreport_8188e } RXREPORT, *PRXREPORT; -#ifdef CONFIG_SDIO_HCI +#if defined (CONFIG_SDIO_HCI)||defined(CONFIG_GSPI_HCI) s32 rtl8188es_init_recv_priv(PADAPTER padapter); void rtl8188es_free_recv_priv(PADAPTER padapter); void rtl8188es_recv_hdl(PADAPTER padapter, struct recv_buf *precvbuf); @@ -122,7 +122,6 @@ s32 rtl8188eu_init_recv_priv(PADAPTER padapter); void rtl8188eu_free_recv_priv(PADAPTER padapter); void rtl8188eu_recv_hdl(PADAPTER padapter, struct recv_buf *precvbuf); void rtl8188eu_recv_tasklet(void *priv); - #endif #ifdef CONFIG_PCI_HCI @@ -130,10 +129,7 @@ s32 rtl8188ee_init_recv_priv(PADAPTER padapter); void rtl8188ee_free_recv_priv(PADAPTER padapter); #endif -void rtl8188e_query_rx_phy_status(union recv_frame *prframe, struct phy_stat *pphy_stat); -void rtl8188e_process_phy_info(PADAPTER padapter, void *prframe); -void update_recvframe_phyinfo_88e(union recv_frame *precvframe,struct phy_stat *pphy_status); -void update_recvframe_attrib_88e( union recv_frame *precvframe, struct recv_stat *prxstat); +void rtl8188e_query_rx_desc_status(union recv_frame *precvframe, struct recv_stat *prxstat); -#endif +#endif /* __RTL8188E_RECV_H__ */ diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8188e_spec.h b/backports/drivers/realtek/rtl8812au/include/rtl8188e_spec.h index 264c3780630a3e..287efee84e8a7b 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8188e_spec.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8188e_spec.h @@ -49,6 +49,8 @@ #define REG_HISRE_88E 0x00BC //RTL8188E #define REG_MACID_NO_LINK_0 0x0484 #define REG_MACID_NO_LINK_1 0x0488 +#define REG_MACID_PAUSE_0 0x048c +#define REG_MACID_PAUSE_1 0x0490 //----------------------------------------------------- // @@ -84,8 +86,8 @@ // //----------------------------------------------------- #ifdef CONFIG_WOWLAN -#define REG_TXPKTBUF_IV_LOW 0x0484 -#define REG_TXPKTBUF_IV_HIGH 0x0488 +#define REG_TXPKTBUF_IV_LOW 0x01a4 +#define REG_TXPKTBUF_IV_HIGH 0x01a8 #endif //----------------------------------------------------- @@ -99,6 +101,11 @@ // 0x0600h ~ 0x07FFh WMAC Configuration // //----------------------------------------------------- +#ifdef CONFIG_RF_GAIN_OFFSET +#define EEPROM_RF_GAIN_OFFSET 0xC1 +#define EEPROM_RF_GAIN_VAL 0xF6 +#define EEPROM_THERMAL_OFFSET 0xF5 +#endif //CONFIG_RF_GAIN_OFFSET //---------------------------------------------------------------------------- // 88E Driver Initialization Offload REG_FDHM0(Offset 0x88, 8 bits) //---------------------------------------------------------------------------- @@ -140,6 +147,8 @@ // General definitions //======================================================== +#define MACID_NUM_88E 64 +#define CAM_ENTRY_NUM_88E 32 //---------------------------------------------------------------------------- // 8192C EEPROM/EFUSE share register definition. @@ -148,5 +157,5 @@ #define EFUSE_ACCESS_ON 0x69 // For RTL8723 only. #define EFUSE_ACCESS_OFF 0x00 // For RTL8723 only. -#endif //__RTL8188E_SPEC_H__ +#endif /* __RTL8188E_SPEC_H__ */ diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8188e_xmit.h b/backports/drivers/realtek/rtl8812au/include/rtl8188e_xmit.h index 3a711c161f68e2..793a66bfbc1423 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8188e_xmit.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8188e_xmit.h @@ -21,17 +21,7 @@ #define __RTL8188E_XMIT_H__ -// -// Queue Select Value in TxDesc -// -#define QSLT_BK 0x2//0x01 -#define QSLT_BE 0x0 -#define QSLT_VI 0x5//0x4 -#define QSLT_VO 0x7//0x6 -#define QSLT_BEACON 0x10 -#define QSLT_HIGH 0x11 -#define QSLT_MGNT 0x12 -#define QSLT_CMD 0x13 + //For 88e early mode #define SET_EARLYMODE_PKTNUM(__pAddr, __Value) SET_BITS_TO_LE_4BYTE(__pAddr, 0, 3, __Value) @@ -249,8 +239,13 @@ struct txrpt_ccx_88e { #define txrpt_ccx_sw_88e(txrpt_ccx) ((txrpt_ccx)->sw0 + ((txrpt_ccx)->sw1<<8)) #define txrpt_ccx_qtime_88e(txrpt_ccx) ((txrpt_ccx)->ccx_qtime0+((txrpt_ccx)->ccx_qtime1<<8)) -void rtl8188e_fill_fake_txdesc(PADAPTER padapter,u8*pDesc,u32 BufferLen,u8 IsPsPoll,u8 IsBTQosNull); -#ifdef CONFIG_SDIO_HCI +#define SET_TX_DESC_SEC_TYPE_8188E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+4, 22, 2, __Value) + +void rtl8188e_fill_fake_txdesc(PADAPTER padapter,u8*pDesc,u32 BufferLen, + u8 IsPsPoll,u8 IsBTQosNull, u8 bDataFrame); +void rtl8188e_cal_txdesc_chksum(struct tx_desc *ptxdesc); + +#if defined(CONFIG_SDIO_HCI)||defined (CONFIG_GSPI_HCI) s32 rtl8188es_init_xmit_priv(PADAPTER padapter); void rtl8188es_free_xmit_priv(PADAPTER padapter); s32 rtl8188es_hal_xmit(PADAPTER padapter, struct xmit_frame *pxmitframe); @@ -278,10 +273,10 @@ s32 rtl8188eu_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv #ifdef CONFIG_PCI_HCI s32 rtl8188ee_init_xmit_priv(PADAPTER padapter); void rtl8188ee_free_xmit_priv(PADAPTER padapter); -struct xmit_buf *rtl8188ee_dequeue_xmitbuf(struct rtw_tx_ring *ring); void rtl8188ee_xmitframe_resume(_adapter *padapter); s32 rtl8188ee_hal_xmit(PADAPTER padapter, struct xmit_frame *pxmitframe); s32 rtl8188ee_mgnt_xmit(PADAPTER padapter, struct xmit_frame *pmgntframe); +s32 rtl8188ee_hal_xmitframe_enqueue(_adapter *padapter, struct xmit_frame *pxmitframe); void rtl8188ee_xmit_tasklet(void *priv); #endif diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8192c_cmd.h b/backports/drivers/realtek/rtl8812au/include/rtl8192c_cmd.h index 4febe67c8e8a8b..3f254d6a111471 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8192c_cmd.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8192c_cmd.h @@ -78,6 +78,7 @@ u8 rtl8192c_set_rssi_cmd(_adapter*padapter, u8 *param); void rtl8192c_set_raid_cmd(_adapter*padapter, u32 mask, u8* arg); void rtl8192c_Add_RateATid(PADAPTER pAdapter, u32 bitmap, u8* arg, u8 rssi_level); u8 rtl8192c_set_FwSelectSuspend_cmd(_adapter*padapter,u8 bfwpoll, u16 period); +int rtl8192c_FillH2CCmd(_adapter* padapter, u8 ElementID, u32 CmdLen, u8* pCmdBuffer); #ifdef CONFIG_P2P void rtl8192c_set_p2p_ps_offload_cmd(_adapter* padapter, u8 p2p_ps_state); #endif //CONFIG_P2P diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8192c_hal.h b/backports/drivers/realtek/rtl8812au/include/rtl8192c_hal.h index 795e39696666d1..ccde9d54af398d 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8192c_hal.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8192c_hal.h @@ -21,13 +21,7 @@ #define __RTL8192C_HAL_H__ //#include "hal_com.h" - -#if 1 #include "hal_data.h" -#else -#include "../hal/OUTSRC/odm_precomp.h" -#endif - #include "drv_types.h" #include "rtl8192c_spec.h" @@ -402,8 +396,9 @@ void rtl8192c_EfuseParseChnlPlan(PADAPTER padapter, u8 *hwinfo, BOOLEAN AutoLoad HAL_VERSION rtl8192c_ReadChipVersion(IN PADAPTER Adapter); void rtl8192c_ReadBluetoothCoexistInfo(PADAPTER Adapter, u8 *PROMContent, BOOLEAN AutoloadFail); -//void rtl8192c_free_hal_data(_adapter * padapter); + VOID rtl8192c_EfuseParseIDCode(PADAPTER pAdapter, u8 *hwinfo); +void rtl8192c_init_default_value(_adapter *adapter); void rtl8192c_set_hal_ops(struct hal_ops *pHalFunc); s32 c2h_id_filter_ccx_8192c(u8 *buf); diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8192c_recv.h b/backports/drivers/realtek/rtl8812au/include/rtl8192c_recv.h index 85716b4105e47f..bab7575bb569dd 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8192c_recv.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8192c_recv.h @@ -26,6 +26,7 @@ #if defined(CONFIG_USB_HCI) +#ifndef MAX_RECVBUF_SZ #ifdef PLATFORM_OS_CE #define MAX_RECVBUF_SZ (8192+1024) // 8K+1k #else @@ -43,6 +44,7 @@ #define MAX_RECVBUF_SZ (4000) // about 4K #endif #endif +#endif //!MAX_RECVBUF_SZ #elif defined(CONFIG_PCI_HCI) //#ifndef CONFIG_MINIMAL_MEMORY_USAGE @@ -52,33 +54,12 @@ //#endif -#elif defined(CONFIG_SDIO_HCI) +#elif defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) #define MAX_RECVBUF_SZ (10240) #endif - - -struct phy_stat -{ - unsigned int phydw0; - - unsigned int phydw1; - - unsigned int phydw2; - - unsigned int phydw3; - - unsigned int phydw4; - - unsigned int phydw5; - - unsigned int phydw6; - - unsigned int phydw7; -}; - // Rx smooth factor #define Rx_Smooth_Factor (20) @@ -104,8 +85,7 @@ int rtl8192ce_init_recv_priv(_adapter * padapter); void rtl8192ce_free_recv_priv(_adapter * padapter); #endif -void rtl8192c_translate_rx_signal_stuff(union recv_frame *precvframe, struct phy_stat *pphy_status); void rtl8192c_query_rx_desc_status(union recv_frame *precvframe, struct recv_stat *pdesc); -#endif +#endif /* _RTL8192C_RECV_H_ */ diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8192c_spec.h b/backports/drivers/realtek/rtl8812au/include/rtl8192c_spec.h index 040651f954399c..80927de1cd8a37 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8192c_spec.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8192c_spec.h @@ -109,26 +109,8 @@ // // Interface type. // -#endif - -#ifdef CONFIG_USB_HCI - -//should be renamed and moved to another file -typedef enum _BOARD_TYPE_8192CUSB{ - BOARD_USB_DONGLE = 0, // USB dongle - BOARD_USB_High_PA = 1, // USB dongle with high power PA - BOARD_MINICARD = 2, // Minicard - BOARD_USB_SOLO = 3, // USB solo-Slim module - BOARD_USB_COMBO = 4, // USB Combo-Slim module -} BOARD_TYPE_8192CUSB, *PBOARD_TYPE_8192CUSB; - -#define SUPPORT_HW_RADIO_DETECT(pHalData) (pHalData->BoardType == BOARD_MINICARD||\ - pHalData->BoardType == BOARD_USB_SOLO||\ - pHalData->BoardType == BOARD_USB_COMBO) - #endif - #define EFUSE_ACCESS_ON 0x69 // For RTL8723 only. #define EFUSE_ACCESS_OFF 0x00 // For RTL8723 only. @@ -136,8 +118,10 @@ typedef enum _BOARD_TYPE_8192CUSB{ // General definitions //======================================================== +#define MACID_NUM_92C 32 +#define CAM_ENTRY_NUM_92C 32 #include "basic_types.h" -#endif +#endif /* __RTL8192C_SPEC_H__ */ diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8192c_xmit.h b/backports/drivers/realtek/rtl8812au/include/rtl8192c_xmit.h index c48847117179c1..c1108eb0c4beac 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8192c_xmit.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8192c_xmit.h @@ -61,17 +61,7 @@ //OFFSET 20 #define SGI BIT(6) -// -// Queue Select Value in TxDesc -// -#define QSLT_BK 0x2//0x01 -#define QSLT_BE 0x0 -#define QSLT_VI 0x5//0x4 -#define QSLT_VO 0x7//0x6 -#define QSLT_BEACON 0x10 -#define QSLT_HIGH 0x11 -#define QSLT_MGNT 0x12 -#define QSLT_CMD 0x13 + struct txrpt_ccx_8192c { /* offset 0 */ diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8192d_cmd.h b/backports/drivers/realtek/rtl8812au/include/rtl8192d_cmd.h index 3896b7daa751ce..deb03a0465f66d 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8192d_cmd.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8192d_cmd.h @@ -28,24 +28,24 @@ // User Define Message [31:8] //_SETPWRMODE_PARM -#define SET_H2CCMD_PWRMODE_PARM_MODE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value) -#define SET_H2CCMD_PWRMODE_PARM_SMART_PS(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 8, __Value) -#define SET_H2CCMD_PWRMODE_PARM_BCN_PASS_TIME(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+2, 0, 8, __Value) +#define SET_H2CCMD_PWRMODE_PARM_MODE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd, 0, 8, __Value) +#define SET_H2CCMD_PWRMODE_PARM_SMART_PS(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+1, 0, 8, __Value) +#define SET_H2CCMD_PWRMODE_PARM_BCN_PASS_TIME(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+2, 0, 8, __Value) //JOINBSSRPT_PARM -#define SET_H2CCMD_JOINBSSRPT_PARM_OPMODE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value) +#define SET_H2CCMD_JOINBSSRPT_PARM_OPMODE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd, 0, 8, __Value) //_RSVDPAGE_LOC -#define SET_H2CCMD_RSVDPAGE_LOC_PROBE_RSP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value) -#define SET_H2CCMD_RSVDPAGE_LOC_PSPOLL(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 8, __Value) -#define SET_H2CCMD_RSVDPAGE_LOC_NULL_DATA(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+2, 0, 8, __Value) +#define SET_H2CCMD_RSVDPAGE_LOC_PROBE_RSP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd, 0, 8, __Value) +#define SET_H2CCMD_RSVDPAGE_LOC_PSPOLL(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+1, 0, 8, __Value) +#define SET_H2CCMD_RSVDPAGE_LOC_NULL_DATA(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+2, 0, 8, __Value) -#define SET_H2CCMD_P2P_PS_OFFLOAD_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value) -#define SET_H2CCMD_P2P_PS_OFFLOAD_ROLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value) -#define SET_H2CCMD_P2P_PS_OFFLOAD_CTW(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 2, 1, __Value) -#define SET_H2CCMD_P2P_PS_OFFLOAD_NOA0(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 3, 1, __Value) -#define SET_H2CCMD_P2P_PS_OFFLOAD_NOA1(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 4, 1, __Value) +#define SET_H2CCMD_P2P_PS_OFFLOAD_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value) +#define SET_H2CCMD_P2P_PS_OFFLOAD_ROLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value) +#define SET_H2CCMD_P2P_PS_OFFLOAD_CTW(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 2, 1, __Value) +#define SET_H2CCMD_P2P_PS_OFFLOAD_NOA0(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 3, 1, __Value) +#define SET_H2CCMD_P2P_PS_OFFLOAD_NOA1(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 4, 1, __Value) #define SET_H2CCMD_P2P_PS_OFFLOAD_ALLSTASLEEP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 5, 1, __Value) #define SET_H2CCMD_P2P_PS_OFFLOAD_DISCOVERY(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 6, 1, __Value) @@ -53,13 +53,13 @@ // Fisrt constructed by tynli. 2009.10.09. typedef enum _RTL8192D_H2C_CMD { - H2C_AP_OFFLOAD = 0, /*0*/ + H2C_92D_AP_OFFLOAD = 0, /*0*/ H2C_SETPWRMODE = 1, /*1*/ H2C_JOINBSSRPT = 2, /*2*/ H2C_RSVDPAGE = 3, H2C_RSSI_REPORT = 5, H2C_RA_MASK = 6, - H2C_P2P_PS_OFFLOAD = 8, + H2C_92D_P2P_PS_OFFLOAD = 8, H2C_MAC_MODE_SEL = 9, H2C_PWRM=15, H2C_P2P_PS_CTW_CMD = 24, @@ -76,7 +76,7 @@ struct cmd_msg_parm { }; -void FillH2CCmd92D(_adapter* padapter, u8 ElementID, u32 CmdLen, u8* pCmdBuffer); +int FillH2CCmd92D(_adapter* padapter, u8 ElementID, u32 CmdLen, u8* pCmdBuffer); // host message to firmware cmd void rtl8192d_set_FwPwrMode_cmd(_adapter*padapter, u8 Mode); diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8192d_hal.h b/backports/drivers/realtek/rtl8812au/include/rtl8192d_hal.h index b9779d5971955a..7190694c9c14b1 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8192d_hal.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8192d_hal.h @@ -22,11 +22,7 @@ //#include "hal_com.h" -#if 1 #include "hal_data.h" -#else -#include "../hal/OUTSRC/odm_precomp.h" -#endif #include "rtl8192d_spec.h" #include "Hal8192DPhyReg.h" @@ -401,6 +397,7 @@ BOOLEAN PHY_CheckPowerOffFor8192D(PADAPTER Adapter); VOID PHY_SetPowerOnFor8192D(PADAPTER Adapter); //void PHY_ConfigMacPhyMode92D(PADAPTER Adapter); void rtl8192d_free_hal_data(_adapter * padapter); +void rtl8192d_init_default_value(_adapter *adapter); void rtl8192d_set_hal_ops(struct hal_ops *pHalFunc); void SetHwReg8192D(_adapter *adapter, u8 variable, u8 *val); diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8192d_recv.h b/backports/drivers/realtek/rtl8812au/include/rtl8192d_recv.h index eff00fe7d6cc56..029d2aa3d099f0 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8192d_recv.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8192d_recv.h @@ -27,6 +27,7 @@ #if defined(CONFIG_USB_HCI) +#ifndef MAX_RECVBUF_SZ #ifdef PLATFORM_OS_CE #define MAX_RECVBUF_SZ (8192+1024) // 8K+1k #else @@ -43,6 +44,7 @@ #define MAX_RECVBUF_SZ (4000) // about 4K #endif #endif +#endif //!MAX_RECVBUF_SZ #elif defined(CONFIG_PCI_HCI) //#ifndef CONFIG_MINIMAL_MEMORY_USAGE @@ -53,25 +55,6 @@ #endif -struct phy_stat -{ - unsigned int phydw0; - - unsigned int phydw1; - - unsigned int phydw2; - - unsigned int phydw3; - - unsigned int phydw4; - - unsigned int phydw5; - - unsigned int phydw6; - - unsigned int phydw7; -}; - // Rx smooth factor #define Rx_Smooth_Factor (20) @@ -96,8 +79,7 @@ int rtl8192de_init_recv_priv(_adapter * padapter); void rtl8192de_free_recv_priv(_adapter * padapter); #endif -void rtl8192d_translate_rx_signal_stuff(union recv_frame *precvframe, struct phy_stat *pphy_status); void rtl8192d_query_rx_desc_status(union recv_frame *precvframe, struct recv_stat *pdesc); -#endif +#endif /* _RTL8192D_RECV_H_ */ diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8192d_spec.h b/backports/drivers/realtek/rtl8812au/include/rtl8192d_spec.h index 09c76e049d40fa..b316b7c4b6210f 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8192d_spec.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8192d_spec.h @@ -41,7 +41,7 @@ #define REG_HMEBOX_EXT_1 0x008A #define REG_HMEBOX_EXT_2 0x008C #define REG_HMEBOX_EXT_3 0x008E -#define REG_MAC_PHY_CTRL_NORMAL 0x00F8 +//#define REG_MAC_PHY_CTRL_NORMAL 0x00F8 #define REG_MAC0 0x0081 #define REG_MAC1 0x0053 #define FW_MAC0_ready 0x18 @@ -109,7 +109,10 @@ // General definitions //======================================================== +#define MACID_NUM_92D 32 +#define CAM_ENTRY_NUM_92D 32 + #include "basic_types.h" -#endif +#endif /* __RTL8192D_SPEC_H__ */ diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8192d_xmit.h b/backports/drivers/realtek/rtl8812au/include/rtl8192d_xmit.h index bddc3385e03b60..8add5a1a3b014e 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8192d_xmit.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8192d_xmit.h @@ -61,17 +61,7 @@ //OFFSET 20 #define SGI BIT(6) -// -// Queue Select Value in TxDesc -// -#define QSLT_BK 0x2//0x01 -#define QSLT_BE 0x0 -#define QSLT_VI 0x5//0x4 -#define QSLT_VO 0x7//0x6 -#define QSLT_BEACON 0x10 -#define QSLT_HIGH 0x11 -#define QSLT_MGNT 0x12 -#define QSLT_CMD 0x13 + //Because we open EM for normal case, we just always insert 2*8 bytes.by wl #ifdef USB_PACKET_OFFSET_SZ diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8192e_cmd.h b/backports/drivers/realtek/rtl8812au/include/rtl8192e_cmd.h index 54502455040ac7..c1ac01ececa00e 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8192e_cmd.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8192e_cmd.h @@ -42,6 +42,7 @@ typedef enum _RTL8192E_H2C_CMD H2C_8192E_SAP_PS = 0x26, H2C_8192E_RA_MASK = 0x40, H2C_8192E_RSSI_REPORT = 0x42, + H2C_8192E_RA_PARA_ADJUST = 0x46, H2C_8192E_WO_WLAN = 0x80, H2C_8192E_REMOTE_WAKE_CTRL = 0x81, @@ -65,7 +66,10 @@ typedef enum _RTL8192E_C2H_EVT C2H_8192E_FW_SWCHNL = 0x10, C2H_8192E_BT_MP = 11, C2H_8192E_RA_RPT=12, - +#ifdef CONFIG_FW_C2H_DEBUG + C2H_8192E_FW_DEBUG = 0xff, +#endif +/*CONFIG_FW_C2H_DEBUG*/ MAX_8192E_C2HEVENT }RTL8192E_C2H_EVT; @@ -114,22 +118,22 @@ typedef struct _RSVDPAGE_LOC_92E { //_SETPWRMODE_PARM -#define SET_8192E_H2CCMD_PWRMODE_PARM_MODE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value) -#define SET_8192E_H2CCMD_PWRMODE_PARM_RLBM(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 4, __Value) -#define SET_8192E_H2CCMD_PWRMODE_PARM_SMART_PS(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 4, 4, __Value) -#define SET_8192E_H2CCMD_PWRMODE_PARM_BCN_PASS_TIME(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+2, 0, 8, __Value) -#define SET_8192E_H2CCMD_PWRMODE_PARM_ALL_QUEUE_UAPSD(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+3, 0, 8, __Value) -#define SET_8192E_H2CCMD_PWRMODE_PARM_PWR_STATE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+4, 0, 8, __Value) -#define SET_8192E_H2CCMD_PWRMODE_PARM_BYTE5(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+5, 0, 8, __Value) -#define GET_8192E_H2CCMD_PWRMODE_PARM_MODE(__pH2CCmd) LE_BITS_TO_1BYTE(__pH2CCmd, 0, 8) +#define SET_8192E_H2CCMD_PWRMODE_PARM_MODE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd, 0, 8, __Value) +#define SET_8192E_H2CCMD_PWRMODE_PARM_RLBM(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 4, __Value) +#define SET_8192E_H2CCMD_PWRMODE_PARM_SMART_PS(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 4, 4, __Value) +#define SET_8192E_H2CCMD_PWRMODE_PARM_BCN_PASS_TIME(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+2, 0, 8, __Value) +#define SET_8192E_H2CCMD_PWRMODE_PARM_ALL_QUEUE_UAPSD(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+3, 0, 8, __Value) +#define SET_8192E_H2CCMD_PWRMODE_PARM_PWR_STATE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+4, 0, 8, __Value) +#define SET_8192E_H2CCMD_PWRMODE_PARM_BYTE5(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+5, 0, 8, __Value) +#define GET_8192E_H2CCMD_PWRMODE_PARM_MODE(__pH2CCmd) LE_BITS_TO_1BYTE(__pH2CCmd, 0, 8) //_P2P_PS_OFFLOAD #define SET_8192E_H2CCMD_P2P_PS_OFFLOAD_ENABLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value) -#define SET_8192E_H2CCMD_P2P_PS_OFFLOAD_ROLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value) +#define SET_8192E_H2CCMD_P2P_PS_OFFLOAD_ROLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value) #define SET_8192E_H2CCMD_P2P_PS_OFFLOAD_CTWINDOW_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 2, 1, __Value) -#define SET_8192E_H2CCMD_P2P_PS_OFFLOAD_NOA0_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 3, 1, __Value) -#define SET_8192E_H2CCMD_P2P_PS_OFFLOAD_NOA1_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 4, 1, __Value) -#define SET_8192E_H2CCMD_P2P_PS_OFFLOAD_ALLSTASLEEP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 5, 1, __Value) +#define SET_8192E_H2CCMD_P2P_PS_OFFLOAD_NOA0_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 3, 1, __Value) +#define SET_8192E_H2CCMD_P2P_PS_OFFLOAD_NOA1_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 4, 1, __Value) +#define SET_8192E_H2CCMD_P2P_PS_OFFLOAD_ALLSTASLEEP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 5, 1, __Value) // host message to firmware cmd @@ -138,9 +142,13 @@ void rtl8192e_set_FwJoinBssReport_cmd(PADAPTER padapter, u8 mstatus); u8 rtl8192e_set_rssi_cmd(PADAPTER padapter, u8 *param); void rtl8192e_set_raid_cmd(PADAPTER padapter, u32 bitmap, u8* arg); void rtl8192e_Add_RateATid(PADAPTER padapter, u32 bitmap, u8 *arg, u8 rssi_level); +s32 FillH2CCmd_8192E(PADAPTER padapter, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer); +u8 GetTxBufferRsvdPageNum8192E(_adapter *padapter, bool wowlan); //u8 rtl8192c_set_FwSelectSuspend_cmd(PADAPTER padapter, u8 bfwpoll, u16 period); - - +s32 c2h_handler_8192e(PADAPTER padapter, u8 *buf); +#ifdef CONFIG_BT_COEXIST +void rtl8192e_download_BTCoex_AP_mode_rsvd_page(PADAPTER padapter); +#endif // CONFIG_BT_COEXIST #ifdef CONFIG_P2P_PS void rtl8192e_set_p2p_ps_offload_cmd(PADAPTER padapter, u8 p2p_ps_state); //void rtl8723a_set_p2p_ps_offload_cmd(PADAPTER padapter, u8 p2p_ps_state); @@ -150,7 +158,6 @@ void CheckFwRsvdPageContent(PADAPTER padapter); void rtl8192e_set_FwMediaStatus_cmd(PADAPTER padapter, u16 mstatus_rpt ); #ifdef CONFIG_TSF_RESET_OFFLOAD -//u8 rtl8188e_reset_tsf(_adapter *padapter, u8 reset_port); int reset_tsf(PADAPTER Adapter, u8 reset_port ); #endif // CONFIG_TSF_RESET_OFFLOAD @@ -212,4 +219,4 @@ C2HPacketHandler_8192E( IN u1Byte Length ); -#endif//__RTL8188E_CMD_H__ +#endif//__RTL8192E_CMD_H__ \ No newline at end of file diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8192e_hal.h b/backports/drivers/realtek/rtl8812au/include/rtl8192e_hal.h index 17dc8e9307ccaf..8941aa0fca94d5 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8192e_hal.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8192e_hal.h @@ -22,11 +22,7 @@ //#include "hal_com.h" -#if 1 #include "hal_data.h" -#else -#include "../hal/OUTSRC/odm_precomp.h" -#endif //include HAL Related header after HAL Related compiling flags #include "rtl8192e_spec.h" @@ -49,17 +45,18 @@ //--------------------------------------------------------------------- // RTL8192E From header //--------------------------------------------------------------------- - #define RTL8192E_FW_IMG "rtl8192E/FW_NIC.bin" - #define RTL8192E_FW_WW_IMG "rtl8192E/FW_WoWLAN.bin" - #define RTL8192E_PHY_REG "rtl8192E/PHY_REG.txt" - #define RTL8192E_PHY_RADIO_A "rtl8192E/RadioA.txt" - #define RTL8192E_PHY_RADIO_B "rtl8192E/RadioB.txt" - #define RTL8192E_TXPWR_TRACK "rtl8192E/TxPowerTrack.txt" - #define RTL8192E_AGC_TAB "rtl8192E/AGC_TAB.txt" - #define RTL8192E_PHY_MACREG "rtl8192E/MAC_REG.txt" - #define RTL8192E_PHY_REG_PG "rtl8192E/PHY_REG_PG.txt" - #define RTL8192E_PHY_REG_MP "rtl8192E/PHY_REG_MP.txt" - #define RTL8192E_TXPWR_LMT "rtl8192E/TXPWR_LMT.txt" + #define RTL8192E_FW_IMG "rtl8192e/FW_NIC.bin" + #define RTL8192E_FW_WW_IMG "rtl8192e/FW_WoWLAN.bin" + #define RTL8192E_PHY_REG "rtl8192e/PHY_REG.txt" + #define RTL8192E_PHY_RADIO_A "rtl8192e/RadioA.txt" + #define RTL8192E_PHY_RADIO_B "rtl8192e/RadioB.txt" + #define RTL8192E_TXPWR_TRACK "rtl8192e/TxPowerTrack.txt" + #define RTL8192E_AGC_TAB "rtl8192e/AGC_TAB.txt" + #define RTL8192E_PHY_MACREG "rtl8192e/MAC_REG.txt" + #define RTL8192E_PHY_REG_PG "rtl8192e/PHY_REG_PG.txt" + #define RTL8192E_PHY_REG_MP "rtl8192e/PHY_REG_MP.txt" + #define RTL8192E_TXPWR_LMT "rtl8192e/TXPWR_LMT.txt" + #define RTL8192E_WIFI_ANT_ISOLATION "rtl8192e/wifi_ant_isolation.txt" //--------------------------------------------------------------------- // RTL8192E Power Configuration CMDs for PCIe interface @@ -131,45 +128,67 @@ typedef struct _RT_FIRMWARE_8192E { #define DRIVER_EARLY_INT_TIME_8192E 0x05 #define BCN_DMA_ATIME_INT_TIME_8192E 0x02 +#define RX_DMA_SIZE_8192E 0x4000 /* 16K*/ +#ifdef CONFIG_FW_C2H_DEBUG + #define RX_DMA_RESERVED_SIZE_8192E 0x100 /* 256B, reserved for c2h debug message*/ +#else + #define RX_DMA_RESERVED_SIZE_8192E 0x40 /* 64B, reserved for c2h event(16bytes) or ccx(8 Bytes )*/ +#endif +#define MAX_RX_DMA_BUFFER_SIZE_8192E (RX_DMA_SIZE_8192E-RX_DMA_RESERVED_SIZE_8192E) /*RX 16K*/ + +//For General Reserved Page Number(Beacon Queue is reserved page) +//if (CONFIG_2BCN_EN) Beacon:4, PS-Poll:1, Null Data:1,Prob Rsp:1,Qos Null Data:1 +//Beacon:2, PS-Poll:1, Null Data:1,Prob Rsp:1,Qos Null Data:1 +#define RSVD_PAGE_NUM_8192E 0x08 +//For WoWLan , more reserved page +//ARP Rsp:1, RWC:1, GTK Info:1,GTK RSP:2,GTK EXT MEM:2, PNO: 6 +#ifdef CONFIG_WOWLAN +#define WOWLAN_PAGE_NUM_8192E 0x07 +#else +#define WOWLAN_PAGE_NUM_8192E 0x00 +#endif + +#ifdef CONFIG_PNO_SUPPORT +#undef WOWLAN_PAGE_NUM_8192E +#define WOWLAN_PAGE_NUM_8192E 0x0d +#endif -#define MAX_RX_DMA_BUFFER_SIZE_8192E 0x3d00 //0x3E80 //0x3FFF // RX 16K reserved for WOW ? +#define TOTAL_RSVD_PAGE_NUMBER_8192E (RSVD_PAGE_NUM_8192E+WOWLAN_PAGE_NUM_8192E) +#define TX_TOTAL_PAGE_NUMBER_8192E (0x100 - TOTAL_RSVD_PAGE_NUMBER_8192E) +#define TX_PAGE_BOUNDARY_8192E TX_TOTAL_PAGE_NUMBER_8192E -#define TX_TOTAL_PAGE_NUMBER_8192E 243 //0x00~0xF3 totoal pages: F4 -#define TX_PAGE_BOUNDARY_8192E (TX_TOTAL_PAGE_NUMBER_8192E + 1)//0xF4,Rserved 12 pages for BCN/PS-POLL.. +#define PAGE_SIZE_TX_92E PAGE_SIZE_256 +#define RSVD_PKT_LEN_92E (TOTAL_RSVD_PAGE_NUMBER_8192E *PAGE_SIZE_TX_92E) + #define TX_PAGE_LOAD_FW_BOUNDARY_8192E 0x47 //0xA5 #define TX_PAGE_BOUNDARY_WOWLAN_8192E 0xE0 // For Normal Chip Setting // (HPQ + LPQ + NPQ + PUBQ) shall be TX_TOTAL_PAGE_NUMBER_92C -#define NORMAL_PAGE_NUM_PUBQ_8192E 0xE0 -#define NORMAL_PAGE_NUM_LPQ_8192E 0x0C -#define NORMAL_PAGE_NUM_HPQ_8192E 0x08 -#define NORMAL_PAGE_NUM_NPQ_8192E 0x00 -#define NORMAL_PAGE_NUM_EPQ_8192E 0x00 +#define NORMAL_PAGE_NUM_HPQ_8192E 0x10 +#define NORMAL_PAGE_NUM_LPQ_8192E 0x10 +#define NORMAL_PAGE_NUM_NPQ_8192E 0x10 +#define NORMAL_PAGE_NUM_EPQ_8192E 0x00 //Note: For WMM Normal Chip Setting ,modify later -#define WMM_NORMAL_TX_TOTAL_PAGE_NUMBER_8192E TX_PAGE_BOUNDARY_8192E -#define WMM_NORMAL_TX_PAGE_BOUNDARY_8192E (WMM_NORMAL_TX_TOTAL_PAGE_NUMBER_8192E + 1) - -#define WMM_NORMAL_PAGE_NUM_PUBQ_8192E NORMAL_PAGE_NUM_PUBQ_8192E #define WMM_NORMAL_PAGE_NUM_HPQ_8192E NORMAL_PAGE_NUM_HPQ_8192E #define WMM_NORMAL_PAGE_NUM_LPQ_8192E NORMAL_PAGE_NUM_LPQ_8192E #define WMM_NORMAL_PAGE_NUM_NPQ_8192E NORMAL_PAGE_NUM_NPQ_8192E -#define USB_JAGUAR_DUMMY_OFFSET_8192EU 2 -#define USB_JAGUAR_DUMMY_UNIT_8192EU 8 -#define USB_JAGUAR_ALL_DUMMY_LENGTH_8192EU (USB_JAGUAR_DUMMY_OFFSET_8192EU * USB_JAGUAR_DUMMY_UNIT_8192EU) -#define USB_HWDESC_HEADER_LEN_8192EU (TX_DESC_SIZE_8192E + USB_JAGUAR_ALL_DUMMY_LENGTH_8192EU) - //------------------------------------------------------------------------- // Chip specific //------------------------------------------------------------------------- +// pic buffer descriptor +#define RTL8192EE_SEG_NUM TX_BUFFER_SEG_NUM +#define TX_DESC_NUM_92E 128 +#define RX_DESC_NUM_92E 128 + //------------------------------------------------------------------------- // Channel Plan //------------------------------------------------------------------------- @@ -203,7 +222,7 @@ typedef struct _RT_FIRMWARE_8192E { #define EFUSE_BT_MAX_SECTION_8192E 128 // 1024/8 #define EFUSE_PROTECT_BYTES_BANK_8192E 16 -#define EFUSE_MAX_BANK_8192E 3 +#define EFUSE_MAX_BANK_8192E 3 //=========================================================== #define INCLUDE_MULTI_FUNC_BT(_Adapter) (GET_HAL_DATA(_Adapter)->MultiFunc & RT_MULTI_FUNC_BT) @@ -213,8 +232,6 @@ typedef struct _RT_FIRMWARE_8192E { //#define RT_IS_FUNC_DISABLED(__pAdapter, __FuncBits) ( (__pAdapter)->DisabledFunctions & (__FuncBits) ) -#define GetDefaultAdapter(padapter) padapter - // rtl8812_hal_init.c void _8051Reset8192E(PADAPTER padapter); s32 FirmwareDownload8192E(PADAPTER Adapter, BOOLEAN bUsedWoWLANFw); @@ -246,6 +263,8 @@ void Hal_DetectWoWMode(PADAPTER pAdapter); /***********************************************************/ // RTL8192E-MAC Setting +VOID _InitQueueReservedPage_8192E(IN PADAPTER Adapter); +VOID _InitQueuePriority_8192E(IN PADAPTER Adapter); VOID _InitTxBufferBoundary_8192E(IN PADAPTER Adapter,IN u8 txpktbuf_bndy); VOID _InitPageBoundary_8192E(IN PADAPTER Adapter); //VOID _InitTransferPageSize_8192E(IN PADAPTER Adapter); @@ -255,15 +274,16 @@ VOID _InitRDGSetting_8192E(PADAPTER Adapter); void _InitID_8192E(IN PADAPTER Adapter); VOID _InitNetworkType_8192E(IN PADAPTER Adapter); VOID _InitWMACSetting_8192E(IN PADAPTER Adapter); -VOID _InitAdaptiveCtrl_8192E(IN PADAPTER Adapter); +VOID _InitAdaptiveCtrl_8192E(IN PADAPTER Adapter); +VOID _InitRateFallback_8192E(IN PADAPTER Adapter); VOID _InitEDCA_8192E( IN PADAPTER Adapter); VOID _InitRetryFunction_8192E( IN PADAPTER Adapter); +VOID _BBTurnOnBlock_8192E(IN PADAPTER Adapter); VOID _InitBeaconParameters_8192E(IN PADAPTER Adapter); VOID _InitBeaconMaxError_8192E( IN PADAPTER Adapter, IN BOOLEAN InfraMode ); -void _BBTurnOnBlock_8192E(PADAPTER padapter); void SetBeaconRelatedRegisters8192E(PADAPTER padapter); VOID hal_ReadRFType_8192E(PADAPTER Adapter); // RTL8192E-MAC Setting @@ -291,5 +311,21 @@ void SetBcnCtrlReg(PADAPTER padapter, u8 SetBits, u8 ClearBits); void rtl8192e_start_thread(_adapter *padapter); void rtl8192e_stop_thread(_adapter *padapter); + +#ifdef CONFIG_PCI_HCI +BOOLEAN InterruptRecognized8192EE(PADAPTER Adapter); +u16 get_txdesc_buf_addr(u16 ff_hwaddr); +#endif + +#ifdef CONFIG_SDIO_HCI +#ifdef CONFIG_SDIO_TX_ENABLE_AVAL_INT +void _init_available_page_threshold(PADAPTER padapter, u8 numHQ, u8 numNQ, u8 numLQ, u8 numPubQ); +#endif +#endif + +#ifdef CONFIG_BT_COEXIST +void rtl8192e_combo_card_WifiOnlyHwInit(PADAPTER Adapter); +#endif + #endif //__RTL8192E_HAL_H__ diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8192e_recv.h b/backports/drivers/realtek/rtl8812au/include/rtl8192e_recv.h index a8404849669cb9..762c6af2934c8b 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8192e_recv.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8192e_recv.h @@ -22,19 +22,25 @@ #if defined(CONFIG_USB_HCI) +#ifndef MAX_RECVBUF_SZ #ifdef PLATFORM_OS_CE #define MAX_RECVBUF_SZ (8192+1024) // 8K+1k #else #ifdef CONFIG_MINIMAL_MEMORY_USAGE #define MAX_RECVBUF_SZ (4000) // about 4K #else + #ifdef CONFIG_PLATFORM_MSTAR + #define MAX_RECVBUF_SZ (8192) // 8K + #else #define MAX_RECVBUF_SZ (32768) // 32k + #endif //#define MAX_RECVBUF_SZ (20480) //20K //#define MAX_RECVBUF_SZ (10240) //10K //#define MAX_RECVBUF_SZ (16384) // 16k - 92E RX BUF :16K //#define MAX_RECVBUF_SZ (8192+1024) // 8K+1k #endif #endif +#endif //!MAX_RECVBUF_SZ #elif defined(CONFIG_PCI_HCI) //#ifndef CONFIG_MINIMAL_MEMORY_USAGE @@ -55,7 +61,28 @@ #define Rx_Smooth_Factor (20) //============= +// [1] Rx Buffer Descriptor (for PCIE) buffer descriptor architecture +//DWORD 0 +#define SET_RX_BUFFER_DESC_DATA_LENGTH_92E(__pRxStatusDesc, __Value) SET_BITS_TO_LE_4BYTE( __pRxStatusDesc, 0, 14, __Value) +#define SET_RX_BUFFER_DESC_LS_92E(__pRxStatusDesc,__Value) SET_BITS_TO_LE_4BYTE( __pRxStatusDesc, 15, 1, __Value) +#define SET_RX_BUFFER_DESC_FS_92E(__pRxStatusDesc, __Value) SET_BITS_TO_LE_4BYTE( __pRxStatusDesc, 16, 1, __Value) +#define SET_RX_BUFFER_DESC_TOTAL_LENGTH_92E(__pRxStatusDesc, __Value) SET_BITS_TO_LE_4BYTE( __pRxStatusDesc, 16, 15, __Value) + +#define GET_RX_BUFFER_DESC_OWN_92E(__pRxStatusDesc) LE_BITS_TO_4BYTE( __pRxStatusDesc, 31, 1) +#define GET_RX_BUFFER_DESC_LS_92E(__pRxStatusDesc) LE_BITS_TO_4BYTE( __pRxStatusDesc, 15, 1) +#define GET_RX_BUFFER_DESC_FS_92E(__pRxStatusDesc) LE_BITS_TO_4BYTE( __pRxStatusDesc, 16, 1) +#define GET_RX_BUFFER_DESC_TOTAL_LENGTH_92E(__pRxStatusDesc) LE_BITS_TO_4BYTE( __pRxStatusDesc, 16, 15) + + +//DWORD 1 +#define SET_RX_BUFFER_PHYSICAL_LOW_92E(__pRxStatusDesc, __Value) SET_BITS_TO_LE_4BYTE( __pRxStatusDesc+4, 0, 32, __Value) +#define GET_RX_BUFFER_PHYSICAL_LOW_92E(__pRxStatusDesc) LE_BITS_TO_4BYTE( __pRxStatusDesc+4, 0, 32) + +//DWORD 2 +#define SET_RX_BUFFER_PHYSICAL_HIGH_92E(__pRxStatusDesc, __Value) SET_BITS_TO_LE_4BYTE( __pRxStatusDesc+8, 0, 32, __Value) +//============= +// [2] Rx Descriptor //DWORD 0 #define GET_RX_STATUS_DESC_PKT_LEN_92E(__pRxStatusDesc) LE_BITS_TO_4BYTE( __pRxStatusDesc, 0, 14) #define GET_RX_STATUS_DESC_CRC32_92E(__pRxStatusDesc) LE_BITS_TO_4BYTE( __pRxStatusDesc, 14, 1) @@ -67,6 +94,12 @@ #define GET_RX_STATUS_DESC_PHY_STATUS_92E(__pRxStatusDesc) LE_BITS_TO_4BYTE( __pRxStatusDesc, 26, 1) #define GET_RX_STATUS_DESC_SWDEC_92E(__pRxStatusDesc) LE_BITS_TO_4BYTE( __pRxStatusDesc, 27, 1) #define GET_RX_STATUS_DESC_EOR_92E(__pRxStatusDesc) LE_BITS_TO_4BYTE( __pRxStatusDesc, 30, 1) +#define GET_RX_STATUS_DESC_OWN_92E(__pRxStatusDesc) LE_BITS_TO_4BYTE( __pRxStatusDesc, 31, 1) + + +#define SET_RX_STATUS_DESC_PKT_LEN_92E(__pRxStatusDesc, __Value) SET_BITS_TO_LE_4BYTE( __pRxStatusDesc, 0, 14, __Value) +#define SET_RX_STATUS_DESC_EOR_92E(__pRxStatusDesc, __Value) SET_BITS_TO_LE_4BYTE( __pRxStatusDesc, 30, 1, __Value) +#define SET_RX_STATUS_DESC_OWN_92E(__pRxStatusDesc, __Value) SET_BITS_TO_LE_4BYTE( __pRxStatusDesc, 31, 1, __Value) //DWORD 1 #define GET_RX_STATUS_DESC_MACID_92E(__pRxDesc) LE_BITS_TO_4BYTE(__pRxDesc+4, 0, 7) @@ -116,13 +149,11 @@ #define GET_RX_STATUS_DESC_BUFF_ADDR_92E(__pRxDesc) LE_BITS_TO_4BYTE(__pRxDesc+24, 0, 32) #define GET_RX_STATUS_DESC_BUFF_ADDR64_92E(__pRxDesc) LE_BITS_TO_4BYTE(__pRxDesc+28, 0, 32) -#define SET_RX_STATUS_DESC_BUFF_ADDR_92E(__pRxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pRxDesc+24, 0, 32, __Value) - #ifdef CONFIG_SDIO_HCI -s32 rtl8812s_init_recv_priv(PADAPTER padapter); -void rtl8812s_free_recv_priv(PADAPTER padapter); -void rtl8812s_recv_hdl(PADAPTER padapter, struct recv_buf *precvbuf); +s32 rtl8192es_init_recv_priv(PADAPTER padapter); +void rtl8192es_free_recv_priv(PADAPTER padapter); +void rtl8192es_recv_hdl(PADAPTER padapter, struct recv_buf *precvbuf); #endif #ifdef CONFIG_USB_HCI @@ -141,7 +172,6 @@ void rtl8192ee_free_recv_priv(PADAPTER padapter); #endif void rtl8192e_query_rx_desc_status(union recv_frame *precvframe, u8 *pdesc); -void rtl8192e_query_rx_phy_status(union recv_frame *prframe, u8 *pphy_stat); -#endif +#endif /* __RTL8192E_RECV_H__ */ diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8192e_spec.h b/backports/drivers/realtek/rtl8812au/include/rtl8192e_spec.h index d7215e4f33a924..be6efa32b04b58 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8192e_spec.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8192e_spec.h @@ -35,11 +35,13 @@ // 0x0000h ~ 0x00FFh System Configuration // //----------------------------------------------------- +#define REG_SYS_SWR_CTRL1_8192E 0x0010 // 1 Byte +#define REG_SYS_SWR_CTRL2_8192E 0x0014 // 1 Byte #define REG_AFE_CTRL1_8192E 0x0024 #define REG_AFE_CTRL2_8192E 0x0028 #define REG_AFE_CTRL3_8192E 0x002c - +#define REG_PAD_CTRL1_8192E 0x0064 #define REG_SDIO_CTRL_8192E 0x0070 #define REG_OPT_CTRL_8192E 0x0074 #define REG_RF_B_CTRL_8192E 0x0076 @@ -79,9 +81,8 @@ // 0x0200h ~ 0x027Fh TXDMA Configuration // //----------------------------------------------------- -#define REG_DWBCN0_CTRL 0x0208 -#define REG_DWBCN1_CTRL 0x0228 - +#define REG_DWBCN0_CTRL 0x0208 +#define REG_DWBCN1_CTRL 0x0228 //----------------------------------------------------- // @@ -101,7 +102,62 @@ // 0x0300h ~ 0x03FFh PCIe // //----------------------------------------------------- -#define REG_PCIE_MULTIFET_CTRL_8192E 0x036A //PCIE Multi-Fethc Control +#define REG_PCIE_CTRL_REG_8192E 0x0300 +#define REG_INT_MIG_8192E 0x0304 // Interrupt Migration +#define REG_BCNQ_TXBD_DESA_8192E 0x0308 // TX Beacon Descriptor Address +#define REG_MGQ_TXBD_DESA_8192E 0x0310 // TX Manage Queue Descriptor Address +#define REG_VOQ_TXBD_DESA_8192E 0x0318 // TX VO Queue Descriptor Address +#define REG_VIQ_TXBD_DESA_8192E 0x0320 // TX VI Queue Descriptor Address +#define REG_BEQ_TXBD_DESA_8192E 0x0328 // TX BE Queue Descriptor Address +#define REG_BKQ_TXBD_DESA_8192E 0x0330 // TX BK Queue Descriptor Address +#define REG_RXQ_RXBD_DESA_8192E 0x0338 // RX Queue Descriptor Address +#define REG_HI0Q_TXBD_DESA_8192E 0x0340 +#define REG_HI1Q_TXBD_DESA_8192E 0x0348 +#define REG_HI2Q_TXBD_DESA_8192E 0x0350 +#define REG_HI3Q_TXBD_DESA_8192E 0x0358 +#define REG_HI4Q_TXBD_DESA_8192E 0x0360 +#define REG_HI5Q_TXBD_DESA_8192E 0x0368 +#define REG_HI6Q_TXBD_DESA_8192E 0x0370 +#define REG_HI7Q_TXBD_DESA_8192E 0x0378 +#define REG_MGQ_TXBD_NUM_8192E 0x0380 +#define REG_RX_RXBD_NUM_8192E 0x0382 +#define REG_VOQ_TXBD_NUM_8192E 0x0384 +#define REG_VIQ_TXBD_NUM_8192E 0x0386 +#define REG_BEQ_TXBD_NUM_8192E 0x0388 +#define REG_BKQ_TXBD_NUM_8192E 0x038A +#define REG_HI0Q_TXBD_NUM_8192E 0x038C +#define REG_HI1Q_TXBD_NUM_8192E 0x038E +#define REG_HI2Q_TXBD_NUM_8192E 0x0390 +#define REG_HI3Q_TXBD_NUM_8192E 0x0392 +#define REG_HI4Q_TXBD_NUM_8192E 0x0394 +#define REG_HI5Q_TXBD_NUM_8192E 0x0396 +#define REG_HI6Q_TXBD_NUM_8192E 0x0398 +#define REG_HI7Q_TXBD_NUM_8192E 0x039A +#define REG_TSFTIMER_HCI_8192E 0x039C + +//Read Write Point +#define REG_VOQ_TXBD_IDX_8192E 0x03A0 +#define REG_VIQ_TXBD_IDX_8192E 0x03A4 +#define REG_BEQ_TXBD_IDX_8192E 0x03A8 +#define REG_BKQ_TXBD_IDX_8192E 0x03AC +#define REG_MGQ_TXBD_IDX_8192E 0x03B0 +#define REG_RXQ_TXBD_IDX_8192E 0x03B4 +#define REG_HI0Q_TXBD_IDX_8192E 0x03B8 +#define REG_HI1Q_TXBD_IDX_8192E 0x03BC +#define REG_HI2Q_TXBD_IDX_8192E 0x03C0 +#define REG_HI3Q_TXBD_IDX_8192E 0x03C4 +#define REG_HI4Q_TXBD_IDX_8192E 0x03C8 +#define REG_HI5Q_TXBD_IDX_8192E 0x03CC +#define REG_HI6Q_TXBD_IDX_8192E 0x03D0 +#define REG_HI7Q_TXBD_IDX_8192E 0x03D4 + +#define REG_PCIE_HCPWM_8192EE 0x03D8 // ?????? +#define REG_PCIE_HRPWM_8192EE 0x03DC //PCIe RPWM // ?????? +#define REG_DBI_WDATA_V1_8192E 0x03E8 +#define REG_DBI_RDATA_V1_8192E 0x03EC +#define REG_DBI_FLAG_V1_8192E 0x03F0 +#define REG_MDIO_V1_8192E 0x3F4 +#define REG_PCIE_MIX_CFG_8192E 0x3F8 //----------------------------------------------------- // @@ -109,14 +165,22 @@ // //----------------------------------------------------- #define REG_TXBF_CTRL_8192E 0x042C +#define REG_ARFR0_8192E 0x0444 #define REG_ARFR1_8192E 0x044C #define REG_CCK_CHECK_8192E 0x0454 #define REG_AMPDU_MAX_TIME_8192E 0x0456 #define REG_BCNQ1_BDNY_8192E 0x0457 #define REG_AMPDU_MAX_LENGTH_8192E 0x0458 +#define REG_WMAC_LBK_BUF_HD_8192E 0x045D #define REG_NDPA_OPT_CTRL_8192E 0x045F #define REG_DATA_SC_8192E 0x0483 +#ifdef CONFIG_WOWLAN +#define REG_TXPKTBUF_IV_LOW 0x0484 +#define REG_TXPKTBUF_IV_HIGH 0x0488 +#endif +#define REG_ARFR2_8192E 0x048C +#define REG_ARFR3_8192E 0x0494 #define REG_TXRPT_START_OFFSET 0x04AC #define REG_AMPDU_BURST_MODE_8192E 0x04BC #define REG_HT_SINGLE_AMPDU_8192E 0x04C7 @@ -249,8 +313,12 @@ #define AcmHw_ViqStatus_8192E BIT(6) #define AcmHw_BeqStatus_8192E BIT(7) +//======================================================== +// General definitions +//======================================================== - +#define MACID_NUM_8192E 128 +#define CAM_ENTRY_NUM_8192E 64 #endif //__RTL8192E_SPEC_H__ diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8192e_xmit.h b/backports/drivers/realtek/rtl8812au/include/rtl8192e_xmit.h index 200a111b20e71e..37e00887f00792 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8192e_xmit.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8192e_xmit.h @@ -127,17 +127,7 @@ typedef struct txdescriptor_8192e u32 mcs15_sgi_max_len:4; }TXDESC_8192E, *PTXDESC_8192E; -// -// Queue Select Value in TxDesc -// -#define QSLT_BK 0x2//0x01 -#define QSLT_BE 0x0 -#define QSLT_VI 0x5//0x4 -#define QSLT_VO 0x7//0x6 -#define QSLT_BEACON 0x10 -#define QSLT_HIGH 0x11 -#define QSLT_MGNT 0x12 -#define QSLT_CMD 0x13 + //For 88e early mode #define SET_EARLYMODE_PKTNUM(__pAddr, __Value) SET_BITS_TO_LE_4BYTE(__pAddr, 0, 3, __Value) @@ -207,16 +197,48 @@ typedef struct txdescriptor_8192e #define USB_TXAGG_NUM_SHT 24 +//=====Tx Desc Buffer content + +// config element for each tx buffer +/* +#define SET_TXBUFFER_DESC_LEN_WITH_OFFSET(__pTxDesc, __Offset, __Valeu) SET_BITS_TO_LE_4BYTE(__pTxDesc+(__Offset*16), 0, 16, __Valeu) +#define SET_TXBUFFER_DESC_AMSDU_WITH_OFFSET(__pTxDesc, __Offset, __Valeu) SET_BITS_TO_LE_4BYTE(__pTxDesc+(__Offset*16), 31, 1, __Valeu) +#define SET_TXBUFFER_DESC_ADD_LOW_WITH_OFFSET(__pTxDesc, __Offset, __Valeu) SET_BITS_TO_LE_4BYTE(__pTxDesc+(__Offset*16)+4, 0, 32, __Valeu) +#define SET_TXBUFFER_DESC_ADD_HIGT_WITH_OFFSET(__pTxDesc, __Offset, __Valeu) SET_BITS_TO_LE_4BYTE(__pTxDesc+(__Offset*16)+8, 0, 32, __Valeu) +*/ +#define SET_TXBUFFER_DESC_LEN_WITH_OFFSET(__pTxDesc, __Offset, __Valeu) SET_BITS_TO_LE_4BYTE(__pTxDesc+(__Offset*8), 0, 16, __Valeu) +#define SET_TXBUFFER_DESC_AMSDU_WITH_OFFSET(__pTxDesc, __Offset, __Valeu) SET_BITS_TO_LE_4BYTE(__pTxDesc+(__Offset*8), 31, 1, __Valeu) +#define SET_TXBUFFER_DESC_ADD_LOW_WITH_OFFSET(__pTxDesc, __Offset, __Valeu) SET_BITS_TO_LE_4BYTE(__pTxDesc+(__Offset*8)+4, 0, 32, __Valeu) +#define SET_TXBUFFER_DESC_ADD_HIGT_WITH_OFFSET(__pTxDesc, __Offset, __Valeu) SET_BITS_TO_LE_4BYTE(__pTxDesc+(__Offset*16)+8, 0, 32, __Valeu) + + +// Dword 0 +#define SET_TX_BUFF_DESC_LEN_0_92E(__pTxDesc, __Valeu) SET_BITS_TO_LE_4BYTE(__pTxDesc, 0, 14, __Valeu) +#define SET_TX_BUFF_DESC_PSB_92E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc, 16, 15, __Value) +#define SET_TX_BUFF_DESC_OWN_92E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc, 31, 1, __Value) +// Dword 1 +#define SET_TX_BUFF_DESC_ADDR_LOW_0_92E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+4, 0, 32, __Value) +#define GET_TX_DESC_TX_BUFFER_ADDRESS_92E(__pTxDesc) LE_BITS_TO_4BYTE(__pTxDesc+4, 0,32) + + +// Dword 2 +#define SET_TX_BUFF_DESC_ADDR_HIGH_0_92E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+8, 0, 32, __Value) +// Dword 3, RESERVED + -//=====Desc content +//=====Tx Desc content // Dword 0 #define SET_TX_DESC_PKT_SIZE_92E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc, 0, 16, __Value) #define SET_TX_DESC_OFFSET_92E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc, 16, 8, __Value) #define SET_TX_DESC_BMC_92E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc, 24, 1, __Value) #define SET_TX_DESC_HTC_92E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc, 25, 1, __Value) +#define SET_TX_DESC_LAST_SEG_92E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc, 26, 1, __Value) +#define SET_TX_DESC_FIRST_SEG_92E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc, 27, 1, __Value) #define SET_TX_DESC_LINIP_92E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc, 28, 1, __Value) #define SET_TX_DESC_NO_ACM_92E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc, 29, 1, __Value) #define SET_TX_DESC_GF_92E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc, 30, 1, __Value) +#define SET_TX_DESC_OWN_92E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc, 31, 1, __Value) +#define GET_TX_DESC_OWN_92E(__pTxDesc) LE_BITS_TO_4BYTE(__pTxDesc, 31, 1) // Dword 1 #define SET_TX_DESC_MACID_92E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+4, 0, 7, __Value) @@ -324,13 +346,8 @@ typedef struct txdescriptor_8192e #define SET_TX_DESC_TXBF_PATH_92E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+36, 11, 1, __Value) #define SET_TX_DESC_SEQ_92E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+36, 12, 12, __Value) #define SET_TX_DESC_FINAL_DATA_RATE_92E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+36, 24, 8, __Value) -// Dword 10 -#define SET_TX_DESC_TX_BUFFER_ADDRESS_92E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+40, 0, 32, __Value) -// Dword 11 -#define SET_TX_DESC_NEXT_DESC_ADDRESS_92E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+48, 0, 32, __Value) - #define SET_EARLYMODE_PKTNUM_92E(__pAddr, __Value) SET_BITS_TO_LE_4BYTE(__pAddr, 0, 4, __Value) #define SET_EARLYMODE_LEN0_92E(__pAddr, __Value) SET_BITS_TO_LE_4BYTE(__pAddr, 4, 15, __Value) #define SET_EARLYMODE_LEN1_1_92E(__pAddr, __Value) SET_BITS_TO_LE_4BYTE(__pAddr, 19, 13, __Value) @@ -338,9 +355,7 @@ typedef struct txdescriptor_8192e #define SET_EARLYMODE_LEN2_92E(__pAddr, __Value) SET_BITS_TO_LE_4BYTE(__pAddr+4, 2, 15, __Value) #define SET_EARLYMODE_LEN3_92E(__pAddr, __Value) SET_BITS_TO_LE_4BYTE(__pAddr+4, 17, 15, __Value) - - -void rtl8192e_fill_fake_txdesc(PADAPTER padapter,u8*pDesc,u32 BufferLen,u8 IsPsPoll,u8 IsBTQosNull); +void rtl8192e_cal_txdesc_chksum(u8 *ptxdesc); #ifdef CONFIG_USB_HCI s32 rtl8192eu_init_xmit_priv(PADAPTER padapter); @@ -358,12 +373,27 @@ s32 rtl8192eu_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv s32 rtl8192ee_init_xmit_priv(PADAPTER padapter); void rtl8192ee_free_xmit_priv(PADAPTER padapter); struct xmit_buf *rtl8192ee_dequeue_xmitbuf(struct rtw_tx_ring *ring); +s32 rtl8192ee_hal_xmitframe_enqueue(_adapter *padapter, struct xmit_frame *pxmitframe); void rtl8192ee_xmitframe_resume(_adapter *padapter); s32 rtl8192ee_hal_xmit(PADAPTER padapter, struct xmit_frame *pxmitframe); s32 rtl8192ee_mgnt_xmit(PADAPTER padapter, struct xmit_frame *pmgntframe); void rtl8192ee_xmit_tasklet(void *priv); #endif +#if defined(CONFIG_SDIO_HCI)||defined (CONFIG_GSPI_HCI) +s32 rtl8192es_init_xmit_priv(PADAPTER padapter); +void rtl8192es_free_xmit_priv(PADAPTER padapter); + +s32 rtl8192es_hal_xmit(PADAPTER padapter, struct xmit_frame *pxmitframe); +s32 rtl8192es_mgnt_xmit(PADAPTER padapter, struct xmit_frame *pmgntframe); +s32 rtl8192es_hal_xmitframe_enqueue(_adapter *padapter, struct xmit_frame *pxmitframe); +thread_return rtl8192es_xmit_thread(thread_context context); +s32 rtl8192es_xmit_buf_handler(PADAPTER padapter); + +#ifdef CONFIG_SDIO_TX_TASKLET +void rtl8192es_xmit_tasklet(void *priv); +#endif +#endif struct txrpt_ccx_92e { /* offset 0 */ @@ -402,12 +432,20 @@ struct txrpt_ccx_92e { #ifdef CONFIG_TX_EARLY_MODE void UpdateEarlyModeInfo8192E(struct xmit_priv *pxmitpriv,struct xmit_buf *pxmitbuf ); #endif - + s32 rtl8192e_init_xmit_priv(_adapter *padapter); void _dbg_dump_tx_info(_adapter *padapter,int frame_tag,u8 *ptxdesc); -u8 BWMapping_92E(PADAPTER Adapter, struct pkt_attrib *pattrib); +void rtl8192e_fill_fake_txdesc(PADAPTER padapter,u8*pDesc,u32 BufferLen, + u8 IsPsPoll,u8 IsBTQosNull, u8 bDataFrame); +void rtl8192e_cal_txdesc_chksum(u8 *ptxdesc); +u8 BWMapping_92E(PADAPTER Adapter, struct pkt_attrib *pattrib); u8 SCMapping_92E(PADAPTER Adapter, struct pkt_attrib *pattrib); +void fill_txdesc_phy(PADAPTER padapter, struct pkt_attrib *pattrib, u8 *ptxdesc); +void fill_txdesc_vcs(struct pkt_attrib *pattrib, u8 *ptxdesc); +void fill_txdesc_sectype(struct pkt_attrib *pattrib, u8 *ptxdesc); +void rtl8192e_fixed_rate(_adapter *padapter,u8 *ptxdesc); #endif //__RTL8192E_XMIT_H__ + diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8723a_cmd.h b/backports/drivers/realtek/rtl8812au/include/rtl8723a_cmd.h index 43523d440f07ef..ced4a49623eff1 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8723a_cmd.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8723a_cmd.h @@ -21,7 +21,7 @@ #define __RTL8723A_CMD_H__ -#define H2C_BT_FW_PATCH_LEN 3 +#define H2C_8723A_BT_FW_PATCH_LEN 3 #define H2C_BT_PWR_FORCE_LEN 3 enum cmd_msg_element_id @@ -49,11 +49,11 @@ enum cmd_msg_element_id BT_PTA_MANAGER_UPDATE_ENABLE_EID = 38, DAC_SWING_VALUE_EID = 41, TRADITIONAL_TDMA_EN_EID = 51, - H2C_BT_FW_PATCH = 54, + H2C_8723A_BT_FW_PATCH = 54, B_TYPE_TDMA_EID = 58, SCAN_EN_EID = 59, LOWPWR_LPS_EID = 71, - H2C_RESET_TSF = 75, + H2C_8723A_RESET_TSF = 75, MAX_CMDMSG_EID }; diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8723a_hal.h b/backports/drivers/realtek/rtl8812au/include/rtl8723a_hal.h index 13c68614c0354d..d7f7b8fb0a63d9 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8723a_hal.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8723a_hal.h @@ -22,11 +22,7 @@ //#include "hal_com.h" -#if 1 #include "hal_data.h" -#else -#include "../hal/OUTSRC/odm_precomp.h" -#endif #include "rtl8723a_spec.h" #include "rtl8723a_pg.h" @@ -155,13 +151,6 @@ typedef struct _RT_FIRMWARE_8723A { u8 szFwBuffer[FW_8723A_SIZE]; #endif u32 ulFwLength; - -#ifdef CONFIG_EMBEDDED_FWIMG - u8* szBTFwBuffer; -#else - u8 szBTFwBuffer[FW_8723A_SIZE]; -#endif - u32 ulBTFwLength; } RT_FIRMWARE_8723A, *PRT_FIRMWARE_8723A; // @@ -448,6 +437,7 @@ void Hal_InitChannelPlan(PADAPTER padapter); void rtl8723a_set_hal_ops(struct hal_ops *pHalFunc); void SetHwReg8723A(PADAPTER padapter, u8 variable, u8 *val); void GetHwReg8723A(PADAPTER padapter, u8 variable, u8 *val); +u8 GetHalDefVar8723A(PADAPTER Adapter, HAL_DEF_VARIABLE eVariable, PVOID pValue); #ifdef CONFIG_BT_COEXIST void rtl8723a_SingleDualAntennaDetection(PADAPTER padapter); #endif diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8723a_recv.h b/backports/drivers/realtek/rtl8812au/include/rtl8723a_recv.h index 988316788325aa..f6bd87615b19c9 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8723a_recv.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8723a_recv.h @@ -31,11 +31,7 @@ s32 rtl8723as_init_recv_priv(PADAPTER padapter); void rtl8723as_free_recv_priv(PADAPTER padapter); #endif -void rtl8192c_query_rx_phy_status(union recv_frame *prframe, struct phy_stat *pphy_stat); -void rtl8192c_process_phy_info(PADAPTER padapter, void *prframe); -#ifdef CONFIG_USB_HCI -void update_recvframe_attrib(union recv_frame *precvframe, struct recv_stat *prxstat); -void update_recvframe_phyinfo(union recv_frame *precvframe, struct phy_stat *pphy_info); -#endif -#endif +void rtl8723a_query_rx_desc_status(union recv_frame *precvframe, struct recv_stat *prxstat); + +#endif /* __RTL8723A_RECV_H__ */ diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8723a_spec.h b/backports/drivers/realtek/rtl8812au/include/rtl8723a_spec.h index 6f67856f32964d..de2c28e281adbe 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8723a_spec.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8723a_spec.h @@ -98,6 +98,8 @@ // General definitions //============================================================================ +#define MACID_NUM_8723A 32 +#define CAM_ENTRY_NUM_8723A 32 -#endif +#endif /* __RTL8723A_SPEC_H__ */ diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8723a_xmit.h b/backports/drivers/realtek/rtl8812au/include/rtl8723a_xmit.h index a4bc48d1d04ad8..fabbdddac7fb4c 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8723a_xmit.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8723a_xmit.h @@ -48,7 +48,7 @@ //OFFSET 8 #define AGG_EN BIT(29) - +#define AMPDU_DENSITY_SHT 20 //OFFSET 12 #define SEQ_SHT 16 @@ -217,7 +217,8 @@ void handle_txrpt_ccx_8723a(_adapter *adapter, void *buf); #endif //CONFIG_XMIT_ACK void rtl8723a_update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem); -void rtl8723a_fill_fake_txdesc(PADAPTER padapter, u8 *pDesc, u32 BufferLen, u8 IsPsPoll, u8 IsBTQosNull); +void rtl8723a_fill_fake_txdesc(PADAPTER padapter, u8 *pDesc, u32 BufferLen, + u8 IsPsPoll, u8 IsBTQosNull, u8 IsDataFrame); #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) s32 rtl8723as_init_xmit_priv(PADAPTER padapter); diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8723b_cmd.h b/backports/drivers/realtek/rtl8812au/include/rtl8723b_cmd.h index 2221af668ea784..0abb84b0e1e99e 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8723b_cmd.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8723b_cmd.h @@ -56,6 +56,7 @@ enum h2c_cmd_8723B{ H2C_8723B_RSSI_SETTING = 0x42, H2C_8723B_AP_REQ_TXRPT = 0x43, H2C_8723B_INIT_RATE_COLLECT = 0x44, + H2C_8723B_RA_PARA_ADJUST = 0x46, //BT Class: 011 H2C_8723B_B_TYPE_TDMA = 0x60, @@ -80,6 +81,8 @@ enum h2c_cmd_8723B{ H2C_8723B_D0_SCAN_OFFLOAD_CTRL = 0x85, H2C_8723B_D0_SCAN_OFFLOAD_INFO = 0x86, H2C_8723B_CHNL_SWITCH_OFFLOAD = 0x87, + H2C_8723B_P2P_OFFLOAD_RSVD_PAGE = 0x8A, + H2C_8723B_P2P_OFFLOAD = 0x8B, H2C_8723B_RESET_TSF = 0xC0, H2C_8723B_MAXID, @@ -156,38 +159,38 @@ enum h2c_cmd_8723B{ //---------------------------------- H2C CMD CONTENT --------------------------------------------------// //---------------------------------------------------------------------------------------------------------// //_RSVDPAGE_LOC_CMD_0x00 -#define SET_8723B_H2CCMD_RSVDPAGE_LOC_PROBE_RSP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value) -#define SET_8723B_H2CCMD_RSVDPAGE_LOC_PSPOLL(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 8, __Value) -#define SET_8723B_H2CCMD_RSVDPAGE_LOC_NULL_DATA(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+2, 0, 8, __Value) -#define SET_8723B_H2CCMD_RSVDPAGE_LOC_QOS_NULL_DATA(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+3, 0, 8, __Value) -#define SET_8723B_H2CCMD_RSVDPAGE_LOC_BT_QOS_NULL_DATA(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+4, 0, 8, __Value) +#define SET_8723B_H2CCMD_RSVDPAGE_LOC_PROBE_RSP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd, 0, 8, __Value) +#define SET_8723B_H2CCMD_RSVDPAGE_LOC_PSPOLL(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+1, 0, 8, __Value) +#define SET_8723B_H2CCMD_RSVDPAGE_LOC_NULL_DATA(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+2, 0, 8, __Value) +#define SET_8723B_H2CCMD_RSVDPAGE_LOC_QOS_NULL_DATA(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+3, 0, 8, __Value) +#define SET_8723B_H2CCMD_RSVDPAGE_LOC_BT_QOS_NULL_DATA(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+4, 0, 8, __Value) //_MEDIA_STATUS_RPT_PARM_CMD_0x01 -#define SET_8723B_H2CCMD_MSRRPT_PARM_OPMODE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value) -#define SET_8723B_H2CCMD_MSRRPT_PARM_MACID_IND(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value) -#define SET_8723B_H2CCMD_MSRRPT_PARM_MACID(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+1, 0, 8, __Value) -#define SET_8723B_H2CCMD_MSRRPT_PARM_MACID_END(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+2, 0, 8, __Value) +#define SET_8723B_H2CCMD_MSRRPT_PARM_OPMODE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value) +#define SET_8723B_H2CCMD_MSRRPT_PARM_MACID_IND(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value) +#define SET_8723B_H2CCMD_MSRRPT_PARM_MACID(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd+1, 0, 8, __Value) +#define SET_8723B_H2CCMD_MSRRPT_PARM_MACID_END(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd+2, 0, 8, __Value) //_KEEP_ALIVE_CMD_0x03 -#define SET_8723B_H2CCMD_KEEPALIVE_PARM_ENABLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value) -#define SET_8723B_H2CCMD_KEEPALIVE_PARM_ADOPT(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value) -#define SET_8723B_H2CCMD_KEEPALIVE_PARM_PKT_TYPE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 2, 1, __Value) -#define SET_8723B_H2CCMD_KEEPALIVE_PARM_CHECK_PERIOD(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+1, 0, 8, __Value) +#define SET_8723B_H2CCMD_KEEPALIVE_PARM_ENABLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value) +#define SET_8723B_H2CCMD_KEEPALIVE_PARM_ADOPT(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value) +#define SET_8723B_H2CCMD_KEEPALIVE_PARM_PKT_TYPE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 2, 1, __Value) +#define SET_8723B_H2CCMD_KEEPALIVE_PARM_CHECK_PERIOD(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd+1, 0, 8, __Value) //_DISCONNECT_DECISION_CMD_0x04 -#define SET_8723B_H2CCMD_DISCONDECISION_PARM_ENABLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value) -#define SET_8723B_H2CCMD_DISCONDECISION_PARM_ADOPT(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value) -#define SET_8723B_H2CCMD_DISCONDECISION_PARM_CHECK_PERIOD(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+1, 0, 8, __Value) -#define SET_8723B_H2CCMD_DISCONDECISION_PARM_TRY_PKT_NUM(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+2, 0, 8, __Value) +#define SET_8723B_H2CCMD_DISCONDECISION_PARM_ENABLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value) +#define SET_8723B_H2CCMD_DISCONDECISION_PARM_ADOPT(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value) +#define SET_8723B_H2CCMD_DISCONDECISION_PARM_CHECK_PERIOD(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd+1, 0, 8, __Value) +#define SET_8723B_H2CCMD_DISCONDECISION_PARM_TRY_PKT_NUM(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd+2, 0, 8, __Value) // _PWR_MOD_CMD_0x20 -#define SET_8723B_H2CCMD_PWRMODE_PARM_MODE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value) -#define SET_8723B_H2CCMD_PWRMODE_PARM_RLBM(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 4, __Value) -#define SET_8723B_H2CCMD_PWRMODE_PARM_SMART_PS(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 4, 4, __Value) -#define SET_8723B_H2CCMD_PWRMODE_PARM_BCN_PASS_TIME(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+2, 0, 8, __Value) -#define SET_8723B_H2CCMD_PWRMODE_PARM_ALL_QUEUE_UAPSD(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+3, 0, 8, __Value) -#define SET_8723B_H2CCMD_PWRMODE_PARM_PWR_STATE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+4, 0, 8, __Value) -#define SET_8723B_H2CCMD_PWRMODE_PARM_BYTE5(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+5, 0, 8, __Value) +#define SET_8723B_H2CCMD_PWRMODE_PARM_MODE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd, 0, 8, __Value) +#define SET_8723B_H2CCMD_PWRMODE_PARM_RLBM(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 4, __Value) +#define SET_8723B_H2CCMD_PWRMODE_PARM_SMART_PS(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 4, 4, __Value) +#define SET_8723B_H2CCMD_PWRMODE_PARM_BCN_PASS_TIME(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+2, 0, 8, __Value) +#define SET_8723B_H2CCMD_PWRMODE_PARM_ALL_QUEUE_UAPSD(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+3, 0, 8, __Value) +#define SET_8723B_H2CCMD_PWRMODE_PARM_PWR_STATE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+4, 0, 8, __Value) +#define SET_8723B_H2CCMD_PWRMODE_PARM_BYTE5(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+5, 0, 8, __Value) #define GET_8723B_H2CCMD_PWRMODE_PARM_MODE(__pH2CCmd) LE_BITS_TO_1BYTE(__pH2CCmd, 0, 8) @@ -230,6 +233,7 @@ enum h2c_cmd_8723B{ #define SET_8723B_H2CCMD_BT_MPOPER_IDX(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+1, 0, 8, __Value) #define SET_8723B_H2CCMD_BT_MPOPER_PARAM1(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+2, 0, 8, __Value) #define SET_8723B_H2CCMD_BT_MPOPER_PARAM2(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+3, 0, 8, __Value) +#define SET_8723B_H2CCMD_BT_MPOPER_PARAM3(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+4, 0, 8, __Value) // _BT_FW_PATCH_0x6A #define SET_8723B_H2CCMD_BT_FW_PATCH_SIZE(__pH2CCmd, __Value) SET_BITS_TO_LE_2BYTE((pu1Byte)(__pH2CCmd), 0, 16, __Value) @@ -353,12 +357,16 @@ void rtl8723b_set_ap_wowlan_cmd(_adapter* padapter, u8 enable); void SetFwRelatedForWoWLAN8723b(_adapter* padapter, u8 bHostIsGoingtoSleep); #endif//CONFIG_WOWLAN +#ifdef CONFIG_P2P_WOWLAN +void rtl8723b_set_p2p_wowlan_offload_cmd(PADAPTER padapter); +#endif + void rtl8723b_set_FwPwrModeInIPS_cmd(PADAPTER padapter, u8 cmd_param); #ifdef CONFIG_TSF_RESET_OFFLOAD u8 rtl8723b_reset_tsf(_adapter *padapter, u8 reset_port); #endif // CONFIG_TSF_RESET_OFFLOAD s32 FillH2CCmd8723B(PADAPTER padapter, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer); - -#define FillH2CCmd FillH2CCmd8723B +u8 GetTxBufferRsvdPageNum8723B(_adapter *padapter, bool wowlan); #endif + diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8723b_hal.h b/backports/drivers/realtek/rtl8812au/include/rtl8723b_hal.h index 24dcf957413f80..d37b756b0c55d0 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8723b_hal.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8723b_hal.h @@ -40,17 +40,17 @@ //--------------------------------------------------------------------- // RTL8723B From file //--------------------------------------------------------------------- - #define RTL8723B_FW_IMG "rtl8723B/FW_NIC.bin" - #define RTL8723B_FW_WW_IMG "rtl8723B/FW_WoWLAN.bin" - #define RTL8723B_PHY_REG "rtl8723B/PHY_REG.txt" - #define RTL8723B_PHY_RADIO_A "rtl8723B/RadioA.txt" - #define RTL8723B_PHY_RADIO_B "rtl8723B/RadioB.txt" - #define RTL8723B_TXPWR_TRACK "rtl8723B/TxPowerTrack.txt" - #define RTL8723B_AGC_TAB "rtl8723B/AGC_TAB.txt" - #define RTL8723B_PHY_MACREG "rtl8723B/MAC_REG.txt" - #define RTL8723B_PHY_REG_PG "rtl8723B/PHY_REG_PG.txt" - #define RTL8723B_PHY_REG_MP "rtl8723B/PHY_REG_MP.txt" - #define RTL8723B_TXPWR_LMT "rtl8723B/TXPWR_LMT.txt" + #define RTL8723B_FW_IMG "rtl8723b/FW_NIC.bin" + #define RTL8723B_FW_WW_IMG "rtl8723b/FW_WoWLAN.bin" + #define RTL8723B_PHY_REG "rtl8723b/PHY_REG.txt" + #define RTL8723B_PHY_RADIO_A "rtl8723b/RadioA.txt" + #define RTL8723B_PHY_RADIO_B "rtl8723b/RadioB.txt" + #define RTL8723B_TXPWR_TRACK "rtl8723b/TxPowerTrack.txt" + #define RTL8723B_AGC_TAB "rtl8723b/AGC_TAB.txt" + #define RTL8723B_PHY_MACREG "rtl8723b/MAC_REG.txt" + #define RTL8723B_PHY_REG_PG "rtl8723b/PHY_REG_PG.txt" + #define RTL8723B_PHY_REG_MP "rtl8723b/PHY_REG_MP.txt" + #define RTL8723B_TXPWR_LMT "rtl8723b/TXPWR_LMT.txt" //--------------------------------------------------------------------- // RTL8723B From header @@ -82,14 +82,6 @@ typedef struct _RT_FIRMWARE { u8 szFwBuffer[FW_8723B_SIZE]; #endif u32 ulFwLength; - -#ifdef CONFIG_EMBEDDED_FWIMG - u8* szBTFwBuffer; - u8 myBTFwBuffer[FW_8723B_SIZE]; -#else - u8 szBTFwBuffer[FW_8723B_SIZE]; -#endif - u32 ulBTFwLength; } RT_FIRMWARE_8723B, *PRT_FIRMWARE_8723B; // @@ -132,8 +124,14 @@ typedef struct _RT_8723B_FIRMWARE_HDR #define PAGE_SIZE_TX_8723B 128 #define PAGE_SIZE_RX_8723B 8 -#define RX_DMA_SIZE_8723B 0x4000 // 16K +#define TX_DMA_SIZE_8723B 0x8000 /* 32K(TX) */ +#define RX_DMA_SIZE_8723B 0x4000 /* 16K(RX) */ + +#ifdef CONFIG_FW_C2H_DEBUG +#define RX_DMA_RESERVED_SIZE_8723B 0x100 // 256B, reserved for c2h debug message +#else #define RX_DMA_RESERVED_SIZE_8723B 0x80 // 128B, reserved for tx report +#endif #define RX_DMA_BOUNDARY_8723B (RX_DMA_SIZE_8723B - RX_DMA_RESERVED_SIZE_8723B - 1) @@ -163,7 +161,7 @@ typedef struct _RT_8723B_FIRMWARE_HDR #ifdef CONFIG_PNO_SUPPORT #undef WOWLAN_PAGE_NUM_8723B -#define WOWLAN_PAGE_NUM_8723B 0x0d +#define WOWLAN_PAGE_NUM_8723B 0x15 #endif #ifdef CONFIG_AP_WOWLAN @@ -230,6 +228,10 @@ typedef enum _C2H_EVT C2H_8723B_BT_INFO = 9, C2H_HW_INFO_EXCH = 10, C2H_8723B_BT_MP_INFO = 11, + C2H_8723B_P2P_RPORT = 0x16, +#ifdef CONFIG_FW_C2H_DEBUG + C2H_8723B_FW_DEBUG = 0xff, +#endif //CONFIG_FW_C2H_DEBUG MAX_C2HEVENT } C2H_EVT; @@ -242,10 +244,11 @@ typedef struct _C2H_EVT_HDR typedef enum tag_Package_Definition { - PACKAGE_DEFAULT = 0, - PACKAGE_QFN68 = BIT(0), - PACKAGE_TFBGA90 = BIT(1), - PACKAGE_TFBGA79 = BIT(2), + PACKAGE_DEFAULT, + PACKAGE_QFN68, + PACKAGE_TFBGA90, + PACKAGE_TFBGA80, + PACKAGE_TFBGA79 }PACKAGE_TYPE_E; #define INCLUDE_MULTI_FUNC_BT(_Adapter) (GET_HAL_DATA(_Adapter)->MultiFunc & RT_MULTI_FUNC_BT) @@ -279,15 +282,19 @@ void Hal_EfuseParseAntennaDiversity_8723B(PADAPTER padapter, u8 *hwinfo, BOOLEAN void Hal_EfuseParseXtal_8723B(PADAPTER pAdapter, u8 *hwinfo, u8 AutoLoadFail); void Hal_EfuseParseThermalMeter_8723B(PADAPTER padapter, u8 *hwinfo, u8 AutoLoadFail); VOID Hal_EfuseParsePackageType_8723B(PADAPTER pAdapter,u8* hwinfo,BOOLEAN AutoLoadFail); +VOID Hal_EfuseParseVoltage_8723B(PADAPTER pAdapter,u8* hwinfo,BOOLEAN AutoLoadFail); #ifdef CONFIG_C2H_PACKET_EN -void C2HPacketHandler_8723B(PADAPTER padapter, u8 *pbuffer, u16 length); +void rtl8723b_c2h_packet_handler(PADAPTER padapter, u8 *pbuf, u16 length); #endif void rtl8723b_set_hal_ops(struct hal_ops *pHalFunc); void SetHwReg8723B(PADAPTER padapter, u8 variable, u8 *val); void GetHwReg8723B(PADAPTER padapter, u8 variable, u8 *val); +#ifdef CONFIG_C2H_PACKET_EN +void SetHwRegWithBuf8723B(PADAPTER padapter, u8 variable, u8 *pbuf, int len); +#endif // CONFIG_C2H_PACKET_EN u8 SetHalDefVar8723B(PADAPTER padapter, HAL_DEF_VARIABLE variable, void *pval); u8 GetHalDefVar8723B(PADAPTER padapter, HAL_DEF_VARIABLE variable, void *pval); @@ -295,8 +302,8 @@ u8 GetHalDefVar8723B(PADAPTER padapter, HAL_DEF_VARIABLE variable, void *pval); void rtl8723b_InitBeaconParameters(PADAPTER padapter); void rtl8723b_InitBeaconMaxError(PADAPTER padapter, u8 InfraMode); void _InitBurstPktLen_8723BS(PADAPTER Adapter); -#ifdef CONFIG_WOWLAN void _8051Reset8723(PADAPTER padapter); +#ifdef CONFIG_WOWLAN void Hal_DetectWoWMode(PADAPTER pAdapter); #endif //CONFIG_WOWLAN @@ -326,5 +333,10 @@ u8 HwRateToMRate8723B(u8 rate); void Hal_ReadRFGainOffset(PADAPTER pAdapter,u8* hwinfo,BOOLEAN AutoLoadFail); #endif //CONFIG_RF_GAIN_OFFSET +#ifdef CONFIG_PCI_HCI +BOOLEAN InterruptRecognized8723BE(PADAPTER Adapter); +VOID UpdateInterruptMask8723BE(PADAPTER Adapter, u32 AddMSR, u32 AddMSR1, u32 RemoveMSR, u32 RemoveMSR1); +#endif + #endif diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8723b_led.h b/backports/drivers/realtek/rtl8812au/include/rtl8723b_led.h index f5458f27fced5e..36772c05157190 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8723b_led.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8723b_led.h @@ -40,6 +40,10 @@ void rtl8723bs_DeInitSwLeds(PADAPTER padapter); void rtl8723bs_InitSwLeds(PADAPTER padapter); void rtl8723bs_DeInitSwLeds(PADAPTER padapter); #endif +#ifdef CONFIG_PCI_HCI +void rtl8723be_InitSwLeds(PADAPTER padapter); +void rtl8723be_DeInitSwLeds(PADAPTER padapter); +#endif #endif diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8723b_recv.h b/backports/drivers/realtek/rtl8812au/include/rtl8723b_recv.h index 81c181fe540e29..0162d06328e953 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8723b_recv.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8723b_recv.h @@ -29,137 +29,23 @@ #endif // !CONFIG_SDIO_RX_COPY #endif // CONFIG_SDIO_HCI -typedef struct rxreport_8723b -{ - //DWORD 0 - u32 pktlen:14; - u32 crc32:1; - u32 icverr:1; - u32 drvinfosize:4; - u32 security:3; - u32 qos:1; - u32 shift:2; - u32 physt:1; - u32 swdec:1; - u32 rsvd0028:2; - u32 eor:1; - u32 rsvd0031:1; - - //DWORD 1 - u32 macid:7; - u32 rsvd0407:1; - u32 tid:4; - u32 macid_vld:1; - u32 amsdu:1; - u32 rxid_match:1; - u32 paggr:1; - u32 a1fit:4; - u32 chkerr:1; //20 - u32 rx_ipv:1; - u32 rx_is_tcp_udp:1; - u32 chk_vld:1; //23 - u32 pam:1; - u32 pwr:1; - u32 md:1; - u32 mf:1; - u32 type:2; - u32 mc:1; - u32 bc:1; - - //DWORD 2 - u32 seq:12; - u32 frag:4; - u32 rx_is_qos:1; - u32 rsvd0817:1; - u32 wlanhd_iv_len:6; - u32 hwrsvd0824:4; - u32 c2h_ind:1; - u32 rsvd0829:2; - u32 fcs_ok:1; - - //DWORD 3 - u32 rx_rate:7; - u32 rsvd1207:3; - u32 htc:1; - u32 esop:1; - u32 bssid_fit:2; - u32 rsvd1214:2; - u32 dma_agg_num:8; - u32 rsvd1224:5; - u32 patternmatch:1; - u32 unicastwake:1; - u32 magicwake:1; - - //DWORD 4 - u32 splcp:1; //Ofdm sgi or cck_splcp - u32 ldpc:1; - u32 stbc:1; - u32 not_sounding:1; - u32 bw:2; - u32 rsvd1606:26; - - //DWORD 5 - u32 tsfl; -} RXREPORT, *PRXREPORT; - -typedef struct phystatus_8723b -{ - u32 rxgain_a:7; - u32 trsw_a:1; - u32 rxgain_b:7; - u32 trsw_b:1; - u32 chcorr_l:16; - - u32 sigqualcck:8; - u32 cfo_a:8; - u32 cfo_b:8; - u32 chcorr_h:8; - - u32 noisepwrdb_h:8; - u32 cfo_tail_a:8; - u32 cfo_tail_b:8; - u32 rsvd0824:8; - - u32 rsvd1200:8; - u32 rxevm_a:8; - u32 rxevm_b:8; - u32 rxsnr_a:8; - - u32 rxsnr_b:8; - u32 noisepwrdb_l:8; - u32 rsvd1616:8; - u32 postsnr_a:8; - - u32 postsnr_b:8; - u32 csi_a:8; - u32 csi_b:8; - u32 targetcsi_a:8; - - u32 targetcsi_b:8; - u32 sigevm:8; - u32 maxexpwr:8; - u32 exintflag:1; - u32 sgien:1; - u32 rxsc:2; - u32 idlelong:1; - u32 anttrainen:1; - u32 antselb:1; - u32 antsel:1; -} PHYSTATUS, *PPHYSTATUS; - #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) s32 rtl8723bs_init_recv_priv(PADAPTER padapter); void rtl8723bs_free_recv_priv(PADAPTER padapter); #endif -void rtl8723b_query_rx_phy_status(union recv_frame *prframe, struct phy_stat *pphy_stat); -void rtl8723b_process_phy_info(PADAPTER padapter, void *prframe); #ifdef CONFIG_USB_HCI -void update_recvframe_attrib(PADAPTER padapter, union recv_frame *precvframe, struct recv_stat *prxstat); -void update_recvframe_phyinfo(union recv_frame *precvframe, struct phy_stat *pphy_info); -int rtl8723bu_init_recv_priv(_adapter *padapter); +int rtl8723bu_init_recv_priv(_adapter *padapter); void rtl8723bu_free_recv_priv (_adapter *padapter); void rtl8723bu_init_recvbuf(_adapter *padapter, struct recv_buf *precvbuf); #endif + +#ifdef CONFIG_PCI_HCI +s32 rtl8723be_init_recv_priv(PADAPTER padapter); +void rtl8723be_free_recv_priv(PADAPTER padapter); #endif +void rtl8723b_query_rx_desc_status(union recv_frame *precvframe, u8 *pdesc); + +#endif /* __RTL8723B_RECV_H__ */ + diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8723b_spec.h b/backports/drivers/realtek/rtl8812au/include/rtl8723b_spec.h index 7fea179020a22d..aa4bc2cf35527f 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8723b_spec.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8723b_spec.h @@ -29,13 +29,20 @@ // 0x0000h ~ 0x00FFh System Configuration // //----------------------------------------------------- +#define REG_RSV_CTRL_8723B 0x001C // 3 Byte #define REG_BT_WIFI_ANTENNA_SWITCH_8723B 0x0038 +#define REG_HSISR_8723B 0x005c #define REG_PAD_CTRL1_8723B 0x0064 #define REG_AFE_CTRL_4_8723B 0x0078 #define REG_HMEBOX_DBG_0_8723B 0x0088 #define REG_HMEBOX_DBG_1_8723B 0x008A #define REG_HMEBOX_DBG_2_8723B 0x008C #define REG_HMEBOX_DBG_3_8723B 0x008E +#define REG_HIMR0_8723B 0x00B0 +#define REG_HISR0_8723B 0x00B4 +#define REG_HIMR1_8723B 0x00B8 +#define REG_HISR1_8723B 0x00BC +#define REG_PMC_DBG_CTRL2_8723B 0x00CC //----------------------------------------------------- // @@ -64,6 +71,7 @@ // 0x0280h ~ 0x02FFh RXDMA Configuration // //----------------------------------------------------- +#define REG_RXDMA_CONTROL_8723B 0x0286 // Control the RX DMA. #define REG_RXDMA_MODE_CTRL_8723B 0x0290 //----------------------------------------------------- @@ -71,6 +79,27 @@ // 0x0300h ~ 0x03FFh PCIe // //----------------------------------------------------- +#define REG_PCIE_CTRL_REG_8723B 0x0300 +#define REG_INT_MIG_8723B 0x0304 // Interrupt Migration +#define REG_BCNQ_DESA_8723B 0x0308 // TX Beacon Descriptor Address +#define REG_HQ_DESA_8723B 0x0310 // TX High Queue Descriptor Address +#define REG_MGQ_DESA_8723B 0x0318 // TX Manage Queue Descriptor Address +#define REG_VOQ_DESA_8723B 0x0320 // TX VO Queue Descriptor Address +#define REG_VIQ_DESA_8723B 0x0328 // TX VI Queue Descriptor Address +#define REG_BEQ_DESA_8723B 0x0330 // TX BE Queue Descriptor Address +#define REG_BKQ_DESA_8723B 0x0338 // TX BK Queue Descriptor Address +#define REG_RX_DESA_8723B 0x0340 // RX Queue Descriptor Address +#define REG_DBI_WDATA_8723B 0x0348 // DBI Write Data +#define REG_DBI_RDATA_8723B 0x034C // DBI Read Data +#define REG_DBI_ADDR_8723B 0x0350 // DBI Address +#define REG_DBI_FLAG_8723B 0x0352 // DBI Read/Write Flag +#define REG_MDIO_WDATA_8723B 0x0354 // MDIO for Write PCIE PHY +#define REG_MDIO_RDATA_8723B 0x0356 // MDIO for Reads PCIE PHY +#define REG_MDIO_CTL_8723B 0x0358 // MDIO for Control +#define REG_DBG_SEL_8723B 0x0360 // Debug Selection Register +#define REG_PCIE_HRPWM_8723B 0x0361 //PCIe RPWM +#define REG_PCIE_HCPWM_8723B 0x0363 //PCIe CPWM +#define REG_PCIE_MULTIFET_CTRL_8723B 0x036A //PCIE Multi-Fethc Control //----------------------------------------------------- // @@ -84,6 +113,7 @@ #define REG_TXPKTBUF_IV_LOW 0x0484 #define REG_TXPKTBUF_IV_HIGH 0x0488 #endif +#define REG_AMPDU_BURST_MODE_8723B 0x04BC //----------------------------------------------------- // @@ -187,16 +217,73 @@ #define EEPROM_RF_GAIN_VAL 0x1F6 #endif //CONFIG_RF_GAIN_OFFSET + +//---------------------------------------------------------------------------- +// 8195 IMR/ISR bits (offset 0xB0, 8bits) +//---------------------------------------------------------------------------- +#define IMR_DISABLED_8723B 0 +// IMR DW0(0x00B0-00B3) Bit 0-31 +#define IMR_TIMER2_8723B BIT31 // Timeout interrupt 2 +#define IMR_TIMER1_8723B BIT30 // Timeout interrupt 1 +#define IMR_PSTIMEOUT_8723B BIT29 // Power Save Time Out Interrupt +#define IMR_GTINT4_8723B BIT28 // When GTIMER4 expires, this bit is set to 1 +#define IMR_GTINT3_8723B BIT27 // When GTIMER3 expires, this bit is set to 1 +#define IMR_TXBCN0ERR_8723B BIT26 // Transmit Beacon0 Error +#define IMR_TXBCN0OK_8723B BIT25 // Transmit Beacon0 OK +#define IMR_TSF_BIT32_TOGGLE_8723B BIT24 // TSF Timer BIT32 toggle indication interrupt +#define IMR_BCNDMAINT0_8723B BIT20 // Beacon DMA Interrupt 0 +#define IMR_BCNDERR0_8723B BIT16 // Beacon Queue DMA OK0 +#define IMR_HSISR_IND_ON_INT_8723B BIT15 // HSISR Indicator (HSIMR & HSISR is true, this bit is set to 1) +#define IMR_BCNDMAINT_E_8723B BIT14 // Beacon DMA Interrupt Extension for Win7 +#define IMR_ATIMEND_8723B BIT12 // CTWidnow End or ATIM Window End +#define IMR_C2HCMD_8723B BIT10 // CPU to Host Command INT Status, Write 1 clear +#define IMR_CPWM2_8723B BIT9 // CPU power Mode exchange INT Status, Write 1 clear +#define IMR_CPWM_8723B BIT8 // CPU power Mode exchange INT Status, Write 1 clear +#define IMR_HIGHDOK_8723B BIT7 // High Queue DMA OK +#define IMR_MGNTDOK_8723B BIT6 // Management Queue DMA OK +#define IMR_BKDOK_8723B BIT5 // AC_BK DMA OK +#define IMR_BEDOK_8723B BIT4 // AC_BE DMA OK +#define IMR_VIDOK_8723B BIT3 // AC_VI DMA OK +#define IMR_VODOK_8723B BIT2 // AC_VO DMA OK +#define IMR_RDU_8723B BIT1 // Rx Descriptor Unavailable +#define IMR_ROK_8723B BIT0 // Receive DMA OK + +// IMR DW1(0x00B4-00B7) Bit 0-31 +#define IMR_BCNDMAINT7_8723B BIT27 // Beacon DMA Interrupt 7 +#define IMR_BCNDMAINT6_8723B BIT26 // Beacon DMA Interrupt 6 +#define IMR_BCNDMAINT5_8723B BIT25 // Beacon DMA Interrupt 5 +#define IMR_BCNDMAINT4_8723B BIT24 // Beacon DMA Interrupt 4 +#define IMR_BCNDMAINT3_8723B BIT23 // Beacon DMA Interrupt 3 +#define IMR_BCNDMAINT2_8723B BIT22 // Beacon DMA Interrupt 2 +#define IMR_BCNDMAINT1_8723B BIT21 // Beacon DMA Interrupt 1 +#define IMR_BCNDOK7_8723B BIT20 // Beacon Queue DMA OK Interrup 7 +#define IMR_BCNDOK6_8723B BIT19 // Beacon Queue DMA OK Interrup 6 +#define IMR_BCNDOK5_8723B BIT18 // Beacon Queue DMA OK Interrup 5 +#define IMR_BCNDOK4_8723B BIT17 // Beacon Queue DMA OK Interrup 4 +#define IMR_BCNDOK3_8723B BIT16 // Beacon Queue DMA OK Interrup 3 +#define IMR_BCNDOK2_8723B BIT15 // Beacon Queue DMA OK Interrup 2 +#define IMR_BCNDOK1_8723B BIT14 // Beacon Queue DMA OK Interrup 1 +#define IMR_ATIMEND_E_8723B BIT13 // ATIM Window End Extension for Win7 +#define IMR_TXERR_8723B BIT11 // Tx Error Flag Interrupt Status, write 1 clear. +#define IMR_RXERR_8723B BIT10 // Rx Error Flag INT Status, Write 1 clear +#define IMR_TXFOVW_8723B BIT9 // Transmit FIFO Overflow +#define IMR_RXFOVW_8723B BIT8 // Receive FIFO Overflow + +#ifdef CONFIG_PCI_HCI +//#define IMR_RX_MASK (IMR_ROK_8723B|IMR_RDU_8723B|IMR_RXFOVW_8723B) +#define IMR_TX_MASK (IMR_VODOK_8723B|IMR_VIDOK_8723B|IMR_BEDOK_8723B|IMR_BKDOK_8723B|IMR_MGNTDOK_8723B|IMR_HIGHDOK_8723B) + +#define RT_BCN_INT_MASKS (IMR_BCNDMAINT0_8723B | IMR_TXBCN0OK_8723B | IMR_TXBCN0ERR_8723B | IMR_BCNDERR0_8723B) + +#define RT_AC_INT_MASKS (IMR_VIDOK_8723B | IMR_VODOK_8723B | IMR_BEDOK_8723B|IMR_BKDOK_8723B) #endif -#ifdef CONFIG_USB_HCI -//should be renamed and moved to another file -typedef enum _BOARD_TYPE_8192CUSB{ - BOARD_USB_DONGLE = 0, // USB dongle - BOARD_USB_High_PA = 1, // USB dongle with high power PA - BOARD_MINICARD = 2, // Minicard - BOARD_USB_SOLO = 3, // USB solo-Slim module - BOARD_USB_COMBO = 4, // USB Combo-Slim module -} BOARD_TYPE_8723BUSB, *PBOARD_TYPE_8723BUSB; - -#endif \ No newline at end of file +//======================================================== +// General definitions +//======================================================== + +#define MACID_NUM_8723B 128 +#define CAM_ENTRY_NUM_8723B 64 + +#endif /* __RTL8723B_SPEC_H__ */ + diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8723b_xmit.h b/backports/drivers/realtek/rtl8812au/include/rtl8723b_xmit.h index 47b105d241cb61..b998233610e2d3 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8723b_xmit.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8723b_xmit.h @@ -20,176 +20,9 @@ #ifndef __RTL8723B_XMIT_H__ #define __RTL8723B_XMIT_H__ -// -// Queue Select Value in TxDesc -// -#define QSLT_BK 0x2//0x01 -#define QSLT_BE 0x0 -#define QSLT_VI 0x5//0x4 -#define QSLT_VO 0x7//0x6 -#define QSLT_BEACON 0x10 -#define QSLT_HIGH 0x11 -#define QSLT_MGNT 0x12 -#define QSLT_CMD 0x13 #define MAX_TID (15) -//OFFSET 0 -#define OFFSET_SZ 0 -#define OFFSET_SHT 16 -#define BMC BIT(24) -#define LSG BIT(26) -#define FSG BIT(27) -#define OWN BIT(31) - - -//OFFSET 4 -#define PKT_OFFSET_SZ 0 -#define BK BIT(6) -#define QSEL_SHT 8 -#define Rate_ID_SHT 16 -#define NAVUSEHDR BIT(20) -#define PKT_OFFSET_SHT 26 -#define HWPC BIT(31) - -//OFFSET 8 -#define AGG_EN BIT(29) - -//OFFSET 12 -#define SEQ_SHT 16 - -//OFFSET 16 -#define QoS BIT(6) -#define HW_SEQ_EN BIT(7) -#define USERATE BIT(8) -#define DISDATAFB BIT(10) -#define DATA_SHORT BIT(24) -#define DATA_BW BIT(25) - -//OFFSET 20 -#define SGI BIT(6) - -// -//defined for TX DESC Operation -// -typedef struct txdesc_8723b -{ - // Offset 0 - u32 pktlen:16; - u32 offset:8; - u32 bmc:1; - u32 htc:1; - u32 rsvd0026:1; - u32 rsvd0027:1; - u32 linip:1; - u32 noacm:1; - u32 gf:1; - u32 rsvd0031:1; - - // Offset 4 - u32 macid:7; - u32 rsvd0407:1; - u32 qsel:5; - u32 rdg_nav_ext:1; - u32 lsig_txop_en:1; - u32 pifs:1; - u32 rate_id:5; - u32 en_desc_id:1; - u32 sectype:2; - u32 pkt_offset:5; // unit: 8 bytes - u32 moredata:1; - u32 txop_ps_cap:1; - u32 txop_ps_mode:1; - - // Offset 8 - u32 p_aid:9; - u32 rsvd0809:1; - u32 cca_rts:2; - u32 agg_en:1; - u32 rdg_en:1; - u32 null_0:1; - u32 null_1:1; - u32 bk:1; - u32 morefrag:1; - u32 raw:1; - u32 spe_rpt:1; - u32 ampdu_density:3; - u32 bt_null:1; - u32 g_id:6; - u32 rsvd0830:2; - - // Offset 12 - u32 wheader_len:4; - u32 chk_en:1; - u32 early_rate:1; - u32 hw_ssn_sel:2; - u32 userate:1; - u32 disrtsfb:1; - u32 disdatafb:1; - u32 cts2self:1; - u32 rtsen:1; - u32 hw_rts_en:1; - u32 port_id:1; - u32 navusehdr:1; - u32 use_max_len:1; - u32 max_agg_num:5; - u32 ndpa:2; - u32 ampdu_max_time:8; - - // Offset 16 - u32 datarate:7; - u32 try_rate:1; - u32 data_ratefb_lmt:5; - u32 rts_ratefb_lmt:4; - u32 rty_lmt_en:1; - u32 data_rt_lmt:6; - u32 rtsrate:5; - u32 pcts_en:1; - u32 pcts_mask_idx:2; - - // Offset 20 - u32 data_sc:4; - u32 data_short:1; - u32 data_bw:2; - u32 data_ldpc:1; - u32 data_stbc:2; - u32 vcs_stbc:2; - u32 rts_short:1; - u32 rts_sc:4; - u32 rsvd2016:7; - u32 tx_ant:4; - u32 txpwr_offset:3; - u32 rsvd2031:1; - - // Offset 24 - u32 sw_define:12; - u32 mbssid:4; - u32 antsel_A:3; - u32 antsel_B:3; - u32 antsel_C:3; - u32 antsel_D:3; - u32 rsvd2428:4; - - // Offset 28 - u32 checksum:16; - u32 rsvd2816:8; - u32 usb_txagg_num:8; - - // Offset 32 - u32 rts_rc:6; - u32 bar_rty_th:2; - u32 data_rc:6; - u32 rsvd3214:1; - u32 en_hwseq:1; - u32 nextneadpage:8; - u32 tailpage:8; - - // Offset 36 - u32 padding_len:11; - u32 txbf_path:1; - u32 seq:12; - u32 final_data_rate:8; -}TXDESC_8723B, *PTXDESC_8723B; #ifndef __INC_HAL8723BDESC_H #define __INC_HAL8723BDESC_H @@ -349,6 +182,7 @@ typedef struct txdesc_8723b // Dword 6 #define SET_TX_DESC_SW_DEFINE_8723B(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+24, 0, 12, __Value) +#define SET_TX_DESC_MBSSID_8723B(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+24, 12, 4, __Value) #define SET_TX_DESC_ANTSEL_A_8723B(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+24, 16, 3, __Value) #define SET_TX_DESC_ANTSEL_B_8723B(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+24, 19, 3, __Value) #define SET_TX_DESC_ANTSEL_C_8723B(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+24, 22, 3, __Value) @@ -373,7 +207,7 @@ typedef struct txdesc_8723b // Dword 10 #define SET_TX_DESC_TX_BUFFER_ADDRESS_8723B(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+40, 0, 32, __Value) - +#define GET_TX_DESC_TX_BUFFER_ADDRESS_8723B(__pTxDesc) LE_BITS_TO_4BYTE(__pTxDesc+40, 0, 32) // Dword 11 #define SET_TX_DESC_NEXT_DESC_ADDRESS_8723B(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+48, 0, 32, __Value) @@ -483,5 +317,20 @@ void rtl8723bu_xmit_tasklet(void *priv); s32 rtl8723bu_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf); void _dbg_dump_tx_info(_adapter *padapter,int frame_tag,struct tx_desc *ptxdesc); #endif + +#ifdef CONFIG_PCI_HCI +s32 rtl8723be_init_xmit_priv(PADAPTER padapter); +void rtl8723be_free_xmit_priv(PADAPTER padapter); +struct xmit_buf *rtl8723be_dequeue_xmitbuf(struct rtw_tx_ring *ring); +void rtl8723be_xmitframe_resume(_adapter *padapter); +s32 rtl8723be_hal_xmit(PADAPTER padapter, struct xmit_frame *pxmitframe); +s32 rtl8723be_mgnt_xmit(PADAPTER padapter, struct xmit_frame *pmgntframe); +s32 rtl8723be_hal_xmitframe_enqueue(_adapter *padapter, struct xmit_frame *pxmitframe); +void rtl8723be_xmit_tasklet(void *priv); +#endif + +u8 BWMapping_8723B(PADAPTER Adapter, struct pkt_attrib *pattrib); +u8 SCMapping_8723B(PADAPTER Adapter, struct pkt_attrib *pattrib); + #endif diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8812a_cmd.h b/backports/drivers/realtek/rtl8812au/include/rtl8812a_cmd.h index 8cf7322409fcac..cf050e03d43c2c 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8812a_cmd.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8812a_cmd.h @@ -41,6 +41,8 @@ typedef enum _RTL8812_H2C_CMD H2C_8812_RA_MASK = 0x40, H2C_8812_TxBF = 0x41, H2C_8812_RSSI_REPORT = 0x42, + H2C_8812_IQ_CALIBRATION = 0x45, + H2C_8812_RA_PARA_ADJUST = 0x46, H2C_8812_BT_FW_PATCH = 0x6a, @@ -69,6 +71,9 @@ typedef enum _RTL8812_C2H_EVT C2H_8812_FW_SWCHNL = 0x10, C2H_8812_IQK_FINISH = 0x11, C2H_8812_MAILBOX_STATUS = 0x15, +#ifdef CONFIG_FW_C2H_DEBUG + C2H_8812_FW_DEBUG = 0xff, +#endif //CONFIG_FW_C2H_DEBUG MAX_8812_C2HEVENT }RTL8812_C2H_EVT; @@ -91,37 +96,37 @@ struct H2C_SS_RFOFF_PARAM{ //_RSVDPAGE_LOC_CMD0 -#define SET_8812_H2CCMD_RSVDPAGE_LOC_PROBE_RSP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value) -#define SET_8812_H2CCMD_RSVDPAGE_LOC_PSPOLL(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 8, __Value) -#define SET_8812_H2CCMD_RSVDPAGE_LOC_NULL_DATA(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+2, 0, 8, __Value) -#define SET_8812_H2CCMD_RSVDPAGE_LOC_QOS_NULL_DATA(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+3, 0, 8, __Value) -#define SET_8812_H2CCMD_RSVDPAGE_LOC_BT_QOS_NULL_DATA(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+4, 0, 8, __Value) +#define SET_8812_H2CCMD_RSVDPAGE_LOC_PROBE_RSP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd, 0, 8, __Value) +#define SET_8812_H2CCMD_RSVDPAGE_LOC_PSPOLL(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+1, 0, 8, __Value) +#define SET_8812_H2CCMD_RSVDPAGE_LOC_NULL_DATA(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+2, 0, 8, __Value) +#define SET_8812_H2CCMD_RSVDPAGE_LOC_QOS_NULL_DATA(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+3, 0, 8, __Value) +#define SET_8812_H2CCMD_RSVDPAGE_LOC_BT_QOS_NULL_DATA(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+4, 0, 8, __Value) //_MEDIA_STATUS_RPT_PARM_CMD1 -#define SET_8812_H2CCMD_MSRRPT_PARM_OPMODE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value) -#define SET_8812_H2CCMD_MSRRPT_PARM_MACID_IND(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value) -#define SET_8812_H2CCMD_MSRRPT_PARM_MACID(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+1, 0, 8, __Value) -#define SET_8812_H2CCMD_MSRRPT_PARM_MACID_END(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd+2, 0, 8, __Value) +#define SET_8812_H2CCMD_MSRRPT_PARM_OPMODE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value) +#define SET_8812_H2CCMD_MSRRPT_PARM_MACID_IND(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value) +#define SET_8812_H2CCMD_MSRRPT_PARM_MACID(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd+1, 0, 8, __Value) +#define SET_8812_H2CCMD_MSRRPT_PARM_MACID_END(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd+2, 0, 8, __Value) //_SETPWRMODE_PARM -#define SET_8812_H2CCMD_PWRMODE_PARM_MODE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value) -#define SET_8812_H2CCMD_PWRMODE_PARM_RLBM(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 4, __Value) -#define SET_8812_H2CCMD_PWRMODE_PARM_SMART_PS(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 4, 4, __Value) -#define SET_8812_H2CCMD_PWRMODE_PARM_BCN_PASS_TIME(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+2, 0, 8, __Value) -#define SET_8812_H2CCMD_PWRMODE_PARM_ALL_QUEUE_UAPSD(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+3, 0, 8, __Value) -#define SET_8812_H2CCMD_PWRMODE_PARM_PWR_STATE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+4, 0, 8, __Value) -#define SET_8812_H2CCMD_PWRMODE_PARM_BYTE5(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+5, 0, 8, __Value) +#define SET_8812_H2CCMD_PWRMODE_PARM_MODE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd, 0, 8, __Value) +#define SET_8812_H2CCMD_PWRMODE_PARM_RLBM(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 4, __Value) +#define SET_8812_H2CCMD_PWRMODE_PARM_SMART_PS(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 4, 4, __Value) +#define SET_8812_H2CCMD_PWRMODE_PARM_BCN_PASS_TIME(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+2, 0, 8, __Value) +#define SET_8812_H2CCMD_PWRMODE_PARM_ALL_QUEUE_UAPSD(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+3, 0, 8, __Value) +#define SET_8812_H2CCMD_PWRMODE_PARM_PWR_STATE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+4, 0, 8, __Value) +#define SET_8812_H2CCMD_PWRMODE_PARM_BYTE5(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+5, 0, 8, __Value) -#define GET_8812_H2CCMD_PWRMODE_PARM_MODE(__pH2CCmd) LE_BITS_TO_1BYTE(__pH2CCmd, 0, 8) +#define GET_8812_H2CCMD_PWRMODE_PARM_MODE(__pH2CCmd) LE_BITS_TO_1BYTE(__pH2CCmd, 0, 8) //_P2P_PS_OFFLOAD -#define SET_8812_H2CCMD_P2P_PS_OFFLOAD_ENABLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value) -#define SET_8812_H2CCMD_P2P_PS_OFFLOAD_ROLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value) +#define SET_8812_H2CCMD_P2P_PS_OFFLOAD_ENABLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value) +#define SET_8812_H2CCMD_P2P_PS_OFFLOAD_ROLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value) #define SET_8812_H2CCMD_P2P_PS_OFFLOAD_CTWINDOW_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 2, 1, __Value) -#define SET_8812_H2CCMD_P2P_PS_OFFLOAD_NOA0_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 3, 1, __Value) -#define SET_8812_H2CCMD_P2P_PS_OFFLOAD_NOA1_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 4, 1, __Value) -#define SET_8812_H2CCMD_P2P_PS_OFFLOAD_ALLSTASLEEP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 5, 1, __Value) -#define SET_8812_H2CCMD_P2P_PS_OFFLOAD_DISCOVERY(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 6, 1, __Value) +#define SET_8812_H2CCMD_P2P_PS_OFFLOAD_NOA0_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 3, 1, __Value) +#define SET_8812_H2CCMD_P2P_PS_OFFLOAD_NOA1_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 4, 1, __Value) +#define SET_8812_H2CCMD_P2P_PS_OFFLOAD_ALLSTASLEEP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 5, 1, __Value) +#define SET_8812_H2CCMD_P2P_PS_OFFLOAD_DISCOVERY(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 6, 1, __Value) void Set_RA_LDPC_8812(struct sta_info *psta, BOOLEAN bLDPC); @@ -133,8 +138,13 @@ void rtl8812_set_FwJoinBssReport_cmd(PADAPTER padapter, u8 mstatus); u8 rtl8812_set_rssi_cmd(PADAPTER padapter, u8 *param); void rtl8812_set_raid_cmd(PADAPTER padapter, u32 bitmap, u8* arg); void rtl8812_Add_RateATid(PADAPTER padapter, u32 bitmap, u8* arg, u8 rssi_level); +void rtl8812_set_wowlan_cmd(_adapter* padapter, u8 enable); +s32 FillH2CCmd_8812(PADAPTER padapter, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer); +u8 GetTxBufferRsvdPageNum8812(_adapter *padapter, bool wowlan); - +#ifdef CONFIG_BT_COEXIST +void rtl8812a_download_BTCoex_AP_mode_rsvd_page(PADAPTER padapter); +#endif // CONFIG_BT_COEXIST #ifdef CONFIG_P2P_PS void rtl8812_set_p2p_ps_offload_cmd(PADAPTER padapter, u8 p2p_ps_state); #endif //CONFIG_P2P diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8812a_hal.h b/backports/drivers/realtek/rtl8812au/include/rtl8812a_hal.h index 0ad050da648885..457ae82a855fbd 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8812a_hal.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8812a_hal.h @@ -21,11 +21,7 @@ #define __RTL8812A_HAL_H__ //#include "hal_com.h" -#if 1 #include "hal_data.h" -#else -#include "../hal/OUTSRC/odm_precomp.h" -#endif //include HAL Related header after HAL Related compiling flags #include "rtl8812a_spec.h" @@ -47,32 +43,33 @@ //--------------------------------------------------------------------- // RTL8812AU From header //--------------------------------------------------------------------- - #define RTL8812_FW_IMG "rtl8812A/FW_NIC.bin" - #define RTL8812_FW_WW_IMG "rtl8812A/FW_WoWLAN.bin" - #define RTL8812_PHY_REG "rtl8812A/PHY_REG.txt" - #define RTL8812_PHY_RADIO_A "rtl8812A/RadioA.txt" - #define RTL8812_PHY_RADIO_B "rtl8812A/RadioB.txt" - #define RTL8812_TXPWR_TRACK "rtl8812A/TxPowerTrack.txt" - #define RTL8812_AGC_TAB "rtl8812A/AGC_TAB.txt" - #define RTL8812_PHY_MACREG "rtl8812A/MAC_REG.txt" - #define RTL8812_PHY_REG_PG "rtl8812A/PHY_REG_PG.txt" - #define RTL8812_PHY_REG_MP "rtl8812A/PHY_REG_MP.txt" - #define RTL8812_TXPWR_LMT "rtl8812A/TXPWR_LMT.txt" + #define RTL8812_FW_IMG "rtl8812a/FW_NIC.bin" + #define RTL8812_FW_WW_IMG "rtl8812a/FW_WoWLAN.bin" + #define RTL8812_PHY_REG "rtl8812a/PHY_REG.txt" + #define RTL8812_PHY_RADIO_A "rtl8812a/RadioA.txt" + #define RTL8812_PHY_RADIO_B "rtl8812a/RadioB.txt" + #define RTL8812_TXPWR_TRACK "rtl8812a/TxPowerTrack.txt" + #define RTL8812_AGC_TAB "rtl8812a/AGC_TAB.txt" + #define RTL8812_PHY_MACREG "rtl8812a/MAC_REG.txt" + #define RTL8812_PHY_REG_PG "rtl8812a/PHY_REG_PG.txt" + #define RTL8812_PHY_REG_MP "rtl8812a/PHY_REG_MP.txt" + #define RTL8812_TXPWR_LMT "rtl8812a/TXPWR_LMT.txt" + #define RTL8812_WIFI_ANT_ISOLATION "rtl8812a/wifi_ant_isolation.txt" //--------------------------------------------------------------------- // RTL8821U From file //--------------------------------------------------------------------- - #define RTL8821_FW_IMG "rtl8821A/FW_NIC.bin" - #define RTL8821_FW_WW_IMG "rtl8821A/FW_WoWLAN.bin" - #define RTL8821_PHY_REG "rtl8821A/PHY_REG.txt" - #define RTL8821_PHY_RADIO_A "rtl8821A/RadioA.txt" - #define RTL8821_PHY_RADIO_B "rtl8821A/RadioB.txt" - #define RTL8821_TXPWR_TRACK "rtl8821A/TxPowerTrack.txt" - #define RTL8821_AGC_TAB "rtl8821A/AGC_TAB.txt" - #define RTL8821_PHY_MACREG "rtl8821A/MAC_REG.txt" - #define RTL8821_PHY_REG_PG "rtl8821A/PHY_REG_PG.txt" - #define RTL8821_PHY_REG_MP "rtl8821A/PHY_REG_MP.txt" - #define RTL8821_TXPWR_LMT "rtl8821A/TXPWR_LMT.txt" + #define RTL8821_FW_IMG "rtl8821a/FW_NIC.bin" + #define RTL8821_FW_WW_IMG "rtl8821a/FW_WoWLAN.bin" + #define RTL8821_PHY_REG "rtl8821a/PHY_REG.txt" + #define RTL8821_PHY_RADIO_A "rtl8821a/RadioA.txt" + #define RTL8821_PHY_RADIO_B "rtl8821a/RadioB.txt" + #define RTL8821_TXPWR_TRACK "rtl8821a/TxPowerTrack.txt" + #define RTL8821_AGC_TAB "rtl8821a/AGC_TAB.txt" + #define RTL8821_PHY_MACREG "rtl8821a/MAC_REG.txt" + #define RTL8821_PHY_REG_PG "rtl8821a/PHY_REG_PG.txt" + #define RTL8821_PHY_REG_MP "rtl8821a/PHY_REG_MP.txt" + #define RTL8821_TXPWR_LMT "rtl8821a/TXPWR_LMT.txt" //--------------------------------------------------------------------- // RTL8812 Power Configuration CMDs for PCIe interface @@ -161,6 +158,12 @@ typedef struct _RT_FIRMWARE_8812 { //for 8812 // TX 128K, RX 16K, Page size 512B for TX, 128B for RX #define MAX_RX_DMA_BUFFER_SIZE_8812 0x3E80 //0x3FFF // RX 16K +#ifdef CONFIG_FW_C2H_DEBUG +#define RX_DMA_RESERVED_SIZE_8812 0x100 // 256B, reserved for c2h debug message +#else +#define RX_DMA_RESERVED_SIZE_8812 0x0 // 0B +#endif +#define RX_DMA_BOUNDARY_8812 (MAX_RX_DMA_BUFFER_SIZE_8812 - RX_DMA_RESERVED_SIZE_8812 - 1) #define BCNQ_PAGE_NUM_8812 0x07 @@ -197,6 +200,12 @@ typedef struct _RT_FIRMWARE_8812 { #define PAGE_SIZE_RX_8821A 128 #define MAX_RX_DMA_BUFFER_SIZE_8821 0x3E80 // RX 16K +#ifdef CONFIG_FW_C2H_DEBUG +#define RX_DMA_RESERVED_SIZE_8821 0x100 // 256B, reserved for c2h debug message +#else +#define RX_DMA_RESERVED_SIZE_8821 0x0 // 0B +#endif +#define RX_DMA_BOUNDARY_8821 (MAX_RX_DMA_BUFFER_SIZE_8821 - RX_DMA_RESERVED_SIZE_8821 - 1) #define BCNQ_PAGE_NUM_8821 0x08 #ifdef CONFIG_CONCURRENT_MODE @@ -271,17 +280,6 @@ typedef enum _TX_PWR_PERCENTAGE{ //#define RT_IS_FUNC_DISABLED(__pAdapter, __FuncBits) ( (__pAdapter)->DisabledFunctions & (__FuncBits) ) -#define GetRegTxBBSwing_2G(_Adapter) (_Adapter->registrypriv.TxBBSwing_2G) -#define GetRegTxBBSwing_5G(_Adapter) (_Adapter->registrypriv.TxBBSwing_5G) - -#define GetRegAmplifierType2G(_Adapter) (_Adapter->registrypriv.AmplifierType_2G) -#define GetRegAmplifierType5G(_Adapter) (_Adapter->registrypriv.AmplifierType_5G) - -#define GetRegbENRFEType(_Adapter) (_Adapter->registrypriv.bEn_RFE) -#define GetRegRFEType(_Adapter) (_Adapter->registrypriv.RFE_Type) - -#define GetDefaultAdapter(padapter) padapter - // rtl8812_hal_init.c void _8051Reset8812(PADAPTER padapter); s32 FirmwareDownload8812(PADAPTER Adapter, BOOLEAN bUsedWoWLANFw); @@ -311,6 +309,7 @@ void Hal_ReadRFEType_8812A(PADAPTER Adapter,u8* PROMContent, BOOLEAN AutoloadFai void Hal_EfuseParseBTCoexistInfo8812A(PADAPTER Adapter, u8* hwinfo, BOOLEAN AutoLoadFail); void hal_ReadUsbType_8812AU(PADAPTER Adapter, u8 *PROMContent, BOOLEAN AutoloadFail); int FirmwareDownloadBT(PADAPTER Adapter, PRT_MP_FIRMWARE pFirmware); +void Hal_ReadRemoteWakeup_8812A(PADAPTER padapter, u8* hwinfo, BOOLEAN AutoLoadFail); BOOLEAN HalDetectPwrDownMode8812(PADAPTER Adapter); @@ -342,5 +341,10 @@ BOOLEAN InterruptRecognized8812AE(PADAPTER Adapter); VOID UpdateInterruptMask8812AE(PADAPTER Adapter, u32 AddMSR, u32 AddMSR1, u32 RemoveMSR, u32 RemoveMSR1); #endif +#ifdef CONFIG_BT_COEXIST +void rtl8812a_combo_card_WifiOnlyHwInit(PADAPTER Adapter); +#endif + + #endif //__RTL8188E_HAL_H__ diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8812a_recv.h b/backports/drivers/realtek/rtl8812au/include/rtl8812a_recv.h index d1c202995fb2c7..65203b1489d26a 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8812a_recv.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8812a_recv.h @@ -22,20 +22,30 @@ #if defined(CONFIG_USB_HCI) +#ifndef MAX_RECVBUF_SZ #ifdef PLATFORM_OS_CE #define MAX_RECVBUF_SZ (8192+1024) // 8K+1k #else #ifndef CONFIG_MINIMAL_MEMORY_USAGE + #ifdef CONFIG_PLATFORM_MSTAR + #define MAX_RECVBUF_SZ (8192) // 8K + #else #define MAX_RECVBUF_SZ (32768) // 32k + #endif //#define MAX_RECVBUF_SZ (24576) // 24k //#define MAX_RECVBUF_SZ (20480) //20K //#define MAX_RECVBUF_SZ (10240) //10K //#define MAX_RECVBUF_SZ (15360) // 15k < 16k //#define MAX_RECVBUF_SZ (8192+1024) // 8K+1k + #ifdef CONFIG_PLATFORM_NOVATEK_NT72668 + #undef MAX_RECVBUF_SZ + #define MAX_RECVBUF_SZ (15360) // 15k < 16k + #endif //CONFIG_PLATFORM_NOVATEK_NT72668 #else #define MAX_RECVBUF_SZ (4000) // about 4K #endif #endif +#endif //!MAX_RECVBUF_SZ #elif defined(CONFIG_PCI_HCI) //#ifndef CONFIG_MINIMAL_MEMORY_USAGE @@ -151,8 +161,7 @@ s32 rtl8812ae_init_recv_priv(PADAPTER padapter); void rtl8812ae_free_recv_priv(PADAPTER padapter); #endif -void rtl8812_query_rx_desc_status(union recv_frame *precvframe, u8 *pdesc); -void rtl8812_query_rx_phy_status(union recv_frame *prframe, u8 *pphy_stat); +void rtl8812_query_rx_desc_status(union recv_frame *precvframe, u8 *pdesc); -#endif +#endif /* __RTL8812A_RECV_H__ */ diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8812a_spec.h b/backports/drivers/realtek/rtl8812au/include/rtl8812a_spec.h index 1daf4103bc3cea..5fb42637321d59 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8812a_spec.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8812a_spec.h @@ -59,6 +59,7 @@ #define REG_PKTBUF_DBG_ADDR (REG_PKTBUF_DBG_CTRL) #define REG_RXPKTBUF_DBG (REG_PKTBUF_DBG_CTRL+2) #define REG_TXPKTBUF_DBG (REG_PKTBUF_DBG_CTRL+3) +#define REG_WOWLAN_WAKE_REASON REG_MCUTST_WOWLAN #define REG_RSVD3_8812 0x0168 #define REG_C2HEVT_CMD_SEQ_88XX 0x01A1 @@ -75,7 +76,8 @@ // 0x0200h ~ 0x027Fh TXDMA Configuration // //----------------------------------------------------- -#define REG_TDECTRL1_8812 0x0228 +#define REG_DWBCN0_CTRL_8812 REG_TDECTRL +#define REG_DWBCN1_CTRL_8812 0x0228 //----------------------------------------------------- // @@ -121,6 +123,10 @@ #define REG_TXPKTBUF_WMAC_LBK_BF_HD_8812 0x045D #define REG_NDPA_OPT_CTRL_8812 0x045F #define REG_DATA_SC_8812 0x0483 +#ifdef CONFIG_WOWLAN +#define REG_TXPKTBUF_IV_LOW 0x0484 +#define REG_TXPKTBUF_IV_HIGH 0x0488 +#endif #define REG_ARFR2_8812 0x048C #define REG_ARFR3_8812 0x0494 #define REG_TXRPT_START_OFFSET 0x04AC @@ -243,9 +249,16 @@ #define AcmHw_ViqStatus_8812 BIT(6) #define AcmHw_BeqStatus_8812 BIT(7) -#endif //__RTL8188E_SPEC_H__ +//======================================================== +// General definitions +//======================================================== + +#define MACID_NUM_8812A 128 +#define CAM_ENTRY_NUM_8812A 64 + +#endif /* __RTL8812A_SPEC_H__ */ #ifdef CONFIG_RTL8821A #include "rtl8821a_spec.h" -#endif // CONFIG_RTL8821A +#endif /* CONFIG_RTL8821A */ diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8812a_xmit.h b/backports/drivers/realtek/rtl8812au/include/rtl8812a_xmit.h index cc87890450f391..42e1a8895c7fb7 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8812a_xmit.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8812a_xmit.h @@ -20,17 +20,6 @@ #ifndef __RTL8812A_XMIT_H__ #define __RTL8812A_XMIT_H__ -// -// Queue Select Value in TxDesc -// -#define QSLT_BK 0x2//0x01 -#define QSLT_BE 0x0 -#define QSLT_VI 0x5//0x4 -#define QSLT_VO 0x7//0x6 -#define QSLT_BEACON 0x10 -#define QSLT_HIGH 0x11 -#define QSLT_MGNT 0x12 -#define QSLT_CMD 0x13 //For 88e early mode #define SET_EARLYMODE_PKTNUM(__pAddr, __Value) SET_BITS_TO_LE_4BYTE(__pAddr, 0, 3, __Value) @@ -331,7 +320,7 @@ typedef struct txdescriptor_8812 void rtl8812a_cal_txdesc_chksum(u8 *ptxdesc); -void rtl8812a_fill_fake_txdesc(PADAPTER padapter,u8*pDesc,u32 BufferLen,u8 IsPsPoll,u8 IsBTQosNull); +void rtl8812a_fill_fake_txdesc(PADAPTER padapter,u8*pDesc,u32 BufferLen,u8 IsPsPoll,u8 IsBTQosNull, u8 bDataFrame); void rtl8812a_fill_txdesc_sectype(struct pkt_attrib *pattrib, u8 *ptxdesc); void rtl8812a_fill_txdesc_vcs(PADAPTER padapter, struct pkt_attrib *pattrib, u8 *ptxdesc); void rtl8812a_fill_txdesc_phy(PADAPTER padapter, struct pkt_attrib *pattrib, u8 *ptxdesc); diff --git a/backports/drivers/realtek/rtl8812au/include/rtl8821a_spec.h b/backports/drivers/realtek/rtl8812au/include/rtl8821a_spec.h index a6fe31b3422147..4c79b3a1fa0bae 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtl8821a_spec.h +++ b/backports/drivers/realtek/rtl8812au/include/rtl8821a_spec.h @@ -42,6 +42,7 @@ //----------------------------------------------------- // 0x0100h ~ 0x01FFh MACTOP General Configuration //----------------------------------------------------- +#define REG_WOWLAN_WAKE_REASON REG_MCUTST_WOWLAN //----------------------------------------------------- // 0x0200h ~ 0x027Fh TXDMA Configuration @@ -92,6 +93,12 @@ // Regsiter Bit and Content definition //============================================================ +//======================================================== +// General definitions +//======================================================== -#endif // __RTL8821A_SPEC_H__ +#define MACID_NUM_8821A 128 +#define CAM_ENTRY_NUM_8821A 64 + +#endif /* __RTL8821A_SPEC_H__ */ diff --git a/backports/drivers/realtek/rtl8812au/include/rtw_android.h b/backports/drivers/realtek/rtl8812au/include/rtw_android.h index 00a5117b2c1ef3..cc59417397a1d3 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtw_android.h +++ b/backports/drivers/realtek/rtl8812au/include/rtw_android.h @@ -45,6 +45,9 @@ enum ANDROID_WIFI_CMD { ANDROID_WIFI_CMD_P2P_GET_NOA, ANDROID_WIFI_CMD_P2P_SET_PS, ANDROID_WIFI_CMD_SET_AP_WPS_P2P_IE, + + ANDROID_WIFI_CMD_MIRACAST, + #ifdef CONFIG_PNO_SUPPORT ANDROID_WIFI_CMD_PNOSSIDCLR_SET, ANDROID_WIFI_CMD_PNOSETUP_SET, @@ -69,12 +72,19 @@ enum ANDROID_WIFI_CMD { #ifdef CONFIG_GTK_OL ANDROID_WIFI_CMD_GTK_REKEY_OFFLOAD, #endif //CONFIG_GTK_OL + ANDROID_WIFI_CMD_P2P_DISABLE, ANDROID_WIFI_CMD_MAX }; int rtw_android_cmdstr_to_num(char *cmdstr); int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd); +#if defined(CONFIG_PNO_SUPPORT) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0)) +int rtw_android_pno_enable(struct net_device *net, int pno_enable); +int rtw_android_cfg80211_pno_setup(struct net_device *net, + struct cfg80211_ssid *ssid, int n_ssids, int interval); +#endif + #if defined(RTW_ENABLE_WIFI_CONTROL_FUNC) int rtw_android_wifictrl_func_add(void); void rtw_android_wifictrl_func_del(void); @@ -89,5 +99,13 @@ static int rtw_android_wifictrl_func_add(void) { return 0; } static void rtw_android_wifictrl_func_del(void) {} #endif /* defined(RTW_ENABLE_WIFI_CONTROL_FUNC) */ +#ifdef CONFIG_GPIO_WAKEUP +#ifdef CONFIG_PLATFORM_INTEL_BYT +int wifi_configure_gpio(void); +#endif //CONFIG_PLATFORM_INTEL_BYT +void wifi_free_gpio(unsigned int gpio); +#endif //CONFIG_GPIO_WAKEUP + + #endif //__RTW_ANDROID_H__ diff --git a/backports/drivers/realtek/rtl8812au/include/rtw_ap.h b/backports/drivers/realtek/rtl8812au/include/rtw_ap.h index dccd5faa7b571e..ed8598fca74690 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtw_ap.h +++ b/backports/drivers/realtek/rtl8812au/include/rtw_ap.h @@ -33,7 +33,8 @@ void free_mlme_ap_info(_adapter *padapter); //void update_BCNTIM(_adapter *padapter); void rtw_add_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index, u8 *data, u8 len); void rtw_remove_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index); -void update_beacon(_adapter *padapter, u8 ie_id, u8 *oui, u8 tx); +void _update_beacon(_adapter *padapter, u8 ie_id, u8 *oui, u8 tx, const char *tag); +#define update_beacon(adapter, ie_id, oui, tx) _update_beacon((adapter), (ie_id), (oui), (tx), __func__) void add_RATid(_adapter *padapter, struct sta_info *psta, u8 rssi_level); void expire_timeout_chk(_adapter *padapter); void update_sta_info_apmode(_adapter *padapter, struct sta_info *psta); diff --git a/backports/drivers/realtek/rtl8812au/include/rtw_beamforming.h b/backports/drivers/realtek/rtl8812au/include/rtw_beamforming.h index 8a8a340bde7ba6..69d781931ea686 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtw_beamforming.h +++ b/backports/drivers/realtek/rtl8812au/include/rtw_beamforming.h @@ -74,19 +74,28 @@ enum BEAMFORMING_CTRL_TYPE BEAMFORMING_CTRL_LEAVE = 1, BEAMFORMING_CTRL_START_PERIOD = 2, BEAMFORMING_CTRL_END_PERIOD = 3, + BEAMFORMING_CTRL_SOUNDING_FAIL=4, + BEAMFORMING_CTRL_SOUNDING_CLK=5, }; struct beamforming_entry { - u8 used; - u8 tx_bf; - u16 aid; // Used to construct AID field of NDPA packet. - u16 mac_id; // Used to Set Reg42C in IBSS mode. - u16 p_aid; // Used to fill Reg42C & Reg714 to compare with P_AID of Tx DESC. - u8 mac_addr[6];// Used to fill Reg6E4 to fill Mac address of CSI report frame. - CHANNEL_WIDTH sound_bw; // Sounding BandWidth - u16 sound_period; - BEAMFORMING_CAP beamforming_entry_cap; + BOOLEAN bUsed; + BOOLEAN bSound; + u16 aid; // Used to construct AID field of NDPA packet. + u16 mac_id; // Used to Set Reg42C in IBSS mode. + u16 p_aid; // Used to fill Reg42C & Reg714 to compare with P_AID of Tx DESC. + u8 mac_addr[6];// Used to fill Reg6E4 to fill Mac address of CSI report frame. + CHANNEL_WIDTH sound_bw; // Sounding BandWidth + u16 sound_period; + BEAMFORMING_CAP beamforming_entry_cap; BEAMFORMING_ENTRY_STATE beamforming_entry_state; + u8 LogSeq; + u8 LogRetryCnt; + u8 LogSuccessCnt; + u8 LogStatusFailCnt; + u8 PreCsiReport[327]; + u8 DefaultCsiCnt; + BOOLEAN bDefaultCSI; }; struct sounding_info { @@ -102,12 +111,30 @@ struct beamforming_info { struct beamforming_entry beamforming_entry[BEAMFORMING_ENTRY_NUM]; u8 beamforming_cur_idx; u8 beamforming_in_progress; + u8 sounding_sequence; struct sounding_info sounding_info; }; +struct rtw_ndpa_sta_info { + u16 aid:12; + u16 feedback_type:1; + u16 nc_index:3; +}; + +BEAMFORMING_CAP beamforming_get_entry_beam_cap_by_mac_id(PVOID pmlmepriv ,u8 mac_id); void beamforming_notify(PADAPTER adapter); BEAMFORMING_CAP beamforming_get_beamform_cap(struct beamforming_info *pBeamInfo); +u32 beamforming_get_report_frame(PADAPTER Adapter, union recv_frame *precv_frame); +void beamforming_get_ndpa_frame(PADAPTER Adapter, union recv_frame *precv_frame); + +BOOLEAN beamforming_send_ht_ndpa_packet(PADAPTER Adapter, u8 *ra, CHANNEL_WIDTH bw, u8 qidx); +BOOLEAN beamforming_send_vht_ndpa_packet(PADAPTER Adapter, u8 *ra, u16 aid, CHANNEL_WIDTH bw, u8 qidx); + +void beamforming_check_sounding_success(PADAPTER Adapter,BOOLEAN status); + +void beamforming_watchdog(PADAPTER Adapter); + void beamforming_wk_hdl(_adapter *padapter, u8 type, u8 *pbuf); u8 beamforming_wk_cmd(_adapter*padapter, s32 type, u8 *pbuf, s32 size, u8 enqueue); diff --git a/backports/drivers/realtek/rtl8812au/include/rtw_bt_mp.h b/backports/drivers/realtek/rtl8812au/include/rtw_bt_mp.h index 7a1fa0d5242292..9ede51af8d6a66 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtw_bt_mp.h +++ b/backports/drivers/realtek/rtl8812au/include/rtw_bt_mp.h @@ -75,7 +75,7 @@ typedef enum _MP_BT_PAYLOAD_TYPE{ MP_BT_PAYLOAD_ALL_0 = 2, MP_BT_PAYLOAD_11110000 = 3, MP_BT_PAYLOAD_PRBS9 = 4, - MP_BT_PAYLOAD_MAX + MP_BT_PAYLOAD_MAX = 8, }MP_BT_PAYLOAD_TYPE,*PMP_BT_PAYLOAD_TYPE; diff --git a/backports/drivers/realtek/rtl8812au/include/rtw_btcoex.h b/backports/drivers/realtek/rtl8812au/include/rtw_btcoex.h index aa5676d40fc21e..660810964235b0 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtw_btcoex.h +++ b/backports/drivers/realtek/rtl8812au/include/rtw_btcoex.h @@ -22,6 +22,290 @@ #include +#ifdef CONFIG_BT_COEXIST_SOCKET_TRX + +#define NETLINK_USER 31 +#define CONNECT_PORT 30001 +#define KERNEL_SOCKET_OK 0x01 +#define NETLINK_SOCKET_OK 0x02 + +#define OTHER 0 +#define RX_ATTEND_ACK 1 +#define RX_LEAVE_ACK 2 +#define RX_BT_LEAVE 3 +#define RX_INVITE_REQ 4 + +#define invite_req "INVITE_REQ" +#define invite_rsp "INVITE_RSP" +#define attend_req "ATTEND_REQ" +#define attend_ack "ATTEND_ACK" +#define wifi_leave "WIFI_LEAVE" +#define leave_ack "LEAVE_ACK" +#define bt_leave "BT_LEAVE" + +#define BT_INFO_NOTIFY_CMD 0x0106 +#define BT_INFO_LEN 8 + +typedef struct _HCI_LINK_INFO{ + u2Byte ConnectHandle; + u1Byte IncomingTrafficMode; + u1Byte OutgoingTrafficMode; + u1Byte BTProfile; + u1Byte BTCoreSpec; + s1Byte BT_RSSI; + u1Byte TrafficProfile; + u1Byte linkRole; +}HCI_LINK_INFO, *PHCI_LINK_INFO; + +#define MAX_BT_ACL_LINK_NUM 8 + +typedef struct _HCI_EXT_CONFIG{ + HCI_LINK_INFO aclLink[MAX_BT_ACL_LINK_NUM]; + u1Byte btOperationCode; + u2Byte CurrentConnectHandle; + u1Byte CurrentIncomingTrafficMode; + u1Byte CurrentOutgoingTrafficMode; + + u1Byte NumberOfACL; + u1Byte NumberOfSCO; + u1Byte CurrentBTStatus; + u2Byte HCIExtensionVer; + + BOOLEAN bEnableWifiScanNotify; +}HCI_EXT_CONFIG, *PHCI_EXT_CONFIG; + +typedef struct _HCI_PHY_LINK_BSS_INFO{ + u2Byte bdCap; // capability information + + // Qos related. Added by Annie, 2005-11-01. + //BSS_QOS BssQos; + +}HCI_PHY_LINK_BSS_INFO, *PHCI_PHY_LINK_BSS_INFO; + +typedef enum _BT_CONNECT_TYPE{ + BT_CONNECT_AUTH_REQ =0x00, + BT_CONNECT_AUTH_RSP =0x01, + BT_CONNECT_ASOC_REQ =0x02, + BT_CONNECT_ASOC_RSP =0x03, + BT_DISCONNECT =0x04 +}BT_CONNECT_TYPE,*PBT_CONNECT_TYPE; + + +typedef struct _PACKET_IRP_HCIEVENT_DATA { + u8 EventCode; + u8 Length; //total cmd length = extension event length+1(extension event code length) + u8 Data[1]; // byte1 is extension event code +} rtw_HCI_event; + + +struct btinfo_8761ATV { + u8 cid; + u8 len; + + u8 bConnection:1; + u8 bSCOeSCO:1; + u8 bInQPage:1; + u8 bACLBusy:1; + u8 bSCOBusy:1; + u8 bHID:1; + u8 bA2DP:1; + u8 bFTP:1; + + u8 retry_cnt:4; + u8 rsvd_34:1; + u8 bPage:1; + u8 TRxMask:1; + u8 Sniff_attempt:1; + + u8 rssi; + + u8 A2dp_rate:1; + u8 ReInit:1; + u8 MaxPower:1; + u8 bEnIgnoreWlanAct:1; + u8 TxPowerLow:1; + u8 TxPowerHigh:1; + u8 eSCO_SCO:1; + u8 Master_Slave:1; + + u8 ACL_TRx_TP_low; + u8 ACL_TRx_TP_high; +}; + +#define HCIOPCODE(_OCF, _OGF) ((_OGF)<<10|(_OCF)) +#define HCIOPCODELOW(_OCF, _OGF) (u8)(HCIOPCODE(_OCF, _OGF)&0x00ff) +#define HCIOPCODEHIGHT(_OCF, _OGF) (u8)(HCIOPCODE(_OCF, _OGF)>>8) +#define HCI_OGF(opCode) (unsigned char)((0xFC00 & (opCode)) >> 10) +#define HCI_OCF(opCode) ( 0x3FF & (opCode)) + + +typedef enum _HCI_STATUS{ + HCI_STATUS_SUCCESS =0x00, //Success + HCI_STATUS_UNKNOW_HCI_CMD =0x01, //Unknown HCI Command + HCI_STATUS_UNKNOW_CONNECT_ID =0X02, //Unknown Connection Identifier + HCI_STATUS_HW_FAIL =0X03, //Hardware Failure + HCI_STATUS_PAGE_TIMEOUT =0X04, //Page Timeout + HCI_STATUS_AUTH_FAIL =0X05, //Authentication Failure + HCI_STATUS_PIN_OR_KEY_MISSING =0X06, //PIN or Key Missing + HCI_STATUS_MEM_CAP_EXCEED =0X07, //Memory Capacity Exceeded + HCI_STATUS_CONNECT_TIMEOUT =0X08, //Connection Timeout + HCI_STATUS_CONNECT_LIMIT =0X09, //Connection Limit Exceeded + HCI_STATUS_SYN_CONNECT_LIMIT =0X0a, //Synchronous Connection Limit To A Device Exceeded + HCI_STATUS_ACL_CONNECT_EXISTS =0X0b, //ACL Connection Already Exists + HCI_STATUS_CMD_DISALLOW =0X0c, //Command Disallowed + HCI_STATUS_CONNECT_RJT_LIMIT_RESOURCE =0X0d, //Connection Rejected due to Limited Resources + HCI_STATUS_CONNECT_RJT_SEC_REASON =0X0e, //Connection Rejected Due To Security Reasons + HCI_STATUS_CONNECT_RJT_UNACCEPT_BD_ADDR =0X0f, //Connection Rejected due to Unacceptable BD_ADDR + HCI_STATUS_CONNECT_ACCEPT_TIMEOUT =0X10, //Connection Accept Timeout Exceeded + HCI_STATUS_UNSUPPORT_FEATURE_PARA_VALUE =0X11, //Unsupported Feature or Parameter Value + HCI_STATUS_INVALID_HCI_CMD_PARA_VALUE =0X12, //Invalid HCI Command Parameters + HCI_STATUS_REMOTE_USER_TERMINATE_CONNECT =0X13, //Remote User Terminated Connection + HCI_STATUS_REMOTE_DEV_TERMINATE_LOW_RESOURCE =0X14, //Remote Device Terminated Connection due to Low Resources + HCI_STATUS_REMOTE_DEV_TERMINATE_CONNECT_POWER_OFF =0X15, //Remote Device Terminated Connection due to Power Off + HCI_STATUS_CONNECT_TERMINATE_LOCAL_HOST =0X16, //Connection Terminated By Local Host + HCI_STATUS_REPEATE_ATTEMPT =0X17, //Repeated Attempts + HCI_STATUS_PAIR_NOT_ALLOW =0X18, //Pairing Not Allowed + HCI_STATUS_UNKNOW_LMP_PDU =0X19, //Unknown LMP PDU + HCI_STATUS_UNSUPPORT_REMOTE_LMP_FEATURE =0X1a, //Unsupported Remote Feature / Unsupported LMP Feature + HCI_STATUS_SOC_OFFSET_REJECT =0X1b, //SCO Offset Rejected + HCI_STATUS_SOC_INTERVAL_REJECT =0X1c, //SCO Interval Rejected + HCI_STATUS_SOC_AIR_MODE_REJECT =0X1d,//SCO Air Mode Rejected + HCI_STATUS_INVALID_LMP_PARA =0X1e, //Invalid LMP Parameters + HCI_STATUS_UNSPECIFIC_ERROR =0X1f, //Unspecified Error + HCI_STATUS_UNSUPPORT_LMP_PARA_VALUE =0X20, //Unsupported LMP Parameter Value + HCI_STATUS_ROLE_CHANGE_NOT_ALLOW =0X21, //Role Change Not Allowed + HCI_STATUS_LMP_RESPONSE_TIMEOUT =0X22, //LMP Response Timeout + HCI_STATUS_LMP_ERROR_TRANSACTION_COLLISION =0X23, //LMP Error Transaction Collision + HCI_STATUS_LMP_PDU_NOT_ALLOW =0X24, //LMP PDU Not Allowed + HCI_STATUS_ENCRYPTION_MODE_NOT_ALLOW =0X25, //Encryption Mode Not Acceptable + HCI_STATUS_LINK_KEY_CAN_NOT_CHANGE =0X26, //Link Key Can Not be Changed + HCI_STATUS_REQUEST_QOS_NOT_SUPPORT =0X27, //Requested QoS Not Supported + HCI_STATUS_INSTANT_PASSED =0X28, //Instant Passed + HCI_STATUS_PAIRING_UNIT_KEY_NOT_SUPPORT =0X29, //Pairing With Unit Key Not Supported + HCI_STATUS_DIFFERENT_TRANSACTION_COLLISION =0X2a, //Different Transaction Collision + HCI_STATUS_RESERVE_1 =0X2b, //Reserved + HCI_STATUS_QOS_UNACCEPT_PARA =0X2c, //QoS Unacceptable Parameter + HCI_STATUS_QOS_REJECT =0X2d, //QoS Rejected + HCI_STATUS_CHNL_CLASSIFICATION_NOT_SUPPORT =0X2e, //Channel Classification Not Supported + HCI_STATUS_INSUFFICIENT_SECURITY =0X2f, //Insufficient Security + HCI_STATUS_PARA_OUT_OF_RANGE =0x30, //Parameter Out Of Mandatory Range + HCI_STATUS_RESERVE_2 =0X31, //Reserved + HCI_STATUS_ROLE_SWITCH_PENDING =0X32, //Role Switch Pending + HCI_STATUS_RESERVE_3 =0X33, //Reserved + HCI_STATUS_RESERVE_SOLT_VIOLATION =0X34, //Reserved Slot Violation + HCI_STATUS_ROLE_SWITCH_FAIL =0X35, //Role Switch Failed + HCI_STATUS_EXTEND_INQUIRY_RSP_TOO_LARGE =0X36, //Extended Inquiry Response Too Large + HCI_STATUS_SEC_SIMPLE_PAIRING_NOT_SUPPORT =0X37, //Secure Simple Pairing Not Supported By Host. + HCI_STATUS_HOST_BUSY_PAIRING =0X38, //Host Busy - Pairing + HCI_STATUS_CONNECT_REJ_NOT_SUIT_CHNL_FOUND =0X39, //Connection Rejected due to No Suitable Channel Found + HCI_STATUS_CONTROLLER_BUSY =0X3a //CONTROLLER BUSY +}RTW_HCI_STATUS; + +#define HCI_EVENT_COMMAND_COMPLETE 0x0e + +#define OGF_EXTENSION 0X3f +typedef enum HCI_EXTENSION_COMMANDS{ + HCI_SET_ACL_LINK_DATA_FLOW_MODE =0x0010, + HCI_SET_ACL_LINK_STATUS =0x0020, + HCI_SET_SCO_LINK_STATUS =0x0030, + HCI_SET_RSSI_VALUE =0x0040, + HCI_SET_CURRENT_BLUETOOTH_STATUS =0x0041, + + //The following is for RTK8723 + HCI_EXTENSION_VERSION_NOTIFY =0x0100, + HCI_LINK_STATUS_NOTIFY =0x0101, + HCI_BT_OPERATION_NOTIFY =0x0102, + HCI_ENABLE_WIFI_SCAN_NOTIFY =0x0103, + HCI_QUERY_RF_STATUS =0x0104, + HCI_BT_ABNORMAL_NOTIFY =0x0105, + HCI_BT_INFO_NOTIFY =0x0106, + HCI_BT_COEX_NOTIFY =0x0107, + HCI_BT_PATCH_VERSION_NOTIFY =0x0108, + HCI_BT_AFH_MAP_NOTIFY =0x0109, + HCI_BT_REGISTER_VALUE_NOTIFY =0x010a, + + //The following is for IVT + HCI_WIFI_CURRENT_CHANNEL =0x0300, + HCI_WIFI_CURRENT_BANDWIDTH =0x0301, + HCI_WIFI_CONNECTION_STATUS =0x0302 +}RTW_HCI_EXT_CMD; + +#define HCI_EVENT_EXTENSION_RTK 0xfe +typedef enum HCI_EXTENSION_EVENT_RTK{ + HCI_EVENT_EXT_WIFI_SCAN_NOTIFY =0x01, + HCI_EVENT_EXT_WIFI_RF_STATUS_NOTIFY =0x02, + HCI_EVENT_EXT_BT_INFO_CONTROL =0x03, + HCI_EVENT_EXT_BT_COEX_CONTROL =0x04 +}RTW_HCI_EXT_EVENT; + +typedef enum _BT_TRAFFIC_MODE{ + BT_MOTOR_EXT_BE = 0x00, //Best Effort. Default. for HCRP, PAN, SDP, RFCOMM-based profiles like FTP,OPP, SPP, DUN, etc. + BT_MOTOR_EXT_GUL = 0x01, //Guaranteed Latency. This type of traffic is used e.g. for HID and AVRCP. + BT_MOTOR_EXT_GUB = 0X02, //Guaranteed Bandwidth. + BT_MOTOR_EXT_GULB = 0X03 //Guaranteed Latency and Bandwidth. for A2DP and VDP. +} BT_TRAFFIC_MODE; + +typedef enum _BT_TRAFFIC_MODE_PROFILE{ + BT_PROFILE_NONE, + BT_PROFILE_A2DP, + BT_PROFILE_PAN , + BT_PROFILE_HID, + BT_PROFILE_SCO +} BT_TRAFFIC_MODE_PROFILE; + +typedef struct _BT_MGNT{ + BOOLEAN bBTConnectInProgress; + BOOLEAN bLogLinkInProgress; + BOOLEAN bPhyLinkInProgress; + BOOLEAN bPhyLinkInProgressStartLL; + u1Byte BtCurrentPhyLinkhandle; + u2Byte BtCurrentLogLinkhandle; + u1Byte CurrentConnectEntryNum; + u1Byte DisconnectEntryNum; + u1Byte CurrentBTConnectionCnt; + BT_CONNECT_TYPE BTCurrentConnectType; + BT_CONNECT_TYPE BTReceiveConnectPkt; + u1Byte BTAuthCount; + u1Byte BTAsocCount; + BOOLEAN bStartSendSupervisionPkt; + BOOLEAN BtOperationOn; + BOOLEAN BTNeedAMPStatusChg; + BOOLEAN JoinerNeedSendAuth; + HCI_PHY_LINK_BSS_INFO bssDesc; + HCI_EXT_CONFIG ExtConfig; + BOOLEAN bNeedNotifyAMPNoCap; + BOOLEAN bCreateSpportQos; + BOOLEAN bSupportProfile; + u1Byte BTChannel; + BOOLEAN CheckChnlIsSuit; + BOOLEAN bBtScan; + BOOLEAN btLogoTest; + BOOLEAN bRfStatusNotified; + BOOLEAN bBtRsvedPageDownload; +}BT_MGNT, *PBT_MGNT; + +struct bt_coex_info { + /* For Kernel Socket */ + struct socket *udpsock; + struct sockaddr_in sin; + + /* For Netlink Socket */ + struct sock *nl_sk; + u32 pid; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) + struct netlink_kernel_cfg *pnl_cfg; +#endif + /* store which socket is OK */ + u8 sock_open; + + u8 BT_attend; +// u8 WIFI_leave; + u8 is_exist; // socket exist + BT_MGNT BtMgnt; + //u8 bEnableWifiScanNotify; + //u16 HCIExtensionVer; +}; +#endif //CONFIG_BT_COEXIST_SOCKET_TRX #define PACKET_NORMAL 0 #define PACKET_DHCP 1 @@ -29,7 +313,9 @@ #define PACKET_EAPOL 3 void rtw_btcoex_Initialize(PADAPTER); -void rtw_btcoex_HAL_Initialize(PADAPTER padapter); +void rtw_btcoex_PowerOnSetting(PADAPTER padapter); +void rtw_btcoex_PreLoadFirmware(PADAPTER padapter); +void rtw_btcoex_HAL_Initialize(PADAPTER padapter, u8 bWifiOnly); void rtw_btcoex_IpsNotify(PADAPTER, u8 type); void rtw_btcoex_LpsNotify(PADAPTER, u8 type); void rtw_btcoex_ScanNotify(PADAPTER, u8 type); @@ -40,10 +326,11 @@ void rtw_btcoex_IQKNotify(PADAPTER padapter, u8 state); void rtw_btcoex_BtInfoNotify(PADAPTER, u8 length, u8 *tmpBuf); void rtw_btcoex_SuspendNotify(PADAPTER, u8 state); void rtw_btcoex_HaltNotify(PADAPTER); -void rtw_btcoex_SwitchGntBt(PADAPTER); +void rtw_btcoex_SwitchBtTRxMask(PADAPTER); void rtw_btcoex_Switch(PADAPTER, u8 enable); u8 rtw_btcoex_IsBtDisabled(PADAPTER); void rtw_btcoex_Handler(PADAPTER); +s32 rtw_btcoex_IsBTCoexRejectAMPDU(PADAPTER padapter); s32 rtw_btcoex_IsBTCoexCtrlAMPDUSize(PADAPTER); u32 rtw_btcoex_GetAMPDUSize(PADAPTER); void rtw_btcoex_SetManualControl(PADAPTER, u8 bmanual); @@ -56,6 +343,7 @@ void rtw_btcoex_SetBTCoexist(PADAPTER, u8 bBtExist); void rtw_btcoex_SetChipType(PADAPTER, u8 chipType); void rtw_btcoex_SetPGAntNum(PADAPTER, u8 antNum); u8 rtw_btcoex_GetPGAntNum(PADAPTER); +void rtw_btcoex_SetSingleAntPath(PADAPTER padapter, u8 singleAntPath); u32 rtw_btcoex_GetRaMask(PADAPTER); void rtw_btcoex_RecordPwrMode(PADAPTER, u8 *pCmdBuf, u8 cmdLen); void rtw_btcoex_DisplayBtCoexInfo(PADAPTER, u8 *pbuf, u32 bufsize); @@ -63,11 +351,35 @@ void rtw_btcoex_SetDBG(PADAPTER, u32 *pDbgModule); u32 rtw_btcoex_GetDBG(PADAPTER, u8 *pStrBuf, u32 bufSize); u8 rtw_btcoex_IncreaseScanDeviceNum(PADAPTER); u8 rtw_btcoex_IsBtLinkExist(PADAPTER); +#ifdef CONFIG_BT_COEXIST_SOCKET_TRX +void rtw_btcoex_SetBtPatchVersion(PADAPTER padapter,u16 btHciVer, u16 btPatchVer); +void rtw_btcoex_SetHciVersion(PADAPTER padapter, u16 hciVersion); +void rtw_btcoex_StackUpdateProfileInfo(void); +void rtw_btcoex_init_socket(_adapter *padapter); +void rtw_btcoex_close_socket(_adapter *padapter); +void rtw_btcoex_dump_tx_msg(u8 *tx_msg, u8 len, u8 *msg_name); +u8 rtw_btcoex_sendmsgbysocket(_adapter *padapter, u8 *msg, u8 msg_size); +void rtw_btcoex_create_nl_socket(_adapter *padapter); +void rtw_btcoex_close_nl_socket(_adapter *padapter); +u8 rtw_btcoex_create_kernel_socket(_adapter *padapter, u8 is_invite); +void rtw_btcoex_close_kernel_socket(_adapter *padapter); +void rtw_btcoex_recvmsgbysocket(struct sock *sk, int bytes); +s8 rtw_btcoex_sendmsgbynetlink(_adapter *padapter, u8 *msg, u8 msg_size); +void rtw_btcoex_recvmsgbynetlink(struct sk_buff *skb); +u16 rtw_btcoex_parse_recv_data(u8 *msg, u8 msg_size); +u8 rtw_btcoex_btinfo_cmd(PADAPTER padapter, u8 *pbuf, u16 length); +void rtw_btcoex_parse_hci_cmd(_adapter *padapter, u8 *cmd, u16 len); +void rtw_btcoex_SendEventExtBtCoexControl(PADAPTER Adapter, u8 bNeedDbgRsp, u8 dataLen, void *pData); +void rtw_btcoex_SendEventExtBtInfoControl(PADAPTER Adapter, u8 dataLen, void *pData); +void rtw_btcoex_SendScanNotify(PADAPTER padapter, u8 scanType); +#define BT_SendEventExtBtCoexControl(Adapter, bNeedDbgRsp, dataLen, pData) rtw_btcoex_SendEventExtBtCoexControl(Adapter, bNeedDbgRsp, dataLen, pData) +#define BT_SendEventExtBtInfoControl(Adapter, dataLen, pData) rtw_btcoex_SendEventExtBtInfoControl(Adapter, dataLen, pData) +#endif //CONFIG_BT_COEXIST_SOCKET_TRX // ================================================== // Below Functions are called by BT-Coex // ================================================== -void rtw_btcoex_RejectApAggregatedPacket(PADAPTER, u8 enable); +void rtw_btcoex_rx_ampdu_apply(PADAPTER); void rtw_btcoex_LPS_Enter(PADAPTER); void rtw_btcoex_LPS_Leave(PADAPTER); diff --git a/backports/drivers/realtek/rtl8812au/include/rtw_cmd.h b/backports/drivers/realtek/rtl8812au/include/rtw_cmd.h index 8e92594ba98e59..4e0d7a01c38b74 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtw_cmd.h +++ b/backports/drivers/realtek/rtl8812au/include/rtw_cmd.h @@ -69,7 +69,8 @@ u32 cmd_issued_cnt; u32 cmd_done_cnt; u32 rsp_cnt; - u8 cmdthd_running; + ATOMIC_T cmdthd_running; + //u8 cmdthd_running; u8 stop_req; _adapter *padapter; _mutex sctx_mutex; @@ -130,6 +131,16 @@ do {\ pcmd->rspsz = 0;\ } while(0) +#define init_h2fwcmd_w_parm_no_parm_rsp(pcmd, code) \ +do {\ + _rtw_init_listhead(&pcmd->list);\ + pcmd->cmdcode = code;\ + pcmd->parmbuf = NULL;\ + pcmd->cmdsz = 0;\ + pcmd->rsp = NULL;\ + pcmd->rspsz = 0;\ +} while(0) + struct c2h_evt_hdr { u8 id:4; u8 plen:4; @@ -162,6 +173,16 @@ struct P2P_PS_CTWPeriod_t { u8 CTWPeriod; //TU }; +#ifdef CONFIG_P2P_WOWLAN + +struct P2P_WoWlan_Offload_t{ + u8 Disconnect_Wkup_Drv:1; + u8 role:2; + u8 Wps_Config[2]; +}; + +#endif //CONFIG_P2P_WOWLAN + extern u32 rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *obj); extern struct cmd_obj *rtw_dequeue_cmd(struct cmd_priv *pcmdpriv); extern void rtw_free_cmd_obj(struct cmd_obj *pcmd); @@ -211,7 +232,9 @@ enum rtw_drvextra_cmd_id DM_RA_MSK_WK_CID, //add for STA update RAMask when bandwith change. BEAMFORMING_WK_CID, LPS_CHANGE_DTIM_CID, - MAX_WK_CID}; + BTINFO_WK_CID, + MAX_WK_CID +}; enum LPS_CTRL_TYPE { @@ -222,6 +245,16 @@ enum LPS_CTRL_TYPE LPS_CTRL_SPECIAL_PACKET=4, LPS_CTRL_LEAVE=5, LPS_CTRL_TRAFFIC_BUSY = 6, + LPS_CTRL_TX_TRAFFIC_LEAVE = 7, + LPS_CTRL_RX_TRAFFIC_LEAVE = 8, + LPS_CTRL_ENTER = 9, +}; + +enum STAKEY_TYPE +{ + GROUP_KEY =0, + UNICAST_KEY =1, + TDLS_KEY =2, }; enum RFINTFS { @@ -375,7 +408,7 @@ when shared key ==> algorithm/keyid struct set_stakey_parm { u8 addr[ETH_ALEN]; u8 algorithm; - u8 id;// currently for erasing cam entry if algorithm == _NO_PRIVACY_ + u8 keyid; u8 key[16]; }; @@ -939,6 +972,14 @@ struct TDLSoption_param u8 option; }; +/*H2C Handler index: 64 */ +struct RunInThread_param +{ + void (*func)(void*); + void *context; +}; + + #define GEN_CMD_CODE(cmd) cmd ## _CMD_ @@ -971,8 +1012,11 @@ extern u8 rtw_createbss_cmd(_adapter *padapter); extern u8 rtw_createbss_cmd_ex(_adapter *padapter, unsigned char *pbss, unsigned int sz); u8 rtw_startbss_cmd(_adapter *padapter, int flags); extern u8 rtw_setphy_cmd(_adapter *padapter, u8 modem, u8 ch); -extern u8 rtw_setstakey_cmd(_adapter *padapter, u8 *psta, u8 unicast_key, bool enqueue); -extern u8 rtw_clearstakey_cmd(_adapter *padapter, u8 *psta, u8 entry, u8 enqueue); + +struct sta_info; +extern u8 rtw_setstakey_cmd(_adapter *padapter, struct sta_info *sta, u8 key_type, bool enqueue); +extern u8 rtw_clearstakey_cmd(_adapter *padapter, struct sta_info *sta, u8 enqueue); + extern u8 rtw_joinbss_cmd(_adapter *padapter, struct wlan_network* pnetwork); u8 rtw_disassoc_cmd(_adapter *padapter, u32 deauth_timeout_ms, bool enqueue); extern u8 rtw_setopmode_cmd(_adapter *padapter, NDIS_802_11_NETWORK_INFRASTRUCTURE networktype, bool enqueue); @@ -1016,6 +1060,10 @@ extern u8 rtw_ps_cmd(_adapter*padapter); u8 rtw_chk_hi_queue_cmd(_adapter*padapter); #endif +#ifdef CONFIG_BT_COEXIST +u8 rtw_btinfo_cmd(PADAPTER padapter, u8 *pbuf, u16 length); +#endif + u8 rtw_set_ch_cmd(_adapter*padapter, u8 ch, u8 bw, u8 ch_offset, u8 enqueue); extern u8 rtw_set_chplan_cmd(_adapter*padapter, u8 chplan, u8 enqueue, u8 swconfig); extern u8 rtw_led_blink_cmd(_adapter*padapter, PVOID pLed); @@ -1028,6 +1076,8 @@ extern u8 rtw_c2h_packet_wk_cmd(PADAPTER padapter, u8 *pbuf, u16 length); extern u8 rtw_c2h_wk_cmd(PADAPTER padapter, u8 *c2h_evt); //#endif +u8 rtw_run_in_thread_cmd(PADAPTER padapter, void (*func)(void*), void* context); + u8 rtw_drvextra_cmd_hdl(_adapter *padapter, unsigned char *pbuf); extern void rtw_survey_cmd_callback(_adapter *padapter, struct cmd_obj *pcmd); @@ -1120,7 +1170,10 @@ enum rtw_h2c_cmd GEN_CMD_CODE(_SetChannelSwitch), /*61*/ GEN_CMD_CODE(_TDLS), /*62*/ - + GEN_CMD_CODE(_ChkBMCSleepq), /*63*/ + + GEN_CMD_CODE(_RunInThreadCMD), /*64*/ + MAX_H2CCMD }; @@ -1202,6 +1255,9 @@ struct _cmd_callback rtw_cmd_callback[] = {GEN_CMD_CODE(_SetChannelSwitch), NULL},/*61*/ {GEN_CMD_CODE(_TDLS), NULL},/*62*/ + {GEN_CMD_CODE(_ChkBMCSleepq), NULL}, /*63*/ + + {GEN_CMD_CODE(_RunInThreadCMD), NULL},/*64*/ }; #endif diff --git a/backports/drivers/realtek/rtl8812au/include/rtw_debug.h b/backports/drivers/realtek/rtl8812au/include/rtw_debug.h index ab506b69633279..d7ca1893d45368 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtw_debug.h +++ b/backports/drivers/realtek/rtl8812au/include/rtw_debug.h @@ -194,6 +194,8 @@ extern void rtl871x_cedbg(const char *fmt, ...); #if defined(_dbgdump) +#define DBG_871X_EXP(level, EXP) do { if (level <= GlobalDebugLevel) EXP; } while (0) + /* with driver-defined prefix */ #undef DBG_871X_LEVEL #define DBG_871X_LEVEL(level, fmt, arg...) \ @@ -227,7 +229,7 @@ extern void rtl871x_cedbg(const char *fmt, ...); if (sel == RTW_DBGDUMP)\ _DBG_871X_LEVEL(_drv_always_, fmt, ##arg); \ else {\ - if(_seqdump(sel, fmt, ##arg)) /*rtw_warn_on(1)*/; \ + if(_seqdump(sel, fmt, ##arg)) /*rtw_warn_on(1)*/ { ; } \ } \ }while(0) @@ -237,7 +239,7 @@ extern void rtl871x_cedbg(const char *fmt, ...); if (sel == RTW_DBGDUMP)\ DBG_871X_LEVEL(_drv_always_, fmt, ##arg); \ else {\ - if(_seqdump(sel, fmt, ##arg)) /*rtw_warn_on(1)*/; \ + if(_seqdump(sel, fmt, ##arg)) /*rtw_warn_on(1)*/ { ; } \ } \ }while(0) @@ -317,6 +319,12 @@ extern void rtl871x_cedbg(const char *fmt, ...); #endif /* defined(_dbgdump) */ #endif /* CONFIG_DEBUG_RTL871X */ +#ifdef CONFIG_DBG_COUNTER +#define DBG_COUNTER(counter) counter++ +#else +#define DBG_COUNTER(counter) +#endif + void dump_drv_version(void *sel); void dump_log_level(void *sel); @@ -328,6 +336,16 @@ void mac_reg_dump(void *sel, _adapter *adapter); void bb_reg_dump(void *sel, _adapter *adapter); void rf_reg_dump(void *sel, _adapter *adapter); +bool rtw_fwdl_test_trigger_chksum_fail(void); +bool rtw_fwdl_test_trigger_wintint_rdy_fail(void); +bool rtw_del_rx_ampdu_test_trigger_no_tx_fail(void); + +u32 rtw_get_wait_hiq_empty_ms(void); +void rtw_sink_rtp_seq_dbg( _adapter *adapter,_pkt *pkt); + +struct sta_info; +void sta_rx_reorder_ctl_dump(void *sel, struct sta_info *sta); + #ifdef CONFIG_PROC_DEBUG ssize_t proc_set_write_reg(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); int proc_get_read_reg(struct seq_file *m, void *v); @@ -346,14 +364,26 @@ ssize_t proc_set_roam_tgt_addr(struct file *file, const char __user *buffer, siz int proc_get_qos_option(struct seq_file *m, void *v); int proc_get_ht_option(struct seq_file *m, void *v); int proc_get_rf_info(struct seq_file *m, void *v); +int proc_get_survey_info(struct seq_file *m, void *v); int proc_get_ap_info(struct seq_file *m, void *v); int proc_get_adapter_state(struct seq_file *m, void *v); +ssize_t proc_reset_trx_info(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); int proc_get_trx_info(struct seq_file *m, void *v); int proc_get_rate_ctl(struct seq_file *m, void *v); +int proc_get_wifi_spec(struct seq_file *m, void *v); ssize_t proc_set_rate_ctl(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); +#ifdef DBG_RX_COUNTER_DUMP +int proc_get_rx_cnt_dump(struct seq_file *m, void *v); +ssize_t proc_set_rx_cnt_dump(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); +#endif +int proc_get_dis_pwt(struct seq_file *m, void *v); +ssize_t proc_set_dis_pwt(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); + int proc_get_suspend_resume_info(struct seq_file *m, void *v); ssize_t proc_set_fwdl_test_case(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); +ssize_t proc_set_del_rx_ampdu_test_case(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); +ssize_t proc_set_wait_hiq_empty(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); #ifdef CONFIG_AP_MODE int proc_get_all_sta_info(struct seq_file *m, void *v); @@ -370,6 +400,7 @@ ssize_t proc_set_best_channel(struct file *file, const char __user *buffer, size int proc_get_rx_signal(struct seq_file *m, void *v); ssize_t proc_set_rx_signal(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); +int proc_get_hw_status(struct seq_file *m, void *v); #ifdef CONFIG_80211N_HT int proc_get_ht_enable(struct seq_file *m, void *v); @@ -386,14 +417,24 @@ ssize_t proc_set_rx_ampdu(struct file *file, const char __user *buffer, size_t c int proc_get_rx_stbc(struct seq_file *m, void *v); ssize_t proc_set_rx_stbc(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); + + +int proc_get_rx_ampdu_factor(struct seq_file *m, void *v); +ssize_t proc_set_rx_ampdu_factor(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); + +int proc_get_rx_ampdu_density(struct seq_file *m, void *v); +ssize_t proc_set_rx_ampdu_density(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); + +int proc_get_tx_ampdu_density(struct seq_file *m, void *v); +ssize_t proc_set_tx_ampdu_density(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); #endif /* CONFIG_80211N_HT */ int proc_get_en_fwps(struct seq_file *m, void *v); ssize_t proc_set_en_fwps(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); -int proc_get_two_path_rssi(struct seq_file *m, void *v); -int proc_get_rssi_disp(struct seq_file *m, void *v); -ssize_t proc_set_rssi_disp(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); +//int proc_get_two_path_rssi(struct seq_file *m, void *v); +//int proc_get_rssi_disp(struct seq_file *m, void *v); +//ssize_t proc_set_rssi_disp(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); #ifdef CONFIG_BT_COEXIST int proc_get_btcoex_dbg(struct seq_file *m, void *v); @@ -414,6 +455,35 @@ ssize_t proc_set_odm_dbg_level(struct file *file, const char __user *buffer, siz int proc_get_odm_adaptivity(struct seq_file *m, void *v); ssize_t proc_set_odm_adaptivity(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); +#ifdef CONFIG_DBG_COUNTER +int proc_get_rx_logs(struct seq_file *m, void *v); +int proc_get_tx_logs(struct seq_file *m, void *v); +int proc_get_int_logs(struct seq_file *m, void *v); +#endif + +#ifdef CONFIG_PCI_HCI +int proc_get_rx_ring(struct seq_file *m, void *v); +int proc_get_tx_ring(struct seq_file *m, void *v); +#endif + +#ifdef CONFIG_P2P_WOWLAN +int proc_get_p2p_wowlan_info(struct seq_file *m, void *v); +#endif /* CONFIG_P2P_WOWLAN */ + +int proc_get_new_bcn_max(struct seq_file *m, void *v); +ssize_t proc_set_new_bcn_max(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); + +#ifdef CONFIG_POWER_SAVING +int proc_get_ps_info(struct seq_file *m, void *v); +#endif //CONFIG_POWER_SAVING + +#ifdef CONFIG_TDLS +int proc_get_tdls_info(struct seq_file *m, void *v); +#endif + +int proc_get_monitor(struct seq_file *m, void *v); +ssize_t proc_set_monitor(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); + #endif /* CONFIG_PROC_DEBUG */ #endif //__RTW_DEBUG_H__ diff --git a/backports/drivers/realtek/rtl8812au/include/rtw_eeprom.h b/backports/drivers/realtek/rtl8812au/include/rtw_eeprom.h index 24eb1a06f13012..7705adc9bd5267 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtw_eeprom.h +++ b/backports/drivers/realtek/rtl8812au/include/rtw_eeprom.h @@ -121,10 +121,11 @@ struct eeprom_priv u16 CustomerID; u8 efuse_eeprom_data[EEPROM_MAX_SIZE]; //92C:256bytes, 88E:512bytes, we use union set (512bytes) + u8 adjuseVoltageVal; #ifdef CONFIG_RF_GAIN_OFFSET - u8 EEPROMRFGainOffset; - u8 EEPROMRFGainVal; + u8 EEPROMRFGainOffset; + u8 EEPROMRFGainVal; #endif //CONFIG_RF_GAIN_OFFSET #ifdef CONFIG_SDIO_HCI diff --git a/backports/drivers/realtek/rtl8812au/include/rtw_efuse.h b/backports/drivers/realtek/rtl8812au/include/rtw_efuse.h index 9dbab56fa0ca47..742802c7c0e405 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtw_efuse.h +++ b/backports/drivers/realtek/rtl8812au/include/rtw_efuse.h @@ -59,6 +59,18 @@ enum _EFUSE_DEF_TYPE { #define EFUSE_REPEAT_THRESHOLD_ 3 +#define IS_MASKED_MP(ic, txt, offset) (EFUSE_IsAddressMasked_MP_##ic##txt(offset)) +#define IS_MASKED_TC(ic, txt, offset) (EFUSE_IsAddressMasked_TC_##ic##txt(offset)) +#define GET_MASK_ARRAY_LEN_MP(ic, txt) (EFUSE_GetArrayLen_MP_##ic##txt()) +#define GET_MASK_ARRAY_LEN_TC(ic, txt) (EFUSE_GetArrayLen_TC_##ic##txt()) +#define GET_MASK_ARRAY_MP(ic, txt, offset) (EFUSE_GetMaskArray_MP_##ic##txt(offset)) +#define GET_MASK_ARRAY_TC(ic, txt, offset) (EFUSE_GetMaskArray_TC_##ic##txt(offset)) + + +#define IS_MASKED(ic, txt, offset) ( IS_MASKED_MP(ic,txt, offset) ) +#define GET_MASK_ARRAY_LEN(ic, txt) ( GET_MASK_ARRAY_LEN_MP(ic,txt) ) +#define GET_MASK_ARRAY(ic, txt, out) do { GET_MASK_ARRAY_MP(ic,txt, out);} while(0) + //============================================= // The following is for BT Efuse definition //============================================= @@ -97,6 +109,7 @@ typedef struct _EFUSE_HAL{ u8 fakeBTEfuseModifiedMap[EFUSE_BT_MAX_MAP_LEN]; }EFUSE_HAL, *PEFUSE_HAL; +extern u8 maskfileBuffer[32]; /*------------------------Export global variable----------------------------*/ extern u8 fakeEfuseBank; @@ -143,6 +156,7 @@ void EFUSE_ShadowMapUpdate(PADAPTER pAdapter, u8 efuseType, BOOLEAN bPseudoTest) void EFUSE_ShadowRead(PADAPTER pAdapter, u8 Type, u16 Offset, u32 *Value); void Rtw_Hal_ReadMACAddrFromFile(PADAPTER padapter); u32 Rtw_Hal_readPGDataFromConfigFile(PADAPTER padapter); +u8 rtw_efuse_file_read(PADAPTER padapter,u8 *filepatch,u8 *buf, u32 len); #endif diff --git a/backports/drivers/realtek/rtl8812au/include/rtw_event.h b/backports/drivers/realtek/rtl8812au/include/rtw_event.h index e2c63248d3a75c..2fb9503e89c584 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtw_event.h +++ b/backports/drivers/realtek/rtl8812au/include/rtw_event.h @@ -82,6 +82,10 @@ struct addba_event unsigned int tid; }; +struct wmm_event +{ + unsigned char wmm; +}; #ifdef CONFIG_H2CLBK struct c2hlbk_event{ diff --git a/backports/drivers/realtek/rtl8812au/include/rtw_ht.h b/backports/drivers/realtek/rtl8812au/include/rtw_ht.h index 0c4928a8db054f..84b3bfb134435c 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtw_ht.h +++ b/backports/drivers/realtek/rtl8812au/include/rtw_ht.h @@ -32,6 +32,8 @@ struct ht_priv u32 tx_amsdu_maxlen; // 1: 8k, 0:4k ; default:8k, for tx u32 rx_ampdu_maxlen; //for rx reordering ctrl win_sz, updated when join_callback. + u8 rx_ampdu_min_spacing; + u8 ch_offset;//PRIME_CHNL_OFFSET u8 sgi_20m; u8 sgi_40m; @@ -91,8 +93,77 @@ typedef enum _RT_HT_INF1_CAP{ #define BEAMFORMING_HT_BEAMFORMEE_ENABLE BIT1 // Declare our NIC supports beamformee #define BEAMFORMING_HT_BEAMFORMER_TEST BIT2 // Transmiting Beamforming no matter the target supports it or not -#define SET_EXT_CAPABILITY_ELE_BSS_COEXIST(_pEleStart, _val) SET_BITS_TO_LE_1BYTE((_pEleStart), 0, 1, _val) -#define GET_EXT_CAPABILITY_ELE_BSS_COEXIST(_pEleStart) LE_BITS_TO_1BYTE((_pEleStart), 0, 1) +//------------------------------------------------------------ +// The HT Control field +//------------------------------------------------------------ +#define SET_HT_CTRL_CSI_STEERING(_pEleStart, _val) SET_BITS_TO_LE_1BYTE(((u8*)(_pEleStart))+2, 6, 2, _val) +#define SET_HT_CTRL_NDP_ANNOUNCEMENT(_pEleStart, _val) SET_BITS_TO_LE_1BYTE(((u8*)(_pEleStart))+3, 0, 1, _val) +#define GET_HT_CTRL_NDP_ANNOUNCEMENT(_pEleStart) LE_BITS_TO_1BYTE(((u8*)(_pEleStart))+3, 0, 1) + +// 20/40 BSS Coexist +#define SET_EXT_CAPABILITY_ELE_BSS_COEXIST(_pEleStart, _val) SET_BITS_TO_LE_1BYTE(((u8*)(_pEleStart)), 0, 1, _val) +#define GET_EXT_CAPABILITY_ELE_BSS_COEXIST(_pEleStart) LE_BITS_TO_1BYTE(((u8*)(_pEleStart)), 0, 1) + +/* HT Capabilities Info field */ +#define HT_CAP_ELE_CAP_INFO(_pEleStart) ((u8*)(_pEleStart)) +#define GET_HT_CAP_ELE_LDPC_CAP(_pEleStart) LE_BITS_TO_1BYTE(((u8*)(_pEleStart)), 0, 1) +#define GET_HT_CAP_ELE_CHL_WIDTH(_pEleStart) LE_BITS_TO_1BYTE(((u8*)(_pEleStart)), 1, 1) +#define GET_HT_CAP_ELE_SM_PS(_pEleStart) LE_BITS_TO_1BYTE(((u8*)(_pEleStart)), 2, 2) +#define GET_HT_CAP_ELE_GREENFIELD(_pEleStart) LE_BITS_TO_1BYTE(((u8*)(_pEleStart)), 4, 1) +#define GET_HT_CAP_ELE_SHORT_GI20M(_pEleStart) LE_BITS_TO_1BYTE(((u8*)(_pEleStart)), 5, 1) +#define GET_HT_CAP_ELE_SHORT_GI40M(_pEleStart) LE_BITS_TO_1BYTE(((u8*)(_pEleStart)), 6, 1) +#define GET_HT_CAP_ELE_TX_STBC(_pEleStart) LE_BITS_TO_1BYTE(((u8*)(_pEleStart)), 7, 1) +#define GET_HT_CAP_ELE_RX_STBC(_pEleStart) LE_BITS_TO_1BYTE(((u8*)(_pEleStart))+1, 0, 2) +#define GET_HT_CAP_ELE_DELAYED_BA(_pEleStart) LE_BITS_TO_1BYTE(((u8*)(_pEleStart))+1, 2, 1) +#define GET_HT_CAP_ELE_MAX_AMSDU_LENGTH(_pEleStart) LE_BITS_TO_1BYTE(((u8*)(_pEleStart))+1, 3, 1) +#define GET_HT_CAP_ELE_DSSS_CCK_40M(_pEleStart) LE_BITS_TO_1BYTE(((u8*)(_pEleStart))+1, 4, 1) +#define GET_HT_CAP_ELE_FORTY_INTOLERANT(_pEleStart) LE_BITS_TO_1BYTE(((u8*)(_pEleStart))+1, 6, 1) +#define GET_HT_CAP_ELE_LSIG_TXOP_PROTECT(_pEleStart) LE_BITS_TO_1BYTE(((u8*)(_pEleStart))+1, 7, 1) + +#define SET_HT_CAP_ELE_FORTY_INTOLERANT(_pEleStart, _val) SET_BITS_TO_LE_1BYTE(((u8*)(_pEleStart))+1, 6, 1, _val) + +/* A-MPDU Parameters field */ +#define HT_CAP_ELE_AMPDU_PARA(_pEleStart) (((u8*)(_pEleStart))+2) +#define GET_HT_CAP_ELE_MAX_AMPDU_LEN_EXP(_pEleStart) LE_BITS_TO_1BYTE(((u8*)(_pEleStart))+2, 0, 2) +#define GET_HT_CAP_ELE_MIN_MPDU_S_SPACE(_pEleStart) LE_BITS_TO_1BYTE(((u8*)(_pEleStart))+2, 2, 3) + +#define HT_AMPDU_PARA_FMT "%02x " \ + "MAX AMPDU len:%u bytes, MIN MPDU Start Spacing:%u" + +#define HT_AMPDU_PARA_ARG(x) \ + *((u8*)(x)) \ + , (1 << (13+GET_HT_CAP_ELE_MAX_AMPDU_LEN_EXP(((u8*)x)-2)))-1 \ + , GET_HT_CAP_ELE_MIN_MPDU_S_SPACE(((u8*)x)-2) + +/* Supported MCS Set field */ +#define HT_CAP_ELE_SUP_MCS_SET(_pEleStart) (((u8*)(_pEleStart))+3) +#define HT_CAP_ELE_RX_MCS_MAP(_pEleStart) HT_CAP_ELE_SUP_MCS_SET(_pEleStart) +#define GET_HT_CAP_ELE_RX_HIGHEST_DATA_RATE(_pEleStart) LE_BITS_TO_2BYTE(((u8*)(_pEleStart))+13, 0, 10) +#define GET_HT_CAP_ELE_TX_MCS_DEF(_pEleStart) LE_BITS_TO_1BYTE(((u8*)(_pEleStart))+15, 0, 1) +#define GET_HT_CAP_ELE_TRX_MCS_NEQ(_pEleStart) LE_BITS_TO_1BYTE(((u8*)(_pEleStart))+15, 1, 1) +#define GET_HT_CAP_ELE_TX_MAX_SS(_pEleStart) LE_BITS_TO_1BYTE(((u8*)(_pEleStart))+15, 2, 2) +#define GET_HT_CAP_ELE_TX_UEQM(_pEleStart) LE_BITS_TO_1BYTE(((u8*)(_pEleStart))+15, 4, 1) + +#define HT_SUP_MCS_SET_FMT "%02x %02x %02x %02x %02x%02x%02x%02x%02x%02x" \ + /* "\n%02x%02x%02x%02x%02x%02x" */\ + " %uMbps %s%s%s" +#define HT_SUP_MCS_SET_ARG(x) ((u8*)(x))[0],((u8*)(x))[1],((u8*)(x))[2],((u8*)(x))[3],((u8*)(x))[4],((u8*)(x))[5], \ + ((u8*)(x))[6],((u8*)(x))[7],((u8*)(x))[8],((u8*)(x))[9] \ + /*,((u8*)(x))[10],((u8*)(x))[11], ((u8*)(x))[12],((u8*)(x))[13],((u8*)(x))[14],((u8*)(x))[15] */\ + , GET_HT_CAP_ELE_RX_HIGHEST_DATA_RATE(((u8*)x)-3) \ + , GET_HT_CAP_ELE_TX_MCS_DEF(((u8*)x)-3) ? "TX_MCS_DEF " : "" \ + , GET_HT_CAP_ELE_TRX_MCS_NEQ(((u8*)x)-3) ? "TRX_MCS_NEQ " : "" \ + , GET_HT_CAP_ELE_TX_UEQM(((u8*)x)-3) ? "TX_UEQM " : "" + +//TXBF Capabilities +#define SET_HT_CAP_TXBF_RECEIVE_NDP_CAP(_pEleStart, _val) SET_BITS_TO_LE_4BYTE( ((u8*)(_pEleStart))+21, 3, 1, ((u8)_val) ) +#define SET_HT_CAP_TXBF_TRANSMIT_NDP_CAP(_pEleStart, _val) SET_BITS_TO_LE_4BYTE( ((u8*)(_pEleStart))+21, 4, 1, ((u8)_val) ) +#define SET_HT_CAP_TXBF_EXPLICIT_COMP_STEERING_CAP(_pEleStart, _val) SET_BITS_TO_LE_4BYTE( ((u8*)(_pEleStart))+21, 10, 1, ((u8)_val) ) +#define SET_HT_CAP_TXBF_EXPLICIT_COMP_FEEDBACK_CAP(_pEleStart, _val) SET_BITS_TO_LE_4BYTE( ((u8*)(_pEleStart))+21, 15, 2, ((u8)_val) ) +#define SET_HT_CAP_TXBF_COMP_STEERING_NUM_ANTENNAS(_pEleStart, _val) SET_BITS_TO_LE_4BYTE( ((u8 *)(_pEleStart))+21, 23, 2, ((u8)_val) ) + +#define GET_HT_CAP_TXBF_EXPLICIT_COMP_STEERING_CAP(_pEleStart) LE_BITS_TO_4BYTE(((u8*)(_pEleStart))+21, 10, 1) +#define GET_HT_CAP_TXBF_EXPLICIT_COMP_FEEDBACK_CAP(_pEleStart) LE_BITS_TO_4BYTE(((u8*)(_pEleStart))+21, 15, 2) #endif //_RTL871X_HT_H_ diff --git a/backports/drivers/realtek/rtl8812au/include/rtw_io.h b/backports/drivers/realtek/rtl8812au/include/rtw_io.h index 10b21477426ee8..bad0acc5f4d912 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtw_io.h +++ b/backports/drivers/realtek/rtl8812au/include/rtw_io.h @@ -312,6 +312,11 @@ struct reg_protocol_wt { #define MAX_CONTINUAL_IO_ERR SD_IO_TRY_CNT #endif +#ifdef CONFIG_GSPI_HCI +#define SD_IO_TRY_CNT (8) +#define MAX_CONTINUAL_IO_ERR SD_IO_TRY_CNT +#endif + int rtw_inc_and_chk_continual_io_error(struct dvobj_priv *dvobj); void rtw_reset_continual_io_error(struct dvobj_priv *dvobj); diff --git a/backports/drivers/realtek/rtl8812au/include/rtw_mem.h b/backports/drivers/realtek/rtl8812au/include/rtw_mem.h new file mode 100644 index 00000000000000..5283d777827f06 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/include/rtw_mem.h @@ -0,0 +1,38 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ +#ifndef __RTW_MEM_H__ +#define __RTW_MEM_H__ + +#include +#include +#include + + +#ifndef MAX_RECVBUF_SZ +#define MAX_RECVBUF_SZ (32768-RECVBUFF_ALIGN_SZ) // 32k +#endif + +struct u8* rtw_alloc_revcbuf_premem(void); +struct sk_buff *rtw_alloc_skb_premem(void); +int rtw_free_skb_premem(struct sk_buff *pskb); + + +#endif //__RTW_MEM_H__ + diff --git a/backports/drivers/realtek/rtl8812au/include/rtw_mlme.h b/backports/drivers/realtek/rtl8812au/include/rtw_mlme.h index 062b239ac541c0..05465d37829f35 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtw_mlme.h +++ b/backports/drivers/realtek/rtl8812au/include/rtw_mlme.h @@ -30,6 +30,10 @@ // Increase the scanning timeout because of increasing the SURVEY_TO value. #define SCANNING_TIMEOUT 8000 +#ifdef CONFIG_STA_MODE_SCAN_UNDER_AP_MODE +#define CONC_SCANNING_TIMEOUT_SINGLE_BAND 10000 +#define CONC_SCANNING_TIMEOUT_DUAL_BAND 15000 +#endif //CONFIG_STA_MODE_SCAN_UNDER_AP_MODE #ifdef PALTFORM_OS_WINCE #define SCANQUEUE_LIFETIME 12000000 // unit:us @@ -60,6 +64,7 @@ #define WIFI_AUTOCONF 0x00004000 #define WIFI_AUTOCONF_IND 0x00008000 #endif +#define WIFI_MONITOR_STATE 0x80000000 /* // ========== P2P Section Start =============== @@ -254,12 +259,33 @@ struct cfg80211_wifidirect_info{ struct ieee80211_channel remain_on_ch_channel; enum nl80211_channel_type remain_on_ch_type; u64 remain_on_ch_cookie; + bool not_indic_ro_ch_exp; bool is_ro_ch; u32 last_ro_ch_time; /* this will be updated at the beginning and end of ro_ch */ - u8 chk_invite_ch_list; }; #endif //CONFIG_IOCTL_CFG80211 +#ifdef CONFIG_P2P_WOWLAN + +enum P2P_WOWLAN_RECV_FRAME_TYPE +{ + P2P_WOWLAN_RECV_NEGO_REQ = 0, + P2P_WOWLAN_RECV_INVITE_REQ = 1, + P2P_WOWLAN_RECV_PROVISION_REQ = 2, +}; + +struct p2p_wowlan_info{ + + u8 is_trigger; + enum P2P_WOWLAN_RECV_FRAME_TYPE wowlan_recv_frame_type; + u8 wowlan_peer_addr[ETH_ALEN]; + u16 wowlan_peer_wpsconfig; + u8 wowlan_peer_is_persistent; + u8 wowlan_peer_invitation_type; +}; + +#endif //CONFIG_P2P_WOWLAN + struct wifidirect_info{ _adapter* padapter; _timer find_phase_timer; @@ -285,6 +311,11 @@ struct wifidirect_info{ #ifdef CONFIG_WFD struct wifi_display_info *wfd_info; #endif + +#ifdef CONFIG_P2P_WOWLAN + struct p2p_wowlan_info p2p_wow_info; +#endif //CONFIG_P2P_WOWLAN + enum P2P_ROLE role; enum P2P_STATE pre_p2p_state; enum P2P_STATE p2p_state; @@ -364,22 +395,46 @@ struct tdls_ss_record{ //signal strength record u8 is_tdls_sta; // _TRUE: direct link sta, _FALSE: else }; +struct tdls_temp_mgmt{ + u8 initiator; // 0: None, 1: we initiate, 2: peer initiate + u8 peer_addr[ETH_ALEN]; +}; + +#ifdef CONFIG_TDLS_CH_SW +struct tdls_ch_switch{ + u32 ch_sw_state; + ATOMIC_T chsw_on; + u8 addr[ETH_ALEN]; + u8 off_ch_num; + u8 ch_offset; + u32 cur_time; + u8 delay_switch_back; + u8 dump_stack; +}; +#endif + struct tdls_info{ u8 ap_prohibited; + u8 ch_switch_prohibited; u8 link_established; u8 sta_cnt; - u8 sta_maximum; // 1:tdls sta is equal (NUM_STA-1), reach max direct link number; 0: else; + u8 sta_maximum; /* 1:tdls sta is equal (NUM_STA-1), reach max direct link number; 0: else; */ struct tdls_ss_record ss_record; +#ifdef CONFIG_TDLS_CH_SW + struct tdls_ch_switch chsw_info; +#endif + u8 ch_sensing; u8 cur_channel; - u8 candidate_ch; u8 collect_pkt_num[MAX_CHANNEL_NUM]; _lock cmd_lock; _lock hdl_lock; u8 watchdog_count; - u8 dev_discovered; //WFD_TDLS: for sigma test + u8 dev_discovered; /* WFD_TDLS: for sigma test */ u8 tdls_enable; - u8 external_setup; // _TRUE: setup is handled by wpa_supplicant + + /* Let wpa_supplicant to setup*/ + u8 driver_setup; #ifdef CONFIG_WFD struct wifi_display_info *wfd_info; #endif @@ -392,7 +447,6 @@ struct tdls_txmgmt { u16 status_code; u8 *buf; size_t len; - u8 external_support; }; /* used for mlme_priv.roam_flags */ @@ -402,6 +456,18 @@ enum { RTW_ROAM_ACTIVE = BIT2, }; +struct beacon_keys { + u8 ssid[IW_ESSID_MAX_SIZE]; + u32 ssid_len; + u8 bcn_channel; + u16 ht_cap_info; + u8 ht_info_infos_0_sco; // bit0 & bit1 in infos[0] is second channel offset + int encryp_protocol; + int pairwise_cipher; + int group_cipher; + int is_8021x; +}; + struct mlme_priv { _lock lock; @@ -432,6 +498,12 @@ struct mlme_priv { struct wlan_network cur_network; struct wlan_network *cur_network_scanned; + + // bcn check info + struct beacon_keys cur_beacon_keys; // save current beacon keys + struct beacon_keys new_beacon_keys; // save new beacon keys + u8 new_beacon_cnts; // if new_beacon_cnts >= threshold, ap beacon is changed + #ifdef CONFIG_ARP_KEEP_ALIVE // for arp offload keep alive u8 gw_mac_addr[6]; @@ -620,8 +692,16 @@ struct mlme_priv { u8 scanning_via_buddy_intf; #endif +// u8 NumOfBcnInfoChkFail; +// u32 timeBcnInfoChkStart; }; +#define mlme_set_scan_to_timer(mlme, ms) \ + do { \ + /* DBG_871X("%s set_scan_to_timer(%p, %d)\n", __FUNCTION__, (mlme), (ms)); */ \ + _set_timer(&(mlme)->scan_to_timer, (ms)); \ + } while(0) + #define rtw_mlme_set_auto_scan_int(adapter, ms) \ do { \ adapter->mlmepriv.auto_scan_int_ms = ms; \ @@ -655,6 +735,7 @@ extern void rtw_stassoc_event_callback(_adapter *adapter, u8 *pbuf); extern void rtw_stadel_event_callback(_adapter *adapter, u8 *pbuf); extern void rtw_atimdone_event_callback(_adapter *adapter, u8 *pbuf); extern void rtw_cpwm_event_callback(_adapter *adapter, u8 *pbuf); +extern void rtw_wmm_event_callback(PADAPTER padapter, u8 *pbuf); extern void rtw_join_timeout_handler(RTW_TIMER_HDL_ARGS); extern void _rtw_scan_timeout_handler(RTW_TIMER_HDL_ARGS); diff --git a/backports/drivers/realtek/rtl8812au/include/rtw_mlme_ext.h b/backports/drivers/realtek/rtl8812au/include/rtw_mlme_ext.h index 4bd0c8a7f88259..d3cc4f940a9ddc 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtw_mlme_ext.h +++ b/backports/drivers/realtek/rtl8812au/include/rtw_mlme_ext.h @@ -89,6 +89,7 @@ #define _HW_STATE_ADHOC_ 0x01 #define _HW_STATE_STATION_ 0x02 #define _HW_STATE_AP_ 0x03 +#define _HW_STATE_MONITOR_ 0x04 #define _1M_RATE_ 0 @@ -104,6 +105,15 @@ #define _48M_RATE_ 10 #define _54M_RATE_ 11 +/******************************************************** +MCS rate definitions +*********************************************************/ +#define MCS_RATE_1R (0x000000ff) +#define MCS_RATE_2R (0x0000ffff) +#define MCS_RATE_3R (0x00ffffff) +#define MCS_RATE_4R (0xffffffff) +#define MCS_RATE_2R_13TO15_OFF (0x00001fff) + extern unsigned char RTW_WPA_OUI[]; extern unsigned char WMM_OUI[]; @@ -187,6 +197,7 @@ typedef enum _RT_CHANNEL_DOMAIN RT_CHANNEL_DOMAIN_FCC1_FCC9 = 0x55, RT_CHANNEL_DOMAIN_WORLD_ETSI13 = 0x56, RT_CHANNEL_DOMAIN_FCC1_FCC10 = 0x57, + RT_CHANNEL_DOMAIN_WORLD_MKK4 = 0x58, //===== Add new channel plan above this line===============// RT_CHANNEL_DOMAIN_MAX, RT_CHANNEL_DOMAIN_REALTEK_DEFINE = 0x7F, @@ -239,11 +250,15 @@ typedef enum _RT_CHANNEL_DOMAIN_5G RT_CHANNEL_DOMAIN_5G_FCC9 = 0x1D, //(w/o Weather radar) RT_CHANNEL_DOMAIN_5G_ETSI13 = 0x1E, //(w/o Weather radar) RT_CHANNEL_DOMAIN_5G_FCC10 = 0x1F, //Argentina (w/o Weather radar) + RT_CHANNEL_DOMAIN_5G_KCC2 = 0x20, //Korea 5G + RT_CHANNEL_DOMAIN_5G_FCC11 = 0x21, //US/Canada + RT_CHANNEL_DOMAIN_5G_NCC5 = 0x22, //Taiwan + RT_CHANNEL_DOMAIN_5G_MKK4 = 0x23, //Japan W52 //===== Add new channel plan above this line===============// //===== Driver Self Defined =====// - RT_CHANNEL_DOMAIN_5G_FCC = 0x20, - RT_CHANNEL_DOMAIN_5G_JAPAN_NO_DFS = 0x21, - RT_CHANNEL_DOMAIN_5G_FCC4_NO_DFS = 0x22, + RT_CHANNEL_DOMAIN_5G_FCC = 0x30, + RT_CHANNEL_DOMAIN_5G_JAPAN_NO_DFS = 0x31, + RT_CHANNEL_DOMAIN_5G_FCC4_NO_DFS = 0x32, RT_CHANNEL_DOMAIN_5G_MAX, }RT_CHANNEL_DOMAIN_5G, *PRT_CHANNEL_DOMAIN_5G; @@ -364,30 +379,15 @@ struct ss_res #define WIFI_FW_LINKING_STATE (WIFI_FW_AUTH_NULL | WIFI_FW_AUTH_STATE | WIFI_FW_AUTH_SUCCESS |WIFI_FW_ASSOC_STATE) #ifdef CONFIG_TDLS -// 1: Write RCR DATA BIT -// 2: Issue peer traffic indication -// 3: Go back to the channel linked with AP, terminating channel switch procedure -// 4: Init channel sensing, receive all data and mgnt frame -// 5: Channel sensing and report candidate channel -// 6: First time set channel to off channel -// 7: Go back tp the channel linked with AP when set base channel as target channel -// 8: Set channel back to base channel -// 9: Set channel back to off channel -// 10: Restore RCR DATA BIT -// 11: Free TDLS sta enum TDLS_option { TDLS_ESTABLISHED = 1, - TDLS_SD_PTI = 2, - TDLS_CS_OFF = 3, - TDLS_INIT_CH_SEN = 4, - TDLS_DONE_CH_SEN = 5, - TDLS_OFF_CH = 6, - TDLS_BASE_CH = 7, - TDLS_P_OFF_CH = 8, - TDLS_P_BASE_CH = 9, - TDLS_RS_RCR = 10, - TDLS_TEAR_STA = 11, + TDLS_ISSUE_PTI = 2, + TDLS_CH_SW_RESP = 3, + TDLS_CH_SW = 4, + TDLS_CH_SW_BACK = 5, + TDLS_RS_RCR = 6, + TDLS_TEAR_STA = 7, maxTDLS, }; @@ -553,6 +553,9 @@ struct mlme_ext_priv struct p2p_channels channel_list; unsigned char basicrate[NumRates]; unsigned char datarate[NumRates]; +#ifdef CONFIG_80211N_HT + unsigned char default_supported_mcs_set[16]; +#endif struct ss_res sitesurvey_res; struct mlme_ext_info mlmext_info;//for sta/adhoc mode, including current scanning/connecting/connected related info. @@ -600,6 +603,9 @@ struct mlme_ext_priv }; +#define mlmeext_msr(mlmeext) ((mlmeext)->mlmext_info.state & 0x03) + +void init_mlme_default_rate_set(_adapter* padapter); int init_mlme_ext_priv(_adapter* padapter); int init_hw_mlme_ext(_adapter *padapter); void free_mlme_ext_priv (struct mlme_ext_priv *pmlmeext); @@ -615,6 +621,7 @@ unsigned char networktype_to_raid_ex(_adapter *adapter, struct sta_info *psta); u8 judge_network_type(_adapter *padapter, unsigned char *rate, int ratelen); void get_rate_set(_adapter *padapter, unsigned char *pbssrate, int *bssrate_len); +void set_mcs_rate_by_mask(u8 *mcs_set, u32 mask); void UpdateBrateTbl(_adapter *padapter,u8 *mBratesOS); void UpdateBrateTblForSoftAP(u8 *bssrateset, u32 bssratelen); void change_band_update_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork); @@ -646,9 +653,20 @@ void SetBWMode(_adapter *padapter, unsigned short bwmode, unsigned char channel_ unsigned int decide_wait_for_beacon_timeout(unsigned int bcn_interval); void read_cam(_adapter *padapter ,u8 entry, u8 *get_key); +void dump_cam_table(_adapter *padapter); + +/* modify HW only */ +void _write_cam(_adapter *padapter, u8 entry, u16 ctrl, u8 *mac, u8 *key); +void _clear_cam_entry(_adapter *padapter, u8 entry); +void write_cam_from_cache(_adapter *adapter, u8 id); -void write_cam(_adapter *padapter, u8 entry, u16 ctrl, u8 *mac, u8 *key); -void clear_cam_entry(_adapter *padapter, u8 entry); +/* modify both HW and cache */ +void write_cam(_adapter *padapter, u8 id, u16 ctrl, u8 *mac, u8 *key); +void clear_cam_entry(_adapter *padapter, u8 id); + +/* modify cache only */ +void write_cam_cache(_adapter *adapter, u8 id, u16 ctrl, u8 *mac, u8 *key); +void clear_cam_cache(_adapter *adapter, u8 id); void invalidate_cam_all(_adapter *padapter); void CAM_empty_entry(PADAPTER Adapter, u8 ucIndex); @@ -685,9 +703,13 @@ void HTOnAssocRsp(_adapter *padapter); void ERP_IE_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE); void VCS_update(_adapter *padapter, struct sta_info *psta); +void update_ldpc_stbc_cap(struct sta_info *psta); -void update_beacon_info(_adapter *padapter, u8 *pframe, uint len, struct sta_info *psta); +int rtw_get_bcn_keys(ADAPTER *Adapter, u8 *pframe, u32 packet_len, + struct beacon_keys *recv_beacon); +void rtw_dump_bcn_keys(struct beacon_keys *recv_beacon); int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len); +void update_beacon_info(_adapter *padapter, u8 *pframe, uint len, struct sta_info *psta); #ifdef CONFIG_DFS void process_csa_ie(_adapter *padapter, u8 *pframe, uint len); #endif //CONFIG_DFS @@ -714,10 +736,26 @@ unsigned int is_ap_in_tkip(_adapter *padapter); unsigned int is_ap_in_wep(_adapter *padapter); unsigned int should_forbid_n_rate(_adapter * padapter); -extern uint rtw_get_camid(uint macid); -extern void rtw_alloc_macid(_adapter *padapter, struct sta_info *psta); -extern void rtw_release_macid(_adapter *padapter, struct sta_info *psta); -extern u8 rtw_search_max_mac_id(_adapter *padapter); +s16 rtw_get_camid(_adapter *adapter, struct sta_info* sta, s16 kid); +s16 rtw_camid_search(_adapter *adapter, u8 *addr, s16 kid); +s16 rtw_camid_alloc(_adapter *adapter, struct sta_info *sta, u8 kid); +void rtw_camid_free(_adapter *adapter, u8 cam_id); +bool rtw_camid_is_gk(_adapter *padapter, u8 entry); +bool read_phy_cam_is_gtk(_adapter *padapter, u8 entry); + +struct macid_bmp; +struct macid_ctl_t; +void dump_macid_map(void *sel, struct macid_bmp *map, u8 max_num); +bool rtw_macid_is_set(struct macid_bmp *map, u8 id); +bool rtw_macid_is_used(struct macid_ctl_t *macid_ctl, u8 id); +bool rtw_macid_is_bmc(struct macid_ctl_t *macid_ctl, u8 id); +s8 rtw_macid_get_if_g(struct macid_ctl_t *macid_ctl, u8 id); +s8 rtw_macid_get_ch_g(struct macid_ctl_t *macid_ctl, u8 id); +void rtw_alloc_macid(_adapter *padapter, struct sta_info *psta); +void rtw_release_macid(_adapter *padapter, struct sta_info *psta); +u8 rtw_search_max_mac_id(_adapter *padapter); +void rtw_macid_ctl_init(struct macid_ctl_t *macid_ctl); +void rtw_macid_ctl_deinit(struct macid_ctl_t *macid_ctl); void report_join_res(_adapter *padapter, int res); void report_survey_event(_adapter *padapter, union recv_frame *precv_frame); @@ -725,8 +763,10 @@ void report_surveydone_event(_adapter *padapter); void report_del_sta_event(_adapter *padapter, unsigned char* MacAddr, unsigned short reason); void report_add_sta_event(_adapter *padapter, unsigned char* MacAddr, int cam_idx); bool rtw_port_switch_chk(_adapter *adapter); +void report_wmm_edca_update(_adapter *padapter); void beacon_timing_control(_adapter *padapter); +u8 chk_bmc_sleepq_cmd(_adapter* padapter); extern u8 set_tx_beacon_cmd(_adapter*padapter); unsigned int setup_beacon_frame(_adapter *padapter, unsigned char *beacon_frame); void update_mgnt_tx_rate(_adapter *padapter, u8 rate); @@ -753,15 +793,25 @@ void issue_auth(_adapter *padapter, struct sta_info *psta, unsigned short status void issue_probereq(_adapter *padapter, NDIS_802_11_SSID *pssid, u8 *da); s32 issue_probereq_ex(_adapter *padapter, NDIS_802_11_SSID *pssid, u8* da, u8 ch, bool append_wps, int try_cnt, int wait_ms); int issue_nulldata(_adapter *padapter, unsigned char *da, unsigned int power_mode, int try_cnt, int wait_ms); -s32 issue_nulldata_in_interrupt(PADAPTER padapter, u8 *da); +s32 issue_nulldata_in_interrupt(PADAPTER padapter, u8 *da, unsigned int power_mode); int issue_qos_nulldata(_adapter *padapter, unsigned char *da, u16 tid, int try_cnt, int wait_ms); int issue_deauth(_adapter *padapter, unsigned char *da, unsigned short reason); int issue_deauth_ex(_adapter *padapter, u8 *da, unsigned short reason, int try_cnt, int wait_ms); void issue_action_spct_ch_switch(_adapter *padapter, u8 *ra, u8 new_ch, u8 ch_offset); -void issue_action_BA(_adapter *padapter, unsigned char *raddr, unsigned char action, unsigned short status); +void issue_addba_req(_adapter *adapter, unsigned char *ra, u8 tid); +void issue_addba_rsp(_adapter *adapter, unsigned char *ra, u8 tid, u16 status, u8 size); +void issue_del_ba(_adapter *adapter, unsigned char *ra, u8 tid, u16 reason, u8 initiator); +int issue_del_ba_ex(_adapter *adapter, unsigned char *ra, u8 tid, u16 reason, u8 initiator, int try_cnt, int wait_ms); + #ifdef CONFIG_IEEE80211W void issue_action_SA_Query(_adapter *padapter, unsigned char *raddr, unsigned char action, unsigned short tid); #endif //CONFIG_IEEE80211W +int issue_action_SM_PS(_adapter *padapter , unsigned char *raddr , u8 NewMimoPsMode); +int issue_action_SM_PS_wait_ack(_adapter *padapter, unsigned char *raddr, u8 NewMimoPsMode, int try_cnt, int wait_ms); + +unsigned int send_delba_sta_tid(_adapter *adapter, u8 initiator, struct sta_info *sta, u8 tid, u8 force); +unsigned int send_delba_sta_tid_wait_ack(_adapter *adapter, u8 initiator, struct sta_info *sta, u8 tid, u8 force); + unsigned int send_delba(_adapter *padapter, u8 initiator, u8 *addr); unsigned int send_beacon(_adapter *padapter); @@ -786,6 +836,22 @@ unsigned int OnAction(_adapter *padapter, union recv_frame *precv_frame); unsigned int on_action_spct(_adapter *padapter, union recv_frame *precv_frame); unsigned int OnAction_qos(_adapter *padapter, union recv_frame *precv_frame); unsigned int OnAction_dls(_adapter *padapter, union recv_frame *precv_frame); + +#define RX_AMPDU_ACCEPT_INVALID 0xFF +#define RX_AMPDU_SIZE_INVALID 0xFF + +enum rx_ampdu_reason { + RX_AMPDU_DRV_FIXED = 1, + RX_AMPDU_BTCOEX = 2, /* not used, because BTCOEX has its own variable management */ +}; +u8 rtw_rx_ampdu_size(_adapter *adapter); +bool rtw_rx_ampdu_is_accept(_adapter *adapter); +bool rtw_rx_ampdu_set_size(_adapter *adapter, u8 size, u8 reason); +bool rtw_rx_ampdu_set_accept(_adapter *adapter, u8 accept, u8 reason); +u8 rx_ampdu_apply_sta_tid(_adapter *adapter, struct sta_info *sta, u8 tid, u8 accept, u8 size); +u8 rx_ampdu_apply_sta(_adapter *adapter, struct sta_info *sta, u8 accept, u8 size); +u16 rtw_rx_ampdu_apply(_adapter *adapter); + unsigned int OnAction_back(_adapter *padapter, union recv_frame *precv_frame); unsigned int on_action_public(_adapter *padapter, union recv_frame *precv_frame); unsigned int OnAction_ht(_adapter *padapter, union recv_frame *precv_frame); @@ -801,7 +867,7 @@ void mlmeext_joinbss_event_callback(_adapter *padapter, int join_res); void mlmeext_sta_del_event_callback(_adapter *padapter); void mlmeext_sta_add_event_callback(_adapter *padapter, struct sta_info *psta); -void linked_status_chk(_adapter *padapter); +void linked_status_chk(_adapter *padapter, u8 from_timer); void _linked_info_dump(_adapter *padapter); @@ -842,6 +908,7 @@ extern void correct_TSF(_adapter *padapter, struct mlme_ext_priv *pmlmeext); extern void adaptive_early_32k(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len); extern u8 traffic_status_watchdog(_adapter *padapter, u8 from_timer); + #ifdef CONFIG_CONCURRENT_MODE sint check_buddy_mlmeinfo_state(_adapter *padapter, u32 state); void concurrent_chk_joinbss_done(_adapter *padapter, int join_res); @@ -894,12 +961,14 @@ u8 add_ba_hdl(_adapter *padapter, unsigned char *pbuf); u8 mlme_evt_hdl(_adapter *padapter, unsigned char *pbuf); u8 h2c_msg_hdl(_adapter *padapter, unsigned char *pbuf); +u8 chk_bmc_sleepq_hdl(_adapter *padapter, unsigned char *pbuf); u8 tx_beacon_hdl(_adapter *padapter, unsigned char *pbuf); u8 set_ch_hdl(_adapter *padapter, u8 *pbuf); u8 set_chplan_hdl(_adapter *padapter, unsigned char *pbuf); u8 led_blink_hdl(_adapter *padapter, unsigned char *pbuf); u8 set_csa_hdl(_adapter *padapter, unsigned char *pbuf); //Kurt: Handling DFS channel switch announcement ie. u8 tdls_hdl(_adapter *padapter, unsigned char *pbuf); +u8 run_in_thread_hdl(_adapter *padapter, u8 *pbuf); #define GEN_DRV_CMD_HANDLER(size, cmd) {size, &cmd ## _hdl}, @@ -975,6 +1044,8 @@ struct cmd_hdl wlancmds[] = GEN_MLME_EXT_HANDLER(sizeof(struct SetChannelSwitch_param), set_csa_hdl) /*61*/ GEN_MLME_EXT_HANDLER(sizeof(struct TDLSoption_param), tdls_hdl) /*62*/ + GEN_MLME_EXT_HANDLER(0, chk_bmc_sleepq_hdl) /*63*/ + GEN_MLME_EXT_HANDLER(sizeof(struct RunInThread_param), run_in_thread_hdl) /*64*/ }; #endif @@ -1035,6 +1106,7 @@ enum rtw_c2h_event GEN_EVT_CODE(_C2HBCN), GEN_EVT_CODE(_ReportPwrState), //filen: only for PCIE, USB GEN_EVT_CODE(_CloseRF), //filen: only for PCIE, work around ASPM + GEN_EVT_CODE(_WMM), /*25*/ MAX_C2HEVT }; @@ -1069,6 +1141,8 @@ static struct fwevent wlanevents[] = {0, NULL}, {0, &rtw_cpwm_event_callback}, {0, NULL}, + {0, &rtw_wmm_event_callback}, + }; #endif//_RTL8192C_CMD_C_ diff --git a/backports/drivers/realtek/rtl8812au/include/rtw_mp.h b/backports/drivers/realtek/rtl8812au/include/rtw_mp.h index 81678985d14f2d..8a04ce9ee96396 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtw_mp.h +++ b/backports/drivers/realtek/rtl8812au/include/rtw_mp.h @@ -53,6 +53,7 @@ #define MPT_GET_THERMAL_METER 33 #endif +#define RTWPRIV_VER_INFO 1 #define MAX_MP_XMITBUF_SZ 2048 #define NR_MP_XMITFRAME 8 @@ -347,6 +348,13 @@ enum { CTA_TEST, MP_DISABLE_BT_COEXIST, MP_PwrCtlDM, + MP_GETVER, + MP_MON, + EFUSE_MASK, + EFUSE_FILE, +#ifdef CONFIG_WOWLAN + MP_WOW_ENABLE, +#endif #ifdef CONFIG_AP_WOWLAN MP_AP_WOW_ENABLE, #endif @@ -379,7 +387,7 @@ struct mp_priv u32 rx_pktcount_filter_out; u32 rx_crcerrpktcount; u32 rx_pktloss; - + BOOLEAN rx_bindicatePkt; struct recv_stat rxstat; //RF/BB relative @@ -440,7 +448,7 @@ struct mp_priv u32 free_mp_xmitframe_cnt; BOOLEAN bSetRxBssid; BOOLEAN bTxBufCkFail; - + BOOLEAN bRTWSmbCfg; MPT_CONTEXT MptCtx; u8 *TXradomBuffer; @@ -471,14 +479,6 @@ typedef struct _MP_FIRMWARE { u8 szFwBuffer[0x8000]; #endif u32 ulFwLength; - -#ifdef CONFIG_EMBEDDED_FWIMG - u8* szBTFwBuffer; - u8 myBTFwBuffer[0x8000]; -#else - u8 szBTFwBuffer[0x8000]; -#endif - u32 ulBTFwLength; } RT_MP_FIRMWARE, *PRT_MP_FIRMWARE; @@ -568,27 +568,63 @@ typedef enum _MPT_RATE_INDEX MPT_RATE_MCS13, MPT_RATE_MCS14, MPT_RATE_MCS15, /* 27 */ + MPT_RATE_MCS16, + MPT_RATE_MCS17, // #29 + MPT_RATE_MCS18, + MPT_RATE_MCS19, + MPT_RATE_MCS20, + MPT_RATE_MCS21, + MPT_RATE_MCS22, // #34 + MPT_RATE_MCS23, + MPT_RATE_MCS24, + MPT_RATE_MCS25, + MPT_RATE_MCS26, + MPT_RATE_MCS27, // #39 + MPT_RATE_MCS28, // #40 + MPT_RATE_MCS29, // #41 + MPT_RATE_MCS30, // #42 + MPT_RATE_MCS31, // #43 /* VHT rate. Total: 20*/ - MPT_RATE_VHT1SS_MCS0 = 100,// To reserve MCS16~MCS31, the index starts from #100. - MPT_RATE_VHT1SS_MCS1, // #101 + MPT_RATE_VHT1SS_MCS0,// #44 + MPT_RATE_VHT1SS_MCS1, // # MPT_RATE_VHT1SS_MCS2, MPT_RATE_VHT1SS_MCS3, MPT_RATE_VHT1SS_MCS4, MPT_RATE_VHT1SS_MCS5, - MPT_RATE_VHT1SS_MCS6, // #106 + MPT_RATE_VHT1SS_MCS6, // # MPT_RATE_VHT1SS_MCS7, MPT_RATE_VHT1SS_MCS8, - MPT_RATE_VHT1SS_MCS9, - MPT_RATE_VHT2SS_MCS0, - MPT_RATE_VHT2SS_MCS1, // #111 + MPT_RATE_VHT1SS_MCS9, //#53 + MPT_RATE_VHT2SS_MCS0, //#54 + MPT_RATE_VHT2SS_MCS1, MPT_RATE_VHT2SS_MCS2, MPT_RATE_VHT2SS_MCS3, MPT_RATE_VHT2SS_MCS4, MPT_RATE_VHT2SS_MCS5, - MPT_RATE_VHT2SS_MCS6, // #116 + MPT_RATE_VHT2SS_MCS6, MPT_RATE_VHT2SS_MCS7, MPT_RATE_VHT2SS_MCS8, - MPT_RATE_VHT2SS_MCS9, + MPT_RATE_VHT2SS_MCS9, //#63 + MPT_RATE_VHT3SS_MCS0, + MPT_RATE_VHT3SS_MCS1, + MPT_RATE_VHT3SS_MCS2, + MPT_RATE_VHT3SS_MCS3, + MPT_RATE_VHT3SS_MCS4, + MPT_RATE_VHT3SS_MCS5, + MPT_RATE_VHT3SS_MCS6, // #126 + MPT_RATE_VHT3SS_MCS7, + MPT_RATE_VHT3SS_MCS8, + MPT_RATE_VHT3SS_MCS9, + MPT_RATE_VHT4SS_MCS0, + MPT_RATE_VHT4SS_MCS1, // #131 + MPT_RATE_VHT4SS_MCS2, + MPT_RATE_VHT4SS_MCS3, + MPT_RATE_VHT4SS_MCS4, + MPT_RATE_VHT4SS_MCS5, + MPT_RATE_VHT4SS_MCS6, // #136 + MPT_RATE_VHT4SS_MCS7, + MPT_RATE_VHT4SS_MCS8, + MPT_RATE_VHT4SS_MCS9, MPT_RATE_LAST }MPT_RATE_E, *PMPT_RATE_E; @@ -681,6 +717,9 @@ typedef enum _MPT_TXPWR_DEF{ #elif defined(CONFIG_RTL8723B) #define REG_RF_BB_GAIN_OFFSET 0x7f #define RF_GAIN_OFFSET_MASK 0xfffff +#elif defined(CONFIG_RTL8188E) + #define REG_RF_BB_GAIN_OFFSET 0x55 + #define RF_GAIN_OFFSET_MASK 0xfffff #else #define REG_RF_BB_GAIN_OFFSET 0x55 #define RF_GAIN_OFFSET_MASK 0xfffff @@ -722,72 +761,74 @@ extern void write_bbreg(_adapter *padapter, u32 addr, u32 bitmask, u32 val); extern u32 read_rfreg(PADAPTER padapter, u8 rfpath, u32 addr); extern void write_rfreg(PADAPTER padapter, u8 rfpath, u32 addr, u32 val); -extern void SetChannel(PADAPTER pAdapter); -extern void SetBandwidth(PADAPTER pAdapter); -extern int SetTxPower(PADAPTER pAdapter); -extern void SetAntennaPathPower(PADAPTER pAdapter); +void SetChannel(PADAPTER pAdapter); +void SetBandwidth(PADAPTER pAdapter); +int SetTxPower(PADAPTER pAdapter); +void SetAntennaPathPower(PADAPTER pAdapter); //extern void SetTxAGCOffset(PADAPTER pAdapter, u32 ulTxAGCOffset); -extern void SetDataRate(PADAPTER pAdapter); +void SetDataRate(PADAPTER pAdapter); -extern void SetAntenna(PADAPTER pAdapter); +void SetAntenna(PADAPTER pAdapter); //extern void SetCrystalCap(PADAPTER pAdapter); -extern s32 SetThermalMeter(PADAPTER pAdapter, u8 target_ther); -extern void GetThermalMeter(PADAPTER pAdapter, u8 *value); - -extern void SetContinuousTx(PADAPTER pAdapter, u8 bStart); -extern void SetSingleCarrierTx(PADAPTER pAdapter, u8 bStart); -extern void SetSingleToneTx(PADAPTER pAdapter, u8 bStart); -extern void SetCarrierSuppressionTx(PADAPTER pAdapter, u8 bStart); -extern void PhySetTxPowerLevel(PADAPTER pAdapter); - -extern void fill_txdesc_for_mp(PADAPTER padapter, u8 *ptxdesc); -extern void SetPacketTx(PADAPTER padapter); -extern void SetPacketRx(PADAPTER pAdapter, u8 bStartRx); - -extern void ResetPhyRxPktCount(PADAPTER pAdapter); -extern u32 GetPhyRxPktReceived(PADAPTER pAdapter); -extern u32 GetPhyRxPktCRC32Error(PADAPTER pAdapter); - -extern s32 SetPowerTracking(PADAPTER padapter, u8 enable); -extern void GetPowerTracking(PADAPTER padapter, u8 *enable); - -extern u32 mp_query_psd(PADAPTER pAdapter, u8 *data); - - -extern void Hal_SetAntenna(PADAPTER pAdapter); -extern void Hal_SetBandwidth(PADAPTER pAdapter); - -extern void Hal_SetTxPower(PADAPTER pAdapter); -extern void Hal_SetCarrierSuppressionTx(PADAPTER pAdapter, u8 bStart); -extern void Hal_SetSingleToneTx ( PADAPTER pAdapter , u8 bStart ); -extern void Hal_SetSingleCarrierTx (PADAPTER pAdapter, u8 bStart); -extern void Hal_SetContinuousTx (PADAPTER pAdapter, u8 bStart); -extern void Hal_SetBandwidth(PADAPTER pAdapter); - -extern void Hal_SetDataRate(PADAPTER pAdapter); -extern void Hal_SetChannel(PADAPTER pAdapter); -extern void Hal_SetAntennaPathPower(PADAPTER pAdapter); -extern s32 Hal_SetThermalMeter(PADAPTER pAdapter, u8 target_ther); -extern s32 Hal_SetPowerTracking(PADAPTER padapter, u8 enable); -extern void Hal_GetPowerTracking(PADAPTER padapter, u8 * enable); -extern void Hal_GetThermalMeter(PADAPTER pAdapter, u8 *value); -extern void Hal_mpt_SwitchRfSetting(PADAPTER pAdapter); -extern void Hal_MPT_CCKTxPowerAdjust(PADAPTER Adapter, BOOLEAN bInCH14); -extern void Hal_MPT_CCKTxPowerAdjustbyIndex(PADAPTER pAdapter, BOOLEAN beven); -extern void Hal_SetCCKTxPower(PADAPTER pAdapter, u8 * TxPower); -extern void Hal_SetOFDMTxPower(PADAPTER pAdapter, u8 * TxPower); -extern void Hal_TriggerRFThermalMeter(PADAPTER pAdapter); -extern u8 Hal_ReadRFThermalMeter(PADAPTER pAdapter); -extern void Hal_SetCCKContinuousTx(PADAPTER pAdapter, u8 bStart); -extern void Hal_SetOFDMContinuousTx(PADAPTER pAdapter, u8 bStart); -extern void Hal_ProSetCrystalCap (PADAPTER pAdapter , u32 CrystalCapVal); -extern void _rtw_mp_xmit_priv(struct xmit_priv *pxmitpriv); -extern void MP_PHY_SetRFPathSwitch(PADAPTER pAdapter ,BOOLEAN bMain); -extern ULONG mpt_ProQueryCalTxPower(PADAPTER pAdapter,u8 RfPath); -extern void MPT_PwrCtlDM(PADAPTER padapter, u32 bstart); -extern u8 MptToMgntRate(u32 MptRateIdx); +s32 SetThermalMeter(PADAPTER pAdapter, u8 target_ther); +void GetThermalMeter(PADAPTER pAdapter, u8 *value); + +void SetContinuousTx(PADAPTER pAdapter, u8 bStart); +void SetSingleCarrierTx(PADAPTER pAdapter, u8 bStart); +void SetSingleToneTx(PADAPTER pAdapter, u8 bStart); +void SetCarrierSuppressionTx(PADAPTER pAdapter, u8 bStart); +void PhySetTxPowerLevel(PADAPTER pAdapter); + +void fill_txdesc_for_mp(PADAPTER padapter, u8 *ptxdesc); +void SetPacketTx(PADAPTER padapter); +void SetPacketRx(PADAPTER pAdapter, u8 bStartRx); + +void ResetPhyRxPktCount(PADAPTER pAdapter); +u32 GetPhyRxPktReceived(PADAPTER pAdapter); +u32 GetPhyRxPktCRC32Error(PADAPTER pAdapter); + +s32 SetPowerTracking(PADAPTER padapter, u8 enable); +void GetPowerTracking(PADAPTER padapter, u8 *enable); + +u32 mp_query_psd(PADAPTER pAdapter, u8 *data); + + +void Hal_SetAntenna(PADAPTER pAdapter); +void Hal_SetBandwidth(PADAPTER pAdapter); + +void Hal_SetTxPower(PADAPTER pAdapter); +void Hal_SetCarrierSuppressionTx(PADAPTER pAdapter, u8 bStart); +void Hal_SetSingleToneTx(PADAPTER pAdapter, u8 bStart); +void Hal_SetSingleCarrierTx(PADAPTER pAdapter, u8 bStart); +void Hal_SetContinuousTx(PADAPTER pAdapter, u8 bStart); +void Hal_SetBandwidth(PADAPTER pAdapter); + +void Hal_SetDataRate(PADAPTER pAdapter); +void Hal_SetChannel(PADAPTER pAdapter); +void Hal_SetAntennaPathPower(PADAPTER pAdapter); +s32 Hal_SetThermalMeter(PADAPTER pAdapter, u8 target_ther); +s32 Hal_SetPowerTracking(PADAPTER padapter, u8 enable); +void Hal_GetPowerTracking(PADAPTER padapter, u8 *enable); +void Hal_GetThermalMeter(PADAPTER pAdapter, u8 *value); +void Hal_mpt_SwitchRfSetting(PADAPTER pAdapter); +void Hal_MPT_CCKTxPowerAdjust(PADAPTER Adapter, BOOLEAN bInCH14); +void Hal_MPT_CCKTxPowerAdjustbyIndex(PADAPTER pAdapter, BOOLEAN beven); +void Hal_SetCCKTxPower(PADAPTER pAdapter, u8 *TxPower); +void Hal_SetOFDMTxPower(PADAPTER pAdapter, u8 *TxPower); +void Hal_TriggerRFThermalMeter(PADAPTER pAdapter); +u8 Hal_ReadRFThermalMeter(PADAPTER pAdapter); +void Hal_SetCCKContinuousTx(PADAPTER pAdapter, u8 bStart); +void Hal_SetOFDMContinuousTx(PADAPTER pAdapter, u8 bStart); +void Hal_ProSetCrystalCap(PADAPTER pAdapter , u32 CrystalCapVal); +//extern void _rtw_mp_xmit_priv(struct xmit_priv *pxmitpriv); +void MP_PHY_SetRFPathSwitch(PADAPTER pAdapter , BOOLEAN bMain); +ULONG mpt_ProQueryCalTxPower(PADAPTER pAdapter, u8 RfPath); +void MPT_PwrCtlDM(PADAPTER padapter, u32 bstart); +u8 MptToMgntRate(u32 MptRateIdx); +u8 rtw_mpRateParseFunc(PADAPTER pAdapter, u8 *targetStr); +u32 mp_join(PADAPTER padapter, u8 mode); #endif //_RTW_MP_H_ diff --git a/backports/drivers/realtek/rtl8812au/include/rtw_mp_phy_regdef.h b/backports/drivers/realtek/rtl8812au/include/rtw_mp_phy_regdef.h index 781bb821994888..340015cd3b2b62 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtw_mp_phy_regdef.h +++ b/backports/drivers/realtek/rtl8812au/include/rtw_mp_phy_regdef.h @@ -1014,11 +1014,12 @@ #define bMaskByte1 0xff00 #define bMaskByte2 0xff0000 #define bMaskByte3 0xff000000 -#define bMaskHWord 0xffff0000 +#define bMaskHWord 0xffff0000 #define bMaskLWord 0x0000ffff -#define bMaskDWord 0xffffffff -#define bMaskH4Bits 0xf0000000 -#define bMaskOFDM_D 0xffc00000 +#define bMaskDWord 0xffffffff +#define bMaskH4Bits 0xf0000000 +#define bMaskH3Bytes 0xffffff00 +#define bMaskOFDM_D 0xffc00000 #define bMaskCCK 0x3f3f3f3f #define bMask12Bits 0xfff diff --git a/backports/drivers/realtek/rtl8812au/include/rtw_odm.h b/backports/drivers/realtek/rtl8812au/include/rtw_odm.h index 148e44d1c49402..3015be60179746 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtw_odm.h +++ b/backports/drivers/realtek/rtl8812au/include/rtw_odm.h @@ -21,7 +21,7 @@ #define __RTW_ODM_H__ #include - +#include "../hal/OUTSRC/phydm_types.h" /* * This file provides utilities/wrappers for rtw driver to use ODM */ @@ -34,9 +34,12 @@ void rtw_odm_dbg_level_set(_adapter *adapter, u32 level); void rtw_odm_ability_msg(void *sel, _adapter *adapter); void rtw_odm_ability_set(_adapter *adapter, u32 ability); +bool rtw_odm_adaptivity_needed(_adapter *adapter); void rtw_odm_adaptivity_parm_msg(void *sel,_adapter *adapter); void rtw_odm_adaptivity_parm_set(_adapter *adapter, s8 TH_L2H_ini, s8 TH_EDCCA_HL_diff, - s8 IGI_Base, bool ForceEDCCA, u8 AdapEn_RSSI, u8 IGI_LowerBound); - + s8 IGI_Base, u32 FABound); +void rtw_odm_get_perpkt_rssi(void *sel, _adapter *adapter); +void rtw_odm_acquirespinlock(_adapter *adapter, RT_SPINLOCK_TYPE type); +void rtw_odm_releasespinlock(_adapter *adapter, RT_SPINLOCK_TYPE type); #endif // __RTW_ODM_H__ diff --git a/backports/drivers/realtek/rtl8812au/include/rtw_p2p.h b/backports/drivers/realtek/rtl8812au/include/rtw_p2p.h index d43ad24f37ed4d..2425cb2b1ea1e1 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtw_p2p.h +++ b/backports/drivers/realtek/rtl8812au/include/rtw_p2p.h @@ -51,6 +51,7 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pframe, uint len ); u8 process_p2p_group_negotation_confirm( struct wifidirect_info *pwdinfo, u8 *pframe, uint len ); u8 process_p2p_presence_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint len); +int process_p2p_cross_connect_ie(PADAPTER padapter, u8 *IEs, u32 IELength); void p2p_protocol_wk_hdl(_adapter *padapter, int intCmdType); diff --git a/backports/drivers/realtek/rtl8812au/include/rtw_pwrctrl.h b/backports/drivers/realtek/rtl8812au/include/rtw_pwrctrl.h index fec80161311067..4fceaee2545d95 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtw_pwrctrl.h +++ b/backports/drivers/realtek/rtl8812au/include/rtw_pwrctrl.h @@ -63,7 +63,8 @@ enum Power_Mgnt #ifdef CONFIG_PNO_SUPPORT #define MAX_PNO_LIST_COUNT 16 -#define MAX_SCAN_LIST_COUNT 14 //2.4G only +#define MAX_SCAN_LIST_COUNT 14 //2.4G only +#define MAX_HIDDEN_AP 8 //8 hidden AP #endif /* @@ -205,13 +206,15 @@ typedef enum _PS_DENY_REASON typedef struct pno_nlo_info { u32 fast_scan_period; //Fast scan period - u32 ssid_num; //number of entry + u8 ssid_num; //number of entry + u8 hidden_ssid_num; u32 slow_scan_period; //slow scan period u32 fast_scan_iterations; //Fast scan iterations u8 ssid_length[MAX_PNO_LIST_COUNT]; //SSID Length Array - u8 ssid_chiper_info[MAX_PNO_LIST_COUNT]; //Chiper information for security + u8 ssid_cipher_info[MAX_PNO_LIST_COUNT]; //Cipher information for security u8 ssid_channel_info[MAX_PNO_LIST_COUNT]; //channel information -}pno_nlo_info_t; + u8 loc_probe_req[MAX_HIDDEN_AP]; //loc_probeReq +}pno_nlo_info_t; typedef struct pno_ssid { u32 SSID_len; @@ -279,11 +282,15 @@ struct pwrctrl_priv uint ips_enter_cnts; uint ips_leave_cnts; + uint lps_enter_cnts; + uint lps_leave_cnts; u8 ips_mode; + u8 ips_org_mode; u8 ips_mode_req; // used to accept the mode setting request, will update to ipsmode later uint bips_processing; u32 ips_deny_time; /* will deny IPS when system time is smaller than this */ + u8 pre_ips_type;// 0: default flow, 1: carddisbale flow // ps_deny: if 0, power save is free to go; otherwise deny all kinds of power save. // Use PS_DENY_REASON to decide reason. @@ -297,6 +304,7 @@ struct pwrctrl_priv u8 bLeisurePs; u8 LpsIdleCount; u8 power_mgnt; + u8 org_power_mgnt; u8 bFwCurrentInPSMode; u32 DelayLPSLastTimeStamp; s32 pnp_current_pwr_state; @@ -313,14 +321,17 @@ struct pwrctrl_priv u8 wowlan_wake_reason; u8 wowlan_ap_mode; u8 wowlan_mode; + u8 wowlan_p2p_mode; + u8 wowlan_pno_enable; #ifdef CONFIG_WOWLAN u8 wowlan_pattern; u8 wowlan_magic; u8 wowlan_unicast; u8 wowlan_pattern_idx; - u8 wowlan_pno_enable; + u8 wowlan_from_cmd; #ifdef CONFIG_PNO_SUPPORT u8 pno_in_resume; + u8 pno_inited; pno_nlo_info_t *pnlo_info; pno_scan_info_t *pscan_info; pno_ssid_list_t *pno_ssid_list; @@ -399,8 +410,6 @@ extern void cpwm_int_hdl(PADAPTER padapter, struct reportpwrstate_parm *preportp extern void LPS_Leave_check(PADAPTER padapter); #endif -extern void rtw_set_ps_mode(PADAPTER padapter, u8 ps_mode, u8 smart_ps, u8 bcn_ant_mode, const char *msg); -extern void rtw_set_rpwm(_adapter * padapter, u8 val8); extern void LeaveAllPowerSaveMode(PADAPTER Adapter); extern void LeaveAllPowerSaveModeDirect(PADAPTER Adapter); #ifdef CONFIG_IPS @@ -426,7 +435,10 @@ int rtw_fw_ps_state(PADAPTER padapter); s32 LPS_RF_ON_check(PADAPTER padapter, u32 delay_ms); void LPS_Enter(PADAPTER padapter, const char *msg); void LPS_Leave(PADAPTER padapter, const char *msg); -void traffic_check_for_leave_lps(PADAPTER padapter, u8 tx, u32 tx_packets); +void traffic_check_for_leave_lps(PADAPTER padapter, u8 tx, u32 tx_packets); +void rtw_set_ps_mode(PADAPTER padapter, u8 ps_mode, u8 smart_ps, u8 bcn_ant_mode, const char *msg); +void rtw_set_fw_in_ips_mode(PADAPTER padapter, u8 enable); +void rtw_set_rpwm(_adapter * padapter, u8 val8); #endif #ifdef CONFIG_RESUME_IN_WORKQUEUE diff --git a/backports/drivers/realtek/rtl8812au/include/rtw_recv.h b/backports/drivers/realtek/rtl8812au/include/rtw_recv.h index a5eb0480573ee8..f04c045a8aa78a 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtw_recv.h +++ b/backports/drivers/realtek/rtl8812au/include/rtw_recv.h @@ -96,6 +96,7 @@ struct recv_reorder_ctrl u16 indicate_seq;//=wstart_b, init_value=0xffff u16 wend_b; u8 wsize_b; + u8 ampdu_size; _queue pending_recvframe_queue; _timer reordering_ctrl_timer; }; @@ -190,12 +191,27 @@ struct phy_info u8 BTRxRSSIPercentage; u8 SignalStrength; // in 0-100 index. - u8 RxPwr[4]; //per-path's pwdb + s8 RxPwr[4]; //per-path's pwdb u8 RxSNR[4]; //per-path's SNR u8 BandWidth; u8 btCoexPwrAdjust; }; +#ifdef DBG_RX_SIGNAL_DISPLAY_RAW_DATA +struct rx_raw_rssi +{ + u8 data_rate; + u8 pwdball; + s8 pwr_all; + + u8 mimo_singal_strength[4];// in 0~100 index + u8 mimo_singal_quality[4]; + + s8 ofdm_pwr[4]; + u8 ofdm_snr[4]; + +}; +#endif struct rx_pkt_attrib { u16 pkt_len; @@ -239,8 +255,12 @@ struct rx_pkt_attrib { u8 key_index; u8 data_rate; + u8 bw; + u8 stbc; + u8 ldpc; u8 sgi; u8 pkt_rpt_type; + u32 tsfl; u32 MacIDValidEntry[2]; // 64 bits present 64 entry. /* @@ -250,7 +270,7 @@ struct rx_pkt_attrib { u32 RxPWDBAll; s32 RecvSignalPower; */ - struct phy_info phy_info; + struct phy_info phy_info; }; @@ -263,7 +283,16 @@ struct rx_pkt_attrib { #define RECVBUFF_ALIGN_SZ 8 +#if defined (CONFIG_RTL8192E) + #ifdef CONFIG_PCI_HCI + #define RXDESC_SIZE 16 + #define RX_WIFI_INFO_SIZE 24 + #else + #define RXDESC_SIZE 24 + #endif +#else #define RXDESC_SIZE 24 +#endif #define RXDESC_OFFSET RXDESC_SIZE struct recv_stat @@ -272,10 +301,13 @@ struct recv_stat unsigned int rxdw1; +#if !(defined(CONFIG_RTL8192E) && defined(CONFIG_PCI_HCI)) //exclude 8192ee unsigned int rxdw2; unsigned int rxdw3; +#endif +#ifndef BUF_DESC_ARCH unsigned int rxdw4; unsigned int rxdw5; @@ -285,6 +317,7 @@ struct recv_stat unsigned int rxdw7; #endif +#endif //if BUF_DESC_ARCH is defined, rx_buf_desc occupy 4 double words }; #define EOR BIT(30) @@ -301,6 +334,8 @@ struct rtw_rx_ring { }; #endif + + /* accesser of recv_priv: rtw_recv_entry(dispatch / passive level); recv_thread(passive) ; returnpkt(dispatch) ; halt(passive) ; @@ -354,7 +389,7 @@ struct recv_priv //u8 *pallocated_urb_buf; _sema allrxreturnevt; uint ff_hwaddr; - u8 rx_pending_cnt; + ATOMIC_T rx_pending_cnt; #ifdef CONFIG_USB_INTERRUPT_IN_PIPE #ifdef PLATFORM_LINUX @@ -380,9 +415,6 @@ struct recv_priv struct ifqueue rx_indicate_queue; #endif // CONFIG_RX_INDICATE_QUEUE -#ifdef CONFIG_USE_USB_BUFFER_ALLOC_RX - _queue recv_buf_pending_queue; -#endif // CONFIG_USE_USB_BUFFER_ALLOC_RX #endif //defined(PLATFORM_LINUX) || defined(PLATFORM_FREEBSD) u8 *pallocated_recv_buf; @@ -390,7 +422,7 @@ struct recv_priv _queue free_recv_buf_queue; u32 free_recv_buf_queue_cnt; -#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) +#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) || defined(CONFIG_USB_HCI) _queue recv_buf_pending_queue; #endif @@ -404,14 +436,19 @@ struct recv_priv //For display the phy informatiom u8 is_signal_dbg; // for debug u8 signal_strength_dbg; // for debug - s8 rssi; - s8 rxpwdb; + u8 signal_strength; u8 signal_qual; - u8 noise; - int RxSNRdB[2]; - s8 RxRssi[2]; - int FalseAlmCnt_all; + s8 rssi; //translate_percentage_to_dbm(ptarget_wlan->network.PhyInfo.SignalStrength); + #ifdef DBG_RX_SIGNAL_DISPLAY_RAW_DATA + struct rx_raw_rssi raw_rssi_info; + #endif + //s8 rxpwdb; + s16 noise; + //int RxSNRdB[2]; + //s8 RxRssi[2]; + //int FalseAlmCnt_all; + #ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS _timer signal_stat_timer; @@ -423,7 +460,7 @@ struct recv_priv struct smooth_rssi_data signal_qual_data; struct smooth_rssi_data signal_strength_data; #endif //CONFIG_NEW_SIGNAL_STAT_PROCESS - + u16 sink_udpport,pre_rtp_rxseq,cur_rtp_rxseq; }; #ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS @@ -489,11 +526,9 @@ struct recv_buf #ifdef PLATFORM_LINUX _pkt *pskb; - u8 reuse; #endif #ifdef PLATFORM_FREEBSD //skb solution struct sk_buff *pskb; - u8 reuse; #endif //PLATFORM_FREEBSD //skb solution }; @@ -596,6 +631,8 @@ struct recv_buf *rtw_dequeue_recvbuf (_queue *queue); void rtw_reordering_ctrl_timeout_handler(void *pcontext); +void rx_query_phy_status(union recv_frame *rframe, u8 *phy_stat); + __inline static u8 *get_rxmem(union recv_frame *precvframe) { //always return rx_head... @@ -803,9 +840,14 @@ __inline static s32 translate_percentage_to_dbm(u32 SignalStrengthIndex) { s32 SignalPower; // in dBm. +#ifdef CONFIG_SKIP_SIGNAL_SCALE_MAPPING + // Translate to dBm (x=y-100) + SignalPower = SignalStrengthIndex - 100; +#else // Translate to dBm (x=0.5y-95). SignalPower = (s32)((SignalStrengthIndex + 1) >> 1); SignalPower -= 95; +#endif return SignalPower; } diff --git a/backports/drivers/realtek/rtl8812au/include/rtw_rf.h b/backports/drivers/realtek/rtl8812au/include/rtw_rf.h index 567ac52dc016cb..35d031f0b1e48e 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtw_rf.h +++ b/backports/drivers/realtek/rtl8812au/include/rtw_rf.h @@ -155,20 +155,6 @@ typedef enum _PROTECTION_MODE{ PROTECTION_MODE_FORCE_DISABLE = 2, }PROTECTION_MODE, *PPROTECTION_MODE; -#define LDPC_VHT_ENABLE_RX BIT0 -#define LDPC_VHT_ENABLE_TX BIT1 -#define LDPC_VHT_TEST_TX_ENABLE BIT2 -#define LDPC_VHT_CAP_TX BIT3 - -#define STBC_VHT_ENABLE_RX BIT0 -#define STBC_VHT_ENABLE_TX BIT1 -#define STBC_VHT_TEST_TX_ENABLE BIT2 -#define STBC_VHT_CAP_TX BIT3 - -#define BEAMFORMING_VHT_BEAMFORMER_ENABLE BIT0 // Declare our NIC supports beamformer -#define BEAMFORMING_VHT_BEAMFORMEE_ENABLE BIT1 // Declare our NIC supports beamformee -#define BEAMFORMING_VHT_BEAMFORMER_TEST BIT2 // Transmiting Beamforming no matter the target supports it or not - /* 2007/11/15 MH Define different RF type. */ typedef enum _RT_RF_TYPE_DEFINITION { diff --git a/backports/drivers/realtek/rtl8812au/include/rtw_security.h b/backports/drivers/realtek/rtl8812au/include/rtw_security.h index 4c866ce7ba4ef6..00b08fd75e469c 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtw_security.h +++ b/backports/drivers/realtek/rtl8812au/include/rtw_security.h @@ -34,6 +34,8 @@ #endif //CONFIG_IEEE80211W #define is_wep_enc(alg) (((alg) == _WEP40_) || ((alg) == _WEP104_)) +const char *security_type_str(u8 value); + #define _WPA_IE_ID_ 0xdd #define _WPA2_IE_ID_ 0x30 @@ -207,6 +209,30 @@ struct security_priv //u8 szCapability[256]; // For WPA2-PSK using zero-config, by Annie, 2005-09-20. u8 bWepDefaultKeyIdxSet; + +#define DBG_SW_SEC_CNT +#ifdef DBG_SW_SEC_CNT + u64 wep_sw_enc_cnt_bc; + u64 wep_sw_enc_cnt_mc; + u64 wep_sw_enc_cnt_uc; + u64 wep_sw_dec_cnt_bc; + u64 wep_sw_dec_cnt_mc; + u64 wep_sw_dec_cnt_uc; + + u64 tkip_sw_enc_cnt_bc; + u64 tkip_sw_enc_cnt_mc; + u64 tkip_sw_enc_cnt_uc; + u64 tkip_sw_dec_cnt_bc; + u64 tkip_sw_dec_cnt_mc; + u64 tkip_sw_dec_cnt_uc; + + u64 aes_sw_enc_cnt_bc; + u64 aes_sw_enc_cnt_mc; + u64 aes_sw_enc_cnt_uc; + u64 aes_sw_dec_cnt_bc; + u64 aes_sw_dec_cnt_mc; + u64 aes_sw_dec_cnt_uc; +#endif /* DBG_SW_SEC_CNT */ }; struct sha256_state { diff --git a/backports/drivers/realtek/rtl8812au/include/rtw_tdls.h b/backports/drivers/realtek/rtl8812au/include/rtw_tdls.h index ce0e2fc3c8973e..6c26fda604075f 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtw_tdls.h +++ b/backports/drivers/realtek/rtl8812au/include/rtw_tdls.h @@ -23,33 +23,32 @@ #ifdef CONFIG_TDLS /* TDLS STA state */ -#define TDLS_STATE_NONE 0x00000000 //default state -#define TDLS_INITIATOR_STATE 0x10000000 -#define TDLS_RESPONDER_STATE 0x20000000 -#define TDLS_LINKED_STATE 0x40000000 -#define TDLS_CH_SWITCH_ON_STATE 0x01000000 -#define TDLS_PEER_AT_OFF_STATE 0x02000000 //could send pkt on target ch -#define TDLS_AT_OFF_CH_STATE 0x04000000 -#define TDLS_CH_SW_INITIATOR_STATE 0x08000000 //avoiding duplicated or unconditional ch. switch rsp. -#define TDLS_APSD_CHSW_STATE 0x00100000 //in APSD and want to setup channel switch -#define TDLS_PEER_SLEEP_STATE 0x00200000 //peer sta is sleeping //[TDLS] UAPSD: will not be used one day -#define TDLS_SW_OFF_STATE 0x00400000 //terminate channel swithcing -#define TDLS_ALIVE_STATE 0x00010000 //Check if peer sta is alived. -#define TDLS_WAIT_PTR_STATE 0x00020000 //Waiting peer's TDLS_PEER_TRAFFIC_RESPONSE frame - -#define TPK_RESEND_COUNT 301 -#define CH_SWITCH_TIME 10 -#define CH_SWITCH_TIMEOUT 30 -#define TDLS_STAY_TIME 500 + + +/* TDLS Diect Link Establishment */ +#define TDLS_STATE_NONE 0x00000000 /* Default state */ +#define TDLS_INITIATOR_STATE BIT(28) /* 0x10000000 */ +#define TDLS_RESPONDER_STATE BIT(29) /* 0x20000000 */ +#define TDLS_LINKED_STATE BIT(30) /* 0x40000000 */ +/* TDLS PU Buffer STA */ +#define TDLS_WAIT_PTR_STATE BIT(24) /* 0x01000000 */ /* Waiting peer's TDLS_PEER_TRAFFIC_RESPONSE frame */ +/* TDLS Check ALive */ +#define TDLS_ALIVE_STATE BIT(20) /* 0x00100000 */ /* Check if peer sta is alived. */ +/* TDLS Channel Switch */ +#define TDLS_CH_SWITCH_ON_STATE BIT(16) /* 0x00010000 */ +#define TDLS_PEER_AT_OFF_STATE BIT(17) /* 0x00020000 */ /* Could send pkt on target ch */ +#define TDLS_CH_SW_INITIATOR_STATE BIT(18) /* 0x00040000 */ /* Avoid duplicated or unconditional ch. switch rsp. */ +#define TDLS_WAIT_CH_RSP_STATE BIT(19) /* 0x00080000 */ /* Wait Ch. response as we are TDLS channel switch initiator */ + + +#define TPK_RESEND_COUNT 1800 /*Unit: seconds */ +#define CH_SWITCH_TIME 5 +#define CH_SWITCH_TIMEOUT 20 #define TDLS_SIGNAL_THRESH 0x20 -#define TDLS_WATCHDOG_PERIOD 10 //Periodically sending tdls discovery request in TDLS_WATCHDOG_PERIOD * 2 sec -#define TDLS_STAY_TIME 500 +#define TDLS_WATCHDOG_PERIOD 10 /* Periodically sending tdls discovery request in TDLS_WATCHDOG_PERIOD * 2 sec */ #define TDLS_HANDSHAKE_TIME 3000 -#define TDLS_PTI_TIME 7000 -#define TDLS_ALIVE_COUNT 3 -#define TDLS_INI_MACID_ENTRY 6 +#define TDLS_PTI_TIME 7000 -/* TDLS */ #define TDLS_MIC_LEN 16 #define WPA_NONCE_LEN 32 #define TDLS_TIMEOUT_LEN 4 @@ -72,44 +71,46 @@ struct wpa_tdls_lnkid { u8 resp_sta[ETH_ALEN]; } ; -static u8 TDLS_RSNIE[]={ 0x01, 0x00, //version shall be set to 1 - 0x00, 0x0f, 0xac, 0x07, //group sipher suite - 0x01, 0x00, //pairwise cipher suite count - 0x00, 0x0f, 0xac, 0x04, //pairwise cipher suite list; CCMP only - 0x01, 0x00, //AKM suite count - 0x00, 0x0f, 0xac, 0x07, //TPK Handshake - 0x0c, 0x02, - //PMKID shall not be present +static u8 TDLS_RSNIE[20]={ 0x01, 0x00, /* Version shall be set to 1 */ + 0x00, 0x0f, 0xac, 0x07, /* Group sipher suite */ + 0x01, 0x00, /* Pairwise cipher suite count */ + 0x00, 0x0f, 0xac, 0x04, /* Pairwise cipher suite list; CCMP only */ + 0x01, 0x00, /* AKM suite count */ + 0x00, 0x0f, 0xac, 0x07, /* TPK Handshake */ + 0x0c, 0x02, + /* PMKID shall not be present */ }; -static u8 TDLS_WMMIE[]={0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00}; //Qos info all set zero +static u8 TDLS_WMMIE[]={0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00}; /* Qos info all set zero */ -static u8 TDLS_EXT_CAPIE[] = {0x00, 0x00, 0x00, 0x50, 0x20, 0x00, 0x00, 0x00}; //bit(28), bit(30), bit(37) +static u8 TDLS_EXT_CAPIE[] = {0x00, 0x00, 0x00, 0x50, 0x20, 0x00, 0x00, 0x00}; /* bit(28), bit(30), bit(37) */ -// SRC: Supported Regulatory Classes +/* SRC: Supported Regulatory Classes */ static u8 TDLS_SRC[] = { 0x01, 0x01, 0x02, 0x03, 0x04, 0x0c, 0x16, 0x17, 0x18, 0x19, 0x1b, 0x1c, 0x1d, 0x1e, 0x20, 0x21 }; +int check_ap_tdls_prohibited(u8 *pframe, u8 pkt_len); +int check_ap_tdls_ch_switching_prohibited(u8 *pframe, u8 pkt_len); void rtw_reset_tdls_info(_adapter* padapter); int rtw_init_tdls_info(_adapter* padapter); void rtw_free_tdls_info(struct tdls_info *ptdlsinfo); int issue_nulldata_to_TDLS_peer_STA(_adapter *padapter, unsigned char *da, unsigned int power_mode, int try_cnt, int wait_ms); void rtw_init_tdls_timer(_adapter *padapter, struct sta_info *psta); -void rtw_free_tdls_timer(struct sta_info *psta); +void rtw_free_tdls_timer(struct sta_info *psta); void free_tdls_sta(_adapter *padapter, struct sta_info *ptdls_sta); #ifdef CONFIG_WFD int issue_tunneled_probe_req(_adapter *padapter); int issue_tunneled_probe_rsp(_adapter *padapter, union recv_frame *precv_frame); -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ int issue_tdls_dis_req(_adapter *padapter, struct tdls_txmgmt *ptxmgmt); int issue_tdls_setup_req(_adapter *padapter, struct tdls_txmgmt *ptxmgmt, int wait_ack); int issue_tdls_setup_rsp(_adapter *padapter, struct tdls_txmgmt *ptxmgmt); int issue_tdls_setup_cfm(_adapter *padapter, struct tdls_txmgmt *ptxmgmt); int issue_tdls_dis_rsp(_adapter * padapter, struct tdls_txmgmt *ptxmgmt, u8 privacy); int issue_tdls_teardown(_adapter *padapter, struct tdls_txmgmt *ptxmgmt, u8 wait_ack); -int issue_tdls_peer_traffic_rsp(_adapter *padapter, struct sta_info *psta); +int issue_tdls_peer_traffic_rsp(_adapter *padapter, struct sta_info *psta, struct tdls_txmgmt *ptxmgmt); int issue_tdls_peer_traffic_indication(_adapter *padapter, struct sta_info *psta); -int issue_tdls_ch_switch_req(_adapter *padapter, u8 *mac_addr); -int issue_tdls_ch_switch_rsp(_adapter *padapter, u8 *mac_addr); +int issue_tdls_ch_switch_req(_adapter *padapter, struct sta_info *ptdls_sta); +int issue_tdls_ch_switch_rsp(_adapter *padapter, struct tdls_txmgmt *ptxmgmt, int wait_ack); sint On_TDLS_Dis_Rsp(_adapter *adapter, union recv_frame *precv_frame); sint On_TDLS_Setup_Req(_adapter *adapter, union recv_frame *precv_frame); int On_TDLS_Setup_Rsp(_adapter *adapter, union recv_frame *precv_frame); @@ -118,24 +119,29 @@ int On_TDLS_Dis_Req(_adapter *adapter, union recv_frame *precv_frame); int On_TDLS_Teardown(_adapter *adapter, union recv_frame *precv_frame); int On_TDLS_Peer_Traffic_Indication(_adapter *adapter, union recv_frame *precv_frame); int On_TDLS_Peer_Traffic_Rsp(_adapter *adapter, union recv_frame *precv_frame); +#ifdef CONFIG_TDLS_CH_SW sint On_TDLS_Ch_Switch_Req(_adapter *adapter, union recv_frame *precv_frame); sint On_TDLS_Ch_Switch_Rsp(_adapter *adapter, union recv_frame *precv_frame); +void rtw_build_tdls_ch_switch_req_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe, struct tdls_txmgmt *ptxmgmt); +void rtw_build_tdls_ch_switch_rsp_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe, struct tdls_txmgmt *ptxmgmt); +#endif void rtw_build_tdls_setup_req_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe, struct tdls_txmgmt *ptxmgmt); void rtw_build_tdls_setup_rsp_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe, struct tdls_txmgmt *ptxmgmt); void rtw_build_tdls_setup_cfm_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe, struct tdls_txmgmt *ptxmgmt); void rtw_build_tdls_teardown_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe, struct tdls_txmgmt *ptxmgmt); void rtw_build_tdls_dis_req_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe, struct tdls_txmgmt *ptxmgmt); -void rtw_build_tdls_dis_rsp_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe, u8 dialog, u8 privacy); -void rtw_build_tdls_peer_traffic_rsp_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe); -void rtw_build_tdls_peer_traffic_indication_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe); -void rtw_build_tdls_ch_switch_req_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe); -void rtw_build_tdls_ch_switch_rsp_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe); +void rtw_build_tdls_dis_rsp_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe, struct tdls_txmgmt *ptxmgmt, u8 privacy); +void rtw_build_tdls_peer_traffic_rsp_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe, struct tdls_txmgmt *ptxmgmt); +void rtw_build_tdls_peer_traffic_indication_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe, struct tdls_txmgmt *ptxmgmt); void rtw_build_tunneled_probe_req_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe); void rtw_build_tunneled_probe_rsp_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe); u8 update_sgi_tdls(_adapter *padapter, struct sta_info *psta); u32 update_mask_tdls(_adapter *padapter, struct sta_info *psta); -#endif //CONFIG_TDLS +int rtw_tdls_is_driver_setup(_adapter *padapter); +void rtw_tdls_set_key(_adapter *padapter, struct sta_info *ptdls_sta); +const char * rtw_tdls_action_txt(enum TDLS_ACTION_FIELD action); +#endif /* CONFIG_TDLS */ #endif diff --git a/backports/drivers/realtek/rtl8812au/include/rtw_version.h b/backports/drivers/realtek/rtl8812au/include/rtw_version.h index f122507178005f..cde32ead78dfb2 100644 --- a/backports/drivers/realtek/rtl8812au/include/rtw_version.h +++ b/backports/drivers/realtek/rtl8812au/include/rtw_version.h @@ -1 +1,2 @@ -#define DRIVERVERSION "v4.2.5_10143.20140103_ASUS" +#define DRIVERVERSION "v4.3.14_13455.20150212_BTCOEX20150128-51" +#define BTCOEXVERSION "BTCOEX20150128-51" diff --git a/backports/drivers/realtek/rtl8812au/include/rtw_vht.h b/backports/drivers/realtek/rtl8812au/include/rtw_vht.h index 651737e8387022..62ad08b5a7d1ee 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtw_vht.h +++ b/backports/drivers/realtek/rtl8812au/include/rtw_vht.h @@ -20,6 +20,19 @@ #ifndef _RTW_VHT_H_ #define _RTW_VHT_H_ +#define LDPC_VHT_ENABLE_RX BIT0 +#define LDPC_VHT_ENABLE_TX BIT1 +#define LDPC_VHT_TEST_TX_ENABLE BIT2 +#define LDPC_VHT_CAP_TX BIT3 + +#define STBC_VHT_ENABLE_RX BIT0 +#define STBC_VHT_ENABLE_TX BIT1 +#define STBC_VHT_TEST_TX_ENABLE BIT2 +#define STBC_VHT_CAP_TX BIT3 + +#define BEAMFORMING_VHT_BEAMFORMER_ENABLE BIT0 // Declare our NIC supports beamformer +#define BEAMFORMING_VHT_BEAMFORMEE_ENABLE BIT1 // Declare our NIC supports beamformee +#define BEAMFORMING_VHT_BEAMFORMER_TEST BIT2 // Transmiting Beamforming no matter the target supports it or not //VHT capability info #define SET_VHT_CAPABILITY_ELE_MAX_MPDU_LENGTH(_pEleStart, _val) SET_BITS_TO_LE_1BYTE(_pEleStart, 0, 2, _val) @@ -39,9 +52,9 @@ #define SET_VHT_CAPABILITY_ELE_HTC_VHT(_pEleStart, _val) SET_BITS_TO_LE_1BYTE((_pEleStart)+2, 6, 1, _val) #define SET_VHT_CAPABILITY_ELE_MAX_RXAMPDU_FACTOR(_pEleStart, _val) SET_BITS_TO_LE_2BYTE((_pEleStart)+2, 7, 3, _val) //B23~B25 #define SET_VHT_CAPABILITY_ELE_LINK_ADAPTION(_pEleStart, _val) SET_BITS_TO_LE_1BYTE((_pEleStart)+2, 2, 2, _val) -#define SET_VHT_CAPABILITY_ELE_MCS_RX_MAP(_pEleStart, _val) SET_BITS_TO_LE_2BYTE((_pEleStart)+4, 0, 16, _val) //B0~B15 indicate Rx MCS MAP, we write 0 to indicate MCS0~7. by page +#define SET_VHT_CAPABILITY_ELE_MCS_RX_MAP(_pEleStart, _val) SET_BITS_TO_LE_2BYTE_16BIT((_pEleStart)+4, 0, 16, _val) //B0~B15 indicate Rx MCS MAP, we write 0 to indicate MCS0~7. by page #define SET_VHT_CAPABILITY_ELE_MCS_RX_HIGHEST_RATE(_pEleStart, _val) SET_BITS_TO_LE_2BYTE((_pEleStart)+6, 0, 13, _val) -#define SET_VHT_CAPABILITY_ELE_MCS_TX_MAP(_pEleStart, _val) SET_BITS_TO_LE_2BYTE((_pEleStart)+8, 0, 16, _val) //B0~B15 indicate Tx MCS MAP, we write 0 to indicate MCS0~7. by page +#define SET_VHT_CAPABILITY_ELE_MCS_TX_MAP(_pEleStart, _val) SET_BITS_TO_LE_2BYTE_16BIT((_pEleStart)+8, 0, 16, _val) //B0~B15 indicate Tx MCS MAP, we write 0 to indicate MCS0~7. by page #define SET_VHT_CAPABILITY_ELE_MCS_TX_HIGHEST_RATE(_pEleStart, _val) SET_BITS_TO_LE_2BYTE((_pEleStart)+10, 0, 13, _val) @@ -63,10 +76,10 @@ //VHT Operation Information Element -#define SET_VHT_OPERATION_ELE_CHL_WIDTH(_pEleStart, _val) SET_BITS_TO_LE_1BYTE(_pEleStart, 0, 8, _val) -#define SET_VHT_OPERATION_ELE_CHL_CENTER_FREQ1(_pEleStart, _val) SET_BITS_TO_LE_1BYTE(_pEleStart+1, 0, 8, _val) -#define SET_VHT_OPERATION_ELE_CHL_CENTER_FREQ2(_pEleStart, _val) SET_BITS_TO_LE_1BYTE(_pEleStart+2, 0, 8, _val) -#define SET_VHT_OPERATION_ELE_BASIC_MCS_SET(_pEleStart, _val) SET_BITS_TO_LE_2BYTE(_pEleStart+3, 0, 16, _val) +#define SET_VHT_OPERATION_ELE_CHL_WIDTH(_pEleStart, _val) SET_BITS_TO_LE_1BYTE_8BIT(_pEleStart, 0, 8, _val) +#define SET_VHT_OPERATION_ELE_CHL_CENTER_FREQ1(_pEleStart, _val) SET_BITS_TO_LE_1BYTE_8BIT(_pEleStart+1, 0, 8, _val) +#define SET_VHT_OPERATION_ELE_CHL_CENTER_FREQ2(_pEleStart, _val) SET_BITS_TO_LE_1BYTE_8BIT(_pEleStart+2, 0, 8, _val) +#define SET_VHT_OPERATION_ELE_BASIC_MCS_SET(_pEleStart, _val) SET_BITS_TO_LE_2BYTE_16BIT((_pEleStart)+3, 0, 16, _val) #define GET_VHT_OPERATION_ELE_CHL_WIDTH(_pEleStart) LE_BITS_TO_1BYTE(_pEleStart,0,8) #define GET_VHT_OPERATION_ELE_CENTER_FREQ1(_pEleStart) LE_BITS_TO_1BYTE((_pEleStart)+1,0,8) diff --git a/backports/drivers/realtek/rtl8812au/include/rtw_wifi_regd.h b/backports/drivers/realtek/rtl8812au/include/rtw_wifi_regd.h index 46cba1bffd85d3..aea6365290f8b3 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtw_wifi_regd.h +++ b/backports/drivers/realtek/rtl8812au/include/rtw_wifi_regd.h @@ -19,10 +19,8 @@ enum country_code_type_t { COUNTRY_CODE_MAX }; -int rtw_regd_init(_adapter *padapter, - int (*reg_notifier)(struct wiphy *wiphy, - struct regulatory_request *request)); -int rtw_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request); +int rtw_regd_init(_adapter *padapter); +void rtw_reg_notify_by_driver(_adapter *adapter); +#endif /* __RTW_WIFI_REGD_H__ */ -#endif diff --git a/backports/drivers/realtek/rtl8812au/include/rtw_xmit.h b/backports/drivers/realtek/rtl8812au/include/rtw_xmit.h index 5ab366fc7f4f3c..fa5a014cd861a0 100755 --- a/backports/drivers/realtek/rtl8812au/include/rtw_xmit.h +++ b/backports/drivers/realtek/rtl8812au/include/rtw_xmit.h @@ -77,9 +77,14 @@ // xmit extension buff defination #define MAX_XMIT_EXTBUF_SZ (1536) + +#ifdef CONFIG_SINGLE_XMIT_BUF +#define NR_XMIT_EXTBUFF (1) +#else #define NR_XMIT_EXTBUFF (32) +#endif -#define MAX_CMDBUF_SZ (4096) +#define MAX_CMDBUF_SZ (5120) //(4096) #define MAX_NUMBLKS (1) @@ -144,8 +149,24 @@ do{\ #define HWXMIT_ENTRY 4 -#if defined(CONFIG_RTL8812A) || defined(CONFIG_RTL8821A)|| defined(CONFIG_RTL8192E) || defined(CONFIG_RTL8723B) +// For Buffer Descriptor ring architecture +#ifdef BUF_DESC_ARCH +#if defined (CONFIG_RTL8192E) +#define TX_BUFFER_SEG_NUM 1 // 0:2 seg, 1: 4 seg, 2: 8 seg. +#endif +#endif + +#if defined(CONFIG_RTL8812A) || defined(CONFIG_RTL8821A)|| defined(CONFIG_RTL8723B) #define TXDESC_SIZE 40 +//8192EE_TODO +#elif defined (CONFIG_RTL8192E) // this section is defined for buffer descriptor ring architecture + #ifdef CONFIG_PCI_HCI + #define TXDESC_SIZE ((TX_BUFFER_SEG_NUM ==0)?16: ((TX_BUFFER_SEG_NUM ==1)? 32:64) ) + #define TX_WIFI_INFO_SIZE 40 + #else //8192E USB or SDIO + #define TXDESC_SIZE 40 + #endif +//8192EE_TODO #else #define TXDESC_SIZE 32 #endif @@ -169,9 +190,13 @@ do{\ #endif #ifdef CONFIG_PCI_HCI +#if defined(CONFIG_RTL8192E) // this section is defined for buffer descriptor ring architecture +#define TXDESC_OFFSET TX_WIFI_INFO_SIZE +#else #define TXDESC_OFFSET 0 +#endif #define TX_DESC_NEXT_DESC_OFFSET (TXDESC_SIZE + 8) -#endif +#endif //CONFIG_PCI_HCI enum TXDESC_SC{ SC_DONT_CARE = 0x00, @@ -186,6 +211,20 @@ enum TXDESC_SC{ #define TXDESC_40_BYTES #endif +#if defined(CONFIG_RTL8192E) && defined(CONFIG_PCI_HCI) //8192ee +//8192EE_TODO +struct tx_desc +{ + unsigned int txdw0; + unsigned int txdw1; + unsigned int txdw2; + unsigned int txdw3; + unsigned int txdw4; + unsigned int txdw5; + unsigned int txdw6; + unsigned int txdw7; +}; +#else struct tx_desc { unsigned int txdw0; @@ -216,7 +255,7 @@ struct tx_desc unsigned int txdw15; #endif }; - +#endif union txdesc { struct tx_desc txdesc; @@ -227,12 +266,13 @@ union txdesc { #define PCI_MAX_TX_QUEUE_COUNT 8 struct rtw_tx_ring { + unsigned char qid; struct tx_desc *desc; - dma_addr_t dma; - unsigned int idx; - unsigned int entries; - _queue queue; - u32 qlen; + dma_addr_t dma; + unsigned int idx; + unsigned int entries; + _queue queue; + u32 qlen; }; #endif @@ -305,6 +345,7 @@ struct pkt_attrib u8 dhcp_pkt; u16 ether_type; u16 seqnum; + u8 hw_ssn_sel; //for HW_SEQ0,1,2,3 u16 pkt_hdrlen; //the original 802.3 pkt header len u16 hdrlen; //the WLAN Header Len u32 pktlen; //the original 802.3 pkt raw_data len (not include ether_hdr data) @@ -331,10 +372,12 @@ struct pkt_attrib u8 ch_offset;//PRIME_CHNL_OFFSET u8 sgi;//short GI u8 ampdu_en;//tx ampdu enable + u8 ampdu_spacing; //ampdu_min_spacing for peer sta's rx u8 mdata;//more data bit u8 pctrl;//per packet txdesc control enable u8 triggered;//for ap mode handling Power Saving sta u8 qsel; + u8 order;//order bit u8 eosp; u8 rate; u8 intel_proxim; @@ -490,6 +533,10 @@ struct xmit_buf #endif #endif +#ifdef CONFIG_PCI_HCI + struct tx_desc *desc; +#endif + #if defined(DBG_XMIT_BUF )|| defined(DBG_XMIT_BUF_EXT) u8 no; #endif @@ -586,6 +633,14 @@ struct agg_pkt_info{ u16 pkt_len; }; +enum cmdbuf_type { + CMDBUF_BEACON = 0x00, + CMDBUF_RSVD, + CMDBUF_MAX +}; + +u8 rtw_get_hwseq_no(_adapter *padapter); + struct xmit_priv { _lock lock; @@ -673,7 +728,7 @@ struct xmit_priv { #endif #endif -#ifdef CONFIG_SDIO_HCI +#if defined (CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) #ifdef CONFIG_SDIO_TX_TASKLET #ifdef PLATFORM_LINUX struct tasklet_struct xmit_tasklet; @@ -696,8 +751,8 @@ struct xmit_priv { u8 *pxmit_extbuf; uint free_xmit_extbuf_cnt; - struct xmit_buf pcmd_xmitbuf; - + struct xmit_buf pcmd_xmitbuf[CMDBUF_MAX]; + u8 hw_ssn_seq_no;//mapping to REG_HW_SEQ 0,1,2,3 u16 nqos_ssn; #ifdef CONFIG_TX_EARLY_MODE @@ -719,9 +774,16 @@ struct xmit_priv { _lock lock_sctx; }; -extern struct xmit_frame *rtw_alloc_cmdxmitframe(struct xmit_priv *pxmitpriv); -extern struct xmit_buf *rtw_alloc_cmd_xmitbuf(struct xmit_priv *pxmitpriv); -extern s32 rtw_free_cmd_xmitbuf(struct xmit_priv *pxmitpriv); +extern struct xmit_frame *__rtw_alloc_cmdxmitframe(struct xmit_priv *pxmitpriv, + enum cmdbuf_type buf_type); +#define rtw_alloc_cmdxmitframe(p) __rtw_alloc_cmdxmitframe(p, CMDBUF_RSVD) +#if defined(CONFIG_RTL8192E) && defined(CONFIG_PCI_HCI) +extern struct xmit_frame *__rtw_alloc_cmdxmitframe_8192ee(struct xmit_priv *pxmitpriv, + enum cmdbuf_type buf_type); +#define rtw_alloc_bcnxmitframe(p) __rtw_alloc_cmdxmitframe_8192ee(p, CMDBUF_BEACON) +#else +#define rtw_alloc_bcnxmitframe(p) __rtw_alloc_cmdxmitframe(p, CMDBUF_BEACON) +#endif extern struct xmit_buf *rtw_alloc_xmitbuf_ext(struct xmit_priv *pxmitpriv); extern s32 rtw_free_xmitbuf_ext(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf); @@ -732,7 +794,7 @@ extern s32 rtw_free_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitb void rtw_count_tx_stats(_adapter *padapter, struct xmit_frame *pxmitframe, int sz); extern void rtw_update_protection(_adapter *padapter, u8 *ie, uint ie_len); static s32 update_attrib_sec_info(_adapter *padapter, struct pkt_attrib *pattrib, struct sta_info *psta); -static void update_attrib_phy_info(struct pkt_attrib *pattrib, struct sta_info *psta); +static void update_attrib_phy_info(_adapter *padapter, struct pkt_attrib *pattrib, struct sta_info *psta); extern s32 rtw_make_wlanhdr(_adapter *padapter, u8 *hdr, struct pkt_attrib *pattrib); extern s32 rtw_put_snap(u8 *data, u16 h_proto); @@ -775,7 +837,7 @@ void rtw_free_hwxmits(_adapter *padapter); s32 rtw_xmit(_adapter *padapter, _pkt **pkt); - +bool xmitframe_hiq_filter(struct xmit_frame *xmitframe); #if defined(CONFIG_AP_MODE) || defined(CONFIG_TDLS) sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *pxmitframe); void stop_sta_xmit(_adapter *padapter, struct sta_info *psta); diff --git a/backports/drivers/realtek/rtl8812au/include/sdio_hal.h b/backports/drivers/realtek/rtl8812au/include/sdio_hal.h index a3a0b2f865bccf..a918a768d6668e 100755 --- a/backports/drivers/realtek/rtl8812au/include/sdio_hal.h +++ b/backports/drivers/realtek/rtl8812au/include/sdio_hal.h @@ -44,5 +44,9 @@ void rtl8723bs_set_hal_ops(PADAPTER padapter); void rtl8821as_set_hal_ops(PADAPTER padapter); #endif +#ifdef CONFIG_RTL8192E +void rtl8192es_set_hal_ops(PADAPTER padapter); +#endif + #endif //__SDIO_HAL_H__ diff --git a/backports/drivers/realtek/rtl8812au/include/sdio_ops.h b/backports/drivers/realtek/rtl8812au/include/sdio_ops.h index 72604cfb514398..0dcd86f28e17b9 100755 --- a/backports/drivers/realtek/rtl8812au/include/sdio_ops.h +++ b/backports/drivers/realtek/rtl8812au/include/sdio_ops.h @@ -76,6 +76,7 @@ extern void EnableInterrupt8188ESdio(PADAPTER padapter); extern void DisableInterrupt8188ESdio(PADAPTER padapter); extern void UpdateInterruptMask8188ESdio(PADAPTER padapter, u32 AddMSR, u32 RemoveMSR); extern u8 HalQueryTxBufferStatus8189ESdio(PADAPTER padapter); +extern u8 HalQueryTxOQTBufferStatus8189ESdio(PADAPTER padapter); extern void ClearInterrupt8188ESdio(PADAPTER padapter); #endif // CONFIG_RTL8188E @@ -84,6 +85,7 @@ extern void InitInterrupt8821AS(PADAPTER padapter); extern void EnableInterrupt8821AS(PADAPTER padapter); extern void DisableInterrupt8821AS(PADAPTER padapter); extern u8 HalQueryTxBufferStatus8821AS(PADAPTER padapter); +extern u8 HalQueryTxOQTBufferStatus8821ASdio(PADAPTER padapter); #endif // CONFIG_RTL8188E #if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN) @@ -95,11 +97,25 @@ extern void InitSysInterrupt8723BSdio(PADAPTER padapter); extern void EnableInterrupt8723BSdio(PADAPTER padapter); extern void DisableInterrupt8723BSdio(PADAPTER padapter); extern u8 HalQueryTxBufferStatus8723BSdio(PADAPTER padapter); +extern u8 HalQueryTxOQTBufferStatus8723BSdio(PADAPTER padapter); #if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN) extern void DisableInterruptButCpwm28723BSdio(PADAPTER padapter); extern void ClearInterrupt8723BSdio(PADAPTER padapter); #endif //CONFIG_WOWLAN #endif + +#ifdef CONFIG_RTL8192E +extern void InitInterrupt8192ESdio(PADAPTER padapter); +extern void EnableInterrupt8192ESdio(PADAPTER padapter); +extern void DisableInterrupt8192ESdio(PADAPTER padapter); +extern void UpdateInterruptMask8192ESdio(PADAPTER padapter, u32 AddMSR, u32 RemoveMSR); +extern u8 HalQueryTxBufferStatus8192ESdio(PADAPTER padapter); +extern u8 HalQueryTxOQTBufferStatus8192ESdio(PADAPTER padapter); +extern void ClearInterrupt8192ESdio(PADAPTER padapter); +#endif // CONFIG_RTL8192E + + + #endif // !__SDIO_OPS_H__ diff --git a/backports/drivers/realtek/rtl8812au/include/sta_info.h b/backports/drivers/realtek/rtl8812au/include/sta_info.h index 240171ca12e47d..c03291600636b7 100755 --- a/backports/drivers/realtek/rtl8812au/include/sta_info.h +++ b/backports/drivers/realtek/rtl8812au/include/sta_info.h @@ -25,6 +25,9 @@ #define NUM_STA 32 #define NUM_ACL 16 +#ifdef CONFIG_TDLS +#define MAX_ALLOWED_TDLS_STA_NUM 4 +#endif //if mode ==0, then the sta is allowed once the addr is hit. //if mode ==1, then the sta is rejected once the addr is non-hit. @@ -140,31 +143,31 @@ struct sta_info { u8 wireless_mode; // NETWORK_TYPE u8 bw_mode; + u8 ldpc; + u8 stbc; + struct stainfo_stats sta_stats; #ifdef CONFIG_TDLS u32 tdls_sta_state; - u8 dialog; u8 SNonce[32]; u8 ANonce[32]; u32 TDLS_PeerKey_Lifetime; u16 TPK_count; _timer TPK_timer; struct TDLS_PeerKey tpk; - u16 stat_code; - u8 off_ch; +#ifdef CONFIG_TDLS_CH_SW u16 ch_switch_time; u16 ch_switch_timeout; - u8 option; - _timer option_timer; - _timer base_ch_timer; - _timer off_ch_timer; + //u8 option; + _timer ch_sw_timer; + _timer delay_timer; +#endif _timer handshake_timer; - u8 timer_flag; u8 alive_count; _timer pti_timer; - u8 TDLS_RSNIE[20]; //Save peer's RSNIE, use for sending TDLS_SETUP_RSP -#endif //CONFIG_TDLS + u8 TDLS_RSNIE[20]; /* Save peer's RSNIE, used for sending TDLS_SETUP_RSP */ +#endif /* CONFIG_TDLS */ //for A-MPDU TX, ADDBA timeout check _timer addba_retry_timer; diff --git a/backports/drivers/realtek/rtl8812au/include/usb_hal.h b/backports/drivers/realtek/rtl8812au/include/usb_hal.h index 51f25b8086ab75..f829bee18f98ee 100755 --- a/backports/drivers/realtek/rtl8812au/include/usb_hal.h +++ b/backports/drivers/realtek/rtl8812au/include/usb_hal.h @@ -20,6 +20,9 @@ #ifndef __USB_HAL_H__ #define __USB_HAL_H__ +int usb_init_recv_priv(_adapter *padapter, u16 ini_in_buf_sz); +void usb_free_recv_priv (_adapter *padapter, u16 ini_in_buf_sz); + void rtw_set_hal_ops(_adapter *padapter); #ifdef CONFIG_RTL8192C diff --git a/backports/drivers/realtek/rtl8812au/include/usb_ops_linux.h b/backports/drivers/realtek/rtl8812au/include/usb_ops_linux.h index a048e83bda3d21..83c1c74c2ce261 100755 --- a/backports/drivers/realtek/rtl8812au/include/usb_ops_linux.h +++ b/backports/drivers/realtek/rtl8812au/include/usb_ops_linux.h @@ -65,5 +65,20 @@ u32 usb_write_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem); void usb_write_port_cancel(struct intf_hdl *pintfhdl); int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u16 index, void *pdata, u16 len, u8 requesttype); +#ifdef CONFIG_USB_SUPPORT_ASYNC_VDN_REQ +int _usbctrl_vendorreq_async_write(struct usb_device *udev, u8 request, + u16 value, u16 index, void *pdata, u16 len, u8 requesttype); +#endif /* CONFIG_USB_SUPPORT_ASYNC_VDN_REQ */ + +u8 usb_read8(struct intf_hdl *pintfhdl, u32 addr); +u16 usb_read16(struct intf_hdl *pintfhdl, u32 addr); +u32 usb_read32(struct intf_hdl *pintfhdl, u32 addr); +int usb_write8(struct intf_hdl *pintfhdl, u32 addr, u8 val); +int usb_write16(struct intf_hdl *pintfhdl, u32 addr, u16 val); +int usb_write32(struct intf_hdl *pintfhdl, u32 addr, u32 val); +int usb_writeN(struct intf_hdl *pintfhdl, u32 addr, u32 length, u8 *pdata); +u32 usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem); +void usb_recv_tasklet(void *priv); + #endif diff --git a/backports/drivers/realtek/rtl8812au/include/wifi.h b/backports/drivers/realtek/rtl8812au/include/wifi.h index 172733755bfe95..bb309050e44e1e 100755 --- a/backports/drivers/realtek/rtl8812au/include/wifi.h +++ b/backports/drivers/realtek/rtl8812au/include/wifi.h @@ -48,6 +48,7 @@ #define WLAN_MIN_ETHFRM_LEN 60 #define WLAN_MAX_ETHFRM_LEN 1514 #define WLAN_ETHHDR_LEN 14 +#define WLAN_WMM_LEN 24 #define P80211CAPTURE_VERSION 0x80211001 @@ -81,6 +82,7 @@ enum WIFI_FRAME_SUBTYPE { WIFI_AUTH = (BIT(7) | BIT(5) | BIT(4) | WIFI_MGT_TYPE), WIFI_DEAUTH = (BIT(7) | BIT(6) | WIFI_MGT_TYPE), WIFI_ACTION = (BIT(7) | BIT(6) | BIT(4) | WIFI_MGT_TYPE), + WIFI_ACTION_NOACK = (BIT(7) | BIT(6) | BIT(5) | WIFI_MGT_TYPE), // below is for control frame WIFI_NDPA = (BIT(6) | BIT(4) | WIFI_CTRL_TYPE), @@ -168,6 +170,8 @@ enum WIFI_REASON_CODE { enum WIFI_STATUS_CODE { _STATS_SUCCESSFUL_ = 0, _STATS_FAILURE_ = 1, + _STATS_SEC_DISABLED_ = 5, + _STATS_NOT_IN_SAME_BSS_ = 7, _STATS_CAP_FAIL_ = 10, _STATS_NO_ASOC_ = 11, _STATS_OTHER_ = 12, @@ -177,6 +181,9 @@ enum WIFI_STATUS_CODE { _STATS_AUTH_TIMEOUT_ = 16, _STATS_UNABLE_HANDLE_STA_ = 17, _STATS_RATE_FAIL_ = 18, + _STATS_DECLINE_REQ_ = 37, + _STATS_INVALID_PARAMETERS_ = 38, + _STATS_INVALID_RSNIE_ = 72, }; /* Status codes (IEEE 802.11-2007, 7.3.1.9, Table 7-23) */ @@ -499,7 +506,7 @@ __inline static unsigned char * get_sa(unsigned char *pframe) __inline static unsigned char * get_hdr_bssid(unsigned char *pframe) { - unsigned char *sa; + unsigned char *sa = NULL; unsigned int to_fr_ds = (GetToDs(pframe) << 1) | GetFrDs(pframe); switch (to_fr_ds) { @@ -515,9 +522,6 @@ __inline static unsigned char * get_hdr_bssid(unsigned char *pframe) case 0x03: // ToDs=1, FromDs=1 sa = GetAddr1Ptr(pframe); break; - default: - sa =NULL; //??????? - break; } return sa; @@ -744,6 +748,7 @@ typedef enum _ELEMENT_ID{ #define GetOrderBit(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_ORDER_)) != 0) +#define ACT_CAT_VENDOR 0x7F/* 127 */ /** * struct rtw_ieee80211_bar - HT Block Ack Request @@ -934,6 +939,7 @@ typedef enum _HT_CAP_AMPDU_FACTOR { }HT_CAP_AMPDU_FACTOR; /* 802.11n HT capabilities masks */ +#define IEEE80211_HT_CAP_LDPC_CODING 0x0001 #define IEEE80211_HT_CAP_SUP_WIDTH 0x0002 #define IEEE80211_HT_CAP_SM_PS 0x000C #define IEEE80211_HT_CAP_GRN_FLD 0x0010 @@ -958,6 +964,11 @@ typedef enum _HT_CAP_AMPDU_FACTOR { #define IEEE80211_HT_CAP_MCS_TX_RX_DIFF 0x02 #define IEEE80211_HT_CAP_MCS_TX_STREAMS 0x0C #define IEEE80211_HT_CAP_MCS_TX_UEQM 0x10 +/* 802.11n HT capability TXBF capability */ +#define IEEE80211_HT_CAP_TXBF_RX_NDP 0x00000008 +#define IEEE80211_HT_CAP_TXBF_TX_NDP 0x00000010 +#define IEEE80211_HT_CAP_TXBF_EXPLICIT_COMP_STEERING_CAP 0x00000400 + /* 802.11n HT IE masks */ #define IEEE80211_HT_IE_CHA_SEC_OFFSET 0x03 #define IEEE80211_HT_IE_CHA_SEC_NONE 0x00 diff --git a/backports/drivers/realtek/rtl8812au/include/wlan_bssdef.h b/backports/drivers/realtek/rtl8812au/include/wlan_bssdef.h index dac17a05bb4457..3a885311f96509 100755 --- a/backports/drivers/realtek/rtl8812au/include/wlan_bssdef.h +++ b/backports/drivers/realtek/rtl8812au/include/wlan_bssdef.h @@ -85,7 +85,8 @@ typedef enum _NDIS_802_11_NETWORK_INFRASTRUCTURE Ndis802_11Infrastructure, Ndis802_11AutoUnknown, Ndis802_11InfrastructureMax, // Not a real value, defined as upper bound - Ndis802_11APMode + Ndis802_11APMode, + Ndis802_11Monitor, } NDIS_802_11_NETWORK_INFRASTRUCTURE, *PNDIS_802_11_NETWORK_INFRASTRUCTURE; diff --git a/backports/drivers/realtek/rtl8812au/include/xmit_osdep.h b/backports/drivers/realtek/rtl8812au/include/xmit_osdep.h index 79d0a8864bfedb..d489ebfcf6426c 100755 --- a/backports/drivers/realtek/rtl8812au/include/xmit_osdep.h +++ b/backports/drivers/realtek/rtl8812au/include/xmit_osdep.h @@ -92,5 +92,9 @@ extern sint rtw_endofpktfile (struct pkt_file *pfile); extern void rtw_os_pkt_complete(_adapter *padapter, _pkt *pkt); extern void rtw_os_xmit_complete(_adapter *padapter, struct xmit_frame *pxframe); +void rtw_os_wake_queue_at_free_stainfo(_adapter *padapter, int *qcnt_freed); + +void dump_os_queue(void *sel, _adapter *padapter); + #endif //__XMIT_OSDEP_H_ diff --git a/backports/drivers/realtek/rtl8812au/os_dep/linux/custom_gpio_linux.c b/backports/drivers/realtek/rtl8812au/os_dep/linux/custom_gpio_linux.c index 46ae1d140c682a..a574566d534889 100755 --- a/backports/drivers/realtek/rtl8812au/os_dep/linux/custom_gpio_linux.c +++ b/backports/drivers/realtek/rtl8812au/os_dep/linux/custom_gpio_linux.c @@ -277,7 +277,73 @@ void rtw_wifi_gpio_wlan_ctrl(int onoff) } #endif //ANDROID_2X -#else // !CONFIG_PLATFORM_SPRD +#elif defined(CONFIG_PLATFORM_ARM_RK3066) +#include + +#define GPIO_WIFI_IRQ RK30_PIN2_PC2 +extern unsigned int oob_irq; +int rtw_wifi_gpio_init(void) +{ +#ifdef CONFIG_GSPI_HCI + if (GPIO_WIFI_IRQ > 0) { + rk30_mux_api_set(GPIO2C2_LCDC1DATA18_SMCBLSN1_HSADCDATA5_NAME, GPIO2C_GPIO2C2);//jacky_test + gpio_request(GPIO_WIFI_IRQ, "oob_irq"); + gpio_direction_input(GPIO_WIFI_IRQ); + + oob_irq = gpio_to_irq(GPIO_WIFI_IRQ); + + DBG_8192C("%s oob_irq:%d\n", __func__, oob_irq); + } +#endif + return 0; +} + + +int rtw_wifi_gpio_deinit(void) +{ +#ifdef CONFIG_GSPI_HCI + if (GPIO_WIFI_IRQ > 0) + gpio_free(GPIO_WIFI_IRQ); +#endif + return 0; +} + +void rtw_wifi_gpio_wlan_ctrl(int onoff) +{ +} + +#ifdef CONFIG_GPIO_API +//this is a demo for extending GPIO pin[7] as interrupt mode +struct net_device * rtl_net; +extern int rtw_register_gpio_interrupt(struct net_device *netdev, int gpio_num, void(*callback)(u8 level)); +extern int rtw_disable_gpio_interrupt(struct net_device *netdev, int gpio_num); +void gpio_int(u8 is_high) +{ + DBG_8192C("%s level=%d\n",__func__, is_high); +} +int register_net_gpio_init(void) +{ + rtl_net = dev_get_by_name(&init_net,"wlan0"); + if(!rtl_net) + { + DBG_871X_LEVEL(_drv_always_, "rtl_net init fail!\n"); + return -1; + } + return rtw_register_gpio_interrupt(rtl_net,7, gpio_int); +} +int unregister_net_gpio_init(void) +{ + rtl_net = dev_get_by_name(&init_net,"wlan0"); + if(!rtl_net) + { + DBG_871X_LEVEL(_drv_always_, "rtl_net init fail!\n"); + return -1; + } + return rtw_disable_gpio_interrupt(rtl_net,7); +} +#endif + +#else int rtw_wifi_gpio_init(void) { diff --git a/backports/drivers/realtek/rtl8812au/os_dep/linux/ioctl_cfg80211.c b/backports/drivers/realtek/rtl8812au/os_dep/linux/ioctl_cfg80211.c index 277535d44505d7..87fd1f4d821f7b 100755 --- a/backports/drivers/realtek/rtl8812au/os_dep/linux/ioctl_cfg80211.c +++ b/backports/drivers/realtek/rtl8812au/os_dep/linux/ioctl_cfg80211.c @@ -28,7 +28,7 @@ #define RTW_MAX_MGMT_TX_CNT (8) #define RTW_SCAN_IE_LEN_MAX 2304 -#define RTW_MAX_REMAIN_ON_CHANNEL_DURATION 65535 //ms +#define RTW_MAX_REMAIN_ON_CHANNEL_DURATION 5000 //ms #define RTW_MAX_NUM_PMKIDS 4 #define RTW_CH_MAX_2G_CHANNEL 14 /* Max channel in 2G band */ @@ -53,6 +53,12 @@ #endif +#ifdef CONFIG_PLATFORM_ARM_SUN8I +#define BUSY_TRAFFIC_SCAN_DENY_PERIOD 8000 +#else +#define BUSY_TRAFFIC_SCAN_DENY_PERIOD 12000 +#endif + static const u32 rtw_cipher_suites[] = { WLAN_CIPHER_SUITE_WEP40, WLAN_CIPHER_SUITE_WEP104, @@ -91,6 +97,23 @@ static const u32 rtw_cipher_suites[] = { .max_power = 30, \ } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0)) +/* if wowlan is not supported, kernel generate a disconnect at each suspend + * cf: /net/wireless/sysfs.c, so register a stub wowlan. + * Moreover wowlan has to be enabled via a the nl80211_set_wowlan callback. + * (from user space, e.g. iw phy0 wowlan enable) + */ +static const struct wiphy_wowlan_support wowlan_stub = { + .flags = WIPHY_WOWLAN_ANY, + .n_patterns = 0, + .pattern_max_len = 0, + .pattern_min_len = 0, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)) + .max_pkt_offset = 0, +#endif +}; +#endif + static struct ieee80211_rate rtw_rates[] = { RATETAB_ENT(10, 0x1, 0), RATETAB_ENT(20, 0x2, 0), @@ -333,6 +356,19 @@ static int rtw_ieee80211_channel_to_frequency(int chan, int band) } } +static u64 rtw_get_systime_us(void) +{ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) + struct timespec ts; + get_monotonic_boottime(&ts); + return ((u64)ts.tv_sec*1000000) + ts.tv_nsec / 1000; +#else + struct timeval tv; + do_gettimeofday(&tv); + return ((u64)tv.tv_sec*1000000) + tv.tv_usec; +#endif +} + #define MAX_BSSINFO_LEN 1000 struct cfg80211_bss *rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_network *pnetwork) { @@ -347,7 +383,10 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_net u8 *notify_ie; size_t notify_ielen; s32 notify_signal; - u8 buf[MAX_BSSINFO_LEN], *pbuf; + //u8 buf[MAX_BSSINFO_LEN]; + + u8 *pbuf; + size_t buf_size = MAX_BSSINFO_LEN; size_t len,bssinf_len=0; struct rtw_ieee80211_hdr *pwlanhdr; unsigned short *fctrl; @@ -357,12 +396,17 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_net struct wiphy *wiphy = wdev->wiphy; struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); - + pbuf = rtw_zmalloc(buf_size); + if(pbuf == NULL){ + DBG_871X("%s pbuf allocate failed !! \n",__FUNCTION__); + return bss; + } + //DBG_8192C("%s\n", __func__); bssinf_len = pnetwork->network.IELength+sizeof (struct rtw_ieee80211_hdr_3addr); - if(bssinf_len > MAX_BSSINFO_LEN){ - DBG_871X("%s IE Length too long > %d byte \n",__FUNCTION__,MAX_BSSINFO_LEN); + if(bssinf_len > buf_size){ + DBG_871X("%s IE Length too long > %zu byte \n",__FUNCTION__,buf_size); goto exit; } @@ -464,13 +508,14 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_net notify_channel = ieee80211_get_channel(wiphy, freq); - //rtw_get_timestampe_from_ie() - notify_timestamp = jiffies_to_msecs(jiffies)*1000; /* uSec */ + if (0) + notify_timestamp = le64_to_cpu(*(u64*)rtw_get_timestampe_from_ie(pnetwork->network.IEs)); + else + notify_timestamp = rtw_get_systime_us(); notify_interval = le16_to_cpu(*(u16*)rtw_get_beacon_interval_from_ie(pnetwork->network.IEs)); notify_capability = le16_to_cpu(*(u16*)rtw_get_capability_from_ie(pnetwork->network.IEs)); - notify_ie = pnetwork->network.IEs+_FIXED_IE_LENGTH_; notify_ielen = pnetwork->network.IELength-_FIXED_IE_LENGTH_; @@ -488,10 +533,10 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_net DBG_8192C("Capability: %X\n", notify_capability); DBG_8192C("Beacon interval: %d\n", notify_interval); DBG_8192C("Signal: %d\n", notify_signal); - DBG_8192C("notify_timestamp: %#018llx\n", notify_timestamp); + DBG_8192C("notify_timestamp: %llu\n", notify_timestamp); #endif - pbuf = buf; + //pbuf = buf; pwlanhdr = (struct rtw_ieee80211_hdr *)pbuf; fctrl = &(pwlanhdr->frame_ctl); @@ -512,11 +557,12 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_net _rtw_memcpy(pwlanhdr->addr3, pnetwork->network.MacAddress, ETH_ALEN); - pbuf += sizeof(struct rtw_ieee80211_hdr_3addr); + //pbuf += sizeof(struct rtw_ieee80211_hdr_3addr); len = sizeof (struct rtw_ieee80211_hdr_3addr); - - _rtw_memcpy(pbuf, pnetwork->network.IEs, pnetwork->network.IELength); - len += pnetwork->network.IELength; + _rtw_memcpy((pbuf+len), pnetwork->network.IEs, pnetwork->network.IELength); + *((u64*)(pbuf+len)) = cpu_to_le64(notify_timestamp); + + len += pnetwork->network.IELength; //#ifdef CONFIG_P2P //if(rtw_get_p2p_ie(pnetwork->network.IEs+12, pnetwork->network.IELength-12, NULL, NULL)) @@ -524,10 +570,9 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_net // DBG_8192C("%s, got p2p_ie\n", __func__); //} //#endif - #if 1 - bss = cfg80211_inform_bss_frame(wiphy, notify_channel, (struct ieee80211_mgmt *)buf, + bss = cfg80211_inform_bss_frame(wiphy, notify_channel, (struct ieee80211_mgmt *)pbuf, len, notify_signal, GFP_ATOMIC); #else @@ -577,8 +622,10 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_net #else cfg80211_put_bss(bss); #endif - -exit: + +exit: + if(pbuf) + rtw_mfree(pbuf, buf_size); return bss; } @@ -610,6 +657,12 @@ int rtw_cfg80211_check_bss(_adapter *padapter) pnetwork->Ssid.SsidLength, WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) + cfg80211_put_bss(padapter->rtw_wdev->wiphy, bss); +#else + cfg80211_put_bss(bss); +#endif + return (bss!=NULL); } @@ -619,6 +672,11 @@ void rtw_cfg80211_ibss_indicate_connect(_adapter *padapter) struct wlan_network *cur_network = &(pmlmepriv->cur_network); struct wireless_dev *pwdev = padapter->rtw_wdev; struct cfg80211_bss *bss = NULL; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)) + struct wiphy *wiphy = pwdev->wiphy; + int freq = (int)cur_network->network.Configuration.DSConfig; + struct ieee80211_channel *chan; +#endif DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(padapter)); if (pwdev->iftype != NL80211_IFTYPE_ADHOC) @@ -670,7 +728,12 @@ void rtw_cfg80211_ibss_indicate_connect(_adapter *padapter) DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" BSS not found !!\n", FUNC_ADPT_ARG(padapter)); } //notify cfg80211 that device joined an IBSS +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)) + chan = ieee80211_get_channel(wiphy, freq); + cfg80211_ibss_joined(padapter->pnetdev, cur_network->network.MacAddress, chan, GFP_ATOMIC); +#else cfg80211_ibss_joined(padapter->pnetdev, cur_network->network.MacAddress, GFP_ATOMIC); +#endif } void rtw_cfg80211_indicate_connect(_adapter *padapter) @@ -769,14 +832,18 @@ void rtw_cfg80211_indicate_connect(_adapter *padapter) } else { + #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0) || defined(COMPAT_KERNEL_RELEASE) DBG_8192C("pwdev->sme_state(b)=%d\n", pwdev->sme_state); + #endif cfg80211_connect_result(padapter->pnetdev, cur_network->network.MacAddress , pmlmepriv->assoc_req+sizeof(struct rtw_ieee80211_hdr_3addr)+2 , pmlmepriv->assoc_req_len-sizeof(struct rtw_ieee80211_hdr_3addr)-2 , pmlmepriv->assoc_rsp+sizeof(struct rtw_ieee80211_hdr_3addr)+6 , pmlmepriv->assoc_rsp_len-sizeof(struct rtw_ieee80211_hdr_3addr)-6 , WLAN_STATUS_SUCCESS, GFP_ATOMIC); + #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0) || defined(COMPAT_KERNEL_RELEASE) DBG_8192C("pwdev->sme_state(a)=%d\n", pwdev->sme_state); + #endif } } @@ -815,6 +882,7 @@ void rtw_cfg80211_indicate_disconnect(_adapter *padapter) #endif //CONFIG_P2P if (!padapter->mlmepriv.not_indic_disco) { + #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0) || defined(COMPAT_KERNEL_RELEASE) DBG_8192C("pwdev->sme_state(b)=%d\n", pwdev->sme_state); if(pwdev->sme_state==CFG80211_SME_CONNECTING) @@ -826,6 +894,18 @@ void rtw_cfg80211_indicate_disconnect(_adapter *padapter) //DBG_8192C("pwdev->sme_state=%d\n", pwdev->sme_state); DBG_8192C("pwdev->sme_state(a)=%d\n", pwdev->sme_state); + #else + + if(check_fwstate(&padapter->mlmepriv, _FW_LINKED)) + #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) + cfg80211_disconnected(padapter->pnetdev, 0, NULL, 0, false, GFP_ATOMIC); + #else + cfg80211_disconnected(padapter->pnetdev, 0, NULL, 0, GFP_ATOMIC); + #endif + else + cfg80211_connect_result(padapter->pnetdev, NULL, NULL, 0, NULL, 0, + WLAN_STATUS_UNSPECIFIED_FAILURE, GFP_ATOMIC/*GFP_KERNEL*/); + #endif } } @@ -1257,7 +1337,7 @@ _func_enter_; //DEBUG_ERR((" param->u.crypt.key_len=%d\n",param->u.crypt.key_len)); DBG_871X(" ~~~~set sta key:unicastkey\n"); - rtw_setstakey_cmd(padapter, (unsigned char *)psta, _TRUE, _TRUE); + rtw_setstakey_cmd(padapter, psta, UNICAST_KEY, _TRUE); } else//group key { @@ -1271,14 +1351,7 @@ _func_enter_; DBG_871X(" ~~~~set sta key:groupkey\n"); padapter->securitypriv.dot118021XGrpKeyid = param->u.crypt.idx; -#ifdef CONFIG_CONCURRENT_MODE - if (padapter->adapter_type == PRIMARY_ADAPTER) - rtw_set_key(padapter,&padapter->securitypriv,param->u.crypt.idx, 1, _TRUE); - else - DBG_871X_LEVEL(_drv_always_, "second interface do not set cam.\n"); -#else rtw_set_key(padapter,&padapter->securitypriv,param->u.crypt.idx, 1, _TRUE); -#endif } #ifdef CONFIG_IEEE80211W else if(strcmp(param->u.crypt.alg, "BIP") == 0) @@ -1424,6 +1497,9 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, _adapter *padapter = (_adapter *)rtw_netdev_priv(ndev); struct wireless_dev *rtw_wdev = padapter->rtw_wdev; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; +#ifdef CONFIG_TDLS + struct sta_info *ptdls_sta; +#endif /* CONFIG_TDLS */ DBG_871X(FUNC_NDEV_FMT" adding key for %pM\n", FUNC_NDEV_ARG(ndev), mac_addr); DBG_871X("cipher=0x%x\n", params->cipher); @@ -1502,17 +1578,28 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, if (params->seq_len && params->seq) { - _rtw_memcpy(param->u.crypt.seq, params->seq, params->seq_len); + _rtw_memcpy(param->u.crypt.seq, (u8 *)params->seq, params->seq_len); } if(params->key_len && params->key) { param->u.crypt.key_len = params->key_len; - _rtw_memcpy(param->u.crypt.key, params->key, params->key_len); + _rtw_memcpy(param->u.crypt.key, (u8 *)params->key, params->key_len); } if(check_fwstate(pmlmepriv, WIFI_STATION_STATE) == _TRUE) { +#ifdef CONFIG_TDLS + if (rtw_tdls_is_driver_setup(padapter) == _FALSE && mac_addr) { + ptdls_sta = rtw_get_stainfo(&padapter->stapriv, (void *)mac_addr); + if (ptdls_sta != NULL && ptdls_sta->tdls_sta_state) { + _rtw_memcpy(ptdls_sta->tpk.tk, params->key, params->key_len); + rtw_tdls_set_key(padapter, ptdls_sta); + goto addkey_end; + } + } +#endif /* CONFIG_TDLS */ + ret = rtw_cfg80211_set_encryption(ndev, param, param_len); } else if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE) @@ -1524,6 +1611,12 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, ret = rtw_cfg80211_ap_set_encryption(ndev, param, param_len); #endif } + else if(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == _TRUE + || check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE) + { + //DBG_8192C("@@@@@@@@@@ fw_state=0x%x, iftype=%d\n", pmlmepriv->fw_state, rtw_wdev->iftype); + ret = rtw_cfg80211_set_encryption(ndev, param, param_len); + } else { DBG_8192C("error! fw_state=0x%x, iftype=%d\n", pmlmepriv->fw_state, rtw_wdev->iftype); @@ -1636,8 +1729,13 @@ static int cfg80211_rtw_set_default_key(struct wiphy *wiphy, } static int cfg80211_rtw_get_station(struct wiphy *wiphy, - struct net_device *ndev, - u8 *mac, struct station_info *sinfo) + struct net_device *ndev, +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0)) + u8 *mac, +#else + const u8 *mac, +#endif + struct station_info *sinfo) { int ret = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(ndev); @@ -1653,7 +1751,7 @@ static int cfg80211_rtw_get_station(struct wiphy *wiphy, goto exit; } - psta = rtw_get_stainfo(pstapriv, mac); + psta = rtw_get_stainfo(pstapriv, (u8 *)mac); if (psta == NULL) { DBG_8192C("%s, sta_info is null\n", __func__); ret = -ENOENT; @@ -1671,22 +1769,38 @@ static int cfg80211_rtw_get_station(struct wiphy *wiphy, { struct wlan_network *cur_network = &(pmlmepriv->cur_network); - if (_rtw_memcmp(mac, cur_network->network.MacAddress, ETH_ALEN) == _FALSE) { + if (_rtw_memcmp((u8 *)mac, cur_network->network.MacAddress, ETH_ALEN) == _FALSE) { DBG_871X("%s, mismatch bssid="MAC_FMT"\n", __func__, MAC_ARG(cur_network->network.MacAddress)); ret = -ENOENT; goto exit; } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) + sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL); +#else sinfo->filled |= STATION_INFO_SIGNAL; +#endif sinfo->signal = translate_percentage_to_dbm(padapter->recvpriv.signal_strength); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) + sinfo->filled |= BIT(NL80211_STA_INFO_TX_BITRATE); +#else sinfo->filled |= STATION_INFO_TX_BITRATE; +#endif sinfo->txrate.legacy = rtw_get_cur_max_rate(padapter); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) + sinfo->filled |= BIT(NL80211_STA_INFO_RX_PACKETS); +#else sinfo->filled |= STATION_INFO_RX_PACKETS; +#endif sinfo->rx_packets = sta_rx_data_pkts(psta); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) + sinfo->filled |= BIT(NL80211_STA_INFO_TX_PACKETS); +#else sinfo->filled |= STATION_INFO_TX_PACKETS; +#endif sinfo->tx_packets = psta->sta_stats.tx_pkts; } @@ -1743,7 +1857,7 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy, int ret = 0; u8 change = _FALSE; - DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev)); + DBG_871X(FUNC_NDEV_FMT" type=%d\n", FUNC_NDEV_ARG(ndev), type); if(adapter_to_dvobj(padapter)->processing_dev_remove == _TRUE) { @@ -1756,6 +1870,7 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy, { DBG_871X(FUNC_NDEV_FMT" call netdev_if2_open\n", FUNC_NDEV_ARG(ndev)); if(netdev_if2_open(ndev) != 0) { + DBG_871X(FUNC_NDEV_FMT" call netdev_if2_open fail\n", FUNC_NDEV_ARG(ndev)); ret= -EPERM; goto exit; } @@ -1765,12 +1880,14 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy, { DBG_871X(FUNC_NDEV_FMT" call netdev_open\n", FUNC_NDEV_ARG(ndev)); if(netdev_open(ndev) != 0) { + DBG_871X(FUNC_NDEV_FMT" call netdev_open fail\n", FUNC_NDEV_ARG(ndev)); ret= -EPERM; goto exit; } } if(_FAIL == rtw_pwr_wakeup(padapter)) { + DBG_871X(FUNC_NDEV_FMT" call rtw_pwr_wakeup fail\n", FUNC_NDEV_ARG(ndev)); ret= -EPERM; goto exit; } @@ -1785,7 +1902,10 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy, pmlmeext->action_public_rxseq = 0xffff; pmlmeext->action_public_dialog_token = 0xff; } - + + /* initial default type */ + ndev->type = ARPHRD_ETHER; + switch (type) { case NL80211_IFTYPE_ADHOC: networkType = Ndis802_11IBSS; @@ -1824,9 +1944,17 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy, } } #endif //CONFIG_P2P - break; + break; + case NL80211_IFTYPE_MONITOR: + networkType = Ndis802_11Monitor; +#if 0 + ndev->type = ARPHRD_IEEE80211; /* IEEE 802.11 : 801 */ +#endif + ndev->type = ARPHRD_IEEE80211_RADIOTAP; /* IEEE 802.11 + radiotap header : 803 */ + break; default: - return -EOPNOTSUPP; + ret = -EOPNOTSUPP; + goto exit; } rtw_wdev->iftype = type; @@ -1842,6 +1970,7 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy, exit: + DBG_871X(FUNC_NDEV_FMT" ret:%d\n", FUNC_NDEV_ARG(ndev), ret); return ret; } @@ -1875,6 +2004,30 @@ void rtw_cfg80211_indicate_scan_done(_adapter *adapter, bool aborted) _exit_critical_bh(&pwdev_priv->scan_req_lock, &irqL); } +void rtw_cfg80211_unlink_bss(_adapter *padapter, struct wlan_network *pnetwork) +{ + struct wireless_dev *pwdev = padapter->rtw_wdev; + struct wiphy *wiphy = pwdev->wiphy; + struct cfg80211_bss *bss = NULL; + WLAN_BSSID_EX select_network = pnetwork->network; + + bss = cfg80211_get_bss(wiphy, NULL/*notify_channel*/, + select_network.MacAddress, select_network.Ssid.Ssid, + select_network.Ssid.SsidLength, 0/*WLAN_CAPABILITY_ESS*/, + 0/*WLAN_CAPABILITY_ESS*/); + + if (bss) { + cfg80211_unlink_bss(wiphy, bss); + DBG_8192C("%s(): cfg80211_unlink %s!! () ",__func__,select_network.Ssid.Ssid ); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) + cfg80211_put_bss(padapter->rtw_wdev->wiphy, bss); +#else + cfg80211_put_bss(bss); +#endif + } + return; +} + void rtw_cfg80211_surveydone_event_callback(_adapter *padapter) { _irqL irqL; @@ -1915,7 +2068,16 @@ void rtw_cfg80211_surveydone_event_callback(_adapter *padapter) //ev=translate_scan(padapter, a, pnetwork, ev, stop); rtw_cfg80211_inform_bss(padapter, pnetwork); } - + /* //check ralink testbed RSN IE length + { + if(_rtw_memcmp(pnetwork->network.Ssid.Ssid, "Ralink_11n_AP",13)) + { + uint ie_len=0; + u8 *p=NULL; + p = rtw_get_ie(pnetwork->network.IEs + _BEACON_IE_OFFSET_, _RSN_IE_2_, &ie_len, (pnetwork->network.IELength - _BEACON_IE_OFFSET_)); + DBG_871X("ie_len=%d\n", ie_len); + } + }*/ plist = get_next(plist); } @@ -2207,7 +2369,7 @@ if (padapter->registrypriv.mp_mode == 1) passtime = rtw_get_passing_time_ms(lastscantime); lastscantime = rtw_get_current_time(); - if (passtime > 12000) + if (passtime > BUSY_TRAFFIC_SCAN_DENY_PERIOD) #endif { DBG_871X("%s: bBusyTraffic == _TRUE\n", __FUNCTION__); @@ -2231,10 +2393,10 @@ if (padapter->registrypriv.mp_mode == 1) passtime = rtw_get_passing_time_ms(buddylastscantime); buddylastscantime = rtw_get_current_time(); - if ((passtime > 12000) -#ifdef CONFIG_P2P - ||(!rtw_p2p_chk_state(&padapter->wdinfo, P2P_STATE_NONE)) -#endif //CONFIG_P2P + if ((passtime > BUSY_TRAFFIC_SCAN_DENY_PERIOD) +//#ifdef CONFIG_P2P +// ||(!rtw_p2p_chk_state(&padapter->wdinfo, P2P_STATE_NONE)) +//#endif //CONFIG_P2P ) #endif { @@ -2244,36 +2406,45 @@ if (padapter->registrypriv.mp_mode == 1) } } - if (check_buddy_fwstate(padapter, - _FW_UNDER_SURVEY|_FW_UNDER_LINKING|WIFI_UNDER_WPS) == _TRUE) - { - if(check_buddy_fwstate(padapter, _FW_UNDER_SURVEY)) - { - DBG_8192C("scanning_via_buddy_intf\n"); + if (check_buddy_fwstate(padapter, _FW_UNDER_LINKING|WIFI_UNDER_WPS) == _TRUE) { + DBG_871X("buddy_intf's mlme state:0x%x\n", pbuddy_mlmepriv->fw_state); + need_indicate_scan_done = _TRUE; + goto check_need_indicate_scan_done; + + } else if (check_buddy_fwstate(padapter, _FW_UNDER_SURVEY)) { + bool scan_via_buddy = _FALSE; + struct rtw_wdev_priv *buddy_wdev_priv = adapter_wdev_data(pbuddy_adapter); + + _enter_critical_bh(&pwdev_priv->scan_req_lock, &irqL); + _enter_critical_bh(&buddy_wdev_priv->scan_req_lock, &irqL); + if (buddy_wdev_priv->scan_request) { + DBG_871X("scan via buddy\n"); pmlmepriv->scanning_via_buddy_intf = _TRUE; - } + _enter_critical_bh(&pmlmepriv->lock, &irqL); + set_fwstate(pmlmepriv, _FW_UNDER_SURVEY); + _exit_critical_bh(&pmlmepriv->lock, &irqL); + scan_via_buddy = _TRUE; + } + _exit_critical_bh(&buddy_wdev_priv->scan_req_lock, &irqL); + _exit_critical_bh(&pwdev_priv->scan_req_lock, &irqL); + + if (scan_via_buddy == _FALSE) + need_indicate_scan_done = _TRUE; - DBG_8192C("buddy_intf's mlme state:0x%x\n", pbuddy_mlmepriv->fw_state); - - need_indicate_scan_done = _TRUE; goto check_need_indicate_scan_done; } -#endif - +#endif /* CONFIG_CONCURRENT_MODE */ #ifdef CONFIG_P2P - if( pwdinfo->driver_interface == DRIVER_CFG80211 ) + if(!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE) && !rtw_p2p_chk_state(pwdinfo, P2P_STATE_IDLE)) { - if(!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE) && !rtw_p2p_chk_state(pwdinfo, P2P_STATE_IDLE)) - { - rtw_p2p_set_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH); - rtw_free_network_queue(padapter, _TRUE); + rtw_p2p_set_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH); + rtw_free_network_queue(padapter, _TRUE); - if(social_channel == 0) - rtw_p2p_findphase_ex_set(pwdinfo, P2P_FINDPHASE_EX_NONE); - else - rtw_p2p_findphase_ex_set(pwdinfo, P2P_FINDPHASE_EX_SOCIAL_LAST); - } + if(social_channel == 0) + rtw_p2p_findphase_ex_set(pwdinfo, P2P_FINDPHASE_EX_NONE); + else + rtw_p2p_findphase_ex_set(pwdinfo, P2P_FINDPHASE_EX_SOCIAL_LAST); } #endif //CONFIG_P2P @@ -2809,7 +2980,7 @@ static int cfg80211_rtw_join_ibss(struct wiphy *wiphy, struct net_device *ndev, _rtw_memset(&ndis_ssid, 0, sizeof(NDIS_802_11_SSID)); ndis_ssid.SsidLength = params->ssid_len; - _rtw_memcpy(ndis_ssid.Ssid, params->ssid, params->ssid_len); + _rtw_memcpy(ndis_ssid.Ssid, (u8 *)params->ssid, params->ssid_len); //DBG_8192C("ssid=%s, len=%zu\n", ndis_ssid.Ssid, params->ssid_len); @@ -2902,7 +3073,7 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev, goto exit; } -#ifdef CONFIG_PLATFORM_MSTAR +#ifdef CONFIG_PLATFORM_MSTAR_SCAN_BEFORE_CONNECT printk("MStar Android!\n"); if(adapter_wdev_data(padapter)->bandroid_scan == _FALSE) { @@ -2954,7 +3125,7 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev, _rtw_memset(&ndis_ssid, 0, sizeof(NDIS_802_11_SSID)); ndis_ssid.SsidLength = sme->ssid_len; - _rtw_memcpy(ndis_ssid.Ssid, sme->ssid, sme->ssid_len); + _rtw_memcpy(ndis_ssid.Ssid, (u8 *)sme->ssid, sme->ssid_len); DBG_8192C("ssid=%s, len=%zu\n", ndis_ssid.Ssid, sme->ssid_len); @@ -3008,7 +3179,7 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev, DBG_8192C("%s, ie_len=%zu\n", __func__, sme->ie_len); - ret = rtw_cfg80211_set_wpa_ie(padapter, sme->ie, sme->ie_len); + ret = rtw_cfg80211_set_wpa_ie(padapter, (u8 *)sme->ie, sme->ie_len); if (ret < 0) goto exit; @@ -3104,7 +3275,7 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev, //rtw_set_802_11_encryption_mode(padapter, padapter->securitypriv.ndisencryptstatus); - if (rtw_set_802_11_connect(padapter, sme->bssid, &ndis_ssid) == _FALSE) { + if (rtw_set_802_11_connect(padapter, (u8 *)sme->bssid, &ndis_ssid) == _FALSE) { ret = -1; goto exit; } @@ -3238,26 +3409,33 @@ static int cfg80211_rtw_set_pmksa(struct wiphy *wiphy, { u8 index,blInserted = _FALSE; _adapter *padapter = (_adapter *)rtw_netdev_priv(ndev); + struct mlme_priv *mlme = &padapter->mlmepriv; struct security_priv *psecuritypriv = &padapter->securitypriv; u8 strZeroMacAddress[ ETH_ALEN ] = { 0x00 }; - DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev)); + DBG_871X(FUNC_NDEV_FMT" "MAC_FMT" "KEY_FMT"\n", FUNC_NDEV_ARG(ndev) + , MAC_ARG(pmksa->bssid), KEY_ARG(pmksa->pmkid)); - if ( _rtw_memcmp( pmksa->bssid, strZeroMacAddress, ETH_ALEN ) == _TRUE ) + if ( _rtw_memcmp((u8 *)pmksa->bssid, strZeroMacAddress, ETH_ALEN ) == _TRUE ) { return -EINVAL; } + if (check_fwstate(mlme, _FW_LINKED) == _FALSE) { + DBG_871X(FUNC_NDEV_FMT" not set pmksa cause not in linked state\n", FUNC_NDEV_ARG(ndev)); + return -EINVAL; + } + blInserted = _FALSE; //overwrite PMKID for(index=0 ; indexPMKIDList[index].Bssid, pmksa->bssid, ETH_ALEN) ==_TRUE ) + if( _rtw_memcmp(psecuritypriv->PMKIDList[index].Bssid, (u8 *)pmksa->bssid, ETH_ALEN) ==_TRUE ) { // BSSID is matched, the same AP => rewrite with new PMKID. DBG_871X(FUNC_NDEV_FMT" BSSID exists in the PMKList.\n", FUNC_NDEV_ARG(ndev)); - _rtw_memcpy( psecuritypriv->PMKIDList[index].PMKID, pmksa->pmkid, WLAN_PMKID_LEN); + _rtw_memcpy( psecuritypriv->PMKIDList[index].PMKID, (u8 *)pmksa->pmkid, WLAN_PMKID_LEN); psecuritypriv->PMKIDList[index].bUsed = _TRUE; psecuritypriv->PMKIDIndex = index+1; blInserted = _TRUE; @@ -3271,8 +3449,8 @@ static int cfg80211_rtw_set_pmksa(struct wiphy *wiphy, DBG_871X(FUNC_NDEV_FMT" Use the new entry index = %d for this PMKID.\n", FUNC_NDEV_ARG(ndev), psecuritypriv->PMKIDIndex ); - _rtw_memcpy(psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].Bssid, pmksa->bssid, ETH_ALEN); - _rtw_memcpy(psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].PMKID, pmksa->pmkid, WLAN_PMKID_LEN); + _rtw_memcpy(psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].Bssid, (u8 *)pmksa->bssid, ETH_ALEN); + _rtw_memcpy(psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].PMKID, (u8 *)pmksa->pmkid, WLAN_PMKID_LEN); psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].bUsed = _TRUE; psecuritypriv->PMKIDIndex++ ; @@ -3293,16 +3471,18 @@ static int cfg80211_rtw_del_pmksa(struct wiphy *wiphy, _adapter *padapter = (_adapter *)rtw_netdev_priv(ndev); struct security_priv *psecuritypriv = &padapter->securitypriv; - DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev)); + DBG_871X(FUNC_NDEV_FMT" "MAC_FMT" "KEY_FMT"\n", FUNC_NDEV_ARG(ndev) + , MAC_ARG(pmksa->bssid), KEY_ARG(pmksa->pmkid)); for(index=0 ; indexPMKIDList[index].Bssid, pmksa->bssid, ETH_ALEN) ==_TRUE ) + if( _rtw_memcmp(psecuritypriv->PMKIDList[index].Bssid, (u8 *)pmksa->bssid, ETH_ALEN) ==_TRUE ) { // BSSID is matched, the same AP => Remove this PMKID information and reset it. - _rtw_memset( psecuritypriv->PMKIDList[index].Bssid, 0x00, ETH_ALEN ); - _rtw_memset( psecuritypriv->PMKIDList[index].PMKID, 0x00, WLAN_PMKID_LEN ); + _rtw_memset(psecuritypriv->PMKIDList[index].Bssid, 0x00, ETH_ALEN ); + _rtw_memset(psecuritypriv->PMKIDList[index].PMKID, 0x00, WLAN_PMKID_LEN ); psecuritypriv->PMKIDList[index].bUsed = _FALSE; bMatched = _TRUE; + DBG_871X(FUNC_NDEV_FMT" clear id:%hhu\n", FUNC_NDEV_ARG(ndev), index); break; } } @@ -3352,7 +3532,9 @@ void rtw_cfg80211_indicate_sta_assoc(_adapter *padapter, u8 *pmgmt_frame, uint f ie_offset = _REASOCREQ_IE_OFFSET_; sinfo.filled = 0; +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)) sinfo.filled = STATION_INFO_ASSOC_REQ_IES; +#endif sinfo.assoc_req_ies = pmgmt_frame + WLAN_HDR_A3_LEN + ie_offset; sinfo.assoc_req_ies_len = frame_len - WLAN_HDR_A3_LEN - ie_offset; cfg80211_new_sta(ndev, GetAddr2Ptr(pmgmt_frame), &sinfo, GFP_ATOMIC); @@ -3744,6 +3926,9 @@ static int const char *name, #else char *name, + #endif + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0)) + unsigned char name_assign_type, #endif enum nl80211_iftype type, u32 *flags, struct vif_params *params) { @@ -3987,9 +4172,9 @@ static int cfg80211_rtw_start_ap(struct wiphy *wiphy, struct net_device *ndev, WLAN_BSSID_EX *pbss_network_ext = &adapter->mlmeextpriv.mlmext_info.network; if(0) - DBG_871X(FUNC_ADPT_FMT" ssid:(%s,%d), from ie:(%s,%d)\n", FUNC_ADPT_ARG(adapter), - settings->ssid, settings->ssid_len, - pbss_network->Ssid.Ssid, pbss_network->Ssid.SsidLength); + DBG_871X(FUNC_ADPT_FMT" ssid:(%s,%zu), from ie:(%s,%d)\n", FUNC_ADPT_ARG(adapter), + settings->ssid, settings->ssid_len, + pbss_network->Ssid.Ssid, pbss_network->Ssid.SsidLength); _rtw_memcpy(pbss_network->Ssid.Ssid, (void *)settings->ssid, settings->ssid_len); pbss_network->Ssid.SsidLength = settings->ssid_len; @@ -3997,9 +4182,9 @@ static int cfg80211_rtw_start_ap(struct wiphy *wiphy, struct net_device *ndev, pbss_network_ext->Ssid.SsidLength = settings->ssid_len; if(0) - DBG_871X(FUNC_ADPT_FMT" after ssid:(%s,%d), (%s,%d)\n", FUNC_ADPT_ARG(adapter), - pbss_network->Ssid.Ssid, pbss_network->Ssid.SsidLength, - pbss_network_ext->Ssid.Ssid, pbss_network_ext->Ssid.SsidLength); + DBG_871X(FUNC_ADPT_FMT" after ssid:(%s,%d), (%s,%d)\n", FUNC_ADPT_ARG(adapter), + pbss_network->Ssid.Ssid, pbss_network->Ssid.SsidLength, + pbss_network_ext->Ssid.Ssid, pbss_network_ext->Ssid.SsidLength); } return ret; @@ -4027,16 +4212,50 @@ static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev) #endif //(LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) static int cfg80211_rtw_add_station(struct wiphy *wiphy, struct net_device *ndev, - u8 *mac, struct station_parameters *params) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0)) + u8 *mac, +#else + const u8 *mac, +#endif + struct station_parameters *params) { + int ret = 0; +#ifdef CONFIG_TDLS + _adapter *padapter = (_adapter *)rtw_netdev_priv(ndev); + struct sta_priv *pstapriv = &padapter->stapriv; + struct sta_info *psta; +#endif /* CONFIG_TDLS */ DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev)); - return 0; +#ifdef CONFIG_TDLS + psta = rtw_get_stainfo(pstapriv, mac); + if (psta == NULL) { + psta = rtw_alloc_stainfo(pstapriv, mac); + if (psta ==NULL) { + DBG_871X("[%s] Alloc station for "MAC_FMT" fail\n", __FUNCTION__, MAC_ARG(mac)); + ret =-EOPNOTSUPP; + goto exit; + } + } +#endif /* CONFIG_TDLS */ + +exit: + return ret; } static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev, - u8 *mac) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0)) + u8 *mac +#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)) + const u8 *mac +#else + struct station_del_parameters *params +#endif + ) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)) + const u8 *mac = params->mac; +#endif int ret=0; _irqL irqL; _list *phead, *plist; @@ -4089,7 +4308,7 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev plist = get_next(plist); - if(_rtw_memcmp(mac, psta->hwaddr, ETH_ALEN)) + if(_rtw_memcmp((u8 *)mac, psta->hwaddr, ETH_ALEN)) { if(psta->dot8021xalg == 1 && psta->bpairwise_key_installed == _FALSE) { @@ -4126,21 +4345,70 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev } static int cfg80211_rtw_change_station(struct wiphy *wiphy, struct net_device *ndev, - u8 *mac, struct station_parameters *params) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0)) + u8 *mac, +#else + const u8 *mac, +#endif + struct station_parameters *params) { DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev)); return 0; } +struct sta_info *rtw_sta_info_get_by_idx(const int idx, struct sta_priv *pstapriv) + +{ + + _list *phead, *plist; + struct sta_info *psta = NULL; + int i = 0; + + phead = &pstapriv->asoc_list; + plist = get_next(phead); + + //check asoc_queue + while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) + { + if(idx == i) psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list); + plist = get_next(plist); + i++; + } + return psta; +} + static int cfg80211_rtw_dump_station(struct wiphy *wiphy, struct net_device *ndev, int idx, u8 *mac, struct station_info *sinfo) { - DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev)); - //TODO: dump scanned queue + int ret = 0; + _irqL irqL; + _adapter *padapter = (_adapter *)rtw_netdev_priv(ndev); + struct sta_info *psta = NULL; + struct sta_priv *pstapriv = &padapter->stapriv; + DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev)); - return -ENOENT; + _enter_critical_bh(&pstapriv->asoc_list_lock, &irqL); + psta = rtw_sta_info_get_by_idx(idx, pstapriv); + _exit_critical_bh(&pstapriv->asoc_list_lock, &irqL); + if(NULL == psta) + { + DBG_871X("Station is not found\n"); + ret = -ENOENT; + goto exit; + } + _rtw_memcpy(mac, psta->hwaddr, ETH_ALEN); + sinfo->filled = 0; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) + sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL); +#else + sinfo->filled |= STATION_INFO_SIGNAL; +#endif + sinfo->signal = psta->rssi; + +exit: + return ret; } static int cfg80211_rtw_change_bss(struct wiphy *wiphy, struct net_device *ndev, @@ -4172,10 +4440,37 @@ static int cfg80211_rtw_set_channel(struct wiphy *wiphy #endif , struct ieee80211_channel *chan, enum nl80211_channel_type channel_type) { + int chan_target = (u8) ieee80211_frequency_to_channel(chan->center_freq); + int chan_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; + int chan_width = CHANNEL_WIDTH_20; + _adapter *padapter = wiphy_to_adapter(wiphy); + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev)); #endif - + + switch (channel_type) { + case NL80211_CHAN_NO_HT: + case NL80211_CHAN_HT20: + chan_width = CHANNEL_WIDTH_20; + chan_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; + break; + case NL80211_CHAN_HT40MINUS: + chan_width = CHANNEL_WIDTH_40; + chan_offset = HAL_PRIME_CHNL_OFFSET_UPPER; + break; + case NL80211_CHAN_HT40PLUS: + chan_width = CHANNEL_WIDTH_40; + chan_offset = HAL_PRIME_CHNL_OFFSET_LOWER; + break; + default: + chan_width = CHANNEL_WIDTH_20; + chan_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; + break; + } + + set_channel_bwmode(padapter, chan_target, chan_offset, chan_width); + return 0; } @@ -4548,7 +4843,8 @@ static s32 cfg80211_rtw_remain_on_channel(struct wiphy *wiphy, struct mlme_ext_priv *pmlmeext; struct wifidirect_info *pwdinfo; struct cfg80211_wifidirect_info *pcfg80211_wdinfo; - + u8 is_p2p_find = _FALSE; + if (ndev == NULL) { return -EINVAL; } @@ -4558,20 +4854,21 @@ static s32 cfg80211_rtw_remain_on_channel(struct wiphy *wiphy, pmlmeext = &padapter->mlmeextpriv; pwdinfo = &padapter->wdinfo; pcfg80211_wdinfo = &padapter->cfg80211_wdinfo; - + #ifdef CONFIG_CONCURRENT_MODE + is_p2p_find=(duration < (pwdinfo->ext_listen_interval))? _TRUE : _FALSE; + #endif DBG_871X(FUNC_ADPT_FMT" ch:%u duration:%d\n", FUNC_ADPT_ARG(padapter), remain_ch, duration); if(pcfg80211_wdinfo->is_ro_ch == _TRUE) { + pcfg80211_wdinfo->not_indic_ro_ch_exp = _TRUE; DBG_8192C("%s, cancel ro ch timer\n", __func__); - _cancel_timer_ex(&padapter->cfg80211_wdinfo.remain_on_ch_timer); - -#ifdef CONFIG_CONCURRENT_MODE - ATOMIC_SET(&pwdev_priv->ro_ch_to, 1); -#endif //CONFIG_CONCURRENT_MODE - + #ifdef CONFIG_CONCURRENT_MODE + ATOMIC_SET(&pwdev_priv->ro_ch_to, 1); + #endif //CONFIG_CONCURRENT_MODE p2p_protocol_wk_hdl(padapter, P2P_RO_CH_WK); + pcfg80211_wdinfo->not_indic_ro_ch_exp = _FALSE; } pcfg80211_wdinfo->is_ro_ch = _TRUE; @@ -4590,10 +4887,23 @@ static s32 cfg80211_rtw_remain_on_channel(struct wiphy *wiphy, rtw_scan_abort(padapter); #ifdef CONFIG_CONCURRENT_MODE - if(rtw_buddy_adapter_up(padapter)) + if ((rtw_buddy_adapter_up(padapter)) && is_p2p_find) //don't scan_abort during p2p_listen. rtw_scan_abort(padapter->pbuddy_adapter); #endif //CONFIG_CONCURRENT_MODE + if (check_fwstate(&padapter->mlmepriv, _FW_UNDER_LINKING|WIFI_UNDER_WPS) == _TRUE) + { + DBG_871X("mlme state:0x%x\n", get_fwstate(&padapter->mlmepriv)); + remain_ch = padapter->mlmeextpriv.cur_channel; + } +#ifdef CONFIG_CONCURRENT_MODE + if (check_buddy_fwstate(padapter, _FW_UNDER_LINKING|WIFI_UNDER_WPS) == _TRUE) + { + DBG_871X("buddy_intf's mlme state:0x%x\n", get_fwstate(&(padapter->pbuddy_adapter->mlmepriv))); + remain_ch = padapter->pbuddy_adapter->mlmeextpriv.cur_channel; + } +#endif /* CONFIG_CONCURRENT_MODE */ + //if(!rtw_p2p_chk_role(pwdinfo, P2P_ROLE_CLIENT) && !rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO)) if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) { @@ -4618,10 +4928,13 @@ static s32 cfg80211_rtw_remain_on_channel(struct wiphy *wiphy, #ifdef CONFIG_CONCURRENT_MODE - if(check_buddy_fwstate(padapter, _FW_LINKED) && - (durationext_listen_interval)) + if (check_buddy_fwstate(padapter, _FW_LINKED)) { - duration = duration + pwdinfo->ext_listen_interval; + if (is_p2p_find) // p2p_find , duration<1000 + duration = duration + pwdinfo->ext_listen_interval; + else // p2p_listen, duration=5000 + duration = pwdinfo->ext_listen_interval + + (pwdinfo->ext_listen_interval/4); } #endif @@ -4639,9 +4952,11 @@ static s32 cfg80211_rtw_remain_on_channel(struct wiphy *wiphy, if(ATOMIC_READ(&pwdev_priv->switch_ch_to)==1 || (remain_ch != pmlmeext->cur_channel)) { - DBG_8192C("%s, issue nulldata pwrbit=1\n", __func__); - issue_nulldata(padapter->pbuddy_adapter, NULL, 1, 3, 500); - + if (check_buddy_fwstate(padapter, WIFI_FW_STATION_STATE)) { + DBG_8192C("%s, issue nulldata pwrbit=1\n", __func__); + issue_nulldata(padapter->pbuddy_adapter, NULL, 1, 3, 500); + } + ATOMIC_SET(&pwdev_priv->switch_ch_to, 0); DBG_8192C("%s, set switch ch timer, duration=%d\n", __func__, duration-pwdinfo->ext_listen_interval); @@ -4739,12 +5054,14 @@ static s32 cfg80211_rtw_cancel_remain_on_channel(struct wiphy *wiphy, DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(padapter)); if (pcfg80211_wdinfo->is_ro_ch == _TRUE) { + pcfg80211_wdinfo->not_indic_ro_ch_exp = _TRUE; DBG_8192C("%s, cancel ro ch timer\n", __func__); _cancel_timer_ex(&padapter->cfg80211_wdinfo.remain_on_ch_timer); #ifdef CONFIG_CONCURRENT_MODE ATOMIC_SET(&pwdev_priv->ro_ch_to, 1); #endif p2p_protocol_wk_hdl(padapter, P2P_RO_CH_WK); + pcfg80211_wdinfo->not_indic_ro_ch_exp = _FALSE; } #if 0 @@ -4826,8 +5143,10 @@ static int _cfg80211_rtw_mgmt_tx(_adapter *padapter, u8 tx_ch, const u8 *buf, si u16 ext_listen_period; if (ATOMIC_READ(&pwdev_priv->switch_ch_to)==1) { - DBG_8192C("%s, issue nulldata pwrbit=1\n", __func__); - issue_nulldata(padapter->pbuddy_adapter, NULL, 1, 3, 500); + if (check_buddy_fwstate(padapter, WIFI_FW_STATION_STATE)) { + DBG_8192C("%s, issue nulldata pwrbit=1\n", __func__); + issue_nulldata(padapter->pbuddy_adapter, NULL, 1, 3, 500); + } ATOMIC_SET(&pwdev_priv->switch_ch_to, 0); @@ -4941,30 +5260,43 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy, #else struct net_device *ndev, #endif +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0)) || defined(COMPAT_KERNEL_RELEASE) struct ieee80211_channel *chan, -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) || defined(COMPAT_KERNEL_RELEASE) + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) || defined(COMPAT_KERNEL_RELEASE) bool offchan, -#endif -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)) + #endif + #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)) enum nl80211_channel_type channel_type, #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE) bool channel_type_valid, #endif -#endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) || defined(COMPAT_KERNEL_RELEASE) + #endif + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) || defined(COMPAT_KERNEL_RELEASE) unsigned int wait, -#endif + #endif const u8 *buf, size_t len, -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) bool no_cck, -#endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) + #endif + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) bool dont_wait_for_ack, + #endif +#else + struct cfg80211_mgmt_tx_params *params, #endif u64 *cookie) { #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) struct net_device *ndev = wdev_to_ndev(wdev); +#endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) || defined(COMPAT_KERNEL_RELEASE) + struct ieee80211_channel *chan = params->chan; + bool offchan = params->offchan; + unsigned int wait = params->wait; + const u8 *buf = params->buf; + size_t len = params->len; + bool no_cck = params->no_cck; + bool dont_wait_for_ack = params->dont_wait_for_ack; #endif int ret = 0; int tx_ret; @@ -5113,12 +5445,15 @@ static int cfg80211_rtw_tdls_mgmt(struct wiphy *wiphy, size_t len) { _adapter *padapter = (_adapter *)rtw_netdev_priv(ndev); + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; + struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; int ret = 0; struct tdls_txmgmt txmgmt; - //TDLS: discard wpa_supplicant's frame mgmt - DBG_871X("%s %d\n", __FUNCTION__, __LINE__); - return 0; + if (rtw_tdls_is_driver_setup(padapter)) { + DBG_871X("Discard tdls action:%d, let driver to set up direct link\n", action_code); + goto discard; + } _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); _rtw_memcpy(txmgmt.peer, peer, ETH_ALEN); @@ -5127,53 +5462,52 @@ static int cfg80211_rtw_tdls_mgmt(struct wiphy *wiphy, txmgmt.status_code = status_code; txmgmt.len = len; txmgmt.buf = (u8 *)rtw_malloc(txmgmt.len); - if (txmgmt.buf == NULL) - { + if (txmgmt.buf == NULL) { ret = -ENOMEM; goto bad; } _rtw_memcpy(txmgmt.buf, (void*)buf, txmgmt.len); - txmgmt.external_support = _TRUE; -//TDLS: Debug purpose -#if 0 +/* Debug purpose */ +#if 1 DBG_871X("%s %d\n", __FUNCTION__, __LINE__); - DBG_871X("peer:"MAC_FMT" ", MAC_ARG(txmgmt.peer)); - DBG_871X("action code:%d ", txmgmt.action_code); - DBG_871X("dialog:%d ", txmgmt.dialog_token); - DBG_871X("status code:%d\n", txmgmt.status_code); - if( txmgmt.len > 0 ) - { + DBG_871X("peer:"MAC_FMT", action code:%d, dialog:%d, status code:%d\n", + MAC_ARG(txmgmt.peer), txmgmt.action_code, + txmgmt.dialog_token, txmgmt.status_code); + if (txmgmt.len > 0) { int i=0; for(;i < len; i++) - DBG_871X("%02x ", *(txmgmt.buf+i)); - DBG_871X("\n len:%d\n", txmgmt.len); + printk("%02x ", *(txmgmt.buf+i)); + DBG_871X("len:%d\n", txmgmt.len); } #endif - switch(txmgmt.action_code) { - case TDLS_SETUP_REQUEST: - issue_tdls_setup_req(padapter, &txmgmt, _TRUE); - break; - case TDLS_SETUP_RESPONSE: - issue_tdls_setup_rsp(padapter, &txmgmt); - break; - case TDLS_SETUP_CONFIRM: - issue_tdls_setup_cfm(padapter, &txmgmt); - break; - case TDLS_TEARDOWN: - break; - case TDLS_DISCOVERY_REQUEST: - issue_tdls_dis_req(padapter, &txmgmt); + switch (txmgmt.action_code) { + case TDLS_SETUP_REQUEST: + issue_tdls_setup_req(padapter, &txmgmt, _TRUE); + break; + case TDLS_SETUP_RESPONSE: + issue_tdls_setup_rsp(padapter, &txmgmt); + break; + case TDLS_SETUP_CONFIRM: + issue_tdls_setup_cfm(padapter, &txmgmt); + break; + case TDLS_TEARDOWN: + issue_tdls_teardown(padapter, &txmgmt, _TRUE); + break; + case TDLS_DISCOVERY_REQUEST: + issue_tdls_dis_req(padapter, &txmgmt); + break; + case TDLS_DISCOVERY_RESPONSE: + issue_tdls_dis_rsp(padapter, &txmgmt, pmlmeinfo->enc_algo? _TRUE : _FALSE); break; } bad: if (txmgmt.buf) - { rtw_mfree(txmgmt.buf, txmgmt.len); - } +discard: return ret; } @@ -5183,61 +5517,123 @@ static int cfg80211_rtw_tdls_oper(struct wiphy *wiphy, enum nl80211_tdls_operation oper) { _adapter *padapter = (_adapter *)rtw_netdev_priv(ndev); + struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; struct tdls_txmgmt txmgmt; struct sta_info *ptdls_sta = NULL; DBG_871X(FUNC_NDEV_FMT", nl80211_tdls_operation:%d\n", FUNC_NDEV_ARG(ndev), oper); +#ifdef CONFIG_LPS + rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_LEAVE, 1); +#endif //CONFIG_LPS + _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); - if(peer) + if (peer) _rtw_memcpy(txmgmt.peer, peer, ETH_ALEN); -#if 0 - CFG80211_TDLS_DISCOVERY_REQ, - CFG80211_TDLS_SETUP, - CFG80211_TDLS_TEARDOWN, - CFG80211_TDLS_ENABLE_LINK, - CFG80211_TDLS_DISABLE_LINK, - CFG80211_TDLS_ENABLE, - CFG80211_TDLS_DISABLE -#endif - switch(oper) { - case NL80211_TDLS_DISCOVERY_REQ: - issue_tdls_dis_req(padapter, &txmgmt); - break; - case NL80211_TDLS_SETUP: + + if (rtw_tdls_is_driver_setup(padapter)) { + /* these two cases are done by driver itself */ + if (oper == NL80211_TDLS_ENABLE_LINK || oper == NL80211_TDLS_DISABLE_LINK) + return 0; + } + + switch (oper) { + case NL80211_TDLS_DISCOVERY_REQ: + issue_tdls_dis_req(padapter, &txmgmt); + break; + case NL80211_TDLS_SETUP: #ifdef CONFIG_WFD - if ( _AES_ != padapter->securitypriv.dot11PrivacyAlgrthm ) - { - if ( padapter->wdinfo.wfd_tdls_weaksec == _TRUE) - issue_tdls_setup_req(padapter, &txmgmt, _TRUE); - else - DBG_871X( "[%s] Current link is not AES, SKIP sending the tdls setup request!!\n", __FUNCTION__ ); - } - else -#endif // CONFIG_WFD - { + if ( _AES_ != padapter->securitypriv.dot11PrivacyAlgrthm ) { + if ( padapter->wdinfo.wfd_tdls_weaksec == _TRUE) issue_tdls_setup_req(padapter, &txmgmt, _TRUE); - } - break; - case NL80211_TDLS_TEARDOWN: - ptdls_sta = rtw_get_stainfo( &(padapter->stapriv), txmgmt.peer); - if(ptdls_sta != NULL) - { - txmgmt.status_code = _RSON_TDLS_TEAR_UN_RSN_; - issue_tdls_teardown(padapter, &txmgmt, _FALSE); - } else - DBG_871X( "TDLS peer not found\n"); - break; - case NL80211_TDLS_ENABLE_LINK: - break; - case NL80211_TDLS_DISABLE_LINK: - break; + DBG_871X( "[%s] Current link is not AES, SKIP sending the tdls setup request!!\n", __FUNCTION__ ); + } else +#endif // CONFIG_WFD + { + issue_tdls_setup_req(padapter, &txmgmt, _TRUE); + } + break; + case NL80211_TDLS_TEARDOWN: + ptdls_sta = rtw_get_stainfo( &(padapter->stapriv), txmgmt.peer); + if (ptdls_sta != NULL) { + txmgmt.status_code = _RSON_TDLS_TEAR_UN_RSN_; + issue_tdls_teardown(padapter, &txmgmt, _FALSE); + }else { + DBG_871X( "TDLS peer not found\n"); + } + break; + case NL80211_TDLS_ENABLE_LINK: + DBG_871X(FUNC_NDEV_FMT", NL80211_TDLS_ENABLE_LINK;mac:"MAC_FMT"\n", FUNC_NDEV_ARG(ndev), MAC_ARG(peer)); + ptdls_sta = rtw_get_stainfo(&(padapter->stapriv), peer); + if (ptdls_sta != NULL) { + ptdlsinfo->link_established = _TRUE; + ptdls_sta->tdls_sta_state |= TDLS_LINKED_STATE; + ptdls_sta->state |= _FW_LINKED; + rtw_tdls_cmd(padapter, txmgmt.peer, TDLS_ESTABLISHED); + } + break; + case NL80211_TDLS_DISABLE_LINK: + DBG_871X(FUNC_NDEV_FMT", NL80211_TDLS_DISABLE_LINK;mac:"MAC_FMT"\n", FUNC_NDEV_ARG(ndev), MAC_ARG(peer)); + ptdls_sta = rtw_get_stainfo(&(padapter->stapriv), peer); + if (ptdls_sta != NULL) { + rtw_tdls_cmd(padapter, peer, TDLS_TEAR_STA ); + } + break; } return 0; } #endif /* CONFIG_TDLS */ +#if defined(CONFIG_PNO_SUPPORT) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0)) +static int cfg80211_rtw_sched_scan_start(struct wiphy *wiphy, + struct net_device *dev, + struct cfg80211_sched_scan_request *request) { + + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + u8 ret; + + if (padapter->bup == _FALSE) { + DBG_871X("%s: net device is down.\n", __func__); + return -EIO; + } + + if(check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == _TRUE || + check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE || + check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == _TRUE) { + DBG_871X("%s: device is busy.\n", __func__); + rtw_scan_abort(padapter); + } + + if (request == NULL) { + DBG_871X("%s: invalid cfg80211_requests parameters.\n", __func__); + return -EINVAL; + } + + ret = rtw_android_cfg80211_pno_setup(dev, request->ssids, + request->n_ssids, request->interval); + + if (ret < 0) { + DBG_871X("%s ret: %d\n", __func__, ret); + goto exit; + } + + ret = rtw_android_pno_enable(dev, _TRUE); + if (ret < 0) { + DBG_871X("%s ret: %d\n", __func__, ret); + goto exit; + } +exit: + return ret; +} + +static int cfg80211_rtw_sched_scan_stop(struct wiphy *wiphy, + struct net_device *dev) { + return rtw_android_pno_enable(dev, _FALSE); +} +#endif /* CONFIG_PNO_SUPPORT */ + static int rtw_cfg80211_set_beacon_wpsp2pie(struct net_device *ndev, char *buf, int len) { int ret = 0; @@ -5678,14 +6074,14 @@ void rtw_cfg80211_init_wiphy(_adapter *padapter) DBG_8192C("%s:rf_type=%d\n", __func__, rf_type); - /* if (padapter->registrypriv.wireless_mode & WIRELESS_11G) */ + if (padapter->registrypriv.wireless_mode & WIRELESS_11G) { bands = wiphy->bands[IEEE80211_BAND_2GHZ]; if(bands) rtw_cfg80211_init_ht_capab(&bands->ht_cap, IEEE80211_BAND_2GHZ, rf_type); } - /* if (padapter->registrypriv.wireless_mode & WIRELESS_11A) */ + if (padapter->registrypriv.wireless_mode & WIRELESS_11A) { bands = wiphy->bands[IEEE80211_BAND_5GHZ]; if(bands) @@ -5693,7 +6089,7 @@ void rtw_cfg80211_init_wiphy(_adapter *padapter) } /* init regulary domain */ - rtw_regd_init(padapter, rtw_reg_notifier); + rtw_regd_init(padapter); /* copy mac_addr to wiphy */ _rtw_memcpy(wiphy->perm_addr, padapter->eeprompriv.mac_addr, ETH_ALEN); @@ -5768,8 +6164,10 @@ static void rtw_cfg80211_preinit_wiphy(_adapter *padapter, struct wiphy *wiphy) /* if (padapter->registrypriv.wireless_mode & WIRELESS_11G) */ wiphy->bands[IEEE80211_BAND_2GHZ] = rtw_spt_band_alloc(IEEE80211_BAND_2GHZ); +#ifdef CONFIG_IEEE80211_BAND_5GHZ /* if (padapter->registrypriv.wireless_mode & WIRELESS_11A) */ wiphy->bands[IEEE80211_BAND_5GHZ] = rtw_spt_band_alloc(IEEE80211_BAND_5GHZ); +#endif #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38) && LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0)) wiphy->flags |= WIPHY_FLAG_SUPPORTS_SEPARATE_DEFAULT_KEYS; @@ -5780,9 +6178,27 @@ static void rtw_cfg80211_preinit_wiphy(_adapter *padapter, struct wiphy *wiphy) wiphy->flags |= WIPHY_FLAG_OFFCHAN_TX | WIPHY_FLAG_HAVE_AP_SME; #endif +#if defined(CONFIG_PM) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0)) + wiphy->flags |= WIPHY_FLAG_SUPPORTS_SCHED_SCAN; +#ifdef CONFIG_PNO_SUPPORT + wiphy->max_sched_scan_ssids = MAX_PNO_LIST_COUNT; +#endif +#endif + +#if defined(CONFIG_PM) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) + wiphy->wowlan = wowlan_stub; +#else + wiphy->wowlan = &wowlan_stub; +#endif +#endif + #if defined(CONFIG_TDLS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS; - //wiphy->flags |= WIPHY_FLAG_TDLS_EXTERNAL_SETUP; +#ifndef CONFIG_TDLS_DRIVER_SETUP + wiphy->flags |= WIPHY_FLAG_TDLS_EXTERNAL_SETUP; //Driver handles key exchange + wiphy->flags |= NL80211_ATTR_HT_CAPABILITY; +#endif //CONFIG_TDLS_DRIVER_SETUP #endif /* CONFIG_TDLS */ if(padapter->registrypriv.power_mgnt != PS_MODE_ACTIVE) @@ -5791,7 +6207,11 @@ static void rtw_cfg80211_preinit_wiphy(_adapter *padapter, struct wiphy *wiphy) wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) - wiphy->flags |= WIPHY_FLAG_SUPPORTS_FW_ROAM; + //wiphy->flags |= WIPHY_FLAG_SUPPORTS_FW_ROAM; +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) || defined(RTW_VENDOR_EXT_SUPPORT) + rtw_cfgvendor_attach(wiphy); #endif } @@ -5857,6 +6277,11 @@ static struct cfg80211_ops rtw_cfg80211_ops = { .tdls_mgmt = cfg80211_rtw_tdls_mgmt, .tdls_oper = cfg80211_rtw_tdls_oper, #endif /* CONFIG_TDLS */ + +#if defined(CONFIG_PNO_SUPPORT) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0)) + .sched_scan_start = cfg80211_rtw_sched_scan_start, + .sched_scan_stop = cfg80211_rtw_sched_scan_stop, +#endif /* CONFIG_PNO_SUPPORT */ }; int rtw_wdev_alloc(_adapter *padapter, struct device *dev) @@ -5980,6 +6405,10 @@ void rtw_wdev_unregister(struct wireless_dev *wdev) unregister_netdev(pwdev_priv->pmon_ndev); } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) || defined(RTW_VENDOR_EXT_SUPPORT) + rtw_cfgvendor_detach(wdev->wiphy); +#endif + wiphy_unregister(wdev->wiphy); } diff --git a/backports/drivers/realtek/rtl8812au/include/ioctl_cfg80211.h b/backports/drivers/realtek/rtl8812au/os_dep/linux/ioctl_cfg80211.h old mode 100755 new mode 100644 similarity index 90% rename from backports/drivers/realtek/rtl8812au/include/ioctl_cfg80211.h rename to backports/drivers/realtek/rtl8812au/os_dep/linux/ioctl_cfg80211.h index c6c6024ae2d68b..b5022a7ad7d9f6 --- a/backports/drivers/realtek/rtl8812au/include/ioctl_cfg80211.h +++ b/backports/drivers/realtek/rtl8812au/os_dep/linux/ioctl_cfg80211.h @@ -49,7 +49,7 @@ struct rtw_wdev_invit_info { } while (0) struct rtw_wdev_nego_info { - u8 state; /* 0: req, 1:rep, 3:conf */ + u8 state; /* 0: req, 1:rep, 2:conf */ u8 peer_mac[ETH_ALEN]; u8 active; u8 token; @@ -117,6 +117,7 @@ void rtw_wdev_unregister(struct wireless_dev *wdev); void rtw_cfg80211_init_wiphy(_adapter *padapter); +void rtw_cfg80211_unlink_bss(_adapter *padapter, struct wlan_network *pnetwork); void rtw_cfg80211_surveydone_event_callback(_adapter *padapter); struct cfg80211_bss *rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_network *pnetwork); int rtw_cfg80211_check_bss(_adapter *padapter); @@ -143,8 +144,12 @@ bool rtw_cfg80211_pwr_mgmt(_adapter *adapter); #define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->pnetdev, freq, buf, len, gfp) #elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0)) #define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->pnetdev, freq, sig_dbm, buf, len, gfp) -#else +#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0)) #define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->rtw_wdev, freq, sig_dbm, buf, len, gfp) +#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0)) +#define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->rtw_wdev, freq, sig_dbm, buf, len,0,gfp) +#else +#define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->rtw_wdev, freq, sig_dbm, buf, len, 0) #endif #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) && !defined(COMPAT_KERNEL_RELEASE) @@ -170,5 +175,7 @@ bool rtw_cfg80211_pwr_mgmt(_adapter *adapter); #define rtw_cfg80211_remain_on_channel_expired(adapter, cookie, chan, chan_type, gfp) cfg80211_remain_on_channel_expired((adapter)->rtw_wdev, cookie, chan, gfp) #endif +#include "rtw_cfgvendor.h" + #endif //__IOCTL_CFG80211_H__ diff --git a/backports/drivers/realtek/rtl8812au/os_dep/linux/ioctl_linux.c b/backports/drivers/realtek/rtl8812au/os_dep/linux/ioctl_linux.c index 1c38dc69b937a5..ba9fd540df1ce7 100755 --- a/backports/drivers/realtek/rtl8812au/os_dep/linux/ioctl_linux.c +++ b/backports/drivers/realtek/rtl8812au/os_dep/linux/ioctl_linux.c @@ -22,8 +22,9 @@ #include //#ifdef CONFIG_MP_INCLUDED +#include #include -#include "../../hal/OUTSRC/odm_precomp.h" +#include "../../hal/OUTSRC/phydm_precomp.h" //#endif #if defined(CONFIG_RTL8723A) @@ -40,6 +41,10 @@ #define iwe_stream_add_point(a, b, c, d, e) iwe_stream_add_point(b, c, d, e) #endif +#ifdef CONFIG_80211N_HT +extern int rtw_ht_enable; +#endif + #define RTL_IOCTL_WPA_SUPPLICANT SIOCIWFIRSTPRIV+30 @@ -192,6 +197,7 @@ static void request_wps_pbc_event(_adapter *padapter) } +#ifdef CONFIG_SUPPORT_HW_WPS_PBC void rtw_request_wps_pbc_event(_adapter *padapter) { #ifdef RTK_DMP_PLATFORM @@ -213,6 +219,7 @@ void rtw_request_wps_pbc_event(_adapter *padapter) rtw_led_control(padapter, LED_CTL_START_WPS_BOTTON); } +#endif//#ifdef CONFIG_SUPPORT_HW_WPS_PBC void indicate_wx_scan_complete_event(_adapter *padapter) { @@ -298,28 +305,12 @@ uint rtw_is_cckratesonly_included(u8 *rate) } */ -static char *translate_scan(_adapter *padapter, +static int search_p2p_wfd_ie(_adapter *padapter, struct iw_request_info* info, struct wlan_network *pnetwork, char *start, char *stop) { - struct iw_event iwe; - u16 cap; - u32 ht_ielen = 0, vht_ielen = 0; - char custom[MAX_CUSTOM_LEN]; - char *p; - u16 max_rate=0, rate, ht_cap=_FALSE, vht_cap = _FALSE; - u32 i = 0; - char *current_val; - long rssi; - u8 bw_40MHz=0, short_GI=0, bw_160MHz=0, vht_highest_rate = 0; - u16 mcs_rate=0, vht_data_rate=0; - u8 ie_offset = (pnetwork->network.Reserved[0] == 2? 0:12); - struct registry_priv *pregpriv = &padapter->registrypriv; #ifdef CONFIG_P2P struct wifidirect_info *pwdinfo = &padapter->wdinfo; -#endif //CONFIG_P2P - -#ifdef CONFIG_P2P #ifdef CONFIG_WFD if ( SCAN_RESULT_ALL == pwdinfo->wfd_info->scan_result_type ) { @@ -351,7 +342,7 @@ static char *translate_scan(_adapter *padapter, if ( blnGotP2PIE == _FALSE ) { - return start; + return _FALSE; } } @@ -395,12 +386,547 @@ static char *translate_scan(_adapter *padapter, if ( blnGotWFD == _FALSE ) { - return start; + return _FALSE; } } #endif // CONFIG_WFD #endif //CONFIG_P2P + return _TRUE; +} + static inline char *iwe_stream_mac_addr_proess(_adapter *padapter, + struct iw_request_info* info, struct wlan_network *pnetwork, + char *start, char *stop,struct iw_event *iwe) +{ + /* AP MAC address */ + iwe->cmd = SIOCGIWAP; + iwe->u.ap_addr.sa_family = ARPHRD_ETHER; + + _rtw_memcpy(iwe->u.ap_addr.sa_data, pnetwork->network.MacAddress, ETH_ALEN); + start = iwe_stream_add_event(info, start, stop, iwe, IW_EV_ADDR_LEN); + return start; +} + static inline char * iwe_stream_essid_proess(_adapter *padapter, + struct iw_request_info* info, struct wlan_network *pnetwork, + char *start, char *stop,struct iw_event *iwe) +{ + + /* Add the ESSID */ + iwe->cmd = SIOCGIWESSID; + iwe->u.data.flags = 1; + iwe->u.data.length = min((u16)pnetwork->network.Ssid.SsidLength, (u16)32); + start = iwe_stream_add_point(info, start, stop, iwe, pnetwork->network.Ssid.Ssid); + return start; +} + + static inline char * iwe_stream_chan_process(_adapter *padapter, + struct iw_request_info* info, struct wlan_network *pnetwork, + char *start, char *stop,struct iw_event *iwe) +{ + if(pnetwork->network.Configuration.DSConfig<1 /*|| pnetwork->network.Configuration.DSConfig>14*/) + pnetwork->network.Configuration.DSConfig = 1; + + /* Add frequency/channel */ + iwe->cmd = SIOCGIWFREQ; + iwe->u.freq.m = rtw_ch2freq(pnetwork->network.Configuration.DSConfig) * 100000; + iwe->u.freq.e = 1; + iwe->u.freq.i = pnetwork->network.Configuration.DSConfig; + start = iwe_stream_add_event(info, start, stop, iwe, IW_EV_FREQ_LEN); + return start; +} + static inline char * iwe_stream_mode_process(_adapter *padapter, + struct iw_request_info* info, struct wlan_network *pnetwork, + char *start, char *stop,struct iw_event *iwe,u16 cap) +{ + /* Add mode */ + if(cap & (WLAN_CAPABILITY_IBSS |WLAN_CAPABILITY_BSS)){ + iwe->cmd = SIOCGIWMODE; + if (cap & WLAN_CAPABILITY_BSS) + iwe->u.mode = IW_MODE_MASTER; + else + iwe->u.mode = IW_MODE_ADHOC; + + start = iwe_stream_add_event(info, start, stop, iwe, IW_EV_UINT_LEN); + } + return start; + } + static inline char * iwe_stream_encryption_process(_adapter *padapter, + struct iw_request_info* info, struct wlan_network *pnetwork, + char *start, char *stop,struct iw_event *iwe,u16 cap) +{ + + /* Add encryption capability */ + iwe->cmd = SIOCGIWENCODE; + if (cap & WLAN_CAPABILITY_PRIVACY) + iwe->u.data.flags = IW_ENCODE_ENABLED | IW_ENCODE_NOKEY; + else + iwe->u.data.flags = IW_ENCODE_DISABLED; + iwe->u.data.length = 0; + start = iwe_stream_add_point(info, start, stop, iwe, pnetwork->network.Ssid.Ssid); + return start; + +} + + static inline char * iwe_stream_protocol_process(_adapter *padapter, + struct iw_request_info* info, struct wlan_network *pnetwork, + char *start, char *stop,struct iw_event *iwe) + { + u16 ht_cap=_FALSE,vht_cap = _FALSE; + u32 ht_ielen = 0, vht_ielen = 0; + char *p; + u8 ie_offset = (pnetwork->network.Reserved[0] == 2? 0:12);// Probe Request + + //parsing HT_CAP_IE + p = rtw_get_ie(&pnetwork->network.IEs[ie_offset], _HT_CAPABILITY_IE_, &ht_ielen, pnetwork->network.IELength-ie_offset); + if(p && ht_ielen>0) + ht_cap = _TRUE; + + #ifdef CONFIG_80211AC_VHT + //parsing VHT_CAP_IE + p = rtw_get_ie(&pnetwork->network.IEs[ie_offset], EID_VHTCapability, &vht_ielen, pnetwork->network.IELength-ie_offset); + if(p && vht_ielen>0) + vht_cap = _TRUE; + #endif + /* Add the protocol name */ + iwe->cmd = SIOCGIWNAME; + if ((rtw_is_cckratesonly_included((u8*)&pnetwork->network.SupportedRates)) == _TRUE) + { + if(ht_cap == _TRUE) + snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11bn"); + else + snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11b"); + } + else if ((rtw_is_cckrates_included((u8*)&pnetwork->network.SupportedRates)) == _TRUE) + { + if(ht_cap == _TRUE) + snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11bgn"); + else + snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11bg"); + } + else + { + if(pnetwork->network.Configuration.DSConfig > 14) + { + #ifdef CONFIG_80211AC_VHT + if(vht_cap == _TRUE){ + snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11AC"); + } + else + #endif + { + if(ht_cap == _TRUE) + snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11an"); + else + snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11a"); + } + } + else + { + if(ht_cap == _TRUE) + snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11gn"); + else + snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11g"); + } + } + start = iwe_stream_add_event(info, start, stop, iwe, IW_EV_CHAR_LEN); + return start; + } + + static inline char * iwe_stream_rate_process(_adapter *padapter, + struct iw_request_info* info, struct wlan_network *pnetwork, + char *start, char *stop,struct iw_event *iwe) +{ + u32 ht_ielen = 0, vht_ielen = 0; + char *p; + u16 max_rate=0, rate, ht_cap=_FALSE, vht_cap = _FALSE; + u32 i = 0; + u8 bw_40MHz=0, short_GI=0, bw_160MHz=0, vht_highest_rate = 0; + u16 mcs_rate=0, vht_data_rate=0; + char custom[MAX_CUSTOM_LEN]={0}; + u8 ie_offset = (pnetwork->network.Reserved[0] == 2? 0:12);// Probe Request + + //parsing HT_CAP_IE + p = rtw_get_ie(&pnetwork->network.IEs[ie_offset], _HT_CAPABILITY_IE_, &ht_ielen, pnetwork->network.IELength-ie_offset); + if(p && ht_ielen>0) + { + struct rtw_ieee80211_ht_cap *pht_capie; + ht_cap = _TRUE; + pht_capie = (struct rtw_ieee80211_ht_cap *)(p+2); + _rtw_memcpy(&mcs_rate , pht_capie->supp_mcs_set, 2); + bw_40MHz = (pht_capie->cap_info&IEEE80211_HT_CAP_SUP_WIDTH) ? 1:0; + short_GI = (pht_capie->cap_info&(IEEE80211_HT_CAP_SGI_20|IEEE80211_HT_CAP_SGI_40)) ? 1:0; + } + +#ifdef CONFIG_80211AC_VHT + //parsing VHT_CAP_IE + p = rtw_get_ie(&pnetwork->network.IEs[ie_offset], EID_VHTCapability, &vht_ielen, pnetwork->network.IELength-ie_offset); + if(p && vht_ielen>0) + { + u8 mcs_map[2]; + + vht_cap = _TRUE; + bw_160MHz = GET_VHT_CAPABILITY_ELE_CHL_WIDTH(p+2); + if(bw_160MHz) + short_GI = GET_VHT_CAPABILITY_ELE_SHORT_GI160M(p+2); + else + short_GI = GET_VHT_CAPABILITY_ELE_SHORT_GI80M(p+2); + + _rtw_memcpy(mcs_map, GET_VHT_CAPABILITY_ELE_TX_MCS(p+2), 2); + + vht_highest_rate = rtw_get_vht_highest_rate(mcs_map); + vht_data_rate = rtw_vht_mcs_to_data_rate(CHANNEL_WIDTH_80, short_GI, vht_highest_rate); + } +#endif + + /*Add basic and extended rates */ + p = custom; + p += snprintf(p, MAX_CUSTOM_LEN - (p - custom), " Rates (Mb/s): "); + while(pnetwork->network.SupportedRates[i]!=0) + { + rate = pnetwork->network.SupportedRates[i]&0x7F; + if (rate > max_rate) + max_rate = rate; + p += snprintf(p, MAX_CUSTOM_LEN - (p - custom), + "%d%s ", rate >> 1, (rate & 1) ? ".5" : ""); + i++; + } +#ifdef CONFIG_80211AC_VHT + if(vht_cap == _TRUE) { + max_rate = vht_data_rate; + } + else +#endif + if(ht_cap == _TRUE) + { + if(mcs_rate&0x8000)//MCS15 + { + max_rate = (bw_40MHz) ? ((short_GI)?300:270):((short_GI)?144:130); + + } + else if(mcs_rate&0x0080)//MCS7 + { + max_rate = (bw_40MHz) ? ((short_GI)?150:135):((short_GI)?72:65); + } + else//default MCS7 + { + //DBG_871X("wx_get_scan, mcs_rate_bitmap=0x%x\n", mcs_rate); + max_rate = (bw_40MHz) ? ((short_GI)?150:135):((short_GI)?72:65); + } + + max_rate = max_rate*2;//Mbps/2; + } + + iwe->cmd = SIOCGIWRATE; + iwe->u.bitrate.fixed = iwe->u.bitrate.disabled = 0; + iwe->u.bitrate.value = max_rate * 500000; + start =iwe_stream_add_event(info, start, stop, iwe, IW_EV_PARAM_LEN); + return start ; +} + +static inline char * iwe_stream_wpa_wpa2_process(_adapter *padapter, + struct iw_request_info* info, struct wlan_network *pnetwork, + char *start, char *stop,struct iw_event *iwe) +{ + int buf_size = MAX_WPA_IE_LEN*2; + //u8 pbuf[buf_size]={0}; + u8 *pbuf = rtw_zmalloc(buf_size); + + u8 wpa_ie[255]={0},rsn_ie[255]={0}; + u16 i, wpa_len=0,rsn_len=0; + u8 *p; + sint out_len=0; + + + if(pbuf){ + p=pbuf; + + //parsing WPA/WPA2 IE + if (pnetwork->network.Reserved[0] != 2) // Probe Request + { + out_len=rtw_get_sec_ie(pnetwork->network.IEs ,pnetwork->network.IELength,rsn_ie,&rsn_len,wpa_ie,&wpa_len); + RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("rtw_wx_get_scan: ssid=%s\n",pnetwork->network.Ssid.Ssid)); + RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("rtw_wx_get_scan: wpa_len=%d rsn_len=%d\n",wpa_len,rsn_len)); + + if (wpa_len > 0){ + + _rtw_memset(pbuf, 0, buf_size); + p += sprintf(p, "wpa_ie="); + for (i = 0; i < wpa_len; i++) { + p += sprintf(p, "%02x", wpa_ie[i]); + } + + if (wpa_len > 100) { + printk("-----------------Len %d----------------\n", wpa_len); + for (i = 0; i < wpa_len; i++) { + printk("%02x ", wpa_ie[i]); + } + printk("\n"); + printk("-----------------Len %d----------------\n", wpa_len); + } + + _rtw_memset(iwe, 0, sizeof(*iwe)); + iwe->cmd = IWEVCUSTOM; + iwe->u.data.length = strlen(pbuf); + start = iwe_stream_add_point(info, start, stop, iwe,pbuf); + + _rtw_memset(iwe, 0, sizeof(*iwe)); + iwe->cmd =IWEVGENIE; + iwe->u.data.length = wpa_len; + start = iwe_stream_add_point(info, start, stop, iwe, wpa_ie); + } + if (rsn_len > 0){ + + _rtw_memset(pbuf, 0, buf_size); + p += sprintf(p, "rsn_ie="); + for (i = 0; i < rsn_len; i++) { + p += sprintf(p, "%02x", rsn_ie[i]); + } + _rtw_memset(iwe, 0, sizeof(*iwe)); + iwe->cmd = IWEVCUSTOM; + iwe->u.data.length = strlen(pbuf); + start = iwe_stream_add_point(info, start, stop, iwe,pbuf); + + _rtw_memset(iwe, 0, sizeof(*iwe)); + iwe->cmd =IWEVGENIE; + iwe->u.data.length = rsn_len; + start = iwe_stream_add_point(info, start, stop, iwe, rsn_ie); + } + } + + rtw_mfree(pbuf, buf_size); + } + return start; +} + +static inline char * iwe_stream_wps_process(_adapter *padapter, + struct iw_request_info* info, struct wlan_network *pnetwork, + char *start, char *stop,struct iw_event *iwe) +{ + //parsing WPS IE + uint cnt = 0,total_ielen; + u8 *wpsie_ptr=NULL; + uint wps_ielen = 0; + u8 ie_offset = (pnetwork->network.Reserved[0] == 2? 0:12); + + u8 *ie_ptr = pnetwork->network.IEs + ie_offset; + total_ielen= pnetwork->network.IELength - ie_offset; + + if (pnetwork->network.Reserved[0] == 2) // Probe Request + { + ie_ptr = pnetwork->network.IEs; + total_ielen = pnetwork->network.IELength; + } + else // Beacon or Probe Respones + { + ie_ptr = pnetwork->network.IEs + _FIXED_IE_LENGTH_; + total_ielen = pnetwork->network.IELength - _FIXED_IE_LENGTH_; + } + while(cnt < total_ielen) + { + if(rtw_is_wps_ie(&ie_ptr[cnt], &wps_ielen) && (wps_ielen>2)) + { + wpsie_ptr = &ie_ptr[cnt]; + iwe->cmd =IWEVGENIE; + iwe->u.data.length = (u16)wps_ielen; + start = iwe_stream_add_point(info, start, stop,iwe, wpsie_ptr); + } + cnt+=ie_ptr[cnt+1]+2; //goto next + } + return start; +} + +static inline char * iwe_stream_wapi_process(_adapter *padapter, + struct iw_request_info* info, struct wlan_network *pnetwork, + char *start, char *stop,struct iw_event *iwe) +{ +#ifdef CONFIG_WAPI_SUPPORT + char *p; + + if (pnetwork->network.Reserved[0] != 2) // Probe Request + { + sint out_len_wapi=0; + /* here use static for stack size */ + static u8 buf_wapi[MAX_WAPI_IE_LEN*2]={0}; + static u8 wapi_ie[MAX_WAPI_IE_LEN]={0}; + u16 wapi_len=0; + u16 i; + + out_len_wapi=rtw_get_wapi_ie(pnetwork->network.IEs ,pnetwork->network.IELength,wapi_ie,&wapi_len); + RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("rtw_wx_get_scan: ssid=%s\n",pnetwork->network.Ssid.Ssid)); + RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("rtw_wx_get_scan: wapi_len=%d \n",wapi_len)); + + DBG_871X("rtw_wx_get_scan: %s ",pnetwork->network.Ssid.Ssid); + DBG_871X("rtw_wx_get_scan: ssid = %d ",wapi_len); + + + if (wapi_len > 0) + { + p=buf_wapi; + //_rtw_memset(buf_wapi, 0, MAX_WAPI_IE_LEN*2); + p += sprintf(p, "wapi_ie="); + for (i = 0; i < wapi_len; i++) { + p += sprintf(p, "%02x", wapi_ie[i]); + } + + _rtw_memset(iwe, 0, sizeof(*iwe)); + iwe->cmd = IWEVCUSTOM; + iwe->u.data.length = strlen(buf_wapi); + start = iwe_stream_add_point(info, start, stop, iwe,buf_wapi); + + _rtw_memset(iwe, 0, sizeof(*iwe)); + iwe->cmd =IWEVGENIE; + iwe->u.data.length = wapi_len; + start = iwe_stream_add_point(info, start, stop, iwe, wapi_ie); + } + } +#endif//#ifdef CONFIG_WAPI_SUPPORT + return start; +} + +static inline char * iwe_stream_rssi_process(_adapter *padapter, + struct iw_request_info* info, struct wlan_network *pnetwork, + char *start, char *stop,struct iw_event *iwe) +{ + u8 ss, sq; + struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + + /* Add quality statistics */ + iwe->cmd = IWEVQUAL; + iwe->u.qual.updated = IW_QUAL_QUAL_UPDATED | IW_QUAL_LEVEL_UPDATED + #if defined(CONFIG_SIGNAL_DISPLAY_DBM) && defined(CONFIG_BACKGROUND_NOISE_MONITOR) + | IW_QUAL_NOISE_UPDATED + #else + | IW_QUAL_NOISE_INVALID + #endif + #ifdef CONFIG_SIGNAL_DISPLAY_DBM + | IW_QUAL_DBM + #endif + ; + + if ( check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE && + is_same_network(&pmlmepriv->cur_network.network, &pnetwork->network, 0)){ + ss = padapter->recvpriv.signal_strength; + sq = padapter->recvpriv.signal_qual; + } else { + ss = pnetwork->network.PhyInfo.SignalStrength; + sq = pnetwork->network.PhyInfo.SignalQuality; + } + + + #ifdef CONFIG_SIGNAL_DISPLAY_DBM + iwe->u.qual.level = (u8) translate_percentage_to_dbm(ss);//dbm + #else + #ifdef CONFIG_SKIP_SIGNAL_SCALE_MAPPING + { + /* Do signal scale mapping when using percentage as the unit of signal strength, since the scale mapping is skipped in odm */ + + HAL_DATA_TYPE *pHal = GET_HAL_DATA(padapter); + + iwe->u.qual.level = (u8)odm_SignalScaleMapping(&pHal->odmpriv, ss); + } + #else + iwe->u.qual.level = (u8)ss;//% + #endif + #endif + + iwe->u.qual.qual = (u8)sq; // signal quality + + #ifdef CONFIG_PLATFORM_ROCKCHIPS + iwe->u.qual.noise = -100; // noise level suggest by zhf@rockchips + #else + #if defined(CONFIG_SIGNAL_DISPLAY_DBM) && defined(CONFIG_BACKGROUND_NOISE_MONITOR) + { + s16 tmp_noise=0; + rtw_hal_get_odm_var(padapter, HAL_ODM_NOISE_MONITOR,&(pnetwork->network.Configuration.DSConfig), &(tmp_noise)); + iwe->u.qual.noise = tmp_noise ; + } + #else + iwe->u.qual.noise = 0; // noise level + #endif + #endif //CONFIG_PLATFORM_ROCKCHIPS + + //DBG_871X("iqual=%d, ilevel=%d, inoise=%d, iupdated=%d\n", iwe.u.qual.qual, iwe.u.qual.level , iwe.u.qual.noise, iwe.u.qual.updated); + + start = iwe_stream_add_event(info, start, stop, iwe, IW_EV_QUAL_LEN); + return start; +} + +static inline char * iwe_stream_net_rsv_process(_adapter *padapter, + struct iw_request_info* info, struct wlan_network *pnetwork, + char *start, char *stop,struct iw_event *iwe) +{ + u8 buf[32] = {0}; + u8 * p,*pos; + int len; + p = buf; + pos = pnetwork->network.Reserved; + + p += sprintf(p, "fm=%02X%02X", pos[1], pos[0]); + _rtw_memset(iwe, 0, sizeof(*iwe)); + iwe->cmd = IWEVCUSTOM; + iwe->u.data.length = strlen(buf); + start = iwe_stream_add_point(info, start, stop,iwe, buf); + return start; +} + +#if 1 +static char *translate_scan(_adapter *padapter, + struct iw_request_info* info, struct wlan_network *pnetwork, + char *start, char *stop) +{ + struct iw_event iwe; + u16 cap = 0; + _rtw_memset(&iwe, 0, sizeof(iwe)); + + if(_FALSE == search_p2p_wfd_ie(padapter,info,pnetwork,start,stop)) + return start; + + start = iwe_stream_mac_addr_proess(padapter,info,pnetwork,start,stop,&iwe); + start = iwe_stream_essid_proess(padapter,info,pnetwork,start,stop,&iwe); + start = iwe_stream_protocol_process(padapter,info,pnetwork,start,stop,&iwe); + if (pnetwork->network.Reserved[0] == 2) // Probe Request + { + cap = 0; + } + else + { + _rtw_memcpy((u8 *)&cap, rtw_get_capability_from_ie(pnetwork->network.IEs), 2); + cap = le16_to_cpu(cap); + } + + start = iwe_stream_mode_process(padapter,info,pnetwork,start,stop,&iwe,cap); + start = iwe_stream_chan_process(padapter,info,pnetwork,start,stop,&iwe); + start = iwe_stream_encryption_process(padapter,info,pnetwork,start,stop,&iwe,cap); + start = iwe_stream_rate_process(padapter,info,pnetwork,start,stop,&iwe); + start = iwe_stream_wpa_wpa2_process(padapter,info,pnetwork,start,stop,&iwe); + start = iwe_stream_wps_process(padapter,info,pnetwork,start,stop,&iwe); + start = iwe_stream_wapi_process(padapter,info,pnetwork,start,stop,&iwe); + start = iwe_stream_rssi_process(padapter,info,pnetwork,start,stop,&iwe); + start = iwe_stream_net_rsv_process(padapter,info,pnetwork,start,stop,&iwe); + + return start; +} +#else +static char *translate_scan(_adapter *padapter, + struct iw_request_info* info, struct wlan_network *pnetwork, + char *start, char *stop) +{ + struct iw_event iwe; + u16 cap; + u32 ht_ielen = 0, vht_ielen = 0; + char custom[MAX_CUSTOM_LEN]; + char *p; + u16 max_rate=0, rate, ht_cap=_FALSE, vht_cap = _FALSE; + u32 i = 0; + char *current_val; + long rssi; + u8 bw_40MHz=0, short_GI=0, bw_160MHz=0, vht_highest_rate = 0; + u16 mcs_rate=0, vht_data_rate=0; + u8 ie_offset = (pnetwork->network.Reserved[0] == 2? 0:12); + struct registry_priv *pregpriv = &padapter->registrypriv; + + if(_FALSE == search_p2p_wfd_ie(padapter,info,pnetwork,start,stop)) + return start; /* AP MAC address */ iwe.cmd = SIOCGIWAP; @@ -408,7 +934,7 @@ static char *translate_scan(_adapter *padapter, _rtw_memcpy(iwe.u.ap_addr.sa_data, pnetwork->network.MacAddress, ETH_ALEN); start = iwe_stream_add_event(info, start, stop, &iwe, IW_EV_ADDR_LEN); - + /* Add the ESSID */ iwe.cmd = SIOCGIWESSID; iwe.u.data.flags = 1; @@ -416,8 +942,14 @@ static char *translate_scan(_adapter *padapter, start = iwe_stream_add_point(info, start, stop, &iwe, pnetwork->network.Ssid.Ssid); //parsing HT_CAP_IE - p = rtw_get_ie(&pnetwork->network.IEs[12], _HT_CAPABILITY_IE_, &ht_ielen, pnetwork->network.IELength-12); - + if (pnetwork->network.Reserved[0] == 2) // Probe Request + { + p = rtw_get_ie(&pnetwork->network.IEs[0], _HT_CAPABILITY_IE_, &ht_ielen, pnetwork->network.IELength); + } + else + { + p = rtw_get_ie(&pnetwork->network.IEs[12], _HT_CAPABILITY_IE_, &ht_ielen, pnetwork->network.IELength-12); + } if(p && ht_ielen>0) { struct rtw_ieee80211_ht_cap *pht_capie; @@ -488,11 +1020,16 @@ static char *translate_scan(_adapter *padapter, start = iwe_stream_add_event(info, start, stop, &iwe, IW_EV_CHAR_LEN); /* Add mode */ + if (pnetwork->network.Reserved[0] == 2) // Probe Request + { + cap = 0; + } + else + { iwe.cmd = SIOCGIWMODE; - _rtw_memcpy((u8 *)&cap, rtw_get_capability_from_ie(pnetwork->network.IEs), 2); - - - cap = le16_to_cpu(cap); + _rtw_memcpy((u8 *)&cap, rtw_get_capability_from_ie(pnetwork->network.IEs), 2); + cap = le16_to_cpu(cap); + } if(cap & (WLAN_CAPABILITY_IBSS |WLAN_CAPABILITY_BSS)){ if (cap & WLAN_CAPABILITY_BSS) @@ -565,8 +1102,9 @@ static char *translate_scan(_adapter *padapter, start = iwe_stream_add_event(info, start, stop, &iwe, IW_EV_PARAM_LEN); //parsing WPA/WPA2 IE + if (pnetwork->network.Reserved[0] != 2) // Probe Request { - u8 buf[MAX_WPA_IE_LEN]; + u8 buf[MAX_WPA_IE_LEN*2]; u8 wpa_ie[255],rsn_ie[255]; u16 wpa_len=0,rsn_len=0; u8 *p; @@ -578,11 +1116,20 @@ static char *translate_scan(_adapter *padapter, if (wpa_len > 0) { p=buf; - _rtw_memset(buf, 0, MAX_WPA_IE_LEN); + _rtw_memset(buf, 0, MAX_WPA_IE_LEN*2); p += sprintf(p, "wpa_ie="); for (i = 0; i < wpa_len; i++) { p += sprintf(p, "%02x", wpa_ie[i]); } + + if (wpa_len > 100) { + printk("-----------------Len %d----------------\n", wpa_len); + for (i = 0; i < wpa_len; i++) { + printk("%02x ", wpa_ie[i]); + } + printk("\n"); + printk("-----------------Len %d----------------\n", wpa_len); + } _rtw_memset(&iwe, 0, sizeof(iwe)); iwe.cmd = IWEVCUSTOM; @@ -597,7 +1144,7 @@ static char *translate_scan(_adapter *padapter, if (rsn_len > 0) { p = buf; - _rtw_memset(buf, 0, MAX_WPA_IE_LEN); + _rtw_memset(buf, 0, MAX_WPA_IE_LEN*2); p += sprintf(p, "rsn_ie="); for (i = 0; i < rsn_len; i++) { p += sprintf(p, "%02x", rsn_ie[i]); @@ -647,10 +1194,11 @@ static char *translate_scan(_adapter *padapter, } #ifdef CONFIG_WAPI_SUPPORT + if (pnetwork->network.Reserved[0] != 2) // Probe Request { sint out_len_wapi=0; /* here use static for stack size */ - static u8 buf_wapi[MAX_WAPI_IE_LEN]; + static u8 buf_wapi[MAX_WAPI_IE_LEN*2]; static u8 wapi_ie[MAX_WAPI_IE_LEN]; u16 wapi_len=0; u16 i; @@ -669,7 +1217,7 @@ static char *translate_scan(_adapter *padapter, if (wapi_len > 0) { p=buf_wapi; - _rtw_memset(buf_wapi, 0, MAX_WAPI_IE_LEN); + _rtw_memset(buf_wapi, 0, MAX_WAPI_IE_LEN*2); p += sprintf(p, "wapi_ie="); for (i = 0; i < wapi_len; i++) { p += sprintf(p, "%02x", wapi_ie[i]); @@ -694,7 +1242,12 @@ static char *translate_scan(_adapter *padapter, /* Add quality statistics */ iwe.cmd = IWEVQUAL; - iwe.u.qual.updated = IW_QUAL_QUAL_UPDATED | IW_QUAL_LEVEL_UPDATED | IW_QUAL_NOISE_INVALID + iwe.u.qual.updated = IW_QUAL_QUAL_UPDATED | IW_QUAL_LEVEL_UPDATED + #if defined(CONFIG_SIGNAL_DISPLAY_DBM) && defined(CONFIG_BACKGROUND_NOISE_MONITOR) + | IW_QUAL_NOISE_UPDATED + #else + | IW_QUAL_NOISE_INVALID + #endif #ifdef CONFIG_SIGNAL_DISPLAY_DBM | IW_QUAL_DBM #endif @@ -713,15 +1266,33 @@ static char *translate_scan(_adapter *padapter, #ifdef CONFIG_SIGNAL_DISPLAY_DBM iwe.u.qual.level = (u8) translate_percentage_to_dbm(ss);//dbm #else + #ifdef CONFIG_SKIP_SIGNAL_SCALE_MAPPING + { + /* Do signal scale mapping when using percentage as the unit of signal strength, since the scale mapping is skipped in odm */ + + HAL_DATA_TYPE *pHal = GET_HAL_DATA(padapter); + + iwe.u.qual.level = (u8)odm_SignalScaleMapping(&pHal->odmpriv, ss); + } + #else iwe.u.qual.level = (u8)ss;//% #endif + #endif iwe.u.qual.qual = (u8)sq; // signal quality #ifdef CONFIG_PLATFORM_ROCKCHIPS iwe.u.qual.noise = -100; // noise level suggest by zhf@rockchips #else + #if defined(CONFIG_SIGNAL_DISPLAY_DBM) && defined(CONFIG_BACKGROUND_NOISE_MONITOR) + { + s16 tmp_noise=0; + rtw_hal_get_odm_var(padapter, HAL_ODM_NOISE_MONITOR,&(pnetwork->network.Configuration.DSConfig), &(tmp_noise)); + iwe.u.qual.noise = tmp_noise ; + } + #else iwe.u.qual.noise = 0; // noise level + #endif #endif //CONFIG_PLATFORM_ROCKCHIPS //DBG_871X("iqual=%d, ilevel=%d, inoise=%d, iupdated=%d\n", iwe.u.qual.qual, iwe.u.qual.level , iwe.u.qual.noise, iwe.u.qual.updated); @@ -745,6 +1316,7 @@ static char *translate_scan(_adapter *padapter, return start; } +#endif static int wpa_set_auth_algs(struct net_device *dev, u32 value) { @@ -970,7 +1542,7 @@ _func_enter_; //DEBUG_ERR((" param->u.crypt.key_len=%d\n",param->u.crypt.key_len)); DBG_871X(" ~~~~set sta key:unicastkey\n"); - rtw_setstakey_cmd(padapter, (unsigned char *)psta, _TRUE, _TRUE); + rtw_setstakey_cmd(padapter, psta, UNICAST_KEY, _TRUE); } else//group key { @@ -1261,8 +1833,8 @@ static int rtw_set_wpa_ie(_adapter *padapter, char *pie, unsigned short ielen) { DBG_871X("SET WPS_IE\n"); - padapter->securitypriv.wps_ie_len = ( (buf[cnt+1]+2) < (MAX_WPA_IE_LEN<<2)) ? (buf[cnt+1]+2):(MAX_WPA_IE_LEN<<2); - + padapter->securitypriv.wps_ie_len = ((buf[cnt+1]+2) < MAX_WPS_IE_LEN) ? (buf[cnt+1]+2):MAX_WPS_IE_LEN; + _rtw_memcpy(padapter->securitypriv.wps_ie, &buf[cnt], padapter->securitypriv.wps_ie_len); set_fwstate(&padapter->mlmepriv, WIFI_UNDER_WPS); @@ -1353,12 +1925,18 @@ static int rtw_wx_get_name(struct net_device *dev, { if(pcur_bss->Configuration.DSConfig > 14) { - if(vht_cap == _TRUE) + #ifdef CONFIG_80211AC_VHT + if(vht_cap == _TRUE){ snprintf(wrqu->name, IFNAMSIZ, "IEEE 802.11AC"); - else if(ht_cap == _TRUE) - snprintf(wrqu->name, IFNAMSIZ, "IEEE 802.11an"); + } else - snprintf(wrqu->name, IFNAMSIZ, "IEEE 802.11a"); + #endif + { + if(ht_cap == _TRUE) + snprintf(wrqu->name, IFNAMSIZ, "IEEE 802.11an"); + else + snprintf(wrqu->name, IFNAMSIZ, "IEEE 802.11a"); + } } else { @@ -1437,9 +2015,21 @@ static int rtw_wx_set_mode(struct net_device *dev, struct iw_request_info *a, ret = -EPERM; goto exit; } - + + /* initial default type */ + dev->type = ARPHRD_ETHER; + switch(wrqu->mode) { + case IW_MODE_MONITOR: + networkType = Ndis802_11Monitor; +#if 0 + dev->type = ARPHRD_IEEE80211; /* IEEE 802.11 : 801 */ +#endif + dev->type = ARPHRD_IEEE80211_RADIOTAP; /* IEEE 802.11 + radiotap header : 803 */ + DBG_871X("set_mode = IW_MODE_MONITOR\n"); + break; + case IW_MODE_AUTO: networkType = Ndis802_11AutoUnknown; DBG_871X("set_mode = IW_MODE_AUTO\n"); @@ -1987,12 +2577,12 @@ struct iw_mlme { case IW_MLME_DEAUTH: if(!rtw_set_802_11_disassociate(padapter)) - ret = -1; + ret = -1; break; case IW_MLME_DISASSOC: if(!rtw_set_802_11_disassociate(padapter)) - ret = -1; + ret = -1; break; @@ -2095,15 +2685,8 @@ _func_enter_; #ifdef CONFIG_CONCURRENT_MODE if (check_buddy_fwstate(padapter, _FW_UNDER_SURVEY|_FW_UNDER_LINKING|WIFI_UNDER_WPS) == _TRUE) - { - if(check_buddy_fwstate(padapter, _FW_UNDER_SURVEY)) - { - DBG_871X("scanning_via_buddy_intf\n"); - pmlmepriv->scanning_via_buddy_intf = _TRUE; - } - + { indicate_wx_scan_complete_event(padapter); - goto exit; } #endif @@ -2319,20 +2902,6 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a, } #endif //CONFIG_P2P -/* -#ifdef CONFIG_CONCURRENT_MODE - if(pmlmepriv->scanning_via_buddy_intf == _TRUE) - { - pmlmepriv->scanning_via_buddy_intf = _FALSE;//reset - - // change pointers to buddy interface - padapter = pbuddy_adapter; - pmlmepriv = pbuddy_mlmepriv; - queue = &(pbuddy_mlmepriv->scanned_queue); - - } -#endif // CONFIG_CONCURRENT_MODE -*/ #if 1 // Wireless Extension use EAGAIN to try wait_status = _FW_UNDER_SURVEY #ifndef CONFIG_ANDROID @@ -4213,14 +4782,13 @@ static int rtw_wps_start(struct net_device *dev, u32 u32wps_start = 0; unsigned int uintRet = 0; - uintRet = copy_from_user( ( void* ) &u32wps_start, pdata->pointer, 4 ); - - if((padapter->bDriverStopped) || (pdata==NULL)) + if((_TRUE == padapter->bDriverStopped) ||(_TRUE==padapter->bSurpriseRemoved) || (NULL== pdata)) { ret= -EINVAL; goto exit; } + uintRet = copy_from_user( ( void* ) &u32wps_start, pdata->pointer, 4 ); if ( u32wps_start == 0 ) { u32wps_start = *extra; @@ -5165,13 +5733,10 @@ static int rtw_p2p_get_invitation_procedure(struct net_device *dev, sprintf(inv_proc_str, "\nIP=-1"); } else { - if (attr_content[0] && 0x20) - { + if ((attr_content[0] & 0x20) == 0x20) sprintf(inv_proc_str, "\nIP=1"); - } else - { + else sprintf(inv_proc_str, "\nIP=0"); - } } wrqu->data.length = strlen(inv_proc_str); @@ -5218,7 +5783,14 @@ static int rtw_p2p_connect(struct net_device *dev, DBG_871X( "[%s] WiFi Direct is disable!\n", __FUNCTION__ ); return ret; } - + +#ifdef CONFIG_INTEL_WIDI + if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == _TRUE) { + DBG_871X( "[%s] WiFi is under survey!\n", __FUNCTION__ ); + return ret; + } +#endif //CONFIG_INTEL_WIDI + if ( pwdinfo->ui_got_wps_info == P2P_NO_WPSINFO ) { return -1; @@ -5307,6 +5879,19 @@ static int rtw_p2p_connect(struct net_device *dev, else { DBG_871X( "[%s] Not Found in Scanning Queue~\n", __FUNCTION__ ); +#ifdef CONFIG_INTEL_WIDI + _cancel_timer_ex( &pwdinfo->restore_p2p_state_timer ); + rtw_p2p_set_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH); + rtw_p2p_findphase_ex_set(pwdinfo, P2P_FINDPHASE_EX_NONE); + rtw_free_network_queue(padapter, _TRUE); + /** + * For WiDi, if we can't find candidate device in scanning queue, + * driver will do scanning itself + */ + _enter_critical_bh(&pmlmepriv->lock, &irqL); + rtw_sitesurvey_cmd(padapter, NULL, 0, NULL, 0); + _exit_critical_bh(&pmlmepriv->lock, &irqL); +#endif //CONFIG_INTEL_WIDI ret = -1; } exit: @@ -5986,7 +6571,7 @@ static int rtw_p2p_prov_disc(struct net_device *dev, else { #ifdef CONFIG_INTEL_WIDI - if(check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == _TRUE){ + if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == _TRUE) { DBG_871X( "[%s] WiFi is under survey!\n", __FUNCTION__ ); return ret; } @@ -6200,6 +6785,7 @@ static int rtw_p2p_prov_disc(struct net_device *dev, { DBG_871X( "[%s] NOT Found in the Scanning Queue!\n", __FUNCTION__ ); #ifdef CONFIG_INTEL_WIDI + _cancel_timer_ex( &pwdinfo->restore_p2p_state_timer ); rtw_p2p_set_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH); rtw_p2p_findphase_ex_set(pwdinfo, P2P_FINDPHASE_EX_NONE); rtw_free_network_queue(padapter, _TRUE); @@ -6483,7 +7069,7 @@ static int rtw_p2p_get2(struct net_device *dev, if (copy_from_user(buffer, wrqu->data.pointer, wrqu->data.length)) { - ret - EFAULT; + ret = -EFAULT; goto bad; } @@ -6625,6 +7211,10 @@ static int rtw_rereg_nd_name(struct net_device *dev, #ifdef CONFIG_IOL #include #endif + +#ifdef DBG_CMD_QUEUE +u8 dump_cmd_id=0; +#endif static int rtw_dbg_port(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) @@ -6710,7 +7300,6 @@ static int rtw_dbg_port(struct net_device *dev, case 0x01: //dbg mode padapter->recvpriv.is_signal_dbg = 1; extra_arg = extra_arg>100?100:extra_arg; - extra_arg = extra_arg<0?0:extra_arg; padapter->recvpriv.signal_strength_dbg=extra_arg; break; } @@ -6941,9 +7530,6 @@ static int rtw_dbg_port(struct net_device *dev, psta = rtw_get_stainfo(pstapriv, cur_network->network.MacAddress); if(psta) { - int i; - struct recv_reorder_ctrl *preorder_ctrl; - DBG_871X("SSID=%s\n", cur_network->network.Ssid.Ssid); DBG_871X("sta's macaddr:" MAC_FMT "\n", MAC_ARG(psta->hwaddr)); DBG_871X("cur_channel=%d, cur_bwmode=%d, cur_ch_offset=%d\n", pmlmeext->cur_channel, pmlmeext->cur_bwmode, pmlmeext->cur_ch_offset); @@ -6955,16 +7541,8 @@ static int rtw_dbg_port(struct net_device *dev, DBG_871X("ampdu_enable = %d\n", psta->htpriv.ampdu_enable); DBG_871X("agg_enable_bitmap=%x, candidate_tid_bitmap=%x\n", psta->htpriv.agg_enable_bitmap, psta->htpriv.candidate_tid_bitmap); #endif //CONFIG_80211N_HT - - for(i=0;i<16;i++) - { - preorder_ctrl = &psta->recvreorder_ctrl[i]; - if(preorder_ctrl->enable) - { - DBG_871X("tid=%d, indicate_seq=%d\n", i, preorder_ctrl->indicate_seq); - } - } - + + sta_rx_reorder_ctl_dump(RTW_DBGDUMP, psta); } else { @@ -6973,7 +7551,7 @@ static int rtw_dbg_port(struct net_device *dev, break; case 0x06: { - u32 ODMFlag; + u32 ODMFlag = 0; rtw_hal_get_hwreg(padapter, HW_VAR_DM_FLAG, (u8*)(&ODMFlag)); DBG_871X("(B)DMFlag=0x%x, arg=0x%x\n", ODMFlag, arg); ODMFlag = (u32)(0x0f&arg); @@ -6997,15 +7575,14 @@ static int rtw_dbg_port(struct net_device *dev, pxmitpriv->free_xmit_extbuf_cnt, pxmitpriv->free_xframe_ext_cnt, precvpriv->free_recvframe_cnt); #ifdef CONFIG_USB_HCI - DBG_871X("rx_urb_pending_cn=%d\n", precvpriv->rx_pending_cnt); + DBG_871X("rx_urb_pending_cn=%d\n", ATOMIC_READ(&(precvpriv->rx_pending_cnt))); #endif } break; case 0x09: { - int i, j; + int i; _list *plist, *phead; - struct recv_reorder_ctrl *preorder_ctrl; #ifdef CONFIG_AP_MODE DBG_871X("sta_dz_bitmap=0x%x, tim_bitmap=0x%x\n", pstapriv->sta_dz_bitmap, pstapriv->tim_bitmap); @@ -7044,18 +7621,8 @@ static int rtw_dbg_port(struct net_device *dev, DBG_871X("qos_info=0x%x\n", psta->qos_info); #endif DBG_871X("dot118021XPrivacy=0x%x\n", psta->dot118021XPrivacy); - - - - for(j=0;j<16;j++) - { - preorder_ctrl = &psta->recvreorder_ctrl[j]; - if(preorder_ctrl->enable) - { - DBG_871X("tid=%d, indicate_seq=%d\n", j, preorder_ctrl->indicate_seq); - } - } - + + sta_rx_reorder_ctl_dump(RTW_DBGDUMP, psta); } } @@ -7072,6 +7639,26 @@ static int rtw_dbg_port(struct net_device *dev, printk("%s ==> max_mac_id = %d \n",__FUNCTION__,max_mac_id); } break; + case 0x0b: //Enable=1, Disable=0 driver control vrtl_carrier_sense. + { + //u8 driver_vcs_en; //Enable=1, Disable=0 driver control vrtl_carrier_sense. + //u8 driver_vcs_type;//force 0:disable VCS, 1:RTS-CTS, 2:CTS-to-self when vcs_en=1. + + if(arg == 0){ + DBG_871X("disable driver ctrl vcs\n"); + padapter->driver_vcs_en = 0; + } + else if(arg == 1){ + DBG_871X("enable driver ctrl vcs = %d\n", extra_arg); + padapter->driver_vcs_en = 1; + + if(extra_arg>2) + padapter->driver_vcs_type = 1; + else + padapter->driver_vcs_type = extra_arg; + } + } + break; case 0x0c://dump rx/tx packet { if(arg == 0){ @@ -7096,6 +7683,23 @@ static int rtw_dbg_port(struct net_device *dev, } break; #endif + case 0x0e: + { + if(arg == 0){ + DBG_871X("disable driver ctrl rx_ampdu_factor\n"); + padapter->driver_rx_ampdu_factor = 0xFF; + } + else if(arg == 1){ + + DBG_871X("enable driver ctrl rx_ampdu_factor = %d\n", extra_arg); + + if(extra_arg > 0x03) + padapter->driver_rx_ampdu_factor = 0xFF; + else + padapter->driver_rx_ampdu_factor = extra_arg; + } + } + break; #ifdef DBG_CONFIG_ERROR_DETECT case 0x0f: { @@ -7122,12 +7726,25 @@ static int rtw_dbg_port(struct net_device *dev, case 0x10:// driver version display dump_drv_version(RTW_DBGDUMP); break; - case 0x11: - { - DBG_871X("linked info dump func %s \n",(extra_arg>=1)?"enable":"disable"); - padapter->bLinkInfoDump = extra_arg ; - rtw_hal_set_def_var(padapter, HW_DEF_FA_CNT_DUMP, &(extra_arg)); - } + case 0x11://dump linked status + { + int pre_mode; + pre_mode=padapter->bLinkInfoDump; + // linked_info_dump(padapter,extra_arg); + if(extra_arg==1 || (extra_arg==0 && pre_mode==1) ) //not consider pwr_saving 0: + { + padapter->bLinkInfoDump = extra_arg; + + } + else if( (extra_arg==2 ) || (extra_arg==0 && pre_mode==2))//consider power_saving + { + //DBG_871X("linked_info_dump =%s \n", (padapter->bLinkInfoDump)?"enable":"disable") + linked_info_dump(padapter,extra_arg); + } + + + + } break; #ifdef CONFIG_80211N_HT case 0x12: //set rx_stbc @@ -7149,7 +7766,7 @@ static int rtw_dbg_port(struct net_device *dev, { struct registry_priv *pregpriv = &padapter->registrypriv; // 0: disable, 0x1:enable (but wifi_spec should be 0), 0x2: force enable (don't care wifi_spec) - if( pregpriv && extra_arg >= 0 && extra_arg < 3 ) + if( pregpriv && extra_arg < 3 ) { pregpriv->ampdu_enable= extra_arg; DBG_871X("set ampdu_enable=%d\n",pregpriv->ampdu_enable); @@ -7194,6 +7811,120 @@ static int rtw_dbg_port(struct net_device *dev, rtw_hal_set_hwreg(padapter, HW_VAR_USB_MODE, (u8 *)&extra_arg); } break; +#ifdef CONFIG_80211N_HT + case 0x19: + { + struct registry_priv *pregistrypriv = &padapter->registrypriv; + // extra_arg : + // BIT0: Enable VHT LDPC Rx, BIT1: Enable VHT LDPC Tx, + // BIT4: Enable HT LDPC Rx, BIT5: Enable HT LDPC Tx + if(arg == 0){ + DBG_871X("driver disable LDPC\n"); + pregistrypriv->ldpc_cap = 0x00; + } + else if(arg == 1){ + DBG_871X("driver set LDPC cap = 0x%x\n", extra_arg); + pregistrypriv->ldpc_cap = (u8)(extra_arg&0x33); + } + } + break; + case 0x1a: + { + struct registry_priv *pregistrypriv = &padapter->registrypriv; + // extra_arg : + // BIT0: Enable VHT STBC Rx, BIT1: Enable VHT STBC Tx, + // BIT4: Enable HT STBC Rx, BIT5: Enable HT STBC Tx + if(arg == 0){ + DBG_871X("driver disable STBC\n"); + pregistrypriv->stbc_cap = 0x00; + } + else if(arg == 1){ + DBG_871X("driver set STBC cap = 0x%x\n", extra_arg); + pregistrypriv->stbc_cap = (u8)(extra_arg&0x33); + } + } + break; +#endif //CONFIG_80211N_HT + case 0x1b: + { + struct registry_priv *pregistrypriv = &padapter->registrypriv; + + if(arg == 0){ + DBG_871X("disable driver ctrl max_rx_rate, reset to default_rate_set\n"); + init_mlme_default_rate_set(padapter); +#ifdef CONFIG_80211N_HT + pregistrypriv->ht_enable = (u8)rtw_ht_enable; +#endif //CONFIG_80211N_HT + } + else if(arg == 1){ + + int i; + u8 max_rx_rate; + + DBG_871X("enable driver ctrl max_rx_rate = 0x%x\n", extra_arg); + + max_rx_rate = (u8)extra_arg; + + if(max_rx_rate < 0xc) // max_rx_rate < MSC0 -> B or G -> disable HT + { +#ifdef CONFIG_80211N_HT + pregistrypriv->ht_enable = 0; +#endif //CONFIG_80211N_HT + for(i=0; idatarate[i] > max_rx_rate) + pmlmeext->datarate[i] = 0xff; + } + + } +#ifdef CONFIG_80211N_HT + else if(max_rx_rate < 0x1c) // mcs0~mcs15 + { + u32 mcs_bitmap=0x0; + + for(i=0; i<((max_rx_rate+1)-0xc); i++) + mcs_bitmap |= BIT(i); + + set_mcs_rate_by_mask(pmlmeext->default_supported_mcs_set, mcs_bitmap); + } +#endif //CONFIG_80211N_HT + } + } + break; + case 0x1c: //enable/disable driver control AMPDU Density for peer sta's rx + { + if(arg == 0){ + DBG_871X("disable driver ctrl ampdu density\n"); + padapter->driver_ampdu_spacing = 0xFF; + } + else if(arg == 1){ + + DBG_871X("enable driver ctrl ampdu density = %d\n", extra_arg); + + if(extra_arg > 0x07) + padapter->driver_ampdu_spacing = 0xFF; + else + padapter->driver_ampdu_spacing = extra_arg; + } + } + break; +#ifdef CONFIG_BACKGROUND_NOISE_MONITOR + case 0x1e: + { + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); + PDM_ODM_T pDM_Odm = &pHalData->odmpriv; + u8 chan = rtw_get_oper_ch(padapter); + DBG_871X("===========================================\n"); + ODM_InbandNoise_Monitor(pDM_Odm,_TRUE,0x1e,100); + DBG_871X("channel(%d),noise_a = %d, noise_b = %d , noise_all:%d \n", + chan,pDM_Odm->noise_level.noise[ODM_RF_PATH_A], + pDM_Odm->noise_level.noise[ODM_RF_PATH_B], + pDM_Odm->noise_level.noise_all); + DBG_871X("===========================================\n"); + + } + break; +#endif case 0x23: { DBG_871X("turn %s the bNotifyChannelChange Variable\n",(extra_arg==1)?"on":"off"); @@ -7208,6 +7939,54 @@ static int rtw_dbg_port(struct net_device *dev, #endif // CONFIG_P2P break; } +#ifdef CONFIG_GPIO_API + case 0x25: //Get GPIO register + { + /* + * dbg 0x7f250000 [gpio_num], Get gpio value, gpio_num:0~7 + */ + + u8 value; + DBG_871X("Read GPIO Value extra_arg = %d\n",extra_arg); + value = rtw_hal_get_gpio(padapter,extra_arg); + DBG_871X("Read GPIO Value = %d\n",value); + break; + } + case 0x26: //Set GPIO direction + { + + /* dbg 0x7f26000x [y], Set gpio direction, + * x: gpio_num,4~7 y: indicate direction, 0~1 + */ + + int value; + DBG_871X("Set GPIO Direction! arg = %d ,extra_arg=%d\n",arg ,extra_arg); + value = rtw_hal_config_gpio(padapter, arg, extra_arg); + DBG_871X("Set GPIO Direction %s \n",(value==-1)?"Fail!!!":"Success"); + break; + } + case 0x27: //Set GPIO output direction value + { + /* + * dbg 0x7f27000x [y], Set gpio output direction value, + * x: gpio_num,4~7 y: indicate direction, 0~1 + */ + + int value; + DBG_871X("Set GPIO Value! arg = %d ,extra_arg=%d\n",arg ,extra_arg); + value = rtw_hal_set_gpio_output_value(padapter,arg,extra_arg); + DBG_871X("Set GPIO Value %s \n",(value==-1)?"Fail!!!":"Success"); + break; + } +#endif +#ifdef DBG_CMD_QUEUE + case 0x28: + { + dump_cmd_id = extra_arg; + DBG_871X("dump_cmd_id:%d\n",dump_cmd_id); + } + break; +#endif //DBG_CMD_QUEUE case 0xaa: { if((extra_arg & 0x7F)> 0x3F) extra_arg = 0xFF; @@ -7231,7 +8010,7 @@ static int rtw_dbg_port(struct net_device *dev, case 0xee://turn on/off dynamic funcs { - u32 odm_flag; + u32 odm_flag = 0; if(0xf==extra_arg){ rtw_hal_get_def_var(padapter, HAL_DEF_DBG_DM_FUNC,&odm_flag); @@ -7926,9 +8705,9 @@ static int rtw_add_sta(struct net_device *dev, struct ieee_param *param) if(psta) { DBG_871X("rtw_add_sta(), free has been added psta=%p\n", psta); - _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); + //_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); rtw_free_stainfo(padapter, psta); - _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); + //_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); psta = NULL; } @@ -8316,7 +9095,7 @@ static int rtw_set_hidden_ssid(struct net_device *dev, struct ieee_param *param, int ie_len; u8 *ssid_ie; char ssid[NDIS_802_11_LENGTH_SSID + 1]; - sint ssid_len; + sint ssid_len = 0; u8 ignore_broadcast_ssid; if(check_fwstate(mlmepriv, WIFI_AP_STATE) != _TRUE) @@ -8338,10 +9117,10 @@ static int rtw_set_hidden_ssid(struct net_device *dev, struct ieee_param *param, ssid[ssid_len] = 0x0; if(0) - DBG_871X(FUNC_ADPT_FMT" ssid:(%s,%d), from ie:(%s,%d), (%s,%d)\n", FUNC_ADPT_ARG(adapter), - ssid, ssid_len, - pbss_network->Ssid.Ssid, pbss_network->Ssid.SsidLength, - pbss_network_ext->Ssid.Ssid, pbss_network_ext->Ssid.SsidLength); + DBG_871X(FUNC_ADPT_FMT" ssid:(%s,%d), from ie:(%s,%d), (%s,%d)\n", FUNC_ADPT_ARG(adapter), + ssid, ssid_len, + pbss_network->Ssid.Ssid, pbss_network->Ssid.SsidLength, + pbss_network_ext->Ssid.Ssid, pbss_network_ext->Ssid.SsidLength); _rtw_memcpy(pbss_network->Ssid.Ssid, (void *)ssid, ssid_len); pbss_network->Ssid.SsidLength = ssid_len; @@ -8349,9 +9128,9 @@ static int rtw_set_hidden_ssid(struct net_device *dev, struct ieee_param *param, pbss_network_ext->Ssid.SsidLength = ssid_len; if(0) - DBG_871X(FUNC_ADPT_FMT" after ssid:(%s,%d), (%s,%d)\n", FUNC_ADPT_ARG(adapter), - pbss_network->Ssid.Ssid, pbss_network->Ssid.SsidLength, - pbss_network_ext->Ssid.Ssid, pbss_network_ext->Ssid.SsidLength); + DBG_871X(FUNC_ADPT_FMT" after ssid:(%s,%d), (%s,%d)\n", FUNC_ADPT_ARG(adapter), + pbss_network->Ssid.Ssid, pbss_network->Ssid.SsidLength, + pbss_network_ext->Ssid.Ssid, pbss_network_ext->Ssid.SsidLength); } DBG_871X(FUNC_ADPT_FMT" ignore_broadcast_ssid:%d, %s,%d\n", FUNC_ADPT_ARG(adapter), @@ -8744,6 +9523,74 @@ static int rtw_wx_set_priv(struct net_device *dev, return ret; } +#ifdef CONFIG_WOWLAN +static int rtw_wowlan_ctrl(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) +{ + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + struct wowlan_ioctl_param poidparam; + struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(padapter); + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + struct net_device *pnetdev = padapter->pnetdev; +#ifdef CONFIG_CONCURRENT_MODE + struct net_device *pbuddy_netdev = padapter->pbuddy_adapter->pnetdev; +#endif + struct sta_info *psta = NULL; + int ret = 0; + u32 start_time = rtw_get_current_time(); + poidparam.subcode = 0; + + DBG_871X("+rtw_wowlan_ctrl: %s\n", extra); + + if(pwrctrlpriv->bSupportRemoteWakeup==_FALSE){ + ret = -EPERM; + DBG_871X("+rtw_wowlan_ctrl: Device didn't support the remote wakeup!!\n"); + goto _rtw_wowlan_ctrl_exit_free; + } + + if (!check_fwstate(pmlmepriv, _FW_LINKED) && + check_fwstate(pmlmepriv, WIFI_STATION_STATE)) { +#ifdef CONFIG_PNO_SUPPORT + pwrctrlpriv->wowlan_pno_enable = _TRUE; +#else + DBG_871X("[%s] WARNING: Please Connect With AP First!!\n", __func__); + goto _rtw_wowlan_ctrl_exit_free; +#endif //CONFIG_PNO_SUPPORT + } + + if (_rtw_memcmp( extra, "enable", 6 )) { + + padapter->registrypriv.mp_mode = 1; + + pwrctrlpriv->wowlan_from_cmd = _TRUE; + + rtw_suspend_common(padapter); + + } else if (_rtw_memcmp( extra, "disable", 6 )) { + + rtw_resume_common(padapter); + + pwrctrlpriv->wowlan_from_cmd = _FALSE; + +#ifdef CONFIG_PNO_SUPPORT + pwrctrlpriv->wowlan_pno_enable = _FALSE; +#endif //CONFIG_PNO_SUPPORT + + padapter->registrypriv.mp_mode = 0; + } else { + DBG_871X("[%s] Invalid Parameter.\n", __func__); + goto _rtw_wowlan_ctrl_exit_free; + } + //mutex_lock(&ioctl_mutex); +_rtw_wowlan_ctrl_exit_free: + DBG_871X("-rtw_wowlan_ctrl( subcode = %d)\n", poidparam.subcode); + DBG_871X_LEVEL(_drv_always_, "%s in %d ms\n", __func__, + rtw_get_passing_time_ms(start_time)); +_rtw_wowlan_ctrl_exit: + return ret; +} +#endif //CONFIG_WOWLAN #ifdef CONFIG_AP_WOWLAN static int rtw_ap_wowlan_ctrl(struct net_device *dev, @@ -9532,7 +10379,7 @@ static int rtw_mp_efuse_set(struct net_device *dev, u8 *ShadowMapWiFi = NULL; u8 *setrawdata = NULL; char *pch, *ptmp, *token, *tmp[3]={0x00,0x00,0x00}; - u16 addr=0, cnts=0, BTStatus=0 , max_available_size=0; + u16 addr=0xFF, cnts=0, BTStatus=0 , max_available_size=0; int err; wrqu = (struct iw_point*)wdata; @@ -9541,6 +10388,10 @@ static int rtw_mp_efuse_set(struct net_device *dev, pHalData = GET_HAL_DATA(padapter); pEfuseHal = &pHalData->EfuseHal; err = 0; + + if (copy_from_user(extra, wrqu->pointer, wrqu->length)) + return -EFAULT; + setdata = rtw_zmalloc(1024); if (setdata == NULL) { @@ -9575,9 +10426,6 @@ static int rtw_mp_efuse_set(struct net_device *dev, ips_mode = pwrctrlpriv->ips_mode;//keep org value rtw_pm_set_ips(padapter,IPS_NONE); #endif - - if (copy_from_user(extra, wrqu->pointer, wrqu->length)) - return -EFAULT; pch = extra; DBG_871X("%s: in=%s\n", __FUNCTION__, extra); @@ -9656,7 +10504,7 @@ static int rtw_mp_efuse_set(struct net_device *dev, goto exit; } *extra = 0; - DBG_871X("%s: after rtw_BT_efuse_map_write to _rtw_memcmp \n", __FUNCTION__); + DBG_871X("%s: after rtw_efuse_map_write to _rtw_memcmp \n", __FUNCTION__); if ( (rtw_efuse_map_read(padapter, addr, cnts, ShadowMapWiFi) == _SUCCESS ) ) { if (_rtw_memcmp((void*)ShadowMapWiFi ,(void*)setdata,cnts)) @@ -9786,7 +10634,20 @@ static int rtw_mp_efuse_set(struct net_device *dev, addr = EEPROM_MAC_ADDR_8723BU; #endif #endif // CONFIG_RTL8723B - + + #if defined(CONFIG_RTL8812A) || defined(CONFIG_RTL8821A) + #ifdef CONFIG_SDIO_HCI + addr = EEPROM_MAC_ADDR_8821AS; + #endif + #ifdef CONFIG_PCI_HCI + addr = EEPROM_MAC_ADDR_8821AE; + #endif + #ifdef CONFIG_USB_HCI + addr = EEPROM_MAC_ADDR_8821AU; + #endif + + #endif // CONFIG_RTL8812A/CONFIG_RTL8821A + cnts = strlen(tmp[1]); if (cnts%2) { @@ -10430,8 +11291,8 @@ static int rtw_mp_read_reg(struct net_device *dev, tmp[j]=' '; j++; } - if ( data[i] != '\0' ) - tmp[j] = data[i]; + if ( data[i] != '\0' ) + tmp[j] = data[i]; j++; } @@ -10560,6 +11421,8 @@ static int rtw_mp_read_rf(struct net_device *dev, while( *pch != '\0' ) { pnext = strpbrk(pch, " "); + if (!pnext) + break; pnext++; if ( *pnext != '\0' ) { @@ -10586,29 +11449,21 @@ static int rtw_mp_start(struct net_device *dev, struct dm_priv *pdmpriv = &pHalData->dmpriv; struct hal_ops *pHalFunc = &padapter->HalFunc; + rtw_pm_set_ips(padapter,IPS_NONE); + LeaveAllPowerSaveMode(padapter); + if(padapter->registrypriv.mp_mode ==0) { - #if (defined(CONFIG_RTL8723A) || defined(CONFIG_RTL8723B)) - DBG_871X("_rtw_mp_xmit_priv for Download BT patch FW\n"); - _rtw_mp_xmit_priv(&padapter->xmitpriv); - #endif - - padapter->registrypriv.mp_mode =1; - - rtw_pm_set_ips(padapter,IPS_NONE); - LeaveAllPowerSaveMode(padapter); - MPT_InitializeAdapter(padapter, 1); #ifdef CONFIG_BT_COEXIST - rtw_btcoex_HaltNotify(padapter); - rtw_btcoex_SetManualControl(padapter, _TRUE); pdmpriv->DMFlag &= ~DYNAMIC_FUNC_BT; - // Force to switch Antenna to WiFi - padapter->registrypriv.mp_mode=0; +#endif + pHalFunc->hal_deinit(padapter); + padapter->registrypriv.mp_mode =1; pHalFunc->hal_init(padapter); - padapter->registrypriv.mp_mode=1; - //rtw_btcoex_HaltNotify(padapter); -#endif + + rtw_pm_set_ips(padapter,IPS_NONE); + LeaveAllPowerSaveMode(padapter); } if (padapter->registrypriv.mp_mode == 0) @@ -10622,14 +11477,22 @@ static int rtw_mp_start(struct net_device *dev, } padapter->mppriv.bmac_filter = _FALSE; #ifdef CONFIG_RTL8723B +#ifdef CONFIG_USB_HCI + rtw_write32(padapter, 0x765, 0x0000); + rtw_write32(padapter, 0x948, 0x0280); +#else + rtw_write32(padapter, 0x765, 0x0000); + rtw_write32(padapter, 0x948, 0x0000); +#endif +#ifdef CONFIG_FOR_RTL8723BS_VQ0 + rtw_write32(padapter, 0x765, 0x0000); + rtw_write32(padapter, 0x948, 0x0280); +#endif rtw_write8(padapter, 0x66, 0x27); //Open BT uart Log rtw_write8(padapter, 0xc50, 0x20); //for RX init Gain #endif ODM_Write_DIG(&pHalData->odmpriv,0x20); - rtw_write32(padapter, 0x508 , 0x00a43f); //Disable EDCA BE Txop for MP pkt tx - DBG_871X("%s:write 0x508~~~~~~ 0x%x\n", __func__,rtw_read32(padapter, 0x508)); - return 0; } @@ -10642,10 +11505,6 @@ static int rtw_mp_stop(struct net_device *dev, if(padapter->registrypriv.mp_mode ==1) { - #if (defined(CONFIG_RTL8723A) || defined(CONFIG_RTL8723B)) - DBG_871X("_rtw_mp_xmit_priv reinit for normal mode\n"); - _rtw_mp_xmit_priv(&padapter->xmitpriv); - #endif MPT_DeInitAdapter(padapter); pHalFunc->hal_deinit(padapter); @@ -10674,27 +11533,34 @@ static int rtw_mp_rate(struct net_device *dev, if (copy_from_user(input, wrqu->pointer, wrqu->length)) return -EFAULT; - rate = rtw_atoi(input); - sprintf( extra, "Set data rate to %d" , rate ); - + rate = rtw_mpRateParseFunc(padapter,input); + + if (rate ==0 && strcmp(input,"1M")!=0) + { + rate = rtw_atoi(input); if(rate <= 0x7f) rate = wifirate2_ratetbl_inx( (u8)rate); - else if (rate < 0x90) - //HT rate 0x80(MCS0) ~ 0x8F(MCS15) 128~143 + else if (rate < 0xC8) rate =(rate - 0x80 + MPT_RATE_MCS0); - else + //HT rate 0x80(MCS0) ~ 0x8F(MCS15) ~ 0x9F(MCS31) 128~159 + //VHT1SS~2SS rate 0xA0 (VHT1SS_MCS0 44) ~ 0xB3 (VHT2SS_MCS9 #63) 160~179 + //VHT rate 0xB4 (VHT3SS_MCS0 64) ~ 0xC7 (VHT2SS_MCS9 #83) 180~199 + //else //VHT rate 0x90(VHT1SS_MCS0) ~ 0x99(VHT1SS_MCS9) 144~153 - rate =(rate - MPT_RATE_VHT1SS_MCS0); + // rate =(rate - MPT_RATE_VHT1SS_MCS0); + } + _rtw_memset(extra, 0, wrqu->length); - //DBG_871X("%s: rate=%d\n", __func__, rate); + sprintf( extra, "Set data rate to %s index %d" ,input,rate ); + DBG_871X("%s: %s rate index=%d \n", __func__,input,rate); if (rate >= MPT_RATE_LAST ) - return -EINVAL; + return -EINVAL; padapter->mppriv.rateidx = rate; Hal_SetDataRate(padapter); - wrqu->length = strlen(extra) + 1; + wrqu->length = strlen(extra); return 0; } @@ -10714,14 +11580,13 @@ static int rtw_mp_channel(struct net_device *dev, channel = rtw_atoi(input); //DBG_871X("%s: channel=%d\n", __func__, channel); + _rtw_memset(extra, 0, wrqu->length); sprintf( extra, "Change channel %d to channel %d", padapter->mppriv.channel , channel ); padapter->mppriv.channel = channel; - pHalData->CurrentChannel = channel; Hal_SetChannel(padapter); + pHalData->CurrentChannel = channel; - //cur_ch_offset = rtw_get_offset_by_ch(padapter->mppriv.channel); - //set_channel_bwmode(padapter, padapter->mppriv.channel, cur_ch_offset, padapter->mppriv.bandwidth); - wrqu->length = strlen(extra) + 1; + wrqu->length = strlen(extra); return 0; } @@ -10748,10 +11613,10 @@ static int rtw_mp_bandwidth(struct net_device *dev, DBG_871X("%s: bw=%d sg=%d \n", __func__, bandwidth , sg); padapter->mppriv.bandwidth = (u8)bandwidth; - pHalData->CurrentChannelBW = bandwidth; padapter->mppriv.preamble = sg; SetBandwidth(padapter); + pHalData->CurrentChannelBW = bandwidth; //cur_ch_offset = rtw_get_offset_by_ch(padapter->mppriv.channel); //set_channel_bwmode(padapter, padapter->mppriv.channel, cur_ch_offset, bandwidth); @@ -10777,7 +11642,7 @@ static int rtw_mp_txpower_index(struct net_device *dev, rfpath = rtw_atoi(input); txpower_inx = mpt_ProQueryCalTxPower(padapter, rfpath); sprintf(extra, " %d", txpower_inx); - wrqu->length = strlen(extra) + 1; + wrqu->length = strlen(extra); return 0; } @@ -10787,7 +11652,8 @@ static int rtw_mp_txpower(struct net_device *dev, struct iw_request_info *info, struct iw_point *wrqu, char *extra) { - u32 idx_a=0,idx_b=0,MsetPower=1; + u32 idx_a = 0, idx_b = 0; + int MsetPower = 1; u8 input[wrqu->length]; PADAPTER padapter = rtw_netdev_priv(dev); @@ -10811,7 +11677,7 @@ static int rtw_mp_txpower(struct net_device *dev, padapter->mppriv.bSetTxPower = 1; Hal_SetAntennaPathPower(padapter); } - wrqu->length = strlen(extra) + 1; + wrqu->length = strlen(extra); return 0; } @@ -10829,7 +11695,7 @@ static int rtw_mp_ant_tx(struct net_device *dev, //DBG_871X("%s: input=%s\n", __func__, input); - sprintf( extra, "switch Tx antenna to %s", input ); + sprintf( extra, "switch Tx antenna to %s", input); for (i=0; i < strlen(input); i++) { @@ -10846,11 +11712,12 @@ static int rtw_mp_ant_tx(struct net_device *dev, //antenna |= BIT(extra[i]-'a'); //DBG_871X("%s: antenna=0x%x\n", __func__, antenna); padapter->mppriv.antenna_tx = antenna; + padapter->mppriv.antenna_rx = antenna; //DBG_871X("%s:mppriv.antenna_rx=%d\n", __func__, padapter->mppriv.antenna_tx); Hal_SetAntenna(padapter); - wrqu->length = strlen(extra) + 1; + wrqu->length = strlen(extra); return 0; } @@ -10886,6 +11753,7 @@ static int rtw_mp_ant_rx(struct net_device *dev, } //DBG_871X("%s: antenna=0x%x\n", __func__, antenna); + padapter->mppriv.antenna_tx = antenna; padapter->mppriv.antenna_rx = antenna; //DBG_871X("%s:mppriv.antenna_rx=%d\n", __func__, padapter->mppriv.antenna_rx); Hal_SetAntenna(padapter); @@ -10894,20 +11762,46 @@ static int rtw_mp_ant_rx(struct net_device *dev, return 0; } +static int rtw_set_ctx_destAddr(struct net_device *dev, + struct iw_request_info *info, + struct iw_point *wrqu, char *extra) +{ + int jj,kk=0; + + struct pkt_attrib *pattrib; + struct mp_priv *pmp_priv; + PADAPTER padapter = rtw_netdev_priv(dev); + pmp_priv = &padapter->mppriv; + pattrib = &pmp_priv->tx.attrib; + + if( strlen(extra) < 5 ) + return _FAIL; + + DBG_871X("%s: in=%s\n", __func__, extra); + for(jj = 0,kk = 0; jj < ETH_ALEN; jj++, kk += 3 ) + { + pattrib->dst[ jj ] = key_2char2num( extra[kk], extra[kk+ 1] ); + } + + DBG_871X("pattrib->dst:%x %x %x %x %x %x\n",pattrib->dst[0],pattrib->dst[1],pattrib->dst[2],pattrib->dst[3],pattrib->dst[4],pattrib->dst[5]); + return 0; +} + static int rtw_mp_ctx(struct net_device *dev, struct iw_request_info *info, struct iw_point *wrqu, char *extra) { - u32 pkTx = 1, countPkTx = 1, cotuTx = 1, CarrSprTx = 1, scTx = 1, sgleTx = 1, stop = 1; + u32 pkTx = 1; + int countPkTx = 1, cotuTx = 1, CarrSprTx = 1, scTx = 1, sgleTx = 1, stop = 1; u32 bStartTest = 1; - u32 count = 0,interval=0,pktinterval=0; + u32 count = 0,pktinterval=0,pktlen=0; struct mp_priv *pmp_priv; struct pkt_attrib *pattrib; - PADAPTER padapter = rtw_netdev_priv(dev); - + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); pmp_priv = &padapter->mppriv; + pattrib = &pmp_priv->tx.attrib; if (copy_from_user(extra, wrqu->pointer, wrqu->length)) return -EFAULT; @@ -10922,31 +11816,34 @@ static int rtw_mp_ctx(struct net_device *dev, pkTx = strncmp(extra, "background,pkt", 20); stop = strncmp(extra, "stop", 4); sscanf(extra, "count=%d,pkt", &count); - sscanf(extra, "interval=%d", &interval); sscanf(extra, "pktinterval=%d", &pktinterval); + sscanf(extra, "pktlen=%d", &pktlen); + + if ( _rtw_memcmp( extra, "destmac=", 8 ) ) + { + wrqu->length -= 8; + rtw_set_ctx_destAddr (dev,info,wrqu,&extra[8]); + sprintf( extra, "Set dest mac OK ! \n"); + return 0; + } //DBG_871X("%s: count=%d countPkTx=%d cotuTx=%d CarrSprTx=%d scTx=%d sgleTx=%d pkTx=%d stop=%d\n", __func__, count, countPkTx, cotuTx, CarrSprTx, pkTx, sgleTx, scTx, stop); - _rtw_memset(extra, '\0', sizeof(extra)); + _rtw_memset(extra, '\0', strlen(extra)); if( pktinterval !=0 ) { - sprintf( extra, "Pkt Interval = %d",interval); - padapter->mppriv.pktInterval = interval; - + sprintf( extra, "Pkt Interval = %d",pktinterval); + padapter->mppriv.pktInterval = pktinterval; wrqu->length = strlen(extra); return 0; } - if( interval !=0 ) - { - sprintf( extra, "Interval = %d",interval); - rtw_write8(padapter, 0x508 , interval); - if(interval==1) - rtw_write32(padapter, 0x508 , 0x5ea42b); - + if( pktlen !=0 ) + { + sprintf( extra, "Pkt len = %d",pktlen); + pattrib->pktlen = pktlen ; wrqu->length = strlen(extra); return 0; } - if (stop == 0) { bStartTest = 0; // To set Stop pmp_priv->tx.stop = 1; @@ -10985,20 +11882,16 @@ static int rtw_mp_ctx(struct net_device *dev, } else if (pmp_priv->tx.stop == 1) { - sprintf( extra, "Start continuous DA=ffffffffffff len=1500 count=%u,\n",count); + sprintf( extra, "Start continuous DA=ffffffffffff len=1500 count=%u\n",count); //DBG_871X("%s:countPkTx %d\n", __func__,count); pmp_priv->tx.stop = 0; pmp_priv->tx.count = count; - pmp_priv->tx.payload = 2; -#ifdef CONFIG_80211N_HT - pmp_priv->tx.attrib.ht_en = 1; -#endif -#ifdef CONFIG_80211AC_VHT - pmp_priv->tx.attrib.raid = RATEID_IDX_VHT_1SS; //10 -#endif - pattrib = &pmp_priv->tx.attrib; - pattrib->pktlen = 1000; - _rtw_memset(pattrib->dst, 0xFF, ETH_ALEN); + #ifdef CONFIG_80211AC_VHT + if (pHalData->rf_type == RF_1T1R) + pmp_priv->tx.attrib.raid = RATEID_IDX_VHT_1SS; + else + pmp_priv->tx.attrib.raid = RATEID_IDX_VHT_2SS; + #endif SetPacketTx(padapter); } else { @@ -11013,15 +11906,15 @@ static int rtw_mp_ctx(struct net_device *dev, if (bStartTest != 0){ sprintf( extra, "Start continuous DA=ffffffffffff len=1500 \n infinite=yes."); } - Hal_SetSingleToneTx(padapter, (u8)bStartTest); + Hal_SetSingleToneTx(padapter, (u8)bStartTest); break; case MP_CONTINUOUS_TX: //DBG_871X("%s: cotuTx %d\n", __func__, bStartTest); if (bStartTest != 0){ sprintf( extra, "Start continuous DA=ffffffffffff len=1500 \n infinite=yes."); - } - Hal_SetContinuousTx(padapter, (u8)bStartTest); + } + Hal_SetContinuousTx(padapter, (u8)bStartTest); break; case MP_CARRIER_SUPPRISSION_TX: @@ -11030,10 +11923,11 @@ static int rtw_mp_ctx(struct net_device *dev, if( pmp_priv->rateidx <= MPT_RATE_11M ) { sprintf( extra, "Start continuous DA=ffffffffffff len=1500 \n infinite=yes."); - Hal_SetCarrierSuppressionTx(padapter, (u8)bStartTest); + }else sprintf( extra, "Specify carrier suppression but not CCK rate"); } + Hal_SetCarrierSuppressionTx(padapter, (u8)bStartTest); break; case MP_SINGLE_CARRIER_TX: @@ -11041,7 +11935,7 @@ static int rtw_mp_ctx(struct net_device *dev, if (bStartTest != 0){ sprintf( extra, "Start continuous DA=ffffffffffff len=1500 \n infinite=yes."); } - Hal_SetSingleCarrierTx(padapter, (u8)bStartTest); + Hal_SetSingleCarrierTx(padapter, (u8)bStartTest); break; default: @@ -11061,7 +11955,10 @@ static int rtw_mp_ctx(struct net_device *dev, pmp_priv->tx.attrib.ht_en = 1; #endif #ifdef CONFIG_80211AC_VHT - pmp_priv->tx.attrib.raid = RATEID_IDX_VHT_1SS; //10 + if (pHalData->rf_type == RF_1T1R) + pmp_priv->tx.attrib.raid = RATEID_IDX_VHT_1SS; + else + pmp_priv->tx.attrib.raid = RATEID_IDX_VHT_2SS; #endif pmp_priv->tx.stop = 0; pmp_priv->tx.count = 1; @@ -11124,16 +12021,14 @@ static int rtw_mp_arx(struct net_device *dev, struct iw_request_info *info, struct iw_point *wrqu, char *extra) { - u8 bStartRx=0,bStopRx=0,bQueryPhy=0,bQueryMac=0,bSetBssid=0; - u8 bmac_filter = 0,bfilter_init=0; - u32 cckok=0,cckcrc=0,ofdmok=0,ofdmcrc=0,htok=0,htcrc=0,OFDM_FA=0,CCK_FA=0,DropPacket=0,vht_ok=0,vht_err=0; - u32 mac_cck_ok=0, mac_ofdm_ok=0, mac_ht_ok=0, mac_vht_ok=0; - u32 mac_cck_err=0, mac_ofdm_err=0, mac_ht_err=0, mac_vht_err=0; + int bStartRx = 0, bStopRx = 0, bQueryPhy = 0, bQueryMac = 0, bSetBssid = 0; + int bmac_filter = 0, bfilter_init = 0, bmon = 0; u8 input[wrqu->length]; char *pch, *ptmp, *token, *tmp[2]={0x00,0x00}; - u32 i=0,ii=0,jj=0,kk=0,cnts=0; + u32 i = 0, ii = 0, jj = 0, kk = 0, cnts = 0; PADAPTER padapter = rtw_netdev_priv(dev); struct mp_priv *pmppriv = &padapter->mppriv; + struct dbg_rx_counter rx_counter; if (copy_from_user(input, wrqu->pointer, wrqu->length)) return -EFAULT; @@ -11147,7 +12042,7 @@ static int rtw_mp_arx(struct net_device *dev, bSetBssid = (strncmp(input, "setbssid=", 8)==0)?1:0; // strncmp TRUE is 0 //bfilter_init = (strncmp(input, "filter_init",11)==0)?1:0; bmac_filter = (strncmp(input, "accept_mac",10)==0)?1:0; - + bmon = (strncmp(input, "mon=",4)==0)?1:0; if(bSetBssid==1){ pch = input; @@ -11210,67 +12105,40 @@ static int rtw_mp_arx(struct net_device *dev, sprintf( extra, "Received packet OK:%d CRC error:%d ,Filter out:%d",padapter->mppriv.rx_pktcount,padapter->mppriv.rx_crcerrpktcount,padapter->mppriv.rx_pktcount_filter_out); } else if(bQueryPhy) - { - - //if (IS_HARDWARE_TYPE_JAGUAR(padapter)) - #ifdef CONFIG_RTL8188A - { - cckok = PHY_QueryBBReg(padapter, 0xF04, 0x3FFF); // [13:0] - ofdmok = PHY_QueryBBReg(padapter, 0xF14, 0x3FFF); // [13:0] - htok = PHY_QueryBBReg(padapter, 0xF10, 0x3FFF); // [13:0] - vht_ok = PHY_QueryBBReg(padapter, 0xF0C, 0x3FFF); // [13:0] - - cckcrc = PHY_QueryBBReg(padapter, 0xF04, 0x3FFF0000); // [29:16] - ofdmcrc = PHY_QueryBBReg(padapter, 0xF14, 0x3FFF0000); // [29:16] - htcrc = PHY_QueryBBReg(padapter, 0xF10, 0x3FFF0000); // [29:16] - vht_err = PHY_QueryBBReg(padapter, 0xF0C, 0x3FFF0000); // [29:16] - } - #else - { - cckok = PHY_QueryBBReg(padapter, 0xF88, bMaskDWord); - ofdmok = PHY_QueryBBReg(padapter, 0xF94, bMaskLWord); - htok = PHY_QueryBBReg(padapter, 0xF90, bMaskLWord); - vht_ok = 0; - - cckcrc = PHY_QueryBBReg(padapter, 0xF84, bMaskDWord); - ofdmcrc = PHY_QueryBBReg(padapter, 0xF94, bMaskHWord); - htcrc = PHY_QueryBBReg(padapter, 0xF90, bMaskHWord); - vht_err = 0; - } - #endif - CCK_FA=(rtw_read8(padapter, 0xa5b )<<8 ) | (rtw_read8(padapter, 0xa5c)); - sprintf( extra, "Phy Received packet OK:%d CRC error:%d FA Counter: %d",cckok+ofdmok+htok+vht_ok,cckcrc+ofdmcrc+htcrc+vht_err,OFDM_FA+CCK_FA); + { + _rtw_memset(&rx_counter,0,sizeof(struct dbg_rx_counter)); + rtw_dump_phy_rx_counters(padapter,&rx_counter); + + DBG_871X("%s: OFDM_FA =%d\n", __FUNCTION__, rx_counter.rx_ofdm_fa); + DBG_871X("%s: CCK_FA =%d\n", __FUNCTION__, rx_counter.rx_cck_fa); + sprintf( extra, "Phy Received packet OK:%d CRC error:%d FA Counter: %d",rx_counter.rx_pkt_ok,rx_counter.rx_pkt_crc_error,rx_counter.rx_cck_fa+rx_counter.rx_ofdm_fa); + + } else if(bQueryMac) { - // for 8723A + _rtw_memset(&rx_counter,0,sizeof(struct dbg_rx_counter)); + rtw_dump_mac_rx_counters(padapter,&rx_counter); + sprintf( extra, "Mac Received packet OK: %d , CRC error: %d , Drop Packets: %d\n", + rx_counter.rx_pkt_ok,rx_counter.rx_pkt_crc_error,rx_counter.rx_pkt_drop); + + } + + if( bmon==1 ) { + sscanf(input, "mon=%d", &bmon); + + if(bmon==1) { - PHY_SetMacReg(padapter, 0x664, BIT28|BIT29|BIT30|BIT31, 0x3); - mac_cck_ok = PHY_QueryMacReg(padapter, 0x664, bMaskLWord); // [15:0] - PHY_SetMacReg(padapter, 0x664, BIT28|BIT29|BIT30|BIT31, 0x0); - mac_ofdm_ok = PHY_QueryMacReg(padapter, 0x664, bMaskLWord); // [15:0] - PHY_SetMacReg(padapter, 0x664, BIT28|BIT29|BIT30|BIT31, 0x6); - mac_ht_ok = PHY_QueryMacReg(padapter, 0x664, bMaskLWord); // [15:0] - mac_vht_ok = 0; - - PHY_SetMacReg(padapter, 0x664, BIT28|BIT29|BIT30|BIT31, 0x4); - mac_cck_err = PHY_QueryMacReg(padapter, 0x664, bMaskLWord); // [15:0] - PHY_SetMacReg(padapter, 0x664, BIT28|BIT29|BIT30|BIT31, 0x1); - mac_ofdm_err = PHY_QueryMacReg(padapter, 0x664, bMaskLWord); // [15:0] - PHY_SetMacReg(padapter, 0x664, BIT28|BIT29|BIT30|BIT31, 0x7); - mac_ht_err = PHY_QueryMacReg(padapter, 0x664, bMaskLWord); // [15:0] - mac_vht_err = 0; - //Mac_DropPacket - rtw_write32(padapter, 0x664, (rtw_read32(padapter, 0x0664)& 0x0FFFFFFF)| Mac_DropPacket); - DropPacket = rtw_read32(padapter, 0x664)& 0x0000FFFF; - } - - sprintf( extra, "Mac Received packet OK: %d , CRC error: %d , FA Counter: %d , Drop Packets: %d\n", - mac_cck_ok+mac_ofdm_ok+mac_ht_ok+mac_vht_ok,mac_cck_err+mac_ofdm_err+mac_ht_err+mac_vht_err,OFDM_FA+CCK_FA,DropPacket); + pmppriv->rx_bindicatePkt= _TRUE; + sprintf( extra, "Indicating Receive Packet to network start\n"); + }else { + pmppriv->rx_bindicatePkt= _FALSE; + sprintf( extra, "Indicating Receive Packet to network Stop\n"); + } } + wrqu->length = strlen(extra) + 1; - return 0; } @@ -11324,11 +12192,11 @@ static int rtw_mp_pwrtrk(struct net_device *dev, } else if (sscanf(input, "ther=%d", &thermal)) { pHalData->TxPowerTrackControl = _TRUE; - ret = Hal_SetThermalMeter(padapter, (u8)thermal); - if (ret == _FAIL) return -EPERM; + ret = Hal_SetThermalMeter(padapter, (u8)thermal); + if (ret == _FAIL) return -EPERM; sprintf(extra, "mp tx power tracking start,target value=%d ok ",thermal); - }else { - return -EINVAL; + }else{ + return -EINVAL; } } @@ -11362,7 +12230,7 @@ static int rtw_mp_thermal(struct net_device *dev, struct iw_point *wrqu, char *extra) { u8 val; - u16 bwrite=1; + int bwrite=1; #ifdef CONFIG_RTL8192C u16 addr=EEPROM_THERMAL_METER_92C; @@ -11442,21 +12310,9 @@ static int rtw_mp_reset_stats(struct net_device *dev, pmp_priv->rx_pktcount_filter_out=0; pmp_priv->rx_crcerrpktcount = 0; - //reset phy counter - if (IS_HARDWARE_TYPE_JAGUAR(padapter)) - { - write_bbreg(padapter, 0xB58, BIT0, 0x1); - write_bbreg(padapter, 0xB58, BIT0, 0x0); - } - else - { - write_bbreg(padapter, 0xF14, BIT16, 0x1); - rtw_msleep_os(10); - write_bbreg(padapter, 0xF14, BIT16, 0x0); - } - //reset mac counter - PHY_SetMacReg(padapter, 0x664, BIT27, 0x1); - PHY_SetMacReg(padapter, 0x664, BIT27, 0x0); + rtw_reset_phy_rx_counters(padapter); + rtw_reset_mac_rx_counters(padapter); + return 0; } @@ -11519,7 +12375,7 @@ static int rtw_mp_SetRFPath(struct net_device *dev, { PADAPTER padapter = rtw_netdev_priv(dev); char input[wrqu->data.length]; - u8 bMain=1,bTurnoff=1; + int bMain = 1, bTurnoff = 1; if (copy_from_user(input, wrqu->data.pointer, wrqu->data.length)) return -EFAULT; @@ -11548,7 +12404,7 @@ static int rtw_mp_QueryDrv(struct net_device *dev, { PADAPTER padapter = rtw_netdev_priv(dev); char input[wrqu->data.length]; - u8 qAutoLoad=1; + int qAutoLoad = 1; EEPROM_EFUSE_PRIV *pEEPROM = GET_EEPROM_EFUSE_PRIV(padapter); @@ -11589,7 +12445,7 @@ static int rtw_mp_PwrCtlDM(struct net_device *dev, { PADAPTER padapter = rtw_netdev_priv(dev); u8 input[wrqu->length]; - u8 bstart=1; + int bstart=1; if (copy_from_user(input, wrqu->pointer, wrqu->length)) return -EFAULT; @@ -11607,6 +12463,157 @@ static int rtw_mp_PwrCtlDM(struct net_device *dev, return 0; } +static int rtw_mp_getver(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) +{ + PADAPTER padapter = rtw_netdev_priv(dev); + struct mp_priv *pmp_priv; + + pmp_priv = &padapter->mppriv; + + if (copy_from_user(extra, wrqu->data.pointer, wrqu->data.length)) + return -EFAULT; + + sprintf(extra, "rtwpriv=%d\n",RTWPRIV_VER_INFO); + wrqu->data.length = strlen(extra); + return 0; +} + +static int rtw_mp_mon(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) +{ + PADAPTER padapter = rtw_netdev_priv(dev); + struct mp_priv *pmp_priv = &padapter->mppriv; + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + struct hal_ops *pHalFunc = &padapter->HalFunc; + NDIS_802_11_NETWORK_INFRASTRUCTURE networkType ; + int bstart = 1, bstop = 1; + networkType=Ndis802_11Infrastructure; + if (copy_from_user(extra, wrqu->data.pointer, wrqu->data.length)) + return -EFAULT; + + rtw_pm_set_ips(padapter,IPS_NONE); + LeaveAllPowerSaveMode(padapter); + +#ifdef CONFIG_MP_INCLUDED + if (init_mp_priv(padapter) == _FAIL) { + DBG_871X("%s: initialize MP private data Fail!\n", __func__); + } + padapter->mppriv.channel = 6; + + bstart = strncmp(extra, "start", 5); // strncmp TRUE is 0 + bstop = strncmp(extra, "stop", 4); // strncmp TRUE is 0 + if(bstart==0) + { + mp_join(padapter,WIFI_FW_ADHOC_STATE); + SetPacketRx(padapter, _TRUE); + Hal_SetChannel(padapter); + pmp_priv->rx_bindicatePkt= _TRUE; + pmp_priv->bRTWSmbCfg = _TRUE; + sprintf(extra, "monitor mode start\n"); + } + else if (bstop==0) + { + SetPacketRx(padapter, _FALSE); + pmp_priv->rx_bindicatePkt= _FALSE; + pmp_priv->bRTWSmbCfg = _FALSE; + padapter->registrypriv.mp_mode=1; + pHalFunc->hal_deinit(padapter); + padapter->registrypriv.mp_mode=0; + pHalFunc->hal_init(padapter); + //rtw_disassoc_cmd(padapter, 0, _TRUE); + if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) { + rtw_disassoc_cmd(padapter, 500, _TRUE); + rtw_indicate_disconnect(padapter); + //rtw_free_assoc_resources(padapter, 1); + } + rtw_pm_set_ips(padapter,IPS_NORMAL); + sprintf(extra, "monitor mode Stop\n"); + } +#endif + wrqu->data.length = strlen(extra); + return 0; +} + +static int rtw_efuse_mask_file(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) +{ + char *rtw_efuse_mask_file_path; + u8 Status; + PADAPTER padapter = rtw_netdev_priv(dev); + _rtw_memset(maskfileBuffer,0x00,sizeof(maskfileBuffer)); + + if (copy_from_user(extra, wrqu->data.pointer, wrqu->data.length)) + return -EFAULT; + + if(strncmp(extra, "off",3) ==0 && strlen(extra)<4) + { + padapter->registrypriv.boffefusemask=1; + sprintf(extra, "Turn off Efuse Mask\n"); + wrqu->data.length = strlen(extra); + return 0; + } + if(strncmp(extra, "on",2) ==0 && strlen(extra)<3) + { + padapter->registrypriv.boffefusemask=0; + sprintf(extra, "Turn on Efuse Mask\n"); + wrqu->data.length = strlen(extra); + return 0; + } + rtw_efuse_mask_file_path=extra; + + if (rtw_is_file_readable(rtw_efuse_mask_file_path) == _TRUE) + { + DBG_871X("%s do rtw_efuse_mask_file_read = %s! ,sizeof maskfileBuffer %zu\n",__FUNCTION__,rtw_efuse_mask_file_path,sizeof(maskfileBuffer)); + Status=rtw_efuse_file_read(padapter,rtw_efuse_mask_file_path,maskfileBuffer,sizeof(maskfileBuffer)); + if(Status==_TRUE) + padapter->registrypriv.bFileMaskEfuse = _TRUE; + sprintf(extra, "efuse mask file read OK\n"); + } else { + padapter->registrypriv.bFileMaskEfuse = _FALSE; + sprintf(extra, "efuse mask file readable FAIL\n"); + DBG_871X("%s rtw_is_file_readable fail !\n",__FUNCTION__); + } + wrqu->data.length = strlen(extra); + return 0; +} + + +static int rtw_efuse_file_map(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) +{ + char *rtw_efuse_file_map_path; + u8 Status; + PEFUSE_HAL pEfuseHal; + PADAPTER padapter = rtw_netdev_priv(dev); + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); + pEfuseHal = &pHalData->EfuseHal; + if (copy_from_user(extra, wrqu->data.pointer, wrqu->data.length)) + return -EFAULT; + + rtw_efuse_file_map_path=extra; + + if (rtw_is_file_readable(rtw_efuse_file_map_path) == _TRUE) + { + DBG_871X("%s do rtw_efuse_mask_file_read = %s! \n",__FUNCTION__,rtw_efuse_file_map_path); + Status=rtw_efuse_file_read(padapter,rtw_efuse_file_map_path,pEfuseHal->fakeEfuseModifiedMap,sizeof(pEfuseHal->fakeEfuseModifiedMap)); + if(Status==_TRUE) + sprintf(extra, "efuse file file_read OK\n"); + else + sprintf(extra, "efuse file file_read FAIL\n"); + } else { + sprintf(extra, "efuse file readable FAIL\n"); + DBG_871X("%s rtw_is_file_readable fail !\n",__FUNCTION__); + } + wrqu->data.length = strlen(extra); + return 0; +} + + #if (defined(CONFIG_RTL8723A) || defined(CONFIG_RTL8723B)) /* update Tx AGC offset */ static int rtw_mp_SetBT(struct net_device *dev, @@ -11627,8 +12634,8 @@ static int rtw_mp_SetBT(struct net_device *dev, u8 tempval,BTStatus; u8 H2cSetbtmac[6]; u8 u1H2CBtMpOperParm[4]={0x01}; - u16 testmode=1,ready=1,trxparam=1,setgen=1,getgen=1,testctrl=1,testbt=1,readtherm=1,setbtmac=1; - u32 i=0,ii=0,jj=0,kk=0,cnts=0,status=0; + int testmode = 1, ready = 1, trxparam = 1, setgen = 1, getgen = 1, testctrl = 1, testbt = 1, readtherm = 1, setbtmac = 1; + u32 i = 0, ii = 0, jj = 0, kk = 0, cnts = 0, status = 0; PRT_MP_FIRMWARE pBTFirmware = NULL; if (copy_from_user(extra, wrqu->data.pointer, wrqu->data.length)) @@ -11697,29 +12704,20 @@ static int rtw_mp_SetBT(struct net_device *dev, rtw_msleep_os(100); DBG_8192C("FirmwareDownloadBT ready = 0x%x 0x%x", pMptCtx->mptOutBuf[4],pMptCtx->mptOutBuf[5]); - if( (pMptCtx->mptOutBuf[4]==0x00) && (pMptCtx->mptOutBuf[5]==0x00)) - { - if(padapter->mppriv.bTxBufCkFail==_TRUE) - sprintf(extra, "check TxBuf Fail.\n"); - else - sprintf(extra, "download FW Fail.\n"); - } + if ((pMptCtx->mptOutBuf[4] == 0x00) && (pMptCtx->mptOutBuf[5] == 0x00)) { + + if (padapter->mppriv.bTxBufCkFail == _TRUE) + sprintf(extra, "check TxBuf Fail.\n"); else - { - sprintf(extra, "download FW OK.\n"); - goto exit; - } - goto exit; + sprintf(extra, "download FW Fail.\n"); + } else { + sprintf(extra, "download FW OK.\n"); + goto exit; + } goto exit; } if ( strncmp(extra, "dlfw", 4) == 0) { - #ifdef CONFIG_BT_COEXIST - rtw_btcoex_HaltNotify(padapter); - //DBG_871X("SetBT bt1ant !\n"); - //hal_btcoex1ant_SetAntPath(padapter); - rtw_btcoex_SetManualControl(padapter, _TRUE); - #endif pHalData->LastHMEBoxNum=0; padapter->bBTFWReady = _FALSE; rtw_write8(padapter, 0xa3, 0x05); @@ -11767,6 +12765,12 @@ static int rtw_mp_SetBT(struct net_device *dev, #endif DBG_871X("Wait for FirmwareDownloadBT fw boot!\n"); rtw_msleep_os(1000); +#ifdef CONFIG_BT_COEXIST + rtw_btcoex_HaltNotify(padapter); + DBG_871X("SetBT btcoex HaltNotify !\n"); + //hal_btcoex1ant_SetAntPath(padapter); + rtw_btcoex_SetManualControl(padapter, _TRUE); +#endif _rtw_memset(extra,'\0', wrqu->data.length); BtReq.opCodeVer = 1; BtReq.OpCode = 0; @@ -11785,7 +12789,7 @@ static int rtw_mp_SetBT(struct net_device *dev, else { #ifdef CONFIG_BT_COEXIST - rtw_btcoex_SwitchGntBt(padapter); + rtw_btcoex_SwitchBtTRxMask(padapter); #endif rtw_msleep_os(200); sprintf(extra, "download FW OK.\n"); @@ -11796,9 +12800,15 @@ static int rtw_mp_SetBT(struct net_device *dev, if ( strncmp(extra, "down", 4) == 0){ DBG_871X("SetBT down for to hal_init !\n"); - mp_stop_test(padapter); +#ifdef CONFIG_BT_COEXIST + rtw_btcoex_SetManualControl(padapter, _FALSE); + rtw_btcoex_Initialize(padapter); +#endif + pHalFunc->read_adapter_info(padapter); + pHalFunc->hal_deinit(padapter); pHalFunc->hal_init(padapter); - mp_start_test(padapter); + rtw_pm_set_ips(padapter,IPS_NONE); + LeaveAllPowerSaveMode(padapter); MPT_PwrCtlDM(padapter,0); rtw_write32(padapter, 0xcc, (rtw_read32(padapter, 0xcc)| 0x00000004)); rtw_write32(padapter, 0x6b, (rtw_read32(padapter, 0x6b)& 0xFFFFFFEF)); @@ -11824,13 +12834,13 @@ static int rtw_mp_SetBT(struct net_device *dev, if ( strncmp(extra, "h2c", 3) == 0){ DBG_871X("SetBT h2c !\n"); padapter->bBTFWReady = _TRUE; - FillH2CCmd(padapter, 0x63, 1, u1H2CBtMpOperParm); + rtw_hal_fill_h2c_cmd(padapter, 0x63, 1, u1H2CBtMpOperParm); goto exit; } if ( strncmp(extra, "2ant", 4) == 0){ DBG_871X("Set BT 2ant use!\n"); PHY_SetMacReg(padapter,0x67,BIT5,0x1); - rtw_write16(padapter, 0x948, 0000); + rtw_write32(padapter, 0x948, 0000); goto exit; } @@ -12044,6 +13054,12 @@ static int rtw_mp_set(struct net_device *dev, DBG_871X("set case MP_DISABLE_BT_COEXIST \n"); rtw_mp_disable_bt_coexist(dev, info, wdata, extra); break; +#ifdef CONFIG_WOWLAN + case MP_WOW_ENABLE: + DBG_871X("set case MP_WOW_ENABLE: %s \n", extra); + rtw_wowlan_ctrl(dev, info, wdata, extra); + break; +#endif #ifdef CONFIG_AP_WOWLAN case MP_AP_WOW_ENABLE: DBG_871X("set case MP_AP_WOW_ENABLE: %s \n", extra); @@ -12147,7 +13163,7 @@ static int rtw_mp_get(struct net_device *dev, DBG_871X("set case MP_CTX \n"); rtw_mp_ctx (dev,info,wrqu,extra); break; - + case MP_ARX: DBG_871X("set case MP_ARX \n"); rtw_mp_arx (dev,info,wrqu,extra); @@ -12189,8 +13205,23 @@ static int rtw_mp_get(struct net_device *dev, case MP_GET_TXPOWER_INX: DBG_871X("mp_get MP_GET_TXPOWER_INX \n"); rtw_mp_txpower_index(dev,info,wrqu,extra); - break; - + break; + case MP_GETVER: + DBG_871X("mp_get MP_GETVER \n"); + rtw_mp_getver(dev,info,wdata,extra); + break; + case MP_MON: + DBG_871X("mp_get MP_MON \n"); + rtw_mp_mon(dev,info,wdata,extra); + break; + case EFUSE_MASK: + DBG_871X("mp_get MP_MON \n"); + rtw_efuse_mask_file(dev,info,wdata,extra); + break; + case EFUSE_FILE: + DBG_871X("mp_get MP_MON \n"); + rtw_efuse_file_map(dev,info,wdata,extra); + break; #if defined(CONFIG_RTL8723A) || defined(CONFIG_RTL8723B) case MP_SetBT: DBG_871X("set MP_SetBT \n"); @@ -12217,19 +13248,15 @@ static int rtw_wfd_tdls_enable(struct net_device *dev, _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); - printk( "[%s] %s %d\n", __FUNCTION__, extra, wrqu->data.length -1 ); + DBG_871X( "[%s] %s %d\n", __FUNCTION__, extra, wrqu->data.length -1 ); if ( extra[ 0 ] == '0' ) - { padapter->wdinfo.wfd_tdls_enable = 0; - } else - { padapter->wdinfo.wfd_tdls_enable = 1; - } -#endif //CONFIG_WFD -#endif //CONFIG_TDLS +#endif /* CONFIG_WFD */ +#endif /* CONFIG_TDLS */ return ret; } @@ -12248,14 +13275,11 @@ static int rtw_tdls_weaksec(struct net_device *dev, DBG_871X( "[%s] %s %d\n", __FUNCTION__, extra, wrqu->data.length -1 ); if ( extra[ 0 ] == '0' ) - { padapter->wdinfo.wfd_tdls_weaksec = 0; - } else - { padapter->wdinfo.wfd_tdls_weaksec = 1; - } -#endif + +#endif /* CONFIG_TDLS */ return ret; } @@ -12280,56 +13304,48 @@ static int rtw_tdls_enable(struct net_device *dev, u8 empty_hwaddr[ETH_ALEN] = { 0x00 }; struct tdls_txmgmt txmgmt; - printk( "[%s] %s %d\n", __FUNCTION__, extra, wrqu->data.length -1 ); + DBG_871X( "[%s] %s %d\n", __FUNCTION__, extra, wrqu->data.length -1 ); _rtw_memset(tdls_sta, 0x00, sizeof(tdls_sta)); _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); - if ( extra[ 0 ] == '0' ) - { + if (extra[ 0 ] == '0') { ptdlsinfo->tdls_enable = 0; if(pstapriv->asoc_sta_count==1) return ret; _enter_critical_bh(&pstapriv->sta_hash_lock, &irqL); - for(index=0; index< NUM_STA; index++) - { + for (index=0; index< NUM_STA; index++) { phead = &(pstapriv->sta_hash[index]); plist = get_next(phead); - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) - { + while (rtw_end_of_queue_search(phead, plist) == _FALSE) { psta = LIST_CONTAINOR(plist, struct sta_info ,hash_list); plist = get_next(plist); - if(psta->tdls_sta_state != TDLS_STATE_NONE) - { + if (psta->tdls_sta_state != TDLS_STATE_NONE) { _rtw_memcpy(tdls_sta[index], psta->hwaddr, ETH_ALEN); } } } _exit_critical_bh(&pstapriv->sta_hash_lock, &irqL); - for(index=0; index< NUM_STA; index++) - { - if( !_rtw_memcmp(tdls_sta[index], empty_hwaddr, ETH_ALEN) ) - { - printk("issue tear down to "MAC_FMT"\n", MAC_ARG(tdls_sta[index])); + for (index=0; index< NUM_STA; index++) { + if (!_rtw_memcmp(tdls_sta[index], empty_hwaddr, ETH_ALEN)) { + DBG_871X("issue tear down to "MAC_FMT"\n", MAC_ARG(tdls_sta[index])); txmgmt.status_code = _RSON_TDLS_TEAR_UN_RSN_; _rtw_memcpy(txmgmt.peer, tdls_sta[index], ETH_ALEN); issue_tdls_teardown(padapter, &txmgmt, _FALSE); } } - rtw_tdls_cmd(padapter, myid(&(padapter->eeprompriv)), TDLS_RS_RCR); + rtw_tdls_cmd(padapter, NULL, TDLS_RS_RCR); rtw_reset_tdls_info(padapter); - } - else if ( extra[ 0 ] == '1' ) - { + } else if (extra[0] == '1') { ptdlsinfo->tdls_enable = 1; } -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ return ret; } @@ -12345,13 +13361,12 @@ static int rtw_tdls_setup(struct net_device *dev, struct tdls_txmgmt txmgmt; #ifdef CONFIG_WFD struct wifidirect_info *pwdinfo= &(padapter->wdinfo); -#endif // CONFIG_WFD +#endif /* CONFIG_WFD */ - printk( "[%s] %s %d\n", __FUNCTION__, extra, wrqu->data.length -1 ); + DBG_871X("[%s] %s %d\n", __FUNCTION__, extra, wrqu->data.length -1); - if(wrqu->data.length - 1 != 17 ) - { - printk( "[%s] length:%d != 17\n", __FUNCTION__, (wrqu->data.length -1) ); + if (wrqu->data.length - 1 != 17) { + DBG_871X("[%s] length:%d != 17\n", __FUNCTION__, (wrqu->data.length -1)); return ret; } @@ -12361,128 +13376,262 @@ static int rtw_tdls_setup(struct net_device *dev, } #ifdef CONFIG_WFD - if ( _AES_ != padapter->securitypriv.dot11PrivacyAlgrthm ) - { - // Weak Security situation with AP. - if ( 0 == pwdinfo->wfd_tdls_weaksec ) - { - // Can't send the tdls setup request out!! - DBG_871X( "[%s] Current link is not AES, SKIP sending the tdls setup request!!\n", __FUNCTION__ ); - } - else - { + if (_AES_ != padapter->securitypriv.dot11PrivacyAlgrthm) { + /* Weak Security situation with AP. */ + if (0 == pwdinfo->wfd_tdls_weaksec) { + /* Can't send the tdls setup request out!! */ + DBG_871X("[%s] Current link is not AES, " + "SKIP sending the tdls setup request!!\n", __FUNCTION__); + } else { issue_tdls_setup_req(padapter, &txmgmt, _TRUE); } - } - else -#endif // CONFIG_WFD + } else +#endif /* CONFIG_WFD */ { issue_tdls_setup_req(padapter, &txmgmt, _TRUE); } -#endif +#endif /* CONFIG_TDLS */ + + return ret; +} + +static int rtw_tdls_teardown(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) +{ + int ret = 0; + +#ifdef CONFIG_TDLS + + u8 i,j; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + struct sta_info *ptdls_sta = NULL; + struct tdls_txmgmt txmgmt; + + DBG_871X( "[%s] %s %d\n", __FUNCTION__, extra, wrqu->data.length -1 ); + + if (wrqu->data.length - 1 != 17 && wrqu->data.length - 1 != 19) { + DBG_871X("[%s] length:%d != 17 or 19\n", + __FUNCTION__, (wrqu->data.length -1)); + return ret; + } + + _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); + for (i=0, j=0; i < ETH_ALEN; i++, j+=3) + txmgmt.peer[i]=key_2char2num(*(extra+j), *(extra+j+1)); + + ptdls_sta = rtw_get_stainfo( &(padapter->stapriv), txmgmt.peer); + + if (ptdls_sta != NULL) { + txmgmt.status_code = _RSON_TDLS_TEAR_UN_RSN_; + if(wrqu->data.length - 1 == 17) + issue_tdls_teardown(padapter, &txmgmt, _FALSE); + else if(wrqu->data.length - 1 == 19) + issue_tdls_teardown(padapter, &txmgmt, _TRUE); + } else { + DBG_871X( "TDLS peer not found\n"); + } +#endif /* CONFIG_TDLS */ + + return ret; +} + +static int rtw_tdls_discovery(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) +{ + int ret = 0; + +#ifdef CONFIG_TDLS + + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + struct tdls_txmgmt txmgmt; + int i = 0, j=0; + + DBG_871X( "[%s] %s %d\n", __FUNCTION__, extra, wrqu->data.length -1 ); + + _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); + for( i=0, j=0 ; i < ETH_ALEN; i++, j+=3 ){ + txmgmt.peer[i]=key_2char2num(*(extra+j), *(extra+j+1)); + } + + issue_tdls_dis_req(padapter, &txmgmt); + +#endif /* CONFIG_TDLS */ + + return ret; +} + +static int rtw_tdls_ch_switch(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) +{ + int ret = 0; + +#ifdef CONFIG_TDLS +#ifdef CONFIG_TDLS_CH_SW + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + struct tdls_ch_switch *pchsw_info = &padapter->tdlsinfo.chsw_info; + u8 i, j; + struct sta_info *ptdls_sta = NULL; + + DBG_8192C( "[%s] %s %d\n", __FUNCTION__, extra, wrqu->data.length -1 ); + + if (padapter->tdlsinfo.ch_switch_prohibited == _TRUE) + { + DBG_871X("Can't do TDLS channel switch since ch_switch_prohibited = _TRUE\n"); + return ret; + } + + for( i=0, j=0 ; i < ETH_ALEN; i++, j+=3 ){ + pchsw_info->addr[i] = key_2char2num(*(extra+j), *(extra+j+1)); + } + + ptdls_sta = rtw_get_stainfo(&padapter->stapriv, pchsw_info->addr); + if( ptdls_sta == NULL ) + return ret; + + pchsw_info->ch_sw_state |= TDLS_CH_SW_INITIATOR_STATE; + + if (ptdls_sta != NULL) { + if (pchsw_info->off_ch_num == 0) + pchsw_info->off_ch_num = 11; + }else { + DBG_871X( "TDLS peer not found\n"); + } + + //issue_tdls_ch_switch_req(padapter, ptdls_sta); + /* DBG_871X("issue tdls ch switch req\n"); */ + +#endif /* CONFIG_TDLS_CH_SW */ +#endif /* CONFIG_TDLS */ + return ret; } -static int rtw_tdls_teardown(struct net_device *dev, +static int rtw_tdls_ch_switch_off(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { int ret = 0; #ifdef CONFIG_TDLS - - u8 i,j; +#ifdef CONFIG_TDLS_CH_SW + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + struct tdls_ch_switch *pchsw_info = &padapter->tdlsinfo.chsw_info; + u8 i, j, mac_addr[ETH_ALEN]; struct sta_info *ptdls_sta = NULL; struct tdls_txmgmt txmgmt; + _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); + DBG_871X( "[%s] %s %d\n", __FUNCTION__, extra, wrqu->data.length -1 ); - if(wrqu->data.length - 1 != 17 && wrqu->data.length - 1 != 19) + if (padapter->tdlsinfo.ch_switch_prohibited == _TRUE) { - printk( "[%s] length:%d != 17 or 19\n", __FUNCTION__, (wrqu->data.length -1) ); + DBG_871X("Can't do TDLS channel switch since ch_switch_prohibited = _TRUE\n"); return ret; } - _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); - for( i=0, j=0 ; i < ETH_ALEN; i++, j+=3 ){ - txmgmt.peer[i]=key_2char2num(*(extra+j), *(extra+j+1)); + if (wrqu->data.length >= 17) { + for (i=0, j=0 ; i < ETH_ALEN; i++, j+=3) + mac_addr[i]=key_2char2num(*(extra+j), *(extra+j+1)); + ptdls_sta = rtw_get_stainfo(&padapter->stapriv, mac_addr); } - ptdls_sta = rtw_get_stainfo( &(padapter->stapriv), txmgmt.peer); - - if(ptdls_sta != NULL) - { - txmgmt.status_code = _RSON_TDLS_TEAR_UN_RSN_; - if(wrqu->data.length - 1 == 17) - issue_tdls_teardown(padapter, &txmgmt, _FALSE); - else if(wrqu->data.length - 1 == 19) - issue_tdls_teardown(padapter, &txmgmt, _TRUE); + if (padapter->mlmeextpriv.cur_channel != rtw_get_oper_ch(padapter)) { + SelectChannel(padapter, padapter->mlmeextpriv.cur_channel); } - else - DBG_871X( "TDLS peer not found\n"); -#endif //CONFIG_TDLS - + + pchsw_info->ch_sw_state &= ~(TDLS_CH_SW_INITIATOR_STATE | + TDLS_CH_SWITCH_ON_STATE | + TDLS_PEER_AT_OFF_STATE); + ATOMIC_SET(&pchsw_info->chsw_on, _FALSE); + _rtw_memset(pchsw_info->addr, 0x00, ETH_ALEN); + + if (ptdls_sta != NULL) { + ptdls_sta->ch_switch_time = 0; + ptdls_sta->ch_switch_timeout = 0; + _cancel_timer_ex(&ptdls_sta->ch_sw_timer); + _cancel_timer_ex(&ptdls_sta->delay_timer); + } + +#endif /* CONFIG_TDLS_CH_SW */ +#endif /* CONFIG_TDLS */ + return ret; } -static int rtw_tdls_discovery(struct net_device *dev, +static int rtw_tdls_dump_ch(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { int ret = 0; #ifdef CONFIG_TDLS - +#ifdef CONFIG_TDLS_CH_SW _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); - struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - struct tdls_txmgmt txmgmt; - int i = 0, j=0; + struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; - DBG_871X( "[%s] %s %d\n", __FUNCTION__, extra, wrqu->data.length -1 ); + DBG_8192C("[%s] dump_stack:%s\n", __FUNCTION__, extra); - _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); - for( i=0, j=0 ; i < ETH_ALEN; i++, j+=3 ){ - txmgmt.peer[i]=key_2char2num(*(extra+j), *(extra+j+1)); - } + extra[ wrqu->data.length ] = 0x00; + ptdlsinfo->chsw_info.dump_stack = rtw_atoi( extra ); - issue_tdls_dis_req(padapter, &txmgmt); + return ret; -#endif //CONFIG_TDLS +#endif +#endif /* CONFIG_TDLS */ return ret; } -static int rtw_tdls_ch_switch(struct net_device *dev, +static int rtw_tdls_off_ch_num(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { int ret = 0; #ifdef CONFIG_TDLS - +#ifdef CONFIG_TDLS_CH_SW _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); - struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; - u8 i, j, mac_addr[ETH_ALEN]; - struct sta_info *ptdls_sta = NULL; + struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; - DBG_8192C( "[%s] %s %d\n", __FUNCTION__, extra, wrqu->data.length -1 ); + DBG_8192C("[%s] off_ch_num:%s\n", __FUNCTION__, extra); - for( i=0, j=0 ; i < ETH_ALEN; i++, j+=3 ){ - mac_addr[i]=key_2char2num(*(extra+j), *(extra+j+1)); - } + extra[ wrqu->data.length ] = 0x00; + ptdlsinfo->chsw_info.off_ch_num = rtw_atoi(extra); - ptdls_sta = rtw_get_stainfo(&padapter->stapriv, mac_addr); - if( ptdls_sta == NULL ) - return ret; + return ret; + +#endif +#endif /* CONFIG_TDLS */ + + return ret; +} + +static int rtw_tdls_ch_offset(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) +{ + int ret = 0; + +#ifdef CONFIG_TDLS +#ifdef CONFIG_TDLS_CH_SW + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; -// ptdlsinfo->ch_sensing=1; + DBG_8192C("[%s] ch_offset:%s\n", __FUNCTION__, extra); + + extra[ wrqu->data.length ] = 0x00; + ptdlsinfo->chsw_info.ch_offset = rtw_atoi( extra ); -// rtw_tdls_cmd(padapter, ptdls_sta->hwaddr, TDLS_INIT_CH_SEN); + return ret; -#endif //CONFIG_TDLS +#endif +#endif /* CONFIG_TDLS */ return ret; } @@ -12496,22 +13645,19 @@ static int rtw_tdls_pson(struct net_device *dev, #ifdef CONFIG_TDLS _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); - struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); u8 i, j, mac_addr[ETH_ALEN]; struct sta_info *ptdls_sta = NULL; DBG_871X( "[%s] %s %d\n", __FUNCTION__, extra, wrqu->data.length -1 ); - for( i=0, j=0 ; i < ETH_ALEN; i++, j+=3 ){ + for (i=0, j=0; i < ETH_ALEN; i++, j+=3) mac_addr[i]=key_2char2num(*(extra+j), *(extra+j+1)); - } ptdls_sta = rtw_get_stainfo(&padapter->stapriv, mac_addr); issue_nulldata_to_TDLS_peer_STA(padapter, ptdls_sta->hwaddr, 1, 3, 500); -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ return ret; } @@ -12525,25 +13671,20 @@ static int rtw_tdls_psoff(struct net_device *dev, #ifdef CONFIG_TDLS _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); - struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); u8 i, j, mac_addr[ETH_ALEN]; struct sta_info *ptdls_sta = NULL; DBG_8192C( "[%s] %s %d\n", __FUNCTION__, extra, wrqu->data.length -1 ); - for( i=0, j=0 ; i < ETH_ALEN; i++, j+=3 ){ + for (i=0, j=0; i < ETH_ALEN; i++, j+=3) mac_addr[i]=key_2char2num(*(extra+j), *(extra+j+1)); - } ptdls_sta = rtw_get_stainfo(&padapter->stapriv, mac_addr); if(ptdls_sta) - { - //issue_tdls_peer_traffic_rsp(padapter, ptdls_sta); issue_nulldata_to_TDLS_peer_STA(padapter, ptdls_sta->hwaddr, 0, 3, 500); - } -#endif //CONFIG_TDLS + +#endif /* CONFIG_TDLS */ return ret; } @@ -12560,17 +13701,13 @@ static int rtw_tdls_setip(struct net_device *dev, _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; struct wifi_display_info *pwfd_info = ptdlsinfo->wfd_info; - u8 i=0, j=0, k=0, tag=0, ip[3] = { 0xff }, *ptr = extra; - - printk( "[%s] %s %d\n", __FUNCTION__, extra, wrqu->data.length - 1 ); + u8 i=0, j=0, k=0, tag=0; + DBG_871X("[%s] %s %d\n", __FUNCTION__, extra, wrqu->data.length - 1); - while( i < 4 ) - { - for( j=0; j < 4; j++) - { - if( *( extra + j + tag ) == '.' || *( extra + j + tag ) == '\0' ) - { + while (i < 4) { + for (j=0; j < 4; j++) { + if (*( extra + j + tag ) == '.' || *( extra + j + tag ) == '\0') { if( j == 1 ) pwfd_info->ip_address[i]=convert_ip_addr( '0', '0', *(extra+(j-1)+tag)); if( j == 2 ) @@ -12585,13 +13722,14 @@ static int rtw_tdls_setip(struct net_device *dev, i++; } - printk( "[%s] Set IP = %u.%u.%u.%u \n", __FUNCTION__, - ptdlsinfo->wfd_info->ip_address[0], ptdlsinfo->wfd_info->ip_address[1], - ptdlsinfo->wfd_info->ip_address[2], ptdlsinfo->wfd_info->ip_address[3] - ); + DBG_871X( "[%s] Set IP = %u.%u.%u.%u \n", __FUNCTION__, + ptdlsinfo->wfd_info->ip_address[0], + ptdlsinfo->wfd_info->ip_address[1], + ptdlsinfo->wfd_info->ip_address[2], + ptdlsinfo->wfd_info->ip_address[3]); -#endif //CONFIG_WFD -#endif //CONFIG_TDLS +#endif /* CONFIG_WFD */ +#endif /* CONFIG_TDLS */ return ret; } @@ -12609,22 +13747,20 @@ static int rtw_tdls_getip(struct net_device *dev, struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; struct wifi_display_info *pwfd_info = ptdlsinfo->wfd_info; - printk( "[%s]\n", __FUNCTION__); + DBG_871X( "[%s]\n", __FUNCTION__); sprintf( extra, "\n\n%u.%u.%u.%u\n", pwfd_info->peer_ip_address[0], pwfd_info->peer_ip_address[1], - pwfd_info->peer_ip_address[2], pwfd_info->peer_ip_address[3] - ); + pwfd_info->peer_ip_address[2], pwfd_info->peer_ip_address[3]); - printk( "[%s] IP=%u.%u.%u.%u\n", __FUNCTION__, + DBG_871X( "[%s] IP=%u.%u.%u.%u\n", __FUNCTION__, pwfd_info->peer_ip_address[0], pwfd_info->peer_ip_address[1], - pwfd_info->peer_ip_address[2], pwfd_info->peer_ip_address[3] - ); + pwfd_info->peer_ip_address[2], pwfd_info->peer_ip_address[3]); wrqu->data.length = strlen( extra ); -#endif //CONFIG_WFD -#endif //CONFIG_TDLS +#endif /* CONFIG_WFD */ +#endif /* CONFIG_TDLS */ return ret; } @@ -12643,21 +13779,22 @@ static int rtw_tdls_getport(struct net_device *dev, struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; struct wifi_display_info *pwfd_info = ptdlsinfo->wfd_info; - printk( "[%s]\n", __FUNCTION__); + DBG_871X( "[%s]\n", __FUNCTION__); sprintf( extra, "\n\n%d\n", pwfd_info->peer_rtsp_ctrlport ); - printk( "[%s] remote port = %d\n", __FUNCTION__, pwfd_info->peer_rtsp_ctrlport ); + DBG_871X( "[%s] remote port = %d\n", + __FUNCTION__, pwfd_info->peer_rtsp_ctrlport ); wrqu->data.length = strlen( extra ); -#endif //CONFIG_WFD -#endif //CONFIG_TDLS +#endif /* CONFIG_WFD */ +#endif /* CONFIG_TDLS */ return ret; } -//WFDTDLS, for sigma test +/* WFDTDLS, for sigma test */ static int rtw_tdls_dis_result(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) @@ -12670,26 +13807,24 @@ static int rtw_tdls_dis_result(struct net_device *dev, _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; - struct wifi_display_info *pwfd_info = ptdlsinfo->wfd_info; - printk( "[%s]\n", __FUNCTION__); + DBG_871X( "[%s]\n", __FUNCTION__); - if(ptdlsinfo->dev_discovered == 1 ) - { + if (ptdlsinfo->dev_discovered == _TRUE) { sprintf( extra, "\n\nDis=1\n" ); - ptdlsinfo->dev_discovered = 0; + ptdlsinfo->dev_discovered = _FALSE; } wrqu->data.length = strlen( extra ); -#endif //CONFIG_WFD -#endif //CONFIG_TDLS +#endif /* CONFIG_WFD */ +#endif /* CONFIG_TDLS */ return ret; } -//WFDTDLS, for sigma test +/* WFDTDLS, for sigma test */ static int rtw_wfd_tdls_status(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) @@ -12702,20 +13837,39 @@ static int rtw_wfd_tdls_status(struct net_device *dev, _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; - printk( "[%s]\n", __FUNCTION__); + DBG_871X("[%s]\n", __FUNCTION__); - sprintf( extra, "\nlink_established:0x%08x \n" + sprintf( extra, "\nlink_established:%d \n" "sta_cnt:%d \n" "sta_maximum:%d \n" "cur_channel:%d \n" - "tdls_enable:%d", - ptdlsinfo->link_established, ptdlsinfo->sta_cnt, ptdlsinfo->sta_maximum, - ptdlsinfo->cur_channel, ptdlsinfo->tdls_enable - ); + "tdls_enable:%d" +#ifdef CONFIG_TDLS_CH_SW + "ch_sw_state:%08x\n" + "chsw_on:%d\n" + "off_ch_num:%d\n" + "cur_time:%d\n" + "ch_offset:%d\n" + "delay_swtich_back:%d" +#endif + , + ptdlsinfo->link_established, ptdlsinfo->sta_cnt, + ptdlsinfo->sta_maximum, ptdlsinfo->cur_channel, + ptdlsinfo->tdls_enable +#ifdef CONFIG_TDLS_CH_SW +, + ptdlsinfo->chsw_info.ch_sw_state, + ATOMIC_READ(&padapter->tdlsinfo.chsw_info.chsw_on), + ptdlsinfo->chsw_info.off_ch_num, + ptdlsinfo->chsw_info.cur_time, + ptdlsinfo->chsw_info.ch_offset, + ptdlsinfo->chsw_info.delay_switch_back +#endif +); wrqu->data.length = strlen( extra ); -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ return ret; @@ -12734,68 +13888,102 @@ static int rtw_tdls_getsta(struct net_device *dev, char charmac[17]; struct sta_info *ptdls_sta = NULL; - printk( "[%s] %s %d\n", __FUNCTION__, (char *)wrqu->data.pointer, wrqu->data.length -1 ); + DBG_871X("[%s] %s %d\n", __FUNCTION__, + (char *)wrqu->data.pointer, wrqu->data.length -1); if(copy_from_user(charmac, wrqu->data.pointer+9, 17)){ ret = -EFAULT; goto exit; } - printk("[%s] %d, charmac:%s\n", __FUNCTION__, __LINE__, charmac); - for( i=0, j=0 ; i < ETH_ALEN; i++, j+=3 ){ + DBG_871X("[%s] %d, charmac:%s\n", __FUNCTION__, __LINE__, charmac); + for (i=0, j=0 ; i < ETH_ALEN; i++, j+=3) addr[i]=key_2char2num(*(charmac+j), *(charmac+j+1)); - } - printk("[%s] %d, charmac:%s, addr:"MAC_FMT"\n", __FUNCTION__, __LINE__, charmac, MAC_ARG(addr)); + DBG_871X("[%s] %d, charmac:%s, addr:"MAC_FMT"\n", + __FUNCTION__, __LINE__, charmac, MAC_ARG(addr)); ptdls_sta = rtw_get_stainfo(&padapter->stapriv, addr); if(ptdls_sta) { - sprintf(extra, "\n\ntdls_sta_state=%d\n", ptdls_sta->tdls_sta_state); - printk("\n\ntdls_sta_state=%d\n", ptdls_sta->tdls_sta_state); - } - else { + sprintf(extra, "\n\ntdls_sta_state=0x%08x\n", ptdls_sta->tdls_sta_state); + DBG_871X("\n\ntdls_sta_state=%d\n", ptdls_sta->tdls_sta_state); + } else { sprintf(extra, "\n\nNot found this sta\n"); - printk("\n\nNot found this sta\n"); + DBG_871X("\n\nNot found this sta\n"); } wrqu->data.length = strlen( extra ); -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ exit: return ret; } -static int rtw_tdls_ch_switch_off(struct net_device *dev, +static int rtw_tdls_get_best_ch(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - int ret = 0; - -#ifdef CONFIG_TDLS - +#ifdef CONFIG_FIND_BEST_CHANNEL _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); - u8 i, j, mac_addr[ETH_ALEN]; - struct sta_info *ptdls_sta = NULL; + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; + u32 i, best_channel_24G = 1, best_channel_5G = 36, index_24G = 0, index_5G = 0; + + for (i=0; pmlmeext->channel_set[i].ChannelNum !=0; i++) { + if (pmlmeext->channel_set[i].ChannelNum == 1) + index_24G = i; + if (pmlmeext->channel_set[i].ChannelNum == 36) + index_5G = i; + } + + for (i=0; pmlmeext->channel_set[i].ChannelNum !=0; i++) { + /* 2.4G */ + if (pmlmeext->channel_set[i].ChannelNum == 6 || pmlmeext->channel_set[i].ChannelNum == 11) { + if (pmlmeext->channel_set[i].rx_count < pmlmeext->channel_set[index_24G].rx_count) { + index_24G = i; + best_channel_24G = pmlmeext->channel_set[i].ChannelNum; + } + } + + /* 5G */ + if (pmlmeext->channel_set[i].ChannelNum >= 36 + && pmlmeext->channel_set[i].ChannelNum < 140) { + /* Find primary channel */ + if (((pmlmeext->channel_set[i].ChannelNum - 36) % 8 == 0) + && (pmlmeext->channel_set[i].rx_count < pmlmeext->channel_set[index_5G].rx_count)) { + index_5G = i; + best_channel_5G = pmlmeext->channel_set[i].ChannelNum; + } + } + + if (pmlmeext->channel_set[i].ChannelNum >= 149 + && pmlmeext->channel_set[i].ChannelNum < 165) { + /* Find primary channel */ + if (((pmlmeext->channel_set[i].ChannelNum - 149) % 8 == 0) + && (pmlmeext->channel_set[i].rx_count < pmlmeext->channel_set[index_5G].rx_count)) { + index_5G = i; + best_channel_5G = pmlmeext->channel_set[i].ChannelNum; + } + } +#if 1 /* debug */ + DBG_871X("The rx cnt of channel %3d = %d\n", + pmlmeext->channel_set[i].ChannelNum, + pmlmeext->channel_set[i].rx_count); +#endif + } - DBG_871X( "[%s] %s %d\n", __FUNCTION__, extra, wrqu->data.length -1 ); + sprintf( extra, "\nbest_channel_24G = %d\n", best_channel_24G ); + DBG_871X("best_channel_24G = %d\n", best_channel_24G); - for( i=0, j=0 ; i < ETH_ALEN; i++, j+=3 ){ - mac_addr[i]=key_2char2num(*(extra+j), *(extra+j+1)); + if (index_5G != 0) { + sprintf(extra, "best_channel_5G = %d\n", best_channel_5G); + DBG_871X("best_channel_5G = %d\n", best_channel_5G); } - ptdls_sta = rtw_get_stainfo(&padapter->stapriv, mac_addr); + wrqu->data.length = strlen( extra ); - ptdls_sta->tdls_sta_state |= TDLS_SW_OFF_STATE; -/* - if((ptdls_sta->tdls_sta_state & TDLS_AT_OFF_CH_STATE) && (ptdls_sta->tdls_sta_state & TDLS_PEER_AT_OFF_STATE)){ - pmlmeinfo->tdls_candidate_ch= pmlmeext->cur_channel; - issue_tdls_ch_switch_req(padapter, mac_addr); - DBG_871X("issue tdls ch switch req back to base channel\n"); - } -*/ - -#endif //CONFIG_TDLS +#endif + + return 0; - return ret; } static int rtw_tdls(struct net_device *dev, @@ -12805,85 +13993,71 @@ static int rtw_tdls(struct net_device *dev, int ret = 0; #ifdef CONFIG_TDLS - _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); - + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); DBG_871X( "[%s] extra = %s\n", __FUNCTION__, extra ); - // WFD Sigma will use the tdls enable command to let the driver know we want to test the tdls now! - if ( _rtw_memcmp( extra, "wfdenable=", 10 ) ) - { + /* WFD Sigma will use the tdls enable command to let the driver know we want to test the tdls now! */ + if (_rtw_memcmp(extra, "wfdenable=", 10)) { wrqu->data.length -=10; rtw_wfd_tdls_enable( dev, info, wrqu, &extra[10] ); return ret; - } - else if ( _rtw_memcmp( extra, "weaksec=", 8 ) ) - { + } else if (_rtw_memcmp(extra, "weaksec=", 8)) { wrqu->data.length -=8; rtw_tdls_weaksec( dev, info, wrqu, &extra[8] ); return ret; - } - else if ( _rtw_memcmp( extra, "tdlsenable=", 11 ) ) - { + } else if (_rtw_memcmp( extra, "tdlsenable=", 11)) { wrqu->data.length -=11; rtw_tdls_enable( dev, info, wrqu, &extra[11] ); return ret; } - if( padapter->tdlsinfo.tdls_enable == 0 ) - { - printk("tdls haven't enabled\n"); + if (padapter->tdlsinfo.tdls_enable == 0) { + DBG_871X("tdls haven't enabled\n"); return 0; } - if ( _rtw_memcmp( extra, "setup=", 6 ) ) - { + if (_rtw_memcmp(extra, "setup=", 6)) { wrqu->data.length -=6; rtw_tdls_setup( dev, info, wrqu, &extra[6] ); - } - else if (_rtw_memcmp( extra, "tear=", 5 ) ) - { + } else if (_rtw_memcmp(extra, "tear=", 5)) { wrqu->data.length -= 5; rtw_tdls_teardown( dev, info, wrqu, &extra[5] ); - } - else if (_rtw_memcmp( extra, "dis=", 4 ) ) - { + } else if (_rtw_memcmp(extra, "dis=", 4)) { wrqu->data.length -= 4; rtw_tdls_discovery( dev, info, wrqu, &extra[4] ); - } - else if (_rtw_memcmp( extra, "sw=", 3 ) ) - { + } else if (_rtw_memcmp(extra, "swoff=", 6)) { + wrqu->data.length -= 6; + rtw_tdls_ch_switch_off(dev, info, wrqu, &extra[6]); + } else if (_rtw_memcmp(extra, "sw=", 3)) { wrqu->data.length -= 3; rtw_tdls_ch_switch( dev, info, wrqu, &extra[3] ); - } - else if (_rtw_memcmp( extra, "swoff=", 6 ) ) - { - wrqu->data.length -= 6; - rtw_tdls_ch_switch_off( dev, info, wrqu, &extra[6] ); - } - else if (_rtw_memcmp( extra, "pson=", 5 ) ) - { + } else if (_rtw_memcmp(extra, "dumpstack=", 10)) { + wrqu->data.length -= 10; + rtw_tdls_dump_ch(dev, info, wrqu, &extra[10]); + } else if (_rtw_memcmp(extra, "offchnum=", 9)) { + wrqu->data.length -= 9; + rtw_tdls_off_ch_num(dev, info, wrqu, &extra[9]); + } else if (_rtw_memcmp(extra, "choffset=", 9)) { + wrqu->data.length -= 9; + rtw_tdls_ch_offset(dev, info, wrqu, &extra[9]); + } else if (_rtw_memcmp(extra, "pson=", 5)) { wrqu->data.length -= 5; rtw_tdls_pson( dev, info, wrqu, &extra[5] ); - } - else if (_rtw_memcmp( extra, "psoff=", 6 ) ) - { + } else if (_rtw_memcmp(extra, "psoff=", 6)) { wrqu->data.length -= 6; rtw_tdls_psoff( dev, info, wrqu, &extra[6] ); } #ifdef CONFIG_WFD - else if (_rtw_memcmp( extra, "setip=", 6 ) ) - { + else if (_rtw_memcmp(extra, "setip=", 6)) { wrqu->data.length -= 6; rtw_tdls_setip( dev, info, wrqu, &extra[6] ); - } - else if (_rtw_memcmp( extra, "tprobe=", 6 ) ) - { + } else if (_rtw_memcmp(extra, "tprobe=", 6)) { issue_tunneled_probe_req((_adapter *)rtw_netdev_priv(dev)); } -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ return ret; } @@ -12895,33 +14069,24 @@ static int rtw_tdls_get(struct net_device *dev, { int ret = 0; -#ifdef CONFIG_WFD +#ifdef CONFIG_TDLS DBG_871X( "[%s] extra = %s\n", __FUNCTION__, (char*) wrqu->data.pointer ); if ( _rtw_memcmp( wrqu->data.pointer, "ip", 2 ) ) - { rtw_tdls_getip( dev, info, wrqu, extra ); - } - if ( _rtw_memcmp( wrqu->data.pointer, "port", 4 ) ) - { + else if (_rtw_memcmp(wrqu->data.pointer, "port", 4)) rtw_tdls_getport( dev, info, wrqu, extra ); - } - //WFDTDLS, for sigma test - if ( _rtw_memcmp( wrqu->data.pointer, "dis", 3 ) ) - { + /* WFDTDLS, for sigma test */ + else if ( _rtw_memcmp(wrqu->data.pointer, "dis", 3)) rtw_tdls_dis_result( dev, info, wrqu, extra ); - } - if ( _rtw_memcmp( wrqu->data.pointer, "status", 6 ) ) - { + else if ( _rtw_memcmp(wrqu->data.pointer, "status", 6)) rtw_wfd_tdls_status( dev, info, wrqu, extra ); - } - if ( _rtw_memcmp( wrqu->data.pointer, "tdls_sta=", 9 ) ) - { + else if ( _rtw_memcmp(wrqu->data.pointer, "tdls_sta=", 9)) rtw_tdls_getsta( dev, info, wrqu, extra ); - } - -#endif //CONFIG_WFD + else if (_rtw_memcmp(wrqu->data.pointer, "best_ch", 7)) + rtw_tdls_get_best_ch(dev, info, wrqu, extra); +#endif /* CONFIG_TDLS */ return ret; } @@ -12990,6 +14155,14 @@ extern void rtl8723b_cal_txdesc_chksum(struct tx_desc *ptxdesc); extern void rtl8723b_fill_default_txdesc(struct xmit_frame *pxmitframe, u8 *pbuf); #define fill_default_txdesc rtl8723b_fill_default_txdesc #endif // CONFIG_RTL8723B +#if defined(CONFIG_RTL8192E) +extern void rtl8192e_cal_txdesc_chksum(struct tx_desc *ptxdesc); +#define cal_txdesc_chksum rtl8192e_cal_txdesc_chksum +#ifdef CONFIG_SDIO_HCI || defined(CONFIG_GSPI_HCI) +extern void rtl8192es_fill_default_txdesc(struct xmit_frame *pxmitframe, u8 *pbuf); +#define fill_default_txdesc rtl8192es_fill_default_txdesc +#endif // CONFIG_SDIO_HCI +#endif //CONFIG_RTL8192E static s32 initLoopback(PADAPTER padapter) { @@ -13616,13 +14789,11 @@ static int rtw_test( { rtw_btcoex_SetManualControl(padapter, _FALSE); } - - if (strcmp(pch, "btoff") == 0) + else if (strcmp(pch, "btoff") == 0) { rtw_btcoex_SetManualControl(padapter, _TRUE); } - - if (strcmp(pch, "h2c") == 0) + else if (strcmp(pch, "h2c") == 0) { u8 param[8]; u8 count = 0; @@ -13725,64 +14896,6 @@ static iw_handler rtw_handlers[] = NULL, /*---hole---*/ }; -#if 0 -//defined(CONFIG_MP_INCLUDED) && defined(CONFIG_MP_IWPRIV_SUPPORT) -static const struct iw_priv_args rtw_private_args[] = -{ - { SIOCIWFIRSTPRIV + 0x00, IW_PRIV_TYPE_CHAR | 1024, 0 , ""}, //set - { SIOCIWFIRSTPRIV + 0x01, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK , ""},//get -/* --- sub-ioctls definitions --- */ - { MP_START , IW_PRIV_TYPE_CHAR | 1024, 0, "mp_start" }, //set - { MP_PHYPARA, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_phypara" },//get - { MP_STOP , IW_PRIV_TYPE_CHAR | 1024, 0, "mp_stop" }, //set - { MP_CHANNEL , IW_PRIV_TYPE_CHAR | 1024 , IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_channel" },//get - { MP_BANDWIDTH , IW_PRIV_TYPE_CHAR | 1024, 0, "mp_bandwidth"}, //set - { MP_RATE , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_rate" },//get - { MP_RESET_STATS , IW_PRIV_TYPE_CHAR | 1024, 0, "mp_reset_stats"}, - { MP_QUERY , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK , "mp_query"}, //get - { MP_NULL, IW_PRIV_TYPE_CHAR | 128, 0,"NULL"},//set - { READ_REG , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "read_reg" }, - { MP_NULL, IW_PRIV_TYPE_CHAR | 128, 0,"NULL"},//set - { MP_RATE , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_rate" }, - { MP_NULL, IW_PRIV_TYPE_CHAR | 128, 0,"NULL"},//set - { READ_RF , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "read_rf" }, - { MP_NULL, IW_PRIV_TYPE_CHAR | 128, 0,"NULL"},//set - { MP_PSD , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_psd"}, - { MP_NULL, IW_PRIV_TYPE_CHAR | 128, 0,"NULL"},//set - { MP_DUMP, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_dump" }, - { MP_NULL, IW_PRIV_TYPE_CHAR | 128, 0,"NULL"},//set - { MP_TXPOWER , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_txpower"}, - { MP_NULL, IW_PRIV_TYPE_CHAR | 128, 0,"NULL"},//set - { MP_ANT_TX , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_ant_tx"}, - { MP_NULL, IW_PRIV_TYPE_CHAR | 128, 0,"NULL"},//set - { MP_ANT_RX , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_ant_rx"}, - { WRITE_REG, IW_PRIV_TYPE_CHAR | 1024, 0,"write_reg"},//set - { MP_NULL, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "NULL" }, - { WRITE_RF, IW_PRIV_TYPE_CHAR | 1024, 0,"write_rf"},//set - { MP_NULL, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "NULL" }, - { MP_NULL, IW_PRIV_TYPE_CHAR | 128, 0,"NULL"},//set - { MP_CTX , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_ctx"}, - { MP_NULL, IW_PRIV_TYPE_CHAR | 128, 0,"NULL"},//set - { MP_ARX , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_arx"}, - { MP_NULL, IW_PRIV_TYPE_CHAR | 128, 0,"NULL"},//set - { MP_THER , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_ther"}, - { EFUSE_SET, IW_PRIV_TYPE_CHAR | 1024, 0, "efuse_set" }, - { EFUSE_GET, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "efuse_get" }, - { MP_PWRTRK , IW_PRIV_TYPE_CHAR | 1024, 0, "mp_pwrtrk"}, - { MP_QueryDrvStats, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_drvquery" }, - { MP_IOCTL, IW_PRIV_TYPE_CHAR | 1024, 0, "mp_ioctl"}, // mp_ioctl - { MP_SetRFPathSwh, IW_PRIV_TYPE_CHAR | 1024, 0, "mp_setrfpath" }, -#ifdef CONFIG_RTL8723A - { MP_SetBT, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_setbt" }, -#endif - { SIOCIWFIRSTPRIV + 0x02, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK , "test"},//set -}; -static iw_handler rtw_private_handler[] = -{ - rtw_mp_set, - rtw_mp_get, -}; -#else // not inlucde MP static const struct iw_priv_args rtw_private_args[] = { { @@ -13934,15 +15047,21 @@ static const struct iw_priv_args rtw_private_args[] = { { MP_SetRFPathSwh, IW_PRIV_TYPE_CHAR | 1024, 0, "mp_setrfpath" }, { MP_PwrCtlDM, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_pwrctldm" }, { MP_GET_TXPOWER_INX, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_get_txpower" }, - + { MP_GETVER, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_priv_ver" }, + { MP_MON, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_mon" }, + { EFUSE_MASK, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "efuse_mask" }, + { EFUSE_FILE, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "efuse_file" }, #if defined(CONFIG_RTL8723A) || defined(CONFIG_RTL8723B) { MP_SetBT, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_setbt" }, { MP_DISABLE_BT_COEXIST, IW_PRIV_TYPE_CHAR | 1024, 0, "mp_disa_btcoex"}, #endif { CTA_TEST, IW_PRIV_TYPE_CHAR | 1024, 0, "cta_test"}, #endif +#ifdef CONFIG_WOWLAN + { MP_WOW_ENABLE , IW_PRIV_TYPE_CHAR | 1024, 0, "wow_mode" }, //set +#endif #ifdef CONFIG_AP_WOWLAN - { MP_AP_WOW_ENABLE , IW_PRIV_TYPE_CHAR | 1024, 0, "ap_wow_enable" }, //set + { MP_AP_WOW_ENABLE , IW_PRIV_TYPE_CHAR | 1024, 0, "ap_wow_mode" }, //set #endif }; @@ -14005,7 +15124,6 @@ static iw_handler rtw_private_handler[] = #endif // CONFIG_INTEL_WIDI }; -#endif // #if defined(CONFIG_MP_INCLUDED) && defined(CONFIG_MP_IWPRIV_SUPPORT) #if WIRELESS_EXT >= 17 static struct iw_statistics *rtw_get_wireless_stats(struct net_device *dev) @@ -14027,11 +15145,22 @@ static struct iw_statistics *rtw_get_wireless_stats(struct net_device *dev) #ifdef CONFIG_SIGNAL_DISPLAY_DBM tmp_level = translate_percentage_to_dbm(padapter->recvpriv.signal_strength); #else + #ifdef CONFIG_SKIP_SIGNAL_SCALE_MAPPING + { + /* Do signal scale mapping when using percentage as the unit of signal strength, since the scale mapping is skipped in odm */ + + HAL_DATA_TYPE *pHal = GET_HAL_DATA(padapter); + + tmp_level = (u8)odm_SignalScaleMapping(&pHal->odmpriv, padapter->recvpriv.signal_strength); + } + #else tmp_level = padapter->recvpriv.signal_strength; #endif + #endif tmp_qual = padapter->recvpriv.signal_qual; - tmp_noise =padapter->recvpriv.noise; + rtw_get_noise(padapter); + tmp_noise = padapter->recvpriv.noise; //DBG_871X("level:%d, qual:%d, noise:%d, rssi (%d)\n", tmp_level, tmp_qual, tmp_noise,padapter->recvpriv.rssi); piwstats->qual.level = tmp_level; @@ -14100,7 +15229,8 @@ static int get_priv_size(__u16 args) } // copy from net/wireless/wext.c end -static int rtw_ioctl_wext_private(struct net_device *dev, union iwreq_data *wrq_data) + +static int _rtw_ioctl_wext_private(struct net_device *dev, union iwreq_data *wrq_data) { int err = 0; u8 *input = NULL; @@ -14130,30 +15260,29 @@ static int rtw_ioctl_wext_private(struct net_device *dev, union iwreq_data *wrq_ union iwreq_data wdata; - _rtw_memcpy(&wdata, wrq_data, sizeof(wdata)); input_len = wdata.data.length; input = rtw_zmalloc(input_len); - if (NULL == input) + if (NULL == input || input_len == 0) return -ENOMEM; if (copy_from_user(input, wdata.data.pointer, input_len)) { err = -EFAULT; goto exit; } + input[input_len - 1] = '\0'; ptr = input; len = input_len; - sscanf(ptr, "%16s", cmdname); cmdlen = strlen(cmdname); - DBG_8192C("%s: cmd=%s\n", __func__, cmdname); + DBG_871X("%s: cmd=%s\n", __func__, cmdname); // skip command string if (cmdlen > 0) cmdlen += 1; // skip one space ptr += cmdlen; len -= cmdlen; - DBG_8192C("%s: parameters=%s\n", __func__, ptr); + DBG_871X("%s: parameters=%s\n", __func__, ptr); priv = rtw_private_handler; priv_args = rtw_private_args; @@ -14439,6 +15568,61 @@ static int rtw_ioctl_wext_private(struct net_device *dev, union iwreq_data *wrq_ return err; } +#ifdef CONFIG_COMPAT +static int rtw_ioctl_compat_wext_private(struct net_device *dev, struct ifreq *rq) +{ + struct compat_iw_point iwp_compat; + union iwreq_data wrq_data; + int err = 0; + DBG_871X("%s:...\n", __func__); + if (copy_from_user(&iwp_compat, rq->ifr_ifru.ifru_data, sizeof(struct compat_iw_point))) + return -EFAULT; + + wrq_data.data.pointer = compat_ptr(iwp_compat.pointer); + wrq_data.data.length = iwp_compat.length; + wrq_data.data.flags = iwp_compat.flags; + + err = _rtw_ioctl_wext_private(dev, &wrq_data); + + iwp_compat.pointer = ptr_to_compat(wrq_data.data.pointer); + iwp_compat.length = wrq_data.data.length; + iwp_compat.flags = wrq_data.data.flags; + if (copy_to_user(rq->ifr_ifru.ifru_data, &iwp_compat, sizeof(struct compat_iw_point))) + return -EFAULT; + + return err; +} +#endif // CONFIG_COMPAT + +static int rtw_ioctl_standard_wext_private(struct net_device *dev, struct ifreq *rq) +{ + struct iw_point *iwp; + struct ifreq ifrq; + union iwreq_data wrq_data; + int err = 0; + iwp = &wrq_data.data; + DBG_871X("%s:...\n", __func__); + if (copy_from_user(iwp, rq->ifr_ifru.ifru_data, sizeof(struct iw_point))) + return -EFAULT; + + err = _rtw_ioctl_wext_private(dev, &wrq_data); + + if (copy_to_user(rq->ifr_ifru.ifru_data, iwp, sizeof(struct iw_point))) + return -EFAULT; + + return err; +} + +static int rtw_ioctl_wext_private(struct net_device *dev, struct ifreq *rq) +{ +#ifdef CONFIG_COMPAT + if(is_compat_task()) + return rtw_ioctl_compat_wext_private( dev, rq ); + else +#endif // CONFIG_COMPAT + return rtw_ioctl_standard_wext_private( dev, rq ); +} + int rtw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { struct iwreq *wrq = (struct iwreq *)rq; @@ -14459,8 +15643,8 @@ int rtw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) break; #endif #endif // CONFIG_AP_MODE - case SIOCDEVPRIVATE: - ret = rtw_ioctl_wext_private(dev, &wrq->u); + case SIOCDEVPRIVATE: + ret = rtw_ioctl_wext_private(dev, rq); break; case (SIOCDEVPRIVATE+1): ret = rtw_android_priv_cmd(dev, rq, cmd); diff --git a/backports/drivers/realtek/rtl8812au/os_dep/linux/mlme_linux.c b/backports/drivers/realtek/rtl8812au/os_dep/linux/mlme_linux.c index 78ea1017670575..ba0ab12f46e6d3 100755 --- a/backports/drivers/realtek/rtl8812au/os_dep/linux/mlme_linux.c +++ b/backports/drivers/realtek/rtl8812au/os_dep/linux/mlme_linux.c @@ -285,39 +285,41 @@ _func_enter_; if(authmode==_WPA_IE_ID_) { RT_TRACE(_module_mlme_osdep_c_,_drv_info_,("rtw_report_sec_ie, authmode=%d\n", authmode)); - - buff = rtw_malloc(IW_CUSTOM_MAX); - - _rtw_memset(buff,0,IW_CUSTOM_MAX); - - p=buff; - + + buff = rtw_zmalloc(IW_CUSTOM_MAX); + if (NULL == buff) { + DBG_871X(FUNC_ADPT_FMT ": alloc memory FAIL!!\n", + FUNC_ADPT_ARG(adapter)); + return; + } + p = buff; + p+=sprintf(p,"ASSOCINFO(ReqIEs="); len = sec_ie[1]+2; - len = (len < IW_CUSTOM_MAX) ? len:IW_CUSTOM_MAX; + len = (len < IW_CUSTOM_MAX) ? len:IW_CUSTOM_MAX; for(i=0;ipnetdev,IWEVCUSTOM,&wrqu,buff); #endif - if(buff) - rtw_mfree(buff, IW_CUSTOM_MAX); - + rtw_mfree(buff, IW_CUSTOM_MAX); } +exit: + _func_exit_; } @@ -462,11 +464,7 @@ static int mgnt_netdev_open(struct net_device *pnetdev) init_usb_anchor(&phostapdpriv->anchored); - if(!rtw_netif_queue_stopped(pnetdev)) - rtw_netif_start_queue(pnetdev); - else - rtw_netif_wake_queue(pnetdev); - + rtw_netif_wake_queue(pnetdev); netif_carrier_on(pnetdev); @@ -484,9 +482,8 @@ static int mgnt_netdev_close(struct net_device *pnetdev) netif_carrier_off(pnetdev); - if (!rtw_netif_queue_stopped(pnetdev)) - rtw_netif_stop_queue(pnetdev); - + rtw_netif_stop_queue(pnetdev); + //rtw_write16(phostapdpriv->padapter, 0x0116, 0x3f3f); return 0; diff --git a/backports/drivers/realtek/rtl8812au/os_dep/linux/os_intfs.c b/backports/drivers/realtek/rtl8812au/os_dep/linux/os_intfs.c index 70d3c342d51e53..906a38b38f58a0 100755 --- a/backports/drivers/realtek/rtl8812au/os_dep/linux/os_intfs.c +++ b/backports/drivers/realtek/rtl8812au/os_dep/linux/os_intfs.c @@ -54,7 +54,11 @@ int rtw_adhoc_tx_pwr = 1; int rtw_soft_ap = 0; //int smart_ps = 1; #ifdef CONFIG_POWER_SAVING -int rtw_power_mgnt = 1; +#ifdef CONFIG_PLATFORM_INTEL_BYT +int rtw_power_mgnt = PS_MODE_MAX; +#else +int rtw_power_mgnt = PS_MODE_MIN; +#endif #ifdef CONFIG_IPS_LEVEL_2 int rtw_ips_mode = IPS_LEVEL_2; #else @@ -107,9 +111,9 @@ int rtw_ht_enable = 1; // 0x21 means enable 2.4G 40MHz & 5G 80MHz int rtw_bw_mode = 0x21; int rtw_cbw40_enable = 3; // 0 :diable, bit(0): enable 2.4g, bit(1): enable 5g -int rtw_ampdu_enable = 1;//for enable tx_ampdu +int rtw_ampdu_enable = 1;//for enable tx_ampdu ,// 0: disable, 0x1:enable (but wifi_spec should be 0), 0x2: force enable (don't care wifi_spec) int rtw_rx_stbc = 1;// 0: disable, bit(0):enable 2.4g, bit(1):enable 5g, default is set to enable 2.4GHZ for IOT issue with bufflao's AP at 5GHZ -int rtw_ampdu_amsdu = 0;// 0: disabled, 1:enabled, 2:auto +int rtw_ampdu_amsdu = 0;// 0: disabled, 1:enabled, 2:auto . There is an IOT issu with DLINK DIR-629 when the flag turn on // Short GI support Bit Map // BIT0 - 20MHz, 0: non-support, 1: support // BIT1 - 40MHz, 0: non-support, 1: support @@ -140,13 +144,21 @@ int rtw_wifi_spec = 1;//for wifi test #else int rtw_wifi_spec = 0; #endif + +int rtw_special_rf_path = 0; //0: 2T2R ,1: only turn on path A 1T1R + int rtw_channel_plan = RT_CHANNEL_DOMAIN_MAX; #ifdef CONFIG_BT_COEXIST int rtw_btcoex_enable = 1; +module_param(rtw_btcoex_enable, int, 0644); +MODULE_PARM_DESC(rtw_btcoex_enable, "Enable BT co-existence mechanism"); int rtw_bt_iso = 2;// 0:Low, 1:High, 2:From Efuse int rtw_bt_sco = 3;// 0:Idle, 1:None-SCO, 2:SCO, 3:From Counter, 4.Busy, 5.OtherBusy int rtw_bt_ampdu =1 ;// 0:Disable BT control A-MPDU, 1:Enable BT control A-MPDU. +int rtw_ant_num = -1; // <0: undefined, >0: Antenna number +module_param(rtw_ant_num, int, 0644); +MODULE_PARM_DESC(rtw_ant_num, "Antenna number setting"); #endif int rtw_AcceptAddbaReq = _TRUE;// 0:Reject AP's Add BA req, 1:Accept AP's Add BA req. @@ -187,14 +199,6 @@ int rtw_dmsp = 0; int rtw_80211d = 0; #endif -#ifdef CONFIG_REGULATORY_CTRL -int rtw_regulatory_id =2; -#else -int rtw_regulatory_id = 0xff;// Regulatory tab id, 0xff = follow efuse's setting -#endif -module_param(rtw_regulatory_id, int, 0644); - - #ifdef CONFIG_SPECIAL_SETTING_FOR_FUNAI_TV int rtw_force_ant = 2;//0 :normal, 1:Main ant, 2:Aux ant int rtw_force_igi =0;//0 :normal @@ -202,11 +206,22 @@ module_param(rtw_force_ant, int, 0644); module_param(rtw_force_igi, int, 0644); #endif +#ifdef CONFIG_QOS_OPTIMIZATION +int rtw_qos_opt_enable=1;//0: disable,1:enable +#else +int rtw_qos_opt_enable=0;//0: disable,1:enable +#endif +module_param(rtw_qos_opt_enable,int,0644); + char* ifname = "wlan%d"; module_param(ifname, charp, 0644); MODULE_PARM_DESC(ifname, "The default name to allocate for first interface"); +#ifdef CONFIG_PLATFORM_ANDROID +char* if2name = "p2p%d"; +#else //CONFIG_PLATFORM_ANDROID char* if2name = "wlan%d"; +#endif //CONFIG_PLATFORM_ANDROID module_param(if2name, charp, 0644); MODULE_PARM_DESC(if2name, "The default name to allocate for second interface"); @@ -219,6 +234,7 @@ module_param(rtw_ext_iface_num, int, 0644); module_param(rtw_initmac, charp, 0644); module_param(rtw_channel_plan, int, 0644); +module_param(rtw_special_rf_path, int, 0644); module_param(rtw_chip_version, int, 0644); module_param(rtw_rfintfs, int, 0644); module_param(rtw_lbkmode, int, 0644); @@ -274,9 +290,9 @@ MODULE_PARM_DESC(rtw_max_roaming_times,"The max roaming times to try"); #endif //CONFIG_LAYER2_ROAMING #ifdef CONFIG_IOL -int rtw_fw_iol=1;// 0:Disable, 1:enable, 2:by usb speed +int rtw_fw_iol=1; module_param(rtw_fw_iol, int, 0644); -MODULE_PARM_DESC(rtw_fw_iol,"FW IOL"); +MODULE_PARM_DESC(rtw_fw_iol, "FW IOL. 0:Disable, 1:enable, 2:by usb speed"); #endif //CONFIG_IOL #ifdef CONFIG_FILE_FWIMG @@ -308,25 +324,79 @@ module_param(rtw_80211d, int, 0644); MODULE_PARM_DESC(rtw_80211d, "Enable 802.11d mechanism"); #endif -#ifdef CONFIG_BT_COEXIST -module_param(rtw_btcoex_enable, int, 0644); -MODULE_PARM_DESC(rtw_btcoex_enable, "Enable BT co-existence mechanism"); -#endif - uint rtw_notch_filter = RTW_NOTCH_FILTER; module_param(rtw_notch_filter, uint, 0644); MODULE_PARM_DESC(rtw_notch_filter, "0:Disable, 1:Enable, 2:Enable only for P2P"); -int rtw_tx_pwr_lmt_enable = 2; +uint rtw_hiq_filter = CONFIG_RTW_HIQ_FILTER; +module_param(rtw_hiq_filter, uint, 0644); +MODULE_PARM_DESC(rtw_hiq_filter, "0:allow all, 1:allow special, 2:deny all"); + +uint rtw_adaptivity_en = CONFIG_RTW_ADAPTIVITY_EN; +module_param(rtw_adaptivity_en, uint, 0644); +MODULE_PARM_DESC(rtw_adaptivity_en, "0:disable, 1:enable"); + +uint rtw_adaptivity_mode = CONFIG_RTW_ADAPTIVITY_MODE; +module_param(rtw_adaptivity_mode, uint, 0644); +MODULE_PARM_DESC(rtw_adaptivity_mode, "0:normal, 1:carrier sense"); + +uint rtw_adaptivity_dml = CONFIG_RTW_ADAPTIVITY_DML; +module_param(rtw_adaptivity_dml, uint, 0644); +MODULE_PARM_DESC(rtw_adaptivity_dml, "0:disable, 1:enable"); + +uint rtw_amplifier_type_2g = CONFIG_RTW_AMPLIFIER_TYPE_2G; +module_param(rtw_amplifier_type_2g, uint, 0644); +MODULE_PARM_DESC(rtw_amplifier_type_2g, "BIT3:2G ext-PA, BIT4:2G ext-LNA"); + +uint rtw_amplifier_type_5g = CONFIG_RTW_AMPLIFIER_TYPE_5G; +module_param(rtw_amplifier_type_5g, uint, 0644); +MODULE_PARM_DESC(rtw_amplifier_type_5g, "BIT6:5G ext-PA, BIT7:5G ext-LNA"); + +uint rtw_RFE_type = 64; +module_param(rtw_RFE_type, uint, 0644); +MODULE_PARM_DESC(rtw_RFE_type, "default init value:64"); + +uint rtw_TxBBSwing_2G = 0xFF; +module_param(rtw_TxBBSwing_2G, uint, 0644); +MODULE_PARM_DESC(rtw_TxBBSwing_2G, "default init value:0xFF"); + +uint rtw_TxBBSwing_5G = 0xFF; +module_param(rtw_TxBBSwing_5G, uint, 0644); +MODULE_PARM_DESC(rtw_TxBBSwing_5G, "default init value:0xFF"); + +uint rtw_OffEfuseMask = 0; +module_param(rtw_OffEfuseMask, uint, 0644); +MODULE_PARM_DESC(rtw_OffEfuseMask, "default open Efuse Mask vaule:0"); + +uint rtw_FileMaskEfuse = 0; +module_param(rtw_FileMaskEfuse, uint, 0644); +MODULE_PARM_DESC(rtw_FileMaskEfuse, "default drv Mask Efuse vaule:0"); + + +#if defined(CONFIG_CALIBRATE_TX_POWER_BY_REGULATORY) //eFuse: Regulatory selection=1 +int rtw_tx_pwr_lmt_enable = 1; +int rtw_tx_pwr_by_rate = 1; +#elif defined(CONFIG_CALIBRATE_TX_POWER_TO_MAX)//eFuse: Regulatory selection=0 +int rtw_tx_pwr_lmt_enable = 0; +int rtw_tx_pwr_by_rate = 1; +#else //eFuse: Regulatory selection=2 +#ifdef CONFIG_PCI_HCI +int rtw_tx_pwr_lmt_enable = 2; // 2- Depend on efuse +int rtw_tx_pwr_by_rate = 2;// 2- Depend on efuse +#else // USB & SDIO +int rtw_tx_pwr_lmt_enable = 0; +int rtw_tx_pwr_by_rate = 0; +#endif +#endif + module_param(rtw_tx_pwr_lmt_enable, int, 0644); MODULE_PARM_DESC(rtw_tx_pwr_lmt_enable,"0:Disable, 1:Enable, 2: Depend on efuse"); -int rtw_tx_pwr_by_rate = 2; module_param(rtw_tx_pwr_by_rate, int, 0644); MODULE_PARM_DESC(rtw_tx_pwr_by_rate,"0:Disable, 1:Enable, 2: Depend on efuse"); #ifdef CONFIG_LOAD_PHY_PARA_FROM_FILE -char *rtw_phy_file_path = ""; +char *rtw_phy_file_path = REALTEK_CONFIG_PATH; module_param(rtw_phy_file_path, charp, 0644); MODULE_PARM_DESC(rtw_phy_file_path, "The path of phy parameter"); // PHY FILE Bit Map @@ -349,6 +419,9 @@ static uint loadparam(PADAPTER padapter, _nic_hdl pnetdev); int _netdev_open(struct net_device *pnetdev); int netdev_open (struct net_device *pnetdev); static int netdev_close (struct net_device *pnetdev); +#ifdef CONFIG_PLATFORM_INTEL_BYT +extern int rtw_sdio_set_power(int on); +#endif //CONFIG_PLATFORM_INTEL_BYT //#ifdef RTK_DMP_PLATFORM uint loadparam( _adapter *padapter, _nic_hdl pnetdev) @@ -421,15 +494,15 @@ _func_enter_; registry_par->rx_stbc = (u8)rtw_rx_stbc; registry_par->ampdu_amsdu = (u8)rtw_ampdu_amsdu; registry_par->short_gi = (u8)rtw_short_gi; + registry_par->ldpc_cap = (u8)rtw_ldpc_cap; + registry_par->stbc_cap = (u8)rtw_stbc_cap; + registry_par->beamform_cap = (u8)rtw_beamform_cap; #endif #ifdef CONFIG_80211AC_VHT registry_par->vht_enable = (u8)rtw_vht_enable; registry_par->ampdu_factor = (u8)rtw_ampdu_factor; registry_par->vht_rate_sel = (u8)rtw_vht_rate_sel; - registry_par->ldpc_cap = (u8)rtw_ldpc_cap; - registry_par->stbc_cap = (u8)rtw_stbc_cap; - registry_par->beamform_cap = (u8)rtw_beamform_cap; #endif #ifdef CONFIG_TX_EARLY_MODE @@ -443,12 +516,14 @@ _func_enter_; registry_par->wifi_spec = (u8)rtw_wifi_spec; registry_par->channel_plan = (u8)rtw_channel_plan; + registry_par->special_rf_path = (u8)rtw_special_rf_path; #ifdef CONFIG_BT_COEXIST registry_par->btcoex = (u8)rtw_btcoex_enable; registry_par->bt_iso = (u8)rtw_bt_iso; registry_par->bt_sco = (u8)rtw_bt_sco; registry_par->bt_ampdu = (u8)rtw_bt_ampdu; + registry_par->ant_num = (s8)rtw_ant_num; #endif registry_par->bAcceptAddbaReq = (u8)rtw_AcceptAddbaReq; @@ -500,8 +575,6 @@ _func_enter_; registry_par->force_igi = (u8)rtw_force_igi; #endif - registry_par->regulatory_tid = (u8)rtw_regulatory_id; - #ifdef CONFIG_MULTI_VIR_IFACES registry_par->ext_iface_num = (u8)rtw_ext_iface_num; #endif //CONFIG_MULTI_VIR_IFACES @@ -510,16 +583,27 @@ _func_enter_; registry_par->RegEnableTxPowerByRate = (u8)rtw_tx_pwr_by_rate; registry_par->RegPowerBase = 14; - registry_par->TxBBSwing_2G = 0xFF; - registry_par->TxBBSwing_5G = 0xFF; + registry_par->TxBBSwing_2G = (s8)rtw_TxBBSwing_2G; + registry_par->TxBBSwing_5G = (s8)rtw_TxBBSwing_5G; registry_par->bEn_RFE = 1; - registry_par->RFE_Type = 64; + registry_par->RFE_Type = (u8)rtw_RFE_type; + registry_par->AmplifierType_2G = (u8)rtw_amplifier_type_2g; + registry_par->AmplifierType_5G = (u8)rtw_amplifier_type_5g; #ifdef CONFIG_LOAD_PHY_PARA_FROM_FILE registry_par->load_phy_file = (u8)rtw_load_phy_file; registry_par->RegDecryptCustomFile = (u8)rtw_decrypt_phy_file; #endif + registry_par->qos_opt_enable = (u8)rtw_qos_opt_enable; + + registry_par->hiq_filter = (u8)rtw_hiq_filter; + registry_par->adaptivity_en = (u8)rtw_adaptivity_en; + registry_par->adaptivity_mode = (u8)rtw_adaptivity_mode; + registry_par->adaptivity_dml = (u8)rtw_adaptivity_dml; + + registry_par->boffefusemask = (u8)rtw_OffEfuseMask; + registry_par->bFileMaskEfuse = (u8)rtw_FileMaskEfuse; _func_exit_; return status; @@ -593,7 +677,16 @@ unsigned int rtw_classify8021d(struct sk_buff *skb) return dscp >> 5; } -static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb) + +static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0) + , void *accel_priv +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) + , select_queue_fallback_t fallback +#endif + +#endif +) { _adapter *padapter = rtw_netdev_priv(dev); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -637,10 +730,13 @@ u16 rtw_recv_select_queue(struct sk_buff *skb) } #endif - -static int rtw_ndev_notifier_call(struct notifier_block * nb, unsigned long state, void *ndev) -{ - struct net_device *dev = ndev; +static int rtw_ndev_notifier_call(struct notifier_block * nb, unsigned long state, void *ptr) +{ +#if (LINUX_VERSION_CODE>=KERNEL_VERSION(3,11,0)) + struct net_device *dev = netdev_notifier_info_to_dev(ptr); +#else + struct net_device *dev = ptr; +#endif #if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29)) if (dev->netdev_ops->ndo_do_ioctl != rtw_ioctl) @@ -681,6 +777,7 @@ int rtw_ndev_init(struct net_device *dev) DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(adapter)); strncpy(adapter->old_ifname, dev->name, IFNAMSIZ); + adapter->old_ifname[IFNAMSIZ-1] = '\0'; rtw_adapter_proc_init(dev); return 0; @@ -819,34 +916,37 @@ struct net_device *rtw_init_netdev(_adapter *old_padapter) } -void rtw_unregister_netdevs(struct dvobj_priv *dvobj) +void rtw_unregister_netdev(_adapter *adapter) { - int i; - _adapter *padapter = NULL; + struct net_device *netdev = NULL; - for(i=0;iiface_nums;i++) - { - struct net_device *pnetdev = NULL; - - padapter = dvobj->padapters[i]; - - if (padapter == NULL) - continue; + if (adapter == NULL) + return; - pnetdev = padapter->pnetdev; + netdev = adapter->pnetdev; - if((padapter->DriverState != DRIVER_DISAPPEAR) && pnetdev) { - - unregister_netdev(pnetdev); //will call netdev_close() - } + if ((adapter->DriverState != DRIVER_DISAPPEAR) && netdev) + unregister_netdev(netdev); /* will call netdev_close() */ -#ifdef CONFIG_IOCTL_CFG80211 - rtw_wdev_unregister(padapter->rtw_wdev); +#ifdef CONFIG_IOCTL_CFG80211 + rtw_wdev_unregister(adapter->rtw_wdev); #endif +} + +void rtw_unregister_netdevs(struct dvobj_priv *dvobj) +{ + int i; + _adapter *adapter = NULL; + + for (i = 0; i < dvobj->iface_nums; i++) { + adapter = dvobj->padapters[i]; + + if (adapter == NULL) + continue; + rtw_unregister_netdev(adapter); } - -} +} u32 rtw_start_drv_threads(_adapter *padapter) { @@ -998,16 +1098,28 @@ u8 rtw_init_default_value(_adapter *padapter) rtw_hal_def_value_init(padapter); //misc. - padapter->bReadPortCancel = _FALSE; - padapter->bWritePortCancel = _FALSE; + RTW_ENABLE_FUNC(padapter, DF_RX_BIT); + RTW_ENABLE_FUNC(padapter, DF_TX_BIT); padapter->bLinkInfoDump = 0; - padapter->bNotifyChannelChange = 0; + padapter->bNotifyChannelChange = _FALSE; #ifdef CONFIG_P2P padapter->bShowGetP2PState = 1; #endif + //for debug purpose padapter->fix_rate = 0xFF; - + padapter->data_fb = 0; + padapter->driver_ampdu_spacing = 0xFF; + padapter->driver_rx_ampdu_factor = 0xFF; + padapter->driver_rx_ampdu_spacing = 0xFF; + padapter->fix_rx_ampdu_accept = RX_AMPDU_ACCEPT_INVALID; + padapter->fix_rx_ampdu_size = RX_AMPDU_SIZE_INVALID; +#ifdef DBG_RX_COUNTER_DUMP + padapter->dump_rx_cnt_mode = 0; + padapter->drv_rx_cnt_ok = 0; + padapter->drv_rx_cnt_crcerror = 0; + padapter->drv_rx_cnt_drop = 0; +#endif return ret; } @@ -1025,12 +1137,12 @@ struct dvobj_priv *devobj_init(void) _rtw_mutex_init(&pdvobj->setch_mutex); _rtw_mutex_init(&pdvobj->setbw_mutex); - _rtw_spinlock_init(&pdvobj->lock); - - pdvobj->macid[1] = _TRUE; //macid=1 for bc/mc stainfo - pdvobj->processing_dev_remove = _FALSE; + ATOMIC_SET(&pdvobj->disable_func, 0); + + rtw_macid_ctl_init(&pdvobj->macid_ctl); + _rtw_spinlock_init(&pdvobj->cam_ctl.lock); return pdvobj; @@ -1041,13 +1153,14 @@ void devobj_deinit(struct dvobj_priv *pdvobj) if(!pdvobj) return; - _rtw_spinlock_free(&pdvobj->lock); - _rtw_mutex_free(&pdvobj->hw_init_mutex); _rtw_mutex_free(&pdvobj->h2c_fwcmd_mutex); _rtw_mutex_free(&pdvobj->setch_mutex); _rtw_mutex_free(&pdvobj->setbw_mutex); + rtw_macid_ctl_deinit(&pdvobj->macid_ctl); + _rtw_spinlock_free(&pdvobj->cam_ctl.lock); + rtw_mfree((u8*)pdvobj, sizeof(*pdvobj)); } @@ -1060,9 +1173,9 @@ u8 rtw_reset_drv_sw(_adapter *padapter) //hal_priv if( is_primary_adapter(padapter)) rtw_hal_def_value_init(padapter); - - padapter->bReadPortCancel = _FALSE; - padapter->bWritePortCancel = _FALSE; + + RTW_ENABLE_FUNC(padapter, DF_RX_BIT); + RTW_ENABLE_FUNC(padapter, DF_TX_BIT); padapter->bLinkInfoDump = 0; padapter->xmitpriv.tx_pkts = 0; @@ -1110,8 +1223,6 @@ _func_enter_; ret8 = rtw_init_default_value(padapter); - rtw_init_hal_com_default_value(padapter); - if ((rtw_init_cmd_priv(&padapter->cmdpriv)) == _FAIL) { RT_TRACE(_module_os_intfs_c_,_drv_err_,("\n Can't init cmd_priv\n")); @@ -1196,6 +1307,15 @@ _func_enter_; padapter->stapriv.padapter = padapter; padapter->setband = GHZ24_50; padapter->fix_rate = 0xFF; + padapter->data_fb = 0; + padapter->fix_rx_ampdu_accept = RX_AMPDU_ACCEPT_INVALID; + padapter->fix_rx_ampdu_size = RX_AMPDU_SIZE_INVALID; +#ifdef DBG_RX_COUNTER_DUMP + padapter->dump_rx_cnt_mode = 0; + padapter->drv_rx_cnt_ok = 0; + padapter->drv_rx_cnt_crcerror = 0; + padapter->drv_rx_cnt_drop = 0; +#endif rtw_init_bcmc_stainfo(padapter); rtw_init_pwrctrl_priv(padapter); @@ -1429,11 +1549,7 @@ int _netdev_vir_if_open(struct net_device *pnetdev) _set_timer(&padapter->mlmepriv.dynamic_chk_timer, 2000); - if(!rtw_netif_queue_stopped(pnetdev)) - rtw_netif_start_queue(pnetdev); - else - rtw_netif_wake_queue(pnetdev); - + rtw_netif_wake_queue(pnetdev); DBG_871X(FUNC_NDEV_FMT" exit\n", FUNC_NDEV_ARG(pnetdev)); return 0; @@ -1474,8 +1590,7 @@ static int netdev_vir_if_close(struct net_device *pnetdev) if(pnetdev) { - if (!rtw_netif_queue_stopped(pnetdev)) - rtw_netif_stop_queue(pnetdev); + rtw_netif_stop_queue(pnetdev); } #ifdef CONFIG_IOCTL_CFG80211 @@ -1747,6 +1862,42 @@ int _netdev_if2_open(struct net_device *pnetdev) DBG_871X("+871x_drv - if2_open, bup=%d\n", padapter->bup); +#ifdef CONFIG_PLATFORM_INTEL_BYT + if (padapter->bup == _FALSE) + { + u8 mac[ETH_ALEN]; + + //get mac address from primary_padapter + if (primary_padapter->bup == _FALSE) + rtw_macaddr_cfg(primary_padapter->eeprompriv.mac_addr); + + _rtw_memcpy(mac, primary_padapter->eeprompriv.mac_addr, ETH_ALEN); + + if (((mac[0] == 0xff) && (mac[1] == 0xff) && (mac[2] == 0xff) && + (mac[3] == 0xff) && (mac[4] == 0xff) && (mac[5] == 0xff)) || + ((mac[0] == 0x0) && (mac[1] == 0x0) && (mac[2] == 0x0) && + (mac[3] == 0x0) && (mac[4] == 0x0) && (mac[5] == 0x0))) + { + mac[0] = 0x00; + mac[1] = 0xe0; + mac[2] = 0x4c; + mac[3] = 0x87; + mac[4] = 0x11; + mac[5] = 0x22; + } + else + { + //If the BIT1 is 0, the address is universally administered. + //If it is 1, the address is locally administered + mac[0] |= BIT(1); // locally administered + } + + _rtw_memcpy(padapter->eeprompriv.mac_addr, mac, ETH_ALEN); + rtw_init_wifidirect_addrs(padapter, padapter->eeprompriv.mac_addr, padapter->eeprompriv.mac_addr); + _rtw_memcpy(pnetdev->dev_addr, padapter->eeprompriv.mac_addr, ETH_ALEN); + } +#endif //CONFIG_PLATFORM_INTEL_BYT + if(primary_padapter->bup == _FALSE || primary_padapter->hw_init_completed == _FALSE) { _netdev_open(primary_padapter->pnetdev); @@ -1792,10 +1943,7 @@ int _netdev_if2_open(struct net_device *pnetdev) // secondary interface shares the timer with primary interface. //_set_timer(&padapter->mlmepriv.dynamic_chk_timer, 2000); - if(!rtw_netif_queue_stopped(pnetdev)) - rtw_netif_start_queue(pnetdev); - else - rtw_netif_wake_queue(pnetdev); + rtw_netif_wake_queue(pnetdev); DBG_871X("-871x_drv - if2_open, bup=%d\n", padapter->bup); return 0; @@ -1815,6 +1963,13 @@ int netdev_if2_open(struct net_device *pnetdev) { int ret; _adapter *padapter = (_adapter *)rtw_netdev_priv(pnetdev); + struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(padapter); + + if (pwrctrlpriv->bInSuspend == _TRUE) + { + DBG_871X("+871x_drv - netdev_if2_open, bInSuspend=%d\n", pwrctrlpriv->bInSuspend); + return 0; + } _enter_critical_mutex(&(adapter_to_dvobj(padapter)->hw_init_mutex), NULL); ret = _netdev_if2_open(pnetdev); @@ -1831,15 +1986,20 @@ int netdev_if2_open(struct net_device *pnetdev) static int netdev_if2_close(struct net_device *pnetdev) { _adapter *padapter = (_adapter *)rtw_netdev_priv(pnetdev); + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; padapter->net_closed = _TRUE; + pmlmepriv->LinkDetectInfo.bBusyTraffic = _FALSE; if(pnetdev) { - if (!rtw_netif_queue_stopped(pnetdev)) - rtw_netif_stop_queue(pnetdev); + rtw_netif_stop_queue(pnetdev); } +#ifdef CONFIG_P2P + rtw_p2p_enable(padapter, P2P_ROLE_DISABLE); +#endif + #ifdef CONFIG_IOCTL_CFG80211 rtw_scan_abort(padapter); adapter_wdev_data(padapter)->bandroid_scan = _FALSE; @@ -2173,10 +2333,19 @@ int _netdev_open(struct net_device *pnetdev) uint status; _adapter *padapter = (_adapter *)rtw_netdev_priv(pnetdev); struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(padapter); +#ifdef CONFIG_BT_COEXIST_SOCKET_TRX + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); +#endif //CONFIG_BT_COEXIST_SOCKET_TRX RT_TRACE(_module_os_intfs_c_,_drv_info_,("+871x_drv - dev_open\n")); DBG_871X("+871x_drv - drv_open, bup=%d\n", padapter->bup); + padapter->netif_up = _TRUE; + +#ifdef CONFIG_PLATFORM_INTEL_BYT + rtw_sdio_set_power(1); +#endif //CONFIG_PLATFORM_INTEL_BYT + if(pwrctrlpriv->ps_flag == _TRUE){ padapter->net_closed = _FALSE; goto netdev_open_normal_process; @@ -2184,6 +2353,12 @@ int _netdev_open(struct net_device *pnetdev) if(padapter->bup == _FALSE) { +#ifdef CONFIG_PLATFORM_INTEL_BYT + rtw_macaddr_cfg(padapter->eeprompriv.mac_addr); + rtw_init_wifidirect_addrs(padapter, padapter->eeprompriv.mac_addr, padapter->eeprompriv.mac_addr); + _rtw_memcpy(pnetdev->dev_addr, padapter->eeprompriv.mac_addr, ETH_ALEN); +#endif //CONFIG_PLATFORM_INTEL_BYT + padapter->bDriverStopped = _FALSE; padapter->bSurpriseRemoved = _FALSE; padapter->bCardDisableWOHSM = _FALSE; @@ -2197,10 +2372,6 @@ int _netdev_open(struct net_device *pnetdev) DBG_871X("MAC Address = "MAC_FMT"\n", MAC_ARG(pnetdev->dev_addr)); -#ifdef CONFIG_RF_GAIN_OFFSET - rtw_bb_rf_gain_offset(padapter); -#endif //CONFIG_RF_GAIN_OFFSET - status=rtw_start_drv_threads(padapter); if(status ==_FAIL) { @@ -2225,6 +2396,12 @@ int _netdev_open(struct net_device *pnetdev) padapter->bup = _TRUE; pwrctrlpriv->bips_processing = _FALSE; + +#ifdef CONFIG_PLATFORM_INTEL_BYT +#ifdef CONFIG_BT_COEXIST + rtw_btcoex_IpsNotify(padapter, IPS_NONE); +#endif // CONFIG_BT_COEXIST +#endif //CONFIG_PLATFORM_INTEL_BYT } padapter->net_closed = _FALSE; @@ -2235,15 +2412,24 @@ int _netdev_open(struct net_device *pnetdev) #endif //netif_carrier_on(pnetdev);//call this func when rtw_joinbss_event_callback return success - if(!rtw_netif_queue_stopped(pnetdev)) - rtw_netif_start_queue(pnetdev); - else - rtw_netif_wake_queue(pnetdev); + rtw_netif_wake_queue(pnetdev); #ifdef CONFIG_BR_EXT netdev_br_init(pnetdev); #endif // CONFIG_BR_EXT +#ifdef CONFIG_BT_COEXIST_SOCKET_TRX + if(is_primary_adapter(padapter) && _TRUE == pHalData->EEPROMBluetoothCoexist) + { + rtw_btcoex_init_socket(padapter); + padapter->coex_info.BtMgnt.ExtConfig.HCIExtensionVer = 0x04; + rtw_btcoex_SetHciVersion(padapter,0x04); + } + else + DBG_871X("CONFIG_BT_COEXIST: SECONDARY_ADAPTER\n"); +#endif //CONFIG_BT_COEXIST_SOCKET_TRX + + netdev_open_normal_process: #ifdef CONFIG_CONCURRENT_MODE @@ -2277,6 +2463,13 @@ int netdev_open(struct net_device *pnetdev) { int ret; _adapter *padapter = (_adapter *)rtw_netdev_priv(pnetdev); + struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(padapter); + + if (pwrctrlpriv->bInSuspend == _TRUE) + { + DBG_871X("+871x_drv - drv_open, bInSuspend=%d\n", pwrctrlpriv->bInSuspend); + return 0; + } _enter_critical_mutex(&(adapter_to_dvobj(padapter)->hw_init_mutex), NULL); ret = _netdev_open(pnetdev); @@ -2307,10 +2500,6 @@ int ips_netdrv_open(_adapter *padapter) goto netdev_open_error; } -#ifdef CONFIG_RF_GAIN_OFFSET - rtw_bb_rf_gain_offset(padapter); -#endif //CONFIG_RF_GAIN_OFFSET - if (padapter->intf_start) { padapter->intf_start(padapter); @@ -2346,7 +2535,7 @@ int rtw_ips_pwr_up(_adapter *padapter) if (psrtpriv->silent_reset_inprogress == _TRUE) #endif//#ifdef DBG_CONFIG_ERROR_DETECT #endif //defined(CONFIG_SWLPS_IN_IPS) || defined(CONFIG_FWLPS_IN_IPS) - rtw_reset_drv_sw(padapter); + rtw_reset_drv_sw(padapter); result = ips_netdrv_open(padapter); @@ -2387,12 +2576,12 @@ void rtw_ips_dev_unload(_adapter *padapter) #endif //#ifdef DBG_CONFIG_ERROR_DETECT #endif //defined(CONFIG_SWLPS_IN_IPS) || defined(CONFIG_FWLPS_IN_IPS) { - rtw_hal_set_hwreg(padapter, HW_VAR_FIFO_CLEARN_UP, 0); + rtw_hal_set_hwreg(padapter, HW_VAR_FIFO_CLEARN_UP, 0); - if (padapter->intf_stop) - { - padapter->intf_stop(padapter); - } + if (padapter->intf_stop) + { + padapter->intf_stop(padapter); + } } if(padapter->bSurpriseRemoved == _FALSE) @@ -2402,120 +2591,22 @@ void rtw_ips_dev_unload(_adapter *padapter) } -#ifdef CONFIG_RF_GAIN_OFFSET -u32 Array_kfreemap[] = { -0xf8,0xe, -0xf6,0xc, -0xf4,0xa, -0xf2,0x8, -0xf0,0x6, -0xf3,0x4, -0xf5,0x2, -0xf7,0x0, -0xf9,0x0, -0xfc,0x0, -}; - -void rtw_bb_rf_gain_offset(_adapter *padapter) -{ - u8 value = padapter->eeprompriv.EEPROMRFGainOffset; - u8 tmp = 0x3e; - u32 res,i=0; - u4Byte ArrayLen = sizeof(Array_kfreemap)/sizeof(u32); - pu4Byte Array = Array_kfreemap; - u4Byte v1=0,v2=0,target=0; - //DBG_871X("+%s value: 0x%02x+\n", __func__, value); -#if defined(CONFIG_RTL8723A) - if (value & BIT0) { - DBG_871X("Offset RF Gain.\n"); - DBG_871X("Offset RF Gain. padapter->eeprompriv.EEPROMRFGainVal=0x%x\n",padapter->eeprompriv.EEPROMRFGainVal); - if(padapter->eeprompriv.EEPROMRFGainVal != 0xff){ - res = rtw_hal_read_rfreg(padapter, RF_PATH_A, 0xd, 0xffffffff); - DBG_871X("Offset RF Gain. reg 0xd=0x%x\n",res); - res &= 0xfff87fff; - - res |= (padapter->eeprompriv.EEPROMRFGainVal & 0x0f)<< 15; - DBG_871X("Offset RF Gain. reg 0xd=0x%x\n",res); - - rtw_hal_write_rfreg(padapter, RF_PATH_A, REG_RF_BB_GAIN_OFFSET_CCK, RF_GAIN_OFFSET_MASK, res); - - res = rtw_hal_read_rfreg(padapter, RF_PATH_A, 0xe, 0xffffffff); - DBG_871X("Offset RF Gain. reg 0xe=0x%x\n",res); - res &= 0xfffffff0; - - res |= (padapter->eeprompriv.EEPROMRFGainVal & 0x0f); - DBG_871X("Offset RF Gain. reg 0xe=0x%x\n",res); - - rtw_hal_write_rfreg(padapter, RF_PATH_A, REG_RF_BB_GAIN_OFFSET_OFDM, RF_GAIN_OFFSET_MASK, res); - } - else - { - DBG_871X("Offset RF Gain. padapter->eeprompriv.EEPROMRFGainVal=0x%x != 0xff, didn't run Kfree\n",padapter->eeprompriv.EEPROMRFGainVal); - } - } else { - DBG_871X("Using the default RF gain.\n"); - } -#elif defined(CONFIG_RTL8723B) - if (value & BIT4) { - DBG_871X("Offset RF Gain.\n"); - DBG_871X("Offset RF Gain. padapter->eeprompriv.EEPROMRFGainVal=0x%x\n",padapter->eeprompriv.EEPROMRFGainVal); - if(padapter->eeprompriv.EEPROMRFGainVal != 0xff){ - res = rtw_hal_read_rfreg(padapter, RF_PATH_A, 0x7f, 0xffffffff); - res &= 0xfff87fff; - DBG_871X("Offset RF Gain. before reg 0x7f=0x%08x\n",res); - //res &= 0xfff87fff; - for (i = 0; i < ArrayLen; i += 2 ) - { - v1 = Array[i]; - v2 = Array[i+1]; - if ( v1 == padapter->eeprompriv.EEPROMRFGainVal ) - { - DBG_871X("Offset RF Gain. got v1 =0x%x ,v2 =0x%x \n",v1,v2); - target=v2; - break; - } - } - DBG_871X("padapter->eeprompriv.EEPROMRFGainVal=0x%x ,Gain offset Target Value=0x%x\n",padapter->eeprompriv.EEPROMRFGainVal,target); - PHY_SetRFReg(padapter, RF_PATH_A, REG_RF_BB_GAIN_OFFSET, BIT18|BIT17|BIT16|BIT15, target); - - //res |= (padapter->eeprompriv.EEPROMRFGainVal & 0x0f)<< 15; - //rtw_hal_write_rfreg(padapter, RF_PATH_A, REG_RF_BB_GAIN_OFFSET, RF_GAIN_OFFSET_MASK, res); - res = rtw_hal_read_rfreg(padapter, RF_PATH_A, 0x7f, 0xffffffff); - DBG_871X("Offset RF Gain. After reg 0x7f=0x%08x\n",res); - } - else - { - DBG_871X("Offset RF Gain. padapter->eeprompriv.EEPROMRFGainVal=0x%x != 0xff, didn't run Kfree\n",padapter->eeprompriv.EEPROMRFGainVal); - } - } else { - DBG_871X("Using the default RF gain.\n"); - } -#else - if (!(value & 0x01)) { - //DBG_871X("Offset RF Gain.\n"); - res = rtw_hal_read_rfreg(padapter, RF_PATH_A, REG_RF_BB_GAIN_OFFSET, 0xffffffff); - value &= tmp; - res = value << 14; - rtw_hal_write_rfreg(padapter, RF_PATH_A, REG_RF_BB_GAIN_OFFSET, RF_GAIN_OFFSET_MASK, res); - } else { - DBG_871X("Using the default RF gain.\n"); - } -#endif - -} -#endif //CONFIG_RF_GAIN_OFFSET - int pm_netdev_open(struct net_device *pnetdev,u8 bnormal) { int status = 0; + _adapter *padapter = (_adapter *)rtw_netdev_priv(pnetdev); if (_TRUE == bnormal) - status = netdev_open(pnetdev); + { + _enter_critical_mutex(&(adapter_to_dvobj(padapter)->hw_init_mutex), NULL); + status = _netdev_open(pnetdev); + _exit_critical_mutex(&(adapter_to_dvobj(padapter)->hw_init_mutex), NULL); + } #ifdef CONFIG_IPS else - status = (_SUCCESS == ips_netdrv_open((_adapter *)rtw_netdev_priv(pnetdev)))?(0):(-1); + status = (_SUCCESS == ips_netdrv_open(padapter))?(0):(-1); #endif return status; @@ -2525,9 +2616,14 @@ static int netdev_close(struct net_device *pnetdev) { _adapter *padapter = (_adapter *)rtw_netdev_priv(pnetdev); struct pwrctrl_priv *pwrctl = adapter_to_pwrctl(padapter); + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; +#ifdef CONFIG_BT_COEXIST_SOCKET_TRX + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); +#endif //CONFIG_BT_COEXIST_SOCKET_TRX RT_TRACE(_module_os_intfs_c_,_drv_info_,("+871x_drv - drv_close\n")); +#ifndef CONFIG_PLATFORM_INTEL_BYT if(pwrctl->bInternalAutoSuspend == _TRUE) { //rtw_pwr_wakeup(padapter); @@ -2535,6 +2631,8 @@ static int netdev_close(struct net_device *pnetdev) pwrctl->ps_flag = _TRUE; } padapter->net_closed = _TRUE; + padapter->netif_up = _FALSE; + pmlmepriv->LinkDetectInfo.bBusyTraffic = _FALSE; /* if(!padapter->hw_init_completed) { @@ -2551,8 +2649,7 @@ static int netdev_close(struct net_device *pnetdev) //s1. if(pnetdev) { - if (!rtw_netif_queue_stopped(pnetdev)) - rtw_netif_stop_queue(pnetdev); + rtw_netif_stop_queue(pnetdev); } #ifndef CONFIG_ANDROID @@ -2585,12 +2682,36 @@ static int netdev_close(struct net_device *pnetdev) #ifdef CONFIG_IOCTL_CFG80211 rtw_scan_abort(padapter); adapter_wdev_data(padapter)->bandroid_scan = _FALSE; - padapter->rtw_wdev->iftype = NL80211_IFTYPE_MONITOR; //set this at the end + //padapter->rtw_wdev->iftype = NL80211_IFTYPE_MONITOR; //set this at the end #endif //CONFIG_IOCTL_CFG80211 #ifdef CONFIG_WAPI_SUPPORT rtw_wapi_disable_tx(padapter); #endif +#ifdef CONFIG_BT_COEXIST_SOCKET_TRX + if(is_primary_adapter(padapter) && _TRUE == pHalData->EEPROMBluetoothCoexist) + rtw_btcoex_close_socket(padapter); + else + DBG_871X("CONFIG_BT_COEXIST: SECONDARY_ADAPTER\n"); +#endif //CONFIG_BT_COEXIST_SOCKET_TRX +#else //!CONFIG_PLATFORM_INTEL_BYT + + if (pwrctl->bInSuspend == _TRUE) + { + DBG_871X("+871x_drv - drv_close, bInSuspend=%d\n", pwrctl->bInSuspend); + return 0; + } + + rtw_scan_abort(padapter); // stop scanning process before wifi is going to down + + DBG_871X("netdev_close, bips_processing=%d\n", pwrctl->bips_processing); + while (pwrctl->bips_processing == _TRUE) // waiting for ips_processing done before call rtw_dev_unload() + rtw_msleep_os(1); + + rtw_dev_unload(padapter); + rtw_sdio_set_power(0); + +#endif //!CONFIG_PLATFORM_INTEL_BYT RT_TRACE(_module_os_intfs_c_,_drv_info_,("-871x_drv - drv_close\n")); DBG_871X("-871x_drv - drv_close, bup=%d\n", padapter->bup); @@ -2619,12 +2740,297 @@ void rtw_ndev_destructor(struct net_device *ndev) free_netdev(ndev); } +#ifdef CONFIG_ARP_KEEP_ALIVE +struct route_info { + struct in_addr dst_addr; + struct in_addr src_addr; + struct in_addr gateway; + unsigned int dev_index; +}; + +static void parse_routes(struct nlmsghdr *nl_hdr, struct route_info *rt_info) +{ + struct rtmsg *rt_msg; + struct rtattr *rt_attr; + int rt_len; + + rt_msg = (struct rtmsg *) NLMSG_DATA(nl_hdr); + if ((rt_msg->rtm_family != AF_INET) || (rt_msg->rtm_table != RT_TABLE_MAIN)) + return; + + rt_attr = (struct rtattr *) RTM_RTA(rt_msg); + rt_len = RTM_PAYLOAD(nl_hdr); + + for (; RTA_OK(rt_attr, rt_len); rt_attr = RTA_NEXT(rt_attr, rt_len)) + { + switch (rt_attr->rta_type) { + case RTA_OIF: + rt_info->dev_index = *(int *) RTA_DATA(rt_attr); + break; + case RTA_GATEWAY: + rt_info->gateway.s_addr = *(u_int *) RTA_DATA(rt_attr); + break; + case RTA_PREFSRC: + rt_info->src_addr.s_addr = *(u_int *) RTA_DATA(rt_attr); + break; + case RTA_DST: + rt_info->dst_addr.s_addr = *(u_int *) RTA_DATA(rt_attr); + break; + } + } +} + +static int route_dump(u32 *gw_addr ,int* gw_index) +{ + int err = 0; + struct socket *sock; + struct { + struct nlmsghdr nlh; + struct rtgenmsg g; + } req; + struct msghdr msg; + struct iovec iov; + struct sockaddr_nl nladdr; + mm_segment_t oldfs; + char *pg; + int size = 0; + + err = sock_create(AF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE, &sock); + if (err) + { + printk( ": Could not create a datagram socket, error = %d\n", -ENXIO); + return err; + } + + memset(&nladdr, 0, sizeof(nladdr)); + nladdr.nl_family = AF_NETLINK; + + req.nlh.nlmsg_len = sizeof(req); + req.nlh.nlmsg_type = RTM_GETROUTE; + req.nlh.nlmsg_flags = NLM_F_ROOT | NLM_F_MATCH | NLM_F_REQUEST; + req.nlh.nlmsg_pid = 0; + req.g.rtgen_family = AF_INET; + + iov.iov_base = &req; + iov.iov_len = sizeof(req); + + msg.msg_name = &nladdr; + msg.msg_namelen = sizeof(nladdr); + msg.msg_iov = &iov; + msg.msg_iovlen = 1; + msg.msg_control = NULL; + msg.msg_controllen = 0; + msg.msg_flags = MSG_DONTWAIT; + + oldfs = get_fs(); set_fs(KERNEL_DS); + err = sock_sendmsg(sock, &msg, sizeof(req)); + set_fs(oldfs); + + if (size < 0) + goto out_sock; + + pg = (char *) __get_free_page(GFP_KERNEL); + if (pg == NULL) { + err = -ENOMEM; + goto out_sock; + } + +#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) +restart: +#endif + + for (;;) + { + struct nlmsghdr *h; + + iov.iov_base = pg; + iov.iov_len = PAGE_SIZE; + + oldfs = get_fs(); set_fs(KERNEL_DS); + err = sock_recvmsg(sock, &msg, PAGE_SIZE, MSG_DONTWAIT); + set_fs(oldfs); + + if (err < 0) + goto out_sock_pg; + + if (msg.msg_flags & MSG_TRUNC) { + err = -ENOBUFS; + goto out_sock_pg; + } + + h = (struct nlmsghdr*) pg; + + while (NLMSG_OK(h, err)) + { + struct route_info rt_info; + if (h->nlmsg_type == NLMSG_DONE) { + err = 0; + goto done; + } + + if (h->nlmsg_type == NLMSG_ERROR) { + struct nlmsgerr *errm = (struct nlmsgerr*) NLMSG_DATA(h); + err = errm->error; + printk( "NLMSG error: %d\n", errm->error); + goto done; + } + + if (h->nlmsg_type == RTM_GETROUTE) + { + printk( "RTM_GETROUTE: NLMSG: %d\n", h->nlmsg_type); + } + if (h->nlmsg_type != RTM_NEWROUTE) { + printk( "NLMSG: %d\n", h->nlmsg_type); + err = -EINVAL; + goto done; + } + + memset(&rt_info, 0, sizeof(struct route_info)); + parse_routes(h, &rt_info); + if(!rt_info.dst_addr.s_addr && rt_info.gateway.s_addr && rt_info.dev_index) + { + *gw_addr = rt_info.gateway.s_addr; + *gw_index = rt_info.dev_index; + + } + h = NLMSG_NEXT(h, err); + } + + if (err) + { + printk( "!!!Remnant of size %d %d %d\n", err, h->nlmsg_len, h->nlmsg_type); + err = -EINVAL; + break; + } + } + +done: +#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) + if (!err && req.g.rtgen_family == AF_INET) { + req.g.rtgen_family = AF_INET6; + + iov.iov_base = &req; + iov.iov_len = sizeof(req); + + msg.msg_name = &nladdr; + msg.msg_namelen = sizeof(nladdr); + msg.msg_iov = &iov; + msg.msg_iovlen = 1; + msg.msg_control = NULL; + msg.msg_controllen = 0; + msg.msg_flags=MSG_DONTWAIT; + + oldfs = get_fs(); set_fs(KERNEL_DS); + err = sock_sendmsg(sock, &msg, sizeof(req)); + set_fs(oldfs); + + if (err > 0) + goto restart; + } +#endif + +out_sock_pg: + free_page((unsigned long) pg); + +out_sock: + sock_release(sock); + return err; +} + +static int arp_query(unsigned char *haddr, u32 paddr, + struct net_device *dev) +{ + struct neighbour *neighbor_entry; + int ret = 0; + + neighbor_entry = neigh_lookup(&arp_tbl, &paddr, dev); + + if (neighbor_entry != NULL) { + neighbor_entry->used = jiffies; + if (neighbor_entry->nud_state & NUD_VALID) { + _rtw_memcpy(haddr, neighbor_entry->ha, dev->addr_len); + ret = 1; + } + neigh_release(neighbor_entry); + } + return ret; +} + +static int get_defaultgw(u32 *ip_addr ,char mac[]) +{ + int gw_index = 0; // oif device index + struct net_device *gw_dev = NULL; //oif device + + route_dump(ip_addr, &gw_index); + + if( !(*ip_addr) || !gw_index ) + { + //DBG_871X("No default GW \n"); + return -1; + } + + gw_dev = dev_get_by_index(&init_net, gw_index); + + if(gw_dev == NULL) + { + //DBG_871X("get Oif Device Fail \n"); + return -1; + } + + if(!arp_query(mac, *ip_addr, gw_dev)) + { + //DBG_871X( "arp query failed\n"); + dev_put(gw_dev); + return -1; + + } + dev_put(gw_dev); + + return 0; +} + +int rtw_gw_addr_query(_adapter *padapter) +{ + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + struct pwrctrl_priv *pwrctl = adapter_to_pwrctl(padapter); + u32 gw_addr = 0; // default gw address + unsigned char gw_mac[32] = {0}; // default gw mac + int i; + int res; + + if (pwrctl->wowlan_from_cmd == _TRUE) { + DBG_871X("%s: return cuz wowlan_from_cmd\n", __func__); + return 0; + } + + res = get_defaultgw(&gw_addr, gw_mac); + if(!res) + { + pmlmepriv->gw_ip[0] = gw_addr&0xff; + pmlmepriv->gw_ip[1] = (gw_addr&0xff00)>>8; + pmlmepriv->gw_ip[2] = (gw_addr&0xff0000)>>16; + pmlmepriv->gw_ip[3] = (gw_addr&0xff000000)>>24; + _rtw_memcpy(pmlmepriv->gw_mac_addr, gw_mac, 6); + DBG_871X("%s Gateway Mac:\t" MAC_FMT "\n", __FUNCTION__, MAC_ARG(pmlmepriv->gw_mac_addr)); + DBG_871X("%s Gateway IP:\t" IP_FMT "\n", __FUNCTION__, IP_ARG(pmlmepriv->gw_ip)); + } + else + { + DBG_871X("Get Gateway IP/MAC fail!\n"); + } + + return res; +} +#endif + void rtw_dev_unload(PADAPTER padapter) { struct net_device *pnetdev = (struct net_device*)padapter->pnetdev; struct pwrctrl_priv *pwrctl = adapter_to_pwrctl(padapter); struct dvobj_priv *pobjpriv = padapter->dvobj; struct debug_priv *pdbgpriv = &pobjpriv->drv_dbg; + struct cmd_priv *pcmdpriv = &padapter->cmdpriv; + u8 cnt = 0; RT_TRACE(_module_hci_intfs_c_, _drv_notice_, ("+%s\n",__FUNCTION__)); @@ -2645,7 +3051,18 @@ void rtw_dev_unload(PADAPTER padapter) if (!pwrctl->bInternalAutoSuspend) rtw_stop_drv_threads(padapter); - + + while(ATOMIC_READ(&(pcmdpriv->cmdthd_running)) == _TRUE){ + if (cnt > 5) { + DBG_871X("stop cmdthd timeout\n"); + break; + } else { + cnt ++; + DBG_871X("cmdthd is running(%d)\n", cnt); + rtw_msleep_os(10); + } + } + RT_TRACE(_module_hci_intfs_c_, _drv_notice_, ("@ %s: stop thread complete!\n",__FUNCTION__)); //check the status of IPS @@ -2659,6 +3076,9 @@ void rtw_dev_unload(PADAPTER padapter) if (padapter->bSurpriseRemoved == _FALSE) { +#ifdef CONFIG_BT_COEXIST + rtw_btcoex_IpsNotify(padapter, pwrctl->ips_mode_req); +#endif #ifdef CONFIG_WOWLAN if (pwrctl->bSupportRemoteWakeup == _TRUE && pwrctl->wowlan_mode ==_TRUE) { @@ -2686,19 +3106,23 @@ void rtw_dev_unload(PADAPTER padapter) RT_TRACE(_module_hci_intfs_c_, _drv_notice_, ("-%s\n",__FUNCTION__)); } -#ifdef CONFIG_SUSPEND_REFINE int rtw_suspend_free_assoc_resource(_adapter *padapter) { struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct net_device *pnetdev = padapter->pnetdev; +#ifdef CONFIG_P2P struct wifidirect_info* pwdinfo = &padapter->wdinfo; +#endif // CONFIG_P2P DBG_871X("==> "FUNC_ADPT_FMT" entry....\n", FUNC_ADPT_ARG(padapter)); if (rtw_chk_roam_flags(padapter, RTW_ROAM_ON_RESUME)) { if(check_fwstate(pmlmepriv, WIFI_STATION_STATE) && check_fwstate(pmlmepriv, _FW_LINKED) - && rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) +#ifdef CONFIG_P2P + && rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE) +#endif // CONFIG_P2P + ) { DBG_871X("%s %s(" MAC_FMT "), length:%d assoc_ssid.length:%d\n",__FUNCTION__, pmlmepriv->cur_network.network.Ssid.Ssid, @@ -2729,7 +3153,7 @@ int rtw_suspend_free_assoc_resource(_adapter *padapter) #ifdef CONFIG_AUTOSUSPEND if(is_primary_adapter(padapter) && (!adapter_to_pwrctl(padapter)->bInternalAutoSuspend )) #endif - rtw_free_network_queue(padapter, _TRUE); + rtw_free_network_queue(padapter, _TRUE); if(check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)) rtw_indicate_scan_done(padapter, 1); @@ -2761,17 +3185,16 @@ int rtw_suspend_wow(_adapter *padapter) int ret = _SUCCESS; DBG_871X("==> "FUNC_ADPT_FMT" entry....\n", FUNC_ADPT_ARG(padapter)); - - if (check_fwstate(pmlmepriv, _FW_LINKED)) { - pwrpriv->wowlan_mode = _TRUE; - } else if (pwrpriv->wowlan_pno_enable == _TRUE) { - pwrpriv->wowlan_mode |= pwrpriv->wowlan_pno_enable; - } + DBG_871X("wowlan_mode: %d\n", pwrpriv->wowlan_mode); DBG_871X("wowlan_pno_enable: %d\n", pwrpriv->wowlan_pno_enable); +#ifdef CONFIG_P2P_WOWLAN + DBG_871X("wowlan_p2p_enable: %d\n", pwrpriv->wowlan_p2p_enable); +#endif if (pwrpriv->wowlan_mode == _TRUE) { + if(pnetdev) rtw_netif_stop_queue(pnetdev); #ifdef CONFIG_CONCURRENT_MODE @@ -2780,6 +3203,8 @@ int rtw_suspend_wow(_adapter *padapter) rtw_netif_stop_queue(pbuddy_netdev); } #endif//CONFIG_CONCURRENT_MODE + // 0. Power off LED + rtw_led_control(padapter, LED_CTL_POWER_OFF); // 1. stop thread padapter->bDriverStopped = _TRUE; //for stop thread rtw_stop_drv_threads(padapter); @@ -2793,15 +3218,17 @@ int rtw_suspend_wow(_adapter *padapter) } #endif // CONFIG_CONCURRENT_MODE - //#ifdef CONFIG_POWER_SAVING + //#ifdef CONFIG_LPS //rtw_set_ps_mode(padapter, PS_MODE_ACTIVE, 0, 0, "WOWLAN"); //#endif +#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) // 2. disable interrupt if (padapter->intf_stop) { padapter->intf_stop(padapter); } + #ifdef CONFIG_CONCURRENT_MODE if (rtw_buddy_adapter_up(padapter)) { //free buddy adapter's resource padapter->pbuddy_adapter->intf_stop(padapter->pbuddy_adapter); @@ -2811,6 +3238,7 @@ int rtw_suspend_wow(_adapter *padapter) // 2.1 clean interupt if (padapter->HalFunc.clear_interrupt) padapter->HalFunc.clear_interrupt(padapter); +#endif //CONFIG_SDIO_HCI // 2.2 free irq //sdio_free_irq(adapter_to_dvobj(padapter)); @@ -2850,7 +3278,7 @@ int rtw_suspend_wow(_adapter *padapter) } if (rtw_get_ch_setting_union(padapter, &ch, &bw, &offset) != 0) { - DBG_871X(FUNC_ADPT_FMT" back to linked union - ch:%u, bw:%u, offset:%u\n", + DBG_871X(FUNC_ADPT_FMT" back to linked/linking union - ch:%u, bw:%u, offset:%u\n", FUNC_ADPT_ARG(padapter), ch, bw, offset); set_channel_bwmode(padapter, ch, offset, bw); } @@ -2859,56 +3287,23 @@ int rtw_suspend_wow(_adapter *padapter) rtw_suspend_free_assoc_resource(padapter->pbuddy_adapter); } #endif - - #ifdef CONFIG_POWER_SAVING - if(pwrpriv->wowlan_pno_enable) - DBG_871X_LEVEL(_drv_always_, "%s: pno: %d\n", __func__, pwrpriv->wowlan_pno_enable); + + if(pwrpriv->wowlan_pno_enable) { + DBG_871X_LEVEL(_drv_always_, "%s: pno: %d\n", __func__, + pwrpriv->wowlan_pno_enable); +#ifdef CONFIG_FWLPS_IN_IPS + rtw_set_fw_in_ips_mode(padapter, _TRUE); +#endif + } + #ifdef CONFIG_LPS else rtw_set_ps_mode(padapter, PS_MODE_DTIM, 0, 0, "WOWLAN"); - #endif + #endif //#ifdef CONFIG_LPS } else { - if(pnetdev){ - netif_carrier_off(pnetdev); - rtw_netif_stop_queue(pnetdev); - } - #ifdef CONFIG_CONCURRENT_MODE - if(pbuddy_netdev){ - netif_carrier_off(pbuddy_netdev); - rtw_netif_stop_queue(pbuddy_netdev); - } - #endif//CONFIG_CONCURRENT_MODE - - rtw_suspend_free_assoc_resource(padapter); - - #ifdef CONFIG_CONCURRENT_MODE - if(rtw_buddy_adapter_up(padapter)){ - rtw_suspend_free_assoc_resource(padapter->pbuddy_adapter); - } - #endif//CONFIG_CONCURRENT_MODE - rtw_led_control(padapter, LED_CTL_POWER_OFF); - - - if ((rtw_hal_check_ips_status(padapter) == _TRUE) - || (adapter_to_pwrctl(padapter)->rf_pwrstate == rf_off)) - { - DBG_871X_LEVEL(_drv_always_, "%s: ### ERROR #### driver in IPS ####ERROR###!!!\n", __FUNCTION__); - - } - - - #ifdef CONFIG_CONCURRENT_MODE - if(rtw_buddy_adapter_up(padapter)){ - rtw_dev_unload(padapter->pbuddy_adapter); - } - #endif - rtw_dev_unload(padapter); - - //sdio_deinit(adapter_to_dvobj(padapter)); - if(padapter->intf_deinit) - padapter->intf_deinit(adapter_to_dvobj(padapter)); + DBG_871X_LEVEL(_drv_always_, "%s: ### ERROR ### wowlan_mode=%d\n", __FUNCTION__, pwrpriv->wowlan_mode); } DBG_871X("<== "FUNC_ADPT_FMT" exit....\n", FUNC_ADPT_ARG(padapter)); return ret; @@ -2923,9 +3318,9 @@ int rtw_suspend_ap_wow(_adapter *padapter) struct net_device *pnetdev = padapter->pnetdev; #ifdef CONFIG_CONCURRENT_MODE struct net_device *pbuddy_netdev; - #endif + #endif struct dvobj_priv *psdpriv = padapter->dvobj; - struct debug_priv *pdbgpriv = &psdpriv->drv_dbg; + struct debug_priv *pdbgpriv = &psdpriv->drv_dbg; struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); struct wowlan_ioctl_param poidparam; u8 ps_mode; @@ -2938,7 +3333,7 @@ int rtw_suspend_ap_wow(_adapter *padapter) DBG_871X("wowlan_ap_mode: %d\n", pwrpriv->wowlan_ap_mode); if(pnetdev) - rtw_netif_stop_queue(pnetdev); + rtw_netif_stop_queue(pnetdev); #ifdef CONFIG_CONCURRENT_MODE if (rtw_buddy_adapter_up(padapter)) { pbuddy_netdev = padapter->pbuddy_adapter->pnetdev; @@ -2946,6 +3341,8 @@ int rtw_suspend_ap_wow(_adapter *padapter) rtw_netif_stop_queue(pbuddy_netdev); } #endif//CONFIG_CONCURRENT_MODE + // 0. Power off LED + rtw_led_control(padapter, LED_CTL_POWER_OFF); // 1. stop thread padapter->bDriverStopped = _TRUE; //for stop thread rtw_stop_drv_threads(padapter); @@ -2958,11 +3355,12 @@ int rtw_suspend_ap_wow(_adapter *padapter) padapter->pbuddy_adapter->bDriverStopped = _FALSE; //for 32k command } #endif // CONFIG_CONCURRENT_MODE - - //#ifdef CONFIG_POWER_SAVING + + //#ifdef CONFIG_LPS //rtw_set_ps_mode(padapter, PS_MODE_ACTIVE, 0, 0, "WOWLAN"); //#endif +#ifdef CONFIG_SDIO_HCI // 2. disable interrupt rtw_hal_disable_interrupt(padapter); // It need wait for leaving 32K. @@ -2975,6 +3373,7 @@ int rtw_suspend_ap_wow(_adapter *padapter) // 2.1 clean interupt if (padapter->HalFunc.clear_interrupt) padapter->HalFunc.clear_interrupt(padapter); +#endif //CONFIG_SDIO_HCI // 2.2 free irq //sdio_free_irq(adapter_to_dvobj(padapter)); @@ -2986,25 +3385,25 @@ int rtw_suspend_ap_wow(_adapter *padapter) DBG_871X(" ### PORT SWITCH ### \n"); rtw_hal_set_hwreg(padapter, HW_VAR_PORT_SWITCH, NULL); } - #endif - + #endif + poidparam.subcode = WOWLAN_AP_ENABLE; padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_AP_WOWLAN,(u8 *)&poidparam); DBG_871X_LEVEL(_drv_always_, "%s: wowmode suspending\n", __func__); - + #ifdef CONFIG_CONCURRENT_MODE if (check_buddy_fwstate(padapter, WIFI_AP_STATE) == _TRUE) { if (rtw_get_ch_setting_union(padapter->pbuddy_adapter, &ch, &bw, &offset) != 0) { - DBG_871X(FUNC_ADPT_FMT" back to linked union - ch:%u, bw:%u, offset:%u\n", + DBG_871X(FUNC_ADPT_FMT" back to linked/linking union - ch:%u, bw:%u, offset:%u\n", FUNC_ADPT_ARG(padapter->pbuddy_adapter), ch, bw, offset); set_channel_bwmode(padapter->pbuddy_adapter, ch, offset, bw); } rtw_suspend_free_assoc_resource(padapter); } else { if (rtw_get_ch_setting_union(padapter, &ch, &bw, &offset) != 0) { - DBG_871X(FUNC_ADPT_FMT" back to linked union - ch:%u, bw:%u, offset:%u\n", + DBG_871X(FUNC_ADPT_FMT" back to linked/linking union - ch:%u, bw:%u, offset:%u\n", FUNC_ADPT_ARG(padapter), ch, bw, offset); set_channel_bwmode(padapter, ch, offset, bw); } @@ -3012,17 +3411,17 @@ int rtw_suspend_ap_wow(_adapter *padapter) } #else if (rtw_get_ch_setting_union(padapter, &ch, &bw, &offset) != 0) { - DBG_871X(FUNC_ADPT_FMT" back to linked union - ch:%u, bw:%u, offset:%u\n", + DBG_871X(FUNC_ADPT_FMT" back to linked/linking union - ch:%u, bw:%u, offset:%u\n", FUNC_ADPT_ARG(padapter), ch, bw, offset); set_channel_bwmode(padapter, ch, offset, bw); } #endif -#ifdef CONFIG_POWER_SAVING + #ifdef CONFIG_LPS rtw_set_ps_mode(padapter, PS_MODE_MIN, 0, 0, "AP-WOWLAN"); #endif - #endif + DBG_871X("<== "FUNC_ADPT_FMT" exit....\n", FUNC_ADPT_ARG(padapter)); return ret; @@ -3061,6 +3460,14 @@ int rtw_suspend_normal(_adapter *padapter) } #endif rtw_led_control(padapter, LED_CTL_POWER_OFF); + + if ((rtw_hal_check_ips_status(padapter) == _TRUE) + || (adapter_to_pwrctl(padapter)->rf_pwrstate == rf_off)) + { + DBG_871X_LEVEL(_drv_always_, "%s: ### ERROR #### driver in IPS ####ERROR###!!!\n", __FUNCTION__); + + } + #ifdef CONFIG_CONCURRENT_MODE if(rtw_buddy_adapter_up(padapter)){ rtw_dev_unload(padapter->pbuddy_adapter); @@ -3088,6 +3495,7 @@ int rtw_suspend_common(_adapter *padapter) DBG_871X_LEVEL(_drv_always_, " suspend start\n"); DBG_871X("==> %s (%s:%d)\n",__FUNCTION__, current->comm, current->pid); + pdbgpriv->dbg_suspend_cnt++; pwrpriv->bInSuspend = _TRUE; @@ -3148,8 +3556,27 @@ int rtw_suspend_common(_adapter *padapter) #endif ) { #ifdef CONFIG_WOWLAN - rtw_suspend_wow(padapter); - #else + if (check_fwstate(pmlmepriv, _FW_LINKED)) { + pwrpriv->wowlan_mode = _TRUE; + } else if (pwrpriv->wowlan_pno_enable == _TRUE) { + pwrpriv->wowlan_mode |= pwrpriv->wowlan_pno_enable; + } + + #ifdef CONFIG_P2P_WOWLAN + if(!rtw_p2p_chk_state(&padapter->wdinfo, P2P_STATE_NONE) || P2P_ROLE_DISABLE != padapter->wdinfo.role) + { + pwrpriv->wowlan_p2p_mode = _TRUE; + } + if(_TRUE == pwrpriv->wowlan_p2p_mode) + pwrpriv->wowlan_mode |= pwrpriv->wowlan_p2p_mode; + #endif //CONFIG_P2P_WOWLAN + + if (pwrpriv->wowlan_mode == _TRUE) + rtw_suspend_wow(padapter); + else + rtw_suspend_normal(padapter); + + #else //CONFIG_WOWLAN rtw_suspend_normal(padapter); #endif //CONFIG_WOWLAN } else if (check_fwstate(pmlmepriv,WIFI_AP_STATE) == _TRUE @@ -3175,6 +3602,7 @@ int rtw_suspend_common(_adapter *padapter) rtw_suspend_normal(padapter); } + DBG_871X_LEVEL(_drv_always_, "rtw suspend success in %d ms\n", rtw_get_passing_time_ms(start_time)); @@ -3189,6 +3617,8 @@ int rtw_suspend_common(_adapter *padapter) int rtw_resume_process_wow(_adapter *padapter) { struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); struct net_device *pnetdev = padapter->pnetdev; #ifdef CONFIG_CONCURRENT_MODE struct net_device *pbuddy_netdev; @@ -3212,23 +3642,43 @@ _func_enter_; goto exit; } + if (padapter->bDriverStopped || padapter->bSurpriseRemoved) { + DBG_871X("%s pdapter %p bDriverStopped %d bSurpriseRemoved %d\n", + __FUNCTION__, padapter, padapter->bDriverStopped, + padapter->bSurpriseRemoved); + goto exit; + } + #ifdef CONFIG_PNO_SUPPORT pwrpriv->pno_in_resume = _TRUE; -#endif +#ifdef CONFIG_FWLPS_IN_IPS + if(pwrpriv->wowlan_pno_enable) + rtw_set_fw_in_ips_mode(padapter, _FALSE); +#endif //CONFIG_FWLPS_IN_IPS +#endif//CONFIG_PNO_SUPPORT if (pwrpriv->wowlan_mode == _TRUE){ -#ifdef CONFIG_POWER_SAVING #ifdef CONFIG_LPS rtw_set_ps_mode(padapter, PS_MODE_ACTIVE, 0, 0, "WOWLAN"); #endif //CONFIG_LPS -#endif + pwrpriv->bFwCurrentInPSMode = _FALSE; - rtw_hal_disable_interrupt(padapter); +#ifdef CONFIG_SDIO_HCI + if (padapter->intf_stop) { + padapter->intf_stop(padapter); + } + + #ifdef CONFIG_CONCURRENT_MODE + if (rtw_buddy_adapter_up(padapter)) { //free buddy adapter's resource + padapter->pbuddy_adapter->intf_stop(padapter->pbuddy_adapter); + } + #endif if (padapter->HalFunc.clear_interrupt) padapter->HalFunc.clear_interrupt(padapter); - +#endif //CONFIG_SDIO_HCI + //if (sdio_alloc_irq(adapter_to_dvobj(padapter)) != _SUCCESS) { if((padapter->intf_alloc_irq) && (padapter->intf_alloc_irq(adapter_to_dvobj(padapter)) != _SUCCESS)){ ret = -1; @@ -3284,64 +3734,12 @@ _func_enter_; // start netif queue if (pnetdev) { - if(!rtw_netif_queue_stopped(pnetdev)) - rtw_netif_start_queue(pnetdev); - else - rtw_netif_wake_queue(pnetdev); + rtw_netif_wake_queue(pnetdev); } } else{ - // interface init - //if (sdio_init(adapter_to_dvobj(padapter)) != _SUCCESS) - if ((padapter->intf_init) &&(padapter->intf_init(adapter_to_dvobj(padapter)) != _SUCCESS)) - { - ret = -1; - RT_TRACE(_module_hci_intfs_c_, _drv_err_, ("%s: initialize SDIO Failed!!\n", __FUNCTION__)); - goto exit; - } - - rtw_hal_disable_interrupt(padapter); - - if (padapter->HalFunc.clear_interrupt) - padapter->HalFunc.clear_interrupt(padapter); - - //if (sdio_alloc_irq(adapter_to_dvobj(padapter)) != _SUCCESS) - if ((padapter->intf_alloc_irq)&&(padapter->intf_alloc_irq(adapter_to_dvobj(padapter)) != _SUCCESS)) - { - ret = -1; - RT_TRACE(_module_hci_intfs_c_, _drv_err_, ("%s: sdio_alloc_irq Failed!!\n", __FUNCTION__)); - goto exit; - } - - rtw_reset_drv_sw(padapter); - #ifdef CONFIG_CONCURRENT_MODE - rtw_reset_drv_sw(padapter->pbuddy_adapter); - #endif - pwrpriv->bkeepfwalive = _FALSE; - - DBG_871X("bkeepfwalive(%x)\n",pwrpriv->bkeepfwalive); - - if(pm_netdev_close(pnetdev, _TRUE) == 0) { - DBG_871X("netdev_close success\n"); - } - - if(pm_netdev_open(pnetdev,_TRUE) != 0) { - ret = -1; - pdbgpriv->dbg_resume_error_cnt++; - goto exit; - } - - netif_device_attach(pnetdev); - netif_carrier_on(pnetdev); - - #ifdef CONFIG_CONCURRENT_MODE - if(rtw_buddy_adapter_up(padapter)){ - pbuddy_netdev = padapter->pbuddy_adapter->pnetdev; - netif_device_attach(pbuddy_netdev); - netif_carrier_on(pbuddy_netdev); - } - #endif + DBG_871X_LEVEL(_drv_always_, "%s: ### ERROR ### wowlan_mode=%d\n", __FUNCTION__, pwrpriv->wowlan_mode); } if( padapter->pid[1]!=0) { @@ -3357,26 +3755,38 @@ _func_enter_; DBG_871X("%s: disconnect reason: %02x\n", __func__, pwrpriv->wowlan_wake_reason); rtw_indicate_disconnect(padapter); - rtw_sta_media_status_rpt(padapter, rtw_get_stainfo(&padapter->stapriv, get_bssid(&padapter->mlmepriv)), 0); + + rtw_sta_media_status_rpt(padapter, + rtw_get_stainfo(&padapter->stapriv, + get_bssid(&padapter->mlmepriv)), 0); + rtw_free_assoc_resources(padapter, 1); + pmlmeinfo->state = WIFI_FW_NULL_STATE; + } else { DBG_871X("%s: do roaming\n", __func__); rtw_roaming(padapter, NULL); } } - #ifdef CONFIG_RESUME_IN_WORKQUEUE - rtw_unlock_suspend(); - #endif //CONFIG_RESUME_IN_WORKQUEUE - + if (pwrpriv->wowlan_wake_reason == FWDecisionDisconnect) { + rtw_lock_ext_suspend_timeout(2000); + } if (pwrpriv->wowlan_wake_reason == Rx_GTK || pwrpriv->wowlan_wake_reason == Rx_DisAssoc || - pwrpriv->wowlan_wake_reason == Rx_DeAuth || - pwrpriv->wowlan_wake_reason == RX_PNOWakeUp) { + pwrpriv->wowlan_wake_reason == Rx_DeAuth) { rtw_lock_ext_suspend_timeout(8000); } + if (pwrpriv->wowlan_wake_reason == RX_PNOWakeUp) { +#ifdef CONFIG_IOCTL_CFG80211 + cfg80211_disconnected(padapter->pnetdev, 0, NULL, 0, + GFP_ATOMIC); +#endif + rtw_lock_ext_suspend_timeout(10000); + } + if (pwrpriv->wowlan_mode == _TRUE) { pwrpriv->bips_processing = _FALSE; _set_timer(&padapter->mlmepriv.dynamic_chk_timer, 2000); @@ -3389,8 +3799,18 @@ _func_enter_; pwrpriv->wowlan_mode =_FALSE; + // Power On LED + rtw_hal_sw_led_init(padapter); + if(pwrpriv->wowlan_wake_reason == Rx_DisAssoc || + pwrpriv->wowlan_wake_reason == Rx_DeAuth || + pwrpriv->wowlan_wake_reason == FWDecisionDisconnect) + rtw_led_control(padapter, LED_CTL_NO_LINK); + else + rtw_led_control(padapter, LED_CTL_LINK); + //clean driver side wake up reason. pwrpriv->wowlan_wake_reason = 0; + exit: DBG_871X("<== "FUNC_ADPT_FMT" exit....\n", FUNC_ADPT_ARG(padapter)); _func_exit_; @@ -3426,11 +3846,11 @@ _func_enter_; goto exit; } -#ifdef CONFIG_POWER_SAVING + #ifdef CONFIG_LPS rtw_set_ps_mode(padapter, PS_MODE_ACTIVE, 0, 0, "AP-WOWLAN"); #endif //CONFIG_LPS -#endif + pwrpriv->bFwCurrentInPSMode = _FALSE; rtw_hal_disable_interrupt(padapter); @@ -3468,19 +3888,19 @@ _func_enter_; #ifdef CONFIG_CONCURRENT_MODE if (rtw_buddy_adapter_up(padapter)) { if (rtw_get_ch_setting_union(padapter->pbuddy_adapter, &ch, &bw, &offset) != 0) { - DBG_871X(FUNC_ADPT_FMT" back to linked union - ch:%u, bw:%u, offset:%u\n", + DBG_871X(FUNC_ADPT_FMT" back to linked/linking union - ch:%u, bw:%u, offset:%u\n", FUNC_ADPT_ARG(padapter->pbuddy_adapter), ch, bw, offset); set_channel_bwmode(padapter->pbuddy_adapter, ch, offset, bw); } } else { - DBG_871X(FUNC_ADPT_FMT" back to linked union - ch:%u, bw:%u, offset:%u\n", + DBG_871X(FUNC_ADPT_FMT" back to linked/linking union - ch:%u, bw:%u, offset:%u\n", FUNC_ADPT_ARG(padapter), ch, bw, offset); set_channel_bwmode(padapter, ch, offset, bw); rtw_reset_drv_sw(padapter->pbuddy_adapter); } #else if (rtw_get_ch_setting_union(padapter, &ch, &bw, &offset) != 0) { - DBG_871X(FUNC_ADPT_FMT" back to linked union - ch:%u, bw:%u, offset:%u\n", + DBG_871X(FUNC_ADPT_FMT" back to linked/linking union - ch:%u, bw:%u, offset:%u\n", FUNC_ADPT_ARG(padapter), ch, bw, offset); set_channel_bwmode(padapter, ch, offset, bw); } @@ -3500,20 +3920,14 @@ _func_enter_; if (rtw_buddy_adapter_up(padapter)) { pbuddy_netdev = padapter->pbuddy_adapter->pnetdev; if(pbuddy_netdev){ - if (!rtw_netif_queue_stopped(pbuddy_netdev)) - rtw_netif_start_queue(pbuddy_netdev); - else - rtw_netif_wake_queue(pbuddy_netdev); + rtw_netif_wake_queue(pbuddy_netdev); } } #endif // start netif queue if (pnetdev) { - if(!rtw_netif_queue_stopped(pnetdev)) - rtw_netif_start_queue(pnetdev); - else - rtw_netif_wake_queue(pnetdev); + rtw_netif_wake_queue(pnetdev); } if( padapter->pid[1]!=0) { @@ -3522,7 +3936,7 @@ _func_enter_; } #ifdef CONFIG_RESUME_IN_WORKQUEUE - rtw_unlock_suspend(); + //rtw_unlock_suspend(); #endif //CONFIG_RESUME_IN_WORKQUEUE if (pwrpriv->wowlan_wake_reason == AP_WakeUp) @@ -3535,6 +3949,10 @@ _func_enter_; #endif //clean driver side wake up reason. pwrpriv->wowlan_wake_reason = 0; + + // Power On LED + rtw_hal_sw_led_init(padapter); + rtw_led_control(padapter, LED_CTL_LINK); exit: DBG_871X("<== "FUNC_ADPT_FMT" exit....\n", FUNC_ADPT_ARG(padapter)); _func_exit_; @@ -3544,27 +3962,30 @@ _func_exit_; int rtw_resume_process_normal(_adapter *padapter) { - struct net_device *pnetdev = padapter->pnetdev; + struct net_device *pnetdev; #ifdef CONFIG_CONCURRENT_MODE struct net_device *pbuddy_netdev; #endif - struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - struct dvobj_priv *psdpriv = padapter->dvobj; - struct debug_priv *pdbgpriv = &psdpriv->drv_dbg; + struct pwrctrl_priv *pwrpriv; + struct mlme_priv *pmlmepriv; + struct dvobj_priv *psdpriv; + struct debug_priv *pdbgpriv; int ret = _SUCCESS; _func_enter_; - DBG_871X("==> "FUNC_ADPT_FMT" entry....\n", FUNC_ADPT_ARG(padapter)); - if (padapter) { - pnetdev = padapter->pnetdev; - pwrpriv = adapter_to_pwrctl(padapter); - } else { - pdbgpriv->dbg_resume_error_cnt++; + + if (!padapter) { ret = -1; goto exit; } + pnetdev = padapter->pnetdev; + pwrpriv = adapter_to_pwrctl(padapter); + pmlmepriv = &padapter->mlmepriv; + psdpriv = padapter->dvobj; + pdbgpriv = &psdpriv->drv_dbg; + + DBG_871X("==> "FUNC_ADPT_FMT" entry....\n", FUNC_ADPT_ARG(padapter)); // interface init //if (sdio_init(adapter_to_dvobj(padapter)) != _SUCCESS) if((padapter->intf_init)&& (padapter->intf_init(adapter_to_dvobj(padapter)) != _SUCCESS)) @@ -3633,32 +4054,33 @@ _func_enter_; #ifdef CONFIG_CONCURRENT_MODE if(rtw_buddy_adapter_up(padapter)) { - pmlmepriv = &padapter->pbuddy_adapter->mlmepriv; - if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) { - DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - WIFI_STATION_STATE\n", FUNC_ADPT_ARG(padapter), get_fwstate(pmlmepriv)); + _adapter *buddy = padapter->pbuddy_adapter; + struct mlme_priv *buddy_mlme = &padapter->pbuddy_adapter->mlmepriv; + if (check_fwstate(buddy_mlme, WIFI_STATION_STATE)) { + DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - WIFI_STATION_STATE\n", FUNC_ADPT_ARG(buddy), get_fwstate(buddy_mlme)); - if (rtw_chk_roam_flags(padapter->pbuddy_adapter, RTW_ROAM_ON_RESUME)) - rtw_roaming(padapter->pbuddy_adapter, NULL); + if (rtw_chk_roam_flags(buddy, RTW_ROAM_ON_RESUME)) + rtw_roaming(buddy, NULL); - } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { - DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - WIFI_AP_STATE\n", FUNC_ADPT_ARG(padapter), get_fwstate(pmlmepriv)); - rtw_ap_restore_network(padapter->pbuddy_adapter); - } else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) { - DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - WIFI_ADHOC_STATE\n", FUNC_ADPT_ARG(padapter), get_fwstate(pmlmepriv)); + } else if (check_fwstate(buddy_mlme, WIFI_AP_STATE)) { + DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - WIFI_AP_STATE\n", FUNC_ADPT_ARG(buddy), get_fwstate(buddy_mlme)); + rtw_ap_restore_network(buddy); + } else if (check_fwstate(buddy_mlme, WIFI_ADHOC_STATE)) { + DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - WIFI_ADHOC_STATE\n", FUNC_ADPT_ARG(buddy), get_fwstate(buddy_mlme)); } else { - DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - ???\n", FUNC_ADPT_ARG(padapter), get_fwstate(pmlmepriv)); + DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - ???\n", FUNC_ADPT_ARG(buddy), get_fwstate(buddy_mlme)); } } #endif #ifdef CONFIG_RESUME_IN_WORKQUEUE - rtw_unlock_suspend(); + //rtw_unlock_suspend(); #endif //CONFIG_RESUME_IN_WORKQUEUE - -exit: DBG_871X("<== "FUNC_ADPT_FMT" exit....\n", FUNC_ADPT_ARG(padapter)); + +exit: _func_exit_; - return ret; + return ret; } int rtw_resume_common(_adapter *padapter) @@ -3670,6 +4092,9 @@ int rtw_resume_common(_adapter *padapter) _func_enter_; + if (pwrpriv->bInSuspend == _FALSE) + return 0; + DBG_871X_LEVEL(_drv_always_, "resume start\n"); DBG_871X("==> %s (%s:%d)\n",__FUNCTION__, current->comm, current->pid); @@ -3679,7 +4104,10 @@ int rtw_resume_common(_adapter *padapter) #endif ) { #ifdef CONFIG_WOWLAN - rtw_resume_process_wow(padapter); + if (pwrpriv->wowlan_mode == _TRUE) + rtw_resume_process_wow(padapter); + else + rtw_resume_process_normal(padapter); #else rtw_resume_process_normal(padapter); #endif @@ -3724,6 +4152,43 @@ int rtw_resume_common(_adapter *padapter) return ret; } -#endif +#ifdef CONFIG_GPIO_API +u8 rtw_get_gpio(struct net_device *netdev, u8 gpio_num) +{ + _adapter *adapter = (_adapter *)rtw_netdev_priv(netdev); + return rtw_hal_get_gpio(adapter, gpio_num); +} +EXPORT_SYMBOL(rtw_get_gpio); + +int rtw_set_gpio_output_value(struct net_device *netdev, u8 gpio_num, bool isHigh) +{ + u8 direction = 0; + u8 res = -1; + _adapter *adapter = (_adapter *)rtw_netdev_priv(netdev); + return rtw_hal_set_gpio_output_value(adapter, gpio_num,isHigh); +} +EXPORT_SYMBOL(rtw_set_gpio_output_value); + +int rtw_config_gpio(struct net_device *netdev, u8 gpio_num, bool isOutput) +{ + _adapter *adapter = (_adapter *)rtw_netdev_priv(netdev); + return rtw_hal_config_gpio(adapter,gpio_num,isOutput); +} +EXPORT_SYMBOL(rtw_config_gpio); +int rtw_register_gpio_interrupt(struct net_device *netdev, int gpio_num, void(*callback)(u8 level)) +{ + _adapter *adapter = (_adapter *)rtw_netdev_priv(netdev); + return rtw_hal_register_gpio_interrupt(adapter,gpio_num,callback); +} +EXPORT_SYMBOL(rtw_register_gpio_interrupt); + +int rtw_disable_gpio_interrupt(struct net_device *netdev, int gpio_num) +{ + _adapter *adapter = (_adapter *)rtw_netdev_priv(netdev); + return rtw_hal_disable_gpio_interrupt(adapter,gpio_num); +} +EXPORT_SYMBOL(rtw_disable_gpio_interrupt); + +#endif //#ifdef CONFIG_GPIO_API diff --git a/backports/drivers/realtek/rtl8812au/os_dep/linux/recv_linux.c b/backports/drivers/realtek/rtl8812au/os_dep/linux/recv_linux.c index 2f965d2b3433e5..1204a23165b88a 100755 --- a/backports/drivers/realtek/rtl8812au/os_dep/linux/recv_linux.c +++ b/backports/drivers/realtek/rtl8812au/os_dep/linux/recv_linux.c @@ -183,8 +183,6 @@ int rtw_os_recvbuf_resource_alloc(_adapter *padapter, struct recv_buf *precvbuf) precvbuf->pskb = NULL; - precvbuf->reuse = _FALSE; - precvbuf->pallocated_buf = precvbuf->pbuf = NULL; precvbuf->pdata = precvbuf->phead = precvbuf->ptail = precvbuf->pend = NULL; @@ -233,9 +231,12 @@ int rtw_os_recvbuf_resource_free(_adapter *padapter, struct recv_buf *precvbuf) if(precvbuf->pskb) + { +#ifdef CONFIG_PREALLOC_RX_SKB_BUFFER + if(rtw_free_skb_premem(precvbuf->pskb)!=0) +#endif rtw_skb_free(precvbuf->pskb); - - + } return ret; } @@ -299,9 +300,11 @@ _pkt *rtw_os_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_Length, u8 void rtw_os_recv_indicate_pkt(_adapter *padapter, _pkt *pkt, struct rx_pkt_attrib *pattrib) { struct mlme_priv*pmlmepriv = &padapter->mlmepriv; + struct recv_priv *precvpriv = &(padapter->recvpriv); #ifdef CONFIG_BR_EXT void *br_port = NULL; #endif + int ret; /* Indicat the packets to upper layer */ if (pkt) { @@ -342,7 +345,9 @@ void rtw_os_recv_indicate_pkt(_adapter *padapter, _pkt *pkt, struct rx_pkt_attri if(bmcast && (pskb2 != NULL) ) { pkt = pskb2; + DBG_COUNTER(padapter->rx_logs.os_indicate_ap_mcast); } else { + DBG_COUNTER(padapter->rx_logs.os_indicate_ap_forward); return; } } @@ -350,6 +355,7 @@ void rtw_os_recv_indicate_pkt(_adapter *padapter, _pkt *pkt, struct rx_pkt_attri else// to APself { //DBG_871X("to APSelf\n"); + DBG_COUNTER(padapter->rx_logs.os_indicate_ap_self); } } @@ -381,7 +387,8 @@ void rtw_os_recv_indicate_pkt(_adapter *padapter, _pkt *pkt, struct rx_pkt_attri } } #endif // CONFIG_BR_EXT - + if( precvpriv->sink_udpport > 0) + rtw_sink_rtp_seq_dbg(padapter,pkt); pkt->protocol = eth_type_trans(pkt, padapter->pnetdev); pkt->dev = padapter->pnetdev; @@ -395,7 +402,12 @@ void rtw_os_recv_indicate_pkt(_adapter *padapter, _pkt *pkt, struct rx_pkt_attri pkt->ip_summed = CHECKSUM_NONE; #endif //CONFIG_TCP_CSUM_OFFLOAD_RX - rtw_netif_rx(padapter->pnetdev, pkt); + ret = rtw_netif_rx(padapter->pnetdev, pkt); + if (ret == NET_RX_SUCCESS) { + DBG_COUNTER(padapter->rx_logs.os_netif_ok); + } else { + DBG_COUNTER(padapter->rx_logs.os_netif_err); + } } } @@ -552,16 +564,65 @@ static void rtw_os_ksocket_send(_adapter *padapter, union recv_frame *precv_fram } #endif //CONFIG_AUTO_AP_MODE +int rtw_recv_monitor(_adapter *padapter, union recv_frame *precv_frame) +{ + int ret = _FAIL; + struct recv_priv *precvpriv; + _queue *pfree_recv_queue; + _pkt *skb; + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + struct rx_pkt_attrib *pattrib; + + if (NULL == precv_frame) + goto _recv_drop; + + pattrib = &precv_frame->u.hdr.attrib; + precvpriv = &(padapter->recvpriv); + pfree_recv_queue = &(precvpriv->free_recv_queue); + + skb = precv_frame->u.hdr.pkt; + if (skb == NULL) { + DBG_871X("%s :skb==NULL something wrong!!!!\n", __func__); + goto _recv_drop; + } + + skb->data = precv_frame->u.hdr.rx_data; + skb_set_tail_pointer(skb, precv_frame->u.hdr.len); + skb->len = precv_frame->u.hdr.len; + skb->ip_summed = CHECKSUM_NONE; + skb->pkt_type = PACKET_OTHERHOST; + skb->protocol = htons(0x0019); /* ETH_P_80211_RAW */ + + rtw_netif_rx(padapter->pnetdev, skb); + + /* pointers to NULL before rtw_free_recvframe() */ + precv_frame->u.hdr.pkt = NULL; + + ret = _SUCCESS; + +_recv_drop: + + /* enqueue back to free_recv_queue */ + if (precv_frame) + rtw_free_recvframe(precv_frame, pfree_recv_queue); + + return ret; + +} + int rtw_recv_indicatepkt(_adapter *padapter, union recv_frame *precv_frame) { struct recv_priv *precvpriv; _queue *pfree_recv_queue; _pkt *skb; struct mlme_priv*pmlmepriv = &padapter->mlmepriv; - struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib; - -_func_enter_; + struct rx_pkt_attrib *pattrib; + + if(NULL == precv_frame) + goto _recv_indicatepkt_drop; + DBG_COUNTER(padapter->rx_logs.os_indicate); + pattrib = &precv_frame->u.hdr.attrib; precvpriv = &(padapter->recvpriv); pfree_recv_queue = &(precvpriv->free_recv_queue); @@ -629,7 +690,6 @@ _func_enter_; RT_TRACE(_module_recv_osdep_c_,_drv_info_,("\n rtw_recv_indicatepkt :after rtw_os_recv_indicate_pkt!!!!\n")); -_func_exit_; return _SUCCESS; @@ -639,9 +699,9 @@ _func_exit_; if(precv_frame) rtw_free_recvframe(precv_frame, pfree_recv_queue); - return _FAIL; + DBG_COUNTER(padapter->rx_logs.os_indicate_err); -_func_exit_; + return _FAIL; } @@ -657,7 +717,6 @@ void rtw_os_read_port(_adapter *padapter, struct recv_buf *precvbuf) rtw_skb_free(precvbuf->pskb); precvbuf->pskb = NULL; - precvbuf->reuse = _FALSE; if(precvbuf->irp_pending == _FALSE) { diff --git a/backports/drivers/realtek/rtl8812au/os_dep/linux/rtw_android.c b/backports/drivers/realtek/rtl8812au/os_dep/linux/rtw_android.c index 8f215868bbc7b4..f9ce0217173a7a 100755 --- a/backports/drivers/realtek/rtl8812au/os_dep/linux/rtw_android.c +++ b/backports/drivers/realtek/rtl8812au/os_dep/linux/rtw_android.c @@ -64,6 +64,9 @@ const char *android_wifi_cmd_str[ANDROID_WIFI_CMD_MAX] = { "P2P_GET_NOA", "P2P_SET_PS", "SET_AP_WPS_P2P_IE", + + "MIRACAST", + #ifdef CONFIG_PNO_SUPPORT "PNOSSIDCLR", "PNOSETUP", @@ -86,6 +89,8 @@ const char *android_wifi_cmd_str[ANDROID_WIFI_CMD_MAX] = { #ifdef CONFIG_GTK_OL "GTK_REKEY_OFFLOAD", #endif //CONFIG_GTK_OL +/* Private command for P2P disable*/ + "P2P_DISABLE" }; #ifdef CONFIG_PNO_SUPPORT @@ -133,16 +138,18 @@ char pno_in_example[] = { #endif /* PNO_SUPPORT */ typedef struct android_wifi_priv_cmd { + char *buf; + int used_len; + int total_len; +} android_wifi_priv_cmd; #ifdef CONFIG_COMPAT +typedef struct compat_android_wifi_priv_cmd { compat_uptr_t buf; -#else - char *buf; -#endif - int used_len; int total_len; -} android_wifi_priv_cmd; +} compat_android_wifi_priv_cmd; +#endif /* CONFIG_COMPAT */ /** * Local (static) functions and variables @@ -154,9 +161,21 @@ typedef struct android_wifi_priv_cmd { */ static int g_wifi_on = _TRUE; -unsigned int oob_irq; +unsigned int oob_irq = 0; +unsigned int oob_gpio = 0; #ifdef CONFIG_PNO_SUPPORT +/* + * rtw_android_pno_setup + * Description: + * This is used for private command. + * + * Parameter: + * net: net_device + * command: parameters from private command + * total_len: the length of the command. + * + * */ static int rtw_android_pno_setup(struct net_device *net, char *command, int total_len) { pno_ssid_t pno_ssids_local[MAX_PNO_LIST_COUNT]; int res = -1; @@ -246,10 +265,56 @@ static int rtw_android_pno_setup(struct net_device *net, char *command, int tota return res; } -static int rtw_android_pno_enable(struct net_device *net, int pno_enable) { +/* + * rtw_android_cfg80211_pno_setup + * Description: + * This is used for cfg80211 sched_scan. + * + * Parameter: + * net: net_device + * request: cfg80211_request + * */ + +int rtw_android_cfg80211_pno_setup(struct net_device *net, + struct cfg80211_ssid *ssids, int n_ssids, int interval) { + int res = -1; + int nssid = 0; + int pno_time = 0; + int pno_repeat = 0; + int pno_freq_expo_max = 0; + int index = 0; + pno_ssid_t pno_ssids_local[MAX_PNO_LIST_COUNT]; + + if (n_ssids > MAX_PNO_LIST_COUNT || n_ssids < 0) { + DBG_871X("%s: nssids(%d) is invalid.\n", __func__, n_ssids); + return -EINVAL; + } + + memset(pno_ssids_local, 0, sizeof(pno_ssids_local)); + + nssid = n_ssids; + + for (index = 0 ; index < nssid ; index++) { + pno_ssids_local[index].SSID_len = ssids[index].ssid_len; + memcpy(pno_ssids_local[index].SSID, ssids[index].ssid, + ssids[index].ssid_len); + } + + pno_time = (interval / 1000); + + DBG_871X("%s: nssids: %d, pno_time=%d\n", __func__, nssid, pno_time); + + res = rtw_dev_pno_set(net, pno_ssids_local, nssid, pno_time, + pno_repeat, pno_freq_expo_max); + +exit_proc: + return res; +} + +int rtw_android_pno_enable(struct net_device *net, int pno_enable) { _adapter *padapter = (_adapter *)rtw_netdev_priv(net); struct pwrctrl_priv *pwrctl = adapter_to_pwrctl(padapter); - + if (pwrctl) { pwrctl->wowlan_pno_enable = pno_enable; DBG_871X("%s: wowlan_pno_enable: %d\n", __func__, pwrctl->wowlan_pno_enable); @@ -278,7 +343,11 @@ int rtw_android_cmdstr_to_num(char *cmdstr) { int cmd_num; for(cmd_num=0 ; cmd_num= KERNEL_VERSION(4,0,0)) + if(0 == strncasecmp(cmdstr , android_wifi_cmd_str[cmd_num], strlen(android_wifi_cmd_str[cmd_num])) ) +#else if(0 == strnicmp(cmdstr , android_wifi_cmd_str[cmd_num], strlen(android_wifi_cmd_str[cmd_num])) ) +#endif break; return cmd_num; @@ -379,6 +448,46 @@ int rtw_android_getband(struct net_device *net, char *command, int total_len) return bytes_written; } +enum { + MIRACAST_DISABLED = 0, + MIRACAST_SOURCE, + MIRACAST_SINK, + MIRACAST_INVALID, +}; + +static const char *miracast_mode_str[] = { + "DISABLED", + "SOURCE", + "SINK", + "INVALID", +}; + +static const char *get_miracast_mode_str(int mode) +{ + if (mode < MIRACAST_DISABLED || mode >= MIRACAST_INVALID) + mode = MIRACAST_INVALID; + + return miracast_mode_str[mode]; +} + +int rtw_android_set_miracast_mode(struct net_device *net, char *command, int total_len) +{ + _adapter *adapter = (_adapter *)rtw_netdev_priv(net); + char *arg = command + strlen(android_wifi_cmd_str[ANDROID_WIFI_CMD_MIRACAST]) + 1; + u8 mode; + int num; + int ret = _FAIL; + + num = sscanf(arg, "%hhu", &mode); + + if (num >= 1) { + DBG_871X("Miracast mode: %s(%u)\n", get_miracast_mode_str(mode), mode); + ret = _SUCCESS; + } + + return (ret==_SUCCESS)?0:-1; +} + int get_int_from_command( char* pcmd ) { int i = 0; @@ -458,17 +567,35 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd) #ifdef CONFIG_WFD struct wifi_display_info *pwfd_info; #endif + rtw_lock_suspend(); if (!ifr->ifr_data) { ret = -EINVAL; goto exit; } +#ifdef CONFIG_COMPAT + if (is_compat_task()) { + /* User space is 32-bit, use compat ioctl */ + compat_android_wifi_priv_cmd compat_priv_cmd; + + if (copy_from_user(&compat_priv_cmd, ifr->ifr_data, sizeof(compat_android_wifi_priv_cmd))) { + ret = -EFAULT; + goto exit; + } + priv_cmd.buf = compat_ptr(compat_priv_cmd.buf); + priv_cmd.used_len = compat_priv_cmd.used_len; + priv_cmd.total_len = compat_priv_cmd.total_len; + } else +#endif /* CONFIG_COMPAT */ if (copy_from_user(&priv_cmd, ifr->ifr_data, sizeof(android_wifi_priv_cmd))) { ret = -EFAULT; goto exit; } - + if ( padapter->registrypriv.mp_mode == 1) { + ret = -EFAULT; + goto exit; + } //DBG_871X("%s priv_cmd.buf=%p priv_cmd.total_len=%d priv_cmd.used_len=%d\n",__func__,priv_cmd.buf,priv_cmd.total_len,priv_cmd.used_len); command = rtw_zmalloc(priv_cmd.total_len); if (!command) @@ -483,11 +610,7 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd) ret = -EFAULT; goto exit; } -#ifdef CONFIG_COMPAT - if (copy_from_user(command, compat_ptr(priv_cmd.buf), (unsigned long) priv_cmd.total_len)) { -#else if (copy_from_user(command, (void *)priv_cmd.buf, priv_cmd.total_len)) { -#endif ret = -EFAULT; goto exit; } @@ -522,7 +645,7 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd) //rtw_set_scan_mode((_adapter *)rtw_netdev_priv(net), SCAN_ACTIVE); #ifdef CONFIG_PLATFORM_MSTAR #ifdef CONFIG_IOCTL_CFG80211 - (adapter_wdev_data((_adapter *)rtw_netdev_priv(net))->bandroid_scan = _TRUE; + adapter_wdev_data((_adapter *)rtw_netdev_priv(net))->bandroid_scan = _TRUE; #endif //CONFIG_IOCTL_CFG80211 #endif //CONFIG_PLATFORM_MSTAR break; @@ -590,7 +713,11 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd) case ANDROID_WIFI_CMD_GETBAND: bytes_written = rtw_android_getband(net, command, priv_cmd.total_len); break; - + + case ANDROID_WIFI_CMD_MIRACAST: + bytes_written = rtw_android_set_miracast_mode(net, command, priv_cmd.total_len); + break; + case ANDROID_WIFI_CMD_COUNTRY: bytes_written = rtw_android_set_country(net, command, priv_cmd.total_len); break; @@ -666,12 +793,8 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd) pwfd_info = &padapter->wfd_info; if( padapter->wdinfo.driver_interface == DRIVER_CFG80211 ) { -#ifdef CONFIG_COMPAT - pwfd_info->rtsp_ctrlport = ( u16 ) get_int_from_command( compat_ptr(priv_cmd.buf) ); -#else pwfd_info->rtsp_ctrlport = ( u16 ) get_int_from_command( priv_cmd.buf ); -#endif - } + } break; } case ANDROID_WIFI_CMD_WFD_SET_MAX_TPUT: @@ -686,12 +809,7 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd) pwfd_info = &padapter->wfd_info; if( padapter->wdinfo.driver_interface == DRIVER_CFG80211 ) { -#ifdef CONFIG_COMPAT - pwfd_info->wfd_device_type = ( u8 ) get_int_from_command( compat_ptr(priv_cmd.buf) ); -#else pwfd_info->wfd_device_type = ( u8 ) get_int_from_command( priv_cmd.buf ); -#endif - pwfd_info->wfd_device_type &= WFD_DEVINFO_DUAL; } break; @@ -701,7 +819,7 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd) { #ifdef CONFIG_LPS u8 dtim; - u8 *ptr = priv_cmd.buf; + u8 *ptr =(u8 *) &priv_cmd.buf; ptr += 9;//string command length of "SET_DTIM"; @@ -735,9 +853,20 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd) } #ifdef CONFIG_GTK_OL case ANDROID_WIFI_CMD_GTK_REKEY_OFFLOAD: - rtw_gtk_offload(net, priv_cmd.buf); + rtw_gtk_offload(net, (u8*)command); break; #endif //CONFIG_GTK_OL + case ANDROID_WIFI_CMD_P2P_DISABLE: + { +#ifdef CONFIG_P2P + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; + u8 channel, ch_offset; + u16 bwmode; + + rtw_p2p_enable(padapter, P2P_ROLE_DISABLE); +#endif // CONFIG_P2P + break; + } default: DBG_871X("Unknown PRIVATE command %s - ignored\n", command); snprintf(command, 3, "OK"); @@ -755,11 +884,7 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd) bytes_written++; } priv_cmd.used_len = bytes_written; -#ifdef CONFIG_COMPAT - if (copy_to_user(compat_ptr(priv_cmd.buf), command, bytes_written)) { -#else if (copy_to_user((void *)priv_cmd.buf, command, bytes_written)) { -#endif DBG_871X("%s: failed to copy data to user buffer\n", __FUNCTION__); ret = -EFAULT; } @@ -917,9 +1042,13 @@ static int wifi_probe(struct platform_device *pdev) wifi_irqres->start, wifi_wake_gpio); if (wifi_wake_gpio > 0) { +#ifdef CONFIG_PLATFORM_INTEL_BYT + wifi_configure_gpio(); +#else //CONFIG_PLATFORM_INTEL_BYT gpio_request(wifi_wake_gpio, "oob_irq"); gpio_direction_input(wifi_wake_gpio); oob_irq = gpio_to_irq(wifi_wake_gpio); +#endif //CONFIG_PLATFORM_INTEL_BYT printk("%s oob_irq:%d\n", __func__, oob_irq); } else if(wifi_irqres) @@ -1107,3 +1236,34 @@ static void wifi_del_dev(void) } #endif /* defined(RTW_ENABLE_WIFI_CONTROL_FUNC) */ +#ifdef CONFIG_GPIO_WAKEUP +#ifdef CONFIG_PLATFORM_INTEL_BYT +int wifi_configure_gpio(void) +{ + if (gpio_request(oob_gpio, "oob_irq")) { + DBG_871X("## %s Cannot request GPIO\n", __FUNCTION__); + return -1; + } + gpio_export(oob_gpio, 0); + if (gpio_direction_input(oob_gpio)) { + DBG_871X("## %s Cannot set GPIO direction input\n", __FUNCTION__); + return -1; + } + if ((oob_irq = gpio_to_irq(oob_gpio)) < 0) { + DBG_871X("## %s Cannot convert GPIO to IRQ\n", __FUNCTION__); + return -1; + } + + DBG_871X("## %s OOB_IRQ=%d\n", __FUNCTION__, oob_irq); + + return 0; +} +#endif //CONFIG_PLATFORM_INTEL_BYT +void wifi_free_gpio(unsigned int gpio) +{ +#ifdef CONFIG_PLATFORM_INTEL_BYT + if(gpio) + gpio_free(gpio); +#endif //CONFIG_PLATFORM_INTEL_BYT +} +#endif //CONFIG_GPIO_WAKEUP diff --git a/backports/drivers/realtek/rtl8812au/os_dep/linux/rtw_cfgvendor.c b/backports/drivers/realtek/rtl8812au/os_dep/linux/rtw_cfgvendor.c new file mode 100644 index 00000000000000..699decfdb30821 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/os_dep/linux/rtw_cfgvendor.c @@ -0,0 +1,1328 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2014 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +#include + +#ifdef CONFIG_IOCTL_CFG80211 + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) || defined(RTW_VENDOR_EXT_SUPPORT) + +/* +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +*/ + +#include + +#ifdef DBG_MEM_ALLOC +extern bool match_mstat_sniff_rules(const enum mstat_f flags, const size_t size); +struct sk_buff * dbg_rtw_cfg80211_vendor_event_alloc(struct wiphy *wiphy, int len, int event_id, gfp_t gfp + , const enum mstat_f flags, const char *func, const int line) +{ + struct sk_buff *skb; + unsigned int truesize = 0; + +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0)) + skb = cfg80211_vendor_event_alloc(wiphy, len, event_id, gfp); +#else + skb = cfg80211_vendor_event_alloc(wiphy, NULL, len, event_id, gfp); +#endif + + if(skb) + truesize = skb->truesize; + + if(!skb || truesize < len || match_mstat_sniff_rules(flags, truesize)) + DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d), skb:%p, truesize=%u\n", func, line, __FUNCTION__, len, skb, truesize); + + rtw_mstat_update( + flags + , skb ? MSTAT_ALLOC_SUCCESS : MSTAT_ALLOC_FAIL + , truesize + ); + + return skb; +} + +void dbg_rtw_cfg80211_vendor_event(struct sk_buff *skb, gfp_t gfp + , const enum mstat_f flags, const char *func, const int line) +{ + unsigned int truesize = skb->truesize; + + if(match_mstat_sniff_rules(flags, truesize)) + DBG_871X("DBG_MEM_ALLOC %s:%d %s, truesize=%u\n", func, line, __FUNCTION__, truesize); + + cfg80211_vendor_event(skb, gfp); + + rtw_mstat_update( + flags + , MSTAT_FREE + , truesize + ); +} + +struct sk_buff *dbg_rtw_cfg80211_vendor_cmd_alloc_reply_skb(struct wiphy *wiphy, int len + , const enum mstat_f flags, const char *func, const int line) +{ + struct sk_buff *skb; + unsigned int truesize = 0; + + skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, len); + + if(skb) + truesize = skb->truesize; + + if(!skb || truesize < len || match_mstat_sniff_rules(flags, truesize)) + DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d), skb:%p, truesize=%u\n", func, line, __FUNCTION__, len, skb, truesize); + + rtw_mstat_update( + flags + , skb ? MSTAT_ALLOC_SUCCESS : MSTAT_ALLOC_FAIL + , truesize + ); + + return skb; +} + +int dbg_rtw_cfg80211_vendor_cmd_reply(struct sk_buff *skb + , const enum mstat_f flags, const char *func, const int line) +{ + unsigned int truesize = skb->truesize; + int ret; + + if(match_mstat_sniff_rules(flags, truesize)) + DBG_871X("DBG_MEM_ALLOC %s:%d %s, truesize=%u\n", func, line, __FUNCTION__, truesize); + + ret = cfg80211_vendor_cmd_reply(skb); + + rtw_mstat_update( + flags + , MSTAT_FREE + , truesize + ); + + return ret; +} + +#define rtw_cfg80211_vendor_event_alloc(wiphy, len, event_id, gfp) \ + dbg_rtw_cfg80211_vendor_event_alloc(wiphy, len, event_id, gfp, MSTAT_FUNC_CFG_VENDOR|MSTAT_TYPE_SKB, __FUNCTION__, __LINE__) + +#define rtw_cfg80211_vendor_event(skb, gfp) \ + dbg_rtw_cfg80211_vendor_event(skb, gfp, MSTAT_FUNC_CFG_VENDOR|MSTAT_TYPE_SKB, __FUNCTION__, __LINE__) + +#define rtw_cfg80211_vendor_cmd_alloc_reply_skb(wiphy, len) \ + dbg_rtw_cfg80211_vendor_cmd_alloc_reply_skb(wiphy, len, MSTAT_FUNC_CFG_VENDOR|MSTAT_TYPE_SKB, __FUNCTION__, __LINE__) + +#define rtw_cfg80211_vendor_cmd_reply(skb) \ + dbg_rtw_cfg80211_vendor_cmd_reply(skb, MSTAT_FUNC_CFG_VENDOR|MSTAT_TYPE_SKB, __FUNCTION__, __LINE__) +#else +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0)) + #define rtw_cfg80211_vendor_event_alloc(wiphy, len, event_id, gfp) \ + cfg80211_vendor_event_alloc(wiphy, len, event_id, gfp) +#else + #define rtw_cfg80211_vendor_event_alloc(wiphy, len, event_id, gfp) \ + cfg80211_vendor_event_alloc(wiphy, NULL, len, event_id, gfp) +#endif + +#define rtw_cfg80211_vendor_event(skb, gfp) \ + cfg80211_vendor_event(skb, gfp) + +#define rtw_cfg80211_vendor_cmd_alloc_reply_skb(wiphy, len) \ + cfg80211_vendor_cmd_alloc_reply_skb(wiphy, len) + +#define rtw_cfg80211_vendor_cmd_reply(skb) \ + cfg80211_vendor_cmd_reply(skb) +#endif /* DBG_MEM_ALLOC */ + +/* + * This API is to be used for asynchronous vendor events. This + * shouldn't be used in response to a vendor command from its + * do_it handler context (instead rtw_cfgvendor_send_cmd_reply should + * be used). + */ +int rtw_cfgvendor_send_async_event(struct wiphy *wiphy, + struct net_device *dev, int event_id, const void *data, int len) +{ + u16 kflags; + struct sk_buff *skb; + + kflags = in_atomic() ? GFP_ATOMIC : GFP_KERNEL; + + /* Alloc the SKB for vendor_event */ + skb = rtw_cfg80211_vendor_event_alloc(wiphy, len, event_id, kflags); + if (!skb) { + DBG_871X_LEVEL(_drv_err_, FUNC_NDEV_FMT" skb alloc failed", FUNC_NDEV_ARG(dev)); + return -ENOMEM; + } + + /* Push the data to the skb */ + nla_put_nohdr(skb, len, data); + + rtw_cfg80211_vendor_event(skb, kflags); + + return 0; +} + +static int rtw_cfgvendor_send_cmd_reply(struct wiphy *wiphy, + struct net_device *dev, const void *data, int len) +{ + struct sk_buff *skb; + + /* Alloc the SKB for vendor_event */ + skb = rtw_cfg80211_vendor_cmd_alloc_reply_skb(wiphy, len); + if (unlikely(!skb)) { + DBG_871X_LEVEL(_drv_err_, FUNC_NDEV_FMT" skb alloc failed", FUNC_NDEV_ARG(dev)); + return -ENOMEM; + } + + /* Push the data to the skb */ + nla_put_nohdr(skb, len, data); + + return rtw_cfg80211_vendor_cmd_reply(skb); +} + +#define WIFI_FEATURE_INFRA 0x0001 /* Basic infrastructure mode */ +#define WIFI_FEATURE_INFRA_5G 0x0002 /* Support for 5 GHz Band */ +#define WIFI_FEATURE_HOTSPOT 0x0004 /* Support for GAS/ANQP */ +#define WIFI_FEATURE_P2P 0x0008 /* Wifi-Direct */ +#define WIFI_FEATURE_SOFT_AP 0x0010 /* Soft AP */ +#define WIFI_FEATURE_GSCAN 0x0020 /* Google-Scan APIs */ +#define WIFI_FEATURE_NAN 0x0040 /* Neighbor Awareness Networking */ +#define WIFI_FEATURE_D2D_RTT 0x0080 /* Device-to-device RTT */ +#define WIFI_FEATURE_D2AP_RTT 0x0100 /* Device-to-AP RTT */ +#define WIFI_FEATURE_BATCH_SCAN 0x0200 /* Batched Scan (legacy) */ +#define WIFI_FEATURE_PNO 0x0400 /* Preferred network offload */ +#define WIFI_FEATURE_ADDITIONAL_STA 0x0800 /* Support for two STAs */ +#define WIFI_FEATURE_TDLS 0x1000 /* Tunnel directed link setup */ +#define WIFI_FEATURE_TDLS_OFFCHANNEL 0x2000 /* Support for TDLS off channel */ +#define WIFI_FEATURE_EPR 0x4000 /* Enhanced power reporting */ +#define WIFI_FEATURE_AP_STA 0x8000 /* Support for AP STA Concurrency */ + +#define MAX_FEATURE_SET_CONCURRRENT_GROUPS 3 + +#include +int rtw_dev_get_feature_set(struct net_device *dev) +{ + _adapter *adapter = (_adapter *)rtw_netdev_priv(dev); + HAL_DATA_TYPE *HalData = GET_HAL_DATA(adapter); + HAL_VERSION *hal_ver = &HalData->VersionID; + + int feature_set = 0; + + feature_set |= WIFI_FEATURE_INFRA; + + if(IS_92D(*hal_ver) || IS_8812_SERIES(*hal_ver) || IS_8821_SERIES(*hal_ver)) + feature_set |= WIFI_FEATURE_INFRA_5G; + + feature_set |= WIFI_FEATURE_P2P; + feature_set |= WIFI_FEATURE_SOFT_AP; + + feature_set |= WIFI_FEATURE_ADDITIONAL_STA; + + return feature_set; +} + +int *rtw_dev_get_feature_set_matrix(struct net_device *dev, int *num) +{ + int feature_set_full, mem_needed; + int *ret; + + *num = 0; + mem_needed = sizeof(int) * MAX_FEATURE_SET_CONCURRRENT_GROUPS; + ret = (int *)rtw_malloc(mem_needed); + + if (!ret) { + DBG_871X_LEVEL(_drv_err_, FUNC_NDEV_FMT" failed to allocate %d bytes\n" + , FUNC_NDEV_ARG(dev), mem_needed); + return ret; + } + + feature_set_full = rtw_dev_get_feature_set(dev); + + ret[0] = (feature_set_full & WIFI_FEATURE_INFRA) | + (feature_set_full & WIFI_FEATURE_INFRA_5G) | + (feature_set_full & WIFI_FEATURE_NAN) | + (feature_set_full & WIFI_FEATURE_D2D_RTT) | + (feature_set_full & WIFI_FEATURE_D2AP_RTT) | + (feature_set_full & WIFI_FEATURE_PNO) | + (feature_set_full & WIFI_FEATURE_BATCH_SCAN) | + (feature_set_full & WIFI_FEATURE_GSCAN) | + (feature_set_full & WIFI_FEATURE_HOTSPOT) | + (feature_set_full & WIFI_FEATURE_ADDITIONAL_STA) | + (feature_set_full & WIFI_FEATURE_EPR); + + ret[1] = (feature_set_full & WIFI_FEATURE_INFRA) | + (feature_set_full & WIFI_FEATURE_INFRA_5G) | + /* Not yet verified NAN with P2P */ + /* (feature_set_full & WIFI_FEATURE_NAN) | */ + (feature_set_full & WIFI_FEATURE_P2P) | + (feature_set_full & WIFI_FEATURE_D2AP_RTT) | + (feature_set_full & WIFI_FEATURE_D2D_RTT) | + (feature_set_full & WIFI_FEATURE_EPR); + + ret[2] = (feature_set_full & WIFI_FEATURE_INFRA) | + (feature_set_full & WIFI_FEATURE_INFRA_5G) | + (feature_set_full & WIFI_FEATURE_NAN) | + (feature_set_full & WIFI_FEATURE_D2D_RTT) | + (feature_set_full & WIFI_FEATURE_D2AP_RTT) | + (feature_set_full & WIFI_FEATURE_TDLS) | + (feature_set_full & WIFI_FEATURE_TDLS_OFFCHANNEL) | + (feature_set_full & WIFI_FEATURE_EPR); + *num = MAX_FEATURE_SET_CONCURRRENT_GROUPS; + + return ret; +} + +static int rtw_cfgvendor_get_feature_set(struct wiphy *wiphy, + struct wireless_dev *wdev, const void *data, int len) +{ + int err = 0; + int reply; + + reply = rtw_dev_get_feature_set(wdev_to_ndev(wdev)); + + err = rtw_cfgvendor_send_cmd_reply(wiphy, wdev_to_ndev(wdev), &reply, sizeof(int)); + + if (unlikely(err)) + DBG_871X_LEVEL(_drv_err_, FUNC_NDEV_FMT" Vendor Command reply failed ret:%d \n" + , FUNC_NDEV_ARG(wdev_to_ndev(wdev)), err); + + return err; +} + +static int rtw_cfgvendor_get_feature_set_matrix(struct wiphy *wiphy, + struct wireless_dev *wdev, const void *data, int len) +{ + int err = 0; + struct sk_buff *skb; + int *reply; + int num, mem_needed, i; + + reply = rtw_dev_get_feature_set_matrix(wdev_to_ndev(wdev), &num); + + if (!reply) { + DBG_871X_LEVEL(_drv_err_, FUNC_NDEV_FMT" Could not get feature list matrix\n" + , FUNC_NDEV_ARG(wdev_to_ndev(wdev))); + err = -EINVAL; + return err; + } + + mem_needed = VENDOR_REPLY_OVERHEAD + (ATTRIBUTE_U32_LEN * num) + + ATTRIBUTE_U32_LEN; + + /* Alloc the SKB for vendor_event */ + skb = rtw_cfg80211_vendor_cmd_alloc_reply_skb(wiphy, mem_needed); + if (unlikely(!skb)) { + DBG_871X_LEVEL(_drv_err_, FUNC_NDEV_FMT" skb alloc failed", FUNC_NDEV_ARG(wdev_to_ndev(wdev))); + err = -ENOMEM; + goto exit; + } + + nla_put_u32(skb, ANDR_WIFI_ATTRIBUTE_NUM_FEATURE_SET, num); + for (i = 0; i < num; i++) { + nla_put_u32(skb, ANDR_WIFI_ATTRIBUTE_FEATURE_SET, reply[i]); + } + + err = rtw_cfg80211_vendor_cmd_reply(skb); + + if (unlikely(err)) + DBG_871X_LEVEL(_drv_err_, FUNC_NDEV_FMT" Vendor Command reply failed ret:%d \n" + , FUNC_NDEV_ARG(wdev_to_ndev(wdev)), err); +exit: + rtw_mfree((u8*)reply, sizeof(int)*num); + return err; +} + +#if defined(GSCAN_SUPPORT) && 0 +int wl_cfgvendor_send_hotlist_event(struct wiphy *wiphy, + struct net_device *dev, void *data, int len, wl_vendor_event_t event) +{ + u16 kflags; + const void *ptr; + struct sk_buff *skb; + int malloc_len, total, iter_cnt_to_send, cnt; + gscan_results_cache_t *cache = (gscan_results_cache_t *)data; + + total = len/sizeof(wifi_gscan_result_t); + while (total > 0) { + malloc_len = (total * sizeof(wifi_gscan_result_t)) + VENDOR_DATA_OVERHEAD; + if (malloc_len > NLMSG_DEFAULT_SIZE) { + malloc_len = NLMSG_DEFAULT_SIZE; + } + iter_cnt_to_send = + (malloc_len - VENDOR_DATA_OVERHEAD)/sizeof(wifi_gscan_result_t); + total = total - iter_cnt_to_send; + + kflags = in_atomic() ? GFP_ATOMIC : GFP_KERNEL; + + /* Alloc the SKB for vendor_event */ + skb = rtw_cfg80211_vendor_event_alloc(wiphy, malloc_len, event, kflags); + if (!skb) { + WL_ERR(("skb alloc failed")); + return -ENOMEM; + } + + while (cache && iter_cnt_to_send) { + ptr = (const void *) &cache->results[cache->tot_consumed]; + + if (iter_cnt_to_send < (cache->tot_count - cache->tot_consumed)) + cnt = iter_cnt_to_send; + else + cnt = (cache->tot_count - cache->tot_consumed); + + iter_cnt_to_send -= cnt; + cache->tot_consumed += cnt; + /* Push the data to the skb */ + nla_append(skb, cnt * sizeof(wifi_gscan_result_t), ptr); + if (cache->tot_consumed == cache->tot_count) + cache = cache->next; + + } + + rtw_cfg80211_vendor_event(skb, kflags); + } + + return 0; +} + + +static int wl_cfgvendor_gscan_get_capabilities(struct wiphy *wiphy, + struct wireless_dev *wdev, const void *data, int len) +{ + int err = 0; + struct bcm_cfg80211 *cfg = wiphy_priv(wiphy); + dhd_pno_gscan_capabilities_t *reply = NULL; + uint32 reply_len = 0; + + + reply = dhd_dev_pno_get_gscan(bcmcfg_to_prmry_ndev(cfg), + DHD_PNO_GET_CAPABILITIES, NULL, &reply_len); + if (!reply) { + WL_ERR(("Could not get capabilities\n")); + err = -EINVAL; + return err; + } + + err = rtw_cfgvendor_send_cmd_reply(wiphy, bcmcfg_to_prmry_ndev(cfg), + reply, reply_len); + + if (unlikely(err)) + WL_ERR(("Vendor Command reply failed ret:%d \n", err)); + + kfree(reply); + return err; +} + +static int wl_cfgvendor_gscan_get_channel_list(struct wiphy *wiphy, + struct wireless_dev *wdev, const void *data, int len) +{ + int err = 0, type, band; + struct bcm_cfg80211 *cfg = wiphy_priv(wiphy); + uint16 *reply = NULL; + uint32 reply_len = 0, num_channels, mem_needed; + struct sk_buff *skb; + + type = nla_type(data); + + if (type == GSCAN_ATTRIBUTE_BAND) { + band = nla_get_u32(data); + } else { + return -1; + } + + reply = dhd_dev_pno_get_gscan(bcmcfg_to_prmry_ndev(cfg), + DHD_PNO_GET_CHANNEL_LIST, &band, &reply_len); + + if (!reply) { + WL_ERR(("Could not get channel list\n")); + err = -EINVAL; + return err; + } + num_channels = reply_len/ sizeof(uint32); + mem_needed = reply_len + VENDOR_REPLY_OVERHEAD + (ATTRIBUTE_U32_LEN * 2); + + /* Alloc the SKB for vendor_event */ + skb = rtw_cfg80211_vendor_cmd_alloc_reply_skb(wiphy, mem_needed); + if (unlikely(!skb)) { + WL_ERR(("skb alloc failed")); + err = -ENOMEM; + goto exit; + } + + nla_put_u32(skb, GSCAN_ATTRIBUTE_NUM_CHANNELS, num_channels); + nla_put(skb, GSCAN_ATTRIBUTE_CHANNEL_LIST, reply_len, reply); + + err = rtw_cfg80211_vendor_cmd_reply(skb); + + if (unlikely(err)) + WL_ERR(("Vendor Command reply failed ret:%d \n", err)); +exit: + kfree(reply); + return err; +} + +static int wl_cfgvendor_gscan_get_batch_results(struct wiphy *wiphy, + struct wireless_dev *wdev, const void *data, int len) +{ + int err = 0; + struct bcm_cfg80211 *cfg = wiphy_priv(wiphy); + gscan_results_cache_t *results, *iter; + uint32 reply_len, complete = 0, num_results_iter; + int32 mem_needed; + wifi_gscan_result_t *ptr; + uint16 num_scan_ids, num_results; + struct sk_buff *skb; + struct nlattr *scan_hdr; + + dhd_dev_wait_batch_results_complete(bcmcfg_to_prmry_ndev(cfg)); + dhd_dev_pno_lock_access_batch_results(bcmcfg_to_prmry_ndev(cfg)); + results = dhd_dev_pno_get_gscan(bcmcfg_to_prmry_ndev(cfg), + DHD_PNO_GET_BATCH_RESULTS, NULL, &reply_len); + + if (!results) { + WL_ERR(("No results to send %d\n", err)); + err = rtw_cfgvendor_send_cmd_reply(wiphy, bcmcfg_to_prmry_ndev(cfg), + results, 0); + + if (unlikely(err)) + WL_ERR(("Vendor Command reply failed ret:%d \n", err)); + dhd_dev_pno_unlock_access_batch_results(bcmcfg_to_prmry_ndev(cfg)); + return err; + } + num_scan_ids = reply_len & 0xFFFF; + num_results = (reply_len & 0xFFFF0000) >> 16; + mem_needed = (num_results * sizeof(wifi_gscan_result_t)) + + (num_scan_ids * GSCAN_BATCH_RESULT_HDR_LEN) + + VENDOR_REPLY_OVERHEAD + SCAN_RESULTS_COMPLETE_FLAG_LEN; + + if (mem_needed > (int32)NLMSG_DEFAULT_SIZE) { + mem_needed = (int32)NLMSG_DEFAULT_SIZE; + complete = 0; + } else { + complete = 1; + } + + WL_TRACE(("complete %d mem_needed %d max_mem %d\n", complete, mem_needed, + (int)NLMSG_DEFAULT_SIZE)); + /* Alloc the SKB for vendor_event */ + skb = rtw_cfg80211_vendor_cmd_alloc_reply_skb(wiphy, mem_needed); + if (unlikely(!skb)) { + WL_ERR(("skb alloc failed")); + dhd_dev_pno_unlock_access_batch_results(bcmcfg_to_prmry_ndev(cfg)); + return -ENOMEM; + } + iter = results; + + nla_put_u32(skb, GSCAN_ATTRIBUTE_SCAN_RESULTS_COMPLETE, complete); + + mem_needed = mem_needed - (SCAN_RESULTS_COMPLETE_FLAG_LEN + VENDOR_REPLY_OVERHEAD); + + while (iter && ((mem_needed - GSCAN_BATCH_RESULT_HDR_LEN) > 0)) { + scan_hdr = nla_nest_start(skb, GSCAN_ATTRIBUTE_SCAN_RESULTS); + nla_put_u32(skb, GSCAN_ATTRIBUTE_SCAN_ID, iter->scan_id); + nla_put_u8(skb, GSCAN_ATTRIBUTE_SCAN_FLAGS, iter->flag); + num_results_iter = + (mem_needed - GSCAN_BATCH_RESULT_HDR_LEN)/sizeof(wifi_gscan_result_t); + + if ((iter->tot_count - iter->tot_consumed) < num_results_iter) + num_results_iter = iter->tot_count - iter->tot_consumed; + + nla_put_u32(skb, GSCAN_ATTRIBUTE_NUM_OF_RESULTS, num_results_iter); + if (num_results_iter) { + ptr = &iter->results[iter->tot_consumed]; + iter->tot_consumed += num_results_iter; + nla_put(skb, GSCAN_ATTRIBUTE_SCAN_RESULTS, + num_results_iter * sizeof(wifi_gscan_result_t), ptr); + } + nla_nest_end(skb, scan_hdr); + mem_needed -= GSCAN_BATCH_RESULT_HDR_LEN + + (num_results_iter * sizeof(wifi_gscan_result_t)); + iter = iter->next; + } + + dhd_dev_gscan_batch_cache_cleanup(bcmcfg_to_prmry_ndev(cfg)); + dhd_dev_pno_unlock_access_batch_results(bcmcfg_to_prmry_ndev(cfg)); + + return rtw_cfg80211_vendor_cmd_reply(skb); +} + +static int wl_cfgvendor_initiate_gscan(struct wiphy *wiphy, + struct wireless_dev *wdev, const void *data, int len) +{ + int err = 0; + struct bcm_cfg80211 *cfg = wiphy_priv(wiphy); + int type, tmp = len; + int run = 0xFF; + int flush = 0; + const struct nlattr *iter; + + nla_for_each_attr(iter, data, len, tmp) { + type = nla_type(iter); + if (type == GSCAN_ATTRIBUTE_ENABLE_FEATURE) + run = nla_get_u32(iter); + else if (type == GSCAN_ATTRIBUTE_FLUSH_FEATURE) + flush = nla_get_u32(iter); + } + + if (run != 0xFF) { + err = dhd_dev_pno_run_gscan(bcmcfg_to_prmry_ndev(cfg), run, flush); + + if (unlikely(err)) + WL_ERR(("Could not run gscan:%d \n", err)); + return err; + } else { + return -1; + } + + +} + +static int wl_cfgvendor_enable_full_scan_result(struct wiphy *wiphy, + struct wireless_dev *wdev, const void *data, int len) +{ + int err = 0; + struct bcm_cfg80211 *cfg = wiphy_priv(wiphy); + int type; + bool real_time = FALSE; + + type = nla_type(data); + + if (type == GSCAN_ATTRIBUTE_ENABLE_FULL_SCAN_RESULTS) { + real_time = nla_get_u32(data); + + err = dhd_dev_pno_enable_full_scan_result(bcmcfg_to_prmry_ndev(cfg), real_time); + + if (unlikely(err)) + WL_ERR(("Could not run gscan:%d \n", err)); + + } else { + err = -1; + } + + return err; +} + +static int wl_cfgvendor_set_scan_cfg(struct wiphy *wiphy, + struct wireless_dev *wdev, const void *data, int len) +{ + int err = 0; + struct bcm_cfg80211 *cfg = wiphy_priv(wiphy); + gscan_scan_params_t *scan_param; + int j = 0; + int type, tmp, tmp1, tmp2, k = 0; + const struct nlattr *iter, *iter1, *iter2; + struct dhd_pno_gscan_channel_bucket *ch_bucket; + + scan_param = kzalloc(sizeof(gscan_scan_params_t), GFP_KERNEL); + if (!scan_param) { + WL_ERR(("Could not set GSCAN scan cfg, mem alloc failure\n")); + err = -EINVAL; + return err; + + } + + scan_param->scan_fr = PNO_SCAN_MIN_FW_SEC; + nla_for_each_attr(iter, data, len, tmp) { + type = nla_type(iter); + + if (j >= GSCAN_MAX_CH_BUCKETS) + break; + + switch (type) { + case GSCAN_ATTRIBUTE_BASE_PERIOD: + scan_param->scan_fr = nla_get_u32(iter)/1000; + break; + case GSCAN_ATTRIBUTE_NUM_BUCKETS: + scan_param->nchannel_buckets = nla_get_u32(iter); + break; + case GSCAN_ATTRIBUTE_CH_BUCKET_1: + case GSCAN_ATTRIBUTE_CH_BUCKET_2: + case GSCAN_ATTRIBUTE_CH_BUCKET_3: + case GSCAN_ATTRIBUTE_CH_BUCKET_4: + case GSCAN_ATTRIBUTE_CH_BUCKET_5: + case GSCAN_ATTRIBUTE_CH_BUCKET_6: + case GSCAN_ATTRIBUTE_CH_BUCKET_7: + nla_for_each_nested(iter1, iter, tmp1) { + type = nla_type(iter1); + ch_bucket = + scan_param->channel_bucket; + + switch (type) { + case GSCAN_ATTRIBUTE_BUCKET_ID: + break; + case GSCAN_ATTRIBUTE_BUCKET_PERIOD: + ch_bucket[j].bucket_freq_multiple = + nla_get_u32(iter1)/1000; + break; + case GSCAN_ATTRIBUTE_BUCKET_NUM_CHANNELS: + ch_bucket[j].num_channels = + nla_get_u32(iter1); + break; + case GSCAN_ATTRIBUTE_BUCKET_CHANNELS: + nla_for_each_nested(iter2, iter1, tmp2) { + if (k >= PFN_SWC_RSSI_WINDOW_MAX) + break; + ch_bucket[j].chan_list[k] = + nla_get_u32(iter2); + k++; + } + k = 0; + break; + case GSCAN_ATTRIBUTE_BUCKETS_BAND: + ch_bucket[j].band = (uint16) + nla_get_u32(iter1); + break; + case GSCAN_ATTRIBUTE_REPORT_EVENTS: + ch_bucket[j].report_flag = (uint8) + nla_get_u32(iter1); + break; + } + } + j++; + break; + } + } + + if (dhd_dev_pno_set_cfg_gscan(bcmcfg_to_prmry_ndev(cfg), + DHD_PNO_SCAN_CFG_ID, scan_param, 0) < 0) { + WL_ERR(("Could not set GSCAN scan cfg\n")); + err = -EINVAL; + } + + kfree(scan_param); + return err; + +} + +static int wl_cfgvendor_hotlist_cfg(struct wiphy *wiphy, + struct wireless_dev *wdev, const void *data, int len) +{ + int err = 0; + struct bcm_cfg80211 *cfg = wiphy_priv(wiphy); + gscan_hotlist_scan_params_t *hotlist_params; + int tmp, tmp1, tmp2, type, j = 0, dummy; + const struct nlattr *outer, *inner, *iter; + uint8 flush = 0; + struct bssid_t *pbssid; + + hotlist_params = (gscan_hotlist_scan_params_t *)kzalloc(len, GFP_KERNEL); + if (!hotlist_params) { + WL_ERR(("Cannot Malloc mem to parse config commands size - %d bytes \n", len)); + return -1; + } + + hotlist_params->lost_ap_window = GSCAN_LOST_AP_WINDOW_DEFAULT; + + nla_for_each_attr(iter, data, len, tmp2) { + type = nla_type(iter); + switch (type) { + case GSCAN_ATTRIBUTE_HOTLIST_BSSIDS: + pbssid = hotlist_params->bssid; + nla_for_each_nested(outer, iter, tmp) { + nla_for_each_nested(inner, outer, tmp1) { + type = nla_type(inner); + + switch (type) { + case GSCAN_ATTRIBUTE_BSSID: + memcpy(&(pbssid[j].macaddr), + nla_data(inner), ETHER_ADDR_LEN); + break; + case GSCAN_ATTRIBUTE_RSSI_LOW: + pbssid[j].rssi_reporting_threshold = + (int8) nla_get_u8(inner); + break; + case GSCAN_ATTRIBUTE_RSSI_HIGH: + dummy = (int8) nla_get_u8(inner); + break; + } + } + j++; + } + hotlist_params->nbssid = j; + break; + case GSCAN_ATTRIBUTE_HOTLIST_FLUSH: + flush = nla_get_u8(iter); + break; + case GSCAN_ATTRIBUTE_LOST_AP_SAMPLE_SIZE: + hotlist_params->lost_ap_window = nla_get_u32(iter); + break; + } + + } + + if (dhd_dev_pno_set_cfg_gscan(bcmcfg_to_prmry_ndev(cfg), + DHD_PNO_GEOFENCE_SCAN_CFG_ID, hotlist_params, flush) < 0) { + WL_ERR(("Could not set GSCAN HOTLIST cfg\n")); + err = -EINVAL; + goto exit; + } +exit: + kfree(hotlist_params); + return err; +} +static int wl_cfgvendor_set_batch_scan_cfg(struct wiphy *wiphy, + struct wireless_dev *wdev, const void *data, int len) +{ + int err = 0, tmp, type; + struct bcm_cfg80211 *cfg = wiphy_priv(wiphy); + gscan_batch_params_t batch_param; + const struct nlattr *iter; + + batch_param.mscan = batch_param.bestn = 0; + batch_param.buffer_threshold = GSCAN_BATCH_NO_THR_SET; + + nla_for_each_attr(iter, data, len, tmp) { + type = nla_type(iter); + + switch (type) { + case GSCAN_ATTRIBUTE_NUM_AP_PER_SCAN: + batch_param.bestn = nla_get_u32(iter); + break; + case GSCAN_ATTRIBUTE_NUM_SCANS_TO_CACHE: + batch_param.mscan = nla_get_u32(iter); + break; + case GSCAN_ATTRIBUTE_REPORT_THRESHOLD: + batch_param.buffer_threshold = nla_get_u32(iter); + break; + } + } + + if (dhd_dev_pno_set_cfg_gscan(bcmcfg_to_prmry_ndev(cfg), + DHD_PNO_BATCH_SCAN_CFG_ID, &batch_param, 0) < 0) { + WL_ERR(("Could not set batch cfg\n")); + err = -EINVAL; + return err; + } + + return err; +} + +static int wl_cfgvendor_significant_change_cfg(struct wiphy *wiphy, + struct wireless_dev *wdev, const void *data, int len) +{ + int err = 0; + struct bcm_cfg80211 *cfg = wiphy_priv(wiphy); + gscan_swc_params_t *significant_params; + int tmp, tmp1, tmp2, type, j = 0; + const struct nlattr *outer, *inner, *iter; + uint8 flush = 0; + wl_pfn_significant_bssid_t *pbssid; + + significant_params = (gscan_swc_params_t *) kzalloc(len, GFP_KERNEL); + if (!significant_params) { + WL_ERR(("Cannot Malloc mem to parse config commands size - %d bytes \n", len)); + return -1; + } + + + nla_for_each_attr(iter, data, len, tmp2) { + type = nla_type(iter); + + switch (type) { + case GSCAN_ATTRIBUTE_SIGNIFICANT_CHANGE_FLUSH: + flush = nla_get_u8(iter); + break; + case GSCAN_ATTRIBUTE_RSSI_SAMPLE_SIZE: + significant_params->rssi_window = nla_get_u16(iter); + break; + case GSCAN_ATTRIBUTE_LOST_AP_SAMPLE_SIZE: + significant_params->lost_ap_window = nla_get_u16(iter); + break; + case GSCAN_ATTRIBUTE_MIN_BREACHING: + significant_params->swc_threshold = nla_get_u16(iter); + break; + case GSCAN_ATTRIBUTE_SIGNIFICANT_CHANGE_BSSIDS: + pbssid = significant_params->bssid_elem_list; + nla_for_each_nested(outer, iter, tmp) { + nla_for_each_nested(inner, outer, tmp1) { + switch (nla_type(inner)) { + case GSCAN_ATTRIBUTE_BSSID: + memcpy(&(pbssid[j].macaddr), + nla_data(inner), + ETHER_ADDR_LEN); + break; + case GSCAN_ATTRIBUTE_RSSI_HIGH: + pbssid[j].rssi_high_threshold = + (int8) nla_get_u8(inner); + break; + case GSCAN_ATTRIBUTE_RSSI_LOW: + pbssid[j].rssi_low_threshold = + (int8) nla_get_u8(inner); + break; + } + } + j++; + } + break; + } + } + significant_params->nbssid = j; + + if (dhd_dev_pno_set_cfg_gscan(bcmcfg_to_prmry_ndev(cfg), + DHD_PNO_SIGNIFICANT_SCAN_CFG_ID, significant_params, flush) < 0) { + WL_ERR(("Could not set GSCAN significant cfg\n")); + err = -EINVAL; + goto exit; + } +exit: + kfree(significant_params); + return err; +} +#endif /* GSCAN_SUPPORT */ + +#if defined(RTT_SUPPORT) && 0 +void wl_cfgvendor_rtt_evt(void *ctx, void *rtt_data) +{ + struct wireless_dev *wdev = (struct wireless_dev *)ctx; + struct wiphy *wiphy; + struct sk_buff *skb; + uint32 tot_len = NLMSG_DEFAULT_SIZE, entry_len = 0; + gfp_t kflags; + rtt_report_t *rtt_report = NULL; + rtt_result_t *rtt_result = NULL; + struct list_head *rtt_list; + wiphy = wdev->wiphy; + + WL_DBG(("In\n")); + /* Push the data to the skb */ + if (!rtt_data) { + WL_ERR(("rtt_data is NULL\n")); + goto exit; + } + rtt_list = (struct list_head *)rtt_data; + kflags = in_atomic() ? GFP_ATOMIC : GFP_KERNEL; + /* Alloc the SKB for vendor_event */ + skb = rtw_cfg80211_vendor_event_alloc(wiphy, tot_len, GOOGLE_RTT_COMPLETE_EVENT, kflags); + if (!skb) { + WL_ERR(("skb alloc failed")); + goto exit; + } + /* fill in the rtt results on each entry */ + list_for_each_entry(rtt_result, rtt_list, list) { + entry_len = 0; + if (rtt_result->TOF_type == TOF_TYPE_ONE_WAY) { + entry_len = sizeof(rtt_report_t); + rtt_report = kzalloc(entry_len, kflags); + if (!rtt_report) { + WL_ERR(("rtt_report alloc failed")); + goto exit; + } + rtt_report->addr = rtt_result->peer_mac; + rtt_report->num_measurement = 1; /* ONE SHOT */ + rtt_report->status = rtt_result->err_code; + rtt_report->type = (rtt_result->TOF_type == TOF_TYPE_ONE_WAY) ? RTT_ONE_WAY: RTT_TWO_WAY; + rtt_report->peer = rtt_result->target_info->peer; + rtt_report->channel = rtt_result->target_info->channel; + rtt_report->rssi = rtt_result->avg_rssi; + /* tx_rate */ + rtt_report->tx_rate = rtt_result->tx_rate; + /* RTT */ + rtt_report->rtt = rtt_result->meanrtt; + rtt_report->rtt_sd = rtt_result->sdrtt; + /* convert to centi meter */ + if (rtt_result->distance != 0xffffffff) + rtt_report->distance = (rtt_result->distance >> 2) * 25; + else /* invalid distance */ + rtt_report->distance = -1; + + rtt_report->ts = rtt_result->ts; + nla_append(skb, entry_len, rtt_report); + kfree(rtt_report); + } + } + rtw_cfg80211_vendor_event(skb, kflags); +exit: + return; +} + +static int wl_cfgvendor_rtt_set_config(struct wiphy *wiphy, struct wireless_dev *wdev, + const void *data, int len) { + int err = 0, rem, rem1, rem2, type; + rtt_config_params_t rtt_param; + rtt_target_info_t* rtt_target = NULL; + const struct nlattr *iter, *iter1, *iter2; + int8 eabuf[ETHER_ADDR_STR_LEN]; + int8 chanbuf[CHANSPEC_STR_LEN]; + struct bcm_cfg80211 *cfg = wiphy_priv(wiphy); + + WL_DBG(("In\n")); + err = dhd_dev_rtt_register_noti_callback(wdev->netdev, wdev, wl_cfgvendor_rtt_evt); + if (err < 0) { + WL_ERR(("failed to register rtt_noti_callback\n")); + goto exit; + } + memset(&rtt_param, 0, sizeof(rtt_param)); + nla_for_each_attr(iter, data, len, rem) { + type = nla_type(iter); + switch (type) { + case RTT_ATTRIBUTE_TARGET_CNT: + rtt_param.rtt_target_cnt = nla_get_u8(iter); + if (rtt_param.rtt_target_cnt > RTT_MAX_TARGET_CNT) { + WL_ERR(("exceed max target count : %d\n", + rtt_param.rtt_target_cnt)); + err = BCME_RANGE; + } + break; + case RTT_ATTRIBUTE_TARGET_INFO: + rtt_target = rtt_param.target_info; + nla_for_each_nested(iter1, iter, rem1) { + nla_for_each_nested(iter2, iter1, rem2) { + type = nla_type(iter2); + switch (type) { + case RTT_ATTRIBUTE_TARGET_MAC: + memcpy(&rtt_target->addr, nla_data(iter2), ETHER_ADDR_LEN); + break; + case RTT_ATTRIBUTE_TARGET_TYPE: + rtt_target->type = nla_get_u8(iter2); + break; + case RTT_ATTRIBUTE_TARGET_PEER: + rtt_target->peer= nla_get_u8(iter2); + break; + case RTT_ATTRIBUTE_TARGET_CHAN: + memcpy(&rtt_target->channel, nla_data(iter2), + sizeof(rtt_target->channel)); + break; + case RTT_ATTRIBUTE_TARGET_MODE: + rtt_target->continuous = nla_get_u8(iter2); + break; + case RTT_ATTRIBUTE_TARGET_INTERVAL: + rtt_target->interval = nla_get_u32(iter2); + break; + case RTT_ATTRIBUTE_TARGET_NUM_MEASUREMENT: + rtt_target->measure_cnt = nla_get_u32(iter2); + break; + case RTT_ATTRIBUTE_TARGET_NUM_PKT: + rtt_target->ftm_cnt = nla_get_u32(iter2); + break; + case RTT_ATTRIBUTE_TARGET_NUM_RETRY: + rtt_target->retry_cnt = nla_get_u32(iter2); + } + } + /* convert to chanspec value */ + rtt_target->chanspec = dhd_rtt_convert_to_chspec(rtt_target->channel); + if (rtt_target->chanspec == 0) { + WL_ERR(("Channel is not valid \n")); + goto exit; + } + WL_INFORM(("Target addr %s, Channel : %s for RTT \n", + bcm_ether_ntoa((const struct ether_addr *)&rtt_target->addr, eabuf), + wf_chspec_ntoa(rtt_target->chanspec, chanbuf))); + rtt_target++; + } + break; + } + } + WL_DBG(("leave :target_cnt : %d\n", rtt_param.rtt_target_cnt)); + if (dhd_dev_rtt_set_cfg(bcmcfg_to_prmry_ndev(cfg), &rtt_param) < 0) { + WL_ERR(("Could not set RTT configuration\n")); + err = -EINVAL; + } +exit: + return err; +} + +static int wl_cfgvendor_rtt_cancel_config(struct wiphy *wiphy, struct wireless_dev *wdev, + const void *data, int len) +{ + int err = 0, rem, type, target_cnt = 0; + const struct nlattr *iter; + struct ether_addr *mac_list = NULL, *mac_addr = NULL; + struct bcm_cfg80211 *cfg = wiphy_priv(wiphy); + + nla_for_each_attr(iter, data, len, rem) { + type = nla_type(iter); + switch (type) { + case RTT_ATTRIBUTE_TARGET_CNT: + target_cnt = nla_get_u8(iter); + mac_list = (struct ether_addr *)kzalloc(target_cnt * ETHER_ADDR_LEN , GFP_KERNEL); + if (mac_list == NULL) { + WL_ERR(("failed to allocate mem for mac list\n")); + goto exit; + } + mac_addr = &mac_list[0]; + break; + case RTT_ATTRIBUTE_TARGET_MAC: + if (mac_addr) + memcpy(mac_addr++, nla_data(iter), ETHER_ADDR_LEN); + else { + WL_ERR(("mac_list is NULL\n")); + goto exit; + } + break; + } + if (dhd_dev_rtt_cancel_cfg(bcmcfg_to_prmry_ndev(cfg), mac_list, target_cnt) < 0) { + WL_ERR(("Could not cancel RTT configuration\n")); + err = -EINVAL; + goto exit; + } + } +exit: + if (mac_list) + kfree(mac_list); + return err; +} +static int wl_cfgvendor_rtt_get_capability(struct wiphy *wiphy, struct wireless_dev *wdev, + const void *data, int len) +{ + int err = 0; + struct bcm_cfg80211 *cfg = wiphy_priv(wiphy); + rtt_capabilities_t capability; + + err = dhd_dev_rtt_capability(bcmcfg_to_prmry_ndev(cfg), &capability); + if (unlikely(err)) { + WL_ERR(("Vendor Command reply failed ret:%d \n", err)); + goto exit; + } + err = rtw_cfgvendor_send_cmd_reply(wiphy, bcmcfg_to_prmry_ndev(cfg), + &capability, sizeof(capability)); + + if (unlikely(err)) { + WL_ERR(("Vendor Command reply failed ret:%d \n", err)); + } +exit: + return err; +} + +#endif /* RTT_SUPPORT */ +static int wl_cfgvendor_priv_string_handler(struct wiphy *wiphy, + struct wireless_dev *wdev, const void *data, int len) +{ + int err = 0; + u8 resp[1] = {'\0'}; + + DBG_871X_LEVEL(_drv_always_, FUNC_NDEV_FMT" %s\n", FUNC_NDEV_ARG(wdev_to_ndev(wdev)), (char*)data); + err = rtw_cfgvendor_send_cmd_reply(wiphy, wdev_to_ndev(wdev), resp, 1); + if (unlikely(err)) + DBG_871X_LEVEL(_drv_err_, FUNC_NDEV_FMT"Vendor Command reply failed ret:%d \n" + , FUNC_NDEV_ARG(wdev_to_ndev(wdev)), err); + + return err; +#if 0 + struct bcm_cfg80211 *cfg = wiphy_priv(wiphy); + int err = 0; + int data_len = 0; + + bzero(cfg->ioctl_buf, WLC_IOCTL_MAXLEN); + + if (strncmp((char *)data, BRCM_VENDOR_SCMD_CAPA, strlen(BRCM_VENDOR_SCMD_CAPA)) == 0) { + err = wldev_iovar_getbuf(bcmcfg_to_prmry_ndev(cfg), "cap", NULL, 0, + cfg->ioctl_buf, WLC_IOCTL_MAXLEN, &cfg->ioctl_buf_sync); + if (unlikely(err)) { + WL_ERR(("error (%d)\n", err)); + return err; + } + data_len = strlen(cfg->ioctl_buf); + cfg->ioctl_buf[data_len] = '\0'; + } + + err = rtw_cfgvendor_send_cmd_reply(wiphy, bcmcfg_to_prmry_ndev(cfg), + cfg->ioctl_buf, data_len+1); + if (unlikely(err)) + WL_ERR(("Vendor Command reply failed ret:%d \n", err)); + else + WL_INFORM(("Vendor Command reply sent successfully!\n")); + + return err; +#endif +} + +static const struct wiphy_vendor_command rtw_vendor_cmds [] = { + { + { + .vendor_id = OUI_BRCM, + .subcmd = BRCM_VENDOR_SCMD_PRIV_STR + }, + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, + .doit = wl_cfgvendor_priv_string_handler + }, +#if defined(GSCAN_SUPPORT) && 0 + { + { + .vendor_id = OUI_GOOGLE, + .subcmd = GSCAN_SUBCMD_GET_CAPABILITIES + }, + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, + .doit = wl_cfgvendor_gscan_get_capabilities + }, + { + { + .vendor_id = OUI_GOOGLE, + .subcmd = GSCAN_SUBCMD_SET_CONFIG + }, + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, + .doit = wl_cfgvendor_set_scan_cfg + }, + { + { + .vendor_id = OUI_GOOGLE, + .subcmd = GSCAN_SUBCMD_SET_SCAN_CONFIG + }, + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, + .doit = wl_cfgvendor_set_batch_scan_cfg + }, + { + { + .vendor_id = OUI_GOOGLE, + .subcmd = GSCAN_SUBCMD_ENABLE_GSCAN + }, + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, + .doit = wl_cfgvendor_initiate_gscan + }, + { + { + .vendor_id = OUI_GOOGLE, + .subcmd = GSCAN_SUBCMD_ENABLE_FULL_SCAN_RESULTS + }, + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, + .doit = wl_cfgvendor_enable_full_scan_result + }, + { + { + .vendor_id = OUI_GOOGLE, + .subcmd = GSCAN_SUBCMD_SET_HOTLIST + }, + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, + .doit = wl_cfgvendor_hotlist_cfg + }, + { + { + .vendor_id = OUI_GOOGLE, + .subcmd = GSCAN_SUBCMD_SET_SIGNIFICANT_CHANGE_CONFIG + }, + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, + .doit = wl_cfgvendor_significant_change_cfg + }, + { + { + .vendor_id = OUI_GOOGLE, + .subcmd = GSCAN_SUBCMD_GET_SCAN_RESULTS + }, + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, + .doit = wl_cfgvendor_gscan_get_batch_results + }, + { + { + .vendor_id = OUI_GOOGLE, + .subcmd = GSCAN_SUBCMD_GET_CHANNEL_LIST + }, + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, + .doit = wl_cfgvendor_gscan_get_channel_list + }, +#endif /* GSCAN_SUPPORT */ +#if defined(RTT_SUPPORT) && 0 + { + { + .vendor_id = OUI_GOOGLE, + .subcmd = RTT_SUBCMD_SET_CONFIG + }, + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, + .doit = wl_cfgvendor_rtt_set_config + }, + { + { + .vendor_id = OUI_GOOGLE, + .subcmd = RTT_SUBCMD_CANCEL_CONFIG + }, + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, + .doit = wl_cfgvendor_rtt_cancel_config + }, + { + { + .vendor_id = OUI_GOOGLE, + .subcmd = RTT_SUBCMD_GETCAPABILITY + }, + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, + .doit = wl_cfgvendor_rtt_get_capability + }, +#endif /* RTT_SUPPORT */ + { + { + .vendor_id = OUI_GOOGLE, + .subcmd = ANDR_WIFI_SUBCMD_GET_FEATURE_SET + }, + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, + .doit = rtw_cfgvendor_get_feature_set + }, + { + { + .vendor_id = OUI_GOOGLE, + .subcmd = ANDR_WIFI_SUBCMD_GET_FEATURE_SET_MATRIX + }, + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, + .doit = rtw_cfgvendor_get_feature_set_matrix + } +}; + +static const struct nl80211_vendor_cmd_info rtw_vendor_events [] = { + { OUI_BRCM, BRCM_VENDOR_EVENT_UNSPEC }, + { OUI_BRCM, BRCM_VENDOR_EVENT_PRIV_STR }, +#if defined(GSCAN_SUPPORT) && 0 + { OUI_GOOGLE, GOOGLE_GSCAN_SIGNIFICANT_EVENT }, + { OUI_GOOGLE, GOOGLE_GSCAN_GEOFENCE_FOUND_EVENT }, + { OUI_GOOGLE, GOOGLE_GSCAN_BATCH_SCAN_EVENT }, + { OUI_GOOGLE, GOOGLE_SCAN_FULL_RESULTS_EVENT }, +#endif /* GSCAN_SUPPORT */ +#if defined(RTT_SUPPORT) && 0 + { OUI_GOOGLE, GOOGLE_RTT_COMPLETE_EVENT }, +#endif /* RTT_SUPPORT */ +#if defined(GSCAN_SUPPORT) && 0 + { OUI_GOOGLE, GOOGLE_SCAN_COMPLETE_EVENT }, + { OUI_GOOGLE, GOOGLE_GSCAN_GEOFENCE_LOST_EVENT } +#endif /* GSCAN_SUPPORT */ +}; + +int rtw_cfgvendor_attach(struct wiphy *wiphy) +{ + + DBG_871X("Register RTW cfg80211 vendor cmd(0x%x) interface \n", NL80211_CMD_VENDOR); + + wiphy->vendor_commands = rtw_vendor_cmds; + wiphy->n_vendor_commands = ARRAY_SIZE(rtw_vendor_cmds); + wiphy->vendor_events = rtw_vendor_events; + wiphy->n_vendor_events = ARRAY_SIZE(rtw_vendor_events); + + return 0; +} + +int rtw_cfgvendor_detach(struct wiphy *wiphy) +{ + DBG_871X("Vendor: Unregister RTW cfg80211 vendor interface \n"); + + wiphy->vendor_commands = NULL; + wiphy->vendor_events = NULL; + wiphy->n_vendor_commands = 0; + wiphy->n_vendor_events = 0; + + return 0; +} +#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) || defined(RTW_VENDOR_EXT_SUPPORT) */ + +#endif /* CONFIG_IOCTL_CFG80211 */ + diff --git a/backports/drivers/realtek/rtl8812au/os_dep/linux/rtw_cfgvendor.h b/backports/drivers/realtek/rtl8812au/os_dep/linux/rtw_cfgvendor.h new file mode 100644 index 00000000000000..7c349e79daa289 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/os_dep/linux/rtw_cfgvendor.h @@ -0,0 +1,246 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2014 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ + +#ifndef _RTW_CFGVENDOR_H_ +#define _RTW_CFGVENDOR_H_ + +#define OUI_BRCM 0x001018 +#define OUI_GOOGLE 0x001A11 +#define BRCM_VENDOR_SUBCMD_PRIV_STR 1 +#define ATTRIBUTE_U32_LEN (NLA_HDRLEN + 4) +#define VENDOR_ID_OVERHEAD ATTRIBUTE_U32_LEN +#define VENDOR_SUBCMD_OVERHEAD ATTRIBUTE_U32_LEN +#define VENDOR_DATA_OVERHEAD (NLA_HDRLEN) + +#define SCAN_RESULTS_COMPLETE_FLAG_LEN ATTRIBUTE_U32_LEN +#define SCAN_INDEX_HDR_LEN (NLA_HDRLEN) +#define SCAN_ID_HDR_LEN ATTRIBUTE_U32_LEN +#define SCAN_FLAGS_HDR_LEN ATTRIBUTE_U32_LEN +#define GSCAN_NUM_RESULTS_HDR_LEN ATTRIBUTE_U32_LEN +#define GSCAN_RESULTS_HDR_LEN (NLA_HDRLEN) +#define GSCAN_BATCH_RESULT_HDR_LEN (SCAN_INDEX_HDR_LEN + SCAN_ID_HDR_LEN + \ + SCAN_FLAGS_HDR_LEN + \ + GSCAN_NUM_RESULTS_HDR_LEN + \ + GSCAN_RESULTS_HDR_LEN) + +#define VENDOR_REPLY_OVERHEAD (VENDOR_ID_OVERHEAD + \ + VENDOR_SUBCMD_OVERHEAD + \ + VENDOR_DATA_OVERHEAD) +typedef enum { + /* don't use 0 as a valid subcommand */ + VENDOR_NL80211_SUBCMD_UNSPECIFIED, + + /* define all vendor startup commands between 0x0 and 0x0FFF */ + VENDOR_NL80211_SUBCMD_RANGE_START = 0x0001, + VENDOR_NL80211_SUBCMD_RANGE_END = 0x0FFF, + + /* define all GScan related commands between 0x1000 and 0x10FF */ + ANDROID_NL80211_SUBCMD_GSCAN_RANGE_START = 0x1000, + ANDROID_NL80211_SUBCMD_GSCAN_RANGE_END = 0x10FF, + + /* define all NearbyDiscovery related commands between 0x1100 and 0x11FF */ + ANDROID_NL80211_SUBCMD_NBD_RANGE_START = 0x1100, + ANDROID_NL80211_SUBCMD_NBD_RANGE_END = 0x11FF, + + /* define all RTT related commands between 0x1100 and 0x11FF */ + ANDROID_NL80211_SUBCMD_RTT_RANGE_START = 0x1100, + ANDROID_NL80211_SUBCMD_RTT_RANGE_END = 0x11FF, + + ANDROID_NL80211_SUBCMD_LSTATS_RANGE_START = 0x1200, + ANDROID_NL80211_SUBCMD_LSTATS_RANGE_END = 0x12FF, + + ANDROID_NL80211_SUBCMD_TDLS_RANGE_START = 0x1300, + ANDROID_NL80211_SUBCMD_TDLS_RANGE_END = 0x13FF, + /* This is reserved for future usage */ + +} ANDROID_VENDOR_SUB_COMMAND; + +enum wl_vendor_subcmd { + BRCM_VENDOR_SCMD_UNSPEC, + BRCM_VENDOR_SCMD_PRIV_STR, + GSCAN_SUBCMD_GET_CAPABILITIES = ANDROID_NL80211_SUBCMD_GSCAN_RANGE_START, + GSCAN_SUBCMD_SET_CONFIG, + GSCAN_SUBCMD_SET_SCAN_CONFIG, + GSCAN_SUBCMD_ENABLE_GSCAN, + GSCAN_SUBCMD_GET_SCAN_RESULTS, + GSCAN_SUBCMD_SCAN_RESULTS, + GSCAN_SUBCMD_SET_HOTLIST, + GSCAN_SUBCMD_SET_SIGNIFICANT_CHANGE_CONFIG, + GSCAN_SUBCMD_ENABLE_FULL_SCAN_RESULTS, + GSCAN_SUBCMD_GET_CHANNEL_LIST, + ANDR_WIFI_SUBCMD_GET_FEATURE_SET, + ANDR_WIFI_SUBCMD_GET_FEATURE_SET_MATRIX, + RTT_SUBCMD_SET_CONFIG = ANDROID_NL80211_SUBCMD_RTT_RANGE_START, + RTT_SUBCMD_CANCEL_CONFIG, + RTT_SUBCMD_GETCAPABILITY, + /* Add more sub commands here */ + VENDOR_SUBCMD_MAX +}; + +enum gscan_attributes { + GSCAN_ATTRIBUTE_NUM_BUCKETS = 10, + GSCAN_ATTRIBUTE_BASE_PERIOD, + GSCAN_ATTRIBUTE_BUCKETS_BAND, + GSCAN_ATTRIBUTE_BUCKET_ID, + GSCAN_ATTRIBUTE_BUCKET_PERIOD, + GSCAN_ATTRIBUTE_BUCKET_NUM_CHANNELS, + GSCAN_ATTRIBUTE_BUCKET_CHANNELS, + GSCAN_ATTRIBUTE_NUM_AP_PER_SCAN, + GSCAN_ATTRIBUTE_REPORT_THRESHOLD, + GSCAN_ATTRIBUTE_NUM_SCANS_TO_CACHE, + GSCAN_ATTRIBUTE_BAND = GSCAN_ATTRIBUTE_BUCKETS_BAND, + + GSCAN_ATTRIBUTE_ENABLE_FEATURE = 20, + GSCAN_ATTRIBUTE_SCAN_RESULTS_COMPLETE, + GSCAN_ATTRIBUTE_FLUSH_FEATURE, + GSCAN_ATTRIBUTE_ENABLE_FULL_SCAN_RESULTS, + GSCAN_ATTRIBUTE_REPORT_EVENTS, + /* remaining reserved for additional attributes */ + GSCAN_ATTRIBUTE_NUM_OF_RESULTS = 30, + GSCAN_ATTRIBUTE_FLUSH_RESULTS, + GSCAN_ATTRIBUTE_SCAN_RESULTS, /* flat array of wifi_scan_result */ + GSCAN_ATTRIBUTE_SCAN_ID, /* indicates scan number */ + GSCAN_ATTRIBUTE_SCAN_FLAGS, /* indicates if scan was aborted */ + GSCAN_ATTRIBUTE_AP_FLAGS, /* flags on significant change event */ + GSCAN_ATTRIBUTE_NUM_CHANNELS, + GSCAN_ATTRIBUTE_CHANNEL_LIST, + + /* remaining reserved for additional attributes */ + + GSCAN_ATTRIBUTE_SSID = 40, + GSCAN_ATTRIBUTE_BSSID, + GSCAN_ATTRIBUTE_CHANNEL, + GSCAN_ATTRIBUTE_RSSI, + GSCAN_ATTRIBUTE_TIMESTAMP, + GSCAN_ATTRIBUTE_RTT, + GSCAN_ATTRIBUTE_RTTSD, + + /* remaining reserved for additional attributes */ + + GSCAN_ATTRIBUTE_HOTLIST_BSSIDS = 50, + GSCAN_ATTRIBUTE_RSSI_LOW, + GSCAN_ATTRIBUTE_RSSI_HIGH, + GSCAN_ATTRIBUTE_HOSTLIST_BSSID_ELEM, + GSCAN_ATTRIBUTE_HOTLIST_FLUSH, + + /* remaining reserved for additional attributes */ + GSCAN_ATTRIBUTE_RSSI_SAMPLE_SIZE = 60, + GSCAN_ATTRIBUTE_LOST_AP_SAMPLE_SIZE, + GSCAN_ATTRIBUTE_MIN_BREACHING, + GSCAN_ATTRIBUTE_SIGNIFICANT_CHANGE_BSSIDS, + GSCAN_ATTRIBUTE_SIGNIFICANT_CHANGE_FLUSH, + GSCAN_ATTRIBUTE_MAX +}; + +enum gscan_bucket_attributes { + GSCAN_ATTRIBUTE_CH_BUCKET_1, + GSCAN_ATTRIBUTE_CH_BUCKET_2, + GSCAN_ATTRIBUTE_CH_BUCKET_3, + GSCAN_ATTRIBUTE_CH_BUCKET_4, + GSCAN_ATTRIBUTE_CH_BUCKET_5, + GSCAN_ATTRIBUTE_CH_BUCKET_6, + GSCAN_ATTRIBUTE_CH_BUCKET_7 +}; + +enum gscan_ch_attributes { + GSCAN_ATTRIBUTE_CH_ID_1, + GSCAN_ATTRIBUTE_CH_ID_2, + GSCAN_ATTRIBUTE_CH_ID_3, + GSCAN_ATTRIBUTE_CH_ID_4, + GSCAN_ATTRIBUTE_CH_ID_5, + GSCAN_ATTRIBUTE_CH_ID_6, + GSCAN_ATTRIBUTE_CH_ID_7 +}; + +enum rtt_attributes { + RTT_ATTRIBUTE_TARGET_CNT, + RTT_ATTRIBUTE_TARGET_INFO, + RTT_ATTRIBUTE_TARGET_MAC, + RTT_ATTRIBUTE_TARGET_TYPE, + RTT_ATTRIBUTE_TARGET_PEER, + RTT_ATTRIBUTE_TARGET_CHAN, + RTT_ATTRIBUTE_TARGET_MODE, + RTT_ATTRIBUTE_TARGET_INTERVAL, + RTT_ATTRIBUTE_TARGET_NUM_MEASUREMENT, + RTT_ATTRIBUTE_TARGET_NUM_PKT, + RTT_ATTRIBUTE_TARGET_NUM_RETRY +}; + +typedef enum wl_vendor_event { + BRCM_VENDOR_EVENT_UNSPEC, + BRCM_VENDOR_EVENT_PRIV_STR, + GOOGLE_GSCAN_SIGNIFICANT_EVENT, + GOOGLE_GSCAN_GEOFENCE_FOUND_EVENT, + GOOGLE_GSCAN_BATCH_SCAN_EVENT, + GOOGLE_SCAN_FULL_RESULTS_EVENT, + GOOGLE_RTT_COMPLETE_EVENT, + GOOGLE_SCAN_COMPLETE_EVENT, + GOOGLE_GSCAN_GEOFENCE_LOST_EVENT +} wl_vendor_event_t; + +enum andr_wifi_feature_set_attr { + ANDR_WIFI_ATTRIBUTE_NUM_FEATURE_SET, + ANDR_WIFI_ATTRIBUTE_FEATURE_SET +}; + +typedef enum wl_vendor_gscan_attribute { + ATTR_START_GSCAN, + ATTR_STOP_GSCAN, + ATTR_SET_SCAN_BATCH_CFG_ID, /* set batch scan params */ + ATTR_SET_SCAN_GEOFENCE_CFG_ID, /* set list of bssids to track */ + ATTR_SET_SCAN_SIGNIFICANT_CFG_ID, /* set list of bssids, rssi threshold etc.. */ + ATTR_SET_SCAN_CFG_ID, /* set common scan config params here */ + ATTR_GET_GSCAN_CAPABILITIES_ID, + /* Add more sub commands here */ + ATTR_GSCAN_MAX +} wl_vendor_gscan_attribute_t; + +typedef enum gscan_batch_attribute { + ATTR_GSCAN_BATCH_BESTN, + ATTR_GSCAN_BATCH_MSCAN, + ATTR_GSCAN_BATCH_BUFFER_THRESHOLD +} gscan_batch_attribute_t; + +typedef enum gscan_geofence_attribute { + ATTR_GSCAN_NUM_HOTLIST_BSSID, + ATTR_GSCAN_HOTLIST_BSSID +} gscan_geofence_attribute_t; + +typedef enum gscan_complete_event { + WIFI_SCAN_BUFFER_FULL, + WIFI_SCAN_COMPLETE +} gscan_complete_event_t; + +/* Capture the BRCM_VENDOR_SUBCMD_PRIV_STRINGS* here */ +#define BRCM_VENDOR_SCMD_CAPA "cap" + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) || defined(RTW_VENDOR_EXT_SUPPORT) +extern int rtw_cfgvendor_attach(struct wiphy *wiphy); +extern int rtw_cfgvendor_detach(struct wiphy *wiphy); +extern int rtw_cfgvendor_send_async_event(struct wiphy *wiphy, + struct net_device *dev, int event_id, const void *data, int len); +#if defined(GSCAN_SUPPORT) && 0 +extern int wl_cfgvendor_send_hotlist_event(struct wiphy *wiphy, + struct net_device *dev, void *data, int len, wl_vendor_event_t event); +#endif +#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) || defined(RTW_VENDOR_EXT_SUPPORT) */ + +#endif /* _RTW_CFGVENDOR_H_ */ + diff --git a/backports/drivers/realtek/rtl8812au/os_dep/linux/rtw_proc.c b/backports/drivers/realtek/rtl8812au/os_dep/linux/rtw_proc.c index 8edd51fbde859a..be7c6a4b38f0c8 100755 --- a/backports/drivers/realtek/rtl8812au/os_dep/linux/rtw_proc.c +++ b/backports/drivers/realtek/rtl8812au/os_dep/linux/rtw_proc.c @@ -19,6 +19,7 @@ ******************************************************************************/ #include +#include #include "rtw_proc.h" #ifdef CONFIG_PROC_DEBUG @@ -69,9 +70,9 @@ inline struct proc_dir_entry *rtw_proc_create_entry(const char *name, struct pro struct proc_dir_entry *entry; #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)) - entry = proc_create_data(name, S_IFREG|S_IRUGO, parent, fops, data); + entry = proc_create_data(name, S_IFREG|S_IRUGO|S_IWUGO, parent, fops, data); #else - entry = create_proc_entry(name, S_IFREG|S_IRUGO, parent); + entry = create_proc_entry(name, S_IFREG|S_IRUGO|S_IWUGO, parent); if (entry) { entry->data = data; entry->proc_fops = fops; @@ -110,7 +111,7 @@ static ssize_t proc_set_log_level(struct file *file, const char __user *buffer, int num = sscanf(tmp, "%d ", &log_level); - if( log_level >= _drv_always_ && log_level < _drv_debug_ ) + if( log_level >= _drv_always_ && log_level <= _drv_debug_ ) { GlobalDebugLevel= log_level; printk("%d\n", GlobalDebugLevel); @@ -262,6 +263,387 @@ static int proc_get_rf_reg_dump(struct seq_file *m, void *v) return 0; } + +//gpio setting +#ifdef CONFIG_GPIO_API +static ssize_t proc_set_config_gpio(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data) +{ + struct net_device *dev = data; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + char tmp[32]={0}; + int num=0,gpio_pin=0,gpio_mode=0;//gpio_mode:0 input 1:output; + + if (count < 2) + return -EFAULT; + if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) + { + num =sscanf(tmp, "%d %d",&gpio_pin,&gpio_mode); + DBG_871X("num=%d gpio_pin=%d mode=%d\n",num,gpio_pin,gpio_mode); + padapter->pre_gpio_pin=gpio_pin; + + if(gpio_mode==0 || gpio_mode==1 ) + rtw_hal_config_gpio(padapter, gpio_pin,gpio_mode); + } + return count; + +} +static ssize_t proc_set_gpio_output_value(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data) +{ + struct net_device *dev = data; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + char tmp[32]={0}; + int num=0,gpio_pin=0,pin_mode=0;//pin_mode: 1 high 0:low + + if (count < 2) + return -EFAULT; + if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) + { + num =sscanf(tmp, "%d %d",&gpio_pin,&pin_mode); + DBG_871X("num=%d gpio_pin=%d pin_high=%d\n",num,gpio_pin,pin_mode); + padapter->pre_gpio_pin=gpio_pin; + + if(pin_mode==0 || pin_mode==1 ) + rtw_hal_set_gpio_output_value(padapter, gpio_pin,pin_mode); + } + return count; +} +static int proc_get_gpio(struct seq_file *m, void *v) +{ + u8 gpioreturnvalue=0; + struct net_device *dev = m->private; + + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + if(!padapter) + return -EFAULT; + gpioreturnvalue = rtw_hal_get_gpio(padapter, padapter->pre_gpio_pin); + DBG_871X_SEL_NL(m, "get_gpio %d:%d \n",padapter->pre_gpio_pin ,gpioreturnvalue); + + return 0; + +} +static ssize_t proc_set_gpio(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data) +{ + struct net_device *dev = data; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + char tmp[32]={0}; + int num=0,gpio_pin=0; + + if (count < 1) + return -EFAULT; + if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) + { + num =sscanf(tmp, "%d",&gpio_pin); + DBG_871X("num=%d gpio_pin=%d\n",num,gpio_pin); + padapter->pre_gpio_pin=gpio_pin; + + } + return count; +} +#endif + + +static int proc_get_linked_info_dump(struct seq_file *m, void *v) +{ + struct net_device *dev = m->private; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + if(padapter) + DBG_871X_SEL_NL(m, "linked_info_dump :%s \n", (padapter->bLinkInfoDump)?"enable":"disable"); + + return 0; +} + +static ssize_t proc_set_linked_info_dump(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data) +{ + struct net_device *dev = data; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + + char tmp[32]={0}; + int mode=0,pre_mode=0; + int num=0; + + if (count < 1) + return -EFAULT; + + pre_mode=padapter->bLinkInfoDump; + DBG_871X("pre_mode=%d \n",pre_mode); + + if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) + { + num =sscanf(tmp, "%d ", &mode); + DBG_871X("num=%d mode=%d\n",num,mode); + + if(num!=1) + { + DBG_871X("argument number is wrong\n"); + return -EFAULT; + } + + if(mode==1 || (mode==0 && pre_mode==1) ) //not consider pwr_saving 0: + { + padapter->bLinkInfoDump = mode; + + } + else if( (mode==2 ) || (mode==0 && pre_mode==2))//consider power_saving + { + //DBG_871X("linked_info_dump =%s \n", (padapter->bLinkInfoDump)?"enable":"disable") + linked_info_dump(padapter,mode); + } + } + return count; +} + +static int proc_get_mac_qinfo(struct seq_file *m, void *v) +{ + struct net_device *dev = m->private; + _adapter *adapter = (_adapter *)rtw_netdev_priv(dev); + + rtw_hal_get_hwreg(adapter, HW_VAR_DUMP_MAC_QUEUE_INFO, (u8 *)m); + + return 0; +} + +int proc_get_wifi_spec(struct seq_file *m, void *v) +{ + struct net_device *dev = m->private; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + struct registry_priv *pregpriv = &padapter->registrypriv; + + DBG_871X_SEL_NL(m,"wifi_spec=%d\n",pregpriv->wifi_spec); + return 0; +} + +static int proc_get_chan_plan(struct seq_file *m, void *v) +{ + struct net_device *dev = m->private; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + + DBG_871X_SEL_NL(m,"Channel plan=0x%02x\n",padapter->mlmepriv.ChannelPlan); + return 0; +} +static ssize_t proc_set_chan_plan(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data) +{ + struct net_device *dev = data; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + struct SetChannelPlan_param setChannelPlan_param; + + char tmp[32]; + u8 chan_plan = RT_CHANNEL_DOMAIN_REALTEK_DEFINE; + + if (!padapter) + return -EFAULT; + + if (count < 1) + { + DBG_871X("argument size is less than 1\n"); + return -EFAULT; + } + + if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) { + + int num = sscanf(tmp, "%hhx", &chan_plan); + + if (num != 1) { + DBG_871X("invalid read_reg parameter!\n"); + return count; + } + + } + setChannelPlan_param.channel_plan = chan_plan; + if( H2C_SUCCESS != set_chplan_hdl(padapter, (unsigned char *)&setChannelPlan_param) ) + return -EFAULT; + + return count; + +} + +static int proc_get_udpport(struct seq_file *m, void *v) +{ + struct net_device *dev = m->private; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + struct recv_priv *precvpriv = &(padapter->recvpriv); + + DBG_871X_SEL_NL(m,"%d\n",precvpriv->sink_udpport); + return 0; +} +static ssize_t proc_set_udpport(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data) +{ + struct net_device *dev = data; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + struct recv_priv *precvpriv = &(padapter->recvpriv); + int sink_udpport = 0; + char tmp[32]; + + + if (!padapter) + return -EFAULT; + + if (count < 1) + { + DBG_871X("argument size is less than 1\n"); + return -EFAULT; + } + + if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) { + + int num = sscanf(tmp, "%d", &sink_udpport); + + if (num != 1) { + DBG_871X("invalid input parameter number!\n"); + return count; + } + + } + precvpriv->sink_udpport = sink_udpport; + + return count; + +} + +static int proc_get_macid_info(struct seq_file *m, void *v) +{ + struct net_device *dev = m->private; + _adapter *adapter = (_adapter *)rtw_netdev_priv(dev); + struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); + struct macid_ctl_t *macid_ctl = dvobj_to_macidctl(dvobj); + u8 i; + + DBG_871X_SEL_NL(m, "max_num:%u\n", macid_ctl->num); + DBG_871X_SEL_NL(m, "\n"); + + DBG_871X_SEL_NL(m, "used:\n"); + dump_macid_map(m, &macid_ctl->used, macid_ctl->num); + DBG_871X_SEL_NL(m, "\n"); + + DBG_871X_SEL_NL(m, "%-3s %-3s %-4s %-4s" + "\n" + , "id", "bmc", "if_g", "ch_g" + ); + + for (i=0;inum;i++) { + if (rtw_macid_is_used(macid_ctl, i)) + DBG_871X_SEL_NL(m, "%3u %3u %4d %4d" + "\n" + , i + , rtw_macid_is_bmc(macid_ctl, i) + , rtw_macid_get_if_g(macid_ctl, i) + , rtw_macid_get_ch_g(macid_ctl, i) + ); + } + + return 0; +} + +static int proc_get_cam(struct seq_file *m, void *v) +{ + struct net_device *dev = m->private; + _adapter *adapter = (_adapter *)rtw_netdev_priv(dev); + u8 i; + + return 0; +} + +static ssize_t proc_set_cam(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data) +{ + struct net_device *dev = data; + _adapter *adapter; + + char tmp[32]; + char cmd[4]; + u8 id; + + adapter = (_adapter *)rtw_netdev_priv(dev); + if (!adapter) + return -EFAULT; + + if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) { + + /* c : clear specific cam entry */ + /* wfc : write specific cam entry from cam cache */ + + int num = sscanf(tmp, "%s %hhu", cmd, &id); + + if (num < 2) + return count; + + if (strcmp("c", cmd) == 0) { + _clear_cam_entry(adapter, id); + adapter->securitypriv.hw_decrypted = _FALSE; /* temporarily set this for TX path to use SW enc */ + } else if (strcmp("wfc", cmd) == 0) { + write_cam_from_cache(adapter, id); + } + } + + return count; +} + +static int proc_get_cam_cache(struct seq_file *m, void *v) +{ + struct net_device *dev = m->private; + _adapter *adapter = (_adapter *)rtw_netdev_priv(dev); + struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); + u8 i; + + DBG_871X_SEL_NL(m, "cam bitmap:0x%016llx\n", dvobj->cam_ctl.bitmap); + + DBG_871X_SEL_NL(m, "%-2s %-6s %-17s %-32s %-3s %-7s" + //" %-2s %-2s %-4s %-5s" + "\n" + , "id", "ctrl", "addr", "key", "kid", "type" + //, "MK", "GK", "MFB", "valid" + ); + + for (i=0;i<32;i++) { + if (dvobj->cam_cache[i].ctrl != 0) + DBG_871X_SEL_NL(m, "%2u 0x%04x "MAC_FMT" "KEY_FMT" %3u %-7s" + //" %2u %2u 0x%02x %5u" + "\n", i + , dvobj->cam_cache[i].ctrl + , MAC_ARG(dvobj->cam_cache[i].mac) + , KEY_ARG(dvobj->cam_cache[i].key) + , (dvobj->cam_cache[i].ctrl)&0x03 + , security_type_str(((dvobj->cam_cache[i].ctrl)>>2)&0x07) + //, ((dvobj->cam_cache[i].ctrl)>>5)&0x01 + //, ((dvobj->cam_cache[i].ctrl)>>6)&0x01 + //, ((dvobj->cam_cache[i].ctrl)>>8)&0x7f + //, ((dvobj->cam_cache[i].ctrl)>>15)&0x01 + ); + } + + return 0; +} + +#ifdef CONFIG_BT_COEXIST +ssize_t proc_set_btinfo_evt(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data) +{ + struct net_device *dev = data; + _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); + char tmp[32]; + u8 btinfo[8]; + + if (count < 6) + return -EFAULT; + + if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) { + int num = 0; + + _rtw_memset(btinfo, 0, 8); + + num = sscanf(tmp, "%hhx %hhx %hhx %hhx %hhx %hhx %hhx %hhx" + , &btinfo[0], &btinfo[1], &btinfo[2], &btinfo[3] + , &btinfo[4], &btinfo[5], &btinfo[6], &btinfo[7]); + + if (num < 6) + return -EINVAL; + + btinfo[1] = num-2; + + rtw_btinfo_cmd(padapter, btinfo, btinfo[1]+2); + } + + return count; +} +#endif + /* * rtw_adapter_proc: * init/deinit when register/unregister net_device @@ -275,12 +657,18 @@ const struct rtw_proc_hdl adapter_proc_hdls [] = { {"qos_option", proc_get_qos_option, NULL}, {"ht_option", proc_get_ht_option, NULL}, {"rf_info", proc_get_rf_info, NULL}, + {"survey_info", proc_get_survey_info, NULL}, {"ap_info", proc_get_ap_info, NULL}, {"adapter_state", proc_get_adapter_state, NULL}, - {"trx_info", proc_get_trx_info, NULL}, + {"trx_info", proc_get_trx_info, proc_reset_trx_info}, {"rate_ctl", proc_get_rate_ctl, proc_set_rate_ctl}, + {"dis_pwt_ctl", proc_get_dis_pwt, proc_set_dis_pwt}, + {"mac_qinfo", proc_get_mac_qinfo, NULL}, + {"macid_info", proc_get_macid_info, NULL}, + {"cam", proc_get_cam, proc_set_cam}, + {"cam_cache", proc_get_cam_cache, NULL}, {"suspend_info", proc_get_suspend_resume_info, NULL}, - + {"wifi_spec",proc_get_wifi_spec,NULL}, #ifdef CONFIG_LAYER2_ROAMING {"roam_flags", proc_get_roam_flags, proc_set_roam_flags}, {"roam_param", proc_get_roam_param, proc_set_roam_param}, @@ -292,6 +680,8 @@ const struct rtw_proc_hdl adapter_proc_hdls [] = { #endif /* CONFIG_SDIO_HCI */ {"fwdl_test_case", proc_get_dummy, proc_set_fwdl_test_case}, + {"del_rx_ampdu_test_case", proc_get_dummy, proc_set_del_rx_ampdu_test_case}, + {"wait_hiq_empty", proc_get_dummy, proc_set_wait_hiq_empty}, {"mac_reg_dump", proc_get_mac_reg_dump, NULL}, {"bb_reg_dump", proc_get_bb_reg_dump, NULL}, @@ -310,6 +700,7 @@ const struct rtw_proc_hdl adapter_proc_hdls [] = { #endif {"rx_signal", proc_get_rx_signal, proc_set_rx_signal}, + {"hw_info", proc_get_hw_status, NULL}, #ifdef CONFIG_80211N_HT {"ht_enable", proc_get_ht_enable, proc_set_ht_enable}, @@ -317,21 +708,59 @@ const struct rtw_proc_hdl adapter_proc_hdls [] = { {"ampdu_enable", proc_get_ampdu_enable, proc_set_ampdu_enable}, {"rx_stbc", proc_get_rx_stbc, proc_set_rx_stbc}, {"rx_ampdu", proc_get_rx_ampdu, proc_set_rx_ampdu}, + {"rx_ampdu_factor",proc_get_rx_ampdu_factor,proc_set_rx_ampdu_factor}, + {"rx_ampdu_density",proc_get_rx_ampdu_density,proc_set_rx_ampdu_density}, + {"tx_ampdu_density",proc_get_tx_ampdu_density,proc_set_tx_ampdu_density}, #endif /* CONFIG_80211N_HT */ {"en_fwps", proc_get_en_fwps, proc_set_en_fwps}, - {"path_rssi", proc_get_two_path_rssi, NULL}, - {"rssi_disp",proc_get_rssi_disp, proc_set_rssi_disp}, + //{"path_rssi", proc_get_two_path_rssi, NULL}, +// {"rssi_disp",proc_get_rssi_disp, proc_set_rssi_disp}, #ifdef CONFIG_BT_COEXIST {"btcoex_dbg", proc_get_btcoex_dbg, proc_set_btcoex_dbg}, {"btcoex", proc_get_btcoex_info, NULL}, + {"btinfo_evt", proc_get_dummy, proc_set_btinfo_evt}, #endif /* CONFIG_BT_COEXIST */ #if defined(DBG_CONFIG_ERROR_DETECT) {"sreset", proc_get_sreset, proc_set_sreset}, #endif /* DBG_CONFIG_ERROR_DETECT */ + {"linked_info_dump",proc_get_linked_info_dump,proc_set_linked_info_dump}, + +#ifdef CONFIG_GPIO_API + {"gpio_info",proc_get_gpio,proc_set_gpio}, + {"gpio_set_output_value",proc_get_dummy,proc_set_gpio_output_value}, + {"gpio_set_direction",proc_get_dummy,proc_set_config_gpio}, +#endif + +#ifdef CONFIG_DBG_COUNTER + {"rx_logs", proc_get_rx_logs, NULL}, + {"tx_logs", proc_get_tx_logs, NULL}, + {"int_logs", proc_get_int_logs, NULL}, +#endif + +#ifdef CONFIG_PCI_HCI + {"rx_ring", proc_get_rx_ring, NULL}, + {"tx_ring", proc_get_tx_ring, NULL}, +#endif +#ifdef CONFIG_P2P_WOWLAN + {"p2p_wowlan_info", proc_get_p2p_wowlan_info, NULL}, +#endif + {"chan_plan",proc_get_chan_plan,proc_set_chan_plan}, + {"new_bcn_max", proc_get_new_bcn_max, proc_set_new_bcn_max}, + {"sink_udpport",proc_get_udpport,proc_set_udpport}, +#ifdef DBG_RX_COUNTER_DUMP + {"dump_rx_cnt_mode",proc_get_rx_cnt_dump,proc_set_rx_cnt_dump}, +#endif +#ifdef CONFIG_POWER_SAVING + {"ps_info",proc_get_ps_info, NULL}, +#endif +#ifdef CONFIG_TDLS + {"tdls_info", proc_get_tdls_info, NULL}, +#endif + {"monitor", proc_get_monitor, proc_set_monitor}, }; const int adapter_proc_hdls_num = sizeof(adapter_proc_hdls) / sizeof(struct rtw_proc_hdl); @@ -485,27 +914,97 @@ ssize_t proc_set_odm_adaptivity(struct file *file, const char __user *buffer, si u32 TH_L2H_ini; s8 TH_EDCCA_HL_diff; u32 IGI_Base; - int ForceEDCCA; - u8 AdapEn_RSSI; - u8 IGI_LowerBound; + u32 FABound; if (count < 1) return -EFAULT; if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) { - int num = sscanf(tmp, "%x %hhd %x %d %hhu %hhu", - &TH_L2H_ini, &TH_EDCCA_HL_diff, &IGI_Base, &ForceEDCCA, &AdapEn_RSSI, &IGI_LowerBound); + int num = sscanf(tmp, "%x %hhd %x %u", + &TH_L2H_ini, &TH_EDCCA_HL_diff, &IGI_Base, &FABound); - if (num != 6) + if (num != 4) return count; - rtw_odm_adaptivity_parm_set(padapter, (s8)TH_L2H_ini, TH_EDCCA_HL_diff, (s8)IGI_Base, (bool)ForceEDCCA, AdapEn_RSSI, IGI_LowerBound); + rtw_odm_adaptivity_parm_set(padapter, (s8)TH_L2H_ini, TH_EDCCA_HL_diff, (s8)IGI_Base, FABound); } return count; } +static char *phydm_msg = NULL; +#define PHYDM_MSG_LEN 80*24 + +int proc_get_phydm_cmd(struct seq_file *m, void *v) +{ + struct net_device *netdev; + PADAPTER padapter; + PHAL_DATA_TYPE pHalData; + PDM_ODM_T phydm; + + + netdev = m->private; + padapter = (PADAPTER)rtw_netdev_priv(netdev); + pHalData = GET_HAL_DATA(padapter); + phydm = &pHalData->odmpriv; + + if (NULL == phydm_msg) { + phydm_msg = rtw_zmalloc(PHYDM_MSG_LEN); + if (NULL == phydm_msg) + return -ENOMEM; + + phydm_cmd(phydm, NULL, 0, 0, phydm_msg, PHYDM_MSG_LEN); + } + + DBG_871X_SEL(m, "%s\n", phydm_msg); + + rtw_mfree(phydm_msg, PHYDM_MSG_LEN); + phydm_msg = NULL; + + return 0; +} + +ssize_t proc_set_phydm_cmd(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data) +{ + struct net_device *netdev; + PADAPTER padapter; + PHAL_DATA_TYPE pHalData; + PDM_ODM_T phydm; + char tmp[64] = {0}; + + + netdev = (struct net_device*)data; + padapter = (PADAPTER)rtw_netdev_priv(netdev); + pHalData = GET_HAL_DATA(padapter); + phydm = &pHalData->odmpriv; + + if (count < 1) + return -EFAULT; + + if (count > sizeof(tmp)) + return -EFAULT; + + if (buffer && !copy_from_user(tmp, buffer, count)) { + if (NULL == phydm_msg) { + phydm_msg = rtw_zmalloc(PHYDM_MSG_LEN); + if (NULL == phydm_msg) + return -ENOMEM; + } else { + _rtw_memset(phydm_msg, 0, PHYDM_MSG_LEN); + } + + phydm_cmd(phydm, tmp, count, 1, phydm_msg, PHYDM_MSG_LEN); + + if (strlen(phydm_msg) == 0) { + rtw_mfree(phydm_msg, PHYDM_MSG_LEN); + phydm_msg = NULL; + } + } + + return count; +} + /* * rtw_odm_proc: * init/deinit when register/unregister net_device, along with rtw_adapter_proc @@ -515,6 +1014,7 @@ const struct rtw_proc_hdl odm_proc_hdls [] = { {"dbg_level", proc_get_odm_dbg_level, proc_set_odm_dbg_level}, {"ability", proc_get_odm_ability, proc_set_odm_ability}, {"adaptivity", proc_get_odm_adaptivity, proc_set_odm_adaptivity}, + {"cmd", proc_get_phydm_cmd, proc_set_phydm_cmd}, }; const int odm_proc_hdls_num = sizeof(odm_proc_hdls) / sizeof(struct rtw_proc_hdl); @@ -603,6 +1103,11 @@ void rtw_odm_proc_deinit(_adapter *adapter) remove_proc_entry("odm", adapter->dir_dev); adapter->dir_odm = NULL; + + if (phydm_msg) { + rtw_mfree(phydm_msg, PHYDM_MSG_LEN); + phydm_msg = NULL; + } } struct proc_dir_entry *rtw_adapter_proc_init(struct net_device *dev) diff --git a/backports/drivers/realtek/rtl8812au/os_dep/linux/rtw_proc.h b/backports/drivers/realtek/rtl8812au/os_dep/linux/rtw_proc.h index d45a28e2bb46f3..9aee7bf56f6824 100755 --- a/backports/drivers/realtek/rtl8812au/os_dep/linux/rtw_proc.h +++ b/backports/drivers/realtek/rtl8812au/os_dep/linux/rtw_proc.h @@ -40,12 +40,12 @@ void rtw_adapter_proc_replace(struct net_device *dev); #else //!CONFIG_PROC_DEBUG -struct proc_dir_entry *get_rtw_drv_proc(void) {return NULL;} -int rtw_drv_proc_init(void) {return 0;} -void rtw_drv_proc_deinit(void) {} -struct proc_dir_entry *rtw_adapter_proc_init(struct net_device *dev){return NULL;} -void rtw_adapter_proc_deinit(struct net_device *dev){} -void rtw_adapter_proc_replace(struct net_device *dev){} +#define get_rtw_drv_proc() NULL +#define rtw_drv_proc_init() 0 +#define rtw_drv_proc_deinit() do {} while (0) +#define rtw_adapter_proc_init(dev) NULL +#define rtw_adapter_proc_deinit(dev) do {} while (0) +#define rtw_adapter_proc_replace(dev) do {} while (0) #endif //!CONFIG_PROC_DEBUG diff --git a/backports/drivers/realtek/rtl8812au/os_dep/linux/usb_intf.c b/backports/drivers/realtek/rtl8812au/os_dep/linux/usb_intf.c index baec0c9b58f874..b130f1c66b2159 100755 --- a/backports/drivers/realtek/rtl8812au/os_dep/linux/usb_intf.c +++ b/backports/drivers/realtek/rtl8812au/os_dep/linux/usb_intf.c @@ -44,7 +44,6 @@ int ui_pid[3] = {0, 0, 0}; extern int pm_netdev_open(struct net_device *pnetdev,u8 bnormal); static int rtw_suspend(struct usb_interface *intf, pm_message_t message); static int rtw_resume(struct usb_interface *intf); -int rtw_resume_process(_adapter *padapter); static int rtw_drv_init(struct usb_interface *pusb_intf,const struct usb_device_id *pdid); @@ -305,12 +304,15 @@ static struct usb_device_id rtw_usb_id_tbl[] ={ {USB_DEVICE(USB_VENDER_ID_REALTEK, 0x0811),.driver_info = RTL8821},/* Default ID */ {USB_DEVICE(USB_VENDER_ID_REALTEK, 0x0821),.driver_info = RTL8821},/* Default ID */ {USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8822),.driver_info = RTL8821},/* Default ID */ + {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0x0820,0xff,0xff,0xff),.driver_info = RTL8821}, /* 8821AU */ + {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0x0823,0xff,0xff,0xff),.driver_info = RTL8821}, /* 8821AU */ /*=== Customer ID ===*/ {USB_DEVICE(0x7392, 0xA811),.driver_info = RTL8821}, /* Edimax - Edimax */ {USB_DEVICE(0x04BB, 0x0953),.driver_info = RTL8821}, /* I-O DATA - Edimax */ {USB_DEVICE(0x2001, 0x3314),.driver_info = RTL8821}, /* D-Link - Cameo */ {USB_DEVICE(0x2001, 0x3318),.driver_info = RTL8821}, /* D-Link - Cameo */ {USB_DEVICE(0x0E66, 0x0023),.driver_info = RTL8821}, /* HAWKING - Edimax */ + {USB_DEVICE(0x0846, 0x9052),.driver_info = RTL8821}, /* Netgear - A6100 */ #endif #ifdef CONFIG_RTL8192E @@ -713,6 +715,9 @@ static void rtw_decide_chip_type_by_usb_info(_adapter *padapter, const struct us } void rtw_set_hal_ops(_adapter *padapter) { + //alloc memory for HAL DATA + rtw_hal_data_init(padapter); + #ifdef CONFIG_RTL8192C if(padapter->chip_type == RTL8188C_8192C) rtl8192cu_set_hal_ops(padapter); @@ -862,73 +867,70 @@ static void process_spec_devid(const struct usb_device_id *pdid) #ifdef SUPPORT_HW_RFOFF_DETECTED int rtw_hw_suspend(_adapter *padapter ) { - struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); - struct usb_interface *pusb_intf = adapter_to_dvobj(padapter)->pusbintf; - struct net_device *pnetdev = padapter->pnetdev; + struct pwrctrl_priv *pwrpriv; + struct usb_interface *pusb_intf; + struct net_device *pnetdev; _func_enter_; + if(NULL==padapter) + goto error_exit; - if((!padapter->bup) || (padapter->bDriverStopped)||(padapter->bSurpriseRemoved)) + if((_FALSE==padapter->bup) || (_TRUE == padapter->bDriverStopped)||(_TRUE==padapter->bSurpriseRemoved)) { DBG_871X("padapter->bup=%d bDriverStopped=%d bSurpriseRemoved = %d\n", padapter->bup, padapter->bDriverStopped,padapter->bSurpriseRemoved); goto error_exit; } + + pwrpriv = adapter_to_pwrctl(padapter); + pusb_intf = adapter_to_dvobj(padapter)->pusbintf; + pnetdev = padapter->pnetdev; + + LeaveAllPowerSaveMode(padapter); - if(padapter)//system suspend + DBG_871X("==> rtw_hw_suspend\n"); + _enter_pwrlock(&pwrpriv->lock); + pwrpriv->bips_processing = _TRUE; + //padapter->net_closed = _TRUE; + //s1. + if(pnetdev) { - LeaveAllPowerSaveMode(padapter); - - DBG_871X("==> rtw_hw_suspend\n"); - _enter_pwrlock(&pwrpriv->lock); - pwrpriv->bips_processing = _TRUE; - //padapter->net_closed = _TRUE; - //s1. - if(pnetdev) - { - netif_carrier_off(pnetdev); - rtw_netif_stop_queue(pnetdev); - } + netif_carrier_off(pnetdev); + rtw_netif_stop_queue(pnetdev); + } - //s2. - rtw_disassoc_cmd(padapter, 500, _FALSE); + //s2. + rtw_disassoc_cmd(padapter, 500, _FALSE); - //s2-2. indicate disconnect to os - //rtw_indicate_disconnect(padapter); + //s2-2. indicate disconnect to os + //rtw_indicate_disconnect(padapter); + { + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + if(check_fwstate(pmlmepriv, _FW_LINKED)) { - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - - if(check_fwstate(pmlmepriv, _FW_LINKED)) - { - _clr_fwstate_(pmlmepriv, _FW_LINKED); - - rtw_led_control(padapter, LED_CTL_NO_LINK); + _clr_fwstate_(pmlmepriv, _FW_LINKED); + rtw_led_control(padapter, LED_CTL_NO_LINK); - rtw_os_indicate_disconnect(padapter); - - #ifdef CONFIG_LPS - //donnot enqueue cmd - rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_DISCONNECT, 0); - #endif - } + rtw_os_indicate_disconnect(padapter); + #ifdef CONFIG_LPS + //donnot enqueue cmd + rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_DISCONNECT, 0); + #endif } - //s2-3. - rtw_free_assoc_resources(padapter, 1); - - //s2-4. - rtw_free_network_queue(padapter,_TRUE); - #ifdef CONFIG_IPS - rtw_ips_dev_unload(padapter); - #endif - pwrpriv->rf_pwrstate = rf_off; - pwrpriv->bips_processing = _FALSE; - - _exit_pwrlock(&pwrpriv->lock); } - else - goto error_exit; + //s2-3. + rtw_free_assoc_resources(padapter, 1); + //s2-4. + rtw_free_network_queue(padapter,_TRUE); + #ifdef CONFIG_IPS + rtw_ips_dev_unload(padapter); + #endif + pwrpriv->rf_pwrstate = rf_off; + pwrpriv->bips_processing = _FALSE; + _exit_pwrlock(&pwrpriv->lock); + _func_exit_; return 0; @@ -944,41 +946,29 @@ int rtw_hw_resume(_adapter *padapter) struct usb_interface *pusb_intf = adapter_to_dvobj(padapter)->pusbintf; struct net_device *pnetdev = padapter->pnetdev; - _func_enter_; + _func_enter_; + DBG_871X("==> rtw_hw_resume\n"); + _enter_pwrlock(&pwrpriv->lock); + pwrpriv->bips_processing = _TRUE; + rtw_reset_drv_sw(padapter); - if(padapter)//system resume + if(pm_netdev_open(pnetdev,_FALSE) != 0) { - DBG_871X("==> rtw_hw_resume\n"); - _enter_pwrlock(&pwrpriv->lock); - pwrpriv->bips_processing = _TRUE; - rtw_reset_drv_sw(padapter); - - if(pm_netdev_open(pnetdev,_FALSE) != 0) - { - _exit_pwrlock(&pwrpriv->lock); - goto error_exit; - } - - netif_device_attach(pnetdev); - netif_carrier_on(pnetdev); + _exit_pwrlock(&pwrpriv->lock); + goto error_exit; + } - if(!rtw_netif_queue_stopped(pnetdev)) - rtw_netif_start_queue(pnetdev); - else - rtw_netif_wake_queue(pnetdev); + netif_device_attach(pnetdev); + netif_carrier_on(pnetdev); - pwrpriv->bkeepfwalive = _FALSE; - pwrpriv->brfoffbyhw = _FALSE; + rtw_netif_wake_queue(pnetdev); - pwrpriv->rf_pwrstate = rf_on; - pwrpriv->bips_processing = _FALSE; + pwrpriv->bkeepfwalive = _FALSE; + pwrpriv->brfoffbyhw = _FALSE; - _exit_pwrlock(&pwrpriv->lock); - } - else - { - goto error_exit; - } + pwrpriv->rf_pwrstate = rf_on; + pwrpriv->bips_processing = _FALSE; + _exit_pwrlock(&pwrpriv->lock); _func_exit_; @@ -989,13 +979,26 @@ int rtw_hw_resume(_adapter *padapter) } #endif -#ifdef CONFIG_SUSPEND_REFINE static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message) { + struct dvobj_priv *dvobj; + struct pwrctrl_priv *pwrpriv; + struct debug_priv *pdbgpriv; + PADAPTER padapter; int ret = 0; - struct dvobj_priv *dvobj = usb_get_intfdata(pusb_intf); - _adapter *padapter = dvobj->if1; - struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); + + + dvobj = usb_get_intfdata(pusb_intf); + pwrpriv = dvobj_to_pwrctl(dvobj); + pdbgpriv = &dvobj->drv_dbg; + padapter = dvobj->if1; + + if (pwrpriv->bInSuspend == _TRUE) { + DBG_871X("%s bInSuspend = %d\n", __FUNCTION__, pwrpriv->bInSuspend); + pdbgpriv->dbg_suspend_error_cnt++; + goto exit; + } + if((padapter->bup) || (padapter->bDriverStopped == _FALSE)||(padapter->bSurpriseRemoved == _FALSE)) { #ifdef CONFIG_AUTOSUSPEND @@ -1013,23 +1016,37 @@ static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message) } #endif//CONFIG_AUTOSUSPEND } + ret = rtw_suspend_common(padapter); +exit: return ret; } + int rtw_resume_process(_adapter *padapter) { int ret,pm_cnt = 0; struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); - - #if defined(CONFIG_BT_COEXIST) && defined(CONFIG_AUTOSUSPEND) //add by amy for 8723as-vau - #if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,32)) + struct dvobj_priv *pdvobj = padapter->dvobj; + struct debug_priv *pdbgpriv = &pdvobj->drv_dbg; + + + if (pwrpriv->bInSuspend == _FALSE) + { + pdbgpriv->dbg_resume_error_cnt++; + DBG_871X("%s bInSuspend = %d\n", __FUNCTION__, pwrpriv->bInSuspend); + return -1; + } + +#if defined(CONFIG_BT_COEXIST) && defined(CONFIG_AUTOSUSPEND) //add by amy for 8723as-vau +#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,32)) DBG_871X("%s...pm_usage_cnt(%d) pwrpriv->bAutoResume=%x. ....\n",__func__,atomic_read(&(adapter_to_dvobj(padapter)->pusbintf->pm_usage_cnt)),pwrpriv->bAutoResume); pm_cnt=atomic_read(&(adapter_to_dvobj(padapter)->pusbintf->pm_usage_cnt)); - #else +#else // kernel < 2.6.32 DBG_871X("...pm_usage_cnt(%d).....\n", adapter_to_dvobj(padapter)->pusbintf->pm_usage_cnt); pm_cnt = adapter_to_dvobj(padapter)->pusbintf->pm_usage_cnt; - #endif +#endif // kernel < 2.6.32 + DBG_871X("pwrpriv->bAutoResume (%x)\n",pwrpriv->bAutoResume ); if( _TRUE == pwrpriv->bAutoResume ){ pwrpriv->bInternalAutoSuspend = _FALSE; @@ -1037,7 +1054,7 @@ int rtw_resume_process(_adapter *padapter) DBG_871X("pwrpriv->bAutoResume (%x) pwrpriv->bInternalAutoSuspend(%x)\n",pwrpriv->bAutoResume,pwrpriv->bInternalAutoSuspend ); } - #endif //#ifdef CONFIG_BT_COEXIST &CONFIG_AUTOSUSPEND& +#endif //#ifdef CONFIG_BT_COEXIST &CONFIG_AUTOSUSPEND& #if defined (CONFIG_WOWLAN) || defined (CONFIG_AP_WOWLAN) /* @@ -1046,12 +1063,8 @@ int rtw_resume_process(_adapter *padapter) * But they will not be clear in intf_start during wow resume flow. * It should move to os_intf in the feature. */ - padapter->bReadPortCancel = _FALSE; - padapter->bWritePortCancel = _FALSE; -#ifdef CONFIG_CONCURRENT_MODE - padapter->pbuddy_adapter->bReadPortCancel = _FALSE; - padapter->pbuddy_adapter->bWritePortCancel = _FALSE; -#endif + RTW_ENABLE_FUNC(padapter, DF_RX_BIT); + RTW_ENABLE_FUNC(padapter, DF_TX_BIT); #endif ret = rtw_resume_common(padapter); @@ -1086,277 +1099,62 @@ int rtw_resume_process(_adapter *padapter) return ret; } -#else -static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message) -{ - struct dvobj_priv *dvobj = usb_get_intfdata(pusb_intf); - _adapter *padapter = dvobj->if1; - struct net_device *pnetdev = padapter->pnetdev; - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - struct pwrctrl_priv *pwrpriv = dvobj_to_pwrctl(dvobj); - struct usb_device *usb_dev = interface_to_usbdev(pusb_intf); - -#ifdef CONFIG_WOWLAN - struct wowlan_ioctl_param poidparam; -#endif // CONFIG_WOWLAN +static int rtw_resume(struct usb_interface *pusb_intf) +{ + struct dvobj_priv *dvobj; + struct pwrctrl_priv *pwrpriv; + struct debug_priv *pdbgpriv; + PADAPTER padapter; + struct mlme_ext_priv *pmlmeext; int ret = 0; - u32 start_time = rtw_get_current_time(); - _func_enter_; - DBG_871X("==> %s (%s:%d)\n",__FUNCTION__, current->comm, current->pid); + dvobj = usb_get_intfdata(pusb_intf); + pwrpriv = dvobj_to_pwrctl(dvobj); + pdbgpriv = &dvobj->drv_dbg; + padapter = dvobj->if1; + pmlmeext = &padapter->mlmeextpriv; -#ifdef CONFIG_WOWLAN - if (check_fwstate(pmlmepriv, _FW_LINKED)) - pwrpriv->wowlan_mode = _TRUE; - else - pwrpriv->wowlan_mode = _FALSE; -#endif + DBG_871X("==> %s (%s:%d)\n", __FUNCTION__, current->comm, current->pid); + pdbgpriv->dbg_resume_cnt++; -#ifdef CONFIG_IOL_READ_EFUSE_MAP - if(!padapter->bup){ - u8 bMacPwrCtrlOn = _FALSE; - rtw_hal_get_hwreg(padapter, HW_VAR_APFM_ON_MAC, &bMacPwrCtrlOn); - if(bMacPwrCtrlOn) - rtw_hal_power_off(padapter); - } -#endif - - if((!padapter->bup) || (padapter->bDriverStopped)||(padapter->bSurpriseRemoved)) - { - DBG_871X("padapter->bup=%d bDriverStopped=%d bSurpriseRemoved = %d\n", - padapter->bup, padapter->bDriverStopped,padapter->bSurpriseRemoved); - goto exit; - } - - if(pwrpriv->bInternalAutoSuspend ) + if(pwrpriv->bInternalAutoSuspend) { - #ifdef CONFIG_AUTOSUSPEND - #ifdef SUPPORT_HW_RFOFF_DETECTED - // The FW command register update must after MAC and FW init ready. - if((padapter->bFWReady) && (pwrpriv->bHWPwrPindetect ) && (padapter->registrypriv.usbss_enable )) - { - u8 bOpen = _TRUE; - rtw_interface_ps_func(padapter,HAL_USB_SELECT_SUSPEND,&bOpen); - //rtl8192c_set_FwSelectSuspend_cmd(padapter,_TRUE ,500);//note fw to support hw power down ping detect - } - #endif - #endif - } - pwrpriv->bInSuspend = _TRUE; - rtw_cancel_all_timer(padapter); - LeaveAllPowerSaveMode(padapter); - - rtw_stop_cmd_thread(padapter); - - _enter_pwrlock(&pwrpriv->lock); - //padapter->net_closed = _TRUE; - //s1. - if(pnetdev) - { - netif_carrier_off(pnetdev); - rtw_netif_stop_queue(pnetdev); - } - -#ifdef CONFIG_WOWLAN - if(pwrpriv->bSupportRemoteWakeup==_TRUE && pwrpriv->wowlan_mode==_TRUE){ - if (rtw_port_switch_chk(padapter)) - rtw_hal_set_hwreg(padapter, HW_VAR_PORT_SWITCH, NULL); - - //set H2C command - poidparam.subcode=WOWLAN_ENABLE; - padapter->HalFunc.SetHwRegHandler(padapter,HW_VAR_WOWLAN,(u8 *)&poidparam); + ret = rtw_resume_process(padapter); } else -#else { - //s2. - rtw_disassoc_cmd(padapter, 0, _FALSE); - } -#endif //CONFIG_WOWLAN - - if (rtw_chk_roam_flags(padapter, RTW_ROAM_ON_RESUME)) { - if(check_fwstate(pmlmepriv, WIFI_STATION_STATE) - && check_fwstate(pmlmepriv, _FW_LINKED)) + if(pwrpriv->wowlan_mode || pwrpriv->wowlan_ap_mode) { - //DBG_871X("%s:%d assoc_ssid:%s\n", __FUNCTION__, __LINE__, pmlmepriv->assoc_ssid.Ssid); - DBG_871X("%s:%d %s(" MAC_FMT "), length:%d assoc_ssid.length:%d\n",__FUNCTION__, __LINE__, - pmlmepriv->cur_network.network.Ssid.Ssid, - MAC_ARG(pmlmepriv->cur_network.network.MacAddress), - pmlmepriv->cur_network.network.Ssid.SsidLength, - pmlmepriv->assoc_ssid.SsidLength); - - rtw_set_to_roam(padapter, 1); + rtw_resume_lock_suspend(); + ret = rtw_resume_process(padapter); + rtw_resume_unlock_suspend(); } - } - - //s2-2. indicate disconnect to os - rtw_indicate_disconnect(padapter); - //s2-3. - rtw_free_assoc_resources(padapter, 1); -#ifdef CONFIG_AUTOSUSPEND - if(!pwrpriv->bInternalAutoSuspend ) -#endif - //s2-4. - rtw_free_network_queue(padapter, _TRUE); - - rtw_dev_unload(padapter); -#ifdef CONFIG_AUTOSUSPEND - pwrpriv->rf_pwrstate = rf_off; - pwrpriv->bips_processing = _FALSE; -#endif - _exit_pwrlock(&pwrpriv->lock); - - if(check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)) - rtw_indicate_scan_done(padapter, 1); - - if(check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) - rtw_indicate_disconnect(padapter); - -exit: - DBG_871X("<=== %s return %d.............. in %dms\n", __FUNCTION__ - , ret, rtw_get_passing_time_ms(start_time)); - - _func_exit_; - return ret; -} - - -int rtw_resume_process(_adapter *padapter) -{ - struct net_device *pnetdev; - struct pwrctrl_priv *pwrpriv = NULL; - int ret = -1; - u32 start_time = rtw_get_current_time(); -#ifdef CONFIG_BT_COEXIST - u8 pm_cnt; -#endif //#ifdef CONFIG_BT_COEXIST - _func_enter_; - - DBG_871X("==> %s (%s:%d)\n",__FUNCTION__, current->comm, current->pid); - - if(padapter) { - pnetdev= padapter->pnetdev; - pwrpriv = adapter_to_pwrctl(padapter); - } else { - goto exit; - } - - _enter_pwrlock(&pwrpriv->lock); -#ifdef CONFIG_BT_COEXIST -#ifdef CONFIG_AUTOSUSPEND - #if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,32)) - DBG_871X("%s...pm_usage_cnt(%d) pwrpriv->bAutoResume=%x. ....\n",__func__,atomic_read(&(adapter_to_dvobj(padapter)->pusbintf->pm_usage_cnt)),pwrpriv->bAutoResume); - pm_cnt=atomic_read(&(adapter_to_dvobj(padapter)->pusbintf->pm_usage_cnt)); - #else - DBG_871X("...pm_usage_cnt(%d).....\n", adapter_to_dvobj(padapter)->pusbintf->pm_usage_cnt); - pm_cnt = adapter_to_dvobj(padapter)->pusbintf->pm_usage_cnt; - #endif - - DBG_871X("pwrpriv->bAutoResume (%x)\n",pwrpriv->bAutoResume ); - if( _TRUE == pwrpriv->bAutoResume ){ - pwrpriv->bInternalAutoSuspend = _FALSE; - pwrpriv->bAutoResume=_FALSE; - DBG_871X("pwrpriv->bAutoResume (%x) pwrpriv->bInternalAutoSuspend(%x)\n",pwrpriv->bAutoResume,pwrpriv->bInternalAutoSuspend ); - - } -#endif //#ifdef CONFIG_AUTOSUSPEND -#endif //#ifdef CONFIG_BT_COEXIST - rtw_reset_drv_sw(padapter); - pwrpriv->bkeepfwalive = _FALSE; - - DBG_871X("bkeepfwalive(%x)\n",pwrpriv->bkeepfwalive); - if(pm_netdev_open(pnetdev,_TRUE) != 0){ - _exit_pwrlock(&pwrpriv->lock); - goto exit; - } - - netif_device_attach(pnetdev); - netif_carrier_on(pnetdev); - -#ifdef CONFIG_AUTOSUSPEND - if(pwrpriv->bInternalAutoSuspend ) - { - #ifdef CONFIG_AUTOSUSPEND - #ifdef SUPPORT_HW_RFOFF_DETECTED - // The FW command register update must after MAC and FW init ready. - if((padapter->bFWReady) && (pwrpriv->bHWPwrPindetect) && (padapter->registrypriv.usbss_enable )) + else { - //rtl8192c_set_FwSelectSuspend_cmd(padapter,_FALSE ,500);//note fw to support hw power down ping detect - u8 bOpen = _FALSE; - rtw_interface_ps_func(padapter,HAL_USB_SELECT_SUSPEND,&bOpen); - } - #endif - #endif -#ifdef CONFIG_BT_COEXIST - DBG_871X("pwrpriv->bAutoResume (%x)\n",pwrpriv->bAutoResume ); - if( _TRUE == pwrpriv->bAutoResume ){ - pwrpriv->bInternalAutoSuspend = _FALSE; - pwrpriv->bAutoResume=_FALSE; - DBG_871X("pwrpriv->bAutoResume (%x) pwrpriv->bInternalAutoSuspend(%x)\n",pwrpriv->bAutoResume,pwrpriv->bInternalAutoSuspend ); - } - -#else //#ifdef CONFIG_BT_COEXIST - pwrpriv->bInternalAutoSuspend = _FALSE; -#endif //#ifdef CONFIG_BT_COEXIST - pwrpriv->brfoffbyhw = _FALSE; - } -#endif - _exit_pwrlock(&pwrpriv->lock); - - if( padapter->pid[1]!=0) { - DBG_871X("pid[1]:%d\n",padapter->pid[1]); - rtw_signal_process(padapter->pid[1], SIGUSR2); - } - - if (rtw_chk_roam_flags(padapter, RTW_ROAM_ON_RESUME)) - rtw_roaming(padapter, NULL); - - ret = 0; -exit: - #ifdef CONFIG_RESUME_IN_WORKQUEUE - rtw_unlock_suspend(); - #endif //CONFIG_RESUME_IN_WORKQUEUE - - pwrpriv->bInSuspend = _FALSE; - DBG_871X("<=== %s return %d.............. in %dms\n", __FUNCTION__ - , ret, rtw_get_passing_time_ms(start_time)); - - _func_exit_; - - return ret; -} -#endif -static int rtw_resume(struct usb_interface *pusb_intf) -{ - struct dvobj_priv *dvobj = usb_get_intfdata(pusb_intf); - _adapter *padapter = dvobj->if1; - struct net_device *pnetdev = padapter->pnetdev; - struct pwrctrl_priv *pwrpriv = dvobj_to_pwrctl(dvobj); - int ret = 0; - - if(pwrpriv->bInternalAutoSuspend ){ - ret = rtw_resume_process(padapter); - } else { #ifdef CONFIG_RESUME_IN_WORKQUEUE - rtw_resume_in_workqueue(pwrpriv); -#else - if (rtw_is_earlysuspend_registered(pwrpriv) - #ifdef CONFIG_WOWLAN - && !pwrpriv->wowlan_mode - #endif /* CONFIG_WOWLAN */ - ) { - /* jeff: bypass resume here, do in late_resume */ - rtw_set_do_late_resume(pwrpriv, _TRUE); - } else { - ret = rtw_resume_process(padapter); + rtw_resume_in_workqueue(pwrpriv); +#else + if (rtw_is_earlysuspend_registered(pwrpriv)) + { + /* jeff: bypass resume here, do in late_resume */ + rtw_set_do_late_resume(pwrpriv, _TRUE); + } + else + { + rtw_resume_lock_suspend(); + ret = rtw_resume_process(padapter); + rtw_resume_unlock_suspend(); + } +#endif } -#endif /* CONFIG_RESUME_IN_WORKQUEUE */ } - return ret; + pmlmeext->last_scan_time = rtw_get_current_time(); + DBG_871X("<======== %s return %d\n", __FUNCTION__, ret); + return ret; } @@ -1417,6 +1215,7 @@ void autosuspend_enter(_adapter* padapter) #endif } + int autoresume_enter(_adapter* padapter) { int result = _SUCCESS; @@ -1639,8 +1438,8 @@ _adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj, status = _SUCCESS; free_hal_data: - if(status != _SUCCESS && padapter->HalData) - rtw_mfree(padapter->HalData, sizeof(*(padapter->HalData))); + if (status != _SUCCESS && padapter->HalData) + rtw_hal_free_data(padapter); free_wdev: if(status != _SUCCESS) { #ifdef CONFIG_IOCTL_CFG80211 @@ -1655,7 +1454,7 @@ _adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj, if (status != _SUCCESS) { if (pnetdev) rtw_free_netdev(pnetdev); - else if (padapter) + else rtw_vmfree((u8*)padapter, sizeof(*padapter)); padapter = NULL; } @@ -1777,9 +1576,8 @@ static int rtw_drv_init(struct usb_interface *pusb_intf, const struct usb_device #endif //dev_alloc_name && register_netdev - if((status = rtw_drv_register_netdev(if1)) != _SUCCESS) { + if (rtw_drv_register_netdev(if1) != _SUCCESS) goto free_if2; - } #ifdef CONFIG_HOSTAPD_MLME hostapd_mode_init(if1); @@ -1794,6 +1592,11 @@ static int rtw_drv_init(struct usb_interface *pusb_intf, const struct usb_device status = _SUCCESS; +#if 0 /* not used now */ +unregister_ndevs: + if (status != _SUCCESS) + rtw_unregister_netdevs(dvobj); +#endif free_if2: if(status != _SUCCESS && if2) { #ifdef CONFIG_CONCURRENT_MODE diff --git a/backports/drivers/realtek/rtl8812au/os_dep/linux/usb_ops_linux.c b/backports/drivers/realtek/rtl8812au/os_dep/linux/usb_ops_linux.c index 28e747b6316760..2ad5be686e8eb1 100755 --- a/backports/drivers/realtek/rtl8812au/os_dep/linux/usb_ops_linux.c +++ b/backports/drivers/realtek/rtl8812au/os_dep/linux/usb_ops_linux.c @@ -22,6 +22,16 @@ #include #include +#ifdef CONFIG_RTL8192D +#include +#endif + + +struct rtw_async_write_data { + u8 data[VENDOR_CMD_MAX_DATA_LEN]; + struct usb_ctrlrequest dr; +}; + int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u16 index, void *pdata, u16 len, u8 requesttype) { _adapter *padapter = pintfhdl->padapter; @@ -53,8 +63,8 @@ int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u16 inde //DBG_871X("%s %s:%d\n",__FUNCTION__, current->comm, current->pid); - if((padapter->bSurpriseRemoved) ||(pwrctl->pnp_bstop_trx)){ - RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usbctrl_vendorreq:(padapter->bSurpriseRemoved ||pwrctl->pnp_bstop_trx)!!!\n")); + if (RTW_CANNOT_IO(padapter)){ + RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usbctrl_vendorreq:(RTW_CANNOT_IO)!!!\n")); status = -EPERM; goto exit; } @@ -178,13 +188,13 @@ static void _usbctrl_vendorreq_async_callback(struct urb *urb, struct pt_regs *r { if (urb) { if (urb->context) { - rtw_mfree(urb->context); + rtw_mfree(urb->context, sizeof(struct rtw_async_write_data)); } usb_free_urb(urb); } } -static int _usbctrl_vendorreq_async_write(struct usb_device *udev, u8 request, +int _usbctrl_vendorreq_async_write(struct usb_device *udev, u8 request, u16 value, u16 index, void *pdata, u16 len, u8 requesttype) { int rc; @@ -192,10 +202,7 @@ static int _usbctrl_vendorreq_async_write(struct usb_device *udev, u8 request, u8 reqtype; struct usb_ctrlrequest *dr; struct urb *urb; - struct rtl819x_async_write_data { - u8 data[VENDOR_CMD_MAX_DATA_LEN]; - struct usb_ctrlrequest dr; - } *buf; + struct rtw_async_write_data *buf; if (requesttype == VENDOR_READ) { @@ -243,70 +250,7 @@ static int _usbctrl_vendorreq_async_write(struct usb_device *udev, u8 request, return rc; } -int usb_write_async(struct usb_device *udev, u32 addr, void *pdata, u16 len) -{ - u8 request; - u8 requesttype; - u16 wvalue; - u16 index; - - int ret; - - requesttype = VENDOR_WRITE;//write_out - request = REALTEK_USB_VENQT_CMD_REQ; - index = REALTEK_USB_VENQT_CMD_IDX;//n/a - - wvalue = (u16)(addr&0x0000ffff); - - ret = _usbctrl_vendorreq_async_write(udev, request, wvalue, index, pdata, len, requesttype); - - return ret; -} - -int usb_async_write8(struct intf_hdl *pintfhdl, u32 addr, u8 val) -{ - u8 data; - int ret; - struct dvobj_priv *pdvobjpriv = (struct dvobj_priv *)pintfhdl->pintf_dev; - struct usb_device *udev=pdvobjpriv->pusbdev; - - _func_enter_; - data = val; - ret = usb_write_async(udev, addr, &data, 1); - _func_exit_; - - return ret; -} - -int usb_async_write16(struct intf_hdl *pintfhdl, u32 addr, u16 val) -{ - u16 data; - int ret; - struct dvobj_priv *pdvobjpriv = (struct dvobj_priv *)pintfhdl->pintf_dev; - struct usb_device *udev=pdvobjpriv->pusbdev; - - _func_enter_; - data = val; - ret = usb_write_async(udev, addr, &data, 2); - _func_exit_; - - return ret; -} - -int usb_async_write32(struct intf_hdl *pintfhdl, u32 addr, u32 val) -{ - u32 data; - int ret; - struct dvobj_priv *pdvobjpriv = (struct dvobj_priv *)pintfhdl->pintf_dev; - struct usb_device *udev=pdvobjpriv->pusbdev; - _func_enter_; - data = val; - ret = usb_write_async(udev, addr, &data, 4); - _func_exit_; - - return ret; -} #endif /* CONFIG_USB_SUPPORT_ASYNC_VDN_REQ */ unsigned int ffaddr2pipehdl(struct dvobj_priv *pdvobj, u32 addr) @@ -318,7 +262,7 @@ unsigned int ffaddr2pipehdl(struct dvobj_priv *pdvobj, u32 addr) pipe=usb_rcvbulkpipe(pusbd, pdvobj->RtInPipe[0]); } else if (addr == RECV_INT_IN_ADDR) { - pipe=usb_rcvbulkpipe(pusbd, pdvobj->RtInPipe[1]); + pipe=usb_rcvintpipe(pusbd, pdvobj->RtInPipe[1]); } else if (addr < HW_QUEUE_ENTRY) { ep_num = pdvobj->Queue2Pipe[addr]; @@ -375,13 +319,16 @@ static u32 usb_bulkout_zero(struct intf_hdl *pintfhdl, u32 addr) //DBG_871X("%s\n", __func__); - if((padapter->bDriverStopped) || (padapter->bSurpriseRemoved) ||(pwrctl->pnp_bstop_trx)) + if (RTW_CANNOT_TX(padapter)) { return _FAIL; } pcontext = (struct zero_bulkout_context *)rtw_zmalloc(sizeof(struct zero_bulkout_context)); + if (pcontext == NULL) { + return _FAIL; + } pbuf = (unsigned char *)rtw_zmalloc(sizeof(int)); purb = usb_alloc_urb(0, GFP_ATOMIC); @@ -441,11 +388,8 @@ void usb_read_port_cancel(struct intf_hdl *pintfhdl) DBG_871X("%s\n", __func__); - padapter->bReadPortCancel = _TRUE; - for (i=0; i < NR_RECVBUFF ; i++) { - - precvbuf->reuse = _TRUE; + if (precvbuf->purb) { //DBG_8192C("usb_read_port_cancel : usb_kill_urb \n"); usb_kill_urb(precvbuf->purb); @@ -485,11 +429,6 @@ _func_enter_; case BK_QUEUE_INX: pxmitpriv->bkq_cnt--; break; - case HIGH_QUEUE_INX: -#ifdef CONFIG_AP_MODE - rtw_chk_hi_queue_cmd(padapter); -#endif - break; default: break; } @@ -537,11 +476,11 @@ _func_enter_; */ //rtw_free_xmitframe(pxmitpriv, pxmitframe); - if(padapter->bSurpriseRemoved || padapter->bDriverStopped ||padapter->bWritePortCancel) + if (RTW_CANNOT_TX(padapter)) { RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_write_port_complete:bDriverStopped(%d) OR bSurpriseRemoved(%d)", padapter->bDriverStopped, padapter->bSurpriseRemoved)); - DBG_8192C("%s(): TX Warning! bDriverStopped(%d) OR bSurpriseRemoved(%d) bWritePortCancel(%d) pxmitbuf->buf_tag(%x) \n", - __FUNCTION__,padapter->bDriverStopped, padapter->bSurpriseRemoved,padapter->bWritePortCancel,pxmitbuf->buf_tag); + DBG_8192C("%s(): TX Warning! bDriverStopped(%d) OR bSurpriseRemoved(%d) pxmitbuf->buf_tag(%x) \n", + __FUNCTION__,padapter->bDriverStopped, padapter->bSurpriseRemoved,pxmitbuf->buf_tag); goto check_completion; } @@ -597,7 +536,7 @@ _func_enter_; check_completion: _enter_critical(&pxmitpriv->lock_sctx, &irqL); rtw_sctx_done_err(&pxmitbuf->sctx, - purb->status ? RTW_SCTX_DONE_WRITE_PORT_ERR : RTW_SCTX_DONE_SUCCESS); + purb->status ? RTW_SCTX_DONE_WRITE_PORT_ERR : RTW_SCTX_DONE_SUCCESS); _exit_critical(&pxmitpriv->lock_sctx, &irqL); rtw_free_xmitbuf(pxmitpriv, pxmitbuf); @@ -630,13 +569,13 @@ u32 usb_write_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem) _func_enter_; RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("+usb_write_port\n")); - - if ((padapter->bDriverStopped) || (padapter->bSurpriseRemoved) ||(pwrctl->pnp_bstop_trx)) { + + if (RTW_CANNOT_TX(padapter)) { #ifdef DBG_TX - DBG_871X(" DBG_TX %s:%d bDriverStopped%d, bSurpriseRemoved:%d, pnp_bstop_trx:%d\n",__FUNCTION__, __LINE__ - ,padapter->bDriverStopped, padapter->bSurpriseRemoved, pwrctl->pnp_bstop_trx ); + DBG_871X(" DBG_TX %s:%d bDriverStopped%d, bSurpriseRemoved:%d\n",__FUNCTION__, __LINE__ + ,padapter->bDriverStopped, padapter->bSurpriseRemoved); #endif - RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_write_port:( padapter->bDriverStopped ||padapter->bSurpriseRemoved ||pwrctl->pnp_bstop_trx)!!!\n")); + RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_write_port:( padapter->bDriverStopped ||padapter->bSurpriseRemoved )!!!\n")); rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_TX_DENY); goto exit; } @@ -764,9 +703,7 @@ void usb_write_port_cancel(struct intf_hdl *pintfhdl) struct xmit_buf *pxmitbuf = (struct xmit_buf *)padapter->xmitpriv.pxmitbuf; DBG_871X("%s \n", __func__); - - padapter->bWritePortCancel = _TRUE; - + for (i=0; ipxmit_urb[j]) { @@ -777,7 +714,7 @@ void usb_write_port_cancel(struct intf_hdl *pintfhdl) } pxmitbuf = (struct xmit_buf*)padapter->xmitpriv.pxmit_extbuf; - for (i = 0; i < NR_XMIT_EXTBUFF; i++) { + for (i = 0; i < NR_XMIT_EXTBUFF ; i++) { for (j=0; j<8; j++) { if(pxmitbuf->pxmit_urb[j]) { usb_kill_urb(pxmitbuf->pxmit_urb[j]); @@ -787,3 +724,395 @@ void usb_write_port_cancel(struct intf_hdl *pintfhdl) } } +void usb_init_recvbuf(_adapter *padapter, struct recv_buf *precvbuf) +{ + + precvbuf->transfer_len = 0; + + precvbuf->len = 0; + + precvbuf->ref_cnt = 0; + + if(precvbuf->pbuf) + { + precvbuf->pdata = precvbuf->phead = precvbuf->ptail = precvbuf->pbuf; + precvbuf->pend = precvbuf->pdata + MAX_RECVBUF_SZ; + } + +} + +int recvbuf2recvframe(PADAPTER padapter, void *ptr); + +#ifdef CONFIG_USE_USB_BUFFER_ALLOC_RX +void usb_recv_tasklet(void *priv) +{ + struct recv_buf *precvbuf = NULL; + _adapter *padapter = (_adapter*)priv; + struct recv_priv *precvpriv = &padapter->recvpriv; + + while (NULL != (precvbuf = rtw_dequeue_recvbuf(&precvpriv->recv_buf_pending_queue))) + { + if ((padapter->bDriverStopped == _TRUE)||(padapter->bSurpriseRemoved== _TRUE)) + { + DBG_8192C("recv_tasklet => bDriverStopped or bSurpriseRemoved \n"); + + break; + } + + + recvbuf2recvframe(padapter, precvbuf); + + rtw_read_port(padapter, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf); + } + +} + +void usb_read_port_complete(struct urb *purb, struct pt_regs *regs) +{ + struct recv_buf *precvbuf = (struct recv_buf *)purb->context; + _adapter *padapter =(_adapter *)precvbuf->adapter; + struct recv_priv *precvpriv = &padapter->recvpriv; + + RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete!!!\n")); + + ATOMIC_DEC(&(precvpriv->rx_pending_cnt)); + + if (RTW_CANNOT_RX(padapter)) + { + RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete:bDriverStopped(%d) OR bSurpriseRemoved(%d)\n", padapter->bDriverStopped, padapter->bSurpriseRemoved)); + DBG_8192C("%s() RX Warning! bDriverStopped(%d) OR bSurpriseRemoved(%d) \n", + __FUNCTION__,padapter->bDriverStopped, padapter->bSurpriseRemoved); + goto exit; + } + + if(purb->status==0)//SUCCESS + { + if ((purb->actual_length > MAX_RECVBUF_SZ) || (purb->actual_length < RXDESC_SIZE)) + { + RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete: (purb->actual_length > MAX_RECVBUF_SZ) || (purb->actual_length < RXDESC_SIZE)\n")); + + rtw_read_port(padapter, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf); + } + else + { + rtw_reset_continual_io_error(adapter_to_dvobj(padapter)); + + precvbuf->transfer_len = purb->actual_length; + + //rtw_enqueue_rx_transfer_buffer(precvpriv, rx_transfer_buf); + rtw_enqueue_recvbuf(precvbuf, &precvpriv->recv_buf_pending_queue); + + tasklet_schedule(&precvpriv->recv_tasklet); + } + } + else + { + RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete : purb->status(%d) != 0 \n", purb->status)); + + DBG_8192C("###=> usb_read_port_complete => urb status(%d)\n", purb->status); + + if(rtw_inc_and_chk_continual_io_error(adapter_to_dvobj(padapter)) == _TRUE ){ + padapter->bSurpriseRemoved = _TRUE; + } + + switch(purb->status) { + case -EINVAL: + case -EPIPE: + case -ENODEV: + case -ESHUTDOWN: + //padapter->bSurpriseRemoved=_TRUE; + //RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete:bSurpriseRemoved=TRUE\n")); + case -ENOENT: + padapter->bDriverStopped=_TRUE; + RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete:bDriverStopped=TRUE\n")); + break; + case -EPROTO: + case -EILSEQ: + case -ETIME: + case -ECOMM: + case -EOVERFLOW: + #ifdef DBG_CONFIG_ERROR_DETECT + { + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); + pHalData->srestpriv.Wifi_Error_Status = USB_READ_PORT_FAIL; + } + #endif + rtw_read_port(padapter, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf); + break; + case -EINPROGRESS: + DBG_8192C("ERROR: URB IS IN PROGRESS!/n"); + break; + default: + break; + } + + } + +exit: + +_func_exit_; +} + +u32 usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem) +{ + int err; + unsigned int pipe; + u32 ret = _SUCCESS; + PURB purb = NULL; + struct recv_buf *precvbuf = (struct recv_buf *)rmem; + _adapter *adapter = pintfhdl->padapter; + struct dvobj_priv *pdvobj = adapter_to_dvobj(adapter); + struct pwrctrl_priv *pwrctl = dvobj_to_pwrctl(pdvobj); + struct recv_priv *precvpriv = &adapter->recvpriv; + struct usb_device *pusbd = pdvobj->pusbdev; + +_func_enter_; + + if (RTW_CANNOT_RX(adapter) || (precvbuf == NULL)) + { + RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port:( RTW_CANNOT_RX ) || precvbuf == NULL!!!\n")); + return _FAIL; + } + + usb_init_recvbuf(adapter, precvbuf); + + if(precvbuf->pbuf) + { + ATOMIC_INC(&(precvpriv->rx_pending_cnt)); + purb = precvbuf->purb; + + //translate DMA FIFO addr to pipehandle + pipe = ffaddr2pipehdl(pdvobj, addr); + + usb_fill_bulk_urb(purb, pusbd, pipe, + precvbuf->pbuf, + MAX_RECVBUF_SZ, + usb_read_port_complete, + precvbuf);//context is precvbuf + + purb->transfer_dma = precvbuf->dma_transfer_addr; + purb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; + + err = usb_submit_urb(purb, GFP_ATOMIC); + if((err) && (err != (-EPERM))) + { + RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("cannot submit rx in-token(err=0x%.8x), URB_STATUS =0x%.8x", err, purb->status)); + DBG_8192C("cannot submit rx in-token(err = 0x%08x),urb_status = %d\n",err,purb->status); + ret = _FAIL; + } + + } + +_func_exit_; + + return ret; +} +#else // CONFIG_USE_USB_BUFFER_ALLOC_RX + +void usb_recv_tasklet(void *priv) +{ + _pkt *pskb; + _adapter *padapter = (_adapter*)priv; + struct recv_priv *precvpriv = &padapter->recvpriv; + struct recv_buf *precvbuf = NULL; + + while (NULL != (pskb = skb_dequeue(&precvpriv->rx_skb_queue))) { + + if ((padapter->bDriverStopped == _TRUE)||(padapter->bSurpriseRemoved== _TRUE)) { + DBG_8192C("recv_tasklet => bDriverStopped or bSurpriseRemoved \n"); + #ifdef CONFIG_PREALLOC_RX_SKB_BUFFER + if (rtw_free_skb_premem(pskb) != 0) + #endif //CONFIG_PREALLOC_RX_SKB_BUFFER + rtw_skb_free(pskb); + break; + } + + recvbuf2recvframe(padapter, pskb); + + skb_reset_tail_pointer(pskb); + pskb->len = 0; + + skb_queue_tail(&precvpriv->free_recv_skb_queue, pskb); + + if (NULL != (precvbuf = rtw_dequeue_recvbuf(&precvpriv->recv_buf_pending_queue))) { + precvbuf->pskb = NULL; + rtw_read_port(padapter, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf); + } + } +} + +void usb_read_port_complete(struct urb *purb, struct pt_regs *regs) +{ + struct recv_buf *precvbuf = (struct recv_buf *)purb->context; + _adapter *padapter =(_adapter *)precvbuf->adapter; + struct recv_priv *precvpriv = &padapter->recvpriv; + + RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete!!!\n")); + + ATOMIC_DEC(&(precvpriv->rx_pending_cnt)); + + if(RTW_CANNOT_RX(padapter)) + { + RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete:bDriverStopped(%d) OR bSurpriseRemoved(%d)\n", padapter->bDriverStopped, padapter->bSurpriseRemoved)); + DBG_8192C("%s() RX Warning! bDriverStopped(%d) OR bSurpriseRemoved(%d) \n", + __FUNCTION__,padapter->bDriverStopped, padapter->bSurpriseRemoved); + goto exit; + } + + if(purb->status==0)//SUCCESS + { + if ((purb->actual_length > MAX_RECVBUF_SZ) || (purb->actual_length < RXDESC_SIZE)) + { + RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete: (purb->actual_length > MAX_RECVBUF_SZ) || (purb->actual_length < RXDESC_SIZE)\n")); + rtw_read_port(padapter, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf); + DBG_8192C("%s()-%d: RX Warning!\n", __FUNCTION__, __LINE__); + } + else + { + rtw_reset_continual_io_error(adapter_to_dvobj(padapter)); + + precvbuf->transfer_len = purb->actual_length; + skb_put(precvbuf->pskb, purb->actual_length); + skb_queue_tail(&precvpriv->rx_skb_queue, precvbuf->pskb); + + #ifndef CONFIG_FIX_NR_BULKIN_BUFFER + if (skb_queue_len(&precvpriv->rx_skb_queue)<=1) + #endif + tasklet_schedule(&precvpriv->recv_tasklet); + + precvbuf->pskb = NULL; + rtw_read_port(padapter, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf); + } + } + else + { + RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete : purb->status(%d) != 0 \n", purb->status)); + + DBG_8192C("###=> usb_read_port_complete => urb status(%d)\n", purb->status); + + if(rtw_inc_and_chk_continual_io_error(adapter_to_dvobj(padapter)) == _TRUE ){ + padapter->bSurpriseRemoved = _TRUE; + } + + switch(purb->status) { + case -EINVAL: + case -EPIPE: + case -ENODEV: + case -ESHUTDOWN: + //padapter->bSurpriseRemoved=_TRUE; + //RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete:bSurpriseRemoved=TRUE\n")); + case -ENOENT: + padapter->bDriverStopped=_TRUE; + RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete:bDriverStopped=TRUE\n")); + break; + case -EPROTO: + case -EILSEQ: + case -ETIME: + case -ECOMM: + case -EOVERFLOW: + #ifdef DBG_CONFIG_ERROR_DETECT + { + HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); + pHalData->srestpriv.Wifi_Error_Status = USB_READ_PORT_FAIL; + } + #endif + rtw_read_port(padapter, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf); + break; + case -EINPROGRESS: + DBG_8192C("ERROR: URB IS IN PROGRESS!/n"); + break; + default: + break; + } + + } + +exit: + +_func_exit_; + +} + +u32 usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem) +{ + int err; + unsigned int pipe; + u32 ret = _FAIL; + PURB purb = NULL; + struct recv_buf *precvbuf = (struct recv_buf *)rmem; + _adapter *adapter = pintfhdl->padapter; + struct dvobj_priv *pdvobj = adapter_to_dvobj(adapter); + struct pwrctrl_priv *pwrctl = dvobj_to_pwrctl(pdvobj); + struct recv_priv *precvpriv = &adapter->recvpriv; + struct usb_device *pusbd = pdvobj->pusbdev; + +_func_enter_; + + if (RTW_CANNOT_RX(adapter) || (precvbuf == NULL)) { + RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port:( RTW_CANNOT_RX ) || precvbuf == NULL!!!\n")); + goto exit; + } + + usb_init_recvbuf(adapter, precvbuf); + + if (precvbuf->pskb == NULL) { + SIZE_PTR tmpaddr = 0; + SIZE_PTR alignment = 0; + + if (NULL != (precvbuf->pskb = skb_dequeue(&precvpriv->free_recv_skb_queue))) + goto recv_buf_hook; + + #ifndef CONFIG_FIX_NR_BULKIN_BUFFER + precvbuf->pskb = rtw_skb_alloc(MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ); + #endif + + if (precvbuf->pskb == NULL) { + if (0) + DBG_871X("usb_read_port() enqueue precvbuf=%p \n", precvbuf); + /* enqueue precvbuf and wait for free skb */ + rtw_enqueue_recvbuf(precvbuf, &precvpriv->recv_buf_pending_queue); + goto exit; + } + + tmpaddr = (SIZE_PTR)precvbuf->pskb->data; + alignment = tmpaddr & (RECVBUFF_ALIGN_SZ-1); + skb_reserve(precvbuf->pskb, (RECVBUFF_ALIGN_SZ - alignment)); + } + +recv_buf_hook: + precvbuf->phead = precvbuf->pskb->head; + precvbuf->pdata = precvbuf->pskb->data; + precvbuf->ptail = skb_tail_pointer(precvbuf->pskb); + precvbuf->pend = skb_end_pointer(precvbuf->pskb); + precvbuf->pbuf = precvbuf->pskb->data; + + purb = precvbuf->purb; + + /* translate DMA FIFO addr to pipehandle */ + pipe = ffaddr2pipehdl(pdvobj, addr); + + usb_fill_bulk_urb(purb, pusbd, pipe, + precvbuf->pbuf, + MAX_RECVBUF_SZ, + usb_read_port_complete, + precvbuf); + + err = usb_submit_urb(purb, GFP_ATOMIC); + if (err && err != (-EPERM)) { + DBG_871X("cannot submit rx in-token(err = 0x%08x),urb_status = %d\n" + , err, purb->status); + goto exit; + } + + ATOMIC_INC(&(precvpriv->rx_pending_cnt)); + ret = _SUCCESS; + +exit: + +_func_exit_; + + return ret; +} +#endif // CONFIG_USE_USB_BUFFER_ALLOC_RX + + diff --git a/backports/drivers/realtek/rtl8812au/os_dep/linux/wifi_regd.c b/backports/drivers/realtek/rtl8812au/os_dep/linux/wifi_regd.c index 74895eaf90b8d7..04ffe781a410fd 100755 --- a/backports/drivers/realtek/rtl8812au/os_dep/linux/wifi_regd.c +++ b/backports/drivers/realtek/rtl8812au/os_dep/linux/wifi_regd.c @@ -268,10 +268,15 @@ static void _rtw_reg_apply_radar_flags(struct wiphy *wiphy) if (!_rtw_is_radar_freq(ch->center_freq)) continue; #ifdef CONFIG_DFS - if (!(ch->flags & IEEE80211_CHAN_DISABLED)) - ch->flags |= IEEE80211_CHAN_RADAR | - IEEE80211_CHAN_NO_IBSS; -#endif + if (!(ch->flags & IEEE80211_CHAN_DISABLED)) { + ch->flags |= IEEE80211_CHAN_RADAR; + #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0)) + ch->flags |= (IEEE80211_CHAN_NO_IBSS|IEEE80211_CHAN_PASSIVE_SCAN); + #else + ch->flags |= IEEE80211_CHAN_NO_IR; + #endif + } +#endif //CONFIG_DFS #if 0 /* @@ -354,12 +359,19 @@ static void _rtw_reg_apply_flags(struct wiphy *wiphy) rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_5GHZ); + ch = ieee80211_get_channel(wiphy, freq); if (ch) { - if (channel_set[i].ScanType == SCAN_PASSIVE) - ch->flags = IEEE80211_CHAN_PASSIVE_SCAN; - else + if (channel_set[i].ScanType == SCAN_PASSIVE) { + #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0)) + ch->flags = (IEEE80211_CHAN_NO_IBSS|IEEE80211_CHAN_PASSIVE_SCAN); + #else + ch->flags = IEEE80211_CHAN_NO_IR; + #endif + } + else { ch->flags = 0; + } } } @@ -474,20 +486,52 @@ static const struct ieee80211_regdomain *_rtw_regdomain_select(struct #endif } -static int _rtw_regd_init_wiphy(struct rtw_regulatory *reg, - struct wiphy *wiphy, - int (*reg_notifier) (struct wiphy * wiphy, - struct regulatory_request * - request)) +void _rtw_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request) +{ + struct rtw_regulatory *reg = NULL; + + DBG_8192C("%s\n", __func__); + + _rtw_reg_notifier_apply(wiphy, request, reg); +} + +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)) +int rtw_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request) +#else +void rtw_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request) +#endif +{ + _rtw_reg_notifier(wiphy, request); + #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)) + return 0; + #endif +} + +void rtw_reg_notify_by_driver(_adapter *adapter) +{ + if ((adapter->rtw_wdev != NULL) && (adapter->rtw_wdev->wiphy)) { + struct regulatory_request request; + request.initiator = NL80211_REGDOM_SET_BY_DRIVER; + rtw_reg_notifier(adapter->rtw_wdev->wiphy, &request); + } +} + +static void _rtw_regd_init_wiphy(struct rtw_regulatory *reg, struct wiphy *wiphy) { const struct ieee80211_regdomain *regd; - wiphy->reg_notifier = reg_notifier; + wiphy->reg_notifier = rtw_reg_notifier; + #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0)) wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY; wiphy->flags &= ~WIPHY_FLAG_STRICT_REGULATORY; wiphy->flags &= ~WIPHY_FLAG_DISABLE_BEACON_HINTS; - + #else + wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG; + wiphy->regulatory_flags &= ~REGULATORY_STRICT_REG; + wiphy->regulatory_flags &= ~REGULATORY_DISABLE_BEACON_HINTS; + #endif + regd = _rtw_regdomain_select(reg); wiphy_apply_custom_regulatory(wiphy, regd); @@ -495,7 +539,6 @@ static int _rtw_regd_init_wiphy(struct rtw_regulatory *reg, _rtw_reg_apply_flags(wiphy); _rtw_reg_apply_radar_flags(wiphy); _rtw_reg_apply_world_flags(wiphy, NL80211_REGDOM_SET_BY_DRIVER, reg); - return 0; } static struct country_code_to_enum_rd *_rtw_regd_find_country(u16 countrycode) @@ -509,11 +552,8 @@ static struct country_code_to_enum_rd *_rtw_regd_find_country(u16 countrycode) return NULL; } -int rtw_regd_init(_adapter * padapter, - int (*reg_notifier) (struct wiphy * wiphy, - struct regulatory_request * request)) +int rtw_regd_init(_adapter * padapter) { - //struct registry_priv *registrypriv = &padapter->registrypriv; struct wiphy *wiphy = padapter->rtw_wdev->wiphy; #if 0 @@ -531,17 +571,9 @@ int rtw_regd_init(_adapter * padapter, __func__, rtw_regd->alpha2[0], rtw_regd->alpha2[1]); #endif - _rtw_regd_init_wiphy(NULL, wiphy, reg_notifier); + _rtw_regd_init_wiphy(NULL, wiphy); return 0; } +#endif //CONFIG_IOCTL_CFG80211 -int rtw_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request) -{ - struct rtw_regulatory *reg = NULL; - - DBG_8192C("%s\n", __func__); - - return _rtw_reg_notifier_apply(wiphy, request, reg); -} -#endif //CONFIG_IOCTL_CFG80211 \ No newline at end of file diff --git a/backports/drivers/realtek/rtl8812au/os_dep/linux/xmit_linux.c b/backports/drivers/realtek/rtl8812au/os_dep/linux/xmit_linux.c index 495059839dcdda..db9b311f321f82 100755 --- a/backports/drivers/realtek/rtl8812au/os_dep/linux/xmit_linux.c +++ b/backports/drivers/realtek/rtl8812au/os_dep/linux/xmit_linux.c @@ -21,6 +21,7 @@ #include +#define DBG_DUMP_OS_QUEUE_CTL 0 uint rtw_remainder_len(struct pkt_file *pfile) { @@ -143,11 +144,11 @@ int rtw_os_xmit_resource_alloc(_adapter *padapter, struct xmit_buf *pxmitbuf, u3 for(i=0; i<8; i++) { pxmitbuf->pxmit_urb[i] = usb_alloc_urb(0, GFP_KERNEL); - if(pxmitbuf->pxmit_urb[i] == NULL) - { - DBG_871X("pxmitbuf->pxmit_urb[i]==NULL"); - return _FAIL; - } + if(pxmitbuf->pxmit_urb[i] == NULL) + { + DBG_871X("pxmitbuf->pxmit_urb[i]==NULL"); + return _FAIL; + } } #endif } @@ -187,28 +188,78 @@ void rtw_os_xmit_resource_free(_adapter *padapter, struct xmit_buf *pxmitbuf,u32 } } +void dump_os_queue(void *sel, _adapter *padapter) +{ + struct net_device *ndev = padapter->pnetdev; + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + int i; + + for (i=0;i<4;i++) { + DBG_871X_SEL_NL(sel, "os_queue[%d]:%s\n" + , i, __netif_subqueue_stopped(ndev, i)?"stopped":"waked"); + } +#else + DBG_871X_SEL_NL(sel, "os_queue:%s\n" + , netif_queue_stopped(ndev)?"stopped":"waked"); +#endif +} + #define WMM_XMIT_THRESHOLD (NR_XMITFRAME*2/5) -void rtw_os_pkt_complete(_adapter *padapter, _pkt *pkt) +inline static bool rtw_os_need_wake_queue(_adapter *padapter, u16 qidx) { #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - u16 queue; struct xmit_priv *pxmitpriv = &padapter->xmitpriv; - queue = skb_get_queue_mapping(pkt); if (padapter->registrypriv.wifi_spec) { - if(__netif_subqueue_stopped(padapter->pnetdev, queue) && - (pxmitpriv->hwxmits[queue].accnt < WMM_XMIT_THRESHOLD)) - { - netif_wake_subqueue(padapter->pnetdev, queue); - } + if (pxmitpriv->hwxmits[qidx].accnt < WMM_XMIT_THRESHOLD) + return _TRUE; + } else { + return _TRUE; + } + return _FALSE; +#else + return _TRUE; +#endif +} + +inline static bool rtw_os_need_stop_queue(_adapter *padapter, u16 qidx) +{ + struct xmit_priv *pxmitpriv = &padapter->xmitpriv; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + if (padapter->registrypriv.wifi_spec) { + /* No free space for Tx, tx_worker is too slow */ + if (pxmitpriv->hwxmits[qidx].accnt > WMM_XMIT_THRESHOLD) + return _TRUE; } else { - if(__netif_subqueue_stopped(padapter->pnetdev, queue)) - netif_wake_subqueue(padapter->pnetdev, queue); + if(pxmitpriv->free_xmitframe_cnt<=4) + return _TRUE; } #else - if (netif_queue_stopped(padapter->pnetdev)) + if(pxmitpriv->free_xmitframe_cnt<=4) + return _TRUE; +#endif + return _FALSE; +} + +void rtw_os_pkt_complete(_adapter *padapter, _pkt *pkt) +{ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + u16 qidx; + + qidx = skb_get_queue_mapping(pkt); + if (rtw_os_need_wake_queue(padapter, qidx)) { + if (DBG_DUMP_OS_QUEUE_CTL) + DBG_871X(FUNC_ADPT_FMT": netif_wake_subqueue[%d]\n", FUNC_ADPT_ARG(padapter), qidx); + netif_wake_subqueue(padapter->pnetdev, qidx); + } +#else + if (rtw_os_need_wake_queue(padapter, 0)) { + if (DBG_DUMP_OS_QUEUE_CTL) + DBG_871X(FUNC_ADPT_FMT": netif_wake_queue\n", FUNC_ADPT_ARG(padapter)); netif_wake_queue(padapter->pnetdev); + } #endif rtw_skb_free(pkt); @@ -259,30 +310,53 @@ void rtw_os_xmit_schedule(_adapter *padapter) #endif } -static void rtw_check_xmit_resource(_adapter *padapter, _pkt *pkt) +static bool rtw_check_xmit_resource(_adapter *padapter, _pkt *pkt) { + bool busy = _FALSE; struct xmit_priv *pxmitpriv = &padapter->xmitpriv; #if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35)) - u16 queue; + u16 qidx; + + qidx = skb_get_queue_mapping(pkt); + if (rtw_os_need_stop_queue(padapter, qidx)) { + if (DBG_DUMP_OS_QUEUE_CTL) + DBG_871X(FUNC_ADPT_FMT": netif_stop_subqueue[%d]\n", FUNC_ADPT_ARG(padapter), qidx); + netif_stop_subqueue(padapter->pnetdev, qidx); + busy = _TRUE; + } +#else + if (rtw_os_need_stop_queue(padapter, 0)) { + if (DBG_DUMP_OS_QUEUE_CTL) + DBG_871X(FUNC_ADPT_FMT": netif_stop_queue\n", FUNC_ADPT_ARG(padapter)); + rtw_netif_stop_queue(padapter->pnetdev); + busy = _TRUE; + } +#endif + return busy; +} - queue = skb_get_queue_mapping(pkt); - if (padapter->registrypriv.wifi_spec) { - /* No free space for Tx, tx_worker is too slow */ - if (pxmitpriv->hwxmits[queue].accnt > WMM_XMIT_THRESHOLD) { - //DBG_871X("%s(): stop netif_subqueue[%d]\n", __FUNCTION__, queue); - netif_stop_subqueue(padapter->pnetdev, queue); - } - } else { - if(pxmitpriv->free_xmitframe_cnt<=4) { - if (!netif_tx_queue_stopped(netdev_get_tx_queue(padapter->pnetdev, queue))) - netif_stop_subqueue(padapter->pnetdev, queue); +void rtw_os_wake_queue_at_free_stainfo(_adapter *padapter, int *qcnt_freed) +{ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + int i; + + for (i=0;i<4;i++) { + if (qcnt_freed[i] == 0) + continue; + + if(rtw_os_need_wake_queue(padapter, i)) { + if (DBG_DUMP_OS_QUEUE_CTL) + DBG_871X(FUNC_ADPT_FMT": netif_wake_subqueue[%d]\n", FUNC_ADPT_ARG(padapter), i); + netif_wake_subqueue(padapter->pnetdev, i); } } #else - if(pxmitpriv->free_xmitframe_cnt<=4) - { - if (!rtw_netif_queue_stopped(padapter->pnetdev)) - rtw_netif_stop_queue(padapter->pnetdev); + if (qcnt_freed[0] || qcnt_freed[1] || qcnt_freed[2] || qcnt_freed[3]) { + if(rtw_os_need_wake_queue(padapter, 0)) { + if (DBG_DUMP_OS_QUEUE_CTL) + DBG_871X(FUNC_ADPT_FMT": netif_wake_queue\n", FUNC_ADPT_ARG(padapter)); + netif_wake_queue(padapter->pnetdev); + } } #endif } @@ -304,6 +378,8 @@ int rtw_mlcst2unicst(_adapter *padapter, struct sk_buff *skb) int i; s32 res; + DBG_COUNTER(padapter->tx_logs.os_tx_m2u); + _enter_critical_bh(&pstapriv->asoc_list_lock, &irqL); phead = &pstapriv->asoc_list; plist = get_next(phead); @@ -324,14 +400,22 @@ int rtw_mlcst2unicst(_adapter *padapter, struct sk_buff *skb) for (i = 0; i < chk_alive_num; i++) { psta = rtw_get_stainfo_by_offset(pstapriv, chk_alive_list[i]); if(!(psta->state &_FW_LINKED)) + { + DBG_COUNTER(padapter->tx_logs.os_tx_m2u_ignore_fw_linked); continue; + } /* avoid come from STA1 and send back STA1 */ if (_rtw_memcmp(psta->hwaddr, &skb->data[6], 6) == _TRUE || _rtw_memcmp(psta->hwaddr, null_addr, 6) == _TRUE || _rtw_memcmp(psta->hwaddr, bc_addr, 6) == _TRUE ) + { + DBG_COUNTER(padapter->tx_logs.os_tx_m2u_ignore_self); continue; + } + + DBG_COUNTER(padapter->tx_logs.os_tx_m2u_entry); newskb = rtw_skb_copy(skb); @@ -339,11 +423,13 @@ int rtw_mlcst2unicst(_adapter *padapter, struct sk_buff *skb) _rtw_memcpy(newskb->data, psta->hwaddr, 6); res = rtw_xmit(padapter, &newskb); if (res < 0) { + DBG_COUNTER(padapter->tx_logs.os_tx_m2u_entry_err_xmit); DBG_871X("%s()-%d: rtw_xmit() return error!\n", __FUNCTION__, __LINE__); pxmitpriv->tx_drop++; rtw_skb_free(newskb); } } else { + DBG_COUNTER(padapter->tx_logs.os_tx_m2u_entry_err_skb); DBG_871X("%s-%d: rtw_skb_copy() failed!\n", __FUNCTION__, __LINE__); pxmitpriv->tx_drop++; //rtw_skb_free(skb); @@ -372,9 +458,16 @@ int _rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev) _func_enter_; + if(padapter->registrypriv.mp_mode) + { + DBG_871X("MP_TX_DROP_OS_FRAME\n"); + goto drop_packet; + } + DBG_COUNTER(padapter->tx_logs.os_tx); RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("+xmit_enry\n")); if (rtw_if_up(padapter) == _FALSE) { + DBG_COUNTER(padapter->tx_logs.os_tx_err_up); RT_TRACE(_module_xmit_osdep_c_, _drv_err_, ("rtw_xmit_entry: rtw_if_up fail\n")); #ifdef DBG_TX_DROP_FRAME DBG_871X("DBG_TX_DROP_FRAME %s if_up fail\n", __FUNCTION__); @@ -388,7 +481,11 @@ _func_enter_; if ( !rtw_mc2u_disable && check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE && ( IP_MCAST_MAC(pkt->data) - || ICMPV6_MCAST_MAC(pkt->data) ) + || ICMPV6_MCAST_MAC(pkt->data) + #ifdef CONFIG_TX_BCAST2UNI + || is_broadcast_mac_addr(pkt->data) + #endif + ) && (padapter->registrypriv.wifi_spec == 0) ) { @@ -400,6 +497,7 @@ _func_enter_; } else { //DBG_871X("Stop M2U(%d, %d)! ", pxmitpriv->free_xmitframe_cnt, pxmitpriv->free_xmitbuf_cnt); //DBG_871X("!m2u ); + DBG_COUNTER(padapter->tx_logs.os_tx_m2u_stop); } } #endif // CONFIG_TX_MCAST2UNI @@ -417,7 +515,7 @@ _func_enter_; drop_packet: pxmitpriv->tx_drop++; - rtw_skb_free(pkt); + rtw_os_pkt_complete(padapter, pkt); RT_TRACE(_module_xmit_osdep_c_, _drv_notice_, ("rtw_xmit_entry: drop, tx_drop=%d\n", (u32)pxmitpriv->tx_drop)); exit: @@ -429,8 +527,13 @@ _func_exit_; int rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev) { - if (pkt) + int ret = 0; + + if (pkt) { rtw_mstat_update(MSTAT_TYPE_SKB, MSTAT_ALLOC_SUCCESS, pkt->truesize); - return _rtw_xmit_entry(pkt, pnetdev); + ret = _rtw_xmit_entry(pkt, pnetdev); + } + + return ret; } diff --git a/backports/drivers/realtek/rtl8812au/os_dep/osdep_service.c b/backports/drivers/realtek/rtl8812au/os_dep/osdep_service.c index 3928eb304ad693..dcef0e75acf525 100755 --- a/backports/drivers/realtek/rtl8812au/os_dep/osdep_service.c +++ b/backports/drivers/realtek/rtl8812au/os_dep/osdep_service.c @@ -506,11 +506,41 @@ void rtw_mstat_update(const enum mstat_f flags, const MSTAT_STATUS status, u32 s //} } +#ifndef SIZE_MAX + #define SIZE_MAX (~(size_t)0) +#endif + +struct mstat_sniff_rule { + enum mstat_f flags; + size_t lb; + size_t hb; +}; + +struct mstat_sniff_rule mstat_sniff_rules[] = { + {MSTAT_TYPE_PHY, 4097, SIZE_MAX}, +}; + +int mstat_sniff_rule_num = sizeof(mstat_sniff_rules)/sizeof(struct mstat_sniff_rule); + +bool match_mstat_sniff_rules(const enum mstat_f flags, const size_t size) +{ + int i; + for (i = 0; i= size) + return _TRUE; + } + + return _FALSE; +} inline u8* dbg_rtw_vmalloc(u32 sz, const enum mstat_f flags, const char *func, const int line) { u8 *p; - //DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz)); + + if (match_mstat_sniff_rules(flags, sz)) + DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz)); p=_rtw_vmalloc((sz)); @@ -526,8 +556,10 @@ inline u8* dbg_rtw_vmalloc(u32 sz, const enum mstat_f flags, const char *func, c inline u8* dbg_rtw_zvmalloc(u32 sz, const enum mstat_f flags, const char *func, const int line) { u8 *p; - //DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz)); - + + if (match_mstat_sniff_rules(flags, sz)) + DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz)); + p=_rtw_zvmalloc((sz)); rtw_mstat_update( @@ -541,8 +573,10 @@ inline u8* dbg_rtw_zvmalloc(u32 sz, const enum mstat_f flags, const char *func, inline void dbg_rtw_vmfree(u8 *pbuf, u32 sz, const enum mstat_f flags, const char *func, const int line) { - //DBG_871X("DBG_MEM_ALLOC %s:%d %s(%p,%d)\n", func, line, __FUNCTION__, (pbuf), (sz)); - + + if (match_mstat_sniff_rules(flags, sz)) + DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz)); + _rtw_vmfree((pbuf), (sz)); rtw_mstat_update( @@ -556,14 +590,11 @@ inline u8* dbg_rtw_malloc(u32 sz, const enum mstat_f flags, const char *func, co { u8 *p; - //if(sz>=153 && sz<=306) - // DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz)); - - //if((sz)>4096) - // DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz)); + if (match_mstat_sniff_rules(flags, sz)) + DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz)); p=_rtw_malloc((sz)); - + rtw_mstat_update( flags , p ? MSTAT_ALLOC_SUCCESS : MSTAT_ALLOC_FAIL @@ -577,11 +608,8 @@ inline u8* dbg_rtw_zmalloc(u32 sz, const enum mstat_f flags, const char *func, c { u8 *p; - //if(sz>=153 && sz<=306) - // DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz)); - - //if((sz)>4096) - // DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz)); + if (match_mstat_sniff_rules(flags, sz)) + DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz)); p = _rtw_zmalloc((sz)); @@ -596,12 +624,9 @@ inline u8* dbg_rtw_zmalloc(u32 sz, const enum mstat_f flags, const char *func, c inline void dbg_rtw_mfree(u8 *pbuf, u32 sz, const enum mstat_f flags, const char *func, const int line) { - //if(sz>=153 && sz<=306) - // DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz)); + if (match_mstat_sniff_rules(flags, sz)) + DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz)); - //if((sz)>4096) - // DBG_871X("DBG_MEM_ALLOC %s:%d %s(%p,%d)\n", func, line, __FUNCTION__, (pbuf), (sz)); - _rtw_mfree((pbuf), (sz)); rtw_mstat_update( @@ -621,7 +646,7 @@ inline struct sk_buff * dbg_rtw_skb_alloc(unsigned int size, const enum mstat_f if(skb) truesize = skb->truesize; - if(!skb || truesize < size /*|| size > 4096*/) + if(!skb || truesize < size || match_mstat_sniff_rules(flags, truesize)) DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d), skb:%p, truesize=%u\n", func, line, __FUNCTION__, size, skb, truesize); rtw_mstat_update( @@ -637,11 +662,11 @@ inline void dbg_rtw_skb_free(struct sk_buff *skb, const enum mstat_f flags, cons { unsigned int truesize = skb->truesize; - //if(truesize > 4096) - // DBG_871X("DBG_MEM_ALLOC %s:%d %s, truesize=%u\n", func, line, __FUNCTION__, truesize); + if(match_mstat_sniff_rules(flags, truesize)) + DBG_871X("DBG_MEM_ALLOC %s:%d %s, truesize=%u\n", func, line, __FUNCTION__, truesize); _rtw_skb_free(skb); - + rtw_mstat_update( flags , MSTAT_FREE @@ -659,7 +684,7 @@ inline struct sk_buff *dbg_rtw_skb_copy(const struct sk_buff *skb, const enum ms if(skb_cp) cp_truesize = skb_cp->truesize; - if(!skb_cp || cp_truesize != truesize /*||cp_truesize > 4096*/) + if(!skb_cp || cp_truesize < truesize || match_mstat_sniff_rules(flags, cp_truesize)) DBG_871X("DBG_MEM_ALLOC %s:%d %s(%u), skb_cp:%p, cp_truesize=%u\n", func, line, __FUNCTION__, truesize, skb_cp, cp_truesize); rtw_mstat_update( @@ -681,7 +706,7 @@ inline struct sk_buff *dbg_rtw_skb_clone(struct sk_buff *skb, const enum mstat_f if(skb_cl) cl_truesize = skb_cl->truesize; - if(!skb_cl || cl_truesize != truesize /*|| cl_truesize > 4096*/) + if(!skb_cl || cl_truesize < truesize || match_mstat_sniff_rules(flags, cl_truesize)) DBG_871X("DBG_MEM_ALLOC %s:%d %s(%u), skb_cl:%p, cl_truesize=%u\n", func, line, __FUNCTION__, truesize, skb_cl, cl_truesize); rtw_mstat_update( @@ -698,8 +723,8 @@ inline int dbg_rtw_netif_rx(_nic_hdl ndev, struct sk_buff *skb, const enum mstat int ret; unsigned int truesize = skb->truesize; - //if(truesize > 4096) - // DBG_871X("DBG_MEM_ALLOC %s:%d %s, truesize=%u\n", func, line, __FUNCTION__, truesize); + if(match_mstat_sniff_rules(flags, truesize)) + DBG_871X("DBG_MEM_ALLOC %s:%d %s, truesize=%u\n", func, line, __FUNCTION__, truesize); ret = _rtw_netif_rx(ndev, skb); @@ -724,8 +749,10 @@ inline void dbg_rtw_skb_queue_purge(struct sk_buff_head *list, enum mstat_f flag inline void *dbg_rtw_usb_buffer_alloc(struct usb_device *dev, size_t size, dma_addr_t *dma, const enum mstat_f flags, const char *func, int line) { void *p; - //DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, size); - + + if(match_mstat_sniff_rules(flags, size)) + DBG_871X("DBG_MEM_ALLOC %s:%d %s(%zu)\n", func, line, __FUNCTION__, size); + p = _rtw_usb_buffer_alloc(dev, size, dma); rtw_mstat_update( @@ -739,7 +766,9 @@ inline void *dbg_rtw_usb_buffer_alloc(struct usb_device *dev, size_t size, dma_a inline void dbg_rtw_usb_buffer_free(struct usb_device *dev, size_t size, void *addr, dma_addr_t dma, const enum mstat_f flags, const char *func, int line) { - //DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, size); + + if(match_mstat_sniff_rules(flags, size)) + DBG_871X("DBG_MEM_ALLOC %s:%d %s(%zu)\n", func, line, __FUNCTION__, size); _rtw_usb_buffer_free(dev, size, addr, dma); @@ -753,7 +782,7 @@ inline void dbg_rtw_usb_buffer_free(struct usb_device *dev, size_t size, void *a #endif /* defined(DBG_MEM_ALLOC) */ -void* rtw_malloc2d(int h, int w, int size) +void* rtw_malloc2d(int h, int w, size_t size) { int j; @@ -1375,7 +1404,12 @@ void rtw_msleep_os(int ms) { #ifdef PLATFORM_LINUX - + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36)) + if (ms < 20) { + unsigned long us = ms * 1000UL; + usleep_range(us, us + 1000UL); + } else + #endif msleep((unsigned int)ms); #endif @@ -1394,16 +1428,19 @@ void rtw_msleep_os(int ms) } void rtw_usleep_os(int us) { - #ifdef PLATFORM_LINUX - - // msleep((unsigned int)us); - if ( 1 < (us/1000) ) - msleep(1); + + // msleep((unsigned int)us); + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36)) + usleep_range(us, us + 1); + #else + if ( 1 < (us/1000) ) + msleep(1); else msleep( (us/1000) + 1); + #endif +#endif -#endif #ifdef PLATFORM_FREEBSD //Delay for delay microseconds DELAY(us); @@ -2118,13 +2155,14 @@ void rtw_free_netdev(struct net_device * netdev) int rtw_change_ifname(_adapter *padapter, const char *ifname) { struct net_device *pnetdev; - struct net_device *cur_pnetdev = padapter->pnetdev; + struct net_device *cur_pnetdev; struct rereg_nd_name_data *rereg_priv; int ret; if(!padapter) goto error; + cur_pnetdev = padapter->pnetdev; rereg_priv = &padapter->rereg_nd_name_priv; //free the old_pnetdev @@ -2280,6 +2318,10 @@ inline u32 rtw_random32(void) #ifdef PLATFORM_LINUX #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) return prandom_u32(); + #elif (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,18)) + u32 random_int; + get_random_bytes( &random_int , 4 ); + return random_int; #else return random32(); #endif diff --git a/backports/drivers/realtek/rtl8812au/platform/platform_ARM_SUNnI_sdio.c b/backports/drivers/realtek/rtl8812au/platform/platform_ARM_SUNnI_sdio.c index 480652676695e0..d384141eba0c81 100755 --- a/backports/drivers/realtek/rtl8812au/platform/platform_ARM_SUNnI_sdio.c +++ b/backports/drivers/realtek/rtl8812au/platform/platform_ARM_SUNnI_sdio.c @@ -69,20 +69,27 @@ int platform_wifi_power_on(void) } else { sdc_id = val.val; DBG_871X("----- %s sdc_id: %d, mod_sel: %d\n", __FUNCTION__, sdc_id, mod_sel); - wifi_pm_power(1); - mdelay(10); + #if defined(CONFIG_PLATFORM_ARM_SUN6I) || defined(CONFIG_PLATFORM_ARM_SUN7I) sw_mci_rescan_card(sdc_id, 1); #elif defined(CONFIG_PLATFORM_ARM_SUN8I) sunxi_mci_rescan_card(sdc_id, 1); #endif + mdelay(100); + wifi_pm_power(1); + DBG_871X("%s: power up, rescan card.\n", __FUNCTION__); } #ifdef CONFIG_GPIO_WAKEUP +#ifdef CONFIG_RTL8723B type = script_get_item("wifi_para", "rtl8723bs_wl_host_wake", &val); +#endif +#ifdef CONFIG_RTL8188E + type = script_get_item("wifi_para", "rtl8189es_host_wake", &val); +#endif if (SCIRPT_ITEM_VALUE_TYPE_PIO != type) { - DBG_871X("has no rtl8723bs_wl_wake_host\n"); + DBG_871X("No definition of wake up host PIN\n"); ret = -1; } else { gpio_eint_wlan = val.gpio.gpio; @@ -100,12 +107,14 @@ int platform_wifi_power_on(void) void platform_wifi_power_off(void) { #ifdef CONFIG_MMC - wifi_pm_power(0); #if defined(CONFIG_PLATFORM_ARM_SUN6I) ||defined(CONFIG_PLATFORM_ARM_SUN7I) sw_mci_rescan_card(sdc_id, 0); #elif defined(CONFIG_PLATFORM_ARM_SUN8I) sunxi_mci_rescan_card(sdc_id, 0); #endif + mdelay(100); + wifi_pm_power(0); + DBG_871X("%s: remove card, power off.\n", __FUNCTION__); #endif // CONFIG_MMC } diff --git a/backports/drivers/realtek/rtl8812au/platform/platform_ARM_WMT_sdio.c b/backports/drivers/realtek/rtl8812au/platform/platform_ARM_WMT_sdio.c new file mode 100644 index 00000000000000..62e5825886cb14 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/platform/platform_ARM_WMT_sdio.c @@ -0,0 +1,51 @@ +/****************************************************************************** + * + * Copyright(c) 2013 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ +#include +#include +#include + +extern void wmt_detect_sdio2(void); +extern void force_remove_sdio2(void); + +int platform_wifi_power_on(void) +{ + int err = 0; + err = gpio_request(WMT_PIN_GP62_SUSGPIO1, "wifi_chip_en"); + if (err < 0){ + printk("request gpio for rtl8188eu failed!\n"); + return err; + } + gpio_direction_output(WMT_PIN_GP62_SUSGPIO1, 0);//pull sus_gpio1 to 0 to open vcc_wifi. + printk("power on rtl8189.\n"); + msleep(500); + wmt_detect_sdio2(); + printk("[rtl8189es] %s: new card, power on.\n", __FUNCTION__); + return err; +} + +void platform_wifi_power_off(void) +{ + force_remove_sdio2(); + + gpio_direction_output(WMT_PIN_GP62_SUSGPIO1, 1);//pull sus_gpio1 to 1 to close vcc_wifi. + printk("power off rtl8189.\n"); + gpio_free(WMT_PIN_GP62_SUSGPIO1); + printk("[rtl8189es] %s: remove card, power off.\n", __FUNCTION__); +} diff --git a/backports/drivers/realtek/rtl8812au/platform/platform_arm_act_sdio.c b/backports/drivers/realtek/rtl8812au/platform/platform_arm_act_sdio.c new file mode 100644 index 00000000000000..539bb178c584e2 --- /dev/null +++ b/backports/drivers/realtek/rtl8812au/platform/platform_arm_act_sdio.c @@ -0,0 +1,58 @@ +/****************************************************************************** + * + * Copyright(c) 2013 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + ******************************************************************************/ +/* + * Description: + * This file can be applied to following platforms: + * CONFIG_PLATFORM_ACTIONS_ATM703X + */ +#include + +#ifdef CONFIG_PLATFORM_ACTIONS_ATM705X +extern int acts_wifi_init(void); +extern void acts_wifi_cleanup(void); +#endif + +/* + * Return: + * 0: power on successfully + * others: power on failed + */ +int platform_wifi_power_on(void) +{ + int ret = 0; + +#ifdef CONFIG_PLATFORM_ACTIONS_ATM705X + ret = acts_wifi_init(); + if (unlikely(ret < 0)) { + pr_err("%s Failed to register the power control driver.\n", __FUNCTION__); + goto exit; + } +#endif + +exit: + return ret; +} + +void platform_wifi_power_off(void) +{ +#ifdef CONFIG_PLATFORM_ACTIONS_ATM705X + acts_wifi_cleanup(); +#endif +} From 7547990e68cead65a5e6d36fb247af68fe85ed50 Mon Sep 17 00:00:00 2001 From: moonman Date: Sat, 24 Oct 2015 06:49:49 -0600 Subject: [PATCH 341/359] Readd AUFS with fixes for 3.10.76 and 3.10.83 kernels --- Documentation/ABI/testing/debugfs-aufs | 50 + Documentation/ABI/testing/sysfs-aufs | 31 + Documentation/filesystems/aufs/README | 370 ++++ .../filesystems/aufs/design/01intro.txt | 161 ++ .../filesystems/aufs/design/02struct.txt | 251 +++ .../filesystems/aufs/design/03lookup.txt | 133 ++ .../filesystems/aufs/design/04branch.txt | 75 + .../filesystems/aufs/design/05wbr_policy.txt | 64 + .../filesystems/aufs/design/06fhsm.txt | 120 ++ .../filesystems/aufs/design/06mmap.txt | 46 + .../filesystems/aufs/design/06xattr.txt | 96 + .../filesystems/aufs/design/07export.txt | 58 + .../filesystems/aufs/design/08shwh.txt | 52 + .../filesystems/aufs/design/10dynop.txt | 46 + .../filesystems/aufs/design/99plan.txt | 58 + MAINTAINERS | 14 + fs/Kconfig | 1 + fs/Makefile | 1 + fs/aufs/Kconfig | 185 ++ fs/aufs/Makefile | 43 + fs/aufs/aufs.h | 59 + fs/aufs/branch.c | 1445 +++++++++++++ fs/aufs/branch.h | 268 +++ fs/aufs/conf.mk | 38 + fs/aufs/cpup.c | 1285 ++++++++++++ fs/aufs/cpup.h | 94 + fs/aufs/dbgaufs.c | 432 ++++ fs/aufs/dbgaufs.h | 48 + fs/aufs/dcsub.c | 242 +++ fs/aufs/dcsub.h | 102 + fs/aufs/debug.c | 520 +++++ fs/aufs/debug.h | 263 +++ fs/aufs/dentry.c | 1096 ++++++++++ fs/aufs/dentry.h | 232 +++ fs/aufs/dinfo.c | 542 +++++ fs/aufs/dir.c | 631 ++++++ fs/aufs/dir.h | 130 ++ fs/aufs/dynop.c | 378 ++++ fs/aufs/dynop.h | 75 + fs/aufs/export.c | 825 ++++++++ fs/aufs/f_op.c | 796 +++++++ fs/aufs/fhsm.c | 426 ++++ fs/aufs/file.c | 815 ++++++++ fs/aufs/file.h | 284 +++ fs/aufs/finfo.c | 156 ++ fs/aufs/fstype.h | 469 +++++ fs/aufs/hfsnotify.c | 302 +++ fs/aufs/hfsplus.c | 56 + fs/aufs/hnotify.c | 712 +++++++ fs/aufs/i_op.c | 1255 +++++++++++ fs/aufs/i_op_add.c | 750 +++++++ fs/aufs/i_op_del.c | 502 +++++ fs/aufs/i_op_ren.c | 1010 +++++++++ fs/aufs/iinfo.c | 275 +++ fs/aufs/inode.c | 496 +++++ fs/aufs/inode.h | 633 ++++++ fs/aufs/ioctl.c | 219 ++ fs/aufs/loop.c | 134 ++ fs/aufs/loop.h | 49 + fs/aufs/magic.mk | 54 + fs/aufs/module.c | 210 ++ fs/aufs/module.h | 104 + fs/aufs/mvdown.c | 680 ++++++ fs/aufs/opts.c | 1840 +++++++++++++++++ fs/aufs/opts.h | 213 ++ fs/aufs/plink.c | 519 +++++ fs/aufs/poll.c | 55 + fs/aufs/procfs.c | 169 ++ fs/aufs/rdu.c | 383 ++++ fs/aufs/rwsem.h | 191 ++ fs/aufs/sbinfo.c | 353 ++++ fs/aufs/spl.h | 111 + fs/aufs/super.c | 1008 +++++++++ fs/aufs/super.h | 641 ++++++ fs/aufs/sysaufs.c | 104 + fs/aufs/sysaufs.h | 101 + fs/aufs/sysfs.c | 372 ++++ fs/aufs/sysrq.c | 157 ++ fs/aufs/vdir.c | 879 ++++++++ fs/aufs/vfsub.c | 782 +++++++ fs/aufs/vfsub.h | 328 +++ fs/aufs/wbr_policy.c | 764 +++++++ fs/aufs/whout.c | 1025 +++++++++ fs/aufs/whout.h | 85 + fs/aufs/wkq.c | 212 ++ fs/aufs/wkq.h | 91 + fs/aufs/xattr.c | 437 ++++ fs/aufs/xino.c | 1309 ++++++++++++ fs/buffer.c | 2 +- fs/inode.c | 4 +- fs/namei.c | 3 +- fs/namespace.c | 2 + fs/notify/group.c | 4 + fs/notify/mark.c | 4 + fs/open.c | 2 + fs/proc/base.c | 2 +- fs/proc/nommu.c | 5 +- fs/proc/task_mmu.c | 6 +- fs/proc/task_nommu.c | 5 +- fs/splice.c | 12 +- fs/xattr.c | 1 + include/linux/aufs_type.h | 418 ++++ include/linux/fs.h | 2 + include/linux/mm.h | 22 + include/linux/mm_types.h | 2 + include/linux/splice.h | 6 + include/uapi/linux/Kbuild | 1 + include/uapi/linux/aufs_type.h | 418 ++++ kernel/fork.c | 2 +- mm/Makefile | 2 +- mm/filemap.c | 2 +- mm/fremap.c | 16 +- mm/madvise.c | 4 +- mm/memory.c | 4 +- mm/mmap.c | 12 +- mm/msync.c | 4 +- mm/nommu.c | 10 +- mm/prfile.c | 86 + security/commoncap.c | 2 + security/device_cgroup.c | 2 + security/security.c | 10 + 121 files changed, 34119 insertions(+), 34 deletions(-) create mode 100644 Documentation/ABI/testing/debugfs-aufs create mode 100644 Documentation/ABI/testing/sysfs-aufs create mode 100644 Documentation/filesystems/aufs/README create mode 100644 Documentation/filesystems/aufs/design/01intro.txt create mode 100644 Documentation/filesystems/aufs/design/02struct.txt create mode 100644 Documentation/filesystems/aufs/design/03lookup.txt create mode 100644 Documentation/filesystems/aufs/design/04branch.txt create mode 100644 Documentation/filesystems/aufs/design/05wbr_policy.txt create mode 100644 Documentation/filesystems/aufs/design/06fhsm.txt create mode 100644 Documentation/filesystems/aufs/design/06mmap.txt create mode 100644 Documentation/filesystems/aufs/design/06xattr.txt create mode 100644 Documentation/filesystems/aufs/design/07export.txt create mode 100644 Documentation/filesystems/aufs/design/08shwh.txt create mode 100644 Documentation/filesystems/aufs/design/10dynop.txt create mode 100644 Documentation/filesystems/aufs/design/99plan.txt create mode 100644 fs/aufs/Kconfig create mode 100644 fs/aufs/Makefile create mode 100644 fs/aufs/aufs.h create mode 100644 fs/aufs/branch.c create mode 100644 fs/aufs/branch.h create mode 100644 fs/aufs/conf.mk create mode 100644 fs/aufs/cpup.c create mode 100644 fs/aufs/cpup.h create mode 100644 fs/aufs/dbgaufs.c create mode 100644 fs/aufs/dbgaufs.h create mode 100644 fs/aufs/dcsub.c create mode 100644 fs/aufs/dcsub.h create mode 100644 fs/aufs/debug.c create mode 100644 fs/aufs/debug.h create mode 100644 fs/aufs/dentry.c create mode 100644 fs/aufs/dentry.h create mode 100644 fs/aufs/dinfo.c create mode 100644 fs/aufs/dir.c create mode 100644 fs/aufs/dir.h create mode 100644 fs/aufs/dynop.c create mode 100644 fs/aufs/dynop.h create mode 100644 fs/aufs/export.c create mode 100644 fs/aufs/f_op.c create mode 100644 fs/aufs/fhsm.c create mode 100644 fs/aufs/file.c create mode 100644 fs/aufs/file.h create mode 100644 fs/aufs/finfo.c create mode 100644 fs/aufs/fstype.h create mode 100644 fs/aufs/hfsnotify.c create mode 100644 fs/aufs/hfsplus.c create mode 100644 fs/aufs/hnotify.c create mode 100644 fs/aufs/i_op.c create mode 100644 fs/aufs/i_op_add.c create mode 100644 fs/aufs/i_op_del.c create mode 100644 fs/aufs/i_op_ren.c create mode 100644 fs/aufs/iinfo.c create mode 100644 fs/aufs/inode.c create mode 100644 fs/aufs/inode.h create mode 100644 fs/aufs/ioctl.c create mode 100644 fs/aufs/loop.c create mode 100644 fs/aufs/loop.h create mode 100644 fs/aufs/magic.mk create mode 100644 fs/aufs/module.c create mode 100644 fs/aufs/module.h create mode 100644 fs/aufs/mvdown.c create mode 100644 fs/aufs/opts.c create mode 100644 fs/aufs/opts.h create mode 100644 fs/aufs/plink.c create mode 100644 fs/aufs/poll.c create mode 100644 fs/aufs/procfs.c create mode 100644 fs/aufs/rdu.c create mode 100644 fs/aufs/rwsem.h create mode 100644 fs/aufs/sbinfo.c create mode 100644 fs/aufs/spl.h create mode 100644 fs/aufs/super.c create mode 100644 fs/aufs/super.h create mode 100644 fs/aufs/sysaufs.c create mode 100644 fs/aufs/sysaufs.h create mode 100644 fs/aufs/sysfs.c create mode 100644 fs/aufs/sysrq.c create mode 100644 fs/aufs/vdir.c create mode 100644 fs/aufs/vfsub.c create mode 100644 fs/aufs/vfsub.h create mode 100644 fs/aufs/wbr_policy.c create mode 100644 fs/aufs/whout.c create mode 100644 fs/aufs/whout.h create mode 100644 fs/aufs/wkq.c create mode 100644 fs/aufs/wkq.h create mode 100644 fs/aufs/xattr.c create mode 100644 fs/aufs/xino.c create mode 100644 include/linux/aufs_type.h create mode 100644 include/uapi/linux/aufs_type.h create mode 100644 mm/prfile.c diff --git a/Documentation/ABI/testing/debugfs-aufs b/Documentation/ABI/testing/debugfs-aufs new file mode 100644 index 00000000000000..99642d1055a295 --- /dev/null +++ b/Documentation/ABI/testing/debugfs-aufs @@ -0,0 +1,50 @@ +What: /debug/aufs/si_/ +Date: March 2009 +Contact: J. R. Okajima +Description: + Under /debug/aufs, a directory named si_ is created + per aufs mount, where is a unique id generated + internally. + +What: /debug/aufs/si_/plink +Date: Apr 2013 +Contact: J. R. Okajima +Description: + It has three lines and shows the information about the + pseudo-link. The first line is a single number + representing a number of buckets. The second line is a + number of pseudo-links per buckets (separated by a + blank). The last line is a single number representing a + total number of psedo-links. + When the aufs mount option 'noplink' is specified, it + will show "1\n0\n0\n". + +What: /debug/aufs/si_/xib +Date: March 2009 +Contact: J. R. Okajima +Description: + It shows the consumed blocks by xib (External Inode Number + Bitmap), its block size and file size. + When the aufs mount option 'noxino' is specified, it + will be empty. About XINO files, see the aufs manual. + +What: /debug/aufs/si_/xino0, xino1 ... xinoN +Date: March 2009 +Contact: J. R. Okajima +Description: + It shows the consumed blocks by xino (External Inode Number + Translation Table), its link count, block size and file + size. + When the aufs mount option 'noxino' is specified, it + will be empty. About XINO files, see the aufs manual. + +What: /debug/aufs/si_/xigen +Date: March 2009 +Contact: J. R. Okajima +Description: + It shows the consumed blocks by xigen (External Inode + Generation Table), its block size and file size. + If CONFIG_AUFS_EXPORT is disabled, this entry will not + be created. + When the aufs mount option 'noxino' is specified, it + will be empty. About XINO files, see the aufs manual. diff --git a/Documentation/ABI/testing/sysfs-aufs b/Documentation/ABI/testing/sysfs-aufs new file mode 100644 index 00000000000000..82f9518495eae4 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-aufs @@ -0,0 +1,31 @@ +What: /sys/fs/aufs/si_/ +Date: March 2009 +Contact: J. R. Okajima +Description: + Under /sys/fs/aufs, a directory named si_ is created + per aufs mount, where is a unique id generated + internally. + +What: /sys/fs/aufs/si_/br0, br1 ... brN +Date: March 2009 +Contact: J. R. Okajima +Description: + It shows the abolute path of a member directory (which + is called branch) in aufs, and its permission. + +What: /sys/fs/aufs/si_/brid0, brid1 ... bridN +Date: July 2013 +Contact: J. R. Okajima +Description: + It shows the id of a member directory (which is called + branch) in aufs. + +What: /sys/fs/aufs/si_/xi_path +Date: March 2009 +Contact: J. R. Okajima +Description: + It shows the abolute path of XINO (External Inode Number + Bitmap, Translation Table and Generation Table) file + even if it is the default path. + When the aufs mount option 'noxino' is specified, it + will be empty. About XINO files, see the aufs manual. diff --git a/Documentation/filesystems/aufs/README b/Documentation/filesystems/aufs/README new file mode 100644 index 00000000000000..4b97e592ddc05a --- /dev/null +++ b/Documentation/filesystems/aufs/README @@ -0,0 +1,370 @@ + +Aufs3 -- advanced multi layered unification filesystem version 3.x +http://aufs.sf.net +Junjiro R. Okajima + + +0. Introduction +---------------------------------------- +In the early days, aufs was entirely re-designed and re-implemented +Unionfs Version 1.x series. After many original ideas, approaches, +improvements and implementations, it becomes totally different from +Unionfs while keeping the basic features. +Recently, Unionfs Version 2.x series begin taking some of the same +approaches to aufs1's. +Unionfs is being developed by Professor Erez Zadok at Stony Brook +University and his team. + +Aufs3 supports linux-3.0 and later. +If you want older kernel version support, try aufs2-2.6.git or +aufs2-standalone.git repository, aufs1 from CVS on SourceForge. + +Note: it becomes clear that "Aufs was rejected. Let's give it up." + According to Christoph Hellwig, linux rejects all union-type + filesystems but UnionMount. + + +PS. Al Viro seems have a plan to merge aufs as well as overlayfs and + UnionMount, and he pointed out an issue around a directory mutex + lock and aufs addressed it. But it is still unsure whether aufs will + be merged (or any other union solution). + + + +1. Features +---------------------------------------- +- unite several directories into a single virtual filesystem. The member + directory is called as a branch. +- you can specify the permission flags to the branch, which are 'readonly', + 'readwrite' and 'whiteout-able.' +- by upper writable branch, internal copyup and whiteout, files/dirs on + readonly branch are modifiable logically. +- dynamic branch manipulation, add, del. +- etc... + +Also there are many enhancements in aufs1, such as: +- readdir(3) in userspace. +- keep inode number by external inode number table +- keep the timestamps of file/dir in internal copyup operation +- seekable directory, supporting NFS readdir. +- whiteout is hardlinked in order to reduce the consumption of inodes + on branch +- do not copyup, nor create a whiteout when it is unnecessary +- revert a single systemcall when an error occurs in aufs +- remount interface instead of ioctl +- maintain /etc/mtab by an external command, /sbin/mount.aufs. +- loopback mounted filesystem as a branch +- kernel thread for removing the dir who has a plenty of whiteouts +- support copyup sparse file (a file which has a 'hole' in it) +- default permission flags for branches +- selectable permission flags for ro branch, whether whiteout can + exist or not +- export via NFS. +- support /fs/aufs and /aufs. +- support multiple writable branches, some policies to select one + among multiple writable branches. +- a new semantics for link(2) and rename(2) to support multiple + writable branches. +- no glibc changes are required. +- pseudo hardlink (hardlink over branches) +- allow a direct access manually to a file on branch, e.g. bypassing aufs. + including NFS or remote filesystem branch. +- userspace wrapper for pathconf(3)/fpathconf(3) with _PC_LINK_MAX. +- and more... + +Currently these features are dropped temporary from aufs3. +See design/08plan.txt in detail. +- test only the highest one for the directory permission (dirperm1) +- copyup on open (coo=) +- nested mount, i.e. aufs as readonly no-whiteout branch of another aufs + (robr) +- statistics of aufs thread (/sys/fs/aufs/stat) +- delegation mode (dlgt) + a delegation of the internal branch access to support task I/O + accounting, which also supports Linux Security Modules (LSM) mainly + for Suse AppArmor. +- intent.open/create (file open in a single lookup) + +Features or just an idea in the future (see also design/*.txt), +- reorder the branch index without del/re-add. +- permanent xino files for NFSD +- an option for refreshing the opened files after add/del branches +- 'move' policy for copy-up between two writable branches, after + checking free space. +- light version, without branch manipulation. (unnecessary?) +- copyup in userspace +- inotify in userspace +- readv/writev +- xattr, acl + + +2. Download +---------------------------------------- +There were three GIT trees for aufs3, aufs3-linux.git, +aufs3-standalone.git, and aufs-util.git. Note that there is no "3" in +"aufs-util.git." +While the aufs-util is always necessary, you need either of aufs3-linux +or aufs3-standalone. + +The aufs3-linux tree includes the whole linux mainline GIT tree, +git://git.kernel.org/.../torvalds/linux.git. +And you cannot select CONFIG_AUFS_FS=m for this version, eg. you cannot +build aufs3 as an external kernel module. + +On the other hand, the aufs3-standalone tree has only aufs source files +and necessary patches, and you can select CONFIG_AUFS_FS=m. + +You will find GIT branches whose name is in form of "aufs3.x" where "x" +represents the linux kernel version, "linux-3.x". For instance, +"aufs3.0" is for linux-3.0. For latest "linux-3.x-rcN", use +"aufs3.x-rcN" branch. + +o aufs3-linux tree +$ git clone --reference /your/linux/git/tree \ + git://git.code.sf.net/p/aufs/aufs3-linux aufs-aufs3-linux \ + aufs3-linux.git +- if you don't have linux GIT tree, then remove "--reference ..." +$ cd aufs3-linux.git +$ git checkout origin/aufs3.0 + +o aufs3-standalone tree +$ git clone git://git.code.sf.net/p/aufs/aufs3-standalone \ + aufs3-standalone.git +$ cd aufs3-standalone.git +$ git checkout origin/aufs3.0 + +o aufs-util tree +$ git clone git://git.code.sf.net/p/aufs/aufs-util \ + aufs-util.git +$ cd aufs-util.git +$ git checkout origin/aufs3.0 + +Note: The 3.x-rcN branch is to be used with `rc' kernel versions ONLY. +The minor version number, 'x' in '3.x', of aufs may not always +follow the minor version number of the kernel. +Because changes in the kernel that cause the use of a new +minor version number do not always require changes to aufs-util. + +Since aufs-util has its own minor version number, you may not be +able to find a GIT branch in aufs-util for your kernel's +exact minor version number. +In this case, you should git-checkout the branch for the +nearest lower number. + +For (an unreleased) example: +If you are using "linux-3.10" and the "aufs3.10" branch +does not exist in aufs-util repository, then "aufs3.9", "aufs3.8" +or something numerically smaller is the branch for your kernel. + +Also you can view all branches by + $ git branch -a + + +3. Configuration and Compilation +---------------------------------------- +Make sure you have git-checkout'ed the correct branch. + +For aufs3-linux tree, +- enable CONFIG_AUFS_FS. +- set other aufs configurations if necessary. + +For aufs3-standalone tree, +There are several ways to build. + +1. +- apply ./aufs3-kbuild.patch to your kernel source files. +- apply ./aufs3-base.patch too. +- apply ./aufs3-mmap.patch too. +- apply ./aufs3-standalone.patch too, if you have a plan to set + CONFIG_AUFS_FS=m. otherwise you don't need ./aufs3-standalone.patch. +- copy ./{Documentation,fs,include/uapi/linux/aufs_type.h} files to your + kernel source tree. Never copy $PWD/include/uapi/linux/Kbuild. +- enable CONFIG_AUFS_FS, you can select either + =m or =y. +- and build your kernel as usual. +- install the built kernel. + Note: Since linux-3.9, every filesystem module requires an alias + "fs-". You should make sure that "fs-aufs" is listed in your + modules.aliases file if you set CONFIG_AUFS_FS=m. +- install the header files too by "make headers_install" to the + directory where you specify. By default, it is $PWD/usr. + "make help" shows a brief note for headers_install. +- and reboot your system. + +2. +- module only (CONFIG_AUFS_FS=m). +- apply ./aufs3-base.patch to your kernel source files. +- apply ./aufs3-mmap.patch too. +- apply ./aufs3-standalone.patch too. +- build your kernel, don't forget "make headers_install", and reboot. +- edit ./config.mk and set other aufs configurations if necessary. + Note: You should read $PWD/fs/aufs/Kconfig carefully which describes + every aufs configurations. +- build the module by simple "make". + Note: Since linux-3.9, every filesystem module requires an alias + "fs-". You should make sure that "fs-aufs" is listed in your + modules.aliases file. +- you can specify ${KDIR} make variable which points to your kernel + source tree. +- install the files + + run "make install" to install the aufs module, or copy the built + $PWD/aufs.ko to /lib/modules/... and run depmod -a (or reboot simply). + + run "make install_headers" (instead of headers_install) to install + the modified aufs header file (you can specify DESTDIR which is + available in aufs standalone version's Makefile only), or copy + $PWD/usr/include/linux/aufs_type.h to /usr/include/linux or wherever + you like manually. By default, the target directory is $PWD/usr. +- no need to apply aufs3-kbuild.patch, nor copying source files to your + kernel source tree. + +Note: The header file aufs_type.h is necessary to build aufs-util + as well as "make headers_install" in the kernel source tree. + headers_install is subject to be forgotten, but it is essentially + necessary, not only for building aufs-util. + You may not meet problems without headers_install in some older + version though. + +And then, +- read README in aufs-util, build and install it +- note that your distribution may contain an obsoleted version of + aufs_type.h in /usr/include/linux or something. When you build aufs + utilities, make sure that your compiler refers the correct aufs header + file which is built by "make headers_install." +- if you want to use readdir(3) in userspace or pathconf(3) wrapper, + then run "make install_ulib" too. And refer to the aufs manual in + detail. + +There several other patches in aufs3-standalone.git. They are all +optional. When you meet some problems, they will help you. +- aufs3-loopback.patch + Supports a nested loopback mount in a branch-fs. This patch is + unnecessary until aufs produces a message like "you may want to try + another patch for loopback file". +- vfs-ino.patch + Modifies a system global kernel internal function get_next_ino() in + order to stop assigning 0 for an inode-number. Not directly related to + aufs, but recommended generally. +- tmpfs-idr.patch + Keeps the tmpfs inode number as the lowest value. Effective to reduce + the size of aufs XINO files for tmpfs branch. Also it prevents the + duplication of inode number, which is important for backup tools and + other utilities. When you find aufs XINO files for tmpfs branch + growing too much, try this patch. + + +4. Usage +---------------------------------------- +At first, make sure aufs-util are installed, and please read the aufs +manual, aufs.5 in aufs-util.git tree. +$ man -l aufs.5 + +And then, +$ mkdir /tmp/rw /tmp/aufs +# mount -t aufs -o br=/tmp/rw:${HOME} none /tmp/aufs + +Here is another example. The result is equivalent. +# mount -t aufs -o br=/tmp/rw=rw:${HOME}=ro none /tmp/aufs + Or +# mount -t aufs -o br:/tmp/rw none /tmp/aufs +# mount -o remount,append:${HOME} /tmp/aufs + +Then, you can see whole tree of your home dir through /tmp/aufs. If +you modify a file under /tmp/aufs, the one on your home directory is +not affected, instead the same named file will be newly created under +/tmp/rw. And all of your modification to a file will be applied to +the one under /tmp/rw. This is called the file based Copy on Write +(COW) method. +Aufs mount options are described in aufs.5. +If you run chroot or something and make your aufs as a root directory, +then you need to customize the shutdown script. See the aufs manual in +detail. + +Additionally, there are some sample usages of aufs which are a +diskless system with network booting, and LiveCD over NFS. +See sample dir in CVS tree on SourceForge. + + +5. Contact +---------------------------------------- +When you have any problems or strange behaviour in aufs, please let me +know with: +- /proc/mounts (instead of the output of mount(8)) +- /sys/module/aufs/* +- /sys/fs/aufs/* (if you have them) +- /debug/aufs/* (if you have them) +- linux kernel version + if your kernel is not plain, for example modified by distributor, + the url where i can download its source is necessary too. +- aufs version which was printed at loading the module or booting the + system, instead of the date you downloaded. +- configuration (define/undefine CONFIG_AUFS_xxx) +- kernel configuration or /proc/config.gz (if you have it) +- behaviour which you think to be incorrect +- actual operation, reproducible one is better +- mailto: aufs-users at lists.sourceforge.net + +Usually, I don't watch the Public Areas(Bugs, Support Requests, Patches, +and Feature Requests) on SourceForge. Please join and write to +aufs-users ML. + + +6. Acknowledgements +---------------------------------------- +Thanks to everyone who have tried and are using aufs, whoever +have reported a bug or any feedback. + +Especially donators: +Tomas Matejicek(slax.org) made a donation (much more than once). + Since Apr 2010, Tomas M (the author of Slax and Linux Live + scripts) is making "doubling" donations. + Unfortunately I cannot list all of the donators, but I really + appreciate. + It ends Aug 2010, but the ordinary donation URL is still available. + +Dai Itasaka made a donation (2007/8). +Chuck Smith made a donation (2008/4, 10 and 12). +Henk Schoneveld made a donation (2008/9). +Chih-Wei Huang, ASUS, CTC donated Eee PC 4G (2008/10). +Francois Dupoux made a donation (2008/11). +Bruno Cesar Ribas and Luis Carlos Erpen de Bona, C3SL serves public + aufs2 GIT tree (2009/2). +William Grant made a donation (2009/3). +Patrick Lane made a donation (2009/4). +The Mail Archive (mail-archive.com) made donations (2009/5). +Nippy Networks (Ed Wildgoose) made a donation (2009/7). +New Dream Network, LLC (www.dreamhost.com) made a donation (2009/11). +Pavel Pronskiy made a donation (2011/2). +Iridium and Inmarsat satellite phone retailer (www.mailasail.com), Nippy + Networks (Ed Wildgoose) made a donation for hardware (2011/3). +Max Lekomcev (DOM-TV project) made a donation (2011/7, 12, 2012/3, 6 and +11). +Sam Liddicott made a donation (2011/9). +Era Scarecrow made a donation (2013/4). +Bor Ratajc made a donation (2013/4). +Alessandro Gorreta made a donation (2013/4). +POIRETTE Marc made a donation (2013/4). +Alessandro Gorreta made a donation (2013/4). +lauri kasvandik made a donation (2013/5). +"pemasu from Finland" made a donation (2013/7). +The Parted Magic Project made a donation (2013/9 and 11). +Pavel Barta made a donation (2013/10). +Nikolay Pertsev made a donation (2014/5). +James B made a donation (2014/7). +Stefano Di Biase made a donation (2014/8). + +Thank you very much. +Donations are always, including future donations, very important and +helpful for me to keep on developing aufs. + + +7. +---------------------------------------- +If you are an experienced user, no explanation is needed. Aufs is +just a linux filesystem. + + +Enjoy! + +# Local variables: ; +# mode: text; +# End: ; diff --git a/Documentation/filesystems/aufs/design/01intro.txt b/Documentation/filesystems/aufs/design/01intro.txt new file mode 100644 index 00000000000000..88aec2d2271b44 --- /dev/null +++ b/Documentation/filesystems/aufs/design/01intro.txt @@ -0,0 +1,161 @@ + +# Copyright (C) 2005-2014 Junjiro R. Okajima +# +# 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, see . + +Introduction +---------------------------------------- + +aufs [ei ju: ef es] | [a u f s] +1. abbrev. for "advanced multi-layered unification filesystem". +2. abbrev. for "another unionfs". +3. abbrev. for "auf das" in German which means "on the" in English. + Ex. "Butter aufs Brot"(G) means "butter onto bread"(E). + But "Filesystem aufs Filesystem" is hard to understand. + +AUFS is a filesystem with features: +- multi layered stackable unification filesystem, the member directory + is called as a branch. +- branch permission and attribute, 'readonly', 'real-readonly', + 'readwrite', 'whiteout-able', 'link-able whiteout' and their + combination. +- internal "file copy-on-write". +- logical deletion, whiteout. +- dynamic branch manipulation, adding, deleting and changing permission. +- allow bypassing aufs, user's direct branch access. +- external inode number translation table and bitmap which maintains the + persistent aufs inode number. +- seekable directory, including NFS readdir. +- file mapping, mmap and sharing pages. +- pseudo-link, hardlink over branches. +- loopback mounted filesystem as a branch. +- several policies to select one among multiple writable branches. +- revert a single systemcall when an error occurs in aufs. +- and more... + + +Multi Layered Stackable Unification Filesystem +---------------------------------------------------------------------- +Most people already knows what it is. +It is a filesystem which unifies several directories and provides a +merged single directory. When users access a file, the access will be +passed/re-directed/converted (sorry, I am not sure which English word is +correct) to the real file on the member filesystem. The member +filesystem is called 'lower filesystem' or 'branch' and has a mode +'readonly' and 'readwrite.' And the deletion for a file on the lower +readonly branch is handled by creating 'whiteout' on the upper writable +branch. + +On LKML, there have been discussions about UnionMount (Jan Blunck, +Bharata B Rao and Valerie Aurora) and Unionfs (Erez Zadok). They took +different approaches to implement the merged-view. +The former tries putting it into VFS, and the latter implements as a +separate filesystem. +(If I misunderstand about these implementations, please let me know and +I shall correct it. Because it is a long time ago when I read their +source files last time). + +UnionMount's approach will be able to small, but may be hard to share +branches between several UnionMount since the whiteout in it is +implemented in the inode on branch filesystem and always +shared. According to Bharata's post, readdir does not seems to be +finished yet. +There are several missing features known in this implementations such as +- for users, the inode number may change silently. eg. copy-up. +- link(2) may break by copy-up. +- read(2) may get an obsoleted filedata (fstat(2) too). +- fcntl(F_SETLK) may be broken by copy-up. +- unnecessary copy-up may happen, for example mmap(MAP_PRIVATE) after + open(O_RDWR). + +Unionfs has a longer history. When I started implementing a stacking filesystem +(Aug 2005), it already existed. It has virtual super_block, inode, +dentry and file objects and they have an array pointing lower same kind +objects. After contributing many patches for Unionfs, I re-started my +project AUFS (Jun 2006). + +In AUFS, the structure of filesystem resembles to Unionfs, but I +implemented my own ideas, approaches and enhancements and it became +totally different one. + +Comparing DM snapshot and fs based implementation +- the number of bytes to be copied between devices is much smaller. +- the type of filesystem must be one and only. +- the fs must be writable, no readonly fs, even for the lower original + device. so the compression fs will not be usable. but if we use + loopback mount, we may address this issue. + for instance, + mount /cdrom/squashfs.img /sq + losetup /sq/ext2.img + losetup /somewhere/cow + dmsetup "snapshot /dev/loop0 /dev/loop1 ..." +- it will be difficult (or needs more operations) to extract the + difference between the original device and COW. +- DM snapshot-merge may help a lot when users try merging. in the + fs-layer union, users will use rsync(1). + + +Several characters/aspects of aufs +---------------------------------------------------------------------- + +Aufs has several characters or aspects. +1. a filesystem, callee of VFS helper +2. sub-VFS, caller of VFS helper for branches +3. a virtual filesystem which maintains persistent inode number +4. reader/writer of files on branches such like an application + +1. Callee of VFS Helper +As an ordinary linux filesystem, aufs is a callee of VFS. For instance, +unlink(2) from an application reaches sys_unlink() kernel function and +then vfs_unlink() is called. vfs_unlink() is one of VFS helper and it +calls filesystem specific unlink operation. Actually aufs implements the +unlink operation but it behaves like a redirector. + +2. Caller of VFS Helper for Branches +aufs_unlink() passes the unlink request to the branch filesystem as if +it were called from VFS. So the called unlink operation of the branch +filesystem acts as usual. As a caller of VFS helper, aufs should handle +every necessary pre/post operation for the branch filesystem. +- acquire the lock for the parent dir on a branch +- lookup in a branch +- revalidate dentry on a branch +- mnt_want_write() for a branch +- vfs_unlink() for a branch +- mnt_drop_write() for a branch +- release the lock on a branch + +3. Persistent Inode Number +One of the most important issue for a filesystem is to maintain inode +numbers. This is particularly important to support exporting a +filesystem via NFS. Aufs is a virtual filesystem which doesn't have a +backend block device for its own. But some storage is necessary to +maintain inode number. It may be a large space and may not suit to keep +in memory. Aufs rents some space from its first writable branch +filesystem (by default) and creates file(s) on it. These files are +created by aufs internally and removed soon (currently) keeping opened. +Note: Because these files are removed, they are totally gone after + unmounting aufs. It means the inode numbers are not persistent + across unmount or reboot. I have a plan to make them really + persistent which will be important for aufs on NFS server. + +4. Read/Write Files Internally (copy-on-write) +Because a branch can be readonly, when you write a file on it, aufs will +"copy-up" it to the upper writable branch internally. And then write the +originally requested thing to the file. Generally kernel doesn't +open/read/write file actively. In aufs, even a single write may cause a +internal "file copy". This behaviour is very similar to cp(1) command. + +Some people may think it is better to pass such work to user space +helper, instead of doing in kernel space. Actually I am still thinking +about it. But currently I have implemented it in kernel space. diff --git a/Documentation/filesystems/aufs/design/02struct.txt b/Documentation/filesystems/aufs/design/02struct.txt new file mode 100644 index 00000000000000..46b6fca69dbb55 --- /dev/null +++ b/Documentation/filesystems/aufs/design/02struct.txt @@ -0,0 +1,251 @@ + +# Copyright (C) 2005-2014 Junjiro R. Okajima +# +# 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, see . + +Basic Aufs Internal Structure + +Superblock/Inode/Dentry/File Objects +---------------------------------------------------------------------- +As like an ordinary filesystem, aufs has its own +superblock/inode/dentry/file objects. All these objects have a +dynamically allocated array and store the same kind of pointers to the +lower filesystem, branch. +For example, when you build a union with one readwrite branch and one +readonly, mounted /au, /rw and /ro respectively. +- /au = /rw + /ro +- /ro/fileA exists but /rw/fileA + +Aufs lookup operation finds /ro/fileA and gets dentry for that. These +pointers are stored in a aufs dentry. The array in aufs dentry will be, +- [0] = NULL +- [1] = /ro/fileA + +This style of an array is essentially same to the aufs +superblock/inode/dentry/file objects. + +Because aufs supports manipulating branches, ie. add/delete/change +dynamically, these objects has its own generation. When branches are +changed, the generation in aufs superblock is incremented. And a +generation in other object are compared when it is accessed. +When a generation in other objects are obsoleted, aufs refreshes the +internal array. + + +Superblock +---------------------------------------------------------------------- +Additionally aufs superblock has some data for policies to select one +among multiple writable branches, XIB files, pseudo-links and kobject. +See below in detail. +About the policies which supports copy-down a directory, see policy.txt +too. + + +Branch and XINO(External Inode Number Translation Table) +---------------------------------------------------------------------- +Every branch has its own xino (external inode number translation table) +file. The xino file is created and unlinked by aufs internally. When two +members of a union exist on the same filesystem, they share the single +xino file. +The struct of a xino file is simple, just a sequence of aufs inode +numbers which is indexed by the lower inode number. +In the above sample, assume the inode number of /ro/fileA is i111 and +aufs assigns the inode number i999 for fileA. Then aufs writes 999 as +4(8) bytes at 111 * 4(8) bytes offset in the xino file. + +When the inode numbers are not contiguous, the xino file will be sparse +which has a hole in it and doesn't consume as much disk space as it +might appear. If your branch filesystem consumes disk space for such +holes, then you should specify 'xino=' option at mounting aufs. + +Also a writable branch has three kinds of "whiteout bases". All these +are existed when the branch is joined to aufs and the names are +whiteout-ed doubly, so that users will never see their names in aufs +hierarchy. +1. a regular file which will be linked to all whiteouts. +2. a directory to store a pseudo-link. +3. a directory to store an "orphan-ed" file temporary. + +1. Whiteout Base + When you remove a file on a readonly branch, aufs handles it as a + logical deletion and creates a whiteout on the upper writable branch + as a hardlink of this file in order not to consume inode on the + writable branch. +2. Pseudo-link Dir + See below, Pseudo-link. +3. Step-Parent Dir + When "fileC" exists on the lower readonly branch only and it is + opened and removed with its parent dir, and then user writes + something into it, then aufs copies-up fileC to this + directory. Because there is no other dir to store fileC. After + creating a file under this dir, the file is unlinked. + +Because aufs supports manipulating branches, ie. add/delete/change +dynamically, a branch has its own id. When the branch order changes, aufs +finds the new index by searching the branch id. + + +Pseudo-link +---------------------------------------------------------------------- +Assume "fileA" exists on the lower readonly branch only and it is +hardlinked to "fileB" on the branch. When you write something to fileA, +aufs copies-up it to the upper writable branch. Additionally aufs +creates a hardlink under the Pseudo-link Directory of the writable +branch. The inode of a pseudo-link is kept in aufs super_block as a +simple list. If fileB is read after unlinking fileA, aufs returns +filedata from the pseudo-link instead of the lower readonly +branch. Because the pseudo-link is based upon the inode, to keep the +inode number by xino (see above) is important. + +All the hardlinks under the Pseudo-link Directory of the writable branch +should be restored in a proper location later. Aufs provides a utility +to do this. The userspace helpers executed at remounting and unmounting +aufs by default. +During this utility is running, it puts aufs into the pseudo-link +maintenance mode. In this mode, only the process which began the +maintenance mode (and its child processes) is allowed to operate in +aufs. Some other processes which are not related to the pseudo-link will +be allowed to run too, but the rest have to return an error or wait +until the maintenance mode ends. If a process already acquires an inode +mutex (in VFS), it has to return an error. + + +XIB(external inode number bitmap) +---------------------------------------------------------------------- +Addition to the xino file per a branch, aufs has an external inode number +bitmap in a superblock object. It is also a file such like a xino file. +It is a simple bitmap to mark whether the aufs inode number is in-use or +not. +To reduce the file I/O, aufs prepares a single memory page to cache xib. + +Aufs implements a feature to truncate/refresh both of xino and xib to +reduce the number of consumed disk blocks for these files. + + +Virtual or Vertical Dir, and Readdir in Userspace +---------------------------------------------------------------------- +In order to support multiple layers (branches), aufs readdir operation +constructs a virtual dir block on memory. For readdir, aufs calls +vfs_readdir() internally for each dir on branches, merges their entries +with eliminating the whiteout-ed ones, and sets it to file (dir) +object. So the file object has its entry list until it is closed. The +entry list will be updated when the file position is zero and becomes +old. This decision is made in aufs automatically. + +The dynamically allocated memory block for the name of entries has a +unit of 512 bytes (by default) and stores the names contiguously (no +padding). Another block for each entry is handled by kmem_cache too. +During building dir blocks, aufs creates hash list and judging whether +the entry is whiteouted by its upper branch or already listed. +The merged result is cached in the corresponding inode object and +maintained by a customizable life-time option. + +Some people may call it can be a security hole or invite DoS attack +since the opened and once readdir-ed dir (file object) holds its entry +list and becomes a pressure for system memory. But I'd say it is similar +to files under /proc or /sys. The virtual files in them also holds a +memory page (generally) while they are opened. When an idea to reduce +memory for them is introduced, it will be applied to aufs too. +For those who really hate this situation, I've developed readdir(3) +library which operates this merging in userspace. You just need to set +LD_PRELOAD environment variable, and aufs will not consume no memory in +kernel space for readdir(3). + + +Workqueue +---------------------------------------------------------------------- +Aufs sometimes requires privilege access to a branch. For instance, +in copy-up/down operation. When a user process is going to make changes +to a file which exists in the lower readonly branch only, and the mode +of one of ancestor directories may not be writable by a user +process. Here aufs copy-up the file with its ancestors and they may +require privilege to set its owner/group/mode/etc. +This is a typical case of a application character of aufs (see +Introduction). + +Aufs uses workqueue synchronously for this case. It creates its own +workqueue. The workqueue is a kernel thread and has privilege. Aufs +passes the request to call mkdir or write (for example), and wait for +its completion. This approach solves a problem of a signal handler +simply. +If aufs didn't adopt the workqueue and changed the privilege of the +process, and if the mkdir/write call arises SIGXFSZ or other signal, +then the user process might gain a privilege or the generated core file +was owned by a superuser. + +Also aufs uses the system global workqueue ("events" kernel thread) too +for asynchronous tasks, such like handling inotify/fsnotify, re-creating a +whiteout base and etc. This is unrelated to a privilege. +Most of aufs operation tries acquiring a rw_semaphore for aufs +superblock at the beginning, at the same time waits for the completion +of all queued asynchronous tasks. + + +Whiteout +---------------------------------------------------------------------- +The whiteout in aufs is very similar to Unionfs's. That is represented +by its filename. UnionMount takes an approach of a file mode, but I am +afraid several utilities (find(1) or something) will have to support it. + +Basically the whiteout represents "logical deletion" which stops aufs to +lookup further, but also it represents "dir is opaque" which also stop +lookup. + +In aufs, rmdir(2) and rename(2) for dir uses whiteout alternatively. +In order to make several functions in a single systemcall to be +revertible, aufs adopts an approach to rename a directory to a temporary +unique whiteouted name. +For example, in rename(2) dir where the target dir already existed, aufs +renames the target dir to a temporary unique whiteouted name before the +actual rename on a branch and then handles other actions (make it opaque, +update the attributes, etc). If an error happens in these actions, aufs +simply renames the whiteouted name back and returns an error. If all are +succeeded, aufs registers a function to remove the whiteouted unique +temporary name completely and asynchronously to the system global +workqueue. + + +Copy-up +---------------------------------------------------------------------- +It is a well-known feature or concept. +When user modifies a file on a readonly branch, aufs operate "copy-up" +internally and makes change to the new file on the upper writable branch. +When the trigger systemcall does not update the timestamps of the parent +dir, aufs reverts it after copy-up. + + +Move-down (aufs3.9 and later) +---------------------------------------------------------------------- +"Copy-up" is one of the essential feature in aufs. It copies a file from +the lower readonly branch to the upper writable branch when a user +changes something about the file. +"Move-down" is an opposite action of copy-up. Basically this action is +ran manually instead of automatically and internally. +For desgin and implementation, aufs has to consider these issues. +- whiteout for the file may exist on the lower branch. +- ancestor directories may not exist on the lower branch. +- diropq for the ancestor directories may exist on the upper branch. +- free space on the lower branch will reduce. +- another access to the file may happen during moving-down, including + UDBA. +- the file should not be hard-linked nor pseudo-linked. they should be + handled by auplink utility later. + +Sometimes users want to move-down a file from the upper writable branch +to the lower readonly or writable branch. For instance, +- the free space of the upper writable branch is going to run out. +- create a new intermediate branch between the upper and lower branch. +- etc. + +For this purpose, use "aumvdown" command in aufs-util.git. diff --git a/Documentation/filesystems/aufs/design/03lookup.txt b/Documentation/filesystems/aufs/design/03lookup.txt new file mode 100644 index 00000000000000..b35365efb179a0 --- /dev/null +++ b/Documentation/filesystems/aufs/design/03lookup.txt @@ -0,0 +1,133 @@ + +# Copyright (C) 2005-2014 Junjiro R. Okajima +# +# 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, see . + +Lookup in a Branch +---------------------------------------------------------------------- +Since aufs has a character of sub-VFS (see Introduction), it operates +lookup for branches as VFS does. It may be a heavy work. Generally +speaking struct nameidata is a bigger structure and includes many +information. But almost all lookup operation in aufs is the simplest +case, ie. lookup only an entry directly connected to its parent. Digging +down the directory hierarchy is unnecessary. + +VFS has a function lookup_one_len() for that use, but it is not usable +for a branch filesystem which requires struct nameidata. So aufs +implements a simple lookup wrapper function. When a branch filesystem +allows NULL as nameidata, it calls lookup_one_len(). Otherwise it builds +a simplest nameidata and calls lookup_hash(). +Here aufs applies "a principle in NFSD", ie. if the filesystem supports +NFS-export, then it has to support NULL as a nameidata parameter for +->create(), ->lookup() and ->d_revalidate(). So the lookup wrapper in +aufs tests if ->s_export_op in the branch is NULL or not. + +When a branch is a remote filesystem, aufs basically trusts its +->d_revalidate(), also aufs forces the hardest revalidate tests for +them. +For d_revalidate, aufs implements three levels of revalidate tests. See +"Revalidate Dentry and UDBA" in detail. + + +Test Only the Highest One for the Directory Permission (dirperm1 option) +---------------------------------------------------------------------- +Let's try case study. +- aufs has two branches, upper readwrite and lower readonly. + /au = /rw + /ro +- "dirA" exists under /ro, but /rw. and its mode is 0700. +- user invoked "chmod a+rx /au/dirA" +- the internal copy-up is activated and "/rw/dirA" is created and its + permission bits are set to world readble. +- then "/au/dirA" becomes world readable? + +In this case, /ro/dirA is still 0700 since it exists in readonly branch, +or it may be a natively readonly filesystem. If aufs respects the lower +branch, it should not respond readdir request from other users. But user +allowed it by chmod. Should really aufs rejects showing the entries +under /ro/dirA? + +To be honest, I don't have a best solution for this case. So aufs +implements 'dirperm1' and 'nodirperm1' and leave it to users. +When dirperm1 is specified, aufs checks only the highest one for the +directory permission, and shows the entries. Otherwise, as usual, checks +every dir existing on all branches and rejects the request. + +As a side effect, dirperm1 option improves the performance of aufs +because the number of permission check is reduced when the number of +branch is many. + + +Loopback Mount +---------------------------------------------------------------------- +Basically aufs supports any type of filesystem and block device for a +branch (actually there are some exceptions). But it is prohibited to add +a loopback mounted one whose backend file exists in a filesystem which is +already added to aufs. The reason is to protect aufs from a recursive +lookup. If it was allowed, the aufs lookup operation might re-enter a +lookup for the loopback mounted branch in the same context, and will +cause a deadlock. + + +Revalidate Dentry and UDBA (User's Direct Branch Access) +---------------------------------------------------------------------- +Generally VFS helpers re-validate a dentry as a part of lookup. +0. digging down the directory hierarchy. +1. lock the parent dir by its i_mutex. +2. lookup the final (child) entry. +3. revalidate it. +4. call the actual operation (create, unlink, etc.) +5. unlock the parent dir + +If the filesystem implements its ->d_revalidate() (step 3), then it is +called. Actually aufs implements it and checks the dentry on a branch is +still valid. +But it is not enough. Because aufs has to release the lock for the +parent dir on a branch at the end of ->lookup() (step 2) and +->d_revalidate() (step 3) while the i_mutex of the aufs dir is still +held by VFS. +If the file on a branch is changed directly, eg. bypassing aufs, after +aufs released the lock, then the subsequent operation may cause +something unpleasant result. + +This situation is a result of VFS architecture, ->lookup() and +->d_revalidate() is separated. But I never say it is wrong. It is a good +design from VFS's point of view. It is just not suitable for sub-VFS +character in aufs. + +Aufs supports such case by three level of revalidation which is +selectable by user. +1. Simple Revalidate + Addition to the native flow in VFS's, confirm the child-parent + relationship on the branch just after locking the parent dir on the + branch in the "actual operation" (step 4). When this validation + fails, aufs returns EBUSY. ->d_revalidate() (step 3) in aufs still + checks the validation of the dentry on branches. +2. Monitor Changes Internally by Inotify/Fsnotify + Addition to above, in the "actual operation" (step 4) aufs re-lookup + the dentry on the branch, and returns EBUSY if it finds different + dentry. + Additionally, aufs sets the inotify/fsnotify watch for every dir on branches + during it is in cache. When the event is notified, aufs registers a + function to kernel 'events' thread by schedule_work(). And the + function sets some special status to the cached aufs dentry and inode + private data. If they are not cached, then aufs has nothing to + do. When the same file is accessed through aufs (step 0-3) later, + aufs will detect the status and refresh all necessary data. + In this mode, aufs has to ignore the event which is fired by aufs + itself. +3. No Extra Validation + This is the simplest test and doesn't add any additional revalidation + test, and skip therevalidatin in step 4. It is useful and improves + aufs performance when system surely hide the aufs branches from user, + by over-mounting something (or another method). diff --git a/Documentation/filesystems/aufs/design/04branch.txt b/Documentation/filesystems/aufs/design/04branch.txt new file mode 100644 index 00000000000000..8033d0ee8006b4 --- /dev/null +++ b/Documentation/filesystems/aufs/design/04branch.txt @@ -0,0 +1,75 @@ + +# Copyright (C) 2005-2014 Junjiro R. Okajima +# +# 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, see . + +Branch Manipulation + +Since aufs supports dynamic branch manipulation, ie. add/remove a branch +and changing its permission/attribute, there are a lot of works to do. + + +Add a Branch +---------------------------------------------------------------------- +o Confirm the adding dir exists outside of aufs, including loopback + mount. +- and other various attributes... +o Initialize the xino file and whiteout bases if necessary. + See struct.txt. + +o Check the owner/group/mode of the directory + When the owner/group/mode of the adding directory differs from the + existing branch, aufs issues a warning because it may impose a + security risk. + For example, when a upper writable branch has a world writable empty + top directory, a malicious user can create any files on the writable + branch directly, like copy-up and modify manually. If something like + /etc/{passwd,shadow} exists on the lower readonly branch but the upper + writable branch, and the writable branch is world-writable, then a + malicious guy may create /etc/passwd on the writable branch directly + and the infected file will be valid in aufs. + I am afraid it can be a security issue, but nothing to do except + producing a warning. + + +Delete a Branch +---------------------------------------------------------------------- +o Confirm the deleting branch is not busy + To be general, there is one merit to adopt "remount" interface to + manipulate branches. It is to discard caches. At deleting a branch, + aufs checks the still cached (and connected) dentries and inodes. If + there are any, then they are all in-use. An inode without its + corresponding dentry can be alive alone (for example, inotify/fsnotify case). + + For the cached one, aufs checks whether the same named entry exists on + other branches. + If the cached one is a directory, because aufs provides a merged view + to users, as long as one dir is left on any branch aufs can show the + dir to users. In this case, the branch can be removed from aufs. + Otherwise aufs rejects deleting the branch. + + If any file on the deleting branch is opened by aufs, then aufs + rejects deleting. + + +Modify the Permission of a Branch +---------------------------------------------------------------------- +o Re-initialize or remove the xino file and whiteout bases if necessary. + See struct.txt. + +o rw --> ro: Confirm the modifying branch is not busy + Aufs rejects the request if any of these conditions are true. + - a file on the branch is mmap-ed. + - a regular file on the branch is opened for write and there is no + same named entry on the upper branch. diff --git a/Documentation/filesystems/aufs/design/05wbr_policy.txt b/Documentation/filesystems/aufs/design/05wbr_policy.txt new file mode 100644 index 00000000000000..9f135a017b38c3 --- /dev/null +++ b/Documentation/filesystems/aufs/design/05wbr_policy.txt @@ -0,0 +1,64 @@ + +# Copyright (C) 2005-2014 Junjiro R. Okajima +# +# 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, see . + +Policies to Select One among Multiple Writable Branches +---------------------------------------------------------------------- +When the number of writable branch is more than one, aufs has to decide +the target branch for file creation or copy-up. By default, the highest +writable branch which has the parent (or ancestor) dir of the target +file is chosen (top-down-parent policy). +By user's request, aufs implements some other policies to select the +writable branch, for file creation two policies, round-robin and +most-free-space policies. For copy-up three policies, top-down-parent, +bottom-up-parent and bottom-up policies. + +As expected, the round-robin policy selects the branch in circular. When +you have two writable branches and creates 10 new files, 5 files will be +created for each branch. mkdir(2) systemcall is an exception. When you +create 10 new directories, all will be created on the same branch. +And the most-free-space policy selects the one which has most free +space among the writable branches. The amount of free space will be +checked by aufs internally, and users can specify its time interval. + +The policies for copy-up is more simple, +top-down-parent is equivalent to the same named on in create policy, +bottom-up-parent selects the writable branch where the parent dir +exists and the nearest upper one from the copyup-source, +bottom-up selects the nearest upper writable branch from the +copyup-source, regardless the existence of the parent dir. + +There are some rules or exceptions to apply these policies. +- If there is a readonly branch above the policy-selected branch and + the parent dir is marked as opaque (a variation of whiteout), or the + target (creating) file is whiteout-ed on the upper readonly branch, + then the result of the policy is ignored and the target file will be + created on the nearest upper writable branch than the readonly branch. +- If there is a writable branch above the policy-selected branch and + the parent dir is marked as opaque or the target file is whiteouted + on the branch, then the result of the policy is ignored and the target + file will be created on the highest one among the upper writable + branches who has diropq or whiteout. In case of whiteout, aufs removes + it as usual. +- link(2) and rename(2) systemcalls are exceptions in every policy. + They try selecting the branch where the source exists as possible + since copyup a large file will take long time. If it can't be, + ie. the branch where the source exists is readonly, then they will + follow the copyup policy. +- There is an exception for rename(2) when the target exists. + If the rename target exists, aufs compares the index of the branches + where the source and the target exists and selects the higher + one. If the selected branch is readonly, then aufs follows the + copyup policy. diff --git a/Documentation/filesystems/aufs/design/06fhsm.txt b/Documentation/filesystems/aufs/design/06fhsm.txt new file mode 100644 index 00000000000000..69cdf17487fbf7 --- /dev/null +++ b/Documentation/filesystems/aufs/design/06fhsm.txt @@ -0,0 +1,120 @@ + +# Copyright (C) 2011-2014 Junjiro R. Okajima +# +# 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 + + +File-based Hierarchical Storage Management (FHSM) +---------------------------------------------------------------------- +Hierarchical Storage Management (or HSM) is a well-known feature in the +storage world. Aufs provides this feature as file-based with multiple +writable branches, based upon the principle of "Colder-Lower". +Here the word "colder" means that the less used files, and "lower" means +that the position in the order of the stacked branches. +These multiple writable branches are prioritized, ie. the topmost one +should be the fastest drive and be used heavily. + +o Characters in aufs FHSM story +- aufs itself and a new branch attribute. +- a new ioctl interface to move-down and to establish a connection with + the daemon ("move-down" is a converse of "copy-up"). +- userspace tool and daemon. + +The userspace daemon establishes a connection with aufs and waits for +the notification. The notified information is very similar to struct +statfs containing the number of consumed blocks and inodes. +When the consumed blocks/inodes of a branch exceeds the user-specified +upper watermark, the daemon activates its move-down process until the +consumed blocks/inodes reaches the user-specified lower watermark. + +The actual move-down is done by aufs based upon the request from +user-space since we need to maintain the inode number and the internal +pointer arrays in aufs. + +Currently aufs FHSM handles the regular files only. Additionally they +must not be hard-linked nor pseudo-linked. + + +o Cowork of aufs and the user-space daemon + During the userspace daemon established the connection, aufs sends a + small notification to it whenever aufs writes something into the + writable branch. But it may cost high since aufs issues statfs(2) + internally. So user can specify a new option to cache the + info. Actually the notification is controlled by these factors. + + the specified cache time. + + classified as "force" by aufs internally. + Until the specified time expires, aufs doesn't send the info + except the forced cases. When aufs decide forcing, the info is always + notified to userspace. + For example, the number of free inodes is generally large enough and + the shortage of it happens rarely. So aufs doesn't force the + notification when creating a new file, directory and others. This is + the typical case which aufs doesn't force. + When aufs writes the actual filedata and the files consumes any of new + blocks, the aufs forces notifying. + + +o Interfaces in aufs +- New branch attribute. + + fhsm + Specifies that the branch is managed by FHSM feature. In other word, + participant in the FHSM. + When nofhsm is set to the branch, it will not be the source/target + branch of the move-down operation. This attribute is set + independently from coo and moo attributes, and if you want full + FHSM, you should specify them as well. +- New mount option. + + fhsm_sec + Specifies a second to suppress many less important info to be + notified. +- New ioctl. + + AUFS_CTL_FHSM_FD + create a new file descriptor which userspace can read the notification + (a subset of struct statfs) from aufs. +- Module parameter 'brs' + It has to be set to 1. Otherwise the new mount option 'fhsm' will not + be set. +- mount helpers /sbin/mount.aufs and /sbin/umount.aufs + When there are two or more branches with fhsm attributes, + /sbin/mount.aufs invokes the user-space daemon and /sbin/umount.aufs + terminates it. As a result of remounting and branch-manipulation, the + number of branches with fhsm attribute can be one. In this case, + /sbin/mount.aufs will terminate the user-space daemon. + + +Finally the operation is done as these steps in kernel-space. +- make sure that, + + no one else is using the file. + + the file is not hard-linked. + + the file is not pseudo-linked. + + the file is a regular file. + + the parent dir is not opaqued. +- find the target writable branch. +- make sure the file is not whiteout-ed by the upper (than the target) + branch. +- make the parent dir on the target branch. +- mutex lock the inode on the branch. +- unlink the whiteout on the target branch (if exists). +- lookup and create the whiteout-ed temporary name on the target branch. +- copy the file as the whiteout-ed temporary name on the target branch. +- rename the whiteout-ed temporary name to the original name. +- unlink the file on the source branch. +- maintain the internal pointer array and the external inode number + table (XINO). +- maintain the timestamps and other attributes of the parent dir and the + file. + +And of course, in every step, an error may happen. So the operation +should restore the original file state after an error happens. diff --git a/Documentation/filesystems/aufs/design/06mmap.txt b/Documentation/filesystems/aufs/design/06mmap.txt new file mode 100644 index 00000000000000..8346545246cc6a --- /dev/null +++ b/Documentation/filesystems/aufs/design/06mmap.txt @@ -0,0 +1,46 @@ + +# Copyright (C) 2005-2014 Junjiro R. Okajima +# +# 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, see . + +mmap(2) -- File Memory Mapping +---------------------------------------------------------------------- +In aufs, the file-mapped pages are handled by a branch fs directly, no +interaction with aufs. It means aufs_mmap() calls the branch fs's +->mmap(). +This approach is simple and good, but there is one problem. +Under /proc, several entries show the mmap-ped files by its path (with +device and inode number), and the printed path will be the path on the +branch fs's instead of virtual aufs's. +This is not a problem in most cases, but some utilities lsof(1) (and its +user) may expect the path on aufs. + +To address this issue, aufs adds a new member called vm_prfile in struct +vm_area_struct (and struct vm_region). The original vm_file points to +the file on the branch fs in order to handle everything correctly as +usual. The new vm_prfile points to a virtual file in aufs, and the +show-functions in procfs refers to vm_prfile if it is set. +Also we need to maintain several other places where touching vm_file +such like +- fork()/clone() copies vma and the reference count of vm_file is + incremented. +- merging vma maintains the ref count too. + +This is not a good approach. It just faking the printed path. But it +leaves all behaviour around f_mapping unchanged. This is surely an +advantage. +Actually aufs had adopted another complicated approach which calls +generic_file_mmap() and handles struct vm_operations_struct. In this +approach, aufs met a hard problem and I could not solve it without +switching the approach. diff --git a/Documentation/filesystems/aufs/design/06xattr.txt b/Documentation/filesystems/aufs/design/06xattr.txt new file mode 100644 index 00000000000000..1896cbaabf9ddd --- /dev/null +++ b/Documentation/filesystems/aufs/design/06xattr.txt @@ -0,0 +1,96 @@ + +# Copyright (C) 2014 Junjiro R. Okajima +# +# 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 + + +Listing XATTR/EA and getting the value +---------------------------------------------------------------------- +For the inode standard attributes (owner, group, timestamps, etc.), aufs +shows the values from the topmost existing file. This behaviour is good +for the non-dir entreis since the bahaviour exactly matches the shown +information. But for the directories, aufs considers all the same named +entries on the lower branches. Which means, if one of the lower entry +rejects readdir call, then aufs returns an error even if the topmost +entry allows it. This behaviour is necessary to respect the branch fs's +security, but can make users confused since the user-visible standard +attributes don't match the behaviour. +To address this issue, aufs has a mount option called dirperm1 which +checks the permission for the topmost entry only, and ignores the lower +entry's permission. + +A similar issue can happen around XATTR. +getxattr(2) and listxattr(2) families behave as if dirperm1 option is +always set. Otherwise these very unpleasant situation can happen. +- listxattr(2) may return the duplicated entires. +- users may not be able to remove or reset the XATTR forever, + + +XATTR/EA support in the internal (copy,move)-(up,down) +---------------------------------------------------------------------- +Generally the extended attributes of inode are categorazied as these. +- "security" for LSM and capability. +- "system" for posix ACL, 'acl' mount option is required for the branch + fs generally. +- "trusted" for userspace, CAP_SYS_ADMIN is required. +- "user" for userspace, 'user_xattr' mount option is required for the + branch fs generally. + +Moreover there are some other categories. Aufs handles these rather +unpopular categories as the ordinary ones, ie. there is no special +condition nor exception. + +In copy-up, the support for XATTR on the dst branch may differ from the +src branch. In this case, the copy-up operation will get an error and +the original user operation which triggered the copy-up fails. It can +happen that even all copy-up will fail. +When both of src and dst branches support XATTR and if an error occurs +during copying XATTR, then the copy-up should fail obviously. That is a +good reason and aufs should return an error to userspace. But when only +the src branch support XATTR, aufs should not return an error. +For example, the src branch supports ACL but the dst branch doesn't +because the dst branch may natively un-support it or temporary +un-support it due to "noacl" mount option. Of course, the dst branch fs +may NOT return an error even if the XATTR is not supported. It is +totally up to the branch fs. + +Anyway when the aufs internal copy-up gets an error from the dst branch +fs, then aufs tries removing the just copied entry and returns the error +to the userspace. The worst case of this situation will be all copy-up +will fail. + +For the copy-up operation, there two basic approaches. +- copy the specified XATTR only (by category above), and return the + error if it happens inconditionally. +- copy all XATTR, and ignore the error on the specified category only. + +In order to support XATTR and to implement the correct behaviour, aufs +chooses the latter approach and introduces some attributes for its +branch, "icexsec", "icexsys", "icextr", "icexusr", and "icexoth". +They correspond to the XATTR namespaces (see above). Additionally, to be +convenient, "icex" is also provided which means all "ix*" attributes are +set. + +The meaning of these attributes is to ignore the error from setting +XATTR on that branch. +Note that aufs tries copying all XATTR unconditionally, and ignores the +error from the dst branch according to the specified attributes. + +Some XATTR may have its default value. The default value may come from +the parent dir or the environment. If the default value is set at the +file creating-time, it will be overwritten by copy-up. +Some contradiction may happen I am afraid. +Do we need another attribute to stop copying XATTR? I am unsure. For +now, aufs implements the branch attributes to ignore the error. diff --git a/Documentation/filesystems/aufs/design/07export.txt b/Documentation/filesystems/aufs/design/07export.txt new file mode 100644 index 00000000000000..8144383d5f5b71 --- /dev/null +++ b/Documentation/filesystems/aufs/design/07export.txt @@ -0,0 +1,58 @@ + +# Copyright (C) 2005-2014 Junjiro R. Okajima +# +# 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, see . + +Export Aufs via NFS +---------------------------------------------------------------------- +Here is an approach. +- like xino/xib, add a new file 'xigen' which stores aufs inode + generation. +- iget_locked(): initialize aufs inode generation for a new inode, and + store it in xigen file. +- destroy_inode(): increment aufs inode generation and store it in xigen + file. it is necessary even if it is not unlinked, because any data of + inode may be changed by UDBA. +- encode_fh(): for a root dir, simply return FILEID_ROOT. otherwise + build file handle by + + branch id (4 bytes) + + superblock generation (4 bytes) + + inode number (4 or 8 bytes) + + parent dir inode number (4 or 8 bytes) + + inode generation (4 bytes)) + + return value of exportfs_encode_fh() for the parent on a branch (4 + bytes) + + file handle for a branch (by exportfs_encode_fh()) +- fh_to_dentry(): + + find the index of a branch from its id in handle, and check it is + still exist in aufs. + + 1st level: get the inode number from handle and search it in cache. + + 2nd level: if not found, get the parent inode number from handle and + search it in cache. and then open the parent dir, find the matching + inode number by vfs_readdir() and get its name, and call + lookup_one_len() for the target dentry. + + 3rd level: if the parent dir is not cached, call + exportfs_decode_fh() for a branch and get the parent on a branch, + build a pathname of it, convert it a pathname in aufs, call + path_lookup(). now aufs gets a parent dir dentry, then handle it as + the 2nd level. + + to open the dir, aufs needs struct vfsmount. aufs keeps vfsmount + for every branch, but not itself. to get this, (currently) aufs + searches in current->nsproxy->mnt_ns list. it may not be a good + idea, but I didn't get other approach. + + test the generation of the gotten inode. +- every inode operation: they may get EBUSY due to UDBA. in this case, + convert it into ESTALE for NFSD. +- readdir(): call lockdep_on/off() because filldir in NFSD calls + lookup_one_len(), vfs_getattr(), encode_fh() and others. diff --git a/Documentation/filesystems/aufs/design/08shwh.txt b/Documentation/filesystems/aufs/design/08shwh.txt new file mode 100644 index 00000000000000..aeca324eb4b1fb --- /dev/null +++ b/Documentation/filesystems/aufs/design/08shwh.txt @@ -0,0 +1,52 @@ + +# Copyright (C) 2005-2014 Junjiro R. Okajima +# +# 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, see . + +Show Whiteout Mode (shwh) +---------------------------------------------------------------------- +Generally aufs hides the name of whiteouts. But in some cases, to show +them is very useful for users. For instance, creating a new middle layer +(branch) by merging existing layers. + +(borrowing aufs1 HOW-TO from a user, Michael Towers) +When you have three branches, +- Bottom: 'system', squashfs (underlying base system), read-only +- Middle: 'mods', squashfs, read-only +- Top: 'overlay', ram (tmpfs), read-write + +The top layer is loaded at boot time and saved at shutdown, to preserve +the changes made to the system during the session. +When larger changes have been made, or smaller changes have accumulated, +the size of the saved top layer data grows. At this point, it would be +nice to be able to merge the two overlay branches ('mods' and 'overlay') +and rewrite the 'mods' squashfs, clearing the top layer and thus +restoring save and load speed. + +This merging is simplified by the use of another aufs mount, of just the +two overlay branches using the 'shwh' option. +# mount -t aufs -o ro,shwh,br:/livesys/overlay=ro+wh:/livesys/mods=rr+wh \ + aufs /livesys/merge_union + +A merged view of these two branches is then available at +/livesys/merge_union, and the new feature is that the whiteouts are +visible! +Note that in 'shwh' mode the aufs mount must be 'ro', which will disable +writing to all branches. Also the default mode for all branches is 'ro'. +It is now possible to save the combined contents of the two overlay +branches to a new squashfs, e.g.: +# mksquashfs /livesys/merge_union /path/to/newmods.squash + +This new squashfs archive can be stored on the boot device and the +initramfs will use it to replace the old one at the next boot. diff --git a/Documentation/filesystems/aufs/design/10dynop.txt b/Documentation/filesystems/aufs/design/10dynop.txt new file mode 100644 index 00000000000000..9091384b08e0d9 --- /dev/null +++ b/Documentation/filesystems/aufs/design/10dynop.txt @@ -0,0 +1,46 @@ + +# Copyright (C) 2010-2014 Junjiro R. Okajima +# +# 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, see . + +Dynamically customizable FS operations +---------------------------------------------------------------------- +Generally FS operations (struct inode_operations, struct +address_space_operations, struct file_operations, etc.) are defined as +"static const", but it never means that FS have only one set of +operation. Some FS have multiple sets of them. For instance, ext2 has +three sets, one for XIP, for NOBH, and for normal. +Since aufs overrides and redirects these operations, sometimes aufs has +to change its behaviour according to the branch FS type. More imporantly +VFS acts differently if a function (member in the struct) is set or +not. It means aufs should have several sets of operations and select one +among them according to the branch FS definition. + +In order to solve this problem and not to affect the behavour of VFS, +aufs defines these operations dynamically. For instance, aufs defines +aio_read function for struct file_operations, but it may not be set to +the file_operations. When the branch FS doesn't have it, aufs doesn't +set it to its file_operations while the function definition itself is +still alive. So the behaviour of io_submit(2) will not change, and it +will return an error when aio_read is not defined. + +The lifetime of these dynamically generated operation object is +maintained by aufs branch object. When the branch is removed from aufs, +the reference counter of the object is decremented. When it reaches +zero, the dynamically generated operation object will be freed. + +This approach is designed to support AIO (io_submit), Direcit I/O and +XIP mainly. +Currently this approach is applied to file_operations and +vm_operations_struct for regular files only. diff --git a/Documentation/filesystems/aufs/design/99plan.txt b/Documentation/filesystems/aufs/design/99plan.txt new file mode 100644 index 00000000000000..575096bf51f0ca --- /dev/null +++ b/Documentation/filesystems/aufs/design/99plan.txt @@ -0,0 +1,58 @@ + +# Copyright (C) 2005-2014 Junjiro R. Okajima +# +# 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, see . + +Plan + +Restoring some features which was implemented in aufs1. +They were dropped in aufs2 in order to make source files simpler and +easier to be reviewed. + + +Being Another Aufs's Readonly Branch (robr) +---------------------------------------------------------------------- +Aufs1 allows aufs to be another aufs's readonly branch. +This feature was developed by a user's request. But it may not be used +currecnly. + + +Refresh the Opened File (refrof) +---------------------------------------------------------------------- +This option is implemented in aufs1 but incomplete. + +When user reads from a file, he expects to get its latest filedata +generally. If the file is removed and a new same named file is created, +the content he gets is unchanged, ie. the unlinked filedata. + +Let's try case study again. +- aufs has two branches. + /au = /rw + /ro +- "fileA" exists under /ro, but /rw. +- user opened "/au/fileA". +- he or someone else inserts a branch (/new) between /rw and /ro. + /au = /rw + /new + /ro +- the new branch has "fileA". +- user reads from the opened "fileA" +- which filedata should aufs return, from /ro or /new? + +Some people says it has to be "from /ro" and it is a semantics of Unix. +The others say it should be "from /new" because the file is not removed +and it is equivalent to the case of someone else modifies the file. + +Here again I don't have a best and final answer. I got an idea to +implement 'refrof' and 'norefrof' option. When 'refrof' (REFResh the +Opened File) is specified (by default), aufs returns the filedata from +/new. +Otherwise from /new. diff --git a/MAINTAINERS b/MAINTAINERS index 48c748080c96ee..75518fe9ddf96d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1533,6 +1533,20 @@ F: include/linux/audit.h F: include/uapi/linux/audit.h F: kernel/audit* +AUFS (advanced multi layered unification filesystem) FILESYSTEM +M: "J. R. Okajima" +L: linux-unionfs@vger.kernel.org +L: aufs-users@lists.sourceforge.net (members only) +W: http://aufs.sourceforge.net +T: git://git.code.sf.net/p/aufs/aufs3-linux +T: git://github.com/sfjro/aufs3-linux.git +S: Supported +F: Documentation/filesystems/aufs/ +F: Documentation/ABI/testing/debugfs-aufs +F: Documentation/ABI/testing/sysfs-aufs +F: fs/aufs/ +F: include/uapi/linux/aufs_type.h + AUXILIARY DISPLAY DRIVERS M: Miguel Ojeda Sandonis W: http://miguelojeda.es/auxdisplay.htm diff --git a/fs/Kconfig b/fs/Kconfig index c229f828eb012e..397b4736016892 100644 --- a/fs/Kconfig +++ b/fs/Kconfig @@ -212,6 +212,7 @@ source "fs/ufs/Kconfig" source "fs/exofs/Kconfig" source "fs/f2fs/Kconfig" source "fs/efivarfs/Kconfig" +source "fs/aufs/Kconfig" endif # MISC_FILESYSTEMS diff --git a/fs/Makefile b/fs/Makefile index 4fe6df3ec28fe5..4a57676050fc67 100644 --- a/fs/Makefile +++ b/fs/Makefile @@ -126,3 +126,4 @@ obj-y += exofs/ # Multiple modules obj-$(CONFIG_CEPH_FS) += ceph/ obj-$(CONFIG_PSTORE) += pstore/ obj-$(CONFIG_EFIVAR_FS) += efivarfs/ +obj-$(CONFIG_AUFS_FS) += aufs/ diff --git a/fs/aufs/Kconfig b/fs/aufs/Kconfig new file mode 100644 index 00000000000000..63560ceda3a4bb --- /dev/null +++ b/fs/aufs/Kconfig @@ -0,0 +1,185 @@ +config AUFS_FS + tristate "Aufs (Advanced multi layered unification filesystem) support" + help + Aufs is a stackable unification filesystem such as Unionfs, + which unifies several directories and provides a merged single + directory. + In the early days, aufs was entirely re-designed and + re-implemented Unionfs Version 1.x series. Introducing many + original ideas, approaches and improvements, it becomes totally + different from Unionfs while keeping the basic features. + +if AUFS_FS +choice + prompt "Maximum number of branches" + default AUFS_BRANCH_MAX_127 + help + Specifies the maximum number of branches (or member directories) + in a single aufs. The larger value consumes more system + resources and has a minor impact to performance. +config AUFS_BRANCH_MAX_127 + bool "127" + help + Specifies the maximum number of branches (or member directories) + in a single aufs. The larger value consumes more system + resources and has a minor impact to performance. +config AUFS_BRANCH_MAX_511 + bool "511" + help + Specifies the maximum number of branches (or member directories) + in a single aufs. The larger value consumes more system + resources and has a minor impact to performance. +config AUFS_BRANCH_MAX_1023 + bool "1023" + help + Specifies the maximum number of branches (or member directories) + in a single aufs. The larger value consumes more system + resources and has a minor impact to performance. +config AUFS_BRANCH_MAX_32767 + bool "32767" + help + Specifies the maximum number of branches (or member directories) + in a single aufs. The larger value consumes more system + resources and has a minor impact to performance. +endchoice + +config AUFS_SBILIST + bool + depends on AUFS_MAGIC_SYSRQ || PROC_FS + default y + help + Automatic configuration for internal use. + When aufs supports Magic SysRq or /proc, enabled automatically. + +config AUFS_HNOTIFY + bool "Detect direct branch access (bypassing aufs)" + help + If you want to modify files on branches directly, eg. bypassing aufs, + and want aufs to detect the changes of them fully, then enable this + option and use 'udba=notify' mount option. + Currently there is only one available configuration, "fsnotify". + It will have a negative impact to the performance. + See detail in aufs.5. + +choice + prompt "method" if AUFS_HNOTIFY + default AUFS_HFSNOTIFY +config AUFS_HFSNOTIFY + bool "fsnotify" + select FSNOTIFY +endchoice + +config AUFS_EXPORT + bool "NFS-exportable aufs" + depends on EXPORTFS + help + If you want to export your mounted aufs via NFS, then enable this + option. There are several requirements for this configuration. + See detail in aufs.5. + +config AUFS_INO_T_64 + bool + depends on AUFS_EXPORT + depends on 64BIT && !(ALPHA || S390) + default y + help + Automatic configuration for internal use. + /* typedef unsigned long/int __kernel_ino_t */ + /* alpha and s390x are int */ + +config AUFS_XATTR + bool "support for XATTR/EA (including Security Labels)" + help + If your branch fs supports XATTR/EA and you want to make them + available in aufs too, then enable this opsion and specify the + branch attributes for EA. + See detail in aufs.5. + +config AUFS_FHSM + bool "File-based Hierarchical Storage Management" + help + Hierarchical Storage Management (or HSM) is a well-known feature + in the storage world. Aufs provides this feature as file-based. + with multiple branches. + These multiple branches are prioritized, ie. the topmost one + should be the fastest drive and be used heavily. + +config AUFS_RDU + bool "Readdir in userspace" + help + Aufs has two methods to provide a merged view for a directory, + by a user-space library and by kernel-space natively. The latter + is always enabled but sometimes large and slow. + If you enable this option, install the library in aufs2-util + package, and set some environment variables for your readdir(3), + then the work will be handled in user-space which generally + shows better performance in most cases. + See detail in aufs.5. + +config AUFS_SHWH + bool "Show whiteouts" + help + If you want to make the whiteouts in aufs visible, then enable + this option and specify 'shwh' mount option. Although it may + sounds like philosophy or something, but in technically it + simply shows the name of whiteout with keeping its behaviour. + +config AUFS_BR_RAMFS + bool "Ramfs (initramfs/rootfs) as an aufs branch" + help + If you want to use ramfs as an aufs branch fs, then enable this + option. Generally tmpfs is recommended. + Aufs prohibited them to be a branch fs by default, because + initramfs becomes unusable after switch_root or something + generally. If you sets initramfs as an aufs branch and boot your + system by switch_root, you will meet a problem easily since the + files in initramfs may be inaccessible. + Unless you are going to use ramfs as an aufs branch fs without + switch_root or something, leave it N. + +config AUFS_BR_FUSE + bool "Fuse fs as an aufs branch" + depends on FUSE_FS + select AUFS_POLL + help + If you want to use fuse-based userspace filesystem as an aufs + branch fs, then enable this option. + It implements the internal poll(2) operation which is + implemented by fuse only (curretnly). + +config AUFS_POLL + bool + help + Automatic configuration for internal use. + +config AUFS_BR_HFSPLUS + bool "Hfsplus as an aufs branch" + depends on HFSPLUS_FS + default y + help + If you want to use hfsplus fs as an aufs branch fs, then enable + this option. This option introduces a small overhead at + copying-up a file on hfsplus. + +config AUFS_BDEV_LOOP + bool + depends on BLK_DEV_LOOP + default y + help + Automatic configuration for internal use. + Convert =[ym] into =y. + +config AUFS_DEBUG + bool "Debug aufs" + help + Enable this to compile aufs internal debug code. + It will have a negative impact to the performance. + +config AUFS_MAGIC_SYSRQ + bool + depends on AUFS_DEBUG && MAGIC_SYSRQ + default y + help + Automatic configuration for internal use. + When aufs supports Magic SysRq, enabled automatically. +endif diff --git a/fs/aufs/Makefile b/fs/aufs/Makefile new file mode 100644 index 00000000000000..22b56c0d2e3b56 --- /dev/null +++ b/fs/aufs/Makefile @@ -0,0 +1,43 @@ + +include ${src}/magic.mk +ifeq (${CONFIG_AUFS_FS},m) +include ${src}/conf.mk +endif +-include ${src}/priv_def.mk + +# cf. include/linux/kernel.h +# enable pr_debug +ccflags-y += -DDEBUG +# sparse requires the full pathname +ifdef M +ccflags-y += -include ${M}/../../include/uapi/linux/aufs_type.h +else +ccflags-y += -include ${srctree}/include/uapi/linux/aufs_type.h +endif + +obj-$(CONFIG_AUFS_FS) += aufs.o +aufs-y := module.o sbinfo.o super.o branch.o xino.o sysaufs.o opts.o \ + wkq.o vfsub.o dcsub.o \ + cpup.o whout.o wbr_policy.o \ + dinfo.o dentry.o \ + dynop.o \ + finfo.o file.o f_op.o \ + dir.o vdir.o \ + iinfo.o inode.o i_op.o i_op_add.o i_op_del.o i_op_ren.o \ + mvdown.o ioctl.o + +# all are boolean +aufs-$(CONFIG_PROC_FS) += procfs.o plink.o +aufs-$(CONFIG_SYSFS) += sysfs.o +aufs-$(CONFIG_DEBUG_FS) += dbgaufs.o +aufs-$(CONFIG_AUFS_BDEV_LOOP) += loop.o +aufs-$(CONFIG_AUFS_HNOTIFY) += hnotify.o +aufs-$(CONFIG_AUFS_HFSNOTIFY) += hfsnotify.o +aufs-$(CONFIG_AUFS_EXPORT) += export.o +aufs-$(CONFIG_AUFS_XATTR) += xattr.o +aufs-$(CONFIG_AUFS_FHSM) += fhsm.o +aufs-$(CONFIG_AUFS_POLL) += poll.o +aufs-$(CONFIG_AUFS_RDU) += rdu.o +aufs-$(CONFIG_AUFS_BR_HFSPLUS) += hfsplus.o +aufs-$(CONFIG_AUFS_DEBUG) += debug.o +aufs-$(CONFIG_AUFS_MAGIC_SYSRQ) += sysrq.o diff --git a/fs/aufs/aufs.h b/fs/aufs/aufs.h new file mode 100644 index 00000000000000..bba08f867c0baa --- /dev/null +++ b/fs/aufs/aufs.h @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * all header files + */ + +#ifndef __AUFS_H__ +#define __AUFS_H__ + +#ifdef __KERNEL__ + +#define AuStub(type, name, body, ...) \ + static inline type name(__VA_ARGS__) { body; } + +#define AuStubVoid(name, ...) \ + AuStub(void, name, , __VA_ARGS__) +#define AuStubInt0(name, ...) \ + AuStub(int, name, return 0, __VA_ARGS__) + +#include "debug.h" + +#include "branch.h" +#include "cpup.h" +#include "dcsub.h" +#include "dbgaufs.h" +#include "dentry.h" +#include "dir.h" +#include "dynop.h" +#include "file.h" +#include "fstype.h" +#include "inode.h" +#include "loop.h" +#include "module.h" +#include "opts.h" +#include "rwsem.h" +#include "spl.h" +#include "super.h" +#include "sysaufs.h" +#include "vfsub.h" +#include "whout.h" +#include "wkq.h" + +#endif /* __KERNEL__ */ +#endif /* __AUFS_H__ */ diff --git a/fs/aufs/branch.c b/fs/aufs/branch.c new file mode 100644 index 00000000000000..3fe9d32017eba2 --- /dev/null +++ b/fs/aufs/branch.c @@ -0,0 +1,1445 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * branch management + */ + +#include +#include +#include "aufs.h" + +/* + * free a single branch + */ + +/* prohibit rmdir to the root of the branch */ +/* todo: another new flag? */ +static void au_br_dflags_force(struct au_branch *br) +{ + struct dentry *h_dentry; + + h_dentry = au_br_dentry(br); + spin_lock(&h_dentry->d_lock); + br->br_dflags = h_dentry->d_flags & DCACHE_MOUNTED; + h_dentry->d_flags |= DCACHE_MOUNTED; + spin_unlock(&h_dentry->d_lock); +} + +/* restore its d_flags */ +static void au_br_dflags_restore(struct au_branch *br) +{ + struct dentry *h_dentry; + + if (br->br_dflags) + return; + + h_dentry = au_br_dentry(br); + spin_lock(&h_dentry->d_lock); + h_dentry->d_flags &= ~DCACHE_MOUNTED; + spin_unlock(&h_dentry->d_lock); +} + +static void au_br_do_free(struct au_branch *br) +{ + int i; + struct au_wbr *wbr; + struct au_dykey **key; + + au_hnotify_fin_br(br); + + if (br->br_xino.xi_file) + fput(br->br_xino.xi_file); + mutex_destroy(&br->br_xino.xi_nondir_mtx); + + AuDebugOn(atomic_read(&br->br_count)); + + wbr = br->br_wbr; + if (wbr) { + for (i = 0; i < AuBrWh_Last; i++) + dput(wbr->wbr_wh[i]); + AuDebugOn(atomic_read(&wbr->wbr_wh_running)); + AuRwDestroy(&wbr->wbr_wh_rwsem); + } + + if (br->br_fhsm) { + au_br_fhsm_fin(br->br_fhsm); + kfree(br->br_fhsm); + } + + key = br->br_dykey; + for (i = 0; i < AuBrDynOp; i++, key++) + if (*key) + au_dy_put(*key); + else + break; + + au_br_dflags_restore(br); + + /* recursive lock, s_umount of branch's */ + lockdep_off(); + path_put(&br->br_path); + lockdep_on(); + kfree(wbr); + kfree(br); +} + +/* + * frees all branches + */ +void au_br_free(struct au_sbinfo *sbinfo) +{ + aufs_bindex_t bmax; + struct au_branch **br; + + AuRwMustWriteLock(&sbinfo->si_rwsem); + + bmax = sbinfo->si_bend + 1; + br = sbinfo->si_branch; + while (bmax--) + au_br_do_free(*br++); +} + +/* + * find the index of a branch which is specified by @br_id. + */ +int au_br_index(struct super_block *sb, aufs_bindex_t br_id) +{ + aufs_bindex_t bindex, bend; + + bend = au_sbend(sb); + for (bindex = 0; bindex <= bend; bindex++) + if (au_sbr_id(sb, bindex) == br_id) + return bindex; + return -1; +} + +/* ---------------------------------------------------------------------- */ + +/* + * add a branch + */ + +static int test_overlap(struct super_block *sb, struct dentry *h_adding, + struct dentry *h_root) +{ + if (unlikely(h_adding == h_root + || au_test_loopback_overlap(sb, h_adding))) + return 1; + if (h_adding->d_sb != h_root->d_sb) + return 0; + return au_test_subdir(h_adding, h_root) + || au_test_subdir(h_root, h_adding); +} + +/* + * returns a newly allocated branch. @new_nbranch is a number of branches + * after adding a branch. + */ +static struct au_branch *au_br_alloc(struct super_block *sb, int new_nbranch, + int perm) +{ + struct au_branch *add_branch; + struct dentry *root; + int err; + + err = -ENOMEM; + root = sb->s_root; + add_branch = kmalloc(sizeof(*add_branch), GFP_NOFS); + if (unlikely(!add_branch)) + goto out; + + err = au_hnotify_init_br(add_branch, perm); + if (unlikely(err)) + goto out_br; + + add_branch->br_wbr = NULL; + if (au_br_writable(perm)) { + /* may be freed separately at changing the branch permission */ + add_branch->br_wbr = kmalloc(sizeof(*add_branch->br_wbr), + GFP_NOFS); + if (unlikely(!add_branch->br_wbr)) + goto out_hnotify; + } + + add_branch->br_fhsm = NULL; + if (au_br_fhsm(perm)) { + err = au_fhsm_br_alloc(add_branch); + if (unlikely(err)) + goto out_wbr; + } + + err = au_sbr_realloc(au_sbi(sb), new_nbranch); + if (!err) + err = au_di_realloc(au_di(root), new_nbranch); + if (!err) + err = au_ii_realloc(au_ii(root->d_inode), new_nbranch); + if (!err) + return add_branch; /* success */ + +out_wbr: + kfree(add_branch->br_wbr); +out_hnotify: + au_hnotify_fin_br(add_branch); +out_br: + kfree(add_branch); +out: + return ERR_PTR(err); +} + +/* + * test if the branch permission is legal or not. + */ +static int test_br(struct inode *inode, int brperm, char *path) +{ + int err; + + err = (au_br_writable(brperm) && IS_RDONLY(inode)); + if (!err) + goto out; + + err = -EINVAL; + pr_err("write permission for readonly mount or inode, %s\n", path); + +out: + return err; +} + +/* + * returns: + * 0: success, the caller will add it + * plus: success, it is already unified, the caller should ignore it + * minus: error + */ +static int test_add(struct super_block *sb, struct au_opt_add *add, int remount) +{ + int err; + aufs_bindex_t bend, bindex; + struct dentry *root; + struct inode *inode, *h_inode; + + root = sb->s_root; + bend = au_sbend(sb); + if (unlikely(bend >= 0 + && au_find_dbindex(root, add->path.dentry) >= 0)) { + err = 1; + if (!remount) { + err = -EINVAL; + pr_err("%s duplicated\n", add->pathname); + } + goto out; + } + + err = -ENOSPC; /* -E2BIG; */ + if (unlikely(AUFS_BRANCH_MAX <= add->bindex + || AUFS_BRANCH_MAX - 1 <= bend)) { + pr_err("number of branches exceeded %s\n", add->pathname); + goto out; + } + + err = -EDOM; + if (unlikely(add->bindex < 0 || bend + 1 < add->bindex)) { + pr_err("bad index %d\n", add->bindex); + goto out; + } + + inode = add->path.dentry->d_inode; + err = -ENOENT; + if (unlikely(!inode->i_nlink)) { + pr_err("no existence %s\n", add->pathname); + goto out; + } + + err = -EINVAL; + if (unlikely(inode->i_sb == sb)) { + pr_err("%s must be outside\n", add->pathname); + goto out; + } + + if (unlikely(au_test_fs_unsuppoted(inode->i_sb))) { + pr_err("unsupported filesystem, %s (%s)\n", + add->pathname, au_sbtype(inode->i_sb)); + goto out; + } + + err = test_br(add->path.dentry->d_inode, add->perm, add->pathname); + if (unlikely(err)) + goto out; + + if (bend < 0) + return 0; /* success */ + + err = -EINVAL; + for (bindex = 0; bindex <= bend; bindex++) + if (unlikely(test_overlap(sb, add->path.dentry, + au_h_dptr(root, bindex)))) { + pr_err("%s is overlapped\n", add->pathname); + goto out; + } + + err = 0; + if (au_opt_test(au_mntflags(sb), WARN_PERM)) { + h_inode = au_h_dptr(root, 0)->d_inode; + if ((h_inode->i_mode & S_IALLUGO) != (inode->i_mode & S_IALLUGO) + || !uid_eq(h_inode->i_uid, inode->i_uid) + || !gid_eq(h_inode->i_gid, inode->i_gid)) + pr_warn("uid/gid/perm %s %u/%u/0%o, %u/%u/0%o\n", + add->pathname, + i_uid_read(inode), i_gid_read(inode), + (inode->i_mode & S_IALLUGO), + i_uid_read(h_inode), i_gid_read(h_inode), + (h_inode->i_mode & S_IALLUGO)); + } + +out: + return err; +} + +/* + * initialize or clean the whiteouts for an adding branch + */ +static int au_br_init_wh(struct super_block *sb, struct au_branch *br, + int new_perm) +{ + int err, old_perm; + aufs_bindex_t bindex; + struct mutex *h_mtx; + struct au_wbr *wbr; + struct au_hinode *hdir; + + err = vfsub_mnt_want_write(au_br_mnt(br)); + if (unlikely(err)) + goto out; + + wbr = br->br_wbr; + old_perm = br->br_perm; + br->br_perm = new_perm; + hdir = NULL; + h_mtx = NULL; + bindex = au_br_index(sb, br->br_id); + if (0 <= bindex) { + hdir = au_hi(sb->s_root->d_inode, bindex); + au_hn_imtx_lock_nested(hdir, AuLsc_I_PARENT); + } else { + h_mtx = &au_br_dentry(br)->d_inode->i_mutex; + mutex_lock_nested(h_mtx, AuLsc_I_PARENT); + } + if (!wbr) + err = au_wh_init(br, sb); + else { + wbr_wh_write_lock(wbr); + err = au_wh_init(br, sb); + wbr_wh_write_unlock(wbr); + } + if (hdir) + au_hn_imtx_unlock(hdir); + else + mutex_unlock(h_mtx); + vfsub_mnt_drop_write(au_br_mnt(br)); + br->br_perm = old_perm; + + if (!err && wbr && !au_br_writable(new_perm)) { + kfree(wbr); + br->br_wbr = NULL; + } + +out: + return err; +} + +static int au_wbr_init(struct au_branch *br, struct super_block *sb, + int perm) +{ + int err; + struct kstatfs kst; + struct au_wbr *wbr; + + wbr = br->br_wbr; + au_rw_init(&wbr->wbr_wh_rwsem); + memset(wbr->wbr_wh, 0, sizeof(wbr->wbr_wh)); + atomic_set(&wbr->wbr_wh_running, 0); + wbr->wbr_bytes = 0; + + /* + * a limit for rmdir/rename a dir + * cf. AUFS_MAX_NAMELEN in include/uapi/linux/aufs_type.h + */ + err = vfs_statfs(&br->br_path, &kst); + if (unlikely(err)) + goto out; + err = -EINVAL; + if (kst.f_namelen >= NAME_MAX) + err = au_br_init_wh(sb, br, perm); + else + pr_err("%.*s(%s), unsupported namelen %ld\n", + AuDLNPair(au_br_dentry(br)), + au_sbtype(au_br_dentry(br)->d_sb), kst.f_namelen); + +out: + return err; +} + +/* initialize a new branch */ +static int au_br_init(struct au_branch *br, struct super_block *sb, + struct au_opt_add *add) +{ + int err; + + err = 0; + memset(&br->br_xino, 0, sizeof(br->br_xino)); + mutex_init(&br->br_xino.xi_nondir_mtx); + br->br_perm = add->perm; + BUILD_BUG_ON(sizeof(br->br_dflags) + != sizeof(br->br_path.dentry->d_flags)); + br->br_dflags = DCACHE_MOUNTED; + br->br_path = add->path; /* set first, path_get() later */ + spin_lock_init(&br->br_dykey_lock); + memset(br->br_dykey, 0, sizeof(br->br_dykey)); + atomic_set(&br->br_count, 0); + atomic_set(&br->br_xino_running, 0); + br->br_id = au_new_br_id(sb); + AuDebugOn(br->br_id < 0); + + if (au_br_writable(add->perm)) { + err = au_wbr_init(br, sb, add->perm); + if (unlikely(err)) + goto out_err; + } + + if (au_opt_test(au_mntflags(sb), XINO)) { + err = au_xino_br(sb, br, add->path.dentry->d_inode->i_ino, + au_sbr(sb, 0)->br_xino.xi_file, /*do_test*/1); + if (unlikely(err)) { + AuDebugOn(br->br_xino.xi_file); + goto out_err; + } + } + + sysaufs_br_init(br); + path_get(&br->br_path); + goto out; /* success */ + +out_err: + memset(&br->br_path, 0, sizeof(br->br_path)); +out: + return err; +} + +static void au_br_do_add_brp(struct au_sbinfo *sbinfo, aufs_bindex_t bindex, + struct au_branch *br, aufs_bindex_t bend, + aufs_bindex_t amount) +{ + struct au_branch **brp; + + AuRwMustWriteLock(&sbinfo->si_rwsem); + + brp = sbinfo->si_branch + bindex; + memmove(brp + 1, brp, sizeof(*brp) * amount); + *brp = br; + sbinfo->si_bend++; + if (unlikely(bend < 0)) + sbinfo->si_bend = 0; +} + +static void au_br_do_add_hdp(struct au_dinfo *dinfo, aufs_bindex_t bindex, + aufs_bindex_t bend, aufs_bindex_t amount) +{ + struct au_hdentry *hdp; + + AuRwMustWriteLock(&dinfo->di_rwsem); + + hdp = dinfo->di_hdentry + bindex; + memmove(hdp + 1, hdp, sizeof(*hdp) * amount); + au_h_dentry_init(hdp); + dinfo->di_bend++; + if (unlikely(bend < 0)) + dinfo->di_bstart = 0; +} + +static void au_br_do_add_hip(struct au_iinfo *iinfo, aufs_bindex_t bindex, + aufs_bindex_t bend, aufs_bindex_t amount) +{ + struct au_hinode *hip; + + AuRwMustWriteLock(&iinfo->ii_rwsem); + + hip = iinfo->ii_hinode + bindex; + memmove(hip + 1, hip, sizeof(*hip) * amount); + hip->hi_inode = NULL; + au_hn_init(hip); + iinfo->ii_bend++; + if (unlikely(bend < 0)) + iinfo->ii_bstart = 0; +} + +static void au_br_do_add(struct super_block *sb, struct au_branch *br, + aufs_bindex_t bindex) +{ + struct dentry *root, *h_dentry; + struct inode *root_inode; + aufs_bindex_t bend, amount; + + au_br_dflags_force(br); + + root = sb->s_root; + root_inode = root->d_inode; + bend = au_sbend(sb); + amount = bend + 1 - bindex; + h_dentry = au_br_dentry(br); + au_sbilist_lock(); + au_br_do_add_brp(au_sbi(sb), bindex, br, bend, amount); + au_br_do_add_hdp(au_di(root), bindex, bend, amount); + au_br_do_add_hip(au_ii(root_inode), bindex, bend, amount); + au_set_h_dptr(root, bindex, dget(h_dentry)); + au_set_h_iptr(root_inode, bindex, au_igrab(h_dentry->d_inode), + /*flags*/0); + au_sbilist_unlock(); +} + +int au_br_add(struct super_block *sb, struct au_opt_add *add, int remount) +{ + int err; + aufs_bindex_t bend, add_bindex; + struct dentry *root, *h_dentry; + struct inode *root_inode; + struct au_branch *add_branch; + + root = sb->s_root; + root_inode = root->d_inode; + IMustLock(root_inode); + err = test_add(sb, add, remount); + if (unlikely(err < 0)) + goto out; + if (err) { + err = 0; + goto out; /* success */ + } + + bend = au_sbend(sb); + add_branch = au_br_alloc(sb, bend + 2, add->perm); + err = PTR_ERR(add_branch); + if (IS_ERR(add_branch)) + goto out; + + err = au_br_init(add_branch, sb, add); + if (unlikely(err)) { + au_br_do_free(add_branch); + goto out; + } + + add_bindex = add->bindex; + if (!remount) + au_br_do_add(sb, add_branch, add_bindex); + else { + sysaufs_brs_del(sb, add_bindex); + au_br_do_add(sb, add_branch, add_bindex); + sysaufs_brs_add(sb, add_bindex); + } + + h_dentry = add->path.dentry; + if (!add_bindex) { + au_cpup_attr_all(root_inode, /*force*/1); + sb->s_maxbytes = h_dentry->d_sb->s_maxbytes; + } else + au_add_nlink(root_inode, h_dentry->d_inode); + + /* + * this test/set prevents aufs from handling unnecesary notify events + * of xino files, in case of re-adding a writable branch which was + * once detached from aufs. + */ + if (au_xino_brid(sb) < 0 + && au_br_writable(add_branch->br_perm) + && !au_test_fs_bad_xino(h_dentry->d_sb) + && add_branch->br_xino.xi_file + && add_branch->br_xino.xi_file->f_dentry->d_parent == h_dentry) + au_xino_brid_set(sb, add_branch->br_id); + +out: + return err; +} + +/* ---------------------------------------------------------------------- */ + +static unsigned long long au_farray_cb(void *a, + unsigned long long max __maybe_unused, + void *arg) +{ + unsigned long long n; + struct file **p, *f; + struct au_sphlhead *files; + struct au_finfo *finfo; + struct super_block *sb = arg; + + n = 0; + p = a; + files = &au_sbi(sb)->si_files; + spin_lock(&files->spin); + hlist_for_each_entry(finfo, &files->head, fi_hlist) { + f = finfo->fi_file; + if (file_count(f) + && !special_file(file_inode(f)->i_mode)) { + get_file(f); + *p++ = f; + n++; + AuDebugOn(n > max); + } + } + spin_unlock(&files->spin); + + return n; +} + +static struct file **au_farray_alloc(struct super_block *sb, + unsigned long long *max) +{ + *max = atomic_long_read(&au_sbi(sb)->si_nfiles); + return au_array_alloc(max, au_farray_cb, sb); +} + +static void au_farray_free(struct file **a, unsigned long long max) +{ + unsigned long long ull; + + for (ull = 0; ull < max; ull++) + if (a[ull]) + fput(a[ull]); + au_array_free(a); +} + +/* ---------------------------------------------------------------------- */ + +/* + * delete a branch + */ + +/* to show the line number, do not make it inlined function */ +#define AuVerbose(do_info, fmt, ...) do { \ + if (do_info) \ + pr_info(fmt, ##__VA_ARGS__); \ +} while (0) + +static int au_test_ibusy(struct inode *inode, aufs_bindex_t bstart, + aufs_bindex_t bend) +{ + return (inode && !S_ISDIR(inode->i_mode)) || bstart == bend; +} + +static int au_test_dbusy(struct dentry *dentry, aufs_bindex_t bstart, + aufs_bindex_t bend) +{ + return au_test_ibusy(dentry->d_inode, bstart, bend); +} + +/* + * test if the branch is deletable or not. + */ +static int test_dentry_busy(struct dentry *root, aufs_bindex_t bindex, + unsigned int sigen, const unsigned int verbose) +{ + int err, i, j, ndentry; + aufs_bindex_t bstart, bend; + struct au_dcsub_pages dpages; + struct au_dpage *dpage; + struct dentry *d; + + err = au_dpages_init(&dpages, GFP_NOFS); + if (unlikely(err)) + goto out; + err = au_dcsub_pages(&dpages, root, NULL, NULL); + if (unlikely(err)) + goto out_dpages; + + for (i = 0; !err && i < dpages.ndpage; i++) { + dpage = dpages.dpages + i; + ndentry = dpage->ndentry; + for (j = 0; !err && j < ndentry; j++) { + d = dpage->dentries[j]; + AuDebugOn(!d->d_count); + if (!au_digen_test(d, sigen)) { + di_read_lock_child(d, AuLock_IR); + if (unlikely(au_dbrange_test(d))) { + di_read_unlock(d, AuLock_IR); + continue; + } + } else { + di_write_lock_child(d); + if (unlikely(au_dbrange_test(d))) { + di_write_unlock(d); + continue; + } + err = au_reval_dpath(d, sigen); + if (!err) + di_downgrade_lock(d, AuLock_IR); + else { + di_write_unlock(d); + break; + } + } + + /* AuDbgDentry(d); */ + bstart = au_dbstart(d); + bend = au_dbend(d); + if (bstart <= bindex + && bindex <= bend + && au_h_dptr(d, bindex) + && au_test_dbusy(d, bstart, bend)) { + err = -EBUSY; + AuVerbose(verbose, "busy %.*s\n", AuDLNPair(d)); + AuDbgDentry(d); + } + di_read_unlock(d, AuLock_IR); + } + } + +out_dpages: + au_dpages_free(&dpages); +out: + return err; +} + +static int test_inode_busy(struct super_block *sb, aufs_bindex_t bindex, + unsigned int sigen, const unsigned int verbose) +{ + int err; + unsigned long long max, ull; + struct inode *i, **array; + aufs_bindex_t bstart, bend; + + array = au_iarray_alloc(sb, &max); + err = PTR_ERR(array); + if (IS_ERR(array)) + goto out; + + err = 0; + AuDbg("b%d\n", bindex); + for (ull = 0; !err && ull < max; ull++) { + i = array[ull]; + if (unlikely(!i)) + break; + if (i->i_ino == AUFS_ROOT_INO) + continue; + + /* AuDbgInode(i); */ + if (au_iigen(i, NULL) == sigen) + ii_read_lock_child(i); + else { + ii_write_lock_child(i); + err = au_refresh_hinode_self(i); + au_iigen_dec(i); + if (!err) + ii_downgrade_lock(i); + else { + ii_write_unlock(i); + break; + } + } + + bstart = au_ibstart(i); + bend = au_ibend(i); + if (bstart <= bindex + && bindex <= bend + && au_h_iptr(i, bindex) + && au_test_ibusy(i, bstart, bend)) { + err = -EBUSY; + AuVerbose(verbose, "busy i%lu\n", i->i_ino); + AuDbgInode(i); + } + ii_read_unlock(i); + } + au_iarray_free(array, max); + +out: + return err; +} + +static int test_children_busy(struct dentry *root, aufs_bindex_t bindex, + const unsigned int verbose) +{ + int err; + unsigned int sigen; + + sigen = au_sigen(root->d_sb); + DiMustNoWaiters(root); + IiMustNoWaiters(root->d_inode); + di_write_unlock(root); + err = test_dentry_busy(root, bindex, sigen, verbose); + if (!err) + err = test_inode_busy(root->d_sb, bindex, sigen, verbose); + di_write_lock_child(root); /* aufs_write_lock() calls ..._child() */ + + return err; +} + +static int test_dir_busy(struct file *file, aufs_bindex_t br_id, + struct file **to_free, int *idx) +{ + int err; + unsigned char matched, root; + aufs_bindex_t bindex, bend; + struct au_fidir *fidir; + struct au_hfile *hfile; + + err = 0; + root = IS_ROOT(file->f_dentry); + if (root) { + get_file(file); + to_free[*idx] = file; + (*idx)++; + goto out; + } + + matched = 0; + fidir = au_fi(file)->fi_hdir; + AuDebugOn(!fidir); + bend = au_fbend_dir(file); + for (bindex = au_fbstart(file); bindex <= bend; bindex++) { + hfile = fidir->fd_hfile + bindex; + if (!hfile->hf_file) + continue; + + if (hfile->hf_br->br_id == br_id) { + matched = 1; + break; + } + } + if (matched) + err = -EBUSY; + +out: + return err; +} + +static int test_file_busy(struct super_block *sb, aufs_bindex_t br_id, + struct file **to_free, int opened) +{ + int err, idx; + unsigned long long ull, max; + aufs_bindex_t bstart; + struct file *file, **array; + struct inode *inode; + struct dentry *root; + struct au_hfile *hfile; + + array = au_farray_alloc(sb, &max); + err = PTR_ERR(array); + if (IS_ERR(array)) + goto out; + + err = 0; + idx = 0; + root = sb->s_root; + di_write_unlock(root); + for (ull = 0; ull < max; ull++) { + file = array[ull]; + if (unlikely(!file)) + break; + + /* AuDbg("%.*s\n", AuDLNPair(file->f_dentry)); */ + fi_read_lock(file); + bstart = au_fbstart(file); + inode = file_inode(file); + if (!S_ISDIR(inode->i_mode)) { + hfile = &au_fi(file)->fi_htop; + if (hfile->hf_br->br_id == br_id) + err = -EBUSY; + } else + err = test_dir_busy(file, br_id, to_free, &idx); + fi_read_unlock(file); + if (unlikely(err)) + break; + } + di_write_lock_child(root); + au_farray_free(array, max); + AuDebugOn(idx > opened); + +out: + return err; +} + +static void br_del_file(struct file **to_free, unsigned long long opened, + aufs_bindex_t br_id) +{ + unsigned long long ull; + aufs_bindex_t bindex, bstart, bend, bfound; + struct file *file; + struct au_fidir *fidir; + struct au_hfile *hfile; + + for (ull = 0; ull < opened; ull++) { + file = to_free[ull]; + if (unlikely(!file)) + break; + + /* AuDbg("%.*s\n", AuDLNPair(file->f_dentry)); */ + AuDebugOn(!S_ISDIR(file_inode(file)->i_mode)); + bfound = -1; + fidir = au_fi(file)->fi_hdir; + AuDebugOn(!fidir); + fi_write_lock(file); + bstart = au_fbstart(file); + bend = au_fbend_dir(file); + for (bindex = bstart; bindex <= bend; bindex++) { + hfile = fidir->fd_hfile + bindex; + if (!hfile->hf_file) + continue; + + if (hfile->hf_br->br_id == br_id) { + bfound = bindex; + break; + } + } + AuDebugOn(bfound < 0); + au_set_h_fptr(file, bfound, NULL); + if (bfound == bstart) { + for (bstart++; bstart <= bend; bstart++) + if (au_hf_dir(file, bstart)) { + au_set_fbstart(file, bstart); + break; + } + } + fi_write_unlock(file); + } +} + +static void au_br_do_del_brp(struct au_sbinfo *sbinfo, + const aufs_bindex_t bindex, + const aufs_bindex_t bend) +{ + struct au_branch **brp, **p; + + AuRwMustWriteLock(&sbinfo->si_rwsem); + + brp = sbinfo->si_branch + bindex; + if (bindex < bend) + memmove(brp, brp + 1, sizeof(*brp) * (bend - bindex)); + sbinfo->si_branch[0 + bend] = NULL; + sbinfo->si_bend--; + + p = krealloc(sbinfo->si_branch, sizeof(*p) * bend, AuGFP_SBILIST); + if (p) + sbinfo->si_branch = p; + /* harmless error */ +} + +static void au_br_do_del_hdp(struct au_dinfo *dinfo, const aufs_bindex_t bindex, + const aufs_bindex_t bend) +{ + struct au_hdentry *hdp, *p; + + AuRwMustWriteLock(&dinfo->di_rwsem); + + hdp = dinfo->di_hdentry; + if (bindex < bend) + memmove(hdp + bindex, hdp + bindex + 1, + sizeof(*hdp) * (bend - bindex)); + hdp[0 + bend].hd_dentry = NULL; + dinfo->di_bend--; + + p = krealloc(hdp, sizeof(*p) * bend, AuGFP_SBILIST); + if (p) + dinfo->di_hdentry = p; + /* harmless error */ +} + +static void au_br_do_del_hip(struct au_iinfo *iinfo, const aufs_bindex_t bindex, + const aufs_bindex_t bend) +{ + struct au_hinode *hip, *p; + + AuRwMustWriteLock(&iinfo->ii_rwsem); + + hip = iinfo->ii_hinode + bindex; + if (bindex < bend) + memmove(hip, hip + 1, sizeof(*hip) * (bend - bindex)); + iinfo->ii_hinode[0 + bend].hi_inode = NULL; + au_hn_init(iinfo->ii_hinode + bend); + iinfo->ii_bend--; + + p = krealloc(iinfo->ii_hinode, sizeof(*p) * bend, AuGFP_SBILIST); + if (p) + iinfo->ii_hinode = p; + /* harmless error */ +} + +static void au_br_do_del(struct super_block *sb, aufs_bindex_t bindex, + struct au_branch *br) +{ + aufs_bindex_t bend; + struct au_sbinfo *sbinfo; + struct dentry *root, *h_root; + struct inode *inode, *h_inode; + struct au_hinode *hinode; + + SiMustWriteLock(sb); + + root = sb->s_root; + inode = root->d_inode; + sbinfo = au_sbi(sb); + bend = sbinfo->si_bend; + + h_root = au_h_dptr(root, bindex); + hinode = au_hi(inode, bindex); + h_inode = au_igrab(hinode->hi_inode); + au_hiput(hinode); + + au_sbilist_lock(); + au_br_do_del_brp(sbinfo, bindex, bend); + au_br_do_del_hdp(au_di(root), bindex, bend); + au_br_do_del_hip(au_ii(inode), bindex, bend); + au_sbilist_unlock(); + + dput(h_root); + iput(h_inode); + au_br_do_free(br); +} + +static unsigned long long empty_cb(void *array, unsigned long long max, + void *arg) +{ + return max; +} + +int au_br_del(struct super_block *sb, struct au_opt_del *del, int remount) +{ + int err, rerr, i; + unsigned long long opened; + unsigned int mnt_flags; + aufs_bindex_t bindex, bend, br_id; + unsigned char do_wh, verbose; + struct au_branch *br; + struct au_wbr *wbr; + struct dentry *root; + struct file **to_free; + + err = 0; + opened = 0; + to_free = NULL; + root = sb->s_root; + bindex = au_find_dbindex(root, del->h_path.dentry); + if (bindex < 0) { + if (remount) + goto out; /* success */ + err = -ENOENT; + pr_err("%s no such branch\n", del->pathname); + goto out; + } + AuDbg("bindex b%d\n", bindex); + + err = -EBUSY; + mnt_flags = au_mntflags(sb); + verbose = !!au_opt_test(mnt_flags, VERBOSE); + bend = au_sbend(sb); + if (unlikely(!bend)) { + AuVerbose(verbose, "no more branches left\n"); + goto out; + } + br = au_sbr(sb, bindex); + AuDebugOn(!path_equal(&br->br_path, &del->h_path)); + + br_id = br->br_id; + opened = atomic_read(&br->br_count); + if (unlikely(opened)) { + to_free = au_array_alloc(&opened, empty_cb, NULL); + err = PTR_ERR(to_free); + if (IS_ERR(to_free)) + goto out; + + err = test_file_busy(sb, br_id, to_free, opened); + if (unlikely(err)) { + AuVerbose(verbose, "%llu file(s) opened\n", opened); + goto out; + } + } + + wbr = br->br_wbr; + do_wh = wbr && (wbr->wbr_whbase || wbr->wbr_plink || wbr->wbr_orph); + if (do_wh) { + /* instead of WbrWhMustWriteLock(wbr) */ + SiMustWriteLock(sb); + for (i = 0; i < AuBrWh_Last; i++) { + dput(wbr->wbr_wh[i]); + wbr->wbr_wh[i] = NULL; + } + } + + err = test_children_busy(root, bindex, verbose); + if (unlikely(err)) { + if (do_wh) + goto out_wh; + goto out; + } + + err = 0; + if (to_free) { + /* + * now we confirmed the branch is deletable. + * let's free the remaining opened dirs on the branch. + */ + di_write_unlock(root); + br_del_file(to_free, opened, br_id); + di_write_lock_child(root); + } + + if (!remount) + au_br_do_del(sb, bindex, br); + else { + sysaufs_brs_del(sb, bindex); + au_br_do_del(sb, bindex, br); + sysaufs_brs_add(sb, bindex); + } + + if (!bindex) { + au_cpup_attr_all(root->d_inode, /*force*/1); + sb->s_maxbytes = au_sbr_sb(sb, 0)->s_maxbytes; + } else + au_sub_nlink(root->d_inode, del->h_path.dentry->d_inode); + if (au_opt_test(mnt_flags, PLINK)) + au_plink_half_refresh(sb, br_id); + + if (au_xino_brid(sb) == br_id) + au_xino_brid_set(sb, -1); + goto out; /* success */ + +out_wh: + /* revert */ + rerr = au_br_init_wh(sb, br, br->br_perm); + if (rerr) + pr_warn("failed re-creating base whiteout, %s. (%d)\n", + del->pathname, rerr); +out: + if (to_free) + au_farray_free(to_free, opened); + return err; +} + +/* ---------------------------------------------------------------------- */ + +static int au_ibusy(struct super_block *sb, struct aufs_ibusy __user *arg) +{ + int err; + aufs_bindex_t bstart, bend; + struct aufs_ibusy ibusy; + struct inode *inode, *h_inode; + + err = -EPERM; + if (unlikely(!capable(CAP_SYS_ADMIN))) + goto out; + + err = copy_from_user(&ibusy, arg, sizeof(ibusy)); + if (!err) + err = !access_ok(VERIFY_WRITE, &arg->h_ino, sizeof(arg->h_ino)); + if (unlikely(err)) { + err = -EFAULT; + AuTraceErr(err); + goto out; + } + + err = -EINVAL; + si_read_lock(sb, AuLock_FLUSH); + if (unlikely(ibusy.bindex < 0 || ibusy.bindex > au_sbend(sb))) + goto out_unlock; + + err = 0; + ibusy.h_ino = 0; /* invalid */ + inode = ilookup(sb, ibusy.ino); + if (!inode + || inode->i_ino == AUFS_ROOT_INO + || is_bad_inode(inode)) + goto out_unlock; + + ii_read_lock_child(inode); + bstart = au_ibstart(inode); + bend = au_ibend(inode); + if (bstart <= ibusy.bindex && ibusy.bindex <= bend) { + h_inode = au_h_iptr(inode, ibusy.bindex); + if (h_inode && au_test_ibusy(inode, bstart, bend)) + ibusy.h_ino = h_inode->i_ino; + } + ii_read_unlock(inode); + iput(inode); + +out_unlock: + si_read_unlock(sb); + if (!err) { + err = __put_user(ibusy.h_ino, &arg->h_ino); + if (unlikely(err)) { + err = -EFAULT; + AuTraceErr(err); + } + } +out: + return err; +} + +long au_ibusy_ioctl(struct file *file, unsigned long arg) +{ + return au_ibusy(file->f_dentry->d_sb, (void __user *)arg); +} + +#ifdef CONFIG_COMPAT +long au_ibusy_compat_ioctl(struct file *file, unsigned long arg) +{ + return au_ibusy(file->f_dentry->d_sb, compat_ptr(arg)); +} +#endif + +/* ---------------------------------------------------------------------- */ + +/* + * change a branch permission + */ + +static void au_warn_ima(void) +{ +#ifdef CONFIG_IMA + /* since it doesn't support mark_files_ro() */ + AuWarn1("RW -> RO makes IMA to produce wrong message\n"); +#endif +} + +static int do_need_sigen_inc(int a, int b) +{ + return au_br_whable(a) && !au_br_whable(b); +} + +static int need_sigen_inc(int old, int new) +{ + return do_need_sigen_inc(old, new) + || do_need_sigen_inc(new, old); +} + +static int au_br_mod_files_ro(struct super_block *sb, aufs_bindex_t bindex) +{ + int err, do_warn; + unsigned int mnt_flags; + unsigned long long ull, max; + aufs_bindex_t br_id; + unsigned char verbose; + struct file *file, *hf, **array; + struct inode *inode; + struct au_hfile *hfile; + + mnt_flags = au_mntflags(sb); + verbose = !!au_opt_test(mnt_flags, VERBOSE); + + array = au_farray_alloc(sb, &max); + err = PTR_ERR(array); + if (IS_ERR(array)) + goto out; + + do_warn = 0; + br_id = au_sbr_id(sb, bindex); + for (ull = 0; ull < max; ull++) { + file = array[ull]; + if (unlikely(!file)) + break; + + /* AuDbg("%.*s\n", AuDLNPair(file->f_dentry)); */ + fi_read_lock(file); + if (unlikely(au_test_mmapped(file))) { + err = -EBUSY; + AuVerbose(verbose, "mmapped %.*s\n", + AuDLNPair(file->f_dentry)); + AuDbgFile(file); + FiMustNoWaiters(file); + fi_read_unlock(file); + goto out_array; + } + + inode = file_inode(file); + hfile = &au_fi(file)->fi_htop; + hf = hfile->hf_file; + if (!S_ISREG(inode->i_mode) + || !(file->f_mode & FMODE_WRITE) + || hfile->hf_br->br_id != br_id + || !(hf->f_mode & FMODE_WRITE)) + array[ull] = NULL; + else { + do_warn = 1; + get_file(file); + } + + FiMustNoWaiters(file); + fi_read_unlock(file); + fput(file); + } + + err = 0; + if (do_warn) + au_warn_ima(); + + for (ull = 0; ull < max; ull++) { + file = array[ull]; + if (!file) + continue; + + /* todo: already flushed? */ + /* + * fs/super.c:mark_files_ro() is gone, but aufs keeps its + * approach which resets f_mode and calls mnt_drop_write() and + * file_release_write() for each file, because the branch + * attribute in aufs world is totally different from the native + * fs rw/ro mode. + */ + /* fi_read_lock(file); */ + hfile = &au_fi(file)->fi_htop; + hf = hfile->hf_file; + /* fi_read_unlock(file); */ + spin_lock(&hf->f_lock); + hf->f_mode &= ~FMODE_WRITE; + spin_unlock(&hf->f_lock); + if (!file_check_writeable(hf)) { + __mnt_drop_write(hf->f_path.mnt); + file_release_write(hf); + } + } + +out_array: + au_farray_free(array, max); +out: + AuTraceErr(err); + return err; +} + +int au_br_mod(struct super_block *sb, struct au_opt_mod *mod, int remount, + int *do_refresh) +{ + int err, rerr; + aufs_bindex_t bindex; + struct dentry *root; + struct au_branch *br; + struct au_br_fhsm *bf; + + root = sb->s_root; + bindex = au_find_dbindex(root, mod->h_root); + if (bindex < 0) { + if (remount) + return 0; /* success */ + err = -ENOENT; + pr_err("%s no such branch\n", mod->path); + goto out; + } + AuDbg("bindex b%d\n", bindex); + + err = test_br(mod->h_root->d_inode, mod->perm, mod->path); + if (unlikely(err)) + goto out; + + br = au_sbr(sb, bindex); + AuDebugOn(mod->h_root != au_br_dentry(br)); + if (br->br_perm == mod->perm) + return 0; /* success */ + + /* pre-allocate for non-fhsm --> fhsm */ + bf = NULL; + if (!au_br_fhsm(br->br_perm) && au_br_fhsm(mod->perm)) { + err = au_fhsm_br_alloc(br); + if (unlikely(err)) + goto out; + bf = br->br_fhsm; + br->br_fhsm = NULL; + } + + if (au_br_writable(br->br_perm)) { + /* remove whiteout base */ + err = au_br_init_wh(sb, br, mod->perm); + if (unlikely(err)) + goto out_bf; + + if (!au_br_writable(mod->perm)) { + /* rw --> ro, file might be mmapped */ + DiMustNoWaiters(root); + IiMustNoWaiters(root->d_inode); + di_write_unlock(root); + err = au_br_mod_files_ro(sb, bindex); + /* aufs_write_lock() calls ..._child() */ + di_write_lock_child(root); + + if (unlikely(err)) { + rerr = -ENOMEM; + br->br_wbr = kmalloc(sizeof(*br->br_wbr), + GFP_NOFS); + if (br->br_wbr) + rerr = au_wbr_init(br, sb, br->br_perm); + if (unlikely(rerr)) { + AuIOErr("nested error %d (%d)\n", + rerr, err); + br->br_perm = mod->perm; + } + } + } + } else if (au_br_writable(mod->perm)) { + /* ro --> rw */ + err = -ENOMEM; + br->br_wbr = kmalloc(sizeof(*br->br_wbr), GFP_NOFS); + if (br->br_wbr) { + err = au_wbr_init(br, sb, mod->perm); + if (unlikely(err)) { + kfree(br->br_wbr); + br->br_wbr = NULL; + } + } + } + if (unlikely(err)) + goto out_bf; + + if (au_br_fhsm(br->br_perm)) { + if (!au_br_fhsm(mod->perm)) { + /* fhsm --> non-fhsm */ + au_br_fhsm_fin(br->br_fhsm); + kfree(br->br_fhsm); + br->br_fhsm = NULL; + } + } else if (au_br_fhsm(mod->perm)) + /* non-fhsm --> fhsm */ + br->br_fhsm = bf; + + if ((br->br_perm & AuBrAttr_UNPIN) + && !(mod->perm & AuBrAttr_UNPIN)) + au_br_dflags_force(br); + else if (!(br->br_perm & AuBrAttr_UNPIN) + && (mod->perm & AuBrAttr_UNPIN)) + au_br_dflags_restore(br); + *do_refresh |= need_sigen_inc(br->br_perm, mod->perm); + br->br_perm = mod->perm; + goto out; /* success */ + +out_bf: + kfree(bf); +out: + AuTraceErr(err); + return err; +} + +/* ---------------------------------------------------------------------- */ + +int au_br_stfs(struct au_branch *br, struct aufs_stfs *stfs) +{ + int err; + struct kstatfs kstfs; + + err = vfs_statfs(&br->br_path, &kstfs); + if (!err) { + stfs->f_blocks = kstfs.f_blocks; + stfs->f_bavail = kstfs.f_bavail; + stfs->f_files = kstfs.f_files; + stfs->f_ffree = kstfs.f_ffree; + } + + return err; +} diff --git a/fs/aufs/branch.h b/fs/aufs/branch.h new file mode 100644 index 00000000000000..b063fb8f15622a --- /dev/null +++ b/fs/aufs/branch.h @@ -0,0 +1,268 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * branch filesystems and xino for them + */ + +#ifndef __AUFS_BRANCH_H__ +#define __AUFS_BRANCH_H__ + +#ifdef __KERNEL__ + +#include +#include "dynop.h" +#include "rwsem.h" +#include "super.h" + +/* ---------------------------------------------------------------------- */ + +/* a xino file */ +struct au_xino_file { + struct file *xi_file; + struct mutex xi_nondir_mtx; + + /* todo: make xino files an array to support huge inode number */ + +#ifdef CONFIG_DEBUG_FS + struct dentry *xi_dbgaufs; +#endif +}; + +/* File-based Hierarchical Storage Management */ +struct au_br_fhsm { +#ifdef CONFIG_AUFS_FHSM + struct mutex bf_lock; + unsigned long bf_jiffy; + struct aufs_stfs bf_stfs; + int bf_readable; +#endif +}; + +/* members for writable branch only */ +enum {AuBrWh_BASE, AuBrWh_PLINK, AuBrWh_ORPH, AuBrWh_Last}; +struct au_wbr { + struct au_rwsem wbr_wh_rwsem; + struct dentry *wbr_wh[AuBrWh_Last]; + atomic_t wbr_wh_running; +#define wbr_whbase wbr_wh[AuBrWh_BASE] /* whiteout base */ +#define wbr_plink wbr_wh[AuBrWh_PLINK] /* pseudo-link dir */ +#define wbr_orph wbr_wh[AuBrWh_ORPH] /* dir for orphans */ + + /* mfs mode */ + unsigned long long wbr_bytes; +}; + +/* ext2 has 3 types of operations at least, ext3 has 4 */ +#define AuBrDynOp (AuDyLast * 4) + +#ifdef CONFIG_AUFS_HFSNOTIFY +/* support for asynchronous destruction */ +struct au_br_hfsnotify { + struct fsnotify_group *hfsn_group; +}; +#endif + +/* sysfs entries */ +struct au_brsysfs { + char name[16]; + struct attribute attr; +}; + +enum { + AuBrSysfs_BR, + AuBrSysfs_BRID, + AuBrSysfs_Last +}; + +/* protected by superblock rwsem */ +struct au_branch { + struct au_xino_file br_xino; + + aufs_bindex_t br_id; + + int br_perm; + unsigned int br_dflags; + struct path br_path; + spinlock_t br_dykey_lock; + struct au_dykey *br_dykey[AuBrDynOp]; + atomic_t br_count; + + struct au_wbr *br_wbr; + struct au_br_fhsm *br_fhsm; + + /* xino truncation */ + atomic_t br_xino_running; + +#ifdef CONFIG_AUFS_HFSNOTIFY + struct au_br_hfsnotify *br_hfsn; +#endif + +#ifdef CONFIG_SYSFS + /* entries under sysfs per mount-point */ + struct au_brsysfs br_sysfs[AuBrSysfs_Last]; +#endif +}; + +/* ---------------------------------------------------------------------- */ + +static inline struct vfsmount *au_br_mnt(struct au_branch *br) +{ + return br->br_path.mnt; +} + +static inline struct dentry *au_br_dentry(struct au_branch *br) +{ + return br->br_path.dentry; +} + +static inline struct super_block *au_br_sb(struct au_branch *br) +{ + return au_br_mnt(br)->mnt_sb; +} + +static inline int au_br_rdonly(struct au_branch *br) +{ + return ((au_br_sb(br)->s_flags & MS_RDONLY) + || !au_br_writable(br->br_perm)) + ? -EROFS : 0; +} + +static inline int au_br_hnotifyable(int brperm __maybe_unused) +{ +#ifdef CONFIG_AUFS_HNOTIFY + return !(brperm & AuBrPerm_RR); +#else + return 0; +#endif +} + +/* ---------------------------------------------------------------------- */ + +/* branch.c */ +struct au_sbinfo; +void au_br_free(struct au_sbinfo *sinfo); +int au_br_index(struct super_block *sb, aufs_bindex_t br_id); +struct au_opt_add; +int au_br_add(struct super_block *sb, struct au_opt_add *add, int remount); +struct au_opt_del; +int au_br_del(struct super_block *sb, struct au_opt_del *del, int remount); +long au_ibusy_ioctl(struct file *file, unsigned long arg); +#ifdef CONFIG_COMPAT +long au_ibusy_compat_ioctl(struct file *file, unsigned long arg); +#endif +struct au_opt_mod; +int au_br_mod(struct super_block *sb, struct au_opt_mod *mod, int remount, + int *do_refresh); +struct aufs_stfs; +int au_br_stfs(struct au_branch *br, struct aufs_stfs *stfs); + +/* xino.c */ +static const loff_t au_loff_max = LLONG_MAX; + +int au_xib_trunc(struct super_block *sb); +ssize_t xino_fread(au_readf_t func, struct file *file, void *buf, size_t size, + loff_t *pos); +ssize_t xino_fwrite(au_writef_t func, struct file *file, void *buf, size_t size, + loff_t *pos); +struct file *au_xino_create2(struct file *base_file, struct file *copy_src); +struct file *au_xino_create(struct super_block *sb, char *fname, int silent); +ino_t au_xino_new_ino(struct super_block *sb); +void au_xino_delete_inode(struct inode *inode, const int unlinked); +int au_xino_write(struct super_block *sb, aufs_bindex_t bindex, ino_t h_ino, + ino_t ino); +int au_xino_read(struct super_block *sb, aufs_bindex_t bindex, ino_t h_ino, + ino_t *ino); +int au_xino_br(struct super_block *sb, struct au_branch *br, ino_t hino, + struct file *base_file, int do_test); +int au_xino_trunc(struct super_block *sb, aufs_bindex_t bindex); + +struct au_opt_xino; +int au_xino_set(struct super_block *sb, struct au_opt_xino *xino, int remount); +void au_xino_clr(struct super_block *sb); +struct file *au_xino_def(struct super_block *sb); +int au_xino_path(struct seq_file *seq, struct file *file); + +/* ---------------------------------------------------------------------- */ + +/* Superblock to branch */ +static inline +aufs_bindex_t au_sbr_id(struct super_block *sb, aufs_bindex_t bindex) +{ + return au_sbr(sb, bindex)->br_id; +} + +static inline +struct vfsmount *au_sbr_mnt(struct super_block *sb, aufs_bindex_t bindex) +{ + return au_br_mnt(au_sbr(sb, bindex)); +} + +static inline +struct super_block *au_sbr_sb(struct super_block *sb, aufs_bindex_t bindex) +{ + return au_br_sb(au_sbr(sb, bindex)); +} + +static inline void au_sbr_put(struct super_block *sb, aufs_bindex_t bindex) +{ + atomic_dec(&au_sbr(sb, bindex)->br_count); +} + +static inline int au_sbr_perm(struct super_block *sb, aufs_bindex_t bindex) +{ + return au_sbr(sb, bindex)->br_perm; +} + +static inline int au_sbr_whable(struct super_block *sb, aufs_bindex_t bindex) +{ + return au_br_whable(au_sbr_perm(sb, bindex)); +} + +/* ---------------------------------------------------------------------- */ + +/* + * wbr_wh_read_lock, wbr_wh_write_lock + * wbr_wh_read_unlock, wbr_wh_write_unlock, wbr_wh_downgrade_lock + */ +AuSimpleRwsemFuncs(wbr_wh, struct au_wbr *wbr, &wbr->wbr_wh_rwsem); + +#define WbrWhMustNoWaiters(wbr) AuRwMustNoWaiters(&wbr->wbr_wh_rwsem) +#define WbrWhMustAnyLock(wbr) AuRwMustAnyLock(&wbr->wbr_wh_rwsem) +#define WbrWhMustWriteLock(wbr) AuRwMustWriteLock(&wbr->wbr_wh_rwsem) + +/* ---------------------------------------------------------------------- */ + +#ifdef CONFIG_AUFS_FHSM +static inline void au_br_fhsm_init(struct au_br_fhsm *brfhsm) +{ + mutex_init(&brfhsm->bf_lock); + brfhsm->bf_jiffy = 0; + brfhsm->bf_readable = 0; +} + +static inline void au_br_fhsm_fin(struct au_br_fhsm *brfhsm) +{ + mutex_destroy(&brfhsm->bf_lock); +} +#else +AuStubVoid(au_br_fhsm_init, struct au_br_fhsm *brfhsm) +AuStubVoid(au_br_fhsm_fin, struct au_br_fhsm *brfhsm) +#endif + +#endif /* __KERNEL__ */ +#endif /* __AUFS_BRANCH_H__ */ diff --git a/fs/aufs/conf.mk b/fs/aufs/conf.mk new file mode 100644 index 00000000000000..0bbb2d3a528594 --- /dev/null +++ b/fs/aufs/conf.mk @@ -0,0 +1,38 @@ + +AuConfStr = CONFIG_AUFS_FS=${CONFIG_AUFS_FS} + +define AuConf +ifdef ${1} +AuConfStr += ${1}=${${1}} +endif +endef + +AuConfAll = BRANCH_MAX_127 BRANCH_MAX_511 BRANCH_MAX_1023 BRANCH_MAX_32767 \ + SBILIST \ + HNOTIFY HFSNOTIFY \ + EXPORT INO_T_64 \ + XATTR \ + FHSM \ + RDU \ + SHWH \ + BR_RAMFS \ + BR_FUSE POLL \ + BR_HFSPLUS \ + BDEV_LOOP \ + DEBUG MAGIC_SYSRQ +$(foreach i, ${AuConfAll}, \ + $(eval $(call AuConf,CONFIG_AUFS_${i}))) + +AuConfName = ${obj}/conf.str +${AuConfName}.tmp: FORCE + @echo ${AuConfStr} | tr ' ' '\n' | sed -e 's/^/"/' -e 's/$$/\\n"/' > $@ +${AuConfName}: ${AuConfName}.tmp + @diff -q $< $@ > /dev/null 2>&1 || { \ + echo ' GEN ' $@; \ + cp -p $< $@; \ + } +FORCE: +clean-files += ${AuConfName} ${AuConfName}.tmp +${obj}/sysfs.o: ${AuConfName} + +-include ${srctree}/${src}/conf_priv.mk diff --git a/fs/aufs/cpup.c b/fs/aufs/cpup.c new file mode 100644 index 00000000000000..0d6c56c40c8e33 --- /dev/null +++ b/fs/aufs/cpup.c @@ -0,0 +1,1285 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * copy-up functions, see wbr_policy.c for copy-down + */ + +#include +#include +#include "aufs.h" + +void au_cpup_attr_flags(struct inode *dst, unsigned int iflags) +{ + const unsigned int mask = S_DEAD | S_SWAPFILE | S_PRIVATE + | S_NOATIME | S_NOCMTIME | S_AUTOMOUNT; + + BUILD_BUG_ON(sizeof(iflags) != sizeof(dst->i_flags)); + + dst->i_flags |= iflags & ~mask; + if (au_test_fs_notime(dst->i_sb)) + dst->i_flags |= S_NOATIME | S_NOCMTIME; +} + +void au_cpup_attr_timesizes(struct inode *inode) +{ + struct inode *h_inode; + + h_inode = au_h_iptr(inode, au_ibstart(inode)); + fsstack_copy_attr_times(inode, h_inode); + fsstack_copy_inode_size(inode, h_inode); +} + +void au_cpup_attr_nlink(struct inode *inode, int force) +{ + struct inode *h_inode; + struct super_block *sb; + aufs_bindex_t bindex, bend; + + sb = inode->i_sb; + bindex = au_ibstart(inode); + h_inode = au_h_iptr(inode, bindex); + if (!force + && !S_ISDIR(h_inode->i_mode) + && au_opt_test(au_mntflags(sb), PLINK) + && au_plink_test(inode)) + return; + + /* + * 0 can happen in revalidating. + * h_inode->i_mutex is not held, but it is harmless since once i_nlink + * reaches 0, it will never become positive. + */ + set_nlink(inode, h_inode->i_nlink); + + /* + * fewer nlink makes find(1) noisy, but larger nlink doesn't. + * it may includes whplink directory. + */ + if (S_ISDIR(h_inode->i_mode)) { + bend = au_ibend(inode); + for (bindex++; bindex <= bend; bindex++) { + h_inode = au_h_iptr(inode, bindex); + if (h_inode) + au_add_nlink(inode, h_inode); + } + } +} + +void au_cpup_attr_changeable(struct inode *inode) +{ + struct inode *h_inode; + + h_inode = au_h_iptr(inode, au_ibstart(inode)); + inode->i_mode = h_inode->i_mode; + inode->i_uid = h_inode->i_uid; + inode->i_gid = h_inode->i_gid; + au_cpup_attr_timesizes(inode); + au_cpup_attr_flags(inode, h_inode->i_flags); +} + +void au_cpup_igen(struct inode *inode, struct inode *h_inode) +{ + struct au_iinfo *iinfo = au_ii(inode); + + IiMustWriteLock(inode); + + iinfo->ii_higen = h_inode->i_generation; + iinfo->ii_hsb1 = h_inode->i_sb; +} + +void au_cpup_attr_all(struct inode *inode, int force) +{ + struct inode *h_inode; + + h_inode = au_h_iptr(inode, au_ibstart(inode)); + au_cpup_attr_changeable(inode); + if (inode->i_nlink > 0) + au_cpup_attr_nlink(inode, force); + inode->i_rdev = h_inode->i_rdev; + inode->i_blkbits = h_inode->i_blkbits; + au_cpup_igen(inode, h_inode); +} + +/* ---------------------------------------------------------------------- */ + +/* Note: dt_dentry and dt_h_dentry are not dget/dput-ed */ + +/* keep the timestamps of the parent dir when cpup */ +void au_dtime_store(struct au_dtime *dt, struct dentry *dentry, + struct path *h_path) +{ + struct inode *h_inode; + + dt->dt_dentry = dentry; + dt->dt_h_path = *h_path; + h_inode = h_path->dentry->d_inode; + dt->dt_atime = h_inode->i_atime; + dt->dt_mtime = h_inode->i_mtime; + /* smp_mb(); */ +} + +void au_dtime_revert(struct au_dtime *dt) +{ + struct iattr attr; + int err; + + attr.ia_atime = dt->dt_atime; + attr.ia_mtime = dt->dt_mtime; + attr.ia_valid = ATTR_FORCE | ATTR_MTIME | ATTR_MTIME_SET + | ATTR_ATIME | ATTR_ATIME_SET; + + err = vfsub_notify_change(&dt->dt_h_path, &attr); + if (unlikely(err)) + pr_warn("restoring timestamps failed(%d). ignored\n", err); +} + +/* ---------------------------------------------------------------------- */ + +/* internal use only */ +struct au_cpup_reg_attr { + int valid; + struct kstat st; + unsigned int iflags; /* inode->i_flags */ +}; + +static noinline_for_stack +int cpup_iattr(struct dentry *dst, aufs_bindex_t bindex, struct dentry *h_src, + struct au_cpup_reg_attr *h_src_attr) +{ + int err, sbits, icex; + struct iattr ia; + struct path h_path; + struct inode *h_isrc, *h_idst; + struct kstat *h_st; + struct au_branch *br; + + h_path.dentry = au_h_dptr(dst, bindex); + h_idst = h_path.dentry->d_inode; + br = au_sbr(dst->d_sb, bindex); + h_path.mnt = au_br_mnt(br); + h_isrc = h_src->d_inode; + ia.ia_valid = ATTR_FORCE | ATTR_UID | ATTR_GID + | ATTR_ATIME | ATTR_MTIME + | ATTR_ATIME_SET | ATTR_MTIME_SET; + if (h_src_attr && h_src_attr->valid) { + h_st = &h_src_attr->st; + ia.ia_uid = h_st->uid; + ia.ia_gid = h_st->gid; + ia.ia_atime = h_st->atime; + ia.ia_mtime = h_st->mtime; + if (h_idst->i_mode != h_st->mode + && !S_ISLNK(h_idst->i_mode)) { + ia.ia_valid |= ATTR_MODE; + ia.ia_mode = h_st->mode; + } + sbits = !!(h_st->mode & (S_ISUID | S_ISGID)); + au_cpup_attr_flags(h_idst, h_src_attr->iflags); + } else { + ia.ia_uid = h_isrc->i_uid; + ia.ia_gid = h_isrc->i_gid; + ia.ia_atime = h_isrc->i_atime; + ia.ia_mtime = h_isrc->i_mtime; + if (h_idst->i_mode != h_isrc->i_mode + && !S_ISLNK(h_idst->i_mode)) { + ia.ia_valid |= ATTR_MODE; + ia.ia_mode = h_isrc->i_mode; + } + sbits = !!(h_isrc->i_mode & (S_ISUID | S_ISGID)); + au_cpup_attr_flags(h_idst, h_isrc->i_flags); + } + err = vfsub_notify_change(&h_path, &ia); + + /* is this nfs only? */ + if (!err && sbits && au_test_nfs(h_path.dentry->d_sb)) { + ia.ia_valid = ATTR_FORCE | ATTR_MODE; + ia.ia_mode = h_isrc->i_mode; + err = vfsub_notify_change(&h_path, &ia); + } + + icex = br->br_perm & AuBrAttr_ICEX; + if (!err) + err = au_cpup_xattr(h_path.dentry, h_src, icex); + + return err; +} + +/* ---------------------------------------------------------------------- */ + +static int au_do_copy_file(struct file *dst, struct file *src, loff_t len, + char *buf, unsigned long blksize) +{ + int err; + size_t sz, rbytes, wbytes; + unsigned char all_zero; + char *p, *zp; + struct mutex *h_mtx; + /* reduce stack usage */ + struct iattr *ia; + + zp = page_address(ZERO_PAGE(0)); + if (unlikely(!zp)) + return -ENOMEM; /* possible? */ + + err = 0; + all_zero = 0; + while (len) { + AuDbg("len %lld\n", len); + sz = blksize; + if (len < blksize) + sz = len; + + rbytes = 0; + /* todo: signal_pending? */ + while (!rbytes || err == -EAGAIN || err == -EINTR) { + rbytes = vfsub_read_k(src, buf, sz, &src->f_pos); + err = rbytes; + } + if (unlikely(err < 0)) + break; + + all_zero = 0; + if (len >= rbytes && rbytes == blksize) + all_zero = !memcmp(buf, zp, rbytes); + if (!all_zero) { + wbytes = rbytes; + p = buf; + while (wbytes) { + size_t b; + + b = vfsub_write_k(dst, p, wbytes, &dst->f_pos); + err = b; + /* todo: signal_pending? */ + if (unlikely(err == -EAGAIN || err == -EINTR)) + continue; + if (unlikely(err < 0)) + break; + wbytes -= b; + p += b; + } + if (unlikely(err < 0)) + break; + } else { + loff_t res; + + AuLabel(hole); + res = vfsub_llseek(dst, rbytes, SEEK_CUR); + err = res; + if (unlikely(res < 0)) + break; + } + len -= rbytes; + err = 0; + } + + /* the last block may be a hole */ + if (!err && all_zero) { + AuLabel(last hole); + + err = 1; + if (au_test_nfs(dst->f_dentry->d_sb)) { + /* nfs requires this step to make last hole */ + /* is this only nfs? */ + do { + /* todo: signal_pending? */ + err = vfsub_write_k(dst, "\0", 1, &dst->f_pos); + } while (err == -EAGAIN || err == -EINTR); + if (err == 1) + dst->f_pos--; + } + + if (err == 1) { + ia = (void *)buf; + ia->ia_size = dst->f_pos; + ia->ia_valid = ATTR_SIZE | ATTR_FILE; + ia->ia_file = dst; + h_mtx = &file_inode(dst)->i_mutex; + mutex_lock_nested(h_mtx, AuLsc_I_CHILD2); + err = vfsub_notify_change(&dst->f_path, ia); + mutex_unlock(h_mtx); + } + } + + return err; +} + +int au_copy_file(struct file *dst, struct file *src, loff_t len) +{ + int err; + unsigned long blksize; + unsigned char do_kfree; + char *buf; + + err = -ENOMEM; + blksize = dst->f_dentry->d_sb->s_blocksize; + if (!blksize || PAGE_SIZE < blksize) + blksize = PAGE_SIZE; + AuDbg("blksize %lu\n", blksize); + do_kfree = (blksize != PAGE_SIZE && blksize >= sizeof(struct iattr *)); + if (do_kfree) + buf = kmalloc(blksize, GFP_NOFS); + else + buf = (void *)__get_free_page(GFP_NOFS); + if (unlikely(!buf)) + goto out; + + if (len > (1 << 22)) + AuDbg("copying a large file %lld\n", (long long)len); + + src->f_pos = 0; + dst->f_pos = 0; + err = au_do_copy_file(dst, src, len, buf, blksize); + if (do_kfree) + kfree(buf); + else + free_page((unsigned long)buf); + +out: + return err; +} + +/* + * to support a sparse file which is opened with O_APPEND, + * we need to close the file. + */ +static int au_cp_regular(struct au_cp_generic *cpg) +{ + int err, i; + enum { SRC, DST }; + struct { + aufs_bindex_t bindex; + unsigned int flags; + struct dentry *dentry; + int force_wr; + struct file *file; + void *label, *label_file; + } *f, file[] = { + { + .bindex = cpg->bsrc, + .flags = O_RDONLY | O_NOATIME | O_LARGEFILE, + .label = &&out, + .label_file = &&out_src + }, + { + .bindex = cpg->bdst, + .flags = O_WRONLY | O_NOATIME | O_LARGEFILE, + .force_wr = !!au_ftest_cpup(cpg->flags, RWDST), + .label = &&out_src, + .label_file = &&out_dst + } + }; + struct super_block *sb; + + /* bsrc branch can be ro/rw. */ + sb = cpg->dentry->d_sb; + f = file; + for (i = 0; i < 2; i++, f++) { + f->dentry = au_h_dptr(cpg->dentry, f->bindex); + f->file = au_h_open(cpg->dentry, f->bindex, f->flags, + /*file*/NULL, f->force_wr); + err = PTR_ERR(f->file); + if (IS_ERR(f->file)) + goto *f->label; + err = -EINVAL; + if (unlikely(!f->file->f_op)) + goto *f->label_file; + } + + /* try stopping to update while we copyup */ + IMustLock(file[SRC].dentry->d_inode); + err = au_copy_file(file[DST].file, file[SRC].file, cpg->len); + +out_dst: + fput(file[DST].file); + au_sbr_put(sb, file[DST].bindex); +out_src: + fput(file[SRC].file); + au_sbr_put(sb, file[SRC].bindex); +out: + return err; +} + +static int au_do_cpup_regular(struct au_cp_generic *cpg, + struct au_cpup_reg_attr *h_src_attr) +{ + int err, rerr; + loff_t l; + struct path h_path; + struct inode *h_src_inode; + + err = 0; + h_src_inode = au_h_iptr(cpg->dentry->d_inode, cpg->bsrc); + l = i_size_read(h_src_inode); + if (cpg->len == -1 || l < cpg->len) + cpg->len = l; + if (cpg->len) { + /* try stopping to update while we are referencing */ + mutex_lock_nested(&h_src_inode->i_mutex, AuLsc_I_CHILD); + au_pin_hdir_unlock(cpg->pin); + + h_path.dentry = au_h_dptr(cpg->dentry, cpg->bsrc); + h_path.mnt = au_sbr_mnt(cpg->dentry->d_sb, cpg->bsrc); + h_src_attr->iflags = h_src_inode->i_flags; + err = vfs_getattr(&h_path, &h_src_attr->st); + if (unlikely(err)) { + mutex_unlock(&h_src_inode->i_mutex); + goto out; + } + h_src_attr->valid = 1; + err = au_cp_regular(cpg); + mutex_unlock(&h_src_inode->i_mutex); + rerr = au_pin_hdir_relock(cpg->pin); + if (!err && rerr) + err = rerr; + } + +out: + return err; +} + +static int au_do_cpup_symlink(struct path *h_path, struct dentry *h_src, + struct inode *h_dir) +{ + int err, symlen; + mm_segment_t old_fs; + union { + char *k; + char __user *u; + } sym; + + err = -ENOSYS; + if (unlikely(!h_src->d_inode->i_op->readlink)) + goto out; + + err = -ENOMEM; + sym.k = (void *)__get_free_page(GFP_NOFS); + if (unlikely(!sym.k)) + goto out; + + /* unnecessary to support mmap_sem since symlink is not mmap-able */ + old_fs = get_fs(); + set_fs(KERNEL_DS); + symlen = h_src->d_inode->i_op->readlink(h_src, sym.u, PATH_MAX); + err = symlen; + set_fs(old_fs); + + if (symlen > 0) { + sym.k[symlen] = 0; + err = vfsub_symlink(h_dir, h_path, sym.k); + } + free_page((unsigned long)sym.k); + +out: + return err; +} + +static noinline_for_stack +int cpup_entry(struct au_cp_generic *cpg, struct dentry *dst_parent, + struct au_cpup_reg_attr *h_src_attr) +{ + int err; + umode_t mode; + unsigned int mnt_flags; + unsigned char isdir, isreg, force; + const unsigned char do_dt = !!au_ftest_cpup(cpg->flags, DTIME); + struct au_dtime dt; + struct path h_path; + struct dentry *h_src, *h_dst, *h_parent; + struct inode *h_inode, *h_dir; + struct super_block *sb; + + /* bsrc branch can be ro/rw. */ + h_src = au_h_dptr(cpg->dentry, cpg->bsrc); + h_inode = h_src->d_inode; + AuDebugOn(h_inode != au_h_iptr(cpg->dentry->d_inode, cpg->bsrc)); + + /* try stopping to be referenced while we are creating */ + h_dst = au_h_dptr(cpg->dentry, cpg->bdst); + if (au_ftest_cpup(cpg->flags, RENAME)) + AuDebugOn(strncmp(h_dst->d_name.name, AUFS_WH_PFX, + AUFS_WH_PFX_LEN)); + h_parent = h_dst->d_parent; /* dir inode is locked */ + h_dir = h_parent->d_inode; + IMustLock(h_dir); + AuDebugOn(h_parent != h_dst->d_parent); + + sb = cpg->dentry->d_sb; + h_path.mnt = au_sbr_mnt(sb, cpg->bdst); + if (do_dt) { + h_path.dentry = h_parent; + au_dtime_store(&dt, dst_parent, &h_path); + } + h_path.dentry = h_dst; + + isreg = 0; + isdir = 0; + mode = h_inode->i_mode; + switch (mode & S_IFMT) { + case S_IFREG: + isreg = 1; + err = vfsub_create(h_dir, &h_path, mode | S_IWUSR, + /*want_excl*/true); + if (!err) + err = au_do_cpup_regular(cpg, h_src_attr); + break; + case S_IFDIR: + isdir = 1; + err = vfsub_mkdir(h_dir, &h_path, mode); + if (!err) { + /* + * strange behaviour from the users view, + * particularry setattr case + */ + if (au_ibstart(dst_parent->d_inode) == cpg->bdst) + au_cpup_attr_nlink(dst_parent->d_inode, + /*force*/1); + au_cpup_attr_nlink(cpg->dentry->d_inode, /*force*/1); + } + break; + case S_IFLNK: + err = au_do_cpup_symlink(&h_path, h_src, h_dir); + break; + case S_IFCHR: + case S_IFBLK: + AuDebugOn(!capable(CAP_MKNOD)); + /*FALLTHROUGH*/ + case S_IFIFO: + case S_IFSOCK: + err = vfsub_mknod(h_dir, &h_path, mode, h_inode->i_rdev); + break; + default: + AuIOErr("Unknown inode type 0%o\n", mode); + err = -EIO; + } + + mnt_flags = au_mntflags(sb); + if (!au_opt_test(mnt_flags, UDBA_NONE) + && !isdir + && au_opt_test(mnt_flags, XINO) + && h_inode->i_nlink == 1 + /* todo: unnecessary? */ + /* && cpg->dentry->d_inode->i_nlink == 1 */ + && cpg->bdst < cpg->bsrc + && !au_ftest_cpup(cpg->flags, KEEPLINO)) + au_xino_write(sb, cpg->bsrc, h_inode->i_ino, /*ino*/0); + /* ignore this error */ + + if (!err) { + force = 0; + if (isreg) { + force = !!cpg->len; + if (cpg->len == -1) + force = !!i_size_read(h_inode); + } + au_fhsm_wrote(sb, cpg->bdst, force); + } + + if (do_dt) + au_dtime_revert(&dt); + return err; +} + +static int au_do_ren_after_cpup(struct au_cp_generic *cpg, struct path *h_path) +{ + int err; + struct dentry *dentry, *h_dentry, *h_parent, *parent; + struct inode *h_dir; + aufs_bindex_t bdst; + + dentry = cpg->dentry; + bdst = cpg->bdst; + h_dentry = au_h_dptr(dentry, bdst); + if (!au_ftest_cpup(cpg->flags, OVERWRITE)) { + dget(h_dentry); + au_set_h_dptr(dentry, bdst, NULL); + err = au_lkup_neg(dentry, bdst, /*wh*/0); + if (!err) + h_path->dentry = dget(au_h_dptr(dentry, bdst)); + au_set_h_dptr(dentry, bdst, h_dentry); + } else { + err = 0; + parent = dget_parent(dentry); + h_parent = au_h_dptr(parent, bdst); + dput(parent); + h_path->dentry = vfsub_lkup_one(&dentry->d_name, h_parent); + if (IS_ERR(h_path->dentry)) + err = PTR_ERR(h_path->dentry); + } + if (unlikely(err)) + goto out; + + h_parent = h_dentry->d_parent; /* dir inode is locked */ + h_dir = h_parent->d_inode; + IMustLock(h_dir); + AuDbg("%.*s %.*s\n", AuDLNPair(h_dentry), AuDLNPair(h_path->dentry)); + err = vfsub_rename(h_dir, h_dentry, h_dir, h_path); + dput(h_path->dentry); + +out: + return err; +} + +/* + * copyup the @dentry from @bsrc to @bdst. + * the caller must set the both of lower dentries. + * @len is for truncating when it is -1 copyup the entire file. + * in link/rename cases, @dst_parent may be different from the real one. + * basic->bsrc can be larger than basic->bdst. + */ +static int au_cpup_single(struct au_cp_generic *cpg, struct dentry *dst_parent) +{ + int err, rerr; + aufs_bindex_t old_ibstart; + unsigned char isdir, plink; + struct dentry *h_src, *h_dst, *h_parent; + struct inode *dst_inode, *h_dir, *inode; + struct super_block *sb; + struct au_branch *br; + /* to reuduce stack size */ + struct { + struct au_dtime dt; + struct path h_path; + struct au_cpup_reg_attr h_src_attr; + } *a; + + err = -ENOMEM; + a = kmalloc(sizeof(*a), GFP_NOFS); + if (unlikely(!a)) + goto out; + a->h_src_attr.valid = 0; + + sb = cpg->dentry->d_sb; + br = au_sbr(sb, cpg->bdst); + a->h_path.mnt = au_br_mnt(br); + h_dst = au_h_dptr(cpg->dentry, cpg->bdst); + h_parent = h_dst->d_parent; /* dir inode is locked */ + h_dir = h_parent->d_inode; + IMustLock(h_dir); + + h_src = au_h_dptr(cpg->dentry, cpg->bsrc); + inode = cpg->dentry->d_inode; + + if (!dst_parent) + dst_parent = dget_parent(cpg->dentry); + else + dget(dst_parent); + + plink = !!au_opt_test(au_mntflags(sb), PLINK); + dst_inode = au_h_iptr(inode, cpg->bdst); + if (dst_inode) { + if (unlikely(!plink)) { + err = -EIO; + AuIOErr("hi%lu(i%lu) exists on b%d " + "but plink is disabled\n", + dst_inode->i_ino, inode->i_ino, cpg->bdst); + goto out_parent; + } + + if (dst_inode->i_nlink) { + const int do_dt = au_ftest_cpup(cpg->flags, DTIME); + + h_src = au_plink_lkup(inode, cpg->bdst); + err = PTR_ERR(h_src); + if (IS_ERR(h_src)) + goto out_parent; + if (unlikely(!h_src->d_inode)) { + err = -EIO; + AuIOErr("i%lu exists on a upper branch " + "but not pseudo-linked\n", + inode->i_ino); + dput(h_src); + goto out_parent; + } + + if (do_dt) { + a->h_path.dentry = h_parent; + au_dtime_store(&a->dt, dst_parent, &a->h_path); + } + + a->h_path.dentry = h_dst; + err = vfsub_link(h_src, h_dir, &a->h_path); + if (!err && au_ftest_cpup(cpg->flags, RENAME)) + err = au_do_ren_after_cpup(cpg, &a->h_path); + if (do_dt) + au_dtime_revert(&a->dt); + dput(h_src); + goto out_parent; + } else + /* todo: cpup_wh_file? */ + /* udba work */ + au_update_ibrange(inode, /*do_put_zero*/1); + } + + isdir = S_ISDIR(inode->i_mode); + old_ibstart = au_ibstart(inode); + err = cpup_entry(cpg, dst_parent, &a->h_src_attr); + if (unlikely(err)) + goto out_rev; + dst_inode = h_dst->d_inode; + mutex_lock_nested(&dst_inode->i_mutex, AuLsc_I_CHILD2); + /* todo: necessary? */ + /* au_pin_hdir_unlock(cpg->pin); */ + + err = cpup_iattr(cpg->dentry, cpg->bdst, h_src, &a->h_src_attr); + if (unlikely(err)) { + /* todo: necessary? */ + /* au_pin_hdir_relock(cpg->pin); */ /* ignore an error */ + mutex_unlock(&dst_inode->i_mutex); + goto out_rev; + } + + if (cpg->bdst < old_ibstart) { + if (S_ISREG(inode->i_mode)) { + err = au_dy_iaop(inode, cpg->bdst, dst_inode); + if (unlikely(err)) { + /* ignore an error */ + /* au_pin_hdir_relock(cpg->pin); */ + mutex_unlock(&dst_inode->i_mutex); + goto out_rev; + } + } + au_set_ibstart(inode, cpg->bdst); + } else + au_set_ibend(inode, cpg->bdst); + au_set_h_iptr(inode, cpg->bdst, au_igrab(dst_inode), + au_hi_flags(inode, isdir)); + + /* todo: necessary? */ + /* err = au_pin_hdir_relock(cpg->pin); */ + mutex_unlock(&dst_inode->i_mutex); + if (unlikely(err)) + goto out_rev; + + if (!isdir + && h_src->d_inode->i_nlink > 1 + && plink) + au_plink_append(inode, cpg->bdst, h_dst); + + if (au_ftest_cpup(cpg->flags, RENAME)) { + a->h_path.dentry = h_dst; + err = au_do_ren_after_cpup(cpg, &a->h_path); + } + if (!err) + goto out_parent; /* success */ + + /* revert */ +out_rev: + a->h_path.dentry = h_parent; + au_dtime_store(&a->dt, dst_parent, &a->h_path); + a->h_path.dentry = h_dst; + rerr = 0; + if (h_dst->d_inode) { + if (!isdir) + rerr = vfsub_unlink(h_dir, &a->h_path, /*force*/0); + else + rerr = vfsub_rmdir(h_dir, &a->h_path); + } + au_dtime_revert(&a->dt); + if (rerr) { + AuIOErr("failed removing broken entry(%d, %d)\n", err, rerr); + err = -EIO; + } +out_parent: + dput(dst_parent); + kfree(a); +out: + return err; +} + +#if 0 /* unused */ +struct au_cpup_single_args { + int *errp; + struct au_cp_generic *cpg; + struct dentry *dst_parent; +}; + +static void au_call_cpup_single(void *args) +{ + struct au_cpup_single_args *a = args; + + au_pin_hdir_acquire_nest(a->cpg->pin); + *a->errp = au_cpup_single(a->cpg, a->dst_parent); + au_pin_hdir_release(a->cpg->pin); +} +#endif + +/* + * prevent SIGXFSZ in copy-up. + * testing CAP_MKNOD is for generic fs, + * but CAP_FSETID is for xfs only, currently. + */ +static int au_cpup_sio_test(struct au_pin *pin, umode_t mode) +{ + int do_sio; + struct super_block *sb; + struct inode *h_dir; + + do_sio = 0; + sb = au_pinned_parent(pin)->d_sb; + if (!au_wkq_test() + && (!au_sbi(sb)->si_plink_maint_pid + || au_plink_maint(sb, AuLock_NOPLM))) { + switch (mode & S_IFMT) { + case S_IFREG: + /* no condition about RLIMIT_FSIZE and the file size */ + do_sio = 1; + break; + case S_IFCHR: + case S_IFBLK: + do_sio = !capable(CAP_MKNOD); + break; + } + if (!do_sio) + do_sio = ((mode & (S_ISUID | S_ISGID)) + && !capable(CAP_FSETID)); + /* this workaround may be removed in the future */ + if (!do_sio) { + h_dir = au_pinned_h_dir(pin); + do_sio = h_dir->i_mode & S_ISVTX; + } + } + + return do_sio; +} + +#if 0 /* unused */ +int au_sio_cpup_single(struct au_cp_generic *cpg, struct dentry *dst_parent) +{ + int err, wkq_err; + struct dentry *h_dentry; + + h_dentry = au_h_dptr(cpg->dentry, cpg->bsrc); + if (!au_cpup_sio_test(pin, h_dentry->d_inode->i_mode)) + err = au_cpup_single(cpg, dst_parent); + else { + struct au_cpup_single_args args = { + .errp = &err, + .cpg = cpg, + .dst_parent = dst_parent + }; + wkq_err = au_wkq_wait(au_call_cpup_single, &args); + if (unlikely(wkq_err)) + err = wkq_err; + } + + return err; +} +#endif + +/* + * copyup the @dentry from the first active lower branch to @bdst, + * using au_cpup_single(). + */ +static int au_cpup_simple(struct au_cp_generic *cpg) +{ + int err; + unsigned int flags_orig; + struct dentry *dentry; + + AuDebugOn(cpg->bsrc < 0); + + dentry = cpg->dentry; + DiMustWriteLock(dentry); + + err = au_lkup_neg(dentry, cpg->bdst, /*wh*/1); + if (!err) { + flags_orig = cpg->flags; + au_fset_cpup(cpg->flags, RENAME); + err = au_cpup_single(cpg, NULL); + cpg->flags = flags_orig; + if (!err) + return 0; /* success */ + + /* revert */ + au_set_h_dptr(dentry, cpg->bdst, NULL); + au_set_dbstart(dentry, cpg->bsrc); + } + + return err; +} + +struct au_cpup_simple_args { + int *errp; + struct au_cp_generic *cpg; +}; + +static void au_call_cpup_simple(void *args) +{ + struct au_cpup_simple_args *a = args; + + au_pin_hdir_acquire_nest(a->cpg->pin); + *a->errp = au_cpup_simple(a->cpg); + au_pin_hdir_release(a->cpg->pin); +} + +static int au_do_sio_cpup_simple(struct au_cp_generic *cpg) +{ + int err, wkq_err; + struct dentry *dentry, *parent; + struct file *h_file; + struct inode *h_dir; + + dentry = cpg->dentry; + h_file = NULL; + if (au_ftest_cpup(cpg->flags, HOPEN)) { + AuDebugOn(cpg->bsrc < 0); + h_file = au_h_open_pre(dentry, cpg->bsrc, /*force_wr*/0); + err = PTR_ERR(h_file); + if (IS_ERR(h_file)) + goto out; + } + + parent = dget_parent(dentry); + h_dir = au_h_iptr(parent->d_inode, cpg->bdst); + if (!au_test_h_perm_sio(h_dir, MAY_EXEC | MAY_WRITE) + && !au_cpup_sio_test(cpg->pin, dentry->d_inode->i_mode)) + err = au_cpup_simple(cpg); + else { + struct au_cpup_simple_args args = { + .errp = &err, + .cpg = cpg + }; + wkq_err = au_wkq_wait(au_call_cpup_simple, &args); + if (unlikely(wkq_err)) + err = wkq_err; + } + + dput(parent); + if (h_file) + au_h_open_post(dentry, cpg->bsrc, h_file); + +out: + return err; +} + +int au_sio_cpup_simple(struct au_cp_generic *cpg) +{ + aufs_bindex_t bsrc, bend; + struct dentry *dentry, *h_dentry; + + if (cpg->bsrc < 0) { + dentry = cpg->dentry; + bend = au_dbend(dentry); + for (bsrc = cpg->bdst + 1; bsrc <= bend; bsrc++) { + h_dentry = au_h_dptr(dentry, bsrc); + if (h_dentry) { + AuDebugOn(!h_dentry->d_inode); + break; + } + } + AuDebugOn(bsrc > bend); + cpg->bsrc = bsrc; + } + AuDebugOn(cpg->bsrc <= cpg->bdst); + return au_do_sio_cpup_simple(cpg); +} + +int au_sio_cpdown_simple(struct au_cp_generic *cpg) +{ + AuDebugOn(cpg->bdst <= cpg->bsrc); + return au_do_sio_cpup_simple(cpg); +} + +/* ---------------------------------------------------------------------- */ + +/* + * copyup the deleted file for writing. + */ +static int au_do_cpup_wh(struct au_cp_generic *cpg, struct dentry *wh_dentry, + struct file *file) +{ + int err; + unsigned int flags_orig; + aufs_bindex_t bsrc_orig; + struct dentry *h_d_dst, *h_d_start; + struct au_dinfo *dinfo; + struct au_hdentry *hdp; + + dinfo = au_di(cpg->dentry); + AuRwMustWriteLock(&dinfo->di_rwsem); + + bsrc_orig = cpg->bsrc; + cpg->bsrc = dinfo->di_bstart; + hdp = dinfo->di_hdentry; + h_d_dst = hdp[0 + cpg->bdst].hd_dentry; + dinfo->di_bstart = cpg->bdst; + hdp[0 + cpg->bdst].hd_dentry = wh_dentry; + h_d_start = NULL; + if (file) { + h_d_start = hdp[0 + cpg->bsrc].hd_dentry; + hdp[0 + cpg->bsrc].hd_dentry = au_hf_top(file)->f_dentry; + } + flags_orig = cpg->flags; + cpg->flags = !AuCpup_DTIME; + err = au_cpup_single(cpg, /*h_parent*/NULL); + cpg->flags = flags_orig; + if (file) { + if (!err) + err = au_reopen_nondir(file); + hdp[0 + cpg->bsrc].hd_dentry = h_d_start; + } + hdp[0 + cpg->bdst].hd_dentry = h_d_dst; + dinfo->di_bstart = cpg->bsrc; + cpg->bsrc = bsrc_orig; + + return err; +} + +static int au_cpup_wh(struct au_cp_generic *cpg, struct file *file) +{ + int err; + aufs_bindex_t bdst; + struct au_dtime dt; + struct dentry *dentry, *parent, *h_parent, *wh_dentry; + struct au_branch *br; + struct path h_path; + + dentry = cpg->dentry; + bdst = cpg->bdst; + br = au_sbr(dentry->d_sb, bdst); + parent = dget_parent(dentry); + h_parent = au_h_dptr(parent, bdst); + wh_dentry = au_whtmp_lkup(h_parent, br, &dentry->d_name); + err = PTR_ERR(wh_dentry); + if (IS_ERR(wh_dentry)) + goto out; + + h_path.dentry = h_parent; + h_path.mnt = au_br_mnt(br); + au_dtime_store(&dt, parent, &h_path); + err = au_do_cpup_wh(cpg, wh_dentry, file); + if (unlikely(err)) + goto out_wh; + + dget(wh_dentry); + h_path.dentry = wh_dentry; + if (!S_ISDIR(wh_dentry->d_inode->i_mode)) + err = vfsub_unlink(h_parent->d_inode, &h_path, /*force*/0); + else + err = vfsub_rmdir(h_parent->d_inode, &h_path); + if (unlikely(err)) { + AuIOErr("failed remove copied-up tmp file %.*s(%d)\n", + AuDLNPair(wh_dentry), err); + err = -EIO; + } + au_dtime_revert(&dt); + au_set_hi_wh(dentry->d_inode, bdst, wh_dentry); + +out_wh: + dput(wh_dentry); +out: + dput(parent); + return err; +} + +struct au_cpup_wh_args { + int *errp; + struct au_cp_generic *cpg; + struct file *file; +}; + +static void au_call_cpup_wh(void *args) +{ + struct au_cpup_wh_args *a = args; + + au_pin_hdir_acquire_nest(a->cpg->pin); + *a->errp = au_cpup_wh(a->cpg, a->file); + au_pin_hdir_release(a->cpg->pin); +} + +int au_sio_cpup_wh(struct au_cp_generic *cpg, struct file *file) +{ + int err, wkq_err; + aufs_bindex_t bdst; + struct dentry *dentry, *parent, *h_orph, *h_parent, *h_dentry; + struct inode *dir, *h_dir, *h_tmpdir; + struct au_wbr *wbr; + struct au_pin wh_pin, *pin_orig; + + dentry = cpg->dentry; + bdst = cpg->bdst; + parent = dget_parent(dentry); + dir = parent->d_inode; + h_orph = NULL; + h_parent = NULL; + h_dir = au_igrab(au_h_iptr(dir, bdst)); + h_tmpdir = h_dir; + pin_orig = NULL; + if (!h_dir->i_nlink) { + wbr = au_sbr(dentry->d_sb, bdst)->br_wbr; + h_orph = wbr->wbr_orph; + + h_parent = dget(au_h_dptr(parent, bdst)); + au_set_h_dptr(parent, bdst, dget(h_orph)); + h_tmpdir = h_orph->d_inode; + au_set_h_iptr(dir, bdst, au_igrab(h_tmpdir), /*flags*/0); + + if (file) + h_dentry = au_hf_top(file)->f_dentry; + else + h_dentry = au_h_dptr(dentry, au_dbstart(dentry)); + mutex_lock_nested(&h_tmpdir->i_mutex, AuLsc_I_PARENT3); + /* todo: au_h_open_pre()? */ + + pin_orig = cpg->pin; + au_pin_init(&wh_pin, dentry, bdst, AuLsc_DI_PARENT, + AuLsc_I_PARENT3, cpg->pin->udba, AuPin_DI_LOCKED); + cpg->pin = &wh_pin; + } + + if (!au_test_h_perm_sio(h_tmpdir, MAY_EXEC | MAY_WRITE) + && !au_cpup_sio_test(cpg->pin, dentry->d_inode->i_mode)) + err = au_cpup_wh(cpg, file); + else { + struct au_cpup_wh_args args = { + .errp = &err, + .cpg = cpg, + .file = file + }; + wkq_err = au_wkq_wait(au_call_cpup_wh, &args); + if (unlikely(wkq_err)) + err = wkq_err; + } + + if (h_orph) { + mutex_unlock(&h_tmpdir->i_mutex); + /* todo: au_h_open_post()? */ + au_set_h_iptr(dir, bdst, au_igrab(h_dir), /*flags*/0); + au_set_h_dptr(parent, bdst, h_parent); + AuDebugOn(!pin_orig); + cpg->pin = pin_orig; + } + iput(h_dir); + dput(parent); + + return err; +} + +/* ---------------------------------------------------------------------- */ + +/* + * generic routine for both of copy-up and copy-down. + */ +/* cf. revalidate function in file.c */ +int au_cp_dirs(struct dentry *dentry, aufs_bindex_t bdst, + int (*cp)(struct dentry *dentry, aufs_bindex_t bdst, + struct au_pin *pin, + struct dentry *h_parent, void *arg), + void *arg) +{ + int err; + struct au_pin pin; + struct dentry *d, *parent, *h_parent, *real_parent; + + err = 0; + parent = dget_parent(dentry); + if (IS_ROOT(parent)) + goto out; + + au_pin_init(&pin, dentry, bdst, AuLsc_DI_PARENT2, AuLsc_I_PARENT2, + au_opt_udba(dentry->d_sb), AuPin_MNT_WRITE); + + /* do not use au_dpage */ + real_parent = parent; + while (1) { + dput(parent); + parent = dget_parent(dentry); + h_parent = au_h_dptr(parent, bdst); + if (h_parent) + goto out; /* success */ + + /* find top dir which is necessary to cpup */ + do { + d = parent; + dput(parent); + parent = dget_parent(d); + di_read_lock_parent3(parent, !AuLock_IR); + h_parent = au_h_dptr(parent, bdst); + di_read_unlock(parent, !AuLock_IR); + } while (!h_parent); + + if (d != real_parent) + di_write_lock_child3(d); + + /* somebody else might create while we were sleeping */ + if (!au_h_dptr(d, bdst) || !au_h_dptr(d, bdst)->d_inode) { + if (au_h_dptr(d, bdst)) + au_update_dbstart(d); + + au_pin_set_dentry(&pin, d); + err = au_do_pin(&pin); + if (!err) { + err = cp(d, bdst, &pin, h_parent, arg); + au_unpin(&pin); + } + } + + if (d != real_parent) + di_write_unlock(d); + if (unlikely(err)) + break; + } + +out: + dput(parent); + return err; +} + +static int au_cpup_dir(struct dentry *dentry, aufs_bindex_t bdst, + struct au_pin *pin, + struct dentry *h_parent __maybe_unused , + void *arg __maybe_unused) +{ + struct au_cp_generic cpg = { + .dentry = dentry, + .bdst = bdst, + .bsrc = -1, + .len = 0, + .pin = pin, + .flags = AuCpup_DTIME + }; + return au_sio_cpup_simple(&cpg); +} + +int au_cpup_dirs(struct dentry *dentry, aufs_bindex_t bdst) +{ + return au_cp_dirs(dentry, bdst, au_cpup_dir, NULL); +} + +int au_test_and_cpup_dirs(struct dentry *dentry, aufs_bindex_t bdst) +{ + int err; + struct dentry *parent; + struct inode *dir; + + parent = dget_parent(dentry); + dir = parent->d_inode; + err = 0; + if (au_h_iptr(dir, bdst)) + goto out; + + di_read_unlock(parent, AuLock_IR); + di_write_lock_parent(parent); + /* someone else might change our inode while we were sleeping */ + if (!au_h_iptr(dir, bdst)) + err = au_cpup_dirs(dentry, bdst); + di_downgrade_lock(parent, AuLock_IR); + +out: + dput(parent); + return err; +} diff --git a/fs/aufs/cpup.h b/fs/aufs/cpup.h new file mode 100644 index 00000000000000..563ca3c9f26d93 --- /dev/null +++ b/fs/aufs/cpup.h @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * copy-up/down functions + */ + +#ifndef __AUFS_CPUP_H__ +#define __AUFS_CPUP_H__ + +#ifdef __KERNEL__ + +#include + +struct inode; +struct file; +struct au_pin; + +void au_cpup_attr_flags(struct inode *dst, unsigned int iflags); +void au_cpup_attr_timesizes(struct inode *inode); +void au_cpup_attr_nlink(struct inode *inode, int force); +void au_cpup_attr_changeable(struct inode *inode); +void au_cpup_igen(struct inode *inode, struct inode *h_inode); +void au_cpup_attr_all(struct inode *inode, int force); + +/* ---------------------------------------------------------------------- */ + +struct au_cp_generic { + struct dentry *dentry; + aufs_bindex_t bdst, bsrc; + loff_t len; + struct au_pin *pin; + unsigned int flags; +}; + +/* cpup flags */ +#define AuCpup_DTIME 1 /* do dtime_store/revert */ +#define AuCpup_KEEPLINO (1 << 1) /* do not clear the lower xino, + for link(2) */ +#define AuCpup_RENAME (1 << 2) /* rename after cpup */ +#define AuCpup_HOPEN (1 << 3) /* call h_open_pre/post() in + cpup */ +#define AuCpup_OVERWRITE (1 << 4) /* allow overwriting the + existing entry */ +#define AuCpup_RWDST (1 << 5) /* force write target even if + the branch is marked as RO */ + +#define au_ftest_cpup(flags, name) ((flags) & AuCpup_##name) +#define au_fset_cpup(flags, name) \ + do { (flags) |= AuCpup_##name; } while (0) +#define au_fclr_cpup(flags, name) \ + do { (flags) &= ~AuCpup_##name; } while (0) + +int au_copy_file(struct file *dst, struct file *src, loff_t len); +int au_sio_cpup_simple(struct au_cp_generic *cpg); +int au_sio_cpdown_simple(struct au_cp_generic *cpg); +int au_sio_cpup_wh(struct au_cp_generic *cpg, struct file *file); + +int au_cp_dirs(struct dentry *dentry, aufs_bindex_t bdst, + int (*cp)(struct dentry *dentry, aufs_bindex_t bdst, + struct au_pin *pin, + struct dentry *h_parent, void *arg), + void *arg); +int au_cpup_dirs(struct dentry *dentry, aufs_bindex_t bdst); +int au_test_and_cpup_dirs(struct dentry *dentry, aufs_bindex_t bdst); + +/* ---------------------------------------------------------------------- */ + +/* keep timestamps when copyup */ +struct au_dtime { + struct dentry *dt_dentry; + struct path dt_h_path; + struct timespec dt_atime, dt_mtime; +}; +void au_dtime_store(struct au_dtime *dt, struct dentry *dentry, + struct path *h_path); +void au_dtime_revert(struct au_dtime *dt); + +#endif /* __KERNEL__ */ +#endif /* __AUFS_CPUP_H__ */ diff --git a/fs/aufs/dbgaufs.c b/fs/aufs/dbgaufs.c new file mode 100644 index 00000000000000..eef7249ce51daa --- /dev/null +++ b/fs/aufs/dbgaufs.c @@ -0,0 +1,432 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * debugfs interface + */ + +#include +#include "aufs.h" + +#ifndef CONFIG_SYSFS +#error DEBUG_FS depends upon SYSFS +#endif + +static struct dentry *dbgaufs; +static const mode_t dbgaufs_mode = S_IRUSR | S_IRGRP | S_IROTH; + +/* 20 is max digits length of ulong 64 */ +struct dbgaufs_arg { + int n; + char a[20 * 4]; +}; + +/* + * common function for all XINO files + */ +static int dbgaufs_xi_release(struct inode *inode __maybe_unused, + struct file *file) +{ + kfree(file->private_data); + return 0; +} + +static int dbgaufs_xi_open(struct file *xf, struct file *file, int do_fcnt) +{ + int err; + struct kstat st; + struct dbgaufs_arg *p; + + err = -ENOMEM; + p = kmalloc(sizeof(*p), GFP_NOFS); + if (unlikely(!p)) + goto out; + + err = 0; + p->n = 0; + file->private_data = p; + if (!xf) + goto out; + + err = vfs_getattr(&xf->f_path, &st); + if (!err) { + if (do_fcnt) + p->n = snprintf + (p->a, sizeof(p->a), "%ld, %llux%lu %lld\n", + (long)file_count(xf), st.blocks, st.blksize, + (long long)st.size); + else + p->n = snprintf(p->a, sizeof(p->a), "%llux%lu %lld\n", + st.blocks, st.blksize, + (long long)st.size); + AuDebugOn(p->n >= sizeof(p->a)); + } else { + p->n = snprintf(p->a, sizeof(p->a), "err %d\n", err); + err = 0; + } + +out: + return err; + +} + +static ssize_t dbgaufs_xi_read(struct file *file, char __user *buf, + size_t count, loff_t *ppos) +{ + struct dbgaufs_arg *p; + + p = file->private_data; + return simple_read_from_buffer(buf, count, ppos, p->a, p->n); +} + +/* ---------------------------------------------------------------------- */ + +struct dbgaufs_plink_arg { + int n; + char a[]; +}; + +static int dbgaufs_plink_release(struct inode *inode __maybe_unused, + struct file *file) +{ + free_page((unsigned long)file->private_data); + return 0; +} + +static int dbgaufs_plink_open(struct inode *inode, struct file *file) +{ + int err, i, limit; + unsigned long n, sum; + struct dbgaufs_plink_arg *p; + struct au_sbinfo *sbinfo; + struct super_block *sb; + struct au_sphlhead *sphl; + + err = -ENOMEM; + p = (void *)get_zeroed_page(GFP_NOFS); + if (unlikely(!p)) + goto out; + + err = -EFBIG; + sbinfo = inode->i_private; + sb = sbinfo->si_sb; + si_noflush_read_lock(sb); + if (au_opt_test(au_mntflags(sb), PLINK)) { + limit = PAGE_SIZE - sizeof(p->n); + + /* the number of buckets */ + n = snprintf(p->a + p->n, limit, "%d\n", AuPlink_NHASH); + p->n += n; + limit -= n; + + sum = 0; + for (i = 0, sphl = sbinfo->si_plink; + i < AuPlink_NHASH; + i++, sphl++) { + n = au_sphl_count(sphl); + sum += n; + + n = snprintf(p->a + p->n, limit, "%lu ", n); + p->n += n; + limit -= n; + if (unlikely(limit <= 0)) + goto out_free; + } + p->a[p->n - 1] = '\n'; + + /* the sum of plinks */ + n = snprintf(p->a + p->n, limit, "%lu\n", sum); + p->n += n; + limit -= n; + if (unlikely(limit <= 0)) + goto out_free; + } else { +#define str "1\n0\n0\n" + p->n = sizeof(str) - 1; + strcpy(p->a, str); +#undef str + } + si_read_unlock(sb); + + err = 0; + file->private_data = p; + goto out; /* success */ + +out_free: + free_page((unsigned long)p); +out: + return err; +} + +static ssize_t dbgaufs_plink_read(struct file *file, char __user *buf, + size_t count, loff_t *ppos) +{ + struct dbgaufs_plink_arg *p; + + p = file->private_data; + return simple_read_from_buffer(buf, count, ppos, p->a, p->n); +} + +static const struct file_operations dbgaufs_plink_fop = { + .owner = THIS_MODULE, + .open = dbgaufs_plink_open, + .release = dbgaufs_plink_release, + .read = dbgaufs_plink_read +}; + +/* ---------------------------------------------------------------------- */ + +static int dbgaufs_xib_open(struct inode *inode, struct file *file) +{ + int err; + struct au_sbinfo *sbinfo; + struct super_block *sb; + + sbinfo = inode->i_private; + sb = sbinfo->si_sb; + si_noflush_read_lock(sb); + err = dbgaufs_xi_open(sbinfo->si_xib, file, /*do_fcnt*/0); + si_read_unlock(sb); + return err; +} + +static const struct file_operations dbgaufs_xib_fop = { + .owner = THIS_MODULE, + .open = dbgaufs_xib_open, + .release = dbgaufs_xi_release, + .read = dbgaufs_xi_read +}; + +/* ---------------------------------------------------------------------- */ + +#define DbgaufsXi_PREFIX "xi" + +static int dbgaufs_xino_open(struct inode *inode, struct file *file) +{ + int err; + long l; + struct au_sbinfo *sbinfo; + struct super_block *sb; + struct file *xf; + struct qstr *name; + + err = -ENOENT; + xf = NULL; + name = &file->f_dentry->d_name; + if (unlikely(name->len < sizeof(DbgaufsXi_PREFIX) + || memcmp(name->name, DbgaufsXi_PREFIX, + sizeof(DbgaufsXi_PREFIX) - 1))) + goto out; + err = kstrtol(name->name + sizeof(DbgaufsXi_PREFIX) - 1, 10, &l); + if (unlikely(err)) + goto out; + + sbinfo = inode->i_private; + sb = sbinfo->si_sb; + si_noflush_read_lock(sb); + if (l <= au_sbend(sb)) { + xf = au_sbr(sb, (aufs_bindex_t)l)->br_xino.xi_file; + err = dbgaufs_xi_open(xf, file, /*do_fcnt*/1); + } else + err = -ENOENT; + si_read_unlock(sb); + +out: + return err; +} + +static const struct file_operations dbgaufs_xino_fop = { + .owner = THIS_MODULE, + .open = dbgaufs_xino_open, + .release = dbgaufs_xi_release, + .read = dbgaufs_xi_read +}; + +void dbgaufs_brs_del(struct super_block *sb, aufs_bindex_t bindex) +{ + aufs_bindex_t bend; + struct au_branch *br; + struct au_xino_file *xi; + + if (!au_sbi(sb)->si_dbgaufs) + return; + + bend = au_sbend(sb); + for (; bindex <= bend; bindex++) { + br = au_sbr(sb, bindex); + xi = &br->br_xino; + debugfs_remove(xi->xi_dbgaufs); + xi->xi_dbgaufs = NULL; + } +} + +void dbgaufs_brs_add(struct super_block *sb, aufs_bindex_t bindex) +{ + struct au_sbinfo *sbinfo; + struct dentry *parent; + struct au_branch *br; + struct au_xino_file *xi; + aufs_bindex_t bend; + char name[sizeof(DbgaufsXi_PREFIX) + 5]; /* "xi" bindex NULL */ + + sbinfo = au_sbi(sb); + parent = sbinfo->si_dbgaufs; + if (!parent) + return; + + bend = au_sbend(sb); + for (; bindex <= bend; bindex++) { + snprintf(name, sizeof(name), DbgaufsXi_PREFIX "%d", bindex); + br = au_sbr(sb, bindex); + xi = &br->br_xino; + AuDebugOn(xi->xi_dbgaufs); + xi->xi_dbgaufs = debugfs_create_file(name, dbgaufs_mode, parent, + sbinfo, &dbgaufs_xino_fop); + /* ignore an error */ + if (unlikely(!xi->xi_dbgaufs)) + AuWarn1("failed %s under debugfs\n", name); + } +} + +/* ---------------------------------------------------------------------- */ + +#ifdef CONFIG_AUFS_EXPORT +static int dbgaufs_xigen_open(struct inode *inode, struct file *file) +{ + int err; + struct au_sbinfo *sbinfo; + struct super_block *sb; + + sbinfo = inode->i_private; + sb = sbinfo->si_sb; + si_noflush_read_lock(sb); + err = dbgaufs_xi_open(sbinfo->si_xigen, file, /*do_fcnt*/0); + si_read_unlock(sb); + return err; +} + +static const struct file_operations dbgaufs_xigen_fop = { + .owner = THIS_MODULE, + .open = dbgaufs_xigen_open, + .release = dbgaufs_xi_release, + .read = dbgaufs_xi_read +}; + +static int dbgaufs_xigen_init(struct au_sbinfo *sbinfo) +{ + int err; + + /* + * This function is a dynamic '__init' function actually, + * so the tiny check for si_rwsem is unnecessary. + */ + /* AuRwMustWriteLock(&sbinfo->si_rwsem); */ + + err = -EIO; + sbinfo->si_dbgaufs_xigen = debugfs_create_file + ("xigen", dbgaufs_mode, sbinfo->si_dbgaufs, sbinfo, + &dbgaufs_xigen_fop); + if (sbinfo->si_dbgaufs_xigen) + err = 0; + + return err; +} +#else +static int dbgaufs_xigen_init(struct au_sbinfo *sbinfo) +{ + return 0; +} +#endif /* CONFIG_AUFS_EXPORT */ + +/* ---------------------------------------------------------------------- */ + +void dbgaufs_si_fin(struct au_sbinfo *sbinfo) +{ + /* + * This function is a dynamic '__init' function actually, + * so the tiny check for si_rwsem is unnecessary. + */ + /* AuRwMustWriteLock(&sbinfo->si_rwsem); */ + + debugfs_remove_recursive(sbinfo->si_dbgaufs); + sbinfo->si_dbgaufs = NULL; + kobject_put(&sbinfo->si_kobj); +} + +int dbgaufs_si_init(struct au_sbinfo *sbinfo) +{ + int err; + char name[SysaufsSiNameLen]; + + /* + * This function is a dynamic '__init' function actually, + * so the tiny check for si_rwsem is unnecessary. + */ + /* AuRwMustWriteLock(&sbinfo->si_rwsem); */ + + err = -ENOENT; + if (!dbgaufs) { + AuErr1("/debug/aufs is uninitialized\n"); + goto out; + } + + err = -EIO; + sysaufs_name(sbinfo, name); + sbinfo->si_dbgaufs = debugfs_create_dir(name, dbgaufs); + if (unlikely(!sbinfo->si_dbgaufs)) + goto out; + kobject_get(&sbinfo->si_kobj); + + sbinfo->si_dbgaufs_xib = debugfs_create_file + ("xib", dbgaufs_mode, sbinfo->si_dbgaufs, sbinfo, + &dbgaufs_xib_fop); + if (unlikely(!sbinfo->si_dbgaufs_xib)) + goto out_dir; + + sbinfo->si_dbgaufs_plink = debugfs_create_file + ("plink", dbgaufs_mode, sbinfo->si_dbgaufs, sbinfo, + &dbgaufs_plink_fop); + if (unlikely(!sbinfo->si_dbgaufs_plink)) + goto out_dir; + + err = dbgaufs_xigen_init(sbinfo); + if (!err) + goto out; /* success */ + +out_dir: + dbgaufs_si_fin(sbinfo); +out: + return err; +} + +/* ---------------------------------------------------------------------- */ + +void dbgaufs_fin(void) +{ + debugfs_remove(dbgaufs); +} + +int __init dbgaufs_init(void) +{ + int err; + + err = -EIO; + dbgaufs = debugfs_create_dir(AUFS_NAME, NULL); + if (dbgaufs) + err = 0; + return err; +} diff --git a/fs/aufs/dbgaufs.h b/fs/aufs/dbgaufs.h new file mode 100644 index 00000000000000..ed79f6eefe6821 --- /dev/null +++ b/fs/aufs/dbgaufs.h @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * debugfs interface + */ + +#ifndef __DBGAUFS_H__ +#define __DBGAUFS_H__ + +#ifdef __KERNEL__ + +struct super_block; +struct au_sbinfo; + +#ifdef CONFIG_DEBUG_FS +/* dbgaufs.c */ +void dbgaufs_brs_del(struct super_block *sb, aufs_bindex_t bindex); +void dbgaufs_brs_add(struct super_block *sb, aufs_bindex_t bindex); +void dbgaufs_si_fin(struct au_sbinfo *sbinfo); +int dbgaufs_si_init(struct au_sbinfo *sbinfo); +void dbgaufs_fin(void); +int __init dbgaufs_init(void); +#else +AuStubVoid(dbgaufs_brs_del, struct super_block *sb, aufs_bindex_t bindex) +AuStubVoid(dbgaufs_brs_add, struct super_block *sb, aufs_bindex_t bindex) +AuStubVoid(dbgaufs_si_fin, struct au_sbinfo *sbinfo) +AuStubInt0(dbgaufs_si_init, struct au_sbinfo *sbinfo) +AuStubVoid(dbgaufs_fin, void) +AuStubInt0(__init dbgaufs_init, void) +#endif /* CONFIG_DEBUG_FS */ + +#endif /* __KERNEL__ */ +#endif /* __DBGAUFS_H__ */ diff --git a/fs/aufs/dcsub.c b/fs/aufs/dcsub.c new file mode 100644 index 00000000000000..2be517ee9e55ca --- /dev/null +++ b/fs/aufs/dcsub.c @@ -0,0 +1,242 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * sub-routines for dentry cache + */ + +#include "aufs.h" + +static void au_dpage_free(struct au_dpage *dpage) +{ + int i; + struct dentry **p; + + p = dpage->dentries; + for (i = 0; i < dpage->ndentry; i++) + dput(*p++); + free_page((unsigned long)dpage->dentries); +} + +int au_dpages_init(struct au_dcsub_pages *dpages, gfp_t gfp) +{ + int err; + void *p; + + err = -ENOMEM; + dpages->dpages = kmalloc(sizeof(*dpages->dpages), gfp); + if (unlikely(!dpages->dpages)) + goto out; + + p = (void *)__get_free_page(gfp); + if (unlikely(!p)) + goto out_dpages; + + dpages->dpages[0].ndentry = 0; + dpages->dpages[0].dentries = p; + dpages->ndpage = 1; + return 0; /* success */ + +out_dpages: + kfree(dpages->dpages); +out: + return err; +} + +void au_dpages_free(struct au_dcsub_pages *dpages) +{ + int i; + struct au_dpage *p; + + p = dpages->dpages; + for (i = 0; i < dpages->ndpage; i++) + au_dpage_free(p++); + kfree(dpages->dpages); +} + +static int au_dpages_append(struct au_dcsub_pages *dpages, + struct dentry *dentry, gfp_t gfp) +{ + int err, sz; + struct au_dpage *dpage; + void *p; + + dpage = dpages->dpages + dpages->ndpage - 1; + sz = PAGE_SIZE / sizeof(dentry); + if (unlikely(dpage->ndentry >= sz)) { + AuLabel(new dpage); + err = -ENOMEM; + sz = dpages->ndpage * sizeof(*dpages->dpages); + p = au_kzrealloc(dpages->dpages, sz, + sz + sizeof(*dpages->dpages), gfp); + if (unlikely(!p)) + goto out; + + dpages->dpages = p; + dpage = dpages->dpages + dpages->ndpage; + p = (void *)__get_free_page(gfp); + if (unlikely(!p)) + goto out; + + dpage->ndentry = 0; + dpage->dentries = p; + dpages->ndpage++; + } + + AuDebugOn(!dentry->d_count); + dpage->dentries[dpage->ndentry++] = dget_dlock(dentry); + return 0; /* success */ + +out: + return err; +} + +int au_dcsub_pages(struct au_dcsub_pages *dpages, struct dentry *root, + au_dpages_test test, void *arg) +{ + int err; + struct dentry *this_parent; + struct list_head *next; + struct super_block *sb = root->d_sb; + + err = 0; + write_seqlock(&rename_lock); + this_parent = root; + spin_lock(&this_parent->d_lock); +repeat: + next = this_parent->d_subdirs.next; +resume: + if (this_parent->d_sb == sb + && !IS_ROOT(this_parent) + && au_di(this_parent) + && this_parent->d_count + && (!test || test(this_parent, arg))) { + err = au_dpages_append(dpages, this_parent, GFP_ATOMIC); + if (unlikely(err)) + goto out; + } + + while (next != &this_parent->d_subdirs) { + struct list_head *tmp = next; + struct dentry *dentry = list_entry(tmp, struct dentry, + d_child); + + next = tmp->next; + spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); + if (dentry->d_count) { + if (!list_empty(&dentry->d_subdirs)) { + spin_unlock(&this_parent->d_lock); + spin_release(&dentry->d_lock.dep_map, 1, + _RET_IP_); + this_parent = dentry; + spin_acquire(&this_parent->d_lock.dep_map, 0, 1, + _RET_IP_); + goto repeat; + } + if (dentry->d_sb == sb + && au_di(dentry) + && (!test || test(dentry, arg))) + err = au_dpages_append(dpages, dentry, + GFP_ATOMIC); + } + spin_unlock(&dentry->d_lock); + if (unlikely(err)) + goto out; + } + + if (this_parent != root) { + struct dentry *tmp; + struct dentry *child; + + tmp = this_parent->d_parent; + rcu_read_lock(); + spin_unlock(&this_parent->d_lock); + child = this_parent; + this_parent = tmp; + spin_lock(&this_parent->d_lock); + rcu_read_unlock(); + next = child->d_child.next; + goto resume; + } + +out: + spin_unlock(&this_parent->d_lock); + write_sequnlock(&rename_lock); + return err; +} + +int au_dcsub_pages_rev(struct au_dcsub_pages *dpages, struct dentry *dentry, + int do_include, au_dpages_test test, void *arg) +{ + int err; + + err = 0; + write_seqlock(&rename_lock); + spin_lock(&dentry->d_lock); + if (do_include + && dentry->d_count + && (!test || test(dentry, arg))) + err = au_dpages_append(dpages, dentry, GFP_ATOMIC); + spin_unlock(&dentry->d_lock); + if (unlikely(err)) + goto out; + + /* + * RCU for vfsmount is unnecessary since this is a traverse in a single + * mount + */ + while (!IS_ROOT(dentry)) { + dentry = dentry->d_parent; /* rename_lock is locked */ + spin_lock(&dentry->d_lock); + if (dentry->d_count + && (!test || test(dentry, arg))) + err = au_dpages_append(dpages, dentry, GFP_ATOMIC); + spin_unlock(&dentry->d_lock); + if (unlikely(err)) + break; + } + +out: + write_sequnlock(&rename_lock); + return err; +} + +static inline int au_dcsub_dpages_aufs(struct dentry *dentry, void *arg) +{ + return au_di(dentry) && dentry->d_sb == arg; +} + +int au_dcsub_pages_rev_aufs(struct au_dcsub_pages *dpages, + struct dentry *dentry, int do_include) +{ + return au_dcsub_pages_rev(dpages, dentry, do_include, + au_dcsub_dpages_aufs, dentry->d_sb); +} + +int au_test_subdir(struct dentry *d1, struct dentry *d2) +{ + struct path path[2] = { + { + .dentry = d1 + }, + { + .dentry = d2 + } + }; + + return path_is_under(path + 0, path + 1); +} diff --git a/fs/aufs/dcsub.h b/fs/aufs/dcsub.h new file mode 100644 index 00000000000000..0a9679b68d780b --- /dev/null +++ b/fs/aufs/dcsub.h @@ -0,0 +1,102 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * sub-routines for dentry cache + */ + +#ifndef __AUFS_DCSUB_H__ +#define __AUFS_DCSUB_H__ + +#ifdef __KERNEL__ + +#include +#include + +struct dentry; + +struct au_dpage { + int ndentry; + struct dentry **dentries; +}; + +struct au_dcsub_pages { + int ndpage; + struct au_dpage *dpages; +}; + +/* ---------------------------------------------------------------------- */ + +/* dcsub.c */ +int au_dpages_init(struct au_dcsub_pages *dpages, gfp_t gfp); +void au_dpages_free(struct au_dcsub_pages *dpages); +typedef int (*au_dpages_test)(struct dentry *dentry, void *arg); +int au_dcsub_pages(struct au_dcsub_pages *dpages, struct dentry *root, + au_dpages_test test, void *arg); +int au_dcsub_pages_rev(struct au_dcsub_pages *dpages, struct dentry *dentry, + int do_include, au_dpages_test test, void *arg); +int au_dcsub_pages_rev_aufs(struct au_dcsub_pages *dpages, + struct dentry *dentry, int do_include); +int au_test_subdir(struct dentry *d1, struct dentry *d2); + +/* ---------------------------------------------------------------------- */ + +static inline int au_d_hashed_positive(struct dentry *d) +{ + int err; + struct inode *inode = d->d_inode; + + err = 0; + if (unlikely(d_unhashed(d) || !inode || !inode->i_nlink)) + err = -ENOENT; + return err; +} + +static inline int au_d_alive(struct dentry *d) +{ + int err; + struct inode *inode; + + err = 0; + if (!IS_ROOT(d)) + err = au_d_hashed_positive(d); + else { + inode = d->d_inode; + if (unlikely(d_unlinked(d) || !inode || !inode->i_nlink)) + err = -ENOENT; + } + return err; +} + +static inline int au_alive_dir(struct dentry *d) +{ + int err; + + err = au_d_alive(d); + if (unlikely(err || IS_DEADDIR(d->d_inode))) + err = -ENOENT; + return err; +} + +static inline int au_qstreq(struct qstr *a, struct qstr *b) +{ + return a->len == b->len + && !memcmp(a->name, b->name, a->len); +} + +#endif /* __KERNEL__ */ +#endif /* __AUFS_DCSUB_H__ */ diff --git a/fs/aufs/debug.c b/fs/aufs/debug.c new file mode 100644 index 00000000000000..5cc83379bd26d3 --- /dev/null +++ b/fs/aufs/debug.c @@ -0,0 +1,520 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * debug print functions + */ + +#include +#include "aufs.h" + +/* Returns 0, or -errno. arg is in kp->arg. */ +static int param_atomic_t_set(const char *val, const struct kernel_param *kp) +{ + int err, n; + + err = kstrtoint(val, 0, &n); + if (!err) { + if (n > 0) + au_debug_on(); + else + au_debug_off(); + } + return err; +} + +/* Returns length written or -errno. Buffer is 4k (ie. be short!) */ +static int param_atomic_t_get(char *buffer, const struct kernel_param *kp) +{ + atomic_t *a; + + a = kp->arg; + return sprintf(buffer, "%d", atomic_read(a)); +} + +static struct kernel_param_ops param_ops_atomic_t = { + .set = param_atomic_t_set, + .get = param_atomic_t_get + /* void (*free)(void *arg) */ +}; + +atomic_t aufs_debug = ATOMIC_INIT(0); +MODULE_PARM_DESC(debug, "debug print"); +module_param_named(debug, aufs_debug, atomic_t, S_IRUGO | S_IWUSR | S_IWGRP); + +DEFINE_MUTEX(au_dbg_mtx); /* just to serialize the dbg msgs */ +char *au_plevel = KERN_DEBUG; +#define dpri(fmt, ...) do { \ + if ((au_plevel \ + && strcmp(au_plevel, KERN_DEBUG)) \ + || au_debug_test()) \ + printk("%s" fmt, au_plevel, ##__VA_ARGS__); \ +} while (0) + +/* ---------------------------------------------------------------------- */ + +void au_dpri_whlist(struct au_nhash *whlist) +{ + unsigned long ul, n; + struct hlist_head *head; + struct au_vdir_wh *pos; + + n = whlist->nh_num; + head = whlist->nh_head; + for (ul = 0; ul < n; ul++) { + hlist_for_each_entry(pos, head, wh_hash) + dpri("b%d, %.*s, %d\n", + pos->wh_bindex, + pos->wh_str.len, pos->wh_str.name, + pos->wh_str.len); + head++; + } +} + +void au_dpri_vdir(struct au_vdir *vdir) +{ + unsigned long ul; + union au_vdir_deblk_p p; + unsigned char *o; + + if (!vdir || IS_ERR(vdir)) { + dpri("err %ld\n", PTR_ERR(vdir)); + return; + } + + dpri("deblk %u, nblk %lu, deblk %p, last{%lu, %p}, ver %lu\n", + vdir->vd_deblk_sz, vdir->vd_nblk, vdir->vd_deblk, + vdir->vd_last.ul, vdir->vd_last.p.deblk, vdir->vd_version); + for (ul = 0; ul < vdir->vd_nblk; ul++) { + p.deblk = vdir->vd_deblk[ul]; + o = p.deblk; + dpri("[%lu]: %p\n", ul, o); + } +} + +static int do_pri_inode(aufs_bindex_t bindex, struct inode *inode, int hn, + struct dentry *wh) +{ + char *n = NULL; + int l = 0; + + if (!inode || IS_ERR(inode)) { + dpri("i%d: err %ld\n", bindex, PTR_ERR(inode)); + return -1; + } + + /* the type of i_blocks depends upon CONFIG_LBDAF */ + BUILD_BUG_ON(sizeof(inode->i_blocks) != sizeof(unsigned long) + && sizeof(inode->i_blocks) != sizeof(u64)); + if (wh) { + n = (void *)wh->d_name.name; + l = wh->d_name.len; + } + + dpri("i%d: %p, i%lu, %s, cnt %d, nl %u, 0%o, sz %llu, blk %llu," + " hn %d, ct %lld, np %lu, st 0x%lx, f 0x%x, v %llu, g %x%s%.*s\n", + bindex, inode, + inode->i_ino, inode->i_sb ? au_sbtype(inode->i_sb) : "??", + atomic_read(&inode->i_count), inode->i_nlink, inode->i_mode, + i_size_read(inode), (unsigned long long)inode->i_blocks, + hn, (long long)timespec_to_ns(&inode->i_ctime) & 0x0ffff, + inode->i_mapping ? inode->i_mapping->nrpages : 0, + inode->i_state, inode->i_flags, inode->i_version, + inode->i_generation, + l ? ", wh " : "", l, n); + return 0; +} + +void au_dpri_inode(struct inode *inode) +{ + struct au_iinfo *iinfo; + aufs_bindex_t bindex; + int err, hn; + + err = do_pri_inode(-1, inode, -1, NULL); + if (err || !au_test_aufs(inode->i_sb)) + return; + + iinfo = au_ii(inode); + if (!iinfo) + return; + dpri("i-1: bstart %d, bend %d, gen %d\n", + iinfo->ii_bstart, iinfo->ii_bend, au_iigen(inode, NULL)); + if (iinfo->ii_bstart < 0) + return; + hn = 0; + for (bindex = iinfo->ii_bstart; bindex <= iinfo->ii_bend; bindex++) { + hn = !!au_hn(iinfo->ii_hinode + bindex); + do_pri_inode(bindex, iinfo->ii_hinode[0 + bindex].hi_inode, hn, + iinfo->ii_hinode[0 + bindex].hi_whdentry); + } +} + +void au_dpri_dalias(struct inode *inode) +{ + struct dentry *d; + + spin_lock(&inode->i_lock); + hlist_for_each_entry(d, &inode->i_dentry, d_u.d_alias) + au_dpri_dentry(d); + spin_unlock(&inode->i_lock); +} + +static int do_pri_dentry(aufs_bindex_t bindex, struct dentry *dentry) +{ + struct dentry *wh = NULL; + int hn; + struct au_iinfo *iinfo; + + if (!dentry || IS_ERR(dentry)) { + dpri("d%d: err %ld\n", bindex, PTR_ERR(dentry)); + return -1; + } + /* do not call dget_parent() here */ + /* note: access d_xxx without d_lock */ + dpri("d%d: %p, %.*s?/%.*s, %s, cnt %d, flags 0x%x, %shashed\n", + bindex, dentry, + AuDLNPair(dentry->d_parent), AuDLNPair(dentry), + dentry->d_sb ? au_sbtype(dentry->d_sb) : "??", + dentry->d_count, dentry->d_flags, + d_unhashed(dentry) ? "un" : ""); + hn = -1; + if (bindex >= 0 && dentry->d_inode && au_test_aufs(dentry->d_sb)) { + iinfo = au_ii(dentry->d_inode); + if (iinfo) { + hn = !!au_hn(iinfo->ii_hinode + bindex); + wh = iinfo->ii_hinode[0 + bindex].hi_whdentry; + } + } + do_pri_inode(bindex, dentry->d_inode, hn, wh); + return 0; +} + +void au_dpri_dentry(struct dentry *dentry) +{ + struct au_dinfo *dinfo; + aufs_bindex_t bindex; + int err; + struct au_hdentry *hdp; + + err = do_pri_dentry(-1, dentry); + if (err || !au_test_aufs(dentry->d_sb)) + return; + + dinfo = au_di(dentry); + if (!dinfo) + return; + dpri("d-1: bstart %d, bend %d, bwh %d, bdiropq %d, gen %d\n", + dinfo->di_bstart, dinfo->di_bend, + dinfo->di_bwh, dinfo->di_bdiropq, au_digen(dentry)); + if (dinfo->di_bstart < 0) + return; + hdp = dinfo->di_hdentry; + for (bindex = dinfo->di_bstart; bindex <= dinfo->di_bend; bindex++) + do_pri_dentry(bindex, hdp[0 + bindex].hd_dentry); +} + +static int do_pri_file(aufs_bindex_t bindex, struct file *file) +{ + char a[32]; + + if (!file || IS_ERR(file)) { + dpri("f%d: err %ld\n", bindex, PTR_ERR(file)); + return -1; + } + a[0] = 0; + if (bindex < 0 + && file->f_dentry + && au_test_aufs(file->f_dentry->d_sb) + && au_fi(file)) + snprintf(a, sizeof(a), ", gen %d, mmapped %d", + au_figen(file), atomic_read(&au_fi(file)->fi_mmapped)); + dpri("f%d: mode 0x%x, flags 0%o, cnt %ld, v %llu, pos %llu%s\n", + bindex, file->f_mode, file->f_flags, (long)file_count(file), + file->f_version, file->f_pos, a); + if (file->f_dentry) + do_pri_dentry(bindex, file->f_dentry); + return 0; +} + +void au_dpri_file(struct file *file) +{ + struct au_finfo *finfo; + struct au_fidir *fidir; + struct au_hfile *hfile; + aufs_bindex_t bindex; + int err; + + err = do_pri_file(-1, file); + if (err || !file->f_dentry || !au_test_aufs(file->f_dentry->d_sb)) + return; + + finfo = au_fi(file); + if (!finfo) + return; + if (finfo->fi_btop < 0) + return; + fidir = finfo->fi_hdir; + if (!fidir) + do_pri_file(finfo->fi_btop, finfo->fi_htop.hf_file); + else + for (bindex = finfo->fi_btop; + bindex >= 0 && bindex <= fidir->fd_bbot; + bindex++) { + hfile = fidir->fd_hfile + bindex; + do_pri_file(bindex, hfile ? hfile->hf_file : NULL); + } +} + +static int do_pri_br(aufs_bindex_t bindex, struct au_branch *br) +{ + struct vfsmount *mnt; + struct super_block *sb; + + if (!br || IS_ERR(br)) + goto out; + mnt = au_br_mnt(br); + if (!mnt || IS_ERR(mnt)) + goto out; + sb = mnt->mnt_sb; + if (!sb || IS_ERR(sb)) + goto out; + + dpri("s%d: {perm 0x%x, id %d, cnt %d, wbr %p}, " + "%s, dev 0x%02x%02x, flags 0x%lx, cnt %d, active %d, " + "xino %d\n", + bindex, br->br_perm, br->br_id, atomic_read(&br->br_count), + br->br_wbr, au_sbtype(sb), MAJOR(sb->s_dev), MINOR(sb->s_dev), + sb->s_flags, sb->s_count, + atomic_read(&sb->s_active), !!br->br_xino.xi_file); + return 0; + +out: + dpri("s%d: err %ld\n", bindex, PTR_ERR(br)); + return -1; +} + +void au_dpri_sb(struct super_block *sb) +{ + struct au_sbinfo *sbinfo; + aufs_bindex_t bindex; + int err; + /* to reuduce stack size */ + struct { + struct vfsmount mnt; + struct au_branch fake; + } *a; + + /* this function can be called from magic sysrq */ + a = kzalloc(sizeof(*a), GFP_ATOMIC); + if (unlikely(!a)) { + dpri("no memory\n"); + return; + } + + a->mnt.mnt_sb = sb; + a->fake.br_perm = 0; + a->fake.br_path.mnt = &a->mnt; + a->fake.br_xino.xi_file = NULL; + atomic_set(&a->fake.br_count, 0); + smp_mb(); /* atomic_set */ + err = do_pri_br(-1, &a->fake); + kfree(a); + dpri("dev 0x%x\n", sb->s_dev); + if (err || !au_test_aufs(sb)) + return; + + sbinfo = au_sbi(sb); + if (!sbinfo) + return; + dpri("nw %d, gen %u, kobj %d\n", + atomic_read(&sbinfo->si_nowait.nw_len), sbinfo->si_generation, + atomic_read(&sbinfo->si_kobj.kref.refcount)); + for (bindex = 0; bindex <= sbinfo->si_bend; bindex++) + do_pri_br(bindex, sbinfo->si_branch[0 + bindex]); +} + +/* ---------------------------------------------------------------------- */ + +void au_dbg_sleep_jiffy(int jiffy) +{ + while (jiffy) + jiffy = schedule_timeout_uninterruptible(jiffy); +} + +void au_dbg_iattr(struct iattr *ia) +{ +#define AuBit(name) \ + do { \ + if (ia->ia_valid & ATTR_ ## name) \ + dpri(#name "\n"); \ + } while (0) + AuBit(MODE); + AuBit(UID); + AuBit(GID); + AuBit(SIZE); + AuBit(ATIME); + AuBit(MTIME); + AuBit(CTIME); + AuBit(ATIME_SET); + AuBit(MTIME_SET); + AuBit(FORCE); + AuBit(ATTR_FLAG); + AuBit(KILL_SUID); + AuBit(KILL_SGID); + AuBit(FILE); + AuBit(KILL_PRIV); + AuBit(OPEN); + AuBit(TIMES_SET); +#undef AuBit + dpri("ia_file %p\n", ia->ia_file); +} + +/* ---------------------------------------------------------------------- */ + +void __au_dbg_verify_dinode(struct dentry *dentry, const char *func, int line) +{ + struct inode *h_inode, *inode = dentry->d_inode; + struct dentry *h_dentry; + aufs_bindex_t bindex, bend, bi; + + if (!inode /* || au_di(dentry)->di_lsc == AuLsc_DI_TMP */) + return; + + bend = au_dbend(dentry); + bi = au_ibend(inode); + if (bi < bend) + bend = bi; + bindex = au_dbstart(dentry); + bi = au_ibstart(inode); + if (bi > bindex) + bindex = bi; + + for (; bindex <= bend; bindex++) { + h_dentry = au_h_dptr(dentry, bindex); + if (!h_dentry) + continue; + h_inode = au_h_iptr(inode, bindex); + if (unlikely(h_inode != h_dentry->d_inode)) { + au_debug_on(); + AuDbg("b%d, %s:%d\n", bindex, func, line); + AuDbgDentry(dentry); + AuDbgInode(inode); + au_debug_off(); + BUG(); + } + } +} + +void au_dbg_verify_dir_parent(struct dentry *dentry, unsigned int sigen) +{ + struct dentry *parent; + + parent = dget_parent(dentry); + AuDebugOn(!S_ISDIR(dentry->d_inode->i_mode)); + AuDebugOn(IS_ROOT(dentry)); + AuDebugOn(au_digen_test(parent, sigen)); + dput(parent); +} + +void au_dbg_verify_nondir_parent(struct dentry *dentry, unsigned int sigen) +{ + struct dentry *parent; + struct inode *inode; + + parent = dget_parent(dentry); + inode = dentry->d_inode; + AuDebugOn(inode && S_ISDIR(dentry->d_inode->i_mode)); + AuDebugOn(au_digen_test(parent, sigen)); + dput(parent); +} + +void au_dbg_verify_gen(struct dentry *parent, unsigned int sigen) +{ + int err, i, j; + struct au_dcsub_pages dpages; + struct au_dpage *dpage; + struct dentry **dentries; + + err = au_dpages_init(&dpages, GFP_NOFS); + AuDebugOn(err); + err = au_dcsub_pages_rev_aufs(&dpages, parent, /*do_include*/1); + AuDebugOn(err); + for (i = dpages.ndpage - 1; !err && i >= 0; i--) { + dpage = dpages.dpages + i; + dentries = dpage->dentries; + for (j = dpage->ndentry - 1; !err && j >= 0; j--) + AuDebugOn(au_digen_test(dentries[j], sigen)); + } + au_dpages_free(&dpages); +} + +void au_dbg_verify_kthread(void) +{ + if (au_wkq_test()) { + au_dbg_blocked(); + /* + * It may be recursive, but udba=notify between two aufs mounts, + * where a single ro branch is shared, is not a problem. + */ + /* WARN_ON(1); */ + } +} + +/* ---------------------------------------------------------------------- */ + +void au_debug_sbinfo_init(struct au_sbinfo *sbinfo __maybe_unused) +{ +#ifdef AuForceNoPlink + au_opt_clr(sbinfo->si_mntflags, PLINK); +#endif +#ifdef AuForceNoXino + au_opt_clr(sbinfo->si_mntflags, XINO); +#endif +#ifdef AuForceNoRefrof + au_opt_clr(sbinfo->si_mntflags, REFROF); +#endif +#ifdef AuForceHnotify + au_opt_set_udba(sbinfo->si_mntflags, UDBA_HNOTIFY); +#endif +#ifdef AuForceRd0 + sbinfo->si_rdblk = 0; + sbinfo->si_rdhash = 0; +#endif +} + +int __init au_debug_init(void) +{ + aufs_bindex_t bindex; + struct au_vdir_destr destr; + + bindex = -1; + AuDebugOn(bindex >= 0); + + destr.len = -1; + AuDebugOn(destr.len < NAME_MAX); + +#ifdef CONFIG_4KSTACKS + pr_warn("CONFIG_4KSTACKS is defined.\n"); +#endif + +#ifdef AuForceNoBrs + sysaufs_brs = 0; +#endif + + return 0; +} diff --git a/fs/aufs/debug.h b/fs/aufs/debug.h new file mode 100644 index 00000000000000..dfda1eb201b220 --- /dev/null +++ b/fs/aufs/debug.h @@ -0,0 +1,263 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * debug print functions + */ + +#ifndef __AUFS_DEBUG_H__ +#define __AUFS_DEBUG_H__ + +#ifdef __KERNEL__ + +#include +#include +#include +#include + +#ifdef CONFIG_AUFS_DEBUG +#define AuDebugOn(a) BUG_ON(a) + +/* module parameter */ +extern atomic_t aufs_debug; +static inline void au_debug_on(void) +{ + atomic_inc(&aufs_debug); +} +static inline void au_debug_off(void) +{ + atomic_dec_if_positive(&aufs_debug); +} + +static inline int au_debug_test(void) +{ + return atomic_read(&aufs_debug) > 0; +} +#else +#define AuDebugOn(a) do {} while (0) +AuStubVoid(au_debug_on, void) +AuStubVoid(au_debug_off, void) +AuStubInt0(au_debug_test, void) +#endif /* CONFIG_AUFS_DEBUG */ + +#define param_check_atomic_t(name, p) __param_check(name, p, atomic_t) + +/* ---------------------------------------------------------------------- */ + +/* debug print */ + +#define AuDbg(fmt, ...) do { \ + if (au_debug_test()) \ + pr_debug("DEBUG: " fmt, ##__VA_ARGS__); \ +} while (0) +#define AuLabel(l) AuDbg(#l "\n") +#define AuIOErr(fmt, ...) pr_err("I/O Error, " fmt, ##__VA_ARGS__) +#define AuWarn1(fmt, ...) do { \ + static unsigned char _c; \ + if (!_c++) \ + pr_warn(fmt, ##__VA_ARGS__); \ +} while (0) + +#define AuErr1(fmt, ...) do { \ + static unsigned char _c; \ + if (!_c++) \ + pr_err(fmt, ##__VA_ARGS__); \ +} while (0) + +#define AuIOErr1(fmt, ...) do { \ + static unsigned char _c; \ + if (!_c++) \ + AuIOErr(fmt, ##__VA_ARGS__); \ +} while (0) + +#define AuUnsupportMsg "This operation is not supported." \ + " Please report this application to aufs-users ML." +#define AuUnsupport(fmt, ...) do { \ + pr_err(AuUnsupportMsg "\n" fmt, ##__VA_ARGS__); \ + dump_stack(); \ +} while (0) + +#define AuTraceErr(e) do { \ + if (unlikely((e) < 0)) \ + AuDbg("err %d\n", (int)(e)); \ +} while (0) + +#define AuTraceErrPtr(p) do { \ + if (IS_ERR(p)) \ + AuDbg("err %ld\n", PTR_ERR(p)); \ +} while (0) + +/* dirty macros for debug print, use with "%.*s" and caution */ +#define AuLNPair(qstr) (qstr)->len, (qstr)->name +#define AuDLNPair(d) AuLNPair(&(d)->d_name) + +/* ---------------------------------------------------------------------- */ + +struct au_sbinfo; +struct au_finfo; +struct dentry; +#ifdef CONFIG_AUFS_DEBUG +extern struct mutex au_dbg_mtx; +extern char *au_plevel; +struct au_nhash; +void au_dpri_whlist(struct au_nhash *whlist); +struct au_vdir; +void au_dpri_vdir(struct au_vdir *vdir); +struct inode; +void au_dpri_inode(struct inode *inode); +void au_dpri_dalias(struct inode *inode); +void au_dpri_dentry(struct dentry *dentry); +struct file; +void au_dpri_file(struct file *filp); +struct super_block; +void au_dpri_sb(struct super_block *sb); + +void au_dbg_sleep_jiffy(int jiffy); +struct iattr; +void au_dbg_iattr(struct iattr *ia); + +#define au_dbg_verify_dinode(d) __au_dbg_verify_dinode(d, __func__, __LINE__) +void __au_dbg_verify_dinode(struct dentry *dentry, const char *func, int line); +void au_dbg_verify_dir_parent(struct dentry *dentry, unsigned int sigen); +void au_dbg_verify_nondir_parent(struct dentry *dentry, unsigned int sigen); +void au_dbg_verify_gen(struct dentry *parent, unsigned int sigen); +void au_dbg_verify_kthread(void); + +int __init au_debug_init(void); +void au_debug_sbinfo_init(struct au_sbinfo *sbinfo); +#define AuDbgWhlist(w) do { \ + mutex_lock(&au_dbg_mtx); \ + AuDbg(#w "\n"); \ + au_dpri_whlist(w); \ + mutex_unlock(&au_dbg_mtx); \ +} while (0) + +#define AuDbgVdir(v) do { \ + mutex_lock(&au_dbg_mtx); \ + AuDbg(#v "\n"); \ + au_dpri_vdir(v); \ + mutex_unlock(&au_dbg_mtx); \ +} while (0) + +#define AuDbgInode(i) do { \ + mutex_lock(&au_dbg_mtx); \ + AuDbg(#i "\n"); \ + au_dpri_inode(i); \ + mutex_unlock(&au_dbg_mtx); \ +} while (0) + +#define AuDbgDAlias(i) do { \ + mutex_lock(&au_dbg_mtx); \ + AuDbg(#i "\n"); \ + au_dpri_dalias(i); \ + mutex_unlock(&au_dbg_mtx); \ +} while (0) + +#define AuDbgDentry(d) do { \ + mutex_lock(&au_dbg_mtx); \ + AuDbg(#d "\n"); \ + au_dpri_dentry(d); \ + mutex_unlock(&au_dbg_mtx); \ +} while (0) + +#define AuDbgFile(f) do { \ + mutex_lock(&au_dbg_mtx); \ + AuDbg(#f "\n"); \ + au_dpri_file(f); \ + mutex_unlock(&au_dbg_mtx); \ +} while (0) + +#define AuDbgSb(sb) do { \ + mutex_lock(&au_dbg_mtx); \ + AuDbg(#sb "\n"); \ + au_dpri_sb(sb); \ + mutex_unlock(&au_dbg_mtx); \ +} while (0) + +#define AuDbgSleep(sec) do { \ + AuDbg("sleep %d sec\n", sec); \ + ssleep(sec); \ +} while (0) + +#define AuDbgSleepJiffy(jiffy) do { \ + AuDbg("sleep %d jiffies\n", jiffy); \ + au_dbg_sleep_jiffy(jiffy); \ +} while (0) + +#define AuDbgIAttr(ia) do { \ + AuDbg("ia_valid 0x%x\n", (ia)->ia_valid); \ + au_dbg_iattr(ia); \ +} while (0) + +#define AuDbgSym(addr) do { \ + char sym[KSYM_SYMBOL_LEN]; \ + sprint_symbol(sym, (unsigned long)addr); \ + AuDbg("%s\n", sym); \ +} while (0) + +#define AuInfoSym(addr) do { \ + char sym[KSYM_SYMBOL_LEN]; \ + sprint_symbol(sym, (unsigned long)addr); \ + AuInfo("%s\n", sym); \ +} while (0) +#else +AuStubVoid(au_dbg_verify_dinode, struct dentry *dentry) +AuStubVoid(au_dbg_verify_dir_parent, struct dentry *dentry, unsigned int sigen) +AuStubVoid(au_dbg_verify_nondir_parent, struct dentry *dentry, + unsigned int sigen) +AuStubVoid(au_dbg_verify_gen, struct dentry *parent, unsigned int sigen) +AuStubVoid(au_dbg_verify_kthread, void) +AuStubInt0(__init au_debug_init, void) +AuStubVoid(au_debug_sbinfo_init, struct au_sbinfo *sbinfo) + +#define AuDbgWhlist(w) do {} while (0) +#define AuDbgVdir(v) do {} while (0) +#define AuDbgInode(i) do {} while (0) +#define AuDbgDAlias(i) do {} while (0) +#define AuDbgDentry(d) do {} while (0) +#define AuDbgFile(f) do {} while (0) +#define AuDbgSb(sb) do {} while (0) +#define AuDbgSleep(sec) do {} while (0) +#define AuDbgSleepJiffy(jiffy) do {} while (0) +#define AuDbgIAttr(ia) do {} while (0) +#define AuDbgSym(addr) do {} while (0) +#define AuInfoSym(addr) do {} while (0) +#endif /* CONFIG_AUFS_DEBUG */ + +/* ---------------------------------------------------------------------- */ + +#ifdef CONFIG_AUFS_MAGIC_SYSRQ +int __init au_sysrq_init(void); +void au_sysrq_fin(void); + +#ifdef CONFIG_HW_CONSOLE +#define au_dbg_blocked() do { \ + WARN_ON(1); \ + handle_sysrq('w'); \ +} while (0) +#else +AuStubVoid(au_dbg_blocked, void) +#endif + +#else +AuStubInt0(__init au_sysrq_init, void) +AuStubVoid(au_sysrq_fin, void) +AuStubVoid(au_dbg_blocked, void) +#endif /* CONFIG_AUFS_MAGIC_SYSRQ */ + +#endif /* __KERNEL__ */ +#endif /* __AUFS_DEBUG_H__ */ diff --git a/fs/aufs/dentry.c b/fs/aufs/dentry.c new file mode 100644 index 00000000000000..b5da387220fc65 --- /dev/null +++ b/fs/aufs/dentry.c @@ -0,0 +1,1096 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * lookup and dentry operations + */ + +#include +#include "aufs.h" + +#define AuLkup_ALLOW_NEG 1 +#define AuLkup_IGNORE_PERM (1 << 1) +#define au_ftest_lkup(flags, name) ((flags) & AuLkup_##name) +#define au_fset_lkup(flags, name) \ + do { (flags) |= AuLkup_##name; } while (0) +#define au_fclr_lkup(flags, name) \ + do { (flags) &= ~AuLkup_##name; } while (0) + +struct au_do_lookup_args { + unsigned int flags; + mode_t type; +}; + +/* + * returns positive/negative dentry, NULL or an error. + * NULL means whiteout-ed or not-found. + */ +static struct dentry* +au_do_lookup(struct dentry *h_parent, struct dentry *dentry, + aufs_bindex_t bindex, struct qstr *wh_name, + struct au_do_lookup_args *args) +{ + struct dentry *h_dentry; + struct inode *h_inode, *inode; + struct au_branch *br; + int wh_found, opq; + unsigned char wh_able; + const unsigned char allow_neg = !!au_ftest_lkup(args->flags, ALLOW_NEG); + const unsigned char ignore_perm = !!au_ftest_lkup(args->flags, + IGNORE_PERM); + + wh_found = 0; + br = au_sbr(dentry->d_sb, bindex); + wh_able = !!au_br_whable(br->br_perm); + if (wh_able) + wh_found = au_wh_test(h_parent, wh_name, /*try_sio*/0); + h_dentry = ERR_PTR(wh_found); + if (!wh_found) + goto real_lookup; + if (unlikely(wh_found < 0)) + goto out; + + /* We found a whiteout */ + /* au_set_dbend(dentry, bindex); */ + au_set_dbwh(dentry, bindex); + if (!allow_neg) + return NULL; /* success */ + +real_lookup: + if (!ignore_perm) + h_dentry = vfsub_lkup_one(&dentry->d_name, h_parent); + else + h_dentry = au_sio_lkup_one(&dentry->d_name, h_parent); + if (IS_ERR(h_dentry)) + goto out; + + h_inode = h_dentry->d_inode; + if (!h_inode) { + if (!allow_neg) + goto out_neg; + } else if (wh_found + || (args->type && args->type != (h_inode->i_mode & S_IFMT))) + goto out_neg; + + if (au_dbend(dentry) <= bindex) + au_set_dbend(dentry, bindex); + if (au_dbstart(dentry) < 0 || bindex < au_dbstart(dentry)) + au_set_dbstart(dentry, bindex); + au_set_h_dptr(dentry, bindex, h_dentry); + + inode = dentry->d_inode; + if (!h_inode || !S_ISDIR(h_inode->i_mode) || !wh_able + || (inode && !S_ISDIR(inode->i_mode))) + goto out; /* success */ + + mutex_lock_nested(&h_inode->i_mutex, AuLsc_I_CHILD); + opq = au_diropq_test(h_dentry); + mutex_unlock(&h_inode->i_mutex); + if (opq > 0) + au_set_dbdiropq(dentry, bindex); + else if (unlikely(opq < 0)) { + au_set_h_dptr(dentry, bindex, NULL); + h_dentry = ERR_PTR(opq); + } + goto out; + +out_neg: + dput(h_dentry); + h_dentry = NULL; +out: + return h_dentry; +} + +static int au_test_shwh(struct super_block *sb, const struct qstr *name) +{ + if (unlikely(!au_opt_test(au_mntflags(sb), SHWH) + && !strncmp(name->name, AUFS_WH_PFX, AUFS_WH_PFX_LEN))) + return -EPERM; + return 0; +} + +/* + * returns the number of lower positive dentries, + * otherwise an error. + * can be called at unlinking with @type is zero. + */ +int au_lkup_dentry(struct dentry *dentry, aufs_bindex_t bstart, mode_t type) +{ + int npositive, err; + aufs_bindex_t bindex, btail, bdiropq; + unsigned char isdir, dirperm1; + struct qstr whname; + struct au_do_lookup_args args = { + .flags = 0, + .type = type + }; + const struct qstr *name = &dentry->d_name; + struct dentry *parent; + struct inode *inode; + struct super_block *sb; + + sb = dentry->d_sb; + err = au_test_shwh(sb, name); + if (unlikely(err)) + goto out; + + err = au_wh_name_alloc(&whname, name); + if (unlikely(err)) + goto out; + + inode = dentry->d_inode; + isdir = !!(inode && S_ISDIR(inode->i_mode)); + if (!type) + au_fset_lkup(args.flags, ALLOW_NEG); + dirperm1 = !!au_opt_test(au_mntflags(sb), DIRPERM1); + + npositive = 0; + parent = dget_parent(dentry); + btail = au_dbtaildir(parent); + for (bindex = bstart; bindex <= btail; bindex++) { + struct dentry *h_parent, *h_dentry; + struct inode *h_inode, *h_dir; + + h_dentry = au_h_dptr(dentry, bindex); + if (h_dentry) { + if (h_dentry->d_inode) + npositive++; + if (type != S_IFDIR) + break; + continue; + } + h_parent = au_h_dptr(parent, bindex); + if (!h_parent) + continue; + h_dir = h_parent->d_inode; + if (!h_dir || !S_ISDIR(h_dir->i_mode)) + continue; + + mutex_lock_nested(&h_dir->i_mutex, AuLsc_I_PARENT); + h_dentry = au_do_lookup(h_parent, dentry, bindex, &whname, + &args); + mutex_unlock(&h_dir->i_mutex); + err = PTR_ERR(h_dentry); + if (IS_ERR(h_dentry)) + goto out_parent; + au_fclr_lkup(args.flags, ALLOW_NEG); + if (dirperm1) + au_fset_lkup(args.flags, IGNORE_PERM); + + if (au_dbwh(dentry) >= 0) + break; + if (!h_dentry) + continue; + h_inode = h_dentry->d_inode; + if (!h_inode) + continue; + npositive++; + if (!args.type) + args.type = h_inode->i_mode & S_IFMT; + if (args.type != S_IFDIR) + break; + else if (isdir) { + /* the type of lower may be different */ + bdiropq = au_dbdiropq(dentry); + if (bdiropq >= 0 && bdiropq <= bindex) + break; + } + } + + if (npositive) { + AuLabel(positive); + au_update_dbstart(dentry); + } + err = npositive; + if (unlikely(!au_opt_test(au_mntflags(sb), UDBA_NONE) + && au_dbstart(dentry) < 0)) { + err = -EIO; + AuIOErr("both of real entry and whiteout found, %.*s, err %d\n", + AuDLNPair(dentry), err); + } + +out_parent: + dput(parent); + kfree(whname.name); +out: + return err; +} + +struct dentry *au_sio_lkup_one(struct qstr *name, struct dentry *parent) +{ + struct dentry *dentry; + int wkq_err; + + if (!au_test_h_perm_sio(parent->d_inode, MAY_EXEC)) + dentry = vfsub_lkup_one(name, parent); + else { + struct vfsub_lkup_one_args args = { + .errp = &dentry, + .name = name, + .parent = parent + }; + + wkq_err = au_wkq_wait(vfsub_call_lkup_one, &args); + if (unlikely(wkq_err)) + dentry = ERR_PTR(wkq_err); + } + + return dentry; +} + +/* + * lookup @dentry on @bindex which should be negative. + */ +int au_lkup_neg(struct dentry *dentry, aufs_bindex_t bindex, int wh) +{ + int err; + struct dentry *parent, *h_parent, *h_dentry; + struct au_branch *br; + + parent = dget_parent(dentry); + h_parent = au_h_dptr(parent, bindex); + br = au_sbr(dentry->d_sb, bindex); + if (wh) + h_dentry = au_whtmp_lkup(h_parent, br, &dentry->d_name); + else + h_dentry = au_sio_lkup_one(&dentry->d_name, h_parent); + err = PTR_ERR(h_dentry); + if (IS_ERR(h_dentry)) + goto out; + if (unlikely(h_dentry->d_inode)) { + err = -EIO; + AuIOErr("%.*s should be negative on b%d.\n", + AuDLNPair(h_dentry), bindex); + dput(h_dentry); + goto out; + } + + err = 0; + if (bindex < au_dbstart(dentry)) + au_set_dbstart(dentry, bindex); + if (au_dbend(dentry) < bindex) + au_set_dbend(dentry, bindex); + au_set_h_dptr(dentry, bindex, h_dentry); + +out: + dput(parent); + return err; +} + +/* ---------------------------------------------------------------------- */ + +/* subset of struct inode */ +struct au_iattr { + unsigned long i_ino; + /* unsigned int i_nlink; */ + kuid_t i_uid; + kgid_t i_gid; + u64 i_version; +/* + loff_t i_size; + blkcnt_t i_blocks; +*/ + umode_t i_mode; +}; + +static void au_iattr_save(struct au_iattr *ia, struct inode *h_inode) +{ + ia->i_ino = h_inode->i_ino; + /* ia->i_nlink = h_inode->i_nlink; */ + ia->i_uid = h_inode->i_uid; + ia->i_gid = h_inode->i_gid; + ia->i_version = h_inode->i_version; +/* + ia->i_size = h_inode->i_size; + ia->i_blocks = h_inode->i_blocks; +*/ + ia->i_mode = (h_inode->i_mode & S_IFMT); +} + +static int au_iattr_test(struct au_iattr *ia, struct inode *h_inode) +{ + return ia->i_ino != h_inode->i_ino + /* || ia->i_nlink != h_inode->i_nlink */ + || !uid_eq(ia->i_uid, h_inode->i_uid) + || !gid_eq(ia->i_gid, h_inode->i_gid) + || ia->i_version != h_inode->i_version +/* + || ia->i_size != h_inode->i_size + || ia->i_blocks != h_inode->i_blocks +*/ + || ia->i_mode != (h_inode->i_mode & S_IFMT); +} + +static int au_h_verify_dentry(struct dentry *h_dentry, struct dentry *h_parent, + struct au_branch *br) +{ + int err; + struct au_iattr ia; + struct inode *h_inode; + struct dentry *h_d; + struct super_block *h_sb; + + err = 0; + memset(&ia, -1, sizeof(ia)); + h_sb = h_dentry->d_sb; + h_inode = h_dentry->d_inode; + if (h_inode) + au_iattr_save(&ia, h_inode); + else if (au_test_nfs(h_sb) || au_test_fuse(h_sb)) + /* nfs d_revalidate may return 0 for negative dentry */ + /* fuse d_revalidate always return 0 for negative dentry */ + goto out; + + /* main purpose is namei.c:cached_lookup() and d_revalidate */ + h_d = vfsub_lkup_one(&h_dentry->d_name, h_parent); + err = PTR_ERR(h_d); + if (IS_ERR(h_d)) + goto out; + + err = 0; + if (unlikely(h_d != h_dentry + || h_d->d_inode != h_inode + || (h_inode && au_iattr_test(&ia, h_inode)))) + err = au_busy_or_stale(); + dput(h_d); + +out: + AuTraceErr(err); + return err; +} + +int au_h_verify(struct dentry *h_dentry, unsigned int udba, struct inode *h_dir, + struct dentry *h_parent, struct au_branch *br) +{ + int err; + + err = 0; + if (udba == AuOpt_UDBA_REVAL + && !au_test_fs_remote(h_dentry->d_sb)) { + IMustLock(h_dir); + err = (h_dentry->d_parent->d_inode != h_dir); + } else if (udba != AuOpt_UDBA_NONE) + err = au_h_verify_dentry(h_dentry, h_parent, br); + + return err; +} + +/* ---------------------------------------------------------------------- */ + +static int au_do_refresh_hdentry(struct dentry *dentry, struct dentry *parent) +{ + int err; + aufs_bindex_t new_bindex, bindex, bend, bwh, bdiropq; + struct au_hdentry tmp, *p, *q; + struct au_dinfo *dinfo; + struct super_block *sb; + + DiMustWriteLock(dentry); + + sb = dentry->d_sb; + dinfo = au_di(dentry); + bend = dinfo->di_bend; + bwh = dinfo->di_bwh; + bdiropq = dinfo->di_bdiropq; + p = dinfo->di_hdentry + dinfo->di_bstart; + for (bindex = dinfo->di_bstart; bindex <= bend; bindex++, p++) { + if (!p->hd_dentry) + continue; + + new_bindex = au_br_index(sb, p->hd_id); + if (new_bindex == bindex) + continue; + + if (dinfo->di_bwh == bindex) + bwh = new_bindex; + if (dinfo->di_bdiropq == bindex) + bdiropq = new_bindex; + if (new_bindex < 0) { + au_hdput(p); + p->hd_dentry = NULL; + continue; + } + + /* swap two lower dentries, and loop again */ + q = dinfo->di_hdentry + new_bindex; + tmp = *q; + *q = *p; + *p = tmp; + if (tmp.hd_dentry) { + bindex--; + p--; + } + } + + dinfo->di_bwh = -1; + if (bwh >= 0 && bwh <= au_sbend(sb) && au_sbr_whable(sb, bwh)) + dinfo->di_bwh = bwh; + + dinfo->di_bdiropq = -1; + if (bdiropq >= 0 + && bdiropq <= au_sbend(sb) + && au_sbr_whable(sb, bdiropq)) + dinfo->di_bdiropq = bdiropq; + + err = -EIO; + dinfo->di_bstart = -1; + dinfo->di_bend = -1; + bend = au_dbend(parent); + p = dinfo->di_hdentry; + for (bindex = 0; bindex <= bend; bindex++, p++) + if (p->hd_dentry) { + dinfo->di_bstart = bindex; + break; + } + + if (dinfo->di_bstart >= 0) { + p = dinfo->di_hdentry + bend; + for (bindex = bend; bindex >= 0; bindex--, p--) + if (p->hd_dentry) { + dinfo->di_bend = bindex; + err = 0; + break; + } + } + + return err; +} + +static void au_do_hide(struct dentry *dentry) +{ + struct inode *inode; + + inode = dentry->d_inode; + if (inode) { + if (!S_ISDIR(inode->i_mode)) { + if (inode->i_nlink && !d_unhashed(dentry)) + drop_nlink(inode); + } else { + clear_nlink(inode); + /* stop next lookup */ + inode->i_flags |= S_DEAD; + } + smp_mb(); /* necessary? */ + } + d_drop(dentry); +} + +static int au_hide_children(struct dentry *parent) +{ + int err, i, j, ndentry; + struct au_dcsub_pages dpages; + struct au_dpage *dpage; + struct dentry *dentry; + + err = au_dpages_init(&dpages, GFP_NOFS); + if (unlikely(err)) + goto out; + err = au_dcsub_pages(&dpages, parent, NULL, NULL); + if (unlikely(err)) + goto out_dpages; + + /* in reverse order */ + for (i = dpages.ndpage - 1; i >= 0; i--) { + dpage = dpages.dpages + i; + ndentry = dpage->ndentry; + for (j = ndentry - 1; j >= 0; j--) { + dentry = dpage->dentries[j]; + if (dentry != parent) + au_do_hide(dentry); + } + } + +out_dpages: + au_dpages_free(&dpages); +out: + return err; +} + +static void au_hide(struct dentry *dentry) +{ + int err; + struct inode *inode; + + AuDbgDentry(dentry); + inode = dentry->d_inode; + if (inode && S_ISDIR(inode->i_mode)) { + /* shrink_dcache_parent(dentry); */ + err = au_hide_children(dentry); + if (unlikely(err)) + AuIOErr("%.*s, failed hiding children, ignored %d\n", + AuDLNPair(dentry), err); + } + au_do_hide(dentry); +} + +/* + * By adding a dirty branch, a cached dentry may be affected in various ways. + * + * a dirty branch is added + * - on the top of layers + * - in the middle of layers + * - to the bottom of layers + * + * on the added branch there exists + * - a whiteout + * - a diropq + * - a same named entry + * + exist + * * negative --> positive + * * positive --> positive + * - type is unchanged + * - type is changed + * + doesn't exist + * * negative --> negative + * * positive --> negative (rejected by au_br_del() for non-dir case) + * - none + */ +static int au_refresh_by_dinfo(struct dentry *dentry, struct au_dinfo *dinfo, + struct au_dinfo *tmp) +{ + int err; + aufs_bindex_t bindex, bend; + struct { + struct dentry *dentry; + struct inode *inode; + mode_t mode; + } orig_h, tmp_h; + struct au_hdentry *hd; + struct inode *inode, *h_inode; + struct dentry *h_dentry; + + err = 0; + AuDebugOn(dinfo->di_bstart < 0); + orig_h.dentry = dinfo->di_hdentry[dinfo->di_bstart].hd_dentry; + orig_h.inode = orig_h.dentry->d_inode; + orig_h.mode = 0; + if (orig_h.inode) + orig_h.mode = orig_h.inode->i_mode & S_IFMT; + memset(&tmp_h, 0, sizeof(tmp_h)); + if (tmp->di_bstart >= 0) { + tmp_h.dentry = tmp->di_hdentry[tmp->di_bstart].hd_dentry; + tmp_h.inode = tmp_h.dentry->d_inode; + if (tmp_h.inode) + tmp_h.mode = tmp_h.inode->i_mode & S_IFMT; + } + + inode = dentry->d_inode; + if (!orig_h.inode) { + AuDbg("nagative originally\n"); + if (inode) { + au_hide(dentry); + goto out; + } + AuDebugOn(inode); + AuDebugOn(dinfo->di_bstart != dinfo->di_bend); + AuDebugOn(dinfo->di_bdiropq != -1); + + if (!tmp_h.inode) { + AuDbg("negative --> negative\n"); + /* should have only one negative lower */ + if (tmp->di_bstart >= 0 + && tmp->di_bstart < dinfo->di_bstart) { + AuDebugOn(tmp->di_bstart != tmp->di_bend); + AuDebugOn(dinfo->di_bstart != dinfo->di_bend); + au_set_h_dptr(dentry, dinfo->di_bstart, NULL); + au_di_cp(dinfo, tmp); + hd = tmp->di_hdentry + tmp->di_bstart; + au_set_h_dptr(dentry, tmp->di_bstart, + dget(hd->hd_dentry)); + } + au_dbg_verify_dinode(dentry); + } else { + AuDbg("negative --> positive\n"); + /* + * similar to the behaviour of creating with bypassing + * aufs. + * unhash it in order to force an error in the + * succeeding create operation. + * we should not set S_DEAD here. + */ + d_drop(dentry); + /* au_di_swap(tmp, dinfo); */ + au_dbg_verify_dinode(dentry); + } + } else { + AuDbg("positive originally\n"); + /* inode may be NULL */ + AuDebugOn(inode && (inode->i_mode & S_IFMT) != orig_h.mode); + if (!tmp_h.inode) { + AuDbg("positive --> negative\n"); + /* or bypassing aufs */ + au_hide(dentry); + if (tmp->di_bwh >= 0 && tmp->di_bwh <= dinfo->di_bstart) + dinfo->di_bwh = tmp->di_bwh; + if (inode) + err = au_refresh_hinode_self(inode); + au_dbg_verify_dinode(dentry); + } else if (orig_h.mode == tmp_h.mode) { + AuDbg("positive --> positive, same type\n"); + if (!S_ISDIR(orig_h.mode) + && dinfo->di_bstart > tmp->di_bstart) { + /* + * similar to the behaviour of removing and + * creating. + */ + au_hide(dentry); + if (inode) + err = au_refresh_hinode_self(inode); + au_dbg_verify_dinode(dentry); + } else { + /* fill empty slots */ + if (dinfo->di_bstart > tmp->di_bstart) + dinfo->di_bstart = tmp->di_bstart; + if (dinfo->di_bend < tmp->di_bend) + dinfo->di_bend = tmp->di_bend; + dinfo->di_bwh = tmp->di_bwh; + dinfo->di_bdiropq = tmp->di_bdiropq; + hd = tmp->di_hdentry; + bend = dinfo->di_bend; + for (bindex = tmp->di_bstart; bindex <= bend; + bindex++) { + if (au_h_dptr(dentry, bindex)) + continue; + h_dentry = hd[bindex].hd_dentry; + if (!h_dentry) + continue; + h_inode = h_dentry->d_inode; + AuDebugOn(!h_inode); + AuDebugOn(orig_h.mode + != (h_inode->i_mode + & S_IFMT)); + au_set_h_dptr(dentry, bindex, + dget(h_dentry)); + } + err = au_refresh_hinode(inode, dentry); + au_dbg_verify_dinode(dentry); + } + } else { + AuDbg("positive --> positive, different type\n"); + /* similar to the behaviour of removing and creating */ + au_hide(dentry); + if (inode) + err = au_refresh_hinode_self(inode); + au_dbg_verify_dinode(dentry); + } + } + +out: + return err; +} + +int au_refresh_dentry(struct dentry *dentry, struct dentry *parent) +{ + int err, ebrange; + unsigned int sigen; + struct au_dinfo *dinfo, *tmp; + struct super_block *sb; + struct inode *inode; + + DiMustWriteLock(dentry); + AuDebugOn(IS_ROOT(dentry)); + AuDebugOn(!parent->d_inode); + + sb = dentry->d_sb; + inode = dentry->d_inode; + sigen = au_sigen(sb); + err = au_digen_test(parent, sigen); + if (unlikely(err)) + goto out; + + dinfo = au_di(dentry); + err = au_di_realloc(dinfo, au_sbend(sb) + 1); + if (unlikely(err)) + goto out; + ebrange = au_dbrange_test(dentry); + if (!ebrange) + ebrange = au_do_refresh_hdentry(dentry, parent); + + if (d_unhashed(dentry) || ebrange) { + AuDebugOn(au_dbstart(dentry) < 0 && au_dbend(dentry) >= 0); + if (inode) + err = au_refresh_hinode_self(inode); + au_dbg_verify_dinode(dentry); + if (!err) + goto out_dgen; /* success */ + goto out; + } + + /* temporary dinfo */ + AuDbgDentry(dentry); + err = -ENOMEM; + tmp = au_di_alloc(sb, AuLsc_DI_TMP); + if (unlikely(!tmp)) + goto out; + au_di_swap(tmp, dinfo); + /* returns the number of positive dentries */ + /* + * if current working dir is removed, it returns an error. + * but the dentry is legal. + */ + err = au_lkup_dentry(dentry, /*bstart*/0, /*type*/0); + AuDbgDentry(dentry); + au_di_swap(tmp, dinfo); + if (err == -ENOENT) + err = 0; + if (err >= 0) { + /* compare/refresh by dinfo */ + AuDbgDentry(dentry); + err = au_refresh_by_dinfo(dentry, dinfo, tmp); + au_dbg_verify_dinode(dentry); + AuTraceErr(err); + } + au_rw_write_unlock(&tmp->di_rwsem); + au_di_free(tmp); + if (unlikely(err)) + goto out; + +out_dgen: + au_update_digen(dentry); +out: + if (unlikely(err && !(dentry->d_flags & DCACHE_NFSFS_RENAMED))) { + AuIOErr("failed refreshing %.*s, %d\n", + AuDLNPair(dentry), err); + AuDbgDentry(dentry); + } + AuTraceErr(err); + return err; +} + +static int au_do_h_d_reval(struct dentry *h_dentry, unsigned int flags, + struct dentry *dentry, aufs_bindex_t bindex) +{ + int err, valid; + + err = 0; + if (!(h_dentry->d_flags & DCACHE_OP_REVALIDATE)) + goto out; + + AuDbg("b%d\n", bindex); + /* + * gave up supporting LOOKUP_CREATE/OPEN for lower fs, + * due to whiteout and branch permission. + */ + flags &= ~(/*LOOKUP_PARENT |*/ LOOKUP_OPEN | LOOKUP_CREATE + | LOOKUP_FOLLOW | LOOKUP_EXCL); + /* it may return tri-state */ + valid = h_dentry->d_op->d_revalidate(h_dentry, flags); + + if (unlikely(valid < 0)) + err = valid; + else if (!valid) + err = -EINVAL; + +out: + AuTraceErr(err); + return err; +} + +/* todo: remove this */ +static int h_d_revalidate(struct dentry *dentry, struct inode *inode, + unsigned int flags, int do_udba) +{ + int err; + umode_t mode, h_mode; + aufs_bindex_t bindex, btail, bstart, ibs, ibe; + unsigned char plus, unhashed, is_root, h_plus, h_nfs; + struct inode *h_inode, *h_cached_inode; + struct dentry *h_dentry; + struct qstr *name, *h_name; + + err = 0; + plus = 0; + mode = 0; + ibs = -1; + ibe = -1; + unhashed = !!d_unhashed(dentry); + is_root = !!IS_ROOT(dentry); + name = &dentry->d_name; + + /* + * Theoretically, REVAL test should be unnecessary in case of + * {FS,I}NOTIFY. + * But {fs,i}notify doesn't fire some necessary events, + * IN_ATTRIB for atime/nlink/pageio + * IN_DELETE for NFS dentry + * Let's do REVAL test too. + */ + if (do_udba && inode) { + mode = (inode->i_mode & S_IFMT); + plus = (inode->i_nlink > 0); + ibs = au_ibstart(inode); + ibe = au_ibend(inode); + } + + bstart = au_dbstart(dentry); + btail = bstart; + if (inode && S_ISDIR(inode->i_mode)) + btail = au_dbtaildir(dentry); + for (bindex = bstart; bindex <= btail; bindex++) { + h_dentry = au_h_dptr(dentry, bindex); + if (!h_dentry) + continue; + + AuDbg("b%d, %.*s\n", bindex, AuDLNPair(h_dentry)); + h_nfs = !!au_test_nfs(h_dentry->d_sb); + spin_lock(&h_dentry->d_lock); + h_name = &h_dentry->d_name; + if (unlikely(do_udba + && !is_root + && ((!h_nfs + && (unhashed != !!d_unhashed(h_dentry) + || !au_qstreq(name, h_name))) + || (h_nfs + && !(flags & LOOKUP_OPEN) + && (h_dentry->d_flags + & DCACHE_NFSFS_RENAMED))) + )) { + int h_unhashed; + + h_unhashed = d_unhashed(h_dentry); + spin_unlock(&h_dentry->d_lock); + AuDbg("unhash 0x%x 0x%x, %.*s %.*s\n", + unhashed, h_unhashed, + AuDLNPair(dentry), AuDLNPair(h_dentry)); + goto err; + } + spin_unlock(&h_dentry->d_lock); + + err = au_do_h_d_reval(h_dentry, flags, dentry, bindex); + if (unlikely(err)) + /* do not goto err, to keep the errno */ + break; + + /* todo: plink too? */ + if (!do_udba) + continue; + + /* UDBA tests */ + h_inode = h_dentry->d_inode; + if (unlikely(!!inode != !!h_inode)) + goto err; + + h_plus = plus; + h_mode = mode; + h_cached_inode = h_inode; + if (h_inode) { + h_mode = (h_inode->i_mode & S_IFMT); + h_plus = (h_inode->i_nlink > 0); + } + if (inode && ibs <= bindex && bindex <= ibe) + h_cached_inode = au_h_iptr(inode, bindex); + + if (!h_nfs) { + if (unlikely(plus != h_plus)) + goto err; + } else { + if (unlikely(!(h_dentry->d_flags & DCACHE_NFSFS_RENAMED) + && !is_root + && !IS_ROOT(h_dentry) + && unhashed != d_unhashed(h_dentry))) + goto err; + } + if (unlikely(mode != h_mode + || h_cached_inode != h_inode)) + goto err; + continue; + +err: + err = -EINVAL; + break; + } + + AuTraceErr(err); + return err; +} + +/* todo: consolidate with do_refresh() and au_reval_for_attr() */ +static int simple_reval_dpath(struct dentry *dentry, unsigned int sigen) +{ + int err; + struct dentry *parent; + + if (!au_digen_test(dentry, sigen)) + return 0; + + parent = dget_parent(dentry); + di_read_lock_parent(parent, AuLock_IR); + AuDebugOn(au_digen_test(parent, sigen)); + au_dbg_verify_gen(parent, sigen); + err = au_refresh_dentry(dentry, parent); + di_read_unlock(parent, AuLock_IR); + dput(parent); + AuTraceErr(err); + return err; +} + +int au_reval_dpath(struct dentry *dentry, unsigned int sigen) +{ + int err; + struct dentry *d, *parent; + struct inode *inode; + + if (!au_ftest_si(au_sbi(dentry->d_sb), FAILED_REFRESH_DIR)) + return simple_reval_dpath(dentry, sigen); + + /* slow loop, keep it simple and stupid */ + /* cf: au_cpup_dirs() */ + err = 0; + parent = NULL; + while (au_digen_test(dentry, sigen)) { + d = dentry; + while (1) { + dput(parent); + parent = dget_parent(d); + if (!au_digen_test(parent, sigen)) + break; + d = parent; + } + + inode = d->d_inode; + if (d != dentry) + di_write_lock_child2(d); + + /* someone might update our dentry while we were sleeping */ + if (au_digen_test(d, sigen)) { + /* + * todo: consolidate with simple_reval_dpath(), + * do_refresh() and au_reval_for_attr(). + */ + di_read_lock_parent(parent, AuLock_IR); + err = au_refresh_dentry(d, parent); + di_read_unlock(parent, AuLock_IR); + } + + if (d != dentry) + di_write_unlock(d); + dput(parent); + if (unlikely(err)) + break; + } + + return err; +} + +/* + * if valid returns 1, otherwise 0. + */ +static int aufs_d_revalidate(struct dentry *dentry, unsigned int flags) +{ + int valid, err; + unsigned int sigen; + unsigned char do_udba; + struct super_block *sb; + struct inode *inode; + + /* todo: support rcu-walk? */ + if (flags & LOOKUP_RCU) + return -ECHILD; + + valid = 0; + if (unlikely(!au_di(dentry))) + goto out; + + valid = 1; + sb = dentry->d_sb; + /* + * todo: very ugly + * i_mutex of parent dir may be held, + * but we should not return 'invalid' due to busy. + */ + err = aufs_read_lock(dentry, AuLock_FLUSH | AuLock_DW | AuLock_NOPLM); + if (unlikely(err)) { + valid = err; + AuTraceErr(err); + goto out; + } + inode = dentry->d_inode; + if (unlikely(inode && is_bad_inode(inode))) { + err = -EINVAL; + AuTraceErr(err); + goto out_dgrade; + } + if (unlikely(au_dbrange_test(dentry))) { + err = -EINVAL; + AuTraceErr(err); + goto out_dgrade; + } + + sigen = au_sigen(sb); + if (au_digen_test(dentry, sigen)) { + AuDebugOn(IS_ROOT(dentry)); + err = au_reval_dpath(dentry, sigen); + if (unlikely(err)) { + AuTraceErr(err); + goto out_dgrade; + } + } + di_downgrade_lock(dentry, AuLock_IR); + + err = -EINVAL; + if (!(flags & (LOOKUP_OPEN | LOOKUP_EMPTY)) + && inode + && (IS_DEADDIR(inode) || !inode->i_nlink)) + goto out_inval; + + do_udba = !au_opt_test(au_mntflags(sb), UDBA_NONE); + if (do_udba && inode) { + aufs_bindex_t bstart = au_ibstart(inode); + struct inode *h_inode; + + if (bstart >= 0) { + h_inode = au_h_iptr(inode, bstart); + if (h_inode && au_test_higen(inode, h_inode)) + goto out_inval; + } + } + + err = h_d_revalidate(dentry, inode, flags, do_udba); + if (unlikely(!err && do_udba && au_dbstart(dentry) < 0)) { + err = -EIO; + AuDbg("both of real entry and whiteout found, %.*s, err %d\n", + AuDLNPair(dentry), err); + } + goto out_inval; + +out_dgrade: + di_downgrade_lock(dentry, AuLock_IR); +out_inval: + aufs_read_unlock(dentry, AuLock_IR); + AuTraceErr(err); + valid = !err; +out: + if (!valid) { + AuDbg("%.*s invalid, %d\n", AuDLNPair(dentry), valid); + d_drop(dentry); + } + return valid; +} + +static void aufs_d_release(struct dentry *dentry) +{ + if (au_di(dentry)) { + au_di_fin(dentry); + au_hn_di_reinit(dentry); + } +} + +const struct dentry_operations aufs_dop = { + .d_revalidate = aufs_d_revalidate, + .d_weak_revalidate = aufs_d_revalidate, + .d_release = aufs_d_release +}; diff --git a/fs/aufs/dentry.h b/fs/aufs/dentry.h new file mode 100644 index 00000000000000..9871e8c22d6689 --- /dev/null +++ b/fs/aufs/dentry.h @@ -0,0 +1,232 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * lookup and dentry operations + */ + +#ifndef __AUFS_DENTRY_H__ +#define __AUFS_DENTRY_H__ + +#ifdef __KERNEL__ + +#include +#include "rwsem.h" + +struct au_hdentry { + struct dentry *hd_dentry; + aufs_bindex_t hd_id; +}; + +struct au_dinfo { + atomic_t di_generation; + + struct au_rwsem di_rwsem; + aufs_bindex_t di_bstart, di_bend, di_bwh, di_bdiropq; + struct au_hdentry *di_hdentry; +} ____cacheline_aligned_in_smp; + +/* ---------------------------------------------------------------------- */ + +/* dentry.c */ +extern const struct dentry_operations aufs_dop; +struct au_branch; +struct dentry *au_sio_lkup_one(struct qstr *name, struct dentry *parent); +int au_h_verify(struct dentry *h_dentry, unsigned int udba, struct inode *h_dir, + struct dentry *h_parent, struct au_branch *br); + +int au_lkup_dentry(struct dentry *dentry, aufs_bindex_t bstart, mode_t type); +int au_lkup_neg(struct dentry *dentry, aufs_bindex_t bindex, int wh); +int au_refresh_dentry(struct dentry *dentry, struct dentry *parent); +int au_reval_dpath(struct dentry *dentry, unsigned int sigen); + +/* dinfo.c */ +void au_di_init_once(void *_di); +struct au_dinfo *au_di_alloc(struct super_block *sb, unsigned int lsc); +void au_di_free(struct au_dinfo *dinfo); +void au_di_swap(struct au_dinfo *a, struct au_dinfo *b); +void au_di_cp(struct au_dinfo *dst, struct au_dinfo *src); +int au_di_init(struct dentry *dentry); +void au_di_fin(struct dentry *dentry); +int au_di_realloc(struct au_dinfo *dinfo, int nbr); + +void di_read_lock(struct dentry *d, int flags, unsigned int lsc); +void di_read_unlock(struct dentry *d, int flags); +void di_downgrade_lock(struct dentry *d, int flags); +void di_write_lock(struct dentry *d, unsigned int lsc); +void di_write_unlock(struct dentry *d); +void di_write_lock2_child(struct dentry *d1, struct dentry *d2, int isdir); +void di_write_lock2_parent(struct dentry *d1, struct dentry *d2, int isdir); +void di_write_unlock2(struct dentry *d1, struct dentry *d2); + +struct dentry *au_h_dptr(struct dentry *dentry, aufs_bindex_t bindex); +struct dentry *au_h_d_alias(struct dentry *dentry, aufs_bindex_t bindex); +aufs_bindex_t au_dbtail(struct dentry *dentry); +aufs_bindex_t au_dbtaildir(struct dentry *dentry); + +void au_set_h_dptr(struct dentry *dentry, aufs_bindex_t bindex, + struct dentry *h_dentry); +int au_digen_test(struct dentry *dentry, unsigned int sigen); +int au_dbrange_test(struct dentry *dentry); +void au_update_digen(struct dentry *dentry); +void au_update_dbrange(struct dentry *dentry, int do_put_zero); +void au_update_dbstart(struct dentry *dentry); +void au_update_dbend(struct dentry *dentry); +int au_find_dbindex(struct dentry *dentry, struct dentry *h_dentry); + +/* ---------------------------------------------------------------------- */ + +static inline struct au_dinfo *au_di(struct dentry *dentry) +{ + return dentry->d_fsdata; +} + +/* ---------------------------------------------------------------------- */ + +/* lock subclass for dinfo */ +enum { + AuLsc_DI_CHILD, /* child first */ + AuLsc_DI_CHILD2, /* rename(2), link(2), and cpup at hnotify */ + AuLsc_DI_CHILD3, /* copyup dirs */ + AuLsc_DI_PARENT, + AuLsc_DI_PARENT2, + AuLsc_DI_PARENT3, + AuLsc_DI_TMP /* temp for replacing dinfo */ +}; + +/* + * di_read_lock_child, di_write_lock_child, + * di_read_lock_child2, di_write_lock_child2, + * di_read_lock_child3, di_write_lock_child3, + * di_read_lock_parent, di_write_lock_parent, + * di_read_lock_parent2, di_write_lock_parent2, + * di_read_lock_parent3, di_write_lock_parent3, + */ +#define AuReadLockFunc(name, lsc) \ +static inline void di_read_lock_##name(struct dentry *d, int flags) \ +{ di_read_lock(d, flags, AuLsc_DI_##lsc); } + +#define AuWriteLockFunc(name, lsc) \ +static inline void di_write_lock_##name(struct dentry *d) \ +{ di_write_lock(d, AuLsc_DI_##lsc); } + +#define AuRWLockFuncs(name, lsc) \ + AuReadLockFunc(name, lsc) \ + AuWriteLockFunc(name, lsc) + +AuRWLockFuncs(child, CHILD); +AuRWLockFuncs(child2, CHILD2); +AuRWLockFuncs(child3, CHILD3); +AuRWLockFuncs(parent, PARENT); +AuRWLockFuncs(parent2, PARENT2); +AuRWLockFuncs(parent3, PARENT3); + +#undef AuReadLockFunc +#undef AuWriteLockFunc +#undef AuRWLockFuncs + +#define DiMustNoWaiters(d) AuRwMustNoWaiters(&au_di(d)->di_rwsem) +#define DiMustAnyLock(d) AuRwMustAnyLock(&au_di(d)->di_rwsem) +#define DiMustWriteLock(d) AuRwMustWriteLock(&au_di(d)->di_rwsem) + +/* ---------------------------------------------------------------------- */ + +/* todo: memory barrier? */ +static inline unsigned int au_digen(struct dentry *d) +{ + return atomic_read(&au_di(d)->di_generation); +} + +static inline void au_h_dentry_init(struct au_hdentry *hdentry) +{ + hdentry->hd_dentry = NULL; +} + +static inline void au_hdput(struct au_hdentry *hd) +{ + if (hd) + dput(hd->hd_dentry); +} + +static inline aufs_bindex_t au_dbstart(struct dentry *dentry) +{ + DiMustAnyLock(dentry); + return au_di(dentry)->di_bstart; +} + +static inline aufs_bindex_t au_dbend(struct dentry *dentry) +{ + DiMustAnyLock(dentry); + return au_di(dentry)->di_bend; +} + +static inline aufs_bindex_t au_dbwh(struct dentry *dentry) +{ + DiMustAnyLock(dentry); + return au_di(dentry)->di_bwh; +} + +static inline aufs_bindex_t au_dbdiropq(struct dentry *dentry) +{ + DiMustAnyLock(dentry); + return au_di(dentry)->di_bdiropq; +} + +/* todo: hard/soft set? */ +static inline void au_set_dbstart(struct dentry *dentry, aufs_bindex_t bindex) +{ + DiMustWriteLock(dentry); + au_di(dentry)->di_bstart = bindex; +} + +static inline void au_set_dbend(struct dentry *dentry, aufs_bindex_t bindex) +{ + DiMustWriteLock(dentry); + au_di(dentry)->di_bend = bindex; +} + +static inline void au_set_dbwh(struct dentry *dentry, aufs_bindex_t bindex) +{ + DiMustWriteLock(dentry); + /* dbwh can be outside of bstart - bend range */ + au_di(dentry)->di_bwh = bindex; +} + +static inline void au_set_dbdiropq(struct dentry *dentry, aufs_bindex_t bindex) +{ + DiMustWriteLock(dentry); + au_di(dentry)->di_bdiropq = bindex; +} + +/* ---------------------------------------------------------------------- */ + +#ifdef CONFIG_AUFS_HNOTIFY +static inline void au_digen_dec(struct dentry *d) +{ + atomic_dec(&au_di(d)->di_generation); +} + +static inline void au_hn_di_reinit(struct dentry *dentry) +{ + dentry->d_fsdata = NULL; +} +#else +AuStubVoid(au_hn_di_reinit, struct dentry *dentry __maybe_unused) +#endif /* CONFIG_AUFS_HNOTIFY */ + +#endif /* __KERNEL__ */ +#endif /* __AUFS_DENTRY_H__ */ diff --git a/fs/aufs/dinfo.c b/fs/aufs/dinfo.c new file mode 100644 index 00000000000000..24c369634ec977 --- /dev/null +++ b/fs/aufs/dinfo.c @@ -0,0 +1,542 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * dentry private data + */ + +#include "aufs.h" + +void au_di_init_once(void *_dinfo) +{ + struct au_dinfo *dinfo = _dinfo; + static struct lock_class_key aufs_di; + + au_rw_init(&dinfo->di_rwsem); + au_rw_class(&dinfo->di_rwsem, &aufs_di); +} + +struct au_dinfo *au_di_alloc(struct super_block *sb, unsigned int lsc) +{ + struct au_dinfo *dinfo; + int nbr, i; + + dinfo = au_cache_alloc_dinfo(); + if (unlikely(!dinfo)) + goto out; + + nbr = au_sbend(sb) + 1; + if (nbr <= 0) + nbr = 1; + dinfo->di_hdentry = kcalloc(nbr, sizeof(*dinfo->di_hdentry), GFP_NOFS); + if (dinfo->di_hdentry) { + au_rw_write_lock_nested(&dinfo->di_rwsem, lsc); + dinfo->di_bstart = -1; + dinfo->di_bend = -1; + dinfo->di_bwh = -1; + dinfo->di_bdiropq = -1; + for (i = 0; i < nbr; i++) + dinfo->di_hdentry[i].hd_id = -1; + goto out; + } + + au_cache_free_dinfo(dinfo); + dinfo = NULL; + +out: + return dinfo; +} + +void au_di_free(struct au_dinfo *dinfo) +{ + struct au_hdentry *p; + aufs_bindex_t bend, bindex; + + /* dentry may not be revalidated */ + bindex = dinfo->di_bstart; + if (bindex >= 0) { + bend = dinfo->di_bend; + p = dinfo->di_hdentry + bindex; + while (bindex++ <= bend) + au_hdput(p++); + } + kfree(dinfo->di_hdentry); + au_cache_free_dinfo(dinfo); +} + +void au_di_swap(struct au_dinfo *a, struct au_dinfo *b) +{ + struct au_hdentry *p; + aufs_bindex_t bi; + + AuRwMustWriteLock(&a->di_rwsem); + AuRwMustWriteLock(&b->di_rwsem); + +#define DiSwap(v, name) \ + do { \ + v = a->di_##name; \ + a->di_##name = b->di_##name; \ + b->di_##name = v; \ + } while (0) + + DiSwap(p, hdentry); + DiSwap(bi, bstart); + DiSwap(bi, bend); + DiSwap(bi, bwh); + DiSwap(bi, bdiropq); + /* smp_mb(); */ + +#undef DiSwap +} + +void au_di_cp(struct au_dinfo *dst, struct au_dinfo *src) +{ + AuRwMustWriteLock(&dst->di_rwsem); + AuRwMustWriteLock(&src->di_rwsem); + + dst->di_bstart = src->di_bstart; + dst->di_bend = src->di_bend; + dst->di_bwh = src->di_bwh; + dst->di_bdiropq = src->di_bdiropq; + /* smp_mb(); */ +} + +int au_di_init(struct dentry *dentry) +{ + int err; + struct super_block *sb; + struct au_dinfo *dinfo; + + err = 0; + sb = dentry->d_sb; + dinfo = au_di_alloc(sb, AuLsc_DI_CHILD); + if (dinfo) { + atomic_set(&dinfo->di_generation, au_sigen(sb)); + /* smp_mb(); */ /* atomic_set */ + dentry->d_fsdata = dinfo; + } else + err = -ENOMEM; + + return err; +} + +void au_di_fin(struct dentry *dentry) +{ + struct au_dinfo *dinfo; + + dinfo = au_di(dentry); + AuRwDestroy(&dinfo->di_rwsem); + au_di_free(dinfo); +} + +int au_di_realloc(struct au_dinfo *dinfo, int nbr) +{ + int err, sz; + struct au_hdentry *hdp; + + AuRwMustWriteLock(&dinfo->di_rwsem); + + err = -ENOMEM; + sz = sizeof(*hdp) * (dinfo->di_bend + 1); + if (!sz) + sz = sizeof(*hdp); + hdp = au_kzrealloc(dinfo->di_hdentry, sz, sizeof(*hdp) * nbr, GFP_NOFS); + if (hdp) { + dinfo->di_hdentry = hdp; + err = 0; + } + + return err; +} + +/* ---------------------------------------------------------------------- */ + +static void do_ii_write_lock(struct inode *inode, unsigned int lsc) +{ + switch (lsc) { + case AuLsc_DI_CHILD: + ii_write_lock_child(inode); + break; + case AuLsc_DI_CHILD2: + ii_write_lock_child2(inode); + break; + case AuLsc_DI_CHILD3: + ii_write_lock_child3(inode); + break; + case AuLsc_DI_PARENT: + ii_write_lock_parent(inode); + break; + case AuLsc_DI_PARENT2: + ii_write_lock_parent2(inode); + break; + case AuLsc_DI_PARENT3: + ii_write_lock_parent3(inode); + break; + default: + BUG(); + } +} + +static void do_ii_read_lock(struct inode *inode, unsigned int lsc) +{ + switch (lsc) { + case AuLsc_DI_CHILD: + ii_read_lock_child(inode); + break; + case AuLsc_DI_CHILD2: + ii_read_lock_child2(inode); + break; + case AuLsc_DI_CHILD3: + ii_read_lock_child3(inode); + break; + case AuLsc_DI_PARENT: + ii_read_lock_parent(inode); + break; + case AuLsc_DI_PARENT2: + ii_read_lock_parent2(inode); + break; + case AuLsc_DI_PARENT3: + ii_read_lock_parent3(inode); + break; + default: + BUG(); + } +} + +void di_read_lock(struct dentry *d, int flags, unsigned int lsc) +{ + au_rw_read_lock_nested(&au_di(d)->di_rwsem, lsc); + if (d->d_inode) { + if (au_ftest_lock(flags, IW)) + do_ii_write_lock(d->d_inode, lsc); + else if (au_ftest_lock(flags, IR)) + do_ii_read_lock(d->d_inode, lsc); + } +} + +void di_read_unlock(struct dentry *d, int flags) +{ + if (d->d_inode) { + if (au_ftest_lock(flags, IW)) { + au_dbg_verify_dinode(d); + ii_write_unlock(d->d_inode); + } else if (au_ftest_lock(flags, IR)) { + au_dbg_verify_dinode(d); + ii_read_unlock(d->d_inode); + } + } + au_rw_read_unlock(&au_di(d)->di_rwsem); +} + +void di_downgrade_lock(struct dentry *d, int flags) +{ + if (d->d_inode && au_ftest_lock(flags, IR)) + ii_downgrade_lock(d->d_inode); + au_rw_dgrade_lock(&au_di(d)->di_rwsem); +} + +void di_write_lock(struct dentry *d, unsigned int lsc) +{ + au_rw_write_lock_nested(&au_di(d)->di_rwsem, lsc); + if (d->d_inode) + do_ii_write_lock(d->d_inode, lsc); +} + +void di_write_unlock(struct dentry *d) +{ + au_dbg_verify_dinode(d); + if (d->d_inode) + ii_write_unlock(d->d_inode); + au_rw_write_unlock(&au_di(d)->di_rwsem); +} + +void di_write_lock2_child(struct dentry *d1, struct dentry *d2, int isdir) +{ + AuDebugOn(d1 == d2 + || d1->d_inode == d2->d_inode + || d1->d_sb != d2->d_sb); + + if (isdir && au_test_subdir(d1, d2)) { + di_write_lock_child(d1); + di_write_lock_child2(d2); + } else { + /* there should be no races */ + di_write_lock_child(d2); + di_write_lock_child2(d1); + } +} + +void di_write_lock2_parent(struct dentry *d1, struct dentry *d2, int isdir) +{ + AuDebugOn(d1 == d2 + || d1->d_inode == d2->d_inode + || d1->d_sb != d2->d_sb); + + if (isdir && au_test_subdir(d1, d2)) { + di_write_lock_parent(d1); + di_write_lock_parent2(d2); + } else { + /* there should be no races */ + di_write_lock_parent(d2); + di_write_lock_parent2(d1); + } +} + +void di_write_unlock2(struct dentry *d1, struct dentry *d2) +{ + di_write_unlock(d1); + if (d1->d_inode == d2->d_inode) + au_rw_write_unlock(&au_di(d2)->di_rwsem); + else + di_write_unlock(d2); +} + +/* ---------------------------------------------------------------------- */ + +struct dentry *au_h_dptr(struct dentry *dentry, aufs_bindex_t bindex) +{ + struct dentry *d; + + DiMustAnyLock(dentry); + + if (au_dbstart(dentry) < 0 || bindex < au_dbstart(dentry)) + return NULL; + AuDebugOn(bindex < 0); + d = au_di(dentry)->di_hdentry[0 + bindex].hd_dentry; + AuDebugOn(d && d->d_count <= 0); + return d; +} + +/* + * extended version of au_h_dptr(). + * returns a hashed and positive h_dentry in bindex, NULL, or error. + */ +struct dentry *au_h_d_alias(struct dentry *dentry, aufs_bindex_t bindex) +{ + struct dentry *h_dentry; + struct inode *inode, *h_inode; + + inode = dentry->d_inode; + AuDebugOn(!inode); + + h_dentry = NULL; + if (au_dbstart(dentry) <= bindex + && bindex <= au_dbend(dentry)) + h_dentry = au_h_dptr(dentry, bindex); + if (h_dentry && !au_d_hashed_positive(h_dentry)) { + dget(h_dentry); + goto out; /* success */ + } + + AuDebugOn(bindex < au_ibstart(inode)); + AuDebugOn(au_ibend(inode) < bindex); + h_inode = au_h_iptr(inode, bindex); + h_dentry = d_find_alias(h_inode); + if (h_dentry) { + if (!IS_ERR(h_dentry)) { + if (!au_d_hashed_positive(h_dentry)) + goto out; /* success */ + dput(h_dentry); + } else + goto out; + } + + if (au_opt_test(au_mntflags(dentry->d_sb), PLINK)) { + h_dentry = au_plink_lkup(inode, bindex); + AuDebugOn(!h_dentry); + if (!IS_ERR(h_dentry)) { + if (!au_d_hashed_positive(h_dentry)) + goto out; /* success */ + dput(h_dentry); + h_dentry = NULL; + } + } + +out: + AuDbgDentry(h_dentry); + return h_dentry; +} + +aufs_bindex_t au_dbtail(struct dentry *dentry) +{ + aufs_bindex_t bend, bwh; + + bend = au_dbend(dentry); + if (0 <= bend) { + bwh = au_dbwh(dentry); + if (!bwh) + return bwh; + if (0 < bwh && bwh < bend) + return bwh - 1; + } + return bend; +} + +aufs_bindex_t au_dbtaildir(struct dentry *dentry) +{ + aufs_bindex_t bend, bopq; + + bend = au_dbtail(dentry); + if (0 <= bend) { + bopq = au_dbdiropq(dentry); + if (0 <= bopq && bopq < bend) + bend = bopq; + } + return bend; +} + +/* ---------------------------------------------------------------------- */ + +void au_set_h_dptr(struct dentry *dentry, aufs_bindex_t bindex, + struct dentry *h_dentry) +{ + struct au_hdentry *hd = au_di(dentry)->di_hdentry + bindex; + struct au_branch *br; + + DiMustWriteLock(dentry); + + au_hdput(hd); + hd->hd_dentry = h_dentry; + if (h_dentry) { + br = au_sbr(dentry->d_sb, bindex); + hd->hd_id = br->br_id; + } +} + +int au_dbrange_test(struct dentry *dentry) +{ + int err; + aufs_bindex_t bstart, bend; + + err = 0; + bstart = au_dbstart(dentry); + bend = au_dbend(dentry); + if (bstart >= 0) + AuDebugOn(bend < 0 && bstart > bend); + else { + err = -EIO; + AuDebugOn(bend >= 0); + } + + return err; +} + +int au_digen_test(struct dentry *dentry, unsigned int sigen) +{ + int err; + + err = 0; + if (unlikely(au_digen(dentry) != sigen + || au_iigen_test(dentry->d_inode, sigen))) + err = -EIO; + + return err; +} + +void au_update_digen(struct dentry *dentry) +{ + atomic_set(&au_di(dentry)->di_generation, au_sigen(dentry->d_sb)); + /* smp_mb(); */ /* atomic_set */ +} + +void au_update_dbrange(struct dentry *dentry, int do_put_zero) +{ + struct au_dinfo *dinfo; + struct dentry *h_d; + struct au_hdentry *hdp; + + DiMustWriteLock(dentry); + + dinfo = au_di(dentry); + if (!dinfo || dinfo->di_bstart < 0) + return; + + hdp = dinfo->di_hdentry; + if (do_put_zero) { + aufs_bindex_t bindex, bend; + + bend = dinfo->di_bend; + for (bindex = dinfo->di_bstart; bindex <= bend; bindex++) { + h_d = hdp[0 + bindex].hd_dentry; + if (h_d && !h_d->d_inode) + au_set_h_dptr(dentry, bindex, NULL); + } + } + + dinfo->di_bstart = -1; + while (++dinfo->di_bstart <= dinfo->di_bend) + if (hdp[0 + dinfo->di_bstart].hd_dentry) + break; + if (dinfo->di_bstart > dinfo->di_bend) { + dinfo->di_bstart = -1; + dinfo->di_bend = -1; + return; + } + + dinfo->di_bend++; + while (0 <= --dinfo->di_bend) + if (hdp[0 + dinfo->di_bend].hd_dentry) + break; + AuDebugOn(dinfo->di_bstart > dinfo->di_bend || dinfo->di_bend < 0); +} + +void au_update_dbstart(struct dentry *dentry) +{ + aufs_bindex_t bindex, bend; + struct dentry *h_dentry; + + bend = au_dbend(dentry); + for (bindex = au_dbstart(dentry); bindex <= bend; bindex++) { + h_dentry = au_h_dptr(dentry, bindex); + if (!h_dentry) + continue; + if (h_dentry->d_inode) { + au_set_dbstart(dentry, bindex); + return; + } + au_set_h_dptr(dentry, bindex, NULL); + } +} + +void au_update_dbend(struct dentry *dentry) +{ + aufs_bindex_t bindex, bstart; + struct dentry *h_dentry; + + bstart = au_dbstart(dentry); + for (bindex = au_dbend(dentry); bindex >= bstart; bindex--) { + h_dentry = au_h_dptr(dentry, bindex); + if (!h_dentry) + continue; + if (h_dentry->d_inode) { + au_set_dbend(dentry, bindex); + return; + } + au_set_h_dptr(dentry, bindex, NULL); + } +} + +int au_find_dbindex(struct dentry *dentry, struct dentry *h_dentry) +{ + aufs_bindex_t bindex, bend; + + bend = au_dbend(dentry); + for (bindex = au_dbstart(dentry); bindex <= bend; bindex++) + if (au_h_dptr(dentry, bindex) == h_dentry) + return bindex; + return -1; +} diff --git a/fs/aufs/dir.c b/fs/aufs/dir.c new file mode 100644 index 00000000000000..ddd23a3f1f1e56 --- /dev/null +++ b/fs/aufs/dir.c @@ -0,0 +1,631 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * directory operations + */ + +#include +#include "aufs.h" + +void au_add_nlink(struct inode *dir, struct inode *h_dir) +{ + unsigned int nlink; + + AuDebugOn(!S_ISDIR(dir->i_mode) || !S_ISDIR(h_dir->i_mode)); + + nlink = dir->i_nlink; + nlink += h_dir->i_nlink - 2; + if (h_dir->i_nlink < 2) + nlink += 2; + smp_mb(); /* for i_nlink */ + /* 0 can happen in revaliding */ + set_nlink(dir, nlink); +} + +void au_sub_nlink(struct inode *dir, struct inode *h_dir) +{ + unsigned int nlink; + + AuDebugOn(!S_ISDIR(dir->i_mode) || !S_ISDIR(h_dir->i_mode)); + + nlink = dir->i_nlink; + nlink -= h_dir->i_nlink - 2; + if (h_dir->i_nlink < 2) + nlink -= 2; + smp_mb(); /* for i_nlink */ + /* nlink == 0 means the branch-fs is broken */ + set_nlink(dir, nlink); +} + +loff_t au_dir_size(struct file *file, struct dentry *dentry) +{ + loff_t sz; + aufs_bindex_t bindex, bend; + struct file *h_file; + struct dentry *h_dentry; + + sz = 0; + if (file) { + AuDebugOn(!file_inode(file)); + AuDebugOn(!S_ISDIR(file_inode(file)->i_mode)); + + bend = au_fbend_dir(file); + for (bindex = au_fbstart(file); + bindex <= bend && sz < KMALLOC_MAX_SIZE; + bindex++) { + h_file = au_hf_dir(file, bindex); + if (h_file && file_inode(h_file)) + sz += vfsub_f_size_read(h_file); + } + } else { + AuDebugOn(!dentry); + AuDebugOn(!dentry->d_inode); + AuDebugOn(!S_ISDIR(dentry->d_inode->i_mode)); + + bend = au_dbtaildir(dentry); + for (bindex = au_dbstart(dentry); + bindex <= bend && sz < KMALLOC_MAX_SIZE; + bindex++) { + h_dentry = au_h_dptr(dentry, bindex); + if (h_dentry && h_dentry->d_inode) + sz += i_size_read(h_dentry->d_inode); + } + } + if (sz < KMALLOC_MAX_SIZE) + sz = roundup_pow_of_two(sz); + if (sz > KMALLOC_MAX_SIZE) + sz = KMALLOC_MAX_SIZE; + else if (sz < NAME_MAX) { + BUILD_BUG_ON(AUFS_RDBLK_DEF < NAME_MAX); + sz = AUFS_RDBLK_DEF; + } + return sz; +} + +/* ---------------------------------------------------------------------- */ + +static int reopen_dir(struct file *file) +{ + int err; + unsigned int flags; + aufs_bindex_t bindex, btail, bstart; + struct dentry *dentry, *h_dentry; + struct file *h_file; + + /* open all lower dirs */ + dentry = file->f_dentry; + bstart = au_dbstart(dentry); + for (bindex = au_fbstart(file); bindex < bstart; bindex++) + au_set_h_fptr(file, bindex, NULL); + au_set_fbstart(file, bstart); + + btail = au_dbtaildir(dentry); + for (bindex = au_fbend_dir(file); btail < bindex; bindex--) + au_set_h_fptr(file, bindex, NULL); + au_set_fbend_dir(file, btail); + + flags = vfsub_file_flags(file); + for (bindex = bstart; bindex <= btail; bindex++) { + h_dentry = au_h_dptr(dentry, bindex); + if (!h_dentry) + continue; + h_file = au_hf_dir(file, bindex); + if (h_file) + continue; + + h_file = au_h_open(dentry, bindex, flags, file, /*force_wr*/0); + err = PTR_ERR(h_file); + if (IS_ERR(h_file)) + goto out; /* close all? */ + au_set_h_fptr(file, bindex, h_file); + } + au_update_figen(file); + /* todo: necessary? */ + /* file->f_ra = h_file->f_ra; */ + err = 0; + +out: + return err; +} + +static int do_open_dir(struct file *file, int flags) +{ + int err; + aufs_bindex_t bindex, btail; + struct dentry *dentry, *h_dentry; + struct file *h_file; + + FiMustWriteLock(file); + + err = 0; + dentry = file->f_dentry; + file->f_version = dentry->d_inode->i_version; + bindex = au_dbstart(dentry); + au_set_fbstart(file, bindex); + btail = au_dbtaildir(dentry); + au_set_fbend_dir(file, btail); + for (; !err && bindex <= btail; bindex++) { + h_dentry = au_h_dptr(dentry, bindex); + if (!h_dentry) + continue; + + h_file = au_h_open(dentry, bindex, flags, file, /*force_wr*/0); + if (IS_ERR(h_file)) { + err = PTR_ERR(h_file); + break; + } + au_set_h_fptr(file, bindex, h_file); + } + au_update_figen(file); + /* todo: necessary? */ + /* file->f_ra = h_file->f_ra; */ + if (!err) + return 0; /* success */ + + /* close all */ + for (bindex = au_fbstart(file); bindex <= btail; bindex++) + au_set_h_fptr(file, bindex, NULL); + au_set_fbstart(file, -1); + au_set_fbend_dir(file, -1); + + return err; +} + +static int aufs_open_dir(struct inode *inode __maybe_unused, + struct file *file) +{ + int err; + struct super_block *sb; + struct au_fidir *fidir; + + err = -ENOMEM; + sb = file->f_dentry->d_sb; + si_read_lock(sb, AuLock_FLUSH); + fidir = au_fidir_alloc(sb); + if (fidir) { + err = au_do_open(file, do_open_dir, fidir); + if (unlikely(err)) + kfree(fidir); + } + si_read_unlock(sb); + return err; +} + +static int aufs_release_dir(struct inode *inode __maybe_unused, + struct file *file) +{ + struct au_vdir *vdir_cache; + struct au_finfo *finfo; + struct au_fidir *fidir; + aufs_bindex_t bindex, bend; + + finfo = au_fi(file); + fidir = finfo->fi_hdir; + if (fidir) { + vdir_cache = fidir->fd_vdir_cache; /* lock-free */ + if (vdir_cache) + au_vdir_free(vdir_cache); + + bindex = finfo->fi_btop; + if (bindex >= 0) { + /* + * calls fput() instead of filp_close(), + * since no dnotify or lock for the lower file. + */ + bend = fidir->fd_bbot; + for (; bindex <= bend; bindex++) + au_set_h_fptr(file, bindex, NULL); + } + kfree(fidir); + finfo->fi_hdir = NULL; + } + au_finfo_fin(file); + return 0; +} + +/* ---------------------------------------------------------------------- */ + +static int au_do_flush_dir(struct file *file, fl_owner_t id) +{ + int err; + aufs_bindex_t bindex, bend; + struct file *h_file; + + err = 0; + bend = au_fbend_dir(file); + for (bindex = au_fbstart(file); !err && bindex <= bend; bindex++) { + h_file = au_hf_dir(file, bindex); + if (h_file) + err = vfsub_flush(h_file, id); + } + return err; +} + +static int aufs_flush_dir(struct file *file, fl_owner_t id) +{ + return au_do_flush(file, id, au_do_flush_dir); +} + +/* ---------------------------------------------------------------------- */ + +static int au_do_fsync_dir_no_file(struct dentry *dentry, int datasync) +{ + int err; + aufs_bindex_t bend, bindex; + struct inode *inode; + struct super_block *sb; + + err = 0; + sb = dentry->d_sb; + inode = dentry->d_inode; + IMustLock(inode); + bend = au_dbend(dentry); + for (bindex = au_dbstart(dentry); !err && bindex <= bend; bindex++) { + struct path h_path; + + if (au_test_ro(sb, bindex, inode)) + continue; + h_path.dentry = au_h_dptr(dentry, bindex); + if (!h_path.dentry) + continue; + + h_path.mnt = au_sbr_mnt(sb, bindex); + err = vfsub_fsync(NULL, &h_path, datasync); + } + + return err; +} + +static int au_do_fsync_dir(struct file *file, int datasync) +{ + int err; + aufs_bindex_t bend, bindex; + struct file *h_file; + struct super_block *sb; + struct inode *inode; + + err = au_reval_and_lock_fdi(file, reopen_dir, /*wlock*/1); + if (unlikely(err)) + goto out; + + sb = file->f_dentry->d_sb; + inode = file_inode(file); + bend = au_fbend_dir(file); + for (bindex = au_fbstart(file); !err && bindex <= bend; bindex++) { + h_file = au_hf_dir(file, bindex); + if (!h_file || au_test_ro(sb, bindex, inode)) + continue; + + err = vfsub_fsync(h_file, &h_file->f_path, datasync); + } + +out: + return err; +} + +/* + * @file may be NULL + */ +static int aufs_fsync_dir(struct file *file, loff_t start, loff_t end, + int datasync) +{ + int err; + struct dentry *dentry; + struct super_block *sb; + struct mutex *mtx; + + err = 0; + dentry = file->f_dentry; + mtx = &dentry->d_inode->i_mutex; + mutex_lock(mtx); + sb = dentry->d_sb; + si_noflush_read_lock(sb); + if (file) + err = au_do_fsync_dir(file, datasync); + else { + di_write_lock_child(dentry); + err = au_do_fsync_dir_no_file(dentry, datasync); + } + au_cpup_attr_timesizes(dentry->d_inode); + di_write_unlock(dentry); + if (file) + fi_write_unlock(file); + + si_read_unlock(sb); + mutex_unlock(mtx); + return err; +} + +/* ---------------------------------------------------------------------- */ + +static int aufs_readdir(struct file *file, void *dirent, filldir_t filldir) +{ + int err; + struct dentry *dentry; + struct inode *inode, *h_inode; + struct super_block *sb; + + dentry = file->f_dentry; + inode = dentry->d_inode; + IMustLock(inode); + + sb = dentry->d_sb; + si_read_lock(sb, AuLock_FLUSH); + err = au_reval_and_lock_fdi(file, reopen_dir, /*wlock*/1); + if (unlikely(err)) + goto out; + err = au_alive_dir(dentry); + if (!err) + err = au_vdir_init(file); + di_downgrade_lock(dentry, AuLock_IR); + if (unlikely(err)) + goto out_unlock; + + h_inode = au_h_iptr(inode, au_ibstart(inode)); + if (!au_test_nfsd()) { + err = au_vdir_fill_de(file, dirent, filldir); + fsstack_copy_attr_atime(inode, h_inode); + } else { + /* + * nfsd filldir may call lookup_one_len(), vfs_getattr(), + * encode_fh() and others. + */ + atomic_inc(&h_inode->i_count); + di_read_unlock(dentry, AuLock_IR); + si_read_unlock(sb); + err = au_vdir_fill_de(file, dirent, filldir); + fsstack_copy_attr_atime(inode, h_inode); + fi_write_unlock(file); + iput(h_inode); + + AuTraceErr(err); + return err; + } + +out_unlock: + di_read_unlock(dentry, AuLock_IR); + fi_write_unlock(file); +out: + si_read_unlock(sb); + return err; +} + +/* ---------------------------------------------------------------------- */ + +#define AuTestEmpty_WHONLY 1 +#define AuTestEmpty_CALLED (1 << 1) +#define AuTestEmpty_SHWH (1 << 2) +#define au_ftest_testempty(flags, name) ((flags) & AuTestEmpty_##name) +#define au_fset_testempty(flags, name) \ + do { (flags) |= AuTestEmpty_##name; } while (0) +#define au_fclr_testempty(flags, name) \ + do { (flags) &= ~AuTestEmpty_##name; } while (0) + +#ifndef CONFIG_AUFS_SHWH +#undef AuTestEmpty_SHWH +#define AuTestEmpty_SHWH 0 +#endif + +struct test_empty_arg { + struct au_nhash *whlist; + unsigned int flags; + int err; + aufs_bindex_t bindex; +}; + +static int test_empty_cb(void *__arg, const char *__name, int namelen, + loff_t offset __maybe_unused, u64 ino, + unsigned int d_type) +{ + struct test_empty_arg *arg = __arg; + char *name = (void *)__name; + + arg->err = 0; + au_fset_testempty(arg->flags, CALLED); + /* smp_mb(); */ + if (name[0] == '.' + && (namelen == 1 || (name[1] == '.' && namelen == 2))) + goto out; /* success */ + + if (namelen <= AUFS_WH_PFX_LEN + || memcmp(name, AUFS_WH_PFX, AUFS_WH_PFX_LEN)) { + if (au_ftest_testempty(arg->flags, WHONLY) + && !au_nhash_test_known_wh(arg->whlist, name, namelen)) + arg->err = -ENOTEMPTY; + goto out; + } + + name += AUFS_WH_PFX_LEN; + namelen -= AUFS_WH_PFX_LEN; + if (!au_nhash_test_known_wh(arg->whlist, name, namelen)) + arg->err = au_nhash_append_wh + (arg->whlist, name, namelen, ino, d_type, arg->bindex, + au_ftest_testempty(arg->flags, SHWH)); + +out: + /* smp_mb(); */ + AuTraceErr(arg->err); + return arg->err; +} + +static int do_test_empty(struct dentry *dentry, struct test_empty_arg *arg) +{ + int err; + struct file *h_file; + + h_file = au_h_open(dentry, arg->bindex, + O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_LARGEFILE, + /*file*/NULL, /*force_wr*/0); + err = PTR_ERR(h_file); + if (IS_ERR(h_file)) + goto out; + + err = 0; + if (!au_opt_test(au_mntflags(dentry->d_sb), UDBA_NONE) + && !file_inode(h_file)->i_nlink) + goto out_put; + + do { + arg->err = 0; + au_fclr_testempty(arg->flags, CALLED); + /* smp_mb(); */ + err = vfsub_readdir(h_file, test_empty_cb, arg); + if (err >= 0) + err = arg->err; + } while (!err && au_ftest_testempty(arg->flags, CALLED)); + +out_put: + fput(h_file); + au_sbr_put(dentry->d_sb, arg->bindex); +out: + return err; +} + +struct do_test_empty_args { + int *errp; + struct dentry *dentry; + struct test_empty_arg *arg; +}; + +static void call_do_test_empty(void *args) +{ + struct do_test_empty_args *a = args; + *a->errp = do_test_empty(a->dentry, a->arg); +} + +static int sio_test_empty(struct dentry *dentry, struct test_empty_arg *arg) +{ + int err, wkq_err; + struct dentry *h_dentry; + struct inode *h_inode; + + h_dentry = au_h_dptr(dentry, arg->bindex); + h_inode = h_dentry->d_inode; + /* todo: i_mode changes anytime? */ + mutex_lock_nested(&h_inode->i_mutex, AuLsc_I_CHILD); + err = au_test_h_perm_sio(h_inode, MAY_EXEC | MAY_READ); + mutex_unlock(&h_inode->i_mutex); + if (!err) + err = do_test_empty(dentry, arg); + else { + struct do_test_empty_args args = { + .errp = &err, + .dentry = dentry, + .arg = arg + }; + unsigned int flags = arg->flags; + + wkq_err = au_wkq_wait(call_do_test_empty, &args); + if (unlikely(wkq_err)) + err = wkq_err; + arg->flags = flags; + } + + return err; +} + +int au_test_empty_lower(struct dentry *dentry) +{ + int err; + unsigned int rdhash; + aufs_bindex_t bindex, bstart, btail; + struct au_nhash whlist; + struct test_empty_arg arg; + int (*test_empty)(struct dentry *dentry, struct test_empty_arg *arg); + + SiMustAnyLock(dentry->d_sb); + + rdhash = au_sbi(dentry->d_sb)->si_rdhash; + if (!rdhash) + rdhash = au_rdhash_est(au_dir_size(/*file*/NULL, dentry)); + err = au_nhash_alloc(&whlist, rdhash, GFP_NOFS); + if (unlikely(err)) + goto out; + + arg.flags = 0; + arg.whlist = &whlist; + bstart = au_dbstart(dentry); + if (au_opt_test(au_mntflags(dentry->d_sb), SHWH)) + au_fset_testempty(arg.flags, SHWH); + test_empty = do_test_empty; + if (au_opt_test(au_mntflags(dentry->d_sb), DIRPERM1)) + test_empty = sio_test_empty; + arg.bindex = bstart; + err = test_empty(dentry, &arg); + if (unlikely(err)) + goto out_whlist; + + au_fset_testempty(arg.flags, WHONLY); + btail = au_dbtaildir(dentry); + for (bindex = bstart + 1; !err && bindex <= btail; bindex++) { + struct dentry *h_dentry; + + h_dentry = au_h_dptr(dentry, bindex); + if (h_dentry && h_dentry->d_inode) { + arg.bindex = bindex; + err = test_empty(dentry, &arg); + } + } + +out_whlist: + au_nhash_wh_free(&whlist); +out: + return err; +} + +int au_test_empty(struct dentry *dentry, struct au_nhash *whlist) +{ + int err; + struct test_empty_arg arg; + aufs_bindex_t bindex, btail; + + err = 0; + arg.whlist = whlist; + arg.flags = AuTestEmpty_WHONLY; + if (au_opt_test(au_mntflags(dentry->d_sb), SHWH)) + au_fset_testempty(arg.flags, SHWH); + btail = au_dbtaildir(dentry); + for (bindex = au_dbstart(dentry); !err && bindex <= btail; bindex++) { + struct dentry *h_dentry; + + h_dentry = au_h_dptr(dentry, bindex); + if (h_dentry && h_dentry->d_inode) { + arg.bindex = bindex; + err = sio_test_empty(dentry, &arg); + } + } + + return err; +} + +/* ---------------------------------------------------------------------- */ + +const struct file_operations aufs_dir_fop = { + .owner = THIS_MODULE, + .llseek = default_llseek, + .read = generic_read_dir, + .readdir = aufs_readdir, + .unlocked_ioctl = aufs_ioctl_dir, +#ifdef CONFIG_COMPAT + .compat_ioctl = aufs_compat_ioctl_dir, +#endif + .open = aufs_open_dir, + .release = aufs_release_dir, + .flush = aufs_flush_dir, + .fsync = aufs_fsync_dir +}; diff --git a/fs/aufs/dir.h b/fs/aufs/dir.h new file mode 100644 index 00000000000000..e41c45d3a59850 --- /dev/null +++ b/fs/aufs/dir.h @@ -0,0 +1,130 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * directory operations + */ + +#ifndef __AUFS_DIR_H__ +#define __AUFS_DIR_H__ + +#ifdef __KERNEL__ + +#include + +/* ---------------------------------------------------------------------- */ + +/* need to be faster and smaller */ + +struct au_nhash { + unsigned int nh_num; + struct hlist_head *nh_head; +}; + +struct au_vdir_destr { + unsigned char len; + unsigned char name[0]; +} __packed; + +struct au_vdir_dehstr { + struct hlist_node hash; + struct au_vdir_destr *str; +} ____cacheline_aligned_in_smp; + +struct au_vdir_de { + ino_t de_ino; + unsigned char de_type; + /* caution: packed */ + struct au_vdir_destr de_str; +} __packed; + +struct au_vdir_wh { + struct hlist_node wh_hash; +#ifdef CONFIG_AUFS_SHWH + ino_t wh_ino; + aufs_bindex_t wh_bindex; + unsigned char wh_type; +#else + aufs_bindex_t wh_bindex; +#endif + /* caution: packed */ + struct au_vdir_destr wh_str; +} __packed; + +union au_vdir_deblk_p { + unsigned char *deblk; + struct au_vdir_de *de; +}; + +struct au_vdir { + unsigned char **vd_deblk; + unsigned long vd_nblk; + struct { + unsigned long ul; + union au_vdir_deblk_p p; + } vd_last; + + unsigned long vd_version; + unsigned int vd_deblk_sz; + unsigned long vd_jiffy; +} ____cacheline_aligned_in_smp; + +/* ---------------------------------------------------------------------- */ + +/* dir.c */ +extern const struct file_operations aufs_dir_fop; +void au_add_nlink(struct inode *dir, struct inode *h_dir); +void au_sub_nlink(struct inode *dir, struct inode *h_dir); +loff_t au_dir_size(struct file *file, struct dentry *dentry); +int au_test_empty_lower(struct dentry *dentry); +int au_test_empty(struct dentry *dentry, struct au_nhash *whlist); + +/* vdir.c */ +unsigned int au_rdhash_est(loff_t sz); +int au_nhash_alloc(struct au_nhash *nhash, unsigned int num_hash, gfp_t gfp); +void au_nhash_wh_free(struct au_nhash *whlist); +int au_nhash_test_longer_wh(struct au_nhash *whlist, aufs_bindex_t btgt, + int limit); +int au_nhash_test_known_wh(struct au_nhash *whlist, char *name, int nlen); +int au_nhash_append_wh(struct au_nhash *whlist, char *name, int nlen, ino_t ino, + unsigned int d_type, aufs_bindex_t bindex, + unsigned char shwh); +void au_vdir_free(struct au_vdir *vdir); +int au_vdir_init(struct file *file); +int au_vdir_fill_de(struct file *file, void *dirent, filldir_t filldir); + +/* ioctl.c */ +long aufs_ioctl_dir(struct file *file, unsigned int cmd, unsigned long arg); + +#ifdef CONFIG_AUFS_RDU +/* rdu.c */ +long au_rdu_ioctl(struct file *file, unsigned int cmd, unsigned long arg); +#ifdef CONFIG_COMPAT +long au_rdu_compat_ioctl(struct file *file, unsigned int cmd, + unsigned long arg); +#endif +#else +AuStub(long, au_rdu_ioctl, return -EINVAL, struct file *file, + unsigned int cmd, unsigned long arg) +#ifdef CONFIG_COMPAT +AuStub(long, au_rdu_compat_ioctl, return -EINVAL, struct file *file, + unsigned int cmd, unsigned long arg) +#endif +#endif + +#endif /* __KERNEL__ */ +#endif /* __AUFS_DIR_H__ */ diff --git a/fs/aufs/dynop.c b/fs/aufs/dynop.c new file mode 100644 index 00000000000000..24d32cef9cb705 --- /dev/null +++ b/fs/aufs/dynop.c @@ -0,0 +1,378 @@ +/* + * Copyright (C) 2010-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * dynamically customizable operations for regular files + */ + +#include "aufs.h" + +#define DyPrSym(key) AuDbgSym(key->dk_op.dy_hop) + +/* + * How large will these lists be? + * Usually just a few elements, 20-30 at most for each, I guess. + */ +static struct au_splhead dynop[AuDyLast]; + +static struct au_dykey *dy_gfind_get(struct au_splhead *spl, const void *h_op) +{ + struct au_dykey *key, *tmp; + struct list_head *head; + + key = NULL; + head = &spl->head; + rcu_read_lock(); + list_for_each_entry_rcu(tmp, head, dk_list) + if (tmp->dk_op.dy_hop == h_op) { + key = tmp; + kref_get(&key->dk_kref); + break; + } + rcu_read_unlock(); + + return key; +} + +static struct au_dykey *dy_bradd(struct au_branch *br, struct au_dykey *key) +{ + struct au_dykey **k, *found; + const void *h_op = key->dk_op.dy_hop; + int i; + + found = NULL; + k = br->br_dykey; + for (i = 0; i < AuBrDynOp; i++) + if (k[i]) { + if (k[i]->dk_op.dy_hop == h_op) { + found = k[i]; + break; + } + } else + break; + if (!found) { + spin_lock(&br->br_dykey_lock); + for (; i < AuBrDynOp; i++) + if (k[i]) { + if (k[i]->dk_op.dy_hop == h_op) { + found = k[i]; + break; + } + } else { + k[i] = key; + break; + } + spin_unlock(&br->br_dykey_lock); + BUG_ON(i == AuBrDynOp); /* expand the array */ + } + + return found; +} + +/* kref_get() if @key is already added */ +static struct au_dykey *dy_gadd(struct au_splhead *spl, struct au_dykey *key) +{ + struct au_dykey *tmp, *found; + struct list_head *head; + const void *h_op = key->dk_op.dy_hop; + + found = NULL; + head = &spl->head; + spin_lock(&spl->spin); + list_for_each_entry(tmp, head, dk_list) + if (tmp->dk_op.dy_hop == h_op) { + kref_get(&tmp->dk_kref); + found = tmp; + break; + } + if (!found) + list_add_rcu(&key->dk_list, head); + spin_unlock(&spl->spin); + + if (!found) + DyPrSym(key); + return found; +} + +static void dy_free_rcu(struct rcu_head *rcu) +{ + struct au_dykey *key; + + key = container_of(rcu, struct au_dykey, dk_rcu); + DyPrSym(key); + kfree(key); +} + +static void dy_free(struct kref *kref) +{ + struct au_dykey *key; + struct au_splhead *spl; + + key = container_of(kref, struct au_dykey, dk_kref); + spl = dynop + key->dk_op.dy_type; + au_spl_del_rcu(&key->dk_list, spl); + call_rcu(&key->dk_rcu, dy_free_rcu); +} + +void au_dy_put(struct au_dykey *key) +{ + kref_put(&key->dk_kref, dy_free); +} + +/* ---------------------------------------------------------------------- */ + +#define DyDbgSize(cnt, op) AuDebugOn(cnt != sizeof(op)/sizeof(void *)) + +#ifdef CONFIG_AUFS_DEBUG +#define DyDbgDeclare(cnt) unsigned int cnt = 0 +#define DyDbgInc(cnt) do { cnt++; } while (0) +#else +#define DyDbgDeclare(cnt) do {} while (0) +#define DyDbgInc(cnt) do {} while (0) +#endif + +#define DySet(func, dst, src, h_op, h_sb) do { \ + DyDbgInc(cnt); \ + if (h_op->func) { \ + if (src.func) \ + dst.func = src.func; \ + else \ + AuDbg("%s %s\n", au_sbtype(h_sb), #func); \ + } \ +} while (0) + +#define DySetForce(func, dst, src) do { \ + AuDebugOn(!src.func); \ + DyDbgInc(cnt); \ + dst.func = src.func; \ +} while (0) + +#define DySetAop(func) \ + DySet(func, dyaop->da_op, aufs_aop, h_aop, h_sb) +#define DySetAopForce(func) \ + DySetForce(func, dyaop->da_op, aufs_aop) + +static void dy_aop(struct au_dykey *key, const void *h_op, + struct super_block *h_sb __maybe_unused) +{ + struct au_dyaop *dyaop = (void *)key; + const struct address_space_operations *h_aop = h_op; + DyDbgDeclare(cnt); + + AuDbg("%s\n", au_sbtype(h_sb)); + + DySetAop(writepage); + DySetAopForce(readpage); /* force */ + DySetAop(writepages); + DySetAop(set_page_dirty); + DySetAop(readpages); + DySetAop(write_begin); + DySetAop(write_end); + DySetAop(bmap); + DySetAop(invalidatepage); + DySetAop(releasepage); + DySetAop(freepage); + /* these two will be changed according to an aufs mount option */ + DySetAop(direct_IO); + DySetAop(get_xip_mem); + DySetAop(migratepage); + DySetAop(launder_page); + DySetAop(is_partially_uptodate); + DySetAop(error_remove_page); + DySetAop(swap_activate); + DySetAop(swap_deactivate); + + DyDbgSize(cnt, *h_aop); + dyaop->da_get_xip_mem = h_aop->get_xip_mem; +} + +/* ---------------------------------------------------------------------- */ + +static void dy_bug(struct kref *kref) +{ + BUG(); +} + +static struct au_dykey *dy_get(struct au_dynop *op, struct au_branch *br) +{ + struct au_dykey *key, *old; + struct au_splhead *spl; + struct op { + unsigned int sz; + void (*set)(struct au_dykey *key, const void *h_op, + struct super_block *h_sb __maybe_unused); + }; + static const struct op a[] = { + [AuDy_AOP] = { + .sz = sizeof(struct au_dyaop), + .set = dy_aop + } + }; + const struct op *p; + + spl = dynop + op->dy_type; + key = dy_gfind_get(spl, op->dy_hop); + if (key) + goto out_add; /* success */ + + p = a + op->dy_type; + key = kzalloc(p->sz, GFP_NOFS); + if (unlikely(!key)) { + key = ERR_PTR(-ENOMEM); + goto out; + } + + key->dk_op.dy_hop = op->dy_hop; + kref_init(&key->dk_kref); + p->set(key, op->dy_hop, au_br_sb(br)); + old = dy_gadd(spl, key); + if (old) { + kfree(key); + key = old; + } + +out_add: + old = dy_bradd(br, key); + if (old) + /* its ref-count should never be zero here */ + kref_put(&key->dk_kref, dy_bug); +out: + return key; +} + +/* ---------------------------------------------------------------------- */ +/* + * Aufs prohibits O_DIRECT by defaut even if the branch supports it. + * This behaviour is necessary to return an error from open(O_DIRECT) instead + * of the succeeding I/O. The dio mount option enables O_DIRECT and makes + * open(O_DIRECT) always succeed, but the succeeding I/O may return an error. + * See the aufs manual in detail. + * + * To keep this behaviour, aufs has to set NULL to ->get_xip_mem too, and the + * performance of fadvise() and madvise() may be affected. + */ +static void dy_adx(struct au_dyaop *dyaop, int do_dx) +{ + if (!do_dx) { + dyaop->da_op.direct_IO = NULL; + dyaop->da_op.get_xip_mem = NULL; + } else { + dyaop->da_op.direct_IO = aufs_aop.direct_IO; + dyaop->da_op.get_xip_mem = aufs_aop.get_xip_mem; + if (!dyaop->da_get_xip_mem) + dyaop->da_op.get_xip_mem = NULL; + } +} + +static struct au_dyaop *dy_aget(struct au_branch *br, + const struct address_space_operations *h_aop, + int do_dx) +{ + struct au_dyaop *dyaop; + struct au_dynop op; + + op.dy_type = AuDy_AOP; + op.dy_haop = h_aop; + dyaop = (void *)dy_get(&op, br); + if (IS_ERR(dyaop)) + goto out; + dy_adx(dyaop, do_dx); + +out: + return dyaop; +} + +int au_dy_iaop(struct inode *inode, aufs_bindex_t bindex, + struct inode *h_inode) +{ + int err, do_dx; + struct super_block *sb; + struct au_branch *br; + struct au_dyaop *dyaop; + + AuDebugOn(!S_ISREG(h_inode->i_mode)); + IiMustWriteLock(inode); + + sb = inode->i_sb; + br = au_sbr(sb, bindex); + do_dx = !!au_opt_test(au_mntflags(sb), DIO); + dyaop = dy_aget(br, h_inode->i_mapping->a_ops, do_dx); + err = PTR_ERR(dyaop); + if (IS_ERR(dyaop)) + /* unnecessary to call dy_fput() */ + goto out; + + err = 0; + inode->i_mapping->a_ops = &dyaop->da_op; + +out: + return err; +} + +/* + * Is it safe to replace a_ops during the inode/file is in operation? + * Yes, I hope so. + */ +int au_dy_irefresh(struct inode *inode) +{ + int err; + aufs_bindex_t bstart; + struct inode *h_inode; + + err = 0; + if (S_ISREG(inode->i_mode)) { + bstart = au_ibstart(inode); + h_inode = au_h_iptr(inode, bstart); + err = au_dy_iaop(inode, bstart, h_inode); + } + return err; +} + +void au_dy_arefresh(int do_dx) +{ + struct au_splhead *spl; + struct list_head *head; + struct au_dykey *key; + + spl = dynop + AuDy_AOP; + head = &spl->head; + spin_lock(&spl->spin); + list_for_each_entry(key, head, dk_list) + dy_adx((void *)key, do_dx); + spin_unlock(&spl->spin); +} + +/* ---------------------------------------------------------------------- */ + +void __init au_dy_init(void) +{ + int i; + + /* make sure that 'struct au_dykey *' can be any type */ + BUILD_BUG_ON(offsetof(struct au_dyaop, da_key)); + + for (i = 0; i < AuDyLast; i++) + au_spl_init(dynop + i); +} + +void au_dy_fin(void) +{ + int i; + + for (i = 0; i < AuDyLast; i++) + WARN_ON(!list_empty(&dynop[i].head)); +} diff --git a/fs/aufs/dynop.h b/fs/aufs/dynop.h new file mode 100644 index 00000000000000..9b7f9c6ac18e6b --- /dev/null +++ b/fs/aufs/dynop.h @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2010-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * dynamically customizable operations (for regular files only) + */ + +#ifndef __AUFS_DYNOP_H__ +#define __AUFS_DYNOP_H__ + +#ifdef __KERNEL__ + +#include "inode.h" + +enum {AuDy_AOP, AuDyLast}; + +struct au_dynop { + int dy_type; + union { + const void *dy_hop; + const struct address_space_operations *dy_haop; + }; +}; + +struct au_dykey { + union { + struct list_head dk_list; + struct rcu_head dk_rcu; + }; + struct au_dynop dk_op; + + /* + * during I am in the branch local array, kref is gotten. when the + * branch is removed, kref is put. + */ + struct kref dk_kref; +}; + +/* stop unioning since their sizes are very different from each other */ +struct au_dyaop { + struct au_dykey da_key; + struct address_space_operations da_op; /* not const */ + int (*da_get_xip_mem)(struct address_space *, pgoff_t, int, + void **, unsigned long *); +}; + +/* ---------------------------------------------------------------------- */ + +/* dynop.c */ +struct au_branch; +void au_dy_put(struct au_dykey *key); +int au_dy_iaop(struct inode *inode, aufs_bindex_t bindex, + struct inode *h_inode); +int au_dy_irefresh(struct inode *inode); +void au_dy_arefresh(int do_dio); + +void __init au_dy_init(void); +void au_dy_fin(void); + +#endif /* __KERNEL__ */ +#endif /* __AUFS_DYNOP_H__ */ diff --git a/fs/aufs/export.c b/fs/aufs/export.c new file mode 100644 index 00000000000000..24e746ae7e8ff1 --- /dev/null +++ b/fs/aufs/export.c @@ -0,0 +1,825 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * export via nfs + */ + +#include +#include +#include +#include +#include +#include +#include "../fs/mount.h" +#include "aufs.h" + +union conv { +#ifdef CONFIG_AUFS_INO_T_64 + __u32 a[2]; +#else + __u32 a[1]; +#endif + ino_t ino; +}; + +static ino_t decode_ino(__u32 *a) +{ + union conv u; + + BUILD_BUG_ON(sizeof(u.ino) != sizeof(u.a)); + u.a[0] = a[0]; +#ifdef CONFIG_AUFS_INO_T_64 + u.a[1] = a[1]; +#endif + return u.ino; +} + +static void encode_ino(__u32 *a, ino_t ino) +{ + union conv u; + + u.ino = ino; + a[0] = u.a[0]; +#ifdef CONFIG_AUFS_INO_T_64 + a[1] = u.a[1]; +#endif +} + +/* NFS file handle */ +enum { + Fh_br_id, + Fh_sigen, +#ifdef CONFIG_AUFS_INO_T_64 + /* support 64bit inode number */ + Fh_ino1, + Fh_ino2, + Fh_dir_ino1, + Fh_dir_ino2, +#else + Fh_ino1, + Fh_dir_ino1, +#endif + Fh_igen, + Fh_h_type, + Fh_tail, + + Fh_ino = Fh_ino1, + Fh_dir_ino = Fh_dir_ino1 +}; + +static int au_test_anon(struct dentry *dentry) +{ + /* note: read d_flags without d_lock */ + return !!(dentry->d_flags & DCACHE_DISCONNECTED); +} + +int au_test_nfsd(void) +{ + int ret; + struct task_struct *tsk = current; + char comm[sizeof(tsk->comm)]; + + ret = 0; + if (tsk->flags & PF_KTHREAD) { + get_task_comm(comm, tsk); + ret = !strcmp(comm, "nfsd"); + } + + return ret; +} + +/* ---------------------------------------------------------------------- */ +/* inode generation external table */ + +void au_xigen_inc(struct inode *inode) +{ + loff_t pos; + ssize_t sz; + __u32 igen; + struct super_block *sb; + struct au_sbinfo *sbinfo; + + sb = inode->i_sb; + AuDebugOn(!au_opt_test(au_mntflags(sb), XINO)); + + sbinfo = au_sbi(sb); + pos = inode->i_ino; + pos *= sizeof(igen); + igen = inode->i_generation + 1; + sz = xino_fwrite(sbinfo->si_xwrite, sbinfo->si_xigen, &igen, + sizeof(igen), &pos); + if (sz == sizeof(igen)) + return; /* success */ + + if (unlikely(sz >= 0)) + AuIOErr("xigen error (%zd)\n", sz); +} + +int au_xigen_new(struct inode *inode) +{ + int err; + loff_t pos; + ssize_t sz; + struct super_block *sb; + struct au_sbinfo *sbinfo; + struct file *file; + + err = 0; + /* todo: dirty, at mount time */ + if (inode->i_ino == AUFS_ROOT_INO) + goto out; + sb = inode->i_sb; + SiMustAnyLock(sb); + if (unlikely(!au_opt_test(au_mntflags(sb), XINO))) + goto out; + + err = -EFBIG; + pos = inode->i_ino; + if (unlikely(au_loff_max / sizeof(inode->i_generation) - 1 < pos)) { + AuIOErr1("too large i%lld\n", pos); + goto out; + } + pos *= sizeof(inode->i_generation); + + err = 0; + sbinfo = au_sbi(sb); + file = sbinfo->si_xigen; + BUG_ON(!file); + + if (vfsub_f_size_read(file) + < pos + sizeof(inode->i_generation)) { + inode->i_generation = atomic_inc_return(&sbinfo->si_xigen_next); + sz = xino_fwrite(sbinfo->si_xwrite, file, &inode->i_generation, + sizeof(inode->i_generation), &pos); + } else + sz = xino_fread(sbinfo->si_xread, file, &inode->i_generation, + sizeof(inode->i_generation), &pos); + if (sz == sizeof(inode->i_generation)) + goto out; /* success */ + + err = sz; + if (unlikely(sz >= 0)) { + err = -EIO; + AuIOErr("xigen error (%zd)\n", sz); + } + +out: + return err; +} + +int au_xigen_set(struct super_block *sb, struct file *base) +{ + int err; + struct au_sbinfo *sbinfo; + struct file *file; + + SiMustWriteLock(sb); + + sbinfo = au_sbi(sb); + file = au_xino_create2(base, sbinfo->si_xigen); + err = PTR_ERR(file); + if (IS_ERR(file)) + goto out; + err = 0; + if (sbinfo->si_xigen) + fput(sbinfo->si_xigen); + sbinfo->si_xigen = file; + +out: + return err; +} + +void au_xigen_clr(struct super_block *sb) +{ + struct au_sbinfo *sbinfo; + + SiMustWriteLock(sb); + + sbinfo = au_sbi(sb); + if (sbinfo->si_xigen) { + fput(sbinfo->si_xigen); + sbinfo->si_xigen = NULL; + } +} + +/* ---------------------------------------------------------------------- */ + +static struct dentry *decode_by_ino(struct super_block *sb, ino_t ino, + ino_t dir_ino) +{ + struct dentry *dentry, *d; + struct inode *inode; + unsigned int sigen; + + dentry = NULL; + inode = ilookup(sb, ino); + if (!inode) + goto out; + + dentry = ERR_PTR(-ESTALE); + sigen = au_sigen(sb); + if (unlikely(is_bad_inode(inode) + || IS_DEADDIR(inode) + || sigen != au_iigen(inode, NULL))) + goto out_iput; + + dentry = NULL; + if (!dir_ino || S_ISDIR(inode->i_mode)) + dentry = d_find_alias(inode); + else { + spin_lock(&inode->i_lock); + hlist_for_each_entry(d, &inode->i_dentry, d_u.d_alias) { + spin_lock(&d->d_lock); + if (!au_test_anon(d) + && d->d_parent->d_inode->i_ino == dir_ino) { + dentry = dget_dlock(d); + spin_unlock(&d->d_lock); + break; + } + spin_unlock(&d->d_lock); + } + spin_unlock(&inode->i_lock); + } + if (unlikely(dentry && au_digen_test(dentry, sigen))) { + /* need to refresh */ + dput(dentry); + dentry = NULL; + } + +out_iput: + iput(inode); +out: + AuTraceErrPtr(dentry); + return dentry; +} + +/* ---------------------------------------------------------------------- */ + +/* todo: dirty? */ +/* if exportfs_decode_fh() passed vfsmount*, we could be happy */ + +struct au_compare_mnt_args { + /* input */ + struct super_block *sb; + + /* output */ + struct vfsmount *mnt; +}; + +static int au_compare_mnt(struct vfsmount *mnt, void *arg) +{ + struct au_compare_mnt_args *a = arg; + + if (mnt->mnt_sb != a->sb) + return 0; + a->mnt = mntget(mnt); + return 1; +} + +static struct vfsmount *au_mnt_get(struct super_block *sb) +{ + int err; + struct path root; + struct au_compare_mnt_args args = { + .sb = sb + }; + + get_fs_root(current->fs, &root); + rcu_read_lock(); + err = iterate_mounts(au_compare_mnt, &args, root.mnt); + rcu_read_unlock(); + path_put(&root); + AuDebugOn(!err); + AuDebugOn(!args.mnt); + return args.mnt; +} + +struct au_nfsd_si_lock { + unsigned int sigen; + aufs_bindex_t bindex, br_id; + unsigned char force_lock; +}; + +static int si_nfsd_read_lock(struct super_block *sb, + struct au_nfsd_si_lock *nsi_lock) +{ + int err; + aufs_bindex_t bindex; + + si_read_lock(sb, AuLock_FLUSH); + + /* branch id may be wrapped around */ + err = 0; + bindex = au_br_index(sb, nsi_lock->br_id); + if (bindex >= 0 && nsi_lock->sigen + AUFS_BRANCH_MAX > au_sigen(sb)) + goto out; /* success */ + + err = -ESTALE; + bindex = -1; + if (!nsi_lock->force_lock) + si_read_unlock(sb); + +out: + nsi_lock->bindex = bindex; + return err; +} + +struct find_name_by_ino { + int called, found; + ino_t ino; + char *name; + int namelen; +}; + +static int +find_name_by_ino(void *arg, const char *name, int namelen, loff_t offset, + u64 ino, unsigned int d_type) +{ + struct find_name_by_ino *a = arg; + + a->called++; + if (a->ino != ino) + return 0; + + memcpy(a->name, name, namelen); + a->namelen = namelen; + a->found = 1; + return 1; +} + +static struct dentry *au_lkup_by_ino(struct path *path, ino_t ino, + struct au_nfsd_si_lock *nsi_lock) +{ + struct dentry *dentry, *parent; + struct file *file; + struct inode *dir; + struct find_name_by_ino arg; + int err; + + parent = path->dentry; + if (nsi_lock) + si_read_unlock(parent->d_sb); + file = vfsub_dentry_open(path, au_dir_roflags); + dentry = (void *)file; + if (IS_ERR(file)) + goto out; + + dentry = ERR_PTR(-ENOMEM); + arg.name = (void *)__get_free_page(GFP_NOFS); + if (unlikely(!arg.name)) + goto out_file; + arg.ino = ino; + arg.found = 0; + do { + arg.called = 0; + /* smp_mb(); */ + err = vfsub_readdir(file, find_name_by_ino, &arg); + } while (!err && !arg.found && arg.called); + dentry = ERR_PTR(err); + if (unlikely(err)) + goto out_name; + /* instead of ENOENT */ + dentry = ERR_PTR(-ESTALE); + if (!arg.found) + goto out_name; + + /* do not call vfsub_lkup_one() */ + dir = parent->d_inode; + mutex_lock(&dir->i_mutex); + dentry = vfsub_lookup_one_len(arg.name, parent, arg.namelen); + mutex_unlock(&dir->i_mutex); + AuTraceErrPtr(dentry); + if (IS_ERR(dentry)) + goto out_name; + AuDebugOn(au_test_anon(dentry)); + if (unlikely(!dentry->d_inode)) { + dput(dentry); + dentry = ERR_PTR(-ENOENT); + } + +out_name: + free_page((unsigned long)arg.name); +out_file: + fput(file); +out: + if (unlikely(nsi_lock + && si_nfsd_read_lock(parent->d_sb, nsi_lock) < 0)) + if (!IS_ERR(dentry)) { + dput(dentry); + dentry = ERR_PTR(-ESTALE); + } + AuTraceErrPtr(dentry); + return dentry; +} + +static struct dentry *decode_by_dir_ino(struct super_block *sb, ino_t ino, + ino_t dir_ino, + struct au_nfsd_si_lock *nsi_lock) +{ + struct dentry *dentry; + struct path path; + + if (dir_ino != AUFS_ROOT_INO) { + path.dentry = decode_by_ino(sb, dir_ino, 0); + dentry = path.dentry; + if (!path.dentry || IS_ERR(path.dentry)) + goto out; + AuDebugOn(au_test_anon(path.dentry)); + } else + path.dentry = dget(sb->s_root); + + path.mnt = au_mnt_get(sb); + dentry = au_lkup_by_ino(&path, ino, nsi_lock); + path_put(&path); + +out: + AuTraceErrPtr(dentry); + return dentry; +} + +/* ---------------------------------------------------------------------- */ + +static int h_acceptable(void *expv, struct dentry *dentry) +{ + return 1; +} + +static char *au_build_path(struct dentry *h_parent, struct path *h_rootpath, + char *buf, int len, struct super_block *sb) +{ + char *p; + int n; + struct path path; + + p = d_path(h_rootpath, buf, len); + if (IS_ERR(p)) + goto out; + n = strlen(p); + + path.mnt = h_rootpath->mnt; + path.dentry = h_parent; + p = d_path(&path, buf, len); + if (IS_ERR(p)) + goto out; + if (n != 1) + p += n; + + path.mnt = au_mnt_get(sb); + path.dentry = sb->s_root; + p = d_path(&path, buf, len - strlen(p)); + mntput(path.mnt); + if (IS_ERR(p)) + goto out; + if (n != 1) + p[strlen(p)] = '/'; + +out: + AuTraceErrPtr(p); + return p; +} + +static +struct dentry *decode_by_path(struct super_block *sb, ino_t ino, __u32 *fh, + int fh_len, struct au_nfsd_si_lock *nsi_lock) +{ + struct dentry *dentry, *h_parent, *root; + struct super_block *h_sb; + char *pathname, *p; + struct vfsmount *h_mnt; + struct au_branch *br; + int err; + struct path path; + + br = au_sbr(sb, nsi_lock->bindex); + h_mnt = au_br_mnt(br); + h_sb = h_mnt->mnt_sb; + /* todo: call lower fh_to_dentry()? fh_to_parent()? */ + h_parent = exportfs_decode_fh(h_mnt, (void *)(fh + Fh_tail), + fh_len - Fh_tail, fh[Fh_h_type], + h_acceptable, /*context*/NULL); + dentry = h_parent; + if (unlikely(!h_parent || IS_ERR(h_parent))) { + AuWarn1("%s decode_fh failed, %ld\n", + au_sbtype(h_sb), PTR_ERR(h_parent)); + goto out; + } + dentry = NULL; + if (unlikely(au_test_anon(h_parent))) { + AuWarn1("%s decode_fh returned a disconnected dentry\n", + au_sbtype(h_sb)); + goto out_h_parent; + } + + dentry = ERR_PTR(-ENOMEM); + pathname = (void *)__get_free_page(GFP_NOFS); + if (unlikely(!pathname)) + goto out_h_parent; + + root = sb->s_root; + path.mnt = h_mnt; + di_read_lock_parent(root, !AuLock_IR); + path.dentry = au_h_dptr(root, nsi_lock->bindex); + di_read_unlock(root, !AuLock_IR); + p = au_build_path(h_parent, &path, pathname, PAGE_SIZE, sb); + dentry = (void *)p; + if (IS_ERR(p)) + goto out_pathname; + + si_read_unlock(sb); + err = vfsub_kern_path(p, LOOKUP_FOLLOW | LOOKUP_DIRECTORY, &path); + dentry = ERR_PTR(err); + if (unlikely(err)) + goto out_relock; + + dentry = ERR_PTR(-ENOENT); + AuDebugOn(au_test_anon(path.dentry)); + if (unlikely(!path.dentry->d_inode)) + goto out_path; + + if (ino != path.dentry->d_inode->i_ino) + dentry = au_lkup_by_ino(&path, ino, /*nsi_lock*/NULL); + else + dentry = dget(path.dentry); + +out_path: + path_put(&path); +out_relock: + if (unlikely(si_nfsd_read_lock(sb, nsi_lock) < 0)) + if (!IS_ERR(dentry)) { + dput(dentry); + dentry = ERR_PTR(-ESTALE); + } +out_pathname: + free_page((unsigned long)pathname); +out_h_parent: + dput(h_parent); +out: + AuTraceErrPtr(dentry); + return dentry; +} + +/* ---------------------------------------------------------------------- */ + +static struct dentry * +aufs_fh_to_dentry(struct super_block *sb, struct fid *fid, int fh_len, + int fh_type) +{ + struct dentry *dentry; + __u32 *fh = fid->raw; + struct au_branch *br; + ino_t ino, dir_ino; + struct au_nfsd_si_lock nsi_lock = { + .force_lock = 0 + }; + + dentry = ERR_PTR(-ESTALE); + /* it should never happen, but the file handle is unreliable */ + if (unlikely(fh_len < Fh_tail)) + goto out; + nsi_lock.sigen = fh[Fh_sigen]; + nsi_lock.br_id = fh[Fh_br_id]; + + /* branch id may be wrapped around */ + br = NULL; + if (unlikely(si_nfsd_read_lock(sb, &nsi_lock))) + goto out; + nsi_lock.force_lock = 1; + + /* is this inode still cached? */ + ino = decode_ino(fh + Fh_ino); + /* it should never happen */ + if (unlikely(ino == AUFS_ROOT_INO)) + goto out; + + dir_ino = decode_ino(fh + Fh_dir_ino); + dentry = decode_by_ino(sb, ino, dir_ino); + if (IS_ERR(dentry)) + goto out_unlock; + if (dentry) + goto accept; + + /* is the parent dir cached? */ + br = au_sbr(sb, nsi_lock.bindex); + atomic_inc(&br->br_count); + dentry = decode_by_dir_ino(sb, ino, dir_ino, &nsi_lock); + if (IS_ERR(dentry)) + goto out_unlock; + if (dentry) + goto accept; + + /* lookup path */ + dentry = decode_by_path(sb, ino, fh, fh_len, &nsi_lock); + if (IS_ERR(dentry)) + goto out_unlock; + if (unlikely(!dentry)) + /* todo?: make it ESTALE */ + goto out_unlock; + +accept: + if (!au_digen_test(dentry, au_sigen(sb)) + && dentry->d_inode->i_generation == fh[Fh_igen]) + goto out_unlock; /* success */ + + dput(dentry); + dentry = ERR_PTR(-ESTALE); +out_unlock: + if (br) + atomic_dec(&br->br_count); + si_read_unlock(sb); +out: + AuTraceErrPtr(dentry); + return dentry; +} + +#if 0 /* reserved for future use */ +/* support subtreecheck option */ +static struct dentry *aufs_fh_to_parent(struct super_block *sb, struct fid *fid, + int fh_len, int fh_type) +{ + struct dentry *parent; + __u32 *fh = fid->raw; + ino_t dir_ino; + + dir_ino = decode_ino(fh + Fh_dir_ino); + parent = decode_by_ino(sb, dir_ino, 0); + if (IS_ERR(parent)) + goto out; + if (!parent) + parent = decode_by_path(sb, au_br_index(sb, fh[Fh_br_id]), + dir_ino, fh, fh_len); + +out: + AuTraceErrPtr(parent); + return parent; +} +#endif + +/* ---------------------------------------------------------------------- */ + +static int aufs_encode_fh(struct inode *inode, __u32 *fh, int *max_len, + struct inode *dir) +{ + int err; + aufs_bindex_t bindex; + struct super_block *sb, *h_sb; + struct dentry *dentry, *parent, *h_parent; + struct inode *h_dir; + struct au_branch *br; + + err = -ENOSPC; + if (unlikely(*max_len <= Fh_tail)) { + AuWarn1("NFSv2 client (max_len %d)?\n", *max_len); + goto out; + } + + err = FILEID_ROOT; + if (inode->i_ino == AUFS_ROOT_INO) { + AuDebugOn(inode->i_ino != AUFS_ROOT_INO); + goto out; + } + + h_parent = NULL; + sb = inode->i_sb; + err = si_read_lock(sb, AuLock_FLUSH); + if (unlikely(err)) + goto out; + +#ifdef CONFIG_AUFS_DEBUG + if (unlikely(!au_opt_test(au_mntflags(sb), XINO))) + AuWarn1("NFS-exporting requires xino\n"); +#endif + err = -EIO; + parent = NULL; + ii_read_lock_child(inode); + bindex = au_ibstart(inode); + if (!dir) { + dentry = d_find_any_alias(inode); + if (unlikely(!dentry)) + goto out_unlock; + AuDebugOn(au_test_anon(dentry)); + parent = dget_parent(dentry); + dput(dentry); + if (unlikely(!parent)) + goto out_unlock; + dir = parent->d_inode; + } + + ii_read_lock_parent(dir); + h_dir = au_h_iptr(dir, bindex); + ii_read_unlock(dir); + if (unlikely(!h_dir)) + goto out_parent; + h_parent = d_find_any_alias(h_dir); + if (unlikely(!h_parent)) + goto out_hparent; + + err = -EPERM; + br = au_sbr(sb, bindex); + h_sb = au_br_sb(br); + if (unlikely(!h_sb->s_export_op)) { + AuErr1("%s branch is not exportable\n", au_sbtype(h_sb)); + goto out_hparent; + } + + fh[Fh_br_id] = br->br_id; + fh[Fh_sigen] = au_sigen(sb); + encode_ino(fh + Fh_ino, inode->i_ino); + encode_ino(fh + Fh_dir_ino, dir->i_ino); + fh[Fh_igen] = inode->i_generation; + + *max_len -= Fh_tail; + fh[Fh_h_type] = exportfs_encode_fh(h_parent, (void *)(fh + Fh_tail), + max_len, + /*connectable or subtreecheck*/0); + err = fh[Fh_h_type]; + *max_len += Fh_tail; + /* todo: macros? */ + if (err != FILEID_INVALID) + err = 99; + else + AuWarn1("%s encode_fh failed\n", au_sbtype(h_sb)); + +out_hparent: + dput(h_parent); +out_parent: + dput(parent); +out_unlock: + ii_read_unlock(inode); + si_read_unlock(sb); +out: + if (unlikely(err < 0)) + err = FILEID_INVALID; + return err; +} + +/* ---------------------------------------------------------------------- */ + +static int aufs_commit_metadata(struct inode *inode) +{ + int err; + aufs_bindex_t bindex; + struct super_block *sb; + struct inode *h_inode; + int (*f)(struct inode *inode); + + sb = inode->i_sb; + si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW); + ii_write_lock_child(inode); + bindex = au_ibstart(inode); + AuDebugOn(bindex < 0); + h_inode = au_h_iptr(inode, bindex); + + f = h_inode->i_sb->s_export_op->commit_metadata; + if (f) + err = f(h_inode); + else { + struct writeback_control wbc = { + .sync_mode = WB_SYNC_ALL, + .nr_to_write = 0 /* metadata only */ + }; + + err = sync_inode(h_inode, &wbc); + } + + au_cpup_attr_timesizes(inode); + ii_write_unlock(inode); + si_read_unlock(sb); + return err; +} + +/* ---------------------------------------------------------------------- */ + +static struct export_operations aufs_export_op = { + .fh_to_dentry = aufs_fh_to_dentry, + /* .fh_to_parent = aufs_fh_to_parent, */ + .encode_fh = aufs_encode_fh, + .commit_metadata = aufs_commit_metadata +}; + +void au_export_init(struct super_block *sb) +{ + struct au_sbinfo *sbinfo; + __u32 u; + + sb->s_export_op = &aufs_export_op; + sbinfo = au_sbi(sb); + sbinfo->si_xigen = NULL; + get_random_bytes(&u, sizeof(u)); + BUILD_BUG_ON(sizeof(u) != sizeof(int)); + atomic_set(&sbinfo->si_xigen_next, u); +} diff --git a/fs/aufs/f_op.c b/fs/aufs/f_op.c new file mode 100644 index 00000000000000..4236287ba9d720 --- /dev/null +++ b/fs/aufs/f_op.c @@ -0,0 +1,796 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * file and vm operations + */ + +#include +#include +#include +#include +#include "aufs.h" + +int au_do_open_nondir(struct file *file, int flags) +{ + int err; + aufs_bindex_t bindex; + struct file *h_file; + struct dentry *dentry; + struct au_finfo *finfo; + + FiMustWriteLock(file); + + err = 0; + dentry = file->f_dentry; + finfo = au_fi(file); + memset(&finfo->fi_htop, 0, sizeof(finfo->fi_htop)); + atomic_set(&finfo->fi_mmapped, 0); + bindex = au_dbstart(dentry); + h_file = au_h_open(dentry, bindex, flags, file, /*force_wr*/0); + if (IS_ERR(h_file)) + err = PTR_ERR(h_file); + else { + au_set_fbstart(file, bindex); + au_set_h_fptr(file, bindex, h_file); + au_update_figen(file); + /* todo: necessary? */ + /* file->f_ra = h_file->f_ra; */ + } + + return err; +} + +static int aufs_open_nondir(struct inode *inode __maybe_unused, + struct file *file) +{ + int err; + struct super_block *sb; + + AuDbg("%.*s, f_flags 0x%x, f_mode 0x%x\n", + AuDLNPair(file->f_dentry), vfsub_file_flags(file), + file->f_mode); + + sb = file->f_dentry->d_sb; + si_read_lock(sb, AuLock_FLUSH); + err = au_do_open(file, au_do_open_nondir, /*fidir*/NULL); + si_read_unlock(sb); + return err; +} + +int aufs_release_nondir(struct inode *inode __maybe_unused, struct file *file) +{ + struct au_finfo *finfo; + aufs_bindex_t bindex; + + finfo = au_fi(file); + bindex = finfo->fi_btop; + if (bindex >= 0) + au_set_h_fptr(file, bindex, NULL); + + au_finfo_fin(file); + return 0; +} + +/* ---------------------------------------------------------------------- */ + +static int au_do_flush_nondir(struct file *file, fl_owner_t id) +{ + int err; + struct file *h_file; + + err = 0; + h_file = au_hf_top(file); + if (h_file) + err = vfsub_flush(h_file, id); + return err; +} + +static int aufs_flush_nondir(struct file *file, fl_owner_t id) +{ + return au_do_flush(file, id, au_do_flush_nondir); +} + +/* ---------------------------------------------------------------------- */ +/* + * read and write functions acquire [fdi]_rwsem once, but release before + * mmap_sem. This is because to stop a race condition between mmap(2). + * Releasing these aufs-rwsem should be safe, no branch-mamagement (by keeping + * si_rwsem), no harmful copy-up should happen. Actually copy-up may happen in + * read functions after [fdi]_rwsem are released, but it should be harmless. + */ + +static ssize_t aufs_read(struct file *file, char __user *buf, size_t count, + loff_t *ppos) +{ + ssize_t err; + struct dentry *dentry; + struct file *h_file; + struct super_block *sb; + + dentry = file->f_dentry; + sb = dentry->d_sb; + si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW); + err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/0); + if (unlikely(err)) + goto out; + + h_file = au_hf_top(file); + get_file(h_file); + di_read_unlock(dentry, AuLock_IR); + fi_read_unlock(file); + + /* filedata may be obsoleted by concurrent copyup, but no problem */ + err = vfsub_read_u(h_file, buf, count, ppos); + /* todo: necessary? */ + /* file->f_ra = h_file->f_ra; */ + /* update without lock, I don't think it a problem */ + fsstack_copy_attr_atime(dentry->d_inode, file_inode(h_file)); + fput(h_file); + +out: + si_read_unlock(sb); + return err; +} + +/* + * todo: very ugly + * it locks both of i_mutex and si_rwsem for read in safe. + * if the plink maintenance mode continues forever (that is the problem), + * may loop forever. + */ +static void au_mtx_and_read_lock(struct inode *inode) +{ + int err; + struct super_block *sb = inode->i_sb; + + while (1) { + mutex_lock(&inode->i_mutex); + err = si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLM); + if (!err) + break; + mutex_unlock(&inode->i_mutex); + si_read_lock(sb, AuLock_NOPLMW); + si_read_unlock(sb); + } +} + +static ssize_t aufs_write(struct file *file, const char __user *ubuf, + size_t count, loff_t *ppos) +{ + ssize_t err; + blkcnt_t blks; + aufs_bindex_t bstart; + struct au_pin pin; + struct dentry *dentry; + struct inode *inode, *h_inode; + struct super_block *sb; + struct file *h_file; + char __user *buf = (char __user *)ubuf; + + dentry = file->f_dentry; + sb = dentry->d_sb; + inode = dentry->d_inode; + au_mtx_and_read_lock(inode); + + err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1); + if (unlikely(err)) + goto out; + + err = au_ready_to_write(file, -1, &pin); + di_downgrade_lock(dentry, AuLock_IR); + if (unlikely(err)) { + di_read_unlock(dentry, AuLock_IR); + fi_write_unlock(file); + goto out; + } + + bstart = au_fbstart(file); + h_file = au_hf_top(file); + get_file(h_file); + h_inode = h_file->f_dentry->d_inode; + blks = h_inode->i_blocks; + au_unpin(&pin); + di_read_unlock(dentry, AuLock_IR); + fi_write_unlock(file); + + err = vfsub_write_u(h_file, buf, count, ppos); + ii_write_lock_child(inode); + au_cpup_attr_timesizes(inode); + inode->i_mode = file_inode(h_file)->i_mode; + AuDbg("blks %llu, %llu\n", (u64)blks, (u64)h_inode->i_blocks); + if (err > 0) + au_fhsm_wrote(sb, bstart, /*force*/h_inode->i_blocks > blks); + ii_write_unlock(inode); + fput(h_file); + +out: + si_read_unlock(sb); + mutex_unlock(&inode->i_mutex); + return err; +} + +static ssize_t au_do_aio(struct file *h_file, int rw, struct kiocb *kio, + const struct iovec *iov, unsigned long nv, loff_t pos) +{ + ssize_t err; + struct file *file; + ssize_t (*func)(struct kiocb *, const struct iovec *, unsigned long, + loff_t); + + err = security_file_permission(h_file, rw); + if (unlikely(err)) + goto out; + + err = -ENOSYS; + func = NULL; + if (rw == MAY_READ) + func = h_file->f_op->aio_read; + else if (rw == MAY_WRITE) + func = h_file->f_op->aio_write; + if (func) { + file = kio->ki_filp; + kio->ki_filp = h_file; + lockdep_off(); + err = func(kio, iov, nv, pos); + lockdep_on(); + kio->ki_filp = file; + } else + /* currently there is no such fs */ + WARN_ON_ONCE(1); + +out: + return err; +} + +static ssize_t aufs_aio_read(struct kiocb *kio, const struct iovec *iov, + unsigned long nv, loff_t pos) +{ + ssize_t err; + struct file *file, *h_file; + struct dentry *dentry; + struct super_block *sb; + + file = kio->ki_filp; + dentry = file->f_dentry; + sb = dentry->d_sb; + si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW); + err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/0); + if (unlikely(err)) + goto out; + + h_file = au_hf_top(file); + get_file(h_file); + di_read_unlock(dentry, AuLock_IR); + fi_read_unlock(file); + + err = au_do_aio(h_file, MAY_READ, kio, iov, nv, pos); + /* todo: necessary? */ + /* file->f_ra = h_file->f_ra; */ + /* update without lock, I don't think it a problem */ + fsstack_copy_attr_atime(dentry->d_inode, file_inode(h_file)); + fput(h_file); + +out: + si_read_unlock(sb); + return err; +} + +static ssize_t aufs_aio_write(struct kiocb *kio, const struct iovec *iov, + unsigned long nv, loff_t pos) +{ + ssize_t err; + blkcnt_t blks; + aufs_bindex_t bstart; + struct au_pin pin; + struct dentry *dentry; + struct inode *inode, *h_inode; + struct file *file, *h_file; + struct super_block *sb; + + file = kio->ki_filp; + dentry = file->f_dentry; + sb = dentry->d_sb; + inode = dentry->d_inode; + au_mtx_and_read_lock(inode); + + err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1); + if (unlikely(err)) + goto out; + + err = au_ready_to_write(file, -1, &pin); + di_downgrade_lock(dentry, AuLock_IR); + if (unlikely(err)) { + di_read_unlock(dentry, AuLock_IR); + fi_write_unlock(file); + goto out; + } + + bstart = au_fbstart(file); + h_file = au_hf_top(file); + get_file(h_file); + h_inode = h_file->f_dentry->d_inode; + blks = h_inode->i_blocks; + au_unpin(&pin); + di_read_unlock(dentry, AuLock_IR); + fi_write_unlock(file); + + err = au_do_aio(h_file, MAY_WRITE, kio, iov, nv, pos); + ii_write_lock_child(inode); + au_cpup_attr_timesizes(inode); + inode->i_mode = file_inode(h_file)->i_mode; + AuDbg("blks %llu, %llu\n", (u64)blks, (u64)h_inode->i_blocks); + if (err > 0) + au_fhsm_wrote(sb, bstart, /*force*/h_inode->i_blocks > blks); + ii_write_unlock(inode); + fput(h_file); + +out: + si_read_unlock(sb); + mutex_unlock(&inode->i_mutex); + return err; +} + +static ssize_t aufs_splice_read(struct file *file, loff_t *ppos, + struct pipe_inode_info *pipe, size_t len, + unsigned int flags) +{ + ssize_t err; + struct file *h_file; + struct dentry *dentry; + struct super_block *sb; + + dentry = file->f_dentry; + sb = dentry->d_sb; + si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW); + err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/0); + if (unlikely(err)) + goto out; + + err = -EINVAL; + h_file = au_hf_top(file); + get_file(h_file); + if (au_test_loopback_kthread()) { + au_warn_loopback(h_file->f_dentry->d_sb); + if (file->f_mapping != h_file->f_mapping) { + file->f_mapping = h_file->f_mapping; + smp_mb(); /* unnecessary? */ + } + } + di_read_unlock(dentry, AuLock_IR); + fi_read_unlock(file); + + err = vfsub_splice_to(h_file, ppos, pipe, len, flags); + /* todo: necessasry? */ + /* file->f_ra = h_file->f_ra; */ + /* update without lock, I don't think it a problem */ + fsstack_copy_attr_atime(dentry->d_inode, file_inode(h_file)); + fput(h_file); + +out: + si_read_unlock(sb); + return err; +} + +static ssize_t +aufs_splice_write(struct pipe_inode_info *pipe, struct file *file, loff_t *ppos, + size_t len, unsigned int flags) +{ + ssize_t err; + blkcnt_t blks; + aufs_bindex_t bstart; + struct au_pin pin; + struct dentry *dentry; + struct inode *inode, *h_inode; + struct super_block *sb; + struct file *h_file; + + dentry = file->f_dentry; + sb = dentry->d_sb; + inode = dentry->d_inode; + au_mtx_and_read_lock(inode); + + err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1); + if (unlikely(err)) + goto out; + + err = au_ready_to_write(file, -1, &pin); + di_downgrade_lock(dentry, AuLock_IR); + if (unlikely(err)) { + di_read_unlock(dentry, AuLock_IR); + fi_write_unlock(file); + goto out; + } + + bstart = au_fbstart(file); + h_file = au_hf_top(file); + get_file(h_file); + h_inode = h_file->f_dentry->d_inode; + blks = h_inode->i_blocks; + au_unpin(&pin); + di_read_unlock(dentry, AuLock_IR); + fi_write_unlock(file); + + err = vfsub_splice_from(pipe, h_file, ppos, len, flags); + ii_write_lock_child(inode); + au_cpup_attr_timesizes(inode); + inode->i_mode = file_inode(h_file)->i_mode; + AuDbg("blks %llu, %llu\n", (u64)blks, (u64)h_inode->i_blocks); + if (err > 0) + au_fhsm_wrote(sb, bstart, /*force*/h_inode->i_blocks > blks); + ii_write_unlock(inode); + fput(h_file); + +out: + si_read_unlock(sb); + mutex_unlock(&inode->i_mutex); + return err; +} + +static long aufs_fallocate(struct file *file, int mode, loff_t offset, + loff_t len) +{ + long err; + struct au_pin pin; + struct dentry *dentry; + struct super_block *sb; + struct inode *inode; + struct file *h_file; + + dentry = file->f_dentry; + sb = dentry->d_sb; + inode = dentry->d_inode; + au_mtx_and_read_lock(inode); + + err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1); + if (unlikely(err)) + goto out; + + err = au_ready_to_write(file, -1, &pin); + di_downgrade_lock(dentry, AuLock_IR); + if (unlikely(err)) { + di_read_unlock(dentry, AuLock_IR); + fi_write_unlock(file); + goto out; + } + + h_file = au_hf_top(file); + get_file(h_file); + au_unpin(&pin); + di_read_unlock(dentry, AuLock_IR); + fi_write_unlock(file); + + lockdep_off(); + err = do_fallocate(h_file, mode, offset, len); + lockdep_on(); + ii_write_lock_child(inode); + au_cpup_attr_timesizes(inode); + inode->i_mode = file_inode(h_file)->i_mode; + ii_write_unlock(inode); + fput(h_file); + +out: + si_read_unlock(sb); + mutex_unlock(&inode->i_mutex); + return err; +} + +/* ---------------------------------------------------------------------- */ + +/* + * The locking order around current->mmap_sem. + * - in most and regular cases + * file I/O syscall -- aufs_read() or something + * -- si_rwsem for read -- mmap_sem + * (Note that [fdi]i_rwsem are released before mmap_sem). + * - in mmap case + * mmap(2) -- mmap_sem -- aufs_mmap() -- si_rwsem for read -- [fdi]i_rwsem + * This AB-BA order is definitly bad, but is not a problem since "si_rwsem for + * read" allows muliple processes to acquire it and [fdi]i_rwsem are not held in + * file I/O. Aufs needs to stop lockdep in aufs_mmap() though. + * It means that when aufs acquires si_rwsem for write, the process should never + * acquire mmap_sem. + * + * Actually aufs_readdir() holds [fdi]i_rwsem before mmap_sem, but this is not a + * problem either since any directory is not able to be mmap-ed. + * The similar scenario is applied to aufs_readlink() too. + */ + +#if 0 /* stop calling security_file_mmap() */ +/* cf. linux/include/linux/mman.h: calc_vm_prot_bits() */ +#define AuConv_VM_PROT(f, b) _calc_vm_trans(f, VM_##b, PROT_##b) + +static unsigned long au_arch_prot_conv(unsigned long flags) +{ + /* currently ppc64 only */ +#ifdef CONFIG_PPC64 + /* cf. linux/arch/powerpc/include/asm/mman.h */ + AuDebugOn(arch_calc_vm_prot_bits(-1) != VM_SAO); + return AuConv_VM_PROT(flags, SAO); +#else + AuDebugOn(arch_calc_vm_prot_bits(-1)); + return 0; +#endif +} + +static unsigned long au_prot_conv(unsigned long flags) +{ + return AuConv_VM_PROT(flags, READ) + | AuConv_VM_PROT(flags, WRITE) + | AuConv_VM_PROT(flags, EXEC) + | au_arch_prot_conv(flags); +} + +/* cf. linux/include/linux/mman.h: calc_vm_flag_bits() */ +#define AuConv_VM_MAP(f, b) _calc_vm_trans(f, VM_##b, MAP_##b) + +static unsigned long au_flag_conv(unsigned long flags) +{ + return AuConv_VM_MAP(flags, GROWSDOWN) + | AuConv_VM_MAP(flags, DENYWRITE) + | AuConv_VM_MAP(flags, LOCKED); +} +#endif + +static int aufs_mmap(struct file *file, struct vm_area_struct *vma) +{ + int err; + aufs_bindex_t bstart; + const unsigned char wlock + = (file->f_mode & FMODE_WRITE) && (vma->vm_flags & VM_SHARED); + struct dentry *dentry; + struct super_block *sb; + struct file *h_file; + struct au_branch *br; + struct au_pin pin; + + AuDbgVmRegion(file, vma); + + dentry = file->f_dentry; + sb = dentry->d_sb; + lockdep_off(); + si_read_lock(sb, AuLock_NOPLMW); + err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1); + if (unlikely(err)) + goto out; + + if (wlock) { + err = au_ready_to_write(file, -1, &pin); + di_write_unlock(dentry); + if (unlikely(err)) { + fi_write_unlock(file); + goto out; + } + au_unpin(&pin); + } else + di_write_unlock(dentry); + + bstart = au_fbstart(file); + br = au_sbr(sb, bstart); + h_file = au_hf_top(file); + get_file(h_file); + au_set_mmapped(file); + fi_write_unlock(file); + lockdep_on(); + + au_vm_file_reset(vma, h_file); + /* + * we cannot call security_mmap_file() here since it may acquire + * mmap_sem or i_mutex. + * + * err = security_mmap_file(h_file, au_prot_conv(vma->vm_flags), + * au_flag_conv(vma->vm_flags)); + */ + if (!err) + err = h_file->f_op->mmap(h_file, vma); + if (unlikely(err)) + goto out_reset; + + au_vm_prfile_set(vma, file); + /* update without lock, I don't think it a problem */ + fsstack_copy_attr_atime(file_inode(file), file_inode(h_file)); + goto out_fput; /* success */ + +out_reset: + au_unset_mmapped(file); + au_vm_file_reset(vma, file); +out_fput: + fput(h_file); + lockdep_off(); +out: + si_read_unlock(sb); + lockdep_on(); + AuTraceErr(err); + return err; +} + +/* ---------------------------------------------------------------------- */ + +static int aufs_fsync_nondir(struct file *file, loff_t start, loff_t end, + int datasync) +{ + int err; + struct au_pin pin; + struct dentry *dentry; + struct inode *inode; + struct file *h_file; + struct super_block *sb; + + dentry = file->f_dentry; + inode = dentry->d_inode; + sb = dentry->d_sb; + mutex_lock(&inode->i_mutex); + err = si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLM); + if (unlikely(err)) + goto out; + + err = 0; /* -EBADF; */ /* posix? */ + if (unlikely(!(file->f_mode & FMODE_WRITE))) + goto out_si; + err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1); + if (unlikely(err)) + goto out_si; + + err = au_ready_to_write(file, -1, &pin); + di_downgrade_lock(dentry, AuLock_IR); + if (unlikely(err)) + goto out_unlock; + au_unpin(&pin); + + err = -EINVAL; + h_file = au_hf_top(file); + err = vfsub_fsync(h_file, &h_file->f_path, datasync); + au_cpup_attr_timesizes(inode); + +out_unlock: + di_read_unlock(dentry, AuLock_IR); + fi_write_unlock(file); +out_si: + si_read_unlock(sb); +out: + mutex_unlock(&inode->i_mutex); + return err; +} + +/* no one supports this operation, currently */ +#if 0 +static int aufs_aio_fsync_nondir(struct kiocb *kio, int datasync) +{ + int err; + struct au_pin pin; + struct dentry *dentry; + struct inode *inode; + struct file *file, *h_file; + + file = kio->ki_filp; + dentry = file->f_dentry; + inode = dentry->d_inode; + au_mtx_and_read_lock(inode); + + err = 0; /* -EBADF; */ /* posix? */ + if (unlikely(!(file->f_mode & FMODE_WRITE))) + goto out; + err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1); + if (unlikely(err)) + goto out; + + err = au_ready_to_write(file, -1, &pin); + di_downgrade_lock(dentry, AuLock_IR); + if (unlikely(err)) + goto out_unlock; + au_unpin(&pin); + + err = -ENOSYS; + h_file = au_hf_top(file); + if (h_file->f_op && h_file->f_op->aio_fsync) { + struct mutex *h_mtx; + + h_mtx = &file_inode(h_file)->i_mutex; + if (!is_sync_kiocb(kio)) { + get_file(h_file); + fput(file); + } + kio->ki_filp = h_file; + err = h_file->f_op->aio_fsync(kio, datasync); + mutex_lock_nested(h_mtx, AuLsc_I_CHILD); + if (!err) + vfsub_update_h_iattr(&h_file->f_path, /*did*/NULL); + /*ignore*/ + au_cpup_attr_timesizes(inode); + mutex_unlock(h_mtx); + } + +out_unlock: + di_read_unlock(dentry, AuLock_IR); + fi_write_unlock(file); +out: + si_read_unlock(inode->sb); + mutex_unlock(&inode->i_mutex); + return err; +} +#endif + +static int aufs_fasync(int fd, struct file *file, int flag) +{ + int err; + struct file *h_file; + struct dentry *dentry; + struct super_block *sb; + + dentry = file->f_dentry; + sb = dentry->d_sb; + si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW); + err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/0); + if (unlikely(err)) + goto out; + + h_file = au_hf_top(file); + if (h_file->f_op && h_file->f_op->fasync) + err = h_file->f_op->fasync(fd, h_file, flag); + + di_read_unlock(dentry, AuLock_IR); + fi_read_unlock(file); + +out: + si_read_unlock(sb); + return err; +} + +/* ---------------------------------------------------------------------- */ + +/* no one supports this operation, currently */ +#if 0 +static ssize_t aufs_sendpage(struct file *file, struct page *page, int offset, + size_t len, loff_t *pos , int more) +{ +} +#endif + +/* ---------------------------------------------------------------------- */ + +const struct file_operations aufs_file_fop = { + .owner = THIS_MODULE, + + .llseek = default_llseek, + + .read = aufs_read, + .write = aufs_write, + .aio_read = aufs_aio_read, + .aio_write = aufs_aio_write, +#ifdef CONFIG_AUFS_POLL + .poll = aufs_poll, +#endif + .unlocked_ioctl = aufs_ioctl_nondir, +#ifdef CONFIG_COMPAT + .compat_ioctl = aufs_compat_ioctl_nondir, +#endif + .mmap = aufs_mmap, + .open = aufs_open_nondir, + .flush = aufs_flush_nondir, + .release = aufs_release_nondir, + .fsync = aufs_fsync_nondir, + /* .aio_fsync = aufs_aio_fsync_nondir, */ + .fasync = aufs_fasync, + /* .sendpage = aufs_sendpage, */ + .splice_write = aufs_splice_write, + .splice_read = aufs_splice_read, +#if 0 + .aio_splice_write = aufs_aio_splice_write, + .aio_splice_read = aufs_aio_splice_read, +#endif + .fallocate = aufs_fallocate +}; diff --git a/fs/aufs/fhsm.c b/fs/aufs/fhsm.c new file mode 100644 index 00000000000000..b734599545f28f --- /dev/null +++ b/fs/aufs/fhsm.c @@ -0,0 +1,426 @@ +/* + * Copyright (C) 2011-2014 Junjiro R. Okajima + * + * This program, aufs 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 + */ + +/* + * File-based Hierarchy Storage Management + */ + +#include +#include +#include +#include +#include "aufs.h" + +static aufs_bindex_t au_fhsm_bottom(struct super_block *sb) +{ + struct au_sbinfo *sbinfo; + struct au_fhsm *fhsm; + + SiMustAnyLock(sb); + + sbinfo = au_sbi(sb); + fhsm = &sbinfo->si_fhsm; + AuDebugOn(!fhsm); + return fhsm->fhsm_bottom; +} + +void au_fhsm_set_bottom(struct super_block *sb, aufs_bindex_t bindex) +{ + struct au_sbinfo *sbinfo; + struct au_fhsm *fhsm; + + SiMustWriteLock(sb); + + sbinfo = au_sbi(sb); + fhsm = &sbinfo->si_fhsm; + AuDebugOn(!fhsm); + fhsm->fhsm_bottom = bindex; +} + +/* ---------------------------------------------------------------------- */ + +static int au_fhsm_test_jiffy(struct au_sbinfo *sbinfo, struct au_branch *br) +{ + struct au_br_fhsm *bf; + + bf = br->br_fhsm; + MtxMustLock(&bf->bf_lock); + + return !bf->bf_readable + || time_after(jiffies, + bf->bf_jiffy + sbinfo->si_fhsm.fhsm_expire); +} + +/* ---------------------------------------------------------------------- */ + +static void au_fhsm_notify(struct super_block *sb, int val) +{ + struct au_sbinfo *sbinfo; + struct au_fhsm *fhsm; + + SiMustAnyLock(sb); + + sbinfo = au_sbi(sb); + fhsm = &sbinfo->si_fhsm; + if (au_fhsm_pid(fhsm) + && atomic_read(&fhsm->fhsm_readable) != -1) { + atomic_set(&fhsm->fhsm_readable, val); + if (val) + wake_up(&fhsm->fhsm_wqh); + } +} + +static int au_fhsm_stfs(struct super_block *sb, aufs_bindex_t bindex, + struct aufs_stfs *rstfs, int do_lock, int do_notify) +{ + int err; + struct au_branch *br; + struct au_br_fhsm *bf; + + br = au_sbr(sb, bindex); + AuDebugOn(au_br_rdonly(br)); + bf = br->br_fhsm; + AuDebugOn(!bf); + + if (do_lock) + mutex_lock(&bf->bf_lock); + else + MtxMustLock(&bf->bf_lock); + + /* sb->s_root for NFS is unreliable */ + err = au_br_stfs(br, &bf->bf_stfs); + if (unlikely(err)) { + AuErr1("FHSM failed (%d), b%d, ignored.\n", bindex, err); + goto out; + } + + bf->bf_jiffy = jiffies; + bf->bf_readable = 1; + if (do_notify) + au_fhsm_notify(sb, /*val*/1); + if (rstfs) + *rstfs = bf->bf_stfs; + +out: + if (do_lock) + mutex_unlock(&bf->bf_lock); + au_fhsm_notify(sb, /*val*/1); + + return err; +} + +void au_fhsm_wrote(struct super_block *sb, aufs_bindex_t bindex, int force) +{ + int err; + struct au_sbinfo *sbinfo; + struct au_fhsm *fhsm; + struct au_branch *br; + struct au_br_fhsm *bf; + + AuDbg("b%d, force %d\n", bindex, force); + SiMustAnyLock(sb); + + sbinfo = au_sbi(sb); + fhsm = &sbinfo->si_fhsm; + if (!au_ftest_si(sbinfo, FHSM) + || fhsm->fhsm_bottom == bindex) + return; + + br = au_sbr(sb, bindex); + bf = br->br_fhsm; + AuDebugOn(!bf); + mutex_lock(&bf->bf_lock); + if (force + || au_fhsm_pid(fhsm) + || au_fhsm_test_jiffy(sbinfo, br)) + err = au_fhsm_stfs(sb, bindex, /*rstfs*/NULL, /*do_lock*/0, + /*do_notify*/1); + mutex_unlock(&bf->bf_lock); +} + +void au_fhsm_wrote_all(struct super_block *sb, int force) +{ + aufs_bindex_t bindex, bend; + struct au_branch *br; + + /* exclude the bottom */ + bend = au_fhsm_bottom(sb); + for (bindex = 0; bindex < bend; bindex++) { + br = au_sbr(sb, bindex); + if (au_br_fhsm(br->br_perm)) + au_fhsm_wrote(sb, bindex, force); + } +} + +/* ---------------------------------------------------------------------- */ + +static unsigned int au_fhsm_poll(struct file *file, + struct poll_table_struct *wait) +{ + unsigned int mask; + struct au_sbinfo *sbinfo; + struct au_fhsm *fhsm; + + mask = 0; + sbinfo = file->private_data; + fhsm = &sbinfo->si_fhsm; + poll_wait(file, &fhsm->fhsm_wqh, wait); + if (atomic_read(&fhsm->fhsm_readable)) + mask = POLLIN /* | POLLRDNORM */; + + AuTraceErr((int)mask); + return mask; +} + +static int au_fhsm_do_read_one(struct aufs_stbr __user *stbr, + struct aufs_stfs *stfs, __s16 brid) +{ + int err; + + err = copy_to_user(&stbr->stfs, stfs, sizeof(*stfs)); + if (!err) + err = __put_user(brid, &stbr->brid); + if (unlikely(err)) + err = -EFAULT; + + return err; +} + +static ssize_t au_fhsm_do_read(struct super_block *sb, + struct aufs_stbr __user *stbr, size_t count) +{ + ssize_t err; + int nstbr; + aufs_bindex_t bindex, bend; + struct au_branch *br; + struct au_br_fhsm *bf; + + /* except the bottom branch */ + err = 0; + nstbr = 0; + bend = au_fhsm_bottom(sb); + for (bindex = 0; !err && bindex < bend; bindex++) { + br = au_sbr(sb, bindex); + if (!au_br_fhsm(br->br_perm)) + continue; + + bf = br->br_fhsm; + mutex_lock(&bf->bf_lock); + if (bf->bf_readable) { + err = -EFAULT; + if (count >= sizeof(*stbr)) + err = au_fhsm_do_read_one(stbr++, &bf->bf_stfs, + br->br_id); + if (!err) { + bf->bf_readable = 0; + count -= sizeof(*stbr); + nstbr++; + } + } + mutex_unlock(&bf->bf_lock); + } + if (!err) + err = sizeof(*stbr) * nstbr; + + return err; +} + +static ssize_t au_fhsm_read(struct file *file, char __user *buf, size_t count, + loff_t *pos) +{ + ssize_t err; + int readable; + aufs_bindex_t nfhsm, bindex, bend; + struct au_sbinfo *sbinfo; + struct au_fhsm *fhsm; + struct au_branch *br; + struct super_block *sb; + + err = 0; + sbinfo = file->private_data; + fhsm = &sbinfo->si_fhsm; +need_data: + spin_lock_irq(&fhsm->fhsm_wqh.lock); + if (!atomic_read(&fhsm->fhsm_readable)) { + if (vfsub_file_flags(file) & O_NONBLOCK) + err = -EAGAIN; + else + err = wait_event_interruptible_locked_irq + (fhsm->fhsm_wqh, + atomic_read(&fhsm->fhsm_readable)); + } + spin_unlock_irq(&fhsm->fhsm_wqh.lock); + if (unlikely(err)) + goto out; + + /* sb may already be dead */ + au_rw_read_lock(&sbinfo->si_rwsem); + readable = atomic_read(&fhsm->fhsm_readable); + if (readable > 0) { + sb = sbinfo->si_sb; + AuDebugOn(!sb); + /* exclude the bottom branch */ + nfhsm = 0; + bend = au_fhsm_bottom(sb); + for (bindex = 0; bindex < bend; bindex++) { + br = au_sbr(sb, bindex); + if (au_br_fhsm(br->br_perm)) + nfhsm++; + } + err = -EMSGSIZE; + if (nfhsm * sizeof(struct aufs_stbr) <= count) { + atomic_set(&fhsm->fhsm_readable, 0); + err = au_fhsm_do_read(sbinfo->si_sb, (void __user *)buf, + count); + } + } + au_rw_read_unlock(&sbinfo->si_rwsem); + if (!readable) + goto need_data; + +out: + return err; +} + +static int au_fhsm_release(struct inode *inode, struct file *file) +{ + struct au_sbinfo *sbinfo; + struct au_fhsm *fhsm; + + /* sb may already be dead */ + sbinfo = file->private_data; + fhsm = &sbinfo->si_fhsm; + spin_lock(&fhsm->fhsm_spin); + fhsm->fhsm_pid = 0; + spin_unlock(&fhsm->fhsm_spin); + kobject_put(&sbinfo->si_kobj); + + return 0; +} + +static const struct file_operations au_fhsm_fops = { + .owner = THIS_MODULE, + .llseek = noop_llseek, + .read = au_fhsm_read, + .poll = au_fhsm_poll, + .release = au_fhsm_release +}; + +int au_fhsm_fd(struct super_block *sb, int oflags) +{ + int err, fd; + struct au_sbinfo *sbinfo; + struct au_fhsm *fhsm; + + err = -EPERM; + if (unlikely(!capable(CAP_SYS_ADMIN))) + goto out; + + err = -EINVAL; + if (unlikely(oflags & ~(O_CLOEXEC | O_NONBLOCK))) + goto out; + + err = 0; + sbinfo = au_sbi(sb); + fhsm = &sbinfo->si_fhsm; + spin_lock(&fhsm->fhsm_spin); + if (!fhsm->fhsm_pid) + fhsm->fhsm_pid = current->pid; + else + err = -EBUSY; + spin_unlock(&fhsm->fhsm_spin); + if (unlikely(err)) + goto out; + + oflags |= O_RDONLY; + /* oflags |= FMODE_NONOTIFY; */ + fd = anon_inode_getfd("[aufs_fhsm]", &au_fhsm_fops, sbinfo, oflags); + err = fd; + if (unlikely(fd < 0)) + goto out_pid; + + /* succeed reglardless 'fhsm' status */ + kobject_get(&sbinfo->si_kobj); + si_noflush_read_lock(sb); + if (au_ftest_si(sbinfo, FHSM)) + au_fhsm_wrote_all(sb, /*force*/0); + si_read_unlock(sb); + goto out; /* success */ + +out_pid: + spin_lock(&fhsm->fhsm_spin); + fhsm->fhsm_pid = 0; + spin_unlock(&fhsm->fhsm_spin); +out: + AuTraceErr(err); + return err; +} + +/* ---------------------------------------------------------------------- */ + +int au_fhsm_br_alloc(struct au_branch *br) +{ + int err; + + err = 0; + br->br_fhsm = kmalloc(sizeof(*br->br_fhsm), GFP_NOFS); + if (br->br_fhsm) + au_br_fhsm_init(br->br_fhsm); + else + err = -ENOMEM; + + return err; +} + +/* ---------------------------------------------------------------------- */ + +void au_fhsm_fin(struct super_block *sb) +{ + au_fhsm_notify(sb, /*val*/-1); +} + +void au_fhsm_init(struct au_sbinfo *sbinfo) +{ + struct au_fhsm *fhsm; + + fhsm = &sbinfo->si_fhsm; + spin_lock_init(&fhsm->fhsm_spin); + init_waitqueue_head(&fhsm->fhsm_wqh); + atomic_set(&fhsm->fhsm_readable, 0); + fhsm->fhsm_expire + = msecs_to_jiffies(AUFS_FHSM_CACHE_DEF_SEC * MSEC_PER_SEC); + fhsm->fhsm_bottom = -1; +} + +void au_fhsm_set(struct au_sbinfo *sbinfo, unsigned int sec) +{ + sbinfo->si_fhsm.fhsm_expire + = msecs_to_jiffies(sec * MSEC_PER_SEC); +} + +void au_fhsm_show(struct seq_file *seq, struct au_sbinfo *sbinfo) +{ + unsigned int u; + + if (!au_ftest_si(sbinfo, FHSM)) + return; + + u = jiffies_to_msecs(sbinfo->si_fhsm.fhsm_expire) / MSEC_PER_SEC; + if (u != AUFS_FHSM_CACHE_DEF_SEC) + seq_printf(seq, ",fhsm_sec=%u", u); +} diff --git a/fs/aufs/file.c b/fs/aufs/file.c new file mode 100644 index 00000000000000..731fe2116eab7c --- /dev/null +++ b/fs/aufs/file.c @@ -0,0 +1,815 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * handling file/dir, and address_space operation + */ + +#ifdef CONFIG_AUFS_DEBUG +#include +#endif +#include +#include "aufs.h" + +/* drop flags for writing */ +unsigned int au_file_roflags(unsigned int flags) +{ + flags &= ~(O_WRONLY | O_RDWR | O_APPEND | O_CREAT | O_TRUNC); + flags |= O_RDONLY | O_NOATIME; + return flags; +} + +/* common functions to regular file and dir */ +struct file *au_h_open(struct dentry *dentry, aufs_bindex_t bindex, int flags, + struct file *file, int force_wr) +{ + struct file *h_file; + struct dentry *h_dentry; + struct inode *h_inode; + struct super_block *sb; + struct au_branch *br; + struct path h_path; + int err, exec_flag; + + /* a race condition can happen between open and unlink/rmdir */ + h_file = ERR_PTR(-ENOENT); + h_dentry = au_h_dptr(dentry, bindex); + if (au_test_nfsd() && !h_dentry) + goto out; + h_inode = h_dentry->d_inode; + if (au_test_nfsd() && !h_inode) + goto out; + spin_lock(&h_dentry->d_lock); + err = (!d_unhashed(dentry) && d_unlinked(h_dentry)) + || !h_inode + /* || !dentry->d_inode->i_nlink */ + ; + spin_unlock(&h_dentry->d_lock); + if (unlikely(err)) + goto out; + + sb = dentry->d_sb; + br = au_sbr(sb, bindex); + h_file = ERR_PTR(-EACCES); + exec_flag = flags & __FMODE_EXEC; + if (exec_flag && (au_br_mnt(br)->mnt_flags & MNT_NOEXEC)) + goto out; + + /* drop flags for writing */ + if (au_test_ro(sb, bindex, dentry->d_inode)) { + if (force_wr && !(flags & O_WRONLY)) + force_wr = 0; + flags = au_file_roflags(flags); + if (force_wr) { + h_file = ERR_PTR(-EROFS); + flags = au_file_roflags(flags); + if (unlikely(vfsub_native_ro(h_inode) + || IS_APPEND(h_inode))) + goto out; + flags &= ~O_ACCMODE; + flags |= O_WRONLY; + } + } + flags &= ~O_CREAT; + atomic_inc(&br->br_count); + h_path.dentry = h_dentry; + h_path.mnt = au_br_mnt(br); + h_file = vfsub_dentry_open(&h_path, flags); + if (IS_ERR(h_file)) + goto out_br; + + if (exec_flag) { + err = deny_write_access(h_file); + if (unlikely(err)) { + fput(h_file); + h_file = ERR_PTR(err); + goto out_br; + } + } + fsnotify_open(h_file); + goto out; /* success */ + +out_br: + atomic_dec(&br->br_count); +out: + return h_file; +} + +static int au_cmoo(struct dentry *dentry) +{ + int err, cmoo; + unsigned int udba; + struct path h_path; + struct au_pin pin; + struct au_cp_generic cpg = { + .dentry = dentry, + .bdst = -1, + .bsrc = -1, + .len = -1, + .pin = &pin, + .flags = AuCpup_DTIME | AuCpup_HOPEN + }; + struct inode *inode; + struct super_block *sb; + struct au_sbinfo *sbinfo; + struct au_fhsm *fhsm; + pid_t pid; + struct au_branch *br; + struct dentry *parent; + struct au_hinode *hdir; + + DiMustWriteLock(dentry); + inode = dentry->d_inode; + IiMustWriteLock(inode); + + err = 0; + if (IS_ROOT(dentry)) + goto out; + cpg.bsrc = au_dbstart(dentry); + if (!cpg.bsrc) + goto out; + + sb = dentry->d_sb; + sbinfo = au_sbi(sb); + fhsm = &sbinfo->si_fhsm; + pid = au_fhsm_pid(fhsm); + if (pid + && (current->pid == pid + || current->real_parent->pid == pid)) + goto out; + + br = au_sbr(sb, cpg.bsrc); + cmoo = au_br_cmoo(br->br_perm); + if (!cmoo) + goto out; + if (!S_ISREG(inode->i_mode)) + cmoo &= AuBrAttr_COO_ALL; + if (!cmoo) + goto out; + + parent = dget_parent(dentry); + di_write_lock_parent(parent); + err = au_wbr_do_copyup_bu(dentry, cpg.bsrc - 1); + cpg.bdst = err; + if (unlikely(err < 0)) { + err = 0; /* there is no upper writable branch */ + goto out_dgrade; + } + AuDbg("bsrc %d, bdst %d\n", cpg.bsrc, cpg.bdst); + + /* do not respect the coo attrib for the target branch */ + err = au_cpup_dirs(dentry, cpg.bdst); + if (unlikely(err)) + goto out_dgrade; + + di_downgrade_lock(parent, AuLock_IR); + udba = au_opt_udba(sb); + err = au_pin(&pin, dentry, cpg.bdst, udba, + AuPin_DI_LOCKED | AuPin_MNT_WRITE); + if (unlikely(err)) + goto out_parent; + + err = au_sio_cpup_simple(&cpg); + au_unpin(&pin); + if (unlikely(err)) + goto out_parent; + if (!(cmoo & AuBrWAttr_MOO)) + goto out_parent; /* success */ + + err = au_pin(&pin, dentry, cpg.bsrc, udba, + AuPin_DI_LOCKED | AuPin_MNT_WRITE); + if (unlikely(err)) + goto out_parent; + + h_path.mnt = au_br_mnt(br); + h_path.dentry = au_h_dptr(dentry, cpg.bsrc); + hdir = au_hi(parent->d_inode, cpg.bsrc); + err = vfsub_unlink(hdir->hi_inode, &h_path, /*force*/1); + au_unpin(&pin); + /* todo: keep h_dentry or not? */ + if (unlikely(err)) { + pr_err("unlink %.*s after coo failed (%d), ignored\n", + AuDLNPair(dentry), err); + err = 0; + } + goto out_parent; /* success */ + +out_dgrade: + di_downgrade_lock(parent, AuLock_IR); +out_parent: + di_read_unlock(parent, AuLock_IR); + dput(parent); +out: + AuTraceErr(err); + return err; +} + +int au_do_open(struct file *file, int (*open)(struct file *file, int flags), + struct au_fidir *fidir) +{ + int err; + struct dentry *dentry; + + err = au_finfo_init(file, fidir); + if (unlikely(err)) + goto out; + + dentry = file->f_dentry; + di_write_lock_child(dentry); + err = au_cmoo(dentry); + di_downgrade_lock(dentry, AuLock_IR); + if (!err) + err = open(file, vfsub_file_flags(file)); + di_read_unlock(dentry, AuLock_IR); + + fi_write_unlock(file); + if (unlikely(err)) { + au_fi(file)->fi_hdir = NULL; + au_finfo_fin(file); + } + +out: + return err; +} + +int au_reopen_nondir(struct file *file) +{ + int err; + aufs_bindex_t bstart; + struct dentry *dentry; + struct file *h_file, *h_file_tmp; + + dentry = file->f_dentry; + bstart = au_dbstart(dentry); + h_file_tmp = NULL; + if (au_fbstart(file) == bstart) { + h_file = au_hf_top(file); + if (file->f_mode == h_file->f_mode) + return 0; /* success */ + h_file_tmp = h_file; + get_file(h_file_tmp); + au_set_h_fptr(file, bstart, NULL); + } + AuDebugOn(au_fi(file)->fi_hdir); + /* + * it can happen + * file exists on both of rw and ro + * open --> dbstart and fbstart are both 0 + * prepend a branch as rw, "rw" become ro + * remove rw/file + * delete the top branch, "rw" becomes rw again + * --> dbstart is 1, fbstart is still 0 + * write --> fbstart is 0 but dbstart is 1 + */ + /* AuDebugOn(au_fbstart(file) < bstart); */ + + h_file = au_h_open(dentry, bstart, vfsub_file_flags(file) & ~O_TRUNC, + file, /*force_wr*/0); + err = PTR_ERR(h_file); + if (IS_ERR(h_file)) { + if (h_file_tmp) { + atomic_inc(&au_sbr(dentry->d_sb, bstart)->br_count); + au_set_h_fptr(file, bstart, h_file_tmp); + h_file_tmp = NULL; + } + goto out; /* todo: close all? */ + } + + err = 0; + au_set_fbstart(file, bstart); + au_set_h_fptr(file, bstart, h_file); + au_update_figen(file); + /* todo: necessary? */ + /* file->f_ra = h_file->f_ra; */ + +out: + if (h_file_tmp) + fput(h_file_tmp); + return err; +} + +/* ---------------------------------------------------------------------- */ + +static int au_reopen_wh(struct file *file, aufs_bindex_t btgt, + struct dentry *hi_wh) +{ + int err; + aufs_bindex_t bstart; + struct au_dinfo *dinfo; + struct dentry *h_dentry; + struct au_hdentry *hdp; + + dinfo = au_di(file->f_dentry); + AuRwMustWriteLock(&dinfo->di_rwsem); + + bstart = dinfo->di_bstart; + dinfo->di_bstart = btgt; + hdp = dinfo->di_hdentry; + h_dentry = hdp[0 + btgt].hd_dentry; + hdp[0 + btgt].hd_dentry = hi_wh; + err = au_reopen_nondir(file); + hdp[0 + btgt].hd_dentry = h_dentry; + dinfo->di_bstart = bstart; + + return err; +} + +static int au_ready_to_write_wh(struct file *file, loff_t len, + aufs_bindex_t bcpup, struct au_pin *pin) +{ + int err; + struct inode *inode, *h_inode; + struct dentry *h_dentry, *hi_wh; + struct au_cp_generic cpg = { + .dentry = file->f_dentry, + .bdst = bcpup, + .bsrc = -1, + .len = len, + .pin = pin + }; + + au_update_dbstart(cpg.dentry); + inode = cpg.dentry->d_inode; + h_inode = NULL; + if (au_dbstart(cpg.dentry) <= bcpup + && au_dbend(cpg.dentry) >= bcpup) { + h_dentry = au_h_dptr(cpg.dentry, bcpup); + if (h_dentry) + h_inode = h_dentry->d_inode; + } + hi_wh = au_hi_wh(inode, bcpup); + if (!hi_wh && !h_inode) + err = au_sio_cpup_wh(&cpg, file); + else + /* already copied-up after unlink */ + err = au_reopen_wh(file, bcpup, hi_wh); + + if (!err + && inode->i_nlink > 1 + && au_opt_test(au_mntflags(cpg.dentry->d_sb), PLINK)) + au_plink_append(inode, bcpup, au_h_dptr(cpg.dentry, bcpup)); + + return err; +} + +/* + * prepare the @file for writing. + */ +int au_ready_to_write(struct file *file, loff_t len, struct au_pin *pin) +{ + int err; + aufs_bindex_t dbstart; + struct dentry *parent, *h_dentry; + struct inode *inode; + struct super_block *sb; + struct file *h_file; + struct au_cp_generic cpg = { + .dentry = file->f_dentry, + .bdst = -1, + .bsrc = -1, + .len = len, + .pin = pin, + .flags = AuCpup_DTIME + }; + + sb = cpg.dentry->d_sb; + inode = cpg.dentry->d_inode; + cpg.bsrc = au_fbstart(file); + err = au_test_ro(sb, cpg.bsrc, inode); + if (!err && (au_hf_top(file)->f_mode & FMODE_WRITE)) { + err = au_pin(pin, cpg.dentry, cpg.bsrc, AuOpt_UDBA_NONE, + /*flags*/0); + goto out; + } + + /* need to cpup or reopen */ + parent = dget_parent(cpg.dentry); + di_write_lock_parent(parent); + err = AuWbrCopyup(au_sbi(sb), cpg.dentry); + cpg.bdst = err; + if (unlikely(err < 0)) + goto out_dgrade; + err = 0; + + if (!d_unhashed(cpg.dentry) && !au_h_dptr(parent, cpg.bdst)) { + err = au_cpup_dirs(cpg.dentry, cpg.bdst); + if (unlikely(err)) + goto out_dgrade; + } + + err = au_pin(pin, cpg.dentry, cpg.bdst, AuOpt_UDBA_NONE, + AuPin_DI_LOCKED | AuPin_MNT_WRITE); + if (unlikely(err)) + goto out_dgrade; + + h_dentry = au_hf_top(file)->f_dentry; + dbstart = au_dbstart(cpg.dentry); + if (dbstart <= cpg.bdst) { + h_dentry = au_h_dptr(cpg.dentry, cpg.bdst); + AuDebugOn(!h_dentry); + cpg.bsrc = cpg.bdst; + } + + if (dbstart <= cpg.bdst /* just reopen */ + || !d_unhashed(cpg.dentry) /* copyup and reopen */ + ) { + h_file = au_h_open_pre(cpg.dentry, cpg.bsrc, /*force_wr*/0); + if (IS_ERR(h_file)) + err = PTR_ERR(h_file); + else { + di_downgrade_lock(parent, AuLock_IR); + if (dbstart > cpg.bdst) + err = au_sio_cpup_simple(&cpg); + if (!err) + err = au_reopen_nondir(file); + au_h_open_post(cpg.dentry, cpg.bsrc, h_file); + } + } else { /* copyup as wh and reopen */ + /* + * since writable hfsplus branch is not supported, + * h_open_pre/post() are unnecessary. + */ + err = au_ready_to_write_wh(file, len, cpg.bdst, pin); + di_downgrade_lock(parent, AuLock_IR); + } + + if (!err) { + au_pin_set_parent_lflag(pin, /*lflag*/0); + goto out_dput; /* success */ + } + au_unpin(pin); + goto out_unlock; + +out_dgrade: + di_downgrade_lock(parent, AuLock_IR); +out_unlock: + di_read_unlock(parent, AuLock_IR); +out_dput: + dput(parent); +out: + return err; +} + +/* ---------------------------------------------------------------------- */ + +int au_do_flush(struct file *file, fl_owner_t id, + int (*flush)(struct file *file, fl_owner_t id)) +{ + int err; + struct super_block *sb; + struct inode *inode; + + inode = file_inode(file); + sb = inode->i_sb; + si_noflush_read_lock(sb); + fi_read_lock(file); + ii_read_lock_child(inode); + + err = flush(file, id); + au_cpup_attr_timesizes(inode); + + ii_read_unlock(inode); + fi_read_unlock(file); + si_read_unlock(sb); + return err; +} + +/* ---------------------------------------------------------------------- */ + +static int au_file_refresh_by_inode(struct file *file, int *need_reopen) +{ + int err; + struct au_pin pin; + struct au_finfo *finfo; + struct dentry *parent, *hi_wh; + struct inode *inode; + struct super_block *sb; + struct au_cp_generic cpg = { + .dentry = file->f_dentry, + .bdst = -1, + .bsrc = -1, + .len = -1, + .pin = &pin, + .flags = AuCpup_DTIME + }; + + FiMustWriteLock(file); + + err = 0; + finfo = au_fi(file); + sb = cpg.dentry->d_sb; + inode = cpg.dentry->d_inode; + cpg.bdst = au_ibstart(inode); + if (cpg.bdst == finfo->fi_btop || IS_ROOT(cpg.dentry)) + goto out; + + parent = dget_parent(cpg.dentry); + if (au_test_ro(sb, cpg.bdst, inode)) { + di_read_lock_parent(parent, !AuLock_IR); + err = AuWbrCopyup(au_sbi(sb), cpg.dentry); + cpg.bdst = err; + di_read_unlock(parent, !AuLock_IR); + if (unlikely(err < 0)) + goto out_parent; + err = 0; + } + + di_read_lock_parent(parent, AuLock_IR); + hi_wh = au_hi_wh(inode, cpg.bdst); + if (!S_ISDIR(inode->i_mode) + && au_opt_test(au_mntflags(sb), PLINK) + && au_plink_test(inode) + && !d_unhashed(cpg.dentry) + && cpg.bdst < au_dbstart(cpg.dentry)) { + err = au_test_and_cpup_dirs(cpg.dentry, cpg.bdst); + if (unlikely(err)) + goto out_unlock; + + /* always superio. */ + err = au_pin(&pin, cpg.dentry, cpg.bdst, AuOpt_UDBA_NONE, + AuPin_DI_LOCKED | AuPin_MNT_WRITE); + if (!err) { + err = au_sio_cpup_simple(&cpg); + au_unpin(&pin); + } + } else if (hi_wh) { + /* already copied-up after unlink */ + err = au_reopen_wh(file, cpg.bdst, hi_wh); + *need_reopen = 0; + } + +out_unlock: + di_read_unlock(parent, AuLock_IR); +out_parent: + dput(parent); +out: + return err; +} + +static void au_do_refresh_dir(struct file *file) +{ + aufs_bindex_t bindex, bend, new_bindex, brid; + struct au_hfile *p, tmp, *q; + struct au_finfo *finfo; + struct super_block *sb; + struct au_fidir *fidir; + + FiMustWriteLock(file); + + sb = file->f_dentry->d_sb; + finfo = au_fi(file); + fidir = finfo->fi_hdir; + AuDebugOn(!fidir); + p = fidir->fd_hfile + finfo->fi_btop; + brid = p->hf_br->br_id; + bend = fidir->fd_bbot; + for (bindex = finfo->fi_btop; bindex <= bend; bindex++, p++) { + if (!p->hf_file) + continue; + + new_bindex = au_br_index(sb, p->hf_br->br_id); + if (new_bindex == bindex) + continue; + if (new_bindex < 0) { + au_set_h_fptr(file, bindex, NULL); + continue; + } + + /* swap two lower inode, and loop again */ + q = fidir->fd_hfile + new_bindex; + tmp = *q; + *q = *p; + *p = tmp; + if (tmp.hf_file) { + bindex--; + p--; + } + } + + p = fidir->fd_hfile; + if (!au_test_mmapped(file) && !d_unlinked(file->f_dentry)) { + bend = au_sbend(sb); + for (finfo->fi_btop = 0; finfo->fi_btop <= bend; + finfo->fi_btop++, p++) + if (p->hf_file) { + if (file_inode(p->hf_file)) + break; + au_hfput(p, file); + } + } else { + bend = au_br_index(sb, brid); + for (finfo->fi_btop = 0; finfo->fi_btop < bend; + finfo->fi_btop++, p++) + if (p->hf_file) + au_hfput(p, file); + bend = au_sbend(sb); + } + + p = fidir->fd_hfile + bend; + for (fidir->fd_bbot = bend; fidir->fd_bbot >= finfo->fi_btop; + fidir->fd_bbot--, p--) + if (p->hf_file) { + if (file_inode(p->hf_file)) + break; + au_hfput(p, file); + } + AuDebugOn(fidir->fd_bbot < finfo->fi_btop); +} + +/* + * after branch manipulating, refresh the file. + */ +static int refresh_file(struct file *file, int (*reopen)(struct file *file)) +{ + int err, need_reopen; + aufs_bindex_t bend, bindex; + struct dentry *dentry; + struct au_finfo *finfo; + struct au_hfile *hfile; + + dentry = file->f_dentry; + finfo = au_fi(file); + if (!finfo->fi_hdir) { + hfile = &finfo->fi_htop; + AuDebugOn(!hfile->hf_file); + bindex = au_br_index(dentry->d_sb, hfile->hf_br->br_id); + AuDebugOn(bindex < 0); + if (bindex != finfo->fi_btop) + au_set_fbstart(file, bindex); + } else { + err = au_fidir_realloc(finfo, au_sbend(dentry->d_sb) + 1); + if (unlikely(err)) + goto out; + au_do_refresh_dir(file); + } + + err = 0; + need_reopen = 1; + if (!au_test_mmapped(file)) + err = au_file_refresh_by_inode(file, &need_reopen); + if (!err && need_reopen && !d_unlinked(dentry)) + err = reopen(file); + if (!err) { + au_update_figen(file); + goto out; /* success */ + } + + /* error, close all lower files */ + if (finfo->fi_hdir) { + bend = au_fbend_dir(file); + for (bindex = au_fbstart(file); bindex <= bend; bindex++) + au_set_h_fptr(file, bindex, NULL); + } + +out: + return err; +} + +/* common function to regular file and dir */ +int au_reval_and_lock_fdi(struct file *file, int (*reopen)(struct file *file), + int wlock) +{ + int err; + unsigned int sigen, figen; + aufs_bindex_t bstart; + unsigned char pseudo_link; + struct dentry *dentry; + struct inode *inode; + + err = 0; + dentry = file->f_dentry; + inode = dentry->d_inode; + sigen = au_sigen(dentry->d_sb); + fi_write_lock(file); + figen = au_figen(file); + di_write_lock_child(dentry); + bstart = au_dbstart(dentry); + pseudo_link = (bstart != au_ibstart(inode)); + if (sigen == figen && !pseudo_link && au_fbstart(file) == bstart) { + if (!wlock) { + di_downgrade_lock(dentry, AuLock_IR); + fi_downgrade_lock(file); + } + goto out; /* success */ + } + + AuDbg("sigen %d, figen %d\n", sigen, figen); + if (au_digen_test(dentry, sigen)) { + err = au_reval_dpath(dentry, sigen); + AuDebugOn(!err && au_digen_test(dentry, sigen)); + } + + if (!err) + err = refresh_file(file, reopen); + if (!err) { + if (!wlock) { + di_downgrade_lock(dentry, AuLock_IR); + fi_downgrade_lock(file); + } + } else { + di_write_unlock(dentry); + fi_write_unlock(file); + } + +out: + return err; +} + +/* ---------------------------------------------------------------------- */ + +/* cf. aufs_nopage() */ +/* for madvise(2) */ +static int aufs_readpage(struct file *file __maybe_unused, struct page *page) +{ + unlock_page(page); + return 0; +} + +/* it will never be called, but necessary to support O_DIRECT */ +static ssize_t aufs_direct_IO(int rw, struct kiocb *iocb, + const struct iovec *iov, loff_t offset, + unsigned long nr_segs) +{ BUG(); return 0; } + +/* + * it will never be called, but madvise and fadvise behaves differently + * when get_xip_mem is defined + */ +static int aufs_get_xip_mem(struct address_space *mapping, pgoff_t pgoff, + int create, void **kmem, unsigned long *pfn) +{ BUG(); return 0; } + +/* they will never be called. */ +#ifdef CONFIG_AUFS_DEBUG +static int aufs_write_begin(struct file *file, struct address_space *mapping, + loff_t pos, unsigned len, unsigned flags, + struct page **pagep, void **fsdata) +{ AuUnsupport(); return 0; } +static int aufs_write_end(struct file *file, struct address_space *mapping, + loff_t pos, unsigned len, unsigned copied, + struct page *page, void *fsdata) +{ AuUnsupport(); return 0; } +static int aufs_writepage(struct page *page, struct writeback_control *wbc) +{ AuUnsupport(); return 0; } + +static int aufs_set_page_dirty(struct page *page) +{ AuUnsupport(); return 0; } +static void aufs_invalidatepage(struct page *page, unsigned long offset) +{ AuUnsupport(); } +static int aufs_releasepage(struct page *page, gfp_t gfp) +{ AuUnsupport(); return 0; } +static int aufs_migratepage(struct address_space *mapping, struct page *newpage, + struct page *page, enum migrate_mode mode) +{ AuUnsupport(); return 0; } +static int aufs_launder_page(struct page *page) +{ AuUnsupport(); return 0; } +static int aufs_is_partially_uptodate(struct page *page, + read_descriptor_t *desc, + unsigned long from) +{ AuUnsupport(); return 0; } +static int aufs_error_remove_page(struct address_space *mapping, + struct page *page) +{ AuUnsupport(); return 0; } +static int aufs_swap_activate(struct swap_info_struct *sis, struct file *file, + sector_t *span) +{ AuUnsupport(); return 0; } +static void aufs_swap_deactivate(struct file *file) +{ AuUnsupport(); } +#endif /* CONFIG_AUFS_DEBUG */ + +const struct address_space_operations aufs_aop = { + .readpage = aufs_readpage, + .direct_IO = aufs_direct_IO, + .get_xip_mem = aufs_get_xip_mem, +#ifdef CONFIG_AUFS_DEBUG + .writepage = aufs_writepage, + /* no writepages, because of writepage */ + .set_page_dirty = aufs_set_page_dirty, + /* no readpages, because of readpage */ + .write_begin = aufs_write_begin, + .write_end = aufs_write_end, + /* no bmap, no block device */ + .invalidatepage = aufs_invalidatepage, + .releasepage = aufs_releasepage, + .migratepage = aufs_migratepage, + .launder_page = aufs_launder_page, + .is_partially_uptodate = aufs_is_partially_uptodate, + .error_remove_page = aufs_error_remove_page, + .swap_activate = aufs_swap_activate, + .swap_deactivate = aufs_swap_deactivate +#endif /* CONFIG_AUFS_DEBUG */ +}; diff --git a/fs/aufs/file.h b/fs/aufs/file.h new file mode 100644 index 00000000000000..174d06fe032ea2 --- /dev/null +++ b/fs/aufs/file.h @@ -0,0 +1,284 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * file operations + */ + +#ifndef __AUFS_FILE_H__ +#define __AUFS_FILE_H__ + +#ifdef __KERNEL__ + +#include +#include +#include +#include "rwsem.h" + +struct au_branch; +struct au_hfile { + struct file *hf_file; + struct au_branch *hf_br; +}; + +struct au_vdir; +struct au_fidir { + aufs_bindex_t fd_bbot; + aufs_bindex_t fd_nent; + struct au_vdir *fd_vdir_cache; + struct au_hfile fd_hfile[]; +}; + +static inline int au_fidir_sz(int nent) +{ + AuDebugOn(nent < 0); + return sizeof(struct au_fidir) + sizeof(struct au_hfile) * nent; +} + +struct au_finfo { + atomic_t fi_generation; + + struct au_rwsem fi_rwsem; + aufs_bindex_t fi_btop; + + /* do not union them */ + struct { /* for non-dir */ + struct au_hfile fi_htop; + atomic_t fi_mmapped; + }; + struct au_fidir *fi_hdir; /* for dir only */ + + struct hlist_node fi_hlist; + struct file *fi_file; /* very ugly */ +} ____cacheline_aligned_in_smp; + +/* ---------------------------------------------------------------------- */ + +/* file.c */ +extern const struct address_space_operations aufs_aop; +unsigned int au_file_roflags(unsigned int flags); +struct file *au_h_open(struct dentry *dentry, aufs_bindex_t bindex, int flags, + struct file *file, int force_wr); +int au_do_open(struct file *file, int (*open)(struct file *file, int flags), + struct au_fidir *fidir); +int au_reopen_nondir(struct file *file); +struct au_pin; +int au_ready_to_write(struct file *file, loff_t len, struct au_pin *pin); +int au_reval_and_lock_fdi(struct file *file, int (*reopen)(struct file *file), + int wlock); +int au_do_flush(struct file *file, fl_owner_t id, + int (*flush)(struct file *file, fl_owner_t id)); + +/* poll.c */ +#ifdef CONFIG_AUFS_POLL +unsigned int aufs_poll(struct file *file, poll_table *wait); +#endif + +#ifdef CONFIG_AUFS_BR_HFSPLUS +/* hfsplus.c */ +struct file *au_h_open_pre(struct dentry *dentry, aufs_bindex_t bindex, + int force_wr); +void au_h_open_post(struct dentry *dentry, aufs_bindex_t bindex, + struct file *h_file); +#else +AuStub(struct file *, au_h_open_pre, return NULL, struct dentry *dentry, + aufs_bindex_t bindex, int force_wr) +AuStubVoid(au_h_open_post, struct dentry *dentry, aufs_bindex_t bindex, + struct file *h_file); +#endif + +/* f_op.c */ +extern const struct file_operations aufs_file_fop; +int au_do_open_nondir(struct file *file, int flags); +int aufs_release_nondir(struct inode *inode __maybe_unused, struct file *file); + +/* finfo.c */ +void au_hfput(struct au_hfile *hf, struct file *file); +void au_set_h_fptr(struct file *file, aufs_bindex_t bindex, + struct file *h_file); + +void au_update_figen(struct file *file); +struct au_fidir *au_fidir_alloc(struct super_block *sb); +int au_fidir_realloc(struct au_finfo *finfo, int nbr); + +void au_fi_init_once(void *_fi); +void au_finfo_fin(struct file *file); +int au_finfo_init(struct file *file, struct au_fidir *fidir); + +/* ioctl.c */ +long aufs_ioctl_nondir(struct file *file, unsigned int cmd, unsigned long arg); +#ifdef CONFIG_COMPAT +long aufs_compat_ioctl_dir(struct file *file, unsigned int cmd, + unsigned long arg); +long aufs_compat_ioctl_nondir(struct file *file, unsigned int cmd, + unsigned long arg); +#endif + +/* ---------------------------------------------------------------------- */ + +static inline struct au_finfo *au_fi(struct file *file) +{ + return file->private_data; +} + +/* ---------------------------------------------------------------------- */ + +/* + * fi_read_lock, fi_write_lock, + * fi_read_unlock, fi_write_unlock, fi_downgrade_lock + */ +AuSimpleRwsemFuncs(fi, struct file *f, &au_fi(f)->fi_rwsem); + +#define FiMustNoWaiters(f) AuRwMustNoWaiters(&au_fi(f)->fi_rwsem) +#define FiMustAnyLock(f) AuRwMustAnyLock(&au_fi(f)->fi_rwsem) +#define FiMustWriteLock(f) AuRwMustWriteLock(&au_fi(f)->fi_rwsem) + +/* ---------------------------------------------------------------------- */ + +/* todo: hard/soft set? */ +static inline aufs_bindex_t au_fbstart(struct file *file) +{ + FiMustAnyLock(file); + return au_fi(file)->fi_btop; +} + +static inline aufs_bindex_t au_fbend_dir(struct file *file) +{ + FiMustAnyLock(file); + AuDebugOn(!au_fi(file)->fi_hdir); + return au_fi(file)->fi_hdir->fd_bbot; +} + +static inline struct au_vdir *au_fvdir_cache(struct file *file) +{ + FiMustAnyLock(file); + AuDebugOn(!au_fi(file)->fi_hdir); + return au_fi(file)->fi_hdir->fd_vdir_cache; +} + +static inline void au_set_fbstart(struct file *file, aufs_bindex_t bindex) +{ + FiMustWriteLock(file); + au_fi(file)->fi_btop = bindex; +} + +static inline void au_set_fbend_dir(struct file *file, aufs_bindex_t bindex) +{ + FiMustWriteLock(file); + AuDebugOn(!au_fi(file)->fi_hdir); + au_fi(file)->fi_hdir->fd_bbot = bindex; +} + +static inline void au_set_fvdir_cache(struct file *file, + struct au_vdir *vdir_cache) +{ + FiMustWriteLock(file); + AuDebugOn(!au_fi(file)->fi_hdir); + au_fi(file)->fi_hdir->fd_vdir_cache = vdir_cache; +} + +static inline struct file *au_hf_top(struct file *file) +{ + FiMustAnyLock(file); + AuDebugOn(au_fi(file)->fi_hdir); + return au_fi(file)->fi_htop.hf_file; +} + +static inline struct file *au_hf_dir(struct file *file, aufs_bindex_t bindex) +{ + FiMustAnyLock(file); + AuDebugOn(!au_fi(file)->fi_hdir); + return au_fi(file)->fi_hdir->fd_hfile[0 + bindex].hf_file; +} + +/* todo: memory barrier? */ +static inline unsigned int au_figen(struct file *f) +{ + return atomic_read(&au_fi(f)->fi_generation); +} + +static inline void au_set_mmapped(struct file *f) +{ + if (atomic_inc_return(&au_fi(f)->fi_mmapped)) + return; + pr_warn("fi_mmapped wrapped around\n"); + while (!atomic_inc_return(&au_fi(f)->fi_mmapped)) + ; +} + +static inline void au_unset_mmapped(struct file *f) +{ + atomic_dec(&au_fi(f)->fi_mmapped); +} + +static inline int au_test_mmapped(struct file *f) +{ + return atomic_read(&au_fi(f)->fi_mmapped); +} + +/* customize vma->vm_file */ + +static inline void au_do_vm_file_reset(struct vm_area_struct *vma, + struct file *file) +{ + struct file *f; + + f = vma->vm_file; + get_file(file); + vma->vm_file = file; + fput(f); +} + +#ifdef CONFIG_MMU +#define AuDbgVmRegion(file, vma) do {} while (0) + +static inline void au_vm_file_reset(struct vm_area_struct *vma, + struct file *file) +{ + au_do_vm_file_reset(vma, file); +} +#else +#define AuDbgVmRegion(file, vma) \ + AuDebugOn((vma)->vm_region && (vma)->vm_region->vm_file != (file)) + +static inline void au_vm_file_reset(struct vm_area_struct *vma, + struct file *file) +{ + struct file *f; + + au_do_vm_file_reset(vma, file); + f = vma->vm_region->vm_file; + get_file(file); + vma->vm_region->vm_file = file; + fput(f); +} +#endif /* CONFIG_MMU */ + +/* handle vma->vm_prfile */ +static inline void au_vm_prfile_set(struct vm_area_struct *vma, + struct file *file) +{ + get_file(file); + vma->vm_prfile = file; +#ifndef CONFIG_MMU + get_file(file); + vma->vm_region->vm_prfile = file; +#endif +} + +#endif /* __KERNEL__ */ +#endif /* __AUFS_FILE_H__ */ diff --git a/fs/aufs/finfo.c b/fs/aufs/finfo.c new file mode 100644 index 00000000000000..28cc9bffa369fe --- /dev/null +++ b/fs/aufs/finfo.c @@ -0,0 +1,156 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * file private data + */ + +#include "aufs.h" + +void au_hfput(struct au_hfile *hf, struct file *file) +{ + /* todo: direct access f_flags */ + if (vfsub_file_flags(file) & __FMODE_EXEC) + allow_write_access(hf->hf_file); + fput(hf->hf_file); + hf->hf_file = NULL; + atomic_dec(&hf->hf_br->br_count); + hf->hf_br = NULL; +} + +void au_set_h_fptr(struct file *file, aufs_bindex_t bindex, struct file *val) +{ + struct au_finfo *finfo = au_fi(file); + struct au_hfile *hf; + struct au_fidir *fidir; + + fidir = finfo->fi_hdir; + if (!fidir) { + AuDebugOn(finfo->fi_btop != bindex); + hf = &finfo->fi_htop; + } else + hf = fidir->fd_hfile + bindex; + + if (hf && hf->hf_file) + au_hfput(hf, file); + if (val) { + FiMustWriteLock(file); + hf->hf_file = val; + hf->hf_br = au_sbr(file->f_dentry->d_sb, bindex); + } +} + +void au_update_figen(struct file *file) +{ + atomic_set(&au_fi(file)->fi_generation, au_digen(file->f_dentry)); + /* smp_mb(); */ /* atomic_set */ +} + +/* ---------------------------------------------------------------------- */ + +struct au_fidir *au_fidir_alloc(struct super_block *sb) +{ + struct au_fidir *fidir; + int nbr; + + nbr = au_sbend(sb) + 1; + if (nbr < 2) + nbr = 2; /* initial allocate for 2 branches */ + fidir = kzalloc(au_fidir_sz(nbr), GFP_NOFS); + if (fidir) { + fidir->fd_bbot = -1; + fidir->fd_nent = nbr; + fidir->fd_vdir_cache = NULL; + } + + return fidir; +} + +int au_fidir_realloc(struct au_finfo *finfo, int nbr) +{ + int err; + struct au_fidir *fidir, *p; + + AuRwMustWriteLock(&finfo->fi_rwsem); + fidir = finfo->fi_hdir; + AuDebugOn(!fidir); + + err = -ENOMEM; + p = au_kzrealloc(fidir, au_fidir_sz(fidir->fd_nent), au_fidir_sz(nbr), + GFP_NOFS); + if (p) { + p->fd_nent = nbr; + finfo->fi_hdir = p; + err = 0; + } + + return err; +} + +/* ---------------------------------------------------------------------- */ + +void au_finfo_fin(struct file *file) +{ + struct au_finfo *finfo; + + au_nfiles_dec(file->f_dentry->d_sb); + + finfo = au_fi(file); + AuDebugOn(finfo->fi_hdir); + AuRwDestroy(&finfo->fi_rwsem); + au_cache_free_finfo(finfo); +} + +void au_fi_init_once(void *_finfo) +{ + struct au_finfo *finfo = _finfo; + static struct lock_class_key aufs_fi; + + au_rw_init(&finfo->fi_rwsem); + au_rw_class(&finfo->fi_rwsem, &aufs_fi); +} + +int au_finfo_init(struct file *file, struct au_fidir *fidir) +{ + int err; + struct au_finfo *finfo; + struct dentry *dentry; + + err = -ENOMEM; + dentry = file->f_dentry; + finfo = au_cache_alloc_finfo(); + if (unlikely(!finfo)) + goto out; + + err = 0; + au_nfiles_inc(dentry->d_sb); + /* verbose coding for lock class name */ + if (!fidir) + au_rw_class(&finfo->fi_rwsem, au_lc_key + AuLcNonDir_FIINFO); + else + au_rw_class(&finfo->fi_rwsem, au_lc_key + AuLcDir_FIINFO); + au_rw_write_lock(&finfo->fi_rwsem); + finfo->fi_btop = -1; + finfo->fi_hdir = fidir; + atomic_set(&finfo->fi_generation, au_digen(dentry)); + /* smp_mb(); */ /* atomic_set */ + + file->private_data = finfo; + +out: + return err; +} diff --git a/fs/aufs/fstype.h b/fs/aufs/fstype.h new file mode 100644 index 00000000000000..b6e6f79f744f02 --- /dev/null +++ b/fs/aufs/fstype.h @@ -0,0 +1,469 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * judging filesystem type + */ + +#ifndef __AUFS_FSTYPE_H__ +#define __AUFS_FSTYPE_H__ + +#ifdef __KERNEL__ + +#include +#include +#include + +static inline int au_test_aufs(struct super_block *sb) +{ + return sb->s_magic == AUFS_SUPER_MAGIC; +} + +static inline const char *au_sbtype(struct super_block *sb) +{ + return sb->s_type->name; +} + +static inline int au_test_iso9660(struct super_block *sb __maybe_unused) +{ +#if defined(CONFIG_ROMFS_FS) || defined(CONFIG_ROMFS_FS_MODULE) + return sb->s_magic == ROMFS_MAGIC; +#else + return 0; +#endif +} + +static inline int au_test_romfs(struct super_block *sb __maybe_unused) +{ +#if defined(CONFIG_ISO9660_FS) || defined(CONFIG_ISO9660_FS_MODULE) + return sb->s_magic == ISOFS_SUPER_MAGIC; +#else + return 0; +#endif +} + +static inline int au_test_cramfs(struct super_block *sb __maybe_unused) +{ +#if defined(CONFIG_CRAMFS) || defined(CONFIG_CRAMFS_MODULE) + return sb->s_magic == CRAMFS_MAGIC; +#endif + return 0; +} + +static inline int au_test_nfs(struct super_block *sb __maybe_unused) +{ +#if defined(CONFIG_NFS_FS) || defined(CONFIG_NFS_FS_MODULE) + return sb->s_magic == NFS_SUPER_MAGIC; +#else + return 0; +#endif +} + +static inline int au_test_fuse(struct super_block *sb __maybe_unused) +{ +#if defined(CONFIG_FUSE_FS) || defined(CONFIG_FUSE_FS_MODULE) + return sb->s_magic == FUSE_SUPER_MAGIC; +#else + return 0; +#endif +} + +static inline int au_test_xfs(struct super_block *sb __maybe_unused) +{ +#if defined(CONFIG_XFS_FS) || defined(CONFIG_XFS_FS_MODULE) + return sb->s_magic == XFS_SB_MAGIC; +#else + return 0; +#endif +} + +static inline int au_test_tmpfs(struct super_block *sb __maybe_unused) +{ +#ifdef CONFIG_TMPFS + return sb->s_magic == TMPFS_MAGIC; +#else + return 0; +#endif +} + +static inline int au_test_ecryptfs(struct super_block *sb __maybe_unused) +{ +#if defined(CONFIG_ECRYPT_FS) || defined(CONFIG_ECRYPT_FS_MODULE) + return !strcmp(au_sbtype(sb), "ecryptfs"); +#else + return 0; +#endif +} + +static inline int au_test_ocfs2(struct super_block *sb __maybe_unused) +{ +#if defined(CONFIG_OCFS2_FS) || defined(CONFIG_OCFS2_FS_MODULE) + return sb->s_magic == OCFS2_SUPER_MAGIC; +#else + return 0; +#endif +} + +static inline int au_test_ocfs2_dlmfs(struct super_block *sb __maybe_unused) +{ +#if defined(CONFIG_OCFS2_FS_O2CB) || defined(CONFIG_OCFS2_FS_O2CB_MODULE) + return sb->s_magic == DLMFS_MAGIC; +#else + return 0; +#endif +} + +static inline int au_test_coda(struct super_block *sb __maybe_unused) +{ +#if defined(CONFIG_CODA_FS) || defined(CONFIG_CODA_FS_MODULE) + return sb->s_magic == CODA_SUPER_MAGIC; +#else + return 0; +#endif +} + +static inline int au_test_v9fs(struct super_block *sb __maybe_unused) +{ +#if defined(CONFIG_9P_FS) || defined(CONFIG_9P_FS_MODULE) + return sb->s_magic == V9FS_MAGIC; +#else + return 0; +#endif +} + +static inline int au_test_ext4(struct super_block *sb __maybe_unused) +{ +#if defined(CONFIG_EXT4_FS) || defined(CONFIG_EXT4_FS_MODULE) + return sb->s_magic == EXT4_SUPER_MAGIC; +#else + return 0; +#endif +} + +static inline int au_test_sysv(struct super_block *sb __maybe_unused) +{ +#if defined(CONFIG_SYSV_FS) || defined(CONFIG_SYSV_FS_MODULE) + return !strcmp(au_sbtype(sb), "sysv"); +#else + return 0; +#endif +} + +static inline int au_test_ramfs(struct super_block *sb) +{ + return sb->s_magic == RAMFS_MAGIC; +} + +static inline int au_test_ubifs(struct super_block *sb __maybe_unused) +{ +#if defined(CONFIG_UBIFS_FS) || defined(CONFIG_UBIFS_FS_MODULE) + return sb->s_magic == UBIFS_SUPER_MAGIC; +#else + return 0; +#endif +} + +static inline int au_test_procfs(struct super_block *sb __maybe_unused) +{ +#ifdef CONFIG_PROC_FS + return sb->s_magic == PROC_SUPER_MAGIC; +#else + return 0; +#endif +} + +static inline int au_test_sysfs(struct super_block *sb __maybe_unused) +{ +#ifdef CONFIG_SYSFS + return sb->s_magic == SYSFS_MAGIC; +#else + return 0; +#endif +} + +static inline int au_test_configfs(struct super_block *sb __maybe_unused) +{ +#if defined(CONFIG_CONFIGFS_FS) || defined(CONFIG_CONFIGFS_FS_MODULE) + return sb->s_magic == CONFIGFS_MAGIC; +#else + return 0; +#endif +} + +static inline int au_test_minix(struct super_block *sb __maybe_unused) +{ +#if defined(CONFIG_MINIX_FS) || defined(CONFIG_MINIX_FS_MODULE) + return sb->s_magic == MINIX3_SUPER_MAGIC + || sb->s_magic == MINIX2_SUPER_MAGIC + || sb->s_magic == MINIX2_SUPER_MAGIC2 + || sb->s_magic == MINIX_SUPER_MAGIC + || sb->s_magic == MINIX_SUPER_MAGIC2; +#else + return 0; +#endif +} + +static inline int au_test_cifs(struct super_block *sb __maybe_unused) +{ +#if defined(CONFIG_CIFS_FS) || defined(CONFIGCIFS_FS_MODULE) + return sb->s_magic == CIFS_MAGIC_NUMBER; +#else + return 0; +#endif +} + +static inline int au_test_fat(struct super_block *sb __maybe_unused) +{ +#if defined(CONFIG_FAT_FS) || defined(CONFIG_FAT_FS_MODULE) + return sb->s_magic == MSDOS_SUPER_MAGIC; +#else + return 0; +#endif +} + +static inline int au_test_msdos(struct super_block *sb) +{ + return au_test_fat(sb); +} + +static inline int au_test_vfat(struct super_block *sb) +{ + return au_test_fat(sb); +} + +static inline int au_test_securityfs(struct super_block *sb __maybe_unused) +{ +#ifdef CONFIG_SECURITYFS + return sb->s_magic == SECURITYFS_MAGIC; +#else + return 0; +#endif +} + +static inline int au_test_squashfs(struct super_block *sb __maybe_unused) +{ +#if defined(CONFIG_SQUASHFS) || defined(CONFIG_SQUASHFS_MODULE) + return sb->s_magic == SQUASHFS_MAGIC; +#else + return 0; +#endif +} + +static inline int au_test_btrfs(struct super_block *sb __maybe_unused) +{ +#if defined(CONFIG_BTRFS_FS) || defined(CONFIG_BTRFS_FS_MODULE) + return sb->s_magic == BTRFS_SUPER_MAGIC; +#else + return 0; +#endif +} + +static inline int au_test_xenfs(struct super_block *sb __maybe_unused) +{ +#if defined(CONFIG_XENFS) || defined(CONFIG_XENFS_MODULE) + return sb->s_magic == XENFS_SUPER_MAGIC; +#else + return 0; +#endif +} + +static inline int au_test_debugfs(struct super_block *sb __maybe_unused) +{ +#ifdef CONFIG_DEBUG_FS + return sb->s_magic == DEBUGFS_MAGIC; +#else + return 0; +#endif +} + +static inline int au_test_nilfs(struct super_block *sb __maybe_unused) +{ +#if defined(CONFIG_NILFS) || defined(CONFIG_NILFS_MODULE) + return sb->s_magic == NILFS_SUPER_MAGIC; +#else + return 0; +#endif +} + +static inline int au_test_hfsplus(struct super_block *sb __maybe_unused) +{ +#if defined(CONFIG_HFSPLUS_FS) || defined(CONFIG_HFSPLUS_FS_MODULE) + return sb->s_magic == HFSPLUS_SUPER_MAGIC; +#else + return 0; +#endif +} + +/* ---------------------------------------------------------------------- */ +/* + * they can't be an aufs branch. + */ +static inline int au_test_fs_unsuppoted(struct super_block *sb) +{ + return +#ifndef CONFIG_AUFS_BR_RAMFS + au_test_ramfs(sb) || +#endif + au_test_procfs(sb) + || au_test_sysfs(sb) + || au_test_configfs(sb) + || au_test_debugfs(sb) + || au_test_securityfs(sb) + || au_test_xenfs(sb) + || au_test_ecryptfs(sb) + /* || !strcmp(au_sbtype(sb), "unionfs") */ + || au_test_aufs(sb); /* will be supported in next version */ +} + +static inline int au_test_fs_remote(struct super_block *sb) +{ + return !au_test_tmpfs(sb) +#ifdef CONFIG_AUFS_BR_RAMFS + && !au_test_ramfs(sb) +#endif + && !(sb->s_type->fs_flags & FS_REQUIRES_DEV); +} + +/* ---------------------------------------------------------------------- */ + +/* + * Note: these functions (below) are created after reading ->getattr() in all + * filesystems under linux/fs. it means we have to do so in every update... + */ + +/* + * some filesystems require getattr to refresh the inode attributes before + * referencing. + * in most cases, we can rely on the inode attribute in NFS (or every remote fs) + * and leave the work for d_revalidate() + */ +static inline int au_test_fs_refresh_iattr(struct super_block *sb) +{ + return au_test_nfs(sb) + || au_test_fuse(sb) + /* || au_test_ocfs2(sb) */ /* untested */ + /* || au_test_btrfs(sb) */ /* untested */ + /* || au_test_coda(sb) */ /* untested */ + /* || au_test_v9fs(sb) */ /* untested */ + ; +} + +/* + * filesystems which don't maintain i_size or i_blocks. + */ +static inline int au_test_fs_bad_iattr_size(struct super_block *sb) +{ + return au_test_xfs(sb) + || au_test_btrfs(sb) + || au_test_ubifs(sb) + || au_test_hfsplus(sb) /* maintained, but incorrect */ + /* || au_test_ext4(sb) */ /* untested */ + /* || au_test_ocfs2(sb) */ /* untested */ + /* || au_test_ocfs2_dlmfs(sb) */ /* untested */ + /* || au_test_sysv(sb) */ /* untested */ + /* || au_test_minix(sb) */ /* untested */ + ; +} + +/* + * filesystems which don't store the correct value in some of their inode + * attributes. + */ +static inline int au_test_fs_bad_iattr(struct super_block *sb) +{ + return au_test_fs_bad_iattr_size(sb) + /* || au_test_cifs(sb) */ /* untested */ + || au_test_fat(sb) + || au_test_msdos(sb) + || au_test_vfat(sb); +} + +/* they don't check i_nlink in link(2) */ +static inline int au_test_fs_no_limit_nlink(struct super_block *sb) +{ + return au_test_tmpfs(sb) +#ifdef CONFIG_AUFS_BR_RAMFS + || au_test_ramfs(sb) +#endif + || au_test_ubifs(sb) + || au_test_hfsplus(sb); +} + +/* + * filesystems which sets S_NOATIME and S_NOCMTIME. + */ +static inline int au_test_fs_notime(struct super_block *sb) +{ + return au_test_nfs(sb) + || au_test_fuse(sb) + || au_test_ubifs(sb) + /* || au_test_cifs(sb) */ /* untested */ + ; +} + +/* + * filesystems which requires replacing i_mapping. + */ +static inline int au_test_fs_bad_mapping(struct super_block *sb) +{ + return au_test_fuse(sb) + || au_test_ubifs(sb); +} + +/* temporary support for i#1 in cramfs */ +static inline int au_test_fs_unique_ino(struct inode *inode) +{ + if (au_test_cramfs(inode->i_sb)) + return inode->i_ino != 1; + return 1; +} + +/* ---------------------------------------------------------------------- */ + +/* + * the filesystem where the xino files placed must support i/o after unlink and + * maintain i_size and i_blocks. + */ +static inline int au_test_fs_bad_xino(struct super_block *sb) +{ + return au_test_fs_remote(sb) + || au_test_fs_bad_iattr_size(sb) + /* don't want unnecessary work for xino */ + || au_test_aufs(sb) + || au_test_ecryptfs(sb) + || au_test_nilfs(sb); +} + +static inline int au_test_fs_trunc_xino(struct super_block *sb) +{ + return au_test_tmpfs(sb) + || au_test_ramfs(sb); +} + +/* + * test if the @sb is real-readonly. + */ +static inline int au_test_fs_rr(struct super_block *sb) +{ + return au_test_squashfs(sb) + || au_test_iso9660(sb) + || au_test_cramfs(sb) + || au_test_romfs(sb); +} + +#endif /* __KERNEL__ */ +#endif /* __AUFS_FSTYPE_H__ */ diff --git a/fs/aufs/hfsnotify.c b/fs/aufs/hfsnotify.c new file mode 100644 index 00000000000000..21d77179609c23 --- /dev/null +++ b/fs/aufs/hfsnotify.c @@ -0,0 +1,302 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * fsnotify for the lower directories + */ + +#include "aufs.h" + +/* FS_IN_IGNORED is unnecessary */ +static const __u32 AuHfsnMask = (FS_MOVED_TO | FS_MOVED_FROM | FS_DELETE + | FS_CREATE | FS_EVENT_ON_CHILD); +static DECLARE_WAIT_QUEUE_HEAD(au_hfsn_wq); +static __cacheline_aligned_in_smp atomic64_t au_hfsn_ifree = ATOMIC64_INIT(0); + +static void au_hfsn_free_mark(struct fsnotify_mark *mark) +{ + struct au_hnotify *hn = container_of(mark, struct au_hnotify, + hn_mark); + AuDbg("here\n"); + au_cache_free_hnotify(hn); + smp_mb__before_atomic_dec(); + if (atomic64_dec_and_test(&au_hfsn_ifree)) + wake_up(&au_hfsn_wq); +} + +static int au_hfsn_alloc(struct au_hinode *hinode) +{ + int err; + struct au_hnotify *hn; + struct super_block *sb; + struct au_branch *br; + struct fsnotify_mark *mark; + aufs_bindex_t bindex; + + hn = hinode->hi_notify; + sb = hn->hn_aufs_inode->i_sb; + bindex = au_br_index(sb, hinode->hi_id); + br = au_sbr(sb, bindex); + AuDebugOn(!br->br_hfsn); + + mark = &hn->hn_mark; + fsnotify_init_mark(mark, au_hfsn_free_mark); + mark->mask = AuHfsnMask; + /* + * by udba rename or rmdir, aufs assign a new inode to the known + * h_inode, so specify 1 to allow dups. + */ + lockdep_off(); + err = fsnotify_add_mark(mark, br->br_hfsn->hfsn_group, hinode->hi_inode, + /*mnt*/NULL, /*allow_dups*/1); + /* even if err */ + fsnotify_put_mark(mark); + lockdep_on(); + + return err; +} + +static int au_hfsn_free(struct au_hinode *hinode, struct au_hnotify *hn) +{ + struct fsnotify_mark *mark; + unsigned long long ull; + struct fsnotify_group *group; + + ull = atomic64_inc_return(&au_hfsn_ifree); + BUG_ON(!ull); + + mark = &hn->hn_mark; + spin_lock(&mark->lock); + group = mark->group; + fsnotify_get_group(group); + spin_unlock(&mark->lock); + lockdep_off(); + fsnotify_destroy_mark(mark, group); + fsnotify_put_group(group); + lockdep_on(); + + /* free hn by myself */ + return 0; +} + +/* ---------------------------------------------------------------------- */ + +static void au_hfsn_ctl(struct au_hinode *hinode, int do_set) +{ + struct fsnotify_mark *mark; + + mark = &hinode->hi_notify->hn_mark; + spin_lock(&mark->lock); + if (do_set) { + AuDebugOn(mark->mask & AuHfsnMask); + mark->mask |= AuHfsnMask; + } else { + AuDebugOn(!(mark->mask & AuHfsnMask)); + mark->mask &= ~AuHfsnMask; + } + spin_unlock(&mark->lock); + /* fsnotify_recalc_inode_mask(hinode->hi_inode); */ +} + +/* ---------------------------------------------------------------------- */ + +/* #define AuDbgHnotify */ +#ifdef AuDbgHnotify +static char *au_hfsn_name(u32 mask) +{ +#ifdef CONFIG_AUFS_DEBUG +#define test_ret(flag) \ + do { \ + if (mask & flag) \ + return #flag; \ + } while (0) + test_ret(FS_ACCESS); + test_ret(FS_MODIFY); + test_ret(FS_ATTRIB); + test_ret(FS_CLOSE_WRITE); + test_ret(FS_CLOSE_NOWRITE); + test_ret(FS_OPEN); + test_ret(FS_MOVED_FROM); + test_ret(FS_MOVED_TO); + test_ret(FS_CREATE); + test_ret(FS_DELETE); + test_ret(FS_DELETE_SELF); + test_ret(FS_MOVE_SELF); + test_ret(FS_UNMOUNT); + test_ret(FS_Q_OVERFLOW); + test_ret(FS_IN_IGNORED); + test_ret(FS_IN_ISDIR); + test_ret(FS_IN_ONESHOT); + test_ret(FS_EVENT_ON_CHILD); + return ""; +#undef test_ret +#else + return "??"; +#endif +} +#endif + +/* ---------------------------------------------------------------------- */ + +static void au_hfsn_free_group(struct fsnotify_group *group) +{ + struct au_br_hfsnotify *hfsn = group->private; + + AuDbg("here\n"); + kfree(hfsn); +} + +static int au_hfsn_handle_event(struct fsnotify_group *group, + struct fsnotify_mark *inode_mark, + struct fsnotify_mark *vfsmount_mark, + struct fsnotify_event *event) +{ + int err; + struct au_hnotify *hnotify; + struct inode *h_dir, *h_inode; + __u32 mask; + struct qstr h_child_qstr = QSTR_INIT(event->file_name, event->name_len); + + AuDebugOn(event->data_type != FSNOTIFY_EVENT_INODE); + + err = 0; + /* if FS_UNMOUNT happens, there must be another bug */ + mask = event->mask; + AuDebugOn(mask & FS_UNMOUNT); + if (mask & (FS_IN_IGNORED | FS_UNMOUNT)) + goto out; + + h_dir = event->to_tell; + h_inode = event->inode; +#ifdef AuDbgHnotify + au_debug_on(); + if (1 || h_child_qstr.len != sizeof(AUFS_XINO_FNAME) - 1 + || strncmp(h_child_qstr.name, AUFS_XINO_FNAME, h_child_qstr.len)) { + AuDbg("i%lu, mask 0x%x %s, hcname %.*s, hi%lu\n", + h_dir->i_ino, mask, au_hfsn_name(mask), + AuLNPair(&h_child_qstr), h_inode ? h_inode->i_ino : 0); + /* WARN_ON(1); */ + } + au_debug_off(); +#endif + + AuDebugOn(!inode_mark); + hnotify = container_of(inode_mark, struct au_hnotify, hn_mark); + err = au_hnotify(h_dir, hnotify, mask, &h_child_qstr, h_inode); + +out: + return err; +} + +/* isn't it waste to ask every registered 'group'? */ +/* copied from linux/fs/notify/inotify/inotify_fsnotiry.c */ +/* it should be exported to modules */ +static bool au_hfsn_should_send_event(struct fsnotify_group *group, + struct inode *h_inode, + struct fsnotify_mark *inode_mark, + struct fsnotify_mark *vfsmount_mark, + __u32 mask, void *data, int data_type) +{ + mask = (mask & ~FS_EVENT_ON_CHILD); + return inode_mark->mask & mask; +} + +static struct fsnotify_ops au_hfsn_ops = { + .should_send_event = au_hfsn_should_send_event, + .handle_event = au_hfsn_handle_event, + .free_group_priv = au_hfsn_free_group +}; + +/* ---------------------------------------------------------------------- */ + +static void au_hfsn_fin_br(struct au_branch *br) +{ + struct au_br_hfsnotify *hfsn; + + hfsn = br->br_hfsn; + if (hfsn) { + lockdep_off(); + fsnotify_put_group(hfsn->hfsn_group); + lockdep_on(); + } +} + +static int au_hfsn_init_br(struct au_branch *br, int perm) +{ + int err; + struct fsnotify_group *group; + struct au_br_hfsnotify *hfsn; + + err = 0; + br->br_hfsn = NULL; + if (!au_br_hnotifyable(perm)) + goto out; + + err = -ENOMEM; + hfsn = kmalloc(sizeof(*hfsn), GFP_NOFS); + if (unlikely(!hfsn)) + goto out; + + err = 0; + group = fsnotify_alloc_group(&au_hfsn_ops); + if (IS_ERR(group)) { + err = PTR_ERR(group); + pr_err("fsnotify_alloc_group() failed, %d\n", err); + goto out_hfsn; + } + + group->private = hfsn; + hfsn->hfsn_group = group; + br->br_hfsn = hfsn; + goto out; /* success */ + +out_hfsn: + kfree(hfsn); +out: + return err; +} + +static int au_hfsn_reset_br(unsigned int udba, struct au_branch *br, int perm) +{ + int err; + + err = 0; + if (!br->br_hfsn) + err = au_hfsn_init_br(br, perm); + + return err; +} + +/* ---------------------------------------------------------------------- */ + +static void au_hfsn_fin(void) +{ + AuDbg("au_hfsn_ifree %lld\n", (long long)atomic64_read(&au_hfsn_ifree)); + wait_event(au_hfsn_wq, !atomic64_read(&au_hfsn_ifree)); +} + +const struct au_hnotify_op au_hnotify_op = { + .ctl = au_hfsn_ctl, + .alloc = au_hfsn_alloc, + .free = au_hfsn_free, + + .fin = au_hfsn_fin, + + .reset_br = au_hfsn_reset_br, + .fin_br = au_hfsn_fin_br, + .init_br = au_hfsn_init_br +}; diff --git a/fs/aufs/hfsplus.c b/fs/aufs/hfsplus.c new file mode 100644 index 00000000000000..cb4340348c62fb --- /dev/null +++ b/fs/aufs/hfsplus.c @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2010-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * special support for filesystems which aqucires an inode mutex + * at final closing a file, eg, hfsplus. + * + * This trick is very simple and stupid, just to open the file before really + * neceeary open to tell hfsplus that this is not the final closing. + * The caller should call au_h_open_pre() after acquiring the inode mutex, + * and au_h_open_post() after releasing it. + */ + +#include "aufs.h" + +struct file *au_h_open_pre(struct dentry *dentry, aufs_bindex_t bindex, + int force_wr) +{ + struct file *h_file; + struct dentry *h_dentry; + + h_dentry = au_h_dptr(dentry, bindex); + AuDebugOn(!h_dentry); + AuDebugOn(!h_dentry->d_inode); + + h_file = NULL; + if (au_test_hfsplus(h_dentry->d_sb) + && S_ISREG(h_dentry->d_inode->i_mode)) + h_file = au_h_open(dentry, bindex, + O_RDONLY | O_NOATIME | O_LARGEFILE, + /*file*/NULL, force_wr); + return h_file; +} + +void au_h_open_post(struct dentry *dentry, aufs_bindex_t bindex, + struct file *h_file) +{ + if (h_file) { + fput(h_file); + au_sbr_put(dentry->d_sb, bindex); + } +} diff --git a/fs/aufs/hnotify.c b/fs/aufs/hnotify.c new file mode 100644 index 00000000000000..6b2e1fa7ac5b63 --- /dev/null +++ b/fs/aufs/hnotify.c @@ -0,0 +1,712 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * abstraction to notify the direct changes on lower directories + */ + +#include "aufs.h" + +int au_hn_alloc(struct au_hinode *hinode, struct inode *inode) +{ + int err; + struct au_hnotify *hn; + + err = -ENOMEM; + hn = au_cache_alloc_hnotify(); + if (hn) { + hn->hn_aufs_inode = inode; + hinode->hi_notify = hn; + err = au_hnotify_op.alloc(hinode); + AuTraceErr(err); + if (unlikely(err)) { + hinode->hi_notify = NULL; + au_cache_free_hnotify(hn); + /* + * The upper dir was removed by udba, but the same named + * dir left. In this case, aufs assignes a new inode + * number and set the monitor again. + * For the lower dir, the old monitnor is still left. + */ + if (err == -EEXIST) + err = 0; + } + } + + AuTraceErr(err); + return err; +} + +void au_hn_free(struct au_hinode *hinode) +{ + struct au_hnotify *hn; + + hn = hinode->hi_notify; + if (hn) { + hinode->hi_notify = NULL; + if (au_hnotify_op.free(hinode, hn)) + au_cache_free_hnotify(hn); + } +} + +/* ---------------------------------------------------------------------- */ + +void au_hn_ctl(struct au_hinode *hinode, int do_set) +{ + if (hinode->hi_notify) + au_hnotify_op.ctl(hinode, do_set); +} + +void au_hn_reset(struct inode *inode, unsigned int flags) +{ + aufs_bindex_t bindex, bend; + struct inode *hi; + struct dentry *iwhdentry; + + bend = au_ibend(inode); + for (bindex = au_ibstart(inode); bindex <= bend; bindex++) { + hi = au_h_iptr(inode, bindex); + if (!hi) + continue; + + /* mutex_lock_nested(&hi->i_mutex, AuLsc_I_CHILD); */ + iwhdentry = au_hi_wh(inode, bindex); + if (iwhdentry) + dget(iwhdentry); + au_igrab(hi); + au_set_h_iptr(inode, bindex, NULL, 0); + au_set_h_iptr(inode, bindex, au_igrab(hi), + flags & ~AuHi_XINO); + iput(hi); + dput(iwhdentry); + /* mutex_unlock(&hi->i_mutex); */ + } +} + +/* ---------------------------------------------------------------------- */ + +static int hn_xino(struct inode *inode, struct inode *h_inode) +{ + int err; + aufs_bindex_t bindex, bend, bfound, bstart; + struct inode *h_i; + + err = 0; + if (unlikely(inode->i_ino == AUFS_ROOT_INO)) { + pr_warn("branch root dir was changed\n"); + goto out; + } + + bfound = -1; + bend = au_ibend(inode); + bstart = au_ibstart(inode); +#if 0 /* reserved for future use */ + if (bindex == bend) { + /* keep this ino in rename case */ + goto out; + } +#endif + for (bindex = bstart; bindex <= bend; bindex++) + if (au_h_iptr(inode, bindex) == h_inode) { + bfound = bindex; + break; + } + if (bfound < 0) + goto out; + + for (bindex = bstart; bindex <= bend; bindex++) { + h_i = au_h_iptr(inode, bindex); + if (!h_i) + continue; + + err = au_xino_write(inode->i_sb, bindex, h_i->i_ino, /*ino*/0); + /* ignore this error */ + /* bad action? */ + } + + /* children inode number will be broken */ + +out: + AuTraceErr(err); + return err; +} + +static int hn_gen_tree(struct dentry *dentry) +{ + int err, i, j, ndentry; + struct au_dcsub_pages dpages; + struct au_dpage *dpage; + struct dentry **dentries; + + err = au_dpages_init(&dpages, GFP_NOFS); + if (unlikely(err)) + goto out; + err = au_dcsub_pages(&dpages, dentry, NULL, NULL); + if (unlikely(err)) + goto out_dpages; + + for (i = 0; i < dpages.ndpage; i++) { + dpage = dpages.dpages + i; + dentries = dpage->dentries; + ndentry = dpage->ndentry; + for (j = 0; j < ndentry; j++) { + struct dentry *d; + + d = dentries[j]; + if (IS_ROOT(d)) + continue; + + au_digen_dec(d); + if (d->d_inode) + /* todo: reset children xino? + cached children only? */ + au_iigen_dec(d->d_inode); + } + } + +out_dpages: + au_dpages_free(&dpages); + +#if 0 + /* discard children */ + dentry_unhash(dentry); + dput(dentry); +#endif +out: + return err; +} + +/* + * return 0 if processed. + */ +static int hn_gen_by_inode(char *name, unsigned int nlen, struct inode *inode, + const unsigned int isdir) +{ + int err; + struct dentry *d; + struct qstr *dname; + + err = 1; + if (unlikely(inode->i_ino == AUFS_ROOT_INO)) { + pr_warn("branch root dir was changed\n"); + err = 0; + goto out; + } + + if (!isdir) { + AuDebugOn(!name); + au_iigen_dec(inode); + spin_lock(&inode->i_lock); + hlist_for_each_entry(d, &inode->i_dentry, d_u.d_alias) { + spin_lock(&d->d_lock); + dname = &d->d_name; + if (dname->len != nlen + && memcmp(dname->name, name, nlen)) { + spin_unlock(&d->d_lock); + continue; + } + err = 0; + au_digen_dec(d); + spin_unlock(&d->d_lock); + break; + } + spin_unlock(&inode->i_lock); + } else { + au_fset_si(au_sbi(inode->i_sb), FAILED_REFRESH_DIR); + d = d_find_any_alias(inode); + if (!d) { + au_iigen_dec(inode); + goto out; + } + + spin_lock(&d->d_lock); + dname = &d->d_name; + if (dname->len == nlen && !memcmp(dname->name, name, nlen)) { + spin_unlock(&d->d_lock); + err = hn_gen_tree(d); + spin_lock(&d->d_lock); + } + spin_unlock(&d->d_lock); + dput(d); + } + +out: + AuTraceErr(err); + return err; +} + +static int hn_gen_by_name(struct dentry *dentry, const unsigned int isdir) +{ + int err; + struct inode *inode; + + inode = dentry->d_inode; + if (IS_ROOT(dentry) + /* || (inode && inode->i_ino == AUFS_ROOT_INO) */ + ) { + pr_warn("branch root dir was changed\n"); + return 0; + } + + err = 0; + if (!isdir) { + au_digen_dec(dentry); + if (inode) + au_iigen_dec(inode); + } else { + au_fset_si(au_sbi(dentry->d_sb), FAILED_REFRESH_DIR); + if (inode) + err = hn_gen_tree(dentry); + } + + AuTraceErr(err); + return err; +} + +/* ---------------------------------------------------------------------- */ + +/* hnotify job flags */ +#define AuHnJob_XINO0 1 +#define AuHnJob_GEN (1 << 1) +#define AuHnJob_DIRENT (1 << 2) +#define AuHnJob_ISDIR (1 << 3) +#define AuHnJob_TRYXINO0 (1 << 4) +#define AuHnJob_MNTPNT (1 << 5) +#define au_ftest_hnjob(flags, name) ((flags) & AuHnJob_##name) +#define au_fset_hnjob(flags, name) \ + do { (flags) |= AuHnJob_##name; } while (0) +#define au_fclr_hnjob(flags, name) \ + do { (flags) &= ~AuHnJob_##name; } while (0) + +enum { + AuHn_CHILD, + AuHn_PARENT, + AuHnLast +}; + +struct au_hnotify_args { + struct inode *h_dir, *dir, *h_child_inode; + u32 mask; + unsigned int flags[AuHnLast]; + unsigned int h_child_nlen; + char h_child_name[]; +}; + +struct hn_job_args { + unsigned int flags; + struct inode *inode, *h_inode, *dir, *h_dir; + struct dentry *dentry; + char *h_name; + int h_nlen; +}; + +static int hn_job(struct hn_job_args *a) +{ + const unsigned int isdir = au_ftest_hnjob(a->flags, ISDIR); + int e; + + /* reset xino */ + if (au_ftest_hnjob(a->flags, XINO0) && a->inode) + hn_xino(a->inode, a->h_inode); /* ignore this error */ + + if (au_ftest_hnjob(a->flags, TRYXINO0) + && a->inode + && a->h_inode) { + mutex_lock_nested(&a->h_inode->i_mutex, AuLsc_I_CHILD); + if (!a->h_inode->i_nlink) + hn_xino(a->inode, a->h_inode); /* ignore this error */ + mutex_unlock(&a->h_inode->i_mutex); + } + + /* make the generation obsolete */ + if (au_ftest_hnjob(a->flags, GEN)) { + e = -1; + if (a->inode) + e = hn_gen_by_inode(a->h_name, a->h_nlen, a->inode, + isdir); + if (e && a->dentry) + hn_gen_by_name(a->dentry, isdir); + /* ignore this error */ + } + + /* make dir entries obsolete */ + if (au_ftest_hnjob(a->flags, DIRENT) && a->inode) { + struct au_vdir *vdir; + + vdir = au_ivdir(a->inode); + if (vdir) + vdir->vd_jiffy = 0; + /* IMustLock(a->inode); */ + /* a->inode->i_version++; */ + } + + /* can do nothing but warn */ + if (au_ftest_hnjob(a->flags, MNTPNT) + && a->dentry + && d_mountpoint(a->dentry)) + pr_warn("mount-point %.*s is removed or renamed\n", + AuDLNPair(a->dentry)); + + return 0; +} + +/* ---------------------------------------------------------------------- */ + +static struct dentry *lookup_wlock_by_name(char *name, unsigned int nlen, + struct inode *dir) +{ + struct dentry *dentry, *d, *parent; + struct qstr *dname; + + parent = d_find_any_alias(dir); + if (!parent) + return NULL; + + dentry = NULL; + spin_lock(&parent->d_lock); + list_for_each_entry(d, &parent->d_subdirs, d_child) { + /* AuDbg("%.*s\n", AuDLNPair(d)); */ + spin_lock_nested(&d->d_lock, DENTRY_D_LOCK_NESTED); + dname = &d->d_name; + if (dname->len != nlen || memcmp(dname->name, name, nlen)) + goto cont_unlock; + if (au_di(d)) + au_digen_dec(d); + else + goto cont_unlock; + if (d->d_count) { + dentry = dget_dlock(d); + spin_unlock(&d->d_lock); + break; + } + +cont_unlock: + spin_unlock(&d->d_lock); + } + spin_unlock(&parent->d_lock); + dput(parent); + + if (dentry) + di_write_lock_child(dentry); + + return dentry; +} + +static struct inode *lookup_wlock_by_ino(struct super_block *sb, + aufs_bindex_t bindex, ino_t h_ino) +{ + struct inode *inode; + ino_t ino; + int err; + + inode = NULL; + err = au_xino_read(sb, bindex, h_ino, &ino); + if (!err && ino) + inode = ilookup(sb, ino); + if (!inode) + goto out; + + if (unlikely(inode->i_ino == AUFS_ROOT_INO)) { + pr_warn("wrong root branch\n"); + iput(inode); + inode = NULL; + goto out; + } + + ii_write_lock_child(inode); + +out: + return inode; +} + +static void au_hn_bh(void *_args) +{ + struct au_hnotify_args *a = _args; + struct super_block *sb; + aufs_bindex_t bindex, bend, bfound; + unsigned char xino, try_iput; + int err; + struct inode *inode; + ino_t h_ino; + struct hn_job_args args; + struct dentry *dentry; + struct au_sbinfo *sbinfo; + + AuDebugOn(!_args); + AuDebugOn(!a->h_dir); + AuDebugOn(!a->dir); + AuDebugOn(!a->mask); + AuDbg("mask 0x%x, i%lu, hi%lu, hci%lu\n", + a->mask, a->dir->i_ino, a->h_dir->i_ino, + a->h_child_inode ? a->h_child_inode->i_ino : 0); + + inode = NULL; + dentry = NULL; + /* + * do not lock a->dir->i_mutex here + * because of d_revalidate() may cause a deadlock. + */ + sb = a->dir->i_sb; + AuDebugOn(!sb); + sbinfo = au_sbi(sb); + AuDebugOn(!sbinfo); + si_write_lock(sb, AuLock_NOPLMW); + + ii_read_lock_parent(a->dir); + bfound = -1; + bend = au_ibend(a->dir); + for (bindex = au_ibstart(a->dir); bindex <= bend; bindex++) + if (au_h_iptr(a->dir, bindex) == a->h_dir) { + bfound = bindex; + break; + } + ii_read_unlock(a->dir); + if (unlikely(bfound < 0)) + goto out; + + xino = !!au_opt_test(au_mntflags(sb), XINO); + h_ino = 0; + if (a->h_child_inode) + h_ino = a->h_child_inode->i_ino; + + if (a->h_child_nlen + && (au_ftest_hnjob(a->flags[AuHn_CHILD], GEN) + || au_ftest_hnjob(a->flags[AuHn_CHILD], MNTPNT))) + dentry = lookup_wlock_by_name(a->h_child_name, a->h_child_nlen, + a->dir); + try_iput = 0; + if (dentry) + inode = dentry->d_inode; + if (xino && !inode && h_ino + && (au_ftest_hnjob(a->flags[AuHn_CHILD], XINO0) + || au_ftest_hnjob(a->flags[AuHn_CHILD], TRYXINO0) + || au_ftest_hnjob(a->flags[AuHn_CHILD], GEN))) { + inode = lookup_wlock_by_ino(sb, bfound, h_ino); + try_iput = 1; + } + + args.flags = a->flags[AuHn_CHILD]; + args.dentry = dentry; + args.inode = inode; + args.h_inode = a->h_child_inode; + args.dir = a->dir; + args.h_dir = a->h_dir; + args.h_name = a->h_child_name; + args.h_nlen = a->h_child_nlen; + err = hn_job(&args); + if (dentry) { + if (au_di(dentry)) + di_write_unlock(dentry); + dput(dentry); + } + if (inode && try_iput) { + ii_write_unlock(inode); + iput(inode); + } + + ii_write_lock_parent(a->dir); + args.flags = a->flags[AuHn_PARENT]; + args.dentry = NULL; + args.inode = a->dir; + args.h_inode = a->h_dir; + args.dir = NULL; + args.h_dir = NULL; + args.h_name = NULL; + args.h_nlen = 0; + err = hn_job(&args); + ii_write_unlock(a->dir); + +out: + iput(a->h_child_inode); + iput(a->h_dir); + iput(a->dir); + si_write_unlock(sb); + au_nwt_done(&sbinfo->si_nowait); + kfree(a); +} + +/* ---------------------------------------------------------------------- */ + +int au_hnotify(struct inode *h_dir, struct au_hnotify *hnotify, u32 mask, + struct qstr *h_child_qstr, struct inode *h_child_inode) +{ + int err, len; + unsigned int flags[AuHnLast], f; + unsigned char isdir, isroot, wh; + struct inode *dir; + struct au_hnotify_args *args; + char *p, *h_child_name; + + err = 0; + AuDebugOn(!hnotify || !hnotify->hn_aufs_inode); + dir = igrab(hnotify->hn_aufs_inode); + if (!dir) + goto out; + + isroot = (dir->i_ino == AUFS_ROOT_INO); + wh = 0; + h_child_name = (void *)h_child_qstr->name; + len = h_child_qstr->len; + if (h_child_name) { + if (len > AUFS_WH_PFX_LEN + && !memcmp(h_child_name, AUFS_WH_PFX, AUFS_WH_PFX_LEN)) { + h_child_name += AUFS_WH_PFX_LEN; + len -= AUFS_WH_PFX_LEN; + wh = 1; + } + } + + isdir = 0; + if (h_child_inode) + isdir = !!S_ISDIR(h_child_inode->i_mode); + flags[AuHn_PARENT] = AuHnJob_ISDIR; + flags[AuHn_CHILD] = 0; + if (isdir) + flags[AuHn_CHILD] = AuHnJob_ISDIR; + au_fset_hnjob(flags[AuHn_PARENT], DIRENT); + au_fset_hnjob(flags[AuHn_CHILD], GEN); + switch (mask & FS_EVENTS_POSS_ON_CHILD) { + case FS_MOVED_FROM: + case FS_MOVED_TO: + au_fset_hnjob(flags[AuHn_CHILD], XINO0); + au_fset_hnjob(flags[AuHn_CHILD], MNTPNT); + /*FALLTHROUGH*/ + case FS_CREATE: + AuDebugOn(!h_child_name || !h_child_inode); + break; + + case FS_DELETE: + /* + * aufs never be able to get this child inode. + * revalidation should be in d_revalidate() + * by checking i_nlink, i_generation or d_unhashed(). + */ + AuDebugOn(!h_child_name); + au_fset_hnjob(flags[AuHn_CHILD], TRYXINO0); + au_fset_hnjob(flags[AuHn_CHILD], MNTPNT); + break; + + default: + AuDebugOn(1); + } + + if (wh) + h_child_inode = NULL; + + err = -ENOMEM; + /* iput() and kfree() will be called in au_hnotify() */ + args = kmalloc(sizeof(*args) + len + 1, GFP_NOFS); + if (unlikely(!args)) { + AuErr1("no memory\n"); + iput(dir); + goto out; + } + args->flags[AuHn_PARENT] = flags[AuHn_PARENT]; + args->flags[AuHn_CHILD] = flags[AuHn_CHILD]; + args->mask = mask; + args->dir = dir; + args->h_dir = igrab(h_dir); + if (h_child_inode) + h_child_inode = igrab(h_child_inode); /* can be NULL */ + args->h_child_inode = h_child_inode; + args->h_child_nlen = len; + if (len) { + p = (void *)args; + p += sizeof(*args); + memcpy(p, h_child_name, len); + p[len] = 0; + } + + f = 0; + if (!dir->i_nlink) + f = AuWkq_NEST; + err = au_wkq_nowait(au_hn_bh, args, dir->i_sb, f); + if (unlikely(err)) { + pr_err("wkq %d\n", err); + iput(args->h_child_inode); + iput(args->h_dir); + iput(args->dir); + kfree(args); + } + +out: + return err; +} + +/* ---------------------------------------------------------------------- */ + +int au_hnotify_reset_br(unsigned int udba, struct au_branch *br, int perm) +{ + int err; + + AuDebugOn(!(udba & AuOptMask_UDBA)); + + err = 0; + if (au_hnotify_op.reset_br) + err = au_hnotify_op.reset_br(udba, br, perm); + + return err; +} + +int au_hnotify_init_br(struct au_branch *br, int perm) +{ + int err; + + err = 0; + if (au_hnotify_op.init_br) + err = au_hnotify_op.init_br(br, perm); + + return err; +} + +void au_hnotify_fin_br(struct au_branch *br) +{ + if (au_hnotify_op.fin_br) + au_hnotify_op.fin_br(br); +} + +static void au_hn_destroy_cache(void) +{ + kmem_cache_destroy(au_cachep[AuCache_HNOTIFY]); + au_cachep[AuCache_HNOTIFY] = NULL; +} + +int __init au_hnotify_init(void) +{ + int err; + + err = -ENOMEM; + au_cachep[AuCache_HNOTIFY] = AuCache(au_hnotify); + if (au_cachep[AuCache_HNOTIFY]) { + err = 0; + if (au_hnotify_op.init) + err = au_hnotify_op.init(); + if (unlikely(err)) + au_hn_destroy_cache(); + } + AuTraceErr(err); + return err; +} + +void au_hnotify_fin(void) +{ + if (au_hnotify_op.fin) + au_hnotify_op.fin(); + /* cf. au_cache_fin() */ + if (au_cachep[AuCache_HNOTIFY]) + au_hn_destroy_cache(); +} diff --git a/fs/aufs/i_op.c b/fs/aufs/i_op.c new file mode 100644 index 00000000000000..e2f0c89955dc05 --- /dev/null +++ b/fs/aufs/i_op.c @@ -0,0 +1,1255 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * inode operations (except add/del/rename) + */ + +#include +#include +#include +#include +#include +#include "aufs.h" + +static int h_permission(struct inode *h_inode, int mask, + struct vfsmount *h_mnt, int brperm) +{ + int err; + const unsigned char write_mask = !!(mask & (MAY_WRITE | MAY_APPEND)); + + err = -EACCES; + if ((write_mask && IS_IMMUTABLE(h_inode)) + || ((mask & MAY_EXEC) + && S_ISREG(h_inode->i_mode) + && ((h_mnt->mnt_flags & MNT_NOEXEC) + || !(h_inode->i_mode & S_IXUGO)))) + goto out; + + /* + * - skip the lower fs test in the case of write to ro branch. + * - nfs dir permission write check is optimized, but a policy for + * link/rename requires a real check. + */ + if ((write_mask && !au_br_writable(brperm)) + || (au_test_nfs(h_inode->i_sb) && S_ISDIR(h_inode->i_mode) + && write_mask && !(mask & MAY_READ)) + || !h_inode->i_op->permission) { + /* AuLabel(generic_permission); */ + err = generic_permission(h_inode, mask); + } else { + /* AuLabel(h_inode->permission); */ + err = h_inode->i_op->permission(h_inode, mask); + AuTraceErr(err); + } + + if (!err) + err = devcgroup_inode_permission(h_inode, mask); + if (!err) + err = security_inode_permission(h_inode, mask); + +#if 0 + if (!err) { + /* todo: do we need to call ima_path_check()? */ + struct path h_path = { + .dentry = + .mnt = h_mnt + }; + err = ima_path_check(&h_path, + mask & (MAY_READ | MAY_WRITE | MAY_EXEC), + IMA_COUNT_LEAVE); + } +#endif + +out: + return err; +} + +static int aufs_permission(struct inode *inode, int mask) +{ + int err; + aufs_bindex_t bindex, bend; + const unsigned char isdir = !!S_ISDIR(inode->i_mode), + write_mask = !!(mask & (MAY_WRITE | MAY_APPEND)); + struct inode *h_inode; + struct super_block *sb; + struct au_branch *br; + + /* todo: support rcu-walk? */ + if (mask & MAY_NOT_BLOCK) + return -ECHILD; + + sb = inode->i_sb; + si_read_lock(sb, AuLock_FLUSH); + ii_read_lock_child(inode); +#if 0 + err = au_iigen_test(inode, au_sigen(sb)); + if (unlikely(err)) + goto out; +#endif + + if (!isdir + || write_mask + || au_opt_test(au_mntflags(sb), DIRPERM1)) { + err = au_busy_or_stale(); + h_inode = au_h_iptr(inode, au_ibstart(inode)); + if (unlikely(!h_inode + || (h_inode->i_mode & S_IFMT) + != (inode->i_mode & S_IFMT))) + goto out; + + err = 0; + bindex = au_ibstart(inode); + br = au_sbr(sb, bindex); + err = h_permission(h_inode, mask, au_br_mnt(br), br->br_perm); + if (write_mask + && !err + && !special_file(h_inode->i_mode)) { + /* test whether the upper writable branch exists */ + err = -EROFS; + for (; bindex >= 0; bindex--) + if (!au_br_rdonly(au_sbr(sb, bindex))) { + err = 0; + break; + } + } + goto out; + } + + /* non-write to dir */ + err = 0; + bend = au_ibend(inode); + for (bindex = au_ibstart(inode); !err && bindex <= bend; bindex++) { + h_inode = au_h_iptr(inode, bindex); + if (h_inode) { + err = au_busy_or_stale(); + if (unlikely(!S_ISDIR(h_inode->i_mode))) + break; + + br = au_sbr(sb, bindex); + err = h_permission(h_inode, mask, au_br_mnt(br), + br->br_perm); + } + } + +out: + ii_read_unlock(inode); + si_read_unlock(sb); + return err; +} + +#ifdef CONFIG_FS_POSIX_ACL +static struct posix_acl *aufs_get_acl(struct inode *inode, int mask) +{ + struct posix_acl *acl; + int err; + aufs_bindex_t bindex, bend; + const unsigned char isdir = !!S_ISDIR(inode->i_mode), + write_mask = !!(mask & (MAY_WRITE | MAY_APPEND)); + struct inode *h_inode; + struct super_block *sb; + + WARN_ON(mask & MAY_NOT_BLOCK); + + err = 0; + sb = inode->i_sb; + si_read_lock(sb, AuLock_FLUSH); + ii_read_lock_child(inode); + if (!(sb->s_flags & MS_POSIXACL)) + goto out_ii; + + err = au_busy_or_stale(); + bindex = au_ibstart(inode); + h_inode = au_h_iptr(inode, bindex); + if (unlikely(!h_inode + || (h_inode->i_mode & S_IFMT) != (inode->i_mode & S_IFMT))) + goto out_ii; + + /* cf: fs/namei.c:acl_permission_check() */ + err = -EAGAIN; + if (!IS_POSIXACL(h_inode)) + goto out_ii; + + if (!isdir + || write_mask + || au_opt_test(au_mntflags(sb), DIRPERM1)) { + err = check_acl(h_inode, mask); + if (unlikely(err && err != -EAGAIN)) + goto out_ii; + + if (write_mask + && !special_file(h_inode->i_mode)) { + /* test whether the upper writable branch exists */ + err = -EROFS; + for (; bindex >= 0; bindex--) + if (!au_br_rdonly(au_sbr(sb, bindex))) { + err = 0; + break; + } + } + goto out_ii; + } + + /* non-write to dir */ + err = 0; + bend = au_ibend(inode); + for (; (!err || err == -EAGAIN) && bindex <= bend; bindex++) { + h_inode = au_h_iptr(inode, bindex); + if (h_inode) { + err = au_busy_or_stale(); + if (unlikely(!S_ISDIR(h_inode->i_mode))) + break; + + err = check_acl(h_inode, mask); + } + } + +out_ii: + ii_read_unlock(inode); + si_read_unlock(sb); + acl = ERR_PTR(err); + + return acl; +} +#endif + +/* ---------------------------------------------------------------------- */ + +static struct dentry *aufs_lookup(struct inode *dir, struct dentry *dentry, + unsigned int flags) +{ + struct dentry *ret, *parent; + struct inode *inode; + struct super_block *sb; + int err, npositive; + + IMustLock(dir); + + /* todo: support rcu-walk? */ + ret = ERR_PTR(-ECHILD); + if (flags & LOOKUP_RCU) + goto out; + + ret = ERR_PTR(-ENAMETOOLONG); + if (unlikely(dentry->d_name.len > AUFS_MAX_NAMELEN)) + goto out; + + sb = dir->i_sb; + err = si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLM); + ret = ERR_PTR(err); + if (unlikely(err)) + goto out; + + err = au_di_init(dentry); + ret = ERR_PTR(err); + if (unlikely(err)) + goto out_si; + + inode = NULL; + npositive = 0; /* suppress a warning */ + parent = dentry->d_parent; /* dir inode is locked */ + di_read_lock_parent(parent, AuLock_IR); + err = au_alive_dir(parent); + if (!err) + err = au_digen_test(parent, au_sigen(sb)); + if (!err) { + npositive = au_lkup_dentry(dentry, au_dbstart(parent), + /*type*/0); + err = npositive; + } + di_read_unlock(parent, AuLock_IR); + ret = ERR_PTR(err); + if (unlikely(err < 0)) + goto out_unlock; + + if (npositive) { + inode = au_new_inode(dentry, /*must_new*/0); + if (IS_ERR(inode)) { + ret = (void *)inode; + inode = NULL; + goto out_unlock; + } + } + + ret = d_splice_alias(inode, dentry); +#if 0 + if (unlikely(d_need_lookup(dentry))) { + spin_lock(&dentry->d_lock); + dentry->d_flags &= ~DCACHE_NEED_LOOKUP; + spin_unlock(&dentry->d_lock); + } else +#endif + if (unlikely(IS_ERR(ret) && inode)) { + ii_write_unlock(inode); + iput(inode); + inode = NULL; + } + +out_unlock: + di_write_unlock(dentry); + if (inode) { + /* verbose coding for lock class name */ + if (unlikely(S_ISLNK(inode->i_mode))) + au_rw_class(&au_di(dentry)->di_rwsem, + au_lc_key + AuLcSymlink_DIINFO); + else if (unlikely(S_ISDIR(inode->i_mode))) + au_rw_class(&au_di(dentry)->di_rwsem, + au_lc_key + AuLcDir_DIINFO); + else /* likely */ + au_rw_class(&au_di(dentry)->di_rwsem, + au_lc_key + AuLcNonDir_DIINFO); + } +out_si: + si_read_unlock(sb); +out: + return ret; +} + +/* ---------------------------------------------------------------------- */ + +static int au_wr_dir_cpup(struct dentry *dentry, struct dentry *parent, + const unsigned char add_entry, aufs_bindex_t bcpup, + aufs_bindex_t bstart) +{ + int err; + struct dentry *h_parent; + struct inode *h_dir; + + if (add_entry) + IMustLock(parent->d_inode); + else + di_write_lock_parent(parent); + + err = 0; + if (!au_h_dptr(parent, bcpup)) { + if (bstart > bcpup) + err = au_cpup_dirs(dentry, bcpup); + else if (bstart < bcpup) + err = au_cpdown_dirs(dentry, bcpup); + else + BUG(); + } + if (!err && add_entry) { + h_parent = au_h_dptr(parent, bcpup); + h_dir = h_parent->d_inode; + mutex_lock_nested(&h_dir->i_mutex, AuLsc_I_PARENT); + err = au_lkup_neg(dentry, bcpup, + au_ftest_wrdir(add_entry, TMP_WHENTRY)); + /* todo: no unlock here */ + mutex_unlock(&h_dir->i_mutex); + + AuDbg("bcpup %d\n", bcpup); + if (!err) { + if (!dentry->d_inode) + au_set_h_dptr(dentry, bstart, NULL); + au_update_dbrange(dentry, /*do_put_zero*/0); + } + } + + if (!add_entry) + di_write_unlock(parent); + if (!err) + err = bcpup; /* success */ + + AuTraceErr(err); + return err; +} + +/* + * decide the branch and the parent dir where we will create a new entry. + * returns new bindex or an error. + * copyup the parent dir if needed. + */ +int au_wr_dir(struct dentry *dentry, struct dentry *src_dentry, + struct au_wr_dir_args *args) +{ + int err; + unsigned int flags; + aufs_bindex_t bcpup, bstart, src_bstart; + const unsigned char add_entry + = au_ftest_wrdir(args->flags, ADD_ENTRY) + | au_ftest_wrdir(args->flags, TMP_WHENTRY); + struct super_block *sb; + struct dentry *parent; + struct au_sbinfo *sbinfo; + + sb = dentry->d_sb; + sbinfo = au_sbi(sb); + parent = dget_parent(dentry); + bstart = au_dbstart(dentry); + bcpup = bstart; + if (args->force_btgt < 0) { + if (src_dentry) { + src_bstart = au_dbstart(src_dentry); + if (src_bstart < bstart) + bcpup = src_bstart; + } else if (add_entry) { + flags = 0; + if (au_ftest_wrdir(args->flags, ISDIR)) + au_fset_wbr(flags, DIR); + err = AuWbrCreate(sbinfo, dentry, flags); + bcpup = err; + } + + if (bcpup < 0 || au_test_ro(sb, bcpup, dentry->d_inode)) { + if (add_entry) + err = AuWbrCopyup(sbinfo, dentry); + else { + if (!IS_ROOT(dentry)) { + di_read_lock_parent(parent, !AuLock_IR); + err = AuWbrCopyup(sbinfo, dentry); + di_read_unlock(parent, !AuLock_IR); + } else + err = AuWbrCopyup(sbinfo, dentry); + } + bcpup = err; + if (unlikely(err < 0)) + goto out; + } + } else { + bcpup = args->force_btgt; + AuDebugOn(au_test_ro(sb, bcpup, dentry->d_inode)); + } + + AuDbg("bstart %d, bcpup %d\n", bstart, bcpup); + err = bcpup; + if (bcpup == bstart) + goto out; /* success */ + + /* copyup the new parent into the branch we process */ + err = au_wr_dir_cpup(dentry, parent, add_entry, bcpup, bstart); + if (err >= 0) { + if (!dentry->d_inode) { + au_set_h_dptr(dentry, bstart, NULL); + au_set_dbstart(dentry, bcpup); + au_set_dbend(dentry, bcpup); + } + AuDebugOn(add_entry && !au_h_dptr(dentry, bcpup)); + } + +out: + dput(parent); + return err; +} + +/* ---------------------------------------------------------------------- */ + +void au_pin_hdir_unlock(struct au_pin *p) +{ + if (p->hdir) + au_hn_imtx_unlock(p->hdir); +} + +int au_pin_hdir_lock(struct au_pin *p) +{ + int err; + + err = 0; + if (!p->hdir) + goto out; + + /* even if an error happens later, keep this lock */ + au_hn_imtx_lock_nested(p->hdir, p->lsc_hi); + + err = -EBUSY; + if (unlikely(p->hdir->hi_inode != p->h_parent->d_inode)) + goto out; + + err = 0; + if (p->h_dentry) + err = au_h_verify(p->h_dentry, p->udba, p->hdir->hi_inode, + p->h_parent, p->br); + +out: + return err; +} + +int au_pin_hdir_relock(struct au_pin *p) +{ + int err, i; + struct inode *h_i; + struct dentry *h_d[] = { + p->h_dentry, + p->h_parent + }; + + err = au_pin_hdir_lock(p); + if (unlikely(err)) + goto out; + + for (i = 0; !err && i < sizeof(h_d)/sizeof(*h_d); i++) { + if (!h_d[i]) + continue; + h_i = h_d[i]->d_inode; + if (h_i) + err = !h_i->i_nlink; + } + +out: + return err; +} + +void au_pin_hdir_set_owner(struct au_pin *p, struct task_struct *task) +{ +#if defined(CONFIG_DEBUG_MUTEXES) || defined(CONFIG_SMP) + p->hdir->hi_inode->i_mutex.owner = task; +#endif +} + +void au_pin_hdir_acquire_nest(struct au_pin *p) +{ + if (p->hdir) { + mutex_acquire_nest(&p->hdir->hi_inode->i_mutex.dep_map, + p->lsc_hi, 0, NULL, _RET_IP_); + au_pin_hdir_set_owner(p, current); + } +} + +void au_pin_hdir_release(struct au_pin *p) +{ + if (p->hdir) { + au_pin_hdir_set_owner(p, p->task); + mutex_release(&p->hdir->hi_inode->i_mutex.dep_map, 1, _RET_IP_); + } +} + +struct dentry *au_pinned_h_parent(struct au_pin *pin) +{ + if (pin && pin->parent) + return au_h_dptr(pin->parent, pin->bindex); + return NULL; +} + +void au_unpin(struct au_pin *p) +{ + if (p->hdir) + au_pin_hdir_unlock(p); + if (p->h_mnt && au_ftest_pin(p->flags, MNT_WRITE)) + vfsub_mnt_drop_write(p->h_mnt); + if (!p->hdir) + return; + + if (!au_ftest_pin(p->flags, DI_LOCKED)) + di_read_unlock(p->parent, AuLock_IR); + iput(p->hdir->hi_inode); + dput(p->parent); + p->parent = NULL; + p->hdir = NULL; + p->h_mnt = NULL; + /* do not clear p->task */ +} + +int au_do_pin(struct au_pin *p) +{ + int err; + struct super_block *sb; + struct inode *h_dir; + + err = 0; + sb = p->dentry->d_sb; + p->br = au_sbr(sb, p->bindex); + if (IS_ROOT(p->dentry)) { + if (au_ftest_pin(p->flags, MNT_WRITE)) { + p->h_mnt = au_br_mnt(p->br); + err = vfsub_mnt_want_write(p->h_mnt); + if (unlikely(err)) { + au_fclr_pin(p->flags, MNT_WRITE); + goto out_err; + } + } + goto out; + } + + p->h_dentry = NULL; + if (p->bindex <= au_dbend(p->dentry)) + p->h_dentry = au_h_dptr(p->dentry, p->bindex); + + p->parent = dget_parent(p->dentry); + if (!au_ftest_pin(p->flags, DI_LOCKED)) + di_read_lock(p->parent, AuLock_IR, p->lsc_di); + + h_dir = NULL; + p->h_parent = au_h_dptr(p->parent, p->bindex); + p->hdir = au_hi(p->parent->d_inode, p->bindex); + if (p->hdir) + h_dir = p->hdir->hi_inode; + + /* + * udba case, or + * if DI_LOCKED is not set, then p->parent may be different + * and h_parent can be NULL. + */ + if (unlikely(!p->hdir || !h_dir || !p->h_parent)) { + err = -EBUSY; + if (!au_ftest_pin(p->flags, DI_LOCKED)) + di_read_unlock(p->parent, AuLock_IR); + dput(p->parent); + p->parent = NULL; + goto out_err; + } + + if (au_ftest_pin(p->flags, MNT_WRITE)) { + p->h_mnt = au_br_mnt(p->br); + err = vfsub_mnt_want_write(p->h_mnt); + if (unlikely(err)) { + au_fclr_pin(p->flags, MNT_WRITE); + if (!au_ftest_pin(p->flags, DI_LOCKED)) + di_read_unlock(p->parent, AuLock_IR); + dput(p->parent); + p->parent = NULL; + goto out_err; + } + } + + au_igrab(h_dir); + err = au_pin_hdir_lock(p); + if (!err) + goto out; /* success */ + + au_unpin(p); + +out_err: + pr_err("err %d\n", err); + err = au_busy_or_stale(); +out: + return err; +} + +void au_pin_init(struct au_pin *p, struct dentry *dentry, + aufs_bindex_t bindex, int lsc_di, int lsc_hi, + unsigned int udba, unsigned char flags) +{ + p->dentry = dentry; + p->udba = udba; + p->lsc_di = lsc_di; + p->lsc_hi = lsc_hi; + p->flags = flags; + p->bindex = bindex; + + p->parent = NULL; + p->hdir = NULL; + p->h_mnt = NULL; + + p->h_dentry = NULL; + p->h_parent = NULL; + p->br = NULL; + p->task = current; +} + +int au_pin(struct au_pin *pin, struct dentry *dentry, aufs_bindex_t bindex, + unsigned int udba, unsigned char flags) +{ + au_pin_init(pin, dentry, bindex, AuLsc_DI_PARENT, AuLsc_I_PARENT2, + udba, flags); + return au_do_pin(pin); +} + +/* ---------------------------------------------------------------------- */ + +/* + * ->setattr() and ->getattr() are called in various cases. + * chmod, stat: dentry is revalidated. + * fchmod, fstat: file and dentry are not revalidated, additionally they may be + * unhashed. + * for ->setattr(), ia->ia_file is passed from ftruncate only. + */ +/* todo: consolidate with do_refresh() and simple_reval_dpath() */ +int au_reval_for_attr(struct dentry *dentry, unsigned int sigen) +{ + int err; + struct inode *inode; + struct dentry *parent; + + err = 0; + inode = dentry->d_inode; + if (au_digen_test(dentry, sigen)) { + parent = dget_parent(dentry); + di_read_lock_parent(parent, AuLock_IR); + err = au_refresh_dentry(dentry, parent); + di_read_unlock(parent, AuLock_IR); + dput(parent); + } + + AuTraceErr(err); + return err; +} + +int au_pin_and_icpup(struct dentry *dentry, struct iattr *ia, + struct au_icpup_args *a) +{ + int err; + loff_t sz; + aufs_bindex_t bstart, ibstart; + struct dentry *hi_wh, *parent; + struct inode *inode; + struct au_wr_dir_args wr_dir_args = { + .force_btgt = -1, + .flags = 0 + }; + + bstart = au_dbstart(dentry); + inode = dentry->d_inode; + if (S_ISDIR(inode->i_mode)) + au_fset_wrdir(wr_dir_args.flags, ISDIR); + /* plink or hi_wh() case */ + ibstart = au_ibstart(inode); + if (bstart != ibstart && !au_test_ro(inode->i_sb, ibstart, inode)) + wr_dir_args.force_btgt = ibstart; + err = au_wr_dir(dentry, /*src_dentry*/NULL, &wr_dir_args); + if (unlikely(err < 0)) + goto out; + a->btgt = err; + if (err != bstart) + au_fset_icpup(a->flags, DID_CPUP); + + err = 0; + a->pin_flags = AuPin_MNT_WRITE; + parent = NULL; + if (!IS_ROOT(dentry)) { + au_fset_pin(a->pin_flags, DI_LOCKED); + parent = dget_parent(dentry); + di_write_lock_parent(parent); + } + + err = au_pin(&a->pin, dentry, a->btgt, a->udba, a->pin_flags); + if (unlikely(err)) + goto out_parent; + + a->h_path.dentry = au_h_dptr(dentry, bstart); + a->h_inode = a->h_path.dentry->d_inode; + sz = -1; + if (ia && (ia->ia_valid & ATTR_SIZE)) { + mutex_lock_nested(&a->h_inode->i_mutex, AuLsc_I_CHILD); + if (ia->ia_size < i_size_read(a->h_inode)) + sz = ia->ia_size; + mutex_unlock(&a->h_inode->i_mutex); + } + + hi_wh = NULL; + if (au_ftest_icpup(a->flags, DID_CPUP) && d_unlinked(dentry)) { + hi_wh = au_hi_wh(inode, a->btgt); + if (!hi_wh) { + struct au_cp_generic cpg = { + .dentry = dentry, + .bdst = a->btgt, + .bsrc = -1, + .len = sz, + .pin = &a->pin + }; + err = au_sio_cpup_wh(&cpg, /*file*/NULL); + if (unlikely(err)) + goto out_unlock; + hi_wh = au_hi_wh(inode, a->btgt); + /* todo: revalidate hi_wh? */ + } + } + + if (parent) { + au_pin_set_parent_lflag(&a->pin, /*lflag*/0); + di_downgrade_lock(parent, AuLock_IR); + dput(parent); + parent = NULL; + } + if (!au_ftest_icpup(a->flags, DID_CPUP)) + goto out; /* success */ + + if (!d_unhashed(dentry)) { + struct au_cp_generic cpg = { + .dentry = dentry, + .bdst = a->btgt, + .bsrc = bstart, + .len = sz, + .pin = &a->pin, + .flags = AuCpup_DTIME | AuCpup_HOPEN + }; + err = au_sio_cpup_simple(&cpg); + if (!err) + a->h_path.dentry = au_h_dptr(dentry, a->btgt); + } else if (!hi_wh) + a->h_path.dentry = au_h_dptr(dentry, a->btgt); + else + a->h_path.dentry = hi_wh; /* do not dget here */ + +out_unlock: + a->h_inode = a->h_path.dentry->d_inode; + if (!err) + goto out; /* success */ + au_unpin(&a->pin); +out_parent: + if (parent) { + di_write_unlock(parent); + dput(parent); + } +out: + if (!err) + mutex_lock_nested(&a->h_inode->i_mutex, AuLsc_I_CHILD); + return err; +} + +static int aufs_setattr(struct dentry *dentry, struct iattr *ia) +{ + int err; + struct inode *inode; + struct super_block *sb; + struct file *file; + struct au_icpup_args *a; + + inode = dentry->d_inode; + IMustLock(inode); + + err = -ENOMEM; + a = kzalloc(sizeof(*a), GFP_NOFS); + if (unlikely(!a)) + goto out; + + if (ia->ia_valid & (ATTR_KILL_SUID | ATTR_KILL_SGID)) + ia->ia_valid &= ~ATTR_MODE; + + file = NULL; + sb = dentry->d_sb; + err = si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLM); + if (unlikely(err)) + goto out_kfree; + + if (ia->ia_valid & ATTR_FILE) { + /* currently ftruncate(2) only */ + AuDebugOn(!S_ISREG(inode->i_mode)); + file = ia->ia_file; + err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1); + if (unlikely(err)) + goto out_si; + ia->ia_file = au_hf_top(file); + a->udba = AuOpt_UDBA_NONE; + } else { + /* fchmod() doesn't pass ia_file */ + a->udba = au_opt_udba(sb); + di_write_lock_child(dentry); + /* no d_unlinked(), to set UDBA_NONE for root */ + if (d_unhashed(dentry)) + a->udba = AuOpt_UDBA_NONE; + if (a->udba != AuOpt_UDBA_NONE) { + AuDebugOn(IS_ROOT(dentry)); + err = au_reval_for_attr(dentry, au_sigen(sb)); + if (unlikely(err)) + goto out_dentry; + } + } + + err = au_pin_and_icpup(dentry, ia, a); + if (unlikely(err < 0)) + goto out_dentry; + if (au_ftest_icpup(a->flags, DID_CPUP)) { + ia->ia_file = NULL; + ia->ia_valid &= ~ATTR_FILE; + } + + a->h_path.mnt = au_sbr_mnt(sb, a->btgt); + if ((ia->ia_valid & (ATTR_MODE | ATTR_CTIME)) + == (ATTR_MODE | ATTR_CTIME)) { + err = security_path_chmod(&a->h_path, ia->ia_mode); + if (unlikely(err)) + goto out_unlock; + } else if ((ia->ia_valid & (ATTR_UID | ATTR_GID)) + && (ia->ia_valid & ATTR_CTIME)) { + err = security_path_chown(&a->h_path, ia->ia_uid, ia->ia_gid); + if (unlikely(err)) + goto out_unlock; + } + + if (ia->ia_valid & ATTR_SIZE) { + struct file *f; + + if (ia->ia_size < i_size_read(inode)) + /* unmap only */ + truncate_setsize(inode, ia->ia_size); + + f = NULL; + if (ia->ia_valid & ATTR_FILE) + f = ia->ia_file; + mutex_unlock(&a->h_inode->i_mutex); + err = vfsub_trunc(&a->h_path, ia->ia_size, ia->ia_valid, f); + mutex_lock_nested(&a->h_inode->i_mutex, AuLsc_I_CHILD); + } else + err = vfsub_notify_change(&a->h_path, ia); + if (!err) + au_cpup_attr_changeable(inode); + +out_unlock: + mutex_unlock(&a->h_inode->i_mutex); + au_unpin(&a->pin); + if (unlikely(err)) + au_update_dbstart(dentry); +out_dentry: + di_write_unlock(dentry); + if (file) { + fi_write_unlock(file); + ia->ia_file = file; + ia->ia_valid |= ATTR_FILE; + } +out_si: + si_read_unlock(sb); +out_kfree: + kfree(a); +out: + AuTraceErr(err); + return err; +} + +static void au_refresh_iattr(struct inode *inode, struct kstat *st, + unsigned int nlink) +{ + unsigned int n; + + inode->i_mode = st->mode; + /* don't i_[ug]id_write() here */ + inode->i_uid = st->uid; + inode->i_gid = st->gid; + inode->i_atime = st->atime; + inode->i_mtime = st->mtime; + inode->i_ctime = st->ctime; + + au_cpup_attr_nlink(inode, /*force*/0); + if (S_ISDIR(inode->i_mode)) { + n = inode->i_nlink; + n -= nlink; + n += st->nlink; + smp_mb(); /* for i_nlink */ + /* 0 can happen */ + set_nlink(inode, n); + } + + spin_lock(&inode->i_lock); + inode->i_blocks = st->blocks; + i_size_write(inode, st->size); + spin_unlock(&inode->i_lock); +} + +/* + * common routine for aufs_getattr() and aufs_getxattr(). + * returns zero or negative (an error). + * @dentry will be read-locked in success. + */ +int au_h_path_getattr(struct dentry *dentry, int force, struct path *h_path) +{ + int err; + unsigned int mnt_flags, sigen; + unsigned char udba_none; + aufs_bindex_t bindex; + struct super_block *sb, *h_sb; + struct inode *inode; + + h_path->mnt = NULL; + h_path->dentry = NULL; + + err = 0; + sb = dentry->d_sb; + mnt_flags = au_mntflags(sb); + udba_none = !!au_opt_test(mnt_flags, UDBA_NONE); + + /* support fstat(2) */ + if (!d_unlinked(dentry) && !udba_none) { + sigen = au_sigen(sb); + err = au_digen_test(dentry, sigen); + if (!err) { + di_read_lock_child(dentry, AuLock_IR); + err = au_dbrange_test(dentry); + if (unlikely(err)) { + di_read_unlock(dentry, AuLock_IR); + goto out; + } + } else { + AuDebugOn(IS_ROOT(dentry)); + di_write_lock_child(dentry); + err = au_dbrange_test(dentry); + if (!err) + err = au_reval_for_attr(dentry, sigen); + if (!err) + di_downgrade_lock(dentry, AuLock_IR); + else { + di_write_unlock(dentry); + goto out; + } + } + } else + di_read_lock_child(dentry, AuLock_IR); + + inode = dentry->d_inode; + bindex = au_ibstart(inode); + h_path->mnt = au_sbr_mnt(sb, bindex); + h_sb = h_path->mnt->mnt_sb; + if (!force + && !au_test_fs_bad_iattr(h_sb) + && udba_none) + goto out; /* success */ + + if (au_dbstart(dentry) == bindex) + h_path->dentry = au_h_dptr(dentry, bindex); + else if (au_opt_test(mnt_flags, PLINK) && au_plink_test(inode)) { + h_path->dentry = au_plink_lkup(inode, bindex); + if (IS_ERR(h_path->dentry)) + /* pretending success */ + h_path->dentry = NULL; + else + dput(h_path->dentry); + } + +out: + return err; +} + +static int aufs_getattr(struct vfsmount *mnt __maybe_unused, + struct dentry *dentry, struct kstat *st) +{ + int err; + unsigned char positive; + struct path h_path; + struct inode *inode; + struct super_block *sb; + + inode = dentry->d_inode; + sb = dentry->d_sb; + err = si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLM); + if (unlikely(err)) + goto out; + err = au_h_path_getattr(dentry, /*force*/0, &h_path); + if (unlikely(err)) + goto out_si; + if (unlikely(!h_path.dentry)) + /* illegally overlapped or something */ + goto out_fill; /* pretending success */ + + positive = !!h_path.dentry->d_inode; + if (positive) + err = vfs_getattr(&h_path, st); + if (!err) { + if (positive) + au_refresh_iattr(inode, st, + h_path.dentry->d_inode->i_nlink); + goto out_fill; /* success */ + } + AuTraceErr(err); + goto out_di; + +out_fill: + generic_fillattr(inode, st); +out_di: + di_read_unlock(dentry, AuLock_IR); +out_si: + si_read_unlock(sb); +out: + AuTraceErr(err); + return err; +} + +/* ---------------------------------------------------------------------- */ + +static int h_readlink(struct dentry *dentry, int bindex, char __user *buf, + int bufsiz) +{ + int err; + struct super_block *sb; + struct dentry *h_dentry; + + err = -EINVAL; + h_dentry = au_h_dptr(dentry, bindex); + if (unlikely(!h_dentry->d_inode->i_op->readlink)) + goto out; + + err = security_inode_readlink(h_dentry); + if (unlikely(err)) + goto out; + + sb = dentry->d_sb; + if (!au_test_ro(sb, bindex, dentry->d_inode)) { + vfsub_touch_atime(au_sbr_mnt(sb, bindex), h_dentry); + fsstack_copy_attr_atime(dentry->d_inode, h_dentry->d_inode); + } + err = h_dentry->d_inode->i_op->readlink(h_dentry, buf, bufsiz); + +out: + return err; +} + +static int aufs_readlink(struct dentry *dentry, char __user *buf, int bufsiz) +{ + int err; + + err = aufs_read_lock(dentry, AuLock_IR | AuLock_GEN); + if (unlikely(err)) + goto out; + err = au_d_hashed_positive(dentry); + if (!err) + err = h_readlink(dentry, au_dbstart(dentry), buf, bufsiz); + aufs_read_unlock(dentry, AuLock_IR); + +out: + return err; +} + +static void *aufs_follow_link(struct dentry *dentry, struct nameidata *nd) +{ + int err; + mm_segment_t old_fs; + union { + char *k; + char __user *u; + } buf; + + err = -ENOMEM; + buf.k = (void *)__get_free_page(GFP_NOFS); + if (unlikely(!buf.k)) + goto out; + + err = aufs_read_lock(dentry, AuLock_IR | AuLock_GEN); + if (unlikely(err)) + goto out_name; + + err = au_d_hashed_positive(dentry); + if (!err) { + old_fs = get_fs(); + set_fs(KERNEL_DS); + err = h_readlink(dentry, au_dbstart(dentry), buf.u, PATH_MAX); + set_fs(old_fs); + } + aufs_read_unlock(dentry, AuLock_IR); + + if (err >= 0) { + buf.k[err] = 0; + /* will be freed by put_link */ + nd_set_link(nd, buf.k); + return NULL; /* success */ + } + +out_name: + free_page((unsigned long)buf.k); +out: + AuTraceErr(err); + return ERR_PTR(err); +} + +static void aufs_put_link(struct dentry *dentry __maybe_unused, + struct nameidata *nd, void *cookie __maybe_unused) +{ + char *p; + + p = nd_get_link(nd); + if (!IS_ERR_OR_NULL(p)) + free_page((unsigned long)p); +} + +/* ---------------------------------------------------------------------- */ + +static int aufs_update_time(struct inode *inode, struct timespec *ts, int flags) +{ + int err; + struct super_block *sb; + struct inode *h_inode; + + sb = inode->i_sb; + /* mmap_sem might be acquired already, cf. aufs_mmap() */ + lockdep_off(); + si_read_lock(sb, AuLock_FLUSH); + ii_write_lock_child(inode); + lockdep_on(); + h_inode = au_h_iptr(inode, au_ibstart(inode)); + err = vfsub_update_time(h_inode, ts, flags); + lockdep_off(); + if (!err) + au_cpup_attr_timesizes(inode); + ii_write_unlock(inode); + si_read_unlock(sb); + lockdep_on(); + + if (!err && (flags & S_VERSION)) + inode_inc_iversion(inode); + + return err; +} + +/* ---------------------------------------------------------------------- */ + +struct inode_operations aufs_symlink_iop = { + .permission = aufs_permission, +#ifdef CONFIG_FS_POSIX_ACL + .get_acl = aufs_get_acl, +#endif + + .setattr = aufs_setattr, + .getattr = aufs_getattr, + +#ifdef CONFIG_AUFS_XATTR + .setxattr = aufs_setxattr, + .getxattr = aufs_getxattr, + .listxattr = aufs_listxattr, + .removexattr = aufs_removexattr, +#endif + + .readlink = aufs_readlink, + .follow_link = aufs_follow_link, + .put_link = aufs_put_link, + + /* .update_time = aufs_update_time */ +}; + +struct inode_operations aufs_dir_iop = { + .create = aufs_create, + .lookup = aufs_lookup, + .link = aufs_link, + .unlink = aufs_unlink, + .symlink = aufs_symlink, + .mkdir = aufs_mkdir, + .rmdir = aufs_rmdir, + .mknod = aufs_mknod, + .rename = aufs_rename, + + .permission = aufs_permission, +#ifdef CONFIG_FS_POSIX_ACL + .get_acl = aufs_get_acl, +#endif + + .setattr = aufs_setattr, + .getattr = aufs_getattr, + +#ifdef CONFIG_AUFS_XATTR + .setxattr = aufs_setxattr, + .getxattr = aufs_getxattr, + .listxattr = aufs_listxattr, + .removexattr = aufs_removexattr, +#endif + + .update_time = aufs_update_time + /* no support for atomic_open() */ +}; + +struct inode_operations aufs_iop = { + .permission = aufs_permission, +#ifdef CONFIG_FS_POSIX_ACL + .get_acl = aufs_get_acl, +#endif + + .setattr = aufs_setattr, + .getattr = aufs_getattr, + +#ifdef CONFIG_AUFS_XATTR + .setxattr = aufs_setxattr, + .getxattr = aufs_getxattr, + .listxattr = aufs_listxattr, + .removexattr = aufs_removexattr, +#endif + + .update_time = aufs_update_time +}; diff --git a/fs/aufs/i_op_add.c b/fs/aufs/i_op_add.c new file mode 100644 index 00000000000000..dee3b9606eeae3 --- /dev/null +++ b/fs/aufs/i_op_add.c @@ -0,0 +1,750 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * inode operations (add entry) + */ + +#include "aufs.h" + +/* + * final procedure of adding a new entry, except link(2). + * remove whiteout, instantiate, copyup the parent dir's times and size + * and update version. + * if it failed, re-create the removed whiteout. + */ +static int epilog(struct inode *dir, aufs_bindex_t bindex, + struct dentry *wh_dentry, struct dentry *dentry) +{ + int err, rerr; + aufs_bindex_t bwh; + struct path h_path; + struct super_block *sb; + struct inode *inode, *h_dir; + struct dentry *wh; + + bwh = -1; + sb = dir->i_sb; + if (wh_dentry) { + h_dir = wh_dentry->d_parent->d_inode; /* dir inode is locked */ + IMustLock(h_dir); + AuDebugOn(au_h_iptr(dir, bindex) != h_dir); + bwh = au_dbwh(dentry); + h_path.dentry = wh_dentry; + h_path.mnt = au_sbr_mnt(sb, bindex); + err = au_wh_unlink_dentry(au_h_iptr(dir, bindex), &h_path, + dentry); + if (unlikely(err)) + goto out; + } + + inode = au_new_inode(dentry, /*must_new*/1); + if (!IS_ERR(inode)) { + d_instantiate(dentry, inode); + dir = dentry->d_parent->d_inode; /* dir inode is locked */ + IMustLock(dir); + if (au_ibstart(dir) == au_dbstart(dentry)) + au_cpup_attr_timesizes(dir); + dir->i_version++; + au_fhsm_wrote(sb, bindex, /*force*/0); + return 0; /* success */ + } + + err = PTR_ERR(inode); + if (!wh_dentry) + goto out; + + /* revert */ + /* dir inode is locked */ + wh = au_wh_create(dentry, bwh, wh_dentry->d_parent); + rerr = PTR_ERR(wh); + if (IS_ERR(wh)) { + AuIOErr("%.*s reverting whiteout failed(%d, %d)\n", + AuDLNPair(dentry), err, rerr); + err = -EIO; + } else + dput(wh); + +out: + return err; +} + +static int au_d_may_add(struct dentry *dentry) +{ + int err; + + err = 0; + if (unlikely(d_unhashed(dentry))) + err = -ENOENT; + if (unlikely(dentry->d_inode)) + err = -EEXIST; + return err; +} + +/* + * simple tests for the adding inode operations. + * following the checks in vfs, plus the parent-child relationship. + */ +int au_may_add(struct dentry *dentry, aufs_bindex_t bindex, + struct dentry *h_parent, int isdir) +{ + int err; + umode_t h_mode; + struct dentry *h_dentry; + struct inode *h_inode; + + err = -ENAMETOOLONG; + if (unlikely(dentry->d_name.len > AUFS_MAX_NAMELEN)) + goto out; + + h_dentry = au_h_dptr(dentry, bindex); + h_inode = h_dentry->d_inode; + if (!dentry->d_inode) { + err = -EEXIST; + if (unlikely(h_inode)) + goto out; + } else { + /* rename(2) case */ + err = -EIO; + if (unlikely(!h_inode || !h_inode->i_nlink)) + goto out; + + h_mode = h_inode->i_mode; + if (!isdir) { + err = -EISDIR; + if (unlikely(S_ISDIR(h_mode))) + goto out; + } else if (unlikely(!S_ISDIR(h_mode))) { + err = -ENOTDIR; + goto out; + } + } + + err = 0; + /* expected parent dir is locked */ + if (unlikely(h_parent != h_dentry->d_parent)) + err = -EIO; + +out: + AuTraceErr(err); + return err; +} + +/* + * initial procedure of adding a new entry. + * prepare writable branch and the parent dir, lock it, + * and lookup whiteout for the new entry. + */ +static struct dentry* +lock_hdir_lkup_wh(struct dentry *dentry, struct au_dtime *dt, + struct dentry *src_dentry, struct au_pin *pin, + struct au_wr_dir_args *wr_dir_args) +{ + struct dentry *wh_dentry, *h_parent; + struct super_block *sb; + struct au_branch *br; + int err; + unsigned int udba; + aufs_bindex_t bcpup; + + AuDbg("%.*s\n", AuDLNPair(dentry)); + + err = au_wr_dir(dentry, src_dentry, wr_dir_args); + bcpup = err; + wh_dentry = ERR_PTR(err); + if (unlikely(err < 0)) + goto out; + + sb = dentry->d_sb; + udba = au_opt_udba(sb); + err = au_pin(pin, dentry, bcpup, udba, + AuPin_DI_LOCKED | AuPin_MNT_WRITE); + wh_dentry = ERR_PTR(err); + if (unlikely(err)) + goto out; + + h_parent = au_pinned_h_parent(pin); + if (udba != AuOpt_UDBA_NONE + && au_dbstart(dentry) == bcpup) + err = au_may_add(dentry, bcpup, h_parent, + au_ftest_wrdir(wr_dir_args->flags, ISDIR)); + else if (unlikely(dentry->d_name.len > AUFS_MAX_NAMELEN)) + err = -ENAMETOOLONG; + wh_dentry = ERR_PTR(err); + if (unlikely(err)) + goto out_unpin; + + br = au_sbr(sb, bcpup); + if (dt) { + struct path tmp = { + .dentry = h_parent, + .mnt = au_br_mnt(br) + }; + au_dtime_store(dt, au_pinned_parent(pin), &tmp); + } + + wh_dentry = NULL; + if (bcpup != au_dbwh(dentry)) + goto out; /* success */ + + wh_dentry = au_wh_lkup(h_parent, &dentry->d_name, br); + +out_unpin: + if (IS_ERR(wh_dentry)) + au_unpin(pin); +out: + return wh_dentry; +} + +/* ---------------------------------------------------------------------- */ + +enum { Mknod, Symlink, Creat }; +struct simple_arg { + int type; + union { + struct { + umode_t mode; + bool want_excl; + } c; + struct { + const char *symname; + } s; + struct { + umode_t mode; + dev_t dev; + } m; + } u; +}; + +static int add_simple(struct inode *dir, struct dentry *dentry, + struct simple_arg *arg) +{ + int err, rerr; + aufs_bindex_t bstart; + unsigned char created; + struct dentry *wh_dentry, *parent; + struct inode *h_dir; + /* to reuduce stack size */ + struct { + struct au_dtime dt; + struct au_pin pin; + struct path h_path; + struct au_wr_dir_args wr_dir_args; + } *a; + + AuDbg("%.*s\n", AuDLNPair(dentry)); + IMustLock(dir); + + err = -ENOMEM; + a = kmalloc(sizeof(*a), GFP_NOFS); + if (unlikely(!a)) + goto out; + a->wr_dir_args.force_btgt = -1; + a->wr_dir_args.flags = AuWrDir_ADD_ENTRY; + + parent = dentry->d_parent; /* dir inode is locked */ + err = aufs_read_lock(dentry, AuLock_DW | AuLock_GEN); + if (unlikely(err)) + goto out_free; + err = au_d_may_add(dentry); + if (unlikely(err)) + goto out_unlock; + di_write_lock_parent(parent); + wh_dentry = lock_hdir_lkup_wh(dentry, &a->dt, /*src_dentry*/NULL, + &a->pin, &a->wr_dir_args); + err = PTR_ERR(wh_dentry); + if (IS_ERR(wh_dentry)) + goto out_parent; + + bstart = au_dbstart(dentry); + a->h_path.dentry = au_h_dptr(dentry, bstart); + a->h_path.mnt = au_sbr_mnt(dentry->d_sb, bstart); + h_dir = au_pinned_h_dir(&a->pin); + switch (arg->type) { + case Creat: + err = vfsub_create(h_dir, &a->h_path, arg->u.c.mode, + arg->u.c.want_excl); + break; + case Symlink: + err = vfsub_symlink(h_dir, &a->h_path, arg->u.s.symname); + break; + case Mknod: + err = vfsub_mknod(h_dir, &a->h_path, arg->u.m.mode, + arg->u.m.dev); + break; + default: + BUG(); + } + created = !err; + if (!err) + err = epilog(dir, bstart, wh_dentry, dentry); + + /* revert */ + if (unlikely(created && err && a->h_path.dentry->d_inode)) { + rerr = vfsub_unlink(h_dir, &a->h_path, /*force*/0); + if (rerr) { + AuIOErr("%.*s revert failure(%d, %d)\n", + AuDLNPair(dentry), err, rerr); + err = -EIO; + } + au_dtime_revert(&a->dt); + } + + au_unpin(&a->pin); + dput(wh_dentry); + +out_parent: + di_write_unlock(parent); +out_unlock: + if (unlikely(err)) { + au_update_dbstart(dentry); + d_drop(dentry); + } + aufs_read_unlock(dentry, AuLock_DW); +out_free: + kfree(a); +out: + return err; +} + +int aufs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, + dev_t dev) +{ + struct simple_arg arg = { + .type = Mknod, + .u.m = { + .mode = mode, + .dev = dev + } + }; + return add_simple(dir, dentry, &arg); +} + +int aufs_symlink(struct inode *dir, struct dentry *dentry, const char *symname) +{ + struct simple_arg arg = { + .type = Symlink, + .u.s.symname = symname + }; + return add_simple(dir, dentry, &arg); +} + +int aufs_create(struct inode *dir, struct dentry *dentry, umode_t mode, + bool want_excl) +{ + struct simple_arg arg = { + .type = Creat, + .u.c = { + .mode = mode, + .want_excl = want_excl + } + }; + return add_simple(dir, dentry, &arg); +} + +/* ---------------------------------------------------------------------- */ + +struct au_link_args { + aufs_bindex_t bdst, bsrc; + struct au_pin pin; + struct path h_path; + struct dentry *src_parent, *parent; +}; + +static int au_cpup_before_link(struct dentry *src_dentry, + struct au_link_args *a) +{ + int err; + struct dentry *h_src_dentry; + struct au_cp_generic cpg = { + .dentry = src_dentry, + .bdst = a->bdst, + .bsrc = a->bsrc, + .len = -1, + .pin = &a->pin, + .flags = AuCpup_DTIME | AuCpup_HOPEN /* | AuCpup_KEEPLINO */ + }; + + di_read_lock_parent(a->src_parent, AuLock_IR); + err = au_test_and_cpup_dirs(src_dentry, a->bdst); + if (unlikely(err)) + goto out; + + h_src_dentry = au_h_dptr(src_dentry, a->bsrc); + err = au_pin(&a->pin, src_dentry, a->bdst, + au_opt_udba(src_dentry->d_sb), + AuPin_DI_LOCKED | AuPin_MNT_WRITE); + if (unlikely(err)) + goto out; + + err = au_sio_cpup_simple(&cpg); + au_unpin(&a->pin); + +out: + di_read_unlock(a->src_parent, AuLock_IR); + return err; +} + +static int au_cpup_or_link(struct dentry *src_dentry, struct dentry *dentry, + struct au_link_args *a) +{ + int err; + unsigned char plink; + aufs_bindex_t bend; + struct dentry *h_src_dentry; + struct inode *h_inode, *inode; + struct super_block *sb; + struct file *h_file; + + plink = 0; + h_inode = NULL; + sb = src_dentry->d_sb; + inode = src_dentry->d_inode; + if (au_ibstart(inode) <= a->bdst) + h_inode = au_h_iptr(inode, a->bdst); + if (!h_inode || !h_inode->i_nlink) { + /* copyup src_dentry as the name of dentry. */ + bend = au_dbend(dentry); + if (bend < a->bsrc) + au_set_dbend(dentry, a->bsrc); + au_set_h_dptr(dentry, a->bsrc, + dget(au_h_dptr(src_dentry, a->bsrc))); + dget(a->h_path.dentry); + au_set_h_dptr(dentry, a->bdst, NULL); + AuDbg("temporary d_inode...\n"); + spin_lock(&dentry->d_lock); + dentry->d_inode = src_dentry->d_inode; /* tmp */ + spin_unlock(&dentry->d_lock); + h_file = au_h_open_pre(dentry, a->bsrc, /*force_wr*/0); + if (IS_ERR(h_file)) + err = PTR_ERR(h_file); + else { + struct au_cp_generic cpg = { + .dentry = dentry, + .bdst = a->bdst, + .bsrc = -1, + .len = -1, + .pin = &a->pin, + .flags = AuCpup_KEEPLINO + }; + err = au_sio_cpup_simple(&cpg); + au_h_open_post(dentry, a->bsrc, h_file); + if (!err) { + dput(a->h_path.dentry); + a->h_path.dentry = au_h_dptr(dentry, a->bdst); + } else + au_set_h_dptr(dentry, a->bdst, + a->h_path.dentry); + } + spin_lock(&dentry->d_lock); + dentry->d_inode = NULL; /* restore */ + spin_unlock(&dentry->d_lock); + AuDbg("temporary d_inode...done\n"); + au_set_h_dptr(dentry, a->bsrc, NULL); + au_set_dbend(dentry, bend); + } else { + /* the inode of src_dentry already exists on a.bdst branch */ + h_src_dentry = d_find_alias(h_inode); + if (!h_src_dentry && au_plink_test(inode)) { + plink = 1; + h_src_dentry = au_plink_lkup(inode, a->bdst); + err = PTR_ERR(h_src_dentry); + if (IS_ERR(h_src_dentry)) + goto out; + + if (unlikely(!h_src_dentry->d_inode)) { + dput(h_src_dentry); + h_src_dentry = NULL; + } + + } + if (h_src_dentry) { + err = vfsub_link(h_src_dentry, au_pinned_h_dir(&a->pin), + &a->h_path); + dput(h_src_dentry); + } else { + AuIOErr("no dentry found for hi%lu on b%d\n", + h_inode->i_ino, a->bdst); + err = -EIO; + } + } + + if (!err && !plink) + au_plink_append(inode, a->bdst, a->h_path.dentry); + +out: + AuTraceErr(err); + return err; +} + +int aufs_link(struct dentry *src_dentry, struct inode *dir, + struct dentry *dentry) +{ + int err, rerr; + struct au_dtime dt; + struct au_link_args *a; + struct dentry *wh_dentry, *h_src_dentry; + struct inode *inode; + struct super_block *sb; + struct au_wr_dir_args wr_dir_args = { + /* .force_btgt = -1, */ + .flags = AuWrDir_ADD_ENTRY + }; + + IMustLock(dir); + inode = src_dentry->d_inode; + IMustLock(inode); + + err = -ENOMEM; + a = kzalloc(sizeof(*a), GFP_NOFS); + if (unlikely(!a)) + goto out; + + a->parent = dentry->d_parent; /* dir inode is locked */ + err = aufs_read_and_write_lock2(dentry, src_dentry, + AuLock_NOPLM | AuLock_GEN); + if (unlikely(err)) + goto out_kfree; + err = au_d_hashed_positive(src_dentry); + if (unlikely(err)) + goto out_unlock; + err = au_d_may_add(dentry); + if (unlikely(err)) + goto out_unlock; + + a->src_parent = dget_parent(src_dentry); + wr_dir_args.force_btgt = au_ibstart(inode); + + di_write_lock_parent(a->parent); + wr_dir_args.force_btgt = au_wbr(dentry, wr_dir_args.force_btgt); + wh_dentry = lock_hdir_lkup_wh(dentry, &dt, src_dentry, &a->pin, + &wr_dir_args); + err = PTR_ERR(wh_dentry); + if (IS_ERR(wh_dentry)) + goto out_parent; + + err = 0; + sb = dentry->d_sb; + a->bdst = au_dbstart(dentry); + a->h_path.dentry = au_h_dptr(dentry, a->bdst); + a->h_path.mnt = au_sbr_mnt(sb, a->bdst); + a->bsrc = au_ibstart(inode); + h_src_dentry = au_h_d_alias(src_dentry, a->bsrc); + if (!h_src_dentry) { + a->bsrc = au_dbstart(src_dentry); + h_src_dentry = au_h_d_alias(src_dentry, a->bsrc); + AuDebugOn(!h_src_dentry); + } else if (IS_ERR(h_src_dentry)) { + err = PTR_ERR(h_src_dentry); + goto out_parent; + } + + if (au_opt_test(au_mntflags(sb), PLINK)) { + if (a->bdst < a->bsrc + /* && h_src_dentry->d_sb != a->h_path.dentry->d_sb */) + err = au_cpup_or_link(src_dentry, dentry, a); + else + err = vfsub_link(h_src_dentry, au_pinned_h_dir(&a->pin), + &a->h_path); + dput(h_src_dentry); + } else { + /* + * copyup src_dentry to the branch we process, + * and then link(2) to it. + */ + dput(h_src_dentry); + if (a->bdst < a->bsrc + /* && h_src_dentry->d_sb != a->h_path.dentry->d_sb */) { + au_unpin(&a->pin); + di_write_unlock(a->parent); + err = au_cpup_before_link(src_dentry, a); + di_write_lock_parent(a->parent); + if (!err) + err = au_pin(&a->pin, dentry, a->bdst, + au_opt_udba(sb), + AuPin_DI_LOCKED | AuPin_MNT_WRITE); + if (unlikely(err)) + goto out_wh; + } + if (!err) { + h_src_dentry = au_h_dptr(src_dentry, a->bdst); + err = -ENOENT; + if (h_src_dentry && h_src_dentry->d_inode) + err = vfsub_link(h_src_dentry, + au_pinned_h_dir(&a->pin), + &a->h_path); + } + } + if (unlikely(err)) + goto out_unpin; + + if (wh_dentry) { + a->h_path.dentry = wh_dentry; + err = au_wh_unlink_dentry(au_pinned_h_dir(&a->pin), &a->h_path, + dentry); + if (unlikely(err)) + goto out_revert; + } + + dir->i_version++; + if (au_ibstart(dir) == au_dbstart(dentry)) + au_cpup_attr_timesizes(dir); + inc_nlink(inode); + inode->i_ctime = dir->i_ctime; + d_instantiate(dentry, au_igrab(inode)); + if (d_unhashed(a->h_path.dentry)) + /* some filesystem calls d_drop() */ + d_drop(dentry); + /* some filesystems consume an inode even hardlink */ + au_fhsm_wrote(sb, a->bdst, /*force*/0); + goto out_unpin; /* success */ + +out_revert: + rerr = vfsub_unlink(au_pinned_h_dir(&a->pin), &a->h_path, /*force*/0); + if (unlikely(rerr)) { + AuIOErr("%.*s reverting failed(%d, %d)\n", + AuDLNPair(dentry), err, rerr); + err = -EIO; + } + au_dtime_revert(&dt); +out_unpin: + au_unpin(&a->pin); +out_wh: + dput(wh_dentry); +out_parent: + di_write_unlock(a->parent); + dput(a->src_parent); +out_unlock: + if (unlikely(err)) { + au_update_dbstart(dentry); + d_drop(dentry); + } + aufs_read_and_write_unlock2(dentry, src_dentry); +out_kfree: + kfree(a); +out: + AuTraceErr(err); + return err; +} + +int aufs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) +{ + int err, rerr; + aufs_bindex_t bindex; + unsigned char diropq; + struct path h_path; + struct dentry *wh_dentry, *parent, *opq_dentry; + struct mutex *h_mtx; + struct super_block *sb; + struct { + struct au_pin pin; + struct au_dtime dt; + } *a; /* reduce the stack usage */ + struct au_wr_dir_args wr_dir_args = { + .force_btgt = -1, + .flags = AuWrDir_ADD_ENTRY | AuWrDir_ISDIR + }; + + IMustLock(dir); + + err = -ENOMEM; + a = kmalloc(sizeof(*a), GFP_NOFS); + if (unlikely(!a)) + goto out; + + err = aufs_read_lock(dentry, AuLock_DW | AuLock_GEN); + if (unlikely(err)) + goto out_free; + err = au_d_may_add(dentry); + if (unlikely(err)) + goto out_unlock; + + parent = dentry->d_parent; /* dir inode is locked */ + di_write_lock_parent(parent); + wh_dentry = lock_hdir_lkup_wh(dentry, &a->dt, /*src_dentry*/NULL, + &a->pin, &wr_dir_args); + err = PTR_ERR(wh_dentry); + if (IS_ERR(wh_dentry)) + goto out_parent; + + sb = dentry->d_sb; + bindex = au_dbstart(dentry); + h_path.dentry = au_h_dptr(dentry, bindex); + h_path.mnt = au_sbr_mnt(sb, bindex); + err = vfsub_mkdir(au_pinned_h_dir(&a->pin), &h_path, mode); + if (unlikely(err)) + goto out_unpin; + + /* make the dir opaque */ + diropq = 0; + h_mtx = &h_path.dentry->d_inode->i_mutex; + if (wh_dentry + || au_opt_test(au_mntflags(sb), ALWAYS_DIROPQ)) { + mutex_lock_nested(h_mtx, AuLsc_I_CHILD); + opq_dentry = au_diropq_create(dentry, bindex); + mutex_unlock(h_mtx); + err = PTR_ERR(opq_dentry); + if (IS_ERR(opq_dentry)) + goto out_dir; + dput(opq_dentry); + diropq = 1; + } + + err = epilog(dir, bindex, wh_dentry, dentry); + if (!err) { + inc_nlink(dir); + goto out_unpin; /* success */ + } + + /* revert */ + if (diropq) { + AuLabel(revert opq); + mutex_lock_nested(h_mtx, AuLsc_I_CHILD); + rerr = au_diropq_remove(dentry, bindex); + mutex_unlock(h_mtx); + if (rerr) { + AuIOErr("%.*s reverting diropq failed(%d, %d)\n", + AuDLNPair(dentry), err, rerr); + err = -EIO; + } + } + +out_dir: + AuLabel(revert dir); + rerr = vfsub_rmdir(au_pinned_h_dir(&a->pin), &h_path); + if (rerr) { + AuIOErr("%.*s reverting dir failed(%d, %d)\n", + AuDLNPair(dentry), err, rerr); + err = -EIO; + } + au_dtime_revert(&a->dt); +out_unpin: + au_unpin(&a->pin); + dput(wh_dentry); +out_parent: + di_write_unlock(parent); +out_unlock: + if (unlikely(err)) { + au_update_dbstart(dentry); + d_drop(dentry); + } + aufs_read_unlock(dentry, AuLock_DW); +out_free: + kfree(a); +out: + return err; +} diff --git a/fs/aufs/i_op_del.c b/fs/aufs/i_op_del.c new file mode 100644 index 00000000000000..7385d0e3c1f242 --- /dev/null +++ b/fs/aufs/i_op_del.c @@ -0,0 +1,502 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * inode operations (del entry) + */ + +#include "aufs.h" + +/* + * decide if a new whiteout for @dentry is necessary or not. + * when it is necessary, prepare the parent dir for the upper branch whose + * branch index is @bcpup for creation. the actual creation of the whiteout will + * be done by caller. + * return value: + * 0: wh is unnecessary + * plus: wh is necessary + * minus: error + */ +int au_wr_dir_need_wh(struct dentry *dentry, int isdir, aufs_bindex_t *bcpup) +{ + int need_wh, err; + aufs_bindex_t bstart; + struct super_block *sb; + + sb = dentry->d_sb; + bstart = au_dbstart(dentry); + if (*bcpup < 0) { + *bcpup = bstart; + if (au_test_ro(sb, bstart, dentry->d_inode)) { + err = AuWbrCopyup(au_sbi(sb), dentry); + *bcpup = err; + if (unlikely(err < 0)) + goto out; + } + } else + AuDebugOn(bstart < *bcpup + || au_test_ro(sb, *bcpup, dentry->d_inode)); + AuDbg("bcpup %d, bstart %d\n", *bcpup, bstart); + + if (*bcpup != bstart) { + err = au_cpup_dirs(dentry, *bcpup); + if (unlikely(err)) + goto out; + need_wh = 1; + } else { + struct au_dinfo *dinfo, *tmp; + + need_wh = -ENOMEM; + dinfo = au_di(dentry); + tmp = au_di_alloc(sb, AuLsc_DI_TMP); + if (tmp) { + au_di_cp(tmp, dinfo); + au_di_swap(tmp, dinfo); + /* returns the number of positive dentries */ + need_wh = au_lkup_dentry(dentry, bstart + 1, /*type*/0); + au_di_swap(tmp, dinfo); + au_rw_write_unlock(&tmp->di_rwsem); + au_di_free(tmp); + } + } + AuDbg("need_wh %d\n", need_wh); + err = need_wh; + +out: + return err; +} + +/* + * simple tests for the del-entry operations. + * following the checks in vfs, plus the parent-child relationship. + */ +int au_may_del(struct dentry *dentry, aufs_bindex_t bindex, + struct dentry *h_parent, int isdir) +{ + int err; + umode_t h_mode; + struct dentry *h_dentry, *h_latest; + struct inode *h_inode; + + h_dentry = au_h_dptr(dentry, bindex); + h_inode = h_dentry->d_inode; + if (dentry->d_inode) { + err = -ENOENT; + if (unlikely(!h_inode || !h_inode->i_nlink)) + goto out; + + h_mode = h_inode->i_mode; + if (!isdir) { + err = -EISDIR; + if (unlikely(S_ISDIR(h_mode))) + goto out; + } else if (unlikely(!S_ISDIR(h_mode))) { + err = -ENOTDIR; + goto out; + } + } else { + /* rename(2) case */ + err = -EIO; + if (unlikely(h_inode)) + goto out; + } + + err = -ENOENT; + /* expected parent dir is locked */ + if (unlikely(h_parent != h_dentry->d_parent)) + goto out; + err = 0; + + /* + * rmdir a dir may break the consistency on some filesystem. + * let's try heavy test. + */ + err = -EACCES; + if (unlikely(!au_opt_test(au_mntflags(dentry->d_sb), DIRPERM1) + && au_test_h_perm(h_parent->d_inode, + MAY_EXEC | MAY_WRITE))) + goto out; + + h_latest = au_sio_lkup_one(&dentry->d_name, h_parent); + err = -EIO; + if (IS_ERR(h_latest)) + goto out; + if (h_latest == h_dentry) + err = 0; + dput(h_latest); + +out: + return err; +} + +/* + * decide the branch where we operate for @dentry. the branch index will be set + * @rbcpup. after diciding it, 'pin' it and store the timestamps of the parent + * dir for reverting. + * when a new whiteout is necessary, create it. + */ +static struct dentry* +lock_hdir_create_wh(struct dentry *dentry, int isdir, aufs_bindex_t *rbcpup, + struct au_dtime *dt, struct au_pin *pin) +{ + struct dentry *wh_dentry; + struct super_block *sb; + struct path h_path; + int err, need_wh; + unsigned int udba; + aufs_bindex_t bcpup; + + need_wh = au_wr_dir_need_wh(dentry, isdir, rbcpup); + wh_dentry = ERR_PTR(need_wh); + if (unlikely(need_wh < 0)) + goto out; + + sb = dentry->d_sb; + udba = au_opt_udba(sb); + bcpup = *rbcpup; + err = au_pin(pin, dentry, bcpup, udba, + AuPin_DI_LOCKED | AuPin_MNT_WRITE); + wh_dentry = ERR_PTR(err); + if (unlikely(err)) + goto out; + + h_path.dentry = au_pinned_h_parent(pin); + if (udba != AuOpt_UDBA_NONE + && au_dbstart(dentry) == bcpup) { + err = au_may_del(dentry, bcpup, h_path.dentry, isdir); + wh_dentry = ERR_PTR(err); + if (unlikely(err)) + goto out_unpin; + } + + h_path.mnt = au_sbr_mnt(sb, bcpup); + au_dtime_store(dt, au_pinned_parent(pin), &h_path); + wh_dentry = NULL; + if (!need_wh) + goto out; /* success, no need to create whiteout */ + + wh_dentry = au_wh_create(dentry, bcpup, h_path.dentry); + if (IS_ERR(wh_dentry)) + goto out_unpin; + + /* returns with the parent is locked and wh_dentry is dget-ed */ + goto out; /* success */ + +out_unpin: + au_unpin(pin); +out: + return wh_dentry; +} + +/* + * when removing a dir, rename it to a unique temporary whiteout-ed name first + * in order to be revertible and save time for removing many child whiteouts + * under the dir. + * returns 1 when there are too many child whiteout and caller should remove + * them asynchronously. returns 0 when the number of children is enough small to + * remove now or the branch fs is a remote fs. + * otherwise return an error. + */ +static int renwh_and_rmdir(struct dentry *dentry, aufs_bindex_t bindex, + struct au_nhash *whlist, struct inode *dir) +{ + int rmdir_later, err, dirwh; + struct dentry *h_dentry; + struct super_block *sb; + + sb = dentry->d_sb; + SiMustAnyLock(sb); + h_dentry = au_h_dptr(dentry, bindex); + err = au_whtmp_ren(h_dentry, au_sbr(sb, bindex)); + if (unlikely(err)) + goto out; + + /* stop monitoring */ + au_hn_free(au_hi(dentry->d_inode, bindex)); + + if (!au_test_fs_remote(h_dentry->d_sb)) { + dirwh = au_sbi(sb)->si_dirwh; + rmdir_later = (dirwh <= 1); + if (!rmdir_later) + rmdir_later = au_nhash_test_longer_wh(whlist, bindex, + dirwh); + if (rmdir_later) + return rmdir_later; + } + + err = au_whtmp_rmdir(dir, bindex, h_dentry, whlist); + if (unlikely(err)) { + AuIOErr("rmdir %.*s, b%d failed, %d. ignored\n", + AuDLNPair(h_dentry), bindex, err); + err = 0; + } + +out: + AuTraceErr(err); + return err; +} + +/* + * final procedure for deleting a entry. + * maintain dentry and iattr. + */ +static void epilog(struct inode *dir, struct dentry *dentry, + aufs_bindex_t bindex) +{ + struct inode *inode; + + inode = dentry->d_inode; + d_drop(dentry); + inode->i_ctime = dir->i_ctime; + + if (au_ibstart(dir) == bindex) + au_cpup_attr_timesizes(dir); + dir->i_version++; +} + +/* + * when an error happened, remove the created whiteout and revert everything. + */ +static int do_revert(int err, struct inode *dir, aufs_bindex_t bindex, + aufs_bindex_t bwh, struct dentry *wh_dentry, + struct dentry *dentry, struct au_dtime *dt) +{ + int rerr; + struct path h_path = { + .dentry = wh_dentry, + .mnt = au_sbr_mnt(dir->i_sb, bindex) + }; + + rerr = au_wh_unlink_dentry(au_h_iptr(dir, bindex), &h_path, dentry); + if (!rerr) { + au_set_dbwh(dentry, bwh); + au_dtime_revert(dt); + return 0; + } + + AuIOErr("%.*s reverting whiteout failed(%d, %d)\n", + AuDLNPair(dentry), err, rerr); + return -EIO; +} + +/* ---------------------------------------------------------------------- */ + +int aufs_unlink(struct inode *dir, struct dentry *dentry) +{ + int err; + aufs_bindex_t bwh, bindex, bstart; + struct inode *inode, *h_dir; + struct dentry *parent, *wh_dentry; + /* to reuduce stack size */ + struct { + struct au_dtime dt; + struct au_pin pin; + struct path h_path; + } *a; + + IMustLock(dir); + + err = -ENOMEM; + a = kmalloc(sizeof(*a), GFP_NOFS); + if (unlikely(!a)) + goto out; + + err = aufs_read_lock(dentry, AuLock_DW | AuLock_GEN); + if (unlikely(err)) + goto out_free; + err = au_d_hashed_positive(dentry); + if (unlikely(err)) + goto out_unlock; + inode = dentry->d_inode; + IMustLock(inode); + err = -EISDIR; + if (unlikely(S_ISDIR(inode->i_mode))) + goto out_unlock; /* possible? */ + + bstart = au_dbstart(dentry); + bwh = au_dbwh(dentry); + bindex = -1; + parent = dentry->d_parent; /* dir inode is locked */ + di_write_lock_parent(parent); + wh_dentry = lock_hdir_create_wh(dentry, /*isdir*/0, &bindex, &a->dt, + &a->pin); + err = PTR_ERR(wh_dentry); + if (IS_ERR(wh_dentry)) + goto out_parent; + + a->h_path.mnt = au_sbr_mnt(dentry->d_sb, bstart); + a->h_path.dentry = au_h_dptr(dentry, bstart); + dget(a->h_path.dentry); + if (bindex == bstart) { + h_dir = au_pinned_h_dir(&a->pin); + err = vfsub_unlink(h_dir, &a->h_path, /*force*/0); + } else { + /* dir inode is locked */ + h_dir = wh_dentry->d_parent->d_inode; + IMustLock(h_dir); + err = 0; + } + + if (!err) { + vfsub_drop_nlink(inode); + epilog(dir, dentry, bindex); + + /* update target timestamps */ + if (bindex == bstart) { + vfsub_update_h_iattr(&a->h_path, /*did*/NULL); + /*ignore*/ + inode->i_ctime = a->h_path.dentry->d_inode->i_ctime; + } else + /* todo: this timestamp may be reverted later */ + inode->i_ctime = h_dir->i_ctime; + goto out_unpin; /* success */ + } + + /* revert */ + if (wh_dentry) { + int rerr; + + rerr = do_revert(err, dir, bindex, bwh, wh_dentry, dentry, + &a->dt); + if (rerr) + err = rerr; + } + +out_unpin: + au_unpin(&a->pin); + dput(wh_dentry); + dput(a->h_path.dentry); +out_parent: + di_write_unlock(parent); +out_unlock: + aufs_read_unlock(dentry, AuLock_DW); +out_free: + kfree(a); +out: + return err; +} + +int aufs_rmdir(struct inode *dir, struct dentry *dentry) +{ + int err, rmdir_later; + aufs_bindex_t bwh, bindex, bstart; + struct inode *inode; + struct dentry *parent, *wh_dentry, *h_dentry; + struct au_whtmp_rmdir *args; + /* to reuduce stack size */ + struct { + struct au_dtime dt; + struct au_pin pin; + } *a; + + IMustLock(dir); + + err = -ENOMEM; + a = kmalloc(sizeof(*a), GFP_NOFS); + if (unlikely(!a)) + goto out; + + err = aufs_read_lock(dentry, AuLock_DW | AuLock_FLUSH | AuLock_GEN); + if (unlikely(err)) + goto out_free; + err = au_alive_dir(dentry); + if (unlikely(err)) + goto out_unlock; + inode = dentry->d_inode; + IMustLock(inode); + err = -ENOTDIR; + if (unlikely(!S_ISDIR(inode->i_mode))) + goto out_unlock; /* possible? */ + + err = -ENOMEM; + args = au_whtmp_rmdir_alloc(dir->i_sb, GFP_NOFS); + if (unlikely(!args)) + goto out_unlock; + + parent = dentry->d_parent; /* dir inode is locked */ + di_write_lock_parent(parent); + err = au_test_empty(dentry, &args->whlist); + if (unlikely(err)) + goto out_parent; + + bstart = au_dbstart(dentry); + bwh = au_dbwh(dentry); + bindex = -1; + wh_dentry = lock_hdir_create_wh(dentry, /*isdir*/1, &bindex, &a->dt, + &a->pin); + err = PTR_ERR(wh_dentry); + if (IS_ERR(wh_dentry)) + goto out_parent; + + h_dentry = au_h_dptr(dentry, bstart); + dget(h_dentry); + rmdir_later = 0; + if (bindex == bstart) { + err = renwh_and_rmdir(dentry, bstart, &args->whlist, dir); + if (err > 0) { + rmdir_later = err; + err = 0; + } + } else { + /* stop monitoring */ + au_hn_free(au_hi(inode, bstart)); + + /* dir inode is locked */ + IMustLock(wh_dentry->d_parent->d_inode); + err = 0; + } + + if (!err) { + vfsub_dead_dir(inode); + au_set_dbdiropq(dentry, -1); + epilog(dir, dentry, bindex); + + if (rmdir_later) { + au_whtmp_kick_rmdir(dir, bstart, h_dentry, args); + args = NULL; + } + + goto out_unpin; /* success */ + } + + /* revert */ + AuLabel(revert); + if (wh_dentry) { + int rerr; + + rerr = do_revert(err, dir, bindex, bwh, wh_dentry, dentry, + &a->dt); + if (rerr) + err = rerr; + } + +out_unpin: + au_unpin(&a->pin); + dput(wh_dentry); + dput(h_dentry); +out_parent: + di_write_unlock(parent); + if (args) + au_whtmp_rmdir_free(args); +out_unlock: + aufs_read_unlock(dentry, AuLock_DW); +out_free: + kfree(a); +out: + AuTraceErr(err); + return err; +} diff --git a/fs/aufs/i_op_ren.c b/fs/aufs/i_op_ren.c new file mode 100644 index 00000000000000..f74802e1090929 --- /dev/null +++ b/fs/aufs/i_op_ren.c @@ -0,0 +1,1010 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * inode operation (rename entry) + * todo: this is crazy monster + */ + +#include "aufs.h" + +enum { AuSRC, AuDST, AuSrcDst }; +enum { AuPARENT, AuCHILD, AuParentChild }; + +#define AuRen_ISDIR 1 +#define AuRen_ISSAMEDIR (1 << 1) +#define AuRen_WHSRC (1 << 2) +#define AuRen_WHDST (1 << 3) +#define AuRen_MNT_WRITE (1 << 4) +#define AuRen_DT_DSTDIR (1 << 5) +#define AuRen_DIROPQ (1 << 6) +#define AuRen_CPUP (1 << 7) +#define au_ftest_ren(flags, name) ((flags) & AuRen_##name) +#define au_fset_ren(flags, name) \ + do { (flags) |= AuRen_##name; } while (0) +#define au_fclr_ren(flags, name) \ + do { (flags) &= ~AuRen_##name; } while (0) + +struct au_ren_args { + struct { + struct dentry *dentry, *h_dentry, *parent, *h_parent, + *wh_dentry; + struct inode *dir, *inode; + struct au_hinode *hdir; + struct au_dtime dt[AuParentChild]; + aufs_bindex_t bstart; + } sd[AuSrcDst]; + +#define src_dentry sd[AuSRC].dentry +#define src_dir sd[AuSRC].dir +#define src_inode sd[AuSRC].inode +#define src_h_dentry sd[AuSRC].h_dentry +#define src_parent sd[AuSRC].parent +#define src_h_parent sd[AuSRC].h_parent +#define src_wh_dentry sd[AuSRC].wh_dentry +#define src_hdir sd[AuSRC].hdir +#define src_h_dir sd[AuSRC].hdir->hi_inode +#define src_dt sd[AuSRC].dt +#define src_bstart sd[AuSRC].bstart + +#define dst_dentry sd[AuDST].dentry +#define dst_dir sd[AuDST].dir +#define dst_inode sd[AuDST].inode +#define dst_h_dentry sd[AuDST].h_dentry +#define dst_parent sd[AuDST].parent +#define dst_h_parent sd[AuDST].h_parent +#define dst_wh_dentry sd[AuDST].wh_dentry +#define dst_hdir sd[AuDST].hdir +#define dst_h_dir sd[AuDST].hdir->hi_inode +#define dst_dt sd[AuDST].dt +#define dst_bstart sd[AuDST].bstart + + struct dentry *h_trap; + struct au_branch *br; + struct au_hinode *src_hinode; + struct path h_path; + struct au_nhash whlist; + aufs_bindex_t btgt, src_bwh, src_bdiropq; + + unsigned int flags; + + struct au_whtmp_rmdir *thargs; + struct dentry *h_dst; +}; + +/* ---------------------------------------------------------------------- */ + +/* + * functions for reverting. + * when an error happened in a single rename systemcall, we should revert + * everything as if nothing happend. + * we don't need to revert the copied-up/down the parent dir since they are + * harmless. + */ + +#define RevertFailure(fmt, ...) do { \ + AuIOErr("revert failure: " fmt " (%d, %d)\n", \ + ##__VA_ARGS__, err, rerr); \ + err = -EIO; \ +} while (0) + +static void au_ren_rev_diropq(int err, struct au_ren_args *a) +{ + int rerr; + + au_hn_imtx_lock_nested(a->src_hinode, AuLsc_I_CHILD); + rerr = au_diropq_remove(a->src_dentry, a->btgt); + au_hn_imtx_unlock(a->src_hinode); + au_set_dbdiropq(a->src_dentry, a->src_bdiropq); + if (rerr) + RevertFailure("remove diropq %.*s", AuDLNPair(a->src_dentry)); +} + +static void au_ren_rev_rename(int err, struct au_ren_args *a) +{ + int rerr; + + a->h_path.dentry = vfsub_lkup_one(&a->src_dentry->d_name, + a->src_h_parent); + rerr = PTR_ERR(a->h_path.dentry); + if (IS_ERR(a->h_path.dentry)) { + RevertFailure("lkup one %.*s", AuDLNPair(a->src_dentry)); + return; + } + + rerr = vfsub_rename(a->dst_h_dir, + au_h_dptr(a->src_dentry, a->btgt), + a->src_h_dir, &a->h_path); + d_drop(a->h_path.dentry); + dput(a->h_path.dentry); + /* au_set_h_dptr(a->src_dentry, a->btgt, NULL); */ + if (rerr) + RevertFailure("rename %.*s", AuDLNPair(a->src_dentry)); +} + +static void au_ren_rev_cpup(int err, struct au_ren_args *a) +{ + int rerr; + + a->h_path.dentry = a->dst_h_dentry; + rerr = vfsub_unlink(a->dst_h_dir, &a->h_path, /*force*/0); + au_set_h_dptr(a->src_dentry, a->btgt, NULL); + au_set_dbstart(a->src_dentry, a->src_bstart); + if (rerr) + RevertFailure("unlink %.*s", AuDLNPair(a->dst_h_dentry)); +} + +static void au_ren_rev_whtmp(int err, struct au_ren_args *a) +{ + int rerr; + + a->h_path.dentry = vfsub_lkup_one(&a->dst_dentry->d_name, + a->dst_h_parent); + rerr = PTR_ERR(a->h_path.dentry); + if (IS_ERR(a->h_path.dentry)) { + RevertFailure("lkup one %.*s", AuDLNPair(a->dst_dentry)); + return; + } + if (a->h_path.dentry->d_inode) { + d_drop(a->h_path.dentry); + dput(a->h_path.dentry); + return; + } + + rerr = vfsub_rename(a->dst_h_dir, a->h_dst, a->dst_h_dir, &a->h_path); + d_drop(a->h_path.dentry); + dput(a->h_path.dentry); + if (!rerr) + au_set_h_dptr(a->dst_dentry, a->btgt, dget(a->h_dst)); + else + RevertFailure("rename %.*s", AuDLNPair(a->h_dst)); +} + +static void au_ren_rev_whsrc(int err, struct au_ren_args *a) +{ + int rerr; + + a->h_path.dentry = a->src_wh_dentry; + rerr = au_wh_unlink_dentry(a->src_h_dir, &a->h_path, a->src_dentry); + au_set_dbwh(a->src_dentry, a->src_bwh); + if (rerr) + RevertFailure("unlink %.*s", AuDLNPair(a->src_wh_dentry)); +} +#undef RevertFailure + +/* ---------------------------------------------------------------------- */ + +/* + * when we have to copyup the renaming entry, do it with the rename-target name + * in order to minimize the cost (the later actual rename is unnecessary). + * otherwise rename it on the target branch. + */ +static int au_ren_or_cpup(struct au_ren_args *a) +{ + int err; + struct dentry *d; + + d = a->src_dentry; + if (au_dbstart(d) == a->btgt) { + a->h_path.dentry = a->dst_h_dentry; + if (au_ftest_ren(a->flags, DIROPQ) + && au_dbdiropq(d) == a->btgt) + au_fclr_ren(a->flags, DIROPQ); + AuDebugOn(au_dbstart(d) != a->btgt); + err = vfsub_rename(a->src_h_dir, au_h_dptr(d, a->btgt), + a->dst_h_dir, &a->h_path); + } else + BUG(); + + if (!err && a->h_dst) + /* it will be set to dinfo later */ + dget(a->h_dst); + + return err; +} + +/* cf. aufs_rmdir() */ +static int au_ren_del_whtmp(struct au_ren_args *a) +{ + int err; + struct inode *dir; + + dir = a->dst_dir; + SiMustAnyLock(dir->i_sb); + if (!au_nhash_test_longer_wh(&a->whlist, a->btgt, + au_sbi(dir->i_sb)->si_dirwh) + || au_test_fs_remote(a->h_dst->d_sb)) { + err = au_whtmp_rmdir(dir, a->btgt, a->h_dst, &a->whlist); + if (unlikely(err)) + pr_warn("failed removing whtmp dir %.*s (%d), " + "ignored.\n", AuDLNPair(a->h_dst), err); + } else { + au_nhash_wh_free(&a->thargs->whlist); + a->thargs->whlist = a->whlist; + a->whlist.nh_num = 0; + au_whtmp_kick_rmdir(dir, a->btgt, a->h_dst, a->thargs); + dput(a->h_dst); + a->thargs = NULL; + } + + return 0; +} + +/* make it 'opaque' dir. */ +static int au_ren_diropq(struct au_ren_args *a) +{ + int err; + struct dentry *diropq; + + err = 0; + a->src_bdiropq = au_dbdiropq(a->src_dentry); + a->src_hinode = au_hi(a->src_inode, a->btgt); + au_hn_imtx_lock_nested(a->src_hinode, AuLsc_I_CHILD); + diropq = au_diropq_create(a->src_dentry, a->btgt); + au_hn_imtx_unlock(a->src_hinode); + if (IS_ERR(diropq)) + err = PTR_ERR(diropq); + else + dput(diropq); + + return err; +} + +static int do_rename(struct au_ren_args *a) +{ + int err; + struct dentry *d, *h_d; + + /* prepare workqueue args for asynchronous rmdir */ + h_d = a->dst_h_dentry; + if (au_ftest_ren(a->flags, ISDIR) && h_d->d_inode) { + err = -ENOMEM; + a->thargs = au_whtmp_rmdir_alloc(a->src_dentry->d_sb, GFP_NOFS); + if (unlikely(!a->thargs)) + goto out; + a->h_dst = dget(h_d); + } + + /* create whiteout for src_dentry */ + if (au_ftest_ren(a->flags, WHSRC)) { + a->src_bwh = au_dbwh(a->src_dentry); + AuDebugOn(a->src_bwh >= 0); + a->src_wh_dentry + = au_wh_create(a->src_dentry, a->btgt, a->src_h_parent); + err = PTR_ERR(a->src_wh_dentry); + if (IS_ERR(a->src_wh_dentry)) + goto out_thargs; + } + + /* lookup whiteout for dentry */ + if (au_ftest_ren(a->flags, WHDST)) { + h_d = au_wh_lkup(a->dst_h_parent, &a->dst_dentry->d_name, + a->br); + err = PTR_ERR(h_d); + if (IS_ERR(h_d)) + goto out_whsrc; + if (!h_d->d_inode) + dput(h_d); + else + a->dst_wh_dentry = h_d; + } + + /* rename dentry to tmpwh */ + if (a->thargs) { + err = au_whtmp_ren(a->dst_h_dentry, a->br); + if (unlikely(err)) + goto out_whdst; + + d = a->dst_dentry; + au_set_h_dptr(d, a->btgt, NULL); + err = au_lkup_neg(d, a->btgt, /*wh*/0); + if (unlikely(err)) + goto out_whtmp; + a->dst_h_dentry = au_h_dptr(d, a->btgt); + } + + BUG_ON(a->dst_h_dentry->d_inode && a->src_bstart != a->btgt); + + /* rename by vfs_rename or cpup */ + d = a->dst_dentry; + if (au_ftest_ren(a->flags, ISDIR) + && (a->dst_wh_dentry + || au_dbdiropq(d) == a->btgt + /* hide the lower to keep xino */ + || a->btgt < au_dbend(d) + || au_opt_test(au_mntflags(d->d_sb), ALWAYS_DIROPQ))) + au_fset_ren(a->flags, DIROPQ); + err = au_ren_or_cpup(a); + if (unlikely(err)) + /* leave the copied-up one */ + goto out_whtmp; + + /* make dir opaque */ + if (au_ftest_ren(a->flags, DIROPQ)) { + err = au_ren_diropq(a); + if (unlikely(err)) + goto out_rename; + } + + /* update target timestamps */ + AuDebugOn(au_dbstart(a->src_dentry) != a->btgt); + a->h_path.dentry = au_h_dptr(a->src_dentry, a->btgt); + vfsub_update_h_iattr(&a->h_path, /*did*/NULL); /*ignore*/ + a->src_inode->i_ctime = a->h_path.dentry->d_inode->i_ctime; + + /* remove whiteout for dentry */ + if (a->dst_wh_dentry) { + a->h_path.dentry = a->dst_wh_dentry; + err = au_wh_unlink_dentry(a->dst_h_dir, &a->h_path, + a->dst_dentry); + if (unlikely(err)) + goto out_diropq; + } + + /* remove whtmp */ + if (a->thargs) + au_ren_del_whtmp(a); /* ignore this error */ + + au_fhsm_wrote(a->src_dentry->d_sb, a->btgt, /*force*/0); + err = 0; + goto out_success; + +out_diropq: + if (au_ftest_ren(a->flags, DIROPQ)) + au_ren_rev_diropq(err, a); +out_rename: + if (!au_ftest_ren(a->flags, CPUP)) + au_ren_rev_rename(err, a); + else + au_ren_rev_cpup(err, a); + dput(a->h_dst); +out_whtmp: + if (a->thargs) + au_ren_rev_whtmp(err, a); +out_whdst: + dput(a->dst_wh_dentry); + a->dst_wh_dentry = NULL; +out_whsrc: + if (a->src_wh_dentry) + au_ren_rev_whsrc(err, a); +out_success: + dput(a->src_wh_dentry); + dput(a->dst_wh_dentry); +out_thargs: + if (a->thargs) { + dput(a->h_dst); + au_whtmp_rmdir_free(a->thargs); + a->thargs = NULL; + } +out: + return err; +} + +/* ---------------------------------------------------------------------- */ + +/* + * test if @dentry dir can be rename destination or not. + * success means, it is a logically empty dir. + */ +static int may_rename_dstdir(struct dentry *dentry, struct au_nhash *whlist) +{ + return au_test_empty(dentry, whlist); +} + +/* + * test if @dentry dir can be rename source or not. + * if it can, return 0 and @children is filled. + * success means, + * - it is a logically empty dir. + * - or, it exists on writable branch and has no children including whiteouts + * on the lower branch. + */ +static int may_rename_srcdir(struct dentry *dentry, aufs_bindex_t btgt) +{ + int err; + unsigned int rdhash; + aufs_bindex_t bstart; + + bstart = au_dbstart(dentry); + if (bstart != btgt) { + struct au_nhash whlist; + + SiMustAnyLock(dentry->d_sb); + rdhash = au_sbi(dentry->d_sb)->si_rdhash; + if (!rdhash) + rdhash = au_rdhash_est(au_dir_size(/*file*/NULL, + dentry)); + err = au_nhash_alloc(&whlist, rdhash, GFP_NOFS); + if (unlikely(err)) + goto out; + err = au_test_empty(dentry, &whlist); + au_nhash_wh_free(&whlist); + goto out; + } + + if (bstart == au_dbtaildir(dentry)) + return 0; /* success */ + + err = au_test_empty_lower(dentry); + +out: + if (err == -ENOTEMPTY) { + AuWarn1("renaming dir who has child(ren) on multiple branches," + " is not supported\n"); + err = -EXDEV; + } + return err; +} + +/* side effect: sets whlist and h_dentry */ +static int au_ren_may_dir(struct au_ren_args *a) +{ + int err; + unsigned int rdhash; + struct dentry *d; + + d = a->dst_dentry; + SiMustAnyLock(d->d_sb); + + err = 0; + if (au_ftest_ren(a->flags, ISDIR) && a->dst_inode) { + rdhash = au_sbi(d->d_sb)->si_rdhash; + if (!rdhash) + rdhash = au_rdhash_est(au_dir_size(/*file*/NULL, d)); + err = au_nhash_alloc(&a->whlist, rdhash, GFP_NOFS); + if (unlikely(err)) + goto out; + + au_set_dbstart(d, a->dst_bstart); + err = may_rename_dstdir(d, &a->whlist); + au_set_dbstart(d, a->btgt); + } + a->dst_h_dentry = au_h_dptr(d, au_dbstart(d)); + if (unlikely(err)) + goto out; + + d = a->src_dentry; + a->src_h_dentry = au_h_dptr(d, au_dbstart(d)); + if (au_ftest_ren(a->flags, ISDIR)) { + err = may_rename_srcdir(d, a->btgt); + if (unlikely(err)) { + au_nhash_wh_free(&a->whlist); + a->whlist.nh_num = 0; + } + } +out: + return err; +} + +/* ---------------------------------------------------------------------- */ + +/* + * simple tests for rename. + * following the checks in vfs, plus the parent-child relationship. + */ +static int au_may_ren(struct au_ren_args *a) +{ + int err, isdir; + struct inode *h_inode; + + if (a->src_bstart == a->btgt) { + err = au_may_del(a->src_dentry, a->btgt, a->src_h_parent, + au_ftest_ren(a->flags, ISDIR)); + if (unlikely(err)) + goto out; + err = -EINVAL; + if (unlikely(a->src_h_dentry == a->h_trap)) + goto out; + } + + err = 0; + if (a->dst_bstart != a->btgt) + goto out; + + err = -ENOTEMPTY; + if (unlikely(a->dst_h_dentry == a->h_trap)) + goto out; + + err = -EIO; + h_inode = a->dst_h_dentry->d_inode; + isdir = !!au_ftest_ren(a->flags, ISDIR); + if (!a->dst_dentry->d_inode) { + if (unlikely(h_inode)) + goto out; + err = au_may_add(a->dst_dentry, a->btgt, a->dst_h_parent, + isdir); + } else { + if (unlikely(!h_inode || !h_inode->i_nlink)) + goto out; + err = au_may_del(a->dst_dentry, a->btgt, a->dst_h_parent, + isdir); + if (unlikely(err)) + goto out; + } + +out: + if (unlikely(err == -ENOENT || err == -EEXIST)) + err = -EIO; + AuTraceErr(err); + return err; +} + +/* ---------------------------------------------------------------------- */ + +/* + * locking order + * (VFS) + * - src_dir and dir by lock_rename() + * - inode if exitsts + * (aufs) + * - lock all + * + src_dentry and dentry by aufs_read_and_write_lock2() which calls, + * + si_read_lock + * + di_write_lock2_child() + * + di_write_lock_child() + * + ii_write_lock_child() + * + di_write_lock_child2() + * + ii_write_lock_child2() + * + src_parent and parent + * + di_write_lock_parent() + * + ii_write_lock_parent() + * + di_write_lock_parent2() + * + ii_write_lock_parent2() + * + lower src_dir and dir by vfsub_lock_rename() + * + verify the every relationships between child and parent. if any + * of them failed, unlock all and return -EBUSY. + */ +static void au_ren_unlock(struct au_ren_args *a) +{ + vfsub_unlock_rename(a->src_h_parent, a->src_hdir, + a->dst_h_parent, a->dst_hdir); + if (au_ftest_ren(a->flags, MNT_WRITE)) + vfsub_mnt_drop_write(au_br_mnt(a->br)); +} + +static int au_ren_lock(struct au_ren_args *a) +{ + int err; + unsigned int udba; + + err = 0; + a->src_h_parent = au_h_dptr(a->src_parent, a->btgt); + a->src_hdir = au_hi(a->src_dir, a->btgt); + a->dst_h_parent = au_h_dptr(a->dst_parent, a->btgt); + a->dst_hdir = au_hi(a->dst_dir, a->btgt); + + err = vfsub_mnt_want_write(au_br_mnt(a->br)); + if (unlikely(err)) + goto out; + au_fset_ren(a->flags, MNT_WRITE); + a->h_trap = vfsub_lock_rename(a->src_h_parent, a->src_hdir, + a->dst_h_parent, a->dst_hdir); + udba = au_opt_udba(a->src_dentry->d_sb); + if (unlikely(a->src_hdir->hi_inode != a->src_h_parent->d_inode + || a->dst_hdir->hi_inode != a->dst_h_parent->d_inode)) + err = au_busy_or_stale(); + if (!err && au_dbstart(a->src_dentry) == a->btgt) + err = au_h_verify(a->src_h_dentry, udba, + a->src_h_parent->d_inode, a->src_h_parent, + a->br); + if (!err && au_dbstart(a->dst_dentry) == a->btgt) + err = au_h_verify(a->dst_h_dentry, udba, + a->dst_h_parent->d_inode, a->dst_h_parent, + a->br); + if (!err) + goto out; /* success */ + + err = au_busy_or_stale(); + au_ren_unlock(a); + +out: + return err; +} + +/* ---------------------------------------------------------------------- */ + +static void au_ren_refresh_dir(struct au_ren_args *a) +{ + struct inode *dir; + + dir = a->dst_dir; + dir->i_version++; + if (au_ftest_ren(a->flags, ISDIR)) { + /* is this updating defined in POSIX? */ + au_cpup_attr_timesizes(a->src_inode); + au_cpup_attr_nlink(dir, /*force*/1); + } + + if (au_ibstart(dir) == a->btgt) + au_cpup_attr_timesizes(dir); + + if (au_ftest_ren(a->flags, ISSAMEDIR)) + return; + + dir = a->src_dir; + dir->i_version++; + if (au_ftest_ren(a->flags, ISDIR)) + au_cpup_attr_nlink(dir, /*force*/1); + if (au_ibstart(dir) == a->btgt) + au_cpup_attr_timesizes(dir); +} + +static void au_ren_refresh(struct au_ren_args *a) +{ + aufs_bindex_t bend, bindex; + struct dentry *d, *h_d; + struct inode *i, *h_i; + struct super_block *sb; + + d = a->dst_dentry; + d_drop(d); + if (a->h_dst) + /* already dget-ed by au_ren_or_cpup() */ + au_set_h_dptr(d, a->btgt, a->h_dst); + + i = a->dst_inode; + if (i) { + if (!au_ftest_ren(a->flags, ISDIR)) + vfsub_drop_nlink(i); + else { + vfsub_dead_dir(i); + au_cpup_attr_timesizes(i); + } + au_update_dbrange(d, /*do_put_zero*/1); + } else { + bend = a->btgt; + for (bindex = au_dbstart(d); bindex < bend; bindex++) + au_set_h_dptr(d, bindex, NULL); + bend = au_dbend(d); + for (bindex = a->btgt + 1; bindex <= bend; bindex++) + au_set_h_dptr(d, bindex, NULL); + au_update_dbrange(d, /*do_put_zero*/0); + } + + d = a->src_dentry; + au_set_dbwh(d, -1); + bend = au_dbend(d); + for (bindex = a->btgt + 1; bindex <= bend; bindex++) { + h_d = au_h_dptr(d, bindex); + if (h_d) + au_set_h_dptr(d, bindex, NULL); + } + au_set_dbend(d, a->btgt); + + sb = d->d_sb; + i = a->src_inode; + if (au_opt_test(au_mntflags(sb), PLINK) && au_plink_test(i)) + return; /* success */ + + bend = au_ibend(i); + for (bindex = a->btgt + 1; bindex <= bend; bindex++) { + h_i = au_h_iptr(i, bindex); + if (h_i) { + au_xino_write(sb, bindex, h_i->i_ino, /*ino*/0); + /* ignore this error */ + au_set_h_iptr(i, bindex, NULL, 0); + } + } + au_set_ibend(i, a->btgt); +} + +/* ---------------------------------------------------------------------- */ + +/* mainly for link(2) and rename(2) */ +int au_wbr(struct dentry *dentry, aufs_bindex_t btgt) +{ + aufs_bindex_t bdiropq, bwh; + struct dentry *parent; + struct au_branch *br; + + parent = dentry->d_parent; + IMustLock(parent->d_inode); /* dir is locked */ + + bdiropq = au_dbdiropq(parent); + bwh = au_dbwh(dentry); + br = au_sbr(dentry->d_sb, btgt); + if (au_br_rdonly(br) + || (0 <= bdiropq && bdiropq < btgt) + || (0 <= bwh && bwh < btgt)) + btgt = -1; + + AuDbg("btgt %d\n", btgt); + return btgt; +} + +/* sets src_bstart, dst_bstart and btgt */ +static int au_ren_wbr(struct au_ren_args *a) +{ + int err; + struct au_wr_dir_args wr_dir_args = { + /* .force_btgt = -1, */ + .flags = AuWrDir_ADD_ENTRY + }; + + a->src_bstart = au_dbstart(a->src_dentry); + a->dst_bstart = au_dbstart(a->dst_dentry); + if (au_ftest_ren(a->flags, ISDIR)) + au_fset_wrdir(wr_dir_args.flags, ISDIR); + wr_dir_args.force_btgt = a->src_bstart; + if (a->dst_inode && a->dst_bstart < a->src_bstart) + wr_dir_args.force_btgt = a->dst_bstart; + wr_dir_args.force_btgt = au_wbr(a->dst_dentry, wr_dir_args.force_btgt); + err = au_wr_dir(a->dst_dentry, a->src_dentry, &wr_dir_args); + a->btgt = err; + + return err; +} + +static void au_ren_dt(struct au_ren_args *a) +{ + a->h_path.dentry = a->src_h_parent; + au_dtime_store(a->src_dt + AuPARENT, a->src_parent, &a->h_path); + if (!au_ftest_ren(a->flags, ISSAMEDIR)) { + a->h_path.dentry = a->dst_h_parent; + au_dtime_store(a->dst_dt + AuPARENT, a->dst_parent, &a->h_path); + } + + au_fclr_ren(a->flags, DT_DSTDIR); + if (!au_ftest_ren(a->flags, ISDIR)) + return; + + a->h_path.dentry = a->src_h_dentry; + au_dtime_store(a->src_dt + AuCHILD, a->src_dentry, &a->h_path); + if (a->dst_h_dentry->d_inode) { + au_fset_ren(a->flags, DT_DSTDIR); + a->h_path.dentry = a->dst_h_dentry; + au_dtime_store(a->dst_dt + AuCHILD, a->dst_dentry, &a->h_path); + } +} + +static void au_ren_rev_dt(int err, struct au_ren_args *a) +{ + struct dentry *h_d; + struct mutex *h_mtx; + + au_dtime_revert(a->src_dt + AuPARENT); + if (!au_ftest_ren(a->flags, ISSAMEDIR)) + au_dtime_revert(a->dst_dt + AuPARENT); + + if (au_ftest_ren(a->flags, ISDIR) && err != -EIO) { + h_d = a->src_dt[AuCHILD].dt_h_path.dentry; + h_mtx = &h_d->d_inode->i_mutex; + mutex_lock_nested(h_mtx, AuLsc_I_CHILD); + au_dtime_revert(a->src_dt + AuCHILD); + mutex_unlock(h_mtx); + + if (au_ftest_ren(a->flags, DT_DSTDIR)) { + h_d = a->dst_dt[AuCHILD].dt_h_path.dentry; + h_mtx = &h_d->d_inode->i_mutex; + mutex_lock_nested(h_mtx, AuLsc_I_CHILD); + au_dtime_revert(a->dst_dt + AuCHILD); + mutex_unlock(h_mtx); + } + } +} + +/* ---------------------------------------------------------------------- */ + +int aufs_rename(struct inode *_src_dir, struct dentry *_src_dentry, + struct inode *_dst_dir, struct dentry *_dst_dentry) +{ + int err, flags; + /* reduce stack space */ + struct au_ren_args *a; + + AuDbg("%.*s, %.*s\n", AuDLNPair(_src_dentry), AuDLNPair(_dst_dentry)); + IMustLock(_src_dir); + IMustLock(_dst_dir); + + err = -ENOMEM; + BUILD_BUG_ON(sizeof(*a) > PAGE_SIZE); + a = kzalloc(sizeof(*a), GFP_NOFS); + if (unlikely(!a)) + goto out; + + a->src_dir = _src_dir; + a->src_dentry = _src_dentry; + a->src_inode = a->src_dentry->d_inode; + a->src_parent = a->src_dentry->d_parent; /* dir inode is locked */ + a->dst_dir = _dst_dir; + a->dst_dentry = _dst_dentry; + a->dst_inode = a->dst_dentry->d_inode; + a->dst_parent = a->dst_dentry->d_parent; /* dir inode is locked */ + if (a->dst_inode) { + IMustLock(a->dst_inode); + au_igrab(a->dst_inode); + } + + err = -ENOTDIR; + flags = AuLock_FLUSH | AuLock_NOPLM | AuLock_GEN; + if (S_ISDIR(a->src_inode->i_mode)) { + au_fset_ren(a->flags, ISDIR); + if (unlikely(a->dst_inode && !S_ISDIR(a->dst_inode->i_mode))) + goto out_free; + err = aufs_read_and_write_lock2(a->dst_dentry, a->src_dentry, + AuLock_DIR | flags); + } else + err = aufs_read_and_write_lock2(a->dst_dentry, a->src_dentry, + flags); + if (unlikely(err)) + goto out_free; + + err = au_d_hashed_positive(a->src_dentry); + if (unlikely(err)) + goto out_unlock; + err = -ENOENT; + if (a->dst_inode) { + /* + * If it is a dir, VFS unhash dst_dentry before this + * function. It means we cannot rely upon d_unhashed(). + */ + if (unlikely(!a->dst_inode->i_nlink)) + goto out_unlock; + if (!S_ISDIR(a->dst_inode->i_mode)) { + err = au_d_hashed_positive(a->dst_dentry); + if (unlikely(err)) + goto out_unlock; + } else if (unlikely(IS_DEADDIR(a->dst_inode))) + goto out_unlock; + } else if (unlikely(d_unhashed(a->dst_dentry))) + goto out_unlock; + + /* + * is it possible? + * yes, it happend (in linux-3.3-rcN) but I don't know why. + * there may exist a problem somewhere else. + */ + err = -EINVAL; + if (unlikely(a->dst_parent->d_inode == a->src_dentry->d_inode)) + goto out_unlock; + + au_fset_ren(a->flags, ISSAMEDIR); /* temporary */ + di_write_lock_parent(a->dst_parent); + + /* which branch we process */ + err = au_ren_wbr(a); + if (unlikely(err < 0)) + goto out_parent; + a->br = au_sbr(a->dst_dentry->d_sb, a->btgt); + a->h_path.mnt = au_br_mnt(a->br); + + /* are they available to be renamed */ + err = au_ren_may_dir(a); + if (unlikely(err)) + goto out_children; + + /* prepare the writable parent dir on the same branch */ + if (a->dst_bstart == a->btgt) { + au_fset_ren(a->flags, WHDST); + } else { + err = au_cpup_dirs(a->dst_dentry, a->btgt); + if (unlikely(err)) + goto out_children; + } + + if (a->src_dir != a->dst_dir) { + /* + * this temporary unlock is safe, + * because both dir->i_mutex are locked. + */ + di_write_unlock(a->dst_parent); + di_write_lock_parent(a->src_parent); + err = au_wr_dir_need_wh(a->src_dentry, + au_ftest_ren(a->flags, ISDIR), + &a->btgt); + di_write_unlock(a->src_parent); + di_write_lock2_parent(a->src_parent, a->dst_parent, /*isdir*/1); + au_fclr_ren(a->flags, ISSAMEDIR); + } else + err = au_wr_dir_need_wh(a->src_dentry, + au_ftest_ren(a->flags, ISDIR), + &a->btgt); + if (unlikely(err < 0)) + goto out_children; + if (err) + au_fset_ren(a->flags, WHSRC); + + /* cpup src */ + if (a->src_bstart != a->btgt) { + struct au_pin pin; + + err = au_pin(&pin, a->src_dentry, a->btgt, + au_opt_udba(a->src_dentry->d_sb), + AuPin_DI_LOCKED | AuPin_MNT_WRITE); + if (!err) { + struct au_cp_generic cpg = { + .dentry = a->src_dentry, + .bdst = a->btgt, + .bsrc = a->src_bstart, + .len = -1, + .pin = &pin, + .flags = AuCpup_DTIME | AuCpup_HOPEN + }; + AuDebugOn(au_dbstart(a->src_dentry) != a->src_bstart); + err = au_sio_cpup_simple(&cpg); + au_unpin(&pin); + } + if (unlikely(err)) + goto out_children; + a->src_bstart = a->btgt; + a->src_h_dentry = au_h_dptr(a->src_dentry, a->btgt); + au_fset_ren(a->flags, WHSRC); + } + + /* lock them all */ + err = au_ren_lock(a); + if (unlikely(err)) + /* leave the copied-up one */ + goto out_children; + + if (!au_opt_test(au_mntflags(a->dst_dir->i_sb), UDBA_NONE)) + err = au_may_ren(a); + else if (unlikely(a->dst_dentry->d_name.len > AUFS_MAX_NAMELEN)) + err = -ENAMETOOLONG; + if (unlikely(err)) + goto out_hdir; + + /* store timestamps to be revertible */ + au_ren_dt(a); + + /* here we go */ + err = do_rename(a); + if (unlikely(err)) + goto out_dt; + + /* update dir attributes */ + au_ren_refresh_dir(a); + + /* dput/iput all lower dentries */ + au_ren_refresh(a); + + goto out_hdir; /* success */ + +out_dt: + au_ren_rev_dt(err, a); +out_hdir: + au_ren_unlock(a); +out_children: + au_nhash_wh_free(&a->whlist); + if (err && a->dst_inode && a->dst_bstart != a->btgt) { + AuDbg("bstart %d, btgt %d\n", a->dst_bstart, a->btgt); + au_set_h_dptr(a->dst_dentry, a->btgt, NULL); + au_set_dbstart(a->dst_dentry, a->dst_bstart); + } +out_parent: + if (!err) + d_move(a->src_dentry, a->dst_dentry); + else { + au_update_dbstart(a->dst_dentry); + if (!a->dst_inode) + d_drop(a->dst_dentry); + } + if (au_ftest_ren(a->flags, ISSAMEDIR)) + di_write_unlock(a->dst_parent); + else + di_write_unlock2(a->src_parent, a->dst_parent); +out_unlock: + aufs_read_and_write_unlock2(a->dst_dentry, a->src_dentry); +out_free: + iput(a->dst_inode); + if (a->thargs) + au_whtmp_rmdir_free(a->thargs); + kfree(a); +out: + AuTraceErr(err); + return err; +} diff --git a/fs/aufs/iinfo.c b/fs/aufs/iinfo.c new file mode 100644 index 00000000000000..14ca4cac8ee6e7 --- /dev/null +++ b/fs/aufs/iinfo.c @@ -0,0 +1,275 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * inode private data + */ + +#include "aufs.h" + +struct inode *au_h_iptr(struct inode *inode, aufs_bindex_t bindex) +{ + struct inode *h_inode; + + IiMustAnyLock(inode); + + h_inode = au_ii(inode)->ii_hinode[0 + bindex].hi_inode; + AuDebugOn(h_inode && atomic_read(&h_inode->i_count) <= 0); + return h_inode; +} + +/* todo: hard/soft set? */ +void au_hiput(struct au_hinode *hinode) +{ + au_hn_free(hinode); + dput(hinode->hi_whdentry); + iput(hinode->hi_inode); +} + +unsigned int au_hi_flags(struct inode *inode, int isdir) +{ + unsigned int flags; + const unsigned int mnt_flags = au_mntflags(inode->i_sb); + + flags = 0; + if (au_opt_test(mnt_flags, XINO)) + au_fset_hi(flags, XINO); + if (isdir && au_opt_test(mnt_flags, UDBA_HNOTIFY)) + au_fset_hi(flags, HNOTIFY); + return flags; +} + +void au_set_h_iptr(struct inode *inode, aufs_bindex_t bindex, + struct inode *h_inode, unsigned int flags) +{ + struct au_hinode *hinode; + struct inode *hi; + struct au_iinfo *iinfo = au_ii(inode); + + IiMustWriteLock(inode); + + hinode = iinfo->ii_hinode + bindex; + hi = hinode->hi_inode; + AuDebugOn(h_inode && atomic_read(&h_inode->i_count) <= 0); + + if (hi) + au_hiput(hinode); + hinode->hi_inode = h_inode; + if (h_inode) { + int err; + struct super_block *sb = inode->i_sb; + struct au_branch *br; + + AuDebugOn(inode->i_mode + && (h_inode->i_mode & S_IFMT) + != (inode->i_mode & S_IFMT)); + if (bindex == iinfo->ii_bstart) + au_cpup_igen(inode, h_inode); + br = au_sbr(sb, bindex); + hinode->hi_id = br->br_id; + if (au_ftest_hi(flags, XINO)) { + err = au_xino_write(sb, bindex, h_inode->i_ino, + inode->i_ino); + if (unlikely(err)) + AuIOErr1("failed au_xino_write() %d\n", err); + } + + if (au_ftest_hi(flags, HNOTIFY) + && au_br_hnotifyable(br->br_perm)) { + err = au_hn_alloc(hinode, inode); + if (unlikely(err)) + AuIOErr1("au_hn_alloc() %d\n", err); + } + } +} + +void au_set_hi_wh(struct inode *inode, aufs_bindex_t bindex, + struct dentry *h_wh) +{ + struct au_hinode *hinode; + + IiMustWriteLock(inode); + + hinode = au_ii(inode)->ii_hinode + bindex; + AuDebugOn(hinode->hi_whdentry); + hinode->hi_whdentry = h_wh; +} + +void au_update_iigen(struct inode *inode, int half) +{ + struct au_iinfo *iinfo; + struct au_iigen *iigen; + unsigned int sigen; + + sigen = au_sigen(inode->i_sb); + iinfo = au_ii(inode); + iigen = &iinfo->ii_generation; + spin_lock(&iinfo->ii_genspin); + iigen->ig_generation = sigen; + if (half) + au_ig_fset(iigen->ig_flags, HALF_REFRESHED); + else + au_ig_fclr(iigen->ig_flags, HALF_REFRESHED); + spin_unlock(&iinfo->ii_genspin); +} + +/* it may be called at remount time, too */ +void au_update_ibrange(struct inode *inode, int do_put_zero) +{ + struct au_iinfo *iinfo; + aufs_bindex_t bindex, bend; + + iinfo = au_ii(inode); + if (!iinfo) + return; + + IiMustWriteLock(inode); + + if (do_put_zero && iinfo->ii_bstart >= 0) { + for (bindex = iinfo->ii_bstart; bindex <= iinfo->ii_bend; + bindex++) { + struct inode *h_i; + + h_i = iinfo->ii_hinode[0 + bindex].hi_inode; + if (h_i && !h_i->i_nlink) + au_set_h_iptr(inode, bindex, NULL, 0); + } + } + + iinfo->ii_bstart = -1; + iinfo->ii_bend = -1; + bend = au_sbend(inode->i_sb); + for (bindex = 0; bindex <= bend; bindex++) + if (iinfo->ii_hinode[0 + bindex].hi_inode) { + iinfo->ii_bstart = bindex; + break; + } + if (iinfo->ii_bstart >= 0) + for (bindex = bend; bindex >= iinfo->ii_bstart; bindex--) + if (iinfo->ii_hinode[0 + bindex].hi_inode) { + iinfo->ii_bend = bindex; + break; + } + AuDebugOn(iinfo->ii_bstart > iinfo->ii_bend); +} + +/* ---------------------------------------------------------------------- */ + +void au_icntnr_init_once(void *_c) +{ + struct au_icntnr *c = _c; + struct au_iinfo *iinfo = &c->iinfo; + static struct lock_class_key aufs_ii; + + spin_lock_init(&iinfo->ii_genspin); + au_rw_init(&iinfo->ii_rwsem); + au_rw_class(&iinfo->ii_rwsem, &aufs_ii); + inode_init_once(&c->vfs_inode); +} + +int au_iinfo_init(struct inode *inode) +{ + struct au_iinfo *iinfo; + struct super_block *sb; + int nbr, i; + + sb = inode->i_sb; + iinfo = &(container_of(inode, struct au_icntnr, vfs_inode)->iinfo); + nbr = au_sbend(sb) + 1; + if (unlikely(nbr <= 0)) + nbr = 1; + iinfo->ii_hinode = kcalloc(nbr, sizeof(*iinfo->ii_hinode), GFP_NOFS); + if (iinfo->ii_hinode) { + au_ninodes_inc(sb); + for (i = 0; i < nbr; i++) + iinfo->ii_hinode[i].hi_id = -1; + + iinfo->ii_generation.ig_generation = au_sigen(sb); + iinfo->ii_bstart = -1; + iinfo->ii_bend = -1; + iinfo->ii_vdir = NULL; + return 0; + } + return -ENOMEM; +} + +int au_ii_realloc(struct au_iinfo *iinfo, int nbr) +{ + int err, sz; + struct au_hinode *hip; + + AuRwMustWriteLock(&iinfo->ii_rwsem); + + err = -ENOMEM; + sz = sizeof(*hip) * (iinfo->ii_bend + 1); + if (!sz) + sz = sizeof(*hip); + hip = au_kzrealloc(iinfo->ii_hinode, sz, sizeof(*hip) * nbr, GFP_NOFS); + if (hip) { + iinfo->ii_hinode = hip; + err = 0; + } + + return err; +} + +void au_iinfo_fin(struct inode *inode) +{ + struct au_iinfo *iinfo; + struct au_hinode *hi; + struct super_block *sb; + aufs_bindex_t bindex, bend; + const unsigned char unlinked = !inode->i_nlink; + + iinfo = au_ii(inode); + /* bad_inode case */ + if (!iinfo) + return; + + sb = inode->i_sb; + au_ninodes_dec(sb); + if (si_pid_test(sb)) + au_xino_delete_inode(inode, unlinked); + else { + /* + * it is safe to hide the dependency between sbinfo and + * sb->s_umount. + */ + lockdep_off(); + si_noflush_read_lock(sb); + au_xino_delete_inode(inode, unlinked); + si_read_unlock(sb); + lockdep_on(); + } + + if (iinfo->ii_vdir) + au_vdir_free(iinfo->ii_vdir); + + bindex = iinfo->ii_bstart; + if (bindex >= 0) { + hi = iinfo->ii_hinode + bindex; + bend = iinfo->ii_bend; + while (bindex++ <= bend) { + if (hi->hi_inode) + au_hiput(hi); + hi++; + } + } + kfree(iinfo->ii_hinode); + iinfo->ii_hinode = NULL; + AuRwDestroy(&iinfo->ii_rwsem); +} diff --git a/fs/aufs/inode.c b/fs/aufs/inode.c new file mode 100644 index 00000000000000..43643390f2f12c --- /dev/null +++ b/fs/aufs/inode.c @@ -0,0 +1,496 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * inode functions + */ + +#include "aufs.h" + +struct inode *au_igrab(struct inode *inode) +{ + if (inode) { + AuDebugOn(!atomic_read(&inode->i_count)); + ihold(inode); + } + return inode; +} + +static void au_refresh_hinode_attr(struct inode *inode, int do_version) +{ + au_cpup_attr_all(inode, /*force*/0); + au_update_iigen(inode, /*half*/1); + if (do_version) + inode->i_version++; +} + +static int au_ii_refresh(struct inode *inode, int *update) +{ + int err, e; + umode_t type; + aufs_bindex_t bindex, new_bindex; + struct super_block *sb; + struct au_iinfo *iinfo; + struct au_hinode *p, *q, tmp; + + IiMustWriteLock(inode); + + *update = 0; + sb = inode->i_sb; + type = inode->i_mode & S_IFMT; + iinfo = au_ii(inode); + err = au_ii_realloc(iinfo, au_sbend(sb) + 1); + if (unlikely(err)) + goto out; + + AuDebugOn(iinfo->ii_bstart < 0); + p = iinfo->ii_hinode + iinfo->ii_bstart; + for (bindex = iinfo->ii_bstart; bindex <= iinfo->ii_bend; + bindex++, p++) { + if (!p->hi_inode) + continue; + + AuDebugOn(type != (p->hi_inode->i_mode & S_IFMT)); + new_bindex = au_br_index(sb, p->hi_id); + if (new_bindex == bindex) + continue; + + if (new_bindex < 0) { + *update = 1; + au_hiput(p); + p->hi_inode = NULL; + continue; + } + + if (new_bindex < iinfo->ii_bstart) + iinfo->ii_bstart = new_bindex; + if (iinfo->ii_bend < new_bindex) + iinfo->ii_bend = new_bindex; + /* swap two lower inode, and loop again */ + q = iinfo->ii_hinode + new_bindex; + tmp = *q; + *q = *p; + *p = tmp; + if (tmp.hi_inode) { + bindex--; + p--; + } + } + au_update_ibrange(inode, /*do_put_zero*/0); + e = au_dy_irefresh(inode); + if (unlikely(e && !err)) + err = e; + +out: + AuTraceErr(err); + return err; +} + +int au_refresh_hinode_self(struct inode *inode) +{ + int err, update; + + err = au_ii_refresh(inode, &update); + if (!err) + au_refresh_hinode_attr(inode, update && S_ISDIR(inode->i_mode)); + + AuTraceErr(err); + return err; +} + +int au_refresh_hinode(struct inode *inode, struct dentry *dentry) +{ + int err, e, update; + unsigned int flags; + umode_t mode; + aufs_bindex_t bindex, bend; + unsigned char isdir; + struct au_hinode *p; + struct au_iinfo *iinfo; + + err = au_ii_refresh(inode, &update); + if (unlikely(err)) + goto out; + + update = 0; + iinfo = au_ii(inode); + p = iinfo->ii_hinode + iinfo->ii_bstart; + mode = (inode->i_mode & S_IFMT); + isdir = S_ISDIR(mode); + flags = au_hi_flags(inode, isdir); + bend = au_dbend(dentry); + for (bindex = au_dbstart(dentry); bindex <= bend; bindex++) { + struct inode *h_i; + struct dentry *h_d; + + h_d = au_h_dptr(dentry, bindex); + if (!h_d || !h_d->d_inode) + continue; + + AuDebugOn(mode != (h_d->d_inode->i_mode & S_IFMT)); + if (iinfo->ii_bstart <= bindex && bindex <= iinfo->ii_bend) { + h_i = au_h_iptr(inode, bindex); + if (h_i) { + if (h_i == h_d->d_inode) + continue; + err = -EIO; + break; + } + } + if (bindex < iinfo->ii_bstart) + iinfo->ii_bstart = bindex; + if (iinfo->ii_bend < bindex) + iinfo->ii_bend = bindex; + au_set_h_iptr(inode, bindex, au_igrab(h_d->d_inode), flags); + update = 1; + } + au_update_ibrange(inode, /*do_put_zero*/0); + e = au_dy_irefresh(inode); + if (unlikely(e && !err)) + err = e; + if (!err) + au_refresh_hinode_attr(inode, update && isdir); + +out: + AuTraceErr(err); + return err; +} + +static int set_inode(struct inode *inode, struct dentry *dentry) +{ + int err; + unsigned int flags; + umode_t mode; + aufs_bindex_t bindex, bstart, btail; + unsigned char isdir; + struct dentry *h_dentry; + struct inode *h_inode; + struct au_iinfo *iinfo; + + IiMustWriteLock(inode); + + err = 0; + isdir = 0; + bstart = au_dbstart(dentry); + h_inode = au_h_dptr(dentry, bstart)->d_inode; + mode = h_inode->i_mode; + switch (mode & S_IFMT) { + case S_IFREG: + btail = au_dbtail(dentry); + inode->i_op = &aufs_iop; + inode->i_fop = &aufs_file_fop; + err = au_dy_iaop(inode, bstart, h_inode); + if (unlikely(err)) + goto out; + break; + case S_IFDIR: + isdir = 1; + btail = au_dbtaildir(dentry); + inode->i_op = &aufs_dir_iop; + inode->i_fop = &aufs_dir_fop; + break; + case S_IFLNK: + btail = au_dbtail(dentry); + inode->i_op = &aufs_symlink_iop; + break; + case S_IFBLK: + case S_IFCHR: + case S_IFIFO: + case S_IFSOCK: + btail = au_dbtail(dentry); + inode->i_op = &aufs_iop; + init_special_inode(inode, mode, h_inode->i_rdev); + break; + default: + AuIOErr("Unknown file type 0%o\n", mode); + err = -EIO; + goto out; + } + + /* do not set hnotify for whiteouted dirs (SHWH mode) */ + flags = au_hi_flags(inode, isdir); + if (au_opt_test(au_mntflags(dentry->d_sb), SHWH) + && au_ftest_hi(flags, HNOTIFY) + && dentry->d_name.len > AUFS_WH_PFX_LEN + && !memcmp(dentry->d_name.name, AUFS_WH_PFX, AUFS_WH_PFX_LEN)) + au_fclr_hi(flags, HNOTIFY); + iinfo = au_ii(inode); + iinfo->ii_bstart = bstart; + iinfo->ii_bend = btail; + for (bindex = bstart; bindex <= btail; bindex++) { + h_dentry = au_h_dptr(dentry, bindex); + if (h_dentry) + au_set_h_iptr(inode, bindex, + au_igrab(h_dentry->d_inode), flags); + } + au_cpup_attr_all(inode, /*force*/1); + /* + * to force calling aufs_get_acl() every time, + * do not call cache_no_acl() for aufs inode. + */ + +out: + return err; +} + +/* + * successful returns with iinfo write_locked + * minus: errno + * zero: success, matched + * plus: no error, but unmatched + */ +static int reval_inode(struct inode *inode, struct dentry *dentry) +{ + int err; + unsigned int gen; + struct au_iigen iigen; + aufs_bindex_t bindex, bend; + struct inode *h_inode, *h_dinode; + + /* + * before this function, if aufs got any iinfo lock, it must be only + * one, the parent dir. + * it can happen by UDBA and the obsoleted inode number. + */ + err = -EIO; + if (unlikely(inode->i_ino == parent_ino(dentry))) + goto out; + + err = 1; + ii_write_lock_new_child(inode); + h_dinode = au_h_dptr(dentry, au_dbstart(dentry))->d_inode; + bend = au_ibend(inode); + for (bindex = au_ibstart(inode); bindex <= bend; bindex++) { + h_inode = au_h_iptr(inode, bindex); + if (!h_inode || h_inode != h_dinode) + continue; + + err = 0; + gen = au_iigen(inode, &iigen); + if (gen == au_digen(dentry) + && !au_ig_ftest(iigen.ig_flags, HALF_REFRESHED)) + break; + + /* fully refresh inode using dentry */ + err = au_refresh_hinode(inode, dentry); + if (!err) + au_update_iigen(inode, /*half*/0); + break; + } + + if (unlikely(err)) + ii_write_unlock(inode); +out: + return err; +} + +int au_ino(struct super_block *sb, aufs_bindex_t bindex, ino_t h_ino, + unsigned int d_type, ino_t *ino) +{ + int err; + struct mutex *mtx; + + /* prevent hardlinked inode number from race condition */ + mtx = NULL; + if (d_type != DT_DIR) { + mtx = &au_sbr(sb, bindex)->br_xino.xi_nondir_mtx; + mutex_lock(mtx); + } + err = au_xino_read(sb, bindex, h_ino, ino); + if (unlikely(err)) + goto out; + + if (!*ino) { + err = -EIO; + *ino = au_xino_new_ino(sb); + if (unlikely(!*ino)) + goto out; + err = au_xino_write(sb, bindex, h_ino, *ino); + if (unlikely(err)) + goto out; + } + +out: + if (mtx) + mutex_unlock(mtx); + return err; +} + +/* successful returns with iinfo write_locked */ +/* todo: return with unlocked? */ +struct inode *au_new_inode(struct dentry *dentry, int must_new) +{ + struct inode *inode, *h_inode; + struct dentry *h_dentry; + struct super_block *sb; + struct mutex *mtx; + ino_t h_ino, ino; + int err; + aufs_bindex_t bstart; + + sb = dentry->d_sb; + bstart = au_dbstart(dentry); + h_dentry = au_h_dptr(dentry, bstart); + h_inode = h_dentry->d_inode; + h_ino = h_inode->i_ino; + + /* + * stop 'race'-ing between hardlinks under different + * parents. + */ + mtx = NULL; + if (!S_ISDIR(h_inode->i_mode)) + mtx = &au_sbr(sb, bstart)->br_xino.xi_nondir_mtx; + +new_ino: + if (mtx) + mutex_lock(mtx); + err = au_xino_read(sb, bstart, h_ino, &ino); + inode = ERR_PTR(err); + if (unlikely(err)) + goto out; + + if (!ino) { + ino = au_xino_new_ino(sb); + if (unlikely(!ino)) { + inode = ERR_PTR(-EIO); + goto out; + } + } + + AuDbg("i%lu\n", (unsigned long)ino); + inode = au_iget_locked(sb, ino); + err = PTR_ERR(inode); + if (IS_ERR(inode)) + goto out; + + AuDbg("%lx, new %d\n", inode->i_state, !!(inode->i_state & I_NEW)); + if (inode->i_state & I_NEW) { + /* verbose coding for lock class name */ + if (unlikely(S_ISLNK(h_inode->i_mode))) + au_rw_class(&au_ii(inode)->ii_rwsem, + au_lc_key + AuLcSymlink_IIINFO); + else if (unlikely(S_ISDIR(h_inode->i_mode))) + au_rw_class(&au_ii(inode)->ii_rwsem, + au_lc_key + AuLcDir_IIINFO); + else /* likely */ + au_rw_class(&au_ii(inode)->ii_rwsem, + au_lc_key + AuLcNonDir_IIINFO); + + ii_write_lock_new_child(inode); + err = set_inode(inode, dentry); + if (!err) { + unlock_new_inode(inode); + goto out; /* success */ + } + + /* + * iget_failed() calls iput(), but we need to call + * ii_write_unlock() after iget_failed(). so dirty hack for + * i_count. + */ + atomic_inc(&inode->i_count); + iget_failed(inode); + ii_write_unlock(inode); + au_xino_write(sb, bstart, h_ino, /*ino*/0); + /* ignore this error */ + goto out_iput; + } else if (!must_new && !IS_DEADDIR(inode) && inode->i_nlink) { + /* + * horrible race condition between lookup, readdir and copyup + * (or something). + */ + if (mtx) + mutex_unlock(mtx); + err = reval_inode(inode, dentry); + if (unlikely(err < 0)) { + mtx = NULL; + goto out_iput; + } + + if (!err) { + mtx = NULL; + goto out; /* success */ + } else if (mtx) + mutex_lock(mtx); + } + + if (unlikely(au_test_fs_unique_ino(h_dentry->d_inode))) + AuWarn1("Warning: Un-notified UDBA or repeatedly renamed dir," + " b%d, %s, %.*s, hi%lu, i%lu.\n", + bstart, au_sbtype(h_dentry->d_sb), AuDLNPair(dentry), + (unsigned long)h_ino, (unsigned long)ino); + ino = 0; + err = au_xino_write(sb, bstart, h_ino, /*ino*/0); + if (!err) { + iput(inode); + if (mtx) + mutex_unlock(mtx); + goto new_ino; + } + +out_iput: + iput(inode); + inode = ERR_PTR(err); +out: + if (mtx) + mutex_unlock(mtx); + return inode; +} + +/* ---------------------------------------------------------------------- */ + +int au_test_ro(struct super_block *sb, aufs_bindex_t bindex, + struct inode *inode) +{ + int err; + struct inode *hi; + + err = au_br_rdonly(au_sbr(sb, bindex)); + + /* pseudo-link after flushed may happen out of bounds */ + if (!err + && inode + && au_ibstart(inode) <= bindex + && bindex <= au_ibend(inode)) { + /* + * permission check is unnecessary since vfsub routine + * will be called later + */ + hi = au_h_iptr(inode, bindex); + if (hi) + err = IS_IMMUTABLE(hi) ? -EROFS : 0; + } + + return err; +} + +int au_test_h_perm(struct inode *h_inode, int mask) +{ + if (uid_eq(current_fsuid(), GLOBAL_ROOT_UID)) + return 0; + return inode_permission(h_inode, mask); +} + +int au_test_h_perm_sio(struct inode *h_inode, int mask) +{ + if (au_test_nfs(h_inode->i_sb) + && (mask & MAY_WRITE) + && S_ISDIR(h_inode->i_mode)) + mask |= MAY_READ; /* force permission check */ + return au_test_h_perm(h_inode, mask); +} diff --git a/fs/aufs/inode.h b/fs/aufs/inode.h new file mode 100644 index 00000000000000..c058dddea6392d --- /dev/null +++ b/fs/aufs/inode.h @@ -0,0 +1,633 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * inode operations + */ + +#ifndef __AUFS_INODE_H__ +#define __AUFS_INODE_H__ + +#ifdef __KERNEL__ + +#include +#include "rwsem.h" + +struct vfsmount; + +struct au_hnotify { +#ifdef CONFIG_AUFS_HNOTIFY +#ifdef CONFIG_AUFS_HFSNOTIFY + /* never use fsnotify_add_vfsmount_mark() */ + struct fsnotify_mark hn_mark; +#endif + struct inode *hn_aufs_inode; /* no get/put */ +#endif +} ____cacheline_aligned_in_smp; + +struct au_hinode { + struct inode *hi_inode; + aufs_bindex_t hi_id; +#ifdef CONFIG_AUFS_HNOTIFY + struct au_hnotify *hi_notify; +#endif + + /* reference to the copied-up whiteout with get/put */ + struct dentry *hi_whdentry; +}; + +/* ig_flags */ +#define AuIG_HALF_REFRESHED 1 +#define au_ig_ftest(flags, name) ((flags) & AuIG_##name) +#define au_ig_fset(flags, name) \ + do { (flags) |= AuIG_##name; } while (0) +#define au_ig_fclr(flags, name) \ + do { (flags) &= ~AuIG_##name; } while (0) + +struct au_iigen { + __u32 ig_generation, ig_flags; +}; + +struct au_vdir; +struct au_iinfo { + spinlock_t ii_genspin; + struct au_iigen ii_generation; + struct super_block *ii_hsb1; /* no get/put */ + + struct au_rwsem ii_rwsem; + aufs_bindex_t ii_bstart, ii_bend; + __u32 ii_higen; + struct au_hinode *ii_hinode; + struct au_vdir *ii_vdir; +}; + +struct au_icntnr { + struct au_iinfo iinfo; + struct inode vfs_inode; +} ____cacheline_aligned_in_smp; + +/* au_pin flags */ +#define AuPin_DI_LOCKED 1 +#define AuPin_MNT_WRITE (1 << 1) +#define au_ftest_pin(flags, name) ((flags) & AuPin_##name) +#define au_fset_pin(flags, name) \ + do { (flags) |= AuPin_##name; } while (0) +#define au_fclr_pin(flags, name) \ + do { (flags) &= ~AuPin_##name; } while (0) + +struct au_pin { + /* input */ + struct dentry *dentry; + unsigned int udba; + unsigned char lsc_di, lsc_hi, flags; + aufs_bindex_t bindex; + + /* output */ + struct dentry *parent; + struct au_hinode *hdir; + struct vfsmount *h_mnt; + + /* temporary unlock/relock for copyup */ + struct dentry *h_dentry, *h_parent; + struct au_branch *br; + struct task_struct *task; +}; + +void au_pin_hdir_unlock(struct au_pin *p); +int au_pin_hdir_lock(struct au_pin *p); +int au_pin_hdir_relock(struct au_pin *p); +void au_pin_hdir_set_owner(struct au_pin *p, struct task_struct *task); +void au_pin_hdir_acquire_nest(struct au_pin *p); +void au_pin_hdir_release(struct au_pin *p); + +/* ---------------------------------------------------------------------- */ + +static inline struct au_iinfo *au_ii(struct inode *inode) +{ + struct au_iinfo *iinfo; + + iinfo = &(container_of(inode, struct au_icntnr, vfs_inode)->iinfo); + if (iinfo->ii_hinode) + return iinfo; + return NULL; /* debugging bad_inode case */ +} + +/* ---------------------------------------------------------------------- */ + +/* inode.c */ +struct inode *au_igrab(struct inode *inode); +int au_refresh_hinode_self(struct inode *inode); +int au_refresh_hinode(struct inode *inode, struct dentry *dentry); +int au_ino(struct super_block *sb, aufs_bindex_t bindex, ino_t h_ino, + unsigned int d_type, ino_t *ino); +struct inode *au_new_inode(struct dentry *dentry, int must_new); +int au_test_ro(struct super_block *sb, aufs_bindex_t bindex, + struct inode *inode); +int au_test_h_perm(struct inode *h_inode, int mask); +int au_test_h_perm_sio(struct inode *h_inode, int mask); + +static inline int au_wh_ino(struct super_block *sb, aufs_bindex_t bindex, + ino_t h_ino, unsigned int d_type, ino_t *ino) +{ +#ifdef CONFIG_AUFS_SHWH + return au_ino(sb, bindex, h_ino, d_type, ino); +#else + return 0; +#endif +} + +/* i_op.c */ +extern struct inode_operations aufs_iop, aufs_symlink_iop, aufs_dir_iop; + +/* au_wr_dir flags */ +#define AuWrDir_ADD_ENTRY 1 +#define AuWrDir_TMP_WHENTRY (1 << 1) +#define AuWrDir_ISDIR (1 << 2) +#define au_ftest_wrdir(flags, name) ((flags) & AuWrDir_##name) +#define au_fset_wrdir(flags, name) \ + do { (flags) |= AuWrDir_##name; } while (0) +#define au_fclr_wrdir(flags, name) \ + do { (flags) &= ~AuWrDir_##name; } while (0) + +struct au_wr_dir_args { + aufs_bindex_t force_btgt; + unsigned char flags; +}; +int au_wr_dir(struct dentry *dentry, struct dentry *src_dentry, + struct au_wr_dir_args *args); + +struct dentry *au_pinned_h_parent(struct au_pin *pin); +void au_pin_init(struct au_pin *pin, struct dentry *dentry, + aufs_bindex_t bindex, int lsc_di, int lsc_hi, + unsigned int udba, unsigned char flags); +int au_pin(struct au_pin *pin, struct dentry *dentry, aufs_bindex_t bindex, + unsigned int udba, unsigned char flags) __must_check; +int au_do_pin(struct au_pin *pin) __must_check; +void au_unpin(struct au_pin *pin); +int au_reval_for_attr(struct dentry *dentry, unsigned int sigen); + +#define AuIcpup_DID_CPUP 1 +#define au_ftest_icpup(flags, name) ((flags) & AuIcpup_##name) +#define au_fset_icpup(flags, name) \ + do { (flags) |= AuIcpup_##name; } while (0) +#define au_fclr_icpup(flags, name) \ + do { (flags) &= ~AuIcpup_##name; } while (0) + +struct au_icpup_args { + unsigned char flags; + unsigned char pin_flags; + aufs_bindex_t btgt; + unsigned int udba; + struct au_pin pin; + struct path h_path; + struct inode *h_inode; +}; + +int au_pin_and_icpup(struct dentry *dentry, struct iattr *ia, + struct au_icpup_args *a); + +int au_h_path_getattr(struct dentry *dentry, int force, struct path *h_path); + +/* i_op_add.c */ +int au_may_add(struct dentry *dentry, aufs_bindex_t bindex, + struct dentry *h_parent, int isdir); +int aufs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, + dev_t dev); +int aufs_symlink(struct inode *dir, struct dentry *dentry, const char *symname); +int aufs_create(struct inode *dir, struct dentry *dentry, umode_t mode, + bool want_excl); +int aufs_link(struct dentry *src_dentry, struct inode *dir, + struct dentry *dentry); +int aufs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode); + +/* i_op_del.c */ +int au_wr_dir_need_wh(struct dentry *dentry, int isdir, aufs_bindex_t *bcpup); +int au_may_del(struct dentry *dentry, aufs_bindex_t bindex, + struct dentry *h_parent, int isdir); +int aufs_unlink(struct inode *dir, struct dentry *dentry); +int aufs_rmdir(struct inode *dir, struct dentry *dentry); + +/* i_op_ren.c */ +int au_wbr(struct dentry *dentry, aufs_bindex_t btgt); +int aufs_rename(struct inode *src_dir, struct dentry *src_dentry, + struct inode *dir, struct dentry *dentry); + +/* iinfo.c */ +struct inode *au_h_iptr(struct inode *inode, aufs_bindex_t bindex); +void au_hiput(struct au_hinode *hinode); +void au_set_hi_wh(struct inode *inode, aufs_bindex_t bindex, + struct dentry *h_wh); +unsigned int au_hi_flags(struct inode *inode, int isdir); + +/* hinode flags */ +#define AuHi_XINO 1 +#define AuHi_HNOTIFY (1 << 1) +#define au_ftest_hi(flags, name) ((flags) & AuHi_##name) +#define au_fset_hi(flags, name) \ + do { (flags) |= AuHi_##name; } while (0) +#define au_fclr_hi(flags, name) \ + do { (flags) &= ~AuHi_##name; } while (0) + +#ifndef CONFIG_AUFS_HNOTIFY +#undef AuHi_HNOTIFY +#define AuHi_HNOTIFY 0 +#endif + +void au_set_h_iptr(struct inode *inode, aufs_bindex_t bindex, + struct inode *h_inode, unsigned int flags); + +void au_update_iigen(struct inode *inode, int half); +void au_update_ibrange(struct inode *inode, int do_put_zero); + +void au_icntnr_init_once(void *_c); +int au_iinfo_init(struct inode *inode); +void au_iinfo_fin(struct inode *inode); +int au_ii_realloc(struct au_iinfo *iinfo, int nbr); + +#ifdef CONFIG_PROC_FS +/* plink.c */ +int au_plink_maint(struct super_block *sb, int flags); +void au_plink_maint_leave(struct au_sbinfo *sbinfo); +int au_plink_maint_enter(struct super_block *sb); +#ifdef CONFIG_AUFS_DEBUG +void au_plink_list(struct super_block *sb); +#else +AuStubVoid(au_plink_list, struct super_block *sb) +#endif +int au_plink_test(struct inode *inode); +struct dentry *au_plink_lkup(struct inode *inode, aufs_bindex_t bindex); +void au_plink_append(struct inode *inode, aufs_bindex_t bindex, + struct dentry *h_dentry); +void au_plink_put(struct super_block *sb, int verbose); +void au_plink_clean(struct super_block *sb, int verbose); +void au_plink_half_refresh(struct super_block *sb, aufs_bindex_t br_id); +#else +AuStubInt0(au_plink_maint, struct super_block *sb, int flags); +AuStubVoid(au_plink_maint_leave, struct au_sbinfo *sbinfo); +AuStubInt0(au_plink_maint_enter, struct super_block *sb); +AuStubVoid(au_plink_list, struct super_block *sb); +AuStubInt0(au_plink_test, struct inode *inode); +AuStub(struct dentry *, au_plink_lkup, return NULL, + struct inode *inode, aufs_bindex_t bindex); +AuStubVoid(au_plink_append, struct inode *inode, aufs_bindex_t bindex, + struct dentry *h_dentry); +AuStubVoid(au_plink_put, struct super_block *sb, int verbose); +AuStubVoid(au_plink_clean, struct super_block *sb, int verbose); +AuStubVoid(au_plink_half_refresh, struct super_block *sb, aufs_bindex_t br_id); +#endif /* CONFIG_PROC_FS */ + +#ifdef CONFIG_AUFS_XATTR +/* xattr.c */ +int au_cpup_xattr(struct dentry *h_dst, struct dentry *h_src, int ignore_flags); +ssize_t aufs_listxattr(struct dentry *dentry, char *list, size_t size); +ssize_t aufs_getxattr(struct dentry *dentry, const char *name, void *value, + size_t size); +int aufs_setxattr(struct dentry *dentry, const char *name, const void *value, + size_t size, int flags); +int aufs_removexattr(struct dentry *dentry, const char *name); + +/* void au_xattr_init(struct super_block *sb); */ +#else +AuStubInt0(au_cpup_xattr, struct dentry *h_dst, struct dentry *h_src, + int ignore_flags); +/* AuStubVoid(au_xattr_init, struct super_block *sb); */ +#endif + + +/* ---------------------------------------------------------------------- */ + +/* lock subclass for iinfo */ +enum { + AuLsc_II_CHILD, /* child first */ + AuLsc_II_CHILD2, /* rename(2), link(2), and cpup at hnotify */ + AuLsc_II_CHILD3, /* copyup dirs */ + AuLsc_II_PARENT, /* see AuLsc_I_PARENT in vfsub.h */ + AuLsc_II_PARENT2, + AuLsc_II_PARENT3, /* copyup dirs */ + AuLsc_II_NEW_CHILD +}; + +/* + * ii_read_lock_child, ii_write_lock_child, + * ii_read_lock_child2, ii_write_lock_child2, + * ii_read_lock_child3, ii_write_lock_child3, + * ii_read_lock_parent, ii_write_lock_parent, + * ii_read_lock_parent2, ii_write_lock_parent2, + * ii_read_lock_parent3, ii_write_lock_parent3, + * ii_read_lock_new_child, ii_write_lock_new_child, + */ +#define AuReadLockFunc(name, lsc) \ +static inline void ii_read_lock_##name(struct inode *i) \ +{ \ + au_rw_read_lock_nested(&au_ii(i)->ii_rwsem, AuLsc_II_##lsc); \ +} + +#define AuWriteLockFunc(name, lsc) \ +static inline void ii_write_lock_##name(struct inode *i) \ +{ \ + au_rw_write_lock_nested(&au_ii(i)->ii_rwsem, AuLsc_II_##lsc); \ +} + +#define AuRWLockFuncs(name, lsc) \ + AuReadLockFunc(name, lsc) \ + AuWriteLockFunc(name, lsc) + +AuRWLockFuncs(child, CHILD); +AuRWLockFuncs(child2, CHILD2); +AuRWLockFuncs(child3, CHILD3); +AuRWLockFuncs(parent, PARENT); +AuRWLockFuncs(parent2, PARENT2); +AuRWLockFuncs(parent3, PARENT3); +AuRWLockFuncs(new_child, NEW_CHILD); + +#undef AuReadLockFunc +#undef AuWriteLockFunc +#undef AuRWLockFuncs + +/* + * ii_read_unlock, ii_write_unlock, ii_downgrade_lock + */ +AuSimpleUnlockRwsemFuncs(ii, struct inode *i, &au_ii(i)->ii_rwsem); + +#define IiMustNoWaiters(i) AuRwMustNoWaiters(&au_ii(i)->ii_rwsem) +#define IiMustAnyLock(i) AuRwMustAnyLock(&au_ii(i)->ii_rwsem) +#define IiMustWriteLock(i) AuRwMustWriteLock(&au_ii(i)->ii_rwsem) + +/* ---------------------------------------------------------------------- */ + +static inline void au_icntnr_init(struct au_icntnr *c) +{ +#ifdef CONFIG_AUFS_DEBUG + c->vfs_inode.i_mode = 0; +#endif +} + +static inline unsigned int au_iigen(struct inode *inode, struct au_iigen *iigen) +{ + unsigned int gen; + struct au_iinfo *iinfo; + + iinfo = au_ii(inode); + spin_lock(&iinfo->ii_genspin); + if (iigen) + *iigen = iinfo->ii_generation; + gen = iinfo->ii_generation.ig_generation; + spin_unlock(&iinfo->ii_genspin); + + return gen; +} + +/* tiny test for inode number */ +/* tmpfs generation is too rough */ +static inline int au_test_higen(struct inode *inode, struct inode *h_inode) +{ + struct au_iinfo *iinfo; + + iinfo = au_ii(inode); + AuRwMustAnyLock(&iinfo->ii_rwsem); + return !(iinfo->ii_hsb1 == h_inode->i_sb + && iinfo->ii_higen == h_inode->i_generation); +} + +static inline void au_iigen_dec(struct inode *inode) +{ + struct au_iinfo *iinfo; + + iinfo = au_ii(inode); + spin_lock(&iinfo->ii_genspin); + iinfo->ii_generation.ig_generation--; + spin_unlock(&iinfo->ii_genspin); +} + +static inline int au_iigen_test(struct inode *inode, unsigned int sigen) +{ + int err; + + err = 0; + if (unlikely(inode && au_iigen(inode, NULL) != sigen)) + err = -EIO; + + return err; +} + +/* ---------------------------------------------------------------------- */ + +static inline aufs_bindex_t au_ii_br_id(struct inode *inode, + aufs_bindex_t bindex) +{ + IiMustAnyLock(inode); + return au_ii(inode)->ii_hinode[0 + bindex].hi_id; +} + +static inline aufs_bindex_t au_ibstart(struct inode *inode) +{ + IiMustAnyLock(inode); + return au_ii(inode)->ii_bstart; +} + +static inline aufs_bindex_t au_ibend(struct inode *inode) +{ + IiMustAnyLock(inode); + return au_ii(inode)->ii_bend; +} + +static inline struct au_vdir *au_ivdir(struct inode *inode) +{ + IiMustAnyLock(inode); + return au_ii(inode)->ii_vdir; +} + +static inline struct dentry *au_hi_wh(struct inode *inode, aufs_bindex_t bindex) +{ + IiMustAnyLock(inode); + return au_ii(inode)->ii_hinode[0 + bindex].hi_whdentry; +} + +static inline void au_set_ibstart(struct inode *inode, aufs_bindex_t bindex) +{ + IiMustWriteLock(inode); + au_ii(inode)->ii_bstart = bindex; +} + +static inline void au_set_ibend(struct inode *inode, aufs_bindex_t bindex) +{ + IiMustWriteLock(inode); + au_ii(inode)->ii_bend = bindex; +} + +static inline void au_set_ivdir(struct inode *inode, struct au_vdir *vdir) +{ + IiMustWriteLock(inode); + au_ii(inode)->ii_vdir = vdir; +} + +static inline struct au_hinode *au_hi(struct inode *inode, aufs_bindex_t bindex) +{ + IiMustAnyLock(inode); + return au_ii(inode)->ii_hinode + bindex; +} + +/* ---------------------------------------------------------------------- */ + +static inline struct dentry *au_pinned_parent(struct au_pin *pin) +{ + if (pin) + return pin->parent; + return NULL; +} + +static inline struct inode *au_pinned_h_dir(struct au_pin *pin) +{ + if (pin && pin->hdir) + return pin->hdir->hi_inode; + return NULL; +} + +static inline struct au_hinode *au_pinned_hdir(struct au_pin *pin) +{ + if (pin) + return pin->hdir; + return NULL; +} + +static inline void au_pin_set_dentry(struct au_pin *pin, struct dentry *dentry) +{ + if (pin) + pin->dentry = dentry; +} + +static inline void au_pin_set_parent_lflag(struct au_pin *pin, + unsigned char lflag) +{ + if (pin) { + if (lflag) + au_fset_pin(pin->flags, DI_LOCKED); + else + au_fclr_pin(pin->flags, DI_LOCKED); + } +} + +static inline void au_pin_set_parent(struct au_pin *pin, struct dentry *parent) +{ + if (pin) { + dput(pin->parent); + pin->parent = dget(parent); + } +} + +/* ---------------------------------------------------------------------- */ + +struct au_branch; +#ifdef CONFIG_AUFS_HNOTIFY +struct au_hnotify_op { + void (*ctl)(struct au_hinode *hinode, int do_set); + int (*alloc)(struct au_hinode *hinode); + + /* + * if it returns true, the the caller should free hinode->hi_notify, + * otherwise ->free() frees it. + */ + int (*free)(struct au_hinode *hinode, + struct au_hnotify *hn) __must_check; + + void (*fin)(void); + int (*init)(void); + + int (*reset_br)(unsigned int udba, struct au_branch *br, int perm); + void (*fin_br)(struct au_branch *br); + int (*init_br)(struct au_branch *br, int perm); +}; + +/* hnotify.c */ +int au_hn_alloc(struct au_hinode *hinode, struct inode *inode); +void au_hn_free(struct au_hinode *hinode); +void au_hn_ctl(struct au_hinode *hinode, int do_set); +void au_hn_reset(struct inode *inode, unsigned int flags); +int au_hnotify(struct inode *h_dir, struct au_hnotify *hnotify, u32 mask, + struct qstr *h_child_qstr, struct inode *h_child_inode); +int au_hnotify_reset_br(unsigned int udba, struct au_branch *br, int perm); +int au_hnotify_init_br(struct au_branch *br, int perm); +void au_hnotify_fin_br(struct au_branch *br); +int __init au_hnotify_init(void); +void au_hnotify_fin(void); + +/* hfsnotify.c */ +extern const struct au_hnotify_op au_hnotify_op; + +static inline +void au_hn_init(struct au_hinode *hinode) +{ + hinode->hi_notify = NULL; +} + +static inline struct au_hnotify *au_hn(struct au_hinode *hinode) +{ + return hinode->hi_notify; +} + +#else +AuStub(int, au_hn_alloc, return -EOPNOTSUPP, + struct au_hinode *hinode __maybe_unused, + struct inode *inode __maybe_unused) +AuStub(struct au_hnotify *, au_hn, return NULL, struct au_hinode *hinode) +AuStubVoid(au_hn_free, struct au_hinode *hinode __maybe_unused) +AuStubVoid(au_hn_ctl, struct au_hinode *hinode __maybe_unused, + int do_set __maybe_unused) +AuStubVoid(au_hn_reset, struct inode *inode __maybe_unused, + unsigned int flags __maybe_unused) +AuStubInt0(au_hnotify_reset_br, unsigned int udba __maybe_unused, + struct au_branch *br __maybe_unused, + int perm __maybe_unused) +AuStubInt0(au_hnotify_init_br, struct au_branch *br __maybe_unused, + int perm __maybe_unused) +AuStubVoid(au_hnotify_fin_br, struct au_branch *br __maybe_unused) +AuStubInt0(__init au_hnotify_init, void) +AuStubVoid(au_hnotify_fin, void) +AuStubVoid(au_hn_init, struct au_hinode *hinode __maybe_unused) +#endif /* CONFIG_AUFS_HNOTIFY */ + +static inline void au_hn_suspend(struct au_hinode *hdir) +{ + au_hn_ctl(hdir, /*do_set*/0); +} + +static inline void au_hn_resume(struct au_hinode *hdir) +{ + au_hn_ctl(hdir, /*do_set*/1); +} + +static inline void au_hn_imtx_lock(struct au_hinode *hdir) +{ + mutex_lock(&hdir->hi_inode->i_mutex); + au_hn_suspend(hdir); +} + +static inline void au_hn_imtx_lock_nested(struct au_hinode *hdir, + unsigned int sc __maybe_unused) +{ + mutex_lock_nested(&hdir->hi_inode->i_mutex, sc); + au_hn_suspend(hdir); +} + +static inline void au_hn_imtx_unlock(struct au_hinode *hdir) +{ + au_hn_resume(hdir); + mutex_unlock(&hdir->hi_inode->i_mutex); +} + +#endif /* __KERNEL__ */ +#endif /* __AUFS_INODE_H__ */ diff --git a/fs/aufs/ioctl.c b/fs/aufs/ioctl.c new file mode 100644 index 00000000000000..cce07d7fb63782 --- /dev/null +++ b/fs/aufs/ioctl.c @@ -0,0 +1,219 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * ioctl + * plink-management and readdir in userspace. + * assist the pathconf(3) wrapper library. + * move-down + * File-based Hierarchical Storage Management. + */ + +#include +#include +#include "aufs.h" + +static int au_wbr_fd(struct path *path, struct aufs_wbr_fd __user *arg) +{ + int err, fd; + aufs_bindex_t wbi, bindex, bend; + struct file *h_file; + struct super_block *sb; + struct dentry *root; + struct au_branch *br; + struct aufs_wbr_fd wbrfd = { + .oflags = au_dir_roflags, + .brid = -1 + }; + const int valid = O_RDONLY | O_NONBLOCK | O_LARGEFILE | O_DIRECTORY + | O_NOATIME | O_CLOEXEC; + + AuDebugOn(wbrfd.oflags & ~valid); + + if (arg) { + err = copy_from_user(&wbrfd, arg, sizeof(wbrfd)); + if (unlikely(err)) { + err = -EFAULT; + goto out; + } + + err = -EINVAL; + AuDbg("wbrfd{0%o, %d}\n", wbrfd.oflags, wbrfd.brid); + wbrfd.oflags |= au_dir_roflags; + AuDbg("0%o\n", wbrfd.oflags); + if (unlikely(wbrfd.oflags & ~valid)) + goto out; + } + + fd = get_unused_fd(); + err = fd; + if (unlikely(fd < 0)) + goto out; + + h_file = ERR_PTR(-EINVAL); + wbi = 0; + br = NULL; + sb = path->dentry->d_sb; + root = sb->s_root; + aufs_read_lock(root, AuLock_IR); + bend = au_sbend(sb); + if (wbrfd.brid >= 0) { + wbi = au_br_index(sb, wbrfd.brid); + if (unlikely(wbi < 0 || wbi > bend)) + goto out_unlock; + } + + h_file = ERR_PTR(-ENOENT); + br = au_sbr(sb, wbi); + if (!au_br_writable(br->br_perm)) { + if (arg) + goto out_unlock; + + bindex = wbi + 1; + wbi = -1; + for (; bindex <= bend; bindex++) { + br = au_sbr(sb, bindex); + if (au_br_writable(br->br_perm)) { + wbi = bindex; + br = au_sbr(sb, wbi); + break; + } + } + } + AuDbg("wbi %d\n", wbi); + if (wbi >= 0) + h_file = au_h_open(root, wbi, wbrfd.oflags, NULL, + /*force_wr*/0); + +out_unlock: + aufs_read_unlock(root, AuLock_IR); + err = PTR_ERR(h_file); + if (IS_ERR(h_file)) + goto out_fd; + + atomic_dec(&br->br_count); /* cf. au_h_open() */ + fd_install(fd, h_file); + err = fd; + goto out; /* success */ + +out_fd: + put_unused_fd(fd); +out: + AuTraceErr(err); + return err; +} + +/* ---------------------------------------------------------------------- */ + +long aufs_ioctl_dir(struct file *file, unsigned int cmd, unsigned long arg) +{ + long err; + struct dentry *dentry; + + switch (cmd) { + case AUFS_CTL_RDU: + case AUFS_CTL_RDU_INO: + err = au_rdu_ioctl(file, cmd, arg); + break; + + case AUFS_CTL_WBR_FD: + err = au_wbr_fd(&file->f_path, (void __user *)arg); + break; + + case AUFS_CTL_IBUSY: + err = au_ibusy_ioctl(file, arg); + break; + + case AUFS_CTL_BRINFO: + err = au_brinfo_ioctl(file, arg); + break; + + case AUFS_CTL_FHSM_FD: + dentry = file->f_dentry; + if (IS_ROOT(dentry)) + err = au_fhsm_fd(dentry->d_sb, arg); + else + err = -ENOTTY; + break; + + default: + /* do not call the lower */ + AuDbg("0x%x\n", cmd); + err = -ENOTTY; + } + + AuTraceErr(err); + return err; +} + +long aufs_ioctl_nondir(struct file *file, unsigned int cmd, unsigned long arg) +{ + long err; + + switch (cmd) { + case AUFS_CTL_MVDOWN: + err = au_mvdown(file->f_dentry, (void __user *)arg); + break; + + case AUFS_CTL_WBR_FD: + err = au_wbr_fd(&file->f_path, (void __user *)arg); + break; + + default: + /* do not call the lower */ + AuDbg("0x%x\n", cmd); + err = -ENOTTY; + } + + AuTraceErr(err); + return err; +} + +#ifdef CONFIG_COMPAT +long aufs_compat_ioctl_dir(struct file *file, unsigned int cmd, + unsigned long arg) +{ + long err; + + switch (cmd) { + case AUFS_CTL_RDU: + case AUFS_CTL_RDU_INO: + err = au_rdu_compat_ioctl(file, cmd, arg); + break; + + case AUFS_CTL_IBUSY: + err = au_ibusy_compat_ioctl(file, arg); + break; + + case AUFS_CTL_BRINFO: + err = au_brinfo_compat_ioctl(file, arg); + break; + + default: + err = aufs_ioctl_dir(file, cmd, arg); + } + + AuTraceErr(err); + return err; +} + +long aufs_compat_ioctl_nondir(struct file *file, unsigned int cmd, + unsigned long arg) +{ + return aufs_ioctl_nondir(file, cmd, (unsigned long)compat_ptr(arg)); +} +#endif diff --git a/fs/aufs/loop.c b/fs/aufs/loop.c new file mode 100644 index 00000000000000..642df0e8aa1a54 --- /dev/null +++ b/fs/aufs/loop.c @@ -0,0 +1,134 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * support for loopback block device as a branch + */ + +#include +#include "aufs.h" + +/* + * test if two lower dentries have overlapping branches. + */ +int au_test_loopback_overlap(struct super_block *sb, struct dentry *h_adding) +{ + struct super_block *h_sb; + struct loop_device *l; + + h_sb = h_adding->d_sb; + if (MAJOR(h_sb->s_dev) != LOOP_MAJOR) + return 0; + + l = h_sb->s_bdev->bd_disk->private_data; + h_adding = l->lo_backing_file->f_dentry; + /* + * h_adding can be local NFS. + * in this case aufs cannot detect the loop. + */ + if (unlikely(h_adding->d_sb == sb)) + return 1; + return !!au_test_subdir(h_adding, sb->s_root); +} + +/* true if a kernel thread named 'loop[0-9].*' accesses a file */ +int au_test_loopback_kthread(void) +{ + int ret; + struct task_struct *tsk = current; + char c, comm[sizeof(tsk->comm)]; + + ret = 0; + if (tsk->flags & PF_KTHREAD) { + get_task_comm(comm, tsk); + c = comm[4]; + ret = ('0' <= c && c <= '9' + && !strncmp(comm, "loop", 4)); + } + + return ret; +} + +/* ---------------------------------------------------------------------- */ + +#define au_warn_loopback_step 16 +static int au_warn_loopback_nelem = au_warn_loopback_step; +static unsigned long *au_warn_loopback_array; + +void au_warn_loopback(struct super_block *h_sb) +{ + int i, new_nelem; + unsigned long *a, magic; + static DEFINE_SPINLOCK(spin); + + magic = h_sb->s_magic; + spin_lock(&spin); + a = au_warn_loopback_array; + for (i = 0; i < au_warn_loopback_nelem && *a; i++) + if (a[i] == magic) { + spin_unlock(&spin); + return; + } + + /* h_sb is new to us, print it */ + if (i < au_warn_loopback_nelem) { + a[i] = magic; + goto pr; + } + + /* expand the array */ + new_nelem = au_warn_loopback_nelem + au_warn_loopback_step; + a = au_kzrealloc(au_warn_loopback_array, + au_warn_loopback_nelem * sizeof(unsigned long), + new_nelem * sizeof(unsigned long), GFP_ATOMIC); + if (a) { + au_warn_loopback_nelem = new_nelem; + au_warn_loopback_array = a; + a[i] = magic; + goto pr; + } + + spin_unlock(&spin); + AuWarn1("realloc failed, ignored\n"); + return; + +pr: + spin_unlock(&spin); + pr_warn("you may want to try another patch for loopback file " + "on %s(0x%lx) branch\n", au_sbtype(h_sb), magic); +} + +int au_loopback_init(void) +{ + int err; + struct super_block *sb __maybe_unused; + + AuDebugOn(sizeof(sb->s_magic) != sizeof(unsigned long)); + + err = 0; + au_warn_loopback_array = kcalloc(au_warn_loopback_step, + sizeof(unsigned long), GFP_NOFS); + if (unlikely(!au_warn_loopback_array)) + err = -ENOMEM; + + return err; +} + +void au_loopback_fin(void) +{ + kfree(au_warn_loopback_array); +} diff --git a/fs/aufs/loop.h b/fs/aufs/loop.h new file mode 100644 index 00000000000000..db430fe41eb1b0 --- /dev/null +++ b/fs/aufs/loop.h @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * support for loopback mount as a branch + */ + +#ifndef __AUFS_LOOP_H__ +#define __AUFS_LOOP_H__ + +#ifdef __KERNEL__ + +struct dentry; +struct super_block; + +#ifdef CONFIG_AUFS_BDEV_LOOP +/* loop.c */ +int au_test_loopback_overlap(struct super_block *sb, struct dentry *h_adding); +int au_test_loopback_kthread(void); +void au_warn_loopback(struct super_block *h_sb); + +int au_loopback_init(void); +void au_loopback_fin(void); +#else +AuStubInt0(au_test_loopback_overlap, struct super_block *sb, + struct dentry *h_adding) +AuStubInt0(au_test_loopback_kthread, void) +AuStubVoid(au_warn_loopback, struct super_block *h_sb) + +AuStubInt0(au_loopback_init, void) +AuStubVoid(au_loopback_fin, void) +#endif /* BLK_DEV_LOOP */ + +#endif /* __KERNEL__ */ +#endif /* __AUFS_LOOP_H__ */ diff --git a/fs/aufs/magic.mk b/fs/aufs/magic.mk new file mode 100644 index 00000000000000..3e6387b01b497d --- /dev/null +++ b/fs/aufs/magic.mk @@ -0,0 +1,54 @@ + +# defined in ${srctree}/fs/fuse/inode.c +# tristate +ifdef CONFIG_FUSE_FS +ccflags-y += -DFUSE_SUPER_MAGIC=0x65735546 +endif + +# defined in ${srctree}/fs/ocfs2/ocfs2_fs.h +# tristate +ifdef CONFIG_OCFS2_FS +ccflags-y += -DOCFS2_SUPER_MAGIC=0x7461636f +endif + +# defined in ${srctree}/fs/ocfs2/dlm/userdlm.h +# tristate +ifdef CONFIG_OCFS2_FS_O2CB +ccflags-y += -DDLMFS_MAGIC=0x76a9f425 +endif + +# defined in ${srctree}/fs/cifs/cifsfs.c +# tristate +ifdef CONFIG_CIFS_FS +ccflags-y += -DCIFS_MAGIC_NUMBER=0xFF534D42 +endif + +# defined in ${srctree}/fs/xfs/xfs_sb.h +# tristate +ifdef CONFIG_XFS_FS +ccflags-y += -DXFS_SB_MAGIC=0x58465342 +endif + +# defined in ${srctree}/fs/configfs/mount.c +# tristate +ifdef CONFIG_CONFIGFS_FS +ccflags-y += -DCONFIGFS_MAGIC=0x62656570 +endif + +# defined in ${srctree}/fs/9p/v9fs.h +# tristate +ifdef CONFIG_9P_FS +ccflags-y += -DV9FS_MAGIC=0x01021997 +endif + +# defined in ${srctree}/fs/ubifs/ubifs.h +# tristate +ifdef CONFIG_UBIFS_FS +ccflags-y += -DUBIFS_SUPER_MAGIC=0x24051905 +endif + +# defined in ${srctree}/fs/hfsplus/hfsplus_raw.h +# tristate +ifdef CONFIG_HFSPLUS_FS +ccflags-y += -DHFSPLUS_SUPER_MAGIC=0x482b +endif diff --git a/fs/aufs/module.c b/fs/aufs/module.c new file mode 100644 index 00000000000000..5bfb50058c2b11 --- /dev/null +++ b/fs/aufs/module.c @@ -0,0 +1,210 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * module global variables and operations + */ + +#include +#include +#include "aufs.h" + +void *au_kzrealloc(void *p, unsigned int nused, unsigned int new_sz, gfp_t gfp) +{ + if (new_sz <= nused) + return p; + + p = krealloc(p, new_sz, gfp); + if (p) + memset(p + nused, 0, new_sz - nused); + return p; +} + +/* ---------------------------------------------------------------------- */ + +/* + * aufs caches + */ +struct kmem_cache *au_cachep[AuCache_Last]; +static int __init au_cache_init(void) +{ + au_cachep[AuCache_DINFO] = AuCacheCtor(au_dinfo, au_di_init_once); + if (au_cachep[AuCache_DINFO]) + /* SLAB_DESTROY_BY_RCU */ + au_cachep[AuCache_ICNTNR] = AuCacheCtor(au_icntnr, + au_icntnr_init_once); + if (au_cachep[AuCache_ICNTNR]) + au_cachep[AuCache_FINFO] = AuCacheCtor(au_finfo, + au_fi_init_once); + if (au_cachep[AuCache_FINFO]) + au_cachep[AuCache_VDIR] = AuCache(au_vdir); + if (au_cachep[AuCache_VDIR]) + au_cachep[AuCache_DEHSTR] = AuCache(au_vdir_dehstr); + if (au_cachep[AuCache_DEHSTR]) + return 0; + + return -ENOMEM; +} + +static void au_cache_fin(void) +{ + int i; + + /* + * Make sure all delayed rcu free inodes are flushed before we + * destroy cache. + */ + rcu_barrier(); + + /* excluding AuCache_HNOTIFY */ + BUILD_BUG_ON(AuCache_HNOTIFY + 1 != AuCache_Last); + for (i = 0; i < AuCache_HNOTIFY; i++) + if (au_cachep[i]) { + kmem_cache_destroy(au_cachep[i]); + au_cachep[i] = NULL; + } +} + +/* ---------------------------------------------------------------------- */ + +int au_dir_roflags; + +#ifdef CONFIG_AUFS_SBILIST +/* + * iterate_supers_type() doesn't protect us from + * remounting (branch management) + */ +struct au_splhead au_sbilist; +#endif + +struct lock_class_key au_lc_key[AuLcKey_Last]; + +/* + * functions for module interface. + */ +MODULE_LICENSE("GPL"); +/* MODULE_LICENSE("GPL v2"); */ +MODULE_AUTHOR("Junjiro R. Okajima "); +MODULE_DESCRIPTION(AUFS_NAME + " -- Advanced multi layered unification filesystem"); +MODULE_VERSION(AUFS_VERSION); +MODULE_ALIAS_FS(AUFS_NAME); + +/* this module parameter has no meaning when SYSFS is disabled */ +int sysaufs_brs = 1; +MODULE_PARM_DESC(brs, "use /fs/aufs/si_*/brN"); +module_param_named(brs, sysaufs_brs, int, S_IRUGO); + +/* this module parameter has no meaning when USER_NS is disabled */ +static bool au_userns; +MODULE_PARM_DESC(allow_userns, "allow unprivileged to mount under userns"); +module_param_named(allow_userns, au_userns, bool, S_IRUGO); + +/* ---------------------------------------------------------------------- */ + +static char au_esc_chars[0x20 + 3]; /* 0x01-0x20, backslash, del, and NULL */ + +int au_seq_path(struct seq_file *seq, struct path *path) +{ + return seq_path(seq, path, au_esc_chars); +} + +/* ---------------------------------------------------------------------- */ + +static int __init aufs_init(void) +{ + int err, i; + char *p; + + p = au_esc_chars; + for (i = 1; i <= ' '; i++) + *p++ = i; + *p++ = '\\'; + *p++ = '\x7f'; + *p = 0; + + au_dir_roflags = au_file_roflags(O_DIRECTORY | O_LARGEFILE); + + au_sbilist_init(); + sysaufs_brs_init(); + au_debug_init(); + au_dy_init(); + err = sysaufs_init(); + if (unlikely(err)) + goto out; + err = au_procfs_init(); + if (unlikely(err)) + goto out_sysaufs; + err = au_wkq_init(); + if (unlikely(err)) + goto out_procfs; + err = au_loopback_init(); + if (unlikely(err)) + goto out_wkq; + err = au_hnotify_init(); + if (unlikely(err)) + goto out_loopback; + err = au_sysrq_init(); + if (unlikely(err)) + goto out_hin; + err = au_cache_init(); + if (unlikely(err)) + goto out_sysrq; + + aufs_fs_type.fs_flags |= au_userns ? FS_USERNS_MOUNT : 0; + err = register_filesystem(&aufs_fs_type); + if (unlikely(err)) + goto out_cache; + + /* since we define pr_fmt, call printk directly */ + printk(KERN_INFO AUFS_NAME " " AUFS_VERSION "\n"); + goto out; /* success */ + +out_cache: + au_cache_fin(); +out_sysrq: + au_sysrq_fin(); +out_hin: + au_hnotify_fin(); +out_loopback: + au_loopback_fin(); +out_wkq: + au_wkq_fin(); +out_procfs: + au_procfs_fin(); +out_sysaufs: + sysaufs_fin(); + au_dy_fin(); +out: + return err; +} + +static void __exit aufs_exit(void) +{ + unregister_filesystem(&aufs_fs_type); + au_cache_fin(); + au_sysrq_fin(); + au_hnotify_fin(); + au_loopback_fin(); + au_wkq_fin(); + au_procfs_fin(); + sysaufs_fin(); + au_dy_fin(); +} + +module_init(aufs_init); +module_exit(aufs_exit); diff --git a/fs/aufs/module.h b/fs/aufs/module.h new file mode 100644 index 00000000000000..da2fb26a2e4a78 --- /dev/null +++ b/fs/aufs/module.h @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * module initialization and module-global + */ + +#ifndef __AUFS_MODULE_H__ +#define __AUFS_MODULE_H__ + +#ifdef __KERNEL__ + +#include + +struct path; +struct seq_file; + +/* module parameters */ +extern int sysaufs_brs; + +/* ---------------------------------------------------------------------- */ + +extern int au_dir_roflags; + +enum { + AuLcNonDir_FIINFO, + AuLcNonDir_DIINFO, + AuLcNonDir_IIINFO, + + AuLcDir_FIINFO, + AuLcDir_DIINFO, + AuLcDir_IIINFO, + + AuLcSymlink_DIINFO, + AuLcSymlink_IIINFO, + + AuLcKey_Last +}; +extern struct lock_class_key au_lc_key[AuLcKey_Last]; + +void *au_kzrealloc(void *p, unsigned int nused, unsigned int new_sz, gfp_t gfp); +int au_seq_path(struct seq_file *seq, struct path *path); + +#ifdef CONFIG_PROC_FS +/* procfs.c */ +int __init au_procfs_init(void); +void au_procfs_fin(void); +#else +AuStubInt0(au_procfs_init, void); +AuStubVoid(au_procfs_fin, void); +#endif + +/* ---------------------------------------------------------------------- */ + +/* kmem cache */ +enum { + AuCache_DINFO, + AuCache_ICNTNR, + AuCache_FINFO, + AuCache_VDIR, + AuCache_DEHSTR, + AuCache_HNOTIFY, /* must be last */ + AuCache_Last +}; + +#define AuCacheFlags (SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD) +#define AuCache(type) KMEM_CACHE(type, AuCacheFlags) +#define AuCacheCtor(type, ctor) \ + kmem_cache_create(#type, sizeof(struct type), \ + __alignof__(struct type), AuCacheFlags, ctor) + +extern struct kmem_cache *au_cachep[]; + +#define AuCacheFuncs(name, index) \ +static inline struct au_##name *au_cache_alloc_##name(void) \ +{ return kmem_cache_alloc(au_cachep[AuCache_##index], GFP_NOFS); } \ +static inline void au_cache_free_##name(struct au_##name *p) \ +{ kmem_cache_free(au_cachep[AuCache_##index], p); } + +AuCacheFuncs(dinfo, DINFO); +AuCacheFuncs(icntnr, ICNTNR); +AuCacheFuncs(finfo, FINFO); +AuCacheFuncs(vdir, VDIR); +AuCacheFuncs(vdir_dehstr, DEHSTR); +#ifdef CONFIG_AUFS_HNOTIFY +AuCacheFuncs(hnotify, HNOTIFY); +#endif + +#endif /* __KERNEL__ */ +#endif /* __AUFS_MODULE_H__ */ diff --git a/fs/aufs/mvdown.c b/fs/aufs/mvdown.c new file mode 100644 index 00000000000000..b02a262550ad75 --- /dev/null +++ b/fs/aufs/mvdown.c @@ -0,0 +1,680 @@ +/* + * Copyright (C) 2011-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * move-down, opposite of copy-up + */ + +#include "aufs.h" + +struct au_mvd_args { + struct { + struct super_block *h_sb; + struct dentry *h_parent; + struct au_hinode *hdir; + struct inode *h_dir, *h_inode; + struct au_pin pin; + } info[AUFS_MVDOWN_NARRAY]; + + struct aufs_mvdown mvdown; + struct dentry *dentry, *parent; + struct inode *inode, *dir; + struct super_block *sb; + aufs_bindex_t bopq, bwh, bfound; + unsigned char rename_lock; +}; + +#define mvd_errno mvdown.au_errno +#define mvd_bsrc mvdown.stbr[AUFS_MVDOWN_UPPER].bindex +#define mvd_src_brid mvdown.stbr[AUFS_MVDOWN_UPPER].brid +#define mvd_bdst mvdown.stbr[AUFS_MVDOWN_LOWER].bindex +#define mvd_dst_brid mvdown.stbr[AUFS_MVDOWN_LOWER].brid + +#define mvd_h_src_sb info[AUFS_MVDOWN_UPPER].h_sb +#define mvd_h_src_parent info[AUFS_MVDOWN_UPPER].h_parent +#define mvd_hdir_src info[AUFS_MVDOWN_UPPER].hdir +#define mvd_h_src_dir info[AUFS_MVDOWN_UPPER].h_dir +#define mvd_h_src_inode info[AUFS_MVDOWN_UPPER].h_inode +#define mvd_pin_src info[AUFS_MVDOWN_UPPER].pin + +#define mvd_h_dst_sb info[AUFS_MVDOWN_LOWER].h_sb +#define mvd_h_dst_parent info[AUFS_MVDOWN_LOWER].h_parent +#define mvd_hdir_dst info[AUFS_MVDOWN_LOWER].hdir +#define mvd_h_dst_dir info[AUFS_MVDOWN_LOWER].h_dir +#define mvd_h_dst_inode info[AUFS_MVDOWN_LOWER].h_inode +#define mvd_pin_dst info[AUFS_MVDOWN_LOWER].pin + +#define AU_MVD_PR(flag, ...) do { \ + if (flag) \ + pr_err(__VA_ARGS__); \ + } while (0) + +static int find_lower_writable(struct au_mvd_args *a) +{ + struct super_block *sb; + aufs_bindex_t bindex, bend; + struct au_branch *br; + + sb = a->sb; + bindex = a->mvd_bsrc; + bend = au_sbend(sb); + if (a->mvdown.flags & AUFS_MVDOWN_FHSM_LOWER) + for (bindex++; bindex <= bend; bindex++) { + br = au_sbr(sb, bindex); + if (au_br_fhsm(br->br_perm) + && (!(au_br_sb(br)->s_flags & MS_RDONLY))) + return bindex; + } + else if (!(a->mvdown.flags & AUFS_MVDOWN_ROLOWER)) + for (bindex++; bindex <= bend; bindex++) { + br = au_sbr(sb, bindex); + if (!au_br_rdonly(br)) + return bindex; + } + else + for (bindex++; bindex <= bend; bindex++) { + br = au_sbr(sb, bindex); + if (!(au_br_sb(br)->s_flags & MS_RDONLY)) { + if (au_br_rdonly(br)) + a->mvdown.flags + |= AUFS_MVDOWN_ROLOWER_R; + return bindex; + } + } + + return -1; +} + +/* make the parent dir on bdst */ +static int au_do_mkdir(const unsigned char dmsg, struct au_mvd_args *a) +{ + int err; + + err = 0; + a->mvd_hdir_src = au_hi(a->dir, a->mvd_bsrc); + a->mvd_hdir_dst = au_hi(a->dir, a->mvd_bdst); + a->mvd_h_src_parent = au_h_dptr(a->parent, a->mvd_bsrc); + a->mvd_h_dst_parent = NULL; + if (au_dbend(a->parent) >= a->mvd_bdst) + a->mvd_h_dst_parent = au_h_dptr(a->parent, a->mvd_bdst); + if (!a->mvd_h_dst_parent) { + err = au_cpdown_dirs(a->dentry, a->mvd_bdst); + if (unlikely(err)) { + AU_MVD_PR(dmsg, "cpdown_dirs failed\n"); + goto out; + } + a->mvd_h_dst_parent = au_h_dptr(a->parent, a->mvd_bdst); + } + +out: + AuTraceErr(err); + return err; +} + +/* lock them all */ +static int au_do_lock(const unsigned char dmsg, struct au_mvd_args *a) +{ + int err; + struct dentry *h_trap; + + a->mvd_h_src_sb = au_sbr_sb(a->sb, a->mvd_bsrc); + a->mvd_h_dst_sb = au_sbr_sb(a->sb, a->mvd_bdst); + err = au_pin(&a->mvd_pin_dst, a->dentry, a->mvd_bdst, + au_opt_udba(a->sb), + AuPin_MNT_WRITE | AuPin_DI_LOCKED); + AuTraceErr(err); + if (unlikely(err)) { + AU_MVD_PR(dmsg, "pin_dst failed\n"); + goto out; + } + + if (a->mvd_h_src_sb != a->mvd_h_dst_sb) { + a->rename_lock = 0; + au_pin_init(&a->mvd_pin_src, a->dentry, a->mvd_bsrc, + AuLsc_DI_PARENT, AuLsc_I_PARENT3, + au_opt_udba(a->sb), + AuPin_MNT_WRITE | AuPin_DI_LOCKED); + err = au_do_pin(&a->mvd_pin_src); + AuTraceErr(err); + a->mvd_h_src_dir = a->mvd_h_src_parent->d_inode; + if (unlikely(err)) { + AU_MVD_PR(dmsg, "pin_src failed\n"); + goto out_dst; + } + goto out; /* success */ + } + + a->rename_lock = 1; + au_pin_hdir_unlock(&a->mvd_pin_dst); + err = au_pin(&a->mvd_pin_src, a->dentry, a->mvd_bsrc, + au_opt_udba(a->sb), + AuPin_MNT_WRITE | AuPin_DI_LOCKED); + AuTraceErr(err); + a->mvd_h_src_dir = a->mvd_h_src_parent->d_inode; + if (unlikely(err)) { + AU_MVD_PR(dmsg, "pin_src failed\n"); + au_pin_hdir_lock(&a->mvd_pin_dst); + goto out_dst; + } + au_pin_hdir_unlock(&a->mvd_pin_src); + h_trap = vfsub_lock_rename(a->mvd_h_src_parent, a->mvd_hdir_src, + a->mvd_h_dst_parent, a->mvd_hdir_dst); + if (h_trap) { + err = (h_trap != a->mvd_h_src_parent); + if (err) + err = (h_trap != a->mvd_h_dst_parent); + } + BUG_ON(err); /* it should never happen */ + if (unlikely(a->mvd_h_src_dir != au_pinned_h_dir(&a->mvd_pin_src))) { + err = -EBUSY; + AuTraceErr(err); + vfsub_unlock_rename(a->mvd_h_src_parent, a->mvd_hdir_src, + a->mvd_h_dst_parent, a->mvd_hdir_dst); + au_pin_hdir_lock(&a->mvd_pin_src); + au_unpin(&a->mvd_pin_src); + au_pin_hdir_lock(&a->mvd_pin_dst); + goto out_dst; + } + goto out; /* success */ + +out_dst: + au_unpin(&a->mvd_pin_dst); +out: + AuTraceErr(err); + return err; +} + +static void au_do_unlock(const unsigned char dmsg, struct au_mvd_args *a) +{ + if (!a->rename_lock) + au_unpin(&a->mvd_pin_src); + else { + vfsub_unlock_rename(a->mvd_h_src_parent, a->mvd_hdir_src, + a->mvd_h_dst_parent, a->mvd_hdir_dst); + au_pin_hdir_lock(&a->mvd_pin_src); + au_unpin(&a->mvd_pin_src); + au_pin_hdir_lock(&a->mvd_pin_dst); + } + au_unpin(&a->mvd_pin_dst); +} + +/* copy-down the file */ +static int au_do_cpdown(const unsigned char dmsg, struct au_mvd_args *a) +{ + int err; + struct au_cp_generic cpg = { + .dentry = a->dentry, + .bdst = a->mvd_bdst, + .bsrc = a->mvd_bsrc, + .len = -1, + .pin = &a->mvd_pin_dst, + .flags = AuCpup_DTIME | AuCpup_HOPEN + }; + + AuDbg("b%d, b%d\n", cpg.bsrc, cpg.bdst); + if (a->mvdown.flags & AUFS_MVDOWN_OWLOWER) + au_fset_cpup(cpg.flags, OVERWRITE); + if (a->mvdown.flags & AUFS_MVDOWN_ROLOWER) + au_fset_cpup(cpg.flags, RWDST); + err = au_sio_cpdown_simple(&cpg); + if (unlikely(err)) + AU_MVD_PR(dmsg, "cpdown failed\n"); + + AuTraceErr(err); + return err; +} + +/* + * unlink the whiteout on bdst if exist which may be created by UDBA while we + * were sleeping + */ +static int au_do_unlink_wh(const unsigned char dmsg, struct au_mvd_args *a) +{ + int err; + struct path h_path; + struct au_branch *br; + + br = au_sbr(a->sb, a->mvd_bdst); + h_path.dentry = au_wh_lkup(a->mvd_h_dst_parent, &a->dentry->d_name, br); + err = PTR_ERR(h_path.dentry); + if (IS_ERR(h_path.dentry)) { + AU_MVD_PR(dmsg, "wh_lkup failed\n"); + goto out; + } + + err = 0; + if (h_path.dentry->d_inode) { + h_path.mnt = au_br_mnt(br); + err = vfsub_unlink(a->mvd_h_dst_parent->d_inode, &h_path, + /*force*/0); + if (unlikely(err)) + AU_MVD_PR(dmsg, "wh_unlink failed\n"); + } + dput(h_path.dentry); + +out: + AuTraceErr(err); + return err; +} + +/* + * unlink the topmost h_dentry + */ +static int au_do_unlink(const unsigned char dmsg, struct au_mvd_args *a) +{ + int err; + struct path h_path; + + h_path.mnt = au_sbr_mnt(a->sb, a->mvd_bsrc); + h_path.dentry = au_h_dptr(a->dentry, a->mvd_bsrc); + err = vfsub_unlink(a->mvd_h_src_dir, &h_path, /*force*/0); + if (unlikely(err)) + AU_MVD_PR(dmsg, "unlink failed\n"); + + AuTraceErr(err); + return err; +} + +/* Since mvdown succeeded, we ignore an error of this function */ +static void au_do_stfs(const unsigned char dmsg, struct au_mvd_args *a) +{ + int err; + struct au_branch *br; + + a->mvdown.flags |= AUFS_MVDOWN_STFS_FAILED; + br = au_sbr(a->sb, a->mvd_bsrc); + err = au_br_stfs(br, &a->mvdown.stbr[AUFS_MVDOWN_UPPER].stfs); + if (!err) { + br = au_sbr(a->sb, a->mvd_bdst); + a->mvdown.stbr[AUFS_MVDOWN_LOWER].brid = br->br_id; + err = au_br_stfs(br, &a->mvdown.stbr[AUFS_MVDOWN_LOWER].stfs); + } + if (!err) + a->mvdown.flags &= ~AUFS_MVDOWN_STFS_FAILED; + else + AU_MVD_PR(dmsg, "statfs failed (%d), ignored\n", err); +} + +/* + * copy-down the file and unlink the bsrc file. + * - unlink the bdst whout if exist + * - copy-down the file (with whtmp name and rename) + * - unlink the bsrc file + */ +static int au_do_mvdown(const unsigned char dmsg, struct au_mvd_args *a) +{ + int err; + + err = au_do_mkdir(dmsg, a); + if (!err) + err = au_do_lock(dmsg, a); + if (unlikely(err)) + goto out; + + /* + * do not revert the activities we made on bdst since they should be + * harmless in aufs. + */ + + err = au_do_cpdown(dmsg, a); + if (!err) + err = au_do_unlink_wh(dmsg, a); + if (!err && !(a->mvdown.flags & AUFS_MVDOWN_KUPPER)) + err = au_do_unlink(dmsg, a); + if (unlikely(err)) + goto out_unlock; + + AuDbg("%pd2, 0x%x, %d --> %d\n", + a->dentry, a->mvdown.flags, a->mvd_bsrc, a->mvd_bdst); + if (find_lower_writable(a) < 0) + a->mvdown.flags |= AUFS_MVDOWN_BOTTOM; + + if (a->mvdown.flags & AUFS_MVDOWN_STFS) + au_do_stfs(dmsg, a); + + /* maintain internal array */ + if (!(a->mvdown.flags & AUFS_MVDOWN_KUPPER)) { + au_set_h_dptr(a->dentry, a->mvd_bsrc, NULL); + au_set_dbstart(a->dentry, a->mvd_bdst); + au_set_h_iptr(a->inode, a->mvd_bsrc, NULL, /*flags*/0); + au_set_ibstart(a->inode, a->mvd_bdst); + } + if (au_dbend(a->dentry) < a->mvd_bdst) + au_set_dbend(a->dentry, a->mvd_bdst); + if (au_ibend(a->inode) < a->mvd_bdst) + au_set_ibend(a->inode, a->mvd_bdst); + +out_unlock: + au_do_unlock(dmsg, a); +out: + AuTraceErr(err); + return err; +} + +/* ---------------------------------------------------------------------- */ + +/* make sure the file is idle */ +static int au_mvd_args_busy(const unsigned char dmsg, struct au_mvd_args *a) +{ + int err, plinked; + + err = 0; + plinked = !!au_opt_test(au_mntflags(a->sb), PLINK); + if (au_dbstart(a->dentry) == a->mvd_bsrc + && a->dentry->d_count == 1 + && atomic_read(&a->inode->i_count) == 1 + /* && a->mvd_h_src_inode->i_nlink == 1 */ + && (!plinked || !au_plink_test(a->inode)) + && a->inode->i_nlink == 1) + goto out; + + err = -EBUSY; + AU_MVD_PR(dmsg, + "b%d, d{b%d, c%u?}, i{c%d?, l%u}, hi{l%u}, p{%d, %d}\n", + a->mvd_bsrc, au_dbstart(a->dentry), a->dentry->d_count, + atomic_read(&a->inode->i_count), a->inode->i_nlink, + a->mvd_h_src_inode->i_nlink, + plinked, plinked ? au_plink_test(a->inode) : 0); + +out: + AuTraceErr(err); + return err; +} + +/* make sure the parent dir is fine */ +static int au_mvd_args_parent(const unsigned char dmsg, + struct au_mvd_args *a) +{ + int err; + aufs_bindex_t bindex; + + err = 0; + if (unlikely(au_alive_dir(a->parent))) { + err = -ENOENT; + AU_MVD_PR(dmsg, "parent dir is dead\n"); + goto out; + } + + a->bopq = au_dbdiropq(a->parent); + bindex = au_wbr_nonopq(a->dentry, a->mvd_bdst); + AuDbg("b%d\n", bindex); + if (unlikely((bindex >= 0 && bindex < a->mvd_bdst) + || (a->bopq != -1 && a->bopq < a->mvd_bdst))) { + err = -EINVAL; + a->mvd_errno = EAU_MVDOWN_OPAQUE; + AU_MVD_PR(dmsg, "ancestor is opaque b%d, b%d\n", + a->bopq, a->mvd_bdst); + } + +out: + AuTraceErr(err); + return err; +} + +static int au_mvd_args_intermediate(const unsigned char dmsg, + struct au_mvd_args *a) +{ + int err; + struct au_dinfo *dinfo, *tmp; + + /* lookup the next lower positive entry */ + err = -ENOMEM; + tmp = au_di_alloc(a->sb, AuLsc_DI_TMP); + if (unlikely(!tmp)) + goto out; + + a->bfound = -1; + a->bwh = -1; + dinfo = au_di(a->dentry); + au_di_cp(tmp, dinfo); + au_di_swap(tmp, dinfo); + + /* returns the number of positive dentries */ + err = au_lkup_dentry(a->dentry, a->mvd_bsrc + 1, /*type*/0); + if (!err) + a->bwh = au_dbwh(a->dentry); + else if (err > 0) + a->bfound = au_dbstart(a->dentry); + + au_di_swap(tmp, dinfo); + au_rw_write_unlock(&tmp->di_rwsem); + au_di_free(tmp); + if (unlikely(err < 0)) + AU_MVD_PR(dmsg, "failed look-up lower\n"); + + /* + * here, we have these cases. + * bfound == -1 + * no positive dentry under bsrc. there are more sub-cases. + * bwh < 0 + * there no whiteout, we can safely move-down. + * bwh <= bsrc + * impossible + * bsrc < bwh && bwh < bdst + * there is a whiteout on RO branch. cannot proceed. + * bwh == bdst + * there is a whiteout on the RW target branch. it should + * be removed. + * bdst < bwh + * there is a whiteout somewhere unrelated branch. + * -1 < bfound && bfound <= bsrc + * impossible. + * bfound < bdst + * found, but it is on RO branch between bsrc and bdst. cannot + * proceed. + * bfound == bdst + * found, replace it if AUFS_MVDOWN_FORCE is set. otherwise return + * error. + * bdst < bfound + * found, after we create the file on bdst, it will be hidden. + */ + + AuDebugOn(a->bfound == -1 + && a->bwh != -1 + && a->bwh <= a->mvd_bsrc); + AuDebugOn(-1 < a->bfound + && a->bfound <= a->mvd_bsrc); + + err = -EINVAL; + if (a->bfound == -1 + && a->mvd_bsrc < a->bwh + && a->bwh != -1 + && a->bwh < a->mvd_bdst) { + a->mvd_errno = EAU_MVDOWN_WHITEOUT; + AU_MVD_PR(dmsg, "bsrc %d, bdst %d, bfound %d, bwh %d\n", + a->mvd_bsrc, a->mvd_bdst, a->bfound, a->bwh); + goto out; + } else if (a->bfound != -1 && a->bfound < a->mvd_bdst) { + a->mvd_errno = EAU_MVDOWN_UPPER; + AU_MVD_PR(dmsg, "bdst %d, bfound %d\n", + a->mvd_bdst, a->bfound); + goto out; + } + + err = 0; /* success */ + +out: + AuTraceErr(err); + return err; +} + +static int au_mvd_args_exist(const unsigned char dmsg, struct au_mvd_args *a) +{ + int err; + + err = 0; + if (!(a->mvdown.flags & AUFS_MVDOWN_OWLOWER) + && a->bfound == a->mvd_bdst) + err = -EEXIST; + AuTraceErr(err); + return err; +} + +static int au_mvd_args(const unsigned char dmsg, struct au_mvd_args *a) +{ + int err; + struct au_branch *br; + + err = -EISDIR; + if (unlikely(S_ISDIR(a->inode->i_mode))) + goto out; + + err = -EINVAL; + if (!(a->mvdown.flags & AUFS_MVDOWN_BRID_UPPER)) + a->mvd_bsrc = au_ibstart(a->inode); + else { + a->mvd_bsrc = au_br_index(a->sb, a->mvd_src_brid); + if (unlikely(a->mvd_bsrc < 0 + || (a->mvd_bsrc < au_dbstart(a->dentry) + || au_dbend(a->dentry) < a->mvd_bsrc + || !au_h_dptr(a->dentry, a->mvd_bsrc)) + || (a->mvd_bsrc < au_ibstart(a->inode) + || au_ibend(a->inode) < a->mvd_bsrc + || !au_h_iptr(a->inode, a->mvd_bsrc)))) { + a->mvd_errno = EAU_MVDOWN_NOUPPER; + AU_MVD_PR(dmsg, "no upper\n"); + goto out; + } + } + if (unlikely(a->mvd_bsrc == au_sbend(a->sb))) { + a->mvd_errno = EAU_MVDOWN_BOTTOM; + AU_MVD_PR(dmsg, "on the bottom\n"); + goto out; + } + a->mvd_h_src_inode = au_h_iptr(a->inode, a->mvd_bsrc); + br = au_sbr(a->sb, a->mvd_bsrc); + err = au_br_rdonly(br); + if (!(a->mvdown.flags & AUFS_MVDOWN_ROUPPER)) { + if (unlikely(err)) + goto out; + } else if (!(vfsub_native_ro(a->mvd_h_src_inode) + || IS_APPEND(a->mvd_h_src_inode))) { + if (err) + a->mvdown.flags |= AUFS_MVDOWN_ROUPPER_R; + /* go on */ + } else + goto out; + + err = -EINVAL; + if (!(a->mvdown.flags & AUFS_MVDOWN_BRID_LOWER)) { + a->mvd_bdst = find_lower_writable(a); + if (unlikely(a->mvd_bdst < 0)) { + a->mvd_errno = EAU_MVDOWN_BOTTOM; + AU_MVD_PR(dmsg, "no writable lower branch\n"); + goto out; + } + } else { + a->mvd_bdst = au_br_index(a->sb, a->mvd_dst_brid); + if (unlikely(a->mvd_bdst < 0 + || au_sbend(a->sb) < a->mvd_bdst)) { + a->mvd_errno = EAU_MVDOWN_NOLOWERBR; + AU_MVD_PR(dmsg, "no lower brid\n"); + goto out; + } + } + + err = au_mvd_args_busy(dmsg, a); + if (!err) + err = au_mvd_args_parent(dmsg, a); + if (!err) + err = au_mvd_args_intermediate(dmsg, a); + if (!err) + err = au_mvd_args_exist(dmsg, a); + if (!err) + AuDbg("b%d, b%d\n", a->mvd_bsrc, a->mvd_bdst); + +out: + AuTraceErr(err); + return err; +} + +int au_mvdown(struct dentry *dentry, struct aufs_mvdown __user *uarg) +{ + int err, e; + unsigned char dmsg; + struct au_mvd_args *args; + + err = -EPERM; + if (unlikely(!capable(CAP_SYS_ADMIN))) + goto out; + + err = -ENOMEM; + args = kmalloc(sizeof(*args), GFP_NOFS); + if (unlikely(!args)) + goto out; + + err = copy_from_user(&args->mvdown, uarg, sizeof(args->mvdown)); + if (!err) + err = !access_ok(VERIFY_WRITE, uarg, sizeof(*uarg)); + if (unlikely(err)) { + err = -EFAULT; + AuTraceErr(err); + goto out_free; + } + AuDbg("flags 0x%x\n", args->mvdown.flags); + args->mvdown.flags &= ~(AUFS_MVDOWN_ROLOWER_R | AUFS_MVDOWN_ROUPPER_R); + args->mvdown.au_errno = 0; + args->dentry = dentry; + args->inode = dentry->d_inode; + args->sb = dentry->d_sb; + + err = -ENOENT; + dmsg = !!(args->mvdown.flags & AUFS_MVDOWN_DMSG); + args->parent = dget_parent(dentry); + args->dir = args->parent->d_inode; + mutex_lock_nested(&args->dir->i_mutex, I_MUTEX_PARENT); + dput(args->parent); + if (unlikely(args->parent != dentry->d_parent)) { + AU_MVD_PR(dmsg, "parent dir is moved\n"); + goto out_dir; + } + + mutex_lock_nested(&args->inode->i_mutex, I_MUTEX_CHILD); + err = aufs_read_lock(dentry, AuLock_DW | AuLock_FLUSH); + if (unlikely(err)) + goto out_inode; + + di_write_lock_parent(args->parent); + err = au_mvd_args(dmsg, args); + if (unlikely(err)) + goto out_parent; + + err = au_do_mvdown(dmsg, args); + if (unlikely(err)) + goto out_parent; + + au_cpup_attr_timesizes(args->dir); + au_cpup_attr_timesizes(args->inode); + au_cpup_igen(args->inode, au_h_iptr(args->inode, args->mvd_bdst)); + /* au_digen_dec(dentry); */ + +out_parent: + di_write_unlock(args->parent); + aufs_read_unlock(dentry, AuLock_DW); +out_inode: + mutex_unlock(&args->inode->i_mutex); +out_dir: + mutex_unlock(&args->dir->i_mutex); +out_free: + e = copy_to_user(uarg, &args->mvdown, sizeof(args->mvdown)); + if (unlikely(e)) + err = -EFAULT; + kfree(args); +out: + AuTraceErr(err); + return err; +} diff --git a/fs/aufs/opts.c b/fs/aufs/opts.c new file mode 100644 index 00000000000000..22de4471fca950 --- /dev/null +++ b/fs/aufs/opts.c @@ -0,0 +1,1840 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * mount options/flags + */ + +#include +#include /* a distribution requires */ +#include +#include "aufs.h" + +/* ---------------------------------------------------------------------- */ + +enum { + Opt_br, + Opt_add, Opt_del, Opt_mod, Opt_reorder, Opt_append, Opt_prepend, + Opt_idel, Opt_imod, Opt_ireorder, + Opt_dirwh, Opt_rdcache, Opt_rdblk, Opt_rdhash, Opt_rendir, + Opt_rdblk_def, Opt_rdhash_def, + Opt_xino, Opt_zxino, Opt_noxino, + Opt_trunc_xino, Opt_trunc_xino_v, Opt_notrunc_xino, + Opt_trunc_xino_path, Opt_itrunc_xino, + Opt_trunc_xib, Opt_notrunc_xib, + Opt_shwh, Opt_noshwh, + Opt_plink, Opt_noplink, Opt_list_plink, + Opt_udba, + Opt_dio, Opt_nodio, + /* Opt_lock, Opt_unlock, */ + Opt_cmd, Opt_cmd_args, + Opt_diropq_a, Opt_diropq_w, + Opt_warn_perm, Opt_nowarn_perm, + Opt_wbr_copyup, Opt_wbr_create, + Opt_fhsm_sec, + Opt_refrof, Opt_norefrof, + Opt_verbose, Opt_noverbose, + Opt_sum, Opt_nosum, Opt_wsum, + Opt_dirperm1, Opt_nodirperm1, + Opt_acl, Opt_noacl, + Opt_tail, Opt_ignore, Opt_ignore_silent, Opt_err +}; + +static match_table_t options = { + {Opt_br, "br=%s"}, + {Opt_br, "br:%s"}, + + {Opt_add, "add=%d:%s"}, + {Opt_add, "add:%d:%s"}, + {Opt_add, "ins=%d:%s"}, + {Opt_add, "ins:%d:%s"}, + {Opt_append, "append=%s"}, + {Opt_append, "append:%s"}, + {Opt_prepend, "prepend=%s"}, + {Opt_prepend, "prepend:%s"}, + + {Opt_del, "del=%s"}, + {Opt_del, "del:%s"}, + /* {Opt_idel, "idel:%d"}, */ + {Opt_mod, "mod=%s"}, + {Opt_mod, "mod:%s"}, + /* {Opt_imod, "imod:%d:%s"}, */ + + {Opt_dirwh, "dirwh=%d"}, + + {Opt_xino, "xino=%s"}, + {Opt_noxino, "noxino"}, + {Opt_trunc_xino, "trunc_xino"}, + {Opt_trunc_xino_v, "trunc_xino_v=%d:%d"}, + {Opt_notrunc_xino, "notrunc_xino"}, + {Opt_trunc_xino_path, "trunc_xino=%s"}, + {Opt_itrunc_xino, "itrunc_xino=%d"}, + /* {Opt_zxino, "zxino=%s"}, */ + {Opt_trunc_xib, "trunc_xib"}, + {Opt_notrunc_xib, "notrunc_xib"}, + +#ifdef CONFIG_PROC_FS + {Opt_plink, "plink"}, +#else + {Opt_ignore_silent, "plink"}, +#endif + + {Opt_noplink, "noplink"}, + +#ifdef CONFIG_AUFS_DEBUG + {Opt_list_plink, "list_plink"}, +#endif + + {Opt_udba, "udba=%s"}, + + {Opt_dio, "dio"}, + {Opt_nodio, "nodio"}, + +#ifdef CONFIG_AUFS_FHSM + {Opt_fhsm_sec, "fhsm_sec=%d"}, +#else + {Opt_ignore_silent, "fhsm_sec=%d"}, +#endif + + {Opt_diropq_a, "diropq=always"}, + {Opt_diropq_a, "diropq=a"}, + {Opt_diropq_w, "diropq=whiteouted"}, + {Opt_diropq_w, "diropq=w"}, + + {Opt_warn_perm, "warn_perm"}, + {Opt_nowarn_perm, "nowarn_perm"}, + + /* keep them temporary */ + {Opt_ignore_silent, "nodlgt"}, + {Opt_ignore_silent, "clean_plink"}, + +#ifdef CONFIG_AUFS_SHWH + {Opt_shwh, "shwh"}, +#endif + {Opt_noshwh, "noshwh"}, + + {Opt_dirperm1, "dirperm1"}, + {Opt_nodirperm1, "nodirperm1"}, + + {Opt_rendir, "rendir=%d"}, + + {Opt_refrof, "refrof"}, + {Opt_norefrof, "norefrof"}, + + {Opt_verbose, "verbose"}, + {Opt_verbose, "v"}, + {Opt_noverbose, "noverbose"}, + {Opt_noverbose, "quiet"}, + {Opt_noverbose, "q"}, + {Opt_noverbose, "silent"}, + + {Opt_sum, "sum"}, + {Opt_nosum, "nosum"}, + {Opt_wsum, "wsum"}, + + {Opt_rdcache, "rdcache=%d"}, + {Opt_rdblk, "rdblk=%d"}, + {Opt_rdblk_def, "rdblk=def"}, + {Opt_rdhash, "rdhash=%d"}, + {Opt_rdhash_def, "rdhash=def"}, + + {Opt_wbr_create, "create=%s"}, + {Opt_wbr_create, "create_policy=%s"}, + {Opt_wbr_copyup, "cpup=%s"}, + {Opt_wbr_copyup, "copyup=%s"}, + {Opt_wbr_copyup, "copyup_policy=%s"}, + + /* generic VFS flag */ +#ifdef CONFIG_FS_POSIX_ACL + {Opt_acl, "acl"}, + {Opt_noacl, "noacl"}, +#else + {Opt_ignore_silent, "acl"}, + {Opt_ignore_silent, "noacl"}, +#endif + + /* internal use for the scripts */ + {Opt_ignore_silent, "si=%s"}, + + {Opt_br, "dirs=%s"}, + {Opt_ignore, "debug=%d"}, + {Opt_ignore, "delete=whiteout"}, + {Opt_ignore, "delete=all"}, + {Opt_ignore, "imap=%s"}, + + /* temporary workaround, due to old mount(8)? */ + {Opt_ignore_silent, "relatime"}, + + {Opt_err, NULL} +}; + +/* ---------------------------------------------------------------------- */ + +static const char *au_parser_pattern(int val, match_table_t tbl) +{ + struct match_token *p; + + p = tbl; + while (p->pattern) { + if (p->token == val) + return p->pattern; + p++; + } + BUG(); + return "??"; +} + +static const char *au_optstr(int *val, match_table_t tbl) +{ + struct match_token *p; + int v; + + v = *val; + p = tbl; + while (p->token) { + if ((v & p->token) == p->token) { + *val &= ~p->token; + return p->pattern; + } + p++; + } + return NULL; +} + +/* ---------------------------------------------------------------------- */ + +static match_table_t brperm = { + {AuBrPerm_RO, AUFS_BRPERM_RO}, + {AuBrPerm_RR, AUFS_BRPERM_RR}, + {AuBrPerm_RW, AUFS_BRPERM_RW}, + {0, NULL} +}; + +static match_table_t brattr = { + /* general */ + {AuBrAttr_COO_REG, AUFS_BRATTR_COO_REG}, + {AuBrAttr_COO_ALL, AUFS_BRATTR_COO_ALL}, + {AuBrAttr_UNPIN, AUFS_BRATTR_UNPIN}, + {AuBrAttr_FHSM, AUFS_BRATTR_FHSM}, + {AuBrAttr_ICEX, AUFS_BRATTR_ICEX}, + {AuBrAttr_ICEX_SEC, AUFS_BRATTR_ICEX_SEC}, + {AuBrAttr_ICEX_SYS, AUFS_BRATTR_ICEX_SYS}, + {AuBrAttr_ICEX_TR, AUFS_BRATTR_ICEX_TR}, + {AuBrAttr_ICEX_USR, AUFS_BRATTR_ICEX_USR}, + {AuBrAttr_ICEX_OTH, AUFS_BRATTR_ICEX_OTH}, + + /* ro/rr branch */ + {AuBrRAttr_WH, AUFS_BRRATTR_WH}, + + /* rw branch */ + {AuBrWAttr_MOO, AUFS_BRWATTR_MOO}, + {AuBrWAttr_NoLinkWH, AUFS_BRWATTR_NLWH}, + + {0, NULL} +}; + +static int br_attr_val(char *str, match_table_t table, substring_t args[]) +{ + int attr, v; + char *p; + + attr = 0; + do { + p = strchr(str, '+'); + if (p) + *p = 0; + v = match_token(str, table, args); + if (v) { + if (v & AuBrAttr_CMOO_Mask) + attr &= ~AuBrAttr_CMOO_Mask; + attr |= v; + } else { + if (p) + *p = '+'; + pr_warn("ignored branch attribute %s\n", str); + break; + } + if (p) + str = p + 1; + } while (p); + + return attr; +} + +static int au_do_optstr_br_attr(au_br_perm_str_t *str, int perm) +{ + int sz; + const char *p; + char *q; + + q = str->a; + *q = 0; + p = au_optstr(&perm, brattr); + if (p) { + sz = strlen(p); + memcpy(q, p, sz + 1); + q += sz; + } else + goto out; + + do { + p = au_optstr(&perm, brattr); + if (p) { + *q++ = '+'; + sz = strlen(p); + memcpy(q, p, sz + 1); + q += sz; + } + } while (p); + +out: + return q - str->a; +} + +static int noinline_for_stack br_perm_val(char *perm) +{ + int val, bad, sz; + char *p; + substring_t args[MAX_OPT_ARGS]; + au_br_perm_str_t attr; + + p = strchr(perm, '+'); + if (p) + *p = 0; + val = match_token(perm, brperm, args); + if (!val) { + if (p) + *p = '+'; + pr_warn("ignored branch permission %s\n", perm); + val = AuBrPerm_RO; + goto out; + } + if (!p) + goto out; + + val |= br_attr_val(p + 1, brattr, args); + + bad = 0; + switch (val & AuBrPerm_Mask) { + case AuBrPerm_RO: + case AuBrPerm_RR: + bad = val & AuBrWAttr_Mask; + val &= ~AuBrWAttr_Mask; + break; + case AuBrPerm_RW: + bad = val & AuBrRAttr_Mask; + val &= ~AuBrRAttr_Mask; + break; + } + if (unlikely(bad)) { + sz = au_do_optstr_br_attr(&attr, bad); + AuDebugOn(!sz); + pr_warn("ignored branch attribute %s\n", attr.a); + } + +out: + return val; +} + +void au_optstr_br_perm(au_br_perm_str_t *str, int perm) +{ + au_br_perm_str_t attr; + const char *p; + char *q; + int sz; + + q = str->a; + p = au_optstr(&perm, brperm); + AuDebugOn(!p || !*p); + sz = strlen(p); + memcpy(q, p, sz + 1); + q += sz; + + sz = au_do_optstr_br_attr(&attr, perm); + if (sz) { + *q++ = '+'; + memcpy(q, attr.a, sz + 1); + } + + AuDebugOn(strlen(str->a) >= sizeof(str->a)); +} + +/* ---------------------------------------------------------------------- */ + +static match_table_t udbalevel = { + {AuOpt_UDBA_REVAL, "reval"}, + {AuOpt_UDBA_NONE, "none"}, +#ifdef CONFIG_AUFS_HNOTIFY + {AuOpt_UDBA_HNOTIFY, "notify"}, /* abstraction */ +#ifdef CONFIG_AUFS_HFSNOTIFY + {AuOpt_UDBA_HNOTIFY, "fsnotify"}, +#endif +#endif + {-1, NULL} +}; + +static int noinline_for_stack udba_val(char *str) +{ + substring_t args[MAX_OPT_ARGS]; + + return match_token(str, udbalevel, args); +} + +const char *au_optstr_udba(int udba) +{ + return au_parser_pattern(udba, udbalevel); +} + +/* ---------------------------------------------------------------------- */ + +static match_table_t au_wbr_create_policy = { + {AuWbrCreate_TDP, "tdp"}, + {AuWbrCreate_TDP, "top-down-parent"}, + {AuWbrCreate_RR, "rr"}, + {AuWbrCreate_RR, "round-robin"}, + {AuWbrCreate_MFS, "mfs"}, + {AuWbrCreate_MFS, "most-free-space"}, + {AuWbrCreate_MFSV, "mfs:%d"}, + {AuWbrCreate_MFSV, "most-free-space:%d"}, + + {AuWbrCreate_MFSRR, "mfsrr:%d"}, + {AuWbrCreate_MFSRRV, "mfsrr:%d:%d"}, + {AuWbrCreate_PMFS, "pmfs"}, + {AuWbrCreate_PMFSV, "pmfs:%d"}, + {AuWbrCreate_PMFSRR, "pmfsrr:%d"}, + {AuWbrCreate_PMFSRRV, "pmfsrr:%d:%d"}, + + {-1, NULL} +}; + +/* + * cf. linux/lib/parser.c and cmdline.c + * gave up calling memparse() since it uses simple_strtoull() instead of + * kstrto...(). + */ +static int noinline_for_stack +au_match_ull(substring_t *s, unsigned long long *result) +{ + int err; + unsigned int len; + char a[32]; + + err = -ERANGE; + len = s->to - s->from; + if (len + 1 <= sizeof(a)) { + memcpy(a, s->from, len); + a[len] = '\0'; + err = kstrtoull(a, 0, result); + } + return err; +} + +static int au_wbr_mfs_wmark(substring_t *arg, char *str, + struct au_opt_wbr_create *create) +{ + int err; + unsigned long long ull; + + err = 0; + if (!au_match_ull(arg, &ull)) + create->mfsrr_watermark = ull; + else { + pr_err("bad integer in %s\n", str); + err = -EINVAL; + } + + return err; +} + +static int au_wbr_mfs_sec(substring_t *arg, char *str, + struct au_opt_wbr_create *create) +{ + int n, err; + + err = 0; + if (!match_int(arg, &n) && 0 <= n && n <= AUFS_MFS_MAX_SEC) + create->mfs_second = n; + else { + pr_err("bad integer in %s\n", str); + err = -EINVAL; + } + + return err; +} + +static int noinline_for_stack +au_wbr_create_val(char *str, struct au_opt_wbr_create *create) +{ + int err, e; + substring_t args[MAX_OPT_ARGS]; + + err = match_token(str, au_wbr_create_policy, args); + create->wbr_create = err; + switch (err) { + case AuWbrCreate_MFSRRV: + case AuWbrCreate_PMFSRRV: + e = au_wbr_mfs_wmark(&args[0], str, create); + if (!e) + e = au_wbr_mfs_sec(&args[1], str, create); + if (unlikely(e)) + err = e; + break; + case AuWbrCreate_MFSRR: + case AuWbrCreate_PMFSRR: + e = au_wbr_mfs_wmark(&args[0], str, create); + if (unlikely(e)) { + err = e; + break; + } + /*FALLTHROUGH*/ + case AuWbrCreate_MFS: + case AuWbrCreate_PMFS: + create->mfs_second = AUFS_MFS_DEF_SEC; + break; + case AuWbrCreate_MFSV: + case AuWbrCreate_PMFSV: + e = au_wbr_mfs_sec(&args[0], str, create); + if (unlikely(e)) + err = e; + break; + } + + return err; +} + +const char *au_optstr_wbr_create(int wbr_create) +{ + return au_parser_pattern(wbr_create, au_wbr_create_policy); +} + +static match_table_t au_wbr_copyup_policy = { + {AuWbrCopyup_TDP, "tdp"}, + {AuWbrCopyup_TDP, "top-down-parent"}, + {AuWbrCopyup_BUP, "bup"}, + {AuWbrCopyup_BUP, "bottom-up-parent"}, + {AuWbrCopyup_BU, "bu"}, + {AuWbrCopyup_BU, "bottom-up"}, + {-1, NULL} +}; + +static int noinline_for_stack au_wbr_copyup_val(char *str) +{ + substring_t args[MAX_OPT_ARGS]; + + return match_token(str, au_wbr_copyup_policy, args); +} + +const char *au_optstr_wbr_copyup(int wbr_copyup) +{ + return au_parser_pattern(wbr_copyup, au_wbr_copyup_policy); +} + +/* ---------------------------------------------------------------------- */ + +static const int lkup_dirflags = LOOKUP_FOLLOW | LOOKUP_DIRECTORY; + +static void dump_opts(struct au_opts *opts) +{ +#ifdef CONFIG_AUFS_DEBUG + /* reduce stack space */ + union { + struct au_opt_add *add; + struct au_opt_del *del; + struct au_opt_mod *mod; + struct au_opt_xino *xino; + struct au_opt_xino_itrunc *xino_itrunc; + struct au_opt_wbr_create *create; + } u; + struct au_opt *opt; + + opt = opts->opt; + while (opt->type != Opt_tail) { + switch (opt->type) { + case Opt_add: + u.add = &opt->add; + AuDbg("add {b%d, %s, 0x%x, %p}\n", + u.add->bindex, u.add->pathname, u.add->perm, + u.add->path.dentry); + break; + case Opt_del: + case Opt_idel: + u.del = &opt->del; + AuDbg("del {%s, %p}\n", + u.del->pathname, u.del->h_path.dentry); + break; + case Opt_mod: + case Opt_imod: + u.mod = &opt->mod; + AuDbg("mod {%s, 0x%x, %p}\n", + u.mod->path, u.mod->perm, u.mod->h_root); + break; + case Opt_append: + u.add = &opt->add; + AuDbg("append {b%d, %s, 0x%x, %p}\n", + u.add->bindex, u.add->pathname, u.add->perm, + u.add->path.dentry); + break; + case Opt_prepend: + u.add = &opt->add; + AuDbg("prepend {b%d, %s, 0x%x, %p}\n", + u.add->bindex, u.add->pathname, u.add->perm, + u.add->path.dentry); + break; + case Opt_dirwh: + AuDbg("dirwh %d\n", opt->dirwh); + break; + case Opt_rdcache: + AuDbg("rdcache %d\n", opt->rdcache); + break; + case Opt_rdblk: + AuDbg("rdblk %u\n", opt->rdblk); + break; + case Opt_rdblk_def: + AuDbg("rdblk_def\n"); + break; + case Opt_rdhash: + AuDbg("rdhash %u\n", opt->rdhash); + break; + case Opt_rdhash_def: + AuDbg("rdhash_def\n"); + break; + case Opt_xino: + u.xino = &opt->xino; + AuDbg("xino {%s %.*s}\n", + u.xino->path, + AuDLNPair(u.xino->file->f_dentry)); + break; + case Opt_trunc_xino: + AuLabel(trunc_xino); + break; + case Opt_notrunc_xino: + AuLabel(notrunc_xino); + break; + case Opt_trunc_xino_path: + case Opt_itrunc_xino: + u.xino_itrunc = &opt->xino_itrunc; + AuDbg("trunc_xino %d\n", u.xino_itrunc->bindex); + break; + + case Opt_noxino: + AuLabel(noxino); + break; + case Opt_trunc_xib: + AuLabel(trunc_xib); + break; + case Opt_notrunc_xib: + AuLabel(notrunc_xib); + break; + case Opt_shwh: + AuLabel(shwh); + break; + case Opt_noshwh: + AuLabel(noshwh); + break; + case Opt_dirperm1: + AuLabel(dirperm1); + break; + case Opt_nodirperm1: + AuLabel(nodirperm1); + break; + case Opt_plink: + AuLabel(plink); + break; + case Opt_noplink: + AuLabel(noplink); + break; + case Opt_list_plink: + AuLabel(list_plink); + break; + case Opt_udba: + AuDbg("udba %d, %s\n", + opt->udba, au_optstr_udba(opt->udba)); + break; + case Opt_dio: + AuLabel(dio); + break; + case Opt_nodio: + AuLabel(nodio); + break; + case Opt_diropq_a: + AuLabel(diropq_a); + break; + case Opt_diropq_w: + AuLabel(diropq_w); + break; + case Opt_warn_perm: + AuLabel(warn_perm); + break; + case Opt_nowarn_perm: + AuLabel(nowarn_perm); + break; + case Opt_refrof: + AuLabel(refrof); + break; + case Opt_norefrof: + AuLabel(norefrof); + break; + case Opt_verbose: + AuLabel(verbose); + break; + case Opt_noverbose: + AuLabel(noverbose); + break; + case Opt_sum: + AuLabel(sum); + break; + case Opt_nosum: + AuLabel(nosum); + break; + case Opt_wsum: + AuLabel(wsum); + break; + case Opt_wbr_create: + u.create = &opt->wbr_create; + AuDbg("create %d, %s\n", u.create->wbr_create, + au_optstr_wbr_create(u.create->wbr_create)); + switch (u.create->wbr_create) { + case AuWbrCreate_MFSV: + case AuWbrCreate_PMFSV: + AuDbg("%d sec\n", u.create->mfs_second); + break; + case AuWbrCreate_MFSRR: + AuDbg("%llu watermark\n", + u.create->mfsrr_watermark); + break; + case AuWbrCreate_MFSRRV: + case AuWbrCreate_PMFSRRV: + AuDbg("%llu watermark, %d sec\n", + u.create->mfsrr_watermark, + u.create->mfs_second); + break; + } + break; + case Opt_wbr_copyup: + AuDbg("copyup %d, %s\n", opt->wbr_copyup, + au_optstr_wbr_copyup(opt->wbr_copyup)); + break; + case Opt_fhsm_sec: + AuDbg("fhsm_sec %u\n", opt->fhsm_second); + break; + case Opt_acl: + AuLabel(acl); + break; + case Opt_noacl: + AuLabel(noacl); + break; + default: + BUG(); + } + opt++; + } +#endif +} + +void au_opts_free(struct au_opts *opts) +{ + struct au_opt *opt; + + opt = opts->opt; + while (opt->type != Opt_tail) { + switch (opt->type) { + case Opt_add: + case Opt_append: + case Opt_prepend: + path_put(&opt->add.path); + break; + case Opt_del: + case Opt_idel: + path_put(&opt->del.h_path); + break; + case Opt_mod: + case Opt_imod: + dput(opt->mod.h_root); + break; + case Opt_xino: + fput(opt->xino.file); + break; + } + opt++; + } +} + +static int opt_add(struct au_opt *opt, char *opt_str, unsigned long sb_flags, + aufs_bindex_t bindex) +{ + int err; + struct au_opt_add *add = &opt->add; + char *p; + + add->bindex = bindex; + add->perm = AuBrPerm_RO; + add->pathname = opt_str; + p = strchr(opt_str, '='); + if (p) { + *p++ = 0; + if (*p) + add->perm = br_perm_val(p); + } + + err = vfsub_kern_path(add->pathname, lkup_dirflags, &add->path); + if (!err) { + if (!p) { + add->perm = AuBrPerm_RO; + if (au_test_fs_rr(add->path.dentry->d_sb)) + add->perm = AuBrPerm_RR; + else if (!bindex && !(sb_flags & MS_RDONLY)) + add->perm = AuBrPerm_RW; + } + opt->type = Opt_add; + goto out; + } + pr_err("lookup failed %s (%d)\n", add->pathname, err); + err = -EINVAL; + +out: + return err; +} + +static int au_opts_parse_del(struct au_opt_del *del, substring_t args[]) +{ + int err; + + del->pathname = args[0].from; + AuDbg("del path %s\n", del->pathname); + + err = vfsub_kern_path(del->pathname, lkup_dirflags, &del->h_path); + if (unlikely(err)) + pr_err("lookup failed %s (%d)\n", del->pathname, err); + + return err; +} + +#if 0 /* reserved for future use */ +static int au_opts_parse_idel(struct super_block *sb, aufs_bindex_t bindex, + struct au_opt_del *del, substring_t args[]) +{ + int err; + struct dentry *root; + + err = -EINVAL; + root = sb->s_root; + aufs_read_lock(root, AuLock_FLUSH); + if (bindex < 0 || au_sbend(sb) < bindex) { + pr_err("out of bounds, %d\n", bindex); + goto out; + } + + err = 0; + del->h_path.dentry = dget(au_h_dptr(root, bindex)); + del->h_path.mnt = mntget(au_sbr_mnt(sb, bindex)); + +out: + aufs_read_unlock(root, !AuLock_IR); + return err; +} +#endif + +static int noinline_for_stack +au_opts_parse_mod(struct au_opt_mod *mod, substring_t args[]) +{ + int err; + struct path path; + char *p; + + err = -EINVAL; + mod->path = args[0].from; + p = strchr(mod->path, '='); + if (unlikely(!p)) { + pr_err("no permssion %s\n", args[0].from); + goto out; + } + + *p++ = 0; + err = vfsub_kern_path(mod->path, lkup_dirflags, &path); + if (unlikely(err)) { + pr_err("lookup failed %s (%d)\n", mod->path, err); + goto out; + } + + mod->perm = br_perm_val(p); + AuDbg("mod path %s, perm 0x%x, %s\n", mod->path, mod->perm, p); + mod->h_root = dget(path.dentry); + path_put(&path); + +out: + return err; +} + +#if 0 /* reserved for future use */ +static int au_opts_parse_imod(struct super_block *sb, aufs_bindex_t bindex, + struct au_opt_mod *mod, substring_t args[]) +{ + int err; + struct dentry *root; + + err = -EINVAL; + root = sb->s_root; + aufs_read_lock(root, AuLock_FLUSH); + if (bindex < 0 || au_sbend(sb) < bindex) { + pr_err("out of bounds, %d\n", bindex); + goto out; + } + + err = 0; + mod->perm = br_perm_val(args[1].from); + AuDbg("mod path %s, perm 0x%x, %s\n", + mod->path, mod->perm, args[1].from); + mod->h_root = dget(au_h_dptr(root, bindex)); + +out: + aufs_read_unlock(root, !AuLock_IR); + return err; +} +#endif + +static int au_opts_parse_xino(struct super_block *sb, struct au_opt_xino *xino, + substring_t args[]) +{ + int err; + struct file *file; + + file = au_xino_create(sb, args[0].from, /*silent*/0); + err = PTR_ERR(file); + if (IS_ERR(file)) + goto out; + + err = -EINVAL; + if (unlikely(file->f_dentry->d_sb == sb)) { + fput(file); + pr_err("%s must be outside\n", args[0].from); + goto out; + } + + err = 0; + xino->file = file; + xino->path = args[0].from; + +out: + return err; +} + +static int noinline_for_stack +au_opts_parse_xino_itrunc_path(struct super_block *sb, + struct au_opt_xino_itrunc *xino_itrunc, + substring_t args[]) +{ + int err; + aufs_bindex_t bend, bindex; + struct path path; + struct dentry *root; + + err = vfsub_kern_path(args[0].from, lkup_dirflags, &path); + if (unlikely(err)) { + pr_err("lookup failed %s (%d)\n", args[0].from, err); + goto out; + } + + xino_itrunc->bindex = -1; + root = sb->s_root; + aufs_read_lock(root, AuLock_FLUSH); + bend = au_sbend(sb); + for (bindex = 0; bindex <= bend; bindex++) { + if (au_h_dptr(root, bindex) == path.dentry) { + xino_itrunc->bindex = bindex; + break; + } + } + aufs_read_unlock(root, !AuLock_IR); + path_put(&path); + + if (unlikely(xino_itrunc->bindex < 0)) { + pr_err("no such branch %s\n", args[0].from); + err = -EINVAL; + } + +out: + return err; +} + +/* called without aufs lock */ +int au_opts_parse(struct super_block *sb, char *str, struct au_opts *opts) +{ + int err, n, token; + aufs_bindex_t bindex; + unsigned char skipped; + struct dentry *root; + struct au_opt *opt, *opt_tail; + char *opt_str; + /* reduce the stack space */ + union { + struct au_opt_xino_itrunc *xino_itrunc; + struct au_opt_wbr_create *create; + } u; + struct { + substring_t args[MAX_OPT_ARGS]; + } *a; + + err = -ENOMEM; + a = kmalloc(sizeof(*a), GFP_NOFS); + if (unlikely(!a)) + goto out; + + root = sb->s_root; + err = 0; + bindex = 0; + opt = opts->opt; + opt_tail = opt + opts->max_opt - 1; + opt->type = Opt_tail; + while (!err && (opt_str = strsep(&str, ",")) && *opt_str) { + err = -EINVAL; + skipped = 0; + token = match_token(opt_str, options, a->args); + switch (token) { + case Opt_br: + err = 0; + while (!err && (opt_str = strsep(&a->args[0].from, ":")) + && *opt_str) { + err = opt_add(opt, opt_str, opts->sb_flags, + bindex++); + if (unlikely(!err && ++opt > opt_tail)) { + err = -E2BIG; + break; + } + opt->type = Opt_tail; + skipped = 1; + } + break; + case Opt_add: + if (unlikely(match_int(&a->args[0], &n))) { + pr_err("bad integer in %s\n", opt_str); + break; + } + bindex = n; + err = opt_add(opt, a->args[1].from, opts->sb_flags, + bindex); + if (!err) + opt->type = token; + break; + case Opt_append: + err = opt_add(opt, a->args[0].from, opts->sb_flags, + /*dummy bindex*/1); + if (!err) + opt->type = token; + break; + case Opt_prepend: + err = opt_add(opt, a->args[0].from, opts->sb_flags, + /*bindex*/0); + if (!err) + opt->type = token; + break; + case Opt_del: + err = au_opts_parse_del(&opt->del, a->args); + if (!err) + opt->type = token; + break; +#if 0 /* reserved for future use */ + case Opt_idel: + del->pathname = "(indexed)"; + if (unlikely(match_int(&args[0], &n))) { + pr_err("bad integer in %s\n", opt_str); + break; + } + err = au_opts_parse_idel(sb, n, &opt->del, a->args); + if (!err) + opt->type = token; + break; +#endif + case Opt_mod: + err = au_opts_parse_mod(&opt->mod, a->args); + if (!err) + opt->type = token; + break; +#ifdef IMOD /* reserved for future use */ + case Opt_imod: + u.mod->path = "(indexed)"; + if (unlikely(match_int(&a->args[0], &n))) { + pr_err("bad integer in %s\n", opt_str); + break; + } + err = au_opts_parse_imod(sb, n, &opt->mod, a->args); + if (!err) + opt->type = token; + break; +#endif + case Opt_xino: + err = au_opts_parse_xino(sb, &opt->xino, a->args); + if (!err) + opt->type = token; + break; + + case Opt_trunc_xino_path: + err = au_opts_parse_xino_itrunc_path + (sb, &opt->xino_itrunc, a->args); + if (!err) + opt->type = token; + break; + + case Opt_itrunc_xino: + u.xino_itrunc = &opt->xino_itrunc; + if (unlikely(match_int(&a->args[0], &n))) { + pr_err("bad integer in %s\n", opt_str); + break; + } + u.xino_itrunc->bindex = n; + aufs_read_lock(root, AuLock_FLUSH); + if (n < 0 || au_sbend(sb) < n) { + pr_err("out of bounds, %d\n", n); + aufs_read_unlock(root, !AuLock_IR); + break; + } + aufs_read_unlock(root, !AuLock_IR); + err = 0; + opt->type = token; + break; + + case Opt_dirwh: + if (unlikely(match_int(&a->args[0], &opt->dirwh))) + break; + err = 0; + opt->type = token; + break; + + case Opt_rdcache: + if (unlikely(match_int(&a->args[0], &n))) { + pr_err("bad integer in %s\n", opt_str); + break; + } + if (unlikely(n > AUFS_RDCACHE_MAX)) { + pr_err("rdcache must be smaller than %d\n", + AUFS_RDCACHE_MAX); + break; + } + opt->rdcache = n; + err = 0; + opt->type = token; + break; + case Opt_rdblk: + if (unlikely(match_int(&a->args[0], &n) + || n < 0 + || n > KMALLOC_MAX_SIZE)) { + pr_err("bad integer in %s\n", opt_str); + break; + } + if (unlikely(n && n < NAME_MAX)) { + pr_err("rdblk must be larger than %d\n", + NAME_MAX); + break; + } + opt->rdblk = n; + err = 0; + opt->type = token; + break; + case Opt_rdhash: + if (unlikely(match_int(&a->args[0], &n) + || n < 0 + || n * sizeof(struct hlist_head) + > KMALLOC_MAX_SIZE)) { + pr_err("bad integer in %s\n", opt_str); + break; + } + opt->rdhash = n; + err = 0; + opt->type = token; + break; + + case Opt_trunc_xino: + case Opt_notrunc_xino: + case Opt_noxino: + case Opt_trunc_xib: + case Opt_notrunc_xib: + case Opt_shwh: + case Opt_noshwh: + case Opt_dirperm1: + case Opt_nodirperm1: + case Opt_plink: + case Opt_noplink: + case Opt_list_plink: + case Opt_dio: + case Opt_nodio: + case Opt_diropq_a: + case Opt_diropq_w: + case Opt_warn_perm: + case Opt_nowarn_perm: + case Opt_refrof: + case Opt_norefrof: + case Opt_verbose: + case Opt_noverbose: + case Opt_sum: + case Opt_nosum: + case Opt_wsum: + case Opt_rdblk_def: + case Opt_rdhash_def: + case Opt_acl: + case Opt_noacl: + err = 0; + opt->type = token; + break; + + case Opt_udba: + opt->udba = udba_val(a->args[0].from); + if (opt->udba >= 0) { + err = 0; + opt->type = token; + } else + pr_err("wrong value, %s\n", opt_str); + break; + + case Opt_wbr_create: + u.create = &opt->wbr_create; + u.create->wbr_create + = au_wbr_create_val(a->args[0].from, u.create); + if (u.create->wbr_create >= 0) { + err = 0; + opt->type = token; + } else + pr_err("wrong value, %s\n", opt_str); + break; + case Opt_wbr_copyup: + opt->wbr_copyup = au_wbr_copyup_val(a->args[0].from); + if (opt->wbr_copyup >= 0) { + err = 0; + opt->type = token; + } else + pr_err("wrong value, %s\n", opt_str); + break; + + case Opt_fhsm_sec: + if (unlikely(match_int(&a->args[0], &n) + || n < 0)) { + pr_err("bad integer in %s\n", opt_str); + break; + } + if (sysaufs_brs) { + opt->fhsm_second = n; + opt->type = token; + } else + pr_warn("ignored %s\n", opt_str); + err = 0; + break; + + case Opt_ignore: + pr_warn("ignored %s\n", opt_str); + /*FALLTHROUGH*/ + case Opt_ignore_silent: + skipped = 1; + err = 0; + break; + case Opt_err: + pr_err("unknown option %s\n", opt_str); + break; + } + + if (!err && !skipped) { + if (unlikely(++opt > opt_tail)) { + err = -E2BIG; + opt--; + opt->type = Opt_tail; + break; + } + opt->type = Opt_tail; + } + } + + kfree(a); + dump_opts(opts); + if (unlikely(err)) + au_opts_free(opts); + +out: + return err; +} + +static int au_opt_wbr_create(struct super_block *sb, + struct au_opt_wbr_create *create) +{ + int err; + struct au_sbinfo *sbinfo; + + SiMustWriteLock(sb); + + err = 1; /* handled */ + sbinfo = au_sbi(sb); + if (sbinfo->si_wbr_create_ops->fin) { + err = sbinfo->si_wbr_create_ops->fin(sb); + if (!err) + err = 1; + } + + sbinfo->si_wbr_create = create->wbr_create; + sbinfo->si_wbr_create_ops = au_wbr_create_ops + create->wbr_create; + switch (create->wbr_create) { + case AuWbrCreate_MFSRRV: + case AuWbrCreate_MFSRR: + case AuWbrCreate_PMFSRR: + case AuWbrCreate_PMFSRRV: + sbinfo->si_wbr_mfs.mfsrr_watermark = create->mfsrr_watermark; + /*FALLTHROUGH*/ + case AuWbrCreate_MFS: + case AuWbrCreate_MFSV: + case AuWbrCreate_PMFS: + case AuWbrCreate_PMFSV: + sbinfo->si_wbr_mfs.mfs_expire + = msecs_to_jiffies(create->mfs_second * MSEC_PER_SEC); + break; + } + + if (sbinfo->si_wbr_create_ops->init) + sbinfo->si_wbr_create_ops->init(sb); /* ignore */ + + return err; +} + +/* + * returns, + * plus: processed without an error + * zero: unprocessed + */ +static int au_opt_simple(struct super_block *sb, struct au_opt *opt, + struct au_opts *opts) +{ + int err; + struct au_sbinfo *sbinfo; + + SiMustWriteLock(sb); + + err = 1; /* handled */ + sbinfo = au_sbi(sb); + switch (opt->type) { + case Opt_udba: + sbinfo->si_mntflags &= ~AuOptMask_UDBA; + sbinfo->si_mntflags |= opt->udba; + opts->given_udba |= opt->udba; + break; + + case Opt_plink: + au_opt_set(sbinfo->si_mntflags, PLINK); + break; + case Opt_noplink: + if (au_opt_test(sbinfo->si_mntflags, PLINK)) + au_plink_put(sb, /*verbose*/1); + au_opt_clr(sbinfo->si_mntflags, PLINK); + break; + case Opt_list_plink: + if (au_opt_test(sbinfo->si_mntflags, PLINK)) + au_plink_list(sb); + break; + + case Opt_dio: + au_opt_set(sbinfo->si_mntflags, DIO); + au_fset_opts(opts->flags, REFRESH_DYAOP); + break; + case Opt_nodio: + au_opt_clr(sbinfo->si_mntflags, DIO); + au_fset_opts(opts->flags, REFRESH_DYAOP); + break; + + case Opt_fhsm_sec: + au_fhsm_set(sbinfo, opt->fhsm_second); + break; + + case Opt_diropq_a: + au_opt_set(sbinfo->si_mntflags, ALWAYS_DIROPQ); + break; + case Opt_diropq_w: + au_opt_clr(sbinfo->si_mntflags, ALWAYS_DIROPQ); + break; + + case Opt_warn_perm: + au_opt_set(sbinfo->si_mntflags, WARN_PERM); + break; + case Opt_nowarn_perm: + au_opt_clr(sbinfo->si_mntflags, WARN_PERM); + break; + + case Opt_refrof: + au_opt_set(sbinfo->si_mntflags, REFROF); + break; + case Opt_norefrof: + au_opt_clr(sbinfo->si_mntflags, REFROF); + break; + + case Opt_verbose: + au_opt_set(sbinfo->si_mntflags, VERBOSE); + break; + case Opt_noverbose: + au_opt_clr(sbinfo->si_mntflags, VERBOSE); + break; + + case Opt_sum: + au_opt_set(sbinfo->si_mntflags, SUM); + break; + case Opt_wsum: + au_opt_clr(sbinfo->si_mntflags, SUM); + au_opt_set(sbinfo->si_mntflags, SUM_W); + case Opt_nosum: + au_opt_clr(sbinfo->si_mntflags, SUM); + au_opt_clr(sbinfo->si_mntflags, SUM_W); + break; + + case Opt_wbr_create: + err = au_opt_wbr_create(sb, &opt->wbr_create); + break; + case Opt_wbr_copyup: + sbinfo->si_wbr_copyup = opt->wbr_copyup; + sbinfo->si_wbr_copyup_ops = au_wbr_copyup_ops + opt->wbr_copyup; + break; + + case Opt_dirwh: + sbinfo->si_dirwh = opt->dirwh; + break; + + case Opt_rdcache: + sbinfo->si_rdcache + = msecs_to_jiffies(opt->rdcache * MSEC_PER_SEC); + break; + case Opt_rdblk: + sbinfo->si_rdblk = opt->rdblk; + break; + case Opt_rdblk_def: + sbinfo->si_rdblk = AUFS_RDBLK_DEF; + break; + case Opt_rdhash: + sbinfo->si_rdhash = opt->rdhash; + break; + case Opt_rdhash_def: + sbinfo->si_rdhash = AUFS_RDHASH_DEF; + break; + + case Opt_shwh: + au_opt_set(sbinfo->si_mntflags, SHWH); + break; + case Opt_noshwh: + au_opt_clr(sbinfo->si_mntflags, SHWH); + break; + + case Opt_dirperm1: + au_opt_set(sbinfo->si_mntflags, DIRPERM1); + break; + case Opt_nodirperm1: + au_opt_clr(sbinfo->si_mntflags, DIRPERM1); + break; + + case Opt_trunc_xino: + au_opt_set(sbinfo->si_mntflags, TRUNC_XINO); + break; + case Opt_notrunc_xino: + au_opt_clr(sbinfo->si_mntflags, TRUNC_XINO); + break; + + case Opt_trunc_xino_path: + case Opt_itrunc_xino: + err = au_xino_trunc(sb, opt->xino_itrunc.bindex); + if (!err) + err = 1; + break; + + case Opt_trunc_xib: + au_fset_opts(opts->flags, TRUNC_XIB); + break; + case Opt_notrunc_xib: + au_fclr_opts(opts->flags, TRUNC_XIB); + break; + + case Opt_acl: + sb->s_flags |= MS_POSIXACL; + break; + case Opt_noacl: + sb->s_flags &= ~MS_POSIXACL; + break; + + default: + err = 0; + break; + } + + return err; +} + +/* + * returns tri-state. + * plus: processed without an error + * zero: unprocessed + * minus: error + */ +static int au_opt_br(struct super_block *sb, struct au_opt *opt, + struct au_opts *opts) +{ + int err, do_refresh; + + err = 0; + switch (opt->type) { + case Opt_append: + opt->add.bindex = au_sbend(sb) + 1; + if (opt->add.bindex < 0) + opt->add.bindex = 0; + goto add; + case Opt_prepend: + opt->add.bindex = 0; + add: /* indented label */ + case Opt_add: + err = au_br_add(sb, &opt->add, + au_ftest_opts(opts->flags, REMOUNT)); + if (!err) { + err = 1; + au_fset_opts(opts->flags, REFRESH); + } + break; + + case Opt_del: + case Opt_idel: + err = au_br_del(sb, &opt->del, + au_ftest_opts(opts->flags, REMOUNT)); + if (!err) { + err = 1; + au_fset_opts(opts->flags, TRUNC_XIB); + au_fset_opts(opts->flags, REFRESH); + } + break; + + case Opt_mod: + case Opt_imod: + err = au_br_mod(sb, &opt->mod, + au_ftest_opts(opts->flags, REMOUNT), + &do_refresh); + if (!err) { + err = 1; + if (do_refresh) + au_fset_opts(opts->flags, REFRESH); + } + break; + } + + return err; +} + +static int au_opt_xino(struct super_block *sb, struct au_opt *opt, + struct au_opt_xino **opt_xino, + struct au_opts *opts) +{ + int err; + aufs_bindex_t bend, bindex; + struct dentry *root, *parent, *h_root; + + err = 0; + switch (opt->type) { + case Opt_xino: + err = au_xino_set(sb, &opt->xino, + !!au_ftest_opts(opts->flags, REMOUNT)); + if (unlikely(err)) + break; + + *opt_xino = &opt->xino; + au_xino_brid_set(sb, -1); + + /* safe d_parent access */ + parent = opt->xino.file->f_dentry->d_parent; + root = sb->s_root; + bend = au_sbend(sb); + for (bindex = 0; bindex <= bend; bindex++) { + h_root = au_h_dptr(root, bindex); + if (h_root == parent) { + au_xino_brid_set(sb, au_sbr_id(sb, bindex)); + break; + } + } + break; + + case Opt_noxino: + au_xino_clr(sb); + au_xino_brid_set(sb, -1); + *opt_xino = (void *)-1; + break; + } + + return err; +} + +int au_opts_verify(struct super_block *sb, unsigned long sb_flags, + unsigned int pending) +{ + int err, fhsm; + aufs_bindex_t bindex, bend; + unsigned char do_plink, skip, do_free; + struct au_branch *br; + struct au_wbr *wbr; + struct dentry *root; + struct inode *dir, *h_dir; + struct au_sbinfo *sbinfo; + struct au_hinode *hdir; + + SiMustAnyLock(sb); + + sbinfo = au_sbi(sb); + AuDebugOn(!(sbinfo->si_mntflags & AuOptMask_UDBA)); + + if (!(sb_flags & MS_RDONLY)) { + if (unlikely(!au_br_writable(au_sbr_perm(sb, 0)))) + pr_warn("first branch should be rw\n"); + if (unlikely(au_opt_test(sbinfo->si_mntflags, SHWH))) + pr_warn("shwh should be used with ro\n"); + } + + if (au_opt_test((sbinfo->si_mntflags | pending), UDBA_HNOTIFY) + && !au_opt_test(sbinfo->si_mntflags, XINO)) + pr_warn("udba=*notify requires xino\n"); + + if (au_opt_test(sbinfo->si_mntflags, DIRPERM1)) + pr_warn("dirperm1 breaks the protection" + " by the permission bits on the lower branch\n"); + + err = 0; + fhsm = 0; + root = sb->s_root; + dir = root->d_inode; + do_plink = !!au_opt_test(sbinfo->si_mntflags, PLINK); + bend = au_sbend(sb); + for (bindex = 0; !err && bindex <= bend; bindex++) { + skip = 0; + h_dir = au_h_iptr(dir, bindex); + br = au_sbr(sb, bindex); + + if ((br->br_perm & AuBrAttr_ICEX) + && !h_dir->i_op->listxattr) + br->br_perm &= ~AuBrAttr_ICEX; +#if 0 + if ((br->br_perm & AuBrAttr_ICEX_SEC) + && (au_br_sb(br)->s_flags & MS_NOSEC)) + br->br_perm &= ~AuBrAttr_ICEX_SEC; +#endif + + do_free = 0; + wbr = br->br_wbr; + if (wbr) + wbr_wh_read_lock(wbr); + + if (!au_br_writable(br->br_perm)) { + do_free = !!wbr; + skip = (!wbr + || (!wbr->wbr_whbase + && !wbr->wbr_plink + && !wbr->wbr_orph)); + } else if (!au_br_wh_linkable(br->br_perm)) { + /* skip = (!br->br_whbase && !br->br_orph); */ + skip = (!wbr || !wbr->wbr_whbase); + if (skip && wbr) { + if (do_plink) + skip = !!wbr->wbr_plink; + else + skip = !wbr->wbr_plink; + } + } else { + /* skip = (br->br_whbase && br->br_ohph); */ + skip = (wbr && wbr->wbr_whbase); + if (skip) { + if (do_plink) + skip = !!wbr->wbr_plink; + else + skip = !wbr->wbr_plink; + } + } + if (wbr) + wbr_wh_read_unlock(wbr); + + if (au_br_fhsm(br->br_perm)) { + fhsm++; + AuDebugOn(!br->br_fhsm); + } + + if (skip) + continue; + + hdir = au_hi(dir, bindex); + au_hn_imtx_lock_nested(hdir, AuLsc_I_PARENT); + if (wbr) + wbr_wh_write_lock(wbr); + err = au_wh_init(br, sb); + if (wbr) + wbr_wh_write_unlock(wbr); + au_hn_imtx_unlock(hdir); + + if (!err && do_free) { + kfree(wbr); + br->br_wbr = NULL; + } + } + + if (fhsm >= 2) { + au_fset_si(sbinfo, FHSM); + for (bindex = bend; bindex >= 0; bindex--) { + br = au_sbr(sb, bindex); + if (au_br_fhsm(br->br_perm)) { + au_fhsm_set_bottom(sb, bindex); + break; + } + } + } else { + au_fclr_si(sbinfo, FHSM); + au_fhsm_set_bottom(sb, -1); + } + + return err; +} + +int au_opts_mount(struct super_block *sb, struct au_opts *opts) +{ + int err; + unsigned int tmp; + aufs_bindex_t bindex, bend; + struct au_opt *opt; + struct au_opt_xino *opt_xino, xino; + struct au_sbinfo *sbinfo; + struct au_branch *br; + struct inode *dir; + + SiMustWriteLock(sb); + + err = 0; + opt_xino = NULL; + opt = opts->opt; + while (err >= 0 && opt->type != Opt_tail) + err = au_opt_simple(sb, opt++, opts); + if (err > 0) + err = 0; + else if (unlikely(err < 0)) + goto out; + + /* disable xino and udba temporary */ + sbinfo = au_sbi(sb); + tmp = sbinfo->si_mntflags; + au_opt_clr(sbinfo->si_mntflags, XINO); + au_opt_set_udba(sbinfo->si_mntflags, UDBA_REVAL); + + opt = opts->opt; + while (err >= 0 && opt->type != Opt_tail) + err = au_opt_br(sb, opt++, opts); + if (err > 0) + err = 0; + else if (unlikely(err < 0)) + goto out; + + bend = au_sbend(sb); + if (unlikely(bend < 0)) { + err = -EINVAL; + pr_err("no branches\n"); + goto out; + } + + if (au_opt_test(tmp, XINO)) + au_opt_set(sbinfo->si_mntflags, XINO); + opt = opts->opt; + while (!err && opt->type != Opt_tail) + err = au_opt_xino(sb, opt++, &opt_xino, opts); + if (unlikely(err)) + goto out; + + err = au_opts_verify(sb, sb->s_flags, tmp); + if (unlikely(err)) + goto out; + + /* restore xino */ + if (au_opt_test(tmp, XINO) && !opt_xino) { + xino.file = au_xino_def(sb); + err = PTR_ERR(xino.file); + if (IS_ERR(xino.file)) + goto out; + + err = au_xino_set(sb, &xino, /*remount*/0); + fput(xino.file); + if (unlikely(err)) + goto out; + } + + /* restore udba */ + tmp &= AuOptMask_UDBA; + sbinfo->si_mntflags &= ~AuOptMask_UDBA; + sbinfo->si_mntflags |= tmp; + bend = au_sbend(sb); + for (bindex = 0; bindex <= bend; bindex++) { + br = au_sbr(sb, bindex); + err = au_hnotify_reset_br(tmp, br, br->br_perm); + if (unlikely(err)) + AuIOErr("hnotify failed on br %d, %d, ignored\n", + bindex, err); + /* go on even if err */ + } + if (au_opt_test(tmp, UDBA_HNOTIFY)) { + dir = sb->s_root->d_inode; + au_hn_reset(dir, au_hi_flags(dir, /*isdir*/1) & ~AuHi_XINO); + } + +out: + return err; +} + +int au_opts_remount(struct super_block *sb, struct au_opts *opts) +{ + int err, rerr; + struct inode *dir; + struct au_opt_xino *opt_xino; + struct au_opt *opt; + struct au_sbinfo *sbinfo; + + SiMustWriteLock(sb); + + dir = sb->s_root->d_inode; + sbinfo = au_sbi(sb); + err = 0; + opt_xino = NULL; + opt = opts->opt; + while (err >= 0 && opt->type != Opt_tail) { + err = au_opt_simple(sb, opt, opts); + if (!err) + err = au_opt_br(sb, opt, opts); + if (!err) + err = au_opt_xino(sb, opt, &opt_xino, opts); + opt++; + } + if (err > 0) + err = 0; + AuTraceErr(err); + /* go on even err */ + + rerr = au_opts_verify(sb, opts->sb_flags, /*pending*/0); + if (unlikely(rerr && !err)) + err = rerr; + + if (au_ftest_opts(opts->flags, TRUNC_XIB)) { + rerr = au_xib_trunc(sb); + if (unlikely(rerr && !err)) + err = rerr; + } + + /* will be handled by the caller */ + if (!au_ftest_opts(opts->flags, REFRESH) + && (opts->given_udba || au_opt_test(sbinfo->si_mntflags, XINO))) + au_fset_opts(opts->flags, REFRESH); + + AuDbg("status 0x%x\n", opts->flags); + return err; +} + +/* ---------------------------------------------------------------------- */ + +unsigned int au_opt_udba(struct super_block *sb) +{ + return au_mntflags(sb) & AuOptMask_UDBA; +} diff --git a/fs/aufs/opts.h b/fs/aufs/opts.h new file mode 100644 index 00000000000000..5bef4d18beb9fe --- /dev/null +++ b/fs/aufs/opts.h @@ -0,0 +1,213 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * mount options/flags + */ + +#ifndef __AUFS_OPTS_H__ +#define __AUFS_OPTS_H__ + +#ifdef __KERNEL__ + +#include +#include "branch.h" + +struct file; +struct super_block; + +/* ---------------------------------------------------------------------- */ + +/* mount flags */ +#define AuOpt_XINO 1 /* external inode number bitmap + and translation table */ +#define AuOpt_TRUNC_XINO (1 << 1) /* truncate xino files */ +#define AuOpt_UDBA_NONE (1 << 2) /* users direct branch access */ +#define AuOpt_UDBA_REVAL (1 << 3) +#define AuOpt_UDBA_HNOTIFY (1 << 4) +#define AuOpt_SHWH (1 << 5) /* show whiteout */ +#define AuOpt_PLINK (1 << 6) /* pseudo-link */ +#define AuOpt_DIRPERM1 (1 << 7) /* ignore the lower dir's perm + bits */ +#define AuOpt_REFROF (1 << 8) /* unimplemented */ +#define AuOpt_ALWAYS_DIROPQ (1 << 9) /* policy to creating diropq */ +#define AuOpt_SUM (1 << 10) /* summation for statfs(2) */ +#define AuOpt_SUM_W (1 << 11) /* unimplemented */ +#define AuOpt_WARN_PERM (1 << 12) /* warn when add-branch */ +#define AuOpt_VERBOSE (1 << 13) /* busy inode when del-branch */ +#define AuOpt_DIO (1 << 14) /* direct io */ + +#ifndef CONFIG_AUFS_HNOTIFY +#undef AuOpt_UDBA_HNOTIFY +#define AuOpt_UDBA_HNOTIFY 0 +#endif +#ifndef CONFIG_AUFS_SHWH +#undef AuOpt_SHWH +#define AuOpt_SHWH 0 +#endif + +#define AuOpt_Def (AuOpt_XINO \ + | AuOpt_UDBA_REVAL \ + | AuOpt_PLINK \ + /* | AuOpt_DIRPERM1 */ \ + | AuOpt_WARN_PERM) +#define AuOptMask_UDBA (AuOpt_UDBA_NONE \ + | AuOpt_UDBA_REVAL \ + | AuOpt_UDBA_HNOTIFY) + +#define au_opt_test(flags, name) (flags & AuOpt_##name) +#define au_opt_set(flags, name) do { \ + BUILD_BUG_ON(AuOpt_##name & AuOptMask_UDBA); \ + ((flags) |= AuOpt_##name); \ +} while (0) +#define au_opt_set_udba(flags, name) do { \ + (flags) &= ~AuOptMask_UDBA; \ + ((flags) |= AuOpt_##name); \ +} while (0) +#define au_opt_clr(flags, name) do { \ + ((flags) &= ~AuOpt_##name); \ +} while (0) + +static inline unsigned int au_opts_plink(unsigned int mntflags) +{ +#ifdef CONFIG_PROC_FS + return mntflags; +#else + return mntflags & ~AuOpt_PLINK; +#endif +} + +/* ---------------------------------------------------------------------- */ + +/* policies to select one among multiple writable branches */ +enum { + AuWbrCreate_TDP, /* top down parent */ + AuWbrCreate_RR, /* round robin */ + AuWbrCreate_MFS, /* most free space */ + AuWbrCreate_MFSV, /* mfs with seconds */ + AuWbrCreate_MFSRR, /* mfs then rr */ + AuWbrCreate_MFSRRV, /* mfs then rr with seconds */ + AuWbrCreate_PMFS, /* parent and mfs */ + AuWbrCreate_PMFSV, /* parent and mfs with seconds */ + AuWbrCreate_PMFSRR, /* parent, mfs and round-robin */ + AuWbrCreate_PMFSRRV, /* plus seconds */ + + AuWbrCreate_Def = AuWbrCreate_TDP +}; + +enum { + AuWbrCopyup_TDP, /* top down parent */ + AuWbrCopyup_BUP, /* bottom up parent */ + AuWbrCopyup_BU, /* bottom up */ + + AuWbrCopyup_Def = AuWbrCopyup_TDP +}; + +/* ---------------------------------------------------------------------- */ + +struct au_opt_add { + aufs_bindex_t bindex; + char *pathname; + int perm; + struct path path; +}; + +struct au_opt_del { + char *pathname; + struct path h_path; +}; + +struct au_opt_mod { + char *path; + int perm; + struct dentry *h_root; +}; + +struct au_opt_xino { + char *path; + struct file *file; +}; + +struct au_opt_xino_itrunc { + aufs_bindex_t bindex; +}; + +struct au_opt_wbr_create { + int wbr_create; + int mfs_second; + unsigned long long mfsrr_watermark; +}; + +struct au_opt { + int type; + union { + struct au_opt_xino xino; + struct au_opt_xino_itrunc xino_itrunc; + struct au_opt_add add; + struct au_opt_del del; + struct au_opt_mod mod; + int dirwh; + int rdcache; + unsigned int rdblk; + unsigned int rdhash; + int udba; + struct au_opt_wbr_create wbr_create; + int wbr_copyup; + unsigned int fhsm_second; + }; +}; + +/* opts flags */ +#define AuOpts_REMOUNT 1 +#define AuOpts_REFRESH (1 << 1) +#define AuOpts_TRUNC_XIB (1 << 2) +#define AuOpts_REFRESH_DYAOP (1 << 3) +#define au_ftest_opts(flags, name) ((flags) & AuOpts_##name) +#define au_fset_opts(flags, name) \ + do { (flags) |= AuOpts_##name; } while (0) +#define au_fclr_opts(flags, name) \ + do { (flags) &= ~AuOpts_##name; } while (0) + +struct au_opts { + struct au_opt *opt; + int max_opt; + + unsigned int given_udba; + unsigned int flags; + unsigned long sb_flags; +}; + +/* ---------------------------------------------------------------------- */ + +void au_optstr_br_perm(au_br_perm_str_t *str, int perm); +const char *au_optstr_udba(int udba); +const char *au_optstr_wbr_copyup(int wbr_copyup); +const char *au_optstr_wbr_create(int wbr_create); + +void au_opts_free(struct au_opts *opts); +int au_opts_parse(struct super_block *sb, char *str, struct au_opts *opts); +int au_opts_verify(struct super_block *sb, unsigned long sb_flags, + unsigned int pending); +int au_opts_mount(struct super_block *sb, struct au_opts *opts); +int au_opts_remount(struct super_block *sb, struct au_opts *opts); + +unsigned int au_opt_udba(struct super_block *sb); + +/* ---------------------------------------------------------------------- */ + +#endif /* __KERNEL__ */ +#endif /* __AUFS_OPTS_H__ */ diff --git a/fs/aufs/plink.c b/fs/aufs/plink.c new file mode 100644 index 00000000000000..d6af13d92c3854 --- /dev/null +++ b/fs/aufs/plink.c @@ -0,0 +1,519 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * pseudo-link + */ + +#include "aufs.h" + +/* + * the pseudo-link maintenance mode. + * during a user process maintains the pseudo-links, + * prohibit adding a new plink and branch manipulation. + * + * Flags + * NOPLM: + * For entry functions which will handle plink, and i_mutex is already held + * in VFS. + * They cannot wait and should return an error at once. + * Callers has to check the error. + * NOPLMW: + * For entry functions which will handle plink, but i_mutex is not held + * in VFS. + * They can wait the plink maintenance mode to finish. + * + * They behave like F_SETLK and F_SETLKW. + * If the caller never handle plink, then both flags are unnecessary. + */ + +int au_plink_maint(struct super_block *sb, int flags) +{ + int err; + pid_t pid, ppid; + struct au_sbinfo *sbi; + + SiMustAnyLock(sb); + + err = 0; + if (!au_opt_test(au_mntflags(sb), PLINK)) + goto out; + + sbi = au_sbi(sb); + pid = sbi->si_plink_maint_pid; + if (!pid || pid == current->pid) + goto out; + + /* todo: it highly depends upon /sbin/mount.aufs */ + rcu_read_lock(); + ppid = task_pid_vnr(rcu_dereference(current->real_parent)); + rcu_read_unlock(); + if (pid == ppid) + goto out; + + if (au_ftest_lock(flags, NOPLMW)) { + /* if there is no i_mutex lock in VFS, we don't need to wait */ + /* AuDebugOn(!lockdep_depth(current)); */ + while (sbi->si_plink_maint_pid) { + si_read_unlock(sb); + /* gave up wake_up_bit() */ + wait_event(sbi->si_plink_wq, !sbi->si_plink_maint_pid); + + if (au_ftest_lock(flags, FLUSH)) + au_nwt_flush(&sbi->si_nowait); + si_noflush_read_lock(sb); + } + } else if (au_ftest_lock(flags, NOPLM)) { + AuDbg("ppid %d, pid %d\n", ppid, pid); + err = -EAGAIN; + } + +out: + return err; +} + +void au_plink_maint_leave(struct au_sbinfo *sbinfo) +{ + spin_lock(&sbinfo->si_plink_maint_lock); + sbinfo->si_plink_maint_pid = 0; + spin_unlock(&sbinfo->si_plink_maint_lock); + wake_up_all(&sbinfo->si_plink_wq); +} + +int au_plink_maint_enter(struct super_block *sb) +{ + int err; + struct au_sbinfo *sbinfo; + + err = 0; + sbinfo = au_sbi(sb); + /* make sure i am the only one in this fs */ + si_write_lock(sb, AuLock_FLUSH); + if (au_opt_test(au_mntflags(sb), PLINK)) { + spin_lock(&sbinfo->si_plink_maint_lock); + if (!sbinfo->si_plink_maint_pid) + sbinfo->si_plink_maint_pid = current->pid; + else + err = -EBUSY; + spin_unlock(&sbinfo->si_plink_maint_lock); + } + si_write_unlock(sb); + + return err; +} + +/* ---------------------------------------------------------------------- */ + +#ifdef CONFIG_AUFS_DEBUG +void au_plink_list(struct super_block *sb) +{ + int i; + struct au_sbinfo *sbinfo; + struct hlist_head *plink_hlist; + struct pseudo_link *plink; + + SiMustAnyLock(sb); + + sbinfo = au_sbi(sb); + AuDebugOn(!au_opt_test(au_mntflags(sb), PLINK)); + AuDebugOn(au_plink_maint(sb, AuLock_NOPLM)); + + for (i = 0; i < AuPlink_NHASH; i++) { + plink_hlist = &sbinfo->si_plink[i].head; + rcu_read_lock(); + hlist_for_each_entry_rcu(plink, plink_hlist, hlist) + AuDbg("%lu\n", plink->inode->i_ino); + rcu_read_unlock(); + } +} +#endif + +/* is the inode pseudo-linked? */ +int au_plink_test(struct inode *inode) +{ + int found, i; + struct au_sbinfo *sbinfo; + struct hlist_head *plink_hlist; + struct pseudo_link *plink; + + sbinfo = au_sbi(inode->i_sb); + AuRwMustAnyLock(&sbinfo->si_rwsem); + AuDebugOn(!au_opt_test(au_mntflags(inode->i_sb), PLINK)); + AuDebugOn(au_plink_maint(inode->i_sb, AuLock_NOPLM)); + + found = 0; + i = au_plink_hash(inode->i_ino); + plink_hlist = &sbinfo->si_plink[i].head; + rcu_read_lock(); + hlist_for_each_entry_rcu(plink, plink_hlist, hlist) + if (plink->inode == inode) { + found = 1; + break; + } + rcu_read_unlock(); + return found; +} + +/* ---------------------------------------------------------------------- */ + +/* + * generate a name for plink. + * the file will be stored under AUFS_WH_PLINKDIR. + */ +/* 20 is max digits length of ulong 64 */ +#define PLINK_NAME_LEN ((20 + 1) * 2) + +static int plink_name(char *name, int len, struct inode *inode, + aufs_bindex_t bindex) +{ + int rlen; + struct inode *h_inode; + + h_inode = au_h_iptr(inode, bindex); + rlen = snprintf(name, len, "%lu.%lu", inode->i_ino, h_inode->i_ino); + return rlen; +} + +struct au_do_plink_lkup_args { + struct dentry **errp; + struct qstr *tgtname; + struct dentry *h_parent; + struct au_branch *br; +}; + +static struct dentry *au_do_plink_lkup(struct qstr *tgtname, + struct dentry *h_parent, + struct au_branch *br) +{ + struct dentry *h_dentry; + struct mutex *h_mtx; + + h_mtx = &h_parent->d_inode->i_mutex; + mutex_lock_nested(h_mtx, AuLsc_I_CHILD2); + h_dentry = vfsub_lkup_one(tgtname, h_parent); + mutex_unlock(h_mtx); + return h_dentry; +} + +static void au_call_do_plink_lkup(void *args) +{ + struct au_do_plink_lkup_args *a = args; + *a->errp = au_do_plink_lkup(a->tgtname, a->h_parent, a->br); +} + +/* lookup the plink-ed @inode under the branch at @bindex */ +struct dentry *au_plink_lkup(struct inode *inode, aufs_bindex_t bindex) +{ + struct dentry *h_dentry, *h_parent; + struct au_branch *br; + struct inode *h_dir; + int wkq_err; + char a[PLINK_NAME_LEN]; + struct qstr tgtname = QSTR_INIT(a, 0); + + AuDebugOn(au_plink_maint(inode->i_sb, AuLock_NOPLM)); + + br = au_sbr(inode->i_sb, bindex); + h_parent = br->br_wbr->wbr_plink; + h_dir = h_parent->d_inode; + tgtname.len = plink_name(a, sizeof(a), inode, bindex); + + if (!uid_eq(current_fsuid(), GLOBAL_ROOT_UID)) { + struct au_do_plink_lkup_args args = { + .errp = &h_dentry, + .tgtname = &tgtname, + .h_parent = h_parent, + .br = br + }; + + wkq_err = au_wkq_wait(au_call_do_plink_lkup, &args); + if (unlikely(wkq_err)) + h_dentry = ERR_PTR(wkq_err); + } else + h_dentry = au_do_plink_lkup(&tgtname, h_parent, br); + + return h_dentry; +} + +/* create a pseudo-link */ +static int do_whplink(struct qstr *tgt, struct dentry *h_parent, + struct dentry *h_dentry, struct au_branch *br) +{ + int err; + struct path h_path = { + .mnt = au_br_mnt(br) + }; + struct inode *h_dir; + + h_dir = h_parent->d_inode; + mutex_lock_nested(&h_dir->i_mutex, AuLsc_I_CHILD2); +again: + h_path.dentry = vfsub_lkup_one(tgt, h_parent); + err = PTR_ERR(h_path.dentry); + if (IS_ERR(h_path.dentry)) + goto out; + + err = 0; + /* wh.plink dir is not monitored */ + /* todo: is it really safe? */ + if (h_path.dentry->d_inode + && h_path.dentry->d_inode != h_dentry->d_inode) { + err = vfsub_unlink(h_dir, &h_path, /*force*/0); + dput(h_path.dentry); + h_path.dentry = NULL; + if (!err) + goto again; + } + if (!err && !h_path.dentry->d_inode) + err = vfsub_link(h_dentry, h_dir, &h_path); + dput(h_path.dentry); + +out: + mutex_unlock(&h_dir->i_mutex); + return err; +} + +struct do_whplink_args { + int *errp; + struct qstr *tgt; + struct dentry *h_parent; + struct dentry *h_dentry; + struct au_branch *br; +}; + +static void call_do_whplink(void *args) +{ + struct do_whplink_args *a = args; + *a->errp = do_whplink(a->tgt, a->h_parent, a->h_dentry, a->br); +} + +static int whplink(struct dentry *h_dentry, struct inode *inode, + aufs_bindex_t bindex, struct au_branch *br) +{ + int err, wkq_err; + struct au_wbr *wbr; + struct dentry *h_parent; + struct inode *h_dir; + char a[PLINK_NAME_LEN]; + struct qstr tgtname = QSTR_INIT(a, 0); + + wbr = au_sbr(inode->i_sb, bindex)->br_wbr; + h_parent = wbr->wbr_plink; + h_dir = h_parent->d_inode; + tgtname.len = plink_name(a, sizeof(a), inode, bindex); + + /* always superio. */ + if (!uid_eq(current_fsuid(), GLOBAL_ROOT_UID)) { + struct do_whplink_args args = { + .errp = &err, + .tgt = &tgtname, + .h_parent = h_parent, + .h_dentry = h_dentry, + .br = br + }; + wkq_err = au_wkq_wait(call_do_whplink, &args); + if (unlikely(wkq_err)) + err = wkq_err; + } else + err = do_whplink(&tgtname, h_parent, h_dentry, br); + + return err; +} + +/* free a single plink */ +static void do_put_plink(struct pseudo_link *plink, int do_del) +{ + if (do_del) + hlist_del(&plink->hlist); + iput(plink->inode); + kfree(plink); +} + +static void do_put_plink_rcu(struct rcu_head *rcu) +{ + struct pseudo_link *plink; + + plink = container_of(rcu, struct pseudo_link, rcu); + iput(plink->inode); + kfree(plink); +} + +/* + * create a new pseudo-link for @h_dentry on @bindex. + * the linked inode is held in aufs @inode. + */ +void au_plink_append(struct inode *inode, aufs_bindex_t bindex, + struct dentry *h_dentry) +{ + struct super_block *sb; + struct au_sbinfo *sbinfo; + struct hlist_head *plink_hlist; + struct pseudo_link *plink, *tmp; + struct au_sphlhead *sphl; + int found, err, cnt, i; + + sb = inode->i_sb; + sbinfo = au_sbi(sb); + AuDebugOn(!au_opt_test(au_mntflags(sb), PLINK)); + AuDebugOn(au_plink_maint(sb, AuLock_NOPLM)); + + found = au_plink_test(inode); + if (found) + return; + + i = au_plink_hash(inode->i_ino); + sphl = sbinfo->si_plink + i; + plink_hlist = &sphl->head; + tmp = kmalloc(sizeof(*plink), GFP_NOFS); + if (tmp) + tmp->inode = au_igrab(inode); + else { + err = -ENOMEM; + goto out; + } + + spin_lock(&sphl->spin); + hlist_for_each_entry(plink, plink_hlist, hlist) { + if (plink->inode == inode) { + found = 1; + break; + } + } + if (!found) + hlist_add_head_rcu(&tmp->hlist, plink_hlist); + spin_unlock(&sphl->spin); + if (!found) { + cnt = au_sphl_count(sphl); +#define msg "unexpectedly unblanced or too many pseudo-links" + if (cnt > AUFS_PLINK_WARN) + AuWarn1(msg ", %d\n", cnt); +#undef msg + err = whplink(h_dentry, inode, bindex, au_sbr(sb, bindex)); + } else { + do_put_plink(tmp, 0); + return; + } + +out: + if (unlikely(err)) { + pr_warn("err %d, damaged pseudo link.\n", err); + if (tmp) { + au_sphl_del_rcu(&tmp->hlist, sphl); + call_rcu(&tmp->rcu, do_put_plink_rcu); + } + } +} + +/* free all plinks */ +void au_plink_put(struct super_block *sb, int verbose) +{ + int i, warned; + struct au_sbinfo *sbinfo; + struct hlist_head *plink_hlist; + struct hlist_node *tmp; + struct pseudo_link *plink; + + SiMustWriteLock(sb); + + sbinfo = au_sbi(sb); + AuDebugOn(!au_opt_test(au_mntflags(sb), PLINK)); + AuDebugOn(au_plink_maint(sb, AuLock_NOPLM)); + + /* no spin_lock since sbinfo is write-locked */ + warned = 0; + for (i = 0; i < AuPlink_NHASH; i++) { + plink_hlist = &sbinfo->si_plink[i].head; + if (!warned && verbose && !hlist_empty(plink_hlist)) { + pr_warn("pseudo-link is not flushed"); + warned = 1; + } + hlist_for_each_entry_safe(plink, tmp, plink_hlist, hlist) + do_put_plink(plink, 0); + INIT_HLIST_HEAD(plink_hlist); + } +} + +void au_plink_clean(struct super_block *sb, int verbose) +{ + struct dentry *root; + + root = sb->s_root; + aufs_write_lock(root); + if (au_opt_test(au_mntflags(sb), PLINK)) + au_plink_put(sb, verbose); + aufs_write_unlock(root); +} + +static int au_plink_do_half_refresh(struct inode *inode, aufs_bindex_t br_id) +{ + int do_put; + aufs_bindex_t bstart, bend, bindex; + + do_put = 0; + bstart = au_ibstart(inode); + bend = au_ibend(inode); + if (bstart >= 0) { + for (bindex = bstart; bindex <= bend; bindex++) { + if (!au_h_iptr(inode, bindex) + || au_ii_br_id(inode, bindex) != br_id) + continue; + au_set_h_iptr(inode, bindex, NULL, 0); + do_put = 1; + break; + } + if (do_put) + for (bindex = bstart; bindex <= bend; bindex++) + if (au_h_iptr(inode, bindex)) { + do_put = 0; + break; + } + } else + do_put = 1; + + return do_put; +} + +/* free the plinks on a branch specified by @br_id */ +void au_plink_half_refresh(struct super_block *sb, aufs_bindex_t br_id) +{ + struct au_sbinfo *sbinfo; + struct hlist_head *plink_hlist; + struct hlist_node *tmp; + struct pseudo_link *plink; + struct inode *inode; + int i, do_put; + + SiMustWriteLock(sb); + + sbinfo = au_sbi(sb); + AuDebugOn(!au_opt_test(au_mntflags(sb), PLINK)); + AuDebugOn(au_plink_maint(sb, AuLock_NOPLM)); + + /* no spin_lock since sbinfo is write-locked */ + for (i = 0; i < AuPlink_NHASH; i++) { + plink_hlist = &sbinfo->si_plink[i].head; + hlist_for_each_entry_safe(plink, tmp, plink_hlist, hlist) { + inode = au_igrab(plink->inode); + ii_write_lock_child(inode); + do_put = au_plink_do_half_refresh(inode, br_id); + if (do_put) + do_put_plink(plink, 1); + ii_write_unlock(inode); + iput(inode); + } + } +} diff --git a/fs/aufs/poll.c b/fs/aufs/poll.c new file mode 100644 index 00000000000000..debe9ccbfe4baf --- /dev/null +++ b/fs/aufs/poll.c @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * poll operation + * There is only one filesystem which implements ->poll operation, currently. + */ + +#include "aufs.h" + +unsigned int aufs_poll(struct file *file, poll_table *wait) +{ + unsigned int mask; + int err; + struct file *h_file; + struct dentry *dentry; + struct super_block *sb; + + /* We should pretend an error happened. */ + mask = POLLERR /* | POLLIN | POLLOUT */; + dentry = file->f_dentry; + sb = dentry->d_sb; + si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW); + err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/0); + if (unlikely(err)) + goto out; + + /* it is not an error if h_file has no operation */ + mask = DEFAULT_POLLMASK; + h_file = au_hf_top(file); + if (h_file->f_op && h_file->f_op->poll) + mask = h_file->f_op->poll(h_file, wait); + + di_read_unlock(dentry, AuLock_IR); + fi_read_unlock(file); + +out: + si_read_unlock(sb); + AuTraceErr((int)mask); + return mask; +} diff --git a/fs/aufs/procfs.c b/fs/aufs/procfs.c new file mode 100644 index 00000000000000..c0c0b4195c181d --- /dev/null +++ b/fs/aufs/procfs.c @@ -0,0 +1,169 @@ +/* + * Copyright (C) 2010-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * procfs interfaces + */ + +#include +#include "aufs.h" + +static int au_procfs_plm_release(struct inode *inode, struct file *file) +{ + struct au_sbinfo *sbinfo; + + sbinfo = file->private_data; + if (sbinfo) { + au_plink_maint_leave(sbinfo); + kobject_put(&sbinfo->si_kobj); + } + + return 0; +} + +static void au_procfs_plm_write_clean(struct file *file) +{ + struct au_sbinfo *sbinfo; + + sbinfo = file->private_data; + if (sbinfo) + au_plink_clean(sbinfo->si_sb, /*verbose*/0); +} + +static int au_procfs_plm_write_si(struct file *file, unsigned long id) +{ + int err; + struct super_block *sb; + struct au_sbinfo *sbinfo; + + err = -EBUSY; + if (unlikely(file->private_data)) + goto out; + + sb = NULL; + /* don't use au_sbilist_lock() here */ + spin_lock(&au_sbilist.spin); + list_for_each_entry(sbinfo, &au_sbilist.head, si_list) + if (id == sysaufs_si_id(sbinfo)) { + kobject_get(&sbinfo->si_kobj); + sb = sbinfo->si_sb; + break; + } + spin_unlock(&au_sbilist.spin); + + err = -EINVAL; + if (unlikely(!sb)) + goto out; + + err = au_plink_maint_enter(sb); + if (!err) + /* keep kobject_get() */ + file->private_data = sbinfo; + else + kobject_put(&sbinfo->si_kobj); +out: + return err; +} + +/* + * Accept a valid "si=xxxx" only. + * Once it is accepted successfully, accept "clean" too. + */ +static ssize_t au_procfs_plm_write(struct file *file, const char __user *ubuf, + size_t count, loff_t *ppos) +{ + ssize_t err; + unsigned long id; + /* last newline is allowed */ + char buf[3 + sizeof(unsigned long) * 2 + 1]; + + err = -EACCES; + if (unlikely(!capable(CAP_SYS_ADMIN))) + goto out; + + err = -EINVAL; + if (unlikely(count > sizeof(buf))) + goto out; + + err = copy_from_user(buf, ubuf, count); + if (unlikely(err)) { + err = -EFAULT; + goto out; + } + buf[count] = 0; + + err = -EINVAL; + if (!strcmp("clean", buf)) { + au_procfs_plm_write_clean(file); + goto out_success; + } else if (unlikely(strncmp("si=", buf, 3))) + goto out; + + err = kstrtoul(buf + 3, 16, &id); + if (unlikely(err)) + goto out; + + err = au_procfs_plm_write_si(file, id); + if (unlikely(err)) + goto out; + +out_success: + err = count; /* success */ +out: + return err; +} + +static const struct file_operations au_procfs_plm_fop = { + .write = au_procfs_plm_write, + .release = au_procfs_plm_release, + .owner = THIS_MODULE +}; + +/* ---------------------------------------------------------------------- */ + +static struct proc_dir_entry *au_procfs_dir; + +void au_procfs_fin(void) +{ + remove_proc_entry(AUFS_PLINK_MAINT_NAME, au_procfs_dir); + remove_proc_entry(AUFS_PLINK_MAINT_DIR, NULL); +} + +int __init au_procfs_init(void) +{ + int err; + struct proc_dir_entry *entry; + + err = -ENOMEM; + au_procfs_dir = proc_mkdir(AUFS_PLINK_MAINT_DIR, NULL); + if (unlikely(!au_procfs_dir)) + goto out; + + entry = proc_create(AUFS_PLINK_MAINT_NAME, S_IFREG | S_IWUSR, + au_procfs_dir, &au_procfs_plm_fop); + if (unlikely(!entry)) + goto out_dir; + + err = 0; + goto out; /* success */ + + +out_dir: + remove_proc_entry(AUFS_PLINK_MAINT_DIR, NULL); +out: + return err; +} diff --git a/fs/aufs/rdu.c b/fs/aufs/rdu.c new file mode 100644 index 00000000000000..7ca9ca9459ee6f --- /dev/null +++ b/fs/aufs/rdu.c @@ -0,0 +1,383 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * readdir in userspace. + */ + +#include +#include +#include +#include "aufs.h" + +/* bits for struct aufs_rdu.flags */ +#define AuRdu_CALLED 1 +#define AuRdu_CONT (1 << 1) +#define AuRdu_FULL (1 << 2) +#define au_ftest_rdu(flags, name) ((flags) & AuRdu_##name) +#define au_fset_rdu(flags, name) \ + do { (flags) |= AuRdu_##name; } while (0) +#define au_fclr_rdu(flags, name) \ + do { (flags) &= ~AuRdu_##name; } while (0) + +struct au_rdu_arg { + struct aufs_rdu *rdu; + union au_rdu_ent_ul ent; + unsigned long end; + + struct super_block *sb; + int err; +}; + +static int au_rdu_fill(void *__arg, const char *name, int nlen, + loff_t offset, u64 h_ino, unsigned int d_type) +{ + int err, len; + struct au_rdu_arg *arg = __arg; + struct aufs_rdu *rdu = arg->rdu; + struct au_rdu_ent ent; + + err = 0; + arg->err = 0; + au_fset_rdu(rdu->cookie.flags, CALLED); + len = au_rdu_len(nlen); + if (arg->ent.ul + len < arg->end) { + ent.ino = h_ino; + ent.bindex = rdu->cookie.bindex; + ent.type = d_type; + ent.nlen = nlen; + if (unlikely(nlen > AUFS_MAX_NAMELEN)) + ent.type = DT_UNKNOWN; + + /* unnecessary to support mmap_sem since this is a dir */ + err = -EFAULT; + if (copy_to_user(arg->ent.e, &ent, sizeof(ent))) + goto out; + if (copy_to_user(arg->ent.e->name, name, nlen)) + goto out; + /* the terminating NULL */ + if (__put_user(0, arg->ent.e->name + nlen)) + goto out; + err = 0; + /* AuDbg("%p, %.*s\n", arg->ent.p, nlen, name); */ + arg->ent.ul += len; + rdu->rent++; + } else { + err = -EFAULT; + au_fset_rdu(rdu->cookie.flags, FULL); + rdu->full = 1; + rdu->tail = arg->ent; + } + +out: + /* AuTraceErr(err); */ + return err; +} + +static int au_rdu_do(struct file *h_file, struct au_rdu_arg *arg) +{ + int err; + loff_t offset; + struct au_rdu_cookie *cookie = &arg->rdu->cookie; + + /* we don't have to care (FMODE_32BITHASH | FMODE_64BITHASH) for ext4 */ + offset = vfsub_llseek(h_file, cookie->h_pos, SEEK_SET); + err = offset; + if (unlikely(offset != cookie->h_pos)) + goto out; + + err = 0; + do { + arg->err = 0; + au_fclr_rdu(cookie->flags, CALLED); + /* smp_mb(); */ + err = vfsub_readdir(h_file, au_rdu_fill, arg); + if (err >= 0) + err = arg->err; + } while (!err + && au_ftest_rdu(cookie->flags, CALLED) + && !au_ftest_rdu(cookie->flags, FULL)); + cookie->h_pos = h_file->f_pos; + +out: + AuTraceErr(err); + return err; +} + +static int au_rdu(struct file *file, struct aufs_rdu *rdu) +{ + int err; + aufs_bindex_t bend; + struct au_rdu_arg arg; + struct dentry *dentry; + struct inode *inode; + struct file *h_file; + struct au_rdu_cookie *cookie = &rdu->cookie; + + err = !access_ok(VERIFY_WRITE, rdu->ent.e, rdu->sz); + if (unlikely(err)) { + err = -EFAULT; + AuTraceErr(err); + goto out; + } + rdu->rent = 0; + rdu->tail = rdu->ent; + rdu->full = 0; + arg.rdu = rdu; + arg.ent = rdu->ent; + arg.end = arg.ent.ul; + arg.end += rdu->sz; + + err = -ENOTDIR; + if (unlikely(!file->f_op || !file->f_op->readdir)) + goto out; + + err = security_file_permission(file, MAY_READ); + AuTraceErr(err); + if (unlikely(err)) + goto out; + + dentry = file->f_dentry; + inode = dentry->d_inode; +#if 1 + mutex_lock(&inode->i_mutex); +#else + err = mutex_lock_killable(&inode->i_mutex); + AuTraceErr(err); + if (unlikely(err)) + goto out; +#endif + + arg.sb = inode->i_sb; + err = si_read_lock(arg.sb, AuLock_FLUSH | AuLock_NOPLM); + if (unlikely(err)) + goto out_mtx; + err = au_alive_dir(dentry); + if (unlikely(err)) + goto out_si; + /* todo: reval? */ + fi_read_lock(file); + + err = -EAGAIN; + if (unlikely(au_ftest_rdu(cookie->flags, CONT) + && cookie->generation != au_figen(file))) + goto out_unlock; + + err = 0; + if (!rdu->blk) { + rdu->blk = au_sbi(arg.sb)->si_rdblk; + if (!rdu->blk) + rdu->blk = au_dir_size(file, /*dentry*/NULL); + } + bend = au_fbstart(file); + if (cookie->bindex < bend) + cookie->bindex = bend; + bend = au_fbend_dir(file); + /* AuDbg("b%d, b%d\n", cookie->bindex, bend); */ + for (; !err && cookie->bindex <= bend; + cookie->bindex++, cookie->h_pos = 0) { + h_file = au_hf_dir(file, cookie->bindex); + if (!h_file) + continue; + + au_fclr_rdu(cookie->flags, FULL); + err = au_rdu_do(h_file, &arg); + AuTraceErr(err); + if (unlikely(au_ftest_rdu(cookie->flags, FULL) || err)) + break; + } + AuDbg("rent %llu\n", rdu->rent); + + if (!err && !au_ftest_rdu(cookie->flags, CONT)) { + rdu->shwh = !!au_opt_test(au_sbi(arg.sb)->si_mntflags, SHWH); + au_fset_rdu(cookie->flags, CONT); + cookie->generation = au_figen(file); + } + + ii_read_lock_child(inode); + fsstack_copy_attr_atime(inode, au_h_iptr(inode, au_ibstart(inode))); + ii_read_unlock(inode); + +out_unlock: + fi_read_unlock(file); +out_si: + si_read_unlock(arg.sb); +out_mtx: + mutex_unlock(&inode->i_mutex); +out: + AuTraceErr(err); + return err; +} + +static int au_rdu_ino(struct file *file, struct aufs_rdu *rdu) +{ + int err; + ino_t ino; + unsigned long long nent; + union au_rdu_ent_ul *u; + struct au_rdu_ent ent; + struct super_block *sb; + + err = 0; + nent = rdu->nent; + u = &rdu->ent; + sb = file->f_dentry->d_sb; + si_read_lock(sb, AuLock_FLUSH); + while (nent-- > 0) { + /* unnecessary to support mmap_sem since this is a dir */ + err = copy_from_user(&ent, u->e, sizeof(ent)); + if (!err) + err = !access_ok(VERIFY_WRITE, &u->e->ino, sizeof(ino)); + if (unlikely(err)) { + err = -EFAULT; + AuTraceErr(err); + break; + } + + /* AuDbg("b%d, i%llu\n", ent.bindex, ent.ino); */ + if (!ent.wh) + err = au_ino(sb, ent.bindex, ent.ino, ent.type, &ino); + else + err = au_wh_ino(sb, ent.bindex, ent.ino, ent.type, + &ino); + if (unlikely(err)) { + AuTraceErr(err); + break; + } + + err = __put_user(ino, &u->e->ino); + if (unlikely(err)) { + err = -EFAULT; + AuTraceErr(err); + break; + } + u->ul += au_rdu_len(ent.nlen); + } + si_read_unlock(sb); + + return err; +} + +/* ---------------------------------------------------------------------- */ + +static int au_rdu_verify(struct aufs_rdu *rdu) +{ + AuDbg("rdu{%llu, %p, %u | %u | %llu, %u, %u | " + "%llu, b%d, 0x%x, g%u}\n", + rdu->sz, rdu->ent.e, rdu->verify[AufsCtlRduV_SZ], + rdu->blk, + rdu->rent, rdu->shwh, rdu->full, + rdu->cookie.h_pos, rdu->cookie.bindex, rdu->cookie.flags, + rdu->cookie.generation); + + if (rdu->verify[AufsCtlRduV_SZ] == sizeof(*rdu)) + return 0; + + AuDbg("%u:%u\n", + rdu->verify[AufsCtlRduV_SZ], (unsigned int)sizeof(*rdu)); + return -EINVAL; +} + +long au_rdu_ioctl(struct file *file, unsigned int cmd, unsigned long arg) +{ + long err, e; + struct aufs_rdu rdu; + void __user *p = (void __user *)arg; + + err = copy_from_user(&rdu, p, sizeof(rdu)); + if (unlikely(err)) { + err = -EFAULT; + AuTraceErr(err); + goto out; + } + err = au_rdu_verify(&rdu); + if (unlikely(err)) + goto out; + + switch (cmd) { + case AUFS_CTL_RDU: + err = au_rdu(file, &rdu); + if (unlikely(err)) + break; + + e = copy_to_user(p, &rdu, sizeof(rdu)); + if (unlikely(e)) { + err = -EFAULT; + AuTraceErr(err); + } + break; + case AUFS_CTL_RDU_INO: + err = au_rdu_ino(file, &rdu); + break; + + default: + /* err = -ENOTTY; */ + err = -EINVAL; + } + +out: + AuTraceErr(err); + return err; +} + +#ifdef CONFIG_COMPAT +long au_rdu_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) +{ + long err, e; + struct aufs_rdu rdu; + void __user *p = compat_ptr(arg); + + /* todo: get_user()? */ + err = copy_from_user(&rdu, p, sizeof(rdu)); + if (unlikely(err)) { + err = -EFAULT; + AuTraceErr(err); + goto out; + } + rdu.ent.e = compat_ptr(rdu.ent.ul); + err = au_rdu_verify(&rdu); + if (unlikely(err)) + goto out; + + switch (cmd) { + case AUFS_CTL_RDU: + err = au_rdu(file, &rdu); + if (unlikely(err)) + break; + + rdu.ent.ul = ptr_to_compat(rdu.ent.e); + rdu.tail.ul = ptr_to_compat(rdu.tail.e); + e = copy_to_user(p, &rdu, sizeof(rdu)); + if (unlikely(e)) { + err = -EFAULT; + AuTraceErr(err); + } + break; + case AUFS_CTL_RDU_INO: + err = au_rdu_ino(file, &rdu); + break; + + default: + /* err = -ENOTTY; */ + err = -EINVAL; + } + +out: + AuTraceErr(err); + return err; +} +#endif diff --git a/fs/aufs/rwsem.h b/fs/aufs/rwsem.h new file mode 100644 index 00000000000000..0704b079d17bdd --- /dev/null +++ b/fs/aufs/rwsem.h @@ -0,0 +1,191 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * simple read-write semaphore wrappers + */ + +#ifndef __AUFS_RWSEM_H__ +#define __AUFS_RWSEM_H__ + +#ifdef __KERNEL__ + +#include "debug.h" + +struct au_rwsem { + struct rw_semaphore rwsem; +#ifdef CONFIG_AUFS_DEBUG + /* just for debugging, not almighty counter */ + atomic_t rcnt, wcnt; +#endif +}; + +#ifdef CONFIG_AUFS_DEBUG +#define AuDbgCntInit(rw) do { \ + atomic_set(&(rw)->rcnt, 0); \ + atomic_set(&(rw)->wcnt, 0); \ + smp_mb(); /* atomic set */ \ +} while (0) + +#define AuDbgRcntInc(rw) atomic_inc(&(rw)->rcnt) +#define AuDbgRcntDec(rw) WARN_ON(atomic_dec_return(&(rw)->rcnt) < 0) +#define AuDbgWcntInc(rw) atomic_inc(&(rw)->wcnt) +#define AuDbgWcntDec(rw) WARN_ON(atomic_dec_return(&(rw)->wcnt) < 0) +#else +#define AuDbgCntInit(rw) do {} while (0) +#define AuDbgRcntInc(rw) do {} while (0) +#define AuDbgRcntDec(rw) do {} while (0) +#define AuDbgWcntInc(rw) do {} while (0) +#define AuDbgWcntDec(rw) do {} while (0) +#endif /* CONFIG_AUFS_DEBUG */ + +/* to debug easier, do not make them inlined functions */ +#define AuRwMustNoWaiters(rw) AuDebugOn(!list_empty(&(rw)->rwsem.wait_list)) +/* rwsem_is_locked() is unusable */ +#define AuRwMustReadLock(rw) AuDebugOn(atomic_read(&(rw)->rcnt) <= 0) +#define AuRwMustWriteLock(rw) AuDebugOn(atomic_read(&(rw)->wcnt) <= 0) +#define AuRwMustAnyLock(rw) AuDebugOn(atomic_read(&(rw)->rcnt) <= 0 \ + && atomic_read(&(rw)->wcnt) <= 0) +#define AuRwDestroy(rw) AuDebugOn(atomic_read(&(rw)->rcnt) \ + || atomic_read(&(rw)->wcnt)) + +#define au_rw_class(rw, key) lockdep_set_class(&(rw)->rwsem, key) + +static inline void au_rw_init(struct au_rwsem *rw) +{ + AuDbgCntInit(rw); + init_rwsem(&rw->rwsem); +} + +static inline void au_rw_init_wlock(struct au_rwsem *rw) +{ + au_rw_init(rw); + down_write(&rw->rwsem); + AuDbgWcntInc(rw); +} + +static inline void au_rw_init_wlock_nested(struct au_rwsem *rw, + unsigned int lsc) +{ + au_rw_init(rw); + down_write_nested(&rw->rwsem, lsc); + AuDbgWcntInc(rw); +} + +static inline void au_rw_read_lock(struct au_rwsem *rw) +{ + down_read(&rw->rwsem); + AuDbgRcntInc(rw); +} + +static inline void au_rw_read_lock_nested(struct au_rwsem *rw, unsigned int lsc) +{ + down_read_nested(&rw->rwsem, lsc); + AuDbgRcntInc(rw); +} + +static inline void au_rw_read_unlock(struct au_rwsem *rw) +{ + AuRwMustReadLock(rw); + AuDbgRcntDec(rw); + up_read(&rw->rwsem); +} + +static inline void au_rw_dgrade_lock(struct au_rwsem *rw) +{ + AuRwMustWriteLock(rw); + AuDbgRcntInc(rw); + AuDbgWcntDec(rw); + downgrade_write(&rw->rwsem); +} + +static inline void au_rw_write_lock(struct au_rwsem *rw) +{ + down_write(&rw->rwsem); + AuDbgWcntInc(rw); +} + +static inline void au_rw_write_lock_nested(struct au_rwsem *rw, + unsigned int lsc) +{ + down_write_nested(&rw->rwsem, lsc); + AuDbgWcntInc(rw); +} + +static inline void au_rw_write_unlock(struct au_rwsem *rw) +{ + AuRwMustWriteLock(rw); + AuDbgWcntDec(rw); + up_write(&rw->rwsem); +} + +/* why is not _nested version defined */ +static inline int au_rw_read_trylock(struct au_rwsem *rw) +{ + int ret; + + ret = down_read_trylock(&rw->rwsem); + if (ret) + AuDbgRcntInc(rw); + return ret; +} + +static inline int au_rw_write_trylock(struct au_rwsem *rw) +{ + int ret; + + ret = down_write_trylock(&rw->rwsem); + if (ret) + AuDbgWcntInc(rw); + return ret; +} + +#undef AuDbgCntInit +#undef AuDbgRcntInc +#undef AuDbgRcntDec +#undef AuDbgWcntInc +#undef AuDbgWcntDec + +#define AuSimpleLockRwsemFuncs(prefix, param, rwsem) \ +static inline void prefix##_read_lock(param) \ +{ au_rw_read_lock(rwsem); } \ +static inline void prefix##_write_lock(param) \ +{ au_rw_write_lock(rwsem); } \ +static inline int prefix##_read_trylock(param) \ +{ return au_rw_read_trylock(rwsem); } \ +static inline int prefix##_write_trylock(param) \ +{ return au_rw_write_trylock(rwsem); } +/* why is not _nested version defined */ +/* static inline void prefix##_read_trylock_nested(param, lsc) +{ au_rw_read_trylock_nested(rwsem, lsc)); } +static inline void prefix##_write_trylock_nestd(param, lsc) +{ au_rw_write_trylock_nested(rwsem, lsc); } */ + +#define AuSimpleUnlockRwsemFuncs(prefix, param, rwsem) \ +static inline void prefix##_read_unlock(param) \ +{ au_rw_read_unlock(rwsem); } \ +static inline void prefix##_write_unlock(param) \ +{ au_rw_write_unlock(rwsem); } \ +static inline void prefix##_downgrade_lock(param) \ +{ au_rw_dgrade_lock(rwsem); } + +#define AuSimpleRwsemFuncs(prefix, param, rwsem) \ + AuSimpleLockRwsemFuncs(prefix, param, rwsem) \ + AuSimpleUnlockRwsemFuncs(prefix, param, rwsem) + +#endif /* __KERNEL__ */ +#endif /* __AUFS_RWSEM_H__ */ diff --git a/fs/aufs/sbinfo.c b/fs/aufs/sbinfo.c new file mode 100644 index 00000000000000..435214f19ef87b --- /dev/null +++ b/fs/aufs/sbinfo.c @@ -0,0 +1,353 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * superblock private data + */ + +#include "aufs.h" + +/* + * they are necessary regardless sysfs is disabled. + */ +void au_si_free(struct kobject *kobj) +{ + int i; + struct au_sbinfo *sbinfo; + char *locked __maybe_unused; /* debug only */ + + sbinfo = container_of(kobj, struct au_sbinfo, si_kobj); + for (i = 0; i < AuPlink_NHASH; i++) + AuDebugOn(!hlist_empty(&sbinfo->si_plink[i].head)); + AuDebugOn(atomic_read(&sbinfo->si_nowait.nw_len)); + + au_rw_write_lock(&sbinfo->si_rwsem); + au_br_free(sbinfo); + au_rw_write_unlock(&sbinfo->si_rwsem); + + AuDebugOn(radix_tree_gang_lookup + (&sbinfo->au_si_pid.tree, (void **)&locked, + /*first_index*/PID_MAX_DEFAULT - 1, + /*max_items*/sizeof(locked)/sizeof(*locked))); + + kfree(sbinfo->si_branch); + kfree(sbinfo->au_si_pid.bitmap); + mutex_destroy(&sbinfo->si_xib_mtx); + AuRwDestroy(&sbinfo->si_rwsem); + + kfree(sbinfo); +} + +int au_si_alloc(struct super_block *sb) +{ + int err, i; + struct au_sbinfo *sbinfo; + static struct lock_class_key aufs_si; + + err = -ENOMEM; + sbinfo = kzalloc(sizeof(*sbinfo), GFP_NOFS); + if (unlikely(!sbinfo)) + goto out; + + BUILD_BUG_ON(sizeof(unsigned long) != + sizeof(*sbinfo->au_si_pid.bitmap)); + sbinfo->au_si_pid.bitmap = kcalloc(BITS_TO_LONGS(PID_MAX_DEFAULT), + sizeof(*sbinfo->au_si_pid.bitmap), + GFP_NOFS); + if (unlikely(!sbinfo->au_si_pid.bitmap)) + goto out_sbinfo; + + /* will be reallocated separately */ + sbinfo->si_branch = kzalloc(sizeof(*sbinfo->si_branch), GFP_NOFS); + if (unlikely(!sbinfo->si_branch)) + goto out_pidmap; + + err = sysaufs_si_init(sbinfo); + if (unlikely(err)) + goto out_br; + + au_nwt_init(&sbinfo->si_nowait); + au_rw_init_wlock(&sbinfo->si_rwsem); + au_rw_class(&sbinfo->si_rwsem, &aufs_si); + spin_lock_init(&sbinfo->au_si_pid.tree_lock); + INIT_RADIX_TREE(&sbinfo->au_si_pid.tree, GFP_ATOMIC | __GFP_NOFAIL); + + atomic_long_set(&sbinfo->si_ninodes, 0); + atomic_long_set(&sbinfo->si_nfiles, 0); + + sbinfo->si_bend = -1; + sbinfo->si_last_br_id = AUFS_BRANCH_MAX / 2; + + sbinfo->si_wbr_copyup = AuWbrCopyup_Def; + sbinfo->si_wbr_create = AuWbrCreate_Def; + sbinfo->si_wbr_copyup_ops = au_wbr_copyup_ops + sbinfo->si_wbr_copyup; + sbinfo->si_wbr_create_ops = au_wbr_create_ops + sbinfo->si_wbr_create; + + au_fhsm_init(sbinfo); + + sbinfo->si_mntflags = au_opts_plink(AuOpt_Def); + + sbinfo->si_xino_jiffy = jiffies; + sbinfo->si_xino_expire + = msecs_to_jiffies(AUFS_XINO_DEF_SEC * MSEC_PER_SEC); + mutex_init(&sbinfo->si_xib_mtx); + sbinfo->si_xino_brid = -1; + /* leave si_xib_last_pindex and si_xib_next_bit */ + + sbinfo->si_rdcache = msecs_to_jiffies(AUFS_RDCACHE_DEF * MSEC_PER_SEC); + sbinfo->si_rdblk = AUFS_RDBLK_DEF; + sbinfo->si_rdhash = AUFS_RDHASH_DEF; + sbinfo->si_dirwh = AUFS_DIRWH_DEF; + + for (i = 0; i < AuPlink_NHASH; i++) + au_sphl_init(sbinfo->si_plink + i); + init_waitqueue_head(&sbinfo->si_plink_wq); + spin_lock_init(&sbinfo->si_plink_maint_lock); + + au_sphl_init(&sbinfo->si_files); + + /* leave other members for sysaufs and si_mnt. */ + sbinfo->si_sb = sb; + sb->s_fs_info = sbinfo; + si_pid_set(sb); + au_debug_sbinfo_init(sbinfo); + return 0; /* success */ + +out_br: + kfree(sbinfo->si_branch); +out_pidmap: + kfree(sbinfo->au_si_pid.bitmap); +out_sbinfo: + kfree(sbinfo); +out: + return err; +} + +int au_sbr_realloc(struct au_sbinfo *sbinfo, int nbr) +{ + int err, sz; + struct au_branch **brp; + + AuRwMustWriteLock(&sbinfo->si_rwsem); + + err = -ENOMEM; + sz = sizeof(*brp) * (sbinfo->si_bend + 1); + if (unlikely(!sz)) + sz = sizeof(*brp); + brp = au_kzrealloc(sbinfo->si_branch, sz, sizeof(*brp) * nbr, GFP_NOFS); + if (brp) { + sbinfo->si_branch = brp; + err = 0; + } + + return err; +} + +/* ---------------------------------------------------------------------- */ + +unsigned int au_sigen_inc(struct super_block *sb) +{ + unsigned int gen; + + SiMustWriteLock(sb); + + gen = ++au_sbi(sb)->si_generation; + au_update_digen(sb->s_root); + au_update_iigen(sb->s_root->d_inode, /*half*/0); + sb->s_root->d_inode->i_version++; + return gen; +} + +aufs_bindex_t au_new_br_id(struct super_block *sb) +{ + aufs_bindex_t br_id; + int i; + struct au_sbinfo *sbinfo; + + SiMustWriteLock(sb); + + sbinfo = au_sbi(sb); + for (i = 0; i <= AUFS_BRANCH_MAX; i++) { + br_id = ++sbinfo->si_last_br_id; + AuDebugOn(br_id < 0); + if (br_id && au_br_index(sb, br_id) < 0) + return br_id; + } + + return -1; +} + +/* ---------------------------------------------------------------------- */ + +/* it is ok that new 'nwt' tasks are appended while we are sleeping */ +int si_read_lock(struct super_block *sb, int flags) +{ + int err; + + err = 0; + if (au_ftest_lock(flags, FLUSH)) + au_nwt_flush(&au_sbi(sb)->si_nowait); + + si_noflush_read_lock(sb); + err = au_plink_maint(sb, flags); + if (unlikely(err)) + si_read_unlock(sb); + + return err; +} + +int si_write_lock(struct super_block *sb, int flags) +{ + int err; + + if (au_ftest_lock(flags, FLUSH)) + au_nwt_flush(&au_sbi(sb)->si_nowait); + + si_noflush_write_lock(sb); + err = au_plink_maint(sb, flags); + if (unlikely(err)) + si_write_unlock(sb); + + return err; +} + +/* dentry and super_block lock. call at entry point */ +int aufs_read_lock(struct dentry *dentry, int flags) +{ + int err; + struct super_block *sb; + + sb = dentry->d_sb; + err = si_read_lock(sb, flags); + if (unlikely(err)) + goto out; + + if (au_ftest_lock(flags, DW)) + di_write_lock_child(dentry); + else + di_read_lock_child(dentry, flags); + + if (au_ftest_lock(flags, GEN)) { + err = au_digen_test(dentry, au_sigen(sb)); + AuDebugOn(!err && au_dbrange_test(dentry)); + if (unlikely(err)) + aufs_read_unlock(dentry, flags); + } + +out: + return err; +} + +void aufs_read_unlock(struct dentry *dentry, int flags) +{ + if (au_ftest_lock(flags, DW)) + di_write_unlock(dentry); + else + di_read_unlock(dentry, flags); + si_read_unlock(dentry->d_sb); +} + +void aufs_write_lock(struct dentry *dentry) +{ + si_write_lock(dentry->d_sb, AuLock_FLUSH | AuLock_NOPLMW); + di_write_lock_child(dentry); +} + +void aufs_write_unlock(struct dentry *dentry) +{ + di_write_unlock(dentry); + si_write_unlock(dentry->d_sb); +} + +int aufs_read_and_write_lock2(struct dentry *d1, struct dentry *d2, int flags) +{ + int err; + unsigned int sigen; + struct super_block *sb; + + sb = d1->d_sb; + err = si_read_lock(sb, flags); + if (unlikely(err)) + goto out; + + di_write_lock2_child(d1, d2, au_ftest_lock(flags, DIR)); + + if (au_ftest_lock(flags, GEN)) { + sigen = au_sigen(sb); + err = au_digen_test(d1, sigen); + AuDebugOn(!err && au_dbrange_test(d1)); + if (!err) { + err = au_digen_test(d2, sigen); + AuDebugOn(!err && au_dbrange_test(d2)); + } + if (unlikely(err)) + aufs_read_and_write_unlock2(d1, d2); + } + +out: + return err; +} + +void aufs_read_and_write_unlock2(struct dentry *d1, struct dentry *d2) +{ + di_write_unlock2(d1, d2); + si_read_unlock(d1->d_sb); +} + +/* ---------------------------------------------------------------------- */ + +int si_pid_test_slow(struct super_block *sb) +{ + void *p; + + rcu_read_lock(); + p = radix_tree_lookup(&au_sbi(sb)->au_si_pid.tree, current->pid); + rcu_read_unlock(); + + return (long)!!p; +} + +void si_pid_set_slow(struct super_block *sb) +{ + int err; + struct au_sbinfo *sbinfo; + + AuDebugOn(si_pid_test_slow(sb)); + + sbinfo = au_sbi(sb); + err = radix_tree_preload(GFP_NOFS | __GFP_NOFAIL); + AuDebugOn(err); + spin_lock(&sbinfo->au_si_pid.tree_lock); + err = radix_tree_insert(&sbinfo->au_si_pid.tree, current->pid, + /*any valid ptr*/sb); + spin_unlock(&sbinfo->au_si_pid.tree_lock); + AuDebugOn(err); + radix_tree_preload_end(); +} + +void si_pid_clr_slow(struct super_block *sb) +{ + void *p; + struct au_sbinfo *sbinfo; + + AuDebugOn(!si_pid_test_slow(sb)); + + sbinfo = au_sbi(sb); + spin_lock(&sbinfo->au_si_pid.tree_lock); + p = radix_tree_delete(&sbinfo->au_si_pid.tree, current->pid); + spin_unlock(&sbinfo->au_si_pid.tree_lock); +} diff --git a/fs/aufs/spl.h b/fs/aufs/spl.h new file mode 100644 index 00000000000000..fbcd820fbfaeef --- /dev/null +++ b/fs/aufs/spl.h @@ -0,0 +1,111 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * simple list protected by a spinlock + */ + +#ifndef __AUFS_SPL_H__ +#define __AUFS_SPL_H__ + +#ifdef __KERNEL__ + +struct au_splhead { + spinlock_t spin; + struct list_head head; +}; + +static inline void au_spl_init(struct au_splhead *spl) +{ + spin_lock_init(&spl->spin); + INIT_LIST_HEAD(&spl->head); +} + +static inline void au_spl_add(struct list_head *list, struct au_splhead *spl) +{ + spin_lock(&spl->spin); + list_add(list, &spl->head); + spin_unlock(&spl->spin); +} + +static inline void au_spl_del(struct list_head *list, struct au_splhead *spl) +{ + spin_lock(&spl->spin); + list_del(list); + spin_unlock(&spl->spin); +} + +static inline void au_spl_del_rcu(struct list_head *list, + struct au_splhead *spl) +{ + spin_lock(&spl->spin); + list_del_rcu(list); + spin_unlock(&spl->spin); +} + +/* ---------------------------------------------------------------------- */ + +struct au_sphlhead { + spinlock_t spin; + struct hlist_head head; +}; + +static inline void au_sphl_init(struct au_sphlhead *sphl) +{ + spin_lock_init(&sphl->spin); + INIT_HLIST_HEAD(&sphl->head); +} + +static inline void au_sphl_add(struct hlist_node *hlist, + struct au_sphlhead *sphl) +{ + spin_lock(&sphl->spin); + hlist_add_head(hlist, &sphl->head); + spin_unlock(&sphl->spin); +} + +static inline void au_sphl_del(struct hlist_node *hlist, + struct au_sphlhead *sphl) +{ + spin_lock(&sphl->spin); + hlist_del(hlist); + spin_unlock(&sphl->spin); +} + +static inline void au_sphl_del_rcu(struct hlist_node *hlist, + struct au_sphlhead *sphl) +{ + spin_lock(&sphl->spin); + hlist_del_rcu(hlist); + spin_unlock(&sphl->spin); +} + +static inline unsigned long au_sphl_count(struct au_sphlhead *sphl) +{ + unsigned long cnt; + struct hlist_node *pos; + + cnt = 0; + spin_lock(&sphl->spin); + hlist_for_each(pos, &sphl->head) + cnt++; + spin_unlock(&sphl->spin); + return cnt; +} + +#endif /* __KERNEL__ */ +#endif /* __AUFS_SPL_H__ */ diff --git a/fs/aufs/super.c b/fs/aufs/super.c new file mode 100644 index 00000000000000..41a02b2cbdc71e --- /dev/null +++ b/fs/aufs/super.c @@ -0,0 +1,1008 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * mount and super_block operations + */ + +#include +#include +#include +#include +#include +#include +#include "aufs.h" + +/* + * super_operations + */ +static struct inode *aufs_alloc_inode(struct super_block *sb __maybe_unused) +{ + struct au_icntnr *c; + + c = au_cache_alloc_icntnr(); + if (c) { + au_icntnr_init(c); + c->vfs_inode.i_version = 1; /* sigen(sb); */ + c->iinfo.ii_hinode = NULL; + return &c->vfs_inode; + } + return NULL; +} + +static void aufs_destroy_inode_cb(struct rcu_head *head) +{ + struct inode *inode = container_of(head, struct inode, i_rcu); + + INIT_HLIST_HEAD(&inode->i_dentry); + au_cache_free_icntnr(container_of(inode, struct au_icntnr, vfs_inode)); +} + +static void aufs_destroy_inode(struct inode *inode) +{ + au_iinfo_fin(inode); + call_rcu(&inode->i_rcu, aufs_destroy_inode_cb); +} + +struct inode *au_iget_locked(struct super_block *sb, ino_t ino) +{ + struct inode *inode; + int err; + + inode = iget_locked(sb, ino); + if (unlikely(!inode)) { + inode = ERR_PTR(-ENOMEM); + goto out; + } + if (!(inode->i_state & I_NEW)) + goto out; + + err = au_xigen_new(inode); + if (!err) + err = au_iinfo_init(inode); + if (!err) + inode->i_version++; + else { + iget_failed(inode); + inode = ERR_PTR(err); + } + +out: + /* never return NULL */ + AuDebugOn(!inode); + AuTraceErrPtr(inode); + return inode; +} + +/* lock free root dinfo */ +static int au_show_brs(struct seq_file *seq, struct super_block *sb) +{ + int err; + aufs_bindex_t bindex, bend; + struct path path; + struct au_hdentry *hdp; + struct au_branch *br; + au_br_perm_str_t perm; + + err = 0; + bend = au_sbend(sb); + hdp = au_di(sb->s_root)->di_hdentry; + for (bindex = 0; !err && bindex <= bend; bindex++) { + br = au_sbr(sb, bindex); + path.mnt = au_br_mnt(br); + path.dentry = hdp[bindex].hd_dentry; + err = au_seq_path(seq, &path); + if (err > 0) { + au_optstr_br_perm(&perm, br->br_perm); + err = seq_printf(seq, "=%s", perm.a); + if (err == -1) + err = -E2BIG; + } + if (!err && bindex != bend) + err = seq_putc(seq, ':'); + } + + return err; +} + +static void au_show_wbr_create(struct seq_file *m, int v, + struct au_sbinfo *sbinfo) +{ + const char *pat; + + AuRwMustAnyLock(&sbinfo->si_rwsem); + + seq_puts(m, ",create="); + pat = au_optstr_wbr_create(v); + switch (v) { + case AuWbrCreate_TDP: + case AuWbrCreate_RR: + case AuWbrCreate_MFS: + case AuWbrCreate_PMFS: + seq_puts(m, pat); + break; + case AuWbrCreate_MFSV: + seq_printf(m, /*pat*/"mfs:%lu", + jiffies_to_msecs(sbinfo->si_wbr_mfs.mfs_expire) + / MSEC_PER_SEC); + break; + case AuWbrCreate_PMFSV: + seq_printf(m, /*pat*/"pmfs:%lu", + jiffies_to_msecs(sbinfo->si_wbr_mfs.mfs_expire) + / MSEC_PER_SEC); + break; + case AuWbrCreate_MFSRR: + seq_printf(m, /*pat*/"mfsrr:%llu", + sbinfo->si_wbr_mfs.mfsrr_watermark); + break; + case AuWbrCreate_MFSRRV: + seq_printf(m, /*pat*/"mfsrr:%llu:%lu", + sbinfo->si_wbr_mfs.mfsrr_watermark, + jiffies_to_msecs(sbinfo->si_wbr_mfs.mfs_expire) + / MSEC_PER_SEC); + break; + case AuWbrCreate_PMFSRR: + seq_printf(m, /*pat*/"pmfsrr:%llu", + sbinfo->si_wbr_mfs.mfsrr_watermark); + break; + case AuWbrCreate_PMFSRRV: + seq_printf(m, /*pat*/"pmfsrr:%llu:%lu", + sbinfo->si_wbr_mfs.mfsrr_watermark, + jiffies_to_msecs(sbinfo->si_wbr_mfs.mfs_expire) + / MSEC_PER_SEC); + break; + } +} + +static int au_show_xino(struct seq_file *seq, struct super_block *sb) +{ +#ifdef CONFIG_SYSFS + return 0; +#else + int err; + const int len = sizeof(AUFS_XINO_FNAME) - 1; + aufs_bindex_t bindex, brid; + struct qstr *name; + struct file *f; + struct dentry *d, *h_root; + struct au_hdentry *hdp; + + AuRwMustAnyLock(&sbinfo->si_rwsem); + + err = 0; + f = au_sbi(sb)->si_xib; + if (!f) + goto out; + + /* stop printing the default xino path on the first writable branch */ + h_root = NULL; + brid = au_xino_brid(sb); + if (brid >= 0) { + bindex = au_br_index(sb, brid); + hdp = au_di(sb->s_root)->di_hdentry; + h_root = hdp[0 + bindex].hd_dentry; + } + d = f->f_dentry; + name = &d->d_name; + /* safe ->d_parent because the file is unlinked */ + if (d->d_parent == h_root + && name->len == len + && !memcmp(name->name, AUFS_XINO_FNAME, len)) + goto out; + + seq_puts(seq, ",xino="); + err = au_xino_path(seq, f); + +out: + return err; +#endif +} + +/* seq_file will re-call me in case of too long string */ +static int aufs_show_options(struct seq_file *m, struct dentry *dentry) +{ + int err; + unsigned int mnt_flags, v; + struct super_block *sb; + struct au_sbinfo *sbinfo; + +#define AuBool(name, str) do { \ + v = au_opt_test(mnt_flags, name); \ + if (v != au_opt_test(AuOpt_Def, name)) \ + seq_printf(m, ",%s" #str, v ? "" : "no"); \ +} while (0) + +#define AuStr(name, str) do { \ + v = mnt_flags & AuOptMask_##name; \ + if (v != (AuOpt_Def & AuOptMask_##name)) \ + seq_printf(m, "," #str "=%s", au_optstr_##str(v)); \ +} while (0) + +#define AuUInt(name, str, val) do { \ + if (val != AUFS_##name##_DEF) \ + seq_printf(m, "," #str "=%u", val); \ +} while (0) + + sb = dentry->d_sb; + if (sb->s_flags & MS_POSIXACL) + seq_puts(m, ",acl"); + + /* lock free root dinfo */ + si_noflush_read_lock(sb); + sbinfo = au_sbi(sb); + seq_printf(m, ",si=%lx", sysaufs_si_id(sbinfo)); + + mnt_flags = au_mntflags(sb); + if (au_opt_test(mnt_flags, XINO)) { + err = au_show_xino(m, sb); + if (unlikely(err)) + goto out; + } else + seq_puts(m, ",noxino"); + + AuBool(TRUNC_XINO, trunc_xino); + AuStr(UDBA, udba); + AuBool(SHWH, shwh); + AuBool(PLINK, plink); + AuBool(DIO, dio); + AuBool(DIRPERM1, dirperm1); + /* AuBool(REFROF, refrof); */ + + v = sbinfo->si_wbr_create; + if (v != AuWbrCreate_Def) + au_show_wbr_create(m, v, sbinfo); + + v = sbinfo->si_wbr_copyup; + if (v != AuWbrCopyup_Def) + seq_printf(m, ",cpup=%s", au_optstr_wbr_copyup(v)); + + v = au_opt_test(mnt_flags, ALWAYS_DIROPQ); + if (v != au_opt_test(AuOpt_Def, ALWAYS_DIROPQ)) + seq_printf(m, ",diropq=%c", v ? 'a' : 'w'); + + AuUInt(DIRWH, dirwh, sbinfo->si_dirwh); + + v = jiffies_to_msecs(sbinfo->si_rdcache) / MSEC_PER_SEC; + AuUInt(RDCACHE, rdcache, v); + + AuUInt(RDBLK, rdblk, sbinfo->si_rdblk); + AuUInt(RDHASH, rdhash, sbinfo->si_rdhash); + + au_fhsm_show(m, sbinfo); + + AuBool(SUM, sum); + /* AuBool(SUM_W, wsum); */ + AuBool(WARN_PERM, warn_perm); + AuBool(VERBOSE, verbose); + +out: + /* be sure to print "br:" last */ + if (!sysaufs_brs) { + seq_puts(m, ",br:"); + au_show_brs(m, sb); + } + si_read_unlock(sb); + return 0; + +#undef AuBool +#undef AuStr +#undef AuUInt +} + +/* ---------------------------------------------------------------------- */ + +/* sum mode which returns the summation for statfs(2) */ + +static u64 au_add_till_max(u64 a, u64 b) +{ + u64 old; + + old = a; + a += b; + if (old <= a) + return a; + return ULLONG_MAX; +} + +static u64 au_mul_till_max(u64 a, long mul) +{ + u64 old; + + old = a; + a *= mul; + if (old <= a) + return a; + return ULLONG_MAX; +} + +static int au_statfs_sum(struct super_block *sb, struct kstatfs *buf) +{ + int err; + long bsize, factor; + u64 blocks, bfree, bavail, files, ffree; + aufs_bindex_t bend, bindex, i; + unsigned char shared; + struct path h_path; + struct super_block *h_sb; + + err = 0; + bsize = LONG_MAX; + files = 0; + ffree = 0; + blocks = 0; + bfree = 0; + bavail = 0; + bend = au_sbend(sb); + for (bindex = 0; bindex <= bend; bindex++) { + h_path.mnt = au_sbr_mnt(sb, bindex); + h_sb = h_path.mnt->mnt_sb; + shared = 0; + for (i = 0; !shared && i < bindex; i++) + shared = (au_sbr_sb(sb, i) == h_sb); + if (shared) + continue; + + /* sb->s_root for NFS is unreliable */ + h_path.dentry = h_path.mnt->mnt_root; + err = vfs_statfs(&h_path, buf); + if (unlikely(err)) + goto out; + + if (bsize > buf->f_bsize) { + /* + * we will reduce bsize, so we have to expand blocks + * etc. to match them again + */ + factor = (bsize / buf->f_bsize); + blocks = au_mul_till_max(blocks, factor); + bfree = au_mul_till_max(bfree, factor); + bavail = au_mul_till_max(bavail, factor); + bsize = buf->f_bsize; + } + + factor = (buf->f_bsize / bsize); + blocks = au_add_till_max(blocks, + au_mul_till_max(buf->f_blocks, factor)); + bfree = au_add_till_max(bfree, + au_mul_till_max(buf->f_bfree, factor)); + bavail = au_add_till_max(bavail, + au_mul_till_max(buf->f_bavail, factor)); + files = au_add_till_max(files, buf->f_files); + ffree = au_add_till_max(ffree, buf->f_ffree); + } + + buf->f_bsize = bsize; + buf->f_blocks = blocks; + buf->f_bfree = bfree; + buf->f_bavail = bavail; + buf->f_files = files; + buf->f_ffree = ffree; + buf->f_frsize = 0; + +out: + return err; +} + +static int aufs_statfs(struct dentry *dentry, struct kstatfs *buf) +{ + int err; + struct path h_path; + struct super_block *sb; + + /* lock free root dinfo */ + sb = dentry->d_sb; + si_noflush_read_lock(sb); + if (!au_opt_test(au_mntflags(sb), SUM)) { + /* sb->s_root for NFS is unreliable */ + h_path.mnt = au_sbr_mnt(sb, 0); + h_path.dentry = h_path.mnt->mnt_root; + err = vfs_statfs(&h_path, buf); + } else + err = au_statfs_sum(sb, buf); + si_read_unlock(sb); + + if (!err) { + buf->f_type = AUFS_SUPER_MAGIC; + buf->f_namelen = AUFS_MAX_NAMELEN; + memset(&buf->f_fsid, 0, sizeof(buf->f_fsid)); + } + /* buf->f_bsize = buf->f_blocks = buf->f_bfree = buf->f_bavail = -1; */ + + return err; +} + +/* ---------------------------------------------------------------------- */ + +static int aufs_sync_fs(struct super_block *sb, int wait) +{ + int err, e; + aufs_bindex_t bend, bindex; + struct au_branch *br; + struct super_block *h_sb; + + err = 0; + si_noflush_read_lock(sb); + bend = au_sbend(sb); + for (bindex = 0; bindex <= bend; bindex++) { + br = au_sbr(sb, bindex); + if (!au_br_writable(br->br_perm)) + continue; + + h_sb = au_sbr_sb(sb, bindex); + if (h_sb->s_op->sync_fs) { + e = h_sb->s_op->sync_fs(h_sb, wait); + if (unlikely(e && !err)) + err = e; + /* go on even if an error happens */ + } + } + si_read_unlock(sb); + + return err; +} + +/* ---------------------------------------------------------------------- */ + +/* final actions when unmounting a file system */ +static void aufs_put_super(struct super_block *sb) +{ + struct au_sbinfo *sbinfo; + + sbinfo = au_sbi(sb); + if (!sbinfo) + return; + + dbgaufs_si_fin(sbinfo); + kobject_put(&sbinfo->si_kobj); +} + +/* ---------------------------------------------------------------------- */ + +void au_array_free(void *array) +{ + if (array) { + if (!is_vmalloc_addr(array)) + kfree(array); + else + vfree(array); + } +} + +void *au_array_alloc(unsigned long long *hint, au_arraycb_t cb, void *arg) +{ + void *array; + unsigned long long n, sz; + + array = NULL; + n = 0; + if (!*hint) + goto out; + + if (*hint > ULLONG_MAX / sizeof(array)) { + array = ERR_PTR(-EMFILE); + pr_err("hint %llu\n", *hint); + goto out; + } + + sz = sizeof(array) * *hint; + array = kzalloc(sz, GFP_NOFS); + if (unlikely(!array)) + array = vzalloc(sz); + if (unlikely(!array)) { + array = ERR_PTR(-ENOMEM); + goto out; + } + + n = cb(array, *hint, arg); + AuDebugOn(n > *hint); + +out: + *hint = n; + return array; +} + +static unsigned long long au_iarray_cb(void *a, + unsigned long long max __maybe_unused, + void *arg) +{ + unsigned long long n; + struct inode **p, *inode; + struct list_head *head; + + n = 0; + p = a; + head = arg; + spin_lock(&inode_sb_list_lock); + list_for_each_entry(inode, head, i_sb_list) { + if (!is_bad_inode(inode) + && au_ii(inode)->ii_bstart >= 0) { + spin_lock(&inode->i_lock); + if (atomic_read(&inode->i_count)) { + au_igrab(inode); + *p++ = inode; + n++; + AuDebugOn(n > max); + } + spin_unlock(&inode->i_lock); + } + } + spin_unlock(&inode_sb_list_lock); + + return n; +} + +struct inode **au_iarray_alloc(struct super_block *sb, unsigned long long *max) +{ + *max = atomic_long_read(&au_sbi(sb)->si_ninodes); + return au_array_alloc(max, au_iarray_cb, &sb->s_inodes); +} + +void au_iarray_free(struct inode **a, unsigned long long max) +{ + unsigned long long ull; + + for (ull = 0; ull < max; ull++) + iput(a[ull]); + au_array_free(a); +} + +/* ---------------------------------------------------------------------- */ + +/* + * refresh dentry and inode at remount time. + */ +/* todo: consolidate with simple_reval_dpath() and au_reval_for_attr() */ +static int au_do_refresh(struct dentry *dentry, unsigned int dir_flags, + struct dentry *parent) +{ + int err; + + di_write_lock_child(dentry); + di_read_lock_parent(parent, AuLock_IR); + err = au_refresh_dentry(dentry, parent); + if (!err && dir_flags) + au_hn_reset(dentry->d_inode, dir_flags); + di_read_unlock(parent, AuLock_IR); + di_write_unlock(dentry); + + return err; +} + +static int au_do_refresh_d(struct dentry *dentry, unsigned int sigen, + struct au_sbinfo *sbinfo, + const unsigned int dir_flags) +{ + int err; + struct dentry *parent; + struct inode *inode; + + err = 0; + parent = dget_parent(dentry); + if (!au_digen_test(parent, sigen) && au_digen_test(dentry, sigen)) { + inode = dentry->d_inode; + if (inode) { + if (!S_ISDIR(inode->i_mode)) + err = au_do_refresh(dentry, /*dir_flags*/0, + parent); + else { + err = au_do_refresh(dentry, dir_flags, parent); + if (unlikely(err)) + au_fset_si(sbinfo, FAILED_REFRESH_DIR); + } + } else + err = au_do_refresh(dentry, /*dir_flags*/0, parent); + AuDbgDentry(dentry); + } + dput(parent); + + AuTraceErr(err); + return err; +} + +static int au_refresh_d(struct super_block *sb) +{ + int err, i, j, ndentry, e; + unsigned int sigen; + struct au_dcsub_pages dpages; + struct au_dpage *dpage; + struct dentry **dentries, *d; + struct au_sbinfo *sbinfo; + struct dentry *root = sb->s_root; + const unsigned int dir_flags = au_hi_flags(root->d_inode, /*isdir*/1); + + err = au_dpages_init(&dpages, GFP_NOFS); + if (unlikely(err)) + goto out; + err = au_dcsub_pages(&dpages, root, NULL, NULL); + if (unlikely(err)) + goto out_dpages; + + sigen = au_sigen(sb); + sbinfo = au_sbi(sb); + for (i = 0; i < dpages.ndpage; i++) { + dpage = dpages.dpages + i; + dentries = dpage->dentries; + ndentry = dpage->ndentry; + for (j = 0; j < ndentry; j++) { + d = dentries[j]; + e = au_do_refresh_d(d, sigen, sbinfo, dir_flags); + if (unlikely(e && !err)) + err = e; + /* go on even err */ + } + } + +out_dpages: + au_dpages_free(&dpages); +out: + return err; +} + +static int au_refresh_i(struct super_block *sb) +{ + int err, e; + unsigned int sigen; + unsigned long long max, ull; + struct inode *inode, **array; + + array = au_iarray_alloc(sb, &max); + err = PTR_ERR(array); + if (IS_ERR(array)) + goto out; + + err = 0; + sigen = au_sigen(sb); + for (ull = 0; ull < max; ull++) { + inode = array[ull]; + if (unlikely(!inode)) + break; + if (au_iigen(inode, NULL) != sigen) { + ii_write_lock_child(inode); + e = au_refresh_hinode_self(inode); + ii_write_unlock(inode); + if (unlikely(e)) { + pr_err("error %d, i%lu\n", e, inode->i_ino); + if (!err) + err = e; + /* go on even if err */ + } + } + } + + au_iarray_free(array, max); + +out: + return err; +} + +static void au_remount_refresh(struct super_block *sb) +{ + int err, e; + unsigned int udba; + aufs_bindex_t bindex, bend; + struct dentry *root; + struct inode *inode; + struct au_branch *br; + + au_sigen_inc(sb); + au_fclr_si(au_sbi(sb), FAILED_REFRESH_DIR); + + root = sb->s_root; + DiMustNoWaiters(root); + inode = root->d_inode; + IiMustNoWaiters(inode); + + udba = au_opt_udba(sb); + bend = au_sbend(sb); + for (bindex = 0; bindex <= bend; bindex++) { + br = au_sbr(sb, bindex); + err = au_hnotify_reset_br(udba, br, br->br_perm); + if (unlikely(err)) + AuIOErr("hnotify failed on br %d, %d, ignored\n", + bindex, err); + /* go on even if err */ + } + au_hn_reset(inode, au_hi_flags(inode, /*isdir*/1)); + + di_write_unlock(root); + err = au_refresh_d(sb); + e = au_refresh_i(sb); + if (unlikely(e && !err)) + err = e; + /* aufs_write_lock() calls ..._child() */ + di_write_lock_child(root); + + au_cpup_attr_all(inode, /*force*/1); + + if (unlikely(err)) + AuIOErr("refresh failed, ignored, %d\n", err); +} + +/* stop extra interpretation of errno in mount(8), and strange error messages */ +static int cvt_err(int err) +{ + AuTraceErr(err); + + switch (err) { + case -ENOENT: + case -ENOTDIR: + case -EEXIST: + case -EIO: + err = -EINVAL; + } + return err; +} + +static int aufs_remount_fs(struct super_block *sb, int *flags, char *data) +{ + int err, do_dx; + unsigned int mntflags; + struct au_opts opts; + struct dentry *root; + struct inode *inode; + struct au_sbinfo *sbinfo; + + err = 0; + root = sb->s_root; + if (!data || !*data) { + err = si_write_lock(sb, AuLock_FLUSH | AuLock_NOPLM); + if (!err) { + di_write_lock_child(root); + err = au_opts_verify(sb, *flags, /*pending*/0); + aufs_write_unlock(root); + } + goto out; + } + + err = -ENOMEM; + memset(&opts, 0, sizeof(opts)); + opts.opt = (void *)__get_free_page(GFP_NOFS); + if (unlikely(!opts.opt)) + goto out; + opts.max_opt = PAGE_SIZE / sizeof(*opts.opt); + opts.flags = AuOpts_REMOUNT; + opts.sb_flags = *flags; + + /* parse it before aufs lock */ + err = au_opts_parse(sb, data, &opts); + if (unlikely(err)) + goto out_opts; + + sbinfo = au_sbi(sb); + inode = root->d_inode; + mutex_lock(&inode->i_mutex); + err = si_write_lock(sb, AuLock_FLUSH | AuLock_NOPLM); + if (unlikely(err)) + goto out_mtx; + di_write_lock_child(root); + + /* au_opts_remount() may return an error */ + err = au_opts_remount(sb, &opts); + au_opts_free(&opts); + + if (au_ftest_opts(opts.flags, REFRESH)) + au_remount_refresh(sb); + + if (au_ftest_opts(opts.flags, REFRESH_DYAOP)) { + mntflags = au_mntflags(sb); + do_dx = !!au_opt_test(mntflags, DIO); + au_dy_arefresh(do_dx); + } + + au_fhsm_wrote_all(sb, /*force*/1); /* ?? */ + aufs_write_unlock(root); + +out_mtx: + mutex_unlock(&inode->i_mutex); +out_opts: + free_page((unsigned long)opts.opt); +out: + err = cvt_err(err); + AuTraceErr(err); + return err; +} + +static const struct super_operations aufs_sop = { + .alloc_inode = aufs_alloc_inode, + .destroy_inode = aufs_destroy_inode, + /* always deleting, no clearing */ + .drop_inode = generic_delete_inode, + .show_options = aufs_show_options, + .statfs = aufs_statfs, + .put_super = aufs_put_super, + .sync_fs = aufs_sync_fs, + .remount_fs = aufs_remount_fs +}; + +/* ---------------------------------------------------------------------- */ + +static int alloc_root(struct super_block *sb) +{ + int err; + struct inode *inode; + struct dentry *root; + + err = -ENOMEM; + inode = au_iget_locked(sb, AUFS_ROOT_INO); + err = PTR_ERR(inode); + if (IS_ERR(inode)) + goto out; + + inode->i_op = &aufs_dir_iop; + inode->i_fop = &aufs_dir_fop; + inode->i_mode = S_IFDIR; + set_nlink(inode, 2); + unlock_new_inode(inode); + + root = d_make_root(inode); + if (unlikely(!root)) + goto out; + err = PTR_ERR(root); + if (IS_ERR(root)) + goto out; + + err = au_di_init(root); + if (!err) { + sb->s_root = root; + return 0; /* success */ + } + dput(root); + +out: + return err; +} + +static int aufs_fill_super(struct super_block *sb, void *raw_data, + int silent __maybe_unused) +{ + int err; + struct au_opts opts; + struct dentry *root; + struct inode *inode; + char *arg = raw_data; + + if (unlikely(!arg || !*arg)) { + err = -EINVAL; + pr_err("no arg\n"); + goto out; + } + + err = -ENOMEM; + memset(&opts, 0, sizeof(opts)); + opts.opt = (void *)__get_free_page(GFP_NOFS); + if (unlikely(!opts.opt)) + goto out; + opts.max_opt = PAGE_SIZE / sizeof(*opts.opt); + opts.sb_flags = sb->s_flags; + + err = au_si_alloc(sb); + if (unlikely(err)) + goto out_opts; + + /* all timestamps always follow the ones on the branch */ + sb->s_flags |= MS_NOATIME | MS_NODIRATIME; + sb->s_op = &aufs_sop; + sb->s_d_op = &aufs_dop; + sb->s_magic = AUFS_SUPER_MAGIC; + sb->s_maxbytes = 0; + au_export_init(sb); + /* au_xattr_init(sb); */ + + err = alloc_root(sb); + if (unlikely(err)) { + si_write_unlock(sb); + goto out_info; + } + root = sb->s_root; + inode = root->d_inode; + + /* + * actually we can parse options regardless aufs lock here. + * but at remount time, parsing must be done before aufs lock. + * so we follow the same rule. + */ + ii_write_lock_parent(inode); + aufs_write_unlock(root); + err = au_opts_parse(sb, arg, &opts); + if (unlikely(err)) + goto out_root; + + /* lock vfs_inode first, then aufs. */ + mutex_lock(&inode->i_mutex); + aufs_write_lock(root); + err = au_opts_mount(sb, &opts); + au_opts_free(&opts); + aufs_write_unlock(root); + mutex_unlock(&inode->i_mutex); + if (!err) + goto out_opts; /* success */ + +out_root: + dput(root); + sb->s_root = NULL; +out_info: + dbgaufs_si_fin(au_sbi(sb)); + kobject_put(&au_sbi(sb)->si_kobj); + sb->s_fs_info = NULL; +out_opts: + free_page((unsigned long)opts.opt); +out: + AuTraceErr(err); + err = cvt_err(err); + AuTraceErr(err); + return err; +} + +/* ---------------------------------------------------------------------- */ + +static struct dentry *aufs_mount(struct file_system_type *fs_type, int flags, + const char *dev_name __maybe_unused, + void *raw_data) +{ + struct dentry *root; + struct super_block *sb; + + /* all timestamps always follow the ones on the branch */ + /* mnt->mnt_flags |= MNT_NOATIME | MNT_NODIRATIME; */ + root = mount_nodev(fs_type, flags, raw_data, aufs_fill_super); + if (IS_ERR(root)) + goto out; + + sb = root->d_sb; + si_write_lock(sb, !AuLock_FLUSH); + sysaufs_brs_add(sb, 0); + si_write_unlock(sb); + au_sbilist_add(sb); + +out: + return root; +} + +static void aufs_kill_sb(struct super_block *sb) +{ + struct au_sbinfo *sbinfo; + + sbinfo = au_sbi(sb); + if (sbinfo) { + au_sbilist_del(sb); + aufs_write_lock(sb->s_root); + au_fhsm_fin(sb); + if (sbinfo->si_wbr_create_ops->fin) + sbinfo->si_wbr_create_ops->fin(sb); + if (au_opt_test(sbinfo->si_mntflags, UDBA_HNOTIFY)) { + au_opt_set_udba(sbinfo->si_mntflags, UDBA_NONE); + au_remount_refresh(sb); + } + if (au_opt_test(sbinfo->si_mntflags, PLINK)) + au_plink_put(sb, /*verbose*/1); + au_xino_clr(sb); + sbinfo->si_sb = NULL; + aufs_write_unlock(sb->s_root); + au_nwt_flush(&sbinfo->si_nowait); + } + kill_anon_super(sb); +} + +struct file_system_type aufs_fs_type = { + .name = AUFS_FSTYPE, + /* a race between rename and others */ + .fs_flags = FS_RENAME_DOES_D_MOVE, + .mount = aufs_mount, + .kill_sb = aufs_kill_sb, + /* no need to __module_get() and module_put(). */ + .owner = THIS_MODULE, +}; diff --git a/fs/aufs/super.h b/fs/aufs/super.h new file mode 100644 index 00000000000000..dd9664e0cfa7d3 --- /dev/null +++ b/fs/aufs/super.h @@ -0,0 +1,641 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * super_block operations + */ + +#ifndef __AUFS_SUPER_H__ +#define __AUFS_SUPER_H__ + +#ifdef __KERNEL__ + +#include +#include "rwsem.h" +#include "spl.h" +#include "wkq.h" + +typedef ssize_t (*au_readf_t)(struct file *, char __user *, size_t, loff_t *); +typedef ssize_t (*au_writef_t)(struct file *, const char __user *, size_t, + loff_t *); + +/* policies to select one among multiple writable branches */ +struct au_wbr_copyup_operations { + int (*copyup)(struct dentry *dentry); +}; + +#define AuWbr_DIR 1 /* target is a dir */ +#define AuWbr_PARENT (1 << 1) /* always require a parent */ + +#define au_ftest_wbr(flags, name) ((flags) & AuWbr_##name) +#define au_fset_wbr(flags, name) { (flags) |= AuWbr_##name; } +#define au_fclr_wbr(flags, name) { (flags) &= ~AuWbr_##name; } + +struct au_wbr_create_operations { + int (*create)(struct dentry *dentry, unsigned int flags); + int (*init)(struct super_block *sb); + int (*fin)(struct super_block *sb); +}; + +struct au_wbr_mfs { + struct mutex mfs_lock; /* protect this structure */ + unsigned long mfs_jiffy; + unsigned long mfs_expire; + aufs_bindex_t mfs_bindex; + + unsigned long long mfsrr_bytes; + unsigned long long mfsrr_watermark; +}; + +struct pseudo_link { + union { + struct hlist_node hlist; + struct rcu_head rcu; + }; + struct inode *inode; +}; + +#define AuPlink_NHASH 100 +static inline int au_plink_hash(ino_t ino) +{ + return ino % AuPlink_NHASH; +} + +/* File-based Hierarchical Storage Management */ +struct au_fhsm { +#ifdef CONFIG_AUFS_FHSM + /* allow only one process who can receive the notification */ + spinlock_t fhsm_spin; + pid_t fhsm_pid; + wait_queue_head_t fhsm_wqh; + atomic_t fhsm_readable; + + /* these are protected by si_rwsem */ + unsigned long fhsm_expire; + aufs_bindex_t fhsm_bottom; +#endif +}; + +struct au_branch; +struct au_sbinfo { + /* nowait tasks in the system-wide workqueue */ + struct au_nowait_tasks si_nowait; + + /* + * tried sb->s_umount, but failed due to the dependecy between i_mutex. + * rwsem for au_sbinfo is necessary. + */ + struct au_rwsem si_rwsem; + + /* prevent recursive locking in deleting inode */ + struct { + unsigned long *bitmap; + spinlock_t tree_lock; + struct radix_tree_root tree; + } au_si_pid; + + /* + * dirty approach to protect sb->sb_inodes and ->s_files (gone) from + * remount. + */ + atomic_long_t si_ninodes, si_nfiles; + + /* branch management */ + unsigned int si_generation; + + /* see above flags */ + unsigned char au_si_status; + + aufs_bindex_t si_bend; + + /* dirty trick to keep br_id plus */ + unsigned int si_last_br_id : + sizeof(aufs_bindex_t) * BITS_PER_BYTE - 1; + struct au_branch **si_branch; + + /* policy to select a writable branch */ + unsigned char si_wbr_copyup; + unsigned char si_wbr_create; + struct au_wbr_copyup_operations *si_wbr_copyup_ops; + struct au_wbr_create_operations *si_wbr_create_ops; + + /* round robin */ + atomic_t si_wbr_rr_next; + + /* most free space */ + struct au_wbr_mfs si_wbr_mfs; + + /* File-based Hierarchical Storage Management */ + struct au_fhsm si_fhsm; + + /* mount flags */ + /* include/asm-ia64/siginfo.h defines a macro named si_flags */ + unsigned int si_mntflags; + + /* external inode number (bitmap and translation table) */ + au_readf_t si_xread; + au_writef_t si_xwrite; + struct file *si_xib; + struct mutex si_xib_mtx; /* protect xib members */ + unsigned long *si_xib_buf; + unsigned long si_xib_last_pindex; + int si_xib_next_bit; + aufs_bindex_t si_xino_brid; + unsigned long si_xino_jiffy; + unsigned long si_xino_expire; + /* reserved for future use */ + /* unsigned long long si_xib_limit; */ /* Max xib file size */ + +#ifdef CONFIG_AUFS_EXPORT + /* i_generation */ + struct file *si_xigen; + atomic_t si_xigen_next; +#endif + + /* vdir parameters */ + unsigned long si_rdcache; /* max cache time in jiffies */ + unsigned int si_rdblk; /* deblk size */ + unsigned int si_rdhash; /* hash size */ + + /* + * If the number of whiteouts are larger than si_dirwh, leave all of + * them after au_whtmp_ren to reduce the cost of rmdir(2). + * future fsck.aufs or kernel thread will remove them later. + * Otherwise, remove all whiteouts and the dir in rmdir(2). + */ + unsigned int si_dirwh; + + /* + * rename(2) a directory with all children. + */ + /* reserved for future use */ + /* int si_rendir; */ + + /* pseudo_link list */ + struct au_sphlhead si_plink[AuPlink_NHASH]; + wait_queue_head_t si_plink_wq; + spinlock_t si_plink_maint_lock; + pid_t si_plink_maint_pid; + + /* file list */ + struct au_sphlhead si_files; + + /* + * sysfs and lifetime management. + * this is not a small structure and it may be a waste of memory in case + * of sysfs is disabled, particulary when many aufs-es are mounted. + * but using sysfs is majority. + */ + struct kobject si_kobj; +#ifdef CONFIG_DEBUG_FS + struct dentry *si_dbgaufs; + struct dentry *si_dbgaufs_plink; + struct dentry *si_dbgaufs_xib; +#ifdef CONFIG_AUFS_EXPORT + struct dentry *si_dbgaufs_xigen; +#endif +#endif + +#ifdef CONFIG_AUFS_SBILIST + struct list_head si_list; +#endif + + /* dirty, necessary for unmounting, sysfs and sysrq */ + struct super_block *si_sb; +}; + +/* sbinfo status flags */ +/* + * set true when refresh_dirs() failed at remount time. + * then try refreshing dirs at access time again. + * if it is false, refreshing dirs at access time is unnecesary + */ +#define AuSi_FAILED_REFRESH_DIR 1 + +#define AuSi_FHSM (1 << 1) /* fhsm is active now */ + +#ifndef CONFIG_AUFS_FHSM +#undef AuSi_FHSM +#define AuSi_FHSM 0 +#endif + +static inline unsigned char au_do_ftest_si(struct au_sbinfo *sbi, + unsigned int flag) +{ + AuRwMustAnyLock(&sbi->si_rwsem); + return sbi->au_si_status & flag; +} +#define au_ftest_si(sbinfo, name) au_do_ftest_si(sbinfo, AuSi_##name) +#define au_fset_si(sbinfo, name) do { \ + AuRwMustWriteLock(&(sbinfo)->si_rwsem); \ + (sbinfo)->au_si_status |= AuSi_##name; \ +} while (0) +#define au_fclr_si(sbinfo, name) do { \ + AuRwMustWriteLock(&(sbinfo)->si_rwsem); \ + (sbinfo)->au_si_status &= ~AuSi_##name; \ +} while (0) + +/* ---------------------------------------------------------------------- */ + +/* policy to select one among writable branches */ +#define AuWbrCopyup(sbinfo, ...) \ + ((sbinfo)->si_wbr_copyup_ops->copyup(__VA_ARGS__)) +#define AuWbrCreate(sbinfo, ...) \ + ((sbinfo)->si_wbr_create_ops->create(__VA_ARGS__)) + +/* flags for si_read_lock()/aufs_read_lock()/di_read_lock() */ +#define AuLock_DW 1 /* write-lock dentry */ +#define AuLock_IR (1 << 1) /* read-lock inode */ +#define AuLock_IW (1 << 2) /* write-lock inode */ +#define AuLock_FLUSH (1 << 3) /* wait for 'nowait' tasks */ +#define AuLock_DIR (1 << 4) /* target is a dir */ +#define AuLock_NOPLM (1 << 5) /* return err in plm mode */ +#define AuLock_NOPLMW (1 << 6) /* wait for plm mode ends */ +#define AuLock_GEN (1 << 7) /* test digen/iigen */ +#define au_ftest_lock(flags, name) ((flags) & AuLock_##name) +#define au_fset_lock(flags, name) \ + do { (flags) |= AuLock_##name; } while (0) +#define au_fclr_lock(flags, name) \ + do { (flags) &= ~AuLock_##name; } while (0) + +/* ---------------------------------------------------------------------- */ + +/* super.c */ +extern struct file_system_type aufs_fs_type; +struct inode *au_iget_locked(struct super_block *sb, ino_t ino); +typedef unsigned long long (*au_arraycb_t)(void *array, unsigned long long max, + void *arg); +void au_array_free(void *array); +void *au_array_alloc(unsigned long long *hint, au_arraycb_t cb, void *arg); +struct inode **au_iarray_alloc(struct super_block *sb, unsigned long long *max); +void au_iarray_free(struct inode **a, unsigned long long max); + +/* sbinfo.c */ +void au_si_free(struct kobject *kobj); +int au_si_alloc(struct super_block *sb); +int au_sbr_realloc(struct au_sbinfo *sbinfo, int nbr); + +unsigned int au_sigen_inc(struct super_block *sb); +aufs_bindex_t au_new_br_id(struct super_block *sb); + +int si_read_lock(struct super_block *sb, int flags); +int si_write_lock(struct super_block *sb, int flags); +int aufs_read_lock(struct dentry *dentry, int flags); +void aufs_read_unlock(struct dentry *dentry, int flags); +void aufs_write_lock(struct dentry *dentry); +void aufs_write_unlock(struct dentry *dentry); +int aufs_read_and_write_lock2(struct dentry *d1, struct dentry *d2, int flags); +void aufs_read_and_write_unlock2(struct dentry *d1, struct dentry *d2); + +int si_pid_test_slow(struct super_block *sb); +void si_pid_set_slow(struct super_block *sb); +void si_pid_clr_slow(struct super_block *sb); + +/* wbr_policy.c */ +extern struct au_wbr_copyup_operations au_wbr_copyup_ops[]; +extern struct au_wbr_create_operations au_wbr_create_ops[]; +int au_cpdown_dirs(struct dentry *dentry, aufs_bindex_t bdst); +int au_wbr_nonopq(struct dentry *dentry, aufs_bindex_t bindex); +int au_wbr_do_copyup_bu(struct dentry *dentry, aufs_bindex_t bstart); + +/* mvdown.c */ +int au_mvdown(struct dentry *dentry, struct aufs_mvdown __user *arg); + +#ifdef CONFIG_AUFS_FHSM +/* fhsm.c */ + +static inline pid_t au_fhsm_pid(struct au_fhsm *fhsm) +{ + pid_t pid; + + spin_lock(&fhsm->fhsm_spin); + pid = fhsm->fhsm_pid; + spin_unlock(&fhsm->fhsm_spin); + + return pid; +} + +void au_fhsm_wrote(struct super_block *sb, aufs_bindex_t bindex, int force); +void au_fhsm_wrote_all(struct super_block *sb, int force); +int au_fhsm_fd(struct super_block *sb, int oflags); +int au_fhsm_br_alloc(struct au_branch *br); +void au_fhsm_set_bottom(struct super_block *sb, aufs_bindex_t bindex); +void au_fhsm_fin(struct super_block *sb); +void au_fhsm_init(struct au_sbinfo *sbinfo); +void au_fhsm_set(struct au_sbinfo *sbinfo, unsigned int sec); +void au_fhsm_show(struct seq_file *seq, struct au_sbinfo *sbinfo); +#else +AuStubVoid(au_fhsm_wrote, struct super_block *sb, aufs_bindex_t bindex, + int force) +AuStubVoid(au_fhsm_wrote_all, struct super_block *sb, int force) +AuStub(int, au_fhsm_fd, return -EOPNOTSUPP, struct super_block *sb, int oflags) +AuStub(pid_t, au_fhsm_pid, return 0, struct au_fhsm *fhsm) +AuStubInt0(au_fhsm_br_alloc, struct au_branch *br) +AuStubVoid(au_fhsm_set_bottom, struct super_block *sb, aufs_bindex_t bindex) +AuStubVoid(au_fhsm_fin, struct super_block *sb) +AuStubVoid(au_fhsm_init, struct au_sbinfo *sbinfo) +AuStubVoid(au_fhsm_set, struct au_sbinfo *sbinfo, unsigned int sec) +AuStubVoid(au_fhsm_show, struct seq_file *seq, struct au_sbinfo *sbinfo) +#endif + +/* ---------------------------------------------------------------------- */ + +static inline struct au_sbinfo *au_sbi(struct super_block *sb) +{ + return sb->s_fs_info; +} + +/* ---------------------------------------------------------------------- */ + +#ifdef CONFIG_AUFS_EXPORT +int au_test_nfsd(void); +void au_export_init(struct super_block *sb); +void au_xigen_inc(struct inode *inode); +int au_xigen_new(struct inode *inode); +int au_xigen_set(struct super_block *sb, struct file *base); +void au_xigen_clr(struct super_block *sb); + +static inline int au_busy_or_stale(void) +{ + if (!au_test_nfsd()) + return -EBUSY; + return -ESTALE; +} +#else +AuStubInt0(au_test_nfsd, void) +AuStubVoid(au_export_init, struct super_block *sb) +AuStubVoid(au_xigen_inc, struct inode *inode) +AuStubInt0(au_xigen_new, struct inode *inode) +AuStubInt0(au_xigen_set, struct super_block *sb, struct file *base) +AuStubVoid(au_xigen_clr, struct super_block *sb) +AuStub(int, au_busy_or_stale, return -EBUSY, void) +#endif /* CONFIG_AUFS_EXPORT */ + +/* ---------------------------------------------------------------------- */ + +#ifdef CONFIG_AUFS_SBILIST +/* module.c */ +extern struct au_splhead au_sbilist; + +static inline void au_sbilist_init(void) +{ + au_spl_init(&au_sbilist); +} + +static inline void au_sbilist_add(struct super_block *sb) +{ + au_spl_add(&au_sbi(sb)->si_list, &au_sbilist); +} + +static inline void au_sbilist_del(struct super_block *sb) +{ + au_spl_del(&au_sbi(sb)->si_list, &au_sbilist); +} + +#ifdef CONFIG_AUFS_MAGIC_SYSRQ +static inline void au_sbilist_lock(void) +{ + spin_lock(&au_sbilist.spin); +} + +static inline void au_sbilist_unlock(void) +{ + spin_unlock(&au_sbilist.spin); +} +#define AuGFP_SBILIST GFP_ATOMIC +#else +AuStubVoid(au_sbilist_lock, void) +AuStubVoid(au_sbilist_unlock, void) +#define AuGFP_SBILIST GFP_NOFS +#endif /* CONFIG_AUFS_MAGIC_SYSRQ */ +#else +AuStubVoid(au_sbilist_init, void) +AuStubVoid(au_sbilist_add, struct super_block *sb) +AuStubVoid(au_sbilist_del, struct super_block *sb) +AuStubVoid(au_sbilist_lock, void) +AuStubVoid(au_sbilist_unlock, void) +#define AuGFP_SBILIST GFP_NOFS +#endif + +/* ---------------------------------------------------------------------- */ + +static inline void dbgaufs_si_null(struct au_sbinfo *sbinfo) +{ + /* + * This function is a dynamic '__init' function actually, + * so the tiny check for si_rwsem is unnecessary. + */ + /* AuRwMustWriteLock(&sbinfo->si_rwsem); */ +#ifdef CONFIG_DEBUG_FS + sbinfo->si_dbgaufs = NULL; + sbinfo->si_dbgaufs_plink = NULL; + sbinfo->si_dbgaufs_xib = NULL; +#ifdef CONFIG_AUFS_EXPORT + sbinfo->si_dbgaufs_xigen = NULL; +#endif +#endif +} + +/* ---------------------------------------------------------------------- */ + +static inline pid_t si_pid_bit(void) +{ + /* the origin of pid is 1, but the bitmap's is 0 */ + return current->pid - 1; +} + +static inline int si_pid_test(struct super_block *sb) +{ + pid_t bit; + + bit = si_pid_bit(); + if (bit < PID_MAX_DEFAULT) + return test_bit(bit, au_sbi(sb)->au_si_pid.bitmap); + return si_pid_test_slow(sb); +} + +static inline void si_pid_set(struct super_block *sb) +{ + pid_t bit; + + bit = si_pid_bit(); + if (bit < PID_MAX_DEFAULT) { + AuDebugOn(test_bit(bit, au_sbi(sb)->au_si_pid.bitmap)); + set_bit(bit, au_sbi(sb)->au_si_pid.bitmap); + /* smp_mb(); */ + } else + si_pid_set_slow(sb); +} + +static inline void si_pid_clr(struct super_block *sb) +{ + pid_t bit; + + bit = si_pid_bit(); + if (bit < PID_MAX_DEFAULT) { + AuDebugOn(!test_bit(bit, au_sbi(sb)->au_si_pid.bitmap)); + clear_bit(bit, au_sbi(sb)->au_si_pid.bitmap); + /* smp_mb(); */ + } else + si_pid_clr_slow(sb); +} + +/* ---------------------------------------------------------------------- */ + +/* lock superblock. mainly for entry point functions */ +/* + * __si_read_lock, __si_write_lock, + * __si_read_unlock, __si_write_unlock, __si_downgrade_lock + */ +AuSimpleRwsemFuncs(__si, struct super_block *sb, &au_sbi(sb)->si_rwsem); + +#define SiMustNoWaiters(sb) AuRwMustNoWaiters(&au_sbi(sb)->si_rwsem) +#define SiMustAnyLock(sb) AuRwMustAnyLock(&au_sbi(sb)->si_rwsem) +#define SiMustWriteLock(sb) AuRwMustWriteLock(&au_sbi(sb)->si_rwsem) + +static inline void si_noflush_read_lock(struct super_block *sb) +{ + __si_read_lock(sb); + si_pid_set(sb); +} + +static inline int si_noflush_read_trylock(struct super_block *sb) +{ + int locked; + + locked = __si_read_trylock(sb); + if (locked) + si_pid_set(sb); + return locked; +} + +static inline void si_noflush_write_lock(struct super_block *sb) +{ + __si_write_lock(sb); + si_pid_set(sb); +} + +static inline int si_noflush_write_trylock(struct super_block *sb) +{ + int locked; + + locked = __si_write_trylock(sb); + if (locked) + si_pid_set(sb); + return locked; +} + +#if 0 /* unused */ +static inline int si_read_trylock(struct super_block *sb, int flags) +{ + if (au_ftest_lock(flags, FLUSH)) + au_nwt_flush(&au_sbi(sb)->si_nowait); + return si_noflush_read_trylock(sb); +} +#endif + +static inline void si_read_unlock(struct super_block *sb) +{ + si_pid_clr(sb); + __si_read_unlock(sb); +} + +#if 0 /* unused */ +static inline int si_write_trylock(struct super_block *sb, int flags) +{ + if (au_ftest_lock(flags, FLUSH)) + au_nwt_flush(&au_sbi(sb)->si_nowait); + return si_noflush_write_trylock(sb); +} +#endif + +static inline void si_write_unlock(struct super_block *sb) +{ + si_pid_clr(sb); + __si_write_unlock(sb); +} + +#if 0 /* unused */ +static inline void si_downgrade_lock(struct super_block *sb) +{ + __si_downgrade_lock(sb); +} +#endif + +/* ---------------------------------------------------------------------- */ + +static inline aufs_bindex_t au_sbend(struct super_block *sb) +{ + SiMustAnyLock(sb); + return au_sbi(sb)->si_bend; +} + +static inline unsigned int au_mntflags(struct super_block *sb) +{ + SiMustAnyLock(sb); + return au_sbi(sb)->si_mntflags; +} + +static inline unsigned int au_sigen(struct super_block *sb) +{ + SiMustAnyLock(sb); + return au_sbi(sb)->si_generation; +} + +static inline void au_ninodes_inc(struct super_block *sb) +{ + atomic_long_inc(&au_sbi(sb)->si_ninodes); +} + +static inline void au_ninodes_dec(struct super_block *sb) +{ + AuDebugOn(!atomic_long_read(&au_sbi(sb)->si_ninodes)); + atomic_long_dec(&au_sbi(sb)->si_ninodes); +} + +static inline void au_nfiles_inc(struct super_block *sb) +{ + atomic_long_inc(&au_sbi(sb)->si_nfiles); +} + +static inline void au_nfiles_dec(struct super_block *sb) +{ + AuDebugOn(!atomic_long_read(&au_sbi(sb)->si_nfiles)); + atomic_long_dec(&au_sbi(sb)->si_nfiles); +} + +static inline struct au_branch *au_sbr(struct super_block *sb, + aufs_bindex_t bindex) +{ + SiMustAnyLock(sb); + return au_sbi(sb)->si_branch[0 + bindex]; +} + +static inline void au_xino_brid_set(struct super_block *sb, aufs_bindex_t brid) +{ + SiMustWriteLock(sb); + au_sbi(sb)->si_xino_brid = brid; +} + +static inline aufs_bindex_t au_xino_brid(struct super_block *sb) +{ + SiMustAnyLock(sb); + return au_sbi(sb)->si_xino_brid; +} + +#endif /* __KERNEL__ */ +#endif /* __AUFS_SUPER_H__ */ diff --git a/fs/aufs/sysaufs.c b/fs/aufs/sysaufs.c new file mode 100644 index 00000000000000..0483dd00172fde --- /dev/null +++ b/fs/aufs/sysaufs.c @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * sysfs interface and lifetime management + * they are necessary regardless sysfs is disabled. + */ + +#include +#include "aufs.h" + +unsigned long sysaufs_si_mask; +struct kset *sysaufs_kset; + +#define AuSiAttr(_name) { \ + .attr = { .name = __stringify(_name), .mode = 0444 }, \ + .show = sysaufs_si_##_name, \ +} + +static struct sysaufs_si_attr sysaufs_si_attr_xi_path = AuSiAttr(xi_path); +struct attribute *sysaufs_si_attrs[] = { + &sysaufs_si_attr_xi_path.attr, + NULL, +}; + +static const struct sysfs_ops au_sbi_ops = { + .show = sysaufs_si_show +}; + +static struct kobj_type au_sbi_ktype = { + .release = au_si_free, + .sysfs_ops = &au_sbi_ops, + .default_attrs = sysaufs_si_attrs +}; + +/* ---------------------------------------------------------------------- */ + +int sysaufs_si_init(struct au_sbinfo *sbinfo) +{ + int err; + + sbinfo->si_kobj.kset = sysaufs_kset; + /* cf. sysaufs_name() */ + err = kobject_init_and_add + (&sbinfo->si_kobj, &au_sbi_ktype, /*&sysaufs_kset->kobj*/NULL, + SysaufsSiNamePrefix "%lx", sysaufs_si_id(sbinfo)); + + dbgaufs_si_null(sbinfo); + if (!err) { + err = dbgaufs_si_init(sbinfo); + if (unlikely(err)) + kobject_put(&sbinfo->si_kobj); + } + return err; +} + +void sysaufs_fin(void) +{ + dbgaufs_fin(); + sysfs_remove_group(&sysaufs_kset->kobj, sysaufs_attr_group); + kset_unregister(sysaufs_kset); +} + +int __init sysaufs_init(void) +{ + int err; + + do { + get_random_bytes(&sysaufs_si_mask, sizeof(sysaufs_si_mask)); + } while (!sysaufs_si_mask); + + err = -EINVAL; + sysaufs_kset = kset_create_and_add(AUFS_NAME, NULL, fs_kobj); + if (unlikely(!sysaufs_kset)) + goto out; + err = PTR_ERR(sysaufs_kset); + if (IS_ERR(sysaufs_kset)) + goto out; + err = sysfs_create_group(&sysaufs_kset->kobj, sysaufs_attr_group); + if (unlikely(err)) { + kset_unregister(sysaufs_kset); + goto out; + } + + err = dbgaufs_init(); + if (unlikely(err)) + sysaufs_fin(); +out: + return err; +} diff --git a/fs/aufs/sysaufs.h b/fs/aufs/sysaufs.h new file mode 100644 index 00000000000000..b7461013687421 --- /dev/null +++ b/fs/aufs/sysaufs.h @@ -0,0 +1,101 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * sysfs interface and mount lifetime management + */ + +#ifndef __SYSAUFS_H__ +#define __SYSAUFS_H__ + +#ifdef __KERNEL__ + +#include +#include "module.h" + +struct super_block; +struct au_sbinfo; + +struct sysaufs_si_attr { + struct attribute attr; + int (*show)(struct seq_file *seq, struct super_block *sb); +}; + +/* ---------------------------------------------------------------------- */ + +/* sysaufs.c */ +extern unsigned long sysaufs_si_mask; +extern struct kset *sysaufs_kset; +extern struct attribute *sysaufs_si_attrs[]; +int sysaufs_si_init(struct au_sbinfo *sbinfo); +int __init sysaufs_init(void); +void sysaufs_fin(void); + +/* ---------------------------------------------------------------------- */ + +/* some people doesn't like to show a pointer in kernel */ +static inline unsigned long sysaufs_si_id(struct au_sbinfo *sbinfo) +{ + return sysaufs_si_mask ^ (unsigned long)sbinfo; +} + +#define SysaufsSiNamePrefix "si_" +#define SysaufsSiNameLen (sizeof(SysaufsSiNamePrefix) + 16) +static inline void sysaufs_name(struct au_sbinfo *sbinfo, char *name) +{ + snprintf(name, SysaufsSiNameLen, SysaufsSiNamePrefix "%lx", + sysaufs_si_id(sbinfo)); +} + +struct au_branch; +#ifdef CONFIG_SYSFS +/* sysfs.c */ +extern struct attribute_group *sysaufs_attr_group; + +int sysaufs_si_xi_path(struct seq_file *seq, struct super_block *sb); +ssize_t sysaufs_si_show(struct kobject *kobj, struct attribute *attr, + char *buf); +long au_brinfo_ioctl(struct file *file, unsigned long arg); +#ifdef CONFIG_COMPAT +long au_brinfo_compat_ioctl(struct file *file, unsigned long arg); +#endif + +void sysaufs_br_init(struct au_branch *br); +void sysaufs_brs_add(struct super_block *sb, aufs_bindex_t bindex); +void sysaufs_brs_del(struct super_block *sb, aufs_bindex_t bindex); + +#define sysaufs_brs_init() do {} while (0) + +#else +#define sysaufs_attr_group NULL + +AuStubInt0(sysaufs_si_xi_path, struct seq_file *seq, struct super_block *sb) +AuStub(ssize_t, sysaufs_si_show, return 0, struct kobject *kobj, + struct attribute *attr, char *buf) +AuStubVoid(sysaufs_br_init, struct au_branch *br) +AuStubVoid(sysaufs_brs_add, struct super_block *sb, aufs_bindex_t bindex) +AuStubVoid(sysaufs_brs_del, struct super_block *sb, aufs_bindex_t bindex) + +static inline void sysaufs_brs_init(void) +{ + sysaufs_brs = 0; +} + +#endif /* CONFIG_SYSFS */ + +#endif /* __KERNEL__ */ +#endif /* __SYSAUFS_H__ */ diff --git a/fs/aufs/sysfs.c b/fs/aufs/sysfs.c new file mode 100644 index 00000000000000..8e97f8fc645155 --- /dev/null +++ b/fs/aufs/sysfs.c @@ -0,0 +1,372 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * sysfs interface + */ + +#include +#include +#include "aufs.h" + +#ifdef CONFIG_AUFS_FS_MODULE +/* this entry violates the "one line per file" policy of sysfs */ +static ssize_t config_show(struct kobject *kobj, struct kobj_attribute *attr, + char *buf) +{ + ssize_t err; + static char *conf = +/* this file is generated at compiling */ +#include "conf.str" + ; + + err = snprintf(buf, PAGE_SIZE, conf); + if (unlikely(err >= PAGE_SIZE)) + err = -EFBIG; + return err; +} + +static struct kobj_attribute au_config_attr = __ATTR_RO(config); +#endif + +static struct attribute *au_attr[] = { +#ifdef CONFIG_AUFS_FS_MODULE + &au_config_attr.attr, +#endif + NULL, /* need to NULL terminate the list of attributes */ +}; + +static struct attribute_group sysaufs_attr_group_body = { + .attrs = au_attr +}; + +struct attribute_group *sysaufs_attr_group = &sysaufs_attr_group_body; + +/* ---------------------------------------------------------------------- */ + +int sysaufs_si_xi_path(struct seq_file *seq, struct super_block *sb) +{ + int err; + + SiMustAnyLock(sb); + + err = 0; + if (au_opt_test(au_mntflags(sb), XINO)) { + err = au_xino_path(seq, au_sbi(sb)->si_xib); + seq_putc(seq, '\n'); + } + return err; +} + +/* + * the lifetime of branch is independent from the entry under sysfs. + * sysfs handles the lifetime of the entry, and never call ->show() after it is + * unlinked. + */ +static int sysaufs_si_br(struct seq_file *seq, struct super_block *sb, + aufs_bindex_t bindex, int idx) +{ + int err; + struct path path; + struct dentry *root; + struct au_branch *br; + au_br_perm_str_t perm; + + AuDbg("b%d\n", bindex); + + err = 0; + root = sb->s_root; + di_read_lock_parent(root, !AuLock_IR); + br = au_sbr(sb, bindex); + + switch (idx) { + case AuBrSysfs_BR: + path.mnt = au_br_mnt(br); + path.dentry = au_h_dptr(root, bindex); + au_seq_path(seq, &path); + au_optstr_br_perm(&perm, br->br_perm); + err = seq_printf(seq, "=%s\n", perm.a); + break; + case AuBrSysfs_BRID: + err = seq_printf(seq, "%d\n", br->br_id); + break; + } + di_read_unlock(root, !AuLock_IR); + if (err == -1) + err = -E2BIG; + + return err; +} + +/* ---------------------------------------------------------------------- */ + +static struct seq_file *au_seq(char *p, ssize_t len) +{ + struct seq_file *seq; + + seq = kzalloc(sizeof(*seq), GFP_NOFS); + if (seq) { + /* mutex_init(&seq.lock); */ + seq->buf = p; + seq->size = len; + return seq; /* success */ + } + + seq = ERR_PTR(-ENOMEM); + return seq; +} + +#define SysaufsBr_PREFIX "br" +#define SysaufsBrid_PREFIX "brid" + +/* todo: file size may exceed PAGE_SIZE */ +ssize_t sysaufs_si_show(struct kobject *kobj, struct attribute *attr, + char *buf) +{ + ssize_t err; + int idx; + long l; + aufs_bindex_t bend; + struct au_sbinfo *sbinfo; + struct super_block *sb; + struct seq_file *seq; + char *name; + struct attribute **cattr; + + sbinfo = container_of(kobj, struct au_sbinfo, si_kobj); + sb = sbinfo->si_sb; + + /* + * prevent a race condition between sysfs and aufs. + * for instance, sysfs_file_read() calls sysfs_get_active_two() which + * prohibits maintaining the sysfs entries. + * hew we acquire read lock after sysfs_get_active_two(). + * on the other hand, the remount process may maintain the sysfs/aufs + * entries after acquiring write lock. + * it can cause a deadlock. + * simply we gave up processing read here. + */ + err = -EBUSY; + if (unlikely(!si_noflush_read_trylock(sb))) + goto out; + + seq = au_seq(buf, PAGE_SIZE); + err = PTR_ERR(seq); + if (IS_ERR(seq)) + goto out_unlock; + + name = (void *)attr->name; + cattr = sysaufs_si_attrs; + while (*cattr) { + if (!strcmp(name, (*cattr)->name)) { + err = container_of(*cattr, struct sysaufs_si_attr, attr) + ->show(seq, sb); + goto out_seq; + } + cattr++; + } + + if (!strncmp(name, SysaufsBrid_PREFIX, + sizeof(SysaufsBrid_PREFIX) - 1)) { + idx = AuBrSysfs_BRID; + name += sizeof(SysaufsBrid_PREFIX) - 1; + } else if (!strncmp(name, SysaufsBr_PREFIX, + sizeof(SysaufsBr_PREFIX) - 1)) { + idx = AuBrSysfs_BR; + name += sizeof(SysaufsBr_PREFIX) - 1; + } else + BUG(); + + err = kstrtol(name, 10, &l); + if (!err) { + bend = au_sbend(sb); + if (l <= bend) + err = sysaufs_si_br(seq, sb, (aufs_bindex_t)l, idx); + else + err = -ENOENT; + } + +out_seq: + if (!err) { + err = seq->count; + /* sysfs limit */ + if (unlikely(err == PAGE_SIZE)) + err = -EFBIG; + } + kfree(seq); +out_unlock: + si_read_unlock(sb); +out: + return err; +} + +/* ---------------------------------------------------------------------- */ + +static int au_brinfo(struct super_block *sb, union aufs_brinfo __user *arg) +{ + int err; + int16_t brid; + aufs_bindex_t bindex, bend; + size_t sz; + char *buf; + struct seq_file *seq; + struct au_branch *br; + + si_read_lock(sb, AuLock_FLUSH); + bend = au_sbend(sb); + err = bend + 1; + if (!arg) + goto out; + + err = -ENOMEM; + buf = (void *)__get_free_page(GFP_NOFS); + if (unlikely(!buf)) + goto out; + + seq = au_seq(buf, PAGE_SIZE); + err = PTR_ERR(seq); + if (IS_ERR(seq)) + goto out_buf; + + sz = sizeof(*arg) - offsetof(union aufs_brinfo, path); + for (bindex = 0; bindex <= bend; bindex++, arg++) { + err = !access_ok(VERIFY_WRITE, arg, sizeof(*arg)); + if (unlikely(err)) + break; + + br = au_sbr(sb, bindex); + brid = br->br_id; + BUILD_BUG_ON(sizeof(brid) != sizeof(arg->id)); + err = __put_user(brid, &arg->id); + if (unlikely(err)) + break; + + BUILD_BUG_ON(sizeof(br->br_perm) != sizeof(arg->perm)); + err = __put_user(br->br_perm, &arg->perm); + if (unlikely(err)) + break; + + au_seq_path(seq, &br->br_path); + err = seq_putc(seq, '\0'); + if (!err && seq->count <= sz) { + err = copy_to_user(arg->path, seq->buf, seq->count); + seq->count = 0; + if (unlikely(err)) + break; + } else { + err = -E2BIG; + goto out_seq; + } + } + if (unlikely(err)) + err = -EFAULT; + +out_seq: + kfree(seq); +out_buf: + free_page((unsigned long)buf); +out: + si_read_unlock(sb); + return err; +} + +long au_brinfo_ioctl(struct file *file, unsigned long arg) +{ + return au_brinfo(file->f_dentry->d_sb, (void __user *)arg); +} + +#ifdef CONFIG_COMPAT +long au_brinfo_compat_ioctl(struct file *file, unsigned long arg) +{ + return au_brinfo(file->f_dentry->d_sb, compat_ptr(arg)); +} +#endif + +/* ---------------------------------------------------------------------- */ + +void sysaufs_br_init(struct au_branch *br) +{ + int i; + struct au_brsysfs *br_sysfs; + struct attribute *attr; + + br_sysfs = br->br_sysfs; + for (i = 0; i < ARRAY_SIZE(br->br_sysfs); i++) { + attr = &br_sysfs->attr; + sysfs_attr_init(attr); + attr->name = br_sysfs->name; + attr->mode = S_IRUGO; + br_sysfs++; + } +} + +void sysaufs_brs_del(struct super_block *sb, aufs_bindex_t bindex) +{ + struct au_branch *br; + struct kobject *kobj; + struct au_brsysfs *br_sysfs; + int i; + aufs_bindex_t bend; + + dbgaufs_brs_del(sb, bindex); + + if (!sysaufs_brs) + return; + + kobj = &au_sbi(sb)->si_kobj; + bend = au_sbend(sb); + for (; bindex <= bend; bindex++) { + br = au_sbr(sb, bindex); + br_sysfs = br->br_sysfs; + for (i = 0; i < ARRAY_SIZE(br->br_sysfs); i++) { + sysfs_remove_file(kobj, &br_sysfs->attr); + br_sysfs++; + } + } +} + +void sysaufs_brs_add(struct super_block *sb, aufs_bindex_t bindex) +{ + int err, i; + aufs_bindex_t bend; + struct kobject *kobj; + struct au_branch *br; + struct au_brsysfs *br_sysfs; + + dbgaufs_brs_add(sb, bindex); + + if (!sysaufs_brs) + return; + + kobj = &au_sbi(sb)->si_kobj; + bend = au_sbend(sb); + for (; bindex <= bend; bindex++) { + br = au_sbr(sb, bindex); + br_sysfs = br->br_sysfs; + snprintf(br_sysfs[AuBrSysfs_BR].name, sizeof(br_sysfs->name), + SysaufsBr_PREFIX "%d", bindex); + snprintf(br_sysfs[AuBrSysfs_BRID].name, sizeof(br_sysfs->name), + SysaufsBrid_PREFIX "%d", bindex); + for (i = 0; i < ARRAY_SIZE(br->br_sysfs); i++) { + err = sysfs_create_file(kobj, &br_sysfs->attr); + if (unlikely(err)) + pr_warn("failed %s under sysfs(%d)\n", + br_sysfs->name, err); + br_sysfs++; + } + } +} diff --git a/fs/aufs/sysrq.c b/fs/aufs/sysrq.c new file mode 100644 index 00000000000000..cabd23f14441fc --- /dev/null +++ b/fs/aufs/sysrq.c @@ -0,0 +1,157 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * magic sysrq hanlder + */ + +/* #include */ +#include +#include "aufs.h" + +/* ---------------------------------------------------------------------- */ + +static void sysrq_sb(struct super_block *sb) +{ + char *plevel; + struct au_sbinfo *sbinfo; + struct file *file; + struct au_sphlhead *files; + struct au_finfo *finfo; + + plevel = au_plevel; + au_plevel = KERN_WARNING; + + /* since we define pr_fmt, call printk directly */ +#define pr(str) printk(KERN_WARNING AUFS_NAME ": " str) + + sbinfo = au_sbi(sb); + printk(KERN_WARNING "si=%lx\n", sysaufs_si_id(sbinfo)); + pr("superblock\n"); + au_dpri_sb(sb); + +#if 0 + pr("root dentry\n"); + au_dpri_dentry(sb->s_root); + pr("root inode\n"); + au_dpri_inode(sb->s_root->d_inode); +#endif + +#if 0 + do { + int err, i, j, ndentry; + struct au_dcsub_pages dpages; + struct au_dpage *dpage; + + err = au_dpages_init(&dpages, GFP_ATOMIC); + if (unlikely(err)) + break; + err = au_dcsub_pages(&dpages, sb->s_root, NULL, NULL); + if (!err) + for (i = 0; i < dpages.ndpage; i++) { + dpage = dpages.dpages + i; + ndentry = dpage->ndentry; + for (j = 0; j < ndentry; j++) + au_dpri_dentry(dpage->dentries[j]); + } + au_dpages_free(&dpages); + } while (0); +#endif + +#if 1 + { + struct inode *i; + + pr("isolated inode\n"); + spin_lock(&inode_sb_list_lock); + list_for_each_entry(i, &sb->s_inodes, i_sb_list) { + spin_lock(&i->i_lock); + if (1 || hlist_empty(&i->i_dentry)) + au_dpri_inode(i); + spin_unlock(&i->i_lock); + } + spin_unlock(&inode_sb_list_lock); + } +#endif + pr("files\n"); + files = &au_sbi(sb)->si_files; + spin_lock(&files->spin); + hlist_for_each_entry(finfo, &files->head, fi_hlist) { + umode_t mode; + + file = finfo->fi_file; + mode = file_inode(file)->i_mode; + if (!special_file(mode)) + au_dpri_file(file); + } + spin_unlock(&files->spin); + pr("done\n"); + +#undef pr + au_plevel = plevel; +} + +/* ---------------------------------------------------------------------- */ + +/* module parameter */ +static char *aufs_sysrq_key = "a"; +module_param_named(sysrq, aufs_sysrq_key, charp, S_IRUGO); +MODULE_PARM_DESC(sysrq, "MagicSysRq key for " AUFS_NAME); + +static void au_sysrq(int key __maybe_unused) +{ + struct au_sbinfo *sbinfo; + + lockdep_off(); + au_sbilist_lock(); + list_for_each_entry(sbinfo, &au_sbilist.head, si_list) + sysrq_sb(sbinfo->si_sb); + au_sbilist_unlock(); + lockdep_on(); +} + +static struct sysrq_key_op au_sysrq_op = { + .handler = au_sysrq, + .help_msg = "Aufs", + .action_msg = "Aufs", + .enable_mask = SYSRQ_ENABLE_DUMP +}; + +/* ---------------------------------------------------------------------- */ + +int __init au_sysrq_init(void) +{ + int err; + char key; + + err = -1; + key = *aufs_sysrq_key; + if ('a' <= key && key <= 'z') + err = register_sysrq_key(key, &au_sysrq_op); + if (unlikely(err)) + pr_err("err %d, sysrq=%c\n", err, key); + return err; +} + +void au_sysrq_fin(void) +{ + int err; + + err = unregister_sysrq_key(*aufs_sysrq_key, &au_sysrq_op); + if (unlikely(err)) + pr_err("err %d (ignored)\n", err); +} diff --git a/fs/aufs/vdir.c b/fs/aufs/vdir.c new file mode 100644 index 00000000000000..00f213765dc5c9 --- /dev/null +++ b/fs/aufs/vdir.c @@ -0,0 +1,879 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * virtual or vertical directory + */ + +#include "aufs.h" + +static unsigned int calc_size(int nlen) +{ + return ALIGN(sizeof(struct au_vdir_de) + nlen, sizeof(ino_t)); +} + +static int set_deblk_end(union au_vdir_deblk_p *p, + union au_vdir_deblk_p *deblk_end) +{ + if (calc_size(0) <= deblk_end->deblk - p->deblk) { + p->de->de_str.len = 0; + /* smp_mb(); */ + return 0; + } + return -1; /* error */ +} + +/* returns true or false */ +static int is_deblk_end(union au_vdir_deblk_p *p, + union au_vdir_deblk_p *deblk_end) +{ + if (calc_size(0) <= deblk_end->deblk - p->deblk) + return !p->de->de_str.len; + return 1; +} + +static unsigned char *last_deblk(struct au_vdir *vdir) +{ + return vdir->vd_deblk[vdir->vd_nblk - 1]; +} + +/* ---------------------------------------------------------------------- */ + +/* estimate the apropriate size for name hash table */ +unsigned int au_rdhash_est(loff_t sz) +{ + unsigned int n; + + n = UINT_MAX; + sz >>= 10; + if (sz < n) + n = sz; + if (sz < AUFS_RDHASH_DEF) + n = AUFS_RDHASH_DEF; + /* pr_info("n %u\n", n); */ + return n; +} + +/* + * the allocated memory has to be freed by + * au_nhash_wh_free() or au_nhash_de_free(). + */ +int au_nhash_alloc(struct au_nhash *nhash, unsigned int num_hash, gfp_t gfp) +{ + struct hlist_head *head; + unsigned int u; + size_t sz; + + sz = sizeof(*nhash->nh_head) * num_hash; + head = kmalloc(sz, gfp); + if (head) { + nhash->nh_num = num_hash; + nhash->nh_head = head; + for (u = 0; u < num_hash; u++) + INIT_HLIST_HEAD(head++); + return 0; /* success */ + } + + return -ENOMEM; +} + +static void nhash_count(struct hlist_head *head) +{ +#if 0 + unsigned long n; + struct hlist_node *pos; + + n = 0; + hlist_for_each(pos, head) + n++; + pr_info("%lu\n", n); +#endif +} + +static void au_nhash_wh_do_free(struct hlist_head *head) +{ + struct au_vdir_wh *pos; + struct hlist_node *node; + + hlist_for_each_entry_safe(pos, node, head, wh_hash) + kfree(pos); +} + +static void au_nhash_de_do_free(struct hlist_head *head) +{ + struct au_vdir_dehstr *pos; + struct hlist_node *node; + + hlist_for_each_entry_safe(pos, node, head, hash) + au_cache_free_vdir_dehstr(pos); +} + +static void au_nhash_do_free(struct au_nhash *nhash, + void (*free)(struct hlist_head *head)) +{ + unsigned int n; + struct hlist_head *head; + + n = nhash->nh_num; + if (!n) + return; + + head = nhash->nh_head; + while (n-- > 0) { + nhash_count(head); + free(head++); + } + kfree(nhash->nh_head); +} + +void au_nhash_wh_free(struct au_nhash *whlist) +{ + au_nhash_do_free(whlist, au_nhash_wh_do_free); +} + +static void au_nhash_de_free(struct au_nhash *delist) +{ + au_nhash_do_free(delist, au_nhash_de_do_free); +} + +/* ---------------------------------------------------------------------- */ + +int au_nhash_test_longer_wh(struct au_nhash *whlist, aufs_bindex_t btgt, + int limit) +{ + int num; + unsigned int u, n; + struct hlist_head *head; + struct au_vdir_wh *pos; + + num = 0; + n = whlist->nh_num; + head = whlist->nh_head; + for (u = 0; u < n; u++, head++) + hlist_for_each_entry(pos, head, wh_hash) + if (pos->wh_bindex == btgt && ++num > limit) + return 1; + return 0; +} + +static struct hlist_head *au_name_hash(struct au_nhash *nhash, + unsigned char *name, + unsigned int len) +{ + unsigned int v; + /* const unsigned int magic_bit = 12; */ + + AuDebugOn(!nhash->nh_num || !nhash->nh_head); + + v = 0; + while (len--) + v += *name++; + /* v = hash_long(v, magic_bit); */ + v %= nhash->nh_num; + return nhash->nh_head + v; +} + +static int au_nhash_test_name(struct au_vdir_destr *str, const char *name, + int nlen) +{ + return str->len == nlen && !memcmp(str->name, name, nlen); +} + +/* returns found or not */ +int au_nhash_test_known_wh(struct au_nhash *whlist, char *name, int nlen) +{ + struct hlist_head *head; + struct au_vdir_wh *pos; + struct au_vdir_destr *str; + + head = au_name_hash(whlist, name, nlen); + hlist_for_each_entry(pos, head, wh_hash) { + str = &pos->wh_str; + AuDbg("%.*s\n", str->len, str->name); + if (au_nhash_test_name(str, name, nlen)) + return 1; + } + return 0; +} + +/* returns found(true) or not */ +static int test_known(struct au_nhash *delist, char *name, int nlen) +{ + struct hlist_head *head; + struct au_vdir_dehstr *pos; + struct au_vdir_destr *str; + + head = au_name_hash(delist, name, nlen); + hlist_for_each_entry(pos, head, hash) { + str = pos->str; + AuDbg("%.*s\n", str->len, str->name); + if (au_nhash_test_name(str, name, nlen)) + return 1; + } + return 0; +} + +static void au_shwh_init_wh(struct au_vdir_wh *wh, ino_t ino, + unsigned char d_type) +{ +#ifdef CONFIG_AUFS_SHWH + wh->wh_ino = ino; + wh->wh_type = d_type; +#endif +} + +/* ---------------------------------------------------------------------- */ + +int au_nhash_append_wh(struct au_nhash *whlist, char *name, int nlen, ino_t ino, + unsigned int d_type, aufs_bindex_t bindex, + unsigned char shwh) +{ + int err; + struct au_vdir_destr *str; + struct au_vdir_wh *wh; + + AuDbg("%.*s\n", nlen, name); + AuDebugOn(!whlist->nh_num || !whlist->nh_head); + + err = -ENOMEM; + wh = kmalloc(sizeof(*wh) + nlen, GFP_NOFS); + if (unlikely(!wh)) + goto out; + + err = 0; + wh->wh_bindex = bindex; + if (shwh) + au_shwh_init_wh(wh, ino, d_type); + str = &wh->wh_str; + str->len = nlen; + memcpy(str->name, name, nlen); + hlist_add_head(&wh->wh_hash, au_name_hash(whlist, name, nlen)); + /* smp_mb(); */ + +out: + return err; +} + +static int append_deblk(struct au_vdir *vdir) +{ + int err; + unsigned long ul; + const unsigned int deblk_sz = vdir->vd_deblk_sz; + union au_vdir_deblk_p p, deblk_end; + unsigned char **o; + + err = -ENOMEM; + o = krealloc(vdir->vd_deblk, sizeof(*o) * (vdir->vd_nblk + 1), + GFP_NOFS); + if (unlikely(!o)) + goto out; + + vdir->vd_deblk = o; + p.deblk = kmalloc(deblk_sz, GFP_NOFS); + if (p.deblk) { + ul = vdir->vd_nblk++; + vdir->vd_deblk[ul] = p.deblk; + vdir->vd_last.ul = ul; + vdir->vd_last.p.deblk = p.deblk; + deblk_end.deblk = p.deblk + deblk_sz; + err = set_deblk_end(&p, &deblk_end); + } + +out: + return err; +} + +static int append_de(struct au_vdir *vdir, char *name, int nlen, ino_t ino, + unsigned int d_type, struct au_nhash *delist) +{ + int err; + unsigned int sz; + const unsigned int deblk_sz = vdir->vd_deblk_sz; + union au_vdir_deblk_p p, *room, deblk_end; + struct au_vdir_dehstr *dehstr; + + p.deblk = last_deblk(vdir); + deblk_end.deblk = p.deblk + deblk_sz; + room = &vdir->vd_last.p; + AuDebugOn(room->deblk < p.deblk || deblk_end.deblk <= room->deblk + || !is_deblk_end(room, &deblk_end)); + + sz = calc_size(nlen); + if (unlikely(sz > deblk_end.deblk - room->deblk)) { + err = append_deblk(vdir); + if (unlikely(err)) + goto out; + + p.deblk = last_deblk(vdir); + deblk_end.deblk = p.deblk + deblk_sz; + /* smp_mb(); */ + AuDebugOn(room->deblk != p.deblk); + } + + err = -ENOMEM; + dehstr = au_cache_alloc_vdir_dehstr(); + if (unlikely(!dehstr)) + goto out; + + dehstr->str = &room->de->de_str; + hlist_add_head(&dehstr->hash, au_name_hash(delist, name, nlen)); + room->de->de_ino = ino; + room->de->de_type = d_type; + room->de->de_str.len = nlen; + memcpy(room->de->de_str.name, name, nlen); + + err = 0; + room->deblk += sz; + if (unlikely(set_deblk_end(room, &deblk_end))) + err = append_deblk(vdir); + /* smp_mb(); */ + +out: + return err; +} + +/* ---------------------------------------------------------------------- */ + +void au_vdir_free(struct au_vdir *vdir) +{ + unsigned char **deblk; + + deblk = vdir->vd_deblk; + while (vdir->vd_nblk--) + kfree(*deblk++); + kfree(vdir->vd_deblk); + au_cache_free_vdir(vdir); +} + +static struct au_vdir *alloc_vdir(struct file *file) +{ + struct au_vdir *vdir; + struct super_block *sb; + int err; + + sb = file->f_dentry->d_sb; + SiMustAnyLock(sb); + + err = -ENOMEM; + vdir = au_cache_alloc_vdir(); + if (unlikely(!vdir)) + goto out; + + vdir->vd_deblk = kzalloc(sizeof(*vdir->vd_deblk), GFP_NOFS); + if (unlikely(!vdir->vd_deblk)) + goto out_free; + + vdir->vd_deblk_sz = au_sbi(sb)->si_rdblk; + if (!vdir->vd_deblk_sz) { + /* estimate the apropriate size for deblk */ + vdir->vd_deblk_sz = au_dir_size(file, /*dentry*/NULL); + /* pr_info("vd_deblk_sz %u\n", vdir->vd_deblk_sz); */ + } + vdir->vd_nblk = 0; + vdir->vd_version = 0; + vdir->vd_jiffy = 0; + err = append_deblk(vdir); + if (!err) + return vdir; /* success */ + + kfree(vdir->vd_deblk); + +out_free: + au_cache_free_vdir(vdir); +out: + vdir = ERR_PTR(err); + return vdir; +} + +static int reinit_vdir(struct au_vdir *vdir) +{ + int err; + union au_vdir_deblk_p p, deblk_end; + + while (vdir->vd_nblk > 1) { + kfree(vdir->vd_deblk[vdir->vd_nblk - 1]); + /* vdir->vd_deblk[vdir->vd_nblk - 1] = NULL; */ + vdir->vd_nblk--; + } + p.deblk = vdir->vd_deblk[0]; + deblk_end.deblk = p.deblk + vdir->vd_deblk_sz; + err = set_deblk_end(&p, &deblk_end); + /* keep vd_dblk_sz */ + vdir->vd_last.ul = 0; + vdir->vd_last.p.deblk = vdir->vd_deblk[0]; + vdir->vd_version = 0; + vdir->vd_jiffy = 0; + /* smp_mb(); */ + return err; +} + +/* ---------------------------------------------------------------------- */ + +#define AuFillVdir_CALLED 1 +#define AuFillVdir_WHABLE (1 << 1) +#define AuFillVdir_SHWH (1 << 2) +#define au_ftest_fillvdir(flags, name) ((flags) & AuFillVdir_##name) +#define au_fset_fillvdir(flags, name) \ + do { (flags) |= AuFillVdir_##name; } while (0) +#define au_fclr_fillvdir(flags, name) \ + do { (flags) &= ~AuFillVdir_##name; } while (0) + +#ifndef CONFIG_AUFS_SHWH +#undef AuFillVdir_SHWH +#define AuFillVdir_SHWH 0 +#endif + +struct fillvdir_arg { + struct file *file; + struct au_vdir *vdir; + struct au_nhash delist; + struct au_nhash whlist; + aufs_bindex_t bindex; + unsigned int flags; + int err; +}; + +static int fillvdir(void *__arg, const char *__name, int nlen, + loff_t offset __maybe_unused, u64 h_ino, + unsigned int d_type) +{ + struct fillvdir_arg *arg = __arg; + char *name = (void *)__name; + struct super_block *sb; + ino_t ino; + const unsigned char shwh = !!au_ftest_fillvdir(arg->flags, SHWH); + + arg->err = 0; + sb = arg->file->f_dentry->d_sb; + au_fset_fillvdir(arg->flags, CALLED); + /* smp_mb(); */ + if (nlen <= AUFS_WH_PFX_LEN + || memcmp(name, AUFS_WH_PFX, AUFS_WH_PFX_LEN)) { + if (test_known(&arg->delist, name, nlen) + || au_nhash_test_known_wh(&arg->whlist, name, nlen)) + goto out; /* already exists or whiteouted */ + + sb = arg->file->f_dentry->d_sb; + arg->err = au_ino(sb, arg->bindex, h_ino, d_type, &ino); + if (!arg->err) { + if (unlikely(nlen > AUFS_MAX_NAMELEN)) + d_type = DT_UNKNOWN; + arg->err = append_de(arg->vdir, name, nlen, ino, + d_type, &arg->delist); + } + } else if (au_ftest_fillvdir(arg->flags, WHABLE)) { + name += AUFS_WH_PFX_LEN; + nlen -= AUFS_WH_PFX_LEN; + if (au_nhash_test_known_wh(&arg->whlist, name, nlen)) + goto out; /* already whiteouted */ + + if (shwh) + arg->err = au_wh_ino(sb, arg->bindex, h_ino, d_type, + &ino); + if (!arg->err) { + if (nlen <= AUFS_MAX_NAMELEN + AUFS_WH_PFX_LEN) + d_type = DT_UNKNOWN; + arg->err = au_nhash_append_wh + (&arg->whlist, name, nlen, ino, d_type, + arg->bindex, shwh); + } + } + +out: + if (!arg->err) + arg->vdir->vd_jiffy = jiffies; + /* smp_mb(); */ + AuTraceErr(arg->err); + return arg->err; +} + +static int au_handle_shwh(struct super_block *sb, struct au_vdir *vdir, + struct au_nhash *whlist, struct au_nhash *delist) +{ +#ifdef CONFIG_AUFS_SHWH + int err; + unsigned int nh, u; + struct hlist_head *head; + struct au_vdir_wh *pos; + struct hlist_node *n; + char *p, *o; + struct au_vdir_destr *destr; + + AuDebugOn(!au_opt_test(au_mntflags(sb), SHWH)); + + err = -ENOMEM; + o = p = (void *)__get_free_page(GFP_NOFS); + if (unlikely(!p)) + goto out; + + err = 0; + nh = whlist->nh_num; + memcpy(p, AUFS_WH_PFX, AUFS_WH_PFX_LEN); + p += AUFS_WH_PFX_LEN; + for (u = 0; u < nh; u++) { + head = whlist->nh_head + u; + hlist_for_each_entry_safe(pos, n, head, wh_hash) { + destr = &pos->wh_str; + memcpy(p, destr->name, destr->len); + err = append_de(vdir, o, destr->len + AUFS_WH_PFX_LEN, + pos->wh_ino, pos->wh_type, delist); + if (unlikely(err)) + break; + } + } + + free_page((unsigned long)o); + +out: + AuTraceErr(err); + return err; +#else + return 0; +#endif +} + +static int au_do_read_vdir(struct fillvdir_arg *arg) +{ + int err; + unsigned int rdhash; + loff_t offset; + aufs_bindex_t bend, bindex, bstart; + unsigned char shwh; + struct file *hf, *file; + struct super_block *sb; + + file = arg->file; + sb = file->f_dentry->d_sb; + SiMustAnyLock(sb); + + rdhash = au_sbi(sb)->si_rdhash; + if (!rdhash) + rdhash = au_rdhash_est(au_dir_size(file, /*dentry*/NULL)); + err = au_nhash_alloc(&arg->delist, rdhash, GFP_NOFS); + if (unlikely(err)) + goto out; + err = au_nhash_alloc(&arg->whlist, rdhash, GFP_NOFS); + if (unlikely(err)) + goto out_delist; + + err = 0; + arg->flags = 0; + shwh = 0; + if (au_opt_test(au_mntflags(sb), SHWH)) { + shwh = 1; + au_fset_fillvdir(arg->flags, SHWH); + } + bstart = au_fbstart(file); + bend = au_fbend_dir(file); + for (bindex = bstart; !err && bindex <= bend; bindex++) { + hf = au_hf_dir(file, bindex); + if (!hf) + continue; + + offset = vfsub_llseek(hf, 0, SEEK_SET); + err = offset; + if (unlikely(offset)) + break; + + arg->bindex = bindex; + au_fclr_fillvdir(arg->flags, WHABLE); + if (shwh + || (bindex != bend + && au_br_whable(au_sbr_perm(sb, bindex)))) + au_fset_fillvdir(arg->flags, WHABLE); + do { + arg->err = 0; + au_fclr_fillvdir(arg->flags, CALLED); + /* smp_mb(); */ + err = vfsub_readdir(hf, fillvdir, arg); + if (err >= 0) + err = arg->err; + } while (!err && au_ftest_fillvdir(arg->flags, CALLED)); + } + + if (!err && shwh) + err = au_handle_shwh(sb, arg->vdir, &arg->whlist, &arg->delist); + + au_nhash_wh_free(&arg->whlist); + +out_delist: + au_nhash_de_free(&arg->delist); +out: + return err; +} + +static int read_vdir(struct file *file, int may_read) +{ + int err; + unsigned long expire; + unsigned char do_read; + struct fillvdir_arg arg; + struct inode *inode; + struct au_vdir *vdir, *allocated; + + err = 0; + inode = file_inode(file); + IMustLock(inode); + SiMustAnyLock(inode->i_sb); + + allocated = NULL; + do_read = 0; + expire = au_sbi(inode->i_sb)->si_rdcache; + vdir = au_ivdir(inode); + if (!vdir) { + do_read = 1; + vdir = alloc_vdir(file); + err = PTR_ERR(vdir); + if (IS_ERR(vdir)) + goto out; + err = 0; + allocated = vdir; + } else if (may_read + && (inode->i_version != vdir->vd_version + || time_after(jiffies, vdir->vd_jiffy + expire))) { + do_read = 1; + err = reinit_vdir(vdir); + if (unlikely(err)) + goto out; + } + + if (!do_read) + return 0; /* success */ + + arg.file = file; + arg.vdir = vdir; + err = au_do_read_vdir(&arg); + if (!err) { + /* file->f_pos = 0; */ + vdir->vd_version = inode->i_version; + vdir->vd_last.ul = 0; + vdir->vd_last.p.deblk = vdir->vd_deblk[0]; + if (allocated) + au_set_ivdir(inode, allocated); + } else if (allocated) + au_vdir_free(allocated); + +out: + return err; +} + +static int copy_vdir(struct au_vdir *tgt, struct au_vdir *src) +{ + int err, rerr; + unsigned long ul, n; + const unsigned int deblk_sz = src->vd_deblk_sz; + + AuDebugOn(tgt->vd_nblk != 1); + + err = -ENOMEM; + if (tgt->vd_nblk < src->vd_nblk) { + unsigned char **p; + + p = krealloc(tgt->vd_deblk, sizeof(*p) * src->vd_nblk, + GFP_NOFS); + if (unlikely(!p)) + goto out; + tgt->vd_deblk = p; + } + + if (tgt->vd_deblk_sz != deblk_sz) { + unsigned char *p; + + tgt->vd_deblk_sz = deblk_sz; + p = krealloc(tgt->vd_deblk[0], deblk_sz, GFP_NOFS); + if (unlikely(!p)) + goto out; + tgt->vd_deblk[0] = p; + } + memcpy(tgt->vd_deblk[0], src->vd_deblk[0], deblk_sz); + tgt->vd_version = src->vd_version; + tgt->vd_jiffy = src->vd_jiffy; + + n = src->vd_nblk; + for (ul = 1; ul < n; ul++) { + tgt->vd_deblk[ul] = kmemdup(src->vd_deblk[ul], deblk_sz, + GFP_NOFS); + if (unlikely(!tgt->vd_deblk[ul])) + goto out; + tgt->vd_nblk++; + } + tgt->vd_nblk = n; + tgt->vd_last.ul = tgt->vd_last.ul; + tgt->vd_last.p.deblk = tgt->vd_deblk[tgt->vd_last.ul]; + tgt->vd_last.p.deblk += src->vd_last.p.deblk + - src->vd_deblk[src->vd_last.ul]; + /* smp_mb(); */ + return 0; /* success */ + +out: + rerr = reinit_vdir(tgt); + BUG_ON(rerr); + return err; +} + +int au_vdir_init(struct file *file) +{ + int err; + struct inode *inode; + struct au_vdir *vdir_cache, *allocated; + + err = read_vdir(file, !file->f_pos); + if (unlikely(err)) + goto out; + + allocated = NULL; + vdir_cache = au_fvdir_cache(file); + if (!vdir_cache) { + vdir_cache = alloc_vdir(file); + err = PTR_ERR(vdir_cache); + if (IS_ERR(vdir_cache)) + goto out; + allocated = vdir_cache; + } else if (!file->f_pos && vdir_cache->vd_version != file->f_version) { + err = reinit_vdir(vdir_cache); + if (unlikely(err)) + goto out; + } else + return 0; /* success */ + + inode = file_inode(file); + err = copy_vdir(vdir_cache, au_ivdir(inode)); + if (!err) { + file->f_version = inode->i_version; + if (allocated) + au_set_fvdir_cache(file, allocated); + } else if (allocated) + au_vdir_free(allocated); + +out: + return err; +} + +static loff_t calc_offset(struct au_vdir *vdir) +{ + loff_t offset; + union au_vdir_deblk_p p; + + p.deblk = vdir->vd_deblk[vdir->vd_last.ul]; + offset = vdir->vd_last.p.deblk - p.deblk; + offset += vdir->vd_deblk_sz * vdir->vd_last.ul; + return offset; +} + +/* returns true or false */ +static int seek_vdir(struct file *file) +{ + int valid; + unsigned int deblk_sz; + unsigned long ul, n; + loff_t offset; + union au_vdir_deblk_p p, deblk_end; + struct au_vdir *vdir_cache; + + valid = 1; + vdir_cache = au_fvdir_cache(file); + offset = calc_offset(vdir_cache); + AuDbg("offset %lld\n", offset); + if (file->f_pos == offset) + goto out; + + vdir_cache->vd_last.ul = 0; + vdir_cache->vd_last.p.deblk = vdir_cache->vd_deblk[0]; + if (!file->f_pos) + goto out; + + valid = 0; + deblk_sz = vdir_cache->vd_deblk_sz; + ul = div64_u64(file->f_pos, deblk_sz); + AuDbg("ul %lu\n", ul); + if (ul >= vdir_cache->vd_nblk) + goto out; + + n = vdir_cache->vd_nblk; + for (; ul < n; ul++) { + p.deblk = vdir_cache->vd_deblk[ul]; + deblk_end.deblk = p.deblk + deblk_sz; + offset = ul; + offset *= deblk_sz; + while (!is_deblk_end(&p, &deblk_end) && offset < file->f_pos) { + unsigned int l; + + l = calc_size(p.de->de_str.len); + offset += l; + p.deblk += l; + } + if (!is_deblk_end(&p, &deblk_end)) { + valid = 1; + vdir_cache->vd_last.ul = ul; + vdir_cache->vd_last.p = p; + break; + } + } + +out: + /* smp_mb(); */ + AuTraceErr(!valid); + return valid; +} + +int au_vdir_fill_de(struct file *file, void *dirent, filldir_t filldir) +{ + int err; + unsigned int l, deblk_sz; + union au_vdir_deblk_p deblk_end; + struct au_vdir *vdir_cache; + struct au_vdir_de *de; + + vdir_cache = au_fvdir_cache(file); + if (!seek_vdir(file)) + return 0; + + deblk_sz = vdir_cache->vd_deblk_sz; + while (1) { + deblk_end.deblk = vdir_cache->vd_deblk[vdir_cache->vd_last.ul]; + deblk_end.deblk += deblk_sz; + while (!is_deblk_end(&vdir_cache->vd_last.p, &deblk_end)) { + de = vdir_cache->vd_last.p.de; + AuDbg("%.*s, off%lld, i%lu, dt%d\n", + de->de_str.len, de->de_str.name, file->f_pos, + (unsigned long)de->de_ino, de->de_type); + err = filldir(dirent, de->de_str.name, de->de_str.len, + file->f_pos, de->de_ino, de->de_type); + if (unlikely(err)) { + AuTraceErr(err); + /* todo: ignore the error caused by udba? */ + /* return err; */ + return 0; + } + + l = calc_size(de->de_str.len); + vdir_cache->vd_last.p.deblk += l; + file->f_pos += l; + } + if (vdir_cache->vd_last.ul < vdir_cache->vd_nblk - 1) { + vdir_cache->vd_last.ul++; + vdir_cache->vd_last.p.deblk + = vdir_cache->vd_deblk[vdir_cache->vd_last.ul]; + file->f_pos = deblk_sz * vdir_cache->vd_last.ul; + continue; + } + break; + } + + /* smp_mb(); */ + return 0; +} diff --git a/fs/aufs/vfsub.c b/fs/aufs/vfsub.c new file mode 100644 index 00000000000000..91468c37830bc1 --- /dev/null +++ b/fs/aufs/vfsub.c @@ -0,0 +1,782 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * sub-routines for VFS + */ + +#include +#include +#include +#include +#include "aufs.h" + +int vfsub_update_h_iattr(struct path *h_path, int *did) +{ + int err; + struct kstat st; + struct super_block *h_sb; + + /* for remote fs, leave work for its getattr or d_revalidate */ + /* for bad i_attr fs, handle them in aufs_getattr() */ + /* still some fs may acquire i_mutex. we need to skip them */ + err = 0; + if (!did) + did = &err; + h_sb = h_path->dentry->d_sb; + *did = (!au_test_fs_remote(h_sb) && au_test_fs_refresh_iattr(h_sb)); + if (*did) + err = vfs_getattr(h_path, &st); + + return err; +} + +/* ---------------------------------------------------------------------- */ + +struct file *vfsub_dentry_open(struct path *path, int flags) +{ + struct file *file; + + file = dentry_open(path, flags /* | __FMODE_NONOTIFY */, + current_cred()); + if (!IS_ERR_OR_NULL(file) + && (file->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ) + i_readcount_inc(path->dentry->d_inode); + + return file; +} + +struct file *vfsub_filp_open(const char *path, int oflags, int mode) +{ + struct file *file; + + lockdep_off(); + file = filp_open(path, + oflags /* | __FMODE_NONOTIFY */, + mode); + lockdep_on(); + if (IS_ERR(file)) + goto out; + vfsub_update_h_iattr(&file->f_path, /*did*/NULL); /*ignore*/ + +out: + return file; +} + +int vfsub_kern_path(const char *name, unsigned int flags, struct path *path) +{ + int err; + + err = kern_path(name, flags, path); + if (!err && path->dentry->d_inode) + vfsub_update_h_iattr(path, /*did*/NULL); /*ignore*/ + return err; +} + +struct dentry *vfsub_lookup_one_len(const char *name, struct dentry *parent, + int len) +{ + struct path path = { + .mnt = NULL + }; + + /* VFS checks it too, but by WARN_ON_ONCE() */ + IMustLock(parent->d_inode); + + path.dentry = lookup_one_len(name, parent, len); + if (IS_ERR(path.dentry)) + goto out; + if (path.dentry->d_inode) + vfsub_update_h_iattr(&path, /*did*/NULL); /*ignore*/ + +out: + AuTraceErrPtr(path.dentry); + return path.dentry; +} + +void vfsub_call_lkup_one(void *args) +{ + struct vfsub_lkup_one_args *a = args; + *a->errp = vfsub_lkup_one(a->name, a->parent); +} + +/* ---------------------------------------------------------------------- */ + +struct dentry *vfsub_lock_rename(struct dentry *d1, struct au_hinode *hdir1, + struct dentry *d2, struct au_hinode *hdir2) +{ + struct dentry *d; + + lockdep_off(); + d = lock_rename(d1, d2); + lockdep_on(); + au_hn_suspend(hdir1); + if (hdir1 != hdir2) + au_hn_suspend(hdir2); + + return d; +} + +void vfsub_unlock_rename(struct dentry *d1, struct au_hinode *hdir1, + struct dentry *d2, struct au_hinode *hdir2) +{ + au_hn_resume(hdir1); + if (hdir1 != hdir2) + au_hn_resume(hdir2); + lockdep_off(); + unlock_rename(d1, d2); + lockdep_on(); +} + +/* ---------------------------------------------------------------------- */ + +int vfsub_create(struct inode *dir, struct path *path, int mode, bool want_excl) +{ + int err; + struct dentry *d; + + IMustLock(dir); + + d = path->dentry; + path->dentry = d->d_parent; + err = security_path_mknod(path, d, mode, 0); + path->dentry = d; + if (unlikely(err)) + goto out; + + lockdep_off(); + err = vfs_create(dir, path->dentry, mode, want_excl); + lockdep_on(); + if (!err) { + struct path tmp = *path; + int did; + + vfsub_update_h_iattr(&tmp, &did); + if (did) { + tmp.dentry = path->dentry->d_parent; + vfsub_update_h_iattr(&tmp, /*did*/NULL); + } + /*ignore*/ + } + +out: + return err; +} + +int vfsub_symlink(struct inode *dir, struct path *path, const char *symname) +{ + int err; + struct dentry *d; + + IMustLock(dir); + + d = path->dentry; + path->dentry = d->d_parent; + err = security_path_symlink(path, d, symname); + path->dentry = d; + if (unlikely(err)) + goto out; + + lockdep_off(); + err = vfs_symlink(dir, path->dentry, symname); + lockdep_on(); + if (!err) { + struct path tmp = *path; + int did; + + vfsub_update_h_iattr(&tmp, &did); + if (did) { + tmp.dentry = path->dentry->d_parent; + vfsub_update_h_iattr(&tmp, /*did*/NULL); + } + /*ignore*/ + } + +out: + return err; +} + +int vfsub_mknod(struct inode *dir, struct path *path, int mode, dev_t dev) +{ + int err; + struct dentry *d; + + IMustLock(dir); + + d = path->dentry; + path->dentry = d->d_parent; + err = security_path_mknod(path, d, mode, new_encode_dev(dev)); + path->dentry = d; + if (unlikely(err)) + goto out; + + lockdep_off(); + err = vfs_mknod(dir, path->dentry, mode, dev); + lockdep_on(); + if (!err) { + struct path tmp = *path; + int did; + + vfsub_update_h_iattr(&tmp, &did); + if (did) { + tmp.dentry = path->dentry->d_parent; + vfsub_update_h_iattr(&tmp, /*did*/NULL); + } + /*ignore*/ + } + +out: + return err; +} + +static int au_test_nlink(struct inode *inode) +{ + const unsigned int link_max = UINT_MAX >> 1; /* rough margin */ + + if (!au_test_fs_no_limit_nlink(inode->i_sb) + || inode->i_nlink < link_max) + return 0; + return -EMLINK; +} + +int vfsub_link(struct dentry *src_dentry, struct inode *dir, struct path *path) +{ + int err; + struct dentry *d; + + IMustLock(dir); + + err = au_test_nlink(src_dentry->d_inode); + if (unlikely(err)) + return err; + + /* we don't call may_linkat() */ + d = path->dentry; + path->dentry = d->d_parent; + err = security_path_link(src_dentry, path, d); + path->dentry = d; + if (unlikely(err)) + goto out; + + lockdep_off(); + err = vfs_link(src_dentry, dir, path->dentry); + lockdep_on(); + if (!err) { + struct path tmp = *path; + int did; + + /* fuse has different memory inode for the same inumber */ + vfsub_update_h_iattr(&tmp, &did); + if (did) { + tmp.dentry = path->dentry->d_parent; + vfsub_update_h_iattr(&tmp, /*did*/NULL); + tmp.dentry = src_dentry; + vfsub_update_h_iattr(&tmp, /*did*/NULL); + } + /*ignore*/ + } + +out: + return err; +} + +int vfsub_rename(struct inode *src_dir, struct dentry *src_dentry, + struct inode *dir, struct path *path) +{ + int err; + struct path tmp = { + .mnt = path->mnt + }; + struct dentry *d; + + IMustLock(dir); + IMustLock(src_dir); + + d = path->dentry; + path->dentry = d->d_parent; + tmp.dentry = src_dentry->d_parent; + err = security_path_rename(&tmp, src_dentry, path, d); + path->dentry = d; + if (unlikely(err)) + goto out; + + lockdep_off(); + err = vfs_rename(src_dir, src_dentry, dir, path->dentry); + lockdep_on(); + if (!err) { + int did; + + tmp.dentry = d->d_parent; + vfsub_update_h_iattr(&tmp, &did); + if (did) { + tmp.dentry = src_dentry; + vfsub_update_h_iattr(&tmp, /*did*/NULL); + tmp.dentry = src_dentry->d_parent; + vfsub_update_h_iattr(&tmp, /*did*/NULL); + } + /*ignore*/ + } + +out: + return err; +} + +int vfsub_mkdir(struct inode *dir, struct path *path, int mode) +{ + int err; + struct dentry *d; + + IMustLock(dir); + + d = path->dentry; + path->dentry = d->d_parent; + err = security_path_mkdir(path, d, mode); + path->dentry = d; + if (unlikely(err)) + goto out; + + lockdep_off(); + err = vfs_mkdir(dir, path->dentry, mode); + lockdep_on(); + if (!err) { + struct path tmp = *path; + int did; + + vfsub_update_h_iattr(&tmp, &did); + if (did) { + tmp.dentry = path->dentry->d_parent; + vfsub_update_h_iattr(&tmp, /*did*/NULL); + } + /*ignore*/ + } + +out: + return err; +} + +int vfsub_rmdir(struct inode *dir, struct path *path) +{ + int err; + struct dentry *d; + + IMustLock(dir); + + d = path->dentry; + path->dentry = d->d_parent; + err = security_path_rmdir(path, d); + path->dentry = d; + if (unlikely(err)) + goto out; + + lockdep_off(); + err = vfs_rmdir(dir, path->dentry); + lockdep_on(); + if (!err) { + struct path tmp = { + .dentry = path->dentry->d_parent, + .mnt = path->mnt + }; + + vfsub_update_h_iattr(&tmp, /*did*/NULL); /*ignore*/ + } + +out: + return err; +} + +/* ---------------------------------------------------------------------- */ + +/* todo: support mmap_sem? */ +ssize_t vfsub_read_u(struct file *file, char __user *ubuf, size_t count, + loff_t *ppos) +{ + ssize_t err; + + lockdep_off(); + err = vfs_read(file, ubuf, count, ppos); + lockdep_on(); + if (err >= 0) + vfsub_update_h_iattr(&file->f_path, /*did*/NULL); /*ignore*/ + return err; +} + +/* todo: kernel_read()? */ +ssize_t vfsub_read_k(struct file *file, void *kbuf, size_t count, + loff_t *ppos) +{ + ssize_t err; + mm_segment_t oldfs; + union { + void *k; + char __user *u; + } buf; + + buf.k = kbuf; + oldfs = get_fs(); + set_fs(KERNEL_DS); + err = vfsub_read_u(file, buf.u, count, ppos); + set_fs(oldfs); + return err; +} + +ssize_t vfsub_write_u(struct file *file, const char __user *ubuf, size_t count, + loff_t *ppos) +{ + ssize_t err; + + lockdep_off(); + err = vfs_write(file, ubuf, count, ppos); + lockdep_on(); + if (err >= 0) + vfsub_update_h_iattr(&file->f_path, /*did*/NULL); /*ignore*/ + return err; +} + +ssize_t vfsub_write_k(struct file *file, void *kbuf, size_t count, loff_t *ppos) +{ + ssize_t err; + mm_segment_t oldfs; + union { + void *k; + const char __user *u; + } buf; + + buf.k = kbuf; + oldfs = get_fs(); + set_fs(KERNEL_DS); + err = vfsub_write_u(file, buf.u, count, ppos); + set_fs(oldfs); + return err; +} + +int vfsub_flush(struct file *file, fl_owner_t id) +{ + int err; + + err = 0; + if (file->f_op && file->f_op->flush) { + if (!au_test_nfs(file->f_dentry->d_sb)) + err = file->f_op->flush(file, id); + else { + lockdep_off(); + err = file->f_op->flush(file, id); + lockdep_on(); + } + if (!err) + vfsub_update_h_iattr(&file->f_path, /*did*/NULL); + /*ignore*/ + } + return err; +} + +int vfsub_readdir(struct file *file, filldir_t filldir, void *arg) +{ + int err; + + lockdep_off(); + err = vfs_readdir(file, filldir, arg); + lockdep_on(); + if (err >= 0) + vfsub_update_h_iattr(&file->f_path, /*did*/NULL); /*ignore*/ + return err; +} + +long vfsub_splice_to(struct file *in, loff_t *ppos, + struct pipe_inode_info *pipe, size_t len, + unsigned int flags) +{ + long err; + + lockdep_off(); + err = do_splice_to(in, ppos, pipe, len, flags); + lockdep_on(); + file_accessed(in); + if (err >= 0) + vfsub_update_h_iattr(&in->f_path, /*did*/NULL); /*ignore*/ + return err; +} + +long vfsub_splice_from(struct pipe_inode_info *pipe, struct file *out, + loff_t *ppos, size_t len, unsigned int flags) +{ + long err; + + lockdep_off(); + err = do_splice_from(pipe, out, ppos, len, flags); + lockdep_on(); + if (err >= 0) + vfsub_update_h_iattr(&out->f_path, /*did*/NULL); /*ignore*/ + return err; +} + +int vfsub_fsync(struct file *file, struct path *path, int datasync) +{ + int err; + + /* file can be NULL */ + lockdep_off(); + err = vfs_fsync(file, datasync); + lockdep_on(); + if (!err) { + if (!path) { + AuDebugOn(!file); + path = &file->f_path; + } + vfsub_update_h_iattr(path, /*did*/NULL); /*ignore*/ + } + return err; +} + +/* cf. open.c:do_sys_truncate() and do_sys_ftruncate() */ +int vfsub_trunc(struct path *h_path, loff_t length, unsigned int attr, + struct file *h_file) +{ + int err; + struct inode *h_inode; + struct super_block *h_sb; + + if (!h_file) { + err = vfsub_truncate(h_path, length); + goto out; + } + + h_inode = h_path->dentry->d_inode; + h_sb = h_inode->i_sb; + lockdep_off(); + sb_start_write(h_sb); + lockdep_on(); + err = locks_verify_truncate(h_inode, h_file, length); + if (!err) + err = security_path_truncate(h_path); + if (!err) { + lockdep_off(); + err = do_truncate(h_path->dentry, length, attr, h_file); + lockdep_on(); + } + lockdep_off(); + sb_end_write(h_sb); + lockdep_on(); + +out: + return err; +} + +/* ---------------------------------------------------------------------- */ + +struct au_vfsub_mkdir_args { + int *errp; + struct inode *dir; + struct path *path; + int mode; +}; + +static void au_call_vfsub_mkdir(void *args) +{ + struct au_vfsub_mkdir_args *a = args; + *a->errp = vfsub_mkdir(a->dir, a->path, a->mode); +} + +int vfsub_sio_mkdir(struct inode *dir, struct path *path, int mode) +{ + int err, do_sio, wkq_err; + + do_sio = au_test_h_perm_sio(dir, MAY_EXEC | MAY_WRITE); + if (!do_sio) { + lockdep_off(); + err = vfsub_mkdir(dir, path, mode); + lockdep_on(); + } else { + struct au_vfsub_mkdir_args args = { + .errp = &err, + .dir = dir, + .path = path, + .mode = mode + }; + wkq_err = au_wkq_wait(au_call_vfsub_mkdir, &args); + if (unlikely(wkq_err)) + err = wkq_err; + } + + return err; +} + +struct au_vfsub_rmdir_args { + int *errp; + struct inode *dir; + struct path *path; +}; + +static void au_call_vfsub_rmdir(void *args) +{ + struct au_vfsub_rmdir_args *a = args; + *a->errp = vfsub_rmdir(a->dir, a->path); +} + +int vfsub_sio_rmdir(struct inode *dir, struct path *path) +{ + int err, do_sio, wkq_err; + + do_sio = au_test_h_perm_sio(dir, MAY_EXEC | MAY_WRITE); + if (!do_sio) { + lockdep_off(); + err = vfsub_rmdir(dir, path); + lockdep_on(); + } else { + struct au_vfsub_rmdir_args args = { + .errp = &err, + .dir = dir, + .path = path + }; + wkq_err = au_wkq_wait(au_call_vfsub_rmdir, &args); + if (unlikely(wkq_err)) + err = wkq_err; + } + + return err; +} + +/* ---------------------------------------------------------------------- */ + +struct notify_change_args { + int *errp; + struct path *path; + struct iattr *ia; +}; + +static void call_notify_change(void *args) +{ + struct notify_change_args *a = args; + struct inode *h_inode; + + h_inode = a->path->dentry->d_inode; + IMustLock(h_inode); + + *a->errp = -EPERM; + if (!IS_IMMUTABLE(h_inode) && !IS_APPEND(h_inode)) { + lockdep_off(); + *a->errp = notify_change(a->path->dentry, a->ia); + lockdep_on(); + if (!*a->errp) + vfsub_update_h_iattr(a->path, /*did*/NULL); /*ignore*/ + } + AuTraceErr(*a->errp); +} + +int vfsub_notify_change(struct path *path, struct iattr *ia) +{ + int err; + struct notify_change_args args = { + .errp = &err, + .path = path, + .ia = ia + }; + + call_notify_change(&args); + + return err; +} + +int vfsub_sio_notify_change(struct path *path, struct iattr *ia) +{ + int err, wkq_err; + struct notify_change_args args = { + .errp = &err, + .path = path, + .ia = ia + }; + + wkq_err = au_wkq_wait(call_notify_change, &args); + if (unlikely(wkq_err)) + err = wkq_err; + + return err; +} + +/* ---------------------------------------------------------------------- */ + +struct unlink_args { + int *errp; + struct inode *dir; + struct path *path; +}; + +static void call_unlink(void *args) +{ + struct unlink_args *a = args; + struct dentry *d = a->path->dentry; + struct inode *h_inode; + const int stop_sillyrename = (au_test_nfs(d->d_sb) + && d->d_count == 1); + + IMustLock(a->dir); + + a->path->dentry = d->d_parent; + *a->errp = security_path_unlink(a->path, d); + a->path->dentry = d; + if (unlikely(*a->errp)) + return; + + if (!stop_sillyrename) + dget(d); + h_inode = d->d_inode; + if (h_inode) + ihold(h_inode); + + lockdep_off(); + *a->errp = vfs_unlink(a->dir, d); + lockdep_on(); + if (!*a->errp) { + struct path tmp = { + .dentry = d->d_parent, + .mnt = a->path->mnt + }; + vfsub_update_h_iattr(&tmp, /*did*/NULL); /*ignore*/ + } + + if (!stop_sillyrename) + dput(d); + if (h_inode) + iput(h_inode); + + AuTraceErr(*a->errp); +} + +/* + * @dir: must be locked. + * @dentry: target dentry. + */ +int vfsub_unlink(struct inode *dir, struct path *path, int force) +{ + int err; + struct unlink_args args = { + .errp = &err, + .dir = dir, + .path = path + }; + + if (!force) + call_unlink(&args); + else { + int wkq_err; + + wkq_err = au_wkq_wait(call_unlink, &args); + if (unlikely(wkq_err)) + err = wkq_err; + } + + return err; +} diff --git a/fs/aufs/vfsub.h b/fs/aufs/vfsub.h new file mode 100644 index 00000000000000..c4c8db8f2fda2b --- /dev/null +++ b/fs/aufs/vfsub.h @@ -0,0 +1,328 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * sub-routines for VFS + */ + +#ifndef __AUFS_VFSUB_H__ +#define __AUFS_VFSUB_H__ + +#ifdef __KERNEL__ + +#include +#include +#include +#include +#include "debug.h" + +/* copied from linux/fs/internal.h */ +/* todo: BAD approach!! */ +extern void __mnt_drop_write(struct vfsmount *); +extern spinlock_t inode_sb_list_lock; + +/* copied from linux/fs/file_table.c */ +extern struct lglock files_lglock; +#ifdef CONFIG_SMP +/* + * These macros iterate all files on all CPUs for a given superblock. + * files_lglock must be held globally. + */ +#define do_file_list_for_each_entry(__sb, __file) \ +{ \ + int i; \ + for_each_possible_cpu(i) { \ + struct list_head *list; \ + list = per_cpu_ptr((__sb)->s_files, i); \ + list_for_each_entry((__file), list, f_u.fu_list) + +#define while_file_list_for_each_entry \ + } \ +} + +#else + +#define do_file_list_for_each_entry(__sb, __file) \ +{ \ + struct list_head *list; \ + list = &(sb)->s_files; \ + list_for_each_entry((__file), list, f_u.fu_list) + +#define while_file_list_for_each_entry \ +} +#endif + +/* ---------------------------------------------------------------------- */ + +/* lock subclass for lower inode */ +/* default MAX_LOCKDEP_SUBCLASSES(8) is not enough */ +/* reduce? gave up. */ +enum { + AuLsc_I_Begin = I_MUTEX_QUOTA, /* 4 */ + AuLsc_I_PARENT, /* lower inode, parent first */ + AuLsc_I_PARENT2, /* copyup dirs */ + AuLsc_I_PARENT3, /* copyup wh */ + AuLsc_I_CHILD, + AuLsc_I_CHILD2, + AuLsc_I_End +}; + +/* to debug easier, do not make them inlined functions */ +#define MtxMustLock(mtx) AuDebugOn(!mutex_is_locked(mtx)) +#define IMustLock(i) MtxMustLock(&(i)->i_mutex) + +/* ---------------------------------------------------------------------- */ + +static inline void vfsub_drop_nlink(struct inode *inode) +{ + AuDebugOn(!inode->i_nlink); + drop_nlink(inode); +} + +static inline void vfsub_dead_dir(struct inode *inode) +{ + AuDebugOn(!S_ISDIR(inode->i_mode)); + inode->i_flags |= S_DEAD; + clear_nlink(inode); +} + +static inline int vfsub_native_ro(struct inode *inode) +{ + return (inode->i_sb->s_flags & MS_RDONLY) + || IS_RDONLY(inode) + /* || IS_APPEND(inode) */ + || IS_IMMUTABLE(inode); +} + +/* ---------------------------------------------------------------------- */ + +int vfsub_update_h_iattr(struct path *h_path, int *did); +struct file *vfsub_dentry_open(struct path *path, int flags); +struct file *vfsub_filp_open(const char *path, int oflags, int mode); +int vfsub_kern_path(const char *name, unsigned int flags, struct path *path); + +struct dentry *vfsub_lookup_one_len(const char *name, struct dentry *parent, + int len); + +struct vfsub_lkup_one_args { + struct dentry **errp; + struct qstr *name; + struct dentry *parent; +}; + +static inline struct dentry *vfsub_lkup_one(struct qstr *name, + struct dentry *parent) +{ + return vfsub_lookup_one_len(name->name, parent, name->len); +} + +void vfsub_call_lkup_one(void *args); + +/* ---------------------------------------------------------------------- */ + +static inline int vfsub_mnt_want_write(struct vfsmount *mnt) +{ + int err; + + lockdep_off(); + err = mnt_want_write(mnt); + lockdep_on(); + return err; +} + +static inline void vfsub_mnt_drop_write(struct vfsmount *mnt) +{ + lockdep_off(); + mnt_drop_write(mnt); + lockdep_on(); +} + +static inline void vfsub_mnt_drop_write_file(struct file *file) +{ + lockdep_off(); + mnt_drop_write_file(file); + lockdep_on(); +} + +/* ---------------------------------------------------------------------- */ + +struct au_hinode; +struct dentry *vfsub_lock_rename(struct dentry *d1, struct au_hinode *hdir1, + struct dentry *d2, struct au_hinode *hdir2); +void vfsub_unlock_rename(struct dentry *d1, struct au_hinode *hdir1, + struct dentry *d2, struct au_hinode *hdir2); + +int vfsub_create(struct inode *dir, struct path *path, int mode, + bool want_excl); +int vfsub_symlink(struct inode *dir, struct path *path, + const char *symname); +int vfsub_mknod(struct inode *dir, struct path *path, int mode, dev_t dev); +int vfsub_link(struct dentry *src_dentry, struct inode *dir, + struct path *path); +int vfsub_rename(struct inode *src_hdir, struct dentry *src_dentry, + struct inode *hdir, struct path *path); +int vfsub_mkdir(struct inode *dir, struct path *path, int mode); +int vfsub_rmdir(struct inode *dir, struct path *path); + +/* ---------------------------------------------------------------------- */ + +ssize_t vfsub_read_u(struct file *file, char __user *ubuf, size_t count, + loff_t *ppos); +ssize_t vfsub_read_k(struct file *file, void *kbuf, size_t count, + loff_t *ppos); +ssize_t vfsub_write_u(struct file *file, const char __user *ubuf, size_t count, + loff_t *ppos); +ssize_t vfsub_write_k(struct file *file, void *kbuf, size_t count, + loff_t *ppos); +int vfsub_flush(struct file *file, fl_owner_t id); +int vfsub_readdir(struct file *file, filldir_t filldir, void *arg); + +static inline loff_t vfsub_f_size_read(struct file *file) +{ + return i_size_read(file_inode(file)); +} + +static inline unsigned int vfsub_file_flags(struct file *file) +{ + unsigned int flags; + + spin_lock(&file->f_lock); + flags = file->f_flags; + spin_unlock(&file->f_lock); + + return flags; +} + +static inline void vfsub_file_accessed(struct file *h_file) +{ + file_accessed(h_file); + vfsub_update_h_iattr(&h_file->f_path, /*did*/NULL); /*ignore*/ +} + +static inline void vfsub_touch_atime(struct vfsmount *h_mnt, + struct dentry *h_dentry) +{ + struct path h_path = { + .dentry = h_dentry, + .mnt = h_mnt + }; + touch_atime(&h_path); + vfsub_update_h_iattr(&h_path, /*did*/NULL); /*ignore*/ +} + +static inline int vfsub_update_time(struct inode *h_inode, struct timespec *ts, + int flags) +{ + return update_time(h_inode, ts, flags); + /* no vfsub_update_h_iattr() since we don't have struct path */ +} + +long vfsub_splice_to(struct file *in, loff_t *ppos, + struct pipe_inode_info *pipe, size_t len, + unsigned int flags); +long vfsub_splice_from(struct pipe_inode_info *pipe, struct file *out, + loff_t *ppos, size_t len, unsigned int flags); + +static inline long vfsub_truncate(struct path *path, loff_t length) +{ + long err; + + lockdep_off(); + err = vfs_truncate(path, length); + lockdep_on(); + return err; +} + +int vfsub_trunc(struct path *h_path, loff_t length, unsigned int attr, + struct file *h_file); +int vfsub_fsync(struct file *file, struct path *path, int datasync); + +/* ---------------------------------------------------------------------- */ + +static inline loff_t vfsub_llseek(struct file *file, loff_t offset, int origin) +{ + loff_t err; + + lockdep_off(); + err = vfs_llseek(file, offset, origin); + lockdep_on(); + return err; +} + +/* ---------------------------------------------------------------------- */ + +/* dirty workaround for strict type of fmode_t */ +union vfsub_fmu { + fmode_t fm; + unsigned int ui; +}; + +static inline unsigned int vfsub_fmode_to_uint(fmode_t fm) +{ + union vfsub_fmu u = { + .fm = fm + }; + + BUILD_BUG_ON(sizeof(u.fm) != sizeof(u.ui)); + + return u.ui; +} + +static inline fmode_t vfsub_uint_to_fmode(unsigned int ui) +{ + union vfsub_fmu u = { + .ui = ui + }; + + return u.fm; +} + +/* ---------------------------------------------------------------------- */ + +int vfsub_sio_mkdir(struct inode *dir, struct path *path, int mode); +int vfsub_sio_rmdir(struct inode *dir, struct path *path); +int vfsub_sio_notify_change(struct path *path, struct iattr *ia); +int vfsub_notify_change(struct path *path, struct iattr *ia); +int vfsub_unlink(struct inode *dir, struct path *path, int force); + +/* ---------------------------------------------------------------------- */ + +static inline int vfsub_setxattr(struct dentry *dentry, const char *name, + const void *value, size_t size, int flags) +{ + int err; + + lockdep_off(); + err = vfs_setxattr(dentry, name, value, size, flags); + lockdep_on(); + + return err; +} + +static inline int vfsub_removexattr(struct dentry *dentry, const char *name) +{ + int err; + + lockdep_off(); + err = vfs_removexattr(dentry, name); + lockdep_on(); + + return err; +} + +#endif /* __KERNEL__ */ +#endif /* __AUFS_VFSUB_H__ */ diff --git a/fs/aufs/wbr_policy.c b/fs/aufs/wbr_policy.c new file mode 100644 index 00000000000000..391b0e00a70d53 --- /dev/null +++ b/fs/aufs/wbr_policy.c @@ -0,0 +1,764 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * policies for selecting one among multiple writable branches + */ + +#include +#include "aufs.h" + +/* subset of cpup_attr() */ +static noinline_for_stack +int au_cpdown_attr(struct path *h_path, struct dentry *h_src) +{ + int err, sbits; + struct iattr ia; + struct inode *h_isrc; + + h_isrc = h_src->d_inode; + ia.ia_valid = ATTR_FORCE | ATTR_MODE | ATTR_UID | ATTR_GID; + ia.ia_mode = h_isrc->i_mode; + ia.ia_uid = h_isrc->i_uid; + ia.ia_gid = h_isrc->i_gid; + sbits = !!(ia.ia_mode & (S_ISUID | S_ISGID)); + au_cpup_attr_flags(h_path->dentry->d_inode, h_isrc->i_flags); + err = vfsub_sio_notify_change(h_path, &ia); + + /* is this nfs only? */ + if (!err && sbits && au_test_nfs(h_path->dentry->d_sb)) { + ia.ia_valid = ATTR_FORCE | ATTR_MODE; + ia.ia_mode = h_isrc->i_mode; + err = vfsub_sio_notify_change(h_path, &ia); + } + + return err; +} + +#define AuCpdown_PARENT_OPQ 1 +#define AuCpdown_WHED (1 << 1) +#define AuCpdown_MADE_DIR (1 << 2) +#define AuCpdown_DIROPQ (1 << 3) +#define au_ftest_cpdown(flags, name) ((flags) & AuCpdown_##name) +#define au_fset_cpdown(flags, name) \ + do { (flags) |= AuCpdown_##name; } while (0) +#define au_fclr_cpdown(flags, name) \ + do { (flags) &= ~AuCpdown_##name; } while (0) + +static int au_cpdown_dir_opq(struct dentry *dentry, aufs_bindex_t bdst, + unsigned int *flags) +{ + int err; + struct dentry *opq_dentry; + + opq_dentry = au_diropq_create(dentry, bdst); + err = PTR_ERR(opq_dentry); + if (IS_ERR(opq_dentry)) + goto out; + dput(opq_dentry); + au_fset_cpdown(*flags, DIROPQ); + +out: + return err; +} + +static int au_cpdown_dir_wh(struct dentry *dentry, struct dentry *h_parent, + struct inode *dir, aufs_bindex_t bdst) +{ + int err; + struct path h_path; + struct au_branch *br; + + br = au_sbr(dentry->d_sb, bdst); + h_path.dentry = au_wh_lkup(h_parent, &dentry->d_name, br); + err = PTR_ERR(h_path.dentry); + if (IS_ERR(h_path.dentry)) + goto out; + + err = 0; + if (h_path.dentry->d_inode) { + h_path.mnt = au_br_mnt(br); + err = au_wh_unlink_dentry(au_h_iptr(dir, bdst), &h_path, + dentry); + } + dput(h_path.dentry); + +out: + return err; +} + +static int au_cpdown_dir(struct dentry *dentry, aufs_bindex_t bdst, + struct au_pin *pin, + struct dentry *h_parent, void *arg) +{ + int err, rerr; + aufs_bindex_t bopq, bstart; + struct path h_path; + struct dentry *parent; + struct inode *h_dir, *h_inode, *inode, *dir; + unsigned int *flags = arg; + + bstart = au_dbstart(dentry); + /* dentry is di-locked */ + parent = dget_parent(dentry); + dir = parent->d_inode; + h_dir = h_parent->d_inode; + AuDebugOn(h_dir != au_h_iptr(dir, bdst)); + IMustLock(h_dir); + + err = au_lkup_neg(dentry, bdst, /*wh*/0); + if (unlikely(err < 0)) + goto out; + h_path.dentry = au_h_dptr(dentry, bdst); + h_path.mnt = au_sbr_mnt(dentry->d_sb, bdst); + err = vfsub_sio_mkdir(au_h_iptr(dir, bdst), &h_path, + S_IRWXU | S_IRUGO | S_IXUGO); + if (unlikely(err)) + goto out_put; + au_fset_cpdown(*flags, MADE_DIR); + + bopq = au_dbdiropq(dentry); + au_fclr_cpdown(*flags, WHED); + au_fclr_cpdown(*flags, DIROPQ); + if (au_dbwh(dentry) == bdst) + au_fset_cpdown(*flags, WHED); + if (!au_ftest_cpdown(*flags, PARENT_OPQ) && bopq <= bdst) + au_fset_cpdown(*flags, PARENT_OPQ); + h_inode = h_path.dentry->d_inode; + mutex_lock_nested(&h_inode->i_mutex, AuLsc_I_CHILD); + if (au_ftest_cpdown(*flags, WHED)) { + err = au_cpdown_dir_opq(dentry, bdst, flags); + if (unlikely(err)) { + mutex_unlock(&h_inode->i_mutex); + goto out_dir; + } + } + + err = au_cpdown_attr(&h_path, au_h_dptr(dentry, bstart)); + mutex_unlock(&h_inode->i_mutex); + if (unlikely(err)) + goto out_opq; + + if (au_ftest_cpdown(*flags, WHED)) { + err = au_cpdown_dir_wh(dentry, h_parent, dir, bdst); + if (unlikely(err)) + goto out_opq; + } + + inode = dentry->d_inode; + if (au_ibend(inode) < bdst) + au_set_ibend(inode, bdst); + au_set_h_iptr(inode, bdst, au_igrab(h_inode), + au_hi_flags(inode, /*isdir*/1)); + au_fhsm_wrote(dentry->d_sb, bdst, /*force*/0); + goto out; /* success */ + + /* revert */ +out_opq: + if (au_ftest_cpdown(*flags, DIROPQ)) { + mutex_lock_nested(&h_inode->i_mutex, AuLsc_I_CHILD); + rerr = au_diropq_remove(dentry, bdst); + mutex_unlock(&h_inode->i_mutex); + if (unlikely(rerr)) { + AuIOErr("failed removing diropq for %.*s b%d (%d)\n", + AuDLNPair(dentry), bdst, rerr); + err = -EIO; + goto out; + } + } +out_dir: + if (au_ftest_cpdown(*flags, MADE_DIR)) { + rerr = vfsub_sio_rmdir(au_h_iptr(dir, bdst), &h_path); + if (unlikely(rerr)) { + AuIOErr("failed removing %.*s b%d (%d)\n", + AuDLNPair(dentry), bdst, rerr); + err = -EIO; + } + } +out_put: + au_set_h_dptr(dentry, bdst, NULL); + if (au_dbend(dentry) == bdst) + au_update_dbend(dentry); +out: + dput(parent); + return err; +} + +int au_cpdown_dirs(struct dentry *dentry, aufs_bindex_t bdst) +{ + int err; + unsigned int flags; + + flags = 0; + err = au_cp_dirs(dentry, bdst, au_cpdown_dir, &flags); + + return err; +} + +/* ---------------------------------------------------------------------- */ + +/* policies for create */ + +int au_wbr_nonopq(struct dentry *dentry, aufs_bindex_t bindex) +{ + int err, i, j, ndentry; + aufs_bindex_t bopq; + struct au_dcsub_pages dpages; + struct au_dpage *dpage; + struct dentry **dentries, *parent, *d; + + err = au_dpages_init(&dpages, GFP_NOFS); + if (unlikely(err)) + goto out; + parent = dget_parent(dentry); + err = au_dcsub_pages_rev_aufs(&dpages, parent, /*do_include*/0); + if (unlikely(err)) + goto out_free; + + err = bindex; + for (i = 0; i < dpages.ndpage; i++) { + dpage = dpages.dpages + i; + dentries = dpage->dentries; + ndentry = dpage->ndentry; + for (j = 0; j < ndentry; j++) { + d = dentries[j]; + di_read_lock_parent2(d, !AuLock_IR); + bopq = au_dbdiropq(d); + di_read_unlock(d, !AuLock_IR); + if (bopq >= 0 && bopq < err) + err = bopq; + } + } + +out_free: + dput(parent); + au_dpages_free(&dpages); +out: + return err; +} + +static int au_wbr_bu(struct super_block *sb, aufs_bindex_t bindex) +{ + for (; bindex >= 0; bindex--) + if (!au_br_rdonly(au_sbr(sb, bindex))) + return bindex; + return -EROFS; +} + +/* top down parent */ +static int au_wbr_create_tdp(struct dentry *dentry, + unsigned int flags __maybe_unused) +{ + int err; + aufs_bindex_t bstart, bindex; + struct super_block *sb; + struct dentry *parent, *h_parent; + + sb = dentry->d_sb; + bstart = au_dbstart(dentry); + err = bstart; + if (!au_br_rdonly(au_sbr(sb, bstart))) + goto out; + + err = -EROFS; + parent = dget_parent(dentry); + for (bindex = au_dbstart(parent); bindex < bstart; bindex++) { + h_parent = au_h_dptr(parent, bindex); + if (!h_parent || !h_parent->d_inode) + continue; + + if (!au_br_rdonly(au_sbr(sb, bindex))) { + err = bindex; + break; + } + } + dput(parent); + + /* bottom up here */ + if (unlikely(err < 0)) { + err = au_wbr_bu(sb, bstart - 1); + if (err >= 0) + err = au_wbr_nonopq(dentry, err); + } + +out: + AuDbg("b%d\n", err); + return err; +} + +/* ---------------------------------------------------------------------- */ + +/* an exception for the policy other than tdp */ +static int au_wbr_create_exp(struct dentry *dentry) +{ + int err; + aufs_bindex_t bwh, bdiropq; + struct dentry *parent; + + err = -1; + bwh = au_dbwh(dentry); + parent = dget_parent(dentry); + bdiropq = au_dbdiropq(parent); + if (bwh >= 0) { + if (bdiropq >= 0) + err = min(bdiropq, bwh); + else + err = bwh; + AuDbg("%d\n", err); + } else if (bdiropq >= 0) { + err = bdiropq; + AuDbg("%d\n", err); + } + dput(parent); + + if (err >= 0) + err = au_wbr_nonopq(dentry, err); + + if (err >= 0 && au_br_rdonly(au_sbr(dentry->d_sb, err))) + err = -1; + + AuDbg("%d\n", err); + return err; +} + +/* ---------------------------------------------------------------------- */ + +/* round robin */ +static int au_wbr_create_init_rr(struct super_block *sb) +{ + int err; + + err = au_wbr_bu(sb, au_sbend(sb)); + atomic_set(&au_sbi(sb)->si_wbr_rr_next, -err); /* less important */ + /* smp_mb(); */ + + AuDbg("b%d\n", err); + return err; +} + +static int au_wbr_create_rr(struct dentry *dentry, unsigned int flags) +{ + int err, nbr; + unsigned int u; + aufs_bindex_t bindex, bend; + struct super_block *sb; + atomic_t *next; + + err = au_wbr_create_exp(dentry); + if (err >= 0) + goto out; + + sb = dentry->d_sb; + next = &au_sbi(sb)->si_wbr_rr_next; + bend = au_sbend(sb); + nbr = bend + 1; + for (bindex = 0; bindex <= bend; bindex++) { + if (!au_ftest_wbr(flags, DIR)) { + err = atomic_dec_return(next) + 1; + /* modulo for 0 is meaningless */ + if (unlikely(!err)) + err = atomic_dec_return(next) + 1; + } else + err = atomic_read(next); + AuDbg("%d\n", err); + u = err; + err = u % nbr; + AuDbg("%d\n", err); + if (!au_br_rdonly(au_sbr(sb, err))) + break; + err = -EROFS; + } + + if (err >= 0) + err = au_wbr_nonopq(dentry, err); + +out: + AuDbg("%d\n", err); + return err; +} + +/* ---------------------------------------------------------------------- */ + +/* most free space */ +static void au_mfs(struct dentry *dentry, struct dentry *parent) +{ + struct super_block *sb; + struct au_branch *br; + struct au_wbr_mfs *mfs; + struct dentry *h_parent; + aufs_bindex_t bindex, bend; + int err; + unsigned long long b, bavail; + struct path h_path; + /* reduce the stack usage */ + struct kstatfs *st; + + st = kmalloc(sizeof(*st), GFP_NOFS); + if (unlikely(!st)) { + AuWarn1("failed updating mfs(%d), ignored\n", -ENOMEM); + return; + } + + bavail = 0; + sb = dentry->d_sb; + mfs = &au_sbi(sb)->si_wbr_mfs; + MtxMustLock(&mfs->mfs_lock); + mfs->mfs_bindex = -EROFS; + mfs->mfsrr_bytes = 0; + if (!parent) { + bindex = 0; + bend = au_sbend(sb); + } else { + bindex = au_dbstart(parent); + bend = au_dbtaildir(parent); + } + + for (; bindex <= bend; bindex++) { + if (parent) { + h_parent = au_h_dptr(parent, bindex); + if (!h_parent || !h_parent->d_inode) + continue; + } + br = au_sbr(sb, bindex); + if (au_br_rdonly(br)) + continue; + + /* sb->s_root for NFS is unreliable */ + h_path.mnt = au_br_mnt(br); + h_path.dentry = h_path.mnt->mnt_root; + err = vfs_statfs(&h_path, st); + if (unlikely(err)) { + AuWarn1("failed statfs, b%d, %d\n", bindex, err); + continue; + } + + /* when the available size is equal, select the lower one */ + BUILD_BUG_ON(sizeof(b) < sizeof(st->f_bavail) + || sizeof(b) < sizeof(st->f_bsize)); + b = st->f_bavail * st->f_bsize; + br->br_wbr->wbr_bytes = b; + if (b >= bavail) { + bavail = b; + mfs->mfs_bindex = bindex; + mfs->mfs_jiffy = jiffies; + } + } + + mfs->mfsrr_bytes = bavail; + AuDbg("b%d\n", mfs->mfs_bindex); + kfree(st); +} + +static int au_wbr_create_mfs(struct dentry *dentry, unsigned int flags) +{ + int err; + struct dentry *parent; + struct super_block *sb; + struct au_wbr_mfs *mfs; + + err = au_wbr_create_exp(dentry); + if (err >= 0) + goto out; + + sb = dentry->d_sb; + parent = NULL; + if (au_ftest_wbr(flags, PARENT)) + parent = dget_parent(dentry); + mfs = &au_sbi(sb)->si_wbr_mfs; + mutex_lock(&mfs->mfs_lock); + if (time_after(jiffies, mfs->mfs_jiffy + mfs->mfs_expire) + || mfs->mfs_bindex < 0 + || au_br_rdonly(au_sbr(sb, mfs->mfs_bindex))) + au_mfs(dentry, parent); + mutex_unlock(&mfs->mfs_lock); + err = mfs->mfs_bindex; + dput(parent); + + if (err >= 0) + err = au_wbr_nonopq(dentry, err); + +out: + AuDbg("b%d\n", err); + return err; +} + +static int au_wbr_create_init_mfs(struct super_block *sb) +{ + struct au_wbr_mfs *mfs; + + mfs = &au_sbi(sb)->si_wbr_mfs; + mutex_init(&mfs->mfs_lock); + mfs->mfs_jiffy = 0; + mfs->mfs_bindex = -EROFS; + + return 0; +} + +static int au_wbr_create_fin_mfs(struct super_block *sb __maybe_unused) +{ + mutex_destroy(&au_sbi(sb)->si_wbr_mfs.mfs_lock); + return 0; +} + +/* ---------------------------------------------------------------------- */ + +/* most free space and then round robin */ +static int au_wbr_create_mfsrr(struct dentry *dentry, unsigned int flags) +{ + int err; + struct au_wbr_mfs *mfs; + + err = au_wbr_create_mfs(dentry, flags); + if (err >= 0) { + mfs = &au_sbi(dentry->d_sb)->si_wbr_mfs; + mutex_lock(&mfs->mfs_lock); + if (mfs->mfsrr_bytes < mfs->mfsrr_watermark) + err = au_wbr_create_rr(dentry, flags); + mutex_unlock(&mfs->mfs_lock); + } + + AuDbg("b%d\n", err); + return err; +} + +static int au_wbr_create_init_mfsrr(struct super_block *sb) +{ + int err; + + au_wbr_create_init_mfs(sb); /* ignore */ + err = au_wbr_create_init_rr(sb); + + return err; +} + +/* ---------------------------------------------------------------------- */ + +/* top down parent and most free space */ +static int au_wbr_create_pmfs(struct dentry *dentry, unsigned int flags) +{ + int err, e2; + unsigned long long b; + aufs_bindex_t bindex, bstart, bend; + struct super_block *sb; + struct dentry *parent, *h_parent; + struct au_branch *br; + + err = au_wbr_create_tdp(dentry, flags); + if (unlikely(err < 0)) + goto out; + parent = dget_parent(dentry); + bstart = au_dbstart(parent); + bend = au_dbtaildir(parent); + if (bstart == bend) + goto out_parent; /* success */ + + e2 = au_wbr_create_mfs(dentry, flags); + if (e2 < 0) + goto out_parent; /* success */ + + /* when the available size is equal, select upper one */ + sb = dentry->d_sb; + br = au_sbr(sb, err); + b = br->br_wbr->wbr_bytes; + AuDbg("b%d, %llu\n", err, b); + + for (bindex = bstart; bindex <= bend; bindex++) { + h_parent = au_h_dptr(parent, bindex); + if (!h_parent || !h_parent->d_inode) + continue; + + br = au_sbr(sb, bindex); + if (!au_br_rdonly(br) && br->br_wbr->wbr_bytes > b) { + b = br->br_wbr->wbr_bytes; + err = bindex; + AuDbg("b%d, %llu\n", err, b); + } + } + + if (err >= 0) + err = au_wbr_nonopq(dentry, err); + +out_parent: + dput(parent); +out: + AuDbg("b%d\n", err); + return err; +} + +/* ---------------------------------------------------------------------- */ + +/* + * - top down parent + * - most free space with parent + * - most free space round-robin regardless parent + */ +static int au_wbr_create_pmfsrr(struct dentry *dentry, unsigned int flags) +{ + int err; + unsigned long long watermark; + struct super_block *sb; + struct au_branch *br; + struct au_wbr_mfs *mfs; + + err = au_wbr_create_pmfs(dentry, flags | AuWbr_PARENT); + if (unlikely(err < 0)) + goto out; + + sb = dentry->d_sb; + br = au_sbr(sb, err); + mfs = &au_sbi(sb)->si_wbr_mfs; + mutex_lock(&mfs->mfs_lock); + watermark = mfs->mfsrr_watermark; + mutex_unlock(&mfs->mfs_lock); + if (br->br_wbr->wbr_bytes < watermark) + /* regardless the parent dir */ + err = au_wbr_create_mfsrr(dentry, flags); + +out: + AuDbg("b%d\n", err); + return err; +} + +/* ---------------------------------------------------------------------- */ + +/* policies for copyup */ + +/* top down parent */ +static int au_wbr_copyup_tdp(struct dentry *dentry) +{ + return au_wbr_create_tdp(dentry, /*flags, anything is ok*/0); +} + +/* bottom up parent */ +static int au_wbr_copyup_bup(struct dentry *dentry) +{ + int err; + aufs_bindex_t bindex, bstart; + struct dentry *parent, *h_parent; + struct super_block *sb; + + err = -EROFS; + sb = dentry->d_sb; + parent = dget_parent(dentry); + bstart = au_dbstart(parent); + for (bindex = au_dbstart(dentry); bindex >= bstart; bindex--) { + h_parent = au_h_dptr(parent, bindex); + if (!h_parent || !h_parent->d_inode) + continue; + + if (!au_br_rdonly(au_sbr(sb, bindex))) { + err = bindex; + break; + } + } + dput(parent); + + /* bottom up here */ + if (unlikely(err < 0)) + err = au_wbr_bu(sb, bstart - 1); + + AuDbg("b%d\n", err); + return err; +} + +/* bottom up */ +int au_wbr_do_copyup_bu(struct dentry *dentry, aufs_bindex_t bstart) +{ + int err; + + err = au_wbr_bu(dentry->d_sb, bstart); + AuDbg("b%d\n", err); + if (err > bstart) + err = au_wbr_nonopq(dentry, err); + + AuDbg("b%d\n", err); + return err; +} + +static int au_wbr_copyup_bu(struct dentry *dentry) +{ + int err; + aufs_bindex_t bstart; + + bstart = au_dbstart(dentry); + err = au_wbr_do_copyup_bu(dentry, bstart); + return err; +} + +/* ---------------------------------------------------------------------- */ + +struct au_wbr_copyup_operations au_wbr_copyup_ops[] = { + [AuWbrCopyup_TDP] = { + .copyup = au_wbr_copyup_tdp + }, + [AuWbrCopyup_BUP] = { + .copyup = au_wbr_copyup_bup + }, + [AuWbrCopyup_BU] = { + .copyup = au_wbr_copyup_bu + } +}; + +struct au_wbr_create_operations au_wbr_create_ops[] = { + [AuWbrCreate_TDP] = { + .create = au_wbr_create_tdp + }, + [AuWbrCreate_RR] = { + .create = au_wbr_create_rr, + .init = au_wbr_create_init_rr + }, + [AuWbrCreate_MFS] = { + .create = au_wbr_create_mfs, + .init = au_wbr_create_init_mfs, + .fin = au_wbr_create_fin_mfs + }, + [AuWbrCreate_MFSV] = { + .create = au_wbr_create_mfs, + .init = au_wbr_create_init_mfs, + .fin = au_wbr_create_fin_mfs + }, + [AuWbrCreate_MFSRR] = { + .create = au_wbr_create_mfsrr, + .init = au_wbr_create_init_mfsrr, + .fin = au_wbr_create_fin_mfs + }, + [AuWbrCreate_MFSRRV] = { + .create = au_wbr_create_mfsrr, + .init = au_wbr_create_init_mfsrr, + .fin = au_wbr_create_fin_mfs + }, + [AuWbrCreate_PMFS] = { + .create = au_wbr_create_pmfs, + .init = au_wbr_create_init_mfs, + .fin = au_wbr_create_fin_mfs + }, + [AuWbrCreate_PMFSV] = { + .create = au_wbr_create_pmfs, + .init = au_wbr_create_init_mfs, + .fin = au_wbr_create_fin_mfs + }, + [AuWbrCreate_PMFSRR] = { + .create = au_wbr_create_pmfsrr, + .init = au_wbr_create_init_mfsrr, + .fin = au_wbr_create_fin_mfs + }, + [AuWbrCreate_PMFSRRV] = { + .create = au_wbr_create_pmfsrr, + .init = au_wbr_create_init_mfsrr, + .fin = au_wbr_create_fin_mfs + } +}; diff --git a/fs/aufs/whout.c b/fs/aufs/whout.c new file mode 100644 index 00000000000000..8537a1ca3feb0d --- /dev/null +++ b/fs/aufs/whout.c @@ -0,0 +1,1025 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * whiteout for logical deletion and opaque directory + */ + +#include "aufs.h" + +#define WH_MASK S_IRUGO + +/* + * If a directory contains this file, then it is opaque. We start with the + * .wh. flag so that it is blocked by lookup. + */ +static struct qstr diropq_name = QSTR_INIT(AUFS_WH_DIROPQ, + sizeof(AUFS_WH_DIROPQ) - 1); + +/* + * generate whiteout name, which is NOT terminated by NULL. + * @name: original d_name.name + * @len: original d_name.len + * @wh: whiteout qstr + * returns zero when succeeds, otherwise error. + * succeeded value as wh->name should be freed by kfree(). + */ +int au_wh_name_alloc(struct qstr *wh, const struct qstr *name) +{ + char *p; + + if (unlikely(name->len > PATH_MAX - AUFS_WH_PFX_LEN)) + return -ENAMETOOLONG; + + wh->len = name->len + AUFS_WH_PFX_LEN; + p = kmalloc(wh->len, GFP_NOFS); + wh->name = p; + if (p) { + memcpy(p, AUFS_WH_PFX, AUFS_WH_PFX_LEN); + memcpy(p + AUFS_WH_PFX_LEN, name->name, name->len); + /* smp_mb(); */ + return 0; + } + return -ENOMEM; +} + +/* ---------------------------------------------------------------------- */ + +/* + * test if the @wh_name exists under @h_parent. + * @try_sio specifies the necessary of super-io. + */ +int au_wh_test(struct dentry *h_parent, struct qstr *wh_name, int try_sio) +{ + int err; + struct dentry *wh_dentry; + + if (!try_sio) + wh_dentry = vfsub_lkup_one(wh_name, h_parent); + else + wh_dentry = au_sio_lkup_one(wh_name, h_parent); + err = PTR_ERR(wh_dentry); + if (IS_ERR(wh_dentry)) + goto out; + + err = 0; + if (!wh_dentry->d_inode) + goto out_wh; /* success */ + + err = 1; + if (S_ISREG(wh_dentry->d_inode->i_mode)) + goto out_wh; /* success */ + + err = -EIO; + AuIOErr("%.*s Invalid whiteout entry type 0%o.\n", + AuDLNPair(wh_dentry), wh_dentry->d_inode->i_mode); + +out_wh: + dput(wh_dentry); +out: + return err; +} + +/* + * test if the @h_dentry sets opaque or not. + */ +int au_diropq_test(struct dentry *h_dentry) +{ + int err; + struct inode *h_dir; + + h_dir = h_dentry->d_inode; + err = au_wh_test(h_dentry, &diropq_name, + au_test_h_perm_sio(h_dir, MAY_EXEC)); + return err; +} + +/* + * returns a negative dentry whose name is unique and temporary. + */ +struct dentry *au_whtmp_lkup(struct dentry *h_parent, struct au_branch *br, + struct qstr *prefix) +{ + struct dentry *dentry; + int i; + char defname[NAME_MAX - AUFS_MAX_NAMELEN + DNAME_INLINE_LEN + 1], + *name, *p; + /* strict atomic_t is unnecessary here */ + static unsigned short cnt; + struct qstr qs; + + BUILD_BUG_ON(sizeof(cnt) * 2 > AUFS_WH_TMP_LEN); + + name = defname; + qs.len = sizeof(defname) - DNAME_INLINE_LEN + prefix->len - 1; + if (unlikely(prefix->len > DNAME_INLINE_LEN)) { + dentry = ERR_PTR(-ENAMETOOLONG); + if (unlikely(qs.len > NAME_MAX)) + goto out; + dentry = ERR_PTR(-ENOMEM); + name = kmalloc(qs.len + 1, GFP_NOFS); + if (unlikely(!name)) + goto out; + } + + /* doubly whiteout-ed */ + memcpy(name, AUFS_WH_PFX AUFS_WH_PFX, AUFS_WH_PFX_LEN * 2); + p = name + AUFS_WH_PFX_LEN * 2; + memcpy(p, prefix->name, prefix->len); + p += prefix->len; + *p++ = '.'; + AuDebugOn(name + qs.len + 1 - p <= AUFS_WH_TMP_LEN); + + qs.name = name; + for (i = 0; i < 3; i++) { + sprintf(p, "%.*x", AUFS_WH_TMP_LEN, cnt++); + dentry = au_sio_lkup_one(&qs, h_parent); + if (IS_ERR(dentry) || !dentry->d_inode) + goto out_name; + dput(dentry); + } + /* pr_warn("could not get random name\n"); */ + dentry = ERR_PTR(-EEXIST); + AuDbg("%.*s\n", AuLNPair(&qs)); + BUG(); + +out_name: + if (name != defname) + kfree(name); +out: + AuTraceErrPtr(dentry); + return dentry; +} + +/* + * rename the @h_dentry on @br to the whiteouted temporary name. + */ +int au_whtmp_ren(struct dentry *h_dentry, struct au_branch *br) +{ + int err; + struct path h_path = { + .mnt = au_br_mnt(br) + }; + struct inode *h_dir; + struct dentry *h_parent; + + h_parent = h_dentry->d_parent; /* dir inode is locked */ + h_dir = h_parent->d_inode; + IMustLock(h_dir); + + h_path.dentry = au_whtmp_lkup(h_parent, br, &h_dentry->d_name); + err = PTR_ERR(h_path.dentry); + if (IS_ERR(h_path.dentry)) + goto out; + + /* under the same dir, no need to lock_rename() */ + err = vfsub_rename(h_dir, h_dentry, h_dir, &h_path); + AuTraceErr(err); + dput(h_path.dentry); + +out: + AuTraceErr(err); + return err; +} + +/* ---------------------------------------------------------------------- */ +/* + * functions for removing a whiteout + */ + +static int do_unlink_wh(struct inode *h_dir, struct path *h_path) +{ + int force; + + /* + * forces superio when the dir has a sticky bit. + * this may be a violation of unix fs semantics. + */ + force = (h_dir->i_mode & S_ISVTX) + && !uid_eq(current_fsuid(), h_path->dentry->d_inode->i_uid); + return vfsub_unlink(h_dir, h_path, force); +} + +int au_wh_unlink_dentry(struct inode *h_dir, struct path *h_path, + struct dentry *dentry) +{ + int err; + + err = do_unlink_wh(h_dir, h_path); + if (!err && dentry) + au_set_dbwh(dentry, -1); + + return err; +} + +static int unlink_wh_name(struct dentry *h_parent, struct qstr *wh, + struct au_branch *br) +{ + int err; + struct path h_path = { + .mnt = au_br_mnt(br) + }; + + err = 0; + h_path.dentry = vfsub_lkup_one(wh, h_parent); + if (IS_ERR(h_path.dentry)) + err = PTR_ERR(h_path.dentry); + else { + if (h_path.dentry->d_inode + && S_ISREG(h_path.dentry->d_inode->i_mode)) + err = do_unlink_wh(h_parent->d_inode, &h_path); + dput(h_path.dentry); + } + + return err; +} + +/* ---------------------------------------------------------------------- */ +/* + * initialize/clean whiteout for a branch + */ + +static void au_wh_clean(struct inode *h_dir, struct path *whpath, + const int isdir) +{ + int err; + + if (!whpath->dentry->d_inode) + return; + + if (isdir) + err = vfsub_rmdir(h_dir, whpath); + else + err = vfsub_unlink(h_dir, whpath, /*force*/0); + if (unlikely(err)) + pr_warn("failed removing %.*s (%d), ignored.\n", + AuDLNPair(whpath->dentry), err); +} + +static int test_linkable(struct dentry *h_root) +{ + struct inode *h_dir = h_root->d_inode; + + if (h_dir->i_op->link) + return 0; + + pr_err("%.*s (%s) doesn't support link(2), use noplink and rw+nolwh\n", + AuDLNPair(h_root), au_sbtype(h_root->d_sb)); + return -ENOSYS; +} + +/* todo: should this mkdir be done in /sbin/mount.aufs helper? */ +static int au_whdir(struct inode *h_dir, struct path *path) +{ + int err; + + err = -EEXIST; + if (!path->dentry->d_inode) { + int mode = S_IRWXU; + + if (au_test_nfs(path->dentry->d_sb)) + mode |= S_IXUGO; + err = vfsub_mkdir(h_dir, path, mode); + } else if (S_ISDIR(path->dentry->d_inode->i_mode)) + err = 0; + else + pr_err("unknown %.*s exists\n", AuDLNPair(path->dentry)); + + return err; +} + +struct au_wh_base { + const struct qstr *name; + struct dentry *dentry; +}; + +static void au_wh_init_ro(struct inode *h_dir, struct au_wh_base base[], + struct path *h_path) +{ + h_path->dentry = base[AuBrWh_BASE].dentry; + au_wh_clean(h_dir, h_path, /*isdir*/0); + h_path->dentry = base[AuBrWh_PLINK].dentry; + au_wh_clean(h_dir, h_path, /*isdir*/1); + h_path->dentry = base[AuBrWh_ORPH].dentry; + au_wh_clean(h_dir, h_path, /*isdir*/1); +} + +/* + * returns tri-state, + * minus: error, caller should print the message + * zero: succuess + * plus: error, caller should NOT print the message + */ +static int au_wh_init_rw_nolink(struct dentry *h_root, struct au_wbr *wbr, + int do_plink, struct au_wh_base base[], + struct path *h_path) +{ + int err; + struct inode *h_dir; + + h_dir = h_root->d_inode; + h_path->dentry = base[AuBrWh_BASE].dentry; + au_wh_clean(h_dir, h_path, /*isdir*/0); + h_path->dentry = base[AuBrWh_PLINK].dentry; + if (do_plink) { + err = test_linkable(h_root); + if (unlikely(err)) { + err = 1; + goto out; + } + + err = au_whdir(h_dir, h_path); + if (unlikely(err)) + goto out; + wbr->wbr_plink = dget(base[AuBrWh_PLINK].dentry); + } else + au_wh_clean(h_dir, h_path, /*isdir*/1); + h_path->dentry = base[AuBrWh_ORPH].dentry; + err = au_whdir(h_dir, h_path); + if (unlikely(err)) + goto out; + wbr->wbr_orph = dget(base[AuBrWh_ORPH].dentry); + +out: + return err; +} + +/* + * for the moment, aufs supports the branch filesystem which does not support + * link(2). testing on FAT which does not support i_op->setattr() fully either, + * copyup failed. finally, such filesystem will not be used as the writable + * branch. + * + * returns tri-state, see above. + */ +static int au_wh_init_rw(struct dentry *h_root, struct au_wbr *wbr, + int do_plink, struct au_wh_base base[], + struct path *h_path) +{ + int err; + struct inode *h_dir; + + WbrWhMustWriteLock(wbr); + + err = test_linkable(h_root); + if (unlikely(err)) { + err = 1; + goto out; + } + + /* + * todo: should this create be done in /sbin/mount.aufs helper? + */ + err = -EEXIST; + h_dir = h_root->d_inode; + if (!base[AuBrWh_BASE].dentry->d_inode) { + h_path->dentry = base[AuBrWh_BASE].dentry; + err = vfsub_create(h_dir, h_path, WH_MASK, /*want_excl*/true); + } else if (S_ISREG(base[AuBrWh_BASE].dentry->d_inode->i_mode)) + err = 0; + else + pr_err("unknown %.*s/%.*s exists\n", + AuDLNPair(h_root), AuDLNPair(base[AuBrWh_BASE].dentry)); + if (unlikely(err)) + goto out; + + h_path->dentry = base[AuBrWh_PLINK].dentry; + if (do_plink) { + err = au_whdir(h_dir, h_path); + if (unlikely(err)) + goto out; + wbr->wbr_plink = dget(base[AuBrWh_PLINK].dentry); + } else + au_wh_clean(h_dir, h_path, /*isdir*/1); + wbr->wbr_whbase = dget(base[AuBrWh_BASE].dentry); + + h_path->dentry = base[AuBrWh_ORPH].dentry; + err = au_whdir(h_dir, h_path); + if (unlikely(err)) + goto out; + wbr->wbr_orph = dget(base[AuBrWh_ORPH].dentry); + +out: + return err; +} + +/* + * initialize the whiteout base file/dir for @br. + */ +int au_wh_init(struct au_branch *br, struct super_block *sb) +{ + int err, i; + const unsigned char do_plink + = !!au_opt_test(au_mntflags(sb), PLINK); + struct inode *h_dir; + struct path path = br->br_path; + struct dentry *h_root = path.dentry; + struct au_wbr *wbr = br->br_wbr; + static const struct qstr base_name[] = { + [AuBrWh_BASE] = QSTR_INIT(AUFS_BASE_NAME, + sizeof(AUFS_BASE_NAME) - 1), + [AuBrWh_PLINK] = QSTR_INIT(AUFS_PLINKDIR_NAME, + sizeof(AUFS_PLINKDIR_NAME) - 1), + [AuBrWh_ORPH] = QSTR_INIT(AUFS_ORPHDIR_NAME, + sizeof(AUFS_ORPHDIR_NAME) - 1) + }; + struct au_wh_base base[] = { + [AuBrWh_BASE] = { + .name = base_name + AuBrWh_BASE, + .dentry = NULL + }, + [AuBrWh_PLINK] = { + .name = base_name + AuBrWh_PLINK, + .dentry = NULL + }, + [AuBrWh_ORPH] = { + .name = base_name + AuBrWh_ORPH, + .dentry = NULL + } + }; + + if (wbr) + WbrWhMustWriteLock(wbr); + + for (i = 0; i < AuBrWh_Last; i++) { + /* doubly whiteouted */ + struct dentry *d; + + d = au_wh_lkup(h_root, (void *)base[i].name, br); + err = PTR_ERR(d); + if (IS_ERR(d)) + goto out; + + base[i].dentry = d; + AuDebugOn(wbr + && wbr->wbr_wh[i] + && wbr->wbr_wh[i] != base[i].dentry); + } + + if (wbr) + for (i = 0; i < AuBrWh_Last; i++) { + dput(wbr->wbr_wh[i]); + wbr->wbr_wh[i] = NULL; + } + + err = 0; + if (!au_br_writable(br->br_perm)) { + h_dir = h_root->d_inode; + au_wh_init_ro(h_dir, base, &path); + } else if (!au_br_wh_linkable(br->br_perm)) { + err = au_wh_init_rw_nolink(h_root, wbr, do_plink, base, &path); + if (err > 0) + goto out; + else if (err) + goto out_err; + } else { + err = au_wh_init_rw(h_root, wbr, do_plink, base, &path); + if (err > 0) + goto out; + else if (err) + goto out_err; + } + goto out; /* success */ + +out_err: + pr_err("an error(%d) on the writable branch %.*s(%s)\n", + err, AuDLNPair(h_root), au_sbtype(h_root->d_sb)); +out: + for (i = 0; i < AuBrWh_Last; i++) + dput(base[i].dentry); + return err; +} + +/* ---------------------------------------------------------------------- */ +/* + * whiteouts are all hard-linked usually. + * when its link count reaches a ceiling, we create a new whiteout base + * asynchronously. + */ + +struct reinit_br_wh { + struct super_block *sb; + struct au_branch *br; +}; + +static void reinit_br_wh(void *arg) +{ + int err; + aufs_bindex_t bindex; + struct path h_path; + struct reinit_br_wh *a = arg; + struct au_wbr *wbr; + struct inode *dir; + struct dentry *h_root; + struct au_hinode *hdir; + + err = 0; + wbr = a->br->br_wbr; + /* big aufs lock */ + si_noflush_write_lock(a->sb); + if (!au_br_writable(a->br->br_perm)) + goto out; + bindex = au_br_index(a->sb, a->br->br_id); + if (unlikely(bindex < 0)) + goto out; + + di_read_lock_parent(a->sb->s_root, AuLock_IR); + dir = a->sb->s_root->d_inode; + hdir = au_hi(dir, bindex); + h_root = au_h_dptr(a->sb->s_root, bindex); + AuDebugOn(h_root != au_br_dentry(a->br)); + + au_hn_imtx_lock_nested(hdir, AuLsc_I_PARENT); + wbr_wh_write_lock(wbr); + err = au_h_verify(wbr->wbr_whbase, au_opt_udba(a->sb), hdir->hi_inode, + h_root, a->br); + if (!err) { + h_path.dentry = wbr->wbr_whbase; + h_path.mnt = au_br_mnt(a->br); + err = vfsub_unlink(hdir->hi_inode, &h_path, /*force*/0); + } else { + pr_warn("%.*s is moved, ignored\n", + AuDLNPair(wbr->wbr_whbase)); + err = 0; + } + dput(wbr->wbr_whbase); + wbr->wbr_whbase = NULL; + if (!err) + err = au_wh_init(a->br, a->sb); + wbr_wh_write_unlock(wbr); + au_hn_imtx_unlock(hdir); + di_read_unlock(a->sb->s_root, AuLock_IR); + if (!err) + au_fhsm_wrote(a->sb, bindex, /*force*/0); + +out: + if (wbr) + atomic_dec(&wbr->wbr_wh_running); + atomic_dec(&a->br->br_count); + si_write_unlock(a->sb); + au_nwt_done(&au_sbi(a->sb)->si_nowait); + kfree(arg); + if (unlikely(err)) + AuIOErr("err %d\n", err); +} + +static void kick_reinit_br_wh(struct super_block *sb, struct au_branch *br) +{ + int do_dec, wkq_err; + struct reinit_br_wh *arg; + + do_dec = 1; + if (atomic_inc_return(&br->br_wbr->wbr_wh_running) != 1) + goto out; + + /* ignore ENOMEM */ + arg = kmalloc(sizeof(*arg), GFP_NOFS); + if (arg) { + /* + * dec(wh_running), kfree(arg) and dec(br_count) + * in reinit function + */ + arg->sb = sb; + arg->br = br; + atomic_inc(&br->br_count); + wkq_err = au_wkq_nowait(reinit_br_wh, arg, sb, /*flags*/0); + if (unlikely(wkq_err)) { + atomic_dec(&br->br_wbr->wbr_wh_running); + atomic_dec(&br->br_count); + kfree(arg); + } + do_dec = 0; + } + +out: + if (do_dec) + atomic_dec(&br->br_wbr->wbr_wh_running); +} + +/* ---------------------------------------------------------------------- */ + +/* + * create the whiteout @wh. + */ +static int link_or_create_wh(struct super_block *sb, aufs_bindex_t bindex, + struct dentry *wh) +{ + int err; + struct path h_path = { + .dentry = wh + }; + struct au_branch *br; + struct au_wbr *wbr; + struct dentry *h_parent; + struct inode *h_dir; + + h_parent = wh->d_parent; /* dir inode is locked */ + h_dir = h_parent->d_inode; + IMustLock(h_dir); + + br = au_sbr(sb, bindex); + h_path.mnt = au_br_mnt(br); + wbr = br->br_wbr; + wbr_wh_read_lock(wbr); + if (wbr->wbr_whbase) { + err = vfsub_link(wbr->wbr_whbase, h_dir, &h_path); + if (!err || err != -EMLINK) + goto out; + + /* link count full. re-initialize br_whbase. */ + kick_reinit_br_wh(sb, br); + } + + /* return this error in this context */ + err = vfsub_create(h_dir, &h_path, WH_MASK, /*want_excl*/true); + if (!err) + au_fhsm_wrote(sb, bindex, /*force*/0); + +out: + wbr_wh_read_unlock(wbr); + return err; +} + +/* ---------------------------------------------------------------------- */ + +/* + * create or remove the diropq. + */ +static struct dentry *do_diropq(struct dentry *dentry, aufs_bindex_t bindex, + unsigned int flags) +{ + struct dentry *opq_dentry, *h_dentry; + struct super_block *sb; + struct au_branch *br; + int err; + + sb = dentry->d_sb; + br = au_sbr(sb, bindex); + h_dentry = au_h_dptr(dentry, bindex); + opq_dentry = vfsub_lkup_one(&diropq_name, h_dentry); + if (IS_ERR(opq_dentry)) + goto out; + + if (au_ftest_diropq(flags, CREATE)) { + err = link_or_create_wh(sb, bindex, opq_dentry); + if (!err) { + au_set_dbdiropq(dentry, bindex); + goto out; /* success */ + } + } else { + struct path tmp = { + .dentry = opq_dentry, + .mnt = au_br_mnt(br) + }; + err = do_unlink_wh(au_h_iptr(dentry->d_inode, bindex), &tmp); + if (!err) + au_set_dbdiropq(dentry, -1); + } + dput(opq_dentry); + opq_dentry = ERR_PTR(err); + +out: + return opq_dentry; +} + +struct do_diropq_args { + struct dentry **errp; + struct dentry *dentry; + aufs_bindex_t bindex; + unsigned int flags; +}; + +static void call_do_diropq(void *args) +{ + struct do_diropq_args *a = args; + *a->errp = do_diropq(a->dentry, a->bindex, a->flags); +} + +struct dentry *au_diropq_sio(struct dentry *dentry, aufs_bindex_t bindex, + unsigned int flags) +{ + struct dentry *diropq, *h_dentry; + + h_dentry = au_h_dptr(dentry, bindex); + if (!au_test_h_perm_sio(h_dentry->d_inode, MAY_EXEC | MAY_WRITE)) + diropq = do_diropq(dentry, bindex, flags); + else { + int wkq_err; + struct do_diropq_args args = { + .errp = &diropq, + .dentry = dentry, + .bindex = bindex, + .flags = flags + }; + + wkq_err = au_wkq_wait(call_do_diropq, &args); + if (unlikely(wkq_err)) + diropq = ERR_PTR(wkq_err); + } + + return diropq; +} + +/* ---------------------------------------------------------------------- */ + +/* + * lookup whiteout dentry. + * @h_parent: lower parent dentry which must exist and be locked + * @base_name: name of dentry which will be whiteouted + * returns dentry for whiteout. + */ +struct dentry *au_wh_lkup(struct dentry *h_parent, struct qstr *base_name, + struct au_branch *br) +{ + int err; + struct qstr wh_name; + struct dentry *wh_dentry; + + err = au_wh_name_alloc(&wh_name, base_name); + wh_dentry = ERR_PTR(err); + if (!err) { + wh_dentry = vfsub_lkup_one(&wh_name, h_parent); + kfree(wh_name.name); + } + return wh_dentry; +} + +/* + * link/create a whiteout for @dentry on @bindex. + */ +struct dentry *au_wh_create(struct dentry *dentry, aufs_bindex_t bindex, + struct dentry *h_parent) +{ + struct dentry *wh_dentry; + struct super_block *sb; + int err; + + sb = dentry->d_sb; + wh_dentry = au_wh_lkup(h_parent, &dentry->d_name, au_sbr(sb, bindex)); + if (!IS_ERR(wh_dentry) && !wh_dentry->d_inode) { + err = link_or_create_wh(sb, bindex, wh_dentry); + if (!err) { + au_set_dbwh(dentry, bindex); + au_fhsm_wrote(sb, bindex, /*force*/0); + } else { + dput(wh_dentry); + wh_dentry = ERR_PTR(err); + } + } + + return wh_dentry; +} + +/* ---------------------------------------------------------------------- */ + +/* Delete all whiteouts in this directory on branch bindex. */ +static int del_wh_children(struct dentry *h_dentry, struct au_nhash *whlist, + aufs_bindex_t bindex, struct au_branch *br) +{ + int err; + unsigned long ul, n; + struct qstr wh_name; + char *p; + struct hlist_head *head; + struct au_vdir_wh *pos; + struct au_vdir_destr *str; + + err = -ENOMEM; + p = (void *)__get_free_page(GFP_NOFS); + wh_name.name = p; + if (unlikely(!wh_name.name)) + goto out; + + err = 0; + memcpy(p, AUFS_WH_PFX, AUFS_WH_PFX_LEN); + p += AUFS_WH_PFX_LEN; + n = whlist->nh_num; + head = whlist->nh_head; + for (ul = 0; !err && ul < n; ul++, head++) { + hlist_for_each_entry(pos, head, wh_hash) { + if (pos->wh_bindex != bindex) + continue; + + str = &pos->wh_str; + if (str->len + AUFS_WH_PFX_LEN <= PATH_MAX) { + memcpy(p, str->name, str->len); + wh_name.len = AUFS_WH_PFX_LEN + str->len; + err = unlink_wh_name(h_dentry, &wh_name, br); + if (!err) + continue; + break; + } + AuIOErr("whiteout name too long %.*s\n", + str->len, str->name); + err = -EIO; + break; + } + } + free_page((unsigned long)wh_name.name); + +out: + return err; +} + +struct del_wh_children_args { + int *errp; + struct dentry *h_dentry; + struct au_nhash *whlist; + aufs_bindex_t bindex; + struct au_branch *br; +}; + +static void call_del_wh_children(void *args) +{ + struct del_wh_children_args *a = args; + *a->errp = del_wh_children(a->h_dentry, a->whlist, a->bindex, a->br); +} + +/* ---------------------------------------------------------------------- */ + +struct au_whtmp_rmdir *au_whtmp_rmdir_alloc(struct super_block *sb, gfp_t gfp) +{ + struct au_whtmp_rmdir *whtmp; + int err; + unsigned int rdhash; + + SiMustAnyLock(sb); + + whtmp = kmalloc(sizeof(*whtmp), gfp); + if (unlikely(!whtmp)) { + whtmp = ERR_PTR(-ENOMEM); + goto out; + } + + whtmp->dir = NULL; + whtmp->br = NULL; + whtmp->wh_dentry = NULL; + /* no estimation for dir size */ + rdhash = au_sbi(sb)->si_rdhash; + if (!rdhash) + rdhash = AUFS_RDHASH_DEF; + err = au_nhash_alloc(&whtmp->whlist, rdhash, gfp); + if (unlikely(err)) { + kfree(whtmp); + whtmp = ERR_PTR(err); + } + +out: + return whtmp; +} + +void au_whtmp_rmdir_free(struct au_whtmp_rmdir *whtmp) +{ + if (whtmp->br) + atomic_dec(&whtmp->br->br_count); + dput(whtmp->wh_dentry); + iput(whtmp->dir); + au_nhash_wh_free(&whtmp->whlist); + kfree(whtmp); +} + +/* + * rmdir the whiteouted temporary named dir @h_dentry. + * @whlist: whiteouted children. + */ +int au_whtmp_rmdir(struct inode *dir, aufs_bindex_t bindex, + struct dentry *wh_dentry, struct au_nhash *whlist) +{ + int err; + struct path h_tmp; + struct inode *wh_inode, *h_dir; + struct au_branch *br; + + h_dir = wh_dentry->d_parent->d_inode; /* dir inode is locked */ + IMustLock(h_dir); + + br = au_sbr(dir->i_sb, bindex); + wh_inode = wh_dentry->d_inode; + mutex_lock_nested(&wh_inode->i_mutex, AuLsc_I_CHILD); + + /* + * someone else might change some whiteouts while we were sleeping. + * it means this whlist may have an obsoleted entry. + */ + if (!au_test_h_perm_sio(wh_inode, MAY_EXEC | MAY_WRITE)) + err = del_wh_children(wh_dentry, whlist, bindex, br); + else { + int wkq_err; + struct del_wh_children_args args = { + .errp = &err, + .h_dentry = wh_dentry, + .whlist = whlist, + .bindex = bindex, + .br = br + }; + + wkq_err = au_wkq_wait(call_del_wh_children, &args); + if (unlikely(wkq_err)) + err = wkq_err; + } + mutex_unlock(&wh_inode->i_mutex); + + if (!err) { + h_tmp.dentry = wh_dentry; + h_tmp.mnt = au_br_mnt(br); + err = vfsub_rmdir(h_dir, &h_tmp); + } + + if (!err) { + if (au_ibstart(dir) == bindex) { + /* todo: dir->i_mutex is necessary */ + au_cpup_attr_timesizes(dir); + vfsub_drop_nlink(dir); + } + return 0; /* success */ + } + + pr_warn("failed removing %.*s(%d), ignored\n", + AuDLNPair(wh_dentry), err); + return err; +} + +static void call_rmdir_whtmp(void *args) +{ + int err; + aufs_bindex_t bindex; + struct au_whtmp_rmdir *a = args; + struct super_block *sb; + struct dentry *h_parent; + struct inode *h_dir; + struct au_hinode *hdir; + + /* rmdir by nfsd may cause deadlock with this i_mutex */ + /* mutex_lock(&a->dir->i_mutex); */ + err = -EROFS; + sb = a->dir->i_sb; + si_read_lock(sb, !AuLock_FLUSH); + if (!au_br_writable(a->br->br_perm)) + goto out; + bindex = au_br_index(sb, a->br->br_id); + if (unlikely(bindex < 0)) + goto out; + + err = -EIO; + ii_write_lock_parent(a->dir); + h_parent = dget_parent(a->wh_dentry); + h_dir = h_parent->d_inode; + hdir = au_hi(a->dir, bindex); + err = vfsub_mnt_want_write(au_br_mnt(a->br)); + if (unlikely(err)) + goto out_mnt; + au_hn_imtx_lock_nested(hdir, AuLsc_I_PARENT); + err = au_h_verify(a->wh_dentry, au_opt_udba(sb), h_dir, h_parent, + a->br); + if (!err) + err = au_whtmp_rmdir(a->dir, bindex, a->wh_dentry, &a->whlist); + au_hn_imtx_unlock(hdir); + vfsub_mnt_drop_write(au_br_mnt(a->br)); + +out_mnt: + dput(h_parent); + ii_write_unlock(a->dir); +out: + /* mutex_unlock(&a->dir->i_mutex); */ + au_whtmp_rmdir_free(a); + si_read_unlock(sb); + au_nwt_done(&au_sbi(sb)->si_nowait); + if (unlikely(err)) + AuIOErr("err %d\n", err); +} + +void au_whtmp_kick_rmdir(struct inode *dir, aufs_bindex_t bindex, + struct dentry *wh_dentry, struct au_whtmp_rmdir *args) +{ + int wkq_err; + struct super_block *sb; + + IMustLock(dir); + + /* all post-process will be done in do_rmdir_whtmp(). */ + sb = dir->i_sb; + args->dir = au_igrab(dir); + args->br = au_sbr(sb, bindex); + atomic_inc(&args->br->br_count); + args->wh_dentry = dget(wh_dentry); + wkq_err = au_wkq_nowait(call_rmdir_whtmp, args, sb, /*flags*/0); + if (unlikely(wkq_err)) { + pr_warn("rmdir error %.*s (%d), ignored\n", + AuDLNPair(wh_dentry), wkq_err); + au_whtmp_rmdir_free(args); + } +} diff --git a/fs/aufs/whout.h b/fs/aufs/whout.h new file mode 100644 index 00000000000000..9c48bd833a23ef --- /dev/null +++ b/fs/aufs/whout.h @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * whiteout for logical deletion and opaque directory + */ + +#ifndef __AUFS_WHOUT_H__ +#define __AUFS_WHOUT_H__ + +#ifdef __KERNEL__ + +#include "dir.h" + +/* whout.c */ +int au_wh_name_alloc(struct qstr *wh, const struct qstr *name); +struct au_branch; +int au_wh_test(struct dentry *h_parent, struct qstr *wh_name, int try_sio); +int au_diropq_test(struct dentry *h_dentry); +struct dentry *au_whtmp_lkup(struct dentry *h_parent, struct au_branch *br, + struct qstr *prefix); +int au_whtmp_ren(struct dentry *h_dentry, struct au_branch *br); +int au_wh_unlink_dentry(struct inode *h_dir, struct path *h_path, + struct dentry *dentry); +int au_wh_init(struct au_branch *br, struct super_block *sb); + +/* diropq flags */ +#define AuDiropq_CREATE 1 +#define au_ftest_diropq(flags, name) ((flags) & AuDiropq_##name) +#define au_fset_diropq(flags, name) \ + do { (flags) |= AuDiropq_##name; } while (0) +#define au_fclr_diropq(flags, name) \ + do { (flags) &= ~AuDiropq_##name; } while (0) + +struct dentry *au_diropq_sio(struct dentry *dentry, aufs_bindex_t bindex, + unsigned int flags); +struct dentry *au_wh_lkup(struct dentry *h_parent, struct qstr *base_name, + struct au_branch *br); +struct dentry *au_wh_create(struct dentry *dentry, aufs_bindex_t bindex, + struct dentry *h_parent); + +/* real rmdir for the whiteout-ed dir */ +struct au_whtmp_rmdir { + struct inode *dir; + struct au_branch *br; + struct dentry *wh_dentry; + struct au_nhash whlist; +}; + +struct au_whtmp_rmdir *au_whtmp_rmdir_alloc(struct super_block *sb, gfp_t gfp); +void au_whtmp_rmdir_free(struct au_whtmp_rmdir *whtmp); +int au_whtmp_rmdir(struct inode *dir, aufs_bindex_t bindex, + struct dentry *wh_dentry, struct au_nhash *whlist); +void au_whtmp_kick_rmdir(struct inode *dir, aufs_bindex_t bindex, + struct dentry *wh_dentry, struct au_whtmp_rmdir *args); + +/* ---------------------------------------------------------------------- */ + +static inline struct dentry *au_diropq_create(struct dentry *dentry, + aufs_bindex_t bindex) +{ + return au_diropq_sio(dentry, bindex, AuDiropq_CREATE); +} + +static inline int au_diropq_remove(struct dentry *dentry, aufs_bindex_t bindex) +{ + return PTR_ERR(au_diropq_sio(dentry, bindex, !AuDiropq_CREATE)); +} + +#endif /* __KERNEL__ */ +#endif /* __AUFS_WHOUT_H__ */ diff --git a/fs/aufs/wkq.c b/fs/aufs/wkq.c new file mode 100644 index 00000000000000..558e69450ee8b8 --- /dev/null +++ b/fs/aufs/wkq.c @@ -0,0 +1,212 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * workqueue for asynchronous/super-io operations + * todo: try new dredential scheme + */ + +#include +#include "aufs.h" + +/* internal workqueue named AUFS_WKQ_NAME */ + +static struct workqueue_struct *au_wkq; + +struct au_wkinfo { + struct work_struct wk; + struct kobject *kobj; + + unsigned int flags; /* see wkq.h */ + + au_wkq_func_t func; + void *args; + + struct completion *comp; +}; + +/* ---------------------------------------------------------------------- */ + +static void wkq_func(struct work_struct *wk) +{ + struct au_wkinfo *wkinfo = container_of(wk, struct au_wkinfo, wk); + + AuDebugOn(!uid_eq(current_fsuid(), GLOBAL_ROOT_UID)); + AuDebugOn(rlimit(RLIMIT_FSIZE) != RLIM_INFINITY); + + wkinfo->func(wkinfo->args); + if (au_ftest_wkq(wkinfo->flags, WAIT)) + complete(wkinfo->comp); + else { + kobject_put(wkinfo->kobj); + module_put(THIS_MODULE); /* todo: ?? */ + kfree(wkinfo); + } +} + +/* + * Since struct completion is large, try allocating it dynamically. + */ +#if 1 /* defined(CONFIG_4KSTACKS) || defined(AuTest4KSTACKS) */ +#define AuWkqCompDeclare(name) struct completion *comp = NULL + +static int au_wkq_comp_alloc(struct au_wkinfo *wkinfo, struct completion **comp) +{ + *comp = kmalloc(sizeof(**comp), GFP_NOFS); + if (*comp) { + init_completion(*comp); + wkinfo->comp = *comp; + return 0; + } + return -ENOMEM; +} + +static void au_wkq_comp_free(struct completion *comp) +{ + kfree(comp); +} + +#else + +/* no braces */ +#define AuWkqCompDeclare(name) \ + DECLARE_COMPLETION_ONSTACK(_ ## name); \ + struct completion *comp = &_ ## name + +static int au_wkq_comp_alloc(struct au_wkinfo *wkinfo, struct completion **comp) +{ + wkinfo->comp = *comp; + return 0; +} + +static void au_wkq_comp_free(struct completion *comp __maybe_unused) +{ + /* empty */ +} +#endif /* 4KSTACKS */ + +static void au_wkq_run(struct au_wkinfo *wkinfo) +{ + if (au_ftest_wkq(wkinfo->flags, NEST)) { + if (au_wkq_test()) { + AuWarn1("wkq from wkq, due to a dead dir by UDBA?\n"); + AuDebugOn(au_ftest_wkq(wkinfo->flags, WAIT)); + } + } else + au_dbg_verify_kthread(); + + if (au_ftest_wkq(wkinfo->flags, WAIT)) { + INIT_WORK_ONSTACK(&wkinfo->wk, wkq_func); + queue_work(au_wkq, &wkinfo->wk); + } else { + INIT_WORK(&wkinfo->wk, wkq_func); + schedule_work(&wkinfo->wk); + } +} + +/* + * Be careful. It is easy to make deadlock happen. + * processA: lock, wkq and wait + * processB: wkq and wait, lock in wkq + * --> deadlock + */ +int au_wkq_do_wait(unsigned int flags, au_wkq_func_t func, void *args) +{ + int err; + AuWkqCompDeclare(comp); + struct au_wkinfo wkinfo = { + .flags = flags, + .func = func, + .args = args + }; + + err = au_wkq_comp_alloc(&wkinfo, &comp); + if (!err) { + au_wkq_run(&wkinfo); + /* no timeout, no interrupt */ + wait_for_completion(wkinfo.comp); + au_wkq_comp_free(comp); + destroy_work_on_stack(&wkinfo.wk); + } + + return err; + +} + +/* + * Note: dget/dput() in func for aufs dentries are not supported. It will be a + * problem in a concurrent umounting. + */ +int au_wkq_nowait(au_wkq_func_t func, void *args, struct super_block *sb, + unsigned int flags) +{ + int err; + struct au_wkinfo *wkinfo; + + atomic_inc(&au_sbi(sb)->si_nowait.nw_len); + + /* + * wkq_func() must free this wkinfo. + * it highly depends upon the implementation of workqueue. + */ + err = 0; + wkinfo = kmalloc(sizeof(*wkinfo), GFP_NOFS); + if (wkinfo) { + wkinfo->kobj = &au_sbi(sb)->si_kobj; + wkinfo->flags = flags & ~AuWkq_WAIT; + wkinfo->func = func; + wkinfo->args = args; + wkinfo->comp = NULL; + kobject_get(wkinfo->kobj); + __module_get(THIS_MODULE); /* todo: ?? */ + + au_wkq_run(wkinfo); + } else { + err = -ENOMEM; + au_nwt_done(&au_sbi(sb)->si_nowait); + } + + return err; +} + +/* ---------------------------------------------------------------------- */ + +void au_nwt_init(struct au_nowait_tasks *nwt) +{ + atomic_set(&nwt->nw_len, 0); + /* smp_mb(); */ /* atomic_set */ + init_waitqueue_head(&nwt->nw_wq); +} + +void au_wkq_fin(void) +{ + destroy_workqueue(au_wkq); +} + +int __init au_wkq_init(void) +{ + int err; + + err = 0; + au_wkq = alloc_workqueue(AUFS_WKQ_NAME, 0, WQ_DFL_ACTIVE); + if (IS_ERR(au_wkq)) + err = PTR_ERR(au_wkq); + else if (!au_wkq) + err = -ENOMEM; + + return err; +} diff --git a/fs/aufs/wkq.h b/fs/aufs/wkq.h new file mode 100644 index 00000000000000..f324e49fa93121 --- /dev/null +++ b/fs/aufs/wkq.h @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * workqueue for asynchronous/super-io operations + * todo: try new credentials management scheme + */ + +#ifndef __AUFS_WKQ_H__ +#define __AUFS_WKQ_H__ + +#ifdef __KERNEL__ + +struct super_block; + +/* ---------------------------------------------------------------------- */ + +/* + * in the next operation, wait for the 'nowait' tasks in system-wide workqueue + */ +struct au_nowait_tasks { + atomic_t nw_len; + wait_queue_head_t nw_wq; +}; + +/* ---------------------------------------------------------------------- */ + +typedef void (*au_wkq_func_t)(void *args); + +/* wkq flags */ +#define AuWkq_WAIT 1 +#define AuWkq_NEST (1 << 1) +#define au_ftest_wkq(flags, name) ((flags) & AuWkq_##name) +#define au_fset_wkq(flags, name) \ + do { (flags) |= AuWkq_##name; } while (0) +#define au_fclr_wkq(flags, name) \ + do { (flags) &= ~AuWkq_##name; } while (0) + +#ifndef CONFIG_AUFS_HNOTIFY +#undef AuWkq_NEST +#define AuWkq_NEST 0 +#endif + +/* wkq.c */ +int au_wkq_do_wait(unsigned int flags, au_wkq_func_t func, void *args); +int au_wkq_nowait(au_wkq_func_t func, void *args, struct super_block *sb, + unsigned int flags); +void au_nwt_init(struct au_nowait_tasks *nwt); +int __init au_wkq_init(void); +void au_wkq_fin(void); + +/* ---------------------------------------------------------------------- */ + +static inline int au_wkq_test(void) +{ + return current->flags & PF_WQ_WORKER; +} + +static inline int au_wkq_wait(au_wkq_func_t func, void *args) +{ + return au_wkq_do_wait(AuWkq_WAIT, func, args); +} + +static inline void au_nwt_done(struct au_nowait_tasks *nwt) +{ + if (atomic_dec_and_test(&nwt->nw_len)) + wake_up_all(&nwt->nw_wq); +} + +static inline int au_nwt_flush(struct au_nowait_tasks *nwt) +{ + wait_event(nwt->nw_wq, !atomic_read(&nwt->nw_len)); + return 0; +} + +#endif /* __KERNEL__ */ +#endif /* __AUFS_WKQ_H__ */ diff --git a/fs/aufs/xattr.c b/fs/aufs/xattr.c new file mode 100644 index 00000000000000..5bcde92dabed8e --- /dev/null +++ b/fs/aufs/xattr.c @@ -0,0 +1,437 @@ +/* + * Copyright (C) 2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * handling xattr functions + */ + +#include +#include "aufs.h" + +static int au_xattr_ignore(int err, char *name, unsigned int ignore_flags) +{ + if (!ignore_flags) + goto out; + switch (err) { + case -ENOMEM: + case -EDQUOT: + goto out; + } + + if ((ignore_flags & AuBrAttr_ICEX) == AuBrAttr_ICEX) { + err = 0; + goto out; + } + +#define cmp(brattr, prefix) do { \ + if (!strncmp(name, XATTR_##prefix##_PREFIX, \ + XATTR_##prefix##_PREFIX_LEN)) { \ + if (ignore_flags & AuBrAttr_ICEX_##brattr) \ + err = 0; \ + goto out; \ + } \ + } while (0) + + cmp(SEC, SECURITY); + cmp(SYS, SYSTEM); + cmp(TR, TRUSTED); + cmp(USR, USER); +#undef cmp + + if (ignore_flags & AuBrAttr_ICEX_OTH) + err = 0; + +out: + return err; +} + +static const int au_xattr_out_of_list = AuBrAttr_ICEX_OTH << 1; + +static int au_do_cpup_xattr(struct dentry *h_dst, struct dentry *h_src, + char *name, char **buf, unsigned int ignore_flags) +{ + int err; + ssize_t ssz; + struct inode *h_idst; + + ssz = vfs_getxattr_alloc(h_src, name, buf, 0, GFP_NOFS); + err = ssz; + if (unlikely(err <= 0)) { + AuTraceErr(err); + if (err == -ENODATA + || (err == -EOPNOTSUPP + && (ignore_flags & au_xattr_out_of_list))) + err = 0; + goto out; + } + + /* unlock it temporary */ + h_idst = h_dst->d_inode; + mutex_unlock(&h_idst->i_mutex); + err = vfsub_setxattr(h_dst, name, *buf, ssz, /*flags*/0); + mutex_lock_nested(&h_idst->i_mutex, AuLsc_I_CHILD2); + if (unlikely(err)) { + AuDbg("%s, err %d\n", name, err); + err = au_xattr_ignore(err, name, ignore_flags); + } + +out: + return err; +} + +int au_cpup_xattr(struct dentry *h_dst, struct dentry *h_src, int ignore_flags) +{ + int err, unlocked, acl_access, acl_default; + ssize_t ssz; + struct inode *h_isrc, *h_idst; + char *value, *p, *o, *e; + + /* try stopping to update the source inode while we are referencing */ + /* there should not be the parent-child relation ship between them */ + h_isrc = h_src->d_inode; + h_idst = h_dst->d_inode; + mutex_unlock(&h_idst->i_mutex); + mutex_lock_nested(&h_isrc->i_mutex, AuLsc_I_CHILD); + mutex_lock_nested(&h_idst->i_mutex, AuLsc_I_CHILD2); + unlocked = 0; + + /* some filesystems don't list POSIX ACL, for example tmpfs */ + ssz = vfs_listxattr(h_src, NULL, 0); + err = ssz; + if (unlikely(err < 0)) { + if (err == -ENODATA + || err == -EOPNOTSUPP) + err = 0; /* ignore */ + goto out; + } + + err = 0; + p = NULL; + o = NULL; + if (ssz) { + err = -ENOMEM; + p = kmalloc(ssz, GFP_NOFS); + o = p; + if (unlikely(!p)) + goto out; + err = vfs_listxattr(h_src, p, ssz); + } + mutex_unlock(&h_isrc->i_mutex); + unlocked = 1; + AuDbg("err %d, ssz %zd\n", err, ssz); + if (unlikely(err < 0)) + goto out_free; + + err = 0; + e = p + ssz; + value = NULL; + acl_access = 0; + acl_default = 0; + while (!err && p < e) { + acl_access |= !strncmp(p, XATTR_NAME_POSIX_ACL_ACCESS, + sizeof(XATTR_NAME_POSIX_ACL_ACCESS) - 1); + acl_default |= !strncmp(p, XATTR_NAME_POSIX_ACL_DEFAULT, + sizeof(XATTR_NAME_POSIX_ACL_DEFAULT) + - 1); + err = au_do_cpup_xattr(h_dst, h_src, p, &value, ignore_flags); + p += strlen(p) + 1; + } + AuTraceErr(err); + ignore_flags |= au_xattr_out_of_list; + if (!err && !acl_access) { + err = au_do_cpup_xattr(h_dst, h_src, + XATTR_NAME_POSIX_ACL_ACCESS, &value, + ignore_flags); + AuTraceErr(err); + } + if (!err && !acl_default) { + err = au_do_cpup_xattr(h_dst, h_src, + XATTR_NAME_POSIX_ACL_DEFAULT, &value, + ignore_flags); + AuTraceErr(err); + } + + kfree(value); + +out_free: + kfree(o); +out: + if (!unlocked) + mutex_unlock(&h_isrc->i_mutex); + AuTraceErr(err); + return err; +} + +/* ---------------------------------------------------------------------- */ + +enum { + AU_XATTR_LIST, + AU_XATTR_GET +}; + +struct au_lgxattr { + int type; + union { + struct { + char *list; + size_t size; + } list; + struct { + const char *name; + void *value; + size_t size; + } get; + } u; +}; + +static ssize_t au_lgxattr(struct dentry *dentry, struct au_lgxattr *arg) +{ + ssize_t err; + struct path h_path; + struct super_block *sb; + + sb = dentry->d_sb; + err = si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLM); + if (unlikely(err)) + goto out; + err = au_h_path_getattr(dentry, /*force*/1, &h_path); + if (unlikely(err)) + goto out_si; + if (unlikely(!h_path.dentry)) + /* illegally overlapped or something */ + goto out_di; /* pretending success */ + + /* always topmost entry only */ + switch (arg->type) { + case AU_XATTR_LIST: + err = vfs_listxattr(h_path.dentry, + arg->u.list.list, arg->u.list.size); + break; + case AU_XATTR_GET: + err = vfs_getxattr(h_path.dentry, + arg->u.get.name, arg->u.get.value, + arg->u.get.size); + break; + } + +out_di: + di_read_unlock(dentry, AuLock_IR); +out_si: + si_read_unlock(sb); +out: + AuTraceErr(err); + return err; +} + +ssize_t aufs_listxattr(struct dentry *dentry, char *list, size_t size) +{ + struct au_lgxattr arg = { + .type = AU_XATTR_LIST, + .u.list = { + .list = list, + .size = size + }, + }; + + return au_lgxattr(dentry, &arg); +} + +ssize_t aufs_getxattr(struct dentry *dentry, const char *name, void *value, + size_t size) +{ + struct au_lgxattr arg = { + .type = AU_XATTR_GET, + .u.get = { + .name = name, + .value = value, + .size = size + }, + }; + + return au_lgxattr(dentry, &arg); +} + +/* cf fs/aufs/i_op.c:aufs_setattr() */ +static int au_h_path_to_set_attr(struct dentry *dentry, + struct au_icpup_args *a, struct path *h_path) +{ + int err; + struct super_block *sb; + + sb = dentry->d_sb; + a->udba = au_opt_udba(sb); + /* no d_unlinked(), to set UDBA_NONE for root */ + if (d_unhashed(dentry)) + a->udba = AuOpt_UDBA_NONE; + if (a->udba != AuOpt_UDBA_NONE) { + AuDebugOn(IS_ROOT(dentry)); + err = au_reval_for_attr(dentry, au_sigen(sb)); + if (unlikely(err)) + goto out; + } + err = au_pin_and_icpup(dentry, /*ia*/NULL, a); + if (unlikely(err < 0)) + goto out; + + h_path->dentry = a->h_path.dentry; + h_path->mnt = au_sbr_mnt(sb, a->btgt); + +out: + return err; +} + +enum { + AU_XATTR_SET, + AU_XATTR_REMOVE +}; + +struct au_srxattr { + int type; + union { + struct { + const char *name; + const void *value; + size_t size; + int flags; + } set; + struct { + const char *name; + } remove; + } u; +}; + +static ssize_t au_srxattr(struct dentry *dentry, struct au_srxattr *arg) +{ + int err; + struct path h_path; + struct super_block *sb; + struct au_icpup_args *a; + struct inode *inode; + + inode = dentry->d_inode; + IMustLock(inode); + + err = -ENOMEM; + a = kzalloc(sizeof(*a), GFP_NOFS); + if (unlikely(!a)) + goto out; + + sb = dentry->d_sb; + err = si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLM); + if (unlikely(err)) + goto out_kfree; + + h_path.dentry = NULL; /* silence gcc */ + di_write_lock_child(dentry); + err = au_h_path_to_set_attr(dentry, a, &h_path); + if (unlikely(err)) + goto out_di; + + mutex_unlock(&a->h_inode->i_mutex); + switch (arg->type) { + case AU_XATTR_SET: + err = vfsub_setxattr(h_path.dentry, + arg->u.set.name, arg->u.set.value, + arg->u.set.size, arg->u.set.flags); + break; + case AU_XATTR_REMOVE: + err = vfsub_removexattr(h_path.dentry, arg->u.remove.name); + break; + } + if (!err) + au_cpup_attr_timesizes(inode); + + au_unpin(&a->pin); + if (unlikely(err)) + au_update_dbstart(dentry); + +out_di: + di_write_unlock(dentry); + si_read_unlock(sb); +out_kfree: + kfree(a); +out: + AuTraceErr(err); + return err; +} + +int aufs_setxattr(struct dentry *dentry, const char *name, const void *value, + size_t size, int flags) +{ + struct au_srxattr arg = { + .type = AU_XATTR_SET, + .u.set = { + .name = name, + .value = value, + .size = size, + .flags = flags + }, + }; + + return au_srxattr(dentry, &arg); +} + +int aufs_removexattr(struct dentry *dentry, const char *name) +{ + struct au_srxattr arg = { + .type = AU_XATTR_REMOVE, + .u.remove = { + .name = name + }, + }; + + return au_srxattr(dentry, &arg); +} + +/* ---------------------------------------------------------------------- */ + +#if 0 +static size_t au_xattr_list(struct dentry *dentry, char *list, size_t list_size, + const char *name, size_t name_len, int type) +{ + return aufs_listxattr(dentry, list, list_size); +} + +static int au_xattr_get(struct dentry *dentry, const char *name, void *buffer, + size_t size, int type) +{ + return aufs_getxattr(dentry, name, buffer, size); +} + +static int au_xattr_set(struct dentry *dentry, const char *name, + const void *value, size_t size, int flags, int type) +{ + return aufs_setxattr(dentry, name, value, size, flags); +} + +static const struct xattr_handler au_xattr_handler = { + /* no prefix, no flags */ + .list = au_xattr_list, + .get = au_xattr_get, + .set = au_xattr_set + /* why no remove? */ +}; + +static const struct xattr_handler *au_xattr_handlers[] = { + &au_xattr_handler +}; + +void au_xattr_init(struct super_block *sb) +{ + /* sb->s_xattr = au_xattr_handlers; */ +} +#endif diff --git a/fs/aufs/xino.c b/fs/aufs/xino.c new file mode 100644 index 00000000000000..49b7a76d7cec74 --- /dev/null +++ b/fs/aufs/xino.c @@ -0,0 +1,1309 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +/* + * external inode number translation table and bitmap + */ + +#include +#include +#include "aufs.h" + +/* todo: unnecessary to support mmap_sem since kernel-space? */ +ssize_t xino_fread(au_readf_t func, struct file *file, void *kbuf, size_t size, + loff_t *pos) +{ + ssize_t err; + mm_segment_t oldfs; + union { + void *k; + char __user *u; + } buf; + + buf.k = kbuf; + oldfs = get_fs(); + set_fs(KERNEL_DS); + do { + /* todo: signal_pending? */ + err = func(file, buf.u, size, pos); + } while (err == -EAGAIN || err == -EINTR); + set_fs(oldfs); + +#if 0 /* reserved for future use */ + if (err > 0) + fsnotify_access(file->f_dentry); +#endif + + return err; +} + +/* ---------------------------------------------------------------------- */ + +static ssize_t do_xino_fwrite(au_writef_t func, struct file *file, void *kbuf, + size_t size, loff_t *pos) +{ + ssize_t err; + mm_segment_t oldfs; + union { + void *k; + const char __user *u; + } buf; + + buf.k = kbuf; + oldfs = get_fs(); + set_fs(KERNEL_DS); + do { + /* todo: signal_pending? */ + err = func(file, buf.u, size, pos); + } while (err == -EAGAIN || err == -EINTR); + set_fs(oldfs); + +#if 0 /* reserved for future use */ + if (err > 0) + fsnotify_modify(file->f_dentry); +#endif + + return err; +} + +struct do_xino_fwrite_args { + ssize_t *errp; + au_writef_t func; + struct file *file; + void *buf; + size_t size; + loff_t *pos; +}; + +static void call_do_xino_fwrite(void *args) +{ + struct do_xino_fwrite_args *a = args; + *a->errp = do_xino_fwrite(a->func, a->file, a->buf, a->size, a->pos); +} + +ssize_t xino_fwrite(au_writef_t func, struct file *file, void *buf, size_t size, + loff_t *pos) +{ + ssize_t err; + + /* todo: signal block and no wkq? */ + if (rlimit(RLIMIT_FSIZE) == RLIM_INFINITY) { + lockdep_off(); + err = do_xino_fwrite(func, file, buf, size, pos); + lockdep_on(); + } else { + /* + * it breaks RLIMIT_FSIZE and normal user's limit, + * users should care about quota and real 'filesystem full.' + */ + int wkq_err; + struct do_xino_fwrite_args args = { + .errp = &err, + .func = func, + .file = file, + .buf = buf, + .size = size, + .pos = pos + }; + + wkq_err = au_wkq_wait(call_do_xino_fwrite, &args); + if (unlikely(wkq_err)) + err = wkq_err; + } + + return err; +} + +/* ---------------------------------------------------------------------- */ + +/* + * create a new xinofile at the same place/path as @base_file. + */ +struct file *au_xino_create2(struct file *base_file, struct file *copy_src) +{ + struct file *file; + struct dentry *base, *parent; + struct inode *dir; + struct qstr *name; + struct path path; + int err; + + base = base_file->f_dentry; + parent = base->d_parent; /* dir inode is locked */ + dir = parent->d_inode; + IMustLock(dir); + + file = ERR_PTR(-EINVAL); + name = &base->d_name; + path.dentry = vfsub_lookup_one_len(name->name, parent, name->len); + if (IS_ERR(path.dentry)) { + file = (void *)path.dentry; + pr_err("%.*s lookup err %ld\n", + AuLNPair(name), PTR_ERR(path.dentry)); + goto out; + } + + /* no need to mnt_want_write() since we call dentry_open() later */ + err = vfs_create(dir, path.dentry, S_IRUGO | S_IWUGO, NULL); + if (unlikely(err)) { + file = ERR_PTR(err); + pr_err("%.*s create err %d\n", AuLNPair(name), err); + goto out_dput; + } + + path.mnt = base_file->f_path.mnt; + file = vfsub_dentry_open(&path, + O_RDWR | O_CREAT | O_EXCL | O_LARGEFILE + /* | __FMODE_NONOTIFY */); + if (IS_ERR(file)) { + pr_err("%.*s open err %ld\n", AuLNPair(name), PTR_ERR(file)); + goto out_dput; + } + + err = vfsub_unlink(dir, &file->f_path, /*force*/0); + if (unlikely(err)) { + pr_err("%.*s unlink err %d\n", AuLNPair(name), err); + goto out_fput; + } + + if (copy_src) { + /* no one can touch copy_src xino */ + err = au_copy_file(file, copy_src, vfsub_f_size_read(copy_src)); + if (unlikely(err)) { + pr_err("%.*s copy err %d\n", AuLNPair(name), err); + goto out_fput; + } + } + goto out_dput; /* success */ + +out_fput: + fput(file); + file = ERR_PTR(err); +out_dput: + dput(path.dentry); +out: + return file; +} + +struct au_xino_lock_dir { + struct au_hinode *hdir; + struct dentry *parent; + struct mutex *mtx; +}; + +static void au_xino_lock_dir(struct super_block *sb, struct file *xino, + struct au_xino_lock_dir *ldir) +{ + aufs_bindex_t brid, bindex; + + ldir->hdir = NULL; + bindex = -1; + brid = au_xino_brid(sb); + if (brid >= 0) + bindex = au_br_index(sb, brid); + if (bindex >= 0) { + ldir->hdir = au_hi(sb->s_root->d_inode, bindex); + au_hn_imtx_lock_nested(ldir->hdir, AuLsc_I_PARENT); + } else { + ldir->parent = dget_parent(xino->f_dentry); + ldir->mtx = &ldir->parent->d_inode->i_mutex; + mutex_lock_nested(ldir->mtx, AuLsc_I_PARENT); + } +} + +static void au_xino_unlock_dir(struct au_xino_lock_dir *ldir) +{ + if (ldir->hdir) + au_hn_imtx_unlock(ldir->hdir); + else { + mutex_unlock(ldir->mtx); + dput(ldir->parent); + } +} + +/* ---------------------------------------------------------------------- */ + +/* trucate xino files asynchronously */ + +int au_xino_trunc(struct super_block *sb, aufs_bindex_t bindex) +{ + int err; + unsigned long jiffy; + blkcnt_t blocks; + aufs_bindex_t bi, bend; + struct kstatfs *st; + struct au_branch *br; + struct file *new_xino, *file; + struct super_block *h_sb; + struct au_xino_lock_dir ldir; + + err = -ENOMEM; + st = kzalloc(sizeof(*st), GFP_NOFS); + if (unlikely(!st)) + goto out; + + err = -EINVAL; + bend = au_sbend(sb); + if (unlikely(bindex < 0 || bend < bindex)) + goto out_st; + br = au_sbr(sb, bindex); + file = br->br_xino.xi_file; + if (!file) + goto out_st; + + err = vfs_statfs(&file->f_path, st); + if (unlikely(err)) + AuErr1("statfs err %d, ignored\n", err); + jiffy = jiffies; + blocks = file_inode(file)->i_blocks; + pr_info("begin truncating xino(b%d), ib%llu, %llu/%llu free blks\n", + bindex, (u64)blocks, st->f_bfree, st->f_blocks); + + au_xino_lock_dir(sb, file, &ldir); + /* mnt_want_write() is unnecessary here */ + new_xino = au_xino_create2(file, file); + au_xino_unlock_dir(&ldir); + err = PTR_ERR(new_xino); + if (IS_ERR(new_xino)) { + pr_err("err %d, ignored\n", err); + goto out_st; + } + err = 0; + fput(file); + br->br_xino.xi_file = new_xino; + + h_sb = au_br_sb(br); + for (bi = 0; bi <= bend; bi++) { + if (unlikely(bi == bindex)) + continue; + br = au_sbr(sb, bi); + if (au_br_sb(br) != h_sb) + continue; + + fput(br->br_xino.xi_file); + br->br_xino.xi_file = new_xino; + get_file(new_xino); + } + + err = vfs_statfs(&new_xino->f_path, st); + if (!err) { + pr_info("end truncating xino(b%d), ib%llu, %llu/%llu free blks\n", + bindex, (u64)file_inode(new_xino)->i_blocks, + st->f_bfree, st->f_blocks); + if (file_inode(new_xino)->i_blocks < blocks) + au_sbi(sb)->si_xino_jiffy = jiffy; + } else + AuErr1("statfs err %d, ignored\n", err); + +out_st: + kfree(st); +out: + return err; +} + +struct xino_do_trunc_args { + struct super_block *sb; + struct au_branch *br; +}; + +static void xino_do_trunc(void *_args) +{ + struct xino_do_trunc_args *args = _args; + struct super_block *sb; + struct au_branch *br; + struct inode *dir; + int err; + aufs_bindex_t bindex; + + err = 0; + sb = args->sb; + dir = sb->s_root->d_inode; + br = args->br; + + si_noflush_write_lock(sb); + ii_read_lock_parent(dir); + bindex = au_br_index(sb, br->br_id); + err = au_xino_trunc(sb, bindex); + ii_read_unlock(dir); + if (unlikely(err)) + pr_warn("err b%d, (%d)\n", bindex, err); + atomic_dec(&br->br_xino_running); + atomic_dec(&br->br_count); + si_write_unlock(sb); + au_nwt_done(&au_sbi(sb)->si_nowait); + kfree(args); +} + +static int xino_trunc_test(struct super_block *sb, struct au_branch *br) +{ + int err; + struct kstatfs st; + struct au_sbinfo *sbinfo; + + /* todo: si_xino_expire and the ratio should be customizable */ + sbinfo = au_sbi(sb); + if (time_before(jiffies, + sbinfo->si_xino_jiffy + sbinfo->si_xino_expire)) + return 0; + + /* truncation border */ + err = vfs_statfs(&br->br_xino.xi_file->f_path, &st); + if (unlikely(err)) { + AuErr1("statfs err %d, ignored\n", err); + return 0; + } + if (div64_u64(st.f_bfree * 100, st.f_blocks) >= AUFS_XINO_DEF_TRUNC) + return 0; + + return 1; +} + +static void xino_try_trunc(struct super_block *sb, struct au_branch *br) +{ + struct xino_do_trunc_args *args; + int wkq_err; + + if (!xino_trunc_test(sb, br)) + return; + + if (atomic_inc_return(&br->br_xino_running) > 1) + goto out; + + /* lock and kfree() will be called in trunc_xino() */ + args = kmalloc(sizeof(*args), GFP_NOFS); + if (unlikely(!args)) { + AuErr1("no memory\n"); + goto out_args; + } + + atomic_inc(&br->br_count); + args->sb = sb; + args->br = br; + wkq_err = au_wkq_nowait(xino_do_trunc, args, sb, /*flags*/0); + if (!wkq_err) + return; /* success */ + + pr_err("wkq %d\n", wkq_err); + atomic_dec(&br->br_count); + +out_args: + kfree(args); +out: + atomic_dec(&br->br_xino_running); +} + +/* ---------------------------------------------------------------------- */ + +static int au_xino_do_write(au_writef_t write, struct file *file, + ino_t h_ino, ino_t ino) +{ + loff_t pos; + ssize_t sz; + + pos = h_ino; + if (unlikely(au_loff_max / sizeof(ino) - 1 < pos)) { + AuIOErr1("too large hi%lu\n", (unsigned long)h_ino); + return -EFBIG; + } + pos *= sizeof(ino); + sz = xino_fwrite(write, file, &ino, sizeof(ino), &pos); + if (sz == sizeof(ino)) + return 0; /* success */ + + AuIOErr("write failed (%zd)\n", sz); + return -EIO; +} + +/* + * write @ino to the xinofile for the specified branch{@sb, @bindex} + * at the position of @h_ino. + * even if @ino is zero, it is written to the xinofile and means no entry. + * if the size of the xino file on a specific filesystem exceeds the watermark, + * try truncating it. + */ +int au_xino_write(struct super_block *sb, aufs_bindex_t bindex, ino_t h_ino, + ino_t ino) +{ + int err; + unsigned int mnt_flags; + struct au_branch *br; + + BUILD_BUG_ON(sizeof(long long) != sizeof(au_loff_max) + || ((loff_t)-1) > 0); + SiMustAnyLock(sb); + + mnt_flags = au_mntflags(sb); + if (!au_opt_test(mnt_flags, XINO)) + return 0; + + br = au_sbr(sb, bindex); + err = au_xino_do_write(au_sbi(sb)->si_xwrite, br->br_xino.xi_file, + h_ino, ino); + if (!err) { + if (au_opt_test(mnt_flags, TRUNC_XINO) + && au_test_fs_trunc_xino(au_br_sb(br))) + xino_try_trunc(sb, br); + return 0; /* success */ + } + + AuIOErr("write failed (%d)\n", err); + return -EIO; +} + +/* ---------------------------------------------------------------------- */ + +/* aufs inode number bitmap */ + +static const int page_bits = (int)PAGE_SIZE * BITS_PER_BYTE; +static ino_t xib_calc_ino(unsigned long pindex, int bit) +{ + ino_t ino; + + AuDebugOn(bit < 0 || page_bits <= bit); + ino = AUFS_FIRST_INO + pindex * page_bits + bit; + return ino; +} + +static void xib_calc_bit(ino_t ino, unsigned long *pindex, int *bit) +{ + AuDebugOn(ino < AUFS_FIRST_INO); + ino -= AUFS_FIRST_INO; + *pindex = ino / page_bits; + *bit = ino % page_bits; +} + +static int xib_pindex(struct super_block *sb, unsigned long pindex) +{ + int err; + loff_t pos; + ssize_t sz; + struct au_sbinfo *sbinfo; + struct file *xib; + unsigned long *p; + + sbinfo = au_sbi(sb); + MtxMustLock(&sbinfo->si_xib_mtx); + AuDebugOn(pindex > ULONG_MAX / PAGE_SIZE + || !au_opt_test(sbinfo->si_mntflags, XINO)); + + if (pindex == sbinfo->si_xib_last_pindex) + return 0; + + xib = sbinfo->si_xib; + p = sbinfo->si_xib_buf; + pos = sbinfo->si_xib_last_pindex; + pos *= PAGE_SIZE; + sz = xino_fwrite(sbinfo->si_xwrite, xib, p, PAGE_SIZE, &pos); + if (unlikely(sz != PAGE_SIZE)) + goto out; + + pos = pindex; + pos *= PAGE_SIZE; + if (vfsub_f_size_read(xib) >= pos + PAGE_SIZE) + sz = xino_fread(sbinfo->si_xread, xib, p, PAGE_SIZE, &pos); + else { + memset(p, 0, PAGE_SIZE); + sz = xino_fwrite(sbinfo->si_xwrite, xib, p, PAGE_SIZE, &pos); + } + if (sz == PAGE_SIZE) { + sbinfo->si_xib_last_pindex = pindex; + return 0; /* success */ + } + +out: + AuIOErr1("write failed (%zd)\n", sz); + err = sz; + if (sz >= 0) + err = -EIO; + return err; +} + +/* ---------------------------------------------------------------------- */ + +static void au_xib_clear_bit(struct inode *inode) +{ + int err, bit; + unsigned long pindex; + struct super_block *sb; + struct au_sbinfo *sbinfo; + + AuDebugOn(inode->i_nlink); + + sb = inode->i_sb; + xib_calc_bit(inode->i_ino, &pindex, &bit); + AuDebugOn(page_bits <= bit); + sbinfo = au_sbi(sb); + mutex_lock(&sbinfo->si_xib_mtx); + err = xib_pindex(sb, pindex); + if (!err) { + clear_bit(bit, sbinfo->si_xib_buf); + sbinfo->si_xib_next_bit = bit; + } + mutex_unlock(&sbinfo->si_xib_mtx); +} + +/* for s_op->delete_inode() */ +void au_xino_delete_inode(struct inode *inode, const int unlinked) +{ + int err; + unsigned int mnt_flags; + aufs_bindex_t bindex, bend, bi; + unsigned char try_trunc; + struct au_iinfo *iinfo; + struct super_block *sb; + struct au_hinode *hi; + struct inode *h_inode; + struct au_branch *br; + au_writef_t xwrite; + + sb = inode->i_sb; + mnt_flags = au_mntflags(sb); + if (!au_opt_test(mnt_flags, XINO) + || inode->i_ino == AUFS_ROOT_INO) + return; + + if (unlinked) { + au_xigen_inc(inode); + au_xib_clear_bit(inode); + } + + iinfo = au_ii(inode); + if (!iinfo) + return; + + bindex = iinfo->ii_bstart; + if (bindex < 0) + return; + + xwrite = au_sbi(sb)->si_xwrite; + try_trunc = !!au_opt_test(mnt_flags, TRUNC_XINO); + hi = iinfo->ii_hinode + bindex; + bend = iinfo->ii_bend; + for (; bindex <= bend; bindex++, hi++) { + h_inode = hi->hi_inode; + if (!h_inode + || (!unlinked && h_inode->i_nlink)) + continue; + + /* inode may not be revalidated */ + bi = au_br_index(sb, hi->hi_id); + if (bi < 0) + continue; + + br = au_sbr(sb, bi); + err = au_xino_do_write(xwrite, br->br_xino.xi_file, + h_inode->i_ino, /*ino*/0); + if (!err && try_trunc + && au_test_fs_trunc_xino(au_br_sb(br))) + xino_try_trunc(sb, br); + } +} + +/* get an unused inode number from bitmap */ +ino_t au_xino_new_ino(struct super_block *sb) +{ + ino_t ino; + unsigned long *p, pindex, ul, pend; + struct au_sbinfo *sbinfo; + struct file *file; + int free_bit, err; + + if (!au_opt_test(au_mntflags(sb), XINO)) + return iunique(sb, AUFS_FIRST_INO); + + sbinfo = au_sbi(sb); + mutex_lock(&sbinfo->si_xib_mtx); + p = sbinfo->si_xib_buf; + free_bit = sbinfo->si_xib_next_bit; + if (free_bit < page_bits && !test_bit(free_bit, p)) + goto out; /* success */ + free_bit = find_first_zero_bit(p, page_bits); + if (free_bit < page_bits) + goto out; /* success */ + + pindex = sbinfo->si_xib_last_pindex; + for (ul = pindex - 1; ul < ULONG_MAX; ul--) { + err = xib_pindex(sb, ul); + if (unlikely(err)) + goto out_err; + free_bit = find_first_zero_bit(p, page_bits); + if (free_bit < page_bits) + goto out; /* success */ + } + + file = sbinfo->si_xib; + pend = vfsub_f_size_read(file) / PAGE_SIZE; + for (ul = pindex + 1; ul <= pend; ul++) { + err = xib_pindex(sb, ul); + if (unlikely(err)) + goto out_err; + free_bit = find_first_zero_bit(p, page_bits); + if (free_bit < page_bits) + goto out; /* success */ + } + BUG(); + +out: + set_bit(free_bit, p); + sbinfo->si_xib_next_bit = free_bit + 1; + pindex = sbinfo->si_xib_last_pindex; + mutex_unlock(&sbinfo->si_xib_mtx); + ino = xib_calc_ino(pindex, free_bit); + AuDbg("i%lu\n", (unsigned long)ino); + return ino; +out_err: + mutex_unlock(&sbinfo->si_xib_mtx); + AuDbg("i0\n"); + return 0; +} + +/* + * read @ino from xinofile for the specified branch{@sb, @bindex} + * at the position of @h_ino. + * if @ino does not exist and @do_new is true, get new one. + */ +int au_xino_read(struct super_block *sb, aufs_bindex_t bindex, ino_t h_ino, + ino_t *ino) +{ + int err; + ssize_t sz; + loff_t pos; + struct file *file; + struct au_sbinfo *sbinfo; + + *ino = 0; + if (!au_opt_test(au_mntflags(sb), XINO)) + return 0; /* no xino */ + + err = 0; + sbinfo = au_sbi(sb); + pos = h_ino; + if (unlikely(au_loff_max / sizeof(*ino) - 1 < pos)) { + AuIOErr1("too large hi%lu\n", (unsigned long)h_ino); + return -EFBIG; + } + pos *= sizeof(*ino); + + file = au_sbr(sb, bindex)->br_xino.xi_file; + if (vfsub_f_size_read(file) < pos + sizeof(*ino)) + return 0; /* no ino */ + + sz = xino_fread(sbinfo->si_xread, file, ino, sizeof(*ino), &pos); + if (sz == sizeof(*ino)) + return 0; /* success */ + + err = sz; + if (unlikely(sz >= 0)) { + err = -EIO; + AuIOErr("xino read error (%zd)\n", sz); + } + + return err; +} + +/* ---------------------------------------------------------------------- */ + +/* create and set a new xino file */ + +struct file *au_xino_create(struct super_block *sb, char *fname, int silent) +{ + struct file *file; + struct dentry *h_parent, *d; + struct inode *h_dir; + int err; + + /* + * at mount-time, and the xino file is the default path, + * hnotify is disabled so we have no notify events to ignore. + * when a user specified the xino, we cannot get au_hdir to be ignored. + */ + file = vfsub_filp_open(fname, O_RDWR | O_CREAT | O_EXCL | O_LARGEFILE + /* | __FMODE_NONOTIFY */, + S_IRUGO | S_IWUGO); + if (IS_ERR(file)) { + if (!silent) + pr_err("open %s(%ld)\n", fname, PTR_ERR(file)); + return file; + } + + /* keep file count */ + h_parent = dget_parent(file->f_dentry); + h_dir = h_parent->d_inode; + mutex_lock_nested(&h_dir->i_mutex, AuLsc_I_PARENT); + /* mnt_want_write() is unnecessary here */ + err = vfsub_unlink(h_dir, &file->f_path, /*force*/0); + mutex_unlock(&h_dir->i_mutex); + dput(h_parent); + if (unlikely(err)) { + if (!silent) + pr_err("unlink %s(%d)\n", fname, err); + goto out; + } + + err = -EINVAL; + d = file->f_dentry; + if (unlikely(sb == d->d_sb)) { + if (!silent) + pr_err("%s must be outside\n", fname); + goto out; + } + if (unlikely(au_test_fs_bad_xino(d->d_sb))) { + if (!silent) + pr_err("xino doesn't support %s(%s)\n", + fname, au_sbtype(d->d_sb)); + goto out; + } + return file; /* success */ + +out: + fput(file); + file = ERR_PTR(err); + return file; +} + +/* + * find another branch who is on the same filesystem of the specified + * branch{@btgt}. search until @bend. + */ +static int is_sb_shared(struct super_block *sb, aufs_bindex_t btgt, + aufs_bindex_t bend) +{ + aufs_bindex_t bindex; + struct super_block *tgt_sb = au_sbr_sb(sb, btgt); + + for (bindex = 0; bindex < btgt; bindex++) + if (unlikely(tgt_sb == au_sbr_sb(sb, bindex))) + return bindex; + for (bindex++; bindex <= bend; bindex++) + if (unlikely(tgt_sb == au_sbr_sb(sb, bindex))) + return bindex; + return -1; +} + +/* ---------------------------------------------------------------------- */ + +/* + * initialize the xinofile for the specified branch @br + * at the place/path where @base_file indicates. + * test whether another branch is on the same filesystem or not, + * if @do_test is true. + */ +int au_xino_br(struct super_block *sb, struct au_branch *br, ino_t h_ino, + struct file *base_file, int do_test) +{ + int err; + ino_t ino; + aufs_bindex_t bend, bindex; + struct au_branch *shared_br, *b; + struct file *file; + struct super_block *tgt_sb; + + shared_br = NULL; + bend = au_sbend(sb); + if (do_test) { + tgt_sb = au_br_sb(br); + for (bindex = 0; bindex <= bend; bindex++) { + b = au_sbr(sb, bindex); + if (tgt_sb == au_br_sb(b)) { + shared_br = b; + break; + } + } + } + + if (!shared_br || !shared_br->br_xino.xi_file) { + struct au_xino_lock_dir ldir; + + au_xino_lock_dir(sb, base_file, &ldir); + /* mnt_want_write() is unnecessary here */ + file = au_xino_create2(base_file, NULL); + au_xino_unlock_dir(&ldir); + err = PTR_ERR(file); + if (IS_ERR(file)) + goto out; + br->br_xino.xi_file = file; + } else { + br->br_xino.xi_file = shared_br->br_xino.xi_file; + get_file(br->br_xino.xi_file); + } + + ino = AUFS_ROOT_INO; + err = au_xino_do_write(au_sbi(sb)->si_xwrite, br->br_xino.xi_file, + h_ino, ino); + if (unlikely(err)) { + fput(br->br_xino.xi_file); + br->br_xino.xi_file = NULL; + } + +out: + return err; +} + +/* ---------------------------------------------------------------------- */ + +/* trucate a xino bitmap file */ + +/* todo: slow */ +static int do_xib_restore(struct super_block *sb, struct file *file, void *page) +{ + int err, bit; + ssize_t sz; + unsigned long pindex; + loff_t pos, pend; + struct au_sbinfo *sbinfo; + au_readf_t func; + ino_t *ino; + unsigned long *p; + + err = 0; + sbinfo = au_sbi(sb); + MtxMustLock(&sbinfo->si_xib_mtx); + p = sbinfo->si_xib_buf; + func = sbinfo->si_xread; + pend = vfsub_f_size_read(file); + pos = 0; + while (pos < pend) { + sz = xino_fread(func, file, page, PAGE_SIZE, &pos); + err = sz; + if (unlikely(sz <= 0)) + goto out; + + err = 0; + for (ino = page; sz > 0; ino++, sz -= sizeof(ino)) { + if (unlikely(*ino < AUFS_FIRST_INO)) + continue; + + xib_calc_bit(*ino, &pindex, &bit); + AuDebugOn(page_bits <= bit); + err = xib_pindex(sb, pindex); + if (!err) + set_bit(bit, p); + else + goto out; + } + } + +out: + return err; +} + +static int xib_restore(struct super_block *sb) +{ + int err; + aufs_bindex_t bindex, bend; + void *page; + + err = -ENOMEM; + page = (void *)__get_free_page(GFP_NOFS); + if (unlikely(!page)) + goto out; + + err = 0; + bend = au_sbend(sb); + for (bindex = 0; !err && bindex <= bend; bindex++) + if (!bindex || is_sb_shared(sb, bindex, bindex - 1) < 0) + err = do_xib_restore + (sb, au_sbr(sb, bindex)->br_xino.xi_file, page); + else + AuDbg("b%d\n", bindex); + free_page((unsigned long)page); + +out: + return err; +} + +int au_xib_trunc(struct super_block *sb) +{ + int err; + ssize_t sz; + loff_t pos; + struct au_xino_lock_dir ldir; + struct au_sbinfo *sbinfo; + unsigned long *p; + struct file *file; + + SiMustWriteLock(sb); + + err = 0; + sbinfo = au_sbi(sb); + if (!au_opt_test(sbinfo->si_mntflags, XINO)) + goto out; + + file = sbinfo->si_xib; + if (vfsub_f_size_read(file) <= PAGE_SIZE) + goto out; + + au_xino_lock_dir(sb, file, &ldir); + /* mnt_want_write() is unnecessary here */ + file = au_xino_create2(sbinfo->si_xib, NULL); + au_xino_unlock_dir(&ldir); + err = PTR_ERR(file); + if (IS_ERR(file)) + goto out; + fput(sbinfo->si_xib); + sbinfo->si_xib = file; + + p = sbinfo->si_xib_buf; + memset(p, 0, PAGE_SIZE); + pos = 0; + sz = xino_fwrite(sbinfo->si_xwrite, sbinfo->si_xib, p, PAGE_SIZE, &pos); + if (unlikely(sz != PAGE_SIZE)) { + err = sz; + AuIOErr("err %d\n", err); + if (sz >= 0) + err = -EIO; + goto out; + } + + mutex_lock(&sbinfo->si_xib_mtx); + /* mnt_want_write() is unnecessary here */ + err = xib_restore(sb); + mutex_unlock(&sbinfo->si_xib_mtx); + +out: + return err; +} + +/* ---------------------------------------------------------------------- */ + +/* + * xino mount option handlers + */ +static au_readf_t find_readf(struct file *h_file) +{ + const struct file_operations *fop = h_file->f_op; + + if (fop) { + if (fop->read) + return fop->read; + if (fop->aio_read) + return do_sync_read; + } + return ERR_PTR(-ENOSYS); +} + +static au_writef_t find_writef(struct file *h_file) +{ + const struct file_operations *fop = h_file->f_op; + + if (fop) { + if (fop->write) + return fop->write; + if (fop->aio_write) + return do_sync_write; + } + return ERR_PTR(-ENOSYS); +} + +/* xino bitmap */ +static void xino_clear_xib(struct super_block *sb) +{ + struct au_sbinfo *sbinfo; + + SiMustWriteLock(sb); + + sbinfo = au_sbi(sb); + sbinfo->si_xread = NULL; + sbinfo->si_xwrite = NULL; + if (sbinfo->si_xib) + fput(sbinfo->si_xib); + sbinfo->si_xib = NULL; + free_page((unsigned long)sbinfo->si_xib_buf); + sbinfo->si_xib_buf = NULL; +} + +static int au_xino_set_xib(struct super_block *sb, struct file *base) +{ + int err; + loff_t pos; + struct au_sbinfo *sbinfo; + struct file *file; + + SiMustWriteLock(sb); + + sbinfo = au_sbi(sb); + file = au_xino_create2(base, sbinfo->si_xib); + err = PTR_ERR(file); + if (IS_ERR(file)) + goto out; + if (sbinfo->si_xib) + fput(sbinfo->si_xib); + sbinfo->si_xib = file; + sbinfo->si_xread = find_readf(file); + sbinfo->si_xwrite = find_writef(file); + + err = -ENOMEM; + if (!sbinfo->si_xib_buf) + sbinfo->si_xib_buf = (void *)get_zeroed_page(GFP_NOFS); + if (unlikely(!sbinfo->si_xib_buf)) + goto out_unset; + + sbinfo->si_xib_last_pindex = 0; + sbinfo->si_xib_next_bit = 0; + if (vfsub_f_size_read(file) < PAGE_SIZE) { + pos = 0; + err = xino_fwrite(sbinfo->si_xwrite, file, sbinfo->si_xib_buf, + PAGE_SIZE, &pos); + if (unlikely(err != PAGE_SIZE)) + goto out_free; + } + err = 0; + goto out; /* success */ + +out_free: + free_page((unsigned long)sbinfo->si_xib_buf); + sbinfo->si_xib_buf = NULL; + if (err >= 0) + err = -EIO; +out_unset: + fput(sbinfo->si_xib); + sbinfo->si_xib = NULL; + sbinfo->si_xread = NULL; + sbinfo->si_xwrite = NULL; +out: + return err; +} + +/* xino for each branch */ +static void xino_clear_br(struct super_block *sb) +{ + aufs_bindex_t bindex, bend; + struct au_branch *br; + + bend = au_sbend(sb); + for (bindex = 0; bindex <= bend; bindex++) { + br = au_sbr(sb, bindex); + if (!br || !br->br_xino.xi_file) + continue; + + fput(br->br_xino.xi_file); + br->br_xino.xi_file = NULL; + } +} + +static int au_xino_set_br(struct super_block *sb, struct file *base) +{ + int err; + ino_t ino; + aufs_bindex_t bindex, bend, bshared; + struct { + struct file *old, *new; + } *fpair, *p; + struct au_branch *br; + struct inode *inode; + au_writef_t writef; + + SiMustWriteLock(sb); + + err = -ENOMEM; + bend = au_sbend(sb); + fpair = kcalloc(bend + 1, sizeof(*fpair), GFP_NOFS); + if (unlikely(!fpair)) + goto out; + + inode = sb->s_root->d_inode; + ino = AUFS_ROOT_INO; + writef = au_sbi(sb)->si_xwrite; + for (bindex = 0, p = fpair; bindex <= bend; bindex++, p++) { + br = au_sbr(sb, bindex); + bshared = is_sb_shared(sb, bindex, bindex - 1); + if (bshared >= 0) { + /* shared xino */ + *p = fpair[bshared]; + get_file(p->new); + } + + if (!p->new) { + /* new xino */ + p->old = br->br_xino.xi_file; + p->new = au_xino_create2(base, br->br_xino.xi_file); + err = PTR_ERR(p->new); + if (IS_ERR(p->new)) { + p->new = NULL; + goto out_pair; + } + } + + err = au_xino_do_write(writef, p->new, + au_h_iptr(inode, bindex)->i_ino, ino); + if (unlikely(err)) + goto out_pair; + } + + for (bindex = 0, p = fpair; bindex <= bend; bindex++, p++) { + br = au_sbr(sb, bindex); + if (br->br_xino.xi_file) + fput(br->br_xino.xi_file); + get_file(p->new); + br->br_xino.xi_file = p->new; + } + +out_pair: + for (bindex = 0, p = fpair; bindex <= bend; bindex++, p++) + if (p->new) + fput(p->new); + else + break; + kfree(fpair); +out: + return err; +} + +void au_xino_clr(struct super_block *sb) +{ + struct au_sbinfo *sbinfo; + + au_xigen_clr(sb); + xino_clear_xib(sb); + xino_clear_br(sb); + sbinfo = au_sbi(sb); + /* lvalue, do not call au_mntflags() */ + au_opt_clr(sbinfo->si_mntflags, XINO); +} + +int au_xino_set(struct super_block *sb, struct au_opt_xino *xino, int remount) +{ + int err, skip; + struct dentry *parent, *cur_parent; + struct qstr *dname, *cur_name; + struct file *cur_xino; + struct inode *dir; + struct au_sbinfo *sbinfo; + + SiMustWriteLock(sb); + + err = 0; + sbinfo = au_sbi(sb); + parent = dget_parent(xino->file->f_dentry); + if (remount) { + skip = 0; + dname = &xino->file->f_dentry->d_name; + cur_xino = sbinfo->si_xib; + if (cur_xino) { + cur_parent = dget_parent(cur_xino->f_dentry); + cur_name = &cur_xino->f_dentry->d_name; + skip = (cur_parent == parent + && au_qstreq(dname, cur_name)); + dput(cur_parent); + } + if (skip) + goto out; + } + + au_opt_set(sbinfo->si_mntflags, XINO); + dir = parent->d_inode; + mutex_lock_nested(&dir->i_mutex, AuLsc_I_PARENT); + /* mnt_want_write() is unnecessary here */ + err = au_xino_set_xib(sb, xino->file); + if (!err) + err = au_xigen_set(sb, xino->file); + if (!err) + err = au_xino_set_br(sb, xino->file); + mutex_unlock(&dir->i_mutex); + if (!err) + goto out; /* success */ + + /* reset all */ + AuIOErr("failed creating xino(%d).\n", err); + +out: + dput(parent); + return err; +} + +/* ---------------------------------------------------------------------- */ + +/* + * create a xinofile at the default place/path. + */ +struct file *au_xino_def(struct super_block *sb) +{ + struct file *file; + char *page, *p; + struct au_branch *br; + struct super_block *h_sb; + struct path path; + aufs_bindex_t bend, bindex, bwr; + + br = NULL; + bend = au_sbend(sb); + bwr = -1; + for (bindex = 0; bindex <= bend; bindex++) { + br = au_sbr(sb, bindex); + if (au_br_writable(br->br_perm) + && !au_test_fs_bad_xino(au_br_sb(br))) { + bwr = bindex; + break; + } + } + + if (bwr >= 0) { + file = ERR_PTR(-ENOMEM); + page = (void *)__get_free_page(GFP_NOFS); + if (unlikely(!page)) + goto out; + path.mnt = au_br_mnt(br); + path.dentry = au_h_dptr(sb->s_root, bwr); + p = d_path(&path, page, PATH_MAX - sizeof(AUFS_XINO_FNAME)); + file = (void *)p; + if (!IS_ERR(p)) { + strcat(p, "/" AUFS_XINO_FNAME); + AuDbg("%s\n", p); + file = au_xino_create(sb, p, /*silent*/0); + if (!IS_ERR(file)) + au_xino_brid_set(sb, br->br_id); + } + free_page((unsigned long)page); + } else { + file = au_xino_create(sb, AUFS_XINO_DEFPATH, /*silent*/0); + if (IS_ERR(file)) + goto out; + h_sb = file->f_dentry->d_sb; + if (unlikely(au_test_fs_bad_xino(h_sb))) { + pr_err("xino doesn't support %s(%s)\n", + AUFS_XINO_DEFPATH, au_sbtype(h_sb)); + fput(file); + file = ERR_PTR(-EINVAL); + } + if (!IS_ERR(file)) + au_xino_brid_set(sb, -1); + } + +out: + return file; +} + +/* ---------------------------------------------------------------------- */ + +int au_xino_path(struct seq_file *seq, struct file *file) +{ + int err; + + err = au_seq_path(seq, &file->f_path); + if (unlikely(err < 0)) + goto out; + + err = 0; +#define Deleted "\\040(deleted)" + seq->count -= sizeof(Deleted) - 1; + AuDebugOn(memcmp(seq->buf + seq->count, Deleted, + sizeof(Deleted) - 1)); +#undef Deleted + +out: + return err; +} diff --git a/fs/buffer.c b/fs/buffer.c index 83fedaa53b55c0..8f474366a6820d 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -2399,7 +2399,7 @@ int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, * Update file times before taking page lock. We may end up failing the * fault so this update may be superfluous but who really cares... */ - file_update_time(vma->vm_file); + vma_file_update_time(vma); ret = __block_page_mkwrite(vma, vmf, get_block); sb_end_pagefault(sb); diff --git a/fs/inode.c b/fs/inode.c index 17f95b417955d3..5e217374f34417 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -56,6 +56,7 @@ static struct hlist_head *inode_hashtable __read_mostly; static __cacheline_aligned_in_smp DEFINE_SPINLOCK(inode_hash_lock); __cacheline_aligned_in_smp DEFINE_SPINLOCK(inode_sb_list_lock); +EXPORT_SYMBOL(inode_sb_list_lock); /* * Empty aops. Can be used for the cases where the user does not @@ -1498,7 +1499,7 @@ static int relatime_need_update(struct vfsmount *mnt, struct inode *inode, * This does the actual work of updating an inodes time or version. Must have * had called mnt_want_write() before calling this. */ -static int update_time(struct inode *inode, struct timespec *time, int flags) +int update_time(struct inode *inode, struct timespec *time, int flags) { if (inode->i_op->update_time) return inode->i_op->update_time(inode, time, flags); @@ -1514,6 +1515,7 @@ static int update_time(struct inode *inode, struct timespec *time, int flags) mark_inode_dirty_sync(inode); return 0; } +EXPORT_SYMBOL(update_time); /** * touch_atime - update the access time diff --git a/fs/namei.c b/fs/namei.c index 157c3dbacf6c55..7ec48544251685 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -221,7 +221,7 @@ void putname(struct filename *name) } #endif -static int check_acl(struct inode *inode, int mask) +int check_acl(struct inode *inode, int mask) { #ifdef CONFIG_FS_POSIX_ACL struct posix_acl *acl; @@ -266,6 +266,7 @@ static int check_acl(struct inode *inode, int mask) return -EAGAIN; } +EXPORT_SYMBOL(check_acl); /* * This does the basic permission checking diff --git a/fs/namespace.c b/fs/namespace.c index d0244c8ba09c8e..65b3c2087199b5 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -427,6 +427,7 @@ void __mnt_drop_write(struct vfsmount *mnt) mnt_dec_writers(real_mount(mnt)); preempt_enable(); } +EXPORT_SYMBOL_GPL(__mnt_drop_write); /** * mnt_drop_write - give up write access to a mount @@ -1474,6 +1475,7 @@ int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg, } return 0; } +EXPORT_SYMBOL(iterate_mounts); static void cleanup_group_ids(struct mount *mnt, struct mount *end) { diff --git a/fs/notify/group.c b/fs/notify/group.c index bd2625bd88b47a..2ff2a0fd5aea39 100644 --- a/fs/notify/group.c +++ b/fs/notify/group.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include "fsnotify.h" @@ -65,6 +66,7 @@ void fsnotify_get_group(struct fsnotify_group *group) { atomic_inc(&group->refcnt); } +EXPORT_SYMBOL(fsnotify_get_group); /* * Drop a reference to a group. Free it if it's through. @@ -74,6 +76,7 @@ void fsnotify_put_group(struct fsnotify_group *group) if (atomic_dec_and_test(&group->refcnt)) fsnotify_final_destroy_group(group); } +EXPORT_SYMBOL(fsnotify_put_group); /* * Create a new fsnotify_group and hold a reference for the group returned. @@ -102,6 +105,7 @@ struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops) return group; } +EXPORT_SYMBOL(fsnotify_alloc_group); int fsnotify_fasync(int fd, struct file *file, int on) { diff --git a/fs/notify/mark.c b/fs/notify/mark.c index f08b3b729d3dec..fb55964f8eb736 100644 --- a/fs/notify/mark.c +++ b/fs/notify/mark.c @@ -115,6 +115,7 @@ void fsnotify_put_mark(struct fsnotify_mark *mark) mark->free_mark(mark); } } +EXPORT_SYMBOL(fsnotify_put_mark); /* * Any time a mark is getting freed we end up here. @@ -197,6 +198,7 @@ void fsnotify_destroy_mark(struct fsnotify_mark *mark, fsnotify_destroy_mark_locked(mark, group); mutex_unlock(&group->mark_mutex); } +EXPORT_SYMBOL(fsnotify_destroy_mark); void fsnotify_set_mark_mask_locked(struct fsnotify_mark *mark, __u32 mask) { @@ -281,6 +283,7 @@ int fsnotify_add_mark_locked(struct fsnotify_mark *mark, return ret; } +EXPORT_SYMBOL(fsnotify_add_mark); int fsnotify_add_mark(struct fsnotify_mark *mark, struct fsnotify_group *group, struct inode *inode, struct vfsmount *mnt, int allow_dups) @@ -362,6 +365,7 @@ void fsnotify_init_mark(struct fsnotify_mark *mark, atomic_set(&mark->refcnt, 1); mark->free_mark = free_mark; } +EXPORT_SYMBOL(fsnotify_init_mark); static int fsnotify_mark_destroy(void *ignored) { diff --git a/fs/open.c b/fs/open.c index 5f129683b7d7eb..42ee52e03d953d 100644 --- a/fs/open.c +++ b/fs/open.c @@ -61,6 +61,7 @@ int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs, mutex_unlock(&dentry->d_inode->i_mutex); return ret; } +EXPORT_SYMBOL(do_truncate); long vfs_truncate(struct path *path, loff_t length) { @@ -278,6 +279,7 @@ int do_fallocate(struct file *file, int mode, loff_t offset, loff_t len) sb_end_write(inode->i_sb); return ret; } +EXPORT_SYMBOL(do_fallocate); SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len) { diff --git a/fs/proc/base.c b/fs/proc/base.c index fb8447f147650e..bae6736d25bb26 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -1835,7 +1835,7 @@ static int proc_map_files_get_link(struct dentry *dentry, struct path *path) down_read(&mm->mmap_sem); vma = find_exact_vma(mm, vm_start, vm_end); if (vma && vma->vm_file) { - *path = vma->vm_file->f_path; + *path = vma_pr_or_file(vma)->f_path; path_get(path); rc = 0; } diff --git a/fs/proc/nommu.c b/fs/proc/nommu.c index ccfd99bd1c5a62..1f584c3ee6f0d7 100644 --- a/fs/proc/nommu.c +++ b/fs/proc/nommu.c @@ -45,7 +45,10 @@ static int nommu_region_show(struct seq_file *m, struct vm_region *region) file = region->vm_file; if (file) { - struct inode *inode = file_inode(region->vm_file); + struct inode *inode; + + file = vmr_pr_or_file(region); + inode = file_inode(file); dev = inode->i_sb->s_dev; ino = inode->i_ino; } diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index e22d93eee4d2de..ec7abcf48fd7d6 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -321,7 +321,10 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid) const char *name = NULL; if (file) { - struct inode *inode = file_inode(vma->vm_file); + struct inode *inode; + + file = vma_pr_or_file(vma); + inode = file_inode(file); dev = inode->i_sb->s_dev; ino = inode->i_ino; pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT; @@ -1356,6 +1359,7 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid) seq_printf(m, "%08lx %s", vma->vm_start, buffer); if (file) { + file = vma_pr_or_file(vma); seq_printf(m, " file="); seq_path(m, &file->f_path, "\n\t= "); } else if (vma->vm_start <= mm->brk && vma->vm_end >= mm->start_brk) { diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c index 56123a6f462e7d..bf8498949d234e 100644 --- a/fs/proc/task_nommu.c +++ b/fs/proc/task_nommu.c @@ -149,7 +149,10 @@ static int nommu_vma_show(struct seq_file *m, struct vm_area_struct *vma, file = vma->vm_file; if (file) { - struct inode *inode = file_inode(vma->vm_file); + struct inode *inode; + + file = vma_pr_or_file(file); + inode = file_inode(file); dev = inode->i_sb->s_dev; ino = inode->i_ino; pgoff = (loff_t)vma->vm_pgoff << PAGE_SHIFT; diff --git a/fs/splice.c b/fs/splice.c index f183f1342c0127..5e951eac4bfb3f 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -1115,8 +1115,8 @@ EXPORT_SYMBOL(generic_splice_sendpage); /* * Attempt to initiate a splice from pipe to file. */ -static long do_splice_from(struct pipe_inode_info *pipe, struct file *out, - loff_t *ppos, size_t len, unsigned int flags) +long do_splice_from(struct pipe_inode_info *pipe, struct file *out, + loff_t *ppos, size_t len, unsigned int flags) { ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); @@ -1142,13 +1142,14 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out, file_end_write(out); return ret; } +EXPORT_SYMBOL(do_splice_from); /* * Attempt to initiate a splice from a file to a pipe. */ -static long do_splice_to(struct file *in, loff_t *ppos, - struct pipe_inode_info *pipe, size_t len, - unsigned int flags) +long do_splice_to(struct file *in, loff_t *ppos, + struct pipe_inode_info *pipe, size_t len, + unsigned int flags) { ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); @@ -1168,6 +1169,7 @@ static long do_splice_to(struct file *in, loff_t *ppos, return splice_read(in, ppos, pipe, len, flags); } +EXPORT_SYMBOL(do_splice_to); /** * splice_direct_to_actor - splices data directly between two non-pipes diff --git a/fs/xattr.c b/fs/xattr.c index 3377dff1840420..1de03c80b68ee4 100644 --- a/fs/xattr.c +++ b/fs/xattr.c @@ -207,6 +207,7 @@ vfs_getxattr_alloc(struct dentry *dentry, const char *name, char **xattr_value, *xattr_value = value; return error; } +EXPORT_SYMBOL(vfs_getxattr_alloc); /* Compare an extended attribute value with the given value */ int vfs_xattr_cmp(struct dentry *dentry, const char *xattr_name, diff --git a/include/linux/aufs_type.h b/include/linux/aufs_type.h new file mode 100644 index 00000000000000..7fea7f031b50e2 --- /dev/null +++ b/include/linux/aufs_type.h @@ -0,0 +1,418 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +#ifndef __AUFS_TYPE_H__ +#define __AUFS_TYPE_H__ + +#define AUFS_NAME "aufs" + +#ifdef __KERNEL__ +/* + * define it before including all other headers. + * sched.h may use pr_* macros before defining "current", so define the + * no-current version first, and re-define later. + */ +#define pr_fmt(fmt) AUFS_NAME " %s:%d: " fmt, __func__, __LINE__ +#include +#undef pr_fmt +#define pr_fmt(fmt) \ + AUFS_NAME " %s:%d:%.*s[%d]: " fmt, __func__, __LINE__, \ + (int)sizeof(current->comm), current->comm, current->pid +#else +#include +#include +#endif /* __KERNEL__ */ + +#include + +#define AUFS_VERSION "3.10.x-20141215" + +/* todo? move this to linux-2.6.19/include/magic.h */ +#define AUFS_SUPER_MAGIC ('a' << 24 | 'u' << 16 | 'f' << 8 | 's') + +/* ---------------------------------------------------------------------- */ + +#ifdef CONFIG_AUFS_BRANCH_MAX_127 +typedef int8_t aufs_bindex_t; +#define AUFS_BRANCH_MAX 127 +#else +typedef int16_t aufs_bindex_t; +#ifdef CONFIG_AUFS_BRANCH_MAX_511 +#define AUFS_BRANCH_MAX 511 +#elif defined(CONFIG_AUFS_BRANCH_MAX_1023) +#define AUFS_BRANCH_MAX 1023 +#elif defined(CONFIG_AUFS_BRANCH_MAX_32767) +#define AUFS_BRANCH_MAX 32767 +#endif +#endif + +#ifdef __KERNEL__ +#ifndef AUFS_BRANCH_MAX +#error unknown CONFIG_AUFS_BRANCH_MAX value +#endif +#endif /* __KERNEL__ */ + +/* ---------------------------------------------------------------------- */ + +#define AUFS_FSTYPE AUFS_NAME + +#define AUFS_ROOT_INO 2 +#define AUFS_FIRST_INO 11 + +#define AUFS_WH_PFX ".wh." +#define AUFS_WH_PFX_LEN ((int)sizeof(AUFS_WH_PFX) - 1) +#define AUFS_WH_TMP_LEN 4 +/* a limit for rmdir/rename a dir and copyup */ +#define AUFS_MAX_NAMELEN (NAME_MAX \ + - AUFS_WH_PFX_LEN * 2 /* doubly whiteouted */\ + - 1 /* dot */\ + - AUFS_WH_TMP_LEN) /* hex */ +#define AUFS_XINO_FNAME "." AUFS_NAME ".xino" +#define AUFS_XINO_DEFPATH "/tmp/" AUFS_XINO_FNAME +#define AUFS_XINO_DEF_SEC 30 /* seconds */ +#define AUFS_XINO_DEF_TRUNC 45 /* percentage */ +#define AUFS_DIRWH_DEF 3 +#define AUFS_RDCACHE_DEF 10 /* seconds */ +#define AUFS_RDCACHE_MAX 3600 /* seconds */ +#define AUFS_RDBLK_DEF 512 /* bytes */ +#define AUFS_RDHASH_DEF 32 +#define AUFS_WKQ_NAME AUFS_NAME "d" +#define AUFS_MFS_DEF_SEC 30 /* seconds */ +#define AUFS_MFS_MAX_SEC 3600 /* seconds */ +#define AUFS_FHSM_CACHE_DEF_SEC 30 /* seconds */ +#define AUFS_PLINK_WARN 50 /* number of plinks in a single bucket */ + +/* pseudo-link maintenace under /proc */ +#define AUFS_PLINK_MAINT_NAME "plink_maint" +#define AUFS_PLINK_MAINT_DIR "fs/" AUFS_NAME +#define AUFS_PLINK_MAINT_PATH AUFS_PLINK_MAINT_DIR "/" AUFS_PLINK_MAINT_NAME + +#define AUFS_DIROPQ_NAME AUFS_WH_PFX ".opq" /* whiteouted doubly */ +#define AUFS_WH_DIROPQ AUFS_WH_PFX AUFS_DIROPQ_NAME + +#define AUFS_BASE_NAME AUFS_WH_PFX AUFS_NAME +#define AUFS_PLINKDIR_NAME AUFS_WH_PFX "plnk" +#define AUFS_ORPHDIR_NAME AUFS_WH_PFX "orph" + +/* doubly whiteouted */ +#define AUFS_WH_BASE AUFS_WH_PFX AUFS_BASE_NAME +#define AUFS_WH_PLINKDIR AUFS_WH_PFX AUFS_PLINKDIR_NAME +#define AUFS_WH_ORPHDIR AUFS_WH_PFX AUFS_ORPHDIR_NAME + +/* branch permissions and attributes */ +#define AUFS_BRPERM_RW "rw" +#define AUFS_BRPERM_RO "ro" +#define AUFS_BRPERM_RR "rr" +#define AUFS_BRATTR_COO_REG "coo_reg" +#define AUFS_BRATTR_COO_ALL "coo_all" +#define AUFS_BRATTR_FHSM "fhsm" +#define AUFS_BRATTR_UNPIN "unpin" +#define AUFS_BRATTR_ICEX "icex" +#define AUFS_BRATTR_ICEX_SEC "icexsec" +#define AUFS_BRATTR_ICEX_SYS "icexsys" +#define AUFS_BRATTR_ICEX_TR "icextr" +#define AUFS_BRATTR_ICEX_USR "icexusr" +#define AUFS_BRATTR_ICEX_OTH "icexoth" +#define AUFS_BRRATTR_WH "wh" +#define AUFS_BRWATTR_NLWH "nolwh" +#define AUFS_BRWATTR_MOO "moo" + +#define AuBrPerm_RW 1 /* writable, hardlinkable wh */ +#define AuBrPerm_RO (1 << 1) /* readonly */ +#define AuBrPerm_RR (1 << 2) /* natively readonly */ +#define AuBrPerm_Mask (AuBrPerm_RW | AuBrPerm_RO | AuBrPerm_RR) + +#define AuBrAttr_COO_REG (1 << 3) /* copy-up on open */ +#define AuBrAttr_COO_ALL (1 << 4) +#define AuBrAttr_COO_Mask (AuBrAttr_COO_REG | AuBrAttr_COO_ALL) + +#define AuBrAttr_FHSM (1 << 5) /* file-based hsm */ +#define AuBrAttr_UNPIN (1 << 6) /* rename-able top dir of + branch */ + +/* ignore error in copying XATTR */ +#define AuBrAttr_ICEX_SEC (1 << 7) +#define AuBrAttr_ICEX_SYS (1 << 8) +#define AuBrAttr_ICEX_TR (1 << 9) +#define AuBrAttr_ICEX_USR (1 << 10) +#define AuBrAttr_ICEX_OTH (1 << 11) +#define AuBrAttr_ICEX (AuBrAttr_ICEX_SEC \ + | AuBrAttr_ICEX_SYS \ + | AuBrAttr_ICEX_TR \ + | AuBrAttr_ICEX_USR \ + | AuBrAttr_ICEX_OTH) + +#define AuBrRAttr_WH (1 << 12) /* whiteout-able */ +#define AuBrRAttr_Mask AuBrRAttr_WH + +#define AuBrWAttr_NoLinkWH (1 << 13) /* un-hardlinkable whiteouts */ +#define AuBrWAttr_MOO (1 << 14) /* move-up on open */ +#define AuBrWAttr_Mask (AuBrWAttr_NoLinkWH | AuBrWAttr_MOO) + +#define AuBrAttr_CMOO_Mask (AuBrAttr_COO_Mask | AuBrWAttr_MOO) + +/* #warning test userspace */ +#ifdef __KERNEL__ +#ifndef CONFIG_AUFS_FHSM +#undef AuBrAttr_FHSM +#define AuBrAttr_FHSM 0 +#endif +#ifndef CONFIG_AUFS_XATTR +#undef AuBrAttr_ICEX +#define AuBrAttr_ICEX 0 +#undef AuBrAttr_ICEX_SEC +#define AuBrAttr_ICEX_SEC 0 +#undef AuBrAttr_ICEX_SYS +#define AuBrAttr_ICEX_SYS 0 +#undef AuBrAttr_ICEX_TR +#define AuBrAttr_ICEX_TR 0 +#undef AuBrAttr_ICEX_USR +#define AuBrAttr_ICEX_USR 0 +#undef AuBrAttr_ICEX_OTH +#define AuBrAttr_ICEX_OTH 0 +#endif +#endif + +/* the longest combination */ +/* AUFS_BRATTR_ICEX and AUFS_BRATTR_ICEX_TR don't affect here */ +#define AuBrPermStrSz sizeof(AUFS_BRPERM_RW \ + "+" AUFS_BRATTR_COO_REG \ + "+" AUFS_BRATTR_FHSM \ + "+" AUFS_BRATTR_UNPIN \ + "+" AUFS_BRATTR_ICEX_SEC \ + "+" AUFS_BRATTR_ICEX_SYS \ + "+" AUFS_BRATTR_ICEX_USR \ + "+" AUFS_BRATTR_ICEX_OTH \ + "+" AUFS_BRWATTR_NLWH) + +typedef struct { + char a[AuBrPermStrSz]; +} au_br_perm_str_t; + +static inline int au_br_writable(int brperm) +{ + return brperm & AuBrPerm_RW; +} + +static inline int au_br_whable(int brperm) +{ + return brperm & (AuBrPerm_RW | AuBrRAttr_WH); +} + +static inline int au_br_wh_linkable(int brperm) +{ + return !(brperm & AuBrWAttr_NoLinkWH); +} + +static inline int au_br_cmoo(int brperm) +{ + return brperm & AuBrAttr_CMOO_Mask; +} + +static inline int au_br_fhsm(int brperm) +{ + return brperm & AuBrAttr_FHSM; +} + +/* ---------------------------------------------------------------------- */ + +/* ioctl */ +enum { + /* readdir in userspace */ + AuCtl_RDU, + AuCtl_RDU_INO, + + AuCtl_WBR_FD, /* pathconf wrapper */ + AuCtl_IBUSY, /* busy inode */ + AuCtl_MVDOWN, /* move-down */ + AuCtl_BR, /* info about branches */ + AuCtl_FHSM_FD /* connection for fhsm */ +}; + +/* borrowed from linux/include/linux/kernel.h */ +#ifndef ALIGN +#define ALIGN(x, a) __ALIGN_MASK(x, (typeof(x))(a)-1) +#define __ALIGN_MASK(x, mask) (((x)+(mask))&~(mask)) +#endif + +/* borrowed from linux/include/linux/compiler-gcc3.h */ +#ifndef __aligned +#define __aligned(x) __attribute__((aligned(x))) +#endif + +#ifdef __KERNEL__ +#ifndef __packed +#define __packed __attribute__((packed)) +#endif +#endif + +struct au_rdu_cookie { + uint64_t h_pos; + int16_t bindex; + uint8_t flags; + uint8_t pad; + uint32_t generation; +} __aligned(8); + +struct au_rdu_ent { + uint64_t ino; + int16_t bindex; + uint8_t type; + uint8_t nlen; + uint8_t wh; + char name[0]; +} __aligned(8); + +static inline int au_rdu_len(int nlen) +{ + /* include the terminating NULL */ + return ALIGN(sizeof(struct au_rdu_ent) + nlen + 1, + sizeof(uint64_t)); +} + +union au_rdu_ent_ul { + struct au_rdu_ent __user *e; + uint64_t ul; +}; + +enum { + AufsCtlRduV_SZ, + AufsCtlRduV_End +}; + +struct aufs_rdu { + /* input */ + union { + uint64_t sz; /* AuCtl_RDU */ + uint64_t nent; /* AuCtl_RDU_INO */ + }; + union au_rdu_ent_ul ent; + uint16_t verify[AufsCtlRduV_End]; + + /* input/output */ + uint32_t blk; + + /* output */ + union au_rdu_ent_ul tail; + /* number of entries which were added in a single call */ + uint64_t rent; + uint8_t full; + uint8_t shwh; + + struct au_rdu_cookie cookie; +} __aligned(8); + +/* ---------------------------------------------------------------------- */ + +struct aufs_wbr_fd { + uint32_t oflags; + int16_t brid; +} __aligned(8); + +/* ---------------------------------------------------------------------- */ + +struct aufs_ibusy { + uint64_t ino, h_ino; + int16_t bindex; +} __aligned(8); + +/* ---------------------------------------------------------------------- */ + +/* error code for move-down */ +/* the actual message strings are implemented in aufs-util.git */ +enum { + EAU_MVDOWN_OPAQUE = 1, + EAU_MVDOWN_WHITEOUT, + EAU_MVDOWN_UPPER, + EAU_MVDOWN_BOTTOM, + EAU_MVDOWN_NOUPPER, + EAU_MVDOWN_NOLOWERBR, + EAU_Last +}; + +/* flags for move-down */ +#define AUFS_MVDOWN_DMSG 1 +#define AUFS_MVDOWN_OWLOWER (1 << 1) /* overwrite lower */ +#define AUFS_MVDOWN_KUPPER (1 << 2) /* keep upper */ +#define AUFS_MVDOWN_ROLOWER (1 << 3) /* do even if lower is RO */ +#define AUFS_MVDOWN_ROLOWER_R (1 << 4) /* did on lower RO */ +#define AUFS_MVDOWN_ROUPPER (1 << 5) /* do even if upper is RO */ +#define AUFS_MVDOWN_ROUPPER_R (1 << 6) /* did on upper RO */ +#define AUFS_MVDOWN_BRID_UPPER (1 << 7) /* upper brid */ +#define AUFS_MVDOWN_BRID_LOWER (1 << 8) /* lower brid */ +#define AUFS_MVDOWN_FHSM_LOWER (1 << 9) /* find fhsm attr for lower */ +#define AUFS_MVDOWN_STFS (1 << 10) /* req. stfs */ +#define AUFS_MVDOWN_STFS_FAILED (1 << 11) /* output: stfs is unusable */ +#define AUFS_MVDOWN_BOTTOM (1 << 12) /* output: no more lowers */ + +/* index for move-down */ +enum { + AUFS_MVDOWN_UPPER, + AUFS_MVDOWN_LOWER, + AUFS_MVDOWN_NARRAY +}; + +/* + * additional info of move-down + * number of free blocks and inodes. + * subset of struct kstatfs, but smaller and always 64bit. + */ +struct aufs_stfs { + uint64_t f_blocks; + uint64_t f_bavail; + uint64_t f_files; + uint64_t f_ffree; +}; + +struct aufs_stbr { + int16_t brid; /* optional input */ + int16_t bindex; /* output */ + struct aufs_stfs stfs; /* output when AUFS_MVDOWN_STFS set */ +} __aligned(8); + +struct aufs_mvdown { + uint32_t flags; /* input/output */ + struct aufs_stbr stbr[AUFS_MVDOWN_NARRAY]; /* input/output */ + int8_t au_errno; /* output */ +} __aligned(8); + +/* ---------------------------------------------------------------------- */ + +union aufs_brinfo { + /* PATH_MAX may differ between kernel-space and user-space */ + char _spacer[4096]; + struct { + int16_t id; + int perm; + char path[0]; + }; +} __aligned(8); + +/* ---------------------------------------------------------------------- */ + +#define AuCtlType 'A' +#define AUFS_CTL_RDU _IOWR(AuCtlType, AuCtl_RDU, struct aufs_rdu) +#define AUFS_CTL_RDU_INO _IOWR(AuCtlType, AuCtl_RDU_INO, struct aufs_rdu) +#define AUFS_CTL_WBR_FD _IOW(AuCtlType, AuCtl_WBR_FD, \ + struct aufs_wbr_fd) +#define AUFS_CTL_IBUSY _IOWR(AuCtlType, AuCtl_IBUSY, struct aufs_ibusy) +#define AUFS_CTL_MVDOWN _IOWR(AuCtlType, AuCtl_MVDOWN, \ + struct aufs_mvdown) +#define AUFS_CTL_BRINFO _IOW(AuCtlType, AuCtl_BR, union aufs_brinfo) +#define AUFS_CTL_FHSM_FD _IOW(AuCtlType, AuCtl_FHSM_FD, int) + +#endif /* __AUFS_TYPE_H__ */ diff --git a/include/linux/fs.h b/include/linux/fs.h index 00b706ab412a7f..f379a440d13660 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2013,6 +2013,7 @@ extern struct file * dentry_open(const struct path *, int, const struct cred *); extern int filp_close(struct file *, fl_owner_t id); extern struct filename *getname(const char __user *); +int check_acl(struct inode *, int); enum { FILE_CREATED = 1, @@ -2579,6 +2580,7 @@ extern int inode_change_ok(const struct inode *, struct iattr *); extern int inode_newsize_ok(const struct inode *, loff_t offset); extern void setattr_copy(struct inode *inode, const struct iattr *attr); +extern int update_time(struct inode *, struct timespec *, int); extern int file_update_time(struct file *file); extern int generic_show_options(struct seq_file *m, struct dentry *root); diff --git a/include/linux/mm.h b/include/linux/mm.h index 05c2f69ce6b532..9ab650a532bcda 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1037,6 +1037,28 @@ static inline int fixup_user_fault(struct task_struct *tsk, } #endif +#ifdef CONFIG_MMU +extern void vma_do_file_update_time(struct vm_area_struct *, const char[], int); +extern struct file *vma_do_pr_or_file(struct vm_area_struct *, const char[], + int); +extern void vma_do_get_file(struct vm_area_struct *, const char[], int); +extern void vma_do_fput(struct vm_area_struct *, const char[], int); + +#define vma_file_update_time(vma) vma_do_file_update_time(vma, __func__, \ + __LINE__) +#define vma_pr_or_file(vma) vma_do_pr_or_file(vma, __func__, \ + __LINE__) +#define vma_get_file(vma) vma_do_get_file(vma, __func__, __LINE__) +#define vma_fput(vma) vma_do_fput(vma, __func__, __LINE__) +#else +extern struct file *vmr_do_pr_or_file(struct vm_region *, const char[], int); +extern void vmr_do_fput(struct vm_region *, const char[], int); + +#define vmr_pr_or_file(region) vmr_do_pr_or_file(region, __func__, \ + __LINE__) +#define vmr_fput(region) vmr_do_fput(region, __func__, __LINE__) +#endif /* CONFIG_MMU */ + extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); extern int access_remote_vm(struct mm_struct *mm, unsigned long addr, void *buf, int len, int write); diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 27e08cee8103ea..dcd1362cf99e1d 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -213,6 +213,7 @@ struct vm_region { unsigned long vm_top; /* region allocated to here */ unsigned long vm_pgoff; /* the offset in vm_file corresponding to vm_start */ struct file *vm_file; /* the backing file or NULL */ + struct file *vm_prfile; /* the virtual backing file or NULL */ int vm_usage; /* region usage count (access under nommu_region_sem) */ bool vm_icache_flushed : 1; /* true if the icache has been flushed for @@ -282,6 +283,7 @@ struct vm_area_struct { unsigned long vm_pgoff; /* Offset (within vm_file) in PAGE_SIZE units, *not* PAGE_CACHE_SIZE */ struct file * vm_file; /* File we map to (can be NULL). */ + struct file *vm_prfile; /* shadow of vm_file */ void * vm_private_data; /* was vm_pte (shared mem) */ #ifndef CONFIG_MMU diff --git a/include/linux/splice.h b/include/linux/splice.h index 74575cbf2d6f57..bfc6fb669d8ebd 100644 --- a/include/linux/splice.h +++ b/include/linux/splice.h @@ -92,4 +92,10 @@ extern void splice_shrink_spd(struct splice_pipe_desc *); extern void spd_release_page(struct splice_pipe_desc *, unsigned int); extern const struct pipe_buf_operations page_cache_pipe_buf_ops; + +extern long do_splice_from(struct pipe_inode_info *pipe, struct file *out, + loff_t *ppos, size_t len, unsigned int flags); +extern long do_splice_to(struct file *in, loff_t *ppos, + struct pipe_inode_info *pipe, size_t len, + unsigned int flags); #endif diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild index bdc6e87ff3eb37..349600cd815fe0 100644 --- a/include/uapi/linux/Kbuild +++ b/include/uapi/linux/Kbuild @@ -56,6 +56,7 @@ header-y += atmppp.h header-y += atmsap.h header-y += atmsvc.h header-y += audit.h +header-y += aufs_type.h header-y += auto_fs.h header-y += auto_fs4.h header-y += auxvec.h diff --git a/include/uapi/linux/aufs_type.h b/include/uapi/linux/aufs_type.h new file mode 100644 index 00000000000000..7fea7f031b50e2 --- /dev/null +++ b/include/uapi/linux/aufs_type.h @@ -0,0 +1,418 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * + * This program, aufs 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, see . + */ + +#ifndef __AUFS_TYPE_H__ +#define __AUFS_TYPE_H__ + +#define AUFS_NAME "aufs" + +#ifdef __KERNEL__ +/* + * define it before including all other headers. + * sched.h may use pr_* macros before defining "current", so define the + * no-current version first, and re-define later. + */ +#define pr_fmt(fmt) AUFS_NAME " %s:%d: " fmt, __func__, __LINE__ +#include +#undef pr_fmt +#define pr_fmt(fmt) \ + AUFS_NAME " %s:%d:%.*s[%d]: " fmt, __func__, __LINE__, \ + (int)sizeof(current->comm), current->comm, current->pid +#else +#include +#include +#endif /* __KERNEL__ */ + +#include + +#define AUFS_VERSION "3.10.x-20141215" + +/* todo? move this to linux-2.6.19/include/magic.h */ +#define AUFS_SUPER_MAGIC ('a' << 24 | 'u' << 16 | 'f' << 8 | 's') + +/* ---------------------------------------------------------------------- */ + +#ifdef CONFIG_AUFS_BRANCH_MAX_127 +typedef int8_t aufs_bindex_t; +#define AUFS_BRANCH_MAX 127 +#else +typedef int16_t aufs_bindex_t; +#ifdef CONFIG_AUFS_BRANCH_MAX_511 +#define AUFS_BRANCH_MAX 511 +#elif defined(CONFIG_AUFS_BRANCH_MAX_1023) +#define AUFS_BRANCH_MAX 1023 +#elif defined(CONFIG_AUFS_BRANCH_MAX_32767) +#define AUFS_BRANCH_MAX 32767 +#endif +#endif + +#ifdef __KERNEL__ +#ifndef AUFS_BRANCH_MAX +#error unknown CONFIG_AUFS_BRANCH_MAX value +#endif +#endif /* __KERNEL__ */ + +/* ---------------------------------------------------------------------- */ + +#define AUFS_FSTYPE AUFS_NAME + +#define AUFS_ROOT_INO 2 +#define AUFS_FIRST_INO 11 + +#define AUFS_WH_PFX ".wh." +#define AUFS_WH_PFX_LEN ((int)sizeof(AUFS_WH_PFX) - 1) +#define AUFS_WH_TMP_LEN 4 +/* a limit for rmdir/rename a dir and copyup */ +#define AUFS_MAX_NAMELEN (NAME_MAX \ + - AUFS_WH_PFX_LEN * 2 /* doubly whiteouted */\ + - 1 /* dot */\ + - AUFS_WH_TMP_LEN) /* hex */ +#define AUFS_XINO_FNAME "." AUFS_NAME ".xino" +#define AUFS_XINO_DEFPATH "/tmp/" AUFS_XINO_FNAME +#define AUFS_XINO_DEF_SEC 30 /* seconds */ +#define AUFS_XINO_DEF_TRUNC 45 /* percentage */ +#define AUFS_DIRWH_DEF 3 +#define AUFS_RDCACHE_DEF 10 /* seconds */ +#define AUFS_RDCACHE_MAX 3600 /* seconds */ +#define AUFS_RDBLK_DEF 512 /* bytes */ +#define AUFS_RDHASH_DEF 32 +#define AUFS_WKQ_NAME AUFS_NAME "d" +#define AUFS_MFS_DEF_SEC 30 /* seconds */ +#define AUFS_MFS_MAX_SEC 3600 /* seconds */ +#define AUFS_FHSM_CACHE_DEF_SEC 30 /* seconds */ +#define AUFS_PLINK_WARN 50 /* number of plinks in a single bucket */ + +/* pseudo-link maintenace under /proc */ +#define AUFS_PLINK_MAINT_NAME "plink_maint" +#define AUFS_PLINK_MAINT_DIR "fs/" AUFS_NAME +#define AUFS_PLINK_MAINT_PATH AUFS_PLINK_MAINT_DIR "/" AUFS_PLINK_MAINT_NAME + +#define AUFS_DIROPQ_NAME AUFS_WH_PFX ".opq" /* whiteouted doubly */ +#define AUFS_WH_DIROPQ AUFS_WH_PFX AUFS_DIROPQ_NAME + +#define AUFS_BASE_NAME AUFS_WH_PFX AUFS_NAME +#define AUFS_PLINKDIR_NAME AUFS_WH_PFX "plnk" +#define AUFS_ORPHDIR_NAME AUFS_WH_PFX "orph" + +/* doubly whiteouted */ +#define AUFS_WH_BASE AUFS_WH_PFX AUFS_BASE_NAME +#define AUFS_WH_PLINKDIR AUFS_WH_PFX AUFS_PLINKDIR_NAME +#define AUFS_WH_ORPHDIR AUFS_WH_PFX AUFS_ORPHDIR_NAME + +/* branch permissions and attributes */ +#define AUFS_BRPERM_RW "rw" +#define AUFS_BRPERM_RO "ro" +#define AUFS_BRPERM_RR "rr" +#define AUFS_BRATTR_COO_REG "coo_reg" +#define AUFS_BRATTR_COO_ALL "coo_all" +#define AUFS_BRATTR_FHSM "fhsm" +#define AUFS_BRATTR_UNPIN "unpin" +#define AUFS_BRATTR_ICEX "icex" +#define AUFS_BRATTR_ICEX_SEC "icexsec" +#define AUFS_BRATTR_ICEX_SYS "icexsys" +#define AUFS_BRATTR_ICEX_TR "icextr" +#define AUFS_BRATTR_ICEX_USR "icexusr" +#define AUFS_BRATTR_ICEX_OTH "icexoth" +#define AUFS_BRRATTR_WH "wh" +#define AUFS_BRWATTR_NLWH "nolwh" +#define AUFS_BRWATTR_MOO "moo" + +#define AuBrPerm_RW 1 /* writable, hardlinkable wh */ +#define AuBrPerm_RO (1 << 1) /* readonly */ +#define AuBrPerm_RR (1 << 2) /* natively readonly */ +#define AuBrPerm_Mask (AuBrPerm_RW | AuBrPerm_RO | AuBrPerm_RR) + +#define AuBrAttr_COO_REG (1 << 3) /* copy-up on open */ +#define AuBrAttr_COO_ALL (1 << 4) +#define AuBrAttr_COO_Mask (AuBrAttr_COO_REG | AuBrAttr_COO_ALL) + +#define AuBrAttr_FHSM (1 << 5) /* file-based hsm */ +#define AuBrAttr_UNPIN (1 << 6) /* rename-able top dir of + branch */ + +/* ignore error in copying XATTR */ +#define AuBrAttr_ICEX_SEC (1 << 7) +#define AuBrAttr_ICEX_SYS (1 << 8) +#define AuBrAttr_ICEX_TR (1 << 9) +#define AuBrAttr_ICEX_USR (1 << 10) +#define AuBrAttr_ICEX_OTH (1 << 11) +#define AuBrAttr_ICEX (AuBrAttr_ICEX_SEC \ + | AuBrAttr_ICEX_SYS \ + | AuBrAttr_ICEX_TR \ + | AuBrAttr_ICEX_USR \ + | AuBrAttr_ICEX_OTH) + +#define AuBrRAttr_WH (1 << 12) /* whiteout-able */ +#define AuBrRAttr_Mask AuBrRAttr_WH + +#define AuBrWAttr_NoLinkWH (1 << 13) /* un-hardlinkable whiteouts */ +#define AuBrWAttr_MOO (1 << 14) /* move-up on open */ +#define AuBrWAttr_Mask (AuBrWAttr_NoLinkWH | AuBrWAttr_MOO) + +#define AuBrAttr_CMOO_Mask (AuBrAttr_COO_Mask | AuBrWAttr_MOO) + +/* #warning test userspace */ +#ifdef __KERNEL__ +#ifndef CONFIG_AUFS_FHSM +#undef AuBrAttr_FHSM +#define AuBrAttr_FHSM 0 +#endif +#ifndef CONFIG_AUFS_XATTR +#undef AuBrAttr_ICEX +#define AuBrAttr_ICEX 0 +#undef AuBrAttr_ICEX_SEC +#define AuBrAttr_ICEX_SEC 0 +#undef AuBrAttr_ICEX_SYS +#define AuBrAttr_ICEX_SYS 0 +#undef AuBrAttr_ICEX_TR +#define AuBrAttr_ICEX_TR 0 +#undef AuBrAttr_ICEX_USR +#define AuBrAttr_ICEX_USR 0 +#undef AuBrAttr_ICEX_OTH +#define AuBrAttr_ICEX_OTH 0 +#endif +#endif + +/* the longest combination */ +/* AUFS_BRATTR_ICEX and AUFS_BRATTR_ICEX_TR don't affect here */ +#define AuBrPermStrSz sizeof(AUFS_BRPERM_RW \ + "+" AUFS_BRATTR_COO_REG \ + "+" AUFS_BRATTR_FHSM \ + "+" AUFS_BRATTR_UNPIN \ + "+" AUFS_BRATTR_ICEX_SEC \ + "+" AUFS_BRATTR_ICEX_SYS \ + "+" AUFS_BRATTR_ICEX_USR \ + "+" AUFS_BRATTR_ICEX_OTH \ + "+" AUFS_BRWATTR_NLWH) + +typedef struct { + char a[AuBrPermStrSz]; +} au_br_perm_str_t; + +static inline int au_br_writable(int brperm) +{ + return brperm & AuBrPerm_RW; +} + +static inline int au_br_whable(int brperm) +{ + return brperm & (AuBrPerm_RW | AuBrRAttr_WH); +} + +static inline int au_br_wh_linkable(int brperm) +{ + return !(brperm & AuBrWAttr_NoLinkWH); +} + +static inline int au_br_cmoo(int brperm) +{ + return brperm & AuBrAttr_CMOO_Mask; +} + +static inline int au_br_fhsm(int brperm) +{ + return brperm & AuBrAttr_FHSM; +} + +/* ---------------------------------------------------------------------- */ + +/* ioctl */ +enum { + /* readdir in userspace */ + AuCtl_RDU, + AuCtl_RDU_INO, + + AuCtl_WBR_FD, /* pathconf wrapper */ + AuCtl_IBUSY, /* busy inode */ + AuCtl_MVDOWN, /* move-down */ + AuCtl_BR, /* info about branches */ + AuCtl_FHSM_FD /* connection for fhsm */ +}; + +/* borrowed from linux/include/linux/kernel.h */ +#ifndef ALIGN +#define ALIGN(x, a) __ALIGN_MASK(x, (typeof(x))(a)-1) +#define __ALIGN_MASK(x, mask) (((x)+(mask))&~(mask)) +#endif + +/* borrowed from linux/include/linux/compiler-gcc3.h */ +#ifndef __aligned +#define __aligned(x) __attribute__((aligned(x))) +#endif + +#ifdef __KERNEL__ +#ifndef __packed +#define __packed __attribute__((packed)) +#endif +#endif + +struct au_rdu_cookie { + uint64_t h_pos; + int16_t bindex; + uint8_t flags; + uint8_t pad; + uint32_t generation; +} __aligned(8); + +struct au_rdu_ent { + uint64_t ino; + int16_t bindex; + uint8_t type; + uint8_t nlen; + uint8_t wh; + char name[0]; +} __aligned(8); + +static inline int au_rdu_len(int nlen) +{ + /* include the terminating NULL */ + return ALIGN(sizeof(struct au_rdu_ent) + nlen + 1, + sizeof(uint64_t)); +} + +union au_rdu_ent_ul { + struct au_rdu_ent __user *e; + uint64_t ul; +}; + +enum { + AufsCtlRduV_SZ, + AufsCtlRduV_End +}; + +struct aufs_rdu { + /* input */ + union { + uint64_t sz; /* AuCtl_RDU */ + uint64_t nent; /* AuCtl_RDU_INO */ + }; + union au_rdu_ent_ul ent; + uint16_t verify[AufsCtlRduV_End]; + + /* input/output */ + uint32_t blk; + + /* output */ + union au_rdu_ent_ul tail; + /* number of entries which were added in a single call */ + uint64_t rent; + uint8_t full; + uint8_t shwh; + + struct au_rdu_cookie cookie; +} __aligned(8); + +/* ---------------------------------------------------------------------- */ + +struct aufs_wbr_fd { + uint32_t oflags; + int16_t brid; +} __aligned(8); + +/* ---------------------------------------------------------------------- */ + +struct aufs_ibusy { + uint64_t ino, h_ino; + int16_t bindex; +} __aligned(8); + +/* ---------------------------------------------------------------------- */ + +/* error code for move-down */ +/* the actual message strings are implemented in aufs-util.git */ +enum { + EAU_MVDOWN_OPAQUE = 1, + EAU_MVDOWN_WHITEOUT, + EAU_MVDOWN_UPPER, + EAU_MVDOWN_BOTTOM, + EAU_MVDOWN_NOUPPER, + EAU_MVDOWN_NOLOWERBR, + EAU_Last +}; + +/* flags for move-down */ +#define AUFS_MVDOWN_DMSG 1 +#define AUFS_MVDOWN_OWLOWER (1 << 1) /* overwrite lower */ +#define AUFS_MVDOWN_KUPPER (1 << 2) /* keep upper */ +#define AUFS_MVDOWN_ROLOWER (1 << 3) /* do even if lower is RO */ +#define AUFS_MVDOWN_ROLOWER_R (1 << 4) /* did on lower RO */ +#define AUFS_MVDOWN_ROUPPER (1 << 5) /* do even if upper is RO */ +#define AUFS_MVDOWN_ROUPPER_R (1 << 6) /* did on upper RO */ +#define AUFS_MVDOWN_BRID_UPPER (1 << 7) /* upper brid */ +#define AUFS_MVDOWN_BRID_LOWER (1 << 8) /* lower brid */ +#define AUFS_MVDOWN_FHSM_LOWER (1 << 9) /* find fhsm attr for lower */ +#define AUFS_MVDOWN_STFS (1 << 10) /* req. stfs */ +#define AUFS_MVDOWN_STFS_FAILED (1 << 11) /* output: stfs is unusable */ +#define AUFS_MVDOWN_BOTTOM (1 << 12) /* output: no more lowers */ + +/* index for move-down */ +enum { + AUFS_MVDOWN_UPPER, + AUFS_MVDOWN_LOWER, + AUFS_MVDOWN_NARRAY +}; + +/* + * additional info of move-down + * number of free blocks and inodes. + * subset of struct kstatfs, but smaller and always 64bit. + */ +struct aufs_stfs { + uint64_t f_blocks; + uint64_t f_bavail; + uint64_t f_files; + uint64_t f_ffree; +}; + +struct aufs_stbr { + int16_t brid; /* optional input */ + int16_t bindex; /* output */ + struct aufs_stfs stfs; /* output when AUFS_MVDOWN_STFS set */ +} __aligned(8); + +struct aufs_mvdown { + uint32_t flags; /* input/output */ + struct aufs_stbr stbr[AUFS_MVDOWN_NARRAY]; /* input/output */ + int8_t au_errno; /* output */ +} __aligned(8); + +/* ---------------------------------------------------------------------- */ + +union aufs_brinfo { + /* PATH_MAX may differ between kernel-space and user-space */ + char _spacer[4096]; + struct { + int16_t id; + int perm; + char path[0]; + }; +} __aligned(8); + +/* ---------------------------------------------------------------------- */ + +#define AuCtlType 'A' +#define AUFS_CTL_RDU _IOWR(AuCtlType, AuCtl_RDU, struct aufs_rdu) +#define AUFS_CTL_RDU_INO _IOWR(AuCtlType, AuCtl_RDU_INO, struct aufs_rdu) +#define AUFS_CTL_WBR_FD _IOW(AuCtlType, AuCtl_WBR_FD, \ + struct aufs_wbr_fd) +#define AUFS_CTL_IBUSY _IOWR(AuCtlType, AuCtl_IBUSY, struct aufs_ibusy) +#define AUFS_CTL_MVDOWN _IOWR(AuCtlType, AuCtl_MVDOWN, \ + struct aufs_mvdown) +#define AUFS_CTL_BRINFO _IOW(AuCtlType, AuCtl_BR, union aufs_brinfo) +#define AUFS_CTL_FHSM_FD _IOW(AuCtlType, AuCtl_FHSM_FD, int) + +#endif /* __AUFS_TYPE_H__ */ diff --git a/kernel/fork.c b/kernel/fork.c index 86f865997783e7..4a12cd5dfb4616 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -433,7 +433,7 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm) struct inode *inode = file_inode(file); struct address_space *mapping = file->f_mapping; - get_file(file); + vma_get_file(tmp); if (tmp->vm_flags & VM_DENYWRITE) atomic_dec(&inode->i_writecount); mutex_lock(&mapping->i_mmap_mutex); diff --git a/mm/Makefile b/mm/Makefile index 72c5acb9345fdd..c7e0d59dea3153 100644 --- a/mm/Makefile +++ b/mm/Makefile @@ -17,7 +17,7 @@ obj-y := filemap.o mempool.o oom_kill.o fadvise.o \ util.o mmzone.o vmstat.o backing-dev.o \ mm_init.o mmu_context.o percpu.o slab_common.o \ compaction.o balloon_compaction.o \ - interval_tree.o $(mmu-y) + interval_tree.o prfile.o $(mmu-y) obj-y += init-mm.o diff --git a/mm/filemap.c b/mm/filemap.c index 7905fe721aa8ab..94cc777e8cb788 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -1733,7 +1733,7 @@ int filemap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) int ret = VM_FAULT_LOCKED; sb_start_pagefault(inode->i_sb); - file_update_time(vma->vm_file); + vma_file_update_time(vma); lock_page(page); if (page->mapping != inode->i_mapping) { unlock_page(page); diff --git a/mm/fremap.c b/mm/fremap.c index 1fb6bfe39d8cd5..d96a92e49b530d 100644 --- a/mm/fremap.c +++ b/mm/fremap.c @@ -202,16 +202,28 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, */ if (mapping_cap_account_dirty(mapping)) { unsigned long addr; - struct file *file = get_file(vma->vm_file); + struct file *file = vma->vm_file, + *prfile = vma->vm_prfile; + /* mmap_region may free vma; grab the info now */ vm_flags = vma->vm_flags; + vma_get_file(vma); addr = mmap_region(file, start, size, vm_flags, pgoff); - fput(file); + vma_fput(vma); if (IS_ERR_VALUE(addr)) { err = addr; } else { BUG_ON(addr != start); + if (prfile) { + struct vm_area_struct *new_vma; + + new_vma = find_vma(mm, addr); + if (!new_vma->vm_prfile) + new_vma->vm_prfile = prfile; + if (new_vma != vma) + get_file(prfile); + } err = 0; } goto out_freed; diff --git a/mm/madvise.c b/mm/madvise.c index 85d1a5427c27fa..06599cb942fc4a 100644 --- a/mm/madvise.c +++ b/mm/madvise.c @@ -328,12 +328,12 @@ static long madvise_remove(struct vm_area_struct *vma, * vma's reference to the file) can go away as soon as we drop * mmap_sem. */ - get_file(f); + vma_get_file(vma); up_read(¤t->mm->mmap_sem); error = do_fallocate(f, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, offset, end - start); - fput(f); + vma_fput(vma); down_read(¤t->mm->mmap_sem); return error; } diff --git a/mm/memory.c b/mm/memory.c index 30bf9cce8c2b04..fa86bbb7704c3f 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -2759,7 +2759,7 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, set_page_dirty_balance(dirty_page, page_mkwrite); /* file_update_time outside page_lock */ if (vma->vm_file) - file_update_time(vma->vm_file); + vma_file_update_time(vma); } put_page(dirty_page); if (page_mkwrite) { @@ -3470,7 +3470,7 @@ static int __do_fault(struct mm_struct *mm, struct vm_area_struct *vma, /* file_update_time outside page_lock */ if (vma->vm_file && !page_mkwrite) - file_update_time(vma->vm_file); + vma_file_update_time(vma); } else { unlock_page(vmf.page); if (anon) diff --git a/mm/mmap.c b/mm/mmap.c index 84a1c44242a8a8..e20402d3a94804 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -250,7 +250,7 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma) if (vma->vm_ops && vma->vm_ops->close) vma->vm_ops->close(vma); if (vma->vm_file) - fput(vma->vm_file); + vma_fput(vma); mpol_put(vma_policy(vma)); kmem_cache_free(vm_area_cachep, vma); return next; @@ -860,7 +860,7 @@ again: remove_next = 1 + (end > next->vm_end); if (remove_next) { if (file) { uprobe_munmap(next, next->vm_start, next->vm_end); - fput(file); + vma_fput(vma); } if (next->anon_vma) anon_vma_merge(vma, next); @@ -1626,8 +1626,8 @@ unsigned long mmap_region(struct file *file, unsigned long addr, unmap_and_free_vma: if (correct_wcount) atomic_inc(&inode->i_writecount); + vma_fput(vma); vma->vm_file = NULL; - fput(file); /* Undo any partial mapping done by a device driver. */ unmap_region(mm, vma, prev, vma->vm_start, vma->vm_end); @@ -2451,7 +2451,7 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma, goto out_free_mpol; if (new->vm_file) - get_file(new->vm_file); + vma_get_file(new); if (new->vm_ops && new->vm_ops->open) new->vm_ops->open(new); @@ -2470,7 +2470,7 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma, if (new->vm_ops && new->vm_ops->close) new->vm_ops->close(new); if (new->vm_file) - fput(new->vm_file); + vma_fput(new); unlink_anon_vmas(new); out_free_mpol: mpol_put(pol); @@ -2870,7 +2870,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, if (anon_vma_clone(new_vma, vma)) goto out_free_mempol; if (new_vma->vm_file) - get_file(new_vma->vm_file); + vma_get_file(new_vma); if (new_vma->vm_ops && new_vma->vm_ops->open) new_vma->vm_ops->open(new_vma); vma_link(mm, new_vma, prev, rb_link, rb_parent); diff --git a/mm/msync.c b/mm/msync.c index 632df4527c0122..02d770eb9fc741 100644 --- a/mm/msync.c +++ b/mm/msync.c @@ -80,10 +80,10 @@ SYSCALL_DEFINE3(msync, unsigned long, start, size_t, len, int, flags) start = vma->vm_end; if ((flags & MS_SYNC) && file && (vma->vm_flags & VM_SHARED)) { - get_file(file); + vma_get_file(vma); up_read(&mm->mmap_sem); error = vfs_fsync(file, 0); - fput(file); + vma_fput(vma); if (error || start >= end) goto out; down_read(&mm->mmap_sem); diff --git a/mm/nommu.c b/mm/nommu.c index d9d07a5d2318ad..b51894cb7b8050 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -650,7 +650,7 @@ static void __put_nommu_region(struct vm_region *region) up_write(&nommu_region_sem); if (region->vm_file) - fput(region->vm_file); + vmr_fput(region); /* IO memory and memory shared directly out of the pagecache * from ramfs/tmpfs mustn't be released here */ @@ -808,7 +808,7 @@ static void delete_vma(struct mm_struct *mm, struct vm_area_struct *vma) if (vma->vm_ops && vma->vm_ops->close) vma->vm_ops->close(vma); if (vma->vm_file) - fput(vma->vm_file); + vma_fput(vma); put_nommu_region(vma->vm_region); kmem_cache_free(vm_area_cachep, vma); } @@ -1374,7 +1374,7 @@ unsigned long do_mmap_pgoff(struct file *file, goto error_just_free; } } - fput(region->vm_file); + vmr_fput(region); kmem_cache_free(vm_region_jar, region); region = pregion; result = start; @@ -1450,10 +1450,10 @@ unsigned long do_mmap_pgoff(struct file *file, up_write(&nommu_region_sem); error: if (region->vm_file) - fput(region->vm_file); + vmr_fput(region); kmem_cache_free(vm_region_jar, region); if (vma->vm_file) - fput(vma->vm_file); + vma_fput(vma); kmem_cache_free(vm_area_cachep, vma); kleave(" = %d", ret); return ret; diff --git a/mm/prfile.c b/mm/prfile.c new file mode 100644 index 00000000000000..fc708d2622dfbb --- /dev/null +++ b/mm/prfile.c @@ -0,0 +1,86 @@ +/* + * Mainly for aufs which mmap(2) diffrent file and wants to print different path + * in /proc/PID/maps. + * Call these functions via macros defined in linux/mm.h. + * + * See Documentation/filesystems/aufs/design/06mmap.txt + * + * Copyright (c) 2014 Junjro R. Okajima + * Copyright (c) 2014 Ian Campbell + */ + +#include +#include +#include + +/* #define PRFILE_TRACE */ +static inline void prfile_trace(struct file *f, struct file *pr, + const char func[], int line, const char func2[]) +{ +#ifdef PRFILE_TRACE + if (pr) + pr_info("%s:%d: %s, %p\n", func, line, func2, + f ? (char *)f->f_dentry->d_name.name : "(null)"); +#endif +} + +#ifdef CONFIG_MMU +void vma_do_file_update_time(struct vm_area_struct *vma, const char func[], + int line) +{ + struct file *f = vma->vm_file, *pr = vma->vm_prfile; + + prfile_trace(f, pr, func, line, __func__); + file_update_time(f); + if (f && pr) + file_update_time(pr); +} + +struct file *vma_do_pr_or_file(struct vm_area_struct *vma, const char func[], + int line) +{ + struct file *f = vma->vm_file, *pr = vma->vm_prfile; + + prfile_trace(f, pr, func, line, __func__); + return (f && pr) ? pr : f; +} + +void vma_do_get_file(struct vm_area_struct *vma, const char func[], int line) +{ + struct file *f = vma->vm_file, *pr = vma->vm_prfile; + + prfile_trace(f, pr, func, line, __func__); + get_file(f); + if (f && pr) + get_file(pr); +} + +void vma_do_fput(struct vm_area_struct *vma, const char func[], int line) +{ + struct file *f = vma->vm_file, *pr = vma->vm_prfile; + + prfile_trace(f, pr, func, line, __func__); + fput(f); + if (f && pr) + fput(pr); +} +#else +struct file *vmr_do_pr_or_file(struct vm_region *region, const char func[], + int line) +{ + struct file *f = region->vm_file, *pr = region->vm_prfile; + + prfile_trace(f, pr, func, line, __func__); + return (f && pr) ? pr : f; +} + +void vmr_do_fput(struct vm_region *region, const char func[], int line) +{ + struct file *f = region->vm_file, *pr = region->vm_prfile; + + prfile_trace(f, pr, func, line, __func__); + fput(f); + if (f && pr) + fput(pr); +} +#endif /* CONFIG_MMU */ diff --git a/security/commoncap.c b/security/commoncap.c index 0405522995c574..e06c96bf05b39c 100644 --- a/security/commoncap.c +++ b/security/commoncap.c @@ -1002,9 +1002,11 @@ int cap_mmap_addr(unsigned long addr) } return ret; } +EXPORT_SYMBOL(cap_mmap_addr); int cap_mmap_file(struct file *file, unsigned long reqprot, unsigned long prot, unsigned long flags) { return 0; } +EXPORT_SYMBOL(cap_mmap_file); diff --git a/security/device_cgroup.c b/security/device_cgroup.c index dd0dc574d78dd0..9760ecb6b05259 100644 --- a/security/device_cgroup.c +++ b/security/device_cgroup.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -789,6 +790,7 @@ int __devcgroup_inode_permission(struct inode *inode, int mask) return __devcgroup_check_permission(type, imajor(inode), iminor(inode), access); } +EXPORT_SYMBOL(__devcgroup_inode_permission); int devcgroup_inode_mknod(int mode, dev_t dev) { diff --git a/security/security.c b/security/security.c index d6ab2d2b363dac..3ccb6220ac9af5 100644 --- a/security/security.c +++ b/security/security.c @@ -416,6 +416,7 @@ int security_path_rmdir(struct path *dir, struct dentry *dentry) return 0; return security_ops->path_rmdir(dir, dentry); } +EXPORT_SYMBOL(security_path_rmdir); int security_path_unlink(struct path *dir, struct dentry *dentry) { @@ -432,6 +433,7 @@ int security_path_symlink(struct path *dir, struct dentry *dentry, return 0; return security_ops->path_symlink(dir, dentry, old_name); } +EXPORT_SYMBOL(security_path_symlink); int security_path_link(struct dentry *old_dentry, struct path *new_dir, struct dentry *new_dentry) @@ -440,6 +442,7 @@ int security_path_link(struct dentry *old_dentry, struct path *new_dir, return 0; return security_ops->path_link(old_dentry, new_dir, new_dentry); } +EXPORT_SYMBOL(security_path_link); int security_path_rename(struct path *old_dir, struct dentry *old_dentry, struct path *new_dir, struct dentry *new_dentry) @@ -458,6 +461,7 @@ int security_path_truncate(struct path *path) return 0; return security_ops->path_truncate(path); } +EXPORT_SYMBOL(security_path_truncate); int security_path_chmod(struct path *path, umode_t mode) { @@ -465,6 +469,7 @@ int security_path_chmod(struct path *path, umode_t mode) return 0; return security_ops->path_chmod(path, mode); } +EXPORT_SYMBOL(security_path_chmod); int security_path_chown(struct path *path, kuid_t uid, kgid_t gid) { @@ -472,6 +477,7 @@ int security_path_chown(struct path *path, kuid_t uid, kgid_t gid) return 0; return security_ops->path_chown(path, uid, gid); } +EXPORT_SYMBOL(security_path_chown); int security_path_chroot(struct path *path) { @@ -548,6 +554,7 @@ int security_inode_readlink(struct dentry *dentry) return 0; return security_ops->inode_readlink(dentry); } +EXPORT_SYMBOL(security_inode_readlink); int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd) { @@ -562,6 +569,7 @@ int security_inode_permission(struct inode *inode, int mask) return 0; return security_ops->inode_permission(inode, mask); } +EXPORT_SYMBOL(security_inode_permission); int security_inode_setattr(struct dentry *dentry, struct iattr *attr) { @@ -683,6 +691,7 @@ int security_file_permission(struct file *file, int mask) return fsnotify_perm(file, mask); } +EXPORT_SYMBOL(security_file_permission); int security_file_alloc(struct file *file) { @@ -743,6 +752,7 @@ int security_mmap_file(struct file *file, unsigned long prot, return ret; return ima_file_mmap(file, prot); } +EXPORT_SYMBOL(security_mmap_file); int security_mmap_addr(unsigned long addr) { From 9bbb3d0d1d76d867a8425756e22b1af6d9654a1c Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Mon, 28 Sep 2015 11:32:42 +0200 Subject: [PATCH 342/359] l2tp: protect tunnel->del_work by ref_count [ Upstream commit 06a15f51cf3618e32a73871ee6a547ef7fd902b5 ] There is a small chance that tunnel_free() is called before tunnel->del_work scheduled resulting in a zero pointer dereference. Signed-off-by: Alexander Couzens Acked-by: James Chapman Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/l2tp/l2tp_core.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c index 8c27de2b4d5a2b..797ff373e4869b 100644 --- a/net/l2tp/l2tp_core.c +++ b/net/l2tp/l2tp_core.c @@ -1381,7 +1381,7 @@ static void l2tp_tunnel_del_work(struct work_struct *work) tunnel = container_of(work, struct l2tp_tunnel, del_work); sk = l2tp_tunnel_sock_lookup(tunnel); if (!sk) - return; + goto out; sock = sk->sk_socket; @@ -1402,6 +1402,8 @@ static void l2tp_tunnel_del_work(struct work_struct *work) } l2tp_tunnel_sock_put(sk); +out: + l2tp_tunnel_dec_refcount(tunnel); } /* Create a socket for the tunnel, if one isn't set up by @@ -1731,8 +1733,13 @@ EXPORT_SYMBOL_GPL(l2tp_tunnel_create); */ int l2tp_tunnel_delete(struct l2tp_tunnel *tunnel) { + l2tp_tunnel_inc_refcount(tunnel); l2tp_tunnel_closeall(tunnel); - return (false == queue_work(l2tp_wq, &tunnel->del_work)); + if (false == queue_work(l2tp_wq, &tunnel->del_work)) { + l2tp_tunnel_dec_refcount(tunnel); + return 1; + } + return 0; } EXPORT_SYMBOL_GPL(l2tp_tunnel_delete); From f9b8d11b312f8caaa9dfcf15fc7ab60d9167a6d0 Mon Sep 17 00:00:00 2001 From: Aaron Conole Date: Sat, 26 Sep 2015 18:50:42 -0400 Subject: [PATCH 343/359] af_unix: Convert the unix_sk macro to an inline function for type safety [ Upstream commit 4613012db1d911f80897f9446a49de817b2c4c47 ] As suggested by Eric Dumazet this change replaces the #define with a static inline function to enjoy complaints by the compiler when misusing the API. Signed-off-by: Aaron Conole Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- include/net/af_unix.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/net/af_unix.h b/include/net/af_unix.h index dbdfd2b0f3b3db..e927d3e80b6159 100644 --- a/include/net/af_unix.h +++ b/include/net/af_unix.h @@ -63,7 +63,11 @@ struct unix_sock { #define UNIX_GC_MAYBE_CYCLE 1 struct socket_wq peer_wq; }; -#define unix_sk(__sk) ((struct unix_sock *)__sk) + +static inline struct unix_sock *unix_sk(struct sock *sk) +{ + return (struct unix_sock *)sk; +} #define peer_wait peer_wq.wait From 1f21dc672d811af15694c6e9c68d275691f91343 Mon Sep 17 00:00:00 2001 From: Aaron Conole Date: Sat, 26 Sep 2015 18:50:43 -0400 Subject: [PATCH 344/359] af_unix: return data from multiple SKBs on recv() with MSG_PEEK flag [ Upstream commit 9f389e35674f5b086edd70ed524ca0f287259725 ] AF_UNIX sockets now return multiple skbs from recv() when MSG_PEEK flag is set. This is referenced in kernel bugzilla #12323 @ https://bugzilla.kernel.org/show_bug.cgi?id=12323 As described both in the BZ and lkml thread @ http://lkml.org/lkml/2008/1/8/444 calling recv() with MSG_PEEK on an AF_UNIX socket only reads a single skb, where the desired effect is to return as much skb data has been queued, until hitting the recv buffer size (whichever comes first). The modified MSG_PEEK path will now move to the next skb in the tree and jump to the again: label, rather than following the natural loop structure. This requires duplicating some of the loop head actions. This was tested using the python socketpair python code attached to the bugzilla issue. Signed-off-by: Aaron Conole Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/unix/af_unix.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 123c16419cbe91..825c029bf0927e 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -2063,8 +2063,20 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock, if (UNIXCB(skb).fp) siocb->scm->fp = scm_fp_dup(UNIXCB(skb).fp); - sk_peek_offset_fwd(sk, chunk); + if (skip) { + sk_peek_offset_fwd(sk, chunk); + skip -= chunk; + } + + if (UNIXCB(skb).fp) + break; + last = skb; + unix_state_lock(sk); + skb = skb_peek_next(skb, &sk->sk_receive_queue); + if (skb) + goto again; + unix_state_unlock(sk); break; } } while (size); From 275ceb01d2bbf8013c907087e9fea084fd3c55c9 Mon Sep 17 00:00:00 2001 From: Pravin B Shelar Date: Tue, 22 Sep 2015 12:57:53 -0700 Subject: [PATCH 345/359] skbuff: Fix skb checksum flag on skb pull [ Upstream commit 6ae459bdaaeebc632b16e54dcbabb490c6931d61 ] VXLAN device can receive skb with checksum partial. But the checksum offset could be in outer header which is pulled on receive. This results in negative checksum offset for the skb. Such skb can cause the assert failure in skb_checksum_help(). Following patch fixes the bug by setting checksum-none while pulling outer header. Following is the kernel panic msg from old kernel hitting the bug. ------------[ cut here ]------------ kernel BUG at net/core/dev.c:1906! RIP: 0010:[] skb_checksum_help+0x144/0x150 Call Trace: [] queue_userspace_packet+0x408/0x470 [openvswitch] [] ovs_dp_upcall+0x5d/0x60 [openvswitch] [] ovs_dp_process_packet_with_key+0xe6/0x100 [openvswitch] [] ovs_dp_process_received_packet+0x4b/0x80 [openvswitch] [] ovs_vport_receive+0x2a/0x30 [openvswitch] [] vxlan_rcv+0x53/0x60 [openvswitch] [] vxlan_udp_encap_recv+0x8b/0xf0 [openvswitch] [] udp_queue_rcv_skb+0x2dc/0x3b0 [] __udp4_lib_rcv+0x1cf/0x6c0 [] udp_rcv+0x1a/0x20 [] ip_local_deliver_finish+0xdd/0x280 [] ip_local_deliver+0x88/0x90 [] ip_rcv_finish+0x10d/0x370 [] ip_rcv+0x235/0x300 [] __netif_receive_skb+0x55d/0x620 [] netif_receive_skb+0x80/0x90 [] virtnet_poll+0x555/0x6f0 [] net_rx_action+0x134/0x290 [] __do_softirq+0xa8/0x210 [] call_softirq+0x1c/0x30 [] do_softirq+0x65/0xa0 [] irq_exit+0x8e/0xb0 [] do_IRQ+0x63/0xe0 [] common_interrupt+0x6e/0x6e Reported-by: Anupam Chanda Signed-off-by: Pravin B Shelar Acked-by: Tom Herbert Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- include/linux/skbuff.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 478120ae34e503..19998b8c72f6ae 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -2363,6 +2363,9 @@ static inline void skb_postpull_rcsum(struct sk_buff *skb, { if (skb->ip_summed == CHECKSUM_COMPLETE) skb->csum = csum_sub(skb->csum, csum_partial(start, len, 0)); + else if (skb->ip_summed == CHECKSUM_PARTIAL && + skb_checksum_start_offset(skb) <= len) + skb->ip_summed = CHECKSUM_NONE; } unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len); From f03a8061b5c46dbc6fac58d7933de35ef91841f0 Mon Sep 17 00:00:00 2001 From: Pravin B Shelar Date: Mon, 28 Sep 2015 17:24:25 -0700 Subject: [PATCH 346/359] skbuff: Fix skb checksum partial check. [ Upstream commit 31b33dfb0a144469dd805514c9e63f4993729a48 ] Earlier patch 6ae459bda tried to detect void ckecksum partial skb by comparing pull length to checksum offset. But it does not work for all cases since checksum-offset depends on updates to skb->data. Following patch fixes it by validating checksum start offset after skb-data pointer is updated. Negative value of checksum offset start means there is no need to checksum. Fixes: 6ae459bda ("skbuff: Fix skb checksum flag on skb pull") Reported-by: Andrew Vagin Signed-off-by: Pravin B Shelar Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- include/linux/skbuff.h | 2 +- net/core/skbuff.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 19998b8c72f6ae..993e34774bb1c5 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -2364,7 +2364,7 @@ static inline void skb_postpull_rcsum(struct sk_buff *skb, if (skb->ip_summed == CHECKSUM_COMPLETE) skb->csum = csum_sub(skb->csum, csum_partial(start, len, 0)); else if (skb->ip_summed == CHECKSUM_PARTIAL && - skb_checksum_start_offset(skb) <= len) + skb_checksum_start_offset(skb) < 0) skb->ip_summed = CHECKSUM_NONE; } diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 6148716884ae85..05195b8c871890 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -2711,11 +2711,12 @@ EXPORT_SYMBOL(skb_append_datato_frags); */ unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len) { + unsigned char *data = skb->data; + BUG_ON(len > skb->len); - skb->len -= len; - BUG_ON(skb->len < skb->data_len); - skb_postpull_rcsum(skb, skb->data, len); - return skb->data += len; + __skb_pull(skb, len); + skb_postpull_rcsum(skb, data, len); + return skb->data; } EXPORT_SYMBOL_GPL(skb_pull_rcsum); From dec23a559fd24701c59f322b669bae73820b257d Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Tue, 29 Sep 2015 18:52:25 -0700 Subject: [PATCH 347/359] net: add pfmemalloc check in sk_add_backlog() [ Upstream commit c7c49b8fde26b74277188bdc6c9dca38db6fa35b ] Greg reported crashes hitting the following check in __sk_backlog_rcv() BUG_ON(!sock_flag(sk, SOCK_MEMALLOC)); The pfmemalloc bit is currently checked in sk_filter(). This works correctly for TCP, because sk_filter() is ran in tcp_v[46]_rcv() before hitting the prequeue or backlog checks. For UDP or other protocols, this does not work, because the sk_filter() is ran from sock_queue_rcv_skb(), which might be called _after_ backlog queuing if socket is owned by user by the time packet is processed by softirq handler. Fixes: b4b9e35585089 ("netvm: set PF_MEMALLOC as appropriate during SKB processing") Signed-off-by: Eric Dumazet Reported-by: Greg Thelen Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- include/net/sock.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/net/sock.h b/include/net/sock.h index c0aad07160ef3e..95dc0c8a9dac07 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -782,6 +782,14 @@ static inline __must_check int sk_add_backlog(struct sock *sk, struct sk_buff *s if (sk_rcvqueues_full(sk, skb, limit)) return -ENOBUFS; + /* + * If the skb was allocated from pfmemalloc reserves, only + * allow SOCK_MEMALLOC sockets to use it as this socket is + * helping free memory + */ + if (skb_pfmemalloc(skb) && !sock_flag(sk, SOCK_MEMALLOC)) + return -ENOMEM; + __sk_add_backlog(sk, skb); sk->sk_backlog.len += skb->truesize; return 0; From 9db7ed146a62e3c66a8a7263fdf4adb5c48d16ca Mon Sep 17 00:00:00 2001 From: Guillaume Nault Date: Wed, 30 Sep 2015 11:45:33 +0200 Subject: [PATCH 348/359] ppp: don't override sk->sk_state in pppoe_flush_dev() [ Upstream commit e6740165b8f7f06d8caee0fceab3fb9d790a6fed ] Since commit 2b018d57ff18 ("pppoe: drop PPPOX_ZOMBIEs in pppoe_release"), pppoe_release() calls dev_put(po->pppoe_dev) if sk is in the PPPOX_ZOMBIE state. But pppoe_flush_dev() can set sk->sk_state to PPPOX_ZOMBIE _and_ reset po->pppoe_dev to NULL. This leads to the following oops: [ 570.140800] BUG: unable to handle kernel NULL pointer dereference at 00000000000004e0 [ 570.142931] IP: [] pppoe_release+0x50/0x101 [pppoe] [ 570.144601] PGD 3d119067 PUD 3dbc1067 PMD 0 [ 570.144601] Oops: 0000 [#1] SMP [ 570.144601] Modules linked in: l2tp_ppp l2tp_netlink l2tp_core ip6_udp_tunnel udp_tunnel pppoe pppox ppp_generic slhc loop crc32c_intel ghash_clmulni_intel jitterentropy_rng sha256_generic hmac drbg ansi_cprng aesni_intel aes_x86_64 ablk_helper cryptd lrw gf128mul glue_helper acpi_cpufreq evdev serio_raw processor button ext4 crc16 mbcache jbd2 virtio_net virtio_blk virtio_pci virtio_ring virtio [ 570.144601] CPU: 1 PID: 15738 Comm: ppp-apitest Not tainted 4.2.0 #1 [ 570.144601] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Debian-1.8.2-1 04/01/2014 [ 570.144601] task: ffff88003d30d600 ti: ffff880036b60000 task.ti: ffff880036b60000 [ 570.144601] RIP: 0010:[] [] pppoe_release+0x50/0x101 [pppoe] [ 570.144601] RSP: 0018:ffff880036b63e08 EFLAGS: 00010202 [ 570.144601] RAX: 0000000000000000 RBX: ffff880034340000 RCX: 0000000000000206 [ 570.144601] RDX: 0000000000000006 RSI: ffff88003d30dd20 RDI: ffff88003d30dd20 [ 570.144601] RBP: ffff880036b63e28 R08: 0000000000000001 R09: 0000000000000000 [ 570.144601] R10: 00007ffee9b50420 R11: ffff880034340078 R12: ffff8800387ec780 [ 570.144601] R13: ffff8800387ec7b0 R14: ffff88003e222aa0 R15: ffff8800387ec7b0 [ 570.144601] FS: 00007f5672f48700(0000) GS:ffff88003fc80000(0000) knlGS:0000000000000000 [ 570.144601] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 570.144601] CR2: 00000000000004e0 CR3: 0000000037f7e000 CR4: 00000000000406a0 [ 570.144601] Stack: [ 570.144601] ffffffffa018f240 ffff8800387ec780 ffffffffa018f240 ffff8800387ec7b0 [ 570.144601] ffff880036b63e48 ffffffff812caabe ffff880039e4e000 0000000000000008 [ 570.144601] ffff880036b63e58 ffffffff812cabad ffff880036b63ea8 ffffffff811347f5 [ 570.144601] Call Trace: [ 570.144601] [] sock_release+0x1a/0x75 [ 570.144601] [] sock_close+0xd/0x11 [ 570.144601] [] __fput+0xff/0x1a5 [ 570.144601] [] ____fput+0x9/0xb [ 570.144601] [] task_work_run+0x66/0x90 [ 570.144601] [] prepare_exit_to_usermode+0x8c/0xa7 [ 570.144601] [] syscall_return_slowpath+0x16d/0x19b [ 570.144601] [] int_ret_from_sys_call+0x25/0x9f [ 570.144601] Code: 48 8b 83 c8 01 00 00 a8 01 74 12 48 89 df e8 8b 27 14 e1 b8 f7 ff ff ff e9 b7 00 00 00 8a 43 12 a8 0b 74 1c 48 8b 83 a8 04 00 00 <48> 8b 80 e0 04 00 00 65 ff 08 48 c7 83 a8 04 00 00 00 00 00 00 [ 570.144601] RIP [] pppoe_release+0x50/0x101 [pppoe] [ 570.144601] RSP [ 570.144601] CR2: 00000000000004e0 [ 570.200518] ---[ end trace 46956baf17349563 ]--- pppoe_flush_dev() has no reason to override sk->sk_state with PPPOX_ZOMBIE. pppox_unbind_sock() already sets sk->sk_state to PPPOX_DEAD, which is the correct state given that sk is unbound and po->pppoe_dev is NULL. Fixes: 2b018d57ff18 ("pppoe: drop PPPOX_ZOMBIEs in pppoe_release") Tested-by: Oleksii Berezhniak Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ppp/pppoe.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ppp/pppoe.c b/drivers/net/ppp/pppoe.c index becfa3ef7fdc4a..eda9f3d8774682 100644 --- a/drivers/net/ppp/pppoe.c +++ b/drivers/net/ppp/pppoe.c @@ -313,7 +313,6 @@ static void pppoe_flush_dev(struct net_device *dev) if (po->pppoe_dev == dev && sk->sk_state & (PPPOX_CONNECTED | PPPOX_BOUND | PPPOX_ZOMBIE)) { pppox_unbind_sock(sk); - sk->sk_state = PPPOX_ZOMBIE; sk->sk_state_change(sk); po->pppoe_dev = NULL; dev_put(dev); From c4fc18ccc48aaf9779633b0074036ba3c42f341c Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Wed, 14 Oct 2015 01:09:40 -0700 Subject: [PATCH 349/359] ethtool: Use kcalloc instead of kmalloc for ethtool_get_strings [ Upstream commit 077cb37fcf6f00a45f375161200b5ee0cd4e937b ] It seems that kernel memory can leak into userspace by a kmalloc, ethtool_get_strings, then copy_to_user sequence. Avoid this by using kcalloc to zero fill the copied buffer. Signed-off-by: Joe Perches Acked-by: Ben Hutchings Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/core/ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/ethtool.c b/net/core/ethtool.c index ce91766eeca90e..213b612551400f 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c @@ -1066,7 +1066,7 @@ static int ethtool_get_strings(struct net_device *dev, void __user *useraddr) gstrings.len = ret; - data = kmalloc(gstrings.len * ETH_GSTRING_LEN, GFP_USER); + data = kcalloc(gstrings.len, ETH_GSTRING_LEN, GFP_USER); if (!data) return -ENOMEM; From d54ee99a9dc2d78c7ab89f62a8316b6cf50795f5 Mon Sep 17 00:00:00 2001 From: Michel Stam Date: Thu, 2 Oct 2014 10:22:02 +0200 Subject: [PATCH 350/359] asix: Don't reset PHY on if_up for ASIX 88772 [ Upstream commit 3cc81d85ee01e5a0b7ea2f4190e2ed1165f53c31 ] I've noticed every time the interface is set to 'up,', the kernel reports that the link speed is set to 100 Mbps/Full Duplex, even when ethtool is used to set autonegotiation to 'off', half duplex, 10 Mbps. It can be tested by: ifconfig eth0 down ethtool -s eth0 autoneg off speed 10 duplex half ifconfig eth0 up Then checking 'dmesg' for the link speed. Signed-off-by: Michel Stam Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/usb/asix_devices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c index 97b5de7aebdbdd..02314fae33d30d 100644 --- a/drivers/net/usb/asix_devices.c +++ b/drivers/net/usb/asix_devices.c @@ -888,7 +888,7 @@ static const struct driver_info ax88772_info = { .unbind = ax88772_unbind, .status = asix_status, .link_reset = ax88772_link_reset, - .reset = ax88772_reset, + .reset = ax88772_link_reset, .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_LINK_INTR | FLAG_MULTI_PACKET, .rx_fixup = asix_rx_fixup_common, .tx_fixup = asix_tx_fixup, From 37673fd3fbdf5a72cc2c3b054daf64d0a8e721b8 Mon Sep 17 00:00:00 2001 From: Charles Keepax Date: Thu, 6 Nov 2014 15:49:41 +0000 Subject: [PATCH 351/359] asix: Do full reset during ax88772_bind [ Upstream commit 436c2a5036b6ffe813310df2cf327d3b69be0734 ] commit 3cc81d85ee01 ("asix: Don't reset PHY on if_up for ASIX 88772") causes the ethernet on Arndale to no longer function. This appears to be because the Arndale ethernet requires a full reset before it will function correctly, however simply reverting the above patch causes problems with ethtool settings getting reset. It seems the problem is that the ethernet is not properly reset during bind, and indeed the code in ax88772_bind that resets the device is a very small subset of the actual ax88772_reset function. This patch uses ax88772_reset in place of the existing reset code in ax88772_bind which removes some code duplication and fixes the ethernet on Arndale. It is still possible that the original patch causes some issues with suspend and resume but that seems like a separate issue and I haven't had a chance to test that yet. Signed-off-by: Charles Keepax Tested-by: Riku Voipio Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/usb/asix_devices.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c index 02314fae33d30d..05e8bd7b3e0f96 100644 --- a/drivers/net/usb/asix_devices.c +++ b/drivers/net/usb/asix_devices.c @@ -466,19 +466,7 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf) return ret; } - ret = asix_sw_reset(dev, AX_SWRESET_IPPD | AX_SWRESET_PRL); - if (ret < 0) - return ret; - - msleep(150); - - ret = asix_sw_reset(dev, AX_SWRESET_CLEAR); - if (ret < 0) - return ret; - - msleep(150); - - ret = asix_sw_reset(dev, embd_phy ? AX_SWRESET_IPRL : AX_SWRESET_PRTE); + ax88772_reset(dev); /* Read PHYID register *AFTER* the PHY was reset properly */ phyid = asix_get_phyid(dev); From 31e29b7bfcbece0d538cb4feec0e57b02b729ab2 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Sun, 9 Jun 2013 20:12:42 +0200 Subject: [PATCH 352/359] m68k/uaccess: Fix asm constraints for userspace access commit 631d8b674f5f8235e9cb7e628b0fe9e5200e3158 upstream. When compiling a MMU kernel with CPU_HAS_ADDRESS_SPACES=n (e.g. "MMU=y allnoconfig": "echo CONFIG_MMU=y > allno.config && make KCONFIG_ALLCONFIG=1 allnoconfig"), we use plain "move" instead of "moves", and I got: CC arch/m68k/lib/uaccess.o {standard input}: Assembler messages: {standard input}:47: Error: operands mismatch -- statement `move.b %a0,(%a1)' ignored This happens because plain "move" doesn't support byte transfers between memory and address registers, while "moves" does. Fix the asm constraints for __generic_copy_from_user(), __generic_copy_to_user(), and __clear_user() to only use data registers when accessing userspace. Also, relax the asm constraints for 16-bit userspace accesses in __put_user() and __get_user(), as both "move" and "moves" do support such transfers between memory and address registers. Signed-off-by: Geert Uytterhoeven Cc: Guenter Roeck Signed-off-by: Greg Kroah-Hartman --- arch/m68k/include/asm/uaccess_mm.h | 8 ++++---- arch/m68k/lib/uaccess.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/m68k/include/asm/uaccess_mm.h b/arch/m68k/include/asm/uaccess_mm.h index 472c891a4aeee4..15901db435b906 100644 --- a/arch/m68k/include/asm/uaccess_mm.h +++ b/arch/m68k/include/asm/uaccess_mm.h @@ -90,7 +90,7 @@ asm volatile ("\n" \ __put_user_asm(__pu_err, __pu_val, ptr, b, d, -EFAULT); \ break; \ case 2: \ - __put_user_asm(__pu_err, __pu_val, ptr, w, d, -EFAULT); \ + __put_user_asm(__pu_err, __pu_val, ptr, w, r, -EFAULT); \ break; \ case 4: \ __put_user_asm(__pu_err, __pu_val, ptr, l, r, -EFAULT); \ @@ -158,7 +158,7 @@ asm volatile ("\n" \ __get_user_asm(__gu_err, x, ptr, u8, b, d, -EFAULT); \ break; \ case 2: \ - __get_user_asm(__gu_err, x, ptr, u16, w, d, -EFAULT); \ + __get_user_asm(__gu_err, x, ptr, u16, w, r, -EFAULT); \ break; \ case 4: \ __get_user_asm(__gu_err, x, ptr, u32, l, r, -EFAULT); \ @@ -245,7 +245,7 @@ __constant_copy_from_user(void *to, const void __user *from, unsigned long n) __get_user_asm(res, *(u8 *)to, (u8 __user *)from, u8, b, d, 1); break; case 2: - __get_user_asm(res, *(u16 *)to, (u16 __user *)from, u16, w, d, 2); + __get_user_asm(res, *(u16 *)to, (u16 __user *)from, u16, w, r, 2); break; case 3: __constant_copy_from_user_asm(res, to, from, tmp, 3, w, b,); @@ -326,7 +326,7 @@ __constant_copy_to_user(void __user *to, const void *from, unsigned long n) __put_user_asm(res, *(u8 *)from, (u8 __user *)to, b, d, 1); break; case 2: - __put_user_asm(res, *(u16 *)from, (u16 __user *)to, w, d, 2); + __put_user_asm(res, *(u16 *)from, (u16 __user *)to, w, r, 2); break; case 3: __constant_copy_to_user_asm(res, to, from, tmp, 3, w, b,); diff --git a/arch/m68k/lib/uaccess.c b/arch/m68k/lib/uaccess.c index 5e97f2ee7c1197..35d1442dee899a 100644 --- a/arch/m68k/lib/uaccess.c +++ b/arch/m68k/lib/uaccess.c @@ -52,7 +52,7 @@ unsigned long __generic_copy_from_user(void *to, const void __user *from, " .long 3b,30b\n" " .long 5b,50b\n" " .previous" - : "=d" (res), "+a" (from), "+a" (to), "=&r" (tmp) + : "=d" (res), "+a" (from), "+a" (to), "=&d" (tmp) : "0" (n / 4), "d" (n & 3)); return res; @@ -96,7 +96,7 @@ unsigned long __generic_copy_to_user(void __user *to, const void *from, " .long 7b,50b\n" " .long 8b,50b\n" " .previous" - : "=d" (res), "+a" (from), "+a" (to), "=&r" (tmp) + : "=d" (res), "+a" (from), "+a" (to), "=&d" (tmp) : "0" (n / 4), "d" (n & 3)); return res; @@ -141,7 +141,7 @@ unsigned long __clear_user(void __user *to, unsigned long n) " .long 7b,40b\n" " .previous" : "=d" (res), "+a" (to) - : "r" (0), "0" (n / 4), "d" (n & 3)); + : "d" (0), "0" (n / 4), "d" (n & 3)); return res; } From 29e5b4243743e13be5196622fd0267657dc2ccf5 Mon Sep 17 00:00:00 2001 From: Dave Kleikamp Date: Mon, 5 Oct 2015 10:08:51 -0500 Subject: [PATCH 353/359] crypto: sparc - initialize blkcipher.ivsize commit a66d7f724a96d6fd279bfbd2ee488def6b081bea upstream. Some of the crypto algorithms write to the initialization vector, but no space has been allocated for it. This clobbers adjacent memory. Signed-off-by: Dave Kleikamp Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- arch/sparc/crypto/aes_glue.c | 2 ++ arch/sparc/crypto/camellia_glue.c | 1 + arch/sparc/crypto/des_glue.c | 2 ++ 3 files changed, 5 insertions(+) diff --git a/arch/sparc/crypto/aes_glue.c b/arch/sparc/crypto/aes_glue.c index ded4cee35318fa..dc78cdd43e0ab7 100644 --- a/arch/sparc/crypto/aes_glue.c +++ b/arch/sparc/crypto/aes_glue.c @@ -433,6 +433,7 @@ static struct crypto_alg algs[] = { { .blkcipher = { .min_keysize = AES_MIN_KEY_SIZE, .max_keysize = AES_MAX_KEY_SIZE, + .ivsize = AES_BLOCK_SIZE, .setkey = aes_set_key, .encrypt = cbc_encrypt, .decrypt = cbc_decrypt, @@ -452,6 +453,7 @@ static struct crypto_alg algs[] = { { .blkcipher = { .min_keysize = AES_MIN_KEY_SIZE, .max_keysize = AES_MAX_KEY_SIZE, + .ivsize = AES_BLOCK_SIZE, .setkey = aes_set_key, .encrypt = ctr_crypt, .decrypt = ctr_crypt, diff --git a/arch/sparc/crypto/camellia_glue.c b/arch/sparc/crypto/camellia_glue.c index 641f55cb61c3a8..eb87d6dd86b1ae 100644 --- a/arch/sparc/crypto/camellia_glue.c +++ b/arch/sparc/crypto/camellia_glue.c @@ -274,6 +274,7 @@ static struct crypto_alg algs[] = { { .blkcipher = { .min_keysize = CAMELLIA_MIN_KEY_SIZE, .max_keysize = CAMELLIA_MAX_KEY_SIZE, + .ivsize = CAMELLIA_BLOCK_SIZE, .setkey = camellia_set_key, .encrypt = cbc_encrypt, .decrypt = cbc_decrypt, diff --git a/arch/sparc/crypto/des_glue.c b/arch/sparc/crypto/des_glue.c index d1150097299479..1359bfc544e403 100644 --- a/arch/sparc/crypto/des_glue.c +++ b/arch/sparc/crypto/des_glue.c @@ -429,6 +429,7 @@ static struct crypto_alg algs[] = { { .blkcipher = { .min_keysize = DES_KEY_SIZE, .max_keysize = DES_KEY_SIZE, + .ivsize = DES_BLOCK_SIZE, .setkey = des_set_key, .encrypt = cbc_encrypt, .decrypt = cbc_decrypt, @@ -485,6 +486,7 @@ static struct crypto_alg algs[] = { { .blkcipher = { .min_keysize = DES3_EDE_KEY_SIZE, .max_keysize = DES3_EDE_KEY_SIZE, + .ivsize = DES3_EDE_BLOCK_SIZE, .setkey = des3_ede_set_key, .encrypt = cbc3_encrypt, .decrypt = cbc3_decrypt, From 2aafe811b0d734f1dc743ce23bc9bec94dec26cb Mon Sep 17 00:00:00 2001 From: Russell King Date: Fri, 9 Oct 2015 20:43:33 +0100 Subject: [PATCH 354/359] crypto: ahash - ensure statesize is non-zero commit 8996eafdcbad149ac0f772fb1649fbb75c482a6a upstream. Unlike shash algorithms, ahash drivers must implement export and import as their descriptors may contain hardware state and cannot be exported as is. Unfortunately some ahash drivers did not provide them and end up causing crashes with algif_hash. This patch adds a check to prevent these drivers from registering ahash algorithms until they are fixed. Signed-off-by: Russell King Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- crypto/ahash.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crypto/ahash.c b/crypto/ahash.c index 793a27f2493e52..857ae2b2a2a291 100644 --- a/crypto/ahash.c +++ b/crypto/ahash.c @@ -462,7 +462,8 @@ static int ahash_prepare_alg(struct ahash_alg *alg) struct crypto_alg *base = &alg->halg.base; if (alg->halg.digestsize > PAGE_SIZE / 8 || - alg->halg.statesize > PAGE_SIZE / 8) + alg->halg.statesize > PAGE_SIZE / 8 || + alg->halg.statesize == 0) return -EINVAL; base->cra_type = &crypto_ahash_type; From 49d851cea0996812449cbe2ceb886cbbf413085a Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Fri, 9 Oct 2015 10:39:25 +0100 Subject: [PATCH 355/359] i2c: rcar: enable RuntimePM before registering to the core commit 4f7effddf4549d57114289f273710f077c4c330a upstream. The core may register clients attached to this master which may use funtionality from the master. So, RuntimePM must be enabled before, otherwise this will fail. While here, move drvdata, too. Reported-by: Geert Uytterhoeven Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang Signed-off-by: Greg Kroah-Hartman --- drivers/i2c/busses/i2c-rcar.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c index 8a806f5c40cf91..3f2dbd1ce6a3ff 100644 --- a/drivers/i2c/busses/i2c-rcar.c +++ b/drivers/i2c/busses/i2c-rcar.c @@ -673,15 +673,16 @@ static int rcar_i2c_probe(struct platform_device *pdev) return ret; } + pm_runtime_enable(dev); + platform_set_drvdata(pdev, priv); + ret = i2c_add_numbered_adapter(adap); if (ret < 0) { dev_err(dev, "reg adap failed: %d\n", ret); + pm_runtime_disable(dev); return ret; } - pm_runtime_enable(dev); - platform_set_drvdata(pdev, priv); - dev_info(dev, "probed\n"); return 0; From 334c94072f03ff42ea823e81351f9baa933b4739 Mon Sep 17 00:00:00 2001 From: Shaohua Li Date: Wed, 30 Sep 2015 09:05:30 -0700 Subject: [PATCH 356/359] workqueue: make sure delayed work run in local cpu commit 874bbfe600a660cba9c776b3957b1ce393151b76 upstream. My system keeps crashing with below message. vmstat_update() schedules a delayed work in current cpu and expects the work runs in the cpu. schedule_delayed_work() is expected to make delayed work run in local cpu. The problem is timer can be migrated with NO_HZ. __queue_work() queues work in timer handler, which could run in a different cpu other than where the delayed work is scheduled. The end result is the delayed work runs in different cpu. The patch makes __queue_delayed_work records local cpu earlier. Where the timer runs doesn't change where the work runs with the change. [ 28.010131] ------------[ cut here ]------------ [ 28.010609] kernel BUG at ../mm/vmstat.c:1392! [ 28.011099] invalid opcode: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC KASAN [ 28.011860] Modules linked in: [ 28.012245] CPU: 0 PID: 289 Comm: kworker/0:3 Tainted: G W4.3.0-rc3+ #634 [ 28.013065] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140709_153802- 04/01/2014 [ 28.014160] Workqueue: events vmstat_update [ 28.014571] task: ffff880117682580 ti: ffff8800ba428000 task.ti: ffff8800ba428000 [ 28.015445] RIP: 0010:[] []vmstat_update+0x31/0x80 [ 28.016282] RSP: 0018:ffff8800ba42fd80 EFLAGS: 00010297 [ 28.016812] RAX: 0000000000000000 RBX: ffff88011a858dc0 RCX:0000000000000000 [ 28.017585] RDX: ffff880117682580 RSI: ffffffff81f14d8c RDI:ffffffff81f4df8d [ 28.018366] RBP: ffff8800ba42fd90 R08: 0000000000000001 R09:0000000000000000 [ 28.019169] R10: 0000000000000000 R11: 0000000000000121 R12:ffff8800baa9f640 [ 28.019947] R13: ffff88011a81e340 R14: ffff88011a823700 R15:0000000000000000 [ 28.020071] FS: 0000000000000000(0000) GS:ffff88011a800000(0000)knlGS:0000000000000000 [ 28.020071] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b [ 28.020071] CR2: 00007ff6144b01d0 CR3: 00000000b8e93000 CR4:00000000000006f0 [ 28.020071] Stack: [ 28.020071] ffff88011a858dc0 ffff8800baa9f640 ffff8800ba42fe00ffffffff8106bd88 [ 28.020071] ffffffff8106bd0b 0000000000000096 0000000000000000ffffffff82f9b1e8 [ 28.020071] ffffffff829f0b10 0000000000000000 ffffffff81f18460ffff88011a81e340 [ 28.020071] Call Trace: [ 28.020071] [] process_one_work+0x1c8/0x540 [ 28.020071] [] ? process_one_work+0x14b/0x540 [ 28.020071] [] worker_thread+0x114/0x460 [ 28.020071] [] ? process_one_work+0x540/0x540 [ 28.020071] [] kthread+0xf8/0x110 [ 28.020071] [] ?kthread_create_on_node+0x200/0x200 [ 28.020071] [] ret_from_fork+0x3f/0x70 [ 28.020071] [] ?kthread_create_on_node+0x200/0x200 Signed-off-by: Shaohua Li Signed-off-by: Tejun Heo Signed-off-by: Greg Kroah-Hartman --- kernel/workqueue.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index fe7c4b91d2e73a..fa927fd5778d54 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -1450,13 +1450,13 @@ static void __queue_delayed_work(int cpu, struct workqueue_struct *wq, timer_stats_timer_set_start_info(&dwork->timer); dwork->wq = wq; + /* timer isn't guaranteed to run in this cpu, record earlier */ + if (cpu == WORK_CPU_UNBOUND) + cpu = raw_smp_processor_id(); dwork->cpu = cpu; timer->expires = jiffies + delay; - if (unlikely(cpu != WORK_CPU_UNBOUND)) - add_timer_on(timer, cpu); - else - add_timer(timer); + add_timer_on(timer, cpu); } /** From ad824a8286dd4db9c23e3e3febdd63d4c2c4ae9e Mon Sep 17 00:00:00 2001 From: Mike Snitzer Date: Tue, 13 Oct 2015 12:04:28 -0400 Subject: [PATCH 357/359] dm thin: fix missing pool reference count decrement in pool_ctr error path commit ba30670f4d5292c4e7f7980bbd5071f7c4794cdd upstream. Fixes: ac8c3f3df ("dm thin: generate event when metadata threshold passed") Signed-off-by: Mike Snitzer Signed-off-by: Greg Kroah-Hartman --- drivers/md/dm-thin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index 39996ca58ce60a..ec56072c6326e1 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c @@ -2109,7 +2109,7 @@ static int pool_ctr(struct dm_target *ti, unsigned argc, char **argv) metadata_low_callback, pool); if (r) - goto out_free_pt; + goto out_flags_changed; pt->callbacks.congested_fn = pool_is_congested; dm_table_add_target_callbacks(ti->table, &pt->callbacks); From f22714069f1bc94b91b463bdc00cc82782f0e363 Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Mon, 31 Aug 2015 15:21:39 +0300 Subject: [PATCH 358/359] rbd: fix double free on rbd_dev->header_name commit 3ebe138ac642a195c7f2efdb918f464734421fd6 upstream. If rbd_dev_image_probe() in rbd_dev_probe_parent() fails, header_name is freed twice: once in rbd_dev_probe_parent() and then in its caller rbd_dev_image_probe() (rbd_dev_image_probe() is called recursively to handle parent images). rbd_dev_probe_parent() is responsible for probing the parent, so it shouldn't muck with clone's fields. Signed-off-by: Ilya Dryomov Reviewed-by: Alex Elder Signed-off-by: Greg Kroah-Hartman --- drivers/block/rbd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 01677543248df1..2fa22c24fa5de3 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -4860,7 +4860,6 @@ static int rbd_dev_probe_parent(struct rbd_device *rbd_dev) out_err: if (parent) { rbd_dev_unparent(rbd_dev); - kfree(rbd_dev->header_name); rbd_dev_destroy(parent); } else { rbd_put_client(rbdc); From d17332ebfb5f2010ae5d3332a52df361f28ae4a8 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 27 Oct 2015 09:45:05 +0900 Subject: [PATCH 359/359] Linux 3.10.92 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ba6a94cf354bbf..25701b67bb6d93 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 10 -SUBLEVEL = 91 +SUBLEVEL = 92 EXTRAVERSION = NAME = TOSSUG Baby Fish