me8100.h
changeset 22 7b722739e329
parent 14 c3f6d5e9713a
child 24 24a49943680f
--- a/me8100.h	Thu Jan 24 18:53:47 2002 +0100
+++ b/me8100.h	Fri Jan 25 16:55:00 2002 +0100
@@ -196,18 +196,14 @@
 
 #ifdef __KERNEL__
 
+#define MAX_SUBDEVICES		  2	/* ME8100 has port A and port B */
+
 typedef enum {  
   ME8100_A, 
   ME8100_B
 } me8100_version_enum_type; 
 
-/* private data: data that are to be stored in the file pointer we
- * get from the calling process. */
-struct me8100_private_data {
-  unsigned long last_read;	   /* jiffies */
-};
-
-struct me8100_subinfo {
+typedef struct me8100_subinfo {
   unsigned int regbase;
   unsigned short ctrl_reg;
   unsigned long last_change;
@@ -224,7 +220,7 @@
 
   struct fasync_struct *fasync_ptr;
   wait_queue_head_t readq;
-};
+} me8100_subinfo_t;
 
 typedef struct{
   int board_count;                  /* index of the board after detection    */
@@ -243,8 +239,16 @@
   char int_line;                    /* IRQ assigned from the PCI BIOS        */
   int board_in_use;                 /* Indicates if board is already in use  */
   struct file *file_ptr;            /* Pointer to file structure of path     */
-  struct me8100_subinfo subinfo[2];   /* .hs */
-} me8100_info_type;
+  struct me8100_subinfo subinfo[MAX_SUBDEVICES];   /* .hs */
+} me8100_info_t;
+
+/* private data: data that are to be stored in the file pointer we
+ * get from the calling process. */
+typedef struct me8100_private_data {
+  unsigned long last_read;	    /* jiffies */
+  me8100_info_t *info;	    /* for faster access */
+  struct me8100_subinfo *subinfo;   /* for faster access */
+} me8100_private_data_t;
 
 #endif	/* __KERNEL__ */
 
@@ -282,7 +286,7 @@
 #define ME8100_INT_OCCUR        _IOR(ME8100_MAGIC, 25, me8100_int_occur_type)
 #define ME8100_SETUP_ICSR       _IOW(ME8100_MAGIC, 26, unsigned char)
 #define ME8100_READ_ICSR        _IOR(ME8100_MAGIC, 27, unsigned char)
-#define ME8100_GET_BOARD_INFO   _IOR(ME8100_MAGIC, 28, me8100_info_type)
+#define ME8100_GET_BOARD_INFO   _IOR(ME8100_MAGIC, 28, me8100_info_t)
 #define ME8100_GET_INT_COUNT    _IOR(ME8100_MAGIC, 29, me8100_int_occur_type)
 
 #define ME8100_WRITE_DO		_IOR(ME8100_MAGIC, 30, unsigned short)