Subversion Repositories shark

Rev

Rev 522 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

/*
 * Project: S.Ha.R.K.
 *
 * Coordinators:
 *   Giorgio Buttazzo    <giorgio@sssup.it>
 *   Paolo Gai           <pj@gandalf.sssup.it>
 *
 * Authors     :
 *   Mauro Marinoni      <mauro.marinoni@unipv.it>
 *   (see the web pages for full authors list)
 *
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
 *
 * http://www.sssup.it
 * http://retis.sssup.it
 * http://shark.sssup.it
 */


/*
 * Copyright (C) 2000 Paolo Gai
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */


#define __MOUSE_DEBUG__

#include <kernel/kern.h>

#include "../include/drivers/shark_input26.h"
#include "../include/drivers/shark_mouse26.h"

/* Devices */
extern int psmouse_init(void);
extern int psmouse_exit(void);

/* Handlers */
extern int  mouse_init(void);
extern void mouse_exit(void);

extern int input_installed;

/* Mouse driver currently installed */
static int mouse_installed = FALSE;

/*static PID mouse_pid = NIL;*/


/*
 * Start mouseProc Task
 */

void shark_mouse_task(void)
{
        //task_activate(mousebpid);
}


/* Init the Linux Speaker Driver */
int MOUSE26_init(void)
{
        int status = 0;

        if (mouse_installed == TRUE) return 0;

        if (input_installed == FALSE) {
                status = INPUT26_init();
                if (status) {
                        printk(KERN_ERR "shark_mouse.c: Unable to open Input SubSystem.\n");
                        return -1;
                }
        }

        status = psmouse_init();
        if (status) {
                printk(KERN_ERR "shark_mouse.c: PsMouse_Init return: %d\n", status);
                return -1;
        }

        status = mouse_init();
        if (status) {
                printk(KERN_ERR "shark_mouse.c: Mouse_Init return: %d\n", status);
                return -1;
        }
       
        mouse_installed = TRUE;
       
        return status;
}

int MOUSE26_close()
{
        if (!mouse_installed)
                return -1;

        mouse_exit();
        psmouse_exit();
       
        mouse_installed = FALSE;
       
        return 0;
}