Pierrick Hascoet | 41b44e0 | 2011-10-31 12:24:39 -0300 | [diff] [blame] | 1 | /* |
| 2 | * Abilis Systems Single DVB-T Receiver |
| 3 | * Copyright (C) 2008 Pierrick Hascoet <pierrick.hascoet@abilis.com> |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 2, or (at your option) |
| 8 | * any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
Pierrick Hascoet | 41b44e0 | 2011-10-31 12:24:39 -0300 | [diff] [blame] | 14 | */ |
Mauro Carvalho Chehab | 47f7912 | 2014-08-12 18:50:22 -0300 | [diff] [blame] | 15 | #ifndef _AS10X_HANDLE_H |
| 16 | #define _AS10X_HANDLE_H |
Sylwester Nawrocki | 34490a0 | 2011-11-06 16:31:50 -0300 | [diff] [blame] | 17 | struct as10x_bus_adapter_t; |
Pierrick Hascoet | 41b44e0 | 2011-10-31 12:24:39 -0300 | [diff] [blame] | 18 | struct as102_dev_t; |
| 19 | |
Pierrick Hascoet | 41b44e0 | 2011-10-31 12:24:39 -0300 | [diff] [blame] | 20 | #include "as10x_cmd.h" |
| 21 | |
| 22 | /* values for "mode" field */ |
Sylwester Nawrocki | 14e0e4b | 2011-11-06 16:31:44 -0300 | [diff] [blame] | 23 | #define REGMODE8 8 |
| 24 | #define REGMODE16 16 |
| 25 | #define REGMODE32 32 |
Pierrick Hascoet | 41b44e0 | 2011-10-31 12:24:39 -0300 | [diff] [blame] | 26 | |
| 27 | struct as102_priv_ops_t { |
Aybuke Ozdemir | 8e3a3ce | 2014-03-19 19:39:52 +0200 | [diff] [blame] | 28 | int (*upload_fw_pkt)(struct as10x_bus_adapter_t *bus_adap, |
Pierrick Hascoet | 41b44e0 | 2011-10-31 12:24:39 -0300 | [diff] [blame] | 29 | unsigned char *buf, int buflen, int swap32); |
| 30 | |
Aybuke Ozdemir | 8e3a3ce | 2014-03-19 19:39:52 +0200 | [diff] [blame] | 31 | int (*send_cmd)(struct as10x_bus_adapter_t *bus_adap, |
Pierrick Hascoet | 41b44e0 | 2011-10-31 12:24:39 -0300 | [diff] [blame] | 32 | unsigned char *buf, int buflen); |
| 33 | |
Aybuke Ozdemir | 8e3a3ce | 2014-03-19 19:39:52 +0200 | [diff] [blame] | 34 | int (*xfer_cmd)(struct as10x_bus_adapter_t *bus_adap, |
Pierrick Hascoet | 41b44e0 | 2011-10-31 12:24:39 -0300 | [diff] [blame] | 35 | unsigned char *send_buf, int send_buf_len, |
| 36 | unsigned char *recv_buf, int recv_buf_len); |
Sylwester Nawrocki | 34490a0 | 2011-11-06 16:31:50 -0300 | [diff] [blame] | 37 | |
Aybuke Ozdemir | 8e3a3ce | 2014-03-19 19:39:52 +0200 | [diff] [blame] | 38 | int (*start_stream)(struct as102_dev_t *dev); |
| 39 | void (*stop_stream)(struct as102_dev_t *dev); |
Pierrick Hascoet | 41b44e0 | 2011-10-31 12:24:39 -0300 | [diff] [blame] | 40 | |
Aybuke Ozdemir | 8e3a3ce | 2014-03-19 19:39:52 +0200 | [diff] [blame] | 41 | int (*reset_target)(struct as10x_bus_adapter_t *bus_adap); |
Pierrick Hascoet | 41b44e0 | 2011-10-31 12:24:39 -0300 | [diff] [blame] | 42 | |
Sylwester Nawrocki | 34490a0 | 2011-11-06 16:31:50 -0300 | [diff] [blame] | 43 | int (*read_write)(struct as10x_bus_adapter_t *bus_adap, uint8_t mode, |
Pierrick Hascoet | 41b44e0 | 2011-10-31 12:24:39 -0300 | [diff] [blame] | 44 | uint32_t rd_addr, uint16_t rd_len, |
| 45 | uint32_t wr_addr, uint16_t wr_len); |
| 46 | |
Aybuke Ozdemir | 8e3a3ce | 2014-03-19 19:39:52 +0200 | [diff] [blame] | 47 | int (*as102_read_ep2)(struct as10x_bus_adapter_t *bus_adap, |
Pierrick Hascoet | 41b44e0 | 2011-10-31 12:24:39 -0300 | [diff] [blame] | 48 | unsigned char *recv_buf, |
| 49 | int recv_buf_len); |
| 50 | }; |
| 51 | #endif |