Commit | Line | Data |
---|---|---|
dd827da1 MA |
1 | /* |
2 | Mantis PCI bridge driver | |
3 | ||
8825a097 | 4 | Copyright (C) Manu Abraham (abraham.manu@gmail.com) |
dd827da1 MA |
5 | |
6 | This program is free software; you can redistribute it and/or modify | |
7 | it under the terms of the GNU General Public License as published by | |
8 | the Free Software Foundation; either version 2 of the License, or | |
9 | (at your option) any later version. | |
10 | ||
11 | This program is distributed in the hope that it will be useful, | |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | GNU General Public License for more details. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
17 | along with this program; if not, write to the Free Software | |
18 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
19 | */ | |
20 | ||
21 | #ifndef __MANTIS_LINK_H | |
22 | #define __MANTIS_LINK_H | |
23 | ||
f684336b | 24 | #include <linux/mutex.h> |
12855cac | 25 | #include <linux/workqueue.h> |
6053240f | 26 | #include "dvb_ca_en50221.h" |
12855cac | 27 | |
dd827da1 MA |
28 | enum mantis_sbuf_status { |
29 | MANTIS_SBUF_DATA_AVAIL = 1, | |
30 | MANTIS_SBUF_DATA_EMPTY = 2, | |
31 | MANTIS_SBUF_DATA_OVFLW = 3 | |
32 | }; | |
33 | ||
34 | struct mantis_slot { | |
35 | u32 timeout; | |
d8b14f8a MA |
36 | u32 slave_cfg; |
37 | u32 bar; | |
dd827da1 MA |
38 | }; |
39 | ||
8ce571f5 MA |
40 | /* Physical layer */ |
41 | enum mantis_slot_state { | |
42 | MODULE_INSERTED = 3, | |
43 | MODULE_XTRACTED = 4 | |
44 | }; | |
45 | ||
dd827da1 | 46 | struct mantis_ca { |
d8b14f8a | 47 | struct mantis_slot slot[4]; |
dd827da1 | 48 | |
12855cac | 49 | struct work_struct hif_evm_work; |
dd827da1 MA |
50 | |
51 | u32 hif_event; | |
52 | wait_queue_head_t hif_opdone_wq; | |
53 | wait_queue_head_t hif_brrdyw_wq; | |
54 | wait_queue_head_t hif_data_wq; | |
e0e099a7 | 55 | wait_queue_head_t hif_write_wq; /* HIF Write op */ |
dd827da1 MA |
56 | |
57 | enum mantis_sbuf_status sbuf_status; | |
58 | ||
8ce571f5 MA |
59 | enum mantis_slot_state slot_state; |
60 | ||
dd827da1 | 61 | void *ca_priv; |
6053240f MA |
62 | |
63 | struct dvb_ca_en50221 en50221; | |
f684336b | 64 | struct mutex ca_lock; |
dd827da1 MA |
65 | }; |
66 | ||
50d82602 MA |
67 | /* CA */ |
68 | extern void mantis_event_cam_plugin(struct mantis_ca *ca); | |
69 | extern void mantis_event_cam_unplug(struct mantis_ca *ca); | |
70 | extern int mantis_pcmcia_init(struct mantis_ca *ca); | |
71 | extern void mantis_pcmcia_exit(struct mantis_ca *ca); | |
72 | extern int mantis_evmgr_init(struct mantis_ca *ca); | |
73 | extern void mantis_evmgr_exit(struct mantis_ca *ca); | |
74 | ||
d8b14f8a MA |
75 | /* HIF */ |
76 | extern int mantis_hif_init(struct mantis_ca *ca); | |
77 | extern void mantis_hif_exit(struct mantis_ca *ca); | |
78 | extern int mantis_hif_read_mem(struct mantis_ca *ca, u32 addr); | |
79 | extern int mantis_hif_write_mem(struct mantis_ca *ca, u32 addr, u8 data); | |
6053240f MA |
80 | extern int mantis_hif_read_iom(struct mantis_ca *ca, u32 addr); |
81 | extern int mantis_hif_write_iom(struct mantis_ca *ca, u32 addr, u8 data); | |
d8b14f8a | 82 | |
b3b96144 | 83 | #endif /* __MANTIS_LINK_H */ |