Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*********************************************************************************
- AVerMedia TECHNOLOGIES, Inc.
- AVerMedia Linux Driver License Agreement
- IMPORTANT: This AVerMeida Linux Driver is supplied to you by
- AVerMedia TECHNOLOGIES, Inc. ("AVerMedia") in consideration
- of your agreement to the following terms, and your use, installation,
- modification or redistribution of this AVerMedia Linux Driver
- constitutes acceptance of these terms. If you do not agree with
- these terms, please do not use, install, modify or redistribute
- this AVerMedia Linux Driver.
- 1. License. Any driver sources, binaries, utilities, documentation
- and other materials accompanying this License, whether on disk,
- print or electronic documentation, in read only memory, or any
- other media, (collectively, the "AVerMedia Linux Driver") are
- licensed, not sold, to you by AVerMedia for use only under the terms
- of this License, and AVerMedia reserves all rights not expressly
- granted to you. The rights granted herein are limited to AVerMedia's
- intellectual property rights in the AVerMedia Linux Driver and do not
- include any other patents or intellectual property rights. You own
- the media on which the AVerMedia Linux Driver is recorded but AVerMedia
- retains ownership of the AVerMedia Linux Driver itself and its
- derivative works. The AVerMedia Linux Driver in this package and
- any copies, modifications and derivative works which this License
- authorizes you to make are subject to this License. The binaries
- part of AVerMedia Linux Driver is ported from Windows driver and
- is under some other NDA, so the original source code will not be
- released.
- 2. Permitted Uses and Restrictions. You may use, copy, redistribute
- or install the original AVerMedia Linux Driver to test or demonstrate
- the AVerMedia Linux Driver with AVerMedia's products. You may also
- modify the released source code in order to improve the compatibilities,
- operability and functionalities with AVerMedia's products as long as
- this License in whole are remained and subsequently use, copy,
- redistribute or install the derivative works. You have no right to
- reverse engineer, decompile, disassemble the accompanying object files
- through the released source code, nor to modify, incorporate into or
- compile in combination with your own programs to operate with any
- product other than from AVerMedia. Your rights under this License
- will terminate automatically without notice from AVerMedia if you
- fail to comply with any term(s) of this License.
- 3. Disclaimer of Warranty. The AVerMedia Linux Driver may be "alpha",
- "beta", "development", pre-release, untested, and/or not fully tested
- and may contain errors that could cause failures or loss of data, be
- incomplete or contain inaccuracies. YOU EXPRESSLY ACKNOWLEDGE AND AGREE
- THAT USE OF THE AVERMEDIA LINUX DRIVER IS AT YOUR SOLE RISK AND THAT THE
- ENTIRE RISK AS TO SATISFACTORY QUALITY, PERFORMANCE, ACCURACY AND EFFORT
- IS WITH YOU. THE AVERMEDIA LINUX DRIVER IS PROVIDED "AS IS" WITH ALL
- FAULTS. THE USER ASSUMES TOTAL RESPONSIBILITY AND ALL RISKS ASSOCIATED
- WITH USE OF THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, RISKS OF ANY
- DEFECTS, INACCURACIES, PROGRAM ERRORS, DAMAGE TO OR LOSS OF DATA,
- PROGRAMS OR EQUIPMENT, UNAVAILABILITY OR INTERRUPTION OF OPERATIONS.
- AVERMEDIA DOES NOT MAKE, AND EXPRESSLY DISCLAIM, ANY EXPRESS OR IMPLIED
- WARRANTIES OF ANY KIND WHATSOEVER, INCLUDING, WITHOUT LIMITATION,
- ANY WARRANTIES OR FITNESS FOR A PARTICULAR PURPOSE, AND ANY WARRANTIES
- OF TITLE OR NON-INFRINGEMENT. AVERMEDIA DOES NOT WARRANT THAT THE USE
- OR OPERATION OF THE SOFTWARE WILL BE UNITERRUPTED OR ERROR FREE.
- 4. Complete Agreement. This License constitutes the entire agreement
- between the parties with respect to the use of the AVerMedia Linux
- Driver licensed hereunder and supersedes all prior or contemporaneous
- understandings regarding such subject matter. No amendment to or
- modification of this License will be binding unless in writing and
- signed by AVerMedia. Any translation of this License is done for
- local requirements and in the event of a dispute between the English
- and any non-English versions, the English version of this License
- shall govern.
- *********************************************************************************/
- #include <linux/module.h>
- #include <linux/version.h>
- #include <linux/types.h>
- #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
- #include <asm/semaphore.h>
- #else
- #include <linux/semaphore.h>
- #endif
- #include <linux/slab.h>
- #include <linux/errno.h>
- #include <linux/sched.h>
- #include <linux/kref.h>
- #include <linux/smp_lock.h>
- #include <linux/proc_fs.h>
- #include <linux/list.h>
- #include <linux/kdev_t.h>
- #include <linux/device.h>
- #include <asm/uaccess.h>
- #include <linux/spinlock.h>
- #include <linux/mm.h>
- #include <asm/scatterlist.h>
- #include <linux/vmalloc.h>
- #include <linux/timer.h>
- #include <linux/pci.h>
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,8)
- #include <linux/hardirq.h>
- #endif
- #include <linux/delay.h>
- #include <linux/interrupt.h>
- #include <asm/atomic.h>
- #include <asm/io.h>
- #include <linux/signal.h>
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
- #include <linux/mutex.h>
- #endif
- #include <linux/poll.h>
- #include <linux/scatterlist.h>
- #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
- #include <asm/bug.h>
- #else
- #include <linux/bug.h>
- #endif
- #include <linux/videodev2.h>
- #include "osdep.h"
- #include "debug.h"
- #include "id.h"
- int SysWaitQueueHeadInit(pWait_queue_head_t *wq)
- {
- wait_queue_head_t *pWQ = kmalloc(sizeof(*pWQ), GFP_KERNEL);
- if( pWQ ) {
- init_waitqueue_head(pWQ);
- *wq = (pWait_queue_head_t) pWQ;
- return 0;
- }
- *wq = NULL;
- return -ENOMEM;
- }
- int SysWaitQueueHeadFini(pWait_queue_head_t wq)
- {
- if( wq ) {
- kfree(wq);
- return 0;
- }
- return -EINVAL;
- }
- int SysWaitQueueInit(pWait_queue_t *wq)
- {
- DECLARE_WAITQUEUE(tmp_wait_queue, current);
- *wq = (pWait_queue_t) kmalloc(sizeof(wait_queue_t), GFP_KERNEL);
- if( !(*wq) ) return -ENOMEM;
- memcpy(*wq, &tmp_wait_queue, sizeof(wait_queue_t));
- return 0;
- }
- int SysWaitQueueFini(pWait_queue_t wq)
- {
- if( wq ) {
- kfree(wq);
- return 0;
- }
- return -EINVAL;
- }
- void SysAddWaitQueue(pWait_queue_head_t wqh, pWait_queue_t wq)
- {
- wait_queue_head_t *pWQH = (wait_queue_head_t *) wqh;
- wait_queue_t *pWQ = (wait_queue_t *) wq;
- #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13)
- pWQ->task = current;
- #else
- pWQ->private = current;
- #endif
- add_wait_queue(pWQH, pWQ);
- }
- void SysRemoveWaitQueue(pWait_queue_head_t wqh, pWait_queue_t wq)
- {
- wait_queue_head_t *pWQH = (wait_queue_head_t *) wqh;
- wait_queue_t *pWQ = (wait_queue_t *) wq;
- remove_wait_queue(pWQH, pWQ);
- }
- void SysWakeUp(pWait_queue_head_t wqh)
- {
- wake_up((wait_queue_head_t *)wqh);
- }
- void SysPollWait(void *FileContext, pWait_queue_head_t head, void *pollstruct)
- {
- poll_wait((struct file *)FileContext,
- (wait_queue_head_t *)head,
- (struct poll_table_struct *)pollstruct);
- }
- int SysSpinLockInit(pSpinlock_t *slock)
- {
- spinlock_t *plock = NULL;
- #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)
- plock = kmalloc(sizeof(*plock), GFP_KERNEL);
- if( plock ) {
- *plock = SPIN_LOCK_UNLOCKED;
- *slock = (pSpinlock_t) plock;
- return 0;
- }
- #else
- plock = kmalloc(1, GFP_KERNEL);
- *slock = (pSpinlock_t) plock;
- if( plock )
- return 0;
- #endif
- *slock = NULL;
- return -ENOMEM;
- }
- void SysSpinLock(pSpinlock_t slock)
- {
- spinlock_t *lock = slock;
- if( lock==NULL ) { BUG(); return; }
- #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)
- spin_lock(lock);
- #else
- #endif
- }
- void SysSpinUnlock(pSpinlock_t slock)
- {
- spinlock_t *lock = slock;
- if( lock==NULL ) { BUG(); return; }
- #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)
- spin_unlock(lock);
- #else
- #endif
- }
- void SysSpinLockIrqsave(pSpinlock_t slock, unsigned long *flags)
- {
- spinlock_t *lock = slock;
- if( lock==NULL ) { BUG(); return; }
- #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)
- spin_lock_irqsave(lock, *flags);
- #else
- #endif
- }
- void SysSpinUnlockIrqrestore(pSpinlock_t slock, unsigned long flags)
- {
- spinlock_t *lock = slock;
- if( lock==NULL ) { BUG(); return; }
- #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)
- spin_unlock_irqrestore(lock, flags);
- #else
- #endif
- }
- int SysSpinLockFini(pSpinlock_t slock)
- {
- if( slock ) {
- kfree(slock);
- return 0;
- }
- return -EINVAL;
- }
- int SysSemInit(pSemaphore *sem, enum sem_type type)
- {
- struct semaphore *tmp;
- *sem = NULL;
- tmp = kmalloc(sizeof(struct semaphore), GFP_KERNEL);
- if( !tmp ) return -ENOMEM;
- if(st_Mutex == type) {
- init_MUTEX(tmp);
- *sem = (pSemaphore) tmp;
- }
- else if(st_MutexLocked == type) {
- init_MUTEX_LOCKED(tmp);
- *sem = (pSemaphore) tmp;
- }
- else {
- kfree(tmp);
- return -EINVAL;
- }
- return 0;
- }
- int SysSemDown(pSemaphore sem)
- {
- if(!sem) BUG();
- #if 0
- down_interruptible((struct semaphore *)sem);
- #else
- down((struct semaphore *)sem);
- #endif
- return 0;
- }
- int SysSemDownInterruptible(pSemaphore sem)
- {
- if(!sem) BUG();
- return down_interruptible((struct semaphore *)sem);
- }
- void SysSemUp(pSemaphore sem)
- {
- if(!sem) BUG();
- up((struct semaphore *)sem);
- }
- void SysSemFini(pSemaphore sem)
- {
- if(!sem) BUG();
- kfree(sem);
- }
- #if 1
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,17)
- int _SysMutexInit(pMutex *pmutex, const char *name)
- {
- *pmutex = kmalloc(sizeof(Mutex), GFP_KERNEL);
- if( *pmutex==NULL ) return -ENOMEM;
- (*pmutex)->context = kmalloc(sizeof(struct mutex), GFP_KERNEL);
- if( (*pmutex)->context==NULL ) {
- kfree((*pmutex));
- return -ENOMEM;
- }
- (*pmutex)->key = kmalloc(sizeof(struct lock_class_key), GFP_KERNEL);
- if( (*pmutex)->key==NULL ) {
- kfree((*pmutex)->context);
- kfree(*pmutex);
- return -ENOMEM;
- }
- __mutex_init((struct mutex *)(*pmutex)->context,
- name,
- (struct lock_class_key *)(*pmutex)->key);
- return 0;
- }
- void SysMutexLock(pMutex mutex)
- {
- mutex_lock((struct mutex *)mutex->context);
- }
- int SysMutexLockInterruptible(pMutex mutex)
- {
- return mutex_lock_interruptible((struct mutex *)mutex->context);
- }
- void SysMutexUnlock(pMutex mutex)
- {
- mutex_unlock((struct mutex *)mutex->context);
- }
- void SysMutexFree(pMutex mutex)
- {
- kfree(mutex->context);
- kfree(mutex->key);
- kfree(mutex);
- }
- #else
- int _SysMutexInit(pMutex *pmutex, const char *name)
- {
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
- *pmutex = kmalloc(sizeof(struct mutex), GFP_KERNEL);
- if( *pmutex==NULL ) return -ENOMEM;
- __mutex_init((struct mutex *)*pmutex, name);
- return 0;
- #else
- return SysSemInit((pSemaphore *)pmutex, st_Mutex);
- #endif
- }
- void SysMutexLock(pMutex mutex)
- {
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
- mutex_lock((struct mutex *)mutex);
- #else
- SysSemDown((pSemaphore)mutex);
- #endif
- }
- int SysMutexLockInterruptible(pMutex mutex)
- {
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
- return mutex_lock_interruptible((struct mutex *)mutex);
- #else
- return SysSemDownInterruptible((pSemaphore)mutex);
- #endif
- }
- void SysMutexUnlock(pMutex mutex)
- {
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
- mutex_unlock((struct mutex *)mutex);
- #else
- SysSemUp((pSemaphore)mutex);
- #endif
- }
- void SysMutexFree(pMutex mutex)
- {
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
- kfree(mutex);
- #else
- SysSemFini((pSemaphore)mutex);
- #endif
- }
- #endif
- #endif
- void SysJSleep(unsigned long j)
- {
- set_current_state(TASK_UNINTERRUPTIBLE);
- schedule_timeout(j);
- }
- void SysMSleep(int miliSec)
- {
- unsigned long j = (HZ*miliSec)/1000;
- set_current_state(TASK_UNINTERRUPTIBLE);
- schedule_timeout(j);
- }
- void SysUSleep(int microSec)
- {
- udelay(microSec);
- }
- void SysMDelay(int miliSec)
- {
- mdelay(miliSec);
- }
- int SysInAtomic(void)
- {
- if(in_atomic() || irqs_disabled()) {
- return 1;
- }
- else {
- return 0;
- }
- }
- void * SysKMalloc(unsigned int size, kmalloc_type flag)
- {
- u32 type;
- void *ptr = NULL;
- if(in_atomic() || irqs_disabled()) {
- flag = eKMALLOC_ATOMIC;
- }
- switch( flag ) {
- case eKMALLOC_ATOMIC:
- type = GFP_ATOMIC;
- break;
- case eKMALLOC_KERNEL:
- type = GFP_KERNEL;
- break;
- case eKMALLOC_DMA:
- type = GFP_DMA;
- break;
- default:
- return ptr;
- }
- if(in_atomic()) type = GFP_ATOMIC;
- ptr = kmalloc(size, type);
- if( ptr ) memset(ptr, 0, size);
- DBG_OSDEP("kmalloc %s @ %p\n",
- (GFP_DMA==type)? "DMA" :
- (GFP_KERNEL==type)? "KERN" :
- (GFP_ATOMIC==type)? "ATOMIC" : "Unknown",
- ptr);
- return ptr;
- }
- void SysKFree(void *ptr)
- {
- DBG_OSDEP("kfree %p\n", ptr);
- if(!ptr) BUG();
- kfree(ptr);
- }
- void SysMemSet(void *ptr, unsigned char val, unsigned int size)
- {
- memset(ptr, val, size);
- }
- void *SysMemCpy(void *dest, const void *src, unsigned int size)
- {
- return memcpy(dest, src, size);
- }
- int SysMemCmp(const void *dest, const void *src, unsigned int size)
- {
- return memcmp(dest, src, size);
- }
- void *SysReAlloc(void *ptr, unsigned int oldsize, unsigned int newsize)
- {
- void *newptr = NULL;
- newptr = SysKMalloc(newsize, eKMALLOC_KERNEL);
- SysMemCpy(newptr, ptr, oldsize);
- SysKFree(ptr);
- return newptr;
- }
- void *SysMemMove(void *ptr, const void *src, unsigned int size)
- {
- return memmove(ptr, src, size);
- }
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,8)
- int SysPrintk(const char *fmt, ...)
- {
- va_list args;
- int ret;
- va_start(args, fmt);
- ret = vprintk(fmt, args);
- va_end(args);
- #if 0
- if(SysInAtomic())
- SysMDelay(500);
- else
- SysMSleep(500);
- #endif
- return ret;
- }
- int SysVPrintk(const char *fmt, va_list args)
- {
- return vprintk(fmt, args);
- }
- #else
- static spinlock_t logbuf_lock = SPIN_LOCK_UNLOCKED;
- static char logbuf[1024];
- int SysPrintk(const char *fmt, ...)
- {
- va_list args;
- int ret;
- va_start(args, fmt);
- ret = SysVPrintk(fmt, args);
- va_end(args);
- return ret;
- }
- int SysVPrintk(const char *fmt, va_list args)
- {
- int ret;
- unsigned long flags;
- spin_lock_irqsave(&logbuf_lock, flags);
- ret = vsprintf(logbuf, fmt, args);
- spin_unlock_irqrestore(&logbuf_lock, flags);
- ret = printk(logbuf);
- return ret;
- }
- #endif
- int SysSnPrintf(char *buf, unsigned int size, const char *fmt, ...)
- {
- va_list args;
- int i;
- va_start(args, fmt);
- i=vsnprintf(buf, size, fmt, args);
- va_end(args);
- return i;
- }
- #if 0
- void SysKrefInit(pKref *ppkref)
- #else
- void SysKrefInit(pKref *ppkref, cb_kref cb_func)
- #endif
- {
- struct kref *pkref;
- pkref = kmalloc(sizeof(*pkref), GFP_KERNEL);
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,8)
- if( pkref ) kref_init(pkref);
- #else
- if( pkref ) kref_init(pkref, (void (*)(struct kref *))cb_func);
- #endif
- *ppkref = pkref;
- }
- void SysKrefPut(pKref kref, cb_kref cb_func)
- {
- struct kref *pkref = (struct kref *) kref;
- DBG_fOSDEP("pkfre=%p, func=%p\n", pkref, cb_func);
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,8)
- kref_put(pkref, (void (*)(struct kref *))cb_func);
- #else
- kref_put(pkref);
- #endif
- }
- void SysKrefGet(pKref kref)
- {
- struct kref *pkref = (struct kref *) kref;
- DBG_fOSDEP("pkfre=%p, func=%p\n", pkref);
- kref_get(pkref);
- }
- void SysKrefFree(pKref kref)
- {
- if(!kref) BUG();
- kfree(kref);
- }
- void SysLockKernel()
- {
- lock_kernel();
- }
- void SysUnlockKernel()
- {
- unlock_kernel();
- }
- unsigned long SysCopyToUser(void *to, const void *from, unsigned long n)
- {
- return copy_to_user(to, from, n);
- }
- unsigned long SysCopyFromUser(void *to, const void *from, unsigned long n)
- {
- return copy_from_user(to, from, n);
- }
- unsigned int SysStrLen(const char *str)
- {
- return strlen(str);
- }
- unsigned long SysSimpleStrtoul(const char *cp,char **endp,unsigned int base)
- {
- return simple_strtoul(cp, endp, base);
- }
- char *SysStrNCpy(char *dest, const char *src, size_t count)
- {
- return strncpy(dest, src, count);
- }
- void SysSetCurrentState(int state)
- {
- int tmp;
- switch( state ) {
- case PROC_RUNNING:
- tmp = TASK_RUNNING; break;
- case PROC_INTERRUPTIBLE:
- tmp = TASK_INTERRUPTIBLE; break;
- case PROC_UNINTERRUPTIBLE:
- tmp = TASK_UNINTERRUPTIBLE; break;
- default:
- DBG_OSDEP("Task state unknown\n");
- return;
- }
- set_current_state(tmp);
- }
- int SysSignalPending(void)
- {
- return signal_pending(current);
- }
- void SysSchedule(void)
- {
- schedule();
- }
- signed long SysScheduleTimeout(signed long timeout)
- {
- return schedule_timeout(timeout);
- }
- unsigned long SysGetHZ(void)
- {
- return HZ;
- }
- void SysGetPageParam(unsigned int *pg_sz, unsigned int *pg_shift)
- {
- if( pg_sz ) *pg_sz = PAGE_SIZE;
- if( pg_shift ) *pg_shift = PAGE_SHIFT;
- }
- pPage SysVmallocToPage(u8 *va)
- {
- struct page *p = vmalloc_to_page(va);
- return (pPage) p;
- }
- void *SysPageAddress(pPage pg)
- {
- return page_address((struct page *)pg);
- }
- int SysPageHighMem(pPage pg)
- {
- struct page *p = (struct page *)pg;
- REF_PARAM(p);
- return PageHighMem(p);
- }
- void SysGetPage(pPage pg)
- {
- struct page *p = (struct page *)pg;
- get_page(p);
- }
- void SysPciDmaSyncSingleForCpu(pPci_dev pci, dma_addr_t pa, int size,
- dma_type_t type)
- {
- pci_dma_sync_single_for_cpu(pci, pa, size, type);
- }
- void SysPciDmaSyncSgForCpu(pPci_dev pci, pScatterlist pSGList, int count,
- dma_type_t type)
- {
- struct scatterlist *sg = (struct scatterlist *)pSGList;
- pci_dma_sync_sg_for_cpu(pci, sg, count, type);
- }
- void SysFillSG(pScatterlist pSGList, int i, pPage pg, int sz)
- {
- struct scatterlist *sg = (struct scatterlist *)pSGList;
- #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,23)
- sg[i].page = (struct page *) pg;
- sg[i].length = sz;
- #else
- sg_set_page(sg+i, pg, sz, 0);
- #endif
- }
- dma_addr_t SysGetSgDmaAddress(pScatterlist pSG, int i)
- {
- struct scatterlist *sg = (struct scatterlist *)pSG;
- return sg_dma_address(&sg[i]);
- }
- size_t SysGetSgDmaLen(pScatterlist pSG, int i)
- {
- struct scatterlist *sg = (struct scatterlist *)pSG;
- return sg_dma_len(&sg[i]);
- }
- pPage SysGetSgPage(pScatterlist pSG, int i)
- {
- struct scatterlist *sg = (struct scatterlist *)pSG;
- #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,23)
- return sg[i].page;
- #else
- return sg_page(sg+i);
- #endif
- }
- void SysSetSgDmaAddress(pScatterlist pSG, int i, dma_addr_t pa)
- {
- struct scatterlist *sg = (struct scatterlist *)pSG;
- sg_dma_address(&sg[i]) = pa;
- }
- void SysSetSgDmaLen(pScatterlist pSG, int i, size_t len)
- {
- struct scatterlist *sg = (struct scatterlist *)pSG;
- sg_dma_len(&sg[i]) = len;
- }
- pScatterlist SysSGAlloc(int count)
- {
- struct scatterlist *sg =
- SysKMalloc(sizeof(*sg)*count, eKMALLOC_KERNEL);
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,23)
- if( sg ) sg_init_table(sg, count);
- #endif
- return (pScatterlist)sg;
- }
- int SysPciMapSg(pPci_dev pci, pScatterlist pSG, int entry, dma_type_t type)
- {
- enum dma_data_direction dir = DMA_NONE;
- switch( type ) {
- case eDMA_DEV_WRITE:
- dir = DMA_TO_DEVICE;
- break;
- case eDMA_DEV_READ:
- dir = DMA_FROM_DEVICE;
- break;
- default:
- return -EINVAL;
- }
- return pci_map_sg((struct pci_dev *)pci, (struct scatterlist *)pSG,
- entry, dir);
- }
- void SysPciUnmapSg(pPci_dev pci, pScatterlist pSG, int entry, dma_type_t type)
- {
- enum dma_data_direction dir = DMA_NONE;
- switch( type ) {
- case eDMA_DEV_WRITE:
- dir = DMA_TO_DEVICE;
- break;
- case eDMA_DEV_READ:
- dir = DMA_FROM_DEVICE;
- break;
- default:
- return;
- }
- pci_unmap_sg((struct pci_dev *)pci, (struct scatterlist *)pSG,
- entry, dir);
- }
- dma_addr_t SysPciMapSingle(pPci_dev pci, void *va, int size, dma_type_t type)
- {
- dma_addr_t pa = (dma_addr_t)0;
- enum dma_data_direction dir = DMA_NONE;
- switch( type ) {
- case eDMA_DEV_WRITE:
- dir = DMA_TO_DEVICE;
- break;
- case eDMA_DEV_READ:
- dir = DMA_FROM_DEVICE;
- break;
- default:
- return pa;
- }
- pa = pci_map_single((struct pci_dev *)pci, va, size, dir);
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,26)
- if( pci_dma_mapping_error((struct pci_dev *)pci, pa) ) pa = (dma_addr_t)0;
- #else
- if( pci_dma_mapping_error(pa) ) pa = (dma_addr_t)0;
- #endif
- return pa;
- }
- void SysPciUnmapSingle(pPci_dev pci, dma_addr_t pa, int size, dma_type_t type)
- {
- enum dma_data_direction dir = DMA_NONE;
- switch( type ) {
- case eDMA_DEV_WRITE:
- dir = DMA_TO_DEVICE;
- break;
- case eDMA_DEV_READ:
- dir = DMA_FROM_DEVICE;
- break;
- default:
- return;
- }
- pci_unmap_single((struct pci_dev *)pci, pa, size, dir);
- }
- void *SysPciAllocConsistent(pPci_dev pci, size_t sz, dma_addr_t *pa)
- {
- return pci_alloc_consistent((struct pci_dev *)pci, sz, pa);
- }
- void SysPciFreeConsistent(pPci_dev pci, size_t sz, void *va, dma_addr_t pa)
- {
- return pci_free_consistent((struct pci_dev *)pci, sz, va, pa);
- }
- int SysPciEnableDevice(pPci_dev pci)
- {
- return pci_enable_device((struct pci_dev *)pci);
- }
- void SysPciSetMaster(pPci_dev pci)
- {
- pci_set_master((struct pci_dev *)pci);
- }
- int SysPciMMIOMap(pPci_dev pci, int resource, const char *devname,
- unsigned long *mmio, unsigned int *mmio_size)
- {
- int err = 0;
- struct pci_dev *pci_dev = (struct pci_dev *)pci;
- DBG_OSDEP("pci=0x%p, resource=%d, name=%s\n", pci, resource, devname);
- if (!request_mem_region(pci_resource_start(pci_dev, resource),
- pci_resource_len(pci_dev, resource),
- devname)) {
- DBG_OSDEP("request_mem_region failed, err=%d\n", err);
- err = -EBUSY;
- goto done;
- }
- *mmio = (unsigned long)ioremap(pci_resource_start(pci_dev, resource),
- pci_resource_len(pci_dev, resource));
- if(!(*mmio)) {
- DBG_OSDEP("ioremap failed\n");
- err = -ENOMEM;
- }
- *mmio_size = pci_resource_len(pci_dev, resource);
- DBG_OSDEP("done, mmio=0x%lx, size=%d\n", *mmio, *mmio_size);
- done:
- return err;
- }
- void SysPciMMIOUnMap(pPci_dev pci, int resource, unsigned long mmio)
- {
- struct pci_dev *pci_dev = (struct pci_dev *)pci;
- DBG_OSDEP("pci=0x%p, resource=%d, mmio=0x%lx\n", pci, resource,
- mmio);
- iounmap((void *)mmio);
- release_mem_region(pci_resource_start(pci_dev, resource),
- pci_resource_len(pci_dev, resource));
- }
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,8)
- unsigned int SysIORead32(void *addr)
- {
- return ioread32(addr);
- }
- void SysIOWrite32(void *addr, unsigned int val)
- {
- iowrite32(val, addr);
- }
- unsigned int SysIORead16(void *addr)
- {
- return ioread16(addr);
- }
- void SysIOWrite16(void *addr, unsigned int val)
- {
- iowrite16(val, addr);
- }
- unsigned int SysIORead8(void *addr)
- {
- return ioread8(addr);
- }
- void SysIOWrite8(void *addr, unsigned int val)
- {
- iowrite8(val, addr);
- }
- #else
- unsigned int SysIORead32(void *addr)
- {
- return readl(addr);
- }
- void SysIOWrite32(void *addr, unsigned int val)
- {
- return writel(val, addr);
- }
- unsigned int SysIORead16(void *addr)
- {
- return readw(addr);
- }
- void SysIOWrite16(void *addr, unsigned int val)
- {
- return writew(val, addr);
- }
- unsigned int SysIORead8(void *addr)
- {
- return readb(addr);
- }
- void SysIOWrite8(void *addr, unsigned int val)
- {
- return writeb(val, addr);
- }
- #endif
- int SysPciReadCfgByte(pPci_dev pci, unsigned int w, u8 *v)
- {
- return pci_read_config_byte((struct pci_dev *)pci, w, v);
- }
- int SysPciReadCfgWord(pPci_dev pci, unsigned int w, u16 *v)
- {
- return pci_read_config_word((struct pci_dev *)pci, w, v);
- }
- int SysPciReadCfgDWord(pPci_dev pci, unsigned int w, u32 *v)
- {
- return pci_read_config_dword((struct pci_dev *)pci, w, v);
- }
- int SysPciWriteCfgByte(pPci_dev pci, unsigned int w, u8 v)
- {
- return pci_write_config_byte((struct pci_dev *)pci, w, v);
- }
- int SysPciWriteCfgWord(pPci_dev pci, unsigned int w, u16 v)
- {
- return pci_write_config_word((struct pci_dev *)pci, w, v);
- }
- int SysPciWriteCfgDWord(pPci_dev pci, unsigned int w, u32 v)
- {
- return pci_write_config_dword((struct pci_dev *)pci, w, v);
- }
- unsigned short SysPciVendorId(pPci_dev pci)
- {
- return ((struct pci_dev *)pci)->vendor;
- }
- unsigned short SysPciDeviceId(pPci_dev pci)
- {
- return ((struct pci_dev *)pci)->device;
- }
- unsigned short SysPciSubVendorId(pPci_dev pci)
- {
- return ((struct pci_dev *)pci)->subsystem_vendor;
- }
- unsigned short SysPciSubDeviceId(pPci_dev pci)
- {
- return ((struct pci_dev *)pci)->subsystem_device;
- }
- void *SysPciGetDevice(pPci_dev pci)
- {
- return &((struct pci_dev *)pci)->dev;
- }
- void SysPciSetDrvData(pPci_dev pci, void *data)
- {
- pci_set_drvdata((struct pci_dev *)pci, data);
- }
- void *SysPciGetDrvData(pPci_dev pci)
- {
- return pci_get_drvdata((struct pci_dev *)pci);
- }
- unsigned int SysPciGetIrq(pPci_dev pci)
- {
- return ((struct pci_dev *)pci)->irq;
- }
- void SysPciGetId(pPci_dev pci, unsigned short *vendor,
- unsigned short *device, unsigned short *subvendor,
- unsigned short *subdevice)
- {
- if( !pci )
- return;
- if(vendor)
- *vendor = ((struct pci_dev *)pci)->vendor;
- if(device)
- *device = ((struct pci_dev *)pci)->device;
- if(subvendor)
- *subvendor = ((struct pci_dev *)pci)->subsystem_vendor;
- if(subdevice)
- *subdevice = ((struct pci_dev *)pci)->subsystem_device;
- }
- const char *SysPciName(pPci_dev pci)
- {
- return pci_name((struct pci_dev *)pci);
- }
- u8 *SysVmalloc32(unsigned long size)
- {
- return vmalloc_32(size);
- }
- void SysVFree(void *addr)
- {
- vfree(addr);
- }
- int SysInitTimer(pTimer_list *pTimer)
- {
- struct timer_list *timer = kmalloc(sizeof(*timer), GFP_KERNEL);
- *pTimer = (pTimer_list) timer;
- if( timer ) {
- init_timer(timer);
- return 0;
- }
- return -ENOMEM;
- }
- void SysFillTimer(pTimer_list Timer, cb_timer func, void *data)
- {
- struct timer_list *timer = (struct timer_list *)Timer;
- timer->function = func;
- timer->data = (unsigned long)data;
- }
- int SysModTimer(pTimer_list Timer, unsigned long ms)
- {
- ms *= HZ;
- ms /= 1000;
- return mod_timer((struct timer_list *)Timer, ms+jiffies);
- }
- int SysDelTimer(pTimer_list Timer)
- {
- return del_timer_sync((struct timer_list *)Timer);
- }
- unsigned long SysGetJiffies(void)
- {
- return jiffies;
- }
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
- struct jump_struct
- {
- struct work_struct w;
- void *data;
- cb_workqueue func;
- };
- static void work_handler(struct work_struct *work)
- {
- struct jump_struct *tmp = list_entry(work, struct jump_struct, w);
- void *user_data = tmp->data;
- cb_workqueue user_handler = tmp->func;
- user_handler(user_data);
- }
- #endif
- int SysInitWork(pWorkStruct *work, cb_workqueue func, void *data)
- {
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
- struct jump_struct *jump;
- jump = SysKMalloc(sizeof(struct jump_struct), eKMALLOC_KERNEL);
- memset(jump,0,sizeof(jump));
- jump->data = data;
- jump->func = func;
- *work = (pWorkStruct) (jump);
- INIT_WORK( &(jump->w), work_handler);
- #else
- struct work_struct *w = SysKMalloc(sizeof(*w), eKMALLOC_KERNEL);
- if( !w ) return -ENOMEM;
- *work = (pWorkStruct) w;
- INIT_WORK(w, func, data);
- #endif
- return 0;
- }
- int SysSubmitWork(pWorkStruct work)
- {
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
- struct jump_struct *j = (struct jump_struct*)work;
- return schedule_work(&(j->w));
- #else
- struct work_struct *w = (struct work_struct *)work;
- return schedule_work(w);
- #endif
- }
- void SysFlushWork(void)
- {
- flush_scheduled_work();
- }
- struct IrqContext
- {
- unsigned int irq;
- KIrqHandler handler;
- void* data;
- };
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
- static irqreturn_t irq_handler(int irq, void *context)
- #else
- static irqreturn_t irq_handler(int irq, void *context, struct pt_regs *regs)
- #endif
- {
- int handled = 0;
- struct IrqContext *ic = context;
- if( !ic || !ic->handler ) return IRQ_RETVAL(handled);
- handled = (ic->handler(ic->data)==0)? 1 : 0;
- return IRQ_RETVAL(handled);
- }
- KIrqObject SysRequestIrq(unsigned int irq, KIrqHandler handler,
- const char *name, void *data)
- {
- int ret = 0;
- struct IrqContext *ic = SysKMalloc(sizeof(*ic), eKMALLOC_KERNEL);
- if( !ic ) return NULL;
- ic->irq = irq;
- ic->handler = handler;
- ic->data = data;
- #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
- ret = request_irq(irq, irq_handler, SA_SHIRQ|SA_INTERRUPT, name, ic);
- #else
- ret = request_irq(irq, irq_handler, IRQF_SHARED, name, ic);
- #endif
- if( ret ) {
- DBG_fOSDEP("request_irq failed with %d\n", ret);
- SysKFree(ic);
- return NULL;
- }
- return (KIrqObject)ic;
- }
- void SysFreeIrq(KIrqObject obj)
- {
- struct IrqContext *ic = obj;
- if( !ic ) return;
- free_irq(ic->irq, ic);
- SysKFree(ic);
- }
- int SysPciEnableMsi(pPci_dev pci)
- {
- #ifdef CONFIG_PCI_MSI
- struct pci_dev *pci_dev = (struct pci_dev *)pci;
- return pci_enable_msi(pci_dev);
- #else
- return 0;
- #endif
- }
- void SysPciDisableMsi(pPci_dev pci)
- {
- #ifdef CONFIG_PCI_MSI
- struct pci_dev *pci_dev = (struct pci_dev *)pci;
- pci_disable_msi(pci_dev);
- #else
- return;
- #endif
- }
- int SysInitCompletion(pCompletion *pobj)
- {
- struct completion *comp = kmalloc(sizeof(*comp), GFP_KERNEL);
- DBG_fOSDEP("obj=%p\n", comp);
- if( !comp ) return -ENOMEM;
- init_completion(comp);
- *pobj = (void *)comp;
- return 0;
- }
- int SysReInitCompletion(pCompletion pobj)
- {
- struct completion *comp = pobj;
- DBG_fOSDEP("obj=%p\n", comp);
- if( !comp ) return -EINVAL;
- init_completion(comp);
- return 0;
- }
- int SysCompleteAndExit(pCompletion obj, int retval)
- {
- DBG_fOSDEP("obj=%p\n", obj);
- if( !obj ) return -EINVAL;
- complete_and_exit((struct completion *)obj, retval);
- return 0;
- }
- int SysComplete(pCompletion obj)
- {
- DBG_fOSDEP("obj=%p\n", obj);
- if( !obj ) return -EINVAL;
- complete((struct completion *)obj);
- return 0;
- }
- int SysCompleteAll(pCompletion obj)
- {
- DBG_fOSDEP("obj=%p\n", obj);
- if( !obj ) return -EINVAL;
- complete_all((struct completion *)obj);
- return 0;
- }
- int SysWaitForCompletion(pCompletion obj)
- {
- DBG_fOSDEP("obj=%p\n", obj);
- wait_for_completion((struct completion *)obj);
- DBG_fOSDEP("obj=%p, done\n", obj);
- return 0;
- }
- long SysWaitForCompletionTimeout(pCompletion obj, int timeoutMiliSec)
- {
- unsigned long timeout;
- long ret;
- DBG_fOSDEP("obj=%p, timeout=%ld\n", obj, timeoutMiliSec);
- timeout = (timeoutMiliSec*HZ)/1000;
- ret = wait_for_completion_timeout((struct completion *)obj, timeout);
- DBG_fOSDEP("obj=%p, done\n", obj);
- return ret;
- }
- void SysFiniCompletion(pCompletion obj)
- {
- DBG_fOSDEP("obj=%p\n", obj);
- kfree(obj);
- }
- int SysFileFlagIsNonBlock(void *f)
- {
- struct file *file = f;
- return (file->f_flags & O_NONBLOCK);
- }
- void SysGetTimeOfDay(struct timeval *tv)
- {
- do_gettimeofday(tv);
- }
- int SysAtomicInit(pAtomic *patm)
- {
- atomic_t *pv = NULL;
- if( !patm ) return -EINVAL;
- pv = SysKMalloc(sizeof(atomic_t), eKMALLOC_KERNEL);
- if( !pv ) return -ENOMEM;
- atomic_set(pv, 0);
- *patm = (void *)pv;
- return 0;
- }
- void SysAtomicSet(pAtomic atm, int value)
- {
- atomic_set((atomic_t *)atm, value);
- }
- int SysAtomicGet(pAtomic atm)
- {
- return atomic_read((atomic_t *)atm);
- }
- void SysAtomicAdd(int value, pAtomic atm)
- {
- atomic_add(value, (atomic_t *)atm);
- }
- void SysAtomicSub(int value, pAtomic atm)
- {
- atomic_sub(value, (atomic_t *)atm);
- }
- void SysAtomicFini(pAtomic atm)
- {
- kfree(atm);
- }
- int SysAtomicAddReturn(int value, pAtomic atm)
- {
- return atomic_add_return(value, atm);
- }
- int SysAtomicSubReturn(int value, pAtomic atm)
- {
- return atomic_sub_return(value, atm);
- }
- void *SysGetCurrent(void)
- {
- return (void *)(current);
- }
- void SysSendSignalToSelf(int sig)
- {
- send_sig(sig, current, 0);
- }
- #ifndef CONFIG_CC_STACKPROTECTOR
- void __stack_chk_fail(void)
- {
- return;
- }
- #endif
- const char * aver_usb_board_name[] = {
- [DiBcom_7700] = "Dibcom 7700",
- [DiBcom_LDR7700]= "Dibcom 7700",
- [Buffalo_M803] = "M803",
- [AVer_A300] = "A300",
- [AVer_A300LDR] = "A300",
- [AVer_A302] = "A302",
- [AVer_A302LDR] = "A302",
- [AVer_A808] = "A808",
- [AVer_A808LDR] = "A808",
- [AVer_E568] = "E568",
- [AVer_B300] = "A300",
- [AVer_B302] = "A302",
- [AVer_B808] = "A808",
- [AVer_B568] = "E568",
- [AVer_A828] = "A828",
- [AVer_A301] = "A301",
- [AVer_A333] = "A333",
- [AVer_A825] = "A825",
- [AVer_C038] = "C038",
- [AVer_H8261] = "H826",
- [AVer_H8262] = "H826",
- [AVer_H826D1] = "H826D",
- [AVer_H826D2] = "H826D",
- [AVer_H826D3] = "H826D",
- [AVer_A321D] = "A321D",
- [AVer_A321] = "A321",
- [AVer_A827] = "A827",
- [AVer_A827J] = "A827",
- [AVer_A827A1] = "A827",
- [AVer_A827A2] = "A827",
- [AVer_A827A3] = "A827",
- [AVer_Max_Board_ID] = "Unknown"
- };
- const char *SysGetV4L2IOCTLName(unsigned int ioctl)
- {
- switch(ioctl) {
- case VIDIOC_QUERYCAP : return "VIDIOC_QUERYCAP";
- case VIDIOC_RESERVED : return "VIDIOC_RESERVED";
- case VIDIOC_ENUM_FMT : return "VIDIOC_ENUM_FMT";
- case VIDIOC_G_FMT : return "VIDIOC_G_FMT";
- case VIDIOC_S_FMT : return "VIDIOC_S_FMT";
- case VIDIOC_REQBUFS : return "VIDIOC_REQBUFS";
- case VIDIOC_QUERYBUF : return "VIDIOC_QUERYBUF";
- case VIDIOC_G_FBUF : return "VIDIOC_G_FBUF";
- case VIDIOC_S_FBUF : return "VIDIOC_S_FBUF";
- case VIDIOC_OVERLAY : return "VIDIOC_OVERLAY";
- case VIDIOC_QBUF : return "VIDIOC_QBUF";
- case VIDIOC_DQBUF : return "VIDIOC_DQBUF";
- case VIDIOC_STREAMON : return "VIDIOC_STREAMON";
- case VIDIOC_STREAMOFF : return "VIDIOC_STREAMOFF";
- case VIDIOC_G_PARM : return "VIDIOC_G_PARM";
- case VIDIOC_S_PARM : return "VIDIOC_S_PARM";
- case VIDIOC_G_STD : return "VIDIOC_G_STD";
- case VIDIOC_S_STD : return "VIDIOC_S_STD";
- case VIDIOC_ENUMSTD : return "VIDIOC_ENUMSTD";
- case VIDIOC_ENUMINPUT : return "VIDIOC_ENUMINPUT";
- case VIDIOC_G_CTRL : return "VIDIOC_G_CTRL";
- case VIDIOC_S_CTRL : return "VIDIOC_S_CTRL";
- case VIDIOC_G_TUNER : return "VIDIOC_G_TUNER";
- case VIDIOC_S_TUNER : return "VIDIOC_S_TUNER";
- case VIDIOC_G_AUDIO : return "VIDIOC_G_AUDIO";
- case VIDIOC_S_AUDIO : return "VIDIOC_S_AUDIO";
- case VIDIOC_QUERYCTRL : return "VIDIOC_QUERYCTRL";
- case VIDIOC_QUERYMENU : return "VIDIOC_QUERYMENU";
- case VIDIOC_G_INPUT : return "VIDIOC_G_INPUT";
- case VIDIOC_S_INPUT : return "VIDIOC_S_INPUT";
- case VIDIOC_G_OUTPUT : return "VIDIOC_G_OUTPUT";
- case VIDIOC_S_OUTPUT : return "VIDIOC_S_OUTPUT";
- case VIDIOC_ENUMOUTPUT : return "VIDIOC_ENUMOUTPUT";
- case VIDIOC_G_AUDOUT : return "VIDIOC_G_AUDOUT";
- case VIDIOC_S_AUDOUT : return "VIDIOC_S_AUDOUT";
- case VIDIOC_G_MODULATOR : return "VIDIOC_G_MODULATOR";
- case VIDIOC_S_MODULATOR : return "VIDIOC_S_MODULATOR";
- case VIDIOC_G_FREQUENCY : return "VIDIOC_G_FREQUENCY";
- case VIDIOC_S_FREQUENCY : return "VIDIOC_S_FREQUENCY";
- case VIDIOC_CROPCAP : return "VIDIOC_CROPCAP";
- case VIDIOC_G_CROP : return "VIDIOC_G_CROP";
- case VIDIOC_S_CROP : return "VIDIOC_S_CROP";
- case VIDIOC_G_JPEGCOMP : return "VIDIOC_G_JPEGCOMP";
- case VIDIOC_S_JPEGCOMP : return "VIDIOC_S_JPEGCOMP";
- case VIDIOC_QUERYSTD : return "VIDIOC_QUERYSTD";
- case VIDIOC_TRY_FMT : return "VIDIOC_TRY_FMT";
- case VIDIOC_ENUMAUDIO : return "VIDIOC_ENUMAUDIO";
- case VIDIOC_ENUMAUDOUT : return "VIDIOC_ENUMAUDOUT";
- case VIDIOC_G_PRIORITY : return "VIDIOC_G_PRIORITY";
- case VIDIOC_S_PRIORITY : return "VIDIOC_S_PRIORITY";
- case VIDIOC_G_SLICED_VBI_CAP : return "VIDIOC_G_SLICED_VBI_CAP";
- case VIDIOC_LOG_STATUS : return "VIDIOC_LOG_STATUS";
- #ifdef VIDIOC_G_EXT_CTRLS
- case VIDIOC_G_EXT_CTRLS : return "VIDIOC_G_EXT_CTRLS";
- #endif
- #ifdef VIDIOC_S_EXT_CTRLS
- case VIDIOC_S_EXT_CTRLS : return "VIDIOC_S_EXT_CTRLS";
- #endif
- #ifdef VIDIOC_TRY_EXT_CTRLS
- case VIDIOC_TRY_EXT_CTRLS : return "VIDIOC_TRY_EXT_CTRLS";
- #endif
- #ifdef VIDIOC_ENUM_FRAMESIZES
- case VIDIOC_ENUM_FRAMESIZES : return "VIDIOC_ENUM_FRAMESIZES";
- #endif
- #ifdef VIDIOC_ENUM_FRAMEINTERVALS
- case VIDIOC_ENUM_FRAMEINTERVALS : return "VIDIOC_ENUM_FRAMEINTERVALS";
- #endif
- #ifdef VIDIOC_G_ENC_INDEX
- case VIDIOC_G_ENC_INDEX : return "VIDIOC_G_ENC_INDEX";
- #endif
- #ifdef VIDIOC_ENCODER_CMD
- case VIDIOC_ENCODER_CMD : return "VIDIOC_ENCODER_CMD";
- #endif
- #ifdef VIDIOC_TRY_ENCODER_CMD
- case VIDIOC_TRY_ENCODER_CMD : return "VIDIOC_TRY_ENCODER_CMD";
- #endif
- #ifdef VIDIOC_G_CHIP_IDENT
- case VIDIOC_G_CHIP_IDENT : return "VIDIOC_G_CHIP_IDENT";
- #endif
- #ifdef VIDIOC_S_HW_FREQ_SEEK
- case VIDIOC_S_HW_FREQ_SEEK : return "VIDIOC_S_HW_FREQ_SEEK";
- #endif
- #ifdef __OLD_VIDIOC_
- case VIDIOC_OVERLAY_OLD : return "VIDIOC_OVERLAY_OLD";
- case VIDIOC_S_PARM_OLD : return "VIDIOC_S_PARM_OLD";
- case VIDIOC_S_CTRL_OLD : return "VIDIOC_S_CTRL_OLD";
- case VIDIOC_G_AUDIO_OLD : return "VIDIOC_G_AUDIO_OLD";
- case VIDIOC_G_AUDOUT_OLD : return "VIDIOC_G_AUDOUT_OLD";
- case VIDIOC_CROPCAP_OLD : return "VIDIOC_CROPCAP_OLD";
- #endif
- default: return "Unknown IOCtrl";
- }
- return "Unknown IOCtrl";
- }
Advertisement
Add Comment
Please, Sign In to add comment