Manu Abraham | dd827da | 2009-12-04 05:00:30 -0300 | [diff] [blame] | 1 | /* |
| 2 | Mantis PCI bridge driver |
| 3 | |
| 4 | Copyright (C) 2005, 2006 Manu Abraham (abraham.manu@gmail.com) |
| 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 | |
Manu Abraham | 12855ca | 2009-12-04 05:09:04 -0300 | [diff] [blame] | 24 | #include <linux/workqueue.h> |
Manu Abraham | 6053240 | 2009-12-04 05:11:14 -0300 | [diff] [blame^] | 25 | #include "dvb_ca_en50221.h" |
Manu Abraham | 12855ca | 2009-12-04 05:09:04 -0300 | [diff] [blame] | 26 | |
Manu Abraham | dd827da | 2009-12-04 05:00:30 -0300 | [diff] [blame] | 27 | enum mantis_sbuf_status { |
| 28 | MANTIS_SBUF_DATA_AVAIL = 1, |
| 29 | MANTIS_SBUF_DATA_EMPTY = 2, |
| 30 | MANTIS_SBUF_DATA_OVFLW = 3 |
| 31 | }; |
| 32 | |
| 33 | struct mantis_slot { |
| 34 | u32 timeout; |
Manu Abraham | d8b14f8 | 2009-12-04 05:09:47 -0300 | [diff] [blame] | 35 | u32 slave_cfg; |
| 36 | u32 bar; |
Manu Abraham | dd827da | 2009-12-04 05:00:30 -0300 | [diff] [blame] | 37 | }; |
| 38 | |
Manu Abraham | 8ce571f | 2009-12-04 05:06:00 -0300 | [diff] [blame] | 39 | /* Physical layer */ |
| 40 | enum mantis_slot_state { |
| 41 | MODULE_INSERTED = 3, |
| 42 | MODULE_XTRACTED = 4 |
| 43 | }; |
| 44 | |
Manu Abraham | dd827da | 2009-12-04 05:00:30 -0300 | [diff] [blame] | 45 | struct mantis_ca { |
Manu Abraham | d8b14f8 | 2009-12-04 05:09:47 -0300 | [diff] [blame] | 46 | struct mantis_slot slot[4]; |
Manu Abraham | dd827da | 2009-12-04 05:00:30 -0300 | [diff] [blame] | 47 | |
Manu Abraham | 12855ca | 2009-12-04 05:09:04 -0300 | [diff] [blame] | 48 | struct work_struct hif_evm_work; |
Manu Abraham | dd827da | 2009-12-04 05:00:30 -0300 | [diff] [blame] | 49 | |
| 50 | u32 hif_event; |
| 51 | wait_queue_head_t hif_opdone_wq; |
| 52 | wait_queue_head_t hif_brrdyw_wq; |
| 53 | wait_queue_head_t hif_data_wq; |
Manu Abraham | bc4ed42 | 2009-12-04 05:03:35 -0300 | [diff] [blame] | 54 | u32 hif_job_queue; |
Manu Abraham | dd827da | 2009-12-04 05:00:30 -0300 | [diff] [blame] | 55 | |
| 56 | enum mantis_sbuf_status sbuf_status; |
| 57 | |
Manu Abraham | 8ce571f | 2009-12-04 05:06:00 -0300 | [diff] [blame] | 58 | enum mantis_slot_state slot_state; |
| 59 | |
Manu Abraham | 6053240 | 2009-12-04 05:11:14 -0300 | [diff] [blame^] | 60 | // struct dvb_device *ca_dev; |
Manu Abraham | dd827da | 2009-12-04 05:00:30 -0300 | [diff] [blame] | 61 | void *ca_priv; |
Manu Abraham | 6053240 | 2009-12-04 05:11:14 -0300 | [diff] [blame^] | 62 | |
| 63 | struct dvb_ca_en50221 en50221; |
Manu Abraham | dd827da | 2009-12-04 05:00:30 -0300 | [diff] [blame] | 64 | }; |
| 65 | |
Manu Abraham | 50d8260 | 2009-12-04 05:06:38 -0300 | [diff] [blame] | 66 | /* CA */ |
| 67 | extern void mantis_event_cam_plugin(struct mantis_ca *ca); |
| 68 | extern void mantis_event_cam_unplug(struct mantis_ca *ca); |
| 69 | extern int mantis_pcmcia_init(struct mantis_ca *ca); |
| 70 | extern void mantis_pcmcia_exit(struct mantis_ca *ca); |
| 71 | extern int mantis_evmgr_init(struct mantis_ca *ca); |
| 72 | extern void mantis_evmgr_exit(struct mantis_ca *ca); |
| 73 | |
Manu Abraham | d8b14f8 | 2009-12-04 05:09:47 -0300 | [diff] [blame] | 74 | /* HIF */ |
| 75 | extern int mantis_hif_init(struct mantis_ca *ca); |
| 76 | extern void mantis_hif_exit(struct mantis_ca *ca); |
| 77 | extern int mantis_hif_read_mem(struct mantis_ca *ca, u32 addr); |
| 78 | extern int mantis_hif_write_mem(struct mantis_ca *ca, u32 addr, u8 data); |
Manu Abraham | 6053240 | 2009-12-04 05:11:14 -0300 | [diff] [blame^] | 79 | extern int mantis_hif_read_iom(struct mantis_ca *ca, u32 addr); |
| 80 | extern int mantis_hif_write_iom(struct mantis_ca *ca, u32 addr, u8 data); |
Manu Abraham | d8b14f8 | 2009-12-04 05:09:47 -0300 | [diff] [blame] | 81 | |
Manu Abraham | dd827da | 2009-12-04 05:00:30 -0300 | [diff] [blame] | 82 | #endif // __MANTIS_LINK_H |