Commit 28a59df4d7cb8f749ba92ad304df4063ccf108fd
1 parent
90414248bf
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
[media] siano: remove the remaining CamelCase compliants
Remove the remaining CamelCase checkpatch.pl compliants. There are still a few left, but those are due to USB and DVB APIs. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Showing 8 changed files with 253 additions and 253 deletions Inline Diff
- drivers/media/common/siano/sms-cards.c
- drivers/media/common/siano/smscoreapi.c
- drivers/media/common/siano/smscoreapi.h
- drivers/media/common/siano/smsdvb-debugfs.c
- drivers/media/common/siano/smsdvb-main.c
- drivers/media/common/siano/smsdvb.h
- drivers/media/common/siano/smsendian.c
- drivers/media/usb/siano/smsusb.c
drivers/media/common/siano/sms-cards.c
1 | /* | 1 | /* |
2 | * Card-specific functions for the Siano SMS1xxx USB dongle | 2 | * Card-specific functions for the Siano SMS1xxx USB dongle |
3 | * | 3 | * |
4 | * Copyright (c) 2008 Michael Krufky <mkrufky@linuxtv.org> | 4 | * Copyright (c) 2008 Michael Krufky <mkrufky@linuxtv.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License version 2 as | 7 | * it under the terms of the GNU General Public License version 2 as |
8 | * published by the Free Software Foundation; | 8 | * published by the Free Software Foundation; |
9 | * | 9 | * |
10 | * Software distributed under the License is distributed on an "AS IS" | 10 | * Software distributed under the License is distributed on an "AS IS" |
11 | * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | 11 | * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. |
12 | * | 12 | * |
13 | * See the GNU General Public License for more details. | 13 | * See the GNU General Public License for more details. |
14 | * | 14 | * |
15 | * You should have received a copy of the GNU General Public License | 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 | 16 | * along with this program; if not, write to the Free Software |
17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include "sms-cards.h" | 20 | #include "sms-cards.h" |
21 | #include "smsir.h" | 21 | #include "smsir.h" |
22 | #include <linux/module.h> | 22 | #include <linux/module.h> |
23 | 23 | ||
24 | static int sms_dbg; | 24 | static int sms_dbg; |
25 | module_param_named(cards_dbg, sms_dbg, int, 0644); | 25 | module_param_named(cards_dbg, sms_dbg, int, 0644); |
26 | MODULE_PARM_DESC(cards_dbg, "set debug level (info=1, adv=2 (or-able))"); | 26 | MODULE_PARM_DESC(cards_dbg, "set debug level (info=1, adv=2 (or-able))"); |
27 | 27 | ||
28 | static struct sms_board sms_boards[] = { | 28 | static struct sms_board sms_boards[] = { |
29 | [SMS_BOARD_UNKNOWN] = { | 29 | [SMS_BOARD_UNKNOWN] = { |
30 | .name = "Unknown board", | 30 | .name = "Unknown board", |
31 | .type = SMS_UNKNOWN_TYPE, | 31 | .type = SMS_UNKNOWN_TYPE, |
32 | .default_mode = DEVICE_MODE_NONE, | 32 | .default_mode = DEVICE_MODE_NONE, |
33 | }, | 33 | }, |
34 | [SMS1XXX_BOARD_SIANO_STELLAR] = { | 34 | [SMS1XXX_BOARD_SIANO_STELLAR] = { |
35 | .name = "Siano Stellar Digital Receiver", | 35 | .name = "Siano Stellar Digital Receiver", |
36 | .type = SMS_STELLAR, | 36 | .type = SMS_STELLAR, |
37 | .default_mode = DEVICE_MODE_DVBT_BDA, | 37 | .default_mode = DEVICE_MODE_DVBT_BDA, |
38 | }, | 38 | }, |
39 | [SMS1XXX_BOARD_SIANO_NOVA_A] = { | 39 | [SMS1XXX_BOARD_SIANO_NOVA_A] = { |
40 | .name = "Siano Nova A Digital Receiver", | 40 | .name = "Siano Nova A Digital Receiver", |
41 | .type = SMS_NOVA_A0, | 41 | .type = SMS_NOVA_A0, |
42 | .default_mode = DEVICE_MODE_DVBT_BDA, | 42 | .default_mode = DEVICE_MODE_DVBT_BDA, |
43 | }, | 43 | }, |
44 | [SMS1XXX_BOARD_SIANO_NOVA_B] = { | 44 | [SMS1XXX_BOARD_SIANO_NOVA_B] = { |
45 | .name = "Siano Nova B Digital Receiver", | 45 | .name = "Siano Nova B Digital Receiver", |
46 | .type = SMS_NOVA_B0, | 46 | .type = SMS_NOVA_B0, |
47 | .default_mode = DEVICE_MODE_DVBT_BDA, | 47 | .default_mode = DEVICE_MODE_DVBT_BDA, |
48 | }, | 48 | }, |
49 | [SMS1XXX_BOARD_SIANO_VEGA] = { | 49 | [SMS1XXX_BOARD_SIANO_VEGA] = { |
50 | .name = "Siano Vega Digital Receiver", | 50 | .name = "Siano Vega Digital Receiver", |
51 | .type = SMS_VEGA, | 51 | .type = SMS_VEGA, |
52 | .default_mode = DEVICE_MODE_CMMB, | 52 | .default_mode = DEVICE_MODE_CMMB, |
53 | }, | 53 | }, |
54 | [SMS1XXX_BOARD_HAUPPAUGE_CATAMOUNT] = { | 54 | [SMS1XXX_BOARD_HAUPPAUGE_CATAMOUNT] = { |
55 | .name = "Hauppauge Catamount", | 55 | .name = "Hauppauge Catamount", |
56 | .type = SMS_STELLAR, | 56 | .type = SMS_STELLAR, |
57 | .fw[DEVICE_MODE_DVBT_BDA] = SMS_FW_DVBT_STELLAR, | 57 | .fw[DEVICE_MODE_DVBT_BDA] = SMS_FW_DVBT_STELLAR, |
58 | .default_mode = DEVICE_MODE_DVBT_BDA, | 58 | .default_mode = DEVICE_MODE_DVBT_BDA, |
59 | }, | 59 | }, |
60 | [SMS1XXX_BOARD_HAUPPAUGE_OKEMO_A] = { | 60 | [SMS1XXX_BOARD_HAUPPAUGE_OKEMO_A] = { |
61 | .name = "Hauppauge Okemo-A", | 61 | .name = "Hauppauge Okemo-A", |
62 | .type = SMS_NOVA_A0, | 62 | .type = SMS_NOVA_A0, |
63 | .fw[DEVICE_MODE_DVBT_BDA] = SMS_FW_DVBT_NOVA_A, | 63 | .fw[DEVICE_MODE_DVBT_BDA] = SMS_FW_DVBT_NOVA_A, |
64 | .default_mode = DEVICE_MODE_DVBT_BDA, | 64 | .default_mode = DEVICE_MODE_DVBT_BDA, |
65 | }, | 65 | }, |
66 | [SMS1XXX_BOARD_HAUPPAUGE_OKEMO_B] = { | 66 | [SMS1XXX_BOARD_HAUPPAUGE_OKEMO_B] = { |
67 | .name = "Hauppauge Okemo-B", | 67 | .name = "Hauppauge Okemo-B", |
68 | .type = SMS_NOVA_B0, | 68 | .type = SMS_NOVA_B0, |
69 | .fw[DEVICE_MODE_DVBT_BDA] = SMS_FW_DVBT_NOVA_B, | 69 | .fw[DEVICE_MODE_DVBT_BDA] = SMS_FW_DVBT_NOVA_B, |
70 | .default_mode = DEVICE_MODE_DVBT_BDA, | 70 | .default_mode = DEVICE_MODE_DVBT_BDA, |
71 | }, | 71 | }, |
72 | [SMS1XXX_BOARD_HAUPPAUGE_WINDHAM] = { | 72 | [SMS1XXX_BOARD_HAUPPAUGE_WINDHAM] = { |
73 | .name = "Hauppauge WinTV MiniStick", | 73 | .name = "Hauppauge WinTV MiniStick", |
74 | .type = SMS_NOVA_B0, | 74 | .type = SMS_NOVA_B0, |
75 | .fw[DEVICE_MODE_ISDBT_BDA] = SMS_FW_ISDBT_HCW_55XXX, | 75 | .fw[DEVICE_MODE_ISDBT_BDA] = SMS_FW_ISDBT_HCW_55XXX, |
76 | .fw[DEVICE_MODE_DVBT_BDA] = SMS_FW_DVBT_HCW_55XXX, | 76 | .fw[DEVICE_MODE_DVBT_BDA] = SMS_FW_DVBT_HCW_55XXX, |
77 | .default_mode = DEVICE_MODE_DVBT_BDA, | 77 | .default_mode = DEVICE_MODE_DVBT_BDA, |
78 | .rc_codes = RC_MAP_HAUPPAUGE, | 78 | .rc_codes = RC_MAP_HAUPPAUGE, |
79 | .board_cfg.leds_power = 26, | 79 | .board_cfg.leds_power = 26, |
80 | .board_cfg.led0 = 27, | 80 | .board_cfg.led0 = 27, |
81 | .board_cfg.led1 = 28, | 81 | .board_cfg.led1 = 28, |
82 | .board_cfg.ir = 9, | 82 | .board_cfg.ir = 9, |
83 | .led_power = 26, | 83 | .led_power = 26, |
84 | .led_lo = 27, | 84 | .led_lo = 27, |
85 | .led_hi = 28, | 85 | .led_hi = 28, |
86 | }, | 86 | }, |
87 | [SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD] = { | 87 | [SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD] = { |
88 | .name = "Hauppauge WinTV MiniCard", | 88 | .name = "Hauppauge WinTV MiniCard", |
89 | .type = SMS_NOVA_B0, | 89 | .type = SMS_NOVA_B0, |
90 | .fw[DEVICE_MODE_DVBT_BDA] = SMS_FW_DVBT_HCW_55XXX, | 90 | .fw[DEVICE_MODE_DVBT_BDA] = SMS_FW_DVBT_HCW_55XXX, |
91 | .default_mode = DEVICE_MODE_DVBT_BDA, | 91 | .default_mode = DEVICE_MODE_DVBT_BDA, |
92 | .lna_ctrl = 29, | 92 | .lna_ctrl = 29, |
93 | .board_cfg.foreign_lna0_ctrl = 29, | 93 | .board_cfg.foreign_lna0_ctrl = 29, |
94 | .rf_switch = 17, | 94 | .rf_switch = 17, |
95 | .board_cfg.rf_switch_uhf = 17, | 95 | .board_cfg.rf_switch_uhf = 17, |
96 | }, | 96 | }, |
97 | [SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2] = { | 97 | [SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2] = { |
98 | .name = "Hauppauge WinTV MiniCard", | 98 | .name = "Hauppauge WinTV MiniCard", |
99 | .type = SMS_NOVA_B0, | 99 | .type = SMS_NOVA_B0, |
100 | .fw[DEVICE_MODE_DVBT_BDA] = SMS_FW_DVBT_HCW_55XXX, | 100 | .fw[DEVICE_MODE_DVBT_BDA] = SMS_FW_DVBT_HCW_55XXX, |
101 | .default_mode = DEVICE_MODE_DVBT_BDA, | 101 | .default_mode = DEVICE_MODE_DVBT_BDA, |
102 | .lna_ctrl = -1, | 102 | .lna_ctrl = -1, |
103 | }, | 103 | }, |
104 | [SMS1XXX_BOARD_SIANO_NICE] = { | 104 | [SMS1XXX_BOARD_SIANO_NICE] = { |
105 | .name = "Siano Nice Digital Receiver", | 105 | .name = "Siano Nice Digital Receiver", |
106 | .type = SMS_NOVA_B0, | 106 | .type = SMS_NOVA_B0, |
107 | .default_mode = DEVICE_MODE_DVBT_BDA, | 107 | .default_mode = DEVICE_MODE_DVBT_BDA, |
108 | }, | 108 | }, |
109 | [SMS1XXX_BOARD_SIANO_VENICE] = { | 109 | [SMS1XXX_BOARD_SIANO_VENICE] = { |
110 | .name = "Siano Venice Digital Receiver", | 110 | .name = "Siano Venice Digital Receiver", |
111 | .type = SMS_VEGA, | 111 | .type = SMS_VEGA, |
112 | .default_mode = DEVICE_MODE_CMMB, | 112 | .default_mode = DEVICE_MODE_CMMB, |
113 | }, | 113 | }, |
114 | [SMS1XXX_BOARD_SIANO_STELLAR_ROM] = { | 114 | [SMS1XXX_BOARD_SIANO_STELLAR_ROM] = { |
115 | .name = "Siano Stellar Digital Receiver ROM", | 115 | .name = "Siano Stellar Digital Receiver ROM", |
116 | .type = SMS_STELLAR, | 116 | .type = SMS_STELLAR, |
117 | .default_mode = DEVICE_MODE_DVBT_BDA, | 117 | .default_mode = DEVICE_MODE_DVBT_BDA, |
118 | .intf_num = 1, | 118 | .intf_num = 1, |
119 | }, | 119 | }, |
120 | [SMS1XXX_BOARD_ZTE_DVB_DATA_CARD] = { | 120 | [SMS1XXX_BOARD_ZTE_DVB_DATA_CARD] = { |
121 | .name = "ZTE Data Card Digital Receiver", | 121 | .name = "ZTE Data Card Digital Receiver", |
122 | .type = SMS_NOVA_B0, | 122 | .type = SMS_NOVA_B0, |
123 | .default_mode = DEVICE_MODE_DVBT_BDA, | 123 | .default_mode = DEVICE_MODE_DVBT_BDA, |
124 | .intf_num = 5, | 124 | .intf_num = 5, |
125 | .mtu = 15792, | 125 | .mtu = 15792, |
126 | }, | 126 | }, |
127 | [SMS1XXX_BOARD_ONDA_MDTV_DATA_CARD] = { | 127 | [SMS1XXX_BOARD_ONDA_MDTV_DATA_CARD] = { |
128 | .name = "ONDA Data Card Digital Receiver", | 128 | .name = "ONDA Data Card Digital Receiver", |
129 | .type = SMS_NOVA_B0, | 129 | .type = SMS_NOVA_B0, |
130 | .default_mode = DEVICE_MODE_DVBT_BDA, | 130 | .default_mode = DEVICE_MODE_DVBT_BDA, |
131 | .intf_num = 6, | 131 | .intf_num = 6, |
132 | .mtu = 15792, | 132 | .mtu = 15792, |
133 | }, | 133 | }, |
134 | [SMS1XXX_BOARD_SIANO_MING] = { | 134 | [SMS1XXX_BOARD_SIANO_MING] = { |
135 | .name = "Siano Ming Digital Receiver", | 135 | .name = "Siano Ming Digital Receiver", |
136 | .type = SMS_MING, | 136 | .type = SMS_MING, |
137 | .default_mode = DEVICE_MODE_CMMB, | 137 | .default_mode = DEVICE_MODE_CMMB, |
138 | }, | 138 | }, |
139 | [SMS1XXX_BOARD_SIANO_PELE] = { | 139 | [SMS1XXX_BOARD_SIANO_PELE] = { |
140 | .name = "Siano Pele Digital Receiver", | 140 | .name = "Siano Pele Digital Receiver", |
141 | .type = SMS_PELE, | 141 | .type = SMS_PELE, |
142 | .default_mode = DEVICE_MODE_ISDBT_BDA, | 142 | .default_mode = DEVICE_MODE_ISDBT_BDA, |
143 | }, | 143 | }, |
144 | [SMS1XXX_BOARD_SIANO_RIO] = { | 144 | [SMS1XXX_BOARD_SIANO_RIO] = { |
145 | .name = "Siano Rio Digital Receiver", | 145 | .name = "Siano Rio Digital Receiver", |
146 | .type = SMS_RIO, | 146 | .type = SMS_RIO, |
147 | .default_mode = DEVICE_MODE_ISDBT_BDA, | 147 | .default_mode = DEVICE_MODE_ISDBT_BDA, |
148 | }, | 148 | }, |
149 | [SMS1XXX_BOARD_SIANO_DENVER_1530] = { | 149 | [SMS1XXX_BOARD_SIANO_DENVER_1530] = { |
150 | .name = "Siano Denver (ATSC-M/H) Digital Receiver", | 150 | .name = "Siano Denver (ATSC-M/H) Digital Receiver", |
151 | .type = SMS_DENVER_1530, | 151 | .type = SMS_DENVER_1530, |
152 | .default_mode = DEVICE_MODE_ATSC, | 152 | .default_mode = DEVICE_MODE_ATSC, |
153 | .crystal = 2400, | 153 | .crystal = 2400, |
154 | }, | 154 | }, |
155 | [SMS1XXX_BOARD_SIANO_DENVER_2160] = { | 155 | [SMS1XXX_BOARD_SIANO_DENVER_2160] = { |
156 | .name = "Siano Denver (TDMB) Digital Receiver", | 156 | .name = "Siano Denver (TDMB) Digital Receiver", |
157 | .type = SMS_DENVER_2160, | 157 | .type = SMS_DENVER_2160, |
158 | .default_mode = DEVICE_MODE_DAB_TDMB, | 158 | .default_mode = DEVICE_MODE_DAB_TDMB, |
159 | }, | 159 | }, |
160 | }; | 160 | }; |
161 | 161 | ||
162 | struct sms_board *sms_get_board(unsigned id) | 162 | struct sms_board *sms_get_board(unsigned id) |
163 | { | 163 | { |
164 | BUG_ON(id >= ARRAY_SIZE(sms_boards)); | 164 | BUG_ON(id >= ARRAY_SIZE(sms_boards)); |
165 | 165 | ||
166 | return &sms_boards[id]; | 166 | return &sms_boards[id]; |
167 | } | 167 | } |
168 | EXPORT_SYMBOL_GPL(sms_get_board); | 168 | EXPORT_SYMBOL_GPL(sms_get_board); |
169 | static inline void sms_gpio_assign_11xx_default_led_config( | 169 | static inline void sms_gpio_assign_11xx_default_led_config( |
170 | struct smscore_config_gpio *p_gpio_config) { | 170 | struct smscore_config_gpio *p_gpio_config) { |
171 | p_gpio_config->direction = SMS_GPIO_DIRECTION_OUTPUT; | 171 | p_gpio_config->direction = SMS_GPIO_DIRECTION_OUTPUT; |
172 | p_gpio_config->inputcharacteristics = | 172 | p_gpio_config->inputcharacteristics = |
173 | SMS_GPIO_INPUTCHARACTERISTICS_NORMAL; | 173 | SMS_GPIO_INPUTCHARACTERISTICS_NORMAL; |
174 | p_gpio_config->outputdriving = SMS_GPIO_OUTPUTDRIVING_4mA; | 174 | p_gpio_config->outputdriving = SMS_GPIO_OUTPUTDRIVING_4mA; |
175 | p_gpio_config->outputslewrate = SMS_GPIO_OUTPUT_SLEW_RATE_0_45_V_NS; | 175 | p_gpio_config->outputslewrate = SMS_GPIO_OUTPUT_SLEW_RATE_0_45_V_NS; |
176 | p_gpio_config->pullupdown = SMS_GPIO_PULLUPDOWN_NONE; | 176 | p_gpio_config->pullupdown = SMS_GPIO_PULLUPDOWN_NONE; |
177 | } | 177 | } |
178 | 178 | ||
179 | int sms_board_event(struct smscore_device_t *coredev, | 179 | int sms_board_event(struct smscore_device_t *coredev, |
180 | enum SMS_BOARD_EVENTS gevent) | 180 | enum SMS_BOARD_EVENTS gevent) |
181 | { | 181 | { |
182 | struct smscore_config_gpio MyGpioConfig; | 182 | struct smscore_config_gpio my_gpio_config; |
183 | 183 | ||
184 | sms_gpio_assign_11xx_default_led_config(&MyGpioConfig); | 184 | sms_gpio_assign_11xx_default_led_config(&my_gpio_config); |
185 | 185 | ||
186 | switch (gevent) { | 186 | switch (gevent) { |
187 | case BOARD_EVENT_POWER_INIT: /* including hotplug */ | 187 | case BOARD_EVENT_POWER_INIT: /* including hotplug */ |
188 | break; /* BOARD_EVENT_BIND */ | 188 | break; /* BOARD_EVENT_BIND */ |
189 | 189 | ||
190 | case BOARD_EVENT_POWER_SUSPEND: | 190 | case BOARD_EVENT_POWER_SUSPEND: |
191 | break; /* BOARD_EVENT_POWER_SUSPEND */ | 191 | break; /* BOARD_EVENT_POWER_SUSPEND */ |
192 | 192 | ||
193 | case BOARD_EVENT_POWER_RESUME: | 193 | case BOARD_EVENT_POWER_RESUME: |
194 | break; /* BOARD_EVENT_POWER_RESUME */ | 194 | break; /* BOARD_EVENT_POWER_RESUME */ |
195 | 195 | ||
196 | case BOARD_EVENT_BIND: | 196 | case BOARD_EVENT_BIND: |
197 | break; /* BOARD_EVENT_BIND */ | 197 | break; /* BOARD_EVENT_BIND */ |
198 | 198 | ||
199 | case BOARD_EVENT_SCAN_PROG: | 199 | case BOARD_EVENT_SCAN_PROG: |
200 | break; /* BOARD_EVENT_SCAN_PROG */ | 200 | break; /* BOARD_EVENT_SCAN_PROG */ |
201 | case BOARD_EVENT_SCAN_COMP: | 201 | case BOARD_EVENT_SCAN_COMP: |
202 | break; /* BOARD_EVENT_SCAN_COMP */ | 202 | break; /* BOARD_EVENT_SCAN_COMP */ |
203 | case BOARD_EVENT_EMERGENCY_WARNING_SIGNAL: | 203 | case BOARD_EVENT_EMERGENCY_WARNING_SIGNAL: |
204 | break; /* BOARD_EVENT_EMERGENCY_WARNING_SIGNAL */ | 204 | break; /* BOARD_EVENT_EMERGENCY_WARNING_SIGNAL */ |
205 | case BOARD_EVENT_FE_LOCK: | 205 | case BOARD_EVENT_FE_LOCK: |
206 | break; /* BOARD_EVENT_FE_LOCK */ | 206 | break; /* BOARD_EVENT_FE_LOCK */ |
207 | case BOARD_EVENT_FE_UNLOCK: | 207 | case BOARD_EVENT_FE_UNLOCK: |
208 | break; /* BOARD_EVENT_FE_UNLOCK */ | 208 | break; /* BOARD_EVENT_FE_UNLOCK */ |
209 | case BOARD_EVENT_DEMOD_LOCK: | 209 | case BOARD_EVENT_DEMOD_LOCK: |
210 | break; /* BOARD_EVENT_DEMOD_LOCK */ | 210 | break; /* BOARD_EVENT_DEMOD_LOCK */ |
211 | case BOARD_EVENT_DEMOD_UNLOCK: | 211 | case BOARD_EVENT_DEMOD_UNLOCK: |
212 | break; /* BOARD_EVENT_DEMOD_UNLOCK */ | 212 | break; /* BOARD_EVENT_DEMOD_UNLOCK */ |
213 | case BOARD_EVENT_RECEPTION_MAX_4: | 213 | case BOARD_EVENT_RECEPTION_MAX_4: |
214 | break; /* BOARD_EVENT_RECEPTION_MAX_4 */ | 214 | break; /* BOARD_EVENT_RECEPTION_MAX_4 */ |
215 | case BOARD_EVENT_RECEPTION_3: | 215 | case BOARD_EVENT_RECEPTION_3: |
216 | break; /* BOARD_EVENT_RECEPTION_3 */ | 216 | break; /* BOARD_EVENT_RECEPTION_3 */ |
217 | case BOARD_EVENT_RECEPTION_2: | 217 | case BOARD_EVENT_RECEPTION_2: |
218 | break; /* BOARD_EVENT_RECEPTION_2 */ | 218 | break; /* BOARD_EVENT_RECEPTION_2 */ |
219 | case BOARD_EVENT_RECEPTION_1: | 219 | case BOARD_EVENT_RECEPTION_1: |
220 | break; /* BOARD_EVENT_RECEPTION_1 */ | 220 | break; /* BOARD_EVENT_RECEPTION_1 */ |
221 | case BOARD_EVENT_RECEPTION_LOST_0: | 221 | case BOARD_EVENT_RECEPTION_LOST_0: |
222 | break; /* BOARD_EVENT_RECEPTION_LOST_0 */ | 222 | break; /* BOARD_EVENT_RECEPTION_LOST_0 */ |
223 | case BOARD_EVENT_MULTIPLEX_OK: | 223 | case BOARD_EVENT_MULTIPLEX_OK: |
224 | break; /* BOARD_EVENT_MULTIPLEX_OK */ | 224 | break; /* BOARD_EVENT_MULTIPLEX_OK */ |
225 | case BOARD_EVENT_MULTIPLEX_ERRORS: | 225 | case BOARD_EVENT_MULTIPLEX_ERRORS: |
226 | break; /* BOARD_EVENT_MULTIPLEX_ERRORS */ | 226 | break; /* BOARD_EVENT_MULTIPLEX_ERRORS */ |
227 | 227 | ||
228 | default: | 228 | default: |
229 | sms_err("Unknown SMS board event"); | 229 | sms_err("Unknown SMS board event"); |
230 | break; | 230 | break; |
231 | } | 231 | } |
232 | return 0; | 232 | return 0; |
233 | } | 233 | } |
234 | EXPORT_SYMBOL_GPL(sms_board_event); | 234 | EXPORT_SYMBOL_GPL(sms_board_event); |
235 | 235 | ||
236 | static int sms_set_gpio(struct smscore_device_t *coredev, int pin, int enable) | 236 | static int sms_set_gpio(struct smscore_device_t *coredev, int pin, int enable) |
237 | { | 237 | { |
238 | int lvl, ret; | 238 | int lvl, ret; |
239 | u32 gpio; | 239 | u32 gpio; |
240 | struct smscore_config_gpio gpioconfig = { | 240 | struct smscore_config_gpio gpioconfig = { |
241 | .direction = SMS_GPIO_DIRECTION_OUTPUT, | 241 | .direction = SMS_GPIO_DIRECTION_OUTPUT, |
242 | .pullupdown = SMS_GPIO_PULLUPDOWN_NONE, | 242 | .pullupdown = SMS_GPIO_PULLUPDOWN_NONE, |
243 | .inputcharacteristics = SMS_GPIO_INPUTCHARACTERISTICS_NORMAL, | 243 | .inputcharacteristics = SMS_GPIO_INPUTCHARACTERISTICS_NORMAL, |
244 | .outputslewrate = SMS_GPIO_OUTPUT_SLEW_RATE_FAST, | 244 | .outputslewrate = SMS_GPIO_OUTPUT_SLEW_RATE_FAST, |
245 | .outputdriving = SMS_GPIO_OUTPUTDRIVING_S_4mA, | 245 | .outputdriving = SMS_GPIO_OUTPUTDRIVING_S_4mA, |
246 | }; | 246 | }; |
247 | 247 | ||
248 | if (pin == 0) | 248 | if (pin == 0) |
249 | return -EINVAL; | 249 | return -EINVAL; |
250 | 250 | ||
251 | if (pin < 0) { | 251 | if (pin < 0) { |
252 | /* inverted gpio */ | 252 | /* inverted gpio */ |
253 | gpio = pin * -1; | 253 | gpio = pin * -1; |
254 | lvl = enable ? 0 : 1; | 254 | lvl = enable ? 0 : 1; |
255 | } else { | 255 | } else { |
256 | gpio = pin; | 256 | gpio = pin; |
257 | lvl = enable ? 1 : 0; | 257 | lvl = enable ? 1 : 0; |
258 | } | 258 | } |
259 | 259 | ||
260 | ret = smscore_configure_gpio(coredev, gpio, &gpioconfig); | 260 | ret = smscore_configure_gpio(coredev, gpio, &gpioconfig); |
261 | if (ret < 0) | 261 | if (ret < 0) |
262 | return ret; | 262 | return ret; |
263 | 263 | ||
264 | return smscore_set_gpio(coredev, gpio, lvl); | 264 | return smscore_set_gpio(coredev, gpio, lvl); |
265 | } | 265 | } |
266 | 266 | ||
267 | int sms_board_setup(struct smscore_device_t *coredev) | 267 | int sms_board_setup(struct smscore_device_t *coredev) |
268 | { | 268 | { |
269 | int board_id = smscore_get_board_id(coredev); | 269 | int board_id = smscore_get_board_id(coredev); |
270 | struct sms_board *board = sms_get_board(board_id); | 270 | struct sms_board *board = sms_get_board(board_id); |
271 | 271 | ||
272 | switch (board_id) { | 272 | switch (board_id) { |
273 | case SMS1XXX_BOARD_HAUPPAUGE_WINDHAM: | 273 | case SMS1XXX_BOARD_HAUPPAUGE_WINDHAM: |
274 | /* turn off all LEDs */ | 274 | /* turn off all LEDs */ |
275 | sms_set_gpio(coredev, board->led_power, 0); | 275 | sms_set_gpio(coredev, board->led_power, 0); |
276 | sms_set_gpio(coredev, board->led_hi, 0); | 276 | sms_set_gpio(coredev, board->led_hi, 0); |
277 | sms_set_gpio(coredev, board->led_lo, 0); | 277 | sms_set_gpio(coredev, board->led_lo, 0); |
278 | break; | 278 | break; |
279 | case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2: | 279 | case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2: |
280 | case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD: | 280 | case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD: |
281 | /* turn off LNA */ | 281 | /* turn off LNA */ |
282 | sms_set_gpio(coredev, board->lna_ctrl, 0); | 282 | sms_set_gpio(coredev, board->lna_ctrl, 0); |
283 | break; | 283 | break; |
284 | } | 284 | } |
285 | return 0; | 285 | return 0; |
286 | } | 286 | } |
287 | EXPORT_SYMBOL_GPL(sms_board_setup); | 287 | EXPORT_SYMBOL_GPL(sms_board_setup); |
288 | 288 | ||
289 | int sms_board_power(struct smscore_device_t *coredev, int onoff) | 289 | int sms_board_power(struct smscore_device_t *coredev, int onoff) |
290 | { | 290 | { |
291 | int board_id = smscore_get_board_id(coredev); | 291 | int board_id = smscore_get_board_id(coredev); |
292 | struct sms_board *board = sms_get_board(board_id); | 292 | struct sms_board *board = sms_get_board(board_id); |
293 | 293 | ||
294 | switch (board_id) { | 294 | switch (board_id) { |
295 | case SMS1XXX_BOARD_HAUPPAUGE_WINDHAM: | 295 | case SMS1XXX_BOARD_HAUPPAUGE_WINDHAM: |
296 | /* power LED */ | 296 | /* power LED */ |
297 | sms_set_gpio(coredev, | 297 | sms_set_gpio(coredev, |
298 | board->led_power, onoff ? 1 : 0); | 298 | board->led_power, onoff ? 1 : 0); |
299 | break; | 299 | break; |
300 | case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2: | 300 | case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2: |
301 | case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD: | 301 | case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD: |
302 | /* LNA */ | 302 | /* LNA */ |
303 | if (!onoff) | 303 | if (!onoff) |
304 | sms_set_gpio(coredev, board->lna_ctrl, 0); | 304 | sms_set_gpio(coredev, board->lna_ctrl, 0); |
305 | break; | 305 | break; |
306 | } | 306 | } |
307 | return 0; | 307 | return 0; |
308 | } | 308 | } |
309 | EXPORT_SYMBOL_GPL(sms_board_power); | 309 | EXPORT_SYMBOL_GPL(sms_board_power); |
310 | 310 | ||
311 | int sms_board_led_feedback(struct smscore_device_t *coredev, int led) | 311 | int sms_board_led_feedback(struct smscore_device_t *coredev, int led) |
312 | { | 312 | { |
313 | int board_id = smscore_get_board_id(coredev); | 313 | int board_id = smscore_get_board_id(coredev); |
314 | struct sms_board *board = sms_get_board(board_id); | 314 | struct sms_board *board = sms_get_board(board_id); |
315 | 315 | ||
316 | /* dont touch GPIO if LEDs are already set */ | 316 | /* dont touch GPIO if LEDs are already set */ |
317 | if (smscore_led_state(coredev, -1) == led) | 317 | if (smscore_led_state(coredev, -1) == led) |
318 | return 0; | 318 | return 0; |
319 | 319 | ||
320 | switch (board_id) { | 320 | switch (board_id) { |
321 | case SMS1XXX_BOARD_HAUPPAUGE_WINDHAM: | 321 | case SMS1XXX_BOARD_HAUPPAUGE_WINDHAM: |
322 | sms_set_gpio(coredev, | 322 | sms_set_gpio(coredev, |
323 | board->led_lo, (led & SMS_LED_LO) ? 1 : 0); | 323 | board->led_lo, (led & SMS_LED_LO) ? 1 : 0); |
324 | sms_set_gpio(coredev, | 324 | sms_set_gpio(coredev, |
325 | board->led_hi, (led & SMS_LED_HI) ? 1 : 0); | 325 | board->led_hi, (led & SMS_LED_HI) ? 1 : 0); |
326 | 326 | ||
327 | smscore_led_state(coredev, led); | 327 | smscore_led_state(coredev, led); |
328 | break; | 328 | break; |
329 | } | 329 | } |
330 | return 0; | 330 | return 0; |
331 | } | 331 | } |
332 | EXPORT_SYMBOL_GPL(sms_board_led_feedback); | 332 | EXPORT_SYMBOL_GPL(sms_board_led_feedback); |
333 | 333 | ||
334 | int sms_board_lna_control(struct smscore_device_t *coredev, int onoff) | 334 | int sms_board_lna_control(struct smscore_device_t *coredev, int onoff) |
335 | { | 335 | { |
336 | int board_id = smscore_get_board_id(coredev); | 336 | int board_id = smscore_get_board_id(coredev); |
337 | struct sms_board *board = sms_get_board(board_id); | 337 | struct sms_board *board = sms_get_board(board_id); |
338 | 338 | ||
339 | sms_debug("%s: LNA %s", __func__, onoff ? "enabled" : "disabled"); | 339 | sms_debug("%s: LNA %s", __func__, onoff ? "enabled" : "disabled"); |
340 | 340 | ||
341 | switch (board_id) { | 341 | switch (board_id) { |
342 | case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2: | 342 | case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2: |
343 | case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD: | 343 | case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD: |
344 | sms_set_gpio(coredev, | 344 | sms_set_gpio(coredev, |
345 | board->rf_switch, onoff ? 1 : 0); | 345 | board->rf_switch, onoff ? 1 : 0); |
346 | return sms_set_gpio(coredev, | 346 | return sms_set_gpio(coredev, |
347 | board->lna_ctrl, onoff ? 1 : 0); | 347 | board->lna_ctrl, onoff ? 1 : 0); |
348 | } | 348 | } |
349 | return -EINVAL; | 349 | return -EINVAL; |
350 | } | 350 | } |
351 | EXPORT_SYMBOL_GPL(sms_board_lna_control); | 351 | EXPORT_SYMBOL_GPL(sms_board_lna_control); |
352 | 352 | ||
353 | int sms_board_load_modules(int id) | 353 | int sms_board_load_modules(int id) |
354 | { | 354 | { |
355 | request_module("smsdvb"); | 355 | request_module("smsdvb"); |
356 | return 0; | 356 | return 0; |
357 | } | 357 | } |
358 | EXPORT_SYMBOL_GPL(sms_board_load_modules); | 358 | EXPORT_SYMBOL_GPL(sms_board_load_modules); |
359 | 359 |
drivers/media/common/siano/smscoreapi.c
1 | /* | 1 | /* |
2 | * Siano core API module | 2 | * Siano core API module |
3 | * | 3 | * |
4 | * This file contains implementation for the interface to sms core component | 4 | * This file contains implementation for the interface to sms core component |
5 | * | 5 | * |
6 | * author: Uri Shkolnik | 6 | * author: Uri Shkolnik |
7 | * | 7 | * |
8 | * Copyright (c), 2005-2008 Siano Mobile Silicon, Inc. | 8 | * Copyright (c), 2005-2008 Siano Mobile Silicon, Inc. |
9 | * | 9 | * |
10 | * This program is free software; you can redistribute it and/or modify | 10 | * This program is free software; you can redistribute it and/or modify |
11 | * it under the terms of the GNU General Public License version 2 as | 11 | * it under the terms of the GNU General Public License version 2 as |
12 | * published by the Free Software Foundation; | 12 | * published by the Free Software Foundation; |
13 | * | 13 | * |
14 | * Software distributed under the License is distributed on an "AS IS" | 14 | * Software distributed under the License is distributed on an "AS IS" |
15 | * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | 15 | * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. |
16 | * | 16 | * |
17 | * See the GNU General Public License for more details. | 17 | * See the GNU General Public License for more details. |
18 | * | 18 | * |
19 | * You should have received a copy of the GNU General Public License | 19 | * You should have received a copy of the GNU General Public License |
20 | * along with this program; if not, write to the Free Software | 20 | * along with this program; if not, write to the Free Software |
21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <linux/kernel.h> | 24 | #include <linux/kernel.h> |
25 | #include <linux/init.h> | 25 | #include <linux/init.h> |
26 | #include <linux/module.h> | 26 | #include <linux/module.h> |
27 | #include <linux/moduleparam.h> | 27 | #include <linux/moduleparam.h> |
28 | #include <linux/dma-mapping.h> | 28 | #include <linux/dma-mapping.h> |
29 | #include <linux/delay.h> | 29 | #include <linux/delay.h> |
30 | #include <linux/io.h> | 30 | #include <linux/io.h> |
31 | #include <linux/slab.h> | 31 | #include <linux/slab.h> |
32 | 32 | ||
33 | #include <linux/firmware.h> | 33 | #include <linux/firmware.h> |
34 | #include <linux/wait.h> | 34 | #include <linux/wait.h> |
35 | #include <asm/byteorder.h> | 35 | #include <asm/byteorder.h> |
36 | 36 | ||
37 | #include "smscoreapi.h" | 37 | #include "smscoreapi.h" |
38 | #include "sms-cards.h" | 38 | #include "sms-cards.h" |
39 | #include "smsir.h" | 39 | #include "smsir.h" |
40 | 40 | ||
41 | static int sms_dbg; | 41 | static int sms_dbg; |
42 | module_param_named(debug, sms_dbg, int, 0644); | 42 | module_param_named(debug, sms_dbg, int, 0644); |
43 | MODULE_PARM_DESC(debug, "set debug level (info=1, adv=2 (or-able))"); | 43 | MODULE_PARM_DESC(debug, "set debug level (info=1, adv=2 (or-able))"); |
44 | 44 | ||
45 | struct smscore_device_notifyee_t { | 45 | struct smscore_device_notifyee_t { |
46 | struct list_head entry; | 46 | struct list_head entry; |
47 | hotplug_t hotplug; | 47 | hotplug_t hotplug; |
48 | }; | 48 | }; |
49 | 49 | ||
50 | struct smscore_idlist_t { | 50 | struct smscore_idlist_t { |
51 | struct list_head entry; | 51 | struct list_head entry; |
52 | int id; | 52 | int id; |
53 | int data_type; | 53 | int data_type; |
54 | }; | 54 | }; |
55 | 55 | ||
56 | struct smscore_client_t { | 56 | struct smscore_client_t { |
57 | struct list_head entry; | 57 | struct list_head entry; |
58 | struct smscore_device_t *coredev; | 58 | struct smscore_device_t *coredev; |
59 | void *context; | 59 | void *context; |
60 | struct list_head idlist; | 60 | struct list_head idlist; |
61 | onresponse_t onresponse_handler; | 61 | onresponse_t onresponse_handler; |
62 | onremove_t onremove_handler; | 62 | onremove_t onremove_handler; |
63 | }; | 63 | }; |
64 | 64 | ||
65 | static char *siano_msgs[] = { | 65 | static char *siano_msgs[] = { |
66 | [MSG_TYPE_BASE_VAL - MSG_TYPE_BASE_VAL] = "MSG_TYPE_BASE_VAL", | 66 | [MSG_TYPE_BASE_VAL - MSG_TYPE_BASE_VAL] = "MSG_TYPE_BASE_VAL", |
67 | [MSG_SMS_GET_VERSION_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_VERSION_REQ", | 67 | [MSG_SMS_GET_VERSION_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_VERSION_REQ", |
68 | [MSG_SMS_GET_VERSION_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_VERSION_RES", | 68 | [MSG_SMS_GET_VERSION_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_VERSION_RES", |
69 | [MSG_SMS_MULTI_BRIDGE_CFG - MSG_TYPE_BASE_VAL] = "MSG_SMS_MULTI_BRIDGE_CFG", | 69 | [MSG_SMS_MULTI_BRIDGE_CFG - MSG_TYPE_BASE_VAL] = "MSG_SMS_MULTI_BRIDGE_CFG", |
70 | [MSG_SMS_GPIO_CONFIG_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GPIO_CONFIG_REQ", | 70 | [MSG_SMS_GPIO_CONFIG_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GPIO_CONFIG_REQ", |
71 | [MSG_SMS_GPIO_CONFIG_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GPIO_CONFIG_RES", | 71 | [MSG_SMS_GPIO_CONFIG_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GPIO_CONFIG_RES", |
72 | [MSG_SMS_GPIO_SET_LEVEL_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GPIO_SET_LEVEL_REQ", | 72 | [MSG_SMS_GPIO_SET_LEVEL_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GPIO_SET_LEVEL_REQ", |
73 | [MSG_SMS_GPIO_SET_LEVEL_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GPIO_SET_LEVEL_RES", | 73 | [MSG_SMS_GPIO_SET_LEVEL_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GPIO_SET_LEVEL_RES", |
74 | [MSG_SMS_GPIO_GET_LEVEL_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GPIO_GET_LEVEL_REQ", | 74 | [MSG_SMS_GPIO_GET_LEVEL_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GPIO_GET_LEVEL_REQ", |
75 | [MSG_SMS_GPIO_GET_LEVEL_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GPIO_GET_LEVEL_RES", | 75 | [MSG_SMS_GPIO_GET_LEVEL_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GPIO_GET_LEVEL_RES", |
76 | [MSG_SMS_EEPROM_BURN_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_EEPROM_BURN_IND", | 76 | [MSG_SMS_EEPROM_BURN_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_EEPROM_BURN_IND", |
77 | [MSG_SMS_LOG_ENABLE_CHANGE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_LOG_ENABLE_CHANGE_REQ", | 77 | [MSG_SMS_LOG_ENABLE_CHANGE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_LOG_ENABLE_CHANGE_REQ", |
78 | [MSG_SMS_LOG_ENABLE_CHANGE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_LOG_ENABLE_CHANGE_RES", | 78 | [MSG_SMS_LOG_ENABLE_CHANGE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_LOG_ENABLE_CHANGE_RES", |
79 | [MSG_SMS_SET_MAX_TX_MSG_LEN_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SET_MAX_TX_MSG_LEN_REQ", | 79 | [MSG_SMS_SET_MAX_TX_MSG_LEN_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SET_MAX_TX_MSG_LEN_REQ", |
80 | [MSG_SMS_SET_MAX_TX_MSG_LEN_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SET_MAX_TX_MSG_LEN_RES", | 80 | [MSG_SMS_SET_MAX_TX_MSG_LEN_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SET_MAX_TX_MSG_LEN_RES", |
81 | [MSG_SMS_SPI_HALFDUPLEX_TOKEN_HOST_TO_DEVICE - MSG_TYPE_BASE_VAL] = "MSG_SMS_SPI_HALFDUPLEX_TOKEN_HOST_TO_DEVICE", | 81 | [MSG_SMS_SPI_HALFDUPLEX_TOKEN_HOST_TO_DEVICE - MSG_TYPE_BASE_VAL] = "MSG_SMS_SPI_HALFDUPLEX_TOKEN_HOST_TO_DEVICE", |
82 | [MSG_SMS_SPI_HALFDUPLEX_TOKEN_DEVICE_TO_HOST - MSG_TYPE_BASE_VAL] = "MSG_SMS_SPI_HALFDUPLEX_TOKEN_DEVICE_TO_HOST", | 82 | [MSG_SMS_SPI_HALFDUPLEX_TOKEN_DEVICE_TO_HOST - MSG_TYPE_BASE_VAL] = "MSG_SMS_SPI_HALFDUPLEX_TOKEN_DEVICE_TO_HOST", |
83 | [MSG_SMS_BACKGROUND_SCAN_FLAG_CHANGE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_BACKGROUND_SCAN_FLAG_CHANGE_REQ", | 83 | [MSG_SMS_BACKGROUND_SCAN_FLAG_CHANGE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_BACKGROUND_SCAN_FLAG_CHANGE_REQ", |
84 | [MSG_SMS_BACKGROUND_SCAN_FLAG_CHANGE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_BACKGROUND_SCAN_FLAG_CHANGE_RES", | 84 | [MSG_SMS_BACKGROUND_SCAN_FLAG_CHANGE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_BACKGROUND_SCAN_FLAG_CHANGE_RES", |
85 | [MSG_SMS_BACKGROUND_SCAN_SIGNAL_DETECTED_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_BACKGROUND_SCAN_SIGNAL_DETECTED_IND", | 85 | [MSG_SMS_BACKGROUND_SCAN_SIGNAL_DETECTED_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_BACKGROUND_SCAN_SIGNAL_DETECTED_IND", |
86 | [MSG_SMS_BACKGROUND_SCAN_NO_SIGNAL_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_BACKGROUND_SCAN_NO_SIGNAL_IND", | 86 | [MSG_SMS_BACKGROUND_SCAN_NO_SIGNAL_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_BACKGROUND_SCAN_NO_SIGNAL_IND", |
87 | [MSG_SMS_CONFIGURE_RF_SWITCH_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CONFIGURE_RF_SWITCH_REQ", | 87 | [MSG_SMS_CONFIGURE_RF_SWITCH_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CONFIGURE_RF_SWITCH_REQ", |
88 | [MSG_SMS_CONFIGURE_RF_SWITCH_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CONFIGURE_RF_SWITCH_RES", | 88 | [MSG_SMS_CONFIGURE_RF_SWITCH_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CONFIGURE_RF_SWITCH_RES", |
89 | [MSG_SMS_MRC_PATH_DISCONNECT_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_MRC_PATH_DISCONNECT_REQ", | 89 | [MSG_SMS_MRC_PATH_DISCONNECT_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_MRC_PATH_DISCONNECT_REQ", |
90 | [MSG_SMS_MRC_PATH_DISCONNECT_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_MRC_PATH_DISCONNECT_RES", | 90 | [MSG_SMS_MRC_PATH_DISCONNECT_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_MRC_PATH_DISCONNECT_RES", |
91 | [MSG_SMS_RECEIVE_1SEG_THROUGH_FULLSEG_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_RECEIVE_1SEG_THROUGH_FULLSEG_REQ", | 91 | [MSG_SMS_RECEIVE_1SEG_THROUGH_FULLSEG_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_RECEIVE_1SEG_THROUGH_FULLSEG_REQ", |
92 | [MSG_SMS_RECEIVE_1SEG_THROUGH_FULLSEG_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_RECEIVE_1SEG_THROUGH_FULLSEG_RES", | 92 | [MSG_SMS_RECEIVE_1SEG_THROUGH_FULLSEG_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_RECEIVE_1SEG_THROUGH_FULLSEG_RES", |
93 | [MSG_SMS_RECEIVE_VHF_VIA_VHF_INPUT_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_RECEIVE_VHF_VIA_VHF_INPUT_REQ", | 93 | [MSG_SMS_RECEIVE_VHF_VIA_VHF_INPUT_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_RECEIVE_VHF_VIA_VHF_INPUT_REQ", |
94 | [MSG_SMS_RECEIVE_VHF_VIA_VHF_INPUT_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_RECEIVE_VHF_VIA_VHF_INPUT_RES", | 94 | [MSG_SMS_RECEIVE_VHF_VIA_VHF_INPUT_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_RECEIVE_VHF_VIA_VHF_INPUT_RES", |
95 | [MSG_WR_REG_RFT_REQ - MSG_TYPE_BASE_VAL] = "MSG_WR_REG_RFT_REQ", | 95 | [MSG_WR_REG_RFT_REQ - MSG_TYPE_BASE_VAL] = "MSG_WR_REG_RFT_REQ", |
96 | [MSG_WR_REG_RFT_RES - MSG_TYPE_BASE_VAL] = "MSG_WR_REG_RFT_RES", | 96 | [MSG_WR_REG_RFT_RES - MSG_TYPE_BASE_VAL] = "MSG_WR_REG_RFT_RES", |
97 | [MSG_RD_REG_RFT_REQ - MSG_TYPE_BASE_VAL] = "MSG_RD_REG_RFT_REQ", | 97 | [MSG_RD_REG_RFT_REQ - MSG_TYPE_BASE_VAL] = "MSG_RD_REG_RFT_REQ", |
98 | [MSG_RD_REG_RFT_RES - MSG_TYPE_BASE_VAL] = "MSG_RD_REG_RFT_RES", | 98 | [MSG_RD_REG_RFT_RES - MSG_TYPE_BASE_VAL] = "MSG_RD_REG_RFT_RES", |
99 | [MSG_RD_REG_ALL_RFT_REQ - MSG_TYPE_BASE_VAL] = "MSG_RD_REG_ALL_RFT_REQ", | 99 | [MSG_RD_REG_ALL_RFT_REQ - MSG_TYPE_BASE_VAL] = "MSG_RD_REG_ALL_RFT_REQ", |
100 | [MSG_RD_REG_ALL_RFT_RES - MSG_TYPE_BASE_VAL] = "MSG_RD_REG_ALL_RFT_RES", | 100 | [MSG_RD_REG_ALL_RFT_RES - MSG_TYPE_BASE_VAL] = "MSG_RD_REG_ALL_RFT_RES", |
101 | [MSG_HELP_INT - MSG_TYPE_BASE_VAL] = "MSG_HELP_INT", | 101 | [MSG_HELP_INT - MSG_TYPE_BASE_VAL] = "MSG_HELP_INT", |
102 | [MSG_RUN_SCRIPT_INT - MSG_TYPE_BASE_VAL] = "MSG_RUN_SCRIPT_INT", | 102 | [MSG_RUN_SCRIPT_INT - MSG_TYPE_BASE_VAL] = "MSG_RUN_SCRIPT_INT", |
103 | [MSG_SMS_EWS_INBAND_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_EWS_INBAND_REQ", | 103 | [MSG_SMS_EWS_INBAND_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_EWS_INBAND_REQ", |
104 | [MSG_SMS_EWS_INBAND_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_EWS_INBAND_RES", | 104 | [MSG_SMS_EWS_INBAND_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_EWS_INBAND_RES", |
105 | [MSG_SMS_RFS_SELECT_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_RFS_SELECT_REQ", | 105 | [MSG_SMS_RFS_SELECT_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_RFS_SELECT_REQ", |
106 | [MSG_SMS_RFS_SELECT_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_RFS_SELECT_RES", | 106 | [MSG_SMS_RFS_SELECT_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_RFS_SELECT_RES", |
107 | [MSG_SMS_MB_GET_VER_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_MB_GET_VER_REQ", | 107 | [MSG_SMS_MB_GET_VER_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_MB_GET_VER_REQ", |
108 | [MSG_SMS_MB_GET_VER_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_MB_GET_VER_RES", | 108 | [MSG_SMS_MB_GET_VER_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_MB_GET_VER_RES", |
109 | [MSG_SMS_MB_WRITE_CFGFILE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_MB_WRITE_CFGFILE_REQ", | 109 | [MSG_SMS_MB_WRITE_CFGFILE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_MB_WRITE_CFGFILE_REQ", |
110 | [MSG_SMS_MB_WRITE_CFGFILE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_MB_WRITE_CFGFILE_RES", | 110 | [MSG_SMS_MB_WRITE_CFGFILE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_MB_WRITE_CFGFILE_RES", |
111 | [MSG_SMS_MB_READ_CFGFILE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_MB_READ_CFGFILE_REQ", | 111 | [MSG_SMS_MB_READ_CFGFILE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_MB_READ_CFGFILE_REQ", |
112 | [MSG_SMS_MB_READ_CFGFILE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_MB_READ_CFGFILE_RES", | 112 | [MSG_SMS_MB_READ_CFGFILE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_MB_READ_CFGFILE_RES", |
113 | [MSG_SMS_RD_MEM_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_RD_MEM_REQ", | 113 | [MSG_SMS_RD_MEM_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_RD_MEM_REQ", |
114 | [MSG_SMS_RD_MEM_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_RD_MEM_RES", | 114 | [MSG_SMS_RD_MEM_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_RD_MEM_RES", |
115 | [MSG_SMS_WR_MEM_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_WR_MEM_REQ", | 115 | [MSG_SMS_WR_MEM_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_WR_MEM_REQ", |
116 | [MSG_SMS_WR_MEM_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_WR_MEM_RES", | 116 | [MSG_SMS_WR_MEM_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_WR_MEM_RES", |
117 | [MSG_SMS_UPDATE_MEM_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_UPDATE_MEM_REQ", | 117 | [MSG_SMS_UPDATE_MEM_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_UPDATE_MEM_REQ", |
118 | [MSG_SMS_UPDATE_MEM_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_UPDATE_MEM_RES", | 118 | [MSG_SMS_UPDATE_MEM_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_UPDATE_MEM_RES", |
119 | [MSG_SMS_ISDBT_ENABLE_FULL_PARAMS_SET_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ISDBT_ENABLE_FULL_PARAMS_SET_REQ", | 119 | [MSG_SMS_ISDBT_ENABLE_FULL_PARAMS_SET_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ISDBT_ENABLE_FULL_PARAMS_SET_REQ", |
120 | [MSG_SMS_ISDBT_ENABLE_FULL_PARAMS_SET_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ISDBT_ENABLE_FULL_PARAMS_SET_RES", | 120 | [MSG_SMS_ISDBT_ENABLE_FULL_PARAMS_SET_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ISDBT_ENABLE_FULL_PARAMS_SET_RES", |
121 | [MSG_SMS_RF_TUNE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_RF_TUNE_REQ", | 121 | [MSG_SMS_RF_TUNE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_RF_TUNE_REQ", |
122 | [MSG_SMS_RF_TUNE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_RF_TUNE_RES", | 122 | [MSG_SMS_RF_TUNE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_RF_TUNE_RES", |
123 | [MSG_SMS_ISDBT_ENABLE_HIGH_MOBILITY_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ISDBT_ENABLE_HIGH_MOBILITY_REQ", | 123 | [MSG_SMS_ISDBT_ENABLE_HIGH_MOBILITY_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ISDBT_ENABLE_HIGH_MOBILITY_REQ", |
124 | [MSG_SMS_ISDBT_ENABLE_HIGH_MOBILITY_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ISDBT_ENABLE_HIGH_MOBILITY_RES", | 124 | [MSG_SMS_ISDBT_ENABLE_HIGH_MOBILITY_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ISDBT_ENABLE_HIGH_MOBILITY_RES", |
125 | [MSG_SMS_ISDBT_SB_RECEPTION_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ISDBT_SB_RECEPTION_REQ", | 125 | [MSG_SMS_ISDBT_SB_RECEPTION_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ISDBT_SB_RECEPTION_REQ", |
126 | [MSG_SMS_ISDBT_SB_RECEPTION_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ISDBT_SB_RECEPTION_RES", | 126 | [MSG_SMS_ISDBT_SB_RECEPTION_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ISDBT_SB_RECEPTION_RES", |
127 | [MSG_SMS_GENERIC_EPROM_WRITE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GENERIC_EPROM_WRITE_REQ", | 127 | [MSG_SMS_GENERIC_EPROM_WRITE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GENERIC_EPROM_WRITE_REQ", |
128 | [MSG_SMS_GENERIC_EPROM_WRITE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GENERIC_EPROM_WRITE_RES", | 128 | [MSG_SMS_GENERIC_EPROM_WRITE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GENERIC_EPROM_WRITE_RES", |
129 | [MSG_SMS_GENERIC_EPROM_READ_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GENERIC_EPROM_READ_REQ", | 129 | [MSG_SMS_GENERIC_EPROM_READ_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GENERIC_EPROM_READ_REQ", |
130 | [MSG_SMS_GENERIC_EPROM_READ_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GENERIC_EPROM_READ_RES", | 130 | [MSG_SMS_GENERIC_EPROM_READ_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GENERIC_EPROM_READ_RES", |
131 | [MSG_SMS_EEPROM_WRITE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_EEPROM_WRITE_REQ", | 131 | [MSG_SMS_EEPROM_WRITE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_EEPROM_WRITE_REQ", |
132 | [MSG_SMS_EEPROM_WRITE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_EEPROM_WRITE_RES", | 132 | [MSG_SMS_EEPROM_WRITE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_EEPROM_WRITE_RES", |
133 | [MSG_SMS_CUSTOM_READ_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CUSTOM_READ_REQ", | 133 | [MSG_SMS_CUSTOM_READ_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CUSTOM_READ_REQ", |
134 | [MSG_SMS_CUSTOM_READ_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CUSTOM_READ_RES", | 134 | [MSG_SMS_CUSTOM_READ_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CUSTOM_READ_RES", |
135 | [MSG_SMS_CUSTOM_WRITE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CUSTOM_WRITE_REQ", | 135 | [MSG_SMS_CUSTOM_WRITE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CUSTOM_WRITE_REQ", |
136 | [MSG_SMS_CUSTOM_WRITE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CUSTOM_WRITE_RES", | 136 | [MSG_SMS_CUSTOM_WRITE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CUSTOM_WRITE_RES", |
137 | [MSG_SMS_INIT_DEVICE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_INIT_DEVICE_REQ", | 137 | [MSG_SMS_INIT_DEVICE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_INIT_DEVICE_REQ", |
138 | [MSG_SMS_INIT_DEVICE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_INIT_DEVICE_RES", | 138 | [MSG_SMS_INIT_DEVICE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_INIT_DEVICE_RES", |
139 | [MSG_SMS_ATSC_SET_ALL_IP_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_SET_ALL_IP_REQ", | 139 | [MSG_SMS_ATSC_SET_ALL_IP_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_SET_ALL_IP_REQ", |
140 | [MSG_SMS_ATSC_SET_ALL_IP_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_SET_ALL_IP_RES", | 140 | [MSG_SMS_ATSC_SET_ALL_IP_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_SET_ALL_IP_RES", |
141 | [MSG_SMS_ATSC_START_ENSEMBLE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_START_ENSEMBLE_REQ", | 141 | [MSG_SMS_ATSC_START_ENSEMBLE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_START_ENSEMBLE_REQ", |
142 | [MSG_SMS_ATSC_START_ENSEMBLE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_START_ENSEMBLE_RES", | 142 | [MSG_SMS_ATSC_START_ENSEMBLE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_START_ENSEMBLE_RES", |
143 | [MSG_SMS_SET_OUTPUT_MODE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SET_OUTPUT_MODE_REQ", | 143 | [MSG_SMS_SET_OUTPUT_MODE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SET_OUTPUT_MODE_REQ", |
144 | [MSG_SMS_SET_OUTPUT_MODE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SET_OUTPUT_MODE_RES", | 144 | [MSG_SMS_SET_OUTPUT_MODE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SET_OUTPUT_MODE_RES", |
145 | [MSG_SMS_ATSC_IP_FILTER_GET_LIST_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_IP_FILTER_GET_LIST_REQ", | 145 | [MSG_SMS_ATSC_IP_FILTER_GET_LIST_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_IP_FILTER_GET_LIST_REQ", |
146 | [MSG_SMS_ATSC_IP_FILTER_GET_LIST_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_IP_FILTER_GET_LIST_RES", | 146 | [MSG_SMS_ATSC_IP_FILTER_GET_LIST_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_IP_FILTER_GET_LIST_RES", |
147 | [MSG_SMS_SUB_CHANNEL_START_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SUB_CHANNEL_START_REQ", | 147 | [MSG_SMS_SUB_CHANNEL_START_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SUB_CHANNEL_START_REQ", |
148 | [MSG_SMS_SUB_CHANNEL_START_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SUB_CHANNEL_START_RES", | 148 | [MSG_SMS_SUB_CHANNEL_START_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SUB_CHANNEL_START_RES", |
149 | [MSG_SMS_SUB_CHANNEL_STOP_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SUB_CHANNEL_STOP_REQ", | 149 | [MSG_SMS_SUB_CHANNEL_STOP_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SUB_CHANNEL_STOP_REQ", |
150 | [MSG_SMS_SUB_CHANNEL_STOP_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SUB_CHANNEL_STOP_RES", | 150 | [MSG_SMS_SUB_CHANNEL_STOP_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SUB_CHANNEL_STOP_RES", |
151 | [MSG_SMS_ATSC_IP_FILTER_ADD_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_IP_FILTER_ADD_REQ", | 151 | [MSG_SMS_ATSC_IP_FILTER_ADD_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_IP_FILTER_ADD_REQ", |
152 | [MSG_SMS_ATSC_IP_FILTER_ADD_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_IP_FILTER_ADD_RES", | 152 | [MSG_SMS_ATSC_IP_FILTER_ADD_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_IP_FILTER_ADD_RES", |
153 | [MSG_SMS_ATSC_IP_FILTER_REMOVE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_IP_FILTER_REMOVE_REQ", | 153 | [MSG_SMS_ATSC_IP_FILTER_REMOVE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_IP_FILTER_REMOVE_REQ", |
154 | [MSG_SMS_ATSC_IP_FILTER_REMOVE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_IP_FILTER_REMOVE_RES", | 154 | [MSG_SMS_ATSC_IP_FILTER_REMOVE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_IP_FILTER_REMOVE_RES", |
155 | [MSG_SMS_ATSC_IP_FILTER_REMOVE_ALL_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_IP_FILTER_REMOVE_ALL_REQ", | 155 | [MSG_SMS_ATSC_IP_FILTER_REMOVE_ALL_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_IP_FILTER_REMOVE_ALL_REQ", |
156 | [MSG_SMS_ATSC_IP_FILTER_REMOVE_ALL_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_IP_FILTER_REMOVE_ALL_RES", | 156 | [MSG_SMS_ATSC_IP_FILTER_REMOVE_ALL_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_IP_FILTER_REMOVE_ALL_RES", |
157 | [MSG_SMS_WAIT_CMD - MSG_TYPE_BASE_VAL] = "MSG_SMS_WAIT_CMD", | 157 | [MSG_SMS_WAIT_CMD - MSG_TYPE_BASE_VAL] = "MSG_SMS_WAIT_CMD", |
158 | [MSG_SMS_ADD_PID_FILTER_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ADD_PID_FILTER_REQ", | 158 | [MSG_SMS_ADD_PID_FILTER_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ADD_PID_FILTER_REQ", |
159 | [MSG_SMS_ADD_PID_FILTER_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ADD_PID_FILTER_RES", | 159 | [MSG_SMS_ADD_PID_FILTER_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ADD_PID_FILTER_RES", |
160 | [MSG_SMS_REMOVE_PID_FILTER_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_REMOVE_PID_FILTER_REQ", | 160 | [MSG_SMS_REMOVE_PID_FILTER_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_REMOVE_PID_FILTER_REQ", |
161 | [MSG_SMS_REMOVE_PID_FILTER_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_REMOVE_PID_FILTER_RES", | 161 | [MSG_SMS_REMOVE_PID_FILTER_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_REMOVE_PID_FILTER_RES", |
162 | [MSG_SMS_FAST_INFORMATION_CHANNEL_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_FAST_INFORMATION_CHANNEL_REQ", | 162 | [MSG_SMS_FAST_INFORMATION_CHANNEL_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_FAST_INFORMATION_CHANNEL_REQ", |
163 | [MSG_SMS_FAST_INFORMATION_CHANNEL_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_FAST_INFORMATION_CHANNEL_RES", | 163 | [MSG_SMS_FAST_INFORMATION_CHANNEL_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_FAST_INFORMATION_CHANNEL_RES", |
164 | [MSG_SMS_DAB_CHANNEL - MSG_TYPE_BASE_VAL] = "MSG_SMS_DAB_CHANNEL", | 164 | [MSG_SMS_DAB_CHANNEL - MSG_TYPE_BASE_VAL] = "MSG_SMS_DAB_CHANNEL", |
165 | [MSG_SMS_GET_PID_FILTER_LIST_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_PID_FILTER_LIST_REQ", | 165 | [MSG_SMS_GET_PID_FILTER_LIST_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_PID_FILTER_LIST_REQ", |
166 | [MSG_SMS_GET_PID_FILTER_LIST_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_PID_FILTER_LIST_RES", | 166 | [MSG_SMS_GET_PID_FILTER_LIST_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_PID_FILTER_LIST_RES", |
167 | [MSG_SMS_POWER_DOWN_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_POWER_DOWN_REQ", | 167 | [MSG_SMS_POWER_DOWN_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_POWER_DOWN_REQ", |
168 | [MSG_SMS_POWER_DOWN_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_POWER_DOWN_RES", | 168 | [MSG_SMS_POWER_DOWN_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_POWER_DOWN_RES", |
169 | [MSG_SMS_ATSC_SLT_EXIST_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_SLT_EXIST_IND", | 169 | [MSG_SMS_ATSC_SLT_EXIST_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_SLT_EXIST_IND", |
170 | [MSG_SMS_ATSC_NO_SLT_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_NO_SLT_IND", | 170 | [MSG_SMS_ATSC_NO_SLT_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_NO_SLT_IND", |
171 | [MSG_SMS_GET_STATISTICS_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_STATISTICS_REQ", | 171 | [MSG_SMS_GET_STATISTICS_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_STATISTICS_REQ", |
172 | [MSG_SMS_GET_STATISTICS_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_STATISTICS_RES", | 172 | [MSG_SMS_GET_STATISTICS_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_STATISTICS_RES", |
173 | [MSG_SMS_SEND_DUMP - MSG_TYPE_BASE_VAL] = "MSG_SMS_SEND_DUMP", | 173 | [MSG_SMS_SEND_DUMP - MSG_TYPE_BASE_VAL] = "MSG_SMS_SEND_DUMP", |
174 | [MSG_SMS_SCAN_START_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SCAN_START_REQ", | 174 | [MSG_SMS_SCAN_START_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SCAN_START_REQ", |
175 | [MSG_SMS_SCAN_START_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SCAN_START_RES", | 175 | [MSG_SMS_SCAN_START_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SCAN_START_RES", |
176 | [MSG_SMS_SCAN_STOP_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SCAN_STOP_REQ", | 176 | [MSG_SMS_SCAN_STOP_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SCAN_STOP_REQ", |
177 | [MSG_SMS_SCAN_STOP_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SCAN_STOP_RES", | 177 | [MSG_SMS_SCAN_STOP_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SCAN_STOP_RES", |
178 | [MSG_SMS_SCAN_PROGRESS_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_SCAN_PROGRESS_IND", | 178 | [MSG_SMS_SCAN_PROGRESS_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_SCAN_PROGRESS_IND", |
179 | [MSG_SMS_SCAN_COMPLETE_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_SCAN_COMPLETE_IND", | 179 | [MSG_SMS_SCAN_COMPLETE_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_SCAN_COMPLETE_IND", |
180 | [MSG_SMS_LOG_ITEM - MSG_TYPE_BASE_VAL] = "MSG_SMS_LOG_ITEM", | 180 | [MSG_SMS_LOG_ITEM - MSG_TYPE_BASE_VAL] = "MSG_SMS_LOG_ITEM", |
181 | [MSG_SMS_DAB_SUBCHANNEL_RECONFIG_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DAB_SUBCHANNEL_RECONFIG_REQ", | 181 | [MSG_SMS_DAB_SUBCHANNEL_RECONFIG_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DAB_SUBCHANNEL_RECONFIG_REQ", |
182 | [MSG_SMS_DAB_SUBCHANNEL_RECONFIG_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DAB_SUBCHANNEL_RECONFIG_RES", | 182 | [MSG_SMS_DAB_SUBCHANNEL_RECONFIG_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DAB_SUBCHANNEL_RECONFIG_RES", |
183 | [MSG_SMS_HO_PER_SLICES_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_HO_PER_SLICES_IND", | 183 | [MSG_SMS_HO_PER_SLICES_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_HO_PER_SLICES_IND", |
184 | [MSG_SMS_HO_INBAND_POWER_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_HO_INBAND_POWER_IND", | 184 | [MSG_SMS_HO_INBAND_POWER_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_HO_INBAND_POWER_IND", |
185 | [MSG_SMS_MANUAL_DEMOD_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_MANUAL_DEMOD_REQ", | 185 | [MSG_SMS_MANUAL_DEMOD_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_MANUAL_DEMOD_REQ", |
186 | [MSG_SMS_HO_TUNE_ON_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_HO_TUNE_ON_REQ", | 186 | [MSG_SMS_HO_TUNE_ON_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_HO_TUNE_ON_REQ", |
187 | [MSG_SMS_HO_TUNE_ON_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_HO_TUNE_ON_RES", | 187 | [MSG_SMS_HO_TUNE_ON_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_HO_TUNE_ON_RES", |
188 | [MSG_SMS_HO_TUNE_OFF_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_HO_TUNE_OFF_REQ", | 188 | [MSG_SMS_HO_TUNE_OFF_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_HO_TUNE_OFF_REQ", |
189 | [MSG_SMS_HO_TUNE_OFF_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_HO_TUNE_OFF_RES", | 189 | [MSG_SMS_HO_TUNE_OFF_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_HO_TUNE_OFF_RES", |
190 | [MSG_SMS_HO_PEEK_FREQ_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_HO_PEEK_FREQ_REQ", | 190 | [MSG_SMS_HO_PEEK_FREQ_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_HO_PEEK_FREQ_REQ", |
191 | [MSG_SMS_HO_PEEK_FREQ_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_HO_PEEK_FREQ_RES", | 191 | [MSG_SMS_HO_PEEK_FREQ_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_HO_PEEK_FREQ_RES", |
192 | [MSG_SMS_HO_PEEK_FREQ_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_HO_PEEK_FREQ_IND", | 192 | [MSG_SMS_HO_PEEK_FREQ_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_HO_PEEK_FREQ_IND", |
193 | [MSG_SMS_MB_ATTEN_SET_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_MB_ATTEN_SET_REQ", | 193 | [MSG_SMS_MB_ATTEN_SET_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_MB_ATTEN_SET_REQ", |
194 | [MSG_SMS_MB_ATTEN_SET_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_MB_ATTEN_SET_RES", | 194 | [MSG_SMS_MB_ATTEN_SET_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_MB_ATTEN_SET_RES", |
195 | [MSG_SMS_ENABLE_STAT_IN_I2C_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ENABLE_STAT_IN_I2C_REQ", | 195 | [MSG_SMS_ENABLE_STAT_IN_I2C_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ENABLE_STAT_IN_I2C_REQ", |
196 | [MSG_SMS_ENABLE_STAT_IN_I2C_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ENABLE_STAT_IN_I2C_RES", | 196 | [MSG_SMS_ENABLE_STAT_IN_I2C_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ENABLE_STAT_IN_I2C_RES", |
197 | [MSG_SMS_SET_ANTENNA_CONFIG_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SET_ANTENNA_CONFIG_REQ", | 197 | [MSG_SMS_SET_ANTENNA_CONFIG_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SET_ANTENNA_CONFIG_REQ", |
198 | [MSG_SMS_SET_ANTENNA_CONFIG_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SET_ANTENNA_CONFIG_RES", | 198 | [MSG_SMS_SET_ANTENNA_CONFIG_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SET_ANTENNA_CONFIG_RES", |
199 | [MSG_SMS_GET_STATISTICS_EX_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_STATISTICS_EX_REQ", | 199 | [MSG_SMS_GET_STATISTICS_EX_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_STATISTICS_EX_REQ", |
200 | [MSG_SMS_GET_STATISTICS_EX_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_STATISTICS_EX_RES", | 200 | [MSG_SMS_GET_STATISTICS_EX_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_STATISTICS_EX_RES", |
201 | [MSG_SMS_SLEEP_RESUME_COMP_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_SLEEP_RESUME_COMP_IND", | 201 | [MSG_SMS_SLEEP_RESUME_COMP_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_SLEEP_RESUME_COMP_IND", |
202 | [MSG_SMS_SWITCH_HOST_INTERFACE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SWITCH_HOST_INTERFACE_REQ", | 202 | [MSG_SMS_SWITCH_HOST_INTERFACE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SWITCH_HOST_INTERFACE_REQ", |
203 | [MSG_SMS_SWITCH_HOST_INTERFACE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SWITCH_HOST_INTERFACE_RES", | 203 | [MSG_SMS_SWITCH_HOST_INTERFACE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SWITCH_HOST_INTERFACE_RES", |
204 | [MSG_SMS_DATA_DOWNLOAD_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DATA_DOWNLOAD_REQ", | 204 | [MSG_SMS_DATA_DOWNLOAD_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DATA_DOWNLOAD_REQ", |
205 | [MSG_SMS_DATA_DOWNLOAD_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DATA_DOWNLOAD_RES", | 205 | [MSG_SMS_DATA_DOWNLOAD_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DATA_DOWNLOAD_RES", |
206 | [MSG_SMS_DATA_VALIDITY_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DATA_VALIDITY_REQ", | 206 | [MSG_SMS_DATA_VALIDITY_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DATA_VALIDITY_REQ", |
207 | [MSG_SMS_DATA_VALIDITY_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DATA_VALIDITY_RES", | 207 | [MSG_SMS_DATA_VALIDITY_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DATA_VALIDITY_RES", |
208 | [MSG_SMS_SWDOWNLOAD_TRIGGER_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SWDOWNLOAD_TRIGGER_REQ", | 208 | [MSG_SMS_SWDOWNLOAD_TRIGGER_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SWDOWNLOAD_TRIGGER_REQ", |
209 | [MSG_SMS_SWDOWNLOAD_TRIGGER_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SWDOWNLOAD_TRIGGER_RES", | 209 | [MSG_SMS_SWDOWNLOAD_TRIGGER_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SWDOWNLOAD_TRIGGER_RES", |
210 | [MSG_SMS_SWDOWNLOAD_BACKDOOR_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SWDOWNLOAD_BACKDOOR_REQ", | 210 | [MSG_SMS_SWDOWNLOAD_BACKDOOR_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SWDOWNLOAD_BACKDOOR_REQ", |
211 | [MSG_SMS_SWDOWNLOAD_BACKDOOR_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SWDOWNLOAD_BACKDOOR_RES", | 211 | [MSG_SMS_SWDOWNLOAD_BACKDOOR_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SWDOWNLOAD_BACKDOOR_RES", |
212 | [MSG_SMS_GET_VERSION_EX_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_VERSION_EX_REQ", | 212 | [MSG_SMS_GET_VERSION_EX_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_VERSION_EX_REQ", |
213 | [MSG_SMS_GET_VERSION_EX_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_VERSION_EX_RES", | 213 | [MSG_SMS_GET_VERSION_EX_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_VERSION_EX_RES", |
214 | [MSG_SMS_CLOCK_OUTPUT_CONFIG_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CLOCK_OUTPUT_CONFIG_REQ", | 214 | [MSG_SMS_CLOCK_OUTPUT_CONFIG_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CLOCK_OUTPUT_CONFIG_REQ", |
215 | [MSG_SMS_CLOCK_OUTPUT_CONFIG_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CLOCK_OUTPUT_CONFIG_RES", | 215 | [MSG_SMS_CLOCK_OUTPUT_CONFIG_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CLOCK_OUTPUT_CONFIG_RES", |
216 | [MSG_SMS_I2C_SET_FREQ_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_I2C_SET_FREQ_REQ", | 216 | [MSG_SMS_I2C_SET_FREQ_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_I2C_SET_FREQ_REQ", |
217 | [MSG_SMS_I2C_SET_FREQ_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_I2C_SET_FREQ_RES", | 217 | [MSG_SMS_I2C_SET_FREQ_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_I2C_SET_FREQ_RES", |
218 | [MSG_SMS_GENERIC_I2C_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GENERIC_I2C_REQ", | 218 | [MSG_SMS_GENERIC_I2C_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GENERIC_I2C_REQ", |
219 | [MSG_SMS_GENERIC_I2C_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GENERIC_I2C_RES", | 219 | [MSG_SMS_GENERIC_I2C_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GENERIC_I2C_RES", |
220 | [MSG_SMS_DVBT_BDA_DATA - MSG_TYPE_BASE_VAL] = "MSG_SMS_DVBT_BDA_DATA", | 220 | [MSG_SMS_DVBT_BDA_DATA - MSG_TYPE_BASE_VAL] = "MSG_SMS_DVBT_BDA_DATA", |
221 | [MSG_SW_RELOAD_REQ - MSG_TYPE_BASE_VAL] = "MSG_SW_RELOAD_REQ", | 221 | [MSG_SW_RELOAD_REQ - MSG_TYPE_BASE_VAL] = "MSG_SW_RELOAD_REQ", |
222 | [MSG_SMS_DATA_MSG - MSG_TYPE_BASE_VAL] = "MSG_SMS_DATA_MSG", | 222 | [MSG_SMS_DATA_MSG - MSG_TYPE_BASE_VAL] = "MSG_SMS_DATA_MSG", |
223 | [MSG_TABLE_UPLOAD_REQ - MSG_TYPE_BASE_VAL] = "MSG_TABLE_UPLOAD_REQ", | 223 | [MSG_TABLE_UPLOAD_REQ - MSG_TYPE_BASE_VAL] = "MSG_TABLE_UPLOAD_REQ", |
224 | [MSG_TABLE_UPLOAD_RES - MSG_TYPE_BASE_VAL] = "MSG_TABLE_UPLOAD_RES", | 224 | [MSG_TABLE_UPLOAD_RES - MSG_TYPE_BASE_VAL] = "MSG_TABLE_UPLOAD_RES", |
225 | [MSG_SW_RELOAD_START_REQ - MSG_TYPE_BASE_VAL] = "MSG_SW_RELOAD_START_REQ", | 225 | [MSG_SW_RELOAD_START_REQ - MSG_TYPE_BASE_VAL] = "MSG_SW_RELOAD_START_REQ", |
226 | [MSG_SW_RELOAD_START_RES - MSG_TYPE_BASE_VAL] = "MSG_SW_RELOAD_START_RES", | 226 | [MSG_SW_RELOAD_START_RES - MSG_TYPE_BASE_VAL] = "MSG_SW_RELOAD_START_RES", |
227 | [MSG_SW_RELOAD_EXEC_REQ - MSG_TYPE_BASE_VAL] = "MSG_SW_RELOAD_EXEC_REQ", | 227 | [MSG_SW_RELOAD_EXEC_REQ - MSG_TYPE_BASE_VAL] = "MSG_SW_RELOAD_EXEC_REQ", |
228 | [MSG_SW_RELOAD_EXEC_RES - MSG_TYPE_BASE_VAL] = "MSG_SW_RELOAD_EXEC_RES", | 228 | [MSG_SW_RELOAD_EXEC_RES - MSG_TYPE_BASE_VAL] = "MSG_SW_RELOAD_EXEC_RES", |
229 | [MSG_SMS_SPI_INT_LINE_SET_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SPI_INT_LINE_SET_REQ", | 229 | [MSG_SMS_SPI_INT_LINE_SET_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SPI_INT_LINE_SET_REQ", |
230 | [MSG_SMS_SPI_INT_LINE_SET_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SPI_INT_LINE_SET_RES", | 230 | [MSG_SMS_SPI_INT_LINE_SET_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SPI_INT_LINE_SET_RES", |
231 | [MSG_SMS_GPIO_CONFIG_EX_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GPIO_CONFIG_EX_REQ", | 231 | [MSG_SMS_GPIO_CONFIG_EX_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GPIO_CONFIG_EX_REQ", |
232 | [MSG_SMS_GPIO_CONFIG_EX_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GPIO_CONFIG_EX_RES", | 232 | [MSG_SMS_GPIO_CONFIG_EX_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GPIO_CONFIG_EX_RES", |
233 | [MSG_SMS_WATCHDOG_ACT_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_WATCHDOG_ACT_REQ", | 233 | [MSG_SMS_WATCHDOG_ACT_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_WATCHDOG_ACT_REQ", |
234 | [MSG_SMS_WATCHDOG_ACT_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_WATCHDOG_ACT_RES", | 234 | [MSG_SMS_WATCHDOG_ACT_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_WATCHDOG_ACT_RES", |
235 | [MSG_SMS_LOOPBACK_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_LOOPBACK_REQ", | 235 | [MSG_SMS_LOOPBACK_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_LOOPBACK_REQ", |
236 | [MSG_SMS_LOOPBACK_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_LOOPBACK_RES", | 236 | [MSG_SMS_LOOPBACK_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_LOOPBACK_RES", |
237 | [MSG_SMS_RAW_CAPTURE_START_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_RAW_CAPTURE_START_REQ", | 237 | [MSG_SMS_RAW_CAPTURE_START_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_RAW_CAPTURE_START_REQ", |
238 | [MSG_SMS_RAW_CAPTURE_START_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_RAW_CAPTURE_START_RES", | 238 | [MSG_SMS_RAW_CAPTURE_START_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_RAW_CAPTURE_START_RES", |
239 | [MSG_SMS_RAW_CAPTURE_ABORT_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_RAW_CAPTURE_ABORT_REQ", | 239 | [MSG_SMS_RAW_CAPTURE_ABORT_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_RAW_CAPTURE_ABORT_REQ", |
240 | [MSG_SMS_RAW_CAPTURE_ABORT_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_RAW_CAPTURE_ABORT_RES", | 240 | [MSG_SMS_RAW_CAPTURE_ABORT_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_RAW_CAPTURE_ABORT_RES", |
241 | [MSG_SMS_RAW_CAPTURE_COMPLETE_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_RAW_CAPTURE_COMPLETE_IND", | 241 | [MSG_SMS_RAW_CAPTURE_COMPLETE_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_RAW_CAPTURE_COMPLETE_IND", |
242 | [MSG_SMS_DATA_PUMP_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_DATA_PUMP_IND", | 242 | [MSG_SMS_DATA_PUMP_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_DATA_PUMP_IND", |
243 | [MSG_SMS_DATA_PUMP_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DATA_PUMP_REQ", | 243 | [MSG_SMS_DATA_PUMP_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DATA_PUMP_REQ", |
244 | [MSG_SMS_DATA_PUMP_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DATA_PUMP_RES", | 244 | [MSG_SMS_DATA_PUMP_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DATA_PUMP_RES", |
245 | [MSG_SMS_FLASH_DL_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_FLASH_DL_REQ", | 245 | [MSG_SMS_FLASH_DL_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_FLASH_DL_REQ", |
246 | [MSG_SMS_EXEC_TEST_1_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_EXEC_TEST_1_REQ", | 246 | [MSG_SMS_EXEC_TEST_1_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_EXEC_TEST_1_REQ", |
247 | [MSG_SMS_EXEC_TEST_1_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_EXEC_TEST_1_RES", | 247 | [MSG_SMS_EXEC_TEST_1_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_EXEC_TEST_1_RES", |
248 | [MSG_SMS_ENBALE_TS_INTERFACE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ENBALE_TS_INTERFACE_REQ", | 248 | [MSG_SMS_ENBALE_TS_INTERFACE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ENBALE_TS_INTERFACE_REQ", |
249 | [MSG_SMS_ENBALE_TS_INTERFACE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ENBALE_TS_INTERFACE_RES", | 249 | [MSG_SMS_ENBALE_TS_INTERFACE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ENBALE_TS_INTERFACE_RES", |
250 | [MSG_SMS_SPI_SET_BUS_WIDTH_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SPI_SET_BUS_WIDTH_REQ", | 250 | [MSG_SMS_SPI_SET_BUS_WIDTH_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SPI_SET_BUS_WIDTH_REQ", |
251 | [MSG_SMS_SPI_SET_BUS_WIDTH_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SPI_SET_BUS_WIDTH_RES", | 251 | [MSG_SMS_SPI_SET_BUS_WIDTH_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SPI_SET_BUS_WIDTH_RES", |
252 | [MSG_SMS_SEND_EMM_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SEND_EMM_REQ", | 252 | [MSG_SMS_SEND_EMM_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SEND_EMM_REQ", |
253 | [MSG_SMS_SEND_EMM_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SEND_EMM_RES", | 253 | [MSG_SMS_SEND_EMM_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SEND_EMM_RES", |
254 | [MSG_SMS_DISABLE_TS_INTERFACE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DISABLE_TS_INTERFACE_REQ", | 254 | [MSG_SMS_DISABLE_TS_INTERFACE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DISABLE_TS_INTERFACE_REQ", |
255 | [MSG_SMS_DISABLE_TS_INTERFACE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DISABLE_TS_INTERFACE_RES", | 255 | [MSG_SMS_DISABLE_TS_INTERFACE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DISABLE_TS_INTERFACE_RES", |
256 | [MSG_SMS_IS_BUF_FREE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_IS_BUF_FREE_REQ", | 256 | [MSG_SMS_IS_BUF_FREE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_IS_BUF_FREE_REQ", |
257 | [MSG_SMS_IS_BUF_FREE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_IS_BUF_FREE_RES", | 257 | [MSG_SMS_IS_BUF_FREE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_IS_BUF_FREE_RES", |
258 | [MSG_SMS_EXT_ANTENNA_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_EXT_ANTENNA_REQ", | 258 | [MSG_SMS_EXT_ANTENNA_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_EXT_ANTENNA_REQ", |
259 | [MSG_SMS_EXT_ANTENNA_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_EXT_ANTENNA_RES", | 259 | [MSG_SMS_EXT_ANTENNA_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_EXT_ANTENNA_RES", |
260 | [MSG_SMS_CMMB_GET_NET_OF_FREQ_REQ_OBSOLETE - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_GET_NET_OF_FREQ_REQ_OBSOLETE", | 260 | [MSG_SMS_CMMB_GET_NET_OF_FREQ_REQ_OBSOLETE - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_GET_NET_OF_FREQ_REQ_OBSOLETE", |
261 | [MSG_SMS_CMMB_GET_NET_OF_FREQ_RES_OBSOLETE - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_GET_NET_OF_FREQ_RES_OBSOLETE", | 261 | [MSG_SMS_CMMB_GET_NET_OF_FREQ_RES_OBSOLETE - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_GET_NET_OF_FREQ_RES_OBSOLETE", |
262 | [MSG_SMS_BATTERY_LEVEL_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_BATTERY_LEVEL_REQ", | 262 | [MSG_SMS_BATTERY_LEVEL_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_BATTERY_LEVEL_REQ", |
263 | [MSG_SMS_BATTERY_LEVEL_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_BATTERY_LEVEL_RES", | 263 | [MSG_SMS_BATTERY_LEVEL_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_BATTERY_LEVEL_RES", |
264 | [MSG_SMS_CMMB_INJECT_TABLE_REQ_OBSOLETE - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_INJECT_TABLE_REQ_OBSOLETE", | 264 | [MSG_SMS_CMMB_INJECT_TABLE_REQ_OBSOLETE - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_INJECT_TABLE_REQ_OBSOLETE", |
265 | [MSG_SMS_CMMB_INJECT_TABLE_RES_OBSOLETE - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_INJECT_TABLE_RES_OBSOLETE", | 265 | [MSG_SMS_CMMB_INJECT_TABLE_RES_OBSOLETE - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_INJECT_TABLE_RES_OBSOLETE", |
266 | [MSG_SMS_FM_RADIO_BLOCK_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_FM_RADIO_BLOCK_IND", | 266 | [MSG_SMS_FM_RADIO_BLOCK_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_FM_RADIO_BLOCK_IND", |
267 | [MSG_SMS_HOST_NOTIFICATION_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_HOST_NOTIFICATION_IND", | 267 | [MSG_SMS_HOST_NOTIFICATION_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_HOST_NOTIFICATION_IND", |
268 | [MSG_SMS_CMMB_GET_CONTROL_TABLE_REQ_OBSOLETE - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_GET_CONTROL_TABLE_REQ_OBSOLETE", | 268 | [MSG_SMS_CMMB_GET_CONTROL_TABLE_REQ_OBSOLETE - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_GET_CONTROL_TABLE_REQ_OBSOLETE", |
269 | [MSG_SMS_CMMB_GET_CONTROL_TABLE_RES_OBSOLETE - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_GET_CONTROL_TABLE_RES_OBSOLETE", | 269 | [MSG_SMS_CMMB_GET_CONTROL_TABLE_RES_OBSOLETE - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_GET_CONTROL_TABLE_RES_OBSOLETE", |
270 | [MSG_SMS_CMMB_GET_NETWORKS_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_GET_NETWORKS_REQ", | 270 | [MSG_SMS_CMMB_GET_NETWORKS_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_GET_NETWORKS_REQ", |
271 | [MSG_SMS_CMMB_GET_NETWORKS_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_GET_NETWORKS_RES", | 271 | [MSG_SMS_CMMB_GET_NETWORKS_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_GET_NETWORKS_RES", |
272 | [MSG_SMS_CMMB_START_SERVICE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_START_SERVICE_REQ", | 272 | [MSG_SMS_CMMB_START_SERVICE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_START_SERVICE_REQ", |
273 | [MSG_SMS_CMMB_START_SERVICE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_START_SERVICE_RES", | 273 | [MSG_SMS_CMMB_START_SERVICE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_START_SERVICE_RES", |
274 | [MSG_SMS_CMMB_STOP_SERVICE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_STOP_SERVICE_REQ", | 274 | [MSG_SMS_CMMB_STOP_SERVICE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_STOP_SERVICE_REQ", |
275 | [MSG_SMS_CMMB_STOP_SERVICE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_STOP_SERVICE_RES", | 275 | [MSG_SMS_CMMB_STOP_SERVICE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_STOP_SERVICE_RES", |
276 | [MSG_SMS_CMMB_ADD_CHANNEL_FILTER_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_ADD_CHANNEL_FILTER_REQ", | 276 | [MSG_SMS_CMMB_ADD_CHANNEL_FILTER_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_ADD_CHANNEL_FILTER_REQ", |
277 | [MSG_SMS_CMMB_ADD_CHANNEL_FILTER_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_ADD_CHANNEL_FILTER_RES", | 277 | [MSG_SMS_CMMB_ADD_CHANNEL_FILTER_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_ADD_CHANNEL_FILTER_RES", |
278 | [MSG_SMS_CMMB_REMOVE_CHANNEL_FILTER_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_REMOVE_CHANNEL_FILTER_REQ", | 278 | [MSG_SMS_CMMB_REMOVE_CHANNEL_FILTER_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_REMOVE_CHANNEL_FILTER_REQ", |
279 | [MSG_SMS_CMMB_REMOVE_CHANNEL_FILTER_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_REMOVE_CHANNEL_FILTER_RES", | 279 | [MSG_SMS_CMMB_REMOVE_CHANNEL_FILTER_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_REMOVE_CHANNEL_FILTER_RES", |
280 | [MSG_SMS_CMMB_START_CONTROL_INFO_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_START_CONTROL_INFO_REQ", | 280 | [MSG_SMS_CMMB_START_CONTROL_INFO_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_START_CONTROL_INFO_REQ", |
281 | [MSG_SMS_CMMB_START_CONTROL_INFO_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_START_CONTROL_INFO_RES", | 281 | [MSG_SMS_CMMB_START_CONTROL_INFO_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_START_CONTROL_INFO_RES", |
282 | [MSG_SMS_CMMB_STOP_CONTROL_INFO_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_STOP_CONTROL_INFO_REQ", | 282 | [MSG_SMS_CMMB_STOP_CONTROL_INFO_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_STOP_CONTROL_INFO_REQ", |
283 | [MSG_SMS_CMMB_STOP_CONTROL_INFO_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_STOP_CONTROL_INFO_RES", | 283 | [MSG_SMS_CMMB_STOP_CONTROL_INFO_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_STOP_CONTROL_INFO_RES", |
284 | [MSG_SMS_ISDBT_TUNE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ISDBT_TUNE_REQ", | 284 | [MSG_SMS_ISDBT_TUNE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ISDBT_TUNE_REQ", |
285 | [MSG_SMS_ISDBT_TUNE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ISDBT_TUNE_RES", | 285 | [MSG_SMS_ISDBT_TUNE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ISDBT_TUNE_RES", |
286 | [MSG_SMS_TRANSMISSION_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_TRANSMISSION_IND", | 286 | [MSG_SMS_TRANSMISSION_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_TRANSMISSION_IND", |
287 | [MSG_SMS_PID_STATISTICS_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_PID_STATISTICS_IND", | 287 | [MSG_SMS_PID_STATISTICS_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_PID_STATISTICS_IND", |
288 | [MSG_SMS_POWER_DOWN_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_POWER_DOWN_IND", | 288 | [MSG_SMS_POWER_DOWN_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_POWER_DOWN_IND", |
289 | [MSG_SMS_POWER_DOWN_CONF - MSG_TYPE_BASE_VAL] = "MSG_SMS_POWER_DOWN_CONF", | 289 | [MSG_SMS_POWER_DOWN_CONF - MSG_TYPE_BASE_VAL] = "MSG_SMS_POWER_DOWN_CONF", |
290 | [MSG_SMS_POWER_UP_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_POWER_UP_IND", | 290 | [MSG_SMS_POWER_UP_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_POWER_UP_IND", |
291 | [MSG_SMS_POWER_UP_CONF - MSG_TYPE_BASE_VAL] = "MSG_SMS_POWER_UP_CONF", | 291 | [MSG_SMS_POWER_UP_CONF - MSG_TYPE_BASE_VAL] = "MSG_SMS_POWER_UP_CONF", |
292 | [MSG_SMS_POWER_MODE_SET_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_POWER_MODE_SET_REQ", | 292 | [MSG_SMS_POWER_MODE_SET_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_POWER_MODE_SET_REQ", |
293 | [MSG_SMS_POWER_MODE_SET_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_POWER_MODE_SET_RES", | 293 | [MSG_SMS_POWER_MODE_SET_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_POWER_MODE_SET_RES", |
294 | [MSG_SMS_DEBUG_HOST_EVENT_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DEBUG_HOST_EVENT_REQ", | 294 | [MSG_SMS_DEBUG_HOST_EVENT_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DEBUG_HOST_EVENT_REQ", |
295 | [MSG_SMS_DEBUG_HOST_EVENT_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DEBUG_HOST_EVENT_RES", | 295 | [MSG_SMS_DEBUG_HOST_EVENT_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DEBUG_HOST_EVENT_RES", |
296 | [MSG_SMS_NEW_CRYSTAL_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_NEW_CRYSTAL_REQ", | 296 | [MSG_SMS_NEW_CRYSTAL_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_NEW_CRYSTAL_REQ", |
297 | [MSG_SMS_NEW_CRYSTAL_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_NEW_CRYSTAL_RES", | 297 | [MSG_SMS_NEW_CRYSTAL_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_NEW_CRYSTAL_RES", |
298 | [MSG_SMS_CONFIG_SPI_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CONFIG_SPI_REQ", | 298 | [MSG_SMS_CONFIG_SPI_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CONFIG_SPI_REQ", |
299 | [MSG_SMS_CONFIG_SPI_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CONFIG_SPI_RES", | 299 | [MSG_SMS_CONFIG_SPI_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CONFIG_SPI_RES", |
300 | [MSG_SMS_I2C_SHORT_STAT_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_I2C_SHORT_STAT_IND", | 300 | [MSG_SMS_I2C_SHORT_STAT_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_I2C_SHORT_STAT_IND", |
301 | [MSG_SMS_START_IR_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_START_IR_REQ", | 301 | [MSG_SMS_START_IR_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_START_IR_REQ", |
302 | [MSG_SMS_START_IR_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_START_IR_RES", | 302 | [MSG_SMS_START_IR_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_START_IR_RES", |
303 | [MSG_SMS_IR_SAMPLES_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_IR_SAMPLES_IND", | 303 | [MSG_SMS_IR_SAMPLES_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_IR_SAMPLES_IND", |
304 | [MSG_SMS_CMMB_CA_SERVICE_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_CA_SERVICE_IND", | 304 | [MSG_SMS_CMMB_CA_SERVICE_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_CA_SERVICE_IND", |
305 | [MSG_SMS_SLAVE_DEVICE_DETECTED - MSG_TYPE_BASE_VAL] = "MSG_SMS_SLAVE_DEVICE_DETECTED", | 305 | [MSG_SMS_SLAVE_DEVICE_DETECTED - MSG_TYPE_BASE_VAL] = "MSG_SMS_SLAVE_DEVICE_DETECTED", |
306 | [MSG_SMS_INTERFACE_LOCK_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_INTERFACE_LOCK_IND", | 306 | [MSG_SMS_INTERFACE_LOCK_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_INTERFACE_LOCK_IND", |
307 | [MSG_SMS_INTERFACE_UNLOCK_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_INTERFACE_UNLOCK_IND", | 307 | [MSG_SMS_INTERFACE_UNLOCK_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_INTERFACE_UNLOCK_IND", |
308 | [MSG_SMS_SEND_ROSUM_BUFF_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SEND_ROSUM_BUFF_REQ", | 308 | [MSG_SMS_SEND_ROSUM_BUFF_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SEND_ROSUM_BUFF_REQ", |
309 | [MSG_SMS_SEND_ROSUM_BUFF_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SEND_ROSUM_BUFF_RES", | 309 | [MSG_SMS_SEND_ROSUM_BUFF_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SEND_ROSUM_BUFF_RES", |
310 | [MSG_SMS_ROSUM_BUFF - MSG_TYPE_BASE_VAL] = "MSG_SMS_ROSUM_BUFF", | 310 | [MSG_SMS_ROSUM_BUFF - MSG_TYPE_BASE_VAL] = "MSG_SMS_ROSUM_BUFF", |
311 | [MSG_SMS_SET_AES128_KEY_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SET_AES128_KEY_REQ", | 311 | [MSG_SMS_SET_AES128_KEY_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SET_AES128_KEY_REQ", |
312 | [MSG_SMS_SET_AES128_KEY_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SET_AES128_KEY_RES", | 312 | [MSG_SMS_SET_AES128_KEY_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SET_AES128_KEY_RES", |
313 | [MSG_SMS_MBBMS_WRITE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_MBBMS_WRITE_REQ", | 313 | [MSG_SMS_MBBMS_WRITE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_MBBMS_WRITE_REQ", |
314 | [MSG_SMS_MBBMS_WRITE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_MBBMS_WRITE_RES", | 314 | [MSG_SMS_MBBMS_WRITE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_MBBMS_WRITE_RES", |
315 | [MSG_SMS_MBBMS_READ_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_MBBMS_READ_IND", | 315 | [MSG_SMS_MBBMS_READ_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_MBBMS_READ_IND", |
316 | [MSG_SMS_IQ_STREAM_START_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_IQ_STREAM_START_REQ", | 316 | [MSG_SMS_IQ_STREAM_START_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_IQ_STREAM_START_REQ", |
317 | [MSG_SMS_IQ_STREAM_START_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_IQ_STREAM_START_RES", | 317 | [MSG_SMS_IQ_STREAM_START_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_IQ_STREAM_START_RES", |
318 | [MSG_SMS_IQ_STREAM_STOP_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_IQ_STREAM_STOP_REQ", | 318 | [MSG_SMS_IQ_STREAM_STOP_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_IQ_STREAM_STOP_REQ", |
319 | [MSG_SMS_IQ_STREAM_STOP_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_IQ_STREAM_STOP_RES", | 319 | [MSG_SMS_IQ_STREAM_STOP_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_IQ_STREAM_STOP_RES", |
320 | [MSG_SMS_IQ_STREAM_DATA_BLOCK - MSG_TYPE_BASE_VAL] = "MSG_SMS_IQ_STREAM_DATA_BLOCK", | 320 | [MSG_SMS_IQ_STREAM_DATA_BLOCK - MSG_TYPE_BASE_VAL] = "MSG_SMS_IQ_STREAM_DATA_BLOCK", |
321 | [MSG_SMS_GET_EEPROM_VERSION_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_EEPROM_VERSION_REQ", | 321 | [MSG_SMS_GET_EEPROM_VERSION_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_EEPROM_VERSION_REQ", |
322 | [MSG_SMS_GET_EEPROM_VERSION_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_EEPROM_VERSION_RES", | 322 | [MSG_SMS_GET_EEPROM_VERSION_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_EEPROM_VERSION_RES", |
323 | [MSG_SMS_SIGNAL_DETECTED_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_SIGNAL_DETECTED_IND", | 323 | [MSG_SMS_SIGNAL_DETECTED_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_SIGNAL_DETECTED_IND", |
324 | [MSG_SMS_NO_SIGNAL_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_NO_SIGNAL_IND", | 324 | [MSG_SMS_NO_SIGNAL_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_NO_SIGNAL_IND", |
325 | [MSG_SMS_MRC_SHUTDOWN_SLAVE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_MRC_SHUTDOWN_SLAVE_REQ", | 325 | [MSG_SMS_MRC_SHUTDOWN_SLAVE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_MRC_SHUTDOWN_SLAVE_REQ", |
326 | [MSG_SMS_MRC_SHUTDOWN_SLAVE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_MRC_SHUTDOWN_SLAVE_RES", | 326 | [MSG_SMS_MRC_SHUTDOWN_SLAVE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_MRC_SHUTDOWN_SLAVE_RES", |
327 | [MSG_SMS_MRC_BRINGUP_SLAVE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_MRC_BRINGUP_SLAVE_REQ", | 327 | [MSG_SMS_MRC_BRINGUP_SLAVE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_MRC_BRINGUP_SLAVE_REQ", |
328 | [MSG_SMS_MRC_BRINGUP_SLAVE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_MRC_BRINGUP_SLAVE_RES", | 328 | [MSG_SMS_MRC_BRINGUP_SLAVE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_MRC_BRINGUP_SLAVE_RES", |
329 | [MSG_SMS_EXTERNAL_LNA_CTRL_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_EXTERNAL_LNA_CTRL_REQ", | 329 | [MSG_SMS_EXTERNAL_LNA_CTRL_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_EXTERNAL_LNA_CTRL_REQ", |
330 | [MSG_SMS_EXTERNAL_LNA_CTRL_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_EXTERNAL_LNA_CTRL_RES", | 330 | [MSG_SMS_EXTERNAL_LNA_CTRL_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_EXTERNAL_LNA_CTRL_RES", |
331 | [MSG_SMS_SET_PERIODIC_STATISTICS_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SET_PERIODIC_STATISTICS_REQ", | 331 | [MSG_SMS_SET_PERIODIC_STATISTICS_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SET_PERIODIC_STATISTICS_REQ", |
332 | [MSG_SMS_SET_PERIODIC_STATISTICS_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SET_PERIODIC_STATISTICS_RES", | 332 | [MSG_SMS_SET_PERIODIC_STATISTICS_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SET_PERIODIC_STATISTICS_RES", |
333 | [MSG_SMS_CMMB_SET_AUTO_OUTPUT_TS0_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_SET_AUTO_OUTPUT_TS0_REQ", | 333 | [MSG_SMS_CMMB_SET_AUTO_OUTPUT_TS0_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_SET_AUTO_OUTPUT_TS0_REQ", |
334 | [MSG_SMS_CMMB_SET_AUTO_OUTPUT_TS0_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_SET_AUTO_OUTPUT_TS0_RES", | 334 | [MSG_SMS_CMMB_SET_AUTO_OUTPUT_TS0_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_SET_AUTO_OUTPUT_TS0_RES", |
335 | [LOCAL_TUNE - MSG_TYPE_BASE_VAL] = "LOCAL_TUNE", | 335 | [LOCAL_TUNE - MSG_TYPE_BASE_VAL] = "LOCAL_TUNE", |
336 | [LOCAL_IFFT_H_ICI - MSG_TYPE_BASE_VAL] = "LOCAL_IFFT_H_ICI", | 336 | [LOCAL_IFFT_H_ICI - MSG_TYPE_BASE_VAL] = "LOCAL_IFFT_H_ICI", |
337 | [MSG_RESYNC_REQ - MSG_TYPE_BASE_VAL] = "MSG_RESYNC_REQ", | 337 | [MSG_RESYNC_REQ - MSG_TYPE_BASE_VAL] = "MSG_RESYNC_REQ", |
338 | [MSG_SMS_CMMB_GET_MRC_STATISTICS_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_GET_MRC_STATISTICS_REQ", | 338 | [MSG_SMS_CMMB_GET_MRC_STATISTICS_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_GET_MRC_STATISTICS_REQ", |
339 | [MSG_SMS_CMMB_GET_MRC_STATISTICS_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_GET_MRC_STATISTICS_RES", | 339 | [MSG_SMS_CMMB_GET_MRC_STATISTICS_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_GET_MRC_STATISTICS_RES", |
340 | [MSG_SMS_LOG_EX_ITEM - MSG_TYPE_BASE_VAL] = "MSG_SMS_LOG_EX_ITEM", | 340 | [MSG_SMS_LOG_EX_ITEM - MSG_TYPE_BASE_VAL] = "MSG_SMS_LOG_EX_ITEM", |
341 | [MSG_SMS_DEVICE_DATA_LOSS_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_DEVICE_DATA_LOSS_IND", | 341 | [MSG_SMS_DEVICE_DATA_LOSS_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_DEVICE_DATA_LOSS_IND", |
342 | [MSG_SMS_MRC_WATCHDOG_TRIGGERED_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_MRC_WATCHDOG_TRIGGERED_IND", | 342 | [MSG_SMS_MRC_WATCHDOG_TRIGGERED_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_MRC_WATCHDOG_TRIGGERED_IND", |
343 | [MSG_SMS_USER_MSG_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_USER_MSG_REQ", | 343 | [MSG_SMS_USER_MSG_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_USER_MSG_REQ", |
344 | [MSG_SMS_USER_MSG_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_USER_MSG_RES", | 344 | [MSG_SMS_USER_MSG_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_USER_MSG_RES", |
345 | [MSG_SMS_SMART_CARD_INIT_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SMART_CARD_INIT_REQ", | 345 | [MSG_SMS_SMART_CARD_INIT_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SMART_CARD_INIT_REQ", |
346 | [MSG_SMS_SMART_CARD_INIT_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SMART_CARD_INIT_RES", | 346 | [MSG_SMS_SMART_CARD_INIT_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SMART_CARD_INIT_RES", |
347 | [MSG_SMS_SMART_CARD_WRITE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SMART_CARD_WRITE_REQ", | 347 | [MSG_SMS_SMART_CARD_WRITE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SMART_CARD_WRITE_REQ", |
348 | [MSG_SMS_SMART_CARD_WRITE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SMART_CARD_WRITE_RES", | 348 | [MSG_SMS_SMART_CARD_WRITE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SMART_CARD_WRITE_RES", |
349 | [MSG_SMS_SMART_CARD_READ_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_SMART_CARD_READ_IND", | 349 | [MSG_SMS_SMART_CARD_READ_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_SMART_CARD_READ_IND", |
350 | [MSG_SMS_TSE_ENABLE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_TSE_ENABLE_REQ", | 350 | [MSG_SMS_TSE_ENABLE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_TSE_ENABLE_REQ", |
351 | [MSG_SMS_TSE_ENABLE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_TSE_ENABLE_RES", | 351 | [MSG_SMS_TSE_ENABLE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_TSE_ENABLE_RES", |
352 | [MSG_SMS_CMMB_GET_SHORT_STATISTICS_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_GET_SHORT_STATISTICS_REQ", | 352 | [MSG_SMS_CMMB_GET_SHORT_STATISTICS_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_GET_SHORT_STATISTICS_REQ", |
353 | [MSG_SMS_CMMB_GET_SHORT_STATISTICS_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_GET_SHORT_STATISTICS_RES", | 353 | [MSG_SMS_CMMB_GET_SHORT_STATISTICS_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_GET_SHORT_STATISTICS_RES", |
354 | [MSG_SMS_LED_CONFIG_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_LED_CONFIG_REQ", | 354 | [MSG_SMS_LED_CONFIG_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_LED_CONFIG_REQ", |
355 | [MSG_SMS_LED_CONFIG_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_LED_CONFIG_RES", | 355 | [MSG_SMS_LED_CONFIG_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_LED_CONFIG_RES", |
356 | [MSG_PWM_ANTENNA_REQ - MSG_TYPE_BASE_VAL] = "MSG_PWM_ANTENNA_REQ", | 356 | [MSG_PWM_ANTENNA_REQ - MSG_TYPE_BASE_VAL] = "MSG_PWM_ANTENNA_REQ", |
357 | [MSG_PWM_ANTENNA_RES - MSG_TYPE_BASE_VAL] = "MSG_PWM_ANTENNA_RES", | 357 | [MSG_PWM_ANTENNA_RES - MSG_TYPE_BASE_VAL] = "MSG_PWM_ANTENNA_RES", |
358 | [MSG_SMS_CMMB_SMD_SN_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_SMD_SN_REQ", | 358 | [MSG_SMS_CMMB_SMD_SN_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_SMD_SN_REQ", |
359 | [MSG_SMS_CMMB_SMD_SN_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_SMD_SN_RES", | 359 | [MSG_SMS_CMMB_SMD_SN_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_SMD_SN_RES", |
360 | [MSG_SMS_CMMB_SET_CA_CW_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_SET_CA_CW_REQ", | 360 | [MSG_SMS_CMMB_SET_CA_CW_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_SET_CA_CW_REQ", |
361 | [MSG_SMS_CMMB_SET_CA_CW_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_SET_CA_CW_RES", | 361 | [MSG_SMS_CMMB_SET_CA_CW_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_SET_CA_CW_RES", |
362 | [MSG_SMS_CMMB_SET_CA_SALT_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_SET_CA_SALT_REQ", | 362 | [MSG_SMS_CMMB_SET_CA_SALT_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_SET_CA_SALT_REQ", |
363 | [MSG_SMS_CMMB_SET_CA_SALT_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_SET_CA_SALT_RES", | 363 | [MSG_SMS_CMMB_SET_CA_SALT_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_SET_CA_SALT_RES", |
364 | [MSG_SMS_NSCD_INIT_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_NSCD_INIT_REQ", | 364 | [MSG_SMS_NSCD_INIT_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_NSCD_INIT_REQ", |
365 | [MSG_SMS_NSCD_INIT_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_NSCD_INIT_RES", | 365 | [MSG_SMS_NSCD_INIT_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_NSCD_INIT_RES", |
366 | [MSG_SMS_NSCD_PROCESS_SECTION_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_NSCD_PROCESS_SECTION_REQ", | 366 | [MSG_SMS_NSCD_PROCESS_SECTION_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_NSCD_PROCESS_SECTION_REQ", |
367 | [MSG_SMS_NSCD_PROCESS_SECTION_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_NSCD_PROCESS_SECTION_RES", | 367 | [MSG_SMS_NSCD_PROCESS_SECTION_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_NSCD_PROCESS_SECTION_RES", |
368 | [MSG_SMS_DBD_CREATE_OBJECT_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_CREATE_OBJECT_REQ", | 368 | [MSG_SMS_DBD_CREATE_OBJECT_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_CREATE_OBJECT_REQ", |
369 | [MSG_SMS_DBD_CREATE_OBJECT_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_CREATE_OBJECT_RES", | 369 | [MSG_SMS_DBD_CREATE_OBJECT_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_CREATE_OBJECT_RES", |
370 | [MSG_SMS_DBD_CONFIGURE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_CONFIGURE_REQ", | 370 | [MSG_SMS_DBD_CONFIGURE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_CONFIGURE_REQ", |
371 | [MSG_SMS_DBD_CONFIGURE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_CONFIGURE_RES", | 371 | [MSG_SMS_DBD_CONFIGURE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_CONFIGURE_RES", |
372 | [MSG_SMS_DBD_SET_KEYS_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_SET_KEYS_REQ", | 372 | [MSG_SMS_DBD_SET_KEYS_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_SET_KEYS_REQ", |
373 | [MSG_SMS_DBD_SET_KEYS_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_SET_KEYS_RES", | 373 | [MSG_SMS_DBD_SET_KEYS_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_SET_KEYS_RES", |
374 | [MSG_SMS_DBD_PROCESS_HEADER_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_PROCESS_HEADER_REQ", | 374 | [MSG_SMS_DBD_PROCESS_HEADER_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_PROCESS_HEADER_REQ", |
375 | [MSG_SMS_DBD_PROCESS_HEADER_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_PROCESS_HEADER_RES", | 375 | [MSG_SMS_DBD_PROCESS_HEADER_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_PROCESS_HEADER_RES", |
376 | [MSG_SMS_DBD_PROCESS_DATA_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_PROCESS_DATA_REQ", | 376 | [MSG_SMS_DBD_PROCESS_DATA_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_PROCESS_DATA_REQ", |
377 | [MSG_SMS_DBD_PROCESS_DATA_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_PROCESS_DATA_RES", | 377 | [MSG_SMS_DBD_PROCESS_DATA_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_PROCESS_DATA_RES", |
378 | [MSG_SMS_DBD_PROCESS_GET_DATA_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_PROCESS_GET_DATA_REQ", | 378 | [MSG_SMS_DBD_PROCESS_GET_DATA_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_PROCESS_GET_DATA_REQ", |
379 | [MSG_SMS_DBD_PROCESS_GET_DATA_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_PROCESS_GET_DATA_RES", | 379 | [MSG_SMS_DBD_PROCESS_GET_DATA_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_PROCESS_GET_DATA_RES", |
380 | [MSG_SMS_NSCD_OPEN_SESSION_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_NSCD_OPEN_SESSION_REQ", | 380 | [MSG_SMS_NSCD_OPEN_SESSION_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_NSCD_OPEN_SESSION_REQ", |
381 | [MSG_SMS_NSCD_OPEN_SESSION_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_NSCD_OPEN_SESSION_RES", | 381 | [MSG_SMS_NSCD_OPEN_SESSION_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_NSCD_OPEN_SESSION_RES", |
382 | [MSG_SMS_SEND_HOST_DATA_TO_DEMUX_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SEND_HOST_DATA_TO_DEMUX_REQ", | 382 | [MSG_SMS_SEND_HOST_DATA_TO_DEMUX_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SEND_HOST_DATA_TO_DEMUX_REQ", |
383 | [MSG_SMS_SEND_HOST_DATA_TO_DEMUX_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SEND_HOST_DATA_TO_DEMUX_RES", | 383 | [MSG_SMS_SEND_HOST_DATA_TO_DEMUX_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SEND_HOST_DATA_TO_DEMUX_RES", |
384 | [MSG_LAST_MSG_TYPE - MSG_TYPE_BASE_VAL] = "MSG_LAST_MSG_TYPE", | 384 | [MSG_LAST_MSG_TYPE - MSG_TYPE_BASE_VAL] = "MSG_LAST_MSG_TYPE", |
385 | }; | 385 | }; |
386 | 386 | ||
387 | char *smscore_translate_msg(enum msg_types msgtype) | 387 | char *smscore_translate_msg(enum msg_types msgtype) |
388 | { | 388 | { |
389 | int i = msgtype - MSG_TYPE_BASE_VAL; | 389 | int i = msgtype - MSG_TYPE_BASE_VAL; |
390 | char *msg; | 390 | char *msg; |
391 | 391 | ||
392 | if (i < 0 || i > ARRAY_SIZE(siano_msgs)) | 392 | if (i < 0 || i > ARRAY_SIZE(siano_msgs)) |
393 | return "Unknown msg type"; | 393 | return "Unknown msg type"; |
394 | 394 | ||
395 | msg = siano_msgs[i]; | 395 | msg = siano_msgs[i]; |
396 | 396 | ||
397 | if (!*msg) | 397 | if (!*msg) |
398 | return "Unknown msg type"; | 398 | return "Unknown msg type"; |
399 | 399 | ||
400 | return msg; | 400 | return msg; |
401 | } | 401 | } |
402 | EXPORT_SYMBOL_GPL(smscore_translate_msg); | 402 | EXPORT_SYMBOL_GPL(smscore_translate_msg); |
403 | 403 | ||
404 | void smscore_set_board_id(struct smscore_device_t *core, int id) | 404 | void smscore_set_board_id(struct smscore_device_t *core, int id) |
405 | { | 405 | { |
406 | core->board_id = id; | 406 | core->board_id = id; |
407 | } | 407 | } |
408 | 408 | ||
409 | int smscore_led_state(struct smscore_device_t *core, int led) | 409 | int smscore_led_state(struct smscore_device_t *core, int led) |
410 | { | 410 | { |
411 | if (led >= 0) | 411 | if (led >= 0) |
412 | core->led_state = led; | 412 | core->led_state = led; |
413 | return core->led_state; | 413 | return core->led_state; |
414 | } | 414 | } |
415 | EXPORT_SYMBOL_GPL(smscore_set_board_id); | 415 | EXPORT_SYMBOL_GPL(smscore_set_board_id); |
416 | 416 | ||
417 | int smscore_get_board_id(struct smscore_device_t *core) | 417 | int smscore_get_board_id(struct smscore_device_t *core) |
418 | { | 418 | { |
419 | return core->board_id; | 419 | return core->board_id; |
420 | } | 420 | } |
421 | EXPORT_SYMBOL_GPL(smscore_get_board_id); | 421 | EXPORT_SYMBOL_GPL(smscore_get_board_id); |
422 | 422 | ||
423 | struct smscore_registry_entry_t { | 423 | struct smscore_registry_entry_t { |
424 | struct list_head entry; | 424 | struct list_head entry; |
425 | char devpath[32]; | 425 | char devpath[32]; |
426 | int mode; | 426 | int mode; |
427 | enum sms_device_type_st type; | 427 | enum sms_device_type_st type; |
428 | }; | 428 | }; |
429 | 429 | ||
430 | static struct list_head g_smscore_notifyees; | 430 | static struct list_head g_smscore_notifyees; |
431 | static struct list_head g_smscore_devices; | 431 | static struct list_head g_smscore_devices; |
432 | static struct mutex g_smscore_deviceslock; | 432 | static struct mutex g_smscore_deviceslock; |
433 | 433 | ||
434 | static struct list_head g_smscore_registry; | 434 | static struct list_head g_smscore_registry; |
435 | static struct mutex g_smscore_registrylock; | 435 | static struct mutex g_smscore_registrylock; |
436 | 436 | ||
437 | static int default_mode = DEVICE_MODE_NONE; | 437 | static int default_mode = DEVICE_MODE_NONE; |
438 | 438 | ||
439 | module_param(default_mode, int, 0644); | 439 | module_param(default_mode, int, 0644); |
440 | MODULE_PARM_DESC(default_mode, "default firmware id (device mode)"); | 440 | MODULE_PARM_DESC(default_mode, "default firmware id (device mode)"); |
441 | 441 | ||
442 | static struct smscore_registry_entry_t *smscore_find_registry(char *devpath) | 442 | static struct smscore_registry_entry_t *smscore_find_registry(char *devpath) |
443 | { | 443 | { |
444 | struct smscore_registry_entry_t *entry; | 444 | struct smscore_registry_entry_t *entry; |
445 | struct list_head *next; | 445 | struct list_head *next; |
446 | 446 | ||
447 | kmutex_lock(&g_smscore_registrylock); | 447 | kmutex_lock(&g_smscore_registrylock); |
448 | for (next = g_smscore_registry.next; | 448 | for (next = g_smscore_registry.next; |
449 | next != &g_smscore_registry; | 449 | next != &g_smscore_registry; |
450 | next = next->next) { | 450 | next = next->next) { |
451 | entry = (struct smscore_registry_entry_t *) next; | 451 | entry = (struct smscore_registry_entry_t *) next; |
452 | if (!strcmp(entry->devpath, devpath)) { | 452 | if (!strcmp(entry->devpath, devpath)) { |
453 | kmutex_unlock(&g_smscore_registrylock); | 453 | kmutex_unlock(&g_smscore_registrylock); |
454 | return entry; | 454 | return entry; |
455 | } | 455 | } |
456 | } | 456 | } |
457 | entry = kmalloc(sizeof(struct smscore_registry_entry_t), GFP_KERNEL); | 457 | entry = kmalloc(sizeof(struct smscore_registry_entry_t), GFP_KERNEL); |
458 | if (entry) { | 458 | if (entry) { |
459 | entry->mode = default_mode; | 459 | entry->mode = default_mode; |
460 | strcpy(entry->devpath, devpath); | 460 | strcpy(entry->devpath, devpath); |
461 | list_add(&entry->entry, &g_smscore_registry); | 461 | list_add(&entry->entry, &g_smscore_registry); |
462 | } else | 462 | } else |
463 | sms_err("failed to create smscore_registry."); | 463 | sms_err("failed to create smscore_registry."); |
464 | kmutex_unlock(&g_smscore_registrylock); | 464 | kmutex_unlock(&g_smscore_registrylock); |
465 | return entry; | 465 | return entry; |
466 | } | 466 | } |
467 | 467 | ||
468 | int smscore_registry_getmode(char *devpath) | 468 | int smscore_registry_getmode(char *devpath) |
469 | { | 469 | { |
470 | struct smscore_registry_entry_t *entry; | 470 | struct smscore_registry_entry_t *entry; |
471 | 471 | ||
472 | entry = smscore_find_registry(devpath); | 472 | entry = smscore_find_registry(devpath); |
473 | if (entry) | 473 | if (entry) |
474 | return entry->mode; | 474 | return entry->mode; |
475 | else | 475 | else |
476 | sms_err("No registry found."); | 476 | sms_err("No registry found."); |
477 | 477 | ||
478 | return default_mode; | 478 | return default_mode; |
479 | } | 479 | } |
480 | EXPORT_SYMBOL_GPL(smscore_registry_getmode); | 480 | EXPORT_SYMBOL_GPL(smscore_registry_getmode); |
481 | 481 | ||
482 | static enum sms_device_type_st smscore_registry_gettype(char *devpath) | 482 | static enum sms_device_type_st smscore_registry_gettype(char *devpath) |
483 | { | 483 | { |
484 | struct smscore_registry_entry_t *entry; | 484 | struct smscore_registry_entry_t *entry; |
485 | 485 | ||
486 | entry = smscore_find_registry(devpath); | 486 | entry = smscore_find_registry(devpath); |
487 | if (entry) | 487 | if (entry) |
488 | return entry->type; | 488 | return entry->type; |
489 | else | 489 | else |
490 | sms_err("No registry found."); | 490 | sms_err("No registry found."); |
491 | 491 | ||
492 | return -EINVAL; | 492 | return -EINVAL; |
493 | } | 493 | } |
494 | 494 | ||
495 | static void smscore_registry_setmode(char *devpath, int mode) | 495 | static void smscore_registry_setmode(char *devpath, int mode) |
496 | { | 496 | { |
497 | struct smscore_registry_entry_t *entry; | 497 | struct smscore_registry_entry_t *entry; |
498 | 498 | ||
499 | entry = smscore_find_registry(devpath); | 499 | entry = smscore_find_registry(devpath); |
500 | if (entry) | 500 | if (entry) |
501 | entry->mode = mode; | 501 | entry->mode = mode; |
502 | else | 502 | else |
503 | sms_err("No registry found."); | 503 | sms_err("No registry found."); |
504 | } | 504 | } |
505 | 505 | ||
506 | static void smscore_registry_settype(char *devpath, | 506 | static void smscore_registry_settype(char *devpath, |
507 | enum sms_device_type_st type) | 507 | enum sms_device_type_st type) |
508 | { | 508 | { |
509 | struct smscore_registry_entry_t *entry; | 509 | struct smscore_registry_entry_t *entry; |
510 | 510 | ||
511 | entry = smscore_find_registry(devpath); | 511 | entry = smscore_find_registry(devpath); |
512 | if (entry) | 512 | if (entry) |
513 | entry->type = type; | 513 | entry->type = type; |
514 | else | 514 | else |
515 | sms_err("No registry found."); | 515 | sms_err("No registry found."); |
516 | } | 516 | } |
517 | 517 | ||
518 | 518 | ||
519 | static void list_add_locked(struct list_head *new, struct list_head *head, | 519 | static void list_add_locked(struct list_head *new, struct list_head *head, |
520 | spinlock_t *lock) | 520 | spinlock_t *lock) |
521 | { | 521 | { |
522 | unsigned long flags; | 522 | unsigned long flags; |
523 | 523 | ||
524 | spin_lock_irqsave(lock, flags); | 524 | spin_lock_irqsave(lock, flags); |
525 | 525 | ||
526 | list_add(new, head); | 526 | list_add(new, head); |
527 | 527 | ||
528 | spin_unlock_irqrestore(lock, flags); | 528 | spin_unlock_irqrestore(lock, flags); |
529 | } | 529 | } |
530 | 530 | ||
531 | /** | 531 | /** |
532 | * register a client callback that called when device plugged in/unplugged | 532 | * register a client callback that called when device plugged in/unplugged |
533 | * NOTE: if devices exist callback is called immediately for each device | 533 | * NOTE: if devices exist callback is called immediately for each device |
534 | * | 534 | * |
535 | * @param hotplug callback | 535 | * @param hotplug callback |
536 | * | 536 | * |
537 | * @return 0 on success, <0 on error. | 537 | * @return 0 on success, <0 on error. |
538 | */ | 538 | */ |
539 | int smscore_register_hotplug(hotplug_t hotplug) | 539 | int smscore_register_hotplug(hotplug_t hotplug) |
540 | { | 540 | { |
541 | struct smscore_device_notifyee_t *notifyee; | 541 | struct smscore_device_notifyee_t *notifyee; |
542 | struct list_head *next, *first; | 542 | struct list_head *next, *first; |
543 | int rc = 0; | 543 | int rc = 0; |
544 | 544 | ||
545 | kmutex_lock(&g_smscore_deviceslock); | 545 | kmutex_lock(&g_smscore_deviceslock); |
546 | 546 | ||
547 | notifyee = kmalloc(sizeof(struct smscore_device_notifyee_t), | 547 | notifyee = kmalloc(sizeof(struct smscore_device_notifyee_t), |
548 | GFP_KERNEL); | 548 | GFP_KERNEL); |
549 | if (notifyee) { | 549 | if (notifyee) { |
550 | /* now notify callback about existing devices */ | 550 | /* now notify callback about existing devices */ |
551 | first = &g_smscore_devices; | 551 | first = &g_smscore_devices; |
552 | for (next = first->next; | 552 | for (next = first->next; |
553 | next != first && !rc; | 553 | next != first && !rc; |
554 | next = next->next) { | 554 | next = next->next) { |
555 | struct smscore_device_t *coredev = | 555 | struct smscore_device_t *coredev = |
556 | (struct smscore_device_t *) next; | 556 | (struct smscore_device_t *) next; |
557 | rc = hotplug(coredev, coredev->device, 1); | 557 | rc = hotplug(coredev, coredev->device, 1); |
558 | } | 558 | } |
559 | 559 | ||
560 | if (rc >= 0) { | 560 | if (rc >= 0) { |
561 | notifyee->hotplug = hotplug; | 561 | notifyee->hotplug = hotplug; |
562 | list_add(¬ifyee->entry, &g_smscore_notifyees); | 562 | list_add(¬ifyee->entry, &g_smscore_notifyees); |
563 | } else | 563 | } else |
564 | kfree(notifyee); | 564 | kfree(notifyee); |
565 | } else | 565 | } else |
566 | rc = -ENOMEM; | 566 | rc = -ENOMEM; |
567 | 567 | ||
568 | kmutex_unlock(&g_smscore_deviceslock); | 568 | kmutex_unlock(&g_smscore_deviceslock); |
569 | 569 | ||
570 | return rc; | 570 | return rc; |
571 | } | 571 | } |
572 | EXPORT_SYMBOL_GPL(smscore_register_hotplug); | 572 | EXPORT_SYMBOL_GPL(smscore_register_hotplug); |
573 | 573 | ||
574 | /** | 574 | /** |
575 | * unregister a client callback that called when device plugged in/unplugged | 575 | * unregister a client callback that called when device plugged in/unplugged |
576 | * | 576 | * |
577 | * @param hotplug callback | 577 | * @param hotplug callback |
578 | * | 578 | * |
579 | */ | 579 | */ |
580 | void smscore_unregister_hotplug(hotplug_t hotplug) | 580 | void smscore_unregister_hotplug(hotplug_t hotplug) |
581 | { | 581 | { |
582 | struct list_head *next, *first; | 582 | struct list_head *next, *first; |
583 | 583 | ||
584 | kmutex_lock(&g_smscore_deviceslock); | 584 | kmutex_lock(&g_smscore_deviceslock); |
585 | 585 | ||
586 | first = &g_smscore_notifyees; | 586 | first = &g_smscore_notifyees; |
587 | 587 | ||
588 | for (next = first->next; next != first;) { | 588 | for (next = first->next; next != first;) { |
589 | struct smscore_device_notifyee_t *notifyee = | 589 | struct smscore_device_notifyee_t *notifyee = |
590 | (struct smscore_device_notifyee_t *) next; | 590 | (struct smscore_device_notifyee_t *) next; |
591 | next = next->next; | 591 | next = next->next; |
592 | 592 | ||
593 | if (notifyee->hotplug == hotplug) { | 593 | if (notifyee->hotplug == hotplug) { |
594 | list_del(¬ifyee->entry); | 594 | list_del(¬ifyee->entry); |
595 | kfree(notifyee); | 595 | kfree(notifyee); |
596 | } | 596 | } |
597 | } | 597 | } |
598 | 598 | ||
599 | kmutex_unlock(&g_smscore_deviceslock); | 599 | kmutex_unlock(&g_smscore_deviceslock); |
600 | } | 600 | } |
601 | EXPORT_SYMBOL_GPL(smscore_unregister_hotplug); | 601 | EXPORT_SYMBOL_GPL(smscore_unregister_hotplug); |
602 | 602 | ||
603 | static void smscore_notify_clients(struct smscore_device_t *coredev) | 603 | static void smscore_notify_clients(struct smscore_device_t *coredev) |
604 | { | 604 | { |
605 | struct smscore_client_t *client; | 605 | struct smscore_client_t *client; |
606 | 606 | ||
607 | /* the client must call smscore_unregister_client from remove handler */ | 607 | /* the client must call smscore_unregister_client from remove handler */ |
608 | while (!list_empty(&coredev->clients)) { | 608 | while (!list_empty(&coredev->clients)) { |
609 | client = (struct smscore_client_t *) coredev->clients.next; | 609 | client = (struct smscore_client_t *) coredev->clients.next; |
610 | client->onremove_handler(client->context); | 610 | client->onremove_handler(client->context); |
611 | } | 611 | } |
612 | } | 612 | } |
613 | 613 | ||
614 | static int smscore_notify_callbacks(struct smscore_device_t *coredev, | 614 | static int smscore_notify_callbacks(struct smscore_device_t *coredev, |
615 | struct device *device, int arrival) | 615 | struct device *device, int arrival) |
616 | { | 616 | { |
617 | struct smscore_device_notifyee_t *elem; | 617 | struct smscore_device_notifyee_t *elem; |
618 | int rc = 0; | 618 | int rc = 0; |
619 | 619 | ||
620 | /* note: must be called under g_deviceslock */ | 620 | /* note: must be called under g_deviceslock */ |
621 | 621 | ||
622 | list_for_each_entry(elem, &g_smscore_notifyees, entry) { | 622 | list_for_each_entry(elem, &g_smscore_notifyees, entry) { |
623 | rc = elem->hotplug(coredev, device, arrival); | 623 | rc = elem->hotplug(coredev, device, arrival); |
624 | if (rc < 0) | 624 | if (rc < 0) |
625 | break; | 625 | break; |
626 | } | 626 | } |
627 | 627 | ||
628 | return rc; | 628 | return rc; |
629 | } | 629 | } |
630 | 630 | ||
631 | static struct | 631 | static struct |
632 | smscore_buffer_t *smscore_createbuffer(u8 *buffer, void *common_buffer, | 632 | smscore_buffer_t *smscore_createbuffer(u8 *buffer, void *common_buffer, |
633 | dma_addr_t common_buffer_phys) | 633 | dma_addr_t common_buffer_phys) |
634 | { | 634 | { |
635 | struct smscore_buffer_t *cb; | 635 | struct smscore_buffer_t *cb; |
636 | 636 | ||
637 | cb = kzalloc(sizeof(struct smscore_buffer_t), GFP_KERNEL); | 637 | cb = kzalloc(sizeof(struct smscore_buffer_t), GFP_KERNEL); |
638 | if (!cb) { | 638 | if (!cb) { |
639 | sms_info("kzalloc(...) failed"); | 639 | sms_info("kzalloc(...) failed"); |
640 | return NULL; | 640 | return NULL; |
641 | } | 641 | } |
642 | 642 | ||
643 | cb->p = buffer; | 643 | cb->p = buffer; |
644 | cb->offset_in_common = buffer - (u8 *) common_buffer; | 644 | cb->offset_in_common = buffer - (u8 *) common_buffer; |
645 | cb->phys = common_buffer_phys + cb->offset_in_common; | 645 | cb->phys = common_buffer_phys + cb->offset_in_common; |
646 | 646 | ||
647 | return cb; | 647 | return cb; |
648 | } | 648 | } |
649 | 649 | ||
650 | /** | 650 | /** |
651 | * creates coredev object for a device, prepares buffers, | 651 | * creates coredev object for a device, prepares buffers, |
652 | * creates buffer mappings, notifies registered hotplugs about new device. | 652 | * creates buffer mappings, notifies registered hotplugs about new device. |
653 | * | 653 | * |
654 | * @param params device pointer to struct with device specific parameters | 654 | * @param params device pointer to struct with device specific parameters |
655 | * and handlers | 655 | * and handlers |
656 | * @param coredev pointer to a value that receives created coredev object | 656 | * @param coredev pointer to a value that receives created coredev object |
657 | * | 657 | * |
658 | * @return 0 on success, <0 on error. | 658 | * @return 0 on success, <0 on error. |
659 | */ | 659 | */ |
660 | int smscore_register_device(struct smsdevice_params_t *params, | 660 | int smscore_register_device(struct smsdevice_params_t *params, |
661 | struct smscore_device_t **coredev) | 661 | struct smscore_device_t **coredev) |
662 | { | 662 | { |
663 | struct smscore_device_t *dev; | 663 | struct smscore_device_t *dev; |
664 | u8 *buffer; | 664 | u8 *buffer; |
665 | 665 | ||
666 | dev = kzalloc(sizeof(struct smscore_device_t), GFP_KERNEL); | 666 | dev = kzalloc(sizeof(struct smscore_device_t), GFP_KERNEL); |
667 | if (!dev) { | 667 | if (!dev) { |
668 | sms_info("kzalloc(...) failed"); | 668 | sms_info("kzalloc(...) failed"); |
669 | return -ENOMEM; | 669 | return -ENOMEM; |
670 | } | 670 | } |
671 | 671 | ||
672 | /* init list entry so it could be safe in smscore_unregister_device */ | 672 | /* init list entry so it could be safe in smscore_unregister_device */ |
673 | INIT_LIST_HEAD(&dev->entry); | 673 | INIT_LIST_HEAD(&dev->entry); |
674 | 674 | ||
675 | /* init queues */ | 675 | /* init queues */ |
676 | INIT_LIST_HEAD(&dev->clients); | 676 | INIT_LIST_HEAD(&dev->clients); |
677 | INIT_LIST_HEAD(&dev->buffers); | 677 | INIT_LIST_HEAD(&dev->buffers); |
678 | 678 | ||
679 | /* init locks */ | 679 | /* init locks */ |
680 | spin_lock_init(&dev->clientslock); | 680 | spin_lock_init(&dev->clientslock); |
681 | spin_lock_init(&dev->bufferslock); | 681 | spin_lock_init(&dev->bufferslock); |
682 | 682 | ||
683 | /* init completion events */ | 683 | /* init completion events */ |
684 | init_completion(&dev->version_ex_done); | 684 | init_completion(&dev->version_ex_done); |
685 | init_completion(&dev->data_download_done); | 685 | init_completion(&dev->data_download_done); |
686 | init_completion(&dev->data_validity_done); | 686 | init_completion(&dev->data_validity_done); |
687 | init_completion(&dev->trigger_done); | 687 | init_completion(&dev->trigger_done); |
688 | init_completion(&dev->init_device_done); | 688 | init_completion(&dev->init_device_done); |
689 | init_completion(&dev->reload_start_done); | 689 | init_completion(&dev->reload_start_done); |
690 | init_completion(&dev->resume_done); | 690 | init_completion(&dev->resume_done); |
691 | init_completion(&dev->gpio_configuration_done); | 691 | init_completion(&dev->gpio_configuration_done); |
692 | init_completion(&dev->gpio_set_level_done); | 692 | init_completion(&dev->gpio_set_level_done); |
693 | init_completion(&dev->gpio_get_level_done); | 693 | init_completion(&dev->gpio_get_level_done); |
694 | init_completion(&dev->ir_init_done); | 694 | init_completion(&dev->ir_init_done); |
695 | 695 | ||
696 | /* Buffer management */ | 696 | /* Buffer management */ |
697 | init_waitqueue_head(&dev->buffer_mng_waitq); | 697 | init_waitqueue_head(&dev->buffer_mng_waitq); |
698 | 698 | ||
699 | /* alloc common buffer */ | 699 | /* alloc common buffer */ |
700 | dev->common_buffer_size = params->buffer_size * params->num_buffers; | 700 | dev->common_buffer_size = params->buffer_size * params->num_buffers; |
701 | dev->common_buffer = dma_alloc_coherent(NULL, dev->common_buffer_size, | 701 | dev->common_buffer = dma_alloc_coherent(NULL, dev->common_buffer_size, |
702 | &dev->common_buffer_phys, | 702 | &dev->common_buffer_phys, |
703 | GFP_KERNEL | GFP_DMA); | 703 | GFP_KERNEL | GFP_DMA); |
704 | if (!dev->common_buffer) { | 704 | if (!dev->common_buffer) { |
705 | smscore_unregister_device(dev); | 705 | smscore_unregister_device(dev); |
706 | return -ENOMEM; | 706 | return -ENOMEM; |
707 | } | 707 | } |
708 | 708 | ||
709 | /* prepare dma buffers */ | 709 | /* prepare dma buffers */ |
710 | for (buffer = dev->common_buffer; | 710 | for (buffer = dev->common_buffer; |
711 | dev->num_buffers < params->num_buffers; | 711 | dev->num_buffers < params->num_buffers; |
712 | dev->num_buffers++, buffer += params->buffer_size) { | 712 | dev->num_buffers++, buffer += params->buffer_size) { |
713 | struct smscore_buffer_t *cb; | 713 | struct smscore_buffer_t *cb; |
714 | 714 | ||
715 | cb = smscore_createbuffer(buffer, dev->common_buffer, | 715 | cb = smscore_createbuffer(buffer, dev->common_buffer, |
716 | dev->common_buffer_phys); | 716 | dev->common_buffer_phys); |
717 | if (!cb) { | 717 | if (!cb) { |
718 | smscore_unregister_device(dev); | 718 | smscore_unregister_device(dev); |
719 | return -ENOMEM; | 719 | return -ENOMEM; |
720 | } | 720 | } |
721 | 721 | ||
722 | smscore_putbuffer(dev, cb); | 722 | smscore_putbuffer(dev, cb); |
723 | } | 723 | } |
724 | 724 | ||
725 | sms_info("allocated %d buffers", dev->num_buffers); | 725 | sms_info("allocated %d buffers", dev->num_buffers); |
726 | 726 | ||
727 | dev->mode = DEVICE_MODE_NONE; | 727 | dev->mode = DEVICE_MODE_NONE; |
728 | dev->board_id = SMS_BOARD_UNKNOWN; | 728 | dev->board_id = SMS_BOARD_UNKNOWN; |
729 | dev->context = params->context; | 729 | dev->context = params->context; |
730 | dev->device = params->device; | 730 | dev->device = params->device; |
731 | dev->setmode_handler = params->setmode_handler; | 731 | dev->setmode_handler = params->setmode_handler; |
732 | dev->detectmode_handler = params->detectmode_handler; | 732 | dev->detectmode_handler = params->detectmode_handler; |
733 | dev->sendrequest_handler = params->sendrequest_handler; | 733 | dev->sendrequest_handler = params->sendrequest_handler; |
734 | dev->preload_handler = params->preload_handler; | 734 | dev->preload_handler = params->preload_handler; |
735 | dev->postload_handler = params->postload_handler; | 735 | dev->postload_handler = params->postload_handler; |
736 | 736 | ||
737 | dev->device_flags = params->flags; | 737 | dev->device_flags = params->flags; |
738 | strcpy(dev->devpath, params->devpath); | 738 | strcpy(dev->devpath, params->devpath); |
739 | 739 | ||
740 | smscore_registry_settype(dev->devpath, params->device_type); | 740 | smscore_registry_settype(dev->devpath, params->device_type); |
741 | 741 | ||
742 | /* add device to devices list */ | 742 | /* add device to devices list */ |
743 | kmutex_lock(&g_smscore_deviceslock); | 743 | kmutex_lock(&g_smscore_deviceslock); |
744 | list_add(&dev->entry, &g_smscore_devices); | 744 | list_add(&dev->entry, &g_smscore_devices); |
745 | kmutex_unlock(&g_smscore_deviceslock); | 745 | kmutex_unlock(&g_smscore_deviceslock); |
746 | 746 | ||
747 | *coredev = dev; | 747 | *coredev = dev; |
748 | 748 | ||
749 | sms_info("device %p created", dev); | 749 | sms_info("device %p created", dev); |
750 | 750 | ||
751 | return 0; | 751 | return 0; |
752 | } | 752 | } |
753 | EXPORT_SYMBOL_GPL(smscore_register_device); | 753 | EXPORT_SYMBOL_GPL(smscore_register_device); |
754 | 754 | ||
755 | 755 | ||
756 | static int smscore_sendrequest_and_wait(struct smscore_device_t *coredev, | 756 | static int smscore_sendrequest_and_wait(struct smscore_device_t *coredev, |
757 | void *buffer, size_t size, struct completion *completion) { | 757 | void *buffer, size_t size, struct completion *completion) { |
758 | int rc; | 758 | int rc; |
759 | 759 | ||
760 | if (completion == NULL) | 760 | if (completion == NULL) |
761 | return -EINVAL; | 761 | return -EINVAL; |
762 | init_completion(completion); | 762 | init_completion(completion); |
763 | 763 | ||
764 | rc = coredev->sendrequest_handler(coredev->context, buffer, size); | 764 | rc = coredev->sendrequest_handler(coredev->context, buffer, size); |
765 | if (rc < 0) { | 765 | if (rc < 0) { |
766 | sms_info("sendrequest returned error %d", rc); | 766 | sms_info("sendrequest returned error %d", rc); |
767 | return rc; | 767 | return rc; |
768 | } | 768 | } |
769 | 769 | ||
770 | return wait_for_completion_timeout(completion, | 770 | return wait_for_completion_timeout(completion, |
771 | msecs_to_jiffies(SMS_PROTOCOL_MAX_RAOUNDTRIP_MS)) ? | 771 | msecs_to_jiffies(SMS_PROTOCOL_MAX_RAOUNDTRIP_MS)) ? |
772 | 0 : -ETIME; | 772 | 0 : -ETIME; |
773 | } | 773 | } |
774 | 774 | ||
775 | /** | 775 | /** |
776 | * Starts & enables IR operations | 776 | * Starts & enables IR operations |
777 | * | 777 | * |
778 | * @return 0 on success, < 0 on error. | 778 | * @return 0 on success, < 0 on error. |
779 | */ | 779 | */ |
780 | static int smscore_init_ir(struct smscore_device_t *coredev) | 780 | static int smscore_init_ir(struct smscore_device_t *coredev) |
781 | { | 781 | { |
782 | int ir_io; | 782 | int ir_io; |
783 | int rc; | 783 | int rc; |
784 | void *buffer; | 784 | void *buffer; |
785 | 785 | ||
786 | coredev->ir.dev = NULL; | 786 | coredev->ir.dev = NULL; |
787 | ir_io = sms_get_board(smscore_get_board_id(coredev))->board_cfg.ir; | 787 | ir_io = sms_get_board(smscore_get_board_id(coredev))->board_cfg.ir; |
788 | if (ir_io) {/* only if IR port exist we use IR sub-module */ | 788 | if (ir_io) {/* only if IR port exist we use IR sub-module */ |
789 | sms_info("IR loading"); | 789 | sms_info("IR loading"); |
790 | rc = sms_ir_init(coredev); | 790 | rc = sms_ir_init(coredev); |
791 | 791 | ||
792 | if (rc != 0) | 792 | if (rc != 0) |
793 | sms_err("Error initialization DTV IR sub-module"); | 793 | sms_err("Error initialization DTV IR sub-module"); |
794 | else { | 794 | else { |
795 | buffer = kmalloc(sizeof(struct sms_msg_data2) + | 795 | buffer = kmalloc(sizeof(struct sms_msg_data2) + |
796 | SMS_DMA_ALIGNMENT, | 796 | SMS_DMA_ALIGNMENT, |
797 | GFP_KERNEL | GFP_DMA); | 797 | GFP_KERNEL | GFP_DMA); |
798 | if (buffer) { | 798 | if (buffer) { |
799 | struct sms_msg_data2 *msg = | 799 | struct sms_msg_data2 *msg = |
800 | (struct sms_msg_data2 *) | 800 | (struct sms_msg_data2 *) |
801 | SMS_ALIGN_ADDRESS(buffer); | 801 | SMS_ALIGN_ADDRESS(buffer); |
802 | 802 | ||
803 | SMS_INIT_MSG(&msg->x_msg_header, | 803 | SMS_INIT_MSG(&msg->x_msg_header, |
804 | MSG_SMS_START_IR_REQ, | 804 | MSG_SMS_START_IR_REQ, |
805 | sizeof(struct sms_msg_data2)); | 805 | sizeof(struct sms_msg_data2)); |
806 | msg->msgData[0] = coredev->ir.controller; | 806 | msg->msg_data[0] = coredev->ir.controller; |
807 | msg->msgData[1] = coredev->ir.timeout; | 807 | msg->msg_data[1] = coredev->ir.timeout; |
808 | 808 | ||
809 | rc = smscore_sendrequest_and_wait(coredev, msg, | 809 | rc = smscore_sendrequest_and_wait(coredev, msg, |
810 | msg->x_msg_header. msg_length, | 810 | msg->x_msg_header. msg_length, |
811 | &coredev->ir_init_done); | 811 | &coredev->ir_init_done); |
812 | 812 | ||
813 | kfree(buffer); | 813 | kfree(buffer); |
814 | } else | 814 | } else |
815 | sms_err | 815 | sms_err |
816 | ("Sending IR initialization message failed"); | 816 | ("Sending IR initialization message failed"); |
817 | } | 817 | } |
818 | } else | 818 | } else |
819 | sms_info("IR port has not been detected"); | 819 | sms_info("IR port has not been detected"); |
820 | 820 | ||
821 | return 0; | 821 | return 0; |
822 | } | 822 | } |
823 | 823 | ||
824 | /** | 824 | /** |
825 | * configures device features according to board configuration structure. | 825 | * configures device features according to board configuration structure. |
826 | * | 826 | * |
827 | * @param coredev pointer to a coredev object returned by | 827 | * @param coredev pointer to a coredev object returned by |
828 | * smscore_register_device | 828 | * smscore_register_device |
829 | * | 829 | * |
830 | * @return 0 on success, <0 on error. | 830 | * @return 0 on success, <0 on error. |
831 | */ | 831 | */ |
832 | int smscore_configure_board(struct smscore_device_t *coredev) | 832 | int smscore_configure_board(struct smscore_device_t *coredev) |
833 | { | 833 | { |
834 | struct sms_board *board; | 834 | struct sms_board *board; |
835 | 835 | ||
836 | board = sms_get_board(coredev->board_id); | 836 | board = sms_get_board(coredev->board_id); |
837 | if (!board) { | 837 | if (!board) { |
838 | sms_err("no board configuration exist."); | 838 | sms_err("no board configuration exist."); |
839 | return -EINVAL; | 839 | return -EINVAL; |
840 | } | 840 | } |
841 | 841 | ||
842 | if (board->mtu) { | 842 | if (board->mtu) { |
843 | struct sms_msg_data MtuMsg; | 843 | struct sms_msg_data mtu_msg; |
844 | sms_debug("set max transmit unit %d", board->mtu); | 844 | sms_debug("set max transmit unit %d", board->mtu); |
845 | 845 | ||
846 | MtuMsg.x_msg_header.msg_src_id = 0; | 846 | mtu_msg.x_msg_header.msg_src_id = 0; |
847 | MtuMsg.x_msg_header.msg_dst_id = HIF_TASK; | 847 | mtu_msg.x_msg_header.msg_dst_id = HIF_TASK; |
848 | MtuMsg.x_msg_header.msg_flags = 0; | 848 | mtu_msg.x_msg_header.msg_flags = 0; |
849 | MtuMsg.x_msg_header.msg_type = MSG_SMS_SET_MAX_TX_MSG_LEN_REQ; | 849 | mtu_msg.x_msg_header.msg_type = MSG_SMS_SET_MAX_TX_MSG_LEN_REQ; |
850 | MtuMsg.x_msg_header.msg_length = sizeof(MtuMsg); | 850 | mtu_msg.x_msg_header.msg_length = sizeof(mtu_msg); |
851 | MtuMsg.msgData[0] = board->mtu; | 851 | mtu_msg.msg_data[0] = board->mtu; |
852 | 852 | ||
853 | coredev->sendrequest_handler(coredev->context, &MtuMsg, | 853 | coredev->sendrequest_handler(coredev->context, &mtu_msg, |
854 | sizeof(MtuMsg)); | 854 | sizeof(mtu_msg)); |
855 | } | 855 | } |
856 | 856 | ||
857 | if (board->crystal) { | 857 | if (board->crystal) { |
858 | struct sms_msg_data CrysMsg; | 858 | struct sms_msg_data crys_msg; |
859 | sms_debug("set crystal value %d", board->crystal); | 859 | sms_debug("set crystal value %d", board->crystal); |
860 | 860 | ||
861 | SMS_INIT_MSG(&CrysMsg.x_msg_header, | 861 | SMS_INIT_MSG(&crys_msg.x_msg_header, |
862 | MSG_SMS_NEW_CRYSTAL_REQ, | 862 | MSG_SMS_NEW_CRYSTAL_REQ, |
863 | sizeof(CrysMsg)); | 863 | sizeof(crys_msg)); |
864 | CrysMsg.msgData[0] = board->crystal; | 864 | crys_msg.msg_data[0] = board->crystal; |
865 | 865 | ||
866 | coredev->sendrequest_handler(coredev->context, &CrysMsg, | 866 | coredev->sendrequest_handler(coredev->context, &crys_msg, |
867 | sizeof(CrysMsg)); | 867 | sizeof(crys_msg)); |
868 | } | 868 | } |
869 | 869 | ||
870 | return 0; | 870 | return 0; |
871 | } | 871 | } |
872 | 872 | ||
873 | /** | 873 | /** |
874 | * sets initial device mode and notifies client hotplugs that device is ready | 874 | * sets initial device mode and notifies client hotplugs that device is ready |
875 | * | 875 | * |
876 | * @param coredev pointer to a coredev object returned by | 876 | * @param coredev pointer to a coredev object returned by |
877 | * smscore_register_device | 877 | * smscore_register_device |
878 | * | 878 | * |
879 | * @return 0 on success, <0 on error. | 879 | * @return 0 on success, <0 on error. |
880 | */ | 880 | */ |
881 | int smscore_start_device(struct smscore_device_t *coredev) | 881 | int smscore_start_device(struct smscore_device_t *coredev) |
882 | { | 882 | { |
883 | int rc; | 883 | int rc; |
884 | int board_id = smscore_get_board_id(coredev); | 884 | int board_id = smscore_get_board_id(coredev); |
885 | int mode = smscore_registry_getmode(coredev->devpath); | 885 | int mode = smscore_registry_getmode(coredev->devpath); |
886 | 886 | ||
887 | /* Device is initialized as DEVICE_MODE_NONE */ | 887 | /* Device is initialized as DEVICE_MODE_NONE */ |
888 | if (board_id != SMS_BOARD_UNKNOWN && mode == DEVICE_MODE_NONE) | 888 | if (board_id != SMS_BOARD_UNKNOWN && mode == DEVICE_MODE_NONE) |
889 | mode = sms_get_board(board_id)->default_mode; | 889 | mode = sms_get_board(board_id)->default_mode; |
890 | 890 | ||
891 | rc = smscore_set_device_mode(coredev, mode); | 891 | rc = smscore_set_device_mode(coredev, mode); |
892 | if (rc < 0) { | 892 | if (rc < 0) { |
893 | sms_info("set device mode faile , rc %d", rc); | 893 | sms_info("set device mode faile , rc %d", rc); |
894 | return rc; | 894 | return rc; |
895 | } | 895 | } |
896 | rc = smscore_configure_board(coredev); | 896 | rc = smscore_configure_board(coredev); |
897 | if (rc < 0) { | 897 | if (rc < 0) { |
898 | sms_info("configure board failed , rc %d", rc); | 898 | sms_info("configure board failed , rc %d", rc); |
899 | return rc; | 899 | return rc; |
900 | } | 900 | } |
901 | 901 | ||
902 | kmutex_lock(&g_smscore_deviceslock); | 902 | kmutex_lock(&g_smscore_deviceslock); |
903 | 903 | ||
904 | rc = smscore_notify_callbacks(coredev, coredev->device, 1); | 904 | rc = smscore_notify_callbacks(coredev, coredev->device, 1); |
905 | smscore_init_ir(coredev); | 905 | smscore_init_ir(coredev); |
906 | 906 | ||
907 | sms_info("device %p started, rc %d", coredev, rc); | 907 | sms_info("device %p started, rc %d", coredev, rc); |
908 | 908 | ||
909 | kmutex_unlock(&g_smscore_deviceslock); | 909 | kmutex_unlock(&g_smscore_deviceslock); |
910 | 910 | ||
911 | return rc; | 911 | return rc; |
912 | } | 912 | } |
913 | EXPORT_SYMBOL_GPL(smscore_start_device); | 913 | EXPORT_SYMBOL_GPL(smscore_start_device); |
914 | 914 | ||
915 | 915 | ||
916 | static int smscore_load_firmware_family2(struct smscore_device_t *coredev, | 916 | static int smscore_load_firmware_family2(struct smscore_device_t *coredev, |
917 | void *buffer, size_t size) | 917 | void *buffer, size_t size) |
918 | { | 918 | { |
919 | struct sms_firmware *firmware = (struct sms_firmware *) buffer; | 919 | struct sms_firmware *firmware = (struct sms_firmware *) buffer; |
920 | struct sms_msg_data4 *msg; | 920 | struct sms_msg_data4 *msg; |
921 | u32 mem_address, calc_checksum = 0; | 921 | u32 mem_address, calc_checksum = 0; |
922 | u32 i, *ptr; | 922 | u32 i, *ptr; |
923 | u8 *payload = firmware->payload; | 923 | u8 *payload = firmware->payload; |
924 | int rc = 0; | 924 | int rc = 0; |
925 | firmware->start_address = le32_to_cpu(firmware->start_address); | 925 | firmware->start_address = le32_to_cpu(firmware->start_address); |
926 | firmware->length = le32_to_cpu(firmware->length); | 926 | firmware->length = le32_to_cpu(firmware->length); |
927 | 927 | ||
928 | mem_address = firmware->start_address; | 928 | mem_address = firmware->start_address; |
929 | 929 | ||
930 | sms_info("loading FW to addr 0x%x size %d", | 930 | sms_info("loading FW to addr 0x%x size %d", |
931 | mem_address, firmware->length); | 931 | mem_address, firmware->length); |
932 | if (coredev->preload_handler) { | 932 | if (coredev->preload_handler) { |
933 | rc = coredev->preload_handler(coredev->context); | 933 | rc = coredev->preload_handler(coredev->context); |
934 | if (rc < 0) | 934 | if (rc < 0) |
935 | return rc; | 935 | return rc; |
936 | } | 936 | } |
937 | 937 | ||
938 | /* PAGE_SIZE buffer shall be enough and dma aligned */ | 938 | /* PAGE_SIZE buffer shall be enough and dma aligned */ |
939 | msg = kmalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA); | 939 | msg = kmalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA); |
940 | if (!msg) | 940 | if (!msg) |
941 | return -ENOMEM; | 941 | return -ENOMEM; |
942 | 942 | ||
943 | if (coredev->mode != DEVICE_MODE_NONE) { | 943 | if (coredev->mode != DEVICE_MODE_NONE) { |
944 | sms_debug("sending reload command."); | 944 | sms_debug("sending reload command."); |
945 | SMS_INIT_MSG(&msg->x_msg_header, MSG_SW_RELOAD_START_REQ, | 945 | SMS_INIT_MSG(&msg->x_msg_header, MSG_SW_RELOAD_START_REQ, |
946 | sizeof(struct sms_msg_hdr)); | 946 | sizeof(struct sms_msg_hdr)); |
947 | rc = smscore_sendrequest_and_wait(coredev, msg, | 947 | rc = smscore_sendrequest_and_wait(coredev, msg, |
948 | msg->x_msg_header.msg_length, | 948 | msg->x_msg_header.msg_length, |
949 | &coredev->reload_start_done); | 949 | &coredev->reload_start_done); |
950 | if (rc < 0) { | 950 | if (rc < 0) { |
951 | sms_err("device reload failed, rc %d", rc); | 951 | sms_err("device reload failed, rc %d", rc); |
952 | goto exit_fw_download; | 952 | goto exit_fw_download; |
953 | } | 953 | } |
954 | mem_address = *(u32 *) &payload[20]; | 954 | mem_address = *(u32 *) &payload[20]; |
955 | } | 955 | } |
956 | 956 | ||
957 | for (i = 0, ptr = (u32 *)firmware->payload; i < firmware->length/4 ; | 957 | for (i = 0, ptr = (u32 *)firmware->payload; i < firmware->length/4 ; |
958 | i++, ptr++) | 958 | i++, ptr++) |
959 | calc_checksum += *ptr; | 959 | calc_checksum += *ptr; |
960 | 960 | ||
961 | while (size && rc >= 0) { | 961 | while (size && rc >= 0) { |
962 | struct sms_data_download *DataMsg = | 962 | struct sms_data_download *data_msg = |
963 | (struct sms_data_download *) msg; | 963 | (struct sms_data_download *) msg; |
964 | int payload_size = min((int) size, SMS_MAX_PAYLOAD_SIZE); | 964 | int payload_size = min((int) size, SMS_MAX_PAYLOAD_SIZE); |
965 | 965 | ||
966 | SMS_INIT_MSG(&msg->x_msg_header, MSG_SMS_DATA_DOWNLOAD_REQ, | 966 | SMS_INIT_MSG(&msg->x_msg_header, MSG_SMS_DATA_DOWNLOAD_REQ, |
967 | (u16)(sizeof(struct sms_msg_hdr) + | 967 | (u16)(sizeof(struct sms_msg_hdr) + |
968 | sizeof(u32) + payload_size)); | 968 | sizeof(u32) + payload_size)); |
969 | 969 | ||
970 | DataMsg->mem_addr = mem_address; | 970 | data_msg->mem_addr = mem_address; |
971 | memcpy(DataMsg->payload, payload, payload_size); | 971 | memcpy(data_msg->payload, payload, payload_size); |
972 | 972 | ||
973 | rc = smscore_sendrequest_and_wait(coredev, DataMsg, | 973 | rc = smscore_sendrequest_and_wait(coredev, data_msg, |
974 | DataMsg->x_msg_header.msg_length, | 974 | data_msg->x_msg_header.msg_length, |
975 | &coredev->data_download_done); | 975 | &coredev->data_download_done); |
976 | 976 | ||
977 | payload += payload_size; | 977 | payload += payload_size; |
978 | size -= payload_size; | 978 | size -= payload_size; |
979 | mem_address += payload_size; | 979 | mem_address += payload_size; |
980 | } | 980 | } |
981 | 981 | ||
982 | if (rc < 0) | 982 | if (rc < 0) |
983 | goto exit_fw_download; | 983 | goto exit_fw_download; |
984 | 984 | ||
985 | sms_err("sending MSG_SMS_DATA_VALIDITY_REQ expecting 0x%x", | 985 | sms_err("sending MSG_SMS_DATA_VALIDITY_REQ expecting 0x%x", |
986 | calc_checksum); | 986 | calc_checksum); |
987 | SMS_INIT_MSG(&msg->x_msg_header, MSG_SMS_DATA_VALIDITY_REQ, | 987 | SMS_INIT_MSG(&msg->x_msg_header, MSG_SMS_DATA_VALIDITY_REQ, |
988 | sizeof(msg->x_msg_header) + | 988 | sizeof(msg->x_msg_header) + |
989 | sizeof(u32) * 3); | 989 | sizeof(u32) * 3); |
990 | msg->msgData[0] = firmware->start_address; | 990 | msg->msg_data[0] = firmware->start_address; |
991 | /* Entry point */ | 991 | /* Entry point */ |
992 | msg->msgData[1] = firmware->length; | 992 | msg->msg_data[1] = firmware->length; |
993 | msg->msgData[2] = 0; /* Regular checksum*/ | 993 | msg->msg_data[2] = 0; /* Regular checksum*/ |
994 | rc = smscore_sendrequest_and_wait(coredev, msg, | 994 | rc = smscore_sendrequest_and_wait(coredev, msg, |
995 | msg->x_msg_header.msg_length, | 995 | msg->x_msg_header.msg_length, |
996 | &coredev->data_validity_done); | 996 | &coredev->data_validity_done); |
997 | if (rc < 0) | 997 | if (rc < 0) |
998 | goto exit_fw_download; | 998 | goto exit_fw_download; |
999 | 999 | ||
1000 | if (coredev->mode == DEVICE_MODE_NONE) { | 1000 | if (coredev->mode == DEVICE_MODE_NONE) { |
1001 | struct sms_msg_data *TriggerMsg = | 1001 | struct sms_msg_data *trigger_msg = |
1002 | (struct sms_msg_data *) msg; | 1002 | (struct sms_msg_data *) msg; |
1003 | 1003 | ||
1004 | sms_debug("sending MSG_SMS_SWDOWNLOAD_TRIGGER_REQ"); | 1004 | sms_debug("sending MSG_SMS_SWDOWNLOAD_TRIGGER_REQ"); |
1005 | SMS_INIT_MSG(&msg->x_msg_header, | 1005 | SMS_INIT_MSG(&msg->x_msg_header, |
1006 | MSG_SMS_SWDOWNLOAD_TRIGGER_REQ, | 1006 | MSG_SMS_SWDOWNLOAD_TRIGGER_REQ, |
1007 | sizeof(struct sms_msg_hdr) + | 1007 | sizeof(struct sms_msg_hdr) + |
1008 | sizeof(u32) * 5); | 1008 | sizeof(u32) * 5); |
1009 | 1009 | ||
1010 | TriggerMsg->msgData[0] = firmware->start_address; | 1010 | trigger_msg->msg_data[0] = firmware->start_address; |
1011 | /* Entry point */ | 1011 | /* Entry point */ |
1012 | TriggerMsg->msgData[1] = 6; /* Priority */ | 1012 | trigger_msg->msg_data[1] = 6; /* Priority */ |
1013 | TriggerMsg->msgData[2] = 0x200; /* Stack size */ | 1013 | trigger_msg->msg_data[2] = 0x200; /* Stack size */ |
1014 | TriggerMsg->msgData[3] = 0; /* Parameter */ | 1014 | trigger_msg->msg_data[3] = 0; /* Parameter */ |
1015 | TriggerMsg->msgData[4] = 4; /* Task ID */ | 1015 | trigger_msg->msg_data[4] = 4; /* Task ID */ |
1016 | 1016 | ||
1017 | rc = smscore_sendrequest_and_wait(coredev, TriggerMsg, | 1017 | rc = smscore_sendrequest_and_wait(coredev, trigger_msg, |
1018 | TriggerMsg->x_msg_header.msg_length, | 1018 | trigger_msg->x_msg_header.msg_length, |
1019 | &coredev->trigger_done); | 1019 | &coredev->trigger_done); |
1020 | } else { | 1020 | } else { |
1021 | SMS_INIT_MSG(&msg->x_msg_header, MSG_SW_RELOAD_EXEC_REQ, | 1021 | SMS_INIT_MSG(&msg->x_msg_header, MSG_SW_RELOAD_EXEC_REQ, |
1022 | sizeof(struct sms_msg_hdr)); | 1022 | sizeof(struct sms_msg_hdr)); |
1023 | rc = coredev->sendrequest_handler(coredev->context, msg, | 1023 | rc = coredev->sendrequest_handler(coredev->context, msg, |
1024 | msg->x_msg_header.msg_length); | 1024 | msg->x_msg_header.msg_length); |
1025 | } | 1025 | } |
1026 | 1026 | ||
1027 | if (rc < 0) | 1027 | if (rc < 0) |
1028 | goto exit_fw_download; | 1028 | goto exit_fw_download; |
1029 | 1029 | ||
1030 | /* | 1030 | /* |
1031 | * backward compatibility - wait to device_ready_done for | 1031 | * backward compatibility - wait to device_ready_done for |
1032 | * not more than 400 ms | 1032 | * not more than 400 ms |
1033 | */ | 1033 | */ |
1034 | msleep(400); | 1034 | msleep(400); |
1035 | 1035 | ||
1036 | exit_fw_download: | 1036 | exit_fw_download: |
1037 | kfree(msg); | 1037 | kfree(msg); |
1038 | 1038 | ||
1039 | if (coredev->postload_handler) { | 1039 | if (coredev->postload_handler) { |
1040 | sms_debug("rc=%d, postload=0x%p", rc, coredev->postload_handler); | 1040 | sms_debug("rc=%d, postload=0x%p", rc, coredev->postload_handler); |
1041 | if (rc >= 0) | 1041 | if (rc >= 0) |
1042 | return coredev->postload_handler(coredev->context); | 1042 | return coredev->postload_handler(coredev->context); |
1043 | } | 1043 | } |
1044 | 1044 | ||
1045 | sms_debug("rc=%d", rc); | 1045 | sms_debug("rc=%d", rc); |
1046 | return rc; | 1046 | return rc; |
1047 | } | 1047 | } |
1048 | 1048 | ||
1049 | static char *smscore_fw_lkup[][DEVICE_MODE_MAX] = { | 1049 | static char *smscore_fw_lkup[][DEVICE_MODE_MAX] = { |
1050 | [SMS_NOVA_A0] = { | 1050 | [SMS_NOVA_A0] = { |
1051 | [DEVICE_MODE_DVBT] = SMS_FW_DVB_NOVA_12MHZ, | 1051 | [DEVICE_MODE_DVBT] = SMS_FW_DVB_NOVA_12MHZ, |
1052 | [DEVICE_MODE_DVBH] = SMS_FW_DVB_NOVA_12MHZ, | 1052 | [DEVICE_MODE_DVBH] = SMS_FW_DVB_NOVA_12MHZ, |
1053 | [DEVICE_MODE_DAB_TDMB] = SMS_FW_TDMB_NOVA_12MHZ, | 1053 | [DEVICE_MODE_DAB_TDMB] = SMS_FW_TDMB_NOVA_12MHZ, |
1054 | [DEVICE_MODE_DVBT_BDA] = SMS_FW_DVB_NOVA_12MHZ, | 1054 | [DEVICE_MODE_DVBT_BDA] = SMS_FW_DVB_NOVA_12MHZ, |
1055 | [DEVICE_MODE_ISDBT] = SMS_FW_ISDBT_NOVA_12MHZ, | 1055 | [DEVICE_MODE_ISDBT] = SMS_FW_ISDBT_NOVA_12MHZ, |
1056 | [DEVICE_MODE_ISDBT_BDA] = SMS_FW_ISDBT_NOVA_12MHZ, | 1056 | [DEVICE_MODE_ISDBT_BDA] = SMS_FW_ISDBT_NOVA_12MHZ, |
1057 | }, | 1057 | }, |
1058 | [SMS_NOVA_B0] = { | 1058 | [SMS_NOVA_B0] = { |
1059 | [DEVICE_MODE_DVBT] = SMS_FW_DVB_NOVA_12MHZ_B0, | 1059 | [DEVICE_MODE_DVBT] = SMS_FW_DVB_NOVA_12MHZ_B0, |
1060 | [DEVICE_MODE_DVBH] = SMS_FW_DVB_NOVA_12MHZ_B0, | 1060 | [DEVICE_MODE_DVBH] = SMS_FW_DVB_NOVA_12MHZ_B0, |
1061 | [DEVICE_MODE_DAB_TDMB] = SMS_FW_TDMB_NOVA_12MHZ_B0, | 1061 | [DEVICE_MODE_DAB_TDMB] = SMS_FW_TDMB_NOVA_12MHZ_B0, |
1062 | [DEVICE_MODE_DVBT_BDA] = SMS_FW_DVB_NOVA_12MHZ_B0, | 1062 | [DEVICE_MODE_DVBT_BDA] = SMS_FW_DVB_NOVA_12MHZ_B0, |
1063 | [DEVICE_MODE_ISDBT] = SMS_FW_ISDBT_NOVA_12MHZ_B0, | 1063 | [DEVICE_MODE_ISDBT] = SMS_FW_ISDBT_NOVA_12MHZ_B0, |
1064 | [DEVICE_MODE_ISDBT_BDA] = SMS_FW_ISDBT_NOVA_12MHZ_B0, | 1064 | [DEVICE_MODE_ISDBT_BDA] = SMS_FW_ISDBT_NOVA_12MHZ_B0, |
1065 | [DEVICE_MODE_FM_RADIO] = SMS_FW_FM_RADIO, | 1065 | [DEVICE_MODE_FM_RADIO] = SMS_FW_FM_RADIO, |
1066 | [DEVICE_MODE_FM_RADIO_BDA] = SMS_FW_FM_RADIO, | 1066 | [DEVICE_MODE_FM_RADIO_BDA] = SMS_FW_FM_RADIO, |
1067 | }, | 1067 | }, |
1068 | [SMS_VEGA] = { | 1068 | [SMS_VEGA] = { |
1069 | [DEVICE_MODE_CMMB] = SMS_FW_CMMB_VEGA_12MHZ, | 1069 | [DEVICE_MODE_CMMB] = SMS_FW_CMMB_VEGA_12MHZ, |
1070 | }, | 1070 | }, |
1071 | [SMS_VENICE] = { | 1071 | [SMS_VENICE] = { |
1072 | [DEVICE_MODE_CMMB] = SMS_FW_CMMB_VENICE_12MHZ, | 1072 | [DEVICE_MODE_CMMB] = SMS_FW_CMMB_VENICE_12MHZ, |
1073 | }, | 1073 | }, |
1074 | [SMS_MING] = { | 1074 | [SMS_MING] = { |
1075 | [DEVICE_MODE_CMMB] = SMS_FW_CMMB_MING_APP, | 1075 | [DEVICE_MODE_CMMB] = SMS_FW_CMMB_MING_APP, |
1076 | }, | 1076 | }, |
1077 | [SMS_PELE] = { | 1077 | [SMS_PELE] = { |
1078 | [DEVICE_MODE_ISDBT] = SMS_FW_ISDBT_PELE, | 1078 | [DEVICE_MODE_ISDBT] = SMS_FW_ISDBT_PELE, |
1079 | [DEVICE_MODE_ISDBT_BDA] = SMS_FW_ISDBT_PELE, | 1079 | [DEVICE_MODE_ISDBT_BDA] = SMS_FW_ISDBT_PELE, |
1080 | }, | 1080 | }, |
1081 | [SMS_RIO] = { | 1081 | [SMS_RIO] = { |
1082 | [DEVICE_MODE_DVBT] = SMS_FW_DVB_RIO, | 1082 | [DEVICE_MODE_DVBT] = SMS_FW_DVB_RIO, |
1083 | [DEVICE_MODE_DVBH] = SMS_FW_DVBH_RIO, | 1083 | [DEVICE_MODE_DVBH] = SMS_FW_DVBH_RIO, |
1084 | [DEVICE_MODE_DVBT_BDA] = SMS_FW_DVB_RIO, | 1084 | [DEVICE_MODE_DVBT_BDA] = SMS_FW_DVB_RIO, |
1085 | [DEVICE_MODE_ISDBT] = SMS_FW_ISDBT_RIO, | 1085 | [DEVICE_MODE_ISDBT] = SMS_FW_ISDBT_RIO, |
1086 | [DEVICE_MODE_ISDBT_BDA] = SMS_FW_ISDBT_RIO, | 1086 | [DEVICE_MODE_ISDBT_BDA] = SMS_FW_ISDBT_RIO, |
1087 | [DEVICE_MODE_FM_RADIO] = SMS_FW_FM_RADIO_RIO, | 1087 | [DEVICE_MODE_FM_RADIO] = SMS_FW_FM_RADIO_RIO, |
1088 | [DEVICE_MODE_FM_RADIO_BDA] = SMS_FW_FM_RADIO_RIO, | 1088 | [DEVICE_MODE_FM_RADIO_BDA] = SMS_FW_FM_RADIO_RIO, |
1089 | }, | 1089 | }, |
1090 | [SMS_DENVER_1530] = { | 1090 | [SMS_DENVER_1530] = { |
1091 | [DEVICE_MODE_ATSC] = SMS_FW_ATSC_DENVER, | 1091 | [DEVICE_MODE_ATSC] = SMS_FW_ATSC_DENVER, |
1092 | }, | 1092 | }, |
1093 | [SMS_DENVER_2160] = { | 1093 | [SMS_DENVER_2160] = { |
1094 | [DEVICE_MODE_DAB_TDMB] = SMS_FW_TDMB_DENVER, | 1094 | [DEVICE_MODE_DAB_TDMB] = SMS_FW_TDMB_DENVER, |
1095 | }, | 1095 | }, |
1096 | }; | 1096 | }; |
1097 | 1097 | ||
1098 | /** | 1098 | /** |
1099 | * get firmware file name from one of the two mechanisms : sms_boards or | 1099 | * get firmware file name from one of the two mechanisms : sms_boards or |
1100 | * smscore_fw_lkup. | 1100 | * smscore_fw_lkup. |
1101 | * @param coredev pointer to a coredev object returned by | 1101 | * @param coredev pointer to a coredev object returned by |
1102 | * smscore_register_device | 1102 | * smscore_register_device |
1103 | * @param mode requested mode of operation | 1103 | * @param mode requested mode of operation |
1104 | * @param lookup if 1, always get the fw filename from smscore_fw_lkup | 1104 | * @param lookup if 1, always get the fw filename from smscore_fw_lkup |
1105 | * table. if 0, try first to get from sms_boards | 1105 | * table. if 0, try first to get from sms_boards |
1106 | * | 1106 | * |
1107 | * @return 0 on success, <0 on error. | 1107 | * @return 0 on success, <0 on error. |
1108 | */ | 1108 | */ |
1109 | static char *smscore_get_fw_filename(struct smscore_device_t *coredev, | 1109 | static char *smscore_get_fw_filename(struct smscore_device_t *coredev, |
1110 | int mode) | 1110 | int mode) |
1111 | { | 1111 | { |
1112 | char **fw; | 1112 | char **fw; |
1113 | int board_id = smscore_get_board_id(coredev); | 1113 | int board_id = smscore_get_board_id(coredev); |
1114 | enum sms_device_type_st type; | 1114 | enum sms_device_type_st type; |
1115 | 1115 | ||
1116 | type = smscore_registry_gettype(coredev->devpath); | 1116 | type = smscore_registry_gettype(coredev->devpath); |
1117 | 1117 | ||
1118 | /* Prevent looking outside the smscore_fw_lkup table */ | 1118 | /* Prevent looking outside the smscore_fw_lkup table */ |
1119 | if (type <= SMS_UNKNOWN_TYPE || type >= SMS_NUM_OF_DEVICE_TYPES) | 1119 | if (type <= SMS_UNKNOWN_TYPE || type >= SMS_NUM_OF_DEVICE_TYPES) |
1120 | return NULL; | 1120 | return NULL; |
1121 | if (mode <= DEVICE_MODE_NONE || mode >= DEVICE_MODE_MAX) | 1121 | if (mode <= DEVICE_MODE_NONE || mode >= DEVICE_MODE_MAX) |
1122 | return NULL; | 1122 | return NULL; |
1123 | 1123 | ||
1124 | sms_debug("trying to get fw name from sms_boards board_id %d mode %d", | 1124 | sms_debug("trying to get fw name from sms_boards board_id %d mode %d", |
1125 | board_id, mode); | 1125 | board_id, mode); |
1126 | fw = sms_get_board(board_id)->fw; | 1126 | fw = sms_get_board(board_id)->fw; |
1127 | if (!fw || !fw[mode]) { | 1127 | if (!fw || !fw[mode]) { |
1128 | sms_debug("cannot find fw name in sms_boards, getting from lookup table mode %d type %d", | 1128 | sms_debug("cannot find fw name in sms_boards, getting from lookup table mode %d type %d", |
1129 | mode, type); | 1129 | mode, type); |
1130 | return smscore_fw_lkup[type][mode]; | 1130 | return smscore_fw_lkup[type][mode]; |
1131 | } | 1131 | } |
1132 | 1132 | ||
1133 | return fw[mode]; | 1133 | return fw[mode]; |
1134 | } | 1134 | } |
1135 | 1135 | ||
1136 | /** | 1136 | /** |
1137 | * loads specified firmware into a buffer and calls device loadfirmware_handler | 1137 | * loads specified firmware into a buffer and calls device loadfirmware_handler |
1138 | * | 1138 | * |
1139 | * @param coredev pointer to a coredev object returned by | 1139 | * @param coredev pointer to a coredev object returned by |
1140 | * smscore_register_device | 1140 | * smscore_register_device |
1141 | * @param filename null-terminated string specifies firmware file name | 1141 | * @param filename null-terminated string specifies firmware file name |
1142 | * @param loadfirmware_handler device handler that loads firmware | 1142 | * @param loadfirmware_handler device handler that loads firmware |
1143 | * | 1143 | * |
1144 | * @return 0 on success, <0 on error. | 1144 | * @return 0 on success, <0 on error. |
1145 | */ | 1145 | */ |
1146 | static int smscore_load_firmware_from_file(struct smscore_device_t *coredev, | 1146 | static int smscore_load_firmware_from_file(struct smscore_device_t *coredev, |
1147 | int mode, | 1147 | int mode, |
1148 | loadfirmware_t loadfirmware_handler) | 1148 | loadfirmware_t loadfirmware_handler) |
1149 | { | 1149 | { |
1150 | int rc = -ENOENT; | 1150 | int rc = -ENOENT; |
1151 | u8 *fw_buf; | 1151 | u8 *fw_buf; |
1152 | u32 fw_buf_size; | 1152 | u32 fw_buf_size; |
1153 | const struct firmware *fw; | 1153 | const struct firmware *fw; |
1154 | 1154 | ||
1155 | char *fw_filename = smscore_get_fw_filename(coredev, mode); | 1155 | char *fw_filename = smscore_get_fw_filename(coredev, mode); |
1156 | if (!fw_filename) { | 1156 | if (!fw_filename) { |
1157 | sms_info("mode %d not supported on this device", mode); | 1157 | sms_info("mode %d not supported on this device", mode); |
1158 | return -ENOENT; | 1158 | return -ENOENT; |
1159 | } | 1159 | } |
1160 | sms_debug("Firmware name: %s", fw_filename); | 1160 | sms_debug("Firmware name: %s", fw_filename); |
1161 | 1161 | ||
1162 | if (loadfirmware_handler == NULL && !(coredev->device_flags | 1162 | if (loadfirmware_handler == NULL && !(coredev->device_flags |
1163 | & SMS_DEVICE_FAMILY2)) | 1163 | & SMS_DEVICE_FAMILY2)) |
1164 | return -EINVAL; | 1164 | return -EINVAL; |
1165 | 1165 | ||
1166 | rc = request_firmware(&fw, fw_filename, coredev->device); | 1166 | rc = request_firmware(&fw, fw_filename, coredev->device); |
1167 | if (rc < 0) { | 1167 | if (rc < 0) { |
1168 | sms_info("failed to open \"%s\"", fw_filename); | 1168 | sms_info("failed to open \"%s\"", fw_filename); |
1169 | return rc; | 1169 | return rc; |
1170 | } | 1170 | } |
1171 | sms_info("read fw %s, buffer size=0x%zx", fw_filename, fw->size); | 1171 | sms_info("read fw %s, buffer size=0x%zx", fw_filename, fw->size); |
1172 | fw_buf = kmalloc(ALIGN(fw->size, SMS_ALLOC_ALIGNMENT), | 1172 | fw_buf = kmalloc(ALIGN(fw->size, SMS_ALLOC_ALIGNMENT), |
1173 | GFP_KERNEL | GFP_DMA); | 1173 | GFP_KERNEL | GFP_DMA); |
1174 | if (!fw_buf) { | 1174 | if (!fw_buf) { |
1175 | sms_info("failed to allocate firmware buffer"); | 1175 | sms_info("failed to allocate firmware buffer"); |
1176 | return -ENOMEM; | 1176 | return -ENOMEM; |
1177 | } | 1177 | } |
1178 | memcpy(fw_buf, fw->data, fw->size); | 1178 | memcpy(fw_buf, fw->data, fw->size); |
1179 | fw_buf_size = fw->size; | 1179 | fw_buf_size = fw->size; |
1180 | 1180 | ||
1181 | rc = (coredev->device_flags & SMS_DEVICE_FAMILY2) ? | 1181 | rc = (coredev->device_flags & SMS_DEVICE_FAMILY2) ? |
1182 | smscore_load_firmware_family2(coredev, fw_buf, fw_buf_size) | 1182 | smscore_load_firmware_family2(coredev, fw_buf, fw_buf_size) |
1183 | : loadfirmware_handler(coredev->context, fw_buf, | 1183 | : loadfirmware_handler(coredev->context, fw_buf, |
1184 | fw_buf_size); | 1184 | fw_buf_size); |
1185 | 1185 | ||
1186 | kfree(fw_buf); | 1186 | kfree(fw_buf); |
1187 | release_firmware(fw); | 1187 | release_firmware(fw); |
1188 | 1188 | ||
1189 | return rc; | 1189 | return rc; |
1190 | } | 1190 | } |
1191 | 1191 | ||
1192 | /** | 1192 | /** |
1193 | * notifies all clients registered with the device, notifies hotplugs, | 1193 | * notifies all clients registered with the device, notifies hotplugs, |
1194 | * frees all buffers and coredev object | 1194 | * frees all buffers and coredev object |
1195 | * | 1195 | * |
1196 | * @param coredev pointer to a coredev object returned by | 1196 | * @param coredev pointer to a coredev object returned by |
1197 | * smscore_register_device | 1197 | * smscore_register_device |
1198 | * | 1198 | * |
1199 | * @return 0 on success, <0 on error. | 1199 | * @return 0 on success, <0 on error. |
1200 | */ | 1200 | */ |
1201 | void smscore_unregister_device(struct smscore_device_t *coredev) | 1201 | void smscore_unregister_device(struct smscore_device_t *coredev) |
1202 | { | 1202 | { |
1203 | struct smscore_buffer_t *cb; | 1203 | struct smscore_buffer_t *cb; |
1204 | int num_buffers = 0; | 1204 | int num_buffers = 0; |
1205 | int retry = 0; | 1205 | int retry = 0; |
1206 | 1206 | ||
1207 | kmutex_lock(&g_smscore_deviceslock); | 1207 | kmutex_lock(&g_smscore_deviceslock); |
1208 | 1208 | ||
1209 | /* Release input device (IR) resources */ | 1209 | /* Release input device (IR) resources */ |
1210 | sms_ir_exit(coredev); | 1210 | sms_ir_exit(coredev); |
1211 | 1211 | ||
1212 | smscore_notify_clients(coredev); | 1212 | smscore_notify_clients(coredev); |
1213 | smscore_notify_callbacks(coredev, NULL, 0); | 1213 | smscore_notify_callbacks(coredev, NULL, 0); |
1214 | 1214 | ||
1215 | /* at this point all buffers should be back | 1215 | /* at this point all buffers should be back |
1216 | * onresponse must no longer be called */ | 1216 | * onresponse must no longer be called */ |
1217 | 1217 | ||
1218 | while (1) { | 1218 | while (1) { |
1219 | while (!list_empty(&coredev->buffers)) { | 1219 | while (!list_empty(&coredev->buffers)) { |
1220 | cb = (struct smscore_buffer_t *) coredev->buffers.next; | 1220 | cb = (struct smscore_buffer_t *) coredev->buffers.next; |
1221 | list_del(&cb->entry); | 1221 | list_del(&cb->entry); |
1222 | kfree(cb); | 1222 | kfree(cb); |
1223 | num_buffers++; | 1223 | num_buffers++; |
1224 | } | 1224 | } |
1225 | if (num_buffers == coredev->num_buffers) | 1225 | if (num_buffers == coredev->num_buffers) |
1226 | break; | 1226 | break; |
1227 | if (++retry > 10) { | 1227 | if (++retry > 10) { |
1228 | sms_info("exiting although " | 1228 | sms_info("exiting although " |
1229 | "not all buffers released."); | 1229 | "not all buffers released."); |
1230 | break; | 1230 | break; |
1231 | } | 1231 | } |
1232 | 1232 | ||
1233 | sms_info("waiting for %d buffer(s)", | 1233 | sms_info("waiting for %d buffer(s)", |
1234 | coredev->num_buffers - num_buffers); | 1234 | coredev->num_buffers - num_buffers); |
1235 | kmutex_unlock(&g_smscore_deviceslock); | 1235 | kmutex_unlock(&g_smscore_deviceslock); |
1236 | msleep(100); | 1236 | msleep(100); |
1237 | kmutex_lock(&g_smscore_deviceslock); | 1237 | kmutex_lock(&g_smscore_deviceslock); |
1238 | } | 1238 | } |
1239 | 1239 | ||
1240 | sms_info("freed %d buffers", num_buffers); | 1240 | sms_info("freed %d buffers", num_buffers); |
1241 | 1241 | ||
1242 | if (coredev->common_buffer) | 1242 | if (coredev->common_buffer) |
1243 | dma_free_coherent(NULL, coredev->common_buffer_size, | 1243 | dma_free_coherent(NULL, coredev->common_buffer_size, |
1244 | coredev->common_buffer, coredev->common_buffer_phys); | 1244 | coredev->common_buffer, coredev->common_buffer_phys); |
1245 | 1245 | ||
1246 | kfree(coredev->fw_buf); | 1246 | kfree(coredev->fw_buf); |
1247 | 1247 | ||
1248 | list_del(&coredev->entry); | 1248 | list_del(&coredev->entry); |
1249 | kfree(coredev); | 1249 | kfree(coredev); |
1250 | 1250 | ||
1251 | kmutex_unlock(&g_smscore_deviceslock); | 1251 | kmutex_unlock(&g_smscore_deviceslock); |
1252 | 1252 | ||
1253 | sms_info("device %p destroyed", coredev); | 1253 | sms_info("device %p destroyed", coredev); |
1254 | } | 1254 | } |
1255 | EXPORT_SYMBOL_GPL(smscore_unregister_device); | 1255 | EXPORT_SYMBOL_GPL(smscore_unregister_device); |
1256 | 1256 | ||
1257 | static int smscore_detect_mode(struct smscore_device_t *coredev) | 1257 | static int smscore_detect_mode(struct smscore_device_t *coredev) |
1258 | { | 1258 | { |
1259 | void *buffer = kmalloc(sizeof(struct sms_msg_hdr) + SMS_DMA_ALIGNMENT, | 1259 | void *buffer = kmalloc(sizeof(struct sms_msg_hdr) + SMS_DMA_ALIGNMENT, |
1260 | GFP_KERNEL | GFP_DMA); | 1260 | GFP_KERNEL | GFP_DMA); |
1261 | struct sms_msg_hdr *msg = | 1261 | struct sms_msg_hdr *msg = |
1262 | (struct sms_msg_hdr *) SMS_ALIGN_ADDRESS(buffer); | 1262 | (struct sms_msg_hdr *) SMS_ALIGN_ADDRESS(buffer); |
1263 | int rc; | 1263 | int rc; |
1264 | 1264 | ||
1265 | if (!buffer) | 1265 | if (!buffer) |
1266 | return -ENOMEM; | 1266 | return -ENOMEM; |
1267 | 1267 | ||
1268 | SMS_INIT_MSG(msg, MSG_SMS_GET_VERSION_EX_REQ, | 1268 | SMS_INIT_MSG(msg, MSG_SMS_GET_VERSION_EX_REQ, |
1269 | sizeof(struct sms_msg_hdr)); | 1269 | sizeof(struct sms_msg_hdr)); |
1270 | 1270 | ||
1271 | rc = smscore_sendrequest_and_wait(coredev, msg, msg->msg_length, | 1271 | rc = smscore_sendrequest_and_wait(coredev, msg, msg->msg_length, |
1272 | &coredev->version_ex_done); | 1272 | &coredev->version_ex_done); |
1273 | if (rc == -ETIME) { | 1273 | if (rc == -ETIME) { |
1274 | sms_err("MSG_SMS_GET_VERSION_EX_REQ failed first try"); | 1274 | sms_err("MSG_SMS_GET_VERSION_EX_REQ failed first try"); |
1275 | 1275 | ||
1276 | if (wait_for_completion_timeout(&coredev->resume_done, | 1276 | if (wait_for_completion_timeout(&coredev->resume_done, |
1277 | msecs_to_jiffies(5000))) { | 1277 | msecs_to_jiffies(5000))) { |
1278 | rc = smscore_sendrequest_and_wait( | 1278 | rc = smscore_sendrequest_and_wait( |
1279 | coredev, msg, msg->msg_length, | 1279 | coredev, msg, msg->msg_length, |
1280 | &coredev->version_ex_done); | 1280 | &coredev->version_ex_done); |
1281 | if (rc < 0) | 1281 | if (rc < 0) |
1282 | sms_err("MSG_SMS_GET_VERSION_EX_REQ failed " | 1282 | sms_err("MSG_SMS_GET_VERSION_EX_REQ failed " |
1283 | "second try, rc %d", rc); | 1283 | "second try, rc %d", rc); |
1284 | } else | 1284 | } else |
1285 | rc = -ETIME; | 1285 | rc = -ETIME; |
1286 | } | 1286 | } |
1287 | 1287 | ||
1288 | kfree(buffer); | 1288 | kfree(buffer); |
1289 | 1289 | ||
1290 | return rc; | 1290 | return rc; |
1291 | } | 1291 | } |
1292 | 1292 | ||
1293 | /** | 1293 | /** |
1294 | * send init device request and wait for response | 1294 | * send init device request and wait for response |
1295 | * | 1295 | * |
1296 | * @param coredev pointer to a coredev object returned by | 1296 | * @param coredev pointer to a coredev object returned by |
1297 | * smscore_register_device | 1297 | * smscore_register_device |
1298 | * @param mode requested mode of operation | 1298 | * @param mode requested mode of operation |
1299 | * | 1299 | * |
1300 | * @return 0 on success, <0 on error. | 1300 | * @return 0 on success, <0 on error. |
1301 | */ | 1301 | */ |
1302 | int smscore_init_device(struct smscore_device_t *coredev, int mode) | 1302 | int smscore_init_device(struct smscore_device_t *coredev, int mode) |
1303 | { | 1303 | { |
1304 | void *buffer; | 1304 | void *buffer; |
1305 | struct sms_msg_data *msg; | 1305 | struct sms_msg_data *msg; |
1306 | int rc = 0; | 1306 | int rc = 0; |
1307 | 1307 | ||
1308 | buffer = kmalloc(sizeof(struct sms_msg_data) + | 1308 | buffer = kmalloc(sizeof(struct sms_msg_data) + |
1309 | SMS_DMA_ALIGNMENT, GFP_KERNEL | GFP_DMA); | 1309 | SMS_DMA_ALIGNMENT, GFP_KERNEL | GFP_DMA); |
1310 | if (!buffer) { | 1310 | if (!buffer) { |
1311 | sms_err("Could not allocate buffer for init device message."); | 1311 | sms_err("Could not allocate buffer for init device message."); |
1312 | return -ENOMEM; | 1312 | return -ENOMEM; |
1313 | } | 1313 | } |
1314 | 1314 | ||
1315 | msg = (struct sms_msg_data *)SMS_ALIGN_ADDRESS(buffer); | 1315 | msg = (struct sms_msg_data *)SMS_ALIGN_ADDRESS(buffer); |
1316 | SMS_INIT_MSG(&msg->x_msg_header, MSG_SMS_INIT_DEVICE_REQ, | 1316 | SMS_INIT_MSG(&msg->x_msg_header, MSG_SMS_INIT_DEVICE_REQ, |
1317 | sizeof(struct sms_msg_data)); | 1317 | sizeof(struct sms_msg_data)); |
1318 | msg->msgData[0] = mode; | 1318 | msg->msg_data[0] = mode; |
1319 | 1319 | ||
1320 | rc = smscore_sendrequest_and_wait(coredev, msg, | 1320 | rc = smscore_sendrequest_and_wait(coredev, msg, |
1321 | msg->x_msg_header. msg_length, | 1321 | msg->x_msg_header. msg_length, |
1322 | &coredev->init_device_done); | 1322 | &coredev->init_device_done); |
1323 | 1323 | ||
1324 | kfree(buffer); | 1324 | kfree(buffer); |
1325 | return rc; | 1325 | return rc; |
1326 | } | 1326 | } |
1327 | 1327 | ||
1328 | /** | 1328 | /** |
1329 | * calls device handler to change mode of operation | 1329 | * calls device handler to change mode of operation |
1330 | * NOTE: stellar/usb may disconnect when changing mode | 1330 | * NOTE: stellar/usb may disconnect when changing mode |
1331 | * | 1331 | * |
1332 | * @param coredev pointer to a coredev object returned by | 1332 | * @param coredev pointer to a coredev object returned by |
1333 | * smscore_register_device | 1333 | * smscore_register_device |
1334 | * @param mode requested mode of operation | 1334 | * @param mode requested mode of operation |
1335 | * | 1335 | * |
1336 | * @return 0 on success, <0 on error. | 1336 | * @return 0 on success, <0 on error. |
1337 | */ | 1337 | */ |
1338 | int smscore_set_device_mode(struct smscore_device_t *coredev, int mode) | 1338 | int smscore_set_device_mode(struct smscore_device_t *coredev, int mode) |
1339 | { | 1339 | { |
1340 | int rc = 0; | 1340 | int rc = 0; |
1341 | 1341 | ||
1342 | sms_debug("set device mode to %d", mode); | 1342 | sms_debug("set device mode to %d", mode); |
1343 | if (coredev->device_flags & SMS_DEVICE_FAMILY2) { | 1343 | if (coredev->device_flags & SMS_DEVICE_FAMILY2) { |
1344 | if (mode <= DEVICE_MODE_NONE || mode >= DEVICE_MODE_MAX) { | 1344 | if (mode <= DEVICE_MODE_NONE || mode >= DEVICE_MODE_MAX) { |
1345 | sms_err("invalid mode specified %d", mode); | 1345 | sms_err("invalid mode specified %d", mode); |
1346 | return -EINVAL; | 1346 | return -EINVAL; |
1347 | } | 1347 | } |
1348 | 1348 | ||
1349 | smscore_registry_setmode(coredev->devpath, mode); | 1349 | smscore_registry_setmode(coredev->devpath, mode); |
1350 | 1350 | ||
1351 | if (!(coredev->device_flags & SMS_DEVICE_NOT_READY)) { | 1351 | if (!(coredev->device_flags & SMS_DEVICE_NOT_READY)) { |
1352 | rc = smscore_detect_mode(coredev); | 1352 | rc = smscore_detect_mode(coredev); |
1353 | if (rc < 0) { | 1353 | if (rc < 0) { |
1354 | sms_err("mode detect failed %d", rc); | 1354 | sms_err("mode detect failed %d", rc); |
1355 | return rc; | 1355 | return rc; |
1356 | } | 1356 | } |
1357 | } | 1357 | } |
1358 | 1358 | ||
1359 | if (coredev->mode == mode) { | 1359 | if (coredev->mode == mode) { |
1360 | sms_info("device mode %d already set", mode); | 1360 | sms_info("device mode %d already set", mode); |
1361 | return 0; | 1361 | return 0; |
1362 | } | 1362 | } |
1363 | 1363 | ||
1364 | if (!(coredev->modes_supported & (1 << mode))) { | 1364 | if (!(coredev->modes_supported & (1 << mode))) { |
1365 | rc = smscore_load_firmware_from_file(coredev, | 1365 | rc = smscore_load_firmware_from_file(coredev, |
1366 | mode, NULL); | 1366 | mode, NULL); |
1367 | if (rc >= 0) | 1367 | if (rc >= 0) |
1368 | sms_info("firmware download success"); | 1368 | sms_info("firmware download success"); |
1369 | } else { | 1369 | } else { |
1370 | sms_info("mode %d is already supported by running firmware", | 1370 | sms_info("mode %d is already supported by running firmware", |
1371 | mode); | 1371 | mode); |
1372 | } | 1372 | } |
1373 | if (coredev->fw_version >= 0x800) { | 1373 | if (coredev->fw_version >= 0x800) { |
1374 | rc = smscore_init_device(coredev, mode); | 1374 | rc = smscore_init_device(coredev, mode); |
1375 | if (rc < 0) | 1375 | if (rc < 0) |
1376 | sms_err("device init failed, rc %d.", rc); | 1376 | sms_err("device init failed, rc %d.", rc); |
1377 | } | 1377 | } |
1378 | } else { | 1378 | } else { |
1379 | if (mode <= DEVICE_MODE_NONE || mode >= DEVICE_MODE_MAX) { | 1379 | if (mode <= DEVICE_MODE_NONE || mode >= DEVICE_MODE_MAX) { |
1380 | sms_err("invalid mode specified %d", mode); | 1380 | sms_err("invalid mode specified %d", mode); |
1381 | return -EINVAL; | 1381 | return -EINVAL; |
1382 | } | 1382 | } |
1383 | 1383 | ||
1384 | smscore_registry_setmode(coredev->devpath, mode); | 1384 | smscore_registry_setmode(coredev->devpath, mode); |
1385 | 1385 | ||
1386 | if (coredev->detectmode_handler) | 1386 | if (coredev->detectmode_handler) |
1387 | coredev->detectmode_handler(coredev->context, | 1387 | coredev->detectmode_handler(coredev->context, |
1388 | &coredev->mode); | 1388 | &coredev->mode); |
1389 | 1389 | ||
1390 | if (coredev->mode != mode && coredev->setmode_handler) | 1390 | if (coredev->mode != mode && coredev->setmode_handler) |
1391 | rc = coredev->setmode_handler(coredev->context, mode); | 1391 | rc = coredev->setmode_handler(coredev->context, mode); |
1392 | } | 1392 | } |
1393 | 1393 | ||
1394 | if (rc >= 0) { | 1394 | if (rc >= 0) { |
1395 | char *buffer; | 1395 | char *buffer; |
1396 | coredev->mode = mode; | 1396 | coredev->mode = mode; |
1397 | coredev->device_flags &= ~SMS_DEVICE_NOT_READY; | 1397 | coredev->device_flags &= ~SMS_DEVICE_NOT_READY; |
1398 | 1398 | ||
1399 | buffer = kmalloc(sizeof(struct sms_msg_data) + | 1399 | buffer = kmalloc(sizeof(struct sms_msg_data) + |
1400 | SMS_DMA_ALIGNMENT, GFP_KERNEL | GFP_DMA); | 1400 | SMS_DMA_ALIGNMENT, GFP_KERNEL | GFP_DMA); |
1401 | if (buffer) { | 1401 | if (buffer) { |
1402 | struct sms_msg_data *msg = (struct sms_msg_data *) SMS_ALIGN_ADDRESS(buffer); | 1402 | struct sms_msg_data *msg = (struct sms_msg_data *) SMS_ALIGN_ADDRESS(buffer); |
1403 | 1403 | ||
1404 | SMS_INIT_MSG(&msg->x_msg_header, MSG_SMS_INIT_DEVICE_REQ, | 1404 | SMS_INIT_MSG(&msg->x_msg_header, MSG_SMS_INIT_DEVICE_REQ, |
1405 | sizeof(struct sms_msg_data)); | 1405 | sizeof(struct sms_msg_data)); |
1406 | msg->msgData[0] = mode; | 1406 | msg->msg_data[0] = mode; |
1407 | 1407 | ||
1408 | rc = smscore_sendrequest_and_wait( | 1408 | rc = smscore_sendrequest_and_wait( |
1409 | coredev, msg, msg->x_msg_header.msg_length, | 1409 | coredev, msg, msg->x_msg_header.msg_length, |
1410 | &coredev->init_device_done); | 1410 | &coredev->init_device_done); |
1411 | 1411 | ||
1412 | kfree(buffer); | 1412 | kfree(buffer); |
1413 | } | 1413 | } |
1414 | } | 1414 | } |
1415 | 1415 | ||
1416 | if (rc < 0) | 1416 | if (rc < 0) |
1417 | sms_err("return error code %d.", rc); | 1417 | sms_err("return error code %d.", rc); |
1418 | else | 1418 | else |
1419 | sms_debug("Success setting device mode."); | 1419 | sms_debug("Success setting device mode."); |
1420 | 1420 | ||
1421 | return rc; | 1421 | return rc; |
1422 | } | 1422 | } |
1423 | 1423 | ||
1424 | /** | 1424 | /** |
1425 | * calls device handler to get current mode of operation | 1425 | * calls device handler to get current mode of operation |
1426 | * | 1426 | * |
1427 | * @param coredev pointer to a coredev object returned by | 1427 | * @param coredev pointer to a coredev object returned by |
1428 | * smscore_register_device | 1428 | * smscore_register_device |
1429 | * | 1429 | * |
1430 | * @return current mode | 1430 | * @return current mode |
1431 | */ | 1431 | */ |
1432 | int smscore_get_device_mode(struct smscore_device_t *coredev) | 1432 | int smscore_get_device_mode(struct smscore_device_t *coredev) |
1433 | { | 1433 | { |
1434 | return coredev->mode; | 1434 | return coredev->mode; |
1435 | } | 1435 | } |
1436 | EXPORT_SYMBOL_GPL(smscore_get_device_mode); | 1436 | EXPORT_SYMBOL_GPL(smscore_get_device_mode); |
1437 | 1437 | ||
1438 | /** | 1438 | /** |
1439 | * find client by response id & type within the clients list. | 1439 | * find client by response id & type within the clients list. |
1440 | * return client handle or NULL. | 1440 | * return client handle or NULL. |
1441 | * | 1441 | * |
1442 | * @param coredev pointer to a coredev object returned by | 1442 | * @param coredev pointer to a coredev object returned by |
1443 | * smscore_register_device | 1443 | * smscore_register_device |
1444 | * @param data_type client data type (SMS_DONT_CARE for all types) | 1444 | * @param data_type client data type (SMS_DONT_CARE for all types) |
1445 | * @param id client id (SMS_DONT_CARE for all id) | 1445 | * @param id client id (SMS_DONT_CARE for all id) |
1446 | * | 1446 | * |
1447 | */ | 1447 | */ |
1448 | static struct | 1448 | static struct |
1449 | smscore_client_t *smscore_find_client(struct smscore_device_t *coredev, | 1449 | smscore_client_t *smscore_find_client(struct smscore_device_t *coredev, |
1450 | int data_type, int id) | 1450 | int data_type, int id) |
1451 | { | 1451 | { |
1452 | struct list_head *first; | 1452 | struct list_head *first; |
1453 | struct smscore_client_t *client; | 1453 | struct smscore_client_t *client; |
1454 | unsigned long flags; | 1454 | unsigned long flags; |
1455 | struct list_head *firstid; | 1455 | struct list_head *firstid; |
1456 | struct smscore_idlist_t *client_id; | 1456 | struct smscore_idlist_t *client_id; |
1457 | 1457 | ||
1458 | spin_lock_irqsave(&coredev->clientslock, flags); | 1458 | spin_lock_irqsave(&coredev->clientslock, flags); |
1459 | first = &coredev->clients; | 1459 | first = &coredev->clients; |
1460 | list_for_each_entry(client, first, entry) { | 1460 | list_for_each_entry(client, first, entry) { |
1461 | firstid = &client->idlist; | 1461 | firstid = &client->idlist; |
1462 | list_for_each_entry(client_id, firstid, entry) { | 1462 | list_for_each_entry(client_id, firstid, entry) { |
1463 | if ((client_id->id == id) && | 1463 | if ((client_id->id == id) && |
1464 | (client_id->data_type == data_type || | 1464 | (client_id->data_type == data_type || |
1465 | (client_id->data_type == 0))) | 1465 | (client_id->data_type == 0))) |
1466 | goto found; | 1466 | goto found; |
1467 | } | 1467 | } |
1468 | } | 1468 | } |
1469 | client = NULL; | 1469 | client = NULL; |
1470 | found: | 1470 | found: |
1471 | spin_unlock_irqrestore(&coredev->clientslock, flags); | 1471 | spin_unlock_irqrestore(&coredev->clientslock, flags); |
1472 | return client; | 1472 | return client; |
1473 | } | 1473 | } |
1474 | 1474 | ||
1475 | /** | 1475 | /** |
1476 | * find client by response id/type, call clients onresponse handler | 1476 | * find client by response id/type, call clients onresponse handler |
1477 | * return buffer to pool on error | 1477 | * return buffer to pool on error |
1478 | * | 1478 | * |
1479 | * @param coredev pointer to a coredev object returned by | 1479 | * @param coredev pointer to a coredev object returned by |
1480 | * smscore_register_device | 1480 | * smscore_register_device |
1481 | * @param cb pointer to response buffer descriptor | 1481 | * @param cb pointer to response buffer descriptor |
1482 | * | 1482 | * |
1483 | */ | 1483 | */ |
1484 | void smscore_onresponse(struct smscore_device_t *coredev, | 1484 | void smscore_onresponse(struct smscore_device_t *coredev, |
1485 | struct smscore_buffer_t *cb) { | 1485 | struct smscore_buffer_t *cb) { |
1486 | struct sms_msg_hdr *phdr = (struct sms_msg_hdr *) ((u8 *) cb->p | 1486 | struct sms_msg_hdr *phdr = (struct sms_msg_hdr *) ((u8 *) cb->p |
1487 | + cb->offset); | 1487 | + cb->offset); |
1488 | struct smscore_client_t *client; | 1488 | struct smscore_client_t *client; |
1489 | int rc = -EBUSY; | 1489 | int rc = -EBUSY; |
1490 | static unsigned long last_sample_time; /* = 0; */ | 1490 | static unsigned long last_sample_time; /* = 0; */ |
1491 | static int data_total; /* = 0; */ | 1491 | static int data_total; /* = 0; */ |
1492 | unsigned long time_now = jiffies_to_msecs(jiffies); | 1492 | unsigned long time_now = jiffies_to_msecs(jiffies); |
1493 | 1493 | ||
1494 | if (!last_sample_time) | 1494 | if (!last_sample_time) |
1495 | last_sample_time = time_now; | 1495 | last_sample_time = time_now; |
1496 | 1496 | ||
1497 | if (time_now - last_sample_time > 10000) { | 1497 | if (time_now - last_sample_time > 10000) { |
1498 | sms_debug("data rate %d bytes/secs", | 1498 | sms_debug("data rate %d bytes/secs", |
1499 | (int)((data_total * 1000) / | 1499 | (int)((data_total * 1000) / |
1500 | (time_now - last_sample_time))); | 1500 | (time_now - last_sample_time))); |
1501 | 1501 | ||
1502 | last_sample_time = time_now; | 1502 | last_sample_time = time_now; |
1503 | data_total = 0; | 1503 | data_total = 0; |
1504 | } | 1504 | } |
1505 | 1505 | ||
1506 | data_total += cb->size; | 1506 | data_total += cb->size; |
1507 | /* Do we need to re-route? */ | 1507 | /* Do we need to re-route? */ |
1508 | if ((phdr->msg_type == MSG_SMS_HO_PER_SLICES_IND) || | 1508 | if ((phdr->msg_type == MSG_SMS_HO_PER_SLICES_IND) || |
1509 | (phdr->msg_type == MSG_SMS_TRANSMISSION_IND)) { | 1509 | (phdr->msg_type == MSG_SMS_TRANSMISSION_IND)) { |
1510 | if (coredev->mode == DEVICE_MODE_DVBT_BDA) | 1510 | if (coredev->mode == DEVICE_MODE_DVBT_BDA) |
1511 | phdr->msg_dst_id = DVBT_BDA_CONTROL_MSG_ID; | 1511 | phdr->msg_dst_id = DVBT_BDA_CONTROL_MSG_ID; |
1512 | } | 1512 | } |
1513 | 1513 | ||
1514 | 1514 | ||
1515 | client = smscore_find_client(coredev, phdr->msg_type, phdr->msg_dst_id); | 1515 | client = smscore_find_client(coredev, phdr->msg_type, phdr->msg_dst_id); |
1516 | 1516 | ||
1517 | /* If no client registered for type & id, | 1517 | /* If no client registered for type & id, |
1518 | * check for control client where type is not registered */ | 1518 | * check for control client where type is not registered */ |
1519 | if (client) | 1519 | if (client) |
1520 | rc = client->onresponse_handler(client->context, cb); | 1520 | rc = client->onresponse_handler(client->context, cb); |
1521 | 1521 | ||
1522 | if (rc < 0) { | 1522 | if (rc < 0) { |
1523 | switch (phdr->msg_type) { | 1523 | switch (phdr->msg_type) { |
1524 | case MSG_SMS_ISDBT_TUNE_RES: | 1524 | case MSG_SMS_ISDBT_TUNE_RES: |
1525 | break; | 1525 | break; |
1526 | case MSG_SMS_RF_TUNE_RES: | 1526 | case MSG_SMS_RF_TUNE_RES: |
1527 | break; | 1527 | break; |
1528 | case MSG_SMS_SIGNAL_DETECTED_IND: | 1528 | case MSG_SMS_SIGNAL_DETECTED_IND: |
1529 | break; | 1529 | break; |
1530 | case MSG_SMS_NO_SIGNAL_IND: | 1530 | case MSG_SMS_NO_SIGNAL_IND: |
1531 | break; | 1531 | break; |
1532 | case MSG_SMS_SPI_INT_LINE_SET_RES: | 1532 | case MSG_SMS_SPI_INT_LINE_SET_RES: |
1533 | break; | 1533 | break; |
1534 | case MSG_SMS_INTERFACE_LOCK_IND: | 1534 | case MSG_SMS_INTERFACE_LOCK_IND: |
1535 | break; | 1535 | break; |
1536 | case MSG_SMS_INTERFACE_UNLOCK_IND: | 1536 | case MSG_SMS_INTERFACE_UNLOCK_IND: |
1537 | break; | 1537 | break; |
1538 | case MSG_SMS_GET_VERSION_EX_RES: | 1538 | case MSG_SMS_GET_VERSION_EX_RES: |
1539 | { | 1539 | { |
1540 | struct sms_version_res *ver = | 1540 | struct sms_version_res *ver = |
1541 | (struct sms_version_res *) phdr; | 1541 | (struct sms_version_res *) phdr; |
1542 | sms_debug("Firmware id %d prots 0x%x ver %d.%d", | 1542 | sms_debug("Firmware id %d prots 0x%x ver %d.%d", |
1543 | ver->firmware_id, ver->supported_protocols, | 1543 | ver->firmware_id, ver->supported_protocols, |
1544 | ver->rom_ver_major, ver->rom_ver_minor); | 1544 | ver->rom_ver_major, ver->rom_ver_minor); |
1545 | 1545 | ||
1546 | coredev->mode = ver->firmware_id == 255 ? | 1546 | coredev->mode = ver->firmware_id == 255 ? |
1547 | DEVICE_MODE_NONE : ver->firmware_id; | 1547 | DEVICE_MODE_NONE : ver->firmware_id; |
1548 | coredev->modes_supported = ver->supported_protocols; | 1548 | coredev->modes_supported = ver->supported_protocols; |
1549 | coredev->fw_version = ver->rom_ver_major << 8 | | 1549 | coredev->fw_version = ver->rom_ver_major << 8 | |
1550 | ver->rom_ver_minor; | 1550 | ver->rom_ver_minor; |
1551 | 1551 | ||
1552 | complete(&coredev->version_ex_done); | 1552 | complete(&coredev->version_ex_done); |
1553 | break; | 1553 | break; |
1554 | } | 1554 | } |
1555 | case MSG_SMS_INIT_DEVICE_RES: | 1555 | case MSG_SMS_INIT_DEVICE_RES: |
1556 | complete(&coredev->init_device_done); | 1556 | complete(&coredev->init_device_done); |
1557 | break; | 1557 | break; |
1558 | case MSG_SW_RELOAD_START_RES: | 1558 | case MSG_SW_RELOAD_START_RES: |
1559 | complete(&coredev->reload_start_done); | 1559 | complete(&coredev->reload_start_done); |
1560 | break; | 1560 | break; |
1561 | case MSG_SMS_DATA_VALIDITY_RES: | 1561 | case MSG_SMS_DATA_VALIDITY_RES: |
1562 | { | 1562 | { |
1563 | struct sms_msg_data *validity = (struct sms_msg_data *) phdr; | 1563 | struct sms_msg_data *validity = (struct sms_msg_data *) phdr; |
1564 | 1564 | ||
1565 | sms_err("MSG_SMS_DATA_VALIDITY_RES, checksum = 0x%x", | 1565 | sms_err("MSG_SMS_DATA_VALIDITY_RES, checksum = 0x%x", |
1566 | validity->msgData[0]); | 1566 | validity->msg_data[0]); |
1567 | complete(&coredev->data_validity_done); | 1567 | complete(&coredev->data_validity_done); |
1568 | break; | 1568 | break; |
1569 | } | 1569 | } |
1570 | case MSG_SMS_DATA_DOWNLOAD_RES: | 1570 | case MSG_SMS_DATA_DOWNLOAD_RES: |
1571 | complete(&coredev->data_download_done); | 1571 | complete(&coredev->data_download_done); |
1572 | break; | 1572 | break; |
1573 | case MSG_SW_RELOAD_EXEC_RES: | 1573 | case MSG_SW_RELOAD_EXEC_RES: |
1574 | break; | 1574 | break; |
1575 | case MSG_SMS_SWDOWNLOAD_TRIGGER_RES: | 1575 | case MSG_SMS_SWDOWNLOAD_TRIGGER_RES: |
1576 | complete(&coredev->trigger_done); | 1576 | complete(&coredev->trigger_done); |
1577 | break; | 1577 | break; |
1578 | case MSG_SMS_SLEEP_RESUME_COMP_IND: | 1578 | case MSG_SMS_SLEEP_RESUME_COMP_IND: |
1579 | complete(&coredev->resume_done); | 1579 | complete(&coredev->resume_done); |
1580 | break; | 1580 | break; |
1581 | case MSG_SMS_GPIO_CONFIG_EX_RES: | 1581 | case MSG_SMS_GPIO_CONFIG_EX_RES: |
1582 | complete(&coredev->gpio_configuration_done); | 1582 | complete(&coredev->gpio_configuration_done); |
1583 | break; | 1583 | break; |
1584 | case MSG_SMS_GPIO_SET_LEVEL_RES: | 1584 | case MSG_SMS_GPIO_SET_LEVEL_RES: |
1585 | complete(&coredev->gpio_set_level_done); | 1585 | complete(&coredev->gpio_set_level_done); |
1586 | break; | 1586 | break; |
1587 | case MSG_SMS_GPIO_GET_LEVEL_RES: | 1587 | case MSG_SMS_GPIO_GET_LEVEL_RES: |
1588 | { | 1588 | { |
1589 | u32 *msgdata = (u32 *) phdr; | 1589 | u32 *msgdata = (u32 *) phdr; |
1590 | coredev->gpio_get_res = msgdata[1]; | 1590 | coredev->gpio_get_res = msgdata[1]; |
1591 | sms_debug("gpio level %d", | 1591 | sms_debug("gpio level %d", |
1592 | coredev->gpio_get_res); | 1592 | coredev->gpio_get_res); |
1593 | complete(&coredev->gpio_get_level_done); | 1593 | complete(&coredev->gpio_get_level_done); |
1594 | break; | 1594 | break; |
1595 | } | 1595 | } |
1596 | case MSG_SMS_START_IR_RES: | 1596 | case MSG_SMS_START_IR_RES: |
1597 | complete(&coredev->ir_init_done); | 1597 | complete(&coredev->ir_init_done); |
1598 | break; | 1598 | break; |
1599 | case MSG_SMS_IR_SAMPLES_IND: | 1599 | case MSG_SMS_IR_SAMPLES_IND: |
1600 | sms_ir_event(coredev, | 1600 | sms_ir_event(coredev, |
1601 | (const char *) | 1601 | (const char *) |
1602 | ((char *)phdr | 1602 | ((char *)phdr |
1603 | + sizeof(struct sms_msg_hdr)), | 1603 | + sizeof(struct sms_msg_hdr)), |
1604 | (int)phdr->msg_length | 1604 | (int)phdr->msg_length |
1605 | - sizeof(struct sms_msg_hdr)); | 1605 | - sizeof(struct sms_msg_hdr)); |
1606 | break; | 1606 | break; |
1607 | 1607 | ||
1608 | case MSG_SMS_DVBT_BDA_DATA: | 1608 | case MSG_SMS_DVBT_BDA_DATA: |
1609 | /* | 1609 | /* |
1610 | * It can be received here, if the frontend is | 1610 | * It can be received here, if the frontend is |
1611 | * tuned into a valid channel and the proper firmware | 1611 | * tuned into a valid channel and the proper firmware |
1612 | * is loaded. That happens when the module got removed | 1612 | * is loaded. That happens when the module got removed |
1613 | * and re-inserted, without powering the device off | 1613 | * and re-inserted, without powering the device off |
1614 | */ | 1614 | */ |
1615 | break; | 1615 | break; |
1616 | 1616 | ||
1617 | default: | 1617 | default: |
1618 | sms_debug("message %s(%d) not handled.", | 1618 | sms_debug("message %s(%d) not handled.", |
1619 | smscore_translate_msg(phdr->msg_type), | 1619 | smscore_translate_msg(phdr->msg_type), |
1620 | phdr->msg_type); | 1620 | phdr->msg_type); |
1621 | break; | 1621 | break; |
1622 | } | 1622 | } |
1623 | smscore_putbuffer(coredev, cb); | 1623 | smscore_putbuffer(coredev, cb); |
1624 | } | 1624 | } |
1625 | } | 1625 | } |
1626 | EXPORT_SYMBOL_GPL(smscore_onresponse); | 1626 | EXPORT_SYMBOL_GPL(smscore_onresponse); |
1627 | 1627 | ||
1628 | /** | 1628 | /** |
1629 | * return pointer to next free buffer descriptor from core pool | 1629 | * return pointer to next free buffer descriptor from core pool |
1630 | * | 1630 | * |
1631 | * @param coredev pointer to a coredev object returned by | 1631 | * @param coredev pointer to a coredev object returned by |
1632 | * smscore_register_device | 1632 | * smscore_register_device |
1633 | * | 1633 | * |
1634 | * @return pointer to descriptor on success, NULL on error. | 1634 | * @return pointer to descriptor on success, NULL on error. |
1635 | */ | 1635 | */ |
1636 | 1636 | ||
1637 | static struct smscore_buffer_t *get_entry(struct smscore_device_t *coredev) | 1637 | static struct smscore_buffer_t *get_entry(struct smscore_device_t *coredev) |
1638 | { | 1638 | { |
1639 | struct smscore_buffer_t *cb = NULL; | 1639 | struct smscore_buffer_t *cb = NULL; |
1640 | unsigned long flags; | 1640 | unsigned long flags; |
1641 | 1641 | ||
1642 | spin_lock_irqsave(&coredev->bufferslock, flags); | 1642 | spin_lock_irqsave(&coredev->bufferslock, flags); |
1643 | if (!list_empty(&coredev->buffers)) { | 1643 | if (!list_empty(&coredev->buffers)) { |
1644 | cb = (struct smscore_buffer_t *) coredev->buffers.next; | 1644 | cb = (struct smscore_buffer_t *) coredev->buffers.next; |
1645 | list_del(&cb->entry); | 1645 | list_del(&cb->entry); |
1646 | } | 1646 | } |
1647 | spin_unlock_irqrestore(&coredev->bufferslock, flags); | 1647 | spin_unlock_irqrestore(&coredev->bufferslock, flags); |
1648 | return cb; | 1648 | return cb; |
1649 | } | 1649 | } |
1650 | 1650 | ||
1651 | struct smscore_buffer_t *smscore_getbuffer(struct smscore_device_t *coredev) | 1651 | struct smscore_buffer_t *smscore_getbuffer(struct smscore_device_t *coredev) |
1652 | { | 1652 | { |
1653 | struct smscore_buffer_t *cb = NULL; | 1653 | struct smscore_buffer_t *cb = NULL; |
1654 | 1654 | ||
1655 | wait_event(coredev->buffer_mng_waitq, (cb = get_entry(coredev))); | 1655 | wait_event(coredev->buffer_mng_waitq, (cb = get_entry(coredev))); |
1656 | 1656 | ||
1657 | return cb; | 1657 | return cb; |
1658 | } | 1658 | } |
1659 | EXPORT_SYMBOL_GPL(smscore_getbuffer); | 1659 | EXPORT_SYMBOL_GPL(smscore_getbuffer); |
1660 | 1660 | ||
1661 | /** | 1661 | /** |
1662 | * return buffer descriptor to a pool | 1662 | * return buffer descriptor to a pool |
1663 | * | 1663 | * |
1664 | * @param coredev pointer to a coredev object returned by | 1664 | * @param coredev pointer to a coredev object returned by |
1665 | * smscore_register_device | 1665 | * smscore_register_device |
1666 | * @param cb pointer buffer descriptor | 1666 | * @param cb pointer buffer descriptor |
1667 | * | 1667 | * |
1668 | */ | 1668 | */ |
1669 | void smscore_putbuffer(struct smscore_device_t *coredev, | 1669 | void smscore_putbuffer(struct smscore_device_t *coredev, |
1670 | struct smscore_buffer_t *cb) { | 1670 | struct smscore_buffer_t *cb) { |
1671 | wake_up_interruptible(&coredev->buffer_mng_waitq); | 1671 | wake_up_interruptible(&coredev->buffer_mng_waitq); |
1672 | list_add_locked(&cb->entry, &coredev->buffers, &coredev->bufferslock); | 1672 | list_add_locked(&cb->entry, &coredev->buffers, &coredev->bufferslock); |
1673 | } | 1673 | } |
1674 | EXPORT_SYMBOL_GPL(smscore_putbuffer); | 1674 | EXPORT_SYMBOL_GPL(smscore_putbuffer); |
1675 | 1675 | ||
1676 | static int smscore_validate_client(struct smscore_device_t *coredev, | 1676 | static int smscore_validate_client(struct smscore_device_t *coredev, |
1677 | struct smscore_client_t *client, | 1677 | struct smscore_client_t *client, |
1678 | int data_type, int id) | 1678 | int data_type, int id) |
1679 | { | 1679 | { |
1680 | struct smscore_idlist_t *listentry; | 1680 | struct smscore_idlist_t *listentry; |
1681 | struct smscore_client_t *registered_client; | 1681 | struct smscore_client_t *registered_client; |
1682 | 1682 | ||
1683 | if (!client) { | 1683 | if (!client) { |
1684 | sms_err("bad parameter."); | 1684 | sms_err("bad parameter."); |
1685 | return -EINVAL; | 1685 | return -EINVAL; |
1686 | } | 1686 | } |
1687 | registered_client = smscore_find_client(coredev, data_type, id); | 1687 | registered_client = smscore_find_client(coredev, data_type, id); |
1688 | if (registered_client == client) | 1688 | if (registered_client == client) |
1689 | return 0; | 1689 | return 0; |
1690 | 1690 | ||
1691 | if (registered_client) { | 1691 | if (registered_client) { |
1692 | sms_err("The msg ID already registered to another client."); | 1692 | sms_err("The msg ID already registered to another client."); |
1693 | return -EEXIST; | 1693 | return -EEXIST; |
1694 | } | 1694 | } |
1695 | listentry = kzalloc(sizeof(struct smscore_idlist_t), GFP_KERNEL); | 1695 | listentry = kzalloc(sizeof(struct smscore_idlist_t), GFP_KERNEL); |
1696 | if (!listentry) { | 1696 | if (!listentry) { |
1697 | sms_err("Can't allocate memory for client id."); | 1697 | sms_err("Can't allocate memory for client id."); |
1698 | return -ENOMEM; | 1698 | return -ENOMEM; |
1699 | } | 1699 | } |
1700 | listentry->id = id; | 1700 | listentry->id = id; |
1701 | listentry->data_type = data_type; | 1701 | listentry->data_type = data_type; |
1702 | list_add_locked(&listentry->entry, &client->idlist, | 1702 | list_add_locked(&listentry->entry, &client->idlist, |
1703 | &coredev->clientslock); | 1703 | &coredev->clientslock); |
1704 | return 0; | 1704 | return 0; |
1705 | } | 1705 | } |
1706 | 1706 | ||
1707 | /** | 1707 | /** |
1708 | * creates smsclient object, check that id is taken by another client | 1708 | * creates smsclient object, check that id is taken by another client |
1709 | * | 1709 | * |
1710 | * @param coredev pointer to a coredev object from clients hotplug | 1710 | * @param coredev pointer to a coredev object from clients hotplug |
1711 | * @param initial_id all messages with this id would be sent to this client | 1711 | * @param initial_id all messages with this id would be sent to this client |
1712 | * @param data_type all messages of this type would be sent to this client | 1712 | * @param data_type all messages of this type would be sent to this client |
1713 | * @param onresponse_handler client handler that is called to | 1713 | * @param onresponse_handler client handler that is called to |
1714 | * process incoming messages | 1714 | * process incoming messages |
1715 | * @param onremove_handler client handler that is called when device is removed | 1715 | * @param onremove_handler client handler that is called when device is removed |
1716 | * @param context client-specific context | 1716 | * @param context client-specific context |
1717 | * @param client pointer to a value that receives created smsclient object | 1717 | * @param client pointer to a value that receives created smsclient object |
1718 | * | 1718 | * |
1719 | * @return 0 on success, <0 on error. | 1719 | * @return 0 on success, <0 on error. |
1720 | */ | 1720 | */ |
1721 | int smscore_register_client(struct smscore_device_t *coredev, | 1721 | int smscore_register_client(struct smscore_device_t *coredev, |
1722 | struct smsclient_params_t *params, | 1722 | struct smsclient_params_t *params, |
1723 | struct smscore_client_t **client) | 1723 | struct smscore_client_t **client) |
1724 | { | 1724 | { |
1725 | struct smscore_client_t *newclient; | 1725 | struct smscore_client_t *newclient; |
1726 | /* check that no other channel with same parameters exists */ | 1726 | /* check that no other channel with same parameters exists */ |
1727 | if (smscore_find_client(coredev, params->data_type, | 1727 | if (smscore_find_client(coredev, params->data_type, |
1728 | params->initial_id)) { | 1728 | params->initial_id)) { |
1729 | sms_err("Client already exist."); | 1729 | sms_err("Client already exist."); |
1730 | return -EEXIST; | 1730 | return -EEXIST; |
1731 | } | 1731 | } |
1732 | 1732 | ||
1733 | newclient = kzalloc(sizeof(struct smscore_client_t), GFP_KERNEL); | 1733 | newclient = kzalloc(sizeof(struct smscore_client_t), GFP_KERNEL); |
1734 | if (!newclient) { | 1734 | if (!newclient) { |
1735 | sms_err("Failed to allocate memory for client."); | 1735 | sms_err("Failed to allocate memory for client."); |
1736 | return -ENOMEM; | 1736 | return -ENOMEM; |
1737 | } | 1737 | } |
1738 | 1738 | ||
1739 | INIT_LIST_HEAD(&newclient->idlist); | 1739 | INIT_LIST_HEAD(&newclient->idlist); |
1740 | newclient->coredev = coredev; | 1740 | newclient->coredev = coredev; |
1741 | newclient->onresponse_handler = params->onresponse_handler; | 1741 | newclient->onresponse_handler = params->onresponse_handler; |
1742 | newclient->onremove_handler = params->onremove_handler; | 1742 | newclient->onremove_handler = params->onremove_handler; |
1743 | newclient->context = params->context; | 1743 | newclient->context = params->context; |
1744 | list_add_locked(&newclient->entry, &coredev->clients, | 1744 | list_add_locked(&newclient->entry, &coredev->clients, |
1745 | &coredev->clientslock); | 1745 | &coredev->clientslock); |
1746 | smscore_validate_client(coredev, newclient, params->data_type, | 1746 | smscore_validate_client(coredev, newclient, params->data_type, |
1747 | params->initial_id); | 1747 | params->initial_id); |
1748 | *client = newclient; | 1748 | *client = newclient; |
1749 | sms_debug("%p %d %d", params->context, params->data_type, | 1749 | sms_debug("%p %d %d", params->context, params->data_type, |
1750 | params->initial_id); | 1750 | params->initial_id); |
1751 | 1751 | ||
1752 | return 0; | 1752 | return 0; |
1753 | } | 1753 | } |
1754 | EXPORT_SYMBOL_GPL(smscore_register_client); | 1754 | EXPORT_SYMBOL_GPL(smscore_register_client); |
1755 | 1755 | ||
1756 | /** | 1756 | /** |
1757 | * frees smsclient object and all subclients associated with it | 1757 | * frees smsclient object and all subclients associated with it |
1758 | * | 1758 | * |
1759 | * @param client pointer to smsclient object returned by | 1759 | * @param client pointer to smsclient object returned by |
1760 | * smscore_register_client | 1760 | * smscore_register_client |
1761 | * | 1761 | * |
1762 | */ | 1762 | */ |
1763 | void smscore_unregister_client(struct smscore_client_t *client) | 1763 | void smscore_unregister_client(struct smscore_client_t *client) |
1764 | { | 1764 | { |
1765 | struct smscore_device_t *coredev = client->coredev; | 1765 | struct smscore_device_t *coredev = client->coredev; |
1766 | unsigned long flags; | 1766 | unsigned long flags; |
1767 | 1767 | ||
1768 | spin_lock_irqsave(&coredev->clientslock, flags); | 1768 | spin_lock_irqsave(&coredev->clientslock, flags); |
1769 | 1769 | ||
1770 | 1770 | ||
1771 | while (!list_empty(&client->idlist)) { | 1771 | while (!list_empty(&client->idlist)) { |
1772 | struct smscore_idlist_t *identry = | 1772 | struct smscore_idlist_t *identry = |
1773 | (struct smscore_idlist_t *) client->idlist.next; | 1773 | (struct smscore_idlist_t *) client->idlist.next; |
1774 | list_del(&identry->entry); | 1774 | list_del(&identry->entry); |
1775 | kfree(identry); | 1775 | kfree(identry); |
1776 | } | 1776 | } |
1777 | 1777 | ||
1778 | sms_info("%p", client->context); | 1778 | sms_info("%p", client->context); |
1779 | 1779 | ||
1780 | list_del(&client->entry); | 1780 | list_del(&client->entry); |
1781 | kfree(client); | 1781 | kfree(client); |
1782 | 1782 | ||
1783 | spin_unlock_irqrestore(&coredev->clientslock, flags); | 1783 | spin_unlock_irqrestore(&coredev->clientslock, flags); |
1784 | } | 1784 | } |
1785 | EXPORT_SYMBOL_GPL(smscore_unregister_client); | 1785 | EXPORT_SYMBOL_GPL(smscore_unregister_client); |
1786 | 1786 | ||
1787 | /** | 1787 | /** |
1788 | * verifies that source id is not taken by another client, | 1788 | * verifies that source id is not taken by another client, |
1789 | * calls device handler to send requests to the device | 1789 | * calls device handler to send requests to the device |
1790 | * | 1790 | * |
1791 | * @param client pointer to smsclient object returned by | 1791 | * @param client pointer to smsclient object returned by |
1792 | * smscore_register_client | 1792 | * smscore_register_client |
1793 | * @param buffer pointer to a request buffer | 1793 | * @param buffer pointer to a request buffer |
1794 | * @param size size (in bytes) of request buffer | 1794 | * @param size size (in bytes) of request buffer |
1795 | * | 1795 | * |
1796 | * @return 0 on success, <0 on error. | 1796 | * @return 0 on success, <0 on error. |
1797 | */ | 1797 | */ |
1798 | int smsclient_sendrequest(struct smscore_client_t *client, | 1798 | int smsclient_sendrequest(struct smscore_client_t *client, |
1799 | void *buffer, size_t size) | 1799 | void *buffer, size_t size) |
1800 | { | 1800 | { |
1801 | struct smscore_device_t *coredev; | 1801 | struct smscore_device_t *coredev; |
1802 | struct sms_msg_hdr *phdr = (struct sms_msg_hdr *) buffer; | 1802 | struct sms_msg_hdr *phdr = (struct sms_msg_hdr *) buffer; |
1803 | int rc; | 1803 | int rc; |
1804 | 1804 | ||
1805 | if (client == NULL) { | 1805 | if (client == NULL) { |
1806 | sms_err("Got NULL client"); | 1806 | sms_err("Got NULL client"); |
1807 | return -EINVAL; | 1807 | return -EINVAL; |
1808 | } | 1808 | } |
1809 | 1809 | ||
1810 | coredev = client->coredev; | 1810 | coredev = client->coredev; |
1811 | 1811 | ||
1812 | /* check that no other channel with same id exists */ | 1812 | /* check that no other channel with same id exists */ |
1813 | if (coredev == NULL) { | 1813 | if (coredev == NULL) { |
1814 | sms_err("Got NULL coredev"); | 1814 | sms_err("Got NULL coredev"); |
1815 | return -EINVAL; | 1815 | return -EINVAL; |
1816 | } | 1816 | } |
1817 | 1817 | ||
1818 | rc = smscore_validate_client(client->coredev, client, 0, | 1818 | rc = smscore_validate_client(client->coredev, client, 0, |
1819 | phdr->msg_src_id); | 1819 | phdr->msg_src_id); |
1820 | if (rc < 0) | 1820 | if (rc < 0) |
1821 | return rc; | 1821 | return rc; |
1822 | 1822 | ||
1823 | return coredev->sendrequest_handler(coredev->context, buffer, size); | 1823 | return coredev->sendrequest_handler(coredev->context, buffer, size); |
1824 | } | 1824 | } |
1825 | EXPORT_SYMBOL_GPL(smsclient_sendrequest); | 1825 | EXPORT_SYMBOL_GPL(smsclient_sendrequest); |
1826 | 1826 | ||
1827 | 1827 | ||
1828 | /* old GPIO managements implementation */ | 1828 | /* old GPIO managements implementation */ |
1829 | int smscore_configure_gpio(struct smscore_device_t *coredev, u32 pin, | 1829 | int smscore_configure_gpio(struct smscore_device_t *coredev, u32 pin, |
1830 | struct smscore_config_gpio *pinconfig) | 1830 | struct smscore_config_gpio *pinconfig) |
1831 | { | 1831 | { |
1832 | struct { | 1832 | struct { |
1833 | struct sms_msg_hdr hdr; | 1833 | struct sms_msg_hdr hdr; |
1834 | u32 data[6]; | 1834 | u32 data[6]; |
1835 | } msg; | 1835 | } msg; |
1836 | 1836 | ||
1837 | if (coredev->device_flags & SMS_DEVICE_FAMILY2) { | 1837 | if (coredev->device_flags & SMS_DEVICE_FAMILY2) { |
1838 | msg.hdr.msg_src_id = DVBT_BDA_CONTROL_MSG_ID; | 1838 | msg.hdr.msg_src_id = DVBT_BDA_CONTROL_MSG_ID; |
1839 | msg.hdr.msg_dst_id = HIF_TASK; | 1839 | msg.hdr.msg_dst_id = HIF_TASK; |
1840 | msg.hdr.msg_flags = 0; | 1840 | msg.hdr.msg_flags = 0; |
1841 | msg.hdr.msg_type = MSG_SMS_GPIO_CONFIG_EX_REQ; | 1841 | msg.hdr.msg_type = MSG_SMS_GPIO_CONFIG_EX_REQ; |
1842 | msg.hdr.msg_length = sizeof(msg); | 1842 | msg.hdr.msg_length = sizeof(msg); |
1843 | 1843 | ||
1844 | msg.data[0] = pin; | 1844 | msg.data[0] = pin; |
1845 | msg.data[1] = pinconfig->pullupdown; | 1845 | msg.data[1] = pinconfig->pullupdown; |
1846 | 1846 | ||
1847 | /* Convert slew rate for Nova: Fast(0) = 3 / Slow(1) = 0; */ | 1847 | /* Convert slew rate for Nova: Fast(0) = 3 / Slow(1) = 0; */ |
1848 | msg.data[2] = pinconfig->outputslewrate == 0 ? 3 : 0; | 1848 | msg.data[2] = pinconfig->outputslewrate == 0 ? 3 : 0; |
1849 | 1849 | ||
1850 | switch (pinconfig->outputdriving) { | 1850 | switch (pinconfig->outputdriving) { |
1851 | case SMS_GPIO_OUTPUTDRIVING_S_16mA: | 1851 | case SMS_GPIO_OUTPUTDRIVING_S_16mA: |
1852 | msg.data[3] = 7; /* Nova - 16mA */ | 1852 | msg.data[3] = 7; /* Nova - 16mA */ |
1853 | break; | 1853 | break; |
1854 | case SMS_GPIO_OUTPUTDRIVING_S_12mA: | 1854 | case SMS_GPIO_OUTPUTDRIVING_S_12mA: |
1855 | msg.data[3] = 5; /* Nova - 11mA */ | 1855 | msg.data[3] = 5; /* Nova - 11mA */ |
1856 | break; | 1856 | break; |
1857 | case SMS_GPIO_OUTPUTDRIVING_S_8mA: | 1857 | case SMS_GPIO_OUTPUTDRIVING_S_8mA: |
1858 | msg.data[3] = 3; /* Nova - 7mA */ | 1858 | msg.data[3] = 3; /* Nova - 7mA */ |
1859 | break; | 1859 | break; |
1860 | case SMS_GPIO_OUTPUTDRIVING_S_4mA: | 1860 | case SMS_GPIO_OUTPUTDRIVING_S_4mA: |
1861 | default: | 1861 | default: |
1862 | msg.data[3] = 2; /* Nova - 4mA */ | 1862 | msg.data[3] = 2; /* Nova - 4mA */ |
1863 | break; | 1863 | break; |
1864 | } | 1864 | } |
1865 | 1865 | ||
1866 | msg.data[4] = pinconfig->direction; | 1866 | msg.data[4] = pinconfig->direction; |
1867 | msg.data[5] = 0; | 1867 | msg.data[5] = 0; |
1868 | } else /* TODO: SMS_DEVICE_FAMILY1 */ | 1868 | } else /* TODO: SMS_DEVICE_FAMILY1 */ |
1869 | return -EINVAL; | 1869 | return -EINVAL; |
1870 | 1870 | ||
1871 | return coredev->sendrequest_handler(coredev->context, | 1871 | return coredev->sendrequest_handler(coredev->context, |
1872 | &msg, sizeof(msg)); | 1872 | &msg, sizeof(msg)); |
1873 | } | 1873 | } |
1874 | 1874 | ||
1875 | int smscore_set_gpio(struct smscore_device_t *coredev, u32 pin, int level) | 1875 | int smscore_set_gpio(struct smscore_device_t *coredev, u32 pin, int level) |
1876 | { | 1876 | { |
1877 | struct { | 1877 | struct { |
1878 | struct sms_msg_hdr hdr; | 1878 | struct sms_msg_hdr hdr; |
1879 | u32 data[3]; | 1879 | u32 data[3]; |
1880 | } msg; | 1880 | } msg; |
1881 | 1881 | ||
1882 | if (pin > MAX_GPIO_PIN_NUMBER) | 1882 | if (pin > MAX_GPIO_PIN_NUMBER) |
1883 | return -EINVAL; | 1883 | return -EINVAL; |
1884 | 1884 | ||
1885 | msg.hdr.msg_src_id = DVBT_BDA_CONTROL_MSG_ID; | 1885 | msg.hdr.msg_src_id = DVBT_BDA_CONTROL_MSG_ID; |
1886 | msg.hdr.msg_dst_id = HIF_TASK; | 1886 | msg.hdr.msg_dst_id = HIF_TASK; |
1887 | msg.hdr.msg_flags = 0; | 1887 | msg.hdr.msg_flags = 0; |
1888 | msg.hdr.msg_type = MSG_SMS_GPIO_SET_LEVEL_REQ; | 1888 | msg.hdr.msg_type = MSG_SMS_GPIO_SET_LEVEL_REQ; |
1889 | msg.hdr.msg_length = sizeof(msg); | 1889 | msg.hdr.msg_length = sizeof(msg); |
1890 | 1890 | ||
1891 | msg.data[0] = pin; | 1891 | msg.data[0] = pin; |
1892 | msg.data[1] = level ? 1 : 0; | 1892 | msg.data[1] = level ? 1 : 0; |
1893 | msg.data[2] = 0; | 1893 | msg.data[2] = 0; |
1894 | 1894 | ||
1895 | return coredev->sendrequest_handler(coredev->context, | 1895 | return coredev->sendrequest_handler(coredev->context, |
1896 | &msg, sizeof(msg)); | 1896 | &msg, sizeof(msg)); |
1897 | } | 1897 | } |
1898 | 1898 | ||
1899 | /* new GPIO management implementation */ | 1899 | /* new GPIO management implementation */ |
1900 | static int GetGpioPinParams(u32 pin_num, u32 *pTranslatedpin_num, | 1900 | static int get_gpio_pin_params(u32 pin_num, u32 *p_translatedpin_num, |
1901 | u32 *pGroupNum, u32 *pGroupCfg) { | 1901 | u32 *p_group_num, u32 *p_group_cfg) { |
1902 | 1902 | ||
1903 | *pGroupCfg = 1; | 1903 | *p_group_cfg = 1; |
1904 | 1904 | ||
1905 | if (pin_num <= 1) { | 1905 | if (pin_num <= 1) { |
1906 | *pTranslatedpin_num = 0; | 1906 | *p_translatedpin_num = 0; |
1907 | *pGroupNum = 9; | 1907 | *p_group_num = 9; |
1908 | *pGroupCfg = 2; | 1908 | *p_group_cfg = 2; |
1909 | } else if (pin_num >= 2 && pin_num <= 6) { | 1909 | } else if (pin_num >= 2 && pin_num <= 6) { |
1910 | *pTranslatedpin_num = 2; | 1910 | *p_translatedpin_num = 2; |
1911 | *pGroupNum = 0; | 1911 | *p_group_num = 0; |
1912 | *pGroupCfg = 2; | 1912 | *p_group_cfg = 2; |
1913 | } else if (pin_num >= 7 && pin_num <= 11) { | 1913 | } else if (pin_num >= 7 && pin_num <= 11) { |
1914 | *pTranslatedpin_num = 7; | 1914 | *p_translatedpin_num = 7; |
1915 | *pGroupNum = 1; | 1915 | *p_group_num = 1; |
1916 | } else if (pin_num >= 12 && pin_num <= 15) { | 1916 | } else if (pin_num >= 12 && pin_num <= 15) { |
1917 | *pTranslatedpin_num = 12; | 1917 | *p_translatedpin_num = 12; |
1918 | *pGroupNum = 2; | 1918 | *p_group_num = 2; |
1919 | *pGroupCfg = 3; | 1919 | *p_group_cfg = 3; |
1920 | } else if (pin_num == 16) { | 1920 | } else if (pin_num == 16) { |
1921 | *pTranslatedpin_num = 16; | 1921 | *p_translatedpin_num = 16; |
1922 | *pGroupNum = 23; | 1922 | *p_group_num = 23; |
1923 | } else if (pin_num >= 17 && pin_num <= 24) { | 1923 | } else if (pin_num >= 17 && pin_num <= 24) { |
1924 | *pTranslatedpin_num = 17; | 1924 | *p_translatedpin_num = 17; |
1925 | *pGroupNum = 3; | 1925 | *p_group_num = 3; |
1926 | } else if (pin_num == 25) { | 1926 | } else if (pin_num == 25) { |
1927 | *pTranslatedpin_num = 25; | 1927 | *p_translatedpin_num = 25; |
1928 | *pGroupNum = 6; | 1928 | *p_group_num = 6; |
1929 | } else if (pin_num >= 26 && pin_num <= 28) { | 1929 | } else if (pin_num >= 26 && pin_num <= 28) { |
1930 | *pTranslatedpin_num = 26; | 1930 | *p_translatedpin_num = 26; |
1931 | *pGroupNum = 4; | 1931 | *p_group_num = 4; |
1932 | } else if (pin_num == 29) { | 1932 | } else if (pin_num == 29) { |
1933 | *pTranslatedpin_num = 29; | 1933 | *p_translatedpin_num = 29; |
1934 | *pGroupNum = 5; | 1934 | *p_group_num = 5; |
1935 | *pGroupCfg = 2; | 1935 | *p_group_cfg = 2; |
1936 | } else if (pin_num == 30) { | 1936 | } else if (pin_num == 30) { |
1937 | *pTranslatedpin_num = 30; | 1937 | *p_translatedpin_num = 30; |
1938 | *pGroupNum = 8; | 1938 | *p_group_num = 8; |
1939 | } else if (pin_num == 31) { | 1939 | } else if (pin_num == 31) { |
1940 | *pTranslatedpin_num = 31; | 1940 | *p_translatedpin_num = 31; |
1941 | *pGroupNum = 17; | 1941 | *p_group_num = 17; |
1942 | } else | 1942 | } else |
1943 | return -1; | 1943 | return -1; |
1944 | 1944 | ||
1945 | *pGroupCfg <<= 24; | 1945 | *p_group_cfg <<= 24; |
1946 | 1946 | ||
1947 | return 0; | 1947 | return 0; |
1948 | } | 1948 | } |
1949 | 1949 | ||
1950 | int smscore_gpio_configure(struct smscore_device_t *coredev, u8 pin_num, | 1950 | int smscore_gpio_configure(struct smscore_device_t *coredev, u8 pin_num, |
1951 | struct smscore_config_gpio *p_gpio_config) { | 1951 | struct smscore_config_gpio *p_gpio_config) { |
1952 | 1952 | ||
1953 | u32 totalLen; | 1953 | u32 total_len; |
1954 | u32 Translatedpin_num = 0; | 1954 | u32 translatedpin_num = 0; |
1955 | u32 GroupNum = 0; | 1955 | u32 group_num = 0; |
1956 | u32 ElectricChar; | 1956 | u32 electric_char; |
1957 | u32 groupCfg; | 1957 | u32 group_cfg; |
1958 | void *buffer; | 1958 | void *buffer; |
1959 | int rc; | 1959 | int rc; |
1960 | 1960 | ||
1961 | struct SetGpioMsg { | 1961 | struct set_gpio_msg { |
1962 | struct sms_msg_hdr x_msg_header; | 1962 | struct sms_msg_hdr x_msg_header; |
1963 | u32 msgData[6]; | 1963 | u32 msg_data[6]; |
1964 | } *pMsg; | 1964 | } *p_msg; |
1965 | 1965 | ||
1966 | 1966 | ||
1967 | if (pin_num > MAX_GPIO_PIN_NUMBER) | 1967 | if (pin_num > MAX_GPIO_PIN_NUMBER) |
1968 | return -EINVAL; | 1968 | return -EINVAL; |
1969 | 1969 | ||
1970 | if (p_gpio_config == NULL) | 1970 | if (p_gpio_config == NULL) |
1971 | return -EINVAL; | 1971 | return -EINVAL; |
1972 | 1972 | ||
1973 | totalLen = sizeof(struct sms_msg_hdr) + (sizeof(u32) * 6); | 1973 | total_len = sizeof(struct sms_msg_hdr) + (sizeof(u32) * 6); |
1974 | 1974 | ||
1975 | buffer = kmalloc(totalLen + SMS_DMA_ALIGNMENT, | 1975 | buffer = kmalloc(total_len + SMS_DMA_ALIGNMENT, |
1976 | GFP_KERNEL | GFP_DMA); | 1976 | GFP_KERNEL | GFP_DMA); |
1977 | if (!buffer) | 1977 | if (!buffer) |
1978 | return -ENOMEM; | 1978 | return -ENOMEM; |
1979 | 1979 | ||
1980 | pMsg = (struct SetGpioMsg *) SMS_ALIGN_ADDRESS(buffer); | 1980 | p_msg = (struct set_gpio_msg *) SMS_ALIGN_ADDRESS(buffer); |
1981 | 1981 | ||
1982 | pMsg->x_msg_header.msg_src_id = DVBT_BDA_CONTROL_MSG_ID; | 1982 | p_msg->x_msg_header.msg_src_id = DVBT_BDA_CONTROL_MSG_ID; |
1983 | pMsg->x_msg_header.msg_dst_id = HIF_TASK; | 1983 | p_msg->x_msg_header.msg_dst_id = HIF_TASK; |
1984 | pMsg->x_msg_header.msg_flags = 0; | 1984 | p_msg->x_msg_header.msg_flags = 0; |
1985 | pMsg->x_msg_header.msg_length = (u16) totalLen; | 1985 | p_msg->x_msg_header.msg_length = (u16) total_len; |
1986 | pMsg->msgData[0] = pin_num; | 1986 | p_msg->msg_data[0] = pin_num; |
1987 | 1987 | ||
1988 | if (!(coredev->device_flags & SMS_DEVICE_FAMILY2)) { | 1988 | if (!(coredev->device_flags & SMS_DEVICE_FAMILY2)) { |
1989 | pMsg->x_msg_header.msg_type = MSG_SMS_GPIO_CONFIG_REQ; | 1989 | p_msg->x_msg_header.msg_type = MSG_SMS_GPIO_CONFIG_REQ; |
1990 | if (GetGpioPinParams(pin_num, &Translatedpin_num, &GroupNum, | 1990 | if (get_gpio_pin_params(pin_num, &translatedpin_num, &group_num, |
1991 | &groupCfg) != 0) { | 1991 | &group_cfg) != 0) { |
1992 | rc = -EINVAL; | 1992 | rc = -EINVAL; |
1993 | goto free; | 1993 | goto free; |
1994 | } | 1994 | } |
1995 | 1995 | ||
1996 | pMsg->msgData[1] = Translatedpin_num; | 1996 | p_msg->msg_data[1] = translatedpin_num; |
1997 | pMsg->msgData[2] = GroupNum; | 1997 | p_msg->msg_data[2] = group_num; |
1998 | ElectricChar = (p_gpio_config->pullupdown) | 1998 | electric_char = (p_gpio_config->pullupdown) |
1999 | | (p_gpio_config->inputcharacteristics << 2) | 1999 | | (p_gpio_config->inputcharacteristics << 2) |
2000 | | (p_gpio_config->outputslewrate << 3) | 2000 | | (p_gpio_config->outputslewrate << 3) |
2001 | | (p_gpio_config->outputdriving << 4); | 2001 | | (p_gpio_config->outputdriving << 4); |
2002 | pMsg->msgData[3] = ElectricChar; | 2002 | p_msg->msg_data[3] = electric_char; |
2003 | pMsg->msgData[4] = p_gpio_config->direction; | 2003 | p_msg->msg_data[4] = p_gpio_config->direction; |
2004 | pMsg->msgData[5] = groupCfg; | 2004 | p_msg->msg_data[5] = group_cfg; |
2005 | } else { | 2005 | } else { |
2006 | pMsg->x_msg_header.msg_type = MSG_SMS_GPIO_CONFIG_EX_REQ; | 2006 | p_msg->x_msg_header.msg_type = MSG_SMS_GPIO_CONFIG_EX_REQ; |
2007 | pMsg->msgData[1] = p_gpio_config->pullupdown; | 2007 | p_msg->msg_data[1] = p_gpio_config->pullupdown; |
2008 | pMsg->msgData[2] = p_gpio_config->outputslewrate; | 2008 | p_msg->msg_data[2] = p_gpio_config->outputslewrate; |
2009 | pMsg->msgData[3] = p_gpio_config->outputdriving; | 2009 | p_msg->msg_data[3] = p_gpio_config->outputdriving; |
2010 | pMsg->msgData[4] = p_gpio_config->direction; | 2010 | p_msg->msg_data[4] = p_gpio_config->direction; |
2011 | pMsg->msgData[5] = 0; | 2011 | p_msg->msg_data[5] = 0; |
2012 | } | 2012 | } |
2013 | 2013 | ||
2014 | rc = smscore_sendrequest_and_wait(coredev, pMsg, totalLen, | 2014 | rc = smscore_sendrequest_and_wait(coredev, p_msg, total_len, |
2015 | &coredev->gpio_configuration_done); | 2015 | &coredev->gpio_configuration_done); |
2016 | 2016 | ||
2017 | if (rc != 0) { | 2017 | if (rc != 0) { |
2018 | if (rc == -ETIME) | 2018 | if (rc == -ETIME) |
2019 | sms_err("smscore_gpio_configure timeout"); | 2019 | sms_err("smscore_gpio_configure timeout"); |
2020 | else | 2020 | else |
2021 | sms_err("smscore_gpio_configure error"); | 2021 | sms_err("smscore_gpio_configure error"); |
2022 | } | 2022 | } |
2023 | free: | 2023 | free: |
2024 | kfree(buffer); | 2024 | kfree(buffer); |
2025 | 2025 | ||
2026 | return rc; | 2026 | return rc; |
2027 | } | 2027 | } |
2028 | 2028 | ||
2029 | int smscore_gpio_set_level(struct smscore_device_t *coredev, u8 pin_num, | 2029 | int smscore_gpio_set_level(struct smscore_device_t *coredev, u8 pin_num, |
2030 | u8 new_level) { | 2030 | u8 new_level) { |
2031 | 2031 | ||
2032 | u32 totalLen; | 2032 | u32 total_len; |
2033 | int rc; | 2033 | int rc; |
2034 | void *buffer; | 2034 | void *buffer; |
2035 | 2035 | ||
2036 | struct SetGpioMsg { | 2036 | struct set_gpio_msg { |
2037 | struct sms_msg_hdr x_msg_header; | 2037 | struct sms_msg_hdr x_msg_header; |
2038 | u32 msgData[3]; /* keep it 3 ! */ | 2038 | u32 msg_data[3]; /* keep it 3 ! */ |
2039 | } *pMsg; | 2039 | } *p_msg; |
2040 | 2040 | ||
2041 | if ((new_level > 1) || (pin_num > MAX_GPIO_PIN_NUMBER)) | 2041 | if ((new_level > 1) || (pin_num > MAX_GPIO_PIN_NUMBER)) |
2042 | return -EINVAL; | 2042 | return -EINVAL; |
2043 | 2043 | ||
2044 | totalLen = sizeof(struct sms_msg_hdr) + | 2044 | total_len = sizeof(struct sms_msg_hdr) + |
2045 | (3 * sizeof(u32)); /* keep it 3 ! */ | 2045 | (3 * sizeof(u32)); /* keep it 3 ! */ |
2046 | 2046 | ||
2047 | buffer = kmalloc(totalLen + SMS_DMA_ALIGNMENT, | 2047 | buffer = kmalloc(total_len + SMS_DMA_ALIGNMENT, |
2048 | GFP_KERNEL | GFP_DMA); | 2048 | GFP_KERNEL | GFP_DMA); |
2049 | if (!buffer) | 2049 | if (!buffer) |
2050 | return -ENOMEM; | 2050 | return -ENOMEM; |
2051 | 2051 | ||
2052 | pMsg = (struct SetGpioMsg *) SMS_ALIGN_ADDRESS(buffer); | 2052 | p_msg = (struct set_gpio_msg *) SMS_ALIGN_ADDRESS(buffer); |
2053 | 2053 | ||
2054 | pMsg->x_msg_header.msg_src_id = DVBT_BDA_CONTROL_MSG_ID; | 2054 | p_msg->x_msg_header.msg_src_id = DVBT_BDA_CONTROL_MSG_ID; |
2055 | pMsg->x_msg_header.msg_dst_id = HIF_TASK; | 2055 | p_msg->x_msg_header.msg_dst_id = HIF_TASK; |
2056 | pMsg->x_msg_header.msg_flags = 0; | 2056 | p_msg->x_msg_header.msg_flags = 0; |
2057 | pMsg->x_msg_header.msg_type = MSG_SMS_GPIO_SET_LEVEL_REQ; | 2057 | p_msg->x_msg_header.msg_type = MSG_SMS_GPIO_SET_LEVEL_REQ; |
2058 | pMsg->x_msg_header.msg_length = (u16) totalLen; | 2058 | p_msg->x_msg_header.msg_length = (u16) total_len; |
2059 | pMsg->msgData[0] = pin_num; | 2059 | p_msg->msg_data[0] = pin_num; |
2060 | pMsg->msgData[1] = new_level; | 2060 | p_msg->msg_data[1] = new_level; |
2061 | 2061 | ||
2062 | /* Send message to SMS */ | 2062 | /* Send message to SMS */ |
2063 | rc = smscore_sendrequest_and_wait(coredev, pMsg, totalLen, | 2063 | rc = smscore_sendrequest_and_wait(coredev, p_msg, total_len, |
2064 | &coredev->gpio_set_level_done); | 2064 | &coredev->gpio_set_level_done); |
2065 | 2065 | ||
2066 | if (rc != 0) { | 2066 | if (rc != 0) { |
2067 | if (rc == -ETIME) | 2067 | if (rc == -ETIME) |
2068 | sms_err("smscore_gpio_set_level timeout"); | 2068 | sms_err("smscore_gpio_set_level timeout"); |
2069 | else | 2069 | else |
2070 | sms_err("smscore_gpio_set_level error"); | 2070 | sms_err("smscore_gpio_set_level error"); |
2071 | } | 2071 | } |
2072 | kfree(buffer); | 2072 | kfree(buffer); |
2073 | 2073 | ||
2074 | return rc; | 2074 | return rc; |
2075 | } | 2075 | } |
2076 | 2076 | ||
2077 | int smscore_gpio_get_level(struct smscore_device_t *coredev, u8 pin_num, | 2077 | int smscore_gpio_get_level(struct smscore_device_t *coredev, u8 pin_num, |
2078 | u8 *level) { | 2078 | u8 *level) { |
2079 | 2079 | ||
2080 | u32 totalLen; | 2080 | u32 total_len; |
2081 | int rc; | 2081 | int rc; |
2082 | void *buffer; | 2082 | void *buffer; |
2083 | 2083 | ||
2084 | struct SetGpioMsg { | 2084 | struct set_gpio_msg { |
2085 | struct sms_msg_hdr x_msg_header; | 2085 | struct sms_msg_hdr x_msg_header; |
2086 | u32 msgData[2]; | 2086 | u32 msg_data[2]; |
2087 | } *pMsg; | 2087 | } *p_msg; |
2088 | 2088 | ||
2089 | 2089 | ||
2090 | if (pin_num > MAX_GPIO_PIN_NUMBER) | 2090 | if (pin_num > MAX_GPIO_PIN_NUMBER) |
2091 | return -EINVAL; | 2091 | return -EINVAL; |
2092 | 2092 | ||
2093 | totalLen = sizeof(struct sms_msg_hdr) + (2 * sizeof(u32)); | 2093 | total_len = sizeof(struct sms_msg_hdr) + (2 * sizeof(u32)); |
2094 | 2094 | ||
2095 | buffer = kmalloc(totalLen + SMS_DMA_ALIGNMENT, | 2095 | buffer = kmalloc(total_len + SMS_DMA_ALIGNMENT, |
2096 | GFP_KERNEL | GFP_DMA); | 2096 | GFP_KERNEL | GFP_DMA); |
2097 | if (!buffer) | 2097 | if (!buffer) |
2098 | return -ENOMEM; | 2098 | return -ENOMEM; |
2099 | 2099 | ||
2100 | pMsg = (struct SetGpioMsg *) SMS_ALIGN_ADDRESS(buffer); | 2100 | p_msg = (struct set_gpio_msg *) SMS_ALIGN_ADDRESS(buffer); |
2101 | 2101 | ||
2102 | pMsg->x_msg_header.msg_src_id = DVBT_BDA_CONTROL_MSG_ID; | 2102 | p_msg->x_msg_header.msg_src_id = DVBT_BDA_CONTROL_MSG_ID; |
2103 | pMsg->x_msg_header.msg_dst_id = HIF_TASK; | 2103 | p_msg->x_msg_header.msg_dst_id = HIF_TASK; |
2104 | pMsg->x_msg_header.msg_flags = 0; | 2104 | p_msg->x_msg_header.msg_flags = 0; |
2105 | pMsg->x_msg_header.msg_type = MSG_SMS_GPIO_GET_LEVEL_REQ; | 2105 | p_msg->x_msg_header.msg_type = MSG_SMS_GPIO_GET_LEVEL_REQ; |
2106 | pMsg->x_msg_header.msg_length = (u16) totalLen; | 2106 | p_msg->x_msg_header.msg_length = (u16) total_len; |
2107 | pMsg->msgData[0] = pin_num; | 2107 | p_msg->msg_data[0] = pin_num; |
2108 | pMsg->msgData[1] = 0; | 2108 | p_msg->msg_data[1] = 0; |
2109 | 2109 | ||
2110 | /* Send message to SMS */ | 2110 | /* Send message to SMS */ |
2111 | rc = smscore_sendrequest_and_wait(coredev, pMsg, totalLen, | 2111 | rc = smscore_sendrequest_and_wait(coredev, p_msg, total_len, |
2112 | &coredev->gpio_get_level_done); | 2112 | &coredev->gpio_get_level_done); |
2113 | 2113 | ||
2114 | if (rc != 0) { | 2114 | if (rc != 0) { |
2115 | if (rc == -ETIME) | 2115 | if (rc == -ETIME) |
2116 | sms_err("smscore_gpio_get_level timeout"); | 2116 | sms_err("smscore_gpio_get_level timeout"); |
2117 | else | 2117 | else |
2118 | sms_err("smscore_gpio_get_level error"); | 2118 | sms_err("smscore_gpio_get_level error"); |
2119 | } | 2119 | } |
2120 | kfree(buffer); | 2120 | kfree(buffer); |
2121 | 2121 | ||
2122 | /* Its a race between other gpio_get_level() and the copy of the single | 2122 | /* Its a race between other gpio_get_level() and the copy of the single |
2123 | * global 'coredev->gpio_get_res' to the function's variable 'level' | 2123 | * global 'coredev->gpio_get_res' to the function's variable 'level' |
2124 | */ | 2124 | */ |
2125 | *level = coredev->gpio_get_res; | 2125 | *level = coredev->gpio_get_res; |
2126 | 2126 | ||
2127 | return rc; | 2127 | return rc; |
2128 | } | 2128 | } |
2129 | 2129 | ||
2130 | static int __init smscore_module_init(void) | 2130 | static int __init smscore_module_init(void) |
2131 | { | 2131 | { |
2132 | int rc = 0; | 2132 | int rc = 0; |
2133 | 2133 | ||
2134 | INIT_LIST_HEAD(&g_smscore_notifyees); | 2134 | INIT_LIST_HEAD(&g_smscore_notifyees); |
2135 | INIT_LIST_HEAD(&g_smscore_devices); | 2135 | INIT_LIST_HEAD(&g_smscore_devices); |
2136 | kmutex_init(&g_smscore_deviceslock); | 2136 | kmutex_init(&g_smscore_deviceslock); |
2137 | 2137 | ||
2138 | INIT_LIST_HEAD(&g_smscore_registry); | 2138 | INIT_LIST_HEAD(&g_smscore_registry); |
2139 | kmutex_init(&g_smscore_registrylock); | 2139 | kmutex_init(&g_smscore_registrylock); |
2140 | 2140 | ||
2141 | return rc; | 2141 | return rc; |
2142 | } | 2142 | } |
2143 | 2143 | ||
2144 | static void __exit smscore_module_exit(void) | 2144 | static void __exit smscore_module_exit(void) |
2145 | { | 2145 | { |
2146 | kmutex_lock(&g_smscore_deviceslock); | 2146 | kmutex_lock(&g_smscore_deviceslock); |
2147 | while (!list_empty(&g_smscore_notifyees)) { | 2147 | while (!list_empty(&g_smscore_notifyees)) { |
2148 | struct smscore_device_notifyee_t *notifyee = | 2148 | struct smscore_device_notifyee_t *notifyee = |
2149 | (struct smscore_device_notifyee_t *) | 2149 | (struct smscore_device_notifyee_t *) |
2150 | g_smscore_notifyees.next; | 2150 | g_smscore_notifyees.next; |
2151 | 2151 | ||
2152 | list_del(¬ifyee->entry); | 2152 | list_del(¬ifyee->entry); |
2153 | kfree(notifyee); | 2153 | kfree(notifyee); |
2154 | } | 2154 | } |
2155 | kmutex_unlock(&g_smscore_deviceslock); | 2155 | kmutex_unlock(&g_smscore_deviceslock); |
2156 | 2156 | ||
2157 | kmutex_lock(&g_smscore_registrylock); | 2157 | kmutex_lock(&g_smscore_registrylock); |
2158 | while (!list_empty(&g_smscore_registry)) { | 2158 | while (!list_empty(&g_smscore_registry)) { |
2159 | struct smscore_registry_entry_t *entry = | 2159 | struct smscore_registry_entry_t *entry = |
2160 | (struct smscore_registry_entry_t *) | 2160 | (struct smscore_registry_entry_t *) |
2161 | g_smscore_registry.next; | 2161 | g_smscore_registry.next; |
2162 | 2162 | ||
2163 | list_del(&entry->entry); | 2163 | list_del(&entry->entry); |
2164 | kfree(entry); | 2164 | kfree(entry); |
2165 | } | 2165 | } |
2166 | kmutex_unlock(&g_smscore_registrylock); | 2166 | kmutex_unlock(&g_smscore_registrylock); |
2167 | 2167 | ||
2168 | sms_debug(""); | 2168 | sms_debug(""); |
2169 | } | 2169 | } |
2170 | 2170 | ||
2171 | module_init(smscore_module_init); | 2171 | module_init(smscore_module_init); |
2172 | module_exit(smscore_module_exit); | 2172 | module_exit(smscore_module_exit); |
2173 | 2173 | ||
2174 | MODULE_DESCRIPTION("Siano MDTV Core module"); | 2174 | MODULE_DESCRIPTION("Siano MDTV Core module"); |
2175 | MODULE_AUTHOR("Siano Mobile Silicon, Inc. (uris@siano-ms.com)"); | 2175 | MODULE_AUTHOR("Siano Mobile Silicon, Inc. (uris@siano-ms.com)"); |
2176 | MODULE_LICENSE("GPL"); | 2176 | MODULE_LICENSE("GPL"); |
2177 | 2177 | ||
2178 | /* This should match what's defined at smscoreapi.h */ | 2178 | /* This should match what's defined at smscoreapi.h */ |
2179 | MODULE_FIRMWARE(SMS_FW_ATSC_DENVER); | 2179 | MODULE_FIRMWARE(SMS_FW_ATSC_DENVER); |
2180 | MODULE_FIRMWARE(SMS_FW_CMMB_MING_APP); | 2180 | MODULE_FIRMWARE(SMS_FW_CMMB_MING_APP); |
2181 | MODULE_FIRMWARE(SMS_FW_CMMB_VEGA_12MHZ); | 2181 | MODULE_FIRMWARE(SMS_FW_CMMB_VEGA_12MHZ); |
2182 | MODULE_FIRMWARE(SMS_FW_CMMB_VENICE_12MHZ); | 2182 | MODULE_FIRMWARE(SMS_FW_CMMB_VENICE_12MHZ); |
2183 | MODULE_FIRMWARE(SMS_FW_DVBH_RIO); | 2183 | MODULE_FIRMWARE(SMS_FW_DVBH_RIO); |
2184 | MODULE_FIRMWARE(SMS_FW_DVB_NOVA_12MHZ_B0); | 2184 | MODULE_FIRMWARE(SMS_FW_DVB_NOVA_12MHZ_B0); |
2185 | MODULE_FIRMWARE(SMS_FW_DVB_NOVA_12MHZ); | 2185 | MODULE_FIRMWARE(SMS_FW_DVB_NOVA_12MHZ); |
2186 | MODULE_FIRMWARE(SMS_FW_DVB_RIO); | 2186 | MODULE_FIRMWARE(SMS_FW_DVB_RIO); |
2187 | MODULE_FIRMWARE(SMS_FW_FM_RADIO); | 2187 | MODULE_FIRMWARE(SMS_FW_FM_RADIO); |
2188 | MODULE_FIRMWARE(SMS_FW_FM_RADIO_RIO); | 2188 | MODULE_FIRMWARE(SMS_FW_FM_RADIO_RIO); |
2189 | MODULE_FIRMWARE(SMS_FW_DVBT_HCW_55XXX); | 2189 | MODULE_FIRMWARE(SMS_FW_DVBT_HCW_55XXX); |
2190 | MODULE_FIRMWARE(SMS_FW_ISDBT_HCW_55XXX); | 2190 | MODULE_FIRMWARE(SMS_FW_ISDBT_HCW_55XXX); |
2191 | MODULE_FIRMWARE(SMS_FW_ISDBT_NOVA_12MHZ_B0); | 2191 | MODULE_FIRMWARE(SMS_FW_ISDBT_NOVA_12MHZ_B0); |
2192 | MODULE_FIRMWARE(SMS_FW_ISDBT_NOVA_12MHZ); | 2192 | MODULE_FIRMWARE(SMS_FW_ISDBT_NOVA_12MHZ); |
2193 | MODULE_FIRMWARE(SMS_FW_ISDBT_PELE); | 2193 | MODULE_FIRMWARE(SMS_FW_ISDBT_PELE); |
2194 | MODULE_FIRMWARE(SMS_FW_ISDBT_RIO); | 2194 | MODULE_FIRMWARE(SMS_FW_ISDBT_RIO); |
2195 | MODULE_FIRMWARE(SMS_FW_DVBT_NOVA_A); | 2195 | MODULE_FIRMWARE(SMS_FW_DVBT_NOVA_A); |
2196 | MODULE_FIRMWARE(SMS_FW_DVBT_NOVA_B); | 2196 | MODULE_FIRMWARE(SMS_FW_DVBT_NOVA_B); |
2197 | MODULE_FIRMWARE(SMS_FW_DVBT_STELLAR); | 2197 | MODULE_FIRMWARE(SMS_FW_DVBT_STELLAR); |
2198 | MODULE_FIRMWARE(SMS_FW_TDMB_DENVER); | 2198 | MODULE_FIRMWARE(SMS_FW_TDMB_DENVER); |
2199 | MODULE_FIRMWARE(SMS_FW_TDMB_NOVA_12MHZ_B0); | 2199 | MODULE_FIRMWARE(SMS_FW_TDMB_NOVA_12MHZ_B0); |
2200 | MODULE_FIRMWARE(SMS_FW_TDMB_NOVA_12MHZ); | 2200 | MODULE_FIRMWARE(SMS_FW_TDMB_NOVA_12MHZ); |
2201 | 2201 |
drivers/media/common/siano/smscoreapi.h
1 | /**************************************************************** | 1 | /**************************************************************** |
2 | 2 | ||
3 | Siano Mobile Silicon, Inc. | 3 | Siano Mobile Silicon, Inc. |
4 | MDTV receiver kernel modules. | 4 | MDTV receiver kernel modules. |
5 | Copyright (C) 2006-2008, Uri Shkolnik, Anatoly Greenblat | 5 | Copyright (C) 2006-2008, Uri Shkolnik, Anatoly Greenblat |
6 | 6 | ||
7 | This program is free software: you can redistribute it and/or modify | 7 | This program is free software: you can redistribute it and/or modify |
8 | it under the terms of the GNU General Public License as published by | 8 | it under the terms of the GNU General Public License as published by |
9 | the Free Software Foundation, either version 2 of the License, or | 9 | the Free Software Foundation, either version 2 of the License, or |
10 | (at your option) any later version. | 10 | (at your option) any later version. |
11 | 11 | ||
12 | This program is distributed in the hope that it will be useful, | 12 | This program is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | GNU General Public License for more details. | 15 | GNU General Public License for more details. |
16 | 16 | ||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License |
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 | 19 | ||
20 | ****************************************************************/ | 20 | ****************************************************************/ |
21 | 21 | ||
22 | #ifndef __SMS_CORE_API_H__ | 22 | #ifndef __SMS_CORE_API_H__ |
23 | #define __SMS_CORE_API_H__ | 23 | #define __SMS_CORE_API_H__ |
24 | 24 | ||
25 | #include <linux/device.h> | 25 | #include <linux/device.h> |
26 | #include <linux/list.h> | 26 | #include <linux/list.h> |
27 | #include <linux/mm.h> | 27 | #include <linux/mm.h> |
28 | #include <linux/scatterlist.h> | 28 | #include <linux/scatterlist.h> |
29 | #include <linux/types.h> | 29 | #include <linux/types.h> |
30 | #include <linux/mutex.h> | 30 | #include <linux/mutex.h> |
31 | #include <linux/wait.h> | 31 | #include <linux/wait.h> |
32 | #include <linux/timer.h> | 32 | #include <linux/timer.h> |
33 | 33 | ||
34 | #include <asm/page.h> | 34 | #include <asm/page.h> |
35 | 35 | ||
36 | #include "smsir.h" | 36 | #include "smsir.h" |
37 | 37 | ||
38 | #define kmutex_init(_p_) mutex_init(_p_) | 38 | #define kmutex_init(_p_) mutex_init(_p_) |
39 | #define kmutex_lock(_p_) mutex_lock(_p_) | 39 | #define kmutex_lock(_p_) mutex_lock(_p_) |
40 | #define kmutex_trylock(_p_) mutex_trylock(_p_) | 40 | #define kmutex_trylock(_p_) mutex_trylock(_p_) |
41 | #define kmutex_unlock(_p_) mutex_unlock(_p_) | 41 | #define kmutex_unlock(_p_) mutex_unlock(_p_) |
42 | 42 | ||
43 | #ifndef min | 43 | #ifndef min |
44 | #define min(a, b) (((a) < (b)) ? (a) : (b)) | 44 | #define min(a, b) (((a) < (b)) ? (a) : (b)) |
45 | #endif | 45 | #endif |
46 | 46 | ||
47 | /* | 47 | /* |
48 | * Define the firmware names used by the driver. | 48 | * Define the firmware names used by the driver. |
49 | * Those should match what's used at smscoreapi.c and sms-cards.c | 49 | * Those should match what's used at smscoreapi.c and sms-cards.c |
50 | * including the MODULE_FIRMWARE() macros at the end of smscoreapi.c | 50 | * including the MODULE_FIRMWARE() macros at the end of smscoreapi.c |
51 | */ | 51 | */ |
52 | #define SMS_FW_ATSC_DENVER "atsc_denver.inp" | 52 | #define SMS_FW_ATSC_DENVER "atsc_denver.inp" |
53 | #define SMS_FW_CMMB_MING_APP "cmmb_ming_app.inp" | 53 | #define SMS_FW_CMMB_MING_APP "cmmb_ming_app.inp" |
54 | #define SMS_FW_CMMB_VEGA_12MHZ "cmmb_vega_12mhz.inp" | 54 | #define SMS_FW_CMMB_VEGA_12MHZ "cmmb_vega_12mhz.inp" |
55 | #define SMS_FW_CMMB_VENICE_12MHZ "cmmb_venice_12mhz.inp" | 55 | #define SMS_FW_CMMB_VENICE_12MHZ "cmmb_venice_12mhz.inp" |
56 | #define SMS_FW_DVBH_RIO "dvbh_rio.inp" | 56 | #define SMS_FW_DVBH_RIO "dvbh_rio.inp" |
57 | #define SMS_FW_DVB_NOVA_12MHZ_B0 "dvb_nova_12mhz_b0.inp" | 57 | #define SMS_FW_DVB_NOVA_12MHZ_B0 "dvb_nova_12mhz_b0.inp" |
58 | #define SMS_FW_DVB_NOVA_12MHZ "dvb_nova_12mhz.inp" | 58 | #define SMS_FW_DVB_NOVA_12MHZ "dvb_nova_12mhz.inp" |
59 | #define SMS_FW_DVB_RIO "dvb_rio.inp" | 59 | #define SMS_FW_DVB_RIO "dvb_rio.inp" |
60 | #define SMS_FW_FM_RADIO "fm_radio.inp" | 60 | #define SMS_FW_FM_RADIO "fm_radio.inp" |
61 | #define SMS_FW_FM_RADIO_RIO "fm_radio_rio.inp" | 61 | #define SMS_FW_FM_RADIO_RIO "fm_radio_rio.inp" |
62 | #define SMS_FW_DVBT_HCW_55XXX "sms1xxx-hcw-55xxx-dvbt-02.fw" | 62 | #define SMS_FW_DVBT_HCW_55XXX "sms1xxx-hcw-55xxx-dvbt-02.fw" |
63 | #define SMS_FW_ISDBT_HCW_55XXX "sms1xxx-hcw-55xxx-isdbt-02.fw" | 63 | #define SMS_FW_ISDBT_HCW_55XXX "sms1xxx-hcw-55xxx-isdbt-02.fw" |
64 | #define SMS_FW_ISDBT_NOVA_12MHZ_B0 "isdbt_nova_12mhz_b0.inp" | 64 | #define SMS_FW_ISDBT_NOVA_12MHZ_B0 "isdbt_nova_12mhz_b0.inp" |
65 | #define SMS_FW_ISDBT_NOVA_12MHZ "isdbt_nova_12mhz.inp" | 65 | #define SMS_FW_ISDBT_NOVA_12MHZ "isdbt_nova_12mhz.inp" |
66 | #define SMS_FW_ISDBT_PELE "isdbt_pele.inp" | 66 | #define SMS_FW_ISDBT_PELE "isdbt_pele.inp" |
67 | #define SMS_FW_ISDBT_RIO "isdbt_rio.inp" | 67 | #define SMS_FW_ISDBT_RIO "isdbt_rio.inp" |
68 | #define SMS_FW_DVBT_NOVA_A "sms1xxx-nova-a-dvbt-01.fw" | 68 | #define SMS_FW_DVBT_NOVA_A "sms1xxx-nova-a-dvbt-01.fw" |
69 | #define SMS_FW_DVBT_NOVA_B "sms1xxx-nova-b-dvbt-01.fw" | 69 | #define SMS_FW_DVBT_NOVA_B "sms1xxx-nova-b-dvbt-01.fw" |
70 | #define SMS_FW_DVBT_STELLAR "sms1xxx-stellar-dvbt-01.fw" | 70 | #define SMS_FW_DVBT_STELLAR "sms1xxx-stellar-dvbt-01.fw" |
71 | #define SMS_FW_TDMB_DENVER "tdmb_denver.inp" | 71 | #define SMS_FW_TDMB_DENVER "tdmb_denver.inp" |
72 | #define SMS_FW_TDMB_NOVA_12MHZ_B0 "tdmb_nova_12mhz_b0.inp" | 72 | #define SMS_FW_TDMB_NOVA_12MHZ_B0 "tdmb_nova_12mhz_b0.inp" |
73 | #define SMS_FW_TDMB_NOVA_12MHZ "tdmb_nova_12mhz.inp" | 73 | #define SMS_FW_TDMB_NOVA_12MHZ "tdmb_nova_12mhz.inp" |
74 | 74 | ||
75 | #define SMS_PROTOCOL_MAX_RAOUNDTRIP_MS (10000) | 75 | #define SMS_PROTOCOL_MAX_RAOUNDTRIP_MS (10000) |
76 | #define SMS_ALLOC_ALIGNMENT 128 | 76 | #define SMS_ALLOC_ALIGNMENT 128 |
77 | #define SMS_DMA_ALIGNMENT 16 | 77 | #define SMS_DMA_ALIGNMENT 16 |
78 | #define SMS_ALIGN_ADDRESS(addr) \ | 78 | #define SMS_ALIGN_ADDRESS(addr) \ |
79 | ((((uintptr_t)(addr)) + (SMS_DMA_ALIGNMENT-1)) & ~(SMS_DMA_ALIGNMENT-1)) | 79 | ((((uintptr_t)(addr)) + (SMS_DMA_ALIGNMENT-1)) & ~(SMS_DMA_ALIGNMENT-1)) |
80 | 80 | ||
81 | #define SMS_DEVICE_FAMILY1 0 | 81 | #define SMS_DEVICE_FAMILY1 0 |
82 | #define SMS_DEVICE_FAMILY2 1 | 82 | #define SMS_DEVICE_FAMILY2 1 |
83 | #define SMS_ROM_NO_RESPONSE 2 | 83 | #define SMS_ROM_NO_RESPONSE 2 |
84 | #define SMS_DEVICE_NOT_READY 0x8000000 | 84 | #define SMS_DEVICE_NOT_READY 0x8000000 |
85 | 85 | ||
86 | enum sms_device_type_st { | 86 | enum sms_device_type_st { |
87 | SMS_UNKNOWN_TYPE = -1, | 87 | SMS_UNKNOWN_TYPE = -1, |
88 | SMS_STELLAR = 0, | 88 | SMS_STELLAR = 0, |
89 | SMS_NOVA_A0, | 89 | SMS_NOVA_A0, |
90 | SMS_NOVA_B0, | 90 | SMS_NOVA_B0, |
91 | SMS_VEGA, | 91 | SMS_VEGA, |
92 | SMS_VENICE, | 92 | SMS_VENICE, |
93 | SMS_MING, | 93 | SMS_MING, |
94 | SMS_PELE, | 94 | SMS_PELE, |
95 | SMS_RIO, | 95 | SMS_RIO, |
96 | SMS_DENVER_1530, | 96 | SMS_DENVER_1530, |
97 | SMS_DENVER_2160, | 97 | SMS_DENVER_2160, |
98 | SMS_NUM_OF_DEVICE_TYPES | 98 | SMS_NUM_OF_DEVICE_TYPES |
99 | }; | 99 | }; |
100 | 100 | ||
101 | enum sms_power_mode_st { | 101 | enum sms_power_mode_st { |
102 | SMS_POWER_MODE_ACTIVE, | 102 | SMS_POWER_MODE_ACTIVE, |
103 | SMS_POWER_MODE_SUSPENDED | 103 | SMS_POWER_MODE_SUSPENDED |
104 | }; | 104 | }; |
105 | 105 | ||
106 | struct smscore_device_t; | 106 | struct smscore_device_t; |
107 | struct smscore_client_t; | 107 | struct smscore_client_t; |
108 | struct smscore_buffer_t; | 108 | struct smscore_buffer_t; |
109 | 109 | ||
110 | typedef int (*hotplug_t)(struct smscore_device_t *coredev, | 110 | typedef int (*hotplug_t)(struct smscore_device_t *coredev, |
111 | struct device *device, int arrival); | 111 | struct device *device, int arrival); |
112 | 112 | ||
113 | typedef int (*setmode_t)(void *context, int mode); | 113 | typedef int (*setmode_t)(void *context, int mode); |
114 | typedef void (*detectmode_t)(void *context, int *mode); | 114 | typedef void (*detectmode_t)(void *context, int *mode); |
115 | typedef int (*sendrequest_t)(void *context, void *buffer, size_t size); | 115 | typedef int (*sendrequest_t)(void *context, void *buffer, size_t size); |
116 | typedef int (*loadfirmware_t)(void *context, void *buffer, size_t size); | 116 | typedef int (*loadfirmware_t)(void *context, void *buffer, size_t size); |
117 | typedef int (*preload_t)(void *context); | 117 | typedef int (*preload_t)(void *context); |
118 | typedef int (*postload_t)(void *context); | 118 | typedef int (*postload_t)(void *context); |
119 | 119 | ||
120 | typedef int (*onresponse_t)(void *context, struct smscore_buffer_t *cb); | 120 | typedef int (*onresponse_t)(void *context, struct smscore_buffer_t *cb); |
121 | typedef void (*onremove_t)(void *context); | 121 | typedef void (*onremove_t)(void *context); |
122 | 122 | ||
123 | struct smscore_buffer_t { | 123 | struct smscore_buffer_t { |
124 | /* public members, once passed to clients can be changed freely */ | 124 | /* public members, once passed to clients can be changed freely */ |
125 | struct list_head entry; | 125 | struct list_head entry; |
126 | int size; | 126 | int size; |
127 | int offset; | 127 | int offset; |
128 | 128 | ||
129 | /* private members, read-only for clients */ | 129 | /* private members, read-only for clients */ |
130 | void *p; | 130 | void *p; |
131 | dma_addr_t phys; | 131 | dma_addr_t phys; |
132 | unsigned long offset_in_common; | 132 | unsigned long offset_in_common; |
133 | }; | 133 | }; |
134 | 134 | ||
135 | struct smsdevice_params_t { | 135 | struct smsdevice_params_t { |
136 | struct device *device; | 136 | struct device *device; |
137 | 137 | ||
138 | int buffer_size; | 138 | int buffer_size; |
139 | int num_buffers; | 139 | int num_buffers; |
140 | 140 | ||
141 | char devpath[32]; | 141 | char devpath[32]; |
142 | unsigned long flags; | 142 | unsigned long flags; |
143 | 143 | ||
144 | setmode_t setmode_handler; | 144 | setmode_t setmode_handler; |
145 | detectmode_t detectmode_handler; | 145 | detectmode_t detectmode_handler; |
146 | sendrequest_t sendrequest_handler; | 146 | sendrequest_t sendrequest_handler; |
147 | preload_t preload_handler; | 147 | preload_t preload_handler; |
148 | postload_t postload_handler; | 148 | postload_t postload_handler; |
149 | 149 | ||
150 | void *context; | 150 | void *context; |
151 | enum sms_device_type_st device_type; | 151 | enum sms_device_type_st device_type; |
152 | }; | 152 | }; |
153 | 153 | ||
154 | struct smsclient_params_t { | 154 | struct smsclient_params_t { |
155 | int initial_id; | 155 | int initial_id; |
156 | int data_type; | 156 | int data_type; |
157 | onresponse_t onresponse_handler; | 157 | onresponse_t onresponse_handler; |
158 | onremove_t onremove_handler; | 158 | onremove_t onremove_handler; |
159 | void *context; | 159 | void *context; |
160 | }; | 160 | }; |
161 | 161 | ||
162 | struct smscore_device_t { | 162 | struct smscore_device_t { |
163 | struct list_head entry; | 163 | struct list_head entry; |
164 | 164 | ||
165 | struct list_head clients; | 165 | struct list_head clients; |
166 | struct list_head subclients; | 166 | struct list_head subclients; |
167 | spinlock_t clientslock; | 167 | spinlock_t clientslock; |
168 | 168 | ||
169 | struct list_head buffers; | 169 | struct list_head buffers; |
170 | spinlock_t bufferslock; | 170 | spinlock_t bufferslock; |
171 | int num_buffers; | 171 | int num_buffers; |
172 | 172 | ||
173 | void *common_buffer; | 173 | void *common_buffer; |
174 | int common_buffer_size; | 174 | int common_buffer_size; |
175 | dma_addr_t common_buffer_phys; | 175 | dma_addr_t common_buffer_phys; |
176 | 176 | ||
177 | void *context; | 177 | void *context; |
178 | struct device *device; | 178 | struct device *device; |
179 | 179 | ||
180 | char devpath[32]; | 180 | char devpath[32]; |
181 | unsigned long device_flags; | 181 | unsigned long device_flags; |
182 | 182 | ||
183 | setmode_t setmode_handler; | 183 | setmode_t setmode_handler; |
184 | detectmode_t detectmode_handler; | 184 | detectmode_t detectmode_handler; |
185 | sendrequest_t sendrequest_handler; | 185 | sendrequest_t sendrequest_handler; |
186 | preload_t preload_handler; | 186 | preload_t preload_handler; |
187 | postload_t postload_handler; | 187 | postload_t postload_handler; |
188 | 188 | ||
189 | int mode, modes_supported; | 189 | int mode, modes_supported; |
190 | 190 | ||
191 | /* host <--> device messages */ | 191 | /* host <--> device messages */ |
192 | struct completion version_ex_done, data_download_done, trigger_done; | 192 | struct completion version_ex_done, data_download_done, trigger_done; |
193 | struct completion data_validity_done, device_ready_done; | 193 | struct completion data_validity_done, device_ready_done; |
194 | struct completion init_device_done, reload_start_done, resume_done; | 194 | struct completion init_device_done, reload_start_done, resume_done; |
195 | struct completion gpio_configuration_done, gpio_set_level_done; | 195 | struct completion gpio_configuration_done, gpio_set_level_done; |
196 | struct completion gpio_get_level_done, ir_init_done; | 196 | struct completion gpio_get_level_done, ir_init_done; |
197 | 197 | ||
198 | /* Buffer management */ | 198 | /* Buffer management */ |
199 | wait_queue_head_t buffer_mng_waitq; | 199 | wait_queue_head_t buffer_mng_waitq; |
200 | 200 | ||
201 | /* GPIO */ | 201 | /* GPIO */ |
202 | int gpio_get_res; | 202 | int gpio_get_res; |
203 | 203 | ||
204 | /* Target hardware board */ | 204 | /* Target hardware board */ |
205 | int board_id; | 205 | int board_id; |
206 | 206 | ||
207 | /* Firmware */ | 207 | /* Firmware */ |
208 | u8 *fw_buf; | 208 | u8 *fw_buf; |
209 | u32 fw_buf_size; | 209 | u32 fw_buf_size; |
210 | u16 fw_version; | 210 | u16 fw_version; |
211 | 211 | ||
212 | /* Infrared (IR) */ | 212 | /* Infrared (IR) */ |
213 | struct ir_t ir; | 213 | struct ir_t ir; |
214 | 214 | ||
215 | /* | 215 | /* |
216 | * Identify if device is USB or not. | 216 | * Identify if device is USB or not. |
217 | * Used by smsdvb-sysfs to know the root node for debugfs | 217 | * Used by smsdvb-sysfs to know the root node for debugfs |
218 | */ | 218 | */ |
219 | bool is_usb_device; | 219 | bool is_usb_device; |
220 | 220 | ||
221 | int led_state; | 221 | int led_state; |
222 | }; | 222 | }; |
223 | 223 | ||
224 | /* GPIO definitions for antenna frequency domain control (SMS8021) */ | 224 | /* GPIO definitions for antenna frequency domain control (SMS8021) */ |
225 | #define SMS_ANTENNA_GPIO_0 1 | 225 | #define SMS_ANTENNA_GPIO_0 1 |
226 | #define SMS_ANTENNA_GPIO_1 0 | 226 | #define SMS_ANTENNA_GPIO_1 0 |
227 | 227 | ||
228 | enum sms_bandwidth_mode { | 228 | enum sms_bandwidth_mode { |
229 | BW_8_MHZ = 0, | 229 | BW_8_MHZ = 0, |
230 | BW_7_MHZ = 1, | 230 | BW_7_MHZ = 1, |
231 | BW_6_MHZ = 2, | 231 | BW_6_MHZ = 2, |
232 | BW_5_MHZ = 3, | 232 | BW_5_MHZ = 3, |
233 | BW_ISDBT_1SEG = 4, | 233 | BW_ISDBT_1SEG = 4, |
234 | BW_ISDBT_3SEG = 5, | 234 | BW_ISDBT_3SEG = 5, |
235 | BW_2_MHZ = 6, | 235 | BW_2_MHZ = 6, |
236 | BW_FM_RADIO = 7, | 236 | BW_FM_RADIO = 7, |
237 | BW_ISDBT_13SEG = 8, | 237 | BW_ISDBT_13SEG = 8, |
238 | BW_1_5_MHZ = 15, | 238 | BW_1_5_MHZ = 15, |
239 | BW_UNKNOWN = 0xffff | 239 | BW_UNKNOWN = 0xffff |
240 | }; | 240 | }; |
241 | 241 | ||
242 | 242 | ||
243 | #define MSG_HDR_FLAG_SPLIT_MSG 4 | 243 | #define MSG_HDR_FLAG_SPLIT_MSG 4 |
244 | 244 | ||
245 | #define MAX_GPIO_PIN_NUMBER 31 | 245 | #define MAX_GPIO_PIN_NUMBER 31 |
246 | 246 | ||
247 | #define HIF_TASK 11 | 247 | #define HIF_TASK 11 |
248 | #define HIF_TASK_SLAVE 22 | 248 | #define HIF_TASK_SLAVE 22 |
249 | #define HIF_TASK_SLAVE2 33 | 249 | #define HIF_TASK_SLAVE2 33 |
250 | #define HIF_TASK_SLAVE3 44 | 250 | #define HIF_TASK_SLAVE3 44 |
251 | #define SMS_HOST_LIB 150 | 251 | #define SMS_HOST_LIB 150 |
252 | #define DVBT_BDA_CONTROL_MSG_ID 201 | 252 | #define DVBT_BDA_CONTROL_MSG_ID 201 |
253 | 253 | ||
254 | #define SMS_MAX_PAYLOAD_SIZE 240 | 254 | #define SMS_MAX_PAYLOAD_SIZE 240 |
255 | #define SMS_TUNE_TIMEOUT 500 | 255 | #define SMS_TUNE_TIMEOUT 500 |
256 | 256 | ||
257 | enum msg_types { | 257 | enum msg_types { |
258 | MSG_TYPE_BASE_VAL = 500, | 258 | MSG_TYPE_BASE_VAL = 500, |
259 | MSG_SMS_GET_VERSION_REQ = 503, | 259 | MSG_SMS_GET_VERSION_REQ = 503, |
260 | MSG_SMS_GET_VERSION_RES = 504, | 260 | MSG_SMS_GET_VERSION_RES = 504, |
261 | MSG_SMS_MULTI_BRIDGE_CFG = 505, | 261 | MSG_SMS_MULTI_BRIDGE_CFG = 505, |
262 | MSG_SMS_GPIO_CONFIG_REQ = 507, | 262 | MSG_SMS_GPIO_CONFIG_REQ = 507, |
263 | MSG_SMS_GPIO_CONFIG_RES = 508, | 263 | MSG_SMS_GPIO_CONFIG_RES = 508, |
264 | MSG_SMS_GPIO_SET_LEVEL_REQ = 509, | 264 | MSG_SMS_GPIO_SET_LEVEL_REQ = 509, |
265 | MSG_SMS_GPIO_SET_LEVEL_RES = 510, | 265 | MSG_SMS_GPIO_SET_LEVEL_RES = 510, |
266 | MSG_SMS_GPIO_GET_LEVEL_REQ = 511, | 266 | MSG_SMS_GPIO_GET_LEVEL_REQ = 511, |
267 | MSG_SMS_GPIO_GET_LEVEL_RES = 512, | 267 | MSG_SMS_GPIO_GET_LEVEL_RES = 512, |
268 | MSG_SMS_EEPROM_BURN_IND = 513, | 268 | MSG_SMS_EEPROM_BURN_IND = 513, |
269 | MSG_SMS_LOG_ENABLE_CHANGE_REQ = 514, | 269 | MSG_SMS_LOG_ENABLE_CHANGE_REQ = 514, |
270 | MSG_SMS_LOG_ENABLE_CHANGE_RES = 515, | 270 | MSG_SMS_LOG_ENABLE_CHANGE_RES = 515, |
271 | MSG_SMS_SET_MAX_TX_MSG_LEN_REQ = 516, | 271 | MSG_SMS_SET_MAX_TX_MSG_LEN_REQ = 516, |
272 | MSG_SMS_SET_MAX_TX_MSG_LEN_RES = 517, | 272 | MSG_SMS_SET_MAX_TX_MSG_LEN_RES = 517, |
273 | MSG_SMS_SPI_HALFDUPLEX_TOKEN_HOST_TO_DEVICE = 518, | 273 | MSG_SMS_SPI_HALFDUPLEX_TOKEN_HOST_TO_DEVICE = 518, |
274 | MSG_SMS_SPI_HALFDUPLEX_TOKEN_DEVICE_TO_HOST = 519, | 274 | MSG_SMS_SPI_HALFDUPLEX_TOKEN_DEVICE_TO_HOST = 519, |
275 | MSG_SMS_BACKGROUND_SCAN_FLAG_CHANGE_REQ = 520, | 275 | MSG_SMS_BACKGROUND_SCAN_FLAG_CHANGE_REQ = 520, |
276 | MSG_SMS_BACKGROUND_SCAN_FLAG_CHANGE_RES = 521, | 276 | MSG_SMS_BACKGROUND_SCAN_FLAG_CHANGE_RES = 521, |
277 | MSG_SMS_BACKGROUND_SCAN_SIGNAL_DETECTED_IND = 522, | 277 | MSG_SMS_BACKGROUND_SCAN_SIGNAL_DETECTED_IND = 522, |
278 | MSG_SMS_BACKGROUND_SCAN_NO_SIGNAL_IND = 523, | 278 | MSG_SMS_BACKGROUND_SCAN_NO_SIGNAL_IND = 523, |
279 | MSG_SMS_CONFIGURE_RF_SWITCH_REQ = 524, | 279 | MSG_SMS_CONFIGURE_RF_SWITCH_REQ = 524, |
280 | MSG_SMS_CONFIGURE_RF_SWITCH_RES = 525, | 280 | MSG_SMS_CONFIGURE_RF_SWITCH_RES = 525, |
281 | MSG_SMS_MRC_PATH_DISCONNECT_REQ = 526, | 281 | MSG_SMS_MRC_PATH_DISCONNECT_REQ = 526, |
282 | MSG_SMS_MRC_PATH_DISCONNECT_RES = 527, | 282 | MSG_SMS_MRC_PATH_DISCONNECT_RES = 527, |
283 | MSG_SMS_RECEIVE_1SEG_THROUGH_FULLSEG_REQ = 528, | 283 | MSG_SMS_RECEIVE_1SEG_THROUGH_FULLSEG_REQ = 528, |
284 | MSG_SMS_RECEIVE_1SEG_THROUGH_FULLSEG_RES = 529, | 284 | MSG_SMS_RECEIVE_1SEG_THROUGH_FULLSEG_RES = 529, |
285 | MSG_SMS_RECEIVE_VHF_VIA_VHF_INPUT_REQ = 530, | 285 | MSG_SMS_RECEIVE_VHF_VIA_VHF_INPUT_REQ = 530, |
286 | MSG_SMS_RECEIVE_VHF_VIA_VHF_INPUT_RES = 531, | 286 | MSG_SMS_RECEIVE_VHF_VIA_VHF_INPUT_RES = 531, |
287 | MSG_WR_REG_RFT_REQ = 533, | 287 | MSG_WR_REG_RFT_REQ = 533, |
288 | MSG_WR_REG_RFT_RES = 534, | 288 | MSG_WR_REG_RFT_RES = 534, |
289 | MSG_RD_REG_RFT_REQ = 535, | 289 | MSG_RD_REG_RFT_REQ = 535, |
290 | MSG_RD_REG_RFT_RES = 536, | 290 | MSG_RD_REG_RFT_RES = 536, |
291 | MSG_RD_REG_ALL_RFT_REQ = 537, | 291 | MSG_RD_REG_ALL_RFT_REQ = 537, |
292 | MSG_RD_REG_ALL_RFT_RES = 538, | 292 | MSG_RD_REG_ALL_RFT_RES = 538, |
293 | MSG_HELP_INT = 539, | 293 | MSG_HELP_INT = 539, |
294 | MSG_RUN_SCRIPT_INT = 540, | 294 | MSG_RUN_SCRIPT_INT = 540, |
295 | MSG_SMS_EWS_INBAND_REQ = 541, | 295 | MSG_SMS_EWS_INBAND_REQ = 541, |
296 | MSG_SMS_EWS_INBAND_RES = 542, | 296 | MSG_SMS_EWS_INBAND_RES = 542, |
297 | MSG_SMS_RFS_SELECT_REQ = 543, | 297 | MSG_SMS_RFS_SELECT_REQ = 543, |
298 | MSG_SMS_RFS_SELECT_RES = 544, | 298 | MSG_SMS_RFS_SELECT_RES = 544, |
299 | MSG_SMS_MB_GET_VER_REQ = 545, | 299 | MSG_SMS_MB_GET_VER_REQ = 545, |
300 | MSG_SMS_MB_GET_VER_RES = 546, | 300 | MSG_SMS_MB_GET_VER_RES = 546, |
301 | MSG_SMS_MB_WRITE_CFGFILE_REQ = 547, | 301 | MSG_SMS_MB_WRITE_CFGFILE_REQ = 547, |
302 | MSG_SMS_MB_WRITE_CFGFILE_RES = 548, | 302 | MSG_SMS_MB_WRITE_CFGFILE_RES = 548, |
303 | MSG_SMS_MB_READ_CFGFILE_REQ = 549, | 303 | MSG_SMS_MB_READ_CFGFILE_REQ = 549, |
304 | MSG_SMS_MB_READ_CFGFILE_RES = 550, | 304 | MSG_SMS_MB_READ_CFGFILE_RES = 550, |
305 | MSG_SMS_RD_MEM_REQ = 552, | 305 | MSG_SMS_RD_MEM_REQ = 552, |
306 | MSG_SMS_RD_MEM_RES = 553, | 306 | MSG_SMS_RD_MEM_RES = 553, |
307 | MSG_SMS_WR_MEM_REQ = 554, | 307 | MSG_SMS_WR_MEM_REQ = 554, |
308 | MSG_SMS_WR_MEM_RES = 555, | 308 | MSG_SMS_WR_MEM_RES = 555, |
309 | MSG_SMS_UPDATE_MEM_REQ = 556, | 309 | MSG_SMS_UPDATE_MEM_REQ = 556, |
310 | MSG_SMS_UPDATE_MEM_RES = 557, | 310 | MSG_SMS_UPDATE_MEM_RES = 557, |
311 | MSG_SMS_ISDBT_ENABLE_FULL_PARAMS_SET_REQ = 558, | 311 | MSG_SMS_ISDBT_ENABLE_FULL_PARAMS_SET_REQ = 558, |
312 | MSG_SMS_ISDBT_ENABLE_FULL_PARAMS_SET_RES = 559, | 312 | MSG_SMS_ISDBT_ENABLE_FULL_PARAMS_SET_RES = 559, |
313 | MSG_SMS_RF_TUNE_REQ = 561, | 313 | MSG_SMS_RF_TUNE_REQ = 561, |
314 | MSG_SMS_RF_TUNE_RES = 562, | 314 | MSG_SMS_RF_TUNE_RES = 562, |
315 | MSG_SMS_ISDBT_ENABLE_HIGH_MOBILITY_REQ = 563, | 315 | MSG_SMS_ISDBT_ENABLE_HIGH_MOBILITY_REQ = 563, |
316 | MSG_SMS_ISDBT_ENABLE_HIGH_MOBILITY_RES = 564, | 316 | MSG_SMS_ISDBT_ENABLE_HIGH_MOBILITY_RES = 564, |
317 | MSG_SMS_ISDBT_SB_RECEPTION_REQ = 565, | 317 | MSG_SMS_ISDBT_SB_RECEPTION_REQ = 565, |
318 | MSG_SMS_ISDBT_SB_RECEPTION_RES = 566, | 318 | MSG_SMS_ISDBT_SB_RECEPTION_RES = 566, |
319 | MSG_SMS_GENERIC_EPROM_WRITE_REQ = 567, | 319 | MSG_SMS_GENERIC_EPROM_WRITE_REQ = 567, |
320 | MSG_SMS_GENERIC_EPROM_WRITE_RES = 568, | 320 | MSG_SMS_GENERIC_EPROM_WRITE_RES = 568, |
321 | MSG_SMS_GENERIC_EPROM_READ_REQ = 569, | 321 | MSG_SMS_GENERIC_EPROM_READ_REQ = 569, |
322 | MSG_SMS_GENERIC_EPROM_READ_RES = 570, | 322 | MSG_SMS_GENERIC_EPROM_READ_RES = 570, |
323 | MSG_SMS_EEPROM_WRITE_REQ = 571, | 323 | MSG_SMS_EEPROM_WRITE_REQ = 571, |
324 | MSG_SMS_EEPROM_WRITE_RES = 572, | 324 | MSG_SMS_EEPROM_WRITE_RES = 572, |
325 | MSG_SMS_CUSTOM_READ_REQ = 574, | 325 | MSG_SMS_CUSTOM_READ_REQ = 574, |
326 | MSG_SMS_CUSTOM_READ_RES = 575, | 326 | MSG_SMS_CUSTOM_READ_RES = 575, |
327 | MSG_SMS_CUSTOM_WRITE_REQ = 576, | 327 | MSG_SMS_CUSTOM_WRITE_REQ = 576, |
328 | MSG_SMS_CUSTOM_WRITE_RES = 577, | 328 | MSG_SMS_CUSTOM_WRITE_RES = 577, |
329 | MSG_SMS_INIT_DEVICE_REQ = 578, | 329 | MSG_SMS_INIT_DEVICE_REQ = 578, |
330 | MSG_SMS_INIT_DEVICE_RES = 579, | 330 | MSG_SMS_INIT_DEVICE_RES = 579, |
331 | MSG_SMS_ATSC_SET_ALL_IP_REQ = 580, | 331 | MSG_SMS_ATSC_SET_ALL_IP_REQ = 580, |
332 | MSG_SMS_ATSC_SET_ALL_IP_RES = 581, | 332 | MSG_SMS_ATSC_SET_ALL_IP_RES = 581, |
333 | MSG_SMS_ATSC_START_ENSEMBLE_REQ = 582, | 333 | MSG_SMS_ATSC_START_ENSEMBLE_REQ = 582, |
334 | MSG_SMS_ATSC_START_ENSEMBLE_RES = 583, | 334 | MSG_SMS_ATSC_START_ENSEMBLE_RES = 583, |
335 | MSG_SMS_SET_OUTPUT_MODE_REQ = 584, | 335 | MSG_SMS_SET_OUTPUT_MODE_REQ = 584, |
336 | MSG_SMS_SET_OUTPUT_MODE_RES = 585, | 336 | MSG_SMS_SET_OUTPUT_MODE_RES = 585, |
337 | MSG_SMS_ATSC_IP_FILTER_GET_LIST_REQ = 586, | 337 | MSG_SMS_ATSC_IP_FILTER_GET_LIST_REQ = 586, |
338 | MSG_SMS_ATSC_IP_FILTER_GET_LIST_RES = 587, | 338 | MSG_SMS_ATSC_IP_FILTER_GET_LIST_RES = 587, |
339 | MSG_SMS_SUB_CHANNEL_START_REQ = 589, | 339 | MSG_SMS_SUB_CHANNEL_START_REQ = 589, |
340 | MSG_SMS_SUB_CHANNEL_START_RES = 590, | 340 | MSG_SMS_SUB_CHANNEL_START_RES = 590, |
341 | MSG_SMS_SUB_CHANNEL_STOP_REQ = 591, | 341 | MSG_SMS_SUB_CHANNEL_STOP_REQ = 591, |
342 | MSG_SMS_SUB_CHANNEL_STOP_RES = 592, | 342 | MSG_SMS_SUB_CHANNEL_STOP_RES = 592, |
343 | MSG_SMS_ATSC_IP_FILTER_ADD_REQ = 593, | 343 | MSG_SMS_ATSC_IP_FILTER_ADD_REQ = 593, |
344 | MSG_SMS_ATSC_IP_FILTER_ADD_RES = 594, | 344 | MSG_SMS_ATSC_IP_FILTER_ADD_RES = 594, |
345 | MSG_SMS_ATSC_IP_FILTER_REMOVE_REQ = 595, | 345 | MSG_SMS_ATSC_IP_FILTER_REMOVE_REQ = 595, |
346 | MSG_SMS_ATSC_IP_FILTER_REMOVE_RES = 596, | 346 | MSG_SMS_ATSC_IP_FILTER_REMOVE_RES = 596, |
347 | MSG_SMS_ATSC_IP_FILTER_REMOVE_ALL_REQ = 597, | 347 | MSG_SMS_ATSC_IP_FILTER_REMOVE_ALL_REQ = 597, |
348 | MSG_SMS_ATSC_IP_FILTER_REMOVE_ALL_RES = 598, | 348 | MSG_SMS_ATSC_IP_FILTER_REMOVE_ALL_RES = 598, |
349 | MSG_SMS_WAIT_CMD = 599, | 349 | MSG_SMS_WAIT_CMD = 599, |
350 | MSG_SMS_ADD_PID_FILTER_REQ = 601, | 350 | MSG_SMS_ADD_PID_FILTER_REQ = 601, |
351 | MSG_SMS_ADD_PID_FILTER_RES = 602, | 351 | MSG_SMS_ADD_PID_FILTER_RES = 602, |
352 | MSG_SMS_REMOVE_PID_FILTER_REQ = 603, | 352 | MSG_SMS_REMOVE_PID_FILTER_REQ = 603, |
353 | MSG_SMS_REMOVE_PID_FILTER_RES = 604, | 353 | MSG_SMS_REMOVE_PID_FILTER_RES = 604, |
354 | MSG_SMS_FAST_INFORMATION_CHANNEL_REQ = 605, | 354 | MSG_SMS_FAST_INFORMATION_CHANNEL_REQ = 605, |
355 | MSG_SMS_FAST_INFORMATION_CHANNEL_RES = 606, | 355 | MSG_SMS_FAST_INFORMATION_CHANNEL_RES = 606, |
356 | MSG_SMS_DAB_CHANNEL = 607, | 356 | MSG_SMS_DAB_CHANNEL = 607, |
357 | MSG_SMS_GET_PID_FILTER_LIST_REQ = 608, | 357 | MSG_SMS_GET_PID_FILTER_LIST_REQ = 608, |
358 | MSG_SMS_GET_PID_FILTER_LIST_RES = 609, | 358 | MSG_SMS_GET_PID_FILTER_LIST_RES = 609, |
359 | MSG_SMS_POWER_DOWN_REQ = 610, | 359 | MSG_SMS_POWER_DOWN_REQ = 610, |
360 | MSG_SMS_POWER_DOWN_RES = 611, | 360 | MSG_SMS_POWER_DOWN_RES = 611, |
361 | MSG_SMS_ATSC_SLT_EXIST_IND = 612, | 361 | MSG_SMS_ATSC_SLT_EXIST_IND = 612, |
362 | MSG_SMS_ATSC_NO_SLT_IND = 613, | 362 | MSG_SMS_ATSC_NO_SLT_IND = 613, |
363 | MSG_SMS_GET_STATISTICS_REQ = 615, | 363 | MSG_SMS_GET_STATISTICS_REQ = 615, |
364 | MSG_SMS_GET_STATISTICS_RES = 616, | 364 | MSG_SMS_GET_STATISTICS_RES = 616, |
365 | MSG_SMS_SEND_DUMP = 617, | 365 | MSG_SMS_SEND_DUMP = 617, |
366 | MSG_SMS_SCAN_START_REQ = 618, | 366 | MSG_SMS_SCAN_START_REQ = 618, |
367 | MSG_SMS_SCAN_START_RES = 619, | 367 | MSG_SMS_SCAN_START_RES = 619, |
368 | MSG_SMS_SCAN_STOP_REQ = 620, | 368 | MSG_SMS_SCAN_STOP_REQ = 620, |
369 | MSG_SMS_SCAN_STOP_RES = 621, | 369 | MSG_SMS_SCAN_STOP_RES = 621, |
370 | MSG_SMS_SCAN_PROGRESS_IND = 622, | 370 | MSG_SMS_SCAN_PROGRESS_IND = 622, |
371 | MSG_SMS_SCAN_COMPLETE_IND = 623, | 371 | MSG_SMS_SCAN_COMPLETE_IND = 623, |
372 | MSG_SMS_LOG_ITEM = 624, | 372 | MSG_SMS_LOG_ITEM = 624, |
373 | MSG_SMS_DAB_SUBCHANNEL_RECONFIG_REQ = 628, | 373 | MSG_SMS_DAB_SUBCHANNEL_RECONFIG_REQ = 628, |
374 | MSG_SMS_DAB_SUBCHANNEL_RECONFIG_RES = 629, | 374 | MSG_SMS_DAB_SUBCHANNEL_RECONFIG_RES = 629, |
375 | MSG_SMS_HO_PER_SLICES_IND = 630, | 375 | MSG_SMS_HO_PER_SLICES_IND = 630, |
376 | MSG_SMS_HO_INBAND_POWER_IND = 631, | 376 | MSG_SMS_HO_INBAND_POWER_IND = 631, |
377 | MSG_SMS_MANUAL_DEMOD_REQ = 632, | 377 | MSG_SMS_MANUAL_DEMOD_REQ = 632, |
378 | MSG_SMS_HO_TUNE_ON_REQ = 636, | 378 | MSG_SMS_HO_TUNE_ON_REQ = 636, |
379 | MSG_SMS_HO_TUNE_ON_RES = 637, | 379 | MSG_SMS_HO_TUNE_ON_RES = 637, |
380 | MSG_SMS_HO_TUNE_OFF_REQ = 638, | 380 | MSG_SMS_HO_TUNE_OFF_REQ = 638, |
381 | MSG_SMS_HO_TUNE_OFF_RES = 639, | 381 | MSG_SMS_HO_TUNE_OFF_RES = 639, |
382 | MSG_SMS_HO_PEEK_FREQ_REQ = 640, | 382 | MSG_SMS_HO_PEEK_FREQ_REQ = 640, |
383 | MSG_SMS_HO_PEEK_FREQ_RES = 641, | 383 | MSG_SMS_HO_PEEK_FREQ_RES = 641, |
384 | MSG_SMS_HO_PEEK_FREQ_IND = 642, | 384 | MSG_SMS_HO_PEEK_FREQ_IND = 642, |
385 | MSG_SMS_MB_ATTEN_SET_REQ = 643, | 385 | MSG_SMS_MB_ATTEN_SET_REQ = 643, |
386 | MSG_SMS_MB_ATTEN_SET_RES = 644, | 386 | MSG_SMS_MB_ATTEN_SET_RES = 644, |
387 | MSG_SMS_ENABLE_STAT_IN_I2C_REQ = 649, | 387 | MSG_SMS_ENABLE_STAT_IN_I2C_REQ = 649, |
388 | MSG_SMS_ENABLE_STAT_IN_I2C_RES = 650, | 388 | MSG_SMS_ENABLE_STAT_IN_I2C_RES = 650, |
389 | MSG_SMS_SET_ANTENNA_CONFIG_REQ = 651, | 389 | MSG_SMS_SET_ANTENNA_CONFIG_REQ = 651, |
390 | MSG_SMS_SET_ANTENNA_CONFIG_RES = 652, | 390 | MSG_SMS_SET_ANTENNA_CONFIG_RES = 652, |
391 | MSG_SMS_GET_STATISTICS_EX_REQ = 653, | 391 | MSG_SMS_GET_STATISTICS_EX_REQ = 653, |
392 | MSG_SMS_GET_STATISTICS_EX_RES = 654, | 392 | MSG_SMS_GET_STATISTICS_EX_RES = 654, |
393 | MSG_SMS_SLEEP_RESUME_COMP_IND = 655, | 393 | MSG_SMS_SLEEP_RESUME_COMP_IND = 655, |
394 | MSG_SMS_SWITCH_HOST_INTERFACE_REQ = 656, | 394 | MSG_SMS_SWITCH_HOST_INTERFACE_REQ = 656, |
395 | MSG_SMS_SWITCH_HOST_INTERFACE_RES = 657, | 395 | MSG_SMS_SWITCH_HOST_INTERFACE_RES = 657, |
396 | MSG_SMS_DATA_DOWNLOAD_REQ = 660, | 396 | MSG_SMS_DATA_DOWNLOAD_REQ = 660, |
397 | MSG_SMS_DATA_DOWNLOAD_RES = 661, | 397 | MSG_SMS_DATA_DOWNLOAD_RES = 661, |
398 | MSG_SMS_DATA_VALIDITY_REQ = 662, | 398 | MSG_SMS_DATA_VALIDITY_REQ = 662, |
399 | MSG_SMS_DATA_VALIDITY_RES = 663, | 399 | MSG_SMS_DATA_VALIDITY_RES = 663, |
400 | MSG_SMS_SWDOWNLOAD_TRIGGER_REQ = 664, | 400 | MSG_SMS_SWDOWNLOAD_TRIGGER_REQ = 664, |
401 | MSG_SMS_SWDOWNLOAD_TRIGGER_RES = 665, | 401 | MSG_SMS_SWDOWNLOAD_TRIGGER_RES = 665, |
402 | MSG_SMS_SWDOWNLOAD_BACKDOOR_REQ = 666, | 402 | MSG_SMS_SWDOWNLOAD_BACKDOOR_REQ = 666, |
403 | MSG_SMS_SWDOWNLOAD_BACKDOOR_RES = 667, | 403 | MSG_SMS_SWDOWNLOAD_BACKDOOR_RES = 667, |
404 | MSG_SMS_GET_VERSION_EX_REQ = 668, | 404 | MSG_SMS_GET_VERSION_EX_REQ = 668, |
405 | MSG_SMS_GET_VERSION_EX_RES = 669, | 405 | MSG_SMS_GET_VERSION_EX_RES = 669, |
406 | MSG_SMS_CLOCK_OUTPUT_CONFIG_REQ = 670, | 406 | MSG_SMS_CLOCK_OUTPUT_CONFIG_REQ = 670, |
407 | MSG_SMS_CLOCK_OUTPUT_CONFIG_RES = 671, | 407 | MSG_SMS_CLOCK_OUTPUT_CONFIG_RES = 671, |
408 | MSG_SMS_I2C_SET_FREQ_REQ = 685, | 408 | MSG_SMS_I2C_SET_FREQ_REQ = 685, |
409 | MSG_SMS_I2C_SET_FREQ_RES = 686, | 409 | MSG_SMS_I2C_SET_FREQ_RES = 686, |
410 | MSG_SMS_GENERIC_I2C_REQ = 687, | 410 | MSG_SMS_GENERIC_I2C_REQ = 687, |
411 | MSG_SMS_GENERIC_I2C_RES = 688, | 411 | MSG_SMS_GENERIC_I2C_RES = 688, |
412 | MSG_SMS_DVBT_BDA_DATA = 693, | 412 | MSG_SMS_DVBT_BDA_DATA = 693, |
413 | MSG_SW_RELOAD_REQ = 697, | 413 | MSG_SW_RELOAD_REQ = 697, |
414 | MSG_SMS_DATA_MSG = 699, | 414 | MSG_SMS_DATA_MSG = 699, |
415 | MSG_TABLE_UPLOAD_REQ = 700, | 415 | MSG_TABLE_UPLOAD_REQ = 700, |
416 | MSG_TABLE_UPLOAD_RES = 701, | 416 | MSG_TABLE_UPLOAD_RES = 701, |
417 | MSG_SW_RELOAD_START_REQ = 702, | 417 | MSG_SW_RELOAD_START_REQ = 702, |
418 | MSG_SW_RELOAD_START_RES = 703, | 418 | MSG_SW_RELOAD_START_RES = 703, |
419 | MSG_SW_RELOAD_EXEC_REQ = 704, | 419 | MSG_SW_RELOAD_EXEC_REQ = 704, |
420 | MSG_SW_RELOAD_EXEC_RES = 705, | 420 | MSG_SW_RELOAD_EXEC_RES = 705, |
421 | MSG_SMS_SPI_INT_LINE_SET_REQ = 710, | 421 | MSG_SMS_SPI_INT_LINE_SET_REQ = 710, |
422 | MSG_SMS_SPI_INT_LINE_SET_RES = 711, | 422 | MSG_SMS_SPI_INT_LINE_SET_RES = 711, |
423 | MSG_SMS_GPIO_CONFIG_EX_REQ = 712, | 423 | MSG_SMS_GPIO_CONFIG_EX_REQ = 712, |
424 | MSG_SMS_GPIO_CONFIG_EX_RES = 713, | 424 | MSG_SMS_GPIO_CONFIG_EX_RES = 713, |
425 | MSG_SMS_WATCHDOG_ACT_REQ = 716, | 425 | MSG_SMS_WATCHDOG_ACT_REQ = 716, |
426 | MSG_SMS_WATCHDOG_ACT_RES = 717, | 426 | MSG_SMS_WATCHDOG_ACT_RES = 717, |
427 | MSG_SMS_LOOPBACK_REQ = 718, | 427 | MSG_SMS_LOOPBACK_REQ = 718, |
428 | MSG_SMS_LOOPBACK_RES = 719, | 428 | MSG_SMS_LOOPBACK_RES = 719, |
429 | MSG_SMS_RAW_CAPTURE_START_REQ = 720, | 429 | MSG_SMS_RAW_CAPTURE_START_REQ = 720, |
430 | MSG_SMS_RAW_CAPTURE_START_RES = 721, | 430 | MSG_SMS_RAW_CAPTURE_START_RES = 721, |
431 | MSG_SMS_RAW_CAPTURE_ABORT_REQ = 722, | 431 | MSG_SMS_RAW_CAPTURE_ABORT_REQ = 722, |
432 | MSG_SMS_RAW_CAPTURE_ABORT_RES = 723, | 432 | MSG_SMS_RAW_CAPTURE_ABORT_RES = 723, |
433 | MSG_SMS_RAW_CAPTURE_COMPLETE_IND = 728, | 433 | MSG_SMS_RAW_CAPTURE_COMPLETE_IND = 728, |
434 | MSG_SMS_DATA_PUMP_IND = 729, | 434 | MSG_SMS_DATA_PUMP_IND = 729, |
435 | MSG_SMS_DATA_PUMP_REQ = 730, | 435 | MSG_SMS_DATA_PUMP_REQ = 730, |
436 | MSG_SMS_DATA_PUMP_RES = 731, | 436 | MSG_SMS_DATA_PUMP_RES = 731, |
437 | MSG_SMS_FLASH_DL_REQ = 732, | 437 | MSG_SMS_FLASH_DL_REQ = 732, |
438 | MSG_SMS_EXEC_TEST_1_REQ = 734, | 438 | MSG_SMS_EXEC_TEST_1_REQ = 734, |
439 | MSG_SMS_EXEC_TEST_1_RES = 735, | 439 | MSG_SMS_EXEC_TEST_1_RES = 735, |
440 | MSG_SMS_ENBALE_TS_INTERFACE_REQ = 736, | 440 | MSG_SMS_ENBALE_TS_INTERFACE_REQ = 736, |
441 | MSG_SMS_ENBALE_TS_INTERFACE_RES = 737, | 441 | MSG_SMS_ENBALE_TS_INTERFACE_RES = 737, |
442 | MSG_SMS_SPI_SET_BUS_WIDTH_REQ = 738, | 442 | MSG_SMS_SPI_SET_BUS_WIDTH_REQ = 738, |
443 | MSG_SMS_SPI_SET_BUS_WIDTH_RES = 739, | 443 | MSG_SMS_SPI_SET_BUS_WIDTH_RES = 739, |
444 | MSG_SMS_SEND_EMM_REQ = 740, | 444 | MSG_SMS_SEND_EMM_REQ = 740, |
445 | MSG_SMS_SEND_EMM_RES = 741, | 445 | MSG_SMS_SEND_EMM_RES = 741, |
446 | MSG_SMS_DISABLE_TS_INTERFACE_REQ = 742, | 446 | MSG_SMS_DISABLE_TS_INTERFACE_REQ = 742, |
447 | MSG_SMS_DISABLE_TS_INTERFACE_RES = 743, | 447 | MSG_SMS_DISABLE_TS_INTERFACE_RES = 743, |
448 | MSG_SMS_IS_BUF_FREE_REQ = 744, | 448 | MSG_SMS_IS_BUF_FREE_REQ = 744, |
449 | MSG_SMS_IS_BUF_FREE_RES = 745, | 449 | MSG_SMS_IS_BUF_FREE_RES = 745, |
450 | MSG_SMS_EXT_ANTENNA_REQ = 746, | 450 | MSG_SMS_EXT_ANTENNA_REQ = 746, |
451 | MSG_SMS_EXT_ANTENNA_RES = 747, | 451 | MSG_SMS_EXT_ANTENNA_RES = 747, |
452 | MSG_SMS_CMMB_GET_NET_OF_FREQ_REQ_OBSOLETE = 748, | 452 | MSG_SMS_CMMB_GET_NET_OF_FREQ_REQ_OBSOLETE = 748, |
453 | MSG_SMS_CMMB_GET_NET_OF_FREQ_RES_OBSOLETE = 749, | 453 | MSG_SMS_CMMB_GET_NET_OF_FREQ_RES_OBSOLETE = 749, |
454 | MSG_SMS_BATTERY_LEVEL_REQ = 750, | 454 | MSG_SMS_BATTERY_LEVEL_REQ = 750, |
455 | MSG_SMS_BATTERY_LEVEL_RES = 751, | 455 | MSG_SMS_BATTERY_LEVEL_RES = 751, |
456 | MSG_SMS_CMMB_INJECT_TABLE_REQ_OBSOLETE = 752, | 456 | MSG_SMS_CMMB_INJECT_TABLE_REQ_OBSOLETE = 752, |
457 | MSG_SMS_CMMB_INJECT_TABLE_RES_OBSOLETE = 753, | 457 | MSG_SMS_CMMB_INJECT_TABLE_RES_OBSOLETE = 753, |
458 | MSG_SMS_FM_RADIO_BLOCK_IND = 754, | 458 | MSG_SMS_FM_RADIO_BLOCK_IND = 754, |
459 | MSG_SMS_HOST_NOTIFICATION_IND = 755, | 459 | MSG_SMS_HOST_NOTIFICATION_IND = 755, |
460 | MSG_SMS_CMMB_GET_CONTROL_TABLE_REQ_OBSOLETE = 756, | 460 | MSG_SMS_CMMB_GET_CONTROL_TABLE_REQ_OBSOLETE = 756, |
461 | MSG_SMS_CMMB_GET_CONTROL_TABLE_RES_OBSOLETE = 757, | 461 | MSG_SMS_CMMB_GET_CONTROL_TABLE_RES_OBSOLETE = 757, |
462 | MSG_SMS_CMMB_GET_NETWORKS_REQ = 760, | 462 | MSG_SMS_CMMB_GET_NETWORKS_REQ = 760, |
463 | MSG_SMS_CMMB_GET_NETWORKS_RES = 761, | 463 | MSG_SMS_CMMB_GET_NETWORKS_RES = 761, |
464 | MSG_SMS_CMMB_START_SERVICE_REQ = 762, | 464 | MSG_SMS_CMMB_START_SERVICE_REQ = 762, |
465 | MSG_SMS_CMMB_START_SERVICE_RES = 763, | 465 | MSG_SMS_CMMB_START_SERVICE_RES = 763, |
466 | MSG_SMS_CMMB_STOP_SERVICE_REQ = 764, | 466 | MSG_SMS_CMMB_STOP_SERVICE_REQ = 764, |
467 | MSG_SMS_CMMB_STOP_SERVICE_RES = 765, | 467 | MSG_SMS_CMMB_STOP_SERVICE_RES = 765, |
468 | MSG_SMS_CMMB_ADD_CHANNEL_FILTER_REQ = 768, | 468 | MSG_SMS_CMMB_ADD_CHANNEL_FILTER_REQ = 768, |
469 | MSG_SMS_CMMB_ADD_CHANNEL_FILTER_RES = 769, | 469 | MSG_SMS_CMMB_ADD_CHANNEL_FILTER_RES = 769, |
470 | MSG_SMS_CMMB_REMOVE_CHANNEL_FILTER_REQ = 770, | 470 | MSG_SMS_CMMB_REMOVE_CHANNEL_FILTER_REQ = 770, |
471 | MSG_SMS_CMMB_REMOVE_CHANNEL_FILTER_RES = 771, | 471 | MSG_SMS_CMMB_REMOVE_CHANNEL_FILTER_RES = 771, |
472 | MSG_SMS_CMMB_START_CONTROL_INFO_REQ = 772, | 472 | MSG_SMS_CMMB_START_CONTROL_INFO_REQ = 772, |
473 | MSG_SMS_CMMB_START_CONTROL_INFO_RES = 773, | 473 | MSG_SMS_CMMB_START_CONTROL_INFO_RES = 773, |
474 | MSG_SMS_CMMB_STOP_CONTROL_INFO_REQ = 774, | 474 | MSG_SMS_CMMB_STOP_CONTROL_INFO_REQ = 774, |
475 | MSG_SMS_CMMB_STOP_CONTROL_INFO_RES = 775, | 475 | MSG_SMS_CMMB_STOP_CONTROL_INFO_RES = 775, |
476 | MSG_SMS_ISDBT_TUNE_REQ = 776, | 476 | MSG_SMS_ISDBT_TUNE_REQ = 776, |
477 | MSG_SMS_ISDBT_TUNE_RES = 777, | 477 | MSG_SMS_ISDBT_TUNE_RES = 777, |
478 | MSG_SMS_TRANSMISSION_IND = 782, | 478 | MSG_SMS_TRANSMISSION_IND = 782, |
479 | MSG_SMS_PID_STATISTICS_IND = 783, | 479 | MSG_SMS_PID_STATISTICS_IND = 783, |
480 | MSG_SMS_POWER_DOWN_IND = 784, | 480 | MSG_SMS_POWER_DOWN_IND = 784, |
481 | MSG_SMS_POWER_DOWN_CONF = 785, | 481 | MSG_SMS_POWER_DOWN_CONF = 785, |
482 | MSG_SMS_POWER_UP_IND = 786, | 482 | MSG_SMS_POWER_UP_IND = 786, |
483 | MSG_SMS_POWER_UP_CONF = 787, | 483 | MSG_SMS_POWER_UP_CONF = 787, |
484 | MSG_SMS_POWER_MODE_SET_REQ = 790, | 484 | MSG_SMS_POWER_MODE_SET_REQ = 790, |
485 | MSG_SMS_POWER_MODE_SET_RES = 791, | 485 | MSG_SMS_POWER_MODE_SET_RES = 791, |
486 | MSG_SMS_DEBUG_HOST_EVENT_REQ = 792, | 486 | MSG_SMS_DEBUG_HOST_EVENT_REQ = 792, |
487 | MSG_SMS_DEBUG_HOST_EVENT_RES = 793, | 487 | MSG_SMS_DEBUG_HOST_EVENT_RES = 793, |
488 | MSG_SMS_NEW_CRYSTAL_REQ = 794, | 488 | MSG_SMS_NEW_CRYSTAL_REQ = 794, |
489 | MSG_SMS_NEW_CRYSTAL_RES = 795, | 489 | MSG_SMS_NEW_CRYSTAL_RES = 795, |
490 | MSG_SMS_CONFIG_SPI_REQ = 796, | 490 | MSG_SMS_CONFIG_SPI_REQ = 796, |
491 | MSG_SMS_CONFIG_SPI_RES = 797, | 491 | MSG_SMS_CONFIG_SPI_RES = 797, |
492 | MSG_SMS_I2C_SHORT_STAT_IND = 798, | 492 | MSG_SMS_I2C_SHORT_STAT_IND = 798, |
493 | MSG_SMS_START_IR_REQ = 800, | 493 | MSG_SMS_START_IR_REQ = 800, |
494 | MSG_SMS_START_IR_RES = 801, | 494 | MSG_SMS_START_IR_RES = 801, |
495 | MSG_SMS_IR_SAMPLES_IND = 802, | 495 | MSG_SMS_IR_SAMPLES_IND = 802, |
496 | MSG_SMS_CMMB_CA_SERVICE_IND = 803, | 496 | MSG_SMS_CMMB_CA_SERVICE_IND = 803, |
497 | MSG_SMS_SLAVE_DEVICE_DETECTED = 804, | 497 | MSG_SMS_SLAVE_DEVICE_DETECTED = 804, |
498 | MSG_SMS_INTERFACE_LOCK_IND = 805, | 498 | MSG_SMS_INTERFACE_LOCK_IND = 805, |
499 | MSG_SMS_INTERFACE_UNLOCK_IND = 806, | 499 | MSG_SMS_INTERFACE_UNLOCK_IND = 806, |
500 | MSG_SMS_SEND_ROSUM_BUFF_REQ = 810, | 500 | MSG_SMS_SEND_ROSUM_BUFF_REQ = 810, |
501 | MSG_SMS_SEND_ROSUM_BUFF_RES = 811, | 501 | MSG_SMS_SEND_ROSUM_BUFF_RES = 811, |
502 | MSG_SMS_ROSUM_BUFF = 812, | 502 | MSG_SMS_ROSUM_BUFF = 812, |
503 | MSG_SMS_SET_AES128_KEY_REQ = 815, | 503 | MSG_SMS_SET_AES128_KEY_REQ = 815, |
504 | MSG_SMS_SET_AES128_KEY_RES = 816, | 504 | MSG_SMS_SET_AES128_KEY_RES = 816, |
505 | MSG_SMS_MBBMS_WRITE_REQ = 817, | 505 | MSG_SMS_MBBMS_WRITE_REQ = 817, |
506 | MSG_SMS_MBBMS_WRITE_RES = 818, | 506 | MSG_SMS_MBBMS_WRITE_RES = 818, |
507 | MSG_SMS_MBBMS_READ_IND = 819, | 507 | MSG_SMS_MBBMS_READ_IND = 819, |
508 | MSG_SMS_IQ_STREAM_START_REQ = 820, | 508 | MSG_SMS_IQ_STREAM_START_REQ = 820, |
509 | MSG_SMS_IQ_STREAM_START_RES = 821, | 509 | MSG_SMS_IQ_STREAM_START_RES = 821, |
510 | MSG_SMS_IQ_STREAM_STOP_REQ = 822, | 510 | MSG_SMS_IQ_STREAM_STOP_REQ = 822, |
511 | MSG_SMS_IQ_STREAM_STOP_RES = 823, | 511 | MSG_SMS_IQ_STREAM_STOP_RES = 823, |
512 | MSG_SMS_IQ_STREAM_DATA_BLOCK = 824, | 512 | MSG_SMS_IQ_STREAM_DATA_BLOCK = 824, |
513 | MSG_SMS_GET_EEPROM_VERSION_REQ = 825, | 513 | MSG_SMS_GET_EEPROM_VERSION_REQ = 825, |
514 | MSG_SMS_GET_EEPROM_VERSION_RES = 826, | 514 | MSG_SMS_GET_EEPROM_VERSION_RES = 826, |
515 | MSG_SMS_SIGNAL_DETECTED_IND = 827, | 515 | MSG_SMS_SIGNAL_DETECTED_IND = 827, |
516 | MSG_SMS_NO_SIGNAL_IND = 828, | 516 | MSG_SMS_NO_SIGNAL_IND = 828, |
517 | MSG_SMS_MRC_SHUTDOWN_SLAVE_REQ = 830, | 517 | MSG_SMS_MRC_SHUTDOWN_SLAVE_REQ = 830, |
518 | MSG_SMS_MRC_SHUTDOWN_SLAVE_RES = 831, | 518 | MSG_SMS_MRC_SHUTDOWN_SLAVE_RES = 831, |
519 | MSG_SMS_MRC_BRINGUP_SLAVE_REQ = 832, | 519 | MSG_SMS_MRC_BRINGUP_SLAVE_REQ = 832, |
520 | MSG_SMS_MRC_BRINGUP_SLAVE_RES = 833, | 520 | MSG_SMS_MRC_BRINGUP_SLAVE_RES = 833, |
521 | MSG_SMS_EXTERNAL_LNA_CTRL_REQ = 834, | 521 | MSG_SMS_EXTERNAL_LNA_CTRL_REQ = 834, |
522 | MSG_SMS_EXTERNAL_LNA_CTRL_RES = 835, | 522 | MSG_SMS_EXTERNAL_LNA_CTRL_RES = 835, |
523 | MSG_SMS_SET_PERIODIC_STATISTICS_REQ = 836, | 523 | MSG_SMS_SET_PERIODIC_STATISTICS_REQ = 836, |
524 | MSG_SMS_SET_PERIODIC_STATISTICS_RES = 837, | 524 | MSG_SMS_SET_PERIODIC_STATISTICS_RES = 837, |
525 | MSG_SMS_CMMB_SET_AUTO_OUTPUT_TS0_REQ = 838, | 525 | MSG_SMS_CMMB_SET_AUTO_OUTPUT_TS0_REQ = 838, |
526 | MSG_SMS_CMMB_SET_AUTO_OUTPUT_TS0_RES = 839, | 526 | MSG_SMS_CMMB_SET_AUTO_OUTPUT_TS0_RES = 839, |
527 | LOCAL_TUNE = 850, | 527 | LOCAL_TUNE = 850, |
528 | LOCAL_IFFT_H_ICI = 851, | 528 | LOCAL_IFFT_H_ICI = 851, |
529 | MSG_RESYNC_REQ = 852, | 529 | MSG_RESYNC_REQ = 852, |
530 | MSG_SMS_CMMB_GET_MRC_STATISTICS_REQ = 853, | 530 | MSG_SMS_CMMB_GET_MRC_STATISTICS_REQ = 853, |
531 | MSG_SMS_CMMB_GET_MRC_STATISTICS_RES = 854, | 531 | MSG_SMS_CMMB_GET_MRC_STATISTICS_RES = 854, |
532 | MSG_SMS_LOG_EX_ITEM = 855, | 532 | MSG_SMS_LOG_EX_ITEM = 855, |
533 | MSG_SMS_DEVICE_DATA_LOSS_IND = 856, | 533 | MSG_SMS_DEVICE_DATA_LOSS_IND = 856, |
534 | MSG_SMS_MRC_WATCHDOG_TRIGGERED_IND = 857, | 534 | MSG_SMS_MRC_WATCHDOG_TRIGGERED_IND = 857, |
535 | MSG_SMS_USER_MSG_REQ = 858, | 535 | MSG_SMS_USER_MSG_REQ = 858, |
536 | MSG_SMS_USER_MSG_RES = 859, | 536 | MSG_SMS_USER_MSG_RES = 859, |
537 | MSG_SMS_SMART_CARD_INIT_REQ = 860, | 537 | MSG_SMS_SMART_CARD_INIT_REQ = 860, |
538 | MSG_SMS_SMART_CARD_INIT_RES = 861, | 538 | MSG_SMS_SMART_CARD_INIT_RES = 861, |
539 | MSG_SMS_SMART_CARD_WRITE_REQ = 862, | 539 | MSG_SMS_SMART_CARD_WRITE_REQ = 862, |
540 | MSG_SMS_SMART_CARD_WRITE_RES = 863, | 540 | MSG_SMS_SMART_CARD_WRITE_RES = 863, |
541 | MSG_SMS_SMART_CARD_READ_IND = 864, | 541 | MSG_SMS_SMART_CARD_READ_IND = 864, |
542 | MSG_SMS_TSE_ENABLE_REQ = 866, | 542 | MSG_SMS_TSE_ENABLE_REQ = 866, |
543 | MSG_SMS_TSE_ENABLE_RES = 867, | 543 | MSG_SMS_TSE_ENABLE_RES = 867, |
544 | MSG_SMS_CMMB_GET_SHORT_STATISTICS_REQ = 868, | 544 | MSG_SMS_CMMB_GET_SHORT_STATISTICS_REQ = 868, |
545 | MSG_SMS_CMMB_GET_SHORT_STATISTICS_RES = 869, | 545 | MSG_SMS_CMMB_GET_SHORT_STATISTICS_RES = 869, |
546 | MSG_SMS_LED_CONFIG_REQ = 870, | 546 | MSG_SMS_LED_CONFIG_REQ = 870, |
547 | MSG_SMS_LED_CONFIG_RES = 871, | 547 | MSG_SMS_LED_CONFIG_RES = 871, |
548 | MSG_PWM_ANTENNA_REQ = 872, | 548 | MSG_PWM_ANTENNA_REQ = 872, |
549 | MSG_PWM_ANTENNA_RES = 873, | 549 | MSG_PWM_ANTENNA_RES = 873, |
550 | MSG_SMS_CMMB_SMD_SN_REQ = 874, | 550 | MSG_SMS_CMMB_SMD_SN_REQ = 874, |
551 | MSG_SMS_CMMB_SMD_SN_RES = 875, | 551 | MSG_SMS_CMMB_SMD_SN_RES = 875, |
552 | MSG_SMS_CMMB_SET_CA_CW_REQ = 876, | 552 | MSG_SMS_CMMB_SET_CA_CW_REQ = 876, |
553 | MSG_SMS_CMMB_SET_CA_CW_RES = 877, | 553 | MSG_SMS_CMMB_SET_CA_CW_RES = 877, |
554 | MSG_SMS_CMMB_SET_CA_SALT_REQ = 878, | 554 | MSG_SMS_CMMB_SET_CA_SALT_REQ = 878, |
555 | MSG_SMS_CMMB_SET_CA_SALT_RES = 879, | 555 | MSG_SMS_CMMB_SET_CA_SALT_RES = 879, |
556 | MSG_SMS_NSCD_INIT_REQ = 880, | 556 | MSG_SMS_NSCD_INIT_REQ = 880, |
557 | MSG_SMS_NSCD_INIT_RES = 881, | 557 | MSG_SMS_NSCD_INIT_RES = 881, |
558 | MSG_SMS_NSCD_PROCESS_SECTION_REQ = 882, | 558 | MSG_SMS_NSCD_PROCESS_SECTION_REQ = 882, |
559 | MSG_SMS_NSCD_PROCESS_SECTION_RES = 883, | 559 | MSG_SMS_NSCD_PROCESS_SECTION_RES = 883, |
560 | MSG_SMS_DBD_CREATE_OBJECT_REQ = 884, | 560 | MSG_SMS_DBD_CREATE_OBJECT_REQ = 884, |
561 | MSG_SMS_DBD_CREATE_OBJECT_RES = 885, | 561 | MSG_SMS_DBD_CREATE_OBJECT_RES = 885, |
562 | MSG_SMS_DBD_CONFIGURE_REQ = 886, | 562 | MSG_SMS_DBD_CONFIGURE_REQ = 886, |
563 | MSG_SMS_DBD_CONFIGURE_RES = 887, | 563 | MSG_SMS_DBD_CONFIGURE_RES = 887, |
564 | MSG_SMS_DBD_SET_KEYS_REQ = 888, | 564 | MSG_SMS_DBD_SET_KEYS_REQ = 888, |
565 | MSG_SMS_DBD_SET_KEYS_RES = 889, | 565 | MSG_SMS_DBD_SET_KEYS_RES = 889, |
566 | MSG_SMS_DBD_PROCESS_HEADER_REQ = 890, | 566 | MSG_SMS_DBD_PROCESS_HEADER_REQ = 890, |
567 | MSG_SMS_DBD_PROCESS_HEADER_RES = 891, | 567 | MSG_SMS_DBD_PROCESS_HEADER_RES = 891, |
568 | MSG_SMS_DBD_PROCESS_DATA_REQ = 892, | 568 | MSG_SMS_DBD_PROCESS_DATA_REQ = 892, |
569 | MSG_SMS_DBD_PROCESS_DATA_RES = 893, | 569 | MSG_SMS_DBD_PROCESS_DATA_RES = 893, |
570 | MSG_SMS_DBD_PROCESS_GET_DATA_REQ = 894, | 570 | MSG_SMS_DBD_PROCESS_GET_DATA_REQ = 894, |
571 | MSG_SMS_DBD_PROCESS_GET_DATA_RES = 895, | 571 | MSG_SMS_DBD_PROCESS_GET_DATA_RES = 895, |
572 | MSG_SMS_NSCD_OPEN_SESSION_REQ = 896, | 572 | MSG_SMS_NSCD_OPEN_SESSION_REQ = 896, |
573 | MSG_SMS_NSCD_OPEN_SESSION_RES = 897, | 573 | MSG_SMS_NSCD_OPEN_SESSION_RES = 897, |
574 | MSG_SMS_SEND_HOST_DATA_TO_DEMUX_REQ = 898, | 574 | MSG_SMS_SEND_HOST_DATA_TO_DEMUX_REQ = 898, |
575 | MSG_SMS_SEND_HOST_DATA_TO_DEMUX_RES = 899, | 575 | MSG_SMS_SEND_HOST_DATA_TO_DEMUX_RES = 899, |
576 | MSG_LAST_MSG_TYPE = 900, | 576 | MSG_LAST_MSG_TYPE = 900, |
577 | }; | 577 | }; |
578 | 578 | ||
579 | #define SMS_INIT_MSG_EX(ptr, type, src, dst, len) do { \ | 579 | #define SMS_INIT_MSG_EX(ptr, type, src, dst, len) do { \ |
580 | (ptr)->msg_type = type; \ | 580 | (ptr)->msg_type = type; \ |
581 | (ptr)->msg_src_id = src; \ | 581 | (ptr)->msg_src_id = src; \ |
582 | (ptr)->msg_dst_id = dst; \ | 582 | (ptr)->msg_dst_id = dst; \ |
583 | (ptr)->msg_length = len; \ | 583 | (ptr)->msg_length = len; \ |
584 | (ptr)->msg_flags = 0; \ | 584 | (ptr)->msg_flags = 0; \ |
585 | } while (0) | 585 | } while (0) |
586 | 586 | ||
587 | #define SMS_INIT_MSG(ptr, type, len) \ | 587 | #define SMS_INIT_MSG(ptr, type, len) \ |
588 | SMS_INIT_MSG_EX(ptr, type, 0, HIF_TASK, len) | 588 | SMS_INIT_MSG_EX(ptr, type, 0, HIF_TASK, len) |
589 | 589 | ||
590 | enum SMS_DVB3_EVENTS { | 590 | enum SMS_DVB3_EVENTS { |
591 | DVB3_EVENT_INIT = 0, | 591 | DVB3_EVENT_INIT = 0, |
592 | DVB3_EVENT_SLEEP, | 592 | DVB3_EVENT_SLEEP, |
593 | DVB3_EVENT_HOTPLUG, | 593 | DVB3_EVENT_HOTPLUG, |
594 | DVB3_EVENT_FE_LOCK, | 594 | DVB3_EVENT_FE_LOCK, |
595 | DVB3_EVENT_FE_UNLOCK, | 595 | DVB3_EVENT_FE_UNLOCK, |
596 | DVB3_EVENT_UNC_OK, | 596 | DVB3_EVENT_UNC_OK, |
597 | DVB3_EVENT_UNC_ERR | 597 | DVB3_EVENT_UNC_ERR |
598 | }; | 598 | }; |
599 | 599 | ||
600 | enum SMS_DEVICE_MODE { | 600 | enum SMS_DEVICE_MODE { |
601 | DEVICE_MODE_NONE = -1, | 601 | DEVICE_MODE_NONE = -1, |
602 | DEVICE_MODE_DVBT = 0, | 602 | DEVICE_MODE_DVBT = 0, |
603 | DEVICE_MODE_DVBH, | 603 | DEVICE_MODE_DVBH, |
604 | DEVICE_MODE_DAB_TDMB, | 604 | DEVICE_MODE_DAB_TDMB, |
605 | DEVICE_MODE_DAB_TDMB_DABIP, | 605 | DEVICE_MODE_DAB_TDMB_DABIP, |
606 | DEVICE_MODE_DVBT_BDA, | 606 | DEVICE_MODE_DVBT_BDA, |
607 | DEVICE_MODE_ISDBT, | 607 | DEVICE_MODE_ISDBT, |
608 | DEVICE_MODE_ISDBT_BDA, | 608 | DEVICE_MODE_ISDBT_BDA, |
609 | DEVICE_MODE_CMMB, | 609 | DEVICE_MODE_CMMB, |
610 | DEVICE_MODE_RAW_TUNER, | 610 | DEVICE_MODE_RAW_TUNER, |
611 | DEVICE_MODE_FM_RADIO, | 611 | DEVICE_MODE_FM_RADIO, |
612 | DEVICE_MODE_FM_RADIO_BDA, | 612 | DEVICE_MODE_FM_RADIO_BDA, |
613 | DEVICE_MODE_ATSC, | 613 | DEVICE_MODE_ATSC, |
614 | DEVICE_MODE_MAX, | 614 | DEVICE_MODE_MAX, |
615 | }; | 615 | }; |
616 | 616 | ||
617 | struct sms_msg_hdr { | 617 | struct sms_msg_hdr { |
618 | u16 msg_type; | 618 | u16 msg_type; |
619 | u8 msg_src_id; | 619 | u8 msg_src_id; |
620 | u8 msg_dst_id; | 620 | u8 msg_dst_id; |
621 | u16 msg_length; /* length of entire message, including header */ | 621 | u16 msg_length; /* length of entire message, including header */ |
622 | u16 msg_flags; | 622 | u16 msg_flags; |
623 | }; | 623 | }; |
624 | 624 | ||
625 | struct sms_msg_data { | 625 | struct sms_msg_data { |
626 | struct sms_msg_hdr x_msg_header; | 626 | struct sms_msg_hdr x_msg_header; |
627 | u32 msgData[1]; | 627 | u32 msg_data[1]; |
628 | }; | 628 | }; |
629 | 629 | ||
630 | struct sms_msg_data2 { | 630 | struct sms_msg_data2 { |
631 | struct sms_msg_hdr x_msg_header; | 631 | struct sms_msg_hdr x_msg_header; |
632 | u32 msgData[2]; | 632 | u32 msg_data[2]; |
633 | }; | 633 | }; |
634 | 634 | ||
635 | struct sms_msg_data4 { | 635 | struct sms_msg_data4 { |
636 | struct sms_msg_hdr x_msg_header; | 636 | struct sms_msg_hdr x_msg_header; |
637 | u32 msgData[4]; | 637 | u32 msg_data[4]; |
638 | }; | 638 | }; |
639 | 639 | ||
640 | struct sms_data_download { | 640 | struct sms_data_download { |
641 | struct sms_msg_hdr x_msg_header; | 641 | struct sms_msg_hdr x_msg_header; |
642 | u32 mem_addr; | 642 | u32 mem_addr; |
643 | u8 payload[SMS_MAX_PAYLOAD_SIZE]; | 643 | u8 payload[SMS_MAX_PAYLOAD_SIZE]; |
644 | }; | 644 | }; |
645 | 645 | ||
646 | struct sms_version_res { | 646 | struct sms_version_res { |
647 | struct sms_msg_hdr x_msg_header; | 647 | struct sms_msg_hdr x_msg_header; |
648 | 648 | ||
649 | u16 chip_model; /* e.g. 0x1102 for SMS-1102 "Nova" */ | 649 | u16 chip_model; /* e.g. 0x1102 for SMS-1102 "Nova" */ |
650 | u8 step; /* 0 - step A */ | 650 | u8 step; /* 0 - step A */ |
651 | u8 metal_fix; /* 0 - Metal 0 */ | 651 | u8 metal_fix; /* 0 - Metal 0 */ |
652 | 652 | ||
653 | /* firmware_id 0xFF if ROM, otherwise the | 653 | /* firmware_id 0xFF if ROM, otherwise the |
654 | * value indicated by SMSHOSTLIB_DEVICE_MODES_E */ | 654 | * value indicated by SMSHOSTLIB_DEVICE_MODES_E */ |
655 | u8 firmware_id; | 655 | u8 firmware_id; |
656 | /* supported_protocols Bitwise OR combination of | 656 | /* supported_protocols Bitwise OR combination of |
657 | * supported protocols */ | 657 | * supported protocols */ |
658 | u8 supported_protocols; | 658 | u8 supported_protocols; |
659 | 659 | ||
660 | u8 version_major; | 660 | u8 version_major; |
661 | u8 version_minor; | 661 | u8 version_minor; |
662 | u8 version_patch; | 662 | u8 version_patch; |
663 | u8 version_field_patch; | 663 | u8 version_field_patch; |
664 | 664 | ||
665 | u8 rom_ver_major; | 665 | u8 rom_ver_major; |
666 | u8 rom_ver_minor; | 666 | u8 rom_ver_minor; |
667 | u8 rom_ver_patch; | 667 | u8 rom_ver_patch; |
668 | u8 rom_ver_field_patch; | 668 | u8 rom_ver_field_patch; |
669 | 669 | ||
670 | u8 TextLabel[34]; | 670 | u8 TextLabel[34]; |
671 | }; | 671 | }; |
672 | 672 | ||
673 | struct sms_firmware { | 673 | struct sms_firmware { |
674 | u32 check_sum; | 674 | u32 check_sum; |
675 | u32 length; | 675 | u32 length; |
676 | u32 start_address; | 676 | u32 start_address; |
677 | u8 payload[1]; | 677 | u8 payload[1]; |
678 | }; | 678 | }; |
679 | 679 | ||
680 | /* statistics information returned as response for | 680 | /* statistics information returned as response for |
681 | * SmsHostApiGetstatistics_Req */ | 681 | * SmsHostApiGetstatistics_Req */ |
682 | struct sms_stats { | 682 | struct sms_stats { |
683 | u32 reserved; /* reserved */ | 683 | u32 reserved; /* reserved */ |
684 | 684 | ||
685 | /* Common parameters */ | 685 | /* Common parameters */ |
686 | u32 is_rf_locked; /* 0 - not locked, 1 - locked */ | 686 | u32 is_rf_locked; /* 0 - not locked, 1 - locked */ |
687 | u32 is_demod_locked; /* 0 - not locked, 1 - locked */ | 687 | u32 is_demod_locked; /* 0 - not locked, 1 - locked */ |
688 | u32 is_external_lna_on; /* 0 - external LNA off, 1 - external LNA on */ | 688 | u32 is_external_lna_on; /* 0 - external LNA off, 1 - external LNA on */ |
689 | 689 | ||
690 | /* Reception quality */ | 690 | /* Reception quality */ |
691 | s32 SNR; /* dB */ | 691 | s32 SNR; /* dB */ |
692 | u32 BER; /* Post Viterbi BER [1E-5] */ | 692 | u32 ber; /* Post Viterbi ber [1E-5] */ |
693 | u32 FIB_CRC; /* CRC errors percentage, valid only for DAB */ | 693 | u32 FIB_CRC; /* CRC errors percentage, valid only for DAB */ |
694 | u32 TS_PER; /* Transport stream PER, | 694 | u32 ts_per; /* Transport stream PER, |
695 | 0xFFFFFFFF indicate N/A, valid only for DVB-T/H */ | 695 | 0xFFFFFFFF indicate N/A, valid only for DVB-T/H */ |
696 | u32 MFER; /* DVB-H frame error rate in percentage, | 696 | u32 MFER; /* DVB-H frame error rate in percentage, |
697 | 0xFFFFFFFF indicate N/A, valid only for DVB-H */ | 697 | 0xFFFFFFFF indicate N/A, valid only for DVB-H */ |
698 | s32 RSSI; /* dBm */ | 698 | s32 RSSI; /* dBm */ |
699 | s32 in_band_pwr; /* In band power in dBM */ | 699 | s32 in_band_pwr; /* In band power in dBM */ |
700 | s32 carrier_offset; /* Carrier Offset in bin/1024 */ | 700 | s32 carrier_offset; /* Carrier Offset in bin/1024 */ |
701 | 701 | ||
702 | /* Transmission parameters */ | 702 | /* Transmission parameters */ |
703 | u32 frequency; /* frequency in Hz */ | 703 | u32 frequency; /* frequency in Hz */ |
704 | u32 bandwidth; /* bandwidth in MHz, valid only for DVB-T/H */ | 704 | u32 bandwidth; /* bandwidth in MHz, valid only for DVB-T/H */ |
705 | u32 transmission_mode; /* Transmission Mode, for DAB modes 1-4, | 705 | u32 transmission_mode; /* Transmission Mode, for DAB modes 1-4, |
706 | for DVB-T/H FFT mode carriers in Kilos */ | 706 | for DVB-T/H FFT mode carriers in Kilos */ |
707 | u32 modem_state; /* from SMSHOSTLIB_DVB_MODEM_STATE_ET, | 707 | u32 modem_state; /* from SMSHOSTLIB_DVB_MODEM_STATE_ET, |
708 | valid only for DVB-T/H */ | 708 | valid only for DVB-T/H */ |
709 | u32 guard_interval; /* Guard Interval from | 709 | u32 guard_interval; /* Guard Interval from |
710 | SMSHOSTLIB_GUARD_INTERVALS_ET, valid only for DVB-T/H */ | 710 | SMSHOSTLIB_GUARD_INTERVALS_ET, valid only for DVB-T/H */ |
711 | u32 code_rate; /* Code Rate from SMSHOSTLIB_CODE_RATE_ET, | 711 | u32 code_rate; /* Code Rate from SMSHOSTLIB_CODE_RATE_ET, |
712 | valid only for DVB-T/H */ | 712 | valid only for DVB-T/H */ |
713 | u32 lp_code_rate; /* Low Priority Code Rate from | 713 | u32 lp_code_rate; /* Low Priority Code Rate from |
714 | SMSHOSTLIB_CODE_RATE_ET, valid only for DVB-T/H */ | 714 | SMSHOSTLIB_CODE_RATE_ET, valid only for DVB-T/H */ |
715 | u32 hierarchy; /* hierarchy from SMSHOSTLIB_HIERARCHY_ET, | 715 | u32 hierarchy; /* hierarchy from SMSHOSTLIB_HIERARCHY_ET, |
716 | valid only for DVB-T/H */ | 716 | valid only for DVB-T/H */ |
717 | u32 constellation; /* constellation from | 717 | u32 constellation; /* constellation from |
718 | SMSHOSTLIB_CONSTELLATION_ET, valid only for DVB-T/H */ | 718 | SMSHOSTLIB_CONSTELLATION_ET, valid only for DVB-T/H */ |
719 | 719 | ||
720 | /* Burst parameters, valid only for DVB-H */ | 720 | /* Burst parameters, valid only for DVB-H */ |
721 | u32 burst_size; /* Current burst size in bytes, | 721 | u32 burst_size; /* Current burst size in bytes, |
722 | valid only for DVB-H */ | 722 | valid only for DVB-H */ |
723 | u32 burst_duration; /* Current burst duration in mSec, | 723 | u32 burst_duration; /* Current burst duration in mSec, |
724 | valid only for DVB-H */ | 724 | valid only for DVB-H */ |
725 | u32 burst_cycle_time; /* Current burst cycle time in mSec, | 725 | u32 burst_cycle_time; /* Current burst cycle time in mSec, |
726 | valid only for DVB-H */ | 726 | valid only for DVB-H */ |
727 | u32 calc_burst_cycle_time;/* Current burst cycle time in mSec, | 727 | u32 calc_burst_cycle_time;/* Current burst cycle time in mSec, |
728 | as calculated by demodulator, valid only for DVB-H */ | 728 | as calculated by demodulator, valid only for DVB-H */ |
729 | u32 num_of_rows; /* Number of rows in MPE table, | 729 | u32 num_of_rows; /* Number of rows in MPE table, |
730 | valid only for DVB-H */ | 730 | valid only for DVB-H */ |
731 | u32 num_of_padd_cols; /* Number of padding columns in MPE table, | 731 | u32 num_of_padd_cols; /* Number of padding columns in MPE table, |
732 | valid only for DVB-H */ | 732 | valid only for DVB-H */ |
733 | u32 num_of_punct_cols; /* Number of puncturing columns in MPE table, | 733 | u32 num_of_punct_cols; /* Number of puncturing columns in MPE table, |
734 | valid only for DVB-H */ | 734 | valid only for DVB-H */ |
735 | u32 error_ts_packets; /* Number of erroneous | 735 | u32 error_ts_packets; /* Number of erroneous |
736 | transport-stream packets */ | 736 | transport-stream packets */ |
737 | u32 total_ts_packets; /* Total number of transport-stream packets */ | 737 | u32 total_ts_packets; /* Total number of transport-stream packets */ |
738 | u32 num_of_valid_mpe_tlbs; /* Number of MPE tables which do not include | 738 | u32 num_of_valid_mpe_tlbs; /* Number of MPE tables which do not include |
739 | errors after MPE RS decoding */ | 739 | errors after MPE RS decoding */ |
740 | u32 num_of_invalid_mpe_tlbs;/* Number of MPE tables which include errors | 740 | u32 num_of_invalid_mpe_tlbs;/* Number of MPE tables which include errors |
741 | after MPE RS decoding */ | 741 | after MPE RS decoding */ |
742 | u32 num_of_corrected_mpe_tlbs;/* Number of MPE tables which were | 742 | u32 num_of_corrected_mpe_tlbs;/* Number of MPE tables which were |
743 | corrected by MPE RS decoding */ | 743 | corrected by MPE RS decoding */ |
744 | /* Common params */ | 744 | /* Common params */ |
745 | u32 ber_error_count; /* Number of errornous SYNC bits. */ | 745 | u32 ber_error_count; /* Number of errornous SYNC bits. */ |
746 | u32 ber_bit_count; /* Total number of SYNC bits. */ | 746 | u32 ber_bit_count; /* Total number of SYNC bits. */ |
747 | 747 | ||
748 | /* Interface information */ | 748 | /* Interface information */ |
749 | u32 sms_to_host_tx_errors; /* Total number of transmission errors. */ | 749 | u32 sms_to_host_tx_errors; /* Total number of transmission errors. */ |
750 | 750 | ||
751 | /* DAB/T-DMB */ | 751 | /* DAB/T-DMB */ |
752 | u32 pre_ber; /* DAB/T-DMB only: Pre Viterbi BER [1E-5] */ | 752 | u32 pre_ber; /* DAB/T-DMB only: Pre Viterbi ber [1E-5] */ |
753 | 753 | ||
754 | /* DVB-H TPS parameters */ | 754 | /* DVB-H TPS parameters */ |
755 | u32 cell_id; /* TPS Cell ID in bits 15..0, bits 31..16 zero; | 755 | u32 cell_id; /* TPS Cell ID in bits 15..0, bits 31..16 zero; |
756 | if set to 0xFFFFFFFF cell_id not yet recovered */ | 756 | if set to 0xFFFFFFFF cell_id not yet recovered */ |
757 | u32 dvbh_srv_ind_hp; /* DVB-H service indication info, bit 1 - | 757 | u32 dvbh_srv_ind_hp; /* DVB-H service indication info, bit 1 - |
758 | Time Slicing indicator, bit 0 - MPE-FEC indicator */ | 758 | Time Slicing indicator, bit 0 - MPE-FEC indicator */ |
759 | u32 dvbh_srv_ind_lp; /* DVB-H service indication info, bit 1 - | 759 | u32 dvbh_srv_ind_lp; /* DVB-H service indication info, bit 1 - |
760 | Time Slicing indicator, bit 0 - MPE-FEC indicator */ | 760 | Time Slicing indicator, bit 0 - MPE-FEC indicator */ |
761 | 761 | ||
762 | u32 num_mpe_received; /* DVB-H, Num MPE section received */ | 762 | u32 num_mpe_received; /* DVB-H, Num MPE section received */ |
763 | 763 | ||
764 | u32 reservedFields[10]; /* reserved */ | 764 | u32 reservedFields[10]; /* reserved */ |
765 | }; | 765 | }; |
766 | 766 | ||
767 | struct sms_msg_statistics_info { | 767 | struct sms_msg_statistics_info { |
768 | u32 request_result; | 768 | u32 request_result; |
769 | 769 | ||
770 | struct sms_stats stat; | 770 | struct sms_stats stat; |
771 | 771 | ||
772 | /* Split the calc of the SNR in DAB */ | 772 | /* Split the calc of the SNR in DAB */ |
773 | u32 signal; /* dB */ | 773 | u32 signal; /* dB */ |
774 | u32 noise; /* dB */ | 774 | u32 noise; /* dB */ |
775 | 775 | ||
776 | }; | 776 | }; |
777 | 777 | ||
778 | struct sms_isdbt_layer_stats { | 778 | struct sms_isdbt_layer_stats { |
779 | /* Per-layer information */ | 779 | /* Per-layer information */ |
780 | u32 code_rate; /* Code Rate from SMSHOSTLIB_CODE_RATE_ET, | 780 | u32 code_rate; /* Code Rate from SMSHOSTLIB_CODE_RATE_ET, |
781 | * 255 means layer does not exist */ | 781 | * 255 means layer does not exist */ |
782 | u32 constellation; /* constellation from SMSHOSTLIB_CONSTELLATION_ET, | 782 | u32 constellation; /* constellation from SMSHOSTLIB_CONSTELLATION_ET, |
783 | * 255 means layer does not exist */ | 783 | * 255 means layer does not exist */ |
784 | u32 BER; /* Post Viterbi BER [1E-5], 0xFFFFFFFF indicate N/A */ | 784 | u32 ber; /* Post Viterbi ber [1E-5], 0xFFFFFFFF indicate N/A */ |
785 | u32 ber_error_count; /* Post Viterbi Error Bits Count */ | 785 | u32 ber_error_count; /* Post Viterbi Error Bits Count */ |
786 | u32 ber_bit_count; /* Post Viterbi Total Bits Count */ | 786 | u32 ber_bit_count; /* Post Viterbi Total Bits Count */ |
787 | u32 pre_ber; /* Pre Viterbi BER [1E-5], 0xFFFFFFFF indicate N/A */ | 787 | u32 pre_ber; /* Pre Viterbi ber [1E-5], 0xFFFFFFFF indicate N/A */ |
788 | u32 TS_PER; /* Transport stream PER [%], 0xFFFFFFFF indicate N/A */ | 788 | u32 ts_per; /* Transport stream PER [%], 0xFFFFFFFF indicate N/A */ |
789 | u32 error_ts_packets; /* Number of erroneous transport-stream packets */ | 789 | u32 error_ts_packets; /* Number of erroneous transport-stream packets */ |
790 | u32 total_ts_packets; /* Total number of transport-stream packets */ | 790 | u32 total_ts_packets; /* Total number of transport-stream packets */ |
791 | u32 ti_ldepth_i; /* Time interleaver depth I parameter, | 791 | u32 ti_ldepth_i; /* Time interleaver depth I parameter, |
792 | * 255 means layer does not exist */ | 792 | * 255 means layer does not exist */ |
793 | u32 number_of_segments; /* Number of segments in layer A, | 793 | u32 number_of_segments; /* Number of segments in layer A, |
794 | * 255 means layer does not exist */ | 794 | * 255 means layer does not exist */ |
795 | u32 tmcc_errors; /* TMCC errors */ | 795 | u32 tmcc_errors; /* TMCC errors */ |
796 | }; | 796 | }; |
797 | 797 | ||
798 | struct sms_isdbt_stats { | 798 | struct sms_isdbt_stats { |
799 | u32 statistics_type; /* Enumerator identifying the type of the | 799 | u32 statistics_type; /* Enumerator identifying the type of the |
800 | * structure. Values are the same as | 800 | * structure. Values are the same as |
801 | * SMSHOSTLIB_DEVICE_MODES_E | 801 | * SMSHOSTLIB_DEVICE_MODES_E |
802 | * | 802 | * |
803 | * This field MUST always be first in any | 803 | * This field MUST always be first in any |
804 | * statistics structure */ | 804 | * statistics structure */ |
805 | 805 | ||
806 | u32 full_size; /* Total size of the structure returned by the modem. | 806 | u32 full_size; /* Total size of the structure returned by the modem. |
807 | * If the size requested by the host is smaller than | 807 | * If the size requested by the host is smaller than |
808 | * full_size, the struct will be truncated */ | 808 | * full_size, the struct will be truncated */ |
809 | 809 | ||
810 | /* Common parameters */ | 810 | /* Common parameters */ |
811 | u32 is_rf_locked; /* 0 - not locked, 1 - locked */ | 811 | u32 is_rf_locked; /* 0 - not locked, 1 - locked */ |
812 | u32 is_demod_locked; /* 0 - not locked, 1 - locked */ | 812 | u32 is_demod_locked; /* 0 - not locked, 1 - locked */ |
813 | u32 is_external_lna_on; /* 0 - external LNA off, 1 - external LNA on */ | 813 | u32 is_external_lna_on; /* 0 - external LNA off, 1 - external LNA on */ |
814 | 814 | ||
815 | /* Reception quality */ | 815 | /* Reception quality */ |
816 | s32 SNR; /* dB */ | 816 | s32 SNR; /* dB */ |
817 | s32 RSSI; /* dBm */ | 817 | s32 RSSI; /* dBm */ |
818 | s32 in_band_pwr; /* In band power in dBM */ | 818 | s32 in_band_pwr; /* In band power in dBM */ |
819 | s32 carrier_offset; /* Carrier Offset in Hz */ | 819 | s32 carrier_offset; /* Carrier Offset in Hz */ |
820 | 820 | ||
821 | /* Transmission parameters */ | 821 | /* Transmission parameters */ |
822 | u32 frequency; /* frequency in Hz */ | 822 | u32 frequency; /* frequency in Hz */ |
823 | u32 bandwidth; /* bandwidth in MHz */ | 823 | u32 bandwidth; /* bandwidth in MHz */ |
824 | u32 transmission_mode; /* ISDB-T transmission mode */ | 824 | u32 transmission_mode; /* ISDB-T transmission mode */ |
825 | u32 modem_state; /* 0 - Acquisition, 1 - Locked */ | 825 | u32 modem_state; /* 0 - Acquisition, 1 - Locked */ |
826 | u32 guard_interval; /* Guard Interval, 1 divided by value */ | 826 | u32 guard_interval; /* Guard Interval, 1 divided by value */ |
827 | u32 system_type; /* ISDB-T system type (ISDB-T / ISDB-Tsb) */ | 827 | u32 system_type; /* ISDB-T system type (ISDB-T / ISDB-Tsb) */ |
828 | u32 partial_reception; /* TRUE - partial reception, FALSE otherwise */ | 828 | u32 partial_reception; /* TRUE - partial reception, FALSE otherwise */ |
829 | u32 num_of_layers; /* Number of ISDB-T layers in the network */ | 829 | u32 num_of_layers; /* Number of ISDB-T layers in the network */ |
830 | 830 | ||
831 | /* Per-layer information */ | 831 | /* Per-layer information */ |
832 | /* Layers A, B and C */ | 832 | /* Layers A, B and C */ |
833 | struct sms_isdbt_layer_stats LayerInfo[3]; | 833 | struct sms_isdbt_layer_stats layer_info[3]; |
834 | /* Per-layer statistics, see sms_isdbt_layer_stats */ | 834 | /* Per-layer statistics, see sms_isdbt_layer_stats */ |
835 | 835 | ||
836 | /* Interface information */ | 836 | /* Interface information */ |
837 | u32 sms_to_host_tx_errors; /* Total number of transmission errors. */ | 837 | u32 sms_to_host_tx_errors; /* Total number of transmission errors. */ |
838 | }; | 838 | }; |
839 | 839 | ||
840 | struct sms_isdbt_stats_ex { | 840 | struct sms_isdbt_stats_ex { |
841 | u32 statistics_type; /* Enumerator identifying the type of the | 841 | u32 statistics_type; /* Enumerator identifying the type of the |
842 | * structure. Values are the same as | 842 | * structure. Values are the same as |
843 | * SMSHOSTLIB_DEVICE_MODES_E | 843 | * SMSHOSTLIB_DEVICE_MODES_E |
844 | * | 844 | * |
845 | * This field MUST always be first in any | 845 | * This field MUST always be first in any |
846 | * statistics structure */ | 846 | * statistics structure */ |
847 | 847 | ||
848 | u32 full_size; /* Total size of the structure returned by the modem. | 848 | u32 full_size; /* Total size of the structure returned by the modem. |
849 | * If the size requested by the host is smaller than | 849 | * If the size requested by the host is smaller than |
850 | * full_size, the struct will be truncated */ | 850 | * full_size, the struct will be truncated */ |
851 | 851 | ||
852 | /* Common parameters */ | 852 | /* Common parameters */ |
853 | u32 is_rf_locked; /* 0 - not locked, 1 - locked */ | 853 | u32 is_rf_locked; /* 0 - not locked, 1 - locked */ |
854 | u32 is_demod_locked; /* 0 - not locked, 1 - locked */ | 854 | u32 is_demod_locked; /* 0 - not locked, 1 - locked */ |
855 | u32 is_external_lna_on; /* 0 - external LNA off, 1 - external LNA on */ | 855 | u32 is_external_lna_on; /* 0 - external LNA off, 1 - external LNA on */ |
856 | 856 | ||
857 | /* Reception quality */ | 857 | /* Reception quality */ |
858 | s32 SNR; /* dB */ | 858 | s32 SNR; /* dB */ |
859 | s32 RSSI; /* dBm */ | 859 | s32 RSSI; /* dBm */ |
860 | s32 in_band_pwr; /* In band power in dBM */ | 860 | s32 in_band_pwr; /* In band power in dBM */ |
861 | s32 carrier_offset; /* Carrier Offset in Hz */ | 861 | s32 carrier_offset; /* Carrier Offset in Hz */ |
862 | 862 | ||
863 | /* Transmission parameters */ | 863 | /* Transmission parameters */ |
864 | u32 frequency; /* frequency in Hz */ | 864 | u32 frequency; /* frequency in Hz */ |
865 | u32 bandwidth; /* bandwidth in MHz */ | 865 | u32 bandwidth; /* bandwidth in MHz */ |
866 | u32 transmission_mode; /* ISDB-T transmission mode */ | 866 | u32 transmission_mode; /* ISDB-T transmission mode */ |
867 | u32 modem_state; /* 0 - Acquisition, 1 - Locked */ | 867 | u32 modem_state; /* 0 - Acquisition, 1 - Locked */ |
868 | u32 guard_interval; /* Guard Interval, 1 divided by value */ | 868 | u32 guard_interval; /* Guard Interval, 1 divided by value */ |
869 | u32 system_type; /* ISDB-T system type (ISDB-T / ISDB-Tsb) */ | 869 | u32 system_type; /* ISDB-T system type (ISDB-T / ISDB-Tsb) */ |
870 | u32 partial_reception; /* TRUE - partial reception, FALSE otherwise */ | 870 | u32 partial_reception; /* TRUE - partial reception, FALSE otherwise */ |
871 | u32 num_of_layers; /* Number of ISDB-T layers in the network */ | 871 | u32 num_of_layers; /* Number of ISDB-T layers in the network */ |
872 | 872 | ||
873 | u32 segment_number; /* Segment number for ISDB-Tsb */ | 873 | u32 segment_number; /* Segment number for ISDB-Tsb */ |
874 | u32 tune_bw; /* Tuned bandwidth - BW_ISDBT_1SEG / BW_ISDBT_3SEG */ | 874 | u32 tune_bw; /* Tuned bandwidth - BW_ISDBT_1SEG / BW_ISDBT_3SEG */ |
875 | 875 | ||
876 | /* Per-layer information */ | 876 | /* Per-layer information */ |
877 | /* Layers A, B and C */ | 877 | /* Layers A, B and C */ |
878 | struct sms_isdbt_layer_stats LayerInfo[3]; | 878 | struct sms_isdbt_layer_stats layer_info[3]; |
879 | /* Per-layer statistics, see sms_isdbt_layer_stats */ | 879 | /* Per-layer statistics, see sms_isdbt_layer_stats */ |
880 | 880 | ||
881 | /* Interface information */ | 881 | /* Interface information */ |
882 | u32 reserved1; /* Was sms_to_host_tx_errors - obsolete . */ | 882 | u32 reserved1; /* Was sms_to_host_tx_errors - obsolete . */ |
883 | /* Proprietary information */ | 883 | /* Proprietary information */ |
884 | u32 ext_antenna; /* Obsolete field. */ | 884 | u32 ext_antenna; /* Obsolete field. */ |
885 | u32 reception_quality; | 885 | u32 reception_quality; |
886 | u32 ews_alert_active; /* signals if EWS alert is currently on */ | 886 | u32 ews_alert_active; /* signals if EWS alert is currently on */ |
887 | u32 lna_on_off; /* Internal LNA state: 0: OFF, 1: ON */ | 887 | u32 lna_on_off; /* Internal LNA state: 0: OFF, 1: ON */ |
888 | 888 | ||
889 | u32 rf_agc_level; /* RF AGC Level [linear units], full gain = 65535 (20dB) */ | 889 | u32 rf_agc_level; /* RF AGC Level [linear units], full gain = 65535 (20dB) */ |
890 | u32 bb_agc_level; /* Baseband AGC level [linear units], full gain = 65535 (71.5dB) */ | 890 | u32 bb_agc_level; /* Baseband AGC level [linear units], full gain = 65535 (71.5dB) */ |
891 | u32 fw_errors_counter; /* Application errors - should be always zero */ | 891 | u32 fw_errors_counter; /* Application errors - should be always zero */ |
892 | u8 FwErrorsHistoryArr[8]; /* Last FW errors IDs - first is most recent, last is oldest */ | 892 | u8 FwErrorsHistoryArr[8]; /* Last FW errors IDs - first is most recent, last is oldest */ |
893 | 893 | ||
894 | s32 MRC_SNR; /* dB */ | 894 | s32 MRC_SNR; /* dB */ |
895 | u32 snr_full_res; /* dB x 65536 */ | 895 | u32 snr_full_res; /* dB x 65536 */ |
896 | u32 reserved4[4]; | 896 | u32 reserved4[4]; |
897 | }; | 897 | }; |
898 | 898 | ||
899 | 899 | ||
900 | struct sms_pid_stats_data { | 900 | struct sms_pid_stats_data { |
901 | struct PID_BURST_S { | 901 | struct PID_BURST_S { |
902 | u32 size; | 902 | u32 size; |
903 | u32 padding_cols; | 903 | u32 padding_cols; |
904 | u32 punct_cols; | 904 | u32 punct_cols; |
905 | u32 duration; | 905 | u32 duration; |
906 | u32 cycle; | 906 | u32 cycle; |
907 | u32 calc_cycle; | 907 | u32 calc_cycle; |
908 | } burst; | 908 | } burst; |
909 | 909 | ||
910 | u32 tot_tbl_cnt; | 910 | u32 tot_tbl_cnt; |
911 | u32 invalid_tbl_cnt; | 911 | u32 invalid_tbl_cnt; |
912 | u32 tot_cor_tbl; | 912 | u32 tot_cor_tbl; |
913 | }; | 913 | }; |
914 | 914 | ||
915 | struct sms_pid_data { | 915 | struct sms_pid_data { |
916 | u32 pid; | 916 | u32 pid; |
917 | u32 num_rows; | 917 | u32 num_rows; |
918 | struct sms_pid_stats_data pid_statistics; | 918 | struct sms_pid_stats_data pid_statistics; |
919 | }; | 919 | }; |
920 | 920 | ||
921 | #define CORRECT_STAT_RSSI(_stat) ((_stat).RSSI *= -1) | 921 | #define CORRECT_STAT_RSSI(_stat) ((_stat).RSSI *= -1) |
922 | #define CORRECT_STAT_BANDWIDTH(_stat) (_stat.bandwidth = 8 - _stat.bandwidth) | 922 | #define CORRECT_STAT_BANDWIDTH(_stat) (_stat.bandwidth = 8 - _stat.bandwidth) |
923 | #define CORRECT_STAT_TRANSMISSON_MODE(_stat) \ | 923 | #define CORRECT_STAT_TRANSMISSON_MODE(_stat) \ |
924 | if (_stat.transmission_mode == 0) \ | 924 | if (_stat.transmission_mode == 0) \ |
925 | _stat.transmission_mode = 2; \ | 925 | _stat.transmission_mode = 2; \ |
926 | else if (_stat.transmission_mode == 1) \ | 926 | else if (_stat.transmission_mode == 1) \ |
927 | _stat.transmission_mode = 8; \ | 927 | _stat.transmission_mode = 8; \ |
928 | else \ | 928 | else \ |
929 | _stat.transmission_mode = 4; | 929 | _stat.transmission_mode = 4; |
930 | 930 | ||
931 | struct sms_tx_stats { | 931 | struct sms_tx_stats { |
932 | u32 frequency; /* frequency in Hz */ | 932 | u32 frequency; /* frequency in Hz */ |
933 | u32 bandwidth; /* bandwidth in MHz */ | 933 | u32 bandwidth; /* bandwidth in MHz */ |
934 | u32 transmission_mode; /* FFT mode carriers in Kilos */ | 934 | u32 transmission_mode; /* FFT mode carriers in Kilos */ |
935 | u32 guard_interval; /* Guard Interval from | 935 | u32 guard_interval; /* Guard Interval from |
936 | SMSHOSTLIB_GUARD_INTERVALS_ET */ | 936 | SMSHOSTLIB_GUARD_INTERVALS_ET */ |
937 | u32 code_rate; /* Code Rate from SMSHOSTLIB_CODE_RATE_ET */ | 937 | u32 code_rate; /* Code Rate from SMSHOSTLIB_CODE_RATE_ET */ |
938 | u32 lp_code_rate; /* Low Priority Code Rate from | 938 | u32 lp_code_rate; /* Low Priority Code Rate from |
939 | SMSHOSTLIB_CODE_RATE_ET */ | 939 | SMSHOSTLIB_CODE_RATE_ET */ |
940 | u32 hierarchy; /* hierarchy from SMSHOSTLIB_HIERARCHY_ET */ | 940 | u32 hierarchy; /* hierarchy from SMSHOSTLIB_HIERARCHY_ET */ |
941 | u32 constellation; /* constellation from | 941 | u32 constellation; /* constellation from |
942 | SMSHOSTLIB_CONSTELLATION_ET */ | 942 | SMSHOSTLIB_CONSTELLATION_ET */ |
943 | 943 | ||
944 | /* DVB-H TPS parameters */ | 944 | /* DVB-H TPS parameters */ |
945 | u32 cell_id; /* TPS Cell ID in bits 15..0, bits 31..16 zero; | 945 | u32 cell_id; /* TPS Cell ID in bits 15..0, bits 31..16 zero; |
946 | if set to 0xFFFFFFFF cell_id not yet recovered */ | 946 | if set to 0xFFFFFFFF cell_id not yet recovered */ |
947 | u32 dvbh_srv_ind_hp; /* DVB-H service indication info, bit 1 - | 947 | u32 dvbh_srv_ind_hp; /* DVB-H service indication info, bit 1 - |
948 | Time Slicing indicator, bit 0 - MPE-FEC indicator */ | 948 | Time Slicing indicator, bit 0 - MPE-FEC indicator */ |
949 | u32 dvbh_srv_ind_lp; /* DVB-H service indication info, bit 1 - | 949 | u32 dvbh_srv_ind_lp; /* DVB-H service indication info, bit 1 - |
950 | Time Slicing indicator, bit 0 - MPE-FEC indicator */ | 950 | Time Slicing indicator, bit 0 - MPE-FEC indicator */ |
951 | u32 is_demod_locked; /* 0 - not locked, 1 - locked */ | 951 | u32 is_demod_locked; /* 0 - not locked, 1 - locked */ |
952 | }; | 952 | }; |
953 | 953 | ||
954 | struct sms_rx_stats { | 954 | struct sms_rx_stats { |
955 | u32 is_rf_locked; /* 0 - not locked, 1 - locked */ | 955 | u32 is_rf_locked; /* 0 - not locked, 1 - locked */ |
956 | u32 is_demod_locked; /* 0 - not locked, 1 - locked */ | 956 | u32 is_demod_locked; /* 0 - not locked, 1 - locked */ |
957 | u32 is_external_lna_on; /* 0 - external LNA off, 1 - external LNA on */ | 957 | u32 is_external_lna_on; /* 0 - external LNA off, 1 - external LNA on */ |
958 | 958 | ||
959 | u32 modem_state; /* from SMSHOSTLIB_DVB_MODEM_STATE_ET */ | 959 | u32 modem_state; /* from SMSHOSTLIB_DVB_MODEM_STATE_ET */ |
960 | s32 SNR; /* dB */ | 960 | s32 SNR; /* dB */ |
961 | u32 BER; /* Post Viterbi BER [1E-5] */ | 961 | u32 ber; /* Post Viterbi ber [1E-5] */ |
962 | u32 ber_error_count; /* Number of erronous SYNC bits. */ | 962 | u32 ber_error_count; /* Number of erronous SYNC bits. */ |
963 | u32 ber_bit_count; /* Total number of SYNC bits. */ | 963 | u32 ber_bit_count; /* Total number of SYNC bits. */ |
964 | u32 TS_PER; /* Transport stream PER, | 964 | u32 ts_per; /* Transport stream PER, |
965 | 0xFFFFFFFF indicate N/A */ | 965 | 0xFFFFFFFF indicate N/A */ |
966 | u32 MFER; /* DVB-H frame error rate in percentage, | 966 | u32 MFER; /* DVB-H frame error rate in percentage, |
967 | 0xFFFFFFFF indicate N/A, valid only for DVB-H */ | 967 | 0xFFFFFFFF indicate N/A, valid only for DVB-H */ |
968 | s32 RSSI; /* dBm */ | 968 | s32 RSSI; /* dBm */ |
969 | s32 in_band_pwr; /* In band power in dBM */ | 969 | s32 in_band_pwr; /* In band power in dBM */ |
970 | s32 carrier_offset; /* Carrier Offset in bin/1024 */ | 970 | s32 carrier_offset; /* Carrier Offset in bin/1024 */ |
971 | u32 error_ts_packets; /* Number of erroneous | 971 | u32 error_ts_packets; /* Number of erroneous |
972 | transport-stream packets */ | 972 | transport-stream packets */ |
973 | u32 total_ts_packets; /* Total number of transport-stream packets */ | 973 | u32 total_ts_packets; /* Total number of transport-stream packets */ |
974 | 974 | ||
975 | s32 MRC_SNR; /* dB */ | 975 | s32 MRC_SNR; /* dB */ |
976 | s32 MRC_RSSI; /* dBm */ | 976 | s32 MRC_RSSI; /* dBm */ |
977 | s32 mrc_in_band_pwr; /* In band power in dBM */ | 977 | s32 mrc_in_band_pwr; /* In band power in dBM */ |
978 | }; | 978 | }; |
979 | 979 | ||
980 | struct sms_rx_stats_ex { | 980 | struct sms_rx_stats_ex { |
981 | u32 is_rf_locked; /* 0 - not locked, 1 - locked */ | 981 | u32 is_rf_locked; /* 0 - not locked, 1 - locked */ |
982 | u32 is_demod_locked; /* 0 - not locked, 1 - locked */ | 982 | u32 is_demod_locked; /* 0 - not locked, 1 - locked */ |
983 | u32 is_external_lna_on; /* 0 - external LNA off, 1 - external LNA on */ | 983 | u32 is_external_lna_on; /* 0 - external LNA off, 1 - external LNA on */ |
984 | 984 | ||
985 | u32 modem_state; /* from SMSHOSTLIB_DVB_MODEM_STATE_ET */ | 985 | u32 modem_state; /* from SMSHOSTLIB_DVB_MODEM_STATE_ET */ |
986 | s32 SNR; /* dB */ | 986 | s32 SNR; /* dB */ |
987 | u32 BER; /* Post Viterbi BER [1E-5] */ | 987 | u32 ber; /* Post Viterbi ber [1E-5] */ |
988 | u32 ber_error_count; /* Number of erronous SYNC bits. */ | 988 | u32 ber_error_count; /* Number of erronous SYNC bits. */ |
989 | u32 ber_bit_count; /* Total number of SYNC bits. */ | 989 | u32 ber_bit_count; /* Total number of SYNC bits. */ |
990 | u32 TS_PER; /* Transport stream PER, | 990 | u32 ts_per; /* Transport stream PER, |
991 | 0xFFFFFFFF indicate N/A */ | 991 | 0xFFFFFFFF indicate N/A */ |
992 | u32 MFER; /* DVB-H frame error rate in percentage, | 992 | u32 MFER; /* DVB-H frame error rate in percentage, |
993 | 0xFFFFFFFF indicate N/A, valid only for DVB-H */ | 993 | 0xFFFFFFFF indicate N/A, valid only for DVB-H */ |
994 | s32 RSSI; /* dBm */ | 994 | s32 RSSI; /* dBm */ |
995 | s32 in_band_pwr; /* In band power in dBM */ | 995 | s32 in_band_pwr; /* In band power in dBM */ |
996 | s32 carrier_offset; /* Carrier Offset in bin/1024 */ | 996 | s32 carrier_offset; /* Carrier Offset in bin/1024 */ |
997 | u32 error_ts_packets; /* Number of erroneous | 997 | u32 error_ts_packets; /* Number of erroneous |
998 | transport-stream packets */ | 998 | transport-stream packets */ |
999 | u32 total_ts_packets; /* Total number of transport-stream packets */ | 999 | u32 total_ts_packets; /* Total number of transport-stream packets */ |
1000 | 1000 | ||
1001 | s32 ref_dev_ppm; | 1001 | s32 ref_dev_ppm; |
1002 | s32 freq_dev_hz; | 1002 | s32 freq_dev_hz; |
1003 | 1003 | ||
1004 | s32 MRC_SNR; /* dB */ | 1004 | s32 MRC_SNR; /* dB */ |
1005 | s32 MRC_RSSI; /* dBm */ | 1005 | s32 MRC_RSSI; /* dBm */ |
1006 | s32 mrc_in_band_pwr; /* In band power in dBM */ | 1006 | s32 mrc_in_band_pwr; /* In band power in dBM */ |
1007 | }; | 1007 | }; |
1008 | 1008 | ||
1009 | 1009 | ||
1010 | /* statistics information returned as response for | 1010 | /* statistics information returned as response for |
1011 | * SmsHostApiGetstatisticsEx_Req for DVB applications, SMS1100 and up */ | 1011 | * SmsHostApiGetstatisticsEx_Req for DVB applications, SMS1100 and up */ |
1012 | struct sms_stats_dvb { | 1012 | struct sms_stats_dvb { |
1013 | /* Reception */ | 1013 | /* Reception */ |
1014 | struct sms_rx_stats reception_data; | 1014 | struct sms_rx_stats reception_data; |
1015 | 1015 | ||
1016 | /* Transmission parameters */ | 1016 | /* Transmission parameters */ |
1017 | struct sms_tx_stats transmission_data; | 1017 | struct sms_tx_stats transmission_data; |
1018 | 1018 | ||
1019 | /* Burst parameters, valid only for DVB-H */ | 1019 | /* Burst parameters, valid only for DVB-H */ |
1020 | #define SRVM_MAX_PID_FILTERS 8 | 1020 | #define SRVM_MAX_PID_FILTERS 8 |
1021 | struct sms_pid_data pid_data[SRVM_MAX_PID_FILTERS]; | 1021 | struct sms_pid_data pid_data[SRVM_MAX_PID_FILTERS]; |
1022 | }; | 1022 | }; |
1023 | 1023 | ||
1024 | /* statistics information returned as response for | 1024 | /* statistics information returned as response for |
1025 | * SmsHostApiGetstatisticsEx_Req for DVB applications, SMS1100 and up */ | 1025 | * SmsHostApiGetstatisticsEx_Req for DVB applications, SMS1100 and up */ |
1026 | struct sms_stats_dvb_ex { | 1026 | struct sms_stats_dvb_ex { |
1027 | /* Reception */ | 1027 | /* Reception */ |
1028 | struct sms_rx_stats_ex reception_data; | 1028 | struct sms_rx_stats_ex reception_data; |
1029 | 1029 | ||
1030 | /* Transmission parameters */ | 1030 | /* Transmission parameters */ |
1031 | struct sms_tx_stats transmission_data; | 1031 | struct sms_tx_stats transmission_data; |
1032 | 1032 | ||
1033 | /* Burst parameters, valid only for DVB-H */ | 1033 | /* Burst parameters, valid only for DVB-H */ |
1034 | #define SRVM_MAX_PID_FILTERS 8 | 1034 | #define SRVM_MAX_PID_FILTERS 8 |
1035 | struct sms_pid_data pid_data[SRVM_MAX_PID_FILTERS]; | 1035 | struct sms_pid_data pid_data[SRVM_MAX_PID_FILTERS]; |
1036 | }; | 1036 | }; |
1037 | 1037 | ||
1038 | struct sms_srvm_signal_status { | 1038 | struct sms_srvm_signal_status { |
1039 | u32 result; | 1039 | u32 result; |
1040 | u32 snr; | 1040 | u32 snr; |
1041 | u32 ts_packets; | 1041 | u32 ts_packets; |
1042 | u32 ets_packets; | 1042 | u32 ets_packets; |
1043 | u32 constellation; | 1043 | u32 constellation; |
1044 | u32 hp_code; | 1044 | u32 hp_code; |
1045 | u32 tps_srv_ind_lp; | 1045 | u32 tps_srv_ind_lp; |
1046 | u32 tps_srv_ind_hp; | 1046 | u32 tps_srv_ind_hp; |
1047 | u32 cell_id; | 1047 | u32 cell_id; |
1048 | u32 reason; | 1048 | u32 reason; |
1049 | 1049 | ||
1050 | s32 in_band_power; | 1050 | s32 in_band_power; |
1051 | u32 request_id; | 1051 | u32 request_id; |
1052 | }; | 1052 | }; |
1053 | 1053 | ||
1054 | struct sms_i2c_req { | 1054 | struct sms_i2c_req { |
1055 | u32 device_address; /* I2c device address */ | 1055 | u32 device_address; /* I2c device address */ |
1056 | u32 write_count; /* number of bytes to write */ | 1056 | u32 write_count; /* number of bytes to write */ |
1057 | u32 read_count; /* number of bytes to read */ | 1057 | u32 read_count; /* number of bytes to read */ |
1058 | u8 Data[1]; | 1058 | u8 Data[1]; |
1059 | }; | 1059 | }; |
1060 | 1060 | ||
1061 | struct sms_i2c_res { | 1061 | struct sms_i2c_res { |
1062 | u32 status; /* non-zero value in case of failure */ | 1062 | u32 status; /* non-zero value in case of failure */ |
1063 | u32 read_count; /* number of bytes read */ | 1063 | u32 read_count; /* number of bytes read */ |
1064 | u8 Data[1]; | 1064 | u8 Data[1]; |
1065 | }; | 1065 | }; |
1066 | 1066 | ||
1067 | 1067 | ||
1068 | struct smscore_config_gpio { | 1068 | struct smscore_config_gpio { |
1069 | #define SMS_GPIO_DIRECTION_INPUT 0 | 1069 | #define SMS_GPIO_DIRECTION_INPUT 0 |
1070 | #define SMS_GPIO_DIRECTION_OUTPUT 1 | 1070 | #define SMS_GPIO_DIRECTION_OUTPUT 1 |
1071 | u8 direction; | 1071 | u8 direction; |
1072 | 1072 | ||
1073 | #define SMS_GPIO_PULLUPDOWN_NONE 0 | 1073 | #define SMS_GPIO_PULLUPDOWN_NONE 0 |
1074 | #define SMS_GPIO_PULLUPDOWN_PULLDOWN 1 | 1074 | #define SMS_GPIO_PULLUPDOWN_PULLDOWN 1 |
1075 | #define SMS_GPIO_PULLUPDOWN_PULLUP 2 | 1075 | #define SMS_GPIO_PULLUPDOWN_PULLUP 2 |
1076 | #define SMS_GPIO_PULLUPDOWN_KEEPER 3 | 1076 | #define SMS_GPIO_PULLUPDOWN_KEEPER 3 |
1077 | u8 pullupdown; | 1077 | u8 pullupdown; |
1078 | 1078 | ||
1079 | #define SMS_GPIO_INPUTCHARACTERISTICS_NORMAL 0 | 1079 | #define SMS_GPIO_INPUTCHARACTERISTICS_NORMAL 0 |
1080 | #define SMS_GPIO_INPUTCHARACTERISTICS_SCHMITT 1 | 1080 | #define SMS_GPIO_INPUTCHARACTERISTICS_SCHMITT 1 |
1081 | u8 inputcharacteristics; | 1081 | u8 inputcharacteristics; |
1082 | 1082 | ||
1083 | /* 10xx */ | 1083 | /* 10xx */ |
1084 | #define SMS_GPIO_OUTPUT_SLEW_RATE_FAST 0 | 1084 | #define SMS_GPIO_OUTPUT_SLEW_RATE_FAST 0 |
1085 | #define SMS_GPIO_OUTPUT_SLEW_WRATE_SLOW 1 | 1085 | #define SMS_GPIO_OUTPUT_SLEW_WRATE_SLOW 1 |
1086 | 1086 | ||
1087 | /* 11xx */ | 1087 | /* 11xx */ |
1088 | #define SMS_GPIO_OUTPUT_SLEW_RATE_0_45_V_NS 0 | 1088 | #define SMS_GPIO_OUTPUT_SLEW_RATE_0_45_V_NS 0 |
1089 | #define SMS_GPIO_OUTPUT_SLEW_RATE_0_9_V_NS 1 | 1089 | #define SMS_GPIO_OUTPUT_SLEW_RATE_0_9_V_NS 1 |
1090 | #define SMS_GPIO_OUTPUT_SLEW_RATE_1_7_V_NS 2 | 1090 | #define SMS_GPIO_OUTPUT_SLEW_RATE_1_7_V_NS 2 |
1091 | #define SMS_GPIO_OUTPUT_SLEW_RATE_3_3_V_NS 3 | 1091 | #define SMS_GPIO_OUTPUT_SLEW_RATE_3_3_V_NS 3 |
1092 | 1092 | ||
1093 | u8 outputslewrate; | 1093 | u8 outputslewrate; |
1094 | 1094 | ||
1095 | /* 10xx */ | 1095 | /* 10xx */ |
1096 | #define SMS_GPIO_OUTPUTDRIVING_S_4mA 0 | 1096 | #define SMS_GPIO_OUTPUTDRIVING_S_4mA 0 |
1097 | #define SMS_GPIO_OUTPUTDRIVING_S_8mA 1 | 1097 | #define SMS_GPIO_OUTPUTDRIVING_S_8mA 1 |
1098 | #define SMS_GPIO_OUTPUTDRIVING_S_12mA 2 | 1098 | #define SMS_GPIO_OUTPUTDRIVING_S_12mA 2 |
1099 | #define SMS_GPIO_OUTPUTDRIVING_S_16mA 3 | 1099 | #define SMS_GPIO_OUTPUTDRIVING_S_16mA 3 |
1100 | 1100 | ||
1101 | /* 11xx*/ | 1101 | /* 11xx*/ |
1102 | #define SMS_GPIO_OUTPUTDRIVING_1_5mA 0 | 1102 | #define SMS_GPIO_OUTPUTDRIVING_1_5mA 0 |
1103 | #define SMS_GPIO_OUTPUTDRIVING_2_8mA 1 | 1103 | #define SMS_GPIO_OUTPUTDRIVING_2_8mA 1 |
1104 | #define SMS_GPIO_OUTPUTDRIVING_4mA 2 | 1104 | #define SMS_GPIO_OUTPUTDRIVING_4mA 2 |
1105 | #define SMS_GPIO_OUTPUTDRIVING_7mA 3 | 1105 | #define SMS_GPIO_OUTPUTDRIVING_7mA 3 |
1106 | #define SMS_GPIO_OUTPUTDRIVING_10mA 4 | 1106 | #define SMS_GPIO_OUTPUTDRIVING_10mA 4 |
1107 | #define SMS_GPIO_OUTPUTDRIVING_11mA 5 | 1107 | #define SMS_GPIO_OUTPUTDRIVING_11mA 5 |
1108 | #define SMS_GPIO_OUTPUTDRIVING_14mA 6 | 1108 | #define SMS_GPIO_OUTPUTDRIVING_14mA 6 |
1109 | #define SMS_GPIO_OUTPUTDRIVING_16mA 7 | 1109 | #define SMS_GPIO_OUTPUTDRIVING_16mA 7 |
1110 | 1110 | ||
1111 | u8 outputdriving; | 1111 | u8 outputdriving; |
1112 | }; | 1112 | }; |
1113 | 1113 | ||
1114 | char *smscore_translate_msg(enum msg_types msgtype); | 1114 | char *smscore_translate_msg(enum msg_types msgtype); |
1115 | 1115 | ||
1116 | extern int smscore_registry_getmode(char *devpath); | 1116 | extern int smscore_registry_getmode(char *devpath); |
1117 | 1117 | ||
1118 | extern int smscore_register_hotplug(hotplug_t hotplug); | 1118 | extern int smscore_register_hotplug(hotplug_t hotplug); |
1119 | extern void smscore_unregister_hotplug(hotplug_t hotplug); | 1119 | extern void smscore_unregister_hotplug(hotplug_t hotplug); |
1120 | 1120 | ||
1121 | extern int smscore_register_device(struct smsdevice_params_t *params, | 1121 | extern int smscore_register_device(struct smsdevice_params_t *params, |
1122 | struct smscore_device_t **coredev); | 1122 | struct smscore_device_t **coredev); |
1123 | extern void smscore_unregister_device(struct smscore_device_t *coredev); | 1123 | extern void smscore_unregister_device(struct smscore_device_t *coredev); |
1124 | 1124 | ||
1125 | extern int smscore_start_device(struct smscore_device_t *coredev); | 1125 | extern int smscore_start_device(struct smscore_device_t *coredev); |
1126 | extern int smscore_load_firmware(struct smscore_device_t *coredev, | 1126 | extern int smscore_load_firmware(struct smscore_device_t *coredev, |
1127 | char *filename, | 1127 | char *filename, |
1128 | loadfirmware_t loadfirmware_handler); | 1128 | loadfirmware_t loadfirmware_handler); |
1129 | 1129 | ||
1130 | extern int smscore_set_device_mode(struct smscore_device_t *coredev, int mode); | 1130 | extern int smscore_set_device_mode(struct smscore_device_t *coredev, int mode); |
1131 | extern int smscore_get_device_mode(struct smscore_device_t *coredev); | 1131 | extern int smscore_get_device_mode(struct smscore_device_t *coredev); |
1132 | 1132 | ||
1133 | extern int smscore_register_client(struct smscore_device_t *coredev, | 1133 | extern int smscore_register_client(struct smscore_device_t *coredev, |
1134 | struct smsclient_params_t *params, | 1134 | struct smsclient_params_t *params, |
1135 | struct smscore_client_t **client); | 1135 | struct smscore_client_t **client); |
1136 | extern void smscore_unregister_client(struct smscore_client_t *client); | 1136 | extern void smscore_unregister_client(struct smscore_client_t *client); |
1137 | 1137 | ||
1138 | extern int smsclient_sendrequest(struct smscore_client_t *client, | 1138 | extern int smsclient_sendrequest(struct smscore_client_t *client, |
1139 | void *buffer, size_t size); | 1139 | void *buffer, size_t size); |
1140 | extern void smscore_onresponse(struct smscore_device_t *coredev, | 1140 | extern void smscore_onresponse(struct smscore_device_t *coredev, |
1141 | struct smscore_buffer_t *cb); | 1141 | struct smscore_buffer_t *cb); |
1142 | 1142 | ||
1143 | extern int smscore_get_common_buffer_size(struct smscore_device_t *coredev); | 1143 | extern int smscore_get_common_buffer_size(struct smscore_device_t *coredev); |
1144 | extern int smscore_map_common_buffer(struct smscore_device_t *coredev, | 1144 | extern int smscore_map_common_buffer(struct smscore_device_t *coredev, |
1145 | struct vm_area_struct *vma); | 1145 | struct vm_area_struct *vma); |
1146 | extern int smscore_send_fw_file(struct smscore_device_t *coredev, | 1146 | extern int smscore_send_fw_file(struct smscore_device_t *coredev, |
1147 | u8 *ufwbuf, int size); | 1147 | u8 *ufwbuf, int size); |
1148 | 1148 | ||
1149 | extern | 1149 | extern |
1150 | struct smscore_buffer_t *smscore_getbuffer(struct smscore_device_t *coredev); | 1150 | struct smscore_buffer_t *smscore_getbuffer(struct smscore_device_t *coredev); |
1151 | extern void smscore_putbuffer(struct smscore_device_t *coredev, | 1151 | extern void smscore_putbuffer(struct smscore_device_t *coredev, |
1152 | struct smscore_buffer_t *cb); | 1152 | struct smscore_buffer_t *cb); |
1153 | 1153 | ||
1154 | /* old GPIO management */ | 1154 | /* old GPIO management */ |
1155 | int smscore_configure_gpio(struct smscore_device_t *coredev, u32 pin, | 1155 | int smscore_configure_gpio(struct smscore_device_t *coredev, u32 pin, |
1156 | struct smscore_config_gpio *pinconfig); | 1156 | struct smscore_config_gpio *pinconfig); |
1157 | int smscore_set_gpio(struct smscore_device_t *coredev, u32 pin, int level); | 1157 | int smscore_set_gpio(struct smscore_device_t *coredev, u32 pin, int level); |
1158 | 1158 | ||
1159 | /* new GPIO management */ | 1159 | /* new GPIO management */ |
1160 | extern int smscore_gpio_configure(struct smscore_device_t *coredev, u8 pin_num, | 1160 | extern int smscore_gpio_configure(struct smscore_device_t *coredev, u8 pin_num, |
1161 | struct smscore_config_gpio *p_gpio_config); | 1161 | struct smscore_config_gpio *p_gpio_config); |
1162 | extern int smscore_gpio_set_level(struct smscore_device_t *coredev, u8 pin_num, | 1162 | extern int smscore_gpio_set_level(struct smscore_device_t *coredev, u8 pin_num, |
1163 | u8 new_level); | 1163 | u8 new_level); |
1164 | extern int smscore_gpio_get_level(struct smscore_device_t *coredev, u8 pin_num, | 1164 | extern int smscore_gpio_get_level(struct smscore_device_t *coredev, u8 pin_num, |
1165 | u8 *level); | 1165 | u8 *level); |
1166 | 1166 | ||
1167 | void smscore_set_board_id(struct smscore_device_t *core, int id); | 1167 | void smscore_set_board_id(struct smscore_device_t *core, int id); |
1168 | int smscore_get_board_id(struct smscore_device_t *core); | 1168 | int smscore_get_board_id(struct smscore_device_t *core); |
1169 | 1169 | ||
1170 | int smscore_led_state(struct smscore_device_t *core, int led); | 1170 | int smscore_led_state(struct smscore_device_t *core, int led); |
1171 | 1171 | ||
1172 | 1172 | ||
1173 | /* ------------------------------------------------------------------------ */ | 1173 | /* ------------------------------------------------------------------------ */ |
1174 | 1174 | ||
1175 | #define DBG_INFO 1 | 1175 | #define DBG_INFO 1 |
1176 | #define DBG_ADV 2 | 1176 | #define DBG_ADV 2 |
1177 | 1177 | ||
1178 | #define sms_printk(kern, fmt, arg...) \ | 1178 | #define sms_printk(kern, fmt, arg...) \ |
1179 | printk(kern "%s: " fmt "\n", __func__, ##arg) | 1179 | printk(kern "%s: " fmt "\n", __func__, ##arg) |
1180 | 1180 | ||
1181 | #define dprintk(kern, lvl, fmt, arg...) do {\ | 1181 | #define dprintk(kern, lvl, fmt, arg...) do {\ |
1182 | if (sms_dbg & lvl) \ | 1182 | if (sms_dbg & lvl) \ |
1183 | sms_printk(kern, fmt, ##arg); \ | 1183 | sms_printk(kern, fmt, ##arg); \ |
1184 | } while (0) | 1184 | } while (0) |
1185 | 1185 | ||
1186 | #define sms_log(fmt, arg...) sms_printk(KERN_INFO, fmt, ##arg) | 1186 | #define sms_log(fmt, arg...) sms_printk(KERN_INFO, fmt, ##arg) |
1187 | #define sms_err(fmt, arg...) \ | 1187 | #define sms_err(fmt, arg...) \ |
1188 | sms_printk(KERN_ERR, "line: %d: " fmt, __LINE__, ##arg) | 1188 | sms_printk(KERN_ERR, "line: %d: " fmt, __LINE__, ##arg) |
1189 | #define sms_warn(fmt, arg...) sms_printk(KERN_WARNING, fmt, ##arg) | 1189 | #define sms_warn(fmt, arg...) sms_printk(KERN_WARNING, fmt, ##arg) |
1190 | #define sms_info(fmt, arg...) \ | 1190 | #define sms_info(fmt, arg...) \ |
1191 | dprintk(KERN_INFO, DBG_INFO, fmt, ##arg) | 1191 | dprintk(KERN_INFO, DBG_INFO, fmt, ##arg) |
1192 | #define sms_debug(fmt, arg...) \ | 1192 | #define sms_debug(fmt, arg...) \ |
1193 | dprintk(KERN_DEBUG, DBG_ADV, fmt, ##arg) | 1193 | dprintk(KERN_DEBUG, DBG_ADV, fmt, ##arg) |
1194 | 1194 | ||
1195 | 1195 | ||
1196 | #endif /* __SMS_CORE_API_H__ */ | 1196 | #endif /* __SMS_CORE_API_H__ */ |
1197 | 1197 |
drivers/media/common/siano/smsdvb-debugfs.c
1 | /*********************************************************************** | 1 | /*********************************************************************** |
2 | * | 2 | * |
3 | * Copyright(c) 2013 Mauro Carvalho Chehab <mchehab@redhat.com> | 3 | * Copyright(c) 2013 Mauro Carvalho Chehab <mchehab@redhat.com> |
4 | * | 4 | * |
5 | * This program is free software: you can redistribute it and/or modify | 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 | 6 | * it under the terms of the GNU General Public License as published by |
7 | * the Free Software Foundation, either version 2 of the License, or | 7 | * the Free Software Foundation, either version 2 of the License, or |
8 | * (at your option) any later version. | 8 | * (at your option) any later version. |
9 | 9 | ||
10 | * This program is distributed in the hope that it will be useful, | 10 | * This program is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
14 | * | 14 | * |
15 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License |
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | * | 17 | * |
18 | ***********************************************************************/ | 18 | ***********************************************************************/ |
19 | 19 | ||
20 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | 20 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
21 | 21 | ||
22 | #include <linux/module.h> | 22 | #include <linux/module.h> |
23 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | #include <linux/debugfs.h> | 25 | #include <linux/debugfs.h> |
26 | #include <linux/spinlock.h> | 26 | #include <linux/spinlock.h> |
27 | #include <linux/usb.h> | 27 | #include <linux/usb.h> |
28 | 28 | ||
29 | #include "dmxdev.h" | 29 | #include "dmxdev.h" |
30 | #include "dvbdev.h" | 30 | #include "dvbdev.h" |
31 | #include "dvb_demux.h" | 31 | #include "dvb_demux.h" |
32 | #include "dvb_frontend.h" | 32 | #include "dvb_frontend.h" |
33 | 33 | ||
34 | #include "smscoreapi.h" | 34 | #include "smscoreapi.h" |
35 | 35 | ||
36 | #include "smsdvb.h" | 36 | #include "smsdvb.h" |
37 | 37 | ||
38 | static struct dentry *smsdvb_debugfs_usb_root; | 38 | static struct dentry *smsdvb_debugfs_usb_root; |
39 | 39 | ||
40 | struct smsdvb_debugfs { | 40 | struct smsdvb_debugfs { |
41 | struct kref refcount; | 41 | struct kref refcount; |
42 | spinlock_t lock; | 42 | spinlock_t lock; |
43 | 43 | ||
44 | char stats_data[PAGE_SIZE]; | 44 | char stats_data[PAGE_SIZE]; |
45 | unsigned stats_count; | 45 | unsigned stats_count; |
46 | bool stats_was_read; | 46 | bool stats_was_read; |
47 | 47 | ||
48 | wait_queue_head_t stats_queue; | 48 | wait_queue_head_t stats_queue; |
49 | }; | 49 | }; |
50 | 50 | ||
51 | void smsdvb_print_dvb_stats(struct smsdvb_debugfs *debug_data, | 51 | void smsdvb_print_dvb_stats(struct smsdvb_debugfs *debug_data, |
52 | struct sms_stats *p) | 52 | struct sms_stats *p) |
53 | { | 53 | { |
54 | int n = 0; | 54 | int n = 0; |
55 | char *buf; | 55 | char *buf; |
56 | 56 | ||
57 | spin_lock(&debug_data->lock); | 57 | spin_lock(&debug_data->lock); |
58 | if (debug_data->stats_count) { | 58 | if (debug_data->stats_count) { |
59 | spin_unlock(&debug_data->lock); | 59 | spin_unlock(&debug_data->lock); |
60 | return; | 60 | return; |
61 | } | 61 | } |
62 | 62 | ||
63 | buf = debug_data->stats_data; | 63 | buf = debug_data->stats_data; |
64 | 64 | ||
65 | n += snprintf(&buf[n], PAGE_SIZE - n, | 65 | n += snprintf(&buf[n], PAGE_SIZE - n, |
66 | "is_rf_locked = %d\n", p->is_rf_locked); | 66 | "is_rf_locked = %d\n", p->is_rf_locked); |
67 | n += snprintf(&buf[n], PAGE_SIZE - n, | 67 | n += snprintf(&buf[n], PAGE_SIZE - n, |
68 | "is_demod_locked = %d\n", p->is_demod_locked); | 68 | "is_demod_locked = %d\n", p->is_demod_locked); |
69 | n += snprintf(&buf[n], PAGE_SIZE - n, | 69 | n += snprintf(&buf[n], PAGE_SIZE - n, |
70 | "is_external_lna_on = %d\n", p->is_external_lna_on); | 70 | "is_external_lna_on = %d\n", p->is_external_lna_on); |
71 | n += snprintf(&buf[n], PAGE_SIZE - n, | 71 | n += snprintf(&buf[n], PAGE_SIZE - n, |
72 | "SNR = %d\n", p->SNR); | 72 | "SNR = %d\n", p->SNR); |
73 | n += snprintf(&buf[n], PAGE_SIZE - n, | 73 | n += snprintf(&buf[n], PAGE_SIZE - n, |
74 | "BER = %d\n", p->BER); | 74 | "ber = %d\n", p->ber); |
75 | n += snprintf(&buf[n], PAGE_SIZE - n, | 75 | n += snprintf(&buf[n], PAGE_SIZE - n, |
76 | "FIB_CRC = %d\n", p->FIB_CRC); | 76 | "FIB_CRC = %d\n", p->FIB_CRC); |
77 | n += snprintf(&buf[n], PAGE_SIZE - n, | 77 | n += snprintf(&buf[n], PAGE_SIZE - n, |
78 | "TS_PER = %d\n", p->TS_PER); | 78 | "ts_per = %d\n", p->ts_per); |
79 | n += snprintf(&buf[n], PAGE_SIZE - n, | 79 | n += snprintf(&buf[n], PAGE_SIZE - n, |
80 | "MFER = %d\n", p->MFER); | 80 | "MFER = %d\n", p->MFER); |
81 | n += snprintf(&buf[n], PAGE_SIZE - n, | 81 | n += snprintf(&buf[n], PAGE_SIZE - n, |
82 | "RSSI = %d\n", p->RSSI); | 82 | "RSSI = %d\n", p->RSSI); |
83 | n += snprintf(&buf[n], PAGE_SIZE - n, | 83 | n += snprintf(&buf[n], PAGE_SIZE - n, |
84 | "in_band_pwr = %d\n", p->in_band_pwr); | 84 | "in_band_pwr = %d\n", p->in_band_pwr); |
85 | n += snprintf(&buf[n], PAGE_SIZE - n, | 85 | n += snprintf(&buf[n], PAGE_SIZE - n, |
86 | "carrier_offset = %d\n", p->carrier_offset); | 86 | "carrier_offset = %d\n", p->carrier_offset); |
87 | n += snprintf(&buf[n], PAGE_SIZE - n, | 87 | n += snprintf(&buf[n], PAGE_SIZE - n, |
88 | "modem_state = %d\n", p->modem_state); | 88 | "modem_state = %d\n", p->modem_state); |
89 | n += snprintf(&buf[n], PAGE_SIZE - n, | 89 | n += snprintf(&buf[n], PAGE_SIZE - n, |
90 | "frequency = %d\n", p->frequency); | 90 | "frequency = %d\n", p->frequency); |
91 | n += snprintf(&buf[n], PAGE_SIZE - n, | 91 | n += snprintf(&buf[n], PAGE_SIZE - n, |
92 | "bandwidth = %d\n", p->bandwidth); | 92 | "bandwidth = %d\n", p->bandwidth); |
93 | n += snprintf(&buf[n], PAGE_SIZE - n, | 93 | n += snprintf(&buf[n], PAGE_SIZE - n, |
94 | "transmission_mode = %d\n", p->transmission_mode); | 94 | "transmission_mode = %d\n", p->transmission_mode); |
95 | n += snprintf(&buf[n], PAGE_SIZE - n, | 95 | n += snprintf(&buf[n], PAGE_SIZE - n, |
96 | "modem_state = %d\n", p->modem_state); | 96 | "modem_state = %d\n", p->modem_state); |
97 | n += snprintf(&buf[n], PAGE_SIZE - n, | 97 | n += snprintf(&buf[n], PAGE_SIZE - n, |
98 | "guard_interval = %d\n", p->guard_interval); | 98 | "guard_interval = %d\n", p->guard_interval); |
99 | n += snprintf(&buf[n], PAGE_SIZE - n, | 99 | n += snprintf(&buf[n], PAGE_SIZE - n, |
100 | "code_rate = %d\n", p->code_rate); | 100 | "code_rate = %d\n", p->code_rate); |
101 | n += snprintf(&buf[n], PAGE_SIZE - n, | 101 | n += snprintf(&buf[n], PAGE_SIZE - n, |
102 | "lp_code_rate = %d\n", p->lp_code_rate); | 102 | "lp_code_rate = %d\n", p->lp_code_rate); |
103 | n += snprintf(&buf[n], PAGE_SIZE - n, | 103 | n += snprintf(&buf[n], PAGE_SIZE - n, |
104 | "hierarchy = %d\n", p->hierarchy); | 104 | "hierarchy = %d\n", p->hierarchy); |
105 | n += snprintf(&buf[n], PAGE_SIZE - n, | 105 | n += snprintf(&buf[n], PAGE_SIZE - n, |
106 | "constellation = %d\n", p->constellation); | 106 | "constellation = %d\n", p->constellation); |
107 | n += snprintf(&buf[n], PAGE_SIZE - n, | 107 | n += snprintf(&buf[n], PAGE_SIZE - n, |
108 | "burst_size = %d\n", p->burst_size); | 108 | "burst_size = %d\n", p->burst_size); |
109 | n += snprintf(&buf[n], PAGE_SIZE - n, | 109 | n += snprintf(&buf[n], PAGE_SIZE - n, |
110 | "burst_duration = %d\n", p->burst_duration); | 110 | "burst_duration = %d\n", p->burst_duration); |
111 | n += snprintf(&buf[n], PAGE_SIZE - n, | 111 | n += snprintf(&buf[n], PAGE_SIZE - n, |
112 | "burst_cycle_time = %d\n", p->burst_cycle_time); | 112 | "burst_cycle_time = %d\n", p->burst_cycle_time); |
113 | n += snprintf(&buf[n], PAGE_SIZE - n, | 113 | n += snprintf(&buf[n], PAGE_SIZE - n, |
114 | "calc_burst_cycle_time = %d\n", | 114 | "calc_burst_cycle_time = %d\n", |
115 | p->calc_burst_cycle_time); | 115 | p->calc_burst_cycle_time); |
116 | n += snprintf(&buf[n], PAGE_SIZE - n, | 116 | n += snprintf(&buf[n], PAGE_SIZE - n, |
117 | "num_of_rows = %d\n", p->num_of_rows); | 117 | "num_of_rows = %d\n", p->num_of_rows); |
118 | n += snprintf(&buf[n], PAGE_SIZE - n, | 118 | n += snprintf(&buf[n], PAGE_SIZE - n, |
119 | "num_of_padd_cols = %d\n", p->num_of_padd_cols); | 119 | "num_of_padd_cols = %d\n", p->num_of_padd_cols); |
120 | n += snprintf(&buf[n], PAGE_SIZE - n, | 120 | n += snprintf(&buf[n], PAGE_SIZE - n, |
121 | "num_of_punct_cols = %d\n", p->num_of_punct_cols); | 121 | "num_of_punct_cols = %d\n", p->num_of_punct_cols); |
122 | n += snprintf(&buf[n], PAGE_SIZE - n, | 122 | n += snprintf(&buf[n], PAGE_SIZE - n, |
123 | "error_ts_packets = %d\n", p->error_ts_packets); | 123 | "error_ts_packets = %d\n", p->error_ts_packets); |
124 | n += snprintf(&buf[n], PAGE_SIZE - n, | 124 | n += snprintf(&buf[n], PAGE_SIZE - n, |
125 | "total_ts_packets = %d\n", p->total_ts_packets); | 125 | "total_ts_packets = %d\n", p->total_ts_packets); |
126 | n += snprintf(&buf[n], PAGE_SIZE - n, | 126 | n += snprintf(&buf[n], PAGE_SIZE - n, |
127 | "num_of_valid_mpe_tlbs = %d\n", p->num_of_valid_mpe_tlbs); | 127 | "num_of_valid_mpe_tlbs = %d\n", p->num_of_valid_mpe_tlbs); |
128 | n += snprintf(&buf[n], PAGE_SIZE - n, | 128 | n += snprintf(&buf[n], PAGE_SIZE - n, |
129 | "num_of_invalid_mpe_tlbs = %d\n", p->num_of_invalid_mpe_tlbs); | 129 | "num_of_invalid_mpe_tlbs = %d\n", p->num_of_invalid_mpe_tlbs); |
130 | n += snprintf(&buf[n], PAGE_SIZE - n, | 130 | n += snprintf(&buf[n], PAGE_SIZE - n, |
131 | "num_of_corrected_mpe_tlbs = %d\n", p->num_of_corrected_mpe_tlbs); | 131 | "num_of_corrected_mpe_tlbs = %d\n", p->num_of_corrected_mpe_tlbs); |
132 | n += snprintf(&buf[n], PAGE_SIZE - n, | 132 | n += snprintf(&buf[n], PAGE_SIZE - n, |
133 | "ber_error_count = %d\n", p->ber_error_count); | 133 | "ber_error_count = %d\n", p->ber_error_count); |
134 | n += snprintf(&buf[n], PAGE_SIZE - n, | 134 | n += snprintf(&buf[n], PAGE_SIZE - n, |
135 | "ber_bit_count = %d\n", p->ber_bit_count); | 135 | "ber_bit_count = %d\n", p->ber_bit_count); |
136 | n += snprintf(&buf[n], PAGE_SIZE - n, | 136 | n += snprintf(&buf[n], PAGE_SIZE - n, |
137 | "sms_to_host_tx_errors = %d\n", p->sms_to_host_tx_errors); | 137 | "sms_to_host_tx_errors = %d\n", p->sms_to_host_tx_errors); |
138 | n += snprintf(&buf[n], PAGE_SIZE - n, | 138 | n += snprintf(&buf[n], PAGE_SIZE - n, |
139 | "pre_ber = %d\n", p->pre_ber); | 139 | "pre_ber = %d\n", p->pre_ber); |
140 | n += snprintf(&buf[n], PAGE_SIZE - n, | 140 | n += snprintf(&buf[n], PAGE_SIZE - n, |
141 | "cell_id = %d\n", p->cell_id); | 141 | "cell_id = %d\n", p->cell_id); |
142 | n += snprintf(&buf[n], PAGE_SIZE - n, | 142 | n += snprintf(&buf[n], PAGE_SIZE - n, |
143 | "dvbh_srv_ind_hp = %d\n", p->dvbh_srv_ind_hp); | 143 | "dvbh_srv_ind_hp = %d\n", p->dvbh_srv_ind_hp); |
144 | n += snprintf(&buf[n], PAGE_SIZE - n, | 144 | n += snprintf(&buf[n], PAGE_SIZE - n, |
145 | "dvbh_srv_ind_lp = %d\n", p->dvbh_srv_ind_lp); | 145 | "dvbh_srv_ind_lp = %d\n", p->dvbh_srv_ind_lp); |
146 | n += snprintf(&buf[n], PAGE_SIZE - n, | 146 | n += snprintf(&buf[n], PAGE_SIZE - n, |
147 | "num_mpe_received = %d\n", p->num_mpe_received); | 147 | "num_mpe_received = %d\n", p->num_mpe_received); |
148 | 148 | ||
149 | debug_data->stats_count = n; | 149 | debug_data->stats_count = n; |
150 | spin_unlock(&debug_data->lock); | 150 | spin_unlock(&debug_data->lock); |
151 | wake_up(&debug_data->stats_queue); | 151 | wake_up(&debug_data->stats_queue); |
152 | } | 152 | } |
153 | 153 | ||
154 | void smsdvb_print_isdb_stats(struct smsdvb_debugfs *debug_data, | 154 | void smsdvb_print_isdb_stats(struct smsdvb_debugfs *debug_data, |
155 | struct sms_isdbt_stats *p) | 155 | struct sms_isdbt_stats *p) |
156 | { | 156 | { |
157 | int i, n = 0; | 157 | int i, n = 0; |
158 | char *buf; | 158 | char *buf; |
159 | 159 | ||
160 | spin_lock(&debug_data->lock); | 160 | spin_lock(&debug_data->lock); |
161 | if (debug_data->stats_count) { | 161 | if (debug_data->stats_count) { |
162 | spin_unlock(&debug_data->lock); | 162 | spin_unlock(&debug_data->lock); |
163 | return; | 163 | return; |
164 | } | 164 | } |
165 | 165 | ||
166 | buf = debug_data->stats_data; | 166 | buf = debug_data->stats_data; |
167 | 167 | ||
168 | n += snprintf(&buf[n], PAGE_SIZE - n, | 168 | n += snprintf(&buf[n], PAGE_SIZE - n, |
169 | "statistics_type = %d\t", p->statistics_type); | 169 | "statistics_type = %d\t", p->statistics_type); |
170 | n += snprintf(&buf[n], PAGE_SIZE - n, | 170 | n += snprintf(&buf[n], PAGE_SIZE - n, |
171 | "full_size = %d\n", p->full_size); | 171 | "full_size = %d\n", p->full_size); |
172 | 172 | ||
173 | n += snprintf(&buf[n], PAGE_SIZE - n, | 173 | n += snprintf(&buf[n], PAGE_SIZE - n, |
174 | "is_rf_locked = %d\t\t", p->is_rf_locked); | 174 | "is_rf_locked = %d\t\t", p->is_rf_locked); |
175 | n += snprintf(&buf[n], PAGE_SIZE - n, | 175 | n += snprintf(&buf[n], PAGE_SIZE - n, |
176 | "is_demod_locked = %d\t", p->is_demod_locked); | 176 | "is_demod_locked = %d\t", p->is_demod_locked); |
177 | n += snprintf(&buf[n], PAGE_SIZE - n, | 177 | n += snprintf(&buf[n], PAGE_SIZE - n, |
178 | "is_external_lna_on = %d\n", p->is_external_lna_on); | 178 | "is_external_lna_on = %d\n", p->is_external_lna_on); |
179 | n += snprintf(&buf[n], PAGE_SIZE - n, | 179 | n += snprintf(&buf[n], PAGE_SIZE - n, |
180 | "SNR = %d dB\t\t", p->SNR); | 180 | "SNR = %d dB\t\t", p->SNR); |
181 | n += snprintf(&buf[n], PAGE_SIZE - n, | 181 | n += snprintf(&buf[n], PAGE_SIZE - n, |
182 | "RSSI = %d dBm\t\t", p->RSSI); | 182 | "RSSI = %d dBm\t\t", p->RSSI); |
183 | n += snprintf(&buf[n], PAGE_SIZE - n, | 183 | n += snprintf(&buf[n], PAGE_SIZE - n, |
184 | "in_band_pwr = %d dBm\n", p->in_band_pwr); | 184 | "in_band_pwr = %d dBm\n", p->in_band_pwr); |
185 | n += snprintf(&buf[n], PAGE_SIZE - n, | 185 | n += snprintf(&buf[n], PAGE_SIZE - n, |
186 | "carrier_offset = %d\t", p->carrier_offset); | 186 | "carrier_offset = %d\t", p->carrier_offset); |
187 | n += snprintf(&buf[n], PAGE_SIZE - n, | 187 | n += snprintf(&buf[n], PAGE_SIZE - n, |
188 | "bandwidth = %d\t\t", p->bandwidth); | 188 | "bandwidth = %d\t\t", p->bandwidth); |
189 | n += snprintf(&buf[n], PAGE_SIZE - n, | 189 | n += snprintf(&buf[n], PAGE_SIZE - n, |
190 | "frequency = %d Hz\n", p->frequency); | 190 | "frequency = %d Hz\n", p->frequency); |
191 | n += snprintf(&buf[n], PAGE_SIZE - n, | 191 | n += snprintf(&buf[n], PAGE_SIZE - n, |
192 | "transmission_mode = %d\t", p->transmission_mode); | 192 | "transmission_mode = %d\t", p->transmission_mode); |
193 | n += snprintf(&buf[n], PAGE_SIZE - n, | 193 | n += snprintf(&buf[n], PAGE_SIZE - n, |
194 | "modem_state = %d\t\t", p->modem_state); | 194 | "modem_state = %d\t\t", p->modem_state); |
195 | n += snprintf(&buf[n], PAGE_SIZE - n, | 195 | n += snprintf(&buf[n], PAGE_SIZE - n, |
196 | "guard_interval = %d\n", p->guard_interval); | 196 | "guard_interval = %d\n", p->guard_interval); |
197 | n += snprintf(&buf[n], PAGE_SIZE - n, | 197 | n += snprintf(&buf[n], PAGE_SIZE - n, |
198 | "system_type = %d\t\t", p->system_type); | 198 | "system_type = %d\t\t", p->system_type); |
199 | n += snprintf(&buf[n], PAGE_SIZE - n, | 199 | n += snprintf(&buf[n], PAGE_SIZE - n, |
200 | "partial_reception = %d\t", p->partial_reception); | 200 | "partial_reception = %d\t", p->partial_reception); |
201 | n += snprintf(&buf[n], PAGE_SIZE - n, | 201 | n += snprintf(&buf[n], PAGE_SIZE - n, |
202 | "num_of_layers = %d\n", p->num_of_layers); | 202 | "num_of_layers = %d\n", p->num_of_layers); |
203 | n += snprintf(&buf[n], PAGE_SIZE - n, | 203 | n += snprintf(&buf[n], PAGE_SIZE - n, |
204 | "sms_to_host_tx_errors = %d\n", p->sms_to_host_tx_errors); | 204 | "sms_to_host_tx_errors = %d\n", p->sms_to_host_tx_errors); |
205 | 205 | ||
206 | for (i = 0; i < 3; i++) { | 206 | for (i = 0; i < 3; i++) { |
207 | if (p->LayerInfo[i].number_of_segments < 1 || | 207 | if (p->layer_info[i].number_of_segments < 1 || |
208 | p->LayerInfo[i].number_of_segments > 13) | 208 | p->layer_info[i].number_of_segments > 13) |
209 | continue; | 209 | continue; |
210 | 210 | ||
211 | n += snprintf(&buf[n], PAGE_SIZE - n, "\nLayer %d\n", i); | 211 | n += snprintf(&buf[n], PAGE_SIZE - n, "\nLayer %d\n", i); |
212 | n += snprintf(&buf[n], PAGE_SIZE - n, "\tcode_rate = %d\t", | 212 | n += snprintf(&buf[n], PAGE_SIZE - n, "\tcode_rate = %d\t", |
213 | p->LayerInfo[i].code_rate); | 213 | p->layer_info[i].code_rate); |
214 | n += snprintf(&buf[n], PAGE_SIZE - n, "constellation = %d\n", | 214 | n += snprintf(&buf[n], PAGE_SIZE - n, "constellation = %d\n", |
215 | p->LayerInfo[i].constellation); | 215 | p->layer_info[i].constellation); |
216 | n += snprintf(&buf[n], PAGE_SIZE - n, "\tBER = %-5d\t", | 216 | n += snprintf(&buf[n], PAGE_SIZE - n, "\tber = %-5d\t", |
217 | p->LayerInfo[i].BER); | 217 | p->layer_info[i].ber); |
218 | n += snprintf(&buf[n], PAGE_SIZE - n, "\tber_error_count = %-5d\t", | 218 | n += snprintf(&buf[n], PAGE_SIZE - n, "\tber_error_count = %-5d\t", |
219 | p->LayerInfo[i].ber_error_count); | 219 | p->layer_info[i].ber_error_count); |
220 | n += snprintf(&buf[n], PAGE_SIZE - n, "ber_bit_count = %-5d\n", | 220 | n += snprintf(&buf[n], PAGE_SIZE - n, "ber_bit_count = %-5d\n", |
221 | p->LayerInfo[i].ber_bit_count); | 221 | p->layer_info[i].ber_bit_count); |
222 | n += snprintf(&buf[n], PAGE_SIZE - n, "\tpre_ber = %-5d\t", | 222 | n += snprintf(&buf[n], PAGE_SIZE - n, "\tpre_ber = %-5d\t", |
223 | p->LayerInfo[i].pre_ber); | 223 | p->layer_info[i].pre_ber); |
224 | n += snprintf(&buf[n], PAGE_SIZE - n, "\tTS_PER = %-5d\n", | 224 | n += snprintf(&buf[n], PAGE_SIZE - n, "\tts_per = %-5d\n", |
225 | p->LayerInfo[i].TS_PER); | 225 | p->layer_info[i].ts_per); |
226 | n += snprintf(&buf[n], PAGE_SIZE - n, "\terror_ts_packets = %-5d\t", | 226 | n += snprintf(&buf[n], PAGE_SIZE - n, "\terror_ts_packets = %-5d\t", |
227 | p->LayerInfo[i].error_ts_packets); | 227 | p->layer_info[i].error_ts_packets); |
228 | n += snprintf(&buf[n], PAGE_SIZE - n, "total_ts_packets = %-5d\t", | 228 | n += snprintf(&buf[n], PAGE_SIZE - n, "total_ts_packets = %-5d\t", |
229 | p->LayerInfo[i].total_ts_packets); | 229 | p->layer_info[i].total_ts_packets); |
230 | n += snprintf(&buf[n], PAGE_SIZE - n, "ti_ldepth_i = %d\n", | 230 | n += snprintf(&buf[n], PAGE_SIZE - n, "ti_ldepth_i = %d\n", |
231 | p->LayerInfo[i].ti_ldepth_i); | 231 | p->layer_info[i].ti_ldepth_i); |
232 | n += snprintf(&buf[n], PAGE_SIZE - n, | 232 | n += snprintf(&buf[n], PAGE_SIZE - n, |
233 | "\tnumber_of_segments = %d\t", | 233 | "\tnumber_of_segments = %d\t", |
234 | p->LayerInfo[i].number_of_segments); | 234 | p->layer_info[i].number_of_segments); |
235 | n += snprintf(&buf[n], PAGE_SIZE - n, "tmcc_errors = %d\n", | 235 | n += snprintf(&buf[n], PAGE_SIZE - n, "tmcc_errors = %d\n", |
236 | p->LayerInfo[i].tmcc_errors); | 236 | p->layer_info[i].tmcc_errors); |
237 | } | 237 | } |
238 | 238 | ||
239 | debug_data->stats_count = n; | 239 | debug_data->stats_count = n; |
240 | spin_unlock(&debug_data->lock); | 240 | spin_unlock(&debug_data->lock); |
241 | wake_up(&debug_data->stats_queue); | 241 | wake_up(&debug_data->stats_queue); |
242 | } | 242 | } |
243 | 243 | ||
244 | void smsdvb_print_isdb_stats_ex(struct smsdvb_debugfs *debug_data, | 244 | void smsdvb_print_isdb_stats_ex(struct smsdvb_debugfs *debug_data, |
245 | struct sms_isdbt_stats_ex *p) | 245 | struct sms_isdbt_stats_ex *p) |
246 | { | 246 | { |
247 | int i, n = 0; | 247 | int i, n = 0; |
248 | char *buf; | 248 | char *buf; |
249 | 249 | ||
250 | spin_lock(&debug_data->lock); | 250 | spin_lock(&debug_data->lock); |
251 | if (debug_data->stats_count) { | 251 | if (debug_data->stats_count) { |
252 | spin_unlock(&debug_data->lock); | 252 | spin_unlock(&debug_data->lock); |
253 | return; | 253 | return; |
254 | } | 254 | } |
255 | 255 | ||
256 | buf = debug_data->stats_data; | 256 | buf = debug_data->stats_data; |
257 | 257 | ||
258 | n += snprintf(&buf[n], PAGE_SIZE - n, | 258 | n += snprintf(&buf[n], PAGE_SIZE - n, |
259 | "statistics_type = %d\t", p->statistics_type); | 259 | "statistics_type = %d\t", p->statistics_type); |
260 | n += snprintf(&buf[n], PAGE_SIZE - n, | 260 | n += snprintf(&buf[n], PAGE_SIZE - n, |
261 | "full_size = %d\n", p->full_size); | 261 | "full_size = %d\n", p->full_size); |
262 | 262 | ||
263 | n += snprintf(&buf[n], PAGE_SIZE - n, | 263 | n += snprintf(&buf[n], PAGE_SIZE - n, |
264 | "is_rf_locked = %d\t\t", p->is_rf_locked); | 264 | "is_rf_locked = %d\t\t", p->is_rf_locked); |
265 | n += snprintf(&buf[n], PAGE_SIZE - n, | 265 | n += snprintf(&buf[n], PAGE_SIZE - n, |
266 | "is_demod_locked = %d\t", p->is_demod_locked); | 266 | "is_demod_locked = %d\t", p->is_demod_locked); |
267 | n += snprintf(&buf[n], PAGE_SIZE - n, | 267 | n += snprintf(&buf[n], PAGE_SIZE - n, |
268 | "is_external_lna_on = %d\n", p->is_external_lna_on); | 268 | "is_external_lna_on = %d\n", p->is_external_lna_on); |
269 | n += snprintf(&buf[n], PAGE_SIZE - n, | 269 | n += snprintf(&buf[n], PAGE_SIZE - n, |
270 | "SNR = %d dB\t\t", p->SNR); | 270 | "SNR = %d dB\t\t", p->SNR); |
271 | n += snprintf(&buf[n], PAGE_SIZE - n, | 271 | n += snprintf(&buf[n], PAGE_SIZE - n, |
272 | "RSSI = %d dBm\t\t", p->RSSI); | 272 | "RSSI = %d dBm\t\t", p->RSSI); |
273 | n += snprintf(&buf[n], PAGE_SIZE - n, | 273 | n += snprintf(&buf[n], PAGE_SIZE - n, |
274 | "in_band_pwr = %d dBm\n", p->in_band_pwr); | 274 | "in_band_pwr = %d dBm\n", p->in_band_pwr); |
275 | n += snprintf(&buf[n], PAGE_SIZE - n, | 275 | n += snprintf(&buf[n], PAGE_SIZE - n, |
276 | "carrier_offset = %d\t", p->carrier_offset); | 276 | "carrier_offset = %d\t", p->carrier_offset); |
277 | n += snprintf(&buf[n], PAGE_SIZE - n, | 277 | n += snprintf(&buf[n], PAGE_SIZE - n, |
278 | "bandwidth = %d\t\t", p->bandwidth); | 278 | "bandwidth = %d\t\t", p->bandwidth); |
279 | n += snprintf(&buf[n], PAGE_SIZE - n, | 279 | n += snprintf(&buf[n], PAGE_SIZE - n, |
280 | "frequency = %d Hz\n", p->frequency); | 280 | "frequency = %d Hz\n", p->frequency); |
281 | n += snprintf(&buf[n], PAGE_SIZE - n, | 281 | n += snprintf(&buf[n], PAGE_SIZE - n, |
282 | "transmission_mode = %d\t", p->transmission_mode); | 282 | "transmission_mode = %d\t", p->transmission_mode); |
283 | n += snprintf(&buf[n], PAGE_SIZE - n, | 283 | n += snprintf(&buf[n], PAGE_SIZE - n, |
284 | "modem_state = %d\t\t", p->modem_state); | 284 | "modem_state = %d\t\t", p->modem_state); |
285 | n += snprintf(&buf[n], PAGE_SIZE - n, | 285 | n += snprintf(&buf[n], PAGE_SIZE - n, |
286 | "guard_interval = %d\n", p->guard_interval); | 286 | "guard_interval = %d\n", p->guard_interval); |
287 | n += snprintf(&buf[n], PAGE_SIZE - n, | 287 | n += snprintf(&buf[n], PAGE_SIZE - n, |
288 | "system_type = %d\t\t", p->system_type); | 288 | "system_type = %d\t\t", p->system_type); |
289 | n += snprintf(&buf[n], PAGE_SIZE - n, | 289 | n += snprintf(&buf[n], PAGE_SIZE - n, |
290 | "partial_reception = %d\t", p->partial_reception); | 290 | "partial_reception = %d\t", p->partial_reception); |
291 | n += snprintf(&buf[n], PAGE_SIZE - n, | 291 | n += snprintf(&buf[n], PAGE_SIZE - n, |
292 | "num_of_layers = %d\n", p->num_of_layers); | 292 | "num_of_layers = %d\n", p->num_of_layers); |
293 | n += snprintf(&buf[n], PAGE_SIZE - n, "segment_number = %d\t", | 293 | n += snprintf(&buf[n], PAGE_SIZE - n, "segment_number = %d\t", |
294 | p->segment_number); | 294 | p->segment_number); |
295 | n += snprintf(&buf[n], PAGE_SIZE - n, "tune_bw = %d\n", | 295 | n += snprintf(&buf[n], PAGE_SIZE - n, "tune_bw = %d\n", |
296 | p->tune_bw); | 296 | p->tune_bw); |
297 | 297 | ||
298 | for (i = 0; i < 3; i++) { | 298 | for (i = 0; i < 3; i++) { |
299 | if (p->LayerInfo[i].number_of_segments < 1 || | 299 | if (p->layer_info[i].number_of_segments < 1 || |
300 | p->LayerInfo[i].number_of_segments > 13) | 300 | p->layer_info[i].number_of_segments > 13) |
301 | continue; | 301 | continue; |
302 | 302 | ||
303 | n += snprintf(&buf[n], PAGE_SIZE - n, "\nLayer %d\n", i); | 303 | n += snprintf(&buf[n], PAGE_SIZE - n, "\nLayer %d\n", i); |
304 | n += snprintf(&buf[n], PAGE_SIZE - n, "\tcode_rate = %d\t", | 304 | n += snprintf(&buf[n], PAGE_SIZE - n, "\tcode_rate = %d\t", |
305 | p->LayerInfo[i].code_rate); | 305 | p->layer_info[i].code_rate); |
306 | n += snprintf(&buf[n], PAGE_SIZE - n, "constellation = %d\n", | 306 | n += snprintf(&buf[n], PAGE_SIZE - n, "constellation = %d\n", |
307 | p->LayerInfo[i].constellation); | 307 | p->layer_info[i].constellation); |
308 | n += snprintf(&buf[n], PAGE_SIZE - n, "\tBER = %-5d\t", | 308 | n += snprintf(&buf[n], PAGE_SIZE - n, "\tber = %-5d\t", |
309 | p->LayerInfo[i].BER); | 309 | p->layer_info[i].ber); |
310 | n += snprintf(&buf[n], PAGE_SIZE - n, "\tber_error_count = %-5d\t", | 310 | n += snprintf(&buf[n], PAGE_SIZE - n, "\tber_error_count = %-5d\t", |
311 | p->LayerInfo[i].ber_error_count); | 311 | p->layer_info[i].ber_error_count); |
312 | n += snprintf(&buf[n], PAGE_SIZE - n, "ber_bit_count = %-5d\n", | 312 | n += snprintf(&buf[n], PAGE_SIZE - n, "ber_bit_count = %-5d\n", |
313 | p->LayerInfo[i].ber_bit_count); | 313 | p->layer_info[i].ber_bit_count); |
314 | n += snprintf(&buf[n], PAGE_SIZE - n, "\tpre_ber = %-5d\t", | 314 | n += snprintf(&buf[n], PAGE_SIZE - n, "\tpre_ber = %-5d\t", |
315 | p->LayerInfo[i].pre_ber); | 315 | p->layer_info[i].pre_ber); |
316 | n += snprintf(&buf[n], PAGE_SIZE - n, "\tTS_PER = %-5d\n", | 316 | n += snprintf(&buf[n], PAGE_SIZE - n, "\tts_per = %-5d\n", |
317 | p->LayerInfo[i].TS_PER); | 317 | p->layer_info[i].ts_per); |
318 | n += snprintf(&buf[n], PAGE_SIZE - n, "\terror_ts_packets = %-5d\t", | 318 | n += snprintf(&buf[n], PAGE_SIZE - n, "\terror_ts_packets = %-5d\t", |
319 | p->LayerInfo[i].error_ts_packets); | 319 | p->layer_info[i].error_ts_packets); |
320 | n += snprintf(&buf[n], PAGE_SIZE - n, "total_ts_packets = %-5d\t", | 320 | n += snprintf(&buf[n], PAGE_SIZE - n, "total_ts_packets = %-5d\t", |
321 | p->LayerInfo[i].total_ts_packets); | 321 | p->layer_info[i].total_ts_packets); |
322 | n += snprintf(&buf[n], PAGE_SIZE - n, "ti_ldepth_i = %d\n", | 322 | n += snprintf(&buf[n], PAGE_SIZE - n, "ti_ldepth_i = %d\n", |
323 | p->LayerInfo[i].ti_ldepth_i); | 323 | p->layer_info[i].ti_ldepth_i); |
324 | n += snprintf(&buf[n], PAGE_SIZE - n, | 324 | n += snprintf(&buf[n], PAGE_SIZE - n, |
325 | "\tnumber_of_segments = %d\t", | 325 | "\tnumber_of_segments = %d\t", |
326 | p->LayerInfo[i].number_of_segments); | 326 | p->layer_info[i].number_of_segments); |
327 | n += snprintf(&buf[n], PAGE_SIZE - n, "tmcc_errors = %d\n", | 327 | n += snprintf(&buf[n], PAGE_SIZE - n, "tmcc_errors = %d\n", |
328 | p->LayerInfo[i].tmcc_errors); | 328 | p->layer_info[i].tmcc_errors); |
329 | } | 329 | } |
330 | 330 | ||
331 | 331 | ||
332 | debug_data->stats_count = n; | 332 | debug_data->stats_count = n; |
333 | spin_unlock(&debug_data->lock); | 333 | spin_unlock(&debug_data->lock); |
334 | 334 | ||
335 | wake_up(&debug_data->stats_queue); | 335 | wake_up(&debug_data->stats_queue); |
336 | } | 336 | } |
337 | 337 | ||
338 | static int smsdvb_stats_open(struct inode *inode, struct file *file) | 338 | static int smsdvb_stats_open(struct inode *inode, struct file *file) |
339 | { | 339 | { |
340 | struct smsdvb_client_t *client = inode->i_private; | 340 | struct smsdvb_client_t *client = inode->i_private; |
341 | struct smsdvb_debugfs *debug_data = client->debug_data; | 341 | struct smsdvb_debugfs *debug_data = client->debug_data; |
342 | 342 | ||
343 | kref_get(&debug_data->refcount); | 343 | kref_get(&debug_data->refcount); |
344 | 344 | ||
345 | spin_lock(&debug_data->lock); | 345 | spin_lock(&debug_data->lock); |
346 | debug_data->stats_count = 0; | 346 | debug_data->stats_count = 0; |
347 | debug_data->stats_was_read = false; | 347 | debug_data->stats_was_read = false; |
348 | spin_unlock(&debug_data->lock); | 348 | spin_unlock(&debug_data->lock); |
349 | 349 | ||
350 | file->private_data = debug_data; | 350 | file->private_data = debug_data; |
351 | 351 | ||
352 | return 0; | 352 | return 0; |
353 | } | 353 | } |
354 | 354 | ||
355 | static void smsdvb_debugfs_data_release(struct kref *ref) | 355 | static void smsdvb_debugfs_data_release(struct kref *ref) |
356 | { | 356 | { |
357 | struct smsdvb_debugfs *debug_data; | 357 | struct smsdvb_debugfs *debug_data; |
358 | 358 | ||
359 | debug_data = container_of(ref, struct smsdvb_debugfs, refcount); | 359 | debug_data = container_of(ref, struct smsdvb_debugfs, refcount); |
360 | kfree(debug_data); | 360 | kfree(debug_data); |
361 | } | 361 | } |
362 | 362 | ||
363 | static int smsdvb_stats_wait_read(struct smsdvb_debugfs *debug_data) | 363 | static int smsdvb_stats_wait_read(struct smsdvb_debugfs *debug_data) |
364 | { | 364 | { |
365 | int rc = 1; | 365 | int rc = 1; |
366 | 366 | ||
367 | spin_lock(&debug_data->lock); | 367 | spin_lock(&debug_data->lock); |
368 | 368 | ||
369 | if (debug_data->stats_was_read) | 369 | if (debug_data->stats_was_read) |
370 | goto exit; | 370 | goto exit; |
371 | 371 | ||
372 | rc = debug_data->stats_count; | 372 | rc = debug_data->stats_count; |
373 | 373 | ||
374 | exit: | 374 | exit: |
375 | spin_unlock(&debug_data->lock); | 375 | spin_unlock(&debug_data->lock); |
376 | return rc; | 376 | return rc; |
377 | } | 377 | } |
378 | 378 | ||
379 | static unsigned int smsdvb_stats_poll(struct file *file, poll_table *wait) | 379 | static unsigned int smsdvb_stats_poll(struct file *file, poll_table *wait) |
380 | { | 380 | { |
381 | struct smsdvb_debugfs *debug_data = file->private_data; | 381 | struct smsdvb_debugfs *debug_data = file->private_data; |
382 | int rc; | 382 | int rc; |
383 | 383 | ||
384 | kref_get(&debug_data->refcount); | 384 | kref_get(&debug_data->refcount); |
385 | 385 | ||
386 | poll_wait(file, &debug_data->stats_queue, wait); | 386 | poll_wait(file, &debug_data->stats_queue, wait); |
387 | 387 | ||
388 | rc = smsdvb_stats_wait_read(debug_data); | 388 | rc = smsdvb_stats_wait_read(debug_data); |
389 | if (rc > 0) | 389 | if (rc > 0) |
390 | rc = POLLIN | POLLRDNORM; | 390 | rc = POLLIN | POLLRDNORM; |
391 | 391 | ||
392 | kref_put(&debug_data->refcount, smsdvb_debugfs_data_release); | 392 | kref_put(&debug_data->refcount, smsdvb_debugfs_data_release); |
393 | 393 | ||
394 | return rc; | 394 | return rc; |
395 | } | 395 | } |
396 | 396 | ||
397 | static ssize_t smsdvb_stats_read(struct file *file, char __user *user_buf, | 397 | static ssize_t smsdvb_stats_read(struct file *file, char __user *user_buf, |
398 | size_t nbytes, loff_t *ppos) | 398 | size_t nbytes, loff_t *ppos) |
399 | { | 399 | { |
400 | int rc = 0, len; | 400 | int rc = 0, len; |
401 | struct smsdvb_debugfs *debug_data = file->private_data; | 401 | struct smsdvb_debugfs *debug_data = file->private_data; |
402 | 402 | ||
403 | kref_get(&debug_data->refcount); | 403 | kref_get(&debug_data->refcount); |
404 | 404 | ||
405 | if (file->f_flags & O_NONBLOCK) { | 405 | if (file->f_flags & O_NONBLOCK) { |
406 | rc = smsdvb_stats_wait_read(debug_data); | 406 | rc = smsdvb_stats_wait_read(debug_data); |
407 | if (!rc) { | 407 | if (!rc) { |
408 | rc = -EWOULDBLOCK; | 408 | rc = -EWOULDBLOCK; |
409 | goto ret; | 409 | goto ret; |
410 | } | 410 | } |
411 | } else { | 411 | } else { |
412 | rc = wait_event_interruptible(debug_data->stats_queue, | 412 | rc = wait_event_interruptible(debug_data->stats_queue, |
413 | smsdvb_stats_wait_read(debug_data)); | 413 | smsdvb_stats_wait_read(debug_data)); |
414 | if (rc < 0) | 414 | if (rc < 0) |
415 | goto ret; | 415 | goto ret; |
416 | } | 416 | } |
417 | 417 | ||
418 | if (debug_data->stats_was_read) { | 418 | if (debug_data->stats_was_read) { |
419 | rc = 0; /* EOF */ | 419 | rc = 0; /* EOF */ |
420 | goto ret; | 420 | goto ret; |
421 | } | 421 | } |
422 | 422 | ||
423 | len = debug_data->stats_count - *ppos; | 423 | len = debug_data->stats_count - *ppos; |
424 | if (len >= 0) | 424 | if (len >= 0) |
425 | rc = simple_read_from_buffer(user_buf, nbytes, ppos, | 425 | rc = simple_read_from_buffer(user_buf, nbytes, ppos, |
426 | debug_data->stats_data, len); | 426 | debug_data->stats_data, len); |
427 | else | 427 | else |
428 | rc = 0; | 428 | rc = 0; |
429 | 429 | ||
430 | if (*ppos >= debug_data->stats_count) { | 430 | if (*ppos >= debug_data->stats_count) { |
431 | spin_lock(&debug_data->lock); | 431 | spin_lock(&debug_data->lock); |
432 | debug_data->stats_was_read = true; | 432 | debug_data->stats_was_read = true; |
433 | spin_unlock(&debug_data->lock); | 433 | spin_unlock(&debug_data->lock); |
434 | } | 434 | } |
435 | ret: | 435 | ret: |
436 | kref_put(&debug_data->refcount, smsdvb_debugfs_data_release); | 436 | kref_put(&debug_data->refcount, smsdvb_debugfs_data_release); |
437 | return rc; | 437 | return rc; |
438 | } | 438 | } |
439 | 439 | ||
440 | static int smsdvb_stats_release(struct inode *inode, struct file *file) | 440 | static int smsdvb_stats_release(struct inode *inode, struct file *file) |
441 | { | 441 | { |
442 | struct smsdvb_debugfs *debug_data = file->private_data; | 442 | struct smsdvb_debugfs *debug_data = file->private_data; |
443 | 443 | ||
444 | spin_lock(&debug_data->lock); | 444 | spin_lock(&debug_data->lock); |
445 | debug_data->stats_was_read = true; /* return EOF to read() */ | 445 | debug_data->stats_was_read = true; /* return EOF to read() */ |
446 | spin_unlock(&debug_data->lock); | 446 | spin_unlock(&debug_data->lock); |
447 | wake_up_interruptible_sync(&debug_data->stats_queue); | 447 | wake_up_interruptible_sync(&debug_data->stats_queue); |
448 | 448 | ||
449 | kref_put(&debug_data->refcount, smsdvb_debugfs_data_release); | 449 | kref_put(&debug_data->refcount, smsdvb_debugfs_data_release); |
450 | file->private_data = NULL; | 450 | file->private_data = NULL; |
451 | 451 | ||
452 | return 0; | 452 | return 0; |
453 | } | 453 | } |
454 | 454 | ||
455 | static const struct file_operations debugfs_stats_ops = { | 455 | static const struct file_operations debugfs_stats_ops = { |
456 | .open = smsdvb_stats_open, | 456 | .open = smsdvb_stats_open, |
457 | .poll = smsdvb_stats_poll, | 457 | .poll = smsdvb_stats_poll, |
458 | .read = smsdvb_stats_read, | 458 | .read = smsdvb_stats_read, |
459 | .release = smsdvb_stats_release, | 459 | .release = smsdvb_stats_release, |
460 | .llseek = generic_file_llseek, | 460 | .llseek = generic_file_llseek, |
461 | }; | 461 | }; |
462 | 462 | ||
463 | /* | 463 | /* |
464 | * Functions used by smsdvb, in order to create the interfaces | 464 | * Functions used by smsdvb, in order to create the interfaces |
465 | */ | 465 | */ |
466 | 466 | ||
467 | int smsdvb_debugfs_create(struct smsdvb_client_t *client) | 467 | int smsdvb_debugfs_create(struct smsdvb_client_t *client) |
468 | { | 468 | { |
469 | struct smscore_device_t *coredev = client->coredev; | 469 | struct smscore_device_t *coredev = client->coredev; |
470 | struct dentry *d; | 470 | struct dentry *d; |
471 | struct smsdvb_debugfs *debug_data; | 471 | struct smsdvb_debugfs *debug_data; |
472 | 472 | ||
473 | if (!smsdvb_debugfs_usb_root || !coredev->is_usb_device) | 473 | if (!smsdvb_debugfs_usb_root || !coredev->is_usb_device) |
474 | return -ENODEV; | 474 | return -ENODEV; |
475 | 475 | ||
476 | client->debugfs = debugfs_create_dir(coredev->devpath, | 476 | client->debugfs = debugfs_create_dir(coredev->devpath, |
477 | smsdvb_debugfs_usb_root); | 477 | smsdvb_debugfs_usb_root); |
478 | if (IS_ERR_OR_NULL(client->debugfs)) { | 478 | if (IS_ERR_OR_NULL(client->debugfs)) { |
479 | pr_info("Unable to create debugfs %s directory.\n", | 479 | pr_info("Unable to create debugfs %s directory.\n", |
480 | coredev->devpath); | 480 | coredev->devpath); |
481 | return -ENODEV; | 481 | return -ENODEV; |
482 | } | 482 | } |
483 | 483 | ||
484 | d = debugfs_create_file("stats", S_IRUGO | S_IWUSR, client->debugfs, | 484 | d = debugfs_create_file("stats", S_IRUGO | S_IWUSR, client->debugfs, |
485 | client, &debugfs_stats_ops); | 485 | client, &debugfs_stats_ops); |
486 | if (!d) { | 486 | if (!d) { |
487 | debugfs_remove(client->debugfs); | 487 | debugfs_remove(client->debugfs); |
488 | return -ENOMEM; | 488 | return -ENOMEM; |
489 | } | 489 | } |
490 | 490 | ||
491 | debug_data = kzalloc(sizeof(*client->debug_data), GFP_KERNEL); | 491 | debug_data = kzalloc(sizeof(*client->debug_data), GFP_KERNEL); |
492 | if (!debug_data) | 492 | if (!debug_data) |
493 | return -ENOMEM; | 493 | return -ENOMEM; |
494 | 494 | ||
495 | client->debug_data = debug_data; | 495 | client->debug_data = debug_data; |
496 | client->prt_dvb_stats = smsdvb_print_dvb_stats; | 496 | client->prt_dvb_stats = smsdvb_print_dvb_stats; |
497 | client->prt_isdb_stats = smsdvb_print_isdb_stats; | 497 | client->prt_isdb_stats = smsdvb_print_isdb_stats; |
498 | client->prt_isdb_stats_ex = smsdvb_print_isdb_stats_ex; | 498 | client->prt_isdb_stats_ex = smsdvb_print_isdb_stats_ex; |
499 | 499 | ||
500 | init_waitqueue_head(&debug_data->stats_queue); | 500 | init_waitqueue_head(&debug_data->stats_queue); |
501 | spin_lock_init(&debug_data->lock); | 501 | spin_lock_init(&debug_data->lock); |
502 | kref_init(&debug_data->refcount); | 502 | kref_init(&debug_data->refcount); |
503 | 503 | ||
504 | return 0; | 504 | return 0; |
505 | } | 505 | } |
506 | 506 | ||
507 | void smsdvb_debugfs_release(struct smsdvb_client_t *client) | 507 | void smsdvb_debugfs_release(struct smsdvb_client_t *client) |
508 | { | 508 | { |
509 | if (!client->debugfs) | 509 | if (!client->debugfs) |
510 | return; | 510 | return; |
511 | 511 | ||
512 | printk("%s\n", __func__); | 512 | printk("%s\n", __func__); |
513 | 513 | ||
514 | client->prt_dvb_stats = NULL; | 514 | client->prt_dvb_stats = NULL; |
515 | client->prt_isdb_stats = NULL; | 515 | client->prt_isdb_stats = NULL; |
516 | client->prt_isdb_stats_ex = NULL; | 516 | client->prt_isdb_stats_ex = NULL; |
517 | 517 | ||
518 | debugfs_remove_recursive(client->debugfs); | 518 | debugfs_remove_recursive(client->debugfs); |
519 | kref_put(&client->debug_data->refcount, smsdvb_debugfs_data_release); | 519 | kref_put(&client->debug_data->refcount, smsdvb_debugfs_data_release); |
520 | 520 | ||
521 | client->debug_data = NULL; | 521 | client->debug_data = NULL; |
522 | client->debugfs = NULL; | 522 | client->debugfs = NULL; |
523 | } | 523 | } |
524 | 524 | ||
525 | int smsdvb_debugfs_register(void) | 525 | int smsdvb_debugfs_register(void) |
526 | { | 526 | { |
527 | struct dentry *d; | 527 | struct dentry *d; |
528 | 528 | ||
529 | /* | 529 | /* |
530 | * FIXME: This was written to debug Siano USB devices. So, it creates | 530 | * FIXME: This was written to debug Siano USB devices. So, it creates |
531 | * the debugfs node under <debugfs>/usb. | 531 | * the debugfs node under <debugfs>/usb. |
532 | * A similar logic would be needed for Siano sdio devices, but, in that | 532 | * A similar logic would be needed for Siano sdio devices, but, in that |
533 | * case, usb_debug_root is not a good choice. | 533 | * case, usb_debug_root is not a good choice. |
534 | * | 534 | * |
535 | * Perhaps the right fix here would be to create another sysfs root | 535 | * Perhaps the right fix here would be to create another sysfs root |
536 | * node for sdio-based boards, but this may need some logic at sdio | 536 | * node for sdio-based boards, but this may need some logic at sdio |
537 | * subsystem. | 537 | * subsystem. |
538 | */ | 538 | */ |
539 | d = debugfs_create_dir("smsdvb", usb_debug_root); | 539 | d = debugfs_create_dir("smsdvb", usb_debug_root); |
540 | if (IS_ERR_OR_NULL(d)) { | 540 | if (IS_ERR_OR_NULL(d)) { |
541 | sms_err("Couldn't create sysfs node for smsdvb"); | 541 | sms_err("Couldn't create sysfs node for smsdvb"); |
542 | return PTR_ERR(d); | 542 | return PTR_ERR(d); |
543 | } else { | 543 | } else { |
544 | smsdvb_debugfs_usb_root = d; | 544 | smsdvb_debugfs_usb_root = d; |
545 | } | 545 | } |
546 | return 0; | 546 | return 0; |
547 | } | 547 | } |
548 | 548 | ||
549 | void smsdvb_debugfs_unregister(void) | 549 | void smsdvb_debugfs_unregister(void) |
550 | { | 550 | { |
551 | if (smsdvb_debugfs_usb_root) | 551 | if (smsdvb_debugfs_usb_root) |
552 | debugfs_remove_recursive(smsdvb_debugfs_usb_root); | 552 | debugfs_remove_recursive(smsdvb_debugfs_usb_root); |
553 | smsdvb_debugfs_usb_root = NULL; | 553 | smsdvb_debugfs_usb_root = NULL; |
554 | } | 554 | } |
555 | 555 |
drivers/media/common/siano/smsdvb-main.c
1 | /**************************************************************** | 1 | /**************************************************************** |
2 | 2 | ||
3 | Siano Mobile Silicon, Inc. | 3 | Siano Mobile Silicon, Inc. |
4 | MDTV receiver kernel modules. | 4 | MDTV receiver kernel modules. |
5 | Copyright (C) 2006-2008, Uri Shkolnik | 5 | Copyright (C) 2006-2008, Uri Shkolnik |
6 | 6 | ||
7 | This program is free software: you can redistribute it and/or modify | 7 | This program is free software: you can redistribute it and/or modify |
8 | it under the terms of the GNU General Public License as published by | 8 | it under the terms of the GNU General Public License as published by |
9 | the Free Software Foundation, either version 2 of the License, or | 9 | the Free Software Foundation, either version 2 of the License, or |
10 | (at your option) any later version. | 10 | (at your option) any later version. |
11 | 11 | ||
12 | This program is distributed in the hope that it will be useful, | 12 | This program is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | GNU General Public License for more details. | 15 | GNU General Public License for more details. |
16 | 16 | ||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License |
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 | 19 | ||
20 | ****************************************************************/ | 20 | ****************************************************************/ |
21 | 21 | ||
22 | #include <linux/module.h> | 22 | #include <linux/module.h> |
23 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | 25 | ||
26 | #include "dmxdev.h" | 26 | #include "dmxdev.h" |
27 | #include "dvbdev.h" | 27 | #include "dvbdev.h" |
28 | #include "dvb_demux.h" | 28 | #include "dvb_demux.h" |
29 | #include "dvb_frontend.h" | 29 | #include "dvb_frontend.h" |
30 | 30 | ||
31 | #include "smscoreapi.h" | 31 | #include "smscoreapi.h" |
32 | #include "sms-cards.h" | 32 | #include "sms-cards.h" |
33 | 33 | ||
34 | #include "smsdvb.h" | 34 | #include "smsdvb.h" |
35 | 35 | ||
36 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); | 36 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); |
37 | 37 | ||
38 | static struct list_head g_smsdvb_clients; | 38 | static struct list_head g_smsdvb_clients; |
39 | static struct mutex g_smsdvb_clientslock; | 39 | static struct mutex g_smsdvb_clientslock; |
40 | 40 | ||
41 | static int sms_dbg; | 41 | static int sms_dbg; |
42 | module_param_named(debug, sms_dbg, int, 0644); | 42 | module_param_named(debug, sms_dbg, int, 0644); |
43 | MODULE_PARM_DESC(debug, "set debug level (info=1, adv=2 (or-able))"); | 43 | MODULE_PARM_DESC(debug, "set debug level (info=1, adv=2 (or-able))"); |
44 | 44 | ||
45 | 45 | ||
46 | u32 sms_to_guard_interval_table[] = { | 46 | u32 sms_to_guard_interval_table[] = { |
47 | [0] = GUARD_INTERVAL_1_32, | 47 | [0] = GUARD_INTERVAL_1_32, |
48 | [1] = GUARD_INTERVAL_1_16, | 48 | [1] = GUARD_INTERVAL_1_16, |
49 | [2] = GUARD_INTERVAL_1_8, | 49 | [2] = GUARD_INTERVAL_1_8, |
50 | [3] = GUARD_INTERVAL_1_4, | 50 | [3] = GUARD_INTERVAL_1_4, |
51 | }; | 51 | }; |
52 | 52 | ||
53 | u32 sms_to_code_rate_table[] = { | 53 | u32 sms_to_code_rate_table[] = { |
54 | [0] = FEC_1_2, | 54 | [0] = FEC_1_2, |
55 | [1] = FEC_2_3, | 55 | [1] = FEC_2_3, |
56 | [2] = FEC_3_4, | 56 | [2] = FEC_3_4, |
57 | [3] = FEC_5_6, | 57 | [3] = FEC_5_6, |
58 | [4] = FEC_7_8, | 58 | [4] = FEC_7_8, |
59 | }; | 59 | }; |
60 | 60 | ||
61 | 61 | ||
62 | u32 sms_to_hierarchy_table[] = { | 62 | u32 sms_to_hierarchy_table[] = { |
63 | [0] = HIERARCHY_NONE, | 63 | [0] = HIERARCHY_NONE, |
64 | [1] = HIERARCHY_1, | 64 | [1] = HIERARCHY_1, |
65 | [2] = HIERARCHY_2, | 65 | [2] = HIERARCHY_2, |
66 | [3] = HIERARCHY_4, | 66 | [3] = HIERARCHY_4, |
67 | }; | 67 | }; |
68 | 68 | ||
69 | u32 sms_to_modulation_table[] = { | 69 | u32 sms_to_modulation_table[] = { |
70 | [0] = QPSK, | 70 | [0] = QPSK, |
71 | [1] = QAM_16, | 71 | [1] = QAM_16, |
72 | [2] = QAM_64, | 72 | [2] = QAM_64, |
73 | [3] = DQPSK, | 73 | [3] = DQPSK, |
74 | }; | 74 | }; |
75 | 75 | ||
76 | 76 | ||
77 | /* Events that may come from DVB v3 adapter */ | 77 | /* Events that may come from DVB v3 adapter */ |
78 | static void sms_board_dvb3_event(struct smsdvb_client_t *client, | 78 | static void sms_board_dvb3_event(struct smsdvb_client_t *client, |
79 | enum SMS_DVB3_EVENTS event) { | 79 | enum SMS_DVB3_EVENTS event) { |
80 | 80 | ||
81 | struct smscore_device_t *coredev = client->coredev; | 81 | struct smscore_device_t *coredev = client->coredev; |
82 | switch (event) { | 82 | switch (event) { |
83 | case DVB3_EVENT_INIT: | 83 | case DVB3_EVENT_INIT: |
84 | sms_debug("DVB3_EVENT_INIT"); | 84 | sms_debug("DVB3_EVENT_INIT"); |
85 | sms_board_event(coredev, BOARD_EVENT_BIND); | 85 | sms_board_event(coredev, BOARD_EVENT_BIND); |
86 | break; | 86 | break; |
87 | case DVB3_EVENT_SLEEP: | 87 | case DVB3_EVENT_SLEEP: |
88 | sms_debug("DVB3_EVENT_SLEEP"); | 88 | sms_debug("DVB3_EVENT_SLEEP"); |
89 | sms_board_event(coredev, BOARD_EVENT_POWER_SUSPEND); | 89 | sms_board_event(coredev, BOARD_EVENT_POWER_SUSPEND); |
90 | break; | 90 | break; |
91 | case DVB3_EVENT_HOTPLUG: | 91 | case DVB3_EVENT_HOTPLUG: |
92 | sms_debug("DVB3_EVENT_HOTPLUG"); | 92 | sms_debug("DVB3_EVENT_HOTPLUG"); |
93 | sms_board_event(coredev, BOARD_EVENT_POWER_INIT); | 93 | sms_board_event(coredev, BOARD_EVENT_POWER_INIT); |
94 | break; | 94 | break; |
95 | case DVB3_EVENT_FE_LOCK: | 95 | case DVB3_EVENT_FE_LOCK: |
96 | if (client->event_fe_state != DVB3_EVENT_FE_LOCK) { | 96 | if (client->event_fe_state != DVB3_EVENT_FE_LOCK) { |
97 | client->event_fe_state = DVB3_EVENT_FE_LOCK; | 97 | client->event_fe_state = DVB3_EVENT_FE_LOCK; |
98 | sms_debug("DVB3_EVENT_FE_LOCK"); | 98 | sms_debug("DVB3_EVENT_FE_LOCK"); |
99 | sms_board_event(coredev, BOARD_EVENT_FE_LOCK); | 99 | sms_board_event(coredev, BOARD_EVENT_FE_LOCK); |
100 | } | 100 | } |
101 | break; | 101 | break; |
102 | case DVB3_EVENT_FE_UNLOCK: | 102 | case DVB3_EVENT_FE_UNLOCK: |
103 | if (client->event_fe_state != DVB3_EVENT_FE_UNLOCK) { | 103 | if (client->event_fe_state != DVB3_EVENT_FE_UNLOCK) { |
104 | client->event_fe_state = DVB3_EVENT_FE_UNLOCK; | 104 | client->event_fe_state = DVB3_EVENT_FE_UNLOCK; |
105 | sms_debug("DVB3_EVENT_FE_UNLOCK"); | 105 | sms_debug("DVB3_EVENT_FE_UNLOCK"); |
106 | sms_board_event(coredev, BOARD_EVENT_FE_UNLOCK); | 106 | sms_board_event(coredev, BOARD_EVENT_FE_UNLOCK); |
107 | } | 107 | } |
108 | break; | 108 | break; |
109 | case DVB3_EVENT_UNC_OK: | 109 | case DVB3_EVENT_UNC_OK: |
110 | if (client->event_unc_state != DVB3_EVENT_UNC_OK) { | 110 | if (client->event_unc_state != DVB3_EVENT_UNC_OK) { |
111 | client->event_unc_state = DVB3_EVENT_UNC_OK; | 111 | client->event_unc_state = DVB3_EVENT_UNC_OK; |
112 | sms_debug("DVB3_EVENT_UNC_OK"); | 112 | sms_debug("DVB3_EVENT_UNC_OK"); |
113 | sms_board_event(coredev, BOARD_EVENT_MULTIPLEX_OK); | 113 | sms_board_event(coredev, BOARD_EVENT_MULTIPLEX_OK); |
114 | } | 114 | } |
115 | break; | 115 | break; |
116 | case DVB3_EVENT_UNC_ERR: | 116 | case DVB3_EVENT_UNC_ERR: |
117 | if (client->event_unc_state != DVB3_EVENT_UNC_ERR) { | 117 | if (client->event_unc_state != DVB3_EVENT_UNC_ERR) { |
118 | client->event_unc_state = DVB3_EVENT_UNC_ERR; | 118 | client->event_unc_state = DVB3_EVENT_UNC_ERR; |
119 | sms_debug("DVB3_EVENT_UNC_ERR"); | 119 | sms_debug("DVB3_EVENT_UNC_ERR"); |
120 | sms_board_event(coredev, BOARD_EVENT_MULTIPLEX_ERRORS); | 120 | sms_board_event(coredev, BOARD_EVENT_MULTIPLEX_ERRORS); |
121 | } | 121 | } |
122 | break; | 122 | break; |
123 | 123 | ||
124 | default: | 124 | default: |
125 | sms_err("Unknown dvb3 api event"); | 125 | sms_err("Unknown dvb3 api event"); |
126 | break; | 126 | break; |
127 | } | 127 | } |
128 | } | 128 | } |
129 | 129 | ||
130 | static void smsdvb_stats_not_ready(struct dvb_frontend *fe) | 130 | static void smsdvb_stats_not_ready(struct dvb_frontend *fe) |
131 | { | 131 | { |
132 | struct smsdvb_client_t *client = | 132 | struct smsdvb_client_t *client = |
133 | container_of(fe, struct smsdvb_client_t, frontend); | 133 | container_of(fe, struct smsdvb_client_t, frontend); |
134 | struct smscore_device_t *coredev = client->coredev; | 134 | struct smscore_device_t *coredev = client->coredev; |
135 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; | 135 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; |
136 | int i, n_layers; | 136 | int i, n_layers; |
137 | 137 | ||
138 | switch (smscore_get_device_mode(coredev)) { | 138 | switch (smscore_get_device_mode(coredev)) { |
139 | case DEVICE_MODE_ISDBT: | 139 | case DEVICE_MODE_ISDBT: |
140 | case DEVICE_MODE_ISDBT_BDA: | 140 | case DEVICE_MODE_ISDBT_BDA: |
141 | n_layers = 4; | 141 | n_layers = 4; |
142 | default: | 142 | default: |
143 | n_layers = 1; | 143 | n_layers = 1; |
144 | } | 144 | } |
145 | 145 | ||
146 | /* Global stats */ | 146 | /* Global stats */ |
147 | c->strength.len = 1; | 147 | c->strength.len = 1; |
148 | c->cnr.len = 1; | 148 | c->cnr.len = 1; |
149 | c->strength.stat[0].scale = FE_SCALE_DECIBEL; | 149 | c->strength.stat[0].scale = FE_SCALE_DECIBEL; |
150 | c->cnr.stat[0].scale = FE_SCALE_DECIBEL; | 150 | c->cnr.stat[0].scale = FE_SCALE_DECIBEL; |
151 | 151 | ||
152 | /* Per-layer stats */ | 152 | /* Per-layer stats */ |
153 | c->post_bit_error.len = n_layers; | 153 | c->post_bit_error.len = n_layers; |
154 | c->post_bit_count.len = n_layers; | 154 | c->post_bit_count.len = n_layers; |
155 | c->block_error.len = n_layers; | 155 | c->block_error.len = n_layers; |
156 | c->block_count.len = n_layers; | 156 | c->block_count.len = n_layers; |
157 | 157 | ||
158 | /* | 158 | /* |
159 | * Put all of them at FE_SCALE_NOT_AVAILABLE. They're dynamically | 159 | * Put all of them at FE_SCALE_NOT_AVAILABLE. They're dynamically |
160 | * changed when the stats become available. | 160 | * changed when the stats become available. |
161 | */ | 161 | */ |
162 | for (i = 0; i < n_layers; i++) { | 162 | for (i = 0; i < n_layers; i++) { |
163 | c->post_bit_error.stat[i].scale = FE_SCALE_NOT_AVAILABLE; | 163 | c->post_bit_error.stat[i].scale = FE_SCALE_NOT_AVAILABLE; |
164 | c->post_bit_count.stat[i].scale = FE_SCALE_NOT_AVAILABLE; | 164 | c->post_bit_count.stat[i].scale = FE_SCALE_NOT_AVAILABLE; |
165 | c->block_error.stat[i].scale = FE_SCALE_NOT_AVAILABLE; | 165 | c->block_error.stat[i].scale = FE_SCALE_NOT_AVAILABLE; |
166 | c->block_count.stat[i].scale = FE_SCALE_NOT_AVAILABLE; | 166 | c->block_count.stat[i].scale = FE_SCALE_NOT_AVAILABLE; |
167 | } | 167 | } |
168 | } | 168 | } |
169 | 169 | ||
170 | static inline int sms_to_mode(u32 mode) | 170 | static inline int sms_to_mode(u32 mode) |
171 | { | 171 | { |
172 | switch (mode) { | 172 | switch (mode) { |
173 | case 2: | 173 | case 2: |
174 | return TRANSMISSION_MODE_2K; | 174 | return TRANSMISSION_MODE_2K; |
175 | case 4: | 175 | case 4: |
176 | return TRANSMISSION_MODE_4K; | 176 | return TRANSMISSION_MODE_4K; |
177 | case 8: | 177 | case 8: |
178 | return TRANSMISSION_MODE_8K; | 178 | return TRANSMISSION_MODE_8K; |
179 | } | 179 | } |
180 | return TRANSMISSION_MODE_AUTO; | 180 | return TRANSMISSION_MODE_AUTO; |
181 | } | 181 | } |
182 | 182 | ||
183 | static inline int sms_to_status(u32 is_demod_locked, u32 is_rf_locked) | 183 | static inline int sms_to_status(u32 is_demod_locked, u32 is_rf_locked) |
184 | { | 184 | { |
185 | if (is_demod_locked) | 185 | if (is_demod_locked) |
186 | return FE_HAS_SIGNAL | FE_HAS_CARRIER | FE_HAS_VITERBI | | 186 | return FE_HAS_SIGNAL | FE_HAS_CARRIER | FE_HAS_VITERBI | |
187 | FE_HAS_SYNC | FE_HAS_LOCK; | 187 | FE_HAS_SYNC | FE_HAS_LOCK; |
188 | 188 | ||
189 | if (is_rf_locked) | 189 | if (is_rf_locked) |
190 | return FE_HAS_SIGNAL | FE_HAS_CARRIER; | 190 | return FE_HAS_SIGNAL | FE_HAS_CARRIER; |
191 | 191 | ||
192 | return 0; | 192 | return 0; |
193 | } | 193 | } |
194 | 194 | ||
195 | static inline u32 sms_to_bw(u32 value) | 195 | static inline u32 sms_to_bw(u32 value) |
196 | { | 196 | { |
197 | return value * 1000000; | 197 | return value * 1000000; |
198 | } | 198 | } |
199 | 199 | ||
200 | #define convert_from_table(value, table, defval) ({ \ | 200 | #define convert_from_table(value, table, defval) ({ \ |
201 | u32 __ret; \ | 201 | u32 __ret; \ |
202 | if (value < ARRAY_SIZE(table)) \ | 202 | if (value < ARRAY_SIZE(table)) \ |
203 | __ret = table[value]; \ | 203 | __ret = table[value]; \ |
204 | else \ | 204 | else \ |
205 | __ret = defval; \ | 205 | __ret = defval; \ |
206 | __ret; \ | 206 | __ret; \ |
207 | }) | 207 | }) |
208 | 208 | ||
209 | #define sms_to_guard_interval(value) \ | 209 | #define sms_to_guard_interval(value) \ |
210 | convert_from_table(value, sms_to_guard_interval_table, \ | 210 | convert_from_table(value, sms_to_guard_interval_table, \ |
211 | GUARD_INTERVAL_AUTO); | 211 | GUARD_INTERVAL_AUTO); |
212 | 212 | ||
213 | #define sms_to_code_rate(value) \ | 213 | #define sms_to_code_rate(value) \ |
214 | convert_from_table(value, sms_to_code_rate_table, \ | 214 | convert_from_table(value, sms_to_code_rate_table, \ |
215 | FEC_NONE); | 215 | FEC_NONE); |
216 | 216 | ||
217 | #define sms_to_hierarchy(value) \ | 217 | #define sms_to_hierarchy(value) \ |
218 | convert_from_table(value, sms_to_hierarchy_table, \ | 218 | convert_from_table(value, sms_to_hierarchy_table, \ |
219 | FEC_NONE); | 219 | FEC_NONE); |
220 | 220 | ||
221 | #define sms_to_modulation(value) \ | 221 | #define sms_to_modulation(value) \ |
222 | convert_from_table(value, sms_to_modulation_table, \ | 222 | convert_from_table(value, sms_to_modulation_table, \ |
223 | FEC_NONE); | 223 | FEC_NONE); |
224 | 224 | ||
225 | static void smsdvb_update_tx_params(struct smsdvb_client_t *client, | 225 | static void smsdvb_update_tx_params(struct smsdvb_client_t *client, |
226 | struct sms_tx_stats *p) | 226 | struct sms_tx_stats *p) |
227 | { | 227 | { |
228 | struct dvb_frontend *fe = &client->frontend; | 228 | struct dvb_frontend *fe = &client->frontend; |
229 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; | 229 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; |
230 | 230 | ||
231 | c->frequency = p->frequency; | 231 | c->frequency = p->frequency; |
232 | client->fe_status = sms_to_status(p->is_demod_locked, 0); | 232 | client->fe_status = sms_to_status(p->is_demod_locked, 0); |
233 | c->bandwidth_hz = sms_to_bw(p->bandwidth); | 233 | c->bandwidth_hz = sms_to_bw(p->bandwidth); |
234 | c->transmission_mode = sms_to_mode(p->transmission_mode); | 234 | c->transmission_mode = sms_to_mode(p->transmission_mode); |
235 | c->guard_interval = sms_to_guard_interval(p->guard_interval); | 235 | c->guard_interval = sms_to_guard_interval(p->guard_interval); |
236 | c->code_rate_HP = sms_to_code_rate(p->code_rate); | 236 | c->code_rate_HP = sms_to_code_rate(p->code_rate); |
237 | c->code_rate_LP = sms_to_code_rate(p->lp_code_rate); | 237 | c->code_rate_LP = sms_to_code_rate(p->lp_code_rate); |
238 | c->hierarchy = sms_to_hierarchy(p->hierarchy); | 238 | c->hierarchy = sms_to_hierarchy(p->hierarchy); |
239 | c->modulation = sms_to_modulation(p->constellation); | 239 | c->modulation = sms_to_modulation(p->constellation); |
240 | } | 240 | } |
241 | 241 | ||
242 | static void smsdvb_update_per_slices(struct smsdvb_client_t *client, | 242 | static void smsdvb_update_per_slices(struct smsdvb_client_t *client, |
243 | struct RECEPTION_STATISTICS_PER_SLICES_S *p) | 243 | struct RECEPTION_STATISTICS_PER_SLICES_S *p) |
244 | { | 244 | { |
245 | struct dvb_frontend *fe = &client->frontend; | 245 | struct dvb_frontend *fe = &client->frontend; |
246 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; | 246 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; |
247 | 247 | ||
248 | client->fe_status = sms_to_status(p->is_demod_locked, p->is_rf_locked); | 248 | client->fe_status = sms_to_status(p->is_demod_locked, p->is_rf_locked); |
249 | c->modulation = sms_to_modulation(p->constellation); | 249 | c->modulation = sms_to_modulation(p->constellation); |
250 | 250 | ||
251 | /* signal Strength, in DBm */ | 251 | /* signal Strength, in DBm */ |
252 | c->strength.stat[0].uvalue = p->in_band_power * 1000; | 252 | c->strength.stat[0].uvalue = p->in_band_power * 1000; |
253 | 253 | ||
254 | /* Carrier to noise ratio, in DB */ | 254 | /* Carrier to noise ratio, in DB */ |
255 | c->cnr.stat[0].svalue = p->snr * 1000; | 255 | c->cnr.stat[0].svalue = p->snr * 1000; |
256 | 256 | ||
257 | /* PER/BER requires demod lock */ | 257 | /* PER/BER requires demod lock */ |
258 | if (!p->is_demod_locked) | 258 | if (!p->is_demod_locked) |
259 | return; | 259 | return; |
260 | 260 | ||
261 | /* TS PER */ | 261 | /* TS PER */ |
262 | client->last_per = c->block_error.stat[0].uvalue; | 262 | client->last_per = c->block_error.stat[0].uvalue; |
263 | c->block_error.stat[0].scale = FE_SCALE_COUNTER; | 263 | c->block_error.stat[0].scale = FE_SCALE_COUNTER; |
264 | c->block_count.stat[0].scale = FE_SCALE_COUNTER; | 264 | c->block_count.stat[0].scale = FE_SCALE_COUNTER; |
265 | c->block_error.stat[0].uvalue += p->ets_packets; | 265 | c->block_error.stat[0].uvalue += p->ets_packets; |
266 | c->block_count.stat[0].uvalue += p->ets_packets + p->ts_packets; | 266 | c->block_count.stat[0].uvalue += p->ets_packets + p->ts_packets; |
267 | 267 | ||
268 | /* BER */ | 268 | /* ber */ |
269 | c->post_bit_error.stat[0].scale = FE_SCALE_COUNTER; | 269 | c->post_bit_error.stat[0].scale = FE_SCALE_COUNTER; |
270 | c->post_bit_count.stat[0].scale = FE_SCALE_COUNTER; | 270 | c->post_bit_count.stat[0].scale = FE_SCALE_COUNTER; |
271 | c->post_bit_error.stat[0].uvalue += p->ber_error_count; | 271 | c->post_bit_error.stat[0].uvalue += p->ber_error_count; |
272 | c->post_bit_count.stat[0].uvalue += p->ber_bit_count; | 272 | c->post_bit_count.stat[0].uvalue += p->ber_bit_count; |
273 | 273 | ||
274 | /* Legacy PER/BER */ | 274 | /* Legacy PER/BER */ |
275 | client->legacy_per = (p->ets_packets * 65535) / | 275 | client->legacy_per = (p->ets_packets * 65535) / |
276 | (p->ts_packets + p->ets_packets); | 276 | (p->ts_packets + p->ets_packets); |
277 | } | 277 | } |
278 | 278 | ||
279 | static void smsdvb_update_dvb_stats(struct smsdvb_client_t *client, | 279 | static void smsdvb_update_dvb_stats(struct smsdvb_client_t *client, |
280 | struct sms_stats *p) | 280 | struct sms_stats *p) |
281 | { | 281 | { |
282 | struct dvb_frontend *fe = &client->frontend; | 282 | struct dvb_frontend *fe = &client->frontend; |
283 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; | 283 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; |
284 | 284 | ||
285 | if (client->prt_dvb_stats) | 285 | if (client->prt_dvb_stats) |
286 | client->prt_dvb_stats(client->debug_data, p); | 286 | client->prt_dvb_stats(client->debug_data, p); |
287 | 287 | ||
288 | client->fe_status = sms_to_status(p->is_demod_locked, p->is_rf_locked); | 288 | client->fe_status = sms_to_status(p->is_demod_locked, p->is_rf_locked); |
289 | 289 | ||
290 | /* Update DVB modulation parameters */ | 290 | /* Update DVB modulation parameters */ |
291 | c->frequency = p->frequency; | 291 | c->frequency = p->frequency; |
292 | client->fe_status = sms_to_status(p->is_demod_locked, 0); | 292 | client->fe_status = sms_to_status(p->is_demod_locked, 0); |
293 | c->bandwidth_hz = sms_to_bw(p->bandwidth); | 293 | c->bandwidth_hz = sms_to_bw(p->bandwidth); |
294 | c->transmission_mode = sms_to_mode(p->transmission_mode); | 294 | c->transmission_mode = sms_to_mode(p->transmission_mode); |
295 | c->guard_interval = sms_to_guard_interval(p->guard_interval); | 295 | c->guard_interval = sms_to_guard_interval(p->guard_interval); |
296 | c->code_rate_HP = sms_to_code_rate(p->code_rate); | 296 | c->code_rate_HP = sms_to_code_rate(p->code_rate); |
297 | c->code_rate_LP = sms_to_code_rate(p->lp_code_rate); | 297 | c->code_rate_LP = sms_to_code_rate(p->lp_code_rate); |
298 | c->hierarchy = sms_to_hierarchy(p->hierarchy); | 298 | c->hierarchy = sms_to_hierarchy(p->hierarchy); |
299 | c->modulation = sms_to_modulation(p->constellation); | 299 | c->modulation = sms_to_modulation(p->constellation); |
300 | 300 | ||
301 | /* update reception data */ | 301 | /* update reception data */ |
302 | c->lna = p->is_external_lna_on ? 1 : 0; | 302 | c->lna = p->is_external_lna_on ? 1 : 0; |
303 | 303 | ||
304 | /* Carrier to noise ratio, in DB */ | 304 | /* Carrier to noise ratio, in DB */ |
305 | c->cnr.stat[0].svalue = p->SNR * 1000; | 305 | c->cnr.stat[0].svalue = p->SNR * 1000; |
306 | 306 | ||
307 | /* signal Strength, in DBm */ | 307 | /* signal Strength, in DBm */ |
308 | c->strength.stat[0].uvalue = p->in_band_pwr * 1000; | 308 | c->strength.stat[0].uvalue = p->in_band_pwr * 1000; |
309 | 309 | ||
310 | /* PER/BER requires demod lock */ | 310 | /* PER/BER requires demod lock */ |
311 | if (!p->is_demod_locked) | 311 | if (!p->is_demod_locked) |
312 | return; | 312 | return; |
313 | 313 | ||
314 | /* TS PER */ | 314 | /* TS PER */ |
315 | client->last_per = c->block_error.stat[0].uvalue; | 315 | client->last_per = c->block_error.stat[0].uvalue; |
316 | c->block_error.stat[0].scale = FE_SCALE_COUNTER; | 316 | c->block_error.stat[0].scale = FE_SCALE_COUNTER; |
317 | c->block_count.stat[0].scale = FE_SCALE_COUNTER; | 317 | c->block_count.stat[0].scale = FE_SCALE_COUNTER; |
318 | c->block_error.stat[0].uvalue += p->error_ts_packets; | 318 | c->block_error.stat[0].uvalue += p->error_ts_packets; |
319 | c->block_count.stat[0].uvalue += p->total_ts_packets; | 319 | c->block_count.stat[0].uvalue += p->total_ts_packets; |
320 | 320 | ||
321 | /* BER */ | 321 | /* ber */ |
322 | c->post_bit_error.stat[0].scale = FE_SCALE_COUNTER; | 322 | c->post_bit_error.stat[0].scale = FE_SCALE_COUNTER; |
323 | c->post_bit_count.stat[0].scale = FE_SCALE_COUNTER; | 323 | c->post_bit_count.stat[0].scale = FE_SCALE_COUNTER; |
324 | c->post_bit_error.stat[0].uvalue += p->ber_error_count; | 324 | c->post_bit_error.stat[0].uvalue += p->ber_error_count; |
325 | c->post_bit_count.stat[0].uvalue += p->ber_bit_count; | 325 | c->post_bit_count.stat[0].uvalue += p->ber_bit_count; |
326 | 326 | ||
327 | /* Legacy PER/BER */ | 327 | /* Legacy PER/BER */ |
328 | client->legacy_ber = p->BER; | 328 | client->legacy_ber = p->ber; |
329 | }; | 329 | }; |
330 | 330 | ||
331 | static void smsdvb_update_isdbt_stats(struct smsdvb_client_t *client, | 331 | static void smsdvb_update_isdbt_stats(struct smsdvb_client_t *client, |
332 | struct sms_isdbt_stats *p) | 332 | struct sms_isdbt_stats *p) |
333 | { | 333 | { |
334 | struct dvb_frontend *fe = &client->frontend; | 334 | struct dvb_frontend *fe = &client->frontend; |
335 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; | 335 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; |
336 | struct sms_isdbt_layer_stats *lr; | 336 | struct sms_isdbt_layer_stats *lr; |
337 | int i, n_layers; | 337 | int i, n_layers; |
338 | 338 | ||
339 | if (client->prt_isdb_stats) | 339 | if (client->prt_isdb_stats) |
340 | client->prt_isdb_stats(client->debug_data, p); | 340 | client->prt_isdb_stats(client->debug_data, p); |
341 | 341 | ||
342 | client->fe_status = sms_to_status(p->is_demod_locked, p->is_rf_locked); | 342 | client->fe_status = sms_to_status(p->is_demod_locked, p->is_rf_locked); |
343 | 343 | ||
344 | /* | 344 | /* |
345 | * Firmware 2.1 seems to report only lock status and | 345 | * Firmware 2.1 seems to report only lock status and |
346 | * signal strength. The signal strength indicator is at the | 346 | * signal strength. The signal strength indicator is at the |
347 | * wrong field. | 347 | * wrong field. |
348 | */ | 348 | */ |
349 | if (p->statistics_type == 0) { | 349 | if (p->statistics_type == 0) { |
350 | c->strength.stat[0].uvalue = ((s32)p->transmission_mode) * 1000; | 350 | c->strength.stat[0].uvalue = ((s32)p->transmission_mode) * 1000; |
351 | c->cnr.stat[0].scale = FE_SCALE_NOT_AVAILABLE; | 351 | c->cnr.stat[0].scale = FE_SCALE_NOT_AVAILABLE; |
352 | return; | 352 | return; |
353 | } | 353 | } |
354 | 354 | ||
355 | /* Update ISDB-T transmission parameters */ | 355 | /* Update ISDB-T transmission parameters */ |
356 | c->frequency = p->frequency; | 356 | c->frequency = p->frequency; |
357 | c->bandwidth_hz = sms_to_bw(p->bandwidth); | 357 | c->bandwidth_hz = sms_to_bw(p->bandwidth); |
358 | c->transmission_mode = sms_to_mode(p->transmission_mode); | 358 | c->transmission_mode = sms_to_mode(p->transmission_mode); |
359 | c->guard_interval = sms_to_guard_interval(p->guard_interval); | 359 | c->guard_interval = sms_to_guard_interval(p->guard_interval); |
360 | c->isdbt_partial_reception = p->partial_reception ? 1 : 0; | 360 | c->isdbt_partial_reception = p->partial_reception ? 1 : 0; |
361 | n_layers = p->num_of_layers; | 361 | n_layers = p->num_of_layers; |
362 | if (n_layers < 1) | 362 | if (n_layers < 1) |
363 | n_layers = 1; | 363 | n_layers = 1; |
364 | if (n_layers > 3) | 364 | if (n_layers > 3) |
365 | n_layers = 3; | 365 | n_layers = 3; |
366 | c->isdbt_layer_enabled = 0; | 366 | c->isdbt_layer_enabled = 0; |
367 | 367 | ||
368 | /* update reception data */ | 368 | /* update reception data */ |
369 | c->lna = p->is_external_lna_on ? 1 : 0; | 369 | c->lna = p->is_external_lna_on ? 1 : 0; |
370 | 370 | ||
371 | /* Carrier to noise ratio, in DB */ | 371 | /* Carrier to noise ratio, in DB */ |
372 | c->cnr.stat[0].svalue = p->SNR * 1000; | 372 | c->cnr.stat[0].svalue = p->SNR * 1000; |
373 | 373 | ||
374 | /* signal Strength, in DBm */ | 374 | /* signal Strength, in DBm */ |
375 | c->strength.stat[0].uvalue = p->in_band_pwr * 1000; | 375 | c->strength.stat[0].uvalue = p->in_band_pwr * 1000; |
376 | 376 | ||
377 | /* PER/BER and per-layer stats require demod lock */ | 377 | /* PER/BER and per-layer stats require demod lock */ |
378 | if (!p->is_demod_locked) | 378 | if (!p->is_demod_locked) |
379 | return; | 379 | return; |
380 | 380 | ||
381 | client->last_per = c->block_error.stat[0].uvalue; | 381 | client->last_per = c->block_error.stat[0].uvalue; |
382 | 382 | ||
383 | /* Clears global counters, as the code below will sum it again */ | 383 | /* Clears global counters, as the code below will sum it again */ |
384 | c->block_error.stat[0].uvalue = 0; | 384 | c->block_error.stat[0].uvalue = 0; |
385 | c->block_count.stat[0].uvalue = 0; | 385 | c->block_count.stat[0].uvalue = 0; |
386 | c->block_error.stat[0].scale = FE_SCALE_COUNTER; | 386 | c->block_error.stat[0].scale = FE_SCALE_COUNTER; |
387 | c->block_count.stat[0].scale = FE_SCALE_COUNTER; | 387 | c->block_count.stat[0].scale = FE_SCALE_COUNTER; |
388 | c->post_bit_error.stat[0].uvalue = 0; | 388 | c->post_bit_error.stat[0].uvalue = 0; |
389 | c->post_bit_count.stat[0].uvalue = 0; | 389 | c->post_bit_count.stat[0].uvalue = 0; |
390 | c->post_bit_error.stat[0].scale = FE_SCALE_COUNTER; | 390 | c->post_bit_error.stat[0].scale = FE_SCALE_COUNTER; |
391 | c->post_bit_count.stat[0].scale = FE_SCALE_COUNTER; | 391 | c->post_bit_count.stat[0].scale = FE_SCALE_COUNTER; |
392 | 392 | ||
393 | for (i = 0; i < n_layers; i++) { | 393 | for (i = 0; i < n_layers; i++) { |
394 | lr = &p->LayerInfo[i]; | 394 | lr = &p->layer_info[i]; |
395 | 395 | ||
396 | /* Update per-layer transmission parameters */ | 396 | /* Update per-layer transmission parameters */ |
397 | if (lr->number_of_segments > 0 && lr->number_of_segments < 13) { | 397 | if (lr->number_of_segments > 0 && lr->number_of_segments < 13) { |
398 | c->isdbt_layer_enabled |= 1 << i; | 398 | c->isdbt_layer_enabled |= 1 << i; |
399 | c->layer[i].segment_count = lr->number_of_segments; | 399 | c->layer[i].segment_count = lr->number_of_segments; |
400 | } else { | 400 | } else { |
401 | continue; | 401 | continue; |
402 | } | 402 | } |
403 | c->layer[i].modulation = sms_to_modulation(lr->constellation); | 403 | c->layer[i].modulation = sms_to_modulation(lr->constellation); |
404 | 404 | ||
405 | /* TS PER */ | 405 | /* TS PER */ |
406 | c->block_error.stat[i + 1].scale = FE_SCALE_COUNTER; | 406 | c->block_error.stat[i + 1].scale = FE_SCALE_COUNTER; |
407 | c->block_count.stat[i + 1].scale = FE_SCALE_COUNTER; | 407 | c->block_count.stat[i + 1].scale = FE_SCALE_COUNTER; |
408 | c->block_error.stat[i + 1].uvalue += lr->error_ts_packets; | 408 | c->block_error.stat[i + 1].uvalue += lr->error_ts_packets; |
409 | c->block_count.stat[i + 1].uvalue += lr->total_ts_packets; | 409 | c->block_count.stat[i + 1].uvalue += lr->total_ts_packets; |
410 | 410 | ||
411 | /* Update global PER counter */ | 411 | /* Update global PER counter */ |
412 | c->block_error.stat[0].uvalue += lr->error_ts_packets; | 412 | c->block_error.stat[0].uvalue += lr->error_ts_packets; |
413 | c->block_count.stat[0].uvalue += lr->total_ts_packets; | 413 | c->block_count.stat[0].uvalue += lr->total_ts_packets; |
414 | 414 | ||
415 | /* BER */ | 415 | /* BER */ |
416 | c->post_bit_error.stat[i + 1].scale = FE_SCALE_COUNTER; | 416 | c->post_bit_error.stat[i + 1].scale = FE_SCALE_COUNTER; |
417 | c->post_bit_count.stat[i + 1].scale = FE_SCALE_COUNTER; | 417 | c->post_bit_count.stat[i + 1].scale = FE_SCALE_COUNTER; |
418 | c->post_bit_error.stat[i + 1].uvalue += lr->ber_error_count; | 418 | c->post_bit_error.stat[i + 1].uvalue += lr->ber_error_count; |
419 | c->post_bit_count.stat[i + 1].uvalue += lr->ber_bit_count; | 419 | c->post_bit_count.stat[i + 1].uvalue += lr->ber_bit_count; |
420 | 420 | ||
421 | /* Update global BER counter */ | 421 | /* Update global BER counter */ |
422 | c->post_bit_error.stat[0].uvalue += lr->ber_error_count; | 422 | c->post_bit_error.stat[0].uvalue += lr->ber_error_count; |
423 | c->post_bit_count.stat[0].uvalue += lr->ber_bit_count; | 423 | c->post_bit_count.stat[0].uvalue += lr->ber_bit_count; |
424 | } | 424 | } |
425 | } | 425 | } |
426 | 426 | ||
427 | static void smsdvb_update_isdbt_stats_ex(struct smsdvb_client_t *client, | 427 | static void smsdvb_update_isdbt_stats_ex(struct smsdvb_client_t *client, |
428 | struct sms_isdbt_stats_ex *p) | 428 | struct sms_isdbt_stats_ex *p) |
429 | { | 429 | { |
430 | struct dvb_frontend *fe = &client->frontend; | 430 | struct dvb_frontend *fe = &client->frontend; |
431 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; | 431 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; |
432 | struct sms_isdbt_layer_stats *lr; | 432 | struct sms_isdbt_layer_stats *lr; |
433 | int i, n_layers; | 433 | int i, n_layers; |
434 | 434 | ||
435 | if (client->prt_isdb_stats_ex) | 435 | if (client->prt_isdb_stats_ex) |
436 | client->prt_isdb_stats_ex(client->debug_data, p); | 436 | client->prt_isdb_stats_ex(client->debug_data, p); |
437 | 437 | ||
438 | /* Update ISDB-T transmission parameters */ | 438 | /* Update ISDB-T transmission parameters */ |
439 | c->frequency = p->frequency; | 439 | c->frequency = p->frequency; |
440 | client->fe_status = sms_to_status(p->is_demod_locked, 0); | 440 | client->fe_status = sms_to_status(p->is_demod_locked, 0); |
441 | c->bandwidth_hz = sms_to_bw(p->bandwidth); | 441 | c->bandwidth_hz = sms_to_bw(p->bandwidth); |
442 | c->transmission_mode = sms_to_mode(p->transmission_mode); | 442 | c->transmission_mode = sms_to_mode(p->transmission_mode); |
443 | c->guard_interval = sms_to_guard_interval(p->guard_interval); | 443 | c->guard_interval = sms_to_guard_interval(p->guard_interval); |
444 | c->isdbt_partial_reception = p->partial_reception ? 1 : 0; | 444 | c->isdbt_partial_reception = p->partial_reception ? 1 : 0; |
445 | n_layers = p->num_of_layers; | 445 | n_layers = p->num_of_layers; |
446 | if (n_layers < 1) | 446 | if (n_layers < 1) |
447 | n_layers = 1; | 447 | n_layers = 1; |
448 | if (n_layers > 3) | 448 | if (n_layers > 3) |
449 | n_layers = 3; | 449 | n_layers = 3; |
450 | c->isdbt_layer_enabled = 0; | 450 | c->isdbt_layer_enabled = 0; |
451 | 451 | ||
452 | /* update reception data */ | 452 | /* update reception data */ |
453 | c->lna = p->is_external_lna_on ? 1 : 0; | 453 | c->lna = p->is_external_lna_on ? 1 : 0; |
454 | 454 | ||
455 | /* Carrier to noise ratio, in DB */ | 455 | /* Carrier to noise ratio, in DB */ |
456 | c->cnr.stat[0].svalue = p->SNR * 1000; | 456 | c->cnr.stat[0].svalue = p->SNR * 1000; |
457 | 457 | ||
458 | /* signal Strength, in DBm */ | 458 | /* signal Strength, in DBm */ |
459 | c->strength.stat[0].uvalue = p->in_band_pwr * 1000; | 459 | c->strength.stat[0].uvalue = p->in_band_pwr * 1000; |
460 | 460 | ||
461 | /* PER/BER and per-layer stats require demod lock */ | 461 | /* PER/BER and per-layer stats require demod lock */ |
462 | if (!p->is_demod_locked) | 462 | if (!p->is_demod_locked) |
463 | return; | 463 | return; |
464 | 464 | ||
465 | client->last_per = c->block_error.stat[0].uvalue; | 465 | client->last_per = c->block_error.stat[0].uvalue; |
466 | 466 | ||
467 | /* Clears global counters, as the code below will sum it again */ | 467 | /* Clears global counters, as the code below will sum it again */ |
468 | c->block_error.stat[0].uvalue = 0; | 468 | c->block_error.stat[0].uvalue = 0; |
469 | c->block_count.stat[0].uvalue = 0; | 469 | c->block_count.stat[0].uvalue = 0; |
470 | c->block_error.stat[0].scale = FE_SCALE_COUNTER; | 470 | c->block_error.stat[0].scale = FE_SCALE_COUNTER; |
471 | c->block_count.stat[0].scale = FE_SCALE_COUNTER; | 471 | c->block_count.stat[0].scale = FE_SCALE_COUNTER; |
472 | c->post_bit_error.stat[0].uvalue = 0; | 472 | c->post_bit_error.stat[0].uvalue = 0; |
473 | c->post_bit_count.stat[0].uvalue = 0; | 473 | c->post_bit_count.stat[0].uvalue = 0; |
474 | c->post_bit_error.stat[0].scale = FE_SCALE_COUNTER; | 474 | c->post_bit_error.stat[0].scale = FE_SCALE_COUNTER; |
475 | c->post_bit_count.stat[0].scale = FE_SCALE_COUNTER; | 475 | c->post_bit_count.stat[0].scale = FE_SCALE_COUNTER; |
476 | 476 | ||
477 | c->post_bit_error.len = n_layers + 1; | 477 | c->post_bit_error.len = n_layers + 1; |
478 | c->post_bit_count.len = n_layers + 1; | 478 | c->post_bit_count.len = n_layers + 1; |
479 | c->block_error.len = n_layers + 1; | 479 | c->block_error.len = n_layers + 1; |
480 | c->block_count.len = n_layers + 1; | 480 | c->block_count.len = n_layers + 1; |
481 | for (i = 0; i < n_layers; i++) { | 481 | for (i = 0; i < n_layers; i++) { |
482 | lr = &p->LayerInfo[i]; | 482 | lr = &p->layer_info[i]; |
483 | 483 | ||
484 | /* Update per-layer transmission parameters */ | 484 | /* Update per-layer transmission parameters */ |
485 | if (lr->number_of_segments > 0 && lr->number_of_segments < 13) { | 485 | if (lr->number_of_segments > 0 && lr->number_of_segments < 13) { |
486 | c->isdbt_layer_enabled |= 1 << i; | 486 | c->isdbt_layer_enabled |= 1 << i; |
487 | c->layer[i].segment_count = lr->number_of_segments; | 487 | c->layer[i].segment_count = lr->number_of_segments; |
488 | } else { | 488 | } else { |
489 | continue; | 489 | continue; |
490 | } | 490 | } |
491 | c->layer[i].modulation = sms_to_modulation(lr->constellation); | 491 | c->layer[i].modulation = sms_to_modulation(lr->constellation); |
492 | 492 | ||
493 | /* TS PER */ | 493 | /* TS PER */ |
494 | c->block_error.stat[i + 1].scale = FE_SCALE_COUNTER; | 494 | c->block_error.stat[i + 1].scale = FE_SCALE_COUNTER; |
495 | c->block_count.stat[i + 1].scale = FE_SCALE_COUNTER; | 495 | c->block_count.stat[i + 1].scale = FE_SCALE_COUNTER; |
496 | c->block_error.stat[i + 1].uvalue += lr->error_ts_packets; | 496 | c->block_error.stat[i + 1].uvalue += lr->error_ts_packets; |
497 | c->block_count.stat[i + 1].uvalue += lr->total_ts_packets; | 497 | c->block_count.stat[i + 1].uvalue += lr->total_ts_packets; |
498 | 498 | ||
499 | /* Update global PER counter */ | 499 | /* Update global PER counter */ |
500 | c->block_error.stat[0].uvalue += lr->error_ts_packets; | 500 | c->block_error.stat[0].uvalue += lr->error_ts_packets; |
501 | c->block_count.stat[0].uvalue += lr->total_ts_packets; | 501 | c->block_count.stat[0].uvalue += lr->total_ts_packets; |
502 | 502 | ||
503 | /* BER */ | 503 | /* ber */ |
504 | c->post_bit_error.stat[i + 1].scale = FE_SCALE_COUNTER; | 504 | c->post_bit_error.stat[i + 1].scale = FE_SCALE_COUNTER; |
505 | c->post_bit_count.stat[i + 1].scale = FE_SCALE_COUNTER; | 505 | c->post_bit_count.stat[i + 1].scale = FE_SCALE_COUNTER; |
506 | c->post_bit_error.stat[i + 1].uvalue += lr->ber_error_count; | 506 | c->post_bit_error.stat[i + 1].uvalue += lr->ber_error_count; |
507 | c->post_bit_count.stat[i + 1].uvalue += lr->ber_bit_count; | 507 | c->post_bit_count.stat[i + 1].uvalue += lr->ber_bit_count; |
508 | 508 | ||
509 | /* Update global BER counter */ | 509 | /* Update global ber counter */ |
510 | c->post_bit_error.stat[0].uvalue += lr->ber_error_count; | 510 | c->post_bit_error.stat[0].uvalue += lr->ber_error_count; |
511 | c->post_bit_count.stat[0].uvalue += lr->ber_bit_count; | 511 | c->post_bit_count.stat[0].uvalue += lr->ber_bit_count; |
512 | } | 512 | } |
513 | } | 513 | } |
514 | 514 | ||
515 | static int smsdvb_onresponse(void *context, struct smscore_buffer_t *cb) | 515 | static int smsdvb_onresponse(void *context, struct smscore_buffer_t *cb) |
516 | { | 516 | { |
517 | struct smsdvb_client_t *client = (struct smsdvb_client_t *) context; | 517 | struct smsdvb_client_t *client = (struct smsdvb_client_t *) context; |
518 | struct sms_msg_hdr *phdr = (struct sms_msg_hdr *) (((u8 *) cb->p) | 518 | struct sms_msg_hdr *phdr = (struct sms_msg_hdr *) (((u8 *) cb->p) |
519 | + cb->offset); | 519 | + cb->offset); |
520 | void *p = phdr + 1; | 520 | void *p = phdr + 1; |
521 | struct dvb_frontend *fe = &client->frontend; | 521 | struct dvb_frontend *fe = &client->frontend; |
522 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; | 522 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; |
523 | bool is_status_update = false; | 523 | bool is_status_update = false; |
524 | 524 | ||
525 | switch (phdr->msg_type) { | 525 | switch (phdr->msg_type) { |
526 | case MSG_SMS_DVBT_BDA_DATA: | 526 | case MSG_SMS_DVBT_BDA_DATA: |
527 | /* | 527 | /* |
528 | * Only feed data to dvb demux if are there any feed listening | 528 | * Only feed data to dvb demux if are there any feed listening |
529 | * to it and if the device has tuned | 529 | * to it and if the device has tuned |
530 | */ | 530 | */ |
531 | if (client->feed_users && client->has_tuned) | 531 | if (client->feed_users && client->has_tuned) |
532 | dvb_dmx_swfilter(&client->demux, p, | 532 | dvb_dmx_swfilter(&client->demux, p, |
533 | cb->size - sizeof(struct sms_msg_hdr)); | 533 | cb->size - sizeof(struct sms_msg_hdr)); |
534 | break; | 534 | break; |
535 | 535 | ||
536 | case MSG_SMS_RF_TUNE_RES: | 536 | case MSG_SMS_RF_TUNE_RES: |
537 | case MSG_SMS_ISDBT_TUNE_RES: | 537 | case MSG_SMS_ISDBT_TUNE_RES: |
538 | complete(&client->tune_done); | 538 | complete(&client->tune_done); |
539 | break; | 539 | break; |
540 | 540 | ||
541 | case MSG_SMS_SIGNAL_DETECTED_IND: | 541 | case MSG_SMS_SIGNAL_DETECTED_IND: |
542 | client->fe_status = FE_HAS_SIGNAL | FE_HAS_CARRIER | | 542 | client->fe_status = FE_HAS_SIGNAL | FE_HAS_CARRIER | |
543 | FE_HAS_VITERBI | FE_HAS_SYNC | | 543 | FE_HAS_VITERBI | FE_HAS_SYNC | |
544 | FE_HAS_LOCK; | 544 | FE_HAS_LOCK; |
545 | 545 | ||
546 | is_status_update = true; | 546 | is_status_update = true; |
547 | break; | 547 | break; |
548 | 548 | ||
549 | case MSG_SMS_NO_SIGNAL_IND: | 549 | case MSG_SMS_NO_SIGNAL_IND: |
550 | client->fe_status = 0; | 550 | client->fe_status = 0; |
551 | 551 | ||
552 | is_status_update = true; | 552 | is_status_update = true; |
553 | break; | 553 | break; |
554 | 554 | ||
555 | case MSG_SMS_TRANSMISSION_IND: | 555 | case MSG_SMS_TRANSMISSION_IND: |
556 | smsdvb_update_tx_params(client, p); | 556 | smsdvb_update_tx_params(client, p); |
557 | 557 | ||
558 | is_status_update = true; | 558 | is_status_update = true; |
559 | break; | 559 | break; |
560 | 560 | ||
561 | case MSG_SMS_HO_PER_SLICES_IND: | 561 | case MSG_SMS_HO_PER_SLICES_IND: |
562 | smsdvb_update_per_slices(client, p); | 562 | smsdvb_update_per_slices(client, p); |
563 | 563 | ||
564 | is_status_update = true; | 564 | is_status_update = true; |
565 | break; | 565 | break; |
566 | 566 | ||
567 | case MSG_SMS_GET_STATISTICS_RES: | 567 | case MSG_SMS_GET_STATISTICS_RES: |
568 | switch (smscore_get_device_mode(client->coredev)) { | 568 | switch (smscore_get_device_mode(client->coredev)) { |
569 | case DEVICE_MODE_ISDBT: | 569 | case DEVICE_MODE_ISDBT: |
570 | case DEVICE_MODE_ISDBT_BDA: | 570 | case DEVICE_MODE_ISDBT_BDA: |
571 | smsdvb_update_isdbt_stats(client, p); | 571 | smsdvb_update_isdbt_stats(client, p); |
572 | break; | 572 | break; |
573 | default: | 573 | default: |
574 | /* Skip sms_msg_statistics_info:request_result field */ | 574 | /* Skip sms_msg_statistics_info:request_result field */ |
575 | smsdvb_update_dvb_stats(client, p + sizeof(u32)); | 575 | smsdvb_update_dvb_stats(client, p + sizeof(u32)); |
576 | } | 576 | } |
577 | 577 | ||
578 | is_status_update = true; | 578 | is_status_update = true; |
579 | break; | 579 | break; |
580 | 580 | ||
581 | /* Only for ISDB-T */ | 581 | /* Only for ISDB-T */ |
582 | case MSG_SMS_GET_STATISTICS_EX_RES: | 582 | case MSG_SMS_GET_STATISTICS_EX_RES: |
583 | /* Skip sms_msg_statistics_info:request_result field? */ | 583 | /* Skip sms_msg_statistics_info:request_result field? */ |
584 | smsdvb_update_isdbt_stats_ex(client, p + sizeof(u32)); | 584 | smsdvb_update_isdbt_stats_ex(client, p + sizeof(u32)); |
585 | is_status_update = true; | 585 | is_status_update = true; |
586 | break; | 586 | break; |
587 | default: | 587 | default: |
588 | sms_info("message not handled"); | 588 | sms_info("message not handled"); |
589 | } | 589 | } |
590 | smscore_putbuffer(client->coredev, cb); | 590 | smscore_putbuffer(client->coredev, cb); |
591 | 591 | ||
592 | if (is_status_update) { | 592 | if (is_status_update) { |
593 | if (client->fe_status & FE_HAS_LOCK) { | 593 | if (client->fe_status & FE_HAS_LOCK) { |
594 | sms_board_dvb3_event(client, DVB3_EVENT_FE_LOCK); | 594 | sms_board_dvb3_event(client, DVB3_EVENT_FE_LOCK); |
595 | if (client->last_per == c->block_error.stat[0].uvalue) | 595 | if (client->last_per == c->block_error.stat[0].uvalue) |
596 | sms_board_dvb3_event(client, DVB3_EVENT_UNC_OK); | 596 | sms_board_dvb3_event(client, DVB3_EVENT_UNC_OK); |
597 | else | 597 | else |
598 | sms_board_dvb3_event(client, DVB3_EVENT_UNC_ERR); | 598 | sms_board_dvb3_event(client, DVB3_EVENT_UNC_ERR); |
599 | client->has_tuned = true; | 599 | client->has_tuned = true; |
600 | } else { | 600 | } else { |
601 | smsdvb_stats_not_ready(fe); | 601 | smsdvb_stats_not_ready(fe); |
602 | client->has_tuned = false; | 602 | client->has_tuned = false; |
603 | sms_board_dvb3_event(client, DVB3_EVENT_FE_UNLOCK); | 603 | sms_board_dvb3_event(client, DVB3_EVENT_FE_UNLOCK); |
604 | } | 604 | } |
605 | complete(&client->stats_done); | 605 | complete(&client->stats_done); |
606 | } | 606 | } |
607 | 607 | ||
608 | return 0; | 608 | return 0; |
609 | } | 609 | } |
610 | 610 | ||
611 | static void smsdvb_unregister_client(struct smsdvb_client_t *client) | 611 | static void smsdvb_unregister_client(struct smsdvb_client_t *client) |
612 | { | 612 | { |
613 | /* must be called under clientslock */ | 613 | /* must be called under clientslock */ |
614 | 614 | ||
615 | list_del(&client->entry); | 615 | list_del(&client->entry); |
616 | 616 | ||
617 | smsdvb_debugfs_release(client); | 617 | smsdvb_debugfs_release(client); |
618 | smscore_unregister_client(client->smsclient); | 618 | smscore_unregister_client(client->smsclient); |
619 | dvb_unregister_frontend(&client->frontend); | 619 | dvb_unregister_frontend(&client->frontend); |
620 | dvb_dmxdev_release(&client->dmxdev); | 620 | dvb_dmxdev_release(&client->dmxdev); |
621 | dvb_dmx_release(&client->demux); | 621 | dvb_dmx_release(&client->demux); |
622 | dvb_unregister_adapter(&client->adapter); | 622 | dvb_unregister_adapter(&client->adapter); |
623 | kfree(client); | 623 | kfree(client); |
624 | } | 624 | } |
625 | 625 | ||
626 | static void smsdvb_onremove(void *context) | 626 | static void smsdvb_onremove(void *context) |
627 | { | 627 | { |
628 | kmutex_lock(&g_smsdvb_clientslock); | 628 | kmutex_lock(&g_smsdvb_clientslock); |
629 | 629 | ||
630 | smsdvb_unregister_client((struct smsdvb_client_t *) context); | 630 | smsdvb_unregister_client((struct smsdvb_client_t *) context); |
631 | 631 | ||
632 | kmutex_unlock(&g_smsdvb_clientslock); | 632 | kmutex_unlock(&g_smsdvb_clientslock); |
633 | } | 633 | } |
634 | 634 | ||
635 | static int smsdvb_start_feed(struct dvb_demux_feed *feed) | 635 | static int smsdvb_start_feed(struct dvb_demux_feed *feed) |
636 | { | 636 | { |
637 | struct smsdvb_client_t *client = | 637 | struct smsdvb_client_t *client = |
638 | container_of(feed->demux, struct smsdvb_client_t, demux); | 638 | container_of(feed->demux, struct smsdvb_client_t, demux); |
639 | struct sms_msg_data PidMsg; | 639 | struct sms_msg_data pid_msg; |
640 | 640 | ||
641 | sms_debug("add pid %d(%x)", | 641 | sms_debug("add pid %d(%x)", |
642 | feed->pid, feed->pid); | 642 | feed->pid, feed->pid); |
643 | 643 | ||
644 | client->feed_users++; | 644 | client->feed_users++; |
645 | 645 | ||
646 | PidMsg.x_msg_header.msg_src_id = DVBT_BDA_CONTROL_MSG_ID; | 646 | pid_msg.x_msg_header.msg_src_id = DVBT_BDA_CONTROL_MSG_ID; |
647 | PidMsg.x_msg_header.msg_dst_id = HIF_TASK; | 647 | pid_msg.x_msg_header.msg_dst_id = HIF_TASK; |
648 | PidMsg.x_msg_header.msg_flags = 0; | 648 | pid_msg.x_msg_header.msg_flags = 0; |
649 | PidMsg.x_msg_header.msg_type = MSG_SMS_ADD_PID_FILTER_REQ; | 649 | pid_msg.x_msg_header.msg_type = MSG_SMS_ADD_PID_FILTER_REQ; |
650 | PidMsg.x_msg_header.msg_length = sizeof(PidMsg); | 650 | pid_msg.x_msg_header.msg_length = sizeof(pid_msg); |
651 | PidMsg.msgData[0] = feed->pid; | 651 | pid_msg.msg_data[0] = feed->pid; |
652 | 652 | ||
653 | return smsclient_sendrequest(client->smsclient, | 653 | return smsclient_sendrequest(client->smsclient, |
654 | &PidMsg, sizeof(PidMsg)); | 654 | &pid_msg, sizeof(pid_msg)); |
655 | } | 655 | } |
656 | 656 | ||
657 | static int smsdvb_stop_feed(struct dvb_demux_feed *feed) | 657 | static int smsdvb_stop_feed(struct dvb_demux_feed *feed) |
658 | { | 658 | { |
659 | struct smsdvb_client_t *client = | 659 | struct smsdvb_client_t *client = |
660 | container_of(feed->demux, struct smsdvb_client_t, demux); | 660 | container_of(feed->demux, struct smsdvb_client_t, demux); |
661 | struct sms_msg_data PidMsg; | 661 | struct sms_msg_data pid_msg; |
662 | 662 | ||
663 | sms_debug("remove pid %d(%x)", | 663 | sms_debug("remove pid %d(%x)", |
664 | feed->pid, feed->pid); | 664 | feed->pid, feed->pid); |
665 | 665 | ||
666 | client->feed_users--; | 666 | client->feed_users--; |
667 | 667 | ||
668 | PidMsg.x_msg_header.msg_src_id = DVBT_BDA_CONTROL_MSG_ID; | 668 | pid_msg.x_msg_header.msg_src_id = DVBT_BDA_CONTROL_MSG_ID; |
669 | PidMsg.x_msg_header.msg_dst_id = HIF_TASK; | 669 | pid_msg.x_msg_header.msg_dst_id = HIF_TASK; |
670 | PidMsg.x_msg_header.msg_flags = 0; | 670 | pid_msg.x_msg_header.msg_flags = 0; |
671 | PidMsg.x_msg_header.msg_type = MSG_SMS_REMOVE_PID_FILTER_REQ; | 671 | pid_msg.x_msg_header.msg_type = MSG_SMS_REMOVE_PID_FILTER_REQ; |
672 | PidMsg.x_msg_header.msg_length = sizeof(PidMsg); | 672 | pid_msg.x_msg_header.msg_length = sizeof(pid_msg); |
673 | PidMsg.msgData[0] = feed->pid; | 673 | pid_msg.msg_data[0] = feed->pid; |
674 | 674 | ||
675 | return smsclient_sendrequest(client->smsclient, | 675 | return smsclient_sendrequest(client->smsclient, |
676 | &PidMsg, sizeof(PidMsg)); | 676 | &pid_msg, sizeof(pid_msg)); |
677 | } | 677 | } |
678 | 678 | ||
679 | static int smsdvb_sendrequest_and_wait(struct smsdvb_client_t *client, | 679 | static int smsdvb_sendrequest_and_wait(struct smsdvb_client_t *client, |
680 | void *buffer, size_t size, | 680 | void *buffer, size_t size, |
681 | struct completion *completion) | 681 | struct completion *completion) |
682 | { | 682 | { |
683 | int rc; | 683 | int rc; |
684 | 684 | ||
685 | rc = smsclient_sendrequest(client->smsclient, buffer, size); | 685 | rc = smsclient_sendrequest(client->smsclient, buffer, size); |
686 | if (rc < 0) | 686 | if (rc < 0) |
687 | return rc; | 687 | return rc; |
688 | 688 | ||
689 | return wait_for_completion_timeout(completion, | 689 | return wait_for_completion_timeout(completion, |
690 | msecs_to_jiffies(2000)) ? | 690 | msecs_to_jiffies(2000)) ? |
691 | 0 : -ETIME; | 691 | 0 : -ETIME; |
692 | } | 692 | } |
693 | 693 | ||
694 | static int smsdvb_send_statistics_request(struct smsdvb_client_t *client) | 694 | static int smsdvb_send_statistics_request(struct smsdvb_client_t *client) |
695 | { | 695 | { |
696 | int rc; | 696 | int rc; |
697 | struct sms_msg_hdr Msg; | 697 | struct sms_msg_hdr msg; |
698 | 698 | ||
699 | /* Don't request stats too fast */ | 699 | /* Don't request stats too fast */ |
700 | if (client->get_stats_jiffies && | 700 | if (client->get_stats_jiffies && |
701 | (!time_after(jiffies, client->get_stats_jiffies))) | 701 | (!time_after(jiffies, client->get_stats_jiffies))) |
702 | return 0; | 702 | return 0; |
703 | client->get_stats_jiffies = jiffies + msecs_to_jiffies(100); | 703 | client->get_stats_jiffies = jiffies + msecs_to_jiffies(100); |
704 | 704 | ||
705 | Msg.msg_src_id = DVBT_BDA_CONTROL_MSG_ID; | 705 | msg.msg_src_id = DVBT_BDA_CONTROL_MSG_ID; |
706 | Msg.msg_dst_id = HIF_TASK; | 706 | msg.msg_dst_id = HIF_TASK; |
707 | Msg.msg_flags = 0; | 707 | msg.msg_flags = 0; |
708 | Msg.msg_length = sizeof(Msg); | 708 | msg.msg_length = sizeof(msg); |
709 | 709 | ||
710 | switch (smscore_get_device_mode(client->coredev)) { | 710 | switch (smscore_get_device_mode(client->coredev)) { |
711 | case DEVICE_MODE_ISDBT: | 711 | case DEVICE_MODE_ISDBT: |
712 | case DEVICE_MODE_ISDBT_BDA: | 712 | case DEVICE_MODE_ISDBT_BDA: |
713 | /* | 713 | /* |
714 | * Check for firmware version, to avoid breaking for old cards | 714 | * Check for firmware version, to avoid breaking for old cards |
715 | */ | 715 | */ |
716 | if (client->coredev->fw_version >= 0x800) | 716 | if (client->coredev->fw_version >= 0x800) |
717 | Msg.msg_type = MSG_SMS_GET_STATISTICS_EX_REQ; | 717 | msg.msg_type = MSG_SMS_GET_STATISTICS_EX_REQ; |
718 | else | 718 | else |
719 | Msg.msg_type = MSG_SMS_GET_STATISTICS_REQ; | 719 | msg.msg_type = MSG_SMS_GET_STATISTICS_REQ; |
720 | break; | 720 | break; |
721 | default: | 721 | default: |
722 | Msg.msg_type = MSG_SMS_GET_STATISTICS_REQ; | 722 | msg.msg_type = MSG_SMS_GET_STATISTICS_REQ; |
723 | } | 723 | } |
724 | 724 | ||
725 | rc = smsdvb_sendrequest_and_wait(client, &Msg, sizeof(Msg), | 725 | rc = smsdvb_sendrequest_and_wait(client, &msg, sizeof(msg), |
726 | &client->stats_done); | 726 | &client->stats_done); |
727 | 727 | ||
728 | return rc; | 728 | return rc; |
729 | } | 729 | } |
730 | 730 | ||
731 | static inline int led_feedback(struct smsdvb_client_t *client) | 731 | static inline int led_feedback(struct smsdvb_client_t *client) |
732 | { | 732 | { |
733 | if (!(client->fe_status & FE_HAS_LOCK)) | 733 | if (!(client->fe_status & FE_HAS_LOCK)) |
734 | return sms_board_led_feedback(client->coredev, SMS_LED_OFF); | 734 | return sms_board_led_feedback(client->coredev, SMS_LED_OFF); |
735 | 735 | ||
736 | return sms_board_led_feedback(client->coredev, | 736 | return sms_board_led_feedback(client->coredev, |
737 | (client->legacy_ber == 0) ? | 737 | (client->legacy_ber == 0) ? |
738 | SMS_LED_HI : SMS_LED_LO); | 738 | SMS_LED_HI : SMS_LED_LO); |
739 | } | 739 | } |
740 | 740 | ||
741 | static int smsdvb_read_status(struct dvb_frontend *fe, fe_status_t *stat) | 741 | static int smsdvb_read_status(struct dvb_frontend *fe, fe_status_t *stat) |
742 | { | 742 | { |
743 | int rc; | 743 | int rc; |
744 | struct smsdvb_client_t *client; | 744 | struct smsdvb_client_t *client; |
745 | client = container_of(fe, struct smsdvb_client_t, frontend); | 745 | client = container_of(fe, struct smsdvb_client_t, frontend); |
746 | 746 | ||
747 | rc = smsdvb_send_statistics_request(client); | 747 | rc = smsdvb_send_statistics_request(client); |
748 | 748 | ||
749 | *stat = client->fe_status; | 749 | *stat = client->fe_status; |
750 | 750 | ||
751 | led_feedback(client); | 751 | led_feedback(client); |
752 | 752 | ||
753 | return rc; | 753 | return rc; |
754 | } | 754 | } |
755 | 755 | ||
756 | static int smsdvb_read_ber(struct dvb_frontend *fe, u32 *ber) | 756 | static int smsdvb_read_ber(struct dvb_frontend *fe, u32 *ber) |
757 | { | 757 | { |
758 | int rc; | 758 | int rc; |
759 | struct smsdvb_client_t *client; | 759 | struct smsdvb_client_t *client; |
760 | 760 | ||
761 | client = container_of(fe, struct smsdvb_client_t, frontend); | 761 | client = container_of(fe, struct smsdvb_client_t, frontend); |
762 | 762 | ||
763 | rc = smsdvb_send_statistics_request(client); | 763 | rc = smsdvb_send_statistics_request(client); |
764 | 764 | ||
765 | *ber = client->legacy_ber; | 765 | *ber = client->legacy_ber; |
766 | 766 | ||
767 | led_feedback(client); | 767 | led_feedback(client); |
768 | 768 | ||
769 | return rc; | 769 | return rc; |
770 | } | 770 | } |
771 | 771 | ||
772 | static int smsdvb_read_signal_strength(struct dvb_frontend *fe, u16 *strength) | 772 | static int smsdvb_read_signal_strength(struct dvb_frontend *fe, u16 *strength) |
773 | { | 773 | { |
774 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; | 774 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; |
775 | int rc; | 775 | int rc; |
776 | s32 power = (s32) c->strength.stat[0].uvalue; | 776 | s32 power = (s32) c->strength.stat[0].uvalue; |
777 | struct smsdvb_client_t *client; | 777 | struct smsdvb_client_t *client; |
778 | 778 | ||
779 | client = container_of(fe, struct smsdvb_client_t, frontend); | 779 | client = container_of(fe, struct smsdvb_client_t, frontend); |
780 | 780 | ||
781 | rc = smsdvb_send_statistics_request(client); | 781 | rc = smsdvb_send_statistics_request(client); |
782 | 782 | ||
783 | if (power < -95) | 783 | if (power < -95) |
784 | *strength = 0; | 784 | *strength = 0; |
785 | else if (power > -29) | 785 | else if (power > -29) |
786 | *strength = 65535; | 786 | *strength = 65535; |
787 | else | 787 | else |
788 | *strength = (power + 95) * 65535 / 66; | 788 | *strength = (power + 95) * 65535 / 66; |
789 | 789 | ||
790 | led_feedback(client); | 790 | led_feedback(client); |
791 | 791 | ||
792 | return rc; | 792 | return rc; |
793 | } | 793 | } |
794 | 794 | ||
795 | static int smsdvb_read_snr(struct dvb_frontend *fe, u16 *snr) | 795 | static int smsdvb_read_snr(struct dvb_frontend *fe, u16 *snr) |
796 | { | 796 | { |
797 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; | 797 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; |
798 | int rc; | 798 | int rc; |
799 | struct smsdvb_client_t *client; | 799 | struct smsdvb_client_t *client; |
800 | 800 | ||
801 | client = container_of(fe, struct smsdvb_client_t, frontend); | 801 | client = container_of(fe, struct smsdvb_client_t, frontend); |
802 | 802 | ||
803 | rc = smsdvb_send_statistics_request(client); | 803 | rc = smsdvb_send_statistics_request(client); |
804 | 804 | ||
805 | /* Preferred scale for SNR with legacy API: 0.1 dB */ | 805 | /* Preferred scale for SNR with legacy API: 0.1 dB */ |
806 | *snr = c->cnr.stat[0].svalue / 100; | 806 | *snr = c->cnr.stat[0].svalue / 100; |
807 | 807 | ||
808 | led_feedback(client); | 808 | led_feedback(client); |
809 | 809 | ||
810 | return rc; | 810 | return rc; |
811 | } | 811 | } |
812 | 812 | ||
813 | static int smsdvb_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks) | 813 | static int smsdvb_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks) |
814 | { | 814 | { |
815 | int rc; | 815 | int rc; |
816 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; | 816 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; |
817 | struct smsdvb_client_t *client; | 817 | struct smsdvb_client_t *client; |
818 | 818 | ||
819 | client = container_of(fe, struct smsdvb_client_t, frontend); | 819 | client = container_of(fe, struct smsdvb_client_t, frontend); |
820 | 820 | ||
821 | rc = smsdvb_send_statistics_request(client); | 821 | rc = smsdvb_send_statistics_request(client); |
822 | 822 | ||
823 | *ucblocks = c->block_error.stat[0].uvalue; | 823 | *ucblocks = c->block_error.stat[0].uvalue; |
824 | 824 | ||
825 | led_feedback(client); | 825 | led_feedback(client); |
826 | 826 | ||
827 | return rc; | 827 | return rc; |
828 | } | 828 | } |
829 | 829 | ||
830 | static int smsdvb_get_tune_settings(struct dvb_frontend *fe, | 830 | static int smsdvb_get_tune_settings(struct dvb_frontend *fe, |
831 | struct dvb_frontend_tune_settings *tune) | 831 | struct dvb_frontend_tune_settings *tune) |
832 | { | 832 | { |
833 | sms_debug(""); | 833 | sms_debug(""); |
834 | 834 | ||
835 | tune->min_delay_ms = 400; | 835 | tune->min_delay_ms = 400; |
836 | tune->step_size = 250000; | 836 | tune->step_size = 250000; |
837 | tune->max_drift = 0; | 837 | tune->max_drift = 0; |
838 | return 0; | 838 | return 0; |
839 | } | 839 | } |
840 | 840 | ||
841 | static int smsdvb_dvbt_set_frontend(struct dvb_frontend *fe) | 841 | static int smsdvb_dvbt_set_frontend(struct dvb_frontend *fe) |
842 | { | 842 | { |
843 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; | 843 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; |
844 | struct smsdvb_client_t *client = | 844 | struct smsdvb_client_t *client = |
845 | container_of(fe, struct smsdvb_client_t, frontend); | 845 | container_of(fe, struct smsdvb_client_t, frontend); |
846 | 846 | ||
847 | struct { | 847 | struct { |
848 | struct sms_msg_hdr Msg; | 848 | struct sms_msg_hdr msg; |
849 | u32 Data[3]; | 849 | u32 Data[3]; |
850 | } Msg; | 850 | } msg; |
851 | 851 | ||
852 | int ret; | 852 | int ret; |
853 | 853 | ||
854 | client->fe_status = 0; | 854 | client->fe_status = 0; |
855 | client->event_fe_state = -1; | 855 | client->event_fe_state = -1; |
856 | client->event_unc_state = -1; | 856 | client->event_unc_state = -1; |
857 | fe->dtv_property_cache.delivery_system = SYS_DVBT; | 857 | fe->dtv_property_cache.delivery_system = SYS_DVBT; |
858 | 858 | ||
859 | Msg.Msg.msg_src_id = DVBT_BDA_CONTROL_MSG_ID; | 859 | msg.msg.msg_src_id = DVBT_BDA_CONTROL_MSG_ID; |
860 | Msg.Msg.msg_dst_id = HIF_TASK; | 860 | msg.msg.msg_dst_id = HIF_TASK; |
861 | Msg.Msg.msg_flags = 0; | 861 | msg.msg.msg_flags = 0; |
862 | Msg.Msg.msg_type = MSG_SMS_RF_TUNE_REQ; | 862 | msg.msg.msg_type = MSG_SMS_RF_TUNE_REQ; |
863 | Msg.Msg.msg_length = sizeof(Msg); | 863 | msg.msg.msg_length = sizeof(msg); |
864 | Msg.Data[0] = c->frequency; | 864 | msg.Data[0] = c->frequency; |
865 | Msg.Data[2] = 12000000; | 865 | msg.Data[2] = 12000000; |
866 | 866 | ||
867 | sms_info("%s: freq %d band %d", __func__, c->frequency, | 867 | sms_info("%s: freq %d band %d", __func__, c->frequency, |
868 | c->bandwidth_hz); | 868 | c->bandwidth_hz); |
869 | 869 | ||
870 | switch (c->bandwidth_hz / 1000000) { | 870 | switch (c->bandwidth_hz / 1000000) { |
871 | case 8: | 871 | case 8: |
872 | Msg.Data[1] = BW_8_MHZ; | 872 | msg.Data[1] = BW_8_MHZ; |
873 | break; | 873 | break; |
874 | case 7: | 874 | case 7: |
875 | Msg.Data[1] = BW_7_MHZ; | 875 | msg.Data[1] = BW_7_MHZ; |
876 | break; | 876 | break; |
877 | case 6: | 877 | case 6: |
878 | Msg.Data[1] = BW_6_MHZ; | 878 | msg.Data[1] = BW_6_MHZ; |
879 | break; | 879 | break; |
880 | case 0: | 880 | case 0: |
881 | return -EOPNOTSUPP; | 881 | return -EOPNOTSUPP; |
882 | default: | 882 | default: |
883 | return -EINVAL; | 883 | return -EINVAL; |
884 | } | 884 | } |
885 | /* Disable LNA, if any. An error is returned if no LNA is present */ | 885 | /* Disable LNA, if any. An error is returned if no LNA is present */ |
886 | ret = sms_board_lna_control(client->coredev, 0); | 886 | ret = sms_board_lna_control(client->coredev, 0); |
887 | if (ret == 0) { | 887 | if (ret == 0) { |
888 | fe_status_t status; | 888 | fe_status_t status; |
889 | 889 | ||
890 | /* tune with LNA off at first */ | 890 | /* tune with LNA off at first */ |
891 | ret = smsdvb_sendrequest_and_wait(client, &Msg, sizeof(Msg), | 891 | ret = smsdvb_sendrequest_and_wait(client, &msg, sizeof(msg), |
892 | &client->tune_done); | 892 | &client->tune_done); |
893 | 893 | ||
894 | smsdvb_read_status(fe, &status); | 894 | smsdvb_read_status(fe, &status); |
895 | 895 | ||
896 | if (status & FE_HAS_LOCK) | 896 | if (status & FE_HAS_LOCK) |
897 | return ret; | 897 | return ret; |
898 | 898 | ||
899 | /* previous tune didn't lock - enable LNA and tune again */ | 899 | /* previous tune didn't lock - enable LNA and tune again */ |
900 | sms_board_lna_control(client->coredev, 1); | 900 | sms_board_lna_control(client->coredev, 1); |
901 | } | 901 | } |
902 | 902 | ||
903 | return smsdvb_sendrequest_and_wait(client, &Msg, sizeof(Msg), | 903 | return smsdvb_sendrequest_and_wait(client, &msg, sizeof(msg), |
904 | &client->tune_done); | 904 | &client->tune_done); |
905 | } | 905 | } |
906 | 906 | ||
907 | static int smsdvb_isdbt_set_frontend(struct dvb_frontend *fe) | 907 | static int smsdvb_isdbt_set_frontend(struct dvb_frontend *fe) |
908 | { | 908 | { |
909 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; | 909 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; |
910 | struct smsdvb_client_t *client = | 910 | struct smsdvb_client_t *client = |
911 | container_of(fe, struct smsdvb_client_t, frontend); | 911 | container_of(fe, struct smsdvb_client_t, frontend); |
912 | int board_id = smscore_get_board_id(client->coredev); | 912 | int board_id = smscore_get_board_id(client->coredev); |
913 | struct sms_board *board = sms_get_board(board_id); | 913 | struct sms_board *board = sms_get_board(board_id); |
914 | enum sms_device_type_st type = board->type; | 914 | enum sms_device_type_st type = board->type; |
915 | int ret; | 915 | int ret; |
916 | 916 | ||
917 | struct { | 917 | struct { |
918 | struct sms_msg_hdr Msg; | 918 | struct sms_msg_hdr msg; |
919 | u32 Data[4]; | 919 | u32 Data[4]; |
920 | } Msg; | 920 | } msg; |
921 | 921 | ||
922 | fe->dtv_property_cache.delivery_system = SYS_ISDBT; | 922 | fe->dtv_property_cache.delivery_system = SYS_ISDBT; |
923 | 923 | ||
924 | Msg.Msg.msg_src_id = DVBT_BDA_CONTROL_MSG_ID; | 924 | msg.msg.msg_src_id = DVBT_BDA_CONTROL_MSG_ID; |
925 | Msg.Msg.msg_dst_id = HIF_TASK; | 925 | msg.msg.msg_dst_id = HIF_TASK; |
926 | Msg.Msg.msg_flags = 0; | 926 | msg.msg.msg_flags = 0; |
927 | Msg.Msg.msg_type = MSG_SMS_ISDBT_TUNE_REQ; | 927 | msg.msg.msg_type = MSG_SMS_ISDBT_TUNE_REQ; |
928 | Msg.Msg.msg_length = sizeof(Msg); | 928 | msg.msg.msg_length = sizeof(msg); |
929 | 929 | ||
930 | if (c->isdbt_sb_segment_idx == -1) | 930 | if (c->isdbt_sb_segment_idx == -1) |
931 | c->isdbt_sb_segment_idx = 0; | 931 | c->isdbt_sb_segment_idx = 0; |
932 | 932 | ||
933 | if (!c->isdbt_layer_enabled) | 933 | if (!c->isdbt_layer_enabled) |
934 | c->isdbt_layer_enabled = 7; | 934 | c->isdbt_layer_enabled = 7; |
935 | 935 | ||
936 | Msg.Data[0] = c->frequency; | 936 | msg.Data[0] = c->frequency; |
937 | Msg.Data[1] = BW_ISDBT_1SEG; | 937 | msg.Data[1] = BW_ISDBT_1SEG; |
938 | Msg.Data[2] = 12000000; | 938 | msg.Data[2] = 12000000; |
939 | Msg.Data[3] = c->isdbt_sb_segment_idx; | 939 | msg.Data[3] = c->isdbt_sb_segment_idx; |
940 | 940 | ||
941 | if (c->isdbt_partial_reception) { | 941 | if (c->isdbt_partial_reception) { |
942 | if ((type == SMS_PELE || type == SMS_RIO) && | 942 | if ((type == SMS_PELE || type == SMS_RIO) && |
943 | c->isdbt_sb_segment_count > 3) | 943 | c->isdbt_sb_segment_count > 3) |
944 | Msg.Data[1] = BW_ISDBT_13SEG; | 944 | msg.Data[1] = BW_ISDBT_13SEG; |
945 | else if (c->isdbt_sb_segment_count > 1) | 945 | else if (c->isdbt_sb_segment_count > 1) |
946 | Msg.Data[1] = BW_ISDBT_3SEG; | 946 | msg.Data[1] = BW_ISDBT_3SEG; |
947 | } else if (type == SMS_PELE || type == SMS_RIO) | 947 | } else if (type == SMS_PELE || type == SMS_RIO) |
948 | Msg.Data[1] = BW_ISDBT_13SEG; | 948 | msg.Data[1] = BW_ISDBT_13SEG; |
949 | 949 | ||
950 | c->bandwidth_hz = 6000000; | 950 | c->bandwidth_hz = 6000000; |
951 | 951 | ||
952 | sms_info("%s: freq %d segwidth %d segindex %d", __func__, | 952 | sms_info("%s: freq %d segwidth %d segindex %d", __func__, |
953 | c->frequency, c->isdbt_sb_segment_count, | 953 | c->frequency, c->isdbt_sb_segment_count, |
954 | c->isdbt_sb_segment_idx); | 954 | c->isdbt_sb_segment_idx); |
955 | 955 | ||
956 | /* Disable LNA, if any. An error is returned if no LNA is present */ | 956 | /* Disable LNA, if any. An error is returned if no LNA is present */ |
957 | ret = sms_board_lna_control(client->coredev, 0); | 957 | ret = sms_board_lna_control(client->coredev, 0); |
958 | if (ret == 0) { | 958 | if (ret == 0) { |
959 | fe_status_t status; | 959 | fe_status_t status; |
960 | 960 | ||
961 | /* tune with LNA off at first */ | 961 | /* tune with LNA off at first */ |
962 | ret = smsdvb_sendrequest_and_wait(client, &Msg, sizeof(Msg), | 962 | ret = smsdvb_sendrequest_and_wait(client, &msg, sizeof(msg), |
963 | &client->tune_done); | 963 | &client->tune_done); |
964 | 964 | ||
965 | smsdvb_read_status(fe, &status); | 965 | smsdvb_read_status(fe, &status); |
966 | 966 | ||
967 | if (status & FE_HAS_LOCK) | 967 | if (status & FE_HAS_LOCK) |
968 | return ret; | 968 | return ret; |
969 | 969 | ||
970 | /* previous tune didn't lock - enable LNA and tune again */ | 970 | /* previous tune didn't lock - enable LNA and tune again */ |
971 | sms_board_lna_control(client->coredev, 1); | 971 | sms_board_lna_control(client->coredev, 1); |
972 | } | 972 | } |
973 | return smsdvb_sendrequest_and_wait(client, &Msg, sizeof(Msg), | 973 | return smsdvb_sendrequest_and_wait(client, &msg, sizeof(msg), |
974 | &client->tune_done); | 974 | &client->tune_done); |
975 | } | 975 | } |
976 | 976 | ||
977 | static int smsdvb_set_frontend(struct dvb_frontend *fe) | 977 | static int smsdvb_set_frontend(struct dvb_frontend *fe) |
978 | { | 978 | { |
979 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; | 979 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; |
980 | struct smsdvb_client_t *client = | 980 | struct smsdvb_client_t *client = |
981 | container_of(fe, struct smsdvb_client_t, frontend); | 981 | container_of(fe, struct smsdvb_client_t, frontend); |
982 | struct smscore_device_t *coredev = client->coredev; | 982 | struct smscore_device_t *coredev = client->coredev; |
983 | 983 | ||
984 | smsdvb_stats_not_ready(fe); | 984 | smsdvb_stats_not_ready(fe); |
985 | c->strength.stat[0].uvalue = 0; | 985 | c->strength.stat[0].uvalue = 0; |
986 | c->cnr.stat[0].uvalue = 0; | 986 | c->cnr.stat[0].uvalue = 0; |
987 | 987 | ||
988 | client->has_tuned = false; | 988 | client->has_tuned = false; |
989 | 989 | ||
990 | switch (smscore_get_device_mode(coredev)) { | 990 | switch (smscore_get_device_mode(coredev)) { |
991 | case DEVICE_MODE_DVBT: | 991 | case DEVICE_MODE_DVBT: |
992 | case DEVICE_MODE_DVBT_BDA: | 992 | case DEVICE_MODE_DVBT_BDA: |
993 | return smsdvb_dvbt_set_frontend(fe); | 993 | return smsdvb_dvbt_set_frontend(fe); |
994 | case DEVICE_MODE_ISDBT: | 994 | case DEVICE_MODE_ISDBT: |
995 | case DEVICE_MODE_ISDBT_BDA: | 995 | case DEVICE_MODE_ISDBT_BDA: |
996 | return smsdvb_isdbt_set_frontend(fe); | 996 | return smsdvb_isdbt_set_frontend(fe); |
997 | default: | 997 | default: |
998 | return -EINVAL; | 998 | return -EINVAL; |
999 | } | 999 | } |
1000 | } | 1000 | } |
1001 | 1001 | ||
1002 | /* Nothing to do here, as stats are automatically updated */ | 1002 | /* Nothing to do here, as stats are automatically updated */ |
1003 | static int smsdvb_get_frontend(struct dvb_frontend *fe) | 1003 | static int smsdvb_get_frontend(struct dvb_frontend *fe) |
1004 | { | 1004 | { |
1005 | return 0; | 1005 | return 0; |
1006 | } | 1006 | } |
1007 | 1007 | ||
1008 | static int smsdvb_init(struct dvb_frontend *fe) | 1008 | static int smsdvb_init(struct dvb_frontend *fe) |
1009 | { | 1009 | { |
1010 | struct smsdvb_client_t *client = | 1010 | struct smsdvb_client_t *client = |
1011 | container_of(fe, struct smsdvb_client_t, frontend); | 1011 | container_of(fe, struct smsdvb_client_t, frontend); |
1012 | 1012 | ||
1013 | sms_board_power(client->coredev, 1); | 1013 | sms_board_power(client->coredev, 1); |
1014 | 1014 | ||
1015 | sms_board_dvb3_event(client, DVB3_EVENT_INIT); | 1015 | sms_board_dvb3_event(client, DVB3_EVENT_INIT); |
1016 | return 0; | 1016 | return 0; |
1017 | } | 1017 | } |
1018 | 1018 | ||
1019 | static int smsdvb_sleep(struct dvb_frontend *fe) | 1019 | static int smsdvb_sleep(struct dvb_frontend *fe) |
1020 | { | 1020 | { |
1021 | struct smsdvb_client_t *client = | 1021 | struct smsdvb_client_t *client = |
1022 | container_of(fe, struct smsdvb_client_t, frontend); | 1022 | container_of(fe, struct smsdvb_client_t, frontend); |
1023 | 1023 | ||
1024 | sms_board_led_feedback(client->coredev, SMS_LED_OFF); | 1024 | sms_board_led_feedback(client->coredev, SMS_LED_OFF); |
1025 | sms_board_power(client->coredev, 0); | 1025 | sms_board_power(client->coredev, 0); |
1026 | 1026 | ||
1027 | sms_board_dvb3_event(client, DVB3_EVENT_SLEEP); | 1027 | sms_board_dvb3_event(client, DVB3_EVENT_SLEEP); |
1028 | 1028 | ||
1029 | return 0; | 1029 | return 0; |
1030 | } | 1030 | } |
1031 | 1031 | ||
1032 | static void smsdvb_release(struct dvb_frontend *fe) | 1032 | static void smsdvb_release(struct dvb_frontend *fe) |
1033 | { | 1033 | { |
1034 | /* do nothing */ | 1034 | /* do nothing */ |
1035 | } | 1035 | } |
1036 | 1036 | ||
1037 | static struct dvb_frontend_ops smsdvb_fe_ops = { | 1037 | static struct dvb_frontend_ops smsdvb_fe_ops = { |
1038 | .info = { | 1038 | .info = { |
1039 | .name = "Siano Mobile Digital MDTV Receiver", | 1039 | .name = "Siano Mobile Digital MDTV Receiver", |
1040 | .frequency_min = 44250000, | 1040 | .frequency_min = 44250000, |
1041 | .frequency_max = 867250000, | 1041 | .frequency_max = 867250000, |
1042 | .frequency_stepsize = 250000, | 1042 | .frequency_stepsize = 250000, |
1043 | .caps = FE_CAN_INVERSION_AUTO | | 1043 | .caps = FE_CAN_INVERSION_AUTO | |
1044 | FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | | 1044 | FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | |
1045 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | | 1045 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | |
1046 | FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 | | 1046 | FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 | |
1047 | FE_CAN_QAM_AUTO | FE_CAN_TRANSMISSION_MODE_AUTO | | 1047 | FE_CAN_QAM_AUTO | FE_CAN_TRANSMISSION_MODE_AUTO | |
1048 | FE_CAN_GUARD_INTERVAL_AUTO | | 1048 | FE_CAN_GUARD_INTERVAL_AUTO | |
1049 | FE_CAN_RECOVER | | 1049 | FE_CAN_RECOVER | |
1050 | FE_CAN_HIERARCHY_AUTO, | 1050 | FE_CAN_HIERARCHY_AUTO, |
1051 | }, | 1051 | }, |
1052 | 1052 | ||
1053 | .release = smsdvb_release, | 1053 | .release = smsdvb_release, |
1054 | 1054 | ||
1055 | .set_frontend = smsdvb_set_frontend, | 1055 | .set_frontend = smsdvb_set_frontend, |
1056 | .get_frontend = smsdvb_get_frontend, | 1056 | .get_frontend = smsdvb_get_frontend, |
1057 | .get_tune_settings = smsdvb_get_tune_settings, | 1057 | .get_tune_settings = smsdvb_get_tune_settings, |
1058 | 1058 | ||
1059 | .read_status = smsdvb_read_status, | 1059 | .read_status = smsdvb_read_status, |
1060 | .read_ber = smsdvb_read_ber, | 1060 | .read_ber = smsdvb_read_ber, |
1061 | .read_signal_strength = smsdvb_read_signal_strength, | 1061 | .read_signal_strength = smsdvb_read_signal_strength, |
1062 | .read_snr = smsdvb_read_snr, | 1062 | .read_snr = smsdvb_read_snr, |
1063 | .read_ucblocks = smsdvb_read_ucblocks, | 1063 | .read_ucblocks = smsdvb_read_ucblocks, |
1064 | 1064 | ||
1065 | .init = smsdvb_init, | 1065 | .init = smsdvb_init, |
1066 | .sleep = smsdvb_sleep, | 1066 | .sleep = smsdvb_sleep, |
1067 | }; | 1067 | }; |
1068 | 1068 | ||
1069 | static int smsdvb_hotplug(struct smscore_device_t *coredev, | 1069 | static int smsdvb_hotplug(struct smscore_device_t *coredev, |
1070 | struct device *device, int arrival) | 1070 | struct device *device, int arrival) |
1071 | { | 1071 | { |
1072 | struct smsclient_params_t params; | 1072 | struct smsclient_params_t params; |
1073 | struct smsdvb_client_t *client; | 1073 | struct smsdvb_client_t *client; |
1074 | int rc; | 1074 | int rc; |
1075 | 1075 | ||
1076 | /* device removal handled by onremove callback */ | 1076 | /* device removal handled by onremove callback */ |
1077 | if (!arrival) | 1077 | if (!arrival) |
1078 | return 0; | 1078 | return 0; |
1079 | client = kzalloc(sizeof(struct smsdvb_client_t), GFP_KERNEL); | 1079 | client = kzalloc(sizeof(struct smsdvb_client_t), GFP_KERNEL); |
1080 | if (!client) { | 1080 | if (!client) { |
1081 | sms_err("kmalloc() failed"); | 1081 | sms_err("kmalloc() failed"); |
1082 | return -ENOMEM; | 1082 | return -ENOMEM; |
1083 | } | 1083 | } |
1084 | 1084 | ||
1085 | /* register dvb adapter */ | 1085 | /* register dvb adapter */ |
1086 | rc = dvb_register_adapter(&client->adapter, | 1086 | rc = dvb_register_adapter(&client->adapter, |
1087 | sms_get_board( | 1087 | sms_get_board( |
1088 | smscore_get_board_id(coredev))->name, | 1088 | smscore_get_board_id(coredev))->name, |
1089 | THIS_MODULE, device, adapter_nr); | 1089 | THIS_MODULE, device, adapter_nr); |
1090 | if (rc < 0) { | 1090 | if (rc < 0) { |
1091 | sms_err("dvb_register_adapter() failed %d", rc); | 1091 | sms_err("dvb_register_adapter() failed %d", rc); |
1092 | goto adapter_error; | 1092 | goto adapter_error; |
1093 | } | 1093 | } |
1094 | 1094 | ||
1095 | /* init dvb demux */ | 1095 | /* init dvb demux */ |
1096 | client->demux.dmx.capabilities = DMX_TS_FILTERING; | 1096 | client->demux.dmx.capabilities = DMX_TS_FILTERING; |
1097 | client->demux.filternum = 32; /* todo: nova ??? */ | 1097 | client->demux.filternum = 32; /* todo: nova ??? */ |
1098 | client->demux.feednum = 32; | 1098 | client->demux.feednum = 32; |
1099 | client->demux.start_feed = smsdvb_start_feed; | 1099 | client->demux.start_feed = smsdvb_start_feed; |
1100 | client->demux.stop_feed = smsdvb_stop_feed; | 1100 | client->demux.stop_feed = smsdvb_stop_feed; |
1101 | 1101 | ||
1102 | rc = dvb_dmx_init(&client->demux); | 1102 | rc = dvb_dmx_init(&client->demux); |
1103 | if (rc < 0) { | 1103 | if (rc < 0) { |
1104 | sms_err("dvb_dmx_init failed %d", rc); | 1104 | sms_err("dvb_dmx_init failed %d", rc); |
1105 | goto dvbdmx_error; | 1105 | goto dvbdmx_error; |
1106 | } | 1106 | } |
1107 | 1107 | ||
1108 | /* init dmxdev */ | 1108 | /* init dmxdev */ |
1109 | client->dmxdev.filternum = 32; | 1109 | client->dmxdev.filternum = 32; |
1110 | client->dmxdev.demux = &client->demux.dmx; | 1110 | client->dmxdev.demux = &client->demux.dmx; |
1111 | client->dmxdev.capabilities = 0; | 1111 | client->dmxdev.capabilities = 0; |
1112 | 1112 | ||
1113 | rc = dvb_dmxdev_init(&client->dmxdev, &client->adapter); | 1113 | rc = dvb_dmxdev_init(&client->dmxdev, &client->adapter); |
1114 | if (rc < 0) { | 1114 | if (rc < 0) { |
1115 | sms_err("dvb_dmxdev_init failed %d", rc); | 1115 | sms_err("dvb_dmxdev_init failed %d", rc); |
1116 | goto dmxdev_error; | 1116 | goto dmxdev_error; |
1117 | } | 1117 | } |
1118 | 1118 | ||
1119 | /* init and register frontend */ | 1119 | /* init and register frontend */ |
1120 | memcpy(&client->frontend.ops, &smsdvb_fe_ops, | 1120 | memcpy(&client->frontend.ops, &smsdvb_fe_ops, |
1121 | sizeof(struct dvb_frontend_ops)); | 1121 | sizeof(struct dvb_frontend_ops)); |
1122 | 1122 | ||
1123 | switch (smscore_get_device_mode(coredev)) { | 1123 | switch (smscore_get_device_mode(coredev)) { |
1124 | case DEVICE_MODE_DVBT: | 1124 | case DEVICE_MODE_DVBT: |
1125 | case DEVICE_MODE_DVBT_BDA: | 1125 | case DEVICE_MODE_DVBT_BDA: |
1126 | client->frontend.ops.delsys[0] = SYS_DVBT; | 1126 | client->frontend.ops.delsys[0] = SYS_DVBT; |
1127 | break; | 1127 | break; |
1128 | case DEVICE_MODE_ISDBT: | 1128 | case DEVICE_MODE_ISDBT: |
1129 | case DEVICE_MODE_ISDBT_BDA: | 1129 | case DEVICE_MODE_ISDBT_BDA: |
1130 | client->frontend.ops.delsys[0] = SYS_ISDBT; | 1130 | client->frontend.ops.delsys[0] = SYS_ISDBT; |
1131 | break; | 1131 | break; |
1132 | } | 1132 | } |
1133 | 1133 | ||
1134 | rc = dvb_register_frontend(&client->adapter, &client->frontend); | 1134 | rc = dvb_register_frontend(&client->adapter, &client->frontend); |
1135 | if (rc < 0) { | 1135 | if (rc < 0) { |
1136 | sms_err("frontend registration failed %d", rc); | 1136 | sms_err("frontend registration failed %d", rc); |
1137 | goto frontend_error; | 1137 | goto frontend_error; |
1138 | } | 1138 | } |
1139 | 1139 | ||
1140 | params.initial_id = 1; | 1140 | params.initial_id = 1; |
1141 | params.data_type = MSG_SMS_DVBT_BDA_DATA; | 1141 | params.data_type = MSG_SMS_DVBT_BDA_DATA; |
1142 | params.onresponse_handler = smsdvb_onresponse; | 1142 | params.onresponse_handler = smsdvb_onresponse; |
1143 | params.onremove_handler = smsdvb_onremove; | 1143 | params.onremove_handler = smsdvb_onremove; |
1144 | params.context = client; | 1144 | params.context = client; |
1145 | 1145 | ||
1146 | rc = smscore_register_client(coredev, ¶ms, &client->smsclient); | 1146 | rc = smscore_register_client(coredev, ¶ms, &client->smsclient); |
1147 | if (rc < 0) { | 1147 | if (rc < 0) { |
1148 | sms_err("smscore_register_client() failed %d", rc); | 1148 | sms_err("smscore_register_client() failed %d", rc); |
1149 | goto client_error; | 1149 | goto client_error; |
1150 | } | 1150 | } |
1151 | 1151 | ||
1152 | client->coredev = coredev; | 1152 | client->coredev = coredev; |
1153 | 1153 | ||
1154 | init_completion(&client->tune_done); | 1154 | init_completion(&client->tune_done); |
1155 | init_completion(&client->stats_done); | 1155 | init_completion(&client->stats_done); |
1156 | 1156 | ||
1157 | kmutex_lock(&g_smsdvb_clientslock); | 1157 | kmutex_lock(&g_smsdvb_clientslock); |
1158 | 1158 | ||
1159 | list_add(&client->entry, &g_smsdvb_clients); | 1159 | list_add(&client->entry, &g_smsdvb_clients); |
1160 | 1160 | ||
1161 | kmutex_unlock(&g_smsdvb_clientslock); | 1161 | kmutex_unlock(&g_smsdvb_clientslock); |
1162 | 1162 | ||
1163 | client->event_fe_state = -1; | 1163 | client->event_fe_state = -1; |
1164 | client->event_unc_state = -1; | 1164 | client->event_unc_state = -1; |
1165 | sms_board_dvb3_event(client, DVB3_EVENT_HOTPLUG); | 1165 | sms_board_dvb3_event(client, DVB3_EVENT_HOTPLUG); |
1166 | 1166 | ||
1167 | sms_info("success"); | 1167 | sms_info("success"); |
1168 | sms_board_setup(coredev); | 1168 | sms_board_setup(coredev); |
1169 | 1169 | ||
1170 | if (smsdvb_debugfs_create(client) < 0) | 1170 | if (smsdvb_debugfs_create(client) < 0) |
1171 | sms_info("failed to create debugfs node"); | 1171 | sms_info("failed to create debugfs node"); |
1172 | 1172 | ||
1173 | return 0; | 1173 | return 0; |
1174 | 1174 | ||
1175 | client_error: | 1175 | client_error: |
1176 | dvb_unregister_frontend(&client->frontend); | 1176 | dvb_unregister_frontend(&client->frontend); |
1177 | 1177 | ||
1178 | frontend_error: | 1178 | frontend_error: |
1179 | dvb_dmxdev_release(&client->dmxdev); | 1179 | dvb_dmxdev_release(&client->dmxdev); |
1180 | 1180 | ||
1181 | dmxdev_error: | 1181 | dmxdev_error: |
1182 | dvb_dmx_release(&client->demux); | 1182 | dvb_dmx_release(&client->demux); |
1183 | 1183 | ||
1184 | dvbdmx_error: | 1184 | dvbdmx_error: |
1185 | dvb_unregister_adapter(&client->adapter); | 1185 | dvb_unregister_adapter(&client->adapter); |
1186 | 1186 | ||
1187 | adapter_error: | 1187 | adapter_error: |
1188 | kfree(client); | 1188 | kfree(client); |
1189 | return rc; | 1189 | return rc; |
1190 | } | 1190 | } |
1191 | 1191 | ||
1192 | static int __init smsdvb_module_init(void) | 1192 | static int __init smsdvb_module_init(void) |
1193 | { | 1193 | { |
1194 | int rc; | 1194 | int rc; |
1195 | 1195 | ||
1196 | INIT_LIST_HEAD(&g_smsdvb_clients); | 1196 | INIT_LIST_HEAD(&g_smsdvb_clients); |
1197 | kmutex_init(&g_smsdvb_clientslock); | 1197 | kmutex_init(&g_smsdvb_clientslock); |
1198 | 1198 | ||
1199 | smsdvb_debugfs_register(); | 1199 | smsdvb_debugfs_register(); |
1200 | 1200 | ||
1201 | rc = smscore_register_hotplug(smsdvb_hotplug); | 1201 | rc = smscore_register_hotplug(smsdvb_hotplug); |
1202 | 1202 | ||
1203 | sms_debug(""); | 1203 | sms_debug(""); |
1204 | 1204 | ||
1205 | return rc; | 1205 | return rc; |
1206 | } | 1206 | } |
1207 | 1207 | ||
1208 | static void __exit smsdvb_module_exit(void) | 1208 | static void __exit smsdvb_module_exit(void) |
1209 | { | 1209 | { |
1210 | smscore_unregister_hotplug(smsdvb_hotplug); | 1210 | smscore_unregister_hotplug(smsdvb_hotplug); |
1211 | 1211 | ||
1212 | kmutex_lock(&g_smsdvb_clientslock); | 1212 | kmutex_lock(&g_smsdvb_clientslock); |
1213 | 1213 | ||
1214 | while (!list_empty(&g_smsdvb_clients)) | 1214 | while (!list_empty(&g_smsdvb_clients)) |
1215 | smsdvb_unregister_client((struct smsdvb_client_t *)g_smsdvb_clients.next); | 1215 | smsdvb_unregister_client((struct smsdvb_client_t *)g_smsdvb_clients.next); |
1216 | 1216 | ||
1217 | smsdvb_debugfs_unregister(); | 1217 | smsdvb_debugfs_unregister(); |
1218 | 1218 | ||
1219 | kmutex_unlock(&g_smsdvb_clientslock); | 1219 | kmutex_unlock(&g_smsdvb_clientslock); |
1220 | } | 1220 | } |
1221 | 1221 | ||
1222 | module_init(smsdvb_module_init); | 1222 | module_init(smsdvb_module_init); |
1223 | module_exit(smsdvb_module_exit); | 1223 | module_exit(smsdvb_module_exit); |
1224 | 1224 | ||
1225 | MODULE_DESCRIPTION("SMS DVB subsystem adaptation module"); | 1225 | MODULE_DESCRIPTION("SMS DVB subsystem adaptation module"); |
1226 | MODULE_AUTHOR("Siano Mobile Silicon, Inc. (uris@siano-ms.com)"); | 1226 | MODULE_AUTHOR("Siano Mobile Silicon, Inc. (uris@siano-ms.com)"); |
1227 | MODULE_LICENSE("GPL"); | 1227 | MODULE_LICENSE("GPL"); |
1228 | 1228 |
drivers/media/common/siano/smsdvb.h
1 | /*********************************************************************** | 1 | /*********************************************************************** |
2 | * | 2 | * |
3 | * This program is free software: you can redistribute it and/or modify | 3 | * This program is free software: you can redistribute it and/or modify |
4 | * it under the terms of the GNU General Public License as published by | 4 | * it under the terms of the GNU General Public License as published by |
5 | * the Free Software Foundation, either version 2 of the License, or | 5 | * the Free Software Foundation, either version 2 of the License, or |
6 | * (at your option) any later version. | 6 | * (at your option) any later version. |
7 | 7 | ||
8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 | * GNU General Public License for more details. | 11 | * GNU General Public License for more details. |
12 | * | 12 | * |
13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU General Public License |
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
15 | * | 15 | * |
16 | ***********************************************************************/ | 16 | ***********************************************************************/ |
17 | 17 | ||
18 | struct smsdvb_debugfs; | 18 | struct smsdvb_debugfs; |
19 | struct smsdvb_client_t; | 19 | struct smsdvb_client_t; |
20 | 20 | ||
21 | typedef void (*sms_prt_dvb_stats_t)(struct smsdvb_debugfs *debug_data, | 21 | typedef void (*sms_prt_dvb_stats_t)(struct smsdvb_debugfs *debug_data, |
22 | struct sms_stats *p); | 22 | struct sms_stats *p); |
23 | 23 | ||
24 | typedef void (*sms_prt_isdb_stats_t)(struct smsdvb_debugfs *debug_data, | 24 | typedef void (*sms_prt_isdb_stats_t)(struct smsdvb_debugfs *debug_data, |
25 | struct sms_isdbt_stats *p); | 25 | struct sms_isdbt_stats *p); |
26 | 26 | ||
27 | typedef void (*sms_prt_isdb_stats_ex_t) | 27 | typedef void (*sms_prt_isdb_stats_ex_t) |
28 | (struct smsdvb_debugfs *debug_data, | 28 | (struct smsdvb_debugfs *debug_data, |
29 | struct sms_isdbt_stats_ex *p); | 29 | struct sms_isdbt_stats_ex *p); |
30 | 30 | ||
31 | 31 | ||
32 | struct smsdvb_client_t { | 32 | struct smsdvb_client_t { |
33 | struct list_head entry; | 33 | struct list_head entry; |
34 | 34 | ||
35 | struct smscore_device_t *coredev; | 35 | struct smscore_device_t *coredev; |
36 | struct smscore_client_t *smsclient; | 36 | struct smscore_client_t *smsclient; |
37 | 37 | ||
38 | struct dvb_adapter adapter; | 38 | struct dvb_adapter adapter; |
39 | struct dvb_demux demux; | 39 | struct dvb_demux demux; |
40 | struct dmxdev dmxdev; | 40 | struct dmxdev dmxdev; |
41 | struct dvb_frontend frontend; | 41 | struct dvb_frontend frontend; |
42 | 42 | ||
43 | fe_status_t fe_status; | 43 | fe_status_t fe_status; |
44 | 44 | ||
45 | struct completion tune_done; | 45 | struct completion tune_done; |
46 | struct completion stats_done; | 46 | struct completion stats_done; |
47 | 47 | ||
48 | int last_per; | 48 | int last_per; |
49 | 49 | ||
50 | int legacy_ber, legacy_per; | 50 | int legacy_ber, legacy_per; |
51 | 51 | ||
52 | int event_fe_state; | 52 | int event_fe_state; |
53 | int event_unc_state; | 53 | int event_unc_state; |
54 | 54 | ||
55 | unsigned long get_stats_jiffies; | 55 | unsigned long get_stats_jiffies; |
56 | 56 | ||
57 | int feed_users; | 57 | int feed_users; |
58 | bool has_tuned; | 58 | bool has_tuned; |
59 | 59 | ||
60 | /* stats debugfs data */ | 60 | /* stats debugfs data */ |
61 | struct dentry *debugfs; | 61 | struct dentry *debugfs; |
62 | 62 | ||
63 | struct smsdvb_debugfs *debug_data; | 63 | struct smsdvb_debugfs *debug_data; |
64 | 64 | ||
65 | sms_prt_dvb_stats_t prt_dvb_stats; | 65 | sms_prt_dvb_stats_t prt_dvb_stats; |
66 | sms_prt_isdb_stats_t prt_isdb_stats; | 66 | sms_prt_isdb_stats_t prt_isdb_stats; |
67 | sms_prt_isdb_stats_ex_t prt_isdb_stats_ex; | 67 | sms_prt_isdb_stats_ex_t prt_isdb_stats_ex; |
68 | }; | 68 | }; |
69 | 69 | ||
70 | /* | 70 | /* |
71 | * This struct is a mix of struct sms_rx_stats_ex and | 71 | * This struct is a mix of struct sms_rx_stats_ex and |
72 | * struct sms_srvm_signal_status. | 72 | * struct sms_srvm_signal_status. |
73 | * It was obtained by comparing the way it was filled by the original code | 73 | * It was obtained by comparing the way it was filled by the original code |
74 | */ | 74 | */ |
75 | struct RECEPTION_STATISTICS_PER_SLICES_S { | 75 | struct RECEPTION_STATISTICS_PER_SLICES_S { |
76 | u32 result; | 76 | u32 result; |
77 | u32 snr; | 77 | u32 snr; |
78 | s32 in_band_power; | 78 | s32 in_band_power; |
79 | u32 ts_packets; | 79 | u32 ts_packets; |
80 | u32 ets_packets; | 80 | u32 ets_packets; |
81 | u32 constellation; | 81 | u32 constellation; |
82 | u32 hp_code; | 82 | u32 hp_code; |
83 | u32 tps_srv_ind_lp; | 83 | u32 tps_srv_ind_lp; |
84 | u32 tps_srv_ind_hp; | 84 | u32 tps_srv_ind_hp; |
85 | u32 cell_id; | 85 | u32 cell_id; |
86 | u32 reason; | 86 | u32 reason; |
87 | u32 request_id; | 87 | u32 request_id; |
88 | u32 modem_state; /* from SMSHOSTLIB_DVB_MODEM_STATE_ET */ | 88 | u32 modem_state; /* from SMSHOSTLIB_DVB_MODEM_STATE_ET */ |
89 | 89 | ||
90 | u32 BER; /* Post Viterbi BER [1E-5] */ | 90 | u32 ber; /* Post Viterbi BER [1E-5] */ |
91 | s32 RSSI; /* dBm */ | 91 | s32 RSSI; /* dBm */ |
92 | s32 carrier_offset; /* Carrier Offset in bin/1024 */ | 92 | s32 carrier_offset; /* Carrier Offset in bin/1024 */ |
93 | 93 | ||
94 | u32 is_rf_locked; /* 0 - not locked, 1 - locked */ | 94 | u32 is_rf_locked; /* 0 - not locked, 1 - locked */ |
95 | u32 is_demod_locked; /* 0 - not locked, 1 - locked */ | 95 | u32 is_demod_locked; /* 0 - not locked, 1 - locked */ |
96 | 96 | ||
97 | u32 ber_bit_count; /* Total number of SYNC bits. */ | 97 | u32 ber_bit_count; /* Total number of SYNC bits. */ |
98 | u32 ber_error_count; /* Number of erronous SYNC bits. */ | 98 | u32 ber_error_count; /* Number of erronous SYNC bits. */ |
99 | 99 | ||
100 | s32 MRC_SNR; /* dB */ | 100 | s32 MRC_SNR; /* dB */ |
101 | s32 mrc_in_band_pwr; /* In band power in dBM */ | 101 | s32 mrc_in_band_pwr; /* In band power in dBM */ |
102 | s32 MRC_RSSI; /* dBm */ | 102 | s32 MRC_RSSI; /* dBm */ |
103 | }; | 103 | }; |
104 | 104 | ||
105 | /* From smsdvb-debugfs.c */ | 105 | /* From smsdvb-debugfs.c */ |
106 | #ifdef CONFIG_SMS_SIANO_DEBUGFS | 106 | #ifdef CONFIG_SMS_SIANO_DEBUGFS |
107 | 107 | ||
108 | int smsdvb_debugfs_create(struct smsdvb_client_t *client); | 108 | int smsdvb_debugfs_create(struct smsdvb_client_t *client); |
109 | void smsdvb_debugfs_release(struct smsdvb_client_t *client); | 109 | void smsdvb_debugfs_release(struct smsdvb_client_t *client); |
110 | int smsdvb_debugfs_register(void); | 110 | int smsdvb_debugfs_register(void); |
111 | void smsdvb_debugfs_unregister(void); | 111 | void smsdvb_debugfs_unregister(void); |
112 | 112 | ||
113 | #else | 113 | #else |
114 | 114 | ||
115 | static inline int smsdvb_debugfs_create(struct smsdvb_client_t *client) | 115 | static inline int smsdvb_debugfs_create(struct smsdvb_client_t *client) |
116 | { | 116 | { |
117 | return 0; | 117 | return 0; |
118 | } | 118 | } |
119 | 119 | ||
120 | static inline void smsdvb_debugfs_release(struct smsdvb_client_t *client) {} | 120 | static inline void smsdvb_debugfs_release(struct smsdvb_client_t *client) {} |
121 | 121 | ||
122 | static inline int smsdvb_debugfs_register(void) | 122 | static inline int smsdvb_debugfs_register(void) |
123 | { | 123 | { |
124 | return 0; | 124 | return 0; |
125 | }; | 125 | }; |
126 | 126 | ||
127 | static inline void smsdvb_debugfs_unregister(void) {}; | 127 | static inline void smsdvb_debugfs_unregister(void) {}; |
128 | 128 | ||
129 | #endif | 129 | #endif |
130 | 130 | ||
131 | 131 |
drivers/media/common/siano/smsendian.c
1 | /**************************************************************** | 1 | /**************************************************************** |
2 | 2 | ||
3 | Siano Mobile Silicon, Inc. | 3 | Siano Mobile Silicon, Inc. |
4 | MDTV receiver kernel modules. | 4 | MDTV receiver kernel modules. |
5 | Copyright (C) 2006-2009, Uri Shkolnik | 5 | Copyright (C) 2006-2009, Uri Shkolnik |
6 | 6 | ||
7 | This program is free software: you can redistribute it and/or modify | 7 | This program is free software: you can redistribute it and/or modify |
8 | it under the terms of the GNU General Public License as published by | 8 | it under the terms of the GNU General Public License as published by |
9 | the Free Software Foundation, either version 2 of the License, or | 9 | the Free Software Foundation, either version 2 of the License, or |
10 | (at your option) any later version. | 10 | (at your option) any later version. |
11 | 11 | ||
12 | This program is distributed in the hope that it will be useful, | 12 | This program is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | GNU General Public License for more details. | 15 | GNU General Public License for more details. |
16 | 16 | ||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License |
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 | 19 | ||
20 | ****************************************************************/ | 20 | ****************************************************************/ |
21 | 21 | ||
22 | #include <linux/export.h> | 22 | #include <linux/export.h> |
23 | #include <asm/byteorder.h> | 23 | #include <asm/byteorder.h> |
24 | 24 | ||
25 | #include "smsendian.h" | 25 | #include "smsendian.h" |
26 | #include "smscoreapi.h" | 26 | #include "smscoreapi.h" |
27 | 27 | ||
28 | void smsendian_handle_tx_message(void *buffer) | 28 | void smsendian_handle_tx_message(void *buffer) |
29 | { | 29 | { |
30 | #ifdef __BIG_ENDIAN | 30 | #ifdef __BIG_ENDIAN |
31 | struct sms_msg_data *msg = (struct sms_msg_data *)buffer; | 31 | struct sms_msg_data *msg = (struct sms_msg_data *)buffer; |
32 | int i; | 32 | int i; |
33 | int msgWords; | 33 | int msg_words; |
34 | 34 | ||
35 | switch (msg->x_msg_header.msg_type) { | 35 | switch (msg->x_msg_header.msg_type) { |
36 | case MSG_SMS_DATA_DOWNLOAD_REQ: | 36 | case MSG_SMS_DATA_DOWNLOAD_REQ: |
37 | { | 37 | { |
38 | msg->msgData[0] = le32_to_cpu(msg->msgData[0]); | 38 | msg->msg_data[0] = le32_to_cpu(msg->msg_data[0]); |
39 | break; | 39 | break; |
40 | } | 40 | } |
41 | 41 | ||
42 | default: | 42 | default: |
43 | msgWords = (msg->x_msg_header.msg_length - | 43 | msg_words = (msg->x_msg_header.msg_length - |
44 | sizeof(struct sms_msg_hdr))/4; | 44 | sizeof(struct sms_msg_hdr))/4; |
45 | 45 | ||
46 | for (i = 0; i < msgWords; i++) | 46 | for (i = 0; i < msg_words; i++) |
47 | msg->msgData[i] = le32_to_cpu(msg->msgData[i]); | 47 | msg->msg_data[i] = le32_to_cpu(msg->msg_data[i]); |
48 | 48 | ||
49 | break; | 49 | break; |
50 | } | 50 | } |
51 | #endif /* __BIG_ENDIAN */ | 51 | #endif /* __BIG_ENDIAN */ |
52 | } | 52 | } |
53 | EXPORT_SYMBOL_GPL(smsendian_handle_tx_message); | 53 | EXPORT_SYMBOL_GPL(smsendian_handle_tx_message); |
54 | 54 | ||
55 | void smsendian_handle_rx_message(void *buffer) | 55 | void smsendian_handle_rx_message(void *buffer) |
56 | { | 56 | { |
57 | #ifdef __BIG_ENDIAN | 57 | #ifdef __BIG_ENDIAN |
58 | struct sms_msg_data *msg = (struct sms_msg_data *)buffer; | 58 | struct sms_msg_data *msg = (struct sms_msg_data *)buffer; |
59 | int i; | 59 | int i; |
60 | int msgWords; | 60 | int msg_words; |
61 | 61 | ||
62 | switch (msg->x_msg_header.msg_type) { | 62 | switch (msg->x_msg_header.msg_type) { |
63 | case MSG_SMS_GET_VERSION_EX_RES: | 63 | case MSG_SMS_GET_VERSION_EX_RES: |
64 | { | 64 | { |
65 | struct sms_version_res *ver = | 65 | struct sms_version_res *ver = |
66 | (struct sms_version_res *) msg; | 66 | (struct sms_version_res *) msg; |
67 | ver->chip_model = le16_to_cpu(ver->chip_model); | 67 | ver->chip_model = le16_to_cpu(ver->chip_model); |
68 | break; | 68 | break; |
69 | } | 69 | } |
70 | 70 | ||
71 | case MSG_SMS_DVBT_BDA_DATA: | 71 | case MSG_SMS_DVBT_BDA_DATA: |
72 | case MSG_SMS_DAB_CHANNEL: | 72 | case MSG_SMS_DAB_CHANNEL: |
73 | case MSG_SMS_DATA_MSG: | 73 | case MSG_SMS_DATA_MSG: |
74 | { | 74 | { |
75 | break; | 75 | break; |
76 | } | 76 | } |
77 | 77 | ||
78 | default: | 78 | default: |
79 | { | 79 | { |
80 | msgWords = (msg->x_msg_header.msg_length - | 80 | msg_words = (msg->x_msg_header.msg_length - |
81 | sizeof(struct sms_msg_hdr))/4; | 81 | sizeof(struct sms_msg_hdr))/4; |
82 | 82 | ||
83 | for (i = 0; i < msgWords; i++) | 83 | for (i = 0; i < msg_words; i++) |
84 | msg->msgData[i] = le32_to_cpu(msg->msgData[i]); | 84 | msg->msg_data[i] = le32_to_cpu(msg->msg_data[i]); |
85 | 85 | ||
86 | break; | 86 | break; |
87 | } | 87 | } |
88 | } | 88 | } |
89 | #endif /* __BIG_ENDIAN */ | 89 | #endif /* __BIG_ENDIAN */ |
90 | } | 90 | } |
91 | EXPORT_SYMBOL_GPL(smsendian_handle_rx_message); | 91 | EXPORT_SYMBOL_GPL(smsendian_handle_rx_message); |
92 | 92 | ||
93 | void smsendian_handle_message_header(void *msg) | 93 | void smsendian_handle_message_header(void *msg) |
94 | { | 94 | { |
95 | #ifdef __BIG_ENDIAN | 95 | #ifdef __BIG_ENDIAN |
96 | struct sms_msg_hdr *phdr = (struct sms_msg_hdr *)msg; | 96 | struct sms_msg_hdr *phdr = (struct sms_msg_hdr *)msg; |
97 | 97 | ||
98 | phdr->msg_type = le16_to_cpu(phdr->msg_type); | 98 | phdr->msg_type = le16_to_cpu(phdr->msg_type); |
99 | phdr->msg_length = le16_to_cpu(phdr->msg_length); | 99 | phdr->msg_length = le16_to_cpu(phdr->msg_length); |
100 | phdr->msg_flags = le16_to_cpu(phdr->msg_flags); | 100 | phdr->msg_flags = le16_to_cpu(phdr->msg_flags); |
101 | #endif /* __BIG_ENDIAN */ | 101 | #endif /* __BIG_ENDIAN */ |
102 | } | 102 | } |
103 | EXPORT_SYMBOL_GPL(smsendian_handle_message_header); | 103 | EXPORT_SYMBOL_GPL(smsendian_handle_message_header); |
104 | 104 |
drivers/media/usb/siano/smsusb.c
1 | /**************************************************************** | 1 | /**************************************************************** |
2 | 2 | ||
3 | Siano Mobile Silicon, Inc. | 3 | Siano Mobile Silicon, Inc. |
4 | MDTV receiver kernel modules. | 4 | MDTV receiver kernel modules. |
5 | Copyright (C) 2005-2009, Uri Shkolnik, Anatoly Greenblat | 5 | Copyright (C) 2005-2009, Uri Shkolnik, Anatoly Greenblat |
6 | 6 | ||
7 | This program is free software: you can redistribute it and/or modify | 7 | This program is free software: you can redistribute it and/or modify |
8 | it under the terms of the GNU General Public License as published by | 8 | it under the terms of the GNU General Public License as published by |
9 | the Free Software Foundation, either version 2 of the License, or | 9 | the Free Software Foundation, either version 2 of the License, or |
10 | (at your option) any later version. | 10 | (at your option) any later version. |
11 | 11 | ||
12 | This program is distributed in the hope that it will be useful, | 12 | This program is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | GNU General Public License for more details. | 15 | GNU General Public License for more details. |
16 | 16 | ||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License |
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 | 19 | ||
20 | ****************************************************************/ | 20 | ****************************************************************/ |
21 | 21 | ||
22 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
23 | #include <linux/init.h> | 23 | #include <linux/init.h> |
24 | #include <linux/usb.h> | 24 | #include <linux/usb.h> |
25 | #include <linux/firmware.h> | 25 | #include <linux/firmware.h> |
26 | #include <linux/slab.h> | 26 | #include <linux/slab.h> |
27 | #include <linux/module.h> | 27 | #include <linux/module.h> |
28 | 28 | ||
29 | #include "smscoreapi.h" | 29 | #include "smscoreapi.h" |
30 | #include "sms-cards.h" | 30 | #include "sms-cards.h" |
31 | #include "smsendian.h" | 31 | #include "smsendian.h" |
32 | 32 | ||
33 | static int sms_dbg; | 33 | static int sms_dbg; |
34 | module_param_named(debug, sms_dbg, int, 0644); | 34 | module_param_named(debug, sms_dbg, int, 0644); |
35 | MODULE_PARM_DESC(debug, "set debug level (info=1, adv=2 (or-able))"); | 35 | MODULE_PARM_DESC(debug, "set debug level (info=1, adv=2 (or-able))"); |
36 | 36 | ||
37 | #define USB1_BUFFER_SIZE 0x1000 | 37 | #define USB1_BUFFER_SIZE 0x1000 |
38 | #define USB2_BUFFER_SIZE 0x2000 | 38 | #define USB2_BUFFER_SIZE 0x2000 |
39 | 39 | ||
40 | #define MAX_BUFFERS 50 | 40 | #define MAX_BUFFERS 50 |
41 | #define MAX_URBS 10 | 41 | #define MAX_URBS 10 |
42 | 42 | ||
43 | struct smsusb_device_t; | 43 | struct smsusb_device_t; |
44 | 44 | ||
45 | enum smsusb_state { | 45 | enum smsusb_state { |
46 | SMSUSB_DISCONNECTED, | 46 | SMSUSB_DISCONNECTED, |
47 | SMSUSB_SUSPENDED, | 47 | SMSUSB_SUSPENDED, |
48 | SMSUSB_ACTIVE | 48 | SMSUSB_ACTIVE |
49 | }; | 49 | }; |
50 | 50 | ||
51 | struct smsusb_urb_t { | 51 | struct smsusb_urb_t { |
52 | struct list_head entry; | 52 | struct list_head entry; |
53 | struct smscore_buffer_t *cb; | 53 | struct smscore_buffer_t *cb; |
54 | struct smsusb_device_t *dev; | 54 | struct smsusb_device_t *dev; |
55 | 55 | ||
56 | struct urb urb; | 56 | struct urb urb; |
57 | }; | 57 | }; |
58 | 58 | ||
59 | struct smsusb_device_t { | 59 | struct smsusb_device_t { |
60 | struct usb_device *udev; | 60 | struct usb_device *udev; |
61 | struct smscore_device_t *coredev; | 61 | struct smscore_device_t *coredev; |
62 | 62 | ||
63 | struct smsusb_urb_t surbs[MAX_URBS]; | 63 | struct smsusb_urb_t surbs[MAX_URBS]; |
64 | 64 | ||
65 | int response_alignment; | 65 | int response_alignment; |
66 | int buffer_size; | 66 | int buffer_size; |
67 | 67 | ||
68 | unsigned char in_ep; | 68 | unsigned char in_ep; |
69 | unsigned char out_ep; | 69 | unsigned char out_ep; |
70 | enum smsusb_state state; | 70 | enum smsusb_state state; |
71 | }; | 71 | }; |
72 | 72 | ||
73 | static int smsusb_submit_urb(struct smsusb_device_t *dev, | 73 | static int smsusb_submit_urb(struct smsusb_device_t *dev, |
74 | struct smsusb_urb_t *surb); | 74 | struct smsusb_urb_t *surb); |
75 | 75 | ||
76 | /** | 76 | /** |
77 | * Completing URB's callback handler - top half (interrupt context) | 77 | * Completing URB's callback handler - top half (interrupt context) |
78 | * adds completing sms urb to the global surbs list and activtes the worker | 78 | * adds completing sms urb to the global surbs list and activtes the worker |
79 | * thread the surb | 79 | * thread the surb |
80 | * IMPORTANT - blocking functions must not be called from here !!! | 80 | * IMPORTANT - blocking functions must not be called from here !!! |
81 | 81 | ||
82 | * @param urb pointer to a completing urb object | 82 | * @param urb pointer to a completing urb object |
83 | */ | 83 | */ |
84 | static void smsusb_onresponse(struct urb *urb) | 84 | static void smsusb_onresponse(struct urb *urb) |
85 | { | 85 | { |
86 | struct smsusb_urb_t *surb = (struct smsusb_urb_t *) urb->context; | 86 | struct smsusb_urb_t *surb = (struct smsusb_urb_t *) urb->context; |
87 | struct smsusb_device_t *dev = surb->dev; | 87 | struct smsusb_device_t *dev = surb->dev; |
88 | 88 | ||
89 | if (urb->status == -ESHUTDOWN) { | 89 | if (urb->status == -ESHUTDOWN) { |
90 | sms_err("error, urb status %d (-ESHUTDOWN), %d bytes", | 90 | sms_err("error, urb status %d (-ESHUTDOWN), %d bytes", |
91 | urb->status, urb->actual_length); | 91 | urb->status, urb->actual_length); |
92 | return; | 92 | return; |
93 | } | 93 | } |
94 | 94 | ||
95 | if ((urb->actual_length > 0) && (urb->status == 0)) { | 95 | if ((urb->actual_length > 0) && (urb->status == 0)) { |
96 | struct sms_msg_hdr *phdr = (struct sms_msg_hdr *)surb->cb->p; | 96 | struct sms_msg_hdr *phdr = (struct sms_msg_hdr *)surb->cb->p; |
97 | 97 | ||
98 | smsendian_handle_message_header(phdr); | 98 | smsendian_handle_message_header(phdr); |
99 | if (urb->actual_length >= phdr->msg_length) { | 99 | if (urb->actual_length >= phdr->msg_length) { |
100 | surb->cb->size = phdr->msg_length; | 100 | surb->cb->size = phdr->msg_length; |
101 | 101 | ||
102 | if (dev->response_alignment && | 102 | if (dev->response_alignment && |
103 | (phdr->msg_flags & MSG_HDR_FLAG_SPLIT_MSG)) { | 103 | (phdr->msg_flags & MSG_HDR_FLAG_SPLIT_MSG)) { |
104 | 104 | ||
105 | surb->cb->offset = | 105 | surb->cb->offset = |
106 | dev->response_alignment + | 106 | dev->response_alignment + |
107 | ((phdr->msg_flags >> 8) & 3); | 107 | ((phdr->msg_flags >> 8) & 3); |
108 | 108 | ||
109 | /* sanity check */ | 109 | /* sanity check */ |
110 | if (((int) phdr->msg_length + | 110 | if (((int) phdr->msg_length + |
111 | surb->cb->offset) > urb->actual_length) { | 111 | surb->cb->offset) > urb->actual_length) { |
112 | sms_err("invalid response " | 112 | sms_err("invalid response " |
113 | "msglen %d offset %d " | 113 | "msglen %d offset %d " |
114 | "size %d", | 114 | "size %d", |
115 | phdr->msg_length, | 115 | phdr->msg_length, |
116 | surb->cb->offset, | 116 | surb->cb->offset, |
117 | urb->actual_length); | 117 | urb->actual_length); |
118 | goto exit_and_resubmit; | 118 | goto exit_and_resubmit; |
119 | } | 119 | } |
120 | 120 | ||
121 | /* move buffer pointer and | 121 | /* move buffer pointer and |
122 | * copy header to its new location */ | 122 | * copy header to its new location */ |
123 | memcpy((char *) phdr + surb->cb->offset, | 123 | memcpy((char *) phdr + surb->cb->offset, |
124 | phdr, sizeof(struct sms_msg_hdr)); | 124 | phdr, sizeof(struct sms_msg_hdr)); |
125 | } else | 125 | } else |
126 | surb->cb->offset = 0; | 126 | surb->cb->offset = 0; |
127 | 127 | ||
128 | sms_debug("received %s(%d) size: %d", | 128 | sms_debug("received %s(%d) size: %d", |
129 | smscore_translate_msg(phdr->msg_type), | 129 | smscore_translate_msg(phdr->msg_type), |
130 | phdr->msg_type, phdr->msg_length); | 130 | phdr->msg_type, phdr->msg_length); |
131 | 131 | ||
132 | smsendian_handle_rx_message((struct sms_msg_data *) phdr); | 132 | smsendian_handle_rx_message((struct sms_msg_data *) phdr); |
133 | 133 | ||
134 | smscore_onresponse(dev->coredev, surb->cb); | 134 | smscore_onresponse(dev->coredev, surb->cb); |
135 | surb->cb = NULL; | 135 | surb->cb = NULL; |
136 | } else { | 136 | } else { |
137 | sms_err("invalid response " | 137 | sms_err("invalid response " |
138 | "msglen %d actual %d", | 138 | "msglen %d actual %d", |
139 | phdr->msg_length, urb->actual_length); | 139 | phdr->msg_length, urb->actual_length); |
140 | } | 140 | } |
141 | } else | 141 | } else |
142 | sms_err("error, urb status %d, %d bytes", | 142 | sms_err("error, urb status %d, %d bytes", |
143 | urb->status, urb->actual_length); | 143 | urb->status, urb->actual_length); |
144 | 144 | ||
145 | 145 | ||
146 | exit_and_resubmit: | 146 | exit_and_resubmit: |
147 | smsusb_submit_urb(dev, surb); | 147 | smsusb_submit_urb(dev, surb); |
148 | } | 148 | } |
149 | 149 | ||
150 | static int smsusb_submit_urb(struct smsusb_device_t *dev, | 150 | static int smsusb_submit_urb(struct smsusb_device_t *dev, |
151 | struct smsusb_urb_t *surb) | 151 | struct smsusb_urb_t *surb) |
152 | { | 152 | { |
153 | if (!surb->cb) { | 153 | if (!surb->cb) { |
154 | surb->cb = smscore_getbuffer(dev->coredev); | 154 | surb->cb = smscore_getbuffer(dev->coredev); |
155 | if (!surb->cb) { | 155 | if (!surb->cb) { |
156 | sms_err("smscore_getbuffer(...) returned NULL"); | 156 | sms_err("smscore_getbuffer(...) returned NULL"); |
157 | return -ENOMEM; | 157 | return -ENOMEM; |
158 | } | 158 | } |
159 | } | 159 | } |
160 | 160 | ||
161 | usb_fill_bulk_urb( | 161 | usb_fill_bulk_urb( |
162 | &surb->urb, | 162 | &surb->urb, |
163 | dev->udev, | 163 | dev->udev, |
164 | usb_rcvbulkpipe(dev->udev, dev->in_ep), | 164 | usb_rcvbulkpipe(dev->udev, dev->in_ep), |
165 | surb->cb->p, | 165 | surb->cb->p, |
166 | dev->buffer_size, | 166 | dev->buffer_size, |
167 | smsusb_onresponse, | 167 | smsusb_onresponse, |
168 | surb | 168 | surb |
169 | ); | 169 | ); |
170 | surb->urb.transfer_dma = surb->cb->phys; | 170 | surb->urb.transfer_dma = surb->cb->phys; |
171 | surb->urb.transfer_flags |= URB_NO_TRANSFER_DMA_MAP; | 171 | surb->urb.transfer_flags |= URB_NO_TRANSFER_DMA_MAP; |
172 | 172 | ||
173 | return usb_submit_urb(&surb->urb, GFP_ATOMIC); | 173 | return usb_submit_urb(&surb->urb, GFP_ATOMIC); |
174 | } | 174 | } |
175 | 175 | ||
176 | static void smsusb_stop_streaming(struct smsusb_device_t *dev) | 176 | static void smsusb_stop_streaming(struct smsusb_device_t *dev) |
177 | { | 177 | { |
178 | int i; | 178 | int i; |
179 | 179 | ||
180 | for (i = 0; i < MAX_URBS; i++) { | 180 | for (i = 0; i < MAX_URBS; i++) { |
181 | usb_kill_urb(&dev->surbs[i].urb); | 181 | usb_kill_urb(&dev->surbs[i].urb); |
182 | 182 | ||
183 | if (dev->surbs[i].cb) { | 183 | if (dev->surbs[i].cb) { |
184 | smscore_putbuffer(dev->coredev, dev->surbs[i].cb); | 184 | smscore_putbuffer(dev->coredev, dev->surbs[i].cb); |
185 | dev->surbs[i].cb = NULL; | 185 | dev->surbs[i].cb = NULL; |
186 | } | 186 | } |
187 | } | 187 | } |
188 | } | 188 | } |
189 | 189 | ||
190 | static int smsusb_start_streaming(struct smsusb_device_t *dev) | 190 | static int smsusb_start_streaming(struct smsusb_device_t *dev) |
191 | { | 191 | { |
192 | int i, rc; | 192 | int i, rc; |
193 | 193 | ||
194 | for (i = 0; i < MAX_URBS; i++) { | 194 | for (i = 0; i < MAX_URBS; i++) { |
195 | rc = smsusb_submit_urb(dev, &dev->surbs[i]); | 195 | rc = smsusb_submit_urb(dev, &dev->surbs[i]); |
196 | if (rc < 0) { | 196 | if (rc < 0) { |
197 | sms_err("smsusb_submit_urb(...) failed"); | 197 | sms_err("smsusb_submit_urb(...) failed"); |
198 | smsusb_stop_streaming(dev); | 198 | smsusb_stop_streaming(dev); |
199 | break; | 199 | break; |
200 | } | 200 | } |
201 | } | 201 | } |
202 | 202 | ||
203 | return rc; | 203 | return rc; |
204 | } | 204 | } |
205 | 205 | ||
206 | static int smsusb_sendrequest(void *context, void *buffer, size_t size) | 206 | static int smsusb_sendrequest(void *context, void *buffer, size_t size) |
207 | { | 207 | { |
208 | struct smsusb_device_t *dev = (struct smsusb_device_t *) context; | 208 | struct smsusb_device_t *dev = (struct smsusb_device_t *) context; |
209 | struct sms_msg_hdr *phdr = (struct sms_msg_hdr *) buffer; | 209 | struct sms_msg_hdr *phdr = (struct sms_msg_hdr *) buffer; |
210 | int dummy; | 210 | int dummy; |
211 | 211 | ||
212 | if (dev->state != SMSUSB_ACTIVE) | 212 | if (dev->state != SMSUSB_ACTIVE) |
213 | return -ENOENT; | 213 | return -ENOENT; |
214 | 214 | ||
215 | sms_debug("sending %s(%d) size: %d", | 215 | sms_debug("sending %s(%d) size: %d", |
216 | smscore_translate_msg(phdr->msg_type), phdr->msg_type, | 216 | smscore_translate_msg(phdr->msg_type), phdr->msg_type, |
217 | phdr->msg_length); | 217 | phdr->msg_length); |
218 | 218 | ||
219 | smsendian_handle_tx_message((struct sms_msg_data *) phdr); | 219 | smsendian_handle_tx_message((struct sms_msg_data *) phdr); |
220 | smsendian_handle_message_header((struct sms_msg_hdr *)buffer); | 220 | smsendian_handle_message_header((struct sms_msg_hdr *)buffer); |
221 | return usb_bulk_msg(dev->udev, usb_sndbulkpipe(dev->udev, 2), | 221 | return usb_bulk_msg(dev->udev, usb_sndbulkpipe(dev->udev, 2), |
222 | buffer, size, &dummy, 1000); | 222 | buffer, size, &dummy, 1000); |
223 | } | 223 | } |
224 | 224 | ||
225 | static char *smsusb1_fw_lkup[] = { | 225 | static char *smsusb1_fw_lkup[] = { |
226 | "dvbt_stellar_usb.inp", | 226 | "dvbt_stellar_usb.inp", |
227 | "dvbh_stellar_usb.inp", | 227 | "dvbh_stellar_usb.inp", |
228 | "tdmb_stellar_usb.inp", | 228 | "tdmb_stellar_usb.inp", |
229 | "none", | 229 | "none", |
230 | "dvbt_bda_stellar_usb.inp", | 230 | "dvbt_bda_stellar_usb.inp", |
231 | }; | 231 | }; |
232 | 232 | ||
233 | static inline char *sms_get_fw_name(int mode, int board_id) | 233 | static inline char *sms_get_fw_name(int mode, int board_id) |
234 | { | 234 | { |
235 | char **fw = sms_get_board(board_id)->fw; | 235 | char **fw = sms_get_board(board_id)->fw; |
236 | return (fw && fw[mode]) ? fw[mode] : smsusb1_fw_lkup[mode]; | 236 | return (fw && fw[mode]) ? fw[mode] : smsusb1_fw_lkup[mode]; |
237 | } | 237 | } |
238 | 238 | ||
239 | static int smsusb1_load_firmware(struct usb_device *udev, int id, int board_id) | 239 | static int smsusb1_load_firmware(struct usb_device *udev, int id, int board_id) |
240 | { | 240 | { |
241 | const struct firmware *fw; | 241 | const struct firmware *fw; |
242 | u8 *fw_buffer; | 242 | u8 *fw_buffer; |
243 | int rc, dummy; | 243 | int rc, dummy; |
244 | char *fw_filename; | 244 | char *fw_filename; |
245 | 245 | ||
246 | if (id < DEVICE_MODE_DVBT || id > DEVICE_MODE_DVBT_BDA) { | 246 | if (id < DEVICE_MODE_DVBT || id > DEVICE_MODE_DVBT_BDA) { |
247 | sms_err("invalid firmware id specified %d", id); | 247 | sms_err("invalid firmware id specified %d", id); |
248 | return -EINVAL; | 248 | return -EINVAL; |
249 | } | 249 | } |
250 | 250 | ||
251 | fw_filename = sms_get_fw_name(id, board_id); | 251 | fw_filename = sms_get_fw_name(id, board_id); |
252 | 252 | ||
253 | rc = request_firmware(&fw, fw_filename, &udev->dev); | 253 | rc = request_firmware(&fw, fw_filename, &udev->dev); |
254 | if (rc < 0) { | 254 | if (rc < 0) { |
255 | sms_warn("failed to open \"%s\" mode %d, " | 255 | sms_warn("failed to open \"%s\" mode %d, " |
256 | "trying again with default firmware", fw_filename, id); | 256 | "trying again with default firmware", fw_filename, id); |
257 | 257 | ||
258 | fw_filename = smsusb1_fw_lkup[id]; | 258 | fw_filename = smsusb1_fw_lkup[id]; |
259 | rc = request_firmware(&fw, fw_filename, &udev->dev); | 259 | rc = request_firmware(&fw, fw_filename, &udev->dev); |
260 | if (rc < 0) { | 260 | if (rc < 0) { |
261 | sms_warn("failed to open \"%s\" mode %d", | 261 | sms_warn("failed to open \"%s\" mode %d", |
262 | fw_filename, id); | 262 | fw_filename, id); |
263 | 263 | ||
264 | return rc; | 264 | return rc; |
265 | } | 265 | } |
266 | } | 266 | } |
267 | 267 | ||
268 | fw_buffer = kmalloc(fw->size, GFP_KERNEL); | 268 | fw_buffer = kmalloc(fw->size, GFP_KERNEL); |
269 | if (fw_buffer) { | 269 | if (fw_buffer) { |
270 | memcpy(fw_buffer, fw->data, fw->size); | 270 | memcpy(fw_buffer, fw->data, fw->size); |
271 | 271 | ||
272 | rc = usb_bulk_msg(udev, usb_sndbulkpipe(udev, 2), | 272 | rc = usb_bulk_msg(udev, usb_sndbulkpipe(udev, 2), |
273 | fw_buffer, fw->size, &dummy, 1000); | 273 | fw_buffer, fw->size, &dummy, 1000); |
274 | 274 | ||
275 | sms_info("sent %zd(%d) bytes, rc %d", fw->size, dummy, rc); | 275 | sms_info("sent %zd(%d) bytes, rc %d", fw->size, dummy, rc); |
276 | 276 | ||
277 | kfree(fw_buffer); | 277 | kfree(fw_buffer); |
278 | } else { | 278 | } else { |
279 | sms_err("failed to allocate firmware buffer"); | 279 | sms_err("failed to allocate firmware buffer"); |
280 | rc = -ENOMEM; | 280 | rc = -ENOMEM; |
281 | } | 281 | } |
282 | sms_info("read FW %s, size=%zd", fw_filename, fw->size); | 282 | sms_info("read FW %s, size=%zd", fw_filename, fw->size); |
283 | 283 | ||
284 | release_firmware(fw); | 284 | release_firmware(fw); |
285 | 285 | ||
286 | return rc; | 286 | return rc; |
287 | } | 287 | } |
288 | 288 | ||
289 | static void smsusb1_detectmode(void *context, int *mode) | 289 | static void smsusb1_detectmode(void *context, int *mode) |
290 | { | 290 | { |
291 | char *product_string = | 291 | char *product_string = |
292 | ((struct smsusb_device_t *) context)->udev->product; | 292 | ((struct smsusb_device_t *) context)->udev->product; |
293 | 293 | ||
294 | *mode = DEVICE_MODE_NONE; | 294 | *mode = DEVICE_MODE_NONE; |
295 | 295 | ||
296 | if (!product_string) { | 296 | if (!product_string) { |
297 | product_string = "none"; | 297 | product_string = "none"; |
298 | sms_err("product string not found"); | 298 | sms_err("product string not found"); |
299 | } else if (strstr(product_string, "DVBH")) | 299 | } else if (strstr(product_string, "DVBH")) |
300 | *mode = 1; | 300 | *mode = 1; |
301 | else if (strstr(product_string, "BDA")) | 301 | else if (strstr(product_string, "BDA")) |
302 | *mode = 4; | 302 | *mode = 4; |
303 | else if (strstr(product_string, "DVBT")) | 303 | else if (strstr(product_string, "DVBT")) |
304 | *mode = 0; | 304 | *mode = 0; |
305 | else if (strstr(product_string, "TDMB")) | 305 | else if (strstr(product_string, "TDMB")) |
306 | *mode = 2; | 306 | *mode = 2; |
307 | 307 | ||
308 | sms_info("%d \"%s\"", *mode, product_string); | 308 | sms_info("%d \"%s\"", *mode, product_string); |
309 | } | 309 | } |
310 | 310 | ||
311 | static int smsusb1_setmode(void *context, int mode) | 311 | static int smsusb1_setmode(void *context, int mode) |
312 | { | 312 | { |
313 | struct sms_msg_hdr Msg = { MSG_SW_RELOAD_REQ, 0, HIF_TASK, | 313 | struct sms_msg_hdr msg = { MSG_SW_RELOAD_REQ, 0, HIF_TASK, |
314 | sizeof(struct sms_msg_hdr), 0 }; | 314 | sizeof(struct sms_msg_hdr), 0 }; |
315 | 315 | ||
316 | if (mode < DEVICE_MODE_DVBT || mode > DEVICE_MODE_DVBT_BDA) { | 316 | if (mode < DEVICE_MODE_DVBT || mode > DEVICE_MODE_DVBT_BDA) { |
317 | sms_err("invalid firmware id specified %d", mode); | 317 | sms_err("invalid firmware id specified %d", mode); |
318 | return -EINVAL; | 318 | return -EINVAL; |
319 | } | 319 | } |
320 | 320 | ||
321 | return smsusb_sendrequest(context, &Msg, sizeof(Msg)); | 321 | return smsusb_sendrequest(context, &msg, sizeof(msg)); |
322 | } | 322 | } |
323 | 323 | ||
324 | static void smsusb_term_device(struct usb_interface *intf) | 324 | static void smsusb_term_device(struct usb_interface *intf) |
325 | { | 325 | { |
326 | struct smsusb_device_t *dev = usb_get_intfdata(intf); | 326 | struct smsusb_device_t *dev = usb_get_intfdata(intf); |
327 | 327 | ||
328 | if (dev) { | 328 | if (dev) { |
329 | dev->state = SMSUSB_DISCONNECTED; | 329 | dev->state = SMSUSB_DISCONNECTED; |
330 | 330 | ||
331 | smsusb_stop_streaming(dev); | 331 | smsusb_stop_streaming(dev); |
332 | 332 | ||
333 | /* unregister from smscore */ | 333 | /* unregister from smscore */ |
334 | if (dev->coredev) | 334 | if (dev->coredev) |
335 | smscore_unregister_device(dev->coredev); | 335 | smscore_unregister_device(dev->coredev); |
336 | 336 | ||
337 | sms_info("device 0x%p destroyed", dev); | 337 | sms_info("device 0x%p destroyed", dev); |
338 | kfree(dev); | 338 | kfree(dev); |
339 | } | 339 | } |
340 | 340 | ||
341 | usb_set_intfdata(intf, NULL); | 341 | usb_set_intfdata(intf, NULL); |
342 | } | 342 | } |
343 | 343 | ||
344 | static int smsusb_init_device(struct usb_interface *intf, int board_id) | 344 | static int smsusb_init_device(struct usb_interface *intf, int board_id) |
345 | { | 345 | { |
346 | struct smsdevice_params_t params; | 346 | struct smsdevice_params_t params; |
347 | struct smsusb_device_t *dev; | 347 | struct smsusb_device_t *dev; |
348 | int i, rc; | 348 | int i, rc; |
349 | 349 | ||
350 | /* create device object */ | 350 | /* create device object */ |
351 | dev = kzalloc(sizeof(struct smsusb_device_t), GFP_KERNEL); | 351 | dev = kzalloc(sizeof(struct smsusb_device_t), GFP_KERNEL); |
352 | if (!dev) { | 352 | if (!dev) { |
353 | sms_err("kzalloc(sizeof(struct smsusb_device_t) failed"); | 353 | sms_err("kzalloc(sizeof(struct smsusb_device_t) failed"); |
354 | return -ENOMEM; | 354 | return -ENOMEM; |
355 | } | 355 | } |
356 | 356 | ||
357 | memset(¶ms, 0, sizeof(params)); | 357 | memset(¶ms, 0, sizeof(params)); |
358 | usb_set_intfdata(intf, dev); | 358 | usb_set_intfdata(intf, dev); |
359 | dev->udev = interface_to_usbdev(intf); | 359 | dev->udev = interface_to_usbdev(intf); |
360 | dev->state = SMSUSB_DISCONNECTED; | 360 | dev->state = SMSUSB_DISCONNECTED; |
361 | 361 | ||
362 | params.device_type = sms_get_board(board_id)->type; | 362 | params.device_type = sms_get_board(board_id)->type; |
363 | 363 | ||
364 | switch (params.device_type) { | 364 | switch (params.device_type) { |
365 | case SMS_STELLAR: | 365 | case SMS_STELLAR: |
366 | dev->buffer_size = USB1_BUFFER_SIZE; | 366 | dev->buffer_size = USB1_BUFFER_SIZE; |
367 | 367 | ||
368 | params.setmode_handler = smsusb1_setmode; | 368 | params.setmode_handler = smsusb1_setmode; |
369 | params.detectmode_handler = smsusb1_detectmode; | 369 | params.detectmode_handler = smsusb1_detectmode; |
370 | break; | 370 | break; |
371 | case SMS_UNKNOWN_TYPE: | 371 | case SMS_UNKNOWN_TYPE: |
372 | sms_err("Unspecified sms device type!"); | 372 | sms_err("Unspecified sms device type!"); |
373 | /* fall-thru */ | 373 | /* fall-thru */ |
374 | default: | 374 | default: |
375 | dev->buffer_size = USB2_BUFFER_SIZE; | 375 | dev->buffer_size = USB2_BUFFER_SIZE; |
376 | dev->response_alignment = | 376 | dev->response_alignment = |
377 | le16_to_cpu(dev->udev->ep_in[1]->desc.wMaxPacketSize) - | 377 | le16_to_cpu(dev->udev->ep_in[1]->desc.wMaxPacketSize) - |
378 | sizeof(struct sms_msg_hdr); | 378 | sizeof(struct sms_msg_hdr); |
379 | 379 | ||
380 | params.flags |= SMS_DEVICE_FAMILY2; | 380 | params.flags |= SMS_DEVICE_FAMILY2; |
381 | break; | 381 | break; |
382 | } | 382 | } |
383 | 383 | ||
384 | for (i = 0; i < intf->cur_altsetting->desc.bNumEndpoints; i++) { | 384 | for (i = 0; i < intf->cur_altsetting->desc.bNumEndpoints; i++) { |
385 | if (intf->cur_altsetting->endpoint[i].desc. bEndpointAddress & USB_DIR_IN) | 385 | if (intf->cur_altsetting->endpoint[i].desc. bEndpointAddress & USB_DIR_IN) |
386 | dev->in_ep = intf->cur_altsetting->endpoint[i].desc.bEndpointAddress; | 386 | dev->in_ep = intf->cur_altsetting->endpoint[i].desc.bEndpointAddress; |
387 | else | 387 | else |
388 | dev->out_ep = intf->cur_altsetting->endpoint[i].desc.bEndpointAddress; | 388 | dev->out_ep = intf->cur_altsetting->endpoint[i].desc.bEndpointAddress; |
389 | } | 389 | } |
390 | 390 | ||
391 | sms_info("in_ep = %02x, out_ep = %02x", | 391 | sms_info("in_ep = %02x, out_ep = %02x", |
392 | dev->in_ep, dev->out_ep); | 392 | dev->in_ep, dev->out_ep); |
393 | 393 | ||
394 | params.device = &dev->udev->dev; | 394 | params.device = &dev->udev->dev; |
395 | params.buffer_size = dev->buffer_size; | 395 | params.buffer_size = dev->buffer_size; |
396 | params.num_buffers = MAX_BUFFERS; | 396 | params.num_buffers = MAX_BUFFERS; |
397 | params.sendrequest_handler = smsusb_sendrequest; | 397 | params.sendrequest_handler = smsusb_sendrequest; |
398 | params.context = dev; | 398 | params.context = dev; |
399 | usb_make_path(dev->udev, params.devpath, sizeof(params.devpath)); | 399 | usb_make_path(dev->udev, params.devpath, sizeof(params.devpath)); |
400 | 400 | ||
401 | /* register in smscore */ | 401 | /* register in smscore */ |
402 | rc = smscore_register_device(¶ms, &dev->coredev); | 402 | rc = smscore_register_device(¶ms, &dev->coredev); |
403 | if (rc < 0) { | 403 | if (rc < 0) { |
404 | sms_err("smscore_register_device(...) failed, rc %d", rc); | 404 | sms_err("smscore_register_device(...) failed, rc %d", rc); |
405 | smsusb_term_device(intf); | 405 | smsusb_term_device(intf); |
406 | return rc; | 406 | return rc; |
407 | } | 407 | } |
408 | 408 | ||
409 | smscore_set_board_id(dev->coredev, board_id); | 409 | smscore_set_board_id(dev->coredev, board_id); |
410 | 410 | ||
411 | dev->coredev->is_usb_device = true; | 411 | dev->coredev->is_usb_device = true; |
412 | 412 | ||
413 | /* initialize urbs */ | 413 | /* initialize urbs */ |
414 | for (i = 0; i < MAX_URBS; i++) { | 414 | for (i = 0; i < MAX_URBS; i++) { |
415 | dev->surbs[i].dev = dev; | 415 | dev->surbs[i].dev = dev; |
416 | usb_init_urb(&dev->surbs[i].urb); | 416 | usb_init_urb(&dev->surbs[i].urb); |
417 | } | 417 | } |
418 | 418 | ||
419 | sms_info("smsusb_start_streaming(...)."); | 419 | sms_info("smsusb_start_streaming(...)."); |
420 | rc = smsusb_start_streaming(dev); | 420 | rc = smsusb_start_streaming(dev); |
421 | if (rc < 0) { | 421 | if (rc < 0) { |
422 | sms_err("smsusb_start_streaming(...) failed"); | 422 | sms_err("smsusb_start_streaming(...) failed"); |
423 | smsusb_term_device(intf); | 423 | smsusb_term_device(intf); |
424 | return rc; | 424 | return rc; |
425 | } | 425 | } |
426 | 426 | ||
427 | dev->state = SMSUSB_ACTIVE; | 427 | dev->state = SMSUSB_ACTIVE; |
428 | 428 | ||
429 | rc = smscore_start_device(dev->coredev); | 429 | rc = smscore_start_device(dev->coredev); |
430 | if (rc < 0) { | 430 | if (rc < 0) { |
431 | sms_err("smscore_start_device(...) failed"); | 431 | sms_err("smscore_start_device(...) failed"); |
432 | smsusb_term_device(intf); | 432 | smsusb_term_device(intf); |
433 | return rc; | 433 | return rc; |
434 | } | 434 | } |
435 | 435 | ||
436 | sms_info("device 0x%p created", dev); | 436 | sms_info("device 0x%p created", dev); |
437 | 437 | ||
438 | return rc; | 438 | return rc; |
439 | } | 439 | } |
440 | 440 | ||
441 | static int smsusb_probe(struct usb_interface *intf, | 441 | static int smsusb_probe(struct usb_interface *intf, |
442 | const struct usb_device_id *id) | 442 | const struct usb_device_id *id) |
443 | { | 443 | { |
444 | struct usb_device *udev = interface_to_usbdev(intf); | 444 | struct usb_device *udev = interface_to_usbdev(intf); |
445 | char devpath[32]; | 445 | char devpath[32]; |
446 | int i, rc; | 446 | int i, rc; |
447 | 447 | ||
448 | sms_info("interface number %d", | 448 | sms_info("interface number %d", |
449 | intf->cur_altsetting->desc.bInterfaceNumber); | 449 | intf->cur_altsetting->desc.bInterfaceNumber); |
450 | 450 | ||
451 | if (sms_get_board(id->driver_info)->intf_num != | 451 | if (sms_get_board(id->driver_info)->intf_num != |
452 | intf->cur_altsetting->desc.bInterfaceNumber) { | 452 | intf->cur_altsetting->desc.bInterfaceNumber) { |
453 | sms_err("interface number is %d expecting %d", | 453 | sms_err("interface number is %d expecting %d", |
454 | sms_get_board(id->driver_info)->intf_num, | 454 | sms_get_board(id->driver_info)->intf_num, |
455 | intf->cur_altsetting->desc.bInterfaceNumber); | 455 | intf->cur_altsetting->desc.bInterfaceNumber); |
456 | return -ENODEV; | 456 | return -ENODEV; |
457 | } | 457 | } |
458 | 458 | ||
459 | if (intf->num_altsetting > 1) { | 459 | if (intf->num_altsetting > 1) { |
460 | rc = usb_set_interface(udev, | 460 | rc = usb_set_interface(udev, |
461 | intf->cur_altsetting->desc.bInterfaceNumber, | 461 | intf->cur_altsetting->desc.bInterfaceNumber, |
462 | 0); | 462 | 0); |
463 | if (rc < 0) { | 463 | if (rc < 0) { |
464 | sms_err("usb_set_interface failed, rc %d", rc); | 464 | sms_err("usb_set_interface failed, rc %d", rc); |
465 | return rc; | 465 | return rc; |
466 | } | 466 | } |
467 | } | 467 | } |
468 | 468 | ||
469 | sms_info("smsusb_probe %d", | 469 | sms_info("smsusb_probe %d", |
470 | intf->cur_altsetting->desc.bInterfaceNumber); | 470 | intf->cur_altsetting->desc.bInterfaceNumber); |
471 | for (i = 0; i < intf->cur_altsetting->desc.bNumEndpoints; i++) { | 471 | for (i = 0; i < intf->cur_altsetting->desc.bNumEndpoints; i++) { |
472 | sms_info("endpoint %d %02x %02x %d", i, | 472 | sms_info("endpoint %d %02x %02x %d", i, |
473 | intf->cur_altsetting->endpoint[i].desc.bEndpointAddress, | 473 | intf->cur_altsetting->endpoint[i].desc.bEndpointAddress, |
474 | intf->cur_altsetting->endpoint[i].desc.bmAttributes, | 474 | intf->cur_altsetting->endpoint[i].desc.bmAttributes, |
475 | intf->cur_altsetting->endpoint[i].desc.wMaxPacketSize); | 475 | intf->cur_altsetting->endpoint[i].desc.wMaxPacketSize); |
476 | if (intf->cur_altsetting->endpoint[i].desc.bEndpointAddress & | 476 | if (intf->cur_altsetting->endpoint[i].desc.bEndpointAddress & |
477 | USB_DIR_IN) | 477 | USB_DIR_IN) |
478 | rc = usb_clear_halt(udev, usb_rcvbulkpipe(udev, | 478 | rc = usb_clear_halt(udev, usb_rcvbulkpipe(udev, |
479 | intf->cur_altsetting->endpoint[i].desc.bEndpointAddress)); | 479 | intf->cur_altsetting->endpoint[i].desc.bEndpointAddress)); |
480 | else | 480 | else |
481 | rc = usb_clear_halt(udev, usb_sndbulkpipe(udev, | 481 | rc = usb_clear_halt(udev, usb_sndbulkpipe(udev, |
482 | intf->cur_altsetting->endpoint[i].desc.bEndpointAddress)); | 482 | intf->cur_altsetting->endpoint[i].desc.bEndpointAddress)); |
483 | } | 483 | } |
484 | if ((udev->actconfig->desc.bNumInterfaces == 2) && | 484 | if ((udev->actconfig->desc.bNumInterfaces == 2) && |
485 | (intf->cur_altsetting->desc.bInterfaceNumber == 0)) { | 485 | (intf->cur_altsetting->desc.bInterfaceNumber == 0)) { |
486 | sms_err("rom interface 0 is not used"); | 486 | sms_err("rom interface 0 is not used"); |
487 | return -ENODEV; | 487 | return -ENODEV; |
488 | } | 488 | } |
489 | 489 | ||
490 | if (id->driver_info == SMS1XXX_BOARD_SIANO_STELLAR_ROM) { | 490 | if (id->driver_info == SMS1XXX_BOARD_SIANO_STELLAR_ROM) { |
491 | sms_info("stellar device was found."); | 491 | sms_info("stellar device was found."); |
492 | snprintf(devpath, sizeof(devpath), "usb\\%d-%s", | 492 | snprintf(devpath, sizeof(devpath), "usb\\%d-%s", |
493 | udev->bus->busnum, udev->devpath); | 493 | udev->bus->busnum, udev->devpath); |
494 | sms_info("stellar device was found."); | 494 | sms_info("stellar device was found."); |
495 | return smsusb1_load_firmware( | 495 | return smsusb1_load_firmware( |
496 | udev, smscore_registry_getmode(devpath), | 496 | udev, smscore_registry_getmode(devpath), |
497 | id->driver_info); | 497 | id->driver_info); |
498 | } | 498 | } |
499 | 499 | ||
500 | rc = smsusb_init_device(intf, id->driver_info); | 500 | rc = smsusb_init_device(intf, id->driver_info); |
501 | sms_info("rc %d", rc); | 501 | sms_info("rc %d", rc); |
502 | sms_board_load_modules(id->driver_info); | 502 | sms_board_load_modules(id->driver_info); |
503 | return rc; | 503 | return rc; |
504 | } | 504 | } |
505 | 505 | ||
506 | static void smsusb_disconnect(struct usb_interface *intf) | 506 | static void smsusb_disconnect(struct usb_interface *intf) |
507 | { | 507 | { |
508 | smsusb_term_device(intf); | 508 | smsusb_term_device(intf); |
509 | } | 509 | } |
510 | 510 | ||
511 | static int smsusb_suspend(struct usb_interface *intf, pm_message_t msg) | 511 | static int smsusb_suspend(struct usb_interface *intf, pm_message_t msg) |
512 | { | 512 | { |
513 | struct smsusb_device_t *dev = usb_get_intfdata(intf); | 513 | struct smsusb_device_t *dev = usb_get_intfdata(intf); |
514 | printk(KERN_INFO "%s Entering status %d.\n", __func__, msg.event); | 514 | printk(KERN_INFO "%s Entering status %d.\n", __func__, msg.event); |
515 | dev->state = SMSUSB_SUSPENDED; | 515 | dev->state = SMSUSB_SUSPENDED; |
516 | /*smscore_set_power_mode(dev, SMS_POWER_MODE_SUSPENDED);*/ | 516 | /*smscore_set_power_mode(dev, SMS_POWER_MODE_SUSPENDED);*/ |
517 | smsusb_stop_streaming(dev); | 517 | smsusb_stop_streaming(dev); |
518 | return 0; | 518 | return 0; |
519 | } | 519 | } |
520 | 520 | ||
521 | static int smsusb_resume(struct usb_interface *intf) | 521 | static int smsusb_resume(struct usb_interface *intf) |
522 | { | 522 | { |
523 | int rc, i; | 523 | int rc, i; |
524 | struct smsusb_device_t *dev = usb_get_intfdata(intf); | 524 | struct smsusb_device_t *dev = usb_get_intfdata(intf); |
525 | struct usb_device *udev = interface_to_usbdev(intf); | 525 | struct usb_device *udev = interface_to_usbdev(intf); |
526 | 526 | ||
527 | printk(KERN_INFO "%s Entering.\n", __func__); | 527 | printk(KERN_INFO "%s Entering.\n", __func__); |
528 | usb_clear_halt(udev, usb_rcvbulkpipe(udev, dev->in_ep)); | 528 | usb_clear_halt(udev, usb_rcvbulkpipe(udev, dev->in_ep)); |
529 | usb_clear_halt(udev, usb_sndbulkpipe(udev, dev->out_ep)); | 529 | usb_clear_halt(udev, usb_sndbulkpipe(udev, dev->out_ep)); |
530 | 530 | ||
531 | for (i = 0; i < intf->cur_altsetting->desc.bNumEndpoints; i++) | 531 | for (i = 0; i < intf->cur_altsetting->desc.bNumEndpoints; i++) |
532 | printk(KERN_INFO "endpoint %d %02x %02x %d\n", i, | 532 | printk(KERN_INFO "endpoint %d %02x %02x %d\n", i, |
533 | intf->cur_altsetting->endpoint[i].desc.bEndpointAddress, | 533 | intf->cur_altsetting->endpoint[i].desc.bEndpointAddress, |
534 | intf->cur_altsetting->endpoint[i].desc.bmAttributes, | 534 | intf->cur_altsetting->endpoint[i].desc.bmAttributes, |
535 | intf->cur_altsetting->endpoint[i].desc.wMaxPacketSize); | 535 | intf->cur_altsetting->endpoint[i].desc.wMaxPacketSize); |
536 | 536 | ||
537 | if (intf->num_altsetting > 0) { | 537 | if (intf->num_altsetting > 0) { |
538 | rc = usb_set_interface(udev, | 538 | rc = usb_set_interface(udev, |
539 | intf->cur_altsetting->desc. | 539 | intf->cur_altsetting->desc. |
540 | bInterfaceNumber, 0); | 540 | bInterfaceNumber, 0); |
541 | if (rc < 0) { | 541 | if (rc < 0) { |
542 | printk(KERN_INFO "%s usb_set_interface failed, " | 542 | printk(KERN_INFO "%s usb_set_interface failed, " |
543 | "rc %d\n", __func__, rc); | 543 | "rc %d\n", __func__, rc); |
544 | return rc; | 544 | return rc; |
545 | } | 545 | } |
546 | } | 546 | } |
547 | 547 | ||
548 | smsusb_start_streaming(dev); | 548 | smsusb_start_streaming(dev); |
549 | return 0; | 549 | return 0; |
550 | } | 550 | } |
551 | 551 | ||
552 | static const struct usb_device_id smsusb_id_table[] = { | 552 | static const struct usb_device_id smsusb_id_table[] = { |
553 | { USB_DEVICE(0x187f, 0x0010), | 553 | { USB_DEVICE(0x187f, 0x0010), |
554 | .driver_info = SMS1XXX_BOARD_SIANO_STELLAR }, | 554 | .driver_info = SMS1XXX_BOARD_SIANO_STELLAR }, |
555 | { USB_DEVICE(0x187f, 0x0100), | 555 | { USB_DEVICE(0x187f, 0x0100), |
556 | .driver_info = SMS1XXX_BOARD_SIANO_STELLAR }, | 556 | .driver_info = SMS1XXX_BOARD_SIANO_STELLAR }, |
557 | { USB_DEVICE(0x187f, 0x0200), | 557 | { USB_DEVICE(0x187f, 0x0200), |
558 | .driver_info = SMS1XXX_BOARD_SIANO_NOVA_A }, | 558 | .driver_info = SMS1XXX_BOARD_SIANO_NOVA_A }, |
559 | { USB_DEVICE(0x187f, 0x0201), | 559 | { USB_DEVICE(0x187f, 0x0201), |
560 | .driver_info = SMS1XXX_BOARD_SIANO_NOVA_B }, | 560 | .driver_info = SMS1XXX_BOARD_SIANO_NOVA_B }, |
561 | { USB_DEVICE(0x187f, 0x0300), | 561 | { USB_DEVICE(0x187f, 0x0300), |
562 | .driver_info = SMS1XXX_BOARD_SIANO_VEGA }, | 562 | .driver_info = SMS1XXX_BOARD_SIANO_VEGA }, |
563 | { USB_DEVICE(0x2040, 0x1700), | 563 | { USB_DEVICE(0x2040, 0x1700), |
564 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_CATAMOUNT }, | 564 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_CATAMOUNT }, |
565 | { USB_DEVICE(0x2040, 0x1800), | 565 | { USB_DEVICE(0x2040, 0x1800), |
566 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_OKEMO_A }, | 566 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_OKEMO_A }, |
567 | { USB_DEVICE(0x2040, 0x1801), | 567 | { USB_DEVICE(0x2040, 0x1801), |
568 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_OKEMO_B }, | 568 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_OKEMO_B }, |
569 | { USB_DEVICE(0x2040, 0x2000), | 569 | { USB_DEVICE(0x2040, 0x2000), |
570 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD }, | 570 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD }, |
571 | { USB_DEVICE(0x2040, 0x2009), | 571 | { USB_DEVICE(0x2040, 0x2009), |
572 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2 }, | 572 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2 }, |
573 | { USB_DEVICE(0x2040, 0x200a), | 573 | { USB_DEVICE(0x2040, 0x200a), |
574 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD }, | 574 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD }, |
575 | { USB_DEVICE(0x2040, 0x2010), | 575 | { USB_DEVICE(0x2040, 0x2010), |
576 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD }, | 576 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD }, |
577 | { USB_DEVICE(0x2040, 0x2011), | 577 | { USB_DEVICE(0x2040, 0x2011), |
578 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD }, | 578 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD }, |
579 | { USB_DEVICE(0x2040, 0x2019), | 579 | { USB_DEVICE(0x2040, 0x2019), |
580 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD }, | 580 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD }, |
581 | { USB_DEVICE(0x2040, 0x5500), | 581 | { USB_DEVICE(0x2040, 0x5500), |
582 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, | 582 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, |
583 | { USB_DEVICE(0x2040, 0x5510), | 583 | { USB_DEVICE(0x2040, 0x5510), |
584 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, | 584 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, |
585 | { USB_DEVICE(0x2040, 0x5520), | 585 | { USB_DEVICE(0x2040, 0x5520), |
586 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, | 586 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, |
587 | { USB_DEVICE(0x2040, 0x5530), | 587 | { USB_DEVICE(0x2040, 0x5530), |
588 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, | 588 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, |
589 | { USB_DEVICE(0x2040, 0x5580), | 589 | { USB_DEVICE(0x2040, 0x5580), |
590 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, | 590 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, |
591 | { USB_DEVICE(0x2040, 0x5590), | 591 | { USB_DEVICE(0x2040, 0x5590), |
592 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, | 592 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, |
593 | { USB_DEVICE(0x187f, 0x0202), | 593 | { USB_DEVICE(0x187f, 0x0202), |
594 | .driver_info = SMS1XXX_BOARD_SIANO_NICE }, | 594 | .driver_info = SMS1XXX_BOARD_SIANO_NICE }, |
595 | { USB_DEVICE(0x187f, 0x0301), | 595 | { USB_DEVICE(0x187f, 0x0301), |
596 | .driver_info = SMS1XXX_BOARD_SIANO_VENICE }, | 596 | .driver_info = SMS1XXX_BOARD_SIANO_VENICE }, |
597 | { USB_DEVICE(0x2040, 0xb900), | 597 | { USB_DEVICE(0x2040, 0xb900), |
598 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, | 598 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, |
599 | { USB_DEVICE(0x2040, 0xb910), | 599 | { USB_DEVICE(0x2040, 0xb910), |
600 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, | 600 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, |
601 | { USB_DEVICE(0x2040, 0xb980), | 601 | { USB_DEVICE(0x2040, 0xb980), |
602 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, | 602 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, |
603 | { USB_DEVICE(0x2040, 0xb990), | 603 | { USB_DEVICE(0x2040, 0xb990), |
604 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, | 604 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, |
605 | { USB_DEVICE(0x2040, 0xc000), | 605 | { USB_DEVICE(0x2040, 0xc000), |
606 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, | 606 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, |
607 | { USB_DEVICE(0x2040, 0xc010), | 607 | { USB_DEVICE(0x2040, 0xc010), |
608 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, | 608 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, |
609 | { USB_DEVICE(0x2040, 0xc080), | 609 | { USB_DEVICE(0x2040, 0xc080), |
610 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, | 610 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, |
611 | { USB_DEVICE(0x2040, 0xc090), | 611 | { USB_DEVICE(0x2040, 0xc090), |
612 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, | 612 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, |
613 | { USB_DEVICE(0x2040, 0xc0a0), | 613 | { USB_DEVICE(0x2040, 0xc0a0), |
614 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, | 614 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, |
615 | { USB_DEVICE(0x2040, 0xf5a0), | 615 | { USB_DEVICE(0x2040, 0xf5a0), |
616 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, | 616 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, |
617 | { USB_DEVICE(0x187f, 0x0202), | 617 | { USB_DEVICE(0x187f, 0x0202), |
618 | .driver_info = SMS1XXX_BOARD_SIANO_NICE }, | 618 | .driver_info = SMS1XXX_BOARD_SIANO_NICE }, |
619 | { USB_DEVICE(0x187f, 0x0301), | 619 | { USB_DEVICE(0x187f, 0x0301), |
620 | .driver_info = SMS1XXX_BOARD_SIANO_VENICE }, | 620 | .driver_info = SMS1XXX_BOARD_SIANO_VENICE }, |
621 | { USB_DEVICE(0x187f, 0x0302), | 621 | { USB_DEVICE(0x187f, 0x0302), |
622 | .driver_info = SMS1XXX_BOARD_SIANO_VENICE }, | 622 | .driver_info = SMS1XXX_BOARD_SIANO_VENICE }, |
623 | { USB_DEVICE(0x187f, 0x0310), | 623 | { USB_DEVICE(0x187f, 0x0310), |
624 | .driver_info = SMS1XXX_BOARD_SIANO_MING }, | 624 | .driver_info = SMS1XXX_BOARD_SIANO_MING }, |
625 | { USB_DEVICE(0x187f, 0x0500), | 625 | { USB_DEVICE(0x187f, 0x0500), |
626 | .driver_info = SMS1XXX_BOARD_SIANO_PELE }, | 626 | .driver_info = SMS1XXX_BOARD_SIANO_PELE }, |
627 | { USB_DEVICE(0x187f, 0x0600), | 627 | { USB_DEVICE(0x187f, 0x0600), |
628 | .driver_info = SMS1XXX_BOARD_SIANO_RIO }, | 628 | .driver_info = SMS1XXX_BOARD_SIANO_RIO }, |
629 | { USB_DEVICE(0x187f, 0x0700), | 629 | { USB_DEVICE(0x187f, 0x0700), |
630 | .driver_info = SMS1XXX_BOARD_SIANO_DENVER_2160 }, | 630 | .driver_info = SMS1XXX_BOARD_SIANO_DENVER_2160 }, |
631 | { USB_DEVICE(0x187f, 0x0800), | 631 | { USB_DEVICE(0x187f, 0x0800), |
632 | .driver_info = SMS1XXX_BOARD_SIANO_DENVER_1530 }, | 632 | .driver_info = SMS1XXX_BOARD_SIANO_DENVER_1530 }, |
633 | { USB_DEVICE(0x19D2, 0x0086), | 633 | { USB_DEVICE(0x19D2, 0x0086), |
634 | .driver_info = SMS1XXX_BOARD_ZTE_DVB_DATA_CARD }, | 634 | .driver_info = SMS1XXX_BOARD_ZTE_DVB_DATA_CARD }, |
635 | { USB_DEVICE(0x19D2, 0x0078), | 635 | { USB_DEVICE(0x19D2, 0x0078), |
636 | .driver_info = SMS1XXX_BOARD_ONDA_MDTV_DATA_CARD }, | 636 | .driver_info = SMS1XXX_BOARD_ONDA_MDTV_DATA_CARD }, |
637 | { } /* Terminating entry */ | 637 | { } /* Terminating entry */ |
638 | }; | 638 | }; |
639 | 639 | ||
640 | MODULE_DEVICE_TABLE(usb, smsusb_id_table); | 640 | MODULE_DEVICE_TABLE(usb, smsusb_id_table); |
641 | 641 | ||
642 | static struct usb_driver smsusb_driver = { | 642 | static struct usb_driver smsusb_driver = { |
643 | .name = "smsusb", | 643 | .name = "smsusb", |
644 | .probe = smsusb_probe, | 644 | .probe = smsusb_probe, |
645 | .disconnect = smsusb_disconnect, | 645 | .disconnect = smsusb_disconnect, |
646 | .id_table = smsusb_id_table, | 646 | .id_table = smsusb_id_table, |
647 | 647 | ||
648 | .suspend = smsusb_suspend, | 648 | .suspend = smsusb_suspend, |
649 | .resume = smsusb_resume, | 649 | .resume = smsusb_resume, |
650 | }; | 650 | }; |
651 | 651 | ||
652 | module_usb_driver(smsusb_driver); | 652 | module_usb_driver(smsusb_driver); |
653 | 653 | ||
654 | MODULE_DESCRIPTION("Driver for the Siano SMS1xxx USB dongle"); | 654 | MODULE_DESCRIPTION("Driver for the Siano SMS1xxx USB dongle"); |
655 | MODULE_AUTHOR("Siano Mobile Silicon, INC. (uris@siano-ms.com)"); | 655 | MODULE_AUTHOR("Siano Mobile Silicon, INC. (uris@siano-ms.com)"); |
656 | MODULE_LICENSE("GPL"); | 656 | MODULE_LICENSE("GPL"); |
657 | 657 |