Subversion Repositories shark

Rev

Rev 927 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
602 giacomo 1
/*
2
 * Project: S.Ha.R.K.
3
 *
4
 * Coordinators:
5
 *   Giorgio Buttazzo    <giorgio@sssup.it>
6
 *   Paolo Gai           <pj@gandalf.sssup.it>
7
 *
8
 * Authors     :
9
 *   Giacomo Guidi       <giacomo@gandalf.sssup.it>
10
 *
11
 *
12
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
13
 *
14
 * http://www.sssup.it
15
 * http://retis.sssup.it
16
 * http://shark.sssup.it
17
 */
18
 
1063 tullio 19
/*
20
 * This program is free software; you can redistribute it and/or modify
21
 * it under the terms of the GNU General Public License as published by
22
 * the Free Software Foundation; either version 2 of the License, or
23
 * (at your option) any later version.
24
 *
25
 * This program is distributed in the hope that it will be useful,
26
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
28
 * GNU General Public License for more details.
29
 *
30
 * You should have received a copy of the GNU General Public License
31
 * along with this program; if not, write to the Free Software
32
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
33
 *
34
 */
35
 
602 giacomo 36
/* Glue Layer for Linux PCI 2.6 Driver */
37
 
38
#include <kernel/kern.h>
39
 
40
extern int bttv_init_module(void);
618 giacomo 41
extern void bttv_cleanup_module(void);
602 giacomo 42
 
43
static int bttv_installed = FALSE;
44
 
45
/* Init the Linux BTTV 2.6 Driver */
46
int BTTV26_installed(void)
47
{
48
        return bttv_installed;
49
}
50
 
605 giacomo 51
extern int videodev_init(void);
52
 
602 giacomo 53
int BTTV26_init() {
54
 
618 giacomo 55
        int res;
56
 
602 giacomo 57
        if (bttv_installed == TRUE)
58
                return 0;
59
 
605 giacomo 60
        videodev_init();
61
 
618 giacomo 62
        res = bttv_init_module();
602 giacomo 63
 
618 giacomo 64
        if (res != 0) {
65
                sys_shutdown_message("ERROR: Cannot initialize BTTV\n");
927 pj 66
                exit(1);
618 giacomo 67
        }
68
 
602 giacomo 69
        bttv_installed = TRUE;
70
 
71
        return 0;
72
 
73
}
618 giacomo 74
 
75
int BTTV26_close() {
76
 
77
        if (bttv_installed == FALSE)
78
                return 0;
79
 
80
        bttv_cleanup_module();
81
 
82
        return 0;
83
 
84
}