[SCSI] libfc: remove redundant timer init for fcp
[sfrench/cifs-2.6.git] / drivers / staging / media / as102 / as10x_types.h
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.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */
19 #ifndef _AS10X_TYPES_H_
20 #define _AS10X_TYPES_H_
21
22 #include "as10x_handle.h"
23
24 /*********************************/
25 /*       MACRO DEFINITIONS       */
26 /*********************************/
27
28 /* bandwidth constant values */
29 #define BW_5_MHZ           0x00
30 #define BW_6_MHZ           0x01
31 #define BW_7_MHZ           0x02
32 #define BW_8_MHZ           0x03
33
34 /* hierarchy priority selection values */
35 #define HIER_NO_PRIORITY   0x00
36 #define HIER_LOW_PRIORITY  0x01
37 #define HIER_HIGH_PRIORITY 0x02
38
39 /* constellation available values */
40 #define CONST_QPSK         0x00
41 #define CONST_QAM16        0x01
42 #define CONST_QAM64        0x02
43 #define CONST_UNKNOWN      0xFF
44
45 /* hierarchy available values */
46 #define HIER_NONE         0x00
47 #define HIER_ALPHA_1      0x01
48 #define HIER_ALPHA_2      0x02
49 #define HIER_ALPHA_4      0x03
50 #define HIER_UNKNOWN      0xFF
51
52 /* interleaving available values */
53 #define INTLV_NATIVE      0x00
54 #define INTLV_IN_DEPTH    0x01
55 #define INTLV_UNKNOWN     0xFF
56
57 /* code rate available values */
58 #define CODE_RATE_1_2     0x00
59 #define CODE_RATE_2_3     0x01
60 #define CODE_RATE_3_4     0x02
61 #define CODE_RATE_5_6     0x03
62 #define CODE_RATE_7_8     0x04
63 #define CODE_RATE_UNKNOWN 0xFF
64
65 /* guard interval available values */
66 #define GUARD_INT_1_32    0x00
67 #define GUARD_INT_1_16    0x01
68 #define GUARD_INT_1_8     0x02
69 #define GUARD_INT_1_4     0x03
70 #define GUARD_UNKNOWN     0xFF
71
72 /* transmission mode available values */
73 #define TRANS_MODE_2K      0x00
74 #define TRANS_MODE_8K      0x01
75 #define TRANS_MODE_4K      0x02
76 #define TRANS_MODE_UNKNOWN 0xFF
77
78 /* DVBH signalling available values */
79 #define TIMESLICING_PRESENT   0x01
80 #define MPE_FEC_PRESENT       0x02
81
82 /* tune state available */
83 #define TUNE_STATUS_NOT_TUNED       0x00
84 #define TUNE_STATUS_IDLE            0x01
85 #define TUNE_STATUS_LOCKING         0x02
86 #define TUNE_STATUS_SIGNAL_DVB_OK   0x03
87 #define TUNE_STATUS_STREAM_DETECTED 0x04
88 #define TUNE_STATUS_STREAM_TUNED    0x05
89 #define TUNE_STATUS_ERROR           0xFF
90
91 /* available TS FID filter types */
92 #define TS_PID_TYPE_TS       0
93 #define TS_PID_TYPE_PSI_SI   1
94 #define TS_PID_TYPE_MPE      2
95
96 /* number of echos available */
97 #define MAX_ECHOS   15
98
99 /* Context types */
100 #define CONTEXT_LNA                   1010
101 #define CONTEXT_ELNA_HYSTERESIS       4003
102 #define CONTEXT_ELNA_GAIN             4004
103 #define CONTEXT_MER_THRESHOLD         5005
104 #define CONTEXT_MER_OFFSET            5006
105 #define CONTEXT_IR_STATE              7000
106 #define CONTEXT_TSOUT_MSB_FIRST       7004
107 #define CONTEXT_TSOUT_FALLING_EDGE    7005
108
109 /* Configuration modes */
110 #define CFG_MODE_ON     0
111 #define CFG_MODE_OFF    1
112 #define CFG_MODE_AUTO   2
113
114 #pragma pack(1)
115 struct as10x_tps {
116    uint8_t constellation;
117    uint8_t hierarchy;
118    uint8_t interleaving_mode;
119    uint8_t code_rate_HP;
120    uint8_t code_rate_LP;
121    uint8_t guard_interval;
122    uint8_t transmission_mode;
123    uint8_t DVBH_mask_HP;
124    uint8_t DVBH_mask_LP;
125    uint16_t cell_ID;
126 };
127
128 struct as10x_tune_args {
129    /* frequency */
130    uint32_t freq;
131    /* bandwidth */
132    uint8_t bandwidth;
133    /* hierarchy selection */
134    uint8_t hier_select;
135    /* constellation */
136    uint8_t constellation;
137    /* hierarchy */
138    uint8_t hierarchy;
139    /* interleaving mode */
140    uint8_t interleaving_mode;
141    /* code rate */
142    uint8_t code_rate;
143    /* guard interval */
144    uint8_t guard_interval;
145    /* transmission mode */
146    uint8_t transmission_mode;
147 };
148
149 struct as10x_tune_status {
150    /* tune status */
151    uint8_t tune_state;
152    /* signal strength */
153    int16_t signal_strength;
154    /* packet error rate 10^-4 */
155    uint16_t PER;
156    /* bit error rate 10^-4 */
157    uint16_t BER;
158 };
159
160 struct as10x_demod_stats {
161    /* frame counter */
162    uint32_t frame_count;
163    /* Bad frame counter */
164    uint32_t bad_frame_count;
165    /* Number of wrong bytes fixed by Reed-Solomon */
166    uint32_t bytes_fixed_by_rs;
167    /* Averaged MER */
168    uint16_t mer;
169    /* statistics calculation state indicator (started or not) */
170    uint8_t has_started;
171 };
172
173 struct as10x_ts_filter {
174    uint16_t pid;  /** valid PID value 0x00 : 0x2000 */
175    uint8_t  type; /** Red TS_PID_TYPE_<N> values */
176    uint8_t  idx;  /** index in filtering table */
177 };
178
179 struct as10x_register_value {
180    uint8_t       mode;
181    union {
182       uint8_t    value8;    /* 8 bit value */
183       uint16_t   value16;   /* 16 bit value */
184       uint32_t   value32;   /* 32 bit value */
185    }u;
186 };
187
188 #pragma pack()
189
190 struct as10x_register_addr {
191    /* register addr */
192    uint32_t addr;
193    /* register mode access */
194    uint8_t mode;
195 };
196
197
198 #endif