diff options
Diffstat (limited to 'drivers/staging/epl/EplApiLinuxKernel.c')
-rw-r--r-- | drivers/staging/epl/EplApiLinuxKernel.c | 105 |
1 files changed, 9 insertions, 96 deletions
diff --git a/drivers/staging/epl/EplApiLinuxKernel.c b/drivers/staging/epl/EplApiLinuxKernel.c index 05ca0628d6a..cb3e275e3aa 100644 --- a/drivers/staging/epl/EplApiLinuxKernel.c +++ b/drivers/staging/epl/EplApiLinuxKernel.c @@ -72,9 +72,6 @@ // kernel modul and driver -//#include <linux/version.h> -//#include <linux/config.h> - #include <linux/module.h> #include <linux/fs.h> #include <linux/cdev.h> @@ -92,25 +89,11 @@ #include <asm/uaccess.h> #include <linux/vmalloc.h> -#ifdef CONFIG_DEVFS_FS -#include <linux/major.h> -#include <linux/devfs_fs_kernel.h> -#endif - #include "Epl.h" #include "EplApiLinux.h" //#include "kernel/EplPdokCal.h" #include "proc_fs.h" -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) - // remove ("make invisible") obsolete symbols for kernel versions 2.6 - // and higher -#define MOD_INC_USE_COUNT -#define MOD_DEC_USE_COUNT -#define EXPORT_NO_SYMBOLS -#else -#error "This driver needs a 2.6.x kernel or higher" -#endif /***************************************************************************/ /* */ @@ -139,7 +122,7 @@ MODULE_DESCRIPTION("EPL API driver"); // TracePoint support for realtime-debugging #ifdef _DBG_TRACE_POINTS_ -void PUBLIC TgtDbgSignalTracePoint(BYTE bTracePointNumber_p); +void TgtDbgSignalTracePoint(u8 bTracePointNumber_p); #define TGT_DBG_SIGNAL_TRACE_POINT(p) TgtDbgSignalTracePoint(p) #else #define TGT_DBG_SIGNAL_TRACE_POINT(p) @@ -159,19 +142,10 @@ void PUBLIC TgtDbgSignalTracePoint(BYTE bTracePointNumber_p); // Global variables //--------------------------------------------------------------------------- -#ifdef CONFIG_DEVFS_FS - - // driver major number -static int nDrvMajorNumber_g; - -#else - // device number (major and minor) static dev_t nDevNum_g; static struct cdev *pEpl_cdev_g; -#endif - static volatile unsigned int uiEplState_g = EPL_STATE_NOTOPEN; static struct semaphore SemaphoreCbEvent_g; // semaphore for EplLinCbEvent @@ -204,11 +178,11 @@ typedef struct { // Prototypes of internal functions //--------------------------------------------------------------------------- -tEplKernel PUBLIC EplLinCbEvent(tEplApiEventType EventType_p, // IN: event type (enum) - tEplApiEventArg * pEventArg_p, // IN: event argument (union) - void GENERIC * pUserArg_p); +tEplKernel EplLinCbEvent(tEplApiEventType EventType_p, // IN: event type (enum) + tEplApiEventArg *pEventArg_p, // IN: event argument (union) + void *pUserArg_p); -tEplKernel PUBLIC EplLinCbSync(void); +tEplKernel EplLinCbSync(void); static int __init EplLinInit(void); static void __exit EplLinExit(void); @@ -226,8 +200,6 @@ static int EplLinIoctl(struct inode *pDeviceFile_p, struct file *pInstance_p, // Kernel Module specific Data Structures //--------------------------------------------------------------------------- -EXPORT_NO_SYMBOLS; - module_init(EplLinInit); module_exit(EplLinExit); @@ -259,9 +231,6 @@ static int __init EplLinInit(void) tEplKernel EplRet; int iErr; int iRet; -#ifdef CONFIG_DEVFS_FS - int nMinorNumber; -#endif TRACE0("EPL: + EplLinInit...\n"); TRACE2("EPL: Driver build: %s / %s\n", __DATE__, __TIME__); @@ -275,44 +244,6 @@ static int __init EplLinInit(void) init_waitqueue_head(&WaitQueueProcess_g); init_waitqueue_head(&WaitQueueRelease_g); -#ifdef CONFIG_DEVFS_FS - - // register character device handler - TRACE2("EPL: Installing Driver '%s', Version %s...\n", - EPLLIN_DRV_NAME, EPL_PRODUCT_VERSION); - TRACE0("EPL: (using dynamic major number assignment)\n"); - nDrvMajorNumber_g = - register_chrdev(0, EPLLIN_DRV_NAME, &EplLinFileOps_g); - if (nDrvMajorNumber_g != 0) { - TRACE2 - ("EPL: Driver '%s' installed successful, assigned MajorNumber=%d\n", - EPLLIN_DRV_NAME, nDrvMajorNumber_g); - } else { - TRACE1 - ("EPL: ERROR: Driver '%s' is unable to get a free MajorNumber!\n", - EPLLIN_DRV_NAME); - iRet = -EIO; - goto Exit; - } - - // create device node in DEVFS - nMinorNumber = 0; - TRACE1("EPL: Creating device node '/dev/%s'...\n", EPLLIN_DEV_NAME); - iErr = - devfs_mk_cdev(MKDEV(nDrvMajorNumber_g, nMinorNumber), - S_IFCHR | S_IRUGO | S_IWUGO, EPLLIN_DEV_NAME); - if (iErr == 0) { - TRACE1("EPL: Device node '/dev/%s' created successful.\n", - EPLLIN_DEV_NAME); - } else { - TRACE1("EPL: ERROR: unable to create device node '/dev/%s'\n", - EPLLIN_DEV_NAME); - iRet = -EIO; - goto Exit; - } - -#else - // register character device handler // only one Minor required TRACE2("EPL: Installing Driver '%s', Version %s...\n", @@ -341,7 +272,6 @@ static int __init EplLinInit(void) iRet = -EIO; goto Exit; } -#endif // create device node in PROCFS EplRet = EplLinProcInit(); @@ -377,25 +307,12 @@ static void __exit EplLinExit(void) TRACE0("EPL: + EplLinExit...\n"); -#ifdef CONFIG_DEVFS_FS - - // remove device node from DEVFS - devfs_remove(EPLLIN_DEV_NAME); - TRACE1("EPL: Device node '/dev/%s' removed.\n", EPLLIN_DEV_NAME); - - // unregister character device handler - unregister_chrdev(nDrvMajorNumber_g, EPLLIN_DRV_NAME); - -#else - // remove cdev structure cdev_del(pEpl_cdev_g); // unregister character device handler unregister_chrdev_region(nDevNum_g, 1); -#endif - TRACE1("EPL: Driver '%s' removed.\n", EPLLIN_DRV_NAME); TRACE0("EPL: - EplLinExit\n"); @@ -416,8 +333,6 @@ static int EplLinOpen(struct inode *pDeviceFile_p, // information about the devi TRACE0("EPL: + EplLinOpen...\n"); - MOD_INC_USE_COUNT; - if (uiEplState_g != EPL_STATE_NOTOPEN) { // stack already initialized iRet = -EALREADY; } else { @@ -490,8 +405,6 @@ static int EplLinRelease(struct inode *pDeviceFile_p, // information about the d uiEplState_g = EPL_STATE_NOTOPEN; iRet = 0; - MOD_DEC_USE_COUNT; - TRACE1("EPL: - EplLinRelease (iRet=%d)\n", iRet); return (iRet); @@ -1158,9 +1071,9 @@ static int EplLinIoctl(struct inode *pDeviceFile_p, // information about the dev // // //=========================================================================// -tEplKernel PUBLIC EplLinCbEvent(tEplApiEventType EventType_p, // IN: event type (enum) - tEplApiEventArg * pEventArg_p, // IN: event argument (union) - void GENERIC * pUserArg_p) +tEplKernel EplLinCbEvent(tEplApiEventType EventType_p, // IN: event type (enum) + tEplApiEventArg *pEventArg_p, // IN: event argument (union) + void *pUserArg_p) { tEplKernel EplRet = kEplSuccessful; int iErr; @@ -1224,7 +1137,7 @@ tEplKernel PUBLIC EplLinCbEvent(tEplApiEventType EventType_p, // IN: event type return EplRet; } -tEplKernel PUBLIC EplLinCbSync(void) +tEplKernel EplLinCbSync(void) { tEplKernel EplRet = kEplSuccessful; int iErr; |