| 1 | /* |
| 2 | |
| 3 | Copyright 1996,2002 Gregory D. Hager, Alfred A. Rizzi, Noah J. Cowan, |
| 4 | Jason Lapenta, Scott Smedley |
| 5 | |
| 6 | This file is part of the DT3155 Device Driver. |
| 7 | |
| 8 | The DT3155 Device Driver is free software; you can redistribute it |
| 9 | and/or modify it under the terms of the GNU General Public License as |
| 10 | published by the Free Software Foundation; either version 2 of the |
| 11 | License, or (at your option) any later version. |
| 12 | |
| 13 | The DT3155 Device Driver is distributed in the hope that it will be |
| 14 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty |
| 15 | of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | GNU General Public License for more details. |
| 17 | |
| 18 | You should have received a copy of the GNU General Public License |
| 19 | along with the DT3155 Device Driver; if not, write to the Free |
| 20 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 21 | MA 02111-1307 USA |
| 22 | |
| 23 | |
| 24 | -- Changes -- |
| 25 | |
| 26 | Date Programmer Description of changes made |
| 27 | ------------------------------------------------------------------- |
| 28 | 03-Jul-2000 JML n/a |
| 29 | 24-Jul-2002 SS GPL licence. |
| 30 | 26-Oct-2009 SS Porting to 2.6.30 kernel. |
| 31 | |
| 32 | -- notes -- |
| 33 | |
| 34 | */ |
| 35 | |
| 36 | #ifndef DT3155_ISR_H |
| 37 | #define DT3155_ISR_H |
| 38 | |
| 39 | extern struct dt3155_fbuffer_s *dt3155_fbuffer[MAXBOARDS]; |
| 40 | |
| 41 | /* User functions for buffering */ |
| 42 | /* Initialize the buffering system. This should */ |
| 43 | /* be called prior to enabling interrupts */ |
| 44 | |
| 45 | u32 dt3155_setup_buffers(u32 *allocatorAddr); |
| 46 | |
| 47 | /* Get the next frame of data if it is ready. Returns */ |
| 48 | /* zero if no data is ready. If there is data but */ |
| 49 | /* the user has a locked buffer, it will unlock that */ |
| 50 | /* buffer and return it to the free list. */ |
| 51 | |
| 52 | int dt3155_get_ready_buffer(int minor); |
| 53 | |
| 54 | /* Return a locked buffer to the free list */ |
| 55 | |
| 56 | void dt3155_release_locked_buffer(int minor); |
| 57 | |
| 58 | /* Flush the buffer system */ |
| 59 | int dt3155_flush(int minor); |
| 60 | |
| 61 | /********************************** |
| 62 | * Simple array based que struct |
| 63 | **********************************/ |
| 64 | |
| 65 | bool are_empty_buffers(int minor); |
| 66 | void push_empty(int index, int minor); |
| 67 | |
| 68 | int pop_empty(int minor); |
| 69 | |
| 70 | bool is_ready_buf_empty(int minor); |
| 71 | bool is_ready_buf_full(int minor); |
| 72 | |
| 73 | void push_ready(int minor, int index); |
| 74 | int pop_ready(int minor); |
| 75 | |
| 76 | |
| 77 | #endif |