diff options
author | Roman Yeryomin <roman@advem.lv> | 2012-09-13 00:40:35 +0300 |
---|---|---|
committer | Roman Yeryomin <roman@advem.lv> | 2013-05-26 00:44:46 +0300 |
commit | a27354c9021a8423ef8c7d2bffad49cbf639eec1 (patch) | |
tree | 2355929a4b8cf1888cd0797cfabdb42e0077c524 /target/linux/realtek/files/drivers/net/rtl819x/rtl_glue.c | |
parent | 24a776baeb5d3cd903b144c89ceb11c5bc36a49e (diff) |
Add realtek target files
Signed-off-by: Roman Yeryomin <roman@advem.lv>
Diffstat (limited to 'target/linux/realtek/files/drivers/net/rtl819x/rtl_glue.c')
-rw-r--r-- | target/linux/realtek/files/drivers/net/rtl819x/rtl_glue.c | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/target/linux/realtek/files/drivers/net/rtl819x/rtl_glue.c b/target/linux/realtek/files/drivers/net/rtl819x/rtl_glue.c new file mode 100644 index 000000000..00c631a2b --- /dev/null +++ b/target/linux/realtek/files/drivers/net/rtl819x/rtl_glue.c @@ -0,0 +1,99 @@ +/* +* Copyright c Realtek Semiconductor Corporation, 2002 +* All rights reserved. +* +* Program : Implementation of Glue Functions of Model Code +* Abstract : +* Author : Louis Yung-Chieh Lo (yjlou@realtek.com.tw) +* $Id: rtl_glue.c,v 1.5 2008/04/11 10:12:38 bo_zhao Exp $ +*/ + +#include <net/rtl/rtl_types.h> +#include <net/rtl/rtl_glue.h> + +#if 0 +int rtl_down_interruptible(struct semaphore * sem) +{ + //return 0; + return down_interruptible(sem); +} + +void rtl_up(struct semaphore * sem) +{ + up(sem); +} + +int32 rtlglue_drvMutexLock(void) +{ +#if 0 + spinlock_t lockForCC = SPIN_LOCK_UNLOCKED; + int flagsForCC; + int needLock; + + spin_lock_irqsave(&lockForCC,flagsForCC); + + needLock = (int_cc >= 1)?FALSE:TRUE; + int_cc ++; + + if ( needLock == TRUE ) + { + uint32 dummy; + saveGimr = READ_MEM32( GIMR ); + +#if defined (CONFIG_RTK_VOIP_DRIVERS_PCM865xC) + WRITE_MEM32( GIMR, 0x00080000 ); /* Note: DO NOT disable PCM interrupt because users might be already on the phone call at this time + ==> Keep PCM interrupt enable for RTK VoIP applications + ==> RTL865xC, bit19: PCM_IE + */ +#elif defined (CONFIG_RTK_VOIP_DRIVERS_PCM8651) + WRITE_MEM32( GIMR, 0x00040000 ); /* RTL865xB, bit18: PCM_IE */ +#else + WRITE_MEM32( GIMR, 0 ); +#endif + /* + For RLX5181, LW/SW for external IPs (ex. GIMR) would be slow because one + CMD queue is implement. + + So, we would always read GIMR back before calling <spin_unlock_irqrestore()> to + make sure GIMR has be set before spin-unlock. + */ + dummy = READ_MEM32( GIMR ); + + } + + spin_unlock_irqrestore(&lockForCC, flagsForCC); +#endif + return 0; +} + +int32 rtlglue_drvMutexUnlock(void) +{ +#if 0 + spinlock_t lockForCC = SPIN_LOCK_UNLOCKED; + int flagsForCC; + int needUnlock; + + spin_lock_irqsave(&lockForCC,flagsForCC); + + int_cc--; + needUnlock = ( int_cc==0 )?TRUE:FALSE; + + if ( needUnlock == TRUE ) + { + WRITE_MEM32( GIMR, saveGimr ); + /* + For RLX5181, LW/SW for external IPs (ex. GIMR) would be slow because one + CMD queue is implement. + + So, we would always read GIMR back before calling <spin_unlock_irqrestore()> to + make sure GIMR has be set before spin-unlock. + */ + saveGimr = READ_MEM32( GIMR ); + } + + spin_unlock_irqrestore(&lockForCC, flagsForCC); +#endif + return 0; +} +#endif + |