root/kernel/chr_drv/mouse.c

/* [previous][next][first][last][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. mouse_open
  2. mouse_init

   1 /*
   2  * linux/kernel/chr_drv/mouse.c
   3  *
   4  * Generic mouse open routine by Johan Myreen
   5  *
   6  * Based on code from Linus
   7  *
   8  * Teemu Rantanen's Microsoft Busmouse support and Derrick Cole's
   9  *   changes incorporated into 0.97pl4
  10  *   by Peter Cervasio (pete%q106fm.uucp@wupost.wustl.edu) (08SEP92)
  11  *   See busmouse.c for particulars.
  12  */
  13 
  14 #include <linux/fs.h>
  15 #include <linux/errno.h>
  16 #include <linux/mouse.h>
  17 
  18 extern struct file_operations bus_mouse_fops;
  19 extern struct file_operations psaux_fops;
  20 extern long bus_mouse_init(long);
  21 extern long psaux_init(long);
  22 extern long ms_bus_mouse_init(long);
  23 
  24 int mse_busmouse_type;
  25 
  26 static int mouse_open(struct inode * inode, struct file * file)
     /* [previous][next][first][last][top][bottom][index][help] */
  27 {
  28         if (MINOR(inode->i_rdev) == BUSMOUSE_MINOR)
  29                 file->f_op = &bus_mouse_fops;
  30         else if (MINOR(inode->i_rdev) == PSMOUSE_MINOR)
  31                 file->f_op = &psaux_fops;
  32         else if (MINOR(inode->i_rdev) == MS_BUSMOUSE_MINOR)
  33                 file->f_op = &bus_mouse_fops;
  34         else
  35                 return -ENODEV;
  36         mse_busmouse_type = (int) MINOR(inode->i_rdev);
  37         return file->f_op->open(inode,file);
  38 }
  39 
  40 static struct file_operations mouse_fops = {
  41         NULL,           /* seek */
  42         NULL,           /* read */
  43         NULL,           /* write */
  44         NULL,           /* readdir */
  45         NULL,           /* select */
  46         NULL,           /* ioctl */
  47         mouse_open,
  48         NULL            /* release */
  49 };
  50 
  51 long mouse_init(long kmem_start)
     /* [previous][next][first][last][top][bottom][index][help] */
  52 {
  53         kmem_start = bus_mouse_init(kmem_start);
  54         kmem_start = psaux_init(kmem_start);
  55         kmem_start = ms_bus_mouse_init(kmem_start);
  56         mse_busmouse_type = -1;
  57         chrdev_fops[10] = &mouse_fops;
  58         return kmem_start;
  59 }

/* [previous][next][first][last][top][bottom][index][help] */