~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Linux/drivers/char/ip2.c

Version: ~ [ 2.4.0 ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // ip2.c
  2 // This is a dummy module to make the firmware available when needed
  3 // and allows it to be unloaded when not. Rumor is the __initdata 
  4 // macro doesn't always works on all platforms so we use this kludge.
  5 // If not compiled as a module it just makes fip_firm avaliable then
  6 //  __initdata should work as advertized
  7 //
  8 
  9 #include <linux/config.h>
 10 #include <linux/module.h>
 11 #include <linux/version.h>
 12 #include <linux/init.h>
 13 #include <linux/wait.h>
 14 
 15 #ifndef __init
 16 #define __init
 17 #endif
 18 #ifndef __initfunc
 19 #define __initfunc(a) a
 20 #endif
 21 #ifndef __initdata
 22 #define __initdata
 23 #endif
 24 
 25 #include "./ip2/ip2types.h"             
 26 #include "./ip2/fip_firm.h"             // the meat
 27 
 28 int
 29 ip2_loadmain(int *, int  *, unsigned char *, int ); // ref into ip2main.c
 30 
 31 #ifdef MODULE
 32 #if defined(CONFIG_MODVERSIONS) && !defined(MODVERSIONS)
 33 #       define MODVERSIONS
 34 #endif
 35 #ifdef MODVERSIONS
 36 #       include <linux/modversions.h>
 37 #endif
 38 
 39 static int io[IP2_MAX_BOARDS]= { 0,};
 40 static int irq[IP2_MAX_BOARDS] = { 0,}; 
 41 
 42 #       if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0)
 43                 MODULE_AUTHOR("Doug McNash");
 44                 MODULE_DESCRIPTION("Computone IntelliPort Plus Driver");
 45                 MODULE_PARM(irq,"1-"__MODULE_STRING(IP2_MAX_BOARDS) "i");
 46                 MODULE_PARM_DESC(irq,"Interrupts for IntelliPort Cards");
 47                 MODULE_PARM(io,"1-"__MODULE_STRING(IP2_MAX_BOARDS) "i");
 48                 MODULE_PARM_DESC(io,"I/O ports for IntelliPort Cards");
 49 #       endif   /* LINUX_VERSION */
 50 
 51 
 52 //======================================================================
 53 int
 54 init_module(void)
 55 {
 56         int rc;
 57 
 58         MOD_INC_USE_COUNT;      // hold till done 
 59                 
 60         rc = ip2_loadmain(io,irq,(unsigned char *)fip_firm,sizeof(fip_firm));
 61         // The call to lock and load main, create dep 
 62 
 63         MOD_DEC_USE_COUNT;      //done - kerneld now can unload us
 64         return rc;
 65 }
 66 
 67 //======================================================================
 68 int
 69 ip2_init(void)
 70 {
 71         // call to this is int tty_io.c so we need this
 72         return 0;
 73 }
 74 
 75 //======================================================================
 76 void
 77 cleanup_module(void) 
 78 {
 79 }
 80 
 81 #else   // !MODULE 
 82 
 83 #ifndef NULL
 84 # define NULL           ((void *) 0)
 85 #endif
 86 
 87 int
 88 ip2_init(void) {
 89         return ip2_loadmain(NULL,NULL,(unsigned char *)fip_firm,sizeof(fip_firm));
 90 }
 91 
 92 #endif /* !MODULE */
 93 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.